Curl_altsvc_init:
  319|  17.2k|{
  320|  17.2k|  struct altsvcinfo *asi = curlx_calloc(1, sizeof(struct altsvcinfo));
  ------------------
  |  | 1480|  17.2k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  321|  17.2k|  if(!asi)
  ------------------
  |  Branch (321:6): [True: 0, False: 17.2k]
  ------------------
  322|      0|    return NULL;
  323|  17.2k|  Curl_llist_init(&asi->list, NULL);
  324|       |
  325|       |  /* set default behavior */
  326|  17.2k|  asi->flags = CURLALTSVC_H1
  ------------------
  |  | 1035|  17.2k|#define CURLALTSVC_H1           (1L << 3)
  ------------------
  327|  17.2k|#ifdef USE_HTTP2
  328|  17.2k|    | CURLALTSVC_H2
  ------------------
  |  | 1036|  17.2k|#define CURLALTSVC_H2           (1L << 4)
  ------------------
  329|  17.2k|#endif
  330|       |#ifdef USE_HTTP3
  331|       |    | CURLALTSVC_H3
  332|       |#endif
  333|  17.2k|    ;
  334|  17.2k|  return asi;
  335|  17.2k|}
Curl_altsvc_load:
  341|  17.2k|{
  342|  17.2k|  DEBUGASSERT(asi);
  ------------------
  |  | 1081|  17.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (342:3): [True: 0, False: 17.2k]
  |  Branch (342:3): [True: 17.2k, False: 0]
  ------------------
  343|  17.2k|  return altsvc_load(asi, file);
  344|  17.2k|}
Curl_altsvc_ctrl:
  350|     40|{
  351|     40|  DEBUGASSERT(data);
  ------------------
  |  | 1081|     40|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (351:3): [True: 0, False: 40]
  |  Branch (351:3): [True: 40, False: 0]
  ------------------
  352|     40|  if(!ctrl)
  ------------------
  |  Branch (352:6): [True: 1, False: 39]
  ------------------
  353|      1|    return CURLE_BAD_FUNCTION_ARGUMENT;
  354|       |
  355|     39|  if(!data->asi) {
  ------------------
  |  Branch (355:6): [True: 39, False: 0]
  ------------------
  356|     39|    data->asi = Curl_altsvc_init();
  357|     39|    if(!data->asi)
  ------------------
  |  Branch (357:8): [True: 0, False: 39]
  ------------------
  358|      0|      return CURLE_OUT_OF_MEMORY;
  359|     39|  }
  360|     39|  data->asi->flags = ctrl;
  361|     39|  return CURLE_OK;
  362|     39|}
Curl_altsvc_cleanup:
  369|  36.6k|{
  370|  36.6k|  if(*asi) {
  ------------------
  |  Branch (370:6): [True: 17.2k, False: 19.4k]
  ------------------
  371|  17.2k|    struct Curl_llist_node *e;
  372|  17.2k|    struct Curl_llist_node *n;
  373|  17.2k|    struct altsvcinfo *altsvc = *asi;
  374|  17.2k|    for(e = Curl_llist_head(&altsvc->list); e; e = n) {
  ------------------
  |  Branch (374:45): [True: 0, False: 17.2k]
  ------------------
  375|      0|      struct altsvc *as = Curl_node_elem(e);
  376|      0|      n = Curl_node_next(e);
  377|      0|      altsvc_free(as);
  ------------------
  |  |   81|      0|#define altsvc_free(x) curlx_free(x)
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
  378|      0|    }
  379|  17.2k|    curlx_free(altsvc->filename);
  ------------------
  |  | 1483|  17.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  380|  17.2k|    curlx_free(altsvc);
  ------------------
  |  | 1483|  17.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  381|       |    *asi = NULL; /* clear the pointer */
  382|  17.2k|  }
  383|  36.6k|}
Curl_altsvc_save:
  390|  36.6k|{
  391|  36.6k|  CURLcode result = CURLE_OK;
  392|  36.6k|  FILE *out;
  393|  36.6k|  char *tempstore = NULL;
  394|       |
  395|  36.6k|  if(!asi)
  ------------------
  |  Branch (395:6): [True: 19.4k, False: 17.2k]
  ------------------
  396|       |    /* no cache activated */
  397|  19.4k|    return CURLE_OK;
  398|       |
  399|       |  /* if not new name is given, use the one we stored from the load */
  400|  17.2k|  if(!file && asi->filename)
  ------------------
  |  Branch (400:6): [True: 7, False: 17.2k]
  |  Branch (400:15): [True: 0, False: 7]
  ------------------
  401|      0|    file = asi->filename;
  402|       |
  403|  17.2k|  if((asi->flags & CURLALTSVC_READONLYFILE) || !file || !file[0])
  ------------------
  |  | 1034|  17.2k|#define CURLALTSVC_READONLYFILE (1L << 2)
  ------------------
  |  Branch (403:6): [True: 22, False: 17.1k]
  |  Branch (403:48): [True: 6, False: 17.1k]
  |  Branch (403:57): [True: 0, False: 17.1k]
  ------------------
  404|       |    /* marked as read-only, no file or zero length filename */
  405|     28|    return CURLE_OK;
  406|       |
  407|  17.1k|  result = Curl_fopen(data, file, &out, &tempstore);
  408|  17.1k|  if(!result) {
  ------------------
  |  Branch (408:6): [True: 17.1k, False: 0]
  ------------------
  409|  17.1k|    struct Curl_llist_node *e;
  410|  17.1k|    struct Curl_llist_node *n;
  411|  17.1k|    fputs("# Your alt-svc cache. https://curl.se/docs/alt-svc.html\n"
  412|  17.1k|          "# This file was generated by libcurl! Edit at your own risk.\n",
  413|  17.1k|          out);
  414|  17.1k|    for(e = Curl_llist_head(&asi->list); e; e = n) {
  ------------------
  |  Branch (414:42): [True: 0, False: 17.1k]
  ------------------
  415|      0|      struct altsvc *as = Curl_node_elem(e);
  416|      0|      n = Curl_node_next(e);
  417|      0|      result = altsvc_out(as, out);
  418|      0|      if(result)
  ------------------
  |  Branch (418:10): [True: 0, False: 0]
  ------------------
  419|      0|        break;
  420|      0|    }
  421|  17.1k|    curlx_fclose(out);
  ------------------
  |  |   79|  17.1k|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
  422|  17.1k|    if(!result && tempstore && curlx_rename(tempstore, file))
  ------------------
  |  |   70|      0|#define curlx_rename            rename
  ------------------
  |  Branch (422:8): [True: 17.1k, False: 0]
  |  Branch (422:19): [True: 0, False: 17.1k]
  |  Branch (422:32): [True: 0, False: 0]
  ------------------
  423|      0|      result = CURLE_WRITE_ERROR;
  424|       |
  425|  17.1k|    if(result && tempstore)
  ------------------
  |  Branch (425:8): [True: 0, False: 17.1k]
  |  Branch (425:18): [True: 0, False: 0]
  ------------------
  426|      0|      unlink(tempstore);
  427|  17.1k|  }
  428|  17.1k|  curlx_free(tempstore);
  ------------------
  |  | 1483|  17.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  429|  17.1k|  return result;
  430|  17.2k|}
altsvc.c:altsvc_load:
  232|  17.2k|{
  233|  17.2k|  CURLcode result = CURLE_OK;
  234|  17.2k|  FILE *fp;
  235|       |
  236|       |  /* we need a private copy of the filename so that the altsvc cache file
  237|       |     name survives an easy handle reset */
  238|  17.2k|  curlx_free(asi->filename);
  ------------------
  |  | 1483|  17.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  239|  17.2k|  asi->filename = curlx_strdup(file);
  ------------------
  |  | 1477|  17.2k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  240|  17.2k|  if(!asi->filename)
  ------------------
  |  Branch (240:6): [True: 0, False: 17.2k]
  ------------------
  241|      0|    return CURLE_OUT_OF_MEMORY;
  242|       |
  243|  17.2k|  fp = curlx_fopen(file, FOPEN_READTEXT);
  ------------------
  |  |   74|  17.2k|#define curlx_fopen(file, mode) curl_dbg_fopen(file, mode, __LINE__, __FILE__)
  ------------------
  244|  17.2k|  if(fp) {
  ------------------
  |  Branch (244:6): [True: 17.2k, False: 0]
  ------------------
  245|  17.2k|    curlx_struct_stat stat;
  ------------------
  |  |   63|  17.2k|#define curlx_struct_stat       struct stat
  ------------------
  246|  17.2k|    if((curlx_fstat(fileno(fp), &stat) == -1) || !S_ISDIR(stat.st_mode)) {
  ------------------
  |  |   62|  17.2k|#define curlx_fstat             fstat
  ------------------
  |  Branch (246:8): [True: 0, False: 17.2k]
  |  Branch (246:50): [True: 17.2k, False: 0]
  ------------------
  247|  17.2k|      bool eof = FALSE;
  ------------------
  |  | 1058|  17.2k|#define FALSE false
  ------------------
  248|  17.2k|      struct dynbuf buf;
  249|  17.2k|      curlx_dyn_init(&buf, MAX_ALTSVC_LINE);
  ------------------
  |  |   41|  17.2k|#define MAX_ALTSVC_LINE    4095
  ------------------
  250|  17.2k|      do {
  251|  17.2k|        result = Curl_get_line(&buf, fp, &eof);
  252|  17.2k|        if(!result) {
  ------------------
  |  Branch (252:12): [True: 17.2k, False: 0]
  ------------------
  253|  17.2k|          const char *lineptr = curlx_dyn_ptr(&buf);
  254|  17.2k|          curlx_str_passblanks(&lineptr);
  255|  17.2k|          if(curlx_str_single(&lineptr, '#'))
  ------------------
  |  Branch (255:14): [True: 17.2k, False: 0]
  ------------------
  256|  17.2k|            altsvc_add(asi, lineptr);
  257|  17.2k|        }
  258|  17.2k|      } while(!result && !eof);
  ------------------
  |  Branch (258:15): [True: 17.2k, False: 0]
  |  Branch (258:26): [True: 0, False: 17.2k]
  ------------------
  259|  17.2k|      curlx_dyn_free(&buf); /* free the line buffer */
  260|  17.2k|    }
  261|  17.2k|    curlx_fclose(fp);
  ------------------
  |  |   79|  17.2k|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
  262|  17.2k|  }
  263|  17.2k|  return result;
  264|  17.2k|}
altsvc.c:altsvc_add:
  163|  17.2k|{
  164|       |  /* Example line:
  165|       |     h2 example.com 443 h3 shiny.example.com 8443 "20191231 10:00:00" 1
  166|       |   */
  167|  17.2k|  struct Curl_str srchost;
  168|  17.2k|  struct Curl_str dsthost;
  169|  17.2k|  struct Curl_str srcalpn;
  170|  17.2k|  struct Curl_str dstalpn;
  171|  17.2k|  struct Curl_str date;
  172|  17.2k|  curl_off_t srcport;
  173|  17.2k|  curl_off_t dstport;
  174|  17.2k|  curl_off_t persist;
  175|  17.2k|  curl_off_t prio;
  176|       |
  177|  17.2k|  if(curlx_str_word(&line, &srcalpn, MAX_ALTSVC_ALPNLEN) ||
  ------------------
  |  |   44|  17.2k|#define MAX_ALTSVC_ALPNLEN 10
  ------------------
  |  Branch (177:6): [True: 0, False: 17.2k]
  ------------------
  178|  17.2k|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (178:6): [True: 17.2k, False: 0]
  ------------------
  179|      0|     curlx_str_word(&line, &srchost, MAX_ALTSVC_HOSTLEN) ||
  ------------------
  |  |   43|      0|#define MAX_ALTSVC_HOSTLEN 2048
  ------------------
  |  Branch (179:6): [True: 0, False: 0]
  ------------------
  180|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (180:6): [True: 0, False: 0]
  ------------------
  181|      0|     curlx_str_number(&line, &srcport, 65535) ||
  ------------------
  |  Branch (181:6): [True: 0, False: 0]
  ------------------
  182|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (182:6): [True: 0, False: 0]
  ------------------
  183|      0|     curlx_str_word(&line, &dstalpn, MAX_ALTSVC_ALPNLEN) ||
  ------------------
  |  |   44|      0|#define MAX_ALTSVC_ALPNLEN 10
  ------------------
  |  Branch (183:6): [True: 0, False: 0]
  ------------------
  184|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (184:6): [True: 0, False: 0]
  ------------------
  185|      0|     curlx_str_word(&line, &dsthost, MAX_ALTSVC_HOSTLEN) ||
  ------------------
  |  |   43|      0|#define MAX_ALTSVC_HOSTLEN 2048
  ------------------
  |  Branch (185:6): [True: 0, False: 0]
  ------------------
  186|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (186:6): [True: 0, False: 0]
  ------------------
  187|      0|     curlx_str_number(&line, &dstport, 65535) ||
  ------------------
  |  Branch (187:6): [True: 0, False: 0]
  ------------------
  188|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (188:6): [True: 0, False: 0]
  ------------------
  189|      0|     curlx_str_quotedword(&line, &date, MAX_ALTSVC_DATELEN) ||
  ------------------
  |  |   42|      0|#define MAX_ALTSVC_DATELEN 17
  ------------------
  |  Branch (189:6): [True: 0, False: 0]
  ------------------
  190|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (190:6): [True: 0, False: 0]
  ------------------
  191|      0|     curlx_str_number(&line, &persist, 1) ||
  ------------------
  |  Branch (191:6): [True: 0, False: 0]
  ------------------
  192|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (192:6): [True: 0, False: 0]
  ------------------
  193|      0|     curlx_str_number(&line, &prio, 0) ||
  ------------------
  |  Branch (193:6): [True: 0, False: 0]
  ------------------
  194|      0|     curlx_str_newline(&line))
  ------------------
  |  Branch (194:6): [True: 0, False: 0]
  ------------------
  195|  17.2k|    ;
  196|      0|  else {
  197|      0|    char dbuf[MAX_ALTSVC_DATELEN + 1];
  198|      0|    time_t expires = 0;
  199|      0|    time_t now = time(NULL);
  ------------------
  |  |   63|      0|#define time(x) altsvc_debugtime(x)
  ------------------
  200|       |
  201|       |    /* The date parser works on a null-terminated string. The maximum length
  202|       |       is upheld by curlx_str_quotedword(). */
  203|      0|    memcpy(dbuf, curlx_str(&date), curlx_strlen(&date));
  ------------------
  |  |   49|      0|#define curlx_str(x)    ((x)->str)
  ------------------
                  memcpy(dbuf, curlx_str(&date), curlx_strlen(&date));
  ------------------
  |  |   50|      0|#define curlx_strlen(x) ((x)->len)
  ------------------
  204|      0|    dbuf[curlx_strlen(&date)] = 0;
  ------------------
  |  |   50|      0|#define curlx_strlen(x) ((x)->len)
  ------------------
  205|      0|    Curl_getdate_capped(dbuf, &expires);
  206|       |
  207|      0|    if(now < expires) {
  ------------------
  |  Branch (207:8): [True: 0, False: 0]
  ------------------
  208|      0|      struct altsvc *as = altsvc_create(&srchost, &dsthost, &srcalpn, &dstalpn,
  209|      0|                                        (size_t)srcport, (size_t)dstport);
  210|      0|      if(as) {
  ------------------
  |  Branch (210:10): [True: 0, False: 0]
  ------------------
  211|      0|        as->expires = expires;
  212|      0|        as->persist = persist ? 1 : 0;
  ------------------
  |  Branch (212:23): [True: 0, False: 0]
  ------------------
  213|      0|        altsvc_append(asi, as);
  214|      0|      }
  215|      0|      else
  216|      0|        return CURLE_OUT_OF_MEMORY;
  217|      0|    }
  218|      0|  }
  219|       |
  220|  17.2k|  return CURLE_OK;
  221|  17.2k|}

Curl_async_timeleft_ms:
   60|   149k|{
   61|   149k|  if(async->timeout_ms) {
  ------------------
  |  Branch (61:6): [True: 149k, False: 0]
  ------------------
   62|   149k|    timediff_t elapsed_ms =
   63|   149k|      curlx_ptimediff_ms(Curl_pgrs_now(data), &async->start);
   64|   149k|    return async->timeout_ms - elapsed_ms;
   65|   149k|  }
   66|      0|  return Curl_timeleft_ms(data);
   67|   149k|}
Curl_async_shutdown:
  210|    602|{
  211|    602|  if(async) {
  ------------------
  |  Branch (211:6): [True: 602, False: 0]
  ------------------
  212|    602|    CURL_TRC_DNS(data, "[%u] shutdown async", async->id);
  ------------------
  |  |  168|    602|  do {                                 \
  |  |  169|    602|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|    602|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|    602|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  1.20k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 602, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 602]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  1.20k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|    602|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|    602|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|    602|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 602]
  |  |  ------------------
  ------------------
  213|    602|    async->shutdown = TRUE;
  ------------------
  |  | 1055|    602|#define TRUE true
  ------------------
  214|       |#ifdef USE_RESOLV_ARES
  215|       |    Curl_async_ares_shutdown(data, async);
  216|       |#endif
  217|    602|#ifdef USE_RESOLV_THREADED
  218|    602|    Curl_async_thrdd_shutdown(data, async);
  219|    602|#endif
  220|    602|#ifndef CURL_DISABLE_DOH
  221|    602|    Curl_doh_cleanup(data, async);
  222|    602|#endif
  223|    602|  }
  224|    602|}
Curl_async_destroy:
  228|    688|{
  229|    688|  if(async) {
  ------------------
  |  Branch (229:6): [True: 688, False: 0]
  ------------------
  230|    688|    CURL_TRC_DNS(data, "[%u] destroy async", async->id);
  ------------------
  |  |  168|    688|  do {                                 \
  |  |  169|    688|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|    688|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|    688|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  1.37k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 688, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 688]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  1.37k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|    688|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|    688|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|    688|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 688]
  |  |  ------------------
  ------------------
  231|    688|    async->shutdown = TRUE;
  ------------------
  |  | 1055|    688|#define TRUE true
  ------------------
  232|       |#ifdef USE_RESOLV_ARES
  233|       |    Curl_async_ares_destroy(data, async);
  234|       |#endif
  235|    688|#ifdef USE_RESOLV_THREADED
  236|    688|    Curl_async_thrdd_destroy(data, async);
  237|    688|#endif
  238|    688|#ifndef CURL_DISABLE_DOH
  239|    688|    Curl_doh_cleanup(data, async);
  240|    688|#endif
  241|       |    curlx_safefree(async);
  ------------------
  |  | 1327|    688|  do {                      \
  |  | 1328|    688|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|    688|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|    688|    (ptr) = NULL;           \
  |  | 1330|    688|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 688]
  |  |  ------------------
  ------------------
  242|    688|  }
  243|    688|}
Curl_async_failed:
  248|    626|{
  249|    626|  const char *host_or_proxy = "host";
  250|    626|  CURLcode result = CURLE_COULDNT_RESOLVE_HOST;
  251|       |
  252|    626|#ifndef CURL_DISABLE_PROXY
  253|    626|  if(async->for_proxy) {
  ------------------
  |  Branch (253:6): [True: 248, False: 378]
  ------------------
  254|    248|    host_or_proxy = "proxy";
  255|    248|    result = CURLE_COULDNT_RESOLVE_PROXY;
  256|    248|  }
  257|    626|#endif
  258|       |
  259|    626|  failf(data, "Could not resolve %s: %s%s%s%s",
  ------------------
  |  |   62|    626|#define failf Curl_failf
  ------------------
  260|    626|        host_or_proxy, async->hostname,
  261|    626|        detail ? " (" : "", detail ? detail : "", detail ? ")" : "");
  ------------------
  |  Branch (261:9): [True: 0, False: 626]
  |  Branch (261:29): [True: 0, False: 626]
  |  Branch (261:51): [True: 0, False: 626]
  ------------------
  262|    626|  return result;
  263|    626|}

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_thrdd_shutdown:
  256|    856|{
  257|    856|  Curl_async_thrdd_destroy(data, async);
  258|    856|}
Curl_async_thrdd_destroy:
  274|  1.54k|{
  275|  1.54k|  (void)data;
  276|  1.54k|  if(async->queries_ongoing && !async->done &&
  ------------------
  |  Branch (276:6): [True: 196, False: 1.34k]
  |  Branch (276:32): [True: 196, False: 0]
  ------------------
  277|    196|     data->multi && data->multi->resolv_thrdq) {
  ------------------
  |  Branch (277:6): [True: 98, False: 98]
  |  Branch (277:21): [True: 98, False: 0]
  ------------------
  278|       |    /* Remove any resolve items still queued */
  279|     98|    struct async_thrdd_match_ctx mctx;
  280|     98|    mctx.mid = data->mid;
  281|     98|    mctx.resolv_id = async->id;
  282|     98|    Curl_thrdq_clear(data->multi->resolv_thrdq,
  283|     98|                     async_thrdd_match_item, &mctx);
  284|     98|  }
  285|       |#ifdef USE_HTTPSRR_ARES
  286|       |  if(async->thrdd.rr.channel) {
  287|       |    ares_destroy(async->thrdd.rr.channel);
  288|       |    async->thrdd.rr.channel = NULL;
  289|       |  }
  290|       |  Curl_httpsrr_cleanup(&async->thrdd.rr.hinfo);
  291|       |#endif
  292|  1.54k|  async_thrdd_item_destroy(async->thrdd.res_A);
  293|  1.54k|  async->thrdd.res_A = NULL;
  294|  1.54k|  async_thrdd_item_destroy(async->thrdd.res_AAAA);
  295|       |  async->thrdd.res_AAAA = NULL;
  296|  1.54k|}
Curl_async_await:
  304|     77|{
  305|     77|  struct Curl_resolv_async *async = Curl_async_get(data, resolv_id);
  306|     77|  struct async_thrdd_ctx *thrdd = async ? &async->thrdd : NULL;
  ------------------
  |  Branch (306:35): [True: 77, False: 0]
  ------------------
  307|     77|  timediff_t milli, ms;
  308|       |
  309|     77|  if(!thrdd)
  ------------------
  |  Branch (309:6): [True: 0, False: 77]
  ------------------
  310|      0|    return CURLE_FAILED_INIT;
  311|       |
  312|   294k|  while(async->queries_ongoing && !async->done) {
  ------------------
  |  Branch (312:9): [True: 294k, False: 0]
  |  Branch (312:35): [True: 294k, False: 0]
  ------------------
  313|   294k|    Curl_async_thrdd_multi_process(data->multi);
  314|   294k|    if(async->done)
  ------------------
  |  Branch (314:8): [True: 77, False: 294k]
  ------------------
  315|     77|      break;
  316|       |
  317|   294k|    ms = curlx_ptimediff_ms(Curl_pgrs_now(data), &async->start);
  318|   294k|    if(ms < 3)
  ------------------
  |  Branch (318:8): [True: 294k, False: 58]
  ------------------
  319|   294k|      milli = 0;
  320|     58|    else if(ms <= 50)
  ------------------
  |  Branch (320:13): [True: 58, False: 0]
  ------------------
  321|     58|      milli = ms / 3;
  322|      0|    else if(ms <= 250)
  ------------------
  |  Branch (322:13): [True: 0, False: 0]
  ------------------
  323|      0|      milli = 50;
  324|      0|    else
  325|      0|      milli = 200;
  326|   294k|    CURL_TRC_DNS(data, "await, waiting %" FMT_TIMEDIFF_T "ms", milli);
  ------------------
  |  |  168|   294k|  do {                                 \
  |  |  169|   294k|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|   294k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|   294k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|   588k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 294k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 294k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|   588k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|   294k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|   294k|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|   294k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 294k]
  |  |  ------------------
  ------------------
  327|   294k|    curlx_wait_ms(milli);
  328|   294k|  }
  329|     77|  return Curl_async_take_result(data, async, pdns);
  330|     77|}
Curl_async_thrdd_multi_init:
  439|  17.2k|{
  440|  17.2k|  CURLcode result;
  441|  17.2k|  DEBUGASSERT(!multi->resolv_thrdq);
  ------------------
  |  | 1081|  17.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (441:3): [True: 0, False: 17.2k]
  |  Branch (441:3): [True: 17.2k, False: 0]
  ------------------
  442|  17.2k|  result = Curl_thrdq_create(&multi->resolv_thrdq, "DNS", 0,
  443|  17.2k|                             min_threads, max_threads, idle_time_ms,
  444|  17.2k|                             async_thrdd_item_free,
  445|  17.2k|                             async_thrdd_item_process,
  446|  17.2k|                             async_thrdd_event,
  447|  17.2k|                             multi);
  448|  17.2k|#ifdef DEBUGBUILD
  449|  17.2k|  if(!result) {
  ------------------
  |  Branch (449:6): [True: 17.2k, False: 0]
  ------------------
  450|  17.2k|    const char *p = getenv("CURL_DBG_RESOLV_MAX_THREADS");
  451|  17.2k|    if(p) {
  ------------------
  |  Branch (451:8): [True: 0, False: 17.2k]
  ------------------
  452|      0|      curl_off_t l;
  453|      0|      if(!curlx_str_number(&p, &l, UINT32_MAX)) {
  ------------------
  |  Branch (453:10): [True: 0, False: 0]
  ------------------
  454|      0|        result = Curl_async_thrdd_multi_set_props(
  455|      0|          multi, min_threads, (uint32_t)l, idle_time_ms);
  456|      0|      }
  457|      0|    }
  458|  17.2k|  }
  459|  17.2k|#endif
  460|  17.2k|  return result;
  461|  17.2k|}
Curl_async_thrdd_multi_destroy:
  465|  17.2k|{
  466|  17.2k|  if(multi->resolv_thrdq) {
  ------------------
  |  Branch (466:6): [True: 17.2k, False: 0]
  ------------------
  467|  17.2k|#ifdef CURLVERBOSE
  468|  17.2k|    CURL_TRC_DNS(multi->admin, "destroy thread queue+pool, join=%d", join);
  ------------------
  |  |  168|  17.2k|  do {                                 \
  |  |  169|  17.2k|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|  17.2k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  17.2k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  34.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 17.2k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 17.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  34.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  17.2k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  17.2k|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|  17.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 17.2k]
  |  |  ------------------
  ------------------
  469|  17.2k|    Curl_thrdq_trace(multi->resolv_thrdq, multi->admin);
  470|  17.2k|#endif
  471|  17.2k|    Curl_thrdq_destroy(multi->resolv_thrdq, join);
  472|       |    multi->resolv_thrdq = NULL;
  473|  17.2k|  }
  474|  17.2k|}
Curl_async_thrdd_multi_process:
  516|  3.81M|{
  517|  3.81M|  struct Curl_easy *data;
  518|  3.81M|  void *qitem;
  519|       |
  520|  3.81M|  while(!Curl_thrdq_recv(multi->resolv_thrdq, &qitem)) {
  ------------------
  |  Branch (520:9): [True: 456, False: 3.81M]
  ------------------
  521|       |    /* dispatch resolve result */
  522|    456|    struct async_thrdd_item *item = qitem;
  523|    456|    struct Curl_resolv_async *async = NULL;
  524|       |
  525|    456|    data = Curl_multi_get_easy(multi, item->mid);
  526|    456|    if(data)
  ------------------
  |  Branch (526:8): [True: 456, False: 0]
  ------------------
  527|    456|      async = Curl_async_get(data, item->resolv_id);
  528|    456|    if(async) {
  ------------------
  |  Branch (528:8): [True: 456, False: 0]
  ------------------
  529|    456|      struct async_thrdd_item **pdest = &async->thrdd.res_A;
  530|       |
  531|    456|      async->dns_responses |= item->dns_queries;
  532|    456|      --async->queries_ongoing;
  533|    456|      async->done = !async->queries_ongoing;
  534|       |
  535|    456|#ifdef CURLRES_IPV6
  536|    456|      if(item->dns_queries & CURL_DNSQ_AAAA)
  ------------------
  |  |   52|    456|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (536:10): [True: 175, False: 281]
  ------------------
  537|    175|        pdest = &async->thrdd.res_AAAA;
  538|    456|#endif
  539|    456|      if(!*pdest) {
  ------------------
  |  Branch (539:10): [True: 456, False: 0]
  ------------------
  540|    456|        VERBOSE(async_thrdd_report_item(data, item));
  ------------------
  |  | 1618|    456|#define VERBOSE(x) x
  ------------------
  541|    456|        *pdest = item;
  542|    456|        item = NULL;
  543|    456|      }
  544|      0|      else
  545|    456|        DEBUGASSERT(0); /* should not receive duplicates here */
  ------------------
  |  | 1081|    456|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (545:9): [Folded, False: 0]
  |  Branch (545:9): [Folded, False: 0]
  ------------------
  546|    456|      Curl_multi_mark_dirty(data);
  547|    456|    }
  548|    456|    async_thrdd_item_free(item);
  549|    456|  }
  550|  3.81M|#ifdef CURLVERBOSE
  551|  3.81M|  Curl_thrdq_trace(multi->resolv_thrdq, multi->admin);
  552|  3.81M|#endif
  553|  3.81M|}
Curl_async_getaddrinfo:
  594|    352|{
  595|    352|  CURLcode result = CURLE_FAILED_INIT;
  596|    352|  void *resolver = NULL;
  597|       |
  598|    352|  if(async->queries_ongoing || async->done)
  ------------------
  |  Branch (598:6): [True: 0, False: 352]
  |  Branch (598:32): [True: 0, False: 352]
  ------------------
  599|      0|    return CURLE_FAILED_INIT;
  600|       |
  601|       |#ifdef USE_HTTPSRR_ARES
  602|       |  DEBUGASSERT(!async->thrdd.rr.channel);
  603|       |  if((async->dns_queries & CURL_DNSQ_HTTPS) && !async->is_ipaddr) {
  604|       |    result = async_rr_start(data, async);
  605|       |    if(result)
  606|       |      goto out;
  607|       |    resolver = async->thrdd.rr.channel;
  608|       |  }
  609|       |#endif
  610|       |
  611|    352|  result = Curl_resolv_announce_start(data, resolver);
  612|    352|  if(result)
  ------------------
  |  Branch (612:6): [True: 0, False: 352]
  ------------------
  613|      0|    return result;
  614|       |
  615|    352|#ifdef CURLRES_IPV6
  616|       |  /* Do not start an AAAA query for an ipv4 address when
  617|       |   * we will start an A query for it. */
  618|    352|  if((async->dns_queries & CURL_DNSQ_AAAA) &&
  ------------------
  |  |   52|    352|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (618:6): [True: 267, False: 85]
  ------------------
  619|    267|     !(async->is_ipv4addr && (async->dns_queries & CURL_DNSQ_A))) {
  ------------------
  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  |  Branch (619:8): [True: 0, False: 267]
  |  Branch (619:30): [True: 0, False: 0]
  ------------------
  620|    267|    result = async_thrdd_query(data, async, CURL_DNSQ_AAAA);
  ------------------
  |  |   52|    267|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  621|    267|    if(result)
  ------------------
  |  Branch (621:8): [True: 0, False: 267]
  ------------------
  622|      0|      goto out;
  623|    267|  }
  624|    352|#endif
  625|    352|  if(async->dns_queries & CURL_DNSQ_A) {
  ------------------
  |  |   51|    352|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  |  Branch (625:6): [True: 350, False: 2]
  ------------------
  626|    350|    result = async_thrdd_query(data, async, CURL_DNSQ_A);
  ------------------
  |  |   51|    350|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  627|    350|    if(result)
  ------------------
  |  Branch (627:8): [True: 0, False: 350]
  ------------------
  628|      0|      goto out;
  629|    350|  }
  630|       |
  631|    352|#ifdef CURLVERBOSE
  632|    352|  Curl_thrdq_trace(data->multi->resolv_thrdq, data);
  633|    352|#endif
  634|       |
  635|    352|out:
  636|    352|  if(result)
  ------------------
  |  Branch (636:6): [True: 0, False: 352]
  ------------------
  637|      0|    CURL_TRC_DNS(data, "error queueing query %s:%d -> %d",
  ------------------
  |  |  168|      0|  do {                                 \
  |  |  169|      0|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|      0|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  638|    352|                 async->hostname, async->port, result);
  639|    352|  return result;
  640|    352|}
Curl_async_pollset:
  645|   149k|{
  646|   149k|  timediff_t timeout_ms;
  647|       |
  648|   149k|  timeout_ms = Curl_async_timeleft_ms(data, async);
  649|       |#ifdef USE_HTTPSRR_ARES
  650|       |  if(async->thrdd.rr.channel) {
  651|       |    CURLcode result = Curl_ares_pollset(data, async->thrdd.rr.channel, ps);
  652|       |    if(result)
  653|       |      return result;
  654|       |    timeout_ms = Curl_ares_timeout_ms(data, async, async->thrdd.rr.channel);
  655|       |  }
  656|       |#else
  657|   149k|  (void)ps;
  658|   149k|#endif
  659|       |
  660|   149k|  if(!async->done) {
  ------------------
  |  Branch (660:6): [True: 149k, False: 0]
  ------------------
  661|       |#ifndef ENABLE_WAKEUP
  662|       |    timediff_t stutter_ms, elapsed_ms;
  663|       |    elapsed_ms = curlx_ptimediff_ms(Curl_pgrs_now(data), &async->start);
  664|       |    if(elapsed_ms < 3)
  665|       |      stutter_ms = 1;
  666|       |    else if(elapsed_ms <= 50)
  667|       |      stutter_ms = elapsed_ms / 3;
  668|       |    else if(elapsed_ms <= 250)
  669|       |      stutter_ms = 50;
  670|       |    else
  671|       |      stutter_ms = 200;
  672|       |    timeout_ms = CURLMIN(stutter_ms, timeout_ms);
  673|       |#endif
  674|   149k|    Curl_expire(data, timeout_ms, EXPIRE_ASYNC_NAME);
  675|   149k|  }
  676|   149k|  return CURLE_OK;
  677|   149k|}
Curl_async_take_result:
  687|   225k|{
  688|   225k|  struct async_thrdd_ctx *thrdd = &async->thrdd;
  689|   225k|  struct Curl_dns_entry *dns = NULL;
  690|   225k|  CURLcode result = CURLE_OK;
  691|       |
  692|   225k|  DEBUGASSERT(pdns);
  ------------------
  |  | 1081|   225k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (692:3): [True: 0, False: 225k]
  |  Branch (692:3): [True: 225k, False: 0]
  ------------------
  693|   225k|  *pdns = NULL;
  694|   225k|  if(!async->queries_ongoing && !async->done) {
  ------------------
  |  Branch (694:6): [True: 254, False: 225k]
  |  Branch (694:33): [True: 0, False: 254]
  ------------------
  695|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (695:5): [Folded, False: 0]
  |  Branch (695:5): [Folded, False: 0]
  ------------------
  696|      0|    return CURLE_FAILED_INIT;
  697|      0|  }
  698|       |
  699|       |#ifdef USE_HTTPSRR_ARES
  700|       |  /* best effort, ignore errors */
  701|       |  if(thrdd->rr.channel)
  702|       |    (void)Curl_ares_perform(thrdd->rr.channel, 0);
  703|       |#endif
  704|       |#ifndef ENABLE_WAKEUP
  705|       |  Curl_async_thrdd_multi_process(data->multi);
  706|       |#endif
  707|       |
  708|   225k|  if(!async->done)
  ------------------
  |  Branch (708:6): [True: 225k, False: 254]
  ------------------
  709|   225k|    return CURLE_AGAIN;
  710|       |
  711|    254|  Curl_expire_done(data, EXPIRE_ASYNC_NAME);
  712|    254|  if(async->result) {
  ------------------
  |  Branch (712:6): [True: 0, False: 254]
  ------------------
  713|      0|    result = async->result;
  714|      0|    goto out;
  715|      0|  }
  716|       |
  717|    254|  if((thrdd->res_A && thrdd->res_A->res) ||
  ------------------
  |  Branch (717:7): [True: 252, False: 2]
  |  Branch (717:23): [True: 18, False: 234]
  ------------------
  718|    236|     (thrdd->res_AAAA && thrdd->res_AAAA->res)) {
  ------------------
  |  Branch (718:7): [True: 158, False: 78]
  |  Branch (718:26): [True: 0, False: 158]
  ------------------
  719|     18|    dns = Curl_dnscache_mk_entry2(
  720|     18|      data, async->dns_queries,
  721|     18|      thrdd->res_A ? &thrdd->res_A->res : NULL,
  ------------------
  |  Branch (721:7): [True: 18, False: 0]
  ------------------
  722|     18|      thrdd->res_AAAA ? &thrdd->res_AAAA->res : NULL,
  ------------------
  |  Branch (722:7): [True: 13, False: 5]
  ------------------
  723|     18|      async->hostname, async->port);
  724|     18|    if(!dns) {
  ------------------
  |  Branch (724:8): [True: 0, False: 18]
  ------------------
  725|      0|      result = CURLE_OUT_OF_MEMORY;
  726|      0|      goto out;
  727|      0|    }
  728|       |
  729|       |#ifdef USE_HTTPSRR_ARES
  730|       |    if(thrdd->rr.channel) {
  731|       |      struct Curl_https_rrinfo *lhrr = NULL;
  732|       |      if(thrdd->rr.hinfo.complete) {
  733|       |        lhrr = Curl_httpsrr_dup_move(&thrdd->rr.hinfo);
  734|       |        if(!lhrr) {
  735|       |          result = CURLE_OUT_OF_MEMORY;
  736|       |          goto out;
  737|       |        }
  738|       |      }
  739|       |      Curl_httpsrr_trace(data, lhrr);
  740|       |      Curl_dns_entry_set_https_rr(dns, lhrr);
  741|       |    }
  742|       |#endif
  743|     18|  }
  744|       |
  745|    254|  if(dns) {
  ------------------
  |  Branch (745:6): [True: 18, False: 236]
  ------------------
  746|     18|    *pdns = dns;
  747|     18|    dns = NULL;
  748|     18|  }
  749|    254|#ifdef CURLVERBOSE
  750|    254|  Curl_thrdq_trace(data->multi->resolv_thrdq, data);
  751|    254|#endif
  752|       |
  753|    254|out:
  754|    254|  Curl_dns_entry_unlink(data, &dns);
  755|    254|  Curl_async_thrdd_shutdown(data, async);
  756|    254|  if(!result && !*pdns)
  ------------------
  |  Branch (756:6): [True: 254, False: 0]
  |  Branch (756:17): [True: 236, False: 18]
  ------------------
  757|    236|    result = Curl_async_failed(data, async, NULL);
  758|    254|  if(result &&
  ------------------
  |  Branch (758:6): [True: 236, False: 18]
  ------------------
  759|    236|     (result != CURLE_COULDNT_RESOLVE_HOST) &&
  ------------------
  |  Branch (759:6): [True: 21, False: 215]
  ------------------
  760|     21|     (result != CURLE_COULDNT_RESOLVE_PROXY)) {
  ------------------
  |  Branch (760:6): [True: 0, False: 21]
  ------------------
  761|      0|    CURL_TRC_DNS(data, "Error %d resolving %s:%d",
  ------------------
  |  |  168|      0|  do {                                 \
  |  |  169|      0|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|      0|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  762|      0|                 result, async->hostname, async->port);
  763|      0|  }
  764|    254|  return result;
  765|    254|}
Curl_async_get_ai:
  786|   349k|{
  787|   349k|  struct async_thrdd_ctx *thrdd = &async->thrdd;
  788|       |
  789|   349k|  (void)data;
  790|   349k|  switch(ai_family) {
  791|  79.6k|  case AF_INET:
  ------------------
  |  Branch (791:3): [True: 79.6k, False: 270k]
  ------------------
  792|  79.6k|    if(thrdd->res_A)
  ------------------
  |  Branch (792:8): [True: 74.8k, False: 4.87k]
  ------------------
  793|  74.8k|      return async_thrdd_get_ai(thrdd->res_A->res, ai_family, index);
  794|  4.87k|    break;
  795|  79.6k|  case AF_INET6:
  ------------------
  |  Branch (795:3): [True: 79.6k, False: 270k]
  ------------------
  796|  79.6k|    if(thrdd->res_AAAA)
  ------------------
  |  Branch (796:8): [True: 232, False: 79.4k]
  ------------------
  797|    232|      return async_thrdd_get_ai(thrdd->res_AAAA->res, ai_family, index);
  798|  79.4k|    break;
  799|   190k|  default:
  ------------------
  |  Branch (799:3): [True: 190k, False: 159k]
  ------------------
  800|   190k|    break;
  801|   349k|  }
  802|   274k|  return NULL;
  803|   349k|}
asyn-thrdd.c:async_thrdd_item_destroy:
  129|  3.70k|{
  130|  3.70k|  if(item) {
  ------------------
  |  Branch (130:6): [True: 617, False: 3.08k]
  ------------------
  131|    617|    if(item->res)
  ------------------
  |  Branch (131:8): [True: 0, False: 617]
  ------------------
  132|      0|      Curl_freeaddrinfo(item->res);
  133|    617|    curlx_free(item);
  ------------------
  |  | 1483|    617|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  134|    617|  }
  135|  3.70k|}
asyn-thrdd.c:async_thrdd_item_free:
  430|    617|{
  431|    617|  async_thrdd_item_destroy(item);
  432|    617|}
asyn-thrdd.c:async_thrdd_item_process:
  336|    617|{
  337|    617|  struct async_thrdd_item *item = arg;
  338|    617|  struct addrinfo hints;
  339|    617|  char service[12];
  340|    617|  int pf = PF_INET;
  341|    617|  int rc;
  342|       |
  343|    617|#ifdef DEBUGBUILD
  344|    617|  if(item->delay_ms) {
  ------------------
  |  Branch (344:6): [True: 0, False: 617]
  ------------------
  345|      0|    curlx_wait_ms(item->delay_ms);
  346|      0|  }
  347|    617|  if(item->delay_fail_ms) {
  ------------------
  |  Branch (347:6): [True: 0, False: 617]
  ------------------
  348|      0|    curlx_wait_ms(item->delay_fail_ms);
  349|      0|    return;
  350|      0|  }
  351|    617|#endif
  352|       |
  353|    617|  memset(&hints, 0, sizeof(hints));
  354|    617|#ifdef CURLRES_IPV6
  355|    617|  if(item->dns_queries & CURL_DNSQ_AAAA) {
  ------------------
  |  |   52|    617|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (355:6): [True: 267, False: 350]
  ------------------
  356|    267|    pf = (item->dns_queries & CURL_DNSQ_A) ? PF_UNSPEC : PF_INET6;
  ------------------
  |  |   51|    267|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  |  Branch (356:10): [True: 0, False: 267]
  ------------------
  357|    267|  }
  358|    617|#endif
  359|    617|  hints.ai_family = pf;
  360|    617|  hints.ai_socktype = Curl_socktype_for_transport(item->transport);
  361|    617|  hints.ai_protocol = Curl_protocol_for_transport(item->transport);
  362|       |#ifdef __APPLE__
  363|       |  /* If we leave `ai_flags == 0` then macOS is looking for IPV4MAPPED
  364|       |   * when doing AAAA queries. We do not want this "help". */
  365|       |  hints.ai_flags = AI_ADDRCONFIG;
  366|       |#endif
  367|       |
  368|    617|  curl_msnprintf(service, sizeof(service), "%u", item->port);
  369|    617|#ifdef AI_NUMERICSERV
  370|    617|  hints.ai_flags |= AI_NUMERICSERV;
  371|    617|#endif
  372|       |
  373|    617|  rc = Curl_getaddrinfo_ex(item->hostname, service, &hints, &item->res);
  374|    617|  if(rc) {
  ------------------
  |  Branch (374:6): [True: 598, False: 19]
  ------------------
  375|    598|    item->sock_error = SOCKERRNO ? SOCKERRNO : rc;
  ------------------
  |  | 1095|    598|#define SOCKERRNO         errno
  ------------------
                  item->sock_error = SOCKERRNO ? SOCKERRNO : rc;
  ------------------
  |  | 1095|    598|#define SOCKERRNO         errno
  ------------------
  |  Branch (375:24): [True: 15, False: 583]
  ------------------
  376|    598|    if(item->sock_error == 0)
  ------------------
  |  Branch (376:8): [True: 0, False: 598]
  ------------------
  377|      0|      item->sock_error = RESOLVER_ENOMEM;
  ------------------
  |  |   46|      0|#define RESOLVER_ENOMEM  EAI_MEMORY  /* = WSA_NOT_ENOUGH_MEMORY on Windows */
  ------------------
  378|    598|  }
  379|     19|  else {
  380|     19|    Curl_addrinfo_set_port(item->res, item->port);
  381|     19|  }
  382|    617|}
asyn-thrdd.c:async_thrdd_event:
  414|    456|{
  415|    456|  struct Curl_multi *multi = user_data;
  416|    456|  (void)tqueue;
  417|    456|  switch(ev) {
  418|    456|  case CURL_THRDQ_EV_ITEM_DONE:
  ------------------
  |  Branch (418:3): [True: 456, False: 0]
  ------------------
  419|    456|    (void)curl_multi_wakeup(multi);
  420|    456|    break;
  421|      0|  default:
  ------------------
  |  Branch (421:3): [True: 0, False: 456]
  ------------------
  422|      0|    break;
  423|    456|  }
  424|    456|}
asyn-thrdd.c:async_thrdd_report_item:
  479|    456|{
  480|    456|  char buf[MAX_IPADR_LEN];
  481|    456|  struct dynbuf tmp;
  482|    456|  const char *sep = "";
  483|    456|  const struct Curl_addrinfo *ai = item->res;
  484|    456|  int ai_family = (item->dns_queries & CURL_DNSQ_AAAA) ? AF_INET6 : AF_INET;
  ------------------
  |  |   52|    456|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (484:19): [True: 175, False: 281]
  ------------------
  485|    456|  CURLcode result;
  486|       |
  487|    456|  if(!CURL_TRC_DNS_is_verbose(data))
  ------------------
  |  |  137|    456|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  ------------------
  |  |  |  |  326|    456|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    912|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 456, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 456]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    912|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    456|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  488|    456|    return;
  489|       |
  490|      0|  curlx_dyn_init(&tmp, 1024);
  491|      0|  for(; ai; ai = ai->ai_next) {
  ------------------
  |  Branch (491:9): [True: 0, False: 0]
  ------------------
  492|      0|    if(ai->ai_family == ai_family) {
  ------------------
  |  Branch (492:8): [True: 0, False: 0]
  ------------------
  493|      0|      Curl_printable_address(ai, buf, sizeof(buf));
  494|      0|      result = curlx_dyn_addf(&tmp, "%s%s", sep, buf);
  495|      0|      if(result) {
  ------------------
  |  Branch (495:10): [True: 0, False: 0]
  ------------------
  496|      0|        CURL_TRC_DNS(data, "too many IP, cannot show");
  ------------------
  |  |  168|      0|  do {                                 \
  |  |  169|      0|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|      0|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  497|      0|        goto out;
  498|      0|      }
  499|      0|      sep = ", ";
  500|      0|    }
  501|      0|  }
  502|       |
  503|      0|  CURL_TRC_DNS(data, "Host %s:%u resolved IPv%c: %s",
  ------------------
  |  |  168|      0|  do {                                 \
  |  |  169|      0|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|      0|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (170:26): [True: 0, False: 0]
  |  |  |  Branch (170:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  171|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  504|      0|               item->hostname, item->port,
  505|      0|               (item->dns_queries & CURL_DNSQ_AAAA) ? '6' : '4',
  506|      0|               (curlx_dyn_len(&tmp) ? curlx_dyn_ptr(&tmp) : "(none)"));
  507|      0|out:
  508|      0|  curlx_dyn_free(&tmp);
  509|      0|}
asyn-thrdd.c:async_thrdd_query:
  567|    617|{
  568|    617|  struct async_thrdd_item *item;
  569|    617|  CURLcode result;
  570|       |
  571|    617|  item = async_thrdd_item_create(data, async->id, dns_queries,
  572|    617|                                 async->hostname, async->port,
  573|    617|                                 async->transport);
  574|    617|  if(!item) {
  ------------------
  |  Branch (574:6): [True: 0, False: 617]
  ------------------
  575|      0|    result = CURLE_OUT_OF_MEMORY;
  576|      0|    goto out;
  577|      0|  }
  578|    617|  CURL_TRC_DNS(data, "queueing query %s", item->description);
  ------------------
  |  |  168|    617|  do {                                 \
  |  |  169|    617|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|    617|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|    617|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  1.23k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 617, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 617]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  1.23k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|    617|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|    617|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|    617|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 617]
  |  |  ------------------
  ------------------
  579|    617|  result = Curl_thrdq_send(data->multi->resolv_thrdq, item,
  580|    617|                           async_item_description(item), async->timeout_ms);
  ------------------
  |  |  104|    617|#define async_item_description(x)   (x)->description
  ------------------
  581|    617|  if(result)
  ------------------
  |  Branch (581:6): [True: 0, False: 617]
  ------------------
  582|      0|    goto out;
  583|    617|  item = NULL;
  584|    617|  async->queries_ongoing++;
  585|       |
  586|    617|out:
  587|    617|  if(item)
  ------------------
  |  Branch (587:6): [True: 0, False: 617]
  ------------------
  588|      0|    async_thrdd_item_free(item);
  589|    617|  return result;
  590|    617|}
asyn-thrdd.c:async_thrdd_item_create:
  143|    617|{
  144|    617|  size_t hostlen = strlen(hostname);
  145|    617|  struct async_thrdd_item *item;
  146|       |
  147|    617|  item = curlx_calloc(1, sizeof(*item) + hostlen);
  ------------------
  |  | 1480|    617|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  148|    617|  if(!item)
  ------------------
  |  Branch (148:6): [True: 0, False: 617]
  ------------------
  149|      0|    return NULL;
  150|       |
  151|    617|  if(hostlen) /* NUL byte of name already in struct size */
  ------------------
  |  Branch (151:6): [True: 617, False: 0]
  ------------------
  152|    617|    memcpy(item->hostname, hostname, hostlen);
  153|    617|  item->mid = data->mid;
  154|    617|  item->resolv_id = resolv_id;
  155|    617|  item->dns_queries = dns_queries;
  156|    617|  item->port = port;
  157|    617|  item->transport = transport;
  158|       |
  159|    617|#ifdef CURLVERBOSE
  160|    617|  curl_msnprintf(item->description, sizeof(item->description),
  161|    617|                 "[%" FMT_OFF_T "/%u] %s %s:%u",
  162|    617|                 data->id, item->resolv_id,
  163|    617|                 Curl_resolv_query_str(dns_queries),
  164|    617|                 item->hostname, item->port);
  165|    617|#endif
  166|       |
  167|    617|#ifdef DEBUGBUILD
  168|    617|  {
  169|    617|    const char *p = getenv("CURL_DBG_RESOLV_DELAY");
  170|    617|    if(p) {
  ------------------
  |  Branch (170:8): [True: 0, False: 617]
  ------------------
  171|      0|      curl_off_t l;
  172|      0|      if(!curlx_str_number(&p, &l, UINT32_MAX)) {
  ------------------
  |  Branch (172:10): [True: 0, False: 0]
  ------------------
  173|      0|        item->delay_ms = (uint32_t)l;
  174|      0|      }
  175|      0|    }
  176|    617|    p = getenv("CURL_DBG_RESOLV_FAIL_DELAY");
  177|    617|    if(p) {
  ------------------
  |  Branch (177:8): [True: 0, False: 617]
  ------------------
  178|      0|      curl_off_t l;
  179|      0|      if(!curlx_str_number(&p, &l, UINT32_MAX)) {
  ------------------
  |  Branch (179:10): [True: 0, False: 0]
  ------------------
  180|      0|        unsigned char c = 0;
  181|      0|        Curl_rand_bytes(data, FALSE, &c, 1);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  182|      0|        item->delay_fail_ms = (uint32_t)l + c;
  183|      0|      }
  184|      0|    }
  185|    617|  }
  186|    617|#endif
  187|       |
  188|    617|  return item;
  189|    617|}
asyn-thrdd.c:async_thrdd_get_ai:
  770|  75.0k|{
  771|  75.0k|  unsigned int i = 0;
  772|  75.0k|  for(i = 0; ai; ai = ai->ai_next) {
  ------------------
  |  Branch (772:14): [True: 0, False: 75.0k]
  ------------------
  773|      0|    if(ai->ai_family == ai_family) {
  ------------------
  |  Branch (773:8): [True: 0, False: 0]
  ------------------
  774|      0|      if(i == index)
  ------------------
  |  Branch (774:10): [True: 0, False: 0]
  ------------------
  775|      0|        return ai;
  776|      0|      ++i;
  777|      0|    }
  778|      0|  }
  779|  75.0k|  return NULL;
  780|  75.0k|}

Curl_bufcp_init:
  148|  4.44k|{
  149|  4.44k|  DEBUGASSERT(chunk_size > 0);
  ------------------
  |  | 1081|  4.44k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (149:3): [True: 0, False: 4.44k]
  |  Branch (149:3): [True: 4.44k, False: 0]
  ------------------
  150|  4.44k|  DEBUGASSERT(spare_max > 0);
  ------------------
  |  | 1081|  4.44k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (150:3): [True: 0, False: 4.44k]
  |  Branch (150:3): [True: 4.44k, False: 0]
  ------------------
  151|  4.44k|  memset(pool, 0, sizeof(*pool));
  152|  4.44k|  pool->chunk_size = chunk_size;
  153|  4.44k|  pool->spare_max = spare_max;
  154|  4.44k|}
Curl_bufcp_free:
  201|  4.44k|{
  202|  4.44k|  chunk_list_free(&pool->spare);
  203|  4.44k|  pool->spare_count = 0;
  204|  4.44k|}
Curl_bufq_init2:
  220|  16.3k|{
  221|       |  bufq_init(q, NULL, chunk_size, max_chunks, opts);
  222|  16.3k|}
Curl_bufq_initp:
  231|  13.3k|{
  232|  13.3k|  bufq_init(q, pool, pool->chunk_size, max_chunks, opts);
  233|  13.3k|}
Curl_bufq_free:
  236|  29.6k|{
  237|  29.6k|  chunk_list_free(&q->head);
  238|  29.6k|  chunk_list_free(&q->spare);
  239|       |  q->tail = NULL;
  240|  29.6k|  q->chunk_count = 0;
  241|  29.6k|}
Curl_bufq_reset:
  244|  9.49k|{
  245|  9.49k|  struct buf_chunk *chunk;
  246|  9.50k|  while(q->head) {
  ------------------
  |  Branch (246:9): [True: 8, False: 9.49k]
  ------------------
  247|      8|    chunk = q->head;
  248|      8|    q->head = chunk->next;
  249|      8|    chunk->next = q->spare;
  250|      8|    q->spare = chunk;
  251|      8|  }
  252|       |  q->tail = NULL;
  253|  9.49k|}
Curl_bufq_len:
  256|   125k|{
  257|   125k|  const struct buf_chunk *chunk = q->head;
  258|   125k|  size_t len = 0;
  259|   250k|  while(chunk) {
  ------------------
  |  Branch (259:9): [True: 125k, False: 125k]
  ------------------
  260|   125k|    len += chunk_len(chunk);
  261|   125k|    chunk = chunk->next;
  262|   125k|  }
  263|   125k|  return len;
  264|   125k|}
Curl_bufq_is_empty:
  267|  68.0M|{
  268|  68.0M|  return !q->head || chunk_is_empty(q->head);
  ------------------
  |  Branch (268:10): [True: 36.4M, False: 31.6M]
  |  Branch (268:22): [True: 13.0M, False: 18.5M]
  ------------------
  269|  68.0M|}
Curl_bufq_is_full:
  272|   165k|{
  273|   165k|  if(!q->tail || q->spare)
  ------------------
  |  Branch (273:6): [True: 7.04k, False: 158k]
  |  Branch (273:18): [True: 0, False: 158k]
  ------------------
  274|  7.04k|    return FALSE;
  ------------------
  |  | 1058|  7.04k|#define FALSE false
  ------------------
  275|   158k|  if(q->chunk_count < q->max_chunks)
  ------------------
  |  Branch (275:6): [True: 0, False: 158k]
  ------------------
  276|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  277|   158k|  if(q->chunk_count > q->max_chunks)
  ------------------
  |  Branch (277:6): [True: 21, False: 158k]
  ------------------
  278|     21|    return TRUE;
  ------------------
  |  | 1055|     21|#define TRUE true
  ------------------
  279|       |  /* we have no spares and cannot make more, is the tail full? */
  280|   158k|  return chunk_is_full(q->tail);
  281|   158k|}
Curl_bufq_write:
  370|  1.49M|{
  371|  1.49M|  struct buf_chunk *tail;
  372|  1.49M|  size_t n;
  373|       |
  374|  1.49M|  DEBUGASSERT(q->max_chunks > 0);
  ------------------
  |  | 1081|  1.49M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (374:3): [True: 0, False: 1.49M]
  |  Branch (374:3): [True: 1.49M, False: 0]
  ------------------
  375|  1.49M|  *pnwritten = 0;
  376|  2.13M|  while(len) {
  ------------------
  |  Branch (376:9): [True: 907k, False: 1.22M]
  ------------------
  377|   907k|    tail = get_non_full_tail(q);
  378|   907k|    if(!tail) {
  ------------------
  |  Branch (378:8): [True: 273k, False: 634k]
  ------------------
  379|   273k|      if((q->chunk_count < q->max_chunks) || (q->opts & BUFQ_OPT_SOFT_LIMIT))
  ------------------
  |  |  111|   273k|#define BUFQ_OPT_SOFT_LIMIT  (1 << 0)
  ------------------
  |  Branch (379:10): [True: 0, False: 273k]
  |  Branch (379:46): [True: 0, False: 273k]
  ------------------
  380|       |        /* should have gotten a tail, but did not */
  381|      0|        return CURLE_OUT_OF_MEMORY;
  382|   273k|      break;
  383|   273k|    }
  384|   634k|    n = chunk_append(tail, buf, len);
  385|   634k|    if(!n)
  ------------------
  |  Branch (385:8): [True: 0, False: 634k]
  ------------------
  386|      0|      break;
  387|   634k|    *pnwritten += n;
  388|   634k|    buf += n;
  389|   634k|    len -= n;
  390|   634k|  }
  391|  1.49M|  return (!*pnwritten && len) ? CURLE_AGAIN : CURLE_OK;
  ------------------
  |  Branch (391:11): [True: 862k, False: 634k]
  |  Branch (391:26): [True: 272k, False: 589k]
  ------------------
  392|  1.49M|}
Curl_bufq_cwrite:
  397|  1.19M|{
  398|  1.19M|  return Curl_bufq_write(q, (const uint8_t *)buf, len, pnwritten);
  399|  1.19M|}
Curl_bufq_read:
  403|  1.08k|{
  404|  1.08k|  *pnread = 0;
  405|  2.10k|  while(len && q->head) {
  ------------------
  |  Branch (405:9): [True: 1.74k, False: 363]
  |  Branch (405:16): [True: 1.02k, False: 722]
  ------------------
  406|  1.02k|    size_t n = chunk_read(q->head, buf, len);
  407|  1.02k|    if(n) {
  ------------------
  |  Branch (407:8): [True: 1.02k, False: 0]
  ------------------
  408|  1.02k|      *pnread += n;
  409|  1.02k|      buf += n;
  410|  1.02k|      len -= n;
  411|  1.02k|    }
  412|  1.02k|    prune_head(q);
  413|  1.02k|  }
  414|  1.08k|  return (!*pnread) ? CURLE_AGAIN : CURLE_OK;
  ------------------
  |  Branch (414:10): [True: 132, False: 953]
  ------------------
  415|  1.08k|}
Curl_bufq_cread:
  419|    191|{
  420|    191|  return Curl_bufq_read(q, (uint8_t *)buf, len, pnread);
  421|    191|}
Curl_bufq_peek:
  425|   303k|{
  426|   303k|  if(q->head && chunk_is_empty(q->head)) {
  ------------------
  |  Branch (426:6): [True: 290k, False: 12.8k]
  |  Branch (426:17): [True: 0, False: 290k]
  ------------------
  427|      0|    prune_head(q);
  428|      0|  }
  429|   303k|  if(q->head && !chunk_is_empty(q->head)) {
  ------------------
  |  Branch (429:6): [True: 290k, False: 12.8k]
  |  Branch (429:17): [True: 290k, False: 0]
  ------------------
  430|   290k|    chunk_peek(q->head, pbuf, plen);
  431|   290k|    return TRUE;
  ------------------
  |  | 1055|   290k|#define TRUE true
  ------------------
  432|   290k|  }
  433|  12.8k|  *pbuf = NULL;
  434|  12.8k|  *plen = 0;
  435|       |  return FALSE;
  ------------------
  |  | 1058|  12.8k|#define FALSE false
  ------------------
  436|   303k|}
Curl_bufq_skip:
  462|   289k|{
  463|   289k|  size_t n;
  464|       |
  465|   306k|  while(amount && q->head) {
  ------------------
  |  Branch (465:9): [True: 16.9k, False: 289k]
  |  Branch (465:19): [True: 16.9k, False: 0]
  ------------------
  466|  16.9k|    n = chunk_skip(q->head, amount);
  467|  16.9k|    amount -= n;
  468|  16.9k|    prune_head(q);
  469|  16.9k|  }
  470|   289k|}
Curl_bufq_pass:
  474|  11.8k|{
  475|  11.8k|  const uint8_t *buf;
  476|  11.8k|  size_t blen;
  477|  11.8k|  CURLcode result = CURLE_OK;
  478|       |
  479|  11.8k|  *pwritten = 0;
  480|  23.6k|  while(Curl_bufq_peek(q, &buf, &blen)) {
  ------------------
  |  Branch (480:9): [True: 11.8k, False: 11.8k]
  ------------------
  481|  11.8k|    size_t chunk_written;
  482|       |
  483|  11.8k|    result = writer(writer_ctx, buf, blen, &chunk_written);
  484|  11.8k|    if(result) {
  ------------------
  |  Branch (484:8): [True: 0, False: 11.8k]
  ------------------
  485|      0|      if((result == CURLE_AGAIN) && *pwritten) {
  ------------------
  |  Branch (485:10): [True: 0, False: 0]
  |  Branch (485:37): [True: 0, False: 0]
  ------------------
  486|       |        /* blocked on subsequent write, report success */
  487|      0|        result = CURLE_OK;
  488|      0|      }
  489|      0|      break;
  490|      0|    }
  491|  11.8k|    if(!chunk_written) {
  ------------------
  |  Branch (491:8): [True: 0, False: 11.8k]
  ------------------
  492|      0|      if(!*pwritten) {
  ------------------
  |  Branch (492:10): [True: 0, False: 0]
  ------------------
  493|       |        /* treat as blocked */
  494|      0|        result = CURLE_AGAIN;
  495|      0|      }
  496|      0|      break;
  497|      0|    }
  498|  11.8k|    *pwritten += chunk_written;
  499|  11.8k|    Curl_bufq_skip(q, chunk_written);
  500|  11.8k|  }
  501|  11.8k|  return result;
  502|  11.8k|}
Curl_bufq_write_pass:
  508|  14.8k|{
  509|  14.8k|  CURLcode result = CURLE_OK;
  510|  14.8k|  size_t n;
  511|       |
  512|  14.8k|  *pwritten = 0;
  513|  30.1k|  while(len) {
  ------------------
  |  Branch (513:9): [True: 15.2k, False: 14.8k]
  ------------------
  514|  15.2k|    if(Curl_bufq_is_full(q)) {
  ------------------
  |  Branch (514:8): [True: 427, False: 14.8k]
  ------------------
  515|       |      /* try to make room in case we are full */
  516|    427|      result = Curl_bufq_pass(q, writer, writer_ctx, &n);
  517|    427|      if(result) {
  ------------------
  |  Branch (517:10): [True: 0, False: 427]
  ------------------
  518|      0|        if(result != CURLE_AGAIN) {
  ------------------
  |  Branch (518:12): [True: 0, False: 0]
  ------------------
  519|       |          /* real error, fail */
  520|      0|          return result;
  521|      0|        }
  522|       |        /* would block, bufq is full, give up */
  523|      0|        break;
  524|      0|      }
  525|    427|    }
  526|       |
  527|       |    /* Add to bufq as much as there is room for */
  528|  15.2k|    result = Curl_bufq_write(q, buf, len, &n);
  529|  15.2k|    if(result) {
  ------------------
  |  Branch (529:8): [True: 0, False: 15.2k]
  ------------------
  530|      0|      if(result != CURLE_AGAIN)
  ------------------
  |  Branch (530:10): [True: 0, False: 0]
  ------------------
  531|       |        /* real error, fail */
  532|      0|        return result;
  533|       |      /* result == CURLE_AGAIN */
  534|      0|      if(*pwritten)
  ------------------
  |  Branch (534:10): [True: 0, False: 0]
  ------------------
  535|       |        /* we did write successfully before */
  536|      0|        result = CURLE_OK;
  537|      0|      return result;
  538|      0|    }
  539|  15.2k|    else if(n == 0)
  ------------------
  |  Branch (539:13): [True: 0, False: 15.2k]
  ------------------
  540|       |      /* edge case of writer returning 0 (and len is >0)
  541|       |       * break or we might enter an infinite loop here */
  542|      0|      break;
  543|       |
  544|       |    /* Track what we added to bufq */
  545|  15.2k|    buf += n;
  546|  15.2k|    len -= n;
  547|  15.2k|    *pwritten += n;
  548|  15.2k|  }
  549|       |
  550|  14.8k|  return (!*pwritten && len) ? CURLE_AGAIN : CURLE_OK;
  ------------------
  |  Branch (550:11): [True: 0, False: 14.8k]
  |  Branch (550:25): [True: 0, False: 0]
  ------------------
  551|  14.8k|}
Curl_bufq_sipn:
  556|  3.26M|{
  557|  3.26M|  struct buf_chunk *tail = NULL;
  558|       |
  559|  3.26M|  *pnread = 0;
  560|  3.26M|  tail = get_non_full_tail(q);
  561|  3.26M|  if(!tail) {
  ------------------
  |  Branch (561:6): [True: 0, False: 3.26M]
  ------------------
  562|      0|    if(q->chunk_count < q->max_chunks)
  ------------------
  |  Branch (562:8): [True: 0, False: 0]
  ------------------
  563|      0|      return CURLE_OUT_OF_MEMORY;
  564|       |    /* full, blocked */
  565|      0|    return CURLE_AGAIN;
  566|      0|  }
  567|       |
  568|  3.26M|  return chunk_slurpn(tail, max_len, reader, reader_ctx, pnread);
  569|  3.26M|}
bufq.c:chunk_list_free:
  137|  63.7k|{
  138|  63.7k|  struct buf_chunk *chunk;
  139|  73.2k|  while(*anchor) {
  ------------------
  |  Branch (139:9): [True: 9.54k, False: 63.7k]
  ------------------
  140|  9.54k|    chunk = *anchor;
  141|  9.54k|    *anchor = chunk->next;
  142|  9.54k|    curlx_free(chunk);
  ------------------
  |  | 1483|  9.54k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  143|  9.54k|  }
  144|  63.7k|}
bufq.c:bufq_init:
  208|  29.6k|{
  209|  29.6k|  DEBUGASSERT(chunk_size > 0);
  ------------------
  |  | 1081|  29.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (209:3): [True: 0, False: 29.6k]
  |  Branch (209:3): [True: 29.6k, False: 0]
  ------------------
  210|  29.6k|  DEBUGASSERT(max_chunks > 0);
  ------------------
  |  | 1081|  29.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (210:3): [True: 0, False: 29.6k]
  |  Branch (210:3): [True: 29.6k, False: 0]
  ------------------
  211|  29.6k|  memset(q, 0, sizeof(*q));
  212|  29.6k|  q->chunk_size = chunk_size;
  213|  29.6k|  q->max_chunks = max_chunks;
  214|  29.6k|  q->pool = pool;
  215|  29.6k|  q->opts = opts;
  216|  29.6k|}
bufq.c:chunk_len:
   39|   125k|{
   40|   125k|  return chunk->w_offset - chunk->r_offset;
   41|   125k|}
bufq.c:chunk_is_empty:
   29|  32.2M|{
   30|  32.2M|  return chunk->r_offset >= chunk->w_offset;
   31|  32.2M|}
bufq.c:chunk_is_full:
   34|  4.31M|{
   35|  4.31M|  return chunk->w_offset >= chunk->dlen;
   36|  4.31M|}
bufq.c:get_non_full_tail:
  347|  4.17M|{
  348|  4.17M|  struct buf_chunk *chunk;
  349|       |
  350|  4.17M|  if(q->tail && !chunk_is_full(q->tail))
  ------------------
  |  Branch (350:6): [True: 4.15M, False: 21.3k]
  |  Branch (350:17): [True: 3.87M, False: 273k]
  ------------------
  351|  3.87M|    return q->tail;
  352|   294k|  chunk = get_spare(q);
  353|   294k|  if(chunk) {
  ------------------
  |  Branch (353:6): [True: 21.8k, False: 273k]
  ------------------
  354|       |    /* new tail, and possibly new head */
  355|  21.8k|    if(q->tail) {
  ------------------
  |  Branch (355:8): [True: 446, False: 21.3k]
  ------------------
  356|    446|      q->tail->next = chunk;
  357|    446|      q->tail = chunk;
  358|    446|    }
  359|  21.3k|    else {
  360|  21.3k|      DEBUGASSERT(!q->head);
  ------------------
  |  | 1081|  21.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (360:7): [True: 0, False: 21.3k]
  |  Branch (360:7): [True: 21.3k, False: 0]
  ------------------
  361|  21.3k|      q->head = q->tail = chunk;
  362|  21.3k|    }
  363|  21.8k|  }
  364|   294k|  return chunk;
  365|   294k|}
bufq.c:get_spare:
  284|   294k|{
  285|   294k|  struct buf_chunk *chunk = NULL;
  286|       |
  287|   294k|  if(q->spare) {
  ------------------
  |  Branch (287:6): [True: 440, False: 294k]
  ------------------
  288|    440|    chunk = q->spare;
  289|    440|    q->spare = chunk->next;
  290|    440|    chunk_reset(chunk);
  291|    440|    return chunk;
  292|    440|  }
  293|       |
  294|   294k|  if(q->chunk_count >= q->max_chunks && (!(q->opts & BUFQ_OPT_SOFT_LIMIT)))
  ------------------
  |  |  111|   273k|#define BUFQ_OPT_SOFT_LIMIT  (1 << 0)
  ------------------
  |  Branch (294:6): [True: 273k, False: 21.2k]
  |  Branch (294:41): [True: 273k, False: 99]
  ------------------
  295|   273k|    return NULL;
  296|       |
  297|  21.3k|  if(q->pool) {
  ------------------
  |  Branch (297:6): [True: 20.1k, False: 1.19k]
  ------------------
  298|  20.1k|    if(bufcp_take(q->pool, &chunk))
  ------------------
  |  Branch (298:8): [True: 0, False: 20.1k]
  ------------------
  299|      0|      return NULL;
  300|  20.1k|    ++q->chunk_count;
  301|  20.1k|    return chunk;
  302|  20.1k|  }
  303|  1.19k|  else {
  304|       |    /* Check for integer overflow before allocation */
  305|  1.19k|    if(q->chunk_size > SIZE_MAX - sizeof(*chunk)) {
  ------------------
  |  Branch (305:8): [True: 0, False: 1.19k]
  ------------------
  306|      0|      return NULL;
  307|      0|    }
  308|       |
  309|  1.19k|    chunk = curlx_calloc(1, sizeof(*chunk) + q->chunk_size);
  ------------------
  |  | 1480|  1.19k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  310|  1.19k|    if(!chunk)
  ------------------
  |  Branch (310:8): [True: 0, False: 1.19k]
  ------------------
  311|      0|      return NULL;
  312|  1.19k|    chunk->dlen = q->chunk_size;
  313|  1.19k|    ++q->chunk_count;
  314|  1.19k|    return chunk;
  315|  1.19k|  }
  316|  21.3k|}
bufq.c:chunk_reset:
   44|  28.5k|{
   45|       |  chunk->next = NULL;
   46|  28.5k|  chunk->r_offset = chunk->w_offset = 0;
   47|  28.5k|}
bufq.c:bufcp_take:
  158|  20.1k|{
  159|  20.1k|  struct buf_chunk *chunk = NULL;
  160|       |
  161|  20.1k|  if(pool->spare) {
  ------------------
  |  Branch (161:6): [True: 11.7k, False: 8.44k]
  ------------------
  162|  11.7k|    chunk = pool->spare;
  163|  11.7k|    pool->spare = chunk->next;
  164|  11.7k|    --pool->spare_count;
  165|  11.7k|    chunk_reset(chunk);
  166|  11.7k|    *pchunk = chunk;
  167|  11.7k|    return CURLE_OK;
  168|  11.7k|  }
  169|       |
  170|       |  /* Check for integer overflow before allocation */
  171|  8.44k|  if(pool->chunk_size > SIZE_MAX - sizeof(*chunk)) {
  ------------------
  |  Branch (171:6): [True: 0, False: 8.44k]
  ------------------
  172|      0|    *pchunk = NULL;
  173|      0|    return CURLE_OUT_OF_MEMORY;
  174|      0|  }
  175|       |
  176|  8.44k|  chunk = curlx_calloc(1, sizeof(*chunk) + pool->chunk_size);
  ------------------
  |  | 1480|  8.44k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  177|  8.44k|  if(!chunk) {
  ------------------
  |  Branch (177:6): [True: 0, False: 8.44k]
  ------------------
  178|      0|    *pchunk = NULL;
  179|      0|    return CURLE_OUT_OF_MEMORY;
  180|      0|  }
  181|  8.44k|  chunk->dlen = pool->chunk_size;
  182|  8.44k|  *pchunk = chunk;
  183|  8.44k|  return CURLE_OK;
  184|  8.44k|}
bufq.c:chunk_append:
   51|   634k|{
   52|   634k|  uint8_t *p = &chunk->x.data[chunk->w_offset];
   53|   634k|  size_t n = chunk->dlen - chunk->w_offset;
   54|   634k|  DEBUGASSERT(chunk->dlen >= chunk->w_offset);
  ------------------
  |  | 1081|   634k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (54:3): [True: 0, False: 634k]
  |  Branch (54:3): [True: 634k, False: 0]
  ------------------
   55|   634k|  if(n) {
  ------------------
  |  Branch (55:6): [True: 634k, False: 0]
  ------------------
   56|   634k|    n = CURLMIN(n, len);
  ------------------
  |  | 1287|   634k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 853, False: 633k]
  |  |  ------------------
  ------------------
   57|   634k|    memcpy(p, buf, n);
   58|   634k|    chunk->w_offset += n;
   59|   634k|  }
   60|   634k|  return n;
   61|   634k|}
bufq.c:chunk_read:
   65|  1.02k|{
   66|  1.02k|  uint8_t *p = &chunk->x.data[chunk->r_offset];
   67|  1.02k|  size_t n = chunk->w_offset - chunk->r_offset;
   68|  1.02k|  DEBUGASSERT(chunk->w_offset >= chunk->r_offset);
  ------------------
  |  | 1081|  1.02k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (68:3): [True: 0, False: 1.02k]
  |  Branch (68:3): [True: 1.02k, False: 0]
  ------------------
   69|  1.02k|  if(!n) {
  ------------------
  |  Branch (69:6): [True: 0, False: 1.02k]
  ------------------
   70|      0|    return 0;
   71|      0|  }
   72|  1.02k|  else if(n <= len) {
  ------------------
  |  Branch (72:11): [True: 942, False: 78]
  ------------------
   73|    942|    memcpy(buf, p, n);
   74|    942|    chunk->r_offset = chunk->w_offset = 0;
   75|    942|    return n;
   76|    942|  }
   77|     78|  else {
   78|     78|    memcpy(buf, p, len);
   79|     78|    chunk->r_offset += len;
   80|     78|    return len;
   81|     78|  }
   82|  1.02k|}
bufq.c:prune_head:
  319|  17.9k|{
  320|  17.9k|  struct buf_chunk *chunk;
  321|       |
  322|  35.8k|  while(q->head && chunk_is_empty(q->head)) {
  ------------------
  |  Branch (322:9): [True: 18.3k, False: 17.5k]
  |  Branch (322:20): [True: 17.8k, False: 456]
  ------------------
  323|  17.8k|    chunk = q->head;
  324|  17.8k|    q->head = chunk->next;
  325|  17.8k|    if(q->tail == chunk)
  ------------------
  |  Branch (325:8): [True: 17.5k, False: 368]
  ------------------
  326|  17.5k|      q->tail = q->head;
  327|  17.8k|    if(q->pool) {
  ------------------
  |  Branch (327:8): [True: 16.4k, False: 1.43k]
  ------------------
  328|  16.4k|      bufcp_put(q->pool, chunk);
  329|  16.4k|      --q->chunk_count;
  330|  16.4k|    }
  331|  1.43k|    else if((q->chunk_count > q->max_chunks) ||
  ------------------
  |  Branch (331:13): [True: 99, False: 1.33k]
  ------------------
  332|  1.33k|            (q->opts & BUFQ_OPT_NO_SPARES)) {
  ------------------
  |  |  115|  1.33k|#define BUFQ_OPT_NO_SPARES   (1 << 1)
  ------------------
  |  Branch (332:13): [True: 1, False: 1.33k]
  ------------------
  333|       |      /* SOFT_LIMIT allowed us more than max. free spares until
  334|       |       * we are at max again. Or free them if we are configured
  335|       |       * to not use spares. */
  336|    100|      curlx_free(chunk);
  ------------------
  |  | 1483|    100|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  337|    100|      --q->chunk_count;
  338|    100|    }
  339|  1.33k|    else {
  340|  1.33k|      chunk->next = q->spare;
  341|  1.33k|      q->spare = chunk;
  342|  1.33k|    }
  343|  17.8k|  }
  344|  17.9k|}
bufq.c:bufcp_put:
  188|  16.4k|{
  189|  16.4k|  if(pool->spare_count >= pool->spare_max) {
  ------------------
  |  Branch (189:6): [True: 0, False: 16.4k]
  ------------------
  190|      0|    curlx_free(chunk);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  191|      0|  }
  192|  16.4k|  else {
  193|  16.4k|    chunk_reset(chunk);
  194|  16.4k|    chunk->next = pool->spare;
  195|  16.4k|    pool->spare = chunk;
  196|  16.4k|    ++pool->spare_count;
  197|  16.4k|  }
  198|  16.4k|}
bufq.c:chunk_peek:
  108|   290k|{
  109|   290k|  DEBUGASSERT(chunk->w_offset >= chunk->r_offset);
  ------------------
  |  | 1081|   290k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (109:3): [True: 0, False: 290k]
  |  Branch (109:3): [True: 290k, False: 0]
  ------------------
  110|   290k|  *pbuf = &chunk->x.data[chunk->r_offset];
  111|   290k|  *plen = chunk->w_offset - chunk->r_offset;
  112|   290k|}
bufq.c:chunk_skip:
  124|  16.9k|{
  125|  16.9k|  size_t n = chunk->w_offset - chunk->r_offset;
  126|  16.9k|  DEBUGASSERT(chunk->w_offset >= chunk->r_offset);
  ------------------
  |  | 1081|  16.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (126:3): [True: 0, False: 16.9k]
  |  Branch (126:3): [True: 16.9k, False: 0]
  ------------------
  127|  16.9k|  if(n) {
  ------------------
  |  Branch (127:6): [True: 16.9k, False: 0]
  ------------------
  128|  16.9k|    n = CURLMIN(n, amount);
  ------------------
  |  | 1287|  16.9k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 0, False: 16.9k]
  |  |  ------------------
  ------------------
  129|  16.9k|    chunk->r_offset += n;
  130|  16.9k|    if(chunk->r_offset == chunk->w_offset)
  ------------------
  |  Branch (130:8): [True: 16.9k, False: 10]
  ------------------
  131|  16.9k|      chunk->r_offset = chunk->w_offset = 0;
  132|  16.9k|  }
  133|  16.9k|  return n;
  134|  16.9k|}
bufq.c:chunk_slurpn:
   87|  3.26M|{
   88|  3.26M|  uint8_t *p = &chunk->x.data[chunk->w_offset];
   89|  3.26M|  size_t n = chunk->dlen - chunk->w_offset; /* free amount */
   90|  3.26M|  CURLcode result;
   91|       |
   92|  3.26M|  *pnread = 0;
   93|  3.26M|  DEBUGASSERT(chunk->dlen >= chunk->w_offset);
  ------------------
  |  | 1081|  3.26M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (93:3): [True: 0, False: 3.26M]
  |  Branch (93:3): [True: 3.26M, False: 0]
  ------------------
   94|  3.26M|  if(!n)
  ------------------
  |  Branch (94:6): [True: 0, False: 3.26M]
  ------------------
   95|      0|    return CURLE_AGAIN;
   96|  3.26M|  if(max_len && n > max_len)
  ------------------
  |  Branch (96:6): [True: 192, False: 3.26M]
  |  Branch (96:17): [True: 192, False: 0]
  ------------------
   97|    192|    n = max_len;
   98|  3.26M|  result = reader(reader_ctx, p, n, pnread);
   99|  3.26M|  if(!result) {
  ------------------
  |  Branch (99:6): [True: 8.73k, False: 3.25M]
  ------------------
  100|  8.73k|    DEBUGASSERT(*pnread <= n);
  ------------------
  |  | 1081|  8.73k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (100:5): [True: 0, False: 8.73k]
  |  Branch (100:5): [True: 8.73k, False: 0]
  ------------------
  101|  8.73k|    chunk->w_offset += *pnread;
  102|  8.73k|  }
  103|  3.26M|  return result;
  104|  3.26M|}

Curl_bufref_init:
   38|  73.9k|{
   39|  73.9k|  DEBUGASSERT(br);
  ------------------
  |  | 1081|  73.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (39:3): [True: 0, False: 73.9k]
  |  Branch (39:3): [True: 73.9k, False: 0]
  ------------------
   40|  73.9k|  br->dtor = NULL;
   41|  73.9k|  br->ptr = NULL;
   42|  73.9k|  br->len = 0;
   43|       |
   44|  73.9k|#ifdef DEBUGBUILD
   45|  73.9k|  br->signature = SIGNATURE;
  ------------------
  |  |   31|  73.9k|#define SIGNATURE 0x5c48e9b2    /* Random pattern. */
  ------------------
   46|  73.9k|#endif
   47|  73.9k|}
Curl_bufref_free:
   55|   170k|{
   56|   170k|  DEBUGASSERT(br);
  ------------------
  |  | 1081|   170k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (56:3): [True: 0, False: 170k]
  |  Branch (56:3): [True: 170k, False: 0]
  ------------------
   57|   170k|  DEBUGASSERT(br->signature == SIGNATURE);
  ------------------
  |  | 1081|   170k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (57:3): [True: 0, False: 170k]
  |  Branch (57:3): [True: 170k, False: 0]
  ------------------
   58|   170k|  DEBUGASSERT(br->ptr || !br->len);
  ------------------
  |  | 1081|   170k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (58:3): [True: 170k, False: 0]
  |  Branch (58:3): [True: 0, False: 0]
  |  Branch (58:3): [True: 45.7k, False: 124k]
  |  Branch (58:3): [True: 124k, False: 0]
  ------------------
   59|       |
   60|   170k|  if(br->ptr && br->dtor)
  ------------------
  |  Branch (60:6): [True: 45.7k, False: 124k]
  |  Branch (60:17): [True: 16.2k, False: 29.5k]
  ------------------
   61|  16.2k|    br->dtor(CURL_UNCONST(br->ptr));
  ------------------
  |  |  866|  16.2k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
   62|       |
   63|   170k|  br->dtor = NULL;
   64|       |  br->ptr = NULL;
   65|   170k|  br->len = 0;
   66|   170k|}
Curl_bufref_set:
   74|  46.1k|{
   75|  46.1k|  DEBUGASSERT(ptr || !len);
  ------------------
  |  | 1081|  46.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (75:3): [True: 46.1k, False: 0]
  |  Branch (75:3): [True: 0, False: 0]
  |  Branch (75:3): [True: 46.1k, False: 0]
  |  Branch (75:3): [True: 0, False: 0]
  ------------------
   76|  46.1k|  DEBUGASSERT(len <= CURL_MAX_INPUT_LENGTH);
  ------------------
  |  | 1081|  46.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (76:3): [True: 0, False: 46.1k]
  |  Branch (76:3): [True: 46.1k, False: 0]
  ------------------
   77|       |
   78|  46.1k|  Curl_bufref_free(br);
   79|  46.1k|  br->ptr = (const unsigned char *)ptr;
   80|  46.1k|  br->len = len;
   81|  46.1k|  br->dtor = dtor;
   82|  46.1k|}
Curl_bufref_ptr:
  100|  42.9k|{
  101|  42.9k|  DEBUGASSERT(br);
  ------------------
  |  | 1081|  42.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (101:3): [True: 0, False: 42.9k]
  |  Branch (101:3): [True: 42.9k, False: 0]
  ------------------
  102|  42.9k|  DEBUGASSERT(br->signature == SIGNATURE);
  ------------------
  |  | 1081|  42.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (102:3): [True: 0, False: 42.9k]
  |  Branch (102:3): [True: 42.9k, False: 0]
  ------------------
  103|  42.9k|  DEBUGASSERT(br->ptr || !br->len);
  ------------------
  |  | 1081|  42.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (103:3): [True: 42.9k, False: 0]
  |  Branch (103:3): [True: 0, False: 0]
  |  Branch (103:3): [True: 35.5k, False: 7.42k]
  |  Branch (103:3): [True: 7.42k, False: 0]
  ------------------
  104|       |
  105|  42.9k|  return (const char *)br->ptr;
  106|  42.9k|}
Curl_bufref_memdup0:
  121|    158|{
  122|    158|  unsigned char *cpy = NULL;
  123|       |
  124|    158|  DEBUGASSERT(br);
  ------------------
  |  | 1081|    158|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (124:3): [True: 0, False: 158]
  |  Branch (124:3): [True: 158, False: 0]
  ------------------
  125|    158|  DEBUGASSERT(br->signature == SIGNATURE);
  ------------------
  |  | 1081|    158|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (125:3): [True: 0, False: 158]
  |  Branch (125:3): [True: 158, False: 0]
  ------------------
  126|    158|  DEBUGASSERT(br->ptr || !br->len);
  ------------------
  |  | 1081|    158|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (126:3): [True: 158, False: 0]
  |  Branch (126:3): [True: 0, False: 0]
  |  Branch (126:3): [True: 158, False: 0]
  |  Branch (126:3): [True: 0, False: 0]
  ------------------
  127|    158|  DEBUGASSERT(ptr || !len);
  ------------------
  |  | 1081|    158|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (127:3): [True: 158, False: 0]
  |  Branch (127:3): [True: 0, False: 0]
  |  Branch (127:3): [True: 158, False: 0]
  |  Branch (127:3): [True: 0, False: 0]
  ------------------
  128|    158|  DEBUGASSERT(len <= CURL_MAX_INPUT_LENGTH);
  ------------------
  |  | 1081|    158|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (128:3): [True: 0, False: 158]
  |  Branch (128:3): [True: 158, False: 0]
  ------------------
  129|       |
  130|    158|  if(ptr) {
  ------------------
  |  Branch (130:6): [True: 158, False: 0]
  ------------------
  131|    158|    cpy = curlx_memdup0(ptr, len);
  132|    158|    if(!cpy)
  ------------------
  |  Branch (132:8): [True: 0, False: 158]
  ------------------
  133|      0|      return CURLE_OUT_OF_MEMORY;
  134|    158|  }
  135|       |
  136|    158|  Curl_bufref_set(br, cpy, len, curl_free);
  137|    158|  return CURLE_OK;
  138|    158|}

Curl_cf_dns_add:
  414|  14.7k|{
  415|  14.7k|  struct Curl_cfilter *cf = NULL;
  416|  14.7k|  bool for_proxy = FALSE;
  ------------------
  |  | 1058|  14.7k|#define FALSE false
  ------------------
  417|  14.7k|  CURLcode result;
  418|       |
  419|  14.7k|  if(!peer)
  ------------------
  |  Branch (419:6): [True: 0, False: 14.7k]
  ------------------
  420|      0|    return CURLE_FAILED_INIT;
  421|  14.7k|#ifndef CURL_DISABLE_PROXY
  422|  14.7k|  for_proxy = (peer == conn->socks_proxy.peer) ||
  ------------------
  |  Branch (422:15): [True: 421, False: 14.3k]
  ------------------
  423|  14.3k|              (peer == conn->http_proxy.peer);
  ------------------
  |  Branch (423:15): [True: 8.63k, False: 5.67k]
  ------------------
  424|  14.7k|#endif
  425|       |
  426|  14.7k|  result = cf_dns_create(&cf, data, peer, dns_queries, transport,
  427|  14.7k|                         for_proxy, FALSE);
  ------------------
  |  | 1058|  14.7k|#define FALSE false
  ------------------
  428|  14.7k|  if(result)
  ------------------
  |  Branch (428:6): [True: 0, False: 14.7k]
  ------------------
  429|      0|    goto out;
  430|  14.7k|  Curl_conn_cf_add(data, conn, sockindex, cf);
  431|  14.7k|out:
  432|  14.7k|  return result;
  433|  14.7k|}
Curl_cf_dns_insert_after:
  447|     60|{
  448|     60|  struct Curl_cfilter *cf;
  449|     60|  CURLcode result;
  450|       |
  451|     60|  result = cf_dns_create(&cf, data, peer, dns_queries, transport,
  452|     60|                         FALSE, complete_resolve);
  ------------------
  |  | 1058|     60|#define FALSE false
  ------------------
  453|     60|  if(result)
  ------------------
  |  Branch (453:6): [True: 0, False: 60]
  ------------------
  454|      0|    return result;
  455|       |
  456|     60|  Curl_conn_cf_insert_after(cf_at, cf);
  457|     60|  return CURLE_OK;
  458|     60|}
Curl_conn_dns_result:
  484|   149k|{
  485|   149k|  return cf_dns_result(conn->cfilter[sockindex]);
  486|   149k|}
Curl_cf_dns_get_ai:
  520|   378k|{
  521|   378k|  (void)data;
  522|   378k|  for(; cf; cf = cf->next) {
  ------------------
  |  Branch (522:9): [True: 378k, False: 0]
  ------------------
  523|   378k|    if(cf->cft == &Curl_cft_dns) {
  ------------------
  |  Branch (523:8): [True: 378k, False: 0]
  ------------------
  524|   378k|      struct cf_dns_ctx *ctx = cf->ctx;
  525|   378k|      if(ctx->resolv_result)
  ------------------
  |  Branch (525:10): [True: 0, False: 378k]
  ------------------
  526|      0|        return NULL;
  527|   378k|      else if(ctx->dns)
  ------------------
  |  Branch (527:15): [True: 28.6k, False: 349k]
  ------------------
  528|  28.6k|        return cf_dns_get_nth_ai(cf, ctx->dns->addr, ai_family, index);
  529|   349k|      else
  530|   349k|        return Curl_resolv_get_ai(data, ctx->resolv_id, ai_family, index);
  531|   378k|    }
  532|   378k|  }
  533|      0|  return NULL;
  534|   378k|}
Curl_conn_dns_get_ai:
  543|   378k|{
  544|   378k|  struct connectdata *conn = data->conn;
  545|   378k|  return Curl_cf_dns_get_ai(conn->cfilter[sockindex], data, ai_family, index);
  546|   378k|}
cf-dns.c:cf_dns_destroy:
  306|  14.7k|{
  307|  14.7k|  struct cf_dns_ctx *ctx = cf->ctx;
  308|       |
  309|  14.7k|  CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|  14.7k|  do {                                          \
  |  |  154|  14.7k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  14.7k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  29.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 14.7k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 14.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  29.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  14.7k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  14.7k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  14.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 14.7k]
  |  |  ------------------
  ------------------
  310|  14.7k|  cf_dns_ctx_destroy(data, ctx);
  311|  14.7k|}
cf-dns.c:cf_dns_ctx_destroy:
   77|  14.7k|{
   78|  14.7k|  if(ctx) {
  ------------------
  |  Branch (78:6): [True: 14.7k, False: 0]
  ------------------
   79|  14.7k|    Curl_peer_unlink(&ctx->peer);
   80|  14.7k|    Curl_dns_entry_unlink(data, &ctx->dns);
   81|  14.7k|    curlx_free(ctx);
  ------------------
  |  | 1483|  14.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   82|  14.7k|  }
   83|  14.7k|}
cf-dns.c:cf_dns_connect:
  247|   389k|{
  248|   389k|  struct cf_dns_ctx *ctx = cf->ctx;
  249|       |
  250|   389k|  if(cf->connected) {
  ------------------
  |  Branch (250:6): [True: 6, False: 389k]
  ------------------
  251|      6|    *done = TRUE;
  ------------------
  |  | 1055|      6|#define TRUE true
  ------------------
  252|      6|    return CURLE_OK;
  253|      6|  }
  254|       |
  255|   389k|  *done = FALSE;
  ------------------
  |  | 1058|   389k|#define FALSE false
  ------------------
  256|   389k|  if(!ctx->started) {
  ------------------
  |  Branch (256:6): [True: 14.7k, False: 374k]
  ------------------
  257|  14.7k|    ctx->started = TRUE;
  ------------------
  |  | 1055|  14.7k|#define TRUE true
  ------------------
  258|  14.7k|    ctx->resolv_result = cf_dns_start(cf, data, &ctx->dns);
  259|  14.7k|  }
  260|       |
  261|   389k|  if(!ctx->dns && !ctx->resolv_result) {
  ------------------
  |  Branch (261:6): [True: 302k, False: 86.6k]
  |  Branch (261:19): [True: 302k, False: 106]
  ------------------
  262|   302k|    ctx->resolv_result =
  263|   302k|      Curl_resolv_take_result(data, ctx->resolv_id, &ctx->dns);
  264|   302k|  }
  265|       |
  266|   389k|  if(ctx->resolv_result) {
  ------------------
  |  Branch (266:6): [True: 496, False: 389k]
  ------------------
  267|    496|    CURL_TRC_CF(data, cf, "error resolving: %d", ctx->resolv_result);
  ------------------
  |  |  153|    496|  do {                                          \
  |  |  154|    496|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    496|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    992|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 496, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 496]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    992|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    496|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    496|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    496|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 496]
  |  |  ------------------
  ------------------
  268|    496|    return ctx->resolv_result;
  269|    496|  }
  270|       |
  271|   389k|  if(ctx->dns && !ctx->announced) {
  ------------------
  |  Branch (271:6): [True: 86.6k, False: 302k]
  |  Branch (271:18): [True: 14.0k, False: 72.5k]
  ------------------
  272|  14.0k|    ctx->announced = TRUE;
  ------------------
  |  | 1055|  14.0k|#define TRUE true
  ------------------
  273|  14.0k|    if(cf->sockindex == FIRSTSOCKET) {
  ------------------
  |  |  303|  14.0k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (273:8): [True: 13.1k, False: 904]
  ------------------
  274|  13.1k|      cf->conn->bits.dns_resolved = TRUE;
  ------------------
  |  | 1055|  13.1k|#define TRUE true
  ------------------
  275|  13.1k|      Curl_pgrsTime(data, TIMER_NAMELOOKUP);
  276|  13.1k|    }
  277|  14.0k|    cf_dns_report(cf, data, ctx->dns);
  278|  14.0k|  }
  279|       |
  280|   389k|  if(!cf_dns_ready_to_connect(cf, data)) {
  ------------------
  |  Branch (280:6): [True: 95.4k, False: 293k]
  ------------------
  281|  95.4k|    return CURLE_OK;
  282|  95.4k|  }
  283|       |
  284|   293k|  if(cf->next && !cf->next->connected) {
  ------------------
  |  Branch (284:6): [True: 293k, False: 0]
  |  Branch (284:18): [True: 221k, False: 71.9k]
  ------------------
  285|   221k|    bool sub_done;
  286|   221k|    CURLcode result = Curl_conn_cf_connect(cf->next, data, &sub_done);
  287|   221k|    if(result || !sub_done)
  ------------------
  |  Branch (287:8): [True: 4.20k, False: 217k]
  |  Branch (287:18): [True: 207k, False: 9.80k]
  ------------------
  288|   211k|      return result;
  289|  9.80k|    DEBUGASSERT(sub_done);
  ------------------
  |  | 1081|  9.80k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (289:5): [True: 0, False: 9.80k]
  |  Branch (289:5): [True: 9.80k, False: 0]
  ------------------
  290|  9.80k|  }
  291|       |
  292|       |  /* sub filter chain is connected */
  293|  81.7k|  CURL_TRC_CF(data, cf, "connected filter chain below");
  ------------------
  |  |  153|  81.7k|  do {                                          \
  |  |  154|  81.7k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  81.7k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|   163k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 81.7k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 81.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|   163k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  81.7k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  81.7k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  81.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 81.7k]
  |  |  ------------------
  ------------------
  294|  81.7k|  if(ctx->complete_resolve && !ctx->dns && !ctx->resolv_result) {
  ------------------
  |  Branch (294:6): [True: 71.9k, False: 9.80k]
  |  Branch (294:31): [True: 71.8k, False: 41]
  |  Branch (294:44): [True: 71.8k, False: 0]
  ------------------
  295|       |    /* This filter only connects when it has resolved everything. */
  296|  71.8k|    CURL_TRC_CF(data, cf, "delay connect until resolve complete");
  ------------------
  |  |  153|  71.8k|  do {                                          \
  |  |  154|  71.8k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  71.8k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|   143k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 71.8k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 71.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|   143k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  71.8k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  71.8k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  71.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 71.8k]
  |  |  ------------------
  ------------------
  297|  71.8k|    return CURLE_OK;
  298|  71.8k|  }
  299|  9.84k|  *done = TRUE;
  ------------------
  |  | 1055|  9.84k|#define TRUE true
  ------------------
  300|       |  cf->connected = TRUE;
  ------------------
  |  | 1055|  9.84k|#define TRUE true
  ------------------
  301|  9.84k|  Curl_resolv_destroy(data, ctx->resolv_id);
  302|  9.84k|  return CURLE_OK;
  303|  81.7k|}
cf-dns.c:cf_dns_start:
  165|  14.7k|{
  166|  14.7k|  struct cf_dns_ctx *ctx = cf->ctx;
  167|  14.7k|  timediff_t timeout_ms = Curl_timeleft_ms(data);
  168|  14.7k|  CURLcode result;
  169|       |
  170|  14.7k|  *pdns = NULL;
  171|       |
  172|  14.7k|  CURL_TRC_CF(data, cf, "cf_dns_start %s %s:%u",
  ------------------
  |  |  153|  14.7k|  do {                                          \
  |  |  154|  14.7k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  14.7k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  29.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 14.7k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 14.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  29.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  14.7k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  14.7k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|  14.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 14.7k]
  |  |  ------------------
  ------------------
  173|  14.7k|              ctx->peer->unix_socket ? "unix-domain-socket" : "host",
  174|  14.7k|              ctx->peer->hostname, ctx->peer->port);
  175|  14.7k|  if(ctx->peer->unix_socket)
  ------------------
  |  Branch (175:6): [True: 112, False: 14.6k]
  ------------------
  176|    112|    ctx->dns_queries = 0;
  177|  14.6k|  else if(Curl_is_ipv4addr(ctx->peer->hostname))
  ------------------
  |  Branch (177:11): [True: 13.8k, False: 802]
  ------------------
  178|  13.8k|    ctx->dns_queries |= CURL_DNSQ_A;
  ------------------
  |  |   51|  13.8k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  179|    802|#ifdef USE_IPV6
  180|    802|  else if(ctx->peer->ipv6)
  ------------------
  |  Branch (180:11): [True: 86, False: 716]
  ------------------
  181|     86|    ctx->dns_queries |= CURL_DNSQ_AAAA;
  ------------------
  |  |   52|     86|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  182|  14.7k|#endif
  183|       |
  184|  14.7k|  result = Curl_resolv(data, ctx->peer, ctx->dns_queries, ctx->transport,
  185|  14.7k|                       (bool)ctx->for_proxy, timeout_ms,
  186|  14.7k|                       &ctx->resolv_id, pdns);
  187|  14.7k|  DEBUGASSERT(!result || !*pdns);
  ------------------
  |  | 1081|  14.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (187:3): [True: 14.7k, False: 0]
  |  Branch (187:3): [True: 0, False: 0]
  |  Branch (187:3): [True: 14.0k, False: 709]
  |  Branch (187:3): [True: 709, False: 0]
  ------------------
  188|  14.7k|  if(!result) { /* resolved right away, either sync or from dnscache */
  ------------------
  |  Branch (188:6): [True: 14.0k, False: 709]
  ------------------
  189|  14.0k|    DEBUGASSERT(*pdns);
  ------------------
  |  | 1081|  14.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (189:5): [True: 0, False: 14.0k]
  |  Branch (189:5): [True: 14.0k, False: 0]
  ------------------
  190|  14.0k|    return CURLE_OK;
  191|  14.0k|  }
  192|    709|  else if(result == CURLE_AGAIN) { /* async resolv in progress */
  ------------------
  |  Branch (192:11): [True: 603, False: 106]
  ------------------
  193|    603|    return CURLE_OK;
  194|    603|  }
  195|    106|  else if(result == CURLE_OPERATION_TIMEDOUT) { /* took too long */
  ------------------
  |  Branch (195:11): [True: 0, False: 106]
  ------------------
  196|      0|    failf(data, "Failed to resolve '%s' with timeout after %"
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  197|      0|          FMT_TIMEDIFF_T " ms", ctx->peer->hostname,
  198|      0|          curlx_ptimediff_ms(Curl_pgrs_now(data),
  199|      0|                             &data->progress.t_startsingle));
  200|      0|    return CURLE_OPERATION_TIMEDOUT;
  201|      0|  }
  202|    106|  else {
  203|    106|    DEBUGASSERT(result);
  ------------------
  |  | 1081|    106|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (203:5): [True: 0, False: 106]
  |  Branch (203:5): [True: 106, False: 0]
  ------------------
  204|    106|    failf(data, "Could not resolve: %s", ctx->peer->hostname);
  ------------------
  |  |   62|    106|#define failf Curl_failf
  ------------------
  205|    106|    return result;
  206|    106|  }
  207|  14.7k|}
cf-dns.c:cf_dns_report:
  116|  14.0k|{
  117|  14.0k|  struct cf_dns_ctx *ctx = cf->ctx;
  118|  14.0k|  struct dynbuf tmp;
  119|       |
  120|  14.0k|  if(!Curl_trc_is_verbose(data) ||
  ------------------
  |  |  319|  28.1k|  ((data) && (data)->set.verbose &&                        \
  |  |  ------------------
  |  |  |  Branch (319:4): [True: 14.0k, False: 0]
  |  |  |  Branch (319:14): [True: 0, False: 14.0k]
  |  |  ------------------
  |  |  320|  28.1k|   (!(data)->state.feat ||                                 \
  |  |  ------------------
  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  ------------------
  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  121|       |     /* ignore no name or numerical IP addresses */
  122|      0|     !dns->hostname[0] || Curl_host_is_ipnum(dns->hostname))
  ------------------
  |  Branch (122:6): [True: 0, False: 0]
  |  Branch (122:27): [True: 0, False: 0]
  ------------------
  123|  14.0k|    return;
  124|       |
  125|      0|  if(ctx->peer->unix_socket) {
  ------------------
  |  Branch (125:6): [True: 0, False: 0]
  ------------------
  126|      0|#ifdef USE_UNIX_SOCKETS
  127|      0|    CURL_TRC_CF(data, cf, "resolved unix://%s", ctx->peer->hostname);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  128|       |#else
  129|       |    DEBUGASSERT(0);
  130|       |#endif
  131|      0|  }
  132|      0|  else {
  133|      0|    curlx_dyn_init(&tmp, 1024);
  134|      0|    infof(data, "Host %s:%u was resolved.", dns->hostname, dns->port);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  135|      0|#ifdef CURLRES_IPV6
  136|      0|    cf_dns_report_addr(data, &tmp, "IPv6: ", AF_INET6, dns->addr);
  137|      0|#endif
  138|      0|    cf_dns_report_addr(data, &tmp, "IPv4: ", AF_INET, dns->addr);
  139|       |#ifdef USE_HTTPSRR
  140|       |    if(!dns->hinfo)
  141|       |      infof(data, "HTTPS-RR: -");
  142|       |    else if(!Curl_httpsrr_applicable(data, dns->hinfo))
  143|       |      infof(data, "HTTPS-RR: not applicable");
  144|       |    else {
  145|       |      CURLcode result = Curl_httpsrr_print(&tmp, dns->hinfo);
  146|       |      if(!result)
  147|       |        infof(data, "HTTPS-RR: %s", curlx_dyn_ptr(&tmp));
  148|       |      else
  149|       |        infof(data, "Error printing HTTPS-RR information");
  150|       |    }
  151|       |#endif
  152|      0|    curlx_dyn_free(&tmp);
  153|      0|  }
  154|      0|}
cf-dns.c:cf_dns_ready_to_connect:
  213|   389k|{
  214|   389k|  struct cf_dns_ctx *ctx = cf->ctx;
  215|       |
  216|   389k|  if(ctx->resolv_result)
  ------------------
  |  Branch (216:6): [True: 0, False: 389k]
  ------------------
  217|      0|    return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  218|   389k|  else if(ctx->dns)
  ------------------
  |  Branch (218:11): [True: 86.6k, False: 302k]
  ------------------
  219|  86.6k|    return TRUE;
  ------------------
  |  | 1055|  86.6k|#define TRUE true
  ------------------
  220|   302k|#ifdef USE_CURL_ASYNC
  221|   302k|  else {
  222|       |    /* We want AAAA answer as we prefer ipv6. If a sub-filter desires
  223|       |    * HTTPS-RR, we check for that query as well. */
  224|   302k|    uint8_t wanted_answers = CURL_DNSQ_AAAA;
  ------------------
  |  |   52|   302k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  225|   302k|    if(Curl_conn_cf_wants_httpsrr(cf, data))
  ------------------
  |  Branch (225:8): [True: 77.1k, False: 225k]
  ------------------
  226|  77.1k|      wanted_answers |= CURL_DNSQ_HTTPS;
  ------------------
  |  |   53|  77.1k|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  227|       |
  228|       |    /* Note: if a query was never started, it is considered to have
  229|       |     * an answer (e.g. a negative one). */
  230|   302k|    if(Curl_resolv_has_answers(data, ctx->resolv_id, wanted_answers))
  ------------------
  |  Branch (230:8): [True: 100k, False: 202k]
  ------------------
  231|   100k|      return TRUE;
  ------------------
  |  | 1055|   100k|#define TRUE true
  ------------------
  232|       |    /* If the wanted answers are not available after a delay,
  233|       |     * we let the connect attempts start anyway. */
  234|   202k|    return Curl_resolv_elapsed_ms(data, ctx->resolv_id) >=
  235|   202k|           CURL_HEV3_RESOLVE_DELAY_MS;
  ------------------
  |  |  209|   202k|#define CURL_HEV3_RESOLVE_DELAY_MS    50
  ------------------
  236|   302k|  }
  237|       |#else
  238|       |  (void)data;
  239|       |  DEBUGASSERT(0); /* We should not come here */
  240|       |  return FALSE;
  241|       |#endif /* USE_CURL_ASYNC */
  242|   389k|}
cf-dns.c:cf_dns_close:
  314|  4.98k|{
  315|  4.98k|  cf->connected = FALSE;
  ------------------
  |  | 1058|  4.98k|#define FALSE false
  ------------------
  316|  4.98k|  if(cf->next)
  ------------------
  |  Branch (316:6): [True: 4.98k, False: 0]
  ------------------
  317|  4.98k|    cf->next->cft->do_close(cf->next, data);
  318|  4.98k|}
cf-dns.c:cf_dns_adjust_pollset:
  323|  71.9k|{
  324|  71.9k|#ifdef USE_CURL_ASYNC
  325|  71.9k|  if(!cf->connected)
  ------------------
  |  Branch (325:6): [True: 71.8k, False: 8]
  ------------------
  326|  71.8k|    return Curl_resolv_pollset(data, ps);
  327|       |#else
  328|       |  (void)cf;
  329|       |  (void)data;
  330|       |  (void)ps;
  331|       |#endif
  332|      8|  return CURLE_OK;
  333|  71.9k|}
cf-dns.c:cf_dns_cntrl:
  338|  14.7k|{
  339|  14.7k|  struct cf_dns_ctx *ctx = cf->ctx;
  340|  14.7k|  CURLcode result = CURLE_OK;
  341|       |
  342|  14.7k|  (void)arg1;
  343|  14.7k|  (void)arg2;
  344|  14.7k|  switch(event) {
  345|  4.92k|  case CF_CTRL_DATA_DONE:
  ------------------
  |  |  122|  4.92k|#define CF_CTRL_DATA_DONE               7  /* premature  NULL     ignored */
  ------------------
  |  Branch (345:3): [True: 4.92k, False: 9.80k]
  ------------------
  346|  4.92k|    if(ctx->dns) {
  ------------------
  |  Branch (346:8): [True: 4.28k, False: 644]
  ------------------
  347|       |      /* Should only come here when the connect attempt failed and
  348|       |       * `data` is giving up on it. On a successful connect, we already
  349|       |       * unlinked the DNS entry. */
  350|  4.28k|      Curl_dns_entry_unlink(data, &ctx->dns);
  351|  4.28k|    }
  352|  4.92k|    break;
  353|  9.80k|  default:
  ------------------
  |  Branch (353:3): [True: 9.80k, False: 4.92k]
  ------------------
  354|  9.80k|    break;
  355|  14.7k|  }
  356|  14.7k|  return result;
  357|  14.7k|}
cf-dns.c:cf_dns_create:
  384|  14.7k|{
  385|  14.7k|  struct Curl_cfilter *cf = NULL;
  386|  14.7k|  struct cf_dns_ctx *ctx;
  387|  14.7k|  CURLcode result = CURLE_OK;
  388|       |
  389|  14.7k|  (void)data;
  390|  14.7k|  ctx = cf_dns_ctx_create(data, peer, dns_queries, transport,
  391|  14.7k|                          for_proxy, complete_resolve);
  392|  14.7k|  if(!ctx) {
  ------------------
  |  Branch (392:6): [True: 0, False: 14.7k]
  ------------------
  393|      0|    result = CURLE_OUT_OF_MEMORY;
  394|      0|    goto out;
  395|      0|  }
  396|       |
  397|  14.7k|  result = Curl_cf_create(&cf, &Curl_cft_dns, ctx);
  398|       |
  399|  14.7k|out:
  400|  14.7k|  *pcf = result ? NULL : cf;
  ------------------
  |  Branch (400:10): [True: 0, False: 14.7k]
  ------------------
  401|  14.7k|  if(result)
  ------------------
  |  Branch (401:6): [True: 0, False: 14.7k]
  ------------------
  402|      0|    cf_dns_ctx_destroy(data, ctx);
  403|  14.7k|  return result;
  404|  14.7k|}
cf-dns.c:cf_dns_ctx_create:
   57|  14.7k|{
   58|  14.7k|  struct cf_dns_ctx *ctx;
   59|       |
   60|  14.7k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1480|  14.7k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   61|  14.7k|  if(!ctx)
  ------------------
  |  Branch (61:6): [True: 0, False: 14.7k]
  ------------------
   62|      0|    return NULL;
   63|       |
   64|  14.7k|  Curl_peer_link(&ctx->peer, peer);
   65|  14.7k|  ctx->dns_queries = dns_queries;
   66|  14.7k|  ctx->transport = transport;
   67|  14.7k|  ctx->for_proxy = for_proxy;
   68|  14.7k|  ctx->complete_resolve = complete_resolve;
   69|       |
   70|  14.7k|  CURL_TRC_DNS(data, "created DNS filter for %s:%u, transport=%x, queries=%x",
  ------------------
  |  |  168|  14.7k|  do {                                 \
  |  |  169|  14.7k|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|  14.7k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  14.7k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  29.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 14.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 14.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  29.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  14.7k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  14.7k|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|  14.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 14.7k]
  |  |  ------------------
  ------------------
   71|  14.7k|               peer->hostname, peer->port, ctx->transport, ctx->dns_queries);
   72|  14.7k|  return ctx;
   73|  14.7k|}
cf-dns.c:cf_dns_result:
  464|   149k|{
  465|   149k|  for(; cf; cf = cf->next) {
  ------------------
  |  Branch (465:9): [True: 149k, False: 0]
  ------------------
  466|   149k|    if(cf->cft == &Curl_cft_dns) {
  ------------------
  |  Branch (466:8): [True: 149k, False: 0]
  ------------------
  467|   149k|      struct cf_dns_ctx *ctx = cf->ctx;
  468|   149k|      if(ctx->dns || ctx->resolv_result)
  ------------------
  |  Branch (468:10): [True: 14.0k, False: 135k]
  |  Branch (468:22): [True: 0, False: 135k]
  ------------------
  469|  14.0k|        return ctx->resolv_result;
  470|   135k|      return CURLE_AGAIN;
  471|   149k|    }
  472|   149k|  }
  473|      0|  return CURLE_FAILED_INIT;
  474|   149k|}
cf-dns.c:cf_dns_get_nth_ai:
  492|  28.6k|{
  493|  28.6k|  struct cf_dns_ctx *ctx = cf->ctx;
  494|  28.6k|  unsigned int i = 0;
  495|       |
  496|  28.6k|  if((ai_family == AF_INET) && !(ctx->dns_queries & CURL_DNSQ_A))
  ------------------
  |  |   51|  14.2k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  |  Branch (496:6): [True: 14.2k, False: 14.3k]
  |  Branch (496:32): [True: 0, False: 14.2k]
  ------------------
  497|      0|    return NULL;
  498|  28.6k|#ifdef USE_IPV6
  499|  28.6k|  if((ai_family == AF_INET6) && !(ctx->dns_queries & CURL_DNSQ_AAAA))
  ------------------
  |  |   52|  14.2k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (499:6): [True: 14.2k, False: 14.3k]
  |  Branch (499:33): [True: 4, False: 14.2k]
  ------------------
  500|      4|    return NULL;
  501|  28.6k|#endif
  502|  43.1k|  for(i = 0; ai; ai = ai->ai_next) {
  ------------------
  |  Branch (502:14): [True: 28.6k, False: 14.5k]
  ------------------
  503|  28.6k|    if(ai->ai_family == ai_family) {
  ------------------
  |  Branch (503:8): [True: 14.4k, False: 14.2k]
  ------------------
  504|  14.4k|      if(i == index)
  ------------------
  |  Branch (504:10): [True: 14.1k, False: 337]
  ------------------
  505|  14.1k|        return ai;
  506|    337|      ++i;
  507|    337|    }
  508|  28.6k|  }
  509|  14.5k|  return NULL;
  510|  28.6k|}

Curl_cf_h1_proxy_insert_after:
  970|  7.98k|{
  971|  7.98k|  struct Curl_cfilter *cf;
  972|  7.98k|  struct cf_h1_proxy_ctx *pctx;
  973|  7.98k|  struct h1_tunnel_state *ts;
  974|  7.98k|  CURLcode result;
  975|       |
  976|  7.98k|  (void)data;
  977|  7.98k|  if(!dest)
  ------------------
  |  Branch (977:6): [True: 0, False: 7.98k]
  ------------------
  978|      0|    return CURLE_FAILED_INIT;
  979|  7.98k|  if((httpversion < 10) || (httpversion >= 20))
  ------------------
  |  Branch (979:6): [True: 0, False: 7.98k]
  |  Branch (979:28): [True: 0, False: 7.98k]
  ------------------
  980|      0|    return CURLE_FAILED_INIT;
  981|       |
  982|  7.98k|  ts = curlx_calloc(1, sizeof(*ts));
  ------------------
  |  | 1480|  7.98k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  983|  7.98k|  if(!ts) {
  ------------------
  |  Branch (983:6): [True: 0, False: 7.98k]
  ------------------
  984|      0|    result = CURLE_OUT_OF_MEMORY;
  985|      0|    goto out;
  986|      0|  }
  987|  7.98k|  Curl_peer_link(&ts->dest, dest);
  988|  7.98k|  ts->httpversion = httpversion;
  989|  7.98k|  curlx_dyn_init(&ts->rcvbuf, DYN_PROXY_CONNECT_HEADERS);
  ------------------
  |  |   73|  7.98k|#define DYN_PROXY_CONNECT_HEADERS 16384
  ------------------
  990|  7.98k|  curlx_dyn_init(&ts->request_data, DYN_HTTP_REQUEST);
  ------------------
  |  |   69|  7.98k|#define DYN_HTTP_REQUEST    (1024 * 1024)
  ------------------
  991|  7.98k|  Curl_httpchunk_init(data, &ts->ch, TRUE);
  ------------------
  |  | 1055|  7.98k|#define TRUE true
  ------------------
  992|       |
  993|  7.98k|  pctx = curlx_calloc(1, sizeof(*pctx));
  ------------------
  |  | 1480|  7.98k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  994|  7.98k|  if(!pctx) {
  ------------------
  |  Branch (994:6): [True: 0, False: 7.98k]
  ------------------
  995|      0|    result = CURLE_OUT_OF_MEMORY;
  996|      0|    goto out;
  997|      0|  }
  998|  7.98k|  pctx->udp_tunnel = udp_tunnel;
  999|  7.98k|  pctx->ts = ts;
 1000|  7.98k|  result = Curl_cf_create(&cf, &Curl_cft_h1_proxy, pctx);
 1001|  7.98k|  if(result) {
  ------------------
  |  Branch (1001:6): [True: 0, False: 7.98k]
  ------------------
 1002|      0|    curlx_free(pctx);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1003|      0|    goto out;
 1004|      0|  }
 1005|  7.98k|  ts = NULL;
 1006|  7.98k|  Curl_conn_cf_insert_after(cf_at, cf);
 1007|       |
 1008|  7.98k|out:
 1009|  7.98k|  tunnel_free(ts, data);
 1010|  7.98k|  return result;
 1011|  7.98k|}
cf-h1-proxy.c:cf_h1_proxy_destroy:
  902|  7.98k|{
  903|  7.98k|  CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|  7.98k|  do {                                          \
  |  |  154|  7.98k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  7.98k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  15.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 7.98k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 7.98k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  15.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  7.98k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  7.98k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  7.98k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 7.98k]
  |  |  ------------------
  ------------------
  904|  7.98k|  cf_tunnel_free(cf, data);
  905|       |  curlx_safefree(cf->ctx);
  ------------------
  |  | 1327|  7.98k|  do {                      \
  |  | 1328|  7.98k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  7.98k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  7.98k|    (ptr) = NULL;           \
  |  | 1330|  7.98k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 7.98k]
  |  |  ------------------
  ------------------
  906|  7.98k|}
cf-h1-proxy.c:cf_tunnel_free:
  214|  14.6k|{
  215|  14.6k|  if(cf) {
  ------------------
  |  Branch (215:6): [True: 14.6k, False: 0]
  ------------------
  216|  14.6k|    struct cf_h1_proxy_ctx *pctx = cf->ctx;
  217|  14.6k|    struct h1_tunnel_state *ts = pctx ? pctx->ts : NULL;
  ------------------
  |  Branch (217:34): [True: 14.6k, False: 0]
  ------------------
  218|  14.6k|    if(ts) {
  ------------------
  |  Branch (218:8): [True: 7.98k, False: 6.62k]
  ------------------
  219|  7.98k|      h1_tunnel_go_state(cf, ts, H1_TUNNEL_FAILED, data);
  220|  7.98k|      tunnel_free(ts, data);
  221|       |      pctx->ts = NULL;
  222|  7.98k|    }
  223|  14.6k|  }
  224|  14.6k|}
cf-h1-proxy.c:h1_tunnel_go_state:
  148|  40.0k|{
  149|  40.0k|  if(ts->tunnel_state == new_state)
  ------------------
  |  Branch (149:6): [True: 0, False: 40.0k]
  ------------------
  150|      0|    return;
  151|       |  /* entering this one */
  152|  40.0k|  switch(new_state) {
  ------------------
  |  Branch (152:10): [True: 40.0k, False: 0]
  ------------------
  153|  1.36k|  case H1_TUNNEL_INIT:
  ------------------
  |  Branch (153:3): [True: 1.36k, False: 38.6k]
  ------------------
  154|  1.36k|    CURL_TRC_CF(data, cf, "new tunnel state 'init'");
  ------------------
  |  |  153|  1.36k|  do {                                          \
  |  |  154|  1.36k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  1.36k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  2.73k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 1.36k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.36k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  2.73k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  1.36k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.36k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.36k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.36k]
  |  |  ------------------
  ------------------
  155|  1.36k|    tunnel_reinit(cf, data, ts);
  156|  1.36k|    break;
  157|       |
  158|  7.97k|  case H1_TUNNEL_CONNECT:
  ------------------
  |  Branch (158:3): [True: 7.97k, False: 32.0k]
  ------------------
  159|  7.97k|    CURL_TRC_CF(data, cf, "new tunnel state 'connect'");
  ------------------
  |  |  153|  7.97k|  do {                                          \
  |  |  154|  7.97k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  7.97k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  15.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 7.97k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 7.97k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  15.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  7.97k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  7.97k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  7.97k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 7.97k]
  |  |  ------------------
  ------------------
  160|  7.97k|    ts->tunnel_state = H1_TUNNEL_CONNECT;
  161|  7.97k|    ts->keepon = KEEPON_CONNECT;
  162|  7.97k|    curlx_dyn_reset(&ts->rcvbuf);
  163|  7.97k|    break;
  164|       |
  165|  7.97k|  case H1_TUNNEL_RECEIVE:
  ------------------
  |  Branch (165:3): [True: 7.97k, False: 32.0k]
  ------------------
  166|  7.97k|    CURL_TRC_CF(data, cf, "new tunnel state 'receive'");
  ------------------
  |  |  153|  7.97k|  do {                                          \
  |  |  154|  7.97k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  7.97k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  15.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 7.97k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 7.97k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  15.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  7.97k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  7.97k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  7.97k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 7.97k]
  |  |  ------------------
  ------------------
  167|  7.97k|    ts->tunnel_state = H1_TUNNEL_RECEIVE;
  168|  7.97k|    break;
  169|       |
  170|  6.74k|  case H1_TUNNEL_RESPONSE:
  ------------------
  |  Branch (170:3): [True: 6.74k, False: 33.3k]
  ------------------
  171|  6.74k|    CURL_TRC_CF(data, cf, "new tunnel state 'response'");
  ------------------
  |  |  153|  6.74k|  do {                                          \
  |  |  154|  6.74k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  6.74k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  13.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 6.74k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 6.74k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  13.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  6.74k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  6.74k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  6.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 6.74k]
  |  |  ------------------
  ------------------
  172|  6.74k|    ts->tunnel_state = H1_TUNNEL_RESPONSE;
  173|  6.74k|    break;
  174|       |
  175|  6.62k|  case H1_TUNNEL_ESTABLISHED:
  ------------------
  |  Branch (175:3): [True: 6.62k, False: 33.4k]
  ------------------
  176|  6.62k|    CURL_TRC_CF(data, cf, "new tunnel state 'established'");
  ------------------
  |  |  153|  6.62k|  do {                                          \
  |  |  154|  6.62k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  6.62k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  13.2k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 6.62k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 6.62k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  13.2k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  6.62k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  6.62k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  6.62k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 6.62k]
  |  |  ------------------
  ------------------
  177|  6.62k|    infof(data, "CONNECT%s phase completed for HTTP proxy",
  ------------------
  |  |  143|  6.62k|  do {                               \
  |  |  144|  6.62k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  6.62k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 6.62k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 6.62k]
  |  |  |  |  ------------------
  |  |  |  |  320|  6.62k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  6.62k|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|  6.62k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 6.62k]
  |  |  ------------------
  ------------------
  178|  6.62k|          h1_proxy_is_udp(cf) ? "-UDP" : "");
  179|       |
  180|  6.62k|    data->state.authproxy.done = TRUE;
  ------------------
  |  | 1055|  6.62k|#define TRUE true
  ------------------
  181|  6.62k|    data->state.authproxy.multipass = FALSE;
  ------------------
  |  | 1058|  6.62k|#define FALSE false
  ------------------
  182|  6.62k|    FALLTHROUGH();
  ------------------
  |  |  821|  6.62k|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  183|  15.9k|  case H1_TUNNEL_FAILED:
  ------------------
  |  Branch (183:3): [True: 9.35k, False: 30.6k]
  ------------------
  184|  15.9k|    if(new_state == H1_TUNNEL_FAILED)
  ------------------
  |  Branch (184:8): [True: 9.35k, False: 6.62k]
  ------------------
  185|  9.35k|      CURL_TRC_CF(data, cf, "new tunnel state 'failed'");
  ------------------
  |  |  153|  9.35k|  do {                                          \
  |  |  154|  9.35k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  9.35k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  18.7k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 9.35k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 9.35k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  18.7k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  9.35k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.35k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  9.35k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.35k]
  |  |  ------------------
  ------------------
  186|  15.9k|    ts->tunnel_state = new_state;
  187|  15.9k|    curlx_dyn_reset(&ts->rcvbuf);
  188|  15.9k|    curlx_dyn_reset(&ts->request_data);
  189|       |    /* restore the protocol pointer */
  190|  15.9k|    data->info.httpcode = 0; /* clear it as it might have been used for the
  191|       |                                proxy */
  192|       |    /* If a proxy-authorization header was used for the proxy, then we should
  193|       |       make sure that it is not accidentally used for the document request
  194|       |       after we have connected. Let's thus free and clear it here. */
  195|       |    curlx_safefree(data->req.hd_proxy_auth);
  ------------------
  |  | 1327|  15.9k|  do {                      \
  |  | 1328|  15.9k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  15.9k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  15.9k|    (ptr) = NULL;           \
  |  | 1330|  15.9k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 15.9k]
  |  |  ------------------
  ------------------
  196|  15.9k|    break;
  197|  40.0k|  }
  198|  40.0k|}
cf-h1-proxy.c:tunnel_reinit:
  102|  1.36k|{
  103|  1.36k|  (void)data;
  104|  1.36k|  (void)cf;
  105|  1.36k|  DEBUGASSERT(ts);
  ------------------
  |  | 1081|  1.36k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (105:3): [True: 0, False: 1.36k]
  |  Branch (105:3): [True: 1.36k, False: 0]
  ------------------
  106|  1.36k|  curlx_dyn_reset(&ts->rcvbuf);
  107|  1.36k|  curlx_dyn_reset(&ts->request_data);
  108|  1.36k|  ts->tunnel_state = H1_TUNNEL_INIT;
  109|  1.36k|  ts->keepon = KEEPON_CONNECT;
  110|  1.36k|  ts->cl = 0;
  111|  1.36k|  ts->close_connection = FALSE;
  ------------------
  |  | 1058|  1.36k|#define FALSE false
  ------------------
  112|  1.36k|  ts->maybe_folded = FALSE;
  ------------------
  |  | 1058|  1.36k|#define FALSE false
  ------------------
  113|       |  ts->leading_unfold = FALSE;
  ------------------
  |  | 1058|  1.36k|#define FALSE false
  ------------------
  114|  1.36k|  ts->nsent = 0;
  115|  1.36k|  ts->headerlines = 0;
  116|  1.36k|  return CURLE_OK;
  117|  1.36k|}
cf-h1-proxy.c:h1_proxy_is_udp:
   94|  61.7k|{
   95|  61.7k|  struct cf_h1_proxy_ctx *pctx = cf->ctx;
   96|  61.7k|  return (pctx->udp_tunnel ? TRUE : FALSE);
  ------------------
  |  | 1055|  61.7k|#define TRUE true
  ------------------
                return (pctx->udp_tunnel ? TRUE : FALSE);
  ------------------
  |  | 1058|  61.7k|#define FALSE false
  ------------------
  |  Branch (96:11): [True: 0, False: 61.7k]
  ------------------
   97|  61.7k|}
cf-h1-proxy.c:cf_h1_proxy_connect:
  819|  8.26k|{
  820|  8.26k|  CURLcode result;
  821|  8.26k|  struct cf_h1_proxy_ctx *pctx = cf->ctx;
  822|  8.26k|  struct h1_tunnel_state *ts = pctx->ts;
  823|       |
  824|  8.26k|  if(cf->connected) {
  ------------------
  |  Branch (824:6): [True: 0, False: 8.26k]
  ------------------
  825|      0|    *done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  826|      0|    return CURLE_OK;
  827|      0|  }
  828|       |
  829|  8.26k|  CURL_TRC_CF(data, cf, "connect");
  ------------------
  |  |  153|  8.26k|  do {                                          \
  |  |  154|  8.26k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  8.26k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  16.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 8.26k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 8.26k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  16.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  8.26k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  8.26k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  8.26k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 8.26k]
  |  |  ------------------
  ------------------
  830|  8.26k|  result = cf->next->cft->do_connect(cf->next, data, done);
  831|  8.26k|  if(result || !*done)
  ------------------
  |  Branch (831:6): [True: 0, False: 8.26k]
  |  Branch (831:16): [True: 0, False: 8.26k]
  ------------------
  832|      0|    return result;
  833|       |
  834|  8.26k|  *done = FALSE;
  ------------------
  |  | 1058|  8.26k|#define FALSE false
  ------------------
  835|  8.26k|  if(!ts) {
  ------------------
  |  Branch (835:6): [True: 0, False: 8.26k]
  ------------------
  836|      0|    result = tunnel_init(cf, data, &ts);
  837|      0|    if(result)
  ------------------
  |  Branch (837:8): [True: 0, False: 0]
  ------------------
  838|      0|      return result;
  839|      0|    pctx->ts = ts;
  840|      0|  }
  841|       |
  842|       |  /* We want "seamless" operations through HTTP proxy tunnel */
  843|       |
  844|  8.26k|  result = H1_CONNECT(cf, data, ts);
  845|  8.26k|  if(result)
  ------------------
  |  Branch (845:6): [True: 1.36k, False: 6.90k]
  ------------------
  846|  1.36k|    goto out;
  847|  6.90k|  curlx_safefree(data->req.hd_proxy_auth);
  ------------------
  |  | 1327|  6.90k|  do {                      \
  |  | 1328|  6.90k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  6.90k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  6.90k|    (ptr) = NULL;           \
  |  | 1330|  6.90k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 6.90k]
  |  |  ------------------
  ------------------
  848|       |
  849|  8.26k|out:
  850|  8.26k|  *done = (result == CURLE_OK) && tunnel_is_established(pctx->ts);
  ------------------
  |  Branch (850:11): [True: 6.90k, False: 1.36k]
  |  Branch (850:35): [True: 6.62k, False: 285]
  ------------------
  851|  8.26k|  if(*done) {
  ------------------
  |  Branch (851:6): [True: 6.62k, False: 1.64k]
  ------------------
  852|  6.62k|    cf->connected = TRUE;
  ------------------
  |  | 1055|  6.62k|#define TRUE true
  ------------------
  853|       |    /* The real request will follow the CONNECT, reset request partially */
  854|  6.62k|    Curl_req_soft_reset(&data->req, data);
  855|  6.62k|    Curl_client_reset(data);
  856|  6.62k|    Curl_pgrsReset(data);
  857|  6.62k|    cf_tunnel_free(cf, data);
  858|  6.62k|  }
  859|  8.26k|  return result;
  860|  6.90k|}
cf-h1-proxy.c:H1_CONNECT:
  692|  8.26k|{
  693|  8.26k|  struct connectdata *conn = cf->conn;
  694|  8.26k|  CURLcode result;
  695|  8.26k|  bool done;
  696|       |
  697|  8.26k|  if(tunnel_is_established(ts))
  ------------------
  |  Branch (697:6): [True: 0, False: 8.26k]
  ------------------
  698|      0|    return CURLE_OK;
  699|  8.26k|  if(tunnel_is_failed(ts))
  ------------------
  |  Branch (699:6): [True: 0, False: 8.26k]
  ------------------
  700|      0|    return CURLE_RECV_ERROR; /* Need a cfilter close and new bootstrap */
  701|       |
  702|  8.26k|  do {
  703|       |
  704|  8.26k|    if(Curl_timeleft_ms(data) < 0) {
  ------------------
  |  Branch (704:8): [True: 0, False: 8.26k]
  ------------------
  705|      0|      failf(data, "Proxy CONNECT aborted due to timeout");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  706|      0|      result = CURLE_OPERATION_TIMEDOUT;
  707|      0|      goto out;
  708|      0|    }
  709|       |
  710|  8.26k|    switch(ts->tunnel_state) {
  711|  7.98k|    case H1_TUNNEL_INIT:
  ------------------
  |  Branch (711:5): [True: 7.98k, False: 280]
  ------------------
  712|       |      /* Prepare the CONNECT request and make a first attempt to send. */
  713|  7.98k|      CURL_TRC_CF(data, cf, "CONNECT start");
  ------------------
  |  |  153|  7.98k|  do {                                          \
  |  |  154|  7.98k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  7.98k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  15.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 7.98k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 7.98k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  15.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  7.98k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  7.98k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  7.98k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 7.98k]
  |  |  ------------------
  ------------------
  714|  7.98k|      result = start_CONNECT(cf, data, ts);
  715|  7.98k|      if(result)
  ------------------
  |  Branch (715:10): [True: 10, False: 7.97k]
  ------------------
  716|     10|        goto out;
  717|  7.97k|      h1_tunnel_go_state(cf, ts, H1_TUNNEL_CONNECT, data);
  718|  7.97k|      FALLTHROUGH();
  ------------------
  |  |  821|  7.97k|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  719|       |
  720|  7.97k|    case H1_TUNNEL_CONNECT:
  ------------------
  |  Branch (720:5): [True: 0, False: 8.26k]
  ------------------
  721|       |      /* see that the request is completely sent */
  722|  7.97k|      CURL_TRC_CF(data, cf, "CONNECT send");
  ------------------
  |  |  153|  7.97k|  do {                                          \
  |  |  154|  7.97k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  7.97k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  15.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 7.97k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 7.97k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  15.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  7.97k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  7.97k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  7.97k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 7.97k]
  |  |  ------------------
  ------------------
  723|  7.97k|      result = send_CONNECT(cf, data, ts, &done);
  724|  7.97k|      if(result || !done)
  ------------------
  |  Branch (724:10): [True: 0, False: 7.97k]
  |  Branch (724:20): [True: 0, False: 7.97k]
  ------------------
  725|      0|        goto out;
  726|  7.97k|      h1_tunnel_go_state(cf, ts, H1_TUNNEL_RECEIVE, data);
  727|  7.97k|      FALLTHROUGH();
  ------------------
  |  |  821|  7.97k|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  728|       |
  729|  8.25k|    case H1_TUNNEL_RECEIVE:
  ------------------
  |  Branch (729:5): [True: 280, False: 7.98k]
  ------------------
  730|       |      /* read what is there */
  731|  8.25k|      CURL_TRC_CF(data, cf, "CONNECT receive");
  ------------------
  |  |  153|  8.25k|  do {                                          \
  |  |  154|  8.25k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  8.25k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  16.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 8.25k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 8.25k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  16.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  8.25k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  8.25k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  8.25k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 8.25k]
  |  |  ------------------
  ------------------
  732|  8.25k|      result = recv_CONNECT_resp(cf, data, ts, &done);
  733|  8.25k|      if(result)
  ------------------
  |  Branch (733:10): [True: 1.23k, False: 7.02k]
  ------------------
  734|  1.23k|        CURL_TRC_CF(data, cf, "error receiving CONNECT response: %d", result);
  ------------------
  |  |  153|  1.23k|  do {                                          \
  |  |  154|  1.23k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  1.23k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  2.46k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 1.23k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.23k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  2.46k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  1.23k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.23k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.23k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.23k]
  |  |  ------------------
  ------------------
  735|  8.25k|      if(!result)
  ------------------
  |  Branch (735:10): [True: 7.02k, False: 1.23k]
  ------------------
  736|  7.02k|        result = Curl_pgrsUpdate(data);
  737|       |      /* error or not complete yet. return for more multi-multi */
  738|  8.25k|      if(result || !done)
  ------------------
  |  Branch (738:10): [True: 1.23k, False: 7.02k]
  |  Branch (738:20): [True: 285, False: 6.74k]
  ------------------
  739|  1.51k|        goto out;
  740|       |      /* got it */
  741|  6.74k|      h1_tunnel_go_state(cf, ts, H1_TUNNEL_RESPONSE, data);
  742|  6.74k|      FALLTHROUGH();
  ------------------
  |  |  821|  6.74k|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  743|       |
  744|  6.74k|    case H1_TUNNEL_RESPONSE:
  ------------------
  |  Branch (744:5): [True: 0, False: 8.26k]
  ------------------
  745|  6.74k|      CURL_TRC_CF(data, cf, "CONNECT response");
  ------------------
  |  |  153|  6.74k|  do {                                          \
  |  |  154|  6.74k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  6.74k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  13.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 6.74k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 6.74k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  13.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  6.74k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  6.74k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  6.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 6.74k]
  |  |  ------------------
  ------------------
  746|  6.74k|      if(data->req.newurl) {
  ------------------
  |  Branch (746:10): [True: 0, False: 6.74k]
  ------------------
  747|       |        /* not the "final" response, we need to do a follow up request.
  748|       |         * If the other side indicated a connection close, or if someone
  749|       |         * else told us to close this connection, do so now.
  750|       |         */
  751|      0|        Curl_req_soft_reset(&data->req, data);
  752|      0|        if(ts->close_connection || conn->bits.close) {
  ------------------
  |  Branch (752:12): [True: 0, False: 0]
  |  Branch (752:36): [True: 0, False: 0]
  ------------------
  753|       |          /* Close this filter and the sub-chain, re-connect the
  754|       |           * sub-chain and continue. Closing this filter will
  755|       |           * reset our tunnel state. To avoid recursion, we return
  756|       |           * and expect to be called again.
  757|       |           */
  758|      0|          CURL_TRC_CF(data, cf, "CONNECT need to close+open");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  759|      0|          infof(data, "Connect me again please");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  760|      0|          Curl_conn_cf_close(cf, data);
  761|      0|          result = Curl_conn_cf_connect(cf->next, data, &done);
  762|      0|          return result;
  763|      0|        }
  764|      0|        else {
  765|       |          /* staying on this connection, reset state */
  766|      0|          h1_tunnel_go_state(cf, ts, H1_TUNNEL_INIT, data);
  767|      0|        }
  768|      0|      }
  769|  6.74k|      break;
  770|       |
  771|  6.74k|    default:
  ------------------
  |  Branch (771:5): [True: 0, False: 8.26k]
  ------------------
  772|      0|      break;
  773|  8.26k|    }
  774|       |
  775|  8.26k|  } while(data->req.newurl);
  ------------------
  |  Branch (775:11): [True: 0, False: 6.74k]
  ------------------
  776|       |
  777|  6.74k|  DEBUGASSERT(ts->tunnel_state == H1_TUNNEL_RESPONSE);
  ------------------
  |  | 1081|  6.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (777:3): [True: 0, False: 6.74k]
  |  Branch (777:3): [True: 6.74k, False: 0]
  ------------------
  778|  6.74k|  if(h1_proxy_is_udp(cf)) {
  ------------------
  |  Branch (778:6): [True: 0, False: 6.74k]
  ------------------
  779|       |    /* RFC 9298: Accept 101 Upgrade for HTTP/1.1 and
  780|       |     * 2xx responses for HTTP/2 and HTTP/3 proxies. */
  781|      0|    if(data->info.httpproxycode / 100 != 2 &&
  ------------------
  |  Branch (781:8): [True: 0, False: 0]
  ------------------
  782|      0|       data->info.httpproxycode != 101) {
  ------------------
  |  Branch (782:8): [True: 0, False: 0]
  ------------------
  783|      0|      curlx_safefree(data->req.newurl);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  784|      0|      h1_tunnel_go_state(cf, ts, H1_TUNNEL_FAILED, data);
  785|      0|      failf(data, "CONNECT-UDP tunnel failed, response %d",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  786|      0|            data->req.httpcode);
  787|      0|      return CURLE_COULDNT_CONNECT;
  788|      0|    }
  789|      0|  }
  790|  6.74k|  else {
  791|  6.74k|    if(data->info.httpproxycode / 100 != 2) {
  ------------------
  |  Branch (791:8): [True: 120, False: 6.62k]
  ------------------
  792|       |      /* a non-2xx response and we have no next URL to try. */
  793|    120|      curlx_safefree(data->req.newurl);
  ------------------
  |  | 1327|    120|  do {                      \
  |  | 1328|    120|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|    120|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|    120|    (ptr) = NULL;           \
  |  | 1330|    120|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 120]
  |  |  ------------------
  ------------------
  794|    120|      h1_tunnel_go_state(cf, ts, H1_TUNNEL_FAILED, data);
  795|    120|      failf(data, "CONNECT tunnel failed, response %d", data->req.httpcode);
  ------------------
  |  |   62|    120|#define failf Curl_failf
  ------------------
  796|    120|      return CURLE_COULDNT_CONNECT;
  797|    120|    }
  798|  6.74k|  }
  799|       |  /* 2xx response, SUCCESS! */
  800|       |  /* 101 Switching Protocol for CONNECT-UDP */
  801|  6.62k|  h1_tunnel_go_state(cf, ts, H1_TUNNEL_ESTABLISHED, data);
  802|  6.62k|  if(h1_proxy_is_udp(cf))
  ------------------
  |  Branch (802:6): [True: 0, False: 6.62k]
  ------------------
  803|      0|    infof(data, "CONNECT-UDP tunnel established, response %d",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  804|  6.62k|                                    data->info.httpproxycode);
  805|  6.62k|  else
  806|  6.62k|    infof(data, "CONNECT tunnel established, response %d",
  ------------------
  |  |  143|  6.62k|  do {                               \
  |  |  144|  6.62k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  6.62k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 6.62k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 6.62k]
  |  |  |  |  ------------------
  |  |  |  |  320|  6.62k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  6.62k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  6.62k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 6.62k]
  |  |  ------------------
  ------------------
  807|  6.62k|                                    data->info.httpproxycode);
  808|  6.62k|  result = CURLE_OK;
  809|       |
  810|  8.14k|out:
  811|  8.14k|  if(result)
  ------------------
  |  Branch (811:6): [True: 1.24k, False: 6.90k]
  ------------------
  812|  1.24k|    h1_tunnel_go_state(cf, ts, H1_TUNNEL_FAILED, data);
  813|  8.14k|  return result;
  814|  6.62k|}
cf-h1-proxy.c:tunnel_is_failed:
   89|  8.26k|{
   90|  8.26k|  return ts && (ts->tunnel_state == H1_TUNNEL_FAILED);
  ------------------
  |  Branch (90:10): [True: 8.26k, False: 0]
  |  Branch (90:16): [True: 0, False: 8.26k]
  ------------------
   91|  8.26k|}
cf-h1-proxy.c:start_CONNECT:
  234|  7.98k|{
  235|  7.98k|  struct httpreq *req = NULL;
  236|  7.98k|  int http_minor;
  237|  7.98k|  CURLcode result;
  238|       |
  239|  7.98k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  7.98k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (239:3): [True: 0, False: 7.98k]
  |  Branch (239:3): [True: 7.98k, False: 0]
  ------------------
  240|       |  /* This only happens if we have looped here due to authentication reasons,
  241|       |     and we do not really use the newly cloned URL here then. Free it. */
  242|  7.98k|  curlx_safefree(data->req.newurl);
  ------------------
  |  | 1327|  7.98k|  do {                      \
  |  | 1328|  7.98k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  7.98k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  7.98k|    (ptr) = NULL;           \
  |  | 1330|  7.98k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 7.98k]
  |  |  ------------------
  ------------------
  243|       |
  244|  7.98k|  result = Curl_http_proxy_create_tunnel_request(&req, cf, data, ts->dest,
  245|  7.98k|                                                  PROXY_HTTP_V1,
  246|  7.98k|                                                  h1_proxy_is_udp(cf));
  247|  7.98k|  if(result)
  ------------------
  |  Branch (247:6): [True: 10, False: 7.97k]
  ------------------
  248|     10|    goto out;
  249|       |
  250|  7.97k|  curlx_dyn_reset(&ts->request_data);
  251|  7.97k|  ts->nsent = 0;
  252|  7.97k|  ts->headerlines = 0;
  253|  7.97k|  http_minor = ts->httpversion % 10;
  254|       |
  255|  7.97k|  result = Curl_h1_req_write_head(req, http_minor, &ts->request_data);
  256|  7.97k|  if(!result)
  ------------------
  |  Branch (256:6): [True: 7.97k, False: 0]
  ------------------
  257|  7.97k|    result = Curl_creader_set_null(data);
  258|       |
  259|  7.98k|out:
  260|  7.98k|  if(result)
  ------------------
  |  Branch (260:6): [True: 10, False: 7.97k]
  ------------------
  261|     10|    failf(data, "Failed sending CONNECT to proxy");
  ------------------
  |  |   62|     10|#define failf Curl_failf
  ------------------
  262|  7.98k|  if(req)
  ------------------
  |  Branch (262:6): [True: 7.97k, False: 10]
  ------------------
  263|  7.97k|    Curl_http_req_free(req);
  264|  7.98k|  return result;
  265|  7.97k|}
cf-h1-proxy.c:send_CONNECT:
  271|  7.97k|{
  272|  7.97k|  const uint8_t *buf = curlx_dyn_uptr(&ts->request_data);
  273|  7.97k|  size_t request_len = curlx_dyn_len(&ts->request_data);
  274|  7.97k|  size_t blen = request_len;
  275|  7.97k|  CURLcode result = CURLE_OK;
  276|  7.97k|  size_t nwritten;
  277|       |
  278|  7.97k|  if(blen <= ts->nsent)
  ------------------
  |  Branch (278:6): [True: 0, False: 7.97k]
  ------------------
  279|      0|    goto out;  /* we are done */
  280|       |
  281|  7.97k|  blen -= ts->nsent;
  282|  7.97k|  buf += ts->nsent;
  283|       |
  284|  7.97k|  result = cf->next->cft->do_send(cf->next, data, buf, blen, FALSE, &nwritten);
  ------------------
  |  | 1058|  7.97k|#define FALSE false
  ------------------
  285|  7.97k|  if(result) {
  ------------------
  |  Branch (285:6): [True: 0, False: 7.97k]
  ------------------
  286|      0|    if(result == CURLE_AGAIN)
  ------------------
  |  Branch (286:8): [True: 0, False: 0]
  ------------------
  287|      0|      result = CURLE_OK;
  288|      0|    goto out;
  289|      0|  }
  290|       |
  291|  7.97k|  DEBUGASSERT(blen >= nwritten);
  ------------------
  |  | 1081|  7.97k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (291:3): [True: 0, False: 7.97k]
  |  Branch (291:3): [True: 7.97k, False: 0]
  ------------------
  292|  7.97k|  ts->nsent += nwritten;
  293|  7.97k|  Curl_debug(data, CURLINFO_HEADER_OUT, (const char *)buf, nwritten);
  294|       |
  295|  7.97k|out:
  296|  7.97k|  if(result)
  ------------------
  |  Branch (296:6): [True: 0, False: 7.97k]
  ------------------
  297|      0|    failf(data, "Failed sending CONNECT to proxy");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  298|  7.97k|  *done = (!result && (ts->nsent >= request_len));
  ------------------
  |  Branch (298:12): [True: 7.97k, False: 0]
  |  Branch (298:23): [True: 7.97k, False: 0]
  ------------------
  299|  7.97k|  return result;
  300|  7.97k|}
cf-h1-proxy.c:recv_CONNECT_resp:
  544|  8.25k|{
  545|  8.25k|  CURLcode result = CURLE_OK;
  546|  8.25k|  int error;
  547|       |
  548|  8.25k|#define SELECT_OK      0
  549|  8.25k|#define SELECT_ERROR   1
  550|       |
  551|  8.25k|  error = SELECT_OK;
  ------------------
  |  |  548|  8.25k|#define SELECT_OK      0
  ------------------
  552|  8.25k|  *done = FALSE;
  ------------------
  |  | 1058|  8.25k|#define FALSE false
  ------------------
  553|       |
  554|  1.44M|  while(ts->keepon) {
  ------------------
  |  Branch (554:9): [True: 1.43M, False: 6.74k]
  ------------------
  555|  1.43M|    size_t nread;
  556|  1.43M|    char byte;
  557|       |
  558|       |    /* Read one byte at a time to avoid a race condition. Wait at most one
  559|       |       second before looping to ensure continuous pgrsUpdates. */
  560|  1.43M|    result = Curl_conn_recv(data, cf->sockindex, &byte, 1, &nread);
  561|  1.43M|    if(result == CURLE_AGAIN)
  ------------------
  |  Branch (561:8): [True: 285, False: 1.43M]
  ------------------
  562|       |      /* socket buffer drained, return */
  563|    285|      return CURLE_OK;
  564|       |
  565|  1.43M|    if(!result)
  ------------------
  |  Branch (565:8): [True: 1.43M, False: 0]
  ------------------
  566|  1.43M|      result = Curl_pgrsUpdate(data);
  567|       |
  568|  1.43M|    if(result) {
  ------------------
  |  Branch (568:8): [True: 0, False: 1.43M]
  ------------------
  569|      0|      ts->keepon = KEEPON_DONE;
  570|      0|      break;
  571|      0|    }
  572|       |
  573|  1.43M|    if(!nread) {
  ------------------
  |  Branch (573:8): [True: 1.10k, False: 1.43M]
  ------------------
  574|  1.10k|      if(ts->maybe_folded) {
  ------------------
  |  Branch (574:10): [True: 8, False: 1.09k]
  ------------------
  575|       |        /* EOF right after LF: finalize the pending header line. */
  576|      8|        result = single_header(cf, data, ts);
  577|      8|        if(result)
  ------------------
  |  Branch (577:12): [True: 4, False: 4]
  ------------------
  578|      4|          return result;
  579|      4|        ts->maybe_folded = FALSE;
  ------------------
  |  | 1058|      4|#define FALSE false
  ------------------
  580|      4|      }
  581|  1.10k|      if(data->set.proxyauth && data->state.authproxy.avail &&
  ------------------
  |  Branch (581:10): [True: 1.09k, False: 3]
  |  Branch (581:33): [True: 0, False: 1.09k]
  ------------------
  582|      0|         data->req.hd_proxy_auth) {
  ------------------
  |  Branch (582:10): [True: 0, False: 0]
  ------------------
  583|       |        /* proxy auth was requested and there was proxy auth available,
  584|       |           then deem this as "mere" proxy disconnect */
  585|      0|        ts->close_connection = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  586|      0|        infof(data, "Proxy CONNECT connection closed");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  587|      0|      }
  588|  1.10k|      else {
  589|  1.10k|        error = SELECT_ERROR;
  ------------------
  |  |  549|  1.10k|#define SELECT_ERROR   1
  ------------------
  590|  1.10k|        failf(data, "Proxy CONNECT aborted");
  ------------------
  |  |   62|  1.10k|#define failf Curl_failf
  ------------------
  591|  1.10k|      }
  592|  1.10k|      ts->keepon = KEEPON_DONE;
  593|  1.10k|      break;
  594|  1.10k|    }
  595|       |
  596|  1.43M|    if(ts->keepon == KEEPON_IGNORE) {
  ------------------
  |  Branch (596:8): [True: 15.9k, False: 1.42M]
  ------------------
  597|       |      /* This means we are currently ignoring a response-body */
  598|  15.9k|      if(ts->chunked_encoding) {
  ------------------
  |  Branch (598:10): [True: 12.6k, False: 3.31k]
  ------------------
  599|       |        /* chunked-encoded body, so we need to do the chunked dance
  600|       |           properly to know when the end of the body is reached */
  601|  12.6k|        size_t consumed = 0;
  602|       |
  603|       |        /* now parse the chunked piece of data so that we can
  604|       |           properly tell when the stream ends */
  605|  12.6k|        result = Curl_httpchunk_read(data, &ts->ch, &byte, 1, &consumed);
  606|  12.6k|        if(result)
  ------------------
  |  Branch (606:12): [True: 42, False: 12.6k]
  ------------------
  607|     42|          return result;
  608|  12.6k|        if(Curl_httpchunk_is_done(data, &ts->ch)) {
  ------------------
  |  Branch (608:12): [True: 4, False: 12.6k]
  ------------------
  609|       |          /* we are done reading chunks! */
  610|      4|          infof(data, "chunk reading DONE");
  ------------------
  |  |  143|      4|  do {                               \
  |  |  144|      4|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      4|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 4, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 4]
  |  |  |  |  ------------------
  |  |  |  |  320|      4|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      4|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      4|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 4]
  |  |  ------------------
  ------------------
  611|      4|          ts->keepon = KEEPON_DONE;
  612|      4|        }
  613|  12.6k|      }
  614|  3.31k|      else if(ts->cl) {
  ------------------
  |  Branch (614:15): [True: 3.31k, False: 0]
  ------------------
  615|       |        /* A Content-Length based body: count down the counter
  616|       |           and make sure to break out of the loop when we are done! */
  617|  3.31k|        ts->cl--;
  618|  3.31k|        if(ts->cl <= 0) {
  ------------------
  |  Branch (618:12): [True: 6, False: 3.30k]
  ------------------
  619|      6|          ts->keepon = KEEPON_DONE;
  620|      6|          break;
  621|      6|        }
  622|  3.31k|      }
  623|  15.9k|      continue;
  624|  15.9k|    }
  625|       |
  626|  1.42M|    if(ts->maybe_folded) {
  ------------------
  |  Branch (626:8): [True: 41.4k, False: 1.37M]
  ------------------
  627|  41.4k|      if(ISBLANK(byte)) {
  ------------------
  |  |   45|  41.4k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 359, False: 41.0k]
  |  |  |  Branch (45:38): [True: 740, False: 40.3k]
  |  |  ------------------
  ------------------
  628|  1.09k|        Curl_http_to_fold(&ts->rcvbuf);
  629|  1.09k|        ts->leading_unfold = TRUE;
  ------------------
  |  | 1055|  1.09k|#define TRUE true
  ------------------
  630|  1.09k|      }
  631|  40.3k|      else {
  632|  40.3k|        result = single_header(cf, data, ts);
  633|  40.3k|        if(result)
  ------------------
  |  Branch (633:12): [True: 79, False: 40.2k]
  ------------------
  634|     79|          return result;
  635|       |        /* now handle the new byte */
  636|  40.3k|      }
  637|  41.3k|      ts->maybe_folded = FALSE;
  ------------------
  |  | 1058|  41.3k|#define FALSE false
  ------------------
  638|  41.3k|    }
  639|       |
  640|  1.42M|    if(ts->leading_unfold) {
  ------------------
  |  Branch (640:8): [True: 3.54k, False: 1.41M]
  ------------------
  641|  3.54k|      if(ISBLANK(byte))
  ------------------
  |  |   45|  3.54k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 809, False: 2.73k]
  |  |  |  Branch (45:38): [True: 1.64k, False: 1.09k]
  |  |  ------------------
  ------------------
  642|       |        /* skip a bit brother */
  643|  2.44k|        continue;
  644|       |      /* non-blank, insert a space then continue the unfolding */
  645|  1.09k|      if(curlx_dyn_addn(&ts->rcvbuf, " ", 1)) {
  ------------------
  |  Branch (645:10): [True: 0, False: 1.09k]
  ------------------
  646|      0|        failf(data, "CONNECT response too large");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  647|      0|        return CURLE_RECV_ERROR;
  648|      0|      }
  649|  1.09k|      ts->leading_unfold = FALSE;
  ------------------
  |  | 1058|  1.09k|#define FALSE false
  ------------------
  650|  1.09k|    }
  651|  1.41M|    if(curlx_dyn_addn(&ts->rcvbuf, &byte, 1)) {
  ------------------
  |  Branch (651:8): [True: 1, False: 1.41M]
  ------------------
  652|      1|      failf(data, "CONNECT response too large");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  653|      1|      return CURLE_RECV_ERROR;
  654|      1|    }
  655|       |
  656|       |    /* if this is not the end of a header line then continue */
  657|  1.41M|    if(byte != 0x0a)
  ------------------
  |  Branch (657:8): [True: 1.36M, False: 48.3k]
  ------------------
  658|  1.36M|      continue;
  659|  48.3k|    else {
  660|  48.3k|      const char *linep = curlx_dyn_ptr(&ts->rcvbuf);
  661|  48.3k|      size_t hlen = curlx_dyn_len(&ts->rcvbuf);
  662|  48.3k|      if(hlen && ISNEWLINE(linep[0])) {
  ------------------
  |  |   50|  48.3k|#define ISNEWLINE(x)    (((x) == '\n') || (x) == '\r')
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 6.76k, False: 41.5k]
  |  |  |  Branch (50:43): [True: 104, False: 41.4k]
  |  |  ------------------
  ------------------
  |  Branch (662:10): [True: 48.3k, False: 0]
  ------------------
  663|       |        /* end of headers */
  664|  6.86k|        result = single_header(cf, data, ts);
  665|  6.86k|        if(result)
  ------------------
  |  Branch (665:12): [True: 1, False: 6.86k]
  ------------------
  666|      1|          return result;
  667|  6.86k|      }
  668|  41.4k|      else
  669|  41.4k|        ts->maybe_folded = TRUE;
  ------------------
  |  | 1055|  41.4k|#define TRUE true
  ------------------
  670|  48.3k|    }
  671|       |
  672|  48.3k|    if(result)
  ------------------
  |  Branch (672:8): [True: 0, False: 48.3k]
  ------------------
  673|      0|      return result;
  674|  48.3k|  } /* while there is buffer left and loop is requested */
  675|       |
  676|  7.84k|  if(error)
  ------------------
  |  Branch (676:6): [True: 1.10k, False: 6.74k]
  ------------------
  677|  1.10k|    result = CURLE_RECV_ERROR;
  678|  7.84k|  *done = (ts->keepon == KEEPON_DONE);
  679|  7.84k|  if(!result && *done &&
  ------------------
  |  Branch (679:6): [True: 6.74k, False: 1.10k]
  |  Branch (679:17): [True: 6.74k, False: 0]
  ------------------
  680|  6.74k|     data->info.httpproxycode / 100 != 2 &&
  ------------------
  |  Branch (680:6): [True: 127, False: 6.62k]
  ------------------
  681|    127|     !(h1_proxy_is_udp(cf) && data->info.httpproxycode == 101)) {
  ------------------
  |  Branch (681:8): [True: 0, False: 127]
  |  Branch (681:31): [True: 0, False: 0]
  ------------------
  682|       |    /* Deal with the possibly already received authenticate
  683|       |       headers. 'newurl' is set to a new URL if we must loop. */
  684|    127|    result = Curl_http_auth_act(data);
  685|    127|  }
  686|  7.84k|  return result;
  687|  8.25k|}
cf-h1-proxy.c:single_header:
  468|  47.2k|{
  469|  47.2k|  CURLcode result = CURLE_OK;
  470|  47.2k|  const char *linep = curlx_dyn_ptr(&ts->rcvbuf);
  471|  47.2k|  size_t line_len = curlx_dyn_len(&ts->rcvbuf); /* bytes in this line */
  472|  47.2k|  const struct SingleRequest *k = &data->req;
  473|  47.2k|  int writetype;
  474|  47.2k|  ts->headerlines++;
  475|       |
  476|       |  /* output debug if that is requested */
  477|  47.2k|  Curl_debug(data, CURLINFO_HEADER_IN, linep, line_len);
  478|       |
  479|       |  /* send the header to the callback */
  480|  47.2k|  writetype = CLIENTWRITE_HEADER | CLIENTWRITE_CONNECT |
  ------------------
  |  |   44|  47.2k|#define CLIENTWRITE_HEADER  (1 << 2) /* meta information, HEADER */
  ------------------
                writetype = CLIENTWRITE_HEADER | CLIENTWRITE_CONNECT |
  ------------------
  |  |   46|  47.2k|#define CLIENTWRITE_CONNECT (1 << 4) /* a CONNECT related HEADER */
  ------------------
  481|  47.2k|    (ts->headerlines == 1 ? CLIENTWRITE_STATUS : 0);
  ------------------
  |  |   45|  7.11k|#define CLIENTWRITE_STATUS  (1 << 3) /* a special status HEADER */
  ------------------
  |  Branch (481:6): [True: 7.11k, False: 40.1k]
  ------------------
  482|  47.2k|  result = Curl_client_write(data, writetype, linep, line_len);
  483|  47.2k|  if(result)
  ------------------
  |  Branch (483:6): [True: 79, False: 47.1k]
  ------------------
  484|     79|    return result;
  485|       |
  486|  47.1k|  result = Curl_bump_headersize(data, line_len, TRUE);
  ------------------
  |  | 1055|  47.1k|#define TRUE true
  ------------------
  487|  47.1k|  if(result)
  ------------------
  |  Branch (487:6): [True: 0, False: 47.1k]
  ------------------
  488|      0|    return result;
  489|       |
  490|       |  /* Newlines are CRLF, so the CR is ignored as the line is not
  491|       |     really terminated until the LF comes. Treat a following CR
  492|       |     as end-of-headers as well.*/
  493|       |
  494|  47.1k|  if(ISNEWLINE(linep[0])) {
  ------------------
  |  |   50|  47.1k|#define ISNEWLINE(x)    (((x) == '\n') || (x) == '\r')
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 6.76k, False: 40.3k]
  |  |  |  Branch (50:43): [True: 104, False: 40.2k]
  |  |  ------------------
  ------------------
  495|       |    /* end of response-headers from the proxy */
  496|       |
  497|  6.86k|    if((407 == k->httpcode) && !data->state.authproblem) {
  ------------------
  |  Branch (497:8): [True: 137, False: 6.73k]
  |  Branch (497:32): [True: 137, False: 0]
  ------------------
  498|       |      /* If we get a 407 response code with content length
  499|       |         when we have no auth problem, we must ignore the
  500|       |         whole response-body */
  501|    137|      ts->keepon = KEEPON_IGNORE;
  502|       |
  503|    137|      if(ts->cl) {
  ------------------
  |  Branch (503:10): [True: 12, False: 125]
  ------------------
  504|     12|        infof(data, "Ignore %" FMT_OFF_T " bytes of response-body", ts->cl);
  ------------------
  |  |  143|     12|  do {                               \
  |  |  144|     12|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     12|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 12, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 12]
  |  |  |  |  ------------------
  |  |  |  |  320|     12|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     12|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     12|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 12]
  |  |  ------------------
  ------------------
  505|     12|      }
  506|    125|      else if(ts->chunked_encoding) {
  ------------------
  |  Branch (506:15): [True: 118, False: 7]
  ------------------
  507|    118|        infof(data, "Ignore chunked response-body");
  ------------------
  |  |  143|    118|  do {                               \
  |  |  144|    118|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    118|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 118, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 118]
  |  |  |  |  ------------------
  |  |  |  |  320|    118|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    118|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    118|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 118]
  |  |  ------------------
  ------------------
  508|    118|      }
  509|      7|      else {
  510|       |        /* without content-length or chunked encoding, we
  511|       |           cannot keep the connection alive since the close is
  512|       |           the end signal so we bail out at once instead */
  513|      7|        CURL_TRC_CF(data, cf, "CONNECT: no content-length or chunked");
  ------------------
  |  |  153|      7|  do {                                          \
  |  |  154|      7|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      7|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     14|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 7, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     14|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      7|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      7|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      7|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 7]
  |  |  ------------------
  ------------------
  514|      7|        ts->keepon = KEEPON_DONE;
  515|      7|      }
  516|    137|    }
  517|  6.73k|    else {
  518|  6.73k|      ts->keepon = KEEPON_DONE;
  519|  6.73k|    }
  520|       |
  521|  6.86k|    DEBUGASSERT(ts->keepon == KEEPON_IGNORE ||
  ------------------
  |  | 1081|  6.86k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (521:5): [True: 6.86k, False: 0]
  |  Branch (521:5): [True: 0, False: 0]
  |  Branch (521:5): [True: 130, False: 6.73k]
  |  Branch (521:5): [True: 6.73k, False: 0]
  ------------------
  522|  6.86k|                ts->keepon == KEEPON_DONE);
  523|  6.86k|    return result;
  524|  6.86k|  }
  525|       |
  526|  40.2k|  if(h1_proxy_is_udp(cf)) {
  ------------------
  |  Branch (526:6): [True: 0, False: 40.2k]
  ------------------
  527|      0|    result = on_resp_header_udp(cf, data, ts, linep);
  528|      0|  }
  529|  40.2k|  else {
  530|  40.2k|    result = on_resp_header(cf, data, ts, linep);
  531|  40.2k|  }
  532|       |
  533|  40.2k|  if(result)
  ------------------
  |  Branch (533:6): [True: 5, False: 40.2k]
  ------------------
  534|      5|    return result;
  535|       |
  536|  40.2k|  curlx_dyn_reset(&ts->rcvbuf);
  537|  40.2k|  return result;
  538|  40.2k|}
cf-h1-proxy.c:on_resp_header:
  392|  40.2k|{
  393|  40.2k|  CURLcode result = CURLE_OK;
  394|  40.2k|  struct SingleRequest *k = &data->req;
  395|  40.2k|  (void)cf;
  396|       |
  397|  40.2k|  if((checkprefix("WWW-Authenticate:", header) && (401 == k->httpcode)) ||
  ------------------
  |  |   33|  80.5k|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1292|  40.2k|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |  |  Branch (33:27): [True: 68, False: 40.1k]
  |  |  ------------------
  ------------------
  |  Branch (397:51): [True: 42, False: 26]
  ------------------
  398|  40.2k|     (checkprefix("Proxy-authenticate:", header) && (407 == k->httpcode))) {
  ------------------
  |  |   33|  80.4k|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1292|  40.2k|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |  |  Branch (33:27): [True: 40, False: 40.1k]
  |  |  ------------------
  ------------------
  |  Branch (398:53): [True: 20, False: 20]
  ------------------
  399|       |
  400|     62|    bool proxy = (k->httpcode == 407);
  401|     62|    char *auth = Curl_copy_header_value(header);
  402|     62|    if(!auth)
  ------------------
  |  Branch (402:8): [True: 0, False: 62]
  ------------------
  403|      0|      return CURLE_OUT_OF_MEMORY;
  404|       |
  405|     62|    CURL_TRC_CF(data, cf, "CONNECT: fwd auth header '%s'", header);
  ------------------
  |  |  153|     62|  do {                                          \
  |  |  154|     62|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     62|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    124|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 62, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 62]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    124|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     62|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     62|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     62|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 62]
  |  |  ------------------
  ------------------
  406|     62|    result = Curl_http_input_auth(data, proxy, auth);
  407|       |
  408|     62|    curlx_free(auth);
  ------------------
  |  | 1483|     62|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  409|       |
  410|     62|    if(result)
  ------------------
  |  Branch (410:8): [True: 0, False: 62]
  ------------------
  411|      0|      return result;
  412|     62|  }
  413|  40.2k|  else if(checkprefix("Content-Length:", header)) {
  ------------------
  |  |   33|  40.2k|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1292|  40.2k|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |  |  Branch (33:27): [True: 120, False: 40.0k]
  |  |  ------------------
  ------------------
  414|    120|    if(k->httpcode / 100 == 2) {
  ------------------
  |  Branch (414:8): [True: 41, False: 79]
  ------------------
  415|       |      /* A client MUST ignore any Content-Length or Transfer-Encoding
  416|       |         header fields received in a successful response to CONNECT.
  417|       |         "Successful" described as: 2xx (Successful). RFC 7231 4.3.6 */
  418|     41|      infof(data, "Ignoring Content-Length in CONNECT %03d response",
  ------------------
  |  |  143|     41|  do {                               \
  |  |  144|     41|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     41|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 41, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 41]
  |  |  |  |  ------------------
  |  |  |  |  320|     41|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     41|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     41|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 41]
  |  |  ------------------
  ------------------
  419|     41|            k->httpcode);
  420|     41|    }
  421|     79|    else {
  422|     79|      const char *p = header + strlen("Content-Length:");
  423|     79|      if(curlx_str_numblanks(&p, &ts->cl)) {
  ------------------
  |  Branch (423:10): [True: 5, False: 74]
  ------------------
  424|      5|        failf(data, "Unsupported Content-Length value");
  ------------------
  |  |   62|      5|#define failf Curl_failf
  ------------------
  425|      5|        return CURLE_WEIRD_SERVER_REPLY;
  426|      5|      }
  427|     79|    }
  428|    120|  }
  429|  40.0k|  else if(Curl_compareheader(header,
  ------------------
  |  Branch (429:11): [True: 0, False: 40.0k]
  ------------------
  430|  40.0k|                             STRCONST("Connection:"), STRCONST("close")))
  ------------------
  |  | 1292|  40.0k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
                                           STRCONST("Connection:"), STRCONST("close")))
  ------------------
  |  | 1292|  40.0k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  431|      0|    ts->close_connection = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  432|  40.0k|  else if(checkprefix("Transfer-Encoding:", header)) {
  ------------------
  |  |   33|  40.0k|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1292|  40.0k|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |  |  Branch (33:27): [True: 721, False: 39.3k]
  |  |  ------------------
  ------------------
  433|    721|    if(k->httpcode / 100 == 2) {
  ------------------
  |  Branch (433:8): [True: 84, False: 637]
  ------------------
  434|       |      /* A client MUST ignore any Content-Length or Transfer-Encoding
  435|       |         header fields received in a successful response to CONNECT.
  436|       |         "Successful" described as: 2xx (Successful). RFC 7231 4.3.6 */
  437|     84|      infof(data, "Ignoring Transfer-Encoding in "
  ------------------
  |  |  143|     84|  do {                               \
  |  |  144|     84|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     84|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 84, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 84]
  |  |  |  |  ------------------
  |  |  |  |  320|     84|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     84|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     84|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 84]
  |  |  ------------------
  ------------------
  438|     84|            "CONNECT %03d response", k->httpcode);
  439|     84|    }
  440|    637|    else if(Curl_compareheader(header,
  ------------------
  |  Branch (440:13): [True: 239, False: 398]
  ------------------
  441|    637|                               STRCONST("Transfer-Encoding:"),
  ------------------
  |  | 1292|    637|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  442|    637|                               STRCONST("chunked"))) {
  ------------------
  |  | 1292|    637|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  443|    239|      infof(data, "CONNECT responded chunked");
  ------------------
  |  |  143|    239|  do {                               \
  |  |  144|    239|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    239|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 239, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 239]
  |  |  |  |  ------------------
  |  |  |  |  320|    239|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    239|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    239|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 239]
  |  |  ------------------
  ------------------
  444|    239|      ts->chunked_encoding = TRUE;
  ------------------
  |  | 1055|    239|#define TRUE true
  ------------------
  445|       |      /* reset our chunky engine */
  446|    239|      Curl_httpchunk_reset(data, &ts->ch, TRUE);
  ------------------
  |  | 1055|    239|#define TRUE true
  ------------------
  447|    239|    }
  448|    721|  }
  449|  39.3k|  else if(Curl_compareheader(header,
  ------------------
  |  Branch (449:11): [True: 0, False: 39.3k]
  ------------------
  450|  39.3k|                             STRCONST("Proxy-Connection:"),
  ------------------
  |  | 1292|  39.3k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  451|  39.3k|                             STRCONST("close")))
  ------------------
  |  | 1292|  39.3k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  452|      0|    ts->close_connection = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  453|  39.3k|  else if(!strncmp(header, "HTTP/1.", 7) &&
  ------------------
  |  Branch (453:11): [True: 7.47k, False: 31.8k]
  ------------------
  454|  7.47k|          ((header[7] == '0') || (header[7] == '1')) &&
  ------------------
  |  Branch (454:12): [True: 3.78k, False: 3.69k]
  |  Branch (454:34): [True: 3.46k, False: 226]
  ------------------
  455|  7.25k|          (header[8] == ' ') &&
  ------------------
  |  Branch (455:11): [True: 7.19k, False: 59]
  ------------------
  456|  7.19k|          ISDIGIT(header[9]) && ISDIGIT(header[10]) && ISDIGIT(header[11]) &&
  ------------------
  |  |   44|  46.5k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 7.13k, False: 58]
  |  |  |  Branch (44:38): [True: 7.11k, False: 18]
  |  |  ------------------
  ------------------
                        ISDIGIT(header[9]) && ISDIGIT(header[10]) && ISDIGIT(header[11]) &&
  ------------------
  |  |   44|  46.4k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 7.08k, False: 32]
  |  |  |  Branch (44:38): [True: 7.06k, False: 21]
  |  |  ------------------
  ------------------
                        ISDIGIT(header[9]) && ISDIGIT(header[10]) && ISDIGIT(header[11]) &&
  ------------------
  |  |   44|  46.4k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 7.02k, False: 37]
  |  |  |  Branch (44:38): [True: 6.99k, False: 38]
  |  |  ------------------
  ------------------
  457|  6.99k|          !ISDIGIT(header[12])) {
  ------------------
  |  |   44|  6.99k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.15k, False: 5.83k]
  |  |  |  Branch (44:38): [True: 36, False: 1.11k]
  |  |  ------------------
  ------------------
  458|       |    /* store the HTTP code from the proxy */
  459|  6.95k|    data->info.httpproxycode = k->httpcode = ((header[9] - '0') * 100) +
  460|  6.95k|      ((header[10] - '0') * 10) + (header[11] - '0');
  461|  6.95k|  }
  462|  40.2k|  return result;
  463|  40.2k|}
cf-h1-proxy.c:tunnel_is_established:
   84|  15.1k|{
   85|  15.1k|  return ts && (ts->tunnel_state == H1_TUNNEL_ESTABLISHED);
  ------------------
  |  Branch (85:10): [True: 15.1k, False: 0]
  |  Branch (85:16): [True: 6.62k, False: 8.55k]
  ------------------
   86|  15.1k|}
cf-h1-proxy.c:cf_h1_proxy_close:
  910|  7.98k|{
  911|  7.98k|  struct cf_h1_proxy_ctx *pctx = cf->ctx;
  912|  7.98k|  CURL_TRC_CF(data, cf, "close");
  ------------------
  |  |  153|  7.98k|  do {                                          \
  |  |  154|  7.98k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  7.98k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  15.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 7.98k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 7.98k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  15.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  7.98k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  7.98k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  7.98k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 7.98k]
  |  |  ------------------
  ------------------
  913|  7.98k|  cf->connected = FALSE;
  ------------------
  |  | 1058|  7.98k|#define FALSE false
  ------------------
  914|  7.98k|  if(pctx && pctx->ts)
  ------------------
  |  Branch (914:6): [True: 7.98k, False: 0]
  |  Branch (914:14): [True: 1.36k, False: 6.62k]
  ------------------
  915|  1.36k|    h1_tunnel_go_state(cf, pctx->ts, H1_TUNNEL_INIT, data);
  916|  7.98k|  if(cf->next)
  ------------------
  |  Branch (916:6): [True: 7.98k, False: 0]
  ------------------
  917|  7.98k|    cf->next->cft->do_close(cf->next, data);
  918|  7.98k|}
cf-h1-proxy.c:cf_h1_proxy_adjust_pollset:
  865|  3.26M|{
  866|  3.26M|  struct cf_h1_proxy_ctx *pctx = cf->ctx;
  867|  3.26M|  struct h1_tunnel_state *ts = pctx->ts;
  868|  3.26M|  CURLcode result = CURLE_OK;
  869|       |
  870|  3.26M|  if(!cf->connected) {
  ------------------
  |  Branch (870:6): [True: 285, False: 3.26M]
  ------------------
  871|       |    /* If we are not connected, but the filter "below" is
  872|       |     * and not waiting on something, we are tunneling. */
  873|    285|    curl_socket_t sock = Curl_conn_cf_get_socket(cf, data);
  874|    285|    if(ts) {
  ------------------
  |  Branch (874:8): [True: 285, False: 0]
  ------------------
  875|       |      /* when we have sent a CONNECT to a proxy, we should rather either
  876|       |         wait for the socket to become readable to be able to get the
  877|       |         response headers or if we are still sending the request, wait
  878|       |         for write. */
  879|    285|      if(tunnel_want_send(ts))
  ------------------
  |  Branch (879:10): [True: 0, False: 285]
  ------------------
  880|      0|        result = Curl_pollset_set_out_only(data, ps, sock);
  ------------------
  |  |  174|      0|  Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  284|      0|#define CURL_POLL_OUT    2
  |  |  ------------------
  |  |                 Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  283|      0|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
  881|    285|      else
  882|    285|        result = Curl_pollset_set_in_only(data, ps, sock);
  ------------------
  |  |  172|    285|  Curl_pollset_change(data, ps, sock, CURL_POLL_IN, CURL_POLL_OUT)
  |  |  ------------------
  |  |  |  |  283|    285|#define CURL_POLL_IN     1
  |  |  ------------------
  |  |                 Curl_pollset_change(data, ps, sock, CURL_POLL_IN, CURL_POLL_OUT)
  |  |  ------------------
  |  |  |  |  284|    285|#define CURL_POLL_OUT    2
  |  |  ------------------
  ------------------
  883|    285|    }
  884|      0|    else
  885|      0|      result = Curl_pollset_set_out_only(data, ps, sock);
  ------------------
  |  |  174|      0|  Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  284|      0|#define CURL_POLL_OUT    2
  |  |  ------------------
  |  |                 Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  283|      0|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
  886|    285|  }
  887|  3.26M|  else {
  888|  3.26M|    if(cf->next)
  ------------------
  |  Branch (888:8): [True: 3.26M, False: 0]
  ------------------
  889|  3.26M|      result = cf->next->cft->adjust_pollset(cf->next, data, ps);
  890|  3.26M|  }
  891|  3.26M|  return result;
  892|  3.26M|}
cf-h1-proxy.c:tunnel_want_send:
  227|    285|{
  228|    285|  return ts->tunnel_state == H1_TUNNEL_CONNECT;
  229|    285|}
cf-h1-proxy.c:cf_h1_proxy_data_pending:
  896|  6.52M|{
  897|  6.52M|  return cf->next ? cf->next->cft->has_data_pending(cf->next, data) : FALSE;
  ------------------
  |  | 1058|  6.52M|#define FALSE false
  ------------------
  |  Branch (897:10): [True: 6.52M, False: 0]
  ------------------
  898|  6.52M|}
cf-h1-proxy.c:cf_h1_proxy_query:
  923|  3.30M|{
  924|  3.30M|  struct cf_h1_proxy_ctx *pctx = cf->ctx;
  925|  3.30M|  struct h1_tunnel_state *ts = pctx ? pctx->ts : NULL;
  ------------------
  |  Branch (925:32): [True: 3.30M, False: 0]
  ------------------
  926|  3.30M|  switch(query) {
  927|      0|  case CF_QUERY_HOST_PORT:
  ------------------
  |  |  177|      0|#define CF_QUERY_HOST_PORT         11  /* port       const char * */
  ------------------
  |  Branch (927:3): [True: 0, False: 3.30M]
  ------------------
  928|      0|    if(!ts || !ts->dest)
  ------------------
  |  Branch (928:8): [True: 0, False: 0]
  |  Branch (928:15): [True: 0, False: 0]
  ------------------
  929|      0|      break;
  930|      0|    *pres1 = (int)ts->dest->port;
  931|      0|    *((const char **)pres2) = ts->dest->hostname;
  932|      0|    return CURLE_OK;
  933|  6.61k|  case CF_QUERY_ALPN_NEGOTIATED: {
  ------------------
  |  |  181|  6.61k|#define CF_QUERY_ALPN_NEGOTIATED   15  /* -          const char * */
  ------------------
  |  Branch (933:3): [True: 6.61k, False: 3.29M]
  ------------------
  934|  6.61k|    const char **palpn = pres2;
  935|  6.61k|    DEBUGASSERT(palpn);
  ------------------
  |  | 1081|  6.61k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (935:5): [True: 0, False: 6.61k]
  |  Branch (935:5): [True: 6.61k, False: 0]
  ------------------
  936|  6.61k|    *palpn = NULL;
  937|  6.61k|    return CURLE_OK;
  938|  6.61k|  }
  939|  3.29M|  default:
  ------------------
  |  Branch (939:3): [True: 3.29M, False: 6.61k]
  ------------------
  940|  3.29M|    break;
  941|  3.30M|  }
  942|  3.29M|  return cf->next ?
  ------------------
  |  Branch (942:10): [True: 3.29M, False: 0]
  ------------------
  943|  3.29M|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
  944|  3.29M|    CURLE_UNKNOWN_OPTION;
  945|  3.30M|}
cf-h1-proxy.c:tunnel_free:
  202|  15.9k|{
  203|  15.9k|  if(ts) {
  ------------------
  |  Branch (203:6): [True: 7.98k, False: 7.98k]
  ------------------
  204|  7.98k|    Curl_peer_unlink(&ts->dest);
  205|  7.98k|    curlx_dyn_free(&ts->rcvbuf);
  206|  7.98k|    curlx_dyn_free(&ts->request_data);
  207|  7.98k|    Curl_httpchunk_free(data, &ts->ch);
  208|  7.98k|    curlx_free(ts);
  ------------------
  |  | 1483|  7.98k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  209|  7.98k|  }
  210|  15.9k|}

Curl_cf_haproxy_insert_after:
  246|    130|{
  247|    130|  struct Curl_cfilter *cf;
  248|    130|  CURLcode result;
  249|       |
  250|    130|  result = cf_haproxy_create(&cf, data);
  251|    130|  if(result)
  ------------------
  |  Branch (251:6): [True: 0, False: 130]
  ------------------
  252|      0|    goto out;
  253|    130|  Curl_conn_cf_insert_after(cf_at, cf);
  254|       |
  255|    130|out:
  256|    130|  return result;
  257|    130|}
cf-haproxy.c:cf_haproxy_destroy:
  171|    130|{
  172|    130|  CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|    130|  do {                                          \
  |  |  154|    130|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    130|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    260|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 130, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 130]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    260|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    130|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    130|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    130|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 130]
  |  |  ------------------
  ------------------
  173|    130|  cf_haproxy_ctx_free(cf->ctx);
  174|    130|}
cf-haproxy.c:cf_haproxy_ctx_free:
   56|    260|{
   57|    260|  if(ctx) {
  ------------------
  |  Branch (57:6): [True: 130, False: 130]
  ------------------
   58|    130|    curlx_dyn_free(&ctx->data_out);
   59|    130|    curlx_free(ctx);
  ------------------
  |  | 1483|    130|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   60|    130|  }
   61|    260|}
cf-haproxy.c:cf_haproxy_connect:
  115|    130|{
  116|    130|  struct cf_haproxy_ctx *ctx = cf->ctx;
  117|    130|  CURLcode result;
  118|    130|  size_t len;
  119|       |
  120|    130|  DEBUGASSERT(ctx);
  ------------------
  |  | 1081|    130|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (120:3): [True: 0, False: 130]
  |  Branch (120:3): [True: 130, False: 0]
  ------------------
  121|    130|  if(cf->connected) {
  ------------------
  |  Branch (121:6): [True: 0, False: 130]
  ------------------
  122|      0|    *done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  123|      0|    return CURLE_OK;
  124|      0|  }
  125|       |
  126|    130|  result = cf->next->cft->do_connect(cf->next, data, done);
  127|    130|  if(result || !*done)
  ------------------
  |  Branch (127:6): [True: 0, False: 130]
  |  Branch (127:16): [True: 0, False: 130]
  ------------------
  128|      0|    return result;
  129|       |
  130|    130|  switch(ctx->state) {
  131|    130|  case HAPROXY_INIT:
  ------------------
  |  Branch (131:3): [True: 130, False: 0]
  ------------------
  132|    130|    result = cf_haproxy_date_out_set(cf, data);
  133|    130|    if(result)
  ------------------
  |  Branch (133:8): [True: 1, False: 129]
  ------------------
  134|      1|      goto out;
  135|    129|    ctx->state = HAPROXY_SEND;
  136|    129|    FALLTHROUGH();
  ------------------
  |  |  821|    129|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  137|    129|  case HAPROXY_SEND:
  ------------------
  |  Branch (137:3): [True: 0, False: 130]
  ------------------
  138|    129|    len = curlx_dyn_len(&ctx->data_out);
  139|    129|    if(len > 0) {
  ------------------
  |  Branch (139:8): [True: 129, False: 0]
  ------------------
  140|    129|      size_t nwritten;
  141|    129|      result = Curl_conn_cf_send(cf->next, data,
  142|    129|                                 curlx_dyn_uptr(&ctx->data_out), len, FALSE,
  ------------------
  |  | 1058|    129|#define FALSE false
  ------------------
  143|    129|                                 &nwritten);
  144|    129|      if(result) {
  ------------------
  |  Branch (144:10): [True: 0, False: 129]
  ------------------
  145|      0|        if(result != CURLE_AGAIN)
  ------------------
  |  Branch (145:12): [True: 0, False: 0]
  ------------------
  146|      0|          goto out;
  147|      0|        result = CURLE_OK;
  148|      0|        nwritten = 0;
  149|      0|      }
  150|    129|      curlx_dyn_tail(&ctx->data_out, len - nwritten);
  151|    129|      if(curlx_dyn_len(&ctx->data_out) > 0) {
  ------------------
  |  Branch (151:10): [True: 0, False: 129]
  ------------------
  152|      0|        result = CURLE_OK;
  153|      0|        goto out;
  154|      0|      }
  155|    129|    }
  156|    129|    ctx->state = HAPROXY_DONE;
  157|    129|    FALLTHROUGH();
  ------------------
  |  |  821|    129|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  158|    129|  default:
  ------------------
  |  Branch (158:3): [True: 0, False: 130]
  ------------------
  159|    129|    curlx_dyn_free(&ctx->data_out);
  160|    129|    break;
  161|    130|  }
  162|       |
  163|    130|out:
  164|    130|  *done = (!result) && (ctx->state == HAPROXY_DONE);
  ------------------
  |  Branch (164:11): [True: 129, False: 1]
  |  Branch (164:24): [True: 129, False: 0]
  ------------------
  165|    130|  cf->connected = *done;
  166|    130|  return result;
  167|    130|}
cf-haproxy.c:cf_haproxy_date_out_set:
   65|    130|{
   66|       |  /* We fake a client connection report to the upstream server
   67|       |   * with the HAProxy protocol, reporting the client's source
   68|       |   * and destination IP addresses and ports.
   69|       |   * addresses: either the ones used to talk to the upstream
   70|       |   *            OR the value supplied by the user
   71|       |   * ports: the ports used in the upstream connection */
   72|    130|  const char *client_source_ip;
   73|    130|  const char *client_dest_ip;
   74|    130|  struct cf_haproxy_ctx *ctx = cf->ctx;
   75|    130|  CURLcode result;
   76|    130|  struct ip_quadruple ipquad;
   77|    130|  bool is_ipv6;
   78|       |
   79|    130|  DEBUGASSERT(ctx);
  ------------------
  |  | 1081|    130|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (79:3): [True: 0, False: 130]
  |  Branch (79:3): [True: 130, False: 0]
  ------------------
   80|    130|  DEBUGASSERT(ctx->state == HAPROXY_INIT);
  ------------------
  |  | 1081|    130|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (80:3): [True: 0, False: 130]
  |  Branch (80:3): [True: 130, False: 0]
  ------------------
   81|    130|#ifdef USE_UNIX_SOCKETS
   82|    130|  if(Curl_conn_get_first_peer(cf->conn, cf->sockindex)->unix_socket)
  ------------------
  |  Branch (82:6): [True: 3, False: 127]
  ------------------
   83|       |    /* the buffer is large enough to hold this! */
   84|      3|    result = curlx_dyn_addn(&ctx->data_out, STRCONST("PROXY UNKNOWN\r\n"));
  ------------------
  |  | 1292|      3|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
   85|    127|  else {
   86|    127|#endif /* USE_UNIX_SOCKETS */
   87|    127|  result = Curl_conn_cf_get_ip_info(cf->next, data, &is_ipv6, &ipquad);
   88|    127|  if(result)
  ------------------
  |  Branch (88:6): [True: 0, False: 127]
  ------------------
   89|      0|    return result;
   90|       |
   91|    127|  if(data->set.str[STRING_HAPROXY_CLIENT_IP]) {
  ------------------
  |  Branch (91:6): [True: 105, False: 22]
  ------------------
   92|    105|    client_source_ip = data->set.str[STRING_HAPROXY_CLIENT_IP];
   93|    105|    client_dest_ip = client_source_ip;
   94|    105|    is_ipv6 = !Curl_is_ipv4addr(client_source_ip);
   95|    105|  }
   96|     22|  else {
   97|     22|    client_source_ip = ipquad.local_ip;
   98|     22|    client_dest_ip = ipquad.remote_ip;
   99|     22|  }
  100|       |
  101|    127|  result = curlx_dyn_addf(&ctx->data_out, "PROXY %s %s %s %i %i\r\n",
  102|    127|                          is_ipv6 ? "TCP6" : "TCP4",
  ------------------
  |  Branch (102:27): [True: 105, False: 22]
  ------------------
  103|    127|                          client_source_ip, client_dest_ip,
  104|    127|                          ipquad.local_port, ipquad.remote_port);
  105|       |
  106|    127|#ifdef USE_UNIX_SOCKETS
  107|    127|  }
  108|    130|#endif /* USE_UNIX_SOCKETS */
  109|    130|  return result;
  110|    130|}
cf-haproxy.c:cf_haproxy_close:
  178|      4|{
  179|      4|  CURL_TRC_CF(data, cf, "close");
  ------------------
  |  |  153|      4|  do {                                          \
  |  |  154|      4|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      4|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      8|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 4, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      8|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      4|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      4|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      4|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 4]
  |  |  ------------------
  ------------------
  180|      4|  cf->connected = FALSE;
  ------------------
  |  | 1058|      4|#define FALSE false
  ------------------
  181|      4|  cf_haproxy_ctx_reset(cf->ctx);
  182|      4|  if(cf->next)
  ------------------
  |  Branch (182:6): [True: 4, False: 0]
  ------------------
  183|      4|    cf->next->cft->do_close(cf->next, data);
  184|      4|}
cf-haproxy.c:cf_haproxy_ctx_reset:
   49|      4|{
   50|      4|  DEBUGASSERT(ctx);
  ------------------
  |  | 1081|      4|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (50:3): [True: 0, False: 4]
  |  Branch (50:3): [True: 4, False: 0]
  ------------------
   51|      4|  ctx->state = HAPROXY_INIT;
   52|      4|  curlx_dyn_reset(&ctx->data_out);
   53|      4|}
cf-haproxy.c:cf_haproxy_create:
  219|    130|{
  220|    130|  struct Curl_cfilter *cf = NULL;
  221|    130|  struct cf_haproxy_ctx *ctx;
  222|    130|  CURLcode result;
  223|       |
  224|    130|  (void)data;
  225|    130|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1480|    130|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  226|    130|  if(!ctx) {
  ------------------
  |  Branch (226:6): [True: 0, False: 130]
  ------------------
  227|      0|    result = CURLE_OUT_OF_MEMORY;
  228|      0|    goto out;
  229|      0|  }
  230|    130|  ctx->state = HAPROXY_INIT;
  231|    130|  curlx_dyn_init(&ctx->data_out, DYN_HAXPROXY);
  ------------------
  |  |   68|    130|#define DYN_HAXPROXY        2048
  ------------------
  232|       |
  233|    130|  result = Curl_cf_create(&cf, &Curl_cft_haproxy, ctx);
  234|    130|  if(result)
  ------------------
  |  Branch (234:6): [True: 0, False: 130]
  ------------------
  235|      0|    goto out;
  236|    130|  ctx = NULL;
  237|       |
  238|    130|out:
  239|    130|  cf_haproxy_ctx_free(ctx);
  240|    130|  *pcf = result ? NULL : cf;
  ------------------
  |  Branch (240:10): [True: 0, False: 130]
  ------------------
  241|    130|  return result;
  242|    130|}

Curl_cf_https_setup:
  820|    329|{
  821|    329|  CURLcode result = CURLE_OK;
  822|       |
  823|    329|  DEBUGASSERT(conn->scheme->protocol == CURLPROTO_HTTPS);
  ------------------
  |  | 1081|    329|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (823:3): [True: 0, False: 329]
  |  Branch (823:3): [True: 329, False: 0]
  ------------------
  824|       |
  825|    329|  if((conn->scheme->protocol != CURLPROTO_HTTPS) ||
  ------------------
  |  | 1079|    329|#define CURLPROTO_HTTPS   (1L << 1)
  ------------------
  |  Branch (825:6): [True: 0, False: 329]
  ------------------
  826|    329|     !conn->bits.tls_enable_alpn)
  ------------------
  |  Branch (826:6): [True: 0, False: 329]
  ------------------
  827|      0|    goto out;
  828|       |
  829|    329|  result = cf_hc_add(data, conn, sockindex, conn->transport_wanted);
  830|       |
  831|    329|out:
  832|    329|  return result;
  833|    329|}
cf-https-connect.c:cf_hc_destroy:
  747|    329|{
  748|    329|  struct cf_hc_ctx *ctx = cf->ctx;
  749|       |
  750|    329|  CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|    329|  do {                                          \
  |  |  154|    329|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    329|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    658|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 329, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 329]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    658|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    329|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    329|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    329|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 329]
  |  |  ------------------
  ------------------
  751|    329|  cf_hc_ctx_destroy(data, ctx);
  752|    329|}
cf-https-connect.c:cf_hc_ctx_destroy:
  138|    658|{
  139|    658|  if(ctx) {
  ------------------
  |  Branch (139:6): [True: 329, False: 329]
  ------------------
  140|    329|    cf_hc_ctx_close(data, ctx);
  141|    329|    curlx_free(ctx);
  ------------------
  |  | 1483|    329|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  142|    329|  }
  143|    658|}
cf-https-connect.c:cf_hc_ctx_close:
  128|    658|{
  129|    658|  if(ctx) {
  ------------------
  |  Branch (129:6): [True: 658, False: 0]
  ------------------
  130|    658|    size_t i;
  131|    856|    for(i = 0; i < ctx->baller_count; ++i)
  ------------------
  |  Branch (131:16): [True: 198, False: 658]
  ------------------
  132|    198|      cf_hc_baller_discard(&ctx->ballers[i], data);
  133|    658|  }
  134|    658|}
cf-https-connect.c:cf_hc_baller_discard:
   63|    198|{
   64|    198|  if(b->cf) {
  ------------------
  |  Branch (64:6): [True: 99, False: 99]
  ------------------
   65|     99|    Curl_conn_cf_close(b->cf, data);
   66|     99|    Curl_conn_cf_discard_chain(&b->cf, data);
   67|       |    b->cf = NULL;
   68|     99|  }
   69|    198|}
cf-https-connect.c:cf_hc_connect:
  484|  39.9k|{
  485|  39.9k|  struct cf_hc_ctx *ctx = cf->ctx;
  486|  39.9k|  CURLcode result = CURLE_OK;
  487|       |
  488|  39.9k|  if(cf->connected) {
  ------------------
  |  Branch (488:6): [True: 0, False: 39.9k]
  ------------------
  489|      0|    *done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  490|      0|    return CURLE_OK;
  491|      0|  }
  492|       |
  493|  39.9k|  *done = FALSE;
  ------------------
  |  | 1058|  39.9k|#define FALSE false
  ------------------
  494|       |
  495|  39.9k|  if(!ctx->httpsrr_resolved) {
  ------------------
  |  Branch (495:6): [True: 99, False: 39.8k]
  ------------------
  496|     99|    ctx->httpsrr_resolved = Curl_conn_dns_resolved_https(data, cf->sockindex);
  ------------------
  |  |   66|     99|#define Curl_conn_dns_resolved_https(a, b)   TRUE
  |  |  ------------------
  |  |  |  | 1055|     99|#define TRUE true
  |  |  ------------------
  ------------------
  497|     99|#ifdef DEBUGBUILD
  498|     99|    if(!ctx->httpsrr_resolved && getenv("CURL_DBG_AWAIT_HTTPSRR")) {
  ------------------
  |  Branch (498:8): [True: 0, False: 99]
  |  Branch (498:34): [True: 0, False: 0]
  ------------------
  499|      0|      CURL_TRC_CF(data, cf, "awaiting HTTPS-RR");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  500|      0|      return CURLE_OK;
  501|      0|    }
  502|     99|#endif
  503|     99|  }
  504|       |
  505|  39.9k|  switch(ctx->state) {
  ------------------
  |  Branch (505:10): [True: 39.9k, False: 0]
  ------------------
  506|     99|  case CF_HC_RESOLV:
  ------------------
  |  Branch (506:3): [True: 99, False: 39.8k]
  ------------------
  507|     99|    ctx->state = CF_HC_INIT;
  508|     99|    FALLTHROUGH();
  ------------------
  |  |  821|     99|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  509|       |
  510|     99|  case CF_HC_INIT:
  ------------------
  |  Branch (510:3): [True: 0, False: 39.9k]
  ------------------
  511|     99|    DEBUGASSERT(!cf->next);
  ------------------
  |  | 1081|     99|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (511:5): [True: 0, False: 99]
  |  Branch (511:5): [True: 99, False: 0]
  ------------------
  512|     99|    CURL_TRC_CF(data, cf, "connect, init");
  ------------------
  |  |  153|     99|  do {                                          \
  |  |  154|     99|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     99|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    198|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 99, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 99]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    198|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     99|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     99|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     99|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 99]
  |  |  ------------------
  ------------------
  513|     99|    result = cf_hc_set_baller1(cf, data);
  514|     99|    if(result) {
  ------------------
  |  Branch (514:8): [True: 0, False: 99]
  ------------------
  515|      0|      ctx->result = result;
  516|      0|      ctx->state = CF_HC_FAILURE;
  517|      0|      goto out;
  518|      0|    }
  519|     99|    cf_hc_set_baller2(cf, data);
  520|     99|    ctx->started = *Curl_pgrs_now(data);
  521|     99|    cf_hc_baller_init(&ctx->ballers[0], cf, data);
  522|     99|    if((ctx->baller_count > 1) || !ctx->ballers_complete) {
  ------------------
  |  Branch (522:8): [True: 0, False: 99]
  |  Branch (522:35): [True: 0, False: 99]
  ------------------
  523|      0|      Curl_expire(data, ctx->soft_eyeballs_timeout_ms, EXPIRE_ALPN_EYEBALLS);
  524|      0|    }
  525|     99|    ctx->state = CF_HC_CONNECT;
  526|     99|    FALLTHROUGH();
  ------------------
  |  |  821|     99|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  527|       |
  528|  39.9k|  case CF_HC_CONNECT:
  ------------------
  |  Branch (528:3): [True: 39.8k, False: 99]
  ------------------
  529|  39.9k|    if(!ctx->ballers_complete)
  ------------------
  |  Branch (529:8): [True: 0, False: 39.9k]
  ------------------
  530|      0|      cf_hc_set_baller2(cf, data);
  531|       |
  532|  39.9k|    if(cf_hc_baller_is_connecting(&ctx->ballers[0])) {
  ------------------
  |  Branch (532:8): [True: 39.9k, False: 0]
  ------------------
  533|  39.9k|      result = cf_hc_baller_connect(&ctx->ballers[0], cf, data, done);
  534|  39.9k|      if(!result && *done) {
  ------------------
  |  Branch (534:10): [True: 39.8k, False: 33]
  |  Branch (534:21): [True: 0, False: 39.8k]
  ------------------
  535|      0|        result = baller_connected(cf, data, &ctx->ballers[0]);
  536|      0|        goto out;
  537|      0|      }
  538|  39.9k|    }
  539|       |
  540|  39.9k|    if(time_to_start_baller2(cf, data)) {
  ------------------
  |  Branch (540:8): [True: 0, False: 39.9k]
  ------------------
  541|      0|      cf_hc_baller_init(&ctx->ballers[1], cf, data);
  542|      0|    }
  543|       |
  544|  39.9k|    if(cf_hc_baller_is_connecting(&ctx->ballers[1])) {
  ------------------
  |  Branch (544:8): [True: 0, False: 39.9k]
  ------------------
  545|      0|      result = cf_hc_baller_connect(&ctx->ballers[1], cf, data, done);
  546|      0|      if(!result && *done) {
  ------------------
  |  Branch (546:10): [True: 0, False: 0]
  |  Branch (546:21): [True: 0, False: 0]
  ------------------
  547|      0|        result = baller_connected(cf, data, &ctx->ballers[1]);
  548|      0|        goto out;
  549|      0|      }
  550|      0|    }
  551|       |
  552|  39.9k|    if(ctx->ballers[0].result &&
  ------------------
  |  Branch (552:8): [True: 33, False: 39.8k]
  ------------------
  553|     33|       (ctx->ballers[1].result ||
  ------------------
  |  Branch (553:9): [True: 0, False: 33]
  ------------------
  554|     33|        (ctx->ballers_complete && (ctx->baller_count < 2)))) {
  ------------------
  |  Branch (554:10): [True: 33, False: 0]
  |  Branch (554:35): [True: 33, False: 0]
  ------------------
  555|       |      /* all have failed. we give up */
  556|     33|      CURL_TRC_CF(data, cf, "connect, all attempts failed");
  ------------------
  |  |  153|     33|  do {                                          \
  |  |  154|     33|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     33|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     66|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 33, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 33]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     66|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     33|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     33|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     33|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 33]
  |  |  ------------------
  ------------------
  557|     33|      ctx->result = result = ctx->ballers[0].result;
  558|     33|      ctx->state = CF_HC_FAILURE;
  559|     33|      goto out;
  560|     33|    }
  561|  39.8k|    result = CURLE_OK;
  562|  39.8k|    *done = FALSE;
  ------------------
  |  | 1058|  39.8k|#define FALSE false
  ------------------
  563|  39.8k|    break;
  564|       |
  565|      0|  case CF_HC_FAILURE:
  ------------------
  |  Branch (565:3): [True: 0, False: 39.9k]
  ------------------
  566|      0|    result = ctx->result;
  567|      0|    cf->connected = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  568|      0|    *done = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  569|      0|    break;
  570|       |
  571|      0|  case CF_HC_SUCCESS:
  ------------------
  |  Branch (571:3): [True: 0, False: 39.9k]
  ------------------
  572|      0|    result = CURLE_OK;
  573|      0|    cf->connected = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  574|      0|    *done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  575|      0|    break;
  576|  39.9k|  }
  577|       |
  578|  39.9k|out:
  579|  39.9k|  CURL_TRC_CF(data, cf, "connect -> %d, done=%d", result, *done);
  ------------------
  |  |  153|  39.9k|  do {                                          \
  |  |  154|  39.9k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  39.9k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  79.8k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 39.9k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 39.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  79.8k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  39.9k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  39.9k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  39.9k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 39.9k]
  |  |  ------------------
  ------------------
  580|  39.9k|  return result;
  581|  39.9k|}
cf-https-connect.c:cf_hc_set_baller1:
  394|     99|{
  395|     99|  struct cf_hc_ctx *ctx = cf->ctx;
  396|     99|  enum alpnid alpn1 = ALPN_none;
  397|     99|  VERBOSE(const char *source = "HTTPS-RR");
  ------------------
  |  | 1618|     99|#define VERBOSE(x) x
  ------------------
  398|       |
  399|     99|  DEBUGASSERT(cf->conn->bits.tls_enable_alpn);
  ------------------
  |  | 1081|     99|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (399:3): [True: 0, False: 99]
  |  Branch (399:3): [True: 99, False: 0]
  ------------------
  400|       |
  401|     99|  alpn1 = cf_hc_get_httpsrr_alpn(cf, data, ALPN_none);
  402|     99|  if(alpn1 == ALPN_none) {
  ------------------
  |  Branch (402:6): [True: 99, False: 0]
  ------------------
  403|       |    /* preference is configured and allowed, can we use it? */
  404|     99|    VERBOSE(source = "preferred version");
  ------------------
  |  | 1618|     99|#define VERBOSE(x) x
  ------------------
  405|     99|    alpn1 = cf_hc_get_pref_alpn(cf, data, ALPN_none);
  406|     99|  }
  407|     99|  if(alpn1 == ALPN_none) {
  ------------------
  |  Branch (407:6): [True: 99, False: 0]
  ------------------
  408|     99|    VERBOSE(source = "wanted versions");
  ------------------
  |  | 1618|     99|#define VERBOSE(x) x
  ------------------
  409|     99|    alpn1 = cf_hc_get_first_alpn(cf, data,
  410|     99|                                 data->state.http_neg.wanted,
  411|     99|                                 ALPN_none);
  412|     99|  }
  413|     99|  if(alpn1 == ALPN_none) {
  ------------------
  |  Branch (413:6): [True: 0, False: 99]
  ------------------
  414|      0|    VERBOSE(source = "allowed versions");
  ------------------
  |  | 1618|      0|#define VERBOSE(x) x
  ------------------
  415|      0|    alpn1 = cf_hc_get_first_alpn(cf, data,
  416|      0|                                 data->state.http_neg.allowed,
  417|      0|                                 ALPN_none);
  418|      0|  }
  419|       |
  420|     99|  if(alpn1 == ALPN_none) {
  ------------------
  |  Branch (420:6): [True: 0, False: 99]
  ------------------
  421|       |    /* None of the wanted/allowed HTTP versions could be chosen */
  422|      0|    if(ctx->check_h3_result) {
  ------------------
  |  Branch (422:8): [True: 0, False: 0]
  ------------------
  423|      0|      CURL_TRC_CF(data, cf, "unable to use HTTP/3");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  424|      0|      return ctx->check_h3_result;
  425|      0|    }
  426|      0|    CURL_TRC_CF(data, cf, "unable to select HTTP version");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  427|      0|    return CURLE_FAILED_INIT;
  428|      0|  }
  429|       |
  430|     99|  cf_hc_baller_assign(&ctx->ballers[0], alpn1, ctx->def_transport);
  431|     99|  ctx->baller_count = 1;
  432|     99|  CURL_TRC_CF(data, cf, "1st attempt uses %s from %s",
  ------------------
  |  |  153|     99|  do {                                          \
  |  |  154|     99|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     99|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    198|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 99, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 99]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    198|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     99|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     99|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     99|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 99]
  |  |  ------------------
  ------------------
  433|     99|              ctx->ballers[0].name, source);
  434|       |
  435|     99|  switch(alpn1) {
  436|      0|  case ALPN_h1:
  ------------------
  |  Branch (436:3): [True: 0, False: 99]
  ------------------
  437|       |    /* We really want h1, switch off h2 to make it disappear in ALPN */
  438|      0|    data->state.http_neg.wanted &= (uint8_t)~CURL_HTTP_V2x;
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  439|      0|    break;
  440|     99|  default:
  ------------------
  |  Branch (440:3): [True: 99, False: 0]
  ------------------
  441|     99|    break;
  442|     99|  }
  443|       |
  444|     99|  return CURLE_OK;
  445|     99|}
cf-https-connect.c:cf_hc_get_httpsrr_alpn:
  297|    198|{
  298|       |#ifdef USE_HTTPSRR
  299|       |  /* Is there an HTTPSRR use its ALPNs here.
  300|       |   * We are here after having selected a connection to a host+port and
  301|       |   * can no longer change that. Any HTTPSRR advice for other hosts and ports
  302|       |   * we need to ignore. */
  303|       |  const struct Curl_https_rrinfo *rr;
  304|       |  size_t i;
  305|       |
  306|       |  /* Do we have HTTPS-RR information? */
  307|       |  rr = Curl_conn_dns_get_https(data, cf->sockindex);
  308|       |
  309|       |  /* We do not support `rr->no_def_alpn`. */
  310|       |  if(Curl_httpsrr_applicable(data, rr) && !rr->no_def_alpn) {
  311|       |    for(i = 0; i < CURL_ARRAYSIZE(rr->alpns); ++i) {
  312|       |      enum alpnid alpn_rr = (enum alpnid)rr->alpns[i];
  313|       |      if(alpn_rr == not_this_one) /* don't want this one */
  314|       |        continue;
  315|       |      switch(alpn_rr) {
  316|       |      case ALPN_h3:
  317|       |        if((data->state.http_neg.allowed & CURL_HTTP_V3x) &&
  318|       |           cf_hc_may_h3(cf, data)) {
  319|       |          return alpn_rr;
  320|       |        }
  321|       |        break;
  322|       |      case ALPN_h2:
  323|       |        if(data->state.http_neg.allowed & CURL_HTTP_V2x) {
  324|       |          return alpn_rr;
  325|       |        }
  326|       |        break;
  327|       |      case ALPN_h1:
  328|       |        if(data->state.http_neg.allowed & CURL_HTTP_V1x) {
  329|       |          return alpn_rr;
  330|       |        }
  331|       |        break;
  332|       |      default: /* ignore */
  333|       |        break;
  334|       |      }
  335|       |    }
  336|       |  }
  337|       |#else
  338|    198|  (void)cf;
  339|    198|  (void)data;
  340|    198|  (void)not_this_one;
  341|    198|#endif
  342|    198|  return ALPN_none;
  343|    198|}
cf-https-connect.c:cf_hc_get_pref_alpn:
  348|    198|{
  349|    198|  if((data->state.http_neg.preferred & data->state.http_neg.allowed)) {
  ------------------
  |  Branch (349:6): [True: 0, False: 198]
  ------------------
  350|      0|    switch(data->state.http_neg.preferred) {
  351|      0|    case CURL_HTTP_V3x:
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  |  Branch (351:5): [True: 0, False: 0]
  ------------------
  352|      0|      if(cf_hc_may_h3(cf, data) && (ALPN_h3 != not_this_one))
  ------------------
  |  Branch (352:10): [True: 0, False: 0]
  |  Branch (352:36): [True: 0, False: 0]
  ------------------
  353|      0|        return ALPN_h3;
  354|      0|      break;
  355|      0|    case CURL_HTTP_V2x:
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  |  Branch (355:5): [True: 0, False: 0]
  ------------------
  356|      0|      if(ALPN_h2 != not_this_one)
  ------------------
  |  Branch (356:10): [True: 0, False: 0]
  ------------------
  357|      0|        return ALPN_h2;
  358|      0|      break;
  359|      0|    case CURL_HTTP_V1x:
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
  |  Branch (359:5): [True: 0, False: 0]
  ------------------
  360|       |      /* If we are trying h2 already, h1 is already used as fallback */
  361|      0|      if((ALPN_h1 != not_this_one) && (ALPN_h2 != not_this_one))
  ------------------
  |  Branch (361:10): [True: 0, False: 0]
  |  Branch (361:39): [True: 0, False: 0]
  ------------------
  362|      0|        return ALPN_h1;
  363|      0|      break;
  364|      0|    default:
  ------------------
  |  Branch (364:5): [True: 0, False: 0]
  ------------------
  365|      0|      break;
  366|      0|    }
  367|      0|  }
  368|    198|  return ALPN_none;
  369|    198|}
cf-https-connect.c:cf_hc_get_first_alpn:
  375|    198|{
  376|       |  /* When told to not try h2, we also do not try h1 and vice versa */
  377|    198|  bool allow_h1_or_h2 = (not_this_one != ALPN_h1) &&
  ------------------
  |  Branch (377:25): [True: 198, False: 0]
  ------------------
  378|    198|                        (not_this_one != ALPN_h2);
  ------------------
  |  Branch (378:25): [True: 99, False: 99]
  ------------------
  379|    198|  if((ALPN_h3 != not_this_one) && (choices & CURL_HTTP_V3x) &&
  ------------------
  |  |   42|    198|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  |  Branch (379:6): [True: 198, False: 0]
  |  Branch (379:35): [True: 0, False: 198]
  ------------------
  380|      0|     cf_hc_may_h3(cf, data)) {
  ------------------
  |  Branch (380:6): [True: 0, False: 0]
  ------------------
  381|      0|    return ALPN_h3;
  382|      0|  }
  383|    198|  if(allow_h1_or_h2 && (choices & CURL_HTTP_V2x)) {
  ------------------
  |  |   41|     99|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  |  Branch (383:6): [True: 99, False: 99]
  |  Branch (383:24): [True: 99, False: 0]
  ------------------
  384|     99|    return ALPN_h2;
  385|     99|  }
  386|     99|  if(allow_h1_or_h2 && (choices & CURL_HTTP_V1x)) {
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
  |  Branch (386:6): [True: 0, False: 99]
  |  Branch (386:24): [True: 0, False: 0]
  ------------------
  387|      0|    return ALPN_h1;
  388|      0|  }
  389|     99|  return ALPN_none;
  390|     99|}
cf-https-connect.c:cf_hc_baller_assign:
  148|     99|{
  149|     99|  b->alpn_id = alpn_id;
  150|     99|  b->transport = def_transport;
  151|     99|  b->cf = NULL;
  152|     99|  b->result = CURLE_OK;
  153|     99|  b->reply_ms = -1;
  154|     99|  b->shutdown = FALSE;
  ------------------
  |  | 1058|     99|#define FALSE false
  ------------------
  155|     99|  switch(b->alpn_id) {
  156|      0|  case ALPN_h3:
  ------------------
  |  Branch (156:3): [True: 0, False: 99]
  ------------------
  157|      0|    b->name = "h3";
  158|      0|    b->transport = TRNSPRT_QUIC;
  ------------------
  |  |  309|      0|#define TRNSPRT_QUIC 5
  ------------------
  159|      0|    break;
  160|     99|  case ALPN_h2:
  ------------------
  |  Branch (160:3): [True: 99, False: 0]
  ------------------
  161|     99|    b->name = "h2";
  162|     99|    break;
  163|      0|  case ALPN_h1:
  ------------------
  |  Branch (163:3): [True: 0, False: 99]
  ------------------
  164|      0|    b->name = "h1";
  165|      0|    break;
  166|      0|  case ALPN_none:
  ------------------
  |  Branch (166:3): [True: 0, False: 99]
  ------------------
  167|      0|    b->name = "no-alpn";
  168|      0|    break;
  169|      0|  default:
  ------------------
  |  Branch (169:3): [True: 0, False: 99]
  ------------------
  170|      0|    b->result = CURLE_FAILED_INIT;
  171|      0|    break;
  172|     99|  }
  173|     99|}
cf-https-connect.c:cf_hc_set_baller2:
  449|     99|{
  450|     99|  struct cf_hc_ctx *ctx = cf->ctx;
  451|     99|  enum alpnid alpn2 = ALPN_none, alpn1 = ctx->ballers[0].alpn_id;
  452|     99|  VERBOSE(const char *source = "HTTPS-RR");
  ------------------
  |  | 1618|     99|#define VERBOSE(x) x
  ------------------
  453|       |
  454|     99|  if(ctx->ballers_complete)
  ------------------
  |  Branch (454:6): [True: 0, False: 99]
  ------------------
  455|      0|    return; /* already done */
  456|     99|  if(!ctx->httpsrr_resolved)
  ------------------
  |  Branch (456:6): [True: 0, False: 99]
  ------------------
  457|      0|    return; /* HTTPS-RR pending */
  458|       |
  459|     99|  alpn2 = cf_hc_get_httpsrr_alpn(cf, data, alpn1);
  460|     99|  if(alpn2 == ALPN_none) {
  ------------------
  |  Branch (460:6): [True: 99, False: 0]
  ------------------
  461|       |    /* preference is configured and allowed, can we use it? */
  462|     99|    VERBOSE(source = "preferred version");
  ------------------
  |  | 1618|     99|#define VERBOSE(x) x
  ------------------
  463|     99|    alpn2 = cf_hc_get_pref_alpn(cf, data, alpn1);
  464|     99|  }
  465|     99|  if(alpn2 == ALPN_none) {
  ------------------
  |  Branch (465:6): [True: 99, False: 0]
  ------------------
  466|     99|    VERBOSE(source = "wanted versions");
  ------------------
  |  | 1618|     99|#define VERBOSE(x) x
  ------------------
  467|     99|    alpn2 = cf_hc_get_first_alpn(cf, data,
  468|     99|                                 data->state.http_neg.wanted,
  469|     99|                                 alpn1);
  470|     99|  }
  471|       |
  472|     99|  if(alpn2 != ALPN_none) {
  ------------------
  |  Branch (472:6): [True: 0, False: 99]
  ------------------
  473|      0|    cf_hc_baller_assign(&ctx->ballers[1], alpn2, ctx->def_transport);
  474|      0|    ctx->baller_count = 2;
  475|      0|    CURL_TRC_CF(data, cf, "2nd attempt uses %s from %s",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  476|      0|                ctx->ballers[1].name, source);
  477|      0|  }
  478|       |  ctx->ballers_complete = TRUE;
  ------------------
  |  | 1055|     99|#define TRUE true
  ------------------
  479|     99|}
cf-https-connect.c:cf_hc_baller_init:
  178|     99|{
  179|     99|  struct Curl_cfilter *save = cf->next;
  180|       |
  181|     99|  cf->next = NULL;
  182|     99|  b->started = *Curl_pgrs_now(data);
  183|     99|  b->result = Curl_cf_setup_insert_after(cf, data, b->transport,
  184|     99|                                         CURL_CF_SSL_ENABLE);
  ------------------
  |  |  365|     99|#define CURL_CF_SSL_ENABLE   1
  ------------------
  185|     99|  b->cf = cf->next;
  186|     99|  cf->next = save;
  187|     99|}
cf-https-connect.c:cf_hc_baller_is_connecting:
   72|   119k|{
   73|   119k|  return b->cf && !b->result;
  ------------------
  |  Branch (73:10): [True: 79.8k, False: 39.9k]
  |  Branch (73:19): [True: 79.8k, False: 0]
  ------------------
   74|   119k|}
cf-https-connect.c:cf_hc_baller_connect:
  193|  39.9k|{
  194|  39.9k|  struct Curl_cfilter *save = cf->next;
  195|       |
  196|  39.9k|  cf->next = b->cf;
  197|  39.9k|  b->result = Curl_conn_cf_connect(cf->next, data, done);
  198|  39.9k|  b->cf = cf->next; /* it might mutate */
  199|  39.9k|  cf->next = save;
  200|  39.9k|  return b->result;
  201|  39.9k|}
cf-https-connect.c:time_to_start_baller2:
  249|  39.9k|{
  250|  39.9k|  struct cf_hc_ctx *ctx = cf->ctx;
  251|  39.9k|  timediff_t elapsed_ms;
  252|       |
  253|  39.9k|  if(ctx->baller_count < 2)
  ------------------
  |  Branch (253:6): [True: 39.9k, False: 0]
  ------------------
  254|  39.9k|    return FALSE;
  ------------------
  |  | 1058|  39.9k|#define FALSE false
  ------------------
  255|      0|  else if(cf_hc_baller_has_started(&ctx->ballers[1]))
  ------------------
  |  Branch (255:11): [True: 0, False: 0]
  ------------------
  256|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  257|      0|  else if(ctx->ballers[0].result) {
  ------------------
  |  Branch (257:11): [True: 0, False: 0]
  ------------------
  258|      0|    CURL_TRC_CF(data, cf, "%s baller failed, starting %s",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  259|      0|                ctx->ballers[0].name, ctx->ballers[1].name);
  260|      0|    return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  261|      0|  }
  262|       |
  263|      0|  elapsed_ms = curlx_ptimediff_ms(Curl_pgrs_now(data), &ctx->started);
  264|      0|  if(elapsed_ms >= ctx->hard_eyeballs_timeout_ms) {
  ------------------
  |  Branch (264:6): [True: 0, False: 0]
  ------------------
  265|      0|    CURL_TRC_CF(data, cf, "%s inconclusive after %" FMT_TIMEDIFF_T ", "
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  266|      0|                "starting %s", ctx->ballers[0].name,
  267|      0|                ctx->hard_eyeballs_timeout_ms, ctx->ballers[1].name);
  268|      0|    return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  269|      0|  }
  270|      0|  else if(elapsed_ms >= ctx->soft_eyeballs_timeout_ms) {
  ------------------
  |  Branch (270:11): [True: 0, False: 0]
  ------------------
  271|      0|    if(cf_hc_baller_reply_ms(&ctx->ballers[0], data) < 0) {
  ------------------
  |  Branch (271:8): [True: 0, False: 0]
  ------------------
  272|      0|      CURL_TRC_CF(data, cf, "%s has not seen any data after %"
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  273|      0|                  FMT_TIMEDIFF_T "ms, starting %s",
  274|      0|                  ctx->ballers[0].name, ctx->soft_eyeballs_timeout_ms,
  275|      0|                  ctx->ballers[1].name);
  276|      0|      return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  277|      0|    }
  278|      0|  }
  279|      0|  return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  280|      0|}
cf-https-connect.c:cf_hc_close:
  735|    329|{
  736|    329|  CURL_TRC_CF(data, cf, "close");
  ------------------
  |  |  153|    329|  do {                                          \
  |  |  154|    329|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    329|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    658|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 329, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 329]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    658|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    329|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    329|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    329|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 329]
  |  |  ------------------
  ------------------
  737|    329|  cf_hc_ctx_close(data, cf->ctx);
  738|    329|  cf->connected = FALSE;
  ------------------
  |  | 1058|    329|#define FALSE false
  ------------------
  739|       |
  740|    329|  if(cf->next) {
  ------------------
  |  Branch (740:6): [True: 0, False: 329]
  ------------------
  741|      0|    cf->next->cft->do_close(cf->next, data);
  742|      0|    Curl_conn_cf_discard_chain(&cf->next, data);
  743|      0|  }
  744|    329|}
cf-https-connect.c:cf_hc_adjust_pollset:
  626|  77.2k|{
  627|  77.2k|  CURLcode result = CURLE_OK;
  628|  77.2k|  if(!cf->connected) {
  ------------------
  |  Branch (628:6): [True: 77.2k, False: 0]
  ------------------
  629|  77.2k|    struct cf_hc_ctx *ctx = cf->ctx;
  630|  77.2k|    size_t i;
  631|       |
  632|   117k|    for(i = 0; (i < ctx->baller_count) && !result; i++) {
  ------------------
  |  Branch (632:16): [True: 39.8k, False: 77.2k]
  |  Branch (632:43): [True: 39.8k, False: 0]
  ------------------
  633|  39.8k|      struct cf_hc_baller *b = &ctx->ballers[i];
  634|  39.8k|      if(!cf_hc_baller_is_connecting(b))
  ------------------
  |  Branch (634:10): [True: 0, False: 39.8k]
  ------------------
  635|      0|        continue;
  636|  39.8k|      result = Curl_conn_cf_adjust_pollset(b->cf, data, ps);
  637|  39.8k|    }
  638|  77.2k|    CURL_TRC_CF(data, cf, "adjust_pollset -> %d, %u socks", result, ps->n);
  ------------------
  |  |  153|  77.2k|  do {                                          \
  |  |  154|  77.2k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  77.2k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|   154k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 77.2k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 77.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|   154k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  77.2k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  77.2k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  77.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 77.2k]
  |  |  ------------------
  ------------------
  639|  77.2k|  }
  640|  77.2k|  return result;
  641|  77.2k|}
cf-https-connect.c:cf_hc_cntrl:
  717|    329|{
  718|    329|  struct cf_hc_ctx *ctx = cf->ctx;
  719|    329|  CURLcode result = CURLE_OK;
  720|    329|  size_t i;
  721|       |
  722|    329|  if(!cf->connected) {
  ------------------
  |  Branch (722:6): [True: 329, False: 0]
  ------------------
  723|    428|    for(i = 0; i < ctx->baller_count; i++) {
  ------------------
  |  Branch (723:16): [True: 99, False: 329]
  ------------------
  724|     99|      result = cf_hc_baller_cntrl(&ctx->ballers[i], data, event, arg1, arg2);
  725|     99|      if(result && (result != CURLE_AGAIN))
  ------------------
  |  Branch (725:10): [True: 0, False: 99]
  |  Branch (725:20): [True: 0, False: 0]
  ------------------
  726|      0|        goto out;
  727|     99|    }
  728|    329|    result = CURLE_OK;
  729|    329|  }
  730|    329|out:
  731|    329|  return result;
  732|    329|}
cf-https-connect.c:cf_hc_baller_cntrl:
  105|     99|{
  106|     99|  if(b->cf && !b->result)
  ------------------
  |  Branch (106:6): [True: 99, False: 0]
  |  Branch (106:15): [True: 66, False: 33]
  ------------------
  107|     66|    return Curl_conn_cf_cntrl(b->cf, data, FALSE, event, arg1, arg2);
  ------------------
  |  | 1058|     66|#define FALSE false
  ------------------
  108|     33|  return CURLE_OK;
  109|     99|}
cf-https-connect.c:cf_hc_query:
  681|   155k|{
  682|   155k|  struct cf_hc_ctx *ctx = cf->ctx;
  683|   155k|  size_t i;
  684|       |
  685|   155k|  if(!cf->connected) {
  ------------------
  |  Branch (685:6): [True: 155k, False: 0]
  ------------------
  686|   155k|    switch(query) {
  687|    227|    case CF_QUERY_TIMER_CONNECT: {
  ------------------
  |  |  168|    227|#define CF_QUERY_TIMER_CONNECT      4  /* -          struct curltime */
  ------------------
  |  Branch (687:5): [True: 227, False: 154k]
  ------------------
  688|    227|      struct curltime *when = pres2;
  689|    227|      *when = cf_get_max_baller_time(cf, data, CF_QUERY_TIMER_CONNECT);
  ------------------
  |  |  168|    227|#define CF_QUERY_TIMER_CONNECT      4  /* -          struct curltime */
  ------------------
  690|    227|      return CURLE_OK;
  691|      0|    }
  692|    227|    case CF_QUERY_TIMER_APPCONNECT: {
  ------------------
  |  |  169|    227|#define CF_QUERY_TIMER_APPCONNECT   5  /* -          struct curltime */
  ------------------
  |  Branch (692:5): [True: 227, False: 154k]
  ------------------
  693|    227|      struct curltime *when = pres2;
  694|    227|      *when = cf_get_max_baller_time(cf, data, CF_QUERY_TIMER_APPCONNECT);
  ------------------
  |  |  169|    227|#define CF_QUERY_TIMER_APPCONNECT   5  /* -          struct curltime */
  ------------------
  695|    227|      return CURLE_OK;
  696|      0|    }
  697|  77.4k|    case CF_QUERY_NEED_FLUSH: {
  ------------------
  |  |  171|  77.4k|#define CF_QUERY_NEED_FLUSH         7  /* TRUE/FALSE - */
  ------------------
  |  Branch (697:5): [True: 77.4k, False: 77.6k]
  ------------------
  698|   117k|      for(i = 0; i < ctx->baller_count; i++)
  ------------------
  |  Branch (698:18): [True: 39.8k, False: 77.4k]
  ------------------
  699|  39.8k|        if(cf_hc_baller_needs_flush(&ctx->ballers[i], data)) {
  ------------------
  |  Branch (699:12): [True: 0, False: 39.8k]
  ------------------
  700|      0|          *pres1 = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  701|      0|          return CURLE_OK;
  702|      0|        }
  703|  77.4k|      break;
  704|  77.4k|    }
  705|  77.4k|    default:
  ------------------
  |  Branch (705:5): [True: 77.2k, False: 77.9k]
  ------------------
  706|  77.2k|      break;
  707|   155k|    }
  708|   155k|  }
  709|   154k|  return cf->next ?
  ------------------
  |  Branch (709:10): [True: 0, False: 154k]
  ------------------
  710|      0|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
  711|   154k|    CURLE_UNKNOWN_OPTION;
  712|   155k|}
cf-https-connect.c:cf_get_max_baller_time:
  661|    454|{
  662|    454|  struct cf_hc_ctx *ctx = cf->ctx;
  663|    454|  struct curltime t, tmax;
  664|    454|  size_t i;
  665|       |
  666|    454|  memset(&tmax, 0, sizeof(tmax));
  667|    594|  for(i = 0; i < ctx->baller_count; i++) {
  ------------------
  |  Branch (667:14): [True: 140, False: 454]
  ------------------
  668|    140|    struct Curl_cfilter *cfb = ctx->ballers[i].cf;
  669|    140|    memset(&t, 0, sizeof(t));
  670|    140|    if(cfb && !cfb->cft->query(cfb, data, query, NULL, &t)) {
  ------------------
  |  Branch (670:8): [True: 140, False: 0]
  |  Branch (670:15): [True: 140, False: 0]
  ------------------
  671|    140|      if((t.tv_sec || t.tv_usec) && curlx_ptimediff_us(&t, &tmax) > 0)
  ------------------
  |  Branch (671:11): [True: 0, False: 140]
  |  Branch (671:23): [True: 0, False: 140]
  |  Branch (671:37): [True: 0, False: 0]
  ------------------
  672|      0|        tmax = t;
  673|    140|    }
  674|    140|  }
  675|    454|  return tmax;
  676|    454|}
cf-https-connect.c:cf_hc_baller_needs_flush:
   98|  39.8k|{
   99|  39.8k|  return b->cf && !b->result && Curl_conn_cf_needs_flush(b->cf, data);
  ------------------
  |  Branch (99:10): [True: 39.8k, False: 0]
  |  Branch (99:19): [True: 39.8k, False: 0]
  |  Branch (99:33): [True: 0, False: 39.8k]
  ------------------
  100|  39.8k|}
cf-https-connect.c:cf_hc_add:
  804|    329|{
  805|    329|  struct Curl_cfilter *cf;
  806|    329|  CURLcode result = CURLE_OK;
  807|       |
  808|    329|  DEBUGASSERT(data);
  ------------------
  |  | 1081|    329|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (808:3): [True: 0, False: 329]
  |  Branch (808:3): [True: 329, False: 0]
  ------------------
  809|    329|  result = cf_hc_create(&cf, data, def_transport);
  810|    329|  if(result)
  ------------------
  |  Branch (810:6): [True: 0, False: 329]
  ------------------
  811|      0|    goto out;
  812|    329|  Curl_conn_cf_add(data, conn, sockindex, cf);
  813|    329|out:
  814|    329|  return result;
  815|    329|}
cf-https-connect.c:cf_hc_create:
  775|    329|{
  776|    329|  struct Curl_cfilter *cf = NULL;
  777|    329|  struct cf_hc_ctx *ctx;
  778|    329|  CURLcode result = CURLE_OK;
  779|       |
  780|    329|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1480|    329|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  781|    329|  if(!ctx) {
  ------------------
  |  Branch (781:6): [True: 0, False: 329]
  ------------------
  782|      0|    result = CURLE_OUT_OF_MEMORY;
  783|      0|    goto out;
  784|      0|  }
  785|    329|  ctx->def_transport = def_transport;
  786|    329|  ctx->hard_eyeballs_timeout_ms = data->set.happy_eyeballs_timeout;
  787|    329|  ctx->soft_eyeballs_timeout_ms = data->set.happy_eyeballs_timeout / 2;
  788|       |
  789|    329|  result = Curl_cf_create(&cf, &Curl_cft_http_connect, ctx);
  790|    329|  if(result)
  ------------------
  |  Branch (790:6): [True: 0, False: 329]
  ------------------
  791|      0|    goto out;
  792|    329|  ctx = NULL;
  793|       |
  794|    329|out:
  795|    329|  *pcf = result ? NULL : cf;
  ------------------
  |  Branch (795:10): [True: 0, False: 329]
  ------------------
  796|    329|  cf_hc_ctx_destroy(data, ctx);
  797|    329|  return result;
  798|    329|}

cf_ip_happy_insert_after:
 1036|  14.1k|{
 1037|  14.1k|  cf_ip_connect_create *cf_create;
 1038|  14.1k|  struct Curl_cfilter *cf;
 1039|  14.1k|  CURLcode result;
 1040|       |
 1041|       |  /* Need to be first */
 1042|  14.1k|  DEBUGASSERT(cf_at);
  ------------------
  |  | 1081|  14.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1042:3): [True: 0, False: 14.1k]
  |  Branch (1042:3): [True: 14.1k, False: 0]
  ------------------
 1043|  14.1k|  cf_create = get_cf_create(transport_out, tunnel_proxy);
 1044|  14.1k|  if(!cf_create) {
  ------------------
  |  Branch (1044:6): [True: 0, False: 14.1k]
  ------------------
 1045|      0|    CURL_TRC_CF(data, cf_at, "unsupported transport type %u%s",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1046|      0|                transport_out, tunnel_proxy ? "to proxy" : "");
 1047|      0|    return CURLE_UNSUPPORTED_PROTOCOL;
 1048|      0|  }
 1049|  14.1k|  result = cf_ip_happy_create(&cf, data, peer, cf_at->conn, cf_create,
 1050|  14.1k|                              transport_in, transport_out);
 1051|  14.1k|  if(result)
  ------------------
  |  Branch (1051:6): [True: 0, False: 14.1k]
  ------------------
 1052|      0|    return result;
 1053|       |
 1054|  14.1k|  Curl_conn_cf_insert_after(cf_at, cf);
 1055|  14.1k|  return CURLE_OK;
 1056|  14.1k|}
cf-ip-happy.c:cf_ip_happy_destroy:
  958|  14.1k|{
  959|  14.1k|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  960|       |
  961|  14.1k|  CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|  14.1k|  do {                                          \
  |  |  154|  14.1k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  14.1k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  28.2k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 14.1k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 14.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  28.2k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  14.1k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  14.1k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  14.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  962|  14.1k|  if(ctx) {
  ------------------
  |  Branch (962:6): [True: 14.1k, False: 0]
  ------------------
  963|  14.1k|    cf_ip_happy_ctx_clear(cf, data);
  964|  14.1k|    cf_ip_happy_ctx_destroy(ctx);
  965|  14.1k|  }
  966|  14.1k|}
cf-ip-happy.c:cf_ip_happy_ctx_clear:
  765|  32.2k|{
  766|  32.2k|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  767|       |
  768|  32.2k|  DEBUGASSERT(ctx);
  ------------------
  |  | 1081|  32.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (768:3): [True: 0, False: 32.2k]
  |  Branch (768:3): [True: 32.2k, False: 0]
  ------------------
  769|  32.2k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  32.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (769:3): [True: 0, False: 32.2k]
  |  Branch (769:3): [True: 32.2k, False: 0]
  ------------------
  770|  32.2k|  cf_ip_ballers_clear(cf, data, &ctx->ballers);
  771|  32.2k|}
cf-ip-happy.c:cf_ip_ballers_clear:
  302|  32.2k|{
  303|  32.2k|  (void)cf;
  304|  32.4k|  while(bs->running) {
  ------------------
  |  Branch (304:9): [True: 225, False: 32.2k]
  ------------------
  305|    225|    struct cf_ip_attempt *a = bs->running;
  306|    225|    bs->running = a->next;
  307|    225|    cf_ip_attempt_free(a, data);
  308|    225|  }
  309|  32.2k|  cf_ip_attempt_free(bs->winner, data);
  310|       |  bs->winner = NULL;
  311|  32.2k|}
cf-ip-happy.c:cf_ip_attempt_free:
  176|  32.4k|{
  177|  32.4k|  if(a) {
  ------------------
  |  Branch (177:6): [True: 14.0k, False: 18.4k]
  ------------------
  178|  14.0k|    if(a->cf)
  ------------------
  |  Branch (178:8): [True: 25, False: 14.0k]
  ------------------
  179|     25|      Curl_conn_cf_discard_chain(&a->cf, data);
  180|  14.0k|    curlx_free(a);
  ------------------
  |  | 1483|  14.0k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  181|  14.0k|  }
  182|  32.4k|}
cf-ip-happy.c:cf_ip_happy_ctx_destroy:
  774|  14.1k|{
  775|  14.1k|  if(ctx) {
  ------------------
  |  Branch (775:6): [True: 14.1k, False: 0]
  ------------------
  776|  14.1k|    Curl_peer_unlink(&ctx->peer);
  777|  14.1k|    curlx_free(ctx);
  ------------------
  |  | 1483|  14.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  778|  14.1k|  }
  779|  14.1k|}
cf-ip-happy.c:cf_ip_happy_connect:
  816|   165k|{
  817|   165k|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  818|   165k|  CURLcode result = CURLE_OK;
  819|       |
  820|       |  /* -Werror=null-dereference finds false positives suddenly. */
  821|   165k|  if(!data)
  ------------------
  |  Branch (821:6): [True: 0, False: 165k]
  ------------------
  822|      0|    return CURLE_FAILED_INIT;
  823|       |
  824|   165k|  if(cf->connected) {
  ------------------
  |  Branch (824:6): [True: 16.4k, False: 149k]
  ------------------
  825|  16.4k|    *done = TRUE;
  ------------------
  |  | 1055|  16.4k|#define TRUE true
  ------------------
  826|  16.4k|    return CURLE_OK;
  827|  16.4k|  }
  828|       |
  829|   149k|  DEBUGASSERT(ctx);
  ------------------
  |  | 1081|   149k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (829:3): [True: 0, False: 149k]
  |  Branch (829:3): [True: 149k, False: 0]
  ------------------
  830|   149k|  *done = FALSE;
  ------------------
  |  | 1058|   149k|#define FALSE false
  ------------------
  831|       |
  832|   149k|  if(!ctx->dns_resolved) {
  ------------------
  |  Branch (832:6): [True: 149k, False: 40]
  ------------------
  833|   149k|    result = Curl_conn_dns_result(cf->conn, cf->sockindex);
  834|   149k|    if(!result)
  ------------------
  |  Branch (834:8): [True: 14.0k, False: 135k]
  ------------------
  835|  14.0k|      ctx->dns_resolved = TRUE;
  ------------------
  |  | 1055|  14.0k|#define TRUE true
  ------------------
  836|   135k|    else if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (836:13): [True: 135k, False: 0]
  ------------------
  837|   135k|      result = CURLE_OK;
  838|   135k|    }
  839|      0|    else /* real error */
  840|      0|      goto out;
  841|   149k|  }
  842|       |
  843|   149k|  switch(ctx->state) {
  ------------------
  |  Branch (843:10): [True: 149k, False: 0]
  ------------------
  844|  14.1k|  case SCFST_INIT:
  ------------------
  |  Branch (844:3): [True: 14.1k, False: 135k]
  ------------------
  845|  14.1k|    DEBUGASSERT(CURL_SOCKET_BAD == Curl_conn_cf_get_socket(cf, data));
  ------------------
  |  | 1081|  14.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (845:5): [True: 0, False: 14.1k]
  |  Branch (845:5): [True: 14.1k, False: 0]
  ------------------
  846|  14.1k|    DEBUGASSERT(!cf->connected);
  ------------------
  |  | 1081|  14.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (846:5): [True: 0, False: 14.1k]
  |  Branch (846:5): [True: 14.1k, False: 0]
  ------------------
  847|  14.1k|    result = cf_ip_happy_init(cf, data);
  848|  14.1k|    if(result)
  ------------------
  |  Branch (848:8): [True: 0, False: 14.1k]
  ------------------
  849|      0|      goto out;
  850|  14.1k|    ctx->state = SCFST_WAITING;
  851|  14.1k|    FALLTHROUGH();
  ------------------
  |  |  821|  14.1k|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  852|   149k|  case SCFST_WAITING:
  ------------------
  |  Branch (852:3): [True: 135k, False: 14.1k]
  ------------------
  853|   149k|    result = is_connected(cf, data, done);
  854|   149k|    if(!result && *done) {
  ------------------
  |  Branch (854:8): [True: 148k, False: 195]
  |  Branch (854:19): [True: 13.8k, False: 135k]
  ------------------
  855|  13.8k|      DEBUGASSERT(ctx->ballers.winner);
  ------------------
  |  | 1081|  13.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (855:7): [True: 0, False: 13.8k]
  |  Branch (855:7): [True: 13.8k, False: 0]
  ------------------
  856|  13.8k|      DEBUGASSERT(ctx->ballers.winner->cf);
  ------------------
  |  | 1081|  13.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (856:7): [True: 0, False: 13.8k]
  |  Branch (856:7): [True: 13.8k, False: 0]
  ------------------
  857|  13.8k|      DEBUGASSERT(ctx->ballers.winner->cf->connected);
  ------------------
  |  | 1081|  13.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (857:7): [True: 0, False: 13.8k]
  |  Branch (857:7): [True: 13.8k, False: 0]
  ------------------
  858|       |      /* we have a winner. Install and activate it.
  859|       |       * close/free all others. */
  860|  13.8k|      ctx->state = SCFST_DONE;
  861|  13.8k|      cf->connected = TRUE;
  ------------------
  |  | 1055|  13.8k|#define TRUE true
  ------------------
  862|  13.8k|      cf->next = ctx->ballers.winner->cf;
  863|  13.8k|      ctx->ballers.winner->cf = NULL;
  864|  13.8k|      cf_ip_happy_ctx_clear(cf, data);
  865|  13.8k|      Curl_expire_done(data, EXPIRE_HAPPY_EYEBALLS);
  866|       |      /* whatever errors where reported by ballers, clear our errorbuf */
  867|  13.8k|      Curl_reset_fail(data);
  868|       |
  869|  13.8k|      if(cf->conn->scheme->protocol & PROTO_FAMILY_SSH)
  ------------------
  |  |   90|  13.8k|#define PROTO_FAMILY_SSH  (CURLPROTO_SCP | CURLPROTO_SFTP)
  |  |  ------------------
  |  |  |  | 1082|  13.8k|#define CURLPROTO_SCP     (1L << 4)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_SSH  (CURLPROTO_SCP | CURLPROTO_SFTP)
  |  |  ------------------
  |  |  |  | 1083|  13.8k|#define CURLPROTO_SFTP    (1L << 5)
  |  |  ------------------
  ------------------
  |  Branch (869:10): [True: 0, False: 13.8k]
  ------------------
  870|      0|        Curl_pgrsTime(data, TIMER_APPCONNECT); /* we are connected already */
  871|  13.8k|#ifdef CURLVERBOSE
  872|  13.8k|      if(Curl_trc_cf_is_verbose(cf, data)) {
  ------------------
  |  |  323|  13.8k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  ------------------
  |  |  |  |  319|  27.6k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 13.8k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 13.8k]
  |  |  |  |  ------------------
  |  |  |  |  320|  27.6k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  324|  13.8k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  873|      0|        struct ip_quadruple ipquad;
  874|      0|        bool is_ipv6;
  875|      0|        if(!Curl_conn_cf_get_ip_info(cf->next, data, &is_ipv6, &ipquad)) {
  ------------------
  |  Branch (875:12): [True: 0, False: 0]
  ------------------
  876|      0|          const char *host;
  877|      0|          Curl_conn_get_current_host(data, cf->sockindex, &host, NULL);
  878|      0|          CURL_TRC_CF(data, cf, "Connected to %s (%s) port %u",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  879|      0|                      host, ipquad.remote_ip, ipquad.remote_port);
  880|      0|        }
  881|      0|      }
  882|  13.8k|#endif
  883|  13.8k|      data->info.numconnects++; /* to track the # of connections made */
  884|  13.8k|    }
  885|   149k|    break;
  886|   149k|  case SCFST_DONE:
  ------------------
  |  Branch (886:3): [True: 0, False: 149k]
  ------------------
  887|      0|    *done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  888|      0|    break;
  889|   149k|  }
  890|   149k|out:
  891|   149k|  return result;
  892|   149k|}
cf-ip-happy.c:cf_ip_happy_init:
  745|  14.1k|{
  746|  14.1k|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  747|       |
  748|  14.1k|  if(Curl_timeleft_ms(data) < 0) {
  ------------------
  |  Branch (748:6): [True: 0, False: 14.1k]
  ------------------
  749|       |    /* a precaution, no need to continue if time already is up */
  750|      0|    failf(data, "Connection time-out");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  751|      0|    return CURLE_OPERATION_TIMEDOUT;
  752|      0|  }
  753|       |
  754|  14.1k|  CURL_TRC_CF(data, cf, "init ip ballers for transport %u",
  ------------------
  |  |  153|  14.1k|  do {                                          \
  |  |  154|  14.1k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  14.1k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  28.2k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 14.1k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 14.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  28.2k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  14.1k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  14.1k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  14.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  755|  14.1k|              ctx->transport_out);
  756|  14.1k|  ctx->started = *Curl_pgrs_now(data);
  757|  14.1k|  return cf_ip_ballers_init(&ctx->ballers, cf, ctx->cf_create,
  758|  14.1k|                            ctx->transport_in, ctx->transport_out,
  759|  14.1k|                            data->set.happy_eyeballs_timeout,
  760|  14.1k|                            IP_HE_MAX_CONCURRENT_ATTEMPTS);
  ------------------
  |  |  741|  14.1k|#define IP_HE_MAX_CONCURRENT_ATTEMPTS     6
  ------------------
  761|  14.1k|}
cf-ip-happy.c:cf_ip_ballers_init:
  320|  14.1k|{
  321|  14.1k|  memset(bs, 0, sizeof(*bs));
  322|  14.1k|  bs->cf_create = cf_create;
  323|  14.1k|  bs->transport_in = transport_in;
  324|  14.1k|  bs->transport_out = transport_out;
  325|  14.1k|  bs->attempt_delay_ms = attempt_delay_ms;
  326|  14.1k|  bs->max_concurrent = max_concurrent;
  327|  14.1k|  bs->last_attempt_ai_family = AF_INET; /* so AF_INET6 is next */
  328|       |
  329|  14.1k|  if(transport_in == TRNSPRT_UNIX) {
  ------------------
  |  |  310|  14.1k|#define TRNSPRT_UNIX 6
  ------------------
  |  Branch (329:6): [True: 131, False: 13.9k]
  ------------------
  330|    131|#ifdef USE_UNIX_SOCKETS
  331|    131|    cf_ai_iter_init(&bs->addr_iter, cf, AF_UNIX);
  332|       |#else
  333|       |    return CURLE_UNSUPPORTED_PROTOCOL;
  334|       |#endif
  335|    131|  }
  336|  13.9k|  else { /* TCP/UDP/QUIC */
  337|  13.9k|#ifdef USE_IPV6
  338|  13.9k|    cf_ai_iter_init(&bs->ipv6_iter, cf, AF_INET6);
  339|  13.9k|#endif
  340|       |    cf_ai_iter_init(&bs->addr_iter, cf, AF_INET);
  341|  13.9k|  }
  342|  14.1k|  return CURLE_OK;
  343|  14.1k|}
cf-ip-happy.c:cf_ai_iter_init:
  128|  28.1k|{
  129|  28.1k|  iter->cf = cf;
  130|  28.1k|  iter->ai_family = ai_family;
  131|  28.1k|  iter->n = 0;
  132|  28.1k|}
cf-ip-happy.c:is_connected:
  685|   149k|{
  686|   149k|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  687|   149k|  struct connectdata *conn = cf->conn;
  688|   149k|  CURLcode result;
  689|       |
  690|   149k|  result = cf_ip_ballers_run(&ctx->ballers, cf, data,
  691|   149k|                             (bool)ctx->dns_resolved, connected);
  692|       |
  693|   149k|  if(!result)
  ------------------
  |  Branch (693:6): [True: 148k, False: 195]
  ------------------
  694|   148k|    return CURLE_OK;
  695|    195|  else {
  696|    195|    struct Curl_peer *peer = NULL, *proxy_peer = NULL;
  697|    195|    char viamsg[160];
  698|       |
  699|    195|    peer = Curl_conn_get_first_peer(conn, cf->sockindex);
  700|    195|    if(!conn->origin || !peer)
  ------------------
  |  Branch (700:8): [True: 0, False: 195]
  |  Branch (700:25): [True: 0, False: 195]
  ------------------
  701|      0|      return CURLE_FAILED_INIT;
  702|       |
  703|    195|#ifndef CURL_DISABLE_PROXY
  704|    195|    if(conn->bits.socksproxy)
  ------------------
  |  Branch (704:8): [True: 4, False: 191]
  ------------------
  705|      4|      proxy_peer = conn->socks_proxy.peer;
  706|    191|    else if(conn->bits.httpproxy)
  ------------------
  |  Branch (706:13): [True: 43, False: 148]
  ------------------
  707|     43|      proxy_peer = conn->http_proxy.peer;
  708|    195|#endif
  709|       |
  710|    195|    viamsg[0] = 0;
  711|    195|    if((peer != conn->origin) && (peer != proxy_peer)) {
  ------------------
  |  Branch (711:8): [True: 162, False: 33]
  |  Branch (711:34): [True: 115, False: 47]
  ------------------
  712|    115|#ifdef USE_UNIX_SOCKETS
  713|    115|      if(peer->unix_socket)
  ------------------
  |  Branch (713:10): [True: 3, False: 112]
  ------------------
  714|      3|        curl_msnprintf(viamsg, sizeof(viamsg), " over unix://%s",
  715|      3|                       peer->hostname);
  716|    112|      else
  717|    112|#endif
  718|    112|      curl_msnprintf(viamsg, sizeof(viamsg), " via %s:%u",
  719|    112|                     peer->hostname, peer->port);
  720|    115|    }
  721|       |
  722|    195|    failf(data, "Failed to connect to %s:%u%s %s%s%safter "
  ------------------
  |  |   62|    195|#define failf Curl_failf
  ------------------
  723|    195|          "%" FMT_TIMEDIFF_T " ms: %s",
  724|    195|          conn->origin->hostname, conn->origin->port, viamsg,
  725|    195|          proxy_peer ? "over proxy " : "",
  ------------------
  |  Branch (725:11): [True: 47, False: 148]
  ------------------
  726|    195|          proxy_peer ? proxy_peer->hostname : "",
  ------------------
  |  Branch (726:11): [True: 47, False: 148]
  ------------------
  727|    195|          proxy_peer ? " " : "",
  ------------------
  |  Branch (727:11): [True: 47, False: 148]
  ------------------
  728|    195|          curlx_ptimediff_ms(Curl_pgrs_now(data),
  729|    195|                             &data->progress.t_startsingle),
  730|    195|          curl_easy_strerror(result));
  731|       |
  732|    195|#ifdef SOCKETIMEDOUT
  733|    195|    if(SOCKETIMEDOUT == data->state.os_errno)
  ------------------
  |  | 1135|    195|#define SOCKETIMEDOUT     ETIMEDOUT
  ------------------
  |  Branch (733:8): [True: 0, False: 195]
  ------------------
  734|      0|      result = CURLE_OPERATION_TIMEDOUT;
  735|    195|#endif
  736|       |
  737|    195|    return result;
  738|    195|  }
  739|   149k|}
cf-ip-happy.c:cf_ip_ballers_run:
  379|   149k|{
  380|   149k|  CURLcode result = CURLE_OK;
  381|   149k|  struct cf_ip_attempt *a = NULL, **panchor;
  382|   149k|  bool do_more;
  383|   149k|  timediff_t next_expire_ms;
  384|   149k|  uint32_t inconclusive, ongoing;
  385|   149k|  VERBOSE(int i);
  ------------------
  |  | 1618|   149k|#define VERBOSE(x) x
  ------------------
  386|       |
  387|   149k|  if(bs->winner)
  ------------------
  |  Branch (387:6): [True: 0, False: 149k]
  ------------------
  388|      0|    return CURLE_OK;
  389|       |
  390|   163k|evaluate:
  391|   163k|  ongoing = inconclusive = 0;
  392|       |
  393|       |  /* check if a running baller connects now */
  394|   163k|  VERBOSE(i = -1);
  ------------------
  |  | 1618|   163k|#define VERBOSE(x) x
  ------------------
  395|   163k|  for(panchor = &bs->running; *panchor; panchor = &((*panchor)->next)) {
  ------------------
  |  Branch (395:31): [True: 14.1k, False: 149k]
  ------------------
  396|  14.1k|    VERBOSE(++i);
  ------------------
  |  | 1618|  14.1k|#define VERBOSE(x) x
  ------------------
  397|  14.1k|    a = *panchor;
  398|  14.1k|    a->result = cf_ip_attempt_connect(a, data, connected);
  399|  14.1k|    if(!a->result) {
  ------------------
  |  Branch (399:8): [True: 13.8k, False: 208]
  ------------------
  400|  13.8k|      if(*connected) {
  ------------------
  |  Branch (400:10): [True: 13.8k, False: 65]
  ------------------
  401|       |        /* connected, declare the winner, remove from running,
  402|       |         * clear remaining running list. */
  403|  13.8k|        CURL_TRC_CF(data, cf, "connect attempt #%d successful", i);
  ------------------
  |  |  153|  13.8k|  do {                                          \
  |  |  154|  13.8k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  13.8k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  27.6k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 13.8k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 13.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  27.6k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  13.8k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  13.8k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  13.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 13.8k]
  |  |  ------------------
  ------------------
  404|  13.8k|        bs->winner = a;
  405|  13.8k|        *panchor = a->next;
  406|  13.8k|        a->next = NULL;
  407|  13.8k|        while(bs->running) {
  ------------------
  |  Branch (407:15): [True: 0, False: 13.8k]
  ------------------
  408|      0|          a = bs->running;
  409|      0|          bs->running = a->next;
  410|      0|          cf_ip_attempt_free(a, data);
  411|      0|        }
  412|  13.8k|        return CURLE_OK;
  413|  13.8k|      }
  414|       |      /* still running */
  415|     65|      ++ongoing;
  416|     65|    }
  417|    208|    else if(a->inconclusive) /* failed, but inconclusive */
  ------------------
  |  Branch (417:13): [True: 0, False: 208]
  ------------------
  418|      0|      ++inconclusive;
  419|  14.1k|  }
  420|   149k|  if(bs->running)
  ------------------
  |  Branch (420:6): [True: 265, False: 149k]
  ------------------
  421|    265|    CURL_TRC_CF(data, cf, "checked connect attempts: "
  ------------------
  |  |  153|    265|  do {                                          \
  |  |  154|    265|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    265|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    530|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 265, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 265]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    530|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    265|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    265|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    265|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 265]
  |  |  ------------------
  ------------------
  422|   149k|                "%u ongoing, %u inconclusive", ongoing, inconclusive);
  423|       |
  424|       |  /* no attempt connected yet, start another one? */
  425|   149k|  if(!ongoing) {
  ------------------
  |  Branch (425:6): [True: 149k, False: 65]
  ------------------
  426|   149k|    if(!bs->started.tv_sec && !bs->started.tv_usec)
  ------------------
  |  Branch (426:8): [True: 14.1k, False: 135k]
  |  Branch (426:31): [True: 14.1k, False: 0]
  ------------------
  427|  14.1k|      bs->started = *Curl_pgrs_now(data);
  428|   149k|    do_more = TRUE;
  ------------------
  |  | 1055|   149k|#define TRUE true
  ------------------
  429|   149k|  }
  430|     65|  else {
  431|     65|    bool more_possible = cf_ai_iter_has_more(&bs->addr_iter, data);
  432|     65|#ifdef USE_IPV6
  433|     65|    if(!more_possible)
  ------------------
  |  Branch (433:8): [True: 65, False: 0]
  ------------------
  434|     65|      more_possible = cf_ai_iter_has_more(&bs->ipv6_iter, data);
  435|     65|#endif
  436|     65|    do_more = more_possible &&
  ------------------
  |  Branch (436:15): [True: 0, False: 65]
  ------------------
  437|      0|      (curlx_ptimediff_ms(Curl_pgrs_now(data), &bs->last_attempt_started) >=
  ------------------
  |  Branch (437:7): [True: 0, False: 0]
  ------------------
  438|      0|       bs->attempt_delay_ms);
  439|     65|    if(do_more)
  ------------------
  |  Branch (439:8): [True: 0, False: 65]
  ------------------
  440|      0|      CURL_TRC_CF(data, cf, "happy eyeballs timeout expired, "
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  441|     65|                  "start next attempt");
  442|     65|  }
  443|       |
  444|   149k|  if(do_more) {
  ------------------
  |  Branch (444:6): [True: 149k, False: 65]
  ------------------
  445|       |    /* start the next attempt if there is another ip address to try.
  446|       |     * Alternate between address families when possible. */
  447|   149k|    const struct Curl_addrinfo *ai = NULL;
  448|   149k|    int ai_family = 0;
  449|   149k|    CURL_TRC_CF(data, cf, "want to do more");
  ------------------
  |  |  153|   149k|  do {                                          \
  |  |  154|   149k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|   149k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|   298k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 149k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 149k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|   298k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|   149k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|   149k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|   149k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 149k]
  |  |  ------------------
  ------------------
  450|   149k|#ifdef USE_IPV6
  451|   149k|    if((bs->last_attempt_ai_family == AF_INET) ||
  ------------------
  |  Branch (451:8): [True: 149k, False: 25]
  ------------------
  452|   149k|       !cf_ai_iter_has_more(&bs->addr_iter, data)) {
  ------------------
  |  Branch (452:8): [True: 19, False: 6]
  ------------------
  453|   149k|      ai = cf_ai_iter_next(&bs->ipv6_iter, data);
  454|   149k|      ai_family = bs->ipv6_iter.ai_family;
  455|   149k|      CURL_TRC_CF(data, cf, "check for next AAAA address: %s",
  ------------------
  |  |  153|   149k|  do {                                          \
  |  |  154|   149k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|   149k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|   298k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 149k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 149k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|   298k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|   149k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|   149k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|   149k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 149k]
  |  |  ------------------
  ------------------
  456|   149k|                  ai ? "found" : "none");
  457|   149k|    }
  458|   149k|#endif
  459|   149k|    if(!ai) {
  ------------------
  |  Branch (459:8): [True: 149k, False: 93]
  ------------------
  460|   149k|      ai = cf_ai_iter_next(&bs->addr_iter, data);
  461|   149k|      ai_family = bs->addr_iter.ai_family;
  462|   149k|      CURL_TRC_CF(data, cf, "check for next A address: %s",
  ------------------
  |  |  153|   149k|  do {                                          \
  |  |  154|   149k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|   149k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|   298k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 149k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 149k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|   298k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|   149k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|   149k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|   149k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 149k]
  |  |  ------------------
  ------------------
  463|   149k|                  ai ? "found" : "none");
  464|   149k|    }
  465|       |    /* We are (re-)starting attempts. We are not interested in
  466|       |     * keeping old failure information. The new attempt will either
  467|       |     * succeed or persist new failure. */
  468|   149k|    Curl_reset_fail(data);
  469|       |
  470|   149k|    if(ai) {  /* try another address */
  ------------------
  |  Branch (470:8): [True: 14.0k, False: 135k]
  ------------------
  471|  14.0k|      struct Curl_sockaddr_ex addr;
  472|       |
  473|       |      /* Discard oldest to make room for new attempt */
  474|  14.0k|      if(bs->max_concurrent)
  ------------------
  |  Branch (474:10): [True: 14.0k, False: 0]
  ------------------
  475|  14.0k|        cf_ip_ballers_prune(bs, cf, data, bs->max_concurrent - 1);
  476|       |
  477|  14.0k|      result = Curl_socket_addr_from_ai(&addr, ai, bs->transport_out);
  478|  14.0k|      if(result)
  ------------------
  |  Branch (478:10): [True: 0, False: 14.0k]
  ------------------
  479|      0|        goto out;
  480|       |
  481|  14.0k|      result = cf_ip_attempt_new(&a, cf, data, &addr, ai_family,
  482|  14.0k|                                 bs->transport_in, bs->transport_out,
  483|  14.0k|                                 bs->cf_create);
  484|  14.0k|      CURL_TRC_CF(data, cf, "starting %s attempt for ipv%s -> %d",
  ------------------
  |  |  153|  14.0k|  do {                                          \
  |  |  154|  14.0k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  14.0k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  28.1k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 14.0k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 14.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  28.1k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  14.0k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  14.0k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|  14.0k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 14.0k]
  |  |  ------------------
  ------------------
  485|  14.0k|                  bs->running ? "next" : "first",
  486|  14.0k|                  (ai_family == AF_INET) ? "4" : "6", result);
  487|  14.0k|      if(result)
  ------------------
  |  Branch (487:10): [True: 0, False: 14.0k]
  ------------------
  488|      0|        goto out;
  489|  14.0k|      DEBUGASSERT(a);
  ------------------
  |  | 1081|  14.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (489:7): [True: 0, False: 14.0k]
  |  Branch (489:7): [True: 14.0k, False: 0]
  ------------------
  490|       |
  491|       |      /* append to running list */
  492|  14.0k|      panchor = &bs->running;
  493|  14.0k|      while(*panchor)
  ------------------
  |  Branch (493:13): [True: 6, False: 14.0k]
  ------------------
  494|      6|        panchor = &((*panchor)->next);
  495|  14.0k|      *panchor = a;
  496|  14.0k|      bs->last_attempt_started = *Curl_pgrs_now(data);
  497|  14.0k|      bs->last_attempt_ai_family = ai_family;
  498|       |      /* and run everything again */
  499|  14.0k|      goto evaluate;
  500|  14.0k|    }
  501|   135k|    else if(inconclusive) {
  ------------------
  |  Branch (501:13): [True: 0, False: 135k]
  ------------------
  502|       |      /* tried all addresses, no success but some where inconclusive.
  503|       |       * Let's restart the inconclusive ones. */
  504|      0|      timediff_t since_ms =
  505|      0|        curlx_ptimediff_ms(Curl_pgrs_now(data), &bs->last_attempt_started);
  506|      0|      timediff_t delay_ms = bs->attempt_delay_ms - since_ms;
  507|      0|      if(delay_ms <= 0) {
  ------------------
  |  Branch (507:10): [True: 0, False: 0]
  ------------------
  508|      0|        CURL_TRC_CF(data, cf, "all attempts inconclusive, restarting one");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  509|      0|        VERBOSE(i = -1);
  ------------------
  |  | 1618|      0|#define VERBOSE(x) x
  ------------------
  510|      0|        for(a = bs->running; a; a = a->next) {
  ------------------
  |  Branch (510:30): [True: 0, False: 0]
  ------------------
  511|      0|          VERBOSE(++i);
  ------------------
  |  | 1618|      0|#define VERBOSE(x) x
  ------------------
  512|      0|          if(!a->inconclusive)
  ------------------
  |  Branch (512:14): [True: 0, False: 0]
  ------------------
  513|      0|            continue;
  514|      0|          result = cf_ip_attempt_restart(a, cf, data);
  515|      0|          CURL_TRC_CF(data, cf, "restarted baller %d -> %d", i, result);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  516|      0|          if(result) /* serious failure */
  ------------------
  |  Branch (516:14): [True: 0, False: 0]
  ------------------
  517|      0|            goto out;
  518|      0|          bs->last_attempt_started = *Curl_pgrs_now(data);
  519|      0|          goto evaluate;
  520|      0|        }
  521|      0|        DEBUGASSERT(0); /* should not come here */
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (521:9): [Folded, False: 0]
  |  Branch (521:9): [Folded, False: 0]
  ------------------
  522|      0|      }
  523|      0|      else {
  524|       |        /* let's wait some more before restarting */
  525|      0|        infof(data, "connect attempts inconclusive, retrying "
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  526|      0|                    "in %" FMT_TIMEDIFF_T "ms", delay_ms);
  527|      0|        Curl_expire(data, delay_ms, EXPIRE_HAPPY_EYEBALLS);
  528|      0|      }
  529|       |      /* attempt timeout for restart has not expired yet */
  530|      0|      goto out;
  531|      0|    }
  532|   135k|    else if(!ongoing && dns_resolved) {
  ------------------
  |  Branch (532:13): [True: 135k, False: 0]
  |  Branch (532:25): [True: 195, False: 135k]
  ------------------
  533|       |      /* no more addresses, no inconclusive attempts */
  534|    195|      CURL_TRC_CF(data, cf, "no more attempts to try");
  ------------------
  |  |  153|    195|  do {                                          \
  |  |  154|    195|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    195|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    390|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 195, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 195]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    390|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    195|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    195|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    195|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 195]
  |  |  ------------------
  ------------------
  535|    195|      result = CURLE_COULDNT_CONNECT;
  536|    195|      VERBOSE(i = 0);
  ------------------
  |  | 1618|    195|#define VERBOSE(x) x
  ------------------
  537|    395|      for(a = bs->running; a; a = a->next) {
  ------------------
  |  Branch (537:28): [True: 200, False: 195]
  ------------------
  538|    200|        CURL_TRC_CF(data, cf, "baller %d: result=%d", i, a->result);
  ------------------
  |  |  153|    200|  do {                                          \
  |  |  154|    200|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    200|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    400|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 200, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 200]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    400|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    200|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    200|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    200|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 200]
  |  |  ------------------
  ------------------
  539|    200|        if(a->result)
  ------------------
  |  Branch (539:12): [True: 200, False: 0]
  ------------------
  540|    200|          result = a->result;
  541|    200|      }
  542|    195|    }
  543|   149k|  }
  544|       |
  545|   135k|out:
  546|   135k|  if(!result) {
  ------------------
  |  Branch (546:6): [True: 135k, False: 195]
  ------------------
  547|   135k|    bool more_possible;
  548|       |
  549|       |    /* when do we need to be called again? */
  550|   135k|    next_expire_ms = Curl_timeleft_ms(data);
  551|   135k|    if(next_expire_ms < 0) {
  ------------------
  |  Branch (551:8): [True: 0, False: 135k]
  ------------------
  552|      0|      failf(data, "Connection timeout after %" FMT_OFF_T " ms",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  553|      0|            curlx_ptimediff_ms(Curl_pgrs_now(data),
  554|      0|                               &data->progress.t_startsingle));
  555|      0|      return CURLE_OPERATION_TIMEDOUT;
  556|      0|    }
  557|       |
  558|   135k|    more_possible = cf_ai_iter_has_more(&bs->addr_iter, data);
  559|   135k|#ifdef USE_IPV6
  560|   135k|    if(!more_possible)
  ------------------
  |  Branch (560:8): [True: 135k, False: 0]
  ------------------
  561|   135k|      more_possible = cf_ai_iter_has_more(&bs->ipv6_iter, data);
  562|   135k|#endif
  563|   135k|    if(more_possible) {
  ------------------
  |  Branch (563:8): [True: 0, False: 135k]
  ------------------
  564|      0|      timediff_t expire_ms, elapsed_ms;
  565|      0|      elapsed_ms =
  566|      0|        curlx_ptimediff_ms(Curl_pgrs_now(data), &bs->last_attempt_started);
  567|      0|      expire_ms = CURLMAX(bs->attempt_delay_ms - elapsed_ms, 0);
  ------------------
  |  | 1286|      0|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1286:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  568|      0|      next_expire_ms = CURLMIN(next_expire_ms, expire_ms);
  ------------------
  |  | 1287|      0|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  569|      0|      if(next_expire_ms <= 0) {
  ------------------
  |  Branch (569:10): [True: 0, False: 0]
  ------------------
  570|      0|        CURL_TRC_CF(data, cf, "HAPPY_EYEBALLS timeout due, re-evaluate");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  571|      0|        goto evaluate;
  572|      0|      }
  573|      0|      CURL_TRC_CF(data, cf, "next HAPPY_EYEBALLS timeout in %" FMT_TIMEDIFF_T
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  574|      0|                  "ms", next_expire_ms);
  575|      0|      Curl_expire(data, next_expire_ms, EXPIRE_HAPPY_EYEBALLS);
  576|      0|    }
  577|   135k|  }
  578|   135k|  return result;
  579|   135k|}
cf-ip-happy.c:cf_ip_attempt_connect:
  232|  14.1k|{
  233|  14.1k|  *connected = (bool)a->connected;
  234|  14.1k|  if(!a->result && !*connected) {
  ------------------
  |  Branch (234:6): [True: 14.0k, False: 8]
  |  Branch (234:20): [True: 14.0k, False: 0]
  ------------------
  235|       |    /* evaluate again */
  236|  14.0k|    a->result = Curl_conn_cf_connect(a->cf, data, connected);
  237|       |
  238|  14.0k|    if(!a->result) {
  ------------------
  |  Branch (238:8): [True: 13.8k, False: 200]
  ------------------
  239|  13.8k|      if(*connected) {
  ------------------
  |  Branch (239:10): [True: 13.8k, False: 65]
  ------------------
  240|  13.8k|        a->connected = TRUE;
  ------------------
  |  | 1055|  13.8k|#define TRUE true
  ------------------
  241|  13.8k|      }
  242|  13.8k|    }
  243|    200|    else {
  244|    200|      if(a->result == CURLE_WEIRD_SERVER_REPLY)
  ------------------
  |  Branch (244:10): [True: 0, False: 200]
  ------------------
  245|      0|        a->inconclusive = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  246|    200|      if(a->cf)
  ------------------
  |  Branch (246:10): [True: 200, False: 0]
  ------------------
  247|    200|        Curl_conn_cf_discard_chain(&a->cf, data);
  248|    200|    }
  249|  14.0k|  }
  250|  14.1k|  return a->result;
  251|  14.1k|}
cf-ip-happy.c:cf_ai_iter_has_more:
  151|   270k|{
  152|   270k|  return (iter->cf &&
  ------------------
  |  Branch (152:11): [True: 175k, False: 95.2k]
  ------------------
  153|   175k|          !!Curl_conn_dns_get_ai(data, iter->cf->sockindex,
  ------------------
  |  Branch (153:11): [True: 6, False: 175k]
  ------------------
  154|   175k|                                 iter->ai_family, iter->n));
  155|   270k|}
cf-ip-happy.c:cf_ai_iter_next:
  136|   298k|{
  137|   298k|  const struct Curl_addrinfo *addr;
  138|       |
  139|   298k|  if(!iter->cf)
  ------------------
  |  Branch (139:6): [True: 95.3k, False: 203k]
  ------------------
  140|  95.3k|    return NULL;
  141|       |
  142|   203k|  addr = Curl_conn_dns_get_ai(data, iter->cf->sockindex,
  143|   203k|                              iter->ai_family, iter->n);
  144|   203k|  if(addr)
  ------------------
  |  Branch (144:6): [True: 14.0k, False: 189k]
  ------------------
  145|  14.0k|    iter->n++;
  146|   203k|  return addr;
  147|   298k|}
cf-ip-happy.c:cf_ip_ballers_prune:
  349|  14.0k|{
  350|  14.0k|  struct cf_ip_attempt *a = NULL, **panchor;
  351|  14.0k|  uint32_t ongoing = 0;
  352|       |
  353|  14.0k|  for(a = bs->running; a; a = a->next) {
  ------------------
  |  Branch (353:24): [True: 6, False: 14.0k]
  ------------------
  354|      6|    if(!a->result && !a->connected)
  ------------------
  |  Branch (354:8): [True: 0, False: 6]
  |  Branch (354:22): [True: 0, False: 0]
  ------------------
  355|      0|      ++ongoing;
  356|      6|  }
  357|       |
  358|  14.0k|  panchor = &bs->running;
  359|  14.0k|  while(*panchor && (ongoing > max_concurrent)) {
  ------------------
  |  Branch (359:9): [True: 6, False: 14.0k]
  |  Branch (359:21): [True: 0, False: 6]
  ------------------
  360|      0|    a = *panchor;
  361|      0|    if(!a->result && !a->connected) {
  ------------------
  |  Branch (361:8): [True: 0, False: 0]
  |  Branch (361:22): [True: 0, False: 0]
  ------------------
  362|      0|      *panchor = a->next;
  363|      0|      a->next = NULL;
  364|      0|      cf_ip_attempt_free(a, data);
  365|      0|      --ongoing;
  366|      0|      CURL_TRC_CF(data, cf, "discarding oldest attempt to keep limit");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  367|      0|    }
  368|      0|    else {
  369|      0|      panchor = &a->next;
  370|      0|    }
  371|      0|  }
  372|  14.0k|}
cf-ip-happy.c:cf_ip_attempt_new:
  192|  14.0k|{
  193|  14.0k|  struct Curl_cfilter *wcf;
  194|  14.0k|  struct cf_ip_attempt *a;
  195|  14.0k|  CURLcode result = CURLE_OK;
  196|       |
  197|  14.0k|  *pa = NULL;
  198|  14.0k|  a = curlx_calloc(1, sizeof(*a));
  ------------------
  |  | 1480|  14.0k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  199|  14.0k|  if(!a)
  ------------------
  |  Branch (199:6): [True: 0, False: 14.0k]
  ------------------
  200|      0|    return CURLE_OUT_OF_MEMORY;
  201|       |
  202|  14.0k|  a->addr = *addr;
  203|  14.0k|  a->ai_family = ai_family;
  204|  14.0k|  a->transport_in = transport_in;
  205|  14.0k|  a->transport_out = transport_out;
  206|  14.0k|  a->result = CURLE_OK;
  207|  14.0k|  a->cf_create = cf_create;
  208|  14.0k|  *pa = a;
  209|       |
  210|  14.0k|  result = a->cf_create(&a->cf, data, cf->conn, &a->addr,
  211|  14.0k|                        a->transport_in, a->transport_out);
  212|  14.0k|  if(result)
  ------------------
  |  Branch (212:6): [True: 0, False: 14.0k]
  ------------------
  213|      0|    goto out;
  214|       |
  215|       |  /* the new filter might have sub-filters */
  216|  28.1k|  for(wcf = a->cf; wcf; wcf = wcf->next) {
  ------------------
  |  Branch (216:20): [True: 14.0k, False: 14.0k]
  ------------------
  217|  14.0k|    wcf->conn = cf->conn;
  218|  14.0k|    wcf->sockindex = cf->sockindex;
  219|  14.0k|  }
  220|       |
  221|  14.0k|out:
  222|  14.0k|  if(result) {
  ------------------
  |  Branch (222:6): [True: 0, False: 14.0k]
  ------------------
  223|      0|    cf_ip_attempt_free(a, data);
  224|       |    *pa = NULL;
  225|      0|  }
  226|  14.0k|  return result;
  227|  14.0k|}
cf-ip-happy.c:cf_ip_happy_close:
  896|  4.32k|{
  897|  4.32k|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  898|       |
  899|  4.32k|  CURL_TRC_CF(data, cf, "close");
  ------------------
  |  |  153|  4.32k|  do {                                          \
  |  |  154|  4.32k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  4.32k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  8.64k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 4.32k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4.32k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  8.64k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  4.32k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  4.32k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  4.32k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 4.32k]
  |  |  ------------------
  ------------------
  900|  4.32k|  cf_ip_happy_ctx_clear(cf, data);
  901|  4.32k|  cf->connected = FALSE;
  ------------------
  |  | 1058|  4.32k|#define FALSE false
  ------------------
  902|  4.32k|  ctx->state = SCFST_INIT;
  903|       |
  904|  4.32k|  if(cf->next) {
  ------------------
  |  Branch (904:6): [True: 4.03k, False: 291]
  ------------------
  905|  4.03k|    cf->next->cft->do_close(cf->next, data);
  906|  4.03k|    Curl_conn_cf_discard_chain(&cf->next, data);
  907|  4.03k|  }
  908|  4.32k|}
cf-ip-happy.c:cf_ip_happy_adjust_pollset:
  802|   207k|{
  803|   207k|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  804|   207k|  CURLcode result = CURLE_OK;
  805|       |
  806|   207k|  if(!cf->connected) {
  ------------------
  |  Branch (806:6): [True: 135k, False: 72.5k]
  ------------------
  807|   135k|    result = cf_ip_ballers_pollset(&ctx->ballers, data, ps);
  808|   135k|    CURL_TRC_CF(data, cf, "adjust_pollset -> %d, %u socks", result, ps->n);
  ------------------
  |  |  153|   135k|  do {                                          \
  |  |  154|   135k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|   135k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|   270k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 135k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 135k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|   270k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|   135k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|   135k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|   135k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 135k]
  |  |  ------------------
  ------------------
  809|   135k|  }
  810|   207k|  return result;
  811|   207k|}
cf-ip-happy.c:cf_ip_ballers_pollset:
  606|   135k|{
  607|   135k|  struct cf_ip_attempt *a;
  608|   135k|  CURLcode result = CURLE_OK;
  609|   135k|  for(a = bs->running; a && !result; a = a->next) {
  ------------------
  |  Branch (609:24): [True: 67, False: 135k]
  |  Branch (609:29): [True: 67, False: 0]
  ------------------
  610|     67|    if(a->result)
  ------------------
  |  Branch (610:8): [True: 2, False: 65]
  ------------------
  611|      2|      continue;
  612|     65|    result = Curl_conn_cf_adjust_pollset(a->cf, data, ps);
  613|     65|  }
  614|   135k|  return result;
  615|   135k|}
cf-ip-happy.c:cf_ip_happy_query:
  924|   328k|{
  925|   328k|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  926|       |
  927|   328k|  if(!cf->connected) {
  ------------------
  |  Branch (927:6): [True: 149k, False: 178k]
  ------------------
  928|   149k|    switch(query) {
  929|      0|    case CF_QUERY_CONNECT_REPLY_MS: {
  ------------------
  |  |  166|      0|#define CF_QUERY_CONNECT_REPLY_MS   2  /* number     -        */
  ------------------
  |  Branch (929:5): [True: 0, False: 149k]
  ------------------
  930|      0|      *pres1 = cf_ip_ballers_min_reply_ms(&ctx->ballers, data);
  931|      0|      CURL_TRC_CF(data, cf, "query connect reply: %dms", *pres1);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  932|      0|      return CURLE_OK;
  933|      0|    }
  934|    256|    case CF_QUERY_TIMER_CONNECT: {
  ------------------
  |  |  168|    256|#define CF_QUERY_TIMER_CONNECT      4  /* -          struct curltime */
  ------------------
  |  Branch (934:5): [True: 256, False: 149k]
  ------------------
  935|    256|      struct curltime *when = pres2;
  936|    256|      *when = cf_ip_ballers_max_time(&ctx->ballers, data,
  937|    256|                                     CF_QUERY_TIMER_CONNECT);
  ------------------
  |  |  168|    256|#define CF_QUERY_TIMER_CONNECT      4  /* -          struct curltime */
  ------------------
  938|    256|      return CURLE_OK;
  939|      0|    }
  940|    256|    case CF_QUERY_TIMER_APPCONNECT: {
  ------------------
  |  |  169|    256|#define CF_QUERY_TIMER_APPCONNECT   5  /* -          struct curltime */
  ------------------
  |  Branch (940:5): [True: 256, False: 149k]
  ------------------
  941|    256|      struct curltime *when = pres2;
  942|    256|      *when = cf_ip_ballers_max_time(&ctx->ballers, data,
  943|    256|                                     CF_QUERY_TIMER_APPCONNECT);
  ------------------
  |  |  169|    256|#define CF_QUERY_TIMER_APPCONNECT   5  /* -          struct curltime */
  ------------------
  944|    256|      return CURLE_OK;
  945|      0|    }
  946|   149k|    default:
  ------------------
  |  Branch (946:5): [True: 149k, False: 512]
  ------------------
  947|   149k|      break;
  948|   149k|    }
  949|   149k|  }
  950|       |
  951|   328k|  return cf->next ?
  ------------------
  |  Branch (951:10): [True: 178k, False: 149k]
  ------------------
  952|   178k|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
  953|   328k|    CURLE_UNKNOWN_OPTION;
  954|   328k|}
cf-ip-happy.c:cf_ip_ballers_max_time:
  634|    512|{
  635|    512|  struct curltime t, tmax;
  636|    512|  struct cf_ip_attempt *a;
  637|       |
  638|    512|  memset(&tmax, 0, sizeof(tmax));
  639|    912|  for(a = bs->running; a; a = a->next) {
  ------------------
  |  Branch (639:24): [True: 400, False: 512]
  ------------------
  640|    400|    memset(&t, 0, sizeof(t));
  641|    400|    if(a->cf && !a->cf->cft->query(a->cf, data, query, NULL, &t)) {
  ------------------
  |  Branch (641:8): [True: 0, False: 400]
  |  Branch (641:17): [True: 0, False: 0]
  ------------------
  642|      0|      if((t.tv_sec || t.tv_usec) && curlx_ptimediff_us(&t, &tmax) > 0)
  ------------------
  |  Branch (642:11): [True: 0, False: 0]
  |  Branch (642:23): [True: 0, False: 0]
  |  Branch (642:37): [True: 0, False: 0]
  ------------------
  643|      0|        tmax = t;
  644|      0|    }
  645|    400|  }
  646|    512|  return tmax;
  647|    512|}
cf-ip-happy.c:get_cf_create:
   93|  14.1k|{
   94|  14.1k|  size_t i;
   95|  22.9k|  for(i = 0; i < CURL_ARRAYSIZE(transport_providers); ++i) {
  ------------------
  |  | 1294|  22.9k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (95:14): [True: 22.9k, False: 0]
  ------------------
   96|  22.9k|    if((transport == transport_providers[i].transport) &&
  ------------------
  |  Branch (96:8): [True: 22.5k, False: 393]
  ------------------
   97|  22.5k|       (tunnel_proxy == transport_providers[i].tunnel_proxy))
  ------------------
  |  Branch (97:8): [True: 14.1k, False: 8.46k]
  ------------------
   98|  14.1k|      return transport_providers[i].cf_create;
   99|  22.9k|  }
  100|      0|  return NULL;
  101|  14.1k|}
cf-ip-happy.c:cf_ip_happy_create:
 1003|  14.1k|{
 1004|  14.1k|  struct cf_ip_happy_ctx *ctx = NULL;
 1005|  14.1k|  CURLcode result;
 1006|       |
 1007|  14.1k|  (void)data;
 1008|  14.1k|  (void)conn;
 1009|  14.1k|  *pcf = NULL;
 1010|  14.1k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1480|  14.1k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1011|  14.1k|  if(!ctx) {
  ------------------
  |  Branch (1011:6): [True: 0, False: 14.1k]
  ------------------
 1012|      0|    result = CURLE_OUT_OF_MEMORY;
 1013|      0|    goto out;
 1014|      0|  }
 1015|  14.1k|  ctx->transport_in = transport_in;
 1016|  14.1k|  ctx->transport_out = transport_out;
 1017|  14.1k|  ctx->cf_create = cf_create;
 1018|  14.1k|  Curl_peer_link(&ctx->peer, peer);
 1019|       |
 1020|  14.1k|  result = Curl_cf_create(pcf, &Curl_cft_ip_happy, ctx);
 1021|       |
 1022|  14.1k|out:
 1023|  14.1k|  if(result) {
  ------------------
  |  Branch (1023:6): [True: 0, False: 14.1k]
  ------------------
 1024|       |    curlx_safefree(*pcf);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1025|      0|    cf_ip_happy_ctx_destroy(ctx);
 1026|      0|  }
 1027|  14.1k|  return result;
 1028|  14.1k|}

Curl_socket_addr_from_ai:
  276|  14.0k|{
  277|       |  /*
  278|       |   * The Curl_sockaddr_ex structure is libcurl's external API
  279|       |   * curl_sockaddr structure with enough space available to directly hold
  280|       |   * any protocol-specific address structures. The variable declared here
  281|       |   * will be used to pass / receive data to/from the fopensocket callback
  282|       |   * if this has been set, before that, it is initialized from parameters.
  283|       |   */
  284|  14.0k|  addr->family = ai->ai_family;
  285|  14.0k|  addr->socktype = Curl_socktype_for_transport(transport);
  286|  14.0k|  addr->protocol = Curl_protocol_for_transport(transport);
  287|  14.0k|  addr->addrlen = (unsigned int)ai->ai_addrlen;
  288|       |
  289|  14.0k|  DEBUGASSERT(addr->addrlen <= sizeof(addr->curl_sa_addrbuf));
  ------------------
  |  | 1081|  14.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (289:3): [True: 0, False: 14.0k]
  |  Branch (289:3): [True: 14.0k, False: 0]
  ------------------
  290|  14.0k|  if(addr->addrlen > sizeof(addr->curl_sa_addrbuf))
  ------------------
  |  |   55|  14.0k|#define curl_sa_addrbuf addr.buf
  ------------------
  |  Branch (290:6): [True: 0, False: 14.0k]
  ------------------
  291|      0|    return CURLE_TOO_LARGE;
  292|       |
  293|  14.0k|  memcpy(&addr->curl_sa_addrbuf, ai->ai_addr, addr->addrlen);
  ------------------
  |  |   55|  14.0k|#define curl_sa_addrbuf addr.buf
  ------------------
  294|  14.0k|  return CURLE_OK;
  295|  14.0k|}
Curl_socket_open:
  440|      5|{
  441|      5|  struct Curl_sockaddr_ex dummy;
  442|      5|  CURLcode result;
  443|       |
  444|      5|  if(!addr)
  ------------------
  |  Branch (444:6): [True: 5, False: 0]
  ------------------
  445|       |    /* if the caller does not want info back, use a local temp copy */
  446|      5|    addr = &dummy;
  447|       |
  448|      5|  result = Curl_socket_addr_from_ai(addr, ai, transport);
  449|      5|  if(result)
  ------------------
  |  Branch (449:6): [True: 0, False: 5]
  ------------------
  450|      0|    return result;
  451|       |
  452|      5|  return socket_open(data, addr, sockfd);
  453|      5|}
Curl_socket_close:
  486|      5|{
  487|       |  return socket_close(data, conn, FALSE, sock);
  ------------------
  |  | 1058|      5|#define FALSE false
  ------------------
  488|      5|}
Curl_parse_interface:
  517|    191|{
  518|    191|  static const char if_prefix[] = "if!";
  519|    191|  static const char host_prefix[] = "host!";
  520|    191|  static const char if_host_prefix[] = "ifhost!";
  521|    191|  size_t len;
  522|       |
  523|    191|  DEBUGASSERT(dev);
  ------------------
  |  | 1081|    191|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (523:3): [True: 0, False: 191]
  |  Branch (523:3): [True: 191, False: 0]
  ------------------
  524|    191|  DEBUGASSERT(iface);
  ------------------
  |  | 1081|    191|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (524:3): [True: 0, False: 191]
  |  Branch (524:3): [True: 191, False: 0]
  ------------------
  525|    191|  DEBUGASSERT(host);
  ------------------
  |  | 1081|    191|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (525:3): [True: 0, False: 191]
  |  Branch (525:3): [True: 191, False: 0]
  ------------------
  526|       |
  527|    191|  len = strlen(input);
  528|    191|  if(len > 512)
  ------------------
  |  Branch (528:6): [True: 1, False: 190]
  ------------------
  529|      1|    return CURLE_BAD_FUNCTION_ARGUMENT;
  530|       |
  531|    190|  if(!strncmp(if_prefix, input, strlen(if_prefix))) {
  ------------------
  |  Branch (531:6): [True: 4, False: 186]
  ------------------
  532|      4|    input += strlen(if_prefix);
  533|      4|    if(!*input)
  ------------------
  |  Branch (533:8): [True: 1, False: 3]
  ------------------
  534|      1|      return CURLE_BAD_FUNCTION_ARGUMENT;
  535|      3|    *iface = curlx_memdup0(input, len - strlen(if_prefix));
  536|      3|    return *iface ? CURLE_OK : CURLE_OUT_OF_MEMORY;
  ------------------
  |  Branch (536:12): [True: 3, False: 0]
  ------------------
  537|      4|  }
  538|    186|  else if(!strncmp(host_prefix, input, strlen(host_prefix))) {
  ------------------
  |  Branch (538:11): [True: 8, False: 178]
  ------------------
  539|      8|    input += strlen(host_prefix);
  540|      8|    if(!*input)
  ------------------
  |  Branch (540:8): [True: 1, False: 7]
  ------------------
  541|      1|      return CURLE_BAD_FUNCTION_ARGUMENT;
  542|      7|    *host = curlx_memdup0(input, len - strlen(host_prefix));
  543|      7|    return *host ? CURLE_OK : CURLE_OUT_OF_MEMORY;
  ------------------
  |  Branch (543:12): [True: 7, False: 0]
  ------------------
  544|      8|  }
  545|    178|  else if(!strncmp(if_host_prefix, input, strlen(if_host_prefix))) {
  ------------------
  |  Branch (545:11): [True: 6, False: 172]
  ------------------
  546|      6|    const char *host_part;
  547|      6|    input += strlen(if_host_prefix);
  548|      6|    len -= strlen(if_host_prefix);
  549|      6|    host_part = memchr(input, '!', len);
  550|      6|    if(!host_part || !*(host_part + 1))
  ------------------
  |  Branch (550:8): [True: 1, False: 5]
  |  Branch (550:22): [True: 1, False: 4]
  ------------------
  551|      2|      return CURLE_BAD_FUNCTION_ARGUMENT;
  552|      4|    *iface = curlx_memdup0(input, host_part - input);
  553|      4|    if(!*iface)
  ------------------
  |  Branch (553:8): [True: 0, False: 4]
  ------------------
  554|      0|      return CURLE_OUT_OF_MEMORY;
  555|      4|    ++host_part;
  556|      4|    *host = curlx_memdup0(host_part, len - (host_part - input));
  557|      4|    if(!*host) {
  ------------------
  |  Branch (557:8): [True: 0, False: 4]
  ------------------
  558|      0|      curlx_safefree(*iface);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  559|      0|      return CURLE_OUT_OF_MEMORY;
  560|      0|    }
  561|      4|    return CURLE_OK;
  562|      4|  }
  563|       |
  564|    172|  if(!*input)
  ------------------
  |  Branch (564:6): [True: 2, False: 170]
  ------------------
  565|      2|    return CURLE_BAD_FUNCTION_ARGUMENT;
  566|    170|  *dev = curlx_memdup0(input, len);
  567|    170|  return *dev ? CURLE_OK : CURLE_OUT_OF_MEMORY;
  ------------------
  |  Branch (567:10): [True: 170, False: 0]
  ------------------
  568|    172|}
Curl_cf_tcp_create:
 1773|  13.9k|{
 1774|  13.9k|  struct cf_socket_ctx *ctx = NULL;
 1775|  13.9k|  struct Curl_cfilter *cf = NULL;
 1776|  13.9k|  CURLcode result;
 1777|       |
 1778|  13.9k|  (void)data;
 1779|  13.9k|  (void)conn;
 1780|  13.9k|  (void)transport_in;
 1781|  13.9k|  DEBUGASSERT(transport_out == TRNSPRT_TCP);
  ------------------
  |  | 1081|  13.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1781:3): [True: 0, False: 13.9k]
  |  Branch (1781:3): [True: 13.9k, False: 0]
  ------------------
 1782|  13.9k|  if(!addr) {
  ------------------
  |  Branch (1782:6): [True: 0, False: 13.9k]
  ------------------
 1783|      0|    result = CURLE_BAD_FUNCTION_ARGUMENT;
 1784|      0|    goto out;
 1785|      0|  }
 1786|       |
 1787|  13.9k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1480|  13.9k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1788|  13.9k|  if(!ctx) {
  ------------------
  |  Branch (1788:6): [True: 0, False: 13.9k]
  ------------------
 1789|      0|    result = CURLE_OUT_OF_MEMORY;
 1790|      0|    goto out;
 1791|      0|  }
 1792|       |
 1793|  13.9k|  result = cf_socket_ctx_init(ctx, addr, transport_out);
 1794|  13.9k|  if(result)
  ------------------
  |  Branch (1794:6): [True: 0, False: 13.9k]
  ------------------
 1795|      0|    goto out;
 1796|       |
 1797|  13.9k|  result = Curl_cf_create(&cf, &Curl_cft_tcp, ctx);
 1798|       |
 1799|  13.9k|out:
 1800|  13.9k|  *pcf = (!result) ? cf : NULL;
  ------------------
  |  Branch (1800:10): [True: 13.9k, False: 0]
  ------------------
 1801|  13.9k|  if(result) {
  ------------------
  |  Branch (1801:6): [True: 0, False: 13.9k]
  ------------------
 1802|      0|    curlx_safefree(cf);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1803|      0|    curlx_safefree(ctx);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1804|      0|  }
 1805|       |
 1806|  13.9k|  return result;
 1807|  13.9k|}
Curl_cf_unix_create:
 1997|    111|{
 1998|    111|  struct cf_socket_ctx *ctx = NULL;
 1999|    111|  struct Curl_cfilter *cf = NULL;
 2000|    111|  CURLcode result;
 2001|       |
 2002|    111|  (void)data;
 2003|    111|  (void)conn;
 2004|    111|  (void)transport_in;
 2005|    111|  DEBUGASSERT(transport_out == TRNSPRT_UNIX);
  ------------------
  |  | 1081|    111|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2005:3): [True: 0, False: 111]
  |  Branch (2005:3): [True: 111, False: 0]
  ------------------
 2006|    111|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1480|    111|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 2007|    111|  if(!ctx) {
  ------------------
  |  Branch (2007:6): [True: 0, False: 111]
  ------------------
 2008|      0|    result = CURLE_OUT_OF_MEMORY;
 2009|      0|    goto out;
 2010|      0|  }
 2011|       |
 2012|    111|  result = cf_socket_ctx_init(ctx, addr, transport_out);
 2013|    111|  if(result)
  ------------------
  |  Branch (2013:6): [True: 0, False: 111]
  ------------------
 2014|      0|    goto out;
 2015|       |
 2016|    111|  result = Curl_cf_create(&cf, &Curl_cft_unix, ctx);
 2017|       |
 2018|    111|out:
 2019|    111|  *pcf = (!result) ? cf : NULL;
  ------------------
  |  Branch (2019:10): [True: 111, False: 0]
  ------------------
 2020|    111|  if(result) {
  ------------------
  |  Branch (2020:6): [True: 0, False: 111]
  ------------------
 2021|      0|    curlx_safefree(cf);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2022|      0|    curlx_safefree(ctx);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2023|      0|  }
 2024|       |
 2025|    111|  return result;
 2026|    111|}
Curl_conn_is_tcp_listen:
 2266|   155k|{
 2267|   155k|  struct Curl_cfilter *cf = data->conn->cfilter[sockindex];
 2268|   559k|  while(cf) {
  ------------------
  |  Branch (2268:9): [True: 404k, False: 155k]
  ------------------
 2269|   404k|    if(cf->cft == &Curl_cft_tcp_accept)
  ------------------
  |  Branch (2269:8): [True: 0, False: 404k]
  ------------------
 2270|      0|      return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2271|   404k|    cf = cf->next;
 2272|   404k|  }
 2273|   155k|  return FALSE;
  ------------------
  |  | 1058|   155k|#define FALSE false
  ------------------
 2274|   155k|}
cf-socket.c:socket_open:
  352|  14.0k|{
  353|  14.0k|  char errbuf[STRERROR_LEN];
  354|       |
  355|  14.0k|#ifdef SOCK_CLOEXEC
  356|  14.0k|  addr->socktype |= SOCK_CLOEXEC;
  357|  14.0k|#endif
  358|       |
  359|  14.0k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  14.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (359:3): [True: 0, False: 14.0k]
  |  Branch (359:3): [True: 14.0k, False: 0]
  ------------------
  360|  14.0k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|  14.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (360:3): [True: 0, False: 14.0k]
  |  Branch (360:3): [True: 14.0k, False: 0]
  ------------------
  361|  14.0k|  if(data->set.fopensocket) {
  ------------------
  |  Branch (361:6): [True: 14.0k, False: 60]
  ------------------
  362|       |    /*
  363|       |     * If the opensocket callback is set, all the destination address
  364|       |     * information is passed to the callback. Depending on this information the
  365|       |     * callback may opt to abort the connection, this is indicated returning
  366|       |     * CURL_SOCKET_BAD; otherwise it will return a not-connected socket. When
  367|       |     * the callback returns a valid socket the destination address information
  368|       |     * might have been changed and this 'new' address will actually be used
  369|       |     * here to connect.
  370|       |     */
  371|  14.0k|    Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|  14.0k|#define TRUE true
  ------------------
  372|  14.0k|    *sockfd = data->set.fopensocket(data->set.opensocket_client,
  373|  14.0k|                                    CURLSOCKTYPE_IPCXN,
  374|  14.0k|                                    (struct curl_sockaddr *)addr);
  375|  14.0k|    Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|  14.0k|#define FALSE false
  ------------------
  376|  14.0k|  }
  377|     60|  else {
  378|       |    /* opensocket callback not set, so create the socket now */
  379|     60|#ifdef DEBUGBUILD
  380|     60|    if((addr->family == AF_INET6) && getenv("CURL_DBG_SOCK_FAIL_IPV6")) {
  ------------------
  |  Branch (380:8): [True: 18, False: 42]
  |  Branch (380:38): [True: 0, False: 18]
  ------------------
  381|      0|      failf(data, "CURL_DBG_SOCK_FAIL_IPV6: failed to open socket");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  382|      0|      return CURLE_COULDNT_CONNECT;
  383|      0|    }
  384|     60|#endif
  385|     60|    *sockfd = CURL_SOCKET(addr->family, addr->socktype, addr->protocol);
  ------------------
  |  | 1436|     60|  curl_dbg_socket((int)(domain), type, protocol, __LINE__, __FILE__)
  ------------------
  386|     60|    if((*sockfd == CURL_SOCKET_BAD) && (SOCKERRNO == SOCKENOMEM))
  ------------------
  |  |  145|     60|#define CURL_SOCKET_BAD (-1)
  ------------------
                  if((*sockfd == CURL_SOCKET_BAD) && (SOCKERRNO == SOCKENOMEM))
  ------------------
  |  | 1095|      0|#define SOCKERRNO         errno
  ------------------
                  if((*sockfd == CURL_SOCKET_BAD) && (SOCKERRNO == SOCKENOMEM))
  ------------------
  |  | 1133|      0|#define SOCKENOMEM        ENOMEM
  ------------------
  |  Branch (386:8): [True: 0, False: 60]
  |  Branch (386:40): [True: 0, False: 0]
  ------------------
  387|      0|      return CURLE_OUT_OF_MEMORY;
  388|     60|  }
  389|       |
  390|  14.0k|  if(*sockfd == CURL_SOCKET_BAD) {
  ------------------
  |  |  145|  14.0k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (390:6): [True: 75, False: 13.9k]
  ------------------
  391|       |    /* no socket, no connection */
  392|     75|    failf(data, "failed to open socket: %s",
  ------------------
  |  |   62|     75|#define failf Curl_failf
  ------------------
  393|     75|          curlx_strerror(SOCKERRNO, errbuf, sizeof(errbuf)));
  ------------------
  |  | 1095|     75|#define SOCKERRNO         errno
  ------------------
  394|     75|    return CURLE_COULDNT_CONNECT;
  395|     75|  }
  396|       |
  397|       |#ifdef USE_SO_NOSIGPIPE
  398|       |  if(Curl_sock_nosigpipe(*sockfd) < 0) {
  399|       |    failf(data, "setsockopt enable SO_NOSIGPIPE: %s",
  400|       |          curlx_strerror(SOCKERRNO, errbuf, sizeof(errbuf)));
  401|       |    sclose(*sockfd);
  402|       |    *sockfd = CURL_SOCKET_BAD;
  403|       |    return CURLE_COULDNT_CONNECT;
  404|       |  }
  405|       |#endif /* USE_SO_NOSIGPIPE */
  406|       |
  407|       |#if defined(HAVE_FCNTL) && !defined(SOCK_CLOEXEC)
  408|       |  if(fcntl(*sockfd, F_SETFD, FD_CLOEXEC) < 0) {
  409|       |    failf(data, "fcntl set CLOEXEC: %s",
  410|       |          curlx_strerror(SOCKERRNO, errbuf, sizeof(errbuf)));
  411|       |    sclose(*sockfd);
  412|       |    *sockfd = CURL_SOCKET_BAD;
  413|       |    return CURLE_COULDNT_CONNECT;
  414|       |  }
  415|       |#endif
  416|       |
  417|  13.9k|#if defined(USE_IPV6) && defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID)
  418|  13.9k|  if(addr->family == AF_INET6) {
  ------------------
  |  Branch (418:6): [True: 94, False: 13.8k]
  ------------------
  419|     94|    struct sockaddr_in6 * const sa6 = (void *)&addr->curl_sa_addr;
  ------------------
  |  |   54|     94|#define curl_sa_addr    addr.sa
  ------------------
  420|     94|    sa6->sin6_scope_id = get_scope_id(data, sa6);
  421|     94|  }
  422|  13.9k|#endif
  423|  13.9k|  return CURLE_OK;
  424|  14.0k|}
cf-socket.c:get_scope_id:
  309|     94|{
  310|     94|  uint32_t scope_id = 0;
  311|     94|  if(data->conn->scope_id)
  ------------------
  |  Branch (311:6): [True: 5, False: 89]
  ------------------
  312|      5|    return data->conn->scope_id;
  313|       |  /* NOLINTNEXTLINE(clang-analyzer-core.uninitialized.Assign) */
  314|     89|  scope_id = sa6->sin6_scope_id;
  315|     89|  if(!scope_id && IN6_IS_ADDR_LINKLOCAL(&sa6->sin6_addr)) {
  ------------------
  |  Branch (315:6): [True: 89, False: 0]
  |  Branch (315:19): [True: 0, False: 89]
  ------------------
  316|       |    /* The resolver did not set scope_id for this link-local address.
  317|       |     * Try to determine it from the system's network interfaces.
  318|       |     * Without a scope_id, connect() to a link-local address fails
  319|       |     * with EINVAL on Linux.
  320|       |     * NOTE: On multi-homed hosts with several interfaces having
  321|       |     * link-local addresses, this picks the first one found, which
  322|       |     * may not be the correct outgoing interface. */
  323|      0|#if defined(HAVE_GETIFADDRS) && defined(HAVE_NET_IF_H)
  324|      0|    struct ifaddrs *ifa, *ifa_list;
  325|      0|    if(getifaddrs(&ifa_list) == 0) {
  ------------------
  |  Branch (325:8): [True: 0, False: 0]
  ------------------
  326|      0|      for(ifa = ifa_list; ifa; ifa = ifa->ifa_next) {
  ------------------
  |  Branch (326:27): [True: 0, False: 0]
  ------------------
  327|      0|        if(ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_INET6 &&
  ------------------
  |  Branch (327:12): [True: 0, False: 0]
  |  Branch (327:29): [True: 0, False: 0]
  ------------------
  328|      0|           (ifa->ifa_flags & IFF_UP) &&
  ------------------
  |  Branch (328:12): [True: 0, False: 0]
  ------------------
  329|      0|           !(ifa->ifa_flags & IFF_LOOPBACK)) {
  ------------------
  |  Branch (329:12): [True: 0, False: 0]
  ------------------
  330|      0|          struct sockaddr_in6 *s6 = (void *)ifa->ifa_addr;
  331|      0|          if(IN6_IS_ADDR_LINKLOCAL(&s6->sin6_addr) && s6->sin6_scope_id) {
  ------------------
  |  Branch (331:14): [True: 0, False: 0]
  |  Branch (331:55): [True: 0, False: 0]
  ------------------
  332|      0|            scope_id = s6->sin6_scope_id;
  333|      0|            infof(data,
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  334|      0|                  "determined scope_id=%lu for link-local address "
  335|      0|                  "from local interface",
  336|      0|                  (unsigned long)scope_id);
  337|      0|            break;
  338|      0|          }
  339|      0|        }
  340|      0|      }
  341|      0|      freeifaddrs(ifa_list);
  342|      0|    }
  343|      0|#endif /* HAVE_GETIFADDRS && HAVE_NET_IF_H */
  344|      0|  }
  345|     89|  return scope_id;
  346|     94|}
cf-socket.c:socket_close:
  457|  13.9k|{
  458|  13.9k|  if(sock == CURL_SOCKET_BAD)
  ------------------
  |  |  145|  13.9k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (458:6): [True: 0, False: 13.9k]
  ------------------
  459|      0|    return 0;
  460|       |
  461|  13.9k|  if(use_callback && conn && conn->fclosesocket) {
  ------------------
  |  Branch (461:6): [True: 13.9k, False: 5]
  |  Branch (461:22): [True: 13.9k, False: 0]
  |  Branch (461:30): [True: 0, False: 13.9k]
  ------------------
  462|      0|    int rc;
  463|      0|    Curl_multi_will_close(data, sock);
  464|      0|    Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  465|      0|    rc = conn->fclosesocket(conn->closesocket_client, sock);
  466|      0|    Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  467|      0|    return rc;
  468|      0|  }
  469|       |
  470|  13.9k|  if(conn)
  ------------------
  |  Branch (470:6): [True: 13.9k, False: 0]
  ------------------
  471|       |    /* tell the multi-socket code about this */
  472|  13.9k|    Curl_multi_will_close(data, sock);
  473|       |
  474|  13.9k|  sclose(sock);
  ------------------
  |  | 1428|  13.9k|#define sclose(sockfd) curl_dbg_sclose(sockfd, __LINE__, __FILE__)
  ------------------
  475|       |
  476|  13.9k|  return 0;
  477|  13.9k|}
cf-socket.c:cf_socket_destroy:
 1016|  14.0k|{
 1017|  14.0k|  struct cf_socket_ctx *ctx = cf->ctx;
 1018|       |
 1019|  14.0k|  cf_socket_close(cf, data);
 1020|  14.0k|  CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|  14.0k|  do {                                          \
  |  |  154|  14.0k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  14.0k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  28.1k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 14.0k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 14.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  28.1k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  14.0k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  14.0k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  14.0k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 14.0k]
  |  |  ------------------
  ------------------
 1021|  14.0k|  curlx_free(ctx);
  ------------------
  |  | 1483|  14.0k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1022|       |  cf->ctx = NULL;
 1023|  14.0k|}
cf-socket.c:cf_tcp_connect:
 1304|  14.0k|{
 1305|  14.0k|  struct cf_socket_ctx *ctx = cf->ctx;
 1306|  14.0k|  CURLcode result = CURLE_COULDNT_CONNECT;
 1307|  14.0k|  int rc = 0;
 1308|       |
 1309|  14.0k|  if(cf->connected) {
  ------------------
  |  Branch (1309:6): [True: 0, False: 14.0k]
  ------------------
 1310|      0|    *done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1311|      0|    return CURLE_OK;
 1312|      0|  }
 1313|       |
 1314|  14.0k|  *done = FALSE; /* a negative world view is best */
  ------------------
  |  | 1058|  14.0k|#define FALSE false
  ------------------
 1315|  14.0k|  if(ctx->sock == CURL_SOCKET_BAD) {
  ------------------
  |  |  145|  14.0k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1315:6): [True: 14.0k, False: 40]
  ------------------
 1316|  14.0k|    int error;
 1317|       |
 1318|  14.0k|    result = cf_socket_open(cf, data);
 1319|  14.0k|    if(result)
  ------------------
  |  Branch (1319:8): [True: 165, False: 13.8k]
  ------------------
 1320|    165|      goto out;
 1321|       |
 1322|  13.8k|    if(cf->connected) {
  ------------------
  |  Branch (1322:8): [True: 13.8k, False: 60]
  ------------------
 1323|  13.8k|      *done = TRUE;
  ------------------
  |  | 1055|  13.8k|#define TRUE true
  ------------------
 1324|  13.8k|      return CURLE_OK;
 1325|  13.8k|    }
 1326|       |
 1327|       |    /* Connect TCP socket */
 1328|     60|    rc = do_connect(cf, data, (bool)cf->conn->bits.tcp_fastopen);
 1329|     60|    error = SOCKERRNO;
  ------------------
  |  | 1095|     60|#define SOCKERRNO         errno
  ------------------
 1330|     60|    set_local_ip(cf, data);
 1331|     60|    CURL_TRC_CF(data, cf, "local address %s port %d...",
  ------------------
  |  |  153|     60|  do {                                          \
  |  |  154|     60|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     60|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    120|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 60, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 60]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    120|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     60|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     60|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     60|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 60]
  |  |  ------------------
  ------------------
 1332|     60|                ctx->ip.local_ip, ctx->ip.local_port);
 1333|     60|    if(rc == -1) {
  ------------------
  |  Branch (1333:8): [True: 60, False: 0]
  ------------------
 1334|     60|      result = socket_connect_result(data, ctx->ip.remote_ip, error);
 1335|     60|      goto out;
 1336|     60|    }
 1337|     60|  }
 1338|       |
 1339|       |#ifdef mpeix
 1340|       |  /* Call this function once now, and ignore the results. We do this to
 1341|       |     "clear" the error state on the socket so that we can later read it
 1342|       |     reliably. This is reported necessary on the MPE/iX operating
 1343|       |     system. */
 1344|       |  (void)verifyconnect(ctx->sock, NULL);
 1345|       |#endif
 1346|       |  /* check socket for connect */
 1347|     40|  rc = SOCKET_WRITABLE(ctx->sock, 0);
  ------------------
  |  |   79|     40|  Curl_socket_check(CURL_SOCKET_BAD, CURL_SOCKET_BAD, x, z)
  |  |  ------------------
  |  |  |  |  145|     40|#define CURL_SOCKET_BAD (-1)
  |  |  ------------------
  |  |                 Curl_socket_check(CURL_SOCKET_BAD, CURL_SOCKET_BAD, x, z)
  |  |  ------------------
  |  |  |  |  145|     40|#define CURL_SOCKET_BAD (-1)
  |  |  ------------------
  ------------------
 1348|       |
 1349|     40|  if(rc == 0) { /* no connection yet */
  ------------------
  |  Branch (1349:6): [True: 25, False: 15]
  ------------------
 1350|     25|    CURL_TRC_CF(data, cf, "not connected yet on fd=%" FMT_SOCKET_T, ctx->sock);
  ------------------
  |  |  153|     25|  do {                                          \
  |  |  154|     25|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     25|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     50|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 25, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 25]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     50|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     25|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     25|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     25|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 25]
  |  |  ------------------
  ------------------
 1351|     25|    return CURLE_OK;
 1352|     25|  }
 1353|     15|  else if(rc == CURL_CSELECT_OUT || cf->conn->bits.tcp_fastopen) {
  ------------------
  |  |  291|     30|#define CURL_CSELECT_OUT  0x02
  ------------------
  |  Branch (1353:11): [True: 0, False: 15]
  |  Branch (1353:37): [True: 0, False: 15]
  ------------------
 1354|      0|    if(verifyconnect(ctx->sock, &ctx->error)) {
  ------------------
  |  Branch (1354:8): [True: 0, False: 0]
  ------------------
 1355|       |      /* we are connected with TCP, awesome! */
 1356|      0|      ctx->connected_at = *Curl_pgrs_now(data);
 1357|      0|      set_local_ip(cf, data);
 1358|      0|      *done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1359|      0|      cf->connected = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1360|      0|      CURL_TRC_CF(data, cf, "connected on fd=%" FMT_SOCKET_T, ctx->sock);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1361|      0|      return CURLE_OK;
 1362|      0|    }
 1363|      0|  }
 1364|     15|  else if(rc & CURL_CSELECT_ERR) {
  ------------------
  |  |  292|     15|#define CURL_CSELECT_ERR  0x04
  ------------------
  |  Branch (1364:11): [True: 15, False: 0]
  ------------------
 1365|     15|    CURL_TRC_CF(data, cf, "poll/select error on fd=%" FMT_SOCKET_T, ctx->sock);
  ------------------
  |  |  153|     15|  do {                                          \
  |  |  154|     15|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     15|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     30|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 15, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 15]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     30|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     15|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     15|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     15|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 15]
  |  |  ------------------
  ------------------
 1366|     15|    (void)verifyconnect(ctx->sock, &ctx->error);
 1367|     15|    result = CURLE_COULDNT_CONNECT;
 1368|     15|  }
 1369|       |
 1370|    240|out:
 1371|    240|  if(result) {
  ------------------
  |  Branch (1371:6): [True: 200, False: 40]
  ------------------
 1372|    200|    VERBOSE(char buffer[STRERROR_LEN]);
  ------------------
  |  | 1618|    200|#define VERBOSE(x) x
  ------------------
 1373|    200|    set_local_ip(cf, data);
 1374|    200|    if(ctx->error) {
  ------------------
  |  Branch (1374:8): [True: 15, False: 185]
  ------------------
 1375|     15|      data->state.os_errno = ctx->error;
 1376|     15|      SET_SOCKERRNO(ctx->error);
  ------------------
  |  | 1096|     15|#define SET_SOCKERRNO(x)  (errno = (x))
  ------------------
 1377|     15|      VERBOSE(curlx_strerror(ctx->error, buffer, sizeof(buffer)));
  ------------------
  |  | 1618|     15|#define VERBOSE(x) x
  ------------------
 1378|     15|    }
 1379|    185|    else {
 1380|    185|      VERBOSE(curlx_strcopy(buffer, sizeof(buffer), STRCONST("peer closed")));
  ------------------
  |  | 1618|    185|#define VERBOSE(x) x
  ------------------
 1381|    185|    }
 1382|    200|    if(ctx->sock != CURL_SOCKET_BAD) {
  ------------------
  |  |  145|    200|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1382:8): [True: 35, False: 165]
  ------------------
 1383|     35|      socket_close(data, cf->conn, TRUE, ctx->sock);
  ------------------
  |  | 1055|     35|#define TRUE true
  ------------------
 1384|     35|      ctx->sock = CURL_SOCKET_BAD;
  ------------------
  |  |  145|     35|#define CURL_SOCKET_BAD (-1)
  ------------------
 1385|     35|    }
 1386|    200|    infof(data, "connect to %s port %u from %s port %d failed: %s",
  ------------------
  |  |  143|    200|  do {                               \
  |  |  144|    200|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    200|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 200, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 200]
  |  |  |  |  ------------------
  |  |  |  |  320|    200|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    200|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    200|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 200]
  |  |  ------------------
  ------------------
 1387|    200|          ctx->ip.remote_ip, ctx->ip.remote_port,
 1388|    200|          ctx->ip.local_ip, ctx->ip.local_port,
 1389|    200|          curlx_strerror(ctx->error, buffer, sizeof(buffer)));
 1390|       |    *done = FALSE;
  ------------------
  |  | 1058|    200|#define FALSE false
  ------------------
 1391|    200|  }
 1392|    240|  return result;
 1393|     40|}
cf-socket.c:cf_socket_open:
 1093|  14.0k|{
 1094|  14.0k|  struct cf_socket_ctx *ctx = cf->ctx;
 1095|  14.0k|  int error = 0;
 1096|  14.0k|  bool isconnected = FALSE;
  ------------------
  |  | 1058|  14.0k|#define FALSE false
  ------------------
 1097|  14.0k|  CURLcode result = CURLE_COULDNT_CONNECT;
 1098|  14.0k|  bool is_tcp;
 1099|       |
 1100|  14.0k|  DEBUGASSERT(ctx->sock == CURL_SOCKET_BAD);
  ------------------
  |  | 1081|  14.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1100:3): [True: 0, False: 14.0k]
  |  Branch (1100:3): [True: 14.0k, False: 0]
  ------------------
 1101|  14.0k|  ctx->started_at = *Curl_pgrs_now(data);
 1102|  14.0k|#ifdef SOCK_NONBLOCK
 1103|       |  /* Do not tuck SOCK_NONBLOCK into socktype when opensocket callback is set
 1104|       |   * because we would not know how socketype is about to be used in the
 1105|       |   * callback, SOCK_NONBLOCK might get factored out before calling socket().
 1106|       |   */
 1107|  14.0k|  if(!data->set.fopensocket)
  ------------------
  |  Branch (1107:6): [True: 60, False: 13.9k]
  ------------------
 1108|     60|    ctx->addr.socktype |= SOCK_NONBLOCK;
 1109|  14.0k|#endif
 1110|  14.0k|  result = socket_open(data, &ctx->addr, &ctx->sock);
 1111|  14.0k|#ifdef SOCK_NONBLOCK
 1112|       |  /* Restore the socktype after the socket is created. */
 1113|  14.0k|  if(!data->set.fopensocket)
  ------------------
  |  Branch (1113:6): [True: 60, False: 13.9k]
  ------------------
 1114|     60|    ctx->addr.socktype &= ~SOCK_NONBLOCK;
 1115|  14.0k|#endif
 1116|  14.0k|  if(result)
  ------------------
  |  Branch (1116:6): [True: 75, False: 13.9k]
  ------------------
 1117|     75|    goto out;
 1118|       |
 1119|  13.9k|  result = set_remote_ip(cf, data);
 1120|  13.9k|  if(result)
  ------------------
  |  Branch (1120:6): [True: 0, False: 13.9k]
  ------------------
 1121|      0|    goto out;
 1122|       |
 1123|  13.9k|#ifdef USE_IPV6
 1124|  13.9k|  if(ctx->addr.family == AF_INET6) {
  ------------------
  |  Branch (1124:6): [True: 93, False: 13.8k]
  ------------------
 1125|       |#ifdef USE_WINSOCK
 1126|       |    /* Turn on support for IPv4-mapped IPv6 addresses.
 1127|       |     * Linux kernel, NetBSD, FreeBSD, Darwin, lwIP: default is off;
 1128|       |     * Windows Vista and later: default is on;
 1129|       |     * DragonFly BSD: acts like off, and dummy setting;
 1130|       |     * OpenBSD and earlier Windows: unsupported.
 1131|       |     * Linux: controlled by /proc/sys/net/ipv6/bindv6only.
 1132|       |     */
 1133|       |    int on = 0;
 1134|       |    (void)setsockopt(ctx->sock, IPPROTO_IPV6, IPV6_V6ONLY,
 1135|       |                     (void *)&on, sizeof(on));
 1136|       |#endif
 1137|     93|#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
 1138|     93|    {
 1139|     93|      struct sockaddr_in6 *sa6 = (void *)&ctx->addr.curl_sa_addr;
  ------------------
  |  |   54|     93|#define curl_sa_addr    addr.sa
  ------------------
 1140|     93|      if(sa6->sin6_scope_id)
  ------------------
  |  Branch (1140:10): [True: 5, False: 88]
  ------------------
 1141|      5|        infof(data, "  Trying [%s]:%d scope_id=%lu...",
  ------------------
  |  |  143|      5|  do {                               \
  |  |  144|      5|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      5|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 5, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 5]
  |  |  |  |  ------------------
  |  |  |  |  320|      5|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      5|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      5|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 5]
  |  |  ------------------
  ------------------
 1142|     93|              ctx->ip.remote_ip, ctx->ip.remote_port,
 1143|     93|              (unsigned long)sa6->sin6_scope_id);
 1144|     88|      else
 1145|     88|#endif
 1146|     88|        infof(data, "  Trying [%s]:%d...",
  ------------------
  |  |  143|     88|  do {                               \
  |  |  144|     88|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     88|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 88, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 88]
  |  |  |  |  ------------------
  |  |  |  |  320|     88|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     88|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     88|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 88]
  |  |  ------------------
  ------------------
 1147|     93|              ctx->ip.remote_ip, ctx->ip.remote_port);
 1148|     93|#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
 1149|     93|    }
 1150|     93|#endif
 1151|     93|  }
 1152|  13.8k|  else
 1153|  13.8k|#endif
 1154|  13.8k|    infof(data, "  Trying %s:%d...", ctx->ip.remote_ip, ctx->ip.remote_port);
  ------------------
  |  |  143|  13.8k|  do {                               \
  |  |  144|  13.8k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  13.8k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 13.8k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 13.8k]
  |  |  |  |  ------------------
  |  |  |  |  320|  13.8k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  13.8k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  13.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 13.8k]
  |  |  ------------------
  ------------------
 1155|       |
 1156|  13.9k|#ifdef USE_IPV6
 1157|  13.9k|  is_tcp = (ctx->addr.family == AF_INET ||
  ------------------
  |  Branch (1157:13): [True: 13.7k, False: 201]
  ------------------
 1158|    201|            ctx->addr.family == AF_INET6) &&
  ------------------
  |  Branch (1158:13): [True: 93, False: 108]
  ------------------
 1159|  13.8k|    cf_socktype(ctx->addr.socktype) == SOCK_STREAM;
  ------------------
  |  Branch (1159:5): [True: 13.8k, False: 0]
  ------------------
 1160|       |#else
 1161|       |  is_tcp = (ctx->addr.family == AF_INET) &&
 1162|       |    cf_socktype(ctx->addr.socktype) == SOCK_STREAM;
 1163|       |#endif
 1164|  13.9k|  if(is_tcp && data->set.tcp_nodelay)
  ------------------
  |  Branch (1164:6): [True: 13.8k, False: 108]
  |  Branch (1164:16): [True: 13.8k, False: 3]
  ------------------
 1165|  13.8k|    tcpnodelay(cf, data, ctx->sock);
 1166|       |
 1167|  13.9k|  if(is_tcp && data->set.tcp_keepalive)
  ------------------
  |  Branch (1167:6): [True: 13.8k, False: 108]
  |  Branch (1167:16): [True: 33, False: 13.8k]
  ------------------
 1168|     33|    tcpkeepalive(cf, data, ctx->sock);
 1169|       |
 1170|  13.9k|  if(data->set.fsockopt) {
  ------------------
  |  Branch (1170:6): [True: 13.9k, False: 60]
  ------------------
 1171|       |    /* activate callback for setting socket options */
 1172|  13.9k|    Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|  13.9k|#define TRUE true
  ------------------
 1173|  13.9k|    error = data->set.fsockopt(data->set.sockopt_client,
 1174|  13.9k|                               ctx->sock,
 1175|  13.9k|                               CURLSOCKTYPE_IPCXN);
 1176|  13.9k|    Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|  13.9k|#define FALSE false
  ------------------
 1177|       |
 1178|  13.9k|    if(error == CURL_SOCKOPT_ALREADY_CONNECTED)
  ------------------
  |  |  421|  13.9k|#define CURL_SOCKOPT_ALREADY_CONNECTED 2
  ------------------
  |  Branch (1178:8): [True: 13.9k, False: 0]
  ------------------
 1179|  13.9k|      isconnected = TRUE;
  ------------------
  |  | 1055|  13.9k|#define TRUE true
  ------------------
 1180|      0|    else if(error) {
  ------------------
  |  Branch (1180:13): [True: 0, False: 0]
  ------------------
 1181|      0|      result = CURLE_ABORTED_BY_CALLBACK;
 1182|      0|      goto out;
 1183|      0|    }
 1184|  13.9k|  }
 1185|       |
 1186|  13.9k|#ifndef CURL_DISABLE_BINDLOCAL
 1187|       |  /* possibly bind the local end to an IP, interface or port */
 1188|  13.9k|  if(ctx->addr.family == AF_INET
  ------------------
  |  Branch (1188:6): [True: 13.7k, False: 201]
  ------------------
 1189|    201|#ifdef USE_IPV6
 1190|    201|     || ctx->addr.family == AF_INET6
  ------------------
  |  Branch (1190:9): [True: 93, False: 108]
  ------------------
 1191|  13.9k|#endif
 1192|  13.9k|    ) {
 1193|  13.8k|    result = bindlocal(data, cf->conn, ctx->sock, ctx->addr.family,
 1194|  13.8k|                       Curl_ipv6_scope(&ctx->addr.curl_sa_addr),
  ------------------
  |  |   54|  13.8k|#define curl_sa_addr    addr.sa
  ------------------
 1195|  13.8k|                       ctx->transport);
 1196|  13.8k|    if(result) {
  ------------------
  |  Branch (1196:8): [True: 90, False: 13.7k]
  ------------------
 1197|     90|      if(result == CURLE_UNSUPPORTED_PROTOCOL) {
  ------------------
  |  Branch (1197:10): [True: 2, False: 88]
  ------------------
 1198|       |        /* The address family is not supported on this interface.
 1199|       |           We can continue trying addresses */
 1200|      2|        result = CURLE_COULDNT_CONNECT;
 1201|      2|      }
 1202|     90|      goto out;
 1203|     90|    }
 1204|  13.8k|  }
 1205|  13.8k|#endif
 1206|       |
 1207|       |#ifndef SOCK_NONBLOCK
 1208|       |  /* Set socket non-blocking, must be a non-blocking socket for
 1209|       |   * a non-blocking connect. */
 1210|       |  error = curlx_nonblock(ctx->sock, TRUE);
 1211|       |  if(error < 0) {
 1212|       |    result = CURLE_UNSUPPORTED_PROTOCOL;
 1213|       |    ctx->error = SOCKERRNO;
 1214|       |    goto out;
 1215|       |  }
 1216|       |#else
 1217|  13.8k|  if(data->set.fopensocket) {
  ------------------
  |  Branch (1217:6): [True: 13.8k, False: 60]
  ------------------
 1218|       |    /* Set socket non-blocking, must be a non-blocking socket for
 1219|       |     * a non-blocking connect. */
 1220|  13.8k|    error = curlx_nonblock(ctx->sock, TRUE);
  ------------------
  |  | 1055|  13.8k|#define TRUE true
  ------------------
 1221|  13.8k|    if(error < 0) {
  ------------------
  |  Branch (1221:8): [True: 0, False: 13.8k]
  ------------------
 1222|      0|      result = CURLE_UNSUPPORTED_PROTOCOL;
 1223|      0|      ctx->error = SOCKERRNO;
  ------------------
  |  | 1095|      0|#define SOCKERRNO         errno
  ------------------
 1224|      0|      goto out;
 1225|      0|    }
 1226|  13.8k|  }
 1227|  13.8k|#endif
 1228|  13.8k|  ctx->sock_connected = (cf_socktype(ctx->addr.socktype) != SOCK_DGRAM);
 1229|  14.0k|out:
 1230|  14.0k|  if(result) {
  ------------------
  |  Branch (1230:6): [True: 165, False: 13.8k]
  ------------------
 1231|    165|    if(ctx->sock != CURL_SOCKET_BAD) {
  ------------------
  |  |  145|    165|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1231:8): [True: 90, False: 75]
  ------------------
 1232|     90|      socket_close(data, cf->conn, TRUE, ctx->sock);
  ------------------
  |  | 1055|     90|#define TRUE true
  ------------------
 1233|     90|      ctx->sock = CURL_SOCKET_BAD;
  ------------------
  |  |  145|     90|#define CURL_SOCKET_BAD (-1)
  ------------------
 1234|     90|    }
 1235|    165|  }
 1236|  13.8k|  else if(isconnected) {
  ------------------
  |  Branch (1236:11): [True: 13.8k, False: 60]
  ------------------
 1237|  13.8k|    set_local_ip(cf, data);
 1238|  13.8k|    ctx->connected_at = *Curl_pgrs_now(data);
 1239|  13.8k|    cf->connected = TRUE;
  ------------------
  |  | 1055|  13.8k|#define TRUE true
  ------------------
 1240|  13.8k|  }
 1241|  14.0k|  CURL_TRC_CF(data, cf, "cf_socket_open() -> %d, fd=%" FMT_SOCKET_T,
  ------------------
  |  |  153|  14.0k|  do {                                          \
  |  |  154|  14.0k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  14.0k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  28.1k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 14.0k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 14.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  28.1k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  14.0k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  14.0k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  14.0k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 14.0k]
  |  |  ------------------
  ------------------
 1242|  14.0k|              result, ctx->sock);
 1243|  14.0k|  return result;
 1244|  13.8k|}
cf-socket.c:set_remote_ip:
 1059|  13.9k|{
 1060|  13.9k|  struct cf_socket_ctx *ctx = cf->ctx;
 1061|       |
 1062|       |  /* store remote address and port used in this connection attempt */
 1063|  13.9k|  ctx->ip.transport = ctx->transport;
 1064|  13.9k|  if(!Curl_addr2string(&ctx->addr.curl_sa_addr,
  ------------------
  |  |   54|  13.9k|#define curl_sa_addr    addr.sa
  ------------------
  |  Branch (1064:6): [True: 0, False: 13.9k]
  ------------------
 1065|  13.9k|                       (curl_socklen_t)ctx->addr.addrlen,
 1066|  13.9k|                       ctx->ip.remote_ip, &ctx->ip.remote_port)) {
 1067|      0|    char buffer[STRERROR_LEN];
 1068|       |
 1069|      0|    ctx->error = errno;
 1070|       |    /* malformed address or bug in inet_ntop, try next address */
 1071|      0|    failf(data, "curl_sa_addr inet_ntop() failed with errno %d: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1072|      0|          errno, curlx_strerror(errno, buffer, sizeof(buffer)));
 1073|      0|    return CURLE_FAILED_INIT;
 1074|      0|  }
 1075|  13.9k|  return CURLE_OK;
 1076|  13.9k|}
cf-socket.c:cf_socktype:
 1081|  27.7k|{
 1082|  27.7k|#ifdef SOCK_CLOEXEC
 1083|  27.7k|  x &= ~SOCK_CLOEXEC;
 1084|  27.7k|#endif
 1085|  27.7k|#ifdef SOCK_NONBLOCK
 1086|       |  x &= ~SOCK_NONBLOCK;
 1087|  27.7k|#endif
 1088|  27.7k|  return x;
 1089|  27.7k|}
cf-socket.c:tcpnodelay:
   84|  13.8k|{
   85|  13.8k|#if defined(TCP_NODELAY) && defined(CURL_TCP_NODELAY_SUPPORTED)
   86|  13.8k|  curl_socklen_t onoff = (curl_socklen_t)1;
   87|  13.8k|  int level = IPPROTO_TCP;
   88|  13.8k|  VERBOSE(char buffer[STRERROR_LEN]);
  ------------------
  |  | 1618|  13.8k|#define VERBOSE(x) x
  ------------------
   89|       |
   90|  13.8k|  if(setsockopt(sockfd, level, TCP_NODELAY, (void *)&onoff, sizeof(onoff)) < 0)
  ------------------
  |  Branch (90:6): [True: 13.8k, False: 60]
  ------------------
   91|  13.8k|    CURL_TRC_CF(data, cf, "Could not set TCP_NODELAY: %s",
  ------------------
  |  |  153|  13.8k|  do {                                          \
  |  |  154|  13.8k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  13.8k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  27.6k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 13.8k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 13.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  27.6k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  13.8k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  13.8k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  13.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 13.8k]
  |  |  ------------------
  ------------------
   92|  13.8k|                curlx_strerror(SOCKERRNO, buffer, sizeof(buffer)));
   93|       |#else
   94|       |  (void)cf;
   95|       |  (void)data;
   96|       |  (void)sockfd;
   97|       |#endif
   98|  13.8k|}
cf-socket.c:tcpkeepalive:
  118|     33|{
  119|     33|  int optval = data->set.tcp_keepalive ? 1 : 0;
  ------------------
  |  Branch (119:16): [True: 33, False: 0]
  ------------------
  120|       |
  121|       |  /* only set IDLE and INTVL if setting KEEPALIVE is successful */
  122|     33|  if(setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE,
  ------------------
  |  Branch (122:6): [True: 0, False: 33]
  ------------------
  123|     33|                (void *)&optval, sizeof(optval)) < 0) {
  124|      0|    CURL_TRC_CF(data, cf, "Failed to set SO_KEEPALIVE on fd "
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  125|      0|                "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
  126|      0|  }
  127|     33|  else {
  128|       |#ifdef USE_WINSOCK
  129|       |    /* Windows 10, version 1709 (10.0.16299) and later versions can use
  130|       |       setsockopt() TCP_KEEP*. Older versions return with failure. */
  131|       |    if(curlx_verify_windows_version(10, 0, 16299, PLATFORM_WINNT,
  132|       |                                    VERSION_GREATER_THAN_EQUAL)) {
  133|       |      CURL_TRC_CF(data, cf, "Set TCP_KEEP* on fd=%" FMT_SOCKET_T, sockfd);
  134|       |      optval = curlx_sltosi(data->set.tcp_keepidle);
  135|       |/* Offered by mingw-w64 v12+, MS SDK 6.0A/VS2008+ */
  136|       |#ifndef TCP_KEEPALIVE
  137|       |#define TCP_KEEPALIVE 3
  138|       |#endif
  139|       |/* Offered by mingw-w64 v12+, MS SDK 10.0.15063.0/VS2017 15.1+ */
  140|       |#ifndef TCP_KEEPCNT
  141|       |#define TCP_KEEPCNT 16
  142|       |#endif
  143|       |/* Offered by mingw-w64 v12+, MS SDK 10.0.16299.0/VS2017 15.4+ */
  144|       |#ifndef TCP_KEEPIDLE
  145|       |#define TCP_KEEPIDLE TCP_KEEPALIVE
  146|       |#endif
  147|       |#ifndef TCP_KEEPINTVL
  148|       |#define TCP_KEEPINTVL 17
  149|       |#endif
  150|       |      if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE,
  151|       |                    (const char *)&optval, sizeof(optval)) < 0) {
  152|       |        CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPIDLE on fd "
  153|       |                    "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
  154|       |      }
  155|       |      optval = curlx_sltosi(data->set.tcp_keepintvl);
  156|       |      if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL,
  157|       |                    (const char *)&optval, sizeof(optval)) < 0) {
  158|       |        CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPINTVL on fd "
  159|       |                    "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
  160|       |      }
  161|       |      optval = curlx_sltosi(data->set.tcp_keepcnt);
  162|       |      if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPCNT,
  163|       |                    (const char *)&optval, sizeof(optval)) < 0) {
  164|       |        CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPCNT on fd "
  165|       |                    "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
  166|       |      }
  167|       |    }
  168|       |    else {
  169|       |/* Offered by mingw-w64 and MS SDK. Latter only when targeting Win7+. */
  170|       |#ifndef SIO_KEEPALIVE_VALS
  171|       |#define SIO_KEEPALIVE_VALS  _WSAIOW(IOC_VENDOR, 4)
  172|       |      struct tcp_keepalive {
  173|       |        u_long onoff;
  174|       |        u_long keepalivetime;
  175|       |        u_long keepaliveinterval;
  176|       |      };
  177|       |#endif
  178|       |      struct tcp_keepalive vals;
  179|       |      DWORD dummy;
  180|       |      vals.onoff = 1;
  181|       |      optval = curlx_sltosi(data->set.tcp_keepidle);
  182|       |      KEEPALIVE_FACTOR(optval);
  183|       |      vals.keepalivetime = (u_long)optval;
  184|       |      optval = curlx_sltosi(data->set.tcp_keepintvl);
  185|       |      KEEPALIVE_FACTOR(optval);
  186|       |      vals.keepaliveinterval = (u_long)optval;
  187|       |      if(WSAIoctl(sockfd, SIO_KEEPALIVE_VALS, (LPVOID)&vals, sizeof(vals),
  188|       |                  NULL, 0, &dummy, NULL, NULL) != 0) {
  189|       |        CURL_TRC_CF(data, cf, "Failed to set SIO_KEEPALIVE_VALS on fd "
  190|       |                    "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
  191|       |      }
  192|       |    }
  193|       |#else /* !USE_WINSOCK */
  194|     33|#ifdef TCP_KEEPIDLE
  195|     33|    optval = curlx_sltosi(data->set.tcp_keepidle);
  196|     33|    KEEPALIVE_FACTOR(optval);
  197|     33|    if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPIDLE,
  ------------------
  |  Branch (197:8): [True: 33, False: 0]
  ------------------
  198|     33|                  (void *)&optval, sizeof(optval)) < 0) {
  199|     33|      CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPIDLE on fd "
  ------------------
  |  |  153|     33|  do {                                          \
  |  |  154|     33|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     33|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     66|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 33, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 33]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     66|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     33|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     33|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     33|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 33]
  |  |  ------------------
  ------------------
  200|     33|                  "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
  201|     33|    }
  202|       |#elif defined(TCP_KEEPALIVE)
  203|       |    /* macOS style */
  204|       |    optval = curlx_sltosi(data->set.tcp_keepidle);
  205|       |    KEEPALIVE_FACTOR(optval);
  206|       |    if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE,
  207|       |                  (void *)&optval, sizeof(optval)) < 0) {
  208|       |      CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPALIVE on fd "
  209|       |                  "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
  210|       |    }
  211|       |#elif defined(TCP_KEEPALIVE_THRESHOLD)
  212|       |    /* Solaris <11.4 style */
  213|       |    optval = curlx_sltosi(data->set.tcp_keepidle);
  214|       |    KEEPALIVE_FACTOR(optval);
  215|       |    if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE_THRESHOLD,
  216|       |                  (void *)&optval, sizeof(optval)) < 0) {
  217|       |      CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPALIVE_THRESHOLD on fd "
  218|       |                  "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
  219|       |    }
  220|       |#endif
  221|     33|#ifdef TCP_KEEPINTVL
  222|     33|    optval = curlx_sltosi(data->set.tcp_keepintvl);
  223|     33|    KEEPALIVE_FACTOR(optval);
  224|     33|    if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPINTVL,
  ------------------
  |  Branch (224:8): [True: 33, False: 0]
  ------------------
  225|     33|                  (void *)&optval, sizeof(optval)) < 0) {
  226|     33|      CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPINTVL on fd "
  ------------------
  |  |  153|     33|  do {                                          \
  |  |  154|     33|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     33|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     66|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 33, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 33]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     66|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     33|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     33|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     33|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 33]
  |  |  ------------------
  ------------------
  227|     33|                  "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
  228|     33|    }
  229|       |#elif defined(TCP_KEEPALIVE_ABORT_THRESHOLD)
  230|       |    /* Solaris <11.4 style */
  231|       |    /* TCP_KEEPALIVE_ABORT_THRESHOLD should equal to
  232|       |     * TCP_KEEPCNT * TCP_KEEPINTVL on other platforms.
  233|       |     * The default value of TCP_KEEPCNT is 9 on Linux,
  234|       |     * 8 on *BSD/macOS, 5 or 10 on Windows. We use the
  235|       |     * default config for Solaris <11.4 because there is
  236|       |     * no default value for TCP_KEEPCNT on Solaris 11.4.
  237|       |     *
  238|       |     * Note that the consequent probes will not be sent
  239|       |     * at equal intervals on Solaris, but will be sent
  240|       |     * using the exponential backoff algorithm. */
  241|       |    {
  242|       |      int keepcnt = curlx_sltosi(data->set.tcp_keepcnt);
  243|       |      int keepintvl = curlx_sltosi(data->set.tcp_keepintvl);
  244|       |
  245|       |      if(keepcnt > 0 && keepintvl > (INT_MAX / keepcnt))
  246|       |        optval = INT_MAX;
  247|       |      else
  248|       |        optval = keepcnt * keepintvl;
  249|       |    }
  250|       |    KEEPALIVE_FACTOR(optval);
  251|       |    if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE_ABORT_THRESHOLD,
  252|       |                  (void *)&optval, sizeof(optval)) < 0) {
  253|       |      CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPALIVE_ABORT_THRESHOLD"
  254|       |                  " on fd %" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
  255|       |    }
  256|       |#endif
  257|     33|#ifdef TCP_KEEPCNT
  258|     33|    optval = curlx_sltosi(data->set.tcp_keepcnt);
  259|     33|    if(setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPCNT,
  ------------------
  |  Branch (259:8): [True: 33, False: 0]
  ------------------
  260|     33|                  (void *)&optval, sizeof(optval)) < 0) {
  261|     33|      CURL_TRC_CF(data, cf, "Failed to set TCP_KEEPCNT on fd "
  ------------------
  |  |  153|     33|  do {                                          \
  |  |  154|     33|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     33|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     66|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 33, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 33]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     66|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     33|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     33|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     33|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 33]
  |  |  ------------------
  ------------------
  262|     33|                  "%" FMT_SOCKET_T ": errno %d", sockfd, SOCKERRNO);
  263|     33|    }
  264|     33|#endif
  265|     33|#endif /* USE_WINSOCK */
  266|     33|  }
  267|     33|}
cf-socket.c:bindlocal:
  574|  13.8k|{
  575|  13.8k|  struct Curl_sockaddr_storage sa;
  576|  13.8k|  struct sockaddr *sock = (struct sockaddr *)&sa;  /* bind to this address */
  577|  13.8k|  curl_socklen_t sizeof_sa = 0; /* size of the data sock points to */
  578|  13.8k|  struct sockaddr_in *si4 = (struct sockaddr_in *)&sa;
  579|  13.8k|#ifdef USE_IPV6
  580|  13.8k|  struct sockaddr_in6 *si6 = (struct sockaddr_in6 *)&sa;
  581|  13.8k|#endif
  582|       |
  583|  13.8k|  struct Curl_dns_entry *h = NULL;
  584|  13.8k|  unsigned short port = data->set.localport; /* use this port number, 0 for
  585|       |                                                "random" */
  586|       |  /* how many port numbers to try to bind to, increasing one at a time */
  587|  13.8k|  int portnum = data->set.localportrange;
  588|  13.8k|  const char *dev = data->set.str[STRING_DEVICE];
  589|  13.8k|  const char *iface_input = data->set.str[STRING_INTERFACE];
  590|  13.8k|  const char *host_input = data->set.str[STRING_BINDHOST];
  591|  13.8k|  const char *iface = iface_input ? iface_input : dev;
  ------------------
  |  Branch (591:23): [True: 4, False: 13.8k]
  ------------------
  592|  13.8k|  const char *host = host_input ? host_input : dev;
  ------------------
  |  Branch (592:22): [True: 8, False: 13.8k]
  ------------------
  593|  13.8k|  int error;
  594|  13.8k|#ifdef IP_BIND_ADDRESS_NO_PORT
  595|  13.8k|  int on = 1;
  596|  13.8k|#endif
  597|       |#ifndef USE_IPV6
  598|       |  (void)scope;
  599|       |#endif
  600|       |
  601|       |  /*************************************************************
  602|       |   * Select device to bind socket to
  603|       |   *************************************************************/
  604|  13.8k|  if(!iface && !host && !port)
  ------------------
  |  Branch (604:6): [True: 13.8k, False: 72]
  |  Branch (604:16): [True: 13.7k, False: 5]
  |  Branch (604:25): [True: 13.7k, False: 16]
  ------------------
  605|       |    /* no local kind of binding was requested */
  606|  13.7k|    return CURLE_OK;
  607|     93|  else if(iface && (strlen(iface) >= 255))
  ------------------
  |  Branch (607:11): [True: 72, False: 21]
  |  Branch (607:20): [True: 1, False: 71]
  ------------------
  608|      1|    return CURLE_BAD_FUNCTION_ARGUMENT;
  609|       |
  610|     92|  memset(&sa, 0, sizeof(struct Curl_sockaddr_storage));
  611|       |
  612|     92|  if(iface || host) {
  ------------------
  |  Branch (612:6): [True: 71, False: 21]
  |  Branch (612:15): [True: 5, False: 16]
  ------------------
  613|     76|    char myhost[256] = "";
  614|     76|    int done = 0; /* -1 for error, 1 for address found */
  615|     76|    if2ip_result_t if2ip_result = IF2IP_NOT_FOUND;
  616|       |
  617|     76|#ifdef SO_BINDTODEVICE
  618|     76|    if(iface) {
  ------------------
  |  Branch (618:8): [True: 71, False: 5]
  ------------------
  619|       |      /*
  620|       |       * This binds the local socket to a particular interface. This will
  621|       |       * force even requests to other local interfaces to go out the external
  622|       |       * interface. Only bind to the interface when specified as interface,
  623|       |       * not as a hostname or ip address.
  624|       |       *
  625|       |       * The interface might be a VRF, eg: vrf-blue, which means it cannot be
  626|       |       * converted to an IP address and would fail Curl_if2ip. Try to
  627|       |       * use it straight away.
  628|       |       */
  629|     71|      if(setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE,
  ------------------
  |  Branch (629:10): [True: 4, False: 67]
  ------------------
  630|     71|                    iface, (curl_socklen_t)strlen(iface) + 1) == 0) {
  631|       |        /* This is often "errno 1, error: Operation not permitted" if you are
  632|       |         * not running as root or another suitable privileged user. If it
  633|       |         * succeeds it means the parameter was a valid interface and not an IP
  634|       |         * address. Return immediately.
  635|       |         */
  636|      4|        if(!host_input) {
  ------------------
  |  Branch (636:12): [True: 3, False: 1]
  ------------------
  637|      3|          infof(data, "socket successfully bound to interface '%s'", iface);
  ------------------
  |  |  143|      3|  do {                               \
  |  |  144|      3|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      3|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 3, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  |  |  320|      3|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      3|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      3|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 3]
  |  |  ------------------
  ------------------
  638|      3|          return CURLE_OK;
  639|      3|        }
  640|      4|      }
  641|     71|    }
  642|     73|#endif
  643|     73|    if(!host_input) {
  ------------------
  |  Branch (643:8): [True: 65, False: 8]
  ------------------
  644|       |      /* Discover IP from input device, then bind to it */
  645|     65|      if2ip_result = Curl_if2ip(af,
  646|     65|#ifdef USE_IPV6
  647|     65|                                scope, conn->scope_id,
  648|     65|#endif
  649|     65|                                iface, myhost, sizeof(myhost));
  650|     65|    }
  651|     73|    switch(if2ip_result) {
  ------------------
  |  Branch (651:12): [True: 73, False: 0]
  ------------------
  652|     70|    case IF2IP_NOT_FOUND:
  ------------------
  |  Branch (652:5): [True: 70, False: 3]
  ------------------
  653|     70|      if(iface_input && !host_input) {
  ------------------
  |  Branch (653:10): [True: 4, False: 66]
  |  Branch (653:25): [True: 1, False: 3]
  ------------------
  654|       |        /* Do not fall back to treating it as a hostname */
  655|      1|        char buffer[STRERROR_LEN];
  656|      1|        data->state.os_errno = error = SOCKERRNO;
  ------------------
  |  | 1095|      1|#define SOCKERRNO         errno
  ------------------
  657|      1|        failf(data, "Could not bind to interface '%s' with errno %d: %s",
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  658|      1|              iface, error, curlx_strerror(error, buffer, sizeof(buffer)));
  659|      1|        return CURLE_INTERFACE_FAILED;
  660|      1|      }
  661|     69|      break;
  662|     69|    case IF2IP_AF_NOT_SUPPORTED:
  ------------------
  |  Branch (662:5): [True: 1, False: 72]
  ------------------
  663|       |      /* Signal the caller to try another address family if available */
  664|      1|      return CURLE_UNSUPPORTED_PROTOCOL;
  665|      2|    case IF2IP_FOUND:
  ------------------
  |  Branch (665:5): [True: 2, False: 71]
  ------------------
  666|       |      /*
  667|       |       * We now have the numerical IP address in the 'myhost' buffer
  668|       |       */
  669|      2|      host = myhost;
  670|      2|      infof(data, "Local Interface %s is ip %s using address family %i",
  ------------------
  |  |  143|      2|  do {                               \
  |  |  144|      2|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      2|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 2, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  320|      2|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      2|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      2|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 2]
  |  |  ------------------
  ------------------
  671|      2|            iface, host, af);
  672|      2|      done = 1;
  673|      2|      break;
  674|     73|    }
  675|     71|    if(!iface_input || host_input) {
  ------------------
  |  Branch (675:8): [True: 68, False: 3]
  |  Branch (675:24): [True: 3, False: 0]
  ------------------
  676|       |      /*
  677|       |       * This was not an interface, resolve the name as a hostname
  678|       |       * or IP number
  679|       |       *
  680|       |       * Temporarily force name resolution to use only the address type
  681|       |       * of the connection. The resolve functions should really be changed
  682|       |       * to take a type parameter instead.
  683|       |       */
  684|     71|      uint8_t dns_queries = (af == AF_INET) ?
  ------------------
  |  Branch (684:29): [True: 69, False: 2]
  ------------------
  685|     69|                            CURL_DNSQ_A : (CURL_DNSQ_A | CURL_DNSQ_AAAA);
  ------------------
  |  |   51|     69|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                                          CURL_DNSQ_A : (CURL_DNSQ_A | CURL_DNSQ_AAAA);
  ------------------
  |  |   51|      2|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                                          CURL_DNSQ_A : (CURL_DNSQ_A | CURL_DNSQ_AAAA);
  ------------------
  |  |   52|      2|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  686|     71|#ifdef USE_IPV6
  687|     71|      if(af == AF_INET6)
  ------------------
  |  Branch (687:10): [True: 2, False: 69]
  ------------------
  688|      2|        dns_queries = CURL_DNSQ_AAAA;
  ------------------
  |  |   52|      2|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  689|     71|#endif
  690|       |
  691|     71|      (void)Curl_resolv_blocking(data, dns_queries, host, 80, transport, &h);
  692|     71|      if(h) {
  ------------------
  |  Branch (692:10): [True: 8, False: 63]
  ------------------
  693|      8|        int h_af = h->addr->ai_family;
  694|       |        /* convert the resolved address, sizeof myhost >= INET_ADDRSTRLEN */
  695|      8|        Curl_printable_address(h->addr, myhost, sizeof(myhost));
  696|      8|        infof(data, "Name '%s' family %i resolved to '%s' family %i",
  ------------------
  |  |  143|      8|  do {                               \
  |  |  144|      8|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      8|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 8, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 8]
  |  |  |  |  ------------------
  |  |  |  |  320|      8|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      8|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      8|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 8]
  |  |  ------------------
  ------------------
  697|      8|              host, af, myhost, h_af);
  698|      8|        Curl_dns_entry_unlink(data, &h); /* this will NULL, potential free h */
  699|      8|        if(af != h_af) {
  ------------------
  |  Branch (699:12): [True: 1, False: 7]
  ------------------
  700|       |          /* bad IP version combo, signal the caller to try another address
  701|       |             family if available */
  702|      1|          return CURLE_UNSUPPORTED_PROTOCOL;
  703|      1|        }
  704|      7|        done = 1;
  705|      7|      }
  706|     63|      else {
  707|       |        /*
  708|       |         * provided dev was no interface (or interfaces are not supported
  709|       |         * e.g. Solaris) no ip address and no domain we fail here
  710|       |         */
  711|     63|        done = -1;
  712|     63|      }
  713|     71|    }
  714|       |
  715|     70|    if(done > 0) {
  ------------------
  |  Branch (715:8): [True: 7, False: 63]
  ------------------
  716|      7|#ifdef USE_IPV6
  717|       |      /* IPv6 address */
  718|      7|      if(af == AF_INET6) {
  ------------------
  |  Branch (718:10): [True: 0, False: 7]
  ------------------
  719|      0|#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
  720|      0|        char *scope_ptr = strchr(myhost, '%');
  721|      0|        if(scope_ptr)
  ------------------
  |  Branch (721:12): [True: 0, False: 0]
  ------------------
  722|      0|          *(scope_ptr++) = '\0';
  723|      0|#endif
  724|      0|        if(curlx_inet_pton(AF_INET6, myhost, &si6->sin6_addr) > 0) {
  ------------------
  |  |   43|      0|  inet_pton(x, y, z)
  ------------------
  |  Branch (724:12): [True: 0, False: 0]
  ------------------
  725|      0|          si6->sin6_family = AF_INET6;
  726|      0|          si6->sin6_port = htons(port);
  727|      0|#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
  728|      0|          if(scope_ptr) {
  ------------------
  |  Branch (728:14): [True: 0, False: 0]
  ------------------
  729|       |            /* The "myhost" string either comes from Curl_if2ip or from
  730|       |               Curl_printable_address. The latter returns only numeric scope
  731|       |               IDs and the former returns none at all. Making the scope ID,
  732|       |               if present, known to be numeric */
  733|      0|            curl_off_t scope_id;
  734|      0|            if(curlx_str_number((const char **)CURL_UNCONST(&scope_ptr),
  ------------------
  |  |  866|      0|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  |  Branch (734:16): [True: 0, False: 0]
  ------------------
  735|      0|                                &scope_id, UINT_MAX))
  736|      0|              return CURLE_UNSUPPORTED_PROTOCOL;
  737|      0|            si6->sin6_scope_id = (unsigned int)scope_id;
  738|      0|          }
  739|      0|#endif
  740|      0|        }
  741|      0|        sizeof_sa = sizeof(struct sockaddr_in6);
  742|      0|      }
  743|      7|      else
  744|      7|#endif
  745|       |      /* IPv4 address */
  746|      7|      if((af == AF_INET) &&
  ------------------
  |  Branch (746:10): [True: 7, False: 0]
  ------------------
  747|      7|         (curlx_inet_pton(AF_INET, myhost, &si4->sin_addr) > 0)) {
  ------------------
  |  |   43|      7|  inet_pton(x, y, z)
  ------------------
  |  Branch (747:10): [True: 7, False: 0]
  ------------------
  748|      7|        si4->sin_family = AF_INET;
  749|      7|        si4->sin_port = htons(port);
  750|      7|        sizeof_sa = sizeof(struct sockaddr_in);
  751|      7|      }
  752|      7|    }
  753|       |
  754|     70|    if(done < 1) {
  ------------------
  |  Branch (754:8): [True: 63, False: 7]
  ------------------
  755|       |      /* errorbuf is set false so failf will overwrite any message already in
  756|       |         the error buffer, so the user receives this error message instead of a
  757|       |         generic resolve error. */
  758|     63|      char buffer[STRERROR_LEN];
  759|     63|      data->state.errorbuf = FALSE;
  ------------------
  |  | 1058|     63|#define FALSE false
  ------------------
  760|     63|      data->state.os_errno = error = SOCKERRNO;
  ------------------
  |  | 1095|     63|#define SOCKERRNO         errno
  ------------------
  761|     63|      failf(data, "Could not bind to '%s' with errno %d: %s", host,
  ------------------
  |  |   62|     63|#define failf Curl_failf
  ------------------
  762|     63|            error, curlx_strerror(error, buffer, sizeof(buffer)));
  763|     63|      return CURLE_INTERFACE_FAILED;
  764|     63|    }
  765|     70|  }
  766|     16|  else {
  767|       |    /* no device was given, prepare sa to match af's needs */
  768|     16|#ifdef USE_IPV6
  769|     16|    if(af == AF_INET6) {
  ------------------
  |  Branch (769:8): [True: 1, False: 15]
  ------------------
  770|      1|      si6->sin6_family = AF_INET6;
  771|      1|      si6->sin6_port = htons(port);
  772|      1|      sizeof_sa = sizeof(struct sockaddr_in6);
  773|      1|    }
  774|     15|    else
  775|     15|#endif
  776|     15|    if(af == AF_INET) {
  ------------------
  |  Branch (776:8): [True: 15, False: 0]
  ------------------
  777|     15|      si4->sin_family = AF_INET;
  778|     15|      si4->sin_port = htons(port);
  779|     15|      sizeof_sa = sizeof(struct sockaddr_in);
  780|     15|    }
  781|     16|  }
  782|     23|#ifdef IP_BIND_ADDRESS_NO_PORT
  783|     23|  (void)setsockopt(sockfd, SOL_IP, IP_BIND_ADDRESS_NO_PORT, &on, sizeof(on));
  784|     23|#endif
  785|  65.4k|  for(;;) {
  786|  65.4k|    if(bind(sockfd, sock, sizeof_sa) >= 0) {
  ------------------
  |  Branch (786:8): [True: 0, False: 65.4k]
  ------------------
  787|       |      /* we succeeded to bind */
  788|      0|      infof(data, "Local port: %hu", port);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  789|      0|      conn->bits.bound = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  790|      0|      return CURLE_OK;
  791|      0|    }
  792|       |
  793|  65.4k|    if(--portnum > 0) {
  ------------------
  |  Branch (793:8): [True: 65.3k, False: 15]
  ------------------
  794|  65.3k|      port++; /* try next port */
  795|  65.3k|      if(port == 0)
  ------------------
  |  Branch (795:10): [True: 8, False: 65.3k]
  ------------------
  796|      8|        break;
  797|  65.3k|      infof(data, "Bind to local port %d failed, trying next", port - 1);
  ------------------
  |  |  143|  65.3k|  do {                               \
  |  |  144|  65.3k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  65.3k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 65.3k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 65.3k]
  |  |  |  |  ------------------
  |  |  |  |  320|  65.3k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  65.3k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  65.3k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 65.3k]
  |  |  ------------------
  ------------------
  798|       |      /* We reuse/clobber the port variable here below */
  799|  65.3k|      if(sock->sa_family == AF_INET)
  ------------------
  |  Branch (799:10): [True: 65.3k, False: 0]
  ------------------
  800|  65.3k|        si4->sin_port = htons(port);
  801|      0|#ifdef USE_IPV6
  802|      0|      else
  803|      0|        si6->sin6_port = htons(port);
  804|  65.3k|#endif
  805|  65.3k|    }
  806|     15|    else
  807|     15|      break;
  808|  65.4k|  }
  809|     23|  {
  810|     23|    char buffer[STRERROR_LEN];
  811|     23|    data->state.os_errno = error = SOCKERRNO;
  ------------------
  |  | 1095|     23|#define SOCKERRNO         errno
  ------------------
  812|     23|    failf(data, "bind failed with errno %d: %s",
  ------------------
  |  |   62|     23|#define failf Curl_failf
  ------------------
  813|     23|          error, curlx_strerror(error, buffer, sizeof(buffer)));
  814|     23|  }
  815|       |
  816|     23|  return CURLE_INTERFACE_FAILED;
  817|     23|}
cf-socket.c:do_connect:
 1248|     60|{
 1249|     60|  struct cf_socket_ctx *ctx = cf->ctx;
 1250|     60|#ifdef TCP_FASTOPEN_CONNECT
 1251|     60|  int optval = 1;
 1252|     60|#endif
 1253|     60|  int rc = -1;
 1254|       |
 1255|     60|  (void)data;
 1256|     60|  if(is_tcp_fastopen) {
  ------------------
  |  Branch (1256:6): [True: 0, False: 60]
  ------------------
 1257|       |#ifdef CONNECT_DATA_IDEMPOTENT /* Darwin */
 1258|       |#  ifdef HAVE_BUILTIN_AVAILABLE
 1259|       |    /* while connectx function is available since macOS 10.11 / iOS 9,
 1260|       |       it did not have the interface declared correctly until
 1261|       |       Xcode 9 / macOS SDK 10.13 */
 1262|       |    if(__builtin_available(macOS 10.11, iOS 9.0, tvOS 9.0, watchOS 2.0, *)) {
 1263|       |      sa_endpoints_t endpoints;
 1264|       |      endpoints.sae_srcif = 0;
 1265|       |      endpoints.sae_srcaddr = NULL;
 1266|       |      endpoints.sae_srcaddrlen = 0;
 1267|       |      endpoints.sae_dstaddr = &ctx->addr.curl_sa_addr;
 1268|       |      endpoints.sae_dstaddrlen = ctx->addr.addrlen;
 1269|       |
 1270|       |      rc = connectx(ctx->sock, &endpoints, SAE_ASSOCID_ANY,
 1271|       |                    CONNECT_RESUME_ON_READ_WRITE | CONNECT_DATA_IDEMPOTENT,
 1272|       |                    NULL, 0, NULL, NULL);
 1273|       |    }
 1274|       |    else {
 1275|       |      rc = connect(ctx->sock, &ctx->addr.curl_sa_addr, ctx->addr.addrlen);
 1276|       |    }
 1277|       |#  else
 1278|       |    rc = connect(ctx->sock, &ctx->addr.curl_sa_addr, ctx->addr.addrlen);
 1279|       |#  endif /* HAVE_BUILTIN_AVAILABLE */
 1280|       |#elif defined(TCP_FASTOPEN_CONNECT) /* Linux >= 4.11 */
 1281|      0|    if(setsockopt(ctx->sock, IPPROTO_TCP, TCP_FASTOPEN_CONNECT,
  ------------------
  |  Branch (1281:8): [True: 0, False: 0]
  ------------------
 1282|      0|                  (void *)&optval, sizeof(optval)) < 0)
 1283|      0|      CURL_TRC_CF(data, cf, "Failed to enable TCP Fast Open on fd %"
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1284|      0|                  FMT_SOCKET_T, ctx->sock);
 1285|       |
 1286|      0|    rc = connect(ctx->sock, &ctx->addr.curl_sa_addr, ctx->addr.addrlen);
  ------------------
  |  |   54|      0|#define curl_sa_addr    addr.sa
  ------------------
 1287|       |#elif defined(MSG_FASTOPEN) /* old Linux */
 1288|       |    if(Curl_conn_is_ssl(cf->conn, cf->sockindex))
 1289|       |      rc = connect(ctx->sock, &ctx->addr.curl_sa_addr, ctx->addr.addrlen);
 1290|       |    else
 1291|       |      rc = 0; /* Do nothing */
 1292|       |#endif
 1293|      0|  }
 1294|     60|  else {
 1295|     60|    rc = connect(ctx->sock, &ctx->addr.curl_sa_addr,
  ------------------
  |  |   54|     60|#define curl_sa_addr    addr.sa
  ------------------
 1296|     60|                 (curl_socklen_t)ctx->addr.addrlen);
 1297|     60|  }
 1298|     60|  return rc;
 1299|     60|}
cf-socket.c:socket_connect_result:
  879|     60|{
  880|     60|  switch(error) {
  881|     40|  case SOCKEINPROGRESS:
  ------------------
  |  | 1128|     40|#define SOCKEINPROGRESS   EINPROGRESS
  ------------------
  |  Branch (881:3): [True: 40, False: 20]
  ------------------
  882|     40|  case SOCKEWOULDBLOCK:
  ------------------
  |  | 1137|     40|#define SOCKEWOULDBLOCK   EWOULDBLOCK
  ------------------
  |  Branch (882:3): [True: 0, False: 60]
  ------------------
  883|     40|#ifdef EAGAIN
  884|       |#if (EAGAIN) != (SOCKEWOULDBLOCK)
  885|       |    /* On some platforms EAGAIN and EWOULDBLOCK are the
  886|       |     * same value, and on others they are different, hence
  887|       |     * the odd #if
  888|       |     */
  889|       |  case EAGAIN:
  890|       |#endif
  891|     40|#endif
  892|     40|    return CURLE_OK;
  893|       |
  894|     20|  default:
  ------------------
  |  Branch (894:3): [True: 20, False: 40]
  ------------------
  895|       |    /* unknown error, fallthrough and try another address! */
  896|     20|    {
  897|     20|      VERBOSE(char buffer[STRERROR_LEN]);
  ------------------
  |  | 1618|     20|#define VERBOSE(x) x
  ------------------
  898|     20|      infof(data, "Immediate connect fail for %s: %s", ipaddress,
  ------------------
  |  |  143|     20|  do {                               \
  |  |  144|     20|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     20|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 20, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 20]
  |  |  |  |  ------------------
  |  |  |  |  320|     20|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     20|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     20|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 20]
  |  |  ------------------
  ------------------
  899|     20|            curlx_strerror(error, buffer, sizeof(buffer)));
  900|     20|      NOVERBOSE((void)ipaddress);
  ------------------
  |  | 1619|     20|#define NOVERBOSE(x) Curl_nop_stmt
  |  |  ------------------
  |  |  |  | 1180|     20|#define Curl_nop_stmt do {} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1180:35): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  901|     20|    }
  902|     20|    data->state.os_errno = error;
  903|       |    /* connect failed */
  904|     20|    return CURLE_COULDNT_CONNECT;
  905|     60|  }
  906|     60|}
cf-socket.c:verifyconnect:
  824|     15|{
  825|     15|  bool rc = TRUE;
  ------------------
  |  | 1055|     15|#define TRUE true
  ------------------
  826|     15|#ifdef SO_ERROR
  827|     15|  int err = 0;
  828|     15|  curl_socklen_t errSize = sizeof(err);
  829|       |
  830|       |#ifdef _WIN32
  831|       |  /*
  832|       |   * In October 2003 we effectively nullified this function on Windows due to
  833|       |   * problems with it using all CPU in multi-threaded cases.
  834|       |   *
  835|       |   * In May 2004, we brought it back to offer more info back on connect
  836|       |   * failures. We could reproduce the former problems with this function, but
  837|       |   * could avoid them by adding this SleepEx() call below:
  838|       |   *
  839|       |   *    "I do not have Rational Quantify, but the hint from his post was
  840|       |   *    ntdll::NtRemoveIoCompletion(). I would assume the SleepEx (or maybe
  841|       |   *    Sleep(0) would be enough?) would release whatever
  842|       |   *    mutex/critical-section the ntdll call is waiting on.
  843|       |   *
  844|       |   *    Someone got to verify this on Win-NT 4.0, 2000."
  845|       |   */
  846|       |  SleepEx(0, FALSE);
  847|       |#endif
  848|       |
  849|     15|  if(getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (void *)&err, &errSize))
  ------------------
  |  Branch (849:6): [True: 0, False: 15]
  ------------------
  850|      0|    err = SOCKERRNO;
  ------------------
  |  | 1095|      0|#define SOCKERRNO         errno
  ------------------
  851|       |#if defined(EBADIOCTL) && defined(__minix)
  852|       |  /* Minix 3.1.x does not support getsockopt on UDP sockets */
  853|       |  if(EBADIOCTL == err) {
  854|       |    SET_SOCKERRNO(0);
  855|       |    err = 0;
  856|       |  }
  857|       |#endif
  858|     15|  if((err == 0) || (SOCKEISCONN == err))
  ------------------
  |  | 1131|     15|#define SOCKEISCONN       EISCONN
  ------------------
  |  Branch (858:6): [True: 0, False: 15]
  |  Branch (858:20): [True: 0, False: 15]
  ------------------
  859|       |    /* we are connected, awesome! */
  860|      0|    rc = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  861|     15|  else
  862|       |    /* This was not a successful connect */
  863|     15|    rc = FALSE;
  ------------------
  |  | 1058|     15|#define FALSE false
  ------------------
  864|     15|  if(error)
  ------------------
  |  Branch (864:6): [True: 15, False: 0]
  ------------------
  865|     15|    *error = err;
  866|       |#else
  867|       |  (void)sockfd;
  868|       |  if(error)
  869|       |    *error = SOCKERRNO;
  870|       |#endif
  871|     15|  return rc;
  872|     15|}
cf-socket.c:cf_socket_close:
  976|  27.8k|{
  977|  27.8k|  struct cf_socket_ctx *ctx = cf->ctx;
  978|       |
  979|  27.8k|  if(ctx && ctx->sock != CURL_SOCKET_BAD) {
  ------------------
  |  |  145|  27.8k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (979:6): [True: 27.8k, False: 0]
  |  Branch (979:13): [True: 13.8k, False: 14.0k]
  ------------------
  980|  13.8k|    CURL_TRC_CF(data, cf, "cf_socket_close, fd=%" FMT_SOCKET_T, ctx->sock);
  ------------------
  |  |  153|  13.8k|  do {                                          \
  |  |  154|  13.8k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  13.8k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  27.7k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 13.8k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 13.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  27.7k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  13.8k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  13.8k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  13.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 13.8k]
  |  |  ------------------
  ------------------
  981|  13.8k|    if(ctx->sock == cf->conn->sock[cf->sockindex])
  ------------------
  |  Branch (981:8): [True: 9.80k, False: 4.05k]
  ------------------
  982|  9.80k|      cf->conn->sock[cf->sockindex] = CURL_SOCKET_BAD;
  ------------------
  |  |  145|  9.80k|#define CURL_SOCKET_BAD (-1)
  ------------------
  983|  13.8k|    socket_close(data, cf->conn, !ctx->accepted, ctx->sock);
  984|  13.8k|    ctx->sock = CURL_SOCKET_BAD;
  ------------------
  |  |  145|  13.8k|#define CURL_SOCKET_BAD (-1)
  ------------------
  985|  13.8k|    ctx->active = FALSE;
  ------------------
  |  | 1058|  13.8k|#define FALSE false
  ------------------
  986|  13.8k|    memset(&ctx->started_at, 0, sizeof(ctx->started_at));
  987|  13.8k|    memset(&ctx->connected_at, 0, sizeof(ctx->connected_at));
  988|  13.8k|  }
  989|       |
  990|       |  cf->connected = FALSE;
  ------------------
  |  | 1058|  27.8k|#define FALSE false
  ------------------
  991|  27.8k|}
cf-socket.c:cf_socket_shutdown:
  996|  4.37k|{
  997|  4.37k|  if(cf->connected) {
  ------------------
  |  Branch (997:6): [True: 4.37k, False: 0]
  ------------------
  998|  4.37k|    struct cf_socket_ctx *ctx = cf->ctx;
  999|       |
 1000|  4.37k|    CURL_TRC_CF(data, cf, "cf_socket_shutdown, fd=%" FMT_SOCKET_T, ctx->sock);
  ------------------
  |  |  153|  4.37k|  do {                                          \
  |  |  154|  4.37k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  4.37k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  8.74k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 4.37k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4.37k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  8.74k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  4.37k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  4.37k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  4.37k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 4.37k]
  |  |  ------------------
  ------------------
 1001|       |    /* On TCP, and when the socket looks well and non-blocking mode
 1002|       |     * can be enabled, receive dangling bytes before close to avoid
 1003|       |     * entering RST states unnecessarily. */
 1004|  4.37k|    if(ctx->sock != CURL_SOCKET_BAD &&
  ------------------
  |  |  145|  8.74k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1004:8): [True: 4.37k, False: 0]
  ------------------
 1005|  4.37k|       ctx->transport == TRNSPRT_TCP &&
  ------------------
  |  |  307|  8.74k|#define TRNSPRT_TCP  3
  ------------------
  |  Branch (1005:8): [True: 4.29k, False: 81]
  ------------------
 1006|  4.29k|       (curlx_nonblock(ctx->sock, TRUE) >= 0)) {
  ------------------
  |  | 1055|  4.29k|#define TRUE true
  ------------------
  |  Branch (1006:8): [True: 4.29k, False: 0]
  ------------------
 1007|  4.29k|      unsigned char buf[1024];
 1008|  4.29k|      (void)sread(ctx->sock, buf, sizeof(buf));
  ------------------
  |  |  954|  4.29k|#define sread(x, y, z) (ssize_t)recv((RECV_TYPE_ARG1)(x), \
  |  |  955|  4.29k|                                     (RECV_TYPE_ARG2)(y), \
  |  |  956|  4.29k|                                     (RECV_TYPE_ARG3)(z), \
  |  |  957|  4.29k|                                     (RECV_TYPE_ARG4)(0))
  ------------------
 1009|  4.29k|    }
 1010|  4.37k|  }
 1011|       |  *done = TRUE;
  ------------------
  |  | 1055|  4.37k|#define TRUE true
  ------------------
 1012|  4.37k|  return CURLE_OK;
 1013|  4.37k|}
cf-socket.c:cf_socket_adjust_pollset:
 1398|  6.76M|{
 1399|  6.76M|  struct cf_socket_ctx *ctx = cf->ctx;
 1400|  6.76M|  CURLcode result = CURLE_OK;
 1401|       |
 1402|  6.76M|  if(ctx->sock != CURL_SOCKET_BAD) {
  ------------------
  |  |  145|  6.76M|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1402:6): [True: 6.76M, False: 0]
  ------------------
 1403|       |    /* A listening socket filter needs to be connected before the accept
 1404|       |     * for some weird FTP interaction. This should be rewritten, so that
 1405|       |     * FTP no longer does the socket checks and accept calls and delegates
 1406|       |     * all that to the filter. */
 1407|  6.76M|    if(ctx->listening) {
  ------------------
  |  Branch (1407:8): [True: 0, False: 6.76M]
  ------------------
 1408|      0|      result = Curl_pollset_set_in_only(data, ps, ctx->sock);
  ------------------
  |  |  172|      0|  Curl_pollset_change(data, ps, sock, CURL_POLL_IN, CURL_POLL_OUT)
  |  |  ------------------
  |  |  |  |  283|      0|#define CURL_POLL_IN     1
  |  |  ------------------
  |  |                 Curl_pollset_change(data, ps, sock, CURL_POLL_IN, CURL_POLL_OUT)
  |  |  ------------------
  |  |  |  |  284|      0|#define CURL_POLL_OUT    2
  |  |  ------------------
  ------------------
 1409|      0|      CURL_TRC_CF(data, cf, "adjust_pollset, listening, POLLIN fd=%"
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1410|      0|                  FMT_SOCKET_T, ctx->sock);
 1411|      0|    }
 1412|  6.76M|    else if(!cf->connected) {
  ------------------
  |  Branch (1412:13): [True: 65, False: 6.76M]
  ------------------
 1413|     65|      result = Curl_pollset_set_out_only(data, ps, ctx->sock);
  ------------------
  |  |  174|     65|  Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  284|     65|#define CURL_POLL_OUT    2
  |  |  ------------------
  |  |                 Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  283|     65|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
 1414|     65|      CURL_TRC_CF(data, cf, "adjust_pollset, !connected, POLLOUT fd=%"
  ------------------
  |  |  153|     65|  do {                                          \
  |  |  154|     65|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     65|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    130|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 65, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 65]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    130|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     65|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     65|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     65|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 65]
  |  |  ------------------
  ------------------
 1415|     65|                  FMT_SOCKET_T, ctx->sock);
 1416|     65|    }
 1417|  6.76M|    else if(!ctx->active) {
  ------------------
  |  Branch (1417:13): [True: 72.5k, False: 6.69M]
  ------------------
 1418|  72.5k|      result = Curl_pollset_add_in(data, ps, ctx->sock);
  ------------------
  |  |  162|  72.5k|  Curl_pollset_change(data, ps, sock, CURL_POLL_IN, 0)
  |  |  ------------------
  |  |  |  |  283|  72.5k|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
 1419|  72.5k|      CURL_TRC_CF(data, cf, "adjust_pollset, !active, POLLIN fd=%"
  ------------------
  |  |  153|  72.5k|  do {                                          \
  |  |  154|  72.5k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  72.5k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|   145k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 72.5k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 72.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|   145k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  72.5k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  72.5k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  72.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 72.5k]
  |  |  ------------------
  ------------------
 1420|  72.5k|                  FMT_SOCKET_T, ctx->sock);
 1421|  72.5k|    }
 1422|  6.76M|  }
 1423|  6.76M|  return result;
 1424|  6.76M|}
cf-socket.c:cf_socket_send:
 1457|  33.1k|{
 1458|  33.1k|  struct cf_socket_ctx *ctx = cf->ctx;
 1459|  33.1k|  curl_socket_t fdsave;
 1460|  33.1k|  ssize_t rv;
 1461|  33.1k|  CURLcode result = CURLE_OK;
 1462|  33.1k|  VERBOSE(size_t orig_len = len);
  ------------------
  |  | 1618|  33.1k|#define VERBOSE(x) x
  ------------------
 1463|       |
 1464|  33.1k|  (void)eos;
 1465|  33.1k|  *pnwritten = 0;
 1466|  33.1k|  fdsave = cf->conn->sock[cf->sockindex];
 1467|  33.1k|  cf->conn->sock[cf->sockindex] = ctx->sock;
 1468|       |
 1469|  33.1k|#ifdef DEBUGBUILD
 1470|       |  /* simulate network blocking/partial writes */
 1471|  33.1k|  if(ctx->wblock_percent > 0) {
  ------------------
  |  Branch (1471:6): [True: 0, False: 33.1k]
  ------------------
 1472|      0|    unsigned char c = 0;
 1473|      0|    Curl_rand_bytes(data, FALSE, &c, 1);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1474|      0|    if(c >= ((100 - ctx->wblock_percent) * 256 / 100)) {
  ------------------
  |  Branch (1474:8): [True: 0, False: 0]
  ------------------
 1475|      0|      CURL_TRC_CF(data, cf, "send(len=%zu) SIMULATE EWOULDBLOCK", orig_len);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1476|      0|      cf->conn->sock[cf->sockindex] = fdsave;
 1477|      0|      return CURLE_AGAIN;
 1478|      0|    }
 1479|      0|  }
 1480|  33.1k|  if(cf->cft != &Curl_cft_udp && ctx->wpartial_percent > 0 && len > 8) {
  ------------------
  |  Branch (1480:6): [True: 33.1k, False: 0]
  |  Branch (1480:34): [True: 0, False: 33.1k]
  |  Branch (1480:63): [True: 0, False: 0]
  ------------------
 1481|      0|    len = len * ctx->wpartial_percent / 100;
 1482|      0|    if(!len)
  ------------------
  |  Branch (1482:8): [True: 0, False: 0]
  ------------------
 1483|      0|      len = 1;
 1484|      0|    CURL_TRC_CF(data, cf, "send(len=%zu) SIMULATE partial write of %zu bytes",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1485|      0|                orig_len, len);
 1486|      0|  }
 1487|  33.1k|#endif
 1488|       |
 1489|       |#if defined(MSG_FASTOPEN) && !defined(TCP_FASTOPEN_CONNECT) /* Linux */
 1490|       |  if(cf->conn->bits.tcp_fastopen) {
 1491|       |    rv = sendto(ctx->sock, buf, len, MSG_FASTOPEN,
 1492|       |                &ctx->addr.curl_sa_addr, ctx->addr.addrlen);
 1493|       |    cf->conn->bits.tcp_fastopen = FALSE;
 1494|       |  }
 1495|       |  else
 1496|       |#endif
 1497|  33.1k|    rv = swrite(ctx->sock, buf, len);
  ------------------
  |  |  976|  33.1k|#define swrite(x, y, z) (ssize_t)send((SEND_TYPE_ARG1)(x), \
  |  |  977|  33.1k|                                      (const SEND_TYPE_ARG2)(y), \
  |  |  978|  33.1k|                                      (SEND_TYPE_ARG3)(z), \
  |  |  979|  33.1k|                                      (SEND_TYPE_ARG4)(SEND_4TH_ARG))
  |  |  ------------------
  |  |  |  |  919|  33.1k|#define SEND_4TH_ARG MSG_NOSIGNAL
  |  |  ------------------
  ------------------
 1498|       |
 1499|  33.1k|  if(!curlx_sztouz(rv, pnwritten)) {
  ------------------
  |  Branch (1499:6): [True: 0, False: 33.1k]
  ------------------
 1500|      0|    int sockerr = SOCKERRNO;
  ------------------
  |  | 1095|      0|#define SOCKERRNO         errno
  ------------------
 1501|       |
 1502|      0|    if(
 1503|       |#ifdef USE_WINSOCK
 1504|       |      /* This is how Windows does it */
 1505|       |      (SOCKEWOULDBLOCK == sockerr)
 1506|       |#else
 1507|       |      /* errno may be EWOULDBLOCK or on some systems EAGAIN when it returned
 1508|       |         due to its inability to send off data without blocking. We therefore
 1509|       |         treat both error codes the same here */
 1510|      0|      (SOCKEWOULDBLOCK == sockerr) ||
  ------------------
  |  | 1137|      0|#define SOCKEWOULDBLOCK   EWOULDBLOCK
  ------------------
  |  Branch (1510:7): [True: 0, False: 0]
  ------------------
 1511|      0|      (EAGAIN == sockerr) || (SOCKEINTR == sockerr) ||
  ------------------
  |  | 1129|      0|#define SOCKEINTR         EINTR
  ------------------
  |  Branch (1511:7): [True: 0, False: 0]
  |  Branch (1511:30): [True: 0, False: 0]
  ------------------
 1512|      0|      (SOCKEINPROGRESS == sockerr)
  ------------------
  |  | 1128|      0|#define SOCKEINPROGRESS   EINPROGRESS
  ------------------
  |  Branch (1512:7): [True: 0, False: 0]
  ------------------
 1513|      0|#endif
 1514|      0|      ) {
 1515|       |      /* EWOULDBLOCK */
 1516|      0|      result = CURLE_AGAIN;
 1517|      0|    }
 1518|      0|    else {
 1519|      0|      char buffer[STRERROR_LEN];
 1520|      0|      failf(data, "Send failure: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1521|      0|            curlx_strerror(sockerr, buffer, sizeof(buffer)));
 1522|      0|      data->state.os_errno = sockerr;
 1523|      0|      result = CURLE_SEND_ERROR;
 1524|      0|    }
 1525|      0|  }
 1526|       |
 1527|       |#ifdef USE_WINSOCK
 1528|       |  if(!result)
 1529|       |    win_update_sndbuf_size(data, ctx);
 1530|       |#endif
 1531|       |
 1532|  33.1k|  CURL_TRC_CF(data, cf, "send(len=%zu) -> %d, %zu",
  ------------------
  |  |  153|  33.1k|  do {                                          \
  |  |  154|  33.1k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  33.1k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  66.3k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 33.1k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 33.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  66.3k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  33.1k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  33.1k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  33.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 33.1k]
  |  |  ------------------
  ------------------
 1533|  33.1k|              orig_len, result, *pnwritten);
 1534|  33.1k|  cf->conn->sock[cf->sockindex] = fdsave;
 1535|  33.1k|  return result;
 1536|  33.1k|}
cf-socket.c:cf_socket_recv:
 1540|  4.80M|{
 1541|  4.80M|  struct cf_socket_ctx *ctx = cf->ctx;
 1542|  4.80M|  CURLcode result = CURLE_OK;
 1543|  4.80M|  ssize_t rv;
 1544|       |
 1545|  4.80M|  *pnread = 0;
 1546|  4.80M|#ifdef DEBUGBUILD
 1547|       |  /* simulate network blocking/partial reads */
 1548|  4.80M|  if(cf->cft != &Curl_cft_udp && ctx->rblock_percent > 0) {
  ------------------
  |  Branch (1548:6): [True: 4.80M, False: 0]
  |  Branch (1548:34): [True: 0, False: 4.80M]
  ------------------
 1549|      0|    unsigned char c = 0;
 1550|      0|    Curl_rand(data, &c, 1);
  ------------------
  |  |   33|      0|#define Curl_rand(a, b, c) Curl_rand_bytes(a, TRUE, b, c)
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  ------------------
 1551|      0|    if(c >= ((100 - ctx->rblock_percent) * 256 / 100)) {
  ------------------
  |  Branch (1551:8): [True: 0, False: 0]
  ------------------
 1552|      0|      CURL_TRC_CF(data, cf, "recv(len=%zu) SIMULATE EWOULDBLOCK", len);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1553|      0|      return CURLE_AGAIN;
 1554|      0|    }
 1555|      0|  }
 1556|  4.80M|  if(cf->cft != &Curl_cft_udp && ctx->recv_max && ctx->recv_max < len) {
  ------------------
  |  Branch (1556:6): [True: 4.80M, False: 0]
  |  Branch (1556:34): [True: 0, False: 4.80M]
  |  Branch (1556:51): [True: 0, False: 0]
  ------------------
 1557|      0|    CURL_TRC_CF(data, cf, "recv(len=%zu) SIMULATE max read of %zu bytes",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1558|      0|                len, ctx->recv_max);
 1559|      0|    len = ctx->recv_max;
 1560|      0|  }
 1561|  4.80M|#endif
 1562|       |
 1563|  4.80M|  rv = sread(ctx->sock, buf, len);
  ------------------
  |  |  954|  4.80M|#define sread(x, y, z) (ssize_t)recv((RECV_TYPE_ARG1)(x), \
  |  |  955|  4.80M|                                     (RECV_TYPE_ARG2)(y), \
  |  |  956|  4.80M|                                     (RECV_TYPE_ARG3)(z), \
  |  |  957|  4.80M|                                     (RECV_TYPE_ARG4)(0))
  ------------------
 1564|       |
 1565|  4.80M|  if(!curlx_sztouz(rv, pnread)) {
  ------------------
  |  Branch (1565:6): [True: 3.25M, False: 1.55M]
  ------------------
 1566|  3.25M|    int sockerr = SOCKERRNO;
  ------------------
  |  | 1095|  3.25M|#define SOCKERRNO         errno
  ------------------
 1567|       |
 1568|  3.25M|    if(
 1569|       |#ifdef USE_WINSOCK
 1570|       |      /* This is how Windows does it */
 1571|       |      (SOCKEWOULDBLOCK == sockerr)
 1572|       |#else
 1573|       |      /* errno may be EWOULDBLOCK or on some systems EAGAIN when it returned
 1574|       |         due to its inability to send off data without blocking. We therefore
 1575|       |         treat both error codes the same here */
 1576|  3.25M|      (SOCKEWOULDBLOCK == sockerr) ||
  ------------------
  |  | 1137|  3.25M|#define SOCKEWOULDBLOCK   EWOULDBLOCK
  ------------------
  |  Branch (1576:7): [True: 3.25M, False: 0]
  ------------------
 1577|      0|      (EAGAIN == sockerr) || (SOCKEINTR == sockerr)
  ------------------
  |  | 1129|      0|#define SOCKEINTR         EINTR
  ------------------
  |  Branch (1577:7): [True: 0, False: 0]
  |  Branch (1577:30): [True: 0, False: 0]
  ------------------
 1578|  3.25M|#endif
 1579|  3.25M|      ) {
 1580|       |      /* EWOULDBLOCK */
 1581|  3.25M|      result = CURLE_AGAIN;
 1582|  3.25M|    }
 1583|      0|    else {
 1584|      0|      char buffer[STRERROR_LEN];
 1585|      0|      failf(data, "Recv failure: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1586|      0|            curlx_strerror(sockerr, buffer, sizeof(buffer)));
 1587|      0|      data->state.os_errno = sockerr;
 1588|      0|      result = CURLE_RECV_ERROR;
 1589|      0|    }
 1590|  3.25M|  }
 1591|       |
 1592|  4.80M|  CURL_TRC_CF(data, cf, "recv(len=%zu) -> %d, %zu", len, result, *pnread);
  ------------------
  |  |  153|  4.80M|  do {                                          \
  |  |  154|  4.80M|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  4.80M|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  9.61M|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 4.80M, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4.80M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  9.61M|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  4.80M|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  4.80M|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  4.80M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 4.80M]
  |  |  ------------------
  ------------------
 1593|  4.80M|  if(!result && !ctx->got_first_byte) {
  ------------------
  |  Branch (1593:6): [True: 1.55M, False: 3.25M]
  |  Branch (1593:17): [True: 12.5k, False: 1.53M]
  ------------------
 1594|  12.5k|    ctx->first_byte_at = *Curl_pgrs_now(data);
 1595|       |    ctx->got_first_byte = TRUE;
  ------------------
  |  | 1055|  12.5k|#define TRUE true
  ------------------
 1596|  12.5k|  }
 1597|  4.80M|  return result;
 1598|  4.80M|}
cf-socket.c:cf_socket_cntrl:
 1629|  3.01M|{
 1630|  3.01M|  struct cf_socket_ctx *ctx = cf->ctx;
 1631|       |
 1632|  3.01M|  (void)arg1;
 1633|  3.01M|  (void)arg2;
 1634|  3.01M|  switch(event) {
  ------------------
  |  Branch (1634:10): [True: 10.8k, False: 3.00M]
  ------------------
 1635|  10.7k|  case CF_CTRL_CONN_INFO_UPDATE:
  ------------------
  |  |  125|  10.7k|#define CF_CTRL_CONN_INFO_UPDATE (256 + 0) /* 0          NULL     ignored */
  ------------------
  |  Branch (1635:3): [True: 10.7k, False: 3.00M]
  ------------------
 1636|  10.7k|    cf_socket_active(cf, data);
 1637|  10.7k|    cf_socket_update_data(cf, data);
 1638|  10.7k|    break;
 1639|    109|  case CF_CTRL_DATA_SETUP:
  ------------------
  |  |  119|    109|#define CF_CTRL_DATA_SETUP              4  /* 0          NULL     first fail */
  ------------------
  |  Branch (1639:3): [True: 109, False: 3.01M]
  ------------------
 1640|    109|    cf_socket_update_data(cf, data);
 1641|    109|    break;
 1642|      0|  case CF_CTRL_FORGET_SOCKET:
  ------------------
  |  |  126|      0|#define CF_CTRL_FORGET_SOCKET    (256 + 1) /* 0          NULL     ignored */
  ------------------
  |  Branch (1642:3): [True: 0, False: 3.01M]
  ------------------
 1643|      0|    ctx->sock = CURL_SOCKET_BAD;
  ------------------
  |  |  145|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
 1644|      0|    break;
 1645|  3.01M|  }
 1646|  3.01M|  return CURLE_OK;
 1647|  3.01M|}
cf-socket.c:cf_socket_active:
 1613|  10.7k|{
 1614|  10.7k|  struct cf_socket_ctx *ctx = cf->ctx;
 1615|       |
 1616|       |  /* use this socket from now on */
 1617|  10.7k|  cf->conn->sock[cf->sockindex] = ctx->sock;
 1618|  10.7k|  set_local_ip(cf, data);
 1619|  10.7k|#ifdef USE_IPV6
 1620|  10.7k|  if(cf->sockindex == FIRSTSOCKET)
  ------------------
  |  |  303|  10.7k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (1620:6): [True: 9.80k, False: 902]
  ------------------
 1621|  9.80k|    cf->conn->bits.ipv6 = (ctx->addr.family == AF_INET6);
 1622|  10.7k|#endif
 1623|       |  ctx->active = TRUE;
  ------------------
  |  | 1055|  10.7k|#define TRUE true
  ------------------
 1624|  10.7k|}
cf-socket.c:cf_socket_update_data:
 1602|  10.8k|{
 1603|       |  /* Update the IP info held in the transfer, if we have that. */
 1604|  10.8k|  if(cf->connected && (cf->sockindex == FIRSTSOCKET)) {
  ------------------
  |  |  303|  10.8k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (1604:6): [True: 10.8k, False: 0]
  |  Branch (1604:23): [True: 9.90k, False: 902]
  ------------------
 1605|  9.90k|    struct cf_socket_ctx *ctx = cf->ctx;
 1606|  9.90k|    data->info.primary = ctx->ip;
 1607|       |    /* not sure if this is redundant... */
 1608|  9.90k|    data->info.conn_remote_port = cf->conn->origin->port;
 1609|  9.90k|  }
 1610|  10.8k|}
cf-socket.c:cf_socket_conn_is_alive:
 1652|    416|{
 1653|    416|  struct cf_socket_ctx *ctx = cf->ctx;
 1654|    416|  struct pollfd pfd[1];
 1655|    416|  int r;
 1656|       |
 1657|    416|  *input_pending = FALSE;
  ------------------
  |  | 1058|    416|#define FALSE false
  ------------------
 1658|       |
 1659|    416|  if(!ctx || ctx->sock == CURL_SOCKET_BAD)
  ------------------
  |  |  145|    416|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1659:6): [True: 0, False: 416]
  |  Branch (1659:14): [True: 0, False: 416]
  ------------------
 1660|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1661|       |
 1662|       |  /* Check with 0 timeout if there are any events pending on the socket */
 1663|    416|  pfd[0].fd = ctx->sock;
 1664|    416|  pfd[0].events = POLLRDNORM | POLLIN | POLLRDBAND | POLLPRI;
 1665|    416|  pfd[0].revents = 0;
 1666|       |
 1667|    416|  r = Curl_poll(pfd, 1, 0);
 1668|    416|  if(r < 0) {
  ------------------
  |  Branch (1668:6): [True: 0, False: 416]
  ------------------
 1669|      0|    CURL_TRC_CF(data, cf, "is_alive: poll error, assume dead");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1670|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1671|      0|  }
 1672|    416|  else if(r == 0) {
  ------------------
  |  Branch (1672:11): [True: 109, False: 307]
  ------------------
 1673|    109|    CURL_TRC_CF(data, cf, "is_alive: poll timeout, assume alive");
  ------------------
  |  |  153|    109|  do {                                          \
  |  |  154|    109|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    109|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    218|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 109, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 109]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    218|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    109|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    109|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    109|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 109]
  |  |  ------------------
  ------------------
 1674|    109|    return TRUE;
  ------------------
  |  | 1055|    109|#define TRUE true
  ------------------
 1675|    109|  }
 1676|    307|  else if(pfd[0].revents & (POLLERR | POLLHUP | POLLPRI | POLLNVAL)) {
  ------------------
  |  Branch (1676:11): [True: 0, False: 307]
  ------------------
 1677|      0|    CURL_TRC_CF(data, cf, "is_alive: err/hup/etc events, assume dead");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1678|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1679|      0|  }
 1680|       |
 1681|    307|  CURL_TRC_CF(data, cf, "is_alive: valid events, looks alive");
  ------------------
  |  |  153|    307|  do {                                          \
  |  |  154|    307|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    307|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    614|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 307, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 307]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    614|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    307|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    307|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    307|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 307]
  |  |  ------------------
  ------------------
 1682|    307|  *input_pending = TRUE;
  ------------------
  |  | 1055|    307|#define TRUE true
  ------------------
 1683|       |  return TRUE;
  ------------------
  |  | 1055|    307|#define TRUE true
  ------------------
 1684|    416|}
cf-socket.c:cf_socket_query:
 1689|  3.45M|{
 1690|  3.45M|  struct cf_socket_ctx *ctx = cf->ctx;
 1691|       |
 1692|  3.45M|  switch(query) {
 1693|  3.33M|  case CF_QUERY_SOCKET:
  ------------------
  |  |  167|  3.33M|#define CF_QUERY_SOCKET             3  /* -          curl_socket_t */
  ------------------
  |  Branch (1693:3): [True: 3.33M, False: 128k]
  ------------------
 1694|  3.33M|    DEBUGASSERT(pres2);
  ------------------
  |  | 1081|  3.33M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1694:5): [True: 0, False: 3.33M]
  |  Branch (1694:5): [True: 3.33M, False: 0]
  ------------------
 1695|  3.33M|    *((curl_socket_t *)pres2) = ctx->sock;
 1696|  3.33M|    return CURLE_OK;
 1697|     16|  case CF_QUERY_TRANSPORT:
  ------------------
  |  |  180|     16|#define CF_QUERY_TRANSPORT         14  /* TRNSPRT_*  - * */
  ------------------
  |  Branch (1697:3): [True: 16, False: 3.45M]
  ------------------
 1698|     16|    DEBUGASSERT(pres1);
  ------------------
  |  | 1081|     16|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1698:5): [True: 0, False: 16]
  |  Branch (1698:5): [True: 16, False: 0]
  ------------------
 1699|     16|    *pres1 = ctx->transport;
 1700|     16|    return CURLE_OK;
 1701|     12|  case CF_QUERY_REMOTE_ADDR:
  ------------------
  |  |  176|     12|#define CF_QUERY_REMOTE_ADDR       10  /* -          `Curl_sockaddr_ex *` */
  ------------------
  |  Branch (1701:3): [True: 12, False: 3.45M]
  ------------------
 1702|     12|    DEBUGASSERT(pres2);
  ------------------
  |  | 1081|     12|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1702:5): [True: 0, False: 12]
  |  Branch (1702:5): [True: 12, False: 0]
  ------------------
 1703|     12|    *((const struct Curl_sockaddr_ex **)pres2) = cf->connected ?
  ------------------
  |  Branch (1703:50): [True: 12, False: 0]
  ------------------
 1704|     12|                                                 &ctx->addr : NULL;
 1705|     12|    return CURLE_OK;
 1706|      0|  case CF_QUERY_CONNECT_REPLY_MS:
  ------------------
  |  |  166|      0|#define CF_QUERY_CONNECT_REPLY_MS   2  /* number     -        */
  ------------------
  |  Branch (1706:3): [True: 0, False: 3.45M]
  ------------------
 1707|      0|    if(ctx->got_first_byte) {
  ------------------
  |  Branch (1707:8): [True: 0, False: 0]
  ------------------
 1708|      0|      timediff_t ms = curlx_ptimediff_ms(&ctx->first_byte_at,
 1709|      0|                                         &ctx->started_at);
 1710|      0|      *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX;
  ------------------
  |  Branch (1710:16): [True: 0, False: 0]
  ------------------
 1711|      0|    }
 1712|      0|    else
 1713|      0|      *pres1 = -1;
 1714|      0|    return CURLE_OK;
 1715|  13.8k|  case CF_QUERY_TIMER_CONNECT: {
  ------------------
  |  |  168|  13.8k|#define CF_QUERY_TIMER_CONNECT      4  /* -          struct curltime */
  ------------------
  |  Branch (1715:3): [True: 13.8k, False: 3.44M]
  ------------------
 1716|  13.8k|    struct curltime *when = pres2;
 1717|  13.8k|    switch(ctx->transport) {
 1718|      0|    case TRNSPRT_UDP:
  ------------------
  |  |  308|      0|#define TRNSPRT_UDP  4
  ------------------
  |  Branch (1718:5): [True: 0, False: 13.8k]
  ------------------
 1719|      0|    case TRNSPRT_QUIC:
  ------------------
  |  |  309|      0|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (1719:5): [True: 0, False: 13.8k]
  ------------------
 1720|       |      /* Since UDP connected sockets work different from TCP, we use the
 1721|       |       * time of the first byte from the peer as the "connect" time. */
 1722|      0|      if(ctx->got_first_byte) {
  ------------------
  |  Branch (1722:10): [True: 0, False: 0]
  ------------------
 1723|      0|        *when = ctx->first_byte_at;
 1724|      0|        break;
 1725|      0|      }
 1726|      0|      FALLTHROUGH();
  ------------------
  |  |  821|      0|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
 1727|  13.8k|    default:
  ------------------
  |  Branch (1727:5): [True: 13.8k, False: 0]
  ------------------
 1728|  13.8k|      *when = ctx->connected_at;
 1729|  13.8k|      break;
 1730|  13.8k|    }
 1731|  13.8k|    return CURLE_OK;
 1732|  13.8k|  }
 1733|  1.10k|  case CF_QUERY_IP_INFO:
  ------------------
  |  |  172|  1.10k|#define CF_QUERY_IP_INFO            8  /* TRUE/FALSE struct ip_quadruple */
  ------------------
  |  Branch (1733:3): [True: 1.10k, False: 3.45M]
  ------------------
 1734|  1.10k|#ifdef USE_IPV6
 1735|  1.10k|    *pres1 = (ctx->addr.family == AF_INET6);
 1736|       |#else
 1737|       |    *pres1 = FALSE;
 1738|       |#endif
 1739|  1.10k|    *(struct ip_quadruple *)pres2 = ctx->ip;
 1740|  1.10k|    return CURLE_OK;
 1741|   113k|  default:
  ------------------
  |  Branch (1741:3): [True: 113k, False: 3.34M]
  ------------------
 1742|   113k|    break;
 1743|  3.45M|  }
 1744|   113k|  return cf->next ?
  ------------------
  |  Branch (1744:10): [True: 0, False: 113k]
  ------------------
 1745|      0|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
 1746|   113k|    CURLE_UNKNOWN_OPTION;
 1747|  3.45M|}
cf-socket.c:cf_socket_ctx_init:
  937|  14.0k|{
  938|  14.0k|  memset(ctx, 0, sizeof(*ctx));
  939|  14.0k|  ctx->sock = CURL_SOCKET_BAD;
  ------------------
  |  |  145|  14.0k|#define CURL_SOCKET_BAD (-1)
  ------------------
  940|  14.0k|  ctx->transport = transport;
  941|  14.0k|  ctx->addr = *addr;
  942|       |
  943|  14.0k|#ifdef DEBUGBUILD
  944|  14.0k|  {
  945|  14.0k|    const char *p = getenv("CURL_DBG_SOCK_WBLOCK");
  946|  14.0k|    if(p) {
  ------------------
  |  Branch (946:8): [True: 0, False: 14.0k]
  ------------------
  947|      0|      curl_off_t l;
  948|      0|      if(!curlx_str_number(&p, &l, 100))
  ------------------
  |  Branch (948:10): [True: 0, False: 0]
  ------------------
  949|      0|        ctx->wblock_percent = (int)l;
  950|      0|    }
  951|  14.0k|    p = getenv("CURL_DBG_SOCK_WPARTIAL");
  952|  14.0k|    if(p) {
  ------------------
  |  Branch (952:8): [True: 0, False: 14.0k]
  ------------------
  953|      0|      curl_off_t l;
  954|      0|      if(!curlx_str_number(&p, &l, 100))
  ------------------
  |  Branch (954:10): [True: 0, False: 0]
  ------------------
  955|      0|        ctx->wpartial_percent = (int)l;
  956|      0|    }
  957|  14.0k|    p = getenv("CURL_DBG_SOCK_RBLOCK");
  958|  14.0k|    if(p) {
  ------------------
  |  Branch (958:8): [True: 0, False: 14.0k]
  ------------------
  959|      0|      curl_off_t l;
  960|      0|      if(!curlx_str_number(&p, &l, 100))
  ------------------
  |  Branch (960:10): [True: 0, False: 0]
  ------------------
  961|      0|        ctx->rblock_percent = (int)l;
  962|      0|    }
  963|  14.0k|    p = getenv("CURL_DBG_SOCK_RMAX");
  964|  14.0k|    if(p) {
  ------------------
  |  Branch (964:8): [True: 0, False: 14.0k]
  ------------------
  965|      0|      curl_off_t l;
  966|      0|      if(!curlx_str_number(&p, &l, CURL_OFF_T_MAX))
  ------------------
  |  |  594|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (966:10): [True: 0, False: 0]
  ------------------
  967|      0|        ctx->recv_max = (size_t)l;
  968|      0|    }
  969|  14.0k|  }
  970|  14.0k|#endif
  971|       |
  972|  14.0k|  return CURLE_OK;
  973|  14.0k|}
cf-socket.c:set_local_ip:
 1027|  24.7k|{
 1028|  24.7k|  struct cf_socket_ctx *ctx = cf->ctx;
 1029|  24.7k|  ctx->ip.local_ip[0] = 0;
 1030|  24.7k|  ctx->ip.local_port = 0;
 1031|       |
 1032|  24.7k|#ifdef HAVE_GETSOCKNAME
 1033|  24.7k|  if((ctx->sock != CURL_SOCKET_BAD) &&
  ------------------
  |  |  145|  24.7k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1033:6): [True: 24.6k, False: 165]
  ------------------
 1034|  24.6k|     !(data->conn->scheme->protocol & CURLPROTO_TFTP)) {
  ------------------
  |  | 1089|  24.6k|#define CURLPROTO_TFTP    (1L << 11)
  ------------------
  |  Branch (1034:6): [True: 24.6k, False: 0]
  ------------------
 1035|       |    /* TFTP does not connect, so it cannot get the IP like this */
 1036|  24.6k|    struct Curl_sockaddr_storage ssloc;
 1037|  24.6k|    curl_socklen_t slen = sizeof(struct Curl_sockaddr_storage);
 1038|  24.6k|    VERBOSE(char buffer[STRERROR_LEN]);
  ------------------
  |  | 1618|  24.6k|#define VERBOSE(x) x
  ------------------
 1039|       |
 1040|  24.6k|    memset(&ssloc, 0, sizeof(ssloc));
 1041|  24.6k|    if(getsockname(ctx->sock, (struct sockaddr *)&ssloc, &slen)) {
  ------------------
  |  Branch (1041:8): [True: 0, False: 24.6k]
  ------------------
 1042|      0|      VERBOSE(int error = SOCKERRNO);
  ------------------
  |  | 1618|      0|#define VERBOSE(x) x
  ------------------
 1043|      0|      infof(data, "getsockname() failed with errno %d: %s",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1044|      0|            error, curlx_strerror(error, buffer, sizeof(buffer)));
 1045|      0|    }
 1046|  24.6k|    else if(!Curl_addr2string((struct sockaddr *)&ssloc, slen,
  ------------------
  |  Branch (1046:13): [True: 0, False: 24.6k]
  ------------------
 1047|  24.6k|                              ctx->ip.local_ip, &ctx->ip.local_port)) {
 1048|      0|      infof(data, "ssloc inet_ntop() failed with errno %d: %s",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1049|      0|            errno, curlx_strerror(errno, buffer, sizeof(buffer)));
 1050|      0|    }
 1051|  24.6k|  }
 1052|       |#else
 1053|       |  (void)data;
 1054|       |#endif
 1055|  24.7k|}

Curl_cf_def_shutdown:
   49|  2.23k|{
   50|  2.23k|  (void)cf;
   51|  2.23k|  (void)data;
   52|       |  *done = TRUE;
  ------------------
  |  | 1055|  2.23k|#define TRUE true
  ------------------
   53|  2.23k|  return CURLE_OK;
   54|  2.23k|}
Curl_cf_def_adjust_pollset:
   59|  58.1k|{
   60|       |  /* NOP */
   61|  58.1k|  (void)cf;
   62|  58.1k|  (void)data;
   63|  58.1k|  (void)ps;
   64|  58.1k|  return CURLE_OK;
   65|  58.1k|}
Curl_cf_def_data_pending:
   69|  6.71M|{
   70|  6.71M|  return cf->next ?
  ------------------
  |  Branch (70:10): [True: 165, False: 6.71M]
  ------------------
   71|    165|    cf->next->cft->has_data_pending(cf->next, data) : FALSE;
  ------------------
  |  | 1058|  6.71M|#define FALSE false
  ------------------
   72|  6.71M|}
Curl_cf_def_send:
   77|  25.6k|{
   78|  25.6k|  if(cf->next)
  ------------------
  |  Branch (78:6): [True: 25.6k, False: 0]
  ------------------
   79|  25.6k|    return cf->next->cft->do_send(cf->next, data, buf, len, eos, pnwritten);
   80|      0|  *pnwritten = 0;
   81|      0|  return CURLE_RECV_ERROR;
   82|  25.6k|}
Curl_cf_def_recv:
   86|  4.80M|{
   87|  4.80M|  if(cf->next)
  ------------------
  |  Branch (87:6): [True: 4.80M, False: 0]
  ------------------
   88|  4.80M|    return cf->next->cft->do_recv(cf->next, data, buf, len, pnread);
   89|      0|  *pnread = 0;
   90|      0|  return CURLE_SEND_ERROR;
   91|  4.80M|}
Curl_cf_def_conn_is_alive:
   96|    314|{
   97|    314|  return cf->next ?
  ------------------
  |  Branch (97:10): [True: 314, False: 0]
  ------------------
   98|    314|    cf->next->cft->is_alive(cf->next, data, input_pending) :
   99|       |    FALSE; /* pessimistic in absence of data */
  ------------------
  |  | 1058|    314|#define FALSE false
  ------------------
  100|    314|}
Curl_cf_def_query:
  113|  1.02M|{
  114|  1.02M|  return cf->next ?
  ------------------
  |  Branch (114:10): [True: 949k, False: 73.6k]
  ------------------
  115|   949k|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
  116|  1.02M|    CURLE_UNKNOWN_OPTION;
  117|  1.02M|}
Curl_conn_trc_filters:
  122|   270k|{
  123|   270k|  if(CURL_TRC_M_is_verbose(data) && data->conn) {
  ------------------
  |  |  135|   270k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  ------------------
  |  |  |  |  326|   541k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|   541k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 270k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 270k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|   541k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|   541k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (123:37): [True: 0, False: 0]
  ------------------
  124|      0|    struct Curl_cfilter *cf = data->conn->cfilter[sockindex];
  125|       |
  126|      0|    if(cf) {
  ------------------
  |  Branch (126:8): [True: 0, False: 0]
  ------------------
  127|      0|      char msg[256], *buf;
  128|      0|      int blen, n;
  129|       |
  130|      0|      buf = msg;
  131|      0|      blen = sizeof(msg) - 1;
  132|      0|      n = curl_msnprintf(buf, blen, "%s [%d]", info, sockindex);
  133|      0|      buf += n;
  134|      0|      blen -= n;
  135|      0|      for(; cf && blen; cf = cf->next) {
  ------------------
  |  Branch (135:13): [True: 0, False: 0]
  |  Branch (135:19): [True: 0, False: 0]
  ------------------
  136|      0|        n = curl_msnprintf(buf, blen, "[%s%s]",
  137|      0|                           cf->connected ? "" : "!", cf->cft->name);
  ------------------
  |  Branch (137:28): [True: 0, False: 0]
  ------------------
  138|      0|        buf += n;
  139|      0|        blen -= n;
  140|      0|      }
  141|      0|      CURL_TRC_M(data, "%s%s", msg, blen ? "" : "...");
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  142|      0|    }
  143|      0|    else
  144|      0|      CURL_TRC_M(data, "%s [%d][-]", info, sockindex);
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  145|      0|  }
  146|   270k|}
Curl_conn_cf_discard_chain:
  151|  41.8k|{
  152|  41.8k|  struct Curl_cfilter *cfn, *cf = *pcf;
  153|       |
  154|  41.8k|  if(cf) {
  ------------------
  |  Branch (154:6): [True: 23.4k, False: 18.4k]
  ------------------
  155|  23.4k|    *pcf = NULL;
  156|  68.7k|    while(cf) {
  ------------------
  |  Branch (156:11): [True: 45.2k, False: 23.4k]
  ------------------
  157|  45.2k|      cfn = cf->next;
  158|       |      /* prevent destroying filter to mess with its sub-chain, since
  159|       |       * we have the reference now and will call destroy on it.
  160|       |       */
  161|  45.2k|      cf->next = NULL;
  162|  45.2k|      cf->cft->destroy(cf, data);
  163|  45.2k|      curlx_free(cf);
  ------------------
  |  | 1483|  45.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  164|  45.2k|      cf = cfn;
  165|  45.2k|    }
  166|  23.4k|  }
  167|  41.8k|}
Curl_conn_cf_discard_all:
  171|  33.1k|{
  172|  33.1k|  Curl_conn_cf_discard_chain(&conn->cfilter[sockindex], data);
  173|  33.1k|}
Curl_conn_close:
  176|  29.5k|{
  177|  29.5k|  struct Curl_cfilter *cf;
  178|       |
  179|  29.5k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|  29.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (179:3): [True: 0, False: 29.5k]
  |  Branch (179:3): [True: 29.5k, False: 0]
  ------------------
  180|       |  /* it is valid to call that without filters being present */
  181|  29.5k|  cf = data->conn->cfilter[sockindex];
  182|  29.5k|  if(cf) {
  ------------------
  |  Branch (182:6): [True: 14.7k, False: 14.8k]
  ------------------
  183|  14.7k|    cf->cft->do_close(cf, data);
  184|  14.7k|  }
  185|  29.5k|  Curl_shutdown_clear(data, sockindex);
  186|  29.5k|}
Curl_conn_shutdown:
  189|  4.37k|{
  190|  4.37k|  struct Curl_cfilter *cf;
  191|  4.37k|  CURLcode result = CURLE_OK;
  192|  4.37k|  timediff_t timeout_ms;
  193|       |
  194|  4.37k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|  4.37k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (194:3): [True: 0, False: 4.37k]
  |  Branch (194:3): [True: 4.37k, False: 0]
  ------------------
  195|       |
  196|  4.37k|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  382|  4.37k|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 4.37k, False: 0]
  |  |  |  Branch (382:50): [True: 4.37k, False: 0]
  |  |  ------------------
  ------------------
  197|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  198|       |
  199|       |  /* Get the first connected filter that is not shut down already. */
  200|  4.37k|  cf = data->conn->cfilter[sockindex];
  201|  4.37k|  while(cf && (!cf->connected || cf->shutdown))
  ------------------
  |  Branch (201:9): [True: 4.37k, False: 0]
  |  Branch (201:16): [True: 0, False: 4.37k]
  |  Branch (201:34): [True: 0, False: 4.37k]
  ------------------
  202|      0|    cf = cf->next;
  203|       |
  204|  4.37k|  if(!cf) {
  ------------------
  |  Branch (204:6): [True: 0, False: 4.37k]
  ------------------
  205|      0|    *done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  206|      0|    return CURLE_OK;
  207|      0|  }
  208|       |
  209|  4.37k|  *done = FALSE;
  ------------------
  |  | 1058|  4.37k|#define FALSE false
  ------------------
  210|  4.37k|  if(!Curl_shutdown_started(data, sockindex)) {
  ------------------
  |  Branch (210:6): [True: 655, False: 3.71k]
  ------------------
  211|    655|    Curl_shutdown_start(data, sockindex, 0);
  212|    655|  }
  213|  3.71k|  else {
  214|  3.71k|    timeout_ms = Curl_shutdown_timeleft(data, data->conn, sockindex);
  215|  3.71k|    if(timeout_ms < 0) {
  ------------------
  |  Branch (215:8): [True: 0, False: 3.71k]
  ------------------
  216|       |      /* info message, since this might be regarded as acceptable */
  217|      0|      infof(data, "shutdown timeout");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  218|      0|      return CURLE_OPERATION_TIMEDOUT;
  219|      0|    }
  220|  3.71k|  }
  221|       |
  222|  12.3k|  while(cf) {
  ------------------
  |  Branch (222:9): [True: 8.00k, False: 4.37k]
  ------------------
  223|  8.00k|    if(!cf->shutdown) {
  ------------------
  |  Branch (223:8): [True: 8.00k, False: 0]
  ------------------
  224|  8.00k|      bool cfdone = FALSE;
  ------------------
  |  | 1058|  8.00k|#define FALSE false
  ------------------
  225|  8.00k|      result = cf->cft->do_shutdown(cf, data, &cfdone);
  226|  8.00k|      if(result) {
  ------------------
  |  Branch (226:10): [True: 0, False: 8.00k]
  ------------------
  227|      0|        CURL_TRC_CF(data, cf, "shut down failed with %d", result);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  228|      0|        return result;
  229|      0|      }
  230|  8.00k|      else if(!cfdone) {
  ------------------
  |  Branch (230:15): [True: 0, False: 8.00k]
  ------------------
  231|      0|        CURL_TRC_CF(data, cf, "shut down not done yet");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  232|      0|        return CURLE_OK;
  233|      0|      }
  234|  8.00k|      CURL_TRC_CF(data, cf, "shut down successfully");
  ------------------
  |  |  153|  8.00k|  do {                                          \
  |  |  154|  8.00k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  8.00k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  16.0k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 8.00k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 8.00k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  16.0k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  8.00k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  8.00k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  8.00k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 8.00k]
  |  |  ------------------
  ------------------
  235|  8.00k|      cf->shutdown = TRUE;
  ------------------
  |  | 1055|  8.00k|#define TRUE true
  ------------------
  236|  8.00k|    }
  237|  8.00k|    cf = cf->next;
  238|  8.00k|  }
  239|  4.37k|  *done = (!result);
  240|  4.37k|  return result;
  241|  4.37k|}
Curl_cf_recv:
  245|  4.80M|{
  246|  4.80M|  struct Curl_cfilter *cf;
  247|       |
  248|  4.80M|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  4.80M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (248:3): [True: 0, False: 4.80M]
  |  Branch (248:3): [True: 4.80M, False: 0]
  ------------------
  249|  4.80M|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|  4.80M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (249:3): [True: 0, False: 4.80M]
  |  Branch (249:3): [True: 4.80M, False: 0]
  ------------------
  250|  4.80M|  cf = data->conn->cfilter[sockindex];
  251|  10.5M|  while(cf && !cf->connected)
  ------------------
  |  Branch (251:9): [True: 10.5M, False: 0]
  |  Branch (251:15): [True: 5.75M, False: 4.80M]
  ------------------
  252|  5.75M|    cf = cf->next;
  253|  4.80M|  if(cf)
  ------------------
  |  Branch (253:6): [True: 4.80M, False: 0]
  ------------------
  254|  4.80M|    return cf->cft->do_recv(cf, data, buf, len, pnread);
  255|      0|  failf(data, "recv: no filter connected");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  256|      0|  DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (256:3): [Folded, False: 0]
  |  Branch (256:3): [Folded, False: 0]
  ------------------
  257|      0|  *pnread = 0;
  258|      0|  return CURLE_FAILED_INIT;
  259|      0|}
Curl_cf_send:
  264|   287k|{
  265|   287k|  struct Curl_cfilter *cf;
  266|       |
  267|   287k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|   287k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (267:3): [True: 0, False: 287k]
  |  Branch (267:3): [True: 287k, False: 0]
  ------------------
  268|   287k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|   287k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (268:3): [True: 0, False: 287k]
  |  Branch (268:3): [True: 287k, False: 0]
  ------------------
  269|   287k|  cf = data->conn->cfilter[sockindex];
  270|   287k|  while(cf && !cf->connected)
  ------------------
  |  Branch (270:9): [True: 287k, False: 0]
  |  Branch (270:15): [True: 0, False: 287k]
  ------------------
  271|      0|    cf = cf->next;
  272|   287k|  if(cf) {
  ------------------
  |  Branch (272:6): [True: 287k, False: 0]
  ------------------
  273|   287k|    return cf->cft->do_send(cf, data, buf, len, eos, pnwritten);
  274|   287k|  }
  275|      0|  failf(data, "send: no filter connected");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  276|      0|  DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (276:3): [Folded, False: 0]
  |  Branch (276:3): [Folded, False: 0]
  ------------------
  277|      0|  *pnwritten = 0;
  278|      0|  return CURLE_FAILED_INIT;
  279|      0|}
Curl_cf_recv_bufq:
  299|  3.26M|{
  300|  3.26M|  struct cf_io_ctx io;
  301|       |
  302|  3.26M|  if(!cf || !data) {
  ------------------
  |  Branch (302:6): [True: 0, False: 3.26M]
  |  Branch (302:13): [True: 0, False: 3.26M]
  ------------------
  303|      0|    *pnread = 0;
  304|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  305|      0|  }
  306|  3.26M|  io.data = data;
  307|  3.26M|  io.cf = cf;
  308|  3.26M|  return Curl_bufq_sipn(bufq, maxlen, cf_bufq_reader, &io, pnread);
  309|  3.26M|}
Curl_cf_send_bufq:
  324|  26.2k|{
  325|  26.2k|  struct cf_io_ctx io;
  326|       |
  327|  26.2k|  if(!cf || !data) {
  ------------------
  |  Branch (327:6): [True: 0, False: 26.2k]
  |  Branch (327:13): [True: 0, False: 26.2k]
  ------------------
  328|      0|    *pnwritten = 0;
  329|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  330|      0|  }
  331|  26.2k|  io.data = data;
  332|  26.2k|  io.cf = cf;
  333|  26.2k|  if(buf && blen)
  ------------------
  |  Branch (333:6): [True: 14.8k, False: 11.3k]
  |  Branch (333:13): [True: 14.8k, False: 0]
  ------------------
  334|  14.8k|    return Curl_bufq_write_pass(bufq, buf, blen, cf_bufq_writer, &io,
  335|  14.8k|                                pnwritten);
  336|  11.3k|  else
  337|  11.3k|    return Curl_bufq_pass(bufq, cf_bufq_writer, &io, pnwritten);
  338|  26.2k|}
Curl_cf_create:
  343|  81.4k|{
  344|  81.4k|  struct Curl_cfilter *cf;
  345|  81.4k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  346|       |
  347|  81.4k|  DEBUGASSERT(cft);
  ------------------
  |  | 1081|  81.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (347:3): [True: 0, False: 81.4k]
  |  Branch (347:3): [True: 81.4k, False: 0]
  ------------------
  348|  81.4k|  cf = curlx_calloc(1, sizeof(*cf));
  ------------------
  |  | 1480|  81.4k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  349|  81.4k|  if(!cf)
  ------------------
  |  Branch (349:6): [True: 0, False: 81.4k]
  ------------------
  350|      0|    goto out;
  351|       |
  352|  81.4k|  cf->cft = cft;
  353|  81.4k|  cf->ctx = ctx;
  354|  81.4k|  result = CURLE_OK;
  355|  81.4k|out:
  356|  81.4k|  *pcf = cf;
  357|  81.4k|  return result;
  358|  81.4k|}
Curl_conn_cf_add:
  364|  33.9k|{
  365|  33.9k|  DEBUGASSERT(conn);
  ------------------
  |  | 1081|  33.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (365:3): [True: 0, False: 33.9k]
  |  Branch (365:3): [True: 33.9k, False: 0]
  ------------------
  366|  33.9k|  DEBUGASSERT(!cf->conn);
  ------------------
  |  | 1081|  33.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (366:3): [True: 0, False: 33.9k]
  |  Branch (366:3): [True: 33.9k, False: 0]
  ------------------
  367|  33.9k|  DEBUGASSERT(!cf->next);
  ------------------
  |  | 1081|  33.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (367:3): [True: 0, False: 33.9k]
  |  Branch (367:3): [True: 33.9k, False: 0]
  ------------------
  368|       |
  369|  33.9k|  cf->next = conn->cfilter[sockindex];
  370|  33.9k|  cf->conn = conn;
  371|  33.9k|  cf->sockindex = sockindex;
  372|  33.9k|  conn->cfilter[sockindex] = cf;
  373|  33.9k|  CURL_TRC_CF(data, cf, "added");
  ------------------
  |  |  153|  33.9k|  do {                                          \
  |  |  154|  33.9k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  33.9k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  67.8k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 33.9k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 33.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  67.8k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  33.9k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  33.9k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  33.9k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 33.9k]
  |  |  ------------------
  ------------------
  374|  33.9k|}
Curl_conn_cf_insert_after:
  378|  33.4k|{
  379|  33.4k|  struct Curl_cfilter *tail, **pnext;
  380|       |
  381|  33.4k|  DEBUGASSERT(cf_at);
  ------------------
  |  | 1081|  33.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (381:3): [True: 0, False: 33.4k]
  |  Branch (381:3): [True: 33.4k, False: 0]
  ------------------
  382|  33.4k|  DEBUGASSERT(cf_new);
  ------------------
  |  | 1081|  33.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (382:3): [True: 0, False: 33.4k]
  |  Branch (382:3): [True: 33.4k, False: 0]
  ------------------
  383|  33.4k|  DEBUGASSERT(!cf_new->conn);
  ------------------
  |  | 1081|  33.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (383:3): [True: 0, False: 33.4k]
  |  Branch (383:3): [True: 33.4k, False: 0]
  ------------------
  384|       |
  385|  33.4k|  tail = cf_at->next;
  386|  33.4k|  cf_at->next = cf_new;
  387|  33.4k|  do {
  388|  33.4k|    cf_new->conn = cf_at->conn;
  389|  33.4k|    cf_new->sockindex = cf_at->sockindex;
  390|  33.4k|    pnext = &cf_new->next;
  391|  33.4k|    cf_new = cf_new->next;
  392|  33.4k|  } while(cf_new);
  ------------------
  |  Branch (392:11): [True: 0, False: 33.4k]
  ------------------
  393|  33.4k|  *pnext = tail;
  394|  33.4k|}
Curl_conn_cf_connect:
  423|   512k|{
  424|   512k|  if(cf)
  ------------------
  |  Branch (424:6): [True: 512k, False: 0]
  ------------------
  425|   512k|    return cf->cft->do_connect(cf, data, done);
  426|      0|  return CURLE_FAILED_INIT;
  427|   512k|}
Curl_conn_cf_close:
  430|     99|{
  431|     99|  if(cf)
  ------------------
  |  Branch (431:6): [True: 99, False: 0]
  ------------------
  432|     99|    cf->cft->do_close(cf, data);
  433|     99|}
Curl_conn_cf_send:
  438|  15.1k|{
  439|  15.1k|  if(cf)
  ------------------
  |  Branch (439:6): [True: 15.1k, False: 0]
  ------------------
  440|  15.1k|    return cf->cft->do_send(cf, data, buf, len, eos, pnwritten);
  441|      0|  *pnwritten = 0;
  442|      0|  return CURLE_SEND_ERROR;
  443|  15.1k|}
Curl_conn_cf_recv:
  447|  3.26M|{
  448|  3.26M|  if(cf)
  ------------------
  |  Branch (448:6): [True: 3.26M, False: 0]
  ------------------
  449|  3.26M|    return cf->cft->do_recv(cf, data, buf, len, pnread);
  450|      0|  *pnread = 0;
  451|      0|  return CURLE_RECV_ERROR;
  452|  3.26M|}
Curl_conn_connect:
  544|   319k|{
  545|   319k|#define CF_CONN_NUM_POLLS_ON_STACK 5
  546|   319k|  struct pollfd a_few_on_stack[CF_CONN_NUM_POLLS_ON_STACK];
  547|   319k|  struct easy_pollset ps;
  548|   319k|  struct curl_pollfds cpfds;
  549|   319k|  struct Curl_cfilter *cf;
  550|   319k|  CURLcode result = CURLE_OK;
  551|       |
  552|   319k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|   319k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (552:3): [True: 0, False: 319k]
  |  Branch (552:3): [True: 319k, False: 0]
  ------------------
  553|   319k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|   319k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (553:3): [True: 0, False: 319k]
  |  Branch (553:3): [True: 319k, False: 0]
  ------------------
  554|   319k|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  382|   319k|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 319k, False: 0]
  |  |  |  Branch (382:50): [True: 319k, False: 0]
  |  |  ------------------
  ------------------
  555|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  556|       |
  557|   319k|  if(data->conn->scheme->flags & PROTOPT_NONETWORK) {
  ------------------
  |  |  215|   319k|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (557:6): [True: 0, False: 319k]
  ------------------
  558|      0|    *done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  559|      0|    return CURLE_OK;
  560|      0|  }
  561|       |
  562|   319k|  cf = data->conn->cfilter[sockindex];
  563|   319k|  if(!cf) {
  ------------------
  |  Branch (563:6): [True: 0, False: 319k]
  ------------------
  564|      0|    *done = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  565|      0|    return CURLE_FAILED_INIT;
  566|      0|  }
  567|       |
  568|   319k|  *done = (bool)cf->connected;
  569|   319k|  if(*done)
  ------------------
  |  Branch (569:6): [True: 2.29k, False: 317k]
  ------------------
  570|  2.29k|    return CURLE_OK;
  571|       |
  572|   317k|  Curl_pollset_init(&ps);
  573|   317k|  Curl_pollfds_init(&cpfds, a_few_on_stack, CF_CONN_NUM_POLLS_ON_STACK);
  ------------------
  |  |  545|   317k|#define CF_CONN_NUM_POLLS_ON_STACK 5
  ------------------
  574|   317k|  while(!*done) {
  ------------------
  |  Branch (574:9): [True: 317k, False: 0]
  ------------------
  575|   317k|    if(Curl_conn_needs_flush(data, sockindex)) {
  ------------------
  |  Branch (575:8): [True: 0, False: 317k]
  ------------------
  576|      0|      DEBUGF(infof(data, "Curl_conn_connect(index=%d), flush", sockindex));
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
  577|      0|      result = Curl_conn_flush(data, sockindex);
  578|      0|      if(result && (result != CURLE_AGAIN))
  ------------------
  |  Branch (578:10): [True: 0, False: 0]
  |  Branch (578:20): [True: 0, False: 0]
  ------------------
  579|      0|        return result;
  580|      0|    }
  581|       |
  582|   317k|    result = cf->cft->do_connect(cf, data, done);
  583|   317k|    CURL_TRC_CF(data, cf, "Curl_conn_connect(block=%d) -> %d, done=%d",
  ------------------
  |  |  153|   317k|  do {                                          \
  |  |  154|   317k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|   317k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|   635k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 317k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 317k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|   635k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|   317k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|   317k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|   317k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 317k]
  |  |  ------------------
  ------------------
  584|   317k|                blocking, result, *done);
  585|   317k|    if(!result && *done) {
  ------------------
  |  Branch (585:8): [True: 312k, False: 4.69k]
  |  Branch (585:19): [True: 9.80k, False: 303k]
  ------------------
  586|       |      /* Now that the complete filter chain is connected, let all filters
  587|       |       * persist information at the connection. E.g. cf-socket sets the
  588|       |       * socket and ip related information. */
  589|  9.80k|      cf_cntrl_update_info(data, data->conn);
  590|  9.80k|      conn_report_connect_stats(cf, data);
  591|  9.80k|      data->conn->keepalive = *Curl_pgrs_now(data);
  592|  9.80k|      VERBOSE(result = cf_verboseconnect(data, cf));
  ------------------
  |  | 1618|  9.80k|#define VERBOSE(x) x
  ------------------
  593|  9.80k|      VERBOSE(Curl_conn_trc_filters(data, sockindex, "connected"));
  ------------------
  |  | 1618|  9.80k|#define VERBOSE(x) x
  ------------------
  594|  9.80k|      conn_remove_setup_filters(data, sockindex);
  595|  9.80k|      VERBOSE(Curl_conn_trc_filters(data, sockindex, "reduced to"));
  ------------------
  |  | 1618|  9.80k|#define VERBOSE(x) x
  ------------------
  596|  9.80k|      goto out;
  597|  9.80k|    }
  598|   307k|    else if(result) {
  ------------------
  |  Branch (598:13): [True: 4.69k, False: 303k]
  ------------------
  599|  4.69k|      CURL_TRC_CF(data, cf, "Curl_conn_connect(), filter returned %d", result);
  ------------------
  |  |  153|  4.69k|  do {                                          \
  |  |  154|  4.69k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  4.69k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  9.38k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 4.69k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4.69k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  9.38k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  4.69k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  4.69k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  4.69k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 4.69k]
  |  |  ------------------
  ------------------
  600|  4.69k|      VERBOSE(Curl_conn_trc_filters(data, sockindex, "failed to connect"));
  ------------------
  |  | 1618|  4.69k|#define VERBOSE(x) x
  ------------------
  601|  4.69k|      conn_report_connect_stats(cf, data);
  602|  4.69k|      goto out;
  603|  4.69k|    }
  604|       |
  605|   303k|    if(!blocking)
  ------------------
  |  Branch (605:8): [True: 303k, False: 0]
  ------------------
  606|   303k|      goto out;
  607|      0|    else {
  608|       |      /* check allowed time left */
  609|      0|      const timediff_t timeout_ms = Curl_timeleft_ms(data);
  610|      0|      curl_socket_t sockfd = Curl_conn_cf_get_socket(cf, data);
  611|      0|      int rc;
  612|       |
  613|      0|      if(timeout_ms < 0) {
  ------------------
  |  Branch (613:10): [True: 0, False: 0]
  ------------------
  614|       |        /* no need to continue if time already is up */
  615|      0|        failf(data, "connect timeout");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  616|      0|        result = CURLE_OPERATION_TIMEDOUT;
  617|      0|        goto out;
  618|      0|      }
  619|       |
  620|      0|      CURL_TRC_CF(data, cf, "Curl_conn_connect(block=1), do poll");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  621|      0|      Curl_pollset_reset(&ps);
  622|      0|      Curl_pollfds_reset(&cpfds);
  623|       |      /* In general, we want to send after connect, wait on that. */
  624|      0|      if(sockfd != CURL_SOCKET_BAD)
  ------------------
  |  |  145|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (624:10): [True: 0, False: 0]
  ------------------
  625|      0|        result = Curl_pollset_set_out_only(data, &ps, sockfd);
  ------------------
  |  |  174|      0|  Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  284|      0|#define CURL_POLL_OUT    2
  |  |  ------------------
  |  |                 Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  283|      0|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
  626|      0|      if(!result)
  ------------------
  |  Branch (626:10): [True: 0, False: 0]
  ------------------
  627|      0|        result = Curl_conn_adjust_pollset(data, data->conn, &ps);
  628|      0|      if(result)
  ------------------
  |  Branch (628:10): [True: 0, False: 0]
  ------------------
  629|      0|        goto out;
  630|      0|      result = Curl_pollfds_add_ps(&cpfds, &ps);
  631|      0|      if(result)
  ------------------
  |  Branch (631:10): [True: 0, False: 0]
  ------------------
  632|      0|        goto out;
  633|       |
  634|      0|      rc = Curl_poll(cpfds.pfds, cpfds.n,
  635|      0|                     CURLMIN(timeout_ms, (cpfds.n ? 1000 : 10)));
  ------------------
  |  | 1287|      0|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 0, False: 0]
  |  |  |  Branch (1287:31): [True: 0, False: 0]
  |  |  |  Branch (1287:43): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  636|      0|      CURL_TRC_CF(data, cf, "Curl_conn_connect(block=1), Curl_poll() -> %d",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  637|      0|                  rc);
  638|      0|      if(rc < 0) {
  ------------------
  |  Branch (638:10): [True: 0, False: 0]
  ------------------
  639|      0|        result = CURLE_COULDNT_CONNECT;
  640|      0|        goto out;
  641|      0|      }
  642|       |      /* continue iterating */
  643|      0|    }
  644|   303k|  }
  645|       |
  646|   317k|out:
  647|   317k|  Curl_pollset_cleanup(&ps);
  648|   317k|  Curl_pollfds_cleanup(&cpfds);
  649|   317k|  return result;
  650|   317k|}
Curl_conn_is_setup:
  653|  2.15k|{
  654|  2.15k|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  382|  2.15k|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 2.15k, False: 0]
  |  |  |  Branch (382:50): [True: 2.15k, False: 0]
  |  |  ------------------
  ------------------
  655|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  656|  2.15k|  return (conn->cfilter[sockindex] != NULL);
  657|  2.15k|}
Curl_conn_is_connected:
  660|  3.88M|{
  661|  3.88M|  struct Curl_cfilter *cf;
  662|       |
  663|  3.88M|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  382|  3.88M|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 3.88M, False: 0]
  |  |  |  Branch (382:50): [True: 3.88M, False: 0]
  |  |  ------------------
  ------------------
  664|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  665|  3.88M|  cf = conn->cfilter[sockindex];
  666|  3.88M|  if(cf)
  ------------------
  |  Branch (666:6): [True: 3.88M, False: 5.10k]
  ------------------
  667|  3.88M|    return (bool)cf->connected;
  668|  5.10k|  else if(conn->scheme->flags & PROTOPT_NONETWORK)
  ------------------
  |  |  215|  5.10k|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (668:11): [True: 0, False: 5.10k]
  ------------------
  669|      0|    return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  670|  5.10k|  return FALSE;
  ------------------
  |  | 1058|  5.10k|#define FALSE false
  ------------------
  671|  3.88M|}
Curl_conn_is_ip_connected:
  674|   152k|{
  675|   152k|  struct Curl_cfilter *cf;
  676|       |
  677|   152k|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  382|   152k|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 152k, False: 0]
  |  |  |  Branch (382:50): [True: 152k, False: 0]
  |  |  ------------------
  ------------------
  678|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  679|   152k|  cf = data->conn->cfilter[sockindex];
  680|   553k|  while(cf) {
  ------------------
  |  Branch (680:9): [True: 400k, False: 152k]
  ------------------
  681|   400k|    if(cf->connected)
  ------------------
  |  Branch (681:8): [True: 0, False: 400k]
  ------------------
  682|      0|      return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  683|   400k|    if(cf->cft->flags & CF_TYPE_IP_CONNECT)
  ------------------
  |  |  206|   400k|#define CF_TYPE_IP_CONNECT  (1 << 0)
  ------------------
  |  Branch (683:8): [True: 0, False: 400k]
  ------------------
  684|      0|      return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  685|   400k|    cf = cf->next;
  686|   400k|  }
  687|   152k|  return FALSE;
  ------------------
  |  | 1058|   152k|#define FALSE false
  ------------------
  688|   152k|}
Curl_conn_is_ssl:
  704|  23.2k|{
  705|  23.2k|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  382|  23.2k|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 23.2k, False: 0]
  |  |  |  Branch (382:50): [True: 23.2k, False: 0]
  |  |  ------------------
  ------------------
  706|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  707|  23.2k|  return conn ? cf_is_ssl(conn->cfilter[sockindex]) : FALSE;
  ------------------
  |  | 1058|  23.2k|#define FALSE false
  ------------------
  |  Branch (707:10): [True: 23.2k, False: 0]
  ------------------
  708|  23.2k|}
Curl_conn_get_ip_info:
  730|    980|{
  731|    980|  struct Curl_cfilter *cf;
  732|    980|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  382|    980|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 980, False: 0]
  |  |  |  Branch (382:50): [True: 980, False: 0]
  |  |  ------------------
  ------------------
  733|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  734|    980|  cf = conn ? conn->cfilter[sockindex] : NULL;
  ------------------
  |  Branch (734:8): [True: 980, False: 0]
  ------------------
  735|    980|  return Curl_conn_cf_get_ip_info(cf, data, is_ipv6, ipquad);
  736|    980|}
Curl_conn_is_multiplex:
  739|  3.40M|{
  740|  3.40M|  struct Curl_cfilter *cf;
  741|       |
  742|  3.40M|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  382|  3.40M|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 3.40M, False: 0]
  |  |  |  Branch (382:50): [True: 3.40M, False: 0]
  |  |  ------------------
  ------------------
  743|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  744|  3.40M|  cf = conn ? conn->cfilter[sockindex] : NULL;
  ------------------
  |  Branch (744:8): [True: 3.40M, False: 0]
  ------------------
  745|       |
  746|  3.42M|  for(; cf; cf = cf->next) {
  ------------------
  |  Branch (746:9): [True: 3.42M, False: 1.68k]
  ------------------
  747|  3.42M|    if(cf->cft->flags & CF_TYPE_MULTIPLEX)
  ------------------
  |  |  208|  3.42M|#define CF_TYPE_MULTIPLEX   (1 << 2)
  ------------------
  |  Branch (747:8): [True: 3.27M, False: 143k]
  ------------------
  748|  3.27M|      return TRUE;
  ------------------
  |  | 1055|  3.27M|#define TRUE true
  ------------------
  749|   143k|    if(cf->cft->flags & (CF_TYPE_IP_CONNECT | CF_TYPE_SSL))
  ------------------
  |  |  206|   143k|#define CF_TYPE_IP_CONNECT  (1 << 0)
  ------------------
                  if(cf->cft->flags & (CF_TYPE_IP_CONNECT | CF_TYPE_SSL))
  ------------------
  |  |  207|   143k|#define CF_TYPE_SSL         (1 << 1)
  ------------------
  |  Branch (749:8): [True: 124k, False: 19.8k]
  ------------------
  750|   124k|      return FALSE;
  ------------------
  |  | 1058|   124k|#define FALSE false
  ------------------
  751|   143k|  }
  752|  1.68k|  return FALSE;
  ------------------
  |  | 1058|  1.68k|#define FALSE false
  ------------------
  753|  3.40M|}
Curl_conn_get_transport:
  757|     16|{
  758|     16|  struct Curl_cfilter *cf = conn->cfilter[FIRSTSOCKET];
  ------------------
  |  |  303|     16|#define FIRSTSOCKET     0
  ------------------
  759|     16|  return Curl_conn_cf_get_transport(cf, data);
  760|     16|}
Curl_socktype_for_transport:
  763|  14.6k|{
  764|  14.6k|  switch(transport) {
  765|  14.4k|  case TRNSPRT_TCP:
  ------------------
  |  |  307|  14.4k|#define TRNSPRT_TCP  3
  ------------------
  |  Branch (765:3): [True: 14.4k, False: 183]
  ------------------
  766|  14.4k|    return SOCK_STREAM;
  767|    183|  case TRNSPRT_UNIX:
  ------------------
  |  |  310|    183|#define TRNSPRT_UNIX 6
  ------------------
  |  Branch (767:3): [True: 183, False: 14.4k]
  ------------------
  768|    183|    return SOCK_STREAM;
  769|      0|  default: /* UDP and QUIC */
  ------------------
  |  Branch (769:3): [True: 0, False: 14.6k]
  ------------------
  770|       |    return SOCK_DGRAM;
  771|  14.6k|  }
  772|  14.6k|}
Curl_protocol_for_transport:
  775|  14.6k|{
  776|  14.6k|  switch(transport) {
  777|  14.4k|  case TRNSPRT_TCP:
  ------------------
  |  |  307|  14.4k|#define TRNSPRT_TCP  3
  ------------------
  |  Branch (777:3): [True: 14.4k, False: 183]
  ------------------
  778|  14.4k|    return IPPROTO_TCP;
  779|    183|  case TRNSPRT_UNIX:
  ------------------
  |  |  310|    183|#define TRNSPRT_UNIX 6
  ------------------
  |  Branch (779:3): [True: 183, False: 14.4k]
  ------------------
  780|    183|    return IPPROTO_IP;
  781|      0|  default: /* UDP and QUIC */
  ------------------
  |  Branch (781:3): [True: 0, False: 14.6k]
  ------------------
  782|       |    return IPPROTO_UDP;
  783|  14.6k|  }
  784|  14.6k|}
Curl_conn_cf_wants_httpsrr:
  788|   302k|{
  789|   302k|  (void)data;
  790|   997k|  for(; cf; cf = cf->next) {
  ------------------
  |  Branch (790:9): [True: 772k, False: 225k]
  ------------------
  791|   772k|    if(cf->cft->flags & CF_TYPE_HTTPSRR)
  ------------------
  |  |  212|   772k|#define CF_TYPE_HTTPSRR     (1 << 6)
  ------------------
  |  Branch (791:8): [True: 77.1k, False: 694k]
  ------------------
  792|  77.1k|      return TRUE;
  ------------------
  |  | 1055|  77.1k|#define TRUE true
  ------------------
  793|   772k|  }
  794|   225k|  return FALSE;
  ------------------
  |  | 1058|   225k|#define FALSE false
  ------------------
  795|   302k|}
Curl_conn_get_alpn_negotiated:
  799|  6.76k|{
  800|  6.76k|  struct Curl_cfilter *cf = conn->cfilter[FIRSTSOCKET];
  ------------------
  |  |  303|  6.76k|#define FIRSTSOCKET     0
  ------------------
  801|  6.76k|  return Curl_conn_cf_get_alpn_negotiated(cf, data);
  802|  6.76k|}
Curl_conn_http_version:
  806|  19.0k|{
  807|  19.0k|  struct Curl_cfilter *cf;
  808|  19.0k|  CURLcode result = CURLE_UNKNOWN_OPTION;
  809|  19.0k|  unsigned char v = 0;
  810|       |
  811|  19.0k|  cf = conn->cfilter[FIRSTSOCKET];
  ------------------
  |  |  303|  19.0k|#define FIRSTSOCKET     0
  ------------------
  812|  19.0k|  for(; cf; cf = cf->next) {
  ------------------
  |  Branch (812:9): [True: 19.0k, False: 0]
  ------------------
  813|  19.0k|    if(cf->cft->flags & CF_TYPE_HTTP) {
  ------------------
  |  |  210|  19.0k|#define CF_TYPE_HTTP        (1 << 4)
  ------------------
  |  Branch (813:8): [True: 5.12k, False: 13.9k]
  ------------------
  814|  5.12k|      int value = 0;
  815|  5.12k|      result = cf->cft->query(cf, data, CF_QUERY_HTTP_VERSION, &value, NULL);
  ------------------
  |  |  173|  5.12k|#define CF_QUERY_HTTP_VERSION       9  /* number (10/11/20/30)   - */
  ------------------
  816|  5.12k|      if(!result && ((value < 0) || (value > 255)))
  ------------------
  |  Branch (816:10): [True: 5.12k, False: 0]
  |  Branch (816:22): [True: 0, False: 5.12k]
  |  Branch (816:37): [True: 0, False: 5.12k]
  ------------------
  817|      0|        result = CURLE_FAILED_INIT;
  818|  5.12k|      else
  819|  5.12k|        v = (unsigned char)value;
  820|  5.12k|      break;
  821|  5.12k|    }
  822|  13.9k|    if(cf->cft->flags & (CF_TYPE_IP_CONNECT | CF_TYPE_SSL))
  ------------------
  |  |  206|  13.9k|#define CF_TYPE_IP_CONNECT  (1 << 0)
  ------------------
                  if(cf->cft->flags & (CF_TYPE_IP_CONNECT | CF_TYPE_SSL))
  ------------------
  |  |  207|  13.9k|#define CF_TYPE_SSL         (1 << 1)
  ------------------
  |  Branch (822:8): [True: 13.9k, False: 0]
  ------------------
  823|  13.9k|      break;
  824|  13.9k|  }
  825|  19.0k|  return (unsigned char)(result ? 0 : v);
  ------------------
  |  Branch (825:26): [True: 13.9k, False: 5.12k]
  ------------------
  826|  19.0k|}
Curl_conn_data_pending:
  829|  6.71M|{
  830|  6.71M|  struct Curl_cfilter *cf;
  831|       |
  832|  6.71M|  (void)data;
  833|  6.71M|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  6.71M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (833:3): [True: 0, False: 6.71M]
  |  Branch (833:3): [True: 6.71M, False: 0]
  ------------------
  834|  6.71M|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|  6.71M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (834:3): [True: 0, False: 6.71M]
  |  Branch (834:3): [True: 6.71M, False: 0]
  ------------------
  835|  6.71M|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  382|  6.71M|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 6.71M, False: 0]
  |  |  |  Branch (382:50): [True: 6.71M, False: 0]
  |  |  ------------------
  ------------------
  836|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  837|       |
  838|  6.71M|  cf = data->conn->cfilter[sockindex];
  839|  6.71M|  while(cf && !cf->connected) {
  ------------------
  |  Branch (839:9): [True: 6.71M, False: 0]
  |  Branch (839:15): [True: 0, False: 6.71M]
  ------------------
  840|      0|    cf = cf->next;
  841|      0|  }
  842|  6.71M|  if(cf) {
  ------------------
  |  Branch (842:6): [True: 6.71M, False: 0]
  ------------------
  843|  6.71M|    return cf->cft->has_data_pending(cf, data);
  844|  6.71M|  }
  845|      0|  return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  846|  6.71M|}
Curl_conn_cf_needs_flush:
  850|  15.3M|{
  851|  15.3M|  CURLcode result;
  852|  15.3M|  int pending = 0;
  853|  15.3M|  result = cf ? cf->cft->query(cf, data, CF_QUERY_NEED_FLUSH,
  ------------------
  |  |  171|  15.3M|#define CF_QUERY_NEED_FLUSH         7  /* TRUE/FALSE - */
  ------------------
  |  Branch (853:12): [True: 15.3M, False: 1]
  ------------------
  854|  15.3M|                               &pending, NULL) : CURLE_UNKNOWN_OPTION;
  855|  15.3M|  return (result || !pending) ? FALSE : TRUE;
  ------------------
  |  | 1058|  15.3M|#define FALSE false
  ------------------
                return (result || !pending) ? FALSE : TRUE;
  ------------------
  |  | 1055|  15.3M|#define TRUE true
  ------------------
  |  Branch (855:11): [True: 377k, False: 14.9M]
  |  Branch (855:21): [True: 0, False: 14.9M]
  ------------------
  856|  15.3M|}
Curl_conn_needs_flush:
  859|  15.2M|{
  860|  15.2M|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  382|  15.2M|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 15.2M, False: 764]
  |  |  |  Branch (382:50): [True: 15.2M, False: 0]
  |  |  ------------------
  ------------------
  861|    764|    return FALSE;
  ------------------
  |  | 1058|    764|#define FALSE false
  ------------------
  862|  15.2M|  return Curl_conn_cf_needs_flush(data->conn->cfilter[sockindex], data);
  863|  15.2M|}
Curl_conn_cf_adjust_pollset:
  868|  7.19M|{
  869|  7.19M|  CURLcode result = CURLE_OK;
  870|       |  /* Get the lowest not-connected filter, if there are any */
  871|  7.77M|  while(cf && !cf->connected && cf->next && !cf->next->connected)
  ------------------
  |  Branch (871:9): [True: 4.35M, False: 3.42M]
  |  Branch (871:15): [True: 926k, False: 3.42M]
  |  Branch (871:33): [True: 655k, False: 270k]
  |  Branch (871:45): [True: 583k, False: 72.5k]
  ------------------
  872|   583k|    cf = cf->next;
  873|       |  /* Skip all filters that have already shut down */
  874|  7.19M|  while(cf && cf->shutdown)
  ------------------
  |  Branch (874:9): [True: 3.77M, False: 3.42M]
  |  Branch (874:15): [True: 0, False: 3.77M]
  ------------------
  875|      0|    cf = cf->next;
  876|       |  /* From there on, give all filters a chance to adjust the pollset.
  877|       |   * Lower filters are called later, so they may override */
  878|  17.6M|  while(cf && !result) {
  ------------------
  |  Branch (878:9): [True: 10.4M, False: 7.19M]
  |  Branch (878:15): [True: 10.4M, False: 0]
  ------------------
  879|  10.4M|    result = cf->cft->adjust_pollset(cf, data, ps);
  880|  10.4M|    cf = cf->next;
  881|  10.4M|  }
  882|  7.19M|  return result;
  883|  7.19M|}
Curl_conn_adjust_pollset:
  888|  3.57M|{
  889|  3.57M|  CURLcode result = CURLE_OK;
  890|  3.57M|  int i;
  891|       |
  892|  3.57M|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  3.57M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (892:3): [True: 0, False: 3.57M]
  |  Branch (892:3): [True: 3.57M, False: 0]
  ------------------
  893|  3.57M|  DEBUGASSERT(conn);
  ------------------
  |  | 1081|  3.57M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (893:3): [True: 0, False: 3.57M]
  |  Branch (893:3): [True: 3.57M, False: 0]
  ------------------
  894|       |  /* During connect time, connection filters may add sockets to the pollset
  895|       |   * even when the transfer neither wants to send nor receive. And those
  896|       |   * sockets, when having events, are served.
  897|       |   * Once connected however, a transfer that neither wants to send nor receive
  898|       |   * will never call the connection filters. Any sockets added by the filters
  899|       |   * will not change state and POLLIN/POLLOUT events will trigger forever,
  900|       |   * making us busy loop. See #21671 */
  901|  3.57M|  if(ps->n || !Curl_conn_is_connected(conn, FIRSTSOCKET) ||
  ------------------
  |  |  303|  77.9k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (901:6): [True: 3.50M, False: 77.9k]
  |  Branch (901:15): [True: 77.9k, False: 2]
  ------------------
  902|      2|     (conn->cfilter[SECONDARYSOCKET] &&
  ------------------
  |  |  304|      2|#define SECONDARYSOCKET 1
  ------------------
  |  Branch (902:7): [True: 0, False: 2]
  ------------------
  903|  3.57M|      !Curl_conn_is_connected(conn, SECONDARYSOCKET))) {
  ------------------
  |  |  304|      0|#define SECONDARYSOCKET 1
  ------------------
  |  Branch (903:7): [True: 0, False: 0]
  ------------------
  904|  10.7M|    for(i = 0; (i < 2) && !result && conn; ++i) {
  ------------------
  |  Branch (904:16): [True: 7.15M, False: 3.57M]
  |  Branch (904:27): [True: 7.15M, False: 0]
  |  Branch (904:38): [True: 7.15M, False: 0]
  ------------------
  905|  7.15M|      result = Curl_conn_cf_adjust_pollset(conn->cfilter[i], data, ps);
  906|  7.15M|    }
  907|  3.57M|  }
  908|  3.57M|  return result;
  909|  3.57M|}
Curl_conn_cf_cntrl:
  991|  3.07M|{
  992|  3.07M|  CURLcode result = CURLE_OK;
  993|       |
  994|  12.1M|  for(; cf; cf = cf->next) {
  ------------------
  |  Branch (994:9): [True: 9.07M, False: 3.07M]
  ------------------
  995|  9.07M|    if(cf->cft->cntrl == Curl_cf_def_cntrl)
  ------------------
  |  Branch (995:8): [True: 3.04M, False: 6.02M]
  ------------------
  996|  3.04M|      continue;
  997|  6.02M|    result = cf->cft->cntrl(cf, data, event, arg1, arg2);
  998|  6.02M|    if(!ignore_result && result)
  ------------------
  |  Branch (998:8): [True: 5.97M, False: 56.4k]
  |  Branch (998:26): [True: 0, False: 5.97M]
  ------------------
  999|      0|      break;
 1000|  6.02M|  }
 1001|  3.07M|  return result;
 1002|  3.07M|}
Curl_conn_cf_get_socket:
 1006|  3.42M|{
 1007|  3.42M|  curl_socket_t sock;
 1008|  3.42M|  if(cf && !cf->cft->query(cf, data, CF_QUERY_SOCKET, NULL, &sock))
  ------------------
  |  |  167|  3.42M|#define CF_QUERY_SOCKET             3  /* -          curl_socket_t */
  ------------------
  |  Branch (1008:6): [True: 3.42M, False: 0]
  |  Branch (1008:12): [True: 3.33M, False: 92.0k]
  ------------------
 1009|  3.33M|    return sock;
 1010|  92.0k|  return CURL_SOCKET_BAD;
  ------------------
  |  |  145|  92.0k|#define CURL_SOCKET_BAD (-1)
  ------------------
 1011|  3.42M|}
Curl_conn_cf_get_transport:
 1015|     16|{
 1016|     16|  int transport = 0;
 1017|     16|  if(cf && !cf->cft->query(cf, data, CF_QUERY_TRANSPORT, &transport, NULL))
  ------------------
  |  |  180|     16|#define CF_QUERY_TRANSPORT         14  /* TRNSPRT_*  - * */
  ------------------
  |  Branch (1017:6): [True: 16, False: 0]
  |  Branch (1017:12): [True: 16, False: 0]
  ------------------
 1018|     16|    return (unsigned char)transport;
 1019|      0|  return (unsigned char)(data->conn ? data->conn->transport_wanted : 0);
  ------------------
  |  Branch (1019:26): [True: 0, False: 0]
  ------------------
 1020|     16|}
Curl_conn_cf_get_alpn_negotiated:
 1024|  14.7k|{
 1025|  14.7k|  const char *alpn = NULL;
 1026|  14.7k|  CURL_TRC_CF(data, cf, "query ALPN");
  ------------------
  |  |  153|  14.7k|  do {                                          \
  |  |  154|  14.7k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  14.7k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  29.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 14.7k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 14.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  29.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  14.7k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  14.7k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  14.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 14.7k]
  |  |  ------------------
  ------------------
 1027|  14.7k|  if(cf && !cf->cft->query(cf, data, CF_QUERY_ALPN_NEGOTIATED, NULL,
  ------------------
  |  |  181|  14.7k|#define CF_QUERY_ALPN_NEGOTIATED   15  /* -          const char * */
  ------------------
  |  Branch (1027:6): [True: 14.7k, False: 0]
  |  Branch (1027:12): [True: 6.62k, False: 8.13k]
  ------------------
 1028|  14.7k|                           CURL_UNCONST(&alpn)))
  ------------------
  |  |  866|  14.7k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
 1029|  6.62k|    return alpn;
 1030|  8.13k|  return NULL;
 1031|  14.7k|}
Curl_conn_cf_get_ip_info:
 1047|  1.10k|{
 1048|  1.10k|  CURLcode result = CURLE_UNKNOWN_OPTION;
 1049|  1.10k|  if(cf) {
  ------------------
  |  Branch (1049:6): [True: 1.10k, False: 0]
  ------------------
 1050|  1.10k|    int ipv6 = 0;
 1051|  1.10k|    result = cf->cft->query(cf, data, CF_QUERY_IP_INFO, &ipv6, ipquad);
  ------------------
  |  |  172|  1.10k|#define CF_QUERY_IP_INFO            8  /* TRUE/FALSE struct ip_quadruple */
  ------------------
 1052|  1.10k|    *is_ipv6 = !!ipv6;
 1053|  1.10k|  }
 1054|  1.10k|  return result;
 1055|  1.10k|}
Curl_conn_get_first_socket:
 1058|   150k|{
 1059|   150k|  struct Curl_cfilter *cf;
 1060|       |
 1061|   150k|  if(!data->conn)
  ------------------
  |  Branch (1061:6): [True: 0, False: 150k]
  ------------------
 1062|      0|    return CURL_SOCKET_BAD;
  ------------------
  |  |  145|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
 1063|       |
 1064|   150k|  cf = data->conn->cfilter[FIRSTSOCKET];
  ------------------
  |  |  303|   150k|#define FIRSTSOCKET     0
  ------------------
 1065|       |  /* if the top filter has not connected, ask it (and its sub-filters)
 1066|       |   * for the socket. Otherwise conn->sock[sockindex] should have it. */
 1067|   150k|  if(cf && !cf->connected)
  ------------------
  |  Branch (1067:6): [True: 150k, False: 0]
  |  Branch (1067:12): [True: 150k, False: 0]
  ------------------
 1068|   150k|    return Curl_conn_cf_get_socket(cf, data);
 1069|      0|  return data->conn->sock[FIRSTSOCKET];
  ------------------
  |  |  303|      0|#define FIRSTSOCKET     0
  ------------------
 1070|   150k|}
Curl_conn_get_remote_addr:
 1074|     12|{
 1075|     12|  struct Curl_cfilter *cf =
 1076|     12|    (data->conn && CONN_SOCK_IDX_VALID(sockindex)) ?
  ------------------
  |  |  382|     12|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 12, False: 0]
  |  |  |  Branch (382:50): [True: 12, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1076:6): [True: 12, False: 0]
  ------------------
 1077|     12|    data->conn->cfilter[sockindex] : NULL;
 1078|     12|  return cf ? cf_get_remote_addr(cf, data) : NULL;
  ------------------
  |  Branch (1078:10): [True: 12, False: 0]
  ------------------
 1079|     12|}
Curl_conn_ev_data_setup:
 1082|  13.8k|{
 1083|  13.8k|  return cf_cntrl_all(data->conn, data, FALSE, CF_CTRL_DATA_SETUP, 0, NULL);
  ------------------
  |  | 1058|  13.8k|#define FALSE false
  ------------------
                return cf_cntrl_all(data->conn, data, FALSE, CF_CTRL_DATA_SETUP, 0, NULL);
  ------------------
  |  |  119|  13.8k|#define CF_CTRL_DATA_SETUP              4  /* 0          NULL     first fail */
  ------------------
 1084|  13.8k|}
Curl_conn_flush:
 1087|  2.98M|{
 1088|  2.98M|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  382|  2.98M|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 2.98M, False: 0]
  |  |  |  Branch (382:50): [True: 2.98M, False: 0]
  |  |  ------------------
  ------------------
 1089|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1090|  2.98M|  return Curl_conn_cf_cntrl(data->conn->cfilter[sockindex], data, FALSE,
  ------------------
  |  | 1058|  2.98M|#define FALSE false
  ------------------
 1091|  2.98M|                            CF_CTRL_FLUSH, 0, NULL);
  ------------------
  |  |  127|  2.98M|#define CF_CTRL_FLUSH            (256 + 2) /* 0          NULL     first fail */
  ------------------
 1092|  2.98M|}
Curl_conn_ev_data_done_send:
 1099|  6.70k|{
 1100|  6.70k|  cf_cntrl_all(data->conn, data, TRUE, CF_CTRL_DATA_DONE_SEND, 0, NULL);
  ------------------
  |  | 1055|  6.70k|#define TRUE true
  ------------------
                cf_cntrl_all(data->conn, data, TRUE, CF_CTRL_DATA_DONE_SEND, 0, NULL);
  ------------------
  |  |  123|  6.70k|#define CF_CTRL_DATA_DONE_SEND          8  /* 0          NULL     ignored */
  ------------------
 1101|  6.70k|}
Curl_conn_ev_data_done:
 1108|  13.8k|{
 1109|  13.8k|  cf_cntrl_all(data->conn, data, TRUE, CF_CTRL_DATA_DONE, premature, NULL);
  ------------------
  |  | 1055|  13.8k|#define TRUE true
  ------------------
                cf_cntrl_all(data->conn, data, TRUE, CF_CTRL_DATA_DONE, premature, NULL);
  ------------------
  |  |  122|  13.8k|#define CF_CTRL_DATA_DONE               7  /* premature  NULL     ignored */
  ------------------
 1110|  13.8k|}
Curl_conn_is_alive:
 1120|    416|{
 1121|    416|  struct Curl_cfilter *cf = conn->cfilter[FIRSTSOCKET];
  ------------------
  |  |  303|    416|#define FIRSTSOCKET     0
  ------------------
 1122|    416|  return cf && !cf->conn->bits.close &&
  ------------------
  |  Branch (1122:10): [True: 416, False: 0]
  |  Branch (1122:16): [True: 416, False: 0]
  ------------------
 1123|    416|         cf->cft->is_alive(cf, data, input_pending);
  ------------------
  |  Branch (1123:10): [True: 416, False: 0]
  ------------------
 1124|    416|}
Curl_conn_get_max_concurrent:
 1141|  2.42k|{
 1142|  2.42k|  struct Curl_cfilter *cf;
 1143|  2.42k|  CURLcode result;
 1144|  2.42k|  int n = -1;
 1145|       |
 1146|  2.42k|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  382|  2.42k|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 2.42k, False: 0]
  |  |  |  Branch (382:50): [True: 2.42k, False: 0]
  |  |  ------------------
  ------------------
 1147|      0|    return 0;
 1148|       |
 1149|  2.42k|  cf = conn->cfilter[sockindex];
 1150|  2.42k|  result = cf ? cf->cft->query(cf, data, CF_QUERY_MAX_CONCURRENT,
  ------------------
  |  |  165|  2.42k|#define CF_QUERY_MAX_CONCURRENT     1  /* number     -        */
  ------------------
  |  Branch (1150:12): [True: 2.42k, False: 0]
  ------------------
 1151|  2.42k|                               &n, NULL) : CURLE_UNKNOWN_OPTION;
 1152|       |  /* If no filter answered the query, the default is a non-multiplexed
 1153|       |   * connection with limit 1. Otherwise, the query may return 0
 1154|       |   * for connections that are in shutdown, e.g. server HTTP/2 GOAWAY. */
 1155|  2.42k|  return (result || n < 0) ? 1 : (size_t)n;
  ------------------
  |  Branch (1155:11): [True: 1.37k, False: 1.04k]
  |  Branch (1155:21): [True: 0, False: 1.04k]
  ------------------
 1156|  2.42k|}
Curl_conn_get_stream_error:
 1161|    680|{
 1162|    680|  struct Curl_cfilter *cf;
 1163|    680|  CURLcode result;
 1164|    680|  int n = 0;
 1165|       |
 1166|    680|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  382|    680|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 680, False: 0]
  |  |  |  Branch (382:50): [True: 680, False: 0]
  |  |  ------------------
  ------------------
 1167|      0|    return 0;
 1168|       |
 1169|    680|  cf = conn->cfilter[sockindex];
 1170|    680|  result = cf ? cf->cft->query(cf, data, CF_QUERY_STREAM_ERROR,
  ------------------
  |  |  170|    680|#define CF_QUERY_STREAM_ERROR       6  /* error code - */
  ------------------
  |  Branch (1170:12): [True: 680, False: 0]
  ------------------
 1171|    680|                               &n, NULL) : CURLE_UNKNOWN_OPTION;
 1172|    680|  return (result || n < 0) ? 0 : n;
  ------------------
  |  Branch (1172:11): [True: 0, False: 680]
  |  Branch (1172:21): [True: 380, False: 300]
  ------------------
 1173|    680|}
Curl_conn_recv:
 1185|  4.80M|{
 1186|  4.80M|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  4.80M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1186:3): [True: 0, False: 4.80M]
  |  Branch (1186:3): [True: 4.80M, False: 0]
  ------------------
 1187|  4.80M|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|  4.80M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1187:3): [True: 0, False: 4.80M]
  |  Branch (1187:3): [True: 4.80M, False: 0]
  ------------------
 1188|  4.80M|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  382|  4.80M|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 4.80M, False: 0]
  |  |  |  Branch (382:50): [True: 4.80M, False: 0]
  |  |  ------------------
  ------------------
 1189|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1190|  4.80M|  if(data && data->conn && data->conn->recv[sockindex])
  ------------------
  |  Branch (1190:6): [True: 4.80M, False: 0]
  |  Branch (1190:14): [True: 4.80M, False: 0]
  |  Branch (1190:28): [True: 4.80M, False: 0]
  ------------------
 1191|  4.80M|    return data->conn->recv[sockindex](data, sockindex, buf, len, pnread);
 1192|      0|  *pnread = 0;
 1193|      0|  return CURLE_FAILED_INIT;
 1194|  4.80M|}
Curl_conn_send:
 1199|   287k|{
 1200|   287k|  size_t write_len = len;
 1201|       |
 1202|   287k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|   287k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1202:3): [True: 0, False: 287k]
  |  Branch (1202:3): [True: 287k, False: 0]
  ------------------
 1203|   287k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|   287k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1203:3): [True: 0, False: 287k]
  |  Branch (1203:3): [True: 287k, False: 0]
  ------------------
 1204|   287k|  DEBUGASSERT(CONN_SOCK_IDX_VALID(sockindex));
  ------------------
  |  | 1081|   287k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1204:3): [True: 0, False: 287k]
  |  Branch (1204:3): [True: 0, False: 0]
  |  Branch (1204:3): [True: 287k, False: 0]
  |  Branch (1204:3): [True: 287k, False: 0]
  ------------------
 1205|   287k|  if(!CONN_SOCK_IDX_VALID(sockindex))
  ------------------
  |  |  382|   287k|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 287k, False: 0]
  |  |  |  Branch (382:50): [True: 287k, False: 0]
  |  |  ------------------
  ------------------
 1206|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1207|   287k|#ifdef DEBUGBUILD
 1208|   287k|  if(write_len) {
  ------------------
  |  Branch (1208:6): [True: 287k, False: 25]
  ------------------
 1209|       |    /* Allow debug builds to override this logic to force short sends */
 1210|   287k|    const char *p = getenv("CURL_SMALLSENDS");
 1211|   287k|    if(p) {
  ------------------
  |  Branch (1211:8): [True: 0, False: 287k]
  ------------------
 1212|      0|      curl_off_t altsize;
 1213|      0|      if(!curlx_str_number(&p, &altsize, write_len)) {
  ------------------
  |  Branch (1213:10): [True: 0, False: 0]
  ------------------
 1214|      0|        write_len = (size_t)altsize;
 1215|      0|        if(write_len != len)
  ------------------
  |  Branch (1215:12): [True: 0, False: 0]
  ------------------
 1216|      0|          eos = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1217|      0|      }
 1218|      0|    }
 1219|   287k|  }
 1220|   287k|#endif
 1221|   287k|  if(data && data->conn && data->conn->send[sockindex])
  ------------------
  |  Branch (1221:6): [True: 287k, False: 0]
  |  Branch (1221:14): [True: 287k, False: 0]
  |  Branch (1221:28): [True: 287k, False: 0]
  ------------------
 1222|   287k|    return data->conn->send[sockindex](data, sockindex, buf, write_len, eos,
 1223|   287k|                                       pnwritten);
 1224|      0|  *pnwritten = 0;
 1225|      0|  return CURLE_FAILED_INIT;
 1226|   287k|}
cfilters.c:cf_bufq_reader:
  289|  3.26M|{
  290|  3.26M|  struct cf_io_ctx *io = writer_ctx;
  291|  3.26M|  return Curl_conn_cf_recv(io->cf, io->data, (char *)buf, blen, pnread);
  292|  3.26M|}
cfilters.c:cf_bufq_writer:
  314|  11.8k|{
  315|  11.8k|  struct cf_io_ctx *io = writer_ctx;
  316|       |  return Curl_conn_cf_send(io->cf, io->data, buf, buflen, FALSE, pnwritten);
  ------------------
  |  | 1058|  11.8k|#define FALSE false
  ------------------
  317|  11.8k|}
cfilters.c:cf_cntrl_update_info:
  496|  9.80k|{
  497|  9.80k|  cf_cntrl_all(conn, data, TRUE, CF_CTRL_CONN_INFO_UPDATE, 0, NULL);
  ------------------
  |  | 1055|  9.80k|#define TRUE true
  ------------------
                cf_cntrl_all(conn, data, TRUE, CF_CTRL_CONN_INFO_UPDATE, 0, NULL);
  ------------------
  |  |  125|  9.80k|#define CF_CTRL_CONN_INFO_UPDATE (256 + 0) /* 0          NULL     ignored */
  ------------------
  498|  9.80k|}
cfilters.c:conn_report_connect_stats:
  505|  14.4k|{
  506|  14.4k|  if(cf) {
  ------------------
  |  Branch (506:6): [True: 14.4k, False: 0]
  ------------------
  507|  14.4k|    struct curltime connected;
  508|  14.4k|    struct curltime appconnected;
  509|       |
  510|  14.4k|    memset(&connected, 0, sizeof(connected));
  511|  14.4k|    cf->cft->query(cf, data, CF_QUERY_TIMER_CONNECT, NULL, &connected);
  ------------------
  |  |  168|  14.4k|#define CF_QUERY_TIMER_CONNECT      4  /* -          struct curltime */
  ------------------
  512|  14.4k|    if(connected.tv_sec || connected.tv_usec)
  ------------------
  |  Branch (512:8): [True: 13.8k, False: 674]
  |  Branch (512:28): [True: 0, False: 674]
  ------------------
  513|  13.8k|      Curl_pgrsTimeWas(data, TIMER_CONNECT, connected);
  514|       |
  515|  14.4k|    memset(&appconnected, 0, sizeof(appconnected));
  516|  14.4k|    cf->cft->query(cf, data, CF_QUERY_TIMER_APPCONNECT, NULL, &appconnected);
  ------------------
  |  |  169|  14.4k|#define CF_QUERY_TIMER_APPCONNECT   5  /* -          struct curltime */
  ------------------
  517|  14.4k|    if(appconnected.tv_sec || appconnected.tv_usec)
  ------------------
  |  Branch (517:8): [True: 0, False: 14.4k]
  |  Branch (517:31): [True: 0, False: 14.4k]
  ------------------
  518|      0|      Curl_pgrsTimeWas(data, TIMER_APPCONNECT, appconnected);
  519|  14.4k|  }
  520|  14.4k|}
cfilters.c:cf_verboseconnect:
  457|  9.80k|{
  458|  9.80k|  if(Curl_trc_is_verbose(data)) {
  ------------------
  |  |  319|  9.80k|  ((data) && (data)->set.verbose &&                        \
  |  |  ------------------
  |  |  |  Branch (319:4): [True: 9.80k, False: 0]
  |  |  |  Branch (319:14): [True: 0, False: 9.80k]
  |  |  ------------------
  |  |  320|  9.80k|   (!(data)->state.feat ||                                 \
  |  |  ------------------
  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  ------------------
  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  459|      0|    struct ip_quadruple ipquad;
  460|      0|    bool is_ipv6;
  461|      0|    CURLcode result;
  462|       |
  463|      0|    result = Curl_conn_cf_get_ip_info(cf, data, &is_ipv6, &ipquad);
  464|      0|    if(result)
  ------------------
  |  Branch (464:8): [True: 0, False: 0]
  ------------------
  465|      0|      return result;
  466|       |
  467|      0|    infof(data, "Established %sconnection to %s (%s port %u) from %s port %u ",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  468|      0|          (cf->sockindex == SECONDARYSOCKET) ? "2nd " : "",
  469|      0|          CURL_CONN_HOST_DISPNAME(data->conn),
  470|      0|          ipquad.remote_ip, ipquad.remote_port,
  471|      0|          ipquad.local_ip, ipquad.local_port);
  472|      0|  }
  473|  9.80k|  return CURLE_OK;
  474|  9.80k|}
cfilters.c:conn_remove_setup_filters:
  524|  9.80k|{
  525|  9.80k|  struct Curl_cfilter **anchor = &data->conn->cfilter[sockindex];
  526|  62.3k|  while(*anchor) {
  ------------------
  |  Branch (526:9): [True: 52.5k, False: 9.80k]
  ------------------
  527|  52.5k|    struct Curl_cfilter *cf = *anchor;
  528|  52.5k|    if(cf->connected && (cf->cft->flags & CF_TYPE_SETUP)) {
  ------------------
  |  |  211|  52.5k|#define CF_TYPE_SETUP       (1 << 5)
  ------------------
  |  Branch (528:8): [True: 52.5k, False: 0]
  |  Branch (528:25): [True: 36.1k, False: 16.4k]
  ------------------
  529|  36.1k|      *anchor = cf->next;
  530|  36.1k|      cf->next = NULL;
  531|  36.1k|      CURL_TRC_CF(data, cf, "removing connected setup filter");
  ------------------
  |  |  153|  36.1k|  do {                                          \
  |  |  154|  36.1k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  36.1k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  72.2k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 36.1k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 36.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  72.2k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  36.1k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  36.1k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  36.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 36.1k]
  |  |  ------------------
  ------------------
  532|  36.1k|      cf->cft->destroy(cf, data);
  533|  36.1k|      curlx_free(cf);
  ------------------
  |  | 1483|  36.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  534|  36.1k|    }
  535|  16.4k|    else
  536|  16.4k|      anchor = &cf->next;
  537|  52.5k|  }
  538|  9.80k|}
cfilters.c:cf_is_ssl:
  691|  23.2k|{
  692|  43.0k|  for(; cf; cf = cf->next) {
  ------------------
  |  Branch (692:9): [True: 43.0k, False: 0]
  ------------------
  693|       |    /* A tunneling proxy does not offer end2end encryption, even if
  694|       |     * it does SSL itself (e.g. QUIC H3 proxy) */
  695|  43.0k|    if((cf->cft->flags & CF_TYPE_SSL) && !(cf->cft->flags & CF_TYPE_PROXY))
  ------------------
  |  |  207|  43.0k|#define CF_TYPE_SSL         (1 << 1)
  ------------------
                  if((cf->cft->flags & CF_TYPE_SSL) && !(cf->cft->flags & CF_TYPE_PROXY))
  ------------------
  |  |  209|      0|#define CF_TYPE_PROXY       (1 << 3)
  ------------------
  |  Branch (695:8): [True: 0, False: 43.0k]
  |  Branch (695:42): [True: 0, False: 0]
  ------------------
  696|      0|      return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  697|  43.0k|    if(cf->cft->flags & CF_TYPE_IP_CONNECT)
  ------------------
  |  |  206|  43.0k|#define CF_TYPE_IP_CONNECT  (1 << 0)
  ------------------
  |  Branch (697:8): [True: 23.2k, False: 19.8k]
  ------------------
  698|  23.2k|      return FALSE;
  ------------------
  |  | 1058|  23.2k|#define FALSE false
  ------------------
  699|  43.0k|  }
  700|      0|  return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  701|  23.2k|}
cfilters.c:cf_get_remote_addr:
 1035|     12|{
 1036|     12|  const struct Curl_sockaddr_ex *remote_addr = NULL;
 1037|     12|  if(cf &&
  ------------------
  |  Branch (1037:6): [True: 12, False: 0]
  ------------------
 1038|     12|     !cf->cft->query(cf, data, CF_QUERY_REMOTE_ADDR, NULL,
  ------------------
  |  |  176|     12|#define CF_QUERY_REMOTE_ADDR       10  /* -          `Curl_sockaddr_ex *` */
  ------------------
  |  Branch (1038:6): [True: 12, False: 0]
  ------------------
 1039|     12|                     CURL_UNCONST(&remote_addr)))
  ------------------
  |  |  866|     12|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
 1040|     12|    return remote_addr;
 1041|      0|  return NULL;
 1042|     12|}
cfilters.c:cf_cntrl_all:
  481|  44.2k|{
  482|  44.2k|  CURLcode result = CURLE_OK;
  483|  44.2k|  size_t i;
  484|       |
  485|   132k|  for(i = 0; i < CURL_ARRAYSIZE(conn->cfilter); ++i) {
  ------------------
  |  | 1294|   132k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (485:14): [True: 88.5k, False: 44.2k]
  ------------------
  486|  88.5k|    result = Curl_conn_cf_cntrl(conn->cfilter[i], data, ignore_result,
  487|  88.5k|                                event, arg1, arg2);
  488|  88.5k|    if(!ignore_result && result)
  ------------------
  |  Branch (488:8): [True: 27.7k, False: 60.7k]
  |  Branch (488:26): [True: 0, False: 27.7k]
  ------------------
  489|      0|      break;
  490|  88.5k|  }
  491|  44.2k|  return result;
  492|  44.2k|}

Curl_cpool_init:
  117|  17.2k|{
  118|  17.2k|  Curl_hash_init(&cpool->dest2bundle, size, Curl_hash_str,
  119|  17.2k|                 curlx_str_key_compare, cpool_bundle_free_entry);
  120|       |
  121|  17.2k|  DEBUGASSERT(idata);
  ------------------
  |  | 1081|  17.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (121:3): [True: 0, False: 17.2k]
  |  Branch (121:3): [True: 17.2k, False: 0]
  ------------------
  122|       |
  123|  17.2k|  cpool->idata = idata;
  124|  17.2k|  cpool->share = share;
  125|       |  cpool->initialized = TRUE;
  ------------------
  |  | 1055|  17.2k|#define TRUE true
  ------------------
  126|  17.2k|}
Curl_cpool_destroy:
  232|  17.2k|{
  233|  17.2k|  if(cpool && cpool->initialized && cpool->idata) {
  ------------------
  |  Branch (233:6): [True: 17.2k, False: 0]
  |  Branch (233:15): [True: 17.2k, False: 0]
  |  Branch (233:37): [True: 17.2k, False: 0]
  ------------------
  234|  17.2k|    struct connectdata *conn;
  235|  17.2k|    struct Curl_sigpipe_ctx pipe_ctx;
  236|       |
  237|  17.2k|    CURL_TRC_M(cpool->idata, "%s[CPOOL] destroy, %zu connections",
  ------------------
  |  |  148|  17.2k|  do {                                   \
  |  |  149|  17.2k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  17.2k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  17.2k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  34.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 17.2k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 17.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  34.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  17.2k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  17.2k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|  17.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 17.2k]
  |  |  ------------------
  ------------------
  238|  17.2k|               cpool->share ? "[SHARE] " : "", cpool->num_conn);
  239|       |    /* Move all connections to the shutdown list */
  240|  17.2k|    sigpipe_init(&pipe_ctx);
  241|  17.2k|    CPOOL_LOCK(cpool, cpool->idata);
  ------------------
  |  |   42|  17.2k|  do {                                                                  \
  |  |   43|  17.2k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (43:8): [True: 17.2k, False: 0]
  |  |  ------------------
  |  |   44|  17.2k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  17.2k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 17.2k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|  17.2k|        Curl_share_lock((d), CURL_LOCK_DATA_CONNECT,                    \
  |  |   46|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   47|  17.2k|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1081|  17.2k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   48|  17.2k|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  | 1055|  17.2k|#define TRUE true
  |  |  ------------------
  |  |   49|  17.2k|    }                                                                   \
  |  |   50|  17.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (50:11): [Folded, False: 17.2k]
  |  |  ------------------
  ------------------
  |  Branch (241:5): [True: 0, False: 17.2k]
  |  Branch (241:5): [True: 17.2k, False: 0]
  ------------------
  242|  17.2k|    conn = cpool_get_first(cpool);
  243|  17.2k|    if(conn)
  ------------------
  |  Branch (243:8): [True: 1.93k, False: 15.2k]
  ------------------
  244|  1.93k|      sigpipe_apply(cpool->idata, &pipe_ctx);
  245|  19.1k|    while(conn) {
  ------------------
  |  Branch (245:11): [True: 1.93k, False: 17.2k]
  ------------------
  246|  1.93k|      cpool_remove_conn(cpool, conn);
  247|  1.93k|      cpool_discard_conn(cpool, cpool->idata, conn, FALSE);
  ------------------
  |  | 1058|  1.93k|#define FALSE false
  ------------------
  248|  1.93k|      conn = cpool_get_first(cpool);
  249|  1.93k|    }
  250|  17.2k|    CPOOL_UNLOCK(cpool, cpool->idata);
  ------------------
  |  |   53|  17.2k|  do {                                                                  \
  |  |   54|  17.2k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (54:8): [True: 17.2k, False: 0]
  |  |  ------------------
  |  |   55|  17.2k|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1081|  17.2k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   56|  17.2k|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  | 1058|  17.2k|#define FALSE false
  |  |  ------------------
  |  |   57|  17.2k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  17.2k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 17.2k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|  17.2k|        Curl_share_unlock((d), CURL_LOCK_DATA_CONNECT);                 \
  |  |   59|  17.2k|    }                                                                   \
  |  |   60|  17.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (60:11): [Folded, False: 17.2k]
  |  |  ------------------
  ------------------
  |  Branch (250:5): [True: 0, False: 17.2k]
  |  Branch (250:5): [True: 17.2k, False: 0]
  ------------------
  251|  17.2k|    sigpipe_restore(&pipe_ctx);
  252|  17.2k|    Curl_hash_destroy(&cpool->dest2bundle);
  253|  17.2k|  }
  254|  17.2k|}
Curl_cpool_xfer_init:
  270|  17.8k|{
  271|  17.8k|  struct cpool *cpool = cpool_get_instance(data);
  272|       |
  273|  17.8k|  DEBUGASSERT(cpool);
  ------------------
  |  | 1081|  17.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (273:3): [True: 0, False: 17.8k]
  |  Branch (273:3): [True: 17.8k, False: 0]
  ------------------
  274|  17.8k|  if(cpool) {
  ------------------
  |  Branch (274:6): [True: 17.8k, False: 0]
  ------------------
  275|  17.8k|    CPOOL_LOCK(cpool, data);
  ------------------
  |  |   42|  17.8k|  do {                                                                  \
  |  |   43|  17.8k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (43:8): [True: 17.8k, False: 0]
  |  |  ------------------
  |  |   44|  17.8k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  17.8k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 17.8k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|  17.8k|        Curl_share_lock((d), CURL_LOCK_DATA_CONNECT,                    \
  |  |   46|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   47|  17.8k|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1081|  17.8k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   48|  17.8k|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  | 1055|  17.8k|#define TRUE true
  |  |  ------------------
  |  |   49|  17.8k|    }                                                                   \
  |  |   50|  17.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (50:11): [Folded, False: 17.8k]
  |  |  ------------------
  ------------------
  |  Branch (275:5): [True: 0, False: 17.8k]
  |  Branch (275:5): [True: 17.8k, False: 0]
  ------------------
  276|       |    /* the identifier inside the connection cache */
  277|  17.8k|    data->id = cpool->next_easy_id++;
  278|  17.8k|    if(cpool->next_easy_id <= 0)
  ------------------
  |  Branch (278:8): [True: 0, False: 17.8k]
  ------------------
  279|      0|      cpool->next_easy_id = 0;
  280|  17.8k|    data->state.lastconnect_id = -1;
  281|       |
  282|  17.8k|    CPOOL_UNLOCK(cpool, data);
  ------------------
  |  |   53|  17.8k|  do {                                                                  \
  |  |   54|  17.8k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (54:8): [True: 17.8k, False: 0]
  |  |  ------------------
  |  |   55|  17.8k|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1081|  17.8k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   56|  17.8k|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  | 1058|  17.8k|#define FALSE false
  |  |  ------------------
  |  |   57|  17.8k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  17.8k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 17.8k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|  17.8k|        Curl_share_unlock((d), CURL_LOCK_DATA_CONNECT);                 \
  |  |   59|  17.8k|    }                                                                   \
  |  |   60|  17.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (60:11): [Folded, False: 17.8k]
  |  |  ------------------
  ------------------
  |  Branch (282:5): [True: 0, False: 17.8k]
  |  Branch (282:5): [True: 17.8k, False: 0]
  ------------------
  283|  17.8k|  }
  284|      0|  else {
  285|       |    /* We should not get here, but in a non-debug build, do something */
  286|      0|    data->id = 0;
  287|      0|    data->state.lastconnect_id = -1;
  288|      0|  }
  289|  17.8k|}
Curl_cpool_check_limits:
  372|  13.7k|{
  373|  13.7k|  struct cpool *cpool = cpool_get_instance(data);
  374|  13.7k|  struct cpool_bundle *bundle;
  375|  13.7k|  size_t dest_limit = 0;
  376|  13.7k|  size_t total_limit = 0;
  377|  13.7k|  size_t shutdowns;
  378|  13.7k|  int res = CPOOL_LIMIT_OK;
  ------------------
  |  |   90|  13.7k|#define CPOOL_LIMIT_OK     0
  ------------------
  379|       |
  380|  13.7k|  if(!cpool)
  ------------------
  |  Branch (380:6): [True: 0, False: 13.7k]
  ------------------
  381|      0|    return CPOOL_LIMIT_OK;
  ------------------
  |  |   90|      0|#define CPOOL_LIMIT_OK     0
  ------------------
  382|       |
  383|  13.7k|  if(cpool->idata->multi) {
  ------------------
  |  Branch (383:6): [True: 13.7k, False: 0]
  ------------------
  384|  13.7k|    dest_limit = cpool->idata->multi->max_host_connections;
  385|  13.7k|    total_limit = cpool->idata->multi->max_total_connections;
  386|  13.7k|  }
  387|       |
  388|  13.7k|  if(!dest_limit && !total_limit)
  ------------------
  |  Branch (388:6): [True: 13.7k, False: 0]
  |  Branch (388:21): [True: 13.7k, False: 0]
  ------------------
  389|  13.7k|    return CPOOL_LIMIT_OK;
  ------------------
  |  |   90|  13.7k|#define CPOOL_LIMIT_OK     0
  ------------------
  390|       |
  391|      0|  CPOOL_LOCK(cpool, cpool->idata);
  ------------------
  |  |   42|      0|  do {                                                                  \
  |  |   43|      0|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (43:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   44|      0|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|      0|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|      0|        Curl_share_lock((d), CURL_LOCK_DATA_CONNECT,                    \
  |  |   46|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   47|      0|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   48|      0|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  |  |   49|      0|    }                                                                   \
  |  |   50|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (50:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (391:3): [True: 0, False: 0]
  |  Branch (391:3): [True: 0, False: 0]
  ------------------
  392|      0|  if(dest_limit) {
  ------------------
  |  Branch (392:6): [True: 0, False: 0]
  ------------------
  393|      0|    size_t live;
  394|       |
  395|      0|    bundle = cpool_find_bundle(cpool, conn);
  396|      0|    live = bundle ? Curl_llist_count(&bundle->conns) : 0;
  ------------------
  |  Branch (396:12): [True: 0, False: 0]
  ------------------
  397|      0|    shutdowns = Curl_cshutdn_dest_count(data, conn->destination);
  398|      0|    while((live + shutdowns) >= dest_limit) {
  ------------------
  |  Branch (398:11): [True: 0, False: 0]
  ------------------
  399|      0|      if(shutdowns) {
  ------------------
  |  Branch (399:10): [True: 0, False: 0]
  ------------------
  400|       |        /* close one connection in shutdown right away, if we can */
  401|      0|        if(!Curl_cshutdn_close_oldest(data, conn->destination))
  ------------------
  |  Branch (401:12): [True: 0, False: 0]
  ------------------
  402|      0|          break;
  403|      0|      }
  404|      0|      else if(!bundle)
  ------------------
  |  Branch (404:15): [True: 0, False: 0]
  ------------------
  405|      0|        break;
  406|      0|      else {
  407|      0|        struct connectdata *oldest_idle = NULL;
  408|       |        /* The bundle is full. Extract the oldest connection that may
  409|       |         * be removed now, if there is one. */
  410|      0|        oldest_idle = cpool_bundle_get_oldest_idle(bundle,
  411|      0|                                                   Curl_pgrs_now(data));
  412|      0|        if(!oldest_idle)
  ------------------
  |  Branch (412:12): [True: 0, False: 0]
  ------------------
  413|      0|          break;
  414|       |        /* disconnect the old conn and continue */
  415|      0|        CURL_TRC_M(data, "Discarding connection #%" FMT_OFF_T
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  416|      0|                   " from %zu to reach destination limit of %zu",
  417|      0|                   oldest_idle->connection_id,
  418|      0|                   Curl_llist_count(&bundle->conns), dest_limit);
  419|      0|        Curl_conn_terminate(cpool->idata, oldest_idle, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  420|       |
  421|       |        /* in case the bundle was destroyed in disconnect, look it up again */
  422|      0|        bundle = cpool_find_bundle(cpool, conn);
  423|      0|        live = bundle ? Curl_llist_count(&bundle->conns) : 0;
  ------------------
  |  Branch (423:16): [True: 0, False: 0]
  ------------------
  424|      0|      }
  425|      0|      shutdowns = Curl_cshutdn_dest_count(cpool->idata, conn->destination);
  426|      0|    }
  427|      0|    if((live + shutdowns) >= dest_limit) {
  ------------------
  |  Branch (427:8): [True: 0, False: 0]
  ------------------
  428|      0|      res = CPOOL_LIMIT_DEST;
  ------------------
  |  |   91|      0|#define CPOOL_LIMIT_DEST   1
  ------------------
  429|      0|      goto out;
  430|      0|    }
  431|      0|  }
  432|       |
  433|      0|  if(total_limit) {
  ------------------
  |  Branch (433:6): [True: 0, False: 0]
  ------------------
  434|      0|    shutdowns = Curl_cshutdn_count(cpool->idata);
  435|      0|    while((cpool->num_conn + shutdowns) >= total_limit) {
  ------------------
  |  Branch (435:11): [True: 0, False: 0]
  ------------------
  436|      0|      if(shutdowns) {
  ------------------
  |  Branch (436:10): [True: 0, False: 0]
  ------------------
  437|       |        /* close one connection in shutdown right away, if we can */
  438|      0|        if(!Curl_cshutdn_close_oldest(data, NULL))
  ------------------
  |  Branch (438:12): [True: 0, False: 0]
  ------------------
  439|      0|          break;
  440|      0|      }
  441|      0|      else {
  442|      0|        struct connectdata *oldest_idle =
  443|      0|          cpool_get_oldest_idle(cpool, Curl_pgrs_now(data));
  444|      0|        if(!oldest_idle)
  ------------------
  |  Branch (444:12): [True: 0, False: 0]
  ------------------
  445|      0|          break;
  446|       |        /* disconnect the old conn and continue */
  447|      0|        CURL_TRC_M(data, "Discarding connection #%"
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  448|      0|                   FMT_OFF_T " from %zu to reach total "
  449|      0|                   "limit of %zu",
  450|      0|                   oldest_idle->connection_id, cpool->num_conn, total_limit);
  451|      0|        Curl_conn_terminate(cpool->idata, oldest_idle, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  452|      0|      }
  453|      0|      shutdowns = Curl_cshutdn_count(cpool->idata);
  454|      0|    }
  455|      0|    if((cpool->num_conn + shutdowns) >= total_limit) {
  ------------------
  |  Branch (455:8): [True: 0, False: 0]
  ------------------
  456|      0|      res = CPOOL_LIMIT_TOTAL;
  ------------------
  |  |   92|      0|#define CPOOL_LIMIT_TOTAL  2
  ------------------
  457|      0|      goto out;
  458|      0|    }
  459|      0|  }
  460|       |
  461|      0|out:
  462|      0|  CPOOL_UNLOCK(cpool, cpool->idata);
  ------------------
  |  |   53|      0|  do {                                                                  \
  |  |   54|      0|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (54:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   56|      0|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   57|      0|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|      0|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|      0|        Curl_share_unlock((d), CURL_LOCK_DATA_CONNECT);                 \
  |  |   59|      0|    }                                                                   \
  |  |   60|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (60:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (462:3): [True: 0, False: 0]
  |  Branch (462:3): [True: 0, False: 0]
  ------------------
  463|      0|  return res;
  464|      0|}
Curl_cpool_add:
  468|  13.7k|{
  469|  13.7k|  CURLcode result = CURLE_OK;
  470|  13.7k|  struct cpool_bundle *bundle = NULL;
  471|  13.7k|  struct cpool *cpool = cpool_get_instance(data);
  472|  13.7k|  DEBUGASSERT(conn);
  ------------------
  |  | 1081|  13.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (472:3): [True: 0, False: 13.7k]
  |  Branch (472:3): [True: 13.7k, False: 0]
  ------------------
  473|       |
  474|  13.7k|  DEBUGASSERT(cpool);
  ------------------
  |  | 1081|  13.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (474:3): [True: 0, False: 13.7k]
  |  Branch (474:3): [True: 13.7k, False: 0]
  ------------------
  475|  13.7k|  if(!cpool)
  ------------------
  |  Branch (475:6): [True: 0, False: 13.7k]
  ------------------
  476|      0|    return CURLE_FAILED_INIT;
  477|       |
  478|  13.7k|  CPOOL_LOCK(cpool, data);
  ------------------
  |  |   42|  13.7k|  do {                                                                  \
  |  |   43|  13.7k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (43:8): [True: 13.7k, False: 0]
  |  |  ------------------
  |  |   44|  13.7k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  13.7k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 13.7k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|  13.7k|        Curl_share_lock((d), CURL_LOCK_DATA_CONNECT,                    \
  |  |   46|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   47|  13.7k|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1081|  13.7k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   48|  13.7k|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  | 1055|  13.7k|#define TRUE true
  |  |  ------------------
  |  |   49|  13.7k|    }                                                                   \
  |  |   50|  13.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (50:11): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  |  Branch (478:3): [True: 0, False: 13.7k]
  |  Branch (478:3): [True: 13.7k, False: 0]
  ------------------
  479|  13.7k|  bundle = cpool_find_bundle(cpool, conn);
  480|  13.7k|  if(!bundle) {
  ------------------
  |  Branch (480:6): [True: 13.6k, False: 84]
  ------------------
  481|  13.6k|    bundle = cpool_add_bundle(cpool, conn);
  482|  13.6k|    if(!bundle) {
  ------------------
  |  Branch (482:8): [True: 0, False: 13.6k]
  ------------------
  483|      0|      result = CURLE_OUT_OF_MEMORY;
  484|      0|      goto out;
  485|      0|    }
  486|  13.6k|  }
  487|       |
  488|  13.7k|  cpool_bundle_add(bundle, conn);
  489|  13.7k|  conn->connection_id = cpool->next_connection_id++;
  490|  13.7k|  cpool->num_conn++;
  491|  13.7k|  CURL_TRC_M(data, "[CPOOL] added connection %" FMT_OFF_T ". "
  ------------------
  |  |  148|  13.7k|  do {                                   \
  |  |  149|  13.7k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  13.7k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  13.7k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  27.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 13.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 13.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  27.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  13.7k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  13.7k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  13.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  492|  13.7k|             "The cache now contains %zu members",
  493|  13.7k|             conn->connection_id, cpool->num_conn);
  494|  13.7k|out:
  495|  13.7k|  CPOOL_UNLOCK(cpool, data);
  ------------------
  |  |   53|  13.7k|  do {                                                                  \
  |  |   54|  13.7k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (54:8): [True: 13.7k, False: 0]
  |  |  ------------------
  |  |   55|  13.7k|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1081|  13.7k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   56|  13.7k|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  | 1058|  13.7k|#define FALSE false
  |  |  ------------------
  |  |   57|  13.7k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  13.7k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 13.7k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|  13.7k|        Curl_share_unlock((d), CURL_LOCK_DATA_CONNECT);                 \
  |  |   59|  13.7k|    }                                                                   \
  |  |   60|  13.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (60:11): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  |  Branch (495:3): [True: 0, False: 13.7k]
  |  Branch (495:3): [True: 13.7k, False: 0]
  ------------------
  496|       |
  497|  13.7k|  return result;
  498|  13.7k|}
Curl_cpool_conn_now_idle:
  555|  2.40k|{
  556|  2.40k|  unsigned int maxconnects;
  557|  2.40k|  struct connectdata *oldest_idle = NULL;
  558|  2.40k|  struct cpool *cpool = cpool_get_instance(data);
  559|  2.40k|  bool kept = TRUE;
  ------------------
  |  | 1055|  2.40k|#define TRUE true
  ------------------
  560|       |
  561|  2.40k|  if(!data || !data->multi)
  ------------------
  |  Branch (561:6): [True: 0, False: 2.40k]
  |  Branch (561:15): [True: 0, False: 2.40k]
  ------------------
  562|      0|    return kept;
  563|       |
  564|  2.40k|  if(!data->multi->maxconnects) {
  ------------------
  |  Branch (564:6): [True: 2.40k, False: 0]
  ------------------
  565|  2.40k|    unsigned int running = Curl_multi_xfers_running(data->multi);
  566|  2.40k|    maxconnects = (running <= UINT_MAX / 4) ? running * 4 : UINT_MAX;
  ------------------
  |  Branch (566:19): [True: 2.40k, False: 0]
  ------------------
  567|  2.40k|  }
  568|      0|  else {
  569|      0|    maxconnects = data->multi->maxconnects;
  570|      0|  }
  571|       |
  572|  2.40k|  conn->lastused = *Curl_pgrs_now(data); /* it was used up until now */
  573|  2.40k|  if(cpool && maxconnects) {
  ------------------
  |  Branch (573:6): [True: 2.40k, False: 0]
  |  Branch (573:15): [True: 2.40k, False: 0]
  ------------------
  574|       |    /* may be called form a callback already under lock */
  575|  2.40k|    bool do_lock = !CPOOL_IS_LOCKED(cpool);
  ------------------
  |  |   39|  2.40k|#define CPOOL_IS_LOCKED(c)    ((c) && (c)->locked)
  |  |  ------------------
  |  |  |  Branch (39:32): [True: 2.40k, False: 0]
  |  |  |  Branch (39:39): [True: 2.40k, False: 0]
  |  |  ------------------
  ------------------
  576|  2.40k|    if(do_lock)
  ------------------
  |  Branch (576:8): [True: 0, False: 2.40k]
  ------------------
  577|      0|      CPOOL_LOCK(cpool, data);
  ------------------
  |  |   42|      0|  do {                                                                  \
  |  |   43|      0|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (43:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   44|      0|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|      0|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|      0|        Curl_share_lock((d), CURL_LOCK_DATA_CONNECT,                    \
  |  |   46|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   47|      0|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   48|      0|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  |  |   49|      0|    }                                                                   \
  |  |   50|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (50:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (577:7): [True: 0, False: 0]
  |  Branch (577:7): [True: 0, False: 0]
  ------------------
  578|  2.40k|    if(cpool->num_conn > maxconnects) {
  ------------------
  |  Branch (578:8): [True: 0, False: 2.40k]
  ------------------
  579|      0|      infof(data, "Connection pool is full, closing the oldest of %zu/%u",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  580|      0|            cpool->num_conn, maxconnects);
  581|       |
  582|      0|      oldest_idle = cpool_get_oldest_idle(cpool, Curl_pgrs_now(data));
  583|      0|      kept = (oldest_idle != conn);
  584|      0|      if(oldest_idle) {
  ------------------
  |  Branch (584:10): [True: 0, False: 0]
  ------------------
  585|      0|        Curl_conn_terminate(data, oldest_idle, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  586|      0|      }
  587|      0|    }
  588|  2.40k|    if(do_lock)
  ------------------
  |  Branch (588:8): [True: 0, False: 2.40k]
  ------------------
  589|      0|      CPOOL_UNLOCK(cpool, data);
  ------------------
  |  |   53|      0|  do {                                                                  \
  |  |   54|      0|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (54:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   56|      0|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   57|      0|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|      0|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|      0|        Curl_share_unlock((d), CURL_LOCK_DATA_CONNECT);                 \
  |  |   59|      0|    }                                                                   \
  |  |   60|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (60:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (589:7): [True: 0, False: 0]
  |  Branch (589:7): [True: 0, False: 0]
  ------------------
  590|  2.40k|  }
  591|       |
  592|  2.40k|  return kept;
  593|  2.40k|}
Curl_cpool_find:
  600|  13.9k|{
  601|  13.9k|  struct cpool *cpool = cpool_get_instance(data);
  602|  13.9k|  struct cpool_bundle *bundle;
  603|  13.9k|  bool found = FALSE;
  ------------------
  |  | 1058|  13.9k|#define FALSE false
  ------------------
  604|       |
  605|  13.9k|  DEBUGASSERT(cpool);
  ------------------
  |  | 1081|  13.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (605:3): [True: 0, False: 13.9k]
  |  Branch (605:3): [True: 13.9k, False: 0]
  ------------------
  606|  13.9k|  DEBUGASSERT(conn_cb);
  ------------------
  |  | 1081|  13.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (606:3): [True: 0, False: 13.9k]
  |  Branch (606:3): [True: 13.9k, False: 0]
  ------------------
  607|  13.9k|  if(!cpool)
  ------------------
  |  Branch (607:6): [True: 0, False: 13.9k]
  ------------------
  608|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  609|       |
  610|  13.9k|  CPOOL_LOCK(cpool, data);
  ------------------
  |  |   42|  13.9k|  do {                                                                  \
  |  |   43|  13.9k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (43:8): [True: 13.9k, False: 0]
  |  |  ------------------
  |  |   44|  13.9k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  13.9k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 13.9k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|  13.9k|        Curl_share_lock((d), CURL_LOCK_DATA_CONNECT,                    \
  |  |   46|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   47|  13.9k|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1081|  13.9k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   48|  13.9k|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  | 1055|  13.9k|#define TRUE true
  |  |  ------------------
  |  |   49|  13.9k|    }                                                                   \
  |  |   50|  13.9k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (50:11): [Folded, False: 13.9k]
  |  |  ------------------
  ------------------
  |  Branch (610:3): [True: 0, False: 13.9k]
  |  Branch (610:3): [True: 13.9k, False: 0]
  ------------------
  611|  13.9k|  bundle = Curl_hash_pick(&cpool->dest2bundle,
  612|  13.9k|                          CURL_UNCONST(destination),
  ------------------
  |  |  866|  13.9k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  613|  13.9k|                          strlen(destination) + 1);
  614|  13.9k|  if(bundle) {
  ------------------
  |  Branch (614:6): [True: 628, False: 13.2k]
  ------------------
  615|    628|    struct Curl_llist_node *curr = Curl_llist_head(&bundle->conns);
  616|  1.14k|    while(curr) {
  ------------------
  |  Branch (616:11): [True: 628, False: 519]
  ------------------
  617|    628|      struct connectdata *conn = Curl_node_elem(curr);
  618|       |      /* Get next node now. callback might discard current */
  619|    628|      curr = Curl_node_next(curr);
  620|       |
  621|    628|      if(conn_cb(conn, userdata)) {
  ------------------
  |  Branch (621:10): [True: 109, False: 519]
  ------------------
  622|    109|        found = TRUE;
  ------------------
  |  | 1055|    109|#define TRUE true
  ------------------
  623|    109|        break;
  624|    109|      }
  625|    628|    }
  626|    628|  }
  627|       |
  628|  13.9k|  if(done_cb) {
  ------------------
  |  Branch (628:6): [True: 13.9k, False: 0]
  ------------------
  629|  13.9k|    found = done_cb(userdata);
  630|  13.9k|  }
  631|  13.9k|  CPOOL_UNLOCK(cpool, data);
  ------------------
  |  |   53|  13.9k|  do {                                                                  \
  |  |   54|  13.9k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (54:8): [True: 13.9k, False: 0]
  |  |  ------------------
  |  |   55|  13.9k|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1081|  13.9k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   56|  13.9k|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  | 1058|  13.9k|#define FALSE false
  |  |  ------------------
  |  |   57|  13.9k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  13.9k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 13.9k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|  13.9k|        Curl_share_unlock((d), CURL_LOCK_DATA_CONNECT);                 \
  |  |   59|  13.9k|    }                                                                   \
  |  |   60|  13.9k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (60:11): [Folded, False: 13.9k]
  |  |  ------------------
  ------------------
  |  Branch (631:3): [True: 0, False: 13.9k]
  |  Branch (631:3): [True: 13.9k, False: 0]
  ------------------
  632|  13.9k|  return found;
  633|  13.9k|}
Curl_conn_terminate:
  638|  11.8k|{
  639|  11.8k|  struct cpool *cpool = cpool_get_instance(data);
  640|  11.8k|  bool do_lock;
  641|       |
  642|  11.8k|  DEBUGASSERT(cpool);
  ------------------
  |  | 1081|  11.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (642:3): [True: 0, False: 11.8k]
  |  Branch (642:3): [True: 11.8k, False: 0]
  ------------------
  643|  11.8k|  DEBUGASSERT(data && !data->conn);
  ------------------
  |  | 1081|  11.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (643:3): [True: 0, False: 11.8k]
  |  Branch (643:3): [True: 0, False: 0]
  |  Branch (643:3): [True: 11.8k, False: 0]
  |  Branch (643:3): [True: 11.8k, False: 0]
  ------------------
  644|  11.8k|  if(!cpool)
  ------------------
  |  Branch (644:6): [True: 0, False: 11.8k]
  ------------------
  645|      0|    return;
  646|       |
  647|       |  /* If this connection is not marked to force-close, leave it open if there
  648|       |   * are other users of it */
  649|  11.8k|  if(CONN_INUSE(conn) && !aborted) {
  ------------------
  |  |  346|  23.6k|#define CONN_INUSE(c) (!!(c)->attached_xfers)
  |  |  ------------------
  |  |  |  Branch (346:23): [True: 0, False: 11.8k]
  |  |  ------------------
  ------------------
  |  Branch (649:26): [True: 0, False: 0]
  ------------------
  650|      0|    DEBUGASSERT(0); /* does this ever happen? */
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (650:5): [Folded, False: 0]
  |  Branch (650:5): [Folded, False: 0]
  ------------------
  651|      0|    DEBUGF(infof(data, "conn terminate when inuse: %u", conn->attached_xfers));
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
  652|      0|    return;
  653|      0|  }
  654|       |
  655|       |  /* This method may be called while we are under lock, e.g. from a
  656|       |   * user callback in find. */
  657|  11.8k|  do_lock = !CPOOL_IS_LOCKED(cpool);
  ------------------
  |  |   39|  11.8k|#define CPOOL_IS_LOCKED(c)    ((c) && (c)->locked)
  |  |  ------------------
  |  |  |  Branch (39:32): [True: 11.8k, False: 0]
  |  |  |  Branch (39:39): [True: 11.7k, False: 53]
  |  |  ------------------
  ------------------
  658|  11.8k|  if(do_lock)
  ------------------
  |  Branch (658:6): [True: 53, False: 11.7k]
  ------------------
  659|     53|    CPOOL_LOCK(cpool, data);
  ------------------
  |  |   42|     53|  do {                                                                  \
  |  |   43|     53|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (43:8): [True: 53, False: 0]
  |  |  ------------------
  |  |   44|     53|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|     53|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 53]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|     53|        Curl_share_lock((d), CURL_LOCK_DATA_CONNECT,                    \
  |  |   46|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   47|     53|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1081|     53|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   48|     53|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  | 1055|     53|#define TRUE true
  |  |  ------------------
  |  |   49|     53|    }                                                                   \
  |  |   50|     53|  } while(0)
  |  |  ------------------
  |  |  |  Branch (50:11): [Folded, False: 53]
  |  |  ------------------
  ------------------
  |  Branch (659:5): [True: 0, False: 53]
  |  Branch (659:5): [True: 53, False: 0]
  ------------------
  660|       |
  661|  11.8k|  if(conn->bits.in_cpool) {
  ------------------
  |  Branch (661:6): [True: 11.8k, False: 0]
  ------------------
  662|  11.8k|    cpool_remove_conn(cpool, conn);
  663|  11.8k|    DEBUGASSERT(!conn->bits.in_cpool);
  ------------------
  |  | 1081|  11.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (663:5): [True: 0, False: 11.8k]
  |  Branch (663:5): [True: 11.8k, False: 0]
  ------------------
  664|  11.8k|  }
  665|       |
  666|       |  /* treat the connection as aborted in CONNECT_ONLY situations,
  667|       |   * so no graceful shutdown is attempted. */
  668|  11.8k|  if(conn->bits.connect_only)
  ------------------
  |  Branch (668:6): [True: 116, False: 11.7k]
  ------------------
  669|    116|    aborted = TRUE;
  ------------------
  |  | 1055|    116|#define TRUE true
  ------------------
  670|       |
  671|  11.8k|  if(data->multi) {
  ------------------
  |  Branch (671:6): [True: 11.8k, False: 0]
  ------------------
  672|       |    /* Add it to the multi's cpool for shutdown handling */
  673|  11.8k|    infof(data, "%s connection #%" FMT_OFF_T,
  ------------------
  |  |  143|  11.8k|  do {                               \
  |  |  144|  11.8k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  11.8k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 11.8k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 11.8k]
  |  |  |  |  ------------------
  |  |  |  |  320|  11.8k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  11.8k|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|  11.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 11.8k]
  |  |  ------------------
  ------------------
  674|  11.8k|          aborted ? "closing" : "shutting down", conn->connection_id);
  675|  11.8k|    cpool_discard_conn(&data->multi->cpool, data, conn, aborted);
  676|  11.8k|  }
  677|      0|  else {
  678|       |    /* No multi available, terminate */
  679|      0|    infof(data, "closing connection #%" FMT_OFF_T, conn->connection_id);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  680|      0|    Curl_cshutdn_terminate(cpool->idata, conn, !aborted);
  681|      0|  }
  682|       |
  683|  11.8k|  if(do_lock)
  ------------------
  |  Branch (683:6): [True: 53, False: 11.7k]
  ------------------
  684|       |    CPOOL_UNLOCK(cpool, data);
  ------------------
  |  |   53|     53|  do {                                                                  \
  |  |   54|     53|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (54:8): [True: 53, False: 0]
  |  |  ------------------
  |  |   55|     53|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1081|     53|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   56|     53|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  | 1058|     53|#define FALSE false
  |  |  ------------------
  |  |   57|     53|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|     53|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 53]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|     53|        Curl_share_unlock((d), CURL_LOCK_DATA_CONNECT);                 \
  |  |   59|     53|    }                                                                   \
  |  |   60|     53|  } while(0)
  |  |  ------------------
  |  |  |  Branch (60:11): [Folded, False: 53]
  |  |  ------------------
  ------------------
  |  Branch (684:5): [True: 0, False: 53]
  |  Branch (684:5): [True: 53, False: 0]
  ------------------
  685|  11.8k|}
Curl_cpool_prune_dead:
  719|  14.0k|{
  720|  14.0k|  struct cpool *cpool = cpool_get_instance(data);
  721|  14.0k|  struct cpool_reaper_ctx reaper;
  722|  14.0k|  timediff_t elapsed;
  723|       |
  724|  14.0k|  if(!cpool)
  ------------------
  |  Branch (724:6): [True: 0, False: 14.0k]
  ------------------
  725|      0|    return;
  726|       |
  727|  14.0k|  memset(&reaper, 0, sizeof(reaper));
  728|  14.0k|  CPOOL_LOCK(cpool, data);
  ------------------
  |  |   42|  14.0k|  do {                                                                  \
  |  |   43|  14.0k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (43:8): [True: 14.0k, False: 0]
  |  |  ------------------
  |  |   44|  14.0k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  14.0k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 14.0k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|  14.0k|        Curl_share_lock((d), CURL_LOCK_DATA_CONNECT,                    \
  |  |   46|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   47|  14.0k|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1081|  14.0k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   48|  14.0k|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  | 1055|  14.0k|#define TRUE true
  |  |  ------------------
  |  |   49|  14.0k|    }                                                                   \
  |  |   50|  14.0k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (50:11): [Folded, False: 14.0k]
  |  |  ------------------
  ------------------
  |  Branch (728:3): [True: 0, False: 14.0k]
  |  Branch (728:3): [True: 14.0k, False: 0]
  ------------------
  729|  14.0k|  elapsed = curlx_ptimediff_ms(Curl_pgrs_now(data), &cpool->last_cleanup);
  730|       |
  731|  14.0k|  if(elapsed >= 1000L) {
  ------------------
  |  Branch (731:6): [True: 12.5k, False: 1.51k]
  ------------------
  732|  12.5k|    while(cpool_foreach(data, cpool, &reaper, cpool_reap_dead_cb))
  ------------------
  |  Branch (732:11): [True: 0, False: 12.5k]
  ------------------
  733|      0|      ;
  734|  12.5k|    cpool->last_cleanup = *Curl_pgrs_now(data);
  735|  12.5k|  }
  736|       |  CPOOL_UNLOCK(cpool, data);
  ------------------
  |  |   53|  14.0k|  do {                                                                  \
  |  |   54|  14.0k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (54:8): [True: 14.0k, False: 0]
  |  |  ------------------
  |  |   55|  14.0k|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1081|  14.0k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   56|  14.0k|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  | 1058|  14.0k|#define FALSE false
  |  |  ------------------
  |  |   57|  14.0k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  14.0k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 14.0k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|  14.0k|        Curl_share_unlock((d), CURL_LOCK_DATA_CONNECT);                 \
  |  |   59|  14.0k|    }                                                                   \
  |  |   60|  14.0k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (60:11): [Folded, False: 14.0k]
  |  |  ------------------
  ------------------
  |  Branch (736:3): [True: 0, False: 14.0k]
  |  Branch (736:3): [True: 14.0k, False: 0]
  ------------------
  737|  14.0k|}
Curl_cpool_get_conn:
  780|     53|{
  781|     53|  struct cpool *cpool = cpool_get_instance(data);
  782|     53|  struct cpool_find_ctx fctx;
  783|       |
  784|     53|  if(!cpool)
  ------------------
  |  Branch (784:6): [True: 0, False: 53]
  ------------------
  785|      0|    return NULL;
  786|     53|  fctx.id = conn_id;
  787|     53|  fctx.conn = NULL;
  788|     53|  CPOOL_LOCK(cpool, data);
  ------------------
  |  |   42|     53|  do {                                                                  \
  |  |   43|     53|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (43:8): [True: 53, False: 0]
  |  |  ------------------
  |  |   44|     53|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|     53|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 53]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|     53|        Curl_share_lock((d), CURL_LOCK_DATA_CONNECT,                    \
  |  |   46|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   47|     53|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1081|     53|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   48|     53|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  | 1055|     53|#define TRUE true
  |  |  ------------------
  |  |   49|     53|    }                                                                   \
  |  |   50|     53|  } while(0)
  |  |  ------------------
  |  |  |  Branch (50:11): [Folded, False: 53]
  |  |  ------------------
  ------------------
  |  Branch (788:3): [True: 0, False: 53]
  |  Branch (788:3): [True: 53, False: 0]
  ------------------
  789|     53|  cpool_foreach(data, cpool, &fctx, cpool_find_conn);
  790|     53|  CPOOL_UNLOCK(cpool, data);
  ------------------
  |  |   53|     53|  do {                                                                  \
  |  |   54|     53|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (54:8): [True: 53, False: 0]
  |  |  ------------------
  |  |   55|     53|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1081|     53|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   56|     53|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  | 1058|     53|#define FALSE false
  |  |  ------------------
  |  |   57|     53|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|     53|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 53]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|     53|        Curl_share_unlock((d), CURL_LOCK_DATA_CONNECT);                 \
  |  |   59|     53|    }                                                                   \
  |  |   60|     53|  } while(0)
  |  |  ------------------
  |  |  |  Branch (60:11): [Folded, False: 53]
  |  |  ------------------
  ------------------
  |  Branch (790:3): [True: 0, False: 53]
  |  Branch (790:3): [True: 53, False: 0]
  ------------------
  791|     53|  return fctx.conn;
  792|     53|}
Curl_cpool_do_by_id:
  814|  2.33k|{
  815|  2.33k|  struct cpool *cpool = cpool_get_instance(data);
  816|  2.33k|  struct cpool_do_conn_ctx dctx;
  817|       |
  818|  2.33k|  if(!cpool)
  ------------------
  |  Branch (818:6): [True: 0, False: 2.33k]
  ------------------
  819|      0|    return;
  820|  2.33k|  dctx.id = conn_id;
  821|  2.33k|  dctx.cb = cb;
  822|  2.33k|  dctx.cbdata = cbdata;
  823|  2.33k|  CPOOL_LOCK(cpool, data);
  ------------------
  |  |   42|  2.33k|  do {                                                                  \
  |  |   43|  2.33k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (43:8): [True: 2.33k, False: 0]
  |  |  ------------------
  |  |   44|  2.33k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  2.33k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 2.33k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|  2.33k|        Curl_share_lock((d), CURL_LOCK_DATA_CONNECT,                    \
  |  |   46|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   47|  2.33k|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1081|  2.33k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   48|  2.33k|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  | 1055|  2.33k|#define TRUE true
  |  |  ------------------
  |  |   49|  2.33k|    }                                                                   \
  |  |   50|  2.33k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (50:11): [Folded, False: 2.33k]
  |  |  ------------------
  ------------------
  |  Branch (823:3): [True: 0, False: 2.33k]
  |  Branch (823:3): [True: 2.33k, False: 0]
  ------------------
  824|  2.33k|  cpool_foreach(data, cpool, &dctx, cpool_do_conn);
  825|       |  CPOOL_UNLOCK(cpool, data);
  ------------------
  |  |   53|  2.33k|  do {                                                                  \
  |  |   54|  2.33k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (54:8): [True: 2.33k, False: 0]
  |  |  ------------------
  |  |   55|  2.33k|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1081|  2.33k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   56|  2.33k|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  | 1058|  2.33k|#define FALSE false
  |  |  ------------------
  |  |   57|  2.33k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  2.33k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 2.33k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|  2.33k|        Curl_share_unlock((d), CURL_LOCK_DATA_CONNECT);                 \
  |  |   59|  2.33k|    }                                                                   \
  |  |   60|  2.33k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (60:11): [Folded, False: 2.33k]
  |  |  ------------------
  ------------------
  |  Branch (825:3): [True: 0, False: 2.33k]
  |  Branch (825:3): [True: 2.33k, False: 0]
  ------------------
  826|  2.33k|}
Curl_cpool_do_locked:
  831|  13.8k|{
  832|  13.8k|  struct cpool *cpool = cpool_get_instance(data);
  833|  13.8k|  if(cpool) {
  ------------------
  |  Branch (833:6): [True: 13.8k, False: 0]
  ------------------
  834|  13.8k|    CPOOL_LOCK(cpool, data);
  ------------------
  |  |   42|  13.8k|  do {                                                                  \
  |  |   43|  13.8k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (43:8): [True: 13.8k, False: 0]
  |  |  ------------------
  |  |   44|  13.8k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  13.8k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 13.8k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   45|  13.8k|        Curl_share_lock((d), CURL_LOCK_DATA_CONNECT,                    \
  |  |   46|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   47|  13.8k|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1081|  13.8k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   48|  13.8k|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  | 1055|  13.8k|#define TRUE true
  |  |  ------------------
  |  |   49|  13.8k|    }                                                                   \
  |  |   50|  13.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (50:11): [Folded, False: 13.8k]
  |  |  ------------------
  ------------------
  |  Branch (834:5): [True: 0, False: 13.8k]
  |  Branch (834:5): [True: 13.8k, False: 0]
  ------------------
  835|  13.8k|    cb(conn, data, cbdata);
  836|  13.8k|    CPOOL_UNLOCK(cpool, data);
  ------------------
  |  |   53|  13.8k|  do {                                                                  \
  |  |   54|  13.8k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (54:8): [True: 13.8k, False: 0]
  |  |  ------------------
  |  |   55|  13.8k|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1081|  13.8k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   56|  13.8k|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  | 1058|  13.8k|#define FALSE false
  |  |  ------------------
  |  |   57|  13.8k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   41|  13.8k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:4): [True: 0, False: 13.8k]
  |  |  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   58|  13.8k|        Curl_share_unlock((d), CURL_LOCK_DATA_CONNECT);                 \
  |  |   59|  13.8k|    }                                                                   \
  |  |   60|  13.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (60:11): [Folded, False: 13.8k]
  |  |  ------------------
  ------------------
  |  Branch (836:5): [True: 0, False: 13.8k]
  |  Branch (836:5): [True: 13.8k, False: 0]
  ------------------
  837|  13.8k|  }
  838|      0|  else
  839|      0|    cb(conn, data, cbdata);
  840|  13.8k|}
conncache.c:cpool_bundle_free_entry:
  109|  13.6k|{
  110|  13.6k|  cpool_bundle_destroy((struct cpool_bundle *)freethis);
  111|  13.6k|}
conncache.c:cpool_bundle_destroy:
   84|  13.6k|{
   85|  13.6k|  DEBUGASSERT(!Curl_llist_count(&bundle->conns));
  ------------------
  |  | 1081|  13.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (85:3): [True: 0, False: 13.6k]
  |  Branch (85:3): [True: 13.6k, False: 0]
  ------------------
   86|  13.6k|  curlx_free(bundle);
  ------------------
  |  | 1483|  13.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   87|  13.6k|}
conncache.c:cpool_get_first:
  130|  19.1k|{
  131|  19.1k|  struct Curl_hash_iterator iter;
  132|  19.1k|  struct Curl_hash_element *he;
  133|  19.1k|  struct cpool_bundle *bundle;
  134|  19.1k|  struct Curl_llist_node *conn_node;
  135|       |
  136|  19.1k|  Curl_hash_start_iterate(&cpool->dest2bundle, &iter);
  137|  19.1k|  for(he = Curl_hash_next_element(&iter); he;
  ------------------
  |  Branch (137:43): [True: 1.93k, False: 17.2k]
  ------------------
  138|  19.1k|      he = Curl_hash_next_element(&iter)) {
  139|  1.93k|    bundle = he->ptr;
  140|  1.93k|    conn_node = Curl_llist_head(&bundle->conns);
  141|  1.93k|    if(conn_node)
  ------------------
  |  Branch (141:8): [True: 1.93k, False: 0]
  ------------------
  142|  1.93k|      return Curl_node_elem(conn_node);
  143|  1.93k|  }
  144|  17.2k|  return NULL;
  145|  19.1k|}
conncache.c:cpool_remove_conn:
  164|  13.7k|{
  165|  13.7k|  struct Curl_llist *list = Curl_node_llist(&conn->cpool_node);
  166|  13.7k|  DEBUGASSERT(cpool);
  ------------------
  |  | 1081|  13.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (166:3): [True: 0, False: 13.7k]
  |  Branch (166:3): [True: 13.7k, False: 0]
  ------------------
  167|  13.7k|  if(list) {
  ------------------
  |  Branch (167:6): [True: 13.7k, False: 0]
  ------------------
  168|       |    /* The connection is certainly in the pool, but where? */
  169|  13.7k|    struct cpool_bundle *bundle = cpool_find_bundle(cpool, conn);
  170|  13.7k|    if(bundle && (list == &bundle->conns)) {
  ------------------
  |  Branch (170:8): [True: 13.7k, False: 0]
  |  Branch (170:18): [True: 13.7k, False: 0]
  ------------------
  171|  13.7k|      cpool_bundle_remove(bundle, conn);
  172|  13.7k|      if(!Curl_llist_count(&bundle->conns))
  ------------------
  |  Branch (172:10): [True: 13.6k, False: 84]
  ------------------
  173|  13.6k|        cpool_remove_bundle(cpool, bundle);
  174|  13.7k|      conn->bits.in_cpool = FALSE;
  ------------------
  |  | 1058|  13.7k|#define FALSE false
  ------------------
  175|  13.7k|      cpool->num_conn--;
  176|  13.7k|    }
  177|      0|    else {
  178|       |      /* Should have been in the bundle list */
  179|       |      DEBUGASSERT(NULL);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (179:7): [True: 0, False: 0]
  |  Branch (179:7): [True: 0, False: 0]
  ------------------
  180|      0|    }
  181|  13.7k|  }
  182|  13.7k|}
conncache.c:cpool_bundle_remove:
  101|  13.7k|{
  102|  13.7k|  (void)bundle;
  103|  13.7k|  DEBUGASSERT(Curl_node_llist(&conn->cpool_node) == &bundle->conns);
  ------------------
  |  | 1081|  13.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (103:3): [True: 0, False: 13.7k]
  |  Branch (103:3): [True: 13.7k, False: 0]
  ------------------
  104|  13.7k|  Curl_node_remove(&conn->cpool_node);
  105|       |  conn->bits.in_cpool = FALSE;
  ------------------
  |  | 1058|  13.7k|#define FALSE false
  ------------------
  106|  13.7k|}
conncache.c:cpool_remove_bundle:
  156|  13.6k|{
  157|  13.6k|  if(!cpool)
  ------------------
  |  Branch (157:6): [True: 0, False: 13.6k]
  ------------------
  158|      0|    return;
  159|  13.6k|  Curl_hash_delete(&cpool->dest2bundle, bundle->dest, bundle->dest_len);
  160|  13.6k|}
conncache.c:cpool_discard_conn:
  188|  13.7k|{
  189|  13.7k|  bool done = FALSE;
  ------------------
  |  | 1058|  13.7k|#define FALSE false
  ------------------
  190|       |
  191|  13.7k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  13.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (191:3): [True: 0, False: 13.7k]
  |  Branch (191:3): [True: 13.7k, False: 0]
  ------------------
  192|  13.7k|  DEBUGASSERT(!data->conn);
  ------------------
  |  | 1081|  13.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (192:3): [True: 0, False: 13.7k]
  |  Branch (192:3): [True: 13.7k, False: 0]
  ------------------
  193|  13.7k|  DEBUGASSERT(cpool);
  ------------------
  |  | 1081|  13.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (193:3): [True: 0, False: 13.7k]
  |  Branch (193:3): [True: 13.7k, False: 0]
  ------------------
  194|  13.7k|  DEBUGASSERT(!conn->bits.in_cpool);
  ------------------
  |  | 1081|  13.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (194:3): [True: 0, False: 13.7k]
  |  Branch (194:3): [True: 13.7k, False: 0]
  ------------------
  195|       |
  196|       |  /*
  197|       |   * If this connection is not marked to force-close, leave it open if there
  198|       |   * are other users of it
  199|       |   */
  200|  13.7k|  if(CONN_INUSE(conn) && !aborted) {
  ------------------
  |  |  346|  27.5k|#define CONN_INUSE(c) (!!(c)->attached_xfers)
  |  |  ------------------
  |  |  |  Branch (346:23): [True: 0, False: 13.7k]
  |  |  ------------------
  ------------------
  |  Branch (200:26): [True: 0, False: 0]
  ------------------
  201|      0|    CURL_TRC_M(data, "[CPOOL] not discarding #%" FMT_OFF_T
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  202|      0|               " still in use by %u transfers", conn->connection_id,
  203|      0|               conn->attached_xfers);
  204|      0|    return;
  205|      0|  }
  206|       |
  207|       |  /* treat the connection as aborted in CONNECT_ONLY situations, we do
  208|       |   * not know what the APP did with it. */
  209|  13.7k|  if(conn->bits.connect_only)
  ------------------
  |  Branch (209:6): [True: 147, False: 13.6k]
  ------------------
  210|    147|    aborted = TRUE;
  ------------------
  |  | 1055|    147|#define TRUE true
  ------------------
  211|  13.7k|  conn->bits.aborted = aborted;
  212|       |
  213|       |  /* We do not shutdown dead connections. The term 'dead' can be misleading
  214|       |   * here, as we also mark errored connections/transfers as 'dead'.
  215|       |   * If we do a shutdown for an aborted transfer, the server might think
  216|       |   * it was successful otherwise (for example an ftps: upload). This is
  217|       |   * not what we want. */
  218|  13.7k|  if(aborted)
  ------------------
  |  Branch (218:6): [True: 10.0k, False: 3.71k]
  ------------------
  219|  10.0k|    done = TRUE;
  ------------------
  |  | 1055|  10.0k|#define TRUE true
  ------------------
  220|  13.7k|  if(!done) {
  ------------------
  |  Branch (220:6): [True: 3.71k, False: 10.0k]
  ------------------
  221|       |    /* Attempt to shutdown the connection right away. */
  222|  3.71k|    Curl_cshutdn_run_once(cpool->idata, conn, &done);
  223|  3.71k|  }
  224|       |
  225|  13.7k|  if(done || !data->multi)
  ------------------
  |  Branch (225:6): [True: 13.7k, False: 0]
  |  Branch (225:14): [True: 0, False: 0]
  ------------------
  226|  13.7k|    Curl_cshutdn_terminate(cpool->idata, conn, FALSE);
  ------------------
  |  | 1058|  13.7k|#define FALSE false
  ------------------
  227|      0|  else
  228|      0|    Curl_cshutdn_add(&data->multi->cshutdn, conn, cpool->num_conn);
  229|  13.7k|}
conncache.c:cpool_get_instance:
  257|   103k|{
  258|   103k|  if(data) {
  ------------------
  |  Branch (258:6): [True: 103k, False: 0]
  ------------------
  259|   103k|    if(CURL_SHARE_KEEP_CONNECT(data->share))
  ------------------
  |  |   41|   103k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  ------------------
  |  |  |  Branch (41:4): [True: 0, False: 103k]
  |  |  |  Branch (41:11): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  260|      0|      return &data->share->cpool;
  261|   103k|    else if(data->multi_easy)
  ------------------
  |  Branch (261:13): [True: 0, False: 103k]
  ------------------
  262|      0|      return &data->multi_easy->cpool;
  263|   103k|    else if(data->multi)
  ------------------
  |  Branch (263:13): [True: 103k, False: 0]
  ------------------
  264|   103k|      return &data->multi->cpool;
  265|   103k|  }
  266|      0|  return NULL;
  267|   103k|}
conncache.c:cpool_find_bundle:
  149|  27.5k|{
  150|  27.5k|  return Curl_hash_pick(&cpool->dest2bundle,
  151|  27.5k|                        conn->destination, strlen(conn->destination) + 1);
  152|  27.5k|}
conncache.c:cpool_add_bundle:
  293|  13.6k|{
  294|  13.6k|  struct cpool_bundle *bundle;
  295|       |
  296|  13.6k|  bundle = cpool_bundle_create(conn->destination);
  297|  13.6k|  if(!bundle)
  ------------------
  |  Branch (297:6): [True: 0, False: 13.6k]
  ------------------
  298|      0|    return NULL;
  299|       |
  300|  13.6k|  if(!Curl_hash_add(&cpool->dest2bundle,
  ------------------
  |  Branch (300:6): [True: 0, False: 13.6k]
  ------------------
  301|  13.6k|                    bundle->dest, bundle->dest_len, bundle)) {
  302|      0|    cpool_bundle_destroy(bundle);
  303|      0|    return NULL;
  304|      0|  }
  305|  13.6k|  return bundle;
  306|  13.6k|}
conncache.c:cpool_bundle_create:
   70|  13.6k|{
   71|  13.6k|  struct cpool_bundle *bundle;
   72|  13.6k|  size_t dest_len = strlen(dest) + 1;
   73|       |
   74|  13.6k|  bundle = curlx_calloc(1, sizeof(*bundle) + dest_len - 1);
  ------------------
  |  | 1480|  13.6k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   75|  13.6k|  if(!bundle)
  ------------------
  |  Branch (75:6): [True: 0, False: 13.6k]
  ------------------
   76|      0|    return NULL;
   77|  13.6k|  Curl_llist_init(&bundle->conns, NULL);
   78|  13.6k|  bundle->dest_len = dest_len;
   79|  13.6k|  memcpy(bundle->dest, dest, bundle->dest_len);
   80|  13.6k|  return bundle;
   81|  13.6k|}
conncache.c:cpool_bundle_add:
   92|  13.7k|{
   93|  13.7k|  DEBUGASSERT(!Curl_node_llist(&conn->cpool_node));
  ------------------
  |  | 1081|  13.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (93:3): [True: 0, False: 13.7k]
  |  Branch (93:3): [True: 13.7k, False: 0]
  ------------------
   94|  13.7k|  Curl_llist_append(&bundle->conns, conn, &conn->cpool_node);
   95|       |  conn->bits.in_cpool = TRUE;
  ------------------
  |  | 1055|  13.7k|#define TRUE true
  ------------------
   96|  13.7k|}
conncache.c:cpool_foreach:
  517|  14.9k|{
  518|  14.9k|  struct Curl_hash_iterator iter;
  519|  14.9k|  struct Curl_hash_element *he;
  520|       |
  521|  14.9k|  if(!cpool)
  ------------------
  |  Branch (521:6): [True: 0, False: 14.9k]
  ------------------
  522|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  523|       |
  524|  14.9k|  Curl_hash_start_iterate(&cpool->dest2bundle, &iter);
  525|       |
  526|  14.9k|  he = Curl_hash_next_element(&iter);
  527|  14.9k|  while(he) {
  ------------------
  |  Branch (527:9): [True: 1.99k, False: 12.9k]
  ------------------
  528|  1.99k|    struct Curl_llist_node *curr;
  529|  1.99k|    struct cpool_bundle *bundle = he->ptr;
  530|  1.99k|    he = Curl_hash_next_element(&iter);
  531|       |
  532|  1.99k|    curr = Curl_llist_head(&bundle->conns);
  533|  2.05k|    while(curr) {
  ------------------
  |  Branch (533:11): [True: 2.02k, False: 31]
  ------------------
  534|       |      /* Yes, we need to update curr before calling func(), because func()
  535|       |         might decide to remove the connection */
  536|  2.02k|      struct connectdata *conn = Curl_node_elem(curr);
  537|  2.02k|      curr = Curl_node_next(curr);
  538|       |
  539|  2.02k|      if(func(data, conn, param) == 1) {
  ------------------
  |  Branch (539:10): [True: 1.95k, False: 62]
  ------------------
  540|  1.95k|        return TRUE;
  ------------------
  |  | 1055|  1.95k|#define TRUE true
  ------------------
  541|  1.95k|      }
  542|  2.02k|    }
  543|  1.99k|  }
  544|  12.9k|  return FALSE;
  ------------------
  |  | 1058|  12.9k|#define FALSE false
  ------------------
  545|  14.9k|}
conncache.c:cpool_find_conn:
  768|     84|{
  769|     84|  struct cpool_find_ctx *fctx = param;
  770|     84|  (void)data;
  771|     84|  if(conn->connection_id == fctx->id) {
  ------------------
  |  Branch (771:6): [True: 53, False: 31]
  ------------------
  772|     53|    fctx->conn = conn;
  773|     53|    return 1;
  774|     53|  }
  775|     31|  return 0;
  776|     84|}
conncache.c:cpool_do_conn:
  802|  1.93k|{
  803|  1.93k|  struct cpool_do_conn_ctx *dctx = param;
  804|       |
  805|  1.93k|  if(conn->connection_id == dctx->id) {
  ------------------
  |  Branch (805:6): [True: 1.90k, False: 31]
  ------------------
  806|  1.90k|    dctx->cb(conn, data, dctx->cbdata);
  807|  1.90k|    return 1;
  808|  1.90k|  }
  809|     31|  return 0;
  810|  1.93k|}

timeleft_now_ms:
  112|  7.26M|{
  113|  7.26M|  timediff_t timeleft_ms = 0;
  114|  7.26M|  timediff_t ctimeleft_ms = 0;
  115|       |
  116|  7.26M|  if(Curl_shutdown_started(data, FIRSTSOCKET))
  ------------------
  |  |  303|  7.26M|#define FIRSTSOCKET     0
  ------------------
  |  Branch (116:6): [True: 899, False: 7.26M]
  ------------------
  117|    899|    return Curl_shutdown_timeleft(data, data->conn, FIRSTSOCKET);
  ------------------
  |  |  303|    899|#define FIRSTSOCKET     0
  ------------------
  118|  7.26M|  else if(Curl_is_connecting(data)) {
  ------------------
  |  Branch (118:11): [True: 440k, False: 6.82M]
  ------------------
  119|   440k|    timediff_t ctimeout_ms = (data->set.connecttimeout > 0) ?
  ------------------
  |  Branch (119:30): [True: 16.6k, False: 423k]
  ------------------
  120|   423k|      data->set.connecttimeout : DEFAULT_CONNECT_TIMEOUT;
  ------------------
  |  |   43|   423k|#define DEFAULT_CONNECT_TIMEOUT 300000 /* milliseconds == five minutes */
  ------------------
  121|   440k|    ctimeleft_ms = ctimeout_ms -
  122|   440k|      curlx_ptimediff_ms(pnow, &data->progress.t_startsingle);
  123|   440k|    if(!ctimeleft_ms)
  ------------------
  |  Branch (123:8): [True: 4, False: 440k]
  ------------------
  124|      4|      ctimeleft_ms = -1; /* 0 is "no limit", fake 1 ms expiry */
  125|   440k|  }
  126|  6.82M|  else if(!data->set.timeout || data->set.connect_only) {
  ------------------
  |  Branch (126:11): [True: 0, False: 6.82M]
  |  Branch (126:33): [True: 528, False: 6.82M]
  ------------------
  127|    528|    return 0; /* no timeout in place or checked, return "no limit" */
  128|    528|  }
  129|       |
  130|  7.26M|  if(data->set.timeout) {
  ------------------
  |  Branch (130:6): [True: 7.26M, False: 0]
  ------------------
  131|  7.26M|    timeleft_ms = data->set.timeout -
  132|  7.26M|      curlx_ptimediff_ms(pnow, &data->progress.t_startop);
  133|  7.26M|    if(!timeleft_ms)
  ------------------
  |  Branch (133:8): [True: 144, False: 7.26M]
  ------------------
  134|    144|      timeleft_ms = -1; /* 0 is "no limit", fake 1 ms expiry */
  135|  7.26M|  }
  136|       |
  137|  7.26M|  if(!ctimeleft_ms)
  ------------------
  |  Branch (137:6): [True: 6.82M, False: 440k]
  ------------------
  138|  6.82M|    return timeleft_ms;
  139|   440k|  else if(!timeleft_ms)
  ------------------
  |  Branch (139:11): [True: 0, False: 440k]
  ------------------
  140|      0|    return ctimeleft_ms;
  141|   440k|  return CURLMIN(ctimeleft_ms, timeleft_ms);
  ------------------
  |  | 1287|   440k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 4.24k, False: 435k]
  |  |  ------------------
  ------------------
  142|  7.26M|}
Curl_timeleft_ms:
  145|  7.26M|{
  146|  7.26M|  return timeleft_now_ms(data, Curl_pgrs_now(data));
  147|  7.26M|}
Curl_shutdown_start:
  151|  4.37k|{
  152|  4.37k|  struct connectdata *conn = data->conn;
  153|       |
  154|  4.37k|  DEBUGASSERT(conn);
  ------------------
  |  | 1081|  4.37k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (154:3): [True: 0, False: 4.37k]
  |  Branch (154:3): [True: 4.37k, False: 0]
  ------------------
  155|  4.37k|  conn->shutdown.start[sockindex] = *Curl_pgrs_now(data);
  156|  4.37k|  conn->shutdown.timeout_ms = (timeout_ms > 0) ?
  ------------------
  |  Branch (156:31): [True: 0, False: 4.37k]
  ------------------
  157|      0|    (timediff_t)timeout_ms :
  158|  4.37k|    ((data->set.shutdowntimeout > 0) ?
  ------------------
  |  Branch (158:6): [True: 0, False: 4.37k]
  ------------------
  159|  4.37k|     data->set.shutdowntimeout : DEFAULT_SHUTDOWN_TIMEOUT_MS);
  ------------------
  |  |   45|  4.37k|#define DEFAULT_SHUTDOWN_TIMEOUT_MS   (2 * 1000)
  ------------------
  160|       |  /* Set a timer, unless we operate on the admin handle */
  161|  4.37k|  if(data->mid)
  ------------------
  |  Branch (161:6): [True: 655, False: 3.71k]
  ------------------
  162|    655|    Curl_expire_ex(data, conn->shutdown.timeout_ms, EXPIRE_SHUTDOWN);
  163|  4.37k|  CURL_TRC_M(data, "shutdown start on%s connection",
  ------------------
  |  |  148|  4.37k|  do {                                   \
  |  |  149|  4.37k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  4.37k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  4.37k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  8.74k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 4.37k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4.37k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  8.74k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  4.37k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  4.37k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|  4.37k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 4.37k]
  |  |  ------------------
  ------------------
  164|  4.37k|             sockindex ? " secondary" : "");
  165|  4.37k|}
Curl_shutdown_timeleft:
  170|  4.61k|{
  171|  4.61k|  timediff_t left_ms;
  172|       |
  173|  4.61k|  if(!conn->shutdown.start[sockindex].tv_sec ||
  ------------------
  |  Branch (173:6): [True: 0, False: 4.61k]
  ------------------
  174|  4.61k|     (conn->shutdown.timeout_ms <= 0))
  ------------------
  |  Branch (174:6): [True: 0, False: 4.61k]
  ------------------
  175|      0|    return 0; /* not started or no limits */
  176|       |
  177|  4.61k|  left_ms = conn->shutdown.timeout_ms -
  178|  4.61k|            curlx_ptimediff_ms(Curl_pgrs_now(data),
  179|  4.61k|                               &conn->shutdown.start[sockindex]);
  180|  4.61k|  return left_ms ? left_ms : -1;
  ------------------
  |  Branch (180:10): [True: 4.61k, False: 0]
  ------------------
  181|  4.61k|}
Curl_shutdown_clear:
  200|  29.5k|{
  201|  29.5k|  struct curltime *pt = &data->conn->shutdown.start[sockindex];
  202|  29.5k|  memset(pt, 0, sizeof(*pt));
  203|  29.5k|}
Curl_shutdown_started:
  206|  10.6M|{
  207|  10.6M|  if(data->conn) {
  ------------------
  |  Branch (207:6): [True: 10.6M, False: 17.1k]
  ------------------
  208|  10.6M|    struct curltime *pt = &data->conn->shutdown.start[sockindex];
  209|  10.6M|    return (pt->tv_sec > 0) || (pt->tv_usec > 0);
  ------------------
  |  Branch (209:12): [True: 4.61k, False: 10.6M]
  |  Branch (209:32): [True: 0, False: 10.6M]
  ------------------
  210|  10.6M|  }
  211|  17.1k|  return FALSE;
  ------------------
  |  | 1058|  17.1k|#define FALSE false
  ------------------
  212|  10.6M|}
Curl_addr2string:
  218|  38.6k|{
  219|  38.6k|  struct sockaddr_in *si = NULL;
  220|  38.6k|#ifdef USE_IPV6
  221|  38.6k|  struct sockaddr_in6 *si6 = NULL;
  222|  38.6k|#endif
  223|  38.6k|#ifdef USE_UNIX_SOCKETS
  224|  38.6k|  struct sockaddr_un *su = NULL;
  225|       |#else
  226|       |  (void)salen;
  227|       |#endif
  228|       |
  229|  38.6k|  switch(sa->sa_family) {
  230|  13.8k|  case AF_INET:
  ------------------
  |  Branch (230:3): [True: 13.8k, False: 24.7k]
  ------------------
  231|  13.8k|    si = (struct sockaddr_in *)(void *)sa;
  232|  13.8k|    if(curlx_inet_ntop(sa->sa_family, &si->sin_addr, addr, MAX_IPADR_LEN)) {
  ------------------
  |  |   44|  13.8k|  inet_ntop(af, src, buf, (curl_socklen_t)(size))
  |  |  ------------------
  |  |  |  Branch (44:3): [True: 13.8k, False: 0]
  |  |  ------------------
  ------------------
  233|  13.8k|      *port = ntohs(si->sin_port);
  234|  13.8k|      return TRUE;
  ------------------
  |  | 1055|  13.8k|#define TRUE true
  ------------------
  235|  13.8k|    }
  236|      0|    break;
  237|      0|#ifdef USE_IPV6
  238|    129|  case AF_INET6:
  ------------------
  |  Branch (238:3): [True: 129, False: 38.4k]
  ------------------
  239|    129|    si6 = (struct sockaddr_in6 *)(void *)sa;
  240|    129|    if(curlx_inet_ntop(sa->sa_family, &si6->sin6_addr, addr, MAX_IPADR_LEN)) {
  ------------------
  |  |   44|    129|  inet_ntop(af, src, buf, (curl_socklen_t)(size))
  |  |  ------------------
  |  |  |  Branch (44:3): [True: 129, False: 0]
  |  |  ------------------
  ------------------
  241|    129|      *port = ntohs(si6->sin6_port);
  242|    129|      return TRUE;
  ------------------
  |  | 1055|    129|#define TRUE true
  ------------------
  243|    129|    }
  244|      0|    break;
  245|      0|#endif
  246|      0|#ifdef USE_UNIX_SOCKETS
  247|  24.6k|  case AF_UNIX:
  ------------------
  |  Branch (247:3): [True: 24.6k, False: 13.9k]
  ------------------
  248|  24.6k|    if(salen > (curl_socklen_t)sizeof(CURL_SA_FAMILY_T)) {
  ------------------
  |  Branch (248:8): [True: 108, False: 24.5k]
  ------------------
  249|    108|      su = (struct sockaddr_un *)sa;
  250|    108|      curl_msnprintf(addr, MAX_IPADR_LEN, "%s", su->sun_path);
  ------------------
  |  |   41|    108|#define MAX_IPADR_LEN sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")
  ------------------
  251|    108|    }
  252|  24.5k|    else
  253|  24.5k|      addr[0] = 0; /* socket with no name */
  254|  24.6k|    *port = 0;
  255|  24.6k|    return TRUE;
  ------------------
  |  | 1055|  24.6k|#define TRUE true
  ------------------
  256|      0|#endif
  257|      0|  default:
  ------------------
  |  Branch (257:3): [True: 0, False: 38.6k]
  ------------------
  258|      0|    break;
  259|  38.6k|  }
  260|       |
  261|      0|  addr[0] = '\0';
  262|      0|  *port = 0;
  263|      0|  errno = SOCKEAFNOSUPPORT;
  ------------------
  |  | 1124|      0|#define SOCKEAFNOSUPPORT  EAFNOSUPPORT
  ------------------
  264|       |  return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  265|  38.6k|}
Curl_getconnectinfo:
  275|     68|{
  276|     68|  DEBUGASSERT(data);
  ------------------
  |  | 1081|     68|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (276:3): [True: 0, False: 68]
  |  Branch (276:3): [True: 68, False: 0]
  ------------------
  277|       |
  278|       |  /* this works for an easy handle:
  279|       |   * - that has been used for curl_easy_perform()
  280|       |   * - that is associated with a multi handle, and whose connection
  281|       |   *   was detached with CURLOPT_CONNECT_ONLY
  282|       |   */
  283|     68|  if(data->state.lastconnect_id != -1) {
  ------------------
  |  Branch (283:6): [True: 53, False: 15]
  ------------------
  284|     53|    struct connectdata *conn;
  285|       |
  286|     53|    conn = Curl_cpool_get_conn(data, data->state.lastconnect_id);
  287|     53|    if(!conn) {
  ------------------
  |  Branch (287:8): [True: 0, False: 53]
  ------------------
  288|      0|      data->state.lastconnect_id = -1;
  289|      0|      return CURL_SOCKET_BAD;
  ------------------
  |  |  145|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  290|      0|    }
  291|       |
  292|     53|    if(connp)
  ------------------
  |  Branch (292:8): [True: 53, False: 0]
  ------------------
  293|       |      /* only store this if the caller cares for it */
  294|     53|      *connp = conn;
  295|     53|    return conn->sock[FIRSTSOCKET];
  ------------------
  |  |  303|     53|#define FIRSTSOCKET     0
  ------------------
  296|     53|  }
  297|     15|  return CURL_SOCKET_BAD;
  ------------------
  |  |  145|     15|#define CURL_SOCKET_BAD (-1)
  ------------------
  298|     68|}
Curl_conncontrol:
  309|  27.4k|{
  310|       |  /* close if a connection, or a stream that is not multiplexed. */
  311|       |  /* This function will be called both before and after this connection is
  312|       |     associated with a transfer. */
  313|  27.4k|  bool closeit, is_multiplex;
  314|  27.4k|  DEBUGASSERT(conn);
  ------------------
  |  | 1081|  27.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (314:3): [True: 0, False: 27.4k]
  |  Branch (314:3): [True: 27.4k, False: 0]
  ------------------
  315|  27.4k|#if defined(DEBUGBUILD) && defined(CURLVERBOSE)
  316|  27.4k|  (void)reason; /* useful for debugging */
  317|  27.4k|#endif
  318|  27.4k|  is_multiplex = Curl_conn_is_multiplex(conn, FIRSTSOCKET);
  ------------------
  |  |  303|  27.4k|#define FIRSTSOCKET     0
  ------------------
  319|  27.4k|  closeit = (ctrl == CONNCTRL_CONNECTION) ||
  ------------------
  |  |   91|  27.4k|#define CONNCTRL_CONNECTION 1
  ------------------
  |  Branch (319:13): [True: 22.1k, False: 5.31k]
  ------------------
  320|  5.31k|            ((ctrl == CONNCTRL_STREAM) && !is_multiplex);
  ------------------
  |  |   92|  5.31k|#define CONNCTRL_STREAM     2
  ------------------
  |  Branch (320:14): [True: 5.31k, False: 0]
  |  Branch (320:43): [True: 1.90k, False: 3.41k]
  ------------------
  321|  27.4k|  if((ctrl == CONNCTRL_STREAM) && is_multiplex)
  ------------------
  |  |   92|  27.4k|#define CONNCTRL_STREAM     2
  ------------------
  |  Branch (321:6): [True: 5.31k, False: 22.1k]
  |  Branch (321:35): [True: 3.41k, False: 1.90k]
  ------------------
  322|  3.41k|    ;  /* stream signal on multiplex conn never affects close state */
  323|  24.0k|  else if((curl_bit)closeit != conn->bits.close) {
  ------------------
  |  Branch (323:11): [True: 11.4k, False: 12.5k]
  ------------------
  324|  11.4k|    conn->bits.close = closeit; /* the only place in the source code that
  325|       |                                   should assign this bit */
  326|  11.4k|  }
  327|  27.4k|}
Curl_cf_setup_insert_after:
  615|     99|{
  616|     99|  struct Curl_cfilter *cf;
  617|     99|  CURLcode result;
  618|       |
  619|     99|  DEBUGASSERT(data);
  ------------------
  |  | 1081|     99|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (619:3): [True: 0, False: 99]
  |  Branch (619:3): [True: 99, False: 0]
  ------------------
  620|     99|  result = cf_setup_create(&cf, data, transport, ssl_mode);
  621|     99|  if(result)
  ------------------
  |  Branch (621:6): [True: 0, False: 99]
  ------------------
  622|      0|    goto out;
  623|     99|  Curl_conn_cf_insert_after(cf_at, cf);
  624|     99|out:
  625|     99|  return result;
  626|     99|}
Curl_conn_setup:
  632|  14.7k|{
  633|  14.7k|  CURLcode result = CURLE_OK;
  634|  14.7k|  struct Curl_peer *peer = Curl_conn_get_first_peer(conn, sockindex);
  635|  14.7k|  uint8_t dns_queries;
  636|       |
  637|  14.7k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  14.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (637:3): [True: 0, False: 14.7k]
  |  Branch (637:3): [True: 14.7k, False: 0]
  ------------------
  638|  14.7k|  DEBUGASSERT(conn->scheme);
  ------------------
  |  | 1081|  14.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (638:3): [True: 0, False: 14.7k]
  |  Branch (638:3): [True: 14.7k, False: 0]
  ------------------
  639|  14.7k|  DEBUGASSERT(!conn->cfilter[sockindex]);
  ------------------
  |  | 1081|  14.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (639:3): [True: 0, False: 14.7k]
  |  Branch (639:3): [True: 14.7k, False: 0]
  ------------------
  640|       |
  641|  14.7k|  if(!peer)
  ------------------
  |  Branch (641:6): [True: 0, False: 14.7k]
  ------------------
  642|      0|    return CURLE_FAILED_INIT;
  643|       |
  644|  14.7k|#ifndef CURL_DISABLE_HTTP
  645|  14.7k|  if(!conn->cfilter[sockindex] &&
  ------------------
  |  Branch (645:6): [True: 14.7k, False: 0]
  ------------------
  646|  14.7k|     conn->scheme->protocol == CURLPROTO_HTTPS) {
  ------------------
  |  | 1079|  14.7k|#define CURLPROTO_HTTPS   (1L << 1)
  ------------------
  |  Branch (646:6): [True: 329, False: 14.4k]
  ------------------
  647|    329|    DEBUGASSERT(ssl_mode != CURL_CF_SSL_DISABLE);
  ------------------
  |  | 1081|    329|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (647:5): [True: 0, False: 329]
  |  Branch (647:5): [True: 329, False: 0]
  ------------------
  648|    329|    result = Curl_cf_https_setup(data, conn, sockindex);
  649|    329|    if(result)
  ------------------
  |  Branch (649:8): [True: 0, False: 329]
  ------------------
  650|      0|      goto out;
  651|    329|  }
  652|  14.7k|#endif /* !CURL_DISABLE_HTTP */
  653|       |
  654|       |  /* Still no cfilter set, apply default. */
  655|  14.7k|  if(!conn->cfilter[sockindex]) {
  ------------------
  |  Branch (655:6): [True: 14.4k, False: 329]
  ------------------
  656|  14.4k|    result = cf_setup_add(data, conn, sockindex,
  657|  14.4k|                          conn->transport_wanted, ssl_mode);
  658|  14.4k|    if(result)
  ------------------
  |  Branch (658:8): [True: 0, False: 14.4k]
  ------------------
  659|      0|      goto out;
  660|  14.4k|  }
  661|       |
  662|  14.7k|  dns_queries = Curl_resolv_dns_queries(data, conn->ip_version);
  663|       |#ifdef USE_HTTPSRR
  664|       |  if(sockindex == FIRSTSOCKET)
  665|       |    dns_queries |= CURL_DNSQ_HTTPS;
  666|       |#endif
  667|  14.7k|  result = Curl_cf_dns_add(data, conn, sockindex, peer, dns_queries,
  668|  14.7k|                           conn->transport_wanted);
  669|  14.7k|  DEBUGASSERT(conn->cfilter[sockindex]);
  ------------------
  |  | 1081|  14.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (669:3): [True: 0, False: 14.7k]
  |  Branch (669:3): [True: 14.7k, False: 0]
  ------------------
  670|  14.7k|out:
  671|  14.7k|  return result;
  672|  14.7k|}
Curl_conn_set_multiplex:
  675|  4.44k|{
  676|  4.44k|  if(!conn->bits.multiplex) {
  ------------------
  |  Branch (676:6): [True: 4.44k, False: 0]
  ------------------
  677|  4.44k|    conn->bits.multiplex = TRUE;
  ------------------
  |  | 1055|  4.44k|#define TRUE true
  ------------------
  678|  4.44k|    if(conn->attached_multi) {
  ------------------
  |  Branch (678:8): [True: 4.44k, False: 0]
  ------------------
  679|  4.44k|      Curl_multi_connchanged(conn->attached_multi);
  680|  4.44k|    }
  681|  4.44k|  }
  682|  4.44k|}
Curl_conn_get_destination:
  686|  22.5k|{
  687|  22.5k|#ifndef CURL_DISABLE_PROXY
  688|  22.5k|  if(conn->http_proxy.peer && !conn->bits.tunnel_proxy)
  ------------------
  |  Branch (688:6): [True: 17.1k, False: 5.42k]
  |  Branch (688:31): [True: 149, False: 17.0k]
  ------------------
  689|    149|    return conn->http_proxy.peer;
  690|  22.4k|#endif
  691|  22.4k|  return (sockindex == SECONDARYSOCKET) ?
  ------------------
  |  |  304|  22.4k|#define SECONDARYSOCKET 1
  ------------------
  |  Branch (691:10): [True: 1, False: 22.4k]
  ------------------
  692|      1|    (conn->via_peer2 ? conn->via_peer2 : conn->origin2) :
  ------------------
  |  Branch (692:6): [True: 1, False: 0]
  ------------------
  693|  22.4k|    (conn->via_peer ? conn->via_peer : conn->origin);
  ------------------
  |  Branch (693:6): [True: 21.8k, False: 544]
  ------------------
  694|  22.5k|}
Curl_conn_get_first_peer:
  698|   250k|{
  699|   250k|#ifndef CURL_DISABLE_PROXY
  700|   250k|  if(conn->socks_proxy.peer)
  ------------------
  |  Branch (700:6): [True: 72.9k, False: 177k]
  ------------------
  701|  72.9k|    return conn->socks_proxy.peer;
  702|   177k|  if(conn->http_proxy.peer)
  ------------------
  |  Branch (702:6): [True: 26.6k, False: 151k]
  ------------------
  703|  26.6k|    return conn->http_proxy.peer;
  704|   151k|#endif
  705|   151k|  return (sockindex == SECONDARYSOCKET) ?
  ------------------
  |  |  304|   151k|#define SECONDARYSOCKET 1
  ------------------
  |  Branch (705:10): [True: 97.0k, False: 54.1k]
  ------------------
  706|  97.0k|    (conn->via_peer2 ? conn->via_peer2 : conn->origin2) :
  ------------------
  |  Branch (706:6): [True: 97.0k, False: 0]
  ------------------
  707|   151k|    (conn->via_peer ? conn->via_peer : conn->origin);
  ------------------
  |  Branch (707:6): [True: 13.3k, False: 40.8k]
  ------------------
  708|   177k|}
connect.c:cf_setup_destroy:
  536|  14.5k|{
  537|  14.5k|  struct cf_setup_ctx *ctx = cf->ctx;
  538|       |
  539|  14.5k|  CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|  14.5k|  do {                                          \
  |  |  154|  14.5k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  14.5k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  29.0k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 14.5k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 14.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  29.0k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  14.5k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  14.5k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  14.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 14.5k]
  |  |  ------------------
  ------------------
  540|       |  curlx_safefree(ctx);
  ------------------
  |  | 1327|  14.5k|  do {                      \
  |  | 1328|  14.5k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  14.5k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  14.5k|    (ptr) = NULL;           \
  |  | 1330|  14.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 14.5k]
  |  |  ------------------
  ------------------
  541|  14.5k|}
connect.c:cf_setup_connect:
  348|   221k|{
  349|   221k|  struct cf_setup_ctx *ctx = cf->ctx;
  350|   221k|  CURLcode result = CURLE_OK;
  351|   221k|  struct Curl_peer *first_peer =
  352|   221k|    Curl_conn_get_first_peer(cf->conn, cf->sockindex);
  353|       |
  354|   221k|  if(cf->connected) {
  ------------------
  |  Branch (354:6): [True: 0, False: 221k]
  ------------------
  355|      0|    *done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  356|      0|    return CURLE_OK;
  357|      0|  }
  358|       |
  359|       |  /* connect current sub-chain */
  360|   246k|connect_sub_chain:
  361|   246k|  VERBOSE(Curl_conn_trc_filters(data, cf->sockindex, "cf_setup_connect"));
  ------------------
  |  | 1618|   246k|#define VERBOSE(x) x
  ------------------
  362|       |
  363|   246k|  if(cf->next && !cf->next->connected) {
  ------------------
  |  Branch (363:6): [True: 232k, False: 14.1k]
  |  Branch (363:18): [True: 232k, False: 0]
  ------------------
  364|   232k|    result = Curl_conn_cf_connect(cf->next, data, done);
  365|   232k|    if(result || !*done)
  ------------------
  |  Branch (365:8): [True: 4.20k, False: 228k]
  |  Branch (365:18): [True: 207k, False: 20.5k]
  ------------------
  366|   211k|      return result;
  367|   232k|  }
  368|       |
  369|  34.7k|  if(ctx->state < CF_SETUP_CNNCT_EYEBALLS) {
  ------------------
  |  Branch (369:6): [True: 14.1k, False: 20.5k]
  ------------------
  370|       |    /* What type of thing we do connect to first?
  371|       |     * - without a proxy, `ctx->transport` defines it
  372|       |     * - with non-tunneling proxy, `ctx->transport` also applies, but
  373|       |     *   for QUIC we need the cf-h3-proxy, not the standard vquic one
  374|       |     * - with tunneling proxy, transport is defined by the proxytype
  375|       |     *   chosen and `ctx->transport` is tunneled through it.
  376|       |     */
  377|  14.1k|    uint8_t transport_out = ctx->transport;
  378|  14.1k|    bool tunnel_proxy = FALSE;
  ------------------
  |  | 1058|  14.1k|#define FALSE false
  ------------------
  379|  14.1k|#if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP)
  380|  14.1k|    CURL_TRC_CF(data, cf, "happy eyeballing, httpproxy=%d, type=%d, "
  ------------------
  |  |  153|  14.1k|  do {                                          \
  |  |  154|  14.1k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  14.1k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  28.2k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 14.1k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 14.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  28.2k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  14.1k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  14.1k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  14.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  381|  14.1k|                "transport=%d",
  382|  14.1k|                cf->conn->bits.httpproxy, cf->conn->http_proxy.proxytype,
  383|  14.1k|                ctx->transport);
  384|  14.1k|    if(cf->conn->bits.httpproxy && cf->conn->bits.tunnel_proxy) {
  ------------------
  |  Branch (384:8): [True: 8.61k, False: 5.50k]
  |  Branch (384:36): [True: 8.46k, False: 148]
  ------------------
  385|  8.46k|      transport_out =
  386|  8.46k|        Curl_http_proxy_transport(cf->conn->http_proxy.proxytype);
  387|  8.46k|      tunnel_proxy = TRUE;
  ------------------
  |  | 1055|  8.46k|#define TRUE true
  ------------------
  388|  8.46k|      if((transport_out == TRNSPRT_QUIC) && (cf->conn->bits.socksproxy)) {
  ------------------
  |  |  309|  8.46k|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (388:10): [True: 0, False: 8.46k]
  |  Branch (388:45): [True: 0, False: 0]
  ------------------
  389|      0|        failf(data, "HTTP/3 proxy not possible via SOCKS");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  390|      0|        return CURLE_UNSUPPORTED_PROTOCOL;
  391|      0|      }
  392|  8.46k|    }
  393|  14.1k|#endif /* !CURL_DISABLE_PROXY && !CURL_DISABLE_HTTP */
  394|       |
  395|  14.1k|    result = cf_ip_happy_insert_after(cf, data, first_peer,
  396|  14.1k|                                      ctx->transport, transport_out,
  397|  14.1k|                                      tunnel_proxy);
  398|  14.1k|    if(result)
  ------------------
  |  Branch (398:8): [True: 0, False: 14.1k]
  ------------------
  399|      0|      return result;
  400|  14.1k|    ctx->state = (tunnel_proxy && (transport_out == TRNSPRT_QUIC)) ?
  ------------------
  |  |  309|  8.46k|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (400:19): [True: 8.46k, False: 5.65k]
  |  Branch (400:35): [True: 0, False: 8.46k]
  ------------------
  401|  14.1k|      CF_SETUP_CNNCT_HTTP_PROXY : CF_SETUP_CNNCT_EYEBALLS;
  402|  14.1k|    if(!cf->next || !cf->next->connected)
  ------------------
  |  Branch (402:8): [True: 0, False: 14.1k]
  |  Branch (402:21): [True: 14.1k, False: 0]
  ------------------
  403|  14.1k|      goto connect_sub_chain;
  404|  14.1k|  }
  405|       |
  406|       |  /* sub-chain connected, do we need to add more? */
  407|  20.5k|#ifndef CURL_DISABLE_PROXY
  408|  20.5k|  if(ctx->state < CF_SETUP_CNNCT_SOCKS && cf->conn->bits.socksproxy) {
  ------------------
  |  Branch (408:6): [True: 13.8k, False: 6.76k]
  |  Branch (408:43): [True: 104, False: 13.7k]
  ------------------
  409|    104|    struct Curl_peer *dest; /* where SOCKS should tunnel to */
  410|       |
  411|    104|    if(cf->conn->bits.httpproxy)
  ------------------
  |  Branch (411:8): [True: 22, False: 82]
  ------------------
  412|     22|      dest = cf->conn->http_proxy.peer;
  413|     82|    else
  414|     82|      dest = Curl_conn_get_destination(cf->conn, cf->sockindex);
  415|    104|    if(!dest)
  ------------------
  |  Branch (415:8): [True: 0, False: 104]
  ------------------
  416|      0|      return CURLE_FAILED_INIT;
  417|       |
  418|    104|    result = Curl_cf_socks_proxy_insert_after(
  419|    104|      cf, data, dest, cf->conn->ip_version,
  420|    104|      cf->conn->socks_proxy.proxytype,
  421|    104|      cf->conn->socks_proxy.creds);
  422|       |
  423|    104|    if(result) {
  ------------------
  |  Branch (423:8): [True: 0, False: 104]
  ------------------
  424|       |      /* 'dest' might be freed now so it can't be dereferenced */
  425|      0|      CURL_TRC_CF(data, cf, "added SOCKS filter failed -> %d", result);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  426|      0|      return result;
  427|      0|    }
  428|    104|    CURL_TRC_CF(data, cf, "added SOCKS filter to %s:%u -> %d",
  ------------------
  |  |  153|    104|  do {                                          \
  |  |  154|    104|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    104|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    208|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 104, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 104]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    208|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    104|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    104|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    104|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 104]
  |  |  ------------------
  ------------------
  429|    104|                dest->hostname, dest->port, result);
  430|    104|    ctx->state = CF_SETUP_CNNCT_SOCKS;
  431|    104|    if(!cf->next || !cf->next->connected)
  ------------------
  |  Branch (431:8): [True: 0, False: 104]
  |  Branch (431:21): [True: 104, False: 0]
  ------------------
  432|    104|      goto connect_sub_chain;
  433|    104|  }
  434|       |
  435|  20.4k|  if(ctx->state < CF_SETUP_CNNCT_HTTP_PROXY && cf->conn->bits.httpproxy) {
  ------------------
  |  Branch (435:6): [True: 13.7k, False: 6.74k]
  |  Branch (435:48): [True: 8.55k, False: 5.19k]
  ------------------
  436|  8.55k|#ifdef USE_SSL
  437|  8.55k|    if(IS_HTTPS_PROXY(cf->conn->http_proxy.proxytype) &&
  ------------------
  |  |   80|  17.1k|  (((t) == CURLPROXY_HTTPS) ||  \
  |  |  ------------------
  |  |  |  |  794|  8.55k|#define CURLPROXY_HTTPS           2L /* HTTPS but stick to HTTP/1
  |  |  ------------------
  |  |  |  Branch (80:4): [True: 35, False: 8.51k]
  |  |  ------------------
  |  |   81|  8.55k|   ((t) == CURLPROXY_HTTPS2) || \
  |  |  ------------------
  |  |  |  |  796|  8.51k|#define CURLPROXY_HTTPS2          3L /* HTTPS and attempt HTTP/2
  |  |  ------------------
  |  |  |  Branch (81:4): [True: 382, False: 8.13k]
  |  |  ------------------
  |  |   82|  17.1k|   ((t) == CURLPROXY_HTTPS3))
  |  |  ------------------
  |  |  |  |  805|  8.13k|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  |  |  ------------------
  |  |  |  Branch (82:4): [True: 0, False: 8.13k]
  |  |  ------------------
  ------------------
  438|    417|       !Curl_conn_is_ssl(cf->conn, cf->sockindex)) {
  ------------------
  |  Branch (438:8): [True: 417, False: 0]
  ------------------
  439|    417|      result = Curl_cf_ssl_proxy_insert_after(cf, data);
  440|    417|      if(result)
  ------------------
  |  Branch (440:10): [True: 0, False: 417]
  ------------------
  441|      0|        return result;
  442|    417|    }
  443|  8.55k|#endif /* USE_SSL */
  444|       |
  445|  8.55k|#ifndef CURL_DISABLE_HTTP
  446|  8.55k|    if(cf->conn->bits.tunnel_proxy) {
  ------------------
  |  Branch (446:8): [True: 8.40k, False: 148]
  ------------------
  447|  8.40k|      struct Curl_peer *dest; /* where HTTP should tunnel to */
  448|  8.40k|      dest = Curl_conn_get_destination(cf->conn, cf->sockindex);
  449|  8.40k|      result = Curl_cf_http_proxy_insert_after(
  450|  8.40k|        cf, data, dest, ctx->transport, cf->conn->http_proxy.proxytype);
  451|  8.40k|      if(result)
  ------------------
  |  Branch (451:10): [True: 0, False: 8.40k]
  ------------------
  452|      0|        return result;
  453|  8.40k|    }
  454|  8.55k|#endif /* !CURL_DISABLE_HTTP */
  455|  8.55k|    ctx->state = CF_SETUP_CNNCT_HTTP_PROXY;
  456|  8.55k|    if(!cf->next || !cf->next->connected)
  ------------------
  |  Branch (456:8): [True: 0, False: 8.55k]
  |  Branch (456:21): [True: 8.40k, False: 147]
  ------------------
  457|  8.40k|      goto connect_sub_chain;
  458|  8.55k|  }
  459|  12.0k|#endif /* !CURL_DISABLE_PROXY */
  460|       |
  461|  12.0k|  if(ctx->state < CF_SETUP_CNNCT_HAPROXY) {
  ------------------
  |  Branch (461:6): [True: 11.9k, False: 129]
  ------------------
  462|  11.9k|#ifndef CURL_DISABLE_PROXY
  463|  11.9k|    if(data->set.haproxyprotocol) {
  ------------------
  |  Branch (463:8): [True: 130, False: 11.8k]
  ------------------
  464|    130|      if(ctx->transport == TRNSPRT_QUIC) {
  ------------------
  |  |  309|    130|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (464:10): [True: 0, False: 130]
  ------------------
  465|      0|        failf(data, "haproxy protocol not support QUIC");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  466|      0|        return CURLE_UNSUPPORTED_PROTOCOL;
  467|      0|      }
  468|    130|      result = Curl_cf_haproxy_insert_after(cf, data);
  469|    130|      if(result)
  ------------------
  |  Branch (469:10): [True: 0, False: 130]
  ------------------
  470|      0|        return result;
  471|    130|    }
  472|  11.9k|#endif /* !CURL_DISABLE_PROXY */
  473|  11.9k|    ctx->state = CF_SETUP_CNNCT_HAPROXY;
  474|  11.9k|    if(!cf->next || !cf->next->connected)
  ------------------
  |  Branch (474:8): [True: 0, False: 11.9k]
  |  Branch (474:21): [True: 130, False: 11.8k]
  ------------------
  475|    130|      goto connect_sub_chain;
  476|  11.9k|  }
  477|       |
  478|       |  /* Adding Curl_cf_quic_insert_after() because now we
  479|       |     need the next filter to be QUIC/HTTP/3 (which has SSL) */
  480|       |#if !defined(CURL_DISABLE_HTTP) && defined(USE_HTTP3) && \
  481|       |  defined(USE_PROXY_HTTP3)
  482|       |  if(ctx->transport == TRNSPRT_QUIC && cf->conn->bits.httpproxy &&
  483|       |     cf->conn->bits.tunnel_proxy &&
  484|       |     (data->state.http_neg.wanted == CURL_HTTP_V3x)) {
  485|       |    if(ctx->state < CF_SETUP_CNNCT_SSL) {
  486|       |      result = Curl_cf_quic_insert_after(cf);
  487|       |      if(result)
  488|       |        return result;
  489|       |      ctx->state = CF_SETUP_CNNCT_SSL;
  490|       |    }
  491|       |    if(!cf->next || !cf->next->connected)
  492|       |      goto connect_sub_chain;
  493|       |  }
  494|       |  else
  495|       |#endif /* !CURL_DISABLE_HTTP && USE_HTTP3 && USE_PROXY_HTTP3 */
  496|  11.9k|  {
  497|  11.9k|    if(ctx->state < CF_SETUP_CNNCT_SSL) {
  ------------------
  |  Branch (497:8): [True: 11.9k, False: 0]
  ------------------
  498|  11.9k|#ifdef USE_SSL
  499|  11.9k|      if((ctx->ssl_mode == CURL_CF_SSL_ENABLE ||
  ------------------
  |  |  365|  23.9k|#define CURL_CF_SSL_ENABLE   1
  ------------------
  |  Branch (499:11): [True: 0, False: 11.9k]
  ------------------
  500|  11.9k|          (ctx->ssl_mode != CURL_CF_SSL_DISABLE &&
  ------------------
  |  |  364|  23.9k|#define CURL_CF_SSL_DISABLE  0
  ------------------
  |  Branch (500:12): [True: 11.0k, False: 902]
  ------------------
  501|  11.0k|           cf->conn->scheme->flags & PROTOPT_SSL)) && /* we want SSL */
  ------------------
  |  |  207|  11.0k|#define PROTOPT_SSL (1 << 0)       /* uses SSL */
  ------------------
  |  Branch (501:12): [True: 2.15k, False: 8.89k]
  ------------------
  502|  2.15k|         !Curl_conn_is_ssl(cf->conn, cf->sockindex)) { /* it is missing */
  ------------------
  |  Branch (502:10): [True: 2.15k, False: 0]
  ------------------
  503|  2.15k|        result = Curl_cf_ssl_insert_after(cf, data);
  504|  2.15k|        if(result)
  ------------------
  |  Branch (504:12): [True: 0, False: 2.15k]
  ------------------
  505|      0|          return result;
  506|  2.15k|      }
  507|  11.9k|#endif /* USE_SSL */
  508|  11.9k|      ctx->state = CF_SETUP_CNNCT_SSL;
  509|  11.9k|      if(!cf->next || !cf->next->connected)
  ------------------
  |  Branch (509:10): [True: 0, False: 11.9k]
  |  Branch (509:23): [True: 2.15k, False: 9.80k]
  ------------------
  510|  2.15k|        goto connect_sub_chain;
  511|  11.9k|    }
  512|  11.9k|  }
  513|       |
  514|  9.80k|  ctx->state = CF_SETUP_DONE;
  515|  9.80k|  cf->connected = TRUE;
  ------------------
  |  | 1055|  9.80k|#define TRUE true
  ------------------
  516|       |  *done = TRUE;
  ------------------
  |  | 1055|  9.80k|#define TRUE true
  ------------------
  517|  9.80k|  return CURLE_OK;
  518|  11.9k|}
connect.c:cf_setup_close:
  522|  4.70k|{
  523|  4.70k|  struct cf_setup_ctx *ctx = cf->ctx;
  524|       |
  525|  4.70k|  CURL_TRC_CF(data, cf, "close");
  ------------------
  |  |  153|  4.70k|  do {                                          \
  |  |  154|  4.70k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  4.70k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  9.40k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 4.70k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4.70k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  9.40k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  4.70k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  4.70k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  4.70k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 4.70k]
  |  |  ------------------
  ------------------
  526|  4.70k|  cf->connected = FALSE;
  ------------------
  |  | 1058|  4.70k|#define FALSE false
  ------------------
  527|  4.70k|  ctx->state = CF_SETUP_INIT;
  528|       |
  529|  4.70k|  if(cf->next) {
  ------------------
  |  Branch (529:6): [True: 4.32k, False: 379]
  ------------------
  530|  4.32k|    cf->next->cft->do_close(cf->next, data);
  531|  4.32k|    Curl_conn_cf_discard_chain(&cf->next, data);
  532|  4.32k|  }
  533|  4.70k|}
connect.c:cf_setup_create:
  565|  14.5k|{
  566|  14.5k|  struct Curl_cfilter *cf = NULL;
  567|  14.5k|  struct cf_setup_ctx *ctx;
  568|  14.5k|  CURLcode result = CURLE_OK;
  569|       |
  570|  14.5k|  (void)data;
  571|  14.5k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1480|  14.5k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  572|  14.5k|  if(!ctx) {
  ------------------
  |  Branch (572:6): [True: 0, False: 14.5k]
  ------------------
  573|      0|    result = CURLE_OUT_OF_MEMORY;
  574|      0|    goto out;
  575|      0|  }
  576|  14.5k|  ctx->state = CF_SETUP_INIT;
  577|  14.5k|  ctx->ssl_mode = ssl_mode;
  578|  14.5k|  ctx->transport = transport;
  579|       |
  580|  14.5k|  result = Curl_cf_create(&cf, &Curl_cft_setup, ctx);
  581|  14.5k|  if(result)
  ------------------
  |  Branch (581:6): [True: 0, False: 14.5k]
  ------------------
  582|      0|    goto out;
  583|  14.5k|  ctx = NULL;
  584|       |
  585|  14.5k|out:
  586|  14.5k|  *pcf = result ? NULL : cf;
  ------------------
  |  Branch (586:10): [True: 0, False: 14.5k]
  ------------------
  587|  14.5k|  if(ctx) {
  ------------------
  |  Branch (587:6): [True: 0, False: 14.5k]
  ------------------
  588|      0|    curlx_free(ctx);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  589|      0|  }
  590|  14.5k|  return result;
  591|  14.5k|}
connect.c:cf_setup_add:
  598|  14.4k|{
  599|  14.4k|  struct Curl_cfilter *cf;
  600|  14.4k|  CURLcode result = CURLE_OK;
  601|       |
  602|  14.4k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  14.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (602:3): [True: 0, False: 14.4k]
  |  Branch (602:3): [True: 14.4k, False: 0]
  ------------------
  603|  14.4k|  result = cf_setup_create(&cf, data, transport, ssl_mode);
  604|  14.4k|  if(result)
  ------------------
  |  Branch (604:6): [True: 0, False: 14.4k]
  ------------------
  605|      0|    goto out;
  606|  14.4k|  Curl_conn_cf_add(data, conn, sockindex, cf);
  607|  14.4k|out:
  608|  14.4k|  return result;
  609|  14.4k|}

Curl_get_content_encodings:
  641|     15|{
  642|     15|  struct dynbuf enc;
  643|     15|  const struct Curl_cwtype * const *cep;
  644|     15|  CURLcode result = CURLE_OK;
  645|     15|  curlx_dyn_init(&enc, 255);
  646|       |
  647|     75|  for(cep = general_unencoders; *cep && !result; cep++) {
  ------------------
  |  Branch (647:33): [True: 60, False: 15]
  |  Branch (647:41): [True: 60, False: 0]
  ------------------
  648|     60|    const struct Curl_cwtype *ce = *cep;
  649|     60|    if(!curl_strequal(ce->name, CONTENT_ENCODING_DEFAULT)) {
  ------------------
  |  |   54|     60|#define CONTENT_ENCODING_DEFAULT  "identity"
  ------------------
  |  Branch (649:8): [True: 45, False: 15]
  ------------------
  650|     45|      if(curlx_dyn_len(&enc))
  ------------------
  |  Branch (650:10): [True: 30, False: 15]
  ------------------
  651|     30|        result = curlx_dyn_addn(&enc, ", ", 2);
  652|     45|      if(!result)
  ------------------
  |  Branch (652:10): [True: 45, False: 0]
  ------------------
  653|     45|        result = curlx_dyn_add(&enc, ce->name);
  654|     45|    }
  655|     60|  }
  656|     15|  if(!result && !curlx_dyn_len(&enc))
  ------------------
  |  Branch (656:6): [True: 15, False: 0]
  |  Branch (656:17): [True: 0, False: 15]
  ------------------
  657|      0|    result = curlx_dyn_add(&enc, CONTENT_ENCODING_DEFAULT);
  ------------------
  |  |   54|      0|#define CONTENT_ENCODING_DEFAULT  "identity"
  ------------------
  658|       |
  659|     15|  if(!result)
  ------------------
  |  Branch (659:6): [True: 15, False: 0]
  ------------------
  660|     15|    return curlx_dyn_ptr(&enc);
  661|      0|  return NULL;
  662|     15|}
Curl_build_unencoding_stack:
  733|  1.62k|{
  734|  1.62k|  Curl_cwriter_phase phase = is_transfer ?
  ------------------
  |  Branch (734:30): [True: 999, False: 624]
  ------------------
  735|    999|    CURL_CW_TRANSFER_DECODE : CURL_CW_CONTENT_DECODE;
  736|  1.62k|  CURLcode result;
  737|  1.62k|  bool has_chunked = FALSE;
  ------------------
  |  | 1058|  1.62k|#define FALSE false
  ------------------
  738|       |
  739|  1.90k|  do {
  740|  1.90k|    const char *name;
  741|  1.90k|    size_t namelen;
  742|  1.90k|    bool is_chunked = FALSE;
  ------------------
  |  | 1058|  1.90k|#define FALSE false
  ------------------
  743|       |
  744|       |    /* Parse a single encoding name. */
  745|  4.16k|    while(ISBLANK(*enclist) || *enclist == ',')
  ------------------
  |  |   45|  8.32k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.59k, False: 2.56k]
  |  |  |  Branch (45:38): [True: 319, False: 2.24k]
  |  |  ------------------
  ------------------
  |  Branch (745:32): [True: 339, False: 1.90k]
  ------------------
  746|  2.25k|      enclist++;
  747|       |
  748|  1.90k|    name = enclist;
  749|       |
  750|  36.9k|    for(namelen = 0; *enclist && *enclist != ','; enclist++)
  ------------------
  |  Branch (750:22): [True: 35.3k, False: 1.55k]
  |  Branch (750:34): [True: 35.0k, False: 357]
  ------------------
  751|  35.0k|      if(*enclist > ' ')
  ------------------
  |  Branch (751:10): [True: 9.28k, False: 25.7k]
  ------------------
  752|  9.28k|        namelen = enclist - name + 1;
  753|       |
  754|  1.90k|    if(namelen) {
  ------------------
  |  Branch (754:8): [True: 1.09k, False: 812]
  ------------------
  755|  1.09k|      const struct Curl_cwtype *cwt;
  756|  1.09k|      struct Curl_cwriter *writer;
  757|       |
  758|  1.09k|      CURL_TRC_WRITE(data, "looking for %s decoder: %.*s",
  ------------------
  |  |  158|  1.09k|  do {                                                     \
  |  |  159|  1.09k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|  1.09k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  2.19k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 1.09k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.09k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  2.19k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.09k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|  1.09k|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (160:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  161|  1.09k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 1.09k]
  |  |  ------------------
  ------------------
  759|  1.09k|                     is_transfer ? "transfer" : "content", (int)namelen, name);
  760|  1.09k|      is_chunked = (is_transfer && (namelen == 7) &&
  ------------------
  |  Branch (760:21): [True: 1.00k, False: 89]
  |  Branch (760:36): [True: 844, False: 163]
  ------------------
  761|    844|                    curl_strnequal(name, "chunked", 7));
  ------------------
  |  Branch (761:21): [True: 99, False: 745]
  ------------------
  762|       |      /* if we skip the decoding in this phase, do not look further.
  763|       |       * Exception is "chunked" transfer-encoding which always must happen */
  764|  1.09k|      if((is_transfer && !data->set.http_transfer_encoding && !is_chunked) ||
  ------------------
  |  Branch (764:11): [True: 1.00k, False: 89]
  |  Branch (764:26): [True: 233, False: 774]
  |  Branch (764:63): [True: 144, False: 89]
  ------------------
  765|    952|         (!is_transfer && data->set.http_ce_skip)) {
  ------------------
  |  Branch (765:11): [True: 89, False: 863]
  |  Branch (765:27): [True: 0, False: 89]
  ------------------
  766|    144|        bool is_identity = curl_strnequal(name, "identity", 8);
  767|       |        /* not requested, ignore */
  768|    144|        CURL_TRC_WRITE(data, "decoder not requested, ignored: %.*s",
  ------------------
  |  |  158|    144|  do {                                                     \
  |  |  159|    144|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|    144|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    288|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 144, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 144]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    288|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    144|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|    144|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|    144|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 144]
  |  |  ------------------
  ------------------
  769|    144|                       (int)namelen, name);
  770|    144|        if(is_transfer && !data->set.http_te_skip) {
  ------------------
  |  Branch (770:12): [True: 144, False: 0]
  |  Branch (770:27): [True: 15, False: 129]
  ------------------
  771|     15|          if(has_chunked)
  ------------------
  |  Branch (771:14): [True: 1, False: 14]
  ------------------
  772|      1|            failf(data, "A Transfer-Encoding (%.*s) was listed after chunked",
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  773|      1|                  (int)namelen, name);
  774|     14|          else if(is_identity)
  ------------------
  |  Branch (774:19): [True: 0, False: 14]
  ------------------
  775|      0|            continue;
  776|     14|          else
  777|     14|            failf(data, "Unsolicited Transfer-Encoding (%.*s) found",
  ------------------
  |  |   62|     14|#define failf Curl_failf
  ------------------
  778|     14|                  (int)namelen, name);
  779|     15|          return CURLE_BAD_CONTENT_ENCODING;
  780|     15|        }
  781|    129|        return CURLE_OK;
  782|    144|      }
  783|       |
  784|    952|      if(Curl_cwriter_count(data, phase) >= MAX_ENCODE_STACK) {
  ------------------
  |  |   59|    952|#define MAX_ENCODE_STACK 5
  ------------------
  |  Branch (784:10): [True: 6, False: 946]
  ------------------
  785|      6|        failf(data, "Reject response exceeding limit of %d %s encodings",
  ------------------
  |  |   62|      6|#define failf Curl_failf
  ------------------
  786|      6|              MAX_ENCODE_STACK,
  ------------------
  |  |   59|      6|#define MAX_ENCODE_STACK 5
  ------------------
  787|      6|              is_transfer ? "transfer" : "content");
  ------------------
  |  Branch (787:15): [True: 0, False: 6]
  ------------------
  788|      6|        return CURLE_BAD_CONTENT_ENCODING;
  789|      6|      }
  790|       |
  791|    946|      cwt = find_unencode_writer(name, namelen, phase);
  792|    946|      if(cwt && is_chunked && Curl_cwriter_get_by_type(data, cwt)) {
  ------------------
  |  Branch (792:10): [True: 814, False: 132]
  |  Branch (792:17): [True: 99, False: 715]
  |  Branch (792:31): [True: 30, False: 69]
  ------------------
  793|       |        /* A 'chunked' transfer encoding has already been added.
  794|       |         * Ignore duplicates. See #13451.
  795|       |         * Also RFC 9112, ch. 6.1:
  796|       |         * "A sender MUST NOT apply the chunked transfer coding more than
  797|       |         *  once to a message body."
  798|       |         */
  799|     30|        CURL_TRC_WRITE(data, "ignoring duplicate 'chunked' decoder");
  ------------------
  |  |  158|     30|  do {                                                     \
  |  |  159|     30|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|     30|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     60|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 30, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 30]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     60|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|     30|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|     30|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|     30|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 30]
  |  |  ------------------
  ------------------
  800|     30|        return CURLE_OK;
  801|     30|      }
  802|       |
  803|    916|      if(is_transfer && !is_chunked &&
  ------------------
  |  Branch (803:10): [True: 833, False: 83]
  |  Branch (803:25): [True: 764, False: 69]
  ------------------
  804|    764|         Curl_cwriter_get_by_name(data, "chunked")) {
  ------------------
  |  Branch (804:10): [True: 1, False: 763]
  ------------------
  805|       |        /* RFC 9112, ch. 6.1:
  806|       |         * "If any transfer coding other than chunked is applied to a
  807|       |         *  response's content, the sender MUST either apply chunked as the
  808|       |         *  final transfer coding or terminate the message by closing the
  809|       |         *  connection."
  810|       |         * "chunked" must be the last added to be the first in its phase,
  811|       |         *  reject this.
  812|       |         */
  813|      1|        failf(data, "Reject response due to 'chunked' not being the last "
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  814|      1|              "Transfer-Encoding");
  815|      1|        return CURLE_BAD_CONTENT_ENCODING;
  816|      1|      }
  817|       |
  818|    915|      if(!cwt)
  ------------------
  |  Branch (818:10): [True: 131, False: 784]
  ------------------
  819|    131|        cwt = &error_writer; /* Defer error at use. */
  820|       |
  821|    915|      result = Curl_cwriter_create(&writer, data, cwt, phase);
  822|    915|      CURL_TRC_WRITE(data, "added %s decoder %s -> %d",
  ------------------
  |  |  158|    915|  do {                                                     \
  |  |  159|    915|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|    915|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  1.83k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 915, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 915]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  1.83k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    915|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|    915|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (160:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  161|    915|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 915]
  |  |  ------------------
  ------------------
  823|    915|                     is_transfer ? "transfer" : "content", cwt->name, result);
  824|    915|      if(result)
  ------------------
  |  Branch (824:10): [True: 0, False: 915]
  ------------------
  825|      0|        return result;
  826|       |
  827|    915|      result = Curl_cwriter_add(data, writer);
  828|    915|      if(result) {
  ------------------
  |  Branch (828:10): [True: 0, False: 915]
  ------------------
  829|      0|        Curl_cwriter_free(data, writer);
  830|      0|        return result;
  831|      0|      }
  832|    915|      if(is_chunked)
  ------------------
  |  Branch (832:10): [True: 69, False: 846]
  ------------------
  833|     69|        has_chunked = TRUE;
  ------------------
  |  | 1055|     69|#define TRUE true
  ------------------
  834|    915|    }
  835|  1.90k|  } while(*enclist);
  ------------------
  |  Branch (835:11): [True: 285, False: 1.44k]
  ------------------
  836|       |
  837|  1.44k|  return CURLE_OK;
  838|  1.62k|}
content_encoding.c:deflate_do_init:
  245|    715|{
  246|    715|  struct zlib_writer *zp = (struct zlib_writer *)writer;
  247|    715|  z_stream *z = &zp->z; /* zlib state structure */
  248|       |
  249|       |  /* Initialize zlib */
  250|    715|  z->zalloc = (alloc_func)zalloc_cb;
  251|    715|  z->zfree = (free_func)zfree_cb;
  252|       |
  253|    715|  if(inflateInit(z) != Z_OK)
  ------------------
  |  Branch (253:6): [True: 0, False: 715]
  ------------------
  254|      0|    return process_zlib_error(data, z);
  255|    715|  zp->zlib_init = ZLIB_INIT;
  256|    715|  return CURLE_OK;
  257|    715|}
content_encoding.c:zalloc_cb:
   89|  1.29k|{
   90|  1.29k|  (void)opaque;
   91|       |  /* not a typo, keep it curlx_calloc() */
   92|  1.29k|  return (voidpf)curlx_calloc(items, size);
  ------------------
  |  | 1480|  1.29k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   93|  1.29k|}
content_encoding.c:zfree_cb:
   96|  1.29k|{
   97|  1.29k|  (void)opaque;
   98|  1.29k|  curlx_free(ptr);
  ------------------
  |  | 1483|  1.29k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   99|  1.29k|}
content_encoding.c:process_zlib_error:
  102|    310|{
  103|    310|  if(z->msg)
  ------------------
  |  Branch (103:6): [True: 306, False: 4]
  ------------------
  104|    306|    failf(data, "Error while processing content unencoding: %s", z->msg);
  ------------------
  |  |   62|    306|#define failf Curl_failf
  ------------------
  105|      4|  else
  106|      4|    failf(data, "Error while processing content unencoding: "
  ------------------
  |  |   62|      4|#define failf Curl_failf
  ------------------
  107|      4|          "Unknown failure within decompression software.");
  108|       |
  109|    310|  return CURLE_BAD_CONTENT_ENCODING;
  110|    310|}
content_encoding.c:deflate_do_write:
  262|  6.52k|{
  263|  6.52k|  struct zlib_writer *zp = (struct zlib_writer *)writer;
  264|  6.52k|  z_stream *z = &zp->z; /* zlib state structure */
  265|       |
  266|  6.52k|  if(!(type & CLIENTWRITE_BODY) || !nbytes)
  ------------------
  |  |   42|  6.52k|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  |  Branch (266:6): [True: 5.12k, False: 1.40k]
  |  Branch (266:36): [True: 101, False: 1.30k]
  ------------------
  267|  5.22k|    return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
  268|       |
  269|       |  /* Set the compressed input when this function is called */
  270|  1.30k|  z->next_in = (z_const Bytef *)buf;
  271|  1.30k|  z->avail_in = (uInt)nbytes;
  272|       |
  273|  1.30k|  if(zp->zlib_init == ZLIB_EXTERNAL_TRAILER)
  ------------------
  |  Branch (273:6): [True: 11, False: 1.29k]
  ------------------
  274|     11|    return process_trailer(data, zp);
  275|       |
  276|       |  /* Now uncompress the data */
  277|  1.29k|  return inflate_stream(data, writer, type, ZLIB_INFLATING);
  278|  1.30k|}
content_encoding.c:process_trailer:
  125|     32|{
  126|     32|  z_stream *z = &zp->z;
  127|     32|  CURLcode result = CURLE_OK;
  128|     32|  uInt len = z->avail_in < zp->trailerlen ? z->avail_in : zp->trailerlen;
  ------------------
  |  Branch (128:14): [True: 12, False: 20]
  ------------------
  129|       |
  130|       |  /* Consume expected trailer bytes. Terminate stream if exhausted.
  131|       |     Issue an error if unexpected bytes follow. */
  132|       |
  133|     32|  zp->trailerlen -= len;
  134|     32|  z->avail_in -= len;
  135|     32|  z->next_in += len;
  136|     32|  if(z->avail_in)
  ------------------
  |  Branch (136:6): [True: 15, False: 17]
  ------------------
  137|     15|    result = CURLE_WRITE_ERROR;
  138|     32|  if(result || !zp->trailerlen)
  ------------------
  |  Branch (138:6): [True: 15, False: 17]
  |  Branch (138:16): [True: 5, False: 12]
  ------------------
  139|     20|    result = exit_zlib(data, z, &zp->zlib_init, result);
  140|     12|  else {
  141|       |    /* Only occurs for gzip with zlib < 1.2.0.4 or raw deflate. */
  142|     12|    zp->zlib_init = ZLIB_EXTERNAL_TRAILER;
  143|     12|  }
  144|     32|  return result;
  145|     32|}
content_encoding.c:exit_zlib:
  114|  1.15k|{
  115|  1.15k|  if(*zlib_init != ZLIB_UNINIT) {
  ------------------
  |  Branch (115:6): [True: 715, False: 439]
  ------------------
  116|    715|    if(inflateEnd(z) != Z_OK && result == CURLE_OK)
  ------------------
  |  Branch (116:8): [True: 0, False: 715]
  |  Branch (116:33): [True: 0, False: 0]
  ------------------
  117|      0|      result = process_zlib_error(data, z);
  118|    715|    *zlib_init = ZLIB_UNINIT;
  119|    715|  }
  120|       |
  121|  1.15k|  return result;
  122|  1.15k|}
content_encoding.c:inflate_stream:
  150|  1.29k|{
  151|  1.29k|  struct zlib_writer *zp = (struct zlib_writer *)writer;
  152|  1.29k|  z_stream *z = &zp->z;         /* zlib state structure */
  153|  1.29k|  uInt nread = z->avail_in;
  154|  1.29k|  z_const Bytef *orig_in = z->next_in;
  155|  1.29k|  bool done = FALSE;
  ------------------
  |  | 1058|  1.29k|#define FALSE false
  ------------------
  156|  1.29k|  CURLcode result = CURLE_OK;   /* Curl_client_write status */
  157|  1.29k|  int i = 0;
  158|       |
  159|       |  /* Check state. */
  160|  1.29k|  if(zp->zlib_init != ZLIB_INIT &&
  ------------------
  |  Branch (160:6): [True: 638, False: 652]
  ------------------
  161|    638|     zp->zlib_init != ZLIB_INFLATING &&
  ------------------
  |  Branch (161:6): [True: 3, False: 635]
  ------------------
  162|      3|     zp->zlib_init != ZLIB_INIT_GZIP)
  ------------------
  |  Branch (162:6): [True: 3, False: 0]
  ------------------
  163|      3|    return exit_zlib(data, z, &zp->zlib_init, CURLE_WRITE_ERROR);
  164|       |
  165|       |  /* because the buffer size is fixed, iteratively decompress and transfer to
  166|       |     the client via next_write function. */
  167|  9.72k|  while(!done) {
  ------------------
  |  Branch (167:9): [True: 8.54k, False: 1.18k]
  ------------------
  168|  8.54k|    int status; /* zlib status */
  169|  8.54k|    done = TRUE;
  ------------------
  |  | 1055|  8.54k|#define TRUE true
  ------------------
  170|       |
  171|  8.54k|    if(++i > (1024 * 1024 / DECOMPRESS_BUFFER_SIZE)) {
  ------------------
  |  |   62|  8.54k|#define DECOMPRESS_BUFFER_SIZE 16384 /* buffer size for decompressed data */
  ------------------
  |  Branch (171:8): [True: 39, False: 8.50k]
  ------------------
  172|       |      /* check every MB of output if we are not exceeding time limit */
  173|     39|      i = 0;
  174|     39|      if(Curl_timeleft_ms(data) < 0) {
  ------------------
  |  Branch (174:10): [True: 0, False: 39]
  ------------------
  175|      0|        failf(data, "Operation timed out while decoding payload");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  176|      0|        return exit_zlib(data, z, &zp->zlib_init, CURLE_OPERATION_TIMEDOUT);
  177|      0|      }
  178|     39|    }
  179|       |
  180|       |    /* (re)set buffer for decompressed output for every iteration */
  181|  8.54k|    z->next_out = (Bytef *)zp->buffer;
  182|  8.54k|    z->avail_out = DECOMPRESS_BUFFER_SIZE;
  ------------------
  |  |   62|  8.54k|#define DECOMPRESS_BUFFER_SIZE 16384 /* buffer size for decompressed data */
  ------------------
  183|       |
  184|  8.54k|    status = inflate(z, Z_BLOCK);
  185|       |
  186|       |    /* Flush output data if some. */
  187|  8.54k|    if(z->avail_out != DECOMPRESS_BUFFER_SIZE) {
  ------------------
  |  |   62|  8.54k|#define DECOMPRESS_BUFFER_SIZE 16384 /* buffer size for decompressed data */
  ------------------
  |  Branch (187:8): [True: 5.71k, False: 2.83k]
  ------------------
  188|  5.71k|      if(status == Z_OK || status == Z_STREAM_END) {
  ------------------
  |  Branch (188:10): [True: 5.64k, False: 72]
  |  Branch (188:28): [True: 0, False: 72]
  ------------------
  189|  5.64k|        zp->zlib_init = started; /* Data started. */
  190|  5.64k|        result = Curl_cwriter_write(data, writer->next, type, zp->buffer,
  191|  5.64k|                                    DECOMPRESS_BUFFER_SIZE - z->avail_out);
  ------------------
  |  |   62|  5.64k|#define DECOMPRESS_BUFFER_SIZE 16384 /* buffer size for decompressed data */
  ------------------
  192|  5.64k|        if(result) {
  ------------------
  |  Branch (192:12): [True: 106, False: 5.53k]
  ------------------
  193|    106|          exit_zlib(data, z, &zp->zlib_init, result);
  194|    106|          break;
  195|    106|        }
  196|  5.64k|      }
  197|  5.71k|    }
  198|       |
  199|       |    /* Dispatch by inflate() status. */
  200|  8.44k|    switch(status) {
  201|  6.69k|    case Z_OK:
  ------------------
  |  Branch (201:5): [True: 6.69k, False: 1.74k]
  ------------------
  202|       |      /* Always loop: there may be unflushed latched data in zlib state. */
  203|  6.69k|      done = FALSE;
  ------------------
  |  | 1058|  6.69k|#define FALSE false
  ------------------
  204|  6.69k|      break;
  205|    850|    case Z_BUF_ERROR:
  ------------------
  |  Branch (205:5): [True: 850, False: 7.59k]
  ------------------
  206|       |      /* No more data to flush: exit loop. */
  207|    850|      break;
  208|     21|    case Z_STREAM_END:
  ------------------
  |  Branch (208:5): [True: 21, False: 8.42k]
  ------------------
  209|     21|      result = process_trailer(data, zp);
  210|     21|      break;
  211|    869|    case Z_DATA_ERROR:
  ------------------
  |  Branch (211:5): [True: 869, False: 7.57k]
  ------------------
  212|       |      /* some servers seem to not generate zlib headers, so this is an attempt
  213|       |         to fix and continue anyway */
  214|    869|      if(zp->zlib_init == ZLIB_INIT) {
  ------------------
  |  Branch (214:10): [True: 563, False: 306]
  ------------------
  215|    563|        if(inflateReset2(z, -MAX_WBITS) == Z_OK) {
  ------------------
  |  Branch (215:12): [True: 563, False: 0]
  ------------------
  216|    563|          z->next_in = orig_in;
  217|    563|          z->avail_in = nread;
  218|    563|          zp->zlib_init = ZLIB_INFLATING;
  219|    563|          zp->trailerlen = 4; /* Tolerate up to 4 unknown trailer bytes. */
  220|    563|          done = FALSE;
  ------------------
  |  | 1058|    563|#define FALSE false
  ------------------
  221|    563|          break;
  222|    563|        }
  223|      0|        zp->zlib_init = ZLIB_UNINIT; /* inflateEnd() already called. */
  224|      0|      }
  225|    306|      result = exit_zlib(data, z, &zp->zlib_init, process_zlib_error(data, z));
  226|    306|      break;
  227|      4|    default:
  ------------------
  |  Branch (227:5): [True: 4, False: 8.43k]
  ------------------
  228|      4|      result = exit_zlib(data, z, &zp->zlib_init, process_zlib_error(data, z));
  229|      4|      break;
  230|  8.44k|    }
  231|  8.44k|  }
  232|       |
  233|       |  /* We are about to leave this call so the `nread' data bytes will not be seen
  234|       |     again. If we are in a state that would wrongly allow restart in raw mode
  235|       |     at the next call, assume output has already started. */
  236|  1.28k|  if(nread && zp->zlib_init == ZLIB_INIT)
  ------------------
  |  Branch (236:6): [True: 1.28k, False: 0]
  |  Branch (236:15): [True: 25, False: 1.26k]
  ------------------
  237|     25|    zp->zlib_init = started; /* Cannot restart anymore. */
  238|       |
  239|  1.28k|  return result;
  240|  1.28k|}
content_encoding.c:deflate_do_close:
  282|    715|{
  283|    715|  struct zlib_writer *zp = (struct zlib_writer *)writer;
  284|    715|  z_stream *z = &zp->z; /* zlib state structure */
  285|       |
  286|    715|  exit_zlib(data, z, &zp->zlib_init, CURLE_OK);
  287|    715|}
content_encoding.c:find_unencode_writer:
  707|    946|{
  708|    946|  const struct Curl_cwtype * const *cep;
  709|       |
  710|    946|  if(phase == CURL_CW_TRANSFER_DECODE) {
  ------------------
  |  Branch (710:6): [True: 863, False: 83]
  ------------------
  711|  1.62k|    for(cep = transfer_unencoders; *cep; cep++) {
  ------------------
  |  Branch (711:36): [True: 863, False: 764]
  ------------------
  712|    863|      const struct Curl_cwtype *ce = *cep;
  713|    863|      if((curl_strnequal(name, ce->name, len) && !ce->name[len]) ||
  ------------------
  |  Branch (713:11): [True: 109, False: 754]
  |  Branch (713:50): [True: 99, False: 10]
  ------------------
  714|    764|         (ce->alias && curl_strnequal(name, ce->alias, len) &&
  ------------------
  |  Branch (714:11): [True: 0, False: 764]
  |  Branch (714:24): [True: 0, False: 0]
  ------------------
  715|      0|          !ce->alias[len]))
  ------------------
  |  Branch (715:11): [True: 0, False: 0]
  ------------------
  716|     99|        return ce;
  717|    863|    }
  718|    863|  }
  719|       |  /* look among the general decoders */
  720|  2.09k|  for(cep = general_unencoders; *cep; cep++) {
  ------------------
  |  Branch (720:33): [True: 1.95k, False: 132]
  ------------------
  721|  1.95k|    const struct Curl_cwtype *ce = *cep;
  722|  1.95k|    if((curl_strnequal(name, ce->name, len) && !ce->name[len]) ||
  ------------------
  |  Branch (722:9): [True: 739, False: 1.21k]
  |  Branch (722:48): [True: 715, False: 24]
  ------------------
  723|  1.24k|       (ce->alias && curl_strnequal(name, ce->alias, len) && !ce->alias[len]))
  ------------------
  |  Branch (723:9): [True: 979, False: 264]
  |  Branch (723:22): [True: 13, False: 966]
  |  Branch (723:62): [True: 0, False: 13]
  ------------------
  724|    715|      return ce;
  725|  1.95k|  }
  726|    132|  return NULL;
  727|    847|}
content_encoding.c:error_do_init:
  667|    131|{
  668|    131|  (void)data;
  669|    131|  (void)writer;
  670|    131|  return CURLE_OK;
  671|    131|}
content_encoding.c:error_do_write:
  676|  2.29k|{
  677|  2.29k|  (void)writer;
  678|  2.29k|  (void)buf;
  679|  2.29k|  (void)nbytes;
  680|       |
  681|  2.29k|  if(!(type & CLIENTWRITE_BODY) || !nbytes)
  ------------------
  |  |   42|  2.29k|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  |  Branch (681:6): [True: 2.28k, False: 14]
  |  Branch (681:36): [True: 10, False: 4]
  ------------------
  682|  2.29k|    return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
  683|      4|  failf(data, "Unrecognized content encoding type");
  ------------------
  |  |   62|      4|#define failf Curl_failf
  ------------------
  684|      4|  return CURLE_BAD_CONTENT_ENCODING;
  685|  2.29k|}
content_encoding.c:error_do_close:
  689|    131|{
  690|    131|  (void)data;
  691|    131|  (void)writer;
  692|    131|}

Curl_cookie_add:
  943|  27.3k|{
  944|  27.3k|  struct Cookie comem;
  945|  27.3k|  struct Cookie *co;
  946|  27.3k|  size_t myhash;
  947|  27.3k|  CURLcode result;
  948|  27.3k|  bool replaces = FALSE;
  ------------------
  |  | 1058|  27.3k|#define FALSE false
  ------------------
  949|  27.3k|  bool okay;
  950|       |
  951|  27.3k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  27.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (951:3): [True: 0, False: 27.3k]
  |  Branch (951:3): [True: 27.3k, False: 0]
  ------------------
  952|  27.3k|  DEBUGASSERT(MAX_SET_COOKIE_AMOUNT <= 255); /* counter is an unsigned char */
  ------------------
  |  | 1081|  27.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (952:3): [True: 0, Folded]
  |  Branch (952:3): [True: 27.3k, Folded]
  ------------------
  953|  27.3k|  if(data->req.setcookies >= MAX_SET_COOKIE_AMOUNT)
  ------------------
  |  |   90|  27.3k|#define MAX_SET_COOKIE_AMOUNT 50
  ------------------
  |  Branch (953:6): [True: 277, False: 27.1k]
  ------------------
  954|    277|    return CURLE_OK; /* silently ignore */
  955|       |
  956|  27.1k|  co = &comem;
  957|  27.1k|  memset(co, 0, sizeof(comem));
  958|       |
  959|  27.1k|  if(httpheader)
  ------------------
  |  Branch (959:6): [True: 12.5k, False: 14.5k]
  ------------------
  960|  12.5k|    result = parse_cookie_header(data, co, ci, &okay,
  961|  12.5k|                                 lineptr, domain, path, secure);
  962|  14.5k|  else
  963|  14.5k|    result = parse_netscape(co, ci, &okay, lineptr, secure);
  964|       |
  965|  27.1k|  if(result || !okay)
  ------------------
  |  Branch (965:6): [True: 0, False: 27.1k]
  |  Branch (965:16): [True: 16.7k, False: 10.3k]
  ------------------
  966|  16.7k|    goto fail;
  967|       |
  968|  10.3k|  if(co->prefix_secure && !co->secure)
  ------------------
  |  Branch (968:6): [True: 997, False: 9.32k]
  |  Branch (968:27): [True: 995, False: 2]
  ------------------
  969|       |    /* The __Secure- prefix only requires that the cookie be set secure */
  970|    995|    goto fail;
  971|       |
  972|  9.32k|  if(co->prefix_host) {
  ------------------
  |  Branch (972:6): [True: 2.71k, False: 6.60k]
  ------------------
  973|       |    /*
  974|       |     * The __Host- prefix requires the cookie to be secure, have a "/" path
  975|       |     * and not have a domain set.
  976|       |     */
  977|  2.71k|    if(co->secure && co->path && !strcmp(co->path, "/") && !co->tailmatch)
  ------------------
  |  Branch (977:8): [True: 5, False: 2.71k]
  |  Branch (977:22): [True: 3, False: 2]
  |  Branch (977:34): [True: 2, False: 1]
  |  Branch (977:60): [True: 1, False: 1]
  ------------------
  978|      1|      ;
  979|  2.71k|    else
  980|  2.71k|      goto fail;
  981|  2.71k|  }
  982|       |
  983|  6.60k|  if(!ci->running &&    /* read from a file */
  ------------------
  |  Branch (983:6): [True: 1.14k, False: 5.46k]
  ------------------
  984|  1.14k|     ci->newsession &&  /* clean session cookies */
  ------------------
  |  Branch (984:6): [True: 0, False: 1.14k]
  ------------------
  985|      0|     !co->expires)      /* this is a session cookie */
  ------------------
  |  Branch (985:6): [True: 0, False: 0]
  ------------------
  986|      0|    goto fail;
  987|       |
  988|  6.60k|  co->livecookie = ci->running;
  989|  6.60k|  co->creationtime = ++ci->lastct;
  990|       |
  991|       |  /*
  992|       |   * Now we have parsed the incoming line, we must now check if this supersedes
  993|       |   * an already existing cookie, which it may if the previous have the same
  994|       |   * domain and path as this.
  995|       |   */
  996|       |
  997|       |  /* remove expired cookies */
  998|  6.60k|  if(!noexpire)
  ------------------
  |  Branch (998:6): [True: 6.60k, False: 0]
  ------------------
  999|  6.60k|    remove_expired(ci);
 1000|       |
 1001|  6.60k|  if(is_public_suffix(data, co, domain))
  ------------------
  |  Branch (1001:6): [True: 0, False: 6.60k]
  ------------------
 1002|      0|    goto fail;
 1003|       |
 1004|  6.60k|  if(!replace_existing(data, co, ci, secure, &replaces))
  ------------------
  |  Branch (1004:6): [True: 0, False: 6.60k]
  ------------------
 1005|      0|    goto fail;
 1006|       |
 1007|       |  /* clone the stack struct into heap */
 1008|  6.60k|  co = curlx_memdup(&comem, sizeof(comem));
 1009|  6.60k|  if(!co) {
  ------------------
  |  Branch (1009:6): [True: 0, False: 6.60k]
  ------------------
 1010|      0|    co = &comem;
 1011|      0|    result = CURLE_OUT_OF_MEMORY;
 1012|      0|    goto fail; /* bail out if we are this low on memory */
 1013|      0|  }
 1014|       |
 1015|       |  /* add this cookie to the list */
 1016|  6.60k|  myhash = cookiehash(co->domain);
 1017|  6.60k|  Curl_llist_append(&ci->cookielist[myhash], co, &co->node);
 1018|       |
 1019|  6.60k|  if(ci->running)
  ------------------
  |  Branch (1019:6): [True: 5.46k, False: 1.14k]
  ------------------
 1020|       |    /* Only show this when NOT reading the cookies from a file */
 1021|  5.46k|    infof(data, "%s cookie %s=\"%s\" for domain %s, path %s, "
  ------------------
  |  |  143|  5.46k|  do {                               \
  |  |  144|  5.46k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  5.46k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 5.46k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 5.46k]
  |  |  |  |  ------------------
  |  |  |  |  320|  5.46k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  5.46k|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|  5.46k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 5.46k]
  |  |  ------------------
  ------------------
 1022|  6.60k|          "expire %" FMT_OFF_T,
 1023|  6.60k|          replaces ? "Replaced" : "Added", co->name, co->value,
 1024|  6.60k|          co->domain, co->path, co->expires);
 1025|       |
 1026|  6.60k|  if(!replaces)
  ------------------
  |  Branch (1026:6): [True: 2.92k, False: 3.68k]
  ------------------
 1027|  2.92k|    ci->numcookies++; /* one more cookie in the jar */
 1028|       |
 1029|       |  /*
 1030|       |   * Now that we have added a new cookie to the jar, update the expiration
 1031|       |   * tracker in case it is the next one to expire.
 1032|       |   */
 1033|  6.60k|  if(co->expires && (co->expires < ci->next_expiration))
  ------------------
  |  Branch (1033:6): [True: 1.34k, False: 5.26k]
  |  Branch (1033:21): [True: 960, False: 387]
  ------------------
 1034|    960|    ci->next_expiration = co->expires;
 1035|       |
 1036|  6.60k|  if(httpheader)
  ------------------
  |  Branch (1036:6): [True: 6.38k, False: 227]
  ------------------
 1037|  6.38k|    data->req.setcookies++;
 1038|       |
 1039|  6.60k|  return result;
 1040|  20.4k|fail:
 1041|       |  freecookie(co, FALSE);
  ------------------
  |  | 1058|  20.4k|#define FALSE false
  ------------------
 1042|  20.4k|  return result;
 1043|  6.60k|}
Curl_cookie_init:
 1060|  17.2k|{
 1061|  17.2k|  int i;
 1062|  17.2k|  struct CookieInfo *ci = curlx_calloc(1, sizeof(struct CookieInfo));
  ------------------
  |  | 1480|  17.2k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1063|  17.2k|  if(!ci)
  ------------------
  |  Branch (1063:6): [True: 0, False: 17.2k]
  ------------------
 1064|      0|    return NULL;
 1065|       |
 1066|       |  /* This does not use the destructor callback since we want to add
 1067|       |     and remove to lists while keeping the cookie struct intact */
 1068|  1.10M|  for(i = 0; i < COOKIE_HASH_SIZE; i++)
  ------------------
  |  |   54|  1.10M|#define COOKIE_HASH_SIZE 63
  ------------------
  |  Branch (1068:14): [True: 1.08M, False: 17.2k]
  ------------------
 1069|  1.08M|    Curl_llist_init(&ci->cookielist[i], NULL);
 1070|       |  /*
 1071|       |   * Initialize the next_expiration time to signal that we do not have enough
 1072|       |   * information yet.
 1073|       |   */
 1074|  17.2k|  ci->next_expiration = CURL_OFF_T_MAX;
  ------------------
  |  |  594|  17.2k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
 1075|       |
 1076|  17.2k|  return ci;
 1077|  17.2k|}
Curl_cookie_loadfiles:
 1165|  14.6k|{
 1166|  14.6k|  CURLcode result = CURLE_OK;
 1167|  14.6k|  struct curl_slist *list = data->state.cookielist;
 1168|  14.6k|  if(list) {
  ------------------
  |  Branch (1168:6): [True: 14.0k, False: 651]
  ------------------
 1169|  14.0k|    Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 1170|  14.0k|    if(!data->cookies)
  ------------------
  |  Branch (1170:8): [True: 0, False: 14.0k]
  ------------------
 1171|      0|      data->cookies = Curl_cookie_init();
 1172|  14.0k|    if(!data->cookies)
  ------------------
  |  Branch (1172:8): [True: 0, False: 14.0k]
  ------------------
 1173|      0|      result = CURLE_OUT_OF_MEMORY;
 1174|  14.0k|    else {
 1175|  14.0k|      data->state.cookie_engine = TRUE;
  ------------------
  |  | 1055|  14.0k|#define TRUE true
  ------------------
 1176|  28.0k|      while(list) {
  ------------------
  |  Branch (1176:13): [True: 14.0k, False: 14.0k]
  ------------------
 1177|  14.0k|        result = cookie_load(data, list->data, data->cookies,
 1178|  14.0k|                             (bool)data->set.cookiesession);
 1179|  14.0k|        if(result)
  ------------------
  |  Branch (1179:12): [True: 0, False: 14.0k]
  ------------------
 1180|      0|          break;
 1181|  14.0k|        list = list->next;
 1182|  14.0k|      }
 1183|  14.0k|    }
 1184|  14.0k|    Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 1185|  14.0k|  }
 1186|  14.6k|  return result;
 1187|  14.6k|}
Curl_secure_context:
 1242|  18.6k|{
 1243|  18.6k|  return conn->scheme->protocol & (CURLPROTO_HTTPS | CURLPROTO_WSS) ||
  ------------------
  |  | 1079|  18.6k|#define CURLPROTO_HTTPS   (1L << 1)
  ------------------
                return conn->scheme->protocol & (CURLPROTO_HTTPS | CURLPROTO_WSS) ||
  ------------------
  |  |   64|  18.6k|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  ------------------
  |  Branch (1243:10): [True: 0, False: 18.6k]
  ------------------
 1244|  18.6k|    curl_strequal("localhost", host) ||
  ------------------
  |  Branch (1244:5): [True: 0, False: 18.6k]
  ------------------
 1245|  18.6k|    !strcmp(host, "127.0.0.1") ||
  ------------------
  |  Branch (1245:5): [True: 81, False: 18.5k]
  ------------------
 1246|  18.5k|    !strcmp(host, "::1");
  ------------------
  |  Branch (1246:5): [True: 2, False: 18.5k]
  ------------------
 1247|  18.6k|}
Curl_cookie_getlist:
 1265|  6.82k|{
 1266|  6.82k|  size_t matches = 0;
 1267|  6.82k|  const bool is_ip = Curl_host_is_ipnum(host);
 1268|  6.82k|  const size_t myhash = cookiehash(host);
 1269|  6.82k|  struct Curl_llist_node *n;
 1270|  6.82k|  const bool secure = Curl_secure_context(conn, host);
 1271|  6.82k|  struct CookieInfo *ci = data->cookies;
 1272|  6.82k|  const char *path = data->state.up.path;
 1273|  6.82k|  CURLcode result = CURLE_OK;
 1274|  6.82k|  *okay = FALSE;
  ------------------
  |  | 1058|  6.82k|#define FALSE false
  ------------------
 1275|       |
 1276|  6.82k|  Curl_llist_init(list, NULL);
 1277|       |
 1278|  6.82k|  if(!ci || !Curl_llist_count(&ci->cookielist[myhash]))
  ------------------
  |  Branch (1278:6): [True: 0, False: 6.82k]
  |  Branch (1278:13): [True: 6.75k, False: 71]
  ------------------
 1279|  6.75k|    return CURLE_OK; /* no cookie struct or no cookies in the struct */
 1280|       |
 1281|       |  /* at first, remove expired cookies */
 1282|     71|  remove_expired(ci);
 1283|       |
 1284|    234|  for(n = Curl_llist_head(&ci->cookielist[myhash]); n; n = Curl_node_next(n)) {
  ------------------
  |  Branch (1284:53): [True: 163, False: 71]
  ------------------
 1285|    163|    struct Cookie *co = Curl_node_elem(n);
 1286|       |
 1287|       |    /* if the cookie requires we are secure we must only continue if we are! */
 1288|    163|    if(co->secure ? secure : TRUE) {
  ------------------
  |  | 1055|    163|#define TRUE true
  ------------------
  |  Branch (1288:8): [True: 4, False: 159]
  |  Branch (1288:8): [True: 160, False: 3]
  ------------------
 1289|       |
 1290|       |      /* now check if the domain is correct */
 1291|    160|      if(!co->domain ||
  ------------------
  |  Branch (1291:10): [True: 44, False: 116]
  ------------------
 1292|    116|         (co->tailmatch && !is_ip &&
  ------------------
  |  Branch (1292:11): [True: 1, False: 115]
  |  Branch (1292:28): [True: 0, False: 1]
  ------------------
 1293|      0|          cookie_tailmatch(co->domain, strlen(co->domain), host)) ||
  ------------------
  |  Branch (1293:11): [True: 0, False: 0]
  ------------------
 1294|    159|         ((!co->tailmatch || is_ip) && curl_strequal(host, co->domain))) {
  ------------------
  |  Branch (1294:12): [True: 115, False: 1]
  |  Branch (1294:30): [True: 1, False: 0]
  |  Branch (1294:40): [True: 115, False: 1]
  ------------------
 1295|       |        /*
 1296|       |         * the right part of the host matches the domain stuff in the
 1297|       |         * cookie data
 1298|       |         */
 1299|       |
 1300|       |        /*
 1301|       |         * now check the left part of the path with the cookies path
 1302|       |         * requirement
 1303|       |         */
 1304|    159|        if(!co->path || pathmatch(co->path, path)) {
  ------------------
  |  Branch (1304:12): [True: 24, False: 135]
  |  Branch (1304:25): [True: 120, False: 15]
  ------------------
 1305|       |
 1306|       |          /*
 1307|       |           * This is a match and we add it to the return-linked-list
 1308|       |           */
 1309|    144|          Curl_llist_append(list, co, &co->getnode);
 1310|    144|          matches++;
 1311|    144|          if(matches >= MAX_COOKIE_SEND_AMOUNT) {
  ------------------
  |  |  102|    144|#define MAX_COOKIE_SEND_AMOUNT 150
  ------------------
  |  Branch (1311:14): [True: 0, False: 144]
  ------------------
 1312|      0|            infof(data, "Included max number of cookies (%zu) in request!",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1313|      0|                  matches);
 1314|      0|            break;
 1315|      0|          }
 1316|    144|        }
 1317|    159|      }
 1318|    160|    }
 1319|    163|  }
 1320|       |
 1321|     71|  if(matches) {
  ------------------
  |  Branch (1321:6): [True: 52, False: 19]
  ------------------
 1322|       |    /*
 1323|       |     * Now we need to make sure that if there is a name appearing more than
 1324|       |     * once, the longest specified path version comes first. To make this the
 1325|       |     * swiftest way, we sort them all based on path length.
 1326|       |     */
 1327|     52|    struct Cookie **array;
 1328|     52|    size_t i;
 1329|       |
 1330|       |    /* alloc an array and store all cookie pointers */
 1331|     52|    array = curlx_malloc(sizeof(struct Cookie *) * matches);
  ------------------
  |  | 1478|     52|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
 1332|     52|    if(!array) {
  ------------------
  |  Branch (1332:8): [True: 0, False: 52]
  ------------------
 1333|      0|      result = CURLE_OUT_OF_MEMORY;
 1334|      0|      goto fail;
 1335|      0|    }
 1336|       |
 1337|     52|    n = Curl_llist_head(list);
 1338|       |
 1339|    196|    for(i = 0; n; n = Curl_node_next(n))
  ------------------
  |  Branch (1339:16): [True: 144, False: 52]
  ------------------
 1340|    144|      array[i++] = Curl_node_elem(n);
 1341|       |
 1342|       |    /* now sort the cookie pointers in path length order */
 1343|     52|    qsort(array, matches, sizeof(struct Cookie *), cookie_sort);
 1344|       |
 1345|       |    /* remake the linked list order according to the new order */
 1346|     52|    Curl_llist_destroy(list, NULL);
 1347|       |
 1348|    196|    for(i = 0; i < matches; i++)
  ------------------
  |  Branch (1348:16): [True: 144, False: 52]
  ------------------
 1349|    144|      Curl_llist_append(list, array[i], &array[i]->getnode);
 1350|       |
 1351|     52|    curlx_free(array); /* remove the temporary data again */
  ------------------
  |  | 1483|     52|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1352|     52|  }
 1353|       |
 1354|     71|  *okay = TRUE;
  ------------------
  |  | 1055|     71|#define TRUE true
  ------------------
 1355|     71|  return CURLE_OK; /* success */
 1356|       |
 1357|      0|fail:
 1358|       |  /* failure, clear up the allocated chain and return NULL */
 1359|       |  Curl_llist_destroy(list, NULL);
 1360|      0|  return result; /* error */
 1361|     71|}
Curl_cookie_clearall:
 1369|  17.2k|{
 1370|  17.2k|  if(ci) {
  ------------------
  |  Branch (1370:6): [True: 17.2k, False: 1]
  ------------------
 1371|  17.2k|    unsigned int i;
 1372|  1.10M|    for(i = 0; i < COOKIE_HASH_SIZE; i++) {
  ------------------
  |  |   54|  1.10M|#define COOKIE_HASH_SIZE 63
  ------------------
  |  Branch (1372:16): [True: 1.08M, False: 17.2k]
  ------------------
 1373|  1.08M|      struct Curl_llist_node *n;
 1374|  1.08M|      for(n = Curl_llist_head(&ci->cookielist[i]); n;) {
  ------------------
  |  Branch (1374:52): [True: 2.39k, False: 1.08M]
  ------------------
 1375|  2.39k|        struct Cookie *c = Curl_node_elem(n);
 1376|  2.39k|        struct Curl_llist_node *e = Curl_node_next(n);
 1377|  2.39k|        Curl_node_remove(n);
 1378|       |        freecookie(c, TRUE);
  ------------------
  |  | 1055|  2.39k|#define TRUE true
  ------------------
 1379|  2.39k|        n = e;
 1380|  2.39k|      }
 1381|  1.08M|    }
 1382|  17.2k|    ci->numcookies = 0;
 1383|  17.2k|  }
 1384|  17.2k|}
Curl_cookie_clearsess:
 1392|      1|{
 1393|      1|  unsigned int i;
 1394|       |
 1395|      1|  if(!ci)
  ------------------
  |  Branch (1395:6): [True: 1, False: 0]
  ------------------
 1396|      1|    return;
 1397|       |
 1398|      0|  for(i = 0; i < COOKIE_HASH_SIZE; i++) {
  ------------------
  |  |   54|      0|#define COOKIE_HASH_SIZE 63
  ------------------
  |  Branch (1398:14): [True: 0, False: 0]
  ------------------
 1399|      0|    struct Curl_llist_node *n = Curl_llist_head(&ci->cookielist[i]);
 1400|      0|    struct Curl_llist_node *e = NULL;
 1401|       |
 1402|      0|    for(; n; n = e) {
  ------------------
  |  Branch (1402:11): [True: 0, False: 0]
  ------------------
 1403|      0|      struct Cookie *curr = Curl_node_elem(n);
 1404|      0|      e = Curl_node_next(n); /* in case the node is removed, get it early */
 1405|      0|      if(!curr->expires) {
  ------------------
  |  Branch (1405:10): [True: 0, False: 0]
  ------------------
 1406|      0|        Curl_node_remove(n);
 1407|       |        freecookie(curr, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1408|      0|        ci->numcookies--;
 1409|      0|      }
 1410|      0|    }
 1411|      0|  }
 1412|      0|}
Curl_cookie_cleanup:
 1420|  17.2k|{
 1421|  17.2k|  if(ci) {
  ------------------
  |  Branch (1421:6): [True: 17.2k, False: 0]
  ------------------
 1422|  17.2k|    Curl_cookie_clearall(ci);
 1423|  17.2k|    curlx_free(ci); /* free the base struct as well */
  ------------------
  |  | 1483|  17.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1424|  17.2k|  }
 1425|  17.2k|}
Curl_flush_cookies:
 1613|  36.6k|{
 1614|  36.6k|  Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 1615|       |  /* only save the cookie file if a transfer was started (cookies->running is
 1616|       |     set), as otherwise the cookies were not completely initialized and there
 1617|       |     might be cookie files that were not loaded so saving the file is the
 1618|       |     wrong thing. */
 1619|  36.6k|  if(data->cookies) {
  ------------------
  |  Branch (1619:6): [True: 17.2k, False: 19.4k]
  ------------------
 1620|  17.2k|    if(data->set.str[STRING_COOKIEJAR] && data->cookies->running) {
  ------------------
  |  Branch (1620:8): [True: 17.2k, False: 33]
  |  Branch (1620:43): [True: 13.8k, False: 3.34k]
  ------------------
 1621|       |      /* if we have a destination file for all the cookies to get dumped to */
 1622|  13.8k|      CURLcode result = cookie_output(data, data->cookies,
 1623|  13.8k|                                      data->set.str[STRING_COOKIEJAR]);
 1624|  13.8k|      if(result)
  ------------------
  |  Branch (1624:10): [True: 0, False: 13.8k]
  ------------------
 1625|      0|        infof(data, "WARNING: failed to save cookies in %s: %s",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1626|  13.8k|              data->set.str[STRING_COOKIEJAR], curl_easy_strerror(result));
 1627|  13.8k|    }
 1628|       |
 1629|  17.2k|    if(cleanup && (!data->share || (data->cookies != data->share->cookies))) {
  ------------------
  |  Branch (1629:8): [True: 17.2k, False: 0]
  |  Branch (1629:20): [True: 17.2k, False: 0]
  |  Branch (1629:36): [True: 0, False: 0]
  ------------------
 1630|  17.2k|      Curl_cookie_cleanup(data->cookies);
 1631|       |      data->cookies = NULL;
 1632|  17.2k|    }
 1633|  17.2k|  }
 1634|  36.6k|  Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 1635|  36.6k|}
Curl_cookie_run:
 1638|  14.6k|{
 1639|  14.6k|  Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 1640|  14.6k|  if(data->cookies)
  ------------------
  |  Branch (1640:6): [True: 14.0k, False: 649]
  ------------------
 1641|  14.0k|    data->cookies->running = TRUE;
  ------------------
  |  | 1055|  14.0k|#define TRUE true
  ------------------
 1642|  14.6k|  Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 1643|  14.6k|}
cookie.c:parse_cookie_header:
  429|  12.5k|{
  430|       |  /* This line was read off an HTTP-header */
  431|  12.5k|  time_t now = 0;
  432|  12.5k|  size_t linelength = strlen(ptr);
  433|  12.5k|  CURLcode result = CURLE_OK;
  434|  12.5k|  struct Curl_str cookie[COOKIE_PIECES];
  435|  12.5k|  *okay = FALSE;
  ------------------
  |  | 1058|  12.5k|#define FALSE false
  ------------------
  436|  12.5k|  if(linelength > MAX_COOKIE_LINE)
  ------------------
  |  |   81|  12.5k|#define MAX_COOKIE_LINE 5000
  ------------------
  |  Branch (436:6): [True: 1, False: 12.5k]
  ------------------
  437|       |    /* discard overly long lines at once */
  438|      1|    return CURLE_OK;
  439|       |
  440|       |  /* memset instead of initializer because gcc 4.8.1 is silly */
  441|  12.5k|  memset(cookie, 0, sizeof(cookie));
  442|  59.3k|  do {
  443|  59.3k|    struct Curl_str name;
  444|  59.3k|    struct Curl_str val;
  445|       |
  446|       |    /* we have a <name>=<value> pair or a stand-alone word here */
  447|  59.3k|    if(!curlx_str_cspn(&ptr, &name, ";\t\r\n=")) {
  ------------------
  |  Branch (447:8): [True: 58.4k, False: 885]
  ------------------
  448|  58.4k|      bool sep = FALSE;
  ------------------
  |  | 1058|  58.4k|#define FALSE false
  ------------------
  449|  58.4k|      curlx_str_trimblanks(&name);
  450|       |
  451|  58.4k|      if(!curlx_str_single(&ptr, '=')) {
  ------------------
  |  Branch (451:10): [True: 40.6k, False: 17.8k]
  ------------------
  452|  40.6k|        sep = TRUE; /* a '=' was used */
  ------------------
  |  | 1055|  40.6k|#define TRUE true
  ------------------
  453|  40.6k|        if(!curlx_str_cspn(&ptr, &val, ";\r\n"))
  ------------------
  |  Branch (453:12): [True: 33.6k, False: 6.94k]
  ------------------
  454|  33.6k|          curlx_str_trimblanks(&val);
  455|       |
  456|       |        /* Reject cookies with a TAB inside the value */
  457|  40.6k|        if(curlx_strlen(&val) &&
  ------------------
  |  |   50|  81.2k|#define curlx_strlen(x) ((x)->len)
  |  |  ------------------
  |  |  |  Branch (50:25): [True: 33.5k, False: 7.07k]
  |  |  ------------------
  ------------------
  458|  33.5k|           memchr(curlx_str(&val), '\t', curlx_strlen(&val))) {
  ------------------
  |  |   49|  33.5k|#define curlx_str(x)    ((x)->str)
  ------------------
                         memchr(curlx_str(&val), '\t', curlx_strlen(&val))) {
  ------------------
  |  |   50|  33.5k|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (458:12): [True: 768, False: 32.7k]
  ------------------
  459|    768|          infof(data, "cookie contains TAB, dropping");
  ------------------
  |  |  143|    768|  do {                               \
  |  |  144|    768|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    768|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 768, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 768]
  |  |  |  |  ------------------
  |  |  |  |  320|    768|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    768|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    768|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 768]
  |  |  ------------------
  ------------------
  460|    768|          return CURLE_OK;
  461|    768|        }
  462|  40.6k|      }
  463|  17.8k|      else
  464|  17.8k|        curlx_str_init(&val);
  465|       |
  466|  57.7k|      if(!curlx_strlen(&cookie[COOKIE_NAME])) {
  ------------------
  |  |   50|  57.7k|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (466:10): [True: 12.5k, False: 45.2k]
  ------------------
  467|       |        /* The first name/value pair is the actual cookie name */
  468|  12.5k|        if(!sep ||
  ------------------
  |  Branch (468:12): [True: 554, False: 11.9k]
  ------------------
  469|       |           /* Bad name/value pair. */
  470|  11.9k|           invalid_octets(curlx_str(&name), curlx_strlen(&name)) ||
  ------------------
  |  |   49|  11.9k|#define curlx_str(x)    ((x)->str)
  ------------------
                         invalid_octets(curlx_str(&name), curlx_strlen(&name)) ||
  ------------------
  |  |   50|  11.9k|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (470:12): [True: 112, False: 11.8k]
  ------------------
  471|  11.8k|           invalid_octets(curlx_str(&val), curlx_strlen(&val)) ||
  ------------------
  |  |   49|  11.8k|#define curlx_str(x)    ((x)->str)
  ------------------
                         invalid_octets(curlx_str(&val), curlx_strlen(&val)) ||
  ------------------
  |  |   50|  11.8k|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (471:12): [True: 122, False: 11.7k]
  ------------------
  472|  11.7k|           !curlx_strlen(&name)) {
  ------------------
  |  |   50|  11.7k|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (472:12): [True: 608, False: 11.1k]
  ------------------
  473|  1.39k|          infof(data, "invalid octets in name/value, cookie dropped");
  ------------------
  |  |  143|  1.39k|  do {                               \
  |  |  144|  1.39k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  1.39k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 1.39k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.39k]
  |  |  |  |  ------------------
  |  |  |  |  320|  1.39k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.39k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  1.39k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1.39k]
  |  |  ------------------
  ------------------
  474|  1.39k|          return CURLE_OK;
  475|  1.39k|        }
  476|       |
  477|       |        /*
  478|       |         * Check for too long individual name or contents, or too long
  479|       |         * combination of name + contents. Chrome and Firefox support 4095 or
  480|       |         * 4096 bytes combo
  481|       |         */
  482|  11.1k|        if(curlx_strlen(&name) >= (MAX_NAME - 1) ||
  ------------------
  |  |   50|  11.1k|#define curlx_strlen(x) ((x)->len)
  ------------------
                      if(curlx_strlen(&name) >= (MAX_NAME - 1) ||
  ------------------
  |  |   85|  11.1k|#define MAX_NAME 4096
  ------------------
  |  Branch (482:12): [True: 2, False: 11.1k]
  ------------------
  483|  11.1k|           curlx_strlen(&val) >= (MAX_NAME - 1) ||
  ------------------
  |  |   50|  11.1k|#define curlx_strlen(x) ((x)->len)
  ------------------
                         curlx_strlen(&val) >= (MAX_NAME - 1) ||
  ------------------
  |  |   85|  11.1k|#define MAX_NAME 4096
  ------------------
  |  Branch (483:12): [True: 1, False: 11.1k]
  ------------------
  484|  11.1k|           ((curlx_strlen(&name) + curlx_strlen(&val)) > MAX_NAME)) {
  ------------------
  |  |   50|  11.1k|#define curlx_strlen(x) ((x)->len)
  ------------------
                         ((curlx_strlen(&name) + curlx_strlen(&val)) > MAX_NAME)) {
  ------------------
  |  |   50|  11.1k|#define curlx_strlen(x) ((x)->len)
  ------------------
                         ((curlx_strlen(&name) + curlx_strlen(&val)) > MAX_NAME)) {
  ------------------
  |  |   85|  11.1k|#define MAX_NAME 4096
  ------------------
  |  Branch (484:12): [True: 2, False: 11.1k]
  ------------------
  485|      5|          infof(data, "oversized cookie dropped, name/val %zu + %zu bytes",
  ------------------
  |  |  143|      5|  do {                               \
  |  |  144|      5|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      5|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 5, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 5]
  |  |  |  |  ------------------
  |  |  |  |  320|      5|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      5|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      5|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 5]
  |  |  ------------------
  ------------------
  486|      5|                curlx_strlen(&name), curlx_strlen(&val));
  487|      5|          return CURLE_OK;
  488|      5|        }
  489|       |
  490|       |        /* Check if we have a reserved prefix set. */
  491|  11.1k|        if(!strncmp("__Secure-", curlx_str(&name), 9))
  ------------------
  |  |   49|  11.1k|#define curlx_str(x)    ((x)->str)
  ------------------
  |  Branch (491:12): [True: 1.21k, False: 9.88k]
  ------------------
  492|  1.21k|          co->prefix_secure = TRUE;
  ------------------
  |  | 1055|  1.21k|#define TRUE true
  ------------------
  493|  9.88k|        else if(!strncmp("__Host-", curlx_str(&name), 7))
  ------------------
  |  |   49|  9.88k|#define curlx_str(x)    ((x)->str)
  ------------------
  |  Branch (493:17): [True: 2.71k, False: 7.16k]
  ------------------
  494|  2.71k|          co->prefix_host = TRUE;
  ------------------
  |  | 1055|  2.71k|#define TRUE true
  ------------------
  495|       |
  496|  11.1k|        cookie[COOKIE_NAME] = name;
  ------------------
  |  |  365|  11.1k|#define COOKIE_NAME   0
  ------------------
  497|  11.1k|        cookie[COOKIE_VALUE] = val;
  ------------------
  |  |  366|  11.1k|#define COOKIE_VALUE  1
  ------------------
  498|  11.1k|      }
  499|  45.2k|      else if(!sep) {
  ------------------
  |  Branch (499:15): [True: 17.2k, False: 27.9k]
  ------------------
  500|       |        /*
  501|       |         * this is a "<name>" with no content
  502|       |         */
  503|       |
  504|       |        /*
  505|       |         * secure cookies are only allowed to be set when the connection is
  506|       |         * using a secure protocol, or when the cookie is being set by
  507|       |         * reading from file
  508|       |         */
  509|  17.2k|        if(curlx_str_casecompare(&name, "secure")) {
  ------------------
  |  Branch (509:12): [True: 457, False: 16.8k]
  ------------------
  510|    457|          if(secure || !ci->running)
  ------------------
  |  Branch (510:14): [True: 212, False: 245]
  |  Branch (510:24): [True: 0, False: 245]
  ------------------
  511|    212|            co->secure = TRUE;
  ------------------
  |  | 1055|    212|#define TRUE true
  ------------------
  512|    245|          else {
  513|    245|            infof(data, "skipped cookie because not 'secure'");
  ------------------
  |  |  143|    245|  do {                               \
  |  |  144|    245|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    245|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 245, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 245]
  |  |  |  |  ------------------
  |  |  |  |  320|    245|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    245|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    245|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 245]
  |  |  ------------------
  ------------------
  514|    245|            return CURLE_OK;
  515|    245|          }
  516|    457|        }
  517|  16.8k|        else if(curlx_str_casecompare(&name, "httponly"))
  ------------------
  |  Branch (517:17): [True: 322, False: 16.5k]
  ------------------
  518|    322|          co->httponly = TRUE;
  ------------------
  |  | 1055|    322|#define TRUE true
  ------------------
  519|  17.2k|      }
  520|  27.9k|      else if(curlx_str_casecompare(&name, "path")) {
  ------------------
  |  Branch (520:15): [True: 1.47k, False: 26.4k]
  ------------------
  521|  1.47k|        cookie[COOKIE_PATH] = val;
  ------------------
  |  |  368|  1.47k|#define COOKIE_PATH   3
  ------------------
  522|  1.47k|      }
  523|  26.4k|      else if(curlx_str_casecompare(&name, "domain") && curlx_strlen(&val)) {
  ------------------
  |  |   50|      0|#define curlx_strlen(x) ((x)->len)
  |  |  ------------------
  |  |  |  Branch (50:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (523:15): [True: 0, False: 26.4k]
  ------------------
  524|      0|        bool is_ip;
  525|      0|        const char *v = curlx_str(&val);
  ------------------
  |  |   49|      0|#define curlx_str(x)    ((x)->str)
  ------------------
  526|       |        /*
  527|       |         * Now, we make sure that our host is within the given domain, or
  528|       |         * the given domain is not valid and thus cannot be set.
  529|       |         */
  530|       |
  531|      0|        if('.' == *v)
  ------------------
  |  Branch (531:12): [True: 0, False: 0]
  ------------------
  532|      0|          curlx_str_nudge(&val, 1);
  533|       |
  534|      0|#ifndef USE_LIBPSL
  535|       |        /*
  536|       |         * Without PSL we do not know when the incoming cookie is set on a
  537|       |         * TLD or otherwise "protected" suffix. To reduce risk, we require a
  538|       |         * dot OR the exact hostname being "localhost".
  539|       |         */
  540|      0|        if(bad_domain(curlx_str(&val), curlx_strlen(&val)))
  ------------------
  |  |   49|      0|#define curlx_str(x)    ((x)->str)
  ------------------
                      if(bad_domain(curlx_str(&val), curlx_strlen(&val)))
  ------------------
  |  |   50|      0|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (540:12): [True: 0, False: 0]
  ------------------
  541|      0|          domain = ":";
  542|      0|#endif
  543|       |
  544|      0|        is_ip = Curl_host_is_ipnum(domain ? domain : curlx_str(&val));
  ------------------
  |  |   49|      0|#define curlx_str(x)    ((x)->str)
  ------------------
  |  Branch (544:36): [True: 0, False: 0]
  ------------------
  545|       |
  546|      0|        if(!domain ||
  ------------------
  |  Branch (546:12): [True: 0, False: 0]
  ------------------
  547|      0|           (is_ip &&
  ------------------
  |  Branch (547:13): [True: 0, False: 0]
  ------------------
  548|      0|            !strncmp(curlx_str(&val), domain, curlx_strlen(&val)) &&
  ------------------
  |  |   49|      0|#define curlx_str(x)    ((x)->str)
  ------------------
                          !strncmp(curlx_str(&val), domain, curlx_strlen(&val)) &&
  ------------------
  |  |   50|      0|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (548:13): [True: 0, False: 0]
  ------------------
  549|      0|            (curlx_strlen(&val) == strlen(domain))) ||
  ------------------
  |  |   50|      0|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (549:13): [True: 0, False: 0]
  ------------------
  550|      0|           (!is_ip && cookie_tailmatch(curlx_str(&val),
  ------------------
  |  |   49|      0|#define curlx_str(x)    ((x)->str)
  ------------------
  |  Branch (550:13): [True: 0, False: 0]
  |  Branch (550:23): [True: 0, False: 0]
  ------------------
  551|      0|                                          curlx_strlen(&val), domain))) {
  ------------------
  |  |   50|      0|#define curlx_strlen(x) ((x)->len)
  ------------------
  552|      0|          cookie[COOKIE_DOMAIN] = val;
  ------------------
  |  |  367|      0|#define COOKIE_DOMAIN 2
  ------------------
  553|      0|          if(!is_ip)
  ------------------
  |  Branch (553:14): [True: 0, False: 0]
  ------------------
  554|      0|            co->tailmatch = TRUE; /* we always do that if the domain name was
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  555|       |                                     given */
  556|      0|        }
  557|      0|        else {
  558|       |          /*
  559|       |           * We did not get a tailmatch and then the attempted set domain is
  560|       |           * not a domain to which the current host belongs. Mark as bad.
  561|       |           */
  562|      0|          infof(data, "skipped cookie with bad tailmatch domain: %s",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  563|      0|                curlx_str(&val));
  564|      0|          return CURLE_OK;
  565|      0|        }
  566|      0|      }
  567|  26.4k|      else if(curlx_str_casecompare(&name, "max-age") && curlx_strlen(&val)) {
  ------------------
  |  |   50|      0|#define curlx_strlen(x) ((x)->len)
  |  |  ------------------
  |  |  |  Branch (50:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (567:15): [True: 0, False: 26.4k]
  ------------------
  568|       |        /*
  569|       |         * Defined in RFC2109:
  570|       |         *
  571|       |         * Optional. The Max-Age attribute defines the lifetime of the
  572|       |         * cookie, in seconds. The delta-seconds value is a decimal non-
  573|       |         * negative integer. After delta-seconds seconds elapse, the
  574|       |         * client should discard the cookie. A value of zero means the
  575|       |         * cookie should be discarded immediately.
  576|       |         */
  577|      0|        int rc;
  578|      0|        const char *maxage = curlx_str(&val);
  ------------------
  |  |   49|      0|#define curlx_str(x)    ((x)->str)
  ------------------
  579|      0|        if(*maxage == '\"')
  ------------------
  |  Branch (579:12): [True: 0, False: 0]
  ------------------
  580|      0|          maxage++;
  581|      0|        rc = curlx_str_number(&maxage, &co->expires, CURL_OFF_T_MAX);
  ------------------
  |  |  594|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  582|      0|        if(!now)
  ------------------
  |  Branch (582:12): [True: 0, False: 0]
  ------------------
  583|      0|          now = time(NULL);
  584|      0|        switch(rc) {
  585|      0|        case STRE_OVERFLOW:
  ------------------
  |  |   35|      0|#define STRE_OVERFLOW 7
  ------------------
  |  Branch (585:9): [True: 0, False: 0]
  ------------------
  586|       |          /* overflow, used max value */
  587|      0|          co->expires = CURL_OFF_T_MAX;
  ------------------
  |  |  594|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  588|      0|          break;
  589|      0|        default:
  ------------------
  |  Branch (589:9): [True: 0, False: 0]
  ------------------
  590|       |          /* negative or otherwise bad, expire */
  591|      0|          co->expires = 1;
  592|      0|          break;
  593|      0|        case STRE_OK:
  ------------------
  |  |   28|      0|#define STRE_OK       0
  ------------------
  |  Branch (593:9): [True: 0, False: 0]
  ------------------
  594|      0|          if(!co->expires)
  ------------------
  |  Branch (594:14): [True: 0, False: 0]
  ------------------
  595|      0|            co->expires = 1; /* expire now */
  596|      0|          else if(CURL_OFF_T_MAX - now < co->expires)
  ------------------
  |  |  594|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (596:19): [True: 0, False: 0]
  ------------------
  597|       |            /* would overflow */
  598|      0|            co->expires = CURL_OFF_T_MAX;
  ------------------
  |  |  594|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  599|      0|          else
  600|      0|            co->expires += now;
  601|      0|          break;
  602|      0|        }
  603|      0|        cap_expires(now, co);
  604|      0|      }
  605|  26.4k|      else if(curlx_str_casecompare(&name, "expires") && curlx_strlen(&val) &&
  ------------------
  |  |   50|  42.2k|#define curlx_strlen(x) ((x)->len)
  |  |  ------------------
  |  |  |  Branch (50:25): [True: 15.5k, False: 245]
  |  |  ------------------
  ------------------
  |  Branch (605:15): [True: 15.8k, False: 10.6k]
  ------------------
  606|  15.5k|              !co->expires && (curlx_strlen(&val) < MAX_DATE_LENGTH)) {
  ------------------
  |  |   50|  15.2k|#define curlx_strlen(x) ((x)->len)
  ------------------
                            !co->expires && (curlx_strlen(&val) < MAX_DATE_LENGTH)) {
  ------------------
  |  |  363|  15.2k|#define MAX_DATE_LENGTH 80
  ------------------
  |  Branch (606:15): [True: 15.2k, False: 349]
  |  Branch (606:31): [True: 15.0k, False: 242]
  ------------------
  607|       |        /*
  608|       |         * Let max-age have priority.
  609|       |         *
  610|       |         * If the date cannot get parsed for whatever reason, the cookie
  611|       |         * will be treated as a session cookie
  612|       |         */
  613|  15.0k|        char dbuf[MAX_DATE_LENGTH + 1];
  614|  15.0k|        time_t date = 0;
  615|  15.0k|        memcpy(dbuf, curlx_str(&val), curlx_strlen(&val));
  ------------------
  |  |   49|  15.0k|#define curlx_str(x)    ((x)->str)
  ------------------
                      memcpy(dbuf, curlx_str(&val), curlx_strlen(&val));
  ------------------
  |  |   50|  15.0k|#define curlx_strlen(x) ((x)->len)
  ------------------
  616|  15.0k|        dbuf[curlx_strlen(&val)] = 0;
  ------------------
  |  |   50|  15.0k|#define curlx_strlen(x) ((x)->len)
  ------------------
  617|  15.0k|        if(!Curl_getdate_capped(dbuf, &date)) {
  ------------------
  |  Branch (617:12): [True: 1.62k, False: 13.3k]
  ------------------
  618|  1.62k|          if(!date)
  ------------------
  |  Branch (618:14): [True: 1, False: 1.62k]
  ------------------
  619|      1|            date++;
  620|  1.62k|          co->expires = (curl_off_t)date;
  621|  1.62k|        }
  622|  13.3k|        else
  623|  13.3k|          co->expires = 0;
  624|  15.0k|        if(!now)
  ------------------
  |  Branch (624:12): [True: 7.94k, False: 7.06k]
  ------------------
  625|  7.94k|          now = time(NULL);
  626|  15.0k|        cap_expires(now, co);
  627|  15.0k|      }
  628|  57.7k|    }
  629|  59.3k|  } while(!curlx_str_single(&ptr, ';'));
  ------------------
  |  Branch (629:11): [True: 46.8k, False: 10.1k]
  ------------------
  630|       |
  631|  10.1k|  if(curlx_strlen(&cookie[COOKIE_NAME])) {
  ------------------
  |  |   50|  10.1k|#define curlx_strlen(x) ((x)->len)
  |  |  ------------------
  |  |  |  Branch (50:25): [True: 10.0k, False: 31]
  |  |  ------------------
  ------------------
  632|       |    /* the header was fine, now store the data */
  633|  10.0k|    result = storecookie(co, &cookie[0], path, domain);
  634|  10.0k|    if(!result)
  ------------------
  |  Branch (634:8): [True: 10.0k, False: 0]
  ------------------
  635|  10.0k|      *okay = TRUE;
  ------------------
  |  | 1055|  10.0k|#define TRUE true
  ------------------
  636|  10.0k|  }
  637|  10.1k|  return result;
  638|  12.5k|}
cookie.c:invalid_octets:
  347|  23.7k|{
  348|  23.7k|  const unsigned char *p = (const unsigned char *)ptr;
  349|       |  /* Reject all bytes \x01 - \x1f (*except* \x09, TAB) + \x7f */
  350|   284k|  while(len && *p) {
  ------------------
  |  Branch (350:9): [True: 260k, False: 23.5k]
  |  Branch (350:16): [True: 260k, False: 0]
  ------------------
  351|   260k|    if(((*p != 9) && (*p < 0x20)) || (*p == 0x7f))
  ------------------
  |  Branch (351:9): [True: 260k, False: 0]
  |  Branch (351:22): [True: 187, False: 260k]
  |  Branch (351:38): [True: 47, False: 260k]
  ------------------
  352|    234|      return TRUE;
  ------------------
  |  | 1055|    234|#define TRUE true
  ------------------
  353|   260k|    p++;
  354|   260k|    len--;
  355|   260k|  }
  356|  23.5k|  return FALSE;
  ------------------
  |  | 1058|  23.5k|#define FALSE false
  ------------------
  357|  23.7k|}
cookie.c:cap_expires:
   53|  15.0k|{
   54|  15.0k|  if(co->expires && (TIME_T_MAX - COOKIES_MAXAGE - 30) > now) {
  ------------------
  |  |  614|  1.62k|#  define TIME_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
                if(co->expires && (TIME_T_MAX - COOKIES_MAXAGE - 30) > now) {
  ------------------
  |  |   44|  1.62k|#define COOKIES_MAXAGE (400 * 24 * 3600)
  ------------------
  |  Branch (54:6): [True: 1.62k, False: 13.3k]
  |  Branch (54:21): [True: 1.62k, False: 0]
  ------------------
   55|  1.62k|    timediff_t cap = now + COOKIES_MAXAGE;
  ------------------
  |  |   44|  1.62k|#define COOKIES_MAXAGE (400 * 24 * 3600)
  ------------------
   56|  1.62k|    if(co->expires > cap) {
  ------------------
  |  Branch (56:8): [True: 611, False: 1.01k]
  ------------------
   57|    611|      cap += 30;
   58|    611|      co->expires = (cap / 60) * 60;
   59|    611|    }
   60|  1.62k|  }
   61|  15.0k|}
cookie.c:storecookie:
  374|  10.0k|{
  375|  10.0k|  CURLcode result;
  376|  10.0k|  result = strstore(&co->name, curlx_str(&cp[COOKIE_NAME]),
  ------------------
  |  |   49|  10.0k|#define curlx_str(x)    ((x)->str)
  ------------------
  377|  10.0k|                    curlx_strlen(&cp[COOKIE_NAME]));
  ------------------
  |  |   50|  10.0k|#define curlx_strlen(x) ((x)->len)
  ------------------
  378|  10.0k|  if(!result)
  ------------------
  |  Branch (378:6): [True: 10.0k, False: 0]
  ------------------
  379|  10.0k|    result = strstore(&co->value, curlx_str(&cp[COOKIE_VALUE]),
  ------------------
  |  |   49|  10.0k|#define curlx_str(x)    ((x)->str)
  ------------------
  380|  10.0k|                      curlx_strlen(&cp[COOKIE_VALUE]));
  ------------------
  |  |   50|  10.0k|#define curlx_strlen(x) ((x)->len)
  ------------------
  381|  10.0k|  if(!result) {
  ------------------
  |  Branch (381:6): [True: 10.0k, False: 0]
  ------------------
  382|  10.0k|    size_t plen = 0;
  383|  10.0k|    if(curlx_strlen(&cp[COOKIE_PATH])) {
  ------------------
  |  |   50|  10.0k|#define curlx_strlen(x) ((x)->len)
  |  |  ------------------
  |  |  |  Branch (50:25): [True: 879, False: 9.21k]
  |  |  ------------------
  ------------------
  384|    879|      path = curlx_str(&cp[COOKIE_PATH]);
  ------------------
  |  |   49|    879|#define curlx_str(x)    ((x)->str)
  ------------------
  385|    879|      plen = curlx_strlen(&cp[COOKIE_PATH]);
  ------------------
  |  |   50|    879|#define curlx_strlen(x) ((x)->len)
  ------------------
  386|    879|    }
  387|  9.21k|    else if(path) {
  ------------------
  |  Branch (387:13): [True: 8.33k, False: 877]
  ------------------
  388|       |      /* No path was given in the header line, set the default */
  389|  8.33k|      const char *endslash = strrchr(path, '/');
  390|  8.33k|      if(endslash)
  ------------------
  |  Branch (390:10): [True: 8.33k, False: 0]
  ------------------
  391|  8.33k|        plen = endslash - path + 1; /* include end slash */
  392|      0|      else
  393|      0|        plen = strlen(path);
  394|  8.33k|    }
  395|       |
  396|  10.0k|    if(path) {
  ------------------
  |  Branch (396:8): [True: 9.21k, False: 877]
  ------------------
  397|  9.21k|      co->path = sanitize_cookie_path(path, plen);
  398|  9.21k|      if(!co->path)
  ------------------
  |  Branch (398:10): [True: 0, False: 9.21k]
  ------------------
  399|      0|        result = CURLE_OUT_OF_MEMORY;
  400|  9.21k|    }
  401|  10.0k|  }
  402|  10.0k|  if(!result) {
  ------------------
  |  Branch (402:6): [True: 10.0k, False: 0]
  ------------------
  403|  10.0k|    if(curlx_strlen(&cp[COOKIE_DOMAIN]))
  ------------------
  |  |   50|  10.0k|#define curlx_strlen(x) ((x)->len)
  |  |  ------------------
  |  |  |  Branch (50:25): [True: 0, False: 10.0k]
  |  |  ------------------
  ------------------
  404|      0|      result = strstore(&co->domain, curlx_str(&cp[COOKIE_DOMAIN]),
  ------------------
  |  |   49|      0|#define curlx_str(x)    ((x)->str)
  ------------------
  405|      0|                        curlx_strlen(&cp[COOKIE_DOMAIN]));
  ------------------
  |  |   50|      0|#define curlx_strlen(x) ((x)->len)
  ------------------
  406|  10.0k|    else if(domain) {
  ------------------
  |  Branch (406:13): [True: 9.17k, False: 918]
  ------------------
  407|       |      /* no domain was given in the header line, set the default */
  408|  9.17k|      co->domain = curlx_strdup(domain);
  ------------------
  |  | 1477|  9.17k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  409|  9.17k|      if(!co->domain)
  ------------------
  |  Branch (409:10): [True: 0, False: 9.17k]
  ------------------
  410|      0|        result = CURLE_OUT_OF_MEMORY;
  411|  9.17k|    }
  412|  10.0k|  }
  413|  10.0k|  return result;
  414|  10.0k|}
cookie.c:strstore:
  256|  20.1k|{
  257|  20.1k|  DEBUGASSERT(str);
  ------------------
  |  | 1081|  20.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (257:3): [True: 0, False: 20.1k]
  |  Branch (257:3): [True: 20.1k, False: 0]
  ------------------
  258|  20.1k|  *str = curlx_memdup0(newstr, len);
  259|  20.1k|  if(!*str)
  ------------------
  |  Branch (259:6): [True: 0, False: 20.1k]
  ------------------
  260|      0|    return CURLE_OUT_OF_MEMORY;
  261|  20.1k|  return CURLE_OK;
  262|  20.1k|}
cookie.c:sanitize_cookie_path:
  227|  9.29k|{
  228|       |  /* some sites send path attribute within '"'. */
  229|  9.29k|  if(len && (cookie_path[0] == '\"')) {
  ------------------
  |  Branch (229:6): [True: 9.29k, False: 0]
  |  Branch (229:13): [True: 435, False: 8.86k]
  ------------------
  230|    435|    cookie_path++;
  231|    435|    len--;
  232|       |
  233|    435|    if(len && (cookie_path[len - 1] == '\"'))
  ------------------
  |  Branch (233:8): [True: 352, False: 83]
  |  Branch (233:15): [True: 88, False: 264]
  ------------------
  234|     88|      len--;
  235|    435|  }
  236|       |
  237|       |  /* RFC6265 5.2.4 The Path Attribute */
  238|  9.29k|  if(!len || (cookie_path[0] != '/'))
  ------------------
  |  Branch (238:6): [True: 85, False: 9.21k]
  |  Branch (238:14): [True: 469, False: 8.74k]
  ------------------
  239|       |    /* Let cookie-path be the default-path. */
  240|    554|    return curlx_strdup("/");
  ------------------
  |  | 1477|    554|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  241|       |
  242|       |  /* remove trailing slash when path is non-empty */
  243|       |  /* convert /hoge/ to /hoge */
  244|  8.74k|  if(len > 1 && cookie_path[len - 1] == '/')
  ------------------
  |  Branch (244:6): [True: 747, False: 7.99k]
  |  Branch (244:17): [True: 345, False: 402]
  ------------------
  245|    345|    len--;
  246|       |
  247|  8.74k|  return curlx_memdup0(cookie_path, len);
  248|  9.29k|}
cookie.c:parse_netscape:
  646|  14.5k|{
  647|       |  /*
  648|       |   * This line is NOT an HTTP header style line, we do offer support for
  649|       |   * reading the odd netscape cookies-file format here
  650|       |   */
  651|  14.5k|  const char *ptr, *next;
  652|  14.5k|  int fields;
  653|  14.5k|  size_t len;
  654|  14.5k|  *okay = FALSE;
  ------------------
  |  | 1058|  14.5k|#define FALSE false
  ------------------
  655|       |
  656|       |  /*
  657|       |   * In 2008, Internet Explorer introduced HTTP-only cookies to prevent XSS
  658|       |   * attacks. Cookies marked httpOnly are not accessible to JavaScript. In
  659|       |   * Firefox's cookie files, they are prefixed #HttpOnly_ and the rest
  660|       |   * remains as usual, so we skip 10 characters of the line.
  661|       |   */
  662|  14.5k|  if(strncmp(lineptr, "#HttpOnly_", 10) == 0) {
  ------------------
  |  Branch (662:6): [True: 1, False: 14.5k]
  ------------------
  663|      1|    lineptr += 10;
  664|      1|    co->httponly = TRUE;
  ------------------
  |  | 1055|      1|#define TRUE true
  ------------------
  665|      1|  }
  666|       |
  667|  14.5k|  if(lineptr[0] == '#')
  ------------------
  |  Branch (667:6): [True: 38, False: 14.5k]
  ------------------
  668|       |    /* do not even try the comments */
  669|     38|    return CURLE_OK;
  670|       |
  671|       |  /*
  672|       |   * Now loop through the fields and init the struct we already have
  673|       |   * allocated
  674|       |   */
  675|  14.5k|  fields = 0;
  676|  30.6k|  for(next = lineptr; next; fields++) {
  ------------------
  |  Branch (676:23): [True: 16.2k, False: 14.4k]
  ------------------
  677|  16.2k|    ptr = next;
  678|  16.2k|    len = strcspn(ptr, "\t\r\n");
  679|  16.2k|    next = (ptr[len] == '\t' ? &ptr[len + 1] : NULL);
  ------------------
  |  Branch (679:13): [True: 1.68k, False: 14.5k]
  ------------------
  680|  16.2k|    switch(fields) {
  ------------------
  |  Branch (680:12): [True: 15.8k, False: 386]
  ------------------
  681|  14.5k|    case 0:
  ------------------
  |  Branch (681:5): [True: 14.5k, False: 1.67k]
  ------------------
  682|  14.5k|      if(ptr[0] == '.') { /* skip preceding dots */
  ------------------
  |  Branch (682:10): [True: 1, False: 14.5k]
  ------------------
  683|      1|        ptr++;
  684|      1|        len--;
  685|      1|      }
  686|  14.5k|      co->domain = curlx_memdup0(ptr, len);
  687|  14.5k|      if(!co->domain)
  ------------------
  |  Branch (687:10): [True: 0, False: 14.5k]
  ------------------
  688|      0|        return CURLE_OUT_OF_MEMORY;
  689|  14.5k|      break;
  690|  14.5k|    case 1:
  ------------------
  |  Branch (690:5): [True: 368, False: 15.8k]
  ------------------
  691|       |      /*
  692|       |       * flag: A TRUE/FALSE value indicating if all machines within a given
  693|       |       * domain can access the variable. Set TRUE when the cookie says
  694|       |       * .example.com and to false when the domain is complete www.example.com
  695|       |       */
  696|    368|      co->tailmatch = !!curl_strnequal(ptr, "TRUE", len);
  697|    368|      break;
  698|    364|    case 2:
  ------------------
  |  Branch (698:5): [True: 364, False: 15.8k]
  ------------------
  699|       |      /* The file format allows the path field to remain not filled in */
  700|    364|      if(strncmp("TRUE", ptr, len) && strncmp("FALSE", ptr, len)) {
  ------------------
  |  Branch (700:10): [True: 85, False: 279]
  |  Branch (700:39): [True: 84, False: 1]
  ------------------
  701|       |        /* only if the path does not look like a boolean option! */
  702|     84|        co->path = sanitize_cookie_path(ptr, len);
  703|     84|        if(!co->path)
  ------------------
  |  Branch (703:12): [True: 0, False: 84]
  ------------------
  704|      0|          return CURLE_OUT_OF_MEMORY;
  705|     84|        break;
  706|     84|      }
  707|    280|      else {
  708|       |        /* this does not look like a path, make one up! */
  709|    280|        co->path = curlx_strdup("/");
  ------------------
  |  | 1477|    280|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  710|    280|        if(!co->path)
  ------------------
  |  Branch (710:12): [True: 0, False: 280]
  ------------------
  711|      0|          return CURLE_OUT_OF_MEMORY;
  712|    280|      }
  713|    280|      fields++; /* add a field and fall down to secure */
  714|    280|      FALLTHROUGH();
  ------------------
  |  |  821|    280|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  715|    294|    case 3:
  ------------------
  |  Branch (715:5): [True: 14, False: 16.1k]
  ------------------
  716|    294|      co->secure = FALSE;
  ------------------
  |  | 1058|    294|#define FALSE false
  ------------------
  717|    294|      if(curl_strnequal(ptr, "TRUE", len)) {
  ------------------
  |  Branch (717:10): [True: 286, False: 8]
  ------------------
  718|    286|        if(secure || ci->running)
  ------------------
  |  Branch (718:12): [True: 286, False: 0]
  |  Branch (718:22): [True: 0, False: 0]
  ------------------
  719|    286|          co->secure = TRUE;
  ------------------
  |  | 1055|    286|#define TRUE true
  ------------------
  720|      0|        else
  721|      0|          return CURLE_OK;
  722|    286|      }
  723|    294|      break;
  724|    294|    case 4:
  ------------------
  |  Branch (724:5): [True: 285, False: 15.9k]
  ------------------
  725|    285|      if(curlx_str_number(&ptr, &co->expires, CURL_OFF_T_MAX))
  ------------------
  |  |  594|    285|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (725:10): [True: 37, False: 248]
  ------------------
  726|     37|        return CURLE_OK;
  727|    248|      break;
  728|    248|    case 5:
  ------------------
  |  Branch (728:5): [True: 242, False: 15.9k]
  ------------------
  729|    242|      co->name = curlx_memdup0(ptr, len);
  730|    242|      if(!co->name)
  ------------------
  |  Branch (730:10): [True: 0, False: 242]
  ------------------
  731|      0|        return CURLE_OUT_OF_MEMORY;
  732|    242|      else {
  733|       |        /* For Netscape file format cookies we check prefix on the name */
  734|    242|        if(curl_strnequal("__Secure-", co->name, 9))
  ------------------
  |  Branch (734:12): [True: 1, False: 241]
  ------------------
  735|      1|          co->prefix_secure = TRUE;
  ------------------
  |  | 1055|      1|#define TRUE true
  ------------------
  736|    241|        else if(curl_strnequal("__Host-", co->name, 7))
  ------------------
  |  Branch (736:17): [True: 4, False: 237]
  ------------------
  737|      4|          co->prefix_host = TRUE;
  ------------------
  |  | 1055|      4|#define TRUE true
  ------------------
  738|    242|      }
  739|    242|      break;
  740|    242|    case 6:
  ------------------
  |  Branch (740:5): [True: 20, False: 16.1k]
  ------------------
  741|     20|      co->value = curlx_memdup0(ptr, len);
  742|     20|      if(!co->value)
  ------------------
  |  Branch (742:10): [True: 0, False: 20]
  ------------------
  743|      0|        return CURLE_OUT_OF_MEMORY;
  744|     20|      break;
  745|  16.2k|    }
  746|  16.2k|  }
  747|  14.4k|  if(fields == 6) {
  ------------------
  |  Branch (747:6): [True: 222, False: 14.2k]
  ------------------
  748|       |    /* we got a cookie with blank contents, fix it */
  749|    222|    co->value = curlx_strdup("");
  ------------------
  |  | 1477|    222|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  750|    222|    if(!co->value)
  ------------------
  |  Branch (750:8): [True: 0, False: 222]
  ------------------
  751|      0|      return CURLE_OUT_OF_MEMORY;
  752|    222|    else
  753|    222|      fields++;
  754|    222|  }
  755|       |
  756|  14.4k|  if(fields != 7)
  ------------------
  |  Branch (756:6): [True: 14.2k, False: 230]
  ------------------
  757|       |    /* we did not find the sufficient number of fields */
  758|  14.2k|    return CURLE_OK;
  759|       |
  760|    230|  *okay = TRUE;
  ------------------
  |  | 1055|    230|#define TRUE true
  ------------------
  761|    230|  return CURLE_OK;
  762|  14.4k|}
cookie.c:remove_expired:
  274|  34.5k|{
  275|  34.5k|  struct Cookie *co;
  276|  34.5k|  curl_off_t now = (curl_off_t)time(NULL);
  277|  34.5k|  unsigned int i;
  278|       |
  279|       |  /*
  280|       |   * If the earliest expiration timestamp in the jar is in the future we can
  281|       |   * skip scanning the whole jar and instead exit early as there will not be
  282|       |   * any cookies to evict. If we need to evict, reset the next_expiration
  283|       |   * counter in order to track the next one. In case the recorded first
  284|       |   * expiration is the max offset, then perform the safe fallback of checking
  285|       |   * all cookies.
  286|       |   */
  287|  34.5k|  if(now < ci->next_expiration &&
  ------------------
  |  Branch (287:6): [True: 34.0k, False: 527]
  ------------------
  288|  34.0k|     ci->next_expiration != CURL_OFF_T_MAX)
  ------------------
  |  |  594|  34.0k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (288:6): [True: 691, False: 33.3k]
  ------------------
  289|    691|    return;
  290|  33.8k|  else
  291|  33.8k|    ci->next_expiration = CURL_OFF_T_MAX;
  ------------------
  |  |  594|  33.8k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  292|       |
  293|  2.16M|  for(i = 0; i < COOKIE_HASH_SIZE; i++) {
  ------------------
  |  |   54|  2.16M|#define COOKIE_HASH_SIZE 63
  ------------------
  |  Branch (293:14): [True: 2.13M, False: 33.8k]
  ------------------
  294|  2.13M|    struct Curl_llist_node *n;
  295|  2.13M|    struct Curl_llist_node *e = NULL;
  296|       |
  297|  2.14M|    for(n = Curl_llist_head(&ci->cookielist[i]); n; n = e) {
  ------------------
  |  Branch (297:50): [True: 9.72k, False: 2.13M]
  ------------------
  298|  9.72k|      co = Curl_node_elem(n);
  299|  9.72k|      e = Curl_node_next(n);
  300|  9.72k|      if(co->expires) {
  ------------------
  |  Branch (300:10): [True: 865, False: 8.86k]
  ------------------
  301|    865|        if(co->expires < now) {
  ------------------
  |  Branch (301:12): [True: 527, False: 338]
  ------------------
  302|    527|          Curl_node_remove(n);
  303|    527|          freecookie(co, TRUE);
  ------------------
  |  | 1055|    527|#define TRUE true
  ------------------
  304|    527|          ci->numcookies--;
  305|    527|        }
  306|    338|        else if(co->expires < ci->next_expiration)
  ------------------
  |  Branch (306:17): [True: 290, False: 48]
  ------------------
  307|       |          /*
  308|       |           * If this cookie has an expiration timestamp earlier than what we
  309|       |           * have seen so far then record it for the next round of expirations.
  310|       |           */
  311|    290|          ci->next_expiration = co->expires;
  312|    865|      }
  313|  9.72k|    }
  314|  2.13M|  }
  315|  33.8k|}
cookie.c:is_public_suffix:
  767|  6.60k|{
  768|       |#ifdef USE_LIBPSL
  769|       |  /*
  770|       |   * Check if the domain is a Public Suffix and if yes, ignore the cookie. We
  771|       |   * must also check that the data handle is not NULL since the psl code will
  772|       |   * dereference it.
  773|       |   */
  774|       |  DEBUGF(infof(data, "PSL check set-cookie '%s' for domain=%s in %s",
  775|       |               co->name, co->domain, domain));
  776|       |  if(data && (domain && co->domain && !Curl_host_is_ipnum(co->domain))) {
  777|       |    bool acceptable = FALSE;
  778|       |    char lcase[256];
  779|       |    char lcookie[256];
  780|       |    size_t dlen = strlen(domain);
  781|       |    size_t clen = strlen(co->domain);
  782|       |
  783|       |    /* trim trailing dots */
  784|       |    if(dlen && (domain[dlen - 1] == '.'))
  785|       |      dlen--;
  786|       |    if(clen && (co->domain[clen - 1] == '.'))
  787|       |      clen--;
  788|       |
  789|       |    if((dlen < sizeof(lcase)) && (clen < sizeof(lcookie))) {
  790|       |      const psl_ctx_t *psl = Curl_psl_use(data);
  791|       |      if(psl) {
  792|       |        /* the PSL check requires lowercase domain name and pattern */
  793|       |        Curl_strntolower(lcase, domain, dlen);
  794|       |        lcase[dlen] = 0;
  795|       |        Curl_strntolower(lcookie, co->domain, clen);
  796|       |        lcookie[clen] = 0;
  797|       |        acceptable = psl_is_cookie_domain_acceptable(psl, lcase, lcookie);
  798|       |        Curl_psl_release(data);
  799|       |      }
  800|       |      else
  801|       |        infof(data, "libpsl problem, rejecting cookie for safety");
  802|       |    }
  803|       |
  804|       |    if(!acceptable) {
  805|       |      infof(data, "cookie '%s' dropped, domain '%s' must not "
  806|       |            "set cookies for '%s'", co->name, domain, co->domain);
  807|       |      return TRUE;
  808|       |    }
  809|       |  }
  810|       |#else
  811|  6.60k|  (void)data;
  812|  6.60k|  (void)co;
  813|  6.60k|  (void)domain;
  814|  6.60k|  DEBUGF(infof(data, "NO PSL to check set-cookie '%s' for domain=%s in %s",
  ------------------
  |  | 1067|  46.2k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 6.60k, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 6.60k]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 6.60k]
  |  |  ------------------
  ------------------
  815|  6.60k|               co->name, co->domain, domain));
  816|  6.60k|#endif
  817|       |  return FALSE;
  ------------------
  |  | 1058|  6.60k|#define FALSE false
  ------------------
  818|  6.60k|}
cookie.c:replace_existing:
  826|  6.60k|{
  827|  6.60k|  bool replace_old = FALSE;
  ------------------
  |  | 1058|  6.60k|#define FALSE false
  ------------------
  828|  6.60k|  struct Curl_llist_node *replace_n = NULL;
  829|  6.60k|  struct Curl_llist_node *n;
  830|  6.60k|  size_t myhash = cookiehash(co->domain);
  831|  14.8k|  for(n = Curl_llist_head(&ci->cookielist[myhash]); n; n = Curl_node_next(n)) {
  ------------------
  |  Branch (831:53): [True: 8.26k, False: 6.60k]
  ------------------
  832|  8.26k|    struct Cookie *clist = Curl_node_elem(n);
  833|  8.26k|    if(!strcmp(clist->name, co->name)) {
  ------------------
  |  Branch (833:8): [True: 4.20k, False: 4.05k]
  ------------------
  834|       |      /* the names are identical */
  835|  4.20k|      bool matching_domains = FALSE;
  ------------------
  |  | 1058|  4.20k|#define FALSE false
  ------------------
  836|       |
  837|  4.20k|      if(clist->domain && co->domain) {
  ------------------
  |  Branch (837:10): [True: 4.12k, False: 88]
  |  Branch (837:27): [True: 4.12k, False: 0]
  ------------------
  838|  4.12k|        if(curl_strequal(clist->domain, co->domain))
  ------------------
  |  Branch (838:12): [True: 4.12k, False: 0]
  ------------------
  839|       |          /* The domains are identical */
  840|  4.12k|          matching_domains = TRUE;
  ------------------
  |  | 1055|  4.12k|#define TRUE true
  ------------------
  841|  4.12k|      }
  842|     88|      else if(!clist->domain && !co->domain)
  ------------------
  |  Branch (842:15): [True: 88, False: 0]
  |  Branch (842:33): [True: 0, False: 88]
  ------------------
  843|      0|        matching_domains = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  844|       |
  845|  4.20k|      if(matching_domains && /* the domains were identical */
  ------------------
  |  Branch (845:10): [True: 4.12k, False: 88]
  ------------------
  846|  4.12k|         clist->path && co->path && /* both have paths */
  ------------------
  |  Branch (846:10): [True: 4.12k, False: 0]
  |  Branch (846:25): [True: 4.12k, False: 0]
  ------------------
  847|  4.12k|         clist->secure && !co->secure && !secure) {
  ------------------
  |  Branch (847:10): [True: 0, False: 4.12k]
  |  Branch (847:27): [True: 0, False: 0]
  |  Branch (847:42): [True: 0, False: 0]
  ------------------
  848|      0|        size_t cllen;
  849|      0|        const char *sep = NULL;
  850|       |
  851|       |        /*
  852|       |         * A non-secure cookie may not overlay an existing secure cookie.
  853|       |         * For an existing cookie "a" with path "/login", refuse a new
  854|       |         * cookie "a" with for example path "/login/en", while the path
  855|       |         * "/loginhelper" is ok.
  856|       |         */
  857|       |
  858|      0|        DEBUGASSERT(clist->path[0]);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (858:9): [True: 0, False: 0]
  |  Branch (858:9): [True: 0, False: 0]
  ------------------
  859|      0|        if(clist->path[0])
  ------------------
  |  Branch (859:12): [True: 0, False: 0]
  ------------------
  860|      0|          sep = strchr(clist->path + 1, '/');
  861|      0|        if(sep)
  ------------------
  |  Branch (861:12): [True: 0, False: 0]
  ------------------
  862|      0|          cllen = sep - clist->path;
  863|      0|        else
  864|      0|          cllen = strlen(clist->path);
  865|       |
  866|      0|        if(!strncmp(clist->path, co->path, cllen)) {
  ------------------
  |  Branch (866:12): [True: 0, False: 0]
  ------------------
  867|      0|          infof(data, "cookie '%s' for domain '%s' dropped, would "
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  868|      0|                "overlay an existing cookie", co->name, co->domain);
  869|      0|          return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  870|      0|        }
  871|      0|      }
  872|  4.20k|    }
  873|       |
  874|  8.26k|    if(!replace_n && !strcmp(clist->name, co->name)) {
  ------------------
  |  Branch (874:8): [True: 7.86k, False: 396]
  |  Branch (874:22): [True: 4.16k, False: 3.70k]
  ------------------
  875|       |      /* the names are identical */
  876|       |
  877|  4.16k|      if(clist->domain && co->domain) {
  ------------------
  |  Branch (877:10): [True: 4.07k, False: 88]
  |  Branch (877:27): [True: 4.07k, False: 0]
  ------------------
  878|  4.07k|        if(curl_strequal(clist->domain, co->domain) &&
  ------------------
  |  Branch (878:12): [True: 4.07k, False: 0]
  ------------------
  879|  4.07k|           (clist->tailmatch == co->tailmatch))
  ------------------
  |  Branch (879:12): [True: 4.07k, False: 0]
  ------------------
  880|       |          /* The domains are identical */
  881|  4.07k|          replace_old = TRUE;
  ------------------
  |  | 1055|  4.07k|#define TRUE true
  ------------------
  882|  4.07k|      }
  883|     88|      else if(!clist->domain && !co->domain)
  ------------------
  |  Branch (883:15): [True: 88, False: 0]
  |  Branch (883:33): [True: 0, False: 88]
  ------------------
  884|      0|        replace_old = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  885|       |
  886|  4.16k|      if(replace_old) {
  ------------------
  |  Branch (886:10): [True: 4.07k, False: 88]
  ------------------
  887|       |        /* the domains were identical */
  888|       |
  889|  4.07k|        if(clist->path && co->path &&
  ------------------
  |  Branch (889:12): [True: 4.07k, False: 0]
  |  Branch (889:27): [True: 4.07k, False: 0]
  ------------------
  890|  4.07k|           strcmp(clist->path, co->path))
  ------------------
  |  Branch (890:12): [True: 388, False: 3.68k]
  ------------------
  891|    388|          replace_old = FALSE;
  ------------------
  |  | 1058|    388|#define FALSE false
  ------------------
  892|  3.68k|        else if(!clist->path != !co->path)
  ------------------
  |  Branch (892:17): [True: 0, False: 3.68k]
  ------------------
  893|      0|          replace_old = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  894|  4.07k|      }
  895|       |
  896|  4.16k|      if(replace_old && !co->livecookie && clist->livecookie) {
  ------------------
  |  Branch (896:10): [True: 3.68k, False: 476]
  |  Branch (896:25): [True: 0, False: 3.68k]
  |  Branch (896:44): [True: 0, False: 0]
  ------------------
  897|       |        /*
  898|       |         * Both cookies matched fine, except that the already present cookie
  899|       |         * is "live", which means it was set from a header, while the new one
  900|       |         * was read from a file and thus is not "live". "live" cookies are
  901|       |         * preferred so the new cookie is freed.
  902|       |         */
  903|      0|        return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  904|      0|      }
  905|  4.16k|      if(replace_old)
  ------------------
  |  Branch (905:10): [True: 3.68k, False: 476]
  ------------------
  906|  3.68k|        replace_n = n;
  907|  4.16k|    }
  908|  8.26k|  }
  909|  6.60k|  if(replace_n) {
  ------------------
  |  Branch (909:6): [True: 3.68k, False: 2.92k]
  ------------------
  910|  3.68k|    struct Cookie *repl = Curl_node_elem(replace_n);
  911|       |
  912|       |    /* when replacing, creationtime is kept from old */
  913|  3.68k|    co->creationtime = repl->creationtime;
  914|       |
  915|       |    /* unlink the old */
  916|  3.68k|    Curl_node_remove(replace_n);
  917|       |
  918|       |    /* free the old cookie */
  919|  3.68k|    freecookie(repl, TRUE);
  ------------------
  |  | 1055|  3.68k|#define TRUE true
  ------------------
  920|  3.68k|  }
  921|  6.60k|  *replacep = replace_old;
  922|       |  return TRUE;
  ------------------
  |  | 1055|  6.60k|#define TRUE true
  ------------------
  923|  6.60k|}
cookie.c:cookiehash:
  212|  20.0k|{
  213|  20.0k|  const char *top;
  214|  20.0k|  size_t len;
  215|       |
  216|  20.0k|  if(!domain || Curl_host_is_ipnum(domain))
  ------------------
  |  Branch (216:6): [True: 1.82k, False: 18.2k]
  |  Branch (216:17): [True: 6.97k, False: 11.2k]
  ------------------
  217|  8.80k|    return 0;
  218|       |
  219|  11.2k|  top = get_top_domain(domain, &len);
  220|  11.2k|  return cookie_hash_domain(top, len);
  221|  20.0k|}
cookie.c:get_top_domain:
  162|  11.2k|{
  163|  11.2k|  size_t len = 0;
  164|  11.2k|  const char *first = NULL, *last;
  165|       |
  166|  11.2k|  if(domain) {
  ------------------
  |  Branch (166:6): [True: 11.2k, False: 0]
  ------------------
  167|  11.2k|    len = strlen(domain);
  168|  11.2k|    last = memrchr(domain, '.', len);
  169|  11.2k|    if(last) {
  ------------------
  |  Branch (169:8): [True: 8.53k, False: 2.69k]
  ------------------
  170|  8.53k|      first = memrchr(domain, '.', (last - domain));
  171|  8.53k|      if(first)
  ------------------
  |  Branch (171:10): [True: 269, False: 8.26k]
  ------------------
  172|    269|        len -= (++first - domain);
  173|  8.53k|    }
  174|  11.2k|  }
  175|       |
  176|  11.2k|  if(outlen)
  ------------------
  |  Branch (176:6): [True: 11.2k, False: 0]
  ------------------
  177|  11.2k|    *outlen = len;
  178|       |
  179|  11.2k|  return first ? first : domain;
  ------------------
  |  Branch (179:10): [True: 269, False: 10.9k]
  ------------------
  180|  11.2k|}
cookie.c:cookie_hash_domain:
  191|  11.2k|{
  192|  11.2k|  const char *end = domain + len;
  193|  11.2k|  size_t h = 5381;
  194|       |
  195|   100k|  while(domain < end) {
  ------------------
  |  Branch (195:9): [True: 89.7k, False: 11.2k]
  ------------------
  196|  89.7k|    size_t j = (size_t)Curl_raw_toupper(*domain++);
  197|  89.7k|    h += h << 5;
  198|  89.7k|    h ^= j;
  199|  89.7k|  }
  200|       |
  201|  11.2k|  return (h % COOKIE_HASH_SIZE);
  ------------------
  |  |   54|  11.2k|#define COOKIE_HASH_SIZE 63
  ------------------
  202|  11.2k|}
cookie.c:freecookie:
   64|  27.1k|{
   65|  27.1k|  curlx_free(co->domain);
  ------------------
  |  | 1483|  27.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   66|  27.1k|  curlx_free(co->path);
  ------------------
  |  | 1483|  27.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   67|  27.1k|  curlx_free(co->name);
  ------------------
  |  | 1483|  27.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   68|  27.1k|  curlx_free(co->value);
  ------------------
  |  | 1483|  27.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   69|  27.1k|  if(maintoo)
  ------------------
  |  Branch (69:6): [True: 6.60k, False: 20.4k]
  ------------------
   70|  6.60k|    curlx_free(co);
  ------------------
  |  | 1483|  6.60k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   71|  27.1k|}
cookie.c:cookie_load:
 1090|  14.0k|{
 1091|  14.0k|  FILE *handle = NULL;
 1092|  14.0k|  CURLcode result = CURLE_OK;
 1093|  14.0k|  FILE *fp = NULL;
 1094|  14.0k|  DEBUGASSERT(ci);
  ------------------
  |  | 1081|  14.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1094:3): [True: 0, False: 14.0k]
  |  Branch (1094:3): [True: 14.0k, False: 0]
  ------------------
 1095|  14.0k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  14.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1095:3): [True: 0, False: 14.0k]
  |  Branch (1095:3): [True: 14.0k, False: 0]
  ------------------
 1096|  14.0k|  DEBUGASSERT(file);
  ------------------
  |  | 1081|  14.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1096:3): [True: 0, False: 14.0k]
  |  Branch (1096:3): [True: 14.0k, False: 0]
  ------------------
 1097|       |
 1098|  14.0k|  ci->newsession = newsession; /* new session? */
 1099|  14.0k|  ci->running = FALSE; /* this is not running, this is init */
  ------------------
  |  | 1058|  14.0k|#define FALSE false
  ------------------
 1100|       |
 1101|  14.0k|  if(file && *file) {
  ------------------
  |  Branch (1101:6): [True: 14.0k, False: 0]
  |  Branch (1101:14): [True: 14.0k, False: 0]
  ------------------
 1102|  14.0k|    if(!strcmp(file, "-"))
  ------------------
  |  Branch (1102:8): [True: 0, False: 14.0k]
  ------------------
 1103|      0|      fp = stdin;
 1104|  14.0k|    else {
 1105|  14.0k|      fp = curlx_fopen(file, "rb");
  ------------------
  |  |   74|  14.0k|#define curlx_fopen(file, mode) curl_dbg_fopen(file, mode, __LINE__, __FILE__)
  ------------------
 1106|  14.0k|      if(!fp)
  ------------------
  |  Branch (1106:10): [True: 0, False: 14.0k]
  ------------------
 1107|      0|        infof(data, "WARNING: failed to open cookie file \"%s\"", file);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1108|  14.0k|      else {
 1109|  14.0k|        curlx_struct_stat stat;
  ------------------
  |  |   63|  14.0k|#define curlx_struct_stat       struct stat
  ------------------
 1110|  14.0k|        if((curlx_fstat(fileno(fp), &stat) != -1) && S_ISDIR(stat.st_mode)) {
  ------------------
  |  |   62|  14.0k|#define curlx_fstat             fstat
  ------------------
  |  Branch (1110:12): [True: 14.0k, False: 0]
  |  Branch (1110:54): [True: 0, False: 14.0k]
  ------------------
 1111|      0|          curlx_fclose(fp);
  ------------------
  |  |   79|      0|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
 1112|      0|          fp = NULL;
 1113|      0|          infof(data, "WARNING: cookie filename points to a directory: \"%s\"",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1114|      0|                file);
 1115|      0|        }
 1116|  14.0k|        else
 1117|  14.0k|          handle = fp;
 1118|  14.0k|      }
 1119|  14.0k|    }
 1120|  14.0k|  }
 1121|       |
 1122|  14.0k|  if(fp) {
  ------------------
  |  Branch (1122:6): [True: 14.0k, False: 0]
  ------------------
 1123|  14.0k|    struct dynbuf buf;
 1124|  14.0k|    bool eof = FALSE;
  ------------------
  |  | 1058|  14.0k|#define FALSE false
  ------------------
 1125|  14.0k|    curlx_dyn_init(&buf, MAX_COOKIE_LINE);
  ------------------
  |  |   81|  14.0k|#define MAX_COOKIE_LINE 5000
  ------------------
 1126|  14.0k|    do {
 1127|  14.0k|      result = Curl_get_line(&buf, fp, &eof);
 1128|  14.0k|      if(!result) {
  ------------------
  |  Branch (1128:10): [True: 14.0k, False: 0]
  ------------------
 1129|  14.0k|        const char *lineptr = curlx_dyn_ptr(&buf);
 1130|  14.0k|        bool headerline = FALSE;
  ------------------
  |  | 1058|  14.0k|#define FALSE false
  ------------------
 1131|  14.0k|        if(checkprefix("Set-Cookie:", lineptr)) {
  ------------------
  |  |   33|  14.0k|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1292|  14.0k|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |  |  Branch (33:27): [True: 0, False: 14.0k]
  |  |  ------------------
  ------------------
 1132|       |          /* This is a cookie line, get it! */
 1133|      0|          lineptr += 11;
 1134|      0|          headerline = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1135|      0|          curlx_str_passblanks(&lineptr);
 1136|      0|        }
 1137|       |
 1138|  14.0k|        result = Curl_cookie_add(data, ci, headerline, TRUE, lineptr, NULL,
  ------------------
  |  | 1055|  14.0k|#define TRUE true
  ------------------
 1139|  14.0k|                                 NULL, TRUE);
  ------------------
  |  | 1055|  14.0k|#define TRUE true
  ------------------
 1140|       |        /* File reading cookie failures are not propagated back to the
 1141|       |           caller because there is no way to do that */
 1142|  14.0k|      }
 1143|  14.0k|    } while(!result && !eof);
  ------------------
  |  Branch (1143:13): [True: 14.0k, False: 0]
  |  Branch (1143:24): [True: 0, False: 14.0k]
  ------------------
 1144|  14.0k|    curlx_dyn_free(&buf); /* free the line buffer */
 1145|       |
 1146|       |    /*
 1147|       |     * Remove expired cookies from the hash. We must make sure to run this
 1148|       |     * after reading the file, and not on every cookie.
 1149|       |     */
 1150|  14.0k|    remove_expired(ci);
 1151|       |
 1152|  14.0k|    if(handle)
  ------------------
  |  Branch (1152:8): [True: 14.0k, False: 0]
  ------------------
 1153|  14.0k|      curlx_fclose(handle);
  ------------------
  |  |   79|  14.0k|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
 1154|  14.0k|  }
 1155|  14.0k|  data->state.cookie_engine = TRUE;
  ------------------
  |  | 1055|  14.0k|#define TRUE true
  ------------------
 1156|  14.0k|  ci->running = TRUE; /* now, we are running */
  ------------------
  |  | 1055|  14.0k|#define TRUE true
  ------------------
 1157|       |
 1158|  14.0k|  return result;
 1159|  14.0k|}
cookie.c:pathmatch:
  107|    135|{
  108|    135|  size_t cookie_path_len;
  109|    135|  size_t uri_path_len;
  110|    135|  bool ret = FALSE;
  ------------------
  |  | 1058|    135|#define FALSE false
  ------------------
  111|       |
  112|       |  /* cookie_path must not have last '/' separator. ex: /sample */
  113|    135|  cookie_path_len = strlen(cookie_path);
  114|    135|  if(cookie_path_len == 1) {
  ------------------
  |  Branch (114:6): [True: 116, False: 19]
  ------------------
  115|       |    /* cookie_path must be '/' */
  116|    116|    return TRUE;
  ------------------
  |  | 1055|    116|#define TRUE true
  ------------------
  117|    116|  }
  118|       |
  119|       |  /* #-fragments are already cut off! */
  120|     19|  if(strlen(uri_path) == 0 || uri_path[0] != '/')
  ------------------
  |  Branch (120:6): [True: 0, False: 19]
  |  Branch (120:31): [True: 0, False: 19]
  ------------------
  121|      0|    uri_path = "/";
  122|       |
  123|       |  /*
  124|       |   * here, RFC6265 5.1.4 says
  125|       |   *  4. Output the characters of the uri-path from the first character up
  126|       |   *     to, but not including, the right-most %x2F ("/").
  127|       |   *  but URL path /hoge?fuga=xxx means /hoge/index.cgi?fuga=xxx in some site
  128|       |   *  without redirect.
  129|       |   *  Ignore this algorithm because /hoge is uri path for this case
  130|       |   *  (uri path is not /).
  131|       |   */
  132|       |
  133|     19|  uri_path_len = strlen(uri_path);
  134|       |
  135|     19|  if(uri_path_len < cookie_path_len)
  ------------------
  |  Branch (135:6): [True: 5, False: 14]
  ------------------
  136|      5|    goto pathmatched;
  137|       |
  138|       |  /* not using checkprefix() because matching should be case-sensitive */
  139|     14|  if(strncmp(cookie_path, uri_path, cookie_path_len))
  ------------------
  |  Branch (139:6): [True: 7, False: 7]
  ------------------
  140|      7|    goto pathmatched;
  141|       |
  142|       |  /* The cookie-path and the uri-path are identical. */
  143|      7|  if(cookie_path_len == uri_path_len) {
  ------------------
  |  Branch (143:6): [True: 3, False: 4]
  ------------------
  144|      3|    ret = TRUE;
  ------------------
  |  | 1055|      3|#define TRUE true
  ------------------
  145|      3|    goto pathmatched;
  146|      3|  }
  147|       |
  148|       |  /* here, cookie_path_len < uri_path_len */
  149|      4|  if(uri_path[cookie_path_len] == '/') {
  ------------------
  |  Branch (149:6): [True: 1, False: 3]
  ------------------
  150|      1|    ret = TRUE;
  ------------------
  |  | 1055|      1|#define TRUE true
  ------------------
  151|      1|    goto pathmatched;
  152|      1|  }
  153|       |
  154|     19|pathmatched:
  155|     19|  return ret;
  156|      4|}
cookie.c:cookie_sort:
 1198|    216|{
 1199|    216|  const struct Cookie *c1 = *(const struct Cookie * const *)p1;
 1200|    216|  const struct Cookie *c2 = *(const struct Cookie * const *)p2;
 1201|    216|  size_t l1, l2;
 1202|       |
 1203|       |  /* 1 - compare cookie path lengths */
 1204|    216|  l1 = c1->path ? strlen(c1->path) : 0;
  ------------------
  |  Branch (1204:8): [True: 216, False: 0]
  ------------------
 1205|    216|  l2 = c2->path ? strlen(c2->path) : 0;
  ------------------
  |  Branch (1205:8): [True: 216, False: 0]
  ------------------
 1206|       |
 1207|    216|  if(l1 != l2)
  ------------------
  |  Branch (1207:6): [True: 0, False: 216]
  ------------------
 1208|      0|    return (l2 > l1) ? 1 : -1; /* avoid size_t <=> int conversions */
  ------------------
  |  Branch (1208:12): [True: 0, False: 0]
  ------------------
 1209|       |
 1210|       |  /* 2 - compare cookie domain lengths */
 1211|    216|  l1 = c1->domain ? strlen(c1->domain) : 0;
  ------------------
  |  Branch (1211:8): [True: 216, False: 0]
  ------------------
 1212|    216|  l2 = c2->domain ? strlen(c2->domain) : 0;
  ------------------
  |  Branch (1212:8): [True: 216, False: 0]
  ------------------
 1213|       |
 1214|    216|  if(l1 != l2)
  ------------------
  |  Branch (1214:6): [True: 0, False: 216]
  ------------------
 1215|      0|    return (l2 > l1) ? 1 : -1; /* avoid size_t <=> int conversions */
  ------------------
  |  Branch (1215:12): [True: 0, False: 0]
  ------------------
 1216|       |
 1217|       |  /* 3 - compare cookie name lengths */
 1218|    216|  l1 = c1->name ? strlen(c1->name) : 0;
  ------------------
  |  Branch (1218:8): [True: 216, False: 0]
  ------------------
 1219|    216|  l2 = c2->name ? strlen(c2->name) : 0;
  ------------------
  |  Branch (1219:8): [True: 216, False: 0]
  ------------------
 1220|       |
 1221|    216|  if(l1 != l2)
  ------------------
  |  Branch (1221:6): [True: 145, False: 71]
  ------------------
 1222|    145|    return (l2 > l1) ? 1 : -1;
  ------------------
  |  Branch (1222:12): [True: 63, False: 82]
  ------------------
 1223|       |
 1224|       |  /* 4 - compare cookie creation time */
 1225|     71|  return (c2->creationtime > c1->creationtime) ? 1 : -1;
  ------------------
  |  Branch (1225:10): [True: 62, False: 9]
  ------------------
 1226|    216|}
cookie.c:get_netscape_format:
 1435|  1.42k|{
 1436|  1.42k|  return curl_maprintf(
 1437|  1.42k|    "%s"               /* httponly preamble */
 1438|  1.42k|    "%s%s\t"           /* domain */
 1439|  1.42k|    "%s\t"             /* tailmatch */
 1440|  1.42k|    "%s\t"             /* path */
 1441|  1.42k|    "%s\t"             /* secure */
 1442|  1.42k|    "%" FMT_OFF_T "\t" /* expires */
 1443|  1.42k|    "%s\t"             /* name */
 1444|  1.42k|    "%s",              /* value */
 1445|  1.42k|    co->httponly ? "#HttpOnly_" : "",
  ------------------
  |  Branch (1445:5): [True: 10, False: 1.41k]
  ------------------
 1446|       |    /*
 1447|       |     * Make sure all domains are prefixed with a dot if they allow
 1448|       |     * tailmatching. This is Mozilla-style.
 1449|       |     */
 1450|  1.42k|    (co->tailmatch && co->domain && co->domain[0] != '.') ? "." : "",
  ------------------
  |  Branch (1450:6): [True: 122, False: 1.30k]
  |  Branch (1450:23): [True: 122, False: 0]
  |  Branch (1450:37): [True: 122, False: 0]
  ------------------
 1451|  1.42k|    co->domain ? co->domain : "unknown",
  ------------------
  |  Branch (1451:5): [True: 1.42k, False: 0]
  ------------------
 1452|  1.42k|    co->tailmatch ? "TRUE" : "FALSE",
  ------------------
  |  Branch (1452:5): [True: 122, False: 1.30k]
  ------------------
 1453|  1.42k|    co->path ? co->path : "/",
  ------------------
  |  Branch (1453:5): [True: 1.42k, False: 0]
  ------------------
 1454|  1.42k|    co->secure ? "TRUE" : "FALSE",
  ------------------
  |  Branch (1454:5): [True: 123, False: 1.30k]
  ------------------
 1455|  1.42k|    co->expires,
 1456|  1.42k|    co->name,
 1457|  1.42k|    co->value ? co->value : "");
  ------------------
  |  Branch (1457:5): [True: 1.42k, False: 0]
  ------------------
 1458|  1.42k|}
cookie.c:cookie_output:
 1471|  13.8k|{
 1472|  13.8k|  FILE *out = NULL;
 1473|  13.8k|  bool use_stdout = FALSE;
  ------------------
  |  | 1058|  13.8k|#define FALSE false
  ------------------
 1474|  13.8k|  char *tempstore = NULL;
 1475|  13.8k|  CURLcode result = CURLE_OK;
 1476|       |
 1477|  13.8k|  if(!ci)
  ------------------
  |  Branch (1477:6): [True: 0, False: 13.8k]
  ------------------
 1478|       |    /* no cookie engine alive */
 1479|      0|    return CURLE_OK;
 1480|       |
 1481|       |  /* at first, remove expired cookies */
 1482|  13.8k|  remove_expired(ci);
 1483|       |
 1484|  13.8k|  if(!strcmp("-", filename)) {
  ------------------
  |  Branch (1484:6): [True: 0, False: 13.8k]
  ------------------
 1485|       |    /* use stdout */
 1486|      0|    out = stdout;
 1487|      0|    use_stdout = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1488|      0|  }
 1489|  13.8k|  else {
 1490|  13.8k|    result = Curl_fopen(data, filename, &out, &tempstore);
 1491|  13.8k|    if(result)
  ------------------
  |  Branch (1491:8): [True: 0, False: 13.8k]
  ------------------
 1492|      0|      goto error;
 1493|  13.8k|  }
 1494|       |
 1495|  13.8k|  fputs("# Netscape HTTP Cookie File\n"
 1496|  13.8k|        "# https://curl.se/docs/http-cookies.html\n"
 1497|  13.8k|        "# This file was generated by libcurl! Edit at your own risk.\n\n",
 1498|  13.8k|        out);
 1499|       |
 1500|  13.8k|  if(ci->numcookies) {
  ------------------
  |  Branch (1500:6): [True: 598, False: 13.2k]
  ------------------
 1501|    598|    unsigned int i;
 1502|    598|    size_t nvalid = 0;
 1503|    598|    struct Cookie **array;
 1504|    598|    struct Curl_llist_node *n;
 1505|       |
 1506|    598|    array = curlx_calloc(1, sizeof(struct Cookie *) * ci->numcookies);
  ------------------
  |  | 1480|    598|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1507|    598|    if(!array) {
  ------------------
  |  Branch (1507:8): [True: 0, False: 598]
  ------------------
 1508|      0|      result = CURLE_OUT_OF_MEMORY;
 1509|      0|      goto error;
 1510|      0|    }
 1511|       |
 1512|       |    /* only sort the cookies with a domain property */
 1513|  38.2k|    for(i = 0; i < COOKIE_HASH_SIZE; i++) {
  ------------------
  |  |   54|  38.2k|#define COOKIE_HASH_SIZE 63
  ------------------
  |  Branch (1513:16): [True: 37.6k, False: 598]
  ------------------
 1514|  39.1k|      for(n = Curl_llist_head(&ci->cookielist[i]); n; n = Curl_node_next(n)) {
  ------------------
  |  Branch (1514:52): [True: 1.46k, False: 37.6k]
  ------------------
 1515|  1.46k|        struct Cookie *co = Curl_node_elem(n);
 1516|  1.46k|        if(!co->domain)
  ------------------
  |  Branch (1516:12): [True: 40, False: 1.42k]
  ------------------
 1517|     40|          continue;
 1518|  1.42k|        array[nvalid++] = co;
 1519|  1.42k|      }
 1520|  37.6k|    }
 1521|       |
 1522|    598|    qsort(array, nvalid, sizeof(struct Cookie *), cookie_sort_ct);
 1523|       |
 1524|  2.02k|    for(i = 0; i < nvalid; i++) {
  ------------------
  |  Branch (1524:16): [True: 1.42k, False: 598]
  ------------------
 1525|  1.42k|      char *format_ptr = get_netscape_format(array[i]);
 1526|  1.42k|      if(!format_ptr) {
  ------------------
  |  Branch (1526:10): [True: 0, False: 1.42k]
  ------------------
 1527|      0|        curlx_free(array);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1528|      0|        result = CURLE_OUT_OF_MEMORY;
 1529|      0|        goto error;
 1530|      0|      }
 1531|  1.42k|      curl_mfprintf(out, "%s\n", format_ptr);
 1532|  1.42k|      curlx_free(format_ptr);
  ------------------
  |  | 1483|  1.42k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1533|  1.42k|    }
 1534|       |
 1535|    598|    curlx_free(array);
  ------------------
  |  | 1483|    598|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1536|    598|  }
 1537|       |
 1538|  13.8k|  if(!use_stdout) {
  ------------------
  |  Branch (1538:6): [True: 13.8k, False: 0]
  ------------------
 1539|  13.8k|    curlx_fclose(out);
  ------------------
  |  |   79|  13.8k|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
 1540|  13.8k|    out = NULL;
 1541|  13.8k|    if(tempstore && curlx_rename(tempstore, filename)) {
  ------------------
  |  |   70|      0|#define curlx_rename            rename
  ------------------
  |  Branch (1541:8): [True: 0, False: 13.8k]
  |  Branch (1541:21): [True: 0, False: 0]
  ------------------
 1542|      0|      result = CURLE_WRITE_ERROR;
 1543|      0|      goto error;
 1544|      0|    }
 1545|  13.8k|  }
 1546|       |
 1547|       |  /*
 1548|       |   * If we reach here we have successfully written a cookie file so there is
 1549|       |   * no need to inspect the error, any error case should have jumped into the
 1550|       |   * error block below.
 1551|       |   */
 1552|  13.8k|  curlx_free(tempstore);
  ------------------
  |  | 1483|  13.8k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1553|  13.8k|  return CURLE_OK;
 1554|       |
 1555|      0|error:
 1556|      0|  if(out && !use_stdout)
  ------------------
  |  Branch (1556:6): [True: 0, False: 0]
  |  Branch (1556:13): [True: 0, False: 0]
  ------------------
 1557|      0|    curlx_fclose(out);
  ------------------
  |  |   79|      0|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
 1558|      0|  if(tempstore) {
  ------------------
  |  Branch (1558:6): [True: 0, False: 0]
  ------------------
 1559|      0|    unlink(tempstore);
 1560|      0|    curlx_free(tempstore);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1561|      0|  }
 1562|      0|  return result;
 1563|  13.8k|}
cookie.c:cookie_sort_ct:
 1234|  1.62k|{
 1235|  1.62k|  const struct Cookie *c1 = *(const struct Cookie * const *)p1;
 1236|  1.62k|  const struct Cookie *c2 = *(const struct Cookie * const *)p2;
 1237|       |
 1238|  1.62k|  return (c2->creationtime > c1->creationtime) ? 1 : -1;
  ------------------
  |  Branch (1238:10): [True: 1.38k, False: 240]
  ------------------
 1239|  1.62k|}

Curl_creds_create:
   41|  20.7k|{
   42|  20.7k|  struct Curl_creds *creds = NULL;
   43|  20.7k|  size_t ulen = user ? strlen(user) : 0;
  ------------------
  |  Branch (43:17): [True: 20.2k, False: 562]
  ------------------
   44|  20.7k|  size_t plen = passwd ? strlen(passwd) : 0;
  ------------------
  |  Branch (44:17): [True: 19.1k, False: 1.65k]
  ------------------
   45|  20.7k|  size_t olen = oauth_bearer ? strlen(oauth_bearer) : 0;
  ------------------
  |  Branch (45:17): [True: 14.2k, False: 6.48k]
  ------------------
   46|  20.7k|  size_t salen = sasl_authzid ? strlen(sasl_authzid) : 0;
  ------------------
  |  Branch (46:18): [True: 14.0k, False: 6.68k]
  ------------------
   47|  20.7k|  size_t sslen = sasl_service ? strlen(sasl_service) : 0;
  ------------------
  |  Branch (47:18): [True: 14.0k, False: 6.73k]
  ------------------
   48|  20.7k|  char *s, *buf;
   49|  20.7k|  CURLcode result = CURLE_OK;
   50|       |
   51|  20.7k|  Curl_creds_unlink(pcreds);
   52|       |
   53|       |  /* Everything empty/NULL, this is the NULL credential */
   54|  20.7k|  if(!ulen && !plen && !olen && !salen && !sslen)
  ------------------
  |  Branch (54:6): [True: 10.2k, False: 10.5k]
  |  Branch (54:15): [True: 10.0k, False: 230]
  |  Branch (54:24): [True: 9.84k, False: 165]
  |  Branch (54:33): [True: 9.79k, False: 50]
  |  Branch (54:43): [True: 9.73k, False: 60]
  ------------------
   55|  9.73k|    goto out;
   56|       |
   57|  11.0k|  if((ulen > CURL_MAX_INPUT_LENGTH) ||
  ------------------
  |  |   45|  11.0k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (57:6): [True: 0, False: 11.0k]
  ------------------
   58|  11.0k|     (plen > CURL_MAX_INPUT_LENGTH) ||
  ------------------
  |  |   45|  11.0k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (58:6): [True: 0, False: 11.0k]
  ------------------
   59|  11.0k|     (olen > CURL_MAX_INPUT_LENGTH) ||
  ------------------
  |  |   45|  11.0k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (59:6): [True: 0, False: 11.0k]
  ------------------
   60|  11.0k|     (salen > CURL_MAX_INPUT_LENGTH) ||
  ------------------
  |  |   45|  11.0k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (60:6): [True: 0, False: 11.0k]
  ------------------
   61|  11.0k|     (sslen > CURL_MAX_INPUT_LENGTH)) {
  ------------------
  |  |   45|  11.0k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (61:6): [True: 0, False: 11.0k]
  ------------------
   62|      0|    result = CURLE_BAD_FUNCTION_ARGUMENT;
   63|      0|    goto out;
   64|      0|  }
   65|       |
   66|       |  /* null-terminator for user already part of struct */
   67|  11.0k|  creds = curlx_calloc(1, sizeof(*creds) +
  ------------------
  |  | 1480|  11.0k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   68|  11.0k|                       ulen + plen + 1 + olen + 1 + salen + 1 + sslen + 1);
   69|  11.0k|  if(!creds) {
  ------------------
  |  Branch (69:6): [True: 0, False: 11.0k]
  ------------------
   70|      0|    result = CURLE_OUT_OF_MEMORY;
   71|      0|    goto out;
   72|      0|  }
   73|       |
   74|  11.0k|  creds->refcount = 1;
   75|  11.0k|  creds->source = source;
   76|       |  /* Some compilers try to be too smart about our dynamic struct size */
   77|  11.0k|  buf = ((char *)creds) + offsetof(struct Curl_creds, buf);
   78|  11.0k|  creds->user = s = buf;
   79|  11.0k|  if(ulen)
  ------------------
  |  Branch (79:6): [True: 10.5k, False: 505]
  ------------------
   80|  10.5k|    memcpy(s, user, ulen + 1);
   81|  11.0k|  creds->passwd = s = buf + ulen + 1;
   82|  11.0k|  if(plen)
  ------------------
  |  Branch (82:6): [True: 6.69k, False: 4.33k]
  ------------------
   83|  6.69k|    memcpy(s, passwd, plen + 1);
   84|  11.0k|  creds->oauth_bearer = s = buf + ulen + 1 + plen + 1;
   85|  11.0k|  if(olen)
  ------------------
  |  Branch (85:6): [True: 176, False: 10.8k]
  ------------------
   86|    176|    memcpy(s, oauth_bearer, olen + 1);
   87|  11.0k|  creds->sasl_authzid = s = buf + ulen + 1 + plen + 1 + olen + 1;
   88|  11.0k|  if(salen)
  ------------------
  |  Branch (88:6): [True: 76, False: 10.9k]
  ------------------
   89|     76|    memcpy(s, sasl_authzid, salen + 1);
   90|  11.0k|  creds->sasl_service = s = buf + ulen + 1 + plen + 1 + olen + 1 + salen + 1;
   91|  11.0k|  if(sslen)
  ------------------
  |  Branch (91:6): [True: 61, False: 10.9k]
  ------------------
   92|     61|    memcpy(s, sasl_service, sslen + 1);
   93|       |
   94|  20.7k|out:
   95|  20.7k|  if(!result)
  ------------------
  |  Branch (95:6): [True: 20.7k, False: 0]
  ------------------
   96|  20.7k|    *pcreds = creds;
   97|      0|  else
   98|      0|    Curl_creds_unlink(&creds);
   99|  20.7k|  return result;
  100|  11.0k|}
Curl_creds_merge:
  107|  13.9k|{
  108|  13.9k|  struct Curl_creds *creds_out = NULL;
  109|  13.9k|  CURLcode result;
  110|       |
  111|  13.9k|  if(!user || !user[0])
  ------------------
  |  Branch (111:6): [True: 9.47k, False: 4.50k]
  |  Branch (111:15): [True: 38, False: 4.46k]
  ------------------
  112|  9.50k|    user = Curl_creds_user(creds_in);
  ------------------
  |  |   75|  9.50k|#define Curl_creds_user(c)               ((c) ? (c)->user : "")
  |  |  ------------------
  |  |  |  Branch (75:43): [True: 187, False: 9.32k]
  |  |  ------------------
  ------------------
  113|  13.9k|  if(!passwd || !passwd[0])
  ------------------
  |  Branch (113:6): [True: 12.3k, False: 1.59k]
  |  Branch (113:17): [True: 37, False: 1.55k]
  ------------------
  114|  12.4k|    passwd = Curl_creds_passwd(creds_in);
  ------------------
  |  |   76|  12.4k|#define Curl_creds_passwd(c)             ((c) ? (c)->passwd : "")
  |  |  ------------------
  |  |  |  Branch (76:43): [True: 227, False: 12.1k]
  |  |  ------------------
  ------------------
  115|  13.9k|  result = Curl_creds_create(user, passwd,
  116|  13.9k|                             Curl_creds_oauth_bearer(creds_in),
  ------------------
  |  |   77|  13.9k|#define Curl_creds_oauth_bearer(c)       ((c) ? (c)->oauth_bearer : "")
  |  |  ------------------
  |  |  |  Branch (77:43): [True: 234, False: 13.7k]
  |  |  ------------------
  ------------------
  117|  13.9k|                             Curl_creds_sasl_authzid(creds_in),
  ------------------
  |  |   78|  13.9k|#define Curl_creds_sasl_authzid(c)       ((c) ? (c)->sasl_authzid : "")
  |  |  ------------------
  |  |  |  Branch (78:43): [True: 234, False: 13.7k]
  |  |  ------------------
  ------------------
  118|  13.9k|                             Curl_creds_sasl_service(creds_in),
  ------------------
  |  |   79|  13.9k|#define Curl_creds_sasl_service(c)       ((c) ? (c)->sasl_service : "")
  |  |  ------------------
  |  |  |  Branch (79:43): [True: 234, False: 13.7k]
  |  |  ------------------
  ------------------
  119|  13.9k|                             source, &creds_out);
  120|  13.9k|  Curl_creds_link(pcreds_out, creds_out);
  121|  13.9k|  Curl_creds_unlink(&creds_out);
  122|  13.9k|  return result;
  123|  13.9k|}
Curl_creds_link:
  126|  14.5k|{
  127|  14.5k|  if(*pdest != src) {
  ------------------
  |  Branch (127:6): [True: 4.97k, False: 9.56k]
  ------------------
  128|  4.97k|    Curl_creds_unlink(pdest);
  129|  4.97k|    *pdest = src;
  130|  4.97k|    if(src) {
  ------------------
  |  Branch (130:8): [True: 4.97k, False: 0]
  ------------------
  131|  4.97k|      DEBUGASSERT(src->refcount < UINT32_MAX);
  ------------------
  |  | 1081|  4.97k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (131:7): [True: 0, False: 4.97k]
  |  Branch (131:7): [True: 4.97k, False: 0]
  ------------------
  132|  4.97k|      src->refcount++;
  133|  4.97k|    }
  134|  4.97k|  }
  135|  14.5k|}
Curl_creds_unlink:
  138|   159k|{
  139|   159k|  if(*pcreds) {
  ------------------
  |  Branch (139:6): [True: 16.0k, False: 143k]
  ------------------
  140|  16.0k|    struct Curl_creds *creds = *pcreds;
  141|       |
  142|  16.0k|    DEBUGASSERT(creds->refcount);
  ------------------
  |  | 1081|  16.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (142:5): [True: 0, False: 16.0k]
  |  Branch (142:5): [True: 16.0k, False: 0]
  ------------------
  143|  16.0k|    *pcreds = NULL;
  144|  16.0k|    if(creds->refcount)
  ------------------
  |  Branch (144:8): [True: 16.0k, False: 0]
  ------------------
  145|  16.0k|      creds->refcount--;
  146|  16.0k|    if(!creds->refcount) {
  ------------------
  |  Branch (146:8): [True: 11.0k, False: 4.97k]
  ------------------
  147|  11.0k|      curlx_free(creds);
  ------------------
  |  | 1483|  11.0k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  148|  11.0k|    }
  149|  16.0k|  }
  150|   159k|}
Curl_creds_same:
  153|    742|{
  154|    742|  return (c1 == c2) ||
  ------------------
  |  Branch (154:10): [True: 431, False: 311]
  ------------------
  155|    311|         (c1 && c2 &&
  ------------------
  |  Branch (155:11): [True: 311, False: 0]
  |  Branch (155:17): [True: 311, False: 0]
  ------------------
  156|    311|          !Curl_timestrcmp(c1->user, c2->user) &&
  ------------------
  |  Branch (156:11): [True: 311, False: 0]
  ------------------
  157|    311|          !Curl_timestrcmp(c1->passwd, c2->passwd) &&
  ------------------
  |  Branch (157:11): [True: 311, False: 0]
  ------------------
  158|    311|          !Curl_timestrcmp(c1->oauth_bearer, c2->oauth_bearer) &&
  ------------------
  |  Branch (158:11): [True: 311, False: 0]
  ------------------
  159|    311|          !Curl_timestrcmp(c1->sasl_authzid, c2->sasl_authzid) &&
  ------------------
  |  Branch (159:11): [True: 311, False: 0]
  ------------------
  160|    311|          !Curl_timestrcmp(c1->sasl_service, c2->sasl_service));
  ------------------
  |  Branch (160:11): [True: 311, False: 0]
  ------------------
  161|    742|}
Curl_creds_trace:
  166|  14.1k|{
  167|  14.1k|  if(creds) {
  ------------------
  |  Branch (167:6): [True: 4.80k, False: 9.30k]
  ------------------
  168|  4.80k|    CURL_TRC_M(data, "%s: user=%s, passwd=%s, "
  ------------------
  |  |  148|  4.80k|  do {                                   \
  |  |  149|  4.80k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  4.80k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  4.80k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  9.60k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 4.80k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4.80k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  9.60k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  4.80k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  4.80k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|  4.80k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 4.80k]
  |  |  ------------------
  ------------------
  169|  4.80k|               "sasl_authzid=%s, oauth_bearer=%s, source=%d",
  170|  4.80k|               msg,
  171|  4.80k|               Curl_creds_user(creds),
  172|  4.80k|               Curl_creds_has_passwd(creds) ? "***" : "",
  173|  4.80k|               Curl_creds_sasl_authzid(creds),
  174|  4.80k|               Curl_creds_has_oauth_bearer(creds) ? "***" : "",
  175|  4.80k|               creds->source);
  176|  4.80k|  }
  177|  9.30k|  else
  178|  9.30k|    CURL_TRC_M(data, "%s: -", msg);
  ------------------
  |  |  148|  9.30k|  do {                                   \
  |  |  149|  9.30k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  9.30k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  9.30k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  18.6k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 9.30k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 9.30k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  18.6k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  9.30k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  9.30k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  9.30k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 9.30k]
  |  |  ------------------
  ------------------
  179|  14.1k|}

Curl_cshutdn_run_once:
  113|  3.71k|{
  114|  3.71k|  DEBUGASSERT(!data->conn);
  ------------------
  |  | 1081|  3.71k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (114:3): [True: 0, False: 3.71k]
  |  Branch (114:3): [True: 3.71k, False: 0]
  ------------------
  115|  3.71k|  Curl_attach_connection(data, conn);
  116|  3.71k|  cshutdn_run_once(data, conn, done);
  117|  3.71k|  CURL_TRC_M(data, "[SHUTDOWN] shutdown, done=%d", *done);
  ------------------
  |  |  148|  3.71k|  do {                                   \
  |  |  149|  3.71k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.71k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  3.71k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  7.43k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 3.71k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 3.71k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  7.43k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  3.71k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.71k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  3.71k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.71k]
  |  |  ------------------
  ------------------
  118|  3.71k|  Curl_detach_connection(data);
  119|  3.71k|}
Curl_cshutdn_terminate:
  124|  13.7k|{
  125|  13.7k|  struct Curl_easy *admin = data;
  126|  13.7k|  bool done;
  127|       |
  128|       |  /* there must be a connection to close */
  129|  13.7k|  DEBUGASSERT(conn);
  ------------------
  |  | 1081|  13.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (129:3): [True: 0, False: 13.7k]
  |  Branch (129:3): [True: 13.7k, False: 0]
  ------------------
  130|       |  /* it must be removed from the connection pool */
  131|  13.7k|  DEBUGASSERT(!conn->bits.in_cpool);
  ------------------
  |  | 1081|  13.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (131:3): [True: 0, False: 13.7k]
  |  Branch (131:3): [True: 13.7k, False: 0]
  ------------------
  132|       |  /* the transfer must be detached from the connection */
  133|  13.7k|  DEBUGASSERT(data && !data->conn);
  ------------------
  |  | 1081|  13.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (133:3): [True: 0, False: 13.7k]
  |  Branch (133:3): [True: 0, False: 0]
  |  Branch (133:3): [True: 13.7k, False: 0]
  |  Branch (133:3): [True: 13.7k, False: 0]
  ------------------
  134|       |
  135|       |  /* If we can obtain an internal admin handle, use that to attach
  136|       |   * and terminate the connection. Some protocol will try to mess with
  137|       |   * `data` during shutdown and we do not want that with a `data` from
  138|       |   * the application. */
  139|  13.7k|  if(data->multi && data->multi->admin)
  ------------------
  |  Branch (139:6): [True: 13.7k, False: 0]
  |  Branch (139:21): [True: 13.7k, False: 0]
  ------------------
  140|  13.7k|    admin = data->multi->admin;
  141|       |
  142|  13.7k|  Curl_attach_connection(admin, conn);
  143|       |
  144|  13.7k|  cshutdn_run_conn_handler(admin, conn);
  145|  13.7k|  if(do_shutdown) {
  ------------------
  |  Branch (145:6): [True: 0, False: 13.7k]
  ------------------
  146|       |    /* Make a last attempt to shutdown handlers and filters, if
  147|       |     * not done so already. */
  148|      0|    cshutdn_run_once(admin, conn, &done);
  149|      0|  }
  150|  13.7k|  CURL_TRC_M(admin, "[SHUTDOWN] %sclosing connection #%" FMT_OFF_T,
  ------------------
  |  |  148|  13.7k|  do {                                   \
  |  |  149|  13.7k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  13.7k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  13.7k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  27.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 13.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 13.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  27.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  13.7k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  13.7k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|  13.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  151|  13.7k|             conn->bits.shutdown_filters ? "" : "force ",
  152|  13.7k|             conn->connection_id);
  153|  13.7k|  Curl_conn_close(admin, SECONDARYSOCKET);
  ------------------
  |  |  304|  13.7k|#define SECONDARYSOCKET 1
  ------------------
  154|  13.7k|  Curl_conn_close(admin, FIRSTSOCKET);
  ------------------
  |  |  303|  13.7k|#define FIRSTSOCKET     0
  ------------------
  155|  13.7k|  Curl_detach_connection(admin);
  156|       |
  157|  13.7k|  if(data->multi)
  ------------------
  |  Branch (157:6): [True: 13.7k, False: 0]
  ------------------
  158|  13.7k|    Curl_multi_ev_conn_done(data->multi, data, conn);
  159|  13.7k|  Curl_conn_free(admin, conn);
  160|       |
  161|  13.7k|  if(data->multi) {
  ------------------
  |  Branch (161:6): [True: 13.7k, False: 0]
  ------------------
  162|  13.7k|    CURL_TRC_M(data, "[SHUTDOWN] trigger multi connchanged");
  ------------------
  |  |  148|  13.7k|  do {                                   \
  |  |  149|  13.7k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  13.7k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  13.7k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  27.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 13.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 13.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  27.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  13.7k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  13.7k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  13.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
  163|  13.7k|    Curl_multi_connchanged(data->multi);
  164|  13.7k|  }
  165|  13.7k|}
Curl_cshutdn_init:
  321|  17.2k|{
  322|  17.2k|  DEBUGASSERT(multi);
  ------------------
  |  | 1081|  17.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (322:3): [True: 0, False: 17.2k]
  |  Branch (322:3): [True: 17.2k, False: 0]
  ------------------
  323|  17.2k|  cshutdn->multi = multi;
  324|  17.2k|  Curl_llist_init(&cshutdn->list, NULL);
  325|       |  cshutdn->initialized = TRUE;
  ------------------
  |  | 1055|  17.2k|#define TRUE true
  ------------------
  326|  17.2k|  return 0; /* good */
  327|  17.2k|}
Curl_cshutdn_destroy:
  331|  17.2k|{
  332|  17.2k|  if(cshutdn->initialized && data) {
  ------------------
  |  Branch (332:6): [True: 17.2k, False: 0]
  |  Branch (332:30): [True: 17.2k, False: 0]
  ------------------
  333|  17.2k|    int timeout_ms = 0;
  334|       |    /* for testing, run graceful shutdown */
  335|  17.2k|#ifdef DEBUGBUILD
  336|  17.2k|    {
  337|  17.2k|      const char *p = getenv("CURL_GRACEFUL_SHUTDOWN");
  338|  17.2k|      if(p) {
  ------------------
  |  Branch (338:10): [True: 0, False: 17.2k]
  ------------------
  339|      0|        curl_off_t l;
  340|      0|        if(!curlx_str_number(&p, &l, INT_MAX))
  ------------------
  |  Branch (340:12): [True: 0, False: 0]
  ------------------
  341|      0|          timeout_ms = (int)l;
  342|      0|      }
  343|  17.2k|    }
  344|  17.2k|#endif
  345|       |
  346|  17.2k|    CURL_TRC_M(data, "[SHUTDOWN] destroy, %zu connections, timeout=%dms",
  ------------------
  |  |  148|  17.2k|  do {                                   \
  |  |  149|  17.2k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  17.2k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  17.2k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  34.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 17.2k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 17.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  34.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  17.2k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  17.2k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  17.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 17.2k]
  |  |  ------------------
  ------------------
  347|  17.2k|               Curl_llist_count(&cshutdn->list), timeout_ms);
  348|  17.2k|    cshutdn_terminate_all(cshutdn, data, timeout_ms);
  349|  17.2k|  }
  350|       |  cshutdn->multi = NULL;
  351|  17.2k|}
Curl_cshutdn_perform:
  429|  3.51M|{
  430|  3.51M|  cshutdn_perform(cshutdn, data, sigpipe_ctx);
  431|  3.51M|}
Curl_cshutdn_setfds:
  438|  3.50M|{
  439|  3.50M|  if(Curl_llist_head(&cshutdn->list)) {
  ------------------
  |  Branch (439:6): [True: 0, False: 3.50M]
  ------------------
  440|      0|    struct Curl_llist_node *e;
  441|      0|    struct easy_pollset ps;
  442|       |
  443|      0|    Curl_pollset_init(&ps);
  444|      0|    for(e = Curl_llist_head(&cshutdn->list); e; e = Curl_node_next(e)) {
  ------------------
  |  Branch (444:46): [True: 0, False: 0]
  ------------------
  445|      0|      unsigned int i;
  446|      0|      struct connectdata *conn = Curl_node_elem(e);
  447|      0|      CURLcode result;
  448|       |
  449|      0|      Curl_pollset_reset(&ps);
  450|      0|      Curl_attach_connection(data, conn);
  451|      0|      result = Curl_conn_adjust_pollset(data, conn, &ps);
  452|      0|      Curl_detach_connection(data);
  453|       |
  454|      0|      if(result)
  ------------------
  |  Branch (454:10): [True: 0, False: 0]
  ------------------
  455|      0|        continue;
  456|       |
  457|      0|      for(i = 0; i < ps.n; i++) {
  ------------------
  |  Branch (457:18): [True: 0, False: 0]
  ------------------
  458|      0|        curl_socket_t sock = ps.sockets[i];
  459|      0|        if(!FDSET_SOCK(sock))
  ------------------
  |  |  101|      0|#define FDSET_SOCK(s) ((s) < FD_SETSIZE)
  ------------------
  |  Branch (459:12): [True: 0, False: 0]
  ------------------
  460|      0|          continue;
  461|      0|        if(ps.actions[i] & CURL_POLL_IN)
  ------------------
  |  |  283|      0|#define CURL_POLL_IN     1
  ------------------
  |  Branch (461:12): [True: 0, False: 0]
  ------------------
  462|      0|          FD_SET(sock, read_fd_set);
  463|      0|        if(ps.actions[i] & CURL_POLL_OUT)
  ------------------
  |  |  284|      0|#define CURL_POLL_OUT    2
  ------------------
  |  Branch (463:12): [True: 0, False: 0]
  ------------------
  464|      0|          FD_SET(sock, write_fd_set);
  465|      0|        if((ps.actions[i] & (CURL_POLL_OUT | CURL_POLL_IN)) &&
  ------------------
  |  |  284|      0|#define CURL_POLL_OUT    2
  ------------------
                      if((ps.actions[i] & (CURL_POLL_OUT | CURL_POLL_IN)) &&
  ------------------
  |  |  283|      0|#define CURL_POLL_IN     1
  ------------------
  |  Branch (465:12): [True: 0, False: 0]
  ------------------
  466|      0|           ((int)sock > *maxfd))
  ------------------
  |  Branch (466:12): [True: 0, False: 0]
  ------------------
  467|      0|          *maxfd = (int)sock;
  468|      0|      }
  469|      0|    }
  470|      0|    Curl_pollset_cleanup(&ps);
  471|      0|  }
  472|  3.50M|}
cshutdn.c:cshutdn_run_once:
   72|  3.71k|{
   73|  3.71k|  CURLcode r1, r2;
   74|  3.71k|  bool done1, done2;
   75|       |
   76|       |  /* We expect to be attached when called */
   77|  3.71k|  DEBUGASSERT(data->conn == conn);
  ------------------
  |  | 1081|  3.71k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (77:3): [True: 0, False: 3.71k]
  |  Branch (77:3): [True: 3.71k, False: 0]
  ------------------
   78|       |
   79|  3.71k|  if(!Curl_shutdown_started(data, FIRSTSOCKET)) {
  ------------------
  |  |  303|  3.71k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (79:6): [True: 3.71k, False: 0]
  ------------------
   80|  3.71k|    Curl_shutdown_start(data, FIRSTSOCKET, 0);
  ------------------
  |  |  303|  3.71k|#define FIRSTSOCKET     0
  ------------------
   81|  3.71k|  }
   82|       |
   83|  3.71k|  cshutdn_run_conn_handler(data, conn);
   84|       |
   85|  3.71k|  if(conn->bits.shutdown_filters) {
  ------------------
  |  Branch (85:6): [True: 0, False: 3.71k]
  ------------------
   86|      0|    *done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
   87|      0|    return;
   88|      0|  }
   89|       |
   90|  3.71k|  if(!conn->bits.connect_only && Curl_conn_is_connected(conn, FIRSTSOCKET))
  ------------------
  |  |  303|  3.71k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (90:6): [True: 3.71k, False: 0]
  |  Branch (90:34): [True: 3.71k, False: 0]
  ------------------
   91|  3.71k|    r1 = Curl_conn_shutdown(data, FIRSTSOCKET, &done1);
  ------------------
  |  |  303|  3.71k|#define FIRSTSOCKET     0
  ------------------
   92|      0|  else {
   93|      0|    r1 = CURLE_OK;
   94|      0|    done1 = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
   95|      0|  }
   96|       |
   97|  3.71k|  if(!conn->bits.connect_only && Curl_conn_is_connected(conn, SECONDARYSOCKET))
  ------------------
  |  |  304|  3.71k|#define SECONDARYSOCKET 1
  ------------------
  |  Branch (97:6): [True: 3.71k, False: 0]
  |  Branch (97:34): [True: 0, False: 3.71k]
  ------------------
   98|      0|    r2 = Curl_conn_shutdown(data, SECONDARYSOCKET, &done2);
  ------------------
  |  |  304|      0|#define SECONDARYSOCKET 1
  ------------------
   99|  3.71k|  else {
  100|  3.71k|    r2 = CURLE_OK;
  101|  3.71k|    done2 = TRUE;
  ------------------
  |  | 1055|  3.71k|#define TRUE true
  ------------------
  102|  3.71k|  }
  103|       |
  104|       |  /* we are done when any failed or both report success */
  105|  3.71k|  *done = (r1 || r2 || (done1 && done2));
  ------------------
  |  Branch (105:12): [True: 0, False: 3.71k]
  |  Branch (105:18): [True: 0, False: 3.71k]
  |  Branch (105:25): [True: 3.71k, False: 0]
  |  Branch (105:34): [True: 3.71k, False: 0]
  ------------------
  106|  3.71k|  if(*done)
  ------------------
  |  Branch (106:6): [True: 3.71k, False: 0]
  ------------------
  107|  3.71k|    conn->bits.shutdown_filters = TRUE;
  ------------------
  |  | 1055|  3.71k|#define TRUE true
  ------------------
  108|  3.71k|}
cshutdn.c:cshutdn_run_conn_handler:
   43|  17.4k|{
   44|  17.4k|  if(!conn->bits.shutdown_handler) {
  ------------------
  |  Branch (44:6): [True: 13.7k, False: 3.71k]
  ------------------
   45|       |
   46|  13.7k|    if(conn->scheme && conn->scheme->run->disconnect) {
  ------------------
  |  Branch (46:8): [True: 13.7k, False: 0]
  |  Branch (46:24): [True: 4.94k, False: 8.82k]
  ------------------
   47|       |      /* Some disconnect handlers do a blocking wait on server responses.
   48|       |       * FTP/IMAP/SMTP and SFTP are among them. When using the internal
   49|       |       * handle, set an overall short timeout so we do not hang for the
   50|       |       * default 120 seconds. */
   51|  4.94k|      if(data->state.internal) {
  ------------------
  |  Branch (51:10): [True: 4.94k, False: 0]
  ------------------
   52|  4.94k|        data->set.timeout = DEFAULT_SHUTDOWN_TIMEOUT_MS;
  ------------------
  |  |   45|  4.94k|#define DEFAULT_SHUTDOWN_TIMEOUT_MS   (2 * 1000)
  ------------------
   53|  4.94k|        Curl_pgrsTime(data, TIMER_STARTOP);
   54|  4.94k|      }
   55|       |
   56|       |      /* This is set if protocol-specific cleanups should be made */
   57|  4.94k|      DEBUGF(infof(data, "connection #%" FMT_OFF_T
  ------------------
  |  | 1067|  34.5k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 4.94k, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 4.94k]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 4.94k]
  |  |  ------------------
  ------------------
   58|  4.94k|                   ", shutdown protocol handler (aborted=%d)",
   59|  4.94k|                   conn->connection_id, conn->bits.aborted));
   60|       |      /* There are protocol handlers that block on retrieving
   61|       |       * server responses here (FTP). Set a short timeout. */
   62|  4.94k|      conn->scheme->run->disconnect(data, conn, (bool)conn->bits.aborted);
   63|  4.94k|    }
   64|       |
   65|       |    conn->bits.shutdown_handler = TRUE;
  ------------------
  |  | 1055|  13.7k|#define TRUE true
  ------------------
   66|  13.7k|  }
   67|  17.4k|}
cshutdn.c:cshutdn_terminate_all:
  269|  17.2k|{
  270|  17.2k|  struct curltime started = *Curl_pgrs_now(data);
  271|  17.2k|  struct Curl_llist_node *e;
  272|  17.2k|  struct Curl_sigpipe_ctx sigpipe_ctx;
  273|       |
  274|  17.2k|  DEBUGASSERT(cshutdn);
  ------------------
  |  | 1081|  17.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (274:3): [True: 0, False: 17.2k]
  |  Branch (274:3): [True: 17.2k, False: 0]
  ------------------
  275|  17.2k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  17.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (275:3): [True: 0, False: 17.2k]
  |  Branch (275:3): [True: 17.2k, False: 0]
  ------------------
  276|       |
  277|  17.2k|  CURL_TRC_M(data, "[SHUTDOWN] shutdown all");
  ------------------
  |  |  148|  17.2k|  do {                                   \
  |  |  149|  17.2k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  17.2k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  17.2k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  34.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 17.2k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 17.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  34.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  17.2k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  17.2k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  17.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 17.2k]
  |  |  ------------------
  ------------------
  278|  17.2k|  sigpipe_init(&sigpipe_ctx);
  279|       |
  280|  17.2k|  while(Curl_llist_head(&cshutdn->list)) {
  ------------------
  |  Branch (280:9): [True: 0, False: 17.2k]
  ------------------
  281|      0|    timediff_t spent_ms;
  282|      0|    int remain_ms;
  283|       |
  284|      0|    cshutdn_perform(cshutdn, data, &sigpipe_ctx);
  285|       |
  286|      0|    if(!Curl_llist_head(&cshutdn->list)) {
  ------------------
  |  Branch (286:8): [True: 0, False: 0]
  ------------------
  287|      0|      CURL_TRC_M(data, "[SHUTDOWN] shutdown finished cleanly");
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  288|      0|      break;
  289|      0|    }
  290|       |
  291|       |    /* wait for activity, timeout or "nothing" */
  292|      0|    spent_ms = curlx_ptimediff_ms(Curl_pgrs_now(data), &started);
  293|      0|    if(spent_ms >= (timediff_t)timeout_ms) {
  ------------------
  |  Branch (293:8): [True: 0, False: 0]
  ------------------
  294|      0|      CURL_TRC_M(data, "[SHUTDOWN] shutdown finished, %s",
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  295|      0|                 (timeout_ms > 0) ? "timeout" : "best effort done");
  296|      0|      break;
  297|      0|    }
  298|       |
  299|      0|    remain_ms = timeout_ms - (int)spent_ms;
  300|      0|    if(cshutdn_wait(cshutdn, data, remain_ms)) {
  ------------------
  |  Branch (300:8): [True: 0, False: 0]
  ------------------
  301|      0|      CURL_TRC_M(data, "[SHUTDOWN] shutdown finished, aborted");
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  302|      0|      break;
  303|      0|    }
  304|      0|  }
  305|       |
  306|       |  /* Terminate any remaining. */
  307|  17.2k|  e = Curl_llist_head(&cshutdn->list);
  308|  17.2k|  while(e) {
  ------------------
  |  Branch (308:9): [True: 0, False: 17.2k]
  ------------------
  309|      0|    struct connectdata *conn = Curl_node_elem(e);
  310|      0|    Curl_node_remove(e);
  311|      0|    Curl_cshutdn_terminate(data, conn, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  312|      0|    e = Curl_llist_head(&cshutdn->list);
  313|      0|  }
  314|  17.2k|  DEBUGASSERT(!Curl_llist_count(&cshutdn->list));
  ------------------
  |  | 1081|  17.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (314:3): [True: 0, False: 17.2k]
  |  Branch (314:3): [True: 17.2k, False: 0]
  ------------------
  315|       |
  316|  17.2k|  sigpipe_restore(&sigpipe_ctx);
  317|  17.2k|}
cshutdn.c:cshutdn_perform:
  231|  3.51M|{
  232|  3.51M|  struct Curl_llist_node *e = Curl_llist_head(&cshutdn->list);
  233|  3.51M|  struct Curl_llist_node *enext;
  234|  3.51M|  struct connectdata *conn;
  235|  3.51M|  timediff_t next_expire_ms = 0, ms;
  236|  3.51M|  bool done;
  237|       |
  238|  3.51M|  if(!e)
  ------------------
  |  Branch (238:6): [True: 3.51M, False: 0]
  ------------------
  239|  3.51M|    return;
  240|       |
  241|      0|  CURL_TRC_M(data, "[SHUTDOWN] perform on %zu connections",
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  242|      0|             Curl_llist_count(&cshutdn->list));
  243|      0|  sigpipe_apply(data, sigpipe_ctx);
  244|      0|  while(e) {
  ------------------
  |  Branch (244:9): [True: 0, False: 0]
  ------------------
  245|      0|    enext = Curl_node_next(e);
  246|      0|    conn = Curl_node_elem(e);
  247|      0|    Curl_cshutdn_run_once(data, conn, &done);
  248|      0|    if(done) {
  ------------------
  |  Branch (248:8): [True: 0, False: 0]
  ------------------
  249|      0|      Curl_node_remove(e);
  250|      0|      Curl_cshutdn_terminate(data, conn, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  251|      0|    }
  252|      0|    else {
  253|       |      /* idata has one timer list, but maybe more than one connection.
  254|       |       * Set EXPIRE_SHUTDOWN to the smallest time left for all. */
  255|      0|      ms = Curl_conn_shutdown_timeleft(data, conn);
  256|      0|      if(ms && ms < next_expire_ms)
  ------------------
  |  Branch (256:10): [True: 0, False: 0]
  |  Branch (256:16): [True: 0, False: 0]
  ------------------
  257|      0|        next_expire_ms = ms;
  258|      0|    }
  259|      0|    e = enext;
  260|      0|  }
  261|       |
  262|      0|  if(next_expire_ms)
  ------------------
  |  Branch (262:6): [True: 0, False: 0]
  ------------------
  263|      0|    Curl_expire_ex(data, next_expire_ms, EXPIRE_SHUTDOWN);
  264|      0|}

Curl_freeaddrinfo:
   72|  13.6k|{
   73|  13.6k|  struct Curl_addrinfo *vqualifier canext;
   74|  13.6k|  struct Curl_addrinfo *ca;
   75|       |
   76|  26.8k|  for(ca = cahead; ca; ca = canext) {
  ------------------
  |  Branch (76:20): [True: 13.2k, False: 13.6k]
  ------------------
   77|  13.2k|    canext = ca->ai_next;
   78|  13.2k|    curlx_free(ca);
  ------------------
  |  | 1483|  13.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   79|  13.2k|  }
   80|  13.6k|}
Curl_getaddrinfo_ex:
  100|    617|{
  101|    617|  const struct addrinfo *ai;
  102|    617|  struct addrinfo *aihead;
  103|    617|  struct Curl_addrinfo *cafirst = NULL;
  104|    617|  struct Curl_addrinfo *calast = NULL;
  105|    617|  struct Curl_addrinfo *ca;
  106|    617|  size_t ss_size;
  107|    617|  int error;
  108|       |
  109|    617|  *result = NULL; /* assume failure */
  110|       |
  111|    617|  error = CURL_GETADDRINFO(nodename, servname, hints, &aihead);
  ------------------
  |  | 1432|    617|  curl_dbg_getaddrinfo(host, serv, hint, res, __LINE__, __FILE__)
  ------------------
  112|    617|  if(error)
  ------------------
  |  Branch (112:6): [True: 598, False: 19]
  ------------------
  113|    598|    return error;
  114|       |
  115|       |  /* traverse the addrinfo list */
  116|       |
  117|     38|  for(ai = aihead; ai != NULL; ai = ai->ai_next) {
  ------------------
  |  Branch (117:20): [True: 19, False: 19]
  ------------------
  118|     19|    size_t namelen = ai->ai_canonname ? strlen(ai->ai_canonname) + 1 : 0;
  ------------------
  |  Branch (118:22): [True: 0, False: 19]
  ------------------
  119|       |    /* ignore elements with unsupported address family,
  120|       |       settle family-specific sockaddr structure size. */
  121|     19|    if(ai->ai_family == AF_INET)
  ------------------
  |  Branch (121:8): [True: 18, False: 1]
  ------------------
  122|     18|      ss_size = sizeof(struct sockaddr_in);
  123|      1|#ifdef USE_IPV6
  124|      1|    else if(ai->ai_family == AF_INET6)
  ------------------
  |  Branch (124:13): [True: 1, False: 0]
  ------------------
  125|      1|      ss_size = sizeof(struct sockaddr_in6);
  126|      0|#endif
  127|      0|    else
  128|      0|      continue;
  129|       |
  130|       |    /* ignore elements without required address info */
  131|     19|    if(!ai->ai_addr || !(ai->ai_addrlen > 0))
  ------------------
  |  Branch (131:8): [True: 0, False: 19]
  |  Branch (131:24): [True: 0, False: 19]
  ------------------
  132|      0|      continue;
  133|       |
  134|       |    /* ignore elements with bogus address size */
  135|     19|    if((size_t)ai->ai_addrlen < ss_size)
  ------------------
  |  Branch (135:8): [True: 0, False: 19]
  ------------------
  136|      0|      continue;
  137|       |
  138|     19|    ca = curlx_malloc(sizeof(struct Curl_addrinfo) + ss_size + namelen);
  ------------------
  |  | 1478|     19|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  139|     19|    if(!ca) {
  ------------------
  |  Branch (139:8): [True: 0, False: 19]
  ------------------
  140|      0|      error = EAI_MEMORY;
  141|      0|      break;
  142|      0|    }
  143|       |
  144|       |    /* copy each structure member individually, member ordering,
  145|       |       size, or padding might be different for each platform. */
  146|       |
  147|     19|    ca->ai_flags     = ai->ai_flags;
  148|     19|    ca->ai_family    = ai->ai_family;
  149|     19|    ca->ai_socktype  = ai->ai_socktype;
  150|     19|    ca->ai_protocol  = ai->ai_protocol;
  151|     19|    ca->ai_addrlen   = (curl_socklen_t)ss_size;
  152|     19|    ca->ai_addr      = NULL;
  153|     19|    ca->ai_canonname = NULL;
  154|     19|    ca->ai_next      = NULL;
  155|       |
  156|     19|    ca->ai_addr = (void *)((char *)ca + sizeof(struct Curl_addrinfo));
  157|     19|    memcpy(ca->ai_addr, ai->ai_addr, ss_size);
  158|       |
  159|     19|    if(namelen) {
  ------------------
  |  Branch (159:8): [True: 0, False: 19]
  ------------------
  160|      0|      ca->ai_canonname = (void *)((char *)ca->ai_addr + ss_size);
  161|      0|      memcpy(ca->ai_canonname, ai->ai_canonname, namelen);
  162|      0|    }
  163|       |
  164|       |    /* if the return list is empty, this becomes the first element */
  165|     19|    if(!cafirst)
  ------------------
  |  Branch (165:8): [True: 19, False: 0]
  ------------------
  166|     19|      cafirst = ca;
  167|       |
  168|       |    /* add this element last in the return list */
  169|     19|    if(calast)
  ------------------
  |  Branch (169:8): [True: 0, False: 19]
  ------------------
  170|      0|      calast->ai_next = ca;
  171|     19|    calast = ca;
  172|     19|  }
  173|       |
  174|       |  /* destroy the addrinfo list */
  175|     19|  if(aihead)
  ------------------
  |  Branch (175:6): [True: 19, False: 0]
  ------------------
  176|     19|    CURL_FREEADDRINFO(aihead);
  ------------------
  |  | 1434|     19|  curl_dbg_freeaddrinfo(data, __LINE__, __FILE__)
  ------------------
  177|       |
  178|       |  /* if we failed, also destroy the Curl_addrinfo list */
  179|     19|  if(error) {
  ------------------
  |  Branch (179:6): [True: 0, False: 19]
  ------------------
  180|      0|    Curl_freeaddrinfo(cafirst);
  181|      0|    cafirst = NULL;
  182|      0|  }
  183|     19|  else if(!cafirst) {
  ------------------
  |  Branch (183:11): [True: 0, False: 19]
  ------------------
  184|      0|#ifdef EAI_NONAME
  185|       |    /* rfc3493 conformant */
  186|      0|    error = EAI_NONAME;
  187|       |#else
  188|       |    /* rfc3493 obsoleted */
  189|       |    error = EAI_NODATA;
  190|       |#endif
  191|       |#ifdef USE_WINSOCK
  192|       |    SET_SOCKERRNO(error);
  193|       |#endif
  194|      0|  }
  195|       |
  196|     19|  *result = cafirst;
  197|       |
  198|       |  /* This is not a CURLcode */
  199|     19|  return error;
  200|    617|}
Curl_str2addr:
  410|  13.0k|{
  411|  13.0k|  struct in_addr in;
  412|  13.0k|  if(curlx_inet_pton(AF_INET, dotted, &in) > 0)
  ------------------
  |  |   43|  13.0k|  inet_pton(x, y, z)
  ------------------
  |  Branch (412:6): [True: 13.0k, False: 58]
  ------------------
  413|       |    /* This is a dotted IP address 123.123.123.123-style */
  414|  13.0k|    return ip2addr(addrp, AF_INET, &in, dotted, port);
  415|     58|#ifdef USE_IPV6
  416|     58|  {
  417|     58|    struct in6_addr in6;
  418|     58|    if(curlx_inet_pton(AF_INET6, dotted, &in6) > 0)
  ------------------
  |  |   43|     58|  inet_pton(x, y, z)
  ------------------
  |  Branch (418:8): [True: 58, False: 0]
  ------------------
  419|       |      /* This is a dotted IPv6 address ::1-style */
  420|     58|      return ip2addr(addrp, AF_INET6, &in6, dotted, port);
  421|     58|  }
  422|      0|#endif
  423|      0|  return CURLE_BAD_FUNCTION_ARGUMENT; /* bad input format */
  424|     58|}
Curl_is_ipv4addr:
  427|  29.9k|{
  428|  29.9k|  struct in_addr in;
  429|  29.9k|  return (curlx_inet_pton(AF_INET, address, &in) > 0);
  ------------------
  |  |   43|  29.9k|  inet_pton(x, y, z)
  ------------------
  430|  29.9k|}
Curl_is_ipaddr:
  433|  15.1k|{
  434|  15.1k|  if(Curl_is_ipv4addr(address))
  ------------------
  |  Branch (434:6): [True: 13.0k, False: 2.13k]
  ------------------
  435|  13.0k|    return TRUE;
  ------------------
  |  | 1055|  13.0k|#define TRUE true
  ------------------
  436|  2.13k|#ifdef USE_IPV6
  437|  2.13k|  {
  438|  2.13k|    struct in6_addr in6;
  439|  2.13k|    if(curlx_inet_pton(AF_INET6, address, &in6) > 0)
  ------------------
  |  |   43|  2.13k|  inet_pton(x, y, z)
  ------------------
  |  Branch (439:8): [True: 58, False: 2.07k]
  ------------------
  440|       |      /* This is a dotted IPv6 address ::1-style */
  441|     58|      return TRUE;
  ------------------
  |  | 1055|     58|#define TRUE true
  ------------------
  442|  2.13k|  }
  443|  2.07k|#endif
  444|  2.07k|  return FALSE;
  ------------------
  |  | 1058|  2.07k|#define FALSE false
  ------------------
  445|  2.13k|}
Curl_looks_like_ipv6:
  449|  2.08k|{
  450|  2.08k|  const char *zonep = NULL;
  451|  2.08k|  size_t i = 0, hlen = 0, zlen = 0;
  452|       |
  453|  2.08k|  if(host)
  ------------------
  |  Branch (453:6): [True: 2.08k, False: 0]
  ------------------
  454|  2.08k|    memset(host, 0, sizeof(*host));
  455|  2.08k|  if(zone)
  ------------------
  |  Branch (455:6): [True: 2.08k, False: 0]
  ------------------
  456|  2.08k|    memset(zone, 0, sizeof(*zone));
  457|       |
  458|  22.9k|  for(i = 0; i < len; ++i, ++hlen) {
  ------------------
  |  Branch (458:14): [True: 21.0k, False: 1.95k]
  ------------------
  459|  21.0k|    if(!s[i] || !(ISXDIGIT(s[i]) || (s[i] == ':') || (s[i] == '.')))
  ------------------
  |  |   39|  42.0k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   44|  42.0k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 15.4k, False: 5.57k]
  |  |  |  |  |  Branch (44:38): [True: 14.6k, False: 787]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|  27.3k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 287, False: 6.07k]
  |  |  |  |  |  Branch (27:43): [True: 264, False: 23]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|  6.10k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 195, False: 5.90k]
  |  |  |  |  |  Branch (28:43): [True: 139, False: 56]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (459:8): [True: 0, False: 21.0k]
  |  Branch (459:37): [True: 326, False: 5.63k]
  |  Branch (459:54): [True: 5.50k, False: 128]
  ------------------
  460|    128|      break;
  461|  21.0k|  }
  462|       |
  463|  2.08k|  if((i < len) && (s[i] == '%')) { /* address followed by a zone? */
  ------------------
  |  Branch (463:6): [True: 128, False: 1.95k]
  |  Branch (463:19): [True: 58, False: 70]
  ------------------
  464|     58|    i += 1;
  465|     58|    if(maybe_url_encoded && !strncmp("25", s + i, 2))
  ------------------
  |  Branch (465:8): [True: 58, False: 0]
  |  Branch (465:29): [True: 3, False: 55]
  ------------------
  466|      3|      i += 2;
  467|     58|    zonep = s + i;
  468|    804|    for(; i < len; ++i, ++zlen) {
  ------------------
  |  Branch (468:11): [True: 780, False: 24]
  ------------------
  469|       |      /* Allow unreserved characters as defined in RFC 3986 */
  470|    780|      if(!s[i] || !(ISALPHA(s[i]) || ISXDIGIT(s[i]) || (s[i] == '-') ||
  ------------------
  |  |   38|  1.56k|#define ISALPHA(x)  (ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   43|  1.56k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:22): [True: 217, False: 563]
  |  |  |  |  |  Branch (43:38): [True: 194, False: 23]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALPHA(x)  (ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   42|    586|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 236, False: 350]
  |  |  |  |  |  Branch (42:38): [True: 128, False: 108]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                    if(!s[i] || !(ISALPHA(s[i]) || ISXDIGIT(s[i]) || (s[i] == '-') ||
  ------------------
  |  |   39|  1.23k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   44|    916|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 203, False: 255]
  |  |  |  |  |  Branch (44:38): [True: 93, False: 110]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|    823|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 23, False: 342]
  |  |  |  |  |  Branch (27:43): [True: 0, False: 23]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|    365|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 108, False: 257]
  |  |  |  |  |  Branch (28:43): [True: 0, False: 108]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (470:10): [True: 0, False: 780]
  |  Branch (470:56): [True: 140, False: 225]
  ------------------
  471|    225|                    (s[i] == '.') || (s[i] == '_') || (s[i] == '~')))
  ------------------
  |  Branch (471:21): [True: 85, False: 140]
  |  Branch (471:38): [True: 85, False: 55]
  |  Branch (471:55): [True: 21, False: 34]
  ------------------
  472|     34|        break;
  473|    780|    }
  474|     58|  }
  475|       |
  476|  2.08k|  if(i != len)
  ------------------
  |  Branch (476:6): [True: 104, False: 1.98k]
  ------------------
  477|    104|    return FALSE; /* invalid chars in zone */
  ------------------
  |  | 1058|    104|#define FALSE false
  ------------------
  478|  1.98k|  if(host && hlen) {
  ------------------
  |  Branch (478:6): [True: 1.98k, False: 0]
  |  Branch (478:14): [True: 1.96k, False: 16]
  ------------------
  479|  1.96k|    host->str = s;
  480|  1.96k|    host->len = hlen;
  481|  1.96k|  }
  482|  1.98k|  if(zone && zlen) {
  ------------------
  |  Branch (482:6): [True: 1.98k, False: 0]
  |  Branch (482:14): [True: 21, False: 1.95k]
  ------------------
  483|     21|    zone->str = zonep;
  484|     21|    zone->len = zlen;
  485|     21|  }
  486|       |  return TRUE;
  ------------------
  |  | 1055|  1.98k|#define TRUE true
  ------------------
  487|  2.08k|}
Curl_unix2addr:
  497|    112|{
  498|    112|  struct Curl_addrinfo *ai;
  499|    112|  struct sockaddr_un *sa_un;
  500|    112|  size_t path_len;
  501|       |
  502|    112|  *paddr = NULL;
  503|       |
  504|       |  /* sun_path must be able to store the null-terminated path */
  505|    112|  path_len = strlen(path) + 1;
  506|    112|  if(path_len > sizeof(sa_un->sun_path))
  ------------------
  |  Branch (506:6): [True: 1, False: 111]
  ------------------
  507|      1|    return CURLE_TOO_LARGE;
  508|       |
  509|    111|  ai = curlx_calloc(1,
  ------------------
  |  | 1480|    111|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  510|    111|                    sizeof(struct Curl_addrinfo) + sizeof(struct sockaddr_un));
  511|    111|  if(!ai)
  ------------------
  |  Branch (511:6): [True: 0, False: 111]
  ------------------
  512|      0|    return CURLE_OUT_OF_MEMORY;
  513|       |
  514|    111|  ai->ai_addr = (void *)((char *)ai + sizeof(struct Curl_addrinfo));
  515|    111|  sa_un = (void *)ai->ai_addr;
  516|    111|  sa_un->sun_family = AF_UNIX;
  517|       |
  518|    111|  ai->ai_family = AF_UNIX;
  519|    111|  ai->ai_socktype = SOCK_STREAM; /* assume reliable transport for HTTP */
  520|    111|  ai->ai_addrlen = (curl_socklen_t)
  521|    111|    ((offsetof(struct sockaddr_un, sun_path) + path_len) & 0x7FFFFFFF);
  522|       |
  523|       |  /* Abstract Unix domain socket have NULL prefix instead of suffix */
  524|    111|  if(abstract)
  ------------------
  |  Branch (524:6): [True: 16, False: 95]
  ------------------
  525|     16|    memcpy(sa_un->sun_path + 1, path, path_len - 1);
  526|     95|  else
  527|     95|    memcpy(sa_un->sun_path, path, path_len); /* copy NUL byte */
  528|       |
  529|    111|  *paddr = ai;
  530|    111|  return CURLE_OK;
  531|    111|}
curl_dbg_freeaddrinfo:
  545|     19|{
  546|     19|  curl_dbg_log("ADDR %s:%d freeaddrinfo(%p)\n",
  547|     19|               source, line, (void *)freethis);
  548|       |#ifdef USE_LWIPSOCK
  549|       |  lwip_freeaddrinfo(freethis);
  550|       |#elif defined(USE_FAKE_GETADDRINFO)
  551|       |  {
  552|       |    const char *env = getenv("CURL_DNS_SERVER");
  553|       |    if(env)
  554|       |      r_freeaddrinfo(freethis);
  555|       |    else
  556|       |      /* !checksrc! disable BANNEDFUNC 1 */
  557|       |      freeaddrinfo(freethis);
  558|       |  }
  559|       |#else
  560|       |  /* !checksrc! disable BANNEDFUNC 1 */
  561|     19|  freeaddrinfo(freethis);
  562|     19|#endif
  563|     19|}
curl_dbg_getaddrinfo:
  579|    617|{
  580|       |#ifdef USE_LWIPSOCK
  581|       |  int res = lwip_getaddrinfo(hostname, service, hints, result);
  582|       |#elif defined(USE_FAKE_GETADDRINFO)
  583|       |  int res;
  584|       |  const char *env = getenv("CURL_DNS_SERVER");
  585|       |  if(env)
  586|       |    res = r_getaddrinfo(hostname, service, hints, result);
  587|       |  else
  588|       |    /* !checksrc! disable BANNEDFUNC 1 */
  589|       |    res = getaddrinfo(hostname, service, hints, result);
  590|       |#else
  591|       |  /* !checksrc! disable BANNEDFUNC 1 */
  592|    617|  int res = getaddrinfo(hostname, service, hints, result);
  593|    617|#endif
  594|    617|  if(res == 0)
  ------------------
  |  Branch (594:6): [True: 19, False: 598]
  ------------------
  595|       |    /* success */
  596|     19|    curl_dbg_log("ADDR %s:%d getaddrinfo() = %p\n", source, line,
  597|     19|                 (void *)*result);
  598|    598|  else
  599|    598|    curl_dbg_log("ADDR %s:%d getaddrinfo() failed\n", source, line);
  600|    617|  return res;
  601|    617|}
curl_addrinfo.c:ip2addr:
  344|  13.0k|{
  345|  13.0k|  struct Curl_addrinfo *ai;
  346|  13.0k|  size_t addrsize;
  347|  13.0k|  size_t namelen;
  348|  13.0k|  struct sockaddr_in *addr;
  349|  13.0k|#ifdef USE_IPV6
  350|  13.0k|  struct sockaddr_in6 *addr6;
  351|  13.0k|#endif
  352|       |
  353|  13.0k|  DEBUGASSERT(inaddr && hostname);
  ------------------
  |  | 1081|  13.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (353:3): [True: 0, False: 13.0k]
  |  Branch (353:3): [True: 0, False: 0]
  |  Branch (353:3): [True: 13.0k, False: 0]
  |  Branch (353:3): [True: 13.0k, False: 0]
  ------------------
  354|       |
  355|  13.0k|  namelen = strlen(hostname) + 1;
  356|  13.0k|  *addrp = NULL;
  357|       |
  358|  13.0k|  if(af == AF_INET)
  ------------------
  |  Branch (358:6): [True: 13.0k, False: 58]
  ------------------
  359|  13.0k|    addrsize = sizeof(struct sockaddr_in);
  360|     58|#ifdef USE_IPV6
  361|     58|  else if(af == AF_INET6)
  ------------------
  |  Branch (361:11): [True: 58, False: 0]
  ------------------
  362|     58|    addrsize = sizeof(struct sockaddr_in6);
  363|      0|#endif
  364|      0|  else
  365|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  366|       |
  367|       |  /* allocate memory to hold the struct, the address and the name */
  368|  13.0k|  ai = curlx_calloc(1, sizeof(struct Curl_addrinfo) + addrsize + namelen);
  ------------------
  |  | 1480|  13.0k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  369|  13.0k|  if(!ai)
  ------------------
  |  Branch (369:6): [True: 0, False: 13.0k]
  ------------------
  370|      0|    return CURLE_OUT_OF_MEMORY;
  371|       |  /* put the address after the struct */
  372|  13.0k|  ai->ai_addr = (void *)((char *)ai + sizeof(struct Curl_addrinfo));
  373|       |  /* then put the name after the address */
  374|  13.0k|  ai->ai_canonname = (char *)ai->ai_addr + addrsize;
  375|  13.0k|  memcpy(ai->ai_canonname, hostname, namelen);
  376|  13.0k|  ai->ai_family = af;
  377|  13.0k|  ai->ai_socktype = SOCK_STREAM;
  378|  13.0k|  ai->ai_addrlen = (curl_socklen_t)addrsize;
  379|       |  /* leave the rest of the struct filled with zero */
  380|       |
  381|  13.0k|  switch(af) {
  ------------------
  |  Branch (381:10): [True: 13.0k, False: 0]
  ------------------
  382|  13.0k|  case AF_INET:
  ------------------
  |  Branch (382:3): [True: 13.0k, False: 58]
  ------------------
  383|  13.0k|    addr = (void *)ai->ai_addr; /* storage area for this info */
  384|       |
  385|  13.0k|    memcpy(&addr->sin_addr, inaddr, sizeof(struct in_addr));
  386|  13.0k|    addr->sin_family = (CURL_SA_FAMILY_T)af;
  387|  13.0k|    addr->sin_port = htons((unsigned short)port);
  388|  13.0k|    break;
  389|       |
  390|      0|#ifdef USE_IPV6
  391|     58|  case AF_INET6:
  ------------------
  |  Branch (391:3): [True: 58, False: 13.0k]
  ------------------
  392|     58|    addr6 = (void *)ai->ai_addr; /* storage area for this info */
  393|       |
  394|     58|    memcpy(&addr6->sin6_addr, inaddr, sizeof(struct in6_addr));
  395|     58|    addr6->sin6_family = (CURL_SA_FAMILY_T)af;
  396|     58|    addr6->sin6_port = htons((unsigned short)port);
  397|     58|    break;
  398|  13.0k|#endif
  399|  13.0k|  }
  400|  13.0k|  *addrp = ai;
  401|  13.0k|  return CURLE_OK;
  402|  13.0k|}

Curl_fnmatch:
  366|    385|{
  367|    385|  (void)ptr; /* the argument is specified by the curl_fnmatch_callback
  368|       |                prototype, but not used by Curl_fnmatch() */
  369|    385|  if(!pattern || !string) {
  ------------------
  |  Branch (369:6): [True: 0, False: 385]
  |  Branch (369:18): [True: 0, False: 385]
  ------------------
  370|      0|    return CURL_FNMATCH_FAIL;
  ------------------
  |  |   28|      0|#define CURL_FNMATCH_FAIL     2
  ------------------
  371|      0|  }
  372|       |
  373|    385|  switch(fnmatch(pattern, string, 0)) {
  374|    145|  case 0:
  ------------------
  |  Branch (374:3): [True: 145, False: 240]
  ------------------
  375|    145|    return CURL_FNMATCH_MATCH;
  ------------------
  |  |   26|    145|#define CURL_FNMATCH_MATCH    0
  ------------------
  376|    240|  case FNM_NOMATCH:
  ------------------
  |  Branch (376:3): [True: 240, False: 145]
  ------------------
  377|    240|    return CURL_FNMATCH_NOMATCH;
  ------------------
  |  |   27|    240|#define CURL_FNMATCH_NOMATCH  1
  ------------------
  378|      0|  default:
  ------------------
  |  Branch (378:3): [True: 0, False: 385]
  ------------------
  379|      0|    return CURL_FNMATCH_FAIL;
  ------------------
  |  |   28|      0|#define CURL_FNMATCH_FAIL     2
  ------------------
  380|    385|  }
  381|       |  /* not reached */
  382|    385|}

Curl_fopen:
   87|  48.2k|{
   88|  48.2k|  CURLcode result = CURLE_WRITE_ERROR;
   89|  48.2k|  unsigned char randbuf[41];
   90|  48.2k|  char *tempstore = NULL;
   91|  48.2k|#ifndef _WIN32
   92|  48.2k|  curlx_struct_stat sb;
  ------------------
  |  |   63|  48.2k|#define curlx_struct_stat       struct stat
  ------------------
   93|  48.2k|#endif
   94|  48.2k|  int fd = -1;
   95|  48.2k|  char *dir = NULL;
   96|  48.2k|  *tempname = NULL;
   97|       |
   98|  48.2k|#ifndef _WIN32
   99|  48.2k|  *fh = curlx_fopen(filename, FOPEN_WRITETEXT);
  ------------------
  |  |   74|  48.2k|#define curlx_fopen(file, mode) curl_dbg_fopen(file, mode, __LINE__, __FILE__)
  ------------------
  100|  48.2k|  if(!*fh)
  ------------------
  |  Branch (100:6): [True: 0, False: 48.2k]
  ------------------
  101|      0|    goto fail;
  102|  48.2k|  if(curlx_fstat(fileno(*fh), &sb) == -1 || !S_ISREG(sb.st_mode)) {
  ------------------
  |  |   62|  48.2k|#define curlx_fstat             fstat
  ------------------
  |  Branch (102:6): [True: 0, False: 48.2k]
  |  Branch (102:45): [True: 48.2k, False: 0]
  ------------------
  103|  48.2k|    return CURLE_OK;
  104|  48.2k|  }
  105|      0|  curlx_fclose(*fh);
  ------------------
  |  |   79|      0|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
  106|      0|#ifdef HAVE_GETEUID
  107|       |  /* If the existing file is not owned by the user, do not inherit
  108|       |   * its permissions at the temp file created below. The permissions
  109|       |   * might be unsuitable for holding user private data. */
  110|      0|  if(sb.st_uid != geteuid())
  ------------------
  |  Branch (110:6): [True: 0, False: 0]
  ------------------
  111|      0|    sb.st_mode = 0;
  112|      0|#endif
  113|      0|#endif /* !_WIN32 */
  114|      0|  *fh = NULL;
  115|       |
  116|      0|  result = Curl_rand_alnum(data, randbuf, sizeof(randbuf));
  117|      0|  if(result)
  ------------------
  |  Branch (117:6): [True: 0, False: 0]
  ------------------
  118|      0|    goto fail;
  119|       |
  120|      0|  dir = dirslash(filename);
  121|      0|  if(dir) {
  ------------------
  |  Branch (121:6): [True: 0, False: 0]
  ------------------
  122|       |    /* The temp filename should not end up too long for the target file
  123|       |       system */
  124|      0|    tempstore = curl_maprintf("%s%s.tmp", dir, randbuf);
  125|      0|    curlx_free(dir);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  126|      0|  }
  127|       |
  128|      0|  if(!tempstore) {
  ------------------
  |  Branch (128:6): [True: 0, False: 0]
  ------------------
  129|      0|    result = CURLE_OUT_OF_MEMORY;
  130|      0|    goto fail;
  131|      0|  }
  132|       |
  133|      0|  result = CURLE_WRITE_ERROR;
  134|       |#ifdef _WIN32
  135|       |  fd = curlx_open(tempstore, _O_WRONLY | _O_CREAT | _O_EXCL,
  136|       |                  _S_IREAD | _S_IWRITE);
  137|       |#elif (defined(ANDROID) || defined(__ANDROID__)) && \
  138|       |  (defined(__i386__) || defined(__arm__))
  139|       |  fd = curlx_open(tempstore, O_WRONLY | O_CREAT | O_EXCL,
  140|       |                  (mode_t)(S_IRUSR | S_IWUSR | sb.st_mode));
  141|       |#else
  142|      0|  fd = curlx_open(tempstore, O_WRONLY | O_CREAT | O_EXCL,
  ------------------
  |  |   68|      0|#define curlx_open              open
  ------------------
  143|      0|                  S_IRUSR | S_IWUSR | sb.st_mode);
  144|      0|#endif
  145|      0|  if(fd == -1)
  ------------------
  |  Branch (145:6): [True: 0, False: 0]
  ------------------
  146|      0|    goto fail;
  147|       |
  148|      0|  *fh = curlx_fdopen(fd, FOPEN_WRITETEXT);
  ------------------
  |  |   78|      0|  curl_dbg_fdopen(file, mode, __LINE__, __FILE__)
  ------------------
  149|      0|  if(!*fh)
  ------------------
  |  Branch (149:6): [True: 0, False: 0]
  ------------------
  150|      0|    goto fail;
  151|       |
  152|      0|  *tempname = tempstore;
  153|      0|  return CURLE_OK;
  154|       |
  155|      0|fail:
  156|      0|  if(fd != -1) {
  ------------------
  |  Branch (156:6): [True: 0, False: 0]
  ------------------
  157|      0|    curlx_close(fd);
  ------------------
  |  |   69|      0|#define curlx_close             close
  ------------------
  158|      0|    unlink(tempstore);
  159|      0|  }
  160|       |
  161|      0|  curlx_free(tempstore);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  162|      0|  return result;
  163|      0|}

Curl_get_line:
   36|  45.3k|{
   37|  45.3k|  CURLcode result;
   38|  45.3k|  char buffer[128];
   39|  45.3k|  curlx_dyn_reset(buf);
   40|  45.3k|  while(1) {
  ------------------
  |  Branch (40:9): [True: 45.3k, Folded]
  ------------------
   41|  45.3k|    size_t rlen;
   42|  45.3k|    const char *b = fgets(buffer, sizeof(buffer), input);
   43|  45.3k|    if(!b && ferror(input))
  ------------------
  |  Branch (43:8): [True: 45.3k, False: 0]
  |  Branch (43:14): [True: 0, False: 45.3k]
  ------------------
   44|      0|      return CURLE_READ_ERROR;
   45|       |
   46|  45.3k|    *eof = feof(input);
   47|       |
   48|  45.3k|    rlen = b ? strlen(b) : 0;
  ------------------
  |  Branch (48:12): [True: 0, False: 45.3k]
  ------------------
   49|  45.3k|    if(rlen) {
  ------------------
  |  Branch (49:8): [True: 0, False: 45.3k]
  ------------------
   50|      0|      result = curlx_dyn_addn(buf, b, rlen);
   51|      0|      if(result)
  ------------------
  |  Branch (51:10): [True: 0, False: 0]
  ------------------
   52|       |        /* too long line or out of memory */
   53|      0|        return result;
   54|      0|    }
   55|       |    /* now check the full line */
   56|  45.3k|    rlen = curlx_dyn_len(buf);
   57|  45.3k|    b = curlx_dyn_ptr(buf);
   58|  45.3k|    if(rlen && (b[rlen - 1] == '\n'))
  ------------------
  |  Branch (58:8): [True: 0, False: 45.3k]
  |  Branch (58:16): [True: 0, False: 0]
  ------------------
   59|       |      /* LF at end of the line */
   60|      0|      return CURLE_OK; /* all good */
   61|  45.3k|    if(*eof)
  ------------------
  |  Branch (61:8): [True: 45.3k, False: 0]
  ------------------
   62|       |      /* append a newline */
   63|  45.3k|      return curlx_dyn_addn(buf, "\n", 1);
   64|       |    /* otherwise get next line to append */
   65|  45.3k|  }
   66|       |  /* UNREACHABLE */
   67|  45.3k|}

Curl_range:
   36|    860|{
   37|    860|  if(data->state.use_range && data->state.range) {
  ------------------
  |  Branch (37:6): [True: 264, False: 596]
  |  Branch (37:31): [True: 264, False: 0]
  ------------------
   38|    264|    curl_off_t from, to;
   39|    264|    bool first_num = TRUE;
  ------------------
  |  | 1055|    264|#define TRUE true
  ------------------
   40|    264|    const char *p = data->state.range;
   41|    264|    if(curlx_str_number(&p, &from, CURL_OFF_T_MAX))
  ------------------
  |  |  594|    264|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (41:8): [True: 164, False: 100]
  ------------------
   42|    164|      first_num = FALSE;
  ------------------
  |  | 1058|    164|#define FALSE false
  ------------------
   43|       |
   44|    264|    if(curlx_str_single(&p, '-'))
  ------------------
  |  Branch (44:8): [True: 5, False: 259]
  ------------------
   45|       |      /* no leading dash or after the first number is an error */
   46|      5|      return CURLE_RANGE_ERROR;
   47|       |
   48|    259|    if(curlx_str_number(&p, &to, CURL_OFF_T_MAX)) {
  ------------------
  |  |  594|    259|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (48:8): [True: 3, False: 256]
  ------------------
   49|       |      /* no second number */
   50|       |      /* X - */
   51|      3|      data->state.resume_from = from;
   52|      3|      DEBUGF(infof(data, "RANGE %" FMT_OFF_T " to end of file", from));
  ------------------
  |  | 1067|     21|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 3, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 3]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 3]
  |  |  ------------------
  ------------------
   53|      3|    }
   54|    256|    else if(!first_num) {
  ------------------
  |  Branch (54:13): [True: 159, False: 97]
  ------------------
   55|       |      /* -Y */
   56|    159|      if(!to)
  ------------------
  |  Branch (56:10): [True: 1, False: 158]
  ------------------
   57|       |        /* "-0" is wrong */
   58|      1|        return CURLE_RANGE_ERROR;
   59|       |
   60|    158|      data->req.maxdownload = to;
   61|    158|      data->state.resume_from = -to;
   62|    158|      DEBUGF(infof(data, "RANGE the last %" FMT_OFF_T " bytes", to));
  ------------------
  |  | 1067|  1.10k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 158, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 158]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 158]
  |  |  ------------------
  ------------------
   63|    158|    }
   64|     97|    else {
   65|       |      /* X-Y */
   66|     97|      curl_off_t totalsize;
   67|       |
   68|       |      /* Ensure the range is sensible - to should follow from. */
   69|     97|      if(from > to)
  ------------------
  |  Branch (69:10): [True: 6, False: 91]
  ------------------
   70|      6|        return CURLE_RANGE_ERROR;
   71|       |
   72|     91|      totalsize = to - from;
   73|     91|      if(totalsize == CURL_OFF_T_MAX)
  ------------------
  |  |  594|     91|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (73:10): [True: 1, False: 90]
  ------------------
   74|      1|        return CURLE_RANGE_ERROR;
   75|       |
   76|     90|      data->req.maxdownload = totalsize + 1; /* include last byte */
   77|     90|      data->state.resume_from = from;
   78|     90|      DEBUGF(infof(data, "RANGE from %" FMT_OFF_T
  ------------------
  |  | 1067|    630|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 90, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 90]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 90]
  |  |  ------------------
  ------------------
   79|     90|                   " getting %" FMT_OFF_T " bytes",
   80|     90|                   from, data->req.maxdownload));
   81|     90|    }
   82|    251|    DEBUGF(infof(data, "range-download from %" FMT_OFF_T
  ------------------
  |  | 1067|  1.75k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 251, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 251]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 251]
  |  |  ------------------
  ------------------
   83|    251|                 " to %" FMT_OFF_T ", totally %" FMT_OFF_T " bytes",
   84|    251|                 from, to, data->req.maxdownload));
   85|    251|  }
   86|    596|  else
   87|    596|    data->req.maxdownload = -1;
   88|    847|  return CURLE_OK;
   89|    860|}

Curl_share_lock:
  373|  99.5k|{
  374|  99.5k|  struct Curl_share *share = data->share;
  375|       |
  376|  99.5k|  if(!share)
  ------------------
  |  Branch (376:6): [True: 99.5k, False: 0]
  ------------------
  377|  99.5k|    return CURLSHE_INVALID;
  378|       |
  379|      0|  if(share->specifier & (unsigned int)(1 << type)) {
  ------------------
  |  Branch (379:6): [True: 0, False: 0]
  ------------------
  380|      0|    if(share->lockfunc) /* only call this if set! */
  ------------------
  |  Branch (380:8): [True: 0, False: 0]
  ------------------
  381|      0|      share->lockfunc(data, type, accesstype, share->clientdata);
  382|      0|  }
  383|       |  /* else if we do not share this, pretend successful lock */
  384|       |
  385|      0|  return CURLSHE_OK;
  386|  99.5k|}
Curl_share_unlock:
  389|  99.5k|{
  390|  99.5k|  struct Curl_share *share = data->share;
  391|       |
  392|  99.5k|  if(!share)
  ------------------
  |  Branch (392:6): [True: 99.5k, False: 0]
  ------------------
  393|  99.5k|    return CURLSHE_INVALID;
  394|       |
  395|      0|  if(share->specifier & (unsigned int)(1 << type)) {
  ------------------
  |  Branch (395:6): [True: 0, False: 0]
  ------------------
  396|      0|    if(share->unlockfunc) /* only call this if set! */
  ------------------
  |  Branch (396:8): [True: 0, False: 0]
  ------------------
  397|      0|      share->unlockfunc(data, type, share->clientdata);
  398|      0|  }
  399|       |
  400|      0|  return CURLSHE_OK;
  401|  99.5k|}
Curl_share_easy_unlink:
  404|  37.2k|{
  405|  37.2k|  struct Curl_share *share = data->share;
  406|       |
  407|  37.2k|  if(share) {
  ------------------
  |  Branch (407:6): [True: 0, False: 37.2k]
  ------------------
  408|      0|    bool locked = share_lock_acquire(share, data);
  409|       |
  410|       |    /* If data has a connection from this share, detach it. */
  411|      0|    if(data->conn && (share->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  ------------------
  |  Branch (411:8): [True: 0, False: 0]
  |  Branch (411:22): [True: 0, False: 0]
  ------------------
  412|      0|      Curl_detach_connection(data);
  413|       |
  414|      0|#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
  415|      0|    if(share->cookies == data->cookies)
  ------------------
  |  Branch (415:8): [True: 0, False: 0]
  ------------------
  416|      0|      data->cookies = NULL;
  417|      0|#endif
  418|       |
  419|      0|#ifndef CURL_DISABLE_HSTS
  420|      0|    if(share->hsts == data->hsts)
  ------------------
  |  Branch (420:8): [True: 0, False: 0]
  ------------------
  421|      0|      data->hsts = NULL;
  422|      0|#endif
  423|       |#ifdef USE_LIBPSL
  424|       |    if(&share->psl == data->psl)
  425|       |      data->psl = data->multi ? &data->multi->psl : NULL;
  426|       |#endif
  427|       |
  428|      0|    share_unlink(&data->share, data, locked);
  429|      0|  }
  430|  37.2k|  return CURLE_OK;
  431|  37.2k|}

Curl_thread_create:
   52|    614|{
   53|    614|  curl_thread_t t = curlx_malloc(sizeof(pthread_t));
  ------------------
  |  |   33|    614|#  define curl_thread_t          pthread_t *
  ------------------
                curl_thread_t t = curlx_malloc(sizeof(pthread_t));
  ------------------
  |  | 1478|    614|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
   54|    614|  struct Curl_actual_call *ac = NULL;
   55|    614|  int rc;
   56|       |
   57|    614|  if(t)
  ------------------
  |  Branch (57:6): [True: 614, False: 0]
  ------------------
   58|    614|    ac = curlx_malloc(sizeof(struct Curl_actual_call));
  ------------------
  |  | 1478|    614|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
   59|    614|  if(!(ac && t))
  ------------------
  |  Branch (59:8): [True: 614, False: 0]
  |  Branch (59:14): [True: 614, False: 0]
  ------------------
   60|      0|    goto err;
   61|       |
   62|    614|  ac->func = func;
   63|    614|  ac->arg = arg;
   64|       |
   65|    614|  rc = pthread_create(t, NULL, curl_thread_create_thunk, ac);
   66|    614|  if(rc) {
  ------------------
  |  Branch (66:6): [True: 0, False: 614]
  ------------------
   67|      0|    errno = rc;
   68|      0|    goto err;
   69|      0|  }
   70|       |
   71|    614|  return t;
   72|       |
   73|      0|err:
   74|      0|  curlx_free(t);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   75|      0|  curlx_free(ac);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   76|      0|  return curl_thread_t_null;
  ------------------
  |  |   34|      0|#  define curl_thread_t_null     (pthread_t *)0
  ------------------
   77|    614|}
Curl_thread_join:
   89|    614|{
   90|    614|  int ret = (pthread_join(**hnd, NULL) == 0);
   91|       |
   92|    614|  curlx_free(*hnd);
  ------------------
  |  | 1483|    614|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   93|    614|  *hnd = curl_thread_t_null;
  ------------------
  |  |   34|    614|#  define curl_thread_t_null     (pthread_t *)0
  ------------------
   94|       |
   95|    614|  return ret;
   96|    614|}
Curl_cond_signal:
  142|  1.86k|{
  143|       |  /* return code defined as always 0 */
  144|  1.86k|  (void)pthread_cond_signal(c);
  145|  1.86k|}
Curl_cond_wait:
  148|    523|{
  149|       |  /* return code defined as always 0 */
  150|    523|  (void)pthread_cond_wait(c, m);
  151|    523|}
Curl_cond_timedwait:
  155|    456|{
  156|    456|  struct curltime now;
  157|    456|  struct timespec ts;
  158|    456|  timediff_t usec;
  159|    456|  int rc;
  160|       |
  161|       |  /* POSIX expects an "absolute" time until the condition wait ends.
  162|       |   * We cannot use `curlx_now()` here that may run on some monotonic clock
  163|       |   * that will be most likely in the past, as far as POSIX abstime is
  164|       |   * concerned. */
  165|    456|#ifdef HAVE_GETTIMEOFDAY
  166|    456|  struct timeval tv;
  167|    456|  (void)gettimeofday(&tv, NULL);
  168|    456|  now.tv_sec = tv.tv_sec;
  169|    456|  now.tv_usec = (int)tv.tv_usec;
  170|       |#else
  171|       |  now.tv_sec = time(NULL);
  172|       |  now.tv_usec = 0;
  173|       |#endif
  174|       |
  175|    456|  ts.tv_sec = now.tv_sec + (timeout_ms / 1000);
  176|    456|  usec = now.tv_usec + ((timeout_ms % 1000) * 1000);
  177|    456|  if(usec >= 1000000) {
  ------------------
  |  Branch (177:6): [True: 0, False: 456]
  ------------------
  178|      0|    ++ts.tv_sec;
  179|      0|    usec %= 1000000;
  180|      0|  }
  181|    456|  ts.tv_nsec = (long)usec * 1000;
  182|       |
  183|    456|  rc = pthread_cond_timedwait(c, m, &ts);
  184|    456|  if(rc == SOCKETIMEDOUT)
  ------------------
  |  | 1135|    456|#define SOCKETIMEDOUT     ETIMEDOUT
  ------------------
  |  Branch (184:6): [True: 0, False: 456]
  ------------------
  185|      0|    return CURLE_OPERATION_TIMEDOUT;
  186|    456|  return rc ? CURLE_UNRECOVERABLE_POLL : CURLE_OK;
  ------------------
  |  Branch (186:10): [True: 0, False: 456]
  ------------------
  187|    456|}
curl_threads.c:curl_thread_create_thunk:
   38|    612|{
   39|    612|  struct Curl_actual_call *ac = arg;
   40|    612|  unsigned int (*func)(void *) = ac->func;
   41|    612|  void *real_arg = ac->arg;
   42|       |
   43|    612|  curlx_free(ac);
  ------------------
  |  | 1483|    612|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   44|       |
   45|    612|  (*func)(real_arg);
   46|       |
   47|    612|  return 0;
   48|    612|}

Curl_debug:
  129|   961k|{
  130|   961k|  if(data->set.verbose) {
  ------------------
  |  Branch (130:6): [True: 0, False: 961k]
  ------------------
  131|      0|    static const char s_infotype[CURLINFO_END][3] = {
  132|      0|      "* ", "< ", "> ", "{ ", "} ", "{ ", "} " };
  133|      0|    char buf[TRC_LINE_MAX];
  134|      0|    size_t len;
  135|      0|    if(data->set.fdebug) {
  ------------------
  |  Branch (135:8): [True: 0, False: 0]
  ------------------
  136|      0|      bool inCallback = Curl_is_in_callback(data);
  137|       |
  138|      0|      if(CURL_TRC_IDS(data) && (size < TRC_LINE_MAX)) {
  ------------------
  |  |   90|      0|  (Curl_trc_is_verbose(data) && \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   91|      0|  Curl_trc_feat_ids.log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (91:3): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                    if(CURL_TRC_IDS(data) && (size < TRC_LINE_MAX)) {
  ------------------
  |  |   78|      0|#define TRC_LINE_MAX 2048
  ------------------
  |  Branch (138:32): [True: 0, False: 0]
  ------------------
  139|      0|        len = trc_print_ids(data, buf, TRC_LINE_MAX);
  ------------------
  |  |   78|      0|#define TRC_LINE_MAX 2048
  ------------------
  140|      0|        len += curl_msnprintf(buf + len, TRC_LINE_MAX - len, "%.*s",
  ------------------
  |  |   78|      0|#define TRC_LINE_MAX 2048
  ------------------
  141|      0|                              (int)size, ptr);
  142|      0|        len = trc_end_buf(buf, len, TRC_LINE_MAX, FALSE);
  ------------------
  |  |   78|      0|#define TRC_LINE_MAX 2048
  ------------------
                      len = trc_end_buf(buf, len, TRC_LINE_MAX, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  143|      0|        Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  144|      0|        (void)(*data->set.fdebug)(data, type, buf, len, data->set.debugdata);
  145|      0|        Curl_set_in_callback(data, inCallback);
  146|      0|      }
  147|      0|      else {
  148|      0|        Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  149|      0|        (void)(*data->set.fdebug)(data, type, CURL_UNCONST(ptr),
  ------------------
  |  |  866|      0|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  150|      0|                                  size, data->set.debugdata);
  151|      0|        Curl_set_in_callback(data, inCallback);
  152|      0|      }
  153|      0|    }
  154|      0|    else {
  155|      0|      switch(type) {
  156|      0|      case CURLINFO_TEXT:
  ------------------
  |  Branch (156:7): [True: 0, False: 0]
  ------------------
  157|      0|      case CURLINFO_HEADER_OUT:
  ------------------
  |  Branch (157:7): [True: 0, False: 0]
  ------------------
  158|      0|      case CURLINFO_HEADER_IN:
  ------------------
  |  Branch (158:7): [True: 0, False: 0]
  ------------------
  159|      0|#ifndef CURL_DISABLE_VERBOSE_STRINGS
  160|      0|        if(CURL_TRC_IDS(data)) {
  ------------------
  |  |   90|      0|  (Curl_trc_is_verbose(data) && \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   91|      0|  Curl_trc_feat_ids.log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (91:3): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  161|      0|          len = trc_print_ids(data, buf, TRC_LINE_MAX);
  ------------------
  |  |   78|      0|#define TRC_LINE_MAX 2048
  ------------------
  162|      0|          fwrite(buf, len, 1, data->set.err);
  163|      0|        }
  164|      0|#endif
  165|      0|        fwrite(s_infotype[type], 2, 1, data->set.err);
  166|      0|        fwrite(ptr, size, 1, data->set.err);
  167|      0|        break;
  168|      0|      default: /* nada */
  ------------------
  |  Branch (168:7): [True: 0, False: 0]
  ------------------
  169|      0|        break;
  170|      0|      }
  171|      0|    }
  172|      0|  }
  173|   961k|}
Curl_failf:
  179|  31.1k|{
  180|  31.1k|  DEBUGASSERT(!strchr(fmt, '\n'));
  ------------------
  |  | 1081|  31.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (180:3): [True: 0, False: 31.1k]
  |  Branch (180:3): [True: 31.1k, False: 0]
  ------------------
  181|  31.1k|  if(data->set.verbose || data->set.errorbuffer) {
  ------------------
  |  Branch (181:6): [True: 0, False: 31.1k]
  |  Branch (181:27): [True: 0, False: 31.1k]
  ------------------
  182|      0|    va_list ap;
  183|      0|    size_t len;
  184|      0|    char error[CURL_ERROR_SIZE + 2];
  185|      0|    va_start(ap, fmt);
  186|      0|    len = curl_mvsnprintf(error, CURL_ERROR_SIZE, fmt, ap);
  ------------------
  |  |  867|      0|#define CURL_ERROR_SIZE 256
  ------------------
  187|       |
  188|      0|    if(data->set.errorbuffer && !data->state.errorbuf) {
  ------------------
  |  Branch (188:8): [True: 0, False: 0]
  |  Branch (188:33): [True: 0, False: 0]
  ------------------
  189|      0|      curlx_strcopy(data->set.errorbuffer, CURL_ERROR_SIZE, error, len);
  ------------------
  |  |  867|      0|#define CURL_ERROR_SIZE 256
  ------------------
  190|      0|      data->state.errorbuf = TRUE; /* wrote error string */
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  191|      0|    }
  192|      0|    error[len++] = '\n';
  193|      0|    error[len] = '\0';
  194|      0|    trc_write(data, CURLINFO_TEXT, error, len);
  195|       |    va_end(ap);
  196|      0|  }
  197|  31.1k|}
Curl_reset_fail:
  200|   163k|{
  201|   163k|  if(data->set.errorbuffer)
  ------------------
  |  Branch (201:6): [True: 0, False: 163k]
  ------------------
  202|      0|    data->set.errorbuffer[0] = 0;
  203|       |  data->state.errorbuf = FALSE;
  ------------------
  |  | 1058|   163k|#define FALSE false
  ------------------
  204|   163k|}
Curl_trc_opt:
  667|      1|{
  668|      1|  CURLcode result = config ? trc_opt(config) : CURLE_OK;
  ------------------
  |  Branch (668:21): [True: 0, False: 1]
  ------------------
  669|      1|#ifdef DEBUGBUILD
  670|       |  /* CURL_DEBUG can override anything */
  671|      1|  if(!result) {
  ------------------
  |  Branch (671:6): [True: 1, False: 0]
  ------------------
  672|      1|    const char *dbg_config = getenv("CURL_DEBUG");
  673|      1|    if(dbg_config)
  ------------------
  |  Branch (673:8): [True: 0, False: 1]
  ------------------
  674|      0|      result = trc_opt(dbg_config);
  675|      1|  }
  676|      1|#endif /* DEBUGBUILD */
  677|      1|  return result;
  678|      1|}
Curl_trc_init:
  681|      1|{
  682|      1|#ifdef DEBUGBUILD
  683|      1|  return Curl_trc_opt(NULL);
  684|       |#else
  685|       |  return CURLE_OK;
  686|       |#endif
  687|      1|}

curlx_base64_encode:
  243|  7.45k|{
  244|  7.45k|  return base64_encode(curlx_base64encdec, '=',
  245|  7.45k|                       inputbuff, insize, outptr, outlen);
  246|  7.45k|}
curlx_base64url_encode:
  265|     29|{
  266|     29|  return base64_encode(base64url, 0, inputbuff, insize, outptr, outlen);
  267|     29|}
base64.c:base64_encode:
  169|  7.48k|{
  170|  7.48k|  char *output;
  171|  7.48k|  char *base64data;
  172|  7.48k|  const unsigned char *in = (const unsigned char *)inputbuff;
  173|       |
  174|  7.48k|  *outptr = NULL;
  175|  7.48k|  *outlen = 0;
  176|       |
  177|  7.48k|  if(!insize)
  ------------------
  |  Branch (177:6): [True: 0, False: 7.48k]
  ------------------
  178|      0|    return CURLE_OK;
  179|       |
  180|       |  /* safety precaution */
  181|  7.48k|  DEBUGASSERT(insize <= CURL_MAX_BASE64_INPUT);
  ------------------
  |  | 1081|  7.48k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (181:3): [True: 0, False: 7.48k]
  |  Branch (181:3): [True: 7.48k, False: 0]
  ------------------
  182|  7.48k|  if(insize > CURL_MAX_BASE64_INPUT)
  ------------------
  |  |   38|  7.48k|#define CURL_MAX_BASE64_INPUT 16000000
  ------------------
  |  Branch (182:6): [True: 0, False: 7.48k]
  ------------------
  183|      0|    return CURLE_TOO_LARGE;
  184|       |
  185|  7.48k|  base64data = output = curlx_malloc(((insize + 2) / 3 * 4) + 1);
  ------------------
  |  | 1478|  7.48k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  186|  7.48k|  if(!output)
  ------------------
  |  Branch (186:6): [True: 0, False: 7.48k]
  ------------------
  187|      0|    return CURLE_OUT_OF_MEMORY;
  188|       |
  189|   397k|  while(insize >= 3) {
  ------------------
  |  Branch (189:9): [True: 389k, False: 7.48k]
  ------------------
  190|   389k|    *output++ = table64[in[0] >> 2];
  191|   389k|    *output++ = table64[((in[0] & 0x03) << 4) | (in[1] >> 4)];
  192|   389k|    *output++ = table64[((in[1] & 0x0F) << 2) | ((in[2] & 0xC0) >> 6)];
  193|   389k|    *output++ = table64[in[2] & 0x3F];
  194|   389k|    insize -= 3;
  195|   389k|    in += 3;
  196|   389k|  }
  197|  7.48k|  if(insize) {
  ------------------
  |  Branch (197:6): [True: 4.09k, False: 3.39k]
  ------------------
  198|       |    /* this is only one or two bytes now */
  199|  4.09k|    *output++ = table64[in[0] >> 2];
  200|  4.09k|    if(insize == 1) {
  ------------------
  |  Branch (200:8): [True: 1.42k, False: 2.67k]
  ------------------
  201|  1.42k|      *output++ = table64[((in[0] & 0x03) << 4)];
  202|  1.42k|      if(padbyte) {
  ------------------
  |  Branch (202:10): [True: 1.42k, False: 0]
  ------------------
  203|  1.42k|        *output++ = padbyte;
  204|  1.42k|        *output++ = padbyte;
  205|  1.42k|      }
  206|  1.42k|    }
  207|  2.67k|    else {
  208|       |      /* insize == 2 */
  209|  2.67k|      *output++ = table64[((in[0] & 0x03) << 4) | ((in[1] & 0xF0) >> 4)];
  210|  2.67k|      *output++ = table64[((in[1] & 0x0F) << 2)];
  211|  2.67k|      if(padbyte)
  ------------------
  |  Branch (211:10): [True: 2.67k, False: 0]
  ------------------
  212|  2.67k|        *output++ = padbyte;
  213|  2.67k|    }
  214|  4.09k|  }
  215|       |
  216|       |  /* Null-terminate */
  217|  7.48k|  *output = '\0';
  218|       |
  219|       |  /* Return the pointer to the new data (allocated memory) */
  220|  7.48k|  *outptr = base64data;
  221|       |
  222|       |  /* Return the length of the new data */
  223|  7.48k|  *outlen = (size_t)(output - base64data);
  224|       |
  225|  7.48k|  return CURLE_OK;
  226|  7.48k|}

curlx_dyn_init:
   39|   452k|{
   40|   452k|  DEBUGASSERT(s);
  ------------------
  |  | 1081|   452k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (40:3): [True: 0, False: 452k]
  |  Branch (40:3): [True: 452k, False: 0]
  ------------------
   41|   452k|  DEBUGASSERT(toobig);
  ------------------
  |  | 1081|   452k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (41:3): [True: 0, False: 452k]
  |  Branch (41:3): [True: 452k, False: 0]
  ------------------
   42|   452k|  DEBUGASSERT(toobig <= MAX_DYNBUF_SIZE); /* catch crazy mistakes */
  ------------------
  |  | 1081|   452k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (42:3): [True: 0, False: 452k]
  |  Branch (42:3): [True: 452k, False: 0]
  ------------------
   43|   452k|  s->bufr = NULL;
   44|   452k|  s->leng = 0;
   45|   452k|  s->allc = 0;
   46|   452k|  s->toobig = toobig;
   47|   452k|#ifdef DEBUGBUILD
   48|   452k|  s->init = DYNINIT;
  ------------------
  |  |   32|   452k|#define DYNINIT 0xbee51da /* random pattern */
  ------------------
   49|   452k|#endif
   50|   452k|}
curlx_dyn_free:
   57|   213k|{
   58|   213k|  DEBUGASSERT(s);
  ------------------
  |  | 1081|   213k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (58:3): [True: 0, False: 213k]
  |  Branch (58:3): [True: 213k, False: 0]
  ------------------
   59|   213k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1081|   213k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (59:3): [True: 0, False: 213k]
  |  Branch (59:3): [True: 213k, False: 0]
  ------------------
   60|   213k|  curlx_safefree(s->bufr);
  ------------------
  |  | 1327|   213k|  do {                      \
  |  | 1328|   213k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|   213k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|   213k|    (ptr) = NULL;           \
  |  | 1330|   213k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 213k]
  |  |  ------------------
  ------------------
   61|   213k|  s->leng = s->allc = 0;
   62|   213k|}
curlx_dyn_reset:
  126|   377k|{
  127|   377k|  DEBUGASSERT(s);
  ------------------
  |  | 1081|   377k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (127:3): [True: 0, False: 377k]
  |  Branch (127:3): [True: 377k, False: 0]
  ------------------
  128|   377k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1081|   377k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (128:3): [True: 0, False: 377k]
  |  Branch (128:3): [True: 377k, False: 0]
  ------------------
  129|   377k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1081|   377k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (129:3): [True: 377k, False: 0]
  |  Branch (129:3): [True: 0, False: 0]
  |  Branch (129:3): [True: 240k, False: 136k]
  |  Branch (129:3): [True: 136k, False: 0]
  ------------------
  130|   377k|  if(s->leng)
  ------------------
  |  Branch (130:6): [True: 136k, False: 240k]
  ------------------
  131|   136k|    s->bufr[0] = 0;
  132|   377k|  s->leng = 0;
  133|   377k|}
curlx_dyn_tail:
  140|   832k|{
  141|   832k|  DEBUGASSERT(s);
  ------------------
  |  | 1081|   832k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (141:3): [True: 0, False: 832k]
  |  Branch (141:3): [True: 832k, False: 0]
  ------------------
  142|   832k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1081|   832k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (142:3): [True: 0, False: 832k]
  |  Branch (142:3): [True: 832k, False: 0]
  ------------------
  143|   832k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1081|   832k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (143:3): [True: 832k, False: 0]
  |  Branch (143:3): [True: 0, False: 0]
  |  Branch (143:3): [True: 0, False: 832k]
  |  Branch (143:3): [True: 832k, False: 0]
  ------------------
  144|   832k|  if(trail > s->leng)
  ------------------
  |  Branch (144:6): [True: 0, False: 832k]
  ------------------
  145|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  146|   832k|  else if(trail == s->leng)
  ------------------
  |  Branch (146:11): [True: 0, False: 832k]
  ------------------
  147|      0|    return CURLE_OK;
  148|   832k|  else if(!trail) {
  ------------------
  |  Branch (148:11): [True: 1.69k, False: 830k]
  ------------------
  149|  1.69k|    curlx_dyn_reset(s);
  150|  1.69k|  }
  151|   830k|  else {
  152|   830k|    memmove(&s->bufr[0], &s->bufr[s->leng - trail], trail);
  153|   830k|    s->leng = trail;
  154|   830k|    s->bufr[s->leng] = 0;
  155|   830k|  }
  156|   832k|  return CURLE_OK;
  157|   832k|}
curlx_dyn_addn:
  163|  34.0M|{
  164|  34.0M|  DEBUGASSERT(s);
  ------------------
  |  | 1081|  34.0M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (164:3): [True: 0, False: 34.0M]
  |  Branch (164:3): [True: 34.0M, False: 0]
  ------------------
  165|  34.0M|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1081|  34.0M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (165:3): [True: 0, False: 34.0M]
  |  Branch (165:3): [True: 34.0M, False: 0]
  ------------------
  166|  34.0M|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1081|  34.0M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (166:3): [True: 34.0M, False: 0]
  |  Branch (166:3): [True: 0, False: 0]
  |  Branch (166:3): [True: 468k, False: 33.6M]
  |  Branch (166:3): [True: 33.6M, False: 0]
  ------------------
  167|  34.0M|  return dyn_nappend(s, mem, len);
  168|  34.0M|}
curlx_dyn_add:
  174|  56.3k|{
  175|  56.3k|  size_t n;
  176|  56.3k|  DEBUGASSERT(str);
  ------------------
  |  | 1081|  56.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (176:3): [True: 0, False: 56.3k]
  |  Branch (176:3): [True: 56.3k, False: 0]
  ------------------
  177|  56.3k|  DEBUGASSERT(s);
  ------------------
  |  | 1081|  56.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (177:3): [True: 0, False: 56.3k]
  |  Branch (177:3): [True: 56.3k, False: 0]
  ------------------
  178|  56.3k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1081|  56.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (178:3): [True: 0, False: 56.3k]
  |  Branch (178:3): [True: 56.3k, False: 0]
  ------------------
  179|  56.3k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1081|  56.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (179:3): [True: 56.3k, False: 0]
  |  Branch (179:3): [True: 0, False: 0]
  |  Branch (179:3): [True: 7.22k, False: 49.0k]
  |  Branch (179:3): [True: 49.0k, False: 0]
  ------------------
  180|  56.3k|  n = strlen(str);
  181|  56.3k|  return dyn_nappend(s, (const unsigned char *)str, n);
  182|  56.3k|}
curlx_dyn_vaddf:
  188|   162k|{
  189|   162k|#ifdef BUILDING_LIBCURL
  190|   162k|  int rc;
  191|   162k|  DEBUGASSERT(s);
  ------------------
  |  | 1081|   162k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (191:3): [True: 0, False: 162k]
  |  Branch (191:3): [True: 162k, False: 0]
  ------------------
  192|   162k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1081|   162k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (192:3): [True: 0, False: 162k]
  |  Branch (192:3): [True: 162k, False: 0]
  ------------------
  193|   162k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1081|   162k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (193:3): [True: 162k, False: 0]
  |  Branch (193:3): [True: 0, False: 0]
  |  Branch (193:3): [True: 43.7k, False: 118k]
  |  Branch (193:3): [True: 118k, False: 0]
  ------------------
  194|   162k|  DEBUGASSERT(fmt);
  ------------------
  |  | 1081|   162k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (194:3): [True: 0, False: 162k]
  |  Branch (194:3): [True: 162k, False: 0]
  ------------------
  195|   162k|  rc = curlx_dyn_vprintf(s, fmt, ap);
  196|       |
  197|   162k|  if(!rc)
  ------------------
  |  Branch (197:6): [True: 162k, False: 11]
  ------------------
  198|   162k|    return CURLE_OK;
  199|     11|  else if(rc == MERR_TOO_LARGE)
  ------------------
  |  |   29|     11|#define MERR_TOO_LARGE 2
  ------------------
  |  Branch (199:11): [True: 11, False: 0]
  ------------------
  200|     11|    return CURLE_TOO_LARGE;
  201|      0|  return CURLE_OUT_OF_MEMORY;
  202|       |#else
  203|       |  char *str;
  204|       |  str = curl_mvaprintf(fmt, ap); /* this allocs a new string to append */
  205|       |
  206|       |  if(str) {
  207|       |    CURLcode result = dyn_nappend(s, (const unsigned char *)str, strlen(str));
  208|       |    curl_free(str);
  209|       |    return result;
  210|       |  }
  211|       |  /* If we failed, we cleanup the whole buffer and return error */
  212|       |  curlx_dyn_free(s);
  213|       |  return CURLE_OUT_OF_MEMORY;
  214|       |#endif
  215|   162k|}
curlx_dyn_addf:
  221|   154k|{
  222|   154k|  CURLcode result;
  223|   154k|  va_list ap;
  224|   154k|  DEBUGASSERT(s);
  ------------------
  |  | 1081|   154k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (224:3): [True: 0, False: 154k]
  |  Branch (224:3): [True: 154k, False: 0]
  ------------------
  225|   154k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1081|   154k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (225:3): [True: 0, False: 154k]
  |  Branch (225:3): [True: 154k, False: 0]
  ------------------
  226|   154k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1081|   154k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (226:3): [True: 154k, False: 0]
  |  Branch (226:3): [True: 0, False: 0]
  |  Branch (226:3): [True: 36.2k, False: 118k]
  |  Branch (226:3): [True: 118k, False: 0]
  ------------------
  227|   154k|  DEBUGASSERT(strcmp(fmt, "%s")); /* use curlx_dyn_add instead */
  ------------------
  |  | 1081|   154k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (227:3): [True: 0, False: 154k]
  |  Branch (227:3): [True: 154k, False: 0]
  ------------------
  228|   154k|  va_start(ap, fmt);
  229|   154k|  result = curlx_dyn_vaddf(s, fmt, ap);
  230|       |  va_end(ap);
  231|   154k|  return result;
  232|   154k|}
curlx_dyn_ptr:
  238|  1.60M|{
  239|  1.60M|  DEBUGASSERT(s);
  ------------------
  |  | 1081|  1.60M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (239:3): [True: 0, False: 1.60M]
  |  Branch (239:3): [True: 1.60M, False: 0]
  ------------------
  240|  1.60M|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1081|  1.60M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (240:3): [True: 0, False: 1.60M]
  |  Branch (240:3): [True: 1.60M, False: 0]
  ------------------
  241|  1.60M|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1081|  1.60M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (241:3): [True: 1.60M, False: 0]
  |  Branch (241:3): [True: 0, False: 0]
  |  Branch (241:3): [True: 48.5k, False: 1.55M]
  |  Branch (241:3): [True: 1.55M, False: 0]
  ------------------
  242|  1.60M|  return s->bufr;
  243|  1.60M|}
curlx_dyn_take:
  246|  2.56k|{
  247|  2.56k|  char *ptr = s->bufr;
  248|  2.56k|  DEBUGASSERT(s);
  ------------------
  |  | 1081|  2.56k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (248:3): [True: 0, False: 2.56k]
  |  Branch (248:3): [True: 2.56k, False: 0]
  ------------------
  249|  2.56k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1081|  2.56k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (249:3): [True: 0, False: 2.56k]
  |  Branch (249:3): [True: 2.56k, False: 0]
  ------------------
  250|  2.56k|  *plen = s->leng;
  251|       |  s->bufr = NULL;
  252|  2.56k|  s->leng = 0;
  253|  2.56k|  s->allc = 0;
  254|  2.56k|  return ptr;
  255|  2.56k|}
curlx_dyn_uptr:
  261|  8.10k|{
  262|  8.10k|  DEBUGASSERT(s);
  ------------------
  |  | 1081|  8.10k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (262:3): [True: 0, False: 8.10k]
  |  Branch (262:3): [True: 8.10k, False: 0]
  ------------------
  263|  8.10k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1081|  8.10k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (263:3): [True: 0, False: 8.10k]
  |  Branch (263:3): [True: 8.10k, False: 0]
  ------------------
  264|  8.10k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1081|  8.10k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (264:3): [True: 8.10k, False: 0]
  |  Branch (264:3): [True: 0, False: 0]
  |  Branch (264:3): [True: 0, False: 8.10k]
  |  Branch (264:3): [True: 8.10k, False: 0]
  ------------------
  265|  8.10k|  return (unsigned char *)s->bufr;
  266|  8.10k|}
curlx_dyn_len:
  272|  3.32M|{
  273|  3.32M|  DEBUGASSERT(s);
  ------------------
  |  | 1081|  3.32M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (273:3): [True: 0, False: 3.32M]
  |  Branch (273:3): [True: 3.32M, False: 0]
  ------------------
  274|  3.32M|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1081|  3.32M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (274:3): [True: 0, False: 3.32M]
  |  Branch (274:3): [True: 3.32M, False: 0]
  ------------------
  275|  3.32M|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1081|  3.32M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (275:3): [True: 3.32M, False: 0]
  |  Branch (275:3): [True: 0, False: 0]
  |  Branch (275:3): [True: 199k, False: 3.12M]
  |  Branch (275:3): [True: 3.12M, False: 0]
  ------------------
  276|  3.32M|  return s->leng;
  277|  3.32M|}
curlx_dyn_setlen:
  283|  6.01k|{
  284|  6.01k|  DEBUGASSERT(s);
  ------------------
  |  | 1081|  6.01k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (284:3): [True: 0, False: 6.01k]
  |  Branch (284:3): [True: 6.01k, False: 0]
  ------------------
  285|  6.01k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1081|  6.01k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (285:3): [True: 0, False: 6.01k]
  |  Branch (285:3): [True: 6.01k, False: 0]
  ------------------
  286|  6.01k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1081|  6.01k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (286:3): [True: 6.01k, False: 0]
  |  Branch (286:3): [True: 0, False: 0]
  |  Branch (286:3): [True: 0, False: 6.01k]
  |  Branch (286:3): [True: 6.01k, False: 0]
  ------------------
  287|  6.01k|  if(set > s->leng)
  ------------------
  |  Branch (287:6): [True: 0, False: 6.01k]
  ------------------
  288|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  289|  6.01k|  s->leng = set;
  290|  6.01k|  s->bufr[s->leng] = 0;
  291|  6.01k|  return CURLE_OK;
  292|  6.01k|}
dynbuf.c:dyn_nappend:
   69|  34.1M|{
   70|  34.1M|  size_t idx = s->leng;
   71|  34.1M|  size_t a = s->allc;
   72|  34.1M|  size_t fit = len + idx + 1; /* new string + old string + zero byte */
   73|       |
   74|       |  /* try to detect if there is rubbish in the struct */
   75|  34.1M|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1081|  34.1M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (75:3): [True: 0, False: 34.1M]
  |  Branch (75:3): [True: 34.1M, False: 0]
  ------------------
   76|  34.1M|  DEBUGASSERT(s->toobig);
  ------------------
  |  | 1081|  34.1M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (76:3): [True: 0, False: 34.1M]
  |  Branch (76:3): [True: 34.1M, False: 0]
  ------------------
   77|  34.1M|  DEBUGASSERT(idx < s->toobig);
  ------------------
  |  | 1081|  34.1M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (77:3): [True: 0, False: 34.1M]
  |  Branch (77:3): [True: 34.1M, False: 0]
  ------------------
   78|  34.1M|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1081|  34.1M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (78:3): [True: 34.1M, False: 0]
  |  Branch (78:3): [True: 0, False: 0]
  |  Branch (78:3): [True: 475k, False: 33.6M]
  |  Branch (78:3): [True: 33.6M, False: 0]
  ------------------
   79|  34.1M|  DEBUGASSERT(a <= s->toobig);
  ------------------
  |  | 1081|  34.1M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (79:3): [True: 0, False: 34.1M]
  |  Branch (79:3): [True: 34.1M, False: 0]
  ------------------
   80|  34.1M|  DEBUGASSERT(!len || mem);
  ------------------
  |  | 1081|  34.1M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (80:3): [True: 34.1M, False: 0]
  |  Branch (80:3): [True: 0, False: 0]
  |  Branch (80:3): [True: 12.0k, False: 34.1M]
  |  Branch (80:3): [True: 34.1M, False: 0]
  ------------------
   81|       |
   82|  34.1M|  if(fit > s->toobig) {
  ------------------
  |  Branch (82:6): [True: 17, False: 34.1M]
  ------------------
   83|     17|    curlx_dyn_free(s);
   84|     17|    return CURLE_TOO_LARGE;
   85|     17|  }
   86|  34.1M|  else if(!a) {
  ------------------
  |  Branch (86:11): [True: 356k, False: 33.7M]
  ------------------
   87|   356k|    DEBUGASSERT(!idx);
  ------------------
  |  | 1081|   356k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (87:5): [True: 0, False: 356k]
  |  Branch (87:5): [True: 356k, False: 0]
  ------------------
   88|       |    /* first invoke */
   89|   356k|    if(MIN_FIRST_ALLOC > s->toobig)
  ------------------
  |  |   29|   356k|#define MIN_FIRST_ALLOC 32
  ------------------
  |  Branch (89:8): [True: 16.4k, False: 339k]
  ------------------
   90|  16.4k|      a = s->toobig;
   91|   339k|    else if(fit < MIN_FIRST_ALLOC)
  ------------------
  |  |   29|   339k|#define MIN_FIRST_ALLOC 32
  ------------------
  |  Branch (91:13): [True: 334k, False: 5.04k]
  ------------------
   92|   334k|      a = MIN_FIRST_ALLOC;
  ------------------
  |  |   29|   334k|#define MIN_FIRST_ALLOC 32
  ------------------
   93|  5.04k|    else
   94|  5.04k|      a = fit;
   95|   356k|  }
   96|  33.7M|  else {
   97|  33.9M|    while(a < fit)
  ------------------
  |  Branch (97:11): [True: 120k, False: 33.7M]
  ------------------
   98|   120k|      a *= 2;
   99|  33.7M|    if(a > s->toobig)
  ------------------
  |  Branch (99:8): [True: 1.04k, False: 33.7M]
  ------------------
  100|       |      /* no point in allocating a larger buffer than this is allowed to use */
  101|  1.04k|      a = s->toobig;
  102|  33.7M|  }
  103|       |
  104|  34.1M|  if(a != s->allc) {
  ------------------
  |  Branch (104:6): [True: 469k, False: 33.6M]
  ------------------
  105|   469k|    void *p = curlx_realloc(s->bufr, a);
  ------------------
  |  | 1482|   469k|  curl_dbg_realloc(ptr, size, __LINE__, __FILE__)
  ------------------
  106|   469k|    if(!p) {
  ------------------
  |  Branch (106:8): [True: 0, False: 469k]
  ------------------
  107|      0|      curlx_dyn_free(s);
  108|      0|      return CURLE_OUT_OF_MEMORY;
  109|      0|    }
  110|   469k|    s->bufr = p;
  111|   469k|    s->allc = a;
  112|   469k|  }
  113|       |
  114|  34.1M|  if(len)
  ------------------
  |  Branch (114:6): [True: 34.1M, False: 12.0k]
  ------------------
  115|  34.1M|    memcpy(&s->bufr[idx], mem, len);
  116|  34.1M|  s->leng = idx + len;
  117|  34.1M|  s->bufr[s->leng] = 0;
  118|  34.1M|  return CURLE_OK;
  119|  34.1M|}

curlx_nonblock:
   47|  18.1k|{
   48|  18.1k|#ifdef HAVE_FCNTL_O_NONBLOCK
   49|       |  /* most recent Unix versions */
   50|  18.1k|  int flags;
   51|  18.1k|  flags = sfcntl(sockfd, F_GETFL, 0);
  ------------------
  |  | 1008|  18.1k|#  define sfcntl  fcntl
  ------------------
   52|  18.1k|  if(flags < 0)
  ------------------
  |  Branch (52:6): [True: 0, False: 18.1k]
  ------------------
   53|      0|    return -1;
   54|       |  /* Check if the current file status flags have already satisfied
   55|       |   * the request, if so, it is no need to call fcntl() to replicate it.
   56|       |   */
   57|  18.1k|  if(!!(flags & O_NONBLOCK) == !!nonblock)
  ------------------
  |  Branch (57:6): [True: 4.29k, False: 13.8k]
  ------------------
   58|  4.29k|    return 0;
   59|  13.8k|  if(nonblock)
  ------------------
  |  Branch (59:6): [True: 13.8k, False: 0]
  ------------------
   60|  13.8k|    flags |= O_NONBLOCK;
   61|      0|  else
   62|      0|    flags &= ~O_NONBLOCK;
   63|  13.8k|  return sfcntl(sockfd, F_SETFL, flags);
  ------------------
  |  | 1008|  13.8k|#  define sfcntl  fcntl
  ------------------
   64|       |
   65|       |#elif defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO)
   66|       |
   67|       |  /* Amiga */
   68|       |  long flags = nonblock ? 1L : 0L;
   69|       |  return IoctlSocket(sockfd, FIONBIO, (char *)&flags);
   70|       |
   71|       |#elif defined(HAVE_IOCTL_FIONBIO)
   72|       |
   73|       |  /* older Unix versions */
   74|       |  int flags = nonblock ? 1 : 0;
   75|       |  return ioctl(sockfd, FIONBIO, &flags);
   76|       |
   77|       |#elif defined(HAVE_IOCTLSOCKET_FIONBIO)
   78|       |
   79|       |  /* Windows */
   80|       |  unsigned long flags = nonblock ? 1UL : 0UL;
   81|       |  return ioctlsocket(sockfd, (long)FIONBIO, &flags);
   82|       |
   83|       |#elif defined(HAVE_SETSOCKOPT_SO_NONBLOCK)
   84|       |
   85|       |  /* Orbis OS */
   86|       |  long b = nonblock ? 1L : 0L;
   87|       |  return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b));
   88|       |
   89|       |#else
   90|       |#error "no non-blocking method was found/used/set"
   91|       |#endif
   92|  18.1k|}

curlx_strcopy:
   42|  10.3k|{
   43|  10.3k|  DEBUGASSERT(slen < dsize);
  ------------------
  |  | 1081|  10.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (43:3): [True: 0, False: 10.3k]
  |  Branch (43:3): [True: 10.3k, False: 0]
  ------------------
   44|  10.3k|  if(slen < dsize) {
  ------------------
  |  Branch (44:6): [True: 10.3k, False: 0]
  ------------------
   45|  10.3k|    memcpy(dest, src, slen);
   46|  10.3k|    dest[slen] = 0;
   47|  10.3k|  }
   48|      0|  else if(dsize)
  ------------------
  |  Branch (48:11): [True: 0, False: 0]
  ------------------
   49|      0|    dest[0] = 0;
   50|  10.3k|}

curlx_memdup:
   65|  6.60k|{
   66|  6.60k|  void *buffer = curlx_malloc(length);
  ------------------
  |  | 1478|  6.60k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
   67|  6.60k|  if(!buffer)
  ------------------
  |  Branch (67:6): [True: 0, False: 6.60k]
  ------------------
   68|      0|    return NULL; /* fail */
   69|       |
   70|  6.60k|  memcpy(buffer, src, length);
   71|       |
   72|  6.60k|  return buffer;
   73|  6.60k|}
curlx_memdup0:
   86|   155k|{
   87|   155k|  char *buf = (length < SIZE_MAX) ? curlx_malloc(length + 1) : NULL;
  ------------------
  |  | 1478|   155k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  |  Branch (87:15): [True: 155k, False: 0]
  ------------------
   88|   155k|  if(!buf)
  ------------------
  |  Branch (88:6): [True: 0, False: 155k]
  ------------------
   89|      0|    return NULL;
   90|   155k|  if(length) {
  ------------------
  |  Branch (90:6): [True: 134k, False: 21.7k]
  ------------------
   91|   134k|    DEBUGASSERT(src); /* must never be NULL */
  ------------------
  |  | 1081|   134k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (91:5): [True: 0, False: 134k]
  |  Branch (91:5): [True: 134k, False: 0]
  ------------------
   92|   134k|    memcpy(buf, src, length);
   93|   134k|  }
   94|   155k|  buf[length] = 0;
   95|   155k|  return buf;
   96|   155k|}

curlx_strerror:
  249|    182|{
  250|       |#ifdef _WIN32
  251|       |  DWORD old_win_err = GetLastError();
  252|       |#endif
  253|    182|  int old_errno = errno;
  254|    182|  char *p;
  255|       |
  256|    182|  if(!buflen)
  ------------------
  |  Branch (256:6): [True: 0, False: 182]
  ------------------
  257|      0|    return NULL;
  258|       |
  259|    182|#ifndef _WIN32
  260|    182|  DEBUGASSERT(err >= 0);
  ------------------
  |  | 1081|    182|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (260:3): [True: 0, False: 182]
  |  Branch (260:3): [True: 182, False: 0]
  ------------------
  261|    182|#endif
  262|       |
  263|    182|  *buf = '\0';
  264|       |
  265|       |#ifdef _WIN32
  266|       |  if((strerror_s(buf, buflen, err) || !strcmp(buf, "Unknown error")) &&
  267|       |#ifdef USE_WINSOCK
  268|       |     !get_winsock_error(err, buf, buflen) &&
  269|       |#endif
  270|       |     !curlx_get_winapi_error((DWORD)err, buf, buflen))
  271|       |    SNPRINTF(buf, buflen, "Unknown error %d (%#x)", err, err);
  272|       |#else /* !_WIN32 */
  273|       |
  274|       |#if defined(HAVE_STRERROR_R) && defined(HAVE_POSIX_STRERROR_R)
  275|       |  /*
  276|       |   * The POSIX-style strerror_r() may set errno to ERANGE if insufficient
  277|       |   * storage is supplied via 'strerrbuf' and 'buflen' to hold the generated
  278|       |   * message string, or EINVAL if 'errnum' is not a valid error number.
  279|       |   */
  280|       |  if(strerror_r(err, buf, buflen) &&
  281|       |     buflen > sizeof("Unknown error ") + 20) {
  282|       |    if(buf[0] == '\0')
  283|       |      SNPRINTF(buf, buflen, "Unknown error %d", err);
  284|       |  }
  285|       |#elif defined(HAVE_STRERROR_R) && defined(HAVE_GLIBC_STRERROR_R)
  286|       |  /*
  287|       |   * The glibc-style strerror_r() only *might* use the buffer we pass to
  288|       |   * the function, but it always returns the error message as a pointer,
  289|       |   * so we must copy that string unconditionally (if non-NULL).
  290|       |   */
  291|    182|  {
  292|    182|    char buffer[256];
  293|    182|    const char *msg = strerror_r(err, buffer, sizeof(buffer));
  294|    182|    if(msg && buflen > 1)
  ------------------
  |  Branch (294:8): [True: 182, False: 0]
  |  Branch (294:15): [True: 182, False: 0]
  ------------------
  295|    182|      SNPRINTF(buf, buflen, "%s", msg);
  ------------------
  |  |   43|    182|#define SNPRINTF curl_msnprintf
  ------------------
  296|      0|    else if(buflen > sizeof("Unknown error ") + 20)
  ------------------
  |  Branch (296:13): [True: 0, False: 0]
  ------------------
  297|      0|      SNPRINTF(buf, buflen, "Unknown error %d", err);
  ------------------
  |  |   43|      0|#define SNPRINTF curl_msnprintf
  ------------------
  298|    182|  }
  299|       |#else
  300|       |  {
  301|       |    /* !checksrc! disable BANNEDFUNC 1 */
  302|       |    const char *msg = strerror(err);
  303|       |    if(msg && buflen > 1)
  304|       |      SNPRINTF(buf, buflen, "%s", msg);
  305|       |    else if(buflen > sizeof("Unknown error ") + 20)
  306|       |      SNPRINTF(buf, buflen, "Unknown error %d", err);
  307|       |  }
  308|       |#endif
  309|       |
  310|    182|#endif /* _WIN32 */
  311|       |
  312|       |  /* strip trailing '\r\n' or '\n'. */
  313|    182|  p = strrchr(buf, '\n');
  314|    182|  if(p && (p - buf) >= 2)
  ------------------
  |  Branch (314:6): [True: 0, False: 182]
  |  Branch (314:11): [True: 0, False: 0]
  ------------------
  315|      0|    *p = '\0';
  316|    182|  p = strrchr(buf, '\r');
  317|    182|  if(p && (p - buf) >= 1)
  ------------------
  |  Branch (317:6): [True: 0, False: 182]
  |  Branch (317:11): [True: 0, False: 0]
  ------------------
  318|      0|    *p = '\0';
  319|       |
  320|    182|  if(errno != old_errno)
  ------------------
  |  Branch (320:6): [True: 0, False: 182]
  ------------------
  321|    182|    errno = old_errno;
  322|       |
  323|       |#ifdef _WIN32
  324|       |  if(old_win_err != GetLastError())
  325|       |    SetLastError(old_win_err);
  326|       |#endif
  327|       |
  328|    182|  return buf;
  329|    182|}

curlx_str_init:
   27|  71.3k|{
   28|       |  out->str = NULL;
   29|  71.3k|  out->len = 0;
   30|  71.3k|}
curlx_str_assign:
   33|  2.01k|{
   34|  2.01k|  out->str = str;
   35|  2.01k|  out->len = len;
   36|  2.01k|}
curlx_str_until:
   51|  38.7k|{
   52|  38.7k|  const char *s;
   53|  38.7k|  size_t len = 0;
   54|  38.7k|  DEBUGASSERT(linep);
  ------------------
  |  | 1081|  38.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (54:3): [True: 0, False: 38.7k]
  |  Branch (54:3): [True: 38.7k, False: 0]
  ------------------
   55|  38.7k|  DEBUGASSERT(*linep);
  ------------------
  |  | 1081|  38.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (55:3): [True: 0, False: 38.7k]
  |  Branch (55:3): [True: 38.7k, False: 0]
  ------------------
   56|  38.7k|  DEBUGASSERT(out);
  ------------------
  |  | 1081|  38.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (56:3): [True: 0, False: 38.7k]
  |  Branch (56:3): [True: 38.7k, False: 0]
  ------------------
   57|  38.7k|  DEBUGASSERT(delim);
  ------------------
  |  | 1081|  38.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (57:3): [True: 0, False: 38.7k]
  |  Branch (57:3): [True: 38.7k, False: 0]
  ------------------
   58|  38.7k|  s = *linep;
   59|       |
   60|  38.7k|  curlx_str_init(out);
   61|   228k|  while(*s && (*s != delim)) {
  ------------------
  |  Branch (61:9): [True: 203k, False: 25.2k]
  |  Branch (61:15): [True: 189k, False: 13.4k]
  ------------------
   62|   189k|    s++;
   63|   189k|    if(++len > max) {
  ------------------
  |  Branch (63:8): [True: 31, False: 189k]
  ------------------
   64|     31|      return STRE_BIG;
  ------------------
  |  |   29|     31|#define STRE_BIG      1
  ------------------
   65|     31|    }
   66|   189k|  }
   67|  38.6k|  if(!len)
  ------------------
  |  Branch (67:6): [True: 2.57k, False: 36.1k]
  ------------------
   68|  2.57k|    return STRE_SHORT;
  ------------------
  |  |   30|  2.57k|#define STRE_SHORT    2
  ------------------
   69|  36.1k|  out->str = *linep;
   70|  36.1k|  out->len = len;
   71|  36.1k|  *linep = s; /* point to the first byte after the word */
   72|  36.1k|  return STRE_OK;
  ------------------
  |  |   28|  36.1k|#define STRE_OK       0
  ------------------
   73|  38.6k|}
curlx_str_word:
   78|  17.2k|{
   79|  17.2k|  return curlx_str_until(linep, out, max, ' ');
   80|  17.2k|}
curlx_str_untilnl:
   86|  5.74k|{
   87|  5.74k|  const char *s = *linep;
   88|  5.74k|  size_t len = 0;
   89|  5.74k|  DEBUGASSERT(linep && *linep && out && max);
  ------------------
  |  | 1081|  5.74k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (89:3): [True: 0, False: 5.74k]
  |  Branch (89:3): [True: 0, False: 0]
  |  Branch (89:3): [True: 0, False: 0]
  |  Branch (89:3): [True: 0, False: 0]
  |  Branch (89:3): [True: 5.74k, False: 0]
  |  Branch (89:3): [True: 5.74k, False: 0]
  |  Branch (89:3): [True: 5.74k, False: 0]
  |  Branch (89:3): [True: 5.74k, False: 0]
  ------------------
   90|       |
   91|  5.74k|  curlx_str_init(out);
   92|   334k|  while(*s && !ISNEWLINE(*s)) {
  ------------------
  |  |   50|   331k|#define ISNEWLINE(x)    (((x) == '\n') || (x) == '\r')
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 1.56k, False: 330k]
  |  |  |  Branch (50:43): [True: 1.60k, False: 328k]
  |  |  ------------------
  ------------------
  |  Branch (92:9): [True: 331k, False: 2.57k]
  ------------------
   93|   328k|    s++;
   94|   328k|    if(++len > max)
  ------------------
  |  Branch (94:8): [True: 0, False: 328k]
  ------------------
   95|      0|      return STRE_BIG;
  ------------------
  |  |   29|      0|#define STRE_BIG      1
  ------------------
   96|   328k|  }
   97|  5.74k|  if(!len)
  ------------------
  |  Branch (97:6): [True: 142, False: 5.60k]
  ------------------
   98|    142|    return STRE_SHORT;
  ------------------
  |  |   30|    142|#define STRE_SHORT    2
  ------------------
   99|  5.60k|  out->str = *linep;
  100|  5.60k|  out->len = len;
  101|  5.60k|  *linep = s; /* point to the first byte after the word */
  102|  5.60k|  return STRE_OK;
  ------------------
  |  |   28|  5.60k|#define STRE_OK       0
  ------------------
  103|  5.74k|}
curlx_str_quotedword:
  109|    459|{
  110|    459|  const char *s = *linep;
  111|    459|  size_t len = 0;
  112|    459|  DEBUGASSERT(linep && *linep && out && max);
  ------------------
  |  | 1081|    459|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (112:3): [True: 0, False: 459]
  |  Branch (112:3): [True: 0, False: 0]
  |  Branch (112:3): [True: 0, False: 0]
  |  Branch (112:3): [True: 0, False: 0]
  |  Branch (112:3): [True: 459, False: 0]
  |  Branch (112:3): [True: 459, False: 0]
  |  Branch (112:3): [True: 459, False: 0]
  |  Branch (112:3): [True: 459, False: 0]
  ------------------
  113|       |
  114|    459|  curlx_str_init(out);
  115|    459|  if(*s != '\"')
  ------------------
  |  Branch (115:6): [True: 0, False: 459]
  ------------------
  116|      0|    return STRE_BEGQUOTE;
  ------------------
  |  |   31|      0|#define STRE_BEGQUOTE 3
  ------------------
  117|    459|  s++;
  118|  2.52k|  while(*s && (*s != '\"')) {
  ------------------
  |  Branch (118:9): [True: 2.44k, False: 79]
  |  Branch (118:15): [True: 2.06k, False: 380]
  ------------------
  119|  2.06k|    if(*s == '\\' && s[1]) {
  ------------------
  |  Branch (119:8): [True: 277, False: 1.78k]
  |  Branch (119:22): [True: 259, False: 18]
  ------------------
  120|    259|      s++;
  121|    259|      if(++len > max)
  ------------------
  |  Branch (121:10): [True: 0, False: 259]
  ------------------
  122|      0|        return STRE_BIG;
  ------------------
  |  |   29|      0|#define STRE_BIG      1
  ------------------
  123|    259|    }
  124|  2.06k|    s++;
  125|  2.06k|    if(++len > max)
  ------------------
  |  Branch (125:8): [True: 0, False: 2.06k]
  ------------------
  126|      0|      return STRE_BIG;
  ------------------
  |  |   29|      0|#define STRE_BIG      1
  ------------------
  127|  2.06k|  }
  128|    459|  if(*s != '\"')
  ------------------
  |  Branch (128:6): [True: 79, False: 380]
  ------------------
  129|     79|    return STRE_ENDQUOTE;
  ------------------
  |  |   32|     79|#define STRE_ENDQUOTE 4
  ------------------
  130|    380|  out->str = (*linep) + 1;
  131|    380|  out->len = len;
  132|    380|  *linep = s + 1;
  133|    380|  return STRE_OK;
  ------------------
  |  |   28|    380|#define STRE_OK       0
  ------------------
  134|    459|}
curlx_str_single:
  139|   245k|{
  140|   245k|  DEBUGASSERT(linep && *linep);
  ------------------
  |  | 1081|   245k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (140:3): [True: 0, False: 245k]
  |  Branch (140:3): [True: 0, False: 0]
  |  Branch (140:3): [True: 245k, False: 0]
  |  Branch (140:3): [True: 245k, False: 0]
  ------------------
  141|   245k|  if(**linep != byte)
  ------------------
  |  Branch (141:6): [True: 142k, False: 103k]
  ------------------
  142|   142k|    return STRE_BYTE;
  ------------------
  |  |   33|   142k|#define STRE_BYTE     5
  ------------------
  143|   103k|  (*linep)++; /* move over it */
  144|   103k|  return STRE_OK;
  ------------------
  |  |   28|   103k|#define STRE_OK       0
  ------------------
  145|   245k|}
curlx_str_singlespace:
  150|  17.2k|{
  151|  17.2k|  return curlx_str_single(linep, ' ');
  152|  17.2k|}
curlx_str_number:
  209|   940k|{
  210|   940k|  return str_num_base(linep, nump, max, 10);
  211|   940k|}
curlx_str_hex:
  216|    268|{
  217|    268|  return str_num_base(linep, nump, max, 16);
  218|    268|}
curlx_str_octal:
  223|  8.65k|{
  224|  8.65k|  return str_num_base(linep, nump, max, 8);
  225|  8.65k|}
curlx_str_numblanks:
  232|  1.55k|{
  233|  1.55k|  curlx_str_passblanks(str);
  234|  1.55k|  return curlx_str_number(str, num, CURL_OFF_T_MAX);
  ------------------
  |  |  594|  1.55k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  235|  1.55k|}
curlx_str_newline:
  240|    294|{
  241|    294|  DEBUGASSERT(linep && *linep);
  ------------------
  |  | 1081|    294|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (241:3): [True: 0, False: 294]
  |  Branch (241:3): [True: 0, False: 0]
  |  Branch (241:3): [True: 294, False: 0]
  |  Branch (241:3): [True: 294, False: 0]
  ------------------
  242|    294|  if(ISNEWLINE(**linep)) {
  ------------------
  |  |   50|    294|#define ISNEWLINE(x)    (((x) == '\n') || (x) == '\r')
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 66, False: 228]
  |  |  |  Branch (50:43): [True: 226, False: 2]
  |  |  ------------------
  ------------------
  243|    292|    (*linep)++;
  244|    292|    return STRE_OK; /* yessir */
  ------------------
  |  |   28|    292|#define STRE_OK       0
  ------------------
  245|    292|  }
  246|      2|  return STRE_NEWLINE;
  ------------------
  |  |   34|      2|#define STRE_NEWLINE  6
  ------------------
  247|    294|}
curlx_str_casecompare:
  253|   162k|{
  254|   162k|  size_t clen = check ? strlen(check) : 0;
  ------------------
  |  Branch (254:17): [True: 162k, False: 0]
  ------------------
  255|   162k|  return ((str->len == clen) && curl_strnequal(str->str, check, clen));
  ------------------
  |  Branch (255:11): [True: 47.0k, False: 115k]
  |  Branch (255:33): [True: 19.3k, False: 27.7k]
  ------------------
  256|   162k|}
curlx_str_cmp:
  261|  5.98k|{
  262|  5.98k|  if(check) {
  ------------------
  |  Branch (262:6): [True: 5.98k, False: 0]
  ------------------
  263|  5.98k|    size_t clen = strlen(check);
  264|  5.98k|    return ((str->len == clen) && !strncmp(str->str, check, clen));
  ------------------
  |  Branch (264:13): [True: 114, False: 5.87k]
  |  Branch (264:35): [True: 53, False: 61]
  ------------------
  265|  5.98k|  }
  266|      0|  return !!(str->len);
  267|  5.98k|}
curlx_str_nudge:
  272|  14.6k|{
  273|  14.6k|  if(num <= str->len) {
  ------------------
  |  Branch (273:6): [True: 14.6k, False: 0]
  ------------------
  274|  14.6k|    str->str += num;
  275|  14.6k|    str->len -= num;
  276|  14.6k|    return STRE_OK;
  ------------------
  |  |   28|  14.6k|#define STRE_OK       0
  ------------------
  277|  14.6k|  }
  278|      0|  return STRE_OVERFLOW;
  ------------------
  |  |   35|      0|#define STRE_OVERFLOW 7
  ------------------
  279|  14.6k|}
curlx_str_cspn:
  285|   104k|{
  286|   104k|  const char *s = *linep;
  287|   104k|  size_t len;
  288|   104k|  DEBUGASSERT(linep && *linep);
  ------------------
  |  | 1081|   104k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (288:3): [True: 0, False: 104k]
  |  Branch (288:3): [True: 0, False: 0]
  |  Branch (288:3): [True: 104k, False: 0]
  |  Branch (288:3): [True: 104k, False: 0]
  ------------------
  289|       |
  290|   104k|  len = strcspn(s, reject);
  291|   104k|  if(len) {
  ------------------
  |  Branch (291:6): [True: 95.9k, False: 8.55k]
  ------------------
  292|  95.9k|    out->str = s;
  293|  95.9k|    out->len = len;
  294|  95.9k|    *linep = &s[len];
  295|  95.9k|    return STRE_OK;
  ------------------
  |  |   28|  95.9k|#define STRE_OK       0
  ------------------
  296|  95.9k|  }
  297|  8.55k|  curlx_str_init(out);
  298|  8.55k|  return STRE_SHORT;
  ------------------
  |  |   30|  8.55k|#define STRE_SHORT    2
  ------------------
  299|   104k|}
curlx_str_trimblanks:
  303|  97.8k|{
  304|   112k|  while(out->len && ISBLANK(*out->str))
  ------------------
  |  |   45|   110k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 14.4k, False: 96.2k]
  |  |  |  Branch (45:38): [True: 199, False: 96.0k]
  |  |  ------------------
  ------------------
  |  Branch (304:9): [True: 110k, False: 1.86k]
  ------------------
  305|  14.6k|    curlx_str_nudge(out, 1);
  306|       |
  307|       |  /* trim trailing spaces and tabs */
  308|   101k|  while(out->len && ISBLANK(out->str[out->len - 1]))
  ------------------
  |  |   45|  99.2k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 2.04k, False: 97.2k]
  |  |  |  Branch (45:38): [True: 1.22k, False: 96.0k]
  |  |  ------------------
  ------------------
  |  Branch (308:9): [True: 99.2k, False: 1.86k]
  ------------------
  309|  3.26k|    out->len--;
  310|  97.8k|}
curlx_str_passblanks:
  314|  58.1k|{
  315|  67.4k|  while(ISBLANK(**linep))
  ------------------
  |  |   45|  67.4k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 8.72k, False: 58.7k]
  |  |  |  Branch (45:38): [True: 550, False: 58.1k]
  |  |  ------------------
  ------------------
  316|  9.27k|    (*linep)++; /* move over it */
  317|  58.1k|}
strparse.c:str_num_base:
  172|   949k|{
  173|   949k|  curl_off_t num = 0;
  174|   949k|  const char *p;
  175|   949k|  int m = (base == 10) ? '9' :   /* the largest digit possible */
  ------------------
  |  Branch (175:11): [True: 940k, False: 8.92k]
  ------------------
  176|   949k|    (base == 16) ? 'f' : '7';
  ------------------
  |  Branch (176:5): [True: 268, False: 8.65k]
  ------------------
  177|   949k|  DEBUGASSERT(linep && *linep && nump);
  ------------------
  |  | 1081|   949k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (177:3): [True: 0, False: 949k]
  |  Branch (177:3): [True: 0, False: 0]
  |  Branch (177:3): [True: 0, False: 0]
  |  Branch (177:3): [True: 949k, False: 1]
  |  Branch (177:3): [True: 949k, False: 0]
  |  Branch (177:3): [True: 949k, False: 0]
  ------------------
  178|   949k|  DEBUGASSERT((base == 8) || (base == 10) || (base == 16));
  ------------------
  |  | 1081|   949k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (178:3): [True: 949k, False: 0]
  |  Branch (178:3): [True: 0, False: 0]
  |  Branch (178:3): [True: 0, False: 0]
  |  Branch (178:3): [True: 8.65k, False: 940k]
  |  Branch (178:3): [True: 940k, False: 268]
  |  Branch (178:3): [True: 268, False: 0]
  ------------------
  179|   949k|  DEBUGASSERT(max >= 0); /* mostly to catch SIZE_MAX, which is too large */
  ------------------
  |  | 1081|   949k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (179:3): [True: 0, False: 949k]
  |  Branch (179:3): [True: 949k, False: 0]
  ------------------
  180|   949k|  *nump = 0;
  181|   949k|  p = *linep;
  182|   949k|  if(!valid_digit(*p, m))
  ------------------
  |  |  156|   949k|  (((x) >= '0') && ((x) <= (m)) && curlx_hexasciitable[(x) - '0'])
  |  |  ------------------
  |  |  |  Branch (156:4): [True: 897k, False: 52.1k]
  |  |  |  Branch (156:20): [True: 234k, False: 662k]
  |  |  |  Branch (156:36): [True: 234k, False: 37]
  |  |  ------------------
  ------------------
  183|   714k|    return STRE_NO_NUM;
  ------------------
  |  |   36|   714k|#define STRE_NO_NUM   8
  ------------------
  184|   234k|  if(max < base) {
  ------------------
  |  Branch (184:6): [True: 0, False: 234k]
  ------------------
  185|       |    /* special-case low max scenario because check needs to be different */
  186|      0|    do {
  187|      0|      int n = curlx_hexval(*p++);
  ------------------
  |  |  112|      0|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  188|      0|      num = (num * base) + n;
  189|      0|      if(num > max)
  ------------------
  |  Branch (189:10): [True: 0, False: 0]
  ------------------
  190|      0|        return STRE_OVERFLOW;
  ------------------
  |  |   35|      0|#define STRE_OVERFLOW 7
  ------------------
  191|      0|    } while(valid_digit(*p, m));
  ------------------
  |  |  156|      0|  (((x) >= '0') && ((x) <= (m)) && curlx_hexasciitable[(x) - '0'])
  |  |  ------------------
  |  |  |  Branch (156:4): [True: 0, False: 0]
  |  |  |  Branch (156:20): [True: 0, False: 0]
  |  |  |  Branch (156:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  192|      0|  }
  193|   234k|  else {
  194|   584k|    do {
  195|   584k|      int n = curlx_hexval(*p++);
  ------------------
  |  |  112|   584k|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  196|   584k|      if(num > ((max - n) / base))
  ------------------
  |  Branch (196:10): [True: 1.94k, False: 582k]
  ------------------
  197|  1.94k|        return STRE_OVERFLOW;
  ------------------
  |  |   35|  1.94k|#define STRE_OVERFLOW 7
  ------------------
  198|   582k|      num = (num * base) + n;
  199|   582k|    } while(valid_digit(*p, m));
  ------------------
  |  |  156|   582k|  (((x) >= '0') && ((x) <= (m)) && curlx_hexasciitable[(x) - '0'])
  |  |  ------------------
  |  |  |  Branch (156:4): [True: 502k, False: 80.5k]
  |  |  |  Branch (156:20): [True: 349k, False: 152k]
  |  |  |  Branch (156:36): [True: 349k, False: 2]
  |  |  ------------------
  ------------------
  200|   234k|  }
  201|   232k|  *nump = num;
  202|   232k|  *linep = p;
  203|   232k|  return STRE_OK;
  ------------------
  |  |   28|   232k|#define STRE_OK       0
  ------------------
  204|   234k|}

curlx_mstotv:
   35|     58|{
   36|     58|  if(!tv)
  ------------------
  |  Branch (36:6): [True: 0, False: 58]
  ------------------
   37|      0|    return NULL;
   38|       |
   39|     58|  if(ms < 0)
  ------------------
  |  Branch (39:6): [True: 0, False: 58]
  ------------------
   40|      0|    return NULL;
   41|       |
   42|     58|  if(ms > 0) {
  ------------------
  |  Branch (42:6): [True: 58, False: 0]
  ------------------
   43|     58|    timediff_t tv_sec = ms / 1000;
   44|     58|    timediff_t tv_usec = (ms % 1000) * 1000; /* max=999000 */
   45|     58|#ifdef HAVE_SUSECONDS_T
   46|       |#if TIMEDIFF_T_MAX > TIME_T_MAX
   47|       |    /* tv_sec overflow check in case time_t is signed */
   48|       |    if(tv_sec > TIME_T_MAX)
   49|       |      tv_sec = TIME_T_MAX;
   50|       |#endif
   51|     58|    tv->tv_sec = (time_t)tv_sec;
   52|     58|    tv->tv_usec = (suseconds_t)tv_usec;
   53|       |#elif defined(_WIN32) /* maybe also others in the future */
   54|       |#if TIMEDIFF_T_MAX > LONG_MAX
   55|       |    /* tv_sec overflow check on Windows there we know it is long */
   56|       |    if(tv_sec > LONG_MAX)
   57|       |      tv_sec = LONG_MAX;
   58|       |#endif
   59|       |    tv->tv_sec = (long)tv_sec;
   60|       |    tv->tv_usec = (long)tv_usec;
   61|       |#else
   62|       |#if TIMEDIFF_T_MAX > INT_MAX
   63|       |    /* tv_sec overflow check in case time_t is signed */
   64|       |    if(tv_sec > INT_MAX)
   65|       |      tv_sec = INT_MAX;
   66|       |#endif
   67|       |    tv->tv_sec = (int)tv_sec;
   68|       |    tv->tv_usec = (int)tv_usec;
   69|       |#endif
   70|     58|  }
   71|      0|  else {
   72|      0|    tv->tv_sec = 0;
   73|      0|    tv->tv_usec = 0;
   74|      0|  }
   75|       |
   76|     58|  return tv;
   77|     58|}

curlx_pnow:
   54|  46.7M|{
   55|       |  /*
   56|       |   * clock_gettime() is granted to be increased monotonically when the
   57|       |   * monotonic clock is queried. Time starting point is unspecified, it
   58|       |   * could be the system start-up time, the Epoch, or something else,
   59|       |   * in any case the time starting point does not change once that the
   60|       |   * system has started up.
   61|       |   */
   62|  46.7M|  struct timespec tsnow;
   63|       |
   64|       |  /*
   65|       |   * clock_gettime() may be defined by Apple's SDK as weak symbol thus
   66|       |   * code compiles but fails during runtime if clock_gettime() is
   67|       |   * called on unsupported OS version.
   68|       |   */
   69|       |#if defined(__APPLE__) && defined(HAVE_BUILTIN_AVAILABLE) && \
   70|       |  (HAVE_BUILTIN_AVAILABLE == 1)
   71|       |  bool have_clock_gettime = FALSE;
   72|       |  if(__builtin_available(macOS 10.12, iOS 10, tvOS 10, watchOS 3, *))
   73|       |    have_clock_gettime = TRUE;
   74|       |#endif
   75|       |
   76|  46.7M|#ifdef HAVE_CLOCK_GETTIME_MONOTONIC_RAW
   77|  46.7M|  if(
   78|       |#if defined(__APPLE__) && defined(HAVE_BUILTIN_AVAILABLE) && \
   79|       |  (HAVE_BUILTIN_AVAILABLE == 1)
   80|       |    have_clock_gettime &&
   81|       |#endif
   82|  46.7M|    (clock_gettime(CLOCK_MONOTONIC_RAW, &tsnow) == 0)) {
  ------------------
  |  Branch (82:5): [True: 46.7M, False: 18.4E]
  ------------------
   83|  46.7M|    pnow->tv_sec = tsnow.tv_sec;
   84|  46.7M|    pnow->tv_usec = (int)(tsnow.tv_nsec / 1000);
   85|  46.7M|  }
   86|  18.4E|  else
   87|  18.4E|#endif
   88|       |
   89|  18.4E|  if(
   90|       |#if defined(__APPLE__) && defined(HAVE_BUILTIN_AVAILABLE) && \
   91|       |  (HAVE_BUILTIN_AVAILABLE == 1)
   92|       |    have_clock_gettime &&
   93|       |#endif
   94|  18.4E|    (clock_gettime(CLOCK_MONOTONIC, &tsnow) == 0)) {
  ------------------
  |  Branch (94:5): [True: 0, False: 18.4E]
  ------------------
   95|      0|    pnow->tv_sec = tsnow.tv_sec;
   96|      0|    pnow->tv_usec = (int)(tsnow.tv_nsec / 1000);
   97|      0|  }
   98|       |  /*
   99|       |   * Even when the configure process has truly detected monotonic clock
  100|       |   * availability, it might happen that it is not actually available at
  101|       |   * runtime. When this occurs, fallback to other time source.
  102|       |   */
  103|  18.4E|#ifdef HAVE_GETTIMEOFDAY
  104|  18.4E|  else {
  105|  18.4E|    struct timeval now;
  106|  18.4E|    (void)gettimeofday(&now, NULL);
  107|  18.4E|    pnow->tv_sec = now.tv_sec;
  108|  18.4E|    pnow->tv_usec = (int)now.tv_usec;
  109|  18.4E|  }
  110|       |#else
  111|       |  else {
  112|       |    pnow->tv_sec = time(NULL);
  113|       |    pnow->tv_usec = 0;
  114|       |  }
  115|       |#endif
  116|  46.7M|}
curlx_now:
  176|  2.22k|{
  177|  2.22k|  struct curltime now;
  178|  2.22k|  curlx_pnow(&now);
  179|  2.22k|  return now;
  180|  2.22k|}
curlx_ptimediff_ms:
  190|  30.0M|{
  191|  30.0M|  timediff_t diff = (timediff_t)newer->tv_sec - older->tv_sec;
  192|  30.0M|  if(diff >= (TIMEDIFF_T_MAX / 1000))
  ------------------
  |  |   33|  30.0M|#define TIMEDIFF_T_MAX CURL_OFF_T_MAX
  |  |  ------------------
  |  |  |  |  594|  30.0M|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  ------------------
  ------------------
  |  Branch (192:6): [True: 0, False: 30.0M]
  ------------------
  193|      0|    return TIMEDIFF_T_MAX;
  ------------------
  |  |   33|      0|#define TIMEDIFF_T_MAX CURL_OFF_T_MAX
  |  |  ------------------
  |  |  |  |  594|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  ------------------
  ------------------
  194|  30.0M|  else if(diff <= (TIMEDIFF_T_MIN / 1000))
  ------------------
  |  |   34|  30.0M|#define TIMEDIFF_T_MIN CURL_OFF_T_MIN
  |  |  ------------------
  |  |  |  |  596|  30.0M|#define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  594|  30.0M|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (194:11): [True: 0, False: 30.0M]
  ------------------
  195|      0|    return TIMEDIFF_T_MIN;
  ------------------
  |  |   34|      0|#define TIMEDIFF_T_MIN CURL_OFF_T_MIN
  |  |  ------------------
  |  |  |  |  596|      0|#define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  594|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  196|  30.0M|  return (diff * 1000) + ((newer->tv_usec - older->tv_usec) / 1000);
  197|  30.0M|}
curlx_ptimediff_us:
  225|  38.9M|{
  226|  38.9M|  timediff_t diff = (timediff_t)newer->tv_sec - older->tv_sec;
  227|  38.9M|  if(diff >= (TIMEDIFF_T_MAX / 1000000))
  ------------------
  |  |   33|  38.9M|#define TIMEDIFF_T_MAX CURL_OFF_T_MAX
  |  |  ------------------
  |  |  |  |  594|  38.9M|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  ------------------
  ------------------
  |  Branch (227:6): [True: 0, False: 38.9M]
  ------------------
  228|      0|    return TIMEDIFF_T_MAX;
  ------------------
  |  |   33|      0|#define TIMEDIFF_T_MAX CURL_OFF_T_MAX
  |  |  ------------------
  |  |  |  |  594|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  ------------------
  ------------------
  229|  38.9M|  else if(diff <= (TIMEDIFF_T_MIN / 1000000))
  ------------------
  |  |   34|  38.9M|#define TIMEDIFF_T_MIN CURL_OFF_T_MIN
  |  |  ------------------
  |  |  |  |  596|  38.9M|#define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  594|  38.9M|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (229:11): [True: 0, False: 38.9M]
  ------------------
  230|      0|    return TIMEDIFF_T_MIN;
  ------------------
  |  |   34|      0|#define TIMEDIFF_T_MIN CURL_OFF_T_MIN
  |  |  ------------------
  |  |  |  |  596|      0|#define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  594|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|  38.9M|  return (diff * 1000000) + newer->tv_usec - older->tv_usec;
  232|  38.9M|}
curlx_gmtime:
  253|  2.08k|{
  254|       |#ifdef _WIN32
  255|       |  if(gmtime_s(store, &intime)) /* thread-safe */
  256|       |    return CURLE_BAD_FUNCTION_ARGUMENT;
  257|       |#elif defined(HAVE_GMTIME_R)
  258|       |  const struct tm *tm;
  259|  2.08k|  tm = gmtime_r(&intime, store); /* thread-safe */
  260|  2.08k|  if(!tm)
  ------------------
  |  Branch (260:6): [True: 0, False: 2.08k]
  ------------------
  261|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  262|       |#else
  263|       |  const struct tm *tm;
  264|       |  /* !checksrc! disable BANNEDFUNC 1 */
  265|       |  tm = gmtime(&intime); /* not thread-safe */
  266|       |  if(tm)
  267|       |    *store = *tm; /* copy the pointed struct to the local copy */
  268|       |  else
  269|       |    return CURLE_BAD_FUNCTION_ARGUMENT;
  270|       |#endif
  271|       |
  272|  2.08k|  return CURLE_OK;
  273|  2.08k|}

curlx_wait_ms:
   59|   294k|{
   60|   294k|  int r = 0;
   61|       |
   62|   294k|  if(!timeout_ms)
  ------------------
  |  Branch (62:6): [True: 294k, False: 58]
  ------------------
   63|   294k|    return 0;
   64|     58|  if(timeout_ms < 0) {
  ------------------
  |  Branch (64:6): [True: 0, False: 58]
  ------------------
   65|      0|    SET_SOCKERRNO(SOCKEINVAL);
  ------------------
  |  | 1096|      0|#define SET_SOCKERRNO(x)  (errno = (x))
  ------------------
   66|      0|    return -1;
   67|      0|  }
   68|       |#ifdef MSDOS
   69|       |  delay((unsigned int)timeout_ms);
   70|       |#elif defined(_WIN32)
   71|       |  /* prevent overflow, timeout_ms is typecast to ULONG/DWORD. */
   72|       |#if TIMEDIFF_T_MAX >= ULONG_MAX
   73|       |  if(timeout_ms >= ULONG_MAX)
   74|       |    timeout_ms = ULONG_MAX - 1;
   75|       |    /* do not use ULONG_MAX, because that is equal to INFINITE */
   76|       |#endif
   77|       |  Sleep((DWORD)timeout_ms);
   78|       |#else
   79|       |  /* avoid using poll() for this since it behaves incorrectly with no sockets
   80|       |     on Apple operating systems */
   81|     58|  {
   82|     58|    struct timeval pending_tv;
   83|     58|    r = select(0, NULL, NULL, NULL, curlx_mstotv(&pending_tv, timeout_ms));
   84|     58|  }
   85|     58|#endif /* _WIN32 */
   86|     58|  if(r) {
  ------------------
  |  Branch (86:6): [True: 0, False: 58]
  ------------------
   87|      0|    if((r == -1) && (SOCKERRNO == SOCKEINTR))
  ------------------
  |  | 1095|      0|#define SOCKERRNO         errno
  ------------------
                  if((r == -1) && (SOCKERRNO == SOCKEINTR))
  ------------------
  |  | 1129|      0|#define SOCKEINTR         EINTR
  ------------------
  |  Branch (87:8): [True: 0, False: 0]
  |  Branch (87:21): [True: 0, False: 0]
  ------------------
   88|       |      /* make EINTR from select or poll not a "lethal" error */
   89|      0|      r = 0;
   90|      0|    else
   91|      0|      r = -1;
   92|      0|  }
   93|     58|  return r;
   94|     58|}

curlx_uztosi:
   73|  14.1k|{
   74|       |#ifdef __INTEL_COMPILER
   75|       |#pragma warning(push)
   76|       |#pragma warning(disable:810) /* conversion may lose significant bits */
   77|       |#endif
   78|       |
   79|  14.1k|  DEBUGASSERT(uznum <= (size_t)CURL_MASK_SINT);
  ------------------
  |  | 1081|  14.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (79:3): [True: 0, False: 14.1k]
  |  Branch (79:3): [True: 14.1k, False: 0]
  ------------------
   80|  14.1k|  return (int)(uznum & (size_t)CURL_MASK_SINT);
  ------------------
  |  |   44|  14.1k|#define CURL_MASK_SINT    (CURL_MASK_UINT >> 1)
  |  |  ------------------
  |  |  |  |   43|  14.1k|#define CURL_MASK_UINT    ((unsigned int)~0)
  |  |  ------------------
  ------------------
   81|       |
   82|       |#ifdef __INTEL_COMPILER
   83|       |#pragma warning(pop)
   84|       |#endif
   85|  14.1k|}
curlx_uztoui:
  111|  10.0k|{
  112|       |#ifdef __INTEL_COMPILER
  113|       |#pragma warning(push)
  114|       |#pragma warning(disable:810) /* conversion may lose significant bits */
  115|       |#endif
  116|       |
  117|  10.0k|#if UINT_MAX < SIZE_MAX
  118|  10.0k|  DEBUGASSERT(uznum <= (size_t)CURL_MASK_UINT);
  ------------------
  |  | 1081|  10.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (118:3): [True: 0, False: 10.0k]
  |  Branch (118:3): [True: 10.0k, False: 0]
  ------------------
  119|  10.0k|#endif
  120|  10.0k|  return (unsigned int)(uznum & (size_t)CURL_MASK_UINT);
  ------------------
  |  |   43|  10.0k|#define CURL_MASK_UINT    ((unsigned int)~0)
  ------------------
  121|       |
  122|       |#ifdef __INTEL_COMPILER
  123|       |#pragma warning(pop)
  124|       |#endif
  125|  10.0k|}
curlx_sltosi:
  131|     99|{
  132|       |#ifdef __INTEL_COMPILER
  133|       |#pragma warning(push)
  134|       |#pragma warning(disable:810) /* conversion may lose significant bits */
  135|       |#endif
  136|       |
  137|     99|  DEBUGASSERT(slnum >= 0);
  ------------------
  |  | 1081|     99|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (137:3): [True: 0, False: 99]
  |  Branch (137:3): [True: 99, False: 0]
  ------------------
  138|     99|#if INT_MAX < LONG_MAX
  139|     99|  DEBUGASSERT((unsigned long)slnum <= (unsigned long)CURL_MASK_SINT);
  ------------------
  |  | 1081|     99|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (139:3): [True: 0, False: 99]
  |  Branch (139:3): [True: 99, False: 0]
  ------------------
  140|     99|#endif
  141|     99|  return (int)(slnum & (long)CURL_MASK_SINT);
  ------------------
  |  |   44|     99|#define CURL_MASK_SINT    (CURL_MASK_UINT >> 1)
  |  |  ------------------
  |  |  |  |   43|     99|#define CURL_MASK_UINT    ((unsigned int)~0)
  |  |  ------------------
  ------------------
  142|       |
  143|       |#ifdef __INTEL_COMPILER
  144|       |#pragma warning(pop)
  145|       |#endif
  146|     99|}
curlx_sltous:
  173|     68|{
  174|       |#ifdef __INTEL_COMPILER
  175|       |#pragma warning(push)
  176|       |#pragma warning(disable:810) /* conversion may lose significant bits */
  177|       |#endif
  178|       |
  179|     68|  DEBUGASSERT(slnum >= 0);
  ------------------
  |  | 1081|     68|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (179:3): [True: 0, False: 68]
  |  Branch (179:3): [True: 68, False: 0]
  ------------------
  180|     68|  DEBUGASSERT((unsigned long)slnum <= (unsigned long)CURL_MASK_USHORT);
  ------------------
  |  | 1081|     68|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (180:3): [True: 0, False: 68]
  |  Branch (180:3): [True: 68, False: 0]
  ------------------
  181|     68|  return (unsigned short)(slnum & (long)CURL_MASK_USHORT);
  ------------------
  |  |   41|     68|#define CURL_MASK_USHORT  ((unsigned short)~0)
  ------------------
  182|       |
  183|       |#ifdef __INTEL_COMPILER
  184|       |#pragma warning(pop)
  185|       |#endif
  186|     68|}
curlx_sotouz:
  210|  1.16M|{
  211|       |#ifdef __INTEL_COMPILER
  212|       |#pragma warning(push)
  213|       |#pragma warning(disable:810) /* conversion may lose significant bits */
  214|       |#endif
  215|       |
  216|  1.16M|  DEBUGASSERT(sonum >= 0);
  ------------------
  |  | 1081|  1.16M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (216:3): [True: 0, False: 1.16M]
  |  Branch (216:3): [True: 1.16M, False: 0]
  ------------------
  217|  1.16M|  return (size_t)(sonum & (curl_off_t)CURL_MASK_USIZE_T);
  ------------------
  |  |   48|  1.16M|#define CURL_MASK_USIZE_T ((size_t)~0)
  ------------------
  218|       |
  219|       |#ifdef __INTEL_COMPILER
  220|       |#pragma warning(pop)
  221|       |#endif
  222|  1.16M|}
curlx_uitouz:
  282|  3.36M|{
  283|  3.36M|  return (size_t)uinum;
  284|  3.36M|}
curlx_sotouz_range:
  287|  1.43k|{
  288|  1.43k|  if(sonum < 0)
  ------------------
  |  Branch (288:6): [True: 0, False: 1.43k]
  ------------------
  289|      0|    return uzmin;
  290|       |#if SIZEOF_CURL_OFF_T > SIZEOF_SIZE_T
  291|       |  if(sonum > SIZE_MAX)
  292|       |    return uzmax;
  293|       |#endif
  294|  1.43k|  return CURLMIN(CURLMAX((size_t)sonum, uzmin), uzmax);
  ------------------
  |  | 1287|  2.87k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 1.18k, False: 248]
  |  |  |  Branch (1287:25): [True: 1.25k, False: 178]
  |  |  |  Branch (1287:37): [True: 1.01k, False: 178]
  |  |  ------------------
  ------------------
  295|  1.43k|}
curlx_sztouz:
  298|  4.84M|{
  299|  4.84M|  if(sznum < 0) {
  ------------------
  |  Branch (299:6): [True: 3.25M, False: 1.58M]
  ------------------
  300|  3.25M|    *puznum = 0;
  301|  3.25M|    return FALSE;
  ------------------
  |  | 1058|  3.25M|#define FALSE false
  ------------------
  302|  3.25M|  }
  303|  1.58M|  *puznum = (size_t)sznum;
  304|       |  return TRUE;
  ------------------
  |  | 1055|  1.58M|#define TRUE true
  ------------------
  305|  4.84M|}

Curl_cw_out_is_paused:
  459|   946k|{
  460|   946k|  struct Curl_cwriter *cw_out;
  461|   946k|  struct cw_out_ctx *ctx;
  462|       |
  463|   946k|  cw_out = Curl_cwriter_get_by_type(data, &Curl_cwt_out);
  464|   946k|  if(!cw_out)
  ------------------
  |  Branch (464:6): [True: 0, False: 946k]
  ------------------
  465|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  466|       |
  467|   946k|  ctx = (struct cw_out_ctx *)cw_out;
  468|   946k|  return (bool)ctx->paused;
  469|   946k|}
Curl_cw_out_done:
  510|  13.8k|{
  511|  13.8k|  struct Curl_cwriter *cw_out;
  512|  13.8k|  CURLcode result = CURLE_OK;
  513|       |
  514|  13.8k|  cw_out = Curl_cwriter_get_by_type(data, &Curl_cwt_out);
  515|  13.8k|  if(cw_out) {
  ------------------
  |  Branch (515:6): [True: 10.5k, False: 3.30k]
  ------------------
  516|  10.5k|    CURL_TRC_WRITE(data, "[OUT] done");
  ------------------
  |  |  158|  10.5k|  do {                                                     \
  |  |  159|  10.5k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|  10.5k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  21.1k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 10.5k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 10.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  21.1k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  10.5k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|  10.5k|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|  10.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 10.5k]
  |  |  ------------------
  ------------------
  517|  10.5k|    result = Curl_cw_pause_flush(data);
  518|  10.5k|    if(!result)
  ------------------
  |  Branch (518:8): [True: 10.5k, False: 0]
  ------------------
  519|  10.5k|      result = cw_out_flush(data, cw_out, TRUE);
  ------------------
  |  | 1055|  10.5k|#define TRUE true
  ------------------
  520|  10.5k|  }
  521|  13.8k|  return result;
  522|  13.8k|}
cw-out.c:cw_out_init:
  106|  17.1k|{
  107|  17.1k|  struct cw_out_ctx *ctx = writer->ctx;
  108|  17.1k|  (void)data;
  109|       |  ctx->buf = NULL;
  110|  17.1k|  return CURLE_OK;
  111|  17.1k|}
cw-out.c:cw_out_write:
  426|   946k|{
  427|   946k|  struct cw_out_ctx *ctx = writer->ctx;
  428|   946k|  CURLcode result;
  429|   946k|  bool flush_all = !!(type & CLIENTWRITE_EOS);
  ------------------
  |  |   49|   946k|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
  430|       |
  431|   946k|  if((type & CLIENTWRITE_BODY) ||
  ------------------
  |  |   42|   946k|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  |  Branch (431:6): [True: 9.61k, False: 937k]
  ------------------
  432|   937k|     ((type & CLIENTWRITE_HEADER) && data->set.include_header)) {
  ------------------
  |  |   44|   937k|#define CLIENTWRITE_HEADER  (1 << 2) /* meta information, HEADER */
  ------------------
  |  Branch (432:7): [True: 103k, False: 833k]
  |  Branch (432:38): [True: 683, False: 102k]
  ------------------
  433|  10.2k|    cw_out_type otype = (!blen && (type & CLIENTWRITE_0LEN)) ?
  ------------------
  |  |   50|    766|#define CLIENTWRITE_0LEN    (1 << 8) /* write even 0-length buffers */
  ------------------
  |  Branch (433:26): [True: 766, False: 9.53k]
  |  Branch (433:35): [True: 0, False: 766]
  ------------------
  434|  10.2k|                        CW_OUT_BODY_0LEN : CW_OUT_BODY;
  435|  10.2k|    result = cw_out_do_write(ctx, data, otype, flush_all, buf, blen);
  436|  10.2k|    if(result)
  ------------------
  |  Branch (436:8): [True: 4, False: 10.2k]
  ------------------
  437|      4|      return result;
  438|  10.2k|  }
  439|       |
  440|   946k|  if(type & (CLIENTWRITE_HEADER | CLIENTWRITE_INFO)) {
  ------------------
  |  |   44|   946k|#define CLIENTWRITE_HEADER  (1 << 2) /* meta information, HEADER */
  ------------------
                if(type & (CLIENTWRITE_HEADER | CLIENTWRITE_INFO)) {
  ------------------
  |  |   43|   946k|#define CLIENTWRITE_INFO    (1 << 1) /* meta information, not a HEADER */
  ------------------
  |  Branch (440:6): [True: 937k, False: 9.61k]
  ------------------
  441|   937k|    result = cw_out_do_write(ctx, data, CW_OUT_HDS, flush_all, buf, blen);
  442|   937k|    if(result)
  ------------------
  |  Branch (442:8): [True: 0, False: 937k]
  ------------------
  443|      0|      return result;
  444|   937k|  }
  445|       |
  446|   946k|  return CURLE_OK;
  447|   946k|}
cw-out.c:cw_out_do_write:
  376|   947k|{
  377|   947k|  CURLcode result = CURLE_OK;
  378|       |
  379|       |  /* if we have buffered data and it is a different type than what
  380|       |   * we are writing now, try to flush all */
  381|   947k|  if(ctx->buf && ctx->buf->type != otype) {
  ------------------
  |  Branch (381:6): [True: 0, False: 947k]
  |  Branch (381:18): [True: 0, False: 0]
  ------------------
  382|      0|    result = cw_out_flush_chain(ctx, data, &ctx->buf, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  383|      0|    if(result)
  ------------------
  |  Branch (383:8): [True: 0, False: 0]
  ------------------
  384|      0|      goto out;
  385|      0|  }
  386|       |
  387|   947k|  if(ctx->buf) {
  ------------------
  |  Branch (387:6): [True: 0, False: 947k]
  ------------------
  388|       |    /* still have buffered data, append and flush */
  389|      0|    result = cw_out_append(ctx, data, otype, buf, blen);
  390|      0|    if(result)
  ------------------
  |  Branch (390:8): [True: 0, False: 0]
  ------------------
  391|      0|      goto out;
  392|      0|    result = cw_out_flush_chain(ctx, data, &ctx->buf, flush_all);
  393|      0|    if(result)
  ------------------
  |  Branch (393:8): [True: 0, False: 0]
  ------------------
  394|      0|      goto out;
  395|      0|  }
  396|   947k|  else {
  397|       |    /* nothing buffered, try direct write */
  398|   947k|    size_t consumed;
  399|   947k|    result = cw_out_ptr_flush(ctx, data, otype, flush_all,
  400|   947k|                              buf, blen, &consumed);
  401|   947k|    if(result && (result != CURLE_AGAIN))
  ------------------
  |  Branch (401:8): [True: 4, False: 947k]
  |  Branch (401:18): [True: 4, False: 0]
  ------------------
  402|      4|      return result;
  403|   947k|    result = CURLE_OK;
  404|   947k|    if(consumed < blen) {
  ------------------
  |  Branch (404:8): [True: 0, False: 947k]
  ------------------
  405|       |      /* did not write all, append the rest */
  406|      0|      result = cw_out_append(ctx, data, otype,
  407|      0|                             buf + consumed, blen - consumed);
  408|      0|      if(result)
  ------------------
  |  Branch (408:10): [True: 0, False: 0]
  ------------------
  409|      0|        goto out;
  410|      0|    }
  411|   947k|  }
  412|       |
  413|   947k|out:
  414|   947k|  if(result) {
  ------------------
  |  Branch (414:6): [True: 0, False: 947k]
  ------------------
  415|       |    /* We do not want to invoked client callbacks a second time after
  416|       |     * encountering an error. See issue #13337 */
  417|       |    ctx->errored = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  418|      0|    cw_out_bufs_free(ctx);
  419|      0|  }
  420|   947k|  return result;
  421|   947k|}
cw-out.c:cw_out_flush_chain:
  311|  10.5k|{
  312|  10.5k|  struct cw_out_buf *cwbuf = *pcwbuf;
  313|  10.5k|  CURLcode result;
  314|       |
  315|  10.5k|  if(!cwbuf)
  ------------------
  |  Branch (315:6): [True: 10.5k, False: 0]
  ------------------
  316|  10.5k|    return CURLE_OK;
  317|      0|  if(ctx->paused)
  ------------------
  |  Branch (317:6): [True: 0, False: 0]
  ------------------
  318|      0|    return CURLE_OK;
  319|       |
  320|       |  /* write the end of the chain until it blocks or gets empty */
  321|      0|  while(cwbuf->next) {
  ------------------
  |  Branch (321:9): [True: 0, False: 0]
  ------------------
  322|      0|    struct cw_out_buf **plast = &cwbuf->next;
  323|      0|    while((*plast)->next)
  ------------------
  |  Branch (323:11): [True: 0, False: 0]
  ------------------
  324|      0|      plast = &(*plast)->next;
  325|      0|    result = cw_out_flush_chain(ctx, data, plast, flush_all);
  326|      0|    if(result)
  ------------------
  |  Branch (326:8): [True: 0, False: 0]
  ------------------
  327|      0|      return result;
  328|      0|    if(*plast) {
  ------------------
  |  Branch (328:8): [True: 0, False: 0]
  ------------------
  329|       |      /* could not write last, paused again? */
  330|      0|      DEBUGASSERT(ctx->paused);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (330:7): [True: 0, False: 0]
  |  Branch (330:7): [True: 0, False: 0]
  ------------------
  331|      0|      return CURLE_OK;
  332|      0|    }
  333|      0|  }
  334|       |
  335|      0|  result = cw_out_buf_flush(ctx, data, cwbuf, flush_all);
  336|      0|  if(result)
  ------------------
  |  Branch (336:6): [True: 0, False: 0]
  ------------------
  337|      0|    return result;
  338|      0|  if(!curlx_dyn_len(&cwbuf->b)) {
  ------------------
  |  Branch (338:6): [True: 0, False: 0]
  ------------------
  339|      0|    cw_out_buf_free(cwbuf);
  340|       |    *pcwbuf = NULL;
  341|      0|  }
  342|      0|  return CURLE_OK;
  343|      0|}
cw-out.c:cw_out_ptr_flush:
  227|   947k|{
  228|   947k|  curl_write_callback wcb = NULL;
  229|   947k|  void *wcb_data;
  230|   947k|  size_t max_write, min_write;
  231|   947k|  size_t wlen, nwritten = 0;
  232|   947k|  CURLcode result = CURLE_OK;
  233|       |
  234|       |  /* If we errored once, we do not invoke the client callback again */
  235|   947k|  if(ctx->errored)
  ------------------
  |  Branch (235:6): [True: 0, False: 947k]
  ------------------
  236|      0|    return CURLE_WRITE_ERROR;
  237|       |
  238|       |  /* write callbacks may get NULLed by the client between calls. */
  239|   947k|  cw_get_writefunc(data, otype, &wcb, &wcb_data, &max_write, &min_write);
  240|   947k|  if(!wcb) {
  ------------------
  |  Branch (240:6): [True: 937k, False: 10.2k]
  ------------------
  241|   937k|    *pconsumed = blen;
  242|   937k|    return CURLE_OK;
  243|   937k|  }
  244|       |
  245|  10.2k|  *pconsumed = 0;
  246|  10.2k|  if(otype == CW_OUT_BODY_0LEN) {
  ------------------
  |  Branch (246:6): [True: 0, False: 10.2k]
  ------------------
  247|      0|    DEBUGASSERT(!blen);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (247:5): [True: 0, False: 0]
  |  Branch (247:5): [True: 0, False: 0]
  ------------------
  248|      0|    return cw_out_cb_write(ctx, data, wcb, wcb_data, otype,
  249|      0|                           buf, blen, &nwritten);
  250|      0|  }
  251|  10.2k|  else {
  252|  19.8k|    while(blen && !ctx->paused) {
  ------------------
  |  Branch (252:11): [True: 9.53k, False: 10.2k]
  |  Branch (252:19): [True: 9.53k, False: 0]
  ------------------
  253|  9.53k|      if(!flush_all && blen < min_write)
  ------------------
  |  Branch (253:10): [True: 9.49k, False: 32]
  |  Branch (253:24): [True: 0, False: 9.49k]
  ------------------
  254|      0|        break;
  255|  9.53k|      wlen = max_write ? CURLMIN(blen, max_write) : blen;
  ------------------
  |  | 1287|  9.53k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 7.71k, False: 1.82k]
  |  |  ------------------
  ------------------
  |  Branch (255:14): [True: 9.53k, False: 0]
  ------------------
  256|  9.53k|      if(otype == CW_OUT_BODY)
  ------------------
  |  Branch (256:10): [True: 9.53k, False: 0]
  ------------------
  257|  9.53k|        result = Curl_pgrs_deliver_check(data, wlen);
  258|  9.53k|      if(!result)
  ------------------
  |  Branch (258:10): [True: 9.52k, False: 4]
  ------------------
  259|  9.52k|        result = cw_out_cb_write(ctx, data, wcb, wcb_data, otype,
  260|  9.52k|                                 buf, wlen, &nwritten);
  261|  9.53k|      if(result)
  ------------------
  |  Branch (261:10): [True: 4, False: 9.52k]
  ------------------
  262|      4|        return result;
  263|  9.52k|      if(otype == CW_OUT_BODY)
  ------------------
  |  Branch (263:10): [True: 9.52k, False: 0]
  ------------------
  264|  9.52k|        Curl_pgrs_deliver_inc(data, nwritten);
  265|  9.52k|      *pconsumed += nwritten;
  266|  9.52k|      blen -= nwritten;
  267|  9.52k|      buf += nwritten;
  268|  9.52k|    }
  269|  10.2k|  }
  270|  10.2k|  return CURLE_OK;
  271|  10.2k|}
cw-out.c:cw_get_writefunc:
  147|   947k|{
  148|   947k|  switch(otype) {
  149|  10.2k|  case CW_OUT_BODY:
  ------------------
  |  Branch (149:3): [True: 10.2k, False: 937k]
  ------------------
  150|  10.2k|  case CW_OUT_BODY_0LEN:
  ------------------
  |  Branch (150:3): [True: 0, False: 947k]
  ------------------
  151|  10.2k|    *pwcb = data->set.fwrite_func;
  152|  10.2k|    *pwcb_data = data->set.out;
  153|  10.2k|    *pmax_write = CURL_MAX_WRITE_SIZE;
  ------------------
  |  |  265|  10.2k|#define CURL_MAX_WRITE_SIZE 16384
  ------------------
  154|       |    /* if we ever want buffering of BODY output, we can set `min_write`
  155|       |     * the preferred size. The default should always be to pass data
  156|       |     * to the client as it comes without delay */
  157|  10.2k|    *pmin_write = 0;
  158|  10.2k|    break;
  159|   937k|  case CW_OUT_HDS:
  ------------------
  |  Branch (159:3): [True: 937k, False: 10.2k]
  ------------------
  160|   937k|    *pwcb = data->set.fwrite_header ? data->set.fwrite_header :
  ------------------
  |  Branch (160:13): [True: 0, False: 937k]
  ------------------
  161|   937k|             (data->set.writeheader ? data->set.fwrite_func : NULL);
  ------------------
  |  Branch (161:15): [True: 0, False: 937k]
  ------------------
  162|   937k|    *pwcb_data = data->set.writeheader;
  163|   937k|    *pmax_write = 0; /* do not chunk-write headers, write them as they are */
  164|   937k|    *pmin_write = 0;
  165|   937k|    break;
  166|      0|  default:
  ------------------
  |  Branch (166:3): [True: 0, False: 947k]
  ------------------
  167|      0|    *pwcb = NULL;
  168|      0|    *pwcb_data = NULL;
  169|      0|    *pmax_write = CURL_MAX_WRITE_SIZE;
  ------------------
  |  |  265|      0|#define CURL_MAX_WRITE_SIZE 16384
  ------------------
  170|      0|    *pmin_write = 0;
  171|   947k|  }
  172|   947k|}
cw-out.c:cw_out_cb_write:
  181|  9.52k|{
  182|  9.52k|  size_t nwritten;
  183|  9.52k|  CURLcode result;
  184|       |
  185|  9.52k|  NOVERBOSE((void)otype);
  ------------------
  |  | 1619|  9.52k|#define NOVERBOSE(x) Curl_nop_stmt
  |  |  ------------------
  |  |  |  | 1180|  9.52k|#define Curl_nop_stmt do {} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1180:35): [Folded, False: 9.52k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  186|       |
  187|  9.52k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|  9.52k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (187:3): [True: 0, False: 9.52k]
  |  Branch (187:3): [True: 9.52k, False: 0]
  ------------------
  188|  9.52k|  *pnwritten = 0;
  189|  9.52k|  Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|  9.52k|#define TRUE true
  ------------------
  190|  9.52k|  nwritten = wcb((char *)CURL_UNCONST(buf), 1, blen, wcb_data);
  ------------------
  |  |  866|  9.52k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  191|  9.52k|  Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|  9.52k|#define FALSE false
  ------------------
  192|  9.52k|  CURL_TRC_WRITE(data, "[OUT] wrote %zu %s bytes -> %zu",
  ------------------
  |  |  158|  9.52k|  do {                                                     \
  |  |  159|  9.52k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|  9.52k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  19.0k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 9.52k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 9.52k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  19.0k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.52k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|  9.52k|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (160:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  161|  9.52k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 9.52k]
  |  |  ------------------
  ------------------
  193|  9.52k|                 blen, (otype == CW_OUT_HDS) ? "header" : "body",
  194|  9.52k|                 nwritten);
  195|  9.52k|  if(nwritten == CURL_WRITEFUNC_PAUSE) {
  ------------------
  |  |  277|  9.52k|#define CURL_WRITEFUNC_PAUSE 0x10000001
  ------------------
  |  Branch (195:6): [True: 0, False: 9.52k]
  ------------------
  196|      0|    if(data->conn->scheme->flags & PROTOPT_NONETWORK) {
  ------------------
  |  |  215|      0|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (196:8): [True: 0, False: 0]
  ------------------
  197|       |      /* Protocols that work without network cannot be paused. This is
  198|       |         actually only file:// now, and it cannot pause since the transfer is
  199|       |         not done using the "normal" procedure. */
  200|      0|      failf(data, "Write callback asked for PAUSE when not supported");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  201|      0|      return CURLE_WRITE_ERROR;
  202|      0|    }
  203|      0|    ctx->paused = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  204|      0|    CURL_TRC_WRITE(data, "[OUT] PAUSE requested by client");
  ------------------
  |  |  158|      0|  do {                                                     \
  |  |  159|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|      0|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  205|      0|    result = Curl_xfer_pause_recv(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  206|      0|    return result ? result : CURLE_AGAIN;
  ------------------
  |  Branch (206:12): [True: 0, False: 0]
  ------------------
  207|      0|  }
  208|  9.52k|  else if(nwritten == CURL_WRITEFUNC_ERROR) {
  ------------------
  |  |  281|  9.52k|#define CURL_WRITEFUNC_ERROR 0xFFFFFFFF
  ------------------
  |  Branch (208:11): [True: 0, False: 9.52k]
  ------------------
  209|      0|    failf(data, "client returned ERROR on write of %zu bytes", blen);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  210|      0|    return CURLE_WRITE_ERROR;
  211|      0|  }
  212|  9.52k|  else if(nwritten != blen) {
  ------------------
  |  Branch (212:11): [True: 0, False: 9.52k]
  ------------------
  213|      0|    failf(data, "Failure writing output to destination, "
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  214|      0|          "passed %zu returned %zu", blen, nwritten);
  215|      0|    return CURLE_WRITE_ERROR;
  216|      0|  }
  217|  9.52k|  *pnwritten = nwritten;
  218|  9.52k|  return CURLE_OK;
  219|  9.52k|}
cw-out.c:cw_out_bufs_free:
  114|  17.1k|{
  115|  17.1k|  while(ctx->buf) {
  ------------------
  |  Branch (115:9): [True: 0, False: 17.1k]
  ------------------
  116|      0|    struct cw_out_buf *next = ctx->buf->next;
  117|      0|    cw_out_buf_free(ctx->buf);
  118|      0|    ctx->buf = next;
  119|      0|  }
  120|  17.1k|}
cw-out.c:cw_out_close:
  134|  17.1k|{
  135|  17.1k|  struct cw_out_ctx *ctx = writer->ctx;
  136|       |
  137|  17.1k|  (void)data;
  138|  17.1k|  cw_out_bufs_free(ctx);
  139|  17.1k|}
cw-out.c:cw_out_flush:
  474|  10.5k|{
  475|  10.5k|  struct cw_out_ctx *ctx = (struct cw_out_ctx *)cw_out;
  476|  10.5k|  CURLcode result = CURLE_OK;
  477|       |
  478|  10.5k|  if(ctx->errored)
  ------------------
  |  Branch (478:6): [True: 0, False: 10.5k]
  ------------------
  479|      0|    return CURLE_WRITE_ERROR;
  480|  10.5k|  if(ctx->paused)
  ------------------
  |  Branch (480:6): [True: 0, False: 10.5k]
  ------------------
  481|      0|    return CURLE_OK;  /* not doing it */
  482|       |
  483|  10.5k|  result = cw_out_flush_chain(ctx, data, &ctx->buf, flush_all);
  484|  10.5k|  if(result) {
  ------------------
  |  Branch (484:6): [True: 0, False: 10.5k]
  ------------------
  485|      0|    ctx->errored = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  486|      0|    cw_out_bufs_free(ctx);
  487|      0|    return result;
  488|      0|  }
  489|  10.5k|  return result;
  490|  10.5k|}

Curl_cw_pause_flush:
  216|  10.5k|{
  217|  10.5k|  struct Curl_cwriter *cw_pause;
  218|  10.5k|  CURLcode result = CURLE_OK;
  219|       |
  220|  10.5k|  cw_pause = Curl_cwriter_get_by_type(data, &Curl_cwt_pause);
  221|  10.5k|  if(cw_pause)
  ------------------
  |  Branch (221:6): [True: 10.5k, False: 0]
  ------------------
  222|  10.5k|    result = cw_pause_flush(data, cw_pause);
  223|       |
  224|  10.5k|  return result;
  225|  10.5k|}
cw-pause.c:cw_pause_init:
   75|  17.1k|{
   76|  17.1k|  struct cw_pause_ctx *ctx = writer->ctx;
   77|  17.1k|  (void)data;
   78|       |  ctx->buf = NULL;
   79|  17.1k|  return CURLE_OK;
   80|  17.1k|}
cw-pause.c:cw_pause_write:
  145|   944k|{
  146|   944k|  struct cw_pause_ctx *ctx = writer->ctx;
  147|   944k|  CURLcode result = CURLE_OK;
  148|   944k|  size_t wlen = 0;
  149|   944k|  bool decoding = Curl_cwriter_is_content_decoding(data);
  150|       |
  151|   944k|  if(ctx->buf && !Curl_cwriter_is_paused(data)) {
  ------------------
  |  Branch (151:6): [True: 0, False: 944k]
  |  Branch (151:18): [True: 0, False: 0]
  ------------------
  152|      0|    result = cw_pause_flush(data, writer);
  153|      0|    if(result)
  ------------------
  |  Branch (153:8): [True: 0, False: 0]
  ------------------
  154|      0|      return result;
  155|      0|  }
  156|       |
  157|   944k|  while(!ctx->buf && !Curl_cwriter_is_paused(data)) {
  ------------------
  |  Branch (157:9): [True: 944k, False: 0]
  |  Branch (157:22): [True: 944k, False: 0]
  ------------------
  158|   944k|    int wtype = type;
  159|   944k|    DEBUGASSERT(!ctx->buf);
  ------------------
  |  | 1081|   944k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (159:5): [True: 0, False: 944k]
  |  Branch (159:5): [True: 944k, False: 0]
  ------------------
  160|       |    /* content decoding might blow up size considerably, write smaller
  161|       |     * chunks to make pausing need buffer less. */
  162|   944k|    wlen = (decoding && (type & CLIENTWRITE_BODY)) ?
  ------------------
  |  |   42|   511k|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  |  Branch (162:13): [True: 511k, False: 432k]
  |  Branch (162:25): [True: 1.07k, False: 510k]
  ------------------
  163|   943k|           CURLMIN(blen, CW_PAUSE_DEC_WRITE_CHUNK) : blen;
  ------------------
  |  | 1287|  1.07k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 1.07k, False: 0]
  |  |  ------------------
  ------------------
  164|   944k|    if(wlen < blen)
  ------------------
  |  Branch (164:8): [True: 0, False: 944k]
  ------------------
  165|      0|      wtype &= ~CLIENTWRITE_EOS;
  ------------------
  |  |   49|      0|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
  166|   944k|    result = Curl_cwriter_write(data, writer->next, wtype, buf, wlen);
  167|   944k|    CURL_TRC_WRITE(data, "[PAUSE] writing %zu/%zu bytes of type %x -> %d",
  ------------------
  |  |  158|   944k|  do {                                                     \
  |  |  159|   944k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|   944k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  1.88M|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 944k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 944k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  1.88M|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|   944k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|   944k|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|   944k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 944k]
  |  |  ------------------
  ------------------
  168|   944k|                   wlen, blen, wtype, result);
  169|   944k|    if(result)
  ------------------
  |  Branch (169:8): [True: 4, False: 944k]
  ------------------
  170|      4|      return result;
  171|   944k|    buf += wlen;
  172|   944k|    blen -= wlen;
  173|   944k|    if(!blen)
  ------------------
  |  Branch (173:8): [True: 944k, False: 0]
  ------------------
  174|   944k|      return result;
  175|   944k|  }
  176|       |
  177|      0|  do {
  178|      0|    size_t nwritten = 0;
  179|      0|    if(ctx->buf && (ctx->buf->type == type) && (type & CLIENTWRITE_BODY)) {
  ------------------
  |  |   42|      0|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  |  Branch (179:8): [True: 0, False: 0]
  |  Branch (179:20): [True: 0, False: 0]
  |  Branch (179:48): [True: 0, False: 0]
  ------------------
  180|       |      /* same type and body, append to current buffer which has a soft
  181|       |       * limit and should take everything up to OOM. */
  182|      0|      result = Curl_bufq_cwrite(&ctx->buf->b, buf, blen, &nwritten);
  183|      0|    }
  184|      0|    else {
  185|       |      /* Need a new buf, type changed */
  186|      0|      struct cw_pause_buf *cwbuf = cw_pause_buf_create(type, blen);
  187|      0|      if(!cwbuf)
  ------------------
  |  Branch (187:10): [True: 0, False: 0]
  ------------------
  188|      0|        return CURLE_OUT_OF_MEMORY;
  189|      0|      cwbuf->next = ctx->buf;
  190|      0|      ctx->buf = cwbuf;
  191|      0|      result = Curl_bufq_cwrite(&ctx->buf->b, buf, blen, &nwritten);
  192|      0|    }
  193|      0|    CURL_TRC_WRITE(data, "[PAUSE] buffer %zu more bytes of type %x, "
  ------------------
  |  |  158|      0|  do {                                                     \
  |  |  159|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|      0|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  194|      0|                   "total=%zu -> %d", nwritten, type, ctx->buf_total + wlen,
  195|      0|                   result);
  196|      0|    if(result)
  ------------------
  |  Branch (196:8): [True: 0, False: 0]
  ------------------
  197|      0|      return result;
  198|      0|    buf += nwritten;
  199|      0|    blen -= nwritten;
  200|      0|    ctx->buf_total += nwritten;
  201|      0|  } while(blen);
  ------------------
  |  Branch (201:11): [True: 0, False: 0]
  ------------------
  202|       |
  203|      0|  return result;
  204|      0|}
cw-pause.c:cw_pause_close:
   92|  17.1k|{
   93|  17.1k|  struct cw_pause_ctx *ctx = writer->ctx;
   94|       |
   95|  17.1k|  (void)data;
   96|  17.1k|  cw_pause_bufs_free(ctx);
   97|  17.1k|}
cw-pause.c:cw_pause_bufs_free:
   83|  17.1k|{
   84|  17.1k|  while(ctx->buf) {
  ------------------
  |  Branch (84:9): [True: 0, False: 17.1k]
  ------------------
   85|      0|    struct cw_pause_buf *next = ctx->buf->next;
   86|      0|    cw_pause_buf_free(ctx->buf);
   87|      0|    ctx->buf = next;
   88|      0|  }
   89|  17.1k|}
cw-pause.c:cw_pause_flush:
  101|  10.5k|{
  102|  10.5k|  struct cw_pause_ctx *ctx = (struct cw_pause_ctx *)cw_pause;
  103|  10.5k|  bool decoding = Curl_cwriter_is_content_decoding(data);
  104|  10.5k|  CURLcode result = CURLE_OK;
  105|       |
  106|       |  /* write the end of the chain until it blocks or gets empty */
  107|  10.5k|  while(ctx->buf && !Curl_cwriter_is_paused(data)) {
  ------------------
  |  Branch (107:9): [True: 0, False: 10.5k]
  |  Branch (107:21): [True: 0, False: 0]
  ------------------
  108|      0|    struct cw_pause_buf **plast = &ctx->buf;
  109|      0|    size_t blen, wlen = 0;
  110|      0|    const unsigned char *buf = NULL;
  111|       |
  112|      0|    while((*plast)->next) /* got to last in list */
  ------------------
  |  Branch (112:11): [True: 0, False: 0]
  ------------------
  113|      0|      plast = &(*plast)->next;
  114|      0|    if(Curl_bufq_peek(&(*plast)->b, &buf, &blen)) {
  ------------------
  |  Branch (114:8): [True: 0, False: 0]
  ------------------
  115|      0|      wlen = (decoding && ((*plast)->type & CLIENTWRITE_BODY)) ?
  ------------------
  |  |   42|      0|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  |  Branch (115:15): [True: 0, False: 0]
  |  Branch (115:27): [True: 0, False: 0]
  ------------------
  116|      0|             CURLMIN(blen, CW_PAUSE_DEC_WRITE_CHUNK) : blen;
  ------------------
  |  | 1287|      0|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  117|      0|      result = Curl_cwriter_write(data, cw_pause->next, (*plast)->type,
  118|      0|                                  (const char *)buf, wlen);
  119|      0|      CURL_TRC_WRITE(data, "[PAUSE] flushed %zu/%zu bytes, type=%x -> %d",
  ------------------
  |  |  158|      0|  do {                                                     \
  |  |  159|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|      0|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  120|      0|                     wlen, ctx->buf_total, (*plast)->type, result);
  121|      0|      Curl_bufq_skip(&(*plast)->b, wlen);
  122|      0|      DEBUGASSERT(ctx->buf_total >= wlen);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (122:7): [True: 0, False: 0]
  |  Branch (122:7): [True: 0, False: 0]
  ------------------
  123|      0|      ctx->buf_total -= wlen;
  124|      0|      if(result)
  ------------------
  |  Branch (124:10): [True: 0, False: 0]
  ------------------
  125|      0|        return result;
  126|      0|    }
  127|      0|    else if((*plast)->type & CLIENTWRITE_EOS) {
  ------------------
  |  |   49|      0|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
  |  Branch (127:13): [True: 0, False: 0]
  ------------------
  128|      0|      result = Curl_cwriter_write(data, cw_pause->next, (*plast)->type,
  129|      0|                                  (const char *)buf, 0);
  130|      0|      CURL_TRC_WRITE(data, "[PAUSE] flushed 0/%zu bytes, type=%x -> %d",
  ------------------
  |  |  158|      0|  do {                                                     \
  |  |  159|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|      0|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  131|      0|                     ctx->buf_total, (*plast)->type, result);
  132|      0|    }
  133|       |
  134|      0|    if(Curl_bufq_is_empty(&(*plast)->b)) {
  ------------------
  |  Branch (134:8): [True: 0, False: 0]
  ------------------
  135|      0|      cw_pause_buf_free(*plast);
  136|      0|      *plast = NULL;
  137|      0|    }
  138|      0|  }
  139|  10.5k|  return result;
  140|  10.5k|}

Curl_dnscache_prune:
  172|  13.8k|{
  173|  13.8k|  struct Curl_dnscache *dnscache = dnscache_get(data);
  174|       |  /* the timeout may be set -1 (forever) */
  175|  13.8k|  timediff_t timeout_ms = data->set.dns_cache_timeout_ms;
  176|       |
  177|  13.8k|  if(!dnscache || (timeout_ms == -1))
  ------------------
  |  Branch (177:6): [True: 0, False: 13.8k]
  |  Branch (177:19): [True: 0, False: 13.8k]
  ------------------
  178|       |    /* NULL hostcache means we cannot do it */
  179|      0|    return;
  180|       |
  181|  13.8k|  dnscache_lock(data, dnscache);
  182|       |
  183|  13.8k|  do {
  184|       |    /* Remove outdated and unused entries from the hostcache */
  185|  13.8k|    timediff_t oldest_ms =
  186|  13.8k|      dnscache_prune(&dnscache->entries, timeout_ms, *Curl_pgrs_now(data));
  187|       |
  188|  13.8k|    if(Curl_hash_count(&dnscache->entries) > MAX_DNS_CACHE_SIZE)
  ------------------
  |  |   61|  13.8k|#define MAX_DNS_CACHE_SIZE 29999
  ------------------
  |  Branch (188:8): [True: 0, False: 13.8k]
  ------------------
  189|       |      /* prune the ones over half this age */
  190|      0|      timeout_ms = oldest_ms / 2;
  191|  13.8k|    else
  192|  13.8k|      break;
  193|       |
  194|       |    /* if the cache size is still too big, use the oldest age as new prune
  195|       |       limit */
  196|  13.8k|  } while(timeout_ms);
  ------------------
  |  Branch (196:11): [True: 0, False: 0]
  ------------------
  197|       |
  198|  13.8k|  dnscache_unlock(data, dnscache);
  199|  13.8k|}
Curl_dnscache_get:
  299|   317k|{
  300|   317k|  struct Curl_dnscache *dnscache = dnscache_get(data);
  301|   317k|  struct Curl_dns_entry *dns = NULL;
  302|   317k|  CURLcode result = CURLE_OK;
  303|       |
  304|   317k|  dnscache_lock(data, dnscache);
  305|   317k|  result = fetch_addr(data, dnscache, dns_queries, hostname, port, &dns);
  306|   317k|  if(!result && dns)
  ------------------
  |  Branch (306:6): [True: 317k, False: 97]
  |  Branch (306:17): [True: 880, False: 316k]
  ------------------
  307|    880|    dns->refcount++; /* we pass out a reference */
  308|   316k|  else if(result) {
  ------------------
  |  Branch (308:11): [True: 97, False: 316k]
  ------------------
  309|     97|    DEBUGASSERT(!dns);
  ------------------
  |  | 1081|     97|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (309:5): [True: 0, False: 97]
  |  Branch (309:5): [True: 97, False: 0]
  ------------------
  310|     97|    dns = NULL;
  311|     97|  }
  312|   317k|  dnscache_unlock(data, dnscache);
  313|       |
  314|   317k|  *pentry = dns;
  315|   317k|  return result;
  316|   317k|}
dns_shuffle_addr:
  348|     43|{
  349|     43|  CURLcode result = CURLE_OK;
  350|     43|  const int num_addrs = num_addresses(*addr);
  351|       |
  352|     43|  if(num_addrs > 1) {
  ------------------
  |  Branch (352:6): [True: 3, False: 40]
  ------------------
  353|      3|    struct Curl_addrinfo **nodes;
  354|      3|    CURL_TRC_DNS(data, "Shuffling %i addresses", num_addrs);
  ------------------
  |  |  168|      3|  do {                                 \
  |  |  169|      3|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      3|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      3|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      6|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 3, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 3]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      6|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      3|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|      3|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|      3|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 3]
  |  |  ------------------
  ------------------
  355|       |
  356|      3|    nodes = curlx_malloc(num_addrs * sizeof(*nodes));
  ------------------
  |  | 1478|      3|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  357|      3|    if(nodes) {
  ------------------
  |  Branch (357:8): [True: 3, False: 0]
  ------------------
  358|      3|      int i;
  359|      3|      unsigned int *rnd;
  360|      3|      const size_t rnd_size = num_addrs * sizeof(*rnd);
  361|       |
  362|       |      /* build a plain array of Curl_addrinfo pointers */
  363|      3|      nodes[0] = *addr;
  364|      6|      for(i = 1; i < num_addrs; i++) {
  ------------------
  |  Branch (364:18): [True: 3, False: 3]
  ------------------
  365|      3|        nodes[i] = nodes[i - 1]->ai_next;
  366|      3|      }
  367|       |
  368|      3|      rnd = curlx_malloc(rnd_size);
  ------------------
  |  | 1478|      3|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  369|      3|      if(rnd) {
  ------------------
  |  Branch (369:10): [True: 3, False: 0]
  ------------------
  370|       |        /* Fisher-Yates shuffle */
  371|      3|        if(Curl_rand(data, (unsigned char *)rnd, rnd_size) == CURLE_OK) {
  ------------------
  |  |   33|      3|#define Curl_rand(a, b, c) Curl_rand_bytes(a, TRUE, b, c)
  |  |  ------------------
  |  |  |  | 1055|      3|#define TRUE true
  |  |  ------------------
  ------------------
  |  Branch (371:12): [True: 3, False: 0]
  ------------------
  372|      3|          struct Curl_addrinfo *swap_tmp;
  373|      6|          for(i = num_addrs - 1; i > 0; i--) {
  ------------------
  |  Branch (373:34): [True: 3, False: 3]
  ------------------
  374|      3|            swap_tmp = nodes[rnd[i] % (unsigned int)(i + 1)];
  375|      3|            nodes[rnd[i] % (unsigned int)(i + 1)] = nodes[i];
  376|      3|            nodes[i] = swap_tmp;
  377|      3|          }
  378|       |
  379|       |          /* relink list in the new order */
  380|      6|          for(i = 1; i < num_addrs; i++) {
  ------------------
  |  Branch (380:22): [True: 3, False: 3]
  ------------------
  381|      3|            nodes[i - 1]->ai_next = nodes[i];
  382|      3|          }
  383|       |
  384|      3|          nodes[num_addrs - 1]->ai_next = NULL;
  385|      3|          *addr = nodes[0];
  386|      3|        }
  387|      3|        curlx_free(rnd);
  ------------------
  |  | 1483|      3|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  388|      3|      }
  389|      0|      else
  390|      0|        result = CURLE_OUT_OF_MEMORY;
  391|      3|      curlx_free(nodes);
  ------------------
  |  | 1483|      3|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  392|      3|    }
  393|      0|    else
  394|      0|      result = CURLE_OUT_OF_MEMORY;
  395|      3|  }
  396|     43|  return result;
  397|     43|}
Curl_dnscache_mk_entry:
  496|  13.2k|{
  497|  13.2k|  return dnscache_entry_create(data, dns_queries, paddr, NULL, hostname,
  498|  13.2k|                               hostname ? strlen(hostname) : 0,
  ------------------
  |  Branch (498:32): [True: 13.0k, False: 111]
  ------------------
  499|       |                               port, FALSE);
  ------------------
  |  | 1058|  13.2k|#define FALSE false
  ------------------
  500|  13.2k|}
Curl_dnscache_mk_entry2:
  508|     18|{
  509|     18|  return dnscache_entry_create(data, dns_queries, paddr1, paddr2, hostname,
  510|     18|                               hostname ? strlen(hostname) : 0,
  ------------------
  |  Branch (510:32): [True: 18, False: 0]
  ------------------
  511|       |                               port, FALSE);
  ------------------
  |  | 1058|     18|#define FALSE false
  ------------------
  512|     18|}
Curl_dnscache_add:
  569|  13.1k|{
  570|  13.1k|  struct Curl_dnscache *dnscache = dnscache_get(data);
  571|  13.1k|  char id[MAX_HOSTCACHE_LEN];
  572|  13.1k|  size_t idlen;
  573|       |
  574|  13.1k|  if(!dnscache)
  ------------------
  |  Branch (574:6): [True: 0, False: 13.1k]
  ------------------
  575|      0|    return CURLE_FAILED_INIT;
  576|       |  /* Create an entry id, based upon the hostname and port */
  577|  13.1k|  idlen = create_dnscache_id(entry->hostname, 0, entry->port, id, sizeof(id));
  578|       |
  579|       |  /* Store the resolved data in our DNS cache and up ref count */
  580|  13.1k|  dnscache_lock(data, dnscache);
  581|  13.1k|  if(!Curl_hash_add(&dnscache->entries, id, idlen + 1, (void *)entry)) {
  ------------------
  |  Branch (581:6): [True: 0, False: 13.1k]
  ------------------
  582|      0|    dnscache_unlock(data, dnscache);
  583|      0|    return CURLE_OUT_OF_MEMORY;
  584|      0|  }
  585|  13.1k|  entry->refcount++;
  586|  13.1k|  dnscache_unlock(data, dnscache);
  587|  13.1k|  return CURLE_OK;
  588|  13.1k|}
Curl_dnscache_add_negative:
  594|    390|{
  595|    390|  struct Curl_dnscache *dnscache = dnscache_get(data);
  596|    390|  struct Curl_dns_entry *dns;
  597|    390|  DEBUGASSERT(dnscache);
  ------------------
  |  | 1081|    390|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (597:3): [True: 0, False: 390]
  |  Branch (597:3): [True: 390, False: 0]
  ------------------
  598|    390|  if(!dnscache)
  ------------------
  |  Branch (598:6): [True: 0, False: 390]
  ------------------
  599|      0|    return CURLE_FAILED_INIT;
  600|       |
  601|    390|  dnscache_lock(data, dnscache);
  602|       |
  603|       |  /* put this new host in the cache */
  604|    390|  dns = dnscache_add_addr(data, dnscache, dns_queries, NULL,
  605|    390|                          host, strlen(host), port, FALSE);
  ------------------
  |  | 1058|    390|#define FALSE false
  ------------------
  606|    390|  if(dns) {
  ------------------
  |  Branch (606:6): [True: 390, False: 0]
  ------------------
  607|       |    /* release the returned reference; the cache itself will keep the
  608|       |     * entry alive: */
  609|    390|    dns->refcount--;
  610|    390|    dnscache_unlock(data, dnscache);
  611|    390|    CURL_TRC_DNS(data, "cache negative name resolve for %s:%d type=%s",
  ------------------
  |  |  168|    390|  do {                                 \
  |  |  169|    390|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|    390|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|    390|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|    780|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 390, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 390]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|    780|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|    390|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|    390|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|    390|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 390]
  |  |  ------------------
  ------------------
  612|    390|                 host, port, Curl_resolv_query_str(dns_queries));
  613|    390|    return CURLE_OK;
  614|    390|  }
  615|      0|  dnscache_unlock(data, dnscache);
  616|      0|  return CURLE_OUT_OF_MEMORY;
  617|    390|}
Curl_dns_entry_unlink:
  628|  19.4k|{
  629|  19.4k|  if(*pdns) {
  ------------------
  |  Branch (629:6): [True: 14.1k, False: 5.34k]
  ------------------
  630|  14.1k|    struct Curl_dnscache *dnscache = dnscache_get(data);
  631|  14.1k|    struct Curl_dns_entry *dns = *pdns;
  632|  14.1k|    *pdns = NULL;
  633|  14.1k|    dnscache_lock(data, dnscache);
  634|  14.1k|    dns->refcount--;
  635|  14.1k|    if(dns->refcount == 0)
  ------------------
  |  Branch (635:8): [True: 119, False: 13.9k]
  ------------------
  636|    119|      dnscache_entry_free(dns);
  637|  14.1k|    dnscache_unlock(data, dnscache);
  638|  14.1k|  }
  639|  19.4k|}
Curl_dnscache_init:
  654|  17.2k|{
  655|  17.2k|  Curl_hash_init(&dns->entries, size, Curl_hash_str, curlx_str_key_compare,
  656|  17.2k|                 dnscache_entry_dtor);
  657|  17.2k|}
Curl_dnscache_destroy:
  660|  17.2k|{
  661|  17.2k|  Curl_hash_destroy(&dns->entries);
  662|  17.2k|}
dnscache.c:dnscache_get:
  145|   359k|{
  146|   359k|  if(data->share && data->share->specifier & (1 << CURL_LOCK_DATA_DNS))
  ------------------
  |  Branch (146:6): [True: 0, False: 359k]
  |  Branch (146:21): [True: 0, False: 0]
  ------------------
  147|      0|    return &data->share->dnscache;
  148|   359k|  if(data->multi)
  ------------------
  |  Branch (148:6): [True: 359k, False: 0]
  ------------------
  149|   359k|    return &data->multi->dnscache;
  150|      0|  return NULL;
  151|   359k|}
dnscache.c:dnscache_lock:
  155|   359k|{
  156|   359k|  if(data->share && dnscache == &data->share->dnscache)
  ------------------
  |  Branch (156:6): [True: 0, False: 359k]
  |  Branch (156:21): [True: 0, False: 0]
  ------------------
  157|      0|    Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
  158|   359k|}
dnscache.c:dnscache_prune:
  130|  13.8k|{
  131|  13.8k|  struct dnscache_prune_data user;
  132|       |
  133|  13.8k|  user.max_age_ms = cache_timeout_ms;
  134|  13.8k|  user.now = now;
  135|  13.8k|  user.oldest_ms = 0;
  136|       |
  137|  13.8k|  Curl_hash_clean_with_criterium(hostcache,
  138|  13.8k|                                 (void *)&user,
  139|  13.8k|                                 dnscache_entry_is_stale);
  140|       |
  141|  13.8k|  return user.oldest_ms;
  142|  13.8k|}
dnscache.c:dnscache_entry_is_stale:
  106|  15.7k|{
  107|  15.7k|  struct dnscache_prune_data *prune = (struct dnscache_prune_data *)datap;
  108|  15.7k|  struct Curl_dns_entry *dns = (struct Curl_dns_entry *)hc;
  109|       |
  110|  15.7k|  if(dns->timestamp.tv_sec || dns->timestamp.tv_usec) {
  ------------------
  |  Branch (110:6): [True: 15.7k, False: 0]
  |  Branch (110:31): [True: 0, False: 0]
  ------------------
  111|       |    /* get age in milliseconds */
  112|  15.7k|    timediff_t age = curlx_ptimediff_ms(&prune->now, &dns->timestamp);
  113|  15.7k|    if(!dns->addr)
  ------------------
  |  Branch (113:8): [True: 683, False: 15.0k]
  ------------------
  114|    683|      age *= 2; /* negative entries age twice as fast */
  115|  15.7k|    if(age >= prune->max_age_ms)
  ------------------
  |  Branch (115:8): [True: 8, False: 15.7k]
  ------------------
  116|      8|      return TRUE;
  ------------------
  |  | 1055|      8|#define TRUE true
  ------------------
  117|  15.7k|    if(age > prune->oldest_ms)
  ------------------
  |  Branch (117:8): [True: 2.86k, False: 12.8k]
  ------------------
  118|  2.86k|      prune->oldest_ms = age;
  119|  15.7k|  }
  120|  15.7k|  return FALSE;
  ------------------
  |  | 1058|  15.7k|#define FALSE false
  ------------------
  121|  15.7k|}
dnscache.c:dnscache_unlock:
  162|   359k|{
  163|   359k|  if(data->share && dnscache == &data->share->dnscache)
  ------------------
  |  Branch (163:6): [True: 0, False: 359k]
  |  Branch (163:21): [True: 0, False: 0]
  ------------------
  164|      0|    Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
  165|   359k|}
dnscache.c:fetch_addr:
  218|   317k|{
  219|   317k|  struct Curl_dns_entry *dns = NULL;
  220|   317k|  char entry_id[MAX_HOSTCACHE_LEN];
  221|   317k|  size_t entry_len;
  222|   317k|  CURLcode result = CURLE_OK;
  223|       |
  224|   317k|  *pdns = NULL;
  225|   317k|  if(!dnscache)
  ------------------
  |  Branch (225:6): [True: 0, False: 317k]
  ------------------
  226|      0|    return CURLE_OK;
  227|       |
  228|       |  /* Create an entry id, based upon the hostname and port */
  229|   317k|  entry_len = create_dnscache_id(hostname, 0, port,
  230|   317k|                                 entry_id, sizeof(entry_id));
  231|       |
  232|       |  /* See if it is already in our dns cache */
  233|   317k|  dns = Curl_hash_pick(&dnscache->entries, entry_id, entry_len + 1);
  234|       |
  235|       |  /* No entry found in cache, check if we might have a wildcard entry */
  236|   317k|  if(!dns && data->state.wildcard_resolve) {
  ------------------
  |  Branch (236:6): [True: 316k, False: 977]
  |  Branch (236:14): [True: 0, False: 316k]
  ------------------
  237|      0|    entry_len = create_dnscache_id("*", 1, port, entry_id, sizeof(entry_id));
  238|       |
  239|       |    /* See if it is already in our dns cache */
  240|      0|    dns = Curl_hash_pick(&dnscache->entries, entry_id, entry_len + 1);
  241|      0|  }
  242|       |
  243|   317k|  if(dns && (data->set.dns_cache_timeout_ms != -1)) {
  ------------------
  |  Branch (243:6): [True: 977, False: 316k]
  |  Branch (243:13): [True: 977, False: 0]
  ------------------
  244|       |    /* See whether the returned entry is stale. Done before we release lock */
  245|    977|    struct dnscache_prune_data user;
  246|       |
  247|    977|    user.now = *Curl_pgrs_now(data);
  248|    977|    user.max_age_ms = data->set.dns_cache_timeout_ms;
  249|    977|    user.oldest_ms = 0;
  250|       |
  251|    977|    if(dnscache_entry_is_stale(&user, dns)) {
  ------------------
  |  Branch (251:8): [True: 0, False: 977]
  ------------------
  252|      0|      infof(data, "Hostname in DNS cache was stale, zapped");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  253|      0|      dns = NULL; /* the memory deallocation is being handled by the hash */
  254|      0|      Curl_hash_delete(&dnscache->entries, entry_id, entry_len + 1);
  255|      0|    }
  256|    977|  }
  257|       |
  258|   317k|  if(dns) {
  ------------------
  |  Branch (258:6): [True: 977, False: 316k]
  ------------------
  259|    977|    if((dns->dns_queries & dns_queries) != dns_queries) {
  ------------------
  |  Branch (259:8): [True: 0, False: 977]
  ------------------
  260|       |      /* The entry does not cover all wanted DNS queries, a miss. */
  261|      0|      dns = NULL;
  262|      0|    }
  263|    977|    else if(!(dns->dns_responses & dns_queries)) {
  ------------------
  |  Branch (263:13): [True: 97, False: 880]
  ------------------
  264|       |      /* The entry has no responses for the wanted DNS queries. */
  265|     97|      CURL_TRC_DNS(data, "cache entry does not have type=%s addresses",
  ------------------
  |  |  168|     97|  do {                                 \
  |  |  169|     97|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|     97|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|     97|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|    194|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 97, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 97]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|    194|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|     97|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|     97|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|     97|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 97]
  |  |  ------------------
  ------------------
  266|     97|                   Curl_resolv_query_str(dns_queries));
  267|     97|      dns = NULL;
  268|     97|      result = CURLE_COULDNT_RESOLVE_HOST;
  269|     97|    }
  270|    977|  }
  271|       |
  272|   317k|  if(dns && !dns->addr) { /* negative entry */
  ------------------
  |  Branch (272:6): [True: 880, False: 316k]
  |  Branch (272:13): [True: 0, False: 880]
  ------------------
  273|       |    dns = NULL;
  274|      0|    result = CURLE_COULDNT_RESOLVE_HOST;
  275|      0|  }
  276|   317k|  *pdns = dns;
  277|   317k|  return result;
  278|   317k|}
dnscache.c:num_addresses:
  323|     43|{
  324|     43|  int i = 0;
  325|     89|  while(addr) {
  ------------------
  |  Branch (325:9): [True: 46, False: 43]
  ------------------
  326|     46|    addr = addr->ai_next;
  327|     46|    i++;
  328|     46|  }
  329|     43|  return i;
  330|     43|}
dnscache.c:dnscache_entry_create:
  419|  13.6k|{
  420|  13.6k|  struct Curl_dns_entry *dns = NULL;
  421|       |
  422|       |  /* Create a new cache entry, struct already has the hostname NUL */
  423|  13.6k|  dns = curlx_calloc(1, sizeof(struct Curl_dns_entry) + hostlen);
  ------------------
  |  | 1480|  13.6k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  424|  13.6k|  if(!dns)
  ------------------
  |  Branch (424:6): [True: 0, False: 13.6k]
  ------------------
  425|      0|    goto out;
  426|       |
  427|  13.6k|  dns->refcount = 1; /* the cache has the first reference */
  428|  13.6k|  dns->dns_queries = dns_queries;
  429|  13.6k|  dns->port = port;
  430|  13.6k|  if(hostlen)
  ------------------
  |  Branch (430:6): [True: 13.5k, False: 111]
  ------------------
  431|  13.5k|    memcpy(dns->hostname, hostname, hostlen);
  432|       |
  433|  13.6k|  if(permanent) {
  ------------------
  |  Branch (433:6): [True: 0, False: 13.6k]
  ------------------
  434|      0|    dns->timestamp.tv_sec = 0; /* an entry that never goes stale */
  435|      0|    dns->timestamp.tv_usec = 0; /* an entry that never goes stale */
  436|      0|  }
  437|  13.6k|  else {
  438|  13.6k|    dns->timestamp = *Curl_pgrs_now(data);
  439|  13.6k|  }
  440|       |
  441|       |  /* Take the given address lists into the entry */
  442|  13.6k|  if(paddr1 && *paddr1) {
  ------------------
  |  Branch (442:6): [True: 13.2k, False: 390]
  |  Branch (442:16): [True: 13.2k, False: 0]
  ------------------
  443|  13.2k|    dns->addr = *paddr1;
  444|  13.2k|    *paddr1 = NULL;
  445|  13.2k|  }
  446|  13.6k|  if(paddr2 && *paddr2) {
  ------------------
  |  Branch (446:6): [True: 13, False: 13.6k]
  |  Branch (446:16): [True: 1, False: 12]
  ------------------
  447|      1|    struct Curl_addrinfo **phead = &dns->addr;
  448|      2|    while(*phead)
  ------------------
  |  Branch (448:11): [True: 1, False: 1]
  ------------------
  449|      1|      phead = &(*phead)->ai_next;
  450|      1|    *phead = *paddr2;
  451|      1|    *paddr2 = NULL;
  452|      1|  }
  453|       |
  454|  13.6k|  if((dns_queries & CURL_DNSQ_A) &&
  ------------------
  |  |   51|  13.6k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  |  Branch (454:6): [True: 13.5k, False: 113]
  ------------------
  455|  13.5k|     dnscache_ai_has_family(dns->addr, PF_INET))
  ------------------
  |  Branch (455:6): [True: 13.0k, False: 446]
  ------------------
  456|  13.0k|    dns->dns_responses |= CURL_DNSQ_A;
  ------------------
  |  |   51|  13.0k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  457|       |
  458|  13.6k|#ifdef USE_IPV6
  459|  13.6k|  if((dns_queries & CURL_DNSQ_AAAA) &&
  ------------------
  |  |   52|  13.6k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (459:6): [True: 13.4k, False: 177]
  ------------------
  460|  13.4k|     dnscache_ai_has_family(dns->addr, PF_INET6))
  ------------------
  |  Branch (460:6): [True: 70, False: 13.3k]
  ------------------
  461|     70|    dns->dns_responses |= CURL_DNSQ_AAAA;
  ------------------
  |  |   52|     70|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  462|  13.6k|#endif /* USE_IPV6 */
  463|       |
  464|  13.6k|#ifndef CURL_DISABLE_SHUFFLE_DNS
  465|       |  /* shuffle addresses if requested */
  466|  13.6k|  if(data->set.dns_shuffle_addresses && dns->addr) {
  ------------------
  |  Branch (466:6): [True: 43, False: 13.5k]
  |  Branch (466:41): [True: 43, False: 0]
  ------------------
  467|     43|    CURLcode result = dns_shuffle_addr(data, &dns->addr);
  468|     43|    if(result) {
  ------------------
  |  Branch (468:8): [True: 0, False: 43]
  ------------------
  469|       |      /* free without lock, we are the sole owner */
  470|      0|      dnscache_entry_free(dns);
  471|      0|      dns = NULL;
  472|      0|      goto out;
  473|      0|    }
  474|     43|  }
  475|       |#else
  476|       |  (void)data;
  477|       |#endif
  478|       |
  479|  13.6k|out:
  480|  13.6k|  if(paddr1 && *paddr1) {
  ------------------
  |  Branch (480:6): [True: 13.2k, False: 390]
  |  Branch (480:16): [True: 0, False: 13.2k]
  ------------------
  481|      0|    Curl_freeaddrinfo(*paddr1);
  482|      0|    *paddr1 = NULL;
  483|      0|  }
  484|  13.6k|  if(paddr2 && *paddr2) {
  ------------------
  |  Branch (484:6): [True: 13, False: 13.6k]
  |  Branch (484:16): [True: 0, False: 13]
  ------------------
  485|      0|    Curl_freeaddrinfo(*paddr2);
  486|       |    *paddr2 = NULL;
  487|      0|  }
  488|  13.6k|  return dns;
  489|  13.6k|}
dnscache.c:dnscache_ai_has_family:
  402|  26.9k|{
  403|  40.0k|  for(; ai; ai = ai->ai_next) {
  ------------------
  |  Branch (403:9): [True: 26.1k, False: 13.8k]
  ------------------
  404|  26.1k|    if(ai->ai_family == ai_family)
  ------------------
  |  Branch (404:8): [True: 13.1k, False: 13.0k]
  ------------------
  405|  13.1k|      return TRUE;
  ------------------
  |  | 1055|  13.1k|#define TRUE true
  ------------------
  406|  26.1k|  }
  407|  13.8k|  return FALSE;
  ------------------
  |  | 1058|  13.8k|#define FALSE false
  ------------------
  408|  26.9k|}
dnscache.c:create_dnscache_id:
   82|   331k|{
   83|   331k|  size_t len = nlen ? nlen : strlen(name);
  ------------------
  |  Branch (83:16): [True: 390, False: 330k]
  ------------------
   84|   331k|  DEBUGASSERT(buflen >= MAX_HOSTCACHE_LEN);
  ------------------
  |  | 1081|   331k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (84:3): [True: 0, False: 331k]
  |  Branch (84:3): [True: 331k, False: 0]
  ------------------
   85|   331k|  if(len > (buflen - 7))
  ------------------
  |  Branch (85:6): [True: 2, False: 331k]
  ------------------
   86|      2|    len = buflen - 7;
   87|       |  /* store and lower case the name */
   88|   331k|  Curl_strntolower(ptr, name, len);
   89|   331k|  return curl_msnprintf(&ptr[len], 7, ":%u", port) + len;
   90|   331k|}
dnscache.c:dnscache_add_addr:
  539|    390|{
  540|    390|  char entry_id[MAX_HOSTCACHE_LEN];
  541|    390|  size_t entry_len;
  542|    390|  struct Curl_dns_entry *dns;
  543|    390|  struct Curl_dns_entry *dns2;
  544|       |
  545|    390|  dns = dnscache_entry_create(data, dns_queries, paddr, NULL,
  546|    390|                              hostname, hlen, port, permanent);
  547|    390|  if(!dns)
  ------------------
  |  Branch (547:6): [True: 0, False: 390]
  ------------------
  548|      0|    return NULL;
  549|       |
  550|       |  /* Create an entry id, based upon the hostname and port */
  551|    390|  entry_len = create_dnscache_id(hostname, hlen, port,
  552|    390|                                 entry_id, sizeof(entry_id));
  553|       |
  554|       |  /* Store the resolved data in our DNS cache. */
  555|    390|  dns2 = Curl_hash_add(&dnscache->entries, entry_id, entry_len + 1,
  556|    390|                       (void *)dns);
  557|    390|  if(!dns2) {
  ------------------
  |  Branch (557:6): [True: 0, False: 390]
  ------------------
  558|      0|    dnscache_entry_free(dns);
  559|      0|    return NULL;
  560|      0|  }
  561|       |
  562|    390|  dns = dns2;
  563|    390|  dns->refcount++;         /* mark entry as in-use */
  564|    390|  return dns;
  565|    390|}
dnscache.c:dnscache_entry_free:
   64|  13.6k|{
   65|  13.6k|  Curl_freeaddrinfo(dns->addr);
   66|       |#ifdef USE_HTTPSRR
   67|       |  if(dns->hinfo) {
   68|       |    Curl_httpsrr_cleanup(dns->hinfo);
   69|       |    curlx_free(dns->hinfo);
   70|       |  }
   71|       |#endif
   72|  13.6k|  curlx_free(dns);
  ------------------
  |  | 1483|  13.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   73|  13.6k|}
dnscache.c:dnscache_entry_dtor:
  642|  13.4k|{
  643|  13.4k|  struct Curl_dns_entry *dns = (struct Curl_dns_entry *)entry;
  644|  13.4k|  DEBUGASSERT(dns && (dns->refcount > 0));
  ------------------
  |  | 1081|  13.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (644:3): [True: 0, False: 13.4k]
  |  Branch (644:3): [True: 0, False: 0]
  |  Branch (644:3): [True: 13.4k, False: 0]
  |  Branch (644:3): [True: 13.4k, False: 0]
  ------------------
  645|  13.4k|  dns->refcount--;
  646|  13.4k|  if(dns->refcount == 0)
  ------------------
  |  Branch (646:6): [True: 13.4k, False: 0]
  ------------------
  647|  13.4k|    dnscache_entry_free(dns);
  648|  13.4k|}

doh_req_encode:
   85|    657|{
   86|    657|  const size_t hostlen = strlen(host);
   87|    657|  unsigned char *orig = dnsp;
   88|    657|  const char *hostp = host;
   89|       |
   90|       |  /* The expected output length is 16 bytes more than the length of
   91|       |   * the QNAME-encoding of the hostname.
   92|       |   *
   93|       |   * A valid DNS name may not contain a zero-length label, except at
   94|       |   * the end. For this reason, a name beginning with a dot, or
   95|       |   * containing a sequence of two or more consecutive dots, is invalid
   96|       |   * and cannot be encoded as a QNAME.
   97|       |   *
   98|       |   * If the hostname ends with a trailing dot, the corresponding
   99|       |   * QNAME-encoding is one byte longer than the hostname. If (as is
  100|       |   * also valid) the hostname is shortened by the omission of the
  101|       |   * trailing dot, then its QNAME-encoding will be two bytes longer
  102|       |   * than the hostname.
  103|       |   *
  104|       |   * Each [ label, dot ] pair is encoded as [ length, label ],
  105|       |   * preserving overall length. A final [ label ] without a dot is
  106|       |   * also encoded as [ length, label ], increasing overall length
  107|       |   * by one. The encoding is completed by appending a zero byte,
  108|       |   * representing the zero-length root label, again increasing
  109|       |   * the overall length by one.
  110|       |   */
  111|       |
  112|    657|  size_t expected_len;
  113|    657|  DEBUGASSERT(hostlen);
  ------------------
  |  | 1081|    657|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (113:3): [True: 0, False: 657]
  |  Branch (113:3): [True: 657, False: 0]
  ------------------
  114|    657|  expected_len = 12 + 1 + hostlen + 4;
  115|    657|  if(host[hostlen - 1] != '.')
  ------------------
  |  Branch (115:6): [True: 649, False: 8]
  ------------------
  116|    649|    expected_len++;
  117|       |
  118|    657|  if(expected_len > DOH_MAX_DNSREQ_SIZE)
  ------------------
  |  |   87|    657|#define DOH_MAX_DNSREQ_SIZE (256 + 16)
  ------------------
  |  Branch (118:6): [True: 0, False: 657]
  ------------------
  119|      0|    return DOH_DNS_NAME_TOO_LONG;
  120|       |
  121|    657|  if(len < expected_len)
  ------------------
  |  Branch (121:6): [True: 0, False: 657]
  ------------------
  122|      0|    return DOH_TOO_SMALL_BUFFER;
  123|       |
  124|    657|  *dnsp++ = 0; /* 16-bit id */
  125|    657|  *dnsp++ = 0;
  126|    657|  *dnsp++ = 0x01; /* |QR|   Opcode  |AA|TC|RD| Set the RD bit */
  127|    657|  *dnsp++ = '\0'; /* |RA|   Z    |   RCODE   |                */
  128|    657|  *dnsp++ = '\0';
  129|    657|  *dnsp++ = 1;    /* QDCOUNT (number of entries in the question section) */
  130|    657|  *dnsp++ = '\0';
  131|    657|  *dnsp++ = '\0'; /* ANCOUNT */
  132|    657|  *dnsp++ = '\0';
  133|    657|  *dnsp++ = '\0'; /* NSCOUNT */
  134|    657|  *dnsp++ = '\0';
  135|    657|  *dnsp++ = '\0'; /* ARCOUNT */
  136|       |
  137|       |  /* encode each label and store it in the QNAME */
  138|  1.35k|  while(*hostp) {
  ------------------
  |  Branch (138:9): [True: 709, False: 649]
  ------------------
  139|    709|    size_t labellen;
  140|    709|    const char *dot = strchr(hostp, '.');
  141|    709|    if(dot)
  ------------------
  |  Branch (141:8): [True: 64, False: 645]
  ------------------
  142|     64|      labellen = dot - hostp;
  143|    645|    else
  144|    645|      labellen = strlen(hostp);
  145|    709|    if((labellen > 63) || (!labellen)) {
  ------------------
  |  Branch (145:8): [True: 2, False: 707]
  |  Branch (145:27): [True: 6, False: 701]
  ------------------
  146|       |      /* label is too long or too short, error out */
  147|      8|      *olen = 0;
  148|      8|      return DOH_DNS_BAD_LABEL;
  149|      8|    }
  150|       |    /* label is non-empty, process it */
  151|    701|    *dnsp++ = (unsigned char)labellen;
  152|    701|    memcpy(dnsp, hostp, labellen);
  153|    701|    dnsp += labellen;
  154|    701|    hostp += labellen;
  155|       |    /* advance past dot, but only if there is one */
  156|    701|    if(dot)
  ------------------
  |  Branch (156:8): [True: 58, False: 643]
  ------------------
  157|     58|      hostp++;
  158|    701|  } /* next label */
  159|       |
  160|    649|  *dnsp++ = 0; /* append zero-length label for root */
  161|       |
  162|       |  /* There are assigned TYPE codes beyond 255: use range [1..65535] */
  163|    649|  *dnsp++ = (unsigned char)(255 & (dnstype >> 8)); /* upper 8-bit TYPE */
  164|    649|  *dnsp++ = (unsigned char)(255 & dnstype);        /* lower 8-bit TYPE */
  165|       |
  166|    649|  *dnsp++ = '\0'; /* upper 8-bit CLASS */
  167|    649|  *dnsp++ = DNS_CLASS_IN; /* IN - "the Internet" */
  ------------------
  |  |   41|    649|#define DNS_CLASS_IN 0x01
  ------------------
  168|       |
  169|    649|  *olen = dnsp - orig;
  170|       |
  171|       |  /* verify that our estimation of length is valid, since
  172|       |   * this has led to buffer overflows in this function */
  173|    649|  DEBUGASSERT(*olen == expected_len);
  ------------------
  |  | 1081|    649|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (173:3): [True: 0, False: 649]
  |  Branch (173:3): [True: 649, False: 0]
  ------------------
  174|    649|  return DOH_OK;
  175|    649|}
Curl_doh:
  457|    336|{
  458|    336|  CURLcode result = CURLE_OK;
  459|    336|  struct doh_probes *dohp = NULL;
  460|    336|  size_t i;
  461|       |
  462|    336|  DEBUGASSERT(!async->doh);
  ------------------
  |  | 1081|    336|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (462:3): [True: 0, False: 336]
  |  Branch (462:3): [True: 336, False: 0]
  ------------------
  463|    336|  DEBUGASSERT(async->hostname[0]);
  ------------------
  |  | 1081|    336|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (463:3): [True: 0, False: 336]
  |  Branch (463:3): [True: 336, False: 0]
  ------------------
  464|    336|  if(async->doh) {
  ------------------
  |  Branch (464:6): [True: 0, False: 336]
  ------------------
  465|      0|    DEBUGASSERT(0); /* should not happen */
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (465:5): [Folded, False: 0]
  |  Branch (465:5): [Folded, False: 0]
  ------------------
  466|      0|    Curl_doh_cleanup(data, async);
  467|      0|  }
  468|       |
  469|       |  /* start clean, consider allocating this struct on demand */
  470|    336|  async->doh = dohp = curlx_calloc(1, sizeof(struct doh_probes));
  ------------------
  |  | 1480|    336|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  471|    336|  if(!dohp)
  ------------------
  |  Branch (471:6): [True: 0, False: 336]
  ------------------
  472|      0|    return CURLE_OUT_OF_MEMORY;
  473|       |
  474|  1.00k|  for(i = 0; i < DOH_SLOT_COUNT; ++i) {
  ------------------
  |  Branch (474:14): [True: 672, False: 336]
  ------------------
  475|    672|    dohp->probe_resp[i].probe_mid = UINT32_MAX;
  476|    672|    curlx_dyn_init(&dohp->probe_resp[i].body, DYN_DOH_RESPONSE);
  ------------------
  |  |   65|    672|#define DYN_DOH_RESPONSE    3000
  ------------------
  477|    672|  }
  478|       |
  479|    336|  dohp->host = async->hostname;
  480|    336|  dohp->port = async->port;
  481|       |  /* We are making sub easy handles and want to be called back when
  482|       |   * one is done. */
  483|    336|  data->sub_xfer_done = doh_probe_done;
  484|       |
  485|       |  /* create IPv4 DoH request */
  486|    336|  if(async->dns_queries & CURL_DNSQ_A) {
  ------------------
  |  |   51|    336|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  |  Branch (486:6): [True: 332, False: 4]
  ------------------
  487|    332|    result = doh_probe_run(data, CURL_DNS_TYPE_A,
  488|    332|                           async->hostname, data->set.str[STRING_DOH],
  489|    332|                           data->multi, async->id,
  490|    332|                           &dohp->probe_resp[DOH_SLOT_IPV4].probe_mid);
  491|    332|    if(result)
  ------------------
  |  Branch (491:8): [True: 8, False: 324]
  ------------------
  492|      8|      goto error;
  493|    324|    dohp->pending++;
  494|    324|  }
  495|       |
  496|    328|#ifdef USE_IPV6
  497|    328|  if(async->dns_queries & CURL_DNSQ_AAAA) {
  ------------------
  |  |   52|    328|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (497:6): [True: 325, False: 3]
  ------------------
  498|       |    /* create IPv6 DoH request */
  499|    325|    result = doh_probe_run(data, CURL_DNS_TYPE_AAAA,
  500|    325|                           async->hostname, data->set.str[STRING_DOH],
  501|    325|                           data->multi, async->id,
  502|    325|                           &dohp->probe_resp[DOH_SLOT_IPV6].probe_mid);
  503|    325|    if(result)
  ------------------
  |  Branch (503:8): [True: 0, False: 325]
  ------------------
  504|      0|      goto error;
  505|    325|    dohp->pending++;
  506|    325|  }
  507|    328|#endif
  508|       |
  509|       |#ifdef USE_HTTPSRR
  510|       |  if(async->dns_queries & CURL_DNSQ_HTTPS) {
  511|       |    char *qname = NULL;
  512|       |    if(async->port != PORT_HTTPS) {
  513|       |      qname = curl_maprintf("_%d._https.%s", async->port, async->hostname);
  514|       |      if(!qname)
  515|       |        goto error;
  516|       |    }
  517|       |    result = doh_probe_run(data, CURL_DNS_TYPE_HTTPS,
  518|       |                           qname ? qname : async->hostname,
  519|       |                           data->set.str[STRING_DOH], data->multi,
  520|       |                           async->id,
  521|       |                           &dohp->probe_resp[DOH_SLOT_HTTPS_RR].probe_mid);
  522|       |    curlx_free(qname);
  523|       |    if(result)
  524|       |      goto error;
  525|       |    dohp->pending++;
  526|       |  }
  527|       |#endif
  528|    328|  return CURLE_OK;
  529|       |
  530|      8|error:
  531|      8|  Curl_doh_cleanup(data, async);
  532|      8|  return result;
  533|    328|}
de_init:
  719|    223|{
  720|    223|  int i;
  721|    223|  memset(de, 0, sizeof(*de));
  722|    223|  de->ttl = INT_MAX;
  723|  1.11k|  for(i = 0; i < DOH_MAX_CNAME; i++)
  ------------------
  |  |  128|  1.11k|#define DOH_MAX_CNAME 4
  ------------------
  |  Branch (723:14): [True: 892, False: 223]
  ------------------
  724|    892|    curlx_dyn_init(&de->cname[i], DYN_DOH_CNAME);
  ------------------
  |  |   66|    892|#define DYN_DOH_CNAME       256
  ------------------
  725|    223|}
de_cleanup:
 1052|    223|{
 1053|    223|  int i = 0;
 1054|    223|  for(i = 0; i < d->numcname; i++) {
  ------------------
  |  Branch (1054:14): [True: 0, False: 223]
  ------------------
 1055|      0|    curlx_dyn_free(&d->cname[i]);
 1056|      0|  }
 1057|       |#ifdef USE_HTTPSRR
 1058|       |  for(i = 0; i < d->numhttps_rrs; i++)
 1059|       |    curlx_safefree(d->https_rrs[i].val);
 1060|       |#endif
 1061|    223|}
Curl_doh_take_result:
 1221|  77.6k|{
 1222|  77.6k|  struct doh_probes *dohp = async->doh;
 1223|  77.6k|  CURLcode result = CURLE_OK;
 1224|  77.6k|  struct dohentry de;
 1225|       |
 1226|  77.6k|  *pdns = NULL; /* defaults to no response */
 1227|  77.6k|  if(!dohp)
  ------------------
  |  Branch (1227:6): [True: 0, False: 77.6k]
  ------------------
 1228|      0|    return CURLE_OUT_OF_MEMORY;
 1229|       |
 1230|  77.6k|  if(dohp->probe_resp[DOH_SLOT_IPV4].probe_mid == UINT32_MAX &&
  ------------------
  |  Branch (1230:6): [True: 12, False: 77.6k]
  ------------------
 1231|     12|     dohp->probe_resp[DOH_SLOT_IPV6].probe_mid == UINT32_MAX) {
  ------------------
  |  Branch (1231:6): [True: 0, False: 12]
  ------------------
 1232|      0|    failf(data, "Could not DoH-resolve: %s", dohp->host);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1233|      0|    return async->for_proxy ?
  ------------------
  |  Branch (1233:12): [True: 0, False: 0]
  ------------------
 1234|      0|      CURLE_COULDNT_RESOLVE_PROXY : CURLE_COULDNT_RESOLVE_HOST;
 1235|      0|  }
 1236|  77.6k|  else if(!dohp->pending) {
  ------------------
  |  Branch (1236:11): [True: 223, False: 77.4k]
  ------------------
 1237|    223|    DOHcode rc[DOH_SLOT_COUNT];
 1238|    223|    int slot;
 1239|       |
 1240|    223|    memset(rc, 0, sizeof(rc));
 1241|       |    /* remove DoH handles from multi handle and close them */
 1242|    223|    doh_close(data, async);
 1243|       |    /* parse the responses, create the struct and return it! */
 1244|    223|    de_init(&de);
 1245|    669|    for(slot = 0; slot < DOH_SLOT_COUNT; slot++) {
  ------------------
  |  Branch (1245:19): [True: 446, False: 223]
  ------------------
 1246|    446|      struct doh_response *p = &dohp->probe_resp[slot];
 1247|    446|      if(!p->dnstype)
  ------------------
  |  Branch (1247:10): [True: 446, False: 0]
  ------------------
 1248|    446|        continue;
 1249|      0|      rc[slot] = doh_resp_decode(curlx_dyn_uptr(&p->body),
 1250|      0|                                 curlx_dyn_len(&p->body),
 1251|      0|                                 p->dnstype, &de);
 1252|      0|      if(rc[slot]) {
  ------------------
  |  Branch (1252:10): [True: 0, False: 0]
  ------------------
 1253|      0|        CURL_TRC_DNS(data, "DoH: %s type %s for %s", doh_strerror(rc[slot]),
  ------------------
  |  |  168|      0|  do {                                 \
  |  |  169|      0|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|      0|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1254|      0|                     doh_type2name(p->dnstype), dohp->host);
 1255|      0|      }
 1256|      0|    } /* next slot */
 1257|       |
 1258|    223|    if(!rc[DOH_SLOT_IPV4] || !rc[DOH_SLOT_IPV6]) {
  ------------------
  |  Branch (1258:8): [True: 223, False: 0]
  |  Branch (1258:30): [True: 0, False: 0]
  ------------------
 1259|       |      /* we have an address, of one kind or other */
 1260|    223|      struct Curl_dns_entry *dns;
 1261|    223|      struct Curl_addrinfo *ai;
 1262|       |
 1263|    223|      if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)) {
  ------------------
  |  |  326|    223|  (Curl_trc_is_verbose(data) &&          \
  |  |  ------------------
  |  |  |  |  319|    446|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 223, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 223]
  |  |  |  |  ------------------
  |  |  |  |  320|    446|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  327|    223|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1264|      0|        CURL_TRC_DNS(data, "hostname: %s", dohp->host);
  ------------------
  |  |  168|      0|  do {                                 \
  |  |  169|      0|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|      0|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1265|      0|        doh_show(data, &de);
 1266|      0|      }
 1267|       |
 1268|    223|      result = doh2ai(&de, dohp->host, dohp->port, &ai);
 1269|    223|      if(result)
  ------------------
  |  Branch (1269:10): [True: 223, False: 0]
  ------------------
 1270|    223|        goto error;
 1271|       |
 1272|       |      /* we got a response, create a dns entry. */
 1273|      0|      dns = Curl_dnscache_mk_entry(data, async->dns_queries,
 1274|      0|                                   &ai, dohp->host, dohp->port);
 1275|      0|      if(!dns) {
  ------------------
  |  Branch (1275:10): [True: 0, False: 0]
  ------------------
 1276|      0|        result = CURLE_OUT_OF_MEMORY;
 1277|      0|        goto error;
 1278|      0|      }
 1279|       |
 1280|       |      /* Now add and HTTPSRR information if we have */
 1281|       |#ifdef USE_HTTPSRR
 1282|       |      if(de.numhttps_rrs > 0 && result == CURLE_OK) {
 1283|       |        struct Curl_https_rrinfo *hrr = NULL;
 1284|       |        result = doh_resp_decode_httpsrr(data, de.https_rrs->val,
 1285|       |                                         de.https_rrs->len, &hrr);
 1286|       |        if(result) {
 1287|       |          infof(data, "Failed to decode HTTPS RR");
 1288|       |          Curl_dns_entry_unlink(data, &dns);
 1289|       |          goto error;
 1290|       |        }
 1291|       |        infof(data, "Some HTTPS RR to process");
 1292|       |#if defined(DEBUGBUILD) && defined(CURLVERBOSE)
 1293|       |        doh_print_httpsrr(data, hrr);
 1294|       |#endif
 1295|       |        Curl_dns_entry_set_https_rr(dns, hrr);
 1296|       |      }
 1297|       |#endif /* USE_HTTPSRR */
 1298|       |
 1299|       |      /* and add the entry to the cache */
 1300|      0|      result = Curl_dnscache_add(data, dns);
 1301|      0|      *pdns = dns;
 1302|      0|    } /* address processing done */
 1303|      0|    else {
 1304|      0|      result = async->for_proxy ?
  ------------------
  |  Branch (1304:16): [True: 0, False: 0]
  ------------------
 1305|      0|        CURLE_COULDNT_RESOLVE_PROXY : CURLE_COULDNT_RESOLVE_HOST;
 1306|      0|    }
 1307|       |
 1308|    223|  } /* !dohp->pending */
 1309|  77.4k|  else
 1310|       |    /* wait for pending DoH transactions to complete */
 1311|  77.4k|    return CURLE_AGAIN;
 1312|       |
 1313|    223|error:
 1314|    223|  de_cleanup(&de);
 1315|    223|  Curl_doh_cleanup(data, async);
 1316|    223|  return result;
 1317|  77.6k|}
Curl_doh_cleanup:
 1350|  1.52k|{
 1351|  1.52k|  struct doh_probes *dohp = async->doh;
 1352|  1.52k|  if(dohp) {
  ------------------
  |  Branch (1352:6): [True: 336, False: 1.18k]
  ------------------
 1353|    336|    int i;
 1354|    336|    doh_close(data, async);
 1355|  1.00k|    for(i = 0; i < DOH_SLOT_COUNT; ++i) {
  ------------------
  |  Branch (1355:16): [True: 672, False: 336]
  ------------------
 1356|    672|      curlx_dyn_free(&dohp->probe_resp[i].body);
 1357|    672|    }
 1358|       |    curlx_safefree(async->doh);
  ------------------
  |  | 1327|    336|  do {                      \
  |  | 1328|    336|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|    336|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|    336|    (ptr) = NULL;           \
  |  | 1330|    336|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 336]
  |  |  ------------------
  ------------------
 1359|    336|  }
 1360|  1.52k|}
doh.c:doh_probe_done:
  221|    446|{
  222|    446|  struct Curl_resolv_async *async = NULL;
  223|    446|  struct doh_probes *dohp = NULL;
  224|    446|  struct doh_request *doh_req = NULL;
  225|    446|  int i;
  226|       |
  227|    446|  doh_req = Curl_meta_get(doh, CURL_EZM_DOH_PROBE);
  ------------------
  |  |   84|    446|#define CURL_EZM_DOH_PROBE   "ezm:doh-p"
  ------------------
  228|    446|  if(!doh_req) {
  ------------------
  |  Branch (228:6): [True: 0, False: 446]
  ------------------
  229|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (229:5): [Folded, False: 0]
  |  Branch (229:5): [Folded, False: 0]
  ------------------
  230|      0|    return;
  231|      0|  }
  232|       |
  233|    446|  async = Curl_async_get(data, doh_req->resolv_id);
  234|    446|  if(!async) {
  ------------------
  |  Branch (234:6): [True: 0, False: 446]
  ------------------
  235|      0|    CURL_TRC_DNS(data, "[%u] ignoring outdated DoH response",
  ------------------
  |  |  168|      0|  do {                                 \
  |  |  169|      0|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|      0|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  236|      0|                 doh_req->resolv_id);
  237|      0|    return;
  238|      0|  }
  239|    446|  dohp = async->doh;
  240|       |
  241|    669|  for(i = 0; i < DOH_SLOT_COUNT; ++i) {
  ------------------
  |  Branch (241:14): [True: 669, False: 0]
  ------------------
  242|    669|    if(dohp->probe_resp[i].probe_mid == doh->mid)
  ------------------
  |  Branch (242:8): [True: 446, False: 223]
  ------------------
  243|    446|      break;
  244|    669|  }
  245|       |  /* We really should have found the slot where to store the response */
  246|    446|  if(i >= DOH_SLOT_COUNT) {
  ------------------
  |  Branch (246:6): [True: 0, False: 446]
  ------------------
  247|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (247:5): [Folded, False: 0]
  |  Branch (247:5): [Folded, False: 0]
  ------------------
  248|      0|    failf(data, "DoH: unknown sub request done");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  249|      0|    return;
  250|      0|  }
  251|       |
  252|    446|  dohp->pending--;
  253|    446|  infof(doh, "a DoH request is completed, %u to go", dohp->pending);
  ------------------
  |  |  143|    446|  do {                               \
  |  |  144|    446|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    446|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 446, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 446]
  |  |  |  |  ------------------
  |  |  |  |  320|    446|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    446|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    446|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 446]
  |  |  ------------------
  ------------------
  254|    446|  dohp->probe_resp[i].result = result;
  255|       |  /* We expect either the meta data still to exist or the sub request
  256|       |   * to have already failed. */
  257|    446|  if(!result) {
  ------------------
  |  Branch (257:6): [True: 0, False: 446]
  ------------------
  258|      0|    dohp->probe_resp[i].dnstype = doh_req->dnstype;
  259|      0|    result = curlx_dyn_addn(&dohp->probe_resp[i].body,
  260|      0|                            curlx_dyn_ptr(&doh_req->resp_body),
  261|      0|                            curlx_dyn_len(&doh_req->resp_body));
  262|      0|    curlx_dyn_free(&doh_req->resp_body);
  263|      0|  }
  264|    446|  Curl_meta_remove(doh, CURL_EZM_DOH_PROBE);
  ------------------
  |  |   84|    446|#define CURL_EZM_DOH_PROBE   "ezm:doh-p"
  ------------------
  265|       |
  266|    446|  if(result)
  ------------------
  |  Branch (266:6): [True: 446, False: 0]
  ------------------
  267|    446|    infof(doh, "DoH request %s", curl_easy_strerror(result));
  ------------------
  |  |  143|    446|  do {                               \
  |  |  144|    446|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    446|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 446, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 446]
  |  |  |  |  ------------------
  |  |  |  |  320|    446|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    446|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    446|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 446]
  |  |  ------------------
  ------------------
  268|       |
  269|    446|  if(!dohp->pending) {
  ------------------
  |  Branch (269:6): [True: 225, False: 221]
  ------------------
  270|       |    /* DoH completed, run the transfer picking up the results */
  271|    225|    Curl_multi_mark_dirty(data);
  272|    225|  }
  273|    446|}
doh.c:doh_probe_run:
  302|    657|{
  303|    657|  struct Curl_easy *doh = NULL;
  304|    657|  CURLcode result = CURLE_OK;
  305|    657|  timediff_t timeout_ms;
  306|    657|  struct doh_request *doh_req;
  307|    657|  DOHcode d;
  308|       |
  309|    657|  *pmid = UINT32_MAX;
  310|       |
  311|    657|  doh_req = curlx_calloc(1, sizeof(*doh_req));
  ------------------
  |  | 1480|    657|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  312|    657|  if(!doh_req)
  ------------------
  |  Branch (312:6): [True: 0, False: 657]
  ------------------
  313|      0|    return CURLE_OUT_OF_MEMORY;
  314|    657|  doh_req->resolv_id = resolv_id;
  315|    657|  doh_req->dnstype = dnstype;
  316|    657|  curlx_dyn_init(&doh_req->resp_body, DYN_DOH_RESPONSE);
  ------------------
  |  |   65|    657|#define DYN_DOH_RESPONSE    3000
  ------------------
  317|       |
  318|    657|  d = doh_req_encode(host, dnstype, doh_req->req_body,
  319|    657|                     sizeof(doh_req->req_body),
  320|    657|                     &doh_req->req_body_len);
  321|    657|  if(d) {
  ------------------
  |  Branch (321:6): [True: 8, False: 649]
  ------------------
  322|      8|    failf(data, "Failed to encode DoH packet [%d]", d);
  ------------------
  |  |   62|      8|#define failf Curl_failf
  ------------------
  323|      8|    result = CURLE_OUT_OF_MEMORY;
  324|      8|    goto error;
  325|      8|  }
  326|       |
  327|    649|  timeout_ms = Curl_timeleft_ms(data);
  328|    649|  if(timeout_ms < 0) {
  ------------------
  |  Branch (328:6): [True: 0, False: 649]
  ------------------
  329|      0|    result = CURLE_OPERATION_TIMEDOUT;
  330|      0|    goto error;
  331|      0|  }
  332|       |
  333|    649|  doh_req->req_hds =
  334|    649|    curl_slist_append(NULL, "Content-Type: application/dns-message");
  335|    649|  if(!doh_req->req_hds) {
  ------------------
  |  Branch (335:6): [True: 0, False: 649]
  ------------------
  336|      0|    result = CURLE_OUT_OF_MEMORY;
  337|      0|    goto error;
  338|      0|  }
  339|       |
  340|       |  /* Curl_open() is the internal version of curl_easy_init() */
  341|    649|  result = Curl_open(&doh);
  342|    649|  if(result)
  ------------------
  |  Branch (342:6): [True: 0, False: 649]
  ------------------
  343|      0|    goto error;
  344|       |
  345|       |  /* pass in the struct pointer via a local variable to please coverity and
  346|       |     the gcc typecheck helpers */
  347|    649|  VERBOSE(doh->state.feat = &Curl_trc_feat_dns);
  ------------------
  |  | 1618|    649|#define VERBOSE(x) x
  ------------------
  348|    649|  ERROR_CHECK_SETOPT(CURLOPT_URL, url);
  ------------------
  |  |  288|    649|  do {                                                  \
  |  |  289|    649|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|    649|  __extension__({                                                       \
  |  |  |  |   46|    649|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 649, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|    649|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|   114k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|    649|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|    649|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|    649|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|    649|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|    649|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|    649|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|    649|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|    649|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|    649|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|    649|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|    649|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|    649|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|    649|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|    649|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|    649|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|    649|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|    649|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|    649|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|    649|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|    649|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|    649|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|    649|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|    649|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|    649|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|    649|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|    649|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|    649|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|    649|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|    649|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|    649|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|    649|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|    649|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|    649|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|    649|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|    649|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|    649|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|    649|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|    649|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|    649|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|    649|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|    649|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|    649|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|    649|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|    649|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|    649|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|    649|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|    649|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|    649|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|    649|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|    649|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|    649|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|    649|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|    649|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|    649|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|    649|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|    649|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|    649|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|    649|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|    649|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|    649|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|    649|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|    649|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|    649|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|    649|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|    649|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|    649|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|    649|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|    649|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|    649|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|    649|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|    649|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|    649|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|    649|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|    649|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|    649|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|    649|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|    649|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|    649|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|    649|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|    649|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|    649|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|    649|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|    649|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|    649|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|    649|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|    649|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|    649|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|    649|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|    649|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|    649|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|    649|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|    649|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|    649|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|    649|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|    649|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|    649|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|    649|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|    649|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|    649|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|    649|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|    649|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|    649|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|    649|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|    649|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|    649|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|    649|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|    649|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|    649|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|    649|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|    649|      )                                                                 \
  |  |  |  |  158|    649|    }                                                                   \
  |  |  |  |  159|    649|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|    649|  })
  |  |  ------------------
  |  |  290|    649|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 649]
  |  |  ------------------
  |  |  291|    649|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|    649|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|    649|      goto error;                                       \
  |  |  294|    649|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 649]
  |  |  ------------------
  ------------------
  349|    649|  ERROR_CHECK_SETOPT(CURLOPT_DEFAULT_PROTOCOL, "https");
  ------------------
  |  |  288|    649|  do {                                                  \
  |  |  289|    649|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|    649|  __extension__({                                                       \
  |  |  |  |   46|    649|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 649, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|    649|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|   114k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|    649|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|    649|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|    649|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|    649|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|    649|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|    649|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|    649|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|    649|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|    649|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|    649|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|    649|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|    649|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|    649|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|    649|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|    649|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|    649|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|    649|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|    649|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|    649|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|    649|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|    649|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|    649|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|    649|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|    649|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|    649|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|    649|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|    649|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|    649|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|    649|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|    649|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|    649|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|    649|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|    649|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|    649|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|    649|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|    649|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|    649|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|    649|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|    649|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|    649|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|    649|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|    649|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|    649|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|    649|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|    649|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|    649|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|    649|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|    649|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|    649|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|    649|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|    649|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|    649|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|    649|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|    649|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|    649|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|    649|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|    649|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|    649|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|    649|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|    649|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|    649|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|    649|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|    649|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|    649|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|    649|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|    649|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|    649|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|    649|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|    649|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|    649|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|    649|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|    649|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|    649|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|    649|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|    649|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|    649|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|    649|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|    649|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|    649|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|    649|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|    649|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|    649|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|    649|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|    649|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|    649|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|    649|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|    649|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|    649|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|    649|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|    649|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|    649|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|    649|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|    649|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|    649|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|    649|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|    649|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|    649|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|    649|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|    649|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|    649|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|    649|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|    649|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|    649|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|    649|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|    649|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|    649|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|    649|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|    649|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|    649|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|    649|      )                                                                 \
  |  |  |  |  158|    649|    }                                                                   \
  |  |  |  |  159|    649|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|    649|  })
  |  |  ------------------
  |  |  290|    649|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 649]
  |  |  ------------------
  |  |  291|    649|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|    649|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|    649|      goto error;                                       \
  |  |  294|    649|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 649]
  |  |  ------------------
  ------------------
  350|    649|  ERROR_CHECK_SETOPT(CURLOPT_WRITEFUNCTION, doh_probe_write_cb);
  ------------------
  |  |  288|    649|  do {                                                  \
  |  |  289|    649|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|    649|  __extension__({                                                       \
  |  |  |  |   46|    649|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 649, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|    649|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|   122k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|    649|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|    649|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|    649|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|    649|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|    649|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|    649|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|    649|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|    649|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|    649|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|    649|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|    649|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|    649|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|    649|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|    649|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|    649|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|    649|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|    649|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|    649|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|    649|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|    649|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|    649|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|    649|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|    649|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|    649|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|    649|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|    649|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|    649|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|    649|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|    649|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|    649|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|    649|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|    649|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|    649|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|    649|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|    649|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|    649|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|    649|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|    649|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|    649|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|    649|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|    649|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|    649|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|    649|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|    649|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|    649|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|    649|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|    649|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|    649|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|    649|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|    649|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|    649|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|    649|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|    649|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|    649|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|    649|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|    649|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|    649|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|    649|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|    649|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|    649|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|    649|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|    649|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|    649|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|    649|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|    649|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|    649|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|    649|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|    649|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|    649|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|    649|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|    649|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|    649|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|    649|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|    649|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|    649|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|    649|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|    649|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|    649|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|    649|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|    649|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|    649|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|    649|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|    649|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|    649|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|    649|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|    649|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|    649|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|    649|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|    649|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|    649|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|    649|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|    649|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|    649|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|    649|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|    649|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|    649|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|    649|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|    649|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|    649|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|    649|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|    649|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|    649|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|    649|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|    649|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|    649|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|    649|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|    649|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|    649|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|    649|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|    649|      )                                                                 \
  |  |  |  |  158|    649|    }                                                                   \
  |  |  |  |  159|    649|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|    649|  })
  |  |  ------------------
  |  |  290|    649|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 649]
  |  |  ------------------
  |  |  291|    649|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|    649|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|    649|      goto error;                                       \
  |  |  294|    649|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 649]
  |  |  ------------------
  ------------------
  351|    649|  ERROR_CHECK_SETOPT(CURLOPT_WRITEDATA, doh);
  ------------------
  |  |  288|    649|  do {                                                  \
  |  |  289|    649|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|    649|  __extension__({                                                       \
  |  |  |  |   46|    649|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 649, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|    649|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|   111k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|    649|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|    649|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|    649|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|    649|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|    649|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|    649|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|    649|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|    649|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|    649|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|    649|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|    649|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|    649|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|    649|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|    649|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|    649|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|    649|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|    649|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|    649|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|    649|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|    649|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|    649|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|    649|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|    649|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|    649|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|    649|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|    649|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|    649|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|    649|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|    649|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|    649|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|    649|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|    649|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|    649|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|    649|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|    649|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|    649|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|    649|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|    649|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|    649|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|    649|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|    649|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|    649|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|    649|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|    649|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|    649|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|    649|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|    649|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|    649|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|    649|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|    649|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|    649|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|    649|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|    649|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|    649|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|    649|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|    649|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|    649|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|    649|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|    649|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|    649|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|    649|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|    649|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|    649|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|    649|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|    649|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|    649|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|    649|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|    649|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|    649|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|    649|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|    649|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|    649|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|    649|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|    649|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|    649|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|    649|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|    649|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|    649|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|    649|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|    649|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|    649|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|    649|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|    649|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|    649|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|    649|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|    649|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|    649|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|    649|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|    649|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|    649|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|    649|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|    649|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|    649|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|    649|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|    649|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|    649|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|    649|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|    649|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|    649|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|    649|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|    649|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|    649|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|    649|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|    649|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|    649|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|    649|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|    649|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|    649|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|    649|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|    649|      )                                                                 \
  |  |  |  |  158|    649|    }                                                                   \
  |  |  |  |  159|    649|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|    649|  })
  |  |  ------------------
  |  |  290|    649|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 649]
  |  |  ------------------
  |  |  291|    649|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|    649|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|    649|      goto error;                                       \
  |  |  294|    649|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 649]
  |  |  ------------------
  ------------------
  352|    649|  ERROR_CHECK_SETOPT(CURLOPT_POSTFIELDS, doh_req->req_body);
  ------------------
  |  |  288|    649|  do {                                                  \
  |  |  289|    649|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|    649|  __extension__({                                                       \
  |  |  |  |   46|    649|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 649, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|    649|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|   114k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 649, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|    649|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|    649|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|    649|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|    649|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|    649|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|    649|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|    649|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|    649|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|    649|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|    649|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|    649|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|    649|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|    649|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|    649|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|    649|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|    649|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|    649|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|    649|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|    649|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|    649|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|    649|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|    649|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|    649|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|    649|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|    649|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|    649|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|    649|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|    649|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|    649|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|    649|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|    649|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|    649|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|    649|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|    649|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|    649|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|    649|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|    649|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|    649|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|    649|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|    649|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|    649|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|    649|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|    649|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|    649|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|    649|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|    649|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|    649|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|    649|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|    649|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|    649|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|    649|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|    649|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|    649|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|    649|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|    649|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|    649|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|    649|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|    649|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|    649|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|    649|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|    649|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|    649|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|    649|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|    649|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|    649|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|    649|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|    649|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|    649|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|    649|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|    649|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|    649|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|    649|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|    649|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|    649|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|    649|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|    649|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|    649|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|    649|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|    649|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|    649|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|    649|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|    649|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|    649|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|    649|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|    649|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|    649|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|    649|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|    649|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|    649|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|    649|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|    649|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|    649|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|    649|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|    649|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|    649|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|    649|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|    649|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|    649|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|    649|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|    649|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|    649|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|    649|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|    649|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|    649|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|    649|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|    649|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|    649|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|    649|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|    649|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|    649|      )                                                                 \
  |  |  |  |  158|    649|    }                                                                   \
  |  |  |  |  159|    649|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|    649|  })
  |  |  ------------------
  |  |  290|    649|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 649]
  |  |  ------------------
  |  |  291|    649|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|    649|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|    649|      goto error;                                       \
  |  |  294|    649|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 649]
  |  |  ------------------
  ------------------
  353|    649|  ERROR_CHECK_SETOPT(CURLOPT_POSTFIELDSIZE, (long)doh_req->req_body_len);
  ------------------
  |  |  288|    649|  do {                                                  \
  |  |  289|    649|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|    649|  __extension__({                                                       \
  |  |  |  |   46|    649|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 649, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|    649|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|   112k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|    649|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|    649|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|    649|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|    649|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|    649|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|    649|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|    649|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|    649|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|    649|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|    649|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|    649|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|    649|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|    649|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|    649|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|    649|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|    649|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|    649|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|    649|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|    649|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|    649|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|    649|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|    649|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|    649|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|    649|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|    649|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|    649|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|    649|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|    649|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|    649|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|    649|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|    649|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|    649|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|    649|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|    649|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|    649|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|    649|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|    649|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|    649|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|    649|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|    649|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|    649|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|    649|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|    649|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|    649|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|    649|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|    649|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|    649|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|    649|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|    649|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|    649|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|    649|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|    649|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|    649|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|    649|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|    649|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|    649|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|    649|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|    649|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|    649|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|    649|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|    649|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|    649|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|    649|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|    649|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|    649|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|    649|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|    649|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|    649|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|    649|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|    649|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|    649|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|    649|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|    649|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|    649|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|    649|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|    649|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|    649|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|    649|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|    649|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|    649|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|    649|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|    649|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|    649|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|    649|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|    649|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|    649|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|    649|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|    649|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|    649|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|    649|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|    649|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|    649|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|    649|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|    649|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|    649|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|    649|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|    649|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|    649|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|    649|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|    649|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|    649|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|    649|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|    649|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|    649|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|    649|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|    649|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|    649|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|    649|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|    649|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|    649|      )                                                                 \
  |  |  |  |  158|    649|    }                                                                   \
  |  |  |  |  159|    649|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|    649|  })
  |  |  ------------------
  |  |  290|    649|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 649]
  |  |  ------------------
  |  |  291|    649|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|    649|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|    649|      goto error;                                       \
  |  |  294|    649|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 649]
  |  |  ------------------
  ------------------
  354|    649|  ERROR_CHECK_SETOPT(CURLOPT_HTTPHEADER, doh_req->req_hds);
  ------------------
  |  |  288|    649|  do {                                                  \
  |  |  289|    649|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|    649|  __extension__({                                                       \
  |  |  |  |   46|    649|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 649, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|    649|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|   113k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|    649|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|    649|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|    649|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|    649|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|    649|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|    649|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|    649|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|    649|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|    649|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|    649|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|    649|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|    649|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|    649|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|    649|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|    649|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|    649|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|    649|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|    649|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|    649|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|    649|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|    649|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|    649|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|    649|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|    649|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|    649|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|    649|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|    649|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|    649|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|    649|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|    649|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|    649|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|    649|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|    649|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|    649|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|    649|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|    649|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|    649|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|    649|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|    649|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|    649|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|    649|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|    649|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|    649|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|    649|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|    649|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|    649|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|    649|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|    649|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|    649|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|    649|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|    649|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|    649|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|    649|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|    649|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|    649|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|    649|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|    649|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|    649|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|    649|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|    649|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|    649|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|    649|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|    649|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|    649|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|    649|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|    649|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|    649|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|    649|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|    649|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|    649|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|    649|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|    649|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|    649|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|    649|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|    649|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|    649|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|    649|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|    649|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|    649|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|    649|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|    649|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|    649|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|    649|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|    649|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|    649|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|    649|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|    649|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|    649|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|    649|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|    649|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|    649|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|    649|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|    649|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|    649|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|    649|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|    649|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|    649|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|    649|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|    649|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|    649|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|    649|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|    649|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|    649|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|    649|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|    649|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|    649|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|    649|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|    649|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|    649|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|    649|      )                                                                 \
  |  |  |  |  158|    649|    }                                                                   \
  |  |  |  |  159|    649|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|    649|  })
  |  |  ------------------
  |  |  290|    649|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 649]
  |  |  ------------------
  |  |  291|    649|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|    649|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|    649|      goto error;                                       \
  |  |  294|    649|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 649]
  |  |  ------------------
  ------------------
  355|    649|#ifdef USE_HTTP2
  356|    649|  ERROR_CHECK_SETOPT(CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS);
  ------------------
  |  |  288|    649|  do {                                                  \
  |  |  289|    649|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|    649|  __extension__({                                                       \
  |  |  |  |   46|    649|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 649, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|    649|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|   112k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|    649|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|    649|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|    649|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|    649|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|    649|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|    649|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|    649|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|    649|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|    649|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|    649|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|    649|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|    649|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|    649|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|    649|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|    649|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|    649|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|    649|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|    649|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|    649|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|    649|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|    649|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|    649|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|    649|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|    649|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|    649|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|    649|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|    649|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|    649|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|    649|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|    649|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|    649|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|    649|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|    649|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|    649|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|    649|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|    649|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|    649|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|    649|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|    649|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|    649|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|    649|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|    649|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|    649|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|    649|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|    649|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|    649|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|    649|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|    649|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|    649|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|    649|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|    649|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|    649|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|    649|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|    649|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|    649|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|    649|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|    649|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|    649|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|    649|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|    649|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|    649|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|    649|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|    649|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|    649|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|    649|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|    649|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|    649|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|    649|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|    649|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|    649|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|    649|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|    649|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|    649|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|    649|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|    649|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|    649|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|    649|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|    649|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|    649|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|    649|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|    649|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|    649|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|    649|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|    649|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|    649|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|    649|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|    649|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|    649|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|    649|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|    649|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|    649|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|    649|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|    649|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|    649|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|    649|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|    649|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|    649|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|    649|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|    649|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|    649|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|    649|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|    649|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|    649|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|    649|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|    649|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|    649|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|    649|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|    649|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|    649|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|    649|      )                                                                 \
  |  |  |  |  158|    649|    }                                                                   \
  |  |  |  |  159|    649|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|    649|  })
  |  |  ------------------
  |  |  290|    649|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 649]
  |  |  ------------------
  |  |  291|    649|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|    649|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|    649|      goto error;                                       \
  |  |  294|    649|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 649]
  |  |  ------------------
  ------------------
  357|    649|  ERROR_CHECK_SETOPT(CURLOPT_PIPEWAIT, 1L);
  ------------------
  |  |  288|    649|  do {                                                  \
  |  |  289|    649|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|    649|  __extension__({                                                       \
  |  |  |  |   46|    649|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 649, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|    649|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|   112k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|    649|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|    649|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|    649|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|    649|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|    649|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|    649|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|    649|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|    649|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|    649|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|    649|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|    649|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|    649|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|    649|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|    649|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|    649|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|    649|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|    649|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|    649|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|    649|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|    649|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|    649|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|    649|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|    649|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|    649|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|    649|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|    649|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|    649|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|    649|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|    649|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|    649|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|    649|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|    649|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|    649|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|    649|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|    649|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|    649|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|    649|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|    649|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|    649|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|    649|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|    649|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|    649|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|    649|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|    649|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|    649|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|    649|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|    649|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|    649|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|    649|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|    649|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|    649|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|    649|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|    649|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|    649|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|    649|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|    649|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|    649|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|    649|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|    649|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|    649|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|    649|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|    649|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|    649|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|    649|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|    649|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|    649|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|    649|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|    649|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|    649|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|    649|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|    649|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|    649|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|    649|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|    649|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|    649|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|    649|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|    649|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|    649|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|    649|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|    649|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|    649|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|    649|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|    649|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|    649|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|    649|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|    649|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|    649|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|    649|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|    649|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|    649|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|    649|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|    649|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|    649|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|    649|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|    649|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|    649|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|    649|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|    649|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|    649|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|    649|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|    649|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|    649|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|    649|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|    649|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|    649|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|    649|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|    649|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|    649|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|    649|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|    649|      )                                                                 \
  |  |  |  |  158|    649|    }                                                                   \
  |  |  |  |  159|    649|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|    649|  })
  |  |  ------------------
  |  |  290|    649|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 649]
  |  |  ------------------
  |  |  291|    649|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|    649|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|    649|      goto error;                                       \
  |  |  294|    649|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 649]
  |  |  ------------------
  ------------------
  358|    649|#endif
  359|       |#ifndef DEBUGBUILD
  360|       |  /* enforce HTTPS if not debug */
  361|       |  ERROR_CHECK_SETOPT(CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);
  362|       |#else
  363|       |  /* in debug mode, also allow http */
  364|    649|  ERROR_CHECK_SETOPT(CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
  ------------------
  |  |  288|    649|  do {                                                  \
  |  |  289|    649|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|    649|  __extension__({                                                       \
  |  |  |  |   46|    649|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 649, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|    649|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|   112k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|    649|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|    649|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|    649|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|    649|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|    649|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|    649|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|    649|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|    649|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|    649|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|    649|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|    649|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|    649|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|    649|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|    649|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|    649|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|    649|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|    649|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|    649|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|    649|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|    649|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|    649|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|    649|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|    649|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|    649|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|    649|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|    649|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|    649|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|    649|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|    649|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|    649|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|    649|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|    649|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|    649|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|    649|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|    649|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|    649|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|    649|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|    649|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|    649|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|    649|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|    649|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|    649|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|    649|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|    649|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|    649|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|    649|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|    649|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|    649|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|    649|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|    649|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|    649|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|    649|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|    649|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|    649|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|    649|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|    649|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|    649|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|    649|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|    649|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|    649|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|    649|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|    649|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|    649|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|    649|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|    649|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|    649|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|    649|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|    649|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|    649|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|    649|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|    649|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|    649|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|    649|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|    649|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|    649|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|    649|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|    649|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|    649|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|    649|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|    649|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|    649|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|    649|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|    649|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|    649|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|    649|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|    649|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|    649|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|    649|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|    649|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|    649|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|    649|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|    649|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|    649|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|    649|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|    649|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|    649|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|    649|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|    649|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|    649|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|    649|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|    649|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|    649|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|    649|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|    649|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|    649|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|    649|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|    649|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|    649|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|    649|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|    649|      )                                                                 \
  |  |  |  |  158|    649|    }                                                                   \
  |  |  |  |  159|    649|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|    649|  })
  |  |  ------------------
  |  |  290|    649|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 649]
  |  |  ------------------
  |  |  291|    649|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|    649|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|    649|      goto error;                                       \
  |  |  294|    649|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 649]
  |  |  ------------------
  ------------------
  365|    649|#endif
  366|    649|  ERROR_CHECK_SETOPT(CURLOPT_TIMEOUT_MS, (long)timeout_ms);
  ------------------
  |  |  288|    649|  do {                                                  \
  |  |  289|    649|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|    649|  __extension__({                                                       \
  |  |  |  |   46|    649|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 649, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|    649|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|   112k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|    649|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|    649|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|    649|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|    649|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|    649|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|    649|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|    649|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|    649|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|    649|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|    649|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|    649|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|    649|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|    649|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|    649|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|    649|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|    649|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|    649|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|    649|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|    649|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|    649|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|    649|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|    649|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|    649|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|    649|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|    649|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|    649|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|    649|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|    649|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|    649|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|    649|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|    649|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|    649|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|    649|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|    649|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|    649|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|    649|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|    649|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|    649|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|    649|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|    649|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|    649|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|    649|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|    649|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|    649|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|    649|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|    649|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|    649|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|    649|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|    649|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|    649|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|    649|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|    649|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|    649|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|    649|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|    649|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|    649|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|    649|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|    649|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|    649|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|    649|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|    649|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|    649|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|    649|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|    649|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|    649|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|    649|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|    649|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|    649|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|    649|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|    649|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|    649|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|    649|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|    649|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|    649|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|    649|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|    649|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|    649|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|    649|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|    649|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|    649|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|    649|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|    649|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|    649|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|    649|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|    649|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|    649|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|    649|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|    649|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|    649|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|    649|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|    649|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|    649|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|    649|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|    649|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|    649|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|    649|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|    649|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|    649|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|    649|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|    649|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|    649|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|    649|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|    649|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|    649|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|    649|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|    649|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|    649|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|    649|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|    649|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|    649|      )                                                                 \
  |  |  |  |  158|    649|    }                                                                   \
  |  |  |  |  159|    649|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|    649|  })
  |  |  ------------------
  |  |  290|    649|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 649]
  |  |  ------------------
  |  |  291|    649|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|    649|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|    649|      goto error;                                       \
  |  |  294|    649|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 649]
  |  |  ------------------
  ------------------
  367|    649|  ERROR_CHECK_SETOPT(CURLOPT_SHARE, (CURLSH *)data->share);
  ------------------
  |  |  288|    649|  do {                                                  \
  |  |  289|    649|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|    649|  __extension__({                                                       \
  |  |  |  |   46|    649|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 649, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|    649|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|   112k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 649, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 649, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|    649|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|    649|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|    649|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|    649|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|    649|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|    649|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|    649|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|    649|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|    649|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|    649|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|    649|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|    649|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|    649|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|    649|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|    649|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|    649|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|    649|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|    649|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|    649|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|    649|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|    649|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|    649|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|    649|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|    649|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|    649|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|    649|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|    649|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|    649|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|    649|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|    649|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|    649|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|    649|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|    649|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|    649|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|    649|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|    649|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|    649|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|    649|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|    649|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|    649|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|    649|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|    649|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|    649|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|    649|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|    649|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|    649|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|    649|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|    649|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|    649|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|    649|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|    649|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|    649|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|    649|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|    649|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|    649|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|    649|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|    649|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|    649|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|    649|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|    649|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|    649|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|    649|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|    649|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|    649|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|    649|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|    649|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|    649|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|    649|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|    649|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|    649|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|    649|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|    649|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|    649|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|    649|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|    649|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|    649|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|    649|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|    649|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|    649|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|    649|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|    649|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|    649|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|    649|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|    649|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|    649|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|    649|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|    649|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|    649|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|    649|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|    649|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|    649|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|    649|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|    649|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|    649|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|    649|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|    649|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|    649|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|    649|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|    649|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|    649|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|    649|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|    649|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|    649|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|    649|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|    649|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|    649|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|    649|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|    649|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|    649|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|    649|      )                                                                 \
  |  |  |  |  158|    649|    }                                                                   \
  |  |  |  |  159|    649|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|    649|  })
  |  |  ------------------
  |  |  290|    649|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 649]
  |  |  ------------------
  |  |  291|    649|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|    649|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|    649|      goto error;                                       \
  |  |  294|    649|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 649]
  |  |  ------------------
  ------------------
  368|    649|  if(data->set.err && data->set.err != stderr)
  ------------------
  |  Branch (368:6): [True: 649, False: 0]
  |  Branch (368:23): [True: 0, False: 649]
  ------------------
  369|      0|    ERROR_CHECK_SETOPT(CURLOPT_STDERR, data->set.err);
  ------------------
  |  |  288|      0|  do {                                                  \
  |  |  289|      0|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|      0|  __extension__({                                                       \
  |  |  |  |   46|      0|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|      0|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|      0|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|      0|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|      0|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|      0|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|      0|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|      0|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|      0|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|      0|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|      0|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|      0|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|      0|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|      0|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|      0|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|      0|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|      0|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|      0|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|      0|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|      0|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|      0|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|      0|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|      0|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|      0|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|      0|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|      0|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|      0|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|      0|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|      0|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|      0|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|      0|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|      0|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|      0|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|      0|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|      0|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|      0|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|      0|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|      0|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|      0|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|      0|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|      0|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|      0|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|      0|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|      0|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|      0|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|      0|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|      0|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|      0|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|      0|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|      0|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|      0|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|      0|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|      0|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|      0|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|      0|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|      0|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|      0|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|      0|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|      0|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|      0|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|      0|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|      0|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|      0|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|      0|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|      0|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|      0|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|      0|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|      0|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|      0|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|      0|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|      0|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|      0|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|      0|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|      0|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|      0|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|      0|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|      0|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|      0|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|      0|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|      0|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|      0|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|      0|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|      0|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|      0|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|      0|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|      0|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|      0|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|      0|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|      0|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|      0|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|      0|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|      0|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|      0|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|      0|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|      0|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|      0|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|      0|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|      0|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|      0|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|      0|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|      0|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|      0|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|      0|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|      0|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|      0|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|      0|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|      0|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|      0|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|      0|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|      0|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|      0|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|      0|      )                                                                 \
  |  |  |  |  158|      0|    }                                                                   \
  |  |  |  |  159|      0|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|      0|  })
  |  |  ------------------
  |  |  290|      0|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  291|      0|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|      0|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|      0|      goto error;                                       \
  |  |  294|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  370|    649|  if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns))
  ------------------
  |  |  326|    649|  (Curl_trc_is_verbose(data) &&          \
  |  |  ------------------
  |  |  |  |  319|  1.29k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 649, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 649]
  |  |  |  |  ------------------
  |  |  |  |  320|  1.29k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  327|    649|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  371|      0|    ERROR_CHECK_SETOPT(CURLOPT_VERBOSE, 1L);
  ------------------
  |  |  288|      0|  do {                                                  \
  |  |  289|      0|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|      0|  __extension__({                                                       \
  |  |  |  |   46|      0|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|      0|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|      0|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|      0|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|      0|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|      0|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|      0|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|      0|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|      0|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|      0|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|      0|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|      0|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|      0|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|      0|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|      0|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|      0|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|      0|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|      0|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|      0|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|      0|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|      0|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|      0|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|      0|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|      0|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|      0|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|      0|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|      0|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|      0|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|      0|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|      0|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|      0|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|      0|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|      0|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|      0|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|      0|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|      0|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|      0|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|      0|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|      0|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|      0|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|      0|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|      0|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|      0|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|      0|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|      0|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|      0|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|      0|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|      0|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|      0|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|      0|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|      0|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|      0|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|      0|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|      0|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|      0|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|      0|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|      0|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|      0|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|      0|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|      0|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|      0|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|      0|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|      0|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|      0|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|      0|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|      0|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|      0|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|      0|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|      0|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|      0|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|      0|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|      0|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|      0|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|      0|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|      0|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|      0|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|      0|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|      0|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|      0|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|      0|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|      0|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|      0|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|      0|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|      0|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|      0|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|      0|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|      0|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|      0|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|      0|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|      0|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|      0|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|      0|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|      0|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|      0|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|      0|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|      0|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|      0|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|      0|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|      0|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|      0|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|      0|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|      0|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|      0|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|      0|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|      0|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|      0|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|      0|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|      0|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|      0|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|      0|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|      0|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|      0|      )                                                                 \
  |  |  |  |  158|      0|    }                                                                   \
  |  |  |  |  159|      0|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|      0|  })
  |  |  ------------------
  |  |  290|      0|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  291|      0|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|      0|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|      0|      goto error;                                       \
  |  |  294|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  372|    649|  if(data->set.no_signal)
  ------------------
  |  Branch (372:6): [True: 2, False: 647]
  ------------------
  373|      2|    ERROR_CHECK_SETOPT(CURLOPT_NOSIGNAL, 1L);
  ------------------
  |  |  288|      2|  do {                                                  \
  |  |  289|      2|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|      2|  __extension__({                                                       \
  |  |  |  |   46|      2|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 2, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|      2|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|    348|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|      2|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|      2|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|      2|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|      2|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|      2|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|      2|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|      2|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|      2|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|      2|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|      2|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|      2|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|      2|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|      2|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|      2|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|      2|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|      2|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|      2|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|      2|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|      2|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|      2|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|      2|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|      2|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|      2|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|      2|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|      2|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|      2|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|      2|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|      2|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|      2|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|      2|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|      2|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|      2|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|      2|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|      2|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|      2|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|      2|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|      2|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|      2|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|      2|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|      2|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|      2|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|      2|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|      2|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|      2|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|      2|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|      2|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|      2|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|      2|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|      2|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|      2|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|      2|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|      2|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|      2|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|      2|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|      2|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|      2|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|      2|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|      2|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|      2|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|      2|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|      2|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|      2|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|      2|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|      2|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|      2|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|      2|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|      2|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|      2|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|      2|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|      2|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|      2|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|      2|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|      2|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|      2|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|      2|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|      2|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|      2|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|      2|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|      2|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|      2|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|      2|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|      2|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|      2|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|      2|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|      2|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|      2|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|      2|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|      2|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|      2|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|      2|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|      2|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|      2|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|      2|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|      2|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|      2|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|      2|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|      2|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|      2|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|      2|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|      2|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|      2|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|      2|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|      2|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|      2|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|      2|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|      2|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|      2|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|      2|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|      2|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|      2|      )                                                                 \
  |  |  |  |  158|      2|    }                                                                   \
  |  |  |  |  159|      2|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|      2|  })
  |  |  ------------------
  |  |  290|      2|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 2]
  |  |  ------------------
  |  |  291|      2|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|      2|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|      2|      goto error;                                       \
  |  |  294|      2|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 2]
  |  |  ------------------
  ------------------
  374|       |
  375|    649|  ERROR_CHECK_SETOPT(CURLOPT_SSL_VERIFYHOST,
  ------------------
  |  |  288|    649|  do {                                                  \
  |  |  289|    649|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|    649|  __extension__({                                                       \
  |  |  |  |   46|    649|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 649, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|    649|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|   112k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|    649|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|    649|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|    649|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|    649|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|    649|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|    649|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|    649|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|    649|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|    649|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|    649|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|    649|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|    649|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|    649|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|    649|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|    649|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|    649|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|    649|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|    649|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|    649|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|    649|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|    649|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|    649|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|    649|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|    649|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|    649|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|    649|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|    649|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|    649|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|    649|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|    649|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|    649|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|    649|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|    649|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|    649|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|    649|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|    649|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|    649|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|    649|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|    649|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|    649|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|    649|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|    649|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|    649|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|    649|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|    649|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|    649|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|    649|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|    649|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|    649|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|    649|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|    649|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|    649|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|    649|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|    649|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|    649|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|    649|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|    649|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|    649|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|    649|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|    649|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|    649|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|    649|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|    649|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|    649|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|    649|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|    649|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|    649|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|    649|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|    649|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|    649|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|    649|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|    649|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|    649|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|    649|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|    649|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|    649|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|    649|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|    649|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|    649|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|    649|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|    649|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|    649|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|    649|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|    649|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|    649|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|    649|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|    649|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|    649|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|    649|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|    649|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|    649|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|    649|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|    649|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|    649|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|    649|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|    649|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|    649|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|    649|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|    649|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|    649|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|    649|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|    649|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|    649|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|    649|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|    649|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|    649|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|    649|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|    649|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|    649|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|    649|      )                                                                 \
  |  |  |  |  158|    649|    }                                                                   \
  |  |  |  |  159|  1.29k|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (159:40): [True: 649, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  160|    649|  })
  |  |  ------------------
  |  |  290|    649|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 649]
  |  |  ------------------
  |  |  291|    649|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|    649|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|    649|      goto error;                                       \
  |  |  294|    649|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 649]
  |  |  ------------------
  ------------------
  376|    649|                     data->set.doh_verifyhost ? 2L : 0L);
  377|    649|  ERROR_CHECK_SETOPT(CURLOPT_SSL_VERIFYPEER,
  ------------------
  |  |  288|    649|  do {                                                  \
  |  |  289|    649|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|    649|  __extension__({                                                       \
  |  |  |  |   46|    649|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 649, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|    649|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|   112k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|    649|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|    649|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|    649|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|    649|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|    649|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|    649|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|    649|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|    649|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|    649|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|    649|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|    649|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|    649|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|    649|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|    649|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|    649|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|    649|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|    649|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|    649|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|    649|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|    649|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|    649|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|    649|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|    649|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|    649|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|    649|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|    649|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|    649|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|    649|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|    649|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|    649|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|    649|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|    649|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|    649|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|    649|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|    649|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|    649|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|    649|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|    649|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|    649|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|    649|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|    649|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|    649|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|    649|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|    649|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|    649|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|    649|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|    649|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|    649|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|    649|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|    649|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|    649|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|    649|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|    649|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|    649|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|    649|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|    649|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|    649|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|    649|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|    649|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|    649|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|    649|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|    649|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|    649|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|    649|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|    649|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|    649|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|    649|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|    649|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|    649|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|    649|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|    649|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|    649|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|    649|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|    649|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|    649|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|    649|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|    649|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|    649|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|    649|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|    649|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|    649|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|    649|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|    649|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|    649|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|    649|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|    649|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|    649|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|    649|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|    649|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|    649|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|    649|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|    649|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|    649|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|    649|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|    649|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|    649|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|    649|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|    649|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|    649|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|    649|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|    649|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|    649|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|    649|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|    649|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|    649|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|    649|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|    649|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|    649|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|    649|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|    649|      )                                                                 \
  |  |  |  |  158|    649|    }                                                                   \
  |  |  |  |  159|  1.29k|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (159:40): [True: 649, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  160|    649|  })
  |  |  ------------------
  |  |  290|    649|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 649]
  |  |  ------------------
  |  |  291|    649|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|    649|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|    649|      goto error;                                       \
  |  |  294|    649|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 649]
  |  |  ------------------
  ------------------
  378|    649|                     data->set.doh_verifypeer ? 1L : 0L);
  379|    649|  ERROR_CHECK_SETOPT(CURLOPT_SSL_VERIFYSTATUS,
  ------------------
  |  |  288|    649|  do {                                                  \
  |  |  289|    649|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|    649|  __extension__({                                                       \
  |  |  |  |   46|    649|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 649, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|    649|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|   112k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|    649|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|    649|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|    649|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|    649|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|    649|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|    649|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|    649|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|    649|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|    649|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|    649|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|    649|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|    649|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|    649|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|    649|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|    649|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|    649|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|    649|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|    649|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|    649|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|    649|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|    649|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|    649|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|    649|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|    649|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|    649|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|    649|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|    649|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|    649|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|    649|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|    649|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|    649|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|    649|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|    649|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|    649|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|    649|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|    649|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|    649|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|    649|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|    649|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|    649|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|    649|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|    649|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|    649|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|    649|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|    649|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|    649|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|    649|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|    649|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|    649|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|    649|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|    649|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|    649|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|    649|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|    649|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|    649|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|    649|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|    649|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|    649|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|    649|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|    649|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|    649|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|    649|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|    649|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|    649|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|    649|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|    649|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|    649|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|    649|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|    649|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|    649|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|    649|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|    649|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|    649|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|    649|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|    649|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|    649|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|    649|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|    649|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|    649|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|    649|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|    649|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|    649|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|    649|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|    649|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|    649|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|    649|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|    649|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|    649|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|    649|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|    649|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|    649|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|    649|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|    649|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|    649|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|    649|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|    649|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|    649|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|    649|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|    649|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|    649|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|    649|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|    649|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|    649|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|    649|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|    649|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|    649|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|    649|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|    649|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|    649|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|    649|      )                                                                 \
  |  |  |  |  158|    649|    }                                                                   \
  |  |  |  |  159|  1.29k|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (159:40): [True: 2, False: 647]
  |  |  |  |  ------------------
  |  |  |  |  160|    649|  })
  |  |  ------------------
  |  |  290|    649|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 649]
  |  |  ------------------
  |  |  291|    649|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|    649|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|    649|      goto error;                                       \
  |  |  294|    649|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 649]
  |  |  ------------------
  ------------------
  380|    649|                     data->set.doh_verifystatus ? 1L : 0L);
  381|       |
  382|       |  /* Inherit *some* SSL options from the user's transfer. This is a
  383|       |     best-guess as to which options are needed for compatibility. #3661
  384|       |
  385|       |     Note DoH does not inherit the user's proxy server so proxy SSL settings
  386|       |     have no effect and are not inherited. If that changes then two new
  387|       |     options should be added to check doh proxy insecure separately,
  388|       |     CURLOPT_DOH_PROXY_SSL_VERIFYHOST and CURLOPT_DOH_PROXY_SSL_VERIFYPEER.
  389|       |     */
  390|    649|  doh->set.ssl.custom_cafile = data->set.ssl.custom_cafile;
  391|    649|  doh->set.ssl.custom_capath = data->set.ssl.custom_capath;
  392|    649|  doh->set.ssl.custom_cablob = data->set.ssl.custom_cablob;
  393|    649|  if(data->set.str[STRING_SSL_CAFILE]) {
  ------------------
  |  Branch (393:6): [True: 649, False: 0]
  ------------------
  394|    649|    ERROR_CHECK_SETOPT(CURLOPT_CAINFO, data->set.str[STRING_SSL_CAFILE]);
  ------------------
  |  |  288|    649|  do {                                                  \
  |  |  289|    649|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|    649|  __extension__({                                                       \
  |  |  |  |   46|    649|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 649, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|    649|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|   114k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|    649|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|    649|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|    649|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|    649|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|    649|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|    649|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|    649|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|    649|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|    649|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|    649|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|    649|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|    649|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|    649|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|    649|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|    649|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|    649|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|    649|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|    649|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|    649|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|    649|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|    649|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|    649|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|    649|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|    649|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|    649|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|    649|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|    649|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|    649|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|    649|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|    649|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|    649|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|    649|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|    649|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|    649|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|    649|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|    649|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|    649|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|    649|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|    649|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|    649|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|    649|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|    649|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|    649|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|    649|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|    649|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|    649|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|    649|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|    649|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|    649|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|    649|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|    649|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|    649|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|    649|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|    649|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|    649|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|    649|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|    649|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|    649|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|    649|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|    649|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|    649|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|    649|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|    649|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|    649|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|    649|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|    649|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|    649|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|    649|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|    649|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|    649|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|    649|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|    649|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|    649|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|    649|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|    649|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|    649|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|    649|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|    649|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|    649|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|    649|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|    649|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|    649|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|    649|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|    649|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|    649|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|    649|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|    649|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|    649|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|    649|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|    649|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|    649|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|    649|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|    649|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|    649|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|    649|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|    649|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|    649|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|    649|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|    649|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|    649|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|    649|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|    649|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|    649|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|    649|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|    649|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|    649|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|    649|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|    649|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|    649|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|    649|      )                                                                 \
  |  |  |  |  158|    649|    }                                                                   \
  |  |  |  |  159|    649|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|    649|  })
  |  |  ------------------
  |  |  290|    649|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 649]
  |  |  ------------------
  |  |  291|    649|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|    649|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|    649|      goto error;                                       \
  |  |  294|    649|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 649]
  |  |  ------------------
  ------------------
  395|    649|  }
  396|    649|  if(data->set.blobs[BLOB_CAINFO]) {
  ------------------
  |  Branch (396:6): [True: 0, False: 649]
  ------------------
  397|      0|    ERROR_CHECK_SETOPT(CURLOPT_CAINFO_BLOB, data->set.blobs[BLOB_CAINFO]);
  ------------------
  |  |  288|      0|  do {                                                  \
  |  |  289|      0|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|      0|  __extension__({                                                       \
  |  |  |  |   46|      0|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|      0|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|      0|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|      0|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|      0|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|      0|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|      0|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|      0|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|      0|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|      0|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|      0|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|      0|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|      0|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|      0|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|      0|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|      0|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|      0|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|      0|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|      0|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|      0|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|      0|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|      0|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|      0|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|      0|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|      0|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|      0|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|      0|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|      0|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|      0|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|      0|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|      0|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|      0|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|      0|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|      0|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|      0|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|      0|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|      0|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|      0|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|      0|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|      0|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|      0|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|      0|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|      0|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|      0|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|      0|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|      0|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|      0|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|      0|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|      0|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|      0|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|      0|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|      0|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|      0|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|      0|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|      0|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|      0|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|      0|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|      0|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|      0|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|      0|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|      0|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|      0|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|      0|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|      0|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|      0|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|      0|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|      0|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|      0|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|      0|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|      0|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|      0|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|      0|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|      0|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|      0|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|      0|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|      0|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|      0|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|      0|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|      0|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|      0|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|      0|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|      0|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|      0|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|      0|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|      0|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|      0|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|      0|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|      0|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|      0|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|      0|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|      0|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|      0|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|      0|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|      0|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|      0|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|      0|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|      0|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|      0|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|      0|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|      0|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|      0|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|      0|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|      0|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|      0|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|      0|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|      0|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|      0|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|      0|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|      0|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|      0|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|      0|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|      0|      )                                                                 \
  |  |  |  |  158|      0|    }                                                                   \
  |  |  |  |  159|      0|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|      0|  })
  |  |  ------------------
  |  |  290|      0|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  291|      0|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|      0|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|      0|      goto error;                                       \
  |  |  294|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  398|      0|  }
  399|    649|  if(data->set.str[STRING_SSL_CAPATH]) {
  ------------------
  |  Branch (399:6): [True: 649, False: 0]
  ------------------
  400|    649|    ERROR_CHECK_SETOPT(CURLOPT_CAPATH, data->set.str[STRING_SSL_CAPATH]);
  ------------------
  |  |  288|    649|  do {                                                  \
  |  |  289|    649|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|    649|  __extension__({                                                       \
  |  |  |  |   46|    649|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 649, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|    649|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|   114k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|    649|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|    649|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|    649|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|    649|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|    649|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|    649|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|    649|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|    649|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|    649|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|    649|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|    649|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|    649|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|    649|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|    649|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|    649|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|    649|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|    649|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|    649|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|    649|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|    649|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|    649|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|    649|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|    649|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|    649|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|    649|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|    649|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|    649|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|    649|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|    649|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|    649|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|    649|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|    649|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|    649|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|    649|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|    649|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|    649|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|    649|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|    649|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|    649|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|    649|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|    649|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|    649|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|    649|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|    649|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|    649|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|    649|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|    649|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|    649|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|    649|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|    649|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|    649|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|    649|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|    649|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|    649|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|    649|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|    649|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|    649|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|    649|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|    649|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|    649|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|    649|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|    649|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|    649|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|    649|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|    649|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|    649|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|    649|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|    649|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|    649|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|    649|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|    649|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|    649|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|    649|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|    649|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|    649|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|    649|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|    649|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|    649|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|    649|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|    649|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|    649|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|    649|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|    649|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|    649|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|    649|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|    649|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|    649|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|    649|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|    649|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|    649|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|    649|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|    649|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|    649|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|    649|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|    649|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|    649|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|    649|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|    649|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|    649|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|    649|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|    649|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|    649|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|    649|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|    649|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|    649|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|    649|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|    649|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|    649|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|    649|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|    649|      )                                                                 \
  |  |  |  |  158|    649|    }                                                                   \
  |  |  |  |  159|    649|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|    649|  })
  |  |  ------------------
  |  |  290|    649|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 649]
  |  |  ------------------
  |  |  291|    649|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|    649|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|    649|      goto error;                                       \
  |  |  294|    649|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 649]
  |  |  ------------------
  ------------------
  401|    649|  }
  402|    649|  if(data->set.str[STRING_SSL_CRLFILE]) {
  ------------------
  |  Branch (402:6): [True: 649, False: 0]
  ------------------
  403|    649|    ERROR_CHECK_SETOPT(CURLOPT_CRLFILE, data->set.str[STRING_SSL_CRLFILE]);
  ------------------
  |  |  288|    649|  do {                                                  \
  |  |  289|    649|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|    649|  __extension__({                                                       \
  |  |  |  |   46|    649|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 649, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|    649|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|   114k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|    649|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|    649|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|    649|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|    649|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|    649|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|    649|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|    649|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|    649|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|    649|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|    649|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|    649|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|    649|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|    649|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|    649|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|    649|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|    649|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|    649|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|    649|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|    649|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|    649|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|    649|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|    649|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|    649|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|    649|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|    649|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|    649|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|    649|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|    649|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|    649|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|    649|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|    649|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|    649|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|    649|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|    649|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|    649|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|    649|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|    649|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|    649|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|    649|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|    649|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|    649|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|    649|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|    649|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|    649|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|    649|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|    649|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|    649|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|    649|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|    649|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|    649|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|    649|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|    649|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|    649|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|    649|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|    649|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|    649|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|    649|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|    649|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|    649|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|    649|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|    649|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|    649|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|    649|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|    649|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|    649|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|    649|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|    649|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|    649|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|    649|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|    649|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|    649|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|    649|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|    649|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|    649|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|    649|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|    649|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|    649|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|    649|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|    649|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|    649|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|    649|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|    649|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|    649|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|    649|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|    649|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|    649|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|    649|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|    649|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|    649|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|    649|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|    649|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|    649|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|    649|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|    649|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|    649|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|    649|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|    649|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|    649|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|    649|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|    649|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|    649|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|    649|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|    649|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|    649|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|    649|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|    649|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|    649|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|    649|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|    649|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|    649|      )                                                                 \
  |  |  |  |  158|    649|    }                                                                   \
  |  |  |  |  159|    649|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|    649|  })
  |  |  ------------------
  |  |  290|    649|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 649]
  |  |  ------------------
  |  |  291|    649|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|    649|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|    649|      goto error;                                       \
  |  |  294|    649|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 649]
  |  |  ------------------
  ------------------
  404|    649|  }
  405|    649|  if(data->set.ssl.certinfo)
  ------------------
  |  Branch (405:6): [True: 2, False: 647]
  ------------------
  406|      2|    ERROR_CHECK_SETOPT(CURLOPT_CERTINFO, 1L);
  ------------------
  |  |  288|      2|  do {                                                  \
  |  |  289|      2|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|      2|  __extension__({                                                       \
  |  |  |  |   46|      2|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 2, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|      2|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|    348|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|      2|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|      2|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|      2|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|      2|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|      2|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|      2|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|      2|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|      2|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|      2|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|      2|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|      2|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|      2|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|      2|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|      2|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|      2|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|      2|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|      2|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|      2|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|      2|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|      2|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|      2|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|      2|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|      2|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|      2|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|      2|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|      2|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|      2|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|      2|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|      2|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|      2|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|      2|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|      2|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|      2|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|      2|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|      2|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|      2|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|      2|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|      2|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|      2|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|      2|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|      2|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|      2|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|      2|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|      2|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|      2|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|      2|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|      2|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|      2|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|      2|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|      2|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|      2|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|      2|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|      2|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|      2|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|      2|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|      2|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|      2|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|      2|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|      2|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|      2|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|      2|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|      2|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|      2|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|      2|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|      2|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|      2|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|      2|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|      2|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|      2|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|      2|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|      2|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|      2|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|      2|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|      2|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|      2|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|      2|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|      2|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|      2|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|      2|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|      2|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|      2|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|      2|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|      2|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|      2|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|      2|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|      2|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|      2|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|      2|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|      2|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|      2|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|      2|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|      2|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|      2|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|      2|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|      2|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|      2|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|      2|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|      2|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|      2|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|      2|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|      2|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|      2|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|      2|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|      2|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|      2|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|      2|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|      2|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|      2|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|      2|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|      2|      )                                                                 \
  |  |  |  |  158|      2|    }                                                                   \
  |  |  |  |  159|      2|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|      2|  })
  |  |  ------------------
  |  |  290|      2|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 2]
  |  |  ------------------
  |  |  291|      2|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|      2|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|      2|      goto error;                                       \
  |  |  294|      2|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 2]
  |  |  ------------------
  ------------------
  407|    649|  if(data->set.ssl.fsslctx)
  ------------------
  |  Branch (407:6): [True: 0, False: 649]
  ------------------
  408|      0|    ERROR_CHECK_SETOPT(CURLOPT_SSL_CTX_FUNCTION, data->set.ssl.fsslctx);
  ------------------
  |  |  288|      0|  do {                                                  \
  |  |  289|      0|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|      0|  __extension__({                                                       \
  |  |  |  |   46|      0|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|      0|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|      0|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|      0|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|      0|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|      0|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|      0|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|      0|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|      0|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|      0|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|      0|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|      0|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|      0|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|      0|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|      0|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|      0|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|      0|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|      0|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|      0|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|      0|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|      0|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|      0|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|      0|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|      0|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|      0|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|      0|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|      0|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|      0|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|      0|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|      0|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|      0|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|      0|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|      0|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|      0|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|      0|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|      0|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|      0|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|      0|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|      0|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|      0|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|      0|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|      0|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|      0|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|      0|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|      0|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|      0|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|      0|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|      0|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|      0|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|      0|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|      0|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|      0|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|      0|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|      0|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|      0|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|      0|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|      0|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|      0|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|      0|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|      0|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|      0|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|      0|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|      0|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|      0|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|      0|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|      0|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|      0|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|      0|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|      0|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|      0|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|      0|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|      0|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|      0|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|      0|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|      0|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|      0|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|      0|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|      0|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|      0|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|      0|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|      0|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|      0|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|      0|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|      0|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|      0|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|      0|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|      0|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|      0|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|      0|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|      0|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|      0|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|      0|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|      0|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|      0|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|      0|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|      0|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|      0|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|      0|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|      0|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|      0|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|      0|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|      0|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|      0|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|      0|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|      0|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|      0|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|      0|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|      0|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|      0|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|      0|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|      0|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|      0|      )                                                                 \
  |  |  |  |  158|      0|    }                                                                   \
  |  |  |  |  159|      0|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|      0|  })
  |  |  ------------------
  |  |  290|      0|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  291|      0|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|      0|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|      0|      goto error;                                       \
  |  |  294|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  409|    649|  if(data->set.ssl.fsslctxp)
  ------------------
  |  Branch (409:6): [True: 0, False: 649]
  ------------------
  410|      0|    ERROR_CHECK_SETOPT(CURLOPT_SSL_CTX_DATA, data->set.ssl.fsslctxp);
  ------------------
  |  |  288|      0|  do {                                                  \
  |  |  289|      0|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|      0|  __extension__({                                                       \
  |  |  |  |   46|      0|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|      0|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|      0|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|      0|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|      0|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|      0|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|      0|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|      0|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|      0|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|      0|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|      0|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|      0|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|      0|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|      0|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|      0|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|      0|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|      0|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|      0|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|      0|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|      0|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|      0|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|      0|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|      0|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|      0|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|      0|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|      0|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|      0|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|      0|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|      0|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|      0|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|      0|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|      0|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|      0|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|      0|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|      0|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|      0|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|      0|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|      0|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|      0|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|      0|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|      0|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|      0|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|      0|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|      0|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|      0|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|      0|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|      0|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|      0|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|      0|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|      0|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|      0|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|      0|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|      0|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|      0|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|      0|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|      0|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|      0|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|      0|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|      0|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|      0|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|      0|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|      0|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|      0|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|      0|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|      0|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|      0|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|      0|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|      0|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|      0|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|      0|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|      0|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|      0|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|      0|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|      0|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|      0|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|      0|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|      0|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|      0|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|      0|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|      0|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|      0|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|      0|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|      0|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|      0|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|      0|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|      0|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|      0|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|      0|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|      0|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|      0|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|      0|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|      0|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|      0|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|      0|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|      0|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|      0|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|      0|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|      0|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|      0|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|      0|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|      0|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|      0|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|      0|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|      0|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|      0|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|      0|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|      0|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|      0|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|      0|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|      0|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|      0|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|      0|      )                                                                 \
  |  |  |  |  158|      0|    }                                                                   \
  |  |  |  |  159|      0|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|      0|  })
  |  |  ------------------
  |  |  290|      0|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  291|      0|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|      0|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|      0|      goto error;                                       \
  |  |  294|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  411|    649|  if(data->set.fdebug)
  ------------------
  |  Branch (411:6): [True: 0, False: 649]
  ------------------
  412|      0|    ERROR_CHECK_SETOPT(CURLOPT_DEBUGFUNCTION, data->set.fdebug);
  ------------------
  |  |  288|      0|  do {                                                  \
  |  |  289|      0|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|      0|  __extension__({                                                       \
  |  |  |  |   46|      0|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|      0|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|      0|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|      0|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|      0|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|      0|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|      0|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|      0|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|      0|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|      0|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|      0|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|      0|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|      0|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|      0|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|      0|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|      0|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|      0|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|      0|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|      0|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|      0|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|      0|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|      0|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|      0|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|      0|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|      0|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|      0|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|      0|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|      0|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|      0|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|      0|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|      0|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|      0|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|      0|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|      0|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|      0|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|      0|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|      0|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|      0|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|      0|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|      0|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|      0|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|      0|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|      0|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|      0|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|      0|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|      0|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|      0|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|      0|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|      0|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|      0|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|      0|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|      0|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|      0|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|      0|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|      0|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|      0|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|      0|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|      0|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|      0|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|      0|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|      0|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|      0|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|      0|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|      0|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|      0|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|      0|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|      0|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|      0|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|      0|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|      0|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|      0|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|      0|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|      0|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|      0|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|      0|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|      0|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|      0|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|      0|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|      0|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|      0|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|      0|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|      0|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|      0|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|      0|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|      0|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|      0|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|      0|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|      0|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|      0|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|      0|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|      0|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|      0|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|      0|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|      0|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|      0|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|      0|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|      0|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|      0|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|      0|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|      0|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|      0|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|      0|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|      0|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|      0|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|      0|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|      0|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|      0|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|      0|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|      0|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|      0|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|      0|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|      0|      )                                                                 \
  |  |  |  |  158|      0|    }                                                                   \
  |  |  |  |  159|      0|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|      0|  })
  |  |  ------------------
  |  |  290|      0|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  291|      0|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|      0|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|      0|      goto error;                                       \
  |  |  294|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  413|    649|  if(data->set.debugdata)
  ------------------
  |  Branch (413:6): [True: 0, False: 649]
  ------------------
  414|      0|    ERROR_CHECK_SETOPT(CURLOPT_DEBUGDATA, data->set.debugdata);
  ------------------
  |  |  288|      0|  do {                                                  \
  |  |  289|      0|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|      0|  __extension__({                                                       \
  |  |  |  |   46|      0|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 0, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|      0|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|      0|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|      0|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|      0|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|      0|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|      0|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|      0|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|      0|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|      0|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|      0|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|      0|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|      0|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|      0|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|      0|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|      0|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|      0|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|      0|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|      0|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|      0|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|      0|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|      0|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|      0|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|      0|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|      0|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|      0|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|      0|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|      0|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|      0|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|      0|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|      0|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|      0|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|      0|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|      0|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|      0|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|      0|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|      0|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|      0|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|      0|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|      0|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|      0|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|      0|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|      0|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|      0|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|      0|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|      0|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|      0|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|      0|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|      0|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|      0|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|      0|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|      0|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|      0|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|      0|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|      0|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|      0|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|      0|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|      0|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|      0|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|      0|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|      0|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|      0|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|      0|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|      0|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|      0|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|      0|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|      0|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|      0|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|      0|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|      0|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|      0|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|      0|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|      0|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|      0|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|      0|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|      0|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|      0|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|      0|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|      0|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|      0|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|      0|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|      0|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|      0|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|      0|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|      0|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|      0|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|      0|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|      0|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|      0|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|      0|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|      0|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|      0|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|      0|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|      0|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|      0|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|      0|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|      0|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|      0|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|      0|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|      0|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|      0|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|      0|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|      0|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|      0|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|      0|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|      0|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|      0|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|      0|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|      0|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|      0|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|      0|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|      0|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|      0|      )                                                                 \
  |  |  |  |  158|      0|    }                                                                   \
  |  |  |  |  159|      0|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|      0|  })
  |  |  ------------------
  |  |  290|      0|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  291|      0|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|      0|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|      0|      goto error;                                       \
  |  |  294|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  415|    649|  if(data->set.str[STRING_SSL_EC_CURVES]) {
  ------------------
  |  Branch (415:6): [True: 8, False: 641]
  ------------------
  416|      8|    ERROR_CHECK_SETOPT(CURLOPT_SSL_EC_CURVES,
  ------------------
  |  |  288|      8|  do {                                                  \
  |  |  289|      8|    result = curl_easy_setopt((CURL *)doh, x, y);       \
  |  |  ------------------
  |  |  |  |   45|      8|  __extension__({                                                       \
  |  |  |  |   46|      8|    if(__builtin_constant_p(option)) {                                  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (46:8): [True: 8, Folded]
  |  |  |  |  ------------------
  |  |  |  |   47|      8|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   59|  1.41k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (59:49): [Folded, False: 8]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   48|      8|        if(curlcheck_long_option(option))                               \
  |  |  |  |   49|      8|          if(!curlcheck_long(value))                                    \
  |  |  |  |   50|      8|            Wcurl_easy_setopt_err_long();                               \
  |  |  |  |   51|      8|        if(curlcheck_off_t_option(option))                              \
  |  |  |  |   52|      8|          if(!curlcheck_off_t(value))                                   \
  |  |  |  |   53|      8|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |  |  |   54|      8|        if(curlcheck_string_option(option))                             \
  |  |  |  |   55|      8|          if(!curlcheck_string(value))                                  \
  |  |  |  |   56|      8|            Wcurl_easy_setopt_err_string();                             \
  |  |  |  |   57|      8|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |  |  |   58|      8|        if(curlcheck_write_cb_option(option))                           \
  |  |  |  |   59|      8|          if(!curlcheck_write_cb(value))                                \
  |  |  |  |   60|      8|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |  |  |   61|      8|        if(curlcheck_curl_option(option))                               \
  |  |  |  |   62|      8|          if(!curlcheck_curl(value))                                    \
  |  |  |  |   63|      8|            Wcurl_easy_setopt_err_curl();                               \
  |  |  |  |   64|      8|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |  |  |   65|      8|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |  |  |   66|      8|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |  |  |   67|      8|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |  |  |   68|      8|          if(!curlcheck_read_cb(value))                                 \
  |  |  |  |   69|      8|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |  |  |   70|      8|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |  |  |   71|      8|          if(!curlcheck_ioctl_cb(value))                                \
  |  |  |  |   72|      8|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |  |  |   73|      8|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |  |  |   74|      8|          if(!curlcheck_sockopt_cb(value))                              \
  |  |  |  |   75|      8|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |  |  |   76|      8|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |  |  |   77|      8|          if(!curlcheck_opensocket_cb(value))                           \
  |  |  |  |   78|      8|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |  |  |   79|      8|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |  |  |   80|      8|          if(!curlcheck_progress_cb(value))                             \
  |  |  |  |   81|      8|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |  |  |   82|      8|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |  |  |   83|      8|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |  |  |   84|      8|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |  |  |   85|      8|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |  |  |   86|      8|          if(!curlcheck_debug_cb(value))                                \
  |  |  |  |   87|      8|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |  |  |   88|      8|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |  |  |   89|      8|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |  |  |   90|      8|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |  |  |   91|      8|        if(curlcheck_conv_cb_option(option))                            \
  |  |  |  |   92|      8|          if(!curlcheck_conv_cb(value))                                 \
  |  |  |  |   93|      8|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |  |  |   94|      8|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |  |  |   95|      8|          if(!curlcheck_seek_cb(value))                                 \
  |  |  |  |   96|      8|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |  |  |   97|      8|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |  |  |   98|      8|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |  |  |   99|      8|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  |  |  100|      8|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  |  |  101|      8|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  |  |  102|      8|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  |  |  103|      8|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  |  |  104|      8|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  |  |  105|      8|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  |  |  106|      8|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  |  |  107|      8|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  |  |  108|      8|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  |  |  109|      8|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  |  |  110|      8|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  |  |  111|      8|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  |  |  112|      8|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  |  |  113|      8|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  |  |  114|      8|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  |  |  115|      8|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  |  |  116|      8|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  |  |  117|      8|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  |  |  118|      8|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  |  |  119|      8|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  |  |  120|      8|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  |  |  121|      8|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  |  |  122|      8|          if(!curlcheck_interleave_cb(value))                           \
  |  |  |  |  123|      8|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  |  |  124|      8|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  |  |  125|      8|          if(!curlcheck_prereq_cb(value))                               \
  |  |  |  |  126|      8|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  |  |  127|      8|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  |  |  128|      8|          if(!curlcheck_trailer_cb(value))                              \
  |  |  |  |  129|      8|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  |  |  130|      8|        if(curlcheck_cb_data_option(option))                            \
  |  |  |  |  131|      8|          if(!curlcheck_cb_data(value))                                 \
  |  |  |  |  132|      8|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  |  |  133|      8|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  |  |  134|      8|          if(!curlcheck_error_buffer(value))                            \
  |  |  |  |  135|      8|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  |  |  136|      8|        if((option) == CURLOPT_CURLU)                                   \
  |  |  |  |  137|      8|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  |  |  138|      8|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  |  |  139|      8|        if((option) == CURLOPT_STDERR)                                  \
  |  |  |  |  140|      8|          if(!curlcheck_FILE(value))                                    \
  |  |  |  |  141|      8|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  |  |  142|      8|        if(curlcheck_postfields_option(option))                         \
  |  |  |  |  143|      8|          if(!curlcheck_postfields(value))                              \
  |  |  |  |  144|      8|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  |  |  145|      8|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  |  |  146|      8|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  |  |  147|      8|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  |  |  148|      8|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  |  |  149|      8|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  |  |  150|      8|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  |  |  151|      8|        if(curlcheck_slist_option(option))                              \
  |  |  |  |  152|      8|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  |  |  153|      8|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  |  |  154|      8|        if((option) == CURLOPT_SHARE)                                   \
  |  |  |  |  155|      8|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  |  |  156|      8|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  |  |  157|      8|      )                                                                 \
  |  |  |  |  158|      8|    }                                                                   \
  |  |  |  |  159|      8|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  |  |  160|      8|  })
  |  |  ------------------
  |  |  290|      8|    if(result &&                                        \
  |  |  ------------------
  |  |  |  Branch (290:8): [True: 0, False: 8]
  |  |  ------------------
  |  |  291|      8|       result != CURLE_NOT_BUILT_IN &&                  \
  |  |  ------------------
  |  |  |  Branch (291:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  292|      8|       result != CURLE_UNKNOWN_OPTION)                  \
  |  |  ------------------
  |  |  |  Branch (292:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  293|      8|      goto error;                                       \
  |  |  294|      8|  } while(0)
  |  |  ------------------
  |  |  |  Branch (294:11): [Folded, False: 8]
  |  |  ------------------
  ------------------
  417|      8|                       data->set.str[STRING_SSL_EC_CURVES]);
  418|      8|  }
  419|       |
  420|    649|  (void)curl_easy_setopt(doh, CURLOPT_SSL_OPTIONS,
  ------------------
  |  |   45|    649|  __extension__({                                                       \
  |  |   46|    649|    if(__builtin_constant_p(option)) {                                  \
  |  |  ------------------
  |  |  |  Branch (46:8): [True: 649, Folded]
  |  |  ------------------
  |  |   47|    649|      CURL_IGNORE_DEPRECATION(                                          \
  |  |  ------------------
  |  |  |  |   59|   112k|#define CURL_IGNORE_DEPRECATION(statements)     statements
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [True: 0, Folded]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 0]
  |  |  |  |  |  Branch (59:49): [Folded, False: 649]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   48|    649|        if(curlcheck_long_option(option))                               \
  |  |   49|    649|          if(!curlcheck_long(value))                                    \
  |  |   50|    649|            Wcurl_easy_setopt_err_long();                               \
  |  |   51|    649|        if(curlcheck_off_t_option(option))                              \
  |  |   52|    649|          if(!curlcheck_off_t(value))                                   \
  |  |   53|    649|            Wcurl_easy_setopt_err_curl_off_t();                         \
  |  |   54|    649|        if(curlcheck_string_option(option))                             \
  |  |   55|    649|          if(!curlcheck_string(value))                                  \
  |  |   56|    649|            Wcurl_easy_setopt_err_string();                             \
  |  |   57|    649|        if((option) == CURLOPT_PRIVATE) { }                             \
  |  |   58|    649|        if(curlcheck_write_cb_option(option))                           \
  |  |   59|    649|          if(!curlcheck_write_cb(value))                                \
  |  |   60|    649|            Wcurl_easy_setopt_err_write_callback();                     \
  |  |   61|    649|        if(curlcheck_curl_option(option))                               \
  |  |   62|    649|          if(!curlcheck_curl(value))                                    \
  |  |   63|    649|            Wcurl_easy_setopt_err_curl();                               \
  |  |   64|    649|        if((option) == CURLOPT_RESOLVER_START_FUNCTION)                 \
  |  |   65|    649|          if(!curlcheck_resolver_start_callback(value))                 \
  |  |   66|    649|            Wcurl_easy_setopt_err_resolver_start_callback();            \
  |  |   67|    649|        if((option) == CURLOPT_READFUNCTION)                            \
  |  |   68|    649|          if(!curlcheck_read_cb(value))                                 \
  |  |   69|    649|            Wcurl_easy_setopt_err_read_cb();                            \
  |  |   70|    649|        if((option) == CURLOPT_IOCTLFUNCTION)                           \
  |  |   71|    649|          if(!curlcheck_ioctl_cb(value))                                \
  |  |   72|    649|            Wcurl_easy_setopt_err_ioctl_cb();                           \
  |  |   73|    649|        if((option) == CURLOPT_SOCKOPTFUNCTION)                         \
  |  |   74|    649|          if(!curlcheck_sockopt_cb(value))                              \
  |  |   75|    649|            Wcurl_easy_setopt_err_sockopt_cb();                         \
  |  |   76|    649|        if((option) == CURLOPT_OPENSOCKETFUNCTION)                      \
  |  |   77|    649|          if(!curlcheck_opensocket_cb(value))                           \
  |  |   78|    649|            Wcurl_easy_setopt_err_opensocket_cb();                      \
  |  |   79|    649|        if((option) == CURLOPT_PROGRESSFUNCTION)                        \
  |  |   80|    649|          if(!curlcheck_progress_cb(value))                             \
  |  |   81|    649|            Wcurl_easy_setopt_err_progress_cb();                        \
  |  |   82|    649|        if((option) == CURLOPT_XFERINFOFUNCTION)                        \
  |  |   83|    649|          if(!curlcheck_xferinfo_cb(value))                             \
  |  |   84|    649|            Wcurl_easy_setopt_err_xferinfo_cb();                        \
  |  |   85|    649|        if((option) == CURLOPT_DEBUGFUNCTION)                           \
  |  |   86|    649|          if(!curlcheck_debug_cb(value))                                \
  |  |   87|    649|            Wcurl_easy_setopt_err_debug_cb();                           \
  |  |   88|    649|        if((option) == CURLOPT_SSL_CTX_FUNCTION)                        \
  |  |   89|    649|          if(!curlcheck_ssl_ctx_cb(value))                              \
  |  |   90|    649|            Wcurl_easy_setopt_err_ssl_ctx_cb();                         \
  |  |   91|    649|        if(curlcheck_conv_cb_option(option))                            \
  |  |   92|    649|          if(!curlcheck_conv_cb(value))                                 \
  |  |   93|    649|            Wcurl_easy_setopt_err_conv_cb();                            \
  |  |   94|    649|        if((option) == CURLOPT_SEEKFUNCTION)                            \
  |  |   95|    649|          if(!curlcheck_seek_cb(value))                                 \
  |  |   96|    649|            Wcurl_easy_setopt_err_seek_cb();                            \
  |  |   97|    649|        if((option) == CURLOPT_CHUNK_BGN_FUNCTION)                      \
  |  |   98|    649|          if(!curlcheck_chunk_bgn_cb(value))                            \
  |  |   99|    649|            Wcurl_easy_setopt_err_chunk_bgn_cb();                       \
  |  |  100|    649|        if((option) == CURLOPT_CHUNK_END_FUNCTION)                      \
  |  |  101|    649|          if(!curlcheck_chunk_end_cb(value))                            \
  |  |  102|    649|            Wcurl_easy_setopt_err_chunk_end_cb();                       \
  |  |  103|    649|        if((option) == CURLOPT_CLOSESOCKETFUNCTION)                     \
  |  |  104|    649|          if(!curlcheck_close_socket_cb(value))                         \
  |  |  105|    649|            Wcurl_easy_setopt_err_close_socket_cb();                    \
  |  |  106|    649|        if((option) == CURLOPT_FNMATCH_FUNCTION)                        \
  |  |  107|    649|          if(!curlcheck_fnmatch_cb(value))                              \
  |  |  108|    649|            Wcurl_easy_setopt_err_fnmatch_cb();                         \
  |  |  109|    649|        if((option) == CURLOPT_HSTSREADFUNCTION)                        \
  |  |  110|    649|          if(!curlcheck_hstsread_cb(value))                             \
  |  |  111|    649|            Wcurl_easy_setopt_err_hstsread_cb();                        \
  |  |  112|    649|        if((option) == CURLOPT_HSTSWRITEFUNCTION)                       \
  |  |  113|    649|          if(!curlcheck_hstswrite_cb(value))                            \
  |  |  114|    649|            Wcurl_easy_setopt_err_hstswrite_cb();                       \
  |  |  115|    649|        if((option) == CURLOPT_SSH_HOSTKEYFUNCTION)                     \
  |  |  116|    649|          if(!curlcheck_ssh_hostkey_cb(value))                          \
  |  |  117|    649|            Wcurl_easy_setopt_err_ssh_hostkey_cb();                     \
  |  |  118|    649|        if((option) == CURLOPT_SSH_KEYFUNCTION)                         \
  |  |  119|    649|          if(!curlcheck_ssh_key_cb(value))                              \
  |  |  120|    649|            Wcurl_easy_setopt_err_ssh_key_cb();                         \
  |  |  121|    649|        if((option) == CURLOPT_INTERLEAVEFUNCTION)                      \
  |  |  122|    649|          if(!curlcheck_interleave_cb(value))                           \
  |  |  123|    649|            Wcurl_easy_setopt_err_interleave_cb();                      \
  |  |  124|    649|        if((option) == CURLOPT_PREREQFUNCTION)                          \
  |  |  125|    649|          if(!curlcheck_prereq_cb(value))                               \
  |  |  126|    649|            Wcurl_easy_setopt_err_prereq_cb();                          \
  |  |  127|    649|        if((option) == CURLOPT_TRAILERFUNCTION)                         \
  |  |  128|    649|          if(!curlcheck_trailer_cb(value))                              \
  |  |  129|    649|            Wcurl_easy_setopt_err_trailer_cb();                         \
  |  |  130|    649|        if(curlcheck_cb_data_option(option))                            \
  |  |  131|    649|          if(!curlcheck_cb_data(value))                                 \
  |  |  132|    649|            Wcurl_easy_setopt_err_cb_data();                            \
  |  |  133|    649|        if((option) == CURLOPT_ERRORBUFFER)                             \
  |  |  134|    649|          if(!curlcheck_error_buffer(value))                            \
  |  |  135|    649|            Wcurl_easy_setopt_err_error_buffer();                       \
  |  |  136|    649|        if((option) == CURLOPT_CURLU)                                   \
  |  |  137|    649|          if(!curlcheck_ptr((value), CURLU))                            \
  |  |  138|    649|            Wcurl_easy_setopt_err_curlu();                              \
  |  |  139|    649|        if((option) == CURLOPT_STDERR)                                  \
  |  |  140|    649|          if(!curlcheck_FILE(value))                                    \
  |  |  141|    649|            Wcurl_easy_setopt_err_FILE();                               \
  |  |  142|    649|        if(curlcheck_postfields_option(option))                         \
  |  |  143|    649|          if(!curlcheck_postfields(value))                              \
  |  |  144|    649|            Wcurl_easy_setopt_err_postfields();                         \
  |  |  145|    649|        if((option) == CURLOPT_HTTPPOST)                                \
  |  |  146|    649|          if(!curlcheck_arr((value), struct curl_httppost))             \
  |  |  147|    649|            Wcurl_easy_setopt_err_curl_httpost();                       \
  |  |  148|    649|        if((option) == CURLOPT_MIMEPOST)                                \
  |  |  149|    649|          if(!curlcheck_ptr((value), curl_mime))                        \
  |  |  150|    649|            Wcurl_easy_setopt_err_curl_mimepost();                      \
  |  |  151|    649|        if(curlcheck_slist_option(option))                              \
  |  |  152|    649|          if(!curlcheck_arr((value), struct curl_slist))                \
  |  |  153|    649|            Wcurl_easy_setopt_err_curl_slist();                         \
  |  |  154|    649|        if((option) == CURLOPT_SHARE)                                   \
  |  |  155|    649|          if(!curlcheck_ptr((value), CURLSH))                           \
  |  |  156|    649|            Wcurl_easy_setopt_err_CURLSH();                             \
  |  |  157|    649|      )                                                                 \
  |  |  158|    649|    }                                                                   \
  |  |  159|    649|    (curl_easy_setopt)(handle, option, value);                          \
  |  |  160|    649|  })
  ------------------
  421|    649|                         (long)data->set.ssl.primary.ssl_options);
  422|       |
  423|    649|  doh->state.internal = TRUE;
  ------------------
  |  | 1055|    649|#define TRUE true
  ------------------
  424|    649|  doh->master_mid = data->mid; /* master transfer of this one */
  425|       |
  426|    649|  result = Curl_meta_set(doh, CURL_EZM_DOH_PROBE, doh_req, doh_probe_dtor);
  ------------------
  |  |   84|    649|#define CURL_EZM_DOH_PROBE   "ezm:doh-p"
  ------------------
  427|    649|  doh_req = NULL; /* call took ownership */
  428|    649|  if(result)
  ------------------
  |  Branch (428:6): [True: 0, False: 649]
  ------------------
  429|      0|    goto error;
  430|       |
  431|       |  /* DoH handles must not inherit private_data. The handles may be passed to
  432|       |     the user via callbacks and the user will be able to identify them as
  433|       |     internal handles because private data is not set. The user can then set
  434|       |     private_data via CURLOPT_PRIVATE if they so choose. */
  435|    649|  DEBUGASSERT(!doh->set.private_data);
  ------------------
  |  | 1081|    649|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (435:3): [True: 0, False: 649]
  |  Branch (435:3): [True: 649, False: 0]
  ------------------
  436|       |
  437|    649|  if(curl_multi_add_handle(multi, doh))
  ------------------
  |  Branch (437:6): [True: 0, False: 649]
  ------------------
  438|      0|    goto error;
  439|       |
  440|    649|  *pmid = doh->mid;
  441|    649|  return CURLE_OK;
  442|       |
  443|      8|error:
  444|      8|  Curl_close(&doh);
  445|      8|  if(doh_req)
  ------------------
  |  Branch (445:6): [True: 8, False: 0]
  ------------------
  446|      8|    doh_probe_dtor(NULL, 0, doh_req);
  447|      8|  return result;
  448|    649|}
doh.c:doh_probe_dtor:
  276|    657|{
  277|    657|  (void)key;
  278|    657|  (void)klen;
  279|    657|  if(e) {
  ------------------
  |  Branch (279:6): [True: 657, False: 0]
  ------------------
  280|    657|    struct doh_request *doh_req = e;
  281|    657|    curl_slist_free_all(doh_req->req_hds);
  282|    657|    curlx_dyn_free(&doh_req->resp_body);
  283|    657|    curlx_free(e);
  ------------------
  |  | 1483|    657|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  284|    657|  }
  285|    657|}
doh.c:doh2ai:
  938|    223|{
  939|    223|  struct Curl_addrinfo *ai;
  940|    223|  struct Curl_addrinfo *prevai = NULL;
  941|    223|  struct Curl_addrinfo *firstai = NULL;
  942|    223|  struct sockaddr_in *addr;
  943|    223|#ifdef USE_IPV6
  944|    223|  struct sockaddr_in6 *addr6;
  945|    223|#endif
  946|    223|  CURLcode result = CURLE_OK;
  947|    223|  int i;
  948|    223|  size_t hostlen = strlen(hostname) + 1; /* include null-terminator */
  949|       |
  950|    223|  DEBUGASSERT(de);
  ------------------
  |  | 1081|    223|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (950:3): [True: 0, False: 223]
  |  Branch (950:3): [True: 223, False: 0]
  ------------------
  951|       |
  952|    223|  if(!de->numaddr)
  ------------------
  |  Branch (952:6): [True: 223, False: 0]
  ------------------
  953|    223|    return CURLE_COULDNT_RESOLVE_HOST;
  954|       |
  955|      0|  for(i = 0; i < de->numaddr; i++) {
  ------------------
  |  Branch (955:14): [True: 0, False: 0]
  ------------------
  956|      0|    size_t ss_size;
  957|      0|    CURL_SA_FAMILY_T addrtype;
  ------------------
  |  | 1275|      0|#    define CURL_SA_FAMILY_T sa_family_t
  ------------------
  958|      0|    if(de->addr[i].type == CURL_DNS_TYPE_AAAA) {
  ------------------
  |  Branch (958:8): [True: 0, False: 0]
  ------------------
  959|       |#ifndef USE_IPV6
  960|       |      /* we cannot handle IPv6 addresses */
  961|       |      continue;
  962|       |#else
  963|      0|      ss_size = sizeof(struct sockaddr_in6);
  964|      0|      addrtype = AF_INET6;
  965|      0|#endif
  966|      0|    }
  967|      0|    else {
  968|      0|      ss_size = sizeof(struct sockaddr_in);
  969|      0|      addrtype = AF_INET;
  970|      0|    }
  971|       |
  972|      0|    ai = curlx_calloc(1, sizeof(struct Curl_addrinfo) + ss_size + hostlen);
  ------------------
  |  | 1480|      0|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  973|      0|    if(!ai) {
  ------------------
  |  Branch (973:8): [True: 0, False: 0]
  ------------------
  974|      0|      result = CURLE_OUT_OF_MEMORY;
  975|      0|      break;
  976|      0|    }
  977|      0|    ai->ai_addr = (void *)((char *)ai + sizeof(struct Curl_addrinfo));
  978|      0|    ai->ai_canonname = (void *)((char *)ai->ai_addr + ss_size);
  979|      0|    memcpy(ai->ai_canonname, hostname, hostlen);
  980|       |
  981|      0|    if(!firstai)
  ------------------
  |  Branch (981:8): [True: 0, False: 0]
  ------------------
  982|       |      /* store the pointer we want to return from this function */
  983|      0|      firstai = ai;
  984|       |
  985|      0|    if(prevai)
  ------------------
  |  Branch (985:8): [True: 0, False: 0]
  ------------------
  986|       |      /* make the previous entry point to this */
  987|      0|      prevai->ai_next = ai;
  988|       |
  989|      0|    ai->ai_family = addrtype;
  990|       |
  991|       |    /* we return all names as STREAM, so when using this address for TFTP
  992|       |       the type must be ignored and conn->socktype be used instead! */
  993|      0|    ai->ai_socktype = SOCK_STREAM;
  994|       |
  995|      0|    ai->ai_addrlen = (curl_socklen_t)ss_size;
  996|       |
  997|       |    /* leave the rest of the struct filled with zero */
  998|       |
  999|      0|    switch(ai->ai_family) {
  ------------------
  |  Branch (999:12): [True: 0, False: 0]
  ------------------
 1000|      0|    case AF_INET:
  ------------------
  |  Branch (1000:5): [True: 0, False: 0]
  ------------------
 1001|      0|      addr = (void *)ai->ai_addr; /* storage area for this info */
 1002|      0|      DEBUGASSERT(sizeof(struct in_addr) == sizeof(de->addr[i].ip.v4));
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1002:7): [True: 0, Folded]
  |  Branch (1002:7): [True: 0, Folded]
  ------------------
 1003|      0|      memcpy(&addr->sin_addr, &de->addr[i].ip.v4, sizeof(struct in_addr));
 1004|      0|      addr->sin_family = addrtype;
 1005|      0|      addr->sin_port = htons((unsigned short)port);
 1006|      0|      break;
 1007|       |
 1008|      0|#ifdef USE_IPV6
 1009|      0|    case AF_INET6:
  ------------------
  |  Branch (1009:5): [True: 0, False: 0]
  ------------------
 1010|      0|      addr6 = (void *)ai->ai_addr; /* storage area for this info */
 1011|      0|      DEBUGASSERT(sizeof(struct in6_addr) == sizeof(de->addr[i].ip.v6));
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1011:7): [True: 0, Folded]
  |  Branch (1011:7): [True: 0, Folded]
  ------------------
 1012|      0|      memcpy(&addr6->sin6_addr, &de->addr[i].ip.v6, sizeof(struct in6_addr));
 1013|      0|      addr6->sin6_family = addrtype;
 1014|      0|      addr6->sin6_port = htons((unsigned short)port);
 1015|      0|      break;
 1016|      0|#endif
 1017|      0|    }
 1018|       |
 1019|      0|    prevai = ai;
 1020|      0|  }
 1021|       |
 1022|      0|  if(result) {
  ------------------
  |  Branch (1022:6): [True: 0, False: 0]
  ------------------
 1023|      0|    Curl_freeaddrinfo(firstai);
 1024|      0|    firstai = NULL;
 1025|      0|  }
 1026|      0|  *aip = firstai;
 1027|       |
 1028|      0|  return result;
 1029|      0|}
doh.c:doh_close:
 1321|    559|{
 1322|    559|  struct doh_probes *doh = async ? async->doh : NULL;
  ------------------
  |  Branch (1322:28): [True: 559, False: 0]
  ------------------
 1323|    559|  if(doh && data->multi) {
  ------------------
  |  Branch (1323:6): [True: 559, False: 0]
  |  Branch (1323:13): [True: 559, False: 0]
  ------------------
 1324|    559|    struct Curl_easy *probe_data;
 1325|    559|    uint32_t mid;
 1326|    559|    size_t slot;
 1327|  1.67k|    for(slot = 0; slot < DOH_SLOT_COUNT; slot++) {
  ------------------
  |  Branch (1327:19): [True: 1.11k, False: 559]
  ------------------
 1328|  1.11k|      mid = doh->probe_resp[slot].probe_mid;
 1329|  1.11k|      if(mid == UINT32_MAX)
  ------------------
  |  Branch (1329:10): [True: 469, False: 649]
  ------------------
 1330|    469|        continue;
 1331|    649|      doh->probe_resp[slot].probe_mid = UINT32_MAX;
 1332|       |      /* should have been called before data is removed from multi handle */
 1333|    649|      DEBUGASSERT(data->multi);
  ------------------
  |  | 1081|    649|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1333:7): [True: 0, False: 649]
  |  Branch (1333:7): [True: 649, False: 0]
  ------------------
 1334|    649|      probe_data = data->multi ? Curl_multi_get_easy(data->multi, mid) : NULL;
  ------------------
  |  Branch (1334:20): [True: 649, False: 0]
  ------------------
 1335|    649|      if(!probe_data) {
  ------------------
  |  Branch (1335:10): [True: 0, False: 649]
  ------------------
 1336|      0|        DEBUGF(infof(data, "Curl_doh_close: xfer for mid=%u not found!",
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1337|      0|                     doh->probe_resp[slot].probe_mid));
 1338|      0|        continue;
 1339|      0|      }
 1340|       |      /* data->multi might already be reset at this time */
 1341|    649|      curl_multi_remove_handle(data->multi, probe_data);
 1342|    649|      Curl_close(&probe_data);
 1343|    649|    }
 1344|    559|    data->sub_xfer_done = NULL;
 1345|    559|  }
 1346|    559|}

Curl_dynhds_init:
   59|  33.6k|{
   60|  33.6k|  DEBUGASSERT(dynhds);
  ------------------
  |  | 1081|  33.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (60:3): [True: 0, False: 33.6k]
  |  Branch (60:3): [True: 33.6k, False: 0]
  ------------------
   61|  33.6k|  DEBUGASSERT(max_strs_size);
  ------------------
  |  | 1081|  33.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (61:3): [True: 0, False: 33.6k]
  |  Branch (61:3): [True: 33.6k, False: 0]
  ------------------
   62|  33.6k|  dynhds->hds = NULL;
   63|  33.6k|  dynhds->hds_len = dynhds->hds_allc = dynhds->strs_len = 0;
   64|  33.6k|  dynhds->max_entries = max_entries;
   65|  33.6k|  dynhds->max_strs_size = max_strs_size;
   66|  33.6k|  dynhds->opts = 0;
   67|  33.6k|}
Curl_dynhds_free:
   70|  33.6k|{
   71|  33.6k|  DEBUGASSERT(dynhds);
  ------------------
  |  | 1081|  33.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (71:3): [True: 0, False: 33.6k]
  |  Branch (71:3): [True: 33.6k, False: 0]
  ------------------
   72|  33.6k|  if(dynhds->hds && dynhds->hds_len) {
  ------------------
  |  Branch (72:6): [True: 16.8k, False: 16.8k]
  |  Branch (72:21): [True: 16.8k, False: 0]
  ------------------
   73|  16.8k|    size_t i;
   74|  16.8k|    DEBUGASSERT(dynhds->hds);
  ------------------
  |  | 1081|  16.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (74:5): [True: 0, False: 16.8k]
  |  Branch (74:5): [True: 16.8k, False: 0]
  ------------------
   75|   314k|    for(i = 0; i < dynhds->hds_len; ++i) {
  ------------------
  |  Branch (75:16): [True: 297k, False: 16.8k]
  ------------------
   76|   297k|      entry_free(dynhds->hds[i]);
   77|   297k|    }
   78|  16.8k|  }
   79|  33.6k|  curlx_safefree(dynhds->hds);
  ------------------
  |  | 1327|  33.6k|  do {                      \
  |  | 1328|  33.6k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  33.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  33.6k|    (ptr) = NULL;           \
  |  | 1330|  33.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 33.6k]
  |  |  ------------------
  ------------------
   80|  33.6k|  dynhds->hds_len = dynhds->hds_allc = dynhds->strs_len = 0;
   81|  33.6k|}
Curl_dynhds_reset:
   84|  4.40k|{
   85|  4.40k|  DEBUGASSERT(dynhds);
  ------------------
  |  | 1081|  4.40k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (85:3): [True: 0, False: 4.40k]
  |  Branch (85:3): [True: 4.40k, False: 0]
  ------------------
   86|  4.40k|  if(dynhds->hds_len) {
  ------------------
  |  Branch (86:6): [True: 0, False: 4.40k]
  ------------------
   87|      0|    size_t i;
   88|      0|    DEBUGASSERT(dynhds->hds);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (88:5): [True: 0, False: 0]
  |  Branch (88:5): [True: 0, False: 0]
  ------------------
   89|      0|    for(i = 0; i < dynhds->hds_len; ++i) {
  ------------------
  |  Branch (89:16): [True: 0, False: 0]
  ------------------
   90|      0|      entry_free(dynhds->hds[i]);
   91|      0|      dynhds->hds[i] = NULL;
   92|      0|    }
   93|      0|  }
   94|  4.40k|  dynhds->hds_len = dynhds->strs_len = 0;
   95|  4.40k|}
Curl_dynhds_count:
   98|   137k|{
   99|   137k|  return dynhds->hds_len;
  100|   137k|}
Curl_dynhds_set_opts:
  103|  4.40k|{
  104|  4.40k|  dynhds->opts = opts;
  105|  4.40k|}
Curl_dynhds_getn:
  108|   132k|{
  109|   132k|  DEBUGASSERT(dynhds);
  ------------------
  |  | 1081|   132k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (109:3): [True: 0, False: 132k]
  |  Branch (109:3): [True: 132k, False: 0]
  ------------------
  110|   132k|  return (n < dynhds->hds_len) ? dynhds->hds[n] : NULL;
  ------------------
  |  Branch (110:10): [True: 132k, False: 0]
  ------------------
  111|   132k|}
Curl_dynhds_get:
  115|  4.39k|{
  116|  4.39k|  size_t i;
  117|  5.25k|  for(i = 0; i < dynhds->hds_len; ++i) {
  ------------------
  |  Branch (117:14): [True: 5.23k, False: 17]
  ------------------
  118|  5.23k|    if(dynhds->hds[i]->namelen == namelen &&
  ------------------
  |  Branch (118:8): [True: 4.53k, False: 696]
  ------------------
  119|  4.53k|       curl_strnequal(dynhds->hds[i]->name, name, namelen)) {
  ------------------
  |  Branch (119:8): [True: 4.37k, False: 166]
  ------------------
  120|  4.37k|      return dynhds->hds[i];
  121|  4.37k|    }
  122|  5.23k|  }
  123|     17|  return NULL;
  124|  4.39k|}
Curl_dynhds_add:
  134|   297k|{
  135|   297k|  struct dynhds_entry *entry = NULL;
  136|   297k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  137|       |
  138|   297k|  DEBUGASSERT(dynhds);
  ------------------
  |  | 1081|   297k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (138:3): [True: 0, False: 297k]
  |  Branch (138:3): [True: 297k, False: 0]
  ------------------
  139|   297k|  if(dynhds->max_entries && dynhds->hds_len >= dynhds->max_entries)
  ------------------
  |  Branch (139:6): [True: 0, False: 297k]
  |  Branch (139:29): [True: 0, False: 0]
  ------------------
  140|      0|    return CURLE_OUT_OF_MEMORY;
  141|   297k|  if(dynhds->strs_len + namelen + valuelen > dynhds->max_strs_size)
  ------------------
  |  Branch (141:6): [True: 0, False: 297k]
  ------------------
  142|      0|    return CURLE_OUT_OF_MEMORY;
  143|       |
  144|   297k|  entry = entry_new(name, namelen, value, valuelen, dynhds->opts);
  145|   297k|  if(!entry)
  ------------------
  |  Branch (145:6): [True: 0, False: 297k]
  ------------------
  146|      0|    goto out;
  147|       |
  148|   297k|  if(dynhds->hds_len + 1 >= dynhds->hds_allc) {
  ------------------
  |  Branch (148:6): [True: 32.1k, False: 265k]
  ------------------
  149|  32.1k|    size_t nallc = dynhds->hds_len + 16;
  150|  32.1k|    struct dynhds_entry **nhds;
  151|       |
  152|  32.1k|    if(dynhds->max_entries && nallc > dynhds->max_entries)
  ------------------
  |  Branch (152:8): [True: 0, False: 32.1k]
  |  Branch (152:31): [True: 0, False: 0]
  ------------------
  153|      0|      nallc = dynhds->max_entries;
  154|       |
  155|  32.1k|    nhds = curlx_calloc(nallc, sizeof(struct dynhds_entry *));
  ------------------
  |  | 1480|  32.1k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  156|  32.1k|    if(!nhds)
  ------------------
  |  Branch (156:8): [True: 0, False: 32.1k]
  ------------------
  157|      0|      goto out;
  158|  32.1k|    if(dynhds->hds) {
  ------------------
  |  Branch (158:8): [True: 15.3k, False: 16.8k]
  ------------------
  159|  15.3k|      memcpy(nhds, dynhds->hds,
  160|  15.3k|             dynhds->hds_len * sizeof(struct dynhds_entry *));
  161|  15.3k|      curlx_safefree(dynhds->hds);
  ------------------
  |  | 1327|  15.3k|  do {                      \
  |  | 1328|  15.3k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  15.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  15.3k|    (ptr) = NULL;           \
  |  | 1330|  15.3k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 15.3k]
  |  |  ------------------
  ------------------
  162|  15.3k|    }
  163|  32.1k|    dynhds->hds = nhds;
  164|  32.1k|    dynhds->hds_allc = nallc;
  165|  32.1k|  }
  166|   297k|  dynhds->hds[dynhds->hds_len++] = entry;
  167|   297k|  entry = NULL;
  168|   297k|  dynhds->strs_len += namelen + valuelen;
  169|   297k|  result = CURLE_OK;
  170|       |
  171|   297k|out:
  172|   297k|  if(entry)
  ------------------
  |  Branch (172:6): [True: 0, False: 297k]
  ------------------
  173|      0|    entry_free(entry);
  174|   297k|  return result;
  175|   297k|}
Curl_dynhds_cadd:
  179|  16.7k|{
  180|  16.7k|  return Curl_dynhds_add(dynhds, name, strlen(name), value, strlen(value));
  181|  16.7k|}
Curl_dynhds_h1_add_line:
  185|   134k|{
  186|   134k|  const char *p;
  187|   134k|  const char *name;
  188|   134k|  size_t namelen;
  189|   134k|  const char *value;
  190|   134k|  size_t valuelen, i;
  191|       |
  192|   134k|  if(!line || !line_len)
  ------------------
  |  Branch (192:6): [True: 0, False: 134k]
  |  Branch (192:15): [True: 0, False: 134k]
  ------------------
  193|      0|    return CURLE_OK;
  194|       |
  195|   134k|  p = memchr(line, ':', line_len);
  196|   134k|  if(!p)
  ------------------
  |  Branch (196:6): [True: 19, False: 134k]
  ------------------
  197|     19|    return CURLE_BAD_FUNCTION_ARGUMENT;
  198|   134k|  name = line;
  199|   134k|  namelen = p - line;
  200|   134k|  p++; /* move past the colon */
  201|   151k|  for(i = namelen + 1; i < line_len; ++i, ++p) {
  ------------------
  |  Branch (201:24): [True: 106k, False: 44.5k]
  ------------------
  202|   106k|    if(!ISBLANK(*p))
  ------------------
  |  |   45|   106k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 16.8k, False: 89.8k]
  |  |  |  Branch (45:38): [True: 218, False: 89.6k]
  |  |  ------------------
  ------------------
  203|  89.6k|      break;
  204|   106k|  }
  205|   134k|  value = p;
  206|   134k|  valuelen = line_len - i;
  207|       |
  208|   134k|  p = memchr(value, '\r', valuelen);
  209|   134k|  if(!p)
  ------------------
  |  Branch (209:6): [True: 132k, False: 1.64k]
  ------------------
  210|   132k|    p = memchr(value, '\n', valuelen);
  211|   134k|  if(p)
  ------------------
  |  Branch (211:6): [True: 1.64k, False: 132k]
  ------------------
  212|  1.64k|    valuelen = (size_t)(p - value);
  213|       |
  214|   134k|  return Curl_dynhds_add(dynhds, name, namelen, value, valuelen);
  215|   134k|}
Curl_dynhds_h1_cadd_line:
  218|  1.17k|{
  219|  1.17k|  return Curl_dynhds_h1_add_line(dynhds, line, line ? strlen(line) : 0);
  ------------------
  |  Branch (219:48): [True: 1.17k, False: 0]
  ------------------
  220|  1.17k|}
Curl_dynhds_h1_dprint:
  342|  7.97k|{
  343|  7.97k|  CURLcode result = CURLE_OK;
  344|  7.97k|  size_t i;
  345|       |
  346|  7.97k|  if(!dynhds->hds_len)
  ------------------
  |  Branch (346:6): [True: 0, False: 7.97k]
  ------------------
  347|      0|    return result;
  348|       |
  349|  27.7k|  for(i = 0; i < dynhds->hds_len; ++i) {
  ------------------
  |  Branch (349:14): [True: 19.7k, False: 7.97k]
  ------------------
  350|  19.7k|    result = curlx_dyn_addf(dbuf, "%.*s: %.*s\r\n",
  351|  19.7k|                            (int)dynhds->hds[i]->namelen, dynhds->hds[i]->name,
  352|  19.7k|                            (int)dynhds->hds[i]->valuelen,
  353|  19.7k|                            dynhds->hds[i]->value);
  354|  19.7k|    if(result)
  ------------------
  |  Branch (354:8): [True: 0, False: 19.7k]
  ------------------
  355|      0|      break;
  356|  19.7k|  }
  357|       |
  358|  7.97k|  return result;
  359|  7.97k|}
Curl_dynhds_to_nva:
  364|  4.40k|{
  365|  4.40k|  nghttp2_nv *nva = curlx_calloc(1, sizeof(nghttp2_nv) * dynhds->hds_len);
  ------------------
  |  | 1480|  4.40k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  366|  4.40k|  size_t i;
  367|       |
  368|  4.40k|  *pcount = 0;
  369|  4.40k|  if(!nva)
  ------------------
  |  Branch (369:6): [True: 0, False: 4.40k]
  ------------------
  370|      0|    return NULL;
  371|       |
  372|   149k|  for(i = 0; i < dynhds->hds_len; ++i) {
  ------------------
  |  Branch (372:14): [True: 144k, False: 4.40k]
  ------------------
  373|   144k|    struct dynhds_entry *e = dynhds->hds[i];
  374|   144k|    DEBUGASSERT(e);
  ------------------
  |  | 1081|   144k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (374:5): [True: 0, False: 144k]
  |  Branch (374:5): [True: 144k, False: 0]
  ------------------
  375|   144k|    nva[i].name = (unsigned char *)e->name;
  376|   144k|    nva[i].namelen = e->namelen;
  377|   144k|    nva[i].value = (unsigned char *)e->value;
  378|   144k|    nva[i].valuelen = e->valuelen;
  379|   144k|    nva[i].flags = NGHTTP2_NV_FLAG_NONE;
  380|   144k|  }
  381|  4.40k|  *pcount = dynhds->hds_len;
  382|  4.40k|  return nva;
  383|  4.40k|}
dynhds.c:entry_free:
   53|   297k|{
   54|   297k|  curlx_free(e);
  ------------------
  |  | 1483|   297k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   55|   297k|}
dynhds.c:entry_new:
   32|   297k|{
   33|   297k|  struct dynhds_entry *e;
   34|   297k|  char *p;
   35|       |
   36|   297k|  DEBUGASSERT(name);
  ------------------
  |  | 1081|   297k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (36:3): [True: 0, False: 297k]
  |  Branch (36:3): [True: 297k, False: 0]
  ------------------
   37|   297k|  DEBUGASSERT(value);
  ------------------
  |  | 1081|   297k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (37:3): [True: 0, False: 297k]
  |  Branch (37:3): [True: 297k, False: 0]
  ------------------
   38|   297k|  e = curlx_calloc(1, sizeof(*e) + namelen + valuelen + 2);
  ------------------
  |  | 1480|   297k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   39|   297k|  if(!e)
  ------------------
  |  Branch (39:6): [True: 0, False: 297k]
  ------------------
   40|      0|    return NULL;
   41|   297k|  e->name = p = (char *)e + sizeof(*e);
   42|   297k|  memcpy(p, name, namelen);
   43|   297k|  e->namelen = namelen;
   44|   297k|  e->value = p += namelen + 1; /* leave a \0 at the end of name */
   45|   297k|  memcpy(p, value, valuelen);
   46|   297k|  e->valuelen = valuelen;
   47|   297k|  if(opts & DYNHDS_OPT_LOWERCASE)
  ------------------
  |  |   54|   297k|#define DYNHDS_OPT_LOWERCASE     (1 << 0)
  ------------------
  |  Branch (47:6): [True: 144k, False: 152k]
  ------------------
   48|   144k|    Curl_strntolower(e->name, e->name, e->namelen);
   49|   297k|  return e;
   50|   297k|}

curl_easy_init:
  331|  35.9k|{
  332|  35.9k|  CURLcode result;
  333|  35.9k|  struct Curl_easy *data;
  334|       |
  335|       |  /* Make sure we inited the global SSL stuff */
  336|  35.9k|  global_init_lock();
  ------------------
  |  |   87|  35.9k|#define global_init_lock()   curl_simple_lock_lock(&s_lock)
  ------------------
  337|       |
  338|  35.9k|  if(!initialized) {
  ------------------
  |  Branch (338:6): [True: 1, False: 35.9k]
  ------------------
  339|      1|    result = global_init(CURL_GLOBAL_DEFAULT, TRUE);
  ------------------
  |  | 3022|      1|#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
  |  |  ------------------
  |  |  |  | 3020|      1|#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WIN32)
  |  |  |  |  ------------------
  |  |  |  |  |  | 3018|      1|#define CURL_GLOBAL_SSL (1 << 0) /* no purpose since 7.57.0 */
  |  |  |  |  ------------------
  |  |  |  |               #define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WIN32)
  |  |  |  |  ------------------
  |  |  |  |  |  | 3019|      1|#define CURL_GLOBAL_WIN32 (1 << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  result = global_init(CURL_GLOBAL_DEFAULT, TRUE);
  ------------------
  |  | 1055|      1|#define TRUE true
  ------------------
  340|      1|    if(result) {
  ------------------
  |  Branch (340:8): [True: 0, False: 1]
  ------------------
  341|       |      /* something in the global init failed, return nothing */
  342|      0|      DEBUGF(curl_mfprintf(stderr, "Error: curl_global_init failed\n"));
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  ------------------
  343|      0|      global_init_unlock();
  ------------------
  |  |   88|      0|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  344|      0|      return NULL;
  345|      0|    }
  346|      1|  }
  347|  35.9k|  global_init_unlock();
  ------------------
  |  |   88|  35.9k|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  348|       |
  349|       |  /* We use Curl_open() with undefined URL so far */
  350|  35.9k|  result = Curl_open(&data);
  351|  35.9k|  if(result) {
  ------------------
  |  Branch (351:6): [True: 0, False: 35.9k]
  ------------------
  352|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_open failed\n"));
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  ------------------
  353|      0|    return NULL;
  354|      0|  }
  355|       |
  356|  35.9k|  return data;
  357|  35.9k|}
curl_easy_cleanup:
  839|  18.7k|{
  840|  18.7k|  struct Curl_easy *data = curl;
  841|  18.7k|  if(GOOD_EASY_HANDLE(data)) {
  ------------------
  |  |  136|  18.7k|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  130|  18.7k|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  | 1055|  18.7k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (136:3): [True: 18.7k, False: 0]
  |  |  |  Branch (136:5): [True: 18.7k, False: 0]
  |  |  |  Branch (136:12): [True: 18.7k, False: 0]
  |  |  ------------------
  |  |  137|  18.7k|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (841:6): [True: 0, False: 0]
  |  Branch (841:6): [True: 0, False: 0]
  ------------------
  842|  18.7k|    struct Curl_sigpipe_ctx sigpipe_ctx;
  843|  18.7k|    sigpipe_ignore(data, &sigpipe_ctx);
  844|  18.7k|    Curl_close(&data);
  845|  18.7k|    sigpipe_restore(&sigpipe_ctx);
  846|  18.7k|  }
  847|  18.7k|}
Curl_meta_set:
 1378|  5.60k|{
 1379|  5.60k|  DEBUGASSERT(meta_data); /* never set to NULL */
  ------------------
  |  | 1081|  5.60k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1379:3): [True: 0, False: 5.60k]
  |  Branch (1379:3): [True: 5.60k, False: 0]
  ------------------
 1380|  5.60k|  if(!Curl_hash_add2(&data->meta_hash, CURL_UNCONST(key), strlen(key) + 1,
  ------------------
  |  |  866|  5.60k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  |  Branch (1380:6): [True: 0, False: 5.60k]
  ------------------
 1381|  5.60k|                     meta_data, meta_dtor)) {
 1382|      0|    meta_dtor(CURL_UNCONST(key), strlen(key) + 1, meta_data);
  ------------------
  |  |  866|      0|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
 1383|      0|    return CURLE_OUT_OF_MEMORY;
 1384|      0|  }
 1385|  5.60k|  return CURLE_OK;
 1386|  5.60k|}
Curl_meta_remove:
 1389|  18.2k|{
 1390|  18.2k|  Curl_hash_delete(&data->meta_hash, CURL_UNCONST(key), strlen(key) + 1);
  ------------------
  |  |  866|  18.2k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
 1391|  18.2k|}
Curl_meta_get:
 1394|   177k|{
 1395|   177k|  return Curl_hash_pick(&data->meta_hash, CURL_UNCONST(key), strlen(key) + 1);
  ------------------
  |  |  866|   177k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
 1396|   177k|}
easy.c:global_init:
  125|      1|{
  126|      1|  if(initialized++)
  ------------------
  |  Branch (126:6): [True: 0, False: 1]
  ------------------
  127|      0|    return CURLE_OK;
  128|       |
  129|      1|  if(memoryfuncs) {
  ------------------
  |  Branch (129:6): [True: 1, False: 0]
  ------------------
  130|       |    /* Setup the default memory functions here (again) */
  131|      1|    Curl_cmalloc = (curl_malloc_callback)malloc;
  132|      1|    Curl_cfree = (curl_free_callback)free;
  133|      1|    Curl_crealloc = (curl_realloc_callback)realloc;
  134|      1|    Curl_cstrdup = (curl_strdup_callback)CURLX_STRDUP_LOW;
  ------------------
  |  | 1472|      1|#define CURLX_STRDUP_LOW strdup
  ------------------
  135|      1|    Curl_ccalloc = (curl_calloc_callback)calloc;
  136|      1|  }
  137|       |
  138|      1|  if(Curl_trc_init()) {
  ------------------
  |  Branch (138:6): [True: 0, False: 1]
  ------------------
  139|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_trc_init failed\n"));
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  ------------------
  140|      0|    goto fail;
  141|      0|  }
  142|       |
  143|      1|  if(!Curl_ssl_init()) {
  ------------------
  |  Branch (143:6): [True: 0, False: 1]
  ------------------
  144|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_ssl_init failed\n"));
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  ------------------
  145|      0|    goto fail;
  146|      0|  }
  147|       |
  148|      1|  if(!Curl_vquic_init()) {
  ------------------
  |  |   54|      1|#define Curl_vquic_init() 1
  ------------------
  |  Branch (148:6): [Folded, False: 1]
  ------------------
  149|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_vquic_init failed\n"));
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  ------------------
  150|      0|    goto fail;
  151|      0|  }
  152|       |
  153|      1|  if(Curl_win32_init(flags)) {
  ------------------
  |  |   34|      1|#define Curl_win32_init(x) CURLE_OK
  |  |  ------------------
  |  |  |  Branch (34:28): [Folded, False: 1]
  |  |  ------------------
  ------------------
  154|      0|    DEBUGF(curl_mfprintf(stderr, "Error: win32_init failed\n"));
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  ------------------
  155|      0|    goto fail;
  156|      0|  }
  157|       |
  158|      1|  if(Curl_amiga_init()) {
  ------------------
  |  |   36|      1|#define Curl_amiga_init()    CURLE_OK
  |  |  ------------------
  |  |  |  Branch (36:30): [Folded, False: 1]
  |  |  ------------------
  ------------------
  159|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_amiga_init failed\n"));
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  ------------------
  160|      0|    goto fail;
  161|      0|  }
  162|       |
  163|      1|  if(Curl_macos_init()) {
  ------------------
  |  |   31|      1|#define Curl_macos_init() CURLE_OK
  |  |  ------------------
  |  |  |  Branch (31:27): [Folded, False: 1]
  |  |  ------------------
  ------------------
  164|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_macos_init failed\n"));
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  ------------------
  165|      0|    goto fail;
  166|      0|  }
  167|       |
  168|      1|  if(Curl_async_global_init()) {
  ------------------
  |  Branch (168:6): [True: 0, False: 1]
  ------------------
  169|      0|    DEBUGF(curl_mfprintf(stderr, "Error: resolver_global_init failed\n"));
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  ------------------
  170|      0|    goto fail;
  171|      0|  }
  172|       |
  173|      1|  if(Curl_ssh_init()) {
  ------------------
  |  |  259|      1|#define Curl_ssh_init() 0
  |  |  ------------------
  |  |  |  Branch (259:25): [Folded, False: 1]
  |  |  ------------------
  ------------------
  174|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_ssh_init failed\n"));
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  ------------------
  175|      0|    goto fail;
  176|      0|  }
  177|       |
  178|      1|  easy_init_flags = flags;
  179|       |
  180|      1|#ifdef DEBUGBUILD
  181|      1|  if(getenv("CURL_GLOBAL_INIT"))
  ------------------
  |  Branch (181:6): [True: 0, False: 1]
  ------------------
  182|       |    /* alloc data that will leak if *cleanup() is not called! */
  183|      0|    leakpointer = curlx_malloc(1);
  ------------------
  |  | 1478|      0|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  184|      1|#endif
  185|       |
  186|      1|  return CURLE_OK;
  187|       |
  188|      0|fail:
  189|      0|  initialized--; /* undo the increase */
  190|      0|  return CURLE_FAILED_INIT;
  191|      1|}

easy.c:curl_simple_lock_lock:
   64|  35.9k|{
   65|  35.9k|  for(;;) {
   66|  35.9k|    if(!atomic_exchange_explicit(lock, true, memory_order_acquire))
  ------------------
  |  Branch (66:8): [True: 35.9k, False: 0]
  ------------------
   67|  35.9k|      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|       |      __asm__ volatile("yield" ::: "memory");
   75|       |#elif defined(HAVE_SCHED_YIELD)
   76|       |      sched_yield();
   77|       |#endif
   78|      0|    }
   79|      0|  }
   80|  35.9k|}
easy.c:curl_simple_lock_unlock:
   83|  35.9k|{
   84|  35.9k|  atomic_store_explicit(lock, false, memory_order_release);
   85|  35.9k|}

curl_easy_escape:
   51|    413|{
   52|    413|  size_t len;
   53|    413|  struct dynbuf d;
   54|    413|  (void)curl;
   55|       |
   56|    413|  if(!string || (length < 0))
  ------------------
  |  Branch (56:6): [True: 0, False: 413]
  |  Branch (56:17): [True: 0, False: 413]
  ------------------
   57|      0|    return NULL;
   58|       |
   59|    413|  len = (length ? (size_t)length : strlen(string));
  ------------------
  |  Branch (59:10): [True: 0, False: 413]
  ------------------
   60|    413|  if(!len)
  ------------------
  |  Branch (60:6): [True: 0, False: 413]
  ------------------
   61|      0|    return curlx_strdup("");
  ------------------
  |  | 1477|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
   62|       |
   63|    413|  if(len > SIZE_MAX / 16)
  ------------------
  |  Branch (63:6): [True: 0, False: 413]
  ------------------
   64|      0|    return NULL;
   65|       |
   66|    413|  curlx_dyn_init(&d, (len * 3) + 1);
   67|       |
   68|  2.70k|  while(len--) {
  ------------------
  |  Branch (68:9): [True: 2.28k, False: 413]
  ------------------
   69|       |    /* treat the characters unsigned */
   70|  2.28k|    unsigned char in = (unsigned char)*string++;
   71|       |
   72|  2.28k|    if(ISUNRESERVED(in)) {
  ------------------
  |  |   49|  2.28k|#define ISUNRESERVED(x) (ISALNUM(x) || ISURLPUNTCS(x))
  |  |  ------------------
  |  |  |  |   41|  4.57k|#define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   44|  4.57k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (44:22): [True: 1.83k, False: 459]
  |  |  |  |  |  |  |  Branch (44:38): [True: 96, False: 1.73k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  4.48k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (43:22): [True: 882, False: 1.31k]
  |  |  |  |  |  |  |  Branch (43:38): [True: 832, False: 50]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.36k|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (42:22): [True: 902, False: 459]
  |  |  |  |  |  |  |  Branch (42:38): [True: 413, False: 489]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISUNRESERVED(x) (ISALNUM(x) || ISURLPUNTCS(x))
  |  |  ------------------
  |  |  |  |   48|    948|  (((x) == '-') || ((x) == '.') || ((x) == '_') || ((x) == '~'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (48:4): [True: 38, False: 910]
  |  |  |  |  |  Branch (48:20): [True: 421, False: 489]
  |  |  |  |  |  Branch (48:36): [True: 439, False: 50]
  |  |  |  |  |  Branch (48:52): [True: 50, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   73|       |      /* append this */
   74|  2.28k|      if(curlx_dyn_addn(&d, &in, 1))
  ------------------
  |  Branch (74:10): [True: 0, False: 2.28k]
  ------------------
   75|      0|        return NULL;
   76|  2.28k|    }
   77|      0|    else {
   78|       |      /* encode it */
   79|      0|      unsigned char out[3] = { '%' };
   80|      0|      Curl_hexbyte(&out[1], in);
   81|      0|      if(curlx_dyn_addn(&d, out, 3))
  ------------------
  |  Branch (81:10): [True: 0, False: 0]
  ------------------
   82|      0|        return NULL;
   83|      0|    }
   84|  2.28k|  }
   85|       |
   86|    413|  return curlx_dyn_ptr(&d);
   87|    413|}
Curl_urldecode:
  108|  18.1k|{
  109|  18.1k|  size_t alloc;
  110|  18.1k|  char *ns;
  111|       |
  112|  18.1k|  DEBUGASSERT(string);
  ------------------
  |  | 1081|  18.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (112:3): [True: 0, False: 18.1k]
  |  Branch (112:3): [True: 18.1k, False: 0]
  ------------------
  113|  18.1k|  DEBUGASSERT(ctrl >= REJECT_NADA); /* crash on TRUE/FALSE */
  ------------------
  |  | 1081|  18.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (113:3): [True: 0, False: 18.1k]
  |  Branch (113:3): [True: 18.1k, False: 0]
  ------------------
  114|       |
  115|  18.1k|  alloc = (length ? length : strlen(string));
  ------------------
  |  Branch (115:12): [True: 10.0k, False: 8.13k]
  ------------------
  116|  18.1k|  ns = curlx_malloc(alloc + 1);
  ------------------
  |  | 1478|  18.1k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  117|       |
  118|  18.1k|  if(!ns)
  ------------------
  |  Branch (118:6): [True: 0, False: 18.1k]
  ------------------
  119|      0|    return CURLE_OUT_OF_MEMORY;
  120|       |
  121|       |  /* store output string */
  122|  18.1k|  *ostring = ns;
  123|       |
  124|  6.32M|  while(alloc) {
  ------------------
  |  Branch (124:9): [True: 6.30M, False: 18.1k]
  ------------------
  125|  6.30M|    unsigned char in = (unsigned char)*string;
  126|  6.30M|    if(('%' == in) && (alloc > 2) &&
  ------------------
  |  Branch (126:8): [True: 117k, False: 6.19M]
  |  Branch (126:23): [True: 117k, False: 115]
  ------------------
  127|   117k|       ISXDIGIT(string[1]) && ISXDIGIT(string[2])) {
  ------------------
  |  |   39|  6.42M|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   44|   234k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 28.8k, False: 88.4k]
  |  |  |  |  |  Branch (44:38): [True: 5.87k, False: 23.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|   228k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 8.18k, False: 103k]
  |  |  |  |  |  Branch (27:43): [True: 4.88k, False: 3.29k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|   106k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 17.7k, False: 88.8k]
  |  |  |  |  |  Branch (28:43): [True: 13.8k, False: 3.86k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                     ISXDIGIT(string[1]) && ISXDIGIT(string[2])) {
  ------------------
  |  |   39|  24.6k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   44|  49.2k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 12.7k, False: 11.8k]
  |  |  |  |  |  Branch (44:38): [True: 1.57k, False: 11.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|  47.7k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 6.02k, False: 17.0k]
  |  |  |  |  |  Branch (27:43): [True: 1.40k, False: 4.61k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|  21.6k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 9.80k, False: 11.8k]
  |  |  |  |  |  Branch (28:43): [True: 4.33k, False: 5.46k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  128|       |      /* this is two hexadecimal digits following a '%' */
  129|  7.31k|      in = (unsigned char)((curlx_hexval(string[1]) << 4) |
  ------------------
  |  |  112|  7.31k|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  130|  7.31k|                           curlx_hexval(string[2]));
  ------------------
  |  |  112|  7.31k|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  131|  7.31k|      string += 3;
  132|  7.31k|      alloc -= 3;
  133|  7.31k|    }
  134|  6.30M|    else {
  135|  6.30M|      string++;
  136|  6.30M|      alloc--;
  137|  6.30M|    }
  138|       |
  139|  6.30M|    if(((ctrl == REJECT_CTRL) && (in < 0x20)) ||
  ------------------
  |  Branch (139:9): [True: 5.92M, False: 384k]
  |  Branch (139:34): [True: 9, False: 5.92M]
  ------------------
  140|  6.30M|       ((ctrl == REJECT_ZERO) && (in == 0))) {
  ------------------
  |  Branch (140:9): [True: 384k, False: 5.92M]
  |  Branch (140:34): [True: 6, False: 384k]
  ------------------
  141|     15|      curlx_safefree(*ostring);
  ------------------
  |  | 1327|     15|  do {                      \
  |  | 1328|     15|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|     15|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|     15|    (ptr) = NULL;           \
  |  | 1330|     15|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 15]
  |  |  ------------------
  ------------------
  142|     15|      return CURLE_URL_MALFORMAT;
  143|     15|    }
  144|       |
  145|  6.30M|    *ns++ = (char)in;
  146|  6.30M|  }
  147|  18.1k|  *ns = 0; /* terminate it */
  148|       |
  149|  18.1k|  if(olen)
  ------------------
  |  Branch (149:6): [True: 11.6k, False: 6.53k]
  ------------------
  150|       |    /* store output size */
  151|  11.6k|    *olen = ns - *ostring;
  152|       |
  153|  18.1k|  return CURLE_OK;
  154|  18.1k|}
curl_free:
  191|  16.2k|{
  192|  16.2k|  curlx_free(p);
  ------------------
  |  | 1483|  16.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  193|  16.2k|}
Curl_hexencode:
  203|  6.05k|{
  204|  6.05k|  DEBUGASSERT(src && len && (olen >= 3));
  ------------------
  |  | 1081|  6.05k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (204:3): [True: 0, False: 6.05k]
  |  Branch (204:3): [True: 0, False: 0]
  |  Branch (204:3): [True: 0, False: 0]
  |  Branch (204:3): [True: 6.05k, False: 0]
  |  Branch (204:3): [True: 6.05k, False: 0]
  |  Branch (204:3): [True: 6.05k, False: 0]
  ------------------
  205|  6.05k|  if(src && len && (olen >= 3)) {
  ------------------
  |  Branch (205:6): [True: 6.05k, False: 0]
  |  Branch (205:13): [True: 6.05k, False: 0]
  |  Branch (205:20): [True: 6.05k, False: 0]
  ------------------
  206|   199k|    while(len-- && (olen >= 3)) {
  ------------------
  |  Branch (206:11): [True: 193k, False: 6.05k]
  |  Branch (206:20): [True: 193k, False: 0]
  ------------------
  207|   193k|      out[0] = Curl_ldigits[*src >> 4];
  208|   193k|      out[1] = Curl_ldigits[*src & 0x0F];
  209|   193k|      ++src;
  210|   193k|      out += 2;
  211|   193k|      olen -= 2;
  212|   193k|    }
  213|  6.05k|    *out = 0;
  214|  6.05k|  }
  215|      0|  else if(olen)
  ------------------
  |  Branch (215:11): [True: 0, False: 0]
  ------------------
  216|      0|    *out = 0;
  217|  6.05k|}
Curl_hexbyte:
  225|   550k|{
  226|   550k|  dest[0] = Curl_udigits[val >> 4];
  227|   550k|  dest[1] = Curl_udigits[val & 0x0F];
  228|   550k|}

Curl_fileinfo_alloc:
   31|    789|{
   32|    789|  return curlx_calloc(1, sizeof(struct fileinfo));
  ------------------
  |  | 1480|    789|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   33|    789|}
Curl_fileinfo_cleanup:
   36|  1.20k|{
   37|  1.20k|  if(!finfo)
  ------------------
  |  Branch (37:6): [True: 415, False: 789]
  ------------------
   38|    415|    return;
   39|       |
   40|    789|  curlx_dyn_free(&finfo->buf);
   41|    789|  curlx_free(finfo);
  ------------------
  |  | 1483|    789|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   42|    789|}

curl_formadd:
  610|    158|{
  611|    158|  va_list arg;
  612|    158|  CURLFORMcode form;
  613|    158|  va_start(arg, last_post);
  614|    158|  form = FormAdd(httppost, last_post, arg);
  615|       |  va_end(arg);
  616|    158|  return form;
  617|    158|}
curl_formfree:
  665|    316|{
  666|    316|  struct curl_httppost *next;
  667|       |
  668|    316|  if(!form)
  ------------------
  |  Branch (668:6): [True: 158, False: 158]
  ------------------
  669|       |    /* no form to free, get out of this */
  670|    158|    return;
  671|       |
  672|    158|  do {
  673|    158|    next = form->next;  /* the following form line */
  674|       |
  675|       |    /* recurse to sub-contents */
  676|    158|    curl_formfree(form->more);
  677|       |
  678|    158|    if(!(form->flags & HTTPPOST_PTRNAME))
  ------------------
  |  |   39|    158|#define HTTPPOST_PTRNAME     CURL_HTTPPOST_PTRNAME
  |  |  ------------------
  |  |  |  |  209|    158|#define CURL_HTTPPOST_PTRNAME (1 << 2)
  |  |  ------------------
  ------------------
  |  Branch (678:8): [True: 158, False: 0]
  ------------------
  679|    158|      curlx_free(form->name); /* free the name */
  ------------------
  |  | 1483|    158|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  680|    158|    if(!(form->flags &
  ------------------
  |  Branch (680:8): [True: 0, False: 158]
  ------------------
  681|    158|         (HTTPPOST_PTRCONTENTS | HTTPPOST_BUFFER | HTTPPOST_CALLBACK)))
  ------------------
  |  |   41|    158|#define HTTPPOST_PTRCONTENTS CURL_HTTPPOST_PTRCONTENTS
  |  |  ------------------
  |  |  |  |  211|    158|#define CURL_HTTPPOST_PTRCONTENTS (1 << 3)
  |  |  ------------------
  ------------------
                       (HTTPPOST_PTRCONTENTS | HTTPPOST_BUFFER | HTTPPOST_CALLBACK)))
  ------------------
  |  |   45|    158|#define HTTPPOST_BUFFER      CURL_HTTPPOST_BUFFER
  |  |  ------------------
  |  |  |  |  213|    158|#define CURL_HTTPPOST_BUFFER (1 << 4)
  |  |  ------------------
  ------------------
                       (HTTPPOST_PTRCONTENTS | HTTPPOST_BUFFER | HTTPPOST_CALLBACK)))
  ------------------
  |  |   44|    158|#define HTTPPOST_CALLBACK    CURL_HTTPPOST_CALLBACK
  |  |  ------------------
  |  |  |  |  218|    158|#define CURL_HTTPPOST_CALLBACK (1 << 6)
  |  |  ------------------
  ------------------
  682|      0|      curlx_free(form->contents); /* free the contents */
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  683|    158|    curlx_free(form->contenttype); /* free the content type */
  ------------------
  |  | 1483|    158|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  684|    158|    curlx_free(form->showfilename); /* free the faked filename */
  ------------------
  |  | 1483|    158|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  685|    158|    curlx_free(form);       /* free the struct */
  ------------------
  |  | 1483|    158|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  686|    158|    form = next;
  687|    158|  } while(form); /* continue */
  ------------------
  |  Branch (687:11): [True: 0, False: 158]
  ------------------
  688|    158|}
Curl_getformdata:
  720|    106|{
  721|    106|  CURLcode result = CURLE_OK;
  722|    106|  curl_mime *form = NULL;
  723|    106|  curl_mimepart *part;
  724|    106|  struct curl_httppost *file;
  725|       |
  726|    106|  Curl_mime_cleanpart(finalform); /* default form is empty */
  727|       |
  728|    106|  if(!post)
  ------------------
  |  Branch (728:6): [True: 0, False: 106]
  ------------------
  729|      0|    return result; /* no input => no output! */
  730|       |
  731|    106|  form = curl_mime_init(data);
  732|    106|  if(!form)
  ------------------
  |  Branch (732:6): [True: 0, False: 106]
  ------------------
  733|      0|    result = CURLE_OUT_OF_MEMORY;
  734|       |
  735|    106|  if(!result)
  ------------------
  |  Branch (735:6): [True: 106, False: 0]
  ------------------
  736|    106|    result = curl_mime_subparts(finalform, form);
  737|       |
  738|       |  /* Process each top part. */
  739|    212|  for(; !result && post; post = post->next) {
  ------------------
  |  Branch (739:9): [True: 212, False: 0]
  |  Branch (739:20): [True: 106, False: 106]
  ------------------
  740|       |    /* If we have more than a file here, create a mime subpart and fill it. */
  741|    106|    curl_mime *multipart = form;
  742|    106|    if(post->more) {
  ------------------
  |  Branch (742:8): [True: 0, False: 106]
  ------------------
  743|      0|      part = curl_mime_addpart(form);
  744|      0|      if(!part)
  ------------------
  |  Branch (744:10): [True: 0, False: 0]
  ------------------
  745|      0|        result = CURLE_OUT_OF_MEMORY;
  746|      0|      if(!result)
  ------------------
  |  Branch (746:10): [True: 0, False: 0]
  ------------------
  747|      0|        result = setname(part, post->name, post->namelength);
  748|      0|      if(!result) {
  ------------------
  |  Branch (748:10): [True: 0, False: 0]
  ------------------
  749|      0|        multipart = curl_mime_init(data);
  750|      0|        if(!multipart)
  ------------------
  |  Branch (750:12): [True: 0, False: 0]
  ------------------
  751|      0|          result = CURLE_OUT_OF_MEMORY;
  752|      0|      }
  753|      0|      if(!result)
  ------------------
  |  Branch (753:10): [True: 0, False: 0]
  ------------------
  754|      0|        result = curl_mime_subparts(part, multipart);
  755|      0|    }
  756|       |
  757|       |    /* Generate all the part contents. */
  758|    212|    for(file = post; !result && file; file = file->more) {
  ------------------
  |  Branch (758:22): [True: 212, False: 0]
  |  Branch (758:33): [True: 106, False: 106]
  ------------------
  759|       |      /* Create the part. */
  760|    106|      part = curl_mime_addpart(multipart);
  761|    106|      if(!part)
  ------------------
  |  Branch (761:10): [True: 0, False: 106]
  ------------------
  762|      0|        result = CURLE_OUT_OF_MEMORY;
  763|       |
  764|       |      /* Set the headers. */
  765|    106|      if(!result)
  ------------------
  |  Branch (765:10): [True: 106, False: 0]
  ------------------
  766|    106|        result = curl_mime_headers(part, file->contentheader, 0);
  767|       |
  768|       |      /* Set the content type. */
  769|    106|      if(!result && file->contenttype)
  ------------------
  |  Branch (769:10): [True: 106, False: 0]
  |  Branch (769:21): [True: 0, False: 106]
  ------------------
  770|      0|        result = curl_mime_type(part, file->contenttype);
  771|       |
  772|       |      /* Set field name. */
  773|    106|      if(!result && !post->more)
  ------------------
  |  Branch (773:10): [True: 106, False: 0]
  |  Branch (773:21): [True: 106, False: 0]
  ------------------
  774|    106|        result = setname(part, post->name, post->namelength);
  775|       |
  776|       |      /* Process contents. */
  777|    106|      if(!result) {
  ------------------
  |  Branch (777:10): [True: 106, False: 0]
  ------------------
  778|    106|        curl_off_t clen = post->contentslength;
  779|       |
  780|    106|        if(post->flags & CURL_HTTPPOST_LARGE)
  ------------------
  |  |  220|    106|#define CURL_HTTPPOST_LARGE (1 << 7)
  ------------------
  |  Branch (780:12): [True: 106, False: 0]
  ------------------
  781|    106|          clen = post->contentlen;
  782|       |
  783|    106|        if(post->flags & (HTTPPOST_FILENAME | HTTPPOST_READFILE)) {
  ------------------
  |  |   40|    106|#define HTTPPOST_FILENAME    CURL_HTTPPOST_FILENAME
  |  |  ------------------
  |  |  |  |  205|    106|#define CURL_HTTPPOST_FILENAME (1 << 0)
  |  |  ------------------
  ------------------
                      if(post->flags & (HTTPPOST_FILENAME | HTTPPOST_READFILE)) {
  ------------------
  |  |   42|    106|#define HTTPPOST_READFILE    CURL_HTTPPOST_READFILE
  |  |  ------------------
  |  |  |  |  207|    106|#define CURL_HTTPPOST_READFILE (1 << 1)
  |  |  ------------------
  ------------------
  |  Branch (783:12): [True: 0, False: 106]
  ------------------
  784|      0|          if(!strcmp(file->contents, "-")) {
  ------------------
  |  Branch (784:14): [True: 0, False: 0]
  ------------------
  785|       |            /* There are a few cases where the code below will not work; in
  786|       |               particular, freopen(stdin) by the caller is not guaranteed
  787|       |               to result as expected. This feature has been kept for backward
  788|       |               compatibility: use of "-" pseudo filename should be avoided. */
  789|      0|#if defined(__clang__) && __clang_major__ >= 16
  790|      0|#pragma clang diagnostic push
  791|      0|#pragma clang diagnostic ignored "-Wcast-function-type-strict"
  792|      0|#endif
  793|      0|            result = curl_mime_data_cb(part, (curl_off_t)-1,
  794|      0|                                       (curl_read_callback)fread,
  795|      0|                                       curlx_fseek,
  796|      0|                                       NULL, (void *)stdin);
  797|      0|#if defined(__clang__) && __clang_major__ >= 16
  798|      0|#pragma clang diagnostic pop
  799|      0|#endif
  800|      0|          }
  801|      0|          else
  802|      0|            result = curl_mime_filedata(part, file->contents);
  803|      0|          if(!result && (post->flags & HTTPPOST_READFILE))
  ------------------
  |  |   42|      0|#define HTTPPOST_READFILE    CURL_HTTPPOST_READFILE
  |  |  ------------------
  |  |  |  |  207|      0|#define CURL_HTTPPOST_READFILE (1 << 1)
  |  |  ------------------
  ------------------
  |  Branch (803:14): [True: 0, False: 0]
  |  Branch (803:25): [True: 0, False: 0]
  ------------------
  804|      0|            result = curl_mime_filename(part, NULL);
  805|      0|        }
  806|    106|        else if(post->flags & HTTPPOST_BUFFER)
  ------------------
  |  |   45|    106|#define HTTPPOST_BUFFER      CURL_HTTPPOST_BUFFER
  |  |  ------------------
  |  |  |  |  213|    106|#define CURL_HTTPPOST_BUFFER (1 << 4)
  |  |  ------------------
  ------------------
  |  Branch (806:17): [True: 0, False: 106]
  ------------------
  807|      0|          result = curl_mime_data(part, post->buffer,
  808|      0|                                  post->bufferlength ?
  ------------------
  |  Branch (808:35): [True: 0, False: 0]
  ------------------
  809|      0|                                  post->bufferlength : -1);
  810|    106|        else if(post->flags & HTTPPOST_CALLBACK) {
  ------------------
  |  |   44|    106|#define HTTPPOST_CALLBACK    CURL_HTTPPOST_CALLBACK
  |  |  ------------------
  |  |  |  |  218|    106|#define CURL_HTTPPOST_CALLBACK (1 << 6)
  |  |  ------------------
  ------------------
  |  Branch (810:17): [True: 0, False: 106]
  ------------------
  811|       |          /* the contents should be read with the callback and the size is set
  812|       |             with the contentslength */
  813|      0|          if(!clen)
  ------------------
  |  Branch (813:14): [True: 0, False: 0]
  ------------------
  814|      0|            clen = -1;
  815|      0|          result = curl_mime_data_cb(part, clen,
  816|      0|                                     fread_func, NULL, NULL, post->userp);
  817|      0|        }
  818|    106|        else {
  819|    106|          size_t uclen;
  820|    106|          if(!clen)
  ------------------
  |  Branch (820:14): [True: 58, False: 48]
  ------------------
  821|     58|            uclen = CURL_ZERO_TERMINATED;
  ------------------
  |  | 2423|     58|#define CURL_ZERO_TERMINATED ((size_t)-1)
  ------------------
  822|     48|          else
  823|     48|            uclen = (size_t)clen;
  824|    106|          result = curl_mime_data(part, post->contents, uclen);
  825|    106|        }
  826|    106|      }
  827|       |
  828|       |      /* Set fake filename. */
  829|    106|      if(!result && post->showfilename)
  ------------------
  |  Branch (829:10): [True: 106, False: 0]
  |  Branch (829:21): [True: 0, False: 106]
  ------------------
  830|      0|        if(post->more || (post->flags & (HTTPPOST_FILENAME | HTTPPOST_BUFFER |
  ------------------
  |  |   40|      0|#define HTTPPOST_FILENAME    CURL_HTTPPOST_FILENAME
  |  |  ------------------
  |  |  |  |  205|      0|#define CURL_HTTPPOST_FILENAME (1 << 0)
  |  |  ------------------
  ------------------
                      if(post->more || (post->flags & (HTTPPOST_FILENAME | HTTPPOST_BUFFER |
  ------------------
  |  |   45|      0|#define HTTPPOST_BUFFER      CURL_HTTPPOST_BUFFER
  |  |  ------------------
  |  |  |  |  213|      0|#define CURL_HTTPPOST_BUFFER (1 << 4)
  |  |  ------------------
  ------------------
  |  Branch (830:12): [True: 0, False: 0]
  |  Branch (830:26): [True: 0, False: 0]
  ------------------
  831|      0|                                         HTTPPOST_CALLBACK)))
  ------------------
  |  |   44|      0|#define HTTPPOST_CALLBACK    CURL_HTTPPOST_CALLBACK
  |  |  ------------------
  |  |  |  |  218|      0|#define CURL_HTTPPOST_CALLBACK (1 << 6)
  |  |  ------------------
  ------------------
  832|      0|          result = curl_mime_filename(part, post->showfilename);
  833|    106|    }
  834|    106|  }
  835|       |
  836|    106|  if(result)
  ------------------
  |  Branch (836:6): [True: 0, False: 106]
  ------------------
  837|      0|    Curl_mime_cleanpart(finalform);
  838|       |
  839|    106|  return result;
  840|    106|}
formdata.c:FormAdd:
  302|    158|{
  303|    158|  struct FormInfo *first_form, *curr, *form = NULL;
  304|    158|  CURLFORMcode retval = CURL_FORMADD_OK;
  305|    158|  CURLformoption option;
  306|    158|  const struct curl_forms *forms = NULL;
  307|    158|  char *avalue = NULL;
  308|    158|  struct curl_httppost *newchain = NULL;
  309|    158|  struct curl_httppost *lastnode = NULL;
  310|       |
  311|    158|#define form_ptr_arg(t) (forms ? (t)(void *)avalue : va_arg(params, t))
  312|    158|#ifdef HAVE_UINTPTR_T
  313|    158|#define form_int_arg(t) (forms ? (t)(uintptr_t)avalue : va_arg(params, t))
  314|       |#else
  315|       |#define form_int_arg(t) (forms ? (t)(void *)avalue : va_arg(params, t))
  316|       |#endif
  317|       |
  318|       |  /*
  319|       |   * We need to allocate the first struct to fill in.
  320|       |   */
  321|    158|  first_form = NewFormInfo();
  322|    158|  if(!first_form)
  ------------------
  |  Branch (322:6): [True: 0, False: 158]
  ------------------
  323|      0|    return CURL_FORMADD_MEMORY;
  324|       |
  325|    158|  curr = first_form;
  326|       |
  327|       |  /*
  328|       |   * Loop through all the options set. Break if we have an error to report.
  329|       |   */
  330|    632|  while(retval == CURL_FORMADD_OK) {
  ------------------
  |  Branch (330:9): [True: 632, False: 0]
  ------------------
  331|       |
  332|       |    /* first see if we have more parts of the array param */
  333|    632|    if(forms) {
  ------------------
  |  Branch (333:8): [True: 0, False: 632]
  ------------------
  334|       |      /* get the upcoming option from the given array */
  335|      0|      option = forms->option;
  336|      0|      avalue = (char *)CURL_UNCONST(forms->value);
  ------------------
  |  |  866|      0|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  337|       |
  338|      0|      forms++; /* advance this to next entry */
  339|      0|      if(CURLFORM_END == option) {
  ------------------
  |  Branch (339:10): [True: 0, False: 0]
  ------------------
  340|       |        /* end of array state */
  341|      0|        forms = NULL;
  342|      0|        continue;
  343|      0|      }
  344|      0|    }
  345|    632|    else {
  346|       |      /* This is not array-state, get next option. This gets an 'int' with
  347|       |         va_arg() because CURLformoption might be a smaller type than int and
  348|       |         might cause compiler warnings and wrong behavior. */
  349|    632|      option = (CURLformoption)va_arg(params, int);
  350|    632|      if(CURLFORM_END == option)
  ------------------
  |  Branch (350:10): [True: 158, False: 474]
  ------------------
  351|    158|        break;
  352|    632|    }
  353|       |
  354|    474|    switch(option) {
  355|      0|    case CURLFORM_ARRAY:
  ------------------
  |  Branch (355:5): [True: 0, False: 474]
  ------------------
  356|      0|      if(forms)
  ------------------
  |  Branch (356:10): [True: 0, False: 0]
  ------------------
  357|       |        /* we do not support an array from within an array */
  358|      0|        retval = CURL_FORMADD_ILLEGAL_ARRAY;
  359|      0|      else {
  360|      0|        forms = va_arg(params, struct curl_forms *);
  361|      0|        if(!forms)
  ------------------
  |  Branch (361:12): [True: 0, False: 0]
  ------------------
  362|      0|          retval = CURL_FORMADD_NULL;
  363|      0|      }
  364|      0|      break;
  365|       |
  366|       |      /*
  367|       |       * Set the Name property.
  368|       |       */
  369|      0|    case CURLFORM_PTRNAME:
  ------------------
  |  Branch (369:5): [True: 0, False: 474]
  ------------------
  370|      0|      curr->flags |= HTTPPOST_PTRNAME;
  ------------------
  |  |   39|      0|#define HTTPPOST_PTRNAME     CURL_HTTPPOST_PTRNAME
  |  |  ------------------
  |  |  |  |  209|      0|#define CURL_HTTPPOST_PTRNAME (1 << 2)
  |  |  ------------------
  ------------------
  371|      0|      FALLTHROUGH();
  ------------------
  |  |  821|      0|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  372|    158|    case CURLFORM_COPYNAME:
  ------------------
  |  Branch (372:5): [True: 158, False: 316]
  ------------------
  373|    158|      if(Curl_bufref_ptr(&curr->name))
  ------------------
  |  Branch (373:10): [True: 0, False: 158]
  ------------------
  374|      0|        retval = CURL_FORMADD_OPTION_TWICE;
  375|    158|      else {
  376|    158|        avalue = form_ptr_arg(char *);
  ------------------
  |  |  311|    158|#define form_ptr_arg(t) (forms ? (t)(void *)avalue : va_arg(params, t))
  |  |  ------------------
  |  |  |  Branch (311:26): [True: 0, False: 158]
  |  |  ------------------
  ------------------
  377|    158|        if(avalue)
  ------------------
  |  Branch (377:12): [True: 158, False: 0]
  ------------------
  378|    158|          Curl_bufref_set(&curr->name, avalue, 0, NULL); /* No copy yet. */
  379|      0|        else
  380|      0|          retval = CURL_FORMADD_NULL;
  381|    158|      }
  382|    158|      break;
  383|      0|    case CURLFORM_NAMELENGTH:
  ------------------
  |  Branch (383:5): [True: 0, False: 474]
  ------------------
  384|      0|      if(curr->namelength)
  ------------------
  |  Branch (384:10): [True: 0, False: 0]
  ------------------
  385|      0|        retval = CURL_FORMADD_OPTION_TWICE;
  386|      0|      else
  387|      0|        curr->namelength = (size_t)form_int_arg(long);
  ------------------
  |  |  313|      0|#define form_int_arg(t) (forms ? (t)(uintptr_t)avalue : va_arg(params, t))
  |  |  ------------------
  |  |  |  Branch (313:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  388|      0|      break;
  389|       |
  390|       |      /*
  391|       |       * Set the contents property.
  392|       |       */
  393|    158|    case CURLFORM_PTRCONTENTS:
  ------------------
  |  Branch (393:5): [True: 158, False: 316]
  ------------------
  394|    158|      curr->flags |= HTTPPOST_PTRCONTENTS;
  ------------------
  |  |   41|    158|#define HTTPPOST_PTRCONTENTS CURL_HTTPPOST_PTRCONTENTS
  |  |  ------------------
  |  |  |  |  211|    158|#define CURL_HTTPPOST_PTRCONTENTS (1 << 3)
  |  |  ------------------
  ------------------
  395|    158|      FALLTHROUGH();
  ------------------
  |  |  821|    158|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  396|    158|    case CURLFORM_COPYCONTENTS:
  ------------------
  |  Branch (396:5): [True: 0, False: 474]
  ------------------
  397|    158|      if(Curl_bufref_ptr(&curr->value))
  ------------------
  |  Branch (397:10): [True: 0, False: 158]
  ------------------
  398|      0|        retval = CURL_FORMADD_OPTION_TWICE;
  399|    158|      else {
  400|    158|        avalue = form_ptr_arg(char *);
  ------------------
  |  |  311|    158|#define form_ptr_arg(t) (forms ? (t)(void *)avalue : va_arg(params, t))
  |  |  ------------------
  |  |  |  Branch (311:26): [True: 0, False: 158]
  |  |  ------------------
  ------------------
  401|    158|        if(avalue)
  ------------------
  |  Branch (401:12): [True: 158, False: 0]
  ------------------
  402|    158|          Curl_bufref_set(&curr->value, avalue, 0, NULL); /* No copy yet. */
  403|      0|        else
  404|      0|          retval = CURL_FORMADD_NULL;
  405|    158|      }
  406|    158|      break;
  407|      0|    case CURLFORM_CONTENTSLENGTH:
  ------------------
  |  Branch (407:5): [True: 0, False: 474]
  ------------------
  408|      0|      curr->contentslength = (curl_off_t)(size_t)form_int_arg(long);
  ------------------
  |  |  313|      0|#define form_int_arg(t) (forms ? (t)(uintptr_t)avalue : va_arg(params, t))
  |  |  ------------------
  |  |  |  Branch (313:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  409|      0|      break;
  410|       |
  411|    158|    case CURLFORM_CONTENTLEN:
  ------------------
  |  Branch (411:5): [True: 158, False: 316]
  ------------------
  412|    158|      curr->flags |= CURL_HTTPPOST_LARGE;
  ------------------
  |  |  220|    158|#define CURL_HTTPPOST_LARGE (1 << 7)
  ------------------
  413|    158|      curr->contentslength = form_int_arg(curl_off_t);
  ------------------
  |  |  313|    158|#define form_int_arg(t) (forms ? (t)(uintptr_t)avalue : va_arg(params, t))
  |  |  ------------------
  |  |  |  Branch (313:26): [True: 0, False: 158]
  |  |  ------------------
  ------------------
  414|    158|      break;
  415|       |
  416|       |      /* Get contents from a given filename */
  417|      0|    case CURLFORM_FILECONTENT:
  ------------------
  |  Branch (417:5): [True: 0, False: 474]
  ------------------
  418|      0|      if(curr->flags & (HTTPPOST_PTRCONTENTS | HTTPPOST_READFILE))
  ------------------
  |  |   41|      0|#define HTTPPOST_PTRCONTENTS CURL_HTTPPOST_PTRCONTENTS
  |  |  ------------------
  |  |  |  |  211|      0|#define CURL_HTTPPOST_PTRCONTENTS (1 << 3)
  |  |  ------------------
  ------------------
                    if(curr->flags & (HTTPPOST_PTRCONTENTS | HTTPPOST_READFILE))
  ------------------
  |  |   42|      0|#define HTTPPOST_READFILE    CURL_HTTPPOST_READFILE
  |  |  ------------------
  |  |  |  |  207|      0|#define CURL_HTTPPOST_READFILE (1 << 1)
  |  |  ------------------
  ------------------
  |  Branch (418:10): [True: 0, False: 0]
  ------------------
  419|      0|        retval = CURL_FORMADD_OPTION_TWICE;
  420|      0|      else {
  421|      0|        avalue = form_ptr_arg(char *);
  ------------------
  |  |  311|      0|#define form_ptr_arg(t) (forms ? (t)(void *)avalue : va_arg(params, t))
  |  |  ------------------
  |  |  |  Branch (311:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  422|      0|        if(avalue) {
  ------------------
  |  Branch (422:12): [True: 0, False: 0]
  ------------------
  423|      0|          if(Curl_bufref_memdup0(&curr->value, avalue, strlen(avalue)))
  ------------------
  |  Branch (423:14): [True: 0, False: 0]
  ------------------
  424|      0|            retval = CURL_FORMADD_MEMORY;
  425|      0|          else
  426|      0|            curr->flags |= HTTPPOST_READFILE;
  ------------------
  |  |   42|      0|#define HTTPPOST_READFILE    CURL_HTTPPOST_READFILE
  |  |  ------------------
  |  |  |  |  207|      0|#define CURL_HTTPPOST_READFILE (1 << 1)
  |  |  ------------------
  ------------------
  427|      0|        }
  428|      0|        else
  429|      0|          retval = CURL_FORMADD_NULL;
  430|      0|      }
  431|      0|      break;
  432|       |
  433|       |      /* We upload a file */
  434|      0|    case CURLFORM_FILE:
  ------------------
  |  Branch (434:5): [True: 0, False: 474]
  ------------------
  435|      0|      avalue = form_ptr_arg(char *);
  ------------------
  |  |  311|      0|#define form_ptr_arg(t) (forms ? (t)(void *)avalue : va_arg(params, t))
  |  |  ------------------
  |  |  |  Branch (311:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  436|      0|      if(Curl_bufref_ptr(&curr->value)) {
  ------------------
  |  Branch (436:10): [True: 0, False: 0]
  ------------------
  437|      0|        if(curr->flags & HTTPPOST_FILENAME) {
  ------------------
  |  |   40|      0|#define HTTPPOST_FILENAME    CURL_HTTPPOST_FILENAME
  |  |  ------------------
  |  |  |  |  205|      0|#define CURL_HTTPPOST_FILENAME (1 << 0)
  |  |  ------------------
  ------------------
  |  Branch (437:12): [True: 0, False: 0]
  ------------------
  438|      0|          if(avalue) {
  ------------------
  |  Branch (438:14): [True: 0, False: 0]
  ------------------
  439|      0|            form = NewFormInfo();
  440|      0|            if(!form ||
  ------------------
  |  Branch (440:16): [True: 0, False: 0]
  ------------------
  441|      0|               Curl_bufref_memdup0(&form->value, avalue, strlen(avalue))) {
  ------------------
  |  Branch (441:16): [True: 0, False: 0]
  ------------------
  442|      0|              curlx_free(form);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  443|      0|              retval = CURL_FORMADD_MEMORY;
  444|      0|            }
  445|      0|            else {
  446|      0|              AddFormInfo(form, curr);
  447|      0|              curr = form;
  448|      0|              form = NULL;
  449|      0|            }
  450|      0|          }
  451|      0|          else
  452|      0|            retval = CURL_FORMADD_NULL;
  453|      0|        }
  454|      0|        else
  455|      0|          retval = CURL_FORMADD_OPTION_TWICE;
  456|      0|      }
  457|      0|      else {
  458|      0|        if(avalue) {
  ------------------
  |  Branch (458:12): [True: 0, False: 0]
  ------------------
  459|      0|          if(Curl_bufref_memdup0(&curr->value, avalue, strlen(avalue)))
  ------------------
  |  Branch (459:14): [True: 0, False: 0]
  ------------------
  460|      0|            retval = CURL_FORMADD_MEMORY;
  461|      0|          else
  462|      0|            curr->flags |= HTTPPOST_FILENAME;
  ------------------
  |  |   40|      0|#define HTTPPOST_FILENAME    CURL_HTTPPOST_FILENAME
  |  |  ------------------
  |  |  |  |  205|      0|#define CURL_HTTPPOST_FILENAME (1 << 0)
  |  |  ------------------
  ------------------
  463|      0|        }
  464|      0|        else
  465|      0|          retval = CURL_FORMADD_NULL;
  466|      0|      }
  467|      0|      break;
  468|       |
  469|      0|    case CURLFORM_BUFFERPTR:
  ------------------
  |  Branch (469:5): [True: 0, False: 474]
  ------------------
  470|      0|      curr->flags |= HTTPPOST_PTRBUFFER | HTTPPOST_BUFFER;
  ------------------
  |  |   43|      0|#define HTTPPOST_PTRBUFFER   CURL_HTTPPOST_PTRBUFFER
  |  |  ------------------
  |  |  |  |  215|      0|#define CURL_HTTPPOST_PTRBUFFER (1 << 5)
  |  |  ------------------
  ------------------
                    curr->flags |= HTTPPOST_PTRBUFFER | HTTPPOST_BUFFER;
  ------------------
  |  |   45|      0|#define HTTPPOST_BUFFER      CURL_HTTPPOST_BUFFER
  |  |  ------------------
  |  |  |  |  213|      0|#define CURL_HTTPPOST_BUFFER (1 << 4)
  |  |  ------------------
  ------------------
  471|      0|      if(curr->buffer)
  ------------------
  |  Branch (471:10): [True: 0, False: 0]
  ------------------
  472|      0|        retval = CURL_FORMADD_OPTION_TWICE;
  473|      0|      else {
  474|      0|        avalue = form_ptr_arg(char *);
  ------------------
  |  |  311|      0|#define form_ptr_arg(t) (forms ? (t)(void *)avalue : va_arg(params, t))
  |  |  ------------------
  |  |  |  Branch (311:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  475|      0|        if(avalue) {
  ------------------
  |  Branch (475:12): [True: 0, False: 0]
  ------------------
  476|      0|          curr->buffer = avalue; /* store for the moment */
  477|       |          /* Make value non-NULL to be accepted as fine */
  478|      0|          Curl_bufref_set(&curr->value, avalue, 0, NULL);
  479|      0|        }
  480|      0|        else
  481|      0|          retval = CURL_FORMADD_NULL;
  482|      0|      }
  483|      0|      break;
  484|       |
  485|      0|    case CURLFORM_BUFFERLENGTH:
  ------------------
  |  Branch (485:5): [True: 0, False: 474]
  ------------------
  486|      0|      if(curr->bufferlength)
  ------------------
  |  Branch (486:10): [True: 0, False: 0]
  ------------------
  487|      0|        retval = CURL_FORMADD_OPTION_TWICE;
  488|      0|      else
  489|      0|        curr->bufferlength = (size_t)form_int_arg(long);
  ------------------
  |  |  313|      0|#define form_int_arg(t) (forms ? (t)(uintptr_t)avalue : va_arg(params, t))
  |  |  ------------------
  |  |  |  Branch (313:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  490|      0|      break;
  491|       |
  492|      0|    case CURLFORM_STREAM:
  ------------------
  |  Branch (492:5): [True: 0, False: 474]
  ------------------
  493|      0|      curr->flags |= HTTPPOST_CALLBACK;
  ------------------
  |  |   44|      0|#define HTTPPOST_CALLBACK    CURL_HTTPPOST_CALLBACK
  |  |  ------------------
  |  |  |  |  218|      0|#define CURL_HTTPPOST_CALLBACK (1 << 6)
  |  |  ------------------
  ------------------
  494|      0|      if(curr->userp)
  ------------------
  |  Branch (494:10): [True: 0, False: 0]
  ------------------
  495|      0|        retval = CURL_FORMADD_OPTION_TWICE;
  496|      0|      else {
  497|      0|        avalue = form_ptr_arg(char *);
  ------------------
  |  |  311|      0|#define form_ptr_arg(t) (forms ? (t)(void *)avalue : va_arg(params, t))
  |  |  ------------------
  |  |  |  Branch (311:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  498|      0|        if(avalue) {
  ------------------
  |  Branch (498:12): [True: 0, False: 0]
  ------------------
  499|      0|          curr->userp = avalue;
  500|       |          /* The following line is not strictly true but we derive a value
  501|       |             from this later on and we need this non-NULL to be accepted as
  502|       |             a fine form part */
  503|      0|          Curl_bufref_set(&curr->value, avalue, 0, NULL);
  504|      0|        }
  505|      0|        else
  506|      0|          retval = CURL_FORMADD_NULL;
  507|      0|      }
  508|      0|      break;
  509|       |
  510|      0|    case CURLFORM_CONTENTTYPE:
  ------------------
  |  Branch (510:5): [True: 0, False: 474]
  ------------------
  511|      0|      avalue = form_ptr_arg(char *);
  ------------------
  |  |  311|      0|#define form_ptr_arg(t) (forms ? (t)(void *)avalue : va_arg(params, t))
  |  |  ------------------
  |  |  |  Branch (311:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  512|      0|      if(Curl_bufref_ptr(&curr->contenttype)) {
  ------------------
  |  Branch (512:10): [True: 0, False: 0]
  ------------------
  513|      0|        if(curr->flags & HTTPPOST_FILENAME) {
  ------------------
  |  |   40|      0|#define HTTPPOST_FILENAME    CURL_HTTPPOST_FILENAME
  |  |  ------------------
  |  |  |  |  205|      0|#define CURL_HTTPPOST_FILENAME (1 << 0)
  |  |  ------------------
  ------------------
  |  Branch (513:12): [True: 0, False: 0]
  ------------------
  514|      0|          if(avalue) {
  ------------------
  |  Branch (514:14): [True: 0, False: 0]
  ------------------
  515|      0|            form = NewFormInfo();
  516|      0|            if(!form || Curl_bufref_memdup0(&form->contenttype, avalue,
  ------------------
  |  Branch (516:16): [True: 0, False: 0]
  |  Branch (516:25): [True: 0, False: 0]
  ------------------
  517|      0|                                            strlen(avalue))) {
  518|      0|              curlx_free(form);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  519|      0|              retval = CURL_FORMADD_MEMORY;
  520|      0|            }
  521|      0|            else {
  522|      0|              AddFormInfo(form, curr);
  523|      0|              curr = form;
  524|      0|              form = NULL;
  525|      0|            }
  526|      0|          }
  527|      0|          else
  528|      0|            retval = CURL_FORMADD_NULL;
  529|      0|        }
  530|      0|        else
  531|      0|          retval = CURL_FORMADD_OPTION_TWICE;
  532|      0|      }
  533|      0|      else if(avalue) {
  ------------------
  |  Branch (533:15): [True: 0, False: 0]
  ------------------
  534|      0|        if(Curl_bufref_memdup0(&curr->contenttype, avalue, strlen(avalue)))
  ------------------
  |  Branch (534:12): [True: 0, False: 0]
  ------------------
  535|      0|          retval = CURL_FORMADD_MEMORY;
  536|      0|      }
  537|      0|      else
  538|      0|        retval = CURL_FORMADD_NULL;
  539|      0|      break;
  540|       |
  541|      0|    case CURLFORM_CONTENTHEADER: {
  ------------------
  |  Branch (541:5): [True: 0, False: 474]
  ------------------
  542|       |      /* this "cast increases required alignment of target type" but
  543|       |         we consider it OK anyway */
  544|      0|      struct curl_slist *list = form_ptr_arg(struct curl_slist *);
  ------------------
  |  |  311|      0|#define form_ptr_arg(t) (forms ? (t)(void *)avalue : va_arg(params, t))
  |  |  ------------------
  |  |  |  Branch (311:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  545|       |
  546|      0|      if(curr->contentheader)
  ------------------
  |  Branch (546:10): [True: 0, False: 0]
  ------------------
  547|      0|        retval = CURL_FORMADD_OPTION_TWICE;
  548|      0|      else
  549|      0|        curr->contentheader = list;
  550|       |
  551|      0|      break;
  552|    158|    }
  553|      0|    case CURLFORM_FILENAME:
  ------------------
  |  Branch (553:5): [True: 0, False: 474]
  ------------------
  554|      0|    case CURLFORM_BUFFER:
  ------------------
  |  Branch (554:5): [True: 0, False: 474]
  ------------------
  555|      0|      avalue = form_ptr_arg(char *);
  ------------------
  |  |  311|      0|#define form_ptr_arg(t) (forms ? (t)(void *)avalue : va_arg(params, t))
  |  |  ------------------
  |  |  |  Branch (311:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  556|      0|      if(Curl_bufref_ptr(&curr->showfilename))
  ------------------
  |  Branch (556:10): [True: 0, False: 0]
  ------------------
  557|      0|        retval = CURL_FORMADD_OPTION_TWICE;
  558|      0|      else if(Curl_bufref_memdup0(&curr->showfilename, avalue, strlen(avalue)))
  ------------------
  |  Branch (558:15): [True: 0, False: 0]
  ------------------
  559|      0|        retval = CURL_FORMADD_MEMORY;
  560|      0|      break;
  561|       |
  562|      0|    default:
  ------------------
  |  Branch (562:5): [True: 0, False: 474]
  ------------------
  563|      0|      retval = CURL_FORMADD_UNKNOWN_OPTION;
  564|      0|      break;
  565|    474|    }
  566|    474|  }
  567|       |
  568|    158|  if(!retval)
  ------------------
  |  Branch (568:6): [True: 158, False: 0]
  ------------------
  569|    158|    retval = FormAddCheck(first_form, &newchain, &lastnode);
  570|       |
  571|    158|  if(retval)
  ------------------
  |  Branch (571:6): [True: 0, False: 158]
  ------------------
  572|       |    /* On error, free allocated fields for all nodes of the FormInfo linked
  573|       |       list without deallocating nodes. List nodes are deallocated later on */
  574|      0|    free_formlist(first_form);
  575|       |
  576|       |  /* Always deallocate FormInfo linked list nodes without touching node
  577|       |     fields given that these have either been deallocated or are owned
  578|       |     now by the httppost linked list */
  579|    316|  while(first_form) {
  ------------------
  |  Branch (579:9): [True: 158, False: 158]
  ------------------
  580|    158|    struct FormInfo *ptr = first_form->more;
  581|    158|    curlx_free(first_form);
  ------------------
  |  | 1483|    158|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  582|    158|    first_form = ptr;
  583|    158|  }
  584|       |
  585|    158|  if(!retval) {
  ------------------
  |  Branch (585:6): [True: 158, False: 0]
  ------------------
  586|       |    /* Only if all is fine, link the new chain into the provided list */
  587|    158|    if(*last_post)
  ------------------
  |  Branch (587:8): [True: 0, False: 158]
  ------------------
  588|      0|      (*last_post)->next = newchain;
  589|    158|    else
  590|    158|      (*httppost) = newchain;
  591|       |
  592|    158|    (*last_post) = lastnode;
  593|    158|  }
  594|      0|  else
  595|      0|    free_chain(newchain);
  596|       |
  597|    158|  return retval;
  598|    158|#undef form_ptr_arg
  599|    158|#undef form_int_arg
  600|    158|}
formdata.c:NewFormInfo:
  107|    158|{
  108|    158|  struct FormInfo *form_info = curlx_calloc(1, sizeof(struct FormInfo));
  ------------------
  |  | 1480|    158|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  109|       |
  110|    158|  if(form_info) {
  ------------------
  |  Branch (110:6): [True: 158, False: 0]
  ------------------
  111|    158|    Curl_bufref_init(&form_info->name);
  112|    158|    Curl_bufref_init(&form_info->value);
  113|    158|    Curl_bufref_init(&form_info->contenttype);
  114|    158|    Curl_bufref_init(&form_info->showfilename);
  115|    158|  }
  116|       |
  117|    158|  return form_info;
  118|    158|}
formdata.c:FormAddCheck:
  218|    158|{
  219|    158|  const char *prevtype = NULL;
  220|    158|  struct FormInfo *form = NULL;
  221|    158|  struct curl_httppost *post = NULL;
  222|       |
  223|       |  /* go through the list, check for completeness and if everything is
  224|       |   * alright add the HttpPost item otherwise set retval accordingly */
  225|       |
  226|    316|  for(form = first_form; form != NULL; form = form->more) {
  ------------------
  |  Branch (226:26): [True: 158, False: 158]
  ------------------
  227|    158|    const char *name = Curl_bufref_ptr(&form->name);
  228|       |
  229|    158|    if(((!name || !Curl_bufref_ptr(&form->value)) && !post) ||
  ------------------
  |  Branch (229:10): [True: 0, False: 158]
  |  Branch (229:19): [True: 0, False: 158]
  |  Branch (229:54): [True: 0, False: 0]
  ------------------
  230|    158|       (form->contentslength &&
  ------------------
  |  Branch (230:9): [True: 59, False: 99]
  ------------------
  231|     59|        (form->flags & HTTPPOST_FILENAME)) ||
  ------------------
  |  |   40|     59|#define HTTPPOST_FILENAME    CURL_HTTPPOST_FILENAME
  |  |  ------------------
  |  |  |  |  205|     59|#define CURL_HTTPPOST_FILENAME (1 << 0)
  |  |  ------------------
  ------------------
  |  Branch (231:9): [True: 0, False: 59]
  ------------------
  232|    158|       ((form->flags & HTTPPOST_FILENAME) &&
  ------------------
  |  |   40|    158|#define HTTPPOST_FILENAME    CURL_HTTPPOST_FILENAME
  |  |  ------------------
  |  |  |  |  205|    158|#define CURL_HTTPPOST_FILENAME (1 << 0)
  |  |  ------------------
  ------------------
  |  Branch (232:9): [True: 0, False: 158]
  ------------------
  233|      0|        (form->flags & HTTPPOST_PTRCONTENTS)) ||
  ------------------
  |  |   41|      0|#define HTTPPOST_PTRCONTENTS CURL_HTTPPOST_PTRCONTENTS
  |  |  ------------------
  |  |  |  |  211|      0|#define CURL_HTTPPOST_PTRCONTENTS (1 << 3)
  |  |  ------------------
  ------------------
  |  Branch (233:9): [True: 0, False: 0]
  ------------------
  234|       |
  235|    158|       (!form->buffer &&
  ------------------
  |  Branch (235:9): [True: 158, False: 0]
  ------------------
  236|    158|        (form->flags & HTTPPOST_BUFFER) &&
  ------------------
  |  |   45|    158|#define HTTPPOST_BUFFER      CURL_HTTPPOST_BUFFER
  |  |  ------------------
  |  |  |  |  213|    158|#define CURL_HTTPPOST_BUFFER (1 << 4)
  |  |  ------------------
  ------------------
  |  Branch (236:9): [True: 0, False: 158]
  ------------------
  237|      0|        (form->flags & HTTPPOST_PTRBUFFER)) ||
  ------------------
  |  |   43|      0|#define HTTPPOST_PTRBUFFER   CURL_HTTPPOST_PTRBUFFER
  |  |  ------------------
  |  |  |  |  215|      0|#define CURL_HTTPPOST_PTRBUFFER (1 << 5)
  |  |  ------------------
  ------------------
  |  Branch (237:9): [True: 0, False: 0]
  ------------------
  238|       |
  239|    158|       ((form->flags & HTTPPOST_READFILE) &&
  ------------------
  |  |   42|    158|#define HTTPPOST_READFILE    CURL_HTTPPOST_READFILE
  |  |  ------------------
  |  |  |  |  207|    158|#define CURL_HTTPPOST_READFILE (1 << 1)
  |  |  ------------------
  ------------------
  |  Branch (239:9): [True: 0, False: 158]
  ------------------
  240|      0|        (form->flags & HTTPPOST_PTRCONTENTS))
  ------------------
  |  |   41|      0|#define HTTPPOST_PTRCONTENTS CURL_HTTPPOST_PTRCONTENTS
  |  |  ------------------
  |  |  |  |  211|      0|#define CURL_HTTPPOST_PTRCONTENTS (1 << 3)
  |  |  ------------------
  ------------------
  |  Branch (240:9): [True: 0, False: 0]
  ------------------
  241|    158|      ) {
  242|      0|      return CURL_FORMADD_INCOMPLETE;
  243|      0|    }
  244|    158|    if(((form->flags & HTTPPOST_FILENAME) ||
  ------------------
  |  |   40|    158|#define HTTPPOST_FILENAME    CURL_HTTPPOST_FILENAME
  |  |  ------------------
  |  |  |  |  205|    158|#define CURL_HTTPPOST_FILENAME (1 << 0)
  |  |  ------------------
  ------------------
  |  Branch (244:9): [True: 0, False: 158]
  ------------------
  245|    158|        (form->flags & HTTPPOST_BUFFER)) &&
  ------------------
  |  |   45|    158|#define HTTPPOST_BUFFER      CURL_HTTPPOST_BUFFER
  |  |  ------------------
  |  |  |  |  213|    158|#define CURL_HTTPPOST_BUFFER (1 << 4)
  |  |  ------------------
  ------------------
  |  Branch (245:9): [True: 0, False: 158]
  ------------------
  246|      0|       !Curl_bufref_ptr(&form->contenttype)) {
  ------------------
  |  Branch (246:8): [True: 0, False: 0]
  ------------------
  247|      0|      const char *f = Curl_bufref_ptr((form->flags & HTTPPOST_BUFFER) ?
  ------------------
  |  |   45|      0|#define HTTPPOST_BUFFER      CURL_HTTPPOST_BUFFER
  |  |  ------------------
  |  |  |  |  213|      0|#define CURL_HTTPPOST_BUFFER (1 << 4)
  |  |  ------------------
  ------------------
  |  Branch (247:39): [True: 0, False: 0]
  ------------------
  248|      0|                                      &form->showfilename : &form->value);
  249|      0|      const char *type = Curl_mime_contenttype(f);
  250|      0|      if(!type)
  ------------------
  |  Branch (250:10): [True: 0, False: 0]
  ------------------
  251|      0|        type = prevtype;
  252|      0|      if(!type)
  ------------------
  |  Branch (252:10): [True: 0, False: 0]
  ------------------
  253|      0|        type = FILE_CONTENTTYPE_DEFAULT;
  ------------------
  |  |   38|      0|#define FILE_CONTENTTYPE_DEFAULT        "application/octet-stream"
  ------------------
  254|       |
  255|       |      /* our contenttype is missing */
  256|      0|      if(Curl_bufref_memdup0(&form->contenttype, type, strlen(type)))
  ------------------
  |  Branch (256:10): [True: 0, False: 0]
  ------------------
  257|      0|        return CURL_FORMADD_MEMORY;
  258|      0|    }
  259|    158|    if(name && form->namelength) {
  ------------------
  |  Branch (259:8): [True: 158, False: 0]
  |  Branch (259:16): [True: 0, False: 158]
  ------------------
  260|      0|      if(memchr(name, 0, form->namelength))
  ------------------
  |  Branch (260:10): [True: 0, False: 0]
  ------------------
  261|      0|        return CURL_FORMADD_NULL;
  262|      0|    }
  263|    158|    if(!(form->flags & HTTPPOST_PTRNAME)) {
  ------------------
  |  |   39|    158|#define HTTPPOST_PTRNAME     CURL_HTTPPOST_PTRNAME
  |  |  ------------------
  |  |  |  |  209|    158|#define CURL_HTTPPOST_PTRNAME (1 << 2)
  |  |  ------------------
  ------------------
  |  Branch (263:8): [True: 158, False: 0]
  ------------------
  264|       |      /* Note that there is small risk that form->name is NULL here if the app
  265|       |         passed in a bad combo, so we check for that. */
  266|    158|      if(FormInfoCopyField(&form->name, form->namelength))
  ------------------
  |  Branch (266:10): [True: 0, False: 158]
  ------------------
  267|      0|        return CURL_FORMADD_MEMORY;
  268|    158|    }
  269|    158|    if(!(form->flags & (HTTPPOST_FILENAME | HTTPPOST_READFILE |
  ------------------
  |  |   40|    158|#define HTTPPOST_FILENAME    CURL_HTTPPOST_FILENAME
  |  |  ------------------
  |  |  |  |  205|    158|#define CURL_HTTPPOST_FILENAME (1 << 0)
  |  |  ------------------
  ------------------
                  if(!(form->flags & (HTTPPOST_FILENAME | HTTPPOST_READFILE |
  ------------------
  |  |   42|    158|#define HTTPPOST_READFILE    CURL_HTTPPOST_READFILE
  |  |  ------------------
  |  |  |  |  207|    158|#define CURL_HTTPPOST_READFILE (1 << 1)
  |  |  ------------------
  ------------------
  |  Branch (269:8): [True: 0, False: 158]
  ------------------
  270|    158|                        HTTPPOST_PTRCONTENTS | HTTPPOST_PTRBUFFER |
  ------------------
  |  |   41|    158|#define HTTPPOST_PTRCONTENTS CURL_HTTPPOST_PTRCONTENTS
  |  |  ------------------
  |  |  |  |  211|    158|#define CURL_HTTPPOST_PTRCONTENTS (1 << 3)
  |  |  ------------------
  ------------------
                                      HTTPPOST_PTRCONTENTS | HTTPPOST_PTRBUFFER |
  ------------------
  |  |   43|    158|#define HTTPPOST_PTRBUFFER   CURL_HTTPPOST_PTRBUFFER
  |  |  ------------------
  |  |  |  |  215|    158|#define CURL_HTTPPOST_PTRBUFFER (1 << 5)
  |  |  ------------------
  ------------------
  271|    158|                        HTTPPOST_CALLBACK))) {
  ------------------
  |  |   44|    158|#define HTTPPOST_CALLBACK    CURL_HTTPPOST_CALLBACK
  |  |  ------------------
  |  |  |  |  218|    158|#define CURL_HTTPPOST_CALLBACK (1 << 6)
  |  |  ------------------
  ------------------
  272|      0|      if(FormInfoCopyField(&form->value, (size_t)form->contentslength))
  ------------------
  |  Branch (272:10): [True: 0, False: 0]
  ------------------
  273|      0|        return CURL_FORMADD_MEMORY;
  274|      0|    }
  275|    158|    post = AddHttpPost(form, post, httppost, last_post);
  276|       |
  277|    158|    if(!post)
  ------------------
  |  Branch (277:8): [True: 0, False: 158]
  ------------------
  278|      0|      return CURL_FORMADD_MEMORY;
  279|       |
  280|    158|    if(Curl_bufref_ptr(&form->contenttype))
  ------------------
  |  Branch (280:8): [True: 0, False: 158]
  ------------------
  281|      0|      prevtype = Curl_bufref_ptr(&form->contenttype);
  282|    158|  }
  283|       |
  284|    158|  return CURL_FORMADD_OK;
  285|    158|}
formdata.c:FormInfoCopyField:
  122|    158|{
  123|    158|  const char *value = Curl_bufref_ptr(field);
  124|    158|  CURLcode result = CURLE_OK;
  125|       |
  126|    158|  if(value) {
  ------------------
  |  Branch (126:6): [True: 158, False: 0]
  ------------------
  127|    158|    if(!len)
  ------------------
  |  Branch (127:8): [True: 158, False: 0]
  ------------------
  128|    158|      len = strlen(value);
  129|    158|    result = Curl_bufref_memdup0(field, value, len);
  130|    158|  }
  131|       |
  132|    158|  return result;
  133|    158|}
formdata.c:AddHttpPost:
   61|    158|{
   62|    158|  struct curl_httppost *post;
   63|    158|  size_t namelength = src->namelength;
   64|    158|  if(!namelength && Curl_bufref_ptr(&src->name))
  ------------------
  |  Branch (64:6): [True: 158, False: 0]
  |  Branch (64:21): [True: 158, False: 0]
  ------------------
   65|    158|    namelength = strlen(Curl_bufref_ptr(&src->name));
   66|    158|  if((src->bufferlength > LONG_MAX) || (namelength > LONG_MAX))
  ------------------
  |  Branch (66:6): [True: 0, False: 158]
  |  Branch (66:40): [True: 0, False: 158]
  ------------------
   67|       |    /* avoid overflow in typecasts below */
   68|      0|    return NULL;
   69|    158|  post = curlx_calloc(1, sizeof(struct curl_httppost));
  ------------------
  |  | 1480|    158|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   70|    158|  if(post) {
  ------------------
  |  Branch (70:6): [True: 158, False: 0]
  ------------------
   71|    158|    post->name = CURL_UNCONST(Curl_bufref_ptr(&src->name));
  ------------------
  |  |  866|    158|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
   72|    158|    post->namelength = (long)namelength;
   73|    158|    post->contents = CURL_UNCONST(Curl_bufref_ptr(&src->value));
  ------------------
  |  |  866|    158|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
   74|    158|    post->contentlen = src->contentslength;
   75|    158|    post->buffer = src->buffer;
   76|    158|    post->bufferlength = (long)src->bufferlength;
   77|    158|    post->contenttype = CURL_UNCONST(Curl_bufref_ptr(&src->contenttype));
  ------------------
  |  |  866|    158|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
   78|    158|    post->flags = src->flags | CURL_HTTPPOST_LARGE;
  ------------------
  |  |  220|    158|#define CURL_HTTPPOST_LARGE (1 << 7)
  ------------------
   79|    158|    post->contentheader = src->contentheader;
   80|    158|    post->showfilename = CURL_UNCONST(Curl_bufref_ptr(&src->showfilename));
  ------------------
  |  |  866|    158|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
   81|    158|    post->userp = src->userp;
   82|    158|  }
   83|      0|  else
   84|      0|    return NULL;
   85|       |
   86|    158|  if(parent_post) {
  ------------------
  |  Branch (86:6): [True: 0, False: 158]
  ------------------
   87|       |    /* now, point our 'more' to the original 'more' */
   88|      0|    post->more = parent_post->more;
   89|       |
   90|       |    /* then move the original 'more' to point to ourselves */
   91|      0|    parent_post->more = post;
   92|      0|  }
   93|    158|  else {
   94|       |    /* make the previous point to this */
   95|    158|    if(*last_post)
  ------------------
  |  Branch (95:8): [True: 0, False: 158]
  ------------------
   96|      0|      (*last_post)->next = post;
   97|    158|    else
   98|    158|      (*httppost) = post;
   99|       |
  100|    158|    (*last_post) = post;
  101|    158|  }
  102|    158|  return post;
  103|    158|}
formdata.c:setname:
  692|    106|{
  693|    106|  char *zname;
  694|    106|  CURLcode result;
  695|       |
  696|    106|  if(!name || !len)
  ------------------
  |  Branch (696:6): [True: 0, False: 106]
  |  Branch (696:15): [True: 0, False: 106]
  ------------------
  697|      0|    return curl_mime_name(part, name);
  698|    106|  zname = curlx_memdup0(name, len);
  699|    106|  if(!zname)
  ------------------
  |  Branch (699:6): [True: 0, False: 106]
  ------------------
  700|      0|    return CURLE_OUT_OF_MEMORY;
  701|    106|  result = curl_mime_name(part, zname);
  702|    106|  curlx_free(zname);
  ------------------
  |  | 1483|    106|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  703|    106|  return result;
  704|    106|}

ftp_213_date:
 2467|     49|{
 2468|     49|  int century;
 2469|     49|  if((strlen(p) < 14) || twodigit(&p[0], &century) || twodigit(&p[2], year) ||
  ------------------
  |  Branch (2469:6): [True: 2, False: 47]
  |  Branch (2469:26): [True: 9, False: 38]
  |  Branch (2469:55): [True: 6, False: 32]
  ------------------
 2470|     32|     twodigit(&p[4], month) || twodigit(&p[6], day) ||
  ------------------
  |  Branch (2470:6): [True: 6, False: 26]
  |  Branch (2470:32): [True: 5, False: 21]
  ------------------
 2471|     21|     twodigit(&p[8], hour) || twodigit(&p[10], minute) ||
  ------------------
  |  Branch (2471:6): [True: 4, False: 17]
  |  Branch (2471:31): [True: 3, False: 14]
  ------------------
 2472|     14|     twodigit(&p[12], second))
  ------------------
  |  Branch (2472:6): [True: 2, False: 12]
  ------------------
 2473|     37|    return FALSE;
  ------------------
  |  | 1058|     37|#define FALSE false
  ------------------
 2474|       |
 2475|     12|  *year += century * 100;
 2476|     12|  if((*month > 12) || (*day > 31) || (*hour > 23) || (*minute > 59) ||
  ------------------
  |  Branch (2476:6): [True: 1, False: 11]
  |  Branch (2476:23): [True: 1, False: 10]
  |  Branch (2476:38): [True: 1, False: 9]
  |  Branch (2476:54): [True: 1, False: 8]
  ------------------
 2477|      8|     (*second > 60))
  ------------------
  |  Branch (2477:6): [True: 1, False: 7]
  ------------------
 2478|      5|    return FALSE;
  ------------------
  |  | 1058|      5|#define FALSE false
  ------------------
 2479|      7|  return TRUE;
  ------------------
  |  | 1055|      7|#define TRUE true
  ------------------
 2480|     12|}
ftp_conns_match:
 4453|    105|{
 4454|    105|  struct ftp_conn *nftpc = Curl_conn_meta_get(needle, CURL_META_FTP_CONN);
  ------------------
  |  |  156|    105|#define CURL_META_FTP_CONN   "meta:proto:ftp:conn"
  ------------------
 4455|    105|  struct ftp_conn *cftpc = Curl_conn_meta_get(conn, CURL_META_FTP_CONN);
  ------------------
  |  |  156|    105|#define CURL_META_FTP_CONN   "meta:proto:ftp:conn"
  ------------------
 4456|       |  /* Also match ACCOUNT, ALTERNATIVE-TO-USER, USE_SSL and CCC options */
 4457|    105|  if(!nftpc || !cftpc ||
  ------------------
  |  Branch (4457:6): [True: 0, False: 105]
  |  Branch (4457:16): [True: 0, False: 105]
  ------------------
 4458|    105|     Curl_timestrcmp(nftpc->account, cftpc->account) ||
  ------------------
  |  Branch (4458:6): [True: 0, False: 105]
  ------------------
 4459|    105|     Curl_timestrcmp(nftpc->alternative_to_user,
  ------------------
  |  Branch (4459:6): [True: 0, False: 105]
  ------------------
 4460|    105|                     cftpc->alternative_to_user) ||
 4461|    105|     (nftpc->use_ssl != cftpc->use_ssl) ||
  ------------------
  |  Branch (4461:6): [True: 0, False: 105]
  ------------------
 4462|    105|     (nftpc->ccc != cftpc->ccc))
  ------------------
  |  Branch (4462:6): [True: 0, False: 105]
  ------------------
 4463|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 4464|    105|  return TRUE;
  ------------------
  |  | 1055|    105|#define TRUE true
  ------------------
 4465|    105|}
ftp.c:twodigit:
 2452|    195|{
 2453|    195|  if(!ISDIGIT(p[0]) || !ISDIGIT(p[1]))
  ------------------
  |  |   44|    390|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 183, False: 12]
  |  |  |  Branch (44:38): [True: 177, False: 6]
  |  |  ------------------
  ------------------
                if(!ISDIGIT(p[0]) || !ISDIGIT(p[1]))
  ------------------
  |  |   44|    177|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 166, False: 11]
  |  |  |  Branch (44:38): [True: 160, False: 6]
  |  |  ------------------
  ------------------
 2454|     35|    return TRUE;
  ------------------
  |  | 1055|     35|#define TRUE true
  ------------------
 2455|       |  /* curlx_hexval() works fine here since we make sure it is decimal above */
 2456|    160|  *val = (curlx_hexval(p[0]) * 10) + curlx_hexval(p[1]);
  ------------------
  |  |  112|    160|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
                *val = (curlx_hexval(p[0]) * 10) + curlx_hexval(p[1]);
  ------------------
  |  |  112|    160|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
 2457|       |  return FALSE;
  ------------------
  |  | 1058|    160|#define FALSE false
  ------------------
 2458|    195|}
ftp.c:ftp_setup_connection:
 4404|  4.96k|{
 4405|  4.96k|  struct FTP *ftp;
 4406|  4.96k|  CURLcode result = CURLE_OK;
 4407|  4.96k|  struct ftp_conn *ftpc;
 4408|       |
 4409|  4.96k|  ftp = curlx_calloc(1, sizeof(*ftp));
  ------------------
  |  | 1480|  4.96k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 4410|  4.96k|  if(!ftp ||
  ------------------
  |  Branch (4410:6): [True: 0, False: 4.96k]
  ------------------
 4411|  4.96k|     Curl_meta_set(data, CURL_META_FTP_EASY, ftp, ftp_easy_dtor))
  ------------------
  |  |  154|  4.96k|#define CURL_META_FTP_EASY   "meta:proto:ftp:easy"
  ------------------
  |  Branch (4411:6): [True: 0, False: 4.96k]
  ------------------
 4412|      0|    return CURLE_OUT_OF_MEMORY;
 4413|       |
 4414|  4.96k|  ftpc = curlx_calloc(1, sizeof(*ftpc));
  ------------------
  |  | 1480|  4.96k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 4415|  4.96k|  if(!ftpc ||
  ------------------
  |  Branch (4415:6): [True: 0, False: 4.96k]
  ------------------
 4416|  4.96k|     Curl_conn_meta_set(conn, CURL_META_FTP_CONN, ftpc, ftp_conn_dtor))
  ------------------
  |  |  156|  4.96k|#define CURL_META_FTP_CONN   "meta:proto:ftp:conn"
  ------------------
  |  Branch (4416:6): [True: 0, False: 4.96k]
  ------------------
 4417|      0|    return CURLE_OUT_OF_MEMORY;
 4418|       |
 4419|       |  /* clone connection related data that is FTP specific */
 4420|  4.96k|  if(data->set.str[STRING_FTP_ACCOUNT]) {
  ------------------
  |  Branch (4420:6): [True: 8, False: 4.95k]
  ------------------
 4421|      8|    ftpc->account = curlx_strdup(data->set.str[STRING_FTP_ACCOUNT]);
  ------------------
  |  | 1477|      8|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 4422|      8|    if(!ftpc->account) {
  ------------------
  |  Branch (4422:8): [True: 0, False: 8]
  ------------------
 4423|      0|      Curl_conn_meta_remove(conn, CURL_META_FTP_CONN);
  ------------------
  |  |  156|      0|#define CURL_META_FTP_CONN   "meta:proto:ftp:conn"
  ------------------
 4424|      0|      return CURLE_OUT_OF_MEMORY;
 4425|      0|    }
 4426|      8|  }
 4427|  4.96k|  if(data->set.str[STRING_FTP_ALTERNATIVE_TO_USER]) {
  ------------------
  |  Branch (4427:6): [True: 7, False: 4.95k]
  ------------------
 4428|      7|    ftpc->alternative_to_user =
 4429|      7|      curlx_strdup(data->set.str[STRING_FTP_ALTERNATIVE_TO_USER]);
  ------------------
  |  | 1477|      7|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 4430|      7|    if(!ftpc->alternative_to_user) {
  ------------------
  |  Branch (4430:8): [True: 0, False: 7]
  ------------------
 4431|      0|      curlx_safefree(ftpc->account);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4432|      0|      Curl_conn_meta_remove(conn, CURL_META_FTP_CONN);
  ------------------
  |  |  156|      0|#define CURL_META_FTP_CONN   "meta:proto:ftp:conn"
  ------------------
 4433|      0|      return CURLE_OUT_OF_MEMORY;
 4434|      0|    }
 4435|      7|  }
 4436|       |
 4437|  4.96k|  ftp->path = &data->state.up.path[1]; /* do not include the initial slash */
 4438|       |
 4439|  4.96k|  type_url_check(data, ftp);
 4440|       |
 4441|       |  /* get some initial data into the ftp struct */
 4442|  4.96k|  ftp->transfer = PPTRANSFER_BODY;
 4443|  4.96k|  ftp->downloadsize = 0;
 4444|  4.96k|  ftpc->known_filesize = -1; /* unknown size for now */
 4445|  4.96k|  ftpc->use_ssl = data->set.use_ssl;
 4446|  4.96k|  ftpc->ccc = data->set.ftp_ccc;
 4447|       |
 4448|  4.96k|  CURL_TRC_FTP(data, "[%s] setup connection -> %d", FTP_CSTATE(ftpc), result);
  ------------------
  |  |  180|  4.96k|  do {                                                   \
  |  |  181|  4.96k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|  4.96k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  9.92k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 4.96k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4.96k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  9.92k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  4.96k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|  4.96k|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (182:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  183|  4.96k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 4.96k]
  |  |  ------------------
  ------------------
 4449|  4.96k|  return result;
 4450|  4.96k|}
ftp.c:ftp_easy_dtor:
 4350|  4.96k|{
 4351|  4.96k|  struct FTP *ftp = entry;
 4352|  4.96k|  (void)key;
 4353|  4.96k|  (void)klen;
 4354|  4.96k|  curlx_safefree(ftp->pathalloc);
  ------------------
  |  | 1327|  4.96k|  do {                      \
  |  | 1328|  4.96k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  4.96k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  4.96k|    (ptr) = NULL;           \
  |  | 1330|  4.96k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 4.96k]
  |  |  ------------------
  ------------------
 4355|  4.96k|  curlx_free(ftp);
  ------------------
  |  | 1483|  4.96k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 4356|  4.96k|}
ftp.c:ftp_conn_dtor:
 4359|  4.96k|{
 4360|  4.96k|  struct ftp_conn *ftpc = entry;
 4361|  4.96k|  (void)key;
 4362|  4.96k|  (void)klen;
 4363|  4.96k|  freedirs(ftpc);
 4364|  4.96k|  curlx_safefree(ftpc->account);
  ------------------
  |  | 1327|  4.96k|  do {                      \
  |  | 1328|  4.96k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  4.96k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  4.96k|    (ptr) = NULL;           \
  |  | 1330|  4.96k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 4.96k]
  |  |  ------------------
  ------------------
 4365|  4.96k|  curlx_safefree(ftpc->alternative_to_user);
  ------------------
  |  | 1327|  4.96k|  do {                      \
  |  | 1328|  4.96k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  4.96k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  4.96k|    (ptr) = NULL;           \
  |  | 1330|  4.96k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 4.96k]
  |  |  ------------------
  ------------------
 4366|  4.96k|  curlx_safefree(ftpc->entrypath);
  ------------------
  |  | 1327|  4.96k|  do {                      \
  |  | 1328|  4.96k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  4.96k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  4.96k|    (ptr) = NULL;           \
  |  | 1330|  4.96k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 4.96k]
  |  |  ------------------
  ------------------
 4367|  4.96k|  curlx_safefree(ftpc->prevpath);
  ------------------
  |  | 1327|  4.96k|  do {                      \
  |  | 1328|  4.96k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  4.96k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  4.96k|    (ptr) = NULL;           \
  |  | 1330|  4.96k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 4.96k]
  |  |  ------------------
  ------------------
 4368|  4.96k|  curlx_safefree(ftpc->server_os);
  ------------------
  |  | 1327|  4.96k|  do {                      \
  |  | 1328|  4.96k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  4.96k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  4.96k|    (ptr) = NULL;           \
  |  | 1330|  4.96k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 4.96k]
  |  |  ------------------
  ------------------
 4369|  4.96k|  Curl_pp_disconnect(&ftpc->pp);
 4370|  4.96k|  curlx_free(ftpc);
  ------------------
  |  | 1483|  4.96k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 4371|  4.96k|}
ftp.c:freedirs:
  177|  5.04k|{
  178|  5.04k|  curlx_safefree(ftpc->dirs);
  ------------------
  |  | 1327|  5.04k|  do {                      \
  |  | 1328|  5.04k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  5.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  5.04k|    (ptr) = NULL;           \
  |  | 1330|  5.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 5.04k]
  |  |  ------------------
  ------------------
  179|  5.04k|  ftpc->dirdepth = 0;
  180|  5.04k|  curlx_safefree(ftpc->rawpath);
  ------------------
  |  | 1327|  5.04k|  do {                      \
  |  | 1328|  5.04k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  5.04k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  5.04k|    (ptr) = NULL;           \
  |  | 1330|  5.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 5.04k]
  |  |  ------------------
  ------------------
  181|       |  ftpc->file = NULL;
  182|  5.04k|}
ftp.c:type_url_check:
 4374|  4.96k|{
 4375|  4.96k|  size_t len = strlen(ftp->path);
 4376|       |  /* FTP URLs support an extension like ";type=<typecode>" that
 4377|       |   * we will try to get now! */
 4378|  4.96k|  if((len >= 7) && !memcmp(&ftp->path[len - 7], ";type=", 6)) {
  ------------------
  |  Branch (4378:6): [True: 767, False: 4.19k]
  |  Branch (4378:20): [True: 63, False: 704]
  ------------------
 4379|     63|    char *type = &ftp->path[len - 7];
 4380|     63|    char command = Curl_raw_toupper(type[6]);
 4381|       |
 4382|     63|    *type = 0; /* cut it off */
 4383|       |
 4384|     63|    switch(command) {
 4385|     41|    case 'A': /* ASCII mode */
  ------------------
  |  Branch (4385:5): [True: 41, False: 22]
  ------------------
 4386|     41|      data->state.prefer_ascii = TRUE;
  ------------------
  |  | 1055|     41|#define TRUE true
  ------------------
 4387|     41|      break;
 4388|       |
 4389|      8|    case 'D': /* directory mode */
  ------------------
  |  Branch (4389:5): [True: 8, False: 55]
  ------------------
 4390|      8|      data->state.list_only = TRUE;
  ------------------
  |  | 1055|      8|#define TRUE true
  ------------------
 4391|      8|      break;
 4392|       |
 4393|      0|    case 'I': /* binary mode */
  ------------------
  |  Branch (4393:5): [True: 0, False: 63]
  ------------------
 4394|     14|    default:
  ------------------
  |  Branch (4394:5): [True: 14, False: 49]
  ------------------
 4395|       |      /* switch off ASCII */
 4396|       |      data->state.prefer_ascii = FALSE;
  ------------------
  |  | 1058|     14|#define FALSE false
  ------------------
 4397|     14|      break;
 4398|     63|    }
 4399|     63|  }
 4400|  4.96k|}
ftp.c:ftp_do:
 4212|  1.41k|{
 4213|  1.41k|  CURLcode result = CURLE_OK;
 4214|  1.41k|  struct ftp_conn *ftpc = Curl_conn_meta_get(data->conn, CURL_META_FTP_CONN);
  ------------------
  |  |  156|  1.41k|#define CURL_META_FTP_CONN   "meta:proto:ftp:conn"
  ------------------
 4215|  1.41k|  struct FTP *ftp = Curl_meta_get(data, CURL_META_FTP_EASY);
  ------------------
  |  |  154|  1.41k|#define CURL_META_FTP_EASY   "meta:proto:ftp:easy"
  ------------------
 4216|       |
 4217|  1.41k|  *done = FALSE; /* default to false */
  ------------------
  |  | 1058|  1.41k|#define FALSE false
  ------------------
 4218|  1.41k|  if(!ftpc || !ftp)
  ------------------
  |  Branch (4218:6): [True: 0, False: 1.41k]
  |  Branch (4218:15): [True: 0, False: 1.41k]
  ------------------
 4219|      0|    return CURLE_FAILED_INIT;
 4220|  1.41k|  ftpc->wait_data_conn = FALSE; /* default to no such wait */
  ------------------
  |  | 1058|  1.41k|#define FALSE false
  ------------------
 4221|       |
 4222|  1.41k|#ifdef CURL_PREFER_LF_LINEENDS
 4223|  1.41k|  {
 4224|       |    /* FTP data may need conversion. */
 4225|  1.41k|    struct Curl_cwriter *ftp_lc_writer;
 4226|       |
 4227|  1.41k|    result = Curl_cwriter_create(&ftp_lc_writer, data, &ftp_cw_lc,
 4228|  1.41k|                                 CURL_CW_CONTENT_DECODE);
 4229|  1.41k|    if(result)
  ------------------
  |  Branch (4229:8): [True: 0, False: 1.41k]
  ------------------
 4230|      0|      return result;
 4231|       |
 4232|  1.41k|    result = Curl_cwriter_add(data, ftp_lc_writer);
 4233|  1.41k|    if(result) {
  ------------------
  |  Branch (4233:8): [True: 0, False: 1.41k]
  ------------------
 4234|      0|      Curl_cwriter_free(data, ftp_lc_writer);
 4235|      0|      return result;
 4236|      0|    }
 4237|  1.41k|  }
 4238|  1.41k|#endif /* CURL_PREFER_LF_LINEENDS */
 4239|       |
 4240|  1.41k|  if(data->state.wildcardmatch) {
  ------------------
  |  Branch (4240:6): [True: 535, False: 881]
  ------------------
 4241|    535|    result = wc_statemach(data, ftpc, ftp);
 4242|    535|    if(data->wildcard->state == CURLWC_SKIP ||
  ------------------
  |  Branch (4242:8): [True: 0, False: 535]
  ------------------
 4243|    535|       data->wildcard->state == CURLWC_DONE) {
  ------------------
  |  Branch (4243:8): [True: 7, False: 528]
  ------------------
 4244|       |      /* do not call ftp_regular_transfer */
 4245|      7|      return CURLE_OK;
 4246|      7|    }
 4247|    528|    if(result) /* error, loop or skipping the file */
  ------------------
  |  Branch (4247:8): [True: 8, False: 520]
  ------------------
 4248|      8|      return result;
 4249|    528|  }
 4250|    881|  else { /* no wildcard FSM needed */
 4251|    881|    result = ftp_parse_url_path(data, ftpc, ftp);
 4252|    881|    if(result)
  ------------------
  |  Branch (4252:8): [True: 2, False: 879]
  ------------------
 4253|      2|      return result;
 4254|    881|  }
 4255|       |
 4256|  1.39k|  result = ftp_regular_transfer(data, ftpc, ftp, done);
 4257|       |
 4258|  1.39k|  return result;
 4259|  1.41k|}
ftp.c:ftp_cw_lc_write:
  377|   510k|{
  378|   510k|  static const char nl = '\n';
  379|   510k|  struct ftp_cw_lc_ctx *ctx = writer->ctx;
  380|   510k|  struct ftp_conn *ftpc = Curl_conn_meta_get(data->conn, CURL_META_FTP_CONN);
  ------------------
  |  |  156|   510k|#define CURL_META_FTP_CONN   "meta:proto:ftp:conn"
  ------------------
  381|       |
  382|   510k|  if(!ftpc)
  ------------------
  |  Branch (382:6): [True: 0, False: 510k]
  ------------------
  383|      0|    return CURLE_FAILED_INIT;
  384|       |
  385|   510k|  if(!(type & CLIENTWRITE_BODY) || ftpc->transfertype != 'A')
  ------------------
  |  |   42|   510k|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  |  Branch (385:6): [True: 509k, False: 1.07k]
  |  Branch (385:36): [True: 52, False: 1.02k]
  ------------------
  386|   509k|    return Curl_cwriter_write(data, writer->next, type, buf, blen);
  387|       |
  388|       |  /* ASCII mode BODY data, convert lineends */
  389|  2.86k|  while(blen) {
  ------------------
  |  Branch (389:9): [True: 2.25k, False: 609]
  ------------------
  390|       |    /* do not pass EOS when writing parts */
  391|  2.25k|    int chunk_type = (type & ~CLIENTWRITE_EOS);
  ------------------
  |  |   49|  2.25k|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
  392|  2.25k|    const char *cp;
  393|  2.25k|    size_t chunk_len;
  394|  2.25k|    CURLcode result;
  395|       |
  396|  2.25k|    if(ctx->newline_pending) {
  ------------------
  |  Branch (396:8): [True: 1.80k, False: 447]
  ------------------
  397|  1.80k|      if(buf[0] != '\n') {
  ------------------
  |  Branch (397:10): [True: 1.55k, False: 247]
  ------------------
  398|       |        /* previous chunk ended in '\r' and we do not see a '\n' in this one,
  399|       |         * need to write a newline. */
  400|  1.55k|        result = Curl_cwriter_write(data, writer->next, chunk_type, &nl, 1);
  401|  1.55k|        if(result)
  ------------------
  |  Branch (401:12): [True: 0, False: 1.55k]
  ------------------
  402|      0|          return result;
  403|  1.55k|      }
  404|       |      /* either we wrote the newline or it is part of the next chunk of bytes
  405|       |       * we write. */
  406|  1.80k|      ctx->newline_pending = FALSE;
  ------------------
  |  | 1058|  1.80k|#define FALSE false
  ------------------
  407|  1.80k|    }
  408|       |
  409|  2.25k|    cp = memchr(buf, '\r', blen);
  410|  2.25k|    if(!cp)
  ------------------
  |  Branch (410:8): [True: 415, False: 1.83k]
  ------------------
  411|    415|      break;
  412|       |
  413|       |    /* write the bytes before the '\r', excluding the '\r' */
  414|  1.83k|    chunk_len = cp - buf;
  415|  1.83k|    if(chunk_len) {
  ------------------
  |  Branch (415:8): [True: 918, False: 920]
  ------------------
  416|    918|      result = Curl_cwriter_write(data, writer->next, chunk_type,
  417|    918|                                  buf, chunk_len);
  418|    918|      if(result)
  ------------------
  |  Branch (418:10): [True: 0, False: 918]
  ------------------
  419|      0|        return result;
  420|    918|    }
  421|       |    /* skip the '\r', we now have a newline pending */
  422|  1.83k|    buf = cp + 1;
  423|  1.83k|    blen = blen - chunk_len - 1;
  424|  1.83k|    ctx->newline_pending = TRUE;
  ------------------
  |  | 1055|  1.83k|#define TRUE true
  ------------------
  425|  1.83k|  }
  426|       |
  427|       |  /* Any remaining data does not contain a '\r' */
  428|  1.02k|  if(blen) {
  ------------------
  |  Branch (428:6): [True: 415, False: 609]
  ------------------
  429|    415|    DEBUGASSERT(!ctx->newline_pending);
  ------------------
  |  | 1081|    415|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (429:5): [True: 0, False: 415]
  |  Branch (429:5): [True: 415, False: 0]
  ------------------
  430|    415|    return Curl_cwriter_write(data, writer->next, type, buf, blen);
  431|    415|  }
  432|    609|  else if(type & CLIENTWRITE_EOS) {
  ------------------
  |  |   49|    609|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
  |  Branch (432:11): [True: 577, False: 32]
  ------------------
  433|       |    /* EndOfStream, if we have a trailing cr, now is the time to write it */
  434|    577|    if(ctx->newline_pending) {
  ------------------
  |  Branch (434:8): [True: 32, False: 545]
  ------------------
  435|     32|      ctx->newline_pending = FALSE;
  ------------------
  |  | 1058|     32|#define FALSE false
  ------------------
  436|     32|      return Curl_cwriter_write(data, writer->next, type, &nl, 1);
  437|     32|    }
  438|       |    /* Always pass on the EOS type indicator */
  439|    545|    return Curl_cwriter_write(data, writer->next, type, buf, 0);
  440|    577|  }
  441|     32|  return CURLE_OK;
  442|  1.02k|}
ftp.c:wc_statemach:
 4028|    535|{
 4029|    535|  struct WildcardData * const wildcard = data->wildcard;
 4030|    535|  CURLcode result = CURLE_OK;
 4031|       |
 4032|    605|  for(;;) {
 4033|    605|    switch(wildcard->state) {
  ------------------
  |  Branch (4033:12): [True: 605, False: 0]
  ------------------
 4034|    515|    case CURLWC_INIT:
  ------------------
  |  Branch (4034:5): [True: 515, False: 90]
  ------------------
 4035|    515|      result = init_wc_data(data, ftpc, ftp);
 4036|    515|      if(wildcard->state == CURLWC_CLEAN)
  ------------------
  |  Branch (4036:10): [True: 77, False: 438]
  ------------------
 4037|       |        /* only listing! */
 4038|     77|        return result;
 4039|    438|      wildcard->state = result ? CURLWC_ERROR : CURLWC_MATCHING;
  ------------------
  |  Branch (4039:25): [True: 1, False: 437]
  ------------------
 4040|    438|      return result;
 4041|       |
 4042|     17|    case CURLWC_MATCHING: {
  ------------------
  |  Branch (4042:5): [True: 17, False: 588]
  ------------------
 4043|       |      /* In this state is LIST response successfully parsed, so lets restore
 4044|       |         previous WRITEFUNCTION callback and WRITEDATA pointer */
 4045|     17|      struct ftp_wc *ftpwc = wildcard->ftpwc;
 4046|     17|      data->set.fwrite_func = ftpwc->backup.write_function;
 4047|     17|      data->set.out = ftpwc->backup.file_descriptor;
 4048|     17|      ftpwc->backup.write_function = ZERO_NULL;
  ------------------
  |  | 1155|     17|#define ZERO_NULL 0
  ------------------
 4049|     17|      ftpwc->backup.file_descriptor = NULL;
 4050|     17|      wildcard->state = CURLWC_DOWNLOADING;
 4051|       |
 4052|     17|      if(Curl_ftp_parselist_geterror(ftpwc->parser)) {
  ------------------
  |  Branch (4052:10): [True: 3, False: 14]
  ------------------
 4053|       |        /* error found in LIST parsing */
 4054|      3|        wildcard->state = CURLWC_CLEAN;
 4055|      3|        continue;
 4056|      3|      }
 4057|     14|      if(Curl_llist_count(&wildcard->filelist) == 0) {
  ------------------
  |  Branch (4057:10): [True: 3, False: 11]
  ------------------
 4058|       |        /* no corresponding file */
 4059|      3|        wildcard->state = CURLWC_CLEAN;
 4060|      3|        return CURLE_REMOTE_FILE_NOT_FOUND;
 4061|      3|      }
 4062|     11|      continue;
 4063|     14|    }
 4064|       |
 4065|     35|    case CURLWC_DOWNLOADING: {
  ------------------
  |  Branch (4065:5): [True: 35, False: 570]
  ------------------
 4066|       |      /* filelist has at least one file, lets get first one */
 4067|     35|      struct Curl_llist_node *head = Curl_llist_head(&wildcard->filelist);
 4068|     35|      struct curl_fileinfo *finfo = Curl_node_elem(head);
 4069|       |
 4070|     35|      char *tmp_path = curl_maprintf("%s%s", wildcard->path, finfo->filename);
 4071|     35|      if(!tmp_path)
  ------------------
  |  Branch (4071:10): [True: 0, False: 35]
  ------------------
 4072|      0|        return CURLE_OUT_OF_MEMORY;
 4073|       |
 4074|       |      /* switch default ftp->path and tmp_path */
 4075|     35|      curlx_free(ftp->pathalloc);
  ------------------
  |  | 1483|     35|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 4076|     35|      ftp->pathalloc = ftp->path = tmp_path;
 4077|       |
 4078|     35|      infof(data, "Wildcard - START of \"%s\"", finfo->filename);
  ------------------
  |  |  143|     35|  do {                               \
  |  |  144|     35|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     35|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 35, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 35]
  |  |  |  |  ------------------
  |  |  |  |  320|     35|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     35|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     35|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 35]
  |  |  ------------------
  ------------------
 4079|     35|      if(data->set.chunk_bgn) {
  ------------------
  |  Branch (4079:10): [True: 0, False: 35]
  ------------------
 4080|      0|        long userresponse;
 4081|      0|        Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 4082|      0|        userresponse = data->set.chunk_bgn(
 4083|      0|          finfo, data->set.wildcardptr,
 4084|      0|          (int)Curl_llist_count(&wildcard->filelist));
 4085|      0|        Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 4086|      0|        switch(userresponse) {
  ------------------
  |  Branch (4086:16): [True: 0, False: 0]
  ------------------
 4087|      0|        case CURL_CHUNK_BGN_FUNC_SKIP:
  ------------------
  |  |  347|      0|#define CURL_CHUNK_BGN_FUNC_SKIP    2 /* skip this chunk over */
  ------------------
  |  Branch (4087:9): [True: 0, False: 0]
  ------------------
 4088|      0|          infof(data, "Wildcard - \"%s\" skipped by user", finfo->filename);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4089|      0|          wildcard->state = CURLWC_SKIP;
 4090|      0|          continue;
 4091|      0|        case CURL_CHUNK_BGN_FUNC_FAIL:
  ------------------
  |  |  346|      0|#define CURL_CHUNK_BGN_FUNC_FAIL    1 /* tell the lib to end the task */
  ------------------
  |  Branch (4091:9): [True: 0, False: 0]
  ------------------
 4092|      0|          return CURLE_CHUNK_FAILED;
 4093|      0|        }
 4094|      0|      }
 4095|       |
 4096|     35|      if(finfo->filetype != CURLFILETYPE_FILE) {
  ------------------
  |  Branch (4096:10): [True: 28, False: 7]
  ------------------
 4097|     28|        wildcard->state = CURLWC_SKIP;
 4098|     28|        continue;
 4099|     28|      }
 4100|       |
 4101|      7|      if(finfo->flags & CURLFINFOFLAG_KNOWN_SIZE)
  ------------------
  |  |  312|      7|#define CURLFINFOFLAG_KNOWN_SIZE        (1 << 6)
  ------------------
  |  Branch (4101:10): [True: 7, False: 0]
  ------------------
 4102|      7|        ftpc->known_filesize = finfo->size;
 4103|       |
 4104|      7|      result = ftp_parse_url_path(data, ftpc, ftp);
 4105|      7|      if(result)
  ------------------
  |  Branch (4105:10): [True: 1, False: 6]
  ------------------
 4106|      1|        return result;
 4107|       |
 4108|       |      /* we do not need the Curl_fileinfo of first file anymore */
 4109|      6|      Curl_node_remove(Curl_llist_head(&wildcard->filelist));
 4110|       |
 4111|      6|      if(Curl_llist_count(&wildcard->filelist) == 0) {
  ------------------
  |  Branch (4111:10): [True: 3, False: 3]
  ------------------
 4112|       |        /* remains only one file to down. */
 4113|      3|        wildcard->state = CURLWC_CLEAN;
 4114|       |        /* after that will be ftp_do called once again and no transfer
 4115|       |           will be done because of CURLWC_CLEAN state */
 4116|      3|        return CURLE_OK;
 4117|      3|      }
 4118|      3|      return result;
 4119|      6|    }
 4120|       |
 4121|     28|    case CURLWC_SKIP: {
  ------------------
  |  Branch (4121:5): [True: 28, False: 577]
  ------------------
 4122|     28|      if(data->set.chunk_end) {
  ------------------
  |  Branch (4122:10): [True: 0, False: 28]
  ------------------
 4123|      0|        Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 4124|      0|        data->set.chunk_end(data->set.wildcardptr);
 4125|      0|        Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 4126|      0|      }
 4127|     28|      Curl_node_remove(Curl_llist_head(&wildcard->filelist));
 4128|     28|      wildcard->state = (Curl_llist_count(&wildcard->filelist) == 0) ?
  ------------------
  |  Branch (4128:25): [True: 4, False: 24]
  ------------------
 4129|     24|        CURLWC_CLEAN : CURLWC_DOWNLOADING;
 4130|     28|      continue;
 4131|      6|    }
 4132|       |
 4133|     10|    case CURLWC_CLEAN: {
  ------------------
  |  Branch (4133:5): [True: 10, False: 595]
  ------------------
 4134|     10|      struct ftp_wc *ftpwc = wildcard->ftpwc;
 4135|     10|      result = CURLE_OK;
 4136|     10|      if(ftpwc)
  ------------------
  |  Branch (4136:10): [True: 7, False: 3]
  ------------------
 4137|      7|        result = Curl_ftp_parselist_geterror(ftpwc->parser);
 4138|       |
 4139|     10|      wildcard->state = result ? CURLWC_ERROR : CURLWC_DONE;
  ------------------
  |  Branch (4139:25): [True: 3, False: 7]
  ------------------
 4140|     10|      return result;
 4141|      6|    }
 4142|       |
 4143|      0|    case CURLWC_DONE:
  ------------------
  |  Branch (4143:5): [True: 0, False: 605]
  ------------------
 4144|      0|    case CURLWC_ERROR:
  ------------------
  |  Branch (4144:5): [True: 0, False: 605]
  ------------------
 4145|      0|    case CURLWC_CLEAR:
  ------------------
  |  Branch (4145:5): [True: 0, False: 605]
  ------------------
 4146|      0|      if(wildcard->dtor) {
  ------------------
  |  Branch (4146:10): [True: 0, False: 0]
  ------------------
 4147|      0|        wildcard->dtor(wildcard->ftpwc);
 4148|      0|        wildcard->ftpwc = NULL;
 4149|      0|      }
 4150|      0|      return result;
 4151|    605|    }
 4152|    605|  }
 4153|       |  /* UNREACHABLE */
 4154|    535|}
ftp.c:init_wc_data:
 3934|    515|{
 3935|    515|  char *last_slash;
 3936|    515|  char *path = ftp->path;
 3937|    515|  struct WildcardData *wildcard = data->wildcard;
 3938|    515|  CURLcode result = CURLE_OK;
 3939|    515|  struct ftp_wc *ftpwc = NULL;
 3940|       |
 3941|    515|  last_slash = strrchr(ftp->path, '/');
 3942|    515|  if(last_slash) {
  ------------------
  |  Branch (3942:6): [True: 76, False: 439]
  ------------------
 3943|     76|    last_slash++;
 3944|     76|    if(last_slash[0] == '\0') {
  ------------------
  |  Branch (3944:8): [True: 2, False: 74]
  ------------------
 3945|      2|      wildcard->state = CURLWC_CLEAN;
 3946|      2|      return ftp_parse_url_path(data, ftpc, ftp);
 3947|      2|    }
 3948|     74|    wildcard->pattern = curlx_strdup(last_slash);
  ------------------
  |  | 1477|     74|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 3949|     74|    if(!wildcard->pattern)
  ------------------
  |  Branch (3949:8): [True: 0, False: 74]
  ------------------
 3950|      0|      return CURLE_OUT_OF_MEMORY;
 3951|     74|    last_slash[0] = '\0'; /* cut file from path */
 3952|     74|  }
 3953|    439|  else { /* there is only 'wildcard pattern' or nothing */
 3954|    439|    if(path[0]) {
  ------------------
  |  Branch (3954:8): [True: 364, False: 75]
  ------------------
 3955|    364|      wildcard->pattern = curlx_strdup(path);
  ------------------
  |  | 1477|    364|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 3956|    364|      if(!wildcard->pattern)
  ------------------
  |  Branch (3956:10): [True: 0, False: 364]
  ------------------
 3957|      0|        return CURLE_OUT_OF_MEMORY;
 3958|    364|      path[0] = '\0';
 3959|    364|    }
 3960|     75|    else { /* only list */
 3961|     75|      wildcard->state = CURLWC_CLEAN;
 3962|     75|      return ftp_parse_url_path(data, ftpc, ftp);
 3963|     75|    }
 3964|    439|  }
 3965|       |
 3966|       |  /* program continues only if URL is not ending with slash, allocate needed
 3967|       |     resources for wildcard transfer */
 3968|       |
 3969|       |  /* allocate ftp protocol specific wildcard data */
 3970|    438|  ftpwc = curlx_calloc(1, sizeof(struct ftp_wc));
  ------------------
  |  | 1480|    438|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 3971|    438|  if(!ftpwc) {
  ------------------
  |  Branch (3971:6): [True: 0, False: 438]
  ------------------
 3972|      0|    result = CURLE_OUT_OF_MEMORY;
 3973|      0|    goto fail;
 3974|      0|  }
 3975|       |
 3976|       |  /* INITIALIZE parselist structure */
 3977|    438|  ftpwc->parser = Curl_ftp_parselist_data_alloc();
 3978|    438|  if(!ftpwc->parser) {
  ------------------
  |  Branch (3978:6): [True: 0, False: 438]
  ------------------
 3979|      0|    result = CURLE_OUT_OF_MEMORY;
 3980|      0|    goto fail;
 3981|      0|  }
 3982|       |
 3983|    438|  wildcard->ftpwc = ftpwc; /* put it to the WildcardData tmp pointer */
 3984|    438|  wildcard->dtor = wc_data_dtor;
 3985|       |
 3986|       |  /* wildcard does not support NOCWD option (assert it?) */
 3987|    438|  if(data->set.ftp_filemethod == FTPFILE_NOCWD)
  ------------------
  |  Branch (3987:6): [True: 1, False: 437]
  ------------------
 3988|      1|    data->set.ftp_filemethod = FTPFILE_MULTICWD;
 3989|       |
 3990|       |  /* try to parse ftp URL */
 3991|    438|  result = ftp_parse_url_path(data, ftpc, ftp);
 3992|    438|  if(result) {
  ------------------
  |  Branch (3992:6): [True: 1, False: 437]
  ------------------
 3993|      1|    goto fail;
 3994|      1|  }
 3995|       |
 3996|    437|  wildcard->path = curlx_strdup(ftp->path);
  ------------------
  |  | 1477|    437|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 3997|    437|  if(!wildcard->path) {
  ------------------
  |  Branch (3997:6): [True: 0, False: 437]
  ------------------
 3998|      0|    result = CURLE_OUT_OF_MEMORY;
 3999|      0|    goto fail;
 4000|      0|  }
 4001|       |
 4002|       |  /* backup old write_function */
 4003|    437|  ftpwc->backup.write_function = data->set.fwrite_func;
 4004|       |  /* parsing write function */
 4005|    437|  data->set.fwrite_func = Curl_ftp_parselist;
 4006|       |  /* backup old file descriptor */
 4007|    437|  ftpwc->backup.file_descriptor = data->set.out;
 4008|       |  /* let the writefunc callback know the transfer */
 4009|    437|  data->set.out = data;
 4010|       |
 4011|    437|  infof(data, "Wildcard - Parsing started");
  ------------------
  |  |  143|    437|  do {                               \
  |  |  144|    437|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    437|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 437, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 437]
  |  |  |  |  ------------------
  |  |  |  |  320|    437|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    437|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    437|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 437]
  |  |  ------------------
  ------------------
 4012|    437|  return CURLE_OK;
 4013|       |
 4014|      1|fail:
 4015|      1|  if(ftpwc) {
  ------------------
  |  Branch (4015:6): [True: 1, False: 0]
  ------------------
 4016|      1|    Curl_ftp_parselist_data_free(&ftpwc->parser);
 4017|      1|    curlx_free(ftpwc);
  ------------------
  |  | 1483|      1|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 4018|      1|  }
 4019|      1|  curlx_safefree(wildcard->pattern);
  ------------------
  |  | 1327|      1|  do {                      \
  |  | 1328|      1|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      1|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      1|    (ptr) = NULL;           \
  |  | 1330|      1|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 1]
  |  |  ------------------
  ------------------
 4020|      1|  wildcard->dtor = ZERO_NULL;
  ------------------
  |  | 1155|      1|#define ZERO_NULL 0
  ------------------
 4021|       |  wildcard->ftpwc = NULL;
 4022|      1|  return result;
 4023|    437|}
ftp.c:wc_data_dtor:
 3924|    437|{
 3925|    437|  struct ftp_wc *ftpwc = ptr;
 3926|    437|  if(ftpwc && ftpwc->parser)
  ------------------
  |  Branch (3926:6): [True: 437, False: 0]
  |  Branch (3926:15): [True: 437, False: 0]
  ------------------
 3927|    437|    Curl_ftp_parselist_data_free(&ftpwc->parser);
 3928|    437|  curlx_free(ftpwc);
  ------------------
  |  | 1483|    437|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3929|    437|}
ftp.c:ftp_parse_url_path:
  210|  1.40k|{
  211|  1.40k|  const char *slashPos = NULL;
  212|  1.40k|  const char *fileName = NULL;
  213|  1.40k|  CURLcode result = CURLE_OK;
  214|  1.40k|  const char *rawPath = NULL; /* URL-decoded "raw" path */
  215|  1.40k|  size_t pathLen = 0;
  216|       |
  217|  1.40k|  ftpc->ctl_valid = FALSE;
  ------------------
  |  | 1058|  1.40k|#define FALSE false
  ------------------
  218|  1.40k|  ftpc->cwdfail = FALSE;
  ------------------
  |  | 1058|  1.40k|#define FALSE false
  ------------------
  219|       |
  220|  1.40k|  if(ftpc->rawpath)
  ------------------
  |  Branch (220:6): [True: 7, False: 1.39k]
  ------------------
  221|      7|    freedirs(ftpc);
  222|       |  /* URL-decode ftp path before further evaluation */
  223|  1.40k|  result = Curl_urldecode(ftp->path, 0, &ftpc->rawpath, &pathLen, REJECT_CTRL);
  224|  1.40k|  if(result) {
  ------------------
  |  Branch (224:6): [True: 2, False: 1.40k]
  ------------------
  225|      2|    failf(data, "path contains control characters");
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
  226|      2|    return result;
  227|      2|  }
  228|  1.40k|  rawPath = ftpc->rawpath;
  229|       |
  230|  1.40k|  switch(data->set.ftp_filemethod) {
  231|      7|  case FTPFILE_NOCWD: /* fastest, but less standard-compliant */
  ------------------
  |  Branch (231:3): [True: 7, False: 1.39k]
  ------------------
  232|       |
  233|      7|    if((pathLen > 0) && (rawPath[pathLen - 1] != '/'))
  ------------------
  |  Branch (233:8): [True: 5, False: 2]
  |  Branch (233:25): [True: 1, False: 4]
  ------------------
  234|      1|      fileName = rawPath;  /* this is a full file path */
  235|       |    /*
  236|       |      else: ftpc->file is not used anywhere other than for operations on
  237|       |            a file. In other words, never for directory operations,
  238|       |            so we can safely leave filename as NULL here and use it as a
  239|       |            argument in dir/file decisions.
  240|       |    */
  241|      7|    break;
  242|       |
  243|      4|  case FTPFILE_SINGLECWD:
  ------------------
  |  Branch (243:3): [True: 4, False: 1.39k]
  ------------------
  244|      4|    slashPos = strrchr(rawPath, '/');
  245|      4|    if(slashPos) {
  ------------------
  |  Branch (245:8): [True: 2, False: 2]
  ------------------
  246|       |      /* get path before last slash, except for / */
  247|      2|      size_t dirlen = slashPos - rawPath;
  248|      2|      if(dirlen == 0)
  ------------------
  |  Branch (248:10): [True: 1, False: 1]
  ------------------
  249|      1|        dirlen = 1;
  250|       |
  251|      2|      ftpc->dirs = curlx_calloc(1, sizeof(ftpc->dirs[0]));
  ------------------
  |  | 1480|      2|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  252|      2|      if(!ftpc->dirs)
  ------------------
  |  Branch (252:10): [True: 0, False: 2]
  ------------------
  253|      0|        return CURLE_OUT_OF_MEMORY;
  254|       |
  255|      2|      ftpc->dirs[0].start = 0;
  256|      2|      ftpc->dirs[0].len = (int)dirlen;
  257|      2|      ftpc->dirdepth = 1; /* we consider it to be a single directory */
  258|      2|      fileName = slashPos + 1; /* rest is filename */
  259|      2|    }
  260|      2|    else
  261|      2|      fileName = rawPath; /* filename only (or empty) */
  262|      4|    break;
  263|       |
  264|      4|  default: /* allow pretty much anything */
  ------------------
  |  Branch (264:3): [True: 0, False: 1.40k]
  ------------------
  265|  1.39k|  case FTPFILE_MULTICWD: {
  ------------------
  |  Branch (265:3): [True: 1.39k, False: 11]
  ------------------
  266|       |    /* current position: begin of next path component */
  267|  1.39k|    const char *curPos = rawPath;
  268|       |
  269|       |    /* number of entries to allocate for the 'dirs' array */
  270|  1.39k|    size_t dirAlloc = numof_slashes(rawPath);
  271|       |
  272|  1.39k|    if(dirAlloc >= FTP_MAX_DIR_DEPTH)
  ------------------
  |  |  198|  1.39k|#define FTP_MAX_DIR_DEPTH 1000
  ------------------
  |  Branch (272:8): [True: 0, False: 1.39k]
  ------------------
  273|       |      /* suspiciously deep directory hierarchy */
  274|      0|      return CURLE_URL_MALFORMAT;
  275|       |
  276|  1.39k|    if(dirAlloc) {
  ------------------
  |  Branch (276:8): [True: 269, False: 1.12k]
  ------------------
  277|    269|      ftpc->dirs = curlx_calloc(dirAlloc, sizeof(ftpc->dirs[0]));
  ------------------
  |  | 1480|    269|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  278|    269|      if(!ftpc->dirs)
  ------------------
  |  Branch (278:10): [True: 0, False: 269]
  ------------------
  279|      0|        return CURLE_OUT_OF_MEMORY;
  280|       |
  281|       |      /* parse the URL path into separate path components */
  282|  2.00k|      while(dirAlloc--) {
  ------------------
  |  Branch (282:13): [True: 1.73k, False: 269]
  ------------------
  283|  1.73k|        const char *spos = strchr(curPos, '/');
  284|  1.73k|        size_t clen = spos - curPos;
  285|       |
  286|       |        /* path starts with a slash: add that as a directory */
  287|  1.73k|        if(!clen && (ftpc->dirdepth == 0))
  ------------------
  |  Branch (287:12): [True: 1.42k, False: 304]
  |  Branch (287:21): [True: 113, False: 1.31k]
  ------------------
  288|    113|          ++clen;
  289|       |
  290|       |        /* we skip empty path components, like "x//y" since the FTP command
  291|       |           CWD requires a parameter and a non-existent parameter a) does not
  292|       |           work on many servers and b) has no effect on the others. */
  293|  1.73k|        if(clen) {
  ------------------
  |  Branch (293:12): [True: 417, False: 1.31k]
  ------------------
  294|    417|          ftpc->dirs[ftpc->dirdepth].start = (int)(curPos - rawPath);
  295|    417|          ftpc->dirs[ftpc->dirdepth].len = (int)clen;
  296|    417|          ftpc->dirdepth++;
  297|    417|        }
  298|  1.73k|        curPos = spos + 1;
  299|  1.73k|      }
  300|    269|    }
  301|  1.39k|    fileName = curPos; /* the rest is the filename (or empty) */
  302|  1.39k|  }
  303|      0|    break;
  304|  1.40k|  } /* switch */
  305|       |
  306|  1.40k|  if(fileName && *fileName)
  ------------------
  |  Branch (306:6): [True: 1.39k, False: 6]
  |  Branch (306:18): [True: 543, False: 852]
  ------------------
  307|    543|    ftpc->file = fileName;
  308|    858|  else
  309|    858|    ftpc->file = NULL; /* instead of point to a zero byte,
  310|       |                          we make it a NULL pointer */
  311|       |
  312|  1.40k|  if(data->state.upload && !ftpc->file && (ftp->transfer == PPTRANSFER_BODY)) {
  ------------------
  |  Branch (312:6): [True: 56, False: 1.34k]
  |  Branch (312:28): [True: 2, False: 54]
  |  Branch (312:43): [True: 2, False: 0]
  ------------------
  313|       |    /* We need a filename when uploading. Return error! */
  314|      2|    failf(data, "Uploading to a URL without a filename");
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
  315|      2|    return CURLE_URL_MALFORMAT;
  316|      2|  }
  317|       |
  318|  1.39k|  ftpc->cwddone = FALSE; /* default to not done */
  ------------------
  |  | 1058|  1.39k|#define FALSE false
  ------------------
  319|       |
  320|  1.39k|  if((data->set.ftp_filemethod == FTPFILE_NOCWD) && (rawPath[0] == '/'))
  ------------------
  |  Branch (320:6): [True: 7, False: 1.39k]
  |  Branch (320:53): [True: 3, False: 4]
  ------------------
  321|      3|    ftpc->cwddone = TRUE; /* skip CWD for absolute paths */
  ------------------
  |  | 1055|      3|#define TRUE true
  ------------------
  322|  1.39k|  else { /* newly created FTP connections are already in entry path */
  323|  1.39k|    const char *oldPath = data->conn->bits.reuse ? ftpc->prevpath : "";
  ------------------
  |  Branch (323:27): [True: 6, False: 1.39k]
  ------------------
  324|  1.39k|    if(oldPath) {
  ------------------
  |  Branch (324:8): [True: 1.39k, False: 0]
  ------------------
  325|  1.39k|      size_t n = pathLen;
  326|  1.39k|      if(data->set.ftp_filemethod == FTPFILE_NOCWD)
  ------------------
  |  Branch (326:10): [True: 4, False: 1.39k]
  ------------------
  327|      4|        n = 0; /* CWD to entry for relative paths */
  328|  1.39k|      else
  329|  1.39k|        n -= ftpc->file ? strlen(ftpc->file) : 0;
  ------------------
  |  Branch (329:14): [True: 542, False: 850]
  ------------------
  330|       |
  331|  1.39k|      if((strlen(oldPath) == n) && rawPath && !strncmp(rawPath, oldPath, n)) {
  ------------------
  |  Branch (331:10): [True: 1.12k, False: 267]
  |  Branch (331:36): [True: 1.12k, False: 0]
  |  Branch (331:47): [True: 1.12k, False: 0]
  ------------------
  332|  1.12k|        infof(data, "Request has same path as previous transfer");
  ------------------
  |  |  143|  1.12k|  do {                               \
  |  |  144|  1.12k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  1.12k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 1.12k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.12k]
  |  |  |  |  ------------------
  |  |  |  |  320|  1.12k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.12k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  1.12k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1.12k]
  |  |  ------------------
  ------------------
  333|  1.12k|        ftpc->cwddone = TRUE;
  ------------------
  |  | 1055|  1.12k|#define TRUE true
  ------------------
  334|  1.12k|      }
  335|  1.39k|    }
  336|  1.39k|  }
  337|       |
  338|  1.39k|  return CURLE_OK;
  339|  1.40k|}
ftp.c:numof_slashes:
  185|  1.39k|{
  186|  1.39k|  const char *slashPos;
  187|  1.39k|  size_t num = 0;
  188|  3.12k|  do {
  189|  3.12k|    slashPos = strchr(str, '/');
  190|  3.12k|    if(slashPos) {
  ------------------
  |  Branch (190:8): [True: 1.73k, False: 1.39k]
  ------------------
  191|  1.73k|      ++num;
  192|  1.73k|      str = slashPos + 1;
  193|  1.73k|    }
  194|  3.12k|  } while(slashPos);
  ------------------
  |  Branch (194:11): [True: 1.73k, False: 1.39k]
  ------------------
  195|  1.39k|  return num;
  196|  1.39k|}
ftp.c:ftp_regular_transfer:
 4172|  1.39k|{
 4173|  1.39k|  CURLcode result = CURLE_OK;
 4174|  1.39k|  bool connected = FALSE;
  ------------------
  |  | 1058|  1.39k|#define FALSE false
  ------------------
 4175|  1.39k|  data->req.size = -1; /* make sure this is unknown at this point */
 4176|       |
 4177|  1.39k|  Curl_pgrsReset(data);
 4178|       |
 4179|  1.39k|  ftpc->ctl_valid = TRUE; /* starts good */
  ------------------
  |  | 1055|  1.39k|#define TRUE true
  ------------------
 4180|       |
 4181|  1.39k|  result = ftp_perform(data, ftpc, ftp,
 4182|  1.39k|                       &connected, /* have we connected after PASV/PORT */
 4183|  1.39k|                       dophase_done); /* all commands in the DO-phase done? */
 4184|       |
 4185|  1.39k|  if(!result) {
  ------------------
  |  Branch (4185:6): [True: 1.32k, False: 79]
  ------------------
 4186|       |
 4187|  1.32k|    if(!*dophase_done)
  ------------------
  |  Branch (4187:8): [True: 1.22k, False: 96]
  ------------------
 4188|       |      /* the DO phase has not completed yet */
 4189|  1.22k|      return CURLE_OK;
 4190|       |
 4191|     96|    result = ftp_dophase_done(data, ftpc, ftp, connected);
 4192|       |
 4193|     96|    if(result)
  ------------------
  |  Branch (4193:8): [True: 0, False: 96]
  ------------------
 4194|      0|      return result;
 4195|     96|  }
 4196|     79|  else
 4197|     79|    freedirs(ftpc);
 4198|       |
 4199|    175|  return result;
 4200|  1.39k|}
ftp.c:ftp_perform:
 3887|  1.39k|{
 3888|       |  /* this is FTP and no proxy */
 3889|  1.39k|  CURLcode result = CURLE_OK;
 3890|       |
 3891|  1.39k|  CURL_TRC_FTP(data, "[%s] DO phase starts", FTP_CSTATE(ftpc));
  ------------------
  |  |  180|  1.39k|  do {                                                   \
  |  |  181|  1.39k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|  1.39k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  2.79k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 1.39k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.39k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  2.79k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.39k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|  1.39k|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (182:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  183|  1.39k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 1.39k]
  |  |  ------------------
  ------------------
 3892|       |
 3893|  1.39k|  if(data->req.no_body) {
  ------------------
  |  Branch (3893:6): [True: 143, False: 1.25k]
  ------------------
 3894|       |    /* requested no body means no transfer... */
 3895|    143|    ftp->transfer = PPTRANSFER_INFO;
 3896|    143|  }
 3897|       |
 3898|  1.39k|  *dophase_done = FALSE; /* not done yet */
  ------------------
  |  | 1058|  1.39k|#define FALSE false
  ------------------
 3899|       |
 3900|       |  /* start the first command in the DO phase */
 3901|  1.39k|  result = ftp_state_quote(data, ftpc, ftp, TRUE, FTP_QUOTE);
  ------------------
  |  | 1055|  1.39k|#define TRUE true
  ------------------
 3902|  1.39k|  if(result)
  ------------------
  |  Branch (3902:6): [True: 13, False: 1.38k]
  ------------------
 3903|     13|    return result;
 3904|       |
 3905|       |  /* run the state-machine */
 3906|  1.38k|  result = ftp_statemach(data, ftpc, dophase_done);
 3907|       |
 3908|  1.38k|  *connected = Curl_conn_is_connected(data->conn, SECONDARYSOCKET);
  ------------------
  |  |  304|  1.38k|#define SECONDARYSOCKET 1
  ------------------
 3909|       |
 3910|  1.38k|  if(*connected)
  ------------------
  |  Branch (3910:6): [True: 0, False: 1.38k]
  ------------------
 3911|      0|    infof(data, "[FTP] [%s] perform, DATA connection established",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3912|  1.38k|          FTP_CSTATE(ftpc));
 3913|  1.38k|  else
 3914|  1.38k|    CURL_TRC_FTP(data, "[%s] perform, awaiting DATA connect",
  ------------------
  |  |  180|  1.38k|  do {                                                   \
  |  |  181|  1.38k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|  1.38k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  2.77k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 1.38k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.38k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  2.77k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.38k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|  1.38k|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (182:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  183|  1.38k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 1.38k]
  |  |  ------------------
  ------------------
 3915|  1.38k|                 FTP_CSTATE(ftpc));
 3916|       |
 3917|  1.38k|  if(*dophase_done)
  ------------------
  |  Branch (3917:6): [True: 99, False: 1.28k]
  ------------------
 3918|     99|    CURL_TRC_FTP(data, "[%s] DO phase is complete1", FTP_CSTATE(ftpc));
  ------------------
  |  |  180|     99|  do {                                                   \
  |  |  181|     99|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|     99|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    198|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 99, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 99]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    198|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|     99|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|     99|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (182:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  183|     99|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 99]
  |  |  ------------------
  ------------------
 3919|       |
 3920|  1.38k|  return result;
 3921|  1.39k|}
ftp.c:ftp_state_quote:
 1864|  1.70k|{
 1865|  1.70k|  CURLcode result = CURLE_OK;
 1866|  1.70k|  bool quote = FALSE;
  ------------------
  |  | 1058|  1.70k|#define FALSE false
  ------------------
 1867|  1.70k|  struct curl_slist *item;
 1868|       |
 1869|  1.70k|  switch(instate) {
 1870|  1.39k|  case FTP_QUOTE:
  ------------------
  |  Branch (1870:3): [True: 1.39k, False: 305]
  ------------------
 1871|  1.39k|  default:
  ------------------
  |  Branch (1871:3): [True: 0, False: 1.70k]
  ------------------
 1872|  1.39k|    item = data->set.quote;
 1873|  1.39k|    break;
 1874|    270|  case FTP_RETR_PREQUOTE:
  ------------------
  |  Branch (1874:3): [True: 270, False: 1.43k]
  ------------------
 1875|    305|  case FTP_STOR_PREQUOTE:
  ------------------
  |  Branch (1875:3): [True: 35, False: 1.66k]
  ------------------
 1876|    305|  case FTP_LIST_PREQUOTE:
  ------------------
  |  Branch (1876:3): [True: 0, False: 1.70k]
  ------------------
 1877|    305|    item = data->set.prequote;
 1878|    305|    break;
 1879|      0|  case FTP_POSTQUOTE:
  ------------------
  |  Branch (1879:3): [True: 0, False: 1.70k]
  ------------------
 1880|      0|    item = data->set.postquote;
 1881|      0|    break;
 1882|  1.70k|  }
 1883|       |
 1884|       |  /*
 1885|       |   * This state uses:
 1886|       |   * 'count1' to iterate over the commands to send
 1887|       |   * 'count2' to store whether to allow commands to fail
 1888|       |   */
 1889|       |
 1890|  1.70k|  if(init)
  ------------------
  |  Branch (1890:6): [True: 1.70k, False: 0]
  ------------------
 1891|  1.70k|    ftpc->count1 = 0;
 1892|      0|  else
 1893|      0|    ftpc->count1++;
 1894|       |
 1895|  1.70k|  if(item) {
  ------------------
  |  Branch (1895:6): [True: 0, False: 1.70k]
  ------------------
 1896|      0|    int i = 0;
 1897|       |
 1898|       |    /* Skip count1 items in the linked list */
 1899|      0|    while((i < ftpc->count1) && item) {
  ------------------
  |  Branch (1899:11): [True: 0, False: 0]
  |  Branch (1899:33): [True: 0, False: 0]
  ------------------
 1900|      0|      item = item->next;
 1901|      0|      i++;
 1902|      0|    }
 1903|      0|    if(item) {
  ------------------
  |  Branch (1903:8): [True: 0, False: 0]
  ------------------
 1904|      0|      const char *cmd = item->data;
 1905|      0|      if(cmd[0] == '*') {
  ------------------
  |  Branch (1905:10): [True: 0, False: 0]
  ------------------
 1906|      0|        cmd++;
 1907|      0|        ftpc->count2 = 1; /* the sent command is allowed to fail */
 1908|      0|      }
 1909|      0|      else
 1910|      0|        ftpc->count2 = 0; /* failure means cancel operation */
 1911|       |
 1912|      0|      result = Curl_pp_sendf(data, &ftpc->pp, "%s", cmd);
 1913|      0|      if(result)
  ------------------
  |  Branch (1913:10): [True: 0, False: 0]
  ------------------
 1914|      0|        return result;
 1915|      0|      ftp_state(data, ftpc, instate);
  ------------------
  |  |  159|      0|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 1916|      0|      quote = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1917|      0|    }
 1918|      0|  }
 1919|       |
 1920|  1.70k|  if(!quote) {
  ------------------
  |  Branch (1920:6): [True: 1.70k, False: 0]
  ------------------
 1921|       |    /* No more quote to send, continue to ... */
 1922|  1.70k|    switch(instate) {
 1923|  1.39k|    case FTP_QUOTE:
  ------------------
  |  Branch (1923:5): [True: 1.39k, False: 305]
  ------------------
 1924|  1.39k|    default:
  ------------------
  |  Branch (1924:5): [True: 0, False: 1.70k]
  ------------------
 1925|  1.39k|      result = ftp_state_cwd(data, ftpc, ftp);
 1926|  1.39k|      break;
 1927|    270|    case FTP_RETR_PREQUOTE:
  ------------------
  |  Branch (1927:5): [True: 270, False: 1.43k]
  ------------------
 1928|    270|      if(ftp->transfer != PPTRANSFER_BODY)
  ------------------
  |  Branch (1928:10): [True: 100, False: 170]
  ------------------
 1929|    100|        ftp_state(data, ftpc, FTP_STOP);
  ------------------
  |  |  159|    100|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 1930|    170|      else {
 1931|    170|        if(ftpc->known_filesize != -1) {
  ------------------
  |  Branch (1931:12): [True: 0, False: 170]
  ------------------
 1932|      0|          Curl_pgrsSetDownloadSize(data, ftpc->known_filesize);
 1933|      0|          result = ftp_state_retr(data, ftpc, ftp, ftpc->known_filesize);
 1934|      0|        }
 1935|    170|        else {
 1936|    170|          if(data->set.ignorecl || data->state.prefer_ascii) {
  ------------------
  |  Branch (1936:14): [True: 1, False: 169]
  |  Branch (1936:36): [True: 3, False: 166]
  ------------------
 1937|       |            /* 'ignorecl' is used to support download of growing files. It
 1938|       |               prevents the state machine from requesting the file size from
 1939|       |               the server. With an unknown file size the download continues
 1940|       |               until the server terminates it, otherwise the client stops if
 1941|       |               the received byte count exceeds the reported file size. Set
 1942|       |               option CURLOPT_IGNORE_CONTENT_LENGTH to 1 to enable this
 1943|       |               behavior.
 1944|       |
 1945|       |               In addition: asking for the size for 'TYPE A' transfers is not
 1946|       |               constructive since servers do not report the converted size.
 1947|       |               Thus, skip it.
 1948|       |            */
 1949|      4|            result = Curl_pp_sendf(data, &ftpc->pp, "RETR %s", ftpc->file);
 1950|      4|            if(!result)
  ------------------
  |  Branch (1950:16): [True: 4, False: 0]
  ------------------
 1951|      4|              ftp_state(data, ftpc, FTP_RETR);
  ------------------
  |  |  159|      4|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 1952|      4|          }
 1953|    166|          else {
 1954|    166|            result = Curl_pp_sendf(data, &ftpc->pp, "SIZE %s", ftpc->file);
 1955|    166|            if(!result)
  ------------------
  |  Branch (1955:16): [True: 166, False: 0]
  ------------------
 1956|    166|              ftp_state(data, ftpc, FTP_RETR_SIZE);
  ------------------
  |  |  159|    166|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 1957|    166|          }
 1958|    170|        }
 1959|    170|      }
 1960|    270|      break;
 1961|     35|    case FTP_STOR_PREQUOTE:
  ------------------
  |  Branch (1961:5): [True: 35, False: 1.66k]
  ------------------
 1962|     35|      result = ftp_state_ul_setup(data, ftpc, ftp, FALSE);
  ------------------
  |  | 1058|     35|#define FALSE false
  ------------------
 1963|     35|      break;
 1964|      0|    case FTP_POSTQUOTE:
  ------------------
  |  Branch (1964:5): [True: 0, False: 1.70k]
  ------------------
 1965|      0|      break;
 1966|      0|    case FTP_LIST_PREQUOTE:
  ------------------
  |  Branch (1966:5): [True: 0, False: 1.70k]
  ------------------
 1967|      0|      ftp_state(data, ftpc, FTP_LIST_TYPE);
  ------------------
  |  |  159|      0|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 1968|      0|      result = ftp_state_list(data, ftpc, ftp);
 1969|      0|      break;
 1970|  1.70k|    }
 1971|  1.70k|  }
 1972|       |
 1973|  1.70k|  return result;
 1974|  1.70k|}
ftp.c:ftp_state_low:
  141|  12.7k|{
  142|  12.7k|  if(ftpc->state != newstate) {
  ------------------
  |  Branch (142:6): [True: 11.6k, False: 1.06k]
  ------------------
  143|  11.6k|#ifdef DEBUGBUILD
  144|  11.6k|    NOVERBOSE((void)lineno);
  ------------------
  |  | 1619|  11.6k|#define NOVERBOSE(x) Curl_nop_stmt
  |  |  ------------------
  |  |  |  | 1180|  11.6k|#define Curl_nop_stmt do {} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1180:35): [Folded, False: 11.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|  11.6k|    CURL_TRC_FTP(data, "[%s] -> [%s] (line %d)", FTP_CSTATE(ftpc),
  ------------------
  |  |  180|  11.6k|  do {                                                   \
  |  |  181|  11.6k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|  11.6k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  23.3k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 11.6k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 11.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  23.3k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  11.6k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|  11.6k|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (182:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  183|  11.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 11.6k]
  |  |  ------------------
  ------------------
  146|  11.6k|                 ftp_state_names[newstate], lineno);
  147|       |#else
  148|       |    CURL_TRC_FTP(data, "[%s] -> [%s]", FTP_CSTATE(ftpc),
  149|       |                 ftp_state_names[newstate]);
  150|       |#endif
  151|  11.6k|  }
  152|  12.7k|  ftpc->state = newstate;
  153|  12.7k|}
ftp.c:ftp_state_cwd:
  828|  1.39k|{
  829|  1.39k|  CURLcode result = CURLE_OK;
  830|       |
  831|  1.39k|  if(ftpc->cwddone)
  ------------------
  |  Branch (831:6): [True: 1.13k, False: 267]
  ------------------
  832|       |    /* already done and fine */
  833|  1.13k|    result = ftp_state_mdtm(data, ftpc, ftp);
  834|    267|  else {
  835|       |    /* FTPFILE_NOCWD with full path: expect ftpc->cwddone! */
  836|    267|    DEBUGASSERT((data->set.ftp_filemethod != FTPFILE_NOCWD) ||
  ------------------
  |  | 1081|    267|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (836:5): [True: 0, False: 0]
  |  Branch (836:5): [True: 0, False: 0]
  |  Branch (836:5): [True: 267, False: 0]
  |  Branch (836:5): [True: 0, False: 0]
  |  Branch (836:5): [True: 0, False: 0]
  |  Branch (836:5): [True: 267, False: 0]
  ------------------
  837|    267|                !(ftpc->dirdepth && ftpc->rawpath[0] == '/'));
  838|       |
  839|    267|    ftpc->count2 = 0; /* count2 counts failed CWDs */
  840|       |
  841|    267|    if(data->conn->bits.reuse && ftpc->entrypath &&
  ------------------
  |  Branch (841:8): [True: 3, False: 264]
  |  Branch (841:34): [True: 0, False: 3]
  ------------------
  842|       |       /* no need to go to entrypath when we have an absolute path */
  843|      0|       !(ftpc->dirdepth && ftpc->rawpath[0] == '/')) {
  ------------------
  |  Branch (843:10): [True: 0, False: 0]
  |  Branch (843:28): [True: 0, False: 0]
  ------------------
  844|       |      /* This is a reused connection. Since we change directory to where the
  845|       |         transfer is taking place, we must first get back to the original dir
  846|       |         where we ended up after login: */
  847|      0|      ftpc->cwdcount = 0; /* we count this as the first path, then we add one
  848|       |                             for all upcoming ones in the ftp->dirs[] array */
  849|      0|      result = Curl_pp_sendf(data, &ftpc->pp, "CWD %s", ftpc->entrypath);
  850|      0|      if(!result)
  ------------------
  |  Branch (850:10): [True: 0, False: 0]
  ------------------
  851|      0|        ftp_state(data, ftpc, FTP_CWD);
  ------------------
  |  |  159|      0|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
  852|      0|    }
  853|    267|    else {
  854|    267|      if(ftpc->dirdepth) {
  ------------------
  |  Branch (854:10): [True: 267, False: 0]
  ------------------
  855|    267|        ftpc->cwdcount = 1;
  856|       |        /* issue the first CWD, the rest is sent when the CWD responses are
  857|       |           received... */
  858|    267|        result = Curl_pp_sendf(data, &ftpc->pp, "CWD %.*s",
  859|    267|                               pathlen(ftpc, 0), pathpiece(ftpc, 0));
  860|    267|        if(!result)
  ------------------
  |  Branch (860:12): [True: 267, False: 0]
  ------------------
  861|    267|          ftp_state(data, ftpc, FTP_CWD);
  ------------------
  |  |  159|    267|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
  862|    267|      }
  863|      0|      else {
  864|       |        /* No CWD necessary */
  865|      0|        result = ftp_state_mdtm(data, ftpc, ftp);
  866|      0|      }
  867|    267|    }
  868|    267|  }
  869|  1.39k|  return result;
  870|  1.39k|}
ftp.c:ftp_state_mdtm:
 1657|  1.34k|{
 1658|  1.34k|  CURLcode result = CURLE_OK;
 1659|       |
 1660|       |  /* Requested time of file or time-depended transfer? */
 1661|  1.34k|  if((data->set.get_filetime || data->set.timecondition) && ftpc->file) {
  ------------------
  |  Branch (1661:7): [True: 9, False: 1.33k]
  |  Branch (1661:33): [True: 53, False: 1.28k]
  |  Branch (1661:61): [True: 60, False: 2]
  ------------------
 1662|       |
 1663|       |    /* we have requested to get the modified-time of the file, this is a white
 1664|       |       spot as the MDTM is not mentioned in RFC959 */
 1665|     60|    result = Curl_pp_sendf(data, &ftpc->pp, "MDTM %s", ftpc->file);
 1666|       |
 1667|     60|    if(!result)
  ------------------
  |  Branch (1667:8): [True: 60, False: 0]
  ------------------
 1668|     60|      ftp_state(data, ftpc, FTP_MDTM);
  ------------------
  |  |  159|     60|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 1669|     60|  }
 1670|  1.28k|  else
 1671|  1.28k|    result = ftp_state_type(data, ftpc, ftp);
 1672|       |
 1673|  1.34k|  return result;
 1674|  1.34k|}
ftp.c:ftp_state_type:
 1624|  1.34k|{
 1625|  1.34k|  CURLcode result = CURLE_OK;
 1626|       |
 1627|       |  /* If we have selected NOBODY and HEADER, it means that we only want file
 1628|       |     information. Which in FTP cannot be much more than the file size and
 1629|       |     date. */
 1630|  1.34k|  if(data->req.no_body && ftpc->file &&
  ------------------
  |  Branch (1630:6): [True: 142, False: 1.20k]
  |  Branch (1630:27): [True: 48, False: 94]
  ------------------
 1631|     48|     ftp_need_type(ftpc, (bool)data->state.prefer_ascii)) {
  ------------------
  |  Branch (1631:6): [True: 48, False: 0]
  ------------------
 1632|       |    /* The SIZE command is _not_ RFC 959 specified, and therefore many servers
 1633|       |       may not support it! It is however the only way we have to get a file's
 1634|       |       size! */
 1635|       |
 1636|     48|    ftp->transfer = PPTRANSFER_INFO;
 1637|       |    /* this means no actual transfer will be made */
 1638|       |
 1639|       |    /* Some servers return different sizes for different modes, and thus we
 1640|       |       must set the proper type before we check the size */
 1641|     48|    result = ftp_nb_type(data, ftpc, ftp, (bool)data->state.prefer_ascii,
 1642|     48|                         FTP_TYPE);
 1643|     48|    if(result)
  ------------------
  |  Branch (1643:8): [True: 0, False: 48]
  ------------------
 1644|      0|      return result;
 1645|     48|  }
 1646|  1.29k|  else
 1647|  1.29k|    result = ftp_state_size(data, ftpc, ftp);
 1648|       |
 1649|  1.34k|  return result;
 1650|  1.34k|}
ftp.c:ftp_need_type:
  349|     48|{
  350|     48|  return ftpc->transfertype != (ascii_wanted ? 'A' : 'I');
  ------------------
  |  Branch (350:33): [True: 0, False: 48]
  ------------------
  351|     48|}
ftp.c:ftp_nb_type:
 3855|    937|{
 3856|    937|  CURLcode result;
 3857|    937|  char want = (char)(ascii ? 'A' : 'I');
  ------------------
  |  Branch (3857:22): [True: 673, False: 264]
  ------------------
 3858|       |
 3859|    937|  if(ftpc->transfertype == want) {
  ------------------
  |  Branch (3859:6): [True: 0, False: 937]
  ------------------
 3860|      0|    ftp_state(data, ftpc, newstate);
  ------------------
  |  |  159|      0|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 3861|      0|    return ftp_state_type_resp(data, ftpc, ftp, 200, newstate);
 3862|      0|  }
 3863|       |
 3864|    937|  result = Curl_pp_sendf(data, &ftpc->pp, "TYPE %c", want);
 3865|    937|  if(!result) {
  ------------------
  |  Branch (3865:6): [True: 937, False: 0]
  ------------------
 3866|    937|    ftp_state(data, ftpc, newstate);
  ------------------
  |  |  159|    937|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 3867|       |
 3868|       |    /* keep track of our current transfer type */
 3869|    937|    ftpc->transfertype = want;
 3870|    937|  }
 3871|    937|  return result;
 3872|    937|}
ftp.c:ftp_state_type_resp:
 2626|    924|{
 2627|    924|  CURLcode result = CURLE_OK;
 2628|       |
 2629|    924|  if(ftpcode / 100 != 2) {
  ------------------
  |  Branch (2629:6): [True: 74, False: 850]
  ------------------
 2630|       |    /* "sasserftpd" and "(u)r(x)bot ftpd" both responds with 226 after a
 2631|       |       successful 'TYPE I'. While that is not as RFC959 says, it is still a
 2632|       |       positive response code and we allow that. */
 2633|     74|    failf(data, "Could not set desired mode");
  ------------------
  |  |   62|     74|#define failf Curl_failf
  ------------------
 2634|     74|    return CURLE_FTP_COULDNT_SET_TYPE;
 2635|     74|  }
 2636|    850|  if(ftpcode != 200)
  ------------------
  |  Branch (2636:6): [True: 793, False: 57]
  ------------------
 2637|    793|    infof(data, "Got a %03d response code instead of the assumed 200",
  ------------------
  |  |  143|    793|  do {                               \
  |  |  144|    793|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    793|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 793, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 793]
  |  |  |  |  ------------------
  |  |  |  |  320|    793|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    793|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    793|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 793]
  |  |  ------------------
  ------------------
 2638|    850|          ftpcode);
 2639|       |
 2640|    850|  if(instate == FTP_TYPE)
  ------------------
  |  Branch (2640:6): [True: 46, False: 804]
  ------------------
 2641|     46|    result = ftp_state_size(data, ftpc, ftp);
 2642|    804|  else if(instate == FTP_LIST_TYPE)
  ------------------
  |  Branch (2642:11): [True: 599, False: 205]
  ------------------
 2643|    599|    result = ftp_state_list(data, ftpc, ftp);
 2644|    205|  else if(instate == FTP_RETR_TYPE)
  ------------------
  |  Branch (2644:11): [True: 170, False: 35]
  ------------------
 2645|    170|    result = ftp_state_retr_prequote(data, ftpc, ftp);
 2646|     35|  else if(instate == FTP_STOR_TYPE)
  ------------------
  |  Branch (2646:11): [True: 35, False: 0]
  ------------------
 2647|     35|    result = ftp_state_stor_prequote(data, ftpc, ftp);
 2648|      0|  else if(instate == FTP_RETR_LIST_TYPE)
  ------------------
  |  Branch (2648:11): [True: 0, False: 0]
  ------------------
 2649|      0|    result = ftp_state_list_prequote(data, ftpc, ftp);
 2650|       |
 2651|    850|  return result;
 2652|    924|}
ftp.c:ftp_state_retr_prequote:
 1608|    170|{
 1609|       |  /* We have sent the TYPE, now we must send the list of prequote strings */
 1610|       |  return ftp_state_quote(data, ftpc, ftp, TRUE, FTP_RETR_PREQUOTE);
  ------------------
  |  | 1055|    170|#define TRUE true
  ------------------
 1611|    170|}
ftp.c:ftp_state_stor_prequote:
 1616|     35|{
 1617|       |  /* We have sent the TYPE, now we must send the list of prequote strings */
 1618|       |  return ftp_state_quote(data, ftpc, ftp, TRUE, FTP_STOR_PREQUOTE);
  ------------------
  |  | 1055|     35|#define TRUE true
  ------------------
 1619|     35|}
ftp.c:ftp_state_size:
 1522|  1.34k|{
 1523|  1.34k|  CURLcode result = CURLE_OK;
 1524|       |
 1525|  1.34k|  if((ftp->transfer == PPTRANSFER_INFO) && ftpc->file) {
  ------------------
  |  Branch (1525:6): [True: 140, False: 1.20k]
  |  Branch (1525:44): [True: 46, False: 94]
  ------------------
 1526|       |    /* if a "head"-like request is being made (on a file) */
 1527|       |
 1528|       |    /* we know ftpc->file is a valid pointer to a filename */
 1529|     46|    result = Curl_pp_sendf(data, &ftpc->pp, "SIZE %s", ftpc->file);
 1530|     46|    if(!result)
  ------------------
  |  Branch (1530:8): [True: 46, False: 0]
  ------------------
 1531|     46|      ftp_state(data, ftpc, FTP_SIZE);
  ------------------
  |  |  159|     46|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 1532|     46|  }
 1533|  1.29k|  else
 1534|  1.29k|    result = ftp_state_rest(data, ftpc, ftp);
 1535|       |
 1536|  1.34k|  return result;
 1537|  1.34k|}
ftp.c:ftp_state_rest:
 1501|  1.34k|{
 1502|  1.34k|  CURLcode result = CURLE_OK;
 1503|       |
 1504|  1.34k|  if((ftp->transfer != PPTRANSFER_BODY) && ftpc->file) {
  ------------------
  |  Branch (1504:6): [True: 138, False: 1.20k]
  |  Branch (1504:44): [True: 44, False: 94]
  ------------------
 1505|       |    /* if a "head"-like request is being made (on a file) */
 1506|       |
 1507|       |    /* Determine if server can respond to REST command and therefore
 1508|       |       whether it supports range */
 1509|     44|    result = Curl_pp_sendf(data, &ftpc->pp, "REST %d", 0);
 1510|     44|    if(!result)
  ------------------
  |  Branch (1510:8): [True: 44, False: 0]
  ------------------
 1511|     44|      ftp_state(data, ftpc, FTP_REST);
  ------------------
  |  |  159|     44|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 1512|     44|  }
 1513|  1.29k|  else
 1514|  1.29k|    result = ftp_state_prepare_transfer(data, ftpc, ftp);
 1515|       |
 1516|  1.34k|  return result;
 1517|  1.34k|}
ftp.c:ftp_state_prepare_transfer:
 1460|  1.30k|{
 1461|  1.30k|  CURLcode result = CURLE_OK;
 1462|  1.30k|  struct connectdata *conn = data->conn;
 1463|       |
 1464|  1.30k|  if(ftp->transfer != PPTRANSFER_BODY) {
  ------------------
  |  Branch (1464:6): [True: 100, False: 1.20k]
  ------------------
 1465|       |    /* does not transfer any data */
 1466|       |
 1467|       |    /* still possibly do PRE QUOTE jobs */
 1468|    100|    ftp_state(data, ftpc, FTP_RETR_PREQUOTE);
  ------------------
  |  |  159|    100|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 1469|    100|    result = ftp_state_quote(data, ftpc, ftp, TRUE, FTP_RETR_PREQUOTE);
  ------------------
  |  | 1055|    100|#define TRUE true
  ------------------
 1470|    100|  }
 1471|  1.20k|  else if(data->set.ftp_use_port) {
  ------------------
  |  Branch (1471:11): [True: 16, False: 1.18k]
  ------------------
 1472|       |    /* We have chosen to use the PORT (or similar) command */
 1473|     16|    result = ftp_state_use_port(data, ftpc, EPRT);
 1474|     16|  }
 1475|  1.18k|  else {
 1476|       |    /* We have chosen (this is default) to use the PASV (or similar) command */
 1477|  1.18k|    if(data->set.ftp_use_pret) {
  ------------------
  |  Branch (1477:8): [True: 5, False: 1.18k]
  ------------------
 1478|       |      /* The user has requested that we send a PRET command
 1479|       |         to prepare the server for the upcoming PASV */
 1480|      5|      if(!ftpc->file)
  ------------------
  |  Branch (1480:10): [True: 1, False: 4]
  ------------------
 1481|      1|        result = Curl_pp_sendf(data, &ftpc->pp, "PRET %s",
 1482|      1|                               data->set.str[STRING_CUSTOMREQUEST] ?
  ------------------
  |  Branch (1482:32): [True: 0, False: 1]
  ------------------
 1483|      0|                               data->set.str[STRING_CUSTOMREQUEST] :
 1484|      1|                               (data->state.list_only ? "NLST" : "LIST"));
  ------------------
  |  Branch (1484:33): [True: 0, False: 1]
  ------------------
 1485|      4|      else if(data->state.upload)
  ------------------
  |  Branch (1485:15): [True: 1, False: 3]
  ------------------
 1486|      1|        result = Curl_pp_sendf(data, &ftpc->pp, "PRET STOR %s", ftpc->file);
 1487|      3|      else
 1488|      3|        result = Curl_pp_sendf(data, &ftpc->pp, "PRET RETR %s", ftpc->file);
 1489|      5|      if(!result)
  ------------------
  |  Branch (1489:10): [True: 5, False: 0]
  ------------------
 1490|      5|        ftp_state(data, ftpc, FTP_PRET);
  ------------------
  |  |  159|      5|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 1491|      5|    }
 1492|  1.18k|    else
 1493|  1.18k|      result = ftp_state_use_pasv(data, ftpc, conn);
 1494|  1.18k|  }
 1495|  1.30k|  return result;
 1496|  1.30k|}
ftp.c:ftp_state_use_port:
 1329|     16|{
 1330|     16|  CURLcode result = CURLE_FTP_PORT_FAILED;
 1331|     16|  struct connectdata *conn = data->conn;
 1332|     16|  curl_socket_t portsock = CURL_SOCKET_BAD;
  ------------------
  |  |  145|     16|#define CURL_SOCKET_BAD (-1)
  ------------------
 1333|       |
 1334|     16|  struct Curl_sockaddr_storage ss;
 1335|     16|  curl_socklen_t sslen;
 1336|     16|  char hbuf[NI_MAXHOST];
 1337|     16|  const char *host = NULL;
 1338|     16|  const char *string_ftpport = data->set.str[STRING_FTPPORT];
 1339|     16|  struct Curl_dns_entry *dns_entry = NULL;
 1340|     16|  const struct Curl_addrinfo *res = NULL;
 1341|     16|  const struct Curl_addrinfo *ai = NULL;
 1342|     16|  unsigned short port_min = 0;
 1343|     16|  unsigned short port_max = 0;
 1344|     16|  bool non_local = TRUE;
  ------------------
  |  | 1055|     16|#define TRUE true
  ------------------
 1345|       |
 1346|       |  /* parse the FTPPORT string for address and port range */
 1347|     16|  result = ftp_port_parse_string(data, conn, string_ftpport,
 1348|     16|                                 &ss, &port_min, &port_max,
 1349|     16|                                 &host, hbuf, sizeof(hbuf));
 1350|     16|  if(!result && !host)
  ------------------
  |  Branch (1350:6): [True: 15, False: 1]
  |  Branch (1350:17): [True: 4, False: 11]
  ------------------
 1351|       |    /* if no host was specified, use the control connection's local IP */
 1352|      4|    result = ftp_port_default_host(data, conn, &ss, &sslen, &host,
 1353|      4|                                   hbuf, sizeof(hbuf), &non_local);
 1354|       |
 1355|       |  /* resolve host string to address list */
 1356|     16|  if(!result)
  ------------------
  |  Branch (1356:6): [True: 11, False: 5]
  ------------------
 1357|     11|    result = ftp_port_resolve_host(data, conn, host, &dns_entry, &res);
 1358|       |
 1359|       |  /* Open a TCP socket for the data connection */
 1360|     16|  if(!result)
  ------------------
  |  Branch (1360:6): [True: 5, False: 11]
  ------------------
 1361|      5|    result = ftp_port_open_socket(data, conn, res, &ai, &portsock);
 1362|     16|  if(!result) {
  ------------------
  |  Branch (1362:6): [True: 5, False: 11]
  ------------------
 1363|      5|    CURL_TRC_FTP(data, "[%s] ftp_state_use_port(), opened socket",
  ------------------
  |  |  180|      5|  do {                                                   \
  |  |  181|      5|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|      5|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     10|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 5, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     10|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      5|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|      5|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (182:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  183|      5|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 5]
  |  |  ------------------
  ------------------
 1364|      5|                 FTP_CSTATE(ftpc));
 1365|       |
 1366|       |    /* bind to a suitable local address / port */
 1367|      5|    result = ftp_port_bind_socket(data, conn, portsock, ai, &ss, &sslen,
 1368|      5|                                  port_min, port_max, non_local);
 1369|      5|  }
 1370|       |
 1371|       |  /* listen */
 1372|     16|  if(!result)
  ------------------
  |  Branch (1372:6): [True: 0, False: 16]
  ------------------
 1373|      0|    result = ftp_port_listen(data, portsock);
 1374|       |
 1375|       |  /* send the PORT / EPRT command */
 1376|     16|  if(!result)
  ------------------
  |  Branch (1376:6): [True: 0, False: 16]
  ------------------
 1377|      0|    result = ftp_port_send_command(data, ftpc, conn, &ss, ai, fcmd);
 1378|       |
 1379|       |  /* replace any filter on SECONDARY with one listening on this socket */
 1380|     16|  if(!result)
  ------------------
  |  Branch (1380:6): [True: 0, False: 16]
  ------------------
 1381|      0|    result = Curl_conn_tcp_listen_set(data, conn, SECONDARYSOCKET, &portsock);
  ------------------
  |  |  304|      0|#define SECONDARYSOCKET 1
  ------------------
 1382|       |
 1383|     16|  if(!result)
  ------------------
  |  Branch (1383:6): [True: 0, False: 16]
  ------------------
 1384|      0|    portsock = CURL_SOCKET_BAD; /* now held in filter */
  ------------------
  |  |  145|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
 1385|       |
 1386|       |  /* cleanup */
 1387|       |
 1388|     16|  if(dns_entry)
  ------------------
  |  Branch (1388:6): [True: 5, False: 11]
  ------------------
 1389|      5|    Curl_dns_entry_unlink(data, &dns_entry);
 1390|     16|  if(result) {
  ------------------
  |  Branch (1390:6): [True: 16, False: 0]
  ------------------
 1391|     16|    ftp_state(data, ftpc, FTP_STOP);
  ------------------
  |  |  159|     16|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 1392|     16|  }
 1393|      0|  else {
 1394|       |    /* successfully set up the listen socket filter. SSL needed? */
 1395|      0|    if(conn->bits.ftp_use_data_ssl && data->set.ftp_use_port &&
  ------------------
  |  Branch (1395:8): [True: 0, False: 0]
  |  Branch (1395:39): [True: 0, False: 0]
  ------------------
 1396|      0|       !Curl_conn_is_ssl(conn, SECONDARYSOCKET)) {
  ------------------
  |  |  304|      0|#define SECONDARYSOCKET 1
  ------------------
  |  Branch (1396:8): [True: 0, False: 0]
  ------------------
 1397|      0|      result = Curl_ssl_cfilter_add(data, conn, SECONDARYSOCKET);
  ------------------
  |  |  304|      0|#define SECONDARYSOCKET 1
  ------------------
 1398|      0|    }
 1399|      0|    conn->bits.do_more = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1400|      0|    Curl_pgrsTime(data, TIMER_STARTACCEPT);
 1401|      0|    Curl_expire(data, (data->set.accepttimeout > 0) ?
  ------------------
  |  Branch (1401:23): [True: 0, False: 0]
  ------------------
 1402|      0|                data->set.accepttimeout: DEFAULT_ACCEPT_TIMEOUT,
  ------------------
  |  |   42|      0|#define DEFAULT_ACCEPT_TIMEOUT   60000 /* milliseconds == one minute */
  ------------------
 1403|      0|                EXPIRE_FTP_ACCEPT);
 1404|      0|  }
 1405|     16|  if(portsock != CURL_SOCKET_BAD)
  ------------------
  |  |  145|     16|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1405:6): [True: 5, False: 11]
  ------------------
 1406|      5|    Curl_socket_close(data, conn, portsock);
 1407|     16|  return result;
 1408|     16|}
ftp.c:ftp_port_parse_string:
  891|     16|{
  892|     16|  const char *ip_end = NULL;
  893|     16|  const char *addr = NULL;
  894|     16|  size_t addrlen = 0;
  895|     16|  unsigned short port_min = 0;
  896|     16|  unsigned short port_max = 0;
  897|     16|  char ipstr[50];
  898|       |#ifndef USE_IPV6
  899|       |  (void)conn;
  900|       |  (void)ss;
  901|       |#endif
  902|       |
  903|       |  /* default to nothing */
  904|     16|  *hostp = NULL;
  905|     16|  *port_minp = *port_maxp = 0;
  906|       |
  907|     16|  if(!string_ftpport || (strlen(string_ftpport) <= 1))
  ------------------
  |  Branch (907:6): [True: 0, False: 16]
  |  Branch (907:25): [True: 1, False: 15]
  ------------------
  908|      1|    goto done;
  909|       |
  910|     15|#ifdef USE_IPV6
  911|     15|  if(*string_ftpport == '[') {
  ------------------
  |  Branch (911:6): [True: 2, False: 13]
  ------------------
  912|       |    /* [ipv6]:port(-range) */
  913|      2|    const char *ip_start = string_ftpport + 1;
  914|      2|    ip_end = strchr(ip_start, ']');
  915|      2|    if(ip_end) {
  ------------------
  |  Branch (915:8): [True: 1, False: 1]
  ------------------
  916|      1|      addrlen = ip_end - ip_start;
  917|      1|      addr = ip_start;
  918|      1|    }
  919|      2|  }
  920|     13|  else
  921|     13|#endif
  922|     13|    if(*string_ftpport == ':') {
  ------------------
  |  Branch (922:8): [True: 2, False: 11]
  ------------------
  923|       |      /* :port */
  924|      2|      ip_end = string_ftpport;
  925|      2|    }
  926|     11|    else {
  927|     11|      ip_end = strchr(string_ftpport, ':');
  928|     11|      addr = string_ftpport;
  929|     11|      if(ip_end) {
  ------------------
  |  Branch (929:10): [True: 5, False: 6]
  ------------------
  930|      5|#ifdef USE_IPV6
  931|      5|        struct sockaddr_in6 * const sa6 = (void *)ss;
  932|      5|#endif
  933|       |        /* either ipv6 or (ipv4|domain|interface):port(-range) */
  934|      5|        addrlen = ip_end - string_ftpport;
  935|      5|#ifdef USE_IPV6
  936|      5|        if(curlx_inet_pton(AF_INET6, string_ftpport, &sa6->sin6_addr) == 1) {
  ------------------
  |  |   43|      5|  inet_pton(x, y, z)
  ------------------
  |  Branch (936:12): [True: 1, False: 4]
  ------------------
  937|       |          /* ipv6 */
  938|      1|          addrlen = strlen(string_ftpport);
  939|      1|          ip_end = NULL; /* this got no port ! */
  940|      1|        }
  941|      5|#endif
  942|      5|      }
  943|      6|      else
  944|       |        /* ipv4|interface */
  945|      6|        addrlen = strlen(string_ftpport);
  946|     11|    }
  947|       |
  948|       |  /* parse the port */
  949|     15|  if(ip_end) {
  ------------------
  |  Branch (949:6): [True: 7, False: 8]
  ------------------
  950|      7|    const char *portp = strchr(ip_end, ':');
  951|      7|    if(portp) {
  ------------------
  |  Branch (951:8): [True: 6, False: 1]
  ------------------
  952|      6|      curl_off_t start;
  953|      6|      curl_off_t end;
  954|      6|      portp++;
  955|      6|      if(!curlx_str_number(&portp, &start, 0xffff)) {
  ------------------
  |  Branch (955:10): [True: 4, False: 2]
  ------------------
  956|      4|        port_min = (unsigned short)start;
  957|      4|        if(!curlx_str_single(&portp, '-') &&
  ------------------
  |  Branch (957:12): [True: 3, False: 1]
  ------------------
  958|      3|           !curlx_str_number(&portp, &end, 0xffff))
  ------------------
  |  Branch (958:12): [True: 1, False: 2]
  ------------------
  959|      1|          port_max = (unsigned short)end;
  960|      3|        else
  961|      3|          port_max = port_min;
  962|      4|      }
  963|      6|    }
  964|      7|  }
  965|       |
  966|       |  /* correct errors like :1234-1230 or :-4711 */
  967|     15|  if(port_min > port_max)
  ------------------
  |  Branch (967:6): [True: 1, False: 14]
  ------------------
  968|      1|    port_min = port_max = 0;
  969|       |
  970|     15|  if(addrlen) {
  ------------------
  |  Branch (970:6): [True: 12, False: 3]
  ------------------
  971|     12|    const struct Curl_sockaddr_ex *remote_addr =
  972|     12|      Curl_conn_get_remote_addr(data, FIRSTSOCKET);
  ------------------
  |  |  303|     12|#define FIRSTSOCKET     0
  ------------------
  973|       |
  974|     12|    DEBUGASSERT(remote_addr);
  ------------------
  |  | 1081|     12|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (974:5): [True: 0, False: 12]
  |  Branch (974:5): [True: 12, False: 0]
  ------------------
  975|     12|    DEBUGASSERT(addr);
  ------------------
  |  | 1081|     12|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (975:5): [True: 0, False: 12]
  |  Branch (975:5): [True: 12, False: 0]
  ------------------
  976|     12|    if(!remote_addr || (addrlen >= sizeof(ipstr)) || (addrlen >= hbuflen))
  ------------------
  |  Branch (976:8): [True: 0, False: 12]
  |  Branch (976:24): [True: 1, False: 11]
  |  Branch (976:54): [True: 0, False: 11]
  ------------------
  977|      1|      return CURLE_FTP_PORT_FAILED;
  978|     11|    memcpy(ipstr, addr, addrlen);
  979|     11|    ipstr[addrlen] = 0;
  980|       |
  981|       |    /* attempt to get the address of the given interface name */
  982|     11|    switch(Curl_if2ip(remote_addr->family,
  ------------------
  |  Branch (982:12): [True: 11, False: 0]
  ------------------
  983|     11|#ifdef USE_IPV6
  984|     11|                      Curl_ipv6_scope(&remote_addr->curl_sa_addr),
  ------------------
  |  |   54|     11|#define curl_sa_addr    addr.sa
  ------------------
  985|     11|                      conn->scope_id,
  986|     11|#endif
  987|     11|                      ipstr, hbuf, hbuflen)) {
  988|     10|    case IF2IP_NOT_FOUND:
  ------------------
  |  Branch (988:5): [True: 10, False: 1]
  ------------------
  989|       |      /* not an interface, use the string as hostname instead */
  990|     10|      memcpy(hbuf, addr, addrlen);
  991|     10|      hbuf[addrlen] = 0;
  992|     10|      *hostp = hbuf;
  993|     10|      break;
  994|      0|    case IF2IP_AF_NOT_SUPPORTED:
  ------------------
  |  Branch (994:5): [True: 0, False: 11]
  ------------------
  995|      0|      return CURLE_FTP_PORT_FAILED;
  996|      1|    case IF2IP_FOUND:
  ------------------
  |  Branch (996:5): [True: 1, False: 10]
  ------------------
  997|      1|      *hostp = hbuf; /* use the hbuf for hostname */
  998|      1|      break;
  999|     11|    }
 1000|     11|  }
 1001|       |  /* else: only a port(-range) given, leave host as NULL */
 1002|       |
 1003|     15|done:
 1004|     15|  *port_minp = port_min;
 1005|     15|  *port_maxp = port_max;
 1006|     15|  return CURLE_OK;
 1007|     15|}
ftp.c:ftp_port_default_host:
 1020|      4|{
 1021|      4|  struct sockaddr *sa = (struct sockaddr *)ss;
 1022|      4|  struct sockaddr_in * const sa4 = (void *)sa;
 1023|      4|#ifdef USE_IPV6
 1024|      4|  struct sockaddr_in6 * const sa6 = (void *)sa;
 1025|      4|#endif
 1026|      4|  char buffer[STRERROR_LEN];
 1027|      4|  const char *r;
 1028|       |
 1029|      4|  *sslenp = sizeof(*ss);
 1030|      4|  if(getsockname(conn->sock[FIRSTSOCKET], sa, sslenp)) {
  ------------------
  |  |  303|      4|#define FIRSTSOCKET     0
  ------------------
  |  Branch (1030:6): [True: 0, False: 4]
  ------------------
 1031|      0|    failf(data, "getsockname() failed: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1032|      0|          curlx_strerror(SOCKERRNO, buffer, sizeof(buffer)));
  ------------------
  |  | 1095|      0|#define SOCKERRNO         errno
  ------------------
 1033|      0|    return CURLE_FTP_PORT_FAILED;
 1034|      0|  }
 1035|      4|  switch(sa->sa_family) {
 1036|      0|#ifdef USE_IPV6
 1037|      0|  case AF_INET6:
  ------------------
  |  Branch (1037:3): [True: 0, False: 4]
  ------------------
 1038|      0|    r = curlx_inet_ntop(sa->sa_family, &sa6->sin6_addr, hbuf, hbuflen);
  ------------------
  |  |   44|      0|  inet_ntop(af, src, buf, (curl_socklen_t)(size))
  ------------------
 1039|      0|    break;
 1040|      0|#endif
 1041|      4|  default:
  ------------------
  |  Branch (1041:3): [True: 4, False: 0]
  ------------------
 1042|      4|    r = curlx_inet_ntop(sa->sa_family, &sa4->sin_addr, hbuf, hbuflen);
  ------------------
  |  |   44|      4|  inet_ntop(af, src, buf, (curl_socklen_t)(size))
  ------------------
 1043|      4|    break;
 1044|      4|  }
 1045|      4|  if(!r)
  ------------------
  |  Branch (1045:6): [True: 4, False: 0]
  ------------------
 1046|      4|    return CURLE_FTP_PORT_FAILED;
 1047|       |
 1048|      0|  *hostp = hbuf;
 1049|       |  *non_localp = FALSE; /* we know it is local now */
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1050|      0|  return CURLE_OK;
 1051|      4|}
ftp.c:ftp_port_resolve_host:
 1061|     11|{
 1062|     11|  CURLcode result;
 1063|       |
 1064|     11|  *resp = NULL;
 1065|     11|  result = Curl_resolv_blocking(
 1066|     11|    data, Curl_resolv_dns_queries(data, conn->ip_version),
 1067|     11|    host, 0, Curl_conn_get_transport(data, conn), dns_entryp);
 1068|     11|  if(result)
  ------------------
  |  Branch (1068:6): [True: 6, False: 5]
  ------------------
 1069|      6|    failf(data, "failed to resolve the address provided to PORT: %s", host);
  ------------------
  |  |   62|      6|#define failf Curl_failf
  ------------------
 1070|      5|  else {
 1071|      5|    DEBUGASSERT(*dns_entryp);
  ------------------
  |  | 1081|      5|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1071:5): [True: 0, False: 5]
  |  Branch (1071:5): [True: 5, False: 0]
  ------------------
 1072|      5|    *resp = (*dns_entryp)->addr;
 1073|      5|  }
 1074|     11|  return result;
 1075|     11|}
ftp.c:ftp_port_open_socket:
 1085|      5|{
 1086|      5|  char buffer[STRERROR_LEN];
 1087|      5|  int error = 0;
 1088|      5|  const struct Curl_addrinfo *ai;
 1089|      5|  CURLcode result = CURLE_FTP_PORT_FAILED;
 1090|       |
 1091|      5|  for(ai = res; ai; ai = ai->ai_next) {
  ------------------
  |  Branch (1091:17): [True: 5, False: 0]
  ------------------
 1092|      5|    result =
 1093|      5|      Curl_socket_open(data, ai, NULL,
 1094|      5|                       Curl_conn_get_transport(data, conn), portsockp);
 1095|      5|    if(result) {
  ------------------
  |  Branch (1095:8): [True: 0, False: 5]
  ------------------
 1096|      0|      if(result == CURLE_OUT_OF_MEMORY)
  ------------------
  |  Branch (1096:10): [True: 0, False: 0]
  ------------------
 1097|      0|        return result;
 1098|      0|      result = CURLE_FTP_PORT_FAILED;
 1099|      0|      error = SOCKERRNO;
  ------------------
  |  | 1095|      0|#define SOCKERRNO         errno
  ------------------
 1100|      0|      continue;
 1101|      0|    }
 1102|      5|    break;
 1103|      5|  }
 1104|      5|  if(!ai) {
  ------------------
  |  Branch (1104:6): [True: 0, False: 5]
  ------------------
 1105|      0|    failf(data, "socket failure: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1106|      0|          curlx_strerror(error, buffer, sizeof(buffer)));
 1107|      0|    return CURLE_FTP_PORT_FAILED;
 1108|      0|  }
 1109|      5|  *aip = ai;
 1110|      5|  return result;
 1111|      5|}
ftp.c:ftp_port_bind_socket:
 1127|      5|{
 1128|      5|  struct sockaddr *sa = (struct sockaddr *)ss;
 1129|      5|  struct sockaddr_in * const sa4 = (void *)sa;
 1130|      5|#ifdef USE_IPV6
 1131|      5|  struct sockaddr_in6 * const sa6 = (void *)sa;
 1132|      5|#endif
 1133|      5|  char buffer[STRERROR_LEN];
 1134|      5|  unsigned short port;
 1135|      5|  int error;
 1136|       |
 1137|      5|  memcpy(sa, ai->ai_addr, ai->ai_addrlen);
 1138|      5|  *sslen_io = ai->ai_addrlen;
 1139|       |
 1140|      5|  for(port = port_min; port <= port_max;) {
  ------------------
  |  Branch (1140:24): [True: 5, False: 0]
  ------------------
 1141|      5|    if(sa->sa_family == AF_INET)
  ------------------
  |  Branch (1141:8): [True: 4, False: 1]
  ------------------
 1142|      4|      sa4->sin_port = htons(port);
 1143|      1|#ifdef USE_IPV6
 1144|      1|    else
 1145|      1|      sa6->sin6_port = htons(port);
 1146|      5|#endif
 1147|      5|    if(bind(portsock, sa, *sslen_io)) {
  ------------------
  |  Branch (1147:8): [True: 5, False: 0]
  ------------------
 1148|      5|      error = SOCKERRNO;
  ------------------
  |  | 1095|      5|#define SOCKERRNO         errno
  ------------------
 1149|      5|      if(non_local && (error == SOCKEADDRNOTAVAIL)) {
  ------------------
  |  | 1123|      5|#define SOCKEADDRNOTAVAIL EADDRNOTAVAIL
  ------------------
  |  Branch (1149:10): [True: 5, False: 0]
  |  Branch (1149:23): [True: 0, False: 5]
  ------------------
 1150|       |        /* The requested bind address is not local. Use the address used for
 1151|       |         * the control connection instead and restart the port loop.
 1152|       |         */
 1153|      0|        infof(data, "bind(port=%hu) on non-local address failed: %s", port,
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1154|      0|              curlx_strerror(error, buffer, sizeof(buffer)));
 1155|       |
 1156|      0|        *sslen_io = sizeof(*ss);
 1157|      0|        if(getsockname(conn->sock[FIRSTSOCKET], sa, sslen_io)) {
  ------------------
  |  |  303|      0|#define FIRSTSOCKET     0
  ------------------
  |  Branch (1157:12): [True: 0, False: 0]
  ------------------
 1158|      0|          failf(data, "getsockname() failed: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1159|      0|                curlx_strerror(SOCKERRNO, buffer, sizeof(buffer)));
  ------------------
  |  | 1095|      0|#define SOCKERRNO         errno
  ------------------
 1160|      0|          return CURLE_FTP_PORT_FAILED;
 1161|      0|        }
 1162|      0|        port = port_min;
 1163|      0|        non_local = FALSE; /* do not try this again */
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1164|      0|        continue;
 1165|      0|      }
 1166|      5|      if(error != SOCKEADDRINUSE && error != SOCKEACCES) {
  ------------------
  |  | 1122|     10|#define SOCKEADDRINUSE    EADDRINUSE
  ------------------
                    if(error != SOCKEADDRINUSE && error != SOCKEACCES) {
  ------------------
  |  | 1121|      5|#define SOCKEACCES        EACCES
  ------------------
  |  Branch (1166:10): [True: 5, False: 0]
  |  Branch (1166:37): [True: 5, False: 0]
  ------------------
 1167|      5|        failf(data, "bind(port=%hu) failed: %s", port,
  ------------------
  |  |   62|      5|#define failf Curl_failf
  ------------------
 1168|      5|              curlx_strerror(error, buffer, sizeof(buffer)));
 1169|      5|        return CURLE_FTP_PORT_FAILED;
 1170|      5|      }
 1171|      5|    }
 1172|      0|    else
 1173|      0|      break;
 1174|       |
 1175|       |    /* check if port is the maximum value here, because it might be 0xffff
 1176|       |       and then the increment below will wrap the 16-bit counter */
 1177|      0|    if(port == port_max) {
  ------------------
  |  Branch (1177:8): [True: 0, False: 0]
  ------------------
 1178|      0|      failf(data, "bind() failed, ran out of ports");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1179|      0|      return CURLE_FTP_PORT_FAILED;
 1180|      0|    }
 1181|      0|    port++;
 1182|      0|  }
 1183|       |
 1184|       |  /* re-read the name so we can extract the actual port chosen */
 1185|      0|  *sslen_io = sizeof(*ss);
 1186|      0|  if(getsockname(portsock, sa, sslen_io)) {
  ------------------
  |  Branch (1186:6): [True: 0, False: 0]
  ------------------
 1187|      0|    failf(data, "getsockname() failed: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1188|      0|          curlx_strerror(SOCKERRNO, buffer, sizeof(buffer)));
  ------------------
  |  | 1095|      0|#define SOCKERRNO         errno
  ------------------
 1189|      0|    return CURLE_FTP_PORT_FAILED;
 1190|      0|  }
 1191|      0|  CURL_TRC_FTP(data, "ftp_port_bind_socket(), socket bound to port %d", port);
  ------------------
  |  |  180|      0|  do {                                                   \
  |  |  181|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|      0|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  183|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1192|      0|  return CURLE_OK;
 1193|      0|}
ftp.c:ftp_state_use_pasv:
 1413|  1.18k|{
 1414|  1.18k|  CURLcode result = CURLE_OK;
 1415|       |  /*
 1416|       |    Here's the executive summary on what to do:
 1417|       |
 1418|       |    PASV is RFC959, expect:
 1419|       |    227 Entering Passive Mode (a1,a2,a3,a4,p1,p2)
 1420|       |
 1421|       |    LPSV is RFC1639, expect:
 1422|       |    228 Entering Long Passive Mode (4,4,a1,a2,a3,a4,2,p1,p2)
 1423|       |
 1424|       |    EPSV is RFC2428, expect:
 1425|       |    229 Entering Extended Passive Mode (|||port|)
 1426|       |
 1427|       |  */
 1428|       |
 1429|  1.18k|  static const char mode[][5] = { "EPSV", "PASV" };
 1430|  1.18k|  int modeoff;
 1431|       |
 1432|  1.18k|#ifdef PF_INET6
 1433|  1.18k|  if(!conn->bits.ftp_use_epsv && conn->bits.ipv6)
  ------------------
  |  Branch (1433:6): [True: 4, False: 1.17k]
  |  Branch (1433:34): [True: 0, False: 4]
  ------------------
 1434|       |    /* EPSV is disabled but we are connected to an IPv6 host, so we ignore the
 1435|       |       request and enable EPSV again! */
 1436|      0|    conn->bits.ftp_use_epsv = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1437|  1.18k|#endif
 1438|       |
 1439|  1.18k|  modeoff = conn->bits.ftp_use_epsv ? 0 : 1;
  ------------------
  |  Branch (1439:13): [True: 1.17k, False: 4]
  ------------------
 1440|       |
 1441|  1.18k|  result = Curl_pp_sendf(data, &ftpc->pp, "%s", mode[modeoff]);
 1442|  1.18k|  if(!result) {
  ------------------
  |  Branch (1442:6): [True: 1.18k, False: 0]
  ------------------
 1443|  1.18k|    ftpc->count1 = modeoff;
 1444|  1.18k|    ftp_state(data, ftpc, FTP_PASV);
  ------------------
  |  |  159|  1.18k|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 1445|  1.18k|    infof(data, "Connect data stream passively");
  ------------------
  |  |  143|  1.18k|  do {                               \
  |  |  144|  1.18k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  1.18k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 1.18k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.18k]
  |  |  |  |  ------------------
  |  |  |  |  320|  1.18k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.18k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  1.18k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1.18k]
  |  |  ------------------
  ------------------
 1446|  1.18k|  }
 1447|  1.18k|  return result;
 1448|  1.18k|}
ftp.c:pathlen:
  806|    309|{
  807|    309|  DEBUGASSERT(ftpc->dirs);
  ------------------
  |  | 1081|    309|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (807:3): [True: 0, False: 309]
  |  Branch (807:3): [True: 309, False: 0]
  ------------------
  808|    309|  DEBUGASSERT(ftpc->dirdepth > num);
  ------------------
  |  | 1081|    309|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (808:3): [True: 0, False: 309]
  |  Branch (808:3): [True: 309, False: 0]
  ------------------
  809|    309|  return ftpc->dirs[num].len;
  810|    309|}
ftp.c:pathpiece:
  813|    309|{
  814|    309|  DEBUGASSERT(ftpc->dirs);
  ------------------
  |  | 1081|    309|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (814:3): [True: 0, False: 309]
  |  Branch (814:3): [True: 309, False: 0]
  ------------------
  815|    309|  DEBUGASSERT(ftpc->dirdepth > num);
  ------------------
  |  | 1081|    309|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (815:3): [True: 0, False: 309]
  |  Branch (815:3): [True: 309, False: 0]
  ------------------
  816|    309|  return &ftpc->rawpath[ftpc->dirs[num].start];
  817|    309|}
ftp.c:ftp_state_retr:
 1780|    162|{
 1781|    162|  CURLcode result = CURLE_OK;
 1782|       |
 1783|    162|  CURL_TRC_FTP(data, "[%s] ftp_state_retr()", FTP_CSTATE(ftpc));
  ------------------
  |  |  180|    162|  do {                                                   \
  |  |  181|    162|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|    162|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    324|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 162, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 162]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    324|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    162|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|    162|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (182:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  183|    162|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 162]
  |  |  ------------------
  ------------------
 1784|    162|  if(data->set.max_filesize && (filesize > data->set.max_filesize)) {
  ------------------
  |  Branch (1784:6): [True: 25, False: 137]
  |  Branch (1784:32): [True: 0, False: 25]
  ------------------
 1785|      0|    failf(data, "Maximum file size exceeded");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1786|      0|    return CURLE_FILESIZE_EXCEEDED;
 1787|      0|  }
 1788|    162|  ftp->downloadsize = filesize;
 1789|       |
 1790|    162|  if(data->state.resume_from) {
  ------------------
  |  Branch (1790:6): [True: 77, False: 85]
  ------------------
 1791|       |    /* We always (attempt to) get the size of downloads, so it is done before
 1792|       |       this even when not doing resumes. */
 1793|     77|    if(filesize == -1) {
  ------------------
  |  Branch (1793:8): [True: 77, False: 0]
  ------------------
 1794|     77|      infof(data, "ftp server does not support SIZE");
  ------------------
  |  |  143|     77|  do {                               \
  |  |  144|     77|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     77|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 77, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 77]
  |  |  |  |  ------------------
  |  |  |  |  320|     77|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     77|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     77|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 77]
  |  |  ------------------
  ------------------
 1795|       |      /* We could not get the size and therefore we cannot know if there
 1796|       |         really is a part of the file left to get, although the server will
 1797|       |         close the connection when we start the connection so it will not
 1798|       |         cause us any harm, not make us exit as nicely. */
 1799|     77|    }
 1800|      0|    else {
 1801|       |      /* We got a file size report, so we check that there actually is a
 1802|       |         part of the file left to get, or else we go home. */
 1803|      0|      if(data->state.resume_from < 0) {
  ------------------
  |  Branch (1803:10): [True: 0, False: 0]
  ------------------
 1804|       |        /* We are supposed to download the last abs(from) bytes */
 1805|      0|        if(filesize < -data->state.resume_from) {
  ------------------
  |  Branch (1805:12): [True: 0, False: 0]
  ------------------
 1806|      0|          failf(data, "Offset (%" FMT_OFF_T
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1807|      0|                ") was beyond file size (%" FMT_OFF_T ")",
 1808|      0|                data->state.resume_from, filesize);
 1809|      0|          return CURLE_BAD_DOWNLOAD_RESUME;
 1810|      0|        }
 1811|       |        /* convert to size to download */
 1812|      0|        ftp->downloadsize = -data->state.resume_from;
 1813|       |        /* download from where? */
 1814|      0|        data->state.resume_from = filesize - ftp->downloadsize;
 1815|      0|      }
 1816|      0|      else {
 1817|      0|        if(filesize < data->state.resume_from) {
  ------------------
  |  Branch (1817:12): [True: 0, False: 0]
  ------------------
 1818|      0|          failf(data, "Offset (%" FMT_OFF_T
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1819|      0|                ") was beyond file size (%" FMT_OFF_T ")",
 1820|      0|                data->state.resume_from, filesize);
 1821|      0|          return CURLE_BAD_DOWNLOAD_RESUME;
 1822|      0|        }
 1823|       |        /* Now store the number of bytes we are expected to download */
 1824|      0|        ftp->downloadsize = filesize - data->state.resume_from;
 1825|      0|      }
 1826|      0|    }
 1827|       |
 1828|     77|    if(ftp->downloadsize == 0) {
  ------------------
  |  Branch (1828:8): [True: 0, False: 77]
  ------------------
 1829|       |      /* no data to transfer */
 1830|      0|      Curl_xfer_setup_nop(data);
 1831|      0|      infof(data, "File already completely downloaded");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1832|       |
 1833|       |      /* Set ->transfer so that we will not get any error in ftp_done()
 1834|       |       * because we did not transfer the any file */
 1835|      0|      ftp->transfer = PPTRANSFER_NONE;
 1836|      0|      ftp_state(data, ftpc, FTP_STOP);
  ------------------
  |  |  159|      0|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 1837|      0|      return CURLE_OK;
 1838|      0|    }
 1839|       |
 1840|       |    /* Set resume file transfer offset */
 1841|     77|    infof(data, "Instructs server to resume from offset %" FMT_OFF_T,
  ------------------
  |  |  143|     77|  do {                               \
  |  |  144|     77|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     77|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 77, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 77]
  |  |  |  |  ------------------
  |  |  |  |  320|     77|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     77|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     77|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 77]
  |  |  ------------------
  ------------------
 1842|     77|          data->state.resume_from);
 1843|       |
 1844|     77|    result = Curl_pp_sendf(data, &ftpc->pp, "REST %" FMT_OFF_T,
  ------------------
  |  |  598|     77|#define FMT_OFF_T  CURL_FORMAT_CURL_OFF_T
  |  |  ------------------
  |  |  |  |  341|     77|#    define CURL_FORMAT_CURL_OFF_T     "ld"
  |  |  ------------------
  ------------------
 1845|     77|                           data->state.resume_from);
 1846|     77|    if(!result)
  ------------------
  |  Branch (1846:8): [True: 77, False: 0]
  ------------------
 1847|     77|      ftp_state(data, ftpc, FTP_RETR_REST);
  ------------------
  |  |  159|     77|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 1848|     77|  }
 1849|     85|  else {
 1850|       |    /* no resume */
 1851|     85|    result = Curl_pp_sendf(data, &ftpc->pp, "RETR %s", ftpc->file);
 1852|     85|    if(!result)
  ------------------
  |  Branch (1852:8): [True: 85, False: 0]
  ------------------
 1853|     85|      ftp_state(data, ftpc, FTP_RETR);
  ------------------
  |  |  159|     85|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 1854|     85|  }
 1855|       |
 1856|    162|  return result;
 1857|    162|}
ftp.c:ftp_state_ul_setup:
 1681|     35|{
 1682|     35|  CURLcode result = CURLE_OK;
 1683|     35|  curl_bit append = data->set.remote_append;
 1684|       |
 1685|     35|  if((data->state.resume_from && !sizechecked) ||
  ------------------
  |  Branch (1685:7): [True: 1, False: 34]
  |  Branch (1685:34): [True: 1, False: 0]
  ------------------
 1686|     34|     ((data->state.resume_from > 0) && sizechecked)) {
  ------------------
  |  Branch (1686:7): [True: 0, False: 34]
  |  Branch (1686:40): [True: 0, False: 0]
  ------------------
 1687|       |    /* we are about to continue the uploading of a file
 1688|       |       1. get already existing file's size. We use the SIZE command for this
 1689|       |          which may not exist in the server!  The SIZE command is not in
 1690|       |          RFC959.
 1691|       |
 1692|       |       2. This used to set REST, but since we can do append, we issue no
 1693|       |          another ftp command. Skip the source file offset and APPEND the rest
 1694|       |          on the file instead
 1695|       |
 1696|       |       3. pass file-size number of bytes in the source file
 1697|       |       4. lower the infilesize counter */
 1698|       |    /* => transfer as usual */
 1699|      1|    int seekerr = CURL_SEEKFUNC_OK;
  ------------------
  |  |  380|      1|#define CURL_SEEKFUNC_OK       0
  ------------------
 1700|       |
 1701|      1|    if(data->state.resume_from < 0) {
  ------------------
  |  Branch (1701:8): [True: 0, False: 1]
  ------------------
 1702|       |      /* Got no given size to start from, figure it out */
 1703|      0|      result = Curl_pp_sendf(data, &ftpc->pp, "SIZE %s", ftpc->file);
 1704|      0|      if(!result)
  ------------------
  |  Branch (1704:10): [True: 0, False: 0]
  ------------------
 1705|      0|        ftp_state(data, ftpc, FTP_STOR_SIZE);
  ------------------
  |  |  159|      0|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 1706|      0|      return result;
 1707|      0|    }
 1708|       |
 1709|       |    /* enable append */
 1710|      1|    append = TRUE;
  ------------------
  |  | 1055|      1|#define TRUE true
  ------------------
 1711|       |
 1712|       |    /* Let's read off the proper amount of bytes from the input. */
 1713|      1|    if(data->set.seek_func) {
  ------------------
  |  Branch (1713:8): [True: 0, False: 1]
  ------------------
 1714|      0|      Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1715|      0|      seekerr = data->set.seek_func(data->set.seek_client,
 1716|      0|                                    data->state.resume_from, SEEK_SET);
 1717|      0|      Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1718|      0|    }
 1719|       |
 1720|      1|    if(seekerr != CURL_SEEKFUNC_OK) {
  ------------------
  |  |  380|      1|#define CURL_SEEKFUNC_OK       0
  ------------------
  |  Branch (1720:8): [True: 0, False: 1]
  ------------------
 1721|      0|      curl_off_t passed = 0;
 1722|      0|      if(seekerr != CURL_SEEKFUNC_CANTSEEK) {
  ------------------
  |  |  382|      0|#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking cannot be done, so
  ------------------
  |  Branch (1722:10): [True: 0, False: 0]
  ------------------
 1723|      0|        failf(data, "Could not seek stream");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1724|      0|        return CURLE_FTP_COULDNT_USE_REST;
 1725|      0|      }
 1726|       |      /* seekerr == CURL_SEEKFUNC_CANTSEEK (cannot seek to offset) */
 1727|      0|      do {
 1728|      0|        char scratch[4 * 1024];
 1729|      0|        size_t readthisamountnow =
 1730|      0|          (data->state.resume_from - passed > (curl_off_t)sizeof(scratch)) ?
  ------------------
  |  Branch (1730:11): [True: 0, False: 0]
  ------------------
 1731|      0|          sizeof(scratch) :
 1732|      0|          curlx_sotouz(data->state.resume_from - passed);
 1733|       |
 1734|      0|        size_t actuallyread =
 1735|      0|          data->state.fread_func(scratch, 1, readthisamountnow,
 1736|      0|                                 data->state.in);
 1737|       |
 1738|      0|        passed += actuallyread;
 1739|      0|        if((actuallyread == 0) || (actuallyread > readthisamountnow)) {
  ------------------
  |  Branch (1739:12): [True: 0, False: 0]
  |  Branch (1739:35): [True: 0, False: 0]
  ------------------
 1740|       |          /* this checks for greater-than only to make sure that the
 1741|       |             CURL_READFUNC_ABORT return code still aborts */
 1742|      0|          failf(data, "Failed to read data");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1743|      0|          return CURLE_FTP_COULDNT_USE_REST;
 1744|      0|        }
 1745|      0|      } while(passed < data->state.resume_from);
  ------------------
  |  Branch (1745:15): [True: 0, False: 0]
  ------------------
 1746|      0|    }
 1747|       |    /* now, decrease the size of the read */
 1748|      1|    if(data->state.infilesize > 0) {
  ------------------
  |  Branch (1748:8): [True: 1, False: 0]
  ------------------
 1749|      1|      data->state.infilesize -= data->state.resume_from;
 1750|       |
 1751|      1|      if(data->state.infilesize <= 0) {
  ------------------
  |  Branch (1751:10): [True: 0, False: 1]
  ------------------
 1752|      0|        infof(data, "File already completely uploaded");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1753|       |
 1754|       |        /* no data to transfer */
 1755|      0|        Curl_xfer_setup_nop(data);
 1756|       |
 1757|       |        /* Set ->transfer so that we will not get any error in
 1758|       |         * ftp_done() because we did not transfer anything! */
 1759|      0|        ftp->transfer = PPTRANSFER_NONE;
 1760|       |
 1761|      0|        ftp_state(data, ftpc, FTP_STOP);
  ------------------
  |  |  159|      0|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 1762|      0|        return CURLE_OK;
 1763|      0|      }
 1764|      1|    }
 1765|       |    /* we have passed, proceed as normal */
 1766|      1|  } /* resume_from */
 1767|       |
 1768|     35|  result = Curl_pp_sendf(data, &ftpc->pp, append ? "APPE %s" : "STOR %s",
  ------------------
  |  Branch (1768:43): [True: 1, False: 34]
  ------------------
 1769|     35|                         ftpc->file);
 1770|     35|  if(!result)
  ------------------
  |  Branch (1770:6): [True: 35, False: 0]
  ------------------
 1771|     35|    ftp_state(data, ftpc, FTP_STOR);
  ------------------
  |  |  159|     35|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 1772|       |
 1773|     35|  return result;
 1774|     35|}
ftp.c:ftp_state_list:
 1542|    599|{
 1543|    599|  CURLcode result = CURLE_OK;
 1544|       |
 1545|       |  /* If this output is to be machine-parsed, the NLST command might be better
 1546|       |     to use, since the LIST command output is not specified or standard in any
 1547|       |     way. It has turned out that the NLST list output is not the same on all
 1548|       |     servers either... */
 1549|       |
 1550|       |  /*
 1551|       |     if FTPFILE_NOCWD was specified, we should add the path
 1552|       |     as argument for the LIST / NLST / or custom command.
 1553|       |     Whether the server will support this, is uncertain.
 1554|       |
 1555|       |     The other ftp_filemethods will CWD into dir/dir/ first and
 1556|       |     then do LIST (in that case: nothing to do here)
 1557|       |  */
 1558|    599|  const char *lstArg = NULL;
 1559|    599|  int lstArglen = 0;
 1560|    599|  char *cmd;
 1561|       |
 1562|    599|  if((data->set.ftp_filemethod == FTPFILE_NOCWD) && ftp->path) {
  ------------------
  |  Branch (1562:6): [True: 2, False: 597]
  |  Branch (1562:53): [True: 2, False: 0]
  ------------------
 1563|       |    /* URL-decode before evaluation: e.g. paths starting/ending with %2f */
 1564|      2|    const char *rawPath = ftpc->rawpath;
 1565|      2|    const char *slashPos = strrchr(rawPath, '/');
 1566|      2|    if(slashPos) {
  ------------------
  |  Branch (1566:8): [True: 1, False: 1]
  ------------------
 1567|       |      /* chop off the file part if format is dir/file otherwise remove
 1568|       |         the trailing slash for dir/dir/ except for absolute path / */
 1569|      1|      size_t n = slashPos - rawPath;
 1570|      1|      if(n == 0)
  ------------------
  |  Branch (1570:10): [True: 1, False: 0]
  ------------------
 1571|      1|        ++n;
 1572|       |
 1573|      1|      lstArg = rawPath;
 1574|      1|      lstArglen = (int)n;
 1575|      1|    }
 1576|      2|  }
 1577|       |
 1578|    599|  cmd = curl_maprintf("%s%s%.*s",
 1579|    599|                      data->set.str[STRING_CUSTOMREQUEST] ?
  ------------------
  |  Branch (1579:23): [True: 2, False: 597]
  ------------------
 1580|      2|                      data->set.str[STRING_CUSTOMREQUEST] :
 1581|    599|                      (data->state.list_only ? "NLST" : "LIST"),
  ------------------
  |  Branch (1581:24): [True: 2, False: 595]
  ------------------
 1582|    599|                      lstArg ? " " : "",
  ------------------
  |  Branch (1582:23): [True: 1, False: 598]
  ------------------
 1583|    599|                      lstArglen, lstArg ? lstArg : "");
  ------------------
  |  Branch (1583:34): [True: 1, False: 598]
  ------------------
 1584|       |
 1585|    599|  if(!cmd)
  ------------------
  |  Branch (1585:6): [True: 0, False: 599]
  ------------------
 1586|      0|    return CURLE_OUT_OF_MEMORY;
 1587|       |
 1588|    599|  result = Curl_pp_sendf(data, &ftpc->pp, "%s", cmd);
 1589|    599|  curlx_free(cmd);
  ------------------
  |  | 1483|    599|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1590|       |
 1591|    599|  if(!result)
  ------------------
  |  Branch (1591:6): [True: 599, False: 0]
  ------------------
 1592|    599|    ftp_state(data, ftpc, FTP_LIST);
  ------------------
  |  |  159|    599|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 1593|       |
 1594|    599|  return result;
 1595|    599|}
ftp.c:ftp_statemach:
 2203|  15.9k|{
 2204|  15.9k|  CURLcode result = Curl_pp_statemach(data, &ftpc->pp, FALSE, FALSE);
  ------------------
  |  | 1058|  15.9k|#define FALSE false
  ------------------
                CURLcode result = Curl_pp_statemach(data, &ftpc->pp, FALSE, FALSE);
  ------------------
  |  | 1058|  15.9k|#define FALSE false
  ------------------
 2205|       |
 2206|       |  /* Check for the state outside of the Curl_socket_check() return code checks
 2207|       |     since at times we are in fact already in this state when this function
 2208|       |     gets called. */
 2209|  15.9k|  *done = (ftpc->state == FTP_STOP);
 2210|       |
 2211|  15.9k|  return result;
 2212|  15.9k|}
ftp.c:ftp_dophase_done:
 2390|  1.05k|{
 2391|  1.05k|  if(connected) {
  ------------------
  |  Branch (2391:6): [True: 0, False: 1.05k]
  ------------------
 2392|      0|    domore completed;
 2393|      0|    CURLcode result = ftp_do_more(data, &completed);
 2394|       |
 2395|      0|    if(result) {
  ------------------
  |  Branch (2395:8): [True: 0, False: 0]
  ------------------
 2396|      0|      close_secondarysocket(data, ftpc);
 2397|      0|      return result;
 2398|      0|    }
 2399|      0|  }
 2400|       |
 2401|  1.05k|  if(ftp->transfer != PPTRANSFER_BODY)
  ------------------
  |  Branch (2401:6): [True: 100, False: 959]
  ------------------
 2402|       |    /* no data to transfer */
 2403|    100|    Curl_xfer_setup_nop(data);
 2404|    959|  else if(!connected)
  ------------------
  |  Branch (2404:11): [True: 959, False: 0]
  ------------------
 2405|       |    /* since we did not connect now, we want do_more to get called */
 2406|    959|    data->conn->bits.do_more = TRUE;
  ------------------
  |  | 1055|    959|#define TRUE true
  ------------------
 2407|       |
 2408|  1.05k|  ftpc->ctl_valid = TRUE; /* seems good */
  ------------------
  |  | 1055|  1.05k|#define TRUE true
  ------------------
 2409|       |
 2410|  1.05k|  return CURLE_OK;
 2411|  1.05k|}
ftp.c:close_secondarysocket:
  355|  1.99k|{
  356|  1.99k|  (void)ftpc;
  357|  1.99k|  CURL_TRC_FTP(data, "[%s] closing DATA connection", FTP_CSTATE(ftpc));
  ------------------
  |  |  180|  1.99k|  do {                                                   \
  |  |  181|  1.99k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|  1.99k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  3.99k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 1.99k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.99k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  3.99k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.99k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|  1.99k|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (182:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  183|  1.99k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 1.99k]
  |  |  ------------------
  ------------------
  358|  1.99k|  Curl_conn_close(data, SECONDARYSOCKET);
  ------------------
  |  |  304|  1.99k|#define SECONDARYSOCKET 1
  ------------------
  359|  1.99k|  Curl_conn_cf_discard_all(data, data->conn, SECONDARYSOCKET);
  ------------------
  |  |  304|  1.99k|#define SECONDARYSOCKET 1
  ------------------
  360|  1.99k|}
ftp.c:ftp_done:
 3816|  2.15k|{
 3817|  2.15k|  struct FTP *ftp = Curl_meta_get(data, CURL_META_FTP_EASY);
  ------------------
  |  |  154|  2.15k|#define CURL_META_FTP_EASY   "meta:proto:ftp:easy"
  ------------------
 3818|  2.15k|  struct ftp_conn *ftpc = Curl_conn_meta_get(data->conn, CURL_META_FTP_CONN);
  ------------------
  |  |  156|  2.15k|#define CURL_META_FTP_CONN   "meta:proto:ftp:conn"
  ------------------
 3819|  2.15k|  CURLcode result;
 3820|       |
 3821|  2.15k|  if(!ftp || !ftpc)
  ------------------
  |  Branch (3821:6): [True: 0, False: 2.15k]
  |  Branch (3821:14): [True: 0, False: 2.15k]
  ------------------
 3822|      0|    return CURLE_OK;
 3823|       |
 3824|  2.15k|  result = ftp_done_status(data->conn, ftpc, status, premature);
 3825|       |
 3826|  2.15k|  ftp_done_wildcard(data, ftpc);
 3827|  2.15k|  ftp_done_path(data, ftpc, result);
 3828|  2.15k|  result = ftp_done_secondary_socket(data, ftpc, result);
 3829|  2.15k|  result = ftp_done_control_reply(data, ftpc, ftp, result, premature);
 3830|  2.15k|  result = ftp_done_check_partial(data, ftpc, ftp, result, premature);
 3831|       |
 3832|       |  /* clear these for next connection */
 3833|  2.15k|  ftp->transfer = PPTRANSFER_BODY;
 3834|  2.15k|  ftpc->dont_check = FALSE;
  ------------------
  |  | 1058|  2.15k|#define FALSE false
  ------------------
 3835|       |
 3836|       |  /* Send any post-transfer QUOTE strings? */
 3837|  2.15k|  if(!status && !result && !premature && data->set.postquote)
  ------------------
  |  Branch (3837:6): [True: 899, False: 1.25k]
  |  Branch (3837:17): [True: 270, False: 629]
  |  Branch (3837:28): [True: 222, False: 48]
  |  Branch (3837:42): [True: 0, False: 222]
  ------------------
 3838|      0|    result = ftp_sendquote(data, ftpc, data->set.postquote);
 3839|  2.15k|  CURL_TRC_FTP(data, "[%s] done, result=%d", FTP_CSTATE(ftpc), result);
  ------------------
  |  |  180|  2.15k|  do {                                                   \
  |  |  181|  2.15k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|  2.15k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  4.30k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 2.15k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 2.15k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  4.30k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  2.15k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|  2.15k|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (182:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  183|  2.15k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 2.15k]
  |  |  ------------------
  ------------------
 3840|  2.15k|  return result;
 3841|  2.15k|}
ftp.c:ftp_done_status:
 3600|  2.15k|{
 3601|  2.15k|  switch(status) {
 3602|      0|  case CURLE_BAD_DOWNLOAD_RESUME:
  ------------------
  |  Branch (3602:3): [True: 0, False: 2.15k]
  ------------------
 3603|     31|  case CURLE_FTP_WEIRD_PASV_REPLY:
  ------------------
  |  Branch (3603:3): [True: 31, False: 2.12k]
  ------------------
 3604|     41|  case CURLE_FTP_PORT_FAILED:
  ------------------
  |  Branch (3604:3): [True: 10, False: 2.14k]
  ------------------
 3605|     41|  case CURLE_FTP_ACCEPT_FAILED:
  ------------------
  |  Branch (3605:3): [True: 0, False: 2.15k]
  ------------------
 3606|     41|  case CURLE_FTP_ACCEPT_TIMEOUT:
  ------------------
  |  Branch (3606:3): [True: 0, False: 2.15k]
  ------------------
 3607|    115|  case CURLE_FTP_COULDNT_SET_TYPE:
  ------------------
  |  Branch (3607:3): [True: 74, False: 2.07k]
  ------------------
 3608|    136|  case CURLE_FTP_COULDNT_RETR_FILE:
  ------------------
  |  Branch (3608:3): [True: 21, False: 2.13k]
  ------------------
 3609|    140|  case CURLE_PARTIAL_FILE:
  ------------------
  |  Branch (3609:3): [True: 4, False: 2.14k]
  ------------------
 3610|    141|  case CURLE_UPLOAD_FAILED:
  ------------------
  |  Branch (3610:3): [True: 1, False: 2.15k]
  ------------------
 3611|    157|  case CURLE_REMOTE_ACCESS_DENIED:
  ------------------
  |  Branch (3611:3): [True: 16, False: 2.13k]
  ------------------
 3612|    158|  case CURLE_FILESIZE_EXCEEDED:
  ------------------
  |  Branch (3612:3): [True: 1, False: 2.15k]
  ------------------
 3613|    162|  case CURLE_REMOTE_FILE_NOT_FOUND:
  ------------------
  |  Branch (3613:3): [True: 4, False: 2.14k]
  ------------------
 3614|    162|  case CURLE_WRITE_ERROR:
  ------------------
  |  Branch (3614:3): [True: 0, False: 2.15k]
  ------------------
 3615|       |    /* the connection stays alive fine even though this happened */
 3616|  1.06k|  case CURLE_OK: /* does not affect the control connection's status */
  ------------------
  |  Branch (3616:3): [True: 899, False: 1.25k]
  ------------------
 3617|  1.06k|    if(!premature)
  ------------------
  |  Branch (3617:8): [True: 1.00k, False: 53]
  ------------------
 3618|  1.00k|      break;
 3619|       |
 3620|       |    /* until we cope better with prematurely ended requests, let them
 3621|       |     * fallback as if in complete failure */
 3622|     53|    FALLTHROUGH();
  ------------------
  |  |  821|     53|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
 3623|  1.14k|  default:       /* by default, an error means the control connection is
  ------------------
  |  Branch (3623:3): [True: 1.09k, False: 1.06k]
  ------------------
 3624|       |                    wedged and should not be used anymore */
 3625|  1.14k|    ftpc->ctl_valid = FALSE;
  ------------------
  |  | 1058|  1.14k|#define FALSE false
  ------------------
 3626|  1.14k|    ftpc->cwdfail = TRUE; /* set this TRUE to prevent us to remember the
  ------------------
  |  | 1055|  1.14k|#define TRUE true
  ------------------
 3627|       |                             current path, as this connection is going */
 3628|  1.14k|    connclose(conn, "FTP ended with bad error code");
  ------------------
  |  |  103|  1.14k|#define connclose(x, y)   Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
  |  |  ------------------
  |  |  |  |   91|  1.14k|#define CONNCTRL_CONNECTION 1
  |  |  ------------------
  ------------------
 3629|  1.14k|    return status;      /* use the already set error code */
 3630|  2.15k|  }
 3631|  1.00k|  return CURLE_OK;
 3632|  2.15k|}
ftp.c:ftp_done_wildcard:
 3635|  2.15k|{
 3636|  2.15k|  if(data->state.wildcardmatch) {
  ------------------
  |  Branch (3636:6): [True: 710, False: 1.44k]
  ------------------
 3637|    710|    if(data->set.chunk_end && ftpc->file) {
  ------------------
  |  Branch (3637:8): [True: 0, False: 710]
  |  Branch (3637:31): [True: 0, False: 0]
  ------------------
 3638|      0|      Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 3639|      0|      data->set.chunk_end(data->set.wildcardptr);
 3640|       |      Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 3641|      0|      freedirs(ftpc);
 3642|      0|    }
 3643|    710|    ftpc->known_filesize = -1;
 3644|    710|  }
 3645|  2.15k|}
ftp.c:ftp_done_path:
 3649|  2.15k|{
 3650|  2.15k|  struct connectdata *conn = data->conn;
 3651|  2.15k|  if(result) {
  ------------------
  |  Branch (3651:6): [True: 1.09k, False: 1.05k]
  ------------------
 3652|       |    /* We can limp along anyway (and should try to since we may already be in
 3653|       |     * the error path) */
 3654|  1.09k|    ftpc->ctl_valid = FALSE; /* mark control connection as bad */
  ------------------
  |  | 1058|  1.09k|#define FALSE false
  ------------------
 3655|  1.09k|    connclose(conn, "FTP: out of memory!"); /* mark for connection closure */
  ------------------
  |  |  103|  1.09k|#define connclose(x, y)   Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
  |  |  ------------------
  |  |  |  |   91|  1.09k|#define CONNCTRL_CONNECTION 1
  |  |  ------------------
  ------------------
 3656|  1.09k|    curlx_safefree(ftpc->prevpath); /* no path remembering */
  ------------------
  |  | 1327|  1.09k|  do {                      \
  |  | 1328|  1.09k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  1.09k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  1.09k|    (ptr) = NULL;           \
  |  | 1330|  1.09k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 1.09k]
  |  |  ------------------
  ------------------
 3657|  1.09k|  }
 3658|  1.05k|  else { /* remember working directory for connection reuse */
 3659|  1.05k|    const char *rawPath = ftpc->rawpath;
 3660|  1.05k|    if(rawPath) {
  ------------------
  |  Branch (3660:8): [True: 919, False: 137]
  ------------------
 3661|    919|      if((data->set.ftp_filemethod == FTPFILE_NOCWD) && (rawPath[0] == '/'))
  ------------------
  |  Branch (3661:10): [True: 3, False: 916]
  |  Branch (3661:57): [True: 1, False: 2]
  ------------------
 3662|      1|        ; /* full path => no CWDs happened => keep ftpc->prevpath */
 3663|    918|      else {
 3664|    918|        size_t pathLen = strlen(ftpc->rawpath);
 3665|       |
 3666|    918|        curlx_free(ftpc->prevpath);
  ------------------
  |  | 1483|    918|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3667|       |
 3668|    918|        if(!ftpc->cwdfail) {
  ------------------
  |  Branch (3668:12): [True: 888, False: 30]
  ------------------
 3669|    888|          if(data->set.ftp_filemethod == FTPFILE_NOCWD)
  ------------------
  |  Branch (3669:14): [True: 2, False: 886]
  ------------------
 3670|      2|            pathLen = 0; /* relative path => working directory is FTP home */
 3671|    886|          else
 3672|       |            /* file is URL-decoded */
 3673|    886|            pathLen -= ftpc->file ? strlen(ftpc->file) : 0;
  ------------------
  |  Branch (3673:24): [True: 141, False: 745]
  ------------------
 3674|    888|          ftpc->prevpath = curlx_memdup0(rawPath, pathLen);
 3675|    888|        }
 3676|     30|        else
 3677|     30|          ftpc->prevpath = NULL; /* no path */
 3678|    918|      }
 3679|    919|    }
 3680|  1.05k|    if(ftpc->prevpath)
  ------------------
  |  Branch (3680:8): [True: 888, False: 168]
  ------------------
 3681|    888|      infof(data, "Remembering we are in directory \"%s\"", ftpc->prevpath);
  ------------------
  |  |  143|    888|  do {                               \
  |  |  144|    888|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    888|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 888, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 888]
  |  |  |  |  ------------------
  |  |  |  |  320|    888|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    888|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    888|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 888]
  |  |  ------------------
  ------------------
 3682|  1.05k|  }
 3683|  2.15k|}
ftp.c:ftp_done_secondary_socket:
 3688|  2.15k|{
 3689|  2.15k|  struct connectdata *conn = data->conn;
 3690|  2.15k|  if(Curl_conn_is_setup(conn, SECONDARYSOCKET)) {
  ------------------
  |  |  304|  2.15k|#define SECONDARYSOCKET 1
  ------------------
  |  Branch (3690:6): [True: 959, False: 1.19k]
  ------------------
 3691|    959|    if(!result && ftpc->dont_check && data->req.maxdownload > 0) {
  ------------------
  |  Branch (3691:8): [True: 775, False: 184]
  |  Branch (3691:19): [True: 168, False: 607]
  |  Branch (3691:39): [True: 168, False: 0]
  ------------------
 3692|       |      /* partial download completed */
 3693|    168|      result = Curl_pp_sendf(data, &ftpc->pp, "%s", "ABOR");
 3694|    168|      if(result) {
  ------------------
  |  Branch (3694:10): [True: 0, False: 168]
  ------------------
 3695|      0|        failf(data, "Failure sending ABOR command: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3696|      0|              curl_easy_strerror(result));
 3697|      0|        ftpc->ctl_valid = FALSE; /* mark control connection as bad */
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 3698|      0|        connclose(conn, "ABOR command failed"); /* connection closure */
  ------------------
  |  |  103|      0|#define connclose(x, y)   Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
  |  |  ------------------
  |  |  |  |   91|      0|#define CONNCTRL_CONNECTION 1
  |  |  ------------------
  ------------------
 3699|      0|      }
 3700|    168|    }
 3701|       |
 3702|    959|    close_secondarysocket(data, ftpc);
 3703|    959|  }
 3704|  2.15k|  return result;
 3705|  2.15k|}
ftp.c:ftp_done_control_reply:
 3711|  2.15k|{
 3712|  2.15k|  struct connectdata *conn = data->conn;
 3713|  2.15k|  size_t nread;
 3714|  2.15k|  int ftpcode;
 3715|       |
 3716|  2.15k|  if(!result && (ftp->transfer == PPTRANSFER_BODY) && ftpc->ctl_valid &&
  ------------------
  |  Branch (3716:6): [True: 1.05k, False: 1.09k]
  |  Branch (3716:17): [True: 954, False: 102]
  |  Branch (3716:55): [True: 825, False: 129]
  ------------------
 3717|    825|     ftpc->pp.pending_resp && !premature) {
  ------------------
  |  Branch (3717:6): [True: 722, False: 103]
  |  Branch (3717:31): [True: 722, False: 0]
  ------------------
 3718|       |    /*
 3719|       |     * Let's see what the server says about the transfer we performed, but
 3720|       |     * lower the timeout as sometimes this connection has died while the data
 3721|       |     * has been transferred. This happens when doing through NATs etc that
 3722|       |     * abandon old silent connections.
 3723|       |     */
 3724|    722|    ftpc->pp.response = *Curl_pgrs_now(data); /* timeout relative now */
 3725|    722|    result = getftpresponse(data, &nread, &ftpcode);
 3726|       |
 3727|    722|    if(!nread && (result == CURLE_OPERATION_TIMEDOUT)) {
  ------------------
  |  Branch (3727:8): [True: 703, False: 19]
  |  Branch (3727:18): [True: 7, False: 696]
  ------------------
 3728|      7|      failf(data, "control connection looks dead");
  ------------------
  |  |   62|      7|#define failf Curl_failf
  ------------------
 3729|      7|      ftpc->ctl_valid = FALSE; /* mark control connection as bad */
  ------------------
  |  | 1058|      7|#define FALSE false
  ------------------
 3730|      7|      connclose(conn, "Timeout or similar in FTP DONE operation"); /* close */
  ------------------
  |  |  103|      7|#define connclose(x, y)   Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
  |  |  ------------------
  |  |  |  |   91|      7|#define CONNCTRL_CONNECTION 1
  |  |  ------------------
  ------------------
 3731|      7|    }
 3732|       |
 3733|    722|    if(result)
  ------------------
  |  Branch (3733:8): [True: 620, False: 102]
  ------------------
 3734|    620|      return result;
 3735|       |
 3736|    102|    if(ftpc->dont_check && data->req.maxdownload > 0) {
  ------------------
  |  Branch (3736:8): [True: 45, False: 57]
  |  Branch (3736:28): [True: 45, False: 0]
  ------------------
 3737|       |      /* we have sent ABOR and there is no reliable way to check if it was
 3738|       |       * successful or not; we have to close the connection now */
 3739|     45|      infof(data, "partial download completed, closing connection");
  ------------------
  |  |  143|     45|  do {                               \
  |  |  144|     45|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     45|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 45, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 45]
  |  |  |  |  ------------------
  |  |  |  |  320|     45|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     45|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     45|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 45]
  |  |  ------------------
  ------------------
 3740|     45|      connclose(conn, "Partial download with no ability to check");
  ------------------
  |  |  103|     45|#define connclose(x, y)   Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
  |  |  ------------------
  |  |  |  |   91|     45|#define CONNCTRL_CONNECTION 1
  |  |  ------------------
  ------------------
 3741|     45|      return result;
 3742|     45|    }
 3743|       |
 3744|     57|    if(!ftpc->dont_check) {
  ------------------
  |  Branch (3744:8): [True: 57, False: 0]
  ------------------
 3745|       |      /* 226 Transfer complete, 250 Requested file action okay, completed. */
 3746|     57|      switch(ftpcode) {
 3747|     21|      case 226:
  ------------------
  |  Branch (3747:7): [True: 21, False: 36]
  ------------------
 3748|     22|      case 250:
  ------------------
  |  Branch (3748:7): [True: 1, False: 56]
  ------------------
 3749|     22|        break;
 3750|      0|      case 552:
  ------------------
  |  Branch (3750:7): [True: 0, False: 57]
  ------------------
 3751|      0|        failf(data, "Exceeded storage allocation");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3752|      0|        result = CURLE_REMOTE_DISK_FULL;
 3753|      0|        break;
 3754|     35|      default:
  ------------------
  |  Branch (3754:7): [True: 35, False: 22]
  ------------------
 3755|     35|        failf(data, "server did not report OK, got %d", ftpcode);
  ------------------
  |  |   62|     35|#define failf Curl_failf
  ------------------
 3756|     35|        result = CURLE_PARTIAL_FILE;
 3757|     35|        break;
 3758|     57|      }
 3759|     57|    }
 3760|     57|  }
 3761|  1.48k|  return result;
 3762|  2.15k|}
ftp.c:getftpresponse:
  636|    722|{
  637|       |  /*
  638|       |   * We cannot read one byte per read() and then go back to select() as the
  639|       |   * OpenSSL read() does not grok that properly.
  640|       |   *
  641|       |   * Alas, read as much as possible, split up into lines, use the ending
  642|       |   * line in a response or continue reading. */
  643|       |
  644|    722|  struct connectdata *conn = data->conn;
  645|    722|  curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
  ------------------
  |  |  303|    722|#define FIRSTSOCKET     0
  ------------------
  646|    722|  CURLcode result = CURLE_OK;
  647|    722|  struct ftp_conn *ftpc = Curl_conn_meta_get(data->conn, CURL_META_FTP_CONN);
  ------------------
  |  |  156|    722|#define CURL_META_FTP_CONN   "meta:proto:ftp:conn"
  ------------------
  648|    722|  struct pingpong *pp = &ftpc->pp;
  649|    722|  size_t nread;
  650|    722|  int cache_skip = 0;
  651|    722|  DEBUGASSERT(ftpcodep);
  ------------------
  |  | 1081|    722|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (651:3): [True: 0, False: 722]
  |  Branch (651:3): [True: 722, False: 0]
  ------------------
  652|       |
  653|    722|  CURL_TRC_FTP(data, "getftpresponse start");
  ------------------
  |  |  180|    722|  do {                                                   \
  |  |  181|    722|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|    722|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  1.44k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 722, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 722]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  1.44k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    722|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|    722|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  183|    722|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 722]
  |  |  ------------------
  ------------------
  654|    722|  *nreadp = 0;
  655|    722|  *ftpcodep = 0; /* 0 for errors */
  656|       |
  657|    722|  if(!ftpc)
  ------------------
  |  Branch (657:6): [True: 0, False: 722]
  ------------------
  658|      0|    return CURLE_FAILED_INIT;
  659|       |
  660|  4.82k|  while(!*ftpcodep && !result) {
  ------------------
  |  Branch (660:9): [True: 4.71k, False: 102]
  |  Branch (660:23): [True: 4.71k, False: 0]
  ------------------
  661|       |    /* check and reset timeout value every lap */
  662|  4.71k|    timediff_t timeout = Curl_pp_state_timeleft_ms(data, pp);
  663|  4.71k|    timediff_t interval_ms;
  664|       |
  665|  4.71k|    if(timeout <= 0) {
  ------------------
  |  Branch (665:8): [True: 7, False: 4.71k]
  ------------------
  666|      7|      failf(data, "FTP response timeout");
  ------------------
  |  |   62|      7|#define failf Curl_failf
  ------------------
  667|      7|      return CURLE_OPERATION_TIMEDOUT; /* already too little time */
  668|      7|    }
  669|       |
  670|  4.71k|    interval_ms = 1000;  /* use 1 second timeout intervals */
  671|  4.71k|    if(timeout < interval_ms)
  ------------------
  |  Branch (671:8): [True: 4.70k, False: 3]
  ------------------
  672|  4.70k|      interval_ms = timeout;
  673|       |
  674|       |    /*
  675|       |     * Since this function is blocking, we need to wait here for input on the
  676|       |     * connection and only then we call the response reading function. We do
  677|       |     * timeout at least every second to make the timeout check run.
  678|       |     *
  679|       |     * A caution here is that the ftp_readresp() function has a cache that may
  680|       |     * contain pieces of a response from the previous invoke and we need to
  681|       |     * make sure we do not wait for input while there is unhandled data in
  682|       |     * that cache. Also, if the cache is there, we call ftp_readresp() and
  683|       |     * the cache was not good enough to continue we must not busy-loop around
  684|       |     * this function.
  685|       |     *
  686|       |     */
  687|       |
  688|  4.71k|    if(curlx_dyn_len(&pp->recvbuf) && (cache_skip < 2)) {
  ------------------
  |  Branch (688:8): [True: 4.48k, False: 228]
  |  Branch (688:39): [True: 1.82k, False: 2.65k]
  ------------------
  689|       |      /*
  690|       |       * There is a cache left since before. We then skipping the wait for
  691|       |       * socket action, unless this is the same cache like the previous round
  692|       |       * as then the cache was deemed not enough to act on and we then need to
  693|       |       * wait for more data anyway.
  694|       |       */
  695|  1.82k|    }
  696|  2.88k|    else if(!Curl_conn_data_pending(data, FIRSTSOCKET)) {
  ------------------
  |  |  303|  2.88k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (696:13): [True: 2.88k, False: 0]
  ------------------
  697|  2.88k|      curl_socket_t wsock = Curl_pp_needs_flush(data, pp) ?
  ------------------
  |  Branch (697:29): [True: 0, False: 2.88k]
  ------------------
  698|  2.88k|        sockfd : CURL_SOCKET_BAD;
  ------------------
  |  |  145|  2.88k|#define CURL_SOCKET_BAD (-1)
  ------------------
  699|  2.88k|      int ev = Curl_socket_check(sockfd, CURL_SOCKET_BAD, wsock, interval_ms);
  ------------------
  |  |  145|  2.88k|#define CURL_SOCKET_BAD (-1)
  ------------------
  700|  2.88k|      if(ev < 0) {
  ------------------
  |  Branch (700:10): [True: 0, False: 2.88k]
  ------------------
  701|      0|        failf(data, "FTP response aborted due to select/poll error: %d",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  702|      0|              SOCKERRNO);
  ------------------
  |  | 1095|      0|#define SOCKERRNO         errno
  ------------------
  703|      0|        return CURLE_RECV_ERROR;
  704|      0|      }
  705|  2.88k|      else if(ev == 0) {
  ------------------
  |  Branch (705:15): [True: 8, False: 2.87k]
  ------------------
  706|      8|        result = Curl_pgrsUpdate(data);
  707|      8|        continue; /* continue in our loop for the timeout duration */
  708|      8|      }
  709|  2.88k|    }
  710|       |
  711|  4.70k|    if(Curl_pp_needs_flush(data, pp)) {
  ------------------
  |  Branch (711:8): [True: 0, False: 4.70k]
  ------------------
  712|      0|      result = Curl_pp_flushsend(data, pp);
  713|      0|      if(result)
  ------------------
  |  Branch (713:10): [True: 0, False: 0]
  ------------------
  714|      0|        break;
  715|      0|    }
  716|       |
  717|  4.70k|    result = ftp_readresp(data, ftpc, FIRSTSOCKET, pp, ftpcodep, &nread);
  ------------------
  |  |  303|  4.70k|#define FIRSTSOCKET     0
  ------------------
  718|  4.70k|    if(result)
  ------------------
  |  Branch (718:8): [True: 613, False: 4.09k]
  ------------------
  719|    613|      break;
  720|       |
  721|  4.09k|    if(!nread && curlx_dyn_len(&pp->recvbuf))
  ------------------
  |  Branch (721:8): [True: 3.77k, False: 321]
  |  Branch (721:18): [True: 3.54k, False: 228]
  ------------------
  722|       |      /* bump cache skip counter as on repeated skips we must wait for more
  723|       |         data */
  724|  3.54k|      cache_skip++;
  725|    549|    else
  726|       |      /* when we got data or there is no cache left, we reset the cache skip
  727|       |         counter */
  728|    549|      cache_skip = 0;
  729|       |
  730|  4.09k|    *nreadp += nread;
  731|       |
  732|  4.09k|  } /* while there is buffer left and loop is requested */
  733|       |
  734|    715|  pp->pending_resp = FALSE;
  ------------------
  |  | 1058|    715|#define FALSE false
  ------------------
  735|    715|  CURL_TRC_FTP(data, "getftpresponse -> result=%d, nread=%zu, ftpcode=%d",
  ------------------
  |  |  180|    715|  do {                                                   \
  |  |  181|    715|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|    715|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  1.43k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 715, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 715]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  1.43k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    715|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|    715|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  183|    715|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 715]
  |  |  ------------------
  ------------------
  736|    715|               result, *nreadp, *ftpcodep);
  737|       |
  738|    715|  return result;
  739|    722|}
ftp.c:ftp_readresp:
  598|  19.7k|{
  599|  19.7k|  int code;
  600|  19.7k|  CURLcode result = Curl_pp_readresp(data, sockindex, pp, &code, size);
  601|  19.7k|  DEBUGASSERT(ftpcodep);
  ------------------
  |  | 1081|  19.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (601:3): [True: 0, False: 19.7k]
  |  Branch (601:3): [True: 19.7k, False: 0]
  ------------------
  602|       |
  603|       |  /* store the latest code for later retrieval, except during shutdown */
  604|  19.7k|  if(!ftpc->shutdown)
  ------------------
  |  Branch (604:6): [True: 19.7k, False: 0]
  ------------------
  605|  19.7k|    data->info.httpcode = code;
  606|       |
  607|  19.7k|  *ftpcodep = code;
  608|       |
  609|  19.7k|  if(code == 421) {
  ------------------
  |  Branch (609:6): [True: 1, False: 19.7k]
  ------------------
  610|       |    /* 421 means "Service not available, closing control connection." and FTP
  611|       |     * servers use it to signal that idle session timeout has been exceeded.
  612|       |     * If we ignored the response, it could end up hanging in some cases.
  613|       |     *
  614|       |     * This response code can come at any point so having it treated
  615|       |     * generically is a good idea.
  616|       |     */
  617|      1|    infof(data, "We got a 421 - timeout");
  ------------------
  |  |  143|      1|  do {                               \
  |  |  144|      1|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      1|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 1, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  320|      1|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      1|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      1|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1]
  |  |  ------------------
  ------------------
  618|      1|    ftp_state(data, ftpc, FTP_STOP);
  ------------------
  |  |  159|      1|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
  619|      1|    return CURLE_OPERATION_TIMEDOUT;
  620|      1|  }
  621|       |
  622|  19.7k|  return result;
  623|  19.7k|}
ftp.c:ftp_done_check_partial:
 3768|  2.15k|{
 3769|  2.15k|  if(result || premature)
  ------------------
  |  Branch (3769:6): [True: 1.75k, False: 401]
  |  Branch (3769:16): [True: 48, False: 353]
  ------------------
 3770|       |    /* the response code from the transfer showed an error already so no
 3771|       |       use checking further */
 3772|  1.79k|    ;
 3773|    353|  else if(data->state.upload) {
  ------------------
  |  Branch (3773:11): [True: 19, False: 334]
  ------------------
 3774|     19|    if((ftp->transfer == PPTRANSFER_BODY) &&
  ------------------
  |  Branch (3774:8): [True: 19, False: 0]
  ------------------
 3775|     19|       (data->state.infilesize != -1) && /* upload with known size */
  ------------------
  |  Branch (3775:8): [True: 19, False: 0]
  ------------------
 3776|     19|       ((!data->set.crlf && !data->state.prefer_ascii && /* no conversion */
  ------------------
  |  Branch (3776:10): [True: 19, False: 0]
  |  Branch (3776:29): [True: 16, False: 3]
  ------------------
 3777|     16|         (data->state.infilesize != data->req.writebytecount)) ||
  ------------------
  |  Branch (3777:10): [True: 6, False: 10]
  ------------------
 3778|     13|        ((data->set.crlf || data->state.prefer_ascii) && /* maybe crlf conv */
  ------------------
  |  Branch (3778:11): [True: 0, False: 13]
  |  Branch (3778:29): [True: 3, False: 10]
  ------------------
 3779|      3|         (data->state.infilesize > data->req.writebytecount))
  ------------------
  |  Branch (3779:10): [True: 2, False: 1]
  ------------------
 3780|     19|       )) {
 3781|      8|      failf(data, "Uploaded unaligned file size (%" FMT_OFF_T
  ------------------
  |  |   62|      8|#define failf Curl_failf
  ------------------
 3782|      8|            " out of %" FMT_OFF_T " bytes)",
 3783|      8|            data->req.writebytecount, data->state.infilesize);
 3784|      8|      result = CURLE_PARTIAL_FILE;
 3785|      8|    }
 3786|     19|  }
 3787|    334|  else {
 3788|    334|    if((data->req.size != -1) &&
  ------------------
  |  Branch (3788:8): [True: 0, False: 334]
  ------------------
 3789|      0|       (data->req.size != data->req.bytecount) &&
  ------------------
  |  Branch (3789:8): [True: 0, False: 0]
  ------------------
 3790|      0|       (data->req.maxdownload != data->req.bytecount)) {
  ------------------
  |  Branch (3790:8): [True: 0, False: 0]
  ------------------
 3791|      0|      failf(data, "Received only partial file: %" FMT_OFF_T " bytes",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3792|      0|            data->req.bytecount);
 3793|      0|      result = CURLE_PARTIAL_FILE;
 3794|      0|    }
 3795|    334|    else if(!ftpc->dont_check &&
  ------------------
  |  Branch (3795:13): [True: 289, False: 45]
  ------------------
 3796|    289|            !data->req.bytecount &&
  ------------------
  |  Branch (3796:13): [True: 271, False: 18]
  ------------------
 3797|    271|            (data->req.size > 0)) {
  ------------------
  |  Branch (3797:13): [True: 0, False: 271]
  ------------------
 3798|      0|      failf(data, "No data was received");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3799|      0|      result = CURLE_FTP_COULDNT_RETR_FILE;
 3800|      0|    }
 3801|    334|  }
 3802|  2.15k|  return result;
 3803|  2.15k|}
ftp.c:ftp_do_more:
 2224|   155k|{
 2225|   155k|  struct connectdata *conn = data->conn;
 2226|   155k|  struct ftp_conn *ftpc = Curl_conn_meta_get(data->conn, CURL_META_FTP_CONN);
  ------------------
  |  |  156|   155k|#define CURL_META_FTP_CONN   "meta:proto:ftp:conn"
  ------------------
 2227|   155k|  struct FTP *ftp = Curl_meta_get(data, CURL_META_FTP_EASY);
  ------------------
  |  |  154|   155k|#define CURL_META_FTP_EASY   "meta:proto:ftp:easy"
  ------------------
 2228|   155k|  CURLcode result = CURLE_OK;
 2229|   155k|  bool connected = FALSE;
  ------------------
  |  | 1058|   155k|#define FALSE false
  ------------------
 2230|   155k|  bool complete = FALSE;
  ------------------
  |  | 1058|   155k|#define FALSE false
  ------------------
 2231|       |  /* the ftp struct is inited in ftp_connect(). If we are connecting to an HTTP
 2232|       |   * proxy then the state will not be valid until after that connection is
 2233|       |   * complete */
 2234|       |
 2235|   155k|  if(!ftpc || !ftp)
  ------------------
  |  Branch (2235:6): [True: 0, False: 155k]
  |  Branch (2235:15): [True: 0, False: 155k]
  ------------------
 2236|      0|    return CURLE_FAILED_INIT;
 2237|       |
 2238|   155k|  *more = DOMORE_INCOMPLETE; /* default to stay in the state */
 2239|       |
 2240|       |  /* if the second connection has been set up, try to connect it fully
 2241|       |   * to the remote host. This may not complete at this time, for several
 2242|       |   * reasons:
 2243|       |   * - we do EPTR and the server will not connect to our listen socket
 2244|       |   *   until we send more FTP commands
 2245|       |   * - an SSL filter is in place and the server will not start the TLS
 2246|       |   *   handshake until we send more FTP commands
 2247|       |   */
 2248|   155k|  if(conn->cfilter[SECONDARYSOCKET]) {
  ------------------
  |  |  304|   155k|#define SECONDARYSOCKET 1
  ------------------
  |  Branch (2248:6): [True: 155k, False: 0]
  ------------------
 2249|   155k|    bool is_eptr = Curl_conn_is_tcp_listen(data, SECONDARYSOCKET);
  ------------------
  |  |  304|   155k|#define SECONDARYSOCKET 1
  ------------------
 2250|   155k|    result = Curl_conn_connect(data, SECONDARYSOCKET, FALSE, &connected);
  ------------------
  |  |  304|   155k|#define SECONDARYSOCKET 1
  ------------------
                  result = Curl_conn_connect(data, SECONDARYSOCKET, FALSE, &connected);
  ------------------
  |  | 1058|   155k|#define FALSE false
  ------------------
 2251|   155k|    if(result == CURLE_OUT_OF_MEMORY)
  ------------------
  |  Branch (2251:8): [True: 1, False: 155k]
  ------------------
 2252|      1|      return result;
 2253|   155k|    if(result || (!connected && !is_eptr &&
  ------------------
  |  Branch (2253:8): [True: 49, False: 155k]
  |  Branch (2253:19): [True: 152k, False: 2.42k]
  |  Branch (2253:33): [True: 152k, False: 0]
  ------------------
 2254|   152k|                  !Curl_conn_is_ip_connected(data, SECONDARYSOCKET))) {
  ------------------
  |  |  304|   152k|#define SECONDARYSOCKET 1
  ------------------
  |  Branch (2254:19): [True: 152k, False: 0]
  ------------------
 2255|   152k|      if(result && !is_eptr && (ftpc->count1 == 0)) {
  ------------------
  |  Branch (2255:10): [True: 49, False: 152k]
  |  Branch (2255:20): [True: 49, False: 0]
  |  Branch (2255:32): [True: 0, False: 49]
  ------------------
 2256|      0|        *more = DOMORE_GOBACK; /* go back to DOING please */
 2257|       |        /* this is a EPSV connect failing, try PASV instead */
 2258|      0|        return ftp_epsv_disable(data, ftpc, conn);
 2259|      0|      }
 2260|   152k|      return result;
 2261|   152k|    }
 2262|   155k|  }
 2263|       |
 2264|  2.42k|  if(ftpc->state) {
  ------------------
  |  Branch (2264:6): [True: 1.52k, False: 902]
  ------------------
 2265|       |    /* already in a state so skip the initial commands.
 2266|       |       They are only done to kickstart the do_more state */
 2267|  1.52k|    result = ftp_statemach(data, ftpc, &complete);
 2268|       |
 2269|  1.52k|    if(complete)
  ------------------
  |  Branch (2269:8): [True: 666, False: 857]
  ------------------
 2270|    666|      *more = DOMORE_DONE;
 2271|       |
 2272|       |    /* if we got an error or if we do not wait for a data connection return
 2273|       |       immediately */
 2274|  1.52k|    if(result || !ftpc->wait_data_conn)
  ------------------
  |  Branch (2274:8): [True: 149, False: 1.37k]
  |  Branch (2274:18): [True: 1.37k, False: 0]
  ------------------
 2275|  1.52k|      return result;
 2276|       |
 2277|       |    /* if we reach the end of the FTP state machine here, *complete will be
 2278|       |       TRUE but so is ftpc->wait_data_conn, which says we need to wait for the
 2279|       |       data connection and therefore we are not actually complete */
 2280|      0|    *more = DOMORE_INCOMPLETE;
 2281|      0|  }
 2282|       |
 2283|    902|  if(ftp->transfer <= PPTRANSFER_INFO) {
  ------------------
  |  Branch (2283:6): [True: 902, False: 0]
  ------------------
 2284|       |    /* a transfer is about to take place, or if not a filename was given so we
 2285|       |       will do a SIZE on it later and then we need the right TYPE first */
 2286|       |
 2287|    902|    if(ftpc->wait_data_conn) {
  ------------------
  |  Branch (2287:8): [True: 0, False: 902]
  ------------------
 2288|      0|      bool serv_conned;
 2289|       |
 2290|      0|      result = Curl_conn_connect(data, SECONDARYSOCKET, FALSE, &serv_conned);
  ------------------
  |  |  304|      0|#define SECONDARYSOCKET 1
  ------------------
                    result = Curl_conn_connect(data, SECONDARYSOCKET, FALSE, &serv_conned);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2291|      0|      if(result)
  ------------------
  |  Branch (2291:10): [True: 0, False: 0]
  ------------------
 2292|      0|        return result; /* Failed to accept data connection */
 2293|       |
 2294|      0|      if(serv_conned) {
  ------------------
  |  Branch (2294:10): [True: 0, False: 0]
  ------------------
 2295|       |        /* It looks data connection is established */
 2296|      0|        ftpc->wait_data_conn = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2297|      0|        result = ftp_initiate_transfer(data, ftpc);
 2298|       |
 2299|      0|        if(result)
  ------------------
  |  Branch (2299:12): [True: 0, False: 0]
  ------------------
 2300|      0|          return result;
 2301|       |
 2302|      0|        *more = DOMORE_DONE; /* this state is now complete when the server has
 2303|       |                                connected back to us */
 2304|      0|      }
 2305|      0|      else {
 2306|      0|        result = ftp_check_ctrl_on_data_wait(data, ftpc);
 2307|      0|        if(result)
  ------------------
  |  Branch (2307:12): [True: 0, False: 0]
  ------------------
 2308|      0|          return result;
 2309|      0|      }
 2310|      0|    }
 2311|    902|    else if(data->state.upload) {
  ------------------
  |  Branch (2311:13): [True: 42, False: 860]
  ------------------
 2312|     42|      result = ftp_nb_type(data, ftpc, ftp, (bool)data->state.prefer_ascii,
 2313|     42|                           FTP_STOR_TYPE);
 2314|     42|      if(result)
  ------------------
  |  Branch (2314:10): [True: 0, False: 42]
  ------------------
 2315|      0|        return result;
 2316|       |
 2317|     42|      result = ftp_statemach(data, ftpc, &complete);
 2318|       |      /* ftp_nb_type() might have skipped sending `TYPE A|I` when not
 2319|       |       * deemed necessary and directly sent `STORE name`. If this was
 2320|       |       * then complete, but we are still waiting on the data connection,
 2321|       |       * the transfer has not been initiated yet. */
 2322|     42|      *more = (!ftpc->wait_data_conn && complete) ?
  ------------------
  |  Branch (2322:16): [True: 42, False: 0]
  |  Branch (2322:41): [True: 0, False: 42]
  ------------------
 2323|     42|        DOMORE_DONE : DOMORE_INCOMPLETE;
 2324|     42|    }
 2325|    860|    else {
 2326|       |      /* download */
 2327|    860|      ftp->downloadsize = -1; /* unknown as of yet */
 2328|       |
 2329|    860|      result = Curl_range(data);
 2330|       |
 2331|    860|      if(result == CURLE_OK && data->req.maxdownload >= 0) {
  ------------------
  |  Branch (2331:10): [True: 847, False: 13]
  |  Branch (2331:32): [True: 248, False: 599]
  ------------------
 2332|       |        /* Do not check for successful transfer */
 2333|    248|        ftpc->dont_check = TRUE;
  ------------------
  |  | 1055|    248|#define TRUE true
  ------------------
 2334|    248|      }
 2335|       |
 2336|    860|      if(result)
  ------------------
  |  Branch (2336:10): [True: 13, False: 847]
  ------------------
 2337|     13|        ;
 2338|    847|      else if((data->state.list_only || !ftpc->file) &&
  ------------------
  |  Branch (2338:16): [True: 2, False: 845]
  |  Branch (2338:41): [True: 637, False: 208]
  ------------------
 2339|    639|              !(data->set.prequote)) {
  ------------------
  |  Branch (2339:15): [True: 639, False: 0]
  ------------------
 2340|       |        /* The specified path ends with a slash, and therefore we think this
 2341|       |           is a directory that is requested, use LIST. Before that, we also
 2342|       |           need to set ASCII transfer mode. */
 2343|       |
 2344|       |        /* Only if a body transfer was requested. */
 2345|    639|        if(ftp->transfer == PPTRANSFER_BODY) {
  ------------------
  |  Branch (2345:12): [True: 639, False: 0]
  ------------------
 2346|    639|          result = ftp_nb_type(data, ftpc, ftp, TRUE, FTP_LIST_TYPE);
  ------------------
  |  | 1055|    639|#define TRUE true
  ------------------
 2347|    639|          if(result)
  ------------------
  |  Branch (2347:14): [True: 0, False: 639]
  ------------------
 2348|      0|            return result;
 2349|    639|        }
 2350|       |        /* otherwise fall through */
 2351|    639|      }
 2352|    208|      else {
 2353|    208|        if(data->set.prequote && !ftpc->file) {
  ------------------
  |  Branch (2353:12): [True: 0, False: 208]
  |  Branch (2353:34): [True: 0, False: 0]
  ------------------
 2354|      0|          result = ftp_nb_type(data, ftpc, ftp, TRUE,
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2355|      0|                               FTP_RETR_LIST_TYPE);
 2356|      0|        }
 2357|    208|        else {
 2358|    208|          result = ftp_nb_type(data, ftpc, ftp, (bool)data->state.prefer_ascii,
 2359|    208|                               FTP_RETR_TYPE);
 2360|    208|        }
 2361|    208|        if(result)
  ------------------
  |  Branch (2361:12): [True: 0, False: 208]
  ------------------
 2362|      0|          return result;
 2363|    208|      }
 2364|       |
 2365|    860|      result = ftp_statemach(data, ftpc, &complete);
 2366|    860|      if(complete)
  ------------------
  |  Branch (2366:10): [True: 13, False: 847]
  ------------------
 2367|     13|        *more = DOMORE_DONE;
 2368|    860|    }
 2369|    902|    return result;
 2370|    902|  }
 2371|       |
 2372|       |  /* no data to transfer */
 2373|      0|  Curl_xfer_setup_nop(data);
 2374|       |
 2375|      0|  if(!ftpc->wait_data_conn) {
  ------------------
  |  Branch (2375:6): [True: 0, False: 0]
  ------------------
 2376|       |    /* no waiting for the data connection so this is now complete */
 2377|      0|    *more = DOMORE_DONE;
 2378|      0|    CURL_TRC_FTP(data, "[%s] DO-MORE phase ends with %d", FTP_CSTATE(ftpc),
  ------------------
  |  |  180|      0|  do {                                                   \
  |  |  181|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|      0|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (182:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  183|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2379|      0|                 (int)result);
 2380|      0|  }
 2381|       |
 2382|      0|  return result;
 2383|    902|}
ftp.c:ftp_epsv_disable:
 1981|  1.03k|{
 1982|  1.03k|  CURLcode result = CURLE_OK;
 1983|       |
 1984|  1.03k|  if(conn->bits.ipv6
  ------------------
  |  Branch (1984:6): [True: 0, False: 1.03k]
  ------------------
 1985|      0|#ifndef CURL_DISABLE_PROXY
 1986|      0|     && !(conn->bits.tunnel_proxy || conn->bits.socksproxy)
  ------------------
  |  Branch (1986:11): [True: 0, False: 0]
  |  Branch (1986:38): [True: 0, False: 0]
  ------------------
 1987|  1.03k|#endif
 1988|  1.03k|    ) {
 1989|       |    /* We cannot disable EPSV when doing IPv6, so this is instead a fail */
 1990|      0|    failf(data, "Failed EPSV attempt, exiting");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1991|      0|    return CURLE_WEIRD_SERVER_REPLY;
 1992|      0|  }
 1993|       |
 1994|  1.03k|  infof(data, "Failed EPSV attempt. Disabling EPSV");
  ------------------
  |  |  143|  1.03k|  do {                               \
  |  |  144|  1.03k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  1.03k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 1.03k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.03k]
  |  |  |  |  ------------------
  |  |  |  |  320|  1.03k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.03k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  1.03k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1.03k]
  |  |  ------------------
  ------------------
 1995|       |  /* disable it for next transfer */
 1996|  1.03k|  conn->bits.ftp_use_epsv = FALSE;
  ------------------
  |  | 1058|  1.03k|#define FALSE false
  ------------------
 1997|  1.03k|  close_secondarysocket(data, ftpc);
 1998|  1.03k|  data->state.errorbuf = FALSE; /* allow error message to get
  ------------------
  |  | 1058|  1.03k|#define FALSE false
  ------------------
 1999|       |                                         rewritten */
 2000|  1.03k|  result = Curl_pp_sendf(data, &ftpc->pp, "%s", "PASV");
 2001|  1.03k|  if(!result) {
  ------------------
  |  Branch (2001:6): [True: 1.03k, False: 0]
  ------------------
 2002|  1.03k|    ftpc->count1++;
 2003|       |    /* remain in/go to the FTP_PASV state */
 2004|  1.03k|    ftp_state(data, ftpc, FTP_PASV);
  ------------------
  |  |  159|  1.03k|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 2005|  1.03k|  }
 2006|  1.03k|  return result;
 2007|  1.03k|}
ftp.c:ftp_initiate_transfer:
  546|    664|{
  547|    664|  CURLcode result = CURLE_OK;
  548|    664|  bool connected;
  549|       |
  550|    664|  CURL_TRC_FTP(data, "ftp_initiate_transfer()");
  ------------------
  |  |  180|    664|  do {                                                   \
  |  |  181|    664|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|    664|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  1.32k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 664, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 664]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  1.32k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    664|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|    664|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  183|    664|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 664]
  |  |  ------------------
  ------------------
  551|    664|  result = Curl_conn_connect(data, SECONDARYSOCKET, TRUE, &connected);
  ------------------
  |  |  304|    664|#define SECONDARYSOCKET 1
  ------------------
                result = Curl_conn_connect(data, SECONDARYSOCKET, TRUE, &connected);
  ------------------
  |  | 1055|    664|#define TRUE true
  ------------------
  552|    664|  if(result || !connected)
  ------------------
  |  Branch (552:6): [True: 0, False: 664]
  |  Branch (552:16): [True: 0, False: 664]
  ------------------
  553|      0|    return result;
  554|       |
  555|    664|  if(data->state.upload) {
  ------------------
  |  Branch (555:6): [True: 34, False: 630]
  ------------------
  556|       |    /* When we know we are uploading a specified file, we can get the file
  557|       |       size prior to the actual upload. */
  558|     34|    Curl_pgrsSetUploadSize(data, data->state.infilesize);
  559|       |
  560|       |    /* FTP upload, shutdown DATA, ignore shutdown errors, as we rely
  561|       |     * on the server response on the CONTROL connection. */
  562|     34|    Curl_xfer_setup_send(data, SECONDARYSOCKET);
  ------------------
  |  |  304|     34|#define SECONDARYSOCKET 1
  ------------------
  563|     34|    Curl_xfer_set_shutdown(data, TRUE, TRUE);
  ------------------
  |  | 1055|     34|#define TRUE true
  ------------------
                  Curl_xfer_set_shutdown(data, TRUE, TRUE);
  ------------------
  |  | 1055|     34|#define TRUE true
  ------------------
  564|     34|  }
  565|    630|  else {
  566|       |    /* FTP download, shutdown, do not ignore errors */
  567|    630|    Curl_xfer_setup_recv(data, SECONDARYSOCKET, data->req.size);
  ------------------
  |  |  304|    630|#define SECONDARYSOCKET 1
  ------------------
  568|    630|    Curl_xfer_set_shutdown(data, TRUE, FALSE);
  ------------------
  |  | 1055|    630|#define TRUE true
  ------------------
                  Curl_xfer_set_shutdown(data, TRUE, FALSE);
  ------------------
  |  | 1058|    630|#define FALSE false
  ------------------
  569|    630|  }
  570|       |
  571|    664|  ftpc->pp.pending_resp = TRUE; /* expect server response */
  ------------------
  |  | 1055|    664|#define TRUE true
  ------------------
  572|    664|  ftp_state(data, ftpc, FTP_STOP);
  ------------------
  |  |  159|    664|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
  573|       |
  574|    664|  return CURLE_OK;
  575|    664|}
ftp.c:ftp_connect:
 3512|  2.13k|{
 3513|  2.13k|  CURLcode result;
 3514|  2.13k|  struct connectdata *conn = data->conn;
 3515|  2.13k|  struct ftp_conn *ftpc = Curl_conn_meta_get(data->conn, CURL_META_FTP_CONN);
  ------------------
  |  |  156|  2.13k|#define CURL_META_FTP_CONN   "meta:proto:ftp:conn"
  ------------------
 3516|  2.13k|  struct pingpong *pp;
 3517|       |
 3518|  2.13k|  *done = FALSE; /* default to not done yet */
  ------------------
  |  | 1058|  2.13k|#define FALSE false
  ------------------
 3519|  2.13k|  if(!ftpc)
  ------------------
  |  Branch (3519:6): [True: 0, False: 2.13k]
  ------------------
 3520|      0|    return CURLE_FAILED_INIT;
 3521|  2.13k|  pp = &ftpc->pp;
 3522|  2.13k|  PINGPONG_SETUP(pp, ftp_pp_statemachine, ftp_endofresp);
  ------------------
  |  |   78|  2.13k|  do {                           \
  |  |   79|  2.13k|    (pp)->statemachine = s;      \
  |  |   80|  2.13k|    (pp)->endofresp = e;         \
  |  |   81|  2.13k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (81:11): [Folded, False: 2.13k]
  |  |  ------------------
  ------------------
 3523|       |
 3524|  2.13k|  if(Curl_conn_is_ssl(conn, FIRSTSOCKET)) {
  ------------------
  |  |  303|  2.13k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (3524:6): [True: 0, False: 2.13k]
  ------------------
 3525|       |    /* BLOCKING */
 3526|      0|    result = Curl_conn_connect(data, FIRSTSOCKET, TRUE, done);
  ------------------
  |  |  303|      0|#define FIRSTSOCKET     0
  ------------------
                  result = Curl_conn_connect(data, FIRSTSOCKET, TRUE, done);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 3527|      0|    if(result)
  ------------------
  |  Branch (3527:8): [True: 0, False: 0]
  ------------------
 3528|      0|      return result;
 3529|      0|  }
 3530|       |
 3531|  2.13k|  Curl_pp_init(pp, Curl_pgrs_now(data)); /* once per transfer */
 3532|       |
 3533|       |  /* When we connect, we start in the state where we await the 220
 3534|       |     response */
 3535|  2.13k|  ftp_state(data, ftpc, FTP_WAIT220);
  ------------------
  |  |  159|  2.13k|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 3536|       |
 3537|  2.13k|  result = ftp_statemach(data, ftpc, done);
 3538|       |
 3539|  2.13k|  return result;
 3540|  2.13k|}
ftp.c:ftp_pp_statemachine:
 3159|  15.9k|{
 3160|  15.9k|  CURLcode result;
 3161|  15.9k|  int ftpcode;
 3162|  15.9k|  struct ftp_conn *ftpc = Curl_conn_meta_get(conn, CURL_META_FTP_CONN);
  ------------------
  |  |  156|  15.9k|#define CURL_META_FTP_CONN   "meta:proto:ftp:conn"
  ------------------
 3163|  15.9k|  struct FTP *ftp = Curl_meta_get(data, CURL_META_FTP_EASY);
  ------------------
  |  |  154|  15.9k|#define CURL_META_FTP_EASY   "meta:proto:ftp:easy"
  ------------------
 3164|  15.9k|  struct pingpong *pp;
 3165|  15.9k|  size_t nread = 0;
 3166|       |
 3167|  15.9k|  if(!ftpc || !ftp)
  ------------------
  |  Branch (3167:6): [True: 0, False: 15.9k]
  |  Branch (3167:15): [True: 873, False: 15.0k]
  ------------------
 3168|    873|    return CURLE_FAILED_INIT;
 3169|  15.0k|  pp = &ftpc->pp;
 3170|  15.0k|  if(pp->sendleft)
  ------------------
  |  Branch (3170:6): [True: 0, False: 15.0k]
  ------------------
 3171|      0|    return Curl_pp_flushsend(data, pp);
 3172|       |
 3173|  15.0k|  result = ftp_readresp(data, ftpc, FIRSTSOCKET, pp, &ftpcode, &nread);
  ------------------
  |  |  303|  15.0k|#define FIRSTSOCKET     0
  ------------------
 3174|  15.0k|  if(result || !ftpcode)
  ------------------
  |  Branch (3174:6): [True: 915, False: 14.1k]
  |  Branch (3174:16): [True: 6.55k, False: 7.60k]
  ------------------
 3175|  7.46k|    return result;
 3176|       |
 3177|       |  /* we have now received a full FTP server response */
 3178|  7.60k|  switch(ftpc->state) {
 3179|  1.56k|  case FTP_WAIT220:
  ------------------
  |  Branch (3179:3): [True: 1.56k, False: 6.04k]
  ------------------
 3180|  1.56k|    result = ftp_wait_resp(data, conn, ftpc, ftpcode);
 3181|  1.56k|    break;
 3182|       |
 3183|      8|  case FTP_AUTH:
  ------------------
  |  Branch (3183:3): [True: 8, False: 7.59k]
  ------------------
 3184|       |    /* we have gotten the response to a previous AUTH command */
 3185|       |
 3186|      8|    if(pp->overflow)
  ------------------
  |  Branch (3186:8): [True: 1, False: 7]
  ------------------
 3187|      1|      return CURLE_WEIRD_SERVER_REPLY; /* Forbid pipelining in response. */
 3188|       |
 3189|       |    /* RFC2228 (page 5) says:
 3190|       |     *
 3191|       |     * If the server is willing to accept the named security mechanism,
 3192|       |     * and does not require any security data, it must respond with
 3193|       |     * reply code 234/334.
 3194|       |     */
 3195|       |
 3196|      7|    if((ftpcode == 234) || (ftpcode == 334)) {
  ------------------
  |  Branch (3196:8): [True: 1, False: 6]
  |  Branch (3196:28): [True: 1, False: 5]
  ------------------
 3197|       |      /* this was BLOCKING, keep it so for now */
 3198|      2|      bool done;
 3199|      2|      if(!Curl_conn_is_ssl(conn, FIRSTSOCKET)) {
  ------------------
  |  |  303|      2|#define FIRSTSOCKET     0
  ------------------
  |  Branch (3199:10): [True: 2, False: 0]
  ------------------
 3200|      2|        result = Curl_ssl_cfilter_add(data, conn, FIRSTSOCKET);
  ------------------
  |  |  303|      2|#define FIRSTSOCKET     0
  ------------------
 3201|      2|        if(result) {
  ------------------
  |  Branch (3201:12): [True: 0, False: 2]
  ------------------
 3202|       |          /* we failed and bail out */
 3203|      0|          return CURLE_USE_SSL_FAILED;
 3204|      0|        }
 3205|      2|      }
 3206|       |      /* BLOCKING */
 3207|      2|      result = Curl_conn_connect(data, FIRSTSOCKET, TRUE, &done);
  ------------------
  |  |  303|      2|#define FIRSTSOCKET     0
  ------------------
                    result = Curl_conn_connect(data, FIRSTSOCKET, TRUE, &done);
  ------------------
  |  | 1055|      2|#define TRUE true
  ------------------
 3208|      2|      if(!result) {
  ------------------
  |  Branch (3208:10): [True: 0, False: 2]
  ------------------
 3209|      0|        conn->bits.ftp_use_data_ssl = FALSE; /* clear-text data */
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 3210|      0|        result = ftp_state_user(data, ftpc, conn);
 3211|      0|      }
 3212|      2|    }
 3213|      5|    else if(ftpc->count3 < 1) {
  ------------------
  |  Branch (3213:13): [True: 3, False: 2]
  ------------------
 3214|      3|      ftpc->count3++;
 3215|      3|      ftpc->count1 += ftpc->count2; /* get next attempt */
 3216|      3|      result = Curl_pp_sendf(data, &ftpc->pp, "AUTH %s",
 3217|      3|                             ftpauth[ftpc->count1]);
 3218|       |      /* remain in this same state */
 3219|      3|    }
 3220|      2|    else {
 3221|      2|      if(data->set.use_ssl > CURLUSESSL_TRY)
  ------------------
  |  |  925|      2|#define CURLUSESSL_TRY     1L /* try using SSL, proceed anyway otherwise */
  ------------------
  |  Branch (3221:10): [True: 1, False: 1]
  ------------------
 3222|       |        /* we failed and CURLUSESSL_CONTROL or CURLUSESSL_ALL is set */
 3223|      1|        result = CURLE_USE_SSL_FAILED;
 3224|      1|      else
 3225|       |        /* ignore the failure and continue */
 3226|      1|        result = ftp_state_user(data, ftpc, conn);
 3227|      2|    }
 3228|      7|    break;
 3229|       |
 3230|    264|  case FTP_USER:
  ------------------
  |  Branch (3230:3): [True: 264, False: 7.33k]
  ------------------
 3231|    269|  case FTP_PASS:
  ------------------
  |  Branch (3231:3): [True: 5, False: 7.59k]
  ------------------
 3232|    269|    result = ftp_state_user_resp(data, ftpc, ftpcode);
 3233|    269|    break;
 3234|       |
 3235|      0|  case FTP_ACCT:
  ------------------
  |  Branch (3235:3): [True: 0, False: 7.60k]
  ------------------
 3236|      0|    result = ftp_state_acct_resp(data, ftpc, ftpcode);
 3237|      0|    break;
 3238|       |
 3239|      0|  case FTP_PBSZ:
  ------------------
  |  Branch (3239:3): [True: 0, False: 7.60k]
  ------------------
 3240|      0|    result =
 3241|      0|      Curl_pp_sendf(data, &ftpc->pp, "PROT %c",
 3242|      0|                    data->set.use_ssl == CURLUSESSL_CONTROL ? 'C' : 'P');
  ------------------
  |  |  926|      0|#define CURLUSESSL_CONTROL 2L /* SSL for the control connection or fail */
  ------------------
  |  Branch (3242:21): [True: 0, False: 0]
  ------------------
 3243|      0|    if(!result)
  ------------------
  |  Branch (3243:8): [True: 0, False: 0]
  ------------------
 3244|      0|      ftp_state(data, ftpc, FTP_PROT);
  ------------------
  |  |  159|      0|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 3245|      0|    break;
 3246|       |
 3247|      0|  case FTP_PROT:
  ------------------
  |  Branch (3247:3): [True: 0, False: 7.60k]
  ------------------
 3248|      0|    if(ftpcode / 100 == 2)
  ------------------
  |  Branch (3248:8): [True: 0, False: 0]
  ------------------
 3249|       |      /* We have enabled SSL for the data connection! */
 3250|      0|      conn->bits.ftp_use_data_ssl = (data->set.use_ssl != CURLUSESSL_CONTROL);
  ------------------
  |  |  926|      0|#define CURLUSESSL_CONTROL 2L /* SSL for the control connection or fail */
  ------------------
 3251|       |    /* FTP servers typically responds with 500 if they decide to reject
 3252|       |       our 'P' request */
 3253|      0|    else if(data->set.use_ssl > CURLUSESSL_CONTROL)
  ------------------
  |  |  926|      0|#define CURLUSESSL_CONTROL 2L /* SSL for the control connection or fail */
  ------------------
  |  Branch (3253:13): [True: 0, False: 0]
  ------------------
 3254|       |      /* we failed and bails out */
 3255|      0|      return CURLE_USE_SSL_FAILED;
 3256|       |
 3257|      0|    if(data->set.ftp_ccc) {
  ------------------
  |  Branch (3257:8): [True: 0, False: 0]
  ------------------
 3258|       |      /* CCC - Clear Command Channel
 3259|       |       */
 3260|      0|      result = Curl_pp_sendf(data, &ftpc->pp, "%s", "CCC");
 3261|      0|      if(!result)
  ------------------
  |  Branch (3261:10): [True: 0, False: 0]
  ------------------
 3262|      0|        ftp_state(data, ftpc, FTP_CCC);
  ------------------
  |  |  159|      0|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 3263|      0|    }
 3264|      0|    else
 3265|      0|      result = ftp_state_pwd(data, ftpc);
 3266|      0|    break;
 3267|       |
 3268|      0|  case FTP_CCC:
  ------------------
  |  Branch (3268:3): [True: 0, False: 7.60k]
  ------------------
 3269|      0|    if(ftpcode < 500) {
  ------------------
  |  Branch (3269:8): [True: 0, False: 0]
  ------------------
 3270|       |      /* First shut down the SSL layer (note: this call will block) */
 3271|       |      /* This has only been tested on the proftpd server, and the mod_tls
 3272|       |       * code sends a close notify alert without waiting for a close notify
 3273|       |       * alert in response. Thus we wait for a close notify alert from the
 3274|       |       * server, but we do not send one. Let's hope other servers do
 3275|       |       * the same... */
 3276|      0|      result = Curl_ssl_cfilter_remove(data, FIRSTSOCKET,
  ------------------
  |  |  303|      0|#define FIRSTSOCKET     0
  ------------------
 3277|      0|                                       (data->set.ftp_ccc ==
 3278|      0|                                        (unsigned char)CURLFTPSSL_CCC_ACTIVE));
  ------------------
  |  |  991|      0|#define CURLFTPSSL_CCC_ACTIVE  2L /* Initiate the shutdown */
  ------------------
 3279|      0|      if(result)
  ------------------
  |  Branch (3279:10): [True: 0, False: 0]
  ------------------
 3280|      0|        failf(data, "Failed to clear the command channel (CCC)");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3281|      0|    }
 3282|      0|    if(!result)
  ------------------
  |  Branch (3282:8): [True: 0, False: 0]
  ------------------
 3283|       |      /* Then continue as normal */
 3284|      0|      result = ftp_state_pwd(data, ftpc);
 3285|      0|    break;
 3286|       |
 3287|  1.49k|  case FTP_PWD:
  ------------------
  |  Branch (3287:3): [True: 1.49k, False: 6.11k]
  ------------------
 3288|  1.49k|    result = ftp_pwd_resp(data, ftpc, ftpcode);
 3289|  1.49k|    break;
 3290|       |
 3291|     18|  case FTP_SYST:
  ------------------
  |  Branch (3291:3): [True: 18, False: 7.58k]
  ------------------
 3292|     18|    if(ftpcode == 215) {
  ------------------
  |  Branch (3292:8): [True: 12, False: 6]
  ------------------
 3293|     12|      const char *ptr = curlx_dyn_ptr(&pp->recvbuf) + 4; /* start on the first
 3294|       |                                                            letter */
 3295|     12|      const char *start;
 3296|     12|      char *os;
 3297|       |
 3298|       |      /* Reply format is like
 3299|       |         215<space><OS-name><space><commentary>
 3300|       |      */
 3301|     84|      while(*ptr == ' ')
  ------------------
  |  Branch (3301:13): [True: 72, False: 12]
  ------------------
 3302|     72|        ptr++;
 3303|    250|      for(start = ptr; *ptr && *ptr != ' '; ptr++)
  ------------------
  |  Branch (3303:24): [True: 243, False: 7]
  |  Branch (3303:32): [True: 238, False: 5]
  ------------------
 3304|    238|        ;
 3305|     12|      os = curlx_memdup0(start, ptr - start);
 3306|     12|      if(!os)
  ------------------
  |  Branch (3306:10): [True: 0, False: 12]
  ------------------
 3307|      0|        return CURLE_OUT_OF_MEMORY;
 3308|       |
 3309|       |      /* Check for special servers here. */
 3310|     12|      if(curl_strequal(os, "OS/400")) {
  ------------------
  |  Branch (3310:10): [True: 0, False: 12]
  ------------------
 3311|       |        /* Force OS400 name format 1. */
 3312|      0|        result = Curl_pp_sendf(data, &ftpc->pp, "%s", "SITE NAMEFMT 1");
 3313|      0|        if(result) {
  ------------------
  |  Branch (3313:12): [True: 0, False: 0]
  ------------------
 3314|      0|          curlx_free(os);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3315|      0|          return result;
 3316|      0|        }
 3317|       |        /* remember target server OS */
 3318|      0|        curlx_free(ftpc->server_os);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3319|      0|        ftpc->server_os = os;
 3320|      0|        ftp_state(data, ftpc, FTP_NAMEFMT);
  ------------------
  |  |  159|      0|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 3321|      0|        break;
 3322|      0|      }
 3323|       |      /* Nothing special for the target server. */
 3324|       |      /* remember target server OS */
 3325|     12|      curlx_free(ftpc->server_os);
  ------------------
  |  | 1483|     12|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3326|     12|      ftpc->server_os = os;
 3327|     12|    }
 3328|      6|    else {
 3329|       |      /* Cannot identify server OS. Continue anyway and cross fingers. */
 3330|      6|    }
 3331|       |
 3332|     18|    ftp_state(data, ftpc, FTP_STOP); /* we are done with CONNECT phase! */
  ------------------
  |  |  159|     18|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 3333|     18|    CURL_TRC_FTP(data, "[%s] protocol connect phase DONE", FTP_CSTATE(ftpc));
  ------------------
  |  |  180|     18|  do {                                                   \
  |  |  181|     18|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|     18|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     36|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 18, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 18]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     36|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|     18|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|     18|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (182:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  183|     18|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 18]
  |  |  ------------------
  ------------------
 3334|     18|    break;
 3335|       |
 3336|      0|  case FTP_NAMEFMT:
  ------------------
  |  Branch (3336:3): [True: 0, False: 7.60k]
  ------------------
 3337|      0|    if(ftpcode == 250) {
  ------------------
  |  Branch (3337:8): [True: 0, False: 0]
  ------------------
 3338|       |      /* Name format change successful: reload initial path. */
 3339|      0|      ftp_state_pwd(data, ftpc);
 3340|      0|      break;
 3341|      0|    }
 3342|       |
 3343|      0|    ftp_state(data, ftpc, FTP_STOP); /* we are done with CONNECT phase! */
  ------------------
  |  |  159|      0|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 3344|      0|    CURL_TRC_FTP(data, "[%s] protocol connect phase DONE", FTP_CSTATE(ftpc));
  ------------------
  |  |  180|      0|  do {                                                   \
  |  |  181|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|      0|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (182:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  183|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3345|      0|    break;
 3346|       |
 3347|      0|  case FTP_QUOTE:
  ------------------
  |  Branch (3347:3): [True: 0, False: 7.60k]
  ------------------
 3348|      0|  case FTP_POSTQUOTE:
  ------------------
  |  Branch (3348:3): [True: 0, False: 7.60k]
  ------------------
 3349|      0|  case FTP_RETR_PREQUOTE:
  ------------------
  |  Branch (3349:3): [True: 0, False: 7.60k]
  ------------------
 3350|      0|  case FTP_STOR_PREQUOTE:
  ------------------
  |  Branch (3350:3): [True: 0, False: 7.60k]
  ------------------
 3351|      0|  case FTP_LIST_PREQUOTE:
  ------------------
  |  Branch (3351:3): [True: 0, False: 7.60k]
  ------------------
 3352|      0|    if((ftpcode >= 400) && !ftpc->count2) {
  ------------------
  |  Branch (3352:8): [True: 0, False: 0]
  |  Branch (3352:28): [True: 0, False: 0]
  ------------------
 3353|       |      /* failure response code, and not allowed to fail */
 3354|      0|      failf(data, "QUOT command failed with %03d", ftpcode);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3355|      0|      result = CURLE_QUOTE_ERROR;
 3356|      0|    }
 3357|      0|    else
 3358|      0|      result = ftp_state_quote(data, ftpc, ftp, FALSE, ftpc->state);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 3359|      0|    break;
 3360|       |
 3361|    258|  case FTP_CWD:
  ------------------
  |  Branch (3361:3): [True: 258, False: 7.34k]
  ------------------
 3362|    258|    if(ftpcode / 100 != 2) {
  ------------------
  |  Branch (3362:8): [True: 27, False: 231]
  ------------------
 3363|       |      /* failure to CWD there */
 3364|     27|      if(data->set.ftp_create_missing_dirs &&
  ------------------
  |  Branch (3364:10): [True: 14, False: 13]
  ------------------
 3365|     14|         ftpc->cwdcount && !ftpc->count2) {
  ------------------
  |  Branch (3365:10): [True: 14, False: 0]
  |  Branch (3365:28): [True: 13, False: 1]
  ------------------
 3366|       |        /* try making it */
 3367|     13|        ftpc->count2++; /* counter to prevent CWD-MKD loops */
 3368|       |
 3369|       |        /* count3 is set to allow MKD to fail once per dir. In the case when
 3370|       |           CWD fails and then MKD fails (due to another session raced it to
 3371|       |           create the dir) this then allows for a second try to CWD to it. */
 3372|     13|        ftpc->count3 = (data->set.ftp_create_missing_dirs == 2) ? 1 : 0;
  ------------------
  |  Branch (3372:24): [True: 7, False: 6]
  ------------------
 3373|       |
 3374|     13|        result = Curl_pp_sendf(data, &ftpc->pp, "MKD %.*s",
 3375|     13|                               pathlen(ftpc, ftpc->cwdcount - 1),
 3376|     13|                               pathpiece(ftpc, ftpc->cwdcount - 1));
 3377|     13|        if(!result)
  ------------------
  |  Branch (3377:12): [True: 13, False: 0]
  ------------------
 3378|     13|          ftp_state(data, ftpc, FTP_MKD);
  ------------------
  |  |  159|     13|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 3379|     13|      }
 3380|     14|      else {
 3381|       |        /* return failure */
 3382|     14|        failf(data, "Server denied you to change to the given directory");
  ------------------
  |  |   62|     14|#define failf Curl_failf
  ------------------
 3383|     14|        ftpc->cwdfail = TRUE; /* do not remember this path as we failed
  ------------------
  |  | 1055|     14|#define TRUE true
  ------------------
 3384|       |                                 to enter it */
 3385|     14|        result = CURLE_REMOTE_ACCESS_DENIED;
 3386|     14|      }
 3387|     27|    }
 3388|    231|    else {
 3389|       |      /* success */
 3390|    231|      ftpc->count2 = 0;
 3391|    231|      if(ftpc->cwdcount >= ftpc->dirdepth)
  ------------------
  |  Branch (3391:10): [True: 212, False: 19]
  ------------------
 3392|    212|        result = ftp_state_mdtm(data, ftpc, ftp);
 3393|     19|      else {
 3394|     19|        ftpc->cwdcount++;
 3395|       |        /* send next CWD */
 3396|     19|        result = Curl_pp_sendf(data, &ftpc->pp, "CWD %.*s",
 3397|     19|                               pathlen(ftpc, ftpc->cwdcount - 1),
 3398|     19|                               pathpiece(ftpc, ftpc->cwdcount - 1));
 3399|     19|      }
 3400|    231|    }
 3401|    258|    break;
 3402|       |
 3403|     12|  case FTP_MKD:
  ------------------
  |  Branch (3403:3): [True: 12, False: 7.59k]
  ------------------
 3404|     12|    if((ftpcode / 100 != 2) && !ftpc->count3--) {
  ------------------
  |  Branch (3404:8): [True: 8, False: 4]
  |  Branch (3404:32): [True: 2, False: 6]
  ------------------
 3405|       |      /* failure to MKD the directory */
 3406|      2|      failf(data, "Failed to MKD dir: %03d", ftpcode);
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
 3407|      2|      result = CURLE_REMOTE_ACCESS_DENIED;
 3408|      2|    }
 3409|     10|    else {
 3410|     10|      ftp_state(data, ftpc, FTP_CWD);
  ------------------
  |  |  159|     10|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 3411|       |      /* send CWD */
 3412|     10|      result = Curl_pp_sendf(data, &ftpc->pp, "CWD %.*s",
 3413|     10|                             pathlen(ftpc, ftpc->cwdcount - 1),
 3414|     10|                             pathpiece(ftpc, ftpc->cwdcount - 1));
 3415|     10|    }
 3416|     12|    break;
 3417|       |
 3418|     60|  case FTP_MDTM:
  ------------------
  |  Branch (3418:3): [True: 60, False: 7.54k]
  ------------------
 3419|     60|    result = ftp_state_mdtm_resp(data, ftpc, ftp, ftpcode);
 3420|     60|    break;
 3421|       |
 3422|     47|  case FTP_TYPE:
  ------------------
  |  Branch (3422:3): [True: 47, False: 7.55k]
  ------------------
 3423|    685|  case FTP_LIST_TYPE:
  ------------------
  |  Branch (3423:3): [True: 638, False: 6.96k]
  ------------------
 3424|    886|  case FTP_RETR_TYPE:
  ------------------
  |  Branch (3424:3): [True: 201, False: 7.40k]
  ------------------
 3425|    924|  case FTP_STOR_TYPE:
  ------------------
  |  Branch (3425:3): [True: 38, False: 7.56k]
  ------------------
 3426|    924|  case FTP_RETR_LIST_TYPE:
  ------------------
  |  Branch (3426:3): [True: 0, False: 7.60k]
  ------------------
 3427|    924|    result = ftp_state_type_resp(data, ftpc, ftp, ftpcode, ftpc->state);
 3428|    924|    break;
 3429|       |
 3430|     44|  case FTP_SIZE:
  ------------------
  |  Branch (3430:3): [True: 44, False: 7.55k]
  ------------------
 3431|    207|  case FTP_RETR_SIZE:
  ------------------
  |  Branch (3431:3): [True: 163, False: 7.44k]
  ------------------
 3432|    207|  case FTP_STOR_SIZE:
  ------------------
  |  Branch (3432:3): [True: 0, False: 7.60k]
  ------------------
 3433|    207|    result = ftp_state_size_resp(data, ftpc, ftp, ftpcode, ftpc->state);
 3434|    207|    break;
 3435|       |
 3436|      6|  case FTP_REST:
  ------------------
  |  Branch (3436:3): [True: 6, False: 7.59k]
  ------------------
 3437|      7|  case FTP_RETR_REST:
  ------------------
  |  Branch (3437:3): [True: 1, False: 7.60k]
  ------------------
 3438|      7|    result = ftp_state_rest_resp(data, ftpc, ftp, ftpcode, ftpc->state);
 3439|      7|    break;
 3440|       |
 3441|      2|  case FTP_PRET:
  ------------------
  |  Branch (3441:3): [True: 2, False: 7.60k]
  ------------------
 3442|      2|    if(ftpcode != 200) {
  ------------------
  |  Branch (3442:8): [True: 1, False: 1]
  ------------------
 3443|       |      /* there only is this one standard OK return code. */
 3444|      1|      failf(data, "PRET command not accepted: %03d", ftpcode);
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
 3445|      1|      return CURLE_FTP_PRET_FAILED;
 3446|      1|    }
 3447|      1|    result = ftp_state_use_pasv(data, ftpc, conn);
 3448|      1|    break;
 3449|       |
 3450|  2.08k|  case FTP_PASV:
  ------------------
  |  Branch (3450:3): [True: 2.08k, False: 5.51k]
  ------------------
 3451|  2.08k|    result = ftp_state_pasv_resp(data, ftpc, ftpcode);
 3452|  2.08k|    break;
 3453|       |
 3454|      0|  case FTP_PORT:
  ------------------
  |  Branch (3454:3): [True: 0, False: 7.60k]
  ------------------
 3455|      0|    result = ftp_state_port_resp(data, ftpc, ftp, ftpcode);
 3456|      0|    break;
 3457|       |
 3458|    593|  case FTP_LIST:
  ------------------
  |  Branch (3458:3): [True: 593, False: 7.01k]
  ------------------
 3459|    652|  case FTP_RETR:
  ------------------
  |  Branch (3459:3): [True: 59, False: 7.54k]
  ------------------
 3460|    652|    result = ftp_state_get_resp(data, ftpc, ftp, ftpcode, ftpc->state);
 3461|    652|    break;
 3462|       |
 3463|     35|  case FTP_STOR:
  ------------------
  |  Branch (3463:3): [True: 35, False: 7.56k]
  ------------------
 3464|     35|    result = ftp_state_stor_resp(data, ftpc, ftpcode);
 3465|     35|    break;
 3466|       |
 3467|      0|  case FTP_QUIT:
  ------------------
  |  Branch (3467:3): [True: 0, False: 7.60k]
  ------------------
 3468|     13|  default:
  ------------------
  |  Branch (3468:3): [True: 13, False: 7.59k]
  ------------------
 3469|       |    /* internal error */
 3470|     13|    ftp_state(data, ftpc, FTP_STOP);
  ------------------
  |  |  159|     13|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 3471|     13|    break;
 3472|  7.60k|  }
 3473|       |
 3474|  7.60k|  return result;
 3475|  7.60k|}
ftp.c:ftp_wait_resp:
 3114|  1.56k|{
 3115|  1.56k|  CURLcode result = CURLE_OK;
 3116|  1.56k|  if(ftpcode == 230) {
  ------------------
  |  Branch (3116:6): [True: 1.26k, False: 295]
  ------------------
 3117|       |    /* 230 User logged in - already! Take as 220 if TLS required. */
 3118|  1.26k|    if(data->set.use_ssl <= CURLUSESSL_TRY ||
  ------------------
  |  |  925|  2.53k|#define CURLUSESSL_TRY     1L /* try using SSL, proceed anyway otherwise */
  ------------------
  |  Branch (3118:8): [True: 1.26k, False: 4]
  ------------------
 3119|      4|       Curl_conn_is_ssl(conn, FIRSTSOCKET))
  ------------------
  |  |  303|      4|#define FIRSTSOCKET     0
  ------------------
  |  Branch (3119:8): [True: 0, False: 4]
  ------------------
 3120|  1.26k|      return ftp_state_user_resp(data, ftpc, ftpcode);
 3121|  1.26k|  }
 3122|    295|  else if(ftpcode != 220) {
  ------------------
  |  Branch (3122:11): [True: 27, False: 268]
  ------------------
 3123|     27|    failf(data, "Got a %03d ftp-server response when 220 was expected",
  ------------------
  |  |   62|     27|#define failf Curl_failf
  ------------------
 3124|     27|          ftpcode);
 3125|     27|    return CURLE_WEIRD_SERVER_REPLY;
 3126|     27|  }
 3127|       |
 3128|    272|  if(data->set.use_ssl && !Curl_conn_is_ssl(conn, FIRSTSOCKET)) {
  ------------------
  |  |  303|      6|#define FIRSTSOCKET     0
  ------------------
  |  Branch (3128:6): [True: 6, False: 266]
  |  Branch (3128:27): [True: 6, False: 0]
  ------------------
 3129|       |    /* We do not have an SSL/TLS control connection yet, but FTPS is
 3130|       |       requested. Try an FTPS connection now */
 3131|       |
 3132|      6|    ftpc->count3 = 0;
 3133|      6|    switch((long)data->set.ftpsslauth) {
 3134|      6|    case CURLFTPAUTH_DEFAULT:
  ------------------
  |  |  998|      6|#define CURLFTPAUTH_DEFAULT 0L /* let libcurl decide */
  ------------------
  |  Branch (3134:5): [True: 6, False: 0]
  ------------------
 3135|      6|    case CURLFTPAUTH_SSL:
  ------------------
  |  |  999|      6|#define CURLFTPAUTH_SSL     1L /* use "AUTH SSL" */
  ------------------
  |  Branch (3135:5): [True: 0, False: 6]
  ------------------
 3136|      6|      ftpc->count2 = 1; /* add one to get next */
 3137|      6|      ftpc->count1 = 0;
 3138|      6|      break;
 3139|      0|    case CURLFTPAUTH_TLS:
  ------------------
  |  | 1000|      0|#define CURLFTPAUTH_TLS     2L /* use "AUTH TLS" */
  ------------------
  |  Branch (3139:5): [True: 0, False: 6]
  ------------------
 3140|      0|      ftpc->count2 = -1; /* subtract one to get next */
 3141|      0|      ftpc->count1 = 1;
 3142|      0|      break;
 3143|      0|    default:
  ------------------
  |  Branch (3143:5): [True: 0, False: 6]
  ------------------
 3144|      0|      failf(data, "unsupported parameter to CURLOPT_FTPSSLAUTH: %d",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3145|      0|            (int)data->set.ftpsslauth);
 3146|      0|      return CURLE_UNKNOWN_OPTION; /* we do not know what to do */
 3147|      6|    }
 3148|      6|    result = Curl_pp_sendf(data, &ftpc->pp, "AUTH %s", ftpauth[ftpc->count1]);
 3149|      6|    if(!result)
  ------------------
  |  Branch (3149:8): [True: 6, False: 0]
  ------------------
 3150|      6|      ftp_state(data, ftpc, FTP_AUTH);
  ------------------
  |  |  159|      6|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 3151|      6|  }
 3152|    266|  else
 3153|    266|    result = ftp_state_user(data, ftpc, conn);
 3154|    272|  return result;
 3155|    272|}
ftp.c:ftp_state_user:
  744|    267|{
  745|    267|  CURLcode result = Curl_pp_sendf(data, &ftpc->pp, "USER %s",
  746|    267|                                  Curl_creds_user(conn->creds));
  ------------------
  |  |   75|    267|#define Curl_creds_user(c)               ((c) ? (c)->user : "")
  |  |  ------------------
  |  |  |  Branch (75:43): [True: 267, False: 0]
  |  |  ------------------
  ------------------
  747|    267|  if(!result) {
  ------------------
  |  Branch (747:6): [True: 267, False: 0]
  ------------------
  748|    267|    ftpc->ftp_trying_alternative = FALSE;
  ------------------
  |  | 1058|    267|#define FALSE false
  ------------------
  749|    267|    ftp_state(data, ftpc, FTP_USER);
  ------------------
  |  |  159|    267|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
  750|    267|  }
  751|    267|  return result;
  752|    267|}
ftp.c:ftp_state_user_resp:
 2935|  1.53k|{
 2936|  1.53k|  CURLcode result = CURLE_OK;
 2937|       |
 2938|       |  /* some need password anyway, and others return 2xx ignored */
 2939|  1.53k|  if((ftpcode == 331) && (ftpc->state == FTP_USER)) {
  ------------------
  |  Branch (2939:6): [True: 11, False: 1.52k]
  |  Branch (2939:26): [True: 7, False: 4]
  ------------------
 2940|       |    /* 331 Password required for ...
 2941|       |       (the server requires to send the user's password too) */
 2942|      7|    result = Curl_pp_sendf(data, &ftpc->pp, "PASS %s",
 2943|      7|                           Curl_creds_passwd(data->conn->creds));
  ------------------
  |  |   76|      7|#define Curl_creds_passwd(c)             ((c) ? (c)->passwd : "")
  |  |  ------------------
  |  |  |  Branch (76:43): [True: 7, False: 0]
  |  |  ------------------
  ------------------
 2944|      7|    if(!result)
  ------------------
  |  Branch (2944:8): [True: 7, False: 0]
  ------------------
 2945|      7|      ftp_state(data, ftpc, FTP_PASS);
  ------------------
  |  |  159|      7|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 2946|      7|  }
 2947|  1.52k|  else if(ftpcode / 100 == 2) {
  ------------------
  |  Branch (2947:11): [True: 1.51k, False: 12]
  ------------------
 2948|       |    /* 230 User ... logged in.
 2949|       |       (the user logged in with or without password) */
 2950|  1.51k|    result = ftp_state_loggedin(data, ftpc);
 2951|  1.51k|  }
 2952|     12|  else if(ftpcode == 332) {
  ------------------
  |  Branch (2952:11): [True: 1, False: 11]
  ------------------
 2953|      1|    if(data->set.str[STRING_FTP_ACCOUNT]) {
  ------------------
  |  Branch (2953:8): [True: 0, False: 1]
  ------------------
 2954|      0|      result = Curl_pp_sendf(data, &ftpc->pp, "ACCT %s",
 2955|      0|                             data->set.str[STRING_FTP_ACCOUNT]);
 2956|      0|      if(!result)
  ------------------
  |  Branch (2956:10): [True: 0, False: 0]
  ------------------
 2957|      0|        ftp_state(data, ftpc, FTP_ACCT);
  ------------------
  |  |  159|      0|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 2958|      0|    }
 2959|      1|    else {
 2960|      1|      failf(data, "ACCT requested but none available");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
 2961|      1|      result = CURLE_LOGIN_DENIED;
 2962|      1|    }
 2963|      1|  }
 2964|     11|  else {
 2965|       |    /* All other response codes, like:
 2966|       |
 2967|       |    530 User ... access denied
 2968|       |    (the server denies to log the specified user) */
 2969|       |
 2970|     11|    if(data->set.str[STRING_FTP_ALTERNATIVE_TO_USER] &&
  ------------------
  |  Branch (2970:8): [True: 6, False: 5]
  ------------------
 2971|      6|       !ftpc->ftp_trying_alternative) {
  ------------------
  |  Branch (2971:8): [True: 4, False: 2]
  ------------------
 2972|       |      /* Ok, USER failed. Let's try the supplied command. */
 2973|      4|      result = Curl_pp_sendf(data, &ftpc->pp, "%s",
 2974|      4|                             data->set.str[STRING_FTP_ALTERNATIVE_TO_USER]);
 2975|      4|      if(!result) {
  ------------------
  |  Branch (2975:10): [True: 4, False: 0]
  ------------------
 2976|      4|        ftpc->ftp_trying_alternative = TRUE;
  ------------------
  |  | 1055|      4|#define TRUE true
  ------------------
 2977|      4|        ftp_state(data, ftpc, FTP_USER);
  ------------------
  |  |  159|      4|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 2978|      4|      }
 2979|      4|    }
 2980|      7|    else {
 2981|      7|      failf(data, "Access denied: %03d", ftpcode);
  ------------------
  |  |   62|      7|#define failf Curl_failf
  ------------------
 2982|      7|      result = CURLE_LOGIN_DENIED;
 2983|      7|    }
 2984|     11|  }
 2985|  1.53k|  return result;
 2986|  1.53k|}
ftp.c:ftp_state_loggedin:
 2903|  1.51k|{
 2904|  1.51k|  CURLcode result = CURLE_OK;
 2905|       |
 2906|  1.51k|  if(Curl_conn_is_ssl(data->conn, FIRSTSOCKET)) {
  ------------------
  |  |  303|  1.51k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (2906:6): [True: 0, False: 1.51k]
  ------------------
 2907|       |    /* PBSZ = PROTECTION BUFFER SIZE.
 2908|       |
 2909|       |    The 'draft-murray-auth-ftp-ssl' (draft 12, page 7) says:
 2910|       |
 2911|       |    Specifically, the PROT command MUST be preceded by a PBSZ
 2912|       |    command and a PBSZ command MUST be preceded by a successful
 2913|       |    security data exchange (the TLS negotiation in this case)
 2914|       |
 2915|       |    ... (and on page 8):
 2916|       |
 2917|       |    Thus the PBSZ command must still be issued, but must have a
 2918|       |    parameter of '0' to indicate that no buffering is taking place
 2919|       |    and the data connection should not be encapsulated.
 2920|       |    */
 2921|      0|    result = Curl_pp_sendf(data, &ftpc->pp, "PBSZ %d", 0);
 2922|      0|    if(!result)
  ------------------
  |  Branch (2922:8): [True: 0, False: 0]
  ------------------
 2923|      0|      ftp_state(data, ftpc, FTP_PBSZ);
  ------------------
  |  |  159|      0|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 2924|      0|  }
 2925|  1.51k|  else {
 2926|  1.51k|    result = ftp_state_pwd(data, ftpc);
 2927|  1.51k|  }
 2928|  1.51k|  return result;
 2929|  1.51k|}
ftp.c:ftp_state_pwd:
  756|  1.51k|{
  757|  1.51k|  CURLcode result;
  758|  1.51k|#ifdef DEBUGBUILD
  759|  1.51k|  if(!data->id && getenv("CURL_FTP_PWD_STOP"))
  ------------------
  |  Branch (759:6): [True: 1.51k, False: 0]
  |  Branch (759:19): [True: 0, False: 1.51k]
  ------------------
  760|      0|    return CURLE_OK;
  761|  1.51k|#endif
  762|  1.51k|  result = Curl_pp_sendf(data, &ftpc->pp, "%s", "PWD");
  763|  1.51k|  if(!result)
  ------------------
  |  Branch (763:6): [True: 1.51k, False: 0]
  ------------------
  764|  1.51k|    ftp_state(data, ftpc, FTP_PWD);
  ------------------
  |  |  159|  1.51k|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
  765|       |
  766|  1.51k|  return result;
  767|  1.51k|}
ftp.c:ftp_pwd_resp:
 3007|  1.49k|{
 3008|  1.49k|  struct pingpong *pp = &ftpc->pp;
 3009|  1.49k|  CURLcode result;
 3010|       |
 3011|  1.49k|  if(ftpcode == 257) {
  ------------------
  |  Branch (3011:6): [True: 105, False: 1.38k]
  ------------------
 3012|    105|    const char *ptr = curlx_dyn_ptr(&pp->recvbuf) + 4; /* start on the first
 3013|       |                                                          letter */
 3014|    105|    bool entry_extracted = FALSE;
  ------------------
  |  | 1058|    105|#define FALSE false
  ------------------
 3015|    105|    struct dynbuf out;
 3016|    105|    curlx_dyn_init(&out, 1000);
 3017|       |
 3018|       |    /* Reply format is like
 3019|       |       257<space>[rubbish]"<directory-name>"<space><commentary> and the
 3020|       |       RFC959 says
 3021|       |
 3022|       |       The directory name can contain any character; embedded
 3023|       |       double-quotes should be escaped by double-quotes (the
 3024|       |       "quote-doubling" convention).
 3025|       |    */
 3026|       |
 3027|       |    /* scan for the first double-quote for non-standard responses */
 3028|    657|    while(*ptr != '\n' && *ptr != '\0' && *ptr != '"')
  ------------------
  |  Branch (3028:11): [True: 617, False: 40]
  |  Branch (3028:27): [True: 594, False: 23]
  |  Branch (3028:43): [True: 552, False: 42]
  ------------------
 3029|    552|      ptr++;
 3030|       |
 3031|    105|    if('\"' == *ptr) {
  ------------------
  |  Branch (3031:8): [True: 42, False: 63]
  ------------------
 3032|       |      /* it started good */
 3033|  2.21k|      for(ptr++; *ptr; ptr++) {
  ------------------
  |  Branch (3033:18): [True: 2.20k, False: 8]
  ------------------
 3034|  2.20k|        if('\"' == *ptr) {
  ------------------
  |  Branch (3034:12): [True: 1.02k, False: 1.18k]
  ------------------
 3035|  1.02k|          if('\"' == ptr[1]) {
  ------------------
  |  Branch (3035:14): [True: 1.00k, False: 23]
  ------------------
 3036|       |            /* "quote-doubling" */
 3037|  1.00k|            result = curlx_dyn_addn(&out, &ptr[1], 1);
 3038|  1.00k|            ptr++;
 3039|  1.00k|          }
 3040|     23|          else {
 3041|       |            /* end of path */
 3042|     23|            if(curlx_dyn_len(&out))
  ------------------
  |  Branch (3042:16): [True: 22, False: 1]
  ------------------
 3043|     22|              entry_extracted = TRUE;
  ------------------
  |  | 1055|     22|#define TRUE true
  ------------------
 3044|     23|            break; /* get out of this loop */
 3045|     23|          }
 3046|  1.02k|        }
 3047|  1.18k|        else {
 3048|  1.18k|          if(ISCNTRL(*ptr)) {
  ------------------
  |  |   37|  1.18k|#define ISCNTRL(x)  (ISLOWCNTRL(x) || IS7F(x))
  |  |  ------------------
  |  |  |  |   30|  2.36k|#define ISLOWCNTRL(x) ((unsigned char)(x) <= 0x1f)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (30:23): [True: 9, False: 1.17k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISCNTRL(x)  (ISLOWCNTRL(x) || IS7F(x))
  |  |  ------------------
  |  |  |  |   31|  1.17k|#define IS7F(x)       ((x) == 0x7f)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:23): [True: 1, False: 1.17k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3049|       |            /* control characters have no business in a path */
 3050|     10|            curlx_dyn_free(&out);
 3051|     10|            return CURLE_WEIRD_SERVER_REPLY;
 3052|     10|          }
 3053|  1.17k|          result = curlx_dyn_addn(&out, ptr, 1);
 3054|  1.17k|        }
 3055|  2.17k|        if(result) {
  ------------------
  |  Branch (3055:12): [True: 1, False: 2.17k]
  ------------------
 3056|      1|          curlx_dyn_free(&out);
 3057|      1|          return result;
 3058|      1|        }
 3059|  2.17k|      }
 3060|     42|    }
 3061|     94|    if(entry_extracted) {
  ------------------
  |  Branch (3061:8): [True: 22, False: 72]
  ------------------
 3062|       |      /* If the path name does not look like an absolute path (i.e.: it
 3063|       |         does not start with a '/'), we probably need some server-dependent
 3064|       |         adjustments. For example, this is the case when connecting to
 3065|       |         an OS400 FTP server: this server supports two name syntaxes,
 3066|       |         the default one being incompatible with standard paths. In
 3067|       |         addition, this server switches automatically to the regular path
 3068|       |         syntax when one is encountered in a command: this results in
 3069|       |         having an entrypath in the wrong syntax when later used in CWD.
 3070|       |         The method used here is to check the server OS: we do it only
 3071|       |         if the path name looks strange to minimize overhead on other
 3072|       |         systems. */
 3073|     22|      char *dir = curlx_dyn_ptr(&out);
 3074|       |
 3075|     22|      if(!ftpc->server_os && dir[0] != '/') {
  ------------------
  |  Branch (3075:10): [True: 22, False: 0]
  |  Branch (3075:30): [True: 21, False: 1]
  ------------------
 3076|     21|        result = Curl_pp_sendf(data, &ftpc->pp, "%s", "SYST");
 3077|     21|        if(result) {
  ------------------
  |  Branch (3077:12): [True: 0, False: 21]
  ------------------
 3078|      0|          curlx_dyn_free(&out);
 3079|      0|          return result;
 3080|      0|        }
 3081|     21|      }
 3082|       |
 3083|     22|      curlx_free(ftpc->entrypath);
  ------------------
  |  | 1483|     22|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3084|     22|      ftpc->entrypath = dir; /* remember this */
 3085|     22|      infof(data, "Entry path is '%s'", ftpc->entrypath);
  ------------------
  |  |  143|     22|  do {                               \
  |  |  144|     22|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     22|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 22, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 22]
  |  |  |  |  ------------------
  |  |  |  |  320|     22|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     22|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     22|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 22]
  |  |  ------------------
  ------------------
 3086|       |      /* also save it where getinfo can access it: */
 3087|     22|      curlx_free(data->state.most_recent_ftp_entrypath);
  ------------------
  |  | 1483|     22|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3088|     22|      data->state.most_recent_ftp_entrypath = curlx_strdup(ftpc->entrypath);
  ------------------
  |  | 1477|     22|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 3089|     22|      if(!data->state.most_recent_ftp_entrypath)
  ------------------
  |  Branch (3089:10): [True: 0, False: 22]
  ------------------
 3090|      0|        return CURLE_OUT_OF_MEMORY;
 3091|       |
 3092|     22|      if(!ftpc->server_os && dir[0] != '/') {
  ------------------
  |  Branch (3092:10): [True: 22, False: 0]
  |  Branch (3092:30): [True: 21, False: 1]
  ------------------
 3093|     21|        ftp_state(data, ftpc, FTP_SYST);
  ------------------
  |  |  159|     21|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 3094|     21|        return CURLE_OK;
 3095|     21|      }
 3096|     22|    }
 3097|     72|    else {
 3098|       |      /* could not get the path */
 3099|     72|      curlx_dyn_free(&out);
 3100|     72|      infof(data, "Failed to figure out path");
  ------------------
  |  |  143|     72|  do {                               \
  |  |  144|     72|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     72|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 72, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 72]
  |  |  |  |  ------------------
  |  |  |  |  320|     72|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     72|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     72|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 72]
  |  |  ------------------
  ------------------
 3101|     72|    }
 3102|     94|  }
 3103|  1.45k|  ftp_state(data, ftpc, FTP_STOP); /* we are done with CONNECT phase! */
  ------------------
  |  |  159|  1.45k|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 3104|  1.45k|  CURL_TRC_FTP(data, "[%s] protocol connect phase DONE", FTP_CSTATE(ftpc));
  ------------------
  |  |  180|  1.45k|  do {                                                   \
  |  |  181|  1.45k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|  1.45k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  2.91k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 1.45k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.45k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  2.91k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.45k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|  1.45k|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (182:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  183|  1.45k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 1.45k]
  |  |  ------------------
  ------------------
 3105|  1.45k|  return CURLE_OK;
 3106|  1.49k|}
ftp.c:ftp_state_mdtm_resp:
 2511|     60|{
 2512|     60|  CURLcode result = CURLE_OK;
 2513|       |
 2514|     60|  switch(ftpcode) {
 2515|     49|  case 213: {
  ------------------
  |  Branch (2515:3): [True: 49, False: 11]
  ------------------
 2516|       |    /* we got a time. Format should be: "YYYYMMDDHHMMSS[.sss]" where the
 2517|       |       last .sss part is optional and means fractions of a second */
 2518|     49|    int year, month, day, hour, minute, second;
 2519|     49|    struct pingpong *pp = &ftpc->pp;
 2520|     49|    const char *resp = curlx_dyn_ptr(&pp->recvbuf) + 4;
 2521|     49|    bool showtime = FALSE;
  ------------------
  |  | 1058|     49|#define FALSE false
  ------------------
 2522|     49|    if(ftp_213_date(resp, &year, &month, &day, &hour, &minute, &second)) {
  ------------------
  |  Branch (2522:8): [True: 7, False: 42]
  ------------------
 2523|       |      /* we have a time, reformat it */
 2524|      7|      char timebuf[24];
 2525|      7|      curl_msnprintf(timebuf, sizeof(timebuf),
 2526|      7|                     "%04d%02d%02d %02d:%02d:%02d GMT",
 2527|      7|                     year, month, day, hour, minute, second);
 2528|       |      /* now, convert this into a time() value: */
 2529|      7|      if(!Curl_getdate_capped(timebuf, &data->info.filetime))
  ------------------
  |  Branch (2529:10): [True: 5, False: 2]
  ------------------
 2530|      5|        showtime = TRUE;
  ------------------
  |  | 1055|      5|#define TRUE true
  ------------------
 2531|      7|    }
 2532|       |
 2533|       |    /* If we asked for a time of the file and we actually got one as well,
 2534|       |       we "emulate" an HTTP-style header in our output. */
 2535|       |
 2536|       |#if defined(CURL_HAVE_DIAG) && (defined(__DJGPP__) || defined(__AMIGA__))
 2537|       |#pragma GCC diagnostic push
 2538|       |/* 'time_t' is unsigned in MSDOS and AmigaOS. Silence:
 2539|       |   warning: comparison of unsigned expression in '>= 0' is always true */
 2540|       |#pragma GCC diagnostic ignored "-Wtype-limits"
 2541|       |#endif
 2542|     49|    if(data->req.no_body && ftpc->file &&
  ------------------
  |  Branch (2542:8): [True: 2, False: 47]
  |  Branch (2542:29): [True: 2, False: 0]
  ------------------
 2543|      2|       data->set.get_filetime && showtime) {
  ------------------
  |  Branch (2543:8): [True: 1, False: 1]
  |  Branch (2543:34): [True: 0, False: 1]
  ------------------
 2544|       |#if defined(CURL_HAVE_DIAG) && (defined(__DJGPP__) || defined(__AMIGA__))
 2545|       |#pragma GCC diagnostic pop
 2546|       |#endif
 2547|      0|      char headerbuf[128];
 2548|      0|      int headerbuflen;
 2549|      0|      time_t filetime = data->info.filetime;
 2550|      0|      struct tm buffer;
 2551|      0|      const struct tm *tm = &buffer;
 2552|       |
 2553|      0|      result = curlx_gmtime(filetime, &buffer);
 2554|      0|      if(result)
  ------------------
  |  Branch (2554:10): [True: 0, False: 0]
  ------------------
 2555|      0|        return result;
 2556|       |
 2557|       |      /* format: "Tue, 15 Nov 1994 12:45:26" */
 2558|      0|      headerbuflen =
 2559|      0|        curl_msnprintf(headerbuf, sizeof(headerbuf),
 2560|      0|                       "Last-Modified: %s, %02d %s %4d %02d:%02d:%02d "
 2561|      0|                       "GMT\r\n",
 2562|      0|                       Curl_wkday[tm->tm_wday ? tm->tm_wday-1 : 6],
  ------------------
  |  Branch (2562:35): [True: 0, False: 0]
  ------------------
 2563|      0|                       tm->tm_mday,
 2564|      0|                       Curl_month[tm->tm_mon],
 2565|      0|                       tm->tm_year + 1900,
 2566|      0|                       tm->tm_hour,
 2567|      0|                       tm->tm_min,
 2568|      0|                       tm->tm_sec);
 2569|      0|      result = client_write_header(data, headerbuf, headerbuflen);
 2570|      0|      if(result)
  ------------------
  |  Branch (2570:10): [True: 0, False: 0]
  ------------------
 2571|      0|        return result;
 2572|      0|    } /* end of a ridiculous amount of conditionals */
 2573|     49|  }
 2574|     49|    break;
 2575|     49|  default:
  ------------------
  |  Branch (2575:3): [True: 10, False: 50]
  ------------------
 2576|     10|    infof(data, "unsupported MDTM reply format");
  ------------------
  |  |  143|     10|  do {                               \
  |  |  144|     10|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     10|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 10, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 10]
  |  |  |  |  ------------------
  |  |  |  |  320|     10|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     10|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     10|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 10]
  |  |  ------------------
  ------------------
 2577|     10|    break;
 2578|      1|  case 550: /* 550 is used for several different problems, e.g.
  ------------------
  |  Branch (2578:3): [True: 1, False: 59]
  ------------------
 2579|       |               "No such file or directory" or "Permission denied".
 2580|       |               It does not mean that the file does not exist at all. */
 2581|      1|    infof(data, "MDTM failed: file does not exist or permission problem,"
  ------------------
  |  |  143|      1|  do {                               \
  |  |  144|      1|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      1|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 1, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  320|      1|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      1|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      1|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1]
  |  |  ------------------
  ------------------
 2582|      1|          " continuing");
 2583|      1|    break;
 2584|     60|  }
 2585|       |
 2586|     60|  if(data->set.timecondition) {
  ------------------
  |  Branch (2586:6): [True: 53, False: 7]
  ------------------
 2587|     53|    if((data->info.filetime > 0) && (data->set.timevalue > 0)) {
  ------------------
  |  Branch (2587:8): [True: 5, False: 48]
  |  Branch (2587:37): [True: 0, False: 5]
  ------------------
 2588|      0|      switch(data->set.timecondition) {
 2589|      0|      case CURL_TIMECOND_IFMODSINCE:
  ------------------
  |  | 2411|      0|#define CURL_TIMECOND_IFMODSINCE   1L
  ------------------
  |  Branch (2589:7): [True: 0, False: 0]
  ------------------
 2590|      0|      default:
  ------------------
  |  Branch (2590:7): [True: 0, False: 0]
  ------------------
 2591|      0|        if(data->info.filetime <= data->set.timevalue) {
  ------------------
  |  Branch (2591:12): [True: 0, False: 0]
  ------------------
 2592|      0|          infof(data, "The requested document is not new enough");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2593|      0|          ftp->transfer = PPTRANSFER_NONE; /* mark to not transfer data */
 2594|      0|          data->info.timecond = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2595|      0|          ftp_state(data, ftpc, FTP_STOP);
  ------------------
  |  |  159|      0|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 2596|      0|          return CURLE_OK;
 2597|      0|        }
 2598|      0|        break;
 2599|      0|      case CURL_TIMECOND_IFUNMODSINCE:
  ------------------
  |  | 2412|      0|#define CURL_TIMECOND_IFUNMODSINCE 2L
  ------------------
  |  Branch (2599:7): [True: 0, False: 0]
  ------------------
 2600|      0|        if(data->info.filetime > data->set.timevalue) {
  ------------------
  |  Branch (2600:12): [True: 0, False: 0]
  ------------------
 2601|      0|          infof(data, "The requested document is not old enough");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2602|      0|          ftp->transfer = PPTRANSFER_NONE; /* mark to not transfer data */
 2603|      0|          data->info.timecond = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2604|      0|          ftp_state(data, ftpc, FTP_STOP);
  ------------------
  |  |  159|      0|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 2605|      0|          return CURLE_OK;
 2606|      0|        }
 2607|      0|        break;
 2608|      0|      } /* switch */
 2609|      0|    }
 2610|     53|    else {
 2611|     53|      infof(data, "Skipping time comparison");
  ------------------
  |  |  143|     53|  do {                               \
  |  |  144|     53|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     53|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 53, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 53]
  |  |  |  |  ------------------
  |  |  |  |  320|     53|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     53|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     53|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 53]
  |  |  ------------------
  ------------------
 2612|     53|    }
 2613|     53|  }
 2614|       |
 2615|     60|  if(!result)
  ------------------
  |  Branch (2615:6): [True: 60, False: 0]
  ------------------
 2616|     60|    result = ftp_state_type(data, ftpc, ftp);
 2617|       |
 2618|     60|  return result;
 2619|     60|}
ftp.c:client_write_header:
 2484|     37|{
 2485|       |  /* Some replies from an FTP server are written to the client
 2486|       |   * as CLIENTWRITE_HEADER, formatted as if they came from a
 2487|       |   * HTTP conversation.
 2488|       |   * In all protocols, CLIENTWRITE_HEADER data is only passed to
 2489|       |   * the body write callback when data->set.include_header is set
 2490|       |   * via CURLOPT_HEADER.
 2491|       |   * For historic reasons, FTP never played this game and expects
 2492|       |   * all its headers to do that always. Set that flag during the
 2493|       |   * call to Curl_client_write() so it does the right thing.
 2494|       |   *
 2495|       |   * Notice that we cannot enable this flag for FTP in general,
 2496|       |   * as an FTP transfer might involve an HTTP proxy connection and
 2497|       |   * headers from CONNECT should not automatically be part of the
 2498|       |   * output. */
 2499|     37|  CURLcode result;
 2500|     37|  bool save = (bool)data->set.include_header;
 2501|     37|  data->set.include_header = TRUE;
  ------------------
  |  | 1055|     37|#define TRUE true
  ------------------
 2502|     37|  result = Curl_client_write(data, CLIENTWRITE_HEADER, buf, blen);
  ------------------
  |  |   44|     37|#define CLIENTWRITE_HEADER  (1 << 2) /* meta information, HEADER */
  ------------------
 2503|     37|  data->set.include_header = save;
 2504|     37|  return result;
 2505|     37|}
ftp.c:ftp_state_size_resp:
 2659|    207|{
 2660|    207|  CURLcode result = CURLE_OK;
 2661|    207|  curl_off_t filesize = -1;
 2662|    207|  const char *buf = curlx_dyn_ptr(&ftpc->pp.recvbuf);
 2663|    207|  size_t len = ftpc->pp.nfinal;
 2664|       |
 2665|       |  /* get the size from the ascii string: */
 2666|    207|  if(ftpcode == 213) {
  ------------------
  |  Branch (2666:6): [True: 40, False: 167]
  ------------------
 2667|       |    /* To allow servers to prepend "rubbish" in the response string, we scan
 2668|       |       for all the digits at the end of the response and parse only those as a
 2669|       |       number. */
 2670|     40|    const char *start = &buf[4];
 2671|     40|    const char *fdigit = memchr(start, '\r', len - 4);
 2672|     40|    if(fdigit) {
  ------------------
  |  Branch (2672:8): [True: 7, False: 33]
  ------------------
 2673|      7|      fdigit--;
 2674|      7|      if(*fdigit == '\n')
  ------------------
  |  Branch (2674:10): [True: 0, False: 7]
  ------------------
 2675|      0|        fdigit--;
 2676|     28|      while(ISDIGIT(fdigit[-1]) && (fdigit > start))
  ------------------
  |  |   44|     56|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 24, False: 4]
  |  |  |  Branch (44:38): [True: 22, False: 2]
  |  |  ------------------
  ------------------
  |  Branch (2676:36): [True: 21, False: 1]
  ------------------
 2677|     21|        fdigit--;
 2678|      7|    }
 2679|     33|    else
 2680|     33|      fdigit = start;
 2681|     40|    if(curlx_str_number(&fdigit, &filesize, CURL_OFF_T_MAX))
  ------------------
  |  |  594|     40|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (2681:8): [True: 3, False: 37]
  ------------------
 2682|      3|      filesize = -1; /* size remain unknown */
 2683|     40|  }
 2684|    167|  else if(ftpcode == 550) { /* "No such file or directory" */
  ------------------
  |  Branch (2684:11): [True: 1, False: 166]
  ------------------
 2685|       |    /* allow a SIZE failure for (resumed) uploads, when probing what command
 2686|       |       to use */
 2687|      1|    if(instate != FTP_STOR_SIZE) {
  ------------------
  |  Branch (2687:8): [True: 1, False: 0]
  ------------------
 2688|      1|      failf(data, "The file does not exist");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
 2689|      1|      return CURLE_REMOTE_FILE_NOT_FOUND;
 2690|      1|    }
 2691|      1|  }
 2692|       |
 2693|    206|  if(instate == FTP_SIZE) {
  ------------------
  |  Branch (2693:6): [True: 44, False: 162]
  ------------------
 2694|     44|    if(filesize != -1) {
  ------------------
  |  Branch (2694:8): [True: 36, False: 8]
  ------------------
 2695|     36|      char clbuf[128];
 2696|     36|      int clbuflen = curl_msnprintf(clbuf, sizeof(clbuf),
 2697|     36|                                    "Content-Length: %" FMT_OFF_T "\r\n",
 2698|     36|                                    filesize);
 2699|     36|      result = client_write_header(data, clbuf, clbuflen);
 2700|     36|      if(result)
  ------------------
  |  Branch (2700:10): [True: 0, False: 36]
  ------------------
 2701|      0|        return result;
 2702|     36|    }
 2703|     44|    Curl_pgrsSetDownloadSize(data, filesize);
 2704|     44|    result = ftp_state_rest(data, ftpc, ftp);
 2705|     44|  }
 2706|    162|  else if(instate == FTP_RETR_SIZE) {
  ------------------
  |  Branch (2706:11): [True: 162, False: 0]
  ------------------
 2707|    162|    Curl_pgrsSetDownloadSize(data, filesize);
 2708|    162|    result = ftp_state_retr(data, ftpc, ftp, filesize);
 2709|    162|  }
 2710|      0|  else if(instate == FTP_STOR_SIZE) {
  ------------------
  |  Branch (2710:11): [True: 0, False: 0]
  ------------------
 2711|      0|    data->state.resume_from = filesize;
 2712|      0|    result = ftp_state_ul_setup(data, ftpc, ftp, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2713|      0|  }
 2714|       |
 2715|    206|  return result;
 2716|    206|}
ftp.c:ftp_state_rest_resp:
 2723|      7|{
 2724|      7|  CURLcode result = CURLE_OK;
 2725|       |
 2726|      7|  switch(instate) {
 2727|      6|  case FTP_REST:
  ------------------
  |  Branch (2727:3): [True: 6, False: 1]
  ------------------
 2728|      6|  default:
  ------------------
  |  Branch (2728:3): [True: 0, False: 7]
  ------------------
 2729|      6|    if(ftpcode == 350) {
  ------------------
  |  Branch (2729:8): [True: 1, False: 5]
  ------------------
 2730|      1|      char buffer[24] = { "Accept-ranges: bytes\r\n" };
 2731|      1|      result = client_write_header(data, buffer, strlen(buffer));
 2732|      1|      if(result)
  ------------------
  |  Branch (2732:10): [True: 0, False: 1]
  ------------------
 2733|      0|        return result;
 2734|      1|    }
 2735|      6|    result = ftp_state_prepare_transfer(data, ftpc, ftp);
 2736|      6|    break;
 2737|       |
 2738|      1|  case FTP_RETR_REST:
  ------------------
  |  Branch (2738:3): [True: 1, False: 6]
  ------------------
 2739|      1|    if(ftpcode != 350) {
  ------------------
  |  Branch (2739:8): [True: 1, False: 0]
  ------------------
 2740|      1|      failf(data, "Could not use REST");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
 2741|      1|      result = CURLE_FTP_COULDNT_USE_REST;
 2742|      1|    }
 2743|      0|    else {
 2744|      0|      result = Curl_pp_sendf(data, &ftpc->pp, "RETR %s", ftpc->file);
 2745|      0|      if(!result)
  ------------------
  |  Branch (2745:10): [True: 0, False: 0]
  ------------------
 2746|      0|        ftp_state(data, ftpc, FTP_RETR);
  ------------------
  |  |  159|      0|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 2747|      0|    }
 2748|      1|    break;
 2749|      7|  }
 2750|       |
 2751|      7|  return result;
 2752|      7|}
ftp.c:ftp_state_pasv_resp:
 2057|  2.08k|{
 2058|  2.08k|  struct connectdata *conn = data->conn;
 2059|  2.08k|  CURLcode result;
 2060|  2.08k|  const struct pingpong *pp = &ftpc->pp;
 2061|  2.08k|  char *newhost = NULL;
 2062|  2.08k|  unsigned short newport = 0;
 2063|  2.08k|  const char *str = curlx_dyn_ptr(&pp->recvbuf) + 4; /* start on the first
 2064|       |                                                        letter */
 2065|  2.08k|  if((ftpc->count1 == 0) &&
  ------------------
  |  Branch (2065:6): [True: 1.05k, False: 1.03k]
  ------------------
 2066|  1.05k|     (ftpcode == 229)) {
  ------------------
  |  Branch (2066:6): [True: 15, False: 1.03k]
  ------------------
 2067|       |    /* positive EPSV response */
 2068|     15|    const char *ptr = strchr(str, '(');
 2069|     15|    if(ptr) {
  ------------------
  |  Branch (2069:8): [True: 13, False: 2]
  ------------------
 2070|     13|      char sep;
 2071|     13|      ptr++;
 2072|       |      /* |||12345| */
 2073|     13|      sep = ptr[0];
 2074|     13|      if(sep && (ptr[1] == sep) && (ptr[2] == sep) && ISDIGIT(ptr[3])) {
  ------------------
  |  |   44|      6|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 5, False: 1]
  |  |  |  Branch (44:38): [True: 4, False: 1]
  |  |  ------------------
  ------------------
  |  Branch (2074:10): [True: 8, False: 5]
  |  Branch (2074:17): [True: 7, False: 1]
  |  Branch (2074:36): [True: 6, False: 1]
  ------------------
 2075|      4|        const char *p = &ptr[3];
 2076|      4|        curl_off_t num;
 2077|      4|        if(curlx_str_number(&p, &num, 0xffff) || (*p != sep)) {
  ------------------
  |  Branch (2077:12): [True: 1, False: 3]
  |  Branch (2077:50): [True: 1, False: 2]
  ------------------
 2078|      2|          failf(data, "Illegal port number in EPSV reply");
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
 2079|      2|          return CURLE_FTP_WEIRD_PASV_REPLY;
 2080|      2|        }
 2081|      2|        newport = (unsigned short)num;
 2082|      2|        result = ftp_control_addr_dup(data, &newhost);
 2083|      2|        if(result)
  ------------------
  |  Branch (2083:12): [True: 0, False: 2]
  ------------------
 2084|      0|          return result;
 2085|      2|      }
 2086|      9|      else
 2087|      9|        ptr = NULL;
 2088|     13|    }
 2089|     13|    if(!ptr) {
  ------------------
  |  Branch (2089:8): [True: 11, False: 2]
  ------------------
 2090|     11|      failf(data, "Weirdly formatted EPSV reply");
  ------------------
  |  |   62|     11|#define failf Curl_failf
  ------------------
 2091|     11|      return CURLE_FTP_WEIRD_PASV_REPLY;
 2092|     11|    }
 2093|     13|  }
 2094|  2.06k|  else if((ftpc->count1 == 1) &&
  ------------------
  |  Branch (2094:11): [True: 1.03k, False: 1.03k]
  ------------------
 2095|  1.03k|          (ftpcode == 227)) {
  ------------------
  |  Branch (2095:11): [True: 1.01k, False: 18]
  ------------------
 2096|       |    /* positive PASV response */
 2097|  1.01k|    unsigned int ip[6];
 2098|       |
 2099|       |    /*
 2100|       |     * Scan for a sequence of six comma-separated numbers and use them as
 2101|       |     * IP+port indicators.
 2102|       |     *
 2103|       |     * Found reply-strings include:
 2104|       |     * "227 Entering Passive Mode (127,0,0,1,4,51)"
 2105|       |     * "227 Data transfer will passively listen to 127,0,0,1,4,51"
 2106|       |     * "227 Entering passive mode. 127,0,0,1,4,51"
 2107|       |     */
 2108|  27.6k|    while(*str) {
  ------------------
  |  Branch (2108:11): [True: 27.5k, False: 32]
  ------------------
 2109|  27.5k|      if(match_pasv_6nums(str, ip))
  ------------------
  |  Branch (2109:10): [True: 980, False: 26.6k]
  ------------------
 2110|    980|        break;
 2111|  26.6k|      str++;
 2112|  26.6k|    }
 2113|       |
 2114|  1.01k|    if(!*str) {
  ------------------
  |  Branch (2114:8): [True: 32, False: 980]
  ------------------
 2115|     32|      failf(data, "Could not interpret the 227-response");
  ------------------
  |  |   62|     32|#define failf Curl_failf
  ------------------
 2116|     32|      return CURLE_FTP_WEIRD_227_FORMAT;
 2117|     32|    }
 2118|       |
 2119|       |    /* we got OK from server */
 2120|    980|    if(data->set.ftp_skip_ip) {
  ------------------
  |  Branch (2120:8): [True: 979, False: 1]
  ------------------
 2121|       |      /* told to ignore the remotely given IP but instead use the host we used
 2122|       |         for the control connection */
 2123|    979|      infof(data, "Skip %u.%u.%u.%u for data connection, reuse %s instead",
  ------------------
  |  |  143|    979|  do {                               \
  |  |  144|    979|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    979|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 979, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 979]
  |  |  |  |  ------------------
  |  |  |  |  320|    979|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    979|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    979|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 979]
  |  |  ------------------
  ------------------
 2124|    979|            ip[0], ip[1], ip[2], ip[3], conn->origin->hostname);
 2125|    979|      result = ftp_control_addr_dup(data, &newhost);
 2126|    979|      if(result)
  ------------------
  |  Branch (2126:10): [True: 2, False: 977]
  ------------------
 2127|      2|        return result;
 2128|    979|    }
 2129|      1|    else
 2130|      1|      newhost = curl_maprintf("%u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]);
 2131|       |
 2132|    978|    if(!newhost)
  ------------------
  |  Branch (2132:8): [True: 0, False: 978]
  ------------------
 2133|      0|      return CURLE_OUT_OF_MEMORY;
 2134|       |
 2135|    978|    newport = (unsigned short)(((ip[4] << 8) + ip[5]) & 0xffff);
 2136|    978|  }
 2137|  1.05k|  else if(ftpc->count1 == 0) {
  ------------------
  |  Branch (2137:11): [True: 1.03k, False: 18]
  ------------------
 2138|       |    /* EPSV failed, move on to PASV */
 2139|  1.03k|    return ftp_epsv_disable(data, ftpc, conn);
 2140|  1.03k|  }
 2141|     18|  else {
 2142|     18|    failf(data, "Bad PASV/EPSV response: %03d", ftpcode);
  ------------------
  |  |   62|     18|#define failf Curl_failf
  ------------------
 2143|     18|    return CURLE_FTP_WEIRD_PASV_REPLY;
 2144|     18|  }
 2145|       |
 2146|    980|  DEBUGASSERT(newhost);
  ------------------
  |  | 1081|    980|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2146:3): [True: 0, False: 980]
  |  Branch (2146:3): [True: 980, False: 0]
  ------------------
 2147|    980|  Curl_peer_unlink(&conn->origin2);
 2148|    980|  result = Curl_peer_create(data, conn->scheme, newhost, newport,
 2149|    980|                            &conn->origin2);
 2150|    980|  if(result)
  ------------------
  |  Branch (2150:6): [True: 19, False: 961]
  ------------------
 2151|     19|    goto error;
 2152|       |
 2153|       |  /* If FIRSTSOCKET goes via another peer, SECONDARY needs as well,
 2154|       |   * but with its new port. */
 2155|    961|  if(conn->via_peer) {
  ------------------
  |  Branch (2155:6): [True: 961, False: 0]
  ------------------
 2156|    961|    Curl_peer_unlink(&conn->via_peer2);
 2157|    961|    result = Curl_peer_create(data, conn->via_peer->scheme,
 2158|    961|                              conn->via_peer->hostname, newport,
 2159|    961|                              &conn->via_peer2);
 2160|    961|    if(result)
  ------------------
  |  Branch (2160:8): [True: 2, False: 959]
  ------------------
 2161|      2|      goto error;
 2162|    961|  }
 2163|       |
 2164|    959|  result = Curl_conn_setup(data, conn, SECONDARYSOCKET,
  ------------------
  |  |  304|    959|#define SECONDARYSOCKET 1
  ------------------
 2165|    959|                           conn->bits.ftp_use_data_ssl ?
  ------------------
  |  Branch (2165:28): [True: 0, False: 959]
  ------------------
 2166|    959|                           CURL_CF_SSL_ENABLE : CURL_CF_SSL_DISABLE);
  ------------------
  |  |  365|      0|#define CURL_CF_SSL_ENABLE   1
  ------------------
                                         CURL_CF_SSL_ENABLE : CURL_CF_SSL_DISABLE);
  ------------------
  |  |  364|    959|#define CURL_CF_SSL_DISABLE  0
  ------------------
 2167|       |
 2168|    959|  if(result) {
  ------------------
  |  Branch (2168:6): [True: 0, False: 959]
  ------------------
 2169|      0|    if((result != CURLE_OUT_OF_MEMORY) &&
  ------------------
  |  Branch (2169:8): [True: 0, False: 0]
  ------------------
 2170|      0|       (ftpc->count1 == 0) && (ftpcode == 229)) {
  ------------------
  |  Branch (2170:8): [True: 0, False: 0]
  |  Branch (2170:31): [True: 0, False: 0]
  ------------------
 2171|      0|      result = ftp_epsv_disable(data, ftpc, conn);
 2172|      0|    }
 2173|      0|    goto error;
 2174|      0|  }
 2175|       |
 2176|       |  /*
 2177|       |   * When this is used from the multi interface, this might have returned with
 2178|       |   * the 'connected' set to FALSE and thus we are now awaiting a non-blocking
 2179|       |   * connect to connect.
 2180|       |   */
 2181|       |
 2182|    959|#ifdef CURLVERBOSE
 2183|    959|  if(data->set.verbose) {
  ------------------
  |  Branch (2183:6): [True: 0, False: 959]
  ------------------
 2184|       |    /* Dump information about this second connection when we have issued
 2185|       |     * a PASV command. */
 2186|      0|    infof(data, "Connecting to %s port %d",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2187|      0|          conn->origin2->hostname, conn->origin2->port);
 2188|      0|  }
 2189|    959|#endif
 2190|       |
 2191|    959|  conn->bits.do_more = TRUE;
  ------------------
  |  | 1055|    959|#define TRUE true
  ------------------
 2192|    959|  ftp_state(data, ftpc, FTP_STOP); /* this phase is completed */
  ------------------
  |  |  159|    959|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 2193|       |
 2194|    980|error:
 2195|    980|  curlx_free(newhost);
  ------------------
  |  | 1483|    980|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2196|    980|  return result;
 2197|    959|}
ftp.c:ftp_control_addr_dup:
 2010|    981|{
 2011|    981|  struct connectdata *conn = data->conn;
 2012|    981|  struct ip_quadruple ipquad;
 2013|    981|  bool is_ipv6;
 2014|       |
 2015|       |  /* Returns the control connection IP address.
 2016|       |     If a proxy tunnel is used, returns the original hostname instead, because
 2017|       |     the effective control connection address is the proxy address,
 2018|       |     not the ftp host. */
 2019|    981|#ifndef CURL_DISABLE_PROXY
 2020|    981|  if(conn->bits.tunnel_proxy || conn->bits.socksproxy)
  ------------------
  |  Branch (2020:6): [True: 0, False: 981]
  |  Branch (2020:33): [True: 1, False: 980]
  ------------------
 2021|      1|    *newhostp = curlx_strdup(conn->origin->hostname);
  ------------------
  |  | 1477|      1|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 2022|    980|  else
 2023|    980|#endif
 2024|    980|  if(!Curl_conn_get_ip_info(data, conn, FIRSTSOCKET, &is_ipv6, &ipquad) &&
  ------------------
  |  |  303|    980|#define FIRSTSOCKET     0
  ------------------
  |  Branch (2024:6): [True: 980, False: 0]
  ------------------
 2025|    980|     *ipquad.remote_ip)
  ------------------
  |  Branch (2025:6): [True: 978, False: 2]
  ------------------
 2026|    978|    *newhostp = curlx_strdup(ipquad.remote_ip);
  ------------------
  |  | 1477|    978|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 2027|      2|  else {
 2028|       |    /* failed to get the remote_ip of the DATA connection */
 2029|      2|    failf(data, "unable to get peername of DATA connection");
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
 2030|      2|    *newhostp = NULL;
 2031|      2|    return CURLE_FTP_CANT_GET_HOST;
 2032|      2|  }
 2033|    979|  return *newhostp ? CURLE_OK : CURLE_OUT_OF_MEMORY;
  ------------------
  |  Branch (2033:10): [True: 979, False: 0]
  ------------------
 2034|    981|}
ftp.c:match_pasv_6nums:
 2038|  27.5k|{
 2039|  27.5k|  int i;
 2040|  40.2k|  for(i = 0; i < 6; i++) {
  ------------------
  |  Branch (2040:14): [True: 39.3k, False: 980]
  ------------------
 2041|  39.3k|    curl_off_t num;
 2042|  39.3k|    if(i) {
  ------------------
  |  Branch (2042:8): [True: 11.7k, False: 27.5k]
  ------------------
 2043|  11.7k|      if(*p != ',')
  ------------------
  |  Branch (2043:10): [True: 5.72k, False: 6.00k]
  ------------------
 2044|  5.72k|        return FALSE;
  ------------------
  |  | 1058|  5.72k|#define FALSE false
  ------------------
 2045|  6.00k|      p++;
 2046|  6.00k|    }
 2047|  33.5k|    if(curlx_str_number(&p, &num, 0xff))
  ------------------
  |  Branch (2047:8): [True: 20.8k, False: 12.7k]
  ------------------
 2048|  20.8k|      return FALSE;
  ------------------
  |  | 1058|  20.8k|#define FALSE false
  ------------------
 2049|  12.7k|    array[i] = (unsigned int)num;
 2050|  12.7k|  }
 2051|    980|  return TRUE;
  ------------------
  |  | 1055|    980|#define TRUE true
  ------------------
 2052|  27.5k|}
ftp.c:ftp_state_get_resp:
 2792|    652|{
 2793|    652|  CURLcode result = CURLE_OK;
 2794|       |
 2795|    652|  if((ftpcode == 150) || (ftpcode == 125)) {
  ------------------
  |  Branch (2795:6): [True: 292, False: 360]
  |  Branch (2795:26): [True: 338, False: 22]
  ------------------
 2796|       |
 2797|       |    /*
 2798|       |      A;
 2799|       |      150 Opening BINARY mode data connection for /etc/passwd (2241
 2800|       |      bytes).  (ok, the file is being transferred)
 2801|       |
 2802|       |      B:
 2803|       |      150 Opening ASCII mode data connection for /bin/ls
 2804|       |
 2805|       |      C:
 2806|       |      150 ASCII data connection for /bin/ls (137.167.104.91,37445) (0 bytes).
 2807|       |
 2808|       |      D:
 2809|       |      150 Opening ASCII mode data connection for [file] (0.0.0.0,0) (545 bytes)
 2810|       |
 2811|       |      E:
 2812|       |      125 Data connection already open; Transfer starting. */
 2813|       |
 2814|    630|    data->req.size = -1; /* default unknown size */
 2815|       |
 2816|       |    /*
 2817|       |     * It appears that there are FTP-servers that return size 0 for files when
 2818|       |     * SIZE is used on the file while being in BINARY mode. To work around
 2819|       |     * that (stupid) behavior, we attempt to parse the RETR response even if
 2820|       |     * the SIZE returned size zero.
 2821|       |     *
 2822|       |     * Debugging help from Salvatore Sorrentino on February 26, 2003.
 2823|       |     */
 2824|       |
 2825|    630|    if((instate != FTP_LIST) &&
  ------------------
  |  Branch (2825:8): [True: 52, False: 578]
  ------------------
 2826|     52|       !data->state.prefer_ascii &&
  ------------------
  |  Branch (2826:8): [True: 51, False: 1]
  ------------------
 2827|     51|       !data->set.ignorecl &&
  ------------------
  |  Branch (2827:8): [True: 50, False: 1]
  ------------------
 2828|     50|       (ftp->downloadsize < 1)) {
  ------------------
  |  Branch (2828:8): [True: 49, False: 1]
  ------------------
 2829|       |      /*
 2830|       |       * It seems directory listings either do not show the size or often uses
 2831|       |       * size 0 anyway. ASCII transfers may cause that the transferred amount
 2832|       |       * of data is not the same as this line tells, why using this number in
 2833|       |       * those cases only confuses us.
 2834|       |       *
 2835|       |       * Example D above makes this parsing a little tricky */
 2836|     49|      size_t len = curlx_dyn_len(&ftpc->pp.recvbuf);
 2837|     49|      if(len >= 7) { /* "1 bytes" is 7 characters */
  ------------------
  |  Branch (2837:10): [True: 48, False: 1]
  ------------------
 2838|     48|        size_t i;
 2839|  7.64k|        for(i = 0; i < len - 7; i++) {
  ------------------
  |  Branch (2839:20): [True: 7.60k, False: 44]
  ------------------
 2840|  7.60k|          curl_off_t what;
 2841|  7.60k|          const char *buf = curlx_dyn_ptr(&ftpc->pp.recvbuf);
 2842|  7.60k|          const char *c = &buf[i];
 2843|  7.60k|          if(!curlx_str_number(&c, &what, CURL_OFF_T_MAX) &&
  ------------------
  |  |  594|  7.60k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (2843:14): [True: 1.55k, False: 6.04k]
  ------------------
 2844|  1.55k|             !curlx_str_single(&c, ' ') &&
  ------------------
  |  Branch (2844:14): [True: 650, False: 906]
  ------------------
 2845|    650|             !strncmp(c, "bytes", 5)) {
  ------------------
  |  Branch (2845:14): [True: 4, False: 646]
  ------------------
 2846|      4|            data->req.size = what;
 2847|      4|            break;
 2848|      4|          }
 2849|  7.60k|        }
 2850|     48|      }
 2851|     49|    }
 2852|    581|    else if(ftp->downloadsize > -1)
  ------------------
  |  Branch (2852:13): [True: 1, False: 580]
  ------------------
 2853|      1|      data->req.size = ftp->downloadsize;
 2854|       |
 2855|    630|    if(data->req.size > data->req.maxdownload && data->req.maxdownload > 0)
  ------------------
  |  Branch (2855:8): [True: 5, False: 625]
  |  Branch (2855:50): [True: 0, False: 5]
  ------------------
 2856|      0|      data->req.size = data->req.maxdownload;
 2857|    630|    else if((instate != FTP_LIST) && (data->state.prefer_ascii))
  ------------------
  |  Branch (2857:13): [True: 52, False: 578]
  |  Branch (2857:38): [True: 1, False: 51]
  ------------------
 2858|      1|      data->req.size = -1; /* for servers that understate ASCII mode file
 2859|       |                              size */
 2860|       |
 2861|    630|    infof(data, "Maxdownload = %" FMT_OFF_T, data->req.maxdownload);
  ------------------
  |  |  143|    630|  do {                               \
  |  |  144|    630|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    630|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 630, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 630]
  |  |  |  |  ------------------
  |  |  |  |  320|    630|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    630|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    630|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 630]
  |  |  ------------------
  ------------------
 2862|       |
 2863|    630|    if(instate != FTP_LIST)
  ------------------
  |  Branch (2863:8): [True: 52, False: 578]
  ------------------
 2864|     52|      infof(data, "Getting file with size: %" FMT_OFF_T, data->req.size);
  ------------------
  |  |  143|     52|  do {                               \
  |  |  144|     52|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     52|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 52, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 52]
  |  |  |  |  ------------------
  |  |  |  |  320|     52|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     52|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     52|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 52]
  |  |  ------------------
  ------------------
 2865|       |
 2866|    630|    if(data->set.ftp_use_port) {
  ------------------
  |  Branch (2866:8): [True: 0, False: 630]
  ------------------
 2867|      0|      bool connected;
 2868|       |
 2869|      0|      result = Curl_conn_connect(data, SECONDARYSOCKET, FALSE, &connected);
  ------------------
  |  |  304|      0|#define SECONDARYSOCKET 1
  ------------------
                    result = Curl_conn_connect(data, SECONDARYSOCKET, FALSE, &connected);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2870|      0|      if(result)
  ------------------
  |  Branch (2870:10): [True: 0, False: 0]
  ------------------
 2871|      0|        return result;
 2872|       |
 2873|      0|      if(!connected) {
  ------------------
  |  Branch (2873:10): [True: 0, False: 0]
  ------------------
 2874|      0|        infof(data, "Data conn was not available immediately");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2875|      0|        ftp_state(data, ftpc, FTP_STOP);
  ------------------
  |  |  159|      0|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 2876|      0|        ftpc->wait_data_conn = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2877|      0|        return ftp_check_ctrl_on_data_wait(data, ftpc);
 2878|      0|      }
 2879|      0|      ftpc->wait_data_conn = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2880|      0|    }
 2881|    630|    return ftp_initiate_transfer(data, ftpc);
 2882|    630|  }
 2883|     22|  else {
 2884|     22|    if((instate == FTP_LIST) && (ftpcode == 450)) {
  ------------------
  |  Branch (2884:8): [True: 15, False: 7]
  |  Branch (2884:33): [True: 1, False: 14]
  ------------------
 2885|       |      /* no matching files in the directory listing */
 2886|      1|      ftp->transfer = PPTRANSFER_NONE; /* do not download anything */
 2887|      1|      ftp_state(data, ftpc, FTP_STOP); /* this phase is over */
  ------------------
  |  |  159|      1|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 2888|      1|    }
 2889|     21|    else {
 2890|     21|      failf(data, "RETR response: %03d", ftpcode);
  ------------------
  |  |   62|     21|#define failf Curl_failf
  ------------------
 2891|     21|      return instate == FTP_RETR && ftpcode == 550 ?
  ------------------
  |  Branch (2891:14): [True: 7, False: 14]
  |  Branch (2891:37): [True: 0, False: 7]
  ------------------
 2892|      0|        CURLE_REMOTE_FILE_NOT_FOUND :
 2893|     21|        CURLE_FTP_COULDNT_RETR_FILE;
 2894|     21|    }
 2895|     22|  }
 2896|       |
 2897|      1|  return result;
 2898|    652|}
ftp.c:ftp_state_stor_resp:
 2757|     35|{
 2758|     35|  CURLcode result = CURLE_OK;
 2759|       |
 2760|     35|  if(ftpcode >= 400) {
  ------------------
  |  Branch (2760:6): [True: 1, False: 34]
  ------------------
 2761|      1|    failf(data, "Failed FTP upload: %0d", ftpcode);
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
 2762|      1|    ftp_state(data, ftpc, FTP_STOP);
  ------------------
  |  |  159|      1|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 2763|      1|    return CURLE_UPLOAD_FAILED;
 2764|      1|  }
 2765|       |
 2766|       |  /* PORT means we are now awaiting the server to connect to us. */
 2767|     34|  if(data->set.ftp_use_port) {
  ------------------
  |  Branch (2767:6): [True: 0, False: 34]
  ------------------
 2768|      0|    bool connected;
 2769|       |
 2770|      0|    ftp_state(data, ftpc, FTP_STOP); /* no longer in STOR state */
  ------------------
  |  |  159|      0|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 2771|       |
 2772|      0|    result = Curl_conn_connect(data, SECONDARYSOCKET, FALSE, &connected);
  ------------------
  |  |  304|      0|#define SECONDARYSOCKET 1
  ------------------
                  result = Curl_conn_connect(data, SECONDARYSOCKET, FALSE, &connected);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2773|      0|    if(result)
  ------------------
  |  Branch (2773:8): [True: 0, False: 0]
  ------------------
 2774|      0|      return result;
 2775|       |
 2776|      0|    if(!connected) {
  ------------------
  |  Branch (2776:8): [True: 0, False: 0]
  ------------------
 2777|      0|      infof(data, "Data conn was not available immediately");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2778|      0|      ftpc->wait_data_conn = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2779|      0|      return ftp_check_ctrl_on_data_wait(data, ftpc);
 2780|      0|    }
 2781|      0|    ftpc->wait_data_conn = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2782|      0|  }
 2783|     34|  return ftp_initiate_transfer(data, ftpc);
 2784|     34|}
ftp.c:ftp_endofresp:
  579|   833k|{
  580|   833k|  curl_off_t status;
  581|   833k|  (void)data;
  582|   833k|  (void)conn;
  583|       |
  584|   833k|  if((len > 3) && LASTLINE(line) && !curlx_str_number(&line, &status, 999)) {
  ------------------
  |  |   86|   871k|#define LASTLINE(line) (STATUSCODE(line) && (' ' == (line)[3]))
  |  |  ------------------
  |  |  |  |   83|  75.9k|  (ISDIGIT((line)[0]) && ISDIGIT((line)[1]) && ISDIGIT((line)[2]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   44|  75.9k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (44:22): [True: 28.6k, False: 9.33k]
  |  |  |  |  |  |  |  Branch (44:38): [True: 23.4k, False: 5.20k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                 (ISDIGIT((line)[0]) && ISDIGIT((line)[1]) && ISDIGIT((line)[2]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   44|  61.4k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (44:22): [True: 21.9k, False: 1.45k]
  |  |  |  |  |  |  |  Branch (44:38): [True: 20.7k, False: 1.25k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                 (ISDIGIT((line)[0]) && ISDIGIT((line)[1]) && ISDIGIT((line)[2]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   44|  20.7k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (44:22): [True: 18.1k, False: 2.57k]
  |  |  |  |  |  |  |  Branch (44:38): [True: 18.0k, False: 155]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (86:45): [True: 16.4k, False: 1.54k]
  |  |  ------------------
  ------------------
  |  Branch (584:6): [True: 37.9k, False: 795k]
  |  Branch (584:37): [True: 16.4k, False: 0]
  ------------------
  585|  16.4k|    *code = (int)status;
  586|  16.4k|    return TRUE;
  ------------------
  |  | 1055|  16.4k|#define TRUE true
  ------------------
  587|  16.4k|  }
  588|       |
  589|   817k|  return FALSE;
  ------------------
  |  | 1058|   817k|#define FALSE false
  ------------------
  590|   833k|}
ftp.c:ftp_multi_statemach:
 3480|  7.66k|{
 3481|  7.66k|  struct ftp_conn *ftpc = Curl_conn_meta_get(data->conn, CURL_META_FTP_CONN);
  ------------------
  |  |  156|  7.66k|#define CURL_META_FTP_CONN   "meta:proto:ftp:conn"
  ------------------
 3482|  7.66k|  return ftpc ? ftp_statemach(data, ftpc, done) : CURLE_FAILED_INIT;
  ------------------
  |  Branch (3482:10): [True: 7.66k, False: 0]
  ------------------
 3483|  7.66k|}
ftp.c:ftp_doing:
 4330|  2.36k|{
 4331|  2.36k|  struct ftp_conn *ftpc = Curl_conn_meta_get(data->conn, CURL_META_FTP_CONN);
  ------------------
  |  |  156|  2.36k|#define CURL_META_FTP_CONN   "meta:proto:ftp:conn"
  ------------------
 4332|  2.36k|  struct FTP *ftp = Curl_meta_get(data, CURL_META_FTP_EASY);
  ------------------
  |  |  154|  2.36k|#define CURL_META_FTP_EASY   "meta:proto:ftp:easy"
  ------------------
 4333|  2.36k|  CURLcode result;
 4334|       |
 4335|  2.36k|  if(!ftpc || !ftp)
  ------------------
  |  Branch (4335:6): [True: 0, False: 2.36k]
  |  Branch (4335:15): [True: 0, False: 2.36k]
  ------------------
 4336|      0|    return CURLE_FAILED_INIT;
 4337|  2.36k|  result = ftp_statemach(data, ftpc, dophase_done);
 4338|       |
 4339|  2.36k|  if(result)
  ------------------
  |  Branch (4339:6): [True: 254, False: 2.10k]
  ------------------
 4340|    254|    CURL_TRC_FTP(data, "[%s] DO phase failed", FTP_CSTATE(ftpc));
  ------------------
  |  |  180|    254|  do {                                                   \
  |  |  181|    254|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|    254|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    508|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 254, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 254]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    508|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    254|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|    254|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (182:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  183|    254|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 254]
  |  |  ------------------
  ------------------
 4341|  2.10k|  else if(*dophase_done) {
  ------------------
  |  Branch (4341:11): [True: 963, False: 1.14k]
  ------------------
 4342|    963|    result = ftp_dophase_done(data, ftpc, ftp, FALSE /* not connected */);
  ------------------
  |  | 1058|    963|#define FALSE false
  ------------------
 4343|       |
 4344|    963|    CURL_TRC_FTP(data, "[%s] DO phase is complete2", FTP_CSTATE(ftpc));
  ------------------
  |  |  180|    963|  do {                                                   \
  |  |  181|    963|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|    963|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  1.92k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 963, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 963]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  1.92k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    963|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|    963|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (182:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  183|    963|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 963]
  |  |  ------------------
  ------------------
 4345|    963|  }
 4346|  2.36k|  return result;
 4347|  2.36k|}
ftp.c:ftp_pollset:
  772|  7.21k|{
  773|  7.21k|  struct ftp_conn *ftpc = Curl_conn_meta_get(data->conn, CURL_META_FTP_CONN);
  ------------------
  |  |  156|  7.21k|#define CURL_META_FTP_CONN   "meta:proto:ftp:conn"
  ------------------
  774|  7.21k|  return ftpc ? Curl_pp_pollset(data, &ftpc->pp, ps) : CURLE_OK;
  ------------------
  |  Branch (774:10): [True: 7.21k, False: 0]
  ------------------
  775|  7.21k|}
ftp.c:ftp_domore_pollset:
  780|   154k|{
  781|   154k|  struct ftp_conn *ftpc = Curl_conn_meta_get(data->conn, CURL_META_FTP_CONN);
  ------------------
  |  |  156|   154k|#define CURL_META_FTP_CONN   "meta:proto:ftp:conn"
  ------------------
  782|       |
  783|   154k|  if(!ftpc)
  ------------------
  |  Branch (783:6): [True: 0, False: 154k]
  ------------------
  784|      0|    return CURLE_OK;
  785|       |
  786|       |  /* When in DO_MORE state, we could be either waiting for us to connect to a
  787|       |   * remote site, or we could wait for that site to connect to us. Or handle
  788|       |   * ordinary commands.
  789|       |   */
  790|   154k|  CURL_TRC_FTP(data, "[%s] ftp_domore_pollset()", FTP_CSTATE(ftpc));
  ------------------
  |  |  180|   154k|  do {                                                   \
  |  |  181|   154k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|   154k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|   308k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 154k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 154k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|   308k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|   154k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|   154k|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (182:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  183|   154k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 154k]
  |  |  ------------------
  ------------------
  791|       |
  792|   154k|  if(FTP_STOP == ftpc->state) {
  ------------------
  |  Branch (792:6): [True: 152k, False: 1.52k]
  ------------------
  793|       |    /* if stopped and still in this state, then we are also waiting for a
  794|       |       connect on the secondary connection */
  795|   152k|    DEBUGASSERT(data->conn->sock[SECONDARYSOCKET] != CURL_SOCKET_BAD ||
  ------------------
  |  | 1081|   152k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (795:5): [True: 0, False: 0]
  |  Branch (795:5): [True: 0, False: 0]
  |  Branch (795:5): [True: 152k, False: 0]
  |  Branch (795:5): [True: 152k, False: 0]
  |  Branch (795:5): [True: 152k, False: 0]
  |  Branch (795:5): [True: 0, False: 152k]
  ------------------
  796|   152k|                (data->conn->cfilter[SECONDARYSOCKET] &&
  797|   152k|                 !Curl_conn_is_connected(data->conn, SECONDARYSOCKET)));
  798|       |    /* An unconnected SECONDARY will add its socket by itself
  799|       |     * via its adjust_pollset() */
  800|   152k|    return Curl_pollset_add_in(data, ps, data->conn->sock[FIRSTSOCKET]);
  ------------------
  |  |  162|   152k|  Curl_pollset_change(data, ps, sock, CURL_POLL_IN, 0)
  |  |  ------------------
  |  |  |  |  283|   152k|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
  801|   152k|  }
  802|  1.52k|  return Curl_pp_pollset(data, &ftpc->pp, ps);
  803|   154k|}
ftp.c:ftp_disconnect:
 4306|  4.98k|{
 4307|  4.98k|  struct ftp_conn *ftpc = Curl_conn_meta_get(conn, CURL_META_FTP_CONN);
  ------------------
  |  |  156|  4.98k|#define CURL_META_FTP_CONN   "meta:proto:ftp:conn"
  ------------------
 4308|       |
 4309|  4.98k|  if(!ftpc)
  ------------------
  |  Branch (4309:6): [True: 21, False: 4.96k]
  ------------------
 4310|     21|    return CURLE_FAILED_INIT;
 4311|       |  /* We cannot send quit unconditionally. If this connection is stale or
 4312|       |     bad in any way, sending quit and waiting around here will make the
 4313|       |     disconnect wait in vain and cause more problems than we need to.
 4314|       |
 4315|       |     ftp_quit() will check the state of ftp->ctl_valid. If it is ok it
 4316|       |     will try to send the QUIT command, otherwise it will return.
 4317|       |  */
 4318|  4.96k|  ftpc->shutdown = TRUE;
  ------------------
  |  | 1055|  4.96k|#define TRUE true
  ------------------
 4319|  4.96k|  if(dead_connection || Curl_pp_needs_flush(data, &ftpc->pp))
  ------------------
  |  Branch (4319:6): [True: 3.60k, False: 1.36k]
  |  Branch (4319:25): [True: 0, False: 1.36k]
  ------------------
 4320|  3.60k|    ftpc->ctl_valid = FALSE;
  ------------------
  |  | 1058|  3.60k|#define FALSE false
  ------------------
 4321|       |
 4322|       |  /* The FTP session may or may not have been allocated/setup at this point! */
 4323|  4.96k|  (void)ftp_quit(data, ftpc); /* ignore errors on the QUIT */
 4324|  4.96k|  return CURLE_OK;
 4325|  4.98k|}
ftp.c:ftp_quit:
 4273|  4.96k|{
 4274|  4.96k|  CURLcode result = CURLE_OK;
 4275|       |
 4276|  4.96k|  if(ftpc->ctl_valid) {
  ------------------
  |  Branch (4276:6): [True: 899, False: 4.06k]
  ------------------
 4277|    899|    CURL_TRC_FTP(data, "sending QUIT to close session");
  ------------------
  |  |  180|    899|  do {                                                   \
  |  |  181|    899|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|    899|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  1.79k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 899, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 899]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  1.79k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    899|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|    899|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  183|    899|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 899]
  |  |  ------------------
  ------------------
 4278|    899|    result = Curl_pp_sendf(data, &ftpc->pp, "%s", "QUIT");
 4279|    899|    if(result) {
  ------------------
  |  Branch (4279:8): [True: 0, False: 899]
  ------------------
 4280|      0|      failf(data, "Failure sending QUIT command: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4281|      0|            curl_easy_strerror(result));
 4282|      0|      ftpc->ctl_valid = FALSE; /* mark control connection as bad */
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 4283|      0|      connclose(data->conn, "QUIT command failed"); /* mark for closure */
  ------------------
  |  |  103|      0|#define connclose(x, y)   Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
  |  |  ------------------
  |  |  |  |   91|      0|#define CONNCTRL_CONNECTION 1
  |  |  ------------------
  ------------------
 4284|      0|      ftp_state(data, ftpc, FTP_STOP);
  ------------------
  |  |  159|      0|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 4285|      0|      return result;
 4286|      0|    }
 4287|       |
 4288|    899|    ftp_state(data, ftpc, FTP_QUIT);
  ------------------
  |  |  159|    899|#define ftp_state(x, y, z) ftp_state_low(x, y, z, __LINE__)
  ------------------
 4289|       |
 4290|    899|    result = ftp_block_statemach(data, ftpc);
 4291|    899|  }
 4292|       |
 4293|  4.96k|  return result;
 4294|  4.96k|}
ftp.c:ftp_block_statemach:
 3487|    899|{
 3488|    899|  struct pingpong *pp = &ftpc->pp;
 3489|    899|  CURLcode result = CURLE_OK;
 3490|       |
 3491|    899|  while(ftpc->state != FTP_STOP) {
  ------------------
  |  Branch (3491:9): [True: 899, False: 0]
  ------------------
 3492|    899|    if(ftpc->shutdown)
  ------------------
  |  Branch (3492:8): [True: 899, False: 0]
  ------------------
 3493|    899|      CURL_TRC_FTP(data, "in shutdown, waiting for server response");
  ------------------
  |  |  180|    899|  do {                                                   \
  |  |  181|    899|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \
  |  |  ------------------
  |  |  |  |  326|    899|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  1.79k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 899, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 899]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  1.79k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    899|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  182|    899|      Curl_trc_ftp(data, __VA_ARGS__);                   \
  |  |  183|    899|  } while(0)
  |  |  ------------------
  |  |  |  Branch (183:11): [Folded, False: 899]
  |  |  ------------------
  ------------------
 3494|    899|    result = Curl_pp_statemach(data, pp, TRUE, TRUE /* disconnecting */);
  ------------------
  |  | 1055|    899|#define TRUE true
  ------------------
                  result = Curl_pp_statemach(data, pp, TRUE, TRUE /* disconnecting */);
  ------------------
  |  | 1055|    899|#define TRUE true
  ------------------
 3495|    899|    if(result)
  ------------------
  |  Branch (3495:8): [True: 899, False: 0]
  ------------------
 3496|    899|      break;
 3497|    899|  }
 3498|       |
 3499|    899|  return result;
 3500|    899|}

Curl_wildcard_init:
  183|    584|{
  184|    584|  Curl_llist_init(&wc->filelist, fileinfo_dtor);
  185|    584|  wc->state = CURLWC_INIT;
  186|    584|}
Curl_wildcard_dtor:
  189|  54.4k|{
  190|  54.4k|  struct WildcardData *wc = *wcp;
  191|  54.4k|  if(!wc)
  ------------------
  |  Branch (191:6): [True: 53.9k, False: 584]
  ------------------
  192|  53.9k|    return;
  193|       |
  194|    584|  if(wc->dtor) {
  ------------------
  |  Branch (194:6): [True: 437, False: 147]
  ------------------
  195|    437|    wc->dtor(wc->ftpwc);
  196|    437|    wc->dtor = ZERO_NULL;
  ------------------
  |  | 1155|    437|#define ZERO_NULL 0
  ------------------
  197|    437|    wc->ftpwc = NULL;
  198|    437|  }
  199|    584|  DEBUGASSERT(wc->ftpwc == NULL);
  ------------------
  |  | 1081|    584|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (199:3): [True: 0, False: 584]
  |  Branch (199:3): [True: 584, False: 0]
  ------------------
  200|       |
  201|    584|  Curl_llist_destroy(&wc->filelist, NULL);
  202|    584|  curlx_safefree(wc->path);
  ------------------
  |  | 1327|    584|  do {                      \
  |  | 1328|    584|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|    584|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|    584|    (ptr) = NULL;           \
  |  | 1330|    584|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 584]
  |  |  ------------------
  ------------------
  203|    584|  curlx_safefree(wc->pattern);
  ------------------
  |  | 1327|    584|  do {                      \
  |  | 1328|    584|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|    584|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|    584|    (ptr) = NULL;           \
  |  | 1330|    584|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 584]
  |  |  ------------------
  ------------------
  204|    584|  wc->state = CURLWC_INIT;
  205|    584|  curlx_free(wc);
  ------------------
  |  | 1483|    584|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  206|       |  *wcp = NULL;
  207|    584|}
Curl_ftp_parselist_data_alloc:
  210|    438|{
  211|    438|  return curlx_calloc(1, sizeof(struct ftp_parselist_data));
  ------------------
  |  | 1480|    438|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  212|    438|}
Curl_ftp_parselist_data_free:
  215|    438|{
  216|    438|  struct ftp_parselist_data *parser = *parserp;
  217|    438|  if(parser)
  ------------------
  |  Branch (217:6): [True: 438, False: 0]
  ------------------
  218|    438|    Curl_fileinfo_cleanup(parser->file_data);
  219|    438|  curlx_free(parser);
  ------------------
  |  | 1483|    438|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  220|       |  *parserp = NULL;
  221|    438|}
Curl_ftp_parselist_geterror:
  224|     24|{
  225|     24|  return pl_data->error;
  226|     24|}
Curl_ftp_parselist:
 1013|  1.51k|{
 1014|  1.51k|  size_t bufflen = size * nmemb;
 1015|  1.51k|  struct Curl_easy *data = (struct Curl_easy *)connptr;
 1016|  1.51k|  struct ftp_wc *ftpwc = data->wildcard->ftpwc;
 1017|  1.51k|  struct ftp_parselist_data *parser = ftpwc->parser;
 1018|  1.51k|  size_t i = 0;
 1019|  1.51k|  CURLcode result;
 1020|  1.51k|  size_t retsize = bufflen;
 1021|       |
 1022|  1.51k|  if(parser->error) { /* error in previous call */
  ------------------
  |  Branch (1022:6): [True: 631, False: 886]
  ------------------
 1023|       |    /* scenario:
 1024|       |     * 1. call => OK..
 1025|       |     * 2. call => OUT_OF_MEMORY (or other error)
 1026|       |     * 3. (last) call => is skipped RIGHT HERE and the error is handled later
 1027|       |     *    in wc_statemach()
 1028|       |     */
 1029|    631|    goto fail;
 1030|    631|  }
 1031|       |
 1032|    886|  if(parser->os_type == OS_TYPE_UNKNOWN && bufflen > 0) {
  ------------------
  |  Branch (1032:6): [True: 413, False: 473]
  |  Branch (1032:44): [True: 413, False: 0]
  ------------------
 1033|       |    /* considering info about FILE response format */
 1034|    413|    parser->os_type = ISDIGIT(buffer[0]) ? OS_TYPE_WIN_NT : OS_TYPE_UNIX;
  ------------------
  |  |   44|    413|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 410, False: 3]
  |  |  |  Branch (44:38): [True: 81, False: 329]
  |  |  ------------------
  ------------------
 1035|    413|  }
 1036|       |
 1037|  64.0k|  while(i < bufflen) { /* FSM */
  ------------------
  |  Branch (1037:9): [True: 63.5k, False: 505]
  ------------------
 1038|  63.5k|    char c = buffer[i];
 1039|  63.5k|    struct fileinfo *infop;
 1040|  63.5k|    if(!parser->file_data) { /* tmp file data is not allocated yet */
  ------------------
  |  Branch (1040:8): [True: 789, False: 62.7k]
  ------------------
 1041|    789|      parser->file_data = Curl_fileinfo_alloc();
 1042|    789|      if(!parser->file_data) {
  ------------------
  |  Branch (1042:10): [True: 0, False: 789]
  ------------------
 1043|      0|        parser->error = CURLE_OUT_OF_MEMORY;
 1044|      0|        goto fail;
 1045|      0|      }
 1046|    789|      parser->item_offset = 0;
 1047|    789|      parser->item_length = 0;
 1048|    789|      curlx_dyn_init(&parser->file_data->buf, MAX_FTPLIST_BUFFER);
  ------------------
  |  |  349|    789|#define MAX_FTPLIST_BUFFER 10000 /* arbitrarily set */
  ------------------
 1049|    789|    }
 1050|       |
 1051|  63.5k|    infop = parser->file_data;
 1052|       |
 1053|  63.5k|    if(curlx_dyn_addn(&infop->buf, &c, 1)) {
  ------------------
  |  Branch (1053:8): [True: 0, False: 63.5k]
  ------------------
 1054|      0|      parser->error = CURLE_OUT_OF_MEMORY;
 1055|      0|      goto fail;
 1056|      0|    }
 1057|       |
 1058|  63.5k|    switch(parser->os_type) {
 1059|  54.3k|    case OS_TYPE_UNIX:
  ------------------
  |  Branch (1059:5): [True: 54.3k, False: 9.18k]
  ------------------
 1060|  54.3k|      result = parse_unix(data, parser, infop, c);
 1061|  54.3k|      break;
 1062|  9.18k|    case OS_TYPE_WIN_NT:
  ------------------
  |  Branch (1062:5): [True: 9.18k, False: 54.3k]
  ------------------
 1063|  9.18k|      result = parse_winnt(data, parser, infop, c);
 1064|  9.18k|      break;
 1065|      0|    default:
  ------------------
  |  Branch (1065:5): [True: 0, False: 63.5k]
  ------------------
 1066|      0|      retsize = bufflen + 1;
 1067|      0|      goto fail;
 1068|  63.5k|    }
 1069|  63.5k|    if(result) {
  ------------------
  |  Branch (1069:8): [True: 381, False: 63.1k]
  ------------------
 1070|    381|      parser->error = result;
 1071|    381|      goto fail;
 1072|    381|    }
 1073|       |
 1074|  63.1k|    i++;
 1075|  63.1k|  }
 1076|    505|  return retsize;
 1077|       |
 1078|  1.01k|fail:
 1079|       |
 1080|       |  /* Clean up any allocated memory. */
 1081|  1.01k|  if(parser->file_data) {
  ------------------
  |  Branch (1081:6): [True: 381, False: 631]
  ------------------
 1082|    381|    Curl_fileinfo_cleanup(parser->file_data);
 1083|    381|    parser->file_data = NULL;
 1084|    381|  }
 1085|       |
 1086|  1.01k|  return retsize;
 1087|    886|}
ftplistparser.c:fileinfo_dtor:
  177|    139|{
  178|    139|  (void)user;
  179|    139|  Curl_fileinfo_cleanup(element);
  180|    139|}
ftplistparser.c:parse_unix:
  831|  54.3k|{
  832|  54.3k|  struct curl_fileinfo *finfo = &infop->info;
  833|  54.3k|  CURLcode result = CURLE_OK;
  834|       |
  835|  54.3k|  switch(parser->state.UNIX.main) {
  ------------------
  |  Branch (835:10): [True: 54.3k, False: 0]
  ------------------
  836|  2.12k|  case PL_UNIX_TOTALSIZE:
  ------------------
  |  Branch (836:3): [True: 2.12k, False: 52.2k]
  ------------------
  837|  2.12k|    result = parse_unix_totalsize(parser, infop, c);
  838|  2.12k|    if(result)
  ------------------
  |  Branch (838:8): [True: 23, False: 2.10k]
  ------------------
  839|     23|      break;
  840|  2.10k|    if(parser->state.UNIX.main != PL_UNIX_FILETYPE)
  ------------------
  |  Branch (840:8): [True: 1.79k, False: 308]
  ------------------
  841|  1.79k|      break;
  842|    308|    FALLTHROUGH();
  ------------------
  |  |  821|    308|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  843|    567|  case PL_UNIX_FILETYPE:
  ------------------
  |  Branch (843:3): [True: 259, False: 54.1k]
  ------------------
  844|    567|    result = unix_filetype(c, &finfo->filetype);
  845|    567|    if(!result) {
  ------------------
  |  Branch (845:8): [True: 551, False: 16]
  ------------------
  846|    551|      parser->state.UNIX.main = PL_UNIX_PERMISSION;
  847|    551|      parser->item_length = 0;
  848|    551|      parser->item_offset = 1;
  849|    551|    }
  850|    567|    break;
  851|  5.40k|  case PL_UNIX_PERMISSION:
  ------------------
  |  Branch (851:3): [True: 5.40k, False: 48.9k]
  ------------------
  852|  5.40k|    result = parse_unix_permission(parser, infop, c);
  853|  5.40k|    break;
  854|  2.61k|  case PL_UNIX_HLINKS:
  ------------------
  |  Branch (854:3): [True: 2.61k, False: 51.7k]
  ------------------
  855|  2.61k|    result = parse_unix_hlinks(parser, infop, c);
  856|  2.61k|    break;
  857|  6.41k|  case PL_UNIX_USER:
  ------------------
  |  Branch (857:3): [True: 6.41k, False: 47.9k]
  ------------------
  858|  6.41k|    result = parse_unix_user(parser, infop, c);
  859|  6.41k|    break;
  860|  6.49k|  case PL_UNIX_GROUP:
  ------------------
  |  Branch (860:3): [True: 6.49k, False: 47.8k]
  ------------------
  861|  6.49k|    result = parse_unix_group(parser, infop, c);
  862|  6.49k|    break;
  863|  5.98k|  case PL_UNIX_SIZE:
  ------------------
  |  Branch (863:3): [True: 5.98k, False: 48.4k]
  ------------------
  864|  5.98k|    result = parse_unix_size(parser, infop, c);
  865|  5.98k|    break;
  866|  12.3k|  case PL_UNIX_TIME:
  ------------------
  |  Branch (866:3): [True: 12.3k, False: 41.9k]
  ------------------
  867|  12.3k|    result = parse_unix_time(parser, infop, c);
  868|  12.3k|    break;
  869|  8.69k|  case PL_UNIX_FILENAME:
  ------------------
  |  Branch (869:3): [True: 8.69k, False: 45.6k]
  ------------------
  870|  8.69k|    result = parse_unix_filename(data, parser, infop, c);
  871|  8.69k|    break;
  872|  3.99k|  case PL_UNIX_SYMLINK:
  ------------------
  |  Branch (872:3): [True: 3.99k, False: 50.3k]
  ------------------
  873|  3.99k|    result = parse_unix_symlink(data, parser, infop, c);
  874|  3.99k|    break;
  875|  54.3k|  }
  876|  54.3k|  return result;
  877|  54.3k|}
ftplistparser.c:parse_unix_totalsize:
  387|  2.12k|{
  388|  2.12k|  size_t len = curlx_dyn_len(&infop->buf);
  389|  2.12k|  char *mem = curlx_dyn_ptr(&infop->buf);
  390|  2.12k|  switch(parser->state.UNIX.sub.total_dirsize) {
  ------------------
  |  Branch (390:10): [True: 2.12k, False: 0]
  ------------------
  391|    332|  case PL_UNIX_TOTALSIZE_INIT:
  ------------------
  |  Branch (391:3): [True: 332, False: 1.79k]
  ------------------
  392|    332|    if(c == 't') {
  ------------------
  |  Branch (392:8): [True: 26, False: 306]
  ------------------
  393|     26|      parser->state.UNIX.sub.total_dirsize = PL_UNIX_TOTALSIZE_READING;
  394|     26|      parser->item_length++;
  395|     26|    }
  396|    306|    else {
  397|    306|      parser->state.UNIX.main = PL_UNIX_FILETYPE;
  398|       |      /* continue to fall through */
  399|    306|    }
  400|    332|    break;
  401|  1.79k|  case PL_UNIX_TOTALSIZE_READING:
  ------------------
  |  Branch (401:3): [True: 1.79k, False: 332]
  ------------------
  402|  1.79k|    parser->item_length++;
  403|  1.79k|    if(c == '\r') {
  ------------------
  |  Branch (403:8): [True: 0, False: 1.79k]
  ------------------
  404|      0|      parser->item_length--;
  405|      0|      if(len)
  ------------------
  |  Branch (405:10): [True: 0, False: 0]
  ------------------
  406|      0|        curlx_dyn_setlen(&infop->buf, --len);
  407|      0|    }
  408|  1.79k|    else if(c == '\n') {
  ------------------
  |  Branch (408:13): [True: 25, False: 1.76k]
  ------------------
  409|     25|      mem[parser->item_length - 1] = 0;
  410|     25|      if(!strncmp("total ", mem, 6)) {
  ------------------
  |  Branch (410:10): [True: 8, False: 17]
  ------------------
  411|      8|        const char *endptr = mem + 6;
  412|       |        /* here we can deal with directory size, pass the leading
  413|       |           whitespace and then the digits */
  414|      8|        curlx_str_passblanks(&endptr);
  415|     74|        while(ISDIGIT(*endptr))
  ------------------
  |  |   44|     74|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 69, False: 5]
  |  |  |  Branch (44:38): [True: 66, False: 3]
  |  |  ------------------
  ------------------
  416|     66|          endptr++;
  417|      8|        if(*endptr) {
  ------------------
  |  Branch (417:12): [True: 6, False: 2]
  ------------------
  418|      6|          return CURLE_FTP_BAD_FILE_LIST;
  419|      6|        }
  420|      2|        parser->state.UNIX.main = PL_UNIX_FILETYPE;
  421|      2|        curlx_dyn_reset(&infop->buf);
  422|      2|      }
  423|     17|      else
  424|     17|        return CURLE_FTP_BAD_FILE_LIST;
  425|     25|    }
  426|  1.77k|    break;
  427|  2.12k|  }
  428|  2.10k|  return CURLE_OK;
  429|  2.12k|}
ftplistparser.c:unix_filetype:
  352|    567|{
  353|    567|  switch(c) {
  354|     30|  case '-':
  ------------------
  |  Branch (354:3): [True: 30, False: 537]
  ------------------
  355|     30|    *t = CURLFILETYPE_FILE;
  356|     30|    break;
  357|    192|  case 'd':
  ------------------
  |  Branch (357:3): [True: 192, False: 375]
  ------------------
  358|    192|    *t = CURLFILETYPE_DIRECTORY;
  359|    192|    break;
  360|    127|  case 'l':
  ------------------
  |  Branch (360:3): [True: 127, False: 440]
  ------------------
  361|    127|    *t = CURLFILETYPE_SYMLINK;
  362|    127|    break;
  363|     11|  case 'p':
  ------------------
  |  Branch (363:3): [True: 11, False: 556]
  ------------------
  364|     11|    *t = CURLFILETYPE_NAMEDPIPE;
  365|     11|    break;
  366|     10|  case 's':
  ------------------
  |  Branch (366:3): [True: 10, False: 557]
  ------------------
  367|     10|    *t = CURLFILETYPE_SOCKET;
  368|     10|    break;
  369|     25|  case 'c':
  ------------------
  |  Branch (369:3): [True: 25, False: 542]
  ------------------
  370|     25|    *t = CURLFILETYPE_DEVICE_CHAR;
  371|     25|    break;
  372|     48|  case 'b':
  ------------------
  |  Branch (372:3): [True: 48, False: 519]
  ------------------
  373|     48|    *t = CURLFILETYPE_DEVICE_BLOCK;
  374|     48|    break;
  375|    108|  case 'D':
  ------------------
  |  Branch (375:3): [True: 108, False: 459]
  ------------------
  376|    108|    *t = CURLFILETYPE_DOOR;
  377|    108|    break;
  378|     16|  default:
  ------------------
  |  Branch (378:3): [True: 16, False: 551]
  ------------------
  379|     16|    return CURLE_FTP_BAD_FILE_LIST;
  380|    567|  }
  381|    551|  return CURLE_OK;
  382|    567|}
ftplistparser.c:parse_unix_permission:
  434|  5.40k|{
  435|  5.40k|  char *mem = curlx_dyn_ptr(&infop->buf);
  436|  5.40k|  parser->item_length++;
  437|  5.40k|  if((parser->item_length <= 9) && !strchr("rwx-tTsS", c))
  ------------------
  |  Branch (437:6): [True: 4.87k, False: 530]
  |  Branch (437:36): [True: 21, False: 4.85k]
  ------------------
  438|     21|    return CURLE_FTP_BAD_FILE_LIST;
  439|       |
  440|  5.38k|  else if(parser->item_length == 10) {
  ------------------
  |  Branch (440:11): [True: 530, False: 4.85k]
  ------------------
  441|    530|    unsigned int perm;
  442|    530|    if(c != ' ')
  ------------------
  |  Branch (442:8): [True: 3, False: 527]
  ------------------
  443|      3|      return CURLE_FTP_BAD_FILE_LIST;
  444|       |
  445|    527|    mem[10] = 0; /* terminate permissions */
  446|    527|    perm = ftp_pl_get_permission(mem + parser->item_offset);
  447|    527|    if(perm & FTP_LP_MALFORMATED_PERM)
  ------------------
  |  |  228|    527|#define FTP_LP_MALFORMATED_PERM 0x01000000
  ------------------
  |  Branch (447:8): [True: 17, False: 510]
  ------------------
  448|     17|      return CURLE_FTP_BAD_FILE_LIST;
  449|       |
  450|    510|    parser->file_data->info.flags |= CURLFINFOFLAG_KNOWN_PERM;
  ------------------
  |  |  309|    510|#define CURLFINFOFLAG_KNOWN_PERM        (1 << 3)
  ------------------
  451|    510|    parser->file_data->info.perm = perm;
  452|    510|    parser->offsets.perm = parser->item_offset;
  453|       |
  454|    510|    parser->item_length = 0;
  455|    510|    parser->state.UNIX.main = PL_UNIX_HLINKS;
  456|    510|    parser->state.UNIX.sub.hlinks = PL_UNIX_HLINKS_PRESPACE;
  457|    510|  }
  458|  5.36k|  return CURLE_OK;
  459|  5.40k|}
ftplistparser.c:ftp_pl_get_permission:
  231|    527|{
  232|    527|  unsigned int permissions = 0;
  233|       |  /* USER */
  234|    527|  if(str[0] == 'r')
  ------------------
  |  Branch (234:6): [True: 515, False: 12]
  ------------------
  235|    515|    permissions |= 1 << 8;
  236|     12|  else if(str[0] != '-')
  ------------------
  |  Branch (236:11): [True: 1, False: 11]
  ------------------
  237|      1|    permissions |= FTP_LP_MALFORMATED_PERM;
  ------------------
  |  |  228|      1|#define FTP_LP_MALFORMATED_PERM 0x01000000
  ------------------
  238|    527|  if(str[1] == 'w')
  ------------------
  |  Branch (238:6): [True: 478, False: 49]
  ------------------
  239|    478|    permissions |= 1 << 7;
  240|     49|  else if(str[1] != '-')
  ------------------
  |  Branch (240:11): [True: 9, False: 40]
  ------------------
  241|      9|    permissions |= FTP_LP_MALFORMATED_PERM;
  ------------------
  |  |  228|      9|#define FTP_LP_MALFORMATED_PERM 0x01000000
  ------------------
  242|       |
  243|    527|  if(str[2] == 'x')
  ------------------
  |  Branch (243:6): [True: 460, False: 67]
  ------------------
  244|    460|    permissions |= 1 << 6;
  245|     67|  else if(str[2] == 's') {
  ------------------
  |  Branch (245:11): [True: 30, False: 37]
  ------------------
  246|     30|    permissions |= 1 << 6;
  247|     30|    permissions |= 1 << 11;
  248|     30|  }
  249|     37|  else if(str[2] == 'S')
  ------------------
  |  Branch (249:11): [True: 15, False: 22]
  ------------------
  250|     15|    permissions |= 1 << 11;
  251|     22|  else if(str[2] != '-')
  ------------------
  |  Branch (251:11): [True: 4, False: 18]
  ------------------
  252|      4|    permissions |= FTP_LP_MALFORMATED_PERM;
  ------------------
  |  |  228|      4|#define FTP_LP_MALFORMATED_PERM 0x01000000
  ------------------
  253|       |  /* GROUP */
  254|    527|  if(str[3] == 'r')
  ------------------
  |  Branch (254:6): [True: 489, False: 38]
  ------------------
  255|    489|    permissions |= 1 << 5;
  256|     38|  else if(str[3] != '-')
  ------------------
  |  Branch (256:11): [True: 10, False: 28]
  ------------------
  257|     10|    permissions |= FTP_LP_MALFORMATED_PERM;
  ------------------
  |  |  228|     10|#define FTP_LP_MALFORMATED_PERM 0x01000000
  ------------------
  258|    527|  if(str[4] == 'w')
  ------------------
  |  Branch (258:6): [True: 38, False: 489]
  ------------------
  259|     38|    permissions |= 1 << 4;
  260|    489|  else if(str[4] != '-')
  ------------------
  |  Branch (260:11): [True: 10, False: 479]
  ------------------
  261|     10|    permissions |= FTP_LP_MALFORMATED_PERM;
  ------------------
  |  |  228|     10|#define FTP_LP_MALFORMATED_PERM 0x01000000
  ------------------
  262|    527|  if(str[5] == 'x')
  ------------------
  |  Branch (262:6): [True: 256, False: 271]
  ------------------
  263|    256|    permissions |= 1 << 3;
  264|    271|  else if(str[5] == 's') {
  ------------------
  |  Branch (264:11): [True: 184, False: 87]
  ------------------
  265|    184|    permissions |= 1 << 3;
  266|    184|    permissions |= 1 << 10;
  267|    184|  }
  268|     87|  else if(str[5] == 'S')
  ------------------
  |  Branch (268:11): [True: 47, False: 40]
  ------------------
  269|     47|    permissions |= 1 << 10;
  270|     40|  else if(str[5] != '-')
  ------------------
  |  Branch (270:11): [True: 5, False: 35]
  ------------------
  271|      5|    permissions |= FTP_LP_MALFORMATED_PERM;
  ------------------
  |  |  228|      5|#define FTP_LP_MALFORMATED_PERM 0x01000000
  ------------------
  272|       |  /* others */
  273|    527|  if(str[6] == 'r')
  ------------------
  |  Branch (273:6): [True: 504, False: 23]
  ------------------
  274|    504|    permissions |= 1 << 2;
  275|     23|  else if(str[6] != '-')
  ------------------
  |  Branch (275:11): [True: 6, False: 17]
  ------------------
  276|      6|    permissions |= FTP_LP_MALFORMATED_PERM;
  ------------------
  |  |  228|      6|#define FTP_LP_MALFORMATED_PERM 0x01000000
  ------------------
  277|    527|  if(str[7] == 'w')
  ------------------
  |  Branch (277:6): [True: 48, False: 479]
  ------------------
  278|     48|    permissions |= 1 << 1;
  279|    479|  else if(str[7] != '-')
  ------------------
  |  Branch (279:11): [True: 5, False: 474]
  ------------------
  280|      5|    permissions |= FTP_LP_MALFORMATED_PERM;
  ------------------
  |  |  228|      5|#define FTP_LP_MALFORMATED_PERM 0x01000000
  ------------------
  281|    527|  if(str[8] == 'x')
  ------------------
  |  Branch (281:6): [True: 454, False: 73]
  ------------------
  282|    454|    permissions |= 1;
  283|     73|  else if(str[8] == 't') {
  ------------------
  |  Branch (283:11): [True: 19, False: 54]
  ------------------
  284|     19|    permissions |= 1;
  285|     19|    permissions |= 1 << 9;
  286|     19|  }
  287|     54|  else if(str[8] == 'T')
  ------------------
  |  Branch (287:11): [True: 30, False: 24]
  ------------------
  288|     30|    permissions |= 1 << 9;
  289|     24|  else if(str[8] != '-')
  ------------------
  |  Branch (289:11): [True: 4, False: 20]
  ------------------
  290|      4|    permissions |= FTP_LP_MALFORMATED_PERM;
  ------------------
  |  |  228|      4|#define FTP_LP_MALFORMATED_PERM 0x01000000
  ------------------
  291|       |
  292|    527|  return permissions;
  293|    527|}
ftplistparser.c:parse_unix_hlinks:
  464|  2.61k|{
  465|  2.61k|  size_t len = curlx_dyn_len(&infop->buf);
  466|  2.61k|  char *mem = curlx_dyn_ptr(&infop->buf);
  467|       |
  468|  2.61k|  switch(parser->state.UNIX.sub.hlinks) {
  ------------------
  |  Branch (468:10): [True: 2.61k, False: 0]
  ------------------
  469|  1.25k|  case PL_UNIX_HLINKS_PRESPACE:
  ------------------
  |  Branch (469:3): [True: 1.25k, False: 1.36k]
  ------------------
  470|  1.25k|    if(c != ' ') {
  ------------------
  |  Branch (470:8): [True: 510, False: 742]
  ------------------
  471|    510|      if(ISDIGIT(c) && len) {
  ------------------
  |  |   44|  1.02k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 505, False: 5]
  |  |  |  Branch (44:38): [True: 504, False: 1]
  |  |  ------------------
  ------------------
  |  Branch (471:24): [True: 504, False: 0]
  ------------------
  472|    504|        parser->item_offset = len - 1;
  473|    504|        parser->item_length = 1;
  474|    504|        parser->state.UNIX.sub.hlinks = PL_UNIX_HLINKS_NUMBER;
  475|    504|      }
  476|      6|      else
  477|      6|        return CURLE_FTP_BAD_FILE_LIST;
  478|    510|    }
  479|  1.24k|    break;
  480|  1.36k|  case PL_UNIX_HLINKS_NUMBER:
  ------------------
  |  Branch (480:3): [True: 1.36k, False: 1.25k]
  ------------------
  481|  1.36k|    parser->item_length++;
  482|  1.36k|    if(c == ' ') {
  ------------------
  |  Branch (482:8): [True: 495, False: 872]
  ------------------
  483|    495|      const char *p = &mem[parser->item_offset];
  484|    495|      curl_off_t hlinks;
  485|    495|      mem[parser->item_offset + parser->item_length - 1] = 0;
  486|       |
  487|    495|      if(!curlx_str_number(&p, &hlinks, LONG_MAX)) {
  ------------------
  |  Branch (487:10): [True: 482, False: 13]
  ------------------
  488|    482|        parser->file_data->info.flags |= CURLFINFOFLAG_KNOWN_HLINKCOUNT;
  ------------------
  |  |  313|    482|#define CURLFINFOFLAG_KNOWN_HLINKCOUNT  (1 << 7)
  ------------------
  489|    482|        parser->file_data->info.hardlinks = (long)hlinks;
  490|    482|      }
  491|    495|      parser->item_length = 0;
  492|    495|      parser->item_offset = 0;
  493|    495|      parser->state.UNIX.main = PL_UNIX_USER;
  494|    495|      parser->state.UNIX.sub.user = PL_UNIX_USER_PRESPACE;
  495|    495|    }
  496|    872|    else if(!ISDIGIT(c))
  ------------------
  |  |   44|    872|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 865, False: 7]
  |  |  |  Branch (44:38): [True: 863, False: 2]
  |  |  ------------------
  ------------------
  497|      9|      return CURLE_FTP_BAD_FILE_LIST;
  498|       |
  499|  1.35k|    break;
  500|  2.61k|  }
  501|  2.60k|  return CURLE_OK;
  502|  2.61k|}
ftplistparser.c:parse_unix_user:
  507|  6.41k|{
  508|  6.41k|  size_t len = curlx_dyn_len(&infop->buf);
  509|  6.41k|  char *mem = curlx_dyn_ptr(&infop->buf);
  510|  6.41k|  switch(parser->state.UNIX.sub.user) {
  ------------------
  |  Branch (510:10): [True: 6.41k, False: 0]
  ------------------
  511|  1.27k|  case PL_UNIX_USER_PRESPACE:
  ------------------
  |  Branch (511:3): [True: 1.27k, False: 5.14k]
  ------------------
  512|  1.27k|    if(c != ' ' && len) {
  ------------------
  |  Branch (512:8): [True: 495, False: 778]
  |  Branch (512:20): [True: 495, False: 0]
  ------------------
  513|    495|      parser->item_offset = len - 1;
  514|    495|      parser->item_length = 1;
  515|    495|      parser->state.UNIX.sub.user = PL_UNIX_USER_PARSING;
  516|    495|    }
  517|  1.27k|    break;
  518|  5.14k|  case PL_UNIX_USER_PARSING:
  ------------------
  |  Branch (518:3): [True: 5.14k, False: 1.27k]
  ------------------
  519|  5.14k|    parser->item_length++;
  520|  5.14k|    if(c == ' ') {
  ------------------
  |  Branch (520:8): [True: 494, False: 4.64k]
  ------------------
  521|    494|      mem[parser->item_offset + parser->item_length - 1] = 0;
  522|    494|      parser->offsets.user = parser->item_offset;
  523|    494|      parser->state.UNIX.main = PL_UNIX_GROUP;
  524|    494|      parser->state.UNIX.sub.group = PL_UNIX_GROUP_PRESPACE;
  525|    494|      parser->item_offset = 0;
  526|    494|      parser->item_length = 0;
  527|    494|    }
  528|  5.14k|    break;
  529|  6.41k|  }
  530|  6.41k|  return CURLE_OK;
  531|  6.41k|}
ftplistparser.c:parse_unix_group:
  536|  6.49k|{
  537|  6.49k|  size_t len = curlx_dyn_len(&infop->buf);
  538|  6.49k|  char *mem = curlx_dyn_ptr(&infop->buf);
  539|  6.49k|  switch(parser->state.UNIX.sub.group) {
  ------------------
  |  Branch (539:10): [True: 6.49k, False: 0]
  ------------------
  540|  1.57k|  case PL_UNIX_GROUP_PRESPACE:
  ------------------
  |  Branch (540:3): [True: 1.57k, False: 4.92k]
  ------------------
  541|  1.57k|    if(c != ' ' && len) {
  ------------------
  |  Branch (541:8): [True: 493, False: 1.08k]
  |  Branch (541:20): [True: 493, False: 0]
  ------------------
  542|    493|      parser->item_offset = len - 1;
  543|    493|      parser->item_length = 1;
  544|    493|      parser->state.UNIX.sub.group = PL_UNIX_GROUP_NAME;
  545|    493|    }
  546|  1.57k|    break;
  547|  4.92k|  case PL_UNIX_GROUP_NAME:
  ------------------
  |  Branch (547:3): [True: 4.92k, False: 1.57k]
  ------------------
  548|  4.92k|    parser->item_length++;
  549|  4.92k|    if(c == ' ') {
  ------------------
  |  Branch (549:8): [True: 492, False: 4.43k]
  ------------------
  550|    492|      mem[parser->item_offset + parser->item_length - 1] = 0;
  551|    492|      parser->offsets.group = parser->item_offset;
  552|    492|      parser->state.UNIX.main = PL_UNIX_SIZE;
  553|    492|      parser->state.UNIX.sub.size = PL_UNIX_SIZE_PRESPACE;
  554|    492|      parser->item_offset = 0;
  555|    492|      parser->item_length = 0;
  556|    492|    }
  557|  4.92k|    break;
  558|  6.49k|  }
  559|  6.49k|  return CURLE_OK;
  560|  6.49k|}
ftplistparser.c:parse_unix_size:
  565|  5.98k|{
  566|  5.98k|  size_t len = curlx_dyn_len(&infop->buf);
  567|  5.98k|  char *mem = curlx_dyn_ptr(&infop->buf);
  568|  5.98k|  switch(parser->state.UNIX.sub.size) {
  ------------------
  |  Branch (568:10): [True: 5.98k, False: 0]
  ------------------
  569|  1.56k|  case PL_UNIX_SIZE_PRESPACE:
  ------------------
  |  Branch (569:3): [True: 1.56k, False: 4.42k]
  ------------------
  570|  1.56k|    if(c != ' ') {
  ------------------
  |  Branch (570:8): [True: 492, False: 1.06k]
  ------------------
  571|    492|      if(ISDIGIT(c) && len) {
  ------------------
  |  |   44|    984|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 481, False: 11]
  |  |  |  Branch (44:38): [True: 472, False: 9]
  |  |  ------------------
  ------------------
  |  Branch (571:24): [True: 472, False: 0]
  ------------------
  572|    472|        parser->item_offset = len - 1;
  573|    472|        parser->item_length = 1;
  574|    472|        parser->state.UNIX.sub.size = PL_UNIX_SIZE_NUMBER;
  575|    472|      }
  576|     20|      else
  577|     20|        return CURLE_FTP_BAD_FILE_LIST;
  578|    492|    }
  579|  1.54k|    break;
  580|  4.42k|  case PL_UNIX_SIZE_NUMBER:
  ------------------
  |  Branch (580:3): [True: 4.42k, False: 1.56k]
  ------------------
  581|  4.42k|    parser->item_length++;
  582|  4.42k|    if(c == ' ') {
  ------------------
  |  Branch (582:8): [True: 670, False: 3.75k]
  ------------------
  583|    670|      const char *p = mem + parser->item_offset;
  584|    670|      curl_off_t fsize;
  585|    670|      mem[parser->item_offset + parser->item_length - 1] = 0;
  586|    670|      if(!curlx_str_numblanks(&p, &fsize)) {
  ------------------
  |  Branch (586:10): [True: 436, False: 234]
  ------------------
  587|    436|        if(p[0] == '\0' && fsize != CURL_OFF_T_MAX) {
  ------------------
  |  |  594|    436|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (587:12): [True: 436, False: 0]
  |  Branch (587:28): [True: 427, False: 9]
  ------------------
  588|    427|          parser->file_data->info.flags |= CURLFINFOFLAG_KNOWN_SIZE;
  ------------------
  |  |  312|    427|#define CURLFINFOFLAG_KNOWN_SIZE        (1 << 6)
  ------------------
  589|    427|          parser->file_data->info.size = fsize;
  590|    427|        }
  591|    436|        parser->item_length = 0;
  592|    436|        parser->item_offset = 0;
  593|    436|        parser->state.UNIX.main = PL_UNIX_TIME;
  594|    436|        parser->state.UNIX.sub.time = PL_UNIX_TIME_PREPART1;
  595|    436|      }
  596|    670|    }
  597|  3.75k|    else if(!ISDIGIT(c))
  ------------------
  |  |   44|  3.75k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 3.74k, False: 9]
  |  |  |  Branch (44:38): [True: 3.72k, False: 27]
  |  |  ------------------
  ------------------
  598|     36|      return CURLE_FTP_BAD_FILE_LIST;
  599|       |
  600|  4.39k|    break;
  601|  5.98k|  }
  602|  5.93k|  return CURLE_OK;
  603|  5.98k|}
ftplistparser.c:parse_unix_time:
  608|  12.3k|{
  609|  12.3k|  size_t len = curlx_dyn_len(&infop->buf);
  610|  12.3k|  char *mem = curlx_dyn_ptr(&infop->buf);
  611|  12.3k|  struct curl_fileinfo *finfo = &infop->info;
  612|       |
  613|  12.3k|  switch(parser->state.UNIX.sub.time) {
  ------------------
  |  Branch (613:10): [True: 12.3k, False: 0]
  ------------------
  614|  1.13k|  case PL_UNIX_TIME_PREPART1:
  ------------------
  |  Branch (614:3): [True: 1.13k, False: 11.2k]
  ------------------
  615|  1.13k|    if(c != ' ') {
  ------------------
  |  Branch (615:8): [True: 435, False: 696]
  ------------------
  616|    435|      if(ISALNUM(c) && len) {
  ------------------
  |  |   41|    870|#define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   44|    870|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 419, False: 16]
  |  |  |  |  |  Branch (44:38): [True: 243, False: 176]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   43|    627|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:22): [True: 71, False: 121]
  |  |  |  |  |  Branch (43:38): [True: 69, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   42|    123|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 107, False: 16]
  |  |  |  |  |  Branch (42:38): [True: 105, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (616:24): [True: 417, False: 0]
  ------------------
  617|    417|        parser->item_offset = len - 1;
  618|    417|        parser->item_length = 1;
  619|    417|        parser->state.UNIX.sub.time = PL_UNIX_TIME_PART1;
  620|    417|      }
  621|     18|      else
  622|     18|        return CURLE_FTP_BAD_FILE_LIST;
  623|    435|    }
  624|  1.11k|    break;
  625|  3.98k|  case PL_UNIX_TIME_PART1:
  ------------------
  |  Branch (625:3): [True: 3.98k, False: 8.40k]
  ------------------
  626|  3.98k|    parser->item_length++;
  627|  3.98k|    if(c == ' ')
  ------------------
  |  Branch (627:8): [True: 389, False: 3.59k]
  ------------------
  628|    389|      parser->state.UNIX.sub.time = PL_UNIX_TIME_PREPART2;
  629|       |
  630|  3.59k|    else if(!ISALNUM(c) && c != '.')
  ------------------
  |  |   41|  7.19k|#define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   44|  7.19k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 3.26k, False: 334]
  |  |  |  |  |  Branch (44:38): [True: 1.82k, False: 1.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   43|  5.36k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:22): [True: 705, False: 1.06k]
  |  |  |  |  |  Branch (43:38): [True: 704, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   42|  1.06k|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 729, False: 336]
  |  |  |  |  |  Branch (42:38): [True: 728, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (630:28): [True: 28, False: 309]
  ------------------
  631|     28|      return CURLE_FTP_BAD_FILE_LIST;
  632|       |
  633|  3.95k|    break;
  634|  3.95k|  case PL_UNIX_TIME_PREPART2:
  ------------------
  |  Branch (634:3): [True: 1.03k, False: 11.3k]
  ------------------
  635|  1.03k|    parser->item_length++;
  636|  1.03k|    if(c != ' ') {
  ------------------
  |  Branch (636:8): [True: 389, False: 649]
  ------------------
  637|    389|      if(ISALNUM(c))
  ------------------
  |  |   41|    389|#define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   44|    778|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 378, False: 11]
  |  |  |  |  |  Branch (44:38): [True: 192, False: 186]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   43|    586|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:22): [True: 126, False: 71]
  |  |  |  |  |  Branch (43:38): [True: 125, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   42|     72|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 61, False: 11]
  |  |  |  |  |  Branch (42:38): [True: 60, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  638|    377|        parser->state.UNIX.sub.time = PL_UNIX_TIME_PART2;
  639|     12|      else
  640|     12|        return CURLE_FTP_BAD_FILE_LIST;
  641|    389|    }
  642|  1.02k|    break;
  643|  2.59k|  case PL_UNIX_TIME_PART2:
  ------------------
  |  Branch (643:3): [True: 2.59k, False: 9.79k]
  ------------------
  644|  2.59k|    parser->item_length++;
  645|  2.59k|    if(c == ' ')
  ------------------
  |  Branch (645:8): [True: 356, False: 2.23k]
  ------------------
  646|    356|      parser->state.UNIX.sub.time = PL_UNIX_TIME_PREPART3;
  647|  2.23k|    else if(!ISALNUM(c) && c != '.')
  ------------------
  |  |   41|  4.47k|#define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   44|  4.47k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 1.92k, False: 317]
  |  |  |  |  |  Branch (44:38): [True: 712, False: 1.20k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   43|  3.76k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:22): [True: 677, False: 849]
  |  |  |  |  |  Branch (43:38): [True: 676, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   42|    850|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 531, False: 319]
  |  |  |  |  |  Branch (42:38): [True: 530, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (647:28): [True: 21, False: 299]
  ------------------
  648|     21|      return CURLE_FTP_BAD_FILE_LIST;
  649|  2.57k|    break;
  650|  2.57k|  case PL_UNIX_TIME_PREPART3:
  ------------------
  |  Branch (650:3): [True: 895, False: 11.4k]
  ------------------
  651|    895|    parser->item_length++;
  652|    895|    if(c != ' ') {
  ------------------
  |  Branch (652:8): [True: 355, False: 540]
  ------------------
  653|    355|      if(ISALNUM(c))
  ------------------
  |  |   41|    355|#define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   44|    710|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 340, False: 15]
  |  |  |  |  |  Branch (44:38): [True: 168, False: 172]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   43|    542|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:22): [True: 99, False: 88]
  |  |  |  |  |  Branch (43:38): [True: 98, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   42|     89|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 73, False: 16]
  |  |  |  |  |  Branch (42:38): [True: 70, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  654|    336|        parser->state.UNIX.sub.time = PL_UNIX_TIME_PART3;
  655|     19|      else
  656|     19|        return CURLE_FTP_BAD_FILE_LIST;
  657|    355|    }
  658|    876|    break;
  659|  2.74k|  case PL_UNIX_TIME_PART3:
  ------------------
  |  Branch (659:3): [True: 2.74k, False: 9.64k]
  ------------------
  660|  2.74k|    parser->item_length++;
  661|  2.74k|    if(c == ' ') {
  ------------------
  |  Branch (661:8): [True: 307, False: 2.43k]
  ------------------
  662|    307|      mem[parser->item_offset + parser->item_length - 1] = 0;
  663|    307|      parser->offsets.time = parser->item_offset;
  664|    307|      if(finfo->filetype == CURLFILETYPE_SYMLINK) {
  ------------------
  |  Branch (664:10): [True: 54, False: 253]
  ------------------
  665|     54|        parser->state.UNIX.main = PL_UNIX_SYMLINK;
  666|     54|        parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_PRESPACE;
  667|     54|      }
  668|    253|      else {
  669|    253|        parser->state.UNIX.main = PL_UNIX_FILENAME;
  670|    253|        parser->state.UNIX.sub.filename = PL_UNIX_FILENAME_PRESPACE;
  671|    253|      }
  672|    307|    }
  673|  2.43k|    else if(!ISALNUM(c) && c != '.' && c != ':')
  ------------------
  |  |   41|  4.87k|#define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   44|  4.87k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 2.15k, False: 284]
  |  |  |  |  |  Branch (44:38): [True: 671, False: 1.48k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   43|  4.20k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:22): [True: 625, False: 1.14k]
  |  |  |  |  |  Branch (43:38): [True: 624, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   42|  1.14k|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 569, False: 575]
  |  |  |  |  |  Branch (42:38): [True: 564, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (673:28): [True: 317, False: 263]
  |  Branch (673:40): [True: 29, False: 288]
  ------------------
  674|     29|      return CURLE_FTP_BAD_FILE_LIST;
  675|  2.71k|    break;
  676|  12.3k|  }
  677|  12.2k|  return CURLE_OK;
  678|  12.3k|}
ftplistparser.c:parse_unix_filename:
  684|  8.69k|{
  685|  8.69k|  size_t len = curlx_dyn_len(&infop->buf);
  686|  8.69k|  char *mem = curlx_dyn_ptr(&infop->buf);
  687|  8.69k|  CURLcode result = CURLE_OK;
  688|       |
  689|  8.69k|  switch(parser->state.UNIX.sub.filename) {
  ------------------
  |  Branch (689:10): [True: 8.69k, False: 0]
  ------------------
  690|    664|  case PL_UNIX_FILENAME_PRESPACE:
  ------------------
  |  Branch (690:3): [True: 664, False: 8.02k]
  ------------------
  691|    664|    if(c != ' ' && len) {
  ------------------
  |  Branch (691:8): [True: 253, False: 411]
  |  Branch (691:20): [True: 253, False: 0]
  ------------------
  692|    253|      parser->item_offset = len - 1;
  693|    253|      parser->item_length = 1;
  694|    253|      parser->state.UNIX.sub.filename = PL_UNIX_FILENAME_NAME;
  695|    253|    }
  696|    664|    break;
  697|  8.02k|  case PL_UNIX_FILENAME_NAME:
  ------------------
  |  Branch (697:3): [True: 8.02k, False: 664]
  ------------------
  698|  8.02k|    parser->item_length++;
  699|  8.02k|    if(c == '\r')
  ------------------
  |  Branch (699:8): [True: 0, False: 8.02k]
  ------------------
  700|      0|      parser->state.UNIX.sub.filename = PL_UNIX_FILENAME_WINDOWSEOL;
  701|       |
  702|  8.02k|    else if(c == '\n') {
  ------------------
  |  Branch (702:13): [True: 241, False: 7.78k]
  ------------------
  703|    241|      mem[parser->item_offset + parser->item_length - 1] = 0;
  704|    241|      parser->offsets.filename = parser->item_offset;
  705|    241|      parser->state.UNIX.main = PL_UNIX_FILETYPE;
  706|    241|      result = ftp_pl_insert_finfo(data, infop);
  707|    241|    }
  708|  8.02k|    break;
  709|      0|  case PL_UNIX_FILENAME_WINDOWSEOL:
  ------------------
  |  Branch (709:3): [True: 0, False: 8.69k]
  ------------------
  710|      0|    if(c == '\n') {
  ------------------
  |  Branch (710:8): [True: 0, False: 0]
  ------------------
  711|      0|      mem[parser->item_offset + parser->item_length - 1] = 0;
  712|      0|      parser->offsets.filename = parser->item_offset;
  713|      0|      parser->state.UNIX.main = PL_UNIX_FILETYPE;
  714|      0|      result = ftp_pl_insert_finfo(data, infop);
  715|      0|    }
  716|      0|    else
  717|      0|      result = CURLE_FTP_BAD_FILE_LIST;
  718|      0|    break;
  719|  8.69k|  }
  720|  8.69k|  return result;
  721|  8.69k|}
ftplistparser.c:ftp_pl_insert_finfo:
  297|    385|{
  298|    385|  curl_fnmatch_callback compare;
  299|    385|  struct WildcardData *wc = data->wildcard;
  300|    385|  struct ftp_wc *ftpwc = wc->ftpwc;
  301|    385|  struct Curl_llist *llist = &wc->filelist;
  302|    385|  struct ftp_parselist_data *parser = ftpwc->parser;
  303|    385|  bool add = TRUE;
  ------------------
  |  | 1055|    385|#define TRUE true
  ------------------
  304|    385|  struct curl_fileinfo *finfo = &infop->info;
  305|       |
  306|       |  /* set the finfo pointers */
  307|    385|  char *str = curlx_dyn_ptr(&infop->buf);
  308|    385|  finfo->filename       = str + parser->offsets.filename;
  309|    385|  finfo->strings.group  = parser->offsets.group ?
  ------------------
  |  Branch (309:27): [True: 268, False: 117]
  ------------------
  310|    385|                          str + parser->offsets.group : NULL;
  311|    385|  finfo->strings.perm   = parser->offsets.perm ?
  ------------------
  |  Branch (311:27): [True: 268, False: 117]
  ------------------
  312|    385|                          str + parser->offsets.perm : NULL;
  313|    385|  finfo->strings.target = parser->offsets.symlink_target ?
  ------------------
  |  Branch (313:27): [True: 29, False: 356]
  ------------------
  314|    385|                          str + parser->offsets.symlink_target : NULL;
  315|    385|  finfo->strings.time   = str + parser->offsets.time;
  316|    385|  finfo->strings.user   = parser->offsets.user ?
  ------------------
  |  Branch (316:27): [True: 268, False: 117]
  ------------------
  317|    385|                          str + parser->offsets.user : NULL;
  318|       |
  319|       |  /* get correct fnmatch callback */
  320|    385|  compare = data->set.fnmatch;
  321|    385|  if(!compare)
  ------------------
  |  Branch (321:6): [True: 385, False: 0]
  ------------------
  322|    385|    compare = Curl_fnmatch;
  323|       |
  324|       |  /* filter pattern-corresponding filenames */
  325|    385|  Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|    385|#define TRUE true
  ------------------
  326|    385|  if(compare(data->set.fnmatch_data, wc->pattern, finfo->filename) == 0) {
  ------------------
  |  Branch (326:6): [True: 145, False: 240]
  ------------------
  327|       |    /* discard symlink which is containing multiple " -> " */
  328|    145|    if((finfo->filetype == CURLFILETYPE_SYMLINK) && finfo->strings.target &&
  ------------------
  |  Branch (328:8): [True: 25, False: 120]
  |  Branch (328:53): [True: 25, False: 0]
  ------------------
  329|     25|       (strstr(finfo->strings.target, " -> "))) {
  ------------------
  |  Branch (329:8): [True: 6, False: 19]
  ------------------
  330|      6|      add = FALSE;
  ------------------
  |  | 1058|      6|#define FALSE false
  ------------------
  331|      6|    }
  332|    145|  }
  333|    240|  else {
  334|    240|    add = FALSE;
  ------------------
  |  | 1058|    240|#define FALSE false
  ------------------
  335|    240|  }
  336|    385|  Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|    385|#define FALSE false
  ------------------
  337|       |
  338|    385|  if(add) {
  ------------------
  |  Branch (338:6): [True: 139, False: 246]
  ------------------
  339|    139|    Curl_llist_append(llist, finfo, &infop->list);
  340|    139|  }
  341|    246|  else {
  342|    246|    Curl_fileinfo_cleanup(infop);
  343|    246|  }
  344|       |
  345|       |  ftpwc->parser->file_data = NULL;
  346|    385|  return CURLE_OK;
  347|    385|}
ftplistparser.c:parse_unix_symlink:
  727|  3.99k|{
  728|  3.99k|  size_t len = curlx_dyn_len(&infop->buf);
  729|  3.99k|  char *mem = curlx_dyn_ptr(&infop->buf);
  730|  3.99k|  CURLcode result = CURLE_OK;
  731|       |
  732|  3.99k|  switch(parser->state.UNIX.sub.symlink) {
  ------------------
  |  Branch (732:10): [True: 3.99k, False: 0]
  ------------------
  733|    348|  case PL_UNIX_SYMLINK_PRESPACE:
  ------------------
  |  Branch (733:3): [True: 348, False: 3.65k]
  ------------------
  734|    348|    if(c != ' ' && len) {
  ------------------
  |  Branch (734:8): [True: 53, False: 295]
  |  Branch (734:20): [True: 53, False: 0]
  ------------------
  735|     53|      parser->item_offset = len - 1;
  736|     53|      parser->item_length = 1;
  737|     53|      parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_NAME;
  738|     53|    }
  739|    348|    break;
  740|  2.45k|  case PL_UNIX_SYMLINK_NAME:
  ------------------
  |  Branch (740:3): [True: 2.45k, False: 1.54k]
  ------------------
  741|  2.45k|    parser->item_length++;
  742|  2.45k|    if(c == ' ')
  ------------------
  |  Branch (742:8): [True: 587, False: 1.86k]
  ------------------
  743|    587|      parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_PRETARGET1;
  744|       |
  745|  1.86k|    else if(c == '\r' || c == '\n')
  ------------------
  |  Branch (745:13): [True: 0, False: 1.86k]
  |  Branch (745:26): [True: 17, False: 1.84k]
  ------------------
  746|     17|      return CURLE_FTP_BAD_FILE_LIST;
  747|       |
  748|  2.43k|    break;
  749|  2.43k|  case PL_UNIX_SYMLINK_PRETARGET1:
  ------------------
  |  Branch (749:3): [True: 584, False: 3.41k]
  ------------------
  750|    584|    parser->item_length++;
  751|    584|    if(c == '-')
  ------------------
  |  Branch (751:8): [True: 87, False: 497]
  ------------------
  752|     87|      parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_PRETARGET2;
  753|       |
  754|    497|    else if(c == '\r' || c == '\n')
  ------------------
  |  Branch (754:13): [True: 0, False: 497]
  |  Branch (754:26): [True: 1, False: 496]
  ------------------
  755|      1|      return CURLE_FTP_BAD_FILE_LIST;
  756|    496|    else
  757|    496|      parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_NAME;
  758|    583|    break;
  759|    583|  case PL_UNIX_SYMLINK_PRETARGET2:
  ------------------
  |  Branch (759:3): [True: 87, False: 3.91k]
  ------------------
  760|     87|    parser->item_length++;
  761|     87|    if(c == '>')
  ------------------
  |  Branch (761:8): [True: 59, False: 28]
  ------------------
  762|     59|      parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_PRETARGET3;
  763|     28|    else if(c == '\r' || c == '\n')
  ------------------
  |  Branch (763:13): [True: 0, False: 28]
  |  Branch (763:26): [True: 2, False: 26]
  ------------------
  764|      2|      return CURLE_FTP_BAD_FILE_LIST;
  765|     26|    else
  766|     26|      parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_NAME;
  767|       |
  768|     85|    break;
  769|     85|  case PL_UNIX_SYMLINK_PRETARGET3:
  ------------------
  |  Branch (769:3): [True: 59, False: 3.93k]
  ------------------
  770|     59|    parser->item_length++;
  771|     59|    if(c == ' ') {
  ------------------
  |  Branch (771:8): [True: 28, False: 31]
  ------------------
  772|     28|      parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_PRETARGET4;
  773|       |      /* now place where is symlink following */
  774|     28|      mem[parser->item_offset + parser->item_length - 4] = 0;
  775|     28|      parser->offsets.filename = parser->item_offset;
  776|     28|      parser->item_length = 0;
  777|     28|      parser->item_offset = 0;
  778|     28|    }
  779|     31|    else if(c == '\r' || c == '\n')
  ------------------
  |  Branch (779:13): [True: 0, False: 31]
  |  Branch (779:26): [True: 1, False: 30]
  ------------------
  780|      1|      return CURLE_FTP_BAD_FILE_LIST;
  781|     30|    else
  782|     30|      parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_NAME;
  783|     58|    break;
  784|     58|  case PL_UNIX_SYMLINK_PRETARGET4:
  ------------------
  |  Branch (784:3): [True: 28, False: 3.97k]
  ------------------
  785|     28|    if(c != '\r' && c != '\n' && len) {
  ------------------
  |  Branch (785:8): [True: 28, False: 0]
  |  Branch (785:21): [True: 27, False: 1]
  |  Branch (785:34): [True: 27, False: 0]
  ------------------
  786|     27|      parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_TARGET;
  787|     27|      parser->item_offset = len - 1;
  788|     27|      parser->item_length = 1;
  789|     27|    }
  790|      1|    else
  791|      1|      return CURLE_FTP_BAD_FILE_LIST;
  792|       |
  793|     27|    break;
  794|    441|  case PL_UNIX_SYMLINK_TARGET:
  ------------------
  |  Branch (794:3): [True: 441, False: 3.55k]
  ------------------
  795|    441|    parser->item_length++;
  796|    441|    if(c == '\r')
  ------------------
  |  Branch (796:8): [True: 0, False: 441]
  ------------------
  797|      0|      parser->state.UNIX.sub.symlink = PL_UNIX_SYMLINK_WINDOWSEOL;
  798|       |
  799|    441|    else if(c == '\n') {
  ------------------
  |  Branch (799:13): [True: 27, False: 414]
  ------------------
  800|     27|      mem[parser->item_offset + parser->item_length - 1] = 0;
  801|     27|      parser->offsets.symlink_target = parser->item_offset;
  802|     27|      result = ftp_pl_insert_finfo(data, infop);
  803|     27|      if(result)
  ------------------
  |  Branch (803:10): [True: 0, False: 27]
  ------------------
  804|      0|        break;
  805|       |
  806|     27|      parser->state.UNIX.main = PL_UNIX_FILETYPE;
  807|     27|    }
  808|    441|    break;
  809|    441|  case PL_UNIX_SYMLINK_WINDOWSEOL:
  ------------------
  |  Branch (809:3): [True: 0, False: 3.99k]
  ------------------
  810|      0|    if(c == '\n') {
  ------------------
  |  Branch (810:8): [True: 0, False: 0]
  ------------------
  811|      0|      mem[parser->item_offset + parser->item_length - 1] = 0;
  812|      0|      parser->offsets.symlink_target = parser->item_offset;
  813|      0|      result = ftp_pl_insert_finfo(data, infop);
  814|      0|      if(result)
  ------------------
  |  Branch (814:10): [True: 0, False: 0]
  ------------------
  815|      0|        break;
  816|       |
  817|      0|      parser->state.UNIX.main = PL_UNIX_FILETYPE;
  818|      0|    }
  819|      0|    else
  820|      0|      result = CURLE_FTP_BAD_FILE_LIST;
  821|       |
  822|      0|    break;
  823|  3.99k|  }
  824|  3.97k|  return result;
  825|  3.99k|}
ftplistparser.c:parse_winnt:
  883|  9.18k|{
  884|  9.18k|  struct curl_fileinfo *finfo = &infop->info;
  885|  9.18k|  size_t len = curlx_dyn_len(&infop->buf);
  886|  9.18k|  char *mem = curlx_dyn_ptr(&infop->buf);
  887|  9.18k|  CURLcode result = CURLE_OK;
  888|       |
  889|  9.18k|  switch(parser->state.NT.main) {
  ------------------
  |  Branch (889:10): [True: 9.18k, False: 0]
  ------------------
  890|  1.66k|  case PL_WINNT_DATE:
  ------------------
  |  Branch (890:3): [True: 1.66k, False: 7.52k]
  ------------------
  891|  1.66k|    parser->item_length++;
  892|  1.66k|    if(parser->item_length < 9) {
  ------------------
  |  Branch (892:8): [True: 1.48k, False: 178]
  ------------------
  893|  1.48k|      if(!strchr("0123456789-", c)) { /* only simple control */
  ------------------
  |  Branch (893:10): [True: 20, False: 1.46k]
  ------------------
  894|     20|        return CURLE_FTP_BAD_FILE_LIST;
  895|     20|      }
  896|  1.48k|    }
  897|    178|    else if(parser->item_length == 9) {
  ------------------
  |  Branch (897:13): [True: 178, False: 0]
  ------------------
  898|    178|      if(c == ' ') {
  ------------------
  |  Branch (898:10): [True: 176, False: 2]
  ------------------
  899|    176|        parser->state.NT.main = PL_WINNT_TIME;
  900|    176|        parser->state.NT.sub.time = PL_WINNT_TIME_PRESPACE;
  901|    176|      }
  902|      2|      else
  903|      2|        return CURLE_FTP_BAD_FILE_LIST;
  904|    178|    }
  905|      0|    else
  906|      0|      return CURLE_FTP_BAD_FILE_LIST;
  907|  1.64k|    break;
  908|  1.90k|  case PL_WINNT_TIME:
  ------------------
  |  Branch (908:3): [True: 1.90k, False: 7.28k]
  ------------------
  909|  1.90k|    parser->item_length++;
  910|  1.90k|    switch(parser->state.NT.sub.time) {
  ------------------
  |  Branch (910:12): [True: 1.90k, False: 0]
  ------------------
  911|  1.27k|    case PL_WINNT_TIME_PRESPACE:
  ------------------
  |  Branch (911:5): [True: 1.27k, False: 632]
  ------------------
  912|  1.27k|      if(!ISBLANK(c))
  ------------------
  |  |   45|  1.27k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 730, False: 546]
  |  |  |  Branch (45:38): [True: 370, False: 176]
  |  |  ------------------
  ------------------
  913|    176|        parser->state.NT.sub.time = PL_WINNT_TIME_TIME;
  914|  1.27k|      break;
  915|    632|    case PL_WINNT_TIME_TIME:
  ------------------
  |  Branch (915:5): [True: 632, False: 1.27k]
  ------------------
  916|    632|      if(c == ' ') {
  ------------------
  |  Branch (916:10): [True: 169, False: 463]
  ------------------
  917|    169|        parser->offsets.time = parser->item_offset;
  918|    169|        mem[parser->item_offset + parser->item_length - 1] = 0;
  919|    169|        parser->state.NT.main = PL_WINNT_DIRORSIZE;
  920|    169|        parser->state.NT.sub.dirorsize = PL_WINNT_DIRORSIZE_PRESPACE;
  921|    169|        parser->item_length = 0;
  922|    169|      }
  923|    463|      else if(!strchr("APM0123456789:", c))
  ------------------
  |  Branch (923:15): [True: 7, False: 456]
  ------------------
  924|      7|        return CURLE_FTP_BAD_FILE_LIST;
  925|    625|      break;
  926|  1.90k|    }
  927|  1.90k|    break;
  928|  3.63k|  case PL_WINNT_DIRORSIZE:
  ------------------
  |  Branch (928:3): [True: 3.63k, False: 5.55k]
  ------------------
  929|  3.63k|    switch(parser->state.NT.sub.dirorsize) {
  ------------------
  |  Branch (929:12): [True: 3.63k, False: 0]
  ------------------
  930|    583|    case PL_WINNT_DIRORSIZE_PRESPACE:
  ------------------
  |  Branch (930:5): [True: 583, False: 3.04k]
  ------------------
  931|    583|      if(c != ' ' && len) {
  ------------------
  |  Branch (931:10): [True: 169, False: 414]
  |  Branch (931:22): [True: 169, False: 0]
  ------------------
  932|    169|        parser->item_offset = len - 1;
  933|    169|        parser->item_length = 1;
  934|    169|        parser->state.NT.sub.dirorsize = PL_WINNT_DIRORSIZE_CONTENT;
  935|    169|      }
  936|    583|      break;
  937|  3.04k|    case PL_WINNT_DIRORSIZE_CONTENT:
  ------------------
  |  Branch (937:5): [True: 3.04k, False: 583]
  ------------------
  938|  3.04k|      parser->item_length++;
  939|  3.04k|      if(c == ' ') {
  ------------------
  |  Branch (939:10): [True: 169, False: 2.87k]
  ------------------
  940|    169|        mem[parser->item_offset + parser->item_length - 1] = 0;
  941|    169|        if(strcmp("<DIR>", mem + parser->item_offset) == 0) {
  ------------------
  |  Branch (941:12): [True: 35, False: 134]
  ------------------
  942|     35|          finfo->filetype = CURLFILETYPE_DIRECTORY;
  943|     35|          finfo->size = 0;
  944|     35|        }
  945|    134|        else {
  946|    134|          const char *p = mem + parser->item_offset;
  947|    134|          if(curlx_str_numblanks(&p, &finfo->size)) {
  ------------------
  |  Branch (947:14): [True: 52, False: 82]
  ------------------
  948|     52|            return CURLE_FTP_BAD_FILE_LIST;
  949|     52|          }
  950|       |          /* correct file type */
  951|     82|          parser->file_data->info.filetype = CURLFILETYPE_FILE;
  952|     82|        }
  953|       |
  954|    117|        parser->file_data->info.flags |= CURLFINFOFLAG_KNOWN_SIZE;
  ------------------
  |  |  312|    117|#define CURLFINFOFLAG_KNOWN_SIZE        (1 << 6)
  ------------------
  955|    117|        parser->item_length = 0;
  956|    117|        parser->state.NT.main = PL_WINNT_FILENAME;
  957|    117|        parser->state.NT.sub.filename = PL_WINNT_FILENAME_PRESPACE;
  958|    117|      }
  959|  2.99k|      break;
  960|  3.63k|    }
  961|  3.57k|    break;
  962|  3.57k|  case PL_WINNT_FILENAME:
  ------------------
  |  Branch (962:3): [True: 1.98k, False: 7.20k]
  ------------------
  963|  1.98k|    switch(parser->state.NT.sub.filename) {
  ------------------
  |  Branch (963:12): [True: 1.98k, False: 0]
  ------------------
  964|    403|    case PL_WINNT_FILENAME_PRESPACE:
  ------------------
  |  Branch (964:5): [True: 403, False: 1.58k]
  ------------------
  965|    403|      if(c != ' ' && len) {
  ------------------
  |  Branch (965:10): [True: 117, False: 286]
  |  Branch (965:22): [True: 117, False: 0]
  ------------------
  966|    117|        parser->item_offset = len - 1;
  967|    117|        parser->item_length = 1;
  968|    117|        parser->state.NT.sub.filename = PL_WINNT_FILENAME_CONTENT;
  969|    117|      }
  970|    403|      break;
  971|  1.58k|    case PL_WINNT_FILENAME_CONTENT:
  ------------------
  |  Branch (971:5): [True: 1.58k, False: 403]
  ------------------
  972|  1.58k|      parser->item_length++;
  973|  1.58k|      if(!len)
  ------------------
  |  Branch (973:10): [True: 0, False: 1.58k]
  ------------------
  974|      0|        return CURLE_FTP_BAD_FILE_LIST;
  975|  1.58k|      if(c == '\r') {
  ------------------
  |  Branch (975:10): [True: 0, False: 1.58k]
  ------------------
  976|      0|        parser->state.NT.sub.filename = PL_WINNT_FILENAME_WINEOL;
  977|      0|        mem[len - 1] = 0;
  978|      0|      }
  979|  1.58k|      else if(c == '\n') {
  ------------------
  |  Branch (979:15): [True: 117, False: 1.46k]
  ------------------
  980|    117|        parser->offsets.filename = parser->item_offset;
  981|    117|        mem[len - 1] = 0;
  982|    117|        result = ftp_pl_insert_finfo(data, infop);
  983|    117|        if(result)
  ------------------
  |  Branch (983:12): [True: 0, False: 117]
  ------------------
  984|      0|          return result;
  985|       |
  986|    117|        parser->state.NT.main = PL_WINNT_DATE;
  987|    117|        parser->state.NT.sub.filename = PL_WINNT_FILENAME_PRESPACE;
  988|    117|      }
  989|  1.58k|      break;
  990|  1.58k|    case PL_WINNT_FILENAME_WINEOL:
  ------------------
  |  Branch (990:5): [True: 0, False: 1.98k]
  ------------------
  991|      0|      if(c == '\n') {
  ------------------
  |  Branch (991:10): [True: 0, False: 0]
  ------------------
  992|      0|        parser->offsets.filename = parser->item_offset;
  993|      0|        result = ftp_pl_insert_finfo(data, infop);
  994|      0|        if(result)
  ------------------
  |  Branch (994:12): [True: 0, False: 0]
  ------------------
  995|      0|          return result;
  996|       |
  997|      0|        parser->state.NT.main = PL_WINNT_DATE;
  998|      0|        parser->state.NT.sub.filename = PL_WINNT_FILENAME_PRESPACE;
  999|      0|      }
 1000|      0|      else
 1001|      0|        return CURLE_FTP_BAD_FILE_LIST;
 1002|       |
 1003|      0|      break;
 1004|  1.98k|    }
 1005|  1.98k|    break;
 1006|  9.18k|  }
 1007|       |
 1008|  9.10k|  return CURLE_OK;
 1009|  9.18k|}

curl_getenv:
   27|  46.5k|{
   28|       |#if defined(CURL_WINDOWS_UWP) || \
   29|       |  defined(__ORBIS__) || defined(__PROSPERO__) /* PlayStation 4 and 5 */
   30|       |  (void)variable;
   31|       |  return NULL;
   32|       |#elif defined(_WIN32)
   33|       |  /* This uses Windows API instead of C runtime getenv() to get the environment
   34|       |     variable since some changes are not always visible to the latter. #4774 */
   35|       |  char *buf = NULL;
   36|       |  char *tmp;
   37|       |  DWORD bufsize;
   38|       |  DWORD rc = 1;
   39|       |  const DWORD max = 32768; /* max env var size from MSCRT source */
   40|       |
   41|       |  for(;;) {
   42|       |    tmp = curlx_realloc(buf, rc);
   43|       |    if(!tmp) {
   44|       |      curlx_free(buf);
   45|       |      return NULL;
   46|       |    }
   47|       |
   48|       |    buf = tmp;
   49|       |    bufsize = rc;
   50|       |
   51|       |    /* it is possible for rc to be 0 if the variable was found but empty.
   52|       |       Since getenv does not make that distinction we ignore it as well. */
   53|       |    rc = GetEnvironmentVariableA(variable, buf, bufsize);
   54|       |    if(!rc || rc == bufsize || rc > max) {
   55|       |      curlx_free(buf);
   56|       |      return NULL;
   57|       |    }
   58|       |
   59|       |    /* if rc < bufsize then rc is bytes written not including null */
   60|       |    if(rc < bufsize)
   61|       |      return buf;
   62|       |
   63|       |    /* else rc is bytes needed, try again */
   64|       |  }
   65|       |#else
   66|  46.5k|  char *env = getenv(variable);
   67|  46.5k|  return (env && env[0]) ? curlx_strdup(env) : NULL;
  ------------------
  |  | 1477|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  |  Branch (67:11): [True: 0, False: 46.5k]
  |  Branch (67:18): [True: 0, False: 0]
  ------------------
   68|  46.5k|#endif
   69|  46.5k|}

Curl_initinfo:
   42|  51.3k|{
   43|  51.3k|  struct Progress *pro = &data->progress;
   44|  51.3k|  struct PureInfo *info = &data->info;
   45|       |
   46|  51.3k|  pro->t_nslookup = 0;
   47|  51.3k|  pro->t_connect = 0;
   48|  51.3k|  pro->t_appconnect = 0;
   49|  51.3k|  pro->t_pretransfer = 0;
   50|  51.3k|  pro->t_posttransfer = 0;
   51|  51.3k|  pro->t_starttransfer = 0;
   52|  51.3k|  pro->timespent = 0;
   53|  51.3k|  pro->t_redirect = 0;
   54|  51.3k|  pro->is_t_startransfer_set = FALSE;
  ------------------
  |  | 1058|  51.3k|#define FALSE false
  ------------------
   55|       |
   56|  51.3k|  info->httpcode = 0;
   57|  51.3k|  info->httpproxycode = 0;
   58|  51.3k|  info->httpversion = 0;
   59|  51.3k|  info->filetime = -1; /* -1 is an illegal time and thus means unknown */
   60|  51.3k|  info->timecond = FALSE;
  ------------------
  |  | 1058|  51.3k|#define FALSE false
  ------------------
   61|       |
   62|  51.3k|  info->header_size = 0;
   63|  51.3k|  info->request_size = 0;
   64|  51.3k|  info->proxyauthavail = 0;
   65|  51.3k|  info->httpauthavail = 0;
   66|  51.3k|  info->proxyauthpicked = 0;
   67|  51.3k|  info->httpauthpicked = 0;
   68|  51.3k|  info->numconnects = 0;
   69|       |
   70|  51.3k|  curlx_safefree(info->contenttype);
  ------------------
  |  | 1327|  51.3k|  do {                      \
  |  | 1328|  51.3k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  51.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  51.3k|    (ptr) = NULL;           \
  |  | 1330|  51.3k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 51.3k]
  |  |  ------------------
  ------------------
   71|  51.3k|  curlx_safefree(info->wouldredirect);
  ------------------
  |  | 1327|  51.3k|  do {                      \
  |  | 1328|  51.3k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  51.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  51.3k|    (ptr) = NULL;           \
  |  | 1330|  51.3k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 51.3k]
  |  |  ------------------
  ------------------
   72|       |
   73|  51.3k|  memset(&info->primary, 0, sizeof(info->primary));
   74|  51.3k|  info->retry_after = 0;
   75|       |
   76|  51.3k|  info->conn_scheme = 0;
   77|  51.3k|  info->conn_protocol = 0;
   78|  51.3k|  info->used_proxy = 0;
   79|       |
   80|  51.3k|#ifdef USE_SSL
   81|  51.3k|  Curl_ssl_free_certinfo(data);
   82|  51.3k|#endif
   83|  51.3k|}

Curl_hash_init:
   82|   121k|{
   83|   121k|  DEBUGASSERT(h);
  ------------------
  |  | 1081|   121k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (83:3): [True: 0, False: 121k]
  |  Branch (83:3): [True: 121k, False: 0]
  ------------------
   84|   121k|  DEBUGASSERT(slots);
  ------------------
  |  | 1081|   121k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (84:3): [True: 0, False: 121k]
  |  Branch (84:3): [True: 121k, False: 0]
  ------------------
   85|   121k|  DEBUGASSERT(hfunc);
  ------------------
  |  | 1081|   121k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (85:3): [True: 0, False: 121k]
  |  Branch (85:3): [True: 121k, False: 0]
  ------------------
   86|   121k|  DEBUGASSERT(comparator);
  ------------------
  |  | 1081|   121k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (86:3): [True: 0, False: 121k]
  |  Branch (86:3): [True: 121k, False: 0]
  ------------------
   87|   121k|  DEBUGASSERT(dtor);
  ------------------
  |  | 1081|   121k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (87:3): [True: 0, False: 121k]
  |  Branch (87:3): [True: 121k, False: 0]
  ------------------
   88|       |
   89|   121k|  h->table = NULL;
   90|   121k|  h->hash_func = hfunc;
   91|   121k|  h->comp_func = comparator;
   92|   121k|  h->dtor = dtor;
   93|   121k|  h->size = 0;
   94|   121k|  h->slots = slots;
   95|   121k|#ifdef DEBUGBUILD
   96|   121k|  h->init = HASHINIT;
  ------------------
  |  |   30|   121k|#define HASHINIT 0x7017e781
  ------------------
   97|   121k|#endif
   98|   121k|}
Curl_hash_add2:
  163|  37.7k|{
  164|  37.7k|  struct Curl_hash_element *he, **slot;
  165|       |
  166|  37.7k|  DEBUGASSERT(h);
  ------------------
  |  | 1081|  37.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (166:3): [True: 0, False: 37.7k]
  |  Branch (166:3): [True: 37.7k, False: 0]
  ------------------
  167|  37.7k|  DEBUGASSERT(h->slots);
  ------------------
  |  | 1081|  37.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (167:3): [True: 0, False: 37.7k]
  |  Branch (167:3): [True: 37.7k, False: 0]
  ------------------
  168|  37.7k|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1081|  37.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (168:3): [True: 0, False: 37.7k]
  |  Branch (168:3): [True: 37.7k, False: 0]
  ------------------
  169|  37.7k|  if(!h->table) {
  ------------------
  |  Branch (169:6): [True: 35.3k, False: 2.38k]
  ------------------
  170|  35.3k|    h->table = curlx_calloc(h->slots, sizeof(struct Curl_hash_element *));
  ------------------
  |  | 1480|  35.3k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  171|  35.3k|    if(!h->table)
  ------------------
  |  Branch (171:8): [True: 0, False: 35.3k]
  ------------------
  172|      0|      return NULL; /* OOM */
  173|  35.3k|  }
  174|       |
  175|  37.7k|  slot = CURL_HASH_SLOT_ADDR(h, key, key_len);
  ------------------
  |  |  159|  37.7k|#define CURL_HASH_SLOT_ADDR(x, y, z) &CURL_HASH_SLOT(x, y, z)
  |  |  ------------------
  |  |  |  |  158|  37.7k|#define CURL_HASH_SLOT(x, y, z)      x->table[(x)->hash_func(y, z, (x)->slots)]
  |  |  ------------------
  ------------------
  176|  37.7k|  for(he = *slot; he; he = he->next) {
  ------------------
  |  Branch (176:19): [True: 223, False: 37.5k]
  ------------------
  177|    223|    if(h->comp_func(he->key, he->key_len, key, key_len)) {
  ------------------
  |  Branch (177:8): [True: 184, False: 39]
  ------------------
  178|       |      /* existing key entry, overwrite by clearing old pointer */
  179|    184|      hash_elem_clear_ptr(h, he);
  180|    184|      he->ptr = p;
  181|    184|      he->dtor = dtor;
  182|    184|      return p;
  183|    184|    }
  184|    223|  }
  185|       |
  186|  37.5k|  he = hash_elem_create(key, key_len, p, dtor);
  187|  37.5k|  if(!he)
  ------------------
  |  Branch (187:6): [True: 0, False: 37.5k]
  ------------------
  188|      0|    return NULL; /* OOM */
  189|       |
  190|  37.5k|  hash_elem_link(h, slot, he);
  191|  37.5k|  return p; /* return the new entry */
  192|  37.5k|}
Curl_hash_add:
  203|  27.1k|{
  204|       |  return Curl_hash_add2(h, key, key_len, p, NULL);
  205|  27.1k|}
Curl_hash_delete:
  213|  45.7k|{
  214|  45.7k|  DEBUGASSERT(h);
  ------------------
  |  | 1081|  45.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (214:3): [True: 0, False: 45.7k]
  |  Branch (214:3): [True: 45.7k, False: 0]
  ------------------
  215|  45.7k|  DEBUGASSERT(h->slots);
  ------------------
  |  | 1081|  45.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (215:3): [True: 0, False: 45.7k]
  |  Branch (215:3): [True: 45.7k, False: 0]
  ------------------
  216|  45.7k|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1081|  45.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (216:3): [True: 0, False: 45.7k]
  |  Branch (216:3): [True: 45.7k, False: 0]
  ------------------
  217|  45.7k|  if(h->table) {
  ------------------
  |  Branch (217:6): [True: 24.5k, False: 21.2k]
  ------------------
  218|  24.5k|    struct Curl_hash_element *he, **he_anchor;
  219|       |
  220|  24.5k|    he_anchor = CURL_HASH_SLOT_ADDR(h, key, key_len);
  ------------------
  |  |  159|  24.5k|#define CURL_HASH_SLOT_ADDR(x, y, z) &CURL_HASH_SLOT(x, y, z)
  |  |  ------------------
  |  |  |  |  158|  24.5k|#define CURL_HASH_SLOT(x, y, z)      x->table[(x)->hash_func(y, z, (x)->slots)]
  |  |  ------------------
  ------------------
  221|  24.5k|    while(*he_anchor) {
  ------------------
  |  Branch (221:11): [True: 14.1k, False: 10.3k]
  ------------------
  222|  14.1k|      he = *he_anchor;
  223|  14.1k|      if(h->comp_func(he->key, he->key_len, key, key_len)) {
  ------------------
  |  Branch (223:10): [True: 14.1k, False: 0]
  ------------------
  224|  14.1k|        hash_elem_unlink(h, he_anchor, he);
  225|  14.1k|        hash_elem_destroy(h, he);
  226|  14.1k|        return 0;
  227|  14.1k|      }
  228|      0|      he_anchor = &he->next;
  229|      0|    }
  230|  24.5k|  }
  231|  31.6k|  return 1;
  232|  45.7k|}
Curl_hash_pick:
  239|  1.41M|{
  240|  1.41M|  DEBUGASSERT(h);
  ------------------
  |  | 1081|  1.41M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (240:3): [True: 0, False: 1.41M]
  |  Branch (240:3): [True: 1.41M, False: 0]
  ------------------
  241|  1.41M|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1081|  1.41M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (241:3): [True: 0, False: 1.41M]
  |  Branch (241:3): [True: 1.41M, False: 0]
  ------------------
  242|  1.41M|  if(h->table) {
  ------------------
  |  Branch (242:6): [True: 1.13M, False: 286k]
  ------------------
  243|  1.13M|    struct Curl_hash_element *he;
  244|  1.13M|    DEBUGASSERT(h->slots);
  ------------------
  |  | 1081|  1.13M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (244:5): [True: 0, False: 1.13M]
  |  Branch (244:5): [True: 1.13M, False: 0]
  ------------------
  245|  1.13M|    he = CURL_HASH_SLOT(h, key, key_len);
  ------------------
  |  |  158|  1.13M|#define CURL_HASH_SLOT(x, y, z)      x->table[(x)->hash_func(y, z, (x)->slots)]
  ------------------
  246|  1.13M|    while(he) {
  ------------------
  |  Branch (246:11): [True: 1.05M, False: 75.0k]
  ------------------
  247|  1.05M|      if(h->comp_func(he->key, he->key_len, key, key_len)) {
  ------------------
  |  Branch (247:10): [True: 1.05M, False: 1.16k]
  ------------------
  248|  1.05M|        return he->ptr;
  249|  1.05M|      }
  250|  1.16k|      he = he->next;
  251|  1.16k|    }
  252|  1.13M|  }
  253|   361k|  return NULL;
  254|  1.41M|}
Curl_hash_destroy:
  264|   121k|{
  265|   121k|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1081|   121k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (265:3): [True: 0, False: 121k]
  |  Branch (265:3): [True: 121k, False: 0]
  ------------------
  266|   121k|  if(h->table) {
  ------------------
  |  Branch (266:6): [True: 35.3k, False: 85.6k]
  ------------------
  267|  35.3k|    Curl_hash_clean(h);
  268|  35.3k|    curlx_safefree(h->table);
  ------------------
  |  | 1327|  35.3k|  do {                      \
  |  | 1328|  35.3k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  35.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  35.3k|    (ptr) = NULL;           \
  |  | 1330|  35.3k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 35.3k]
  |  |  ------------------
  ------------------
  269|  35.3k|  }
  270|   121k|  DEBUGASSERT(h->size == 0);
  ------------------
  |  | 1081|   121k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (270:3): [True: 0, False: 121k]
  |  Branch (270:3): [True: 121k, False: 0]
  ------------------
  271|   121k|  h->slots = 0;
  272|   121k|}
Curl_hash_clean:
  279|  35.3k|{
  280|  35.3k|  if(h && h->table) {
  ------------------
  |  Branch (280:6): [True: 35.3k, False: 0]
  |  Branch (280:11): [True: 35.3k, False: 0]
  ------------------
  281|  35.3k|    struct Curl_hash_element *he, **he_anchor;
  282|  35.3k|    size_t i;
  283|  35.3k|    DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1081|  35.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (283:5): [True: 0, False: 35.3k]
  |  Branch (283:5): [True: 35.3k, False: 0]
  ------------------
  284|  2.37M|    for(i = 0; i < h->slots; ++i) {
  ------------------
  |  Branch (284:16): [True: 2.33M, False: 35.3k]
  ------------------
  285|  2.33M|      he_anchor = &h->table[i];
  286|  2.36M|      while(*he_anchor) {
  ------------------
  |  Branch (286:13): [True: 23.4k, False: 2.33M]
  ------------------
  287|  23.4k|        he = *he_anchor;
  288|  23.4k|        hash_elem_unlink(h, he_anchor, he);
  289|  23.4k|        hash_elem_destroy(h, he);
  290|  23.4k|      }
  291|  2.33M|    }
  292|  35.3k|  }
  293|  35.3k|}
Curl_hash_count:
  296|  13.8k|{
  297|  13.8k|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1081|  13.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (297:3): [True: 0, False: 13.8k]
  |  Branch (297:3): [True: 13.8k, False: 0]
  ------------------
  298|  13.8k|  return h->size;
  299|  13.8k|}
Curl_hash_clean_with_criterium:
  304|  13.8k|{
  305|  13.8k|  size_t i;
  306|       |
  307|  13.8k|  if(!h || !h->table)
  ------------------
  |  Branch (307:6): [True: 0, False: 13.8k]
  |  Branch (307:12): [True: 239, False: 13.6k]
  ------------------
  308|    239|    return;
  309|       |
  310|  13.6k|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1081|  13.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (310:3): [True: 0, False: 13.6k]
  |  Branch (310:3): [True: 13.6k, False: 0]
  ------------------
  311|   982k|  for(i = 0; i < h->slots; ++i) {
  ------------------
  |  Branch (311:14): [True: 968k, False: 13.6k]
  ------------------
  312|   968k|    struct Curl_hash_element *he, **he_anchor = &h->table[i];
  313|   983k|    while(*he_anchor) {
  ------------------
  |  Branch (313:11): [True: 14.7k, False: 968k]
  ------------------
  314|       |      /* ask the callback function if we shall remove this entry or not */
  315|  14.7k|      if(!comp || comp(user, (*he_anchor)->ptr)) {
  ------------------
  |  Branch (315:10): [True: 0, False: 14.7k]
  |  Branch (315:19): [True: 8, False: 14.7k]
  ------------------
  316|      8|        he = *he_anchor;
  317|      8|        hash_elem_unlink(h, he_anchor, he);
  318|      8|        hash_elem_destroy(h, he);
  319|      8|      }
  320|  14.7k|      else
  321|  14.7k|        he_anchor = &(*he_anchor)->next;
  322|  14.7k|    }
  323|   968k|  }
  324|  13.6k|}
Curl_hash_str:
  327|  1.19M|{
  328|  1.19M|  const char *key_str = (const char *)key;
  329|  1.19M|  const char *end = key_str + key_length;
  330|  1.19M|  size_t h = 5381;
  331|       |
  332|  23.7M|  while(key_str < end) {
  ------------------
  |  Branch (332:9): [True: 22.5M, False: 1.19M]
  ------------------
  333|  22.5M|    size_t j = (size_t)*key_str++;
  334|  22.5M|    h += h << 5;
  335|  22.5M|    h ^= j;
  336|  22.5M|  }
  337|       |
  338|  1.19M|  return (h % slots_num);
  339|  1.19M|}
curlx_str_key_compare:
  343|  1.07M|{
  344|  1.07M|  if((key1_len == key2_len) && !memcmp(k1, k2, key1_len))
  ------------------
  |  Branch (344:6): [True: 1.07M, False: 1.18k]
  |  Branch (344:32): [True: 1.07M, False: 16]
  ------------------
  345|  1.07M|    return 1;
  346|       |
  347|  1.20k|  return 0;
  348|  1.07M|}
Curl_hash_start_iterate:
  352|  34.0k|{
  353|  34.0k|  DEBUGASSERT(hash->init == HASHINIT);
  ------------------
  |  | 1081|  34.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (353:3): [True: 0, False: 34.0k]
  |  Branch (353:3): [True: 34.0k, False: 0]
  ------------------
  354|  34.0k|  iter->hash = hash;
  355|  34.0k|  iter->slot_index = 0;
  356|  34.0k|  iter->current = NULL;
  357|  34.0k|#ifdef DEBUGBUILD
  358|  34.0k|  iter->init = ITERINIT;
  ------------------
  |  |   31|  34.0k|#define ITERINIT 0x5FEDCBA9
  ------------------
  359|  34.0k|#endif
  360|  34.0k|}
Curl_hash_next_element:
  364|  36.0k|{
  365|  36.0k|  struct Curl_hash *h;
  366|  36.0k|  DEBUGASSERT(iter->init == ITERINIT);
  ------------------
  |  | 1081|  36.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (366:3): [True: 0, False: 36.0k]
  |  Branch (366:3): [True: 36.0k, False: 0]
  ------------------
  367|  36.0k|  h = iter->hash;
  368|  36.0k|  if(!h->table)
  ------------------
  |  Branch (368:6): [True: 17.2k, False: 18.8k]
  ------------------
  369|  17.2k|    return NULL; /* empty hash, nothing to return */
  370|       |
  371|       |  /* Get the next element in the current list, if any */
  372|  18.8k|  if(iter->current)
  ------------------
  |  Branch (372:6): [True: 1.99k, False: 16.8k]
  ------------------
  373|  1.99k|    iter->current = iter->current->next;
  374|       |
  375|       |  /* If we have reached the end of the list, find the next one */
  376|  18.8k|  if(!iter->current) {
  ------------------
  |  Branch (376:6): [True: 18.8k, False: 0]
  ------------------
  377|  18.8k|    size_t i;
  378|  1.60M|    for(i = iter->slot_index; i < h->slots; i++) {
  ------------------
  |  Branch (378:31): [True: 1.58M, False: 14.9k]
  ------------------
  379|  1.58M|      if(h->table[i]) {
  ------------------
  |  Branch (379:10): [True: 3.92k, False: 1.58M]
  ------------------
  380|  3.92k|        iter->current = h->table[i];
  381|  3.92k|        iter->slot_index = i + 1;
  382|  3.92k|        break;
  383|  3.92k|      }
  384|  1.58M|    }
  385|  18.8k|  }
  386|       |
  387|  18.8k|  return iter->current;
  388|  36.0k|}
hash.c:hash_elem_clear_ptr:
  122|  37.7k|{
  123|  37.7k|  DEBUGASSERT(h);
  ------------------
  |  | 1081|  37.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (123:3): [True: 0, False: 37.7k]
  |  Branch (123:3): [True: 37.7k, False: 0]
  ------------------
  124|  37.7k|  DEBUGASSERT(he);
  ------------------
  |  | 1081|  37.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (124:3): [True: 0, False: 37.7k]
  |  Branch (124:3): [True: 37.7k, False: 0]
  ------------------
  125|  37.7k|  if(he->ptr) {
  ------------------
  |  Branch (125:6): [True: 37.7k, False: 0]
  ------------------
  126|  37.7k|    if(he->dtor)
  ------------------
  |  Branch (126:8): [True: 10.5k, False: 27.1k]
  ------------------
  127|  10.5k|      he->dtor(he->key, he->key_len, he->ptr);
  128|  27.1k|    else
  129|  27.1k|      h->dtor(he->ptr);
  130|       |    he->ptr = NULL;
  131|  37.7k|  }
  132|  37.7k|}
hash.c:hash_elem_create:
  104|  37.5k|{
  105|  37.5k|  struct Curl_hash_element *he;
  106|       |
  107|       |  /* allocate the struct plus memory after it to store the key */
  108|  37.5k|  he = curlx_malloc(sizeof(struct Curl_hash_element) + key_len);
  ------------------
  |  | 1478|  37.5k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  109|  37.5k|  if(he) {
  ------------------
  |  Branch (109:6): [True: 37.5k, False: 0]
  ------------------
  110|  37.5k|    he->next = NULL;
  111|       |    /* copy the key */
  112|  37.5k|    memcpy(he->key, key, key_len);
  113|  37.5k|    he->key_len = key_len;
  114|  37.5k|    he->ptr = CURL_UNCONST(p);
  ------------------
  |  |  866|  37.5k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  115|  37.5k|    he->dtor = dtor;
  116|  37.5k|  }
  117|  37.5k|  return he;
  118|  37.5k|}
hash.c:hash_elem_link:
  152|  37.5k|{
  153|  37.5k|  he->next = *he_anchor;
  154|  37.5k|  *he_anchor = he;
  155|  37.5k|  ++h->size;
  156|  37.5k|}
hash.c:hash_elem_unlink:
  144|  37.5k|{
  145|  37.5k|  *he_anchor = he->next;
  146|  37.5k|  --h->size;
  147|  37.5k|}
hash.c:hash_elem_destroy:
  136|  37.5k|{
  137|  37.5k|  hash_elem_clear_ptr(h, he);
  138|  37.5k|  curlx_free(he);
  ------------------
  |  | 1483|  37.5k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  139|  37.5k|}

Curl_headers_push:
  224|  94.7k|{
  225|  94.7k|  char *value = NULL;
  226|  94.7k|  char *name = NULL;
  227|  94.7k|  struct Curl_header_store *hs;
  228|  94.7k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  229|  94.7k|  const size_t ilen = hlen;
  230|       |
  231|  94.7k|  if((header[0] == '\r') || (header[0] == '\n'))
  ------------------
  |  Branch (231:6): [True: 357, False: 94.3k]
  |  Branch (231:29): [True: 8.17k, False: 86.1k]
  ------------------
  232|       |    /* ignore the body separator */
  233|  8.52k|    return CURLE_OK;
  234|       |
  235|       |  /* trim off newline characters */
  236|  86.1k|  if(hlen && (header[hlen - 1] == '\n'))
  ------------------
  |  Branch (236:6): [True: 86.1k, False: 0]
  |  Branch (236:14): [True: 84.4k, False: 1.76k]
  ------------------
  237|  84.4k|    hlen--;
  238|  86.1k|  if(hlen && (header[hlen - 1] == '\r'))
  ------------------
  |  Branch (238:6): [True: 86.1k, False: 0]
  |  Branch (238:14): [True: 32.6k, False: 53.5k]
  ------------------
  239|  32.6k|    hlen--;
  240|  86.1k|  if(hlen == ilen)
  ------------------
  |  Branch (240:6): [True: 556, False: 85.6k]
  ------------------
  241|       |    /* neither CR nor LF as terminator is not a valid header */
  242|    556|    return CURLE_WEIRD_SERVER_REPLY;
  243|       |
  244|  85.6k|  if(ISBLANK(header[0])) {
  ------------------
  |  |   45|  85.6k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 176, False: 85.4k]
  |  |  |  Branch (45:38): [True: 66, False: 85.3k]
  |  |  ------------------
  ------------------
  245|       |    /* pass leading blanks */
  246|  1.28k|    while(hlen && ISBLANK(*header)) {
  ------------------
  |  |   45|  1.28k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 720, False: 563]
  |  |  |  Branch (45:38): [True: 322, False: 241]
  |  |  ------------------
  ------------------
  |  Branch (246:11): [True: 1.28k, False: 1]
  ------------------
  247|  1.04k|      header++;
  248|  1.04k|      hlen--;
  249|  1.04k|    }
  250|    242|    if(!hlen)
  ------------------
  |  Branch (250:8): [True: 1, False: 241]
  ------------------
  251|      1|      return CURLE_WEIRD_SERVER_REPLY;
  252|    242|  }
  253|  85.6k|  if(Curl_llist_count(&data->state.httphdrs) >= MAX_HTTP_RESP_HEADER_COUNT) {
  ------------------
  |  |  158|  85.6k|#define MAX_HTTP_RESP_HEADER_COUNT 5000
  ------------------
  |  Branch (253:6): [True: 0, False: 85.6k]
  ------------------
  254|      0|    failf(data, "Too many response headers, %d is max",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  255|      0|          MAX_HTTP_RESP_HEADER_COUNT);
  ------------------
  |  |  158|      0|#define MAX_HTTP_RESP_HEADER_COUNT 5000
  ------------------
  256|      0|    return CURLE_TOO_LARGE;
  257|      0|  }
  258|       |
  259|  85.6k|  hs = curlx_calloc(1, sizeof(*hs) + hlen);
  ------------------
  |  | 1480|  85.6k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  260|  85.6k|  if(!hs)
  ------------------
  |  Branch (260:6): [True: 0, False: 85.6k]
  ------------------
  261|      0|    return CURLE_OUT_OF_MEMORY;
  262|  85.6k|  memcpy(hs->buffer, header, hlen);
  263|  85.6k|  hs->buffer[hlen] = 0; /* null-terminate */
  264|       |
  265|  85.6k|  result = namevalue(hs->buffer, hlen, type, &name, &value);
  266|  85.6k|  if(!result) {
  ------------------
  |  Branch (266:6): [True: 85.3k, False: 233]
  ------------------
  267|  85.3k|    hs->name = name;
  268|  85.3k|    hs->value = value;
  269|  85.3k|    hs->type = type;
  270|  85.3k|    hs->request = data->state.requests;
  271|       |
  272|       |    /* insert this node into the list of headers */
  273|  85.3k|    Curl_llist_append(&data->state.httphdrs, hs, &hs->node);
  274|  85.3k|    data->state.prevhead = hs;
  275|  85.3k|  }
  276|    233|  else {
  277|    233|    failf(data, "Invalid response header");
  ------------------
  |  |   62|    233|#define failf Curl_failf
  ------------------
  278|    233|    curlx_free(hs);
  ------------------
  |  | 1483|    233|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  279|    233|  }
  280|  85.6k|  return result;
  281|  85.6k|}
Curl_headers_init:
  325|  20.6k|{
  326|  20.6k|  struct Curl_cwriter *writer;
  327|  20.6k|  CURLcode result;
  328|       |
  329|  20.6k|  if(data->conn && (data->conn->scheme->protocol & PROTO_FAMILY_HTTP)) {
  ------------------
  |  |   84|  20.6k|#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1078|  20.6k|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1079|  20.6k|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  |   63|  20.6k|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   85|  20.6k|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   64|  20.6k|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
  |  Branch (329:6): [True: 20.6k, False: 0]
  |  Branch (329:20): [True: 15.6k, False: 4.94k]
  ------------------
  330|       |    /* avoid installing it twice */
  331|  15.6k|    if(Curl_cwriter_get_by_name(data, hds_cw_collect.name))
  ------------------
  |  Branch (331:8): [True: 147, False: 15.5k]
  ------------------
  332|    147|      return CURLE_OK;
  333|       |
  334|  15.5k|    result = Curl_cwriter_create(&writer, data, &hds_cw_collect,
  335|  15.5k|                                 CURL_CW_PROTOCOL);
  336|  15.5k|    if(result)
  ------------------
  |  Branch (336:8): [True: 0, False: 15.5k]
  ------------------
  337|      0|      return result;
  338|       |
  339|  15.5k|    result = Curl_cwriter_add(data, writer);
  340|  15.5k|    if(result) {
  ------------------
  |  Branch (340:8): [True: 0, False: 15.5k]
  ------------------
  341|      0|      Curl_cwriter_free(data, writer);
  342|      0|      return result;
  343|      0|    }
  344|  15.5k|  }
  345|  20.4k|  return CURLE_OK;
  346|  20.6k|}
Curl_headers_cleanup:
  352|  51.3k|{
  353|  51.3k|  struct Curl_llist_node *e;
  354|  51.3k|  struct Curl_llist_node *n;
  355|       |
  356|   136k|  for(e = Curl_llist_head(&data->state.httphdrs); e; e = n) {
  ------------------
  |  Branch (356:51): [True: 85.3k, False: 51.3k]
  ------------------
  357|  85.3k|    struct Curl_header_store *hs = Curl_node_elem(e);
  358|  85.3k|    n = Curl_node_next(e);
  359|  85.3k|    curlx_free(hs);
  ------------------
  |  | 1483|  85.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  360|  85.3k|  }
  361|  51.3k|  headers_reset(data);
  362|  51.3k|  return CURLE_OK;
  363|  51.3k|}
headers.c:namevalue:
  183|  85.6k|{
  184|  85.6k|  char *end = header + hlen - 1; /* point to the last byte */
  185|  85.6k|  DEBUGASSERT(hlen);
  ------------------
  |  | 1081|  85.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (185:3): [True: 0, False: 85.6k]
  |  Branch (185:3): [True: 85.6k, False: 0]
  ------------------
  186|  85.6k|  *name = header;
  187|       |
  188|  85.6k|  if(type == CURLH_PSEUDO) {
  ------------------
  |  |   45|  85.6k|#define CURLH_PSEUDO    (1 << 4) /* pseudo headers */
  ------------------
  |  Branch (188:6): [True: 1.20k, False: 84.4k]
  ------------------
  189|  1.20k|    if(*header != ':')
  ------------------
  |  Branch (189:8): [True: 0, False: 1.20k]
  ------------------
  190|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  191|  1.20k|    header++;
  192|  1.20k|  }
  193|       |
  194|       |  /* Find the end of the header name */
  195|  1.03M|  while(*header && (*header != ':'))
  ------------------
  |  Branch (195:9): [True: 1.03M, False: 233]
  |  Branch (195:20): [True: 949k, False: 85.3k]
  ------------------
  196|   949k|    ++header;
  197|       |
  198|  85.6k|  if(*header)
  ------------------
  |  Branch (198:6): [True: 85.3k, False: 233]
  ------------------
  199|       |    /* Skip over colon, null it */
  200|  85.3k|    *header++ = 0;
  201|    233|  else
  202|    233|    return CURLE_BAD_FUNCTION_ARGUMENT;
  203|       |
  204|       |  /* skip all leading blank letters */
  205|   123k|  while(ISBLANK(*header))
  ------------------
  |  |   45|   123k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 37.8k, False: 85.7k]
  |  |  |  Branch (45:38): [True: 332, False: 85.3k]
  |  |  ------------------
  ------------------
  206|  38.1k|    header++;
  207|       |
  208|  85.3k|  *value = header;
  209|       |
  210|       |  /* skip all trailing space letters */
  211|  87.2k|  while((end > header) && ISBLANK(*end))
  ------------------
  |  |   45|  57.7k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 945, False: 56.7k]
  |  |  |  Branch (45:38): [True: 894, False: 55.8k]
  |  |  ------------------
  ------------------
  |  Branch (211:9): [True: 57.7k, False: 29.5k]
  ------------------
  212|  1.83k|    *end-- = 0; /* null-terminate */
  213|  85.3k|  return CURLE_OK;
  214|  85.6k|}
headers.c:hds_cw_collect_write:
  299|   110k|{
  300|   110k|  if((type & CLIENTWRITE_HEADER) && !(type & CLIENTWRITE_STATUS)) {
  ------------------
  |  |   44|   110k|#define CLIENTWRITE_HEADER  (1 << 2) /* meta information, HEADER */
  ------------------
                if((type & CLIENTWRITE_HEADER) && !(type & CLIENTWRITE_STATUS)) {
  ------------------
  |  |   45|   104k|#define CLIENTWRITE_STATUS  (1 << 3) /* a special status HEADER */
  ------------------
  |  Branch (300:6): [True: 104k, False: 6.38k]
  |  Branch (300:37): [True: 93.5k, False: 10.6k]
  ------------------
  301|  93.5k|    unsigned char htype = (unsigned char)
  302|  93.5k|      (type & CLIENTWRITE_CONNECT ? CURLH_CONNECT :
  ------------------
  |  |   46|  93.5k|#define CLIENTWRITE_CONNECT (1 << 4) /* a CONNECT related HEADER */
  ------------------
                    (type & CLIENTWRITE_CONNECT ? CURLH_CONNECT :
  ------------------
  |  |   43|  40.0k|#define CURLH_CONNECT   (1 << 2) /* CONNECT headers */
  ------------------
  |  Branch (302:8): [True: 40.0k, False: 53.4k]
  ------------------
  303|  93.5k|       (type & CLIENTWRITE_1XX ? CURLH_1XX :
  ------------------
  |  |   47|  53.4k|#define CLIENTWRITE_1XX     (1 << 5) /* a 1xx response related HEADER */
  ------------------
                     (type & CLIENTWRITE_1XX ? CURLH_1XX :
  ------------------
  |  |   44|  3.38k|#define CURLH_1XX       (1 << 3) /* 1xx headers */
  ------------------
  |  Branch (303:9): [True: 3.38k, False: 50.0k]
  ------------------
  304|  53.4k|        (type & CLIENTWRITE_TRAILER ? CURLH_TRAILER :
  ------------------
  |  |   48|  50.0k|#define CLIENTWRITE_TRAILER (1 << 6) /* a trailer HEADER */
  ------------------
                      (type & CLIENTWRITE_TRAILER ? CURLH_TRAILER :
  ------------------
  |  |   42|    215|#define CURLH_TRAILER   (1 << 1) /* trailers */
  ------------------
  |  Branch (304:10): [True: 215, False: 49.8k]
  ------------------
  305|  50.0k|         CURLH_HEADER)));
  ------------------
  |  |   41|  49.8k|#define CURLH_HEADER    (1 << 0) /* plain server header */
  ------------------
  306|  93.5k|    CURLcode result = Curl_headers_push(data, buf, blen, htype);
  307|  93.5k|    CURL_TRC_WRITE(data, "header_collect pushed(type=%x, len=%zu) -> %d",
  ------------------
  |  |  158|  93.5k|  do {                                                     \
  |  |  159|  93.5k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|  93.5k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|   187k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 93.5k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 93.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|   187k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  93.5k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|  93.5k|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|  93.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 93.5k]
  |  |  ------------------
  ------------------
  308|  93.5k|                   htype, blen, result);
  309|  93.5k|    if(result)
  ------------------
  |  Branch (309:8): [True: 790, False: 92.7k]
  ------------------
  310|    790|      return result;
  311|  93.5k|  }
  312|   109k|  return Curl_cwriter_write(data, writer->next, type, buf, blen);
  313|   110k|}
headers.c:headers_reset:
  287|  51.3k|{
  288|  51.3k|  Curl_llist_init(&data->state.httphdrs, NULL);
  289|       |  data->state.prevhead = NULL;
  290|  51.3k|}

Curl_HMAC_init:
   48|  10.0k|{
   49|  10.0k|  size_t i;
   50|  10.0k|  struct HMAC_context *ctxt;
   51|  10.0k|  unsigned char *hkey;
   52|  10.0k|  unsigned char b;
   53|       |
   54|       |  /* Create HMAC context. */
   55|  10.0k|  i = sizeof(*ctxt) + (2 * hashparams->ctxtsize) + hashparams->resultlen;
   56|  10.0k|  ctxt = curlx_malloc(i);
  ------------------
  |  | 1478|  10.0k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
   57|       |
   58|  10.0k|  if(!ctxt)
  ------------------
  |  Branch (58:6): [True: 0, False: 10.0k]
  ------------------
   59|      0|    return ctxt;
   60|       |
   61|  10.0k|  ctxt->hash = hashparams;
   62|  10.0k|  ctxt->hashctxt1 = (void *)(ctxt + 1);
   63|  10.0k|  ctxt->hashctxt2 = (void *)((char *)ctxt->hashctxt1 + hashparams->ctxtsize);
   64|       |
   65|       |  /* If the key is too long, replace it by its hash digest. */
   66|  10.0k|  if(keylen > hashparams->maxkeylen) {
  ------------------
  |  Branch (66:6): [True: 13, False: 10.0k]
  ------------------
   67|     13|    if(hashparams->hinit(ctxt->hashctxt1))
  ------------------
  |  Branch (67:8): [True: 0, False: 13]
  ------------------
   68|      0|      goto fail;
   69|     13|    hashparams->hupdate(ctxt->hashctxt1, key, keylen);
   70|     13|    hkey = (unsigned char *)ctxt->hashctxt2 + hashparams->ctxtsize;
   71|     13|    hashparams->hfinal(hkey, ctxt->hashctxt1);
   72|     13|    key = hkey;
   73|     13|    keylen = hashparams->resultlen;
   74|     13|  }
   75|       |
   76|       |  /* Prime the two hash contexts with the modified key. */
   77|  10.0k|  if(hashparams->hinit(ctxt->hashctxt1) ||
  ------------------
  |  Branch (77:6): [True: 0, False: 10.0k]
  ------------------
   78|  10.0k|     hashparams->hinit(ctxt->hashctxt2))
  ------------------
  |  Branch (78:6): [True: 0, False: 10.0k]
  ------------------
   79|      0|    goto fail;
   80|       |
   81|   284k|  for(i = 0; i < keylen; i++) {
  ------------------
  |  Branch (81:14): [True: 274k, False: 10.0k]
  ------------------
   82|   274k|    b = (unsigned char)(*key ^ hmac_ipad);
   83|   274k|    hashparams->hupdate(ctxt->hashctxt1, &b, 1);
   84|   274k|    b = (unsigned char)(*key++ ^ hmac_opad);
   85|   274k|    hashparams->hupdate(ctxt->hashctxt2, &b, 1);
   86|   274k|  }
   87|       |
   88|   381k|  for(; i < hashparams->maxkeylen; i++) {
  ------------------
  |  Branch (88:9): [True: 371k, False: 10.0k]
  ------------------
   89|   371k|    hashparams->hupdate(ctxt->hashctxt1, &hmac_ipad, 1);
   90|   371k|    hashparams->hupdate(ctxt->hashctxt2, &hmac_opad, 1);
   91|   371k|  }
   92|       |
   93|       |  /* Done, return pointer to HMAC context. */
   94|  10.0k|  return ctxt;
   95|       |
   96|      0|fail:
   97|      0|  curlx_free(ctxt);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   98|       |  return NULL;
   99|  10.0k|}
Curl_HMAC_update:
  104|  10.0k|{
  105|       |  /* Update first hash calculation. */
  106|  10.0k|  ctxt->hash->hupdate(ctxt->hashctxt1, data, len);
  107|  10.0k|}
Curl_HMAC_final:
  110|  10.0k|{
  111|  10.0k|  const struct HMAC_params *hashparams = ctxt->hash;
  112|       |
  113|       |  /* Do not get output if called with a null parameter: only release
  114|       |     storage. */
  115|       |
  116|  10.0k|  if(!output)
  ------------------
  |  Branch (116:6): [True: 0, False: 10.0k]
  ------------------
  117|      0|    output = (unsigned char *)ctxt->hashctxt2 + ctxt->hash->ctxtsize;
  118|       |
  119|  10.0k|  hashparams->hfinal(output, ctxt->hashctxt1);
  120|  10.0k|  hashparams->hupdate(ctxt->hashctxt2, output, hashparams->resultlen);
  121|  10.0k|  hashparams->hfinal(output, ctxt->hashctxt2);
  122|  10.0k|  curlx_free(ctxt);
  ------------------
  |  | 1483|  10.0k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  123|  10.0k|  return 0;
  124|  10.0k|}
Curl_hmacit:
  147|  10.0k|{
  148|  10.0k|  struct HMAC_context *ctxt;
  149|  10.0k|  if(keylen > UINT_MAX) /* unlikely to ever happen */
  ------------------
  |  Branch (149:6): [True: 0, False: 10.0k]
  ------------------
  150|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  151|  10.0k|  ctxt = Curl_HMAC_init(hashparams, key, curlx_uztoui(keylen));
  152|       |
  153|  10.0k|  if(!ctxt)
  ------------------
  |  Branch (153:6): [True: 0, False: 10.0k]
  ------------------
  154|      0|    return CURLE_OUT_OF_MEMORY;
  155|       |
  156|       |  /* Update the digest with the given challenge */
  157|  10.0k|  do {
  158|  10.0k|    unsigned int ilen = (unsigned int)CURLMIN(datalen, UINT_MAX);
  ------------------
  |  | 1287|  10.0k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 10.0k, False: 0]
  |  |  ------------------
  ------------------
  159|  10.0k|    Curl_HMAC_update(ctxt, data, ilen);
  160|  10.0k|    datalen -= ilen;
  161|  10.0k|    data += ilen;
  162|  10.0k|  } while(datalen);
  ------------------
  |  Branch (162:11): [True: 0, False: 10.0k]
  ------------------
  163|       |
  164|       |  /* Finalise the digest */
  165|  10.0k|  Curl_HMAC_final(ctxt, output);
  166|       |
  167|  10.0k|  return CURLE_OK;
  168|  10.0k|}

Curl_resolv_dns_queries:
  126|  14.8k|{
  127|  14.8k|  (void)data;
  128|  14.8k|  switch(ip_version) {
  129|      6|  case CURL_IPRESOLVE_V6:
  ------------------
  |  | 2306|      6|#define CURL_IPRESOLVE_V6       2L /* uses only IPv6 addresses/connections */
  ------------------
  |  Branch (129:3): [True: 6, False: 14.7k]
  ------------------
  130|      6|    return CURL_DNSQ_AAAA;
  ------------------
  |  |   52|      6|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  131|     61|  case CURL_IPRESOLVE_V4:
  ------------------
  |  | 2305|     61|#define CURL_IPRESOLVE_V4       1L /* uses only IPv4 addresses/connections */
  ------------------
  |  Branch (131:3): [True: 61, False: 14.7k]
  ------------------
  132|     61|    return CURL_DNSQ_A;
  ------------------
  |  |   51|     61|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  133|  14.7k|  default:
  ------------------
  |  Branch (133:3): [True: 14.7k, False: 67]
  ------------------
  134|  14.7k|    if(ipv6works(data))
  ------------------
  |  Branch (134:8): [True: 14.7k, False: 0]
  ------------------
  135|  14.7k|      return (CURL_DNSQ_A | CURL_DNSQ_AAAA);
  ------------------
  |  |   51|  14.7k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                    return (CURL_DNSQ_A | CURL_DNSQ_AAAA);
  ------------------
  |  |   52|  14.7k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  136|      0|    else
  137|      0|      return CURL_DNSQ_A;
  ------------------
  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  138|  14.8k|  }
  139|  14.8k|}
Curl_resolv_query_str:
  143|    617|{
  144|    617|  switch(dns_queries) {
  145|      0|  case (CURL_DNSQ_A | CURL_DNSQ_AAAA | CURL_DNSQ_HTTPS):
  ------------------
  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                case (CURL_DNSQ_A | CURL_DNSQ_AAAA | CURL_DNSQ_HTTPS):
  ------------------
  |  |   52|      0|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
                case (CURL_DNSQ_A | CURL_DNSQ_AAAA | CURL_DNSQ_HTTPS):
  ------------------
  |  |   53|      0|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  |  Branch (145:3): [True: 0, False: 617]
  ------------------
  146|      0|    return "A+AAAA+HTTPS";
  147|      0|  case (CURL_DNSQ_A | CURL_DNSQ_AAAA):
  ------------------
  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                case (CURL_DNSQ_A | CURL_DNSQ_AAAA):
  ------------------
  |  |   52|      0|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (147:3): [True: 0, False: 617]
  ------------------
  148|      0|    return "A+AAAA";
  149|      0|  case (CURL_DNSQ_AAAA | CURL_DNSQ_HTTPS):
  ------------------
  |  |   52|      0|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
                case (CURL_DNSQ_AAAA | CURL_DNSQ_HTTPS):
  ------------------
  |  |   53|      0|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  |  Branch (149:3): [True: 0, False: 617]
  ------------------
  150|      0|    return "AAAA+HTTPS";
  151|    267|  case (CURL_DNSQ_AAAA):
  ------------------
  |  |   52|    267|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (151:3): [True: 267, False: 350]
  ------------------
  152|    267|    return "AAAA";
  153|      0|  case (CURL_DNSQ_A | CURL_DNSQ_HTTPS):
  ------------------
  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                case (CURL_DNSQ_A | CURL_DNSQ_HTTPS):
  ------------------
  |  |   53|      0|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  |  Branch (153:3): [True: 0, False: 617]
  ------------------
  154|      0|    return "A+HTTPS";
  155|    350|  case (CURL_DNSQ_A):
  ------------------
  |  |   51|    350|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  |  Branch (155:3): [True: 350, False: 267]
  ------------------
  156|    350|    return "A";
  157|      0|  case (CURL_DNSQ_HTTPS):
  ------------------
  |  |   53|      0|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  |  Branch (157:3): [True: 0, False: 617]
  ------------------
  158|      0|    return "HTTPS";
  159|      0|  case 0:
  ------------------
  |  Branch (159:3): [True: 0, False: 617]
  ------------------
  160|      0|    return "-";
  161|      0|  default:
  ------------------
  |  Branch (161:3): [True: 0, False: 617]
  ------------------
  162|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (162:5): [Folded, False: 0]
  |  Branch (162:5): [Folded, False: 0]
  ------------------
  163|      0|    return "???";
  164|    617|  }
  165|    617|}
Curl_printable_address:
  177|     49|{
  178|     49|  DEBUGASSERT(bufsize);
  ------------------
  |  | 1081|     49|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (178:3): [True: 0, False: 49]
  |  Branch (178:3): [True: 49, False: 0]
  ------------------
  179|     49|  buf[0] = 0;
  180|       |
  181|     49|  switch(ai->ai_family) {
  182|     48|  case AF_INET: {
  ------------------
  |  Branch (182:3): [True: 48, False: 1]
  ------------------
  183|     48|    const struct sockaddr_in *sa4 = (const void *)ai->ai_addr;
  184|     48|    const struct in_addr *ipaddr4 = &sa4->sin_addr;
  185|     48|    (void)curlx_inet_ntop(ai->ai_family, (const void *)ipaddr4, buf, bufsize);
  ------------------
  |  |   44|     48|  inet_ntop(af, src, buf, (curl_socklen_t)(size))
  ------------------
  186|     48|    break;
  187|      0|  }
  188|      0|#ifdef USE_IPV6
  189|      1|  case AF_INET6: {
  ------------------
  |  Branch (189:3): [True: 1, False: 48]
  ------------------
  190|      1|    const struct sockaddr_in6 *sa6 = (const void *)ai->ai_addr;
  191|      1|    const struct in6_addr *ipaddr6 = &sa6->sin6_addr;
  192|      1|    (void)curlx_inet_ntop(ai->ai_family, (const void *)ipaddr6, buf, bufsize);
  ------------------
  |  |   44|      1|  inet_ntop(af, src, buf, (curl_socklen_t)(size))
  ------------------
  193|      1|    break;
  194|      0|  }
  195|      0|#endif
  196|      0|  default:
  ------------------
  |  Branch (196:3): [True: 0, False: 49]
  ------------------
  197|      0|    break;
  198|     49|  }
  199|     49|}
Curl_probeipv6:
  290|  17.2k|{
  291|       |  /* probe to see if we have a working IPv6 stack */
  292|  17.2k|  curl_socket_t s = CURL_SOCKET(PF_INET6, SOCK_DGRAM, 0);
  ------------------
  |  | 1436|  17.2k|  curl_dbg_socket((int)(domain), type, protocol, __LINE__, __FILE__)
  ------------------
  293|  17.2k|  multi->ipv6_works = FALSE;
  ------------------
  |  | 1058|  17.2k|#define FALSE false
  ------------------
  294|  17.2k|  if(s == CURL_SOCKET_BAD) {
  ------------------
  |  |  145|  17.2k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (294:6): [True: 0, False: 17.2k]
  ------------------
  295|      0|    if(SOCKERRNO == SOCKENOMEM)
  ------------------
  |  | 1095|      0|#define SOCKERRNO         errno
  ------------------
                  if(SOCKERRNO == SOCKENOMEM)
  ------------------
  |  | 1133|      0|#define SOCKENOMEM        ENOMEM
  ------------------
  |  Branch (295:8): [True: 0, False: 0]
  ------------------
  296|      0|      return CURLE_OUT_OF_MEMORY;
  297|      0|  }
  298|  17.2k|  else {
  299|  17.2k|    multi->ipv6_works = TRUE;
  ------------------
  |  | 1055|  17.2k|#define TRUE true
  ------------------
  300|  17.2k|    sclose(s);
  ------------------
  |  | 1428|  17.2k|#define sclose(sockfd) curl_dbg_sclose(sockfd, __LINE__, __FILE__)
  ------------------
  301|  17.2k|  }
  302|  17.2k|  return CURLE_OK;
  303|  17.2k|}
Curl_host_is_ipnum:
  321|  26.6k|{
  322|  26.6k|  struct in_addr in;
  323|  26.6k|#ifdef USE_IPV6
  324|  26.6k|  struct in6_addr in6;
  325|  26.6k|#endif
  326|  26.6k|  if(curlx_inet_pton(AF_INET, hostname, &in) > 0
  ------------------
  |  |   43|  26.6k|  inet_pton(x, y, z)
  ------------------
  |  Branch (326:6): [True: 10.3k, False: 16.3k]
  ------------------
  327|  16.3k|#ifdef USE_IPV6
  328|  16.3k|     || curlx_inet_pton(AF_INET6, hostname, &in6) > 0
  ------------------
  |  |   43|  16.3k|  inet_pton(x, y, z)
  ------------------
  |  Branch (328:9): [True: 117, False: 16.2k]
  ------------------
  329|  26.6k|#endif
  330|  26.6k|    )
  331|  10.4k|    return TRUE;
  ------------------
  |  | 1055|  10.4k|#define TRUE true
  ------------------
  332|  16.2k|  return FALSE;
  ------------------
  |  | 1058|  16.2k|#define FALSE false
  ------------------
  333|  26.6k|}
Curl_resolv_announce_start:
  364|  13.7k|{
  365|  13.7k|  if(data->set.resolver_start) {
  ------------------
  |  Branch (365:6): [True: 0, False: 13.7k]
  ------------------
  366|      0|    int rc;
  367|       |
  368|      0|    CURL_TRC_DNS(data, "announcing resolve to application");
  ------------------
  |  |  168|      0|  do {                                 \
  |  |  169|      0|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|      0|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  369|      0|    Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  370|      0|    rc = data->set.resolver_start(resolver, NULL,
  371|      0|                                  data->set.resolver_start_client);
  372|      0|    Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  373|      0|    if(rc) {
  ------------------
  |  Branch (373:8): [True: 0, False: 0]
  ------------------
  374|      0|      CURL_TRC_DNS(data, "application aborted resolve");
  ------------------
  |  |  168|      0|  do {                                 \
  |  |  169|      0|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|      0|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  375|      0|      return CURLE_ABORTED_BY_CALLBACK;
  376|      0|    }
  377|      0|  }
  378|  13.7k|  return CURLE_OK;
  379|  13.7k|}
Curl_resolv_elapsed_ms:
  469|   202k|{
  470|   202k|  struct Curl_resolv_async *async = Curl_async_get(data, resolv_id);
  471|   202k|  if(!async)
  ------------------
  |  Branch (471:6): [True: 0, False: 202k]
  ------------------
  472|      0|    return CURL_TIMEOUT_RESOLVE_MS;
  ------------------
  |  |   38|      0|#define CURL_TIMEOUT_RESOLVE_MS (300 * 1000)
  ------------------
  473|   202k|  return curlx_ptimediff_ms(Curl_pgrs_now(data), &async->start);
  474|   202k|}
Curl_resolv_has_answers:
  478|   302k|{
  479|   302k|  struct Curl_resolv_async *async = Curl_async_get(data, resolv_id);
  480|   302k|  uint8_t check_queries;
  481|       |  /* a no longer existing/running resolve has all answers. */
  482|   302k|  if(!async || async->done)
  ------------------
  |  Branch (482:6): [True: 0, False: 302k]
  |  Branch (482:16): [True: 0, False: 302k]
  ------------------
  483|      0|    return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  484|       |  /* Relevant are only queries undertaken. Others are considered answered. */
  485|   302k|  check_queries = (dns_queries & async->dns_queries);
  486|   302k|  if((check_queries & async->dns_responses) != check_queries) {
  ------------------
  |  Branch (486:6): [True: 202k, False: 100k]
  ------------------
  487|   202k|    return FALSE;
  ------------------
  |  | 1058|   202k|#define FALSE false
  ------------------
  488|   202k|  }
  489|   100k|  return TRUE;
  ------------------
  |  | 1055|   100k|#define TRUE true
  ------------------
  490|   302k|}
Curl_resolv_get_ai:
  496|   349k|{
  497|   349k|  struct Curl_resolv_async *async = Curl_async_get(data, resolv_id);
  498|   349k|  (void)index;
  499|   349k|  if(!async)
  ------------------
  |  Branch (499:6): [True: 0, False: 349k]
  ------------------
  500|      0|    return NULL;
  501|   349k|  if((ai_family == AF_INET) && !(async->dns_queries & CURL_DNSQ_A))
  ------------------
  |  |   51|  79.6k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  |  Branch (501:6): [True: 79.6k, False: 270k]
  |  Branch (501:32): [True: 0, False: 79.6k]
  ------------------
  502|      0|    return NULL;
  503|   349k|#ifdef USE_IPV6
  504|   349k|  if((ai_family == AF_INET6) && !(async->dns_queries & CURL_DNSQ_AAAA))
  ------------------
  |  |   52|  79.6k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (504:6): [True: 79.6k, False: 270k]
  |  Branch (504:33): [True: 12, False: 79.6k]
  ------------------
  505|     12|    return NULL;
  506|   349k|#endif
  507|   349k|  return Curl_async_get_ai(data, async, ai_family, index);
  508|   349k|}
Curl_resolv_blocking:
  755|     82|{
  756|     82|  CURLcode result;
  757|     82|  uint32_t resolv_id;
  758|     82|  DEBUGASSERT(hostname && *hostname);
  ------------------
  |  | 1081|     82|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (758:3): [True: 0, False: 82]
  |  Branch (758:3): [True: 0, False: 0]
  |  Branch (758:3): [True: 82, False: 0]
  |  Branch (758:3): [True: 82, False: 0]
  ------------------
  759|     82|  *pdns = NULL;
  760|       |  /* We cannot do a blocking resolve using DoH currently */
  761|     82|  result = hostip_resolv(data, dns_queries,
  762|     82|                         hostname, port, transport, FALSE, 0, FALSE,
  ------------------
  |  | 1058|     82|#define FALSE false
  ------------------
                                       hostname, port, transport, FALSE, 0, FALSE,
  ------------------
  |  | 1058|     82|#define FALSE false
  ------------------
  763|     82|                         &resolv_id, pdns);
  764|     82|  switch(result) {
  765|      5|  case CURLE_OK:
  ------------------
  |  Branch (765:3): [True: 5, False: 77]
  ------------------
  766|      5|    DEBUGASSERT(*pdns);
  ------------------
  |  | 1081|      5|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (766:5): [True: 0, False: 5]
  |  Branch (766:5): [True: 5, False: 0]
  ------------------
  767|      5|    break;
  768|      5|#ifdef USE_CURL_ASYNC
  769|     77|  case CURLE_AGAIN:
  ------------------
  |  Branch (769:3): [True: 77, False: 5]
  ------------------
  770|     77|    DEBUGASSERT(!*pdns);
  ------------------
  |  | 1081|     77|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (770:5): [True: 0, False: 77]
  |  Branch (770:5): [True: 77, False: 0]
  ------------------
  771|     77|    result = Curl_async_await(data, resolv_id, pdns);
  772|     77|    Curl_resolv_destroy(data, resolv_id);
  773|     77|    break;
  774|      0|#endif
  775|      0|  default:
  ------------------
  |  Branch (775:3): [True: 0, False: 82]
  ------------------
  776|      0|    break;
  777|     82|  }
  778|     82|  return result;
  779|     82|}
Curl_resolv:
  984|  14.7k|{
  985|  14.7k|  *presolv_id = 0;
  986|  14.7k|  *pdns = NULL;
  987|       |
  988|  14.7k|  if(timeout_ms < 0)
  ------------------
  |  Branch (988:6): [True: 0, False: 14.7k]
  ------------------
  989|       |    /* got an already expired timeout */
  990|      0|    return CURLE_OPERATION_TIMEDOUT;
  991|  14.7k|  else if(!timeout_ms)
  ------------------
  |  Branch (991:11): [True: 3, False: 14.7k]
  ------------------
  992|      3|    timeout_ms = CURL_TIMEOUT_RESOLVE_MS;
  ------------------
  |  |   38|      3|#define CURL_TIMEOUT_RESOLVE_MS (300 * 1000)
  ------------------
  993|       |
  994|  14.7k|#ifdef USE_UNIX_SOCKETS
  995|  14.7k|  if(peer->unix_socket)
  ------------------
  |  Branch (995:6): [True: 112, False: 14.6k]
  ------------------
  996|    112|    return resolv_unix(data, peer->hostname, (bool)peer->abstract_uds, pdns);
  997|       |#else
  998|       |  if(peer->unix_socket)
  999|       |    return hostip_resolv_failed(data, peer->hostname, for_proxy);
 1000|       |#endif
 1001|       |
 1002|       |#ifdef USE_ALARM_TIMEOUT
 1003|       |  if(timeout_ms && data->set.no_signal) {
 1004|       |    /* Cannot use ALARM when signals are disabled */
 1005|       |    timeout_ms = 0;
 1006|       |  }
 1007|       |  if(timeout_ms && !Curl_doh_wanted(data)) {
 1008|       |    return resolv_alarm_timeout(data, dns_queries, peer->hostname, peer->port,
 1009|       |                                transport, for_proxy, timeout_ms, presolv_id,
 1010|       |                                pdns);
 1011|       |  }
 1012|       |#endif /* !USE_ALARM_TIMEOUT */
 1013|       |
 1014|       |#ifndef CURLRES_ASYNCH
 1015|       |  if(timeout_ms)
 1016|       |    infof(data, "timeout on name lookup is not supported");
 1017|       |#endif
 1018|       |
 1019|  14.6k|  return hostip_resolv(data, dns_queries, peer->hostname, peer->port,
 1020|       |                       transport, for_proxy, timeout_ms, TRUE, presolv_id,
  ------------------
  |  | 1055|  14.6k|#define TRUE true
  ------------------
 1021|  14.6k|                       pdns);
 1022|  14.7k|}
Curl_async_get:
 1028|  1.15M|{
 1029|  1.15M|  struct Curl_resolv_async *async = data->state.async;
 1030|  1.15M|  for(; async; async = async->next) {
  ------------------
  |  Branch (1030:9): [True: 1.15M, False: 0]
  ------------------
 1031|  1.15M|    if(async->id == resolv_id)
  ------------------
  |  Branch (1031:8): [True: 1.15M, False: 0]
  ------------------
 1032|  1.15M|      return async;
 1033|  1.15M|  }
 1034|      0|  return NULL;
 1035|  1.15M|}
Curl_resolv_take_result:
 1039|   302k|{
 1040|   302k|  struct Curl_resolv_async *async = Curl_async_get(data, resolv_id);
 1041|   302k|  CURLcode result;
 1042|       |
 1043|       |  /* If async resolving is ongoing, this must be set */
 1044|   302k|  if(!async)
  ------------------
  |  Branch (1044:6): [True: 0, False: 302k]
  ------------------
 1045|      0|    return CURLE_FAILED_INIT;
 1046|       |
 1047|       |  /* check if we have the name resolved by now (from someone else) */
 1048|   302k|  result = Curl_dnscache_get(data, async->dns_queries,
 1049|   302k|                             async->hostname, async->port, pdns);
 1050|   302k|  if(*pdns) {
  ------------------
  |  Branch (1050:6): [True: 0, False: 302k]
  ------------------
 1051|       |    /* Tell a possibly async resolver we no longer need the results. */
 1052|      0|    infof(data, "Hostname '%s' was found in DNS cache", async->hostname);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1053|      0|    Curl_async_shutdown(data, async);
 1054|      0|    return CURLE_OK;
 1055|      0|  }
 1056|   302k|  else if(result) {
  ------------------
  |  Branch (1056:11): [True: 0, False: 302k]
  ------------------
 1057|      0|    Curl_async_shutdown(data, async);
 1058|      0|    return Curl_async_failed(data, async, NULL);
 1059|      0|  }
 1060|       |
 1061|   302k|  result = hostip_resolv_take_result(data, async, pdns);
 1062|       |
 1063|   302k|  if(*pdns) {
  ------------------
  |  Branch (1063:6): [True: 10, False: 302k]
  ------------------
 1064|       |    /* Add to cache */
 1065|     10|    result = Curl_dnscache_add(data, *pdns);
 1066|     10|    if(result)
  ------------------
  |  Branch (1066:8): [True: 0, False: 10]
  ------------------
 1067|      0|      Curl_dns_entry_unlink(data, pdns);
 1068|     10|  }
 1069|   302k|  else if(IS_RESOLV_FAIL(result)) {
  ------------------
  |  |   77|   302k|  (((result) == CURLE_COULDNT_RESOLVE_HOST) || \
  |  |  ------------------
  |  |  |  Branch (77:4): [True: 163, False: 302k]
  |  |  ------------------
  |  |   78|   302k|   ((result) == CURLE_COULDNT_RESOLVE_PROXY))
  |  |  ------------------
  |  |  |  Branch (78:4): [True: 227, False: 302k]
  |  |  ------------------
  ------------------
 1070|    390|    Curl_dnscache_add_negative(data, async->dns_queries,
 1071|    390|                               async->hostname, async->port);
 1072|    390|    failf(data, "Could not resolve: %s:%u", async->hostname, async->port);
  ------------------
  |  |   62|    390|#define failf Curl_failf
  ------------------
 1073|    390|  }
 1074|   302k|  else if(result) {
  ------------------
  |  Branch (1074:11): [True: 0, False: 302k]
  ------------------
 1075|      0|    failf(data, "Error %d resolving %s:%u",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1076|      0|          result, async->hostname, async->port);
 1077|      0|  }
 1078|   302k|  return result;
 1079|   302k|}
Curl_resolv_pollset:
 1083|   149k|{
 1084|   149k|  struct Curl_resolv_async *async = data->state.async;
 1085|   149k|  CURLcode result = CURLE_OK;
 1086|       |
 1087|   149k|  (void)ps;
 1088|   299k|  for(; async && !result; async = async->next) {
  ------------------
  |  Branch (1088:9): [True: 149k, False: 149k]
  |  Branch (1088:18): [True: 149k, False: 0]
  ------------------
 1089|   149k|#ifndef CURL_DISABLE_DOH
 1090|   149k|    if(async->doh) /* DoH has nothing for the pollset */
  ------------------
  |  Branch (1090:8): [True: 616, False: 149k]
  ------------------
 1091|    616|      continue;
 1092|   149k|#endif
 1093|   149k|    result = Curl_async_pollset(data, async, ps);
 1094|   149k|  }
 1095|   149k|  return result;
 1096|   149k|}
Curl_resolv_destroy:
 1099|  9.91k|{
 1100|  9.91k|  struct Curl_resolv_async **panchor = &data->state.async;
 1101|       |
 1102|  9.91k|  for(; *panchor; panchor = &(*panchor)->next) {
  ------------------
  |  Branch (1102:9): [True: 79, False: 9.84k]
  ------------------
 1103|     79|    struct Curl_resolv_async *async = *panchor;
 1104|     79|    if(async->id == resolv_id) {
  ------------------
  |  Branch (1104:8): [True: 78, False: 1]
  ------------------
 1105|     78|      *panchor = async->next;
 1106|     78|      Curl_async_destroy(data, async);
 1107|     78|      break;
 1108|     78|    }
 1109|     79|  }
 1110|  9.91k|}
Curl_resolv_shutdown_all:
 1113|  13.8k|{
 1114|  13.8k|  struct Curl_resolv_async *async = data->state.async;
 1115|  14.4k|  for(; async; async = async->next) {
  ------------------
  |  Branch (1115:9): [True: 602, False: 13.8k]
  ------------------
 1116|    602|    Curl_async_shutdown(data, async);
 1117|    602|  }
 1118|  13.8k|}
Curl_resolv_destroy_all:
 1121|  52.2k|{
 1122|  52.8k|  while(data->state.async) {
  ------------------
  |  Branch (1122:9): [True: 602, False: 52.2k]
  ------------------
 1123|    602|    struct Curl_resolv_async *async = data->state.async;
 1124|    602|    data->state.async = async->next;
 1125|    602|    Curl_async_destroy(data, async);
 1126|    602|  }
 1127|  52.2k|}
hostip.c:ipv6works:
  309|  14.7k|{
  310|  14.7k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  14.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (310:3): [True: 0, False: 14.7k]
  |  Branch (310:3): [True: 14.7k, False: 0]
  ------------------
  311|  14.7k|  DEBUGASSERT(data->multi);
  ------------------
  |  | 1081|  14.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (311:3): [True: 0, False: 14.7k]
  |  Branch (311:3): [True: 14.7k, False: 0]
  ------------------
  312|  14.7k|  return data ? data->multi->ipv6_works : FALSE;
  ------------------
  |  | 1058|  14.7k|#define FALSE false
  ------------------
  |  Branch (312:10): [True: 14.7k, False: 0]
  ------------------
  313|  14.7k|}
hostip.c:hostip_resolv:
  677|  14.7k|{
  678|  14.7k|  size_t hostname_len;
  679|  14.7k|  CURLcode result = RESOLV_FAIL(for_proxy);
  ------------------
  |  |   74|  14.7k|  ((for_proxy) ? CURLE_COULDNT_RESOLVE_PROXY : CURLE_COULDNT_RESOLVE_HOST)
  |  |  ------------------
  |  |  |  Branch (74:4): [True: 9.05k, False: 5.70k]
  |  |  ------------------
  ------------------
  680|  14.7k|  bool cache_dns = FALSE;
  ------------------
  |  | 1058|  14.7k|#define FALSE false
  ------------------
  681|       |
  682|  14.7k|  (void)timeout_ms; /* not used in all ifdefs */
  683|  14.7k|  *presolv_id = 0;
  684|  14.7k|  *pdns = NULL;
  685|       |
  686|       |#ifdef CURL_DISABLE_DOH
  687|       |  (void)allowDOH;
  688|       |#endif
  689|       |
  690|       |  /* We should intentionally error and not resolve .onion TLDs */
  691|  14.7k|  hostname_len = strlen(hostname);
  692|  14.7k|  DEBUGASSERT(hostname_len);
  ------------------
  |  | 1081|  14.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (692:3): [True: 0, False: 14.7k]
  |  Branch (692:3): [True: 14.7k, False: 0]
  ------------------
  693|  14.7k|  if(hostname_len >= 7 &&
  ------------------
  |  Branch (693:6): [True: 14.0k, False: 732]
  ------------------
  694|  14.0k|     (curl_strequal(&hostname[hostname_len - 6], ".onion") ||
  ------------------
  |  Branch (694:7): [True: 0, False: 14.0k]
  ------------------
  695|  14.0k|      curl_strequal(&hostname[hostname_len - 7], ".onion."))) {
  ------------------
  |  Branch (695:7): [True: 0, False: 14.0k]
  ------------------
  696|      0|    failf(data, "Not resolving .onion address (RFC 7686)");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  697|      0|    goto out;
  698|      0|  }
  699|       |
  700|  14.7k|#ifdef DEBUGBUILD
  701|  14.7k|  CURL_TRC_DNS(data, "hostip_resolv(%s:%u, queries=%s)",
  ------------------
  |  |  168|  14.7k|  do {                                 \
  |  |  169|  14.7k|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|  14.7k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  14.7k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  29.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 14.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 14.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  29.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  14.7k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  14.7k|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|  14.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 14.7k]
  |  |  ------------------
  ------------------
  702|  14.7k|               hostname, port, Curl_resolv_query_str(dns_queries));
  703|  14.7k|  if((CURL_DNSQ_IP(dns_queries) == CURL_DNSQ_AAAA) &&
  ------------------
  |  |   56|  14.7k|#define CURL_DNSQ_IP(x)       (uint8_t)((x)&(CURL_DNSQ_A | CURL_DNSQ_AAAA))
  |  |  ------------------
  |  |  |  |   51|  14.7k|#define CURL_DNSQ_A           (1U << 0)
  |  |  ------------------
  |  |               #define CURL_DNSQ_IP(x)       (uint8_t)((x)&(CURL_DNSQ_A | CURL_DNSQ_AAAA))
  |  |  ------------------
  |  |  |  |   52|  14.7k|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  ------------------
  ------------------
                if((CURL_DNSQ_IP(dns_queries) == CURL_DNSQ_AAAA) &&
  ------------------
  |  |   52|  14.7k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (703:6): [True: 6, False: 14.7k]
  ------------------
  704|      6|     getenv("CURL_DBG_RESOLV_FAIL_IPV6")) {
  ------------------
  |  Branch (704:6): [True: 0, False: 6]
  ------------------
  705|      0|    infof(data, "DEBUG fail ipv6 resolve");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  706|      0|    result = hostip_resolv_failed(data, hostname, for_proxy);
  707|      0|    goto out;
  708|      0|  }
  709|  14.7k|#endif
  710|       |  /* Let's check our DNS cache first */
  711|  14.7k|  result = Curl_dnscache_get(data, dns_queries, hostname, port, pdns);
  712|  14.7k|  if(*pdns) {
  ------------------
  |  Branch (712:6): [True: 880, False: 13.8k]
  ------------------
  713|    880|    infof(data, "Hostname %s was found in DNS cache", hostname);
  ------------------
  |  |  143|    880|  do {                               \
  |  |  144|    880|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    880|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 880, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 880]
  |  |  |  |  ------------------
  |  |  |  |  320|    880|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    880|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    880|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 880]
  |  |  ------------------
  ------------------
  714|    880|    result = CURLE_OK;
  715|    880|  }
  716|  13.8k|  else if(result) {
  ------------------
  |  Branch (716:11): [True: 97, False: 13.7k]
  ------------------
  717|     97|    infof(data, "Negative DNS entry");
  ------------------
  |  |  143|     97|  do {                               \
  |  |  144|     97|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     97|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 97, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 97]
  |  |  |  |  ------------------
  |  |  |  |  320|     97|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     97|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     97|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 97]
  |  |  ------------------
  ------------------
  718|     97|    result = hostip_resolv_failed(data, hostname, for_proxy);
  719|     97|  }
  720|  13.7k|  else {
  721|       |    /* No luck, we need to start resolving. */
  722|  13.7k|    cache_dns = TRUE;
  ------------------
  |  | 1055|  13.7k|#define TRUE true
  ------------------
  723|  13.7k|    result = hostip_resolv_start(data, dns_queries, hostname, port,
  724|  13.7k|                                 transport, for_proxy, timeout_ms, allowDOH,
  725|  13.7k|                                 presolv_id, pdns);
  726|  13.7k|  }
  727|       |
  728|  14.7k|out:
  729|  14.7k|  if(result && (result != CURLE_AGAIN)) {
  ------------------
  |  Branch (729:6): [True: 785, False: 13.9k]
  |  Branch (729:16): [True: 105, False: 680]
  ------------------
  730|    105|    Curl_dns_entry_unlink(data, pdns);
  731|    105|    if(IS_RESOLV_FAIL(result)) {
  ------------------
  |  |   77|    105|  (((result) == CURLE_COULDNT_RESOLVE_HOST) || \
  |  |  ------------------
  |  |  |  Branch (77:4): [True: 97, False: 8]
  |  |  ------------------
  |  |   78|    105|   ((result) == CURLE_COULDNT_RESOLVE_PROXY))
  |  |  ------------------
  |  |  |  Branch (78:4): [True: 0, False: 8]
  |  |  ------------------
  ------------------
  732|     97|      if(cache_dns)
  ------------------
  |  Branch (732:10): [True: 0, False: 97]
  ------------------
  733|      0|        Curl_dnscache_add_negative(data, dns_queries, hostname, port);
  734|     97|      failf(data, "Could not resolve: %s:%u", hostname, port);
  ------------------
  |  |   62|     97|#define failf Curl_failf
  ------------------
  735|     97|    }
  736|      8|    else {
  737|      8|      failf(data, "Error %d resolving %s:%u", result, hostname, port);
  ------------------
  |  |   62|      8|#define failf Curl_failf
  ------------------
  738|      8|    }
  739|    105|  }
  740|  14.6k|  else if(cache_dns && *pdns) {
  ------------------
  |  Branch (740:11): [True: 13.7k, False: 880]
  |  Branch (740:24): [True: 13.0k, False: 680]
  ------------------
  741|  13.0k|    result = Curl_dnscache_add(data, *pdns);
  742|  13.0k|    if(result)
  ------------------
  |  Branch (742:8): [True: 0, False: 13.0k]
  ------------------
  743|      0|      Curl_dns_entry_unlink(data, pdns);
  744|  13.0k|  }
  745|       |
  746|  14.7k|  return result;
  747|  14.7k|}
hostip.c:hostip_resolv_failed:
  347|     97|{
  348|     97|  failf(data, "Could not resolve %s: %s",
  ------------------
  |  |   62|     97|#define failf Curl_failf
  ------------------
  349|     97|        for_proxy ? "proxy" : "host", hostname);
  ------------------
  |  Branch (349:9): [True: 0, False: 97]
  ------------------
  350|     97|  return RESOLV_FAIL(for_proxy);
  ------------------
  |  |   74|     97|  ((for_proxy) ? CURLE_COULDNT_RESOLVE_PROXY : CURLE_COULDNT_RESOLVE_HOST)
  |  |  ------------------
  |  |  |  Branch (74:4): [True: 0, False: 97]
  |  |  ------------------
  ------------------
  351|     97|}
hostip.c:hostip_resolv_start:
  541|  13.7k|{
  542|  13.7k|#ifdef USE_CURL_ASYNC
  543|  13.7k|  struct Curl_resolv_async *async = NULL;
  544|  13.7k|#endif
  545|  13.7k|  struct Curl_addrinfo *addr = NULL;
  546|  13.7k|  size_t hostname_len;
  547|  13.7k|  CURLcode result = CURLE_OK;
  548|       |
  549|  13.7k|  (void)timeout_ms; /* not in all ifdefs */
  550|  13.7k|  *presolv_id = 0;
  551|  13.7k|  *pdns = NULL;
  552|       |
  553|       |  /* Check for "known" things to resolve ourselves. */
  554|  13.7k|#ifndef USE_RESOLVE_ON_IPS
  555|  13.7k|  if(Curl_is_ipaddr(hostname)) {
  ------------------
  |  Branch (555:6): [True: 13.0k, False: 700]
  ------------------
  556|       |    /* test655 verifies that the announce is done, even though there
  557|       |     * is no real resolving. So, keep doing this. */
  558|  13.0k|    result = Curl_resolv_announce_start(data, NULL);
  559|  13.0k|    if(result)
  ------------------
  |  Branch (559:8): [True: 0, False: 13.0k]
  ------------------
  560|      0|      goto out;
  561|       |    /* shortcut literal IP addresses, if we are not told to resolve them. */
  562|  13.0k|    result = Curl_str2addr(hostname, port, &addr);
  563|  13.0k|    goto out;
  564|  13.0k|  }
  565|    700|#endif
  566|       |
  567|    700|  hostname_len = strlen(hostname);
  568|    700|  if(curl_strequal(hostname, "localhost") ||
  ------------------
  |  Branch (568:6): [True: 9, False: 691]
  ------------------
  569|    691|     curl_strequal(hostname, "localhost.") ||
  ------------------
  |  Branch (569:6): [True: 1, False: 690]
  ------------------
  570|    690|     tailmatch(hostname, hostname_len, STRCONST(".localhost")) ||
  ------------------
  |  | 1292|    690|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (570:6): [True: 1, False: 689]
  ------------------
  571|    689|     tailmatch(hostname, hostname_len, STRCONST(".localhost."))) {
  ------------------
  |  | 1292|    689|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (571:6): [True: 1, False: 688]
  ------------------
  572|     12|    result = Curl_resolv_announce_start(data, NULL);
  573|     12|    if(result)
  ------------------
  |  Branch (573:8): [True: 0, False: 12]
  ------------------
  574|      0|      goto out;
  575|     12|    addr = get_localhost(port, hostname);
  576|     12|    if(!addr)
  ------------------
  |  Branch (576:8): [True: 0, False: 12]
  ------------------
  577|      0|      result = CURLE_OUT_OF_MEMORY;
  578|     12|    goto out;
  579|     12|  }
  580|       |
  581|    688|#ifndef CURL_DISABLE_DOH
  582|    688|  if(!Curl_is_ipaddr(hostname) && allowDOH && data->set.doh) {
  ------------------
  |  Branch (582:6): [True: 688, False: 0]
  |  Branch (582:35): [True: 611, False: 77]
  |  Branch (582:47): [True: 336, False: 275]
  ------------------
  583|    336|    result = Curl_resolv_announce_start(data, NULL);
  584|    336|    if(result)
  ------------------
  |  Branch (584:8): [True: 0, False: 336]
  ------------------
  585|      0|      goto out;
  586|    336|    if(!async) {
  ------------------
  |  Branch (586:8): [True: 336, False: 0]
  ------------------
  587|    336|      async = hostip_async_new(data, dns_queries, hostname, port,
  588|    336|                               transport, for_proxy, timeout_ms);
  589|    336|      if(!async) {
  ------------------
  |  Branch (589:10): [True: 0, False: 336]
  ------------------
  590|      0|        result = CURLE_OUT_OF_MEMORY;
  591|      0|        goto out;
  592|      0|      }
  593|    336|    }
  594|    336|    result = Curl_doh(data, async);
  595|    336|    goto out;
  596|    336|  }
  597|       |#else
  598|       |  (void)allowDOH;
  599|       |#endif
  600|       |
  601|       |  /* Can we provide the requested IP specifics in resolving? */
  602|    352|  if(!can_resolve_dns_queries(data, dns_queries)) {
  ------------------
  |  Branch (602:6): [True: 0, False: 352]
  ------------------
  603|      0|    result = RESOLV_FAIL(for_proxy);
  ------------------
  |  |   74|      0|  ((for_proxy) ? CURLE_COULDNT_RESOLVE_PROXY : CURLE_COULDNT_RESOLVE_HOST)
  |  |  ------------------
  |  |  |  Branch (74:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  604|      0|    goto out;
  605|      0|  }
  606|       |
  607|    352|#ifdef CURLRES_ASYNCH
  608|    352|  (void)addr;
  609|    352|  if(!async) {
  ------------------
  |  Branch (609:6): [True: 352, False: 0]
  ------------------
  610|    352|    async = hostip_async_new(data, dns_queries, hostname, port,
  611|    352|                             transport, for_proxy, timeout_ms);
  612|    352|    if(!async) {
  ------------------
  |  Branch (612:8): [True: 0, False: 352]
  ------------------
  613|      0|      result = CURLE_OUT_OF_MEMORY;
  614|      0|      goto out;
  615|      0|    }
  616|    352|  }
  617|    352|  result = Curl_async_getaddrinfo(data, async);
  618|    352|  if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (618:6): [True: 0, False: 352]
  ------------------
  619|       |    /* the answer might be there already. Check. */
  620|      0|    CURLcode r2 = hostip_resolv_take_result(data, async, pdns);
  621|      0|    if(r2)
  ------------------
  |  Branch (621:8): [True: 0, False: 0]
  ------------------
  622|      0|      result = r2;
  623|      0|    else if(*pdns)
  ------------------
  |  Branch (623:13): [True: 0, False: 0]
  ------------------
  624|      0|      result = CURLE_OK;
  625|      0|  }
  626|       |#else
  627|       |  result = Curl_resolv_announce_start(data, NULL);
  628|       |  if(result)
  629|       |    goto out;
  630|       |  addr = Curl_sync_getaddrinfo(data, dns_queries, hostname, port, transport);
  631|       |  if(!addr)
  632|       |    result = RESOLV_FAIL(for_proxy);
  633|       |#endif
  634|       |
  635|  13.7k|out:
  636|  13.7k|  if(!result) {
  ------------------
  |  Branch (636:6): [True: 13.7k, False: 8]
  ------------------
  637|  13.7k|    if(addr) {
  ------------------
  |  Branch (637:8): [True: 13.0k, False: 680]
  ------------------
  638|       |      /* we got a response, create a dns entry, add to cache, return */
  639|  13.0k|      DEBUGASSERT(!*pdns);
  ------------------
  |  | 1081|  13.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (639:7): [True: 0, False: 13.0k]
  |  Branch (639:7): [True: 13.0k, False: 0]
  ------------------
  640|  13.0k|      *pdns = Curl_dnscache_mk_entry(data, dns_queries, &addr, hostname, port);
  641|  13.0k|      if(!*pdns)
  ------------------
  |  Branch (641:10): [True: 0, False: 13.0k]
  ------------------
  642|      0|        result = CURLE_OUT_OF_MEMORY;
  643|  13.0k|    }
  644|    680|    else if(!*pdns)
  ------------------
  |  Branch (644:13): [True: 680, False: 0]
  ------------------
  645|    680|      result = CURLE_AGAIN;
  646|  13.7k|  }
  647|      8|  else if(*pdns)
  ------------------
  |  Branch (647:11): [True: 0, False: 8]
  ------------------
  648|      0|    Curl_dns_entry_unlink(data, pdns);
  649|      8|  else if(addr)
  ------------------
  |  Branch (649:11): [True: 0, False: 8]
  ------------------
  650|      0|    Curl_freeaddrinfo(addr);
  651|       |
  652|  13.7k|#ifdef USE_CURL_ASYNC
  653|  13.7k|  if(async) {
  ------------------
  |  Branch (653:6): [True: 688, False: 13.0k]
  ------------------
  654|    688|    if(result == CURLE_AGAIN) { /* still need it, link, return id. */
  ------------------
  |  Branch (654:8): [True: 680, False: 8]
  ------------------
  655|    680|      *presolv_id = async->id;
  656|    680|      async->next = data->state.async;
  657|    680|      data->state.async = async;
  658|    680|    }
  659|      8|    else {
  660|      8|      Curl_async_destroy(data, async);
  661|      8|    }
  662|    688|  }
  663|  13.7k|#endif
  664|  13.7k|  return result;
  665|  13.7k|}
hostip.c:tailmatch:
  338|  1.37k|{
  339|  1.37k|  if(plen > flen)
  ------------------
  |  Branch (339:6): [True: 1.17k, False: 206]
  ------------------
  340|  1.17k|    return FALSE;
  ------------------
  |  | 1058|  1.17k|#define FALSE false
  ------------------
  341|    206|  return curl_strnequal(part, &full[flen - plen], plen);
  342|  1.37k|}
hostip.c:get_localhost:
  248|     12|{
  249|     12|  struct Curl_addrinfo *ca;
  250|     12|  struct Curl_addrinfo *ca6;
  251|     12|  const size_t ss_size = sizeof(struct sockaddr_in);
  252|     12|  const size_t hostlen = strlen(name);
  253|     12|  struct sockaddr_in sa;
  254|     12|  unsigned int ipv4;
  255|     12|  unsigned short port16 = (unsigned short)(port & 0xffff);
  256|       |
  257|       |  /* memset to clear the sa.sin_zero field */
  258|     12|  memset(&sa, 0, sizeof(sa));
  259|     12|  sa.sin_family = AF_INET;
  260|     12|  sa.sin_port = htons(port16);
  261|     12|  if(curlx_inet_pton(AF_INET, "127.0.0.1", (char *)&ipv4) < 1)
  ------------------
  |  |   43|     12|  inet_pton(x, y, z)
  ------------------
  |  Branch (261:6): [True: 0, False: 12]
  ------------------
  262|      0|    return NULL;
  263|     12|  memcpy(&sa.sin_addr, &ipv4, sizeof(ipv4));
  264|       |
  265|     12|  ca = curlx_calloc(1, sizeof(struct Curl_addrinfo) + ss_size + hostlen + 1);
  ------------------
  |  | 1480|     12|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  266|     12|  if(!ca)
  ------------------
  |  Branch (266:6): [True: 0, False: 12]
  ------------------
  267|      0|    return NULL;
  268|     12|  ca->ai_flags     = 0;
  269|     12|  ca->ai_family    = AF_INET;
  270|     12|  ca->ai_socktype  = SOCK_STREAM;
  271|     12|  ca->ai_protocol  = IPPROTO_TCP;
  272|     12|  ca->ai_addrlen   = (curl_socklen_t)ss_size;
  273|     12|  ca->ai_addr = (void *)((char *)ca + sizeof(struct Curl_addrinfo));
  274|     12|  memcpy(ca->ai_addr, &sa, ss_size);
  275|     12|  ca->ai_canonname = (char *)ca->ai_addr + ss_size;
  276|     12|  curlx_strcopy(ca->ai_canonname, hostlen + 1, name, hostlen);
  277|       |
  278|     12|  ca6 = get_localhost6(port, name);
  279|     12|  if(!ca6)
  ------------------
  |  Branch (279:6): [True: 0, False: 12]
  ------------------
  280|      0|    return ca;
  281|     12|  ca6->ai_next = ca;
  282|     12|  return ca6;
  283|     12|}
hostip.c:get_localhost6:
  212|     12|{
  213|     12|  struct Curl_addrinfo *ca;
  214|     12|  const size_t ss_size = sizeof(struct sockaddr_in6);
  215|     12|  const size_t hostlen = strlen(name);
  216|     12|  struct sockaddr_in6 sa6;
  217|     12|  unsigned char ipv6[16];
  218|     12|  unsigned short port16 = (unsigned short)(port & 0xffff);
  219|     12|  ca = curlx_calloc(1, sizeof(struct Curl_addrinfo) + ss_size + hostlen + 1);
  ------------------
  |  | 1480|     12|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  220|     12|  if(!ca)
  ------------------
  |  Branch (220:6): [True: 0, False: 12]
  ------------------
  221|      0|    return NULL;
  222|       |
  223|     12|  memset(&sa6, 0, sizeof(sa6));
  224|     12|  sa6.sin6_family = AF_INET6;
  225|     12|  sa6.sin6_port = htons(port16);
  226|       |
  227|     12|  (void)curlx_inet_pton(AF_INET6, "::1", ipv6);
  ------------------
  |  |   43|     12|  inet_pton(x, y, z)
  ------------------
  228|     12|  memcpy(&sa6.sin6_addr, ipv6, sizeof(ipv6));
  229|       |
  230|     12|  ca->ai_flags     = 0;
  231|     12|  ca->ai_family    = AF_INET6;
  232|     12|  ca->ai_socktype  = SOCK_STREAM;
  233|     12|  ca->ai_protocol  = IPPROTO_TCP;
  234|     12|  ca->ai_addrlen   = (curl_socklen_t)ss_size;
  235|       |  ca->ai_next      = NULL;
  236|     12|  ca->ai_addr = (void *)((char *)ca + sizeof(struct Curl_addrinfo));
  237|     12|  memcpy(ca->ai_addr, &sa6, ss_size);
  238|     12|  ca->ai_canonname = (char *)ca->ai_addr + ss_size;
  239|     12|  curlx_strcopy(ca->ai_canonname, hostlen + 1, name, hostlen);
  240|     12|  return ca;
  241|     12|}
hostip.c:hostip_async_new:
  390|    688|{
  391|    688|  struct Curl_resolv_async *async;
  392|    688|  size_t hostlen = strlen(hostname);
  393|       |
  394|    688|  if(!data->multi) {
  ------------------
  |  Branch (394:6): [True: 0, False: 688]
  ------------------
  395|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (395:5): [Folded, False: 0]
  |  Branch (395:5): [Folded, False: 0]
  ------------------
  396|      0|    return NULL;
  397|      0|  }
  398|       |
  399|       |  /* struct size already includes the NUL for hostname */
  400|    688|  async = curlx_calloc(1, sizeof(*async) + hostlen);
  ------------------
  |  | 1480|    688|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  401|    688|  if(!async)
  ------------------
  |  Branch (401:6): [True: 0, False: 688]
  ------------------
  402|      0|    return NULL;
  403|       |
  404|       |  /* Give every async resolve operation a "unique" id. This may
  405|       |   * wrap around after a long time, making collisions highly unlikely.
  406|       |   * As we keep the async structs at the easy handle, chances of
  407|       |   * easy `mid plus resolv->id` colliding should be astronomical.
  408|       |   * `resolv_id == 0` is never used. */
  409|    688|  if(data->multi->last_resolv_id == UINT32_MAX)
  ------------------
  |  Branch (409:6): [True: 0, False: 688]
  ------------------
  410|      0|    data->multi->last_resolv_id = 1; /* wrap around */
  411|    688|  else
  412|    688|    data->multi->last_resolv_id++;
  413|    688|  async->id = data->multi->last_resolv_id;
  414|    688|  async->dns_queries = dns_queries;
  415|    688|  async->port = port;
  416|    688|  async->transport = transport;
  417|    688|  async->for_proxy = for_proxy;
  418|    688|  async->start = *Curl_pgrs_now(data);
  419|    688|  async->timeout_ms = timeout_ms;
  420|    688|  if(hostlen) {
  ------------------
  |  Branch (420:6): [True: 688, False: 0]
  ------------------
  421|    688|    memcpy(async->hostname, hostname, hostlen);
  422|    688|    async->is_ipaddr = Curl_is_ipaddr(async->hostname);
  423|    688|    if(async->is_ipaddr)
  ------------------
  |  Branch (423:8): [True: 0, False: 688]
  ------------------
  424|      0|      async->is_ipv4addr = Curl_is_ipv4addr(async->hostname);
  425|    688|  }
  426|       |
  427|    688|  return async;
  428|    688|}
hostip.c:can_resolve_dns_queries:
  355|    352|{
  356|    352|  (void)data;
  357|    352|  if((CURL_DNSQ_IP(dns_queries) == CURL_DNSQ_AAAA) && !ipv6works(data))
  ------------------
  |  |   56|    352|#define CURL_DNSQ_IP(x)       (uint8_t)((x)&(CURL_DNSQ_A | CURL_DNSQ_AAAA))
  |  |  ------------------
  |  |  |  |   51|    352|#define CURL_DNSQ_A           (1U << 0)
  |  |  ------------------
  |  |               #define CURL_DNSQ_IP(x)       (uint8_t)((x)&(CURL_DNSQ_A | CURL_DNSQ_AAAA))
  |  |  ------------------
  |  |  |  |   52|    352|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  ------------------
  ------------------
                if((CURL_DNSQ_IP(dns_queries) == CURL_DNSQ_AAAA) && !ipv6works(data))
  ------------------
  |  |   52|    352|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (357:6): [True: 2, False: 350]
  |  Branch (357:55): [True: 0, False: 2]
  ------------------
  358|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  359|    352|  return TRUE;
  ------------------
  |  | 1055|    352|#define TRUE true
  ------------------
  360|    352|}
hostip.c:resolv_unix:
  934|    112|{
  935|    112|  struct Curl_addrinfo *addr;
  936|    112|  CURLcode result;
  937|       |
  938|    112|  DEBUGASSERT(unix_path);
  ------------------
  |  | 1081|    112|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (938:3): [True: 0, False: 112]
  |  Branch (938:3): [True: 112, False: 0]
  ------------------
  939|    112|  *pdns = NULL;
  940|       |
  941|    112|  result = Curl_unix2addr(unix_path, abstract_path, &addr);
  942|    112|  if(result) {
  ------------------
  |  Branch (942:6): [True: 1, False: 111]
  ------------------
  943|      1|    if(result == CURLE_TOO_LARGE) {
  ------------------
  |  Branch (943:8): [True: 1, False: 0]
  ------------------
  944|       |      /* Long paths are not supported for now */
  945|      1|      failf(data, "Unix socket path too long: '%s'", unix_path);
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  946|      1|      result = CURLE_COULDNT_RESOLVE_HOST;
  947|      1|    }
  948|      1|    return result;
  949|      1|  }
  950|       |
  951|    111|  *pdns = Curl_dnscache_mk_entry(data, 0, &addr, NULL, 0);
  952|    111|  return *pdns ? CURLE_OK : CURLE_OUT_OF_MEMORY;
  ------------------
  |  Branch (952:10): [True: 111, False: 0]
  ------------------
  953|    112|}
hostip.c:hostip_resolv_take_result:
  433|   302k|{
  434|   302k|  CURLcode result;
  435|       |
  436|       |  /* If async resolving is ongoing, this must be set */
  437|   302k|  if(!async)
  ------------------
  |  Branch (437:6): [True: 0, False: 302k]
  ------------------
  438|      0|    return CURLE_FAILED_INIT;
  439|       |
  440|   302k|#ifndef CURL_DISABLE_DOH
  441|   302k|  if(async->doh)
  ------------------
  |  Branch (441:6): [True: 77.6k, False: 225k]
  ------------------
  442|  77.6k|    result = Curl_doh_take_result(data, async, pdns);
  443|   225k|  else
  444|   225k|#endif
  445|   225k|  result = Curl_async_take_result(data, async, pdns);
  446|       |
  447|   302k|  if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (447:6): [True: 302k, False: 400]
  ------------------
  448|   302k|    CURL_TRC_DNS(data, "resolve incomplete, queries=%s, responses=%s, "
  ------------------
  |  |  168|   302k|  do {                                 \
  |  |  169|   302k|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|   302k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|   302k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|   604k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 302k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 302k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|   604k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|   302k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|   302k|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|   302k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 302k]
  |  |  ------------------
  ------------------
  449|   302k|                 "ongoing=%d for %s:%d",
  450|   302k|                 Curl_resolv_query_str(async->dns_queries),
  451|   302k|                 Curl_resolv_query_str(async->dns_responses),
  452|   302k|                 async->queries_ongoing, async->hostname, async->port);
  453|   302k|    result = CURLE_OK;
  454|   302k|  }
  455|    400|  else if(result) {
  ------------------
  |  Branch (455:11): [True: 390, False: 10]
  ------------------
  456|    390|    result = Curl_async_failed(data, async, NULL);
  457|    390|  }
  458|     10|  else {
  459|     10|    CURL_TRC_DNS(data, "resolve complete for %s:%u",
  ------------------
  |  |  168|     10|  do {                                 \
  |  |  169|     10|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|     10|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|     10|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|     20|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 10, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 10]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|     20|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|     10|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|     10|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|     10|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 10]
  |  |  ------------------
  ------------------
  460|     10|                 async->hostname, async->port);
  461|     10|    DEBUGASSERT(*pdns);
  ------------------
  |  | 1081|     10|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (461:5): [True: 0, False: 10]
  |  Branch (461:5): [True: 10, False: 0]
  ------------------
  462|     10|  }
  463|       |
  464|   302k|  return result;
  465|   302k|}

Curl_hsts_init:
   67|  17.2k|{
   68|  17.2k|  struct hsts *h = curlx_calloc(1, sizeof(struct hsts));
  ------------------
  |  | 1480|  17.2k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   69|  17.2k|  if(h) {
  ------------------
  |  Branch (69:6): [True: 17.2k, False: 0]
  ------------------
   70|       |    Curl_llist_init(&h->list, NULL);
   71|  17.2k|  }
   72|  17.2k|  return h;
   73|  17.2k|}
Curl_hsts_cleanup:
   78|  36.6k|{
   79|  36.6k|  struct hsts *h = *hp;
   80|  36.6k|  if(h) {
  ------------------
  |  Branch (80:6): [True: 17.2k, False: 19.4k]
  ------------------
   81|  17.2k|    struct Curl_llist_node *e;
   82|  17.2k|    struct Curl_llist_node *n;
   83|  17.2k|    for(e = Curl_llist_head(&h->list); e; e = n) {
  ------------------
  |  Branch (83:40): [True: 0, False: 17.2k]
  ------------------
   84|      0|      struct stsentry *sts = Curl_node_elem(e);
   85|      0|      n = Curl_node_next(e);
   86|      0|      hsts_free(sts);
  ------------------
  |  |   75|      0|#define hsts_free(x) curlx_free(x)
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
   87|      0|    }
   88|  17.2k|    curlx_free(h->filename);
  ------------------
  |  | 1483|  17.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   89|  17.2k|    curlx_free(h);
  ------------------
  |  | 1483|  17.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   90|       |    *hp = NULL;
   91|  17.2k|  }
   92|  36.6k|}
hsts_check:
  146|    418|{
  147|    418|  struct stsentry *bestsub = NULL;
  148|    418|  if(h) {
  ------------------
  |  Branch (148:6): [True: 418, False: 0]
  ------------------
  149|    418|    time_t now = time(NULL);
  ------------------
  |  |   63|    418|#define time(x) hsts_debugtime(x)
  ------------------
  150|    418|    struct Curl_llist_node *e;
  151|    418|    struct Curl_llist_node *n;
  152|    418|    size_t blen = 0;
  153|       |
  154|    418|    if((hlen > MAX_HSTS_HOSTLEN) || !hlen)
  ------------------
  |  |   42|    418|#define MAX_HSTS_HOSTLEN 2048
  ------------------
  |  Branch (154:8): [True: 7, False: 411]
  |  Branch (154:37): [True: 0, False: 411]
  ------------------
  155|      7|      return NULL;
  156|    411|    if(hostname[hlen - 1] == '.')
  ------------------
  |  Branch (156:8): [True: 13, False: 398]
  ------------------
  157|       |      /* remove the trailing dot */
  158|     13|      --hlen;
  159|       |
  160|    411|    for(e = Curl_llist_head(&h->list); e; e = n) {
  ------------------
  |  Branch (160:40): [True: 0, False: 411]
  ------------------
  161|      0|      struct stsentry *sts = Curl_node_elem(e);
  162|      0|      size_t ntail;
  163|      0|      n = Curl_node_next(e);
  164|      0|      if(sts->expires <= now) {
  ------------------
  |  Branch (164:10): [True: 0, False: 0]
  ------------------
  165|       |        /* remove expired entries */
  166|      0|        Curl_node_remove(&sts->node);
  167|      0|        hsts_free(sts);
  ------------------
  |  |   75|      0|#define hsts_free(x) curlx_free(x)
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
  168|      0|        continue;
  169|      0|      }
  170|      0|      ntail = strlen(sts->host);
  171|      0|      if((subdomain && sts->includeSubDomains) && (ntail < hlen)) {
  ------------------
  |  Branch (171:11): [True: 0, False: 0]
  |  Branch (171:24): [True: 0, False: 0]
  |  Branch (171:51): [True: 0, False: 0]
  ------------------
  172|      0|        size_t offs = hlen - ntail;
  173|      0|        if((hostname[offs - 1] == '.') &&
  ------------------
  |  Branch (173:12): [True: 0, False: 0]
  ------------------
  174|      0|           curl_strnequal(&hostname[offs], sts->host, ntail) &&
  ------------------
  |  Branch (174:12): [True: 0, False: 0]
  ------------------
  175|      0|           (ntail > blen)) {
  ------------------
  |  Branch (175:12): [True: 0, False: 0]
  ------------------
  176|       |          /* save the tail match with the longest tail */
  177|      0|          bestsub = sts;
  178|      0|          blen = ntail;
  179|      0|        }
  180|      0|      }
  181|       |      /* avoid curl_strequal because the hostname is not null-terminated */
  182|      0|      if((hlen == ntail) && curl_strnequal(hostname, sts->host, hlen))
  ------------------
  |  Branch (182:10): [True: 0, False: 0]
  |  Branch (182:29): [True: 0, False: 0]
  ------------------
  183|      0|        return sts;
  184|      0|    }
  185|    411|  }
  186|    411|  return bestsub;
  187|    418|}
Curl_hsts_parse:
  191|  1.67k|{
  192|  1.67k|  const char *p = header;
  193|  1.67k|  curl_off_t expires = 0;
  194|  1.67k|  bool gotma = FALSE;
  ------------------
  |  | 1058|  1.67k|#define FALSE false
  ------------------
  195|  1.67k|  bool gotinc = FALSE;
  ------------------
  |  | 1058|  1.67k|#define FALSE false
  ------------------
  196|  1.67k|  bool subdomains = FALSE;
  ------------------
  |  | 1058|  1.67k|#define FALSE false
  ------------------
  197|  1.67k|  struct stsentry *sts;
  198|  1.67k|  time_t now = time(NULL);
  ------------------
  |  |   63|  1.67k|#define time(x) hsts_debugtime(x)
  ------------------
  199|  1.67k|  size_t hlen = strlen(hostname);
  200|       |
  201|  1.67k|  if(Curl_host_is_ipnum(hostname))
  ------------------
  |  Branch (201:6): [True: 352, False: 1.31k]
  ------------------
  202|       |    /* "explicit IP address identification of all forms is excluded."
  203|       |       / RFC 6797 */
  204|    352|    return CURLE_OK;
  205|       |
  206|  1.99k|  do {
  207|  1.99k|    curlx_str_passblanks(&p);
  208|  1.99k|    if(curl_strnequal("max-age", p, 7)) {
  ------------------
  |  Branch (208:8): [True: 0, False: 1.99k]
  ------------------
  209|      0|      bool quoted = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  210|      0|      int rc;
  211|       |
  212|      0|      if(gotma)
  ------------------
  |  Branch (212:10): [True: 0, False: 0]
  ------------------
  213|      0|        return CURLE_BAD_FUNCTION_ARGUMENT;
  214|       |
  215|      0|      p += 7;
  216|      0|      curlx_str_passblanks(&p);
  217|      0|      if(curlx_str_single(&p, '='))
  ------------------
  |  Branch (217:10): [True: 0, False: 0]
  ------------------
  218|      0|        return CURLE_BAD_FUNCTION_ARGUMENT;
  219|      0|      curlx_str_passblanks(&p);
  220|       |
  221|      0|      if(!curlx_str_single(&p, '\"'))
  ------------------
  |  Branch (221:10): [True: 0, False: 0]
  ------------------
  222|      0|        quoted = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  223|       |
  224|      0|      rc = curlx_str_number(&p, &expires, TIME_T_MAX);
  ------------------
  |  |  614|      0|#  define TIME_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  225|      0|      if(rc == STRE_OVERFLOW)
  ------------------
  |  |   35|      0|#define STRE_OVERFLOW 7
  ------------------
  |  Branch (225:10): [True: 0, False: 0]
  ------------------
  226|      0|        expires = CURL_OFF_T_MAX;
  ------------------
  |  |  594|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  227|      0|      else if(rc)
  ------------------
  |  Branch (227:15): [True: 0, False: 0]
  ------------------
  228|       |        /* invalid max-age */
  229|      0|        return CURLE_BAD_FUNCTION_ARGUMENT;
  230|       |
  231|      0|      if(quoted) {
  ------------------
  |  Branch (231:10): [True: 0, False: 0]
  ------------------
  232|      0|        if(*p != '\"')
  ------------------
  |  Branch (232:12): [True: 0, False: 0]
  ------------------
  233|      0|          return CURLE_BAD_FUNCTION_ARGUMENT;
  234|      0|        p++;
  235|      0|      }
  236|      0|      gotma = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  237|      0|    }
  238|  1.99k|    else if(curl_strnequal("includesubdomains", p, 17)) {
  ------------------
  |  Branch (238:13): [True: 0, False: 1.99k]
  ------------------
  239|      0|      if(gotinc)
  ------------------
  |  Branch (239:10): [True: 0, False: 0]
  ------------------
  240|      0|        return CURLE_BAD_FUNCTION_ARGUMENT;
  241|      0|      subdomains = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  242|      0|      p += 17;
  243|      0|      gotinc = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  244|      0|    }
  245|  1.99k|    else {
  246|       |      /* unknown directive, do a lame attempt to skip */
  247|  92.0k|      while(*p && (*p != ';'))
  ------------------
  |  Branch (247:13): [True: 90.7k, False: 1.31k]
  |  Branch (247:19): [True: 90.0k, False: 679]
  ------------------
  248|  90.0k|        p++;
  249|  1.99k|    }
  250|       |
  251|  1.99k|    curlx_str_passblanks(&p);
  252|  1.99k|    if(*p == ';')
  ------------------
  |  Branch (252:8): [True: 679, False: 1.31k]
  ------------------
  253|    679|      p++;
  254|  1.99k|  } while(*p);
  ------------------
  |  Branch (254:11): [True: 679, False: 1.31k]
  ------------------
  255|       |
  256|  1.31k|  if(!gotma)
  ------------------
  |  Branch (256:6): [True: 1.31k, False: 0]
  ------------------
  257|       |    /* max-age is mandatory */
  258|  1.31k|    return CURLE_BAD_FUNCTION_ARGUMENT;
  259|       |
  260|      0|  if(!expires) {
  ------------------
  |  Branch (260:6): [True: 0, False: 0]
  ------------------
  261|       |    /* remove the entry if present verbatim (without subdomain match) */
  262|      0|    sts = hsts_check(h, hostname, hlen, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  263|      0|    if(sts) {
  ------------------
  |  Branch (263:8): [True: 0, False: 0]
  ------------------
  264|      0|      Curl_node_remove(&sts->node);
  265|      0|      hsts_free(sts);
  ------------------
  |  |   75|      0|#define hsts_free(x) curlx_free(x)
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
  266|      0|    }
  267|      0|    return CURLE_OK;
  268|      0|  }
  269|       |
  270|      0|  if(CURL_OFF_T_MAX - now < expires)
  ------------------
  |  |  594|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (270:6): [True: 0, False: 0]
  ------------------
  271|       |    /* would overflow, use maximum value */
  272|      0|    expires = CURL_OFF_T_MAX;
  ------------------
  |  |  594|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  273|      0|  else
  274|      0|    expires += now;
  275|       |
  276|       |  /* check if it already exists */
  277|      0|  sts = hsts_check(h, hostname, hlen, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  278|      0|  if(sts) {
  ------------------
  |  Branch (278:6): [True: 0, False: 0]
  ------------------
  279|       |    /* update these fields */
  280|      0|    sts->expires = expires;
  281|      0|    sts->includeSubDomains = subdomains;
  282|      0|  }
  283|      0|  else
  284|      0|    return hsts_create(h, hostname, hlen, subdomains, expires);
  285|       |
  286|      0|  return CURLE_OK;
  287|      0|}
Curl_hsts_save:
  349|  36.6k|{
  350|  36.6k|  struct Curl_llist_node *e;
  351|  36.6k|  struct Curl_llist_node *n;
  352|  36.6k|  CURLcode result = CURLE_OK;
  353|  36.6k|  FILE *out;
  354|  36.6k|  char *tempstore = NULL;
  355|       |
  356|  36.6k|  if(!h)
  ------------------
  |  Branch (356:6): [True: 19.4k, False: 17.2k]
  ------------------
  357|       |    /* no cache activated */
  358|  19.4k|    return CURLE_OK;
  359|       |
  360|       |  /* if no new name is given, use the one we stored from the load */
  361|  17.2k|  if(!file && h->filename)
  ------------------
  |  Branch (361:6): [True: 2, False: 17.2k]
  |  Branch (361:15): [True: 0, False: 2]
  ------------------
  362|      0|    file = h->filename;
  363|       |
  364|  17.2k|  if((h->flags & CURLHSTS_READONLYFILE) || !file || !file[0])
  ------------------
  |  | 1074|  17.2k|#define CURLHSTS_READONLYFILE (1L << 1)
  ------------------
  |  Branch (364:6): [True: 0, False: 17.2k]
  |  Branch (364:44): [True: 2, False: 17.2k]
  |  Branch (364:53): [True: 0, False: 17.2k]
  ------------------
  365|       |    /* marked as read-only, no file or zero length filename */
  366|      2|    goto skipsave;
  367|       |
  368|  17.2k|  result = Curl_fopen(data, file, &out, &tempstore);
  369|  17.2k|  if(!result) {
  ------------------
  |  Branch (369:6): [True: 17.2k, False: 0]
  ------------------
  370|  17.2k|    fputs("# Your HSTS cache. https://curl.se/docs/hsts.html\n"
  371|  17.2k|          "# This file was generated by libcurl! Edit at your own risk.\n",
  372|  17.2k|          out);
  373|  17.2k|    for(e = Curl_llist_head(&h->list); e; e = n) {
  ------------------
  |  Branch (373:40): [True: 0, False: 17.2k]
  ------------------
  374|      0|      struct stsentry *sts = Curl_node_elem(e);
  375|      0|      n = Curl_node_next(e);
  376|      0|      result = hsts_out(sts, out);
  377|      0|      if(result)
  ------------------
  |  Branch (377:10): [True: 0, False: 0]
  ------------------
  378|      0|        break;
  379|      0|    }
  380|  17.2k|    curlx_fclose(out);
  ------------------
  |  |   79|  17.2k|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
  381|  17.2k|    if(!result && tempstore && curlx_rename(tempstore, file))
  ------------------
  |  |   70|      0|#define curlx_rename            rename
  ------------------
  |  Branch (381:8): [True: 17.2k, False: 0]
  |  Branch (381:19): [True: 0, False: 17.2k]
  |  Branch (381:32): [True: 0, False: 0]
  ------------------
  382|      0|      result = CURLE_WRITE_ERROR;
  383|       |
  384|  17.2k|    if(result && tempstore)
  ------------------
  |  Branch (384:8): [True: 0, False: 17.2k]
  |  Branch (384:18): [True: 0, False: 0]
  ------------------
  385|      0|      unlink(tempstore);
  386|  17.2k|  }
  387|  17.2k|  curlx_free(tempstore);
  ------------------
  |  | 1483|  17.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  388|  17.2k|skipsave:
  389|  17.2k|  if(data->set.hsts_write) {
  ------------------
  |  Branch (389:6): [True: 0, False: 17.2k]
  ------------------
  390|       |    /* if there is a write callback */
  391|      0|    struct curl_index i; /* count */
  392|      0|    i.total = Curl_llist_count(&h->list);
  393|      0|    i.index = 0;
  394|      0|    for(e = Curl_llist_head(&h->list); e; e = n) {
  ------------------
  |  Branch (394:40): [True: 0, False: 0]
  ------------------
  395|      0|      struct stsentry *sts = Curl_node_elem(e);
  396|      0|      bool stop;
  397|      0|      n = Curl_node_next(e);
  398|      0|      result = hsts_push(data, &i, sts, &stop);
  399|      0|      if(result || stop)
  ------------------
  |  Branch (399:10): [True: 0, False: 0]
  |  Branch (399:20): [True: 0, False: 0]
  ------------------
  400|      0|        break;
  401|      0|      i.index++;
  402|      0|    }
  403|      0|  }
  404|  17.2k|  return result;
  405|  17.2k|}
Curl_hsts_loadfile:
  584|  14.0k|{
  585|  14.0k|  DEBUGASSERT(h);
  ------------------
  |  | 1081|  14.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (585:3): [True: 0, False: 14.0k]
  |  Branch (585:3): [True: 14.0k, False: 0]
  ------------------
  586|  14.0k|  (void)data;
  587|  14.0k|  return hsts_load(h, file);
  588|  14.0k|}
Curl_hsts_loadcb:
  594|  14.6k|{
  595|  14.6k|  if(h)
  ------------------
  |  Branch (595:6): [True: 14.0k, False: 649]
  ------------------
  596|  14.0k|    return hsts_pull(data, h);
  597|    649|  return CURLE_OK;
  598|  14.6k|}
Curl_hsts_loadfiles:
  601|  14.6k|{
  602|  14.6k|  CURLcode result = CURLE_OK;
  603|  14.6k|  struct curl_slist *l = data->state.hstslist;
  604|  14.6k|  if(l) {
  ------------------
  |  Branch (604:6): [True: 14.0k, False: 649]
  ------------------
  605|  14.0k|    Curl_share_lock(data, CURL_LOCK_DATA_HSTS, CURL_LOCK_ACCESS_SINGLE);
  606|       |
  607|  28.0k|    while(l) {
  ------------------
  |  Branch (607:11): [True: 14.0k, False: 14.0k]
  ------------------
  608|  14.0k|      result = Curl_hsts_loadfile(data, data->hsts, l->data);
  609|  14.0k|      if(result)
  ------------------
  |  Branch (609:10): [True: 0, False: 14.0k]
  ------------------
  610|      0|        break;
  611|  14.0k|      l = l->next;
  612|  14.0k|    }
  613|  14.0k|    Curl_share_unlock(data, CURL_LOCK_DATA_HSTS);
  614|  14.0k|  }
  615|  14.6k|  return result;
  616|  14.6k|}
Curl_hsts_applies:
  619|    418|{
  620|       |  return !!hsts_check(h, dest->hostname, strlen(dest->hostname), TRUE);
  ------------------
  |  | 1055|    418|#define TRUE true
  ------------------
  621|    418|}
hsts.c:hsts_debugtime:
   51|  2.08k|{
   52|  2.08k|  const char *timestr = getenv("CURL_TIME");
   53|  2.08k|  (void)unused;
   54|  2.08k|  if(timestr) {
  ------------------
  |  Branch (54:6): [True: 0, False: 2.08k]
  ------------------
   55|      0|    curl_off_t val;
   56|      0|    if(!curlx_str_number(&timestr, &val, TIME_T_MAX))
  ------------------
  |  |  614|      0|#  define TIME_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (56:8): [True: 0, False: 0]
  ------------------
   57|      0|      val += (curl_off_t)deltatime;
   58|      0|    return (time_t)val;
   59|      0|  }
   60|  2.08k|  return time(NULL);
   61|  2.08k|}
hsts.c:hsts_load:
  539|  14.0k|{
  540|  14.0k|  CURLcode result = CURLE_OK;
  541|  14.0k|  FILE *fp;
  542|       |
  543|       |  /* we need a private copy of the filename so that the hsts cache file
  544|       |     name survives an easy handle reset */
  545|  14.0k|  curlx_free(h->filename);
  ------------------
  |  | 1483|  14.0k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  546|  14.0k|  h->filename = curlx_strdup(file);
  ------------------
  |  | 1477|  14.0k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  547|  14.0k|  if(!h->filename)
  ------------------
  |  Branch (547:6): [True: 0, False: 14.0k]
  ------------------
  548|      0|    return CURLE_OUT_OF_MEMORY;
  549|       |
  550|  14.0k|  fp = curlx_fopen(file, FOPEN_READTEXT);
  ------------------
  |  |   74|  14.0k|#define curlx_fopen(file, mode) curl_dbg_fopen(file, mode, __LINE__, __FILE__)
  ------------------
  551|  14.0k|  if(fp) {
  ------------------
  |  Branch (551:6): [True: 14.0k, False: 0]
  ------------------
  552|  14.0k|    curlx_struct_stat stat;
  ------------------
  |  |   63|  14.0k|#define curlx_struct_stat       struct stat
  ------------------
  553|  14.0k|    if((curlx_fstat(fileno(fp), &stat) == -1) || !S_ISDIR(stat.st_mode)) {
  ------------------
  |  |   62|  14.0k|#define curlx_fstat             fstat
  ------------------
  |  Branch (553:8): [True: 0, False: 14.0k]
  |  Branch (553:50): [True: 14.0k, False: 0]
  ------------------
  554|  14.0k|      struct dynbuf buf;
  555|  14.0k|      bool eof = FALSE;
  ------------------
  |  | 1058|  14.0k|#define FALSE false
  ------------------
  556|  14.0k|      curlx_dyn_init(&buf, MAX_HSTS_LINE);
  ------------------
  |  |   41|  14.0k|#define MAX_HSTS_LINE    4095
  ------------------
  557|  14.0k|      do {
  558|  14.0k|        result = Curl_get_line(&buf, fp, &eof);
  559|  14.0k|        if(!result) {
  ------------------
  |  Branch (559:12): [True: 14.0k, False: 0]
  ------------------
  560|  14.0k|          const char *lineptr = curlx_dyn_ptr(&buf);
  561|  14.0k|          curlx_str_passblanks(&lineptr);
  562|       |
  563|       |          /* Skip empty or commented lines, since we know the line will have
  564|       |             a trailing newline from Curl_get_line we can treat length 1 as
  565|       |             empty. */
  566|  14.0k|          if((*lineptr == '#') || strlen(lineptr) <= 1)
  ------------------
  |  Branch (566:14): [True: 0, False: 14.0k]
  |  Branch (566:35): [True: 14.0k, False: 0]
  ------------------
  567|  14.0k|            continue;
  568|       |
  569|      0|          hsts_add(h, lineptr);
  570|      0|        }
  571|  14.0k|      } while(!result && !eof);
  ------------------
  |  Branch (571:15): [True: 14.0k, False: 0]
  |  Branch (571:26): [True: 0, False: 14.0k]
  ------------------
  572|  14.0k|      curlx_dyn_free(&buf); /* free the line buffer */
  573|  14.0k|    }
  574|  14.0k|    curlx_fclose(fp);
  ------------------
  |  |   79|  14.0k|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
  575|  14.0k|  }
  576|  14.0k|  return result;
  577|  14.0k|}
hsts.c:hsts_pull:
  491|  14.0k|{
  492|       |  /* if the HSTS read callback is set, use it */
  493|  14.0k|  if(data->set.hsts_read) {
  ------------------
  |  Branch (493:6): [True: 0, False: 14.0k]
  ------------------
  494|      0|    CURLSTScode sc;
  495|      0|    DEBUGASSERT(h);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (495:5): [True: 0, False: 0]
  |  Branch (495:5): [True: 0, False: 0]
  ------------------
  496|      0|    do {
  497|      0|      char buffer[MAX_HSTS_HOSTLEN + 1];
  498|      0|      struct curl_hstsentry e;
  499|      0|      e.name = buffer;
  500|      0|      e.namelen = sizeof(buffer) - 1;
  501|      0|      e.includeSubDomains = FALSE; /* default */
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  502|      0|      e.expire[0] = 0;
  503|      0|      e.expire[MAX_HSTS_DATELEN] = 0;
  ------------------
  |  |   43|      0|#define MAX_HSTS_DATELEN 17
  ------------------
  504|      0|      e.name[0] = 0; /* to make it clean */
  505|      0|      e.name[MAX_HSTS_HOSTLEN] = 0;
  ------------------
  |  |   42|      0|#define MAX_HSTS_HOSTLEN 2048
  ------------------
  506|      0|      sc = data->set.hsts_read(data, &e, data->set.hsts_read_userp);
  507|      0|      if(sc == CURLSTS_OK) {
  ------------------
  |  Branch (507:10): [True: 0, False: 0]
  ------------------
  508|      0|        CURLcode result;
  509|      0|        const char *date = e.expire;
  510|      0|        if(!e.name[0] || e.expire[MAX_HSTS_DATELEN] ||
  ------------------
  |  |   43|      0|#define MAX_HSTS_DATELEN 17
  ------------------
  |  Branch (510:12): [True: 0, False: 0]
  |  Branch (510:26): [True: 0, False: 0]
  ------------------
  511|      0|           e.name[MAX_HSTS_HOSTLEN])
  ------------------
  |  |   42|      0|#define MAX_HSTS_HOSTLEN 2048
  ------------------
  |  Branch (511:12): [True: 0, False: 0]
  ------------------
  512|       |          /* bail out if no name was stored or if a null-terminator is gone */
  513|      0|          return CURLE_BAD_FUNCTION_ARGUMENT;
  514|      0|        if(!date[0])
  ------------------
  |  Branch (514:12): [True: 0, False: 0]
  ------------------
  515|      0|          date = UNLIMITED;
  ------------------
  |  |   44|      0|#define UNLIMITED        "unlimited"
  ------------------
  516|      0|        result = hsts_add_host_expire(h, e.name, strlen(e.name),
  517|      0|                                      date, strlen(date),
  518|       |                                      /* bitfield to bool conversion: */
  519|      0|                                      e.includeSubDomains ? TRUE : FALSE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
                                                    e.includeSubDomains ? TRUE : FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  |  Branch (519:39): [True: 0, False: 0]
  ------------------
  520|      0|        if(result)
  ------------------
  |  Branch (520:12): [True: 0, False: 0]
  ------------------
  521|      0|          return result;
  522|      0|      }
  523|      0|      else if(sc == CURLSTS_FAIL)
  ------------------
  |  Branch (523:15): [True: 0, False: 0]
  ------------------
  524|      0|        return CURLE_ABORTED_BY_CALLBACK;
  525|      0|    } while(sc == CURLSTS_OK);
  ------------------
  |  Branch (525:13): [True: 0, False: 0]
  ------------------
  526|      0|  }
  527|  14.0k|  return CURLE_OK;
  528|  14.0k|}

Curl_http_neg_init:
   89|  14.6k|{
   90|  14.6k|  memset(neg, 0, sizeof(*neg));
   91|  14.6k|  neg->accept_09 = data->set.http09_allowed;
   92|  14.6k|  switch(data->set.httpwant) {
   93|     11|  case CURL_HTTP_VERSION_1_0:
  ------------------
  |  | 2315|     11|#define CURL_HTTP_VERSION_1_0   1L /* please use HTTP 1.0 in the request */
  ------------------
  |  Branch (93:3): [True: 11, False: 14.6k]
  ------------------
   94|     11|    neg->wanted = neg->allowed = (CURL_HTTP_V1x);
  ------------------
  |  |   40|     11|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
   95|     11|    neg->only_10 = TRUE;
  ------------------
  |  | 1055|     11|#define TRUE true
  ------------------
   96|     11|    break;
   97|      5|  case CURL_HTTP_VERSION_1_1:
  ------------------
  |  | 2316|      5|#define CURL_HTTP_VERSION_1_1   2L /* please use HTTP 1.1 in the request */
  ------------------
  |  Branch (97:3): [True: 5, False: 14.6k]
  ------------------
   98|      5|    neg->wanted = neg->allowed = (CURL_HTTP_V1x);
  ------------------
  |  |   40|      5|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
   99|      5|    break;
  100|     31|  case CURL_HTTP_VERSION_2_0:
  ------------------
  |  | 2317|     31|#define CURL_HTTP_VERSION_2_0   3L /* please use HTTP 2 in the request */
  ------------------
  |  Branch (100:3): [True: 31, False: 14.6k]
  ------------------
  101|     31|    neg->wanted = neg->allowed = (CURL_HTTP_V1x | CURL_HTTP_V2x);
  ------------------
  |  |   40|     31|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
                  neg->wanted = neg->allowed = (CURL_HTTP_V1x | CURL_HTTP_V2x);
  ------------------
  |  |   41|     31|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  102|     31|    neg->h2_upgrade = TRUE;
  ------------------
  |  | 1055|     31|#define TRUE true
  ------------------
  103|     31|    break;
  104|    652|  case CURL_HTTP_VERSION_2TLS:
  ------------------
  |  | 2318|    652|#define CURL_HTTP_VERSION_2TLS  4L /* use version 2 for HTTPS, version 1.1 for
  ------------------
  |  Branch (104:3): [True: 652, False: 14.0k]
  ------------------
  105|    652|    neg->wanted = neg->allowed = (CURL_HTTP_V1x | CURL_HTTP_V2x);
  ------------------
  |  |   40|    652|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
                  neg->wanted = neg->allowed = (CURL_HTTP_V1x | CURL_HTTP_V2x);
  ------------------
  |  |   41|    652|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  106|    652|    break;
  107|  4.44k|  case CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE:
  ------------------
  |  | 2320|  4.44k|#define CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE 5L /* please use HTTP 2 without
  ------------------
  |  Branch (107:3): [True: 4.44k, False: 10.2k]
  ------------------
  108|  4.44k|    neg->wanted = neg->allowed = (CURL_HTTP_V2x);
  ------------------
  |  |   41|  4.44k|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  109|  4.44k|    data->state.http_neg.h2_prior_knowledge = TRUE;
  ------------------
  |  | 1055|  4.44k|#define TRUE true
  ------------------
  110|  4.44k|    break;
  111|      0|  case CURL_HTTP_VERSION_3:
  ------------------
  |  | 2322|      0|#define CURL_HTTP_VERSION_3     30L /* Use HTTP/3, fallback to HTTP/2 or
  ------------------
  |  Branch (111:3): [True: 0, False: 14.6k]
  ------------------
  112|      0|    neg->wanted = (CURL_HTTP_V1x | CURL_HTTP_V2x | CURL_HTTP_V3x);
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
                  neg->wanted = (CURL_HTTP_V1x | CURL_HTTP_V2x | CURL_HTTP_V3x);
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
                  neg->wanted = (CURL_HTTP_V1x | CURL_HTTP_V2x | CURL_HTTP_V3x);
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  113|      0|    neg->allowed = neg->wanted;
  114|      0|    break;
  115|      0|  case CURL_HTTP_VERSION_3ONLY:
  ------------------
  |  | 2326|      0|#define CURL_HTTP_VERSION_3ONLY 31L /* Use HTTP/3 without fallback. For
  ------------------
  |  Branch (115:3): [True: 0, False: 14.6k]
  ------------------
  116|      0|    neg->wanted = neg->allowed = (CURL_HTTP_V3x);
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  117|      0|    break;
  118|  9.54k|  case CURL_HTTP_VERSION_NONE:
  ------------------
  |  | 2312|  9.54k|#define CURL_HTTP_VERSION_NONE  0L /* setting this means we do not care, and
  ------------------
  |  Branch (118:3): [True: 9.54k, False: 5.14k]
  ------------------
  119|  9.54k|  default:
  ------------------
  |  Branch (119:3): [True: 0, False: 14.6k]
  ------------------
  120|  9.54k|    neg->wanted = (CURL_HTTP_V1x | CURL_HTTP_V2x);
  ------------------
  |  |   40|  9.54k|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
                  neg->wanted = (CURL_HTTP_V1x | CURL_HTTP_V2x);
  ------------------
  |  |   41|  9.54k|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  121|  9.54k|    neg->allowed = (CURL_HTTP_V1x | CURL_HTTP_V2x | CURL_HTTP_V3x);
  ------------------
  |  |   40|  9.54k|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
                  neg->allowed = (CURL_HTTP_V1x | CURL_HTTP_V2x | CURL_HTTP_V3x);
  ------------------
  |  |   41|  9.54k|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
                  neg->allowed = (CURL_HTTP_V1x | CURL_HTTP_V2x | CURL_HTTP_V3x);
  ------------------
  |  |   42|  9.54k|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  122|  9.54k|    break;
  123|  14.6k|  }
  124|  14.6k|}
Curl_http_setup_conn:
  128|  9.12k|{
  129|       |  /* allocate the HTTP-specific struct for the Curl_easy, only to survive
  130|       |     during this request */
  131|  9.12k|  if(data->state.http_neg.wanted == CURL_HTTP_V3x) {
  ------------------
  |  |   42|  9.12k|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  |  Branch (131:6): [True: 0, False: 9.12k]
  ------------------
  132|       |    /* only HTTP/3, needs to work */
  133|      0|    CURLcode result = Curl_conn_may_http3(data, conn, conn->transport_wanted);
  134|      0|    if(result)
  ------------------
  |  Branch (134:8): [True: 0, False: 0]
  ------------------
  135|      0|      return result;
  136|      0|  }
  137|  9.12k|  return CURLE_OK;
  138|  9.12k|}
Curl_checkProxyheaders:
  154|  25.2k|{
  155|  25.2k|  struct curl_slist *head;
  156|       |
  157|  25.2k|  for(head = (conn->bits.proxy && data->set.sep_headers) ?
  ------------------
  |  Branch (157:15): [True: 25.2k, False: 0]
  |  Branch (157:35): [True: 24.0k, False: 1.20k]
  ------------------
  158|  24.0k|        data->set.proxyheaders : data->set.headers;
  159|  35.3k|      head; head = head->next) {
  ------------------
  |  Branch (159:7): [True: 10.1k, False: 25.2k]
  ------------------
  160|  10.1k|    if(curl_strnequal(head->data, thisheader, thislen) &&
  ------------------
  |  Branch (160:8): [True: 73, False: 10.0k]
  ------------------
  161|     73|       Curl_headersep(head->data[thislen]))
  ------------------
  |  |   26|     73|#define Curl_headersep(x) ((((x) == ':') || ((x) == ';')))
  |  |  ------------------
  |  |  |  Branch (26:29): [True: 19, False: 54]
  |  |  |  Branch (26:45): [True: 1, False: 53]
  |  |  ------------------
  ------------------
  162|     20|      return head->data;
  163|  10.1k|  }
  164|       |
  165|  25.2k|  return NULL;
  166|  25.2k|}
Curl_copy_header_value:
  229|  2.43k|{
  230|  2.43k|  struct Curl_str out;
  231|       |
  232|       |  /* find the end of the header name */
  233|  2.43k|  if(!curlx_str_until(&header, &out, MAX_HTTP_RESP_HEADER_SIZE, ':') &&
  ------------------
  |  |  153|  2.43k|#define MAX_HTTP_RESP_HEADER_SIZE (300 * 1024)
  ------------------
  |  Branch (233:6): [True: 2.43k, False: 0]
  ------------------
  234|  2.43k|     !curlx_str_single(&header, ':')) {
  ------------------
  |  Branch (234:6): [True: 2.43k, False: 0]
  ------------------
  235|  2.43k|    curlx_str_untilnl(&header, &out, MAX_HTTP_RESP_HEADER_SIZE);
  ------------------
  |  |  153|  2.43k|#define MAX_HTTP_RESP_HEADER_SIZE (300 * 1024)
  ------------------
  236|  2.43k|    curlx_str_trimblanks(&out);
  237|  2.43k|    return curlx_memdup0(curlx_str(&out), curlx_strlen(&out));
  ------------------
  |  |   49|  2.43k|#define curlx_str(x)    ((x)->str)
  ------------------
                  return curlx_memdup0(curlx_str(&out), curlx_strlen(&out));
  ------------------
  |  |   50|  2.43k|#define curlx_strlen(x) ((x)->len)
  ------------------
  238|  2.43k|  }
  239|       |  /* bad input, should never happen */
  240|      0|  DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (240:3): [Folded, False: 0]
  |  Branch (240:3): [Folded, False: 0]
  ------------------
  241|      0|  return NULL;
  242|      0|}
Curl_http_auth_act:
  551|  1.34k|{
  552|  1.34k|  struct connectdata *conn = data->conn;
  553|  1.34k|  bool pickhost = FALSE;
  ------------------
  |  | 1058|  1.34k|#define FALSE false
  ------------------
  554|  1.34k|  bool pickproxy = FALSE;
  ------------------
  |  | 1058|  1.34k|#define FALSE false
  ------------------
  555|  1.34k|  CURLcode result = CURLE_OK;
  556|  1.34k|  unsigned long authmask = ~0UL;
  557|       |
  558|  1.34k|  if(!Curl_creds_has_oauth_bearer(data->state.creds))
  ------------------
  |  |   73|  1.34k|#define Curl_creds_has_oauth_bearer(c)   ((c) && (c)->oauth_bearer[0])
  |  |  ------------------
  |  |  |  Branch (73:43): [True: 398, False: 944]
  |  |  |  Branch (73:50): [True: 48, False: 350]
  |  |  ------------------
  ------------------
  559|  1.29k|    authmask &= (unsigned long)~CURLAUTH_BEARER;
  ------------------
  |  |  844|  1.29k|#define CURLAUTH_BEARER       (((unsigned long)1) << 6)
  ------------------
  560|       |
  561|  1.34k|  if(100 <= data->req.httpcode && data->req.httpcode <= 199)
  ------------------
  |  Branch (561:6): [True: 1.25k, False: 91]
  |  Branch (561:35): [True: 4, False: 1.24k]
  ------------------
  562|       |    /* this is a transient response code, ignore */
  563|      4|    return CURLE_OK;
  564|       |
  565|  1.33k|  if(data->state.authproblem)
  ------------------
  |  Branch (565:6): [True: 0, False: 1.33k]
  ------------------
  566|      0|    return data->set.http_fail_on_error ? CURLE_HTTP_RETURNED_ERROR : CURLE_OK;
  ------------------
  |  Branch (566:12): [True: 0, False: 0]
  ------------------
  567|       |
  568|  1.33k|  if(data->state.creds &&
  ------------------
  |  Branch (568:6): [True: 395, False: 943]
  ------------------
  569|    395|     ((data->req.httpcode == 401) ||
  ------------------
  |  Branch (569:7): [True: 2, False: 393]
  ------------------
  570|    393|      (data->req.authneg && data->req.httpcode < 300))) {
  ------------------
  |  Branch (570:8): [True: 2, False: 391]
  |  Branch (570:29): [True: 1, False: 1]
  ------------------
  571|      3|    pickhost = pickoneauth(&data->state.authhost, authmask);
  572|      3|    if(!pickhost)
  ------------------
  |  Branch (572:8): [True: 3, False: 0]
  ------------------
  573|      3|      data->state.authproblem = TRUE;
  ------------------
  |  | 1055|      3|#define TRUE true
  ------------------
  574|      0|    else
  575|      0|      data->info.httpauthpicked = data->state.authhost.picked;
  576|      3|    if(data->state.authhost.picked == CURLAUTH_NTLM &&
  ------------------
  |  |  838|      6|#define CURLAUTH_NTLM         (((unsigned long)1) << 3)
  ------------------
  |  Branch (576:8): [True: 0, False: 3]
  ------------------
  577|      0|       (data->req.httpversion_sent > 11)) {
  ------------------
  |  Branch (577:8): [True: 0, False: 0]
  ------------------
  578|      0|      infof(data, "Forcing HTTP/1.1 for NTLM");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  579|      0|      connclose(conn, "Force HTTP/1.1 connection");
  ------------------
  |  |  103|      0|#define connclose(x, y)   Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
  |  |  ------------------
  |  |  |  |   91|      0|#define CONNCTRL_CONNECTION 1
  |  |  ------------------
  ------------------
  580|      0|      data->state.http_neg.wanted = CURL_HTTP_V1x;
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
  581|      0|      data->state.http_neg.allowed = CURL_HTTP_V1x;
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
  582|      0|    }
  583|      3|  }
  584|  1.33k|#ifndef CURL_DISABLE_PROXY
  585|  1.33k|  if(conn->http_proxy.creds &&
  ------------------
  |  Branch (585:6): [True: 302, False: 1.03k]
  ------------------
  586|    302|     ((data->req.httpcode == 407) ||
  ------------------
  |  Branch (586:7): [True: 6, False: 296]
  ------------------
  587|    296|      (data->req.authneg && data->req.httpcode < 300))) {
  ------------------
  |  Branch (587:8): [True: 3, False: 293]
  |  Branch (587:29): [True: 2, False: 1]
  ------------------
  588|      8|    pickproxy = pickoneauth(&data->state.authproxy,
  589|      8|                            authmask & ~CURLAUTH_BEARER);
  ------------------
  |  |  844|      8|#define CURLAUTH_BEARER       (((unsigned long)1) << 6)
  ------------------
  590|      8|    if(!pickproxy)
  ------------------
  |  Branch (590:8): [True: 8, False: 0]
  ------------------
  591|      8|      data->state.authproblem = TRUE;
  ------------------
  |  | 1055|      8|#define TRUE true
  ------------------
  592|      0|    else
  593|      0|      data->info.proxyauthpicked = data->state.authproxy.picked;
  594|      8|  }
  595|  1.33k|#endif
  596|       |
  597|  1.33k|  if(pickhost || pickproxy) {
  ------------------
  |  Branch (597:6): [True: 0, False: 1.33k]
  |  Branch (597:18): [True: 0, False: 1.33k]
  ------------------
  598|      0|    result = http_perhapsrewind(data, conn);
  599|      0|    if(result)
  ------------------
  |  Branch (599:8): [True: 0, False: 0]
  ------------------
  600|      0|      return result;
  601|       |
  602|       |    /* In case this is GSS auth, the newurl field is already allocated so
  603|       |       we must make sure to free it before allocating a new one. As figured
  604|       |       out in bug #2284386 */
  605|      0|    curlx_free(data->req.newurl);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  606|       |    /* clone URL */
  607|      0|    data->req.newurl = Curl_bufref_dup(&data->state.url);
  ------------------
  |  |   49|      0|#define Curl_bufref_dup(x) curlx_strdup(Curl_bufref_ptr(x))
  |  |  ------------------
  |  |  |  | 1477|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
  608|      0|    if(!data->req.newurl)
  ------------------
  |  Branch (608:8): [True: 0, False: 0]
  ------------------
  609|      0|      return CURLE_OUT_OF_MEMORY;
  610|      0|  }
  611|  1.33k|  else if((data->req.httpcode < 300) &&
  ------------------
  |  Branch (611:11): [True: 843, False: 495]
  ------------------
  612|    843|          !data->state.authhost.done &&
  ------------------
  |  Branch (612:11): [True: 94, False: 749]
  ------------------
  613|     94|          data->req.authneg) {
  ------------------
  |  Branch (613:11): [True: 3, False: 91]
  ------------------
  614|       |    /* no (known) authentication available,
  615|       |       authentication is not "done" yet and
  616|       |       no authentication seems to be required and
  617|       |       we did not try HEAD or GET */
  618|      3|    if((data->state.httpreq != HTTPREQ_GET) &&
  ------------------
  |  Branch (618:8): [True: 3, False: 0]
  ------------------
  619|      3|       (data->state.httpreq != HTTPREQ_HEAD)) {
  ------------------
  |  Branch (619:8): [True: 3, False: 0]
  ------------------
  620|       |      /* clone URL */
  621|      3|      data->req.newurl = Curl_bufref_dup(&data->state.url);
  ------------------
  |  |   49|      3|#define Curl_bufref_dup(x) curlx_strdup(Curl_bufref_ptr(x))
  |  |  ------------------
  |  |  |  | 1477|      3|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
  622|      3|      if(!data->req.newurl)
  ------------------
  |  Branch (622:10): [True: 0, False: 3]
  ------------------
  623|      0|        return CURLE_OUT_OF_MEMORY;
  624|      3|      data->state.authhost.done = TRUE;
  ------------------
  |  | 1055|      3|#define TRUE true
  ------------------
  625|      3|    }
  626|      3|  }
  627|  1.33k|  if(http_should_fail(data, data->req.httpcode)) {
  ------------------
  |  Branch (627:6): [True: 7, False: 1.33k]
  ------------------
  628|      7|    failf(data, "The requested URL returned error: %d",
  ------------------
  |  |   62|      7|#define failf Curl_failf
  ------------------
  629|      7|          data->req.httpcode);
  630|      7|    result = CURLE_HTTP_RETURNED_ERROR;
  631|      7|  }
  632|       |
  633|  1.33k|  return result;
  634|  1.33k|}
Curl_http_output_auth:
  773|  14.8k|{
  774|  14.8k|  CURLcode result = CURLE_OK;
  775|  14.8k|  struct auth *authhost;
  776|  14.8k|  struct auth *authproxy;
  777|  14.8k|  const char *path_and_query = path;
  778|  14.8k|  char *tmp_str = NULL;
  779|       |
  780|  14.8k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  14.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (780:3): [True: 0, False: 14.8k]
  |  Branch (780:3): [True: 14.8k, False: 0]
  ------------------
  781|  14.8k|  authhost = &data->state.authhost;
  782|  14.8k|  authproxy = &data->state.authproxy;
  783|       |
  784|  14.8k|  if(
  785|  14.8k|#ifndef CURL_DISABLE_PROXY
  786|  14.8k|    (!conn->bits.httpproxy || !conn->http_proxy.creds) &&
  ------------------
  |  Branch (786:6): [True: 0, False: 14.8k]
  |  Branch (786:31): [True: 12.7k, False: 2.09k]
  ------------------
  787|  12.7k|#endif
  788|       |#ifdef USE_SPNEGO
  789|       |    !(authhost->want & CURLAUTH_NEGOTIATE) &&
  790|       |    !(authproxy->want & CURLAUTH_NEGOTIATE) &&
  791|       |#endif
  792|  12.7k|    !data->state.creds) {
  ------------------
  |  Branch (792:5): [True: 4.92k, False: 7.82k]
  ------------------
  793|       |    /* no authentication with no user or password */
  794|  4.92k|    authhost->done = TRUE;
  ------------------
  |  | 1055|  4.92k|#define TRUE true
  ------------------
  795|  4.92k|    authproxy->done = TRUE;
  ------------------
  |  | 1055|  4.92k|#define TRUE true
  ------------------
  796|  4.92k|    result = CURLE_OK;
  797|  4.92k|    goto out;
  798|  4.92k|  }
  799|       |
  800|  9.91k|  if(query) {
  ------------------
  |  Branch (800:6): [True: 1.36k, False: 8.55k]
  ------------------
  801|  1.36k|    tmp_str = curl_maprintf("%s?%s", path, query);
  802|  1.36k|    if(!tmp_str) {
  ------------------
  |  Branch (802:8): [True: 0, False: 1.36k]
  ------------------
  803|      0|      result = CURLE_OUT_OF_MEMORY;
  804|      0|      goto out;
  805|      0|    }
  806|  1.36k|    path_and_query = tmp_str;
  807|  1.36k|  }
  808|       |
  809|  9.91k|  if(authhost->want && !authhost->picked)
  ------------------
  |  Branch (809:6): [True: 9.89k, False: 24]
  |  Branch (809:24): [True: 4.98k, False: 4.90k]
  ------------------
  810|       |    /* The app has selected one or more methods, but none has been picked
  811|       |       so far by a server round-trip. Then we set the picked one to the
  812|       |       want one, and if this is one single bit it will be used instantly. */
  813|  4.98k|    authhost->picked = authhost->want;
  814|       |
  815|  9.91k|  if(authproxy->want && !authproxy->picked)
  ------------------
  |  Branch (815:6): [True: 9.90k, False: 10]
  |  Branch (815:25): [True: 4.99k, False: 4.91k]
  ------------------
  816|       |    /* The app has selected one or more methods, but none has been picked so
  817|       |       far by a proxy round-trip. Then we set the picked one to the want one,
  818|       |       and if this is one single bit it will be used instantly. */
  819|  4.99k|    authproxy->picked = authproxy->want;
  820|       |
  821|  9.91k|#ifndef CURL_DISABLE_PROXY
  822|       |  /* Send proxy authentication header if needed */
  823|  9.91k|  if(conn->bits.httpproxy && (!conn->bits.tunnel_proxy || is_connect)) {
  ------------------
  |  Branch (823:6): [True: 9.91k, False: 0]
  |  Branch (823:31): [True: 76, False: 9.84k]
  |  Branch (823:59): [True: 5.46k, False: 4.38k]
  ------------------
  824|  5.53k|    result = output_auth_headers(data, conn, authproxy, request,
  825|  5.53k|                                 path_and_query, TRUE);
  ------------------
  |  | 1055|  5.53k|#define TRUE true
  ------------------
  826|  5.53k|    if(result)
  ------------------
  |  Branch (826:8): [True: 0, False: 5.53k]
  ------------------
  827|      0|      goto out;
  828|  5.53k|  }
  829|  4.38k|  else
  830|       |#else
  831|       |  (void)is_connect;
  832|       |#endif /* CURL_DISABLE_PROXY */
  833|       |    /* we have no proxy so let's pretend we are done authenticating
  834|       |       with it */
  835|  4.38k|    authproxy->done = TRUE;
  ------------------
  |  | 1055|  4.38k|#define TRUE true
  ------------------
  836|       |
  837|       |  /* Either we have credentials for the origin we talk to or
  838|       |     performing authentication is allowed here */
  839|  9.91k|  if(data->state.creds || Curl_auth_allowed_to_host(data))
  ------------------
  |  Branch (839:6): [True: 7.91k, False: 2.00k]
  |  Branch (839:27): [True: 1.99k, False: 1]
  ------------------
  840|  9.91k|    result = output_auth_headers(data, conn, authhost, request,
  841|  9.91k|                                 path_and_query, FALSE);
  ------------------
  |  | 1058|  9.91k|#define FALSE false
  ------------------
  842|      1|  else
  843|      1|    authhost->done = TRUE;
  ------------------
  |  | 1055|      1|#define TRUE true
  ------------------
  844|       |
  845|  9.91k|  if(((authhost->multipass && !authhost->done) ||
  ------------------
  |  Branch (845:8): [True: 40, False: 9.87k]
  |  Branch (845:31): [True: 40, False: 0]
  ------------------
  846|  9.87k|      (authproxy->multipass && !authproxy->done)) &&
  ------------------
  |  Branch (846:8): [True: 3, False: 9.87k]
  |  Branch (846:32): [True: 3, False: 0]
  ------------------
  847|     43|     (httpreq != HTTPREQ_GET) &&
  ------------------
  |  Branch (847:6): [True: 13, False: 30]
  ------------------
  848|     13|     (httpreq != HTTPREQ_HEAD)) {
  ------------------
  |  Branch (848:6): [True: 12, False: 1]
  ------------------
  849|       |    /* Auth is required and we are not authenticated yet. Make a PUT or POST
  850|       |       with content-length zero as a "probe". */
  851|     12|    data->req.authneg = TRUE;
  ------------------
  |  | 1055|     12|#define TRUE true
  ------------------
  852|     12|  }
  853|  9.90k|  else
  854|  9.90k|    data->req.authneg = FALSE;
  ------------------
  |  | 1058|  9.90k|#define FALSE false
  ------------------
  855|       |
  856|  14.8k|out:
  857|  14.8k|  curlx_free(tmp_str);
  ------------------
  |  | 1483|  14.8k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  858|  14.8k|  return result;
  859|  9.91k|}
Curl_http_input_auth:
 1034|    112|{
 1035|       |  /*
 1036|       |   * This resource requires authentication
 1037|       |   */
 1038|    112|#if defined(USE_SPNEGO) ||                      \
 1039|    112|  defined(USE_NTLM) ||                          \
 1040|    112|  !defined(CURL_DISABLE_DIGEST_AUTH) ||         \
 1041|    112|  !defined(CURL_DISABLE_BASIC_AUTH) ||          \
 1042|    112|  !defined(CURL_DISABLE_BEARER_AUTH)
 1043|       |
 1044|    112|  uint32_t *availp;
 1045|    112|  struct auth *authp;
 1046|    112|  CURLcode result = CURLE_OK;
 1047|    112|  DEBUGASSERT(auth);
  ------------------
  |  | 1081|    112|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1047:3): [True: 0, False: 112]
  |  Branch (1047:3): [True: 112, False: 0]
  ------------------
 1048|    112|  DEBUGASSERT(data);
  ------------------
  |  | 1081|    112|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1048:3): [True: 0, False: 112]
  |  Branch (1048:3): [True: 112, False: 0]
  ------------------
 1049|       |
 1050|    112|  if(proxy) {
  ------------------
  |  Branch (1050:6): [True: 50, False: 62]
  ------------------
 1051|     50|    availp = &data->info.proxyauthavail;
 1052|     50|    authp = &data->state.authproxy;
 1053|     50|  }
 1054|     62|  else {
 1055|     62|    availp = &data->info.httpauthavail;
 1056|     62|    authp = &data->state.authhost;
 1057|     62|  }
 1058|       |
 1059|       |  /*
 1060|       |   * Here we check if we want the specific single authentication (using ==) and
 1061|       |   * if we do, we initiate usage of it.
 1062|       |   *
 1063|       |   * If the provided authentication is wanted as one out of several accepted
 1064|       |   * types (using &), we OR this authentication type to the authavail
 1065|       |   * variable.
 1066|       |   *
 1067|       |   * Note:
 1068|       |   *
 1069|       |   * ->picked is first set to the 'want' value (one or more bits) before the
 1070|       |   * request is sent, and then it is again set _after_ all response 401/407
 1071|       |   * headers have been received but then only to a single preferred method
 1072|       |   * (bit).
 1073|       |   */
 1074|       |
 1075|    482|  while(*auth) {
  ------------------
  |  Branch (1075:9): [True: 451, False: 31]
  ------------------
 1076|       |#ifdef USE_SPNEGO
 1077|       |    if(authcmp("Negotiate", auth))
 1078|       |      result = auth_spnego(data, proxy, auth, authp, availp);
 1079|       |#endif
 1080|       |#ifdef USE_NTLM
 1081|       |    if(!result && authcmp("NTLM", auth))
 1082|       |      result = auth_ntlm(data, proxy, auth, authp, availp);
 1083|       |#endif
 1084|    451|#ifndef CURL_DISABLE_DIGEST_AUTH
 1085|    451|    if(!result && authcmp("Digest", auth))
  ------------------
  |  Branch (1085:8): [True: 451, False: 0]
  |  Branch (1085:19): [True: 0, False: 451]
  ------------------
 1086|      0|      result = auth_digest(data, proxy, auth, authp, availp);
 1087|    451|#endif
 1088|    451|#ifndef CURL_DISABLE_BASIC_AUTH
 1089|    451|    if(!result && authcmp("Basic", auth))
  ------------------
  |  Branch (1089:8): [True: 451, False: 0]
  |  Branch (1089:19): [True: 0, False: 451]
  ------------------
 1090|      0|      result = auth_basic(data, authp, availp);
 1091|    451|#endif
 1092|    451|#ifndef CURL_DISABLE_BEARER_AUTH
 1093|    451|    if(authcmp("Bearer", auth))
  ------------------
  |  Branch (1093:8): [True: 0, False: 451]
  ------------------
 1094|      0|      result = auth_bearer(data, authp, availp);
 1095|    451|#endif
 1096|       |
 1097|    451|    if(result)
  ------------------
  |  Branch (1097:8): [True: 0, False: 451]
  ------------------
 1098|      0|      break;
 1099|       |
 1100|       |    /* there may be multiple methods on one line, so keep reading */
 1101|    451|    auth = strchr(auth, ',');
 1102|    451|    if(auth) /* if we are on a comma, skip it */
  ------------------
  |  Branch (1102:8): [True: 370, False: 81]
  ------------------
 1103|    370|      auth++;
 1104|     81|    else
 1105|     81|      break;
 1106|    370|    curlx_str_passblanks(&auth);
 1107|    370|  }
 1108|    112|  return result;
 1109|       |#else
 1110|       |  (void)data;
 1111|       |  (void)proxy;
 1112|       |  (void)auth;
 1113|       |  /* nothing to do when disabled */
 1114|       |  return CURLE_OK;
 1115|       |#endif
 1116|    112|}
Curl_http_follow:
 1142|    949|{
 1143|    949|  bool disallowport = FALSE;
  ------------------
  |  | 1058|    949|#define FALSE false
  ------------------
 1144|    949|  bool reachedmax = FALSE;
  ------------------
  |  | 1058|    949|#define FALSE false
  ------------------
 1145|    949|  char *follow_url = NULL;
 1146|    949|  CURLUcode uc;
 1147|    949|  CURLcode rewind_result;
 1148|    949|  bool switch_to_get = FALSE;
  ------------------
  |  | 1058|    949|#define FALSE false
  ------------------
 1149|       |
 1150|    949|  DEBUGASSERT(type != FOLLOW_NONE);
  ------------------
  |  | 1081|    949|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1150:3): [True: 0, False: 949]
  |  Branch (1150:3): [True: 949, False: 0]
  ------------------
 1151|       |
 1152|    949|  if(type != FOLLOW_FAKE)
  ------------------
  |  Branch (1152:6): [True: 858, False: 91]
  ------------------
 1153|    858|    data->state.requests++; /* count all real follows */
 1154|    949|  if(type == FOLLOW_REDIR) {
  ------------------
  |  Branch (1154:6): [True: 418, False: 531]
  ------------------
 1155|    418|    if((data->set.maxredirs != -1) &&
  ------------------
  |  Branch (1155:8): [True: 418, False: 0]
  ------------------
 1156|    418|       (data->state.followlocation >= data->set.maxredirs)) {
  ------------------
  |  Branch (1156:8): [True: 0, False: 418]
  ------------------
 1157|      0|      reachedmax = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1158|      0|      type = FOLLOW_FAKE; /* switch to fake to store the would-be-redirected
 1159|       |                             to URL */
 1160|      0|    }
 1161|    418|    else {
 1162|    418|      data->state.followlocation++; /* count redirect-followings, including
 1163|       |                                       auth reloads */
 1164|       |
 1165|    418|      if(data->set.http_auto_referer) {
  ------------------
  |  Branch (1165:10): [True: 16, False: 402]
  ------------------
 1166|     16|        CURLU *u;
 1167|     16|        char *referer = NULL;
 1168|       |
 1169|       |        /* We are asked to automatically set the previous URL as the referer
 1170|       |           when we get the next URL. We pick the ->url field, which may or may
 1171|       |           not be 100% correct */
 1172|     16|        Curl_bufref_free(&data->state.referer);
 1173|       |
 1174|       |        /* Make a copy of the URL without credentials and fragment */
 1175|     16|        u = curl_url();
 1176|     16|        if(!u)
  ------------------
  |  Branch (1176:12): [True: 0, False: 16]
  ------------------
 1177|      0|          return CURLE_OUT_OF_MEMORY;
 1178|       |
 1179|     16|        uc = curl_url_set(u, CURLUPART_URL,
 1180|     16|                          Curl_bufref_ptr(&data->state.url), 0);
 1181|     16|        if(!uc)
  ------------------
  |  Branch (1181:12): [True: 16, False: 0]
  ------------------
 1182|     16|          uc = curl_url_set(u, CURLUPART_FRAGMENT, NULL, 0);
 1183|     16|        if(!uc)
  ------------------
  |  Branch (1183:12): [True: 16, False: 0]
  ------------------
 1184|     16|          uc = curl_url_set(u, CURLUPART_USER, NULL, 0);
 1185|     16|        if(!uc)
  ------------------
  |  Branch (1185:12): [True: 16, False: 0]
  ------------------
 1186|     16|          uc = curl_url_set(u, CURLUPART_PASSWORD, NULL, 0);
 1187|     16|        if(!uc)
  ------------------
  |  Branch (1187:12): [True: 16, False: 0]
  ------------------
 1188|     16|          uc = curl_url_get(u, CURLUPART_URL, &referer, 0);
 1189|       |
 1190|     16|        curl_url_cleanup(u);
 1191|       |
 1192|     16|        if(uc || !referer)
  ------------------
  |  Branch (1192:12): [True: 0, False: 16]
  |  Branch (1192:18): [True: 0, False: 16]
  ------------------
 1193|      0|          return CURLE_OUT_OF_MEMORY;
 1194|       |
 1195|     16|        Curl_bufref_set(&data->state.referer, referer, 0, curl_free);
 1196|     16|      }
 1197|    418|    }
 1198|    418|  }
 1199|       |
 1200|    949|  if((type != FOLLOW_RETRY) &&
  ------------------
  |  Branch (1200:6): [True: 509, False: 440]
  ------------------
 1201|    509|     (data->req.httpcode != 401) && (data->req.httpcode != 407) &&
  ------------------
  |  Branch (1201:6): [True: 508, False: 1]
  |  Branch (1201:37): [True: 507, False: 1]
  ------------------
 1202|    507|     Curl_is_absolute_url(newurl, NULL, 0, FALSE)) {
  ------------------
  |  | 1058|    507|#define FALSE false
  ------------------
  |  Branch (1202:6): [True: 10, False: 497]
  ------------------
 1203|       |    /* If this is not redirect due to a 401 or 407 response and an absolute
 1204|       |       URL: do not allow a custom port number */
 1205|     10|    disallowport = TRUE;
  ------------------
  |  | 1055|     10|#define TRUE true
  ------------------
 1206|     10|  }
 1207|       |
 1208|    949|  DEBUGASSERT(data->state.uh);
  ------------------
  |  | 1081|    949|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1208:3): [True: 0, False: 949]
  |  Branch (1208:3): [True: 949, False: 0]
  ------------------
 1209|    949|  uc = curl_url_set(data->state.uh, CURLUPART_URL, newurl, (unsigned int)
 1210|    949|                    ((type == FOLLOW_FAKE) ? CURLU_NON_SUPPORT_SCHEME :
  ------------------
  |  |   90|     91|#define CURLU_NON_SUPPORT_SCHEME (1 << 3) /* allow non-supported scheme */
  ------------------
  |  Branch (1210:22): [True: 91, False: 858]
  ------------------
 1211|    949|                     ((type == FOLLOW_REDIR) ? CURLU_URLENCODE : 0) |
  ------------------
  |  |   94|    418|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1211:23): [True: 418, False: 440]
  ------------------
 1212|    858|                     CURLU_ALLOW_SPACE |
  ------------------
  |  |   99|    858|#define CURLU_ALLOW_SPACE (1 << 11)       /* Allow spaces in the URL */
  ------------------
 1213|    858|                     (data->set.path_as_is ? CURLU_PATH_AS_IS : 0)));
  ------------------
  |  |   91|      1|#define CURLU_PATH_AS_IS (1 << 4)         /* leave dot sequences */
  ------------------
  |  Branch (1213:23): [True: 1, False: 857]
  ------------------
 1214|    949|  if(uc) {
  ------------------
  |  Branch (1214:6): [True: 12, False: 937]
  ------------------
 1215|     12|    if((uc == CURLUE_OUT_OF_MEMORY) || (type != FOLLOW_FAKE)) {
  ------------------
  |  Branch (1215:8): [True: 0, False: 12]
  |  Branch (1215:40): [True: 2, False: 10]
  ------------------
 1216|      2|      failf(data, "The redirect target URL could not be parsed: %s",
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
 1217|      2|            curl_url_strerror(uc));
 1218|      2|      return Curl_uc_to_curlcode(uc);
 1219|      2|    }
 1220|       |
 1221|       |    /* the URL could not be parsed for some reason, but since this is FAKE
 1222|       |       mode, duplicate the field as-is */
 1223|     10|    follow_url = curlx_strdup(newurl);
  ------------------
  |  | 1477|     10|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1224|     10|    if(!follow_url)
  ------------------
  |  Branch (1224:8): [True: 0, False: 10]
  ------------------
 1225|      0|      return CURLE_OUT_OF_MEMORY;
 1226|     10|  }
 1227|    937|  else {
 1228|    937|    CURLU *u = curl_url();
 1229|    937|    if(!u)
  ------------------
  |  Branch (1229:8): [True: 0, False: 937]
  ------------------
 1230|      0|      return CURLE_OUT_OF_MEMORY;
 1231|    937|    uc = curl_url_set(u, CURLUPART_URL,
 1232|    937|                      Curl_bufref_ptr(&data->state.url),
 1233|    937|                      CURLU_URLENCODE | CURLU_ALLOW_SPACE);
  ------------------
  |  |   94|    937|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
                                    CURLU_URLENCODE | CURLU_ALLOW_SPACE);
  ------------------
  |  |   99|    937|#define CURLU_ALLOW_SPACE (1 << 11)       /* Allow spaces in the URL */
  ------------------
 1234|    937|    if(!uc)
  ------------------
  |  Branch (1234:8): [True: 937, False: 0]
  ------------------
 1235|    937|      uc = curl_url_get(data->state.uh, CURLUPART_URL, &follow_url, 0);
 1236|    937|    if(uc) {
  ------------------
  |  Branch (1236:8): [True: 0, False: 937]
  ------------------
 1237|      0|      curl_url_cleanup(u);
 1238|      0|      return Curl_uc_to_curlcode(uc);
 1239|      0|    }
 1240|       |
 1241|    937|#ifndef CURL_DISABLE_DIGEST_AUTH
 1242|    937|    {
 1243|    937|      bool same_origin = Curl_url_same_origin(u, data->state.uh);
 1244|    937|      curl_url_cleanup(u);
 1245|    937|      if(!same_origin)
  ------------------
  |  Branch (1245:10): [True: 16, False: 921]
  ------------------
 1246|     16|        Curl_auth_digest_cleanup(&data->state.digest);
 1247|    937|    }
 1248|       |#else
 1249|       |    curl_url_cleanup(u);
 1250|       |#endif
 1251|    937|  }
 1252|    947|  DEBUGASSERT(follow_url);
  ------------------
  |  | 1081|    947|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1252:3): [True: 0, False: 947]
  |  Branch (1252:3): [True: 947, False: 0]
  ------------------
 1253|       |
 1254|    947|  if(type == FOLLOW_FAKE) {
  ------------------
  |  Branch (1254:6): [True: 91, False: 856]
  ------------------
 1255|       |    /* we are only figuring out the new URL if we would have followed locations
 1256|       |       but now we are done so we can get out! */
 1257|     91|    data->info.wouldredirect = follow_url;
 1258|       |
 1259|     91|    if(reachedmax) {
  ------------------
  |  Branch (1259:8): [True: 0, False: 91]
  ------------------
 1260|      0|      failf(data, "Maximum (%d) redirects followed", data->set.maxredirs);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1261|      0|      return CURLE_TOO_MANY_REDIRECTS;
 1262|      0|    }
 1263|     91|    return CURLE_OK;
 1264|     91|  }
 1265|       |
 1266|    856|  if(disallowport)
  ------------------
  |  Branch (1266:6): [True: 3, False: 853]
  ------------------
 1267|      3|    data->state.allow_port = FALSE;
  ------------------
  |  | 1058|      3|#define FALSE false
  ------------------
 1268|       |
 1269|    856|  Curl_bufref_set(&data->state.url, follow_url, 0, curl_free);
 1270|    856|  rewind_result = Curl_req_soft_reset(&data->req, data);
 1271|    856|  infof(data, "Issue another request to this URL: '%s'", follow_url);
  ------------------
  |  |  143|    856|  do {                               \
  |  |  144|    856|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    856|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 856, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 856]
  |  |  |  |  ------------------
  |  |  |  |  320|    856|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    856|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    856|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 856]
  |  |  ------------------
  ------------------
 1272|    856|  if((data->set.http_follow_mode == CURLFOLLOW_FIRSTONLY) &&
  ------------------
  |  |  186|    856|#define CURLFOLLOW_FIRSTONLY 3L
  ------------------
  |  Branch (1272:6): [True: 335, False: 521]
  ------------------
 1273|    335|     data->set.str[STRING_CUSTOMREQUEST] &&
  ------------------
  |  Branch (1273:6): [True: 56, False: 279]
  ------------------
 1274|     56|     !data->state.http_ignorecustom) {
  ------------------
  |  Branch (1274:6): [True: 30, False: 26]
  ------------------
 1275|     30|    data->state.http_ignorecustom = TRUE;
  ------------------
  |  | 1055|     30|#define TRUE true
  ------------------
 1276|     30|    infof(data, "Drop custom request method for next request");
  ------------------
  |  |  143|     30|  do {                               \
  |  |  144|     30|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     30|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 30, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 30]
  |  |  |  |  ------------------
  |  |  |  |  320|     30|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     30|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     30|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 30]
  |  |  ------------------
  ------------------
 1277|     30|  }
 1278|       |
 1279|       |  /*
 1280|       |   * We get here when the HTTP code is 300-399 (and 401). We need to perform
 1281|       |   * differently based on exactly what return code there was.
 1282|       |   *
 1283|       |   * News from 7.10.6: we can also get here on a 401 or 407, in case we act on
 1284|       |   * an HTTP (proxy-) authentication scheme other than Basic.
 1285|       |   */
 1286|    856|  switch(data->info.httpcode) {
 1287|       |    /* 401 - Act on a WWW-Authenticate, we keep on moving and do the
 1288|       |       Authorization: XXXX header in the HTTP request code snippet */
 1289|       |    /* 407 - Act on a Proxy-Authenticate, we keep on moving and do the
 1290|       |       Proxy-Authorization: XXXX header in the HTTP request code snippet */
 1291|       |    /* 300 - Multiple Choices */
 1292|       |    /* 306 - Not used */
 1293|       |    /* 307 - Temporary Redirect */
 1294|    383|  default: /* for all above (and the unknown ones) */
  ------------------
  |  Branch (1294:3): [True: 383, False: 473]
  ------------------
 1295|       |    /* Some codes are explicitly mentioned since I have checked RFC2616 and
 1296|       |     * they seem to be OK to POST to.
 1297|       |     */
 1298|    383|    break;
 1299|    383|  case 301: /* Moved Permanently */
  ------------------
  |  Branch (1299:3): [True: 10, False: 846]
  ------------------
 1300|       |    /* (quote from RFC7231, section 6.4.2)
 1301|       |     *
 1302|       |     * Note: For historical reasons, a user agent MAY change the request
 1303|       |     * method from POST to GET for the subsequent request. If this
 1304|       |     * behavior is undesired, the 307 (Temporary Redirect) status code
 1305|       |     * can be used instead.
 1306|       |     *
 1307|       |     * ----
 1308|       |     *
 1309|       |     * Many webservers expect this, so these servers often answers to a POST
 1310|       |     * request with an error page. To be sure that libcurl gets the page that
 1311|       |     * most user agents would get, libcurl has to force GET.
 1312|       |     *
 1313|       |     * This behavior is forbidden by RFC1945 and the obsolete RFC2616, and
 1314|       |     * can be overridden with CURLOPT_POSTREDIR.
 1315|       |     */
 1316|     10|    if(HTTPREQ_IS_POST(data) && !data->set.post301) {
  ------------------
  |  | 1136|     20|  ((data)->state.httpreq == HTTPREQ_POST ||      \
  |  |  ------------------
  |  |  |  Branch (1136:4): [True: 2, False: 8]
  |  |  ------------------
  |  | 1137|     10|   (data)->state.httpreq == HTTPREQ_POST_FORM || \
  |  |  ------------------
  |  |  |  Branch (1137:4): [True: 2, False: 6]
  |  |  ------------------
  |  | 1138|     20|   (data)->state.httpreq == HTTPREQ_POST_MIME)
  |  |  ------------------
  |  |  |  Branch (1138:4): [True: 1, False: 5]
  |  |  ------------------
  ------------------
  |  Branch (1316:33): [True: 2, False: 3]
  ------------------
 1317|      2|      http_switch_to_get(data, 301);
 1318|      2|      switch_to_get = TRUE;
  ------------------
  |  | 1055|      2|#define TRUE true
  ------------------
 1319|      2|    }
 1320|     10|    break;
 1321|     10|  case 302: /* Found */
  ------------------
  |  Branch (1321:3): [True: 10, False: 846]
  ------------------
 1322|       |    /* (quote from RFC7231, section 6.4.3)
 1323|       |     *
 1324|       |     * Note: For historical reasons, a user agent MAY change the request
 1325|       |     * method from POST to GET for the subsequent request. If this
 1326|       |     * behavior is undesired, the 307 (Temporary Redirect) status code
 1327|       |     * can be used instead.
 1328|       |     *
 1329|       |     * ----
 1330|       |     *
 1331|       |     * Many webservers expect this, so these servers often answers to a POST
 1332|       |     * request with an error page. To be sure that libcurl gets the page that
 1333|       |     * most user agents would get, libcurl has to force GET.
 1334|       |     *
 1335|       |     * This behavior is forbidden by RFC1945 and the obsolete RFC2616, and
 1336|       |     * can be overridden with CURLOPT_POSTREDIR.
 1337|       |     */
 1338|     10|    if(HTTPREQ_IS_POST(data) && !data->set.post302) {
  ------------------
  |  | 1136|     20|  ((data)->state.httpreq == HTTPREQ_POST ||      \
  |  |  ------------------
  |  |  |  Branch (1136:4): [True: 1, False: 9]
  |  |  ------------------
  |  | 1137|     10|   (data)->state.httpreq == HTTPREQ_POST_FORM || \
  |  |  ------------------
  |  |  |  Branch (1137:4): [True: 1, False: 8]
  |  |  ------------------
  |  | 1138|     20|   (data)->state.httpreq == HTTPREQ_POST_MIME)
  |  |  ------------------
  |  |  |  Branch (1138:4): [True: 1, False: 7]
  |  |  ------------------
  ------------------
  |  Branch (1338:33): [True: 3, False: 0]
  ------------------
 1339|      3|      http_switch_to_get(data, 302);
 1340|      3|      switch_to_get = TRUE;
  ------------------
  |  | 1055|      3|#define TRUE true
  ------------------
 1341|      3|    }
 1342|     10|    break;
 1343|       |
 1344|     14|  case 303: /* See Other */
  ------------------
  |  Branch (1344:3): [True: 14, False: 842]
  ------------------
 1345|       |    /* 'See Other' location is not the resource but a substitute for the
 1346|       |     * resource. In this case we switch the method to GET/HEAD, unless the
 1347|       |     * method is POST and the user specified to keep it as POST.
 1348|       |     */
 1349|     14|    if(!HTTPREQ_IS_POST(data) || !data->set.post303) {
  ------------------
  |  | 1136|     28|  ((data)->state.httpreq == HTTPREQ_POST ||      \
  |  |  ------------------
  |  |  |  Branch (1136:4): [True: 0, False: 14]
  |  |  ------------------
  |  | 1137|     14|   (data)->state.httpreq == HTTPREQ_POST_FORM || \
  |  |  ------------------
  |  |  |  Branch (1137:4): [True: 2, False: 12]
  |  |  ------------------
  |  | 1138|     28|   (data)->state.httpreq == HTTPREQ_POST_MIME)
  |  |  ------------------
  |  |  |  Branch (1138:4): [True: 4, False: 8]
  |  |  ------------------
  ------------------
  |  Branch (1349:34): [True: 6, False: 0]
  ------------------
 1350|     14|      http_switch_to_get(data, 303);
 1351|     14|      switch_to_get = TRUE;
  ------------------
  |  | 1055|     14|#define TRUE true
  ------------------
 1352|     14|    }
 1353|     14|    break;
 1354|    436|  case 304: /* Not Modified */
  ------------------
  |  Branch (1354:3): [True: 436, False: 420]
  ------------------
 1355|       |    /* 304 means we did a conditional request and it was "Not modified".
 1356|       |     * We should not get any Location: header in this response!
 1357|       |     */
 1358|    436|    break;
 1359|      3|  case 305: /* Use Proxy */
  ------------------
  |  Branch (1359:3): [True: 3, False: 853]
  ------------------
 1360|       |    /* (quote from RFC2616, section 10.3.6):
 1361|       |     * "The requested resource MUST be accessed through the proxy given
 1362|       |     * by the Location field. The Location field gives the URI of the
 1363|       |     * proxy. The recipient is expected to repeat this single request
 1364|       |     * via the proxy. 305 responses MUST only be generated by origin
 1365|       |     * servers."
 1366|       |     */
 1367|      3|    break;
 1368|    856|  }
 1369|       |
 1370|       |  /* When rewind of upload data failed and we are not switching to GET,
 1371|       |   * we need to fail the follow, as we cannot send the data again. */
 1372|    856|  if(rewind_result && !switch_to_get)
  ------------------
  |  Branch (1372:6): [True: 62, False: 794]
  |  Branch (1372:23): [True: 56, False: 6]
  ------------------
 1373|     56|    return rewind_result;
 1374|       |
 1375|    800|  Curl_pgrsTime(data, TIMER_REDIRECT);
 1376|    800|  Curl_pgrsResetTransferSizes(data);
 1377|       |
 1378|    800|  return CURLE_OK;
 1379|    856|}
Curl_compareheader:
 1394|  80.2k|{
 1395|       |  /* RFC2616, section 4.2 says: "Each header field consists of a name followed
 1396|       |   * by a colon (":") and the field value. Field names are case-insensitive.
 1397|       |   * The field value MAY be preceded by any amount of LWS, though a single SP
 1398|       |   * is preferred." */
 1399|       |
 1400|  80.2k|  const char *p;
 1401|  80.2k|  struct Curl_str val;
 1402|  80.2k|  DEBUGASSERT(hlen);
  ------------------
  |  | 1081|  80.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1402:3): [True: 0, False: 80.2k]
  |  Branch (1402:3): [True: 80.2k, False: 0]
  ------------------
 1403|  80.2k|  DEBUGASSERT(clen);
  ------------------
  |  | 1081|  80.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1403:3): [True: 0, False: 80.2k]
  |  Branch (1403:3): [True: 80.2k, False: 0]
  ------------------
 1404|  80.2k|  DEBUGASSERT(header);
  ------------------
  |  | 1081|  80.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1404:3): [True: 0, False: 80.2k]
  |  Branch (1404:3): [True: 80.2k, False: 0]
  ------------------
 1405|  80.2k|  DEBUGASSERT(content);
  ------------------
  |  | 1081|  80.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1405:3): [True: 0, False: 80.2k]
  |  Branch (1405:3): [True: 80.2k, False: 0]
  ------------------
 1406|       |
 1407|  80.2k|  if(!curl_strnequal(headerline, header, hlen))
  ------------------
  |  Branch (1407:6): [True: 79.4k, False: 819]
  ------------------
 1408|  79.4k|    return FALSE; /* does not start with header */
  ------------------
  |  | 1058|  79.4k|#define FALSE false
  ------------------
 1409|       |
 1410|       |  /* pass the header */
 1411|    819|  p = &headerline[hlen];
 1412|       |
 1413|    819|  if(curlx_str_untilnl(&p, &val, MAX_HTTP_RESP_HEADER_SIZE))
  ------------------
  |  |  153|    819|#define MAX_HTTP_RESP_HEADER_SIZE (300 * 1024)
  ------------------
  |  Branch (1413:6): [True: 21, False: 798]
  ------------------
 1414|     21|    return FALSE;
  ------------------
  |  | 1058|     21|#define FALSE false
  ------------------
 1415|    798|  curlx_str_trimblanks(&val);
 1416|       |
 1417|       |  /* find the content string in the rest of the line */
 1418|    798|  if(curlx_strlen(&val) >= clen) {
  ------------------
  |  |   50|    798|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (1418:6): [True: 550, False: 248]
  ------------------
 1419|    550|    size_t len;
 1420|    550|    p = curlx_str(&val);
  ------------------
  |  |   49|    550|#define curlx_str(x)    ((x)->str)
  ------------------
 1421|  1.35k|    for(len = curlx_strlen(&val); len >= clen;) {
  ------------------
  |  |   50|    550|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (1421:35): [True: 1.28k, False: 69]
  ------------------
 1422|  1.28k|      struct Curl_str next;
 1423|  1.28k|      const char *o = p;
 1424|       |      /* after a match there must be a comma, space, newline or null byte */
 1425|  1.28k|      if(curl_strnequal(p, content, clen) &&
  ------------------
  |  Branch (1425:10): [True: 284, False: 1.00k]
  ------------------
 1426|    284|         ((p[clen] == ',') || ISBLANK(p[clen]) || ISNEWLINE(p[clen]) ||
  ------------------
  |  |   45|    543|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 45, False: 214]
  |  |  |  Branch (45:38): [True: 18, False: 196]
  |  |  ------------------
  ------------------
                       ((p[clen] == ',') || ISBLANK(p[clen]) || ISNEWLINE(p[clen]) ||
  ------------------
  |  |   50|    480|#define ISNEWLINE(x)    (((x) == '\n') || (x) == '\r')
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 26, False: 170]
  |  |  |  Branch (50:43): [True: 8, False: 162]
  |  |  ------------------
  ------------------
  |  Branch (1426:11): [True: 25, False: 259]
  ------------------
 1427|    162|          !p[clen]))
  ------------------
  |  Branch (1427:11): [True: 120, False: 42]
  ------------------
 1428|    242|        return TRUE; /* match! */
  ------------------
  |  | 1055|    242|#define TRUE true
  ------------------
 1429|       |      /* advance to the next comma */
 1430|  1.04k|      if(curlx_str_until(&p, &next, MAX_HTTP_RESP_HEADER_SIZE, ',') ||
  ------------------
  |  |  153|  1.04k|#define MAX_HTTP_RESP_HEADER_SIZE (300 * 1024)
  ------------------
  |  Branch (1430:10): [True: 10, False: 1.03k]
  ------------------
 1431|  1.03k|         curlx_str_single(&p, ','))
  ------------------
  |  Branch (1431:10): [True: 229, False: 806]
  ------------------
 1432|    239|        break; /* no comma, get out */
 1433|       |
 1434|       |      /* if there are more dummy commas, move over them as well */
 1435|    806|      do
 1436|  1.06k|        curlx_str_passblanks(&p);
 1437|  1.06k|      while(!curlx_str_single(&p, ','));
  ------------------
  |  Branch (1437:13): [True: 261, False: 806]
  ------------------
 1438|    806|      len -= (p - o);
 1439|    806|    }
 1440|    550|  }
 1441|    556|  return FALSE; /* no match */
  ------------------
  |  | 1058|    556|#define FALSE false
  ------------------
 1442|    798|}
Curl_http_perform_pollset:
 1595|  3.26M|{
 1596|  3.26M|  struct connectdata *conn = data->conn;
 1597|  3.26M|  CURLcode result = CURLE_OK;
 1598|       |
 1599|  3.26M|  if(CURL_REQ_WANT_RECV(data)) {
  ------------------
  |  |   40|  3.26M|#define CURL_REQ_WANT_RECV(d)  ((d)->req.io_flags & REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|  3.26M|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  |  |  |  Branch (40:32): [True: 3.26M, False: 2]
  |  |  ------------------
  ------------------
 1600|  3.26M|    result = Curl_pollset_add_in(data, ps, conn->sock[FIRSTSOCKET]);
  ------------------
  |  |  162|  3.26M|  Curl_pollset_change(data, ps, sock, CURL_POLL_IN, 0)
  |  |  ------------------
  |  |  |  |  283|  3.26M|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
 1601|  3.26M|  }
 1602|       |
 1603|       |  /* on a "Expect: 100-continue" timed wait, do not poll for outgoing */
 1604|  3.26M|  if(!result && Curl_req_want_send(data) && !http_exp100_is_waiting(data)) {
  ------------------
  |  Branch (1604:6): [True: 3.26M, False: 0]
  |  Branch (1604:17): [True: 3.25M, False: 8.22k]
  |  Branch (1604:45): [True: 3.25M, False: 477]
  ------------------
 1605|  3.25M|    result = Curl_pollset_add_out(data, ps, conn->sock[FIRSTSOCKET]);
  ------------------
  |  |  166|  3.25M|  Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, 0)
  |  |  ------------------
  |  |  |  |  284|  3.25M|#define CURL_POLL_OUT    2
  |  |  ------------------
  ------------------
 1606|  3.25M|  }
 1607|  3.26M|  return result;
 1608|  3.26M|}
Curl_http_done:
 1644|  6.85k|{
 1645|  6.85k|  struct connectdata *conn = data->conn;
 1646|       |
 1647|       |  /* Clear multipass flag. If authentication is not done yet, then it will get
 1648|       |   * a chance to be set back to true when we output the next auth header */
 1649|  6.85k|  data->state.authhost.multipass = FALSE;
  ------------------
  |  | 1058|  6.85k|#define FALSE false
  ------------------
 1650|  6.85k|  data->state.authproxy.multipass = FALSE;
  ------------------
  |  | 1058|  6.85k|#define FALSE false
  ------------------
 1651|       |
 1652|  6.85k|  if(curlx_dyn_len(&data->state.headerb)) {
  ------------------
  |  Branch (1652:6): [True: 719, False: 6.13k]
  ------------------
 1653|    719|    (void)http_write_header(data, curlx_dyn_ptr(&data->state.headerb),
 1654|    719|                            curlx_dyn_len(&data->state.headerb));
 1655|    719|  }
 1656|  6.85k|  curlx_dyn_reset(&data->state.headerb);
 1657|       |
 1658|  6.85k|  if(status)
  ------------------
  |  Branch (1658:6): [True: 5.25k, False: 1.60k]
  ------------------
 1659|  5.25k|    return status;
 1660|       |
 1661|  1.60k|  if(!premature && /* this check is pointless when DONE is called before the
  ------------------
  |  Branch (1661:6): [True: 1.43k, False: 168]
  ------------------
 1662|       |                      entire operation is complete */
 1663|  1.43k|     !conn->bits.retry &&
  ------------------
  |  Branch (1663:6): [True: 1.02k, False: 418]
  ------------------
 1664|  1.02k|     !data->set.connect_only &&
  ------------------
  |  Branch (1664:6): [True: 1.01k, False: 2]
  ------------------
 1665|  1.01k|     (data->req.bytecount +
  ------------------
  |  Branch (1665:6): [True: 171, False: 847]
  ------------------
 1666|  1.01k|      data->req.headerbytecount -
 1667|  1.01k|      data->req.deductheadercount) <= 0) {
 1668|       |    /* If this connection is not closed to be retried, AND nothing was
 1669|       |       read from the HTTP server (that counts), this cannot be right so we
 1670|       |       return an error here */
 1671|    171|    failf(data, "Empty reply from server");
  ------------------
  |  |   62|    171|#define failf Curl_failf
  ------------------
 1672|       |    /* Mark it as closed to avoid the "left intact" message */
 1673|    171|    streamclose(conn, "Empty reply from server");
  ------------------
  |  |  102|    171|#define streamclose(x, y) Curl_conncontrol(x, CONNCTRL_STREAM, y)
  |  |  ------------------
  |  |  |  |   92|    171|#define CONNCTRL_STREAM     2
  |  |  ------------------
  ------------------
 1674|    171|    return CURLE_GOT_NOTHING;
 1675|    171|  }
 1676|       |
 1677|  1.43k|  return CURLE_OK;
 1678|  1.60k|}
Curl_add_custom_headers:
 1727|  6.82k|{
 1728|  6.82k|  struct curl_slist *h[2];
 1729|  6.82k|  struct curl_slist *headers;
 1730|  6.82k|  int numlists = 1; /* by default */
 1731|  6.82k|  int i;
 1732|       |
 1733|  6.82k|#ifndef CURL_DISABLE_PROXY
 1734|  6.82k|  enum Curl_proxy_use proxy;
 1735|       |
 1736|  6.82k|  if(is_connect)
  ------------------
  |  Branch (1736:6): [True: 0, False: 6.82k]
  ------------------
 1737|      0|    proxy = HEADER_CONNECT;
 1738|  6.82k|  else
 1739|  6.82k|    proxy = data->conn->bits.httpproxy && !data->conn->bits.tunnel_proxy ?
  ------------------
  |  Branch (1739:13): [True: 6.82k, False: 0]
  |  Branch (1739:43): [True: 126, False: 6.69k]
  ------------------
 1740|  6.69k|      HEADER_PROXY : HEADER_SERVER;
 1741|       |
 1742|  6.82k|  switch(proxy) {
  ------------------
  |  Branch (1742:10): [True: 6.82k, False: 0]
  ------------------
 1743|  6.69k|  case HEADER_SERVER:
  ------------------
  |  Branch (1743:3): [True: 6.69k, False: 126]
  ------------------
 1744|  6.69k|    h[0] = data->set.headers;
 1745|  6.69k|    break;
 1746|    126|  case HEADER_PROXY:
  ------------------
  |  Branch (1746:3): [True: 126, False: 6.69k]
  ------------------
 1747|    126|    h[0] = data->set.headers;
 1748|    126|    if(data->set.sep_headers) {
  ------------------
  |  Branch (1748:8): [True: 120, False: 6]
  ------------------
 1749|    120|      h[1] = data->set.proxyheaders;
 1750|    120|      numlists++;
 1751|    120|    }
 1752|    126|    break;
 1753|      0|  case HEADER_CONNECT:
  ------------------
  |  Branch (1753:3): [True: 0, False: 6.82k]
  ------------------
 1754|      0|    if(data->set.sep_headers)
  ------------------
  |  Branch (1754:8): [True: 0, False: 0]
  ------------------
 1755|      0|      h[0] = data->set.proxyheaders;
 1756|      0|    else
 1757|      0|      h[0] = data->set.headers;
 1758|      0|    break;
 1759|      0|  case HEADER_CONNECT_UDP:
  ------------------
  |  Branch (1759:3): [True: 0, False: 6.82k]
  ------------------
 1760|      0|    if(data->set.sep_headers)
  ------------------
  |  Branch (1760:8): [True: 0, False: 0]
  ------------------
 1761|      0|      h[0] = data->set.proxyheaders;
 1762|      0|    else
 1763|      0|      h[0] = data->set.headers;
 1764|      0|    break;
 1765|  6.82k|  }
 1766|       |#else
 1767|       |  (void)is_connect;
 1768|       |  h[0] = data->set.headers;
 1769|       |#endif
 1770|       |
 1771|       |  /* loop through one or two lists */
 1772|  13.7k|  for(i = 0; i < numlists; i++) {
  ------------------
  |  Branch (1772:14): [True: 6.94k, False: 6.82k]
  ------------------
 1773|  11.7k|    for(headers = h[i]; headers; headers = headers->next) {
  ------------------
  |  Branch (1773:25): [True: 4.81k, False: 6.94k]
  ------------------
 1774|  4.81k|      CURLcode result = CURLE_OK;
 1775|  4.81k|      bool blankheader = FALSE;
  ------------------
  |  | 1058|  4.81k|#define FALSE false
  ------------------
 1776|  4.81k|      struct Curl_str name;
 1777|  4.81k|      const char *p = headers->data;
 1778|  4.81k|      const char *origp = p;
 1779|       |
 1780|       |      /* explicitly asked to send header without content is done by a header
 1781|       |         that ends with a semicolon, but there must be no colon present in the
 1782|       |         name */
 1783|  4.81k|      if(!curlx_str_until(&p, &name, MAX_HTTP_RESP_HEADER_SIZE, ';') &&
  ------------------
  |  |  153|  4.81k|#define MAX_HTTP_RESP_HEADER_SIZE (300 * 1024)
  ------------------
  |  Branch (1783:10): [True: 3.65k, False: 1.15k]
  ------------------
 1784|  3.65k|         !curlx_str_single(&p, ';') &&
  ------------------
  |  Branch (1784:10): [True: 310, False: 3.34k]
  ------------------
 1785|    310|         !curlx_str_single(&p, '\0') &&
  ------------------
  |  Branch (1785:10): [True: 59, False: 251]
  ------------------
 1786|     59|         !memchr(curlx_str(&name), ':', curlx_strlen(&name)))
  ------------------
  |  |   49|     59|#define curlx_str(x)    ((x)->str)
  ------------------
                       !memchr(curlx_str(&name), ':', curlx_strlen(&name)))
  ------------------
  |  |   50|     59|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (1786:10): [True: 48, False: 11]
  ------------------
 1787|     48|        blankheader = TRUE;
  ------------------
  |  | 1055|     48|#define TRUE true
  ------------------
 1788|  4.76k|      else {
 1789|  4.76k|        p = origp;
 1790|  4.76k|        if(!curlx_str_until(&p, &name, MAX_HTTP_RESP_HEADER_SIZE, ':') &&
  ------------------
  |  |  153|  4.76k|#define MAX_HTTP_RESP_HEADER_SIZE (300 * 1024)
  ------------------
  |  Branch (1790:12): [True: 3.42k, False: 1.33k]
  ------------------
 1791|  3.42k|           !curlx_str_single(&p, ':')) {
  ------------------
  |  Branch (1791:12): [True: 2.41k, False: 1.01k]
  ------------------
 1792|  2.41k|          struct Curl_str val;
 1793|  2.41k|          curlx_str_untilnl(&p, &val, MAX_HTTP_RESP_HEADER_SIZE);
  ------------------
  |  |  153|  2.41k|#define MAX_HTTP_RESP_HEADER_SIZE (300 * 1024)
  ------------------
 1794|  2.41k|          curlx_str_trimblanks(&val);
 1795|  2.41k|          if(!curlx_strlen(&val))
  ------------------
  |  |   50|  2.41k|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (1795:14): [True: 80, False: 2.33k]
  ------------------
 1796|       |            /* no content, do not send this */
 1797|     80|            continue;
 1798|  2.41k|        }
 1799|  2.34k|        else
 1800|       |          /* no colon */
 1801|  2.34k|          continue;
 1802|  4.76k|      }
 1803|       |
 1804|       |      /* only send this if the contents was non-blank or done special */
 1805|       |
 1806|  2.38k|      if(data->state.aptr.host &&
  ------------------
  |  Branch (1806:10): [True: 2.34k, False: 39]
  ------------------
 1807|       |         /* a Host: header was sent already, do not pass on any custom
 1808|       |            Host: header as that will produce *two* in the same
 1809|       |            request! */
 1810|  2.34k|         curlx_str_casecompare(&name, "Host"))
  ------------------
  |  Branch (1810:10): [True: 31, False: 2.31k]
  ------------------
 1811|     31|        ;
 1812|  2.35k|      else if(data->state.httpreq == HTTPREQ_POST_FORM &&
  ------------------
  |  Branch (1812:15): [True: 502, False: 1.85k]
  ------------------
 1813|       |              /* this header (extended by formdata.c) is sent later */
 1814|    502|              curlx_str_casecompare(&name, "Content-Type"))
  ------------------
  |  Branch (1814:15): [True: 2, False: 500]
  ------------------
 1815|      2|        ;
 1816|  2.35k|      else if(data->state.httpreq == HTTPREQ_POST_MIME &&
  ------------------
  |  Branch (1816:15): [True: 925, False: 1.42k]
  ------------------
 1817|       |              /* this header is sent later */
 1818|    925|              curlx_str_casecompare(&name, "Content-Type"))
  ------------------
  |  Branch (1818:15): [True: 13, False: 912]
  ------------------
 1819|     13|        ;
 1820|  2.33k|      else if(data->req.authneg &&
  ------------------
  |  Branch (1820:15): [True: 14, False: 2.32k]
  ------------------
 1821|       |              /* while doing auth neg, do not allow the custom length since
 1822|       |                 we will force length zero then */
 1823|     14|              curlx_str_casecompare(&name, "Content-Length"))
  ------------------
  |  Branch (1823:15): [True: 0, False: 14]
  ------------------
 1824|      0|        ;
 1825|  2.33k|      else if(curlx_str_casecompare(&name, "Connection"))
  ------------------
  |  Branch (1825:15): [True: 3, False: 2.33k]
  ------------------
 1826|       |        /* Connection headers are handled specially */
 1827|      3|        ;
 1828|  2.33k|      else if((httpversion >= 20) &&
  ------------------
  |  Branch (1828:15): [True: 2.16k, False: 172]
  ------------------
 1829|  2.16k|              curlx_str_casecompare(&name, "Transfer-Encoding"))
  ------------------
  |  Branch (1829:15): [True: 3, False: 2.16k]
  ------------------
 1830|       |        /* HTTP/2 does not support chunked requests */
 1831|      3|        ;
 1832|  2.33k|      else if((curlx_str_casecompare(&name, "Authorization") ||
  ------------------
  |  Branch (1832:16): [True: 11, False: 2.32k]
  ------------------
 1833|  2.32k|               curlx_str_casecompare(&name, "Cookie")) &&
  ------------------
  |  Branch (1833:16): [True: 310, False: 2.01k]
  ------------------
 1834|       |              /* be careful of sending this potentially sensitive header to
 1835|       |                 other hosts */
 1836|    321|              !Curl_auth_allowed_to_host(data))
  ------------------
  |  Branch (1836:15): [True: 0, False: 321]
  ------------------
 1837|      0|        ;
 1838|  2.33k|      else if(blankheader)
  ------------------
  |  Branch (1838:15): [True: 47, False: 2.28k]
  ------------------
 1839|     47|        result = curlx_dyn_addf(req, "%.*s:\r\n", (int)curlx_strlen(&name),
  ------------------
  |  |   50|     47|#define curlx_strlen(x) ((x)->len)
  ------------------
 1840|     47|                                curlx_str(&name));
  ------------------
  |  |   49|     47|#define curlx_str(x)    ((x)->str)
  ------------------
 1841|  2.28k|      else
 1842|  2.28k|        result = curlx_dyn_addf(req, "%s\r\n", origp);
 1843|       |
 1844|  2.38k|      if(result)
  ------------------
  |  Branch (1844:10): [True: 0, False: 2.38k]
  ------------------
 1845|      0|        return result;
 1846|  2.38k|    }
 1847|  6.94k|  }
 1848|       |
 1849|  6.82k|  return CURLE_OK;
 1850|  6.82k|}
Curl_add_timecondition:
 1855|  6.82k|{
 1856|  6.82k|  const struct tm *tm;
 1857|  6.82k|  struct tm keeptime;
 1858|  6.82k|  CURLcode result;
 1859|  6.82k|  char datestr[80];
 1860|  6.82k|  const char *condp;
 1861|  6.82k|  size_t len;
 1862|       |
 1863|  6.82k|  if(data->set.timecondition == CURL_TIMECOND_NONE)
  ------------------
  |  | 2410|  6.82k|#define CURL_TIMECOND_NONE         0L
  ------------------
  |  Branch (1863:6): [True: 6.75k, False: 63]
  ------------------
 1864|       |    /* no condition was asked for */
 1865|  6.75k|    return CURLE_OK;
 1866|       |
 1867|     63|  result = curlx_gmtime(data->set.timevalue, &keeptime);
 1868|     63|  if(result) {
  ------------------
  |  Branch (1868:6): [True: 0, False: 63]
  ------------------
 1869|      0|    failf(data, "Invalid TIMEVALUE");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1870|      0|    return result;
 1871|      0|  }
 1872|     63|  tm = &keeptime;
 1873|       |
 1874|     63|  switch(data->set.timecondition) {
 1875|      0|  default:
  ------------------
  |  Branch (1875:3): [True: 0, False: 63]
  ------------------
 1876|      0|    DEBUGF(infof(data, "invalid time condition"));
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1877|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1878|       |
 1879|      3|  case CURL_TIMECOND_IFMODSINCE:
  ------------------
  |  | 2411|      3|#define CURL_TIMECOND_IFMODSINCE   1L
  ------------------
  |  Branch (1879:3): [True: 3, False: 60]
  ------------------
 1880|      3|    condp = "If-Modified-Since";
 1881|      3|    len = 17;
 1882|      3|    break;
 1883|      4|  case CURL_TIMECOND_IFUNMODSINCE:
  ------------------
  |  | 2412|      4|#define CURL_TIMECOND_IFUNMODSINCE 2L
  ------------------
  |  Branch (1883:3): [True: 4, False: 59]
  ------------------
 1884|      4|    condp = "If-Unmodified-Since";
 1885|      4|    len = 19;
 1886|      4|    break;
 1887|     56|  case CURL_TIMECOND_LASTMOD:
  ------------------
  |  | 2413|     56|#define CURL_TIMECOND_LASTMOD      3L
  ------------------
  |  Branch (1887:3): [True: 56, False: 7]
  ------------------
 1888|     56|    condp = "Last-Modified";
 1889|     56|    len = 13;
 1890|     56|    break;
 1891|     63|  }
 1892|       |
 1893|     63|  if(Curl_checkheaders(data, condp, len)) {
  ------------------
  |  Branch (1893:6): [True: 1, False: 62]
  ------------------
 1894|       |    /* A custom header was specified; it will be sent instead. */
 1895|      1|    return CURLE_OK;
 1896|      1|  }
 1897|       |
 1898|       |  /* The If-Modified-Since header family should have their times set in
 1899|       |   * GMT as RFC2616 defines: "All HTTP date/time stamps MUST be
 1900|       |   * represented in Greenwich Mean Time (GMT), without exception. For the
 1901|       |   * purposes of HTTP, GMT is exactly equal to UTC (Coordinated Universal
 1902|       |   * Time)." (see page 20 of RFC2616).
 1903|       |   */
 1904|       |
 1905|       |  /* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
 1906|     62|  curl_msnprintf(datestr, sizeof(datestr),
 1907|     62|                 "%s: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n",
 1908|     62|                 condp,
 1909|     62|                 Curl_wkday[tm->tm_wday ? tm->tm_wday - 1 : 6],
  ------------------
  |  Branch (1909:29): [True: 62, False: 0]
  ------------------
 1910|     62|                 tm->tm_mday,
 1911|     62|                 Curl_month[tm->tm_mon],
 1912|     62|                 tm->tm_year + 1900,
 1913|     62|                 tm->tm_hour,
 1914|     62|                 tm->tm_min,
 1915|     62|                 tm->tm_sec);
 1916|       |
 1917|     62|  result = curlx_dyn_add(req, datestr);
 1918|     62|  return result;
 1919|     63|}
Curl_http_method:
 1933|  8.87k|{
 1934|  8.87k|  Curl_HttpReq httpreq = (Curl_HttpReq)data->state.httpreq;
 1935|  8.87k|  const char *request;
 1936|  8.87k|#ifndef CURL_DISABLE_WEBSOCKETS
 1937|  8.87k|  if(data->conn->scheme->protocol & (CURLPROTO_WS | CURLPROTO_WSS))
  ------------------
  |  |   63|  8.87k|#define CURLPROTO_WS     (1L << 30)
  ------------------
                if(data->conn->scheme->protocol & (CURLPROTO_WS | CURLPROTO_WSS))
  ------------------
  |  |   64|  8.87k|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  ------------------
  |  Branch (1937:6): [True: 0, False: 8.87k]
  ------------------
 1938|      0|    httpreq = HTTPREQ_GET;
 1939|  8.87k|  else
 1940|  8.87k|#endif
 1941|  8.87k|  if((data->conn->scheme->protocol & (PROTO_FAMILY_HTTP | CURLPROTO_FTP)) &&
  ------------------
  |  |   84|  8.87k|#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1078|  8.87k|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1079|  8.87k|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  |   63|  8.87k|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   85|  8.87k|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   64|  8.87k|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
                if((data->conn->scheme->protocol & (PROTO_FAMILY_HTTP | CURLPROTO_FTP)) &&
  ------------------
  |  | 1080|  8.87k|#define CURLPROTO_FTP     (1L << 2)
  ------------------
  |  Branch (1941:6): [True: 8.85k, False: 22]
  ------------------
 1942|  8.85k|     data->state.upload)
  ------------------
  |  Branch (1942:6): [True: 265, False: 8.59k]
  ------------------
 1943|    265|    httpreq = HTTPREQ_PUT;
 1944|       |
 1945|       |  /* Now set the 'request' pointer to the proper request string */
 1946|  8.87k|  if(data->set.str[STRING_CUSTOMREQUEST] &&
  ------------------
  |  Branch (1946:6): [True: 203, False: 8.67k]
  ------------------
 1947|    203|     !data->state.http_ignorecustom) {
  ------------------
  |  Branch (1947:6): [True: 166, False: 37]
  ------------------
 1948|    166|    request = data->set.str[STRING_CUSTOMREQUEST];
 1949|    166|  }
 1950|  8.71k|  else {
 1951|  8.71k|    if(data->req.no_body)
  ------------------
  |  Branch (1951:8): [True: 42, False: 8.67k]
  ------------------
 1952|     42|      request = "HEAD";
 1953|  8.67k|    else {
 1954|  8.67k|      DEBUGASSERT((httpreq >= HTTPREQ_GET) && (httpreq <= HTTPREQ_HEAD));
  ------------------
  |  | 1081|  8.67k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1954:7): [True: 0, False: 8.67k]
  |  Branch (1954:7): [True: 0, False: 0]
  |  Branch (1954:7): [True: 8.67k, False: 0]
  |  Branch (1954:7): [True: 8.67k, False: 0]
  ------------------
 1955|  8.67k|      switch(httpreq) {
 1956|    339|      case HTTPREQ_POST:
  ------------------
  |  Branch (1956:7): [True: 339, False: 8.33k]
  ------------------
 1957|    625|      case HTTPREQ_POST_FORM:
  ------------------
  |  Branch (1957:7): [True: 286, False: 8.38k]
  ------------------
 1958|  1.15k|      case HTTPREQ_POST_MIME:
  ------------------
  |  Branch (1958:7): [True: 533, False: 8.13k]
  ------------------
 1959|  1.15k|        request = "POST";
 1960|  1.15k|        break;
 1961|    265|      case HTTPREQ_PUT:
  ------------------
  |  Branch (1961:7): [True: 265, False: 8.40k]
  ------------------
 1962|    265|        request = "PUT";
 1963|    265|        break;
 1964|      0|      default: /* this should never happen */
  ------------------
  |  Branch (1964:7): [True: 0, False: 8.67k]
  ------------------
 1965|  7.24k|      case HTTPREQ_GET:
  ------------------
  |  Branch (1965:7): [True: 7.24k, False: 1.42k]
  ------------------
 1966|  7.24k|        request = "GET";
 1967|  7.24k|        break;
 1968|      0|      case HTTPREQ_HEAD:
  ------------------
  |  Branch (1968:7): [True: 0, False: 8.67k]
  ------------------
 1969|      0|        request = "HEAD";
 1970|      0|        break;
 1971|  8.67k|      }
 1972|  8.67k|    }
 1973|  8.71k|  }
 1974|  8.87k|  *method = request;
 1975|  8.87k|  *reqp = httpreq;
 1976|  8.87k|}
Curl_http:
 3018|  6.85k|{
 3019|  6.85k|  CURLcode result = CURLE_OK;
 3020|  6.85k|  Curl_HttpReq httpreq;
 3021|  6.85k|  const char *method;
 3022|  6.85k|  struct dynbuf req;
 3023|  6.85k|  unsigned char httpversion;
 3024|  6.85k|  size_t hd_id;
 3025|       |
 3026|       |  /* Always consider the DO phase done after this function call, even if there
 3027|       |     may be parts of the request that are not yet sent, since we can deal with
 3028|       |     the rest of the request in the PERFORM phase. */
 3029|  6.85k|  *done = TRUE;
  ------------------
  |  | 1055|  6.85k|#define TRUE true
  ------------------
 3030|       |  /* initialize a dynamic send-buffer */
 3031|  6.85k|  curlx_dyn_init(&req, DYN_HTTP_REQUEST);
  ------------------
  |  |   69|  6.85k|#define DYN_HTTP_REQUEST    (1024 * 1024)
  ------------------
 3032|       |  /* make sure the header buffer is reset - if there are leftovers from a
 3033|       |     previous transfer */
 3034|  6.85k|  curlx_dyn_reset(&data->state.headerb);
 3035|  6.85k|  data->state.maybe_folded = FALSE;
  ------------------
  |  | 1058|  6.85k|#define FALSE false
  ------------------
 3036|       |
 3037|  6.85k|  if(!data->conn->bits.reuse) {
  ------------------
  |  Branch (3037:6): [True: 6.76k, False: 91]
  ------------------
 3038|  6.76k|    result = http_check_new_conn(data);
 3039|  6.76k|    if(result)
  ------------------
  |  Branch (3039:8): [True: 0, False: 6.76k]
  ------------------
 3040|      0|      goto out;
 3041|  6.76k|  }
 3042|       |
 3043|       |  /* Add collecting of headers written to client. For a new connection,
 3044|       |   * we might have done that already, but reuse
 3045|       |   * or multiplex needs it here as well. */
 3046|  6.85k|  result = Curl_headers_init(data);
 3047|  6.85k|  if(result)
  ------------------
  |  Branch (3047:6): [True: 0, False: 6.85k]
  ------------------
 3048|      0|    goto out;
 3049|       |
 3050|  6.85k|  data->state.http_hd_te = FALSE;
  ------------------
  |  | 1058|  6.85k|#define FALSE false
  ------------------
 3051|  6.85k|  data->state.http_hd_upgrade = FALSE;
  ------------------
  |  | 1058|  6.85k|#define FALSE false
  ------------------
 3052|  6.85k|  data->state.http_hd_h2_settings = FALSE;
  ------------------
  |  | 1058|  6.85k|#define FALSE false
  ------------------
 3053|       |
 3054|       |  /* what kind of request do we need to send? */
 3055|  6.85k|  Curl_http_method(data, &method, &httpreq);
 3056|       |
 3057|       |  /* select host to send */
 3058|  6.85k|  result = http_set_aptr_host(data);
 3059|       |  /* setup the authentication headers, how that method and host are known */
 3060|  6.85k|  if(!result)
  ------------------
  |  Branch (3060:6): [True: 6.85k, False: 0]
  ------------------
 3061|  6.85k|    result = Curl_http_output_auth(data, data->conn, method, httpreq,
 3062|  6.85k|                                   data->state.up.path,
 3063|  6.85k|                                   data->state.up.query, FALSE);
  ------------------
  |  | 1058|  6.85k|#define FALSE false
  ------------------
 3064|  6.85k|  if(!result)
  ------------------
  |  Branch (3064:6): [True: 6.85k, False: 0]
  ------------------
 3065|  6.85k|    result = http_useragent(data);
 3066|       |  /* Setup input reader, resume information and ranges */
 3067|  6.85k|  if(!result)
  ------------------
  |  Branch (3067:6): [True: 6.85k, False: 0]
  ------------------
 3068|  6.85k|    result = set_reader(data, httpreq);
 3069|  6.85k|  if(!result)
  ------------------
  |  Branch (3069:6): [True: 6.85k, False: 0]
  ------------------
 3070|  6.85k|    result = http_resume(data, httpreq);
 3071|  6.85k|  if(!result)
  ------------------
  |  Branch (3071:6): [True: 6.82k, False: 34]
  ------------------
 3072|  6.82k|    result = http_range(data, httpreq);
 3073|  6.85k|  if(result)
  ------------------
  |  Branch (3073:6): [True: 34, False: 6.82k]
  ------------------
 3074|     34|    goto out;
 3075|       |
 3076|  6.82k|  httpversion = http_request_version(data);
 3077|       |  /* Add request line and all headers to `req` */
 3078|   143k|  for(hd_id = 0; hd_id <= H1_HD_LAST; ++hd_id) {
  ------------------
  |  Branch (3078:18): [True: 136k, False: 6.82k]
  ------------------
 3079|   136k|    result = http_add_hd(data, &req, (http_hd_t)hd_id,
 3080|   136k|                         httpversion, method, httpreq);
 3081|   136k|    if(result)
  ------------------
  |  Branch (3081:8): [True: 1, False: 136k]
  ------------------
 3082|      1|      goto out;
 3083|   136k|  }
 3084|       |
 3085|       |  /* setup variables for the upcoming transfer and send */
 3086|  6.82k|  Curl_xfer_setup_sendrecv(data, FIRSTSOCKET, -1);
  ------------------
  |  |  303|  6.82k|#define FIRSTSOCKET     0
  ------------------
 3087|  6.82k|  result = Curl_req_send(data, &req, httpversion);
 3088|       |
 3089|  6.82k|  if((httpversion >= 20) && data->req.upload_chunky)
  ------------------
  |  Branch (3089:6): [True: 4.43k, False: 2.38k]
  |  Branch (3089:29): [True: 0, False: 4.43k]
  ------------------
 3090|       |    /* upload_chunky was set above to set up the request in a chunky fashion,
 3091|       |       but is disabled here again to avoid that the chunked encoded version is
 3092|       |       actually used when sending the request body over h2 */
 3093|      0|    data->req.upload_chunky = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 3094|       |
 3095|  6.85k|out:
 3096|  6.85k|  if(result == CURLE_TOO_LARGE)
  ------------------
  |  Branch (3096:6): [True: 0, False: 6.85k]
  ------------------
 3097|      0|    failf(data, "HTTP request too large");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3098|       |
 3099|  6.85k|  curlx_dyn_free(&req);
 3100|  6.85k|  return result;
 3101|  6.82k|}
Curl_bump_headersize:
 3841|   103k|{
 3842|   103k|  size_t bad = 0;
 3843|   103k|  unsigned int max = MAX_HTTP_RESP_HEADER_SIZE;
  ------------------
  |  |  153|   103k|#define MAX_HTTP_RESP_HEADER_SIZE (300 * 1024)
  ------------------
 3844|   103k|  if(delta < MAX_HTTP_RESP_HEADER_SIZE) {
  ------------------
  |  |  153|   103k|#define MAX_HTTP_RESP_HEADER_SIZE (300 * 1024)
  ------------------
  |  Branch (3844:6): [True: 103k, False: 0]
  ------------------
 3845|   103k|    data->info.header_size += (unsigned int)delta;
 3846|   103k|    data->req.allheadercount += (unsigned int)delta;
 3847|   103k|    if(!connect_only)
  ------------------
  |  Branch (3847:8): [True: 56.0k, False: 47.1k]
  ------------------
 3848|  56.0k|      data->req.headerbytecount += (unsigned int)delta;
 3849|   103k|    if(data->req.allheadercount > max)
  ------------------
  |  Branch (3849:8): [True: 0, False: 103k]
  ------------------
 3850|      0|      bad = data->req.allheadercount;
 3851|   103k|    else if(data->info.header_size > (max * 20)) {
  ------------------
  |  Branch (3851:13): [True: 0, False: 103k]
  ------------------
 3852|      0|      bad = data->info.header_size;
 3853|      0|      max *= 20;
 3854|      0|    }
 3855|   103k|  }
 3856|      0|  else
 3857|      0|    bad = data->req.allheadercount + delta;
 3858|   103k|  if(bad) {
  ------------------
  |  Branch (3858:6): [True: 0, False: 103k]
  ------------------
 3859|      0|    failf(data, "Too large response headers: %zu > %u", bad, max);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3860|      0|    return CURLE_RECV_ERROR;
 3861|      0|  }
 3862|   103k|  return CURLE_OK;
 3863|   103k|}
Curl_http_to_fold:
 4379|  3.27k|{
 4380|  3.27k|  size_t len = curlx_dyn_len(bf);
 4381|  3.27k|  const char *hd = curlx_dyn_ptr(bf);
 4382|  3.27k|  if(len && (hd[len - 1] == '\n'))
  ------------------
  |  Branch (4382:6): [True: 3.27k, False: 0]
  |  Branch (4382:13): [True: 3.27k, False: 0]
  ------------------
 4383|  3.27k|    len--;
 4384|  3.27k|  if(len && (hd[len - 1] == '\r'))
  ------------------
  |  Branch (4384:6): [True: 3.27k, False: 0]
  |  Branch (4384:13): [True: 750, False: 2.52k]
  ------------------
 4385|    750|    len--;
 4386|  7.70k|  while(len && ISBLANK(hd[len - 1])) /* strip off trailing whitespace */
  ------------------
  |  |   45|  7.47k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 2.66k, False: 4.80k]
  |  |  |  Branch (45:38): [True: 1.76k, False: 3.04k]
  |  |  ------------------
  ------------------
  |  Branch (4386:9): [True: 7.47k, False: 233]
  ------------------
 4387|  4.43k|    len--;
 4388|  3.27k|  curlx_dyn_setlen(bf, len);
 4389|  3.27k|}
Curl_http_write_resp_hd:
 4572|  32.7k|{
 4573|  32.7k|  CURLcode result;
 4574|  32.7k|  size_t consumed;
 4575|  32.7k|  char tmp = 0;
 4576|  32.7k|  DEBUGASSERT(!hd[hdlen]); /* null-terminated */
  ------------------
  |  | 1081|  32.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4576:3): [True: 0, False: 32.7k]
  |  Branch (4576:3): [True: 32.7k, False: 0]
  ------------------
 4577|       |
 4578|  32.7k|  result = http_rw_hd(data, hd, hdlen, &tmp, 0, &consumed);
 4579|  32.7k|  if(!result && is_eos) {
  ------------------
  |  Branch (4579:6): [True: 32.5k, False: 135]
  |  Branch (4579:17): [True: 0, False: 32.5k]
  ------------------
 4580|      0|    result = Curl_client_write(data, (CLIENTWRITE_BODY | CLIENTWRITE_EOS),
  ------------------
  |  |   42|      0|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
                  result = Curl_client_write(data, (CLIENTWRITE_BODY | CLIENTWRITE_EOS),
  ------------------
  |  |   49|      0|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
 4581|      0|                               &tmp, 0);
 4582|      0|  }
 4583|  32.7k|  return result;
 4584|  32.7k|}
Curl_http_write_resp_hds:
 4593|  96.4k|{
 4594|  96.4k|  if(!data->req.header) {
  ------------------
  |  Branch (4594:6): [True: 2.25k, False: 94.2k]
  ------------------
 4595|  2.25k|    *pconsumed = 0;
 4596|  2.25k|    return CURLE_OK;
 4597|  2.25k|  }
 4598|  94.2k|  else {
 4599|  94.2k|    CURLcode result;
 4600|       |
 4601|  94.2k|    result = http_parse_headers(data, buf, blen, pconsumed);
 4602|  94.2k|    if(!result && !data->req.header) {
  ------------------
  |  Branch (4602:8): [True: 93.5k, False: 707]
  |  Branch (4602:19): [True: 933, False: 92.5k]
  ------------------
 4603|    933|      if(!data->req.no_body && curlx_dyn_len(&data->state.headerb)) {
  ------------------
  |  Branch (4603:10): [True: 929, False: 4]
  |  Branch (4603:32): [True: 4, False: 925]
  ------------------
 4604|       |        /* leftover from parsing something that turned out not
 4605|       |         * to be a header, only happens if we allow for
 4606|       |         * HTTP/0.9 like responses */
 4607|      4|        result = Curl_client_write(data, CLIENTWRITE_BODY,
  ------------------
  |  |   42|      4|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
 4608|      4|                                   curlx_dyn_ptr(&data->state.headerb),
 4609|      4|                                   curlx_dyn_len(&data->state.headerb));
 4610|      4|      }
 4611|    933|      curlx_dyn_free(&data->state.headerb);
 4612|    933|    }
 4613|  94.2k|    return result;
 4614|  94.2k|  }
 4615|  96.4k|}
Curl_http_write_resp:
 4620|  96.4k|{
 4621|  96.4k|  CURLcode result;
 4622|  96.4k|  size_t consumed;
 4623|  96.4k|  int flags;
 4624|       |
 4625|  96.4k|  result = Curl_http_write_resp_hds(data, buf, blen, &consumed);
 4626|  96.4k|  if(result || data->req.done)
  ------------------
  |  Branch (4626:6): [True: 707, False: 95.7k]
  |  Branch (4626:16): [True: 45, False: 95.7k]
  ------------------
 4627|    752|    goto out;
 4628|       |
 4629|  95.7k|  DEBUGASSERT(consumed <= blen);
  ------------------
  |  | 1081|  95.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4629:3): [True: 0, False: 95.7k]
  |  Branch (4629:3): [True: 95.7k, False: 0]
  ------------------
 4630|  95.7k|  blen -= consumed;
 4631|  95.7k|  buf += consumed;
 4632|       |  /* either all was consumed in header parsing, or we have data left
 4633|       |   * and are done with headers, e.g. it is BODY data */
 4634|  95.7k|  DEBUGASSERT(!blen || !data->req.header);
  ------------------
  |  | 1081|  95.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4634:3): [True: 95.7k, False: 0]
  |  Branch (4634:3): [True: 0, False: 0]
  |  Branch (4634:3): [True: 92.9k, False: 2.77k]
  |  Branch (4634:3): [True: 2.77k, False: 0]
  ------------------
 4635|  95.7k|  if(!data->req.header && (blen || is_eos)) {
  ------------------
  |  Branch (4635:6): [True: 3.13k, False: 92.5k]
  |  Branch (4635:28): [True: 2.77k, False: 365]
  |  Branch (4635:36): [True: 287, False: 78]
  ------------------
 4636|       |    /* BODY data after header been parsed, write and consume */
 4637|  3.06k|    flags = CLIENTWRITE_BODY;
  ------------------
  |  |   42|  3.06k|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
 4638|  3.06k|    if(is_eos)
  ------------------
  |  Branch (4638:8): [True: 287, False: 2.77k]
  ------------------
 4639|    287|      flags |= CLIENTWRITE_EOS;
  ------------------
  |  |   49|    287|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
 4640|  3.06k|    result = Curl_client_write(data, flags, buf, blen);
 4641|  3.06k|  }
 4642|  96.4k|out:
 4643|  96.4k|  return result;
 4644|  95.7k|}
Curl_http_decode_status:
 4648|  1.20k|{
 4649|  1.20k|  CURLcode result = CURLE_BAD_FUNCTION_ARGUMENT;
 4650|  1.20k|  int status = 0;
 4651|  1.20k|  int i;
 4652|       |
 4653|  1.20k|  if(len != 3)
  ------------------
  |  Branch (4653:6): [True: 0, False: 1.20k]
  ------------------
 4654|      0|    goto out;
 4655|       |
 4656|  4.82k|  for(i = 0; i < 3; ++i) {
  ------------------
  |  Branch (4656:14): [True: 3.61k, False: 1.20k]
  ------------------
 4657|  3.61k|    char c = s[i];
 4658|       |
 4659|  3.61k|    if(c < '0' || c > '9')
  ------------------
  |  Branch (4659:8): [True: 0, False: 3.61k]
  |  Branch (4659:19): [True: 0, False: 3.61k]
  ------------------
 4660|      0|      goto out;
 4661|       |
 4662|  3.61k|    status *= 10;
 4663|  3.61k|    status += c - '0';
 4664|  3.61k|  }
 4665|  1.20k|  result = CURLE_OK;
 4666|  1.20k|out:
 4667|  1.20k|  *pstatus = result ? -1 : status;
  ------------------
  |  Branch (4667:14): [True: 0, False: 1.20k]
  ------------------
 4668|  1.20k|  return result;
 4669|  1.20k|}
Curl_http_req_make:
 4676|  12.4k|{
 4677|  12.4k|  struct httpreq *req;
 4678|  12.4k|  CURLcode result = CURLE_OUT_OF_MEMORY;
 4679|       |
 4680|  12.4k|  DEBUGASSERT(method && m_len);
  ------------------
  |  | 1081|  12.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4680:3): [True: 0, False: 12.4k]
  |  Branch (4680:3): [True: 0, False: 0]
  |  Branch (4680:3): [True: 12.4k, False: 0]
  |  Branch (4680:3): [True: 12.4k, False: 0]
  ------------------
 4681|       |
 4682|  12.4k|  req = curlx_calloc(1, sizeof(*req) + m_len);
  ------------------
  |  | 1480|  12.4k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 4683|  12.4k|  if(!req)
  ------------------
  |  Branch (4683:6): [True: 0, False: 12.4k]
  ------------------
 4684|      0|    goto out;
 4685|       |#if defined(__GNUC__) && __GNUC__ >= 13
 4686|       |#pragma GCC diagnostic push
 4687|       |/* error: 'memcpy' offset [137, 142] from the object at 'req' is out of
 4688|       |   the bounds of referenced subobject 'method' with type 'char[1]' at
 4689|       |   offset 136 */
 4690|       |#pragma GCC diagnostic ignored "-Warray-bounds"
 4691|       |#endif
 4692|  12.4k|  memcpy(req->method, method, m_len);
 4693|       |#if defined(__GNUC__) && __GNUC__ >= 13
 4694|       |#pragma GCC diagnostic pop
 4695|       |#endif
 4696|  12.4k|  if(scheme) {
  ------------------
  |  Branch (4696:6): [True: 0, False: 12.4k]
  ------------------
 4697|      0|    req->scheme = curlx_memdup0(scheme, s_len);
 4698|      0|    if(!req->scheme)
  ------------------
  |  Branch (4698:8): [True: 0, False: 0]
  ------------------
 4699|      0|      goto out;
 4700|      0|  }
 4701|  12.4k|  if(authority) {
  ------------------
  |  Branch (4701:6): [True: 8.00k, False: 4.40k]
  ------------------
 4702|  8.00k|    req->authority = curlx_memdup0(authority, a_len);
 4703|  8.00k|    if(!req->authority)
  ------------------
  |  Branch (4703:8): [True: 0, False: 8.00k]
  ------------------
 4704|      0|      goto out;
 4705|  8.00k|  }
 4706|  12.4k|  if(path) {
  ------------------
  |  Branch (4706:6): [True: 4.40k, False: 8.00k]
  ------------------
 4707|  4.40k|    req->path = curlx_memdup0(path, p_len);
 4708|  4.40k|    if(!req->path)
  ------------------
  |  Branch (4708:8): [True: 0, False: 4.40k]
  ------------------
 4709|      0|      goto out;
 4710|  4.40k|  }
 4711|  12.4k|  Curl_dynhds_init(&req->headers, 0, DYN_HTTP_REQUEST);
  ------------------
  |  |   69|  12.4k|#define DYN_HTTP_REQUEST    (1024 * 1024)
  ------------------
 4712|  12.4k|  Curl_dynhds_init(&req->trailers, 0, DYN_HTTP_REQUEST);
  ------------------
  |  |   69|  12.4k|#define DYN_HTTP_REQUEST    (1024 * 1024)
  ------------------
 4713|  12.4k|  result = CURLE_OK;
 4714|       |
 4715|  12.4k|out:
 4716|  12.4k|  if(result && req)
  ------------------
  |  Branch (4716:6): [True: 0, False: 12.4k]
  |  Branch (4716:16): [True: 0, False: 0]
  ------------------
 4717|      0|    Curl_http_req_free(req);
 4718|  12.4k|  *preq = result ? NULL : req;
  ------------------
  |  Branch (4718:11): [True: 0, False: 12.4k]
  ------------------
 4719|  12.4k|  return result;
 4720|  12.4k|}
Curl_http_req_make2:
 4804|      4|{
 4805|      4|  struct httpreq *req;
 4806|      4|  CURLcode result = CURLE_OUT_OF_MEMORY;
 4807|      4|  CURLUcode uc;
 4808|       |
 4809|      4|  DEBUGASSERT(method && m_len);
  ------------------
  |  | 1081|      4|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4809:3): [True: 0, False: 4]
  |  Branch (4809:3): [True: 0, False: 0]
  |  Branch (4809:3): [True: 4, False: 0]
  |  Branch (4809:3): [True: 4, False: 0]
  ------------------
 4810|       |
 4811|      4|  req = curlx_calloc(1, sizeof(*req) + m_len);
  ------------------
  |  | 1480|      4|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 4812|      4|  if(!req)
  ------------------
  |  Branch (4812:6): [True: 0, False: 4]
  ------------------
 4813|      0|    goto out;
 4814|      4|  memcpy(req->method, method, m_len);
 4815|       |
 4816|      4|  uc = curl_url_get(url, CURLUPART_SCHEME, &req->scheme, 0);
 4817|      4|  if(uc && uc != CURLUE_NO_SCHEME)
  ------------------
  |  Branch (4817:6): [True: 0, False: 4]
  |  Branch (4817:12): [True: 0, False: 0]
  ------------------
 4818|      0|    goto out;
 4819|      4|  if(!req->scheme && scheme_default) {
  ------------------
  |  Branch (4819:6): [True: 0, False: 4]
  |  Branch (4819:22): [True: 0, False: 0]
  ------------------
 4820|      0|    req->scheme = curlx_strdup(scheme_default);
  ------------------
  |  | 1477|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 4821|      0|    if(!req->scheme)
  ------------------
  |  Branch (4821:8): [True: 0, False: 0]
  ------------------
 4822|      0|      goto out;
 4823|      0|  }
 4824|       |
 4825|      4|  result = req_assign_url_authority(req, url);
 4826|      4|  if(result)
  ------------------
  |  Branch (4826:6): [True: 0, False: 4]
  ------------------
 4827|      0|    goto out;
 4828|      4|  result = req_assign_url_path(req, url);
 4829|      4|  if(result)
  ------------------
  |  Branch (4829:6): [True: 0, False: 4]
  ------------------
 4830|      0|    goto out;
 4831|       |
 4832|      4|  Curl_dynhds_init(&req->headers, 0, DYN_HTTP_REQUEST);
  ------------------
  |  |   69|      4|#define DYN_HTTP_REQUEST    (1024 * 1024)
  ------------------
 4833|      4|  Curl_dynhds_init(&req->trailers, 0, DYN_HTTP_REQUEST);
  ------------------
  |  |   69|      4|#define DYN_HTTP_REQUEST    (1024 * 1024)
  ------------------
 4834|      4|  result = CURLE_OK;
 4835|       |
 4836|      4|out:
 4837|      4|  if(result && req)
  ------------------
  |  Branch (4837:6): [True: 0, False: 4]
  |  Branch (4837:16): [True: 0, False: 0]
  ------------------
 4838|      0|    Curl_http_req_free(req);
 4839|      4|  *preq = result ? NULL : req;
  ------------------
  |  Branch (4839:11): [True: 0, False: 4]
  ------------------
 4840|      4|  return result;
 4841|      4|}
Curl_http_req_free:
 4844|  16.8k|{
 4845|  16.8k|  if(req) {
  ------------------
  |  Branch (4845:6): [True: 12.4k, False: 4.41k]
  ------------------
 4846|  12.4k|    curlx_free(req->scheme);
  ------------------
  |  | 1483|  12.4k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 4847|  12.4k|    curlx_free(req->authority);
  ------------------
  |  | 1483|  12.4k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 4848|  12.4k|    curlx_free(req->path);
  ------------------
  |  | 1483|  12.4k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 4849|  12.4k|    Curl_dynhds_free(&req->headers);
 4850|  12.4k|    Curl_dynhds_free(&req->trailers);
 4851|  12.4k|    curlx_free(req);
  ------------------
  |  | 1483|  12.4k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 4852|  12.4k|  }
 4853|  16.8k|}
Curl_http_req_to_h2:
 4911|  4.40k|{
 4912|  4.40k|  const char *scheme = NULL, *authority = NULL;
 4913|  4.40k|  struct dynhds_entry *e;
 4914|  4.40k|  size_t i;
 4915|  4.40k|  CURLcode result;
 4916|       |
 4917|  4.40k|  DEBUGASSERT(req);
  ------------------
  |  | 1081|  4.40k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4917:3): [True: 0, False: 4.40k]
  |  Branch (4917:3): [True: 4.40k, False: 0]
  ------------------
 4918|  4.40k|  DEBUGASSERT(h2_headers);
  ------------------
  |  | 1081|  4.40k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4918:3): [True: 0, False: 4.40k]
  |  Branch (4918:3): [True: 4.40k, False: 0]
  ------------------
 4919|       |
 4920|  4.40k|  if(req->scheme) {
  ------------------
  |  Branch (4920:6): [True: 3, False: 4.40k]
  ------------------
 4921|      3|    scheme = req->scheme;
 4922|      3|  }
 4923|  4.40k|  else if(strcmp("CONNECT", req->method)) {
  ------------------
  |  Branch (4923:11): [True: 4.39k, False: 5]
  ------------------
 4924|  4.39k|    scheme = Curl_checkheaders(data, STRCONST(HTTP_PSEUDO_SCHEME));
  ------------------
  |  | 1292|  4.39k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 4925|  4.39k|    if(scheme) {
  ------------------
  |  Branch (4925:8): [True: 3, False: 4.39k]
  ------------------
 4926|      3|      scheme += sizeof(HTTP_PSEUDO_SCHEME);
  ------------------
  |  |  226|      3|#define HTTP_PSEUDO_SCHEME    ":scheme"
  ------------------
 4927|      3|      curlx_str_passblanks(&scheme);
 4928|      3|      infof(data, "set pseudo header %s to %s", HTTP_PSEUDO_SCHEME, scheme);
  ------------------
  |  |  143|      3|  do {                               \
  |  |  144|      3|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      3|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 3, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  |  |  320|      3|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      3|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      3|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 3]
  |  |  ------------------
  ------------------
 4929|      3|    }
 4930|  4.39k|    else {
 4931|  4.39k|      scheme = Curl_xfer_is_secure(data) ? "https" : "http";
  ------------------
  |  Branch (4931:16): [True: 0, False: 4.39k]
  ------------------
 4932|  4.39k|    }
 4933|  4.39k|  }
 4934|       |
 4935|  4.40k|  if(req->authority) {
  ------------------
  |  Branch (4935:6): [True: 15, False: 4.39k]
  ------------------
 4936|     15|    authority = req->authority;
 4937|     15|  }
 4938|  4.39k|  else {
 4939|  4.39k|    e = Curl_dynhds_get(&req->headers, STRCONST("Host"));
  ------------------
  |  | 1292|  4.39k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 4940|  4.39k|    if(e)
  ------------------
  |  Branch (4940:8): [True: 4.37k, False: 17]
  ------------------
 4941|  4.37k|      authority = e->value;
 4942|  4.39k|  }
 4943|       |
 4944|  4.40k|  Curl_dynhds_reset(h2_headers);
 4945|  4.40k|  Curl_dynhds_set_opts(h2_headers, DYNHDS_OPT_LOWERCASE);
  ------------------
  |  |   54|  4.40k|#define DYNHDS_OPT_LOWERCASE     (1 << 0)
  ------------------
 4946|  4.40k|  result = Curl_dynhds_add(h2_headers, STRCONST(HTTP_PSEUDO_METHOD),
  ------------------
  |  | 1292|  4.40k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 4947|  4.40k|                           req->method, strlen(req->method));
 4948|  4.40k|  if(!result && scheme) {
  ------------------
  |  Branch (4948:6): [True: 4.40k, False: 0]
  |  Branch (4948:17): [True: 4.40k, False: 5]
  ------------------
 4949|  4.40k|    result = Curl_dynhds_add(h2_headers, STRCONST(HTTP_PSEUDO_SCHEME),
  ------------------
  |  | 1292|  4.40k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 4950|  4.40k|                             scheme, strlen(scheme));
 4951|  4.40k|  }
 4952|  4.40k|  if(!result && authority) {
  ------------------
  |  Branch (4952:6): [True: 4.40k, False: 0]
  |  Branch (4952:17): [True: 4.38k, False: 17]
  ------------------
 4953|  4.38k|    result = Curl_dynhds_add(h2_headers, STRCONST(HTTP_PSEUDO_AUTHORITY),
  ------------------
  |  | 1292|  4.38k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 4954|  4.38k|                             authority, strlen(authority));
 4955|  4.38k|  }
 4956|  4.40k|  if(!result && req->path) {
  ------------------
  |  Branch (4956:6): [True: 4.40k, False: 0]
  |  Branch (4956:17): [True: 4.39k, False: 12]
  ------------------
 4957|  4.39k|    result = Curl_dynhds_add(h2_headers, STRCONST(HTTP_PSEUDO_PATH),
  ------------------
  |  | 1292|  4.39k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 4958|  4.39k|                             req->path, strlen(req->path));
 4959|  4.39k|  }
 4960|   137k|  for(i = 0; !result && i < Curl_dynhds_count(&req->headers); ++i) {
  ------------------
  |  Branch (4960:14): [True: 137k, False: 0]
  |  Branch (4960:25): [True: 132k, False: 4.40k]
  ------------------
 4961|   132k|    e = Curl_dynhds_getn(&req->headers, i);
 4962|       |    /* "TE" is special in that it is only permissible when it
 4963|       |     * has only value "trailers". RFC 9113 ch. 8.2.2 */
 4964|   132k|    if(e->namelen == 2 && curl_strequal("TE", e->name)) {
  ------------------
  |  Branch (4964:8): [True: 15.7k, False: 116k]
  |  Branch (4964:27): [True: 521, False: 15.2k]
  ------------------
 4965|    521|      if(http_TE_has_token(e->value, "trailers"))
  ------------------
  |  Branch (4965:10): [True: 0, False: 521]
  ------------------
 4966|      0|        result = Curl_dynhds_add(h2_headers, e->name, e->namelen,
 4967|      0|                                 "trailers", sizeof("trailers") - 1);
 4968|    521|    }
 4969|   132k|    else if(h2_permissible_field(e)) {
  ------------------
  |  Branch (4969:13): [True: 127k, False: 5.09k]
  ------------------
 4970|   127k|      result = Curl_dynhds_add(h2_headers, e->name, e->namelen,
 4971|   127k|                               e->value, e->valuelen);
 4972|   127k|    }
 4973|   132k|  }
 4974|       |
 4975|  4.40k|  return result;
 4976|  4.40k|}
http.c:pickoneauth:
  351|     11|{
  352|     11|  bool picked;
  353|       |  /* only deal with authentication we want */
  354|     11|  unsigned long avail = pick->avail & pick->want & mask;
  355|     11|  picked = TRUE;
  ------------------
  |  | 1055|     11|#define TRUE true
  ------------------
  356|       |
  357|       |  /* The order of these checks is highly relevant, as this will be the order
  358|       |     of preference in case of the existence of multiple accepted types. */
  359|     11|  if(avail & CURLAUTH_NEGOTIATE)
  ------------------
  |  |  833|     11|#define CURLAUTH_NEGOTIATE    (((unsigned long)1) << 2)
  ------------------
  |  Branch (359:6): [True: 0, False: 11]
  ------------------
  360|      0|    pick->picked = CURLAUTH_NEGOTIATE;
  ------------------
  |  |  833|      0|#define CURLAUTH_NEGOTIATE    (((unsigned long)1) << 2)
  ------------------
  361|     11|#ifndef CURL_DISABLE_BEARER_AUTH
  362|     11|  else if(avail & CURLAUTH_BEARER)
  ------------------
  |  |  844|     11|#define CURLAUTH_BEARER       (((unsigned long)1) << 6)
  ------------------
  |  Branch (362:11): [True: 0, False: 11]
  ------------------
  363|      0|    pick->picked = CURLAUTH_BEARER;
  ------------------
  |  |  844|      0|#define CURLAUTH_BEARER       (((unsigned long)1) << 6)
  ------------------
  364|     11|#endif
  365|     11|#ifndef CURL_DISABLE_DIGEST_AUTH
  366|     11|  else if(avail & CURLAUTH_DIGEST)
  ------------------
  |  |  832|     11|#define CURLAUTH_DIGEST       (((unsigned long)1) << 1)
  ------------------
  |  Branch (366:11): [True: 0, False: 11]
  ------------------
  367|      0|    pick->picked = CURLAUTH_DIGEST;
  ------------------
  |  |  832|      0|#define CURLAUTH_DIGEST       (((unsigned long)1) << 1)
  ------------------
  368|     11|#endif
  369|     11|  else if(avail & CURLAUTH_NTLM)
  ------------------
  |  |  838|     11|#define CURLAUTH_NTLM         (((unsigned long)1) << 3)
  ------------------
  |  Branch (369:11): [True: 0, False: 11]
  ------------------
  370|      0|    pick->picked = CURLAUTH_NTLM;
  ------------------
  |  |  838|      0|#define CURLAUTH_NTLM         (((unsigned long)1) << 3)
  ------------------
  371|     11|#ifndef CURL_DISABLE_BASIC_AUTH
  372|     11|  else if(avail & CURLAUTH_BASIC)
  ------------------
  |  |  831|     11|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
  |  Branch (372:11): [True: 0, False: 11]
  ------------------
  373|      0|    pick->picked = CURLAUTH_BASIC;
  ------------------
  |  |  831|      0|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
  374|     11|#endif
  375|     11|#ifndef CURL_DISABLE_AWS
  376|     11|  else if(avail & CURLAUTH_AWS_SIGV4)
  ------------------
  |  |  845|     11|#define CURLAUTH_AWS_SIGV4    (((unsigned long)1) << 7)
  ------------------
  |  Branch (376:11): [True: 0, False: 11]
  ------------------
  377|      0|    pick->picked = CURLAUTH_AWS_SIGV4;
  ------------------
  |  |  845|      0|#define CURLAUTH_AWS_SIGV4    (((unsigned long)1) << 7)
  ------------------
  378|     11|#endif
  379|     11|  else {
  380|     11|    pick->picked = CURLAUTH_PICKNONE; /* we select to use nothing */
  ------------------
  |  |  123|     11|#define CURLAUTH_PICKNONE (1 << 30) /* do not use auth */
  ------------------
  381|     11|    picked = FALSE;
  ------------------
  |  | 1058|     11|#define FALSE false
  ------------------
  382|     11|  }
  383|     11|  pick->avail = CURLAUTH_NONE; /* clear it here */
  ------------------
  |  |  830|     11|#define CURLAUTH_NONE         ((unsigned long)0)
  ------------------
  384|       |
  385|     11|  return picked;
  386|     11|}
http.c:http_perhapsrewind:
  398|    451|{
  399|    451|  curl_off_t bytessent = data->req.writebytecount;
  400|    451|  curl_off_t expectsend = Curl_creader_total_length(data);
  401|    451|  curl_off_t upload_remain = (expectsend >= 0) ? (expectsend - bytessent) : -1;
  ------------------
  |  Branch (401:30): [True: 437, False: 14]
  ------------------
  402|    451|  bool little_upload_remains = (upload_remain >= 0 && upload_remain < 2000);
  ------------------
  |  Branch (402:33): [True: 437, False: 14]
  |  Branch (402:55): [True: 429, False: 8]
  ------------------
  403|    451|  bool needs_rewind = Curl_creader_needs_rewind(data);
  404|       |  /* By default, we would like to abort the transfer when little or unknown
  405|       |   * amount remains. This may be overridden by authentications further
  406|       |   * below! */
  407|    451|  bool abort_upload = (!data->req.upload_done && !little_upload_remains);
  ------------------
  |  Branch (407:24): [True: 23, False: 428]
  |  Branch (407:50): [True: 17, False: 6]
  ------------------
  408|    451|  VERBOSE(const char *ongoing_auth = NULL);
  ------------------
  |  | 1618|    451|#define VERBOSE(x) x
  ------------------
  409|       |
  410|       |  /* We need a rewind before uploading client read data again. The
  411|       |   * checks below influence of the upload is to be continued
  412|       |   * or aborted early.
  413|       |   * This depends on how much remains to be sent and in what state
  414|       |   * the authentication is. Some auth schemes such as NTLM do not work
  415|       |   * for a new connection. */
  416|    451|  if(needs_rewind) {
  ------------------
  |  Branch (416:6): [True: 60, False: 391]
  ------------------
  417|     60|    infof(data, "Need to rewind upload for next request");
  ------------------
  |  |  143|     60|  do {                               \
  |  |  144|     60|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     60|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 60, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 60]
  |  |  |  |  ------------------
  |  |  |  |  320|     60|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     60|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     60|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 60]
  |  |  ------------------
  ------------------
  418|     60|    Curl_creader_set_rewind(data, TRUE);
  ------------------
  |  | 1055|     60|#define TRUE true
  ------------------
  419|     60|  }
  420|       |
  421|    451|  if(conn->bits.close)
  ------------------
  |  Branch (421:6): [True: 36, False: 415]
  ------------------
  422|       |    /* If we already decided to close this connection, we cannot veto. */
  423|     36|    return CURLE_OK;
  424|       |
  425|    415|  if(abort_upload) {
  ------------------
  |  Branch (425:6): [True: 17, False: 398]
  ------------------
  426|       |    /* We would like to abort the upload - but should we? */
  427|       |#ifdef USE_NTLM
  428|       |    if((data->state.authproxy.picked == CURLAUTH_NTLM) ||
  429|       |       (data->state.authhost.picked == CURLAUTH_NTLM)) {
  430|       |      VERBOSE(ongoing_auth = "NTLM");
  431|       |      if((conn->http_ntlm_state != NTLMSTATE_NONE) ||
  432|       |         (conn->proxy_ntlm_state != NTLMSTATE_NONE)) {
  433|       |        /* The NTLM-negotiation has started, keep on sending.
  434|       |         * Need to do further work on same connection */
  435|       |        abort_upload = FALSE;
  436|       |      }
  437|       |    }
  438|       |#endif
  439|       |#ifdef USE_SPNEGO
  440|       |    /* There is still data left to send */
  441|       |    if((data->state.authproxy.picked == CURLAUTH_NEGOTIATE) ||
  442|       |       (data->state.authhost.picked == CURLAUTH_NEGOTIATE)) {
  443|       |      VERBOSE(ongoing_auth = "NEGOTIATE");
  444|       |      if((conn->http_negotiate_state != GSS_AUTHNONE) ||
  445|       |         (conn->proxy_negotiate_state != GSS_AUTHNONE)) {
  446|       |        /* The NEGOTIATE-negotiation has started, keep on sending.
  447|       |         * Need to do further work on same connection */
  448|       |        abort_upload = FALSE;
  449|       |      }
  450|       |    }
  451|       |#endif
  452|     17|  }
  453|       |
  454|    415|  if(abort_upload) {
  ------------------
  |  Branch (454:6): [True: 17, False: 398]
  ------------------
  455|     17|    if(upload_remain >= 0)
  ------------------
  |  Branch (455:8): [True: 8, False: 9]
  ------------------
  456|      8|      infof(data, "%s%sclose instead of sending %" FMT_OFF_T " more bytes",
  ------------------
  |  |  143|      8|  do {                               \
  |  |  144|      8|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      8|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 8, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 8]
  |  |  |  |  ------------------
  |  |  |  |  320|      8|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      8|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      8|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 8]
  |  |  ------------------
  ------------------
  457|     17|            ongoing_auth ? ongoing_auth : "",
  458|     17|            ongoing_auth ? " send, " : "",
  459|     17|            upload_remain);
  460|      9|    else
  461|      9|      infof(data, "%s%sclose instead of sending unknown amount "
  ------------------
  |  |  143|      9|  do {                               \
  |  |  144|      9|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      9|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 9, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 9]
  |  |  |  |  ------------------
  |  |  |  |  320|      9|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      9|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      9|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 9]
  |  |  ------------------
  ------------------
  462|     17|            "of more bytes",
  463|     17|            ongoing_auth ? ongoing_auth : "",
  464|     17|            ongoing_auth ? " send, " : "");
  465|       |    /* We decided to abort the ongoing transfer */
  466|     17|    streamclose(conn, "Mid-auth HTTP and much data left to send");
  ------------------
  |  |  102|     17|#define streamclose(x, y) Curl_conncontrol(x, CONNCTRL_STREAM, y)
  |  |  ------------------
  |  |  |  |   92|     17|#define CONNCTRL_STREAM     2
  |  |  ------------------
  ------------------
  467|     17|    data->req.size = 0; /* do not download any more than 0 bytes */
  468|       |    data->req.http_bodyless = TRUE;
  ------------------
  |  | 1055|     17|#define TRUE true
  ------------------
  469|     17|  }
  470|    415|  return CURLE_OK;
  471|    451|}
http.c:http_should_fail:
  482|  2.55k|{
  483|  2.55k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  2.55k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (483:3): [True: 0, False: 2.55k]
  |  Branch (483:3): [True: 2.55k, False: 0]
  ------------------
  484|  2.55k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|  2.55k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (484:3): [True: 0, False: 2.55k]
  |  Branch (484:3): [True: 2.55k, False: 0]
  ------------------
  485|       |
  486|       |  /*
  487|       |   * If we have not been asked to fail on error,
  488|       |   * do not fail.
  489|       |   */
  490|  2.55k|  if(!data->set.http_fail_on_error)
  ------------------
  |  Branch (490:6): [True: 2.53k, False: 20]
  ------------------
  491|  2.53k|    return FALSE;
  ------------------
  |  | 1058|  2.53k|#define FALSE false
  ------------------
  492|       |
  493|       |  /*
  494|       |   * Any code < 400 is never terminal.
  495|       |   */
  496|     20|  if(httpcode < 400)
  ------------------
  |  Branch (496:6): [True: 11, False: 9]
  ------------------
  497|     11|    return FALSE;
  ------------------
  |  | 1058|     11|#define FALSE false
  ------------------
  498|       |
  499|       |  /*
  500|       |   * A 416 response to a resume request is presumably because the file is
  501|       |   * already completely downloaded and thus not actually a fail.
  502|       |   */
  503|      9|  if(data->state.resume_from && data->state.httpreq == HTTPREQ_GET &&
  ------------------
  |  Branch (503:6): [True: 2, False: 7]
  |  Branch (503:33): [True: 1, False: 1]
  ------------------
  504|      1|     httpcode == 416)
  ------------------
  |  Branch (504:6): [True: 0, False: 1]
  ------------------
  505|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  506|       |
  507|       |  /*
  508|       |   * Any code >= 400 that is not 401 or 407 is always
  509|       |   * a terminal error
  510|       |   */
  511|      9|  if((httpcode != 401) && (httpcode != 407))
  ------------------
  |  Branch (511:6): [True: 7, False: 2]
  |  Branch (511:27): [True: 4, False: 3]
  ------------------
  512|      4|    return TRUE;
  ------------------
  |  | 1055|      4|#define TRUE true
  ------------------
  513|       |
  514|       |  /*
  515|       |   * All we have left to deal with is 401 and 407
  516|       |   */
  517|      5|  DEBUGASSERT((httpcode == 401) || (httpcode == 407));
  ------------------
  |  | 1081|      5|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (517:3): [True: 5, False: 0]
  |  Branch (517:3): [True: 0, False: 0]
  |  Branch (517:3): [True: 2, False: 3]
  |  Branch (517:3): [True: 3, False: 0]
  ------------------
  518|       |
  519|       |  /*
  520|       |   * Examine the current authentication state to see if this is an error. The
  521|       |   * idea is for this function to get called after processing all the headers
  522|       |   * in a response message. If we have been to asked to authenticate
  523|       |   * a particular stage, and we have done it, we are OK. If we are already
  524|       |   * completely authenticated, it is not OK to get another 401 or 407.
  525|       |   *
  526|       |   * It is possible for authentication to go stale such that the client needs
  527|       |   * to reauthenticate. Once that info is available, use it here.
  528|       |   */
  529|       |
  530|       |  /*
  531|       |   * Either we are not authenticating, or we are supposed to be authenticating
  532|       |   * something else. This is an error.
  533|       |   */
  534|      5|  if((httpcode == 401) && !data->state.creds)
  ------------------
  |  Branch (534:6): [True: 2, False: 3]
  |  Branch (534:27): [True: 1, False: 1]
  ------------------
  535|      1|    return TRUE;
  ------------------
  |  | 1055|      1|#define TRUE true
  ------------------
  536|      4|#ifndef CURL_DISABLE_PROXY
  537|      4|  if((httpcode == 407) && !data->conn->http_proxy.creds)
  ------------------
  |  Branch (537:6): [True: 3, False: 1]
  |  Branch (537:27): [True: 1, False: 2]
  ------------------
  538|      1|    return TRUE;
  ------------------
  |  | 1055|      1|#define TRUE true
  ------------------
  539|      3|#endif
  540|       |
  541|      3|  return (bool)data->state.authproblem;
  542|      4|}
http.c:output_auth_headers:
  647|  15.4k|{
  648|  15.4k|  const char *auth = NULL;
  649|  15.4k|  CURLcode result = CURLE_OK;
  650|  15.4k|  (void)conn;
  651|       |
  652|       |#ifdef CURL_DISABLE_DIGEST_AUTH
  653|       |  (void)request;
  654|       |  (void)path;
  655|       |#endif
  656|  15.4k|#ifndef CURL_DISABLE_AWS
  657|  15.4k|  if((authstatus->picked == CURLAUTH_AWS_SIGV4) && !proxy) {
  ------------------
  |  |  845|  15.4k|#define CURLAUTH_AWS_SIGV4    (((unsigned long)1) << 7)
  ------------------
  |  Branch (657:6): [True: 2.04k, False: 13.4k]
  |  Branch (657:52): [True: 2.03k, False: 3]
  ------------------
  658|       |    /* this method is never for proxy */
  659|  2.03k|    auth = "AWS_SIGV4";
  660|  2.03k|    result = Curl_output_aws_sigv4(data);
  661|  2.03k|    if(result)
  ------------------
  |  Branch (661:8): [True: 10, False: 2.02k]
  ------------------
  662|     10|      return result;
  663|  2.03k|  }
  664|  13.4k|  else
  665|  13.4k|#endif
  666|       |#ifdef USE_SPNEGO
  667|       |  if(authstatus->picked == CURLAUTH_NEGOTIATE) {
  668|       |    auth = "Negotiate";
  669|       |    result = Curl_output_negotiate(data, conn, proxy);
  670|       |    if(result)
  671|       |      return result;
  672|       |  }
  673|       |  else
  674|       |#endif
  675|       |#ifdef USE_NTLM
  676|       |  if(authstatus->picked == CURLAUTH_NTLM) {
  677|       |    auth = "NTLM";
  678|       |    result = Curl_output_ntlm(data, proxy);
  679|       |    if(result)
  680|       |      return result;
  681|       |  }
  682|       |  else
  683|       |#endif
  684|  13.4k|#ifndef CURL_DISABLE_DIGEST_AUTH
  685|  13.4k|  if(authstatus->picked == CURLAUTH_DIGEST) {
  ------------------
  |  |  832|  13.4k|#define CURLAUTH_DIGEST       (((unsigned long)1) << 1)
  ------------------
  |  Branch (685:6): [True: 33, False: 13.3k]
  ------------------
  686|     33|    auth = "Digest";
  687|     33|    result = Curl_output_digest(data,
  688|     33|                                proxy,
  689|     33|                                (const unsigned char *)request,
  690|     33|                                (const unsigned char *)path);
  691|     33|    if(result)
  ------------------
  |  Branch (691:8): [True: 0, False: 33]
  ------------------
  692|      0|      return result;
  693|     33|  }
  694|  13.3k|  else
  695|  13.3k|#endif
  696|  13.3k|#ifndef CURL_DISABLE_BASIC_AUTH
  697|  13.3k|  if(authstatus->picked == CURLAUTH_BASIC) {
  ------------------
  |  |  831|  13.3k|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
  |  Branch (697:6): [True: 12.6k, False: 682]
  ------------------
  698|       |    /* Basic */
  699|  12.6k|    if(
  700|  12.6k|#ifndef CURL_DISABLE_PROXY
  701|  12.6k|       (proxy && conn->http_proxy.creds &&
  ------------------
  |  Branch (701:9): [True: 5.48k, False: 7.21k]
  |  Branch (701:18): [True: 1.17k, False: 4.30k]
  ------------------
  702|  1.17k|        !Curl_checkProxyheaders(data, conn,
  ------------------
  |  Branch (702:9): [True: 1.17k, False: 0]
  ------------------
  703|  1.17k|                                STRCONST("Proxy-authorization"))) ||
  ------------------
  |  | 1292|  1.17k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  704|  11.5k|#endif
  705|  11.5k|       (!proxy && data->state.creds &&
  ------------------
  |  Branch (705:9): [True: 7.21k, False: 4.30k]
  |  Branch (705:19): [True: 6.29k, False: 919]
  ------------------
  706|  7.45k|        !Curl_checkheaders(data, STRCONST("Authorization")))) {
  ------------------
  |  | 1292|  6.29k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (706:9): [True: 6.28k, False: 14]
  ------------------
  707|  7.45k|      auth = "Basic";
  708|  7.45k|      result = http_output_basic(data, conn, proxy);
  709|  7.45k|      if(result)
  ------------------
  |  Branch (709:10): [True: 0, False: 7.45k]
  ------------------
  710|      0|        return result;
  711|  7.45k|    }
  712|       |
  713|       |    /* NOTE: this function should set 'done' TRUE, as the other auth
  714|       |       functions work that way */
  715|  12.6k|    authstatus->done = TRUE;
  ------------------
  |  | 1055|  12.6k|#define TRUE true
  ------------------
  716|  12.6k|  }
  717|  15.4k|#endif
  718|  15.4k|#ifndef CURL_DISABLE_BEARER_AUTH
  719|  15.4k|  if(authstatus->picked == CURLAUTH_BEARER) {
  ------------------
  |  |  844|  15.4k|#define CURLAUTH_BEARER       (((unsigned long)1) << 6)
  ------------------
  |  Branch (719:6): [True: 21, False: 15.4k]
  ------------------
  720|       |    /* Bearer */
  721|     21|    if(!proxy && Curl_creds_has_oauth_bearer(data->state.creds) &&
  ------------------
  |  |   73|     39|#define Curl_creds_has_oauth_bearer(c)   ((c) && (c)->oauth_bearer[0])
  |  |  ------------------
  |  |  |  Branch (73:43): [True: 15, False: 3]
  |  |  |  Branch (73:50): [True: 1, False: 14]
  |  |  ------------------
  ------------------
  |  Branch (721:8): [True: 18, False: 3]
  ------------------
  722|      1|       !Curl_checkheaders(data, STRCONST("Authorization"))) {
  ------------------
  |  | 1292|      1|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (722:8): [True: 1, False: 0]
  ------------------
  723|      1|      auth = "Bearer";
  724|      1|      result = http_output_bearer(data);
  725|      1|      if(result)
  ------------------
  |  Branch (725:10): [True: 0, False: 1]
  ------------------
  726|      0|        return result;
  727|      1|    }
  728|       |
  729|       |    /* NOTE: this function should set 'done' TRUE, as the other auth
  730|       |       functions work that way */
  731|     21|    authstatus->done = TRUE;
  ------------------
  |  | 1055|     21|#define TRUE true
  ------------------
  732|     21|  }
  733|  15.4k|#endif
  734|       |
  735|  15.4k|  if(auth) {
  ------------------
  |  Branch (735:6): [True: 9.52k, False: 5.92k]
  ------------------
  736|  9.52k|#ifndef CURL_DISABLE_PROXY
  737|  9.52k|    if(proxy)
  ------------------
  |  Branch (737:8): [True: 1.17k, False: 8.34k]
  ------------------
  738|  1.17k|      data->info.proxyauthpicked = authstatus->picked;
  739|  8.34k|    else
  740|  8.34k|      data->info.httpauthpicked = authstatus->picked;
  741|  9.52k|    infof(data, "%s auth using %s with user '%s'",
  ------------------
  |  |  143|  9.52k|  do {                               \
  |  |  144|  9.52k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  9.52k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 9.52k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 9.52k]
  |  |  |  |  ------------------
  |  |  |  |  320|  9.52k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  9.52k|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|  9.52k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 9.52k]
  |  |  ------------------
  ------------------
  742|  9.52k|          proxy ? "Proxy" : "Server", auth,
  743|  9.52k|          proxy ? (conn->http_proxy.creds ?
  744|  9.52k|                   conn->http_proxy.creds->user : "") :
  745|  9.52k|          (data->state.creds ?
  746|  9.52k|           data->state.creds->user : ""));
  747|       |#else
  748|       |    (void)proxy;
  749|       |    infof(data, "Server auth using %s with user '%s'",
  750|       |          auth, data->state.creds ?
  751|       |          data->state.creds->user : "");
  752|       |#endif
  753|  9.52k|    authstatus->multipass = !authstatus->done;
  754|  9.52k|  }
  755|  5.92k|  else {
  756|  5.92k|    authstatus->multipass = FALSE;
  ------------------
  |  | 1058|  5.92k|#define FALSE false
  ------------------
  757|  5.92k|    if(proxy)
  ------------------
  |  Branch (757:8): [True: 4.35k, False: 1.56k]
  ------------------
  758|  4.35k|      data->info.proxyauthpicked = 0;
  759|  1.56k|    else
  760|  1.56k|      data->info.httpauthpicked = 0;
  761|  5.92k|  }
  762|       |
  763|  15.4k|  return result;
  764|  15.4k|}
http.c:http_output_basic:
  255|  7.45k|{
  256|  7.45k|  size_t size = 0;
  257|  7.45k|  char *authorization = NULL;
  258|  7.45k|  char **p_hd;
  259|  7.45k|  CURLcode result;
  260|  7.45k|  struct Curl_creds *creds = NULL;
  261|  7.45k|  char *out;
  262|       |
  263|       |  /* credentials are unique per transfer for HTTP, do not use the ones for the
  264|       |     connection */
  265|  7.45k|  if(proxy) {
  ------------------
  |  Branch (265:6): [True: 1.17k, False: 6.28k]
  ------------------
  266|  1.17k|#ifndef CURL_DISABLE_PROXY
  267|  1.17k|    p_hd = &data->req.hd_proxy_auth;
  268|  1.17k|    creds = conn->http_proxy.creds;
  269|       |#else
  270|       |    (void)conn;
  271|       |    return CURLE_NOT_BUILT_IN;
  272|       |#endif
  273|  1.17k|  }
  274|  6.28k|  else {
  275|  6.28k|    p_hd = &data->req.hd_auth;
  276|  6.28k|    creds = data->state.creds;
  277|  6.28k|  }
  278|       |
  279|  7.45k|  if(!creds) {
  ------------------
  |  Branch (279:6): [True: 0, False: 7.45k]
  ------------------
  280|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (280:5): [Folded, False: 0]
  |  Branch (280:5): [Folded, False: 0]
  ------------------
  281|      0|    return CURLE_FAILED_INIT;
  282|      0|  }
  283|       |
  284|  7.45k|  out = curl_maprintf("%s:%s", creds->user, creds->passwd);
  285|  7.45k|  if(!out)
  ------------------
  |  Branch (285:6): [True: 0, False: 7.45k]
  ------------------
  286|      0|    return CURLE_OUT_OF_MEMORY;
  287|       |
  288|  7.45k|  result = curlx_base64_encode((uint8_t *)out, strlen(out),
  289|  7.45k|                               &authorization, &size);
  290|  7.45k|  if(result)
  ------------------
  |  Branch (290:6): [True: 0, False: 7.45k]
  ------------------
  291|      0|    goto fail;
  292|       |
  293|  7.45k|  if(!authorization) {
  ------------------
  |  Branch (293:6): [True: 0, False: 7.45k]
  ------------------
  294|      0|    result = CURLE_REMOTE_ACCESS_DENIED;
  295|      0|    goto fail;
  296|      0|  }
  297|       |
  298|  7.45k|  curlx_free(*p_hd);
  ------------------
  |  | 1483|  7.45k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  299|  7.45k|  *p_hd = curl_maprintf("%sAuthorization: Basic %s\r\n",
  300|  7.45k|                        proxy ? "Proxy-" : "",
  ------------------
  |  Branch (300:25): [True: 1.17k, False: 6.28k]
  ------------------
  301|  7.45k|                        authorization);
  302|  7.45k|  curlx_free(authorization);
  ------------------
  |  | 1483|  7.45k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  303|  7.45k|  if(!*p_hd) {
  ------------------
  |  Branch (303:6): [True: 0, False: 7.45k]
  ------------------
  304|      0|    result = CURLE_OUT_OF_MEMORY;
  305|      0|    goto fail;
  306|      0|  }
  307|       |
  308|  7.45k|fail:
  309|  7.45k|  curlx_free(out);
  ------------------
  |  | 1483|  7.45k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  310|  7.45k|  return result;
  311|  7.45k|}
http.c:http_output_bearer:
  323|      1|{
  324|      1|  char **userp;
  325|      1|  CURLcode result = CURLE_OK;
  326|       |
  327|      1|  DEBUGASSERT(Curl_creds_has_oauth_bearer(data->state.creds));
  ------------------
  |  | 1081|      1|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (327:3): [True: 0, False: 1]
  |  Branch (327:3): [True: 0, False: 0]
  |  Branch (327:3): [True: 1, False: 0]
  |  Branch (327:3): [True: 1, False: 0]
  ------------------
  328|      1|  userp = &data->req.hd_auth;
  329|      1|  curlx_free(*userp);
  ------------------
  |  | 1483|      1|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  330|      1|  *userp = curl_maprintf("Authorization: Bearer %s\r\n",
  331|      1|                         Curl_creds_oauth_bearer(data->state.creds));
  ------------------
  |  |   77|      1|#define Curl_creds_oauth_bearer(c)       ((c) ? (c)->oauth_bearer : "")
  |  |  ------------------
  |  |  |  Branch (77:43): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  332|       |
  333|      1|  if(!*userp) {
  ------------------
  |  Branch (333:6): [True: 0, False: 1]
  ------------------
  334|      0|    result = CURLE_OUT_OF_MEMORY;
  335|      0|    goto fail;
  336|      0|  }
  337|       |
  338|      1|fail:
  339|      1|  return result;
  340|      1|}
http.c:authcmp:
  887|  1.35k|{
  888|       |  /* the auth string must not have an alnum following */
  889|  1.35k|  size_t n = strlen(auth);
  890|  1.35k|  return curl_strnequal(auth, line, n) && !ISALNUM(line[n]);
  ------------------
  |  |   41|  1.35k|#define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   44|      0|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 0, False: 0]
  |  |  |  |  |  Branch (44:38): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   43|      0|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:22): [True: 0, False: 0]
  |  |  |  |  |  Branch (43:38): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   42|      0|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 0, False: 0]
  |  |  |  |  |  Branch (42:38): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (890:10): [True: 0, False: 1.35k]
  ------------------
  891|  1.35k|}
http.c:http_switch_to_get:
 1119|     19|{
 1120|     19|  const char *req = data->set.str[STRING_CUSTOMREQUEST];
 1121|       |
 1122|     19|  if((req || data->state.httpreq != HTTPREQ_GET) &&
  ------------------
  |  Branch (1122:7): [True: 5, False: 14]
  |  Branch (1122:14): [True: 6, False: 8]
  ------------------
 1123|     11|     (data->set.http_follow_mode == CURLFOLLOW_OBEYCODE)) {
  ------------------
  |  |  183|     11|#define CURLFOLLOW_OBEYCODE  2L
  ------------------
  |  Branch (1123:6): [True: 1, False: 10]
  ------------------
 1124|      1|    NOVERBOSE((void)code);
  ------------------
  |  | 1619|      1|#define NOVERBOSE(x) Curl_nop_stmt
  |  |  ------------------
  |  |  |  | 1180|      1|#define Curl_nop_stmt do {} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1180:35): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1125|      1|    infof(data, "Switch to GET because of %d response", code);
  ------------------
  |  |  143|      1|  do {                               \
  |  |  144|      1|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      1|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 1, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  320|      1|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      1|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      1|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1]
  |  |  ------------------
  ------------------
 1126|      1|    data->state.http_ignorecustom = TRUE;
  ------------------
  |  | 1055|      1|#define TRUE true
  ------------------
 1127|      1|  }
 1128|     18|  else if(req && (data->set.http_follow_mode != CURLFOLLOW_FIRSTONLY))
  ------------------
  |  |  186|      5|#define CURLFOLLOW_FIRSTONLY 3L
  ------------------
  |  Branch (1128:11): [True: 5, False: 13]
  |  Branch (1128:18): [True: 2, False: 3]
  ------------------
 1129|      2|    infof(data, "Stick to %s instead of GET", req);
  ------------------
  |  |  143|      2|  do {                               \
  |  |  144|      2|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      2|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 2, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  320|      2|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      2|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      2|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 2]
  |  |  ------------------
  ------------------
 1130|       |
 1131|     19|  data->state.httpreq = HTTPREQ_GET;
 1132|       |  Curl_creader_set_rewind(data, FALSE);
  ------------------
  |  | 1058|     19|#define FALSE false
  ------------------
 1133|     19|}
http.c:http_exp100_is_waiting:
 1561|  3.25M|{
 1562|  3.25M|  struct Curl_creader *r = Curl_creader_get_by_type(data, &cr_exp100);
 1563|  3.25M|  if(r) {
  ------------------
  |  Branch (1563:6): [True: 477, False: 3.25M]
  ------------------
 1564|    477|    struct cr_exp100_ctx *ctx = r->ctx;
 1565|    477|    return ctx->state == EXP100_AWAITING_CONTINUE;
 1566|    477|  }
 1567|  3.25M|  return FALSE;
  ------------------
  |  | 1058|  3.25M|#define FALSE false
  ------------------
 1568|  3.25M|}
http.c:cr_exp100_read:
 1466|    537|{
 1467|    537|  struct cr_exp100_ctx *ctx = reader->ctx;
 1468|    537|  timediff_t ms;
 1469|       |
 1470|    537|  switch(ctx->state) {
 1471|     82|  case EXP100_SENDING_REQUEST:
  ------------------
  |  Branch (1471:3): [True: 82, False: 455]
  ------------------
 1472|     82|    if(!Curl_req_sendbuf_empty(data)) {
  ------------------
  |  Branch (1472:8): [True: 57, False: 25]
  ------------------
 1473|       |      /* The initial request data has not been fully sent yet. Do
 1474|       |       * not start the timer yet. */
 1475|     57|      DEBUGF(infof(data, "cr_exp100_read, request not full sent yet"));
  ------------------
  |  | 1067|    399|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 57, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 57]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 57]
  |  |  ------------------
  ------------------
 1476|     57|      *nread = 0;
 1477|     57|      *eos = FALSE;
  ------------------
  |  | 1058|     57|#define FALSE false
  ------------------
 1478|     57|      return CURLE_OK;
 1479|     57|    }
 1480|       |    /* We are now waiting for a reply from the server or
 1481|       |     * a timeout on our side IFF the request has been fully sent. */
 1482|     25|    DEBUGF(infof(data, "cr_exp100_read, start AWAITING_CONTINUE, "
  ------------------
  |  | 1067|    175|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 25, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 25]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 25]
  |  |  ------------------
  ------------------
 1483|     25|                 "timeout %dms", data->set.expect_100_timeout));
 1484|     25|    ctx->state = EXP100_AWAITING_CONTINUE;
 1485|     25|    ctx->start = *Curl_pgrs_now(data);
 1486|     25|    Curl_expire(data, data->set.expect_100_timeout, EXPIRE_100_TIMEOUT);
 1487|     25|    *nread = 0;
 1488|     25|    *eos = FALSE;
  ------------------
  |  | 1058|     25|#define FALSE false
  ------------------
 1489|     25|    return CURLE_OK;
 1490|      0|  case EXP100_FAILED:
  ------------------
  |  Branch (1490:3): [True: 0, False: 537]
  ------------------
 1491|      0|    DEBUGF(infof(data, "cr_exp100_read, expectation failed, error"));
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1492|      0|    *nread = 0;
 1493|      0|    *eos = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1494|      0|    return CURLE_READ_ERROR;
 1495|    454|  case EXP100_AWAITING_CONTINUE:
  ------------------
  |  Branch (1495:3): [True: 454, False: 83]
  ------------------
 1496|    454|    ms = curlx_ptimediff_ms(Curl_pgrs_now(data), &ctx->start);
 1497|    454|    if(ms < data->set.expect_100_timeout) {
  ------------------
  |  Branch (1497:8): [True: 454, False: 0]
  ------------------
 1498|    454|      DEBUGF(infof(data, "cr_exp100_read, AWAITING_CONTINUE, not expired"));
  ------------------
  |  | 1067|  3.17k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 454, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 454]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 454]
  |  |  ------------------
  ------------------
 1499|    454|      *nread = 0;
 1500|    454|      *eos = FALSE;
  ------------------
  |  | 1058|    454|#define FALSE false
  ------------------
 1501|    454|      return CURLE_OK;
 1502|    454|    }
 1503|       |    /* we have waited long enough, continue anyway */
 1504|      0|    http_exp100_continue(data, reader);
 1505|      0|    infof(data, "Done waiting for 100-continue");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1506|      0|    FALLTHROUGH();
  ------------------
  |  |  821|      0|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
 1507|      1|  default:
  ------------------
  |  Branch (1507:3): [True: 1, False: 536]
  ------------------
 1508|      1|    DEBUGF(infof(data, "cr_exp100_read, pass through"));
  ------------------
  |  | 1067|      7|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 1, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 1]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 1]
  |  |  ------------------
  ------------------
 1509|      1|    return Curl_creader_read(data, reader->next, buf, blen, nread, eos);
 1510|    537|  }
 1511|    537|}
http.c:http_exp100_continue:
 1454|     27|{
 1455|     27|  struct cr_exp100_ctx *ctx = reader->ctx;
 1456|     27|  if(ctx->state > EXP100_SEND_DATA) {
  ------------------
  |  Branch (1456:6): [True: 7, False: 20]
  ------------------
 1457|      7|    ctx->state = EXP100_SEND_DATA;
 1458|      7|    Curl_expire_done(data, EXPIRE_100_TIMEOUT);
 1459|      7|  }
 1460|     27|}
http.c:cr_exp100_done:
 1515|     26|{
 1516|     26|  struct cr_exp100_ctx *ctx = reader->ctx;
 1517|     26|  ctx->state = premature ? EXP100_FAILED : EXP100_SEND_DATA;
  ------------------
  |  Branch (1517:16): [True: 26, False: 0]
  ------------------
 1518|     26|  Curl_expire_done(data, EXPIRE_100_TIMEOUT);
 1519|     26|}
http.c:http_write_header:
 1612|  2.38k|{
 1613|  2.38k|  CURLcode result;
 1614|  2.38k|  int writetype;
 1615|       |
 1616|       |  /* now, only output this if the header AND body are requested:
 1617|       |   */
 1618|  2.38k|  Curl_debug(data, CURLINFO_HEADER_IN, hd, hdlen);
 1619|       |
 1620|  2.38k|  writetype = CLIENTWRITE_HEADER |
  ------------------
  |  |   44|  2.38k|#define CLIENTWRITE_HEADER  (1 << 2) /* meta information, HEADER */
  ------------------
 1621|  2.38k|    ((data->req.httpcode / 100 == 1) ? CLIENTWRITE_1XX : 0);
  ------------------
  |  |   47|    543|#define CLIENTWRITE_1XX     (1 << 5) /* a 1xx response related HEADER */
  ------------------
  |  Branch (1621:6): [True: 543, False: 1.84k]
  ------------------
 1622|       |
 1623|  2.38k|  result = Curl_client_write(data, writetype, hd, hdlen);
 1624|  2.38k|  if(result)
  ------------------
  |  Branch (1624:6): [True: 696, False: 1.69k]
  ------------------
 1625|    696|    return result;
 1626|       |
 1627|  1.69k|  result = Curl_bump_headersize(data, hdlen, FALSE);
  ------------------
  |  | 1058|  1.69k|#define FALSE false
  ------------------
 1628|  1.69k|  if(result)
  ------------------
  |  Branch (1628:6): [True: 0, False: 1.69k]
  ------------------
 1629|      0|    return result;
 1630|       |
 1631|  1.69k|  data->req.deductheadercount = (100 <= data->req.httpcode &&
  ------------------
  |  Branch (1631:34): [True: 1.68k, False: 9]
  ------------------
 1632|  1.68k|                                 199 >= data->req.httpcode) ?
  ------------------
  |  Branch (1632:34): [True: 450, False: 1.23k]
  ------------------
 1633|  1.24k|    data->req.headerbytecount : 0;
 1634|  1.69k|  return result;
 1635|  1.69k|}
http.c:http_check_new_conn:
 2722|  6.76k|{
 2723|  6.76k|  struct connectdata *conn = data->conn;
 2724|  6.76k|  const char *info_version = NULL;
 2725|  6.76k|  const char *alpn;
 2726|  6.76k|  CURLcode result;
 2727|       |
 2728|  6.76k|  alpn = Curl_conn_get_alpn_negotiated(data, conn);
 2729|  6.76k|  if(alpn && !strcmp("h3", alpn)) {
  ------------------
  |  Branch (2729:6): [True: 0, False: 6.76k]
  |  Branch (2729:14): [True: 0, False: 0]
  ------------------
 2730|      0|#ifndef CURL_DISABLE_PROXY
 2731|      0|    if((Curl_conn_http_version(data, conn) == 30) || !conn->bits.proxy ||
  ------------------
  |  Branch (2731:8): [True: 0, False: 0]
  |  Branch (2731:54): [True: 0, False: 0]
  ------------------
 2732|      0|       conn->bits.tunnel_proxy)
  ------------------
  |  Branch (2732:8): [True: 0, False: 0]
  ------------------
 2733|      0|#endif
 2734|      0|      DEBUGASSERT(Curl_conn_http_version(data, conn) == 30);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2734:7): [True: 0, False: 0]
  |  Branch (2734:7): [True: 0, False: 0]
  ------------------
 2735|      0|    info_version = "HTTP/3";
 2736|      0|  }
 2737|  6.76k|  else if(alpn && !strcmp("h2", alpn)) {
  ------------------
  |  Branch (2737:11): [True: 0, False: 6.76k]
  |  Branch (2737:19): [True: 0, False: 0]
  ------------------
 2738|      0|#ifndef CURL_DISABLE_PROXY
 2739|      0|    if((Curl_conn_http_version(data, conn) != 20) &&
  ------------------
  |  Branch (2739:8): [True: 0, False: 0]
  ------------------
 2740|      0|       conn->bits.proxy && !conn->bits.tunnel_proxy) {
  ------------------
  |  Branch (2740:8): [True: 0, False: 0]
  |  Branch (2740:28): [True: 0, False: 0]
  ------------------
 2741|      0|      result = Curl_http2_switch(data);
 2742|      0|      if(result)
  ------------------
  |  Branch (2742:10): [True: 0, False: 0]
  ------------------
 2743|      0|        return result;
 2744|      0|    }
 2745|      0|    else
 2746|      0|#endif
 2747|      0|    DEBUGASSERT(Curl_conn_http_version(data, conn) == 20);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2747:5): [True: 0, False: 0]
  |  Branch (2747:5): [True: 0, False: 0]
  ------------------
 2748|      0|    info_version = "HTTP/2";
 2749|      0|  }
 2750|  6.76k|  else {
 2751|       |    /* Check if user wants to use HTTP/2 with clear TCP */
 2752|  6.76k|    if(Curl_http2_may_switch(data)) {
  ------------------
  |  Branch (2752:8): [True: 4.44k, False: 2.31k]
  ------------------
 2753|  4.44k|      DEBUGF(infof(data, "HTTP/2 over clean TCP"));
  ------------------
  |  | 1067|  31.1k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 4.44k, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 4.44k]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 4.44k]
  |  |  ------------------
  ------------------
 2754|  4.44k|      result = Curl_http2_switch(data);
 2755|  4.44k|      if(result)
  ------------------
  |  Branch (2755:10): [True: 0, False: 4.44k]
  ------------------
 2756|      0|        return result;
 2757|  4.44k|      info_version = "HTTP/2";
 2758|       |      /* There is no ALPN here, but the connection is now definitely h2 */
 2759|  4.44k|      conn->httpversion_seen = 20;
 2760|  4.44k|      Curl_conn_set_multiplex(conn);
 2761|  4.44k|    }
 2762|  2.31k|    else
 2763|  2.31k|      info_version = "HTTP/1.x";
 2764|  6.76k|  }
 2765|       |
 2766|  6.76k|  if(info_version)
  ------------------
  |  Branch (2766:6): [True: 6.76k, False: 0]
  ------------------
 2767|  6.76k|    infof(data, "using %s", info_version);
  ------------------
  |  |  143|  6.76k|  do {                               \
  |  |  144|  6.76k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  6.76k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 6.76k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 6.76k]
  |  |  |  |  ------------------
  |  |  |  |  320|  6.76k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  6.76k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  6.76k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
 2768|  6.76k|  return CURLE_OK;
 2769|  6.76k|}
http.c:http_set_aptr_host:
 1990|  6.85k|{
 1991|  6.85k|  struct connectdata *conn = data->conn;
 1992|  6.85k|  struct dynamically_allocated_data *aptr = &data->state.aptr;
 1993|  6.85k|  const char *ptr;
 1994|       |
 1995|  6.85k|  curlx_safefree(aptr->host);
  ------------------
  |  | 1327|  6.85k|  do {                      \
  |  | 1328|  6.85k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  6.85k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  6.85k|    (ptr) = NULL;           \
  |  | 1330|  6.85k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 6.85k]
  |  |  ------------------
  ------------------
 1996|  6.85k|#ifndef CURL_DISABLE_COOKIES
 1997|  6.85k|  curlx_safefree(data->req.cookiehost);
  ------------------
  |  | 1327|  6.85k|  do {                      \
  |  | 1328|  6.85k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  6.85k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  6.85k|    (ptr) = NULL;           \
  |  | 1330|  6.85k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 6.85k]
  |  |  ------------------
  ------------------
 1998|  6.85k|#endif
 1999|       |
 2000|  6.85k|  ptr = Curl_checkheaders(data, STRCONST("Host"));
  ------------------
  |  | 1292|  6.85k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 2001|  6.85k|  if(ptr && (!data->state.this_is_a_follow ||
  ------------------
  |  Branch (2001:6): [True: 52, False: 6.80k]
  |  Branch (2001:14): [True: 51, False: 1]
  ------------------
 2002|     52|             Curl_peer_equal(data->state.initial_origin, conn->origin))) {
  ------------------
  |  Branch (2002:14): [True: 1, False: 0]
  ------------------
 2003|     52|#ifndef CURL_DISABLE_COOKIES
 2004|       |    /* If we have a given custom Host: header, we extract the hostname in
 2005|       |       order to possibly use it for cookie reasons later on. We only allow the
 2006|       |       custom Host: header if this is NOT a redirect, as setting Host: in the
 2007|       |       redirected request is being out on thin ice. Except if the hostname
 2008|       |       is the same as the first one! */
 2009|     52|    char *cookiehost;
 2010|     52|    CURLcode result = copy_custom_value(ptr, &cookiehost);
 2011|     52|    if(result)
  ------------------
  |  Branch (2011:8): [True: 0, False: 52]
  ------------------
 2012|      0|      return result;
 2013|     52|    if(!*cookiehost)
  ------------------
  |  Branch (2013:8): [True: 19, False: 33]
  ------------------
 2014|       |      /* ignore empty data */
 2015|     19|      curlx_free(cookiehost);
  ------------------
  |  | 1483|     19|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2016|     33|    else {
 2017|       |      /* If the host begins with '[', we start searching for the port after
 2018|       |         the bracket has been closed */
 2019|     33|      if(*cookiehost == '[') {
  ------------------
  |  Branch (2019:10): [True: 5, False: 28]
  ------------------
 2020|      5|        char *closingbracket;
 2021|       |        /* since the 'cookiehost' is an allocated memory area that will be
 2022|       |           freed later we cannot increment the pointer */
 2023|      5|        memmove(cookiehost, cookiehost + 1, strlen(cookiehost) - 1);
 2024|      5|        closingbracket = strchr(cookiehost, ']');
 2025|      5|        if(closingbracket)
  ------------------
  |  Branch (2025:12): [True: 4, False: 1]
  ------------------
 2026|      4|          *closingbracket = 0;
 2027|      5|      }
 2028|     28|      else {
 2029|     28|        int startsearch = 0;
 2030|     28|        char *colon = strchr(cookiehost + startsearch, ':');
 2031|     28|        if(colon)
  ------------------
  |  Branch (2031:12): [True: 18, False: 10]
  ------------------
 2032|     18|          *colon = 0; /* The host must not include an embedded port number */
 2033|     28|      }
 2034|     33|      data->req.cookiehost = cookiehost;
 2035|     33|    }
 2036|     52|#endif
 2037|       |
 2038|     52|    if(!curl_strequal("Host:", ptr)) {
  ------------------
  |  Branch (2038:8): [True: 35, False: 17]
  ------------------
 2039|     35|      aptr->host = curl_maprintf("Host:%s\r\n", &ptr[5]);
 2040|     35|      if(!aptr->host)
  ------------------
  |  Branch (2040:10): [True: 0, False: 35]
  ------------------
 2041|      0|        return CURLE_OUT_OF_MEMORY;
 2042|     35|    }
 2043|     52|  }
 2044|  6.80k|  else {
 2045|       |    /* Use the hostname as present in the URL if it was IPv6. */
 2046|  6.80k|    char *host = (conn->origin->user_hostname[0] == '[') ?
  ------------------
  |  Branch (2046:18): [True: 10, False: 6.79k]
  ------------------
 2047|  6.79k|       conn->origin->user_hostname : conn->origin->hostname;
 2048|       |
 2049|  6.80k|    if(((conn->given->protocol & (CURLPROTO_HTTPS | CURLPROTO_WSS)) &&
  ------------------
  |  | 1079|  6.80k|#define CURLPROTO_HTTPS   (1L << 1)
  ------------------
                  if(((conn->given->protocol & (CURLPROTO_HTTPS | CURLPROTO_WSS)) &&
  ------------------
  |  |   64|  6.80k|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  ------------------
  |  Branch (2049:9): [True: 0, False: 6.80k]
  ------------------
 2050|      0|        (conn->origin->port == PORT_HTTPS)) ||
  ------------------
  |  |   38|      0|#define PORT_HTTPS  443
  ------------------
  |  Branch (2050:9): [True: 0, False: 0]
  ------------------
 2051|  6.80k|       ((conn->given->protocol & (CURLPROTO_HTTP | CURLPROTO_WS)) &&
  ------------------
  |  | 1078|  6.80k|#define CURLPROTO_HTTP    (1L << 0)
  ------------------
                     ((conn->given->protocol & (CURLPROTO_HTTP | CURLPROTO_WS)) &&
  ------------------
  |  |   63|  6.80k|#define CURLPROTO_WS     (1L << 30)
  ------------------
  |  Branch (2051:9): [True: 0, False: 6.80k]
  ------------------
 2052|      0|        (conn->origin->port == PORT_HTTP)))
  ------------------
  |  |   37|      0|#define PORT_HTTP   80
  ------------------
  |  Branch (2052:9): [True: 0, False: 0]
  ------------------
 2053|       |      /* if(HTTPS on port 443) OR (HTTP on port 80) then do not include
 2054|       |         the port number in the host string */
 2055|      0|      aptr->host = curl_maprintf("Host: %s\r\n", host);
 2056|  6.80k|    else
 2057|  6.80k|      aptr->host = curl_maprintf("Host: %s:%d\r\n", host, conn->origin->port);
 2058|       |
 2059|  6.80k|    if(!aptr->host)
  ------------------
  |  Branch (2059:8): [True: 0, False: 6.80k]
  ------------------
 2060|       |      /* without Host: we cannot make a nice request */
 2061|      0|      return CURLE_OUT_OF_MEMORY;
 2062|  6.80k|  }
 2063|  6.85k|  return CURLE_OK;
 2064|  6.85k|}
http.c:copy_custom_value:
  203|     58|{
  204|     58|  struct Curl_str out;
  205|       |
  206|       |  /* find the end of the header name */
  207|     58|  if(header_has_value(&header, &out)) {
  ------------------
  |  Branch (207:6): [True: 58, False: 0]
  ------------------
  208|     58|    *valp = curlx_memdup0(curlx_str(&out), curlx_strlen(&out));
  ------------------
  |  |   49|     58|#define curlx_str(x)    ((x)->str)
  ------------------
                  *valp = curlx_memdup0(curlx_str(&out), curlx_strlen(&out));
  ------------------
  |  |   50|     58|#define curlx_strlen(x) ((x)->len)
  ------------------
  209|     58|    if(*valp)
  ------------------
  |  Branch (209:8): [True: 58, False: 0]
  ------------------
  210|     58|      return CURLE_OK;
  211|      0|    return CURLE_OUT_OF_MEMORY;
  212|     58|  }
  213|       |  /* bad input */
  214|      0|  *valp = NULL;
  215|      0|  return CURLE_BAD_FUNCTION_ARGUMENT;
  216|     58|}
http.c:header_has_value:
  173|     76|{
  174|     76|  bool value = !curlx_str_cspn(headerp, outp, ";:") &&
  ------------------
  |  Branch (174:16): [True: 76, False: 0]
  ------------------
  175|     76|    (!curlx_str_single(headerp, ':') || !curlx_str_single(headerp, ';'));
  ------------------
  |  Branch (175:6): [True: 57, False: 19]
  |  Branch (175:41): [True: 19, False: 0]
  ------------------
  176|       |
  177|     76|  if(value) {
  ------------------
  |  Branch (177:6): [True: 76, False: 0]
  ------------------
  178|     76|    curlx_str_untilnl(headerp, outp, MAX_HTTP_RESP_HEADER_SIZE);
  ------------------
  |  |  153|     76|#define MAX_HTTP_RESP_HEADER_SIZE (300 * 1024)
  ------------------
  179|     76|    curlx_str_trimblanks(outp);
  180|     76|  }
  181|     76|  return value;
  182|     76|}
http.c:http_useragent:
 1979|  6.85k|{
 1980|       |  /* The User-Agent string might have been allocated already, because
 1981|       |     it might have been used in the proxy connect, but if we have got a header
 1982|       |     with the user-agent string specified, we erase the previously made string
 1983|       |     here. */
 1984|  6.85k|  if(Curl_checkheaders(data, STRCONST("User-Agent")))
  ------------------
  |  | 1292|  6.85k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (1984:6): [True: 1, False: 6.85k]
  ------------------
 1985|       |    curlx_safefree(data->state.aptr.uagent);
  ------------------
  |  | 1327|      1|  do {                      \
  |  | 1328|      1|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      1|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      1|    (ptr) = NULL;           \
  |  | 1330|      1|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 1]
  |  |  ------------------
  ------------------
 1986|  6.85k|  return CURLE_OK;
 1987|  6.85k|}
http.c:set_reader:
 2270|  6.85k|{
 2271|  6.85k|  CURLcode result = CURLE_OK;
 2272|  6.85k|  curl_off_t postsize = data->state.infilesize;
 2273|       |
 2274|  6.85k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|  6.85k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2274:3): [True: 0, False: 6.85k]
  |  Branch (2274:3): [True: 6.85k, False: 0]
  ------------------
 2275|       |
 2276|  6.85k|  if(data->req.authneg) {
  ------------------
  |  Branch (2276:6): [True: 12, False: 6.84k]
  ------------------
 2277|     12|    return Curl_creader_set_null(data);
 2278|     12|  }
 2279|       |
 2280|  6.84k|  switch(httpreq) {
 2281|    189|  case HTTPREQ_PUT: /* Let's PUT the data to the server! */
  ------------------
  |  Branch (2281:3): [True: 189, False: 6.65k]
  ------------------
 2282|    189|    return postsize ? Curl_creader_set_fread(data, postsize) :
  ------------------
  |  Branch (2282:12): [True: 150, False: 39]
  ------------------
 2283|    189|      Curl_creader_set_null(data);
 2284|       |
 2285|      0|#if !defined(CURL_DISABLE_MIME) || !defined(CURL_DISABLE_FORM_API)
 2286|    137|  case HTTPREQ_POST_FORM:
  ------------------
  |  Branch (2286:3): [True: 137, False: 6.70k]
  ------------------
 2287|    536|  case HTTPREQ_POST_MIME:
  ------------------
  |  Branch (2287:3): [True: 399, False: 6.44k]
  ------------------
 2288|    536|    return set_post_reader(data, httpreq);
 2289|      0|#endif
 2290|       |
 2291|    260|  case HTTPREQ_POST:
  ------------------
  |  Branch (2291:3): [True: 260, False: 6.58k]
  ------------------
 2292|       |    /* this is the simple POST, using x-www-form-urlencoded style */
 2293|       |    /* the size of the post body */
 2294|    260|    if(!postsize) {
  ------------------
  |  Branch (2294:8): [True: 47, False: 213]
  ------------------
 2295|     47|      result = Curl_creader_set_null(data);
 2296|     47|    }
 2297|    213|    else if(data->set.postfields) {
  ------------------
  |  Branch (2297:13): [True: 133, False: 80]
  ------------------
 2298|    133|      size_t plen = curlx_sotouz_range(postsize, 0, SIZE_MAX);
 2299|    133|      if(plen == SIZE_MAX)
  ------------------
  |  Branch (2299:10): [True: 0, False: 133]
  ------------------
 2300|      0|        return CURLE_OUT_OF_MEMORY;
 2301|    133|      else if(plen)
  ------------------
  |  Branch (2301:15): [True: 133, False: 0]
  ------------------
 2302|    133|        result = Curl_creader_set_buf(data, data->set.postfields, plen);
 2303|      0|      else
 2304|      0|        result = Curl_creader_set_null(data);
 2305|    133|    }
 2306|     80|    else {
 2307|       |      /* we read the bytes from the callback. In case "chunked" encoding
 2308|       |       * is forced by the application, we disregard `postsize`. This is
 2309|       |       * a backward compatibility decision to earlier versions where
 2310|       |       * chunking disregarded this. See issue #13229. */
 2311|     80|      bool chunked = FALSE;
  ------------------
  |  | 1058|     80|#define FALSE false
  ------------------
 2312|     80|      char *ptr = Curl_checkheaders(data, STRCONST("Transfer-Encoding"));
  ------------------
  |  | 1292|     80|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 2313|     80|      if(ptr) {
  ------------------
  |  Branch (2313:10): [True: 0, False: 80]
  ------------------
 2314|       |        /* Some kind of TE is requested, check if 'chunked' is chosen */
 2315|      0|        chunked = Curl_compareheader(ptr, STRCONST("Transfer-Encoding:"),
  ------------------
  |  | 1292|      0|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 2316|      0|                                     STRCONST("chunked"));
  ------------------
  |  | 1292|      0|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 2317|      0|      }
 2318|     80|      result = Curl_creader_set_fread(data, chunked ? -1 : postsize);
  ------------------
  |  Branch (2318:45): [True: 0, False: 80]
  ------------------
 2319|     80|    }
 2320|    260|    return result;
 2321|       |
 2322|  5.85k|  default:
  ------------------
  |  Branch (2322:3): [True: 5.85k, False: 985]
  ------------------
 2323|       |    /* HTTP GET/HEAD download, has no body, needs no Content-Length */
 2324|  5.85k|    data->state.infilesize = 0;
 2325|  5.85k|    return Curl_creader_set_null(data);
 2326|  6.84k|  }
 2327|       |  /* not reached */
 2328|  6.84k|}
http.c:set_post_reader:
 2192|    536|{
 2193|    536|  CURLcode result;
 2194|       |
 2195|    536|  switch(httpreq) {
 2196|      0|#ifndef CURL_DISABLE_MIME
 2197|    399|  case HTTPREQ_POST_MIME:
  ------------------
  |  Branch (2197:3): [True: 399, False: 137]
  ------------------
 2198|    399|    data->state.mimepost = data->set.mimepostp;
 2199|    399|    break;
 2200|      0|#endif
 2201|      0|#ifndef CURL_DISABLE_FORM_API
 2202|    137|  case HTTPREQ_POST_FORM:
  ------------------
  |  Branch (2202:3): [True: 137, False: 399]
  ------------------
 2203|       |    /* Convert the form structure into a mime structure, then keep
 2204|       |       the conversion */
 2205|    137|    if(!data->state.formp) {
  ------------------
  |  Branch (2205:8): [True: 106, False: 31]
  ------------------
 2206|    106|      data->state.formp = curlx_calloc(1, sizeof(curl_mimepart));
  ------------------
  |  | 1480|    106|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 2207|    106|      if(!data->state.formp)
  ------------------
  |  Branch (2207:10): [True: 0, False: 106]
  ------------------
 2208|      0|        return CURLE_OUT_OF_MEMORY;
 2209|    106|      Curl_mime_cleanpart(data->state.formp);
 2210|    106|      result = Curl_getformdata(data, data->state.formp, data->set.httppost,
 2211|    106|                                data->state.fread_func);
 2212|    106|      if(result) {
  ------------------
  |  Branch (2212:10): [True: 0, False: 106]
  ------------------
 2213|      0|        curlx_safefree(data->state.formp);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2214|      0|        return result;
 2215|      0|      }
 2216|    106|      data->state.mimepost = data->state.formp;
 2217|    106|    }
 2218|    137|    break;
 2219|    137|#endif
 2220|    137|  default:
  ------------------
  |  Branch (2220:3): [True: 0, False: 536]
  ------------------
 2221|      0|    data->state.mimepost = NULL;
 2222|      0|    break;
 2223|    536|  }
 2224|       |
 2225|    536|  switch(httpreq) {
 2226|    137|  case HTTPREQ_POST_FORM:
  ------------------
  |  Branch (2226:3): [True: 137, False: 399]
  ------------------
 2227|    536|  case HTTPREQ_POST_MIME:
  ------------------
  |  Branch (2227:3): [True: 399, False: 137]
  ------------------
 2228|       |    /* This is form posting using mime data. */
 2229|    536|#ifndef CURL_DISABLE_MIME
 2230|    536|    if(data->state.mimepost) {
  ------------------
  |  Branch (2230:8): [True: 536, False: 0]
  ------------------
 2231|    536|      const char *cthdr = Curl_checkheaders(data, STRCONST("Content-Type"));
  ------------------
  |  | 1292|    536|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 2232|       |
 2233|       |      /* Read and seek body only. */
 2234|    536|      data->state.mimepost->flags |= MIME_BODY_ONLY;
  ------------------
  |  |   35|    536|#define MIME_BODY_ONLY          (1 << 1)
  ------------------
 2235|       |
 2236|       |      /* Prepare the mime structure headers & set content type. */
 2237|       |
 2238|    536|      if(cthdr)
  ------------------
  |  Branch (2238:10): [True: 17, False: 519]
  ------------------
 2239|     78|        for(cthdr += 13; *cthdr == ' '; cthdr++)
  ------------------
  |  Branch (2239:26): [True: 61, False: 17]
  ------------------
 2240|     61|          ;
 2241|    519|      else if(data->state.mimepost->kind == MIMEKIND_MULTIPART)
  ------------------
  |  Branch (2241:15): [True: 519, False: 0]
  ------------------
 2242|    519|        cthdr = "multipart/form-data";
 2243|       |
 2244|    536|      curl_mime_headers(data->state.mimepost, data->set.headers, 0);
 2245|    536|      result = Curl_mime_prepare_headers(data, data->state.mimepost, cthdr,
 2246|    536|                                         NULL, MIMESTRATEGY_FORM);
 2247|    536|      if(result)
  ------------------
  |  Branch (2247:10): [True: 0, False: 536]
  ------------------
 2248|      0|        return result;
 2249|    536|      curl_mime_headers(data->state.mimepost, NULL, 0);
 2250|    536|      result = Curl_creader_set_mime(data, data->state.mimepost);
 2251|    536|      if(result)
  ------------------
  |  Branch (2251:10): [True: 0, False: 536]
  ------------------
 2252|      0|        return result;
 2253|    536|    }
 2254|      0|    else
 2255|      0|#endif
 2256|      0|    {
 2257|      0|      result = Curl_creader_set_null(data);
 2258|      0|    }
 2259|    536|    data->state.infilesize = Curl_creader_total_length(data);
 2260|    536|    return result;
 2261|       |
 2262|      0|  default:
  ------------------
  |  Branch (2262:3): [True: 0, False: 536]
  ------------------
 2263|      0|    return Curl_creader_set_null(data);
 2264|    536|  }
 2265|       |  /* never reached */
 2266|    536|}
http.c:http_resume:
 2331|  6.85k|{
 2332|  6.85k|  if((HTTPREQ_POST == httpreq || HTTPREQ_PUT == httpreq) &&
  ------------------
  |  Branch (2332:7): [True: 264, False: 6.59k]
  |  Branch (2332:34): [True: 192, False: 6.40k]
  ------------------
 2333|    456|     data->state.resume_from) {
  ------------------
  |  Branch (2333:6): [True: 40, False: 416]
  ------------------
 2334|       |    /**********************************************************************
 2335|       |     * Resuming upload in HTTP means that we PUT or POST and that we have
 2336|       |     * got a resume_from value set. The resume value has already created
 2337|       |     * a Range: header that will be passed along. We need to "fast forward"
 2338|       |     * the file the given number of bytes and decrease the assume upload
 2339|       |     * file size before we continue this venture in the dark lands of HTTP.
 2340|       |     * Resuming mime/form posting at an offset > 0 has no sense and is ignored.
 2341|       |     *********************************************************************/
 2342|       |
 2343|     40|    if(data->state.resume_from < 0) {
  ------------------
  |  Branch (2343:8): [True: 0, False: 40]
  ------------------
 2344|       |      /*
 2345|       |       * This is meant to get the size of the present remote-file by itself.
 2346|       |       * We do not support this now. Bail out!
 2347|       |       */
 2348|      0|      data->state.resume_from = 0;
 2349|      0|    }
 2350|       |
 2351|     40|    if(data->state.resume_from && !data->req.authneg) {
  ------------------
  |  Branch (2351:8): [True: 40, False: 0]
  |  Branch (2351:35): [True: 37, False: 3]
  ------------------
 2352|       |      /* only act on the first request */
 2353|     37|      CURLcode result;
 2354|     37|      result = Curl_creader_resume_from(data, data->state.resume_from);
 2355|     37|      if(result) {
  ------------------
  |  Branch (2355:10): [True: 34, False: 3]
  ------------------
 2356|     34|        failf(data, "Unable to resume from offset %" FMT_OFF_T,
  ------------------
  |  |   62|     34|#define failf Curl_failf
  ------------------
                      failf(data, "Unable to resume from offset %" FMT_OFF_T,
  ------------------
  |  |  598|     34|#define FMT_OFF_T  CURL_FORMAT_CURL_OFF_T
  |  |  ------------------
  |  |  |  |  341|     34|#    define CURL_FORMAT_CURL_OFF_T     "ld"
  |  |  ------------------
  ------------------
 2357|     34|              data->state.resume_from);
 2358|     34|        return result;
 2359|     34|      }
 2360|     37|    }
 2361|     40|  }
 2362|  6.82k|  return CURLE_OK;
 2363|  6.85k|}
http.c:http_range:
 2602|  6.82k|{
 2603|  6.82k|  if(data->state.use_range) {
  ------------------
  |  Branch (2603:6): [True: 238, False: 6.58k]
  ------------------
 2604|       |    /*
 2605|       |     * A range is selected. We use different headers whether we are downloading
 2606|       |     * or uploading and we always let customized headers override our internal
 2607|       |     * ones if any such are specified.
 2608|       |     */
 2609|    238|    if(((httpreq == HTTPREQ_GET) || (httpreq == HTTPREQ_HEAD)) &&
  ------------------
  |  Branch (2609:9): [True: 148, False: 90]
  |  Branch (2609:37): [True: 1, False: 89]
  ------------------
 2610|    149|       !Curl_checkheaders(data, STRCONST("Range"))) {
  ------------------
  |  | 1292|    149|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (2610:8): [True: 149, False: 0]
  ------------------
 2611|       |      /* if a line like this was already allocated, free the previous one */
 2612|    149|      curlx_free(data->state.aptr.rangeline);
  ------------------
  |  | 1483|    149|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2613|    149|      data->state.aptr.rangeline = curl_maprintf("Range: bytes=%s\r\n",
 2614|    149|                                                 data->state.range);
 2615|    149|      if(!data->state.aptr.rangeline)
  ------------------
  |  Branch (2615:10): [True: 0, False: 149]
  ------------------
 2616|      0|        return CURLE_OUT_OF_MEMORY;
 2617|    149|    }
 2618|     89|    else if((httpreq == HTTPREQ_POST || httpreq == HTTPREQ_PUT) &&
  ------------------
  |  Branch (2618:14): [True: 11, False: 78]
  |  Branch (2618:41): [True: 23, False: 55]
  ------------------
 2619|     34|            !Curl_checkheaders(data, STRCONST("Content-Range"))) {
  ------------------
  |  | 1292|     34|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (2619:13): [True: 34, False: 0]
  ------------------
 2620|     34|      curl_off_t req_clen = Curl_creader_total_length(data);
 2621|       |      /* if a line like this was already allocated, free the previous one */
 2622|     34|      curlx_free(data->state.aptr.rangeline);
  ------------------
  |  | 1483|     34|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2623|       |
 2624|     34|      if(data->set.set_resume_from < 0) {
  ------------------
  |  Branch (2624:10): [True: 0, False: 34]
  ------------------
 2625|       |        /* Upload resume was asked for, but we do not know the size of the
 2626|       |           remote part so we tell the server (and act accordingly) that we
 2627|       |           upload the whole file (again) */
 2628|      0|        data->state.aptr.rangeline =
 2629|      0|          curl_maprintf("Content-Range: bytes 0-%" FMT_OFF_T "/"
 2630|      0|                        "%" FMT_OFF_T "\r\n", req_clen - 1, req_clen);
 2631|      0|      }
 2632|     34|      else if(data->state.resume_from) {
  ------------------
  |  Branch (2632:15): [True: 6, False: 28]
  ------------------
 2633|       |        /* This is because "resume" was selected */
 2634|       |        /* Not sure if we want to send this header during authentication
 2635|       |         * negotiation, but test1084 checks for it. In which case we have a
 2636|       |         * "null" client reader installed that gives an unexpected length. */
 2637|      6|        curl_off_t total_len = data->req.authneg ?
  ------------------
  |  Branch (2637:32): [True: 3, False: 3]
  ------------------
 2638|      3|                               data->state.infilesize :
 2639|      6|                               (data->state.resume_from + req_clen);
 2640|      6|        data->state.aptr.rangeline =
 2641|      6|          curl_maprintf("Content-Range: bytes %s%" FMT_OFF_T "/"
 2642|      6|                        "%" FMT_OFF_T "\r\n",
 2643|      6|                        data->state.range, total_len - 1, total_len);
 2644|      6|      }
 2645|     28|      else {
 2646|       |        /* Range was selected and then we pass the incoming range and append
 2647|       |           total size */
 2648|     28|        data->state.aptr.rangeline =
 2649|     28|          curl_maprintf("Content-Range: bytes %s/%" FMT_OFF_T "\r\n",
 2650|     28|                        data->state.range, req_clen);
 2651|     28|      }
 2652|     34|      if(!data->state.aptr.rangeline)
  ------------------
  |  Branch (2652:10): [True: 0, False: 34]
  ------------------
 2653|      0|        return CURLE_OUT_OF_MEMORY;
 2654|     34|    }
 2655|    238|  }
 2656|  6.82k|  return CURLE_OK;
 2657|  6.82k|}
http.c:http_request_version:
 1701|  6.82k|{
 1702|  6.82k|  unsigned char v = Curl_conn_http_version(data, data->conn);
 1703|  6.82k|  if(!v) {
  ------------------
  |  Branch (1703:6): [True: 2.38k, False: 4.43k]
  ------------------
 1704|       |    /* No specific HTTP connection filter installed. */
 1705|  2.38k|    v = http_may_use_1_1(data) ? 11 : 10;
  ------------------
  |  Branch (1705:9): [True: 2.37k, False: 12]
  ------------------
 1706|  2.38k|  }
 1707|  6.82k|  return v;
 1708|  6.82k|}
http.c:http_may_use_1_1:
 1682|  2.38k|{
 1683|  2.38k|  const struct connectdata *conn = data->conn;
 1684|       |  /* We have seen a previous response for *this* transfer with 1.0,
 1685|       |   * on another connection or the same one. */
 1686|  2.38k|  if(data->state.http_neg.rcvd_min == 10)
  ------------------
  |  Branch (1686:6): [True: 4, False: 2.37k]
  ------------------
 1687|      4|    return FALSE;
  ------------------
  |  | 1058|      4|#define FALSE false
  ------------------
 1688|       |  /* We have seen a previous response on *this* connection with 1.0. */
 1689|  2.37k|  if(conn && conn->httpversion_seen == 10)
  ------------------
  |  Branch (1689:6): [True: 2.37k, False: 0]
  |  Branch (1689:14): [True: 0, False: 2.37k]
  ------------------
 1690|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1691|       |  /* We want 1.0 and have seen no previous response on *this* connection
 1692|       |     with a higher version (maybe no response at all yet). */
 1693|  2.37k|  if((data->state.http_neg.only_10) &&
  ------------------
  |  Branch (1693:6): [True: 8, False: 2.37k]
  ------------------
 1694|      8|     (!conn || conn->httpversion_seen <= 10))
  ------------------
  |  Branch (1694:7): [True: 0, False: 8]
  |  Branch (1694:16): [True: 7, False: 1]
  ------------------
 1695|      7|    return FALSE;
  ------------------
  |  | 1058|      7|#define FALSE false
  ------------------
 1696|       |  /* We are not restricted to use 1.0 only. */
 1697|  2.37k|  return !data->state.http_neg.only_10;
 1698|  2.37k|}
http.c:http_add_hd:
 2868|   136k|{
 2869|   136k|  CURLcode result = CURLE_OK;
 2870|   136k|#if !defined(CURL_DISABLE_ALTSVC) || \
 2871|   136k|  !defined(CURL_DISABLE_PROXY) || \
 2872|   136k|  !defined(CURL_DISABLE_WEBSOCKETS)
 2873|   136k|  struct connectdata *conn = data->conn;
 2874|   136k|#endif
 2875|   136k|  switch(id) {
  ------------------
  |  Branch (2875:10): [True: 136k, False: 0]
  ------------------
 2876|  6.82k|  case H1_HD_REQUEST:
  ------------------
  |  Branch (2876:3): [True: 6.82k, False: 129k]
  ------------------
 2877|       |    /* add the main request stuff */
 2878|       |    /* GET/HEAD/POST/PUT */
 2879|  6.82k|    result = curlx_dyn_addf(req, "%s ", method);
 2880|  6.82k|    if(!result)
  ------------------
  |  Branch (2880:8): [True: 6.82k, False: 0]
  ------------------
 2881|  6.82k|      result = http_target(data, req);
 2882|  6.82k|    if(!result)
  ------------------
  |  Branch (2882:8): [True: 6.82k, False: 0]
  ------------------
 2883|  6.82k|      result = curlx_dyn_addf(req, " HTTP/%s\r\n",
 2884|  6.82k|                              get_http_string(httpversion));
 2885|  6.82k|    break;
 2886|       |
 2887|  6.82k|  case H1_HD_HOST:
  ------------------
  |  Branch (2887:3): [True: 6.82k, False: 129k]
  ------------------
 2888|  6.82k|    if(data->state.aptr.host)
  ------------------
  |  Branch (2888:8): [True: 6.80k, False: 17]
  ------------------
 2889|  6.80k|      result = curlx_dyn_add(req, data->state.aptr.host);
 2890|  6.82k|    break;
 2891|       |
 2892|      0|#ifndef CURL_DISABLE_PROXY
 2893|  6.82k|  case H1_HD_PROXY_AUTH:
  ------------------
  |  Branch (2893:3): [True: 6.82k, False: 129k]
  ------------------
 2894|  6.82k|    if(data->req.hd_proxy_auth)
  ------------------
  |  Branch (2894:8): [True: 2, False: 6.82k]
  ------------------
 2895|      2|      result = curlx_dyn_add(req, data->req.hd_proxy_auth);
 2896|  6.82k|    break;
 2897|      0|#endif
 2898|       |
 2899|  6.82k|  case H1_HD_AUTH:
  ------------------
  |  Branch (2899:3): [True: 6.82k, False: 129k]
  ------------------
 2900|  6.82k|    if(data->req.hd_auth)
  ------------------
  |  Branch (2900:8): [True: 3.70k, False: 3.11k]
  ------------------
 2901|  3.70k|      result = curlx_dyn_add(req, data->req.hd_auth);
 2902|  6.82k|    break;
 2903|       |
 2904|  6.82k|  case H1_HD_RANGE:
  ------------------
  |  Branch (2904:3): [True: 6.82k, False: 129k]
  ------------------
 2905|  6.82k|    if(data->state.use_range && data->state.aptr.rangeline)
  ------------------
  |  Branch (2905:8): [True: 238, False: 6.58k]
  |  Branch (2905:33): [True: 183, False: 55]
  ------------------
 2906|    183|      result = curlx_dyn_add(req, data->state.aptr.rangeline);
 2907|  6.82k|    break;
 2908|       |
 2909|  6.82k|  case H1_HD_USER_AGENT:
  ------------------
  |  Branch (2909:3): [True: 6.82k, False: 129k]
  ------------------
 2910|  6.82k|    if(data->set.str[STRING_USERAGENT] && /* User-Agent: */
  ------------------
  |  Branch (2910:8): [True: 986, False: 5.83k]
  ------------------
 2911|    986|       *data->set.str[STRING_USERAGENT] &&
  ------------------
  |  Branch (2911:8): [True: 829, False: 157]
  ------------------
 2912|    829|       data->state.aptr.uagent)
  ------------------
  |  Branch (2912:8): [True: 828, False: 1]
  ------------------
 2913|    828|      result = curlx_dyn_add(req, data->state.aptr.uagent);
 2914|  6.82k|    break;
 2915|       |
 2916|  6.82k|  case H1_HD_ACCEPT:
  ------------------
  |  Branch (2916:3): [True: 6.82k, False: 129k]
  ------------------
 2917|  6.82k|    if(!Curl_checkheaders(data, STRCONST("Accept")))
  ------------------
  |  | 1292|  6.82k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (2917:8): [True: 6.81k, False: 4]
  ------------------
 2918|  6.81k|      result = curlx_dyn_add(req, "Accept: */*\r\n");
 2919|  6.82k|    break;
 2920|       |
 2921|  6.82k|  case H1_HD_TE:
  ------------------
  |  Branch (2921:3): [True: 6.82k, False: 129k]
  ------------------
 2922|  6.82k|#ifdef HAVE_LIBZ
 2923|  6.82k|    if(!Curl_checkheaders(data, STRCONST("TE")) &&
  ------------------
  |  | 1292|  6.82k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (2923:8): [True: 6.81k, False: 5]
  ------------------
 2924|  6.81k|       data->set.http_transfer_encoding) {
  ------------------
  |  Branch (2924:8): [True: 452, False: 6.36k]
  ------------------
 2925|    452|      data->state.http_hd_te = TRUE;
  ------------------
  |  | 1055|    452|#define TRUE true
  ------------------
 2926|    452|      result = curlx_dyn_add(req, "TE: gzip\r\n");
 2927|    452|    }
 2928|  6.82k|#endif
 2929|  6.82k|    break;
 2930|       |
 2931|  6.82k|  case H1_HD_ACCEPT_ENCODING:
  ------------------
  |  Branch (2931:3): [True: 6.82k, False: 129k]
  ------------------
 2932|  6.82k|    curlx_safefree(data->state.aptr.accept_encoding);
  ------------------
  |  | 1327|  6.82k|  do {                      \
  |  | 1328|  6.82k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  6.82k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  6.82k|    (ptr) = NULL;           \
  |  | 1330|  6.82k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 6.82k]
  |  |  ------------------
  ------------------
 2933|  6.82k|    if(!Curl_checkheaders(data, STRCONST("Accept-Encoding")) &&
  ------------------
  |  | 1292|  6.82k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (2933:8): [True: 6.82k, False: 0]
  ------------------
 2934|  6.82k|       data->set.str[STRING_ENCODING])
  ------------------
  |  Branch (2934:8): [True: 163, False: 6.65k]
  ------------------
 2935|    163|      result = curlx_dyn_addf(req, "Accept-Encoding: %s\r\n",
 2936|    163|                              data->set.str[STRING_ENCODING]);
 2937|  6.82k|    break;
 2938|       |
 2939|  6.82k|  case H1_HD_REFERER:
  ------------------
  |  Branch (2939:3): [True: 6.82k, False: 129k]
  ------------------
 2940|  6.82k|    curlx_safefree(data->state.aptr.ref);
  ------------------
  |  | 1327|  6.82k|  do {                      \
  |  | 1328|  6.82k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  6.82k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  6.82k|    (ptr) = NULL;           \
  |  | 1330|  6.82k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 6.82k]
  |  |  ------------------
  ------------------
 2941|  6.82k|    if(Curl_bufref_ptr(&data->state.referer) &&
  ------------------
  |  Branch (2941:8): [True: 184, False: 6.63k]
  ------------------
 2942|    184|       !Curl_checkheaders(data, STRCONST("Referer")))
  ------------------
  |  | 1292|    184|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (2942:8): [True: 184, False: 0]
  ------------------
 2943|    184|      result = curlx_dyn_addf(req, "Referer: %s\r\n",
 2944|    184|                              Curl_bufref_ptr(&data->state.referer));
 2945|  6.82k|    break;
 2946|       |
 2947|      0|#ifndef CURL_DISABLE_PROXY
 2948|  6.82k|  case H1_HD_PROXY_CONNECTION:
  ------------------
  |  Branch (2948:3): [True: 6.82k, False: 129k]
  ------------------
 2949|  6.82k|    if(conn->bits.httpproxy &&
  ------------------
  |  Branch (2949:8): [True: 6.82k, False: 0]
  ------------------
 2950|  6.82k|       !conn->bits.tunnel_proxy &&
  ------------------
  |  Branch (2950:8): [True: 126, False: 6.69k]
  ------------------
 2951|    126|       !Curl_checkheaders(data, STRCONST("Proxy-Connection")) &&
  ------------------
  |  | 1292|    126|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (2951:8): [True: 126, False: 0]
  ------------------
 2952|    126|       !Curl_checkProxyheaders(data, data->conn, STRCONST("Proxy-Connection")))
  ------------------
  |  | 1292|    126|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (2952:8): [True: 126, False: 0]
  ------------------
 2953|    126|      result = curlx_dyn_add(req, "Proxy-Connection: Keep-Alive\r\n");
 2954|  6.82k|    break;
 2955|      0|#endif
 2956|       |
 2957|  6.82k|  case H1_HD_TRANSFER_ENCODING:
  ------------------
  |  Branch (2957:3): [True: 6.82k, False: 129k]
  ------------------
 2958|  6.82k|    result = http_req_set_TE(data, req, httpversion);
 2959|  6.82k|    break;
 2960|       |
 2961|      0|#ifndef CURL_DISABLE_ALTSVC
 2962|  6.82k|  case H1_HD_ALT_USED:
  ------------------
  |  Branch (2962:3): [True: 6.82k, False: 129k]
  ------------------
 2963|  6.82k|    if(conn->bits.altused && conn->via_peer &&
  ------------------
  |  Branch (2963:8): [True: 0, False: 6.82k]
  |  Branch (2963:30): [True: 0, False: 0]
  ------------------
 2964|      0|       !Curl_checkheaders(data, STRCONST("Alt-Used")))
  ------------------
  |  | 1292|      0|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (2964:8): [True: 0, False: 0]
  ------------------
 2965|      0|      result = curlx_dyn_addf(req, "Alt-Used: %s:%u\r\n",
 2966|      0|                              conn->via_peer->hostname, conn->via_peer->port);
 2967|  6.82k|    break;
 2968|      0|#endif
 2969|       |
 2970|  6.82k|  case H1_HD_UPGRADE:
  ------------------
  |  Branch (2970:3): [True: 6.82k, False: 129k]
  ------------------
 2971|  6.82k|    if(!Curl_conn_is_ssl(data->conn, FIRSTSOCKET) && (httpversion < 20) &&
  ------------------
  |  |  303|  6.82k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (2971:8): [True: 6.82k, False: 0]
  |  Branch (2971:54): [True: 2.38k, False: 4.43k]
  ------------------
 2972|  2.38k|       (data->state.http_neg.wanted & CURL_HTTP_V2x) &&
  ------------------
  |  |   41|  2.38k|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  |  Branch (2972:8): [True: 2.36k, False: 13]
  ------------------
 2973|  2.36k|       data->state.http_neg.h2_upgrade) {
  ------------------
  |  Branch (2973:8): [True: 29, False: 2.34k]
  ------------------
 2974|       |      /* append HTTP2 upgrade magic stuff to the HTTP request if it is not done
 2975|       |         over SSL */
 2976|     29|      result = Curl_http2_request_upgrade(req, data);
 2977|     29|    }
 2978|  6.82k|#ifndef CURL_DISABLE_WEBSOCKETS
 2979|  6.82k|    if(!result && conn->scheme->protocol & (CURLPROTO_WS | CURLPROTO_WSS))
  ------------------
  |  |   63|  6.82k|#define CURLPROTO_WS     (1L << 30)
  ------------------
                  if(!result && conn->scheme->protocol & (CURLPROTO_WS | CURLPROTO_WSS))
  ------------------
  |  |   64|  6.82k|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  ------------------
  |  Branch (2979:8): [True: 6.82k, False: 0]
  |  Branch (2979:19): [True: 0, False: 6.82k]
  ------------------
 2980|      0|      result = Curl_ws_request(data, req);
 2981|  6.82k|#endif
 2982|  6.82k|    break;
 2983|       |
 2984|  6.82k|  case H1_HD_COOKIES:
  ------------------
  |  Branch (2984:3): [True: 6.82k, False: 129k]
  ------------------
 2985|  6.82k|    result = http_cookies(data, req);
 2986|  6.82k|    break;
 2987|       |
 2988|  6.82k|  case H1_HD_CONDITIONALS:
  ------------------
  |  Branch (2988:3): [True: 6.82k, False: 129k]
  ------------------
 2989|  6.82k|    result = Curl_add_timecondition(data, req);
 2990|  6.82k|    break;
 2991|       |
 2992|  6.82k|  case H1_HD_CUSTOM:
  ------------------
  |  Branch (2992:3): [True: 6.82k, False: 129k]
  ------------------
 2993|  6.82k|    result = Curl_add_custom_headers(data, FALSE, httpversion, req);
  ------------------
  |  | 1058|  6.82k|#define FALSE false
  ------------------
 2994|  6.82k|    break;
 2995|       |
 2996|  6.82k|  case H1_HD_CONTENT:
  ------------------
  |  Branch (2996:3): [True: 6.82k, False: 129k]
  ------------------
 2997|  6.82k|    result = http_add_content_hds(data, req, httpversion, httpreq);
 2998|  6.82k|    break;
 2999|       |
 3000|  6.82k|  case H1_HD_CONNECTION: {
  ------------------
  |  Branch (3000:3): [True: 6.82k, False: 129k]
  ------------------
 3001|  6.82k|    result = http_add_connection_hd(data, req);
 3002|  6.82k|    break;
 3003|      0|  }
 3004|       |
 3005|  6.82k|  case H1_HD_LAST:
  ------------------
  |  Branch (3005:3): [True: 6.82k, False: 129k]
  ------------------
 3006|  6.82k|    result = curlx_dyn_addn(req, STRCONST("\r\n"));
  ------------------
  |  | 1292|  6.82k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 3007|  6.82k|    break;
 3008|   136k|  }
 3009|   136k|  return result;
 3010|   136k|}
http.c:http_target:
 2071|  6.82k|{
 2072|  6.82k|  CURLcode result = CURLE_OK;
 2073|  6.82k|  const char *path = data->state.up.path;
 2074|  6.82k|  const char *query = data->state.up.query;
 2075|  6.82k|#ifndef CURL_DISABLE_PROXY
 2076|  6.82k|  struct connectdata *conn = data->conn;
 2077|  6.82k|#endif
 2078|       |
 2079|  6.82k|  if(data->set.str[STRING_TARGET]) {
  ------------------
  |  Branch (2079:6): [True: 90, False: 6.73k]
  ------------------
 2080|     90|    path = data->set.str[STRING_TARGET];
 2081|     90|    query = NULL;
 2082|     90|  }
 2083|       |
 2084|  6.82k|#ifndef CURL_DISABLE_PROXY
 2085|  6.82k|  if(conn->bits.httpproxy && !conn->bits.tunnel_proxy) {
  ------------------
  |  Branch (2085:6): [True: 6.82k, False: 0]
  |  Branch (2085:30): [True: 126, False: 6.69k]
  ------------------
 2086|       |    /* Using a proxy but does not tunnel through it */
 2087|       |
 2088|       |    /* The path sent to the proxy is in fact the entire URL, but if the remote
 2089|       |       host is a IDN-name, we must make sure that the request we produce only
 2090|       |       uses the encoded hostname! */
 2091|       |
 2092|       |    /* and no fragment part */
 2093|    126|    CURLUcode uc;
 2094|    126|    char *url;
 2095|    126|    CURLU *h = curl_url_dup(data->state.uh);
 2096|    126|    if(!h)
  ------------------
  |  Branch (2096:8): [True: 0, False: 126]
  ------------------
 2097|      0|      return CURLE_OUT_OF_MEMORY;
 2098|       |
 2099|    126|    if(conn->origin->user_hostname != conn->origin->hostname) {
  ------------------
  |  Branch (2099:8): [True: 0, False: 126]
  ------------------
 2100|      0|      uc = curl_url_set(h, CURLUPART_HOST, conn->origin->hostname, 0);
 2101|      0|      if(uc) {
  ------------------
  |  Branch (2101:10): [True: 0, False: 0]
  ------------------
 2102|      0|        curl_url_cleanup(h);
 2103|      0|        return CURLE_OUT_OF_MEMORY;
 2104|      0|      }
 2105|      0|    }
 2106|    126|    uc = curl_url_set(h, CURLUPART_FRAGMENT, NULL, 0);
 2107|    126|    if(uc) {
  ------------------
  |  Branch (2107:8): [True: 0, False: 126]
  ------------------
 2108|      0|      curl_url_cleanup(h);
 2109|      0|      return CURLE_OUT_OF_MEMORY;
 2110|      0|    }
 2111|       |
 2112|    126|    if(curl_strequal("http", data->state.up.scheme)) {
  ------------------
  |  Branch (2112:8): [True: 0, False: 126]
  ------------------
 2113|       |      /* when getting HTTP, we do not want the userinfo the URL */
 2114|      0|      uc = curl_url_set(h, CURLUPART_USER, NULL, 0);
 2115|      0|      if(uc) {
  ------------------
  |  Branch (2115:10): [True: 0, False: 0]
  ------------------
 2116|      0|        curl_url_cleanup(h);
 2117|      0|        return CURLE_OUT_OF_MEMORY;
 2118|      0|      }
 2119|      0|      uc = curl_url_set(h, CURLUPART_PASSWORD, NULL, 0);
 2120|      0|      if(uc) {
  ------------------
  |  Branch (2120:10): [True: 0, False: 0]
  ------------------
 2121|      0|        curl_url_cleanup(h);
 2122|      0|        return CURLE_OUT_OF_MEMORY;
 2123|      0|      }
 2124|      0|    }
 2125|    126|    else if(data->state.creds && (data->state.creds->source != CREDS_URL)) {
  ------------------
  |  |   30|     75|#define CREDS_URL    1 /* username/passwd from URL */
  ------------------
  |  Branch (2125:13): [True: 75, False: 51]
  |  Branch (2125:34): [True: 74, False: 1]
  ------------------
 2126|       |        /* credentials not from the URL need to be set */
 2127|     74|      uc = curl_url_set(h, CURLUPART_USER,
 2128|     74|                        data->state.creds->user, CURLU_URLENCODE);
  ------------------
  |  |   94|     74|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
 2129|     74|      if(!uc)
  ------------------
  |  Branch (2129:10): [True: 74, False: 0]
  ------------------
 2130|     74|        uc = curl_url_set(h, CURLUPART_PASSWORD,
 2131|     74|                          data->state.creds->passwd, CURLU_URLENCODE);
  ------------------
  |  |   94|     74|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
 2132|     74|      if(uc) {
  ------------------
  |  Branch (2132:10): [True: 0, False: 74]
  ------------------
 2133|      0|        curl_url_cleanup(h);
 2134|      0|        return Curl_uc_to_curlcode(uc);
 2135|      0|      }
 2136|     74|    }
 2137|       |
 2138|       |    /* Extract the URL to use in the request. */
 2139|    126|    uc = curl_url_get(h, CURLUPART_URL, &url, CURLU_NO_DEFAULT_PORT);
  ------------------
  |  |   85|    126|#define CURLU_NO_DEFAULT_PORT (1 << 1)    /* act as if no port number was set,
  ------------------
 2140|    126|    if(uc) {
  ------------------
  |  Branch (2140:8): [True: 0, False: 126]
  ------------------
 2141|      0|      curl_url_cleanup(h);
 2142|      0|      return CURLE_OUT_OF_MEMORY;
 2143|      0|    }
 2144|       |
 2145|    126|    curl_url_cleanup(h);
 2146|       |
 2147|       |    /* target or URL */
 2148|    126|    result = curlx_dyn_add(r, data->set.str[STRING_TARGET] ?
  ------------------
  |  Branch (2148:31): [True: 1, False: 125]
  ------------------
 2149|    125|      data->set.str[STRING_TARGET] : url);
 2150|    126|    curlx_free(url);
  ------------------
  |  | 1483|    126|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2151|    126|    if(result)
  ------------------
  |  Branch (2151:8): [True: 0, False: 126]
  ------------------
 2152|      0|      return result;
 2153|       |
 2154|    126|    if(curl_strequal("ftp", data->state.up.scheme) &&
  ------------------
  |  Branch (2154:8): [True: 126, False: 0]
  ------------------
 2155|    126|       data->set.proxy_transfer_mode) {
  ------------------
  |  Branch (2155:8): [True: 4, False: 122]
  ------------------
 2156|       |      /* when doing ftp, append ;type=<a|i> if not present */
 2157|      4|      size_t len = strlen(path);
 2158|      4|      bool type_present = FALSE;
  ------------------
  |  | 1058|      4|#define FALSE false
  ------------------
 2159|      4|      if((len >= 7) && !memcmp(&path[len - 7], ";type=", 6)) {
  ------------------
  |  Branch (2159:10): [True: 3, False: 1]
  |  Branch (2159:24): [True: 0, False: 3]
  ------------------
 2160|      0|        switch(Curl_raw_toupper(path[len - 1])) {
  ------------------
  |  Branch (2160:16): [True: 0, False: 0]
  ------------------
 2161|      0|        case 'A':
  ------------------
  |  Branch (2161:9): [True: 0, False: 0]
  ------------------
 2162|      0|        case 'D':
  ------------------
  |  Branch (2162:9): [True: 0, False: 0]
  ------------------
 2163|      0|        case 'I':
  ------------------
  |  Branch (2163:9): [True: 0, False: 0]
  ------------------
 2164|      0|          type_present = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2165|      0|          break;
 2166|      0|        }
 2167|      0|      }
 2168|      4|      if(!type_present) {
  ------------------
  |  Branch (2168:10): [True: 4, False: 0]
  ------------------
 2169|      4|        result = curlx_dyn_addf(r, ";type=%c",
 2170|      4|                                data->state.prefer_ascii ? 'a' : 'i');
  ------------------
  |  Branch (2170:33): [True: 0, False: 4]
  ------------------
 2171|      4|        if(result)
  ------------------
  |  Branch (2171:12): [True: 0, False: 4]
  ------------------
 2172|      0|          return result;
 2173|      4|      }
 2174|      4|    }
 2175|    126|  }
 2176|       |
 2177|  6.69k|  else
 2178|  6.69k|#endif
 2179|  6.69k|  {
 2180|  6.69k|    result = curlx_dyn_add(r, path);
 2181|  6.69k|    if(result)
  ------------------
  |  Branch (2181:8): [True: 0, False: 6.69k]
  ------------------
 2182|      0|      return result;
 2183|  6.69k|    if(query)
  ------------------
  |  Branch (2183:8): [True: 1.52k, False: 5.17k]
  ------------------
 2184|  1.52k|      result = curlx_dyn_addf(r, "?%s", query);
 2185|  6.69k|  }
 2186|       |
 2187|  6.82k|  return result;
 2188|  6.82k|}
http.c:get_http_string:
 1711|  6.82k|{
 1712|  6.82k|  switch(httpversion) {
 1713|      0|  case 30:
  ------------------
  |  Branch (1713:3): [True: 0, False: 6.82k]
  ------------------
 1714|      0|    return "3";
 1715|  4.43k|  case 20:
  ------------------
  |  Branch (1715:3): [True: 4.43k, False: 2.38k]
  ------------------
 1716|  4.43k|    return "2";
 1717|  2.37k|  case 11:
  ------------------
  |  Branch (1717:3): [True: 2.37k, False: 4.45k]
  ------------------
 1718|  2.37k|    return "1.1";
 1719|     12|  default:
  ------------------
  |  Branch (1719:3): [True: 12, False: 6.81k]
  ------------------
 1720|     12|    return "1.0";
 1721|  6.82k|  }
 1722|  6.82k|}
http.c:http_req_set_TE:
 2368|  6.82k|{
 2369|  6.82k|  CURLcode result = CURLE_OK;
 2370|  6.82k|  const char *ptr;
 2371|       |
 2372|  6.82k|  ptr = Curl_checkheaders(data, STRCONST("Transfer-Encoding"));
  ------------------
  |  | 1292|  6.82k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 2373|  6.82k|  if(ptr) {
  ------------------
  |  Branch (2373:6): [True: 4, False: 6.81k]
  ------------------
 2374|       |    /* Some kind of TE is requested, check if 'chunked' is chosen */
 2375|      4|    data->req.upload_chunky =
 2376|      4|      Curl_compareheader(ptr,
 2377|      4|                         STRCONST("Transfer-Encoding:"), STRCONST("chunked"));
  ------------------
  |  | 1292|      4|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
                                       STRCONST("Transfer-Encoding:"), STRCONST("chunked"));
  ------------------
  |  | 1292|      4|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 2378|      4|    if(data->req.upload_chunky && (httpversion >= 20)) {
  ------------------
  |  Branch (2378:8): [True: 3, False: 1]
  |  Branch (2378:35): [True: 1, False: 2]
  ------------------
 2379|      1|      infof(data, "suppressing chunked transfer encoding on connection "
  ------------------
  |  |  143|      1|  do {                               \
  |  |  144|      1|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      1|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 1, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  320|      1|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      1|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      1|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1]
  |  |  ------------------
  ------------------
 2380|      1|            "using HTTP version 2 or higher");
 2381|      1|      data->req.upload_chunky = FALSE;
  ------------------
  |  | 1058|      1|#define FALSE false
  ------------------
 2382|      1|    }
 2383|      4|  }
 2384|  6.81k|  else {
 2385|  6.81k|    curl_off_t req_clen = Curl_creader_total_length(data);
 2386|       |
 2387|  6.81k|    if(req_clen < 0) {
  ------------------
  |  Branch (2387:8): [True: 133, False: 6.68k]
  ------------------
 2388|       |      /* indeterminate request content length */
 2389|    133|      if(httpversion > 10) {
  ------------------
  |  Branch (2389:10): [True: 132, False: 1]
  ------------------
 2390|       |        /* On HTTP/1.1, enable chunked, on HTTP/2 and later we do not
 2391|       |         * need it */
 2392|    132|        data->req.upload_chunky = (httpversion < 20);
 2393|    132|      }
 2394|      1|      else {
 2395|      1|        failf(data, "Chunky upload is not supported by HTTP 1.0");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
 2396|      1|        return CURLE_UPLOAD_FAILED;
 2397|      1|      }
 2398|    133|    }
 2399|  6.68k|    else {
 2400|       |      /* else, no chunky upload */
 2401|  6.68k|      data->req.upload_chunky = FALSE;
  ------------------
  |  | 1058|  6.68k|#define FALSE false
  ------------------
 2402|  6.68k|    }
 2403|       |
 2404|  6.81k|    if(data->req.upload_chunky)
  ------------------
  |  Branch (2404:8): [True: 99, False: 6.71k]
  ------------------
 2405|     99|      result = curlx_dyn_add(req, "Transfer-Encoding: chunked\r\n");
 2406|  6.81k|  }
 2407|  6.82k|  return result;
 2408|  6.82k|}
http.c:http_cookies:
 2528|  6.82k|{
 2529|  6.82k|  CURLcode result = CURLE_OK;
 2530|  6.82k|  char *addcookies = NULL;
 2531|  6.82k|  bool linecap = FALSE;
  ------------------
  |  | 1058|  6.82k|#define FALSE false
  ------------------
 2532|  6.82k|  if(data->set.str[STRING_COOKIE] &&
  ------------------
  |  Branch (2532:6): [True: 202, False: 6.61k]
  ------------------
 2533|    202|     !Curl_checkheaders(data, STRCONST("Cookie")) &&
  ------------------
  |  | 1292|    202|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (2533:6): [True: 194, False: 8]
  ------------------
 2534|    194|     Curl_auth_allowed_to_host(data))
  ------------------
  |  Branch (2534:6): [True: 194, False: 0]
  ------------------
 2535|    194|    addcookies = data->set.str[STRING_COOKIE];
 2536|       |
 2537|  6.82k|  if(data->cookies || addcookies) {
  ------------------
  |  Branch (2537:6): [True: 6.82k, False: 0]
  |  Branch (2537:23): [True: 0, False: 0]
  ------------------
 2538|  6.82k|    struct Curl_llist list;
 2539|  6.82k|    int count = 0;
 2540|       |
 2541|  6.82k|    if(data->cookies && data->state.cookie_engine) {
  ------------------
  |  Branch (2541:8): [True: 6.82k, False: 0]
  |  Branch (2541:25): [True: 6.82k, False: 0]
  ------------------
 2542|  6.82k|      bool okay;
 2543|  6.82k|      const char *host = data->req.cookiehost ?
  ------------------
  |  Branch (2543:26): [True: 33, False: 6.78k]
  ------------------
 2544|  6.78k|        data->req.cookiehost : data->conn->origin->hostname;
 2545|  6.82k|      Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 2546|  6.82k|      result = Curl_cookie_getlist(data, data->conn, &okay, host, &list);
 2547|  6.82k|      if(!result && okay) {
  ------------------
  |  Branch (2547:10): [True: 6.82k, False: 0]
  |  Branch (2547:21): [True: 71, False: 6.75k]
  ------------------
 2548|     71|        struct Curl_llist_node *n;
 2549|     71|        size_t clen = 8; /* hold the size of the generated Cookie: header */
 2550|       |
 2551|       |        /* loop through all cookies that matched */
 2552|    215|        for(n = Curl_llist_head(&list); n; n = Curl_node_next(n)) {
  ------------------
  |  Branch (2552:41): [True: 144, False: 71]
  ------------------
 2553|    144|          struct Cookie *co = Curl_node_elem(n);
 2554|    144|          if(co->value) {
  ------------------
  |  Branch (2554:14): [True: 144, False: 0]
  ------------------
 2555|    144|            size_t add;
 2556|    144|            if(!count) {
  ------------------
  |  Branch (2556:16): [True: 52, False: 92]
  ------------------
 2557|     52|              result = curlx_dyn_addn(r, STRCONST("Cookie: "));
  ------------------
  |  | 1292|     52|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 2558|     52|              if(result)
  ------------------
  |  Branch (2558:18): [True: 0, False: 52]
  ------------------
 2559|      0|                break;
 2560|     52|            }
 2561|    144|            add = strlen(co->name) + strlen(co->value) + 1;
 2562|    144|            if(clen + add >= MAX_COOKIE_HEADER_LEN) {
  ------------------
  |  |   97|    144|#define MAX_COOKIE_HEADER_LEN 8190
  ------------------
  |  Branch (2562:16): [True: 0, False: 144]
  ------------------
 2563|      0|              infof(data, "Restricted outgoing cookies due to header size, "
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2564|      0|                    "'%s' not sent", co->name);
 2565|      0|              linecap = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2566|      0|              break;
 2567|      0|            }
 2568|    144|            result = curlx_dyn_addf(r, "%s%s=%s", count ? "; " : "",
  ------------------
  |  Branch (2568:51): [True: 92, False: 52]
  ------------------
 2569|    144|                                    co->name, co->value);
 2570|    144|            if(result)
  ------------------
  |  Branch (2570:16): [True: 0, False: 144]
  ------------------
 2571|      0|              break;
 2572|    144|            clen += add + (count ? 2 : 0);
  ------------------
  |  Branch (2572:28): [True: 92, False: 52]
  ------------------
 2573|    144|            count++;
 2574|    144|          }
 2575|    144|        }
 2576|     71|        Curl_llist_destroy(&list, NULL);
 2577|     71|      }
 2578|  6.82k|      Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 2579|  6.82k|    }
 2580|  6.82k|    if(addcookies && !result && !linecap) {
  ------------------
  |  Branch (2580:8): [True: 194, False: 6.62k]
  |  Branch (2580:22): [True: 194, False: 0]
  |  Branch (2580:33): [True: 194, False: 0]
  ------------------
 2581|    194|      if(!count)
  ------------------
  |  Branch (2581:10): [True: 191, False: 3]
  ------------------
 2582|    191|        result = curlx_dyn_addn(r, STRCONST("Cookie: "));
  ------------------
  |  | 1292|    191|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 2583|    194|      if(!result) {
  ------------------
  |  Branch (2583:10): [True: 194, False: 0]
  ------------------
 2584|    194|        result = curlx_dyn_addf(r, "%s%s", count ? "; " : "", addcookies);
  ------------------
  |  Branch (2584:44): [True: 3, False: 191]
  ------------------
 2585|    194|        count++;
 2586|    194|      }
 2587|    194|    }
 2588|  6.82k|    if(count && !result)
  ------------------
  |  Branch (2588:8): [True: 243, False: 6.57k]
  |  Branch (2588:17): [True: 243, False: 0]
  ------------------
 2589|    243|      result = curlx_dyn_addn(r, STRCONST("\r\n"));
  ------------------
  |  | 1292|    243|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 2590|       |
 2591|  6.82k|    if(result)
  ------------------
  |  Branch (2591:8): [True: 0, False: 6.82k]
  ------------------
 2592|      0|      return result;
 2593|  6.82k|  }
 2594|  6.82k|  return result;
 2595|  6.82k|}
http.c:http_add_content_hds:
 2449|  6.82k|{
 2450|  6.82k|  CURLcode result = CURLE_OK;
 2451|  6.82k|  curl_off_t req_clen;
 2452|  6.82k|  bool announced_exp100 = FALSE;
  ------------------
  |  | 1058|  6.82k|#define FALSE false
  ------------------
 2453|       |
 2454|  6.82k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|  6.82k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2454:3): [True: 0, False: 6.82k]
  |  Branch (2454:3): [True: 6.82k, False: 0]
  ------------------
 2455|  6.82k|  if(data->req.upload_chunky) {
  ------------------
  |  Branch (2455:6): [True: 101, False: 6.72k]
  ------------------
 2456|    101|    result = Curl_httpchunk_add_reader(data);
 2457|    101|    if(result)
  ------------------
  |  Branch (2457:8): [True: 0, False: 101]
  ------------------
 2458|      0|      return result;
 2459|    101|  }
 2460|       |
 2461|       |  /* Get the request body length that has been set up */
 2462|  6.82k|  req_clen = Curl_creader_total_length(data);
 2463|  6.82k|  switch(httpreq) {
 2464|    166|  case HTTPREQ_PUT:
  ------------------
  |  Branch (2464:3): [True: 166, False: 6.65k]
  ------------------
 2465|    421|  case HTTPREQ_POST:
  ------------------
  |  Branch (2465:3): [True: 255, False: 6.56k]
  ------------------
 2466|    421|#if !defined(CURL_DISABLE_MIME) || !defined(CURL_DISABLE_FORM_API)
 2467|    560|  case HTTPREQ_POST_FORM:
  ------------------
  |  Branch (2467:3): [True: 139, False: 6.68k]
  ------------------
 2468|    962|  case HTTPREQ_POST_MIME:
  ------------------
  |  Branch (2468:3): [True: 402, False: 6.41k]
  ------------------
 2469|    962|#endif
 2470|       |    /* We only set Content-Length and allow a custom Content-Length if
 2471|       |       we do not upload data chunked, as RFC2616 forbids us to set both
 2472|       |       kinds of headers (Transfer-Encoding: chunked and Content-Length).
 2473|       |       We do not override a custom "Content-Length" header, but during
 2474|       |       authentication negotiation that header is suppressed.
 2475|       |     */
 2476|    962|    if(req_clen >= 0 && !data->req.upload_chunky &&
  ------------------
  |  Branch (2476:8): [True: 828, False: 134]
  |  Branch (2476:25): [True: 828, False: 0]
  ------------------
 2477|    828|       (data->req.authneg ||
  ------------------
  |  Branch (2477:9): [True: 12, False: 816]
  ------------------
 2478|    828|        !Curl_checkheaders(data, STRCONST("Content-Length")))) {
  ------------------
  |  | 1292|    816|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (2478:9): [True: 816, False: 0]
  ------------------
 2479|       |      /* we allow replacing this header if not during auth negotiation,
 2480|       |         although it is not wise to actually set your own */
 2481|    828|      result = curlx_dyn_addf(r, "Content-Length: %" FMT_OFF_T "\r\n",
 2482|    828|                              req_clen);
 2483|    828|    }
 2484|    962|    if(result)
  ------------------
  |  Branch (2484:8): [True: 0, False: 962]
  ------------------
 2485|      0|      goto out;
 2486|       |
 2487|    962|#ifndef CURL_DISABLE_MIME
 2488|       |    /* Output mime-generated headers. */
 2489|    962|    if(data->state.mimepost &&
  ------------------
  |  Branch (2489:8): [True: 536, False: 426]
  ------------------
 2490|    536|       ((httpreq == HTTPREQ_POST_FORM) || (httpreq == HTTPREQ_POST_MIME))) {
  ------------------
  |  Branch (2490:9): [True: 137, False: 399]
  |  Branch (2490:43): [True: 399, False: 0]
  ------------------
 2491|    536|      struct curl_slist *hdr;
 2492|       |
 2493|  1.07k|      for(hdr = data->state.mimepost->curlheaders; hdr; hdr = hdr->next) {
  ------------------
  |  Branch (2493:52): [True: 536, False: 536]
  ------------------
 2494|    536|        result = curlx_dyn_addf(r, "%s\r\n", hdr->data);
 2495|    536|        if(result)
  ------------------
  |  Branch (2495:12): [True: 0, False: 536]
  ------------------
 2496|      0|          goto out;
 2497|    536|      }
 2498|    536|    }
 2499|    962|#endif
 2500|    962|    if(httpreq == HTTPREQ_POST) {
  ------------------
  |  Branch (2500:8): [True: 255, False: 707]
  ------------------
 2501|    255|      if(!Curl_checkheaders(data, STRCONST("Content-Type"))) {
  ------------------
  |  | 1292|    255|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (2501:10): [True: 254, False: 1]
  ------------------
 2502|    254|        result = curlx_dyn_addn(r, STRCONST("Content-Type: application/"
  ------------------
  |  | 1292|    254|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 2503|    254|                                            "x-www-form-urlencoded\r\n"));
 2504|    254|        if(result)
  ------------------
  |  Branch (2504:12): [True: 0, False: 254]
  ------------------
 2505|      0|          goto out;
 2506|    254|      }
 2507|    255|    }
 2508|    962|    result = addexpect(data, r, httpversion, &announced_exp100);
 2509|    962|    if(result)
  ------------------
  |  Branch (2509:8): [True: 0, False: 962]
  ------------------
 2510|      0|      goto out;
 2511|    962|    break;
 2512|  5.85k|  default:
  ------------------
  |  Branch (2512:3): [True: 5.85k, False: 962]
  ------------------
 2513|  5.85k|    break;
 2514|  6.82k|  }
 2515|       |
 2516|  6.82k|  Curl_pgrsSetUploadSize(data, req_clen);
 2517|  6.82k|  if(announced_exp100)
  ------------------
  |  Branch (2517:6): [True: 57, False: 6.76k]
  ------------------
 2518|     57|    result = http_exp100_add_reader(data);
 2519|       |
 2520|  6.82k|out:
 2521|  6.82k|  return result;
 2522|  6.82k|}
http.c:addexpect:
 2412|    962|{
 2413|    962|  CURLcode result;
 2414|    962|  char *ptr;
 2415|       |
 2416|    962|  *announced_exp100 = FALSE;
  ------------------
  |  | 1058|    962|#define FALSE false
  ------------------
 2417|       |  /* Avoid Expect: 100-continue if Upgrade: is used */
 2418|    962|  if(data->req.upgr101 != UPGR101_NONE)
  ------------------
  |  Branch (2418:6): [True: 3, False: 959]
  ------------------
 2419|      3|    return CURLE_OK;
 2420|       |
 2421|       |  /* For really small puts we do not use Expect: headers at all, and for
 2422|       |     the somewhat bigger ones we allow the app to disable it. Make
 2423|       |     sure that the expect100header is always set to the preferred value
 2424|       |     here. */
 2425|    959|  ptr = Curl_checkheaders(data, STRCONST("Expect"));
  ------------------
  |  | 1292|    959|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 2426|    959|  if(ptr) {
  ------------------
  |  Branch (2426:6): [True: 4, False: 955]
  ------------------
 2427|      4|    *announced_exp100 =
 2428|      4|      Curl_compareheader(ptr, STRCONST("Expect:"), STRCONST("100-continue"));
  ------------------
  |  | 1292|      4|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
                    Curl_compareheader(ptr, STRCONST("Expect:"), STRCONST("100-continue"));
  ------------------
  |  | 1292|      4|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 2429|      4|  }
 2430|    955|  else if(!data->state.disableexpect && (httpversion == 11)) {
  ------------------
  |  Branch (2430:11): [True: 955, False: 0]
  |  Branch (2430:41): [True: 462, False: 493]
  ------------------
 2431|       |    /* if not doing HTTP 1.0 or version 2, or disabled explicitly, we add an
 2432|       |       Expect: 100-continue to the headers which actually speeds up post
 2433|       |       operations (as there is one packet coming back from the web server) */
 2434|    462|    curl_off_t client_len = Curl_creader_client_length(data);
 2435|    462|    if(client_len > EXPECT_100_THRESHOLD || client_len < 0) {
  ------------------
  |  |  147|    924|#define EXPECT_100_THRESHOLD (1024 * 1024)
  ------------------
  |  Branch (2435:8): [True: 0, False: 462]
  |  Branch (2435:45): [True: 57, False: 405]
  ------------------
 2436|     57|      result = curlx_dyn_addn(r, STRCONST("Expect: 100-continue\r\n"));
  ------------------
  |  | 1292|     57|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 2437|     57|      if(result)
  ------------------
  |  Branch (2437:10): [True: 0, False: 57]
  ------------------
 2438|      0|        return result;
 2439|     57|      *announced_exp100 = TRUE;
  ------------------
  |  | 1055|     57|#define TRUE true
  ------------------
 2440|     57|    }
 2441|    462|  }
 2442|    959|  return CURLE_OK;
 2443|    959|}
http.c:http_exp100_add_reader:
 1536|     57|{
 1537|     57|  struct Curl_creader *reader = NULL;
 1538|     57|  CURLcode result;
 1539|       |
 1540|     57|  result = Curl_creader_create(&reader, data, &cr_exp100, CURL_CR_PROTOCOL);
 1541|     57|  if(!result)
  ------------------
  |  Branch (1541:6): [True: 57, False: 0]
  ------------------
 1542|     57|    result = Curl_creader_add(data, reader);
 1543|     57|  if(!result) {
  ------------------
  |  Branch (1543:6): [True: 57, False: 0]
  ------------------
 1544|     57|    struct cr_exp100_ctx *ctx = reader->ctx;
 1545|     57|    ctx->state = EXP100_SENDING_REQUEST;
 1546|     57|  }
 1547|       |
 1548|     57|  if(result && reader)
  ------------------
  |  Branch (1548:6): [True: 0, False: 57]
  |  Branch (1548:16): [True: 0, False: 0]
  ------------------
 1549|      0|    Curl_creader_free(data, reader);
 1550|     57|  return result;
 1551|     57|}
http.c:http_add_connection_hd:
 2773|  6.82k|{
 2774|  6.82k|  struct curl_slist *head;
 2775|  6.82k|  const char *sep = "Connection: ";
 2776|  6.82k|  CURLcode result = CURLE_OK;
 2777|  6.82k|  size_t rlen = curlx_dyn_len(req);
 2778|  6.82k|  bool skip;
 2779|       |
 2780|       |  /* Add the 1st custom "Connection: " header, if there is one */
 2781|  11.6k|  for(head = data->set.headers; head; head = head->next) {
  ------------------
  |  Branch (2781:33): [True: 4.80k, False: 6.81k]
  ------------------
 2782|  4.80k|    if(curl_strnequal(head->data, "Connection", 10) &&
  ------------------
  |  Branch (2782:8): [True: 12, False: 4.79k]
  ------------------
 2783|     12|       Curl_headersep(head->data[10]) &&
  ------------------
  |  |   26|  4.82k|#define Curl_headersep(x) ((((x) == ':') || ((x) == ';')))
  |  |  ------------------
  |  |  |  Branch (26:29): [True: 6, False: 6]
  |  |  |  Branch (26:45): [True: 3, False: 3]
  |  |  ------------------
  ------------------
 2784|      9|       !http_header_is_empty(head->data)) {
  ------------------
  |  Branch (2784:8): [True: 6, False: 3]
  ------------------
 2785|      6|      char *value;
 2786|      6|      result = copy_custom_value(head->data, &value);
 2787|      6|      if(result)
  ------------------
  |  Branch (2787:10): [True: 0, False: 6]
  ------------------
 2788|      0|        return result;
 2789|      6|      result = curlx_dyn_addf(req, "%s%s", sep, value);
 2790|      6|      sep = ", ";
 2791|      6|      curlx_free(value);
  ------------------
  |  | 1483|      6|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2792|      6|      break; /* leave, having added 1st one */
 2793|      6|    }
 2794|  4.80k|  }
 2795|       |
 2796|       |  /* add our internal Connection: header values, if we have any */
 2797|  6.82k|  if(!result && data->state.http_hd_te) {
  ------------------
  |  Branch (2797:6): [True: 6.82k, False: 0]
  |  Branch (2797:17): [True: 452, False: 6.36k]
  ------------------
 2798|    452|    result = curlx_dyn_addf(req, "%s%s", sep, "TE");
 2799|    452|    sep = ", ";
 2800|    452|  }
 2801|  6.82k|  if(!result && data->state.http_hd_upgrade) {
  ------------------
  |  Branch (2801:6): [True: 6.82k, False: 0]
  |  Branch (2801:17): [True: 29, False: 6.79k]
  ------------------
 2802|     29|    result = curlx_dyn_addf(req, "%s%s", sep, "Upgrade");
 2803|     29|    sep = ", ";
 2804|     29|  }
 2805|  6.82k|  if(!result && data->state.http_hd_h2_settings) {
  ------------------
  |  Branch (2805:6): [True: 6.82k, False: 0]
  |  Branch (2805:17): [True: 29, False: 6.79k]
  ------------------
 2806|     29|    result = curlx_dyn_addf(req, "%s%s", sep, "HTTP2-Settings");
 2807|     29|  }
 2808|  6.82k|  if(!result && (rlen < curlx_dyn_len(req)))
  ------------------
  |  Branch (2808:6): [True: 6.82k, False: 0]
  |  Branch (2808:17): [True: 487, False: 6.33k]
  ------------------
 2809|    487|    result = curlx_dyn_addn(req, STRCONST("\r\n"));
  ------------------
  |  | 1292|    487|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 2810|  6.82k|  if(result)
  ------------------
  |  Branch (2810:6): [True: 0, False: 6.82k]
  ------------------
 2811|      0|    return result;
 2812|       |
 2813|       |  /* Add all user-defined Connection: headers after the first */
 2814|  6.82k|  skip = TRUE;
  ------------------
  |  | 1055|  6.82k|#define TRUE true
  ------------------
 2815|  11.6k|  for(head = data->set.headers; head; head = head->next) {
  ------------------
  |  Branch (2815:33): [True: 4.81k, False: 6.82k]
  ------------------
 2816|  4.81k|    if(curl_strnequal(head->data, "Connection", 10) &&
  ------------------
  |  Branch (2816:8): [True: 12, False: 4.80k]
  ------------------
 2817|     12|       Curl_headersep(head->data[10]) &&
  ------------------
  |  |   26|  4.82k|#define Curl_headersep(x) ((((x) == ':') || ((x) == ';')))
  |  |  ------------------
  |  |  |  Branch (26:29): [True: 6, False: 6]
  |  |  |  Branch (26:45): [True: 3, False: 3]
  |  |  ------------------
  ------------------
 2818|      9|       !http_header_is_empty(head->data)) {
  ------------------
  |  Branch (2818:8): [True: 6, False: 3]
  ------------------
 2819|      6|      if(skip) {
  ------------------
  |  Branch (2819:10): [True: 6, False: 0]
  ------------------
 2820|      6|        skip = FALSE;
  ------------------
  |  | 1058|      6|#define FALSE false
  ------------------
 2821|      6|        continue;
 2822|      6|      }
 2823|      0|      result = curlx_dyn_addf(req, "%s\r\n", head->data);
 2824|      0|      if(result)
  ------------------
  |  Branch (2824:10): [True: 0, False: 0]
  ------------------
 2825|      0|        return result;
 2826|      0|    }
 2827|  4.81k|  }
 2828|       |
 2829|  6.82k|  return CURLE_OK;
 2830|  6.82k|}
http.c:http_header_is_empty:
  185|     18|{
  186|     18|  struct Curl_str out;
  187|       |
  188|     18|  if(header_has_value(&header, &out)) {
  ------------------
  |  Branch (188:6): [True: 18, False: 0]
  ------------------
  189|     18|    return curlx_strlen(&out) == 0;
  ------------------
  |  |   50|     18|#define curlx_strlen(x) ((x)->len)
  ------------------
  190|     18|  }
  191|      0|  return TRUE; /* invalid header format, treat as empty */
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  192|     18|}
http.c:http_rw_hd:
 4211|  56.6k|{
 4212|  56.6k|  CURLcode result = CURLE_OK;
 4213|  56.6k|  struct SingleRequest *k = &data->req;
 4214|  56.6k|  int writetype;
 4215|  56.6k|  DEBUGASSERT(!hd[hdlen]); /* null-terminated */
  ------------------
  |  | 1081|  56.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4215:3): [True: 0, False: 56.6k]
  |  Branch (4215:3): [True: 56.6k, False: 0]
  ------------------
 4216|       |
 4217|  56.6k|  *pconsumed = 0;
 4218|  56.6k|  if((0x0a == *hd) || (0x0d == *hd)) {
  ------------------
  |  Branch (4218:6): [True: 1.41k, False: 55.1k]
  |  Branch (4218:23): [True: 254, False: 54.9k]
  ------------------
 4219|       |    /* Empty header line means end of headers! */
 4220|  1.66k|    struct dynbuf last_header;
 4221|  1.66k|    size_t consumed;
 4222|       |
 4223|  1.66k|    curlx_dyn_init(&last_header, hdlen + 1);
 4224|  1.66k|    result = curlx_dyn_addn(&last_header, hd, hdlen);
 4225|  1.66k|    if(result)
  ------------------
  |  Branch (4225:8): [True: 0, False: 1.66k]
  ------------------
 4226|      0|      return result;
 4227|       |
 4228|       |    /* analyze the response to find out what to do. */
 4229|       |    /* Caveat: we clear anything in the header brigade, because a
 4230|       |     * response might switch HTTP version which may call use recursively.
 4231|       |     * Not nice, but that is currently the way of things. */
 4232|  1.66k|    curlx_dyn_reset(&data->state.headerb);
 4233|  1.66k|    result = http_on_response(data, curlx_dyn_ptr(&last_header),
 4234|  1.66k|                              curlx_dyn_len(&last_header),
 4235|  1.66k|                              buf_remain, blen, &consumed);
 4236|  1.66k|    *pconsumed += consumed;
 4237|  1.66k|    curlx_dyn_free(&last_header);
 4238|  1.66k|    return result;
 4239|  1.66k|  }
 4240|       |
 4241|       |  /*
 4242|       |   * Checks for special headers coming up.
 4243|       |   */
 4244|       |
 4245|  54.9k|  writetype = CLIENTWRITE_HEADER;
  ------------------
  |  |   44|  54.9k|#define CLIENTWRITE_HEADER  (1 << 2) /* meta information, HEADER */
  ------------------
 4246|  54.9k|  if(!k->headerline++) {
  ------------------
  |  Branch (4246:6): [True: 3.68k, False: 51.2k]
  ------------------
 4247|       |    /* This is the first header, it MUST be the error code line
 4248|       |       or else we consider this to be the body right away! */
 4249|  3.68k|    bool fine_statusline = FALSE;
  ------------------
  |  | 1058|  3.68k|#define FALSE false
  ------------------
 4250|       |
 4251|  3.68k|    k->httpversion = 0; /* Do not know yet */
 4252|  3.68k|    if(data->conn->scheme->protocol & PROTO_FAMILY_HTTP) {
  ------------------
  |  |   84|  3.68k|#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1078|  3.68k|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1079|  3.68k|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  |   63|  3.68k|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   85|  3.68k|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   64|  3.68k|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
  |  Branch (4252:8): [True: 3.68k, False: 0]
  ------------------
 4253|       |      /*
 4254|       |       * https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2
 4255|       |       *
 4256|       |       * The response code is always a three-digit number in HTTP as the spec
 4257|       |       * says. We allow any three-digit number here, but we cannot make
 4258|       |       * guarantees on future behaviors since it is not within the protocol.
 4259|       |       */
 4260|  3.68k|      const char *p = hd;
 4261|       |
 4262|  3.68k|      curlx_str_passblanks(&p);
 4263|  3.68k|      if(!strncmp(p, "HTTP/", 5)) {
  ------------------
  |  Branch (4263:10): [True: 3.37k, False: 302]
  ------------------
 4264|  3.37k|        p += 5;
 4265|  3.37k|        switch(*p) {
 4266|  1.28k|        case '1':
  ------------------
  |  Branch (4266:9): [True: 1.28k, False: 2.08k]
  ------------------
 4267|  1.28k|          p++;
 4268|  1.28k|          if((p[0] == '.') && (p[1] == '0' || p[1] == '1')) {
  ------------------
  |  Branch (4268:14): [True: 1.28k, False: 3]
  |  Branch (4268:32): [True: 408, False: 878]
  |  Branch (4268:47): [True: 871, False: 7]
  ------------------
 4269|  1.27k|            if(ISBLANK(p[2])) {
  ------------------
  |  |   45|  1.27k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.26k, False: 16]
  |  |  |  Branch (45:38): [True: 10, False: 6]
  |  |  ------------------
  ------------------
 4270|  1.27k|              k->httpversion = (unsigned char)(10 + (p[1] - '0'));
 4271|  1.27k|              p += 3;
 4272|  1.27k|              if(ISDIGIT(p[0]) && ISDIGIT(p[1]) && ISDIGIT(p[2])) {
  ------------------
  |  |   44|  2.54k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.27k, False: 3]
  |  |  |  Branch (44:38): [True: 1.26k, False: 2]
  |  |  ------------------
  ------------------
                            if(ISDIGIT(p[0]) && ISDIGIT(p[1]) && ISDIGIT(p[2])) {
  ------------------
  |  |   44|  2.54k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.26k, False: 5]
  |  |  |  Branch (44:38): [True: 1.26k, False: 2]
  |  |  ------------------
  ------------------
                            if(ISDIGIT(p[0]) && ISDIGIT(p[1]) && ISDIGIT(p[2])) {
  ------------------
  |  |   44|  1.26k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.25k, False: 2]
  |  |  |  Branch (44:38): [True: 1.25k, False: 2]
  |  |  ------------------
  ------------------
 4273|  1.25k|                k->httpcode = ((p[0] - '0') * 100) + ((p[1] - '0') * 10) +
 4274|  1.25k|                  (p[2] - '0');
 4275|       |                /* RFC 9112 requires a single space following the status code,
 4276|       |                   but the browsers do not so let's not insist */
 4277|  1.25k|                fine_statusline = TRUE;
  ------------------
  |  | 1055|  1.25k|#define TRUE true
  ------------------
 4278|  1.25k|              }
 4279|  1.27k|            }
 4280|  1.27k|          }
 4281|  1.28k|          if(!fine_statusline) {
  ------------------
  |  Branch (4281:14): [True: 32, False: 1.25k]
  ------------------
 4282|     32|            failf(data, "Unsupported HTTP/1 subversion in response");
  ------------------
  |  |   62|     32|#define failf Curl_failf
  ------------------
 4283|     32|            return CURLE_UNSUPPORTED_PROTOCOL;
 4284|     32|          }
 4285|  1.25k|          break;
 4286|  1.99k|        case '2':
  ------------------
  |  Branch (4286:9): [True: 1.99k, False: 1.38k]
  ------------------
 4287|  2.08k|        case '3':
  ------------------
  |  Branch (4287:9): [True: 86, False: 3.29k]
  ------------------
 4288|  2.08k|          if(!ISBLANK(p[1]))
  ------------------
  |  |   45|  2.08k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.30k, False: 781]
  |  |  |  Branch (45:38): [True: 1, False: 780]
  |  |  ------------------
  ------------------
 4289|    780|            break;
 4290|  1.30k|          k->httpversion = (unsigned char)((*p - '0') * 10);
 4291|  1.30k|          p += 2;
 4292|  1.30k|          if(ISDIGIT(p[0]) && ISDIGIT(p[1]) && ISDIGIT(p[2])) {
  ------------------
  |  |   44|  2.60k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.28k, False: 16]
  |  |  |  Branch (44:38): [True: 1.28k, False: 3]
  |  |  ------------------
  ------------------
                        if(ISDIGIT(p[0]) && ISDIGIT(p[1]) && ISDIGIT(p[2])) {
  ------------------
  |  |   44|  2.58k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.27k, False: 5]
  |  |  |  Branch (44:38): [True: 1.22k, False: 54]
  |  |  ------------------
  ------------------
                        if(ISDIGIT(p[0]) && ISDIGIT(p[1]) && ISDIGIT(p[2])) {
  ------------------
  |  |   44|  1.22k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.22k, False: 2]
  |  |  |  Branch (44:38): [True: 1.22k, False: 1]
  |  |  ------------------
  ------------------
 4293|  1.22k|            k->httpcode = ((p[0] - '0') * 100) + ((p[1] - '0') * 10) +
 4294|  1.22k|              (p[2] - '0');
 4295|  1.22k|            p += 3;
 4296|  1.22k|            if(!ISBLANK(*p))
  ------------------
  |  |   45|  1.22k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.20k, False: 14]
  |  |  |  Branch (45:38): [True: 1, False: 13]
  |  |  ------------------
  ------------------
 4297|     13|              break;
 4298|  1.20k|            fine_statusline = TRUE;
  ------------------
  |  | 1055|  1.20k|#define TRUE true
  ------------------
 4299|  1.20k|          }
 4300|  1.28k|          break;
 4301|  1.28k|        default: /* unsupported */
  ------------------
  |  Branch (4301:9): [True: 8, False: 3.37k]
  ------------------
 4302|      8|          failf(data, "Unsupported HTTP version in response");
  ------------------
  |  |   62|      8|#define failf Curl_failf
  ------------------
 4303|      8|          return CURLE_UNSUPPORTED_PROTOCOL;
 4304|  3.37k|        }
 4305|  3.37k|      }
 4306|       |
 4307|  3.64k|      if(!fine_statusline) {
  ------------------
  |  Branch (4307:10): [True: 1.17k, False: 2.46k]
  ------------------
 4308|       |        /* If user has set option HTTP200ALIASES,
 4309|       |           compare header line against list of aliases
 4310|       |        */
 4311|  1.17k|        statusline check = checkhttpprefix(data, hd, hdlen);
 4312|  1.17k|        if(check == STATUS_DONE) {
  ------------------
  |  Branch (4312:12): [True: 1.06k, False: 108]
  ------------------
 4313|  1.06k|          fine_statusline = TRUE;
  ------------------
  |  | 1055|  1.06k|#define TRUE true
  ------------------
 4314|  1.06k|          k->httpcode = 200;
 4315|  1.06k|          k->httpversion = 10;
 4316|  1.06k|        }
 4317|  1.17k|      }
 4318|  3.64k|    }
 4319|      0|    else if(data->conn->scheme->protocol & CURLPROTO_RTSP) {
  ------------------
  |  | 1096|      0|#define CURLPROTO_RTSP    (1L << 18)
  ------------------
  |  Branch (4319:13): [True: 0, False: 0]
  ------------------
 4320|      0|      const char *p = hd;
 4321|      0|      struct Curl_str ver;
 4322|      0|      curl_off_t status;
 4323|       |      /* we set the max string a little excessive to forgive some leading
 4324|       |         spaces */
 4325|      0|      if(!curlx_str_until(&p, &ver, 32, ' ') &&
  ------------------
  |  Branch (4325:10): [True: 0, False: 0]
  ------------------
 4326|      0|         !curlx_str_single(&p, ' ') &&
  ------------------
  |  Branch (4326:10): [True: 0, False: 0]
  ------------------
 4327|      0|         !curlx_str_number(&p, &status, 999)) {
  ------------------
  |  Branch (4327:10): [True: 0, False: 0]
  ------------------
 4328|      0|        curlx_str_trimblanks(&ver);
 4329|      0|        if(curlx_str_cmp(&ver, "RTSP/1.0")) {
  ------------------
  |  Branch (4329:12): [True: 0, False: 0]
  ------------------
 4330|      0|          k->httpcode = (int)status;
 4331|      0|          fine_statusline = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 4332|      0|          k->httpversion = 11; /* RTSP acts like HTTP 1.1 */
 4333|      0|        }
 4334|      0|      }
 4335|      0|      if(!fine_statusline)
  ------------------
  |  Branch (4335:10): [True: 0, False: 0]
  ------------------
 4336|      0|        return CURLE_WEIRD_SERVER_REPLY;
 4337|      0|    }
 4338|       |
 4339|  3.64k|    if(fine_statusline) {
  ------------------
  |  Branch (4339:8): [True: 3.53k, False: 108]
  ------------------
 4340|  3.53k|      result = http_statusline(data, data->conn);
 4341|  3.53k|      if(result)
  ------------------
  |  Branch (4341:10): [True: 2, False: 3.53k]
  ------------------
 4342|      2|        return result;
 4343|  3.53k|      writetype |= CLIENTWRITE_STATUS;
  ------------------
  |  |   45|  3.53k|#define CLIENTWRITE_STATUS  (1 << 3) /* a special status HEADER */
  ------------------
 4344|  3.53k|    }
 4345|    108|    else {
 4346|    108|      k->header = FALSE;   /* this is not a header line */
  ------------------
  |  | 1058|    108|#define FALSE false
  ------------------
 4347|    108|      return CURLE_WEIRD_SERVER_REPLY;
 4348|    108|    }
 4349|  3.64k|  }
 4350|       |
 4351|  54.7k|  result = verify_header(data, hd, hdlen);
 4352|  54.7k|  if(result)
  ------------------
  |  Branch (4352:6): [True: 193, False: 54.5k]
  ------------------
 4353|    193|    return result;
 4354|       |
 4355|  54.5k|  result = http_header(data, hd, hdlen);
 4356|  54.5k|  if(result)
  ------------------
  |  Branch (4356:6): [True: 213, False: 54.3k]
  ------------------
 4357|    213|    return result;
 4358|       |
 4359|       |  /*
 4360|       |   * Taken in one (more) header. Write it to the client.
 4361|       |   */
 4362|  54.3k|  Curl_debug(data, CURLINFO_HEADER_IN, hd, hdlen);
 4363|       |
 4364|  54.3k|  if(k->httpcode / 100 == 1)
  ------------------
  |  Branch (4364:6): [True: 3.42k, False: 50.9k]
  ------------------
 4365|  3.42k|    writetype |= CLIENTWRITE_1XX;
  ------------------
  |  |   47|  3.42k|#define CLIENTWRITE_1XX     (1 << 5) /* a 1xx response related HEADER */
  ------------------
 4366|  54.3k|  result = Curl_client_write(data, writetype, hd, hdlen);
 4367|  54.3k|  if(result)
  ------------------
  |  Branch (4367:6): [True: 1, False: 54.3k]
  ------------------
 4368|      1|    return result;
 4369|       |
 4370|  54.3k|  result = Curl_bump_headersize(data, hdlen, FALSE);
  ------------------
  |  | 1058|  54.3k|#define FALSE false
  ------------------
 4371|  54.3k|  if(result)
  ------------------
  |  Branch (4371:6): [True: 0, False: 54.3k]
  ------------------
 4372|      0|    return result;
 4373|       |
 4374|  54.3k|  return CURLE_OK;
 4375|  54.3k|}
http.c:http_on_response:
 4089|  1.66k|{
 4090|  1.66k|  struct connectdata *conn = data->conn;
 4091|  1.66k|  CURLcode result = CURLE_OK;
 4092|  1.66k|  struct SingleRequest *k = &data->req;
 4093|  1.66k|  bool conn_changed = FALSE;
  ------------------
  |  | 1058|  1.66k|#define FALSE false
  ------------------
 4094|       |
 4095|  1.66k|  (void)buf; /* not used without HTTP2 enabled */
 4096|  1.66k|  *pconsumed = 0;
 4097|       |
 4098|  1.66k|  if(k->upgr101 == UPGR101_RECEIVED) {
  ------------------
  |  Branch (4098:6): [True: 0, False: 1.66k]
  ------------------
 4099|       |    /* supposedly upgraded to http2 now */
 4100|      0|    if(data->req.httpversion != 20)
  ------------------
  |  Branch (4100:8): [True: 0, False: 0]
  ------------------
 4101|      0|      infof(data, "Lying server, not serving HTTP/2");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4102|      0|  }
 4103|       |
 4104|  1.66k|  if(k->httpcode < 200 && last_hd) {
  ------------------
  |  Branch (4104:6): [True: 452, False: 1.21k]
  |  Branch (4104:27): [True: 452, False: 0]
  ------------------
 4105|       |    /* Intermediate responses might trigger processing of more responses,
 4106|       |     * write the last header to the client before proceeding. */
 4107|    452|    result = http_write_header(data, last_hd, last_hd_len);
 4108|    452|    last_hd = NULL; /* handled it */
 4109|    452|    if(result)
  ------------------
  |  Branch (4109:8): [True: 0, False: 452]
  ------------------
 4110|      0|      goto out;
 4111|    452|  }
 4112|       |
 4113|  1.66k|  if(k->httpcode < 100) {
  ------------------
  |  Branch (4113:6): [True: 6, False: 1.66k]
  ------------------
 4114|      6|    failf(data, "Unsupported response code in HTTP response");
  ------------------
  |  |   62|      6|#define failf Curl_failf
  ------------------
 4115|      6|    result = CURLE_UNSUPPORTED_PROTOCOL;
 4116|      6|    goto out;
 4117|      6|  }
 4118|  1.66k|  else if(k->httpcode < 200) {
  ------------------
  |  Branch (4118:11): [True: 446, False: 1.21k]
  ------------------
 4119|    446|    result = http_on_1xx_response(data, buf, blen, pconsumed, &conn_changed);
 4120|    446|    goto out;
 4121|    446|  }
 4122|       |
 4123|       |  /* k->httpcode >= 200, final response */
 4124|  1.21k|  k->header = FALSE;
  ------------------
  |  | 1058|  1.21k|#define FALSE false
  ------------------
 4125|  1.21k|  if(conn->bits.upgrade_in_progress) {
  ------------------
  |  Branch (4125:6): [True: 16, False: 1.20k]
  ------------------
 4126|       |    /* Asked for protocol upgrade, but it was not selected */
 4127|     16|    conn->bits.upgrade_in_progress = FALSE;
  ------------------
  |  | 1058|     16|#define FALSE false
  ------------------
 4128|     16|    conn_changed = TRUE;
  ------------------
  |  | 1055|     16|#define TRUE true
  ------------------
 4129|     16|  }
 4130|       |
 4131|  1.21k|  if((k->size == -1) && !k->chunk && !conn->bits.close &&
  ------------------
  |  Branch (4131:6): [True: 799, False: 418]
  |  Branch (4131:25): [True: 750, False: 49]
  |  Branch (4131:38): [True: 262, False: 488]
  ------------------
 4132|    262|     (k->httpversion == 11) &&
  ------------------
  |  Branch (4132:6): [True: 47, False: 215]
  ------------------
 4133|     47|     !(conn->scheme->protocol & CURLPROTO_RTSP) &&
  ------------------
  |  | 1096|     47|#define CURLPROTO_RTSP    (1L << 18)
  ------------------
  |  Branch (4133:6): [True: 47, False: 0]
  ------------------
 4134|     47|     data->state.httpreq != HTTPREQ_HEAD) {
  ------------------
  |  Branch (4134:6): [True: 44, False: 3]
  ------------------
 4135|       |    /* On HTTP 1.1, when connection is not to get closed, but no
 4136|       |       Content-Length nor Transfer-Encoding chunked have been received,
 4137|       |       according to RFC2616 section 4.4 point 5, we assume that the server
 4138|       |       will close the connection to signal the end of the document. */
 4139|     44|    infof(data, "no chunk, no close, no size. Assume close to signal end");
  ------------------
  |  |  143|     44|  do {                               \
  |  |  144|     44|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     44|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 44, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 44]
  |  |  |  |  ------------------
  |  |  |  |  320|     44|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     44|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     44|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 44]
  |  |  ------------------
  ------------------
 4140|     44|    streamclose(conn, "HTTP: No end-of-message indicator");
  ------------------
  |  |  102|     44|#define streamclose(x, y) Curl_conncontrol(x, CONNCTRL_STREAM, y)
  |  |  ------------------
  |  |  |  |   92|     44|#define CONNCTRL_STREAM     2
  |  |  ------------------
  ------------------
 4141|     44|  }
 4142|       |
 4143|  1.21k|  http_check_auth_closure(data, conn);
 4144|       |
 4145|  1.21k|#ifndef CURL_DISABLE_WEBSOCKETS
 4146|       |  /* All >=200 HTTP status codes are errors when wanting ws */
 4147|  1.21k|  if(data->req.upgr101 == UPGR101_WS) {
  ------------------
  |  Branch (4147:6): [True: 0, False: 1.21k]
  ------------------
 4148|      0|    failf(data, "Refused WebSocket upgrade: %d", k->httpcode);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4149|      0|    result = CURLE_HTTP_RETURNED_ERROR;
 4150|      0|    goto out;
 4151|      0|  }
 4152|  1.21k|#endif
 4153|       |
 4154|       |  /* Check if this response means the transfer errored. */
 4155|  1.21k|  if(http_should_fail(data, data->req.httpcode)) {
  ------------------
  |  Branch (4155:6): [True: 2, False: 1.21k]
  ------------------
 4156|      2|    failf(data, "The requested URL returned error: %d",
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
 4157|      2|          k->httpcode);
 4158|      2|    result = CURLE_HTTP_RETURNED_ERROR;
 4159|      2|    goto out;
 4160|      2|  }
 4161|       |
 4162|       |  /* Curl_http_auth_act() checks what authentication methods that are
 4163|       |   * available and decides which one (if any) to use. It will set 'newurl' if
 4164|       |   * an auth method was picked. */
 4165|  1.21k|  result = Curl_http_auth_act(data);
 4166|  1.21k|  if(result)
  ------------------
  |  Branch (4166:6): [True: 0, False: 1.21k]
  ------------------
 4167|      0|    goto out;
 4168|       |
 4169|  1.21k|  if(k->httpcode >= 300) {
  ------------------
  |  Branch (4169:6): [True: 463, False: 752]
  ------------------
 4170|    463|    result = http_handle_send_error(data);
 4171|    463|    if(result)
  ------------------
  |  Branch (4171:8): [True: 0, False: 463]
  ------------------
 4172|      0|      goto out;
 4173|    463|  }
 4174|       |
 4175|       |  /* If we requested a "no body", this is a good time to get
 4176|       |   * out and return home.
 4177|       |   */
 4178|  1.21k|  if(data->req.no_body)
  ------------------
  |  Branch (4178:6): [True: 5, False: 1.21k]
  ------------------
 4179|      5|    k->download_done = TRUE;
  ------------------
  |  | 1055|      5|#define TRUE true
  ------------------
 4180|       |
 4181|       |  /* If max download size is *zero* (nothing) we already have nothing and can
 4182|       |     safely return ok now! For HTTP/2, we would like to call
 4183|       |     http2_handle_stream_close to properly close a stream. In order to do
 4184|       |     this, we keep reading until we close the stream. */
 4185|  1.21k|  if((k->maxdownload == 0) && (k->httpversion_sent < 20))
  ------------------
  |  Branch (4185:6): [True: 210, False: 1.00k]
  |  Branch (4185:31): [True: 191, False: 19]
  ------------------
 4186|    191|    k->download_done = TRUE;
  ------------------
  |  | 1055|    191|#define TRUE true
  ------------------
 4187|       |
 4188|       |  /* final response without error, prepare to receive the body */
 4189|  1.21k|  result = http_firstwrite(data);
 4190|       |
 4191|  1.21k|  if(!result)
  ------------------
  |  Branch (4191:6): [True: 1.14k, False: 67]
  ------------------
 4192|       |    /* This is the last response that we get for the current request. Check on
 4193|       |     * the body size and determine if the response is complete. */
 4194|  1.14k|    result = http_size(data);
 4195|       |
 4196|  1.66k|out:
 4197|  1.66k|  if(last_hd)
  ------------------
  |  Branch (4197:6): [True: 1.21k, False: 452]
  ------------------
 4198|       |    /* if not written yet, write it now */
 4199|  1.21k|    result = Curl_1st_fatal(result,
 4200|  1.21k|                            http_write_header(data, last_hd, last_hd_len));
 4201|  1.66k|  if(conn_changed)
  ------------------
  |  Branch (4201:6): [True: 18, False: 1.65k]
  ------------------
 4202|       |    /* poke the multi handle to allow pending pipewait to retry */
 4203|     18|    Curl_multi_connchanged(data->multi);
 4204|  1.66k|  return result;
 4205|  1.21k|}
http.c:http_on_1xx_response:
 3936|    446|{
 3937|    446|  struct SingleRequest *k = &data->req;
 3938|       |
 3939|       |  /* "A user agent MAY ignore unexpected 1xx status responses."
 3940|       |   * By default, we expect to get more responses after this one. */
 3941|    446|  k->header = TRUE;
  ------------------
  |  | 1055|    446|#define TRUE true
  ------------------
 3942|    446|  k->headerline = 0; /* restart the header line counter */
 3943|       |
 3944|    446|  switch(k->httpcode) {
 3945|     48|  case 100:
  ------------------
  |  Branch (3945:3): [True: 48, False: 398]
  ------------------
 3946|       |    /* We have made an HTTP PUT or POST and this is 1.1-lingo that tells us
 3947|       |     * that the server is OK with this and ready to receive the data. */
 3948|     48|    http_exp100_got100(data);
 3949|     48|    break;
 3950|      2|  case 101:
  ------------------
  |  Branch (3950:3): [True: 2, False: 444]
  ------------------
 3951|      2|    return http_on_101_upgrade(data, buf, blen, pconsumed, conn_changed);
 3952|    396|  default:
  ------------------
  |  Branch (3952:3): [True: 396, False: 50]
  ------------------
 3953|       |    /* The server may send us other 1xx responses, like informative 103. This
 3954|       |     * has no influence on request processing and we expect to receive a
 3955|       |     * final response eventually. */
 3956|    396|    break;
 3957|    446|  }
 3958|    444|  return CURLE_OK;
 3959|    446|}
http.c:http_exp100_got100:
 1554|     48|{
 1555|     48|  struct Curl_creader *r = Curl_creader_get_by_type(data, &cr_exp100);
 1556|     48|  if(r)
  ------------------
  |  Branch (1556:6): [True: 27, False: 21]
  ------------------
 1557|     27|    http_exp100_continue(data, r);
 1558|     48|}
http.c:http_on_101_upgrade:
 3873|      2|{
 3874|      2|  struct connectdata *conn = data->conn;
 3875|      2|  struct SingleRequest *k = &data->req;
 3876|       |
 3877|       |#if !defined(USE_NGHTTP2) && defined(CURL_DISABLE_WEBSOCKETS)
 3878|       |  (void)buf;
 3879|       |  (void)blen;
 3880|       |  (void)pconsumed;
 3881|       |#else
 3882|      2|  CURLcode result;
 3883|      2|  int upgr101_requested = k->upgr101;
 3884|      2|#endif
 3885|       |
 3886|      2|  if(k->httpversion_sent != 11) {
  ------------------
  |  Branch (3886:6): [True: 0, False: 2]
  ------------------
 3887|       |    /* invalid for other HTTP versions */
 3888|      0|    failf(data, "server sent 101 response while not talking HTTP/1.1");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3889|      0|    return CURLE_WEIRD_SERVER_REPLY;
 3890|      0|  }
 3891|       |
 3892|       |  /* Whatever the success, upgrade was selected. */
 3893|      2|  k->upgr101 = UPGR101_RECEIVED;
 3894|      2|  conn->bits.upgrade_in_progress = FALSE;
  ------------------
  |  | 1058|      2|#define FALSE false
  ------------------
 3895|      2|  *conn_changed = TRUE;
  ------------------
  |  | 1055|      2|#define TRUE true
  ------------------
 3896|       |
 3897|       |  /* To be fully compliant, we would check the "Upgrade:" response header to
 3898|       |   * mention the protocol we requested. */
 3899|      2|#ifdef USE_NGHTTP2
 3900|      2|  if(upgr101_requested == UPGR101_H2) {
  ------------------
  |  Branch (3900:6): [True: 0, False: 2]
  ------------------
 3901|       |    /* Switch to HTTP/2, where we will get more responses. blen bytes in buf
 3902|       |     * are already h2 protocol bytes */
 3903|      0|    infof(data, "Received 101, Switching to HTTP/2");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3904|      0|    result = Curl_http2_upgrade(data, conn, FIRSTSOCKET, buf, blen);
  ------------------
  |  |  303|      0|#define FIRSTSOCKET     0
  ------------------
 3905|      0|    if(!result)
  ------------------
  |  Branch (3905:8): [True: 0, False: 0]
  ------------------
 3906|      0|      *pconsumed += blen;
 3907|      0|    return result;
 3908|      0|  }
 3909|      2|#endif
 3910|      2|#ifndef CURL_DISABLE_WEBSOCKETS
 3911|      2|  if(upgr101_requested == UPGR101_WS) {
  ------------------
  |  Branch (3911:6): [True: 0, False: 2]
  ------------------
 3912|       |    /* Switch to WebSocket, where we now stream ws frames. blen bytes in buf
 3913|       |     * are already ws protocol bytes */
 3914|      0|    infof(data, "Received 101, Switching to WebSocket");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3915|      0|    result = Curl_ws_accept(data, buf, blen);
 3916|      0|    if(!result)
  ------------------
  |  Branch (3916:8): [True: 0, False: 0]
  ------------------
 3917|      0|      *pconsumed += blen; /* ws accept handled the data */
 3918|      0|    return result;
 3919|      0|  }
 3920|      2|#endif
 3921|       |  /* We silently accept this as the final response. What are we switching to
 3922|       |   * if we did not ask for an Upgrade? Maybe the application provided an
 3923|       |   * `Upgrade: xxx` header? */
 3924|      2|  k->header = FALSE;
  ------------------
  |  | 1058|      2|#define FALSE false
  ------------------
 3925|      2|  return CURLE_OK;
 3926|      2|}
http.c:http_handle_send_error:
 4010|    463|{
 4011|    463|  struct connectdata *conn = data->conn;
 4012|    463|  struct SingleRequest *k = &data->req;
 4013|    463|  CURLcode result = CURLE_OK;
 4014|       |
 4015|    463|  if(!data->req.authneg && !conn->bits.close &&
  ------------------
  |  Branch (4015:6): [True: 461, False: 2]
  |  Branch (4015:28): [True: 397, False: 64]
  ------------------
 4016|    397|     !Curl_creader_will_rewind(data)) {
  ------------------
  |  Branch (4016:6): [True: 379, False: 18]
  ------------------
 4017|       |    /*
 4018|       |     * General treatment of errors when about to send data.
 4019|       |     * Including: "417 Expectation Failed", while waiting for
 4020|       |     * 100-continue.
 4021|       |     *
 4022|       |     * The check for close above is done because if something
 4023|       |     * else has already deemed the connection to get closed then
 4024|       |     * something else should have considered the big picture and
 4025|       |     * we avoid this check.
 4026|       |     */
 4027|       |
 4028|    379|    switch(data->state.httpreq) {
 4029|      7|    case HTTPREQ_PUT:
  ------------------
  |  Branch (4029:5): [True: 7, False: 372]
  ------------------
 4030|     21|    case HTTPREQ_POST:
  ------------------
  |  Branch (4030:5): [True: 14, False: 365]
  ------------------
 4031|     23|    case HTTPREQ_POST_FORM:
  ------------------
  |  Branch (4031:5): [True: 2, False: 377]
  ------------------
 4032|     30|    case HTTPREQ_POST_MIME:
  ------------------
  |  Branch (4032:5): [True: 7, False: 372]
  ------------------
 4033|       |      /* We got an error response. If this happened before the
 4034|       |       * whole request body has been sent we stop sending and
 4035|       |       * mark the connection for closure after we have read the
 4036|       |       * entire response. */
 4037|     30|      if(!Curl_req_done_sending(data)) {
  ------------------
  |  Branch (4037:10): [True: 6, False: 24]
  ------------------
 4038|      6|        if((k->httpcode == 417) && http_exp100_is_selected(data)) {
  ------------------
  |  Branch (4038:12): [True: 0, False: 6]
  |  Branch (4038:36): [True: 0, False: 0]
  ------------------
 4039|       |          /* 417 Expectation Failed - try again without the
 4040|       |             Expect header */
 4041|      0|          if(!k->writebytecount && http_exp100_is_waiting(data)) {
  ------------------
  |  Branch (4041:14): [True: 0, False: 0]
  |  Branch (4041:36): [True: 0, False: 0]
  ------------------
 4042|      0|            infof(data, "Got HTTP failure 417 while waiting for a 100");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4043|      0|          }
 4044|      0|          else {
 4045|      0|            infof(data, "Got HTTP failure 417 while sending data");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4046|      0|            streamclose(conn, "Stop sending data before everything sent");
  ------------------
  |  |  102|      0|#define streamclose(x, y) Curl_conncontrol(x, CONNCTRL_STREAM, y)
  |  |  ------------------
  |  |  |  |   92|      0|#define CONNCTRL_STREAM     2
  |  |  ------------------
  ------------------
 4047|      0|            result = http_perhapsrewind(data, conn);
 4048|      0|            if(result)
  ------------------
  |  Branch (4048:16): [True: 0, False: 0]
  ------------------
 4049|      0|              return result;
 4050|      0|          }
 4051|      0|          data->state.disableexpect = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 4052|      0|          Curl_req_abort_sending(data);
 4053|      0|          DEBUGASSERT(!data->req.newurl);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4053:11): [True: 0, False: 0]
  |  Branch (4053:11): [True: 0, False: 0]
  ------------------
 4054|      0|          data->req.newurl = Curl_bufref_dup(&data->state.url);
  ------------------
  |  |   49|      0|#define Curl_bufref_dup(x) curlx_strdup(Curl_bufref_ptr(x))
  |  |  ------------------
  |  |  |  | 1477|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
 4055|      0|          if(!data->req.newurl)
  ------------------
  |  Branch (4055:14): [True: 0, False: 0]
  ------------------
 4056|      0|            return CURLE_OUT_OF_MEMORY;
 4057|      0|        }
 4058|      6|        else if(data->set.http_keep_sending_on_error) {
  ------------------
  |  Branch (4058:17): [True: 0, False: 6]
  ------------------
 4059|      0|          infof(data, "HTTP error before end of send, keep sending");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4060|      0|          http_exp100_send_anyway(data);
 4061|      0|        }
 4062|      6|        else {
 4063|      6|          infof(data, "HTTP error before end of send, stop sending");
  ------------------
  |  |  143|      6|  do {                               \
  |  |  144|      6|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      6|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 6, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 6]
  |  |  |  |  ------------------
  |  |  |  |  320|      6|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      6|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      6|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 6]
  |  |  ------------------
  ------------------
 4064|      6|          streamclose(conn, "Stop sending data before everything sent");
  ------------------
  |  |  102|      6|#define streamclose(x, y) Curl_conncontrol(x, CONNCTRL_STREAM, y)
  |  |  ------------------
  |  |  |  |   92|      6|#define CONNCTRL_STREAM     2
  |  |  ------------------
  ------------------
 4065|      6|          result = Curl_req_abort_sending(data);
 4066|      6|          if(result)
  ------------------
  |  Branch (4066:14): [True: 0, False: 6]
  ------------------
 4067|      0|            return result;
 4068|      6|        }
 4069|      6|      }
 4070|     30|      break;
 4071|       |
 4072|    349|    default: /* default label present to avoid compiler warnings */
  ------------------
  |  Branch (4072:5): [True: 349, False: 30]
  ------------------
 4073|    349|      break;
 4074|    379|    }
 4075|    379|  }
 4076|       |
 4077|    463|  if(Curl_creader_will_rewind(data) && !Curl_req_done_sending(data)) {
  ------------------
  |  Branch (4077:6): [True: 34, False: 429]
  |  Branch (4077:40): [True: 11, False: 23]
  ------------------
 4078|       |    /* We rewind before next send, continue sending now */
 4079|     11|    infof(data, "Keep sending data to get tossed away");
  ------------------
  |  |  143|     11|  do {                               \
  |  |  144|     11|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     11|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 11, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 11]
  |  |  |  |  ------------------
  |  |  |  |  320|     11|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     11|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     11|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 11]
  |  |  ------------------
  ------------------
 4080|     11|    CURL_REQ_SET_SEND(data);
  ------------------
  |  |   44|     11|#define CURL_REQ_SET_SEND(d)   ((d)->req.io_flags |= REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|     11|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  ------------------
 4081|     11|  }
 4082|    463|  return result;
 4083|    463|}
http.c:http_firstwrite:
 2660|  1.21k|{
 2661|  1.21k|  struct connectdata *conn = data->conn;
 2662|  1.21k|  struct SingleRequest *k = &data->req;
 2663|       |
 2664|  1.21k|  if(data->req.newurl) {
  ------------------
  |  Branch (2664:6): [True: 204, False: 1.01k]
  ------------------
 2665|    204|    if(conn->bits.close) {
  ------------------
  |  Branch (2665:8): [True: 45, False: 159]
  ------------------
 2666|       |      /* Abort after the headers if "follow Location" is set
 2667|       |         and we are set to close anyway. */
 2668|     45|      CURL_REQ_CLEAR_RECV(data);
  ------------------
  |  |   49|     45|  ((d)->req.io_flags &= (uint8_t)~REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|     45|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  ------------------
 2669|     45|      k->done = TRUE;
  ------------------
  |  | 1055|     45|#define TRUE true
  ------------------
 2670|     45|      return CURLE_OK;
 2671|     45|    }
 2672|       |    /* We have a new URL to load, but since we want to be able to reuse this
 2673|       |       connection properly, we read the full response in "ignore more" */
 2674|    159|    k->ignorebody = TRUE;
  ------------------
  |  | 1055|    159|#define TRUE true
  ------------------
 2675|    159|    infof(data, "Ignoring the response-body");
  ------------------
  |  |  143|    159|  do {                               \
  |  |  144|    159|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    159|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 159, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 159]
  |  |  |  |  ------------------
  |  |  |  |  320|    159|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    159|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    159|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 159]
  |  |  ------------------
  ------------------
 2676|    159|  }
 2677|  1.17k|  if(data->state.resume_from && !k->content_range &&
  ------------------
  |  Branch (2677:6): [True: 84, False: 1.08k]
  |  Branch (2677:33): [True: 84, False: 0]
  ------------------
 2678|     84|     (data->state.httpreq == HTTPREQ_GET) &&
  ------------------
  |  Branch (2678:6): [True: 71, False: 13]
  ------------------
 2679|     71|     !k->ignorebody) {
  ------------------
  |  Branch (2679:6): [True: 67, False: 4]
  ------------------
 2680|       |
 2681|     67|    if(k->size == data->state.resume_from) {
  ------------------
  |  Branch (2681:8): [True: 0, False: 67]
  ------------------
 2682|       |      /* The resume point is at the end of file, consider this fine even if it
 2683|       |         does not allow resume from here. */
 2684|      0|      infof(data, "The entire document is already downloaded");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2685|      0|      streamclose(conn, "already downloaded");
  ------------------
  |  |  102|      0|#define streamclose(x, y) Curl_conncontrol(x, CONNCTRL_STREAM, y)
  |  |  ------------------
  |  |  |  |   92|      0|#define CONNCTRL_STREAM     2
  |  |  ------------------
  ------------------
 2686|       |      /* Abort download */
 2687|      0|      CURL_REQ_CLEAR_RECV(data);
  ------------------
  |  |   49|      0|  ((d)->req.io_flags &= (uint8_t)~REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|      0|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  ------------------
 2688|      0|      k->done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2689|      0|      return CURLE_OK;
 2690|      0|    }
 2691|       |
 2692|       |    /* we wanted to resume a download, although the server does not seem to
 2693|       |     * support this and we did this with a GET (if it was not a GET we did a
 2694|       |     * POST or PUT resume) */
 2695|     67|    failf(data, "HTTP server does not seem to support "
  ------------------
  |  |   62|     67|#define failf Curl_failf
  ------------------
 2696|     67|          "byte ranges. Cannot resume.");
 2697|     67|    return CURLE_RANGE_ERROR;
 2698|     67|  }
 2699|       |
 2700|  1.10k|  if(data->set.timecondition && !data->state.range) {
  ------------------
  |  Branch (2700:6): [True: 3, False: 1.10k]
  |  Branch (2700:33): [True: 2, False: 1]
  ------------------
 2701|       |    /* A time condition has been set AND no ranges have been requested. This
 2702|       |       seems to be what chapter 13.3.4 of RFC 2616 defines to be the correct
 2703|       |       action for an HTTP/1.1 client */
 2704|       |
 2705|      2|    if(!Curl_meets_timecondition(data, k->timeofdoc)) {
  ------------------
  |  Branch (2705:8): [True: 0, False: 2]
  ------------------
 2706|      0|      k->done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2707|       |      /* We are simulating an HTTP 304 from server so we return
 2708|       |         what should have been returned from the server */
 2709|      0|      data->info.httpcode = 304;
 2710|      0|      infof(data, "Simulate an HTTP 304 response");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2711|       |      /* we abort the transfer before it is completed == we ruin the
 2712|       |         reuse ability. Close the connection */
 2713|      0|      streamclose(conn, "Simulated 304 handling");
  ------------------
  |  |  102|      0|#define streamclose(x, y) Curl_conncontrol(x, CONNCTRL_STREAM, y)
  |  |  ------------------
  |  |  |  |   92|      0|#define CONNCTRL_STREAM     2
  |  |  ------------------
  ------------------
 2714|      0|      return CURLE_OK;
 2715|      0|    }
 2716|      2|  } /* we have a time condition */
 2717|       |
 2718|  1.10k|  return CURLE_OK;
 2719|  1.10k|}
http.c:http_size:
 3791|  1.14k|{
 3792|  1.14k|  struct SingleRequest *k = &data->req;
 3793|  1.14k|  if(data->req.ignore_cl || k->chunk) {
  ------------------
  |  Branch (3793:6): [True: 407, False: 741]
  |  Branch (3793:29): [True: 48, False: 693]
  ------------------
 3794|    455|    k->size = k->maxdownload = -1;
 3795|    455|  }
 3796|    693|  else if(k->size != -1) {
  ------------------
  |  Branch (3796:11): [True: 375, False: 318]
  ------------------
 3797|    375|    if(data->set.max_filesize &&
  ------------------
  |  Branch (3797:8): [True: 13, False: 362]
  ------------------
 3798|     13|       !k->ignorebody &&
  ------------------
  |  Branch (3798:8): [True: 12, False: 1]
  ------------------
 3799|     12|       (k->size > data->set.max_filesize)) {
  ------------------
  |  Branch (3799:8): [True: 4, False: 8]
  ------------------
 3800|      4|      failf(data, "Maximum file size exceeded");
  ------------------
  |  |   62|      4|#define failf Curl_failf
  ------------------
 3801|      4|      return CURLE_FILESIZE_EXCEEDED;
 3802|      4|    }
 3803|    371|    if(k->ignorebody)
  ------------------
  |  Branch (3803:8): [True: 155, False: 216]
  ------------------
 3804|    155|      infof(data, "setting size while ignoring");
  ------------------
  |  |  143|    155|  do {                               \
  |  |  144|    155|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    155|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 155, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 155]
  |  |  |  |  ------------------
  |  |  |  |  320|    155|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    155|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    155|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 155]
  |  |  ------------------
  ------------------
 3805|    371|    Curl_pgrsSetDownloadSize(data, k->size);
 3806|    371|    k->maxdownload = k->size;
 3807|    371|  }
 3808|  1.14k|  return CURLE_OK;
 3809|  1.14k|}
http.c:checkhttpprefix:
 3123|  15.6k|{
 3124|  15.6k|  struct curl_slist *head = data->set.http200aliases;
 3125|  15.6k|  statusline rc = STATUS_BAD;
 3126|  15.6k|  statusline onmatch = len >= 5 ? STATUS_DONE : STATUS_UNKNOWN;
  ------------------
  |  Branch (3126:24): [True: 14.4k, False: 1.20k]
  ------------------
 3127|       |
 3128|  15.6k|  while(head) {
  ------------------
  |  Branch (3128:9): [True: 0, False: 15.6k]
  ------------------
 3129|      0|    if(checkprefixmax(head->data, s, len)) {
  ------------------
  |  Branch (3129:8): [True: 0, False: 0]
  ------------------
 3130|      0|      rc = onmatch;
 3131|      0|      break;
 3132|      0|    }
 3133|      0|    head = head->next;
 3134|      0|  }
 3135|       |
 3136|  15.6k|  if((rc != STATUS_DONE) && (checkprefixmax("HTTP/", s, len)))
  ------------------
  |  Branch (3136:6): [True: 15.6k, False: 0]
  |  Branch (3136:29): [True: 15.3k, False: 317]
  ------------------
 3137|  15.3k|    rc = onmatch;
 3138|       |
 3139|  15.6k|  return rc;
 3140|  15.6k|}
http.c:checkprefixmax:
 3111|  15.6k|{
 3112|  15.6k|  size_t ch = CURLMIN(strlen(prefix), len);
  ------------------
  |  | 1287|  15.6k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 14.1k, False: 1.49k]
  |  |  ------------------
  ------------------
 3113|  15.6k|  return curl_strnequal(prefix, buffer, ch);
 3114|  15.6k|}
http.c:http_statusline:
 3701|  3.53k|{
 3702|  3.53k|  struct SingleRequest *k = &data->req;
 3703|       |
 3704|  3.53k|  switch(k->httpversion) {
 3705|  1.47k|  case 10:
  ------------------
  |  Branch (3705:3): [True: 1.47k, False: 2.06k]
  ------------------
 3706|  2.32k|  case 11:
  ------------------
  |  Branch (3706:3): [True: 855, False: 2.67k]
  ------------------
 3707|  2.32k|#ifdef USE_HTTP2
 3708|  3.53k|  case 20:
  ------------------
  |  Branch (3708:3): [True: 1.20k, False: 2.32k]
  ------------------
 3709|  3.53k|#endif
 3710|       |#ifdef USE_HTTP3
 3711|       |  case 30:
 3712|       |#endif
 3713|       |    /* no major version switch mid-connection */
 3714|  3.53k|    if(k->httpversion_sent &&
  ------------------
  |  Branch (3714:8): [True: 3.53k, False: 0]
  ------------------
 3715|  3.53k|       (k->httpversion / 10 != k->httpversion_sent / 10)) {
  ------------------
  |  Branch (3715:8): [True: 1, False: 3.53k]
  ------------------
 3716|      1|      failf(data, "Version mismatch (from HTTP/%d to HTTP/%d)",
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
 3717|      1|            k->httpversion_sent / 10, k->httpversion / 10);
 3718|      1|      return CURLE_WEIRD_SERVER_REPLY;
 3719|      1|    }
 3720|  3.53k|    break;
 3721|  3.53k|  default:
  ------------------
  |  Branch (3721:3): [True: 1, False: 3.53k]
  ------------------
 3722|      1|    failf(data, "Unsupported HTTP version (%d.%d) in response",
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
 3723|      1|          k->httpversion / 10, k->httpversion % 10);
 3724|      1|    return CURLE_UNSUPPORTED_PROTOCOL;
 3725|  3.53k|  }
 3726|       |
 3727|  3.53k|  data->info.httpcode = k->httpcode;
 3728|  3.53k|  data->info.httpversion = k->httpversion;
 3729|  3.53k|  conn->httpversion_seen = k->httpversion;
 3730|       |
 3731|  3.53k|  if(!data->state.http_neg.rcvd_min ||
  ------------------
  |  Branch (3731:6): [True: 3.08k, False: 445]
  ------------------
 3732|    445|     data->state.http_neg.rcvd_min > k->httpversion)
  ------------------
  |  Branch (3732:6): [True: 21, False: 424]
  ------------------
 3733|       |    /* store the lowest server version we encounter */
 3734|  3.10k|    data->state.http_neg.rcvd_min = k->httpversion;
 3735|       |
 3736|       |  /*
 3737|       |   * This code executes as part of processing the header. As a
 3738|       |   * result, it is not totally clear how to interpret the
 3739|       |   * response code yet as that depends on what other headers may
 3740|       |   * be present. 401 and 407 may be errors, but may be OK
 3741|       |   * depending on how authentication is working. Other codes
 3742|       |   * are definitely errors, so give up here.
 3743|       |   */
 3744|  3.53k|  if(data->state.resume_from && data->state.httpreq == HTTPREQ_GET &&
  ------------------
  |  Branch (3744:6): [True: 282, False: 3.24k]
  |  Branch (3744:33): [True: 190, False: 92]
  ------------------
 3745|    190|     k->httpcode == 416) {
  ------------------
  |  Branch (3745:6): [True: 0, False: 190]
  ------------------
 3746|       |    /* "Requested Range Not Satisfiable", proceed and pretend this is no
 3747|       |       error */
 3748|      0|    k->ignorebody = TRUE; /* Avoid appending error msg to good data. */
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 3749|      0|  }
 3750|       |
 3751|  3.53k|  if(k->httpversion == 10) {
  ------------------
  |  Branch (3751:6): [True: 1.47k, False: 2.06k]
  ------------------
 3752|       |    /* Default action for HTTP/1.0 must be to close, unless
 3753|       |       we get one of those fancy headers that tell us the
 3754|       |       server keeps it open for us! */
 3755|  1.47k|    infof(data, "HTTP 1.0, assume close after body");
  ------------------
  |  |  143|  1.47k|  do {                               \
  |  |  144|  1.47k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  1.47k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 1.47k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.47k]
  |  |  |  |  ------------------
  |  |  |  |  320|  1.47k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.47k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  1.47k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1.47k]
  |  |  ------------------
  ------------------
 3756|  1.47k|    connclose(conn, "HTTP/1.0 close after body");
  ------------------
  |  |  103|  1.47k|#define connclose(x, y)   Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
  |  |  ------------------
  |  |  |  |   91|  1.47k|#define CONNCTRL_CONNECTION 1
  |  |  ------------------
  ------------------
 3757|  1.47k|  }
 3758|       |
 3759|  3.53k|  k->http_bodyless = k->httpcode >= 100 && k->httpcode < 200;
  ------------------
  |  Branch (3759:22): [True: 3.51k, False: 13]
  |  Branch (3759:44): [True: 589, False: 2.92k]
  ------------------
 3760|  3.53k|  switch(k->httpcode) {
 3761|    893|  case 304:
  ------------------
  |  Branch (3761:3): [True: 893, False: 2.63k]
  ------------------
 3762|       |    /* (quote from RFC2616, section 10.3.5): The 304 response
 3763|       |     * MUST NOT contain a message-body, and thus is always
 3764|       |     * terminated by the first empty line after the header
 3765|       |     * fields. */
 3766|    893|    if(data->set.timecondition)
  ------------------
  |  Branch (3766:8): [True: 2, False: 891]
  ------------------
 3767|      2|      data->info.timecond = TRUE;
  ------------------
  |  | 1055|      2|#define TRUE true
  ------------------
 3768|    893|    FALLTHROUGH();
  ------------------
  |  |  821|    893|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
 3769|    922|  case 204:
  ------------------
  |  Branch (3769:3): [True: 29, False: 3.50k]
  ------------------
 3770|       |    /* (quote from RFC2616, section 10.2.5): The server has
 3771|       |     * fulfilled the request but does not need to return an
 3772|       |     * entity-body ... The 204 response MUST NOT include a
 3773|       |     * message-body, and thus is always terminated by the first
 3774|       |     * empty line after the header fields. */
 3775|    922|    k->size = 0;
 3776|    922|    k->maxdownload = 0;
 3777|    922|    k->http_bodyless = TRUE;
  ------------------
  |  | 1055|    922|#define TRUE true
  ------------------
 3778|    922|    break;
 3779|  2.60k|  default:
  ------------------
  |  Branch (3779:3): [True: 2.60k, False: 922]
  ------------------
 3780|  2.60k|    break;
 3781|  3.53k|  }
 3782|  3.53k|  return CURLE_OK;
 3783|  3.53k|}
http.c:verify_header:
 3813|  54.7k|{
 3814|  54.7k|  struct SingleRequest *k = &data->req;
 3815|  54.7k|  const char *ptr = memchr(hd, 0x00, hdlen);
 3816|  54.7k|  if(ptr) {
  ------------------
  |  Branch (3816:6): [True: 134, False: 54.6k]
  ------------------
 3817|       |    /* this is bad, bail out */
 3818|    134|    failf(data, "Nul byte in header");
  ------------------
  |  |   62|    134|#define failf Curl_failf
  ------------------
 3819|    134|    return CURLE_WEIRD_SERVER_REPLY;
 3820|    134|  }
 3821|  54.6k|  if(k->headerline < 2)
  ------------------
  |  Branch (3821:6): [True: 3.51k, False: 51.1k]
  ------------------
 3822|       |    /* the first "header" is the status-line and it has no colon */
 3823|  3.51k|    return CURLE_OK;
 3824|  51.1k|  if(((hd[0] == ' ') || (hd[0] == '\t')) && k->headerline > 2)
  ------------------
  |  Branch (3824:7): [True: 168, False: 50.9k]
  |  Branch (3824:25): [True: 31, False: 50.9k]
  |  Branch (3824:45): [True: 0, False: 199]
  ------------------
 3825|       |    /* line folding, cannot happen on line 2 */
 3826|      0|    ;
 3827|  51.1k|  else {
 3828|  51.1k|    ptr = memchr(hd, ':', hdlen);
 3829|  51.1k|    if(!ptr) {
  ------------------
  |  Branch (3829:8): [True: 59, False: 51.0k]
  ------------------
 3830|       |      /* this is bad, bail out */
 3831|     59|      failf(data, "Header without colon");
  ------------------
  |  |   62|     59|#define failf Curl_failf
  ------------------
 3832|     59|      return CURLE_WEIRD_SERVER_REPLY;
 3833|     59|    }
 3834|  51.1k|  }
 3835|  51.0k|  return CURLE_OK;
 3836|  51.1k|}
http.c:http_header:
 3649|  54.5k|{
 3650|  54.5k|  CURLcode result = CURLE_OK;
 3651|       |
 3652|  54.5k|  switch(hd[0]) {
  ------------------
  |  Branch (3652:10): [True: 42.7k, False: 11.8k]
  ------------------
 3653|  1.23k|  case 'a':
  ------------------
  |  Branch (3653:3): [True: 1.23k, False: 53.3k]
  ------------------
 3654|  1.32k|  case 'A':
  ------------------
  |  Branch (3654:3): [True: 83, False: 54.5k]
  ------------------
 3655|  1.32k|    result = http_header_a(data, hd, hdlen);
 3656|  1.32k|    break;
 3657|  7.79k|  case 'c':
  ------------------
  |  Branch (3657:3): [True: 7.79k, False: 46.8k]
  ------------------
 3658|  7.85k|  case 'C':
  ------------------
  |  Branch (3658:3): [True: 62, False: 54.5k]
  ------------------
 3659|  7.85k|    result = http_header_c(data, hd, hdlen);
 3660|  7.85k|    break;
 3661|  4.97k|  case 'l':
  ------------------
  |  Branch (3661:3): [True: 4.97k, False: 49.6k]
  ------------------
 3662|  5.87k|  case 'L':
  ------------------
  |  Branch (3662:3): [True: 906, False: 53.6k]
  ------------------
 3663|  5.87k|    result = http_header_l(data, hd, hdlen);
 3664|  5.87k|    break;
 3665|  1.30k|  case 'p':
  ------------------
  |  Branch (3665:3): [True: 1.30k, False: 53.2k]
  ------------------
 3666|  1.41k|  case 'P':
  ------------------
  |  Branch (3666:3): [True: 108, False: 54.4k]
  ------------------
 3667|  1.41k|    result = http_header_p(data, hd, hdlen);
 3668|  1.41k|    break;
 3669|  3.90k|  case 'r':
  ------------------
  |  Branch (3669:3): [True: 3.90k, False: 50.6k]
  ------------------
 3670|  4.57k|  case 'R':
  ------------------
  |  Branch (3670:3): [True: 673, False: 53.9k]
  ------------------
 3671|  4.57k|    result = http_header_r(data, hd, hdlen);
 3672|  4.57k|    break;
 3673|  16.0k|  case 's':
  ------------------
  |  Branch (3673:3): [True: 16.0k, False: 38.5k]
  ------------------
 3674|  16.1k|  case 'S':
  ------------------
  |  Branch (3674:3): [True: 91, False: 54.5k]
  ------------------
 3675|  16.1k|    result = http_header_s(data, hd, hdlen);
 3676|  16.1k|    break;
 3677|  3.96k|  case 't':
  ------------------
  |  Branch (3677:3): [True: 3.96k, False: 50.6k]
  ------------------
 3678|  4.44k|  case 'T':
  ------------------
  |  Branch (3678:3): [True: 480, False: 54.1k]
  ------------------
 3679|  4.44k|    result = http_header_t(data, hd, hdlen);
 3680|  4.44k|    break;
 3681|    839|  case 'w':
  ------------------
  |  Branch (3681:3): [True: 839, False: 53.7k]
  ------------------
 3682|  1.06k|  case 'W':
  ------------------
  |  Branch (3682:3): [True: 225, False: 54.3k]
  ------------------
 3683|  1.06k|    result = http_header_w(data, hd, hdlen);
 3684|  1.06k|    break;
 3685|  54.5k|  }
 3686|       |
 3687|  54.5k|  if(!result) {
  ------------------
  |  Branch (3687:6): [True: 54.3k, False: 213]
  ------------------
 3688|  54.3k|    struct connectdata *conn = data->conn;
 3689|  54.3k|    if(conn->scheme->protocol & CURLPROTO_RTSP)
  ------------------
  |  | 1096|  54.3k|#define CURLPROTO_RTSP    (1L << 18)
  ------------------
  |  Branch (3689:8): [True: 0, False: 54.3k]
  ------------------
 3690|      0|      result = Curl_rtsp_parseheader(data, hd);
 3691|  54.3k|  }
 3692|  54.5k|  return result;
 3693|  54.5k|}
http.c:http_header_a:
 3190|  1.32k|{
 3191|  1.32k|#ifndef CURL_DISABLE_ALTSVC
 3192|  1.32k|  const char *v;
 3193|  1.32k|  struct connectdata *conn = data->conn;
 3194|  1.32k|  v = (data->asi &&
  ------------------
  |  Branch (3194:8): [True: 1.32k, False: 0]
  ------------------
 3195|  1.32k|       (Curl_xfer_is_secure(data) ||
  ------------------
  |  Branch (3195:9): [True: 0, False: 1.32k]
  ------------------
 3196|  1.32k|#ifdef DEBUGBUILD
 3197|       |        /* allow debug builds to circumvent the HTTPS restriction */
 3198|  1.32k|        getenv("CURL_ALTSVC_HTTP")
  ------------------
  |  Branch (3198:9): [True: 1.32k, False: 0]
  ------------------
 3199|       |#else
 3200|       |        0
 3201|       |#endif
 3202|  1.32k|         )) ? HD_VAL(hd, hdlen, "Alt-Svc:") : NULL;
  ------------------
  |  | 3175|  1.32k|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3175:5): [True: 795, False: 525]
  |  |  |  Branch (3175:37): [True: 795, False: 0]
  |  |  ------------------
  |  | 3176|  1.32k|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3176:5): [True: 0, False: 795]
  |  |  ------------------
  ------------------
 3203|  1.32k|  if(v) {
  ------------------
  |  Branch (3203:6): [True: 0, False: 1.32k]
  ------------------
 3204|       |    /* the ALPN of the current request */
 3205|      0|    struct SingleRequest *k = &data->req;
 3206|      0|    enum alpnid id = (k->httpversion == 30) ? ALPN_h3 :
  ------------------
  |  Branch (3206:22): [True: 0, False: 0]
  ------------------
 3207|      0|      (k->httpversion == 20) ? ALPN_h2 : ALPN_h1;
  ------------------
  |  Branch (3207:7): [True: 0, False: 0]
  ------------------
 3208|      0|    return Curl_altsvc_parse(data, data->asi, v, id, conn->origin->hostname,
 3209|      0|                             curlx_uitous((unsigned int)conn->origin->port));
 3210|      0|  }
 3211|       |#else
 3212|       |  (void)data;
 3213|       |  (void)hd;
 3214|       |  (void)hdlen;
 3215|       |#endif
 3216|  1.32k|  return CURLE_OK;
 3217|  1.32k|}
http.c:http_header_c:
 3224|  7.85k|{
 3225|  7.85k|  struct connectdata *conn = data->conn;
 3226|  7.85k|  struct SingleRequest *k = &data->req;
 3227|  7.85k|  const char *v;
 3228|       |
 3229|       |  /* Check for Content-Length: header lines to get size. Browsers insist we
 3230|       |     should accept multiple Content-Length headers and that a comma separated
 3231|       |     list also is fine and then we should accept them all as long as they are
 3232|       |     the same value. Different values trigger error.
 3233|       |   */
 3234|  7.85k|  v = (!k->http_bodyless && !data->set.ignorecl) ?
  ------------------
  |  Branch (3234:8): [True: 5.90k, False: 1.94k]
  |  Branch (3234:29): [True: 5.58k, False: 318]
  ------------------
 3235|  7.85k|    HD_VAL(hd, hdlen, "Content-Length:") : NULL;
  ------------------
  |  | 3175|  5.58k|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3175:5): [True: 4.74k, False: 847]
  |  |  |  Branch (3175:37): [True: 4.74k, False: 0]
  |  |  ------------------
  |  | 3176|  5.58k|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3176:5): [True: 508, False: 4.23k]
  |  |  ------------------
  ------------------
 3236|  7.85k|  if(v) {
  ------------------
  |  Branch (3236:6): [True: 508, False: 7.34k]
  ------------------
 3237|    672|    do {
 3238|    672|      curl_off_t contentlength;
 3239|    672|      int offt = curlx_str_numblanks(&v, &contentlength);
 3240|       |
 3241|    672|      if(offt == STRE_OVERFLOW) {
  ------------------
  |  |   35|    672|#define STRE_OVERFLOW 7
  ------------------
  |  Branch (3241:10): [True: 132, False: 540]
  ------------------
 3242|       |        /* out of range */
 3243|    132|        if(data->set.max_filesize) {
  ------------------
  |  Branch (3243:12): [True: 3, False: 129]
  ------------------
 3244|      3|          failf(data, "Maximum file size exceeded");
  ------------------
  |  |   62|      3|#define failf Curl_failf
  ------------------
 3245|      3|          return CURLE_FILESIZE_EXCEEDED;
 3246|      3|        }
 3247|    129|        streamclose(conn, "overflow content-length");
  ------------------
  |  |  102|    129|#define streamclose(x, y) Curl_conncontrol(x, CONNCTRL_STREAM, y)
  |  |  ------------------
  |  |  |  |   92|    129|#define CONNCTRL_STREAM     2
  |  |  ------------------
  ------------------
 3248|    129|        infof(data, "Overflow Content-Length: value");
  ------------------
  |  |  143|    129|  do {                               \
  |  |  144|    129|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    129|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 129, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 129]
  |  |  |  |  ------------------
  |  |  |  |  320|    129|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    129|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    129|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 129]
  |  |  ------------------
  ------------------
 3249|    129|        return CURLE_OK;
 3250|    132|      }
 3251|    540|      else {
 3252|    540|        if((offt == STRE_OK) &&
  ------------------
  |  |   28|    540|#define STRE_OK       0
  ------------------
  |  Branch (3252:12): [True: 537, False: 3]
  ------------------
 3253|    537|           ((k->size == -1) || /* not set to something before */
  ------------------
  |  Branch (3253:13): [True: 369, False: 168]
  ------------------
 3254|    458|            (k->size == contentlength))) { /* or the same value */
  ------------------
  |  Branch (3254:13): [True: 89, False: 79]
  ------------------
 3255|       |
 3256|    458|          k->size = contentlength;
 3257|    458|          curlx_str_passblanks(&v);
 3258|       |
 3259|       |          /* on a comma, loop and get the next instead */
 3260|    458|          if(!curlx_str_single(&v, ','))
  ------------------
  |  Branch (3260:14): [True: 164, False: 294]
  ------------------
 3261|    164|            continue;
 3262|       |
 3263|    294|          if(!curlx_str_newline(&v)) {
  ------------------
  |  Branch (3263:14): [True: 292, False: 2]
  ------------------
 3264|    292|            k->maxdownload = k->size;
 3265|    292|            return CURLE_OK;
 3266|    292|          }
 3267|    294|        }
 3268|       |        /* negative, different value or rubbish - bad HTTP */
 3269|     84|        failf(data, "Invalid Content-Length: value");
  ------------------
  |  |   62|     84|#define failf Curl_failf
  ------------------
 3270|     84|        return CURLE_WEIRD_SERVER_REPLY;
 3271|    540|      }
 3272|    672|    } while(1);
  ------------------
  |  Branch (3272:13): [True: 164, Folded]
  ------------------
 3273|    508|  }
 3274|  7.34k|  v = (!k->http_bodyless && data->set.str[STRING_ENCODING]) ?
  ------------------
  |  Branch (3274:8): [True: 5.39k, False: 1.94k]
  |  Branch (3274:29): [True: 1.01k, False: 4.38k]
  ------------------
 3275|  7.34k|    HD_VAL(hd, hdlen, "Content-Encoding:") : NULL;
  ------------------
  |  | 3175|  1.01k|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3175:5): [True: 954, False: 62]
  |  |  |  Branch (3175:37): [True: 954, False: 0]
  |  |  ------------------
  |  | 3176|  1.01k|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3176:5): [True: 624, False: 330]
  |  |  ------------------
  ------------------
 3276|  7.34k|  if(v) {
  ------------------
  |  Branch (3276:6): [True: 624, False: 6.72k]
  ------------------
 3277|       |    /*
 3278|       |     * Process Content-Encoding. Look for the values: identity, gzip, deflate,
 3279|       |     * compress, x-gzip and x-compress. x-gzip and x-compress are the same as
 3280|       |     * gzip and compress. (Sec 3.5 RFC 2616). zlib cannot handle compress.
 3281|       |     * Errors are handled further down when the response body is processed
 3282|       |     */
 3283|    624|    return Curl_build_unencoding_stack(data, v, FALSE);
  ------------------
  |  | 1058|    624|#define FALSE false
  ------------------
 3284|    624|  }
 3285|       |  /* check for Content-Type: header lines to get the MIME-type */
 3286|  6.72k|  v = HD_VAL(hd, hdlen, "Content-Type:");
  ------------------
  |  | 3175|  6.72k|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3175:5): [True: 5.85k, False: 864]
  |  |  |  Branch (3175:37): [True: 5.85k, False: 0]
  |  |  ------------------
  |  | 3176|  6.72k|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3176:5): [True: 757, False: 5.10k]
  |  |  ------------------
  ------------------
 3287|  6.72k|  if(v) {
  ------------------
  |  Branch (3287:6): [True: 757, False: 5.96k]
  ------------------
 3288|    757|    char *contenttype = Curl_copy_header_value(hd);
 3289|    757|    if(!contenttype)
  ------------------
  |  Branch (3289:8): [True: 0, False: 757]
  ------------------
 3290|      0|      return CURLE_OUT_OF_MEMORY;
 3291|    757|    if(!*contenttype)
  ------------------
  |  Branch (3291:8): [True: 302, False: 455]
  ------------------
 3292|       |      /* ignore empty data */
 3293|    302|      curlx_free(contenttype);
  ------------------
  |  | 1483|    302|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3294|    455|    else {
 3295|    455|      curlx_free(data->info.contenttype);
  ------------------
  |  | 1483|    455|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3296|    455|      data->info.contenttype = contenttype;
 3297|    455|    }
 3298|    757|    return CURLE_OK;
 3299|    757|  }
 3300|  5.96k|  if((k->httpversion < 20) &&
  ------------------
  |  Branch (3300:6): [True: 1.88k, False: 4.08k]
  ------------------
 3301|  1.88k|     HD_IS_AND_SAYS(hd, hdlen, "Connection:", "close")) {
  ------------------
  |  | 3181|  1.88k|  (HD_IS(hd, hdlen, n) && \
  |  |  ------------------
  |  |  |  | 3172|  3.77k|  (((hdlen) >= (sizeof(n) - 1)) && curl_strnequal(n, hd, sizeof(n) - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3172:4): [True: 1.46k, False: 419]
  |  |  |  |  |  Branch (3172:36): [True: 85, False: 1.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3182|  1.88k|   ((hdlen) > ((sizeof(n) - 1) + (sizeof(v) - 1))) && \
  |  |  ------------------
  |  |  |  Branch (3182:4): [True: 54, False: 31]
  |  |  ------------------
  |  | 3183|  1.88k|   Curl_compareheader(hd, STRCONST(n), STRCONST(v)))
  |  |  ------------------
  |  |  |  | 1292|     54|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |                  Curl_compareheader(hd, STRCONST(n), STRCONST(v)))
  |  |  ------------------
  |  |  |  | 1292|     54|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |  |  Branch (3183:4): [True: 0, False: 54]
  |  |  ------------------
  ------------------
 3302|       |    /*
 3303|       |     * [RFC 2616, section 8.1.2.1]
 3304|       |     * "Connection: close" is HTTP/1.1 language and means that
 3305|       |     * the connection will close when this request has been
 3306|       |     * served.
 3307|       |     */
 3308|      0|    connclose(conn, "Connection: close used");
  ------------------
  |  |  103|      0|#define connclose(x, y)   Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
  |  |  ------------------
  |  |  |  |   91|      0|#define CONNCTRL_CONNECTION 1
  |  |  ------------------
  ------------------
 3309|      0|    return CURLE_OK;
 3310|      0|  }
 3311|  5.96k|  if((k->httpversion == 10) &&
  ------------------
  |  Branch (3311:6): [True: 1.76k, False: 4.20k]
  ------------------
 3312|  1.76k|     HD_IS_AND_SAYS(hd, hdlen, "Connection:", "keep-alive")) {
  ------------------
  |  | 3181|  1.76k|  (HD_IS(hd, hdlen, n) && \
  |  |  ------------------
  |  |  |  | 3172|  3.52k|  (((hdlen) >= (sizeof(n) - 1)) && curl_strnequal(n, hd, sizeof(n) - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3172:4): [True: 1.41k, False: 346]
  |  |  |  |  |  Branch (3172:36): [True: 82, False: 1.33k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3182|  1.76k|   ((hdlen) > ((sizeof(n) - 1) + (sizeof(v) - 1))) && \
  |  |  ------------------
  |  |  |  Branch (3182:4): [True: 36, False: 46]
  |  |  ------------------
  |  | 3183|  1.76k|   Curl_compareheader(hd, STRCONST(n), STRCONST(v)))
  |  |  ------------------
  |  |  |  | 1292|     36|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |                  Curl_compareheader(hd, STRCONST(n), STRCONST(v)))
  |  |  ------------------
  |  |  |  | 1292|     36|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |  |  Branch (3183:4): [True: 0, False: 36]
  |  |  ------------------
  ------------------
 3313|       |    /*
 3314|       |     * An HTTP/1.0 reply with the 'Connection: keep-alive' line
 3315|       |     * tells us the connection will be kept alive for our
 3316|       |     * pleasure. Default action for 1.0 is to close.
 3317|       |     *
 3318|       |     * [RFC2068, section 19.7.1] */
 3319|      0|    connkeep(conn, "Connection keep-alive");
  ------------------
  |  |  104|      0|#define connkeep(x, y)    Curl_conncontrol(x, CONNCTRL_KEEP, y)
  |  |  ------------------
  |  |  |  |   90|      0|#define CONNCTRL_KEEP       0 /* undo a marked closure */
  |  |  ------------------
  ------------------
 3320|      0|    infof(data, "HTTP/1.0 connection set to keep alive");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3321|      0|    return CURLE_OK;
 3322|      0|  }
 3323|  5.96k|  v = !k->http_bodyless ? HD_VAL(hd, hdlen, "Content-Range:") : NULL;
  ------------------
  |  | 3175|  4.60k|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3175:5): [True: 3.75k, False: 844]
  |  |  |  Branch (3175:37): [True: 3.75k, False: 0]
  |  |  ------------------
  |  | 3176|  4.60k|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3176:5): [True: 1.71k, False: 2.04k]
  |  |  ------------------
  ------------------
  |  Branch (3323:7): [True: 4.60k, False: 1.36k]
  ------------------
 3324|  5.96k|  if(v) {
  ------------------
  |  Branch (3324:6): [True: 1.71k, False: 4.24k]
  ------------------
 3325|       |    /* Content-Range: bytes [num]-
 3326|       |       Content-Range: bytes: [num]-
 3327|       |       Content-Range: [num]-
 3328|       |       Content-Range: [asterisk]/[total]
 3329|       |
 3330|       |       The second format was added since Sun's webserver
 3331|       |       JavaWebServer/1.1.1 obviously sends the header this way!
 3332|       |       The third added since some servers use that!
 3333|       |       The fourth means the requested range was unsatisfied.
 3334|       |    */
 3335|       |
 3336|  1.71k|    const char *ptr = v;
 3337|       |
 3338|       |    /* Move forward until first digit or asterisk */
 3339|  10.3k|    while(*ptr && !ISDIGIT(*ptr) && *ptr != '*')
  ------------------
  |  |   44|  20.3k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 2.41k, False: 7.61k]
  |  |  |  Branch (44:38): [True: 1.12k, False: 1.28k]
  |  |  ------------------
  ------------------
  |  Branch (3339:11): [True: 10.0k, False: 344]
  |  Branch (3339:37): [True: 8.65k, False: 249]
  ------------------
 3340|  8.65k|      ptr++;
 3341|       |
 3342|       |    /* if it truly stopped on a digit */
 3343|  1.71k|    if(ISDIGIT(*ptr)) {
  ------------------
  |  |   44|  1.71k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.12k, False: 593]
  |  |  |  Branch (44:38): [True: 1.12k, False: 0]
  |  |  ------------------
  ------------------
 3344|  1.12k|      if(!curlx_str_number(&ptr, &k->offset, CURL_OFF_T_MAX) &&
  ------------------
  |  |  594|  1.12k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (3344:10): [True: 881, False: 245]
  ------------------
 3345|    881|         (data->state.resume_from == k->offset))
  ------------------
  |  Branch (3345:10): [True: 240, False: 641]
  ------------------
 3346|       |        /* we asked for a resume and we got it */
 3347|    240|        k->content_range = TRUE;
  ------------------
  |  | 1055|    240|#define TRUE true
  ------------------
 3348|  1.12k|    }
 3349|    593|    else if(k->httpcode < 300)
  ------------------
  |  Branch (3349:13): [True: 277, False: 316]
  ------------------
 3350|    277|      data->state.resume_from = 0; /* get everything */
 3351|  1.71k|  }
 3352|  5.96k|  return CURLE_OK;
 3353|  5.96k|}
http.c:http_header_l:
 3360|  5.87k|{
 3361|  5.87k|  struct connectdata *conn = data->conn;
 3362|  5.87k|  struct SingleRequest *k = &data->req;
 3363|  5.87k|  const char *v = (!k->http_bodyless &&
  ------------------
  |  Branch (3363:20): [True: 3.85k, False: 2.02k]
  ------------------
 3364|  3.85k|                   (data->set.timecondition || data->set.get_filetime)) ?
  ------------------
  |  Branch (3364:21): [True: 465, False: 3.38k]
  |  Branch (3364:48): [True: 233, False: 3.15k]
  ------------------
 3365|  5.87k|    HD_VAL(hd, hdlen, "Last-Modified:") : NULL;
  ------------------
  |  | 3175|    698|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3175:5): [True: 428, False: 270]
  |  |  |  Branch (3175:37): [True: 428, False: 0]
  |  |  ------------------
  |  | 3176|    698|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3176:5): [True: 362, False: 66]
  |  |  ------------------
  ------------------
 3366|  5.87k|  if(v) {
  ------------------
  |  Branch (3366:6): [True: 362, False: 5.51k]
  ------------------
 3367|    362|    if(Curl_getdate_capped(v, &k->timeofdoc))
  ------------------
  |  Branch (3367:8): [True: 362, False: 0]
  ------------------
 3368|    362|      k->timeofdoc = 0;
 3369|    362|    if(data->set.get_filetime)
  ------------------
  |  Branch (3369:8): [True: 112, False: 250]
  ------------------
 3370|    112|      data->info.filetime = k->timeofdoc;
 3371|    362|    return CURLE_OK;
 3372|    362|  }
 3373|  5.51k|  if(HD_IS(hd, hdlen, "Location:")) {
  ------------------
  |  | 3172|  5.51k|  (((hdlen) >= (sizeof(n) - 1)) && curl_strnequal(n, hd, sizeof(n) - 1))
  |  |  ------------------
  |  |  |  Branch (3172:4): [True: 4.09k, False: 1.42k]
  |  |  |  Branch (3172:36): [True: 1.56k, False: 2.52k]
  |  |  ------------------
  ------------------
 3374|       |    /* this is the URL that the server advises us to use instead */
 3375|  1.56k|    char *location = Curl_copy_header_value(hd);
 3376|  1.56k|    if(!location)
  ------------------
  |  Branch (3376:8): [True: 0, False: 1.56k]
  ------------------
 3377|      0|      return CURLE_OUT_OF_MEMORY;
 3378|  1.56k|    if(!*location ||
  ------------------
  |  Branch (3378:8): [True: 541, False: 1.02k]
  ------------------
 3379|  1.02k|       (data->req.location && !strcmp(data->req.location, location))) {
  ------------------
  |  Branch (3379:9): [True: 368, False: 657]
  |  Branch (3379:31): [True: 264, False: 104]
  ------------------
 3380|       |      /* ignore empty header, or exact repeat of a previous one */
 3381|    805|      curlx_free(location);
  ------------------
  |  | 1483|    805|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3382|    805|      return CURLE_OK;
 3383|    805|    }
 3384|    761|    else {
 3385|       |      /* has value and is not an exact repeat */
 3386|    761|      if(data->req.location) {
  ------------------
  |  Branch (3386:10): [True: 104, False: 657]
  ------------------
 3387|    104|        failf(data, "Multiple Location headers");
  ------------------
  |  |   62|    104|#define failf Curl_failf
  ------------------
 3388|    104|        curlx_free(location);
  ------------------
  |  | 1483|    104|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3389|    104|        return CURLE_WEIRD_SERVER_REPLY;
 3390|    104|      }
 3391|    657|      data->req.location = location;
 3392|       |
 3393|    657|      if((k->httpcode >= 300 && k->httpcode < 400) &&
  ------------------
  |  Branch (3393:11): [True: 511, False: 146]
  |  Branch (3393:33): [True: 501, False: 10]
  ------------------
 3394|    501|         data->set.http_follow_mode) {
  ------------------
  |  Branch (3394:10): [True: 451, False: 50]
  ------------------
 3395|    451|        CURLcode result;
 3396|    451|        DEBUGASSERT(!data->req.newurl);
  ------------------
  |  | 1081|    451|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3396:9): [True: 0, False: 451]
  |  Branch (3396:9): [True: 451, False: 0]
  ------------------
 3397|    451|        data->req.newurl = curlx_strdup(data->req.location); /* clone */
  ------------------
  |  | 1477|    451|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 3398|    451|        if(!data->req.newurl)
  ------------------
  |  Branch (3398:12): [True: 0, False: 451]
  ------------------
 3399|      0|          return CURLE_OUT_OF_MEMORY;
 3400|       |
 3401|       |        /* some cases of POST and PUT etc needs to rewind the data
 3402|       |           stream at this point */
 3403|    451|        result = http_perhapsrewind(data, conn);
 3404|    451|        if(result)
  ------------------
  |  Branch (3404:12): [True: 0, False: 451]
  ------------------
 3405|      0|          return result;
 3406|       |
 3407|       |        /* mark the next request as a followed location: */
 3408|    451|        data->state.this_is_a_follow = TRUE;
  ------------------
  |  | 1055|    451|#define TRUE true
  ------------------
 3409|    451|      }
 3410|    657|    }
 3411|  1.56k|  }
 3412|  4.60k|  return CURLE_OK;
 3413|  5.51k|}
http.c:http_header_p:
 3420|  1.41k|{
 3421|  1.41k|  struct SingleRequest *k = &data->req;
 3422|       |
 3423|  1.41k|#ifndef CURL_DISABLE_PROXY
 3424|  1.41k|  const char *v = HD_VAL(hd, hdlen, "Proxy-Connection:");
  ------------------
  |  | 3175|  1.41k|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3175:5): [True: 919, False: 497]
  |  |  |  Branch (3175:37): [True: 919, False: 0]
  |  |  ------------------
  |  | 3176|  1.41k|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3176:5): [True: 80, False: 839]
  |  |  ------------------
  ------------------
 3425|  1.41k|  if(v) {
  ------------------
  |  Branch (3425:6): [True: 80, False: 1.33k]
  ------------------
 3426|     80|    struct connectdata *conn = data->conn;
 3427|     80|    if((k->httpversion == 10) && conn->bits.httpproxy &&
  ------------------
  |  Branch (3427:8): [True: 43, False: 37]
  |  Branch (3427:34): [True: 43, False: 0]
  ------------------
 3428|     43|       HD_IS_AND_SAYS(hd, hdlen, "Proxy-Connection:", "keep-alive")) {
  ------------------
  |  | 3181|     43|  (HD_IS(hd, hdlen, n) && \
  |  |  ------------------
  |  |  |  | 3172|     86|  (((hdlen) >= (sizeof(n) - 1)) && curl_strnequal(n, hd, sizeof(n) - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3172:4): [True: 43, False: 0]
  |  |  |  |  |  Branch (3172:36): [True: 43, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3182|     43|   ((hdlen) > ((sizeof(n) - 1) + (sizeof(v) - 1))) && \
  |  |  ------------------
  |  |  |  Branch (3182:4): [True: 25, False: 18]
  |  |  ------------------
  |  | 3183|     43|   Curl_compareheader(hd, STRCONST(n), STRCONST(v)))
  |  |  ------------------
  |  |  |  | 1292|     25|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |                  Curl_compareheader(hd, STRCONST(n), STRCONST(v)))
  |  |  ------------------
  |  |  |  | 1292|     25|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |  |  Branch (3183:4): [True: 0, False: 25]
  |  |  ------------------
  ------------------
 3429|       |      /*
 3430|       |       * When an HTTP/1.0 reply comes when using a proxy, the
 3431|       |       * 'Proxy-Connection: keep-alive' line tells us the
 3432|       |       * connection will be kept alive for our pleasure.
 3433|       |       * Default action for 1.0 is to close.
 3434|       |       */
 3435|      0|      connkeep(conn, "Proxy-Connection keep-alive"); /* do not close */
  ------------------
  |  |  104|      0|#define connkeep(x, y)    Curl_conncontrol(x, CONNCTRL_KEEP, y)
  |  |  ------------------
  |  |  |  |   90|      0|#define CONNCTRL_KEEP       0 /* undo a marked closure */
  |  |  ------------------
  ------------------
 3436|      0|      infof(data, "HTTP/1.0 proxy connection set to keep alive");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3437|      0|    }
 3438|     80|    else if((k->httpversion == 11) && conn->bits.httpproxy &&
  ------------------
  |  Branch (3438:13): [True: 37, False: 43]
  |  Branch (3438:39): [True: 37, False: 0]
  ------------------
 3439|     37|            HD_IS_AND_SAYS(hd, hdlen, "Proxy-Connection:", "close")) {
  ------------------
  |  | 3181|     37|  (HD_IS(hd, hdlen, n) && \
  |  |  ------------------
  |  |  |  | 3172|     74|  (((hdlen) >= (sizeof(n) - 1)) && curl_strnequal(n, hd, sizeof(n) - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3172:4): [True: 37, False: 0]
  |  |  |  |  |  Branch (3172:36): [True: 37, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3182|     37|   ((hdlen) > ((sizeof(n) - 1) + (sizeof(v) - 1))) && \
  |  |  ------------------
  |  |  |  Branch (3182:4): [True: 23, False: 14]
  |  |  ------------------
  |  | 3183|     37|   Curl_compareheader(hd, STRCONST(n), STRCONST(v)))
  |  |  ------------------
  |  |  |  | 1292|     23|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |                  Curl_compareheader(hd, STRCONST(n), STRCONST(v)))
  |  |  ------------------
  |  |  |  | 1292|     23|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |  |  Branch (3183:4): [True: 0, False: 23]
  |  |  ------------------
  ------------------
 3440|       |      /*
 3441|       |       * We get an HTTP/1.1 response from a proxy and it says it will
 3442|       |       * close down after this transfer.
 3443|       |       */
 3444|      0|      connclose(conn, "Proxy-Connection: asked to close after done");
  ------------------
  |  |  103|      0|#define connclose(x, y)   Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
  |  |  ------------------
  |  |  |  |   91|      0|#define CONNCTRL_CONNECTION 1
  |  |  ------------------
  ------------------
 3445|      0|      infof(data, "HTTP/1.1 proxy connection set close");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3446|      0|    }
 3447|     80|    return CURLE_OK;
 3448|     80|  }
 3449|  1.33k|#endif
 3450|  1.33k|  if((407 == k->httpcode) && HD_IS(hd, hdlen, "Proxy-authenticate:")) {
  ------------------
  |  | 3172|    189|  (((hdlen) >= (sizeof(n) - 1)) && curl_strnequal(n, hd, sizeof(n) - 1))
  |  |  ------------------
  |  |  |  Branch (3172:4): [True: 133, False: 56]
  |  |  |  Branch (3172:36): [True: 30, False: 103]
  |  |  ------------------
  ------------------
  |  Branch (3450:6): [True: 189, False: 1.14k]
  ------------------
 3451|     30|    char *auth = Curl_copy_header_value(hd);
 3452|     30|    CURLcode result = auth ? CURLE_OK : CURLE_OUT_OF_MEMORY;
  ------------------
  |  Branch (3452:23): [True: 30, False: 0]
  ------------------
 3453|     30|    if(!result) {
  ------------------
  |  Branch (3453:8): [True: 30, False: 0]
  ------------------
 3454|     30|      result = Curl_http_input_auth(data, TRUE, auth);
  ------------------
  |  | 1055|     30|#define TRUE true
  ------------------
 3455|     30|      curlx_free(auth);
  ------------------
  |  | 1483|     30|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3456|     30|    }
 3457|     30|    return result;
 3458|     30|  }
 3459|       |#ifdef USE_SPNEGO
 3460|       |  if(HD_IS(hd, hdlen, "Persistent-Auth:")) {
 3461|       |    struct connectdata *conn = data->conn;
 3462|       |    struct negotiatedata *negdata = Curl_auth_nego_get(conn, FALSE);
 3463|       |    struct auth *authp = &data->state.authhost;
 3464|       |    if(!negdata)
 3465|       |      return CURLE_OUT_OF_MEMORY;
 3466|       |    if(authp->picked == CURLAUTH_NEGOTIATE) {
 3467|       |      char *persistentauth = Curl_copy_header_value(hd);
 3468|       |      if(!persistentauth)
 3469|       |        return CURLE_OUT_OF_MEMORY;
 3470|       |      negdata->noauthpersist = !!checkprefix("false", persistentauth);
 3471|       |      negdata->havenoauthpersist = TRUE;
 3472|       |      infof(data, "Negotiate: noauthpersist -> %d, header part: %s",
 3473|       |            negdata->noauthpersist, persistentauth);
 3474|       |      curlx_free(persistentauth);
 3475|       |    }
 3476|       |  }
 3477|       |#endif
 3478|  1.30k|  return CURLE_OK;
 3479|  1.33k|}
http.c:http_header_r:
 3486|  4.57k|{
 3487|  4.57k|  const char *v = HD_VAL(hd, hdlen, "Retry-After:");
  ------------------
  |  | 3175|  4.57k|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3175:5): [True: 3.55k, False: 1.02k]
  |  |  |  Branch (3175:37): [True: 3.55k, False: 0]
  |  |  ------------------
  |  | 3176|  4.57k|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3176:5): [True: 2.76k, False: 786]
  |  |  ------------------
  ------------------
 3488|  4.57k|  if(v) {
  ------------------
  |  Branch (3488:6): [True: 2.76k, False: 1.81k]
  ------------------
 3489|       |    /* Retry-After = HTTP-date / delay-seconds */
 3490|  2.76k|    curl_off_t retry_after = 0; /* zero for unknown or "now" */
 3491|  2.76k|    time_t date = 0;
 3492|  2.76k|    curlx_str_passblanks(&v);
 3493|       |
 3494|       |    /* try it as a date first, because a date can otherwise start with and
 3495|       |       get treated as a number */
 3496|  2.76k|    if(!Curl_getdate_capped(v, &date)) {
  ------------------
  |  Branch (3496:8): [True: 637, False: 2.13k]
  ------------------
 3497|    637|      time_t current = time(NULL);
 3498|    637|      if(date >= current)
  ------------------
  |  Branch (3498:10): [True: 337, False: 300]
  ------------------
 3499|       |        /* convert date to number of seconds into the future */
 3500|    337|        retry_after = date - current;
 3501|    637|    }
 3502|  2.13k|    else
 3503|       |      /* Try it as a decimal number, ignore errors */
 3504|  2.13k|      (void)curlx_str_number(&v, &retry_after, CURL_OFF_T_MAX);
  ------------------
  |  |  594|  2.13k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
 3505|       |    /* limit to 6 hours max. this is not documented so that it can be changed
 3506|       |       in the future if necessary. */
 3507|  2.76k|    if(retry_after > 21600)
  ------------------
  |  Branch (3507:8): [True: 390, False: 2.37k]
  ------------------
 3508|    390|      retry_after = 21600;
 3509|  2.76k|    data->info.retry_after = retry_after;
 3510|  2.76k|  }
 3511|  4.57k|  return CURLE_OK;
 3512|  4.57k|}
http.c:http_header_s:
 3519|  16.1k|{
 3520|  16.1k|#if !defined(CURL_DISABLE_COOKIES) || !defined(CURL_DISABLE_HSTS)
 3521|  16.1k|  struct connectdata *conn = data->conn;
 3522|  16.1k|  const char *v;
 3523|       |#else
 3524|       |  (void)data;
 3525|       |  (void)hd;
 3526|       |  (void)hdlen;
 3527|       |#endif
 3528|       |
 3529|  16.1k|#ifndef CURL_DISABLE_COOKIES
 3530|  16.1k|  v = (data->cookies && data->state.cookie_engine) ?
  ------------------
  |  Branch (3530:8): [True: 16.1k, False: 0]
  |  Branch (3530:25): [True: 16.1k, False: 0]
  ------------------
 3531|  16.1k|    HD_VAL(hd, hdlen, "Set-Cookie:") : NULL;
  ------------------
  |  | 3175|  16.1k|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3175:5): [True: 15.4k, False: 677]
  |  |  |  Branch (3175:37): [True: 15.4k, False: 0]
  |  |  ------------------
  |  | 3176|  16.1k|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3176:5): [True: 11.8k, False: 3.64k]
  |  |  ------------------
  ------------------
 3532|  16.1k|  if(v) {
  ------------------
  |  Branch (3532:6): [True: 11.8k, False: 4.32k]
  ------------------
 3533|       |    /* If there is a custom-set Host: name, use it here, or else use
 3534|       |     * real peer hostname. */
 3535|  11.8k|    const char *host = data->req.cookiehost ?
  ------------------
  |  Branch (3535:24): [True: 135, False: 11.7k]
  ------------------
 3536|  11.7k|      data->req.cookiehost : conn->origin->hostname;
 3537|  11.8k|    const bool secure_context = Curl_secure_context(conn, host);
 3538|  11.8k|    CURLcode result;
 3539|  11.8k|    Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 3540|  11.8k|    result = Curl_cookie_add(data, data->cookies, TRUE, FALSE, v, host,
  ------------------
  |  | 1055|  11.8k|#define TRUE true
  ------------------
                  result = Curl_cookie_add(data, data->cookies, TRUE, FALSE, v, host,
  ------------------
  |  | 1058|  11.8k|#define FALSE false
  ------------------
 3541|  11.8k|                             data->state.up.path, secure_context);
 3542|  11.8k|    Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 3543|  11.8k|    return result;
 3544|  11.8k|  }
 3545|  4.32k|#endif
 3546|  4.32k|#ifndef CURL_DISABLE_HSTS
 3547|       |  /* If enabled, the header is incoming and this is over HTTPS */
 3548|  4.32k|  v = (data->hsts &&
  ------------------
  |  Branch (3548:8): [True: 4.32k, False: 0]
  ------------------
 3549|  4.32k|       (Curl_xfer_is_secure(data) ||
  ------------------
  |  Branch (3549:9): [True: 0, False: 4.32k]
  ------------------
 3550|  4.32k|#ifdef DEBUGBUILD
 3551|       |        /* allow debug builds to circumvent the HTTPS restriction */
 3552|  4.32k|        getenv("CURL_HSTS_HTTP")
  ------------------
  |  Branch (3552:9): [True: 4.32k, False: 0]
  ------------------
 3553|       |#else
 3554|       |        0
 3555|       |#endif
 3556|  4.32k|         )
 3557|  4.32k|    ) ? HD_VAL(hd, hdlen, "Strict-Transport-Security:") : NULL;
  ------------------
  |  | 3175|  4.32k|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3175:5): [True: 2.80k, False: 1.51k]
  |  |  |  Branch (3175:37): [True: 2.80k, False: 0]
  |  |  ------------------
  |  | 3176|  4.32k|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3176:5): [True: 1.67k, False: 1.13k]
  |  |  ------------------
  ------------------
 3558|  4.32k|  if(v) {
  ------------------
  |  Branch (3558:6): [True: 1.67k, False: 2.65k]
  ------------------
 3559|  1.67k|    CURLcode result =
 3560|  1.67k|      Curl_hsts_parse(data->hsts, conn->origin->hostname, v);
 3561|  1.67k|    if(result) {
  ------------------
  |  Branch (3561:8): [True: 1.31k, False: 352]
  ------------------
 3562|  1.31k|      if(result == CURLE_OUT_OF_MEMORY)
  ------------------
  |  Branch (3562:10): [True: 0, False: 1.31k]
  ------------------
 3563|      0|        return result;
 3564|  1.31k|      infof(data, "Illegal STS header skipped");
  ------------------
  |  |  143|  1.31k|  do {                               \
  |  |  144|  1.31k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  1.31k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 1.31k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.31k]
  |  |  |  |  ------------------
  |  |  |  |  320|  1.31k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.31k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  1.31k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1.31k]
  |  |  ------------------
  ------------------
 3565|  1.31k|    }
 3566|    352|#ifdef DEBUGBUILD
 3567|    352|    else
 3568|    352|      infof(data, "Parsed STS header fine (%zu entries)",
  ------------------
  |  |  143|    352|  do {                               \
  |  |  144|    352|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    352|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 352, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 352]
  |  |  |  |  ------------------
  |  |  |  |  320|    352|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    352|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    352|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 352]
  |  |  ------------------
  ------------------
 3569|  1.67k|            Curl_llist_count(&data->hsts->list));
 3570|  1.67k|#endif
 3571|  1.67k|  }
 3572|  4.32k|#endif
 3573|       |
 3574|  4.32k|  return CURLE_OK;
 3575|  4.32k|}
http.c:http_header_t:
 3582|  4.44k|{
 3583|  4.44k|  struct connectdata *conn = data->conn;
 3584|  4.44k|  struct SingleRequest *k = &data->req;
 3585|       |
 3586|       |  /* RFC 9112, ch. 6.1
 3587|       |   * "Transfer-Encoding MAY be sent in a response to a HEAD request or
 3588|       |   *  in a 304 (Not Modified) response (Section 15.4.5 of [HTTP]) to a
 3589|       |   *  GET request, neither of which includes a message body, to indicate
 3590|       |   *  that the origin server would have applied a transfer coding to the
 3591|       |   *  message body if the request had been an unconditional GET."
 3592|       |   *
 3593|       |   * Read: in these cases the 'Transfer-Encoding' does not apply
 3594|       |   * to any data following the response headers. Do not add any decoders.
 3595|       |   */
 3596|  4.44k|  const char *v = (!k->http_bodyless &&
  ------------------
  |  Branch (3596:20): [True: 4.02k, False: 413]
  ------------------
 3597|  4.02k|                   (data->state.httpreq != HTTPREQ_HEAD) &&
  ------------------
  |  Branch (3597:20): [True: 3.95k, False: 77]
  ------------------
 3598|  3.95k|                   (k->httpcode != 304)) ?
  ------------------
  |  Branch (3598:20): [True: 3.95k, False: 0]
  ------------------
 3599|  4.44k|    HD_VAL(hd, hdlen, "Transfer-Encoding:") : NULL;
  ------------------
  |  | 3175|  3.95k|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3175:5): [True: 1.91k, False: 2.03k]
  |  |  |  Branch (3175:37): [True: 1.91k, False: 0]
  |  |  ------------------
  |  | 3176|  3.95k|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3176:5): [True: 999, False: 912]
  |  |  ------------------
  ------------------
 3600|  4.44k|  if(v) {
  ------------------
  |  Branch (3600:6): [True: 999, False: 3.44k]
  ------------------
 3601|       |    /* One or more encodings. We check for chunked and/or a compression
 3602|       |       algorithm. */
 3603|    999|    CURLcode result = Curl_build_unencoding_stack(data, v, TRUE);
  ------------------
  |  | 1055|    999|#define TRUE true
  ------------------
 3604|    999|    if(result)
  ------------------
  |  Branch (3604:8): [True: 16, False: 983]
  ------------------
 3605|     16|      return result;
 3606|    983|    if(!k->chunk && data->set.http_transfer_encoding) {
  ------------------
  |  Branch (3606:8): [True: 816, False: 167]
  |  Branch (3606:21): [True: 772, False: 44]
  ------------------
 3607|       |      /* if this is not chunked, only close can signal the end of this
 3608|       |       * transfer as Content-Length is said not to be trusted for
 3609|       |       * transfer-encoding! */
 3610|    772|      connclose(conn, "HTTP/1.1 transfer-encoding without chunks");
  ------------------
  |  |  103|    772|#define connclose(x, y)   Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
  |  |  ------------------
  |  |  |  |   91|    772|#define CONNCTRL_CONNECTION 1
  |  |  ------------------
  ------------------
 3611|    772|      k->ignore_cl = TRUE;
  ------------------
  |  | 1055|    772|#define TRUE true
  ------------------
 3612|    772|    }
 3613|    983|    return CURLE_OK;
 3614|    999|  }
 3615|  3.44k|  v = HD_VAL(hd, hdlen, "Trailer:");
  ------------------
  |  | 3175|  3.44k|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3175:5): [True: 3.14k, False: 301]
  |  |  |  Branch (3175:37): [True: 3.14k, False: 0]
  |  |  ------------------
  |  | 3176|  3.44k|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3176:5): [True: 0, False: 3.14k]
  |  |  ------------------
  ------------------
 3616|  3.44k|  if(v) {
  ------------------
  |  Branch (3616:6): [True: 0, False: 3.44k]
  ------------------
 3617|      0|    data->req.resp_trailer = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 3618|      0|    return CURLE_OK;
 3619|      0|  }
 3620|  3.44k|  return CURLE_OK;
 3621|  3.44k|}
http.c:http_header_w:
 3628|  1.06k|{
 3629|  1.06k|  struct SingleRequest *k = &data->req;
 3630|  1.06k|  CURLcode result = CURLE_OK;
 3631|       |
 3632|  1.06k|  if((401 == k->httpcode) && HD_IS(hd, hdlen, "WWW-Authenticate:")) {
  ------------------
  |  | 3172|     63|  (((hdlen) >= (sizeof(n) - 1)) && curl_strnequal(n, hd, sizeof(n) - 1))
  |  |  ------------------
  |  |  |  Branch (3172:4): [True: 45, False: 18]
  |  |  |  Branch (3172:36): [True: 20, False: 25]
  |  |  ------------------
  ------------------
  |  Branch (3632:6): [True: 63, False: 1.00k]
  ------------------
 3633|     20|    char *auth = Curl_copy_header_value(hd);
 3634|     20|    if(!auth)
  ------------------
  |  Branch (3634:8): [True: 0, False: 20]
  ------------------
 3635|      0|      result = CURLE_OUT_OF_MEMORY;
 3636|     20|    else {
 3637|     20|      result = Curl_http_input_auth(data, FALSE, auth);
  ------------------
  |  | 1058|     20|#define FALSE false
  ------------------
 3638|     20|      curlx_free(auth);
  ------------------
  |  | 1483|     20|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3639|     20|    }
 3640|     20|  }
 3641|  1.06k|  return result;
 3642|  1.06k|}
http.c:http_parse_headers:
 4403|  94.2k|{
 4404|  94.2k|  struct connectdata *conn = data->conn;
 4405|  94.2k|  CURLcode result = CURLE_OK;
 4406|  94.2k|  struct SingleRequest *k = &data->req;
 4407|  94.2k|  const char *end_ptr;
 4408|  94.2k|  bool leftover_body = FALSE;
  ------------------
  |  | 1058|  94.2k|#define FALSE false
  ------------------
 4409|       |
 4410|       |  /* we have bytes for the next header, make sure it is not a folded header
 4411|       |     before passing it on */
 4412|  94.2k|  if(data->state.maybe_folded && blen) {
  ------------------
  |  Branch (4412:6): [True: 2.78k, False: 91.4k]
  |  Branch (4412:34): [True: 2.77k, False: 10]
  ------------------
 4413|  2.77k|    if(ISBLANK(buf[0])) {
  ------------------
  |  |   45|  2.77k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 155, False: 2.61k]
  |  |  |  Branch (45:38): [True: 239, False: 2.37k]
  |  |  ------------------
  ------------------
 4414|       |      /* folded, remove the trailing newlines and append the next header */
 4415|    394|      unfold_header(data);
 4416|    394|    }
 4417|  2.37k|    else {
 4418|       |      /* the header data we hold is a complete header, pass it on */
 4419|  2.37k|      size_t ignore_this;
 4420|  2.37k|      result = http_rw_hd(data, curlx_dyn_ptr(&data->state.headerb),
 4421|  2.37k|                          curlx_dyn_len(&data->state.headerb),
 4422|  2.37k|                          NULL, 0, &ignore_this);
 4423|  2.37k|      curlx_dyn_reset(&data->state.headerb);
 4424|  2.37k|      if(result)
  ------------------
  |  Branch (4424:10): [True: 55, False: 2.32k]
  ------------------
 4425|     55|        return result;
 4426|  2.37k|    }
 4427|  2.71k|    data->state.maybe_folded = FALSE;
  ------------------
  |  | 1058|  2.71k|#define FALSE false
  ------------------
 4428|  2.71k|  }
 4429|       |
 4430|       |  /* header line within buffer loop */
 4431|  94.1k|  *pconsumed = 0;
 4432|   117k|  while(blen && k->header) {
  ------------------
  |  Branch (4432:9): [True: 115k, False: 1.16k]
  |  Branch (4432:17): [True: 114k, False: 850]
  ------------------
 4433|   114k|    size_t consumed;
 4434|   114k|    size_t hlen;
 4435|   114k|    const char *hd;
 4436|   114k|    size_t unfold_len = 0;
 4437|       |
 4438|   114k|    if(data->state.leading_unfold) {
  ------------------
  |  Branch (4438:8): [True: 2.88k, False: 112k]
  ------------------
 4439|       |      /* immediately after an unfold, keep only a single whitespace */
 4440|  7.74k|      while(blen && ISBLANK(buf[0])) {
  ------------------
  |  |   45|  7.02k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 2.04k, False: 4.97k]
  |  |  |  Branch (45:38): [True: 2.81k, False: 2.16k]
  |  |  ------------------
  ------------------
  |  Branch (4440:13): [True: 7.02k, False: 716]
  ------------------
 4441|  4.85k|        buf++;
 4442|  4.85k|        blen--;
 4443|  4.85k|        unfold_len++;
 4444|  4.85k|      }
 4445|  2.88k|      if(blen) {
  ------------------
  |  Branch (4445:10): [True: 2.16k, False: 716]
  ------------------
 4446|       |        /* insert a single space */
 4447|  2.16k|        result = curlx_dyn_addn(&data->state.headerb, " ", 1);
 4448|  2.16k|        if(result)
  ------------------
  |  Branch (4448:12): [True: 0, False: 2.16k]
  ------------------
 4449|      0|          return result;
 4450|  2.16k|        data->state.leading_unfold = FALSE; /* done now */
  ------------------
  |  | 1058|  2.16k|#define FALSE false
  ------------------
 4451|  2.16k|      }
 4452|  2.88k|    }
 4453|       |
 4454|   114k|    end_ptr = memchr(buf, '\n', blen);
 4455|   114k|    if(!end_ptr) {
  ------------------
  |  Branch (4455:8): [True: 88.7k, False: 26.2k]
  ------------------
 4456|       |      /* Not a complete header line within buffer, append the data to
 4457|       |         the end of the headerbuff. */
 4458|  88.7k|      result = curlx_dyn_addn(&data->state.headerb, buf, blen);
 4459|  88.7k|      if(result)
  ------------------
  |  Branch (4459:10): [True: 0, False: 88.7k]
  ------------------
 4460|      0|        return result;
 4461|  88.7k|      *pconsumed += blen + unfold_len;
 4462|       |
 4463|  88.7k|      if(!k->headerline) {
  ------------------
  |  Branch (4463:10): [True: 11.9k, False: 76.7k]
  ------------------
 4464|       |        /* check if this looks like a protocol header */
 4465|  11.9k|        statusline st =
 4466|  11.9k|          checkprotoprefix(data, conn,
 4467|  11.9k|                           curlx_dyn_ptr(&data->state.headerb),
 4468|  11.9k|                           curlx_dyn_len(&data->state.headerb));
 4469|       |
 4470|  11.9k|        if(st == STATUS_BAD) {
  ------------------
  |  Branch (4470:12): [True: 66, False: 11.9k]
  ------------------
 4471|       |          /* this is not the beginning of a protocol first header line.
 4472|       |           * Cannot be 0.9 if version was detected or connection was reused. */
 4473|     66|          k->header = FALSE;
  ------------------
  |  | 1058|     66|#define FALSE false
  ------------------
 4474|     66|          streamclose(conn, "bad HTTP: No end-of-message indicator");
  ------------------
  |  |  102|     66|#define streamclose(x, y) Curl_conncontrol(x, CONNCTRL_STREAM, y)
  |  |  ------------------
  |  |  |  |   92|     66|#define CONNCTRL_STREAM     2
  |  |  ------------------
  ------------------
 4475|     66|          if((k->httpversion >= 10) || conn->bits.reuse) {
  ------------------
  |  Branch (4475:14): [True: 4, False: 62]
  |  Branch (4475:40): [True: 1, False: 61]
  ------------------
 4476|      5|            failf(data, "Invalid status line");
  ------------------
  |  |   62|      5|#define failf Curl_failf
  ------------------
 4477|      5|            return CURLE_WEIRD_SERVER_REPLY;
 4478|      5|          }
 4479|     61|          if(!data->state.http_neg.accept_09) {
  ------------------
  |  Branch (4479:14): [True: 58, False: 3]
  ------------------
 4480|     58|            failf(data, "Received HTTP/0.9 when not allowed");
  ------------------
  |  |   62|     58|#define failf Curl_failf
  ------------------
 4481|     58|            return CURLE_UNSUPPORTED_PROTOCOL;
 4482|     58|          }
 4483|      3|          leftover_body = TRUE;
  ------------------
  |  | 1055|      3|#define TRUE true
  ------------------
 4484|      3|          goto out;
 4485|     61|        }
 4486|  11.9k|      }
 4487|  88.7k|      goto out; /* read more and try again */
 4488|  88.7k|    }
 4489|       |
 4490|       |    /* the size of the remaining header line */
 4491|  26.2k|    consumed = (end_ptr - buf) + 1;
 4492|       |
 4493|  26.2k|    result = curlx_dyn_addn(&data->state.headerb, buf, consumed);
 4494|  26.2k|    if(result)
  ------------------
  |  Branch (4494:8): [True: 0, False: 26.2k]
  ------------------
 4495|      0|      return result;
 4496|  26.2k|    blen -= consumed;
 4497|  26.2k|    buf += consumed;
 4498|  26.2k|    *pconsumed += consumed + unfold_len;
 4499|       |
 4500|       |    /****
 4501|       |     * We now have a FULL header line in 'headerb'.
 4502|       |     *****/
 4503|       |
 4504|  26.2k|    hlen = curlx_dyn_len(&data->state.headerb);
 4505|  26.2k|    hd = curlx_dyn_ptr(&data->state.headerb);
 4506|       |
 4507|  26.2k|    if(!k->headerline) {
  ------------------
  |  Branch (4507:8): [True: 2.51k, False: 23.6k]
  ------------------
 4508|       |      /* the first read "header", the status line */
 4509|  2.51k|      statusline st = checkprotoprefix(data, conn, hd, hlen);
 4510|  2.51k|      if(st == STATUS_BAD) {
  ------------------
  |  Branch (4510:10): [True: 143, False: 2.36k]
  ------------------
 4511|    143|        streamclose(conn, "bad HTTP: No end-of-message indicator");
  ------------------
  |  |  102|    143|#define streamclose(x, y) Curl_conncontrol(x, CONNCTRL_STREAM, y)
  |  |  ------------------
  |  |  |  |   92|    143|#define CONNCTRL_STREAM     2
  |  |  ------------------
  ------------------
 4512|       |        /* this is not the beginning of a protocol first header line.
 4513|       |         * Cannot be 0.9 if version was detected or connection was reused. */
 4514|    143|        if((k->httpversion >= 10) || conn->bits.reuse) {
  ------------------
  |  Branch (4514:12): [True: 9, False: 134]
  |  Branch (4514:38): [True: 1, False: 133]
  ------------------
 4515|     10|          failf(data, "Invalid status line");
  ------------------
  |  |   62|     10|#define failf Curl_failf
  ------------------
 4516|     10|          return CURLE_WEIRD_SERVER_REPLY;
 4517|     10|        }
 4518|    133|        if(!data->state.http_neg.accept_09) {
  ------------------
  |  Branch (4518:12): [True: 132, False: 1]
  ------------------
 4519|    132|          failf(data, "Received HTTP/0.9 when not allowed");
  ------------------
  |  |   62|    132|#define failf Curl_failf
  ------------------
 4520|    132|          return CURLE_UNSUPPORTED_PROTOCOL;
 4521|    132|        }
 4522|      1|        k->header = FALSE;
  ------------------
  |  | 1058|      1|#define FALSE false
  ------------------
 4523|      1|        leftover_body = TRUE;
  ------------------
  |  | 1055|      1|#define TRUE true
  ------------------
 4524|      1|        goto out;
 4525|    133|      }
 4526|  2.51k|    }
 4527|  23.6k|    else {
 4528|  23.6k|      if(hlen && !ISNEWLINE(hd[0])) {
  ------------------
  |  |   50|  23.6k|#define ISNEWLINE(x)    (((x) == '\n') || (x) == '\r')
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 1.41k, False: 22.2k]
  |  |  |  Branch (50:43): [True: 20, False: 22.2k]
  |  |  ------------------
  ------------------
  |  Branch (4528:10): [True: 23.6k, False: 0]
  ------------------
 4529|       |        /* this is NOT the header separator */
 4530|       |
 4531|       |        /* if we have bytes for the next header, check for folding */
 4532|  22.2k|        if(blen && ISBLANK(buf[0])) {
  ------------------
  |  |   45|  19.4k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.22k, False: 18.2k]
  |  |  |  Branch (45:38): [True: 559, False: 17.6k]
  |  |  ------------------
  ------------------
  |  Branch (4532:12): [True: 19.4k, False: 2.78k]
  ------------------
 4533|       |          /* remove the trailing CRLF and append the next header */
 4534|  1.78k|          unfold_header(data);
 4535|  1.78k|          continue;
 4536|  1.78k|        }
 4537|  20.4k|        else if(!blen) {
  ------------------
  |  Branch (4537:17): [True: 2.78k, False: 17.6k]
  ------------------
 4538|       |          /* this might be a folded header so deal with it in next invoke */
 4539|  2.78k|          data->state.maybe_folded = TRUE;
  ------------------
  |  | 1055|  2.78k|#define TRUE true
  ------------------
 4540|  2.78k|          break;
 4541|  2.78k|        }
 4542|  22.2k|      }
 4543|  23.6k|    }
 4544|       |
 4545|  21.5k|    result = http_rw_hd(data, hd, hlen, buf, blen, &consumed);
 4546|       |    /* We are done with this line. We reset because response
 4547|       |     * processing might switch to HTTP/2 and that might call us
 4548|       |     * directly again. */
 4549|  21.5k|    curlx_dyn_reset(&data->state.headerb);
 4550|  21.5k|    if(consumed) {
  ------------------
  |  Branch (4550:8): [True: 0, False: 21.5k]
  ------------------
 4551|      0|      blen -= consumed;
 4552|      0|      buf += consumed;
 4553|      0|      *pconsumed += consumed;
 4554|      0|    }
 4555|  21.5k|    if(result)
  ------------------
  |  Branch (4555:8): [True: 447, False: 21.0k]
  ------------------
 4556|    447|      return result;
 4557|  21.5k|  }
 4558|       |
 4559|       |  /* We might have reached the end of the header part here, but
 4560|       |     there might be a non-header part left in the end of the read
 4561|       |     buffer. */
 4562|  93.5k|out:
 4563|  93.5k|  if(!k->header && !leftover_body) {
  ------------------
  |  Branch (4563:6): [True: 933, False: 92.5k]
  |  Branch (4563:20): [True: 929, False: 4]
  ------------------
 4564|    929|    curlx_dyn_free(&data->state.headerb);
 4565|    929|  }
 4566|  93.5k|  return CURLE_OK;
 4567|  94.1k|}
http.c:unfold_header:
 4392|  2.17k|{
 4393|  2.17k|  Curl_http_to_fold(&data->state.headerb);
 4394|       |  data->state.leading_unfold = TRUE;
  ------------------
  |  | 1055|  2.17k|#define TRUE true
  ------------------
 4395|  2.17k|}
http.c:checkprotoprefix:
 3159|  14.4k|{
 3160|  14.4k|#ifndef CURL_DISABLE_RTSP
 3161|  14.4k|  if(conn->scheme->protocol & CURLPROTO_RTSP)
  ------------------
  |  | 1096|  14.4k|#define CURLPROTO_RTSP    (1L << 18)
  ------------------
  |  Branch (3161:6): [True: 0, False: 14.4k]
  ------------------
 3162|      0|    return checkrtspprefix(data, s, len);
 3163|       |#else
 3164|       |  (void)conn;
 3165|       |#endif /* CURL_DISABLE_RTSP */
 3166|       |
 3167|  14.4k|  return checkhttpprefix(data, s, len);
 3168|  14.4k|}
http.c:req_assign_url_authority:
 4723|      4|{
 4724|      4|  char *host, *port;
 4725|      4|  struct dynbuf buf;
 4726|      4|  CURLUcode uc;
 4727|      4|  CURLcode result = CURLE_URL_MALFORMAT;
 4728|       |
 4729|      4|  host = port = NULL;
 4730|      4|  curlx_dyn_init(&buf, DYN_HTTP_REQUEST);
  ------------------
  |  |   69|      4|#define DYN_HTTP_REQUEST    (1024 * 1024)
  ------------------
 4731|       |
 4732|      4|  uc = curl_url_get(url, CURLUPART_HOST, &host, 0);
 4733|      4|  if(uc && uc != CURLUE_NO_HOST)
  ------------------
  |  Branch (4733:6): [True: 0, False: 4]
  |  Branch (4733:12): [True: 0, False: 0]
  ------------------
 4734|      0|    goto out;
 4735|      4|  if(!host) {
  ------------------
  |  Branch (4735:6): [True: 0, False: 4]
  ------------------
 4736|      0|    req->authority = NULL;
 4737|      0|    result = CURLE_OK;
 4738|      0|    goto out;
 4739|      0|  }
 4740|       |
 4741|      4|  uc = curl_url_get(url, CURLUPART_PORT, &port, CURLU_NO_DEFAULT_PORT);
  ------------------
  |  |   85|      4|#define CURLU_NO_DEFAULT_PORT (1 << 1)    /* act as if no port number was set,
  ------------------
 4742|      4|  if(uc && uc != CURLUE_NO_PORT)
  ------------------
  |  Branch (4742:6): [True: 3, False: 1]
  |  Branch (4742:12): [True: 0, False: 3]
  ------------------
 4743|      0|    goto out;
 4744|       |
 4745|      4|  result = curlx_dyn_add(&buf, host);
 4746|      4|  if(result)
  ------------------
  |  Branch (4746:6): [True: 0, False: 4]
  ------------------
 4747|      0|    goto out;
 4748|      4|  if(port) {
  ------------------
  |  Branch (4748:6): [True: 1, False: 3]
  ------------------
 4749|      1|    result = curlx_dyn_addf(&buf, ":%s", port);
 4750|      1|    if(result)
  ------------------
  |  Branch (4750:8): [True: 0, False: 1]
  ------------------
 4751|      0|      goto out;
 4752|      1|  }
 4753|      4|  req->authority = curlx_dyn_ptr(&buf);
 4754|      4|out:
 4755|      4|  curlx_free(host);
  ------------------
  |  | 1483|      4|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 4756|      4|  curlx_free(port);
  ------------------
  |  | 1483|      4|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 4757|      4|  if(result)
  ------------------
  |  Branch (4757:6): [True: 0, False: 4]
  ------------------
 4758|      0|    curlx_dyn_free(&buf);
 4759|      4|  return result;
 4760|      4|}
http.c:req_assign_url_path:
 4763|      4|{
 4764|      4|  char *path, *query;
 4765|      4|  struct dynbuf buf;
 4766|      4|  CURLUcode uc;
 4767|      4|  CURLcode result = CURLE_URL_MALFORMAT;
 4768|       |
 4769|      4|  path = query = NULL;
 4770|      4|  curlx_dyn_init(&buf, DYN_HTTP_REQUEST);
  ------------------
  |  |   69|      4|#define DYN_HTTP_REQUEST    (1024 * 1024)
  ------------------
 4771|       |
 4772|      4|  uc = curl_url_get(url, CURLUPART_PATH, &path, 0);
 4773|      4|  if(uc)
  ------------------
  |  Branch (4773:6): [True: 0, False: 4]
  ------------------
 4774|      0|    goto out;
 4775|      4|  uc = curl_url_get(url, CURLUPART_QUERY, &query, 0);
 4776|      4|  if(uc && uc != CURLUE_NO_QUERY)
  ------------------
  |  Branch (4776:6): [True: 2, False: 2]
  |  Branch (4776:12): [True: 0, False: 2]
  ------------------
 4777|      0|    goto out;
 4778|       |
 4779|      4|  if(!query) {
  ------------------
  |  Branch (4779:6): [True: 2, False: 2]
  ------------------
 4780|      2|    req->path = path;
 4781|      2|    path = NULL;
 4782|      2|  }
 4783|      2|  else {
 4784|      2|    result = curlx_dyn_add(&buf, path);
 4785|      2|    if(!result)
  ------------------
  |  Branch (4785:8): [True: 2, False: 0]
  ------------------
 4786|      2|      result = curlx_dyn_addf(&buf, "?%s", query);
 4787|      2|    if(result)
  ------------------
  |  Branch (4787:8): [True: 0, False: 2]
  ------------------
 4788|      0|      goto out;
 4789|      2|    req->path = curlx_dyn_ptr(&buf);
 4790|      2|  }
 4791|      4|  result = CURLE_OK;
 4792|       |
 4793|      4|out:
 4794|      4|  curlx_free(path);
  ------------------
  |  | 1483|      4|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 4795|      4|  curlx_free(query);
  ------------------
  |  | 1483|      4|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 4796|      4|  if(result)
  ------------------
  |  Branch (4796:6): [True: 0, False: 4]
  ------------------
 4797|      0|    curlx_dyn_free(&buf);
 4798|      4|  return result;
 4799|      4|}
http.c:http_TE_has_token:
 4881|    521|{
 4882|  1.44k|  while(*fvalue) {
  ------------------
  |  Branch (4882:9): [True: 1.11k, False: 334]
  ------------------
 4883|  1.11k|    struct Curl_str name;
 4884|       |
 4885|       |    /* skip to first token */
 4886|  3.28k|    while(ISBLANK(*fvalue) || *fvalue == ',')
  ------------------
  |  |   45|  6.56k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.22k, False: 2.05k]
  |  |  |  Branch (45:38): [True: 324, False: 1.73k]
  |  |  ------------------
  ------------------
  |  Branch (4886:31): [True: 616, False: 1.11k]
  ------------------
 4887|  2.16k|      fvalue++;
 4888|  1.11k|    if(curlx_str_cspn(&fvalue, &name, " \t\r;,"))
  ------------------
  |  Branch (4888:8): [True: 108, False: 1.00k]
  ------------------
 4889|    108|      return FALSE;
  ------------------
  |  | 1058|    108|#define FALSE false
  ------------------
 4890|  1.00k|    if(curlx_str_casecompare(&name, token))
  ------------------
  |  Branch (4890:8): [True: 0, False: 1.00k]
  ------------------
 4891|      0|      return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 4892|       |
 4893|       |    /* skip any remainder after token, e.g. parameters with quoted strings */
 4894|  4.91k|    while(*fvalue && *fvalue != ',') {
  ------------------
  |  Branch (4894:11): [True: 4.59k, False: 315]
  |  Branch (4894:22): [True: 3.98k, False: 613]
  ------------------
 4895|  3.98k|      if(*fvalue == '"') {
  ------------------
  |  Branch (4895:10): [True: 459, False: 3.52k]
  ------------------
 4896|    459|        struct Curl_str qw;
 4897|       |        /* if we do not cleanly find a quoted word here, the header value
 4898|       |         * does not follow HTTP syntax and we reject */
 4899|    459|        if(curlx_str_quotedword(&fvalue, &qw, CURL_MAX_HTTP_HEADER))
  ------------------
  |  |  272|    459|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
  |  Branch (4899:12): [True: 79, False: 380]
  ------------------
 4900|     79|          return FALSE;
  ------------------
  |  | 1058|     79|#define FALSE false
  ------------------
 4901|    459|      }
 4902|  3.52k|      else
 4903|  3.52k|        fvalue++;
 4904|  3.98k|    }
 4905|  1.00k|  }
 4906|    334|  return FALSE;
  ------------------
  |  | 1058|    334|#define FALSE false
  ------------------
 4907|    521|}
http.c:h2_permissible_field:
 4870|   132k|{
 4871|   132k|  size_t i;
 4872|   898k|  for(i = 0; i < CURL_ARRAYSIZE(H2_NON_FIELD); ++i) {
  ------------------
  |  | 1294|   898k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (4872:14): [True: 770k, False: 127k]
  ------------------
 4873|   770k|    if(e->namelen == H2_NON_FIELD[i].namelen &&
  ------------------
  |  Branch (4873:8): [True: 37.0k, False: 733k]
  ------------------
 4874|  37.0k|       curl_strnequal(H2_NON_FIELD[i].name, e->name, e->namelen))
  ------------------
  |  Branch (4874:8): [True: 5.09k, False: 31.9k]
  ------------------
 4875|  5.09k|      return FALSE;
  ------------------
  |  | 1058|  5.09k|#define FALSE false
  ------------------
 4876|   770k|  }
 4877|   127k|  return TRUE;
  ------------------
  |  | 1055|   127k|#define TRUE true
  ------------------
 4878|   132k|}

Curl_h1_req_parse_init:
   37|  4.43k|{
   38|  4.43k|  memset(parser, 0, sizeof(*parser));
   39|  4.43k|  parser->max_line_len = max_line_len;
   40|  4.43k|  curlx_dyn_init(&parser->scratch, max_line_len);
   41|  4.43k|}
Curl_h1_req_parse_free:
   44|  8.83k|{
   45|  8.83k|  if(parser) {
  ------------------
  |  Branch (45:6): [True: 8.83k, False: 0]
  ------------------
   46|  8.83k|    Curl_http_req_free(parser->req);
   47|  8.83k|    curlx_dyn_free(&parser->scratch);
   48|  8.83k|    parser->req = NULL;
   49|       |    parser->done = FALSE;
  ------------------
  |  | 1058|  8.83k|#define FALSE false
  ------------------
   50|  8.83k|  }
   51|  8.83k|}
Curl_h1_req_parse_read:
  267|  4.43k|{
  268|  4.43k|  CURLcode result = CURLE_OK;
  269|  4.43k|  size_t nread;
  270|       |
  271|  4.43k|  *pnread = 0;
  272|       |
  273|  4.43k|  DEBUGASSERT(buf);
  ------------------
  |  | 1081|  4.43k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (273:3): [True: 0, False: 4.43k]
  |  Branch (273:3): [True: 4.43k, False: 0]
  ------------------
  274|  4.43k|  if(!buf)
  ------------------
  |  Branch (274:6): [True: 0, False: 4.43k]
  ------------------
  275|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  276|       |
  277|   146k|  while(!parser->done) {
  ------------------
  |  Branch (277:9): [True: 141k, False: 4.40k]
  ------------------
  278|   141k|    result = next_line(parser, buf, buflen, options, &nread);
  279|   141k|    if(result) {
  ------------------
  |  Branch (279:8): [True: 0, False: 141k]
  ------------------
  280|      0|      if(result == CURLE_AGAIN)
  ------------------
  |  Branch (280:10): [True: 0, False: 0]
  ------------------
  281|      0|        result = CURLE_OK;
  282|      0|      goto out;
  283|      0|    }
  284|       |
  285|       |    /* Consume this line */
  286|   141k|    *pnread += nread;
  287|   141k|    buf += nread;
  288|   141k|    buflen -= nread;
  289|       |
  290|   141k|    if(!parser->line) {
  ------------------
  |  Branch (290:8): [True: 0, False: 141k]
  ------------------
  291|       |      /* consumed bytes, but line not complete */
  292|      0|      if(!buflen)
  ------------------
  |  Branch (292:10): [True: 0, False: 0]
  ------------------
  293|      0|        goto out;
  294|      0|    }
  295|   141k|    else if(!parser->req) {
  ------------------
  |  Branch (295:13): [True: 4.43k, False: 137k]
  ------------------
  296|  4.43k|      result = start_req(parser, scheme_default, custom_method, options);
  297|  4.43k|      if(result)
  ------------------
  |  Branch (297:10): [True: 9, False: 4.42k]
  ------------------
  298|      9|        goto out;
  299|  4.43k|    }
  300|   137k|    else if(parser->line_len == 0) {
  ------------------
  |  Branch (300:13): [True: 4.40k, False: 133k]
  ------------------
  301|       |      /* last, empty line, we are finished */
  302|  4.40k|      if(!parser->req) {
  ------------------
  |  Branch (302:10): [True: 0, False: 4.40k]
  ------------------
  303|      0|        result = CURLE_URL_MALFORMAT;
  304|      0|        goto out;
  305|      0|      }
  306|  4.40k|      parser->done = TRUE;
  ------------------
  |  | 1055|  4.40k|#define TRUE true
  ------------------
  307|  4.40k|      curlx_dyn_reset(&parser->scratch);
  308|       |      /* last chance adjustments */
  309|  4.40k|    }
  310|   133k|    else {
  311|   133k|      result = Curl_dynhds_h1_add_line(&parser->req->headers,
  312|   133k|                                       parser->line, parser->line_len);
  313|   133k|      if(result)
  ------------------
  |  Branch (313:10): [True: 19, False: 133k]
  ------------------
  314|     19|        goto out;
  315|   133k|    }
  316|   141k|  }
  317|       |
  318|  4.43k|out:
  319|  4.43k|  return result;
  320|  4.43k|}
Curl_h1_req_write_head:
  324|  7.97k|{
  325|  7.97k|  CURLcode result;
  326|       |
  327|  7.97k|  result = curlx_dyn_addf(dbuf, "%s %s%s%s%s HTTP/1.%d\r\n",
  328|  7.97k|                          req->method,
  329|  7.97k|                          req->scheme ? req->scheme : "",
  ------------------
  |  Branch (329:27): [True: 0, False: 7.97k]
  ------------------
  330|  7.97k|                          req->scheme ? "://" : "",
  ------------------
  |  Branch (330:27): [True: 0, False: 7.97k]
  ------------------
  331|  7.97k|                          req->authority ? req->authority : "",
  ------------------
  |  Branch (331:27): [True: 7.97k, False: 0]
  ------------------
  332|  7.97k|                          req->path ? req->path : "",
  ------------------
  |  Branch (332:27): [True: 0, False: 7.97k]
  ------------------
  333|  7.97k|                          http_minor);
  334|  7.97k|  if(result)
  ------------------
  |  Branch (334:6): [True: 0, False: 7.97k]
  ------------------
  335|      0|    goto out;
  336|       |
  337|  7.97k|  result = Curl_dynhds_h1_dprint(&req->headers, dbuf);
  338|  7.97k|  if(result)
  ------------------
  |  Branch (338:6): [True: 0, False: 7.97k]
  ------------------
  339|      0|    goto out;
  340|       |
  341|  7.97k|  result = curlx_dyn_addn(dbuf, STRCONST("\r\n"));
  ------------------
  |  | 1292|  7.97k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  342|       |
  343|  7.97k|out:
  344|  7.97k|  return result;
  345|  7.97k|}
http1.c:next_line:
   97|   141k|{
   98|   141k|  CURLcode result;
   99|       |
  100|   141k|  *pnread = 0;
  101|   141k|  if(parser->line) {
  ------------------
  |  Branch (101:6): [True: 137k, False: 4.43k]
  ------------------
  102|   137k|    parser->line = NULL;
  103|   137k|    parser->line_len = 0;
  104|   137k|    curlx_dyn_reset(&parser->scratch);
  105|   137k|  }
  106|       |
  107|   141k|  result = detect_line(parser, buf, buflen, pnread);
  108|   141k|  if(!result) {
  ------------------
  |  Branch (108:6): [True: 141k, False: 0]
  ------------------
  109|   141k|    if(curlx_dyn_len(&parser->scratch)) {
  ------------------
  |  Branch (109:8): [True: 0, False: 141k]
  ------------------
  110|       |      /* append detected line to scratch to have the complete line */
  111|      0|      result = curlx_dyn_addn(&parser->scratch, parser->line,
  112|      0|                              parser->line_len);
  113|      0|      if(result)
  ------------------
  |  Branch (113:10): [True: 0, False: 0]
  ------------------
  114|      0|        return result;
  115|      0|      parser->line = curlx_dyn_ptr(&parser->scratch);
  116|      0|      parser->line_len = curlx_dyn_len(&parser->scratch);
  117|      0|    }
  118|   141k|    result = trim_line(parser, options);
  119|   141k|    if(result)
  ------------------
  |  Branch (119:8): [True: 0, False: 141k]
  ------------------
  120|      0|      return result;
  121|   141k|  }
  122|      0|  else if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (122:11): [True: 0, False: 0]
  ------------------
  123|       |    /* no line end in `buf`, add it to our scratch */
  124|      0|    result = curlx_dyn_addn(&parser->scratch, (const unsigned char *)buf,
  125|      0|                            buflen);
  126|      0|    *pnread = buflen;
  127|      0|  }
  128|   141k|  return result;
  129|   141k|}
http1.c:detect_line:
   80|   141k|{
   81|   141k|  const char *line_end;
   82|       |
   83|   141k|  DEBUGASSERT(!parser->line);
  ------------------
  |  | 1081|   141k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (83:3): [True: 0, False: 141k]
  |  Branch (83:3): [True: 141k, False: 0]
  ------------------
   84|   141k|  *pnread = 0;
   85|   141k|  line_end = memchr(buf, '\n', buflen);
   86|   141k|  if(!line_end)
  ------------------
  |  Branch (86:6): [True: 0, False: 141k]
  ------------------
   87|      0|    return CURLE_AGAIN;
   88|   141k|  parser->line = (const char *)buf;
   89|   141k|  parser->line_len = line_end - parser->line + 1;
   90|   141k|  *pnread = parser->line_len;
   91|   141k|  return CURLE_OK;
   92|   141k|}
http1.c:trim_line:
   54|   141k|{
   55|   141k|  DEBUGASSERT(parser->line);
  ------------------
  |  | 1081|   141k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (55:3): [True: 0, False: 141k]
  |  Branch (55:3): [True: 141k, False: 0]
  ------------------
   56|   141k|  if(parser->line_len) {
  ------------------
  |  Branch (56:6): [True: 141k, False: 0]
  ------------------
   57|   141k|    if(parser->line[parser->line_len - 1] == '\n')
  ------------------
  |  Branch (57:8): [True: 141k, False: 0]
  ------------------
   58|   141k|      --parser->line_len;
   59|   141k|    if(parser->line_len) {
  ------------------
  |  Branch (59:8): [True: 141k, False: 196]
  ------------------
   60|   141k|      if(parser->line[parser->line_len - 1] == '\r')
  ------------------
  |  Branch (60:10): [True: 23.9k, False: 117k]
  ------------------
   61|  23.9k|        --parser->line_len;
   62|   117k|      else if(options & H1_PARSE_OPT_STRICT)
  ------------------
  |  |   33|   117k|#define H1_PARSE_OPT_STRICT     (1 << 0)
  ------------------
  |  Branch (62:15): [True: 0, False: 117k]
  ------------------
   63|      0|        return CURLE_URL_MALFORMAT;
   64|   141k|    }
   65|    196|    else if(options & H1_PARSE_OPT_STRICT)
  ------------------
  |  |   33|    196|#define H1_PARSE_OPT_STRICT     (1 << 0)
  ------------------
  |  Branch (65:13): [True: 0, False: 196]
  ------------------
   66|      0|      return CURLE_URL_MALFORMAT;
   67|   141k|  }
   68|      0|  else if(options & H1_PARSE_OPT_STRICT)
  ------------------
  |  |   33|      0|#define H1_PARSE_OPT_STRICT     (1 << 0)
  ------------------
  |  Branch (68:11): [True: 0, False: 0]
  ------------------
   69|      0|    return CURLE_URL_MALFORMAT;
   70|       |
   71|   141k|  if(parser->line_len > parser->max_line_len) {
  ------------------
  |  Branch (71:6): [True: 0, False: 141k]
  ------------------
   72|      0|    return CURLE_URL_MALFORMAT;
   73|      0|  }
   74|   141k|  return CURLE_OK;
   75|   141k|}
http1.c:start_req:
  135|  4.43k|{
  136|  4.43k|  const char *p, *m, *target, *hv, *scheme, *authority, *path;
  137|  4.43k|  size_t m_len, target_len, hv_len, scheme_len, authority_len, path_len;
  138|  4.43k|  size_t i;
  139|  4.43k|  CURLU *url = NULL;
  140|  4.43k|  CURLcode result = CURLE_URL_MALFORMAT; /* Use this as default fail */
  141|       |
  142|  4.43k|  DEBUGASSERT(!parser->req);
  ------------------
  |  | 1081|  4.43k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (142:3): [True: 0, False: 4.43k]
  |  Branch (142:3): [True: 4.43k, False: 0]
  ------------------
  143|       |  /* line must match: "METHOD TARGET HTTP_VERSION" */
  144|  4.43k|  if(custom_method && custom_method[0] &&
  ------------------
  |  Branch (144:6): [True: 90, False: 4.34k]
  |  Branch (144:23): [True: 85, False: 5]
  ------------------
  145|     85|     !strncmp(custom_method, parser->line, strlen(custom_method))) {
  ------------------
  |  Branch (145:6): [True: 85, False: 0]
  ------------------
  146|     85|    p = parser->line + strlen(custom_method);
  147|     85|  }
  148|  4.34k|  else {
  149|  4.34k|    p = memchr(parser->line, ' ', parser->line_len);
  150|  4.34k|    if(!p || p == parser->line)
  ------------------
  |  Branch (150:8): [True: 0, False: 4.34k]
  |  Branch (150:14): [True: 5, False: 4.34k]
  ------------------
  151|      5|      goto out;
  152|  4.34k|  }
  153|       |
  154|  4.42k|  m = parser->line;
  155|  4.42k|  m_len = p - parser->line;
  156|  4.42k|  target = p + 1;
  157|  4.42k|  target_len = hv_len = 0;
  158|  4.42k|  hv = NULL;
  159|       |
  160|       |  /* URL may contain spaces so scan backwards */
  161|  36.0k|  for(i = parser->line_len; i > m_len; --i) {
  ------------------
  |  Branch (161:29): [True: 36.0k, False: 3]
  ------------------
  162|  36.0k|    if(parser->line[i] == ' ') {
  ------------------
  |  Branch (162:8): [True: 4.42k, False: 31.6k]
  ------------------
  163|  4.42k|      hv = &parser->line[i + 1];
  164|  4.42k|      hv_len = parser->line_len - i;
  165|  4.42k|      target_len = (hv - target) - 1;
  166|  4.42k|      break;
  167|  4.42k|    }
  168|  36.0k|  }
  169|       |  /* no SPACE found or empty TARGET or empty HTTP_VERSION */
  170|  4.42k|  if(!target_len || !hv_len)
  ------------------
  |  Branch (170:6): [True: 3, False: 4.42k]
  |  Branch (170:21): [True: 0, False: 4.42k]
  ------------------
  171|      3|    goto out;
  172|       |
  173|  4.42k|  (void)hv;
  174|       |
  175|       |  /* The TARGET can be (rfc 9112, ch. 3.2):
  176|       |   * origin-form:     path + optional query
  177|       |   * absolute-form:   absolute URI
  178|       |   * authority-form:  host+port for CONNECT
  179|       |   * asterisk-form:   '*' for OPTIONS
  180|       |   *
  181|       |   * from TARGET, we derive `scheme` `authority` `path`
  182|       |   * origin-form            --        --          TARGET
  183|       |   * absolute-form          URL*      URL*        URL*
  184|       |   * authority-form         --        TARGET      --
  185|       |   * asterisk-form          --        --          TARGET
  186|       |   */
  187|  4.42k|  scheme = authority = path = NULL;
  188|  4.42k|  scheme_len = authority_len = path_len = 0;
  189|       |
  190|  4.42k|  if(target_len == 1 && target[0] == '*') {
  ------------------
  |  Branch (190:6): [True: 1.68k, False: 2.73k]
  |  Branch (190:25): [True: 0, False: 1.68k]
  ------------------
  191|       |    /* asterisk-form */
  192|      0|    path = target;
  193|      0|    path_len = target_len;
  194|      0|  }
  195|  4.42k|  else if(!strncmp("CONNECT", m, m_len)) {
  ------------------
  |  Branch (195:11): [True: 12, False: 4.41k]
  ------------------
  196|       |    /* authority-form */
  197|     12|    authority = target;
  198|     12|    authority_len = target_len;
  199|     12|  }
  200|  4.41k|  else if(target[0] == '/') {
  ------------------
  |  Branch (200:11): [True: 4.38k, False: 32]
  ------------------
  201|       |    /* origin-form */
  202|  4.38k|    path = target;
  203|  4.38k|    path_len = target_len;
  204|  4.38k|  }
  205|     32|  else {
  206|       |    /* origin-form OR absolute-form */
  207|     32|    CURLUcode uc;
  208|     32|    char tmp[H1_MAX_URL_LEN];
  209|       |
  210|       |    /* default, unless we see an absolute URL */
  211|     32|    path = target;
  212|     32|    path_len = target_len;
  213|       |
  214|       |    /* URL parser wants null-termination */
  215|     32|    if(target_len >= sizeof(tmp))
  ------------------
  |  Branch (215:8): [True: 0, False: 32]
  ------------------
  216|      0|      goto out;
  217|     32|    memcpy(tmp, target, target_len);
  218|     32|    tmp[target_len] = '\0';
  219|       |    /* See if treating TARGET as an absolute URL makes sense */
  220|     32|    if(Curl_is_absolute_url(tmp, NULL, 0, FALSE)) {
  ------------------
  |  | 1058|     32|#define FALSE false
  ------------------
  |  Branch (220:8): [True: 5, False: 27]
  ------------------
  221|      5|      unsigned int url_options;
  222|       |
  223|      5|      url = curl_url();
  224|      5|      if(!url) {
  ------------------
  |  Branch (224:10): [True: 0, False: 5]
  ------------------
  225|      0|        result = CURLE_OUT_OF_MEMORY;
  226|      0|        goto out;
  227|      0|      }
  228|      5|      url_options = (CURLU_NON_SUPPORT_SCHEME |
  ------------------
  |  |   90|      5|#define CURLU_NON_SUPPORT_SCHEME (1 << 3) /* allow non-supported scheme */
  ------------------
  229|      5|                     CURLU_PATH_AS_IS |
  ------------------
  |  |   91|      5|#define CURLU_PATH_AS_IS (1 << 4)         /* leave dot sequences */
  ------------------
  230|      5|                     CURLU_NO_DEFAULT_PORT);
  ------------------
  |  |   85|      5|#define CURLU_NO_DEFAULT_PORT (1 << 1)    /* act as if no port number was set,
  ------------------
  231|      5|      if(!(options & H1_PARSE_OPT_STRICT))
  ------------------
  |  |   33|      5|#define H1_PARSE_OPT_STRICT     (1 << 0)
  ------------------
  |  Branch (231:10): [True: 5, False: 0]
  ------------------
  232|      5|        url_options |= CURLU_ALLOW_SPACE;
  ------------------
  |  |   99|      5|#define CURLU_ALLOW_SPACE (1 << 11)       /* Allow spaces in the URL */
  ------------------
  233|      5|      uc = curl_url_set(url, CURLUPART_URL, tmp, url_options);
  234|      5|      if(uc) {
  ------------------
  |  Branch (234:10): [True: 1, False: 4]
  ------------------
  235|      1|        goto out;
  236|      1|      }
  237|      5|    }
  238|       |
  239|     31|    if(!url && (options & H1_PARSE_OPT_STRICT)) {
  ------------------
  |  |   33|     27|#define H1_PARSE_OPT_STRICT     (1 << 0)
  ------------------
  |  Branch (239:8): [True: 27, False: 4]
  |  Branch (239:16): [True: 0, False: 27]
  ------------------
  240|       |      /* we should have an absolute URL or have seen `/` earlier */
  241|      0|      goto out;
  242|      0|    }
  243|     31|  }
  244|       |
  245|  4.42k|  if(url) {
  ------------------
  |  Branch (245:6): [True: 4, False: 4.42k]
  ------------------
  246|      4|    result = Curl_http_req_make2(&parser->req, m, m_len, url, scheme_default);
  247|      4|  }
  248|  4.42k|  else {
  249|  4.42k|    if(!scheme && scheme_default) {
  ------------------
  |  Branch (249:8): [True: 4.42k, False: 0]
  |  Branch (249:19): [True: 0, False: 4.42k]
  ------------------
  250|      0|      scheme = scheme_default;
  251|      0|      scheme_len = strlen(scheme_default);
  252|      0|    }
  253|  4.42k|    result = Curl_http_req_make(&parser->req, m, m_len, scheme, scheme_len,
  254|  4.42k|                                authority, authority_len, path, path_len);
  255|  4.42k|  }
  256|       |
  257|  4.43k|out:
  258|  4.43k|  curl_url_cleanup(url);
  259|  4.43k|  return result;
  260|  4.42k|}

Curl_nghttp2_fr_print:
 1062|    613|{
 1063|    613|  switch(frame->hd.type) {
 1064|     10|  case NGHTTP2_DATA: {
  ------------------
  |  Branch (1064:3): [True: 10, False: 603]
  ------------------
 1065|     10|    return curl_msnprintf(buffer, blen,
 1066|     10|                          "FRAME[DATA, len=%d, eos=%d, padlen=%d]",
 1067|     10|                          (int)frame->hd.length,
 1068|     10|                          !!(frame->hd.flags & NGHTTP2_FLAG_END_STREAM),
 1069|     10|                          (int)frame->data.padlen);
 1070|      0|  }
 1071|    576|  case NGHTTP2_HEADERS: {
  ------------------
  |  Branch (1071:3): [True: 576, False: 37]
  ------------------
 1072|    576|    return curl_msnprintf(buffer, blen,
 1073|    576|                          "FRAME[HEADERS, len=%d, hend=%d, eos=%d]",
 1074|    576|                          (int)frame->hd.length,
 1075|    576|                          !!(frame->hd.flags & NGHTTP2_FLAG_END_HEADERS),
 1076|    576|                          !!(frame->hd.flags & NGHTTP2_FLAG_END_STREAM));
 1077|      0|  }
 1078|      0|  case NGHTTP2_PRIORITY: {
  ------------------
  |  Branch (1078:3): [True: 0, False: 613]
  ------------------
 1079|      0|    return curl_msnprintf(buffer, blen,
 1080|      0|                          "FRAME[PRIORITY, len=%d, flags=%d]",
 1081|      0|                          (int)frame->hd.length, frame->hd.flags);
 1082|      0|  }
 1083|      0|  case NGHTTP2_RST_STREAM: {
  ------------------
  |  Branch (1083:3): [True: 0, False: 613]
  ------------------
 1084|      0|    return curl_msnprintf(buffer, blen,
 1085|      0|                          "FRAME[RST_STREAM, len=%d, flags=%d, error=%u]",
 1086|      0|                          (int)frame->hd.length, frame->hd.flags,
 1087|      0|                          frame->rst_stream.error_code);
 1088|      0|  }
 1089|      8|  case NGHTTP2_SETTINGS: {
  ------------------
  |  Branch (1089:3): [True: 8, False: 605]
  ------------------
 1090|      8|    if(frame->hd.flags & NGHTTP2_FLAG_ACK) {
  ------------------
  |  Branch (1090:8): [True: 1, False: 7]
  ------------------
 1091|      1|      return curl_msnprintf(buffer, blen, "FRAME[SETTINGS, ack=1]");
 1092|      1|    }
 1093|      7|    return curl_msnprintf(buffer, blen,
 1094|      7|                          "FRAME[SETTINGS, len=%d]", (int)frame->hd.length);
 1095|      8|  }
 1096|     12|  case NGHTTP2_PUSH_PROMISE:
  ------------------
  |  Branch (1096:3): [True: 12, False: 601]
  ------------------
 1097|     12|    return curl_msnprintf(buffer, blen,
 1098|     12|                          "FRAME[PUSH_PROMISE, len=%d, hend=%d]",
 1099|     12|                          (int)frame->hd.length,
 1100|     12|                          !!(frame->hd.flags & NGHTTP2_FLAG_END_HEADERS));
 1101|      1|  case NGHTTP2_PING:
  ------------------
  |  Branch (1101:3): [True: 1, False: 612]
  ------------------
 1102|      1|    return curl_msnprintf(buffer, blen,
 1103|      1|                          "FRAME[PING, len=%d, ack=%d]",
 1104|      1|                          (int)frame->hd.length,
 1105|      1|                          frame->hd.flags & NGHTTP2_FLAG_ACK);
 1106|      4|  case NGHTTP2_GOAWAY: {
  ------------------
  |  Branch (1106:3): [True: 4, False: 609]
  ------------------
 1107|      4|    char scratch[128];
 1108|      4|    size_t s_len = CURL_ARRAYSIZE(scratch);
  ------------------
  |  | 1294|      4|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
 1109|      4|    size_t len = (frame->goaway.opaque_data_len < s_len) ?
  ------------------
  |  Branch (1109:18): [True: 3, False: 1]
  ------------------
 1110|      3|      frame->goaway.opaque_data_len : s_len - 1;
 1111|      4|    if(len)
  ------------------
  |  Branch (1111:8): [True: 3, False: 1]
  ------------------
 1112|      3|      memcpy(scratch, frame->goaway.opaque_data, len);
 1113|      4|    scratch[len] = '\0';
 1114|      4|    return curl_msnprintf(buffer, blen,
 1115|      4|                          "FRAME[GOAWAY, error=%u, reason='%s', "
 1116|      4|                          "last_stream=%d]", frame->goaway.error_code,
 1117|      4|                          scratch, frame->goaway.last_stream_id);
 1118|      8|  }
 1119|      2|  case NGHTTP2_WINDOW_UPDATE: {
  ------------------
  |  Branch (1119:3): [True: 2, False: 611]
  ------------------
 1120|      2|    return curl_msnprintf(buffer, blen,
 1121|      2|                          "FRAME[WINDOW_UPDATE, incr=%d]",
 1122|      2|                          frame->window_update.window_size_increment);
 1123|      8|  }
 1124|      0|  default:
  ------------------
  |  Branch (1124:3): [True: 0, False: 613]
  ------------------
 1125|      0|    return curl_msnprintf(buffer, blen, "FRAME[%d, len=%d, flags=%d]",
 1126|      0|                          frame->hd.type, (int)frame->hd.length,
 1127|      0|                          frame->hd.flags);
 1128|    613|  }
 1129|    613|}
Curl_http2_request_upgrade:
 1651|     29|{
 1652|     29|  CURLcode result;
 1653|     29|  char *base64;
 1654|     29|  size_t blen;
 1655|     29|  struct SingleRequest *k = &data->req;
 1656|     29|  uint8_t binsettings[H2_BINSETTINGS_LEN];
 1657|     29|  ssize_t rc;
 1658|     29|  size_t binlen; /* length of the binsettings data */
 1659|       |
 1660|     29|  rc = populate_binsettings(binsettings, data);
 1661|     29|  if(!curlx_sztouz(rc, &binlen) || !binlen) {
  ------------------
  |  Branch (1661:6): [True: 0, False: 29]
  |  Branch (1661:36): [True: 0, False: 29]
  ------------------
 1662|      0|    failf(data, "nghttp2 unexpectedly failed on pack_settings_payload");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1663|      0|    curlx_dyn_free(req);
 1664|      0|    return CURLE_FAILED_INIT;
 1665|      0|  }
 1666|       |
 1667|     29|  result = curlx_base64url_encode(binsettings, binlen, &base64, &blen);
 1668|     29|  if(result) {
  ------------------
  |  Branch (1668:6): [True: 0, False: 29]
  ------------------
 1669|      0|    curlx_dyn_free(req);
 1670|      0|    return result;
 1671|      0|  }
 1672|       |
 1673|     29|  data->state.http_hd_upgrade = TRUE;
  ------------------
  |  | 1055|     29|#define TRUE true
  ------------------
 1674|     29|  data->state.http_hd_h2_settings = TRUE;
  ------------------
  |  | 1055|     29|#define TRUE true
  ------------------
 1675|     29|  result = curlx_dyn_addf(req,
 1676|     29|                          "Upgrade: %s\r\n"
 1677|     29|                          "HTTP2-Settings: %s\r\n",
 1678|     29|                          NGHTTP2_CLEARTEXT_PROTO_VERSION_ID, base64);
 1679|     29|  curlx_free(base64);
  ------------------
  |  | 1483|     29|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1680|       |
 1681|     29|  k->upgr101 = UPGR101_H2;
 1682|     29|  data->conn->bits.upgrade_in_progress = TRUE;
  ------------------
  |  | 1055|     29|#define TRUE true
  ------------------
 1683|       |
 1684|     29|  return result;
 1685|     29|}
Curl_http2_may_switch:
 2861|  6.76k|{
 2862|  6.76k|  if(Curl_conn_http_version(data, data->conn) < 20 &&
  ------------------
  |  Branch (2862:6): [True: 6.76k, False: 0]
  ------------------
 2863|  6.76k|     (data->state.http_neg.wanted & CURL_HTTP_V2x) &&
  ------------------
  |  |   41|  6.76k|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  |  Branch (2863:6): [True: 6.75k, False: 13]
  ------------------
 2864|  6.75k|     data->state.http_neg.h2_prior_knowledge) {
  ------------------
  |  Branch (2864:6): [True: 4.44k, False: 2.30k]
  ------------------
 2865|  4.44k|#ifndef CURL_DISABLE_PROXY
 2866|  4.44k|    if(data->conn->bits.httpproxy && !data->conn->bits.tunnel_proxy) {
  ------------------
  |  Branch (2866:8): [True: 4.44k, False: 0]
  |  Branch (2866:38): [True: 1, False: 4.44k]
  ------------------
 2867|       |      /* We do not support HTTP/2 proxies yet. Also it is debatable
 2868|       |         whether or not this setting should apply to HTTP/2 proxies. */
 2869|      1|      infof(data, "Ignoring HTTP/2 prior knowledge due to proxy");
  ------------------
  |  |  143|      1|  do {                               \
  |  |  144|      1|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      1|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 1, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  320|      1|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      1|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      1|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1]
  |  |  ------------------
  ------------------
 2870|      1|      return FALSE;
  ------------------
  |  | 1058|      1|#define FALSE false
  ------------------
 2871|      1|    }
 2872|  4.44k|#endif
 2873|  4.44k|    return TRUE;
  ------------------
  |  | 1055|  4.44k|#define TRUE true
  ------------------
 2874|  4.44k|  }
 2875|  2.31k|  return FALSE;
  ------------------
  |  | 1058|  2.31k|#define FALSE false
  ------------------
 2876|  6.76k|}
Curl_http2_switch:
 2879|  4.44k|{
 2880|  4.44k|  struct Curl_cfilter *cf;
 2881|  4.44k|  CURLcode result;
 2882|       |
 2883|  4.44k|  DEBUGASSERT(Curl_conn_http_version(data, data->conn) < 20);
  ------------------
  |  | 1081|  4.44k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2883:3): [True: 0, False: 4.44k]
  |  Branch (2883:3): [True: 4.44k, False: 0]
  ------------------
 2884|       |
 2885|  4.44k|  result = http2_cfilter_add(&cf, data, data->conn, FIRSTSOCKET, FALSE);
  ------------------
  |  |  303|  4.44k|#define FIRSTSOCKET     0
  ------------------
                result = http2_cfilter_add(&cf, data, data->conn, FIRSTSOCKET, FALSE);
  ------------------
  |  | 1058|  4.44k|#define FALSE false
  ------------------
 2886|  4.44k|  if(result)
  ------------------
  |  Branch (2886:6): [True: 0, False: 4.44k]
  ------------------
 2887|      0|    return result;
 2888|  4.44k|  CURL_TRC_CF(data, cf, "switching connection to HTTP/2");
  ------------------
  |  |  153|  4.44k|  do {                                          \
  |  |  154|  4.44k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  4.44k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  8.89k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 4.44k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4.44k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  8.89k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  4.44k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  4.44k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  4.44k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 4.44k]
  |  |  ------------------
  ------------------
 2889|       |
 2890|  4.44k|  if(cf->next) {
  ------------------
  |  Branch (2890:6): [True: 4.44k, False: 0]
  ------------------
 2891|  4.44k|    bool done;
 2892|  4.44k|    return Curl_conn_cf_connect(cf, data, &done);
 2893|  4.44k|  }
 2894|      0|  return CURLE_OK;
 2895|  4.44k|}
Curl_h2_http_1_1_error:
 2973|    680|{
 2974|    680|  if(Curl_conn_http_version(data, data->conn) == 20) {
  ------------------
  |  Branch (2974:6): [True: 680, False: 0]
  ------------------
 2975|    680|    int err = Curl_conn_get_stream_error(data, data->conn, FIRSTSOCKET);
  ------------------
  |  |  303|    680|#define FIRSTSOCKET     0
  ------------------
 2976|    680|    return err == NGHTTP2_HTTP_1_1_REQUIRED;
 2977|    680|  }
 2978|      0|  return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2979|    680|}
Curl_nghttp2_malloc:
 2982|   236k|{
 2983|   236k|  (void)user_data;
 2984|   236k|  return Curl_cmalloc(size);
 2985|   236k|}
Curl_nghttp2_free:
 2988|   346k|{
 2989|   346k|  (void)user_data;
 2990|   346k|  Curl_cfree(ptr);
 2991|   346k|}
Curl_nghttp2_calloc:
 2994|  8.85k|{
 2995|  8.85k|  (void)user_data;
 2996|  8.85k|  return Curl_ccalloc(nmemb, size);
 2997|  8.85k|}
Curl_nghttp2_realloc:
 3000|  5.02k|{
 3001|  5.02k|  (void)user_data;
 3002|  5.02k|  return Curl_crealloc(ptr, size);
 3003|  5.02k|}
http2.c:populate_binsettings:
  242|     29|{
  243|     29|  nghttp2_settings_entry iv[H2_SETTINGS_IV_LEN];
  244|     29|  size_t ivlen;
  245|       |
  246|     29|  ivlen = populate_settings(iv, data, NULL);
  247|       |  /* this returns number of bytes it wrote or a negative number on error. */
  248|     29|  return nghttp2_pack_settings_payload(binsettings, H2_BINSETTINGS_LEN,
  ------------------
  |  |   90|     29|#define H2_BINSETTINGS_LEN 80
  ------------------
  249|     29|                                       iv, ivlen);
  250|     29|}
http2.c:populate_settings:
  226|  4.47k|{
  227|  4.47k|  iv[0].settings_id = NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS;
  228|  4.47k|  iv[0].value = Curl_multi_max_concurrent_streams(data->multi);
  229|       |
  230|  4.47k|  iv[1].settings_id = NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE;
  231|  4.47k|  iv[1].value = cf_h2_initial_win_size(data);
  232|  4.47k|  if(ctx)
  ------------------
  |  Branch (232:6): [True: 4.44k, False: 29]
  ------------------
  233|  4.44k|    ctx->initial_win_size = iv[1].value;
  234|  4.47k|  iv[2].settings_id = NGHTTP2_SETTINGS_ENABLE_PUSH;
  235|  4.47k|  iv[2].value = data->multi->push_cb != NULL;
  236|       |
  237|  4.47k|  return 3;
  238|  4.47k|}
http2.c:cf_h2_initial_win_size:
  211|  8.88k|{
  212|  8.88k|#if NGHTTP2_HAS_SET_LOCAL_WINDOW_SIZE
  213|       |  /* If the transfer has a rate-limit lower than the default initial
  214|       |   * stream window size, use that. It needs to be at least 8k or servers
  215|       |   * may be unhappy. */
  216|  8.88k|  curl_off_t rps = Curl_rlimit_per_step(&data->progress.dl.rlimit);
  217|  8.88k|  if((rps > 0) && (rps < H2_STREAM_WINDOW_SIZE_INITIAL))
  ------------------
  |  |   73|    597|#define H2_STREAM_WINDOW_SIZE_INITIAL  (64 * 1024)
  ------------------
  |  Branch (217:6): [True: 597, False: 8.28k]
  |  Branch (217:19): [True: 225, False: 372]
  ------------------
  218|    225|    return CURLMAX((uint32_t)rps, 8192);
  ------------------
  |  | 1286|    225|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1286:24): [True: 76, False: 149]
  |  |  ------------------
  ------------------
  219|  8.65k|#endif
  220|  8.65k|  return H2_STREAM_WINDOW_SIZE_INITIAL;
  ------------------
  |  |   73|  8.65k|#define H2_STREAM_WINDOW_SIZE_INITIAL  (64 * 1024)
  ------------------
  221|  8.88k|}
http2.c:cf_h2_destroy:
 2570|  4.44k|{
 2571|  4.44k|  struct cf_h2_ctx *ctx = cf->ctx;
 2572|       |
 2573|  4.44k|  (void)data;
 2574|  4.44k|  if(ctx) {
  ------------------
  |  Branch (2574:6): [True: 4.44k, False: 0]
  ------------------
 2575|  4.44k|    cf_h2_ctx_free(ctx);
 2576|       |    cf->ctx = NULL;
 2577|  4.44k|  }
 2578|  4.44k|}
http2.c:cf_h2_ctx_free:
  190|  4.44k|{
  191|  4.44k|  if(ctx && ctx->initialized) {
  ------------------
  |  Branch (191:6): [True: 4.44k, False: 0]
  |  Branch (191:13): [True: 4.44k, False: 0]
  ------------------
  192|  4.44k|    Curl_bufq_free(&ctx->inbufq);
  193|  4.44k|    Curl_bufq_free(&ctx->outbufq);
  194|  4.44k|    Curl_bufcp_free(&ctx->stream_bufcp);
  195|  4.44k|    curlx_dyn_free(&ctx->scratch);
  196|  4.44k|    Curl_uint32_hash_destroy(&ctx->streams);
  197|  4.44k|    memset(ctx, 0, sizeof(*ctx));
  198|  4.44k|  }
  199|  4.44k|  curlx_free(ctx);
  ------------------
  |  | 1483|  4.44k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  200|  4.44k|}
http2.c:cf_h2_connect:
 2502|  4.44k|{
 2503|  4.44k|  struct cf_h2_ctx *ctx = cf->ctx;
 2504|  4.44k|  CURLcode result = CURLE_OK;
 2505|  4.44k|  struct cf_call_data save;
 2506|  4.44k|  bool first_time = FALSE;
  ------------------
  |  | 1058|  4.44k|#define FALSE false
  ------------------
 2507|       |
 2508|  4.44k|  if(cf->connected) {
  ------------------
  |  Branch (2508:6): [True: 0, False: 4.44k]
  ------------------
 2509|      0|    *done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2510|      0|    return CURLE_OK;
 2511|      0|  }
 2512|       |
 2513|       |  /* Connect the lower filters first */
 2514|  4.44k|  if(!cf->next->connected) {
  ------------------
  |  Branch (2514:6): [True: 0, False: 4.44k]
  ------------------
 2515|      0|    result = Curl_conn_cf_connect(cf->next, data, done);
 2516|      0|    if(result || !*done)
  ------------------
  |  Branch (2516:8): [True: 0, False: 0]
  |  Branch (2516:18): [True: 0, False: 0]
  ------------------
 2517|      0|      return result;
 2518|      0|  }
 2519|       |
 2520|  4.44k|  *done = FALSE;
  ------------------
  |  | 1058|  4.44k|#define FALSE false
  ------------------
 2521|       |
 2522|  4.44k|  CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  670|  4.44k|  do { \
  |  |  671|  4.44k|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  120|  4.44k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  672|  4.44k|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  4.44k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  673|  4.44k|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  120|  4.44k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  674|  4.44k|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  120|  4.44k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  866|  4.44k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  675|  4.44k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (675:11): [Folded, False: 4.44k]
  |  |  ------------------
  ------------------
  |  Branch (2522:3): [True: 4.44k, False: 0]
  |  Branch (2522:3): [True: 0, False: 0]
  |  Branch (2522:3): [True: 4.44k, False: 0]
  |  Branch (2522:3): [True: 0, False: 0]
  ------------------
 2523|  4.44k|  DEBUGASSERT(ctx->initialized);
  ------------------
  |  | 1081|  4.44k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2523:3): [True: 0, False: 4.44k]
  |  Branch (2523:3): [True: 4.44k, False: 0]
  ------------------
 2524|  4.44k|  if(!ctx->h2) {
  ------------------
  |  Branch (2524:6): [True: 4.44k, False: 0]
  ------------------
 2525|  4.44k|    result = cf_h2_ctx_open(cf, data);
 2526|  4.44k|    if(result)
  ------------------
  |  Branch (2526:8): [True: 0, False: 4.44k]
  ------------------
 2527|      0|      goto out;
 2528|  4.44k|    first_time = TRUE;
  ------------------
  |  | 1055|  4.44k|#define TRUE true
  ------------------
 2529|  4.44k|  }
 2530|       |
 2531|  4.44k|  if(!first_time) {
  ------------------
  |  Branch (2531:6): [True: 0, False: 4.44k]
  ------------------
 2532|      0|    result = h2_progress_ingress(cf, data, 0);
 2533|      0|    if(result)
  ------------------
  |  Branch (2533:8): [True: 0, False: 0]
  ------------------
 2534|      0|      goto out;
 2535|      0|  }
 2536|       |
 2537|       |  /* Send out our SETTINGS and ACKs and such. If that blocks, we
 2538|       |   * have it buffered and can count this filter as being connected */
 2539|  4.44k|  result = h2_progress_egress(cf, data);
 2540|  4.44k|  if(result && (result != CURLE_AGAIN))
  ------------------
  |  Branch (2540:6): [True: 0, False: 4.44k]
  |  Branch (2540:16): [True: 0, False: 0]
  ------------------
 2541|      0|    goto out;
 2542|       |
 2543|  4.44k|  *done = TRUE;
  ------------------
  |  | 1055|  4.44k|#define TRUE true
  ------------------
 2544|  4.44k|  cf->connected = TRUE;
  ------------------
  |  | 1055|  4.44k|#define TRUE true
  ------------------
 2545|  4.44k|  result = CURLE_OK;
 2546|       |
 2547|  4.44k|out:
 2548|  4.44k|  CURL_TRC_CF(data, cf, "cf_connect() -> %d, %d, ", result, *done);
  ------------------
  |  |  153|  4.44k|  do {                                          \
  |  |  154|  4.44k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  4.44k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  8.89k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 4.44k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4.44k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  8.89k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  4.44k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  4.44k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  4.44k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 4.44k]
  |  |  ------------------
  ------------------
 2549|  4.44k|  CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  678|  4.44k|  do { \
  |  |  679|  4.44k|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1081|  4.44k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  680|  4.44k|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  4.44k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  681|  4.44k|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  120|  4.44k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  682|  4.44k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (682:11): [Folded, False: 4.44k]
  |  |  ------------------
  ------------------
  |  Branch (2549:3): [True: 0, False: 4.44k]
  |  Branch (2549:3): [True: 4.44k, False: 0]
  |  Branch (2549:3): [True: 4.44k, False: 0]
  |  Branch (2549:3): [True: 0, False: 0]
  |  Branch (2549:3): [True: 4.44k, False: 0]
  |  Branch (2549:3): [True: 0, False: 0]
  ------------------
 2550|  4.44k|  return result;
 2551|  4.44k|}
http2.c:cf_h2_ctx_open:
 2382|  4.44k|{
 2383|  4.44k|  struct cf_h2_ctx *ctx = cf->ctx;
 2384|  4.44k|  struct h2_stream_ctx *stream;
 2385|  4.44k|  CURLcode result = CURLE_OUT_OF_MEMORY;
 2386|  4.44k|  int rc;
 2387|  4.44k|  nghttp2_session_callbacks *cbs = NULL;
 2388|       |
 2389|  4.44k|  DEBUGASSERT(!ctx->h2);
  ------------------
  |  | 1081|  4.44k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2389:3): [True: 0, False: 4.44k]
  |  Branch (2389:3): [True: 4.44k, False: 0]
  ------------------
 2390|  4.44k|  DEBUGASSERT(ctx->initialized);
  ------------------
  |  | 1081|  4.44k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2390:3): [True: 0, False: 4.44k]
  |  Branch (2390:3): [True: 4.44k, False: 0]
  ------------------
 2391|       |
 2392|  4.44k|  rc = nghttp2_session_callbacks_new(&cbs);
 2393|  4.44k|  if(rc) {
  ------------------
  |  Branch (2393:6): [True: 0, False: 4.44k]
  ------------------
 2394|      0|    failf(data, "Could not initialize nghttp2 callbacks");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2395|      0|    goto out;
 2396|      0|  }
 2397|       |
 2398|  4.44k|  nghttp2_session_callbacks_set_send_callback(cbs, send_callback);
 2399|  4.44k|  nghttp2_session_callbacks_set_on_frame_recv_callback(cbs, on_frame_recv);
 2400|  4.44k|  nghttp2_session_callbacks_set_on_invalid_frame_recv_callback(cbs,
 2401|  4.44k|    cf_h2_on_invalid_frame_recv);
 2402|  4.44k|#ifdef CURLVERBOSE
 2403|  4.44k|  nghttp2_session_callbacks_set_on_frame_send_callback(cbs, on_frame_send);
 2404|  4.44k|#endif
 2405|  4.44k|  nghttp2_session_callbacks_set_on_data_chunk_recv_callback(
 2406|  4.44k|    cbs, on_data_chunk_recv);
 2407|  4.44k|  nghttp2_session_callbacks_set_on_stream_close_callback(cbs, on_stream_close);
 2408|  4.44k|  nghttp2_session_callbacks_set_on_begin_headers_callback(
 2409|  4.44k|    cbs, on_begin_headers);
 2410|  4.44k|  nghttp2_session_callbacks_set_on_header_callback(cbs, on_header);
 2411|  4.44k|#ifdef CURLVERBOSE
 2412|  4.44k|  nghttp2_session_callbacks_set_error_callback(cbs, error_callback);
 2413|  4.44k|#endif
 2414|       |
 2415|       |  /* The nghttp2 session is not yet setup, do it */
 2416|  4.44k|  rc = h2_client_new(cf, cbs);
 2417|  4.44k|  if(rc) {
  ------------------
  |  Branch (2417:6): [True: 0, False: 4.44k]
  ------------------
 2418|      0|    failf(data, "Could not initialize nghttp2");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2419|      0|    goto out;
 2420|      0|  }
 2421|  4.44k|  ctx->max_concurrent_streams = DEFAULT_MAX_CONCURRENT_STREAMS;
  ------------------
  |  |   32|  4.44k|#define DEFAULT_MAX_CONCURRENT_STREAMS 100
  ------------------
 2422|       |
 2423|  4.44k|  if(ctx->via_h1_upgrade) {
  ------------------
  |  Branch (2423:6): [True: 0, False: 4.44k]
  ------------------
 2424|       |    /* HTTP/1.1 Upgrade issued. H2 Settings have already been submitted
 2425|       |     * in the H1 request and we upgrade from there. This stream
 2426|       |     * is opened implicitly as #1. */
 2427|      0|    uint8_t binsettings[H2_BINSETTINGS_LEN];
 2428|      0|    ssize_t rclen;
 2429|      0|    size_t binlen; /* length of the binsettings data */
 2430|       |
 2431|      0|    rclen = populate_binsettings(binsettings, data);
 2432|       |
 2433|      0|    if(!curlx_sztouz(rclen, &binlen) || !binlen) {
  ------------------
  |  Branch (2433:8): [True: 0, False: 0]
  |  Branch (2433:41): [True: 0, False: 0]
  ------------------
 2434|      0|      failf(data, "nghttp2 unexpectedly failed on pack_settings_payload");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2435|      0|      result = CURLE_FAILED_INIT;
 2436|      0|      goto out;
 2437|      0|    }
 2438|       |
 2439|      0|    result = http2_data_setup(cf, data, &stream);
 2440|      0|    if(result)
  ------------------
  |  Branch (2440:8): [True: 0, False: 0]
  ------------------
 2441|      0|      goto out;
 2442|      0|    DEBUGASSERT(stream);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2442:5): [True: 0, False: 0]
  |  Branch (2442:5): [True: 0, False: 0]
  ------------------
 2443|      0|    stream->id = 1;
 2444|       |    /* queue SETTINGS frame (again) */
 2445|      0|    rc = nghttp2_session_upgrade2(ctx->h2, binsettings, binlen,
 2446|      0|                                  data->state.httpreq == HTTPREQ_HEAD,
 2447|      0|                                  NULL);
 2448|      0|    if(rc) {
  ------------------
  |  Branch (2448:8): [True: 0, False: 0]
  ------------------
 2449|      0|      failf(data, "nghttp2_session_upgrade2() failed: %s(%d)",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2450|      0|            nghttp2_strerror(rc), rc);
 2451|      0|      result = CURLE_HTTP2;
 2452|      0|      goto out;
 2453|      0|    }
 2454|       |
 2455|      0|    rc = nghttp2_session_set_stream_user_data(ctx->h2, stream->id,
 2456|      0|                                              data);
 2457|      0|    if(rc) {
  ------------------
  |  Branch (2457:8): [True: 0, False: 0]
  ------------------
 2458|      0|      infof(data, "http/2: failed to set user_data for stream %d",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2459|      0|            stream->id);
 2460|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2460:7): [Folded, False: 0]
  |  Branch (2460:7): [Folded, False: 0]
  ------------------
 2461|      0|    }
 2462|      0|    CURL_TRC_CF(data, cf, "created session via Upgrade");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2463|      0|  }
 2464|  4.44k|  else {
 2465|  4.44k|    nghttp2_settings_entry iv[H2_SETTINGS_IV_LEN];
 2466|  4.44k|    size_t ivlen;
 2467|       |
 2468|  4.44k|    ivlen = populate_settings(iv, data, ctx);
 2469|  4.44k|    rc = nghttp2_submit_settings(ctx->h2, NGHTTP2_FLAG_NONE,
 2470|  4.44k|                                 iv, ivlen);
 2471|  4.44k|    if(rc) {
  ------------------
  |  Branch (2471:8): [True: 0, False: 4.44k]
  ------------------
 2472|      0|      failf(data, "nghttp2_submit_settings() failed: %s(%d)",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2473|      0|            nghttp2_strerror(rc), rc);
 2474|      0|      result = CURLE_HTTP2;
 2475|      0|      goto out;
 2476|      0|    }
 2477|  4.44k|  }
 2478|       |
 2479|  4.44k|  rc = nghttp2_session_set_local_window_size(ctx->h2, NGHTTP2_FLAG_NONE, 0,
 2480|  4.44k|                                             HTTP2_HUGE_WINDOW_SIZE);
  ------------------
  |  |   87|  4.44k|#define HTTP2_HUGE_WINDOW_SIZE (100 * H2_STREAM_WINDOW_SIZE_MAX)
  |  |  ------------------
  |  |  |  |   69|  4.44k|#define H2_STREAM_WINDOW_SIZE_MAX   (10 * 1024 * 1024)
  |  |  ------------------
  ------------------
 2481|  4.44k|  if(rc) {
  ------------------
  |  Branch (2481:6): [True: 0, False: 4.44k]
  ------------------
 2482|      0|    failf(data, "nghttp2_session_set_local_window_size() failed: %s(%d)",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2483|      0|          nghttp2_strerror(rc), rc);
 2484|      0|    result = CURLE_HTTP2;
 2485|      0|    goto out;
 2486|      0|  }
 2487|       |
 2488|       |  /* all set, traffic will be send on connect */
 2489|  4.44k|  result = CURLE_OK;
 2490|  4.44k|  CURL_TRC_CF(data, cf, "[0] created h2 session%s",
  ------------------
  |  |  153|  4.44k|  do {                                          \
  |  |  154|  4.44k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  4.44k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  8.89k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 4.44k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4.44k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  8.89k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  4.44k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  4.44k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|  4.44k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 4.44k]
  |  |  ------------------
  ------------------
 2491|  4.44k|              ctx->via_h1_upgrade ? " (via h1 upgrade)" : "");
 2492|       |
 2493|  4.44k|out:
 2494|  4.44k|  if(cbs)
  ------------------
  |  Branch (2494:6): [True: 4.44k, False: 0]
  ------------------
 2495|  4.44k|    nghttp2_session_callbacks_del(cbs);
 2496|  4.44k|  return result;
 2497|  4.44k|}
http2.c:send_callback:
  617|  28.1k|{
  618|  28.1k|  struct Curl_cfilter *cf = userp;
  619|  28.1k|  struct cf_h2_ctx *ctx = cf->ctx;
  620|  28.1k|  struct Curl_easy *data = CF_DATA_CURRENT(cf);
  ------------------
  |  |  699|  28.1k|#define CF_DATA_CURRENT(cf) ((cf) ? (CF_CTX_CALL_DATA(cf).data) : NULL)
  |  |  ------------------
  |  |  |  |  120|  28.1k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  |  Branch (699:30): [True: 28.1k, False: 0]
  |  |  ------------------
  ------------------
  621|  28.1k|  size_t nwritten;
  622|  28.1k|  CURLcode result = CURLE_OK;
  623|       |
  624|  28.1k|  (void)h2;
  625|  28.1k|  (void)flags;
  626|  28.1k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  28.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (626:3): [True: 0, False: 28.1k]
  |  Branch (626:3): [True: 28.1k, False: 0]
  ------------------
  627|       |
  628|  28.1k|  if(!cf->connected)
  ------------------
  |  Branch (628:6): [True: 13.3k, False: 14.8k]
  ------------------
  629|  13.3k|    result = Curl_bufq_write(&ctx->outbufq, buf, blen, &nwritten);
  630|  14.8k|  else
  631|  14.8k|    result = Curl_cf_send_bufq(cf->next, data, &ctx->outbufq, buf, blen,
  632|  14.8k|                               &nwritten);
  633|       |
  634|  28.1k|  if(result) {
  ------------------
  |  Branch (634:6): [True: 0, False: 28.1k]
  ------------------
  635|      0|    if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (635:8): [True: 0, False: 0]
  ------------------
  636|      0|      ctx->nw_out_blocked = 1;
  637|      0|      return NGHTTP2_ERR_WOULDBLOCK;
  638|      0|    }
  639|      0|    failf(data, "Failed sending HTTP2 data");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  640|      0|    return NGHTTP2_ERR_CALLBACK_FAILURE;
  641|      0|  }
  642|       |
  643|  28.1k|  if(!nwritten) {
  ------------------
  |  Branch (643:6): [True: 0, False: 28.1k]
  ------------------
  644|      0|    ctx->nw_out_blocked = 1;
  645|      0|    return NGHTTP2_ERR_WOULDBLOCK;
  646|      0|  }
  647|  28.1k|  return (nwritten > SSIZE_MAX) ?
  ------------------
  |  Branch (647:10): [True: 0, False: 28.1k]
  ------------------
  648|  28.1k|    NGHTTP2_ERR_CALLBACK_FAILURE : (ssize_t)nwritten;
  649|  28.1k|}
http2.c:on_frame_recv:
 1160|  5.51k|{
 1161|  5.51k|  struct Curl_cfilter *cf = userp;
 1162|  5.51k|  struct cf_h2_ctx *ctx = cf->ctx;
 1163|  5.51k|  struct Curl_easy *data = CF_DATA_CURRENT(cf), *data_s;
  ------------------
  |  |  699|  5.51k|#define CF_DATA_CURRENT(cf) ((cf) ? (CF_CTX_CALL_DATA(cf).data) : NULL)
  |  |  ------------------
  |  |  |  |  120|  5.51k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  |  Branch (699:30): [True: 5.51k, False: 0]
  |  |  ------------------
  ------------------
 1164|  5.51k|  int32_t stream_id = frame->hd.stream_id;
 1165|       |
 1166|  5.51k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  5.51k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1166:3): [True: 0, False: 5.51k]
  |  Branch (1166:3): [True: 5.51k, False: 0]
  ------------------
 1167|  5.51k|#ifdef CURLVERBOSE
 1168|  5.51k|  if(Curl_trc_cf_is_verbose(cf, data)) {
  ------------------
  |  |  323|  5.51k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  ------------------
  |  |  |  |  319|  11.0k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 5.51k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 5.51k]
  |  |  |  |  ------------------
  |  |  |  |  320|  11.0k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  324|  5.51k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1169|      0|    char buffer[256];
 1170|      0|    int len;
 1171|      0|    len = Curl_nghttp2_fr_print(frame, buffer, sizeof(buffer) - 1);
 1172|      0|    buffer[len] = 0;
 1173|      0|    CURL_TRC_CF(data, cf, "[%d] <- %s", frame->hd.stream_id, buffer);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1174|      0|  }
 1175|  5.51k|#endif /* CURLVERBOSE */
 1176|       |
 1177|  5.51k|  if(!stream_id) {
  ------------------
  |  Branch (1177:6): [True: 4.64k, False: 870]
  ------------------
 1178|       |    /* stream ID zero is for connection-oriented stuff */
 1179|  4.64k|    DEBUGASSERT(data);
  ------------------
  |  | 1081|  4.64k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1179:5): [True: 0, False: 4.64k]
  |  Branch (1179:5): [True: 4.64k, False: 0]
  ------------------
 1180|  4.64k|    switch(frame->hd.type) {
 1181|  4.03k|    case NGHTTP2_SETTINGS: {
  ------------------
  |  Branch (1181:5): [True: 4.03k, False: 607]
  ------------------
 1182|  4.03k|      if(!(frame->hd.flags & NGHTTP2_FLAG_ACK)) {
  ------------------
  |  Branch (1182:10): [True: 3.98k, False: 47]
  ------------------
 1183|  3.98k|        uint32_t max_conn = ctx->max_concurrent_streams;
 1184|  3.98k|        ctx->max_concurrent_streams = nghttp2_session_get_remote_settings(
 1185|  3.98k|          session, NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS);
 1186|  3.98k|        ctx->enable_push = nghttp2_session_get_remote_settings(
 1187|  3.98k|          session, NGHTTP2_SETTINGS_ENABLE_PUSH) != 0;
 1188|  3.98k|        CURL_TRC_CF(data, cf, "[0] MAX_CONCURRENT_STREAMS: %u",
  ------------------
  |  |  153|  3.98k|  do {                                          \
  |  |  154|  3.98k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  3.98k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  7.97k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 3.98k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 3.98k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  7.97k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  3.98k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.98k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.98k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.98k]
  |  |  ------------------
  ------------------
 1189|  3.98k|                    ctx->max_concurrent_streams);
 1190|  3.98k|        CURL_TRC_CF(data, cf, "[0] ENABLE_PUSH: %s",
  ------------------
  |  |  153|  3.98k|  do {                                          \
  |  |  154|  3.98k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  3.98k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  7.97k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 3.98k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 3.98k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  7.97k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  3.98k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.98k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|  3.98k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.98k]
  |  |  ------------------
  ------------------
 1191|  3.98k|                    ctx->enable_push ? "TRUE" : "false");
 1192|  3.98k|        if(data && max_conn != ctx->max_concurrent_streams) {
  ------------------
  |  Branch (1192:12): [True: 3.98k, False: 0]
  |  Branch (1192:20): [True: 3.20k, False: 787]
  ------------------
 1193|       |          /* only signal change if the value actually changed */
 1194|  3.20k|          CURL_TRC_CF(data, cf, "[0] notify MAX_CONCURRENT_STREAMS: %u",
  ------------------
  |  |  153|  3.20k|  do {                                          \
  |  |  154|  3.20k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  3.20k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  6.40k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 3.20k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 3.20k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  6.40k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  3.20k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.20k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.20k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.20k]
  |  |  ------------------
  ------------------
 1195|  3.20k|                      ctx->max_concurrent_streams);
 1196|  3.20k|          Curl_multi_connchanged(data->multi);
 1197|  3.20k|        }
 1198|       |        /* Since the initial stream window is 64K, a request might be on HOLD,
 1199|       |         * due to exhaustion. The (initial) SETTINGS may announce a much larger
 1200|       |         * window and *assume* that we treat this like a WINDOW_UPDATE. Some
 1201|       |         * servers send an explicit WINDOW_UPDATE, but not all seem to do that.
 1202|       |         * To be safe, we UNHOLD a stream in order not to stall. */
 1203|  3.98k|        if(CURL_REQ_WANT_SEND(data))
  ------------------
  |  |   39|  3.98k|#define CURL_REQ_WANT_SEND(d)  ((d)->req.io_flags & REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|  3.98k|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  |  |  |  Branch (39:32): [True: 99, False: 3.89k]
  |  |  ------------------
  ------------------
 1204|     99|          Curl_multi_mark_dirty(data);
 1205|  3.98k|      }
 1206|  4.03k|      break;
 1207|      0|    }
 1208|    464|    case NGHTTP2_GOAWAY:
  ------------------
  |  Branch (1208:5): [True: 464, False: 4.17k]
  ------------------
 1209|    464|      ctx->rcvd_goaway = TRUE;
  ------------------
  |  | 1055|    464|#define TRUE true
  ------------------
 1210|    464|      ctx->goaway_error = frame->goaway.error_code;
 1211|    464|      ctx->remote_max_sid = frame->goaway.last_stream_id;
 1212|    464|      if(data) {
  ------------------
  |  Branch (1212:10): [True: 464, False: 0]
  ------------------
 1213|    464|        infof(data, "received GOAWAY, error=%u, last_stream=%d",
  ------------------
  |  |  143|    464|  do {                               \
  |  |  144|    464|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    464|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 464, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 464]
  |  |  |  |  ------------------
  |  |  |  |  320|    464|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    464|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    464|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 464]
  |  |  ------------------
  ------------------
 1214|    464|              ctx->goaway_error, ctx->remote_max_sid);
 1215|    464|        Curl_multi_connchanged(data->multi);
 1216|    464|      }
 1217|    464|      break;
 1218|    143|    default:
  ------------------
  |  Branch (1218:5): [True: 143, False: 4.50k]
  ------------------
 1219|    143|      break;
 1220|  4.64k|    }
 1221|  4.64k|    return 0;
 1222|  4.64k|  }
 1223|       |
 1224|    870|  data_s = nghttp2_session_get_stream_user_data(session, stream_id);
 1225|    870|  if(!data_s) {
  ------------------
  |  Branch (1225:6): [True: 75, False: 795]
  ------------------
 1226|     75|    CURL_TRC_CF(data, cf, "[%d] No Curl_easy associated", stream_id);
  ------------------
  |  |  153|     75|  do {                                          \
  |  |  154|     75|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     75|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    150|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 75, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 75]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    150|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     75|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     75|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     75|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 75]
  |  |  ------------------
  ------------------
 1227|     75|    return 0;
 1228|     75|  }
 1229|       |
 1230|    795|  return on_stream_frame(cf, data_s, frame) ? NGHTTP2_ERR_CALLBACK_FAILURE : 0;
  ------------------
  |  Branch (1230:10): [True: 0, False: 795]
  ------------------
 1231|    870|}
http2.c:on_stream_frame:
  948|    795|{
  949|    795|  struct cf_h2_ctx *ctx = cf->ctx;
  950|    795|  struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data);
  ------------------
  |  |  265|    795|  ((struct h2_stream_ctx *)(                                             \
  |  |  266|    795|    (data) ? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL))
  |  |  ------------------
  |  |  |  Branch (266:5): [True: 795, False: 0]
  |  |  ------------------
  ------------------
  951|    795|  int32_t stream_id = frame->hd.stream_id;
  952|    795|  int rv;
  953|       |
  954|    795|  if(!stream) {
  ------------------
  |  Branch (954:6): [True: 0, False: 795]
  ------------------
  955|      0|    CURL_TRC_CF(data, cf, "[%d] No stream_ctx set", stream_id);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  956|      0|    return CURLE_FAILED_INIT;
  957|      0|  }
  958|       |
  959|    795|  switch(frame->hd.type) {
  960|    299|  case NGHTTP2_DATA:
  ------------------
  |  Branch (960:3): [True: 299, False: 496]
  ------------------
  961|    299|    CURL_TRC_CF(data, cf, "[%d] DATA, window=%d/%d",
  ------------------
  |  |  153|    299|  do {                                          \
  |  |  154|    299|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    299|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    598|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 299, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 299]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    598|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    299|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    299|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    299|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 299]
  |  |  ------------------
  ------------------
  962|    299|                stream_id,
  963|    299|                nghttp2_session_get_stream_effective_recv_data_length(
  964|    299|                  ctx->h2, stream->id),
  965|    299|                nghttp2_session_get_stream_effective_local_window_size(
  966|    299|                  ctx->h2, stream->id));
  967|       |    /* If !body started on this stream, then receiving DATA is illegal. */
  968|    299|    if(!stream->bodystarted) {
  ------------------
  |  Branch (968:8): [True: 0, False: 299]
  ------------------
  969|      0|      rv = nghttp2_submit_rst_stream(ctx->h2, NGHTTP2_FLAG_NONE,
  970|      0|                                     stream_id, NGHTTP2_PROTOCOL_ERROR);
  971|       |
  972|      0|      if(nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (972:10): [True: 0, False: 0]
  ------------------
  973|      0|        return CURLE_RECV_ERROR;
  974|      0|      }
  975|      0|    }
  976|    299|    break;
  977|    299|  case NGHTTP2_HEADERS:
  ------------------
  |  Branch (977:3): [True: 240, False: 555]
  ------------------
  978|    240|    if(stream->bodystarted) {
  ------------------
  |  Branch (978:8): [True: 6, False: 234]
  ------------------
  979|       |      /* Only valid HEADERS after body started is trailer HEADERS. We
  980|       |         buffer them in on_header callback. */
  981|      6|      break;
  982|      6|    }
  983|       |
  984|       |    /* nghttp2 guarantees that :status is received, and we store it to
  985|       |       stream->status_code. Fuzzing has proven this can still be reached
  986|       |       without status code having been set. */
  987|    234|    if(stream->status_code == -1)
  ------------------
  |  Branch (987:8): [True: 0, False: 234]
  ------------------
  988|      0|      return CURLE_RECV_ERROR;
  989|       |
  990|       |    /* Only final status code signals the end of header */
  991|    234|    if(stream->status_code / 100 != 1)
  ------------------
  |  Branch (991:8): [True: 234, False: 0]
  ------------------
  992|    234|      stream->bodystarted = TRUE;
  ------------------
  |  | 1055|    234|#define TRUE true
  ------------------
  993|      0|    else
  994|      0|      stream->status_code = -1;
  995|       |
  996|    234|    h2_xfer_write_resp_hd(cf, data, stream, STRCONST("\r\n"),
  ------------------
  |  | 1292|    234|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  997|    234|                          (bool)stream->closed);
  998|       |
  999|    234|    if(stream->status_code / 100 != 1) {
  ------------------
  |  Branch (999:8): [True: 234, False: 0]
  ------------------
 1000|    234|      stream->resp_hds_complete = TRUE;
  ------------------
  |  | 1055|    234|#define TRUE true
  ------------------
 1001|    234|    }
 1002|    234|    Curl_multi_mark_dirty(data);
 1003|    234|    break;
 1004|      0|  case NGHTTP2_PUSH_PROMISE:
  ------------------
  |  Branch (1004:3): [True: 0, False: 795]
  ------------------
 1005|      0|    rv = push_promise(cf, data, &frame->push_promise);
 1006|      0|    if(rv) { /* deny! */
  ------------------
  |  Branch (1006:8): [True: 0, False: 0]
  ------------------
 1007|      0|      DEBUGASSERT((rv > CURL_PUSH_OK) && (rv <= CURL_PUSH_ERROROUT));
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1007:7): [True: 0, False: 0]
  |  Branch (1007:7): [True: 0, False: 0]
  |  Branch (1007:7): [True: 0, False: 0]
  |  Branch (1007:7): [True: 0, False: 0]
  ------------------
 1008|      0|      rv = nghttp2_submit_rst_stream(ctx->h2, NGHTTP2_FLAG_NONE,
 1009|      0|                                     frame->push_promise.promised_stream_id,
 1010|      0|                                     NGHTTP2_CANCEL);
 1011|      0|      if(nghttp2_is_fatal(rv))
  ------------------
  |  Branch (1011:10): [True: 0, False: 0]
  ------------------
 1012|      0|        return CURLE_SEND_ERROR;
 1013|      0|      else if(rv == CURL_PUSH_ERROROUT) {
  ------------------
  |  |  507|      0|#define CURL_PUSH_ERROROUT 2 /* added in 7.72.0 */
  ------------------
  |  Branch (1013:15): [True: 0, False: 0]
  ------------------
 1014|      0|        CURL_TRC_CF(data, cf, "[%d] fail in PUSH_PROMISE received",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1015|      0|                    stream_id);
 1016|      0|        return CURLE_RECV_ERROR;
 1017|      0|      }
 1018|      0|    }
 1019|      0|    break;
 1020|    169|  case NGHTTP2_RST_STREAM:
  ------------------
  |  Branch (1020:3): [True: 169, False: 626]
  ------------------
 1021|    169|    if(frame->rst_stream.error_code)
  ------------------
  |  Branch (1021:8): [True: 166, False: 3]
  ------------------
 1022|    166|      stream->reset_by_server = TRUE;
  ------------------
  |  | 1055|    166|#define TRUE true
  ------------------
 1023|    169|    Curl_multi_mark_dirty(data);
 1024|    169|    break;
 1025|     87|  case NGHTTP2_WINDOW_UPDATE:
  ------------------
  |  Branch (1025:3): [True: 87, False: 708]
  ------------------
 1026|     87|    if(CURL_REQ_WANT_SEND(data) && Curl_bufq_is_empty(&stream->sendbuf)) {
  ------------------
  |  |   39|    174|#define CURL_REQ_WANT_SEND(d)  ((d)->req.io_flags & REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|     87|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  |  |  |  Branch (39:32): [True: 0, False: 87]
  |  |  ------------------
  ------------------
  |  Branch (1026:36): [True: 0, False: 0]
  ------------------
 1027|       |      /* need more data, force processing of transfer */
 1028|      0|      Curl_multi_mark_dirty(data);
 1029|      0|    }
 1030|     87|    else if(!Curl_bufq_is_empty(&stream->sendbuf)) {
  ------------------
  |  Branch (1030:13): [True: 13, False: 74]
  ------------------
 1031|       |      /* resume the potentially suspended stream */
 1032|     13|      rv = nghttp2_session_resume_data(ctx->h2, stream->id);
 1033|     13|      if(nghttp2_is_fatal(rv))
  ------------------
  |  Branch (1033:10): [True: 0, False: 13]
  ------------------
 1034|      0|        return CURLE_SEND_ERROR;
 1035|     13|    }
 1036|     87|    break;
 1037|     87|  default:
  ------------------
  |  Branch (1037:3): [True: 0, False: 795]
  ------------------
 1038|      0|    break;
 1039|    795|  }
 1040|       |
 1041|    795|  if(frame->hd.flags & NGHTTP2_FLAG_END_STREAM) {
  ------------------
  |  Branch (1041:6): [True: 37, False: 758]
  ------------------
 1042|     37|    if(!stream->closed && !stream->body_eos &&
  ------------------
  |  Branch (1042:8): [True: 37, False: 0]
  |  Branch (1042:27): [True: 4, False: 33]
  ------------------
 1043|      4|       ((stream->status_code >= 400) || (stream->status_code < 200))) {
  ------------------
  |  Branch (1043:9): [True: 1, False: 3]
  |  Branch (1043:41): [True: 0, False: 3]
  ------------------
 1044|       |      /* The server did not give us a positive response and we are not
 1045|       |       * done uploading the request body. We need to stop doing that and
 1046|       |       * also inform the server that we aborted our side. */
 1047|      1|      CURL_TRC_CF(data, cf, "[%d] EOS frame with unfinished upload and "
  ------------------
  |  |  153|      1|  do {                                          \
  |  |  154|      1|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      1|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      2|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 1, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      2|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      1|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      1|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      1|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1]
  |  |  ------------------
  ------------------
 1048|      1|                  "HTTP status %d, abort upload by RST",
 1049|      1|                  stream_id, stream->status_code);
 1050|      1|      nghttp2_submit_rst_stream(ctx->h2, NGHTTP2_FLAG_NONE,
 1051|      1|                                stream->id, NGHTTP2_STREAM_CLOSED);
 1052|       |      stream->closed = TRUE;
  ------------------
  |  | 1055|      1|#define TRUE true
  ------------------
 1053|      1|    }
 1054|     37|    Curl_multi_mark_dirty(data);
 1055|     37|  }
 1056|    795|  return CURLE_OK;
 1057|    795|}
http2.c:h2_xfer_write_resp_hd:
  903|  34.5k|{
  904|       |  /* If we already encountered an error, skip further writes */
  905|  34.5k|  if(!stream->xfer_result) {
  ------------------
  |  Branch (905:6): [True: 32.7k, False: 1.83k]
  ------------------
  906|  32.7k|    stream->xfer_result = Curl_xfer_write_resp_hd(data, buf, blen, eos);
  907|  32.7k|    if(!stream->xfer_result && !eos)
  ------------------
  |  Branch (907:8): [True: 32.5k, False: 135]
  |  Branch (907:32): [True: 32.5k, False: 0]
  ------------------
  908|  32.5k|      stream->xfer_result = cf_h2_update_local_win(cf, data, stream);
  909|  32.7k|    if(stream->xfer_result)
  ------------------
  |  Branch (909:8): [True: 135, False: 32.5k]
  ------------------
  910|    135|      CURL_TRC_CF(data, cf, "[%d] error %d writing %zu bytes of headers",
  ------------------
  |  |  153|    135|  do {                                          \
  |  |  154|    135|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    135|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    270|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 135, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 135]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    270|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    135|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    135|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    135|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 135]
  |  |  ------------------
  ------------------
  911|  32.7k|                  stream->id, stream->xfer_result, blen);
  912|  32.7k|  }
  913|  34.5k|}
http2.c:cf_h2_update_local_win:
  312|  6.55M|{
  313|  6.55M|  struct cf_h2_ctx *ctx = cf->ctx;
  314|  6.55M|  int32_t dwsize;
  315|  6.55M|  int rv;
  316|       |
  317|  6.55M|  dwsize = (stream->write_paused || stream->xfer_result) ?
  ------------------
  |  Branch (317:13): [True: 0, False: 6.55M]
  |  Branch (317:37): [True: 0, False: 6.55M]
  ------------------
  318|  6.55M|           0 : cf_h2_get_desired_local_win(cf, data);
  319|  6.55M|  if(dwsize != stream->local_window_size) {
  ------------------
  |  Branch (319:6): [True: 4.56k, False: 6.55M]
  ------------------
  320|  4.56k|    int32_t wsize = nghttp2_session_get_stream_effective_local_window_size(
  321|  4.56k|                      ctx->h2, stream->id);
  322|  4.56k|    if(dwsize > wsize) {
  ------------------
  |  Branch (322:8): [True: 4.30k, False: 258]
  ------------------
  323|  4.30k|      rv = nghttp2_session_set_local_window_size(ctx->h2, NGHTTP2_FLAG_NONE,
  324|  4.30k|                                                 stream->id, dwsize);
  325|  4.30k|      if(rv) {
  ------------------
  |  Branch (325:10): [True: 0, False: 4.30k]
  ------------------
  326|      0|        failf(data, "[%d] nghttp2 set_local_window_size(%d) failed: "
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  327|      0|              "%s(%d)", stream->id, dwsize, nghttp2_strerror(rv), rv);
  328|      0|        return CURLE_HTTP2;
  329|      0|      }
  330|  4.30k|      rv = nghttp2_submit_window_update(ctx->h2, NGHTTP2_FLAG_NONE,
  331|  4.30k|                                        stream->id, dwsize - wsize);
  332|  4.30k|      if(rv) {
  ------------------
  |  Branch (332:10): [True: 20, False: 4.28k]
  ------------------
  333|     20|        failf(data, "[%d] nghttp2_submit_window_update() failed: "
  ------------------
  |  |   62|     20|#define failf Curl_failf
  ------------------
  334|     20|              "%s(%d)", stream->id, nghttp2_strerror(rv), rv);
  335|     20|        return CURLE_HTTP2;
  336|     20|      }
  337|  4.28k|      stream->local_window_size = dwsize;
  338|  4.28k|      CURL_TRC_CF(data, cf, "[%d] local window update by %d",
  ------------------
  |  |  153|  4.28k|  do {                                          \
  |  |  154|  4.28k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  4.28k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  8.57k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 4.28k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4.28k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  8.57k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  4.28k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  4.28k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  4.28k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 4.28k]
  |  |  ------------------
  ------------------
  339|  4.28k|                  stream->id, dwsize - wsize);
  340|  4.28k|    }
  341|    258|    else {
  342|    258|      rv = nghttp2_session_set_local_window_size(ctx->h2, NGHTTP2_FLAG_NONE,
  343|    258|                                                 stream->id, dwsize);
  344|    258|      if(rv) {
  ------------------
  |  Branch (344:10): [True: 0, False: 258]
  ------------------
  345|      0|        failf(data, "[%d] nghttp2_session_set_local_window_size() failed: "
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  346|      0|              "%s(%d)", stream->id, nghttp2_strerror(rv), rv);
  347|      0|        return CURLE_HTTP2;
  348|      0|      }
  349|    258|      stream->local_window_size = dwsize;
  350|    258|      CURL_TRC_CF(data, cf, "[%d] local window size now %d",
  ------------------
  |  |  153|    258|  do {                                          \
  |  |  154|    258|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    258|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    516|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 258, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 258]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    516|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    258|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    258|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    258|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 258]
  |  |  ------------------
  ------------------
  351|    258|                  stream->id, dwsize);
  352|    258|    }
  353|  4.56k|  }
  354|  6.55M|  return CURLE_OK;
  355|  6.55M|}
http2.c:cf_h2_get_desired_local_win:
  295|  6.55M|{
  296|  6.55M|  curl_off_t avail = Curl_rlimit_avail(&data->progress.dl.rlimit,
  297|  6.55M|                                       Curl_pgrs_now(data));
  298|       |
  299|  6.55M|  (void)cf;
  300|  6.55M|  if(avail < CURL_OFF_T_MAX) { /* limit in place */
  ------------------
  |  |  594|  6.55M|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (300:6): [True: 3.70M, False: 2.84M]
  ------------------
  301|  3.70M|    if(avail <= 0)
  ------------------
  |  Branch (301:8): [True: 121, False: 3.70M]
  ------------------
  302|    121|      return 0;
  303|  3.70M|    else if(avail < INT32_MAX)
  ------------------
  |  Branch (303:13): [True: 3.29M, False: 416k]
  ------------------
  304|  3.29M|      return (int32_t)avail;
  305|  3.70M|  }
  306|  3.26M|  return H2_STREAM_WINDOW_SIZE_MAX;
  ------------------
  |  |   69|  3.26M|#define H2_STREAM_WINDOW_SIZE_MAX   (10 * 1024 * 1024)
  ------------------
  307|  6.55M|}
http2.c:http2_data_done:
  426|  4.44k|{
  427|  4.44k|  struct cf_h2_ctx *ctx = cf->ctx;
  428|  4.44k|  struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data);
  ------------------
  |  |  265|  4.44k|  ((struct h2_stream_ctx *)(                                             \
  |  |  266|  4.44k|    (data) ? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL))
  |  |  ------------------
  |  |  |  Branch (266:5): [True: 4.44k, False: 0]
  |  |  ------------------
  ------------------
  429|       |
  430|  4.44k|  DEBUGASSERT(ctx);
  ------------------
  |  | 1081|  4.44k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (430:3): [True: 0, False: 4.44k]
  |  Branch (430:3): [True: 4.44k, False: 0]
  ------------------
  431|  4.44k|  if(!stream || !ctx->initialized)
  ------------------
  |  Branch (431:6): [True: 13, False: 4.43k]
  |  Branch (431:17): [True: 0, False: 4.43k]
  ------------------
  432|     13|    return;
  433|       |
  434|  4.43k|  if(ctx->h2) {
  ------------------
  |  Branch (434:6): [True: 4.43k, False: 0]
  ------------------
  435|  4.43k|    bool flush_egress = FALSE;
  ------------------
  |  | 1058|  4.43k|#define FALSE false
  ------------------
  436|       |    /* returns error if stream not known, which is fine here */
  437|  4.43k|    (void)nghttp2_session_set_stream_user_data(ctx->h2, stream->id, NULL);
  438|       |
  439|  4.43k|    if(!stream->closed && stream->id > 0) {
  ------------------
  |  Branch (439:8): [True: 3.29k, False: 1.14k]
  |  Branch (439:27): [True: 3.26k, False: 28]
  ------------------
  440|       |      /* RST_STREAM */
  441|  3.26k|      CURL_TRC_CF(data, cf, "[%d] premature DATA_DONE, RST stream",
  ------------------
  |  |  153|  3.26k|  do {                                          \
  |  |  154|  3.26k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  3.26k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  6.53k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 3.26k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 3.26k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  6.53k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  3.26k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.26k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.26k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.26k]
  |  |  ------------------
  ------------------
  442|  3.26k|                  stream->id);
  443|  3.26k|      stream->closed = TRUE;
  ------------------
  |  | 1055|  3.26k|#define TRUE true
  ------------------
  444|  3.26k|      stream->reset = TRUE;
  ------------------
  |  | 1055|  3.26k|#define TRUE true
  ------------------
  445|  3.26k|      nghttp2_submit_rst_stream(ctx->h2, NGHTTP2_FLAG_NONE,
  446|  3.26k|                                stream->id, NGHTTP2_STREAM_CLOSED);
  447|  3.26k|      flush_egress = TRUE;
  ------------------
  |  | 1055|  3.26k|#define TRUE true
  ------------------
  448|  3.26k|    }
  449|       |
  450|  4.43k|    if(flush_egress) {
  ------------------
  |  Branch (450:8): [True: 3.26k, False: 1.16k]
  ------------------
  451|  3.26k|      (void)nghttp2_session_send(ctx->h2);
  452|  3.26k|      (void)nw_out_flush(cf, data);
  453|  3.26k|    }
  454|  4.43k|  }
  455|       |
  456|  4.43k|  Curl_uint32_hash_remove(&ctx->streams, data->mid);
  457|  4.43k|}
http2.c:nw_out_flush:
  404|  6.52M|{
  405|  6.52M|  struct cf_h2_ctx *ctx = cf->ctx;
  406|  6.52M|  size_t nwritten;
  407|  6.52M|  CURLcode result;
  408|       |
  409|  6.52M|  if(Curl_bufq_is_empty(&ctx->outbufq))
  ------------------
  |  Branch (409:6): [True: 6.51M, False: 11.2k]
  ------------------
  410|  6.51M|    return CURLE_OK;
  411|       |
  412|  11.2k|  result = Curl_cf_send_bufq(cf->next, data, &ctx->outbufq, NULL, 0,
  413|  11.2k|                             &nwritten);
  414|  11.2k|  if(result) {
  ------------------
  |  Branch (414:6): [True: 0, False: 11.2k]
  ------------------
  415|      0|    if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (415:8): [True: 0, False: 0]
  ------------------
  416|      0|      CURL_TRC_CF(data, cf, "flush nw send buffer(%zu) -> EAGAIN",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  417|      0|                  Curl_bufq_len(&ctx->outbufq));
  418|      0|      ctx->nw_out_blocked = 1;
  419|      0|    }
  420|      0|    return result;
  421|      0|  }
  422|  11.2k|  return Curl_bufq_is_empty(&ctx->outbufq) ? CURLE_OK : CURLE_AGAIN;
  ------------------
  |  Branch (422:10): [True: 11.2k, False: 0]
  ------------------
  423|  11.2k|}
http2.c:free_push_headers:
  153|  4.43k|{
  154|  4.43k|  size_t i;
  155|  4.43k|  for(i = 0; i < stream->push_headers_used; i++)
  ------------------
  |  Branch (155:14): [True: 0, False: 4.43k]
  ------------------
  156|      0|    curlx_free(stream->push_headers[i]);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  157|       |  curlx_safefree(stream->push_headers);
  ------------------
  |  | 1327|  4.43k|  do {                      \
  |  | 1328|  4.43k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  4.43k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  4.43k|    (ptr) = NULL;           \
  |  | 1330|  4.43k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 4.43k]
  |  |  ------------------
  ------------------
  158|  4.43k|  stream->push_headers_used = 0;
  159|  4.43k|}
http2.c:cf_h2_on_invalid_frame_recv:
 1236|  1.15k|{
 1237|  1.15k|  struct Curl_cfilter *cf = userp;
 1238|  1.15k|  struct cf_h2_ctx *ctx = cf->ctx;
 1239|  1.15k|  struct Curl_easy *data;
 1240|  1.15k|  int32_t stream_id = frame->hd.stream_id;
 1241|       |
 1242|  1.15k|  data = nghttp2_session_get_stream_user_data(session, stream_id);
 1243|  1.15k|  if(data) {
  ------------------
  |  Branch (1243:6): [True: 613, False: 538]
  ------------------
 1244|    613|    struct h2_stream_ctx *stream;
 1245|    613|#ifdef CURLVERBOSE
 1246|    613|    char buffer[256];
 1247|    613|    int len;
 1248|    613|    len = Curl_nghttp2_fr_print(frame, buffer, sizeof(buffer) - 1);
 1249|    613|    buffer[len] = 0;
 1250|    613|    failf(data, "[HTTP2] [%d] received invalid frame: %s, error %d: %s",
  ------------------
  |  |   62|    613|#define failf Curl_failf
  ------------------
 1251|    613|          stream_id, buffer, ngerr, nghttp2_strerror(ngerr));
 1252|    613|#endif /* CURLVERBOSE */
 1253|    613|    stream = H2_STREAM_CTX(ctx, data);
  ------------------
  |  |  265|    613|  ((struct h2_stream_ctx *)(                                             \
  |  |  266|    613|    (data) ? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL))
  |  |  ------------------
  |  |  |  Branch (266:5): [True: 613, False: 0]
  |  |  ------------------
  ------------------
 1254|    613|    if(stream) {
  ------------------
  |  Branch (1254:8): [True: 613, False: 0]
  ------------------
 1255|    613|      nghttp2_submit_rst_stream(ctx->h2, NGHTTP2_FLAG_NONE,
 1256|    613|                                stream->id, NGHTTP2_STREAM_CLOSED);
 1257|    613|      stream->error = ngerr;
 1258|    613|      stream->closed = TRUE;
  ------------------
  |  | 1055|    613|#define TRUE true
  ------------------
 1259|    613|      stream->reset = TRUE;
  ------------------
  |  | 1055|    613|#define TRUE true
  ------------------
 1260|    613|      return 0;  /* keep the connection alive */
 1261|    613|    }
 1262|    613|  }
 1263|    538|  return NGHTTP2_ERR_CALLBACK_FAILURE;
 1264|  1.15k|}
http2.c:on_frame_send:
 1133|  23.6k|{
 1134|  23.6k|  struct Curl_cfilter *cf = userp;
 1135|  23.6k|  struct cf_h2_ctx *ctx = cf->ctx;
 1136|  23.6k|  struct Curl_easy *data = CF_DATA_CURRENT(cf);
  ------------------
  |  |  699|  23.6k|#define CF_DATA_CURRENT(cf) ((cf) ? (CF_CTX_CALL_DATA(cf).data) : NULL)
  |  |  ------------------
  |  |  |  |  120|  23.6k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  |  Branch (699:30): [True: 23.6k, False: 0]
  |  |  ------------------
  ------------------
 1137|       |
 1138|  23.6k|  (void)session;
 1139|  23.6k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  23.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1139:3): [True: 0, False: 23.6k]
  |  Branch (1139:3): [True: 23.6k, False: 0]
  ------------------
 1140|  23.6k|  if(Curl_trc_cf_is_verbose(cf, data)) {
  ------------------
  |  |  323|  23.6k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  ------------------
  |  |  |  |  319|  47.3k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 23.6k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 23.6k]
  |  |  |  |  ------------------
  |  |  |  |  320|  47.3k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  324|  23.6k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1141|      0|    char buffer[256];
 1142|      0|    int len;
 1143|      0|    len = Curl_nghttp2_fr_print(frame, buffer, sizeof(buffer) - 1);
 1144|      0|    buffer[len] = 0;
 1145|      0|    CURL_TRC_CF(data, cf, "[%d] -> %s", frame->hd.stream_id, buffer);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1146|      0|  }
 1147|  23.6k|  if((frame->hd.type == NGHTTP2_GOAWAY) && !ctx->sent_goaway) {
  ------------------
  |  Branch (1147:6): [True: 3.85k, False: 19.8k]
  |  Branch (1147:44): [True: 2.73k, False: 1.12k]
  ------------------
 1148|       |    /* A GOAWAY not initiated by us, but by nghttp2 itself on detecting
 1149|       |     * a protocol error on the connection */
 1150|  2.73k|    failf(data, "nghttp2 shuts down connection with error %u: %s",
  ------------------
  |  |   62|  2.73k|#define failf Curl_failf
  ------------------
 1151|  2.73k|          frame->goaway.error_code,
 1152|  2.73k|          nghttp2_http2_strerror(frame->goaway.error_code));
 1153|  2.73k|  }
 1154|  23.6k|  return 0;
 1155|  23.6k|}
http2.c:on_data_chunk_recv:
 1269|    416|{
 1270|    416|  struct Curl_cfilter *cf = userp;
 1271|    416|  struct cf_h2_ctx *ctx = cf->ctx;
 1272|    416|  struct h2_stream_ctx *stream;
 1273|    416|  struct Curl_easy *data_s;
 1274|    416|  (void)flags;
 1275|       |
 1276|    416|  DEBUGASSERT(stream_id); /* should never be a zero stream ID here */
  ------------------
  |  | 1081|    416|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1276:3): [True: 0, False: 416]
  |  Branch (1276:3): [True: 416, False: 0]
  ------------------
 1277|    416|  DEBUGASSERT(CF_DATA_CURRENT(cf));
  ------------------
  |  | 1081|    416|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1277:3): [True: 0, False: 416]
  |  Branch (1277:3): [True: 0, False: 416]
  |  Branch (1277:3): [True: 416, False: 0]
  |  Branch (1277:3): [True: 416, False: 0]
  ------------------
 1278|       |
 1279|       |  /* get the stream from the hash based on Stream ID */
 1280|    416|  data_s = nghttp2_session_get_stream_user_data(session, stream_id);
 1281|    416|  if(!data_s) {
  ------------------
  |  Branch (1281:6): [True: 0, False: 416]
  ------------------
 1282|       |    /* Receiving a Stream ID not in the hash should not happen - unless
 1283|       |       we have aborted a transfer artificially and there were more data
 1284|       |       in the pipeline. Silently ignore. */
 1285|      0|    CURL_TRC_CF(CF_DATA_CURRENT(cf), cf, "[%d] Data for unknown", stream_id);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:15): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (320:7): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (321:7): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:25): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1286|       |    /* consumed explicitly as no one will read it */
 1287|      0|    nghttp2_session_consume(session, stream_id, len);
 1288|      0|    return 0;
 1289|      0|  }
 1290|       |
 1291|    416|  stream = H2_STREAM_CTX(ctx, data_s);
  ------------------
  |  |  265|    416|  ((struct h2_stream_ctx *)(                                             \
  |  |  266|    416|    (data) ? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL))
  |  |  ------------------
  |  |  |  Branch (266:5): [True: 416, False: 0]
  |  |  ------------------
  ------------------
 1292|    416|  if(!stream)
  ------------------
  |  Branch (1292:6): [True: 0, False: 416]
  ------------------
 1293|      0|    return NGHTTP2_ERR_CALLBACK_FAILURE;
 1294|       |
 1295|    416|  h2_xfer_write_resp(cf, data_s, stream, (const char *)mem, len, FALSE);
  ------------------
  |  | 1058|    416|#define FALSE false
  ------------------
 1296|       |
 1297|    416|  nghttp2_session_consume(ctx->h2, stream_id, len);
 1298|    416|  stream->nrcvd_data += (curl_off_t)len;
 1299|    416|  return 0;
 1300|    416|}
http2.c:h2_xfer_write_resp:
  919|    416|{
  920|       |  /* If we already encountered an error, skip further writes */
  921|    416|  if(!stream->xfer_result)
  ------------------
  |  Branch (921:6): [True: 402, False: 14]
  ------------------
  922|    402|    stream->xfer_result = Curl_xfer_write_resp(data, buf, blen, eos);
  923|       |  /* If the transfer write is errored, we do not want any more data */
  924|    416|  if(stream->xfer_result) {
  ------------------
  |  Branch (924:6): [True: 14, False: 402]
  ------------------
  925|     14|    struct cf_h2_ctx *ctx = cf->ctx;
  926|     14|    CURL_TRC_CF(data, cf, "[%d] error %d writing %zu bytes of data, "
  ------------------
  |  |  153|     14|  do {                                          \
  |  |  154|     14|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     14|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     28|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 14, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 14]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     28|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     14|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     14|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     14|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 14]
  |  |  ------------------
  ------------------
  927|     14|                "RST-ing stream",
  928|     14|                stream->id, stream->xfer_result, blen);
  929|     14|    nghttp2_submit_rst_stream(ctx->h2, 0, stream->id,
  930|     14|                              (uint32_t)NGHTTP2_ERR_CALLBACK_FAILURE);
  931|     14|  }
  932|    402|  else if(!stream->write_paused && Curl_xfer_write_is_paused(data)) {
  ------------------
  |  Branch (932:11): [True: 402, False: 0]
  |  Branch (932:36): [True: 0, False: 402]
  ------------------
  933|      0|    CURL_TRC_CF(data, cf, "[%d] stream output paused", stream->id);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  934|      0|    stream->write_paused = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  935|      0|  }
  936|    402|  else if(stream->write_paused && !Curl_xfer_write_is_paused(data)) {
  ------------------
  |  Branch (936:11): [True: 0, False: 402]
  |  Branch (936:35): [True: 0, False: 0]
  ------------------
  937|      0|    CURL_TRC_CF(data, cf, "[%d] stream output unpaused", stream->id);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  938|      0|    stream->write_paused = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  939|      0|  }
  940|       |
  941|    416|  if(!stream->xfer_result && !eos)
  ------------------
  |  Branch (941:6): [True: 402, False: 14]
  |  Branch (941:30): [True: 402, False: 0]
  ------------------
  942|    402|    stream->xfer_result = cf_h2_update_local_win(cf, data, stream);
  943|    416|}
http2.c:on_stream_close:
 1304|  2.03k|{
 1305|  2.03k|  struct Curl_cfilter *cf = userp;
 1306|  2.03k|  struct cf_h2_ctx *ctx = cf->ctx;
 1307|  2.03k|  struct Curl_easy *data_s, *call_data = CF_DATA_CURRENT(cf);
  ------------------
  |  |  699|  2.03k|#define CF_DATA_CURRENT(cf) ((cf) ? (CF_CTX_CALL_DATA(cf).data) : NULL)
  |  |  ------------------
  |  |  |  |  120|  2.03k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  |  Branch (699:30): [True: 2.03k, False: 0]
  |  |  ------------------
  ------------------
 1308|  2.03k|  struct h2_stream_ctx *stream;
 1309|  2.03k|  int rv;
 1310|  2.03k|  (void)session;
 1311|       |
 1312|  2.03k|  DEBUGASSERT(call_data);
  ------------------
  |  | 1081|  2.03k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1312:3): [True: 0, False: 2.03k]
  |  Branch (1312:3): [True: 2.03k, False: 0]
  ------------------
 1313|       |  /* stream id 0 is the connection, do not look there for streams. */
 1314|  2.03k|  data_s = stream_id ?
  ------------------
  |  Branch (1314:12): [True: 2.03k, False: 0]
  ------------------
 1315|  2.03k|    nghttp2_session_get_stream_user_data(session, stream_id) : NULL;
 1316|  2.03k|  if(!data_s) {
  ------------------
  |  Branch (1316:6): [True: 1.26k, False: 769]
  ------------------
 1317|  1.26k|    CURL_TRC_CF(call_data, cf,
  ------------------
  |  |  153|  1.26k|  do {                                          \
  |  |  154|  1.26k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  1.26k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  2.52k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 1.26k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.26k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  2.52k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  1.26k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.26k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.26k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.26k]
  |  |  ------------------
  ------------------
 1318|  1.26k|                "[%d] on_stream_close, no easy set on stream", stream_id);
 1319|  1.26k|    return 0;
 1320|  1.26k|  }
 1321|    769|  if(!GOOD_EASY_HANDLE(data_s)) {
  ------------------
  |  |  136|    769|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  130|    769|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  | 1055|    769|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (136:5): [True: 769, False: 0]
  |  |  |  Branch (136:12): [True: 769, False: 0]
  |  |  ------------------
  |  |  137|    769|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (1321:6): [True: 0, False: 769]
  |  Branch (1321:7): [True: 0, False: 0]
  |  Branch (1321:7): [True: 0, False: 0]
  ------------------
 1322|       |    /* nghttp2 still has an easy registered for the stream which has
 1323|       |     * been freed be libcurl. This points to a code path that does not
 1324|       |     * trigger DONE or DETACH events as it must. */
 1325|      0|    CURL_TRC_CF(call_data, cf,
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1326|      0|                "[%d] on_stream_close, not a GOOD easy on stream", stream_id);
 1327|      0|    (void)nghttp2_session_set_stream_user_data(session, stream_id, 0);
 1328|      0|    return NGHTTP2_ERR_CALLBACK_FAILURE;
 1329|      0|  }
 1330|    769|  stream = H2_STREAM_CTX(ctx, data_s);
  ------------------
  |  |  265|    769|  ((struct h2_stream_ctx *)(                                             \
  |  |  266|    769|    (data) ? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL))
  |  |  ------------------
  |  |  |  Branch (266:5): [True: 769, False: 0]
  |  |  ------------------
  ------------------
 1331|    769|  if(!stream) {
  ------------------
  |  Branch (1331:6): [True: 0, False: 769]
  ------------------
 1332|      0|    CURL_TRC_CF(data_s, cf,
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1333|      0|                "[%d] on_stream_close, GOOD easy but no stream", stream_id);
 1334|      0|    return NGHTTP2_ERR_CALLBACK_FAILURE;
 1335|      0|  }
 1336|       |
 1337|    769|  stream->closed = TRUE;
  ------------------
  |  | 1055|    769|#define TRUE true
  ------------------
 1338|    769|  stream->error = error_code;
 1339|    769|  if(stream->error)
  ------------------
  |  Branch (1339:6): [True: 732, False: 37]
  ------------------
 1340|    732|    stream->reset = TRUE;
  ------------------
  |  | 1055|    732|#define TRUE true
  ------------------
 1341|       |
 1342|    769|  if(stream->error)
  ------------------
  |  Branch (1342:6): [True: 732, False: 37]
  ------------------
 1343|    732|    CURL_TRC_CF(data_s, cf, "[%d] RESET: %s (err %u)",
  ------------------
  |  |  153|    732|  do {                                          \
  |  |  154|    732|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    732|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  1.46k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 732, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 732]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  1.46k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    732|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    732|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    732|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 732]
  |  |  ------------------
  ------------------
 1344|    769|              stream_id, nghttp2_http2_strerror(error_code), error_code);
 1345|     37|  else
 1346|     37|    CURL_TRC_CF(data_s, cf, "[%d] CLOSED", stream_id);
  ------------------
  |  |  153|     37|  do {                                          \
  |  |  154|     37|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     37|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     74|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 37, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 37]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     74|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     37|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     37|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     37|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 37]
  |  |  ------------------
  ------------------
 1347|    769|  Curl_multi_mark_dirty(data_s);
 1348|       |
 1349|       |  /* remove `data_s` from the nghttp2 stream */
 1350|    769|  rv = nghttp2_session_set_stream_user_data(session, stream_id, 0);
 1351|    769|  if(rv) {
  ------------------
  |  Branch (1351:6): [True: 0, False: 769]
  ------------------
 1352|      0|    infof(data_s, "http/2: failed to clear user_data for stream %d",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1353|      0|          stream_id);
 1354|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1354:5): [Folded, False: 0]
  |  Branch (1354:5): [Folded, False: 0]
  ------------------
 1355|      0|  }
 1356|    769|  return 0;
 1357|    769|}
http2.c:on_begin_headers:
 1361|  1.81k|{
 1362|  1.81k|  struct Curl_cfilter *cf = userp;
 1363|  1.81k|  struct cf_h2_ctx *ctx = cf->ctx;
 1364|  1.81k|  struct h2_stream_ctx *stream;
 1365|  1.81k|  struct Curl_easy *data_s = NULL;
 1366|       |
 1367|  1.81k|  (void)cf;
 1368|  1.81k|  data_s = nghttp2_session_get_stream_user_data(session, frame->hd.stream_id);
 1369|  1.81k|  if(!data_s) {
  ------------------
  |  Branch (1369:6): [True: 0, False: 1.81k]
  ------------------
 1370|      0|    return 0;
 1371|      0|  }
 1372|       |
 1373|  1.81k|  if(frame->hd.type != NGHTTP2_HEADERS) {
  ------------------
  |  Branch (1373:6): [True: 0, False: 1.81k]
  ------------------
 1374|      0|    return 0;
 1375|      0|  }
 1376|       |
 1377|  1.81k|  stream = H2_STREAM_CTX(ctx, data_s);
  ------------------
  |  |  265|  1.81k|  ((struct h2_stream_ctx *)(                                             \
  |  |  266|  1.81k|    (data) ? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL))
  |  |  ------------------
  |  |  |  Branch (266:5): [True: 1.81k, False: 0]
  |  |  ------------------
  ------------------
 1378|  1.81k|  if(!stream || !stream->bodystarted) {
  ------------------
  |  Branch (1378:6): [True: 0, False: 1.81k]
  |  Branch (1378:17): [True: 1.79k, False: 23]
  ------------------
 1379|  1.79k|    return 0;
 1380|  1.79k|  }
 1381|       |
 1382|     23|  return 0;
 1383|  1.81k|}
http2.c:on_header:
 1408|  34.4k|{
 1409|  34.4k|  struct Curl_cfilter *cf = userp;
 1410|  34.4k|  struct cf_h2_ctx *ctx = cf->ctx;
 1411|  34.4k|  struct h2_stream_ctx *stream;
 1412|  34.4k|  struct Curl_easy *data_s;
 1413|  34.4k|  int32_t stream_id = frame->hd.stream_id;
 1414|  34.4k|  CURLcode result;
 1415|  34.4k|  (void)flags;
 1416|       |
 1417|  34.4k|  DEBUGASSERT(stream_id); /* should never be a zero stream ID here */
  ------------------
  |  | 1081|  34.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1417:3): [True: 0, False: 34.4k]
  |  Branch (1417:3): [True: 34.4k, False: 0]
  ------------------
 1418|       |
 1419|       |  /* get the stream from the hash based on Stream ID */
 1420|  34.4k|  data_s = nghttp2_session_get_stream_user_data(session, stream_id);
 1421|  34.4k|  if(!GOOD_EASY_HANDLE(data_s))
  ------------------
  |  |  136|  34.4k|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  130|  34.4k|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  | 1055|  34.4k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (136:5): [True: 34.4k, False: 0]
  |  |  |  Branch (136:12): [True: 34.4k, False: 0]
  |  |  ------------------
  |  |  137|  34.4k|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (1421:6): [True: 0, False: 34.4k]
  |  Branch (1421:7): [True: 0, False: 0]
  |  Branch (1421:7): [True: 0, False: 0]
  ------------------
 1422|       |    /* Receiving a Stream ID not in the hash should not happen, this is an
 1423|       |       internal error more than anything else! */
 1424|      0|    return NGHTTP2_ERR_CALLBACK_FAILURE;
 1425|       |
 1426|  34.4k|  stream = H2_STREAM_CTX(ctx, data_s);
  ------------------
  |  |  265|  34.4k|  ((struct h2_stream_ctx *)(                                             \
  |  |  266|  34.4k|    (data) ? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL))
  |  |  ------------------
  |  |  |  Branch (266:5): [True: 34.4k, False: 0]
  |  |  ------------------
  ------------------
 1427|  34.4k|  if(!stream) {
  ------------------
  |  Branch (1427:6): [True: 0, False: 34.4k]
  ------------------
 1428|      0|    failf(data_s, "Internal NULL stream");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1429|      0|    return NGHTTP2_ERR_CALLBACK_FAILURE;
 1430|      0|  }
 1431|       |
 1432|       |  /* Store received PUSH_PROMISE headers to be used when the subsequent
 1433|       |     PUSH_PROMISE callback comes */
 1434|  34.4k|  if(frame->hd.type == NGHTTP2_PUSH_PROMISE) {
  ------------------
  |  Branch (1434:6): [True: 0, False: 34.4k]
  ------------------
 1435|      0|    char *h;
 1436|       |
 1437|      0|    if((namelen == (sizeof(HTTP_PSEUDO_AUTHORITY) - 1)) &&
  ------------------
  |  |  227|      0|#define HTTP_PSEUDO_AUTHORITY ":authority"
  ------------------
  |  Branch (1437:8): [True: 0, False: 0]
  ------------------
 1438|      0|       !strncmp(HTTP_PSEUDO_AUTHORITY, (const char *)name, namelen)) {
  ------------------
  |  |  227|      0|#define HTTP_PSEUDO_AUTHORITY ":authority"
  ------------------
  |  Branch (1438:8): [True: 0, False: 0]
  ------------------
 1439|       |      /* pseudo headers are lower case */
 1440|      0|      int rc = 0;
 1441|      0|      char *check = curl_maprintf("%s:%d", cf->conn->origin->hostname,
 1442|      0|                                  cf->conn->origin->port);
 1443|      0|      if(!check)
  ------------------
  |  Branch (1443:10): [True: 0, False: 0]
  ------------------
 1444|       |        /* no memory */
 1445|      0|        return NGHTTP2_ERR_CALLBACK_FAILURE;
 1446|      0|      if(!curl_strequal(check, (const char *)value) &&
  ------------------
  |  Branch (1446:10): [True: 0, False: 0]
  ------------------
 1447|      0|         ((cf->conn->origin->port != cf->conn->given->defport) ||
  ------------------
  |  Branch (1447:11): [True: 0, False: 0]
  ------------------
 1448|      0|          !curl_strequal(cf->conn->origin->hostname, (const char *)value))) {
  ------------------
  |  Branch (1448:11): [True: 0, False: 0]
  ------------------
 1449|       |        /* This is push is not for the same authority that was asked for in
 1450|       |         * the URL. RFC 7540 section 8.2 says: "A client MUST treat a
 1451|       |         * PUSH_PROMISE for which the server is not authoritative as a stream
 1452|       |         * error of type PROTOCOL_ERROR."
 1453|       |         */
 1454|      0|        (void)nghttp2_submit_rst_stream(session, NGHTTP2_FLAG_NONE,
 1455|      0|                                        stream_id, NGHTTP2_PROTOCOL_ERROR);
 1456|      0|        rc = NGHTTP2_ERR_CALLBACK_FAILURE;
 1457|      0|      }
 1458|      0|      curlx_free(check);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1459|      0|      if(rc)
  ------------------
  |  Branch (1459:10): [True: 0, False: 0]
  ------------------
 1460|      0|        return rc;
 1461|      0|    }
 1462|       |
 1463|      0|    if(!stream->push_headers) {
  ------------------
  |  Branch (1463:8): [True: 0, False: 0]
  ------------------
 1464|      0|      stream->push_headers_alloc = 10;
 1465|      0|      stream->push_headers = curlx_malloc(stream->push_headers_alloc *
  ------------------
  |  | 1478|      0|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
 1466|      0|                                          sizeof(char *));
 1467|      0|      if(!stream->push_headers)
  ------------------
  |  Branch (1467:10): [True: 0, False: 0]
  ------------------
 1468|      0|        return NGHTTP2_ERR_CALLBACK_FAILURE;
 1469|      0|      stream->push_headers_used = 0;
 1470|      0|    }
 1471|      0|    else if(stream->push_headers_used ==
  ------------------
  |  Branch (1471:13): [True: 0, False: 0]
  ------------------
 1472|      0|            stream->push_headers_alloc) {
 1473|      0|      char **headp;
 1474|      0|      if(stream->push_headers_alloc > 1000) {
  ------------------
  |  Branch (1474:10): [True: 0, False: 0]
  ------------------
 1475|       |        /* this is beyond crazy many headers, bail out */
 1476|      0|        failf(data_s, "Too many PUSH_PROMISE headers");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1477|      0|        free_push_headers(stream);
 1478|      0|        return NGHTTP2_ERR_CALLBACK_FAILURE;
 1479|      0|      }
 1480|      0|      stream->push_headers_alloc *= 2;
 1481|      0|      headp = curlx_realloc(stream->push_headers,
  ------------------
  |  | 1482|      0|  curl_dbg_realloc(ptr, size, __LINE__, __FILE__)
  ------------------
 1482|      0|                            stream->push_headers_alloc * sizeof(char *));
 1483|      0|      if(!headp) {
  ------------------
  |  Branch (1483:10): [True: 0, False: 0]
  ------------------
 1484|      0|        free_push_headers(stream);
 1485|      0|        return NGHTTP2_ERR_CALLBACK_FAILURE;
 1486|      0|      }
 1487|      0|      stream->push_headers = headp;
 1488|      0|    }
 1489|      0|    h = curl_maprintf("%s:%s", name, value);
 1490|      0|    if(!h) {
  ------------------
  |  Branch (1490:8): [True: 0, False: 0]
  ------------------
 1491|      0|      free_push_headers(stream);
 1492|      0|      return NGHTTP2_ERR_CALLBACK_FAILURE;
 1493|      0|    }
 1494|      0|    stream->push_headers[stream->push_headers_used++] = h;
 1495|      0|    return 0;
 1496|      0|  }
 1497|       |
 1498|  34.4k|  if(stream->bodystarted) {
  ------------------
  |  Branch (1498:6): [True: 129, False: 34.3k]
  ------------------
 1499|       |    /* This is a trailer */
 1500|    129|    CURL_TRC_CF(data_s, cf, "[%d] trailer: %.*s: %.*s",
  ------------------
  |  |  153|    129|  do {                                          \
  |  |  154|    129|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    129|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    258|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 129, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 129]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    258|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    129|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    129|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    129|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 129]
  |  |  ------------------
  ------------------
 1501|    129|                stream->id, (int)namelen, name, (int)valuelen, value);
 1502|    129|    result = Curl_dynhds_add(&stream->resp_trailers,
 1503|    129|                             (const char *)name, namelen,
 1504|    129|                             (const char *)value, valuelen);
 1505|    129|    if(result) {
  ------------------
  |  Branch (1505:8): [True: 0, False: 129]
  ------------------
 1506|      0|      cf_h2_header_error(cf, data_s, stream, result);
 1507|      0|      return NGHTTP2_ERR_CALLBACK_FAILURE;
 1508|      0|    }
 1509|       |
 1510|    129|    return 0;
 1511|    129|  }
 1512|       |
 1513|  34.3k|  if(namelen == sizeof(HTTP_PSEUDO_STATUS) - 1 &&
  ------------------
  |  |  229|  34.3k|#define HTTP_PSEUDO_STATUS    ":status"
  ------------------
  |  Branch (1513:6): [True: 3.31k, False: 31.0k]
  ------------------
 1514|  3.31k|     memcmp(HTTP_PSEUDO_STATUS, name, namelen) == 0) {
  ------------------
  |  |  229|  3.31k|#define HTTP_PSEUDO_STATUS    ":status"
  ------------------
  |  Branch (1514:6): [True: 1.20k, False: 2.11k]
  ------------------
 1515|       |    /* nghttp2 guarantees :status is received first and only once. */
 1516|  1.20k|    char buffer[32];
 1517|  1.20k|    size_t hlen;
 1518|  1.20k|    result = Curl_http_decode_status(&stream->status_code,
 1519|  1.20k|                                     (const char *)value, valuelen);
 1520|  1.20k|    if(result) {
  ------------------
  |  Branch (1520:8): [True: 0, False: 1.20k]
  ------------------
 1521|      0|      cf_h2_header_error(cf, data_s, stream, result);
 1522|      0|      return NGHTTP2_ERR_CALLBACK_FAILURE;
 1523|      0|    }
 1524|  1.20k|    hlen = curl_msnprintf(buffer, sizeof(buffer), HTTP_PSEUDO_STATUS ":%d\r",
  ------------------
  |  |  229|  1.20k|#define HTTP_PSEUDO_STATUS    ":status"
  ------------------
 1525|  1.20k|                          stream->status_code);
 1526|  1.20k|    result = Curl_headers_push(data_s, buffer, hlen, CURLH_PSEUDO);
  ------------------
  |  |   45|  1.20k|#define CURLH_PSEUDO    (1 << 4) /* pseudo headers */
  ------------------
 1527|  1.20k|    if(result) {
  ------------------
  |  Branch (1527:8): [True: 0, False: 1.20k]
  ------------------
 1528|      0|      cf_h2_header_error(cf, data_s, stream, result);
 1529|      0|      return NGHTTP2_ERR_CALLBACK_FAILURE;
 1530|      0|    }
 1531|  1.20k|    curlx_dyn_reset(&ctx->scratch);
 1532|  1.20k|    result = curlx_dyn_addn(&ctx->scratch, STRCONST("HTTP/2 "));
  ------------------
  |  | 1292|  1.20k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 1533|  1.20k|    if(!result)
  ------------------
  |  Branch (1533:8): [True: 1.20k, False: 0]
  ------------------
 1534|  1.20k|      result = curlx_dyn_addn(&ctx->scratch, value, valuelen);
 1535|  1.20k|    if(!result)
  ------------------
  |  Branch (1535:8): [True: 1.20k, False: 0]
  ------------------
 1536|  1.20k|      result = curlx_dyn_addn(&ctx->scratch, STRCONST(" \r\n"));
  ------------------
  |  | 1292|  1.20k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 1537|  1.20k|    if(!result)
  ------------------
  |  Branch (1537:8): [True: 1.20k, False: 0]
  ------------------
 1538|  1.20k|      h2_xfer_write_resp_hd(cf, data_s, stream, curlx_dyn_ptr(&ctx->scratch),
 1539|  1.20k|                            curlx_dyn_len(&ctx->scratch), FALSE);
  ------------------
  |  | 1058|  1.20k|#define FALSE false
  ------------------
 1540|  1.20k|    if(result) {
  ------------------
  |  Branch (1540:8): [True: 0, False: 1.20k]
  ------------------
 1541|      0|      cf_h2_header_error(cf, data_s, stream, result);
 1542|      0|      return NGHTTP2_ERR_CALLBACK_FAILURE;
 1543|      0|    }
 1544|       |    /* if we receive data for another handle, wake that up */
 1545|  1.20k|    if(CF_DATA_CURRENT(cf) != data_s)
  ------------------
  |  |  699|  1.20k|#define CF_DATA_CURRENT(cf) ((cf) ? (CF_CTX_CALL_DATA(cf).data) : NULL)
  |  |  ------------------
  |  |  |  |  120|  1.20k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  |  Branch (699:30): [True: 1.20k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1545:8): [True: 0, False: 1.20k]
  ------------------
 1546|      0|      Curl_multi_mark_dirty(data_s);
 1547|       |
 1548|  1.20k|    CURL_TRC_CF(data_s, cf, "[%d] status: HTTP/2 %03d",
  ------------------
  |  |  153|  1.20k|  do {                                          \
  |  |  154|  1.20k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  1.20k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  2.41k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 1.20k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.20k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  2.41k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  1.20k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.20k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.20k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.20k]
  |  |  ------------------
  ------------------
 1549|  1.20k|                stream->id, stream->status_code);
 1550|  1.20k|    return 0;
 1551|  1.20k|  }
 1552|       |
 1553|       |  /* nghttp2 guarantees that namelen > 0, and :status was already
 1554|       |     received, and this is not pseudo-header field . */
 1555|       |  /* convert to an HTTP1-style header */
 1556|  33.1k|  curlx_dyn_reset(&ctx->scratch);
 1557|  33.1k|  result = curlx_dyn_addn(&ctx->scratch, (const char *)name, namelen);
 1558|  33.1k|  if(!result)
  ------------------
  |  Branch (1558:6): [True: 33.1k, False: 0]
  ------------------
 1559|  33.1k|    result = curlx_dyn_addn(&ctx->scratch, STRCONST(": "));
  ------------------
  |  | 1292|  33.1k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 1560|  33.1k|  if(!result)
  ------------------
  |  Branch (1560:6): [True: 33.1k, False: 0]
  ------------------
 1561|  33.1k|    result = curlx_dyn_addn(&ctx->scratch, (const char *)value, valuelen);
 1562|  33.1k|  if(!result)
  ------------------
  |  Branch (1562:6): [True: 33.1k, False: 0]
  ------------------
 1563|  33.1k|    result = curlx_dyn_addn(&ctx->scratch, STRCONST("\r\n"));
  ------------------
  |  | 1292|  33.1k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 1564|  33.1k|  if(!result)
  ------------------
  |  Branch (1564:6): [True: 33.1k, False: 0]
  ------------------
 1565|  33.1k|    h2_xfer_write_resp_hd(cf, data_s, stream, curlx_dyn_ptr(&ctx->scratch),
 1566|  33.1k|                          curlx_dyn_len(&ctx->scratch), FALSE);
  ------------------
  |  | 1058|  33.1k|#define FALSE false
  ------------------
 1567|  33.1k|  if(result) {
  ------------------
  |  Branch (1567:6): [True: 0, False: 33.1k]
  ------------------
 1568|      0|    cf_h2_header_error(cf, data_s, stream, result);
 1569|      0|    return NGHTTP2_ERR_CALLBACK_FAILURE;
 1570|      0|  }
 1571|       |  /* if we receive data for another handle, wake that up */
 1572|  33.1k|  if(CF_DATA_CURRENT(cf) != data_s)
  ------------------
  |  |  699|  33.1k|#define CF_DATA_CURRENT(cf) ((cf) ? (CF_CTX_CALL_DATA(cf).data) : NULL)
  |  |  ------------------
  |  |  |  |  120|  33.1k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  |  Branch (699:30): [True: 33.1k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1572:6): [True: 0, False: 33.1k]
  ------------------
 1573|      0|    Curl_multi_mark_dirty(data_s);
 1574|       |
 1575|  33.1k|  CURL_TRC_CF(data_s, cf, "[%d] header: %.*s: %.*s",
  ------------------
  |  |  153|  33.1k|  do {                                          \
  |  |  154|  33.1k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  33.1k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  66.2k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 33.1k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 33.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  66.2k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  33.1k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  33.1k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  33.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 33.1k]
  |  |  ------------------
  ------------------
 1576|  33.1k|              stream->id, (int)namelen, name, (int)valuelen, value);
 1577|       |
 1578|  33.1k|  return 0; /* 0 is successful */
 1579|  33.1k|}
http2.c:error_callback:
 1637|  10.4k|{
 1638|  10.4k|  struct Curl_cfilter *cf = userp;
 1639|  10.4k|  struct Curl_easy *data = CF_DATA_CURRENT(cf);
  ------------------
  |  |  699|  10.4k|#define CF_DATA_CURRENT(cf) ((cf) ? (CF_CTX_CALL_DATA(cf).data) : NULL)
  |  |  ------------------
  |  |  |  |  120|  10.4k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  |  Branch (699:30): [True: 10.4k, False: 0]
  |  |  ------------------
  ------------------
 1640|  10.4k|  (void)session;
 1641|  10.4k|  failf(data, "%.*s", (int)len, msg);
  ------------------
  |  |   62|  10.4k|#define failf Curl_failf
  ------------------
 1642|  10.4k|  return 0;
 1643|  10.4k|}
http2.c:h2_client_new:
  461|  4.44k|{
  462|  4.44k|  struct cf_h2_ctx *ctx = cf->ctx;
  463|  4.44k|  nghttp2_option *o;
  464|  4.44k|  nghttp2_mem mem = { NULL, Curl_nghttp2_malloc, Curl_nghttp2_free,
  465|  4.44k|                      Curl_nghttp2_calloc, Curl_nghttp2_realloc };
  466|       |
  467|  4.44k|  int rc = nghttp2_option_new(&o);
  468|  4.44k|  if(rc)
  ------------------
  |  Branch (468:6): [True: 0, False: 4.44k]
  ------------------
  469|      0|    return rc;
  470|       |  /* We handle window updates ourself to enforce buffer limits */
  471|  4.44k|  nghttp2_option_set_no_auto_window_update(o, 1);
  472|  4.44k|#if NGHTTP2_VERSION_NUM >= 0x013200
  473|       |  /* with 1.50.0 */
  474|       |  /* turn off RFC 9113 leading and trailing white spaces validation against
  475|       |     HTTP field value. */
  476|  4.44k|  nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation(o, 1);
  477|  4.44k|#endif
  478|  4.44k|  rc = nghttp2_session_client_new3(&ctx->h2, cbs, cf, o, &mem);
  479|  4.44k|  nghttp2_option_del(o);
  480|  4.44k|  return rc;
  481|  4.44k|}
http2.c:http2_data_setup:
  373|  4.43k|{
  374|  4.43k|  struct cf_h2_ctx *ctx = cf->ctx;
  375|  4.43k|  struct h2_stream_ctx *stream;
  376|       |
  377|  4.43k|  (void)cf;
  378|  4.43k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  4.43k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (378:3): [True: 0, False: 4.43k]
  |  Branch (378:3): [True: 4.43k, False: 0]
  ------------------
  379|       |
  380|  4.43k|  if(!data)
  ------------------
  |  Branch (380:6): [True: 0, False: 4.43k]
  ------------------
  381|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  382|       |
  383|  4.43k|  stream = H2_STREAM_CTX(ctx, data);
  ------------------
  |  |  265|  4.43k|  ((struct h2_stream_ctx *)(                                             \
  |  |  266|  4.43k|    (data) ? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL))
  |  |  ------------------
  |  |  |  Branch (266:5): [True: 4.43k, False: 0]
  |  |  ------------------
  ------------------
  384|  4.43k|  if(stream) {
  ------------------
  |  Branch (384:6): [True: 0, False: 4.43k]
  ------------------
  385|      0|    *pstream = stream;
  386|      0|    return CURLE_OK;
  387|      0|  }
  388|       |
  389|  4.43k|  stream = h2_stream_ctx_create(ctx);
  390|  4.43k|  if(!stream)
  ------------------
  |  Branch (390:6): [True: 0, False: 4.43k]
  ------------------
  391|      0|    return CURLE_OUT_OF_MEMORY;
  392|       |
  393|  4.43k|  if(!Curl_uint32_hash_set(&ctx->streams, data->mid, stream)) {
  ------------------
  |  Branch (393:6): [True: 0, False: 4.43k]
  ------------------
  394|      0|    h2_stream_ctx_free(stream);
  395|      0|    return CURLE_OUT_OF_MEMORY;
  396|      0|  }
  397|       |
  398|  4.43k|  *pstream = stream;
  399|  4.43k|  return CURLE_OK;
  400|  4.43k|}
http2.c:h2_stream_ctx_create:
  269|  4.43k|{
  270|  4.43k|  struct h2_stream_ctx *stream;
  271|       |
  272|  4.43k|  (void)ctx;
  273|  4.43k|  stream = curlx_calloc(1, sizeof(*stream));
  ------------------
  |  | 1480|  4.43k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  274|  4.43k|  if(!stream)
  ------------------
  |  Branch (274:6): [True: 0, False: 4.43k]
  ------------------
  275|      0|    return NULL;
  276|       |
  277|  4.43k|  stream->id = -1;
  278|  4.43k|  Curl_bufq_initp(&stream->sendbuf, &ctx->stream_bufcp,
  279|  4.43k|                  H2_STREAM_SEND_CHUNKS, BUFQ_OPT_NONE);
  ------------------
  |  |   79|  4.43k|#define H2_STREAM_SEND_CHUNKS   ((64 * 1024) / H2_CHUNK_SIZE)
  |  |  ------------------
  |  |  |  |   61|  4.43k|#define H2_CHUNK_SIZE           (16 * 1024)
  |  |  ------------------
  ------------------
                                H2_STREAM_SEND_CHUNKS, BUFQ_OPT_NONE);
  ------------------
  |  |  106|  4.43k|#define BUFQ_OPT_NONE        0
  ------------------
  280|  4.43k|  Curl_h1_req_parse_init(&stream->h1, H1_PARSE_DEFAULT_MAX_LINE_LEN);
  ------------------
  |  |   35|  4.43k|#define H1_PARSE_DEFAULT_MAX_LINE_LEN   DYN_HTTP_REQUEST
  |  |  ------------------
  |  |  |  |   69|  4.43k|#define DYN_HTTP_REQUEST    (1024 * 1024)
  |  |  ------------------
  ------------------
  281|  4.43k|  Curl_dynhds_init(&stream->resp_trailers, 0, DYN_HTTP_REQUEST);
  ------------------
  |  |   69|  4.43k|#define DYN_HTTP_REQUEST    (1024 * 1024)
  ------------------
  282|  4.43k|  stream->bodystarted = FALSE;
  ------------------
  |  | 1058|  4.43k|#define FALSE false
  ------------------
  283|  4.43k|  stream->status_code = -1;
  284|  4.43k|  stream->closed = FALSE;
  ------------------
  |  | 1058|  4.43k|#define FALSE false
  ------------------
  285|  4.43k|  stream->close_handled = FALSE;
  ------------------
  |  | 1058|  4.43k|#define FALSE false
  ------------------
  286|  4.43k|  stream->error = NGHTTP2_NO_ERROR;
  287|  4.43k|  stream->local_window_size = H2_STREAM_WINDOW_SIZE_INITIAL;
  ------------------
  |  |   73|  4.43k|#define H2_STREAM_WINDOW_SIZE_INITIAL  (64 * 1024)
  ------------------
  288|  4.43k|  stream->nrcvd_data = 0;
  289|  4.43k|  return stream;
  290|  4.43k|}
http2.c:h2_stream_ctx_free:
  162|  4.43k|{
  163|  4.43k|  Curl_bufq_free(&stream->sendbuf);
  164|  4.43k|  Curl_h1_req_parse_free(&stream->h1);
  165|  4.43k|  Curl_dynhds_free(&stream->resp_trailers);
  166|  4.43k|  free_push_headers(stream);
  167|  4.43k|  curlx_free(stream);
  ------------------
  |  | 1483|  4.43k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  168|  4.43k|}
http2.c:h2_progress_ingress:
 1873|  3.26M|{
 1874|  3.26M|  struct cf_h2_ctx *ctx = cf->ctx;
 1875|  3.26M|  struct h2_stream_ctx *stream;
 1876|  3.26M|  CURLcode result = CURLE_OK;
 1877|  3.26M|  size_t nread;
 1878|       |
 1879|  3.26M|  if(should_close_session(ctx)) {
  ------------------
  |  Branch (1879:6): [True: 56, False: 3.26M]
  ------------------
 1880|     56|    CURL_TRC_CF(data, cf, "[0] ingress: session is closed");
  ------------------
  |  |  153|     56|  do {                                          \
  |  |  154|     56|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     56|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    112|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 56, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 56]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    112|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     56|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     56|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     56|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 56]
  |  |  ------------------
  ------------------
 1881|     56|    return CURLE_HTTP2;
 1882|     56|  }
 1883|       |
 1884|       |  /* Process network input buffer first */
 1885|  3.26M|  if(!Curl_bufq_is_empty(&ctx->inbufq)) {
  ------------------
  |  Branch (1885:6): [True: 0, False: 3.26M]
  ------------------
 1886|      0|    CURL_TRC_CF(data, cf, "Process %zu bytes in connection buffer",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1887|      0|                Curl_bufq_len(&ctx->inbufq));
 1888|      0|    result = h2_process_pending_input(cf, data);
 1889|      0|    if(result)
  ------------------
  |  Branch (1889:8): [True: 0, False: 0]
  ------------------
 1890|      0|      return result;
 1891|      0|  }
 1892|       |
 1893|  3.26M|  if(!data_max_bytes)
  ------------------
  |  Branch (1893:6): [True: 0, False: 3.26M]
  ------------------
 1894|      0|    data_max_bytes = H2_CHUNK_SIZE;
  ------------------
  |  |   61|      0|#define H2_CHUNK_SIZE           (16 * 1024)
  ------------------
 1895|       |
 1896|       |  /* Receive data from the "lower" filters, e.g. network until
 1897|       |   * it is time to stop due to connection close or us not processing
 1898|       |   * all network input */
 1899|  3.26M|  while(!ctx->conn_closed && Curl_bufq_is_empty(&ctx->inbufq)) {
  ------------------
  |  Branch (1899:9): [True: 3.26M, False: 0]
  |  Branch (1899:30): [True: 3.26M, False: 0]
  ------------------
 1900|  3.26M|    stream = H2_STREAM_CTX(ctx, data);
  ------------------
  |  |  265|  3.26M|  ((struct h2_stream_ctx *)(                                             \
  |  |  266|  3.26M|    (data) ? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL))
  |  |  ------------------
  |  |  |  Branch (266:5): [True: 3.26M, False: 0]
  |  |  ------------------
  ------------------
 1901|  3.26M|    if(stream && (stream->closed || !data_max_bytes)) {
  ------------------
  |  Branch (1901:8): [True: 3.26M, False: 0]
  |  Branch (1901:19): [True: 1.09k, False: 3.26M]
  |  Branch (1901:37): [True: 49, False: 3.26M]
  ------------------
 1902|       |      /* We would like to abort here and stop processing, so that the transfer
 1903|       |       * loop can handle the data/close here. This may leave data in
 1904|       |       * underlying buffers that will not be consumed. */
 1905|  1.14k|      if(!cf->next || !cf->next->cft->has_data_pending(cf->next, data))
  ------------------
  |  Branch (1905:10): [True: 0, False: 1.14k]
  |  Branch (1905:23): [True: 1.14k, False: 0]
  ------------------
 1906|  1.14k|        Curl_multi_mark_dirty(data);
 1907|  1.14k|      break;
 1908|  1.14k|    }
 1909|  3.26M|    else if(!stream) {
  ------------------
  |  Branch (1909:13): [True: 0, False: 3.26M]
  ------------------
 1910|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1910:7): [Folded, False: 0]
  |  Branch (1910:7): [Folded, False: 0]
  ------------------
 1911|      0|      break;
 1912|      0|    }
 1913|       |
 1914|  3.26M|    result = Curl_cf_recv_bufq(cf->next, data, &ctx->inbufq, 0, &nread);
 1915|  3.26M|    if(result) {
  ------------------
  |  Branch (1915:8): [True: 3.25M, False: 7.04k]
  ------------------
 1916|  3.25M|      if(result != CURLE_AGAIN) {
  ------------------
  |  Branch (1916:10): [True: 0, False: 3.25M]
  ------------------
 1917|      0|        failf(data, "Failed receiving HTTP2 data: %d(%s)", result,
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1918|      0|              curl_easy_strerror(result));
 1919|      0|        return result;
 1920|      0|      }
 1921|  3.25M|      break;
 1922|  3.25M|    }
 1923|  7.04k|    else if(nread == 0) {
  ------------------
  |  Branch (1923:13): [True: 2.47k, False: 4.57k]
  ------------------
 1924|  2.47k|      CURL_TRC_CF(data, cf, "[0] ingress: connection closed");
  ------------------
  |  |  153|  2.47k|  do {                                          \
  |  |  154|  2.47k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  2.47k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  4.95k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 2.47k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 2.47k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  4.95k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  2.47k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  2.47k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  2.47k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.47k]
  |  |  ------------------
  ------------------
 1925|  2.47k|      ctx->conn_closed = TRUE;
  ------------------
  |  | 1055|  2.47k|#define TRUE true
  ------------------
 1926|  2.47k|      break;
 1927|  2.47k|    }
 1928|  4.57k|    else {
 1929|  4.57k|      CURL_TRC_CF(data, cf, "[0] ingress: read %zu bytes", nread);
  ------------------
  |  |  153|  4.57k|  do {                                          \
  |  |  154|  4.57k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  4.57k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  9.14k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 4.57k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4.57k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  9.14k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  4.57k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  4.57k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  4.57k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 4.57k]
  |  |  ------------------
  ------------------
 1930|  4.57k|      data_max_bytes = (data_max_bytes > nread) ? (data_max_bytes - nread) : 0;
  ------------------
  |  Branch (1930:24): [True: 4.50k, False: 62]
  ------------------
 1931|  4.57k|    }
 1932|       |
 1933|  4.57k|    result = h2_process_pending_input(cf, data);
 1934|  4.57k|    if(result)
  ------------------
  |  Branch (1934:8): [True: 538, False: 4.03k]
  ------------------
 1935|    538|      return result;
 1936|  4.03k|    CURL_TRC_CF(data, cf, "[0] ingress: nw-in buffered %zu",
  ------------------
  |  |  153|  4.03k|  do {                                          \
  |  |  154|  4.03k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  4.03k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  8.06k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 4.03k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4.03k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  8.06k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  4.03k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  4.03k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  4.03k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 4.03k]
  |  |  ------------------
  ------------------
 1937|  4.03k|                Curl_bufq_len(&ctx->inbufq));
 1938|  4.03k|  }
 1939|       |
 1940|  3.26M|  if(ctx->conn_closed && Curl_bufq_is_empty(&ctx->inbufq)) {
  ------------------
  |  Branch (1940:6): [True: 2.47k, False: 3.25M]
  |  Branch (1940:26): [True: 2.47k, False: 0]
  ------------------
 1941|  2.47k|    connclose(cf->conn, ctx->rcvd_goaway ? "server closed with GOAWAY" :
  ------------------
  |  |  103|  4.95k|#define connclose(x, y)   Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
  |  |  ------------------
  |  |  |  |   91|  2.47k|#define CONNCTRL_CONNECTION 1
  |  |  ------------------
  |  |  |  Branch (103:68): [True: 21, False: 2.45k]
  |  |  ------------------
  ------------------
 1942|  2.47k|              "server closed abruptly");
 1943|  2.47k|  }
 1944|       |
 1945|  3.26M|  CURL_TRC_CF(data, cf, "[0] ingress: done");
  ------------------
  |  |  153|  3.26M|  do {                                          \
  |  |  154|  3.26M|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  3.26M|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  6.52M|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 3.26M, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 3.26M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  6.52M|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  3.26M|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.26M|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.26M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.26M]
  |  |  ------------------
  ------------------
 1946|  3.26M|  return CURLE_OK;
 1947|  3.26M|}
http2.c:should_close_session:
  487|  3.53M|{
  488|  3.53M|  return ctx->drain_total == 0 && !nghttp2_session_want_read(ctx->h2) &&
  ------------------
  |  Branch (488:10): [True: 3.53M, False: 0]
  |  Branch (488:35): [True: 68, False: 3.53M]
  ------------------
  489|     68|    !nghttp2_session_want_write(ctx->h2);
  ------------------
  |  Branch (489:5): [True: 68, False: 0]
  ------------------
  490|  3.53M|}
http2.c:h2_process_pending_input:
  499|  4.57k|{
  500|  4.57k|  struct cf_h2_ctx *ctx = cf->ctx;
  501|  4.57k|  const unsigned char *buf;
  502|  4.57k|  size_t blen, nread;
  503|  4.57k|  ssize_t rv;
  504|       |
  505|  4.57k|  while(Curl_bufq_peek(&ctx->inbufq, &buf, &blen)) {
  ------------------
  |  Branch (505:9): [True: 4.57k, False: 0]
  ------------------
  506|  4.57k|    rv = nghttp2_session_mem_recv(ctx->h2, (const uint8_t *)buf, blen);
  507|  4.57k|    if(!curlx_sztouz(rv, &nread)) {
  ------------------
  |  Branch (507:8): [True: 538, False: 4.03k]
  ------------------
  508|    538|      failf(data, "nghttp2 recv error %zd: %s", rv, nghttp2_strerror((int)rv));
  ------------------
  |  |   62|    538|#define failf Curl_failf
  ------------------
  509|    538|      return CURLE_HTTP2;
  510|    538|    }
  511|  4.03k|    Curl_bufq_skip(&ctx->inbufq, nread);
  512|  4.03k|    if(Curl_bufq_is_empty(&ctx->inbufq)) {
  ------------------
  |  Branch (512:8): [True: 4.03k, False: 0]
  ------------------
  513|  4.03k|      break;
  514|  4.03k|    }
  515|      0|    else {
  516|      0|      CURL_TRC_CF(data, cf, "process_pending_input: %zu bytes left "
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  517|      0|                  "in connection buffer", Curl_bufq_len(&ctx->inbufq));
  518|      0|    }
  519|  4.03k|  }
  520|       |
  521|  4.03k|  if(nghttp2_session_check_request_allowed(ctx->h2) == 0) {
  ------------------
  |  Branch (521:6): [True: 2.85k, False: 1.17k]
  ------------------
  522|       |    /* No more requests are allowed in the current session, so
  523|       |       the connection may not be reused. This is set when a
  524|       |       GOAWAY frame has been received or when the limit of stream
  525|       |       identifiers has been reached. */
  526|  2.85k|    connclose(cf->conn, "http/2: No new requests allowed");
  ------------------
  |  |  103|  2.85k|#define connclose(x, y)   Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
  |  |  ------------------
  |  |  |  |   91|  2.85k|#define CONNCTRL_CONNECTION 1
  |  |  ------------------
  ------------------
  527|  2.85k|  }
  528|       |
  529|  4.03k|  return CURLE_OK;
  530|  4.57k|}
http2.c:h2_progress_egress:
 1798|  6.53M|{
 1799|  6.53M|  struct cf_h2_ctx *ctx = cf->ctx;
 1800|  6.53M|  struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data);
  ------------------
  |  |  265|  6.53M|  ((struct h2_stream_ctx *)(                                             \
  |  |  266|  6.53M|    (data) ? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL))
  |  |  ------------------
  |  |  |  Branch (266:5): [True: 6.53M, False: 0]
  |  |  ------------------
  ------------------
 1801|  6.53M|  int rv = 0;
 1802|       |
 1803|  6.53M|  if(stream && stream->id > 0 &&
  ------------------
  |  Branch (1803:6): [True: 6.52M, False: 5.57k]
  |  Branch (1803:16): [True: 6.52M, False: 0]
  ------------------
 1804|  6.52M|     (sweight_wanted(data) != sweight_in_effect(data))) {
  ------------------
  |  Branch (1804:6): [True: 0, False: 6.52M]
  ------------------
 1805|       |    /* send new weight and/or dependency */
 1806|      0|    nghttp2_priority_spec pri_spec;
 1807|       |
 1808|      0|    h2_pri_spec(data, &pri_spec);
 1809|      0|    CURL_TRC_CF(data, cf, "[%d] Queuing PRIORITY", stream->id);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1810|      0|    DEBUGASSERT(stream->id != -1);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1810:5): [True: 0, False: 0]
  |  Branch (1810:5): [True: 0, False: 0]
  ------------------
 1811|      0|    rv = nghttp2_submit_priority(ctx->h2, NGHTTP2_FLAG_NONE,
 1812|      0|                                 stream->id, &pri_spec);
 1813|      0|    if(rv)
  ------------------
  |  Branch (1813:8): [True: 0, False: 0]
  ------------------
 1814|      0|      goto out;
 1815|      0|  }
 1816|       |
 1817|  6.53M|  ctx->nw_out_blocked = 0;
 1818|  6.54M|  while(!rv && !ctx->nw_out_blocked && nghttp2_session_want_write(ctx->h2))
  ------------------
  |  Branch (1818:9): [True: 6.54M, False: 0]
  |  Branch (1818:16): [True: 6.54M, False: 0]
  |  Branch (1818:40): [True: 14.4k, False: 6.53M]
  ------------------
 1819|  14.4k|    rv = nghttp2_session_send(ctx->h2);
 1820|       |
 1821|  6.53M|out:
 1822|  6.53M|  if(nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (1822:6): [True: 0, False: 6.53M]
  ------------------
 1823|      0|    CURL_TRC_CF(data, cf, "nghttp2_session_send error (%s)%d",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1824|      0|                nghttp2_strerror(rv), rv);
 1825|      0|    return CURLE_SEND_ERROR;
 1826|      0|  }
 1827|       |  /* Defer flushing during the connect phase so that the SETTINGS and
 1828|       |   * other initial frames are sent together with the first request.
 1829|       |   * Unless we are 'connect_only' where the request will never come. */
 1830|  6.53M|  if(!cf->connected && !cf->conn->bits.connect_only)
  ------------------
  |  Branch (1830:6): [True: 4.44k, False: 6.52M]
  |  Branch (1830:24): [True: 4.44k, False: 6]
  ------------------
 1831|  4.44k|    return CURLE_OK;
 1832|  6.52M|  return nw_out_flush(cf, data);
 1833|  6.53M|}
http2.c:sweight_wanted:
 1762|  6.52M|{
 1763|       |  /* 0 weight is not set by user and we take the nghttp2 default one */
 1764|  6.52M|  return data->set.priority.weight ?
  ------------------
  |  Branch (1764:10): [True: 244k, False: 6.28M]
  ------------------
 1765|   244k|    data->set.priority.weight : NGHTTP2_DEFAULT_WEIGHT;
 1766|  6.52M|}
http2.c:sweight_in_effect:
 1769|  6.52M|{
 1770|       |  /* 0 weight is not set by user and we take the nghttp2 default one */
 1771|  6.52M|  return data->state.priority.weight ?
  ------------------
  |  Branch (1771:10): [True: 244k, False: 6.28M]
  ------------------
 1772|   244k|    data->state.priority.weight : NGHTTP2_DEFAULT_WEIGHT;
 1773|  6.52M|}
http2.c:h2_pri_spec:
 1783|  4.40k|{
 1784|  4.40k|  struct Curl_data_priority *prio = &data->set.priority;
 1785|  4.40k|  nghttp2_priority_spec_init(pri_spec, 0,
 1786|       |                             sweight_wanted(data), FALSE);
  ------------------
  |  | 1058|  4.40k|#define FALSE false
  ------------------
 1787|  4.40k|  data->state.priority = *prio;
 1788|  4.40k|}
http2.c:cf_h2_close:
 2554|  4.44k|{
 2555|  4.44k|  struct cf_h2_ctx *ctx = cf->ctx;
 2556|       |
 2557|  4.44k|  if(ctx) {
  ------------------
  |  Branch (2557:6): [True: 4.44k, False: 0]
  ------------------
 2558|  4.44k|    struct cf_call_data save;
 2559|       |
 2560|  4.44k|    CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  670|  4.44k|  do { \
  |  |  671|  4.44k|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  120|  4.44k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  672|  4.44k|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  4.44k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  673|  4.44k|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  120|  4.44k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  674|  4.44k|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  120|  4.44k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  866|  4.44k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  675|  4.44k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (675:11): [Folded, False: 4.44k]
  |  |  ------------------
  ------------------
  |  Branch (2560:5): [True: 4.44k, False: 0]
  |  Branch (2560:5): [True: 0, False: 0]
  |  Branch (2560:5): [True: 4.44k, False: 0]
  |  Branch (2560:5): [True: 0, False: 0]
  ------------------
 2561|  4.44k|    cf_h2_ctx_close(ctx);
 2562|  4.44k|    CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  678|  4.44k|  do { \
  |  |  679|  4.44k|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1081|  4.44k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  680|  4.44k|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  4.44k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  681|  4.44k|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  120|  4.44k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  682|  4.44k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (682:11): [Folded, False: 4.44k]
  |  |  ------------------
  ------------------
  |  Branch (2562:5): [True: 0, False: 4.44k]
  |  Branch (2562:5): [True: 4.44k, False: 0]
  |  Branch (2562:5): [True: 4.44k, False: 0]
  |  Branch (2562:5): [True: 0, False: 0]
  |  Branch (2562:5): [True: 4.44k, False: 0]
  |  Branch (2562:5): [True: 0, False: 0]
  ------------------
 2563|  4.44k|    cf->connected = FALSE;
  ------------------
  |  | 1058|  4.44k|#define FALSE false
  ------------------
 2564|  4.44k|  }
 2565|  4.44k|  if(cf->next)
  ------------------
  |  Branch (2565:6): [True: 4.44k, False: 0]
  ------------------
 2566|  4.44k|    cf->next->cft->do_close(cf->next, data);
 2567|  4.44k|}
http2.c:cf_h2_ctx_close:
  203|  4.44k|{
  204|  4.44k|  if(ctx->h2) {
  ------------------
  |  Branch (204:6): [True: 4.44k, False: 0]
  ------------------
  205|  4.44k|    nghttp2_session_del(ctx->h2);
  206|       |    ctx->h2 = NULL;
  207|  4.44k|  }
  208|  4.44k|}
http2.c:cf_h2_shutdown:
 2582|  1.39k|{
 2583|  1.39k|  struct cf_h2_ctx *ctx = cf->ctx;
 2584|  1.39k|  struct cf_call_data save;
 2585|  1.39k|  CURLcode result;
 2586|  1.39k|  int rv;
 2587|       |
 2588|  1.39k|  if(!cf->connected || !ctx->h2 || cf->shutdown || ctx->conn_closed) {
  ------------------
  |  Branch (2588:6): [True: 0, False: 1.39k]
  |  Branch (2588:24): [True: 0, False: 1.39k]
  |  Branch (2588:36): [True: 0, False: 1.39k]
  |  Branch (2588:52): [True: 0, False: 1.39k]
  ------------------
 2589|      0|    *done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2590|      0|    return CURLE_OK;
 2591|      0|  }
 2592|       |
 2593|  1.39k|  CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  670|  1.39k|  do { \
  |  |  671|  1.39k|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  120|  1.39k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  672|  1.39k|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  1.39k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  673|  1.39k|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  120|  1.39k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  674|  1.39k|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  120|  1.39k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  866|  1.39k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  675|  1.39k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (675:11): [Folded, False: 1.39k]
  |  |  ------------------
  ------------------
  |  Branch (2593:3): [True: 1.39k, False: 0]
  |  Branch (2593:3): [True: 0, False: 0]
  |  Branch (2593:3): [True: 1.39k, False: 0]
  |  Branch (2593:3): [True: 0, False: 0]
  ------------------
 2594|       |
 2595|  1.39k|  if(!ctx->sent_goaway) {
  ------------------
  |  Branch (2595:6): [True: 1.39k, False: 0]
  ------------------
 2596|  1.39k|    ctx->sent_goaway = TRUE;
  ------------------
  |  | 1055|  1.39k|#define TRUE true
  ------------------
 2597|  1.39k|    rv = nghttp2_submit_goaway(ctx->h2, NGHTTP2_FLAG_NONE,
 2598|  1.39k|                               ctx->local_max_sid, 0,
 2599|  1.39k|                               (const uint8_t *)"shutdown",
 2600|  1.39k|                               sizeof("shutdown"));
 2601|  1.39k|    if(rv) {
  ------------------
  |  Branch (2601:8): [True: 0, False: 1.39k]
  ------------------
 2602|      0|      failf(data, "nghttp2_submit_goaway() failed: %s(%d)",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2603|      0|            nghttp2_strerror(rv), rv);
 2604|      0|      result = CURLE_SEND_ERROR;
 2605|      0|      goto out;
 2606|      0|    }
 2607|  1.39k|  }
 2608|       |  /* GOAWAY submitted, process egress and ingress until nghttp2 is done. */
 2609|  1.39k|  result = CURLE_OK;
 2610|  1.39k|  if(nghttp2_session_want_write(ctx->h2) ||
  ------------------
  |  Branch (2610:6): [True: 1.12k, False: 263]
  ------------------
 2611|    263|     !Curl_bufq_is_empty(&ctx->outbufq))
  ------------------
  |  Branch (2611:6): [True: 0, False: 263]
  ------------------
 2612|  1.12k|    result = h2_progress_egress(cf, data);
 2613|  1.39k|  if(!result && nghttp2_session_want_read(ctx->h2))
  ------------------
  |  Branch (2613:6): [True: 1.39k, False: 0]
  |  Branch (2613:17): [True: 0, False: 1.39k]
  ------------------
 2614|      0|    result = h2_progress_ingress(cf, data, 0);
 2615|       |
 2616|  1.39k|  if(result == CURLE_AGAIN)
  ------------------
  |  Branch (2616:6): [True: 0, False: 1.39k]
  ------------------
 2617|      0|    result = CURLE_OK;
 2618|       |
 2619|  1.39k|  *done = (ctx->conn_closed ||
  ------------------
  |  Branch (2619:12): [True: 0, False: 1.39k]
  ------------------
 2620|  1.39k|           (!result && !nghttp2_session_want_write(ctx->h2) &&
  ------------------
  |  Branch (2620:13): [True: 1.39k, False: 0]
  |  Branch (2620:24): [True: 1.39k, False: 0]
  ------------------
 2621|  1.39k|            !nghttp2_session_want_read(ctx->h2) &&
  ------------------
  |  Branch (2621:13): [True: 1.39k, False: 0]
  ------------------
 2622|  1.39k|            Curl_bufq_is_empty(&ctx->outbufq)));
  ------------------
  |  Branch (2622:13): [True: 1.39k, False: 0]
  ------------------
 2623|       |
 2624|  1.39k|out:
 2625|  1.39k|  CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  678|  1.39k|  do { \
  |  |  679|  1.39k|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1081|  1.39k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  680|  1.39k|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  1.39k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  681|  1.39k|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  120|  1.39k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  682|  1.39k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (682:11): [Folded, False: 1.39k]
  |  |  ------------------
  ------------------
  |  Branch (2625:3): [True: 0, False: 1.39k]
  |  Branch (2625:3): [True: 1.39k, False: 0]
  |  Branch (2625:3): [True: 1.39k, False: 0]
  |  Branch (2625:3): [True: 0, False: 0]
  |  Branch (2625:3): [True: 1.39k, False: 0]
  |  Branch (2625:3): [True: 0, False: 0]
  ------------------
 2626|  1.39k|  cf->shutdown = (result || *done);
  ------------------
  |  Branch (2626:19): [True: 0, False: 1.39k]
  |  Branch (2626:29): [True: 1.39k, False: 0]
  ------------------
 2627|  1.39k|  return result;
 2628|  1.39k|}
http2.c:cf_h2_adjust_pollset:
 2339|  3.25M|{
 2340|  3.25M|  struct cf_h2_ctx *ctx = cf->ctx;
 2341|  3.25M|  struct cf_call_data save;
 2342|  3.25M|  curl_socket_t sock;
 2343|  3.25M|  bool want_recv, want_send;
 2344|  3.25M|  CURLcode result = CURLE_OK;
 2345|       |
 2346|  3.25M|  if(!ctx->h2)
  ------------------
  |  Branch (2346:6): [True: 0, False: 3.25M]
  ------------------
 2347|      0|    return CURLE_OK;
 2348|       |
 2349|  3.25M|  sock = Curl_conn_cf_get_socket(cf, data);
 2350|  3.25M|  Curl_pollset_check(data, ps, sock, &want_recv, &want_send);
 2351|  3.25M|  if(want_recv || want_send) {
  ------------------
  |  Branch (2351:6): [True: 3.25M, False: 0]
  |  Branch (2351:19): [True: 0, False: 0]
  ------------------
 2352|  3.25M|    struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data);
  ------------------
  |  |  265|  3.25M|  ((struct h2_stream_ctx *)(                                             \
  |  |  266|  3.25M|    (data) ? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL))
  |  |  ------------------
  |  |  |  Branch (266:5): [True: 3.25M, False: 0]
  |  |  ------------------
  ------------------
 2353|  3.25M|    bool c_exhaust, s_exhaust;
 2354|       |
 2355|  3.25M|    CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  670|  3.25M|  do { \
  |  |  671|  3.25M|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  120|  3.25M|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  672|  3.25M|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  3.25M|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  673|  3.25M|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  120|  3.25M|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  674|  3.25M|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  120|  3.25M|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  866|  3.25M|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  675|  3.25M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (675:11): [Folded, False: 3.25M]
  |  |  ------------------
  ------------------
  |  Branch (2355:5): [True: 3.25M, False: 0]
  |  Branch (2355:5): [True: 0, False: 0]
  |  Branch (2355:5): [True: 3.25M, False: 0]
  |  Branch (2355:5): [True: 0, False: 0]
  ------------------
 2356|  3.25M|    c_exhaust = want_send && !nghttp2_session_get_remote_window_size(ctx->h2);
  ------------------
  |  Branch (2356:17): [True: 3.25M, False: 151]
  |  Branch (2356:30): [True: 572k, False: 2.68M]
  ------------------
 2357|  3.25M|    s_exhaust = want_send && stream && stream->id >= 0 &&
  ------------------
  |  Branch (2357:17): [True: 3.25M, False: 151]
  |  Branch (2357:30): [True: 3.25M, False: 0]
  |  Branch (2357:40): [True: 3.25M, False: 0]
  ------------------
 2358|  3.25M|                !nghttp2_session_get_stream_remote_window_size(ctx->h2,
  ------------------
  |  Branch (2358:17): [True: 38, False: 3.25M]
  ------------------
 2359|  3.25M|                                                               stream->id);
 2360|  3.25M|    want_recv = (want_recv || c_exhaust || s_exhaust);
  ------------------
  |  Branch (2360:18): [True: 3.25M, False: 0]
  |  Branch (2360:31): [True: 0, False: 0]
  |  Branch (2360:44): [True: 0, False: 0]
  ------------------
 2361|  3.25M|    want_send = (!s_exhaust && want_send) ||
  ------------------
  |  Branch (2361:18): [True: 3.25M, False: 38]
  |  Branch (2361:32): [True: 3.25M, False: 151]
  ------------------
 2362|    189|                (!c_exhaust && nghttp2_session_want_write(ctx->h2)) ||
  ------------------
  |  Branch (2362:18): [True: 183, False: 6]
  |  Branch (2362:32): [True: 0, False: 183]
  ------------------
 2363|    189|                !Curl_bufq_is_empty(&ctx->outbufq);
  ------------------
  |  Branch (2363:17): [True: 0, False: 189]
  ------------------
 2364|       |
 2365|  3.25M|    result = Curl_pollset_set(data, ps, sock, want_recv, want_send);
 2366|  3.25M|    CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  678|  3.25M|  do { \
  |  |  679|  3.25M|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1081|  3.25M|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  680|  3.25M|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  3.25M|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  681|  3.25M|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  120|  3.25M|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  682|  3.25M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (682:11): [Folded, False: 3.25M]
  |  |  ------------------
  ------------------
  |  Branch (2366:5): [True: 0, False: 3.25M]
  |  Branch (2366:5): [True: 3.25M, False: 0]
  |  Branch (2366:5): [True: 3.25M, False: 0]
  |  Branch (2366:5): [True: 0, False: 0]
  |  Branch (2366:5): [True: 3.25M, False: 0]
  |  Branch (2366:5): [True: 0, False: 0]
  ------------------
 2367|  3.25M|  }
 2368|      0|  else if(ctx->sent_goaway && !cf->shutdown) {
  ------------------
  |  Branch (2368:11): [True: 0, False: 0]
  |  Branch (2368:31): [True: 0, False: 0]
  ------------------
 2369|       |    /* shutdown in progress */
 2370|      0|    CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  670|      0|  do { \
  |  |  671|      0|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  120|      0|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  672|      0|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  673|      0|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  120|      0|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  674|      0|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  120|      0|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  866|      0|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  675|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (675:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2370:5): [True: 0, False: 0]
  |  Branch (2370:5): [True: 0, False: 0]
  |  Branch (2370:5): [True: 0, False: 0]
  |  Branch (2370:5): [True: 0, False: 0]
  ------------------
 2371|      0|    want_send = nghttp2_session_want_write(ctx->h2) ||
  ------------------
  |  Branch (2371:17): [True: 0, False: 0]
  ------------------
 2372|      0|                !Curl_bufq_is_empty(&ctx->outbufq);
  ------------------
  |  Branch (2372:17): [True: 0, False: 0]
  ------------------
 2373|      0|    want_recv = nghttp2_session_want_read(ctx->h2);
 2374|      0|    result = Curl_pollset_set(data, ps, sock, want_recv, want_send);
 2375|      0|    CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  678|      0|  do { \
  |  |  679|      0|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  680|      0|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  681|      0|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  120|      0|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  682|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (682:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2375:5): [True: 0, False: 0]
  |  Branch (2375:5): [True: 0, False: 0]
  |  Branch (2375:5): [True: 0, False: 0]
  |  Branch (2375:5): [True: 0, False: 0]
  |  Branch (2375:5): [True: 0, False: 0]
  |  Branch (2375:5): [True: 0, False: 0]
  ------------------
 2376|      0|  }
 2377|  3.25M|  return result;
 2378|  3.25M|}
http2.c:cf_h2_data_pending:
 2700|  6.51M|{
 2701|  6.51M|  struct cf_h2_ctx *ctx = cf->ctx;
 2702|       |
 2703|  6.51M|  if(ctx && !Curl_bufq_is_empty(&ctx->inbufq))
  ------------------
  |  Branch (2703:6): [True: 6.51M, False: 0]
  |  Branch (2703:13): [True: 0, False: 6.51M]
  ------------------
 2704|      0|    return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2705|  6.51M|  return cf->next ? cf->next->cft->has_data_pending(cf->next, data) : FALSE;
  ------------------
  |  | 1058|  6.51M|#define FALSE false
  ------------------
  |  Branch (2705:10): [True: 6.51M, False: 0]
  ------------------
 2706|  6.51M|}
http2.c:cf_h2_send:
 2207|   277k|{
 2208|   277k|  struct cf_h2_ctx *ctx = cf->ctx;
 2209|   277k|  struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data);
  ------------------
  |  |  265|   277k|  ((struct h2_stream_ctx *)(                                             \
  |  |  266|   277k|    (data) ? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL))
  |  |  ------------------
  |  |  |  Branch (266:5): [True: 277k, False: 0]
  |  |  ------------------
  ------------------
 2210|   277k|  struct cf_call_data save;
 2211|   277k|  CURLcode result = CURLE_OK, r2;
 2212|       |
 2213|   277k|  CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  670|   277k|  do { \
  |  |  671|   277k|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  120|   277k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  672|   277k|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|   277k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  673|   277k|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  120|   277k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  674|   277k|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  120|   277k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  866|   277k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  675|   277k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (675:11): [Folded, False: 277k]
  |  |  ------------------
  ------------------
  |  Branch (2213:3): [True: 277k, False: 0]
  |  Branch (2213:3): [True: 0, False: 0]
  |  Branch (2213:3): [True: 277k, False: 0]
  |  Branch (2213:3): [True: 0, False: 0]
  ------------------
 2214|   277k|  *pnwritten = 0;
 2215|       |
 2216|   277k|  if(!stream || stream->id == -1) {
  ------------------
  |  Branch (2216:6): [True: 4.43k, False: 272k]
  |  Branch (2216:17): [True: 0, False: 272k]
  ------------------
 2217|  4.43k|    result = h2_submit(&stream, cf, data, buf, len, eos, pnwritten);
 2218|  4.43k|    if(result)
  ------------------
  |  Branch (2218:8): [True: 28, False: 4.40k]
  ------------------
 2219|     28|      goto out;
 2220|  4.40k|    DEBUGASSERT(stream);
  ------------------
  |  | 1081|  4.40k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2220:5): [True: 0, False: 4.40k]
  |  Branch (2220:5): [True: 4.40k, False: 0]
  ------------------
 2221|  4.40k|  }
 2222|   272k|  else if(stream->body_eos) {
  ------------------
  |  Branch (2222:11): [True: 0, False: 272k]
  ------------------
 2223|       |    /* We already wrote this, but CURLE_AGAIN-ed the call due to not
 2224|       |     * being able to flush stream->sendbuf. Make a 0-length write
 2225|       |     * to trigger flushing again.
 2226|       |     * If this works, we report to have written `len` bytes. */
 2227|      0|    size_t n;
 2228|      0|    DEBUGASSERT(eos);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2228:5): [True: 0, False: 0]
  |  Branch (2228:5): [True: 0, False: 0]
  ------------------
 2229|      0|    result = cf_h2_body_send(cf, data, stream, buf, 0, eos, &n);
 2230|      0|    CURL_TRC_CF(data, cf, "[%d] cf_body_send last CHUNK -> %d, %zu, eos=%d",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2231|      0|                stream->id, result, n, eos);
 2232|      0|    if(result)
  ------------------
  |  Branch (2232:8): [True: 0, False: 0]
  ------------------
 2233|      0|      goto out;
 2234|      0|    *pnwritten = len;
 2235|      0|  }
 2236|   272k|  else {
 2237|   272k|    result = cf_h2_body_send(cf, data, stream, buf, len, eos, pnwritten);
 2238|   272k|    CURL_TRC_CF(data, cf, "[%d] cf_body_send(len=%zu) -> %d, %zu, eos=%d",
  ------------------
  |  |  153|   272k|  do {                                          \
  |  |  154|   272k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|   272k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|   545k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 272k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 272k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|   545k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|   272k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|   272k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|   272k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 272k]
  |  |  ------------------
  ------------------
 2239|   272k|                stream->id, len, result, *pnwritten, eos);
 2240|   272k|  }
 2241|       |
 2242|       |  /* Call the nghttp2 send loop and flush to write ALL buffered data,
 2243|       |   * headers and/or request body completely out to the network */
 2244|   277k|  r2 = h2_progress_egress(cf, data);
 2245|       |
 2246|       |  /* if the stream has been closed in egress handling (nghttp2 does that
 2247|       |   * when it does not like the headers, for example */
 2248|   277k|  if(stream && stream->closed) {
  ------------------
  |  Branch (2248:6): [True: 277k, False: 0]
  |  Branch (2248:16): [True: 2, False: 277k]
  ------------------
 2249|      2|    infof(data, "stream %d closed", stream->id);
  ------------------
  |  |  143|      2|  do {                               \
  |  |  144|      2|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      2|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 2, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  320|      2|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      2|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      2|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 2]
  |  |  ------------------
  ------------------
 2250|      2|    result = CURLE_SEND_ERROR;
 2251|      2|    goto out;
 2252|      2|  }
 2253|   277k|  else if(r2 && (r2 != CURLE_AGAIN)) {
  ------------------
  |  Branch (2253:11): [True: 0, False: 277k]
  |  Branch (2253:17): [True: 0, False: 0]
  ------------------
 2254|      0|    result = r2;
 2255|      0|    goto out;
 2256|      0|  }
 2257|       |
 2258|   277k|  if(should_close_session(ctx)) {
  ------------------
  |  Branch (2258:6): [True: 12, False: 277k]
  ------------------
 2259|       |    /* nghttp2 thinks this session is done. If the stream has not been
 2260|       |     * closed, this is an error state for out transfer */
 2261|     12|    if(stream && stream->closed) {
  ------------------
  |  Branch (2261:8): [True: 12, False: 0]
  |  Branch (2261:18): [True: 0, False: 12]
  ------------------
 2262|      0|      result = http2_handle_stream_close(cf, data, stream, pnwritten);
 2263|      0|    }
 2264|     12|    else {
 2265|     12|      CURL_TRC_CF(data, cf, "send: nothing to do in this session");
  ------------------
  |  |  153|     12|  do {                                          \
  |  |  154|     12|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     12|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     24|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 12, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 12]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     24|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     12|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     12|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     12|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 12]
  |  |  ------------------
  ------------------
 2266|     12|      result = CURLE_HTTP2;
 2267|     12|    }
 2268|     12|  }
 2269|       |
 2270|   277k|out:
 2271|   277k|  if(stream) {
  ------------------
  |  Branch (2271:6): [True: 277k, False: 0]
  ------------------
 2272|   277k|    CURL_TRC_CF(data, cf, "[%d] cf_send(len=%zu) -> %d, %zu, "
  ------------------
  |  |  153|   277k|  do {                                          \
  |  |  154|   277k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|   277k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|   554k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 277k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 277k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|   554k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|   277k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|   277k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|   277k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 277k]
  |  |  ------------------
  ------------------
 2273|   277k|                "eos=%d, h2 windows %d-%d (stream-conn), "
 2274|   277k|                "buffers %zu-%zu (stream-conn)",
 2275|   277k|                stream->id, len, result, *pnwritten,
 2276|   277k|                stream->body_eos,
 2277|   277k|                nghttp2_session_get_stream_remote_window_size(
 2278|   277k|                  ctx->h2, stream->id),
 2279|   277k|                nghttp2_session_get_remote_window_size(ctx->h2),
 2280|   277k|                Curl_bufq_len(&stream->sendbuf),
 2281|   277k|                Curl_bufq_len(&ctx->outbufq));
 2282|   277k|  }
 2283|      0|  else {
 2284|      0|    CURL_TRC_CF(data, cf, "cf_send(len=%zu) -> %d, %zu, "
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2285|      0|                "connection-window=%d, nw_send_buffer(%zu)",
 2286|      0|                len, result, *pnwritten,
 2287|      0|                nghttp2_session_get_remote_window_size(ctx->h2),
 2288|      0|                Curl_bufq_len(&ctx->outbufq));
 2289|      0|  }
 2290|   277k|  CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  678|   277k|  do { \
  |  |  679|   277k|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1081|   277k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  680|   277k|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|   277k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  681|   277k|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  120|   277k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  682|   277k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (682:11): [Folded, False: 277k]
  |  |  ------------------
  ------------------
  |  Branch (2290:3): [True: 0, False: 277k]
  |  Branch (2290:3): [True: 277k, False: 0]
  |  Branch (2290:3): [True: 277k, False: 0]
  |  Branch (2290:3): [True: 0, False: 0]
  |  Branch (2290:3): [True: 277k, False: 0]
  |  Branch (2290:3): [True: 0, False: 0]
  ------------------
 2291|   277k|  return result;
 2292|   277k|}
http2.c:h2_submit:
 2074|  4.43k|{
 2075|  4.43k|  struct cf_h2_ctx *ctx = cf->ctx;
 2076|  4.43k|  struct h2_stream_ctx *stream = NULL;
 2077|  4.43k|  struct dynhds h2_headers;
 2078|  4.43k|  nghttp2_nv *nva = NULL;
 2079|  4.43k|  const void *body = NULL;
 2080|  4.43k|  size_t nheader, bodylen;
 2081|  4.43k|  nghttp2_data_provider data_prd;
 2082|  4.43k|  int32_t stream_id;
 2083|  4.43k|  nghttp2_priority_spec pri_spec;
 2084|  4.43k|  size_t nwritten;
 2085|  4.43k|  CURLcode result = CURLE_OK;
 2086|  4.43k|  uint32_t initial_win_size;
 2087|       |
 2088|  4.43k|  *pnwritten = 0;
 2089|  4.43k|  Curl_dynhds_init(&h2_headers, 0, DYN_HTTP_REQUEST);
  ------------------
  |  |   69|  4.43k|#define DYN_HTTP_REQUEST    (1024 * 1024)
  ------------------
 2090|       |
 2091|  4.43k|  result = http2_data_setup(cf, data, &stream);
 2092|  4.43k|  if(result)
  ------------------
  |  Branch (2092:6): [True: 0, False: 4.43k]
  ------------------
 2093|      0|    goto out;
 2094|       |
 2095|  4.43k|  result = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL,
 2096|  4.43k|                                  !data->state.http_ignorecustom ?
  ------------------
  |  Branch (2096:35): [True: 4.43k, False: 0]
  ------------------
 2097|  4.43k|                                  data->set.str[STRING_CUSTOMREQUEST] : NULL,
 2098|  4.43k|                                  0, &nwritten);
 2099|  4.43k|  if(result)
  ------------------
  |  Branch (2099:6): [True: 28, False: 4.40k]
  ------------------
 2100|     28|    goto out;
 2101|  4.40k|  *pnwritten = nwritten;
 2102|  4.40k|  if(!stream->h1.done) {
  ------------------
  |  Branch (2102:6): [True: 0, False: 4.40k]
  ------------------
 2103|       |    /* need more data */
 2104|      0|    goto out;
 2105|      0|  }
 2106|  4.40k|  DEBUGASSERT(stream->h1.req);
  ------------------
  |  | 1081|  4.40k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2106:3): [True: 0, False: 4.40k]
  |  Branch (2106:3): [True: 4.40k, False: 0]
  ------------------
 2107|       |
 2108|  4.40k|  result = Curl_http_req_to_h2(&h2_headers, stream->h1.req, data);
 2109|  4.40k|  if(result)
  ------------------
  |  Branch (2109:6): [True: 0, False: 4.40k]
  ------------------
 2110|      0|    goto out;
 2111|       |  /* no longer needed */
 2112|  4.40k|  Curl_h1_req_parse_free(&stream->h1);
 2113|       |
 2114|  4.40k|  nva = Curl_dynhds_to_nva(&h2_headers, &nheader);
 2115|  4.40k|  if(!nva) {
  ------------------
  |  Branch (2115:6): [True: 0, False: 4.40k]
  ------------------
 2116|      0|    result = CURLE_OUT_OF_MEMORY;
 2117|      0|    goto out;
 2118|      0|  }
 2119|       |
 2120|  4.40k|  h2_pri_spec(data, &pri_spec);
 2121|  4.40k|  if(!nghttp2_session_check_request_allowed(ctx->h2))
  ------------------
  |  Branch (2121:6): [True: 0, False: 4.40k]
  ------------------
 2122|      0|    CURL_TRC_CF(data, cf, "send request NOT allowed (via nghttp2)");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2123|       |
 2124|       |  /* Check the initial windows size of the transfer (rate-limits?) and
 2125|       |   * send an updated settings on changes from previous value. */
 2126|  4.40k|  initial_win_size = cf_h2_initial_win_size(data);
 2127|  4.40k|  if(initial_win_size != ctx->initial_win_size) {
  ------------------
  |  Branch (2127:6): [True: 0, False: 4.40k]
  ------------------
 2128|      0|    result = cf_h2_update_settings(ctx, initial_win_size);
 2129|      0|    if(result)
  ------------------
  |  Branch (2129:8): [True: 0, False: 0]
  ------------------
 2130|      0|      goto out;
 2131|      0|  }
 2132|       |
 2133|  4.40k|  switch(data->state.httpreq) {
 2134|     85|  case HTTPREQ_POST:
  ------------------
  |  Branch (2134:3): [True: 85, False: 4.32k]
  ------------------
 2135|    187|  case HTTPREQ_POST_FORM:
  ------------------
  |  Branch (2135:3): [True: 102, False: 4.30k]
  ------------------
 2136|    440|  case HTTPREQ_POST_MIME:
  ------------------
  |  Branch (2136:3): [True: 253, False: 4.15k]
  ------------------
 2137|    487|  case HTTPREQ_PUT:
  ------------------
  |  Branch (2137:3): [True: 47, False: 4.35k]
  ------------------
 2138|    487|    data_prd.read_callback = req_body_read_callback;
 2139|    487|    data_prd.source.ptr = NULL;
 2140|    487|    stream_id = nghttp2_submit_request(ctx->h2, &pri_spec, nva, nheader,
 2141|    487|                                       &data_prd, data);
 2142|    487|    break;
 2143|  3.91k|  default:
  ------------------
  |  Branch (2143:3): [True: 3.91k, False: 487]
  ------------------
 2144|  3.91k|    stream_id = nghttp2_submit_request(ctx->h2, &pri_spec, nva, nheader,
 2145|  3.91k|                                       NULL, data);
 2146|  4.40k|  }
 2147|       |
 2148|  4.40k|  if(stream_id < 0) {
  ------------------
  |  Branch (2148:6): [True: 0, False: 4.40k]
  ------------------
 2149|      0|    CURL_TRC_CF(data, cf, "send: nghttp2_submit_request error (%s)%d",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2150|      0|                nghttp2_strerror(stream_id), stream_id);
 2151|      0|    result = CURLE_SEND_ERROR;
 2152|      0|    goto out;
 2153|      0|  }
 2154|       |
 2155|  4.40k|#ifdef CURLVERBOSE
 2156|  4.40k|#define MAX_ACC 60000  /* <64KB to account for some overhead */
 2157|  4.40k|  if(Curl_trc_is_verbose(data)) {
  ------------------
  |  |  319|  4.40k|  ((data) && (data)->set.verbose &&                        \
  |  |  ------------------
  |  |  |  Branch (319:4): [True: 4.40k, False: 0]
  |  |  |  Branch (319:14): [True: 0, False: 4.40k]
  |  |  ------------------
  |  |  320|  4.40k|   (!(data)->state.feat ||                                 \
  |  |  ------------------
  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  ------------------
  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2158|      0|    size_t acc = 0, i;
 2159|       |
 2160|      0|    infof(data, "[HTTP/2] [%d] OPENED stream for %s",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2161|      0|          stream_id, Curl_bufref_ptr(&data->state.url));
 2162|      0|    for(i = 0; i < nheader; ++i) {
  ------------------
  |  Branch (2162:16): [True: 0, False: 0]
  ------------------
 2163|      0|      acc += nva[i].namelen + nva[i].valuelen;
 2164|       |
 2165|      0|      infof(data, "[HTTP/2] [%d] [%.*s: %.*s]", stream_id,
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2166|      0|            (int)nva[i].namelen, nva[i].name,
 2167|      0|            (int)nva[i].valuelen, nva[i].value);
 2168|      0|    }
 2169|       |
 2170|      0|    if(acc > MAX_ACC) {
  ------------------
  |  | 2156|      0|#define MAX_ACC 60000  /* <64KB to account for some overhead */
  ------------------
  |  Branch (2170:8): [True: 0, False: 0]
  ------------------
 2171|      0|      infof(data, "[HTTP/2] Warning: The cumulative length of all "
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2172|      0|            "headers exceeds %d bytes and that could cause the "
 2173|      0|            "stream to be rejected.", MAX_ACC);
 2174|      0|    }
 2175|      0|  }
 2176|  4.40k|#endif
 2177|       |
 2178|  4.40k|  stream->id = stream_id;
 2179|       |
 2180|  4.40k|  body = (const char *)buf + *pnwritten;
 2181|  4.40k|  bodylen = len - *pnwritten;
 2182|       |
 2183|  4.40k|  if(bodylen || eos) {
  ------------------
  |  Branch (2183:6): [True: 791, False: 3.61k]
  |  Branch (2183:17): [True: 3.61k, False: 0]
  ------------------
 2184|  4.40k|    size_t n;
 2185|  4.40k|    result = cf_h2_body_send(cf, data, stream, body, bodylen, eos, &n);
 2186|  4.40k|    if(!result)
  ------------------
  |  Branch (2186:8): [True: 4.40k, False: 0]
  ------------------
 2187|  4.40k|      *pnwritten += n;
 2188|      0|    else if(result == CURLE_AGAIN)
  ------------------
  |  Branch (2188:13): [True: 0, False: 0]
  ------------------
 2189|      0|      result = CURLE_OK;
 2190|      0|    else {
 2191|      0|      result = CURLE_SEND_ERROR;
 2192|      0|    }
 2193|  4.40k|  }
 2194|       |
 2195|  4.43k|out:
 2196|  4.43k|  CURL_TRC_CF(data, cf, "[%d] submit -> %d, %zu",
  ------------------
  |  |  153|  4.43k|  do {                                          \
  |  |  154|  4.43k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  4.43k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  8.86k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 4.43k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4.43k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  8.86k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  4.43k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  4.43k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|  4.43k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 4.43k]
  |  |  ------------------
  ------------------
 2197|  4.43k|              stream ? stream->id : -1, result, *pnwritten);
 2198|       |  curlx_safefree(nva);
  ------------------
  |  | 1327|  4.43k|  do {                      \
  |  | 1328|  4.43k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  4.43k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  4.43k|    (ptr) = NULL;           \
  |  | 1330|  4.43k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 4.43k]
  |  |  ------------------
  ------------------
 2199|  4.43k|  *pstream = stream;
 2200|  4.43k|  Curl_dynhds_free(&h2_headers);
 2201|  4.43k|  return result;
 2202|  4.40k|}
http2.c:req_body_read_callback:
 1587|    894|{
 1588|    894|  struct Curl_cfilter *cf = userp;
 1589|    894|  struct cf_h2_ctx *ctx = cf->ctx;
 1590|    894|  struct Curl_easy *data_s;
 1591|    894|  struct h2_stream_ctx *stream = NULL;
 1592|    894|  CURLcode result;
 1593|    894|  ssize_t nread;
 1594|    894|  size_t n;
 1595|    894|  (void)source;
 1596|       |
 1597|    894|  (void)cf;
 1598|    894|  if(!stream_id)
  ------------------
  |  Branch (1598:6): [True: 0, False: 894]
  ------------------
 1599|      0|    return NGHTTP2_ERR_INVALID_ARGUMENT;
 1600|       |
 1601|       |  /* get the stream from the hash based on Stream ID, stream ID zero is for
 1602|       |     connection-oriented stuff */
 1603|    894|  data_s = nghttp2_session_get_stream_user_data(session, stream_id);
 1604|    894|  if(!data_s)
  ------------------
  |  Branch (1604:6): [True: 0, False: 894]
  ------------------
 1605|       |    /* Receiving a Stream ID not in the hash should not happen, this is an
 1606|       |       internal error more than anything else! */
 1607|      0|    return NGHTTP2_ERR_CALLBACK_FAILURE;
 1608|       |
 1609|    894|  stream = H2_STREAM_CTX(ctx, data_s);
  ------------------
  |  |  265|    894|  ((struct h2_stream_ctx *)(                                             \
  |  |  266|    894|    (data) ? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL))
  |  |  ------------------
  |  |  |  Branch (266:5): [True: 894, False: 0]
  |  |  ------------------
  ------------------
 1610|    894|  if(!stream)
  ------------------
  |  Branch (1610:6): [True: 0, False: 894]
  ------------------
 1611|      0|    return NGHTTP2_ERR_CALLBACK_FAILURE;
 1612|       |
 1613|    894|  result = Curl_bufq_read(&stream->sendbuf, buf, length, &n);
 1614|    894|  if(result) {
  ------------------
  |  Branch (1614:6): [True: 132, False: 762]
  ------------------
 1615|    132|    if(result != CURLE_AGAIN)
  ------------------
  |  Branch (1615:8): [True: 0, False: 132]
  ------------------
 1616|      0|      return NGHTTP2_ERR_CALLBACK_FAILURE;
 1617|    132|    nread = 0;
 1618|    132|  }
 1619|    762|  else
 1620|    762|    nread = (ssize_t)n;
 1621|       |
 1622|    894|  CURL_TRC_CF(data_s, cf, "[%d] req_body_read(len=%zu) eos=%d -> %zd, %d",
  ------------------
  |  |  153|    894|  do {                                          \
  |  |  154|    894|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    894|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  1.78k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 894, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 894]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  1.78k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    894|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    894|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    894|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 894]
  |  |  ------------------
  ------------------
 1623|    894|              stream_id, length, stream->body_eos, nread, result);
 1624|       |
 1625|    894|  if(stream->body_eos && Curl_bufq_is_empty(&stream->sendbuf)) {
  ------------------
  |  Branch (1625:6): [True: 467, False: 427]
  |  Branch (1625:26): [True: 405, False: 62]
  ------------------
 1626|    405|    *data_flags = NGHTTP2_DATA_FLAG_EOF;
 1627|    405|    return nread;
 1628|    405|  }
 1629|    489|  return (nread == 0) ? NGHTTP2_ERR_DEFERRED : nread;
  ------------------
  |  Branch (1629:10): [True: 91, False: 398]
  ------------------
 1630|    894|}
http2.c:cf_h2_body_send:
 2029|   277k|{
 2030|   277k|  struct cf_h2_ctx *ctx = cf->ctx;
 2031|   277k|  CURLcode result;
 2032|       |
 2033|   277k|  *pnwritten = 0;
 2034|   277k|  if(stream->closed) {
  ------------------
  |  Branch (2034:6): [True: 0, False: 277k]
  ------------------
 2035|      0|    if(stream->resp_hds_complete) {
  ------------------
  |  Branch (2035:8): [True: 0, False: 0]
  ------------------
 2036|       |      /* Server decided to close the stream after having sent us a final
 2037|       |       * response. This is valid if it is not interested in the request
 2038|       |       * body. This happens on 30x or 40x responses.
 2039|       |       * We silently discard the data sent, since this is not a transport
 2040|       |       * error situation. */
 2041|      0|      CURL_TRC_CF(data, cf, "[%d] discarding data"
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2042|      0|                  "on closed stream with response", stream->id);
 2043|      0|      if(eos)
  ------------------
  |  Branch (2043:10): [True: 0, False: 0]
  ------------------
 2044|      0|        stream->body_eos = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2045|      0|      *pnwritten = blen;
 2046|      0|      return CURLE_OK;
 2047|      0|    }
 2048|       |    /* Server closed before we got a response, this is an error */
 2049|      0|    infof(data, "stream %d closed", stream->id);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2050|      0|    return CURLE_SEND_ERROR;
 2051|      0|  }
 2052|       |
 2053|   277k|  result = Curl_bufq_write(&stream->sendbuf, buf, blen, pnwritten);
 2054|   277k|  if(result)
  ------------------
  |  Branch (2054:6): [True: 272k, False: 4.48k]
  ------------------
 2055|   272k|    return result;
 2056|       |
 2057|  4.48k|  if(eos && (blen == *pnwritten))
  ------------------
  |  Branch (2057:6): [True: 4.37k, False: 110]
  |  Branch (2057:13): [True: 4.35k, False: 13]
  ------------------
 2058|  4.35k|    stream->body_eos = TRUE;
  ------------------
  |  | 1055|  4.35k|#define TRUE true
  ------------------
 2059|       |
 2060|  4.48k|  if(eos || !Curl_bufq_is_empty(&stream->sendbuf)) {
  ------------------
  |  Branch (2060:6): [True: 4.37k, False: 110]
  |  Branch (2060:13): [True: 110, False: 0]
  ------------------
 2061|       |    /* resume the potentially suspended stream */
 2062|  4.48k|    int rv = nghttp2_session_resume_data(ctx->h2, stream->id);
 2063|  4.48k|    if(nghttp2_is_fatal(rv))
  ------------------
  |  Branch (2063:8): [True: 0, False: 4.48k]
  ------------------
 2064|      0|      return CURLE_SEND_ERROR;
 2065|  4.48k|  }
 2066|       |
 2067|  4.48k|  return CURLE_OK;
 2068|  4.48k|}
http2.c:http2_handle_stream_close:
 1691|  1.04k|{
 1692|  1.04k|  CURLcode result;
 1693|       |
 1694|  1.04k|  *pnlen = 0;
 1695|  1.04k|  if(stream->reset) {
  ------------------
  |  Branch (1695:6): [True: 1.01k, False: 29]
  ------------------
 1696|  1.01k|    if(stream->error == NGHTTP2_REFUSED_STREAM) {
  ------------------
  |  Branch (1696:8): [True: 330, False: 682]
  ------------------
 1697|    330|      infof(data, "HTTP/2 stream %d refused by server, try again on a new "
  ------------------
  |  |  143|    330|  do {                               \
  |  |  144|    330|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    330|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 330, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 330]
  |  |  |  |  ------------------
  |  |  |  |  320|    330|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    330|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    330|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 330]
  |  |  ------------------
  ------------------
 1698|    330|                  "connection", stream->id);
 1699|    330|      connclose(cf->conn, "REFUSED_STREAM"); /* do not use this anymore */
  ------------------
  |  |  103|    330|#define connclose(x, y)   Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
  |  |  ------------------
  |  |  |  |   91|    330|#define CONNCTRL_CONNECTION 1
  |  |  ------------------
  ------------------
 1700|    330|      data->state.refused_stream = TRUE;
  ------------------
  |  | 1055|    330|#define TRUE true
  ------------------
 1701|    330|      return CURLE_RECV_ERROR; /* trigger Curl_retry_request() later */
 1702|    330|    }
 1703|    682|    else if(stream->resp_hds_complete && data->req.no_body) {
  ------------------
  |  Branch (1703:13): [True: 17, False: 665]
  |  Branch (1703:42): [True: 1, False: 16]
  ------------------
 1704|      1|      CURL_TRC_CF(data, cf, "[%d] error after response headers, but we did "
  ------------------
  |  |  153|      1|  do {                                          \
  |  |  154|      1|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      1|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      2|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 1, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      2|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      1|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      1|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      1|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1]
  |  |  ------------------
  ------------------
 1705|      1|                  "not want a body anyway, ignore: %s (err %u)",
 1706|      1|                  stream->id, nghttp2_http2_strerror(stream->error),
 1707|      1|                  stream->error);
 1708|      1|      stream->close_handled = TRUE;
  ------------------
  |  | 1055|      1|#define TRUE true
  ------------------
 1709|      1|      return CURLE_OK;
 1710|      1|    }
 1711|    681|    failf(data, "HTTP/2 stream %d reset by %s (error 0x%x %s)",
  ------------------
  |  |   62|    681|#define failf Curl_failf
  ------------------
 1712|    681|          stream->id, stream->reset_by_server ? "server" : "curl",
  ------------------
  |  Branch (1712:23): [True: 135, False: 546]
  ------------------
 1713|    681|          stream->error, nghttp2_http2_strerror(stream->error));
 1714|    681|    return stream->error ? CURLE_HTTP2_STREAM :
  ------------------
  |  Branch (1714:12): [True: 679, False: 2]
  ------------------
 1715|    681|           (data->req.bytecount ? CURLE_PARTIAL_FILE : CURLE_HTTP2);
  ------------------
  |  Branch (1715:13): [True: 0, False: 2]
  ------------------
 1716|  1.01k|  }
 1717|     29|  else if(!stream->bodystarted) {
  ------------------
  |  Branch (1717:11): [True: 1, False: 28]
  ------------------
 1718|      1|    failf(data, "HTTP/2 stream %d was closed cleanly, but before getting "
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
 1719|      1|          "all response header fields, treated as error", stream->id);
 1720|      1|    return CURLE_HTTP2_STREAM;
 1721|      1|  }
 1722|       |
 1723|     28|  if(Curl_dynhds_count(&stream->resp_trailers)) {
  ------------------
  |  Branch (1723:6): [True: 2, False: 26]
  ------------------
 1724|      2|    struct dynhds_entry *e;
 1725|      2|    struct dynbuf dbuf;
 1726|      2|    size_t i;
 1727|       |
 1728|      2|    result = CURLE_OK;
 1729|      2|    curlx_dyn_init(&dbuf, DYN_TRAILERS);
  ------------------
  |  |   72|      2|#define DYN_TRAILERS        (64 * 1024)
  ------------------
 1730|      7|    for(i = 0; i < Curl_dynhds_count(&stream->resp_trailers); ++i) {
  ------------------
  |  Branch (1730:16): [True: 5, False: 2]
  ------------------
 1731|      5|      e = Curl_dynhds_getn(&stream->resp_trailers, i);
 1732|      5|      if(!e)
  ------------------
  |  Branch (1732:10): [True: 0, False: 5]
  ------------------
 1733|      0|        break;
 1734|      5|      curlx_dyn_reset(&dbuf);
 1735|      5|      result = curlx_dyn_addf(&dbuf, "%.*s: %.*s\x0d\x0a",
 1736|      5|                              (int)e->namelen, e->name,
 1737|      5|                              (int)e->valuelen, e->value);
 1738|      5|      if(result)
  ------------------
  |  Branch (1738:10): [True: 0, False: 5]
  ------------------
 1739|      0|        break;
 1740|      5|      Curl_debug(data, CURLINFO_HEADER_IN, curlx_dyn_ptr(&dbuf),
 1741|      5|                 curlx_dyn_len(&dbuf));
 1742|      5|      result = Curl_client_write(data,
 1743|      5|                                 CLIENTWRITE_HEADER | CLIENTWRITE_TRAILER,
  ------------------
  |  |   44|      5|#define CLIENTWRITE_HEADER  (1 << 2) /* meta information, HEADER */
  ------------------
                                               CLIENTWRITE_HEADER | CLIENTWRITE_TRAILER,
  ------------------
  |  |   48|      5|#define CLIENTWRITE_TRAILER (1 << 6) /* a trailer HEADER */
  ------------------
 1744|      5|                                 curlx_dyn_ptr(&dbuf), curlx_dyn_len(&dbuf));
 1745|      5|      if(result)
  ------------------
  |  Branch (1745:10): [True: 0, False: 5]
  ------------------
 1746|      0|        break;
 1747|      5|    }
 1748|      2|    curlx_dyn_free(&dbuf);
 1749|      2|    if(result)
  ------------------
  |  Branch (1749:8): [True: 0, False: 2]
  ------------------
 1750|      0|      goto out;
 1751|      2|  }
 1752|       |
 1753|     28|  stream->close_handled = TRUE;
  ------------------
  |  | 1055|     28|#define TRUE true
  ------------------
 1754|     28|  result = CURLE_OK;
 1755|       |
 1756|     28|out:
 1757|     28|  CURL_TRC_CF(data, cf, "handle_stream_close -> %d, %zu", result, *pnlen);
  ------------------
  |  |  153|     28|  do {                                          \
  |  |  154|     28|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     28|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     56|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 28, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 28]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     56|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     28|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     28|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     28|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 28]
  |  |  ------------------
  ------------------
 1758|     28|  return result;
 1759|     28|}
http2.c:cf_h2_recv:
 1951|  3.26M|{
 1952|  3.26M|  struct cf_h2_ctx *ctx = cf->ctx;
 1953|  3.26M|  struct h2_stream_ctx *stream;
 1954|  3.26M|  CURLcode result, r2;
 1955|  3.26M|  struct cf_call_data save;
 1956|       |
 1957|  3.26M|  if(!data)
  ------------------
  |  Branch (1957:6): [True: 0, False: 3.26M]
  ------------------
 1958|      0|    return CURLE_HTTP2;
 1959|       |
 1960|  3.26M|  stream = H2_STREAM_CTX(ctx, data);
  ------------------
  |  |  265|  3.26M|  ((struct h2_stream_ctx *)(                                             \
  |  |  266|  3.26M|    (data) ? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL))
  |  |  ------------------
  |  |  |  Branch (266:5): [True: 3.26M, False: 0]
  |  |  ------------------
  ------------------
 1961|       |
 1962|  3.26M|  *pnread = 0;
 1963|  3.26M|  if(!stream) {
  ------------------
  |  Branch (1963:6): [True: 0, False: 3.26M]
  ------------------
 1964|       |    /* Abnormal call sequence: either this transfer has never opened a stream
 1965|       |     * (unlikely) or the transfer has been done, cleaned up its resources, but
 1966|       |     * a read() is called anyway. It is not clear what the calling sequence
 1967|       |     * is for such a case. */
 1968|      0|    failf(data, "http/2 recv on a transfer never opened "
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1969|      0|          "or already cleared, mid=%u", data->mid);
 1970|      0|    return CURLE_HTTP2;
 1971|      0|  }
 1972|       |
 1973|  3.26M|  CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  670|  3.26M|  do { \
  |  |  671|  3.26M|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  120|  3.26M|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  672|  3.26M|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  3.26M|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  673|  3.26M|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  120|  3.26M|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  674|  3.26M|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  120|  3.26M|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  866|  3.26M|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  675|  3.26M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (675:11): [Folded, False: 3.26M]
  |  |  ------------------
  ------------------
  |  Branch (1973:3): [True: 3.26M, False: 0]
  |  Branch (1973:3): [True: 0, False: 0]
  |  Branch (1973:3): [True: 3.26M, False: 0]
  |  Branch (1973:3): [True: 0, False: 0]
  ------------------
 1974|       |
 1975|  3.26M|  result = stream_recv(cf, data, stream, buf, len, pnread);
 1976|  3.26M|  if(result && (result != CURLE_AGAIN))
  ------------------
  |  Branch (1976:6): [True: 3.26M, False: 0]
  |  Branch (1976:16): [True: 16, False: 3.26M]
  ------------------
 1977|     16|    goto out;
 1978|       |
 1979|  3.26M|  if(result) {
  ------------------
  |  Branch (1979:6): [True: 3.26M, False: 0]
  ------------------
 1980|  3.26M|    result = h2_progress_ingress(cf, data, len);
 1981|  3.26M|    if(result)
  ------------------
  |  Branch (1981:8): [True: 594, False: 3.26M]
  ------------------
 1982|    594|      goto out;
 1983|       |
 1984|  3.26M|    result = stream_recv(cf, data, stream, buf, len, pnread);
 1985|  3.26M|  }
 1986|       |
 1987|  3.26M|  if(*pnread > 0) {
  ------------------
  |  Branch (1987:6): [True: 0, False: 3.26M]
  ------------------
 1988|       |    /* Now that we transferred this to the upper layer, we report
 1989|       |     * the actual amount of DATA consumed to the H2 session, so
 1990|       |     * that it adjusts stream flow control */
 1991|      0|    nghttp2_session_consume(ctx->h2, stream->id, *pnread);
 1992|      0|    if(stream->closed) {
  ------------------
  |  Branch (1992:8): [True: 0, False: 0]
  ------------------
 1993|      0|      CURL_TRC_CF(data, cf, "[%d] DRAIN closed stream", stream->id);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1994|      0|      Curl_multi_mark_dirty(data);
 1995|      0|    }
 1996|      0|  }
 1997|       |
 1998|  3.26M|out:
 1999|  3.26M|  r2 = h2_progress_egress(cf, data);
 2000|  3.26M|  if(r2 == CURLE_AGAIN) {
  ------------------
  |  Branch (2000:6): [True: 0, False: 3.26M]
  ------------------
 2001|       |    /* pending data to send, need to be called again. Ideally, we
 2002|       |     * monitor the socket for POLLOUT, but when not SENDING
 2003|       |     * any more, we force processing of the transfer. */
 2004|      0|    if(!CURL_REQ_WANT_SEND(data))
  ------------------
  |  |   39|      0|#define CURL_REQ_WANT_SEND(d)  ((d)->req.io_flags & REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|      0|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  ------------------
  |  Branch (2004:8): [True: 0, False: 0]
  ------------------
 2005|      0|      Curl_multi_mark_dirty(data);
 2006|      0|  }
 2007|  3.26M|  else if(r2) {
  ------------------
  |  Branch (2007:11): [True: 0, False: 3.26M]
  ------------------
 2008|      0|    result = r2;
 2009|      0|  }
 2010|  3.26M|  CURL_TRC_CF(data, cf, "[%d] cf_recv(len=%zu) -> %d, %zu, "
  ------------------
  |  |  153|  3.26M|  do {                                          \
  |  |  154|  3.26M|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  3.26M|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  6.52M|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 3.26M, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 3.26M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  6.52M|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  3.26M|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.26M|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.26M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.26M]
  |  |  ------------------
  ------------------
 2011|  3.26M|              "window=%d/%d, connection %d/%d",
 2012|  3.26M|              stream->id, len, result, *pnread,
 2013|  3.26M|              nghttp2_session_get_stream_effective_recv_data_length(
 2014|  3.26M|                ctx->h2, stream->id),
 2015|  3.26M|              nghttp2_session_get_stream_effective_local_window_size(
 2016|  3.26M|                ctx->h2, stream->id),
 2017|  3.26M|              nghttp2_session_get_local_window_size(ctx->h2),
 2018|  3.26M|              HTTP2_HUGE_WINDOW_SIZE);
 2019|       |
 2020|  3.26M|  CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  678|  3.26M|  do { \
  |  |  679|  3.26M|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1081|  3.26M|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  680|  3.26M|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  3.26M|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  681|  3.26M|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  120|  3.26M|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  682|  3.26M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (682:11): [Folded, False: 3.26M]
  |  |  ------------------
  ------------------
  |  Branch (2020:3): [True: 0, False: 3.26M]
  |  Branch (2020:3): [True: 3.26M, False: 0]
  |  Branch (2020:3): [True: 3.26M, False: 0]
  |  Branch (2020:3): [True: 0, False: 0]
  |  Branch (2020:3): [True: 3.26M, False: 0]
  |  Branch (2020:3): [True: 0, False: 0]
  ------------------
 2021|  3.26M|  return result;
 2022|  3.26M|}
http2.c:stream_recv:
 1838|  6.52M|{
 1839|  6.52M|  struct cf_h2_ctx *ctx = cf->ctx;
 1840|  6.52M|  CURLcode result = CURLE_AGAIN;
 1841|       |
 1842|  6.52M|  (void)buf;
 1843|  6.52M|  (void)len;
 1844|  6.52M|  *pnread = 0;
 1845|       |
 1846|  6.52M|  if(!stream->xfer_result)
  ------------------
  |  Branch (1846:6): [True: 6.52M, False: 132]
  ------------------
 1847|  6.52M|    stream->xfer_result = cf_h2_update_local_win(cf, data, stream);
 1848|       |
 1849|  6.52M|  if(stream->xfer_result) {
  ------------------
  |  Branch (1849:6): [True: 148, False: 6.52M]
  ------------------
 1850|    148|    CURL_TRC_CF(data, cf, "[%d] xfer write failed", stream->id);
  ------------------
  |  |  153|    148|  do {                                          \
  |  |  154|    148|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    148|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    296|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 148, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 148]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    296|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    148|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    148|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    148|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 148]
  |  |  ------------------
  ------------------
 1851|    148|    result = stream->xfer_result;
 1852|    148|  }
 1853|  6.52M|  else if(stream->closed) {
  ------------------
  |  Branch (1853:11): [True: 1.04k, False: 6.52M]
  ------------------
 1854|  1.04k|    CURL_TRC_CF(data, cf, "[%d] returning CLOSE", stream->id);
  ------------------
  |  |  153|  1.04k|  do {                                          \
  |  |  154|  1.04k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  1.04k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  2.08k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 1.04k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  2.08k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  1.04k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.04k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.04k]
  |  |  ------------------
  ------------------
 1855|  1.04k|    result = http2_handle_stream_close(cf, data, stream, pnread);
 1856|  1.04k|  }
 1857|  6.52M|  else if(stream->reset ||
  ------------------
  |  Branch (1857:11): [True: 0, False: 6.52M]
  ------------------
 1858|  6.52M|          (ctx->conn_closed && Curl_bufq_is_empty(&ctx->inbufq)) ||
  ------------------
  |  Branch (1858:12): [True: 2.40k, False: 6.52M]
  |  Branch (1858:32): [True: 2.40k, False: 0]
  ------------------
 1859|  6.52M|          (ctx->rcvd_goaway && ctx->remote_max_sid < stream->id)) {
  ------------------
  |  Branch (1859:12): [True: 422k, False: 6.09M]
  |  Branch (1859:32): [True: 0, False: 422k]
  ------------------
 1860|  2.40k|    CURL_TRC_CF(data, cf, "[%d] returning ERR", stream->id);
  ------------------
  |  |  153|  2.40k|  do {                                          \
  |  |  154|  2.40k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  2.40k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  4.80k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 2.40k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 2.40k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  4.80k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  2.40k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  2.40k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  2.40k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.40k]
  |  |  ------------------
  ------------------
 1861|  2.40k|    result = data->req.bytecount ? CURLE_PARTIAL_FILE : CURLE_HTTP2;
  ------------------
  |  Branch (1861:14): [True: 52, False: 2.34k]
  ------------------
 1862|  2.40k|  }
 1863|       |
 1864|  6.52M|  if(result && (result != CURLE_AGAIN))
  ------------------
  |  Branch (1864:6): [True: 6.52M, False: 29]
  |  Branch (1864:16): [True: 3.56k, False: 6.52M]
  ------------------
 1865|  3.56k|    CURL_TRC_CF(data, cf, "[%d] stream_recv(len=%zu) -> %d, %zu",
  ------------------
  |  |  153|  3.56k|  do {                                          \
  |  |  154|  3.56k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  3.56k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  7.12k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 3.56k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 3.56k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  7.12k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  3.56k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.56k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.56k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.56k]
  |  |  ------------------
  ------------------
 1866|  6.52M|                stream->id, len, result, *pnread);
 1867|  6.52M|  return result;
 1868|  6.52M|}
http2.c:cf_h2_cntrl:
 2666|  2.99M|{
 2667|  2.99M|  CURLcode result = CURLE_OK;
 2668|  2.99M|  struct cf_call_data save;
 2669|       |
 2670|  2.99M|  (void)arg2;
 2671|       |
 2672|  2.99M|  CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  670|  2.99M|  do { \
  |  |  671|  2.99M|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  120|  2.99M|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  672|  2.99M|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  2.99M|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  673|  2.99M|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  120|  2.99M|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  674|  2.99M|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  120|  2.99M|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  866|  2.99M|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  675|  2.99M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (675:11): [Folded, False: 2.99M]
  |  |  ------------------
  ------------------
  |  Branch (2672:3): [True: 2.99M, False: 0]
  |  Branch (2672:3): [True: 0, False: 0]
  |  Branch (2672:3): [True: 2.99M, False: 2]
  |  Branch (2672:3): [True: 2, False: 0]
  ------------------
 2673|  2.99M|  switch(event) {
 2674|      0|  case CF_CTRL_DATA_SETUP:
  ------------------
  |  |  119|      0|#define CF_CTRL_DATA_SETUP              4  /* 0          NULL     first fail */
  ------------------
  |  Branch (2674:3): [True: 0, False: 2.99M]
  ------------------
 2675|      0|    break;
 2676|      0|  case CF_CTRL_DATA_PAUSE:
  ------------------
  |  |  121|      0|#define CF_CTRL_DATA_PAUSE              6  /* on/off     NULL     first fail */
  ------------------
  |  Branch (2676:3): [True: 0, False: 2.99M]
  ------------------
 2677|      0|    result = http2_data_pause(cf, data, (arg1 != 0));
 2678|      0|    break;
 2679|  2.98M|  case CF_CTRL_FLUSH:
  ------------------
  |  |  127|  2.98M|#define CF_CTRL_FLUSH            (256 + 2) /* 0          NULL     first fail */
  ------------------
  |  Branch (2679:3): [True: 2.98M, False: 8.79k]
  ------------------
 2680|  2.98M|    result = cf_h2_flush(cf, data);
 2681|  2.98M|    break;
 2682|  4.44k|  case CF_CTRL_DATA_DONE:
  ------------------
  |  |  122|  4.44k|#define CF_CTRL_DATA_DONE               7  /* premature  NULL     ignored */
  ------------------
  |  Branch (2682:3): [True: 4.44k, False: 2.98M]
  ------------------
 2683|  4.44k|    http2_data_done(cf, data);
 2684|  4.44k|    break;
 2685|      0|  case CF_CTRL_CONN_INFO_UPDATE:
  ------------------
  |  |  125|      0|#define CF_CTRL_CONN_INFO_UPDATE (256 + 0) /* 0          NULL     ignored */
  ------------------
  |  Branch (2685:3): [True: 0, False: 2.99M]
  ------------------
 2686|      0|    if(!cf->sockindex && cf->connected) {
  ------------------
  |  Branch (2686:8): [True: 0, False: 0]
  |  Branch (2686:26): [True: 0, False: 0]
  ------------------
 2687|      0|      cf->conn->httpversion_seen = 20;
 2688|      0|      Curl_conn_set_multiplex(cf->conn);
 2689|      0|    }
 2690|      0|    break;
 2691|  4.34k|  default:
  ------------------
  |  Branch (2691:3): [True: 4.34k, False: 2.98M]
  ------------------
 2692|  4.34k|    break;
 2693|  2.99M|  }
 2694|  2.99M|  CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  678|  2.99M|  do { \
  |  |  679|  2.99M|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1081|  2.99M|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  680|  2.99M|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  2.99M|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  681|  2.99M|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  120|  2.99M|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  682|  2.99M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (682:11): [Folded, False: 2.99M]
  |  |  ------------------
  ------------------
  |  Branch (2694:3): [True: 0, False: 2.99M]
  |  Branch (2694:3): [True: 2.99M, False: 0]
  |  Branch (2694:3): [True: 2.99M, False: 0]
  |  Branch (2694:3): [True: 0, False: 0]
  |  Branch (2694:3): [True: 2.99M, False: 2]
  |  Branch (2694:3): [True: 2, False: 0]
  ------------------
 2695|  2.99M|  return result;
 2696|  2.99M|}
http2.c:cf_h2_flush:
 2296|  2.98M|{
 2297|  2.98M|  struct cf_h2_ctx *ctx = cf->ctx;
 2298|  2.98M|  struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data);
  ------------------
  |  |  265|  2.98M|  ((struct h2_stream_ctx *)(                                             \
  |  |  266|  2.98M|    (data) ? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL))
  |  |  ------------------
  |  |  |  Branch (266:5): [True: 2.98M, False: 0]
  |  |  ------------------
  ------------------
 2299|  2.98M|  struct cf_call_data save;
 2300|  2.98M|  CURLcode result = CURLE_OK;
 2301|       |
 2302|  2.98M|  CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  670|  2.98M|  do { \
  |  |  671|  2.98M|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  120|  2.98M|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  672|  2.98M|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  2.98M|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  673|  2.98M|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  120|  2.98M|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  674|  2.98M|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  120|  2.98M|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  866|  2.98M|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  675|  2.98M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (675:11): [Folded, False: 2.98M]
  |  |  ------------------
  ------------------
  |  Branch (2302:3): [True: 2.98M, False: 0]
  |  Branch (2302:3): [True: 0, False: 0]
  |  Branch (2302:3): [True: 0, False: 2.98M]
  |  Branch (2302:3): [True: 2.98M, False: 0]
  ------------------
 2303|  2.98M|  if(stream && !Curl_bufq_is_empty(&stream->sendbuf)) {
  ------------------
  |  Branch (2303:6): [True: 2.98M, False: 0]
  |  Branch (2303:16): [True: 2.98M, False: 0]
  ------------------
 2304|       |    /* resume the potentially suspended stream */
 2305|  2.98M|    int rv = nghttp2_session_resume_data(ctx->h2, stream->id);
 2306|  2.98M|    if(nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (2306:8): [True: 0, False: 2.98M]
  ------------------
 2307|      0|      result = CURLE_SEND_ERROR;
 2308|      0|      goto out;
 2309|      0|    }
 2310|  2.98M|  }
 2311|       |
 2312|  2.98M|  result = h2_progress_egress(cf, data);
 2313|       |
 2314|  2.98M|out:
 2315|  2.98M|  if(stream) {
  ------------------
  |  Branch (2315:6): [True: 2.98M, False: 0]
  ------------------
 2316|  2.98M|    CURL_TRC_CF(data, cf, "[%d] flush -> %d, "
  ------------------
  |  |  153|  2.98M|  do {                                          \
  |  |  154|  2.98M|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  2.98M|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  5.97M|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 2.98M, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 2.98M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  5.97M|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  2.98M|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  2.98M|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  2.98M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.98M]
  |  |  ------------------
  ------------------
 2317|  2.98M|                "h2 windows %d-%d (stream-conn), "
 2318|  2.98M|                "buffers %zu-%zu (stream-conn)",
 2319|  2.98M|                stream->id, result,
 2320|  2.98M|                nghttp2_session_get_stream_remote_window_size(
 2321|  2.98M|                  ctx->h2, stream->id),
 2322|  2.98M|                nghttp2_session_get_remote_window_size(ctx->h2),
 2323|  2.98M|                Curl_bufq_len(&stream->sendbuf),
 2324|  2.98M|                Curl_bufq_len(&ctx->outbufq));
 2325|  2.98M|  }
 2326|      0|  else {
 2327|      0|    CURL_TRC_CF(data, cf, "flush -> %d, "
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2328|      0|                "connection-window=%d, nw_send_buffer(%zu)",
 2329|      0|                result, nghttp2_session_get_remote_window_size(ctx->h2),
 2330|      0|                Curl_bufq_len(&ctx->outbufq));
 2331|      0|  }
 2332|  2.98M|  CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  678|  2.98M|  do { \
  |  |  679|  2.98M|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1081|  2.98M|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  680|  2.98M|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  2.98M|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  681|  2.98M|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  120|  2.98M|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  682|  2.98M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (682:11): [Folded, False: 2.98M]
  |  |  ------------------
  ------------------
  |  Branch (2332:3): [True: 0, False: 2.98M]
  |  Branch (2332:3): [True: 2.98M, False: 0]
  |  Branch (2332:3): [True: 2.98M, False: 0]
  |  Branch (2332:3): [True: 0, False: 0]
  |  Branch (2332:3): [True: 0, False: 2.98M]
  |  Branch (2332:3): [True: 2.98M, False: 0]
  ------------------
 2333|  2.98M|  return result;
 2334|  2.98M|}
http2.c:cf_h2_query:
 2740|  18.1M|{
 2741|  18.1M|  struct cf_h2_ctx *ctx = cf->ctx;
 2742|  18.1M|  struct cf_call_data save;
 2743|  18.1M|  size_t effective_max;
 2744|       |
 2745|  18.1M|  switch(query) {
 2746|  1.04k|  case CF_QUERY_MAX_CONCURRENT:
  ------------------
  |  |  165|  1.04k|#define CF_QUERY_MAX_CONCURRENT     1  /* number     -        */
  ------------------
  |  Branch (2746:3): [True: 1.04k, False: 18.1M]
  ------------------
 2747|  1.04k|    DEBUGASSERT(pres1);
  ------------------
  |  | 1081|  1.04k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2747:5): [True: 0, False: 1.04k]
  |  Branch (2747:5): [True: 1.04k, False: 0]
  ------------------
 2748|       |
 2749|  1.04k|    CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  670|  1.04k|  do { \
  |  |  671|  1.04k|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  120|  1.04k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  672|  1.04k|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  1.04k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  673|  1.04k|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  120|  1.04k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  674|  1.04k|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  120|  1.04k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  866|  1.04k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  675|  1.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (675:11): [Folded, False: 1.04k]
  |  |  ------------------
  ------------------
  |  Branch (2749:5): [True: 1.04k, False: 0]
  |  Branch (2749:5): [True: 0, False: 0]
  |  Branch (2749:5): [True: 1.04k, False: 0]
  |  Branch (2749:5): [True: 0, False: 0]
  ------------------
 2750|  1.04k|    if(!ctx->h2 || !nghttp2_session_check_request_allowed(ctx->h2)) {
  ------------------
  |  Branch (2750:8): [True: 0, False: 1.04k]
  |  Branch (2750:20): [True: 13, False: 1.03k]
  ------------------
 2751|       |      /* the limit is what we have in use right now */
 2752|     13|      effective_max = cf->conn->attached_xfers;
 2753|     13|    }
 2754|  1.03k|    else {
 2755|  1.03k|      effective_max = ctx->max_concurrent_streams;
 2756|  1.03k|    }
 2757|  1.04k|    *pres1 = (effective_max > INT_MAX) ? INT_MAX : (int)effective_max;
  ------------------
  |  Branch (2757:14): [True: 689, False: 360]
  ------------------
 2758|  1.04k|    CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  678|  1.04k|  do { \
  |  |  679|  1.04k|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1081|  1.04k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  680|  1.04k|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  1.04k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  681|  1.04k|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  120|  1.04k|#define CF_CTX_CALL_DATA(cf) ((struct cf_h2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  682|  1.04k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (682:11): [Folded, False: 1.04k]
  |  |  ------------------
  ------------------
  |  Branch (2758:5): [True: 0, False: 1.04k]
  |  Branch (2758:5): [True: 1.04k, False: 0]
  |  Branch (2758:5): [True: 1.04k, False: 0]
  |  Branch (2758:5): [True: 0, False: 0]
  |  Branch (2758:5): [True: 1.04k, False: 0]
  |  Branch (2758:5): [True: 0, False: 0]
  ------------------
 2759|  1.04k|    return CURLE_OK;
 2760|    680|  case CF_QUERY_STREAM_ERROR: {
  ------------------
  |  |  170|    680|#define CF_QUERY_STREAM_ERROR       6  /* error code - */
  ------------------
  |  Branch (2760:3): [True: 680, False: 18.1M]
  ------------------
 2761|    680|    struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data);
  ------------------
  |  |  265|    680|  ((struct h2_stream_ctx *)(                                             \
  |  |  266|    680|    (data) ? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL))
  |  |  ------------------
  |  |  |  Branch (266:5): [True: 680, False: 0]
  |  |  ------------------
  ------------------
 2762|    680|    *pres1 = stream ? (int)stream->error : 0;
  ------------------
  |  Branch (2762:14): [True: 680, False: 0]
  ------------------
 2763|    680|    return CURLE_OK;
 2764|  1.04k|  }
 2765|  14.9M|  case CF_QUERY_NEED_FLUSH: {
  ------------------
  |  |  171|  14.9M|#define CF_QUERY_NEED_FLUSH         7  /* TRUE/FALSE - */
  ------------------
  |  Branch (2765:3): [True: 14.9M, False: 3.26M]
  ------------------
 2766|  14.9M|    struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data);
  ------------------
  |  |  265|  14.9M|  ((struct h2_stream_ctx *)(                                             \
  |  |  266|  14.9M|    (data) ? Curl_uint32_hash_get(&(ctx)->streams, (data)->mid) : NULL))
  |  |  ------------------
  |  |  |  Branch (266:5): [True: 14.9M, False: 0]
  |  |  ------------------
  ------------------
 2767|  14.9M|    if(!Curl_bufq_is_empty(&ctx->outbufq) ||
  ------------------
  |  Branch (2767:8): [True: 0, False: 14.9M]
  ------------------
 2768|  14.9M|       (stream && !Curl_bufq_is_empty(&stream->sendbuf))) {
  ------------------
  |  Branch (2768:9): [True: 14.9M, False: 358]
  |  Branch (2768:19): [True: 14.9M, False: 450]
  ------------------
 2769|  14.9M|      *pres1 = TRUE;
  ------------------
  |  | 1055|  14.9M|#define TRUE true
  ------------------
 2770|  14.9M|      return CURLE_OK;
 2771|  14.9M|    }
 2772|    808|    break;
 2773|  14.9M|  }
 2774|  5.12k|  case CF_QUERY_HTTP_VERSION:
  ------------------
  |  |  173|  5.12k|#define CF_QUERY_HTTP_VERSION       9  /* number (10/11/20/30)   - */
  ------------------
  |  Branch (2774:3): [True: 5.12k, False: 18.1M]
  ------------------
 2775|  5.12k|    *pres1 = 20;
 2776|  5.12k|    return CURLE_OK;
 2777|  3.25M|  default:
  ------------------
  |  Branch (2777:3): [True: 3.25M, False: 14.9M]
  ------------------
 2778|  3.25M|    break;
 2779|  18.1M|  }
 2780|  3.25M|  return cf->next ?
  ------------------
  |  Branch (2780:10): [True: 3.25M, False: 0]
  ------------------
 2781|  3.25M|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
 2782|  3.25M|    CURLE_UNKNOWN_OPTION;
 2783|  18.1M|}
http2.c:http2_cfilter_add:
 2808|  4.44k|{
 2809|  4.44k|  struct Curl_cfilter *cf = NULL;
 2810|  4.44k|  struct cf_h2_ctx *ctx;
 2811|  4.44k|  CURLcode result = CURLE_OUT_OF_MEMORY;
 2812|       |
 2813|  4.44k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|  4.44k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2813:3): [True: 0, False: 4.44k]
  |  Branch (2813:3): [True: 4.44k, False: 0]
  ------------------
 2814|  4.44k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1480|  4.44k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 2815|  4.44k|  if(!ctx)
  ------------------
  |  Branch (2815:6): [True: 0, False: 4.44k]
  ------------------
 2816|      0|    goto out;
 2817|  4.44k|  cf_h2_ctx_init(ctx, via_h1_upgrade);
 2818|       |
 2819|  4.44k|  result = Curl_cf_create(&cf, &Curl_cft_nghttp2, ctx);
 2820|  4.44k|  if(result)
  ------------------
  |  Branch (2820:6): [True: 0, False: 4.44k]
  ------------------
 2821|      0|    goto out;
 2822|       |
 2823|  4.44k|  ctx = NULL;
 2824|  4.44k|  Curl_conn_cf_add(data, conn, sockindex, cf);
 2825|       |
 2826|  4.44k|out:
 2827|  4.44k|  if(result)
  ------------------
  |  Branch (2827:6): [True: 0, False: 4.44k]
  ------------------
 2828|      0|    cf_h2_ctx_free(ctx);
 2829|  4.44k|  *pcf = result ? NULL : cf;
  ------------------
  |  Branch (2829:10): [True: 0, False: 4.44k]
  ------------------
 2830|  4.44k|  return result;
 2831|  4.44k|}
http2.c:cf_h2_ctx_init:
  178|  4.44k|{
  179|  4.44k|  Curl_bufcp_init(&ctx->stream_bufcp, H2_CHUNK_SIZE, H2_STREAM_POOL_SPARES);
  ------------------
  |  |   61|  4.44k|#define H2_CHUNK_SIZE           (16 * 1024)
  ------------------
                Curl_bufcp_init(&ctx->stream_bufcp, H2_CHUNK_SIZE, H2_STREAM_POOL_SPARES);
  ------------------
  |  |   81|  4.44k|#define H2_STREAM_POOL_SPARES   (H2_CONN_WINDOW_SIZE / H2_CHUNK_SIZE)
  |  |  ------------------
  |  |  |  |   63|  4.44k|#define H2_CONN_WINDOW_SIZE     (10 * 1024 * 1024)
  |  |  ------------------
  |  |               #define H2_STREAM_POOL_SPARES   (H2_CONN_WINDOW_SIZE / H2_CHUNK_SIZE)
  |  |  ------------------
  |  |  |  |   61|  4.44k|#define H2_CHUNK_SIZE           (16 * 1024)
  |  |  ------------------
  ------------------
  180|  4.44k|  Curl_bufq_initp(&ctx->inbufq, &ctx->stream_bufcp, H2_NW_RECV_CHUNKS, 0);
  ------------------
  |  |   65|  4.44k|#define H2_NW_RECV_CHUNKS       (H2_CONN_WINDOW_SIZE / H2_CHUNK_SIZE)
  |  |  ------------------
  |  |  |  |   63|  4.44k|#define H2_CONN_WINDOW_SIZE     (10 * 1024 * 1024)
  |  |  ------------------
  |  |               #define H2_NW_RECV_CHUNKS       (H2_CONN_WINDOW_SIZE / H2_CHUNK_SIZE)
  |  |  ------------------
  |  |  |  |   61|  4.44k|#define H2_CHUNK_SIZE           (16 * 1024)
  |  |  ------------------
  ------------------
  181|  4.44k|  Curl_bufq_initp(&ctx->outbufq, &ctx->stream_bufcp, H2_NW_SEND_CHUNKS, 0);
  ------------------
  |  |   67|  4.44k|#define H2_NW_SEND_CHUNKS       1
  ------------------
  182|  4.44k|  curlx_dyn_init(&ctx->scratch, CURL_MAX_HTTP_HEADER);
  ------------------
  |  |  272|  4.44k|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
  183|  4.44k|  Curl_uint32_hash_init(&ctx->streams, 63, h2_stream_hash_free);
  184|  4.44k|  ctx->remote_max_sid = 2147483647;
  185|  4.44k|  ctx->via_h1_upgrade = via_h1_upgrade;
  186|       |  ctx->initialized = TRUE;
  ------------------
  |  | 1055|  4.44k|#define TRUE true
  ------------------
  187|  4.44k|}
http2.c:h2_stream_hash_free:
  171|  4.43k|{
  172|  4.43k|  (void)id;
  173|  4.43k|  DEBUGASSERT(stream);
  ------------------
  |  | 1081|  4.43k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (173:3): [True: 0, False: 4.43k]
  |  Branch (173:3): [True: 4.43k, False: 0]
  ------------------
  174|  4.43k|  h2_stream_ctx_free((struct h2_stream_ctx *)stream);
  175|  4.43k|}

canon_path:
  689|  2.01k|{
  690|  2.01k|  CURLcode result = CURLE_OK;
  691|       |
  692|  2.01k|  struct Curl_str original_path;
  693|       |
  694|  2.01k|  curlx_str_assign(&original_path, q, len);
  695|       |
  696|       |  /* Normalized path will be either the same or shorter than the original
  697|       |   * path, plus trailing slash */
  698|       |
  699|  2.01k|  if(do_uri_encode)
  ------------------
  |  Branch (699:6): [True: 1.96k, False: 53]
  ------------------
  700|  1.96k|    result = uri_encode_path(&original_path, new_path);
  701|     53|  else
  702|     53|    result = curlx_dyn_addn(new_path, q, len);
  703|       |
  704|  2.01k|  if(!result) {
  ------------------
  |  Branch (704:6): [True: 2.01k, False: 0]
  ------------------
  705|  2.01k|    if(curlx_dyn_len(new_path) == 0)
  ------------------
  |  Branch (705:8): [True: 0, False: 2.01k]
  ------------------
  706|      0|      result = curlx_dyn_add(new_path, "/");
  707|  2.01k|  }
  708|       |
  709|  2.01k|  return result;
  710|  2.01k|}
canon_query:
  715|  2.02k|{
  716|  2.02k|  CURLcode result = CURLE_OK;
  717|       |
  718|  2.02k|  struct dynbuf query_array[MAX_QUERY_COMPONENTS];
  719|  2.02k|  struct pair encoded_query_array[MAX_QUERY_COMPONENTS];
  720|  2.02k|  size_t num_query_components;
  721|  2.02k|  size_t counted_query_components = 0;
  722|  2.02k|  size_t index;
  723|       |
  724|  2.02k|  if(!query)
  ------------------
  |  Branch (724:6): [True: 1.32k, False: 696]
  ------------------
  725|  1.32k|    return result;
  726|       |
  727|    696|  result = split_to_dyn_array(query, &query_array[0], &num_query_components);
  728|    696|  if(result) {
  ------------------
  |  Branch (728:6): [True: 2, False: 694]
  ------------------
  729|      2|    goto fail;
  730|      2|  }
  731|       |
  732|       |  /* Create list of pairs, each pair containing an encoded query
  733|       |   * component */
  734|       |
  735|  5.59k|  for(index = 0; index < num_query_components; index++) {
  ------------------
  |  Branch (735:18): [True: 4.90k, False: 694]
  ------------------
  736|  4.90k|    const char *in_key;
  737|  4.90k|    size_t in_key_len;
  738|  4.90k|    const char *offset;
  739|  4.90k|    size_t query_part_len = curlx_dyn_len(&query_array[index]);
  740|  4.90k|    const char *query_part = curlx_dyn_ptr(&query_array[index]);
  741|       |
  742|  4.90k|    in_key = query_part;
  743|       |
  744|  4.90k|    offset = strchr(query_part, '=');
  745|       |    /* If there is no equals, this key has no value */
  746|  4.90k|    if(!offset) {
  ------------------
  |  Branch (746:8): [True: 2.67k, False: 2.22k]
  ------------------
  747|  2.67k|      in_key_len = strlen(in_key);
  748|  2.67k|    }
  749|  2.22k|    else {
  750|  2.22k|      in_key_len = offset - in_key;
  751|  2.22k|    }
  752|       |
  753|  4.90k|    curlx_dyn_init(&encoded_query_array[index].key,
  754|  4.90k|      (query_part_len * 3) + 1);
  755|  4.90k|    curlx_dyn_init(&encoded_query_array[index].value,
  756|  4.90k|      (query_part_len * 3) + 1);
  757|  4.90k|    counted_query_components++;
  758|       |
  759|       |    /* Decode/encode the key */
  760|  4.90k|    result = normalize_query(in_key, in_key_len,
  761|  4.90k|                             &encoded_query_array[index].key);
  762|  4.90k|    if(result) {
  ------------------
  |  Branch (762:8): [True: 0, False: 4.90k]
  ------------------
  763|      0|      goto fail;
  764|      0|    }
  765|       |
  766|       |    /* Decode/encode the value if it exists */
  767|  4.90k|    if(offset && offset != (query_part + query_part_len - 1)) {
  ------------------
  |  Branch (767:8): [True: 2.22k, False: 2.67k]
  |  Branch (767:18): [True: 1.94k, False: 277]
  ------------------
  768|  1.94k|      size_t in_value_len;
  769|  1.94k|      const char *in_value = offset + 1;
  770|  1.94k|      in_value_len = query_part + query_part_len - (offset + 1);
  771|  1.94k|      result = normalize_query(in_value, in_value_len,
  772|  1.94k|                               &encoded_query_array[index].value);
  773|  1.94k|      if(result) {
  ------------------
  |  Branch (773:10): [True: 0, False: 1.94k]
  ------------------
  774|      0|        goto fail;
  775|      0|      }
  776|  1.94k|    }
  777|  2.95k|    else {
  778|       |      /* If there is no value, the value is an empty string */
  779|  2.95k|      curlx_dyn_init(&encoded_query_array[index].value, 2);
  780|  2.95k|      result = curlx_dyn_addn(&encoded_query_array[index].value, "", 1);
  781|  2.95k|    }
  782|       |
  783|  4.90k|    if(result) {
  ------------------
  |  Branch (783:8): [True: 0, False: 4.90k]
  ------------------
  784|      0|      goto fail;
  785|      0|    }
  786|  4.90k|  }
  787|       |
  788|       |  /* Sort the encoded query components by key and value */
  789|    694|  qsort(&encoded_query_array, num_query_components,
  790|    694|        sizeof(struct pair), compare_func);
  791|       |
  792|       |  /* Append the query components together to make a full query string */
  793|  5.59k|  for(index = 0; index < num_query_components; index++) {
  ------------------
  |  Branch (793:18): [True: 4.90k, False: 694]
  ------------------
  794|       |
  795|  4.90k|    if(index)
  ------------------
  |  Branch (795:8): [True: 4.33k, False: 569]
  ------------------
  796|  4.33k|      result = curlx_dyn_addn(dq, "&", 1);
  797|  4.90k|    if(!result) {
  ------------------
  |  Branch (797:8): [True: 4.90k, False: 0]
  ------------------
  798|  4.90k|      const char *key_ptr = curlx_dyn_ptr(&encoded_query_array[index].key);
  799|  4.90k|      const char *value_ptr = curlx_dyn_ptr(&encoded_query_array[index].value);
  800|  4.90k|      size_t vlen = curlx_dyn_len(&encoded_query_array[index].value);
  801|  4.90k|      if(value_ptr && vlen) {
  ------------------
  |  Branch (801:10): [True: 4.90k, False: 0]
  |  Branch (801:23): [True: 4.90k, False: 0]
  ------------------
  802|  4.90k|        result = curlx_dyn_addf(dq, "%s=%s", key_ptr, value_ptr);
  803|  4.90k|      }
  804|      0|      else {
  805|       |        /* Empty value is always encoded to key= */
  806|      0|        result = curlx_dyn_addf(dq, "%s=", key_ptr);
  807|      0|      }
  808|  4.90k|    }
  809|  4.90k|    if(result)
  ------------------
  |  Branch (809:8): [True: 0, False: 4.90k]
  ------------------
  810|      0|      break;
  811|  4.90k|  }
  812|       |
  813|    696|fail:
  814|    696|  if(counted_query_components)
  ------------------
  |  Branch (814:6): [True: 569, False: 127]
  ------------------
  815|       |    /* the encoded_query_array might not be initialized yet */
  816|    569|    pair_array_free(&encoded_query_array[0], counted_query_components);
  817|    696|  dyn_array_free(&query_array[0], num_query_components);
  818|    696|  return result;
  819|    694|}
Curl_output_aws_sigv4:
  822|  2.03k|{
  823|  2.03k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  824|  2.03k|  struct connectdata *conn = data->conn;
  825|  2.03k|  const char *line;
  826|  2.03k|  struct Curl_str provider0;
  827|  2.03k|  struct Curl_str provider1;
  828|  2.03k|  struct Curl_str region = { NULL, 0 };
  829|  2.03k|  struct Curl_str service = { NULL, 0 };
  830|  2.03k|  const char *hostname = conn->origin->hostname;
  831|  2.03k|  time_t clock;
  832|  2.03k|  struct tm tm;
  833|  2.03k|  char timestamp[TIMESTAMP_SIZE];
  834|  2.03k|  char date[9];
  835|  2.03k|  struct dynbuf canonical_headers;
  836|  2.03k|  struct dynbuf signed_headers;
  837|  2.03k|  struct dynbuf canonical_query;
  838|  2.03k|  struct dynbuf canonical_path;
  839|  2.03k|  char *date_header = NULL;
  840|  2.03k|  Curl_HttpReq httpreq;
  841|  2.03k|  const char *method = NULL;
  842|  2.03k|  const char *payload_hash = NULL;
  843|  2.03k|  size_t payload_hash_len = 0;
  844|  2.03k|  unsigned char sha_hash[CURL_SHA256_DIGEST_LENGTH];
  845|  2.03k|  char sha_hex[SHA256_HEX_LENGTH];
  846|  2.03k|  char content_sha256_hdr[CONTENT_SHA256_HDR_LEN + 2] = ""; /* add \r\n */
  847|  2.03k|  char *canonical_request = NULL;
  848|  2.03k|  char *request_type = NULL;
  849|  2.03k|  char *credential_scope = NULL;
  850|  2.03k|  char *str_to_sign = NULL;
  851|  2.03k|  const char *user = Curl_creds_user(data->state.creds);
  ------------------
  |  |   75|  2.03k|#define Curl_creds_user(c)               ((c) ? (c)->user : "")
  |  |  ------------------
  |  |  |  Branch (75:43): [True: 1.52k, False: 511]
  |  |  ------------------
  ------------------
  852|  2.03k|  const char *passwd = Curl_creds_passwd(data->state.creds);
  ------------------
  |  |   76|  2.03k|#define Curl_creds_passwd(c)             ((c) ? (c)->passwd : "")
  |  |  ------------------
  |  |  |  Branch (76:43): [True: 1.52k, False: 511]
  |  |  ------------------
  ------------------
  853|  2.03k|  char *secret = NULL;
  854|  2.03k|  unsigned char sign0[CURL_SHA256_DIGEST_LENGTH] = { 0 };
  855|  2.03k|  unsigned char sign1[CURL_SHA256_DIGEST_LENGTH] = { 0 };
  856|  2.03k|  char *auth_headers = NULL;
  857|       |
  858|  2.03k|  if(data->set.path_as_is) {
  ------------------
  |  Branch (858:6): [True: 1, False: 2.03k]
  ------------------
  859|      1|    failf(data, "Cannot use sigv4 authentication with path-as-is flag");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  860|      1|    return CURLE_BAD_FUNCTION_ARGUMENT;
  861|      1|  }
  862|       |
  863|  2.03k|  if(Curl_checkheaders(data, STRCONST("Authorization"))) {
  ------------------
  |  | 1292|  2.03k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (863:6): [True: 10, False: 2.02k]
  ------------------
  864|       |    /* Authorization already present, Bailing out */
  865|     10|    return CURLE_OK;
  866|     10|  }
  867|       |
  868|       |  /* we init those buffers here, so goto fail will free initialized dynbuf */
  869|  2.02k|  curlx_dyn_init(&canonical_headers, CURL_MAX_HTTP_HEADER);
  ------------------
  |  |  272|  2.02k|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
  870|  2.02k|  curlx_dyn_init(&canonical_query, CURL_MAX_HTTP_HEADER);
  ------------------
  |  |  272|  2.02k|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
  871|  2.02k|  curlx_dyn_init(&signed_headers, CURL_MAX_HTTP_HEADER);
  ------------------
  |  |  272|  2.02k|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
  872|  2.02k|  curlx_dyn_init(&canonical_path, CURL_MAX_HTTP_HEADER);
  ------------------
  |  |  272|  2.02k|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
  873|       |
  874|       |  /*
  875|       |   * Parameters parsing
  876|       |   * Google and Outscale use the same OSC or GOOG,
  877|       |   * but Amazon uses AWS and AMZ for header arguments.
  878|       |   * AWS is the default because most of non-amazon providers
  879|       |   * are still using aws:amz as a prefix.
  880|       |   */
  881|  2.02k|  line = data->set.str[STRING_AWS_SIGV4];
  882|  2.02k|  if(!line || !*line)
  ------------------
  |  Branch (882:6): [True: 12, False: 2.01k]
  |  Branch (882:15): [True: 475, False: 1.54k]
  ------------------
  883|    487|    line = "aws:amz";
  884|       |
  885|       |  /* provider0[:provider1[:region[:service]]]
  886|       |
  887|       |     No string can be longer than N bytes of non-whitespace
  888|       |  */
  889|  2.02k|  if(curlx_str_until(&line, &provider0, MAX_SIGV4_LEN, ':')) {
  ------------------
  |  |  284|  2.02k|#define MAX_SIGV4_LEN    64
  ------------------
  |  Branch (889:6): [True: 2, False: 2.02k]
  ------------------
  890|      2|    failf(data, "first aws-sigv4 provider cannot be empty");
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
  891|      2|    result = CURLE_BAD_FUNCTION_ARGUMENT;
  892|      2|    goto fail;
  893|      2|  }
  894|  2.02k|  if(curlx_str_single(&line, ':') ||
  ------------------
  |  Branch (894:6): [True: 658, False: 1.36k]
  ------------------
  895|  1.36k|     curlx_str_until(&line, &provider1, MAX_SIGV4_LEN, ':')) {
  ------------------
  |  |  284|  1.36k|#define MAX_SIGV4_LEN    64
  ------------------
  |  Branch (895:6): [True: 21, False: 1.34k]
  ------------------
  896|    679|    provider1 = provider0;
  897|    679|  }
  898|  1.34k|  else if(curlx_str_single(&line, ':') ||
  ------------------
  |  Branch (898:11): [True: 660, False: 687]
  ------------------
  899|    687|          curlx_str_until(&line, &region, MAX_SIGV4_LEN, ':') ||
  ------------------
  |  |  284|    687|#define MAX_SIGV4_LEN    64
  ------------------
  |  Branch (899:11): [True: 29, False: 658]
  ------------------
  900|    658|          curlx_str_single(&line, ':') ||
  ------------------
  |  Branch (900:11): [True: 364, False: 294]
  ------------------
  901|  1.06k|          curlx_str_until(&line, &service, MAX_SIGV4_LEN, ':')) {
  ------------------
  |  |  284|    294|#define MAX_SIGV4_LEN    64
  ------------------
  |  Branch (901:11): [True: 15, False: 279]
  ------------------
  902|       |    /* nothing to do */
  903|  1.06k|  }
  904|       |
  905|  2.02k|  if(!curlx_strlen(&service)) {
  ------------------
  |  |   50|  2.02k|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (905:6): [True: 1.74k, False: 279]
  ------------------
  906|  1.74k|    const char *p = hostname;
  907|  1.74k|    if(curlx_str_until(&p, &service, MAX_SIGV4_LEN, '.') ||
  ------------------
  |  |  284|  1.74k|#define MAX_SIGV4_LEN    64
  ------------------
  |  Branch (907:8): [True: 1, False: 1.74k]
  ------------------
  908|  1.74k|       curlx_str_single(&p, '.')) {
  ------------------
  |  Branch (908:8): [True: 1, False: 1.74k]
  ------------------
  909|      2|      failf(data, "aws-sigv4: service missing in parameters and hostname");
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
  910|      2|      result = CURLE_URL_MALFORMAT;
  911|      2|      goto fail;
  912|      2|    }
  913|       |
  914|  1.74k|    infof(data, "aws_sigv4: picked service %.*s from host",
  ------------------
  |  |  143|  1.74k|  do {                               \
  |  |  144|  1.74k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  1.74k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 1.74k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.74k]
  |  |  |  |  ------------------
  |  |  |  |  320|  1.74k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.74k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  1.74k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1.74k]
  |  |  ------------------
  ------------------
  915|  1.74k|          (int)curlx_strlen(&service), curlx_str(&service));
  916|       |
  917|  1.74k|    if(!curlx_strlen(&region)) {
  ------------------
  |  |   50|  1.74k|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (917:8): [True: 1.36k, False: 379]
  ------------------
  918|  1.36k|      if(curlx_str_until(&p, &region, MAX_SIGV4_LEN, '.') ||
  ------------------
  |  |  284|  1.36k|#define MAX_SIGV4_LEN    64
  ------------------
  |  Branch (918:10): [True: 1, False: 1.36k]
  ------------------
  919|  1.36k|         curlx_str_single(&p, '.')) {
  ------------------
  |  Branch (919:10): [True: 1, False: 1.36k]
  ------------------
  920|      2|        failf(data, "aws-sigv4: region missing in parameters and hostname");
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
  921|      2|        result = CURLE_URL_MALFORMAT;
  922|      2|        goto fail;
  923|      2|      }
  924|  1.36k|      infof(data, "aws_sigv4: picked region %.*s from host",
  ------------------
  |  |  143|  1.36k|  do {                               \
  |  |  144|  1.36k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  1.36k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 1.36k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.36k]
  |  |  |  |  ------------------
  |  |  |  |  320|  1.36k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.36k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  1.36k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1.36k]
  |  |  ------------------
  ------------------
  925|  1.36k|            (int)curlx_strlen(&region), curlx_str(&region));
  926|  1.36k|    }
  927|  1.74k|  }
  928|       |
  929|  2.02k|  Curl_http_method(data, &method, &httpreq);
  930|       |
  931|  2.02k|  payload_hash =
  932|  2.02k|    parse_content_sha_hdr(data, curlx_str(&provider1),
  ------------------
  |  |   49|  2.02k|#define curlx_str(x)    ((x)->str)
  ------------------
  933|  2.02k|                          curlx_strlen(&provider1), &payload_hash_len);
  ------------------
  |  |   50|  2.02k|#define curlx_strlen(x) ((x)->len)
  ------------------
  934|       |
  935|  2.02k|  if(!payload_hash) {
  ------------------
  |  Branch (935:6): [True: 2.02k, False: 0]
  ------------------
  936|       |    /* AWS S3 requires a x-amz-content-sha256 header, and supports special
  937|       |     * values like UNSIGNED-PAYLOAD */
  938|  2.02k|    bool sign_as_s3 = curlx_str_casecompare(&provider0, "aws") &&
  ------------------
  |  Branch (938:23): [True: 484, False: 1.53k]
  ------------------
  939|    484|                      curlx_str_casecompare(&service, "s3");
  ------------------
  |  Branch (939:23): [True: 32, False: 452]
  ------------------
  940|       |
  941|  2.02k|    if(sign_as_s3)
  ------------------
  |  Branch (941:8): [True: 32, False: 1.99k]
  ------------------
  942|     32|      result = calc_s3_payload_hash(data, httpreq, curlx_str(&provider1),
  ------------------
  |  |   49|     32|#define curlx_str(x)    ((x)->str)
  ------------------
  943|     32|                                    curlx_strlen(&provider1), sha_hash,
  ------------------
  |  |   50|     32|#define curlx_strlen(x) ((x)->len)
  ------------------
  944|     32|                                    sha_hex, content_sha256_hdr);
  945|  1.99k|    else
  946|  1.99k|      result = calc_payload_hash(data, sha_hash, sha_hex);
  947|  2.02k|    if(result)
  ------------------
  |  Branch (947:8): [True: 0, False: 2.02k]
  ------------------
  948|      0|      goto fail;
  949|       |
  950|  2.02k|    payload_hash = sha_hex;
  951|       |    /* may be shorter than SHA256_HEX_LENGTH, like S3_UNSIGNED_PAYLOAD */
  952|  2.02k|    payload_hash_len = strlen(sha_hex);
  953|  2.02k|  }
  954|       |
  955|  2.02k|#ifdef DEBUGBUILD
  956|  2.02k|  {
  957|  2.02k|    char *force_timestamp = getenv("CURL_FORCETIME");
  958|  2.02k|    if(force_timestamp)
  ------------------
  |  Branch (958:8): [True: 0, False: 2.02k]
  ------------------
  959|      0|      clock = 0;
  960|  2.02k|    else
  961|  2.02k|      clock = time(NULL);
  962|  2.02k|  }
  963|       |#else
  964|       |  clock = time(NULL);
  965|       |#endif
  966|  2.02k|  result = curlx_gmtime(clock, &tm);
  967|  2.02k|  if(result) {
  ------------------
  |  Branch (967:6): [True: 0, False: 2.02k]
  ------------------
  968|      0|    goto fail;
  969|      0|  }
  970|  2.02k|  if(!strftime(timestamp, sizeof(timestamp), "%Y%m%dT%H%M%SZ", &tm)) {
  ------------------
  |  Branch (970:6): [True: 0, False: 2.02k]
  ------------------
  971|      0|    result = CURLE_OUT_OF_MEMORY;
  972|      0|    goto fail;
  973|      0|  }
  974|       |
  975|  2.02k|  result = make_headers(data, hostname, timestamp,
  976|  2.02k|                        curlx_str(&provider1), curlx_strlen(&provider1),
  ------------------
  |  |   49|  2.02k|#define curlx_str(x)    ((x)->str)
  ------------------
                                      curlx_str(&provider1), curlx_strlen(&provider1),
  ------------------
  |  |   50|  2.02k|#define curlx_strlen(x) ((x)->len)
  ------------------
  977|  2.02k|                        &date_header, content_sha256_hdr,
  978|  2.02k|                        &canonical_headers, &signed_headers);
  979|  2.02k|  if(result)
  ------------------
  |  Branch (979:6): [True: 1, False: 2.02k]
  ------------------
  980|      1|    goto fail;
  981|       |
  982|  2.02k|  if(*content_sha256_hdr) {
  ------------------
  |  Branch (982:6): [True: 32, False: 1.98k]
  ------------------
  983|       |    /* make_headers() needed this without the \r\n for canonicalization */
  984|     32|    size_t hdrlen = strlen(content_sha256_hdr);
  985|     32|    DEBUGASSERT(hdrlen + 3 < sizeof(content_sha256_hdr));
  ------------------
  |  | 1081|     32|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (985:5): [True: 0, False: 32]
  |  Branch (985:5): [True: 32, False: 0]
  ------------------
  986|     32|    memcpy(content_sha256_hdr + hdrlen, "\r\n", 3);
  987|     32|  }
  988|       |
  989|  2.02k|  memcpy(date, timestamp, sizeof(date));
  990|  2.02k|  date[sizeof(date) - 1] = 0;
  991|       |
  992|  2.02k|  result = canon_query(data->state.up.query, &canonical_query);
  993|  2.02k|  if(result)
  ------------------
  |  Branch (993:6): [True: 2, False: 2.01k]
  ------------------
  994|      2|    goto fail;
  995|       |
  996|  2.01k|  result = canon_path(data->state.up.path, strlen(data->state.up.path),
  997|  2.01k|                      &canonical_path,
  998|  2.01k|                      should_urlencode(&service));
  999|  2.01k|  if(result)
  ------------------
  |  Branch (999:6): [True: 0, False: 2.01k]
  ------------------
 1000|      0|    goto fail;
 1001|  2.01k|  result = CURLE_OUT_OF_MEMORY;
 1002|       |
 1003|  2.01k|  canonical_request =
 1004|  2.01k|    curl_maprintf("%s\n" /* HTTPRequestMethod */
 1005|  2.01k|                  "%s\n" /* CanonicalURI */
 1006|  2.01k|                  "%s\n" /* CanonicalQueryString */
 1007|  2.01k|                  "%s\n" /* CanonicalHeaders */
 1008|  2.01k|                  "%s\n" /* SignedHeaders */
 1009|  2.01k|                  "%.*s",  /* HashedRequestPayload in hex */
 1010|  2.01k|                  method,
 1011|  2.01k|                  curlx_dyn_ptr(&canonical_path),
 1012|  2.01k|                  curlx_dyn_ptr(&canonical_query) ?
  ------------------
  |  Branch (1012:19): [True: 569, False: 1.45k]
  ------------------
 1013|  1.45k|                  curlx_dyn_ptr(&canonical_query) : "",
 1014|  2.01k|                  curlx_dyn_ptr(&canonical_headers),
 1015|  2.01k|                  curlx_dyn_ptr(&signed_headers),
 1016|  2.01k|                  (int)payload_hash_len, payload_hash);
 1017|  2.01k|  if(!canonical_request)
  ------------------
  |  Branch (1017:6): [True: 0, False: 2.01k]
  ------------------
 1018|      0|    goto fail;
 1019|       |
 1020|  2.01k|  infof(data, "aws_sigv4: Canonical request (enclosed in []) - [%s]",
  ------------------
  |  |  143|  2.01k|  do {                               \
  |  |  144|  2.01k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  2.01k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 2.01k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 2.01k]
  |  |  |  |  ------------------
  |  |  |  |  320|  2.01k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  2.01k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  2.01k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 2.01k]
  |  |  ------------------
  ------------------
 1021|  2.01k|        canonical_request);
 1022|       |
 1023|  2.01k|  request_type = curl_maprintf("%.*s4_request",
 1024|  2.01k|                               (int)curlx_strlen(&provider0),
  ------------------
  |  |   50|  2.01k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1025|  2.01k|                               curlx_str(&provider0));
  ------------------
  |  |   49|  2.01k|#define curlx_str(x)    ((x)->str)
  ------------------
 1026|  2.01k|  if(!request_type)
  ------------------
  |  Branch (1026:6): [True: 0, False: 2.01k]
  ------------------
 1027|      0|    goto fail;
 1028|       |
 1029|       |  /* provider0 is lowercased *after* curl_maprintf() so that the buffer
 1030|       |     can be written to */
 1031|  2.01k|  Curl_strntolower(request_type, request_type, curlx_strlen(&provider0));
  ------------------
  |  |   50|  2.01k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1032|       |
 1033|  2.01k|  credential_scope = curl_maprintf("%s/%.*s/%.*s/%s", date,
 1034|  2.01k|                                   (int)curlx_strlen(&region),
  ------------------
  |  |   50|  2.01k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1035|  2.01k|                                   curlx_str(&region),
  ------------------
  |  |   49|  2.01k|#define curlx_str(x)    ((x)->str)
  ------------------
 1036|  2.01k|                                   (int)curlx_strlen(&service),
  ------------------
  |  |   50|  2.01k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1037|  2.01k|                                   curlx_str(&service),
  ------------------
  |  |   49|  2.01k|#define curlx_str(x)    ((x)->str)
  ------------------
 1038|  2.01k|                                   request_type);
 1039|  2.01k|  if(!credential_scope)
  ------------------
  |  Branch (1039:6): [True: 0, False: 2.01k]
  ------------------
 1040|      0|    goto fail;
 1041|       |
 1042|  2.01k|  if(Curl_sha256it(sha_hash, (unsigned char *)canonical_request,
  ------------------
  |  Branch (1042:6): [True: 0, False: 2.01k]
  ------------------
 1043|  2.01k|                   strlen(canonical_request)))
 1044|      0|    goto fail;
 1045|       |
 1046|  2.01k|  sha256_to_hex(sha_hex, sha_hash);
 1047|       |
 1048|       |  /*
 1049|       |   * Google allows using RSA key instead of HMAC, so this code might change
 1050|       |   * in the future. For now we only support HMAC.
 1051|       |   */
 1052|  2.01k|  str_to_sign = curl_maprintf("%.*s4-HMAC-SHA256\n" /* Algorithm */
 1053|  2.01k|                              "%s\n" /* RequestDateTime */
 1054|  2.01k|                              "%s\n" /* CredentialScope */
 1055|  2.01k|                              "%s",  /* HashedCanonicalRequest in hex */
 1056|  2.01k|                              (int)curlx_strlen(&provider0),
  ------------------
  |  |   50|  2.01k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1057|  2.01k|                              curlx_str(&provider0),
  ------------------
  |  |   49|  2.01k|#define curlx_str(x)    ((x)->str)
  ------------------
 1058|  2.01k|                              timestamp,
 1059|  2.01k|                              credential_scope,
 1060|  2.01k|                              sha_hex);
 1061|  2.01k|  if(!str_to_sign)
  ------------------
  |  Branch (1061:6): [True: 0, False: 2.01k]
  ------------------
 1062|      0|    goto fail;
 1063|       |
 1064|       |  /* make provider0 part done uppercase */
 1065|  2.01k|  Curl_strntoupper(str_to_sign, curlx_str(&provider0),
  ------------------
  |  |   49|  2.01k|#define curlx_str(x)    ((x)->str)
  ------------------
 1066|  2.01k|                   curlx_strlen(&provider0));
  ------------------
  |  |   50|  2.01k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1067|       |
 1068|  2.01k|  infof(data, "aws_sigv4: String to sign (enclosed in []) - [%s]",
  ------------------
  |  |  143|  2.01k|  do {                               \
  |  |  144|  2.01k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  2.01k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 2.01k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 2.01k]
  |  |  |  |  ------------------
  |  |  |  |  320|  2.01k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  2.01k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  2.01k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 2.01k]
  |  |  ------------------
  ------------------
 1069|  2.01k|        str_to_sign);
 1070|       |
 1071|  2.01k|  secret = curl_maprintf("%.*s4%s", (int)curlx_strlen(&provider0),
  ------------------
  |  |   50|  2.01k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1072|  2.01k|                         curlx_str(&provider0), passwd);
  ------------------
  |  |   49|  2.01k|#define curlx_str(x)    ((x)->str)
  ------------------
 1073|  2.01k|  if(!secret)
  ------------------
  |  Branch (1073:6): [True: 0, False: 2.01k]
  ------------------
 1074|      0|    goto fail;
 1075|       |  /* make provider0 part done uppercase */
 1076|  2.01k|  Curl_strntoupper(secret, curlx_str(&provider0), curlx_strlen(&provider0));
  ------------------
  |  |   49|  2.01k|#define curlx_str(x)    ((x)->str)
  ------------------
                Curl_strntoupper(secret, curlx_str(&provider0), curlx_strlen(&provider0));
  ------------------
  |  |   50|  2.01k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1077|       |
 1078|  2.01k|  HMAC_SHA256(secret, strlen(secret), date, strlen(date), sign0);
  ------------------
  |  |   42|  2.01k|  do {                                               \
  |  |   43|  2.01k|    result = Curl_hmacit(&Curl_HMAC_SHA256,          \
  |  |   44|  2.01k|                         (const unsigned char *)(k), \
  |  |   45|  2.01k|                         kl,                         \
  |  |   46|  2.01k|                         (const unsigned char *)(d), \
  |  |   47|  2.01k|                         dl, o);                     \
  |  |   48|  2.01k|    if(result) {                                     \
  |  |  ------------------
  |  |  |  Branch (48:8): [True: 0, False: 2.01k]
  |  |  ------------------
  |  |   49|      0|      goto fail;                                     \
  |  |   50|      0|    }                                                \
  |  |   51|  2.01k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (51:11): [Folded, False: 2.01k]
  |  |  ------------------
  ------------------
 1079|  2.01k|  HMAC_SHA256(sign0, sizeof(sign0),
  ------------------
  |  |   42|  2.01k|  do {                                               \
  |  |   43|  2.01k|    result = Curl_hmacit(&Curl_HMAC_SHA256,          \
  |  |   44|  2.01k|                         (const unsigned char *)(k), \
  |  |   45|  2.01k|                         kl,                         \
  |  |   46|  2.01k|                         (const unsigned char *)(d), \
  |  |   47|  2.01k|                         dl, o);                     \
  |  |   48|  2.01k|    if(result) {                                     \
  |  |  ------------------
  |  |  |  Branch (48:8): [True: 0, False: 2.01k]
  |  |  ------------------
  |  |   49|      0|      goto fail;                                     \
  |  |   50|      0|    }                                                \
  |  |   51|  2.01k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (51:11): [Folded, False: 2.01k]
  |  |  ------------------
  ------------------
 1080|  2.01k|              curlx_str(&region), curlx_strlen(&region), sign1);
 1081|  2.01k|  HMAC_SHA256(sign1, sizeof(sign1),
  ------------------
  |  |   42|  2.01k|  do {                                               \
  |  |   43|  2.01k|    result = Curl_hmacit(&Curl_HMAC_SHA256,          \
  |  |   44|  2.01k|                         (const unsigned char *)(k), \
  |  |   45|  2.01k|                         kl,                         \
  |  |   46|  2.01k|                         (const unsigned char *)(d), \
  |  |   47|  2.01k|                         dl, o);                     \
  |  |   48|  2.01k|    if(result) {                                     \
  |  |  ------------------
  |  |  |  Branch (48:8): [True: 0, False: 2.01k]
  |  |  ------------------
  |  |   49|      0|      goto fail;                                     \
  |  |   50|      0|    }                                                \
  |  |   51|  2.01k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (51:11): [Folded, False: 2.01k]
  |  |  ------------------
  ------------------
 1082|  2.01k|              curlx_str(&service), curlx_strlen(&service), sign0);
 1083|  2.01k|  HMAC_SHA256(sign0, sizeof(sign0), request_type, strlen(request_type), sign1);
  ------------------
  |  |   42|  2.01k|  do {                                               \
  |  |   43|  2.01k|    result = Curl_hmacit(&Curl_HMAC_SHA256,          \
  |  |   44|  2.01k|                         (const unsigned char *)(k), \
  |  |   45|  2.01k|                         kl,                         \
  |  |   46|  2.01k|                         (const unsigned char *)(d), \
  |  |   47|  2.01k|                         dl, o);                     \
  |  |   48|  2.01k|    if(result) {                                     \
  |  |  ------------------
  |  |  |  Branch (48:8): [True: 0, False: 2.01k]
  |  |  ------------------
  |  |   49|      0|      goto fail;                                     \
  |  |   50|      0|    }                                                \
  |  |   51|  2.01k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (51:11): [Folded, False: 2.01k]
  |  |  ------------------
  ------------------
 1084|  2.01k|  HMAC_SHA256(sign1, sizeof(sign1), str_to_sign, strlen(str_to_sign), sign0);
  ------------------
  |  |   42|  2.01k|  do {                                               \
  |  |   43|  2.01k|    result = Curl_hmacit(&Curl_HMAC_SHA256,          \
  |  |   44|  2.01k|                         (const unsigned char *)(k), \
  |  |   45|  2.01k|                         kl,                         \
  |  |   46|  2.01k|                         (const unsigned char *)(d), \
  |  |   47|  2.01k|                         dl, o);                     \
  |  |   48|  2.01k|    if(result) {                                     \
  |  |  ------------------
  |  |  |  Branch (48:8): [True: 0, False: 2.01k]
  |  |  ------------------
  |  |   49|      0|      goto fail;                                     \
  |  |   50|      0|    }                                                \
  |  |   51|  2.01k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (51:11): [Folded, False: 2.01k]
  |  |  ------------------
  ------------------
 1085|       |
 1086|  2.01k|  sha256_to_hex(sha_hex, sign0);
 1087|       |
 1088|  2.01k|  infof(data, "aws_sigv4: Signature - %s", sha_hex);
  ------------------
  |  |  143|  2.01k|  do {                               \
  |  |  144|  2.01k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  2.01k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 2.01k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 2.01k]
  |  |  |  |  ------------------
  |  |  |  |  320|  2.01k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  2.01k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  2.01k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 2.01k]
  |  |  ------------------
  ------------------
 1089|       |
 1090|  2.01k|  auth_headers = curl_maprintf("Authorization: %.*s4-HMAC-SHA256 "
 1091|  2.01k|                               "Credential=%s/%s, "
 1092|  2.01k|                               "SignedHeaders=%s, "
 1093|  2.01k|                               "Signature=%s\r\n"
 1094|       |                               /*
 1095|       |                                * date_header is added here, only if it was not
 1096|       |                                * user-specified (using CURLOPT_HTTPHEADER).
 1097|       |                                * date_header includes \r\n
 1098|       |                                */
 1099|  2.01k|                               "%s"
 1100|  2.01k|                               "%s", /* optional sha256 header includes \r\n */
 1101|  2.01k|                               (int)curlx_strlen(&provider0),
  ------------------
  |  |   50|  2.01k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1102|  2.01k|                               curlx_str(&provider0),
  ------------------
  |  |   49|  2.01k|#define curlx_str(x)    ((x)->str)
  ------------------
 1103|  2.01k|                               user,
 1104|  2.01k|                               credential_scope,
 1105|  2.01k|                               curlx_dyn_ptr(&signed_headers),
 1106|  2.01k|                               sha_hex,
 1107|  2.01k|                               date_header ? date_header : "",
  ------------------
  |  Branch (1107:32): [True: 1.94k, False: 77]
  ------------------
 1108|  2.01k|                               content_sha256_hdr);
 1109|  2.01k|  if(!auth_headers) {
  ------------------
  |  Branch (1109:6): [True: 0, False: 2.01k]
  ------------------
 1110|      0|    goto fail;
 1111|      0|  }
 1112|       |  /* provider 0 uppercase */
 1113|  2.01k|  Curl_strntoupper(&auth_headers[sizeof("Authorization: ") - 1],
 1114|  2.01k|                   curlx_str(&provider0), curlx_strlen(&provider0));
  ------------------
  |  |   49|  2.01k|#define curlx_str(x)    ((x)->str)
  ------------------
                                 curlx_str(&provider0), curlx_strlen(&provider0));
  ------------------
  |  |   50|  2.01k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1115|       |
 1116|  2.01k|  curlx_free(data->req.hd_auth);
  ------------------
  |  | 1483|  2.01k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1117|  2.01k|  data->req.hd_auth = auth_headers;
 1118|  2.01k|  data->state.authhost.done = TRUE;
  ------------------
  |  | 1055|  2.01k|#define TRUE true
  ------------------
 1119|  2.01k|  result = CURLE_OK;
 1120|       |
 1121|  2.02k|fail:
 1122|  2.02k|  curlx_dyn_free(&canonical_query);
 1123|  2.02k|  curlx_dyn_free(&canonical_path);
 1124|  2.02k|  curlx_dyn_free(&canonical_headers);
 1125|  2.02k|  curlx_dyn_free(&signed_headers);
 1126|  2.02k|  curlx_free(canonical_request);
  ------------------
  |  | 1483|  2.02k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1127|  2.02k|  curlx_free(request_type);
  ------------------
  |  | 1483|  2.02k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1128|  2.02k|  curlx_free(credential_scope);
  ------------------
  |  | 1483|  2.02k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1129|  2.02k|  curlx_free(str_to_sign);
  ------------------
  |  | 1483|  2.02k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1130|  2.02k|  curlx_free(secret);
  ------------------
  |  | 1483|  2.02k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1131|  2.02k|  curlx_free(date_header);
  ------------------
  |  | 1483|  2.02k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1132|  2.02k|  return result;
 1133|  2.01k|}
http_aws_sigv4.c:uri_encode_path:
  206|  1.96k|{
  207|  1.96k|  const char *p = curlx_str(original_path);
  ------------------
  |  |   49|  1.96k|#define curlx_str(x)    ((x)->str)
  ------------------
  208|  1.96k|  size_t i;
  209|       |
  210|  61.7k|  for(i = 0; i < curlx_strlen(original_path); i++) {
  ------------------
  |  |   50|  61.7k|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (210:14): [True: 59.8k, False: 1.96k]
  ------------------
  211|       |    /* Do not encode slashes or unreserved chars from RFC 3986 */
  212|  59.8k|    CURLcode result = CURLE_OK;
  213|  59.8k|    unsigned char c = p[i];
  214|  59.8k|    if(is_reserved_char(c) || c == '/')
  ------------------
  |  Branch (214:8): [True: 39.6k, False: 20.1k]
  |  Branch (214:31): [True: 2.36k, False: 17.7k]
  ------------------
  215|  42.0k|      result = curlx_dyn_addn(new_path, &c, 1);
  216|  17.7k|    else
  217|  17.7k|      result = curlx_dyn_addf(new_path, "%%%02X", c);
  218|  59.8k|    if(result)
  ------------------
  |  Branch (218:8): [True: 0, False: 59.8k]
  ------------------
  219|      0|      return result;
  220|  59.8k|  }
  221|       |
  222|  1.96k|  return CURLE_OK;
  223|  1.96k|}
http_aws_sigv4.c:is_reserved_char:
  200|   170k|{
  201|   170k|  return (ISALNUM(c) || ISURLPUNTCS(c));
  ------------------
  |  |   41|   340k|#define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   44|   340k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 103k, False: 66.2k]
  |  |  |  |  |  Branch (44:38): [True: 20.7k, False: 83.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   43|   319k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:22): [True: 32.2k, False: 117k]
  |  |  |  |  |  Branch (43:38): [True: 30.4k, False: 1.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   42|   118k|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 43.5k, False: 75.4k]
  |  |  |  |  |  Branch (42:38): [True: 39.0k, False: 4.44k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                return (ISALNUM(c) || ISURLPUNTCS(c));
  ------------------
  |  |   48|  79.8k|  (((x) == '-') || ((x) == '.') || ((x) == '_') || ((x) == '~'))
  |  |  ------------------
  |  |  |  Branch (48:4): [True: 2.38k, False: 77.5k]
  |  |  |  Branch (48:20): [True: 1.71k, False: 75.7k]
  |  |  |  Branch (48:36): [True: 1.77k, False: 74.0k]
  |  |  |  Branch (48:52): [True: 1.10k, False: 72.9k]
  |  |  ------------------
  ------------------
  202|   170k|}
http_aws_sigv4.c:split_to_dyn_array:
  153|    696|{
  154|    696|  CURLcode result = CURLE_OK;
  155|    696|  size_t len = strlen(source);
  156|    696|  size_t pos;         /* Position in result buffer */
  157|    696|  size_t start = 0;   /* Start of current segment */
  158|    696|  size_t segment_length = 0;
  159|    696|  size_t index = 0;
  160|    696|  size_t num_splits = 0;
  161|       |
  162|       |  /* Split source_ptr on SPLIT_BY and store the segment offsets and length in
  163|       |   * array */
  164|   181k|  for(pos = 0; pos < len; pos++) {
  ------------------
  |  Branch (164:16): [True: 180k, False: 695]
  ------------------
  165|   180k|    if(source[pos] == SPLIT_BY) {
  ------------------
  |  |  148|   180k|#define SPLIT_BY '&'
  ------------------
  |  Branch (165:8): [True: 7.61k, False: 173k]
  ------------------
  166|  7.61k|      if(segment_length) {
  ------------------
  |  Branch (166:10): [True: 4.59k, False: 3.02k]
  ------------------
  167|  4.59k|        curlx_dyn_init(&db[index], segment_length + 1);
  168|  4.59k|        result = curlx_dyn_addn(&db[index], &source[start], segment_length);
  169|  4.59k|        if(result)
  ------------------
  |  Branch (169:12): [True: 0, False: 4.59k]
  ------------------
  170|      0|          goto fail;
  171|       |
  172|  4.59k|        segment_length = 0;
  173|  4.59k|        index++;
  174|  4.59k|        if(++num_splits == MAX_QUERY_COMPONENTS) {
  ------------------
  |  |   58|  4.59k|#define MAX_QUERY_COMPONENTS 128
  ------------------
  |  Branch (174:12): [True: 1, False: 4.59k]
  ------------------
  175|      1|          result = CURLE_TOO_LARGE;
  176|      1|          goto fail;
  177|      1|        }
  178|  4.59k|      }
  179|  7.61k|      start = pos + 1;
  180|  7.61k|    }
  181|   173k|    else {
  182|   173k|      segment_length++;
  183|   173k|    }
  184|   180k|  }
  185|       |
  186|    695|  if(segment_length) {
  ------------------
  |  Branch (186:6): [True: 565, False: 130]
  ------------------
  187|    565|    curlx_dyn_init(&db[index], segment_length + 1);
  188|    565|    result = curlx_dyn_addn(&db[index], &source[start], segment_length);
  189|    565|    if(!result) {
  ------------------
  |  Branch (189:8): [True: 565, False: 0]
  ------------------
  190|    565|      if(++num_splits == MAX_QUERY_COMPONENTS)
  ------------------
  |  |   58|    565|#define MAX_QUERY_COMPONENTS 128
  ------------------
  |  Branch (190:10): [True: 1, False: 564]
  ------------------
  191|      1|        result = CURLE_TOO_LARGE;
  192|    565|    }
  193|    565|  }
  194|    696|fail:
  195|    696|  *num_splits_out = num_splits;
  196|    696|  return result;
  197|    695|}
http_aws_sigv4.c:normalize_query:
  230|  6.84k|{
  231|  6.84k|  CURLcode result = CURLE_OK;
  232|       |
  233|   117k|  while(len && !result) {
  ------------------
  |  Branch (233:9): [True: 110k, False: 6.84k]
  |  Branch (233:16): [True: 110k, False: 0]
  ------------------
  234|   110k|    unsigned char in = (unsigned char)*string;
  235|   110k|    if(('%' == in) && (len > 2) &&
  ------------------
  |  Branch (235:8): [True: 37.5k, False: 72.8k]
  |  Branch (235:23): [True: 37.1k, False: 390]
  ------------------
  236|  37.1k|       ISXDIGIT(string[1]) && ISXDIGIT(string[2])) {
  ------------------
  |  |   39|   147k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   44|  74.3k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 33.3k, False: 3.83k]
  |  |  |  |  |  Branch (44:38): [True: 9.89k, False: 23.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|  64.4k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 2.40k, False: 24.8k]
  |  |  |  |  |  Branch (27:43): [True: 1.60k, False: 801]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|  25.6k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 21.6k, False: 4.04k]
  |  |  |  |  |  Branch (28:43): [True: 20.1k, False: 1.41k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                     ISXDIGIT(string[1]) && ISXDIGIT(string[2])) {
  ------------------
  |  |   39|  31.7k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   44|  63.4k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 30.0k, False: 1.67k]
  |  |  |  |  |  Branch (44:38): [True: 12.4k, False: 17.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|  50.9k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 392, False: 18.9k]
  |  |  |  |  |  Branch (27:43): [True: 63, False: 329]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|  19.2k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 17.5k, False: 1.70k]
  |  |  |  |  |  Branch (28:43): [True: 16.8k, False: 704]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  237|       |      /* this is two hexadecimal digits following a '%' */
  238|  29.2k|      in = (unsigned char)((curlx_hexval(string[1]) << 4) |
  ------------------
  |  |  112|  29.2k|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  239|  29.2k|                           curlx_hexval(string[2]));
  ------------------
  |  |  112|  29.2k|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  240|  29.2k|      string += 3;
  241|  29.2k|      len -= 3;
  242|  29.2k|      if(in == '+') {
  ------------------
  |  Branch (242:10): [True: 56, False: 29.2k]
  ------------------
  243|       |        /* decodes to plus, so leave this encoded */
  244|     56|        result = curlx_dyn_addn(db, "%2B", 3);
  245|     56|        continue;
  246|     56|      }
  247|  29.2k|    }
  248|  81.0k|    else {
  249|  81.0k|      string++;
  250|  81.0k|      len--;
  251|  81.0k|    }
  252|       |
  253|   110k|    if(is_reserved_char(in))
  ------------------
  |  Branch (253:8): [True: 57.5k, False: 52.7k]
  ------------------
  254|       |      /* Escape unreserved chars from RFC 3986 */
  255|  57.5k|      result = curlx_dyn_addn(db, &in, 1);
  256|  52.7k|    else if(in == '+')
  ------------------
  |  Branch (256:13): [True: 2.06k, False: 50.7k]
  ------------------
  257|       |      /* Encode '+' as space */
  258|  2.06k|      result = curlx_dyn_add(db, "%20");
  259|  50.7k|    else
  260|  50.7k|      result = curlx_dyn_addf(db, "%%%02X", in);
  261|   110k|  }
  262|       |
  263|  6.84k|  return result;
  264|  6.84k|}
http_aws_sigv4.c:compare_func:
  647|  18.6k|{
  648|  18.6k|  const struct pair *aa = a;
  649|  18.6k|  const struct pair *bb = b;
  650|  18.6k|  const size_t aa_key_len = curlx_dyn_len(&aa->key);
  651|  18.6k|  const size_t bb_key_len = curlx_dyn_len(&bb->key);
  652|  18.6k|  const size_t aa_value_len = curlx_dyn_len(&aa->value);
  653|  18.6k|  const size_t bb_value_len = curlx_dyn_len(&bb->value);
  654|  18.6k|  int compare;
  655|       |
  656|       |  /* If one element is empty, the other is always sorted higher */
  657|       |
  658|       |  /* Compare keys */
  659|  18.6k|  if((aa_key_len == 0) && (bb_key_len == 0))
  ------------------
  |  Branch (659:6): [True: 1.37k, False: 17.2k]
  |  Branch (659:27): [True: 855, False: 520]
  ------------------
  660|    855|    return 0;
  661|  17.7k|  if(aa_key_len == 0)
  ------------------
  |  Branch (661:6): [True: 520, False: 17.2k]
  ------------------
  662|    520|    return -1;
  663|  17.2k|  if(bb_key_len == 0)
  ------------------
  |  Branch (663:6): [True: 1.53k, False: 15.7k]
  ------------------
  664|  1.53k|    return 1;
  665|  15.7k|  compare = strcmp(curlx_dyn_ptr(&aa->key), curlx_dyn_ptr(&bb->key));
  666|  15.7k|  if(compare) {
  ------------------
  |  Branch (666:6): [True: 13.2k, False: 2.45k]
  ------------------
  667|  13.2k|    return compare;
  668|  13.2k|  }
  669|       |
  670|       |  /* Compare values */
  671|  2.45k|  if((aa_value_len == 0) && (bb_value_len == 0))
  ------------------
  |  Branch (671:6): [True: 0, False: 2.45k]
  |  Branch (671:29): [True: 0, False: 0]
  ------------------
  672|      0|    return 0;
  673|  2.45k|  if(aa_value_len == 0)
  ------------------
  |  Branch (673:6): [True: 0, False: 2.45k]
  ------------------
  674|      0|    return -1;
  675|  2.45k|  if(bb_value_len == 0)
  ------------------
  |  Branch (675:6): [True: 0, False: 2.45k]
  ------------------
  676|      0|    return 1;
  677|  2.45k|  compare = strcmp(curlx_dyn_ptr(&aa->value), curlx_dyn_ptr(&bb->value));
  678|       |
  679|  2.45k|  return compare;
  680|  2.45k|}
http_aws_sigv4.c:pair_array_free:
  122|    569|{
  123|    569|  size_t index;
  124|       |
  125|  5.47k|  for(index = 0; index != num_elements; index++) {
  ------------------
  |  Branch (125:18): [True: 4.90k, False: 569]
  ------------------
  126|  4.90k|    curlx_dyn_free(&pair_array[index].key);
  127|  4.90k|    curlx_dyn_free(&pair_array[index].value);
  128|  4.90k|  }
  129|    569|}
http_aws_sigv4.c:dyn_array_free:
  135|    696|{
  136|    696|  size_t index;
  137|       |
  138|  5.85k|  for(index = 0; index < num_elements; index++)
  ------------------
  |  Branch (138:18): [True: 5.15k, False: 696]
  ------------------
  139|  5.15k|    curlx_dyn_free((&db[index]));
  140|    696|}
http_aws_sigv4.c:parse_content_sha_hdr:
  559|  2.02k|{
  560|  2.02k|  char key[CONTENT_SHA256_KEY_LEN];
  561|  2.02k|  size_t key_len;
  562|  2.02k|  const char *value;
  563|  2.02k|  size_t len;
  564|       |
  565|  2.02k|  key_len = curl_msnprintf(key, sizeof(key), "x-%.*s-content-sha256",
  566|  2.02k|                           (int)plen, provider1);
  567|       |
  568|  2.02k|  value = Curl_checkheaders(data, key, key_len);
  569|  2.02k|  if(!value)
  ------------------
  |  Branch (569:6): [True: 2.02k, False: 0]
  ------------------
  570|  2.02k|    return NULL;
  571|       |
  572|      0|  value = strchr(value, ':');
  573|      0|  if(!value)
  ------------------
  |  Branch (573:6): [True: 0, False: 0]
  ------------------
  574|      0|    return NULL;
  575|      0|  ++value;
  576|       |
  577|      0|  curlx_str_passblanks(&value);
  578|       |
  579|      0|  len = strlen(value);
  580|      0|  while(len > 0 && ISBLANK(value[len - 1]))
  ------------------
  |  |   45|      0|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 0, False: 0]
  |  |  |  Branch (45:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (580:9): [True: 0, False: 0]
  ------------------
  581|      0|    --len;
  582|       |
  583|      0|  *value_len = len;
  584|      0|  return value;
  585|      0|}
http_aws_sigv4.c:calc_s3_payload_hash:
  615|     32|{
  616|     32|  bool empty_method = (httpreq == HTTPREQ_GET || httpreq == HTTPREQ_HEAD);
  ------------------
  |  Branch (616:24): [True: 14, False: 18]
  |  Branch (616:50): [True: 0, False: 18]
  ------------------
  617|       |  /* The request method or filesize indicate no request payload */
  618|     32|  bool empty_payload = (empty_method || data->set.filesize == 0);
  ------------------
  |  Branch (618:25): [True: 14, False: 18]
  |  Branch (618:41): [True: 0, False: 18]
  ------------------
  619|       |  /* The POST payload is in memory */
  620|     32|  bool post_payload = (httpreq == HTTPREQ_POST && data->set.postfields);
  ------------------
  |  Branch (620:24): [True: 15, False: 17]
  |  Branch (620:51): [True: 12, False: 3]
  ------------------
  621|     32|  CURLcode result = CURLE_OUT_OF_MEMORY;
  622|       |
  623|     32|  if(empty_payload || post_payload) {
  ------------------
  |  Branch (623:6): [True: 14, False: 18]
  |  Branch (623:23): [True: 12, False: 6]
  ------------------
  624|       |    /* Calculate a real hash when we know the request payload */
  625|     26|    result = calc_payload_hash(data, sha_hash, sha_hex);
  626|     26|    if(result)
  ------------------
  |  Branch (626:8): [True: 0, False: 26]
  ------------------
  627|      0|      goto fail;
  628|     26|  }
  629|      6|  else {
  630|       |    /* Fall back to s3's UNSIGNED-PAYLOAD */
  631|      6|    size_t len = sizeof(S3_UNSIGNED_PAYLOAD) - 1;
  ------------------
  |  |  607|      6|#define S3_UNSIGNED_PAYLOAD "UNSIGNED-PAYLOAD"
  ------------------
  632|      6|    DEBUGASSERT(len < SHA256_HEX_LENGTH); /* 16 < 65 */
  ------------------
  |  | 1081|      6|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (632:5): [True: 0, False: 6]
  |  Branch (632:5): [True: 6, False: 0]
  ------------------
  633|      6|    memcpy(sha_hex, S3_UNSIGNED_PAYLOAD, len);
  ------------------
  |  |  607|      6|#define S3_UNSIGNED_PAYLOAD "UNSIGNED-PAYLOAD"
  ------------------
  634|      6|    sha_hex[len] = 0;
  635|      6|  }
  636|       |
  637|       |  /* format the required content-sha256 header */
  638|     32|  curl_msnprintf(header, CONTENT_SHA256_HDR_LEN,
  ------------------
  |  |  552|     32|#define CONTENT_SHA256_HDR_LEN (CONTENT_SHA256_KEY_LEN + 2 + SHA256_HEX_LENGTH)
  |  |  ------------------
  |  |  |  |  550|     32|#define CONTENT_SHA256_KEY_LEN (MAX_SIGV4_LEN + sizeof("X--Content-Sha256"))
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|     32|#define MAX_SIGV4_LEN    64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define CONTENT_SHA256_HDR_LEN (CONTENT_SHA256_KEY_LEN + 2 + SHA256_HEX_LENGTH)
  |  |  ------------------
  |  |  |  |   56|     32|#define SHA256_HEX_LENGTH ((2 * CURL_SHA256_DIGEST_LENGTH) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     32|#define CURL_SHA256_DIGEST_LENGTH 32 /* fixed size */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  639|     32|                 "x-%.*s-content-sha256: %s", (int)plen, provider1, sha_hex);
  640|       |
  641|     32|  result = CURLE_OK;
  642|     32|fail:
  643|     32|  return result;
  644|     32|}
http_aws_sigv4.c:calc_payload_hash:
  589|  2.01k|{
  590|  2.01k|  const char *post_data = data->set.postfields;
  591|  2.01k|  size_t post_data_len = 0;
  592|  2.01k|  CURLcode result;
  593|       |
  594|  2.01k|  if(post_data) {
  ------------------
  |  Branch (594:6): [True: 91, False: 1.92k]
  ------------------
  595|     91|    if(data->set.postfieldsize < 0)
  ------------------
  |  Branch (595:8): [True: 91, False: 0]
  ------------------
  596|     91|      post_data_len = strlen(post_data);
  597|      0|    else
  598|      0|      post_data_len = (size_t)data->set.postfieldsize;
  599|     91|  }
  600|  2.01k|  result = Curl_sha256it(sha_hash, (const unsigned char *)post_data,
  601|  2.01k|                         post_data_len);
  602|  2.01k|  if(!result)
  ------------------
  |  Branch (602:6): [True: 2.01k, False: 0]
  ------------------
  603|  2.01k|    sha256_to_hex(sha_hex, sha_hash);
  604|  2.01k|  return result;
  605|  2.01k|}
http_aws_sigv4.c:make_headers:
  382|  2.02k|{
  383|  2.02k|  char date_hdr_key[DATE_HDR_KEY_LEN];
  384|  2.02k|  char date_full_hdr[DATE_FULL_HDR_LEN];
  385|  2.02k|  struct curl_slist *head = NULL;
  386|  2.02k|  struct curl_slist *tmp_head = NULL;
  387|  2.02k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  388|  2.02k|  struct curl_slist *l;
  389|  2.02k|  bool again = TRUE;
  ------------------
  |  | 1055|  2.02k|#define TRUE true
  ------------------
  390|       |
  391|  2.02k|  curl_msnprintf(date_hdr_key, DATE_HDR_KEY_LEN, "X-%.*s-Date",
  ------------------
  |  |  285|  2.02k|#define DATE_HDR_KEY_LEN (MAX_SIGV4_LEN + sizeof("X--Date"))
  |  |  ------------------
  |  |  |  |  284|  2.02k|#define MAX_SIGV4_LEN    64
  |  |  ------------------
  ------------------
  392|  2.02k|                 (int)plen, provider1);
  393|       |  /* provider1 ucfirst */
  394|  2.02k|  Curl_strntolower(&date_hdr_key[2], provider1, plen);
  395|  2.02k|  date_hdr_key[2] = Curl_raw_toupper(provider1[0]);
  396|       |
  397|  2.02k|  curl_msnprintf(date_full_hdr, DATE_FULL_HDR_LEN,
  ------------------
  |  |  288|  2.02k|#define DATE_FULL_HDR_LEN (DATE_HDR_KEY_LEN + TIMESTAMP_SIZE + 1)
  |  |  ------------------
  |  |  |  |  285|  2.02k|#define DATE_HDR_KEY_LEN (MAX_SIGV4_LEN + sizeof("X--Date"))
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  2.02k|#define MAX_SIGV4_LEN    64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DATE_FULL_HDR_LEN (DATE_HDR_KEY_LEN + TIMESTAMP_SIZE + 1)
  |  |  ------------------
  |  |  |  |   53|  2.02k|#define TIMESTAMP_SIZE 17
  |  |  ------------------
  ------------------
  398|  2.02k|                 "x-%.*s-date:%s", (int)plen, provider1, timestamp);
  399|       |  /* provider1 lowercase */
  400|  2.02k|  Curl_strntolower(&date_full_hdr[2], provider1, plen);
  401|       |
  402|  2.02k|  if(!Curl_checkheaders(data, STRCONST("Host"))) {
  ------------------
  |  | 1292|  2.02k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (402:6): [True: 1.96k, False: 59]
  ------------------
  403|  1.96k|    char *fullhost;
  404|       |
  405|  1.96k|    if(data->state.aptr.host) {
  ------------------
  |  Branch (405:8): [True: 1.01k, False: 953]
  ------------------
  406|       |      /* remove /r/n as the separator for canonical request must be '\n' */
  407|  1.01k|      size_t pos = strcspn(data->state.aptr.host, "\n\r");
  408|  1.01k|      fullhost = curlx_memdup0(data->state.aptr.host, pos);
  409|  1.01k|    }
  410|    953|    else
  411|    953|      fullhost = curl_maprintf("host:%s", hostname);
  412|       |
  413|  1.96k|    if(fullhost)
  ------------------
  |  Branch (413:8): [True: 1.96k, False: 0]
  ------------------
  414|  1.96k|      head = Curl_slist_append_nodup(NULL, fullhost);
  415|  1.96k|    if(!head) {
  ------------------
  |  Branch (415:8): [True: 0, False: 1.96k]
  ------------------
  416|      0|      curlx_free(fullhost);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  417|      0|      goto fail;
  418|      0|    }
  419|  1.96k|  }
  420|       |
  421|  2.02k|  if(*content_sha256_header) {
  ------------------
  |  Branch (421:6): [True: 32, False: 1.99k]
  ------------------
  422|     32|    tmp_head = curl_slist_append(head, content_sha256_header);
  423|     32|    if(!tmp_head)
  ------------------
  |  Branch (423:8): [True: 0, False: 32]
  ------------------
  424|      0|      goto fail;
  425|     32|    head = tmp_head;
  426|     32|  }
  427|       |
  428|       |  /* copy user headers to our header list. the logic is based on how http.c
  429|       |     handles user headers.
  430|       |
  431|       |     user headers in format 'name:' with no value are used to signal that an
  432|       |     internal header of that name should be removed. those user headers are not
  433|       |     added to this list.
  434|       |
  435|       |     user headers in format 'name;' with no value are used to signal that a
  436|       |     header of that name with no value should be sent. those user headers are
  437|       |     added to this list but in the format that they will be sent, ie the
  438|       |     semi-colon is changed to a colon for format 'name:'.
  439|       |
  440|       |     user headers with a value of whitespace only, or without a colon or
  441|       |     semi-colon, are not added to this list.
  442|       |     */
  443|  8.37k|  for(l = data->set.headers; l; l = l->next) {
  ------------------
  |  Branch (443:30): [True: 6.35k, False: 2.02k]
  ------------------
  444|  6.35k|    char *dupdata;
  445|  6.35k|    const char *ptr;
  446|  6.35k|    const char *sep = strchr(l->data, ':');
  447|  6.35k|    if(!sep)
  ------------------
  |  Branch (447:8): [True: 1.91k, False: 4.44k]
  ------------------
  448|  1.91k|      sep = strchr(l->data, ';');
  449|  6.35k|    if(!sep || (*sep == ':' && !*(sep + 1)))
  ------------------
  |  Branch (449:8): [True: 1.15k, False: 5.19k]
  |  Branch (449:17): [True: 4.44k, False: 757]
  |  Branch (449:32): [True: 140, False: 4.30k]
  ------------------
  450|  1.29k|      continue;
  451|  7.35k|    for(ptr = sep + 1; ISBLANK(*ptr); ++ptr)
  ------------------
  |  |   45|  7.35k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.99k, False: 5.36k]
  |  |  |  Branch (45:38): [True: 308, False: 5.05k]
  |  |  ------------------
  ------------------
  452|  2.29k|      ;
  453|  5.05k|    if(!*ptr && ptr != sep + 1) /* a value of whitespace only */
  ------------------
  |  Branch (453:8): [True: 444, False: 4.61k]
  |  Branch (453:17): [True: 83, False: 361]
  ------------------
  454|     83|      continue;
  455|  4.97k|    dupdata = curlx_strdup(l->data);
  ------------------
  |  | 1477|  4.97k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  456|  4.97k|    if(!dupdata)
  ------------------
  |  Branch (456:8): [True: 0, False: 4.97k]
  ------------------
  457|      0|      goto fail;
  458|  4.97k|    dupdata[sep - l->data] = ':';
  459|  4.97k|    tmp_head = Curl_slist_append_nodup(head, dupdata);
  460|  4.97k|    if(!tmp_head) {
  ------------------
  |  Branch (460:8): [True: 0, False: 4.97k]
  ------------------
  461|      0|      curlx_free(dupdata);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  462|      0|      goto fail;
  463|      0|    }
  464|  4.97k|    head = tmp_head;
  465|  4.97k|  }
  466|       |
  467|  2.02k|  trim_headers(head);
  468|       |
  469|  2.02k|  *date_header = find_date_hdr(data, date_hdr_key);
  470|  2.02k|  if(!*date_header) {
  ------------------
  |  Branch (470:6): [True: 1.94k, False: 78]
  ------------------
  471|  1.94k|    tmp_head = curl_slist_append(head, date_full_hdr);
  472|  1.94k|    if(!tmp_head)
  ------------------
  |  Branch (472:8): [True: 0, False: 1.94k]
  ------------------
  473|      0|      goto fail;
  474|  1.94k|    head = tmp_head;
  475|  1.94k|    *date_header = curl_maprintf("%s: %s\r\n", date_hdr_key, timestamp);
  476|  1.94k|    if(!*date_header)
  ------------------
  |  Branch (476:8): [True: 0, False: 1.94k]
  ------------------
  477|      0|      goto fail;
  478|  1.94k|  }
  479|     78|  else {
  480|     78|    const char *value;
  481|     78|    const char *endp;
  482|     78|    value = strchr(*date_header, ':');
  483|     78|    if(!value) {
  ------------------
  |  Branch (483:8): [True: 1, False: 77]
  ------------------
  484|      1|      *date_header = NULL;
  485|      1|      goto fail;
  486|      1|    }
  487|     77|    ++value;
  488|     77|    curlx_str_passblanks(&value);
  489|     77|    endp = value;
  490|  1.34k|    while(*endp && ISALNUM(*endp))
  ------------------
  |  |   41|  1.31k|#define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   44|  2.63k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 1.29k, False: 25]
  |  |  |  |  |  Branch (44:38): [True: 484, False: 806]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   43|  2.14k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:22): [True: 441, False: 390]
  |  |  |  |  |  Branch (43:38): [True: 429, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   42|    402|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 375, False: 27]
  |  |  |  |  |  Branch (42:38): [True: 356, False: 19]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (490:11): [True: 1.31k, False: 31]
  ------------------
  491|  1.26k|      ++endp;
  492|       |    /* 16 bytes => "19700101T000000Z" */
  493|     77|    if((endp - value) == TIMESTAMP_SIZE - 1) {
  ------------------
  |  |   53|     77|#define TIMESTAMP_SIZE 17
  ------------------
  |  Branch (493:8): [True: 10, False: 67]
  ------------------
  494|     10|      memcpy(timestamp, value, TIMESTAMP_SIZE - 1);
  ------------------
  |  |   53|     10|#define TIMESTAMP_SIZE 17
  ------------------
  495|     10|      timestamp[TIMESTAMP_SIZE - 1] = 0;
  ------------------
  |  |   53|     10|#define TIMESTAMP_SIZE 17
  ------------------
  496|     10|    }
  497|     67|    else
  498|       |      /* bad timestamp length */
  499|     67|      timestamp[0] = 0;
  500|     77|    *date_header = NULL;
  501|     77|  }
  502|       |
  503|       |  /* alpha-sort by header name in a case sensitive manner */
  504|  4.73k|  do {
  505|  4.73k|    again = FALSE;
  ------------------
  |  | 1058|  4.73k|#define FALSE false
  ------------------
  506|  73.8k|    for(l = head; l; l = l->next) {
  ------------------
  |  Branch (506:19): [True: 69.0k, False: 4.73k]
  ------------------
  507|  69.0k|      struct curl_slist *next = l->next;
  508|       |
  509|  69.0k|      if(next && compare_header_names(l->data, next->data) > 0) {
  ------------------
  |  Branch (509:10): [True: 64.3k, False: 4.72k]
  |  Branch (509:18): [True: 20.8k, False: 43.5k]
  ------------------
  510|  20.8k|        char *tmp = l->data;
  511|       |
  512|  20.8k|        l->data = next->data;
  513|  20.8k|        next->data = tmp;
  514|  20.8k|        again = TRUE;
  ------------------
  |  | 1055|  20.8k|#define TRUE true
  ------------------
  515|  20.8k|      }
  516|  69.0k|    }
  517|  4.73k|  } while(again);
  ------------------
  |  Branch (517:11): [True: 2.71k, False: 2.02k]
  ------------------
  518|       |
  519|  2.02k|  result = merge_duplicate_headers(head);
  520|  2.02k|  if(result)
  ------------------
  |  Branch (520:6): [True: 0, False: 2.02k]
  ------------------
  521|      0|    goto fail;
  522|       |
  523|  8.20k|  for(l = head; l; l = l->next) {
  ------------------
  |  Branch (523:17): [True: 6.18k, False: 2.02k]
  ------------------
  524|  6.18k|    char *tmp;
  525|       |
  526|  6.18k|    if(curlx_dyn_add(canonical_headers, l->data))
  ------------------
  |  Branch (526:8): [True: 0, False: 6.18k]
  ------------------
  527|      0|      goto fail;
  528|  6.18k|    if(curlx_dyn_add(canonical_headers, "\n"))
  ------------------
  |  Branch (528:8): [True: 0, False: 6.18k]
  ------------------
  529|      0|      goto fail;
  530|       |
  531|  6.18k|    tmp = strchr(l->data, ':');
  532|  6.18k|    if(tmp)
  ------------------
  |  Branch (532:8): [True: 6.18k, False: 0]
  ------------------
  533|  6.18k|      *tmp = 0;
  534|       |
  535|  6.18k|    if(l != head) {
  ------------------
  |  Branch (535:8): [True: 4.17k, False: 2.00k]
  ------------------
  536|  4.17k|      if(curlx_dyn_add(signed_headers, ";"))
  ------------------
  |  Branch (536:10): [True: 0, False: 4.17k]
  ------------------
  537|      0|        goto fail;
  538|  4.17k|    }
  539|  6.18k|    if(curlx_dyn_add(signed_headers, l->data))
  ------------------
  |  Branch (539:8): [True: 0, False: 6.18k]
  ------------------
  540|      0|      goto fail;
  541|  6.18k|  }
  542|       |
  543|  2.02k|  result = CURLE_OK;
  544|  2.02k|fail:
  545|  2.02k|  curl_slist_free_all(head);
  546|       |
  547|  2.02k|  return result;
  548|  2.02k|}
http_aws_sigv4.c:trim_headers:
   82|  2.02k|{
   83|  2.02k|  struct curl_slist *l;
   84|  8.99k|  for(l = head; l; l = l->next) {
  ------------------
  |  Branch (84:17): [True: 6.97k, False: 2.02k]
  ------------------
   85|  6.97k|    const char *value; /* to read from */
   86|  6.97k|    char *store;
   87|  6.97k|    size_t colon = strcspn(l->data, ":");
   88|  6.97k|    Curl_strntolower(l->data, l->data, colon);
   89|       |
   90|  6.97k|    value = &l->data[colon];
   91|  6.97k|    if(!*value)
  ------------------
  |  Branch (91:8): [True: 0, False: 6.97k]
  ------------------
   92|      0|      continue;
   93|  6.97k|    ++value;
   94|  6.97k|    store = (char *)CURL_UNCONST(value);
  ------------------
  |  |  866|  6.97k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
   95|       |
   96|       |    /* skip leading whitespace */
   97|  6.97k|    curlx_str_passblanks(&value);
   98|       |
   99|  65.2k|    while(*value) {
  ------------------
  |  Branch (99:11): [True: 58.2k, False: 6.97k]
  ------------------
  100|  58.2k|      int space = 0;
  101|  66.3k|      while(ISBLANK(*value)) {
  ------------------
  |  |   45|  66.3k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 7.36k, False: 59.0k]
  |  |  |  Branch (45:38): [True: 762, False: 58.2k]
  |  |  ------------------
  ------------------
  102|  8.13k|        value++;
  103|  8.13k|        space++;
  104|  8.13k|      }
  105|  58.2k|      if(space) {
  ------------------
  |  Branch (105:10): [True: 4.13k, False: 54.1k]
  ------------------
  106|       |        /* replace any number of consecutive whitespace with a single space,
  107|       |           unless at the end of the string, then nothing */
  108|  4.13k|        if(*value)
  ------------------
  |  Branch (108:12): [True: 3.19k, False: 936]
  ------------------
  109|  3.19k|          *store++ = ' ';
  110|  4.13k|      }
  111|  54.1k|      else
  112|  54.1k|        *store++ = *value++;
  113|  58.2k|    }
  114|  6.97k|    *store = 0; /* null-terminate */
  115|  6.97k|  }
  116|  2.02k|}
http_aws_sigv4.c:find_date_hdr:
   72|  2.02k|{
   73|  2.02k|  char *tmp = Curl_checkheaders(data, sig_hdr, strlen(sig_hdr));
   74|       |
   75|  2.02k|  if(tmp)
  ------------------
  |  Branch (75:6): [True: 54, False: 1.96k]
  ------------------
   76|     54|    return tmp;
   77|  1.96k|  return Curl_checkheaders(data, STRCONST("Date"));
  ------------------
  |  | 1292|  1.96k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
   78|  2.02k|}
http_aws_sigv4.c:compare_header_names:
  293|  71.2k|{
  294|  71.2k|  const char *colon_a;
  295|  71.2k|  const char *colon_b;
  296|  71.2k|  size_t len_a;
  297|  71.2k|  size_t len_b;
  298|  71.2k|  size_t min_len;
  299|  71.2k|  int cmp;
  300|       |
  301|  71.2k|  colon_a = strchr(a, ':');
  302|  71.2k|  colon_b = strchr(b, ':');
  303|       |
  304|  71.2k|  DEBUGASSERT(colon_a);
  ------------------
  |  | 1081|  71.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (304:3): [True: 0, False: 71.2k]
  |  Branch (304:3): [True: 71.2k, False: 0]
  ------------------
  305|  71.2k|  DEBUGASSERT(colon_b);
  ------------------
  |  | 1081|  71.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (305:3): [True: 0, False: 71.2k]
  |  Branch (305:3): [True: 71.2k, False: 0]
  ------------------
  306|       |
  307|  71.2k|  len_a = colon_a ? (size_t)(colon_a - a) : strlen(a);
  ------------------
  |  Branch (307:11): [True: 71.2k, False: 0]
  ------------------
  308|  71.2k|  len_b = colon_b ? (size_t)(colon_b - b) : strlen(b);
  ------------------
  |  Branch (308:11): [True: 71.2k, False: 0]
  ------------------
  309|       |
  310|  71.2k|  min_len = (len_a < len_b) ? len_a : len_b;
  ------------------
  |  Branch (310:13): [True: 14.2k, False: 56.9k]
  ------------------
  311|       |
  312|  71.2k|  cmp = strncmp(a, b, min_len);
  313|       |
  314|       |  /* return the shorter of the two if one is shorter */
  315|  71.2k|  if(!cmp)
  ------------------
  |  Branch (315:6): [True: 38.2k, False: 32.9k]
  ------------------
  316|  38.2k|    return (int)(len_a - len_b);
  317|       |
  318|  32.9k|  return cmp;
  319|  71.2k|}
http_aws_sigv4.c:merge_duplicate_headers:
  325|  2.02k|{
  326|  2.02k|  struct curl_slist *curr = head;
  327|  2.02k|  CURLcode result = CURLE_OK;
  328|       |
  329|  8.92k|  while(curr) {
  ------------------
  |  Branch (329:9): [True: 8.91k, False: 13]
  ------------------
  330|  8.91k|    struct curl_slist *next = curr->next;
  331|  8.91k|    if(!next)
  ------------------
  |  Branch (331:8): [True: 2.00k, False: 6.90k]
  ------------------
  332|  2.00k|      break;
  333|       |
  334|  6.90k|    if(compare_header_names(curr->data, next->data) == 0) {
  ------------------
  |  Branch (334:8): [True: 2.72k, False: 4.17k]
  ------------------
  335|  2.72k|      struct dynbuf buf;
  336|  2.72k|      const char *colon_next;
  337|  2.72k|      const char *val_next;
  338|       |
  339|  2.72k|      curlx_dyn_init(&buf, CURL_MAX_HTTP_HEADER);
  ------------------
  |  |  272|  2.72k|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
  340|       |
  341|  2.72k|      result = curlx_dyn_add(&buf, curr->data);
  342|  2.72k|      if(result)
  ------------------
  |  Branch (342:10): [True: 0, False: 2.72k]
  ------------------
  343|      0|        return result;
  344|       |
  345|  2.72k|      colon_next = strchr(next->data, ':');
  346|  2.72k|      DEBUGASSERT(colon_next);
  ------------------
  |  | 1081|  2.72k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (346:7): [True: 0, False: 2.72k]
  |  Branch (346:7): [True: 2.72k, False: 0]
  ------------------
  347|  2.72k|      val_next = colon_next + 1;
  348|       |
  349|  2.72k|      result = curlx_dyn_addn(&buf, ",", 1);
  350|  2.72k|      if(result)
  ------------------
  |  Branch (350:10): [True: 0, False: 2.72k]
  ------------------
  351|      0|        return result;
  352|       |
  353|  2.72k|      result = curlx_dyn_add(&buf, val_next);
  354|  2.72k|      if(result)
  ------------------
  |  Branch (354:10): [True: 0, False: 2.72k]
  ------------------
  355|      0|        return result;
  356|       |
  357|  2.72k|      curlx_free(curr->data);
  ------------------
  |  | 1483|  2.72k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  358|  2.72k|      curr->data = curlx_dyn_ptr(&buf);
  359|       |
  360|  2.72k|      curr->next = next->next;
  361|  2.72k|      curlx_free(next->data);
  ------------------
  |  | 1483|  2.72k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  362|  2.72k|      curlx_free(next);
  ------------------
  |  | 1483|  2.72k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  363|  2.72k|    }
  364|  4.17k|    else {
  365|  4.17k|      curr = curr->next;
  366|  4.17k|    }
  367|  6.90k|  }
  368|       |
  369|  2.02k|  return CURLE_OK;
  370|  2.02k|}
http_aws_sigv4.c:should_urlencode:
  267|  2.01k|{
  268|       |  /*
  269|       |   * These services require unmodified (not additionally URL-encoded) URL
  270|       |   * paths.
  271|       |   * should_urlencode == true is equivalent to should_urlencode_uri_path
  272|       |   * from the AWS SDK. Urls are already normalized by the curl URL parser
  273|       |   */
  274|       |
  275|  2.01k|  if(curlx_str_cmp(service_name, "s3") ||
  ------------------
  |  Branch (275:6): [True: 32, False: 1.98k]
  ------------------
  276|  1.98k|     curlx_str_cmp(service_name, "s3-express") ||
  ------------------
  |  Branch (276:6): [True: 9, False: 1.97k]
  ------------------
  277|  1.97k|     curlx_str_cmp(service_name, "s3-outposts")) {
  ------------------
  |  Branch (277:6): [True: 12, False: 1.96k]
  ------------------
  278|     53|    return false;
  279|     53|  }
  280|  1.96k|  return true;
  281|  2.01k|}
http_aws_sigv4.c:sha256_to_hex:
   66|  6.05k|{
   67|  6.05k|  Curl_hexencode(sha, CURL_SHA256_DIGEST_LENGTH,
  ------------------
  |  |   37|  6.05k|#define CURL_SHA256_DIGEST_LENGTH 32 /* fixed size */
  ------------------
   68|  6.05k|                 (unsigned char *)dst, SHA256_HEX_LENGTH);
  ------------------
  |  |   56|  6.05k|#define SHA256_HEX_LENGTH ((2 * CURL_SHA256_DIGEST_LENGTH) + 1)
  |  |  ------------------
  |  |  |  |   37|  6.05k|#define CURL_SHA256_DIGEST_LENGTH 32 /* fixed size */
  |  |  ------------------
  ------------------
   69|  6.05k|}

Curl_httpchunk_init:
   74|  8.05k|{
   75|  8.05k|  (void)data;
   76|  8.05k|  ch->hexindex = 0;      /* start at 0 */
   77|  8.05k|  ch->state = CHUNK_HEX; /* we get hex first! */
   78|  8.05k|  ch->last_code = CHUNKE_OK;
   79|  8.05k|  curlx_dyn_init(&ch->trailer, DYN_H1_TRAILER);
  ------------------
  |  |   75|  8.05k|#define DYN_H1_TRAILER      4096
  ------------------
   80|  8.05k|  ch->ignore_body = ignore_body;
   81|  8.05k|}
Curl_httpchunk_reset:
   85|    298|{
   86|    298|  (void)data;
   87|    298|  ch->hexindex = 0;      /* start at 0 */
   88|    298|  ch->state = CHUNK_HEX; /* we get hex first! */
   89|    298|  ch->last_code = CHUNKE_OK;
   90|    298|  curlx_dyn_reset(&ch->trailer);
   91|    298|  ch->ignore_body = ignore_body;
   92|    298|}
Curl_httpchunk_free:
   95|  8.05k|{
   96|  8.05k|  (void)data;
   97|  8.05k|  curlx_dyn_free(&ch->trailer);
   98|  8.05k|}
Curl_httpchunk_is_done:
  101|  12.6k|{
  102|  12.6k|  (void)data;
  103|  12.6k|  return ch->state == CHUNK_DONE;
  104|  12.6k|}
Curl_httpchunk_read:
  384|  12.6k|{
  385|       |  return httpchunk_readwrite(data, ch, NULL, buf, blen, pconsumed);
  386|  12.6k|}
Curl_httpchunk_add_reader:
  655|    101|{
  656|    101|  struct Curl_creader *reader = NULL;
  657|    101|  CURLcode result;
  658|       |
  659|    101|  result = Curl_creader_create(&reader, data, &Curl_httpchunk_encoder,
  660|    101|                               CURL_CR_TRANSFER_ENCODE);
  661|    101|  if(!result)
  ------------------
  |  Branch (661:6): [True: 101, False: 0]
  ------------------
  662|    101|    result = Curl_creader_add(data, reader);
  663|       |
  664|    101|  if(result && reader)
  ------------------
  |  Branch (664:6): [True: 0, False: 101]
  |  Branch (664:16): [True: 0, False: 0]
  ------------------
  665|      0|    Curl_creader_free(data, reader);
  666|    101|  return result;
  667|    101|}
http_chunks.c:httpchunk_readwrite:
  111|  13.7k|{
  112|  13.7k|  CURLcode result = CURLE_OK;
  113|  13.7k|  size_t piece;
  114|       |
  115|  13.7k|  *pconsumed = 0; /* nothing's written yet */
  116|       |  /* first check terminal states that will not progress anywhere */
  117|  13.7k|  if(ch->state == CHUNK_DONE)
  ------------------
  |  Branch (117:6): [True: 0, False: 13.7k]
  ------------------
  118|      0|    return CURLE_OK;
  119|  13.7k|  if(ch->state == CHUNK_FAILED)
  ------------------
  |  Branch (119:6): [True: 0, False: 13.7k]
  ------------------
  120|      0|    return CURLE_RECV_ERROR;
  121|       |
  122|       |  /* the original data is written to the client, but we go on with the
  123|       |     chunk read process, to properly calculate the content length */
  124|  13.7k|  if(data->set.http_te_skip && !ch->ignore_body) {
  ------------------
  |  Branch (124:6): [True: 2.42k, False: 11.3k]
  |  Branch (124:32): [True: 10, False: 2.41k]
  ------------------
  125|     10|    if(cw_next)
  ------------------
  |  Branch (125:8): [True: 10, False: 0]
  ------------------
  126|     10|      result = Curl_cwriter_write(data, cw_next, CLIENTWRITE_BODY, buf, blen);
  ------------------
  |  |   42|     10|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  127|      0|    else
  128|      0|      result = Curl_client_write(data, CLIENTWRITE_BODY, buf, blen);
  ------------------
  |  |   42|      0|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  129|     10|    if(result) {
  ------------------
  |  Branch (129:8): [True: 0, False: 10]
  ------------------
  130|      0|      ch->state = CHUNK_FAILED;
  131|      0|      ch->last_code = CHUNKE_PASSTHRU_ERROR;
  132|      0|      return result;
  133|      0|    }
  134|     10|  }
  135|       |
  136|  37.0k|  while(blen) {
  ------------------
  |  Branch (136:9): [True: 23.4k, False: 13.6k]
  ------------------
  137|  23.4k|    switch(ch->state) {
  ------------------
  |  Branch (137:12): [True: 23.4k, False: 0]
  ------------------
  138|  1.11k|    case CHUNK_HEX:
  ------------------
  |  Branch (138:5): [True: 1.11k, False: 22.3k]
  ------------------
  139|  1.11k|      if(ISXDIGIT(*buf)) {
  ------------------
  |  |   39|  1.11k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   44|  2.23k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 992, False: 127]
  |  |  |  |  |  Branch (44:38): [True: 276, False: 716]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|  1.96k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 411, False: 432]
  |  |  |  |  |  Branch (27:43): [True: 354, False: 57]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|    489|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 351, False: 138]
  |  |  |  |  |  Branch (28:43): [True: 270, False: 81]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  140|    900|        if(ch->hexindex >= CHUNK_MAXNUM_LEN) {
  ------------------
  |  |   39|    900|#define CHUNK_MAXNUM_LEN (SIZEOF_CURL_OFF_T * 2)
  |  |  ------------------
  |  |  |  |  632|    900|#define SIZEOF_CURL_OFF_T 8
  |  |  ------------------
  ------------------
  |  Branch (140:12): [True: 6, False: 894]
  ------------------
  141|      6|          failf(data, "chunk hex-length longer than %d", CHUNK_MAXNUM_LEN);
  ------------------
  |  |   62|      6|#define failf Curl_failf
  ------------------
                        failf(data, "chunk hex-length longer than %d", CHUNK_MAXNUM_LEN);
  ------------------
  |  |   39|      6|#define CHUNK_MAXNUM_LEN (SIZEOF_CURL_OFF_T * 2)
  |  |  ------------------
  |  |  |  |  632|      6|#define SIZEOF_CURL_OFF_T 8
  |  |  ------------------
  ------------------
  142|      6|          ch->state = CHUNK_FAILED;
  143|      6|          ch->last_code = CHUNKE_TOO_LONG_HEX; /* longer than we support */
  144|      6|          return CURLE_RECV_ERROR;
  145|      6|        }
  146|    894|        ch->hexbuffer[ch->hexindex++] = *buf;
  147|    894|        buf++;
  148|    894|        blen--;
  149|    894|        (*pconsumed)++;
  150|    894|      }
  151|    219|      else {
  152|    219|        const char *p;
  153|    219|        if(ch->hexindex == 0) {
  ------------------
  |  Branch (153:12): [True: 7, False: 212]
  ------------------
  154|       |          /* This is illegal data, we received junk where we expected
  155|       |             a hexadecimal digit. */
  156|      7|          failf(data, "chunk hex-length char not a hex digit: 0x%x", *buf);
  ------------------
  |  |   62|      7|#define failf Curl_failf
  ------------------
  157|      7|          ch->state = CHUNK_FAILED;
  158|      7|          ch->last_code = CHUNKE_ILLEGAL_HEX;
  159|      7|          return CURLE_RECV_ERROR;
  160|      7|        }
  161|       |        /* blen and buf are unmodified */
  162|    212|        ch->hexbuffer[ch->hexindex] = 0;
  163|    212|        p = &ch->hexbuffer[0];
  164|    212|        if(curlx_str_hex(&p, &ch->datasize, CURL_OFF_T_MAX)) {
  ------------------
  |  |  594|    212|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (164:12): [True: 2, False: 210]
  ------------------
  165|      2|          failf(data, "invalid chunk size: '%s'", ch->hexbuffer);
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
  166|      2|          ch->state = CHUNK_FAILED;
  167|      2|          ch->last_code = CHUNKE_ILLEGAL_HEX;
  168|      2|          return CURLE_RECV_ERROR;
  169|      2|        }
  170|    210|        ch->state = CHUNK_LF; /* now wait for the CRLF */
  171|    210|      }
  172|  1.10k|      break;
  173|       |
  174|  9.40k|    case CHUNK_LF:
  ------------------
  |  Branch (174:5): [True: 9.40k, False: 14.0k]
  ------------------
  175|       |      /* waiting for the LF after a chunk size */
  176|  9.40k|      if(*buf == 0x0a) {
  ------------------
  |  Branch (176:10): [True: 198, False: 9.20k]
  ------------------
  177|       |        /* we are now expecting data to come, unless size was zero! */
  178|    198|        if(ch->datasize == 0) {
  ------------------
  |  Branch (178:12): [True: 43, False: 155]
  ------------------
  179|     43|          ch->state = CHUNK_TRAILER; /* now check for trailers */
  180|     43|        }
  181|    155|        else {
  182|    155|          ch->state = CHUNK_DATA;
  183|    155|          CURL_TRC_WRITE(data, "http_chunked, chunk start of %"
  ------------------
  |  |  158|    155|  do {                                                     \
  |  |  159|    155|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|    155|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    310|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 155, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 155]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    310|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    155|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|    155|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|    155|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 155]
  |  |  ------------------
  ------------------
  184|    155|                         FMT_OFF_T " bytes", ch->datasize);
  185|    155|        }
  186|    198|      }
  187|       |
  188|  9.40k|      buf++;
  189|  9.40k|      blen--;
  190|  9.40k|      (*pconsumed)++;
  191|  9.40k|      break;
  192|       |
  193|  5.01k|    case CHUNK_DATA:
  ------------------
  |  Branch (193:5): [True: 5.01k, False: 18.4k]
  ------------------
  194|       |      /* We expect 'datasize' of data. We have 'blen' right now, it can be
  195|       |         more or less than 'datasize'. Get the smallest piece.
  196|       |      */
  197|  5.01k|      piece = blen;
  198|  5.01k|      if(ch->datasize < (curl_off_t)blen)
  ------------------
  |  Branch (198:10): [True: 54, False: 4.95k]
  ------------------
  199|     54|        piece = curlx_sotouz(ch->datasize);
  200|       |
  201|       |      /* Write the data portion available */
  202|  5.01k|      if(!data->set.http_te_skip && !ch->ignore_body) {
  ------------------
  |  Branch (202:10): [True: 3.82k, False: 1.18k]
  |  Branch (202:37): [True: 58, False: 3.76k]
  ------------------
  203|     58|        if(cw_next)
  ------------------
  |  Branch (203:12): [True: 58, False: 0]
  ------------------
  204|     58|          result = Curl_cwriter_write(data, cw_next, CLIENTWRITE_BODY,
  ------------------
  |  |   42|     58|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  205|     58|                                      buf, piece);
  206|      0|        else
  207|      0|          result = Curl_client_write(data, CLIENTWRITE_BODY, buf, piece);
  ------------------
  |  |   42|      0|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  208|     58|        if(result) {
  ------------------
  |  Branch (208:12): [True: 1, False: 57]
  ------------------
  209|      1|          ch->state = CHUNK_FAILED;
  210|      1|          ch->last_code = CHUNKE_PASSTHRU_ERROR;
  211|      1|          return result;
  212|      1|        }
  213|     58|      }
  214|       |
  215|  5.01k|      *pconsumed += piece;
  216|  5.01k|      ch->datasize -= piece; /* decrease amount left to expect */
  217|  5.01k|      buf += piece;    /* move read pointer forward */
  218|  5.01k|      blen -= piece;   /* decrease space left in this round */
  219|  5.01k|      CURL_TRC_WRITE(data, "http_chunked, write %zu body bytes, %"
  ------------------
  |  |  158|  5.01k|  do {                                                     \
  |  |  159|  5.01k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|  5.01k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  10.0k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 5.01k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 5.01k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  10.0k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  5.01k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|  5.01k|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|  5.01k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 5.01k]
  |  |  ------------------
  ------------------
  220|  5.01k|                     FMT_OFF_T " bytes in chunk remain",
  221|  5.01k|                     piece, ch->datasize);
  222|       |
  223|  5.01k|      if(ch->datasize == 0)
  ------------------
  |  Branch (223:10): [True: 92, False: 4.91k]
  ------------------
  224|       |        /* end of data this round, we now expect a trailing CRLF */
  225|     92|        ch->state = CHUNK_POSTLF;
  226|  5.01k|      break;
  227|       |
  228|    376|    case CHUNK_POSTLF:
  ------------------
  |  Branch (228:5): [True: 376, False: 23.0k]
  ------------------
  229|    376|      if(*buf == 0x0a) {
  ------------------
  |  Branch (229:10): [True: 59, False: 317]
  ------------------
  230|       |        /* The last one before we go back to hex state and start all over. */
  231|     59|        Curl_httpchunk_reset(data, ch, (bool)ch->ignore_body);
  232|     59|      }
  233|    317|      else if(*buf != 0x0d) {
  ------------------
  |  Branch (233:15): [True: 33, False: 284]
  ------------------
  234|     33|        ch->state = CHUNK_FAILED;
  235|     33|        ch->last_code = CHUNKE_BAD_CHUNK;
  236|     33|        return CURLE_RECV_ERROR;
  237|     33|      }
  238|    343|      buf++;
  239|    343|      blen--;
  240|    343|      (*pconsumed)++;
  241|    343|      break;
  242|       |
  243|  7.05k|    case CHUNK_TRAILER:
  ------------------
  |  Branch (243:5): [True: 7.05k, False: 16.3k]
  ------------------
  244|  7.05k|      if((*buf == 0x0d) || (*buf == 0x0a)) {
  ------------------
  |  Branch (244:10): [True: 44, False: 7.01k]
  |  Branch (244:28): [True: 208, False: 6.80k]
  ------------------
  245|    252|        const char *tr = curlx_dyn_ptr(&ch->trailer);
  246|       |        /* this is the end of a trailer, but if the trailer was zero bytes
  247|       |           there was no trailer and we move on */
  248|       |
  249|    252|        if(tr) {
  ------------------
  |  Branch (249:12): [True: 250, False: 2]
  ------------------
  250|    250|          result = curlx_dyn_addn(&ch->trailer, STRCONST("\x0d\x0a"));
  ------------------
  |  | 1292|    250|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  251|    250|          if(result) {
  ------------------
  |  Branch (251:14): [True: 0, False: 250]
  ------------------
  252|      0|            ch->state = CHUNK_FAILED;
  253|      0|            ch->last_code = CHUNKE_OUT_OF_MEMORY;
  254|      0|            return result;
  255|      0|          }
  256|    250|          tr = curlx_dyn_ptr(&ch->trailer);
  257|    250|          if(!data->set.http_te_skip) {
  ------------------
  |  Branch (257:14): [True: 210, False: 40]
  ------------------
  258|    210|            size_t trlen = curlx_dyn_len(&ch->trailer);
  259|    210|            if(cw_next)
  ------------------
  |  Branch (259:16): [True: 116, False: 94]
  ------------------
  260|    116|              result = Curl_cwriter_write(data, cw_next,
  261|    116|                                          CLIENTWRITE_HEADER |
  ------------------
  |  |   44|    116|#define CLIENTWRITE_HEADER  (1 << 2) /* meta information, HEADER */
  ------------------
  262|    116|                                          CLIENTWRITE_TRAILER,
  ------------------
  |  |   48|    116|#define CLIENTWRITE_TRAILER (1 << 6) /* a trailer HEADER */
  ------------------
  263|    116|                                          tr, trlen);
  264|     94|            else
  265|     94|              result = Curl_client_write(data,
  266|     94|                                         CLIENTWRITE_HEADER |
  ------------------
  |  |   44|     94|#define CLIENTWRITE_HEADER  (1 << 2) /* meta information, HEADER */
  ------------------
  267|     94|                                         CLIENTWRITE_TRAILER,
  ------------------
  |  |   48|     94|#define CLIENTWRITE_TRAILER (1 << 6) /* a trailer HEADER */
  ------------------
  268|     94|                                         tr, trlen);
  269|    210|            if(result) {
  ------------------
  |  Branch (269:16): [True: 17, False: 193]
  ------------------
  270|     17|              ch->state = CHUNK_FAILED;
  271|     17|              ch->last_code = CHUNKE_PASSTHRU_ERROR;
  272|     17|              return result;
  273|     17|            }
  274|    210|          }
  275|    233|          curlx_dyn_reset(&ch->trailer);
  276|    233|          ch->state = CHUNK_TRAILER_CR;
  277|    233|          if(*buf == 0x0a)
  ------------------
  |  Branch (277:14): [True: 192, False: 41]
  ------------------
  278|       |            /* already on the LF */
  279|    192|            break;
  280|    233|        }
  281|      2|        else {
  282|       |          /* no trailer, we are on the final CRLF pair */
  283|      2|          ch->state = CHUNK_TRAILER_POSTCR;
  284|      2|          break; /* do not advance the pointer */
  285|      2|        }
  286|    252|      }
  287|  6.80k|      else {
  288|  6.80k|        result = curlx_dyn_addn(&ch->trailer, buf, 1);
  289|  6.80k|        if(result) {
  ------------------
  |  Branch (289:12): [True: 0, False: 6.80k]
  ------------------
  290|      0|          ch->state = CHUNK_FAILED;
  291|      0|          ch->last_code = CHUNKE_OUT_OF_MEMORY;
  292|      0|          return result;
  293|      0|        }
  294|  6.80k|      }
  295|  6.84k|      buf++;
  296|  6.84k|      blen--;
  297|  6.84k|      (*pconsumed)++;
  298|  6.84k|      break;
  299|       |
  300|    233|    case CHUNK_TRAILER_CR:
  ------------------
  |  Branch (300:5): [True: 233, False: 23.2k]
  ------------------
  301|    233|      if(*buf == 0x0a) {
  ------------------
  |  Branch (301:10): [True: 228, False: 5]
  ------------------
  302|    228|        ch->state = CHUNK_TRAILER_POSTCR;
  303|    228|        buf++;
  304|    228|        blen--;
  305|    228|        (*pconsumed)++;
  306|    228|      }
  307|      5|      else {
  308|      5|        ch->state = CHUNK_FAILED;
  309|      5|        ch->last_code = CHUNKE_BAD_CHUNK;
  310|      5|        return CURLE_RECV_ERROR;
  311|      5|      }
  312|    228|      break;
  313|       |
  314|    230|    case CHUNK_TRAILER_POSTCR:
  ------------------
  |  Branch (314:5): [True: 230, False: 23.2k]
  ------------------
  315|       |      /* We enter this state when a CR should arrive so we expect to
  316|       |         have to first pass a CR before we wait for LF */
  317|    230|      if((*buf != 0x0d) && (*buf != 0x0a)) {
  ------------------
  |  Branch (317:10): [True: 229, False: 1]
  |  Branch (317:28): [True: 216, False: 13]
  ------------------
  318|       |        /* not a CR then it must be another header in the trailer */
  319|    216|        ch->state = CHUNK_TRAILER;
  320|    216|        break;
  321|    216|      }
  322|     14|      if(*buf == 0x0d) {
  ------------------
  |  Branch (322:10): [True: 1, False: 13]
  ------------------
  323|       |        /* skip if CR */
  324|      1|        buf++;
  325|      1|        blen--;
  326|      1|        (*pconsumed)++;
  327|      1|      }
  328|       |      /* now wait for the final LF */
  329|     14|      ch->state = CHUNK_STOP;
  330|     14|      break;
  331|       |
  332|     14|    case CHUNK_STOP:
  ------------------
  |  Branch (332:5): [True: 14, False: 23.4k]
  ------------------
  333|     14|      if(*buf == 0x0a) {
  ------------------
  |  Branch (333:10): [True: 13, False: 1]
  ------------------
  334|     13|        blen--;
  335|     13|        (*pconsumed)++;
  336|       |        /* Record the length of any data left in the end of the buffer
  337|       |           even if there is no more chunks to read */
  338|     13|        ch->datasize = blen;
  339|     13|        ch->state = CHUNK_DONE;
  340|     13|        CURL_TRC_WRITE(data, "http_chunk, response complete");
  ------------------
  |  |  158|     13|  do {                                                     \
  |  |  159|     13|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|     13|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     26|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 13, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 13]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     26|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|     13|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|     13|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|     13|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 13]
  |  |  ------------------
  ------------------
  341|     13|        return CURLE_OK;
  342|     13|      }
  343|      1|      else {
  344|      1|        ch->state = CHUNK_FAILED;
  345|      1|        ch->last_code = CHUNKE_BAD_CHUNK;
  346|      1|        CURL_TRC_WRITE(data, "http_chunk error, expected 0x0a, seeing 0x%ux",
  ------------------
  |  |  158|      1|  do {                                                     \
  |  |  159|      1|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|      1|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      2|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 1, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      2|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      1|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|      1|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|      1|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 1]
  |  |  ------------------
  ------------------
  347|      1|                       (unsigned int)*buf);
  348|      1|        return CURLE_RECV_ERROR;
  349|      1|      }
  350|      0|    case CHUNK_DONE:
  ------------------
  |  Branch (350:5): [True: 0, False: 23.4k]
  ------------------
  351|      0|      return CURLE_OK;
  352|       |
  353|      0|    case CHUNK_FAILED:
  ------------------
  |  Branch (353:5): [True: 0, False: 23.4k]
  ------------------
  354|      0|      return CURLE_RECV_ERROR;
  355|  23.4k|    }
  356|  23.4k|  }
  357|  13.6k|  return CURLE_OK;
  358|  13.7k|}
http_chunks.c:cw_chunked_init:
  395|     69|{
  396|     69|  struct chunked_writer *ctx = writer->ctx;
  397|       |
  398|     69|  data->req.chunk = TRUE;      /* chunks coming our way. */
  ------------------
  |  | 1055|     69|#define TRUE true
  ------------------
  399|       |  Curl_httpchunk_init(data, &ctx->ch, FALSE);
  ------------------
  |  | 1058|     69|#define FALSE false
  ------------------
  400|     69|  return CURLE_OK;
  401|     69|}
http_chunks.c:cw_chunked_write:
  413|  1.49k|{
  414|  1.49k|  struct chunked_writer *ctx = writer->ctx;
  415|  1.49k|  CURLcode result;
  416|  1.49k|  size_t consumed;
  417|       |
  418|  1.49k|  if(!(type & CLIENTWRITE_BODY))
  ------------------
  |  |   42|  1.49k|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  |  Branch (418:6): [True: 413, False: 1.08k]
  ------------------
  419|    413|    return Curl_cwriter_write(data, writer->next, type, buf, blen);
  420|       |
  421|  1.08k|  consumed = 0;
  422|  1.08k|  result = httpchunk_readwrite(data, &ctx->ch, writer->next, buf, blen,
  423|  1.08k|                               &consumed);
  424|       |
  425|  1.08k|  if(result) {
  ------------------
  |  Branch (425:6): [True: 30, False: 1.05k]
  ------------------
  426|     30|    if(CHUNKE_PASSTHRU_ERROR == ctx->ch.last_code) {
  ------------------
  |  Branch (426:8): [True: 9, False: 21]
  ------------------
  427|      9|      failf(data, "Failed reading the chunked-encoded stream");
  ------------------
  |  |   62|      9|#define failf Curl_failf
  ------------------
  428|      9|    }
  429|     21|    else {
  430|     21|      failf(data, "%s in chunked-encoding",
  ------------------
  |  |   62|     21|#define failf Curl_failf
  ------------------
  431|     21|            Curl_chunked_strerror(ctx->ch.last_code));
  432|     21|    }
  433|     30|    return result;
  434|     30|  }
  435|       |
  436|  1.05k|  blen -= consumed;
  437|  1.05k|  if(CHUNK_DONE == ctx->ch.state) {
  ------------------
  |  Branch (437:6): [True: 9, False: 1.04k]
  ------------------
  438|       |    /* chunks read successfully, download is complete */
  439|      9|    data->req.download_done = TRUE;
  ------------------
  |  | 1055|      9|#define TRUE true
  ------------------
  440|      9|    if(blen) {
  ------------------
  |  Branch (440:8): [True: 8, False: 1]
  ------------------
  441|      8|      infof(data, "Leftovers after chunking: %zu bytes", blen);
  ------------------
  |  |  143|      8|  do {                               \
  |  |  144|      8|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      8|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 8, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 8]
  |  |  |  |  ------------------
  |  |  |  |  320|      8|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      8|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      8|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 8]
  |  |  ------------------
  ------------------
  442|      8|    }
  443|      9|  }
  444|  1.04k|  else if((type & CLIENTWRITE_EOS) && !data->req.no_body) {
  ------------------
  |  |   49|  1.04k|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
  |  Branch (444:11): [True: 10, False: 1.03k]
  |  Branch (444:39): [True: 10, False: 0]
  ------------------
  445|     10|    failf(data, "transfer closed with outstanding read data remaining");
  ------------------
  |  |   62|     10|#define failf Curl_failf
  ------------------
  446|     10|    return CURLE_PARTIAL_FILE;
  447|     10|  }
  448|       |
  449|  1.04k|  return CURLE_OK;
  450|  1.05k|}
http_chunks.c:Curl_chunked_strerror:
  361|     21|{
  362|     21|  switch(code) {
  363|      0|  default:
  ------------------
  |  Branch (363:3): [True: 0, False: 21]
  ------------------
  364|      0|    return "OK";
  365|      3|  case CHUNKE_TOO_LONG_HEX:
  ------------------
  |  Branch (365:3): [True: 3, False: 18]
  ------------------
  366|      3|    return "Too long hexadecimal number";
  367|      5|  case CHUNKE_ILLEGAL_HEX:
  ------------------
  |  Branch (367:3): [True: 5, False: 16]
  ------------------
  368|      5|    return "Illegal or missing hexadecimal sequence";
  369|     13|  case CHUNKE_BAD_CHUNK:
  ------------------
  |  Branch (369:3): [True: 13, False: 8]
  ------------------
  370|     13|    return "Malformed encoding found";
  371|      0|  case CHUNKE_PASSTHRU_ERROR:
  ------------------
  |  Branch (371:3): [True: 0, False: 21]
  ------------------
  372|      0|    return "Error writing data to client";
  373|      0|  case CHUNKE_BAD_ENCODING:
  ------------------
  |  Branch (373:3): [True: 0, False: 21]
  ------------------
  374|      0|    return "Bad content-encoding found";
  375|      0|  case CHUNKE_OUT_OF_MEMORY:
  ------------------
  |  Branch (375:3): [True: 0, False: 21]
  ------------------
  376|      0|    return "Out of memory";
  377|     21|  }
  378|     21|}
http_chunks.c:cw_chunked_close:
  405|     69|{
  406|     69|  struct chunked_writer *ctx = writer->ctx;
  407|     69|  Curl_httpchunk_free(data, &ctx->ch);
  408|     69|}
http_chunks.c:cr_chunked_init:
  475|    101|{
  476|    101|  struct chunked_reader *ctx = reader->ctx;
  477|    101|  (void)data;
  478|    101|  Curl_bufq_init2(&ctx->chunkbuf, CURL_CHUNKED_MAXLEN, 2, BUFQ_OPT_SOFT_LIMIT);
  ------------------
  |  |  464|    101|#define CURL_CHUNKED_MAXLEN   (64 * 1024)
  ------------------
                Curl_bufq_init2(&ctx->chunkbuf, CURL_CHUNKED_MAXLEN, 2, BUFQ_OPT_SOFT_LIMIT);
  ------------------
  |  |  111|    101|#define BUFQ_OPT_SOFT_LIMIT  (1 << 0)
  ------------------
  479|    101|  return CURLE_OK;
  480|    101|}
http_chunks.c:cr_chunked_read:
  600|    582|{
  601|    582|  struct chunked_reader *ctx = reader->ctx;
  602|    582|  CURLcode result = CURLE_READ_ERROR;
  603|       |
  604|    582|  *pnread = 0;
  605|    582|  *peos = (bool)ctx->eos;
  606|       |
  607|    582|  if(!ctx->eos) {
  ------------------
  |  Branch (607:6): [True: 582, False: 0]
  ------------------
  608|    582|    if(!ctx->read_eos && Curl_bufq_is_empty(&ctx->chunkbuf)) {
  ------------------
  |  Branch (608:8): [True: 582, False: 0]
  |  Branch (608:26): [True: 582, False: 0]
  ------------------
  609|       |      /* Still getting data form the next reader, buffer is empty */
  610|    582|      result = add_chunk(data, reader, buf, blen);
  611|    582|      if(result)
  ------------------
  |  Branch (611:10): [True: 3, False: 579]
  ------------------
  612|      3|        return result;
  613|    582|    }
  614|       |
  615|    579|    if(!Curl_bufq_is_empty(&ctx->chunkbuf)) {
  ------------------
  |  Branch (615:8): [True: 43, False: 536]
  ------------------
  616|     43|      result = Curl_bufq_cread(&ctx->chunkbuf, buf, blen, pnread);
  617|     43|      if(!result && ctx->read_eos && Curl_bufq_is_empty(&ctx->chunkbuf)) {
  ------------------
  |  Branch (617:10): [True: 43, False: 0]
  |  Branch (617:21): [True: 41, False: 2]
  |  Branch (617:38): [True: 36, False: 5]
  ------------------
  618|       |        /* no more data, read all, done. */
  619|     36|        ctx->eos = TRUE;
  ------------------
  |  | 1055|     36|#define TRUE true
  ------------------
  620|     36|        *peos = TRUE;
  ------------------
  |  | 1055|     36|#define TRUE true
  ------------------
  621|     36|      }
  622|     43|      return result;
  623|     43|    }
  624|    579|  }
  625|       |  /* We may get here, because we are done or because callbacks paused */
  626|    536|  DEBUGASSERT(ctx->eos || !ctx->read_eos);
  ------------------
  |  | 1081|    536|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (626:3): [True: 536, False: 0]
  |  Branch (626:3): [True: 0, False: 0]
  |  Branch (626:3): [True: 0, False: 536]
  |  Branch (626:3): [True: 536, False: 0]
  ------------------
  627|    536|  return CURLE_OK;
  628|    536|}
http_chunks.c:add_chunk:
  545|    582|{
  546|    582|  struct chunked_reader *ctx = reader->ctx;
  547|    582|  CURLcode result;
  548|    582|  char tmp[CURL_CHUNKED_MINLEN];
  549|    582|  size_t nread;
  550|    582|  bool eos;
  551|       |
  552|    582|  DEBUGASSERT(!ctx->read_eos);
  ------------------
  |  | 1081|    582|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (552:3): [True: 0, False: 582]
  |  Branch (552:3): [True: 582, False: 0]
  ------------------
  553|    582|  blen = CURLMIN(blen, CURL_CHUNKED_MAXLEN); /* respect our buffer pref */
  ------------------
  |  | 1287|    582|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 175, False: 407]
  |  |  ------------------
  ------------------
  554|    582|  if(blen < sizeof(tmp)) {
  ------------------
  |  Branch (554:6): [True: 87, False: 495]
  ------------------
  555|       |    /* small read, make a chunk of decent size */
  556|     87|    buf = tmp;
  557|     87|    blen = sizeof(tmp);
  558|     87|  }
  559|    495|  else {
  560|       |    /* larger read, make a chunk that will fit when read back */
  561|    495|    blen -= (8 + 2 + 2); /* deduct max overhead, 8 hex + 2*crlf */
  562|    495|  }
  563|       |
  564|    582|  result = Curl_creader_read(data, reader->next, buf, blen, &nread, &eos);
  565|    582|  if(result)
  ------------------
  |  Branch (565:6): [True: 3, False: 579]
  ------------------
  566|      3|    return result;
  567|    579|  if(eos)
  ------------------
  |  Branch (567:6): [True: 41, False: 538]
  ------------------
  568|     41|    ctx->read_eos = TRUE;
  ------------------
  |  | 1055|     41|#define TRUE true
  ------------------
  569|       |
  570|    579|  if(nread) {
  ------------------
  |  Branch (570:6): [True: 42, False: 537]
  ------------------
  571|       |    /* actually got bytes, wrap them into the chunkbuf */
  572|     42|    char hd[11] = "";
  573|     42|    int hdlen;
  574|     42|    size_t n;
  575|       |
  576|     42|    hdlen = curl_msnprintf(hd, sizeof(hd), "%zx\r\n", nread);
  577|     42|    if(hdlen <= 0)
  ------------------
  |  Branch (577:8): [True: 0, False: 42]
  ------------------
  578|      0|      return CURLE_READ_ERROR;
  579|       |    /* On a soft-limited bufq, we do not need to check that all was written */
  580|     42|    result = Curl_bufq_cwrite(&ctx->chunkbuf, hd, hdlen, &n);
  581|     42|    if(!result)
  ------------------
  |  Branch (581:8): [True: 42, False: 0]
  ------------------
  582|     42|      result = Curl_bufq_cwrite(&ctx->chunkbuf, buf, nread, &n);
  583|     42|    if(!result)
  ------------------
  |  Branch (583:8): [True: 42, False: 0]
  ------------------
  584|     42|      result = Curl_bufq_cwrite(&ctx->chunkbuf, "\r\n", 2, &n);
  585|     42|    CURL_TRC_READ(data, "http_chunk, made chunk of %zu bytes -> %d",
  ------------------
  |  |  163|     42|  do {                                                    \
  |  |  164|     42|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|     42|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     84|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 42, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 42]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     84|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|     42|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|     42|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|     42|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 42]
  |  |  ------------------
  ------------------
  586|     42|                  nread, result);
  587|     42|    if(result)
  ------------------
  |  Branch (587:8): [True: 0, False: 42]
  ------------------
  588|      0|      return result;
  589|     42|  }
  590|       |
  591|    579|  if(ctx->read_eos)
  ------------------
  |  Branch (591:6): [True: 41, False: 538]
  ------------------
  592|     41|    return add_last_chunk(data, reader);
  593|    538|  return CURLE_OK;
  594|    579|}
http_chunks.c:add_last_chunk:
  492|     41|{
  493|     41|  struct chunked_reader *ctx = reader->ctx;
  494|     41|  struct curl_slist *trailers = NULL, *tr;
  495|     41|  CURLcode result;
  496|     41|  size_t n;
  497|     41|  int rc;
  498|       |
  499|     41|  if(!data->set.trailer_callback) {
  ------------------
  |  Branch (499:6): [True: 41, False: 0]
  ------------------
  500|     41|    CURL_TRC_READ(data, "http_chunk, added last, empty chunk");
  ------------------
  |  |  163|     41|  do {                                                    \
  |  |  164|     41|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|     41|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     82|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 41, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 41]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     82|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|     41|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|     41|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|     41|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 41]
  |  |  ------------------
  ------------------
  501|     41|    return Curl_bufq_cwrite(&ctx->chunkbuf, STRCONST("0\r\n\r\n"), &n);
  ------------------
  |  | 1292|     41|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  502|     41|  }
  503|       |
  504|      0|  result = Curl_bufq_cwrite(&ctx->chunkbuf, STRCONST("0\r\n"), &n);
  ------------------
  |  | 1292|      0|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  505|      0|  if(result)
  ------------------
  |  Branch (505:6): [True: 0, False: 0]
  ------------------
  506|      0|    goto out;
  507|       |
  508|      0|  Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  509|      0|  rc = data->set.trailer_callback(&trailers, data->set.trailer_data);
  510|      0|  Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  511|       |
  512|      0|  if(rc != CURL_TRAILERFUNC_OK) {
  ------------------
  |  |  397|      0|#define CURL_TRAILERFUNC_OK 0
  ------------------
  |  Branch (512:6): [True: 0, False: 0]
  ------------------
  513|      0|    failf(data, "operation aborted by trailing headers callback");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  514|      0|    result = CURLE_ABORTED_BY_CALLBACK;
  515|      0|    goto out;
  516|      0|  }
  517|       |
  518|      0|  for(tr = trailers; tr; tr = tr->next) {
  ------------------
  |  Branch (518:22): [True: 0, False: 0]
  ------------------
  519|       |    /* only add correctly formatted trailers */
  520|      0|    const char *ptr = strchr(tr->data, ':');
  521|      0|    if(!ptr || *(ptr + 1) != ' ') {
  ------------------
  |  Branch (521:8): [True: 0, False: 0]
  |  Branch (521:16): [True: 0, False: 0]
  ------------------
  522|      0|      infof(data, "Malformatted trailing header, skipping trailer");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  523|      0|      continue;
  524|      0|    }
  525|       |
  526|      0|    result = Curl_bufq_cwrite(&ctx->chunkbuf, tr->data, strlen(tr->data), &n);
  527|      0|    if(!result)
  ------------------
  |  Branch (527:8): [True: 0, False: 0]
  ------------------
  528|      0|      result = Curl_bufq_cwrite(&ctx->chunkbuf, STRCONST("\r\n"), &n);
  ------------------
  |  | 1292|      0|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  529|      0|    if(result)
  ------------------
  |  Branch (529:8): [True: 0, False: 0]
  ------------------
  530|      0|      goto out;
  531|      0|  }
  532|       |
  533|      0|  result = Curl_bufq_cwrite(&ctx->chunkbuf, STRCONST("\r\n"), &n);
  ------------------
  |  | 1292|      0|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  534|       |
  535|      0|out:
  536|      0|  curl_slist_free_all(trailers);
  537|      0|  CURL_TRC_READ(data, "http_chunk, added last chunk with trailers "
  ------------------
  |  |  163|      0|  do {                                                    \
  |  |  164|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|      0|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  538|      0|                "from client -> %d", result);
  539|      0|  return result;
  540|      0|}
http_chunks.c:cr_chunked_close:
  484|    101|{
  485|    101|  struct chunked_reader *ctx = reader->ctx;
  486|    101|  (void)data;
  487|    101|  Curl_bufq_free(&ctx->chunkbuf);
  488|    101|}
http_chunks.c:cr_chunked_total_length:
  632|    216|{
  633|       |  /* this reader changes length depending on input */
  634|    216|  (void)data;
  635|    216|  (void)reader;
  636|    216|  return -1;
  637|    216|}

Curl_output_digest:
   69|     33|{
   70|     33|  CURLcode result;
   71|     33|  char *response;
   72|     33|  size_t len;
   73|     33|  bool have_chlg;
   74|       |
   75|       |  /* Point to the address of the pointer that holds the string to send to the
   76|       |     server, which is for a plain host or for an HTTP proxy */
   77|     33|  char **allocuserpwd;
   78|       |
   79|       |  /* Point to the name and password for this */
   80|     33|  struct Curl_creds *creds = NULL;
   81|       |
   82|       |  /* Point to the correct struct with this */
   83|     33|  struct digestdata *digest;
   84|     33|  struct auth *authp;
   85|       |
   86|     33|  if(proxy) {
  ------------------
  |  Branch (86:6): [True: 3, False: 30]
  ------------------
   87|       |#ifdef CURL_DISABLE_PROXY
   88|       |    return CURLE_NOT_BUILT_IN;
   89|       |#else
   90|      3|    digest = &data->state.proxydigest;
   91|      3|    allocuserpwd = &data->req.hd_proxy_auth;
   92|      3|    creds = data->conn->http_proxy.creds;
   93|      3|    authp = &data->state.authproxy;
   94|      3|#endif
   95|      3|  }
   96|     30|  else {
   97|     30|    digest = &data->state.digest;
   98|     30|    allocuserpwd = &data->req.hd_auth;
   99|     30|    creds = data->state.creds;
  100|     30|    authp = &data->state.authhost;
  101|     30|  }
  102|       |
  103|     33|  curlx_safefree(*allocuserpwd);
  ------------------
  |  | 1327|     33|  do {                      \
  |  | 1328|     33|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|     33|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|     33|    (ptr) = NULL;           \
  |  | 1330|     33|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 33]
  |  |  ------------------
  ------------------
  104|       |
  105|       |#ifdef USE_WINDOWS_SSPI
  106|       |  have_chlg = !!digest->input_token;
  107|       |#else
  108|     33|  have_chlg = !!digest->nonce;
  109|     33|#endif
  110|       |
  111|     33|  if(!have_chlg) {
  ------------------
  |  Branch (111:6): [True: 33, False: 0]
  ------------------
  112|     33|    authp->done = FALSE;
  ------------------
  |  | 1058|     33|#define FALSE false
  ------------------
  113|     33|    return CURLE_OK;
  114|     33|  }
  115|       |
  116|      0|  result = Curl_auth_create_digest_http_message(data, creds, request,
  117|      0|                                                uripath, digest,
  118|      0|                                                &response, &len);
  119|      0|  if(result)
  ------------------
  |  Branch (119:6): [True: 0, False: 0]
  ------------------
  120|      0|    return result;
  121|       |
  122|      0|  *allocuserpwd = curl_maprintf("%sAuthorization: Digest %s\r\n",
  123|      0|                                proxy ? "Proxy-" : "", response);
  ------------------
  |  Branch (123:33): [True: 0, False: 0]
  ------------------
  124|      0|  curlx_free(response);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  125|      0|  if(!*allocuserpwd)
  ------------------
  |  Branch (125:6): [True: 0, False: 0]
  ------------------
  126|      0|    return CURLE_OUT_OF_MEMORY;
  127|       |
  128|      0|  authp->done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  129|       |
  130|      0|  return CURLE_OK;
  131|      0|}
Curl_http_auth_cleanup_digest:
  134|  36.6k|{
  135|  36.6k|  Curl_auth_digest_cleanup(&data->state.digest);
  136|  36.6k|  Curl_auth_digest_cleanup(&data->state.proxydigest);
  137|  36.6k|}

Curl_http_proxy_create_tunnel_request:
  442|  7.98k|{
  443|  7.98k|  CURLcode result;
  444|       |
  445|  7.98k|  if(udp_tunnel)
  ------------------
  |  Branch (445:6): [True: 0, False: 7.98k]
  ------------------
  446|      0|    result = http_proxy_create_CONNECTUDP(preq, cf, data, dest, ver);
  447|  7.98k|  else
  448|  7.98k|    result = http_proxy_create_CONNECT(preq, cf, data, dest, ver);
  449|  7.98k|  if(result)
  ------------------
  |  Branch (449:6): [True: 10, False: 7.97k]
  ------------------
  450|     10|    return result;
  451|       |
  452|  7.97k|  if(udp_tunnel)
  ------------------
  |  Branch (452:6): [True: 0, False: 7.97k]
  ------------------
  453|      0|    infof(data, "Establishing %s proxy UDP tunnel to %s:%s",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  454|  7.97k|          (ver == PROXY_HTTP_V2) ? "HTTP/2" :
  455|  7.97k|          (ver == PROXY_HTTP_V3) ? "HTTP/3" : "HTTP",
  456|  7.97k|          data->state.up.hostname, data->state.up.port);
  457|  7.97k|  else
  458|  7.97k|    infof(data, "Establishing %s proxy tunnel to %s",
  ------------------
  |  |  143|  7.97k|  do {                               \
  |  |  144|  7.97k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  7.97k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 7.97k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 7.97k]
  |  |  |  |  ------------------
  |  |  |  |  320|  7.97k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  7.97k|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|  7.97k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 7.97k]
  |  |  ------------------
  ------------------
  459|  7.97k|          (ver == PROXY_HTTP_V2) ? "HTTP/2" :
  460|  7.97k|          (ver == PROXY_HTTP_V3) ? "HTTP/3" : "HTTP",
  461|  7.97k|          (*preq)->authority);
  462|  7.97k|  return CURLE_OK;
  463|  7.98k|}
Curl_cf_http_proxy_insert_after:
  758|  8.40k|{
  759|  8.40k|  struct Curl_cfilter *cf;
  760|  8.40k|  struct cf_proxy_ctx *ctx = NULL;
  761|  8.40k|  CURLcode result;
  762|       |
  763|  8.40k|  (void)data;
  764|  8.40k|  if(!dest)
  ------------------
  |  Branch (764:6): [True: 0, False: 8.40k]
  ------------------
  765|      0|    return CURLE_FAILED_INIT;
  766|       |
  767|  8.40k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1480|  8.40k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  768|  8.40k|  if(!ctx) {
  ------------------
  |  Branch (768:6): [True: 0, False: 8.40k]
  ------------------
  769|      0|    result = CURLE_OUT_OF_MEMORY;
  770|      0|    goto out;
  771|      0|  }
  772|  8.40k|  Curl_peer_link(&ctx->dest, dest);
  773|  8.40k|  ctx->proxytype = proxytype;
  774|  8.40k|  ctx->udp_tunnel = (transport == TRNSPRT_QUIC);
  ------------------
  |  |  309|  8.40k|#define TRNSPRT_QUIC 5
  ------------------
  775|       |
  776|  8.40k|  result = Curl_cf_create(&cf, &Curl_cft_http_proxy, ctx);
  777|  8.40k|  if(result)
  ------------------
  |  Branch (777:6): [True: 0, False: 8.40k]
  ------------------
  778|      0|    goto out;
  779|  8.40k|  ctx = NULL;
  780|  8.40k|  Curl_conn_cf_insert_after(cf_at, cf);
  781|       |
  782|  8.40k|out:
  783|  8.40k|  cf_https_proxy_ctx_free(ctx);
  784|  8.40k|  return result;
  785|  8.40k|}
Curl_http_proxy_transport:
  788|  8.46k|{
  789|  8.46k|  switch(proxytype) {
  790|      0|  case CURLPROXY_HTTPS3:
  ------------------
  |  |  805|      0|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  ------------------
  |  Branch (790:3): [True: 0, False: 8.46k]
  ------------------
  791|      0|    return TRNSPRT_QUIC;
  ------------------
  |  |  309|      0|#define TRNSPRT_QUIC 5
  ------------------
  792|  8.46k|  default:
  ------------------
  |  Branch (792:3): [True: 8.46k, False: 0]
  ------------------
  793|  8.46k|    return TRNSPRT_TCP;
  ------------------
  |  |  307|  8.46k|#define TRNSPRT_TCP  3
  ------------------
  794|  8.46k|  }
  795|  8.46k|}
http_proxy.c:proxy_http_ver_major:
  183|  7.98k|{
  184|  7.98k|  switch(ver) {
  ------------------
  |  Branch (184:10): [True: 7.98k, False: 0]
  ------------------
  185|  7.98k|  case PROXY_HTTP_V1:
  ------------------
  |  Branch (185:3): [True: 7.98k, False: 0]
  ------------------
  186|  7.98k|    return 11;
  187|      0|  case PROXY_HTTP_V2:
  ------------------
  |  Branch (187:3): [True: 0, False: 7.98k]
  ------------------
  188|      0|    return 20;
  189|      0|  case PROXY_HTTP_V3:
  ------------------
  |  Branch (189:3): [True: 0, False: 7.98k]
  ------------------
  190|      0|    return 30;
  191|  7.98k|  }
  192|      0|  return 0;
  193|  7.98k|}
http_proxy.c:dynhds_add_custom:
   45|  7.97k|{
   46|  7.97k|  struct connectdata *conn = data->conn;
   47|  7.97k|  struct curl_slist *h[2];
   48|  7.97k|  struct curl_slist *headers;
   49|  7.97k|  int numlists = 1; /* by default */
   50|  7.97k|  int i;
   51|       |
   52|  7.97k|  enum Curl_proxy_use proxy;
   53|       |
   54|  7.97k|  if(is_connect && !is_udp)
  ------------------
  |  Branch (54:6): [True: 7.97k, False: 0]
  |  Branch (54:20): [True: 7.97k, False: 0]
  ------------------
   55|  7.97k|    proxy = HEADER_CONNECT;
   56|      0|  else if(is_connect && is_udp)
  ------------------
  |  Branch (56:11): [True: 0, False: 0]
  |  Branch (56:25): [True: 0, False: 0]
  ------------------
   57|      0|    proxy = HEADER_CONNECT_UDP;
   58|      0|  else
   59|      0|    proxy = (conn->bits.httpproxy && !conn->bits.tunnel_proxy) ?
  ------------------
  |  Branch (59:14): [True: 0, False: 0]
  |  Branch (59:38): [True: 0, False: 0]
  ------------------
   60|      0|      HEADER_PROXY : HEADER_SERVER;
   61|       |
   62|  7.97k|  switch(proxy) {
  ------------------
  |  Branch (62:10): [True: 7.97k, False: 0]
  ------------------
   63|      0|  case HEADER_SERVER:
  ------------------
  |  Branch (63:3): [True: 0, False: 7.97k]
  ------------------
   64|      0|    h[0] = data->set.headers;
   65|      0|    break;
   66|      0|  case HEADER_PROXY:
  ------------------
  |  Branch (66:3): [True: 0, False: 7.97k]
  ------------------
   67|      0|    h[0] = data->set.headers;
   68|      0|    if(data->set.sep_headers) {
  ------------------
  |  Branch (68:8): [True: 0, False: 0]
  ------------------
   69|      0|      h[1] = data->set.proxyheaders;
   70|      0|      numlists++;
   71|      0|    }
   72|      0|    break;
   73|  7.97k|  case HEADER_CONNECT:
  ------------------
  |  Branch (73:3): [True: 7.97k, False: 0]
  ------------------
   74|  7.97k|    if(data->set.sep_headers)
  ------------------
  |  Branch (74:8): [True: 7.58k, False: 391]
  ------------------
   75|  7.58k|      h[0] = data->set.proxyheaders;
   76|    391|    else
   77|    391|      h[0] = data->set.headers;
   78|  7.97k|    break;
   79|      0|  case HEADER_CONNECT_UDP:
  ------------------
  |  Branch (79:3): [True: 0, False: 7.97k]
  ------------------
   80|      0|    if(data->set.sep_headers)
  ------------------
  |  Branch (80:8): [True: 0, False: 0]
  ------------------
   81|      0|      h[0] = data->set.proxyheaders;
   82|      0|    else
   83|      0|      h[0] = data->set.headers;
   84|      0|    break;
   85|  7.97k|  }
   86|       |
   87|       |  /* loop through one or two lists */
   88|  15.9k|  for(i = 0; i < numlists; i++) {
  ------------------
  |  Branch (88:14): [True: 7.97k, False: 7.97k]
  ------------------
   89|  11.3k|    for(headers = h[i]; headers; headers = headers->next) {
  ------------------
  |  Branch (89:25): [True: 3.32k, False: 7.97k]
  ------------------
   90|  3.32k|      struct Curl_str name;
   91|  3.32k|      const char *value = NULL;
   92|  3.32k|      size_t valuelen = 0;
   93|  3.32k|      const char *ptr = headers->data;
   94|       |
   95|       |      /* There are 2 quirks in place for custom headers:
   96|       |       * 1. setting only 'name:' to suppress a header from being sent
   97|       |       * 2. setting only 'name;' to send an empty (illegal) header
   98|       |       */
   99|  3.32k|      if(!curlx_str_cspn(&ptr, &name, ";:")) {
  ------------------
  |  Branch (99:10): [True: 2.71k, False: 617]
  ------------------
  100|  2.71k|        if(!curlx_str_single(&ptr, ':')) {
  ------------------
  |  Branch (100:12): [True: 1.79k, False: 915]
  ------------------
  101|  1.79k|          curlx_str_passblanks(&ptr);
  102|  1.79k|          if(*ptr) {
  ------------------
  |  Branch (102:14): [True: 1.76k, False: 36]
  ------------------
  103|  1.76k|            value = ptr;
  104|  1.76k|            valuelen = strlen(value);
  105|  1.76k|          }
  106|     36|          else {
  107|       |            /* quirk #1, suppress this header */
  108|     36|            continue;
  109|     36|          }
  110|  1.79k|        }
  111|    915|        else if(!curlx_str_single(&ptr, ';')) {
  ------------------
  |  Branch (111:17): [True: 227, False: 688]
  ------------------
  112|    227|          curlx_str_passblanks(&ptr);
  113|    227|          if(!*ptr) {
  ------------------
  |  Branch (113:14): [True: 83, False: 144]
  ------------------
  114|       |            /* quirk #2, send an empty header */
  115|     83|            value = "";
  116|     83|            valuelen = 0;
  117|     83|          }
  118|    144|          else {
  119|       |            /* this may be used for something else in the future,
  120|       |             * ignore this for now */
  121|    144|            continue;
  122|    144|          }
  123|    227|        }
  124|    688|        else
  125|       |          /* neither : nor ; in provided header value. We ignore this
  126|       |           * silently */
  127|    688|          continue;
  128|  2.71k|      }
  129|    617|      else
  130|       |        /* no name, move on */
  131|    617|        continue;
  132|       |
  133|  1.84k|      DEBUGASSERT(curlx_strlen(&name) && value);
  ------------------
  |  | 1081|  1.84k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (133:7): [True: 0, False: 1.84k]
  |  Branch (133:7): [True: 0, False: 0]
  |  Branch (133:7): [True: 1.84k, False: 0]
  |  Branch (133:7): [True: 1.84k, False: 0]
  ------------------
  134|  1.84k|      if(data->state.aptr.host &&
  ------------------
  |  Branch (134:10): [True: 324, False: 1.51k]
  ------------------
  135|       |         /* a Host: header was sent already, do not pass on any custom Host:
  136|       |            header as that will produce *two* in the same request! */
  137|    324|         curlx_str_casecompare(&name, "Host"))
  ------------------
  |  Branch (137:10): [True: 10, False: 314]
  ------------------
  138|     10|        ;
  139|  1.83k|      else if(data->state.httpreq == HTTPREQ_POST_FORM &&
  ------------------
  |  Branch (139:15): [True: 315, False: 1.51k]
  ------------------
  140|       |              /* this header (extended by formdata.c) is sent later */
  141|    315|              curlx_str_casecompare(&name, "Content-Type"))
  ------------------
  |  Branch (141:15): [True: 11, False: 304]
  ------------------
  142|     11|        ;
  143|  1.82k|      else if(data->state.httpreq == HTTPREQ_POST_MIME &&
  ------------------
  |  Branch (143:15): [True: 844, False: 978]
  ------------------
  144|       |              /* this header is sent later */
  145|    844|              curlx_str_casecompare(&name, "Content-Type"))
  ------------------
  |  Branch (145:15): [True: 3, False: 841]
  ------------------
  146|      3|        ;
  147|  1.81k|      else if(data->req.authneg &&
  ------------------
  |  Branch (147:15): [True: 0, False: 1.81k]
  ------------------
  148|       |              /* while doing auth neg, do not allow the custom length since
  149|       |                 we will force length zero then */
  150|      0|              curlx_str_casecompare(&name, "Content-Length"))
  ------------------
  |  Branch (150:15): [True: 0, False: 0]
  ------------------
  151|      0|        ;
  152|  1.81k|      else if((httpversion >= 20) &&
  ------------------
  |  Branch (152:15): [True: 0, False: 1.81k]
  ------------------
  153|      0|              curlx_str_casecompare(&name, "Transfer-Encoding"))
  ------------------
  |  Branch (153:15): [True: 0, False: 0]
  ------------------
  154|      0|        ;
  155|       |      /* HTTP/2 and HTTP/3 do not support chunked requests */
  156|  1.81k|      else if((curlx_str_casecompare(&name, "Authorization") ||
  ------------------
  |  Branch (156:16): [True: 1, False: 1.81k]
  ------------------
  157|  1.81k|               curlx_str_casecompare(&name, "Cookie")) &&
  ------------------
  |  Branch (157:16): [True: 331, False: 1.48k]
  ------------------
  158|       |              /* be careful of sending this potentially sensitive header to
  159|       |                 other hosts */
  160|    332|              !Curl_auth_allowed_to_host(data))
  ------------------
  |  Branch (160:15): [True: 0, False: 332]
  ------------------
  161|      0|        ;
  162|  1.81k|      else {
  163|  1.81k|        CURLcode result =
  164|  1.81k|          Curl_dynhds_add(hds, curlx_str(&name), curlx_strlen(&name),
  ------------------
  |  |   49|  1.81k|#define curlx_str(x)    ((x)->str)
  ------------------
                        Curl_dynhds_add(hds, curlx_str(&name), curlx_strlen(&name),
  ------------------
  |  |   50|  1.81k|#define curlx_strlen(x) ((x)->len)
  ------------------
  165|  1.81k|                          value, valuelen);
  166|  1.81k|        if(result)
  ------------------
  |  Branch (166:12): [True: 0, False: 1.81k]
  ------------------
  167|      0|          return result;
  168|  1.81k|      }
  169|  1.84k|    }
  170|  7.97k|  }
  171|       |
  172|  7.97k|  return CURLE_OK;
  173|  7.97k|}
http_proxy.c:http_proxy_create_CONNECT:
  200|  7.98k|{
  201|  7.98k|  char *authority = NULL;
  202|  7.98k|  int httpversion = proxy_http_ver_major(ver);
  203|  7.98k|  CURLcode result;
  204|  7.98k|  struct httpreq *req = NULL;
  205|       |
  206|  7.98k|  authority = curl_maprintf("%s%s%s:%u",
  207|  7.98k|                            dest->ipv6 ? "[" : "",
  ------------------
  |  Branch (207:29): [True: 0, False: 7.98k]
  ------------------
  208|  7.98k|                            dest->hostname,
  209|  7.98k|                            dest->ipv6 ? "]" : "",
  ------------------
  |  Branch (209:29): [True: 0, False: 7.98k]
  ------------------
  210|  7.98k|                            dest->port);
  211|  7.98k|  if(!authority) {
  ------------------
  |  Branch (211:6): [True: 0, False: 7.98k]
  ------------------
  212|      0|    result = CURLE_OUT_OF_MEMORY;
  213|      0|    goto out;
  214|      0|  }
  215|       |
  216|  7.98k|  result = Curl_http_req_make(&req, "CONNECT", sizeof("CONNECT") - 1,
  217|  7.98k|                              NULL, 0, authority, strlen(authority),
  218|  7.98k|                              NULL, 0);
  219|  7.98k|  if(result)
  ------------------
  |  Branch (219:6): [True: 0, False: 7.98k]
  ------------------
  220|      0|    goto out;
  221|       |
  222|       |  /* Setup the proxy-authorization header, if any */
  223|  7.98k|  result = Curl_http_output_auth(data, cf->conn, req->method, HTTPREQ_GET,
  224|  7.98k|                                 req->authority, NULL, TRUE);
  ------------------
  |  | 1055|  7.98k|#define TRUE true
  ------------------
  225|  7.98k|  if(result)
  ------------------
  |  Branch (225:6): [True: 10, False: 7.97k]
  ------------------
  226|     10|    goto out;
  227|       |
  228|       |  /* If user is not overriding Host: header, we add for HTTP/1.x */
  229|  7.97k|  if(ver == PROXY_HTTP_V1 &&
  ------------------
  |  Branch (229:6): [True: 7.97k, False: 0]
  ------------------
  230|  7.97k|     !Curl_checkProxyheaders(data, cf->conn, STRCONST("Host"))) {
  ------------------
  |  | 1292|  7.97k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (230:6): [True: 7.96k, False: 19]
  ------------------
  231|  7.96k|    result = Curl_dynhds_cadd(&req->headers, "Host", authority);
  232|  7.96k|    if(result)
  ------------------
  |  Branch (232:8): [True: 0, False: 7.96k]
  ------------------
  233|      0|      goto out;
  234|  7.96k|  }
  235|       |
  236|  7.97k|  if(data->req.hd_proxy_auth) {
  ------------------
  |  Branch (236:6): [True: 1.17k, False: 6.80k]
  ------------------
  237|  1.17k|    result = Curl_dynhds_h1_cadd_line(&req->headers,
  238|  1.17k|                                      data->req.hd_proxy_auth);
  239|  1.17k|    if(result)
  ------------------
  |  Branch (239:8): [True: 0, False: 1.17k]
  ------------------
  240|      0|      goto out;
  241|  1.17k|  }
  242|       |
  243|  7.97k|  if(!Curl_checkProxyheaders(data, cf->conn, STRCONST("User-Agent")) &&
  ------------------
  |  | 1292|  7.97k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (243:6): [True: 7.97k, False: 1]
  ------------------
  244|  7.97k|     data->set.str[STRING_USERAGENT] && *data->set.str[STRING_USERAGENT]) {
  ------------------
  |  Branch (244:6): [True: 971, False: 7.00k]
  |  Branch (244:41): [True: 839, False: 132]
  ------------------
  245|    839|    result = Curl_dynhds_cadd(&req->headers, "User-Agent",
  246|    839|                              data->set.str[STRING_USERAGENT]);
  247|    839|    if(result)
  ------------------
  |  Branch (247:8): [True: 0, False: 839]
  ------------------
  248|      0|      goto out;
  249|    839|  }
  250|       |
  251|  7.97k|  if(ver == PROXY_HTTP_V1 &&
  ------------------
  |  Branch (251:6): [True: 7.97k, False: 0]
  ------------------
  252|  7.97k|     !Curl_checkProxyheaders(data, cf->conn, STRCONST("Proxy-Connection"))) {
  ------------------
  |  | 1292|  7.97k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (252:6): [True: 7.97k, False: 0]
  ------------------
  253|  7.97k|    result = Curl_dynhds_cadd(&req->headers, "Proxy-Connection", "Keep-Alive");
  254|  7.97k|    if(result)
  ------------------
  |  Branch (254:8): [True: 0, False: 7.97k]
  ------------------
  255|      0|      goto out;
  256|  7.97k|  }
  257|       |
  258|  7.97k|  result = dynhds_add_custom(data, TRUE, httpversion,
  ------------------
  |  | 1055|  7.97k|#define TRUE true
  ------------------
  259|  7.97k|                             FALSE, &req->headers);
  ------------------
  |  | 1058|  7.97k|#define FALSE false
  ------------------
  260|       |
  261|  7.98k|out:
  262|  7.98k|  if(result && req) {
  ------------------
  |  Branch (262:6): [True: 10, False: 7.97k]
  |  Branch (262:16): [True: 10, False: 0]
  ------------------
  263|     10|    Curl_http_req_free(req);
  264|     10|    req = NULL;
  265|     10|  }
  266|  7.98k|  curlx_free(authority);
  ------------------
  |  | 1483|  7.98k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  267|  7.98k|  *preq = req;
  268|  7.98k|  return result;
  269|  7.97k|}
http_proxy.c:http_proxy_cf_destroy:
  718|  8.40k|{
  719|  8.40k|  struct cf_proxy_ctx *ctx = cf->ctx;
  720|  8.40k|  if(ctx) {
  ------------------
  |  Branch (720:6): [True: 8.40k, False: 0]
  ------------------
  721|  8.40k|    CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|  8.40k|  do {                                          \
  |  |  154|  8.40k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  8.40k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  16.8k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 8.40k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 8.40k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  16.8k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  8.40k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  8.40k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  8.40k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 8.40k]
  |  |  ------------------
  ------------------
  722|  8.40k|    cf_https_proxy_ctx_free(ctx);
  723|  8.40k|  }
  724|  8.40k|}
http_proxy.c:http_proxy_cf_connect:
  557|  9.09k|{
  558|  9.09k|  struct cf_proxy_ctx *ctx = cf->ctx;
  559|  9.09k|  CURLcode result;
  560|  9.09k|  const char *tunnel_type; /* Determine tunnel type once and reuse */
  561|       |
  562|  9.09k|  tunnel_type = ctx->udp_tunnel ? "CONNECT-UDP" : "CONNECT";
  ------------------
  |  Branch (562:17): [True: 0, False: 9.09k]
  ------------------
  563|       |
  564|  9.09k|  if(cf->connected) {
  ------------------
  |  Branch (564:6): [True: 101, False: 8.99k]
  ------------------
  565|    101|    *done = TRUE;
  ------------------
  |  | 1055|    101|#define TRUE true
  ------------------
  566|    101|    return CURLE_OK;
  567|    101|  }
  568|       |
  569|  8.99k|  CURL_TRC_CF(data, cf, "%s", tunnel_type);
  ------------------
  |  |  153|  8.99k|  do {                                          \
  |  |  154|  8.99k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  8.99k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  17.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 8.99k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 8.99k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  17.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  8.99k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  8.99k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  8.99k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 8.99k]
  |  |  ------------------
  ------------------
  570|  16.9k|connect_sub:
  571|       |  /* in case of h3_proxy, cf->next will be NULL initially */
  572|  16.9k|  if(cf->next) {
  ------------------
  |  Branch (572:6): [True: 16.9k, False: 0]
  ------------------
  573|  16.9k|    result = cf->next->cft->do_connect(cf->next, data, done);
  574|  16.9k|    if(result || !*done)
  ------------------
  |  Branch (574:8): [True: 1.77k, False: 15.2k]
  |  Branch (574:18): [True: 595, False: 14.6k]
  ------------------
  575|  2.37k|      return result;
  576|  16.9k|  }
  577|       |
  578|  14.6k|  *done = FALSE;
  ------------------
  |  | 1058|  14.6k|#define FALSE false
  ------------------
  579|  14.6k|  if(!ctx->sub_filter_installed) {
  ------------------
  |  Branch (579:6): [True: 7.98k, False: 6.62k]
  ------------------
  580|  7.98k|    const char *alpn = NULL;
  581|       |
  582|       |    /* in case of h3_proxy, cf->next will be NULL initially */
  583|  7.98k|    if(cf->next) {
  ------------------
  |  Branch (583:8): [True: 7.98k, False: 0]
  ------------------
  584|  7.98k|      alpn = Curl_conn_cf_get_alpn_negotiated(cf->next, data);
  585|  7.98k|    }
  586|       |
  587|  7.98k|    if(alpn)
  ------------------
  |  Branch (587:8): [True: 0, False: 7.98k]
  ------------------
  588|      0|      infof(data, "%s: '%s' negotiated", tunnel_type, alpn);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  589|  7.98k|    else if(!alpn) {
  ------------------
  |  Branch (589:13): [True: 7.98k, False: 0]
  ------------------
  590|       |      /* No ALPN, proxytype rules. Fake ALPN */
  591|  7.98k|      infof(data, "%s: no ALPN negotiated", tunnel_type);
  ------------------
  |  |  143|  7.98k|  do {                               \
  |  |  144|  7.98k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  7.98k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 7.98k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 7.98k]
  |  |  |  |  ------------------
  |  |  |  |  320|  7.98k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  7.98k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  7.98k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 7.98k]
  |  |  ------------------
  ------------------
  592|  7.98k|      switch(ctx->proxytype) {
  593|      3|      case CURLPROXY_HTTP_1_0:
  ------------------
  |  |  792|      3|#define CURLPROXY_HTTP_1_0        1L /* force to use CONNECT HTTP/1.0
  ------------------
  |  Branch (593:7): [True: 3, False: 7.98k]
  ------------------
  594|      3|        alpn = "http/1.0";
  595|      3|        break;
  596|      0|      case CURLPROXY_HTTPS2:
  ------------------
  |  |  796|      0|#define CURLPROXY_HTTPS2          3L /* HTTPS and attempt HTTP/2
  ------------------
  |  Branch (596:7): [True: 0, False: 7.98k]
  ------------------
  597|      0|        alpn = "h2";
  598|      0|        break;
  599|      0|      case CURLPROXY_HTTPS3:
  ------------------
  |  |  805|      0|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  ------------------
  |  Branch (599:7): [True: 0, False: 7.98k]
  ------------------
  600|      0|        alpn = "h3";
  601|      0|        break;
  602|  7.98k|      default:
  ------------------
  |  Branch (602:7): [True: 7.98k, False: 3]
  ------------------
  603|  7.98k|        alpn = "http/1.1";
  604|  7.98k|        break;
  605|  7.98k|      }
  606|  7.98k|    }
  607|       |
  608|  7.98k|    if(!strcmp(alpn, "http/1.0")) {
  ------------------
  |  Branch (608:8): [True: 3, False: 7.98k]
  ------------------
  609|      3|      CURL_TRC_CF(data, cf, "installing subfilter for HTTP/1.0");
  ------------------
  |  |  153|      3|  do {                                          \
  |  |  154|      3|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      3|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      6|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 3, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      6|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      3|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      3|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      3|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3]
  |  |  ------------------
  ------------------
  610|      3|      result = Curl_cf_h1_proxy_insert_after(cf, data, ctx->dest, 10,
  611|      3|                                             (bool)ctx->udp_tunnel);
  612|      3|      if(result)
  ------------------
  |  Branch (612:10): [True: 0, False: 3]
  ------------------
  613|      0|        goto out;
  614|      3|    }
  615|  7.98k|    else if(!strcmp(alpn, "http/1.1")) {
  ------------------
  |  Branch (615:13): [True: 7.98k, False: 0]
  ------------------
  616|  7.98k|      int httpversion = (ctx->proxytype == CURLPROXY_HTTP_1_0) ? 10 : 11;
  ------------------
  |  |  792|  7.98k|#define CURLPROXY_HTTP_1_0        1L /* force to use CONNECT HTTP/1.0
  ------------------
  |  Branch (616:25): [True: 0, False: 7.98k]
  ------------------
  617|  7.98k|      CURL_TRC_CF(data, cf, "installing subfilter for HTTP/1.%d",
  ------------------
  |  |  153|  7.98k|  do {                                          \
  |  |  154|  7.98k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  7.98k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  15.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 7.98k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 7.98k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  15.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  7.98k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  7.98k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  7.98k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 7.98k]
  |  |  ------------------
  ------------------
  618|  7.98k|                  httpversion % 10);
  619|  7.98k|      result = Curl_cf_h1_proxy_insert_after(cf, data, ctx->dest, httpversion,
  620|  7.98k|                                             (bool)ctx->udp_tunnel);
  621|  7.98k|      if(result)
  ------------------
  |  Branch (621:10): [True: 0, False: 7.98k]
  ------------------
  622|      0|        goto out;
  623|  7.98k|    }
  624|      0|#ifdef USE_NGHTTP2
  625|      0|    else if(!strcmp(alpn, "h2")) {
  ------------------
  |  Branch (625:13): [True: 0, False: 0]
  ------------------
  626|      0|      CURL_TRC_CF(data, cf, "installing subfilter for HTTP/2");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  627|      0|      result = Curl_cf_h2_proxy_insert_after(cf, data, ctx->dest,
  628|      0|                                             (bool)ctx->udp_tunnel);
  629|      0|      if(result)
  ------------------
  |  Branch (629:10): [True: 0, False: 0]
  ------------------
  630|      0|        goto out;
  631|      0|    }
  632|      0|#endif /* USE_NGHTTP2 */
  633|       |#if defined(USE_PROXY_HTTP3) && defined(USE_NGHTTP3) && \
  634|       |  defined(USE_NGTCP2) && defined(USE_OPENSSL)
  635|       |    else if(!strcmp(alpn, "h3")) {
  636|       |      CURL_TRC_CF(data, cf, "installing subfilter for HTTP/3");
  637|       |      result = Curl_cf_h3_proxy_insert_after(cf, data, ctx->dest,
  638|       |                                             (bool)ctx->udp_tunnel);
  639|       |      if(result)
  640|       |        goto out;
  641|       |    }
  642|       |#endif /* USE_PROXY_HTTP3 && USE_NGHTTP3 && USE_NGTCP2 && USE_OPENSSL */
  643|      0|    else {
  644|      0|      failf(data, "%s: negotiated ALPN '%s' not supported", tunnel_type, alpn);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  645|      0|      result = CURLE_COULDNT_CONNECT;
  646|      0|      goto out;
  647|      0|    }
  648|       |
  649|  7.98k|    ctx->sub_filter_installed = TRUE;
  ------------------
  |  | 1055|  7.98k|#define TRUE true
  ------------------
  650|       |    /* after we installed the filter "below" us, we call connect
  651|       |     * on out sub-chain again.
  652|       |     */
  653|  7.98k|    goto connect_sub;
  654|  7.98k|  }
  655|  6.62k|  else {
  656|       |    /* subchain connected and we had already installed the protocol filter.
  657|       |     * This means the protocol tunnel is established, we are done.
  658|       |     */
  659|  6.62k|    DEBUGASSERT(ctx->sub_filter_installed);
  ------------------
  |  | 1081|  6.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (659:5): [True: 0, False: 6.62k]
  |  Branch (659:5): [True: 6.62k, False: 0]
  ------------------
  660|  6.62k|    if(ctx->udp_tunnel) {
  ------------------
  |  Branch (660:8): [True: 0, False: 6.62k]
  ------------------
  661|       |#ifdef USE_PROXY_HTTP3
  662|       |      /* Insert capsule filter between us and the protocol sub-filter.
  663|       |       * This handles encap/decap of UDP datagrams in capsule format. */
  664|       |      result = Curl_cf_capsule_insert_after(cf, data);
  665|       |      if(result)
  666|       |        goto out;
  667|       |      CURL_TRC_CF(data, cf, "installed capsule filter for UDP tunnel");
  668|       |#else
  669|      0|      result = CURLE_NOT_BUILT_IN;
  670|      0|      goto out;
  671|      0|#endif /* USE_PROXY_HTTP3 */
  672|      0|    }
  673|  6.62k|    result = CURLE_OK;
  674|  6.62k|  }
  675|       |
  676|  6.62k|out:
  677|  6.62k|  if(!result) {
  ------------------
  |  Branch (677:6): [True: 6.62k, False: 0]
  ------------------
  678|  6.62k|    cf->connected = TRUE;
  ------------------
  |  | 1055|  6.62k|#define TRUE true
  ------------------
  679|       |    *done = TRUE;
  ------------------
  |  | 1055|  6.62k|#define TRUE true
  ------------------
  680|  6.62k|  }
  681|  6.62k|  return result;
  682|  14.6k|}
http_proxy.c:http_proxy_cf_close:
  728|  1.78k|{
  729|  1.78k|  CURL_TRC_CF(data, cf, "close");
  ------------------
  |  |  153|  1.78k|  do {                                          \
  |  |  154|  1.78k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  1.78k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  3.57k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 1.78k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.78k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  3.57k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  1.78k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.78k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.78k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.78k]
  |  |  ------------------
  ------------------
  730|  1.78k|  cf->connected = FALSE;
  ------------------
  |  | 1058|  1.78k|#define FALSE false
  ------------------
  731|  1.78k|  if(cf->next)
  ------------------
  |  Branch (731:6): [True: 1.78k, False: 0]
  ------------------
  732|  1.78k|    cf->next->cft->do_close(cf->next, data);
  733|  1.78k|}
http_proxy.c:cf_http_proxy_query:
  687|  18.0k|{
  688|  18.0k|  struct cf_proxy_ctx *ctx = cf->ctx;
  689|  18.0k|  switch(query) {
  690|      0|  case CF_QUERY_HOST_PORT:
  ------------------
  |  |  177|      0|#define CF_QUERY_HOST_PORT         11  /* port       const char * */
  ------------------
  |  Branch (690:3): [True: 0, False: 18.0k]
  ------------------
  691|      0|    *pres1 = (int)ctx->dest->port;
  692|      0|    *((const char **)pres2) = ctx->dest->hostname;
  693|      0|    return CURLE_OK;
  694|      0|  case CF_QUERY_ALPN_NEGOTIATED: {
  ------------------
  |  |  181|      0|#define CF_QUERY_ALPN_NEGOTIATED   15  /* -          const char * */
  ------------------
  |  Branch (694:3): [True: 0, False: 18.0k]
  ------------------
  695|      0|    const char **palpn = pres2;
  696|      0|    DEBUGASSERT(palpn);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (696:5): [True: 0, False: 0]
  |  Branch (696:5): [True: 0, False: 0]
  ------------------
  697|      0|    *palpn = NULL;
  698|      0|    return CURLE_OK;
  699|      0|  }
  700|  18.0k|  default:
  ------------------
  |  Branch (700:3): [True: 18.0k, False: 0]
  ------------------
  701|  18.0k|    break;
  702|  18.0k|  }
  703|  18.0k|  return cf->next ?
  ------------------
  |  Branch (703:10): [True: 18.0k, False: 0]
  ------------------
  704|  18.0k|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
  705|  18.0k|    CURLE_UNKNOWN_OPTION;
  706|  18.0k|}
http_proxy.c:cf_https_proxy_ctx_free:
  709|  16.8k|{
  710|  16.8k|  if(ctx) {
  ------------------
  |  Branch (710:6): [True: 8.40k, False: 8.40k]
  ------------------
  711|  8.40k|    Curl_peer_unlink(&ctx->dest);
  712|  8.40k|    curlx_free(ctx);
  ------------------
  |  | 1483|  8.40k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  713|  8.40k|  }
  714|  16.8k|}

Curl_is_ASCII_str:
  236|  39.0k|{
  237|  39.0k|  if(s && s->len) {
  ------------------
  |  Branch (237:6): [True: 39.0k, False: 0]
  |  Branch (237:11): [True: 39.0k, False: 0]
  ------------------
  238|  39.0k|    const unsigned char *ch = (const unsigned char *)s->str;
  239|  39.0k|    size_t i;
  240|   853k|    for(i = 0; i < s->len; ++i) {
  ------------------
  |  Branch (240:16): [True: 814k, False: 38.9k]
  ------------------
  241|   814k|      if(ch[i] & 0x80)
  ------------------
  |  Branch (241:10): [True: 127, False: 814k]
  ------------------
  242|    127|        return FALSE;
  ------------------
  |  | 1058|    127|#define FALSE false
  ------------------
  243|   814k|    }
  244|  39.0k|  }
  245|  38.9k|  return TRUE;
  ------------------
  |  | 1055|  38.9k|#define TRUE true
  ------------------
  246|  39.0k|}
Curl_idn_decode:
  313|    127|{
  314|    127|  char *d = NULL;
  315|    127|  CURLcode result = idn_decode(input, &d);
  316|    127|#ifdef USE_LIBIDN2
  317|    127|  if(!result) {
  ------------------
  |  Branch (317:6): [True: 0, False: 127]
  ------------------
  318|      0|    char *c = curlx_strdup(d);
  ------------------
  |  | 1477|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  319|      0|    idn2_free(d);
  320|      0|    if(c)
  ------------------
  |  Branch (320:8): [True: 0, False: 0]
  ------------------
  321|      0|      d = c;
  322|      0|    else
  323|      0|      result = CURLE_OUT_OF_MEMORY;
  324|      0|  }
  325|    127|#endif
  326|    127|  if(!result) {
  ------------------
  |  Branch (326:6): [True: 0, False: 127]
  ------------------
  327|      0|    if(!d[0]) { /* ended up zero length, not acceptable */
  ------------------
  |  Branch (327:8): [True: 0, False: 0]
  ------------------
  328|      0|      result = CURLE_URL_MALFORMAT;
  329|      0|      curlx_free(d);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  330|      0|    }
  331|      0|    else
  332|      0|      *output = d;
  333|      0|  }
  334|    127|  return result;
  335|    127|}
idn.c:idn_decode:
  258|    127|{
  259|    127|  char *decoded = NULL;
  260|    127|  CURLcode result = CURLE_OK;
  261|    127|#ifdef USE_LIBIDN2
  262|    127|  if(idn2_check_version(IDN2_VERSION)) {
  ------------------
  |  Branch (262:6): [True: 127, False: 0]
  ------------------
  263|    127|    int flags = IDN2_NFC_INPUT
  264|    127|#if IDN2_VERSION_NUMBER >= 0x00140000
  265|       |      /* IDN2_NFC_INPUT: Normalize input string using normalization form C.
  266|       |         IDN2_NONTRANSITIONAL: Perform Unicode TR46 non-transitional
  267|       |         processing. */
  268|    127|      | IDN2_NONTRANSITIONAL
  269|    127|#endif
  270|    127|      ;
  271|    127|    int rc = IDN2_LOOKUP(input, &decoded, flags);
  ------------------
  |  |   41|    127|  idn2_lookup_ul((const char *)(name), (char **)(host), flags)
  ------------------
  272|    127|    if(rc != IDN2_OK)
  ------------------
  |  Branch (272:8): [True: 127, False: 0]
  ------------------
  273|       |      /* fallback to TR46 Transitional mode for better IDNA2003
  274|       |         compatibility */
  275|    127|      rc = IDN2_LOOKUP(input, &decoded, IDN2_TRANSITIONAL);
  ------------------
  |  |   41|    127|  idn2_lookup_ul((const char *)(name), (char **)(host), flags)
  ------------------
  276|    127|    if(rc != IDN2_OK)
  ------------------
  |  Branch (276:8): [True: 127, False: 0]
  ------------------
  277|    127|      result = CURLE_URL_MALFORMAT;
  278|    127|  }
  279|      0|  else
  280|       |    /* a too old libidn2 version */
  281|      0|    result = CURLE_NOT_BUILT_IN;
  282|       |#elif defined(USE_WIN32_IDN)
  283|       |  result = win32_idn_to_ascii(input, &decoded);
  284|       |#elif defined(USE_APPLE_IDN)
  285|       |  result = mac_idn_to_ascii(input, &decoded);
  286|       |#endif
  287|    127|  if(!result)
  ------------------
  |  Branch (287:6): [True: 0, False: 127]
  ------------------
  288|      0|    *output = decoded;
  289|    127|  return result;
  290|    127|}

Curl_ipv6_scope:
   62|  13.8k|{
   63|  13.8k|  if(sa->sa_family == AF_INET6) {
  ------------------
  |  Branch (63:6): [True: 93, False: 13.7k]
  ------------------
   64|     93|    const struct sockaddr_in6 *sa6 =
   65|     93|      (const struct sockaddr_in6 *)(const void *)sa;
   66|     93|    const unsigned char *b = sa6->sin6_addr.s6_addr;
   67|     93|    unsigned short w = (unsigned short)((b[0] << 8) | b[1]);
   68|       |
   69|     93|    if((b[0] & 0xFE) == 0xFC) /* Handle ULAs */
  ------------------
  |  Branch (69:8): [True: 0, False: 93]
  ------------------
   70|      0|      return IPV6_SCOPE_UNIQUELOCAL;
  ------------------
  |  |   32|      0|#define IPV6_SCOPE_UNIQUELOCAL  3       /* Unique local */
  ------------------
   71|     93|    switch(w & 0xFFC0) {
   72|      0|    case 0xFE80:
  ------------------
  |  Branch (72:5): [True: 0, False: 93]
  ------------------
   73|      0|      return IPV6_SCOPE_LINKLOCAL;
  ------------------
  |  |   30|      0|#define IPV6_SCOPE_LINKLOCAL    1       /* Link-local scope. */
  ------------------
   74|      0|    case 0xFEC0:
  ------------------
  |  Branch (74:5): [True: 0, False: 93]
  ------------------
   75|      0|      return IPV6_SCOPE_SITELOCAL;
  ------------------
  |  |   31|      0|#define IPV6_SCOPE_SITELOCAL    2       /* Site-local scope (deprecated). */
  ------------------
   76|     88|    case 0x0000:
  ------------------
  |  Branch (76:5): [True: 88, False: 5]
  ------------------
   77|     88|      w = b[1] | b[2] | b[3] | b[4] | b[5] | b[6] | b[7] | b[8] | b[9] |
   78|     88|          b[10] | b[11] | b[12] | b[13] | b[14];
   79|     88|      if(w || b[15] != 0x01)
  ------------------
  |  Branch (79:10): [True: 3, False: 85]
  |  Branch (79:15): [True: 70, False: 15]
  ------------------
   80|     73|        break;
   81|     15|      return IPV6_SCOPE_NODELOCAL;
  ------------------
  |  |   33|     15|#define IPV6_SCOPE_NODELOCAL    4       /* Loopback. */
  ------------------
   82|      5|    default:
  ------------------
  |  Branch (82:5): [True: 5, False: 88]
  ------------------
   83|      5|      break;
   84|     93|    }
   85|     93|  }
   86|  13.8k|  return IPV6_SCOPE_GLOBAL;
  ------------------
  |  |   29|  13.8k|#define IPV6_SCOPE_GLOBAL       0       /* Global scope. */
  ------------------
   87|  13.8k|}
Curl_if2ip:
  101|     76|{
  102|     76|  struct ifaddrs *iface, *head;
  103|     76|  if2ip_result_t res = IF2IP_NOT_FOUND;
  104|       |
  105|       |#if defined(USE_IPV6) && !defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID)
  106|       |  (void)local_scope_id;
  107|       |#endif
  108|       |
  109|     76|  if(getifaddrs(&head) >= 0) {
  ------------------
  |  Branch (109:6): [True: 76, False: 0]
  ------------------
  110|    374|    for(iface = head; iface != NULL; iface = iface->ifa_next) {
  ------------------
  |  Branch (110:23): [True: 301, False: 73]
  ------------------
  111|    301|      if(iface->ifa_addr) {
  ------------------
  |  Branch (111:10): [True: 301, False: 0]
  ------------------
  112|    301|        if(iface->ifa_addr->sa_family == af) {
  ------------------
  |  Branch (112:12): [True: 145, False: 156]
  ------------------
  113|    145|          if(curl_strequal(iface->ifa_name, interf)) {
  ------------------
  |  Branch (113:14): [True: 3, False: 142]
  ------------------
  114|      3|            void *addr;
  115|      3|            const char *ip;
  116|      3|            char scope[12] = "";
  117|      3|            char ipstr[64];
  118|      3|#ifdef USE_IPV6
  119|      3|            if(af == AF_INET6) {
  ------------------
  |  Branch (119:16): [True: 0, False: 3]
  ------------------
  120|      0|#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
  121|      0|              unsigned int scopeid = 0;
  122|      0|#endif
  123|      0|              unsigned int ifscope = Curl_ipv6_scope(iface->ifa_addr);
  124|       |
  125|      0|              if(ifscope != remote_scope) {
  ------------------
  |  Branch (125:18): [True: 0, False: 0]
  ------------------
  126|       |                /* We are interested only in interface addresses whose scope
  127|       |                   matches the remote address we want to connect to: global
  128|       |                   for global, link-local for link-local, etc... */
  129|      0|                if(res == IF2IP_NOT_FOUND)
  ------------------
  |  Branch (129:20): [True: 0, False: 0]
  ------------------
  130|      0|                  res = IF2IP_AF_NOT_SUPPORTED;
  131|      0|                continue;
  132|      0|              }
  133|       |
  134|      0|              addr =
  135|      0|                &((struct sockaddr_in6 *)(void *)iface->ifa_addr)->sin6_addr;
  136|      0|#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
  137|       |              /* Include the scope of this interface as part of the address */
  138|      0|              scopeid = ((struct sockaddr_in6 *)(void *)iface->ifa_addr)
  139|      0|                          ->sin6_scope_id;
  140|       |
  141|       |              /* If given, scope id should match. */
  142|      0|              if(local_scope_id && scopeid != local_scope_id) {
  ------------------
  |  Branch (142:18): [True: 0, False: 0]
  |  Branch (142:36): [True: 0, False: 0]
  ------------------
  143|      0|                if(res == IF2IP_NOT_FOUND)
  ------------------
  |  Branch (143:20): [True: 0, False: 0]
  ------------------
  144|      0|                  res = IF2IP_AF_NOT_SUPPORTED;
  145|       |
  146|      0|                continue;
  147|      0|              }
  148|       |
  149|      0|              if(scopeid)
  ------------------
  |  Branch (149:18): [True: 0, False: 0]
  ------------------
  150|      0|                curl_msnprintf(scope, sizeof(scope), "%%%u", scopeid);
  151|      0|#endif
  152|      0|            }
  153|      3|            else
  154|      3|#endif
  155|      3|              addr =
  156|      3|                &((struct sockaddr_in *)(void *)iface->ifa_addr)->sin_addr;
  157|      3|            res = IF2IP_FOUND;
  158|      3|            ip = curlx_inet_ntop(af, addr, ipstr, sizeof(ipstr));
  ------------------
  |  |   44|      3|  inet_ntop(af, src, buf, (curl_socklen_t)(size))
  ------------------
  159|      3|            curl_msnprintf(buf, buf_size, "%s%s", ip, scope);
  160|      3|            break;
  161|      3|          }
  162|    145|        }
  163|    156|        else if((res == IF2IP_NOT_FOUND) &&
  ------------------
  |  Branch (163:17): [True: 150, False: 6]
  ------------------
  164|    150|                curl_strequal(iface->ifa_name, interf)) {
  ------------------
  |  Branch (164:17): [True: 4, False: 146]
  ------------------
  165|      4|          res = IF2IP_AF_NOT_SUPPORTED;
  166|      4|        }
  167|    301|      }
  168|    301|    }
  169|       |
  170|     76|    freeifaddrs(head);
  171|     76|  }
  172|       |
  173|     76|  return res;
  174|     76|}

Curl_llist_init:
   46|  1.79M|{
   47|  1.79M|  l->_size = 0;
   48|  1.79M|  l->_dtor = dtor;
   49|  1.79M|  l->_head = NULL;
   50|  1.79M|  l->_tail = NULL;
   51|  1.79M|#ifdef DEBUGBUILD
   52|  1.79M|  l->_init = LLISTINIT;
  ------------------
  |  |   29|  1.79M|#define LLISTINIT 0x100cc001 /* random pattern */
  ------------------
   53|  1.79M|#endif
   54|  1.79M|}
Curl_llist_insert_next:
   71|  4.35M|{
   72|  4.35M|  DEBUGASSERT(list);
  ------------------
  |  | 1081|  4.35M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (72:3): [True: 0, False: 4.35M]
  |  Branch (72:3): [True: 4.35M, False: 0]
  ------------------
   73|  4.35M|  DEBUGASSERT(list->_init == LLISTINIT);
  ------------------
  |  | 1081|  4.35M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (73:3): [True: 0, False: 4.35M]
  |  Branch (73:3): [True: 4.35M, False: 1]
  ------------------
   74|  4.35M|  DEBUGASSERT(ne);
  ------------------
  |  | 1081|  4.35M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (74:3): [True: 0, False: 4.35M]
  |  Branch (74:3): [True: 4.35M, False: 0]
  ------------------
   75|       |
   76|  4.35M|#ifdef DEBUGBUILD
   77|  4.35M|  ne->_init = NODEINIT;
  ------------------
  |  |   30|  4.35M|#define NODEINIT  0x12344321 /* random pattern */
  ------------------
   78|  4.35M|#endif
   79|  4.35M|  ne->_ptr = CURL_UNCONST(p);
  ------------------
  |  |  866|  4.35M|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
   80|  4.35M|  ne->_list = list;
   81|  4.35M|  if(list->_size == 0) {
  ------------------
  |  Branch (81:6): [True: 59.3k, False: 4.29M]
  ------------------
   82|  59.3k|    list->_head = ne;
   83|  59.3k|    list->_head->_prev = NULL;
   84|  59.3k|    list->_head->_next = NULL;
   85|  59.3k|    list->_tail = ne;
   86|  59.3k|  }
   87|  4.29M|  else {
   88|       |    /* if 'e' is NULL here, we insert the new element first in the list */
   89|  4.29M|    ne->_next = e ? e->_next : list->_head;
  ------------------
  |  Branch (89:17): [True: 4.29M, False: 94]
  ------------------
   90|  4.29M|    ne->_prev = e;
   91|  4.29M|    if(!e) {
  ------------------
  |  Branch (91:8): [True: 95, False: 4.29M]
  ------------------
   92|     95|      list->_head->_prev = ne;
   93|     95|      list->_head = ne;
   94|     95|    }
   95|  4.29M|    else if(e->_next) {
  ------------------
  |  Branch (95:13): [True: 1.78M, False: 2.50M]
  ------------------
   96|  1.78M|      e->_next->_prev = ne;
   97|  1.78M|    }
   98|  2.50M|    else {
   99|  2.50M|      list->_tail = ne;
  100|  2.50M|    }
  101|  4.29M|    if(e)
  ------------------
  |  Branch (101:8): [True: 4.29M, False: 94]
  ------------------
  102|  4.29M|      e->_next = ne;
  103|  4.29M|  }
  104|       |
  105|  4.35M|  ++list->_size;
  106|  4.35M|}
Curl_llist_append:
  119|   125k|{
  120|   125k|  DEBUGASSERT(list);
  ------------------
  |  | 1081|   125k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (120:3): [True: 0, False: 125k]
  |  Branch (120:3): [True: 125k, False: 0]
  ------------------
  121|   125k|  DEBUGASSERT(list->_init == LLISTINIT);
  ------------------
  |  | 1081|   125k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (121:3): [True: 0, False: 125k]
  |  Branch (121:3): [True: 125k, False: 0]
  ------------------
  122|   125k|  DEBUGASSERT(ne);
  ------------------
  |  | 1081|   125k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (122:3): [True: 0, False: 125k]
  |  Branch (122:3): [True: 125k, False: 0]
  ------------------
  123|   125k|  Curl_llist_insert_next(list, list->_tail, p, ne);
  124|   125k|}
Curl_node_take_elem:
  127|  4.26M|{
  128|  4.26M|  void *ptr;
  129|  4.26M|  struct Curl_llist *list;
  130|  4.26M|  if(!e)
  ------------------
  |  Branch (130:6): [True: 0, False: 4.26M]
  ------------------
  131|      0|    return NULL;
  132|       |
  133|  4.26M|  list = e->_list;
  134|  4.26M|  DEBUGASSERT(list);
  ------------------
  |  | 1081|  4.26M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (134:3): [True: 0, False: 4.26M]
  |  Branch (134:3): [True: 4.26M, False: 0]
  ------------------
  135|  4.26M|  DEBUGASSERT(list->_init == LLISTINIT);
  ------------------
  |  | 1081|  4.26M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (135:3): [True: 0, False: 4.26M]
  |  Branch (135:3): [True: 4.26M, False: 0]
  ------------------
  136|  4.26M|  DEBUGASSERT(list->_size);
  ------------------
  |  | 1081|  4.26M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (136:3): [True: 0, False: 4.26M]
  |  Branch (136:3): [True: 4.26M, False: 0]
  ------------------
  137|  4.26M|  DEBUGASSERT(e->_init == NODEINIT);
  ------------------
  |  | 1081|  4.26M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (137:3): [True: 0, False: 4.26M]
  |  Branch (137:3): [True: 4.26M, False: 0]
  ------------------
  138|  4.26M|  if(list) {
  ------------------
  |  Branch (138:6): [True: 4.26M, False: 0]
  ------------------
  139|  4.26M|    if(e == list->_head) {
  ------------------
  |  Branch (139:8): [True: 54.2k, False: 4.21M]
  ------------------
  140|  54.2k|      list->_head = e->_next;
  141|       |
  142|  54.2k|      if(!list->_head)
  ------------------
  |  Branch (142:10): [True: 52.5k, False: 1.73k]
  ------------------
  143|  52.5k|        list->_tail = NULL;
  144|  1.73k|      else
  145|  1.73k|        e->_next->_prev = NULL;
  146|  54.2k|    }
  147|  4.21M|    else {
  148|  4.21M|      if(e->_prev)
  ------------------
  |  Branch (148:10): [True: 4.21M, False: 0]
  ------------------
  149|  4.21M|        e->_prev->_next = e->_next;
  150|       |
  151|  4.21M|      if(!e->_next)
  ------------------
  |  Branch (151:10): [True: 2.42M, False: 1.78M]
  ------------------
  152|  2.42M|        list->_tail = e->_prev;
  153|  1.78M|      else
  154|  1.78M|        e->_next->_prev = e->_prev;
  155|  4.21M|    }
  156|  4.26M|    --list->_size;
  157|  4.26M|  }
  158|  4.26M|  ptr = e->_ptr;
  159|       |
  160|  4.26M|  e->_list = NULL;
  161|  4.26M|  e->_ptr  = NULL;
  162|  4.26M|  e->_prev = NULL;
  163|  4.26M|  e->_next = NULL;
  164|  4.26M|#ifdef DEBUGBUILD
  165|  4.26M|  e->_init = NODEREM; /* specific pattern on remove - not zero */
  ------------------
  |  |   31|  4.26M|#define NODEREM   0x54321012 /* random pattern */
  ------------------
  166|  4.26M|#endif
  167|       |
  168|  4.26M|  return ptr;
  169|  4.26M|}
Curl_node_remove:
  188|  4.24M|{
  189|       |  node_uremove(e, NULL);
  190|  4.24M|}
Curl_llist_destroy:
  193|   479k|{
  194|   479k|  if(list) {
  ------------------
  |  Branch (194:6): [True: 479k, False: 0]
  ------------------
  195|   479k|    DEBUGASSERT(list->_init == LLISTINIT);
  ------------------
  |  | 1081|   479k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (195:5): [True: 0, False: 479k]
  |  Branch (195:5): [True: 479k, False: 0]
  ------------------
  196|   496k|    while(list->_size > 0)
  ------------------
  |  Branch (196:11): [True: 16.7k, False: 479k]
  ------------------
  197|  16.7k|      node_uremove(list->_tail, user);
  198|   479k|  }
  199|   479k|}
Curl_llist_head:
  204|  22.7M|{
  205|  22.7M|  DEBUGASSERT(list);
  ------------------
  |  | 1081|  22.7M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (205:3): [True: 0, False: 22.7M]
  |  Branch (205:3): [True: 22.7M, False: 0]
  ------------------
  206|  22.7M|  DEBUGASSERT(list->_init == LLISTINIT);
  ------------------
  |  | 1081|  22.7M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (206:3): [True: 0, False: 22.7M]
  |  Branch (206:3): [True: 22.7M, False: 0]
  ------------------
  207|  22.7M|  return VERIFYNODE(list->_head);
  ------------------
  |  |   33|  22.7M|#define VERIFYNODE(x) verifynode(x)
  ------------------
  208|  22.7M|}
Curl_llist_count:
  227|  4.43M|{
  228|  4.43M|  DEBUGASSERT(list);
  ------------------
  |  | 1081|  4.43M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (228:3): [True: 0, False: 4.43M]
  |  Branch (228:3): [True: 4.43M, False: 0]
  ------------------
  229|  4.43M|  DEBUGASSERT(list->_init == LLISTINIT);
  ------------------
  |  | 1081|  4.43M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (229:3): [True: 0, False: 4.43M]
  |  Branch (229:3): [True: 4.43M, False: 0]
  ------------------
  230|  4.43M|  return list->_size;
  231|  4.43M|}
Curl_node_elem:
  235|  14.5M|{
  236|  14.5M|  DEBUGASSERT(n);
  ------------------
  |  | 1081|  14.5M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (236:3): [True: 0, False: 14.5M]
  |  Branch (236:3): [True: 14.5M, False: 0]
  ------------------
  237|  14.5M|  DEBUGASSERT(n->_init == NODEINIT);
  ------------------
  |  | 1081|  14.5M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (237:3): [True: 0, False: 14.5M]
  |  Branch (237:3): [True: 14.5M, False: 0]
  ------------------
  238|  14.5M|  return n->_ptr;
  239|  14.5M|}
Curl_node_next:
  244|  8.57M|{
  245|  8.57M|  DEBUGASSERT(n);
  ------------------
  |  | 1081|  8.57M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (245:3): [True: 0, False: 8.57M]
  |  Branch (245:3): [True: 8.57M, False: 0]
  ------------------
  246|  8.57M|  DEBUGASSERT(n->_init == NODEINIT);
  ------------------
  |  | 1081|  8.57M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (246:3): [True: 0, False: 8.57M]
  |  Branch (246:3): [True: 8.57M, False: 0]
  ------------------
  247|  8.57M|  return VERIFYNODE(n->_next);
  ------------------
  |  |   33|  8.57M|#define VERIFYNODE(x) verifynode(x)
  ------------------
  248|  8.57M|}
Curl_node_llist:
  268|  42.9k|{
  269|  42.9k|  DEBUGASSERT(n);
  ------------------
  |  | 1081|  42.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (269:3): [True: 0, False: 42.9k]
  |  Branch (269:3): [True: 42.9k, False: 0]
  ------------------
  270|  42.9k|  DEBUGASSERT(!n->_list || n->_init == NODEINIT);
  ------------------
  |  | 1081|  42.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (270:3): [True: 42.9k, False: 0]
  |  Branch (270:3): [True: 0, False: 0]
  |  Branch (270:3): [True: 14.2k, False: 28.7k]
  |  Branch (270:3): [True: 28.7k, False: 0]
  ------------------
  271|  42.9k|  return n->_list;
  272|  42.9k|}
llist.c:node_uremove:
  172|  4.26M|{
  173|  4.26M|  struct Curl_llist *list;
  174|  4.26M|  void *ptr;
  175|  4.26M|  if(!e)
  ------------------
  |  Branch (175:6): [True: 0, False: 4.26M]
  ------------------
  176|      0|    return;
  177|       |
  178|  4.26M|  list = e->_list;
  179|  4.26M|  DEBUGASSERT(list);
  ------------------
  |  | 1081|  4.26M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (179:3): [True: 0, False: 4.26M]
  |  Branch (179:3): [True: 4.26M, False: 0]
  ------------------
  180|  4.26M|  if(list) {
  ------------------
  |  Branch (180:6): [True: 4.26M, False: 0]
  ------------------
  181|  4.26M|    ptr = Curl_node_take_elem(e);
  182|  4.26M|    if(list->_dtor)
  ------------------
  |  Branch (182:8): [True: 139, False: 4.26M]
  ------------------
  183|    139|      list->_dtor(user, ptr);
  184|  4.26M|  }
  185|  4.26M|}
llist.c:verifynode:
   35|  31.3M|{
   36|  31.3M|  DEBUGASSERT(!n || (n->_init == NODEINIT));
  ------------------
  |  | 1081|  31.3M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (36:3): [True: 31.3M, False: 0]
  |  Branch (36:3): [True: 0, False: 0]
  |  Branch (36:3): [True: 16.7M, False: 14.5M]
  |  Branch (36:3): [True: 14.5M, False: 0]
  ------------------
   37|  31.3M|  return n;
   38|  31.3M|}

curl_dbg_malloc:
  212|  1.01M|{
  213|  1.01M|  struct memdebug *mem;
  214|  1.01M|  size_t size;
  215|       |
  216|  1.01M|  DEBUGASSERT(wantedsize != 0);
  ------------------
  |  | 1081|  1.01M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (216:3): [True: 0, False: 1.01M]
  |  Branch (216:3): [True: 1.01M, False: 0]
  ------------------
  217|       |
  218|  1.01M|  if(countcheck("malloc", line, source))
  ------------------
  |  Branch (218:6): [True: 0, False: 1.01M]
  ------------------
  219|      0|    return NULL;
  220|       |
  221|       |  /* alloc at least 64 bytes */
  222|  1.01M|  size = sizeof(struct memdebug) + wantedsize;
  223|       |
  224|  1.01M|  mem = Curl_cmalloc(size);
  225|  1.01M|  if(mem) {
  ------------------
  |  Branch (225:6): [True: 1.01M, False: 0]
  ------------------
  226|  1.01M|    mem->size = wantedsize;
  227|  1.01M|  }
  228|       |
  229|  1.01M|  if(source)
  ------------------
  |  Branch (229:6): [True: 573k, False: 440k]
  ------------------
  230|   573k|    curl_dbg_log("MEM %s:%d malloc(%zu) = %p\n",
  231|   573k|                 source, line, wantedsize,
  232|   573k|                 mem ? (void *)mem->mem : (void *)0);
  ------------------
  |  Branch (232:18): [True: 573k, False: 0]
  ------------------
  233|       |
  234|  1.01M|  return mem ? mem->mem : NULL;
  ------------------
  |  Branch (234:10): [True: 1.01M, False: 0]
  ------------------
  235|  1.01M|}
curl_dbg_calloc:
  240|  1.20M|{
  241|  1.20M|  struct memdebug *mem;
  242|  1.20M|  size_t size, user_size;
  243|       |
  244|  1.20M|  DEBUGASSERT(wanted_elements != 0);
  ------------------
  |  | 1081|  1.20M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (244:3): [True: 0, False: 1.20M]
  |  Branch (244:3): [True: 1.20M, False: 0]
  ------------------
  245|  1.20M|  DEBUGASSERT(wanted_size != 0);
  ------------------
  |  | 1081|  1.20M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (245:3): [True: 0, False: 1.20M]
  |  Branch (245:3): [True: 1.20M, False: 0]
  ------------------
  246|       |
  247|  1.20M|  if(countcheck("calloc", line, source))
  ------------------
  |  Branch (247:6): [True: 0, False: 1.20M]
  ------------------
  248|      0|    return NULL;
  249|       |
  250|       |  /* alloc at least 64 bytes */
  251|  1.20M|  user_size = wanted_size * wanted_elements;
  252|  1.20M|  size = sizeof(struct memdebug) + user_size;
  253|       |
  254|  1.20M|  mem = Curl_ccalloc(1, size);
  255|  1.20M|  if(mem)
  ------------------
  |  Branch (255:6): [True: 1.20M, False: 0]
  ------------------
  256|  1.20M|    mem->size = user_size;
  257|       |
  258|  1.20M|  if(source)
  ------------------
  |  Branch (258:6): [True: 1.20M, False: 0]
  ------------------
  259|  1.20M|    curl_dbg_log("MEM %s:%d calloc(%zu,%zu) = %p\n",
  260|  1.20M|                 source, line, wanted_elements, wanted_size,
  261|  1.20M|                 mem ? (void *)mem->mem : (void *)0);
  ------------------
  |  Branch (261:18): [True: 1.20M, False: 0]
  ------------------
  262|       |
  263|  1.20M|  return mem ? mem->mem : NULL;
  ------------------
  |  Branch (263:10): [True: 1.20M, False: 0]
  ------------------
  264|  1.20M|}
curl_dbg_strdup:
  268|   440k|{
  269|   440k|  char *mem;
  270|   440k|  size_t len;
  271|       |
  272|   440k|  DEBUGASSERT(str != NULL);
  ------------------
  |  | 1081|   440k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (272:3): [True: 0, False: 440k]
  |  Branch (272:3): [True: 440k, False: 0]
  ------------------
  273|       |
  274|   440k|  if(countcheck("strdup", line, source))
  ------------------
  |  Branch (274:6): [True: 0, False: 440k]
  ------------------
  275|      0|    return NULL;
  276|       |
  277|   440k|  len = strlen(str) + 1;
  278|       |
  279|   440k|  mem = curl_dbg_malloc(len, 0, NULL); /* NULL prevents logging */
  280|   440k|  if(mem)
  ------------------
  |  Branch (280:6): [True: 440k, False: 0]
  ------------------
  281|   440k|    memcpy(mem, str, len);
  282|       |
  283|   440k|  if(source)
  ------------------
  |  Branch (283:6): [True: 440k, False: 0]
  ------------------
  284|   440k|    curl_dbg_log("MEM %s:%d strdup(%p) (%zu) = %p\n",
  285|   440k|                 source, line, (const void *)str, len, (const void *)mem);
  286|       |
  287|   440k|  return mem;
  288|   440k|}
curl_dbg_realloc:
  321|   469k|{
  322|   469k|  struct memdebug *mem = NULL;
  323|   469k|  bool was_locked;
  324|       |
  325|   469k|  size_t size = sizeof(struct memdebug) + wantedsize;
  326|       |
  327|   469k|  DEBUGASSERT(wantedsize != 0);
  ------------------
  |  | 1081|   469k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (327:3): [True: 0, False: 469k]
  |  Branch (327:3): [True: 469k, False: 0]
  ------------------
  328|       |
  329|   469k|  if(countcheck("realloc", line, source))
  ------------------
  |  Branch (329:6): [True: 0, False: 469k]
  ------------------
  330|      0|    return NULL;
  331|       |
  332|       |  /* need to realloc under lock, as we get out-of-order log
  333|       |   * entries otherwise, since another thread might alloc the
  334|       |   * memory released by realloc() before otherwise would log it. */
  335|   469k|  was_locked = curl_dbg_lock();
  336|       |#ifdef __INTEL_COMPILER
  337|       |#  pragma warning(push)
  338|       |#  pragma warning(disable:1684)
  339|       |   /* 1684: conversion from pointer to same-sized integral type */
  340|       |#endif
  341|       |
  342|   469k|  if(ptr)
  ------------------
  |  Branch (342:6): [True: 113k, False: 356k]
  ------------------
  343|   113k|    mem = (void *)((char *)ptr - offsetof(struct memdebug, mem));
  344|       |
  345|       |#ifdef __INTEL_COMPILER
  346|       |#  pragma warning(pop)
  347|       |#endif
  348|       |
  349|   469k|  mem = Curl_crealloc(mem, size);
  350|   469k|  if(source)
  ------------------
  |  Branch (350:6): [True: 469k, False: 0]
  ------------------
  351|   469k|    curl_dbg_log_locked("MEM %s:%d realloc(%p, %zu) = %p\n",
  352|   469k|                        source, line, (void *)ptr, wantedsize,
  353|   469k|                        mem ? (void *)mem->mem : (void *)0);
  ------------------
  |  Branch (353:25): [True: 469k, False: 0]
  ------------------
  354|       |
  355|   469k|  curl_dbg_unlock(was_locked);
  356|   469k|  if(mem) {
  ------------------
  |  Branch (356:6): [True: 469k, False: 0]
  ------------------
  357|   469k|    mem->size = wantedsize;
  358|   469k|    return mem->mem;
  359|   469k|  }
  360|       |
  361|      0|  return NULL;
  362|   469k|}
curl_dbg_free:
  365|  15.2M|{
  366|  15.2M|  if(ptr) {
  ------------------
  |  Branch (366:6): [True: 2.57M, False: 12.6M]
  ------------------
  367|  2.57M|    struct memdebug *mem;
  368|       |
  369|  2.57M|    if(source)
  ------------------
  |  Branch (369:8): [True: 2.57M, False: 0]
  ------------------
  370|  2.57M|      curl_dbg_log("MEM %s:%d free(%p)\n", source, line, (void *)ptr);
  371|       |
  372|       |#ifdef __INTEL_COMPILER
  373|       |#  pragma warning(push)
  374|       |#  pragma warning(disable:1684)
  375|       |   /* 1684: conversion from pointer to same-sized integral type */
  376|       |#endif
  377|       |
  378|  2.57M|    mem = (void *)((char *)ptr - offsetof(struct memdebug, mem));
  379|       |
  380|       |#ifdef __INTEL_COMPILER
  381|       |#  pragma warning(pop)
  382|       |#endif
  383|       |
  384|       |    /* free for real */
  385|  2.57M|    Curl_cfree(mem);
  386|  2.57M|  }
  387|  15.2M|}
curl_dbg_socket:
  391|  17.2k|{
  392|  17.2k|  curl_socket_t sockfd;
  393|       |
  394|  17.2k|  if(countcheck("socket", line, source))
  ------------------
  |  Branch (394:6): [True: 0, False: 17.2k]
  ------------------
  395|      0|    return CURL_SOCKET_BAD;
  ------------------
  |  |  145|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  396|       |
  397|       |  /* !checksrc! disable BANNEDFUNC 1 */
  398|  17.2k|  sockfd = socket(domain, type, protocol);
  399|       |
  400|  17.2k|  if(source && (sockfd != CURL_SOCKET_BAD))
  ------------------
  |  |  145|  17.2k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (400:6): [True: 17.2k, False: 0]
  |  Branch (400:16): [True: 17.2k, False: 0]
  ------------------
  401|  17.2k|    curl_dbg_log("FD %s:%d socket() = %" FMT_SOCKET_T "\n",
  402|  17.2k|                 source, line, sockfd);
  403|       |
  404|  17.2k|  return sockfd;
  405|  17.2k|}
curl_dbg_mark_sclose:
  461|  31.1k|{
  462|  31.1k|  if(source)
  ------------------
  |  Branch (462:6): [True: 31.1k, False: 0]
  ------------------
  463|  31.1k|    curl_dbg_log("FD %s:%d sclose(%" FMT_SOCKET_T ")\n",
  464|  31.1k|                 source, line, sockfd);
  465|  31.1k|}
curl_dbg_sclose:
  469|  31.1k|{
  470|  31.1k|  curl_dbg_mark_sclose(sockfd, line, source);
  471|  31.1k|  return CURL_SCLOSE(sockfd);
  ------------------
  |  |  999|  31.1k|#  define CURL_SCLOSE(x)  close(x)
  ------------------
  472|  31.1k|}
curl_dbg_fopen:
  477|  93.5k|{
  478|  93.5k|  FILE *res = CURLX_FOPEN_LOW(file, mode);
  ------------------
  |  |   64|  93.5k|#define CURLX_FOPEN_LOW         fopen
  ------------------
  479|  93.5k|  if(source)
  ------------------
  |  Branch (479:6): [True: 93.5k, False: 0]
  ------------------
  480|  93.5k|    curl_dbg_log("FILE %s:%d fopen(\"%s\",\"%s\") = %p\n",
  481|  93.5k|                 source, line, file, mode, (void *)res);
  482|       |
  483|  93.5k|  return res;
  484|  93.5k|}
curl_dbg_fclose:
  510|  93.5k|{
  511|  93.5k|  int res;
  512|       |
  513|  93.5k|  DEBUGASSERT(file != NULL);
  ------------------
  |  | 1081|  93.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (513:3): [True: 0, False: 93.5k]
  |  Branch (513:3): [True: 93.5k, False: 0]
  ------------------
  514|       |
  515|  93.5k|  if(source)
  ------------------
  |  Branch (515:6): [True: 93.5k, False: 0]
  ------------------
  516|  93.5k|    curl_dbg_log("FILE %s:%d fclose(%p)\n", source, line, (void *)file);
  517|       |
  518|       |  /* !checksrc! disable BANNEDFUNC 1 */
  519|  93.5k|  res = fclose(file);
  520|       |
  521|  93.5k|  return res;
  522|  93.5k|}
curl_dbg_log:
  565|  5.03M|{
  566|  5.03M|  bool was_locked;
  567|  5.03M|  va_list ap;
  568|       |
  569|  5.03M|  if(!curl_dbg_logfile)
  ------------------
  |  Branch (569:6): [True: 5.03M, False: 4]
  ------------------
  570|  5.03M|    return;
  571|       |
  572|      4|  was_locked = curl_dbg_lock();
  573|      4|  va_start(ap, format);
  574|      4|  curl_dbg_vlog(format, ap);
  575|       |  va_end(ap);
  576|      4|  curl_dbg_unlock(was_locked);
  577|      4|}
memdebug.c:countcheck:
  187|  3.14M|{
  188|       |  /* if source is NULL, then the call is made internally and this check
  189|       |     should not be made */
  190|  3.14M|  if(memlimit && source) {
  ------------------
  |  Branch (190:6): [True: 0, False: 3.14M]
  |  Branch (190:18): [True: 0, False: 0]
  ------------------
  191|      0|    if(!memsize) {
  ------------------
  |  Branch (191:8): [True: 0, False: 0]
  ------------------
  192|       |      /* log to file */
  193|      0|      curl_dbg_log("LIMIT %s:%d %s reached memlimit\n", source, line, func);
  194|       |      /* log to stderr also */
  195|      0|      curl_mfprintf(stderr, "LIMIT %s:%d %s reached memlimit\n",
  196|      0|                    source, line, func);
  197|      0|      dump_bt();
  198|      0|      fflush(curl_dbg_logfile); /* because it might crash now */
  199|       |      /* !checksrc! disable ERRNOVAR 1 */
  200|      0|      errno = ENOMEM;
  201|      0|      return TRUE; /* RETURN ERROR! */
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  202|      0|    }
  203|      0|    else
  204|      0|      memsize--; /* countdown */
  205|      0|  }
  206|       |
  207|  3.14M|  return FALSE; /* allow this */
  ------------------
  |  | 1058|  3.14M|#define FALSE false
  ------------------
  208|  3.14M|}
memdebug.c:curl_dbg_lock:
   74|   469k|{
   75|   469k|#ifdef USE_MUTEX
   76|   469k|  if(dbg_mutex_init) {
  ------------------
  |  Branch (76:6): [True: 0, False: 469k]
  ------------------
   77|      0|    Curl_mutex_acquire(&dbg_mutex);
  ------------------
  |  |   36|      0|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
   78|      0|    return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
   79|      0|  }
   80|   469k|#endif
   81|   469k|  return FALSE;
  ------------------
  |  | 1058|   469k|#define FALSE false
  ------------------
   82|   469k|}
memdebug.c:curl_dbg_unlock:
   85|   469k|{
   86|   469k|#ifdef USE_MUTEX
   87|   469k|  if(was_locked)
  ------------------
  |  Branch (87:6): [True: 0, False: 469k]
  ------------------
   88|      0|    Curl_mutex_release(&dbg_mutex);
  ------------------
  |  |   37|      0|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
   89|       |#else
   90|       |  (void)was_locked;
   91|       |#endif
   92|   469k|}
memdebug.c:curl_dbg_log_locked:
  552|   469k|{
  553|   469k|  va_list ap;
  554|       |
  555|   469k|  if(!curl_dbg_logfile)
  ------------------
  |  Branch (555:6): [True: 469k, False: 0]
  ------------------
  556|   469k|    return;
  557|       |
  558|   469k|  va_start(ap, format);
  559|      0|  curl_dbg_vlog(format, ap);
  560|       |  va_end(ap);
  561|      0|}

Curl_mime_cleanpart:
 1090|   199k|{
 1091|   199k|  if(part) {
  ------------------
  |  Branch (1091:6): [True: 125k, False: 73.4k]
  ------------------
 1092|   125k|    cleanup_part_content(part);
 1093|   125k|    curl_slist_free_all(part->curlheaders);
 1094|   125k|    if(part->flags & MIME_USERHEADERS_OWNER)
  ------------------
  |  |   34|   125k|#define MIME_USERHEADERS_OWNER  (1 << 0)
  ------------------
  |  Branch (1094:8): [True: 0, False: 125k]
  ------------------
 1095|      0|      curl_slist_free_all(part->userheaders);
 1096|   125k|    curlx_safefree(part->mimetype);
  ------------------
  |  | 1327|   125k|  do {                      \
  |  | 1328|   125k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|   125k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|   125k|    (ptr) = NULL;           \
  |  | 1330|   125k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 125k]
  |  |  ------------------
  ------------------
 1097|   125k|    curlx_safefree(part->name);
  ------------------
  |  | 1327|   125k|  do {                      \
  |  | 1328|   125k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|   125k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|   125k|    (ptr) = NULL;           \
  |  | 1330|   125k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 125k]
  |  |  ------------------
  ------------------
 1098|       |    curlx_safefree(part->filename);
  ------------------
  |  | 1327|   125k|  do {                      \
  |  | 1328|   125k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|   125k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|   125k|    (ptr) = NULL;           \
  |  | 1330|   125k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 125k]
  |  |  ------------------
  ------------------
 1099|   125k|    Curl_mime_initpart(part);
 1100|   125k|  }
 1101|   199k|}
curl_mime_free:
 1105|    643|{
 1106|    643|  curl_mimepart *part;
 1107|       |
 1108|    643|  if(mime) {
  ------------------
  |  Branch (1108:6): [True: 643, False: 0]
  ------------------
 1109|    643|    mime_subparts_unbind(mime);  /* Be sure it is not referenced anymore. */
 1110|   125k|    while(mime->firstpart) {
  ------------------
  |  Branch (1110:11): [True: 124k, False: 643]
  ------------------
 1111|   124k|      part = mime->firstpart;
 1112|   124k|      mime->firstpart = part->nextpart;
 1113|   124k|      Curl_mime_cleanpart(part);
 1114|   124k|      curlx_free(part);
  ------------------
  |  | 1483|   124k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1115|   124k|    }
 1116|    643|    curlx_free(mime);
  ------------------
  |  | 1483|    643|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1117|    643|  }
 1118|    643|}
curl_mime_init:
 1204|    643|{
 1205|    643|  curl_mime *mime;
 1206|       |
 1207|    643|  mime = (curl_mime *)curlx_malloc(sizeof(*mime));
  ------------------
  |  | 1478|    643|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
 1208|       |
 1209|    643|  if(mime) {
  ------------------
  |  Branch (1209:6): [True: 643, False: 0]
  ------------------
 1210|    643|    mime->parent = NULL;
 1211|    643|    mime->firstpart = NULL;
 1212|    643|    mime->lastpart = NULL;
 1213|       |
 1214|    643|    memset(mime->boundary, '-', MIME_BOUNDARY_DASHES);
  ------------------
  |  |   28|    643|#define MIME_BOUNDARY_DASHES            24  /* leading boundary dashes */
  ------------------
 1215|    643|    if(Curl_rand_alnum(easy,
  ------------------
  |  Branch (1215:8): [True: 0, False: 643]
  ------------------
 1216|    643|                       (unsigned char *)&mime->boundary[MIME_BOUNDARY_DASHES],
  ------------------
  |  |   28|    643|#define MIME_BOUNDARY_DASHES            24  /* leading boundary dashes */
  ------------------
 1217|    643|                       MIME_RAND_BOUNDARY_CHARS + 1)) {
  ------------------
  |  |   29|    643|#define MIME_RAND_BOUNDARY_CHARS        22  /* Nb. of random boundary chars. */
  ------------------
 1218|       |      /* failed to get random separator, bail out */
 1219|      0|      curlx_free(mime);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1220|      0|      return NULL;
 1221|      0|    }
 1222|    643|    mimesetstate(&mime->state, MIMESTATE_BEGIN, NULL);
 1223|    643|  }
 1224|       |
 1225|    643|  return mime;
 1226|    643|}
Curl_mime_initpart:
 1230|   250k|{
 1231|   250k|  memset(part, 0, sizeof(*part));
 1232|   250k|  part->lastreadstatus = 1; /* Successful read status. */
 1233|       |  mimesetstate(&part->state, MIMESTATE_BEGIN, NULL);
 1234|   250k|}
curl_mime_addpart:
 1238|   124k|{
 1239|   124k|  curl_mimepart *part;
 1240|       |
 1241|   124k|  if(!mime)
  ------------------
  |  Branch (1241:6): [True: 0, False: 124k]
  ------------------
 1242|      0|    return NULL;
 1243|       |
 1244|   124k|  part = (curl_mimepart *)curlx_malloc(sizeof(*part));
  ------------------
  |  | 1478|   124k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
 1245|       |
 1246|   124k|  if(part) {
  ------------------
  |  Branch (1246:6): [True: 124k, False: 0]
  ------------------
 1247|   124k|    Curl_mime_initpart(part);
 1248|   124k|    part->parent = mime;
 1249|       |
 1250|   124k|    if(mime->lastpart)
  ------------------
  |  Branch (1250:8): [True: 124k, False: 643]
  ------------------
 1251|   124k|      mime->lastpart->nextpart = part;
 1252|    643|    else
 1253|    643|      mime->firstpart = part;
 1254|       |
 1255|   124k|    mime->lastpart = part;
 1256|   124k|  }
 1257|       |
 1258|   124k|  return part;
 1259|   124k|}
curl_mime_name:
 1263|    574|{
 1264|    574|  if(!part)
  ------------------
  |  Branch (1264:6): [True: 0, False: 574]
  ------------------
 1265|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1266|       |
 1267|    574|  curlx_safefree(part->name);
  ------------------
  |  | 1327|    574|  do {                      \
  |  | 1328|    574|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|    574|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|    574|    (ptr) = NULL;           \
  |  | 1330|    574|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 574]
  |  |  ------------------
  ------------------
 1268|       |
 1269|    574|  if(name) {
  ------------------
  |  Branch (1269:6): [True: 574, False: 0]
  ------------------
 1270|    574|    part->name = curlx_strdup(name);
  ------------------
  |  | 1477|    574|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1271|    574|    if(!part->name)
  ------------------
  |  Branch (1271:8): [True: 0, False: 574]
  ------------------
 1272|      0|      return CURLE_OUT_OF_MEMORY;
 1273|    574|  }
 1274|       |
 1275|    574|  return CURLE_OK;
 1276|    574|}
curl_mime_data:
 1297|    972|{
 1298|    972|  if(!part)
  ------------------
  |  Branch (1298:6): [True: 0, False: 972]
  ------------------
 1299|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1300|       |
 1301|    972|  cleanup_part_content(part);
 1302|       |
 1303|    972|  if(data) {
  ------------------
  |  Branch (1303:6): [True: 972, False: 0]
  ------------------
 1304|    972|    if(datasize == CURL_ZERO_TERMINATED)
  ------------------
  |  | 2423|    972|#define CURL_ZERO_TERMINATED ((size_t)-1)
  ------------------
  |  Branch (1304:8): [True: 58, False: 914]
  ------------------
 1305|     58|      datasize = strlen(data);
 1306|       |
 1307|    972|    part->data = curlx_memdup0(data, datasize);
 1308|    972|    if(!part->data)
  ------------------
  |  Branch (1308:8): [True: 0, False: 972]
  ------------------
 1309|      0|      return CURLE_OUT_OF_MEMORY;
 1310|       |
 1311|    972|    part->datasize = datasize;
 1312|    972|    part->readfunc = mime_mem_read;
 1313|    972|    part->seekfunc = mime_mem_seek;
 1314|    972|    part->freefunc = mime_mem_free;
 1315|    972|    part->flags |= MIME_FAST_READ;
  ------------------
  |  |   36|    972|#define MIME_FAST_READ          (1 << 2)
  ------------------
 1316|    972|    part->kind = MIMEKIND_DATA;
 1317|    972|  }
 1318|       |
 1319|    972|  return CURLE_OK;
 1320|    972|}
curl_mime_headers:
 1422|  1.17k|{
 1423|  1.17k|  if(!part)
  ------------------
  |  Branch (1423:6): [True: 0, False: 1.17k]
  ------------------
 1424|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1425|       |
 1426|  1.17k|  if(part->flags & MIME_USERHEADERS_OWNER) {
  ------------------
  |  |   34|  1.17k|#define MIME_USERHEADERS_OWNER  (1 << 0)
  ------------------
  |  Branch (1426:6): [True: 0, False: 1.17k]
  ------------------
 1427|      0|    if(part->userheaders != headers)  /* Allow setting twice the same list. */
  ------------------
  |  Branch (1427:8): [True: 0, False: 0]
  ------------------
 1428|      0|      curl_slist_free_all(part->userheaders);
 1429|      0|    part->flags &= ~(unsigned int)MIME_USERHEADERS_OWNER;
  ------------------
  |  |   34|      0|#define MIME_USERHEADERS_OWNER  (1 << 0)
  ------------------
 1430|      0|  }
 1431|  1.17k|  part->userheaders = headers;
 1432|  1.17k|  if(headers && take_ownership)
  ------------------
  |  Branch (1432:6): [True: 233, False: 945]
  |  Branch (1432:17): [True: 0, False: 233]
  ------------------
 1433|      0|    part->flags |= MIME_USERHEADERS_OWNER;
  ------------------
  |  |   34|      0|#define MIME_USERHEADERS_OWNER  (1 << 0)
  ------------------
 1434|  1.17k|  return CURLE_OK;
 1435|  1.17k|}
Curl_mime_set_subparts:
 1463|    633|{
 1464|    633|  curl_mime *root;
 1465|       |
 1466|    633|  if(!part)
  ------------------
  |  Branch (1466:6): [True: 0, False: 633]
  ------------------
 1467|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1468|       |
 1469|       |  /* Accept setting twice the same subparts. */
 1470|    633|  if(part->kind == MIMEKIND_MULTIPART && part->arg == subparts)
  ------------------
  |  Branch (1470:6): [True: 0, False: 633]
  |  Branch (1470:42): [True: 0, False: 0]
  ------------------
 1471|      0|    return CURLE_OK;
 1472|       |
 1473|    633|  cleanup_part_content(part);
 1474|       |
 1475|    633|  if(subparts) {
  ------------------
  |  Branch (1475:6): [True: 633, False: 0]
  ------------------
 1476|       |    /* Should not have been attached already. */
 1477|    633|    if(subparts->parent)
  ------------------
  |  Branch (1477:8): [True: 0, False: 633]
  ------------------
 1478|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1479|       |
 1480|       |    /* Should not be the part's root. */
 1481|    633|    root = part->parent;
 1482|    633|    if(root) {
  ------------------
  |  Branch (1482:8): [True: 0, False: 633]
  ------------------
 1483|      0|      while(root->parent && root->parent->parent)
  ------------------
  |  Branch (1483:13): [True: 0, False: 0]
  |  Branch (1483:29): [True: 0, False: 0]
  ------------------
 1484|      0|        root = root->parent->parent;
 1485|      0|      if(subparts == root) {
  ------------------
  |  Branch (1485:10): [True: 0, False: 0]
  ------------------
 1486|       |        /* cannot add as a subpart of itself. */
 1487|      0|        return CURLE_BAD_FUNCTION_ARGUMENT;
 1488|      0|      }
 1489|      0|    }
 1490|       |
 1491|       |    /* If subparts have already been used as a top-level MIMEPOST,
 1492|       |       they might not be positioned at start. Rewind them now, as
 1493|       |       a future check while rewinding the parent may cause this
 1494|       |       content to be skipped. */
 1495|    633|    if(mime_subparts_seek(subparts, (curl_off_t)0, SEEK_SET) !=
  ------------------
  |  Branch (1495:8): [True: 0, False: 633]
  ------------------
 1496|    633|       CURL_SEEKFUNC_OK)
  ------------------
  |  |  380|    633|#define CURL_SEEKFUNC_OK       0
  ------------------
 1497|      0|      return CURLE_SEND_FAIL_REWIND;
 1498|       |
 1499|    633|    subparts->parent = part;
 1500|       |    /* Subparts are processed internally: no read callback. */
 1501|    633|    part->seekfunc = mime_subparts_seek;
 1502|    633|    part->freefunc = take_ownership ? mime_subparts_free :
  ------------------
  |  Branch (1502:22): [True: 106, False: 527]
  ------------------
 1503|    633|      mime_subparts_unbind;
 1504|    633|    part->arg = subparts;
 1505|    633|    part->datasize = -1;
 1506|    633|    part->kind = MIMEKIND_MULTIPART;
 1507|    633|  }
 1508|       |
 1509|    633|  return CURLE_OK;
 1510|    633|}
curl_mime_subparts:
 1513|    106|{
 1514|       |  return Curl_mime_set_subparts(part, subparts, TRUE);
  ------------------
  |  | 1055|    106|#define TRUE true
  ------------------
 1515|    106|}
Curl_mime_read:
 1520|    627|{
 1521|    627|  curl_mimepart *part = (curl_mimepart *)instream;
 1522|    627|  size_t ret;
 1523|    627|  bool hasread;
 1524|       |
 1525|    627|  (void)size;  /* Always 1 */
 1526|       |
 1527|       |  /* If `nitems` is <= 4, some encoders will return STOP_FILLING without
 1528|       |   * adding any data and this loops infinitely. */
 1529|    627|  do {
 1530|    627|    hasread = FALSE;
  ------------------
  |  | 1058|    627|#define FALSE false
  ------------------
 1531|    627|    ret = readback_part(part, buffer, nitems, &hasread, 0);
 1532|       |    /*
 1533|       |     * If this is not possible to get some data without calling more than
 1534|       |     * one read callback (probably because a content encoder is not able to
 1535|       |     * deliver a new bunch for the few data accumulated so far), force another
 1536|       |     * read until we get enough data or a special exit code.
 1537|       |     */
 1538|    627|  } while(ret == STOP_FILLING);
  ------------------
  |  |   50|    627|#define STOP_FILLING ((size_t)-2)
  ------------------
  |  Branch (1538:11): [True: 0, False: 627]
  ------------------
 1539|       |
 1540|    627|  return ret;
 1541|    627|}
Curl_mime_add_header:
 1613|   122k|{
 1614|   122k|  struct curl_slist *hdr = NULL;
 1615|   122k|  char *s = NULL;
 1616|   122k|  va_list ap;
 1617|       |
 1618|   122k|  va_start(ap, fmt);
 1619|   122k|  s = curl_mvaprintf(fmt, ap);
 1620|   122k|  va_end(ap);
 1621|       |
 1622|   122k|  if(s) {
  ------------------
  |  Branch (1622:6): [True: 122k, False: 0]
  ------------------
 1623|   122k|    hdr = Curl_slist_append_nodup(*slp, s);
 1624|   122k|    if(hdr)
  ------------------
  |  Branch (1624:8): [True: 122k, False: 0]
  ------------------
 1625|   122k|      *slp = hdr;
 1626|      0|    else
 1627|      0|      curlx_free(s);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1628|   122k|  }
 1629|       |
 1630|   122k|  return hdr ? CURLE_OK : CURLE_OUT_OF_MEMORY;
  ------------------
  |  Branch (1630:10): [True: 122k, False: 0]
  ------------------
 1631|   122k|}
Curl_mime_contenttype:
 1643|   122k|{
 1644|       |  /*
 1645|       |   * If no content type was specified, we scan through a few well-known
 1646|       |   * extensions and pick the first we match!
 1647|       |   */
 1648|   122k|  struct ContentType {
 1649|   122k|    const char *extension;
 1650|   122k|    const char *type;
 1651|   122k|  };
 1652|   122k|  static const struct ContentType ctts[] = {
 1653|   122k|    { ".gif",  "image/gif" },
 1654|   122k|    { ".jpg",  "image/jpeg" },
 1655|   122k|    { ".jpeg", "image/jpeg" },
 1656|   122k|    { ".png",  "image/png" },
 1657|   122k|    { ".svg",  "image/svg+xml" },
 1658|   122k|    { ".txt",  "text/plain" },
 1659|   122k|    { ".htm",  "text/html" },
 1660|   122k|    { ".html", "text/html" },
 1661|   122k|    { ".pdf",  "application/pdf" },
 1662|   122k|    { ".xml",  "application/xml" }
 1663|   122k|  };
 1664|       |
 1665|   122k|  if(filename) {
  ------------------
  |  Branch (1665:6): [True: 0, False: 122k]
  ------------------
 1666|      0|    size_t len1 = strlen(filename);
 1667|      0|    const char *nameend = filename + len1;
 1668|      0|    unsigned int i;
 1669|       |
 1670|      0|    for(i = 0; i < CURL_ARRAYSIZE(ctts); i++) {
  ------------------
  |  | 1294|      0|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (1670:16): [True: 0, False: 0]
  ------------------
 1671|      0|      size_t len2 = strlen(ctts[i].extension);
 1672|       |
 1673|      0|      if(len1 >= len2 && curl_strequal(nameend - len2, ctts[i].extension))
  ------------------
  |  Branch (1673:10): [True: 0, False: 0]
  |  Branch (1673:26): [True: 0, False: 0]
  ------------------
 1674|      0|        return ctts[i].type;
 1675|      0|    }
 1676|      0|  }
 1677|   122k|  return NULL;
 1678|   122k|}
Curl_mime_prepare_headers:
 1747|   123k|{
 1748|   123k|  curl_mime *mime = NULL;
 1749|   123k|  const char *boundary = NULL;
 1750|   123k|  char *customct;
 1751|   123k|  const char *cte = NULL;
 1752|   123k|  CURLcode result = CURLE_OK;
 1753|       |
 1754|       |  /* Get rid of previously prepared headers. */
 1755|   123k|  curl_slist_free_all(part->curlheaders);
 1756|   123k|  part->curlheaders = NULL;
 1757|       |
 1758|       |  /* Be sure we will not access old headers later. */
 1759|   123k|  if(part->state.state == MIMESTATE_CURLHEADERS)
  ------------------
  |  Branch (1759:6): [True: 0, False: 123k]
  ------------------
 1760|      0|    mimesetstate(&part->state, MIMESTATE_CURLHEADERS, NULL);
 1761|       |
 1762|       |  /* Check if content type is specified. */
 1763|   123k|  customct = part->mimetype;
 1764|   123k|  if(!customct)
  ------------------
  |  Branch (1764:6): [True: 123k, False: 0]
  ------------------
 1765|   123k|    customct = search_header(part->userheaders, STRCONST("Content-Type"));
  ------------------
  |  | 1292|   123k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 1766|   123k|  if(customct)
  ------------------
  |  Branch (1766:6): [True: 14, False: 123k]
  ------------------
 1767|     14|    contenttype = customct;
 1768|       |
 1769|       |  /* If content type is not specified, try to determine it. */
 1770|   123k|  if(!contenttype) {
  ------------------
  |  Branch (1770:6): [True: 122k, False: 536]
  ------------------
 1771|   122k|    switch(part->kind) {
 1772|      0|    case MIMEKIND_MULTIPART:
  ------------------
  |  Branch (1772:5): [True: 0, False: 122k]
  ------------------
 1773|      0|      contenttype = MULTIPART_CONTENTTYPE_DEFAULT;
  ------------------
  |  |   39|      0|#define MULTIPART_CONTENTTYPE_DEFAULT   "multipart/mixed"
  ------------------
 1774|      0|      break;
 1775|      0|    case MIMEKIND_FILE:
  ------------------
  |  Branch (1775:5): [True: 0, False: 122k]
  ------------------
 1776|      0|      contenttype = Curl_mime_contenttype(part->filename);
 1777|      0|      if(!contenttype)
  ------------------
  |  Branch (1777:10): [True: 0, False: 0]
  ------------------
 1778|      0|        contenttype = Curl_mime_contenttype(part->data);
 1779|      0|      if(!contenttype && part->filename)
  ------------------
  |  Branch (1779:10): [True: 0, False: 0]
  |  Branch (1779:26): [True: 0, False: 0]
  ------------------
 1780|      0|        contenttype = FILE_CONTENTTYPE_DEFAULT;
  ------------------
  |  |   38|      0|#define FILE_CONTENTTYPE_DEFAULT        "application/octet-stream"
  ------------------
 1781|      0|      break;
 1782|   122k|    default:
  ------------------
  |  Branch (1782:5): [True: 122k, False: 0]
  ------------------
 1783|   122k|      contenttype = Curl_mime_contenttype(part->filename);
 1784|   122k|      break;
 1785|   122k|    }
 1786|   122k|  }
 1787|       |
 1788|   123k|  if(part->kind == MIMEKIND_MULTIPART) {
  ------------------
  |  Branch (1788:6): [True: 536, False: 122k]
  ------------------
 1789|    536|    mime = (curl_mime *)part->arg;
 1790|    536|    if(mime)
  ------------------
  |  Branch (1790:8): [True: 536, False: 0]
  ------------------
 1791|    536|      boundary = mime->boundary;
 1792|    536|  }
 1793|   122k|  else if(contenttype && !customct &&
  ------------------
  |  Branch (1793:11): [True: 0, False: 122k]
  |  Branch (1793:26): [True: 0, False: 0]
  ------------------
 1794|      0|          content_type_match(contenttype, STRCONST("text/plain")))
  ------------------
  |  | 1292|      0|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (1794:11): [True: 0, False: 0]
  ------------------
 1795|      0|    if(strategy == MIMESTRATEGY_MAIL || !part->filename)
  ------------------
  |  Branch (1795:8): [True: 0, False: 0]
  |  Branch (1795:41): [True: 0, False: 0]
  ------------------
 1796|      0|      contenttype = NULL;
 1797|       |
 1798|       |  /* Issue content-disposition header only if not already set by caller. */
 1799|   123k|  if(!search_header(part->userheaders, STRCONST("Content-Disposition"))) {
  ------------------
  |  | 1292|   123k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (1799:6): [True: 123k, False: 0]
  ------------------
 1800|   123k|    result = add_content_disposition(data, part, disposition,
 1801|   123k|                                     contenttype, strategy);
 1802|   123k|    if(result)
  ------------------
  |  Branch (1802:8): [True: 0, False: 123k]
  ------------------
 1803|      0|      return result;
 1804|   123k|  }
 1805|       |
 1806|       |  /* Issue Content-Type header. */
 1807|   123k|  if(contenttype) {
  ------------------
  |  Branch (1807:6): [True: 536, False: 122k]
  ------------------
 1808|    536|    result = add_content_type(&part->curlheaders, contenttype, boundary);
 1809|    536|    if(result)
  ------------------
  |  Branch (1809:8): [True: 0, False: 536]
  ------------------
 1810|      0|      return result;
 1811|    536|  }
 1812|       |
 1813|       |  /* Content-Transfer-Encoding header. */
 1814|   123k|  if(!search_header(part->userheaders,
  ------------------
  |  Branch (1814:6): [True: 123k, False: 0]
  ------------------
 1815|   123k|                    STRCONST("Content-Transfer-Encoding"))) {
  ------------------
  |  | 1292|   123k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 1816|   123k|    if(part->encoder)
  ------------------
  |  Branch (1816:8): [True: 0, False: 123k]
  ------------------
 1817|      0|      cte = part->encoder->name;
 1818|   123k|    else if(contenttype && strategy == MIMESTRATEGY_MAIL &&
  ------------------
  |  Branch (1818:13): [True: 536, False: 122k]
  |  Branch (1818:28): [True: 0, False: 536]
  ------------------
 1819|      0|            part->kind != MIMEKIND_MULTIPART)
  ------------------
  |  Branch (1819:13): [True: 0, False: 0]
  ------------------
 1820|      0|      cte = "8bit";
 1821|   123k|    if(cte) {
  ------------------
  |  Branch (1821:8): [True: 0, False: 123k]
  ------------------
 1822|      0|      result = Curl_mime_add_header(&part->curlheaders,
 1823|      0|                                    "Content-Transfer-Encoding: %s", cte);
 1824|      0|      if(result)
  ------------------
  |  Branch (1824:10): [True: 0, False: 0]
  ------------------
 1825|      0|        return result;
 1826|      0|    }
 1827|   123k|  }
 1828|       |
 1829|       |  /* If we were reading curl-generated headers, restart with new ones (this
 1830|       |     should not occur). */
 1831|   123k|  if(part->state.state == MIMESTATE_CURLHEADERS)
  ------------------
  |  Branch (1831:6): [True: 0, False: 123k]
  ------------------
 1832|      0|    mimesetstate(&part->state, MIMESTATE_CURLHEADERS, part->curlheaders);
 1833|       |
 1834|       |  /* Process subparts. */
 1835|   123k|  if(part->kind == MIMEKIND_MULTIPART && mime) {
  ------------------
  |  Branch (1835:6): [True: 536, False: 122k]
  |  Branch (1835:42): [True: 536, False: 0]
  ------------------
 1836|    536|    curl_mimepart *subpart;
 1837|       |
 1838|    536|    disposition = NULL;
 1839|    536|    if(content_type_match(contenttype, STRCONST("multipart/form-data")))
  ------------------
  |  | 1292|    536|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (1839:8): [True: 519, False: 17]
  ------------------
 1840|    519|      disposition = "form-data";
 1841|   123k|    for(subpart = mime->firstpart; subpart; subpart = subpart->nextpart) {
  ------------------
  |  Branch (1841:36): [True: 122k, False: 536]
  ------------------
 1842|   122k|      result = Curl_mime_prepare_headers(data, subpart, NULL,
 1843|   122k|                                         disposition, strategy);
 1844|   122k|      if(result)
  ------------------
  |  Branch (1844:10): [True: 0, False: 122k]
  ------------------
 1845|      0|        return result;
 1846|   122k|    }
 1847|    536|  }
 1848|   123k|  return result;
 1849|   123k|}
Curl_creader_set_mime:
 2141|    536|{
 2142|    536|  struct Curl_creader *r;
 2143|    536|  struct cr_mime_ctx *ctx;
 2144|    536|  CURLcode result;
 2145|       |
 2146|    536|  result = Curl_creader_create(&r, data, &cr_mime, CURL_CR_CLIENT);
 2147|    536|  if(result)
  ------------------
  |  Branch (2147:6): [True: 0, False: 536]
  ------------------
 2148|      0|    return result;
 2149|    536|  ctx = r->ctx;
 2150|    536|  ctx->part = part;
 2151|       |  /* Make sure we will read the entire mime structure. */
 2152|    536|  result = mime_rewind(ctx->part);
 2153|    536|  if(result) {
  ------------------
  |  Branch (2153:6): [True: 0, False: 536]
  ------------------
 2154|      0|    Curl_creader_free(data, r);
 2155|      0|    return result;
 2156|      0|  }
 2157|    536|  ctx->total_len = mime_size(ctx->part);
 2158|       |
 2159|    536|  return Curl_creader_set(data, r);
 2160|    536|}
mime.c:cleanup_part_content:
 1048|   127k|{
 1049|   127k|  if(part->freefunc)
  ------------------
  |  Branch (1049:6): [True: 1.07k, False: 126k]
  ------------------
 1050|  1.07k|    part->freefunc(part->arg);
 1051|       |
 1052|   127k|  part->readfunc = NULL;
 1053|   127k|  part->seekfunc = NULL;
 1054|   127k|  part->freefunc = NULL;
 1055|   127k|  part->arg = (void *)part;           /* Defaults to part itself. */
 1056|   127k|  part->data = NULL;
 1057|   127k|  part->fp = NULL;
 1058|   127k|  part->datasize = (curl_off_t)0;     /* No size yet. */
 1059|   127k|  cleanup_encoder_state(&part->encstate);
 1060|   127k|  part->kind = MIMEKIND_NONE;
 1061|   127k|  part->flags &= ~(unsigned int)MIME_FAST_READ;
  ------------------
  |  |   36|   127k|#define MIME_FAST_READ          (1 << 2)
  ------------------
 1062|   127k|  part->lastreadstatus = 1; /* Successful read status. */
 1063|   127k|  part->state.state = MIMESTATE_BEGIN;
 1064|   127k|}
mime.c:cleanup_encoder_state:
  284|   264k|{
  285|   264k|  p->pos = 0;
  286|   264k|  p->bufbeg = 0;
  287|   264k|  p->bufend = 0;
  288|   264k|}
mime.c:mime_subparts_unbind:
 1079|    643|{
 1080|    643|  curl_mime *mime = (curl_mime *)ptr;
 1081|       |
 1082|    643|  if(mime && mime->parent) {
  ------------------
  |  Branch (1082:6): [True: 643, False: 0]
  |  Branch (1082:14): [True: 633, False: 10]
  ------------------
 1083|    633|    mime->parent->freefunc = NULL;  /* Be sure we will not be called again. */
 1084|    633|    cleanup_part_content(mime->parent);  /* Avoid dangling pointer in part. */
 1085|       |    mime->parent = NULL;
 1086|    633|  }
 1087|    643|}
mime.c:mimesetstate:
  190|  1.42M|{
  191|  1.42M|  state->state = tok;
  192|  1.42M|  state->ptr = ptr;
  193|  1.42M|  state->offset = 0;
  194|  1.42M|}
mime.c:mime_mem_read:
  567|     89|{
  568|     89|  curl_mimepart *part = (curl_mimepart *)instream;
  569|     89|  size_t sz = curlx_sotouz(part->datasize - part->state.offset);
  570|     89|  (void)size;  /* Always 1 */
  571|       |
  572|     89|  if(!nitems)
  ------------------
  |  Branch (572:6): [True: 0, False: 89]
  ------------------
  573|      0|    return STOP_FILLING;
  ------------------
  |  |   50|      0|#define STOP_FILLING ((size_t)-2)
  ------------------
  574|       |
  575|     89|  if(sz > nitems)
  ------------------
  |  Branch (575:6): [True: 1, False: 88]
  ------------------
  576|      1|    sz = nitems;
  577|       |
  578|     89|  if(sz)
  ------------------
  |  Branch (578:6): [True: 89, False: 0]
  ------------------
  579|     89|    memcpy(buffer, part->data + curlx_sotouz(part->state.offset), sz);
  580|       |
  581|     89|  return sz;
  582|     89|}
mime.c:mime_mem_seek:
  585|     91|{
  586|     91|  curl_mimepart *part = (curl_mimepart *)instream;
  587|       |
  588|     91|  switch(whence) {
  ------------------
  |  Branch (588:10): [True: 0, False: 91]
  ------------------
  589|      0|  case SEEK_CUR:
  ------------------
  |  Branch (589:3): [True: 0, False: 91]
  ------------------
  590|      0|    offset += part->state.offset;
  591|      0|    break;
  592|      0|  case SEEK_END:
  ------------------
  |  Branch (592:3): [True: 0, False: 91]
  ------------------
  593|      0|    offset += part->datasize;
  594|      0|    break;
  595|     91|  }
  596|       |
  597|     91|  if(offset < 0 || offset > part->datasize)
  ------------------
  |  Branch (597:6): [True: 0, False: 91]
  |  Branch (597:20): [True: 0, False: 91]
  ------------------
  598|      0|    return CURL_SEEKFUNC_FAIL;
  ------------------
  |  |  381|      0|#define CURL_SEEKFUNC_FAIL     1 /* fail the entire transfer */
  ------------------
  599|       |
  600|     91|  part->state.offset = offset;
  601|     91|  return CURL_SEEKFUNC_OK;
  ------------------
  |  |  380|     91|#define CURL_SEEKFUNC_OK       0
  ------------------
  602|     91|}
mime.c:mime_mem_free:
  605|    972|{
  606|       |  curlx_safefree(((curl_mimepart *)ptr)->data);
  ------------------
  |  | 1327|    972|  do {                      \
  |  | 1328|    972|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|    972|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|    972|    (ptr) = NULL;           \
  |  | 1330|    972|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 972]
  |  |  ------------------
  ------------------
  607|    972|}
mime.c:mime_subparts_seek:
 1023|    744|{
 1024|    744|  curl_mime *mime = (curl_mime *)instream;
 1025|    744|  curl_mimepart *part;
 1026|    744|  int rc = CURL_SEEKFUNC_OK;
  ------------------
  |  |  380|    744|#define CURL_SEEKFUNC_OK       0
  ------------------
 1027|       |
 1028|    744|  if(whence != SEEK_SET || offset)
  ------------------
  |  Branch (1028:6): [True: 0, False: 744]
  |  Branch (1028:28): [True: 0, False: 744]
  ------------------
 1029|      0|    return CURL_SEEKFUNC_CANTSEEK;    /* Only support full rewind. */
  ------------------
  |  |  382|      0|#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking cannot be done, so
  ------------------
 1030|       |
 1031|    744|  if(mime->state.state == MIMESTATE_BEGIN)
  ------------------
  |  Branch (1031:6): [True: 633, False: 111]
  ------------------
 1032|    633|    return CURL_SEEKFUNC_OK;           /* Already rewound. */
  ------------------
  |  |  380|    633|#define CURL_SEEKFUNC_OK       0
  ------------------
 1033|       |
 1034|  18.4k|  for(part = mime->firstpart; part; part = part->nextpart) {
  ------------------
  |  Branch (1034:31): [True: 18.3k, False: 111]
  ------------------
 1035|  18.3k|    int res = mime_part_rewind(part);
 1036|  18.3k|    if(res != CURL_SEEKFUNC_OK)
  ------------------
  |  |  380|  18.3k|#define CURL_SEEKFUNC_OK       0
  ------------------
  |  Branch (1036:8): [True: 16.1k, False: 2.11k]
  ------------------
 1037|  16.1k|      rc = res;
 1038|  18.3k|  }
 1039|       |
 1040|    111|  if(rc == CURL_SEEKFUNC_OK)
  ------------------
  |  |  380|    111|#define CURL_SEEKFUNC_OK       0
  ------------------
  |  Branch (1040:6): [True: 51, False: 60]
  ------------------
 1041|     51|    mimesetstate(&mime->state, MIMESTATE_BEGIN, NULL);
 1042|       |
 1043|    111|  return rc;
 1044|    744|}
mime.c:mime_part_rewind:
  989|  18.9k|{
  990|  18.9k|  int res = CURL_SEEKFUNC_OK;
  ------------------
  |  |  380|  18.9k|#define CURL_SEEKFUNC_OK       0
  ------------------
  991|  18.9k|  enum mimestate targetstate = MIMESTATE_BEGIN;
  992|       |
  993|  18.9k|  if(part->flags & MIME_BODY_ONLY)
  ------------------
  |  |   35|  18.9k|#define MIME_BODY_ONLY          (1 << 1)
  ------------------
  |  Branch (993:6): [True: 645, False: 18.3k]
  ------------------
  994|    645|    targetstate = MIMESTATE_BODY;
  995|  18.9k|  cleanup_encoder_state(&part->encstate);
  996|  18.9k|  if(part->state.state > targetstate) {
  ------------------
  |  Branch (996:6): [True: 16.3k, False: 2.55k]
  ------------------
  997|  16.3k|    res = CURL_SEEKFUNC_CANTSEEK;
  ------------------
  |  |  382|  16.3k|#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking cannot be done, so
  ------------------
  998|  16.3k|    if(part->seekfunc) {
  ------------------
  |  Branch (998:8): [True: 202, False: 16.1k]
  ------------------
  999|    202|      res = part->seekfunc(part->arg, (curl_off_t)0, SEEK_SET);
 1000|    202|      switch(res) {
 1001|    142|      case CURL_SEEKFUNC_OK:
  ------------------
  |  |  380|    142|#define CURL_SEEKFUNC_OK       0
  ------------------
  |  Branch (1001:7): [True: 142, False: 60]
  ------------------
 1002|    142|      case CURL_SEEKFUNC_FAIL:
  ------------------
  |  |  381|    142|#define CURL_SEEKFUNC_FAIL     1 /* fail the entire transfer */
  ------------------
  |  Branch (1002:7): [True: 0, False: 202]
  ------------------
 1003|    202|      case CURL_SEEKFUNC_CANTSEEK:
  ------------------
  |  |  382|    202|#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking cannot be done, so
  ------------------
  |  Branch (1003:7): [True: 60, False: 142]
  ------------------
 1004|    202|        break;
 1005|      0|      case -1:    /* For fseek() error. */
  ------------------
  |  Branch (1005:7): [True: 0, False: 202]
  ------------------
 1006|      0|        res = CURL_SEEKFUNC_CANTSEEK;
  ------------------
  |  |  382|      0|#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking cannot be done, so
  ------------------
 1007|      0|        break;
 1008|      0|      default:
  ------------------
  |  Branch (1008:7): [True: 0, False: 202]
  ------------------
 1009|      0|        res = CURL_SEEKFUNC_FAIL;
  ------------------
  |  |  381|      0|#define CURL_SEEKFUNC_FAIL     1 /* fail the entire transfer */
  ------------------
 1010|      0|        break;
 1011|    202|      }
 1012|    202|    }
 1013|  16.3k|  }
 1014|       |
 1015|  18.9k|  if(res == CURL_SEEKFUNC_OK)
  ------------------
  |  |  380|  18.9k|#define CURL_SEEKFUNC_OK       0
  ------------------
  |  Branch (1015:6): [True: 2.69k, False: 16.2k]
  ------------------
 1016|  2.69k|    mimesetstate(&part->state, targetstate, NULL);
 1017|       |
 1018|  18.9k|  part->lastreadstatus = 1; /* Successful read status. */
 1019|  18.9k|  return res;
 1020|  18.9k|}
mime.c:mime_subparts_free:
 1067|    106|{
 1068|    106|  curl_mime *mime = (curl_mime *)ptr;
 1069|       |
 1070|    106|  if(mime && mime->parent) {
  ------------------
  |  Branch (1070:6): [True: 106, False: 0]
  |  Branch (1070:14): [True: 106, False: 0]
  ------------------
 1071|       |    mime->parent->freefunc = NULL;  /* Be sure we will not be called again. */
 1072|    106|    cleanup_part_content(mime->parent);  /* Avoid dangling pointer in part. */
 1073|    106|  }
 1074|    106|  curl_mime_free(mime);
 1075|    106|}
mime.c:readback_part:
  831|   234k|{
  832|   234k|  size_t cursize = 0;
  833|       |
  834|   234k|  if(++call_depth > MAX_MIME_LEVELS)
  ------------------
  |  |   47|   234k|#define MAX_MIME_LEVELS 40 /* avoid deep nesting */
  ------------------
  |  Branch (834:6): [True: 0, False: 234k]
  ------------------
  835|      0|    return READ_ERROR;
  ------------------
  |  |   49|      0|#define READ_ERROR   ((size_t)-1)
  ------------------
  836|       |
  837|       |  /* Readback from part. */
  838|  1.28M|  while(bufsize) {
  ------------------
  |  Branch (838:9): [True: 1.28M, False: 692]
  ------------------
  839|  1.28M|    size_t sz = 0;
  840|  1.28M|    struct curl_slist *hdr = (struct curl_slist *)part->state.ptr;
  841|  1.28M|    switch(part->state.state) {
  842|   116k|    case MIMESTATE_BEGIN:
  ------------------
  |  Branch (842:5): [True: 116k, False: 1.16M]
  ------------------
  843|   116k|      mimesetstate(&part->state,
  844|   116k|                   (part->flags & MIME_BODY_ONLY) ?
  ------------------
  |  |   35|   116k|#define MIME_BODY_ONLY          (1 << 1)
  ------------------
  |  Branch (844:20): [True: 0, False: 116k]
  ------------------
  845|   116k|                   MIMESTATE_BODY : MIMESTATE_CURLHEADERS,
  846|   116k|                   part->curlheaders);
  847|   116k|      break;
  848|   116k|    case MIMESTATE_USERHEADERS:
  ------------------
  |  Branch (848:5): [True: 116k, False: 1.16M]
  ------------------
  849|   116k|      if(!hdr) {
  ------------------
  |  Branch (849:10): [True: 116k, False: 0]
  ------------------
  850|   116k|        mimesetstate(&part->state, MIMESTATE_EOH, NULL);
  851|   116k|        break;
  852|   116k|      }
  853|      0|      if(match_header(hdr, "Content-Type", 12)) {
  ------------------
  |  Branch (853:10): [True: 0, False: 0]
  ------------------
  854|      0|        mimesetstate(&part->state, MIMESTATE_USERHEADERS, hdr->next);
  855|      0|        break;
  856|      0|      }
  857|      0|      FALLTHROUGH();
  ------------------
  |  |  821|      0|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  858|   465k|    case MIMESTATE_CURLHEADERS:
  ------------------
  |  Branch (858:5): [True: 465k, False: 817k]
  ------------------
  859|   465k|      if(!hdr)
  ------------------
  |  Branch (859:10): [True: 116k, False: 348k]
  ------------------
  860|   116k|        mimesetstate(&part->state, MIMESTATE_USERHEADERS, part->userheaders);
  861|   348k|      else {
  862|   348k|        sz = readback_bytes(&part->state, buffer, bufsize,
  863|   348k|                            hdr->data, strlen(hdr->data), STRCONST("\r\n"));
  ------------------
  |  | 1292|   348k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  864|   348k|        if(!sz)
  ------------------
  |  Branch (864:12): [True: 116k, False: 232k]
  ------------------
  865|   116k|          mimesetstate(&part->state, part->state.state, hdr->next);
  866|   348k|      }
  867|   465k|      break;
  868|   233k|    case MIMESTATE_EOH:
  ------------------
  |  Branch (868:5): [True: 233k, False: 1.05M]
  ------------------
  869|   233k|      sz = readback_bytes(&part->state, buffer, bufsize, STRCONST("\r\n"),
  ------------------
  |  | 1292|   233k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  870|   233k|                          STRCONST(""));
  ------------------
  |  | 1292|   233k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  871|   233k|      if(!sz)
  ------------------
  |  Branch (871:10): [True: 116k, False: 116k]
  ------------------
  872|   116k|        mimesetstate(&part->state, MIMESTATE_BODY, NULL);
  873|   233k|      break;
  874|   117k|    case MIMESTATE_BODY:
  ------------------
  |  Branch (874:5): [True: 117k, False: 1.16M]
  ------------------
  875|   117k|      cleanup_encoder_state(&part->encstate);
  876|   117k|      mimesetstate(&part->state, MIMESTATE_CONTENT, NULL);
  877|   117k|      break;
  878|   117k|    case MIMESTATE_CONTENT:
  ------------------
  |  Branch (878:5): [True: 117k, False: 1.16M]
  ------------------
  879|   117k|      if(part->encoder)
  ------------------
  |  Branch (879:10): [True: 0, False: 117k]
  ------------------
  880|      0|        sz = read_encoded_part_content(part, buffer, bufsize, hasread,
  881|      0|                                       call_depth);
  882|   117k|      else
  883|   117k|        sz = read_part_content(part, buffer, bufsize, hasread, call_depth);
  884|   117k|      switch(sz) {
  ------------------
  |  Branch (884:14): [True: 116k, False: 716]
  ------------------
  885|   116k|      case 0:
  ------------------
  |  Branch (885:7): [True: 116k, False: 716]
  ------------------
  886|   116k|        mimesetstate(&part->state, MIMESTATE_END, NULL);
  887|       |        /* Try sparing open file descriptors. */
  888|   116k|        if(part->kind == MIMEKIND_FILE && part->fp) {
  ------------------
  |  Branch (888:12): [True: 0, False: 116k]
  |  Branch (888:43): [True: 0, False: 0]
  ------------------
  889|      0|          curlx_fclose(part->fp);
  ------------------
  |  |   79|      0|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
  890|      0|          part->fp = NULL;
  891|      0|        }
  892|   116k|        FALLTHROUGH();
  ------------------
  |  |  821|   116k|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  893|   116k|      case CURL_READFUNC_ABORT:
  ------------------
  |  |  390|   116k|#define CURL_READFUNC_ABORT 0x10000000
  ------------------
  |  Branch (893:7): [True: 0, False: 117k]
  ------------------
  894|   116k|      case CURL_READFUNC_PAUSE:
  ------------------
  |  |  393|   116k|#define CURL_READFUNC_PAUSE 0x10000001
  ------------------
  |  Branch (894:7): [True: 0, False: 117k]
  ------------------
  895|   116k|      case READ_ERROR:
  ------------------
  |  |   49|   116k|#define READ_ERROR   ((size_t)-1)
  ------------------
  |  Branch (895:7): [True: 0, False: 117k]
  ------------------
  896|   116k|      case STOP_FILLING:
  ------------------
  |  |   50|   116k|#define STOP_FILLING ((size_t)-2)
  ------------------
  |  Branch (896:7): [True: 0, False: 117k]
  ------------------
  897|   116k|        return cursize ? cursize : sz;
  ------------------
  |  Branch (897:16): [True: 116k, False: 2]
  ------------------
  898|   117k|      }
  899|    716|      break;
  900|   116k|    case MIMESTATE_END:
  ------------------
  |  Branch (900:5): [True: 116k, False: 1.16M]
  ------------------
  901|   116k|      return cursize;
  902|      0|    default:
  ------------------
  |  Branch (902:5): [True: 0, False: 1.28M]
  ------------------
  903|      0|      break;    /* Other values not in part state. */
  904|  1.28M|    }
  905|       |
  906|       |    /* Bump buffer and counters according to read size. */
  907|  1.05M|    cursize += sz;
  908|  1.05M|    buffer += sz;
  909|  1.05M|    bufsize -= sz;
  910|  1.05M|  }
  911|       |
  912|    692|  return cursize;
  913|   234k|}
mime.c:match_header:
  246|  8.87k|{
  247|  8.87k|  char *value = NULL;
  248|       |
  249|  8.87k|  if(curl_strnequal(hdr->data, lbl, len) && hdr->data[len] == ':')
  ------------------
  |  Branch (249:6): [True: 17, False: 8.85k]
  |  Branch (249:45): [True: 14, False: 3]
  ------------------
  250|     72|    for(value = hdr->data + len + 1; *value == ' '; value++)
  ------------------
  |  Branch (250:38): [True: 58, False: 14]
  ------------------
  251|     58|      ;
  252|  8.87k|  return value;
  253|  8.87k|}
mime.c:readback_bytes:
  668|  1.16M|{
  669|  1.16M|  size_t sz;
  670|  1.16M|  size_t offset = curlx_sotouz(state->offset);
  671|       |
  672|  1.16M|  if(numbytes > offset) {
  ------------------
  |  Branch (672:6): [True: 467k, False: 700k]
  ------------------
  673|   467k|    sz = numbytes - offset;
  674|   467k|    bytes += offset;
  675|   467k|  }
  676|   700k|  else {
  677|   700k|    sz = offset - numbytes;
  678|   700k|    if(sz >= traillen)
  ------------------
  |  Branch (678:8): [True: 466k, False: 233k]
  ------------------
  679|   466k|      return 0;
  680|   233k|    bytes = trail + sz;
  681|   233k|    sz = traillen - sz;
  682|   233k|  }
  683|       |
  684|   700k|  if(sz > bufsize)
  ------------------
  |  Branch (684:6): [True: 115, False: 700k]
  ------------------
  685|    115|    sz = bufsize;
  686|       |
  687|   700k|  memcpy(buffer, bytes, sz);
  688|   700k|  state->offset += sz;
  689|   700k|  return sz;
  690|  1.16M|}
mime.c:read_part_content:
  697|   117k|{
  698|   117k|  size_t sz = 0;
  699|       |
  700|   117k|  if(++call_depth > MAX_MIME_LEVELS)
  ------------------
  |  |   47|   117k|#define MAX_MIME_LEVELS 40 /* avoid deep nesting */
  ------------------
  |  Branch (700:6): [True: 0, False: 117k]
  ------------------
  701|      0|    return READ_ERROR;
  ------------------
  |  |   49|      0|#define READ_ERROR   ((size_t)-1)
  ------------------
  702|       |
  703|   117k|  switch(part->lastreadstatus) {
  704|      0|  case 0:
  ------------------
  |  Branch (704:3): [True: 0, False: 117k]
  ------------------
  705|      0|  case CURL_READFUNC_ABORT:
  ------------------
  |  |  390|      0|#define CURL_READFUNC_ABORT 0x10000000
  ------------------
  |  Branch (705:3): [True: 0, False: 117k]
  ------------------
  706|      0|  case CURL_READFUNC_PAUSE:
  ------------------
  |  |  393|      0|#define CURL_READFUNC_PAUSE 0x10000001
  ------------------
  |  Branch (706:3): [True: 0, False: 117k]
  ------------------
  707|      0|  case READ_ERROR:
  ------------------
  |  |   49|      0|#define READ_ERROR   ((size_t)-1)
  ------------------
  |  Branch (707:3): [True: 0, False: 117k]
  ------------------
  708|      0|    return part->lastreadstatus;
  709|   117k|  default:
  ------------------
  |  Branch (709:3): [True: 117k, False: 0]
  ------------------
  710|   117k|    break;
  711|   117k|  }
  712|       |
  713|       |  /* If we can determine we are at end of part data, spare a read. */
  714|   117k|  if(part->datasize != (curl_off_t)-1 &&
  ------------------
  |  Branch (714:6): [True: 117k, False: 0]
  ------------------
  715|   117k|     part->state.offset >= part->datasize) {
  ------------------
  |  Branch (715:6): [True: 116k, False: 716]
  ------------------
  716|       |    /* sz is already zero. */
  717|   116k|  }
  718|    716|  else {
  719|    716|    switch(part->kind) {
  720|    627|    case MIMEKIND_MULTIPART:
  ------------------
  |  Branch (720:5): [True: 627, False: 89]
  ------------------
  721|       |      /*
  722|       |       * Cannot be processed as other kinds since read function requires
  723|       |       * an additional parameter and is highly recursive.
  724|       |       */
  725|    627|      sz = mime_subparts_read(buffer, 1, bufsize, part->arg, hasread,
  726|    627|                              call_depth);
  727|    627|      break;
  728|      0|    case MIMEKIND_FILE:
  ------------------
  |  Branch (728:5): [True: 0, False: 716]
  ------------------
  729|      0|      if(part->fp && feof(part->fp))
  ------------------
  |  Branch (729:10): [True: 0, False: 0]
  |  Branch (729:22): [True: 0, False: 0]
  ------------------
  730|      0|        break;  /* At EOF. */
  731|      0|      FALLTHROUGH();
  ------------------
  |  |  821|      0|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  732|     89|    default:
  ------------------
  |  Branch (732:5): [True: 89, False: 627]
  ------------------
  733|     89|      if(part->readfunc) {
  ------------------
  |  Branch (733:10): [True: 89, False: 0]
  ------------------
  734|     89|        if(!(part->flags & MIME_FAST_READ)) {
  ------------------
  |  |   36|     89|#define MIME_FAST_READ          (1 << 2)
  ------------------
  |  Branch (734:12): [True: 0, False: 89]
  ------------------
  735|      0|          if(*hasread)
  ------------------
  |  Branch (735:14): [True: 0, False: 0]
  ------------------
  736|      0|            return STOP_FILLING;
  ------------------
  |  |   50|      0|#define STOP_FILLING ((size_t)-2)
  ------------------
  737|      0|          *hasread = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  738|      0|        }
  739|     89|        sz = part->readfunc(buffer, 1, bufsize, part->arg);
  740|     89|      }
  741|     89|      break;
  742|    716|    }
  743|    716|  }
  744|       |
  745|   117k|  switch(sz) {
  746|      0|  case STOP_FILLING:
  ------------------
  |  |   50|      0|#define STOP_FILLING ((size_t)-2)
  ------------------
  |  Branch (746:3): [True: 0, False: 117k]
  ------------------
  747|      0|    break;
  748|   116k|  case 0:
  ------------------
  |  Branch (748:3): [True: 116k, False: 716]
  ------------------
  749|   116k|  case CURL_READFUNC_ABORT:
  ------------------
  |  |  390|   116k|#define CURL_READFUNC_ABORT 0x10000000
  ------------------
  |  Branch (749:3): [True: 0, False: 117k]
  ------------------
  750|   116k|  case CURL_READFUNC_PAUSE:
  ------------------
  |  |  393|   116k|#define CURL_READFUNC_PAUSE 0x10000001
  ------------------
  |  Branch (750:3): [True: 0, False: 117k]
  ------------------
  751|   116k|  case READ_ERROR:
  ------------------
  |  |   49|   116k|#define READ_ERROR   ((size_t)-1)
  ------------------
  |  Branch (751:3): [True: 0, False: 117k]
  ------------------
  752|   116k|    part->lastreadstatus = sz;
  753|   116k|    break;
  754|    716|  default:
  ------------------
  |  Branch (754:3): [True: 716, False: 116k]
  ------------------
  755|    716|    part->state.offset += sz;
  756|    716|    part->lastreadstatus = sz;
  757|    716|    break;
  758|   117k|  }
  759|       |
  760|   117k|  return sz;
  761|   117k|}
mime.c:mime_subparts_read:
  919|    627|{
  920|    627|  curl_mime *mime = (curl_mime *)instream;
  921|    627|  size_t cursize = 0;
  922|    627|  (void)size;  /* Always 1 */
  923|       |
  924|    627|  if(++call_depth > MAX_MIME_LEVELS)
  ------------------
  |  |   47|    627|#define MAX_MIME_LEVELS 40 /* avoid deep nesting */
  ------------------
  |  Branch (924:6): [True: 0, False: 627]
  ------------------
  925|      0|    return READ_ERROR;
  ------------------
  |  |   49|      0|#define READ_ERROR   ((size_t)-1)
  ------------------
  926|       |
  927|   820k|  while(nitems) {
  ------------------
  |  Branch (927:9): [True: 819k, False: 625]
  ------------------
  928|   819k|    size_t sz = 0;
  929|   819k|    curl_mimepart *part = mime->state.ptr;
  930|   819k|    switch(mime->state.state) {
  931|    536|    case MIMESTATE_BEGIN:
  ------------------
  |  Branch (931:5): [True: 536, False: 818k]
  ------------------
  932|    536|    case MIMESTATE_BODY:
  ------------------
  |  Branch (932:5): [True: 0, False: 819k]
  ------------------
  933|    536|      mimesetstate(&mime->state, MIMESTATE_BOUNDARY1, mime->firstpart);
  934|       |      /* The first boundary always follows the header termination empty line,
  935|       |         so is always preceded by a CRLF. We can then spare 2 characters
  936|       |         by skipping the leading CRLF in boundary. */
  937|    536|      mime->state.offset += 2;
  938|    536|      break;
  939|   234k|    case MIMESTATE_BOUNDARY1:
  ------------------
  |  Branch (939:5): [True: 234k, False: 585k]
  ------------------
  940|   234k|      sz = readback_bytes(&mime->state, buffer, nitems, STRCONST("\r\n--"),
  ------------------
  |  | 1292|   234k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  941|   234k|                          STRCONST(""));
  ------------------
  |  | 1292|   234k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  942|   234k|      if(!sz)
  ------------------
  |  Branch (942:10): [True: 117k, False: 117k]
  ------------------
  943|   117k|        mimesetstate(&mime->state, MIMESTATE_BOUNDARY2, part);
  944|   234k|      break;
  945|   351k|    case MIMESTATE_BOUNDARY2:
  ------------------
  |  Branch (945:5): [True: 351k, False: 468k]
  ------------------
  946|   351k|      if(part)
  ------------------
  |  Branch (946:10): [True: 350k, False: 1.01k]
  ------------------
  947|   350k|        sz = readback_bytes(&mime->state, buffer, nitems, mime->boundary,
  948|   350k|                            MIME_BOUNDARY_LEN, STRCONST("\r\n"));
  ------------------
  |  |   97|   350k|#define MIME_BOUNDARY_LEN (MIME_BOUNDARY_DASHES + MIME_RAND_BOUNDARY_CHARS)
  |  |  ------------------
  |  |  |  |   28|   350k|#define MIME_BOUNDARY_DASHES            24  /* leading boundary dashes */
  |  |  ------------------
  |  |               #define MIME_BOUNDARY_LEN (MIME_BOUNDARY_DASHES + MIME_RAND_BOUNDARY_CHARS)
  |  |  ------------------
  |  |  |  |   29|   350k|#define MIME_RAND_BOUNDARY_CHARS        22  /* Nb. of random boundary chars. */
  |  |  ------------------
  ------------------
                                          MIME_BOUNDARY_LEN, STRCONST("\r\n"));
  ------------------
  |  | 1292|   350k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  949|  1.01k|      else
  950|  1.01k|        sz = readback_bytes(&mime->state, buffer, nitems, mime->boundary,
  951|  1.01k|                            MIME_BOUNDARY_LEN, STRCONST("--\r\n"));
  ------------------
  |  |   97|  1.01k|#define MIME_BOUNDARY_LEN (MIME_BOUNDARY_DASHES + MIME_RAND_BOUNDARY_CHARS)
  |  |  ------------------
  |  |  |  |   28|  1.01k|#define MIME_BOUNDARY_DASHES            24  /* leading boundary dashes */
  |  |  ------------------
  |  |               #define MIME_BOUNDARY_LEN (MIME_BOUNDARY_DASHES + MIME_RAND_BOUNDARY_CHARS)
  |  |  ------------------
  |  |  |  |   29|  1.01k|#define MIME_RAND_BOUNDARY_CHARS        22  /* Nb. of random boundary chars. */
  |  |  ------------------
  ------------------
                                          MIME_BOUNDARY_LEN, STRCONST("--\r\n"));
  ------------------
  |  | 1292|  1.01k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  952|   351k|      if(!sz) {
  ------------------
  |  Branch (952:10): [True: 116k, False: 234k]
  ------------------
  953|   116k|        mimesetstate(&mime->state, MIMESTATE_CONTENT, part);
  954|   116k|      }
  955|   351k|      break;
  956|   233k|    case MIMESTATE_CONTENT:
  ------------------
  |  Branch (956:5): [True: 233k, False: 586k]
  ------------------
  957|   233k|      if(!part) {
  ------------------
  |  Branch (957:10): [True: 2, False: 233k]
  ------------------
  958|      2|        mimesetstate(&mime->state, MIMESTATE_END, NULL);
  959|      2|        break;
  960|      2|      }
  961|   233k|      sz = readback_part(part, buffer, nitems, hasread, call_depth);
  962|   233k|      switch(sz) {
  ------------------
  |  Branch (962:14): [True: 116k, False: 116k]
  ------------------
  963|      0|      case CURL_READFUNC_ABORT:
  ------------------
  |  |  390|      0|#define CURL_READFUNC_ABORT 0x10000000
  ------------------
  |  Branch (963:7): [True: 0, False: 233k]
  ------------------
  964|      0|      case CURL_READFUNC_PAUSE:
  ------------------
  |  |  393|      0|#define CURL_READFUNC_PAUSE 0x10000001
  ------------------
  |  Branch (964:7): [True: 0, False: 233k]
  ------------------
  965|      0|      case READ_ERROR:
  ------------------
  |  |   49|      0|#define READ_ERROR   ((size_t)-1)
  ------------------
  |  Branch (965:7): [True: 0, False: 233k]
  ------------------
  966|      0|      case STOP_FILLING:
  ------------------
  |  |   50|      0|#define STOP_FILLING ((size_t)-2)
  ------------------
  |  Branch (966:7): [True: 0, False: 233k]
  ------------------
  967|      0|        return cursize ? cursize : sz;
  ------------------
  |  Branch (967:16): [True: 0, False: 0]
  ------------------
  968|   116k|      case 0:
  ------------------
  |  Branch (968:7): [True: 116k, False: 116k]
  ------------------
  969|   116k|        mimesetstate(&mime->state, MIMESTATE_BOUNDARY1, part->nextpart);
  970|   116k|        break;
  971|   233k|      }
  972|   233k|      break;
  973|   233k|    case MIMESTATE_END:
  ------------------
  |  Branch (973:5): [True: 2, False: 819k]
  ------------------
  974|      2|      return cursize;
  975|      0|    default:
  ------------------
  |  Branch (975:5): [True: 0, False: 819k]
  ------------------
  976|      0|      break;    /* other values not used in mime state. */
  977|   819k|    }
  978|       |
  979|       |    /* Bump buffer and counters according to read size. */
  980|   819k|    cursize += sz;
  981|   819k|    buffer += sz;
  982|   819k|    nitems -= sz;
  983|   819k|  }
  984|       |
  985|    625|  return cursize;
  986|    627|}
mime.c:search_header:
  258|   369k|{
  259|   369k|  char *value = NULL;
  260|       |
  261|   378k|  for(; !value && hdrlist; hdrlist = hdrlist->next)
  ------------------
  |  Branch (261:9): [True: 378k, False: 14]
  |  Branch (261:19): [True: 8.87k, False: 369k]
  ------------------
  262|  8.87k|    value = match_header(hdrlist, hdr, len);
  263|       |
  264|   369k|  return value;
  265|   369k|}
mime.c:content_type_match:
 1682|    536|{
 1683|    536|  if(contenttype && curl_strnequal(contenttype, target, len))
  ------------------
  |  Branch (1683:6): [True: 536, False: 0]
  |  Branch (1683:21): [True: 519, False: 17]
  ------------------
 1684|    519|    switch(contenttype[len]) {
  ------------------
  |  Branch (1684:12): [True: 519, False: 0]
  ------------------
 1685|    519|    case '\0':
  ------------------
  |  Branch (1685:5): [True: 519, False: 0]
  ------------------
 1686|    519|    case '\t':
  ------------------
  |  Branch (1686:5): [True: 0, False: 519]
  ------------------
 1687|    519|    case '\r':
  ------------------
  |  Branch (1687:5): [True: 0, False: 519]
  ------------------
 1688|    519|    case '\n':
  ------------------
  |  Branch (1688:5): [True: 0, False: 519]
  ------------------
 1689|    519|    case ' ':
  ------------------
  |  Branch (1689:5): [True: 0, False: 519]
  ------------------
 1690|    519|    case ';':
  ------------------
  |  Branch (1690:5): [True: 0, False: 519]
  ------------------
 1691|    519|      return TRUE;
  ------------------
  |  | 1055|    519|#define TRUE true
  ------------------
 1692|    519|    }
 1693|     17|  return FALSE;
  ------------------
  |  | 1058|     17|#define FALSE false
  ------------------
 1694|    536|}
mime.c:add_content_disposition:
 1701|   123k|{
 1702|   123k|  if(!disposition)
  ------------------
  |  Branch (1702:6): [True: 889, False: 122k]
  ------------------
 1703|    889|    if(part->filename || part->name ||
  ------------------
  |  Branch (1703:8): [True: 0, False: 889]
  |  Branch (1703:26): [True: 4, False: 885]
  ------------------
 1704|    885|       (contenttype && !curl_strnequal(contenttype, "multipart/", 10)))
  ------------------
  |  Branch (1704:9): [True: 536, False: 349]
  |  Branch (1704:24): [True: 17, False: 519]
  ------------------
 1705|     21|      disposition = DISPOSITION_DEFAULT;
  ------------------
  |  |   40|     21|#define DISPOSITION_DEFAULT             "attachment"
  ------------------
 1706|   123k|  if(disposition && curl_strequal(disposition, "attachment") &&
  ------------------
  |  Branch (1706:6): [True: 122k, False: 868]
  |  Branch (1706:21): [True: 21, False: 122k]
  ------------------
 1707|     21|     !part->name && !part->filename)
  ------------------
  |  Branch (1707:6): [True: 17, False: 4]
  |  Branch (1707:21): [True: 17, False: 0]
  ------------------
 1708|     17|    disposition = NULL;
 1709|   123k|  if(disposition) {
  ------------------
  |  Branch (1709:6): [True: 122k, False: 885]
  ------------------
 1710|   122k|    CURLcode result = CURLE_OK;
 1711|   122k|    char *name = NULL;
 1712|   122k|    char *filename = NULL;
 1713|       |
 1714|   122k|    if(part->name) {
  ------------------
  |  Branch (1714:8): [True: 246, False: 122k]
  ------------------
 1715|    246|      name = escape_string(data, part->name, strategy);
 1716|    246|      if(!name)
  ------------------
  |  Branch (1716:10): [True: 0, False: 246]
  ------------------
 1717|      0|        return CURLE_OUT_OF_MEMORY;
 1718|    246|    }
 1719|   122k|    if(part->filename) {
  ------------------
  |  Branch (1719:8): [True: 0, False: 122k]
  ------------------
 1720|      0|      filename = escape_string(data, part->filename, strategy);
 1721|      0|      if(!filename)
  ------------------
  |  Branch (1721:10): [True: 0, False: 0]
  ------------------
 1722|      0|        result = CURLE_OUT_OF_MEMORY;
 1723|      0|    }
 1724|   122k|    if(!result)
  ------------------
  |  Branch (1724:8): [True: 122k, False: 0]
  ------------------
 1725|   122k|      result = Curl_mime_add_header(&part->curlheaders,
 1726|   122k|                                    "Content-Disposition: %s%s%s%s%s%s%s",
 1727|   122k|                                    disposition,
 1728|   122k|                                    name ? "; name=\"" : "",
  ------------------
  |  Branch (1728:37): [True: 246, False: 122k]
  ------------------
 1729|   122k|                                    name ? name : "",
  ------------------
  |  Branch (1729:37): [True: 246, False: 122k]
  ------------------
 1730|   122k|                                    name ? "\"" : "",
  ------------------
  |  Branch (1730:37): [True: 246, False: 122k]
  ------------------
 1731|   122k|                                    filename ? "; filename=\"" : "",
  ------------------
  |  Branch (1731:37): [True: 0, False: 122k]
  ------------------
 1732|   122k|                                    filename ? filename : "",
  ------------------
  |  Branch (1732:37): [True: 0, False: 122k]
  ------------------
 1733|   122k|                                    filename ? "\"" : "");
  ------------------
  |  Branch (1733:37): [True: 0, False: 122k]
  ------------------
 1734|   122k|    curlx_safefree(name);
  ------------------
  |  | 1327|   122k|  do {                      \
  |  | 1328|   122k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|   122k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|   122k|    (ptr) = NULL;           \
  |  | 1330|   122k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 122k]
  |  |  ------------------
  ------------------
 1735|   122k|    curlx_safefree(filename);
  ------------------
  |  | 1327|   122k|  do {                      \
  |  | 1328|   122k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|   122k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|   122k|    (ptr) = NULL;           \
  |  | 1330|   122k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 122k]
  |  |  ------------------
  ------------------
 1736|   122k|    if(result)
  ------------------
  |  Branch (1736:8): [True: 0, False: 122k]
  ------------------
 1737|      0|      return result;
 1738|   122k|  }
 1739|   123k|  return CURLE_OK;
 1740|   123k|}
mime.c:escape_string:
  199|    246|{
  200|    246|  CURLcode result;
  201|    246|  struct dynbuf db;
  202|    246|  const char * const *table;
  203|    246|  const char * const *p;
  204|       |  /* replace first character by rest of string. */
  205|    246|  static const char * const mimetable[] = {
  206|    246|    "\\\\\\",
  207|    246|    "\"\\\"",
  208|    246|    NULL
  209|    246|  };
  210|       |  /* WHATWG HTML living standard 4.10.21.8 2 specifies:
  211|       |     For field names and filenames for file fields, the result of the
  212|       |     encoding in the previous bullet point must be escaped by replacing
  213|       |     any 0x0A (LF) bytes with the byte sequence `%0A`, 0x0D (CR) with `%0D`
  214|       |     and 0x22 (") with `%22`.
  215|       |     The user agent must not perform any other escapes. */
  216|    246|  static const char * const formtable[] = {
  217|    246|    "\"%22",
  218|    246|    "\r%0D",
  219|    246|    "\n%0A",
  220|    246|    NULL
  221|    246|  };
  222|       |
  223|    246|  table = formtable;
  224|       |  /* data can be NULL when this function is called indirectly from
  225|       |     curl_formget(). */
  226|    246|  if(strategy == MIMESTRATEGY_MAIL || (data && (data->set.mime_formescape)))
  ------------------
  |  Branch (226:6): [True: 0, False: 246]
  |  Branch (226:40): [True: 246, False: 0]
  |  Branch (226:48): [True: 10, False: 236]
  ------------------
  227|     10|    table = mimetable;
  228|       |
  229|    246|  curlx_dyn_init(&db, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|    246|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  230|       |
  231|    860|  for(result = curlx_dyn_addn(&db, STRCONST("")); !result && *src; src++) {
  ------------------
  |  | 1292|    246|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
  |  Branch (231:51): [True: 860, False: 0]
  |  Branch (231:62): [True: 614, False: 246]
  ------------------
  232|  2.39k|    for(p = table; *p && **p != *src; p++)
  ------------------
  |  Branch (232:20): [True: 1.81k, False: 582]
  |  Branch (232:26): [True: 1.78k, False: 32]
  ------------------
  233|  1.78k|      ;
  234|       |
  235|    614|    if(*p)
  ------------------
  |  Branch (235:8): [True: 32, False: 582]
  ------------------
  236|     32|      result = curlx_dyn_add(&db, *p + 1);
  237|    582|    else
  238|    582|      result = curlx_dyn_addn(&db, src, 1);
  239|    614|  }
  240|       |
  241|    246|  return curlx_dyn_ptr(&db);
  242|    246|}
mime.c:add_content_type:
 1636|    536|{
 1637|    536|  return Curl_mime_add_header(slp, "Content-Type: %s%s%s", type,
 1638|    536|                              boundary ? "; boundary=" : "",
  ------------------
  |  Branch (1638:31): [True: 536, False: 0]
  ------------------
 1639|    536|                              boundary ? boundary : "");
  ------------------
  |  Branch (1639:31): [True: 536, False: 0]
  ------------------
 1640|    536|}
mime.c:cr_mime_init:
 1883|    536|{
 1884|    536|  struct cr_mime_ctx *ctx = reader->ctx;
 1885|    536|  (void)data;
 1886|    536|  ctx->total_len = -1;
 1887|    536|  ctx->read_len = 0;
 1888|    536|  Curl_bufq_init2(&ctx->tmpbuf, 1024, 1, BUFQ_OPT_NO_SPARES);
  ------------------
  |  |  115|    536|#define BUFQ_OPT_NO_SPARES   (1 << 1)
  ------------------
 1889|    536|  return CURLE_OK;
 1890|    536|}
mime.c:cr_mime_read:
 1905|    627|{
 1906|    627|  struct cr_mime_ctx *ctx = reader->ctx;
 1907|    627|  CURLcode result = CURLE_OK;
 1908|    627|  size_t nread;
 1909|    627|  char tmp[256];
 1910|       |
 1911|       |  /* Once we have errored, we will return the same error forever */
 1912|    627|  if(ctx->errored) {
  ------------------
  |  Branch (1912:6): [True: 0, False: 627]
  ------------------
 1913|      0|    CURL_TRC_READ(data, "cr_mime_read(len=%zu) is errored -> %d, eos=0",
  ------------------
  |  |  163|      0|  do {                                                    \
  |  |  164|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|      0|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1914|      0|                  blen, ctx->error_result);
 1915|      0|    *pnread = 0;
 1916|      0|    *peos = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1917|      0|    return ctx->error_result;
 1918|      0|  }
 1919|    627|  if(ctx->seen_eos) {
  ------------------
  |  Branch (1919:6): [True: 0, False: 627]
  ------------------
 1920|      0|    CURL_TRC_READ(data, "cr_mime_read(len=%zu) seen eos -> 0, eos=1", blen);
  ------------------
  |  |  163|      0|  do {                                                    \
  |  |  164|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|      0|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1921|      0|    *pnread = 0;
 1922|      0|    *peos = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1923|      0|    return CURLE_OK;
 1924|      0|  }
 1925|       |  /* respect length limitations */
 1926|    627|  if(ctx->total_len >= 0) {
  ------------------
  |  Branch (1926:6): [True: 627, False: 0]
  ------------------
 1927|    627|    curl_off_t remain = ctx->total_len - ctx->read_len;
 1928|    627|    if(remain <= 0)
  ------------------
  |  Branch (1928:8): [True: 0, False: 627]
  ------------------
 1929|      0|      blen = 0;
 1930|    627|    else if(remain < (curl_off_t)blen)
  ------------------
  |  Branch (1930:13): [True: 497, False: 130]
  ------------------
 1931|    497|      blen = (size_t)remain;
 1932|    627|  }
 1933|       |
 1934|    627|  if(!Curl_bufq_is_empty(&ctx->tmpbuf)) {
  ------------------
  |  Branch (1934:6): [True: 0, False: 627]
  ------------------
 1935|      0|    result = Curl_bufq_read(&ctx->tmpbuf, (unsigned char *)buf, blen, &nread);
 1936|      0|    if(result) {
  ------------------
  |  Branch (1936:8): [True: 0, False: 0]
  ------------------
 1937|      0|      ctx->errored = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1938|      0|      ctx->error_result = result;
 1939|      0|      return result;
 1940|      0|    }
 1941|      0|  }
 1942|    627|  else if(blen <= 4) {
  ------------------
  |  Branch (1942:11): [True: 2, False: 625]
  ------------------
 1943|       |    /* Curl_mime_read() may go into an infinite loop when reading
 1944|       |     * via a base64 encoder, as it stalls when the read buffer is too small
 1945|       |     * to contain a complete 3 byte encoding. Read into a larger buffer
 1946|       |     * and use that until empty. */
 1947|      2|    CURL_TRC_READ(data, "cr_mime_read(len=%zu), small read, using tmp", blen);
  ------------------
  |  |  163|      2|  do {                                                    \
  |  |  164|      2|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|      2|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      4|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 2, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      4|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      2|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|      2|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|      2|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 2]
  |  |  ------------------
  ------------------
 1948|      2|    nread = Curl_mime_read(tmp, 1, sizeof(tmp), ctx->part);
 1949|      2|    if(nread <= sizeof(tmp)) {
  ------------------
  |  Branch (1949:8): [True: 2, False: 0]
  ------------------
 1950|      2|      size_t n;
 1951|      2|      result = Curl_bufq_write(&ctx->tmpbuf, (unsigned char *)tmp, nread, &n);
 1952|      2|      if(result) {
  ------------------
  |  Branch (1952:10): [True: 0, False: 2]
  ------------------
 1953|      0|        ctx->errored = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1954|      0|        ctx->error_result = result;
 1955|      0|        return result;
 1956|      0|      }
 1957|       |      /* stored it, read again */
 1958|      2|      result = Curl_bufq_cread(&ctx->tmpbuf, buf, blen, &nread);
 1959|      2|      if(result) {
  ------------------
  |  Branch (1959:10): [True: 0, False: 2]
  ------------------
 1960|      0|        ctx->errored = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1961|      0|        ctx->error_result = result;
 1962|      0|        return result;
 1963|      0|      }
 1964|      2|    }
 1965|      2|  }
 1966|    625|  else
 1967|    625|    nread = Curl_mime_read(buf, 1, blen, ctx->part);
 1968|       |
 1969|    627|  CURL_TRC_READ(data, "cr_mime_read(len=%zu), mime_read() -> %zu",
  ------------------
  |  |  163|    627|  do {                                                    \
  |  |  164|    627|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|    627|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  1.25k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 627, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 627]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  1.25k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    627|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|    627|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|    627|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 627]
  |  |  ------------------
  ------------------
 1970|    627|                blen, nread);
 1971|       |
 1972|    627|  switch(nread) {
 1973|      0|  case 0:
  ------------------
  |  Branch (1973:3): [True: 0, False: 627]
  ------------------
 1974|      0|    if((ctx->total_len >= 0) && (ctx->read_len < ctx->total_len)) {
  ------------------
  |  Branch (1974:8): [True: 0, False: 0]
  |  Branch (1974:33): [True: 0, False: 0]
  ------------------
 1975|      0|      failf(data, "client mime read EOF fail, "
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1976|      0|            "only %" FMT_OFF_T "/%" FMT_OFF_T
 1977|      0|            " of needed bytes read", ctx->read_len, ctx->total_len);
 1978|      0|      return CURLE_READ_ERROR;
 1979|      0|    }
 1980|      0|    *pnread = 0;
 1981|      0|    *peos = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1982|      0|    ctx->seen_eos = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1983|      0|    break;
 1984|       |
 1985|      0|  case CURL_READFUNC_ABORT:
  ------------------
  |  |  390|      0|#define CURL_READFUNC_ABORT 0x10000000
  ------------------
  |  Branch (1985:3): [True: 0, False: 627]
  ------------------
 1986|      0|    failf(data, "operation aborted by callback");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1987|      0|    *pnread = 0;
 1988|      0|    *peos = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1989|      0|    ctx->errored = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1990|      0|    ctx->error_result = CURLE_ABORTED_BY_CALLBACK;
 1991|      0|    result = CURLE_ABORTED_BY_CALLBACK;
 1992|      0|    break;
 1993|       |
 1994|      0|  case CURL_READFUNC_PAUSE:
  ------------------
  |  |  393|      0|#define CURL_READFUNC_PAUSE 0x10000001
  ------------------
  |  Branch (1994:3): [True: 0, False: 627]
  ------------------
 1995|       |    /* CURL_READFUNC_PAUSE pauses read callbacks that feed socket writes */
 1996|      0|    CURL_TRC_READ(data, "cr_mime_read(len=%zu), paused by callback", blen);
  ------------------
  |  |  163|      0|  do {                                                    \
  |  |  164|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|      0|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1997|      0|    *pnread = 0;
 1998|      0|    *peos = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1999|      0|    result = Curl_xfer_pause_send(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2000|      0|    break; /* nothing was read */
 2001|       |
 2002|      0|  case STOP_FILLING:
  ------------------
  |  |   50|      0|#define STOP_FILLING ((size_t)-2)
  ------------------
  |  Branch (2002:3): [True: 0, False: 627]
  ------------------
 2003|      0|  case READ_ERROR:
  ------------------
  |  |   49|      0|#define READ_ERROR   ((size_t)-1)
  ------------------
  |  Branch (2003:3): [True: 0, False: 627]
  ------------------
 2004|      0|    failf(data, "read error getting mime data");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2005|      0|    *pnread = 0;
 2006|      0|    *peos = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2007|      0|    ctx->errored = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2008|      0|    ctx->error_result = CURLE_READ_ERROR;
 2009|      0|    result = CURLE_READ_ERROR;
 2010|      0|    break;
 2011|       |
 2012|    627|  default:
  ------------------
  |  Branch (2012:3): [True: 627, False: 0]
  ------------------
 2013|    627|    if(nread > blen) {
  ------------------
  |  Branch (2013:8): [True: 0, False: 627]
  ------------------
 2014|       |      /* the read function returned a too large value */
 2015|      0|      failf(data, "read function returned funny value");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2016|      0|      *pnread = 0;
 2017|      0|      *peos = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2018|      0|      ctx->errored = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2019|      0|      ctx->error_result = CURLE_READ_ERROR;
 2020|      0|      return CURLE_READ_ERROR;
 2021|      0|    }
 2022|    627|    ctx->read_len += nread;
 2023|    627|    if(ctx->total_len >= 0)
  ------------------
  |  Branch (2023:8): [True: 627, False: 0]
  ------------------
 2024|    627|      ctx->seen_eos = (ctx->read_len >= ctx->total_len);
 2025|    627|    *pnread = nread;
 2026|    627|    *peos = (bool)ctx->seen_eos;
 2027|    627|    break;
 2028|    627|  }
 2029|       |
 2030|    627|  CURL_TRC_READ(data, "cr_mime_read(len=%zu, total=%" FMT_OFF_T
  ------------------
  |  |  163|    627|  do {                                                    \
  |  |  164|    627|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|    627|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  1.25k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 627, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 627]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  1.25k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    627|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|    627|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|    627|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 627]
  |  |  ------------------
  ------------------
 2031|    627|                ", read=%" FMT_OFF_T ") -> %d, %zu, %d",
 2032|    627|                blen, ctx->total_len, ctx->read_len, result, *pnread, *peos);
 2033|    627|  return result;
 2034|    627|}
mime.c:cr_mime_close:
 1894|    536|{
 1895|    536|  struct cr_mime_ctx *ctx = reader->ctx;
 1896|    536|  (void)data;
 1897|    536|  Curl_bufq_free(&ctx->tmpbuf);
 1898|    536|}
mime.c:cr_mime_needs_rewind:
 2038|     53|{
 2039|     53|  struct cr_mime_ctx *ctx = reader->ctx;
 2040|     53|  (void)data;
 2041|     53|  return ctx->read_len > 0;
 2042|     53|}
mime.c:cr_mime_total_length:
 2046|  2.74k|{
 2047|  2.74k|  struct cr_mime_ctx *ctx = reader->ctx;
 2048|  2.74k|  (void)data;
 2049|  2.74k|  return ctx->total_len;
 2050|  2.74k|}
mime.c:cr_mime_cntrl:
 2097|    109|{
 2098|    109|  struct cr_mime_ctx *ctx = reader->ctx;
 2099|    109|  switch(opcode) {
 2100|    109|  case CURL_CRCNTRL_REWIND: {
  ------------------
  |  Branch (2100:3): [True: 109, False: 0]
  ------------------
 2101|    109|    CURLcode result = mime_rewind(ctx->part);
 2102|    109|    if(result)
  ------------------
  |  Branch (2102:8): [True: 60, False: 49]
  ------------------
 2103|     60|      failf(data, "Cannot rewind mime/post data");
  ------------------
  |  |   62|     60|#define failf Curl_failf
  ------------------
 2104|    109|    return result;
 2105|      0|  }
 2106|      0|  case CURL_CRCNTRL_UNPAUSE:
  ------------------
  |  Branch (2106:3): [True: 0, False: 109]
  ------------------
 2107|      0|    mime_unpause(ctx->part);
 2108|      0|    break;
 2109|      0|  case CURL_CRCNTRL_CLEAR_EOS:
  ------------------
  |  Branch (2109:3): [True: 0, False: 109]
  ------------------
 2110|      0|    ctx->seen_eos = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2111|      0|    break;
 2112|      0|  default:
  ------------------
  |  Branch (2112:3): [True: 0, False: 109]
  ------------------
 2113|      0|    break;
 2114|    109|  }
 2115|      0|  return CURLE_OK;
 2116|    109|}
mime.c:mime_rewind:
 1545|    645|{
 1546|    645|  return mime_part_rewind(part) == CURL_SEEKFUNC_OK ?
  ------------------
  |  |  380|    645|#define CURL_SEEKFUNC_OK       0
  ------------------
  |  Branch (1546:10): [True: 585, False: 60]
  ------------------
 1547|    585|         CURLE_OK : CURLE_SEND_FAIL_REWIND;
 1548|    645|}
mime.c:mime_size:
 1590|   123k|{
 1591|   123k|  curl_off_t size;
 1592|       |
 1593|   123k|  if(part->kind == MIMEKIND_MULTIPART)
  ------------------
  |  Branch (1593:6): [True: 536, False: 122k]
  ------------------
 1594|    536|    part->datasize = multipart_size(part->arg);
 1595|       |
 1596|   123k|  size = part->datasize;
 1597|       |
 1598|   123k|  if(part->encoder)
  ------------------
  |  Branch (1598:6): [True: 0, False: 123k]
  ------------------
 1599|      0|    size = part->encoder->sizefunc(part);
 1600|       |
 1601|   123k|  if(size >= 0 && !(part->flags & MIME_BODY_ONLY)) {
  ------------------
  |  |   35|   123k|#define MIME_BODY_ONLY          (1 << 1)
  ------------------
  |  Branch (1601:6): [True: 123k, False: 0]
  |  Branch (1601:19): [True: 122k, False: 536]
  ------------------
 1602|       |    /* Compute total part size. */
 1603|   122k|    size += slist_size(part->curlheaders, 2, NULL, 0);
 1604|   122k|    size += slist_size(part->userheaders, 2, STRCONST("Content-Type"));
  ------------------
  |  | 1292|   122k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 1605|   122k|    size += 2;    /* CRLF after headers. */
 1606|   122k|  }
 1607|   123k|  return size;
 1608|   123k|}
mime.c:multipart_size:
 1564|    536|{
 1565|    536|  curl_off_t size;
 1566|    536|  curl_off_t boundarysize;
 1567|    536|  curl_mimepart *part;
 1568|       |
 1569|    536|  if(!mime)
  ------------------
  |  Branch (1569:6): [True: 0, False: 536]
  ------------------
 1570|      0|    return 0;           /* Not present -> empty. */
 1571|       |
 1572|    536|  boundarysize = 4 + MIME_BOUNDARY_LEN + 2;
  ------------------
  |  |   97|    536|#define MIME_BOUNDARY_LEN (MIME_BOUNDARY_DASHES + MIME_RAND_BOUNDARY_CHARS)
  |  |  ------------------
  |  |  |  |   28|    536|#define MIME_BOUNDARY_DASHES            24  /* leading boundary dashes */
  |  |  ------------------
  |  |               #define MIME_BOUNDARY_LEN (MIME_BOUNDARY_DASHES + MIME_RAND_BOUNDARY_CHARS)
  |  |  ------------------
  |  |  |  |   29|    536|#define MIME_RAND_BOUNDARY_CHARS        22  /* Nb. of random boundary chars. */
  |  |  ------------------
  ------------------
 1573|    536|  size = boundarysize;  /* Final boundary - CRLF after headers. */
 1574|       |
 1575|   123k|  for(part = mime->firstpart; part; part = part->nextpart) {
  ------------------
  |  Branch (1575:31): [True: 122k, False: 536]
  ------------------
 1576|   122k|    curl_off_t sz = mime_size(part);
 1577|       |
 1578|   122k|    if(sz < 0)
  ------------------
  |  Branch (1578:8): [True: 0, False: 122k]
  ------------------
 1579|      0|      size = sz;
 1580|       |
 1581|   122k|    if(size >= 0)
  ------------------
  |  Branch (1581:8): [True: 122k, False: 0]
  ------------------
 1582|   122k|      size += boundarysize + sz;
 1583|   122k|  }
 1584|       |
 1585|    536|  return size;
 1586|    536|}
mime.c:slist_size:
 1553|   245k|{
 1554|   245k|  size_t size = 0;
 1555|       |
 1556|   367k|  for(; s; s = s->next)
  ------------------
  |  Branch (1556:9): [True: 122k, False: 245k]
  ------------------
 1557|   122k|    if(!skip || !match_header(s, skip, skiplen))
  ------------------
  |  Branch (1557:8): [True: 122k, False: 0]
  |  Branch (1557:17): [True: 0, False: 0]
  ------------------
 1558|   122k|      size += strlen(s->data) + overhead;
 1559|   245k|  return size;
 1560|   245k|}

curl_mvsnprintf:
 1106|   380k|{
 1107|   380k|  int retcode;
 1108|   380k|  struct nsprintf info;
 1109|       |
 1110|   380k|  info.buffer = buffer;
 1111|   380k|  info.length = 0;
 1112|   380k|  info.max = maxlength;
 1113|       |
 1114|   380k|  retcode = formatf(&info, addbyter, format, args);
 1115|   380k|  if(info.max) {
  ------------------
  |  Branch (1115:6): [True: 380k, False: 4]
  ------------------
 1116|       |    /* we terminate this with a zero byte */
 1117|   380k|    if(info.max == info.length) {
  ------------------
  |  Branch (1117:8): [True: 39, False: 380k]
  ------------------
 1118|       |      /* we are at maximum, scrap the last letter */
 1119|     39|      info.buffer[-1] = 0;
 1120|     39|      DEBUGASSERT(retcode);
  ------------------
  |  | 1081|     39|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1120:7): [True: 0, False: 39]
  |  Branch (1120:7): [True: 39, False: 0]
  ------------------
 1121|     39|      retcode--; /* do not count the nul byte */
 1122|     39|    }
 1123|   380k|    else
 1124|   380k|      info.buffer[0] = 0;
 1125|   380k|  }
 1126|   380k|  return retcode;
 1127|   380k|}
curl_msnprintf:
 1130|   380k|{
 1131|   380k|  int retcode;
 1132|   380k|  va_list args; /* argument pointer */
 1133|   380k|  va_start(args, format);
 1134|   380k|  retcode = curl_mvsnprintf(buffer, maxlength, format, args);
 1135|       |  va_end(args);
 1136|   380k|  return retcode;
 1137|   380k|}
curlx_dyn_vprintf:
 1153|   162k|{
 1154|   162k|  struct asprintf info;
 1155|   162k|  info.b = dyn;
 1156|   162k|  info.merr = MERR_OK;
  ------------------
  |  |   27|   162k|#define MERR_OK        0
  ------------------
 1157|       |
 1158|   162k|  (void)formatf(&info, alloc_addbyter, format, args);
 1159|   162k|  if(info.merr) {
  ------------------
  |  Branch (1159:6): [True: 11, False: 162k]
  ------------------
 1160|     11|    curlx_dyn_free(info.b);
 1161|     11|    return info.merr;
 1162|     11|  }
 1163|   162k|  return 0;
 1164|   162k|}
curl_mvaprintf:
 1167|   204k|{
 1168|   204k|  struct asprintf info;
 1169|   204k|  struct dynbuf dyn;
 1170|   204k|  info.b = &dyn;
 1171|   204k|  curlx_dyn_init(info.b, DYN_APRINTF);
  ------------------
  |  |   70|   204k|#define DYN_APRINTF         8000000
  ------------------
 1172|   204k|  info.merr = MERR_OK;
  ------------------
  |  |   27|   204k|#define MERR_OK        0
  ------------------
 1173|       |
 1174|   204k|  (void)formatf(&info, alloc_addbyter, format, args);
 1175|   204k|  if(info.merr) {
  ------------------
  |  Branch (1175:6): [True: 0, False: 204k]
  ------------------
 1176|      0|    curlx_dyn_free(info.b);
 1177|      0|    return NULL;
 1178|      0|  }
 1179|   204k|  if(curlx_dyn_len(info.b))
  ------------------
  |  Branch (1179:6): [True: 204k, False: 1]
  ------------------
 1180|   204k|    return curlx_dyn_ptr(info.b);
 1181|      1|  return curlx_strdup("");
  ------------------
  |  | 1477|      1|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1182|   204k|}
curl_maprintf:
 1185|  81.2k|{
 1186|  81.2k|  va_list args;
 1187|  81.2k|  char *s;
 1188|  81.2k|  va_start(args, format);
 1189|  81.2k|  s = curl_mvaprintf(format, args);
 1190|       |  va_end(args);
 1191|  81.2k|  return s;
 1192|  81.2k|}
curl_mfprintf:
 1232|  1.71k|{
 1233|  1.71k|  int retcode;
 1234|  1.71k|  va_list args; /* argument pointer */
 1235|  1.71k|  va_start(args, format);
 1236|  1.71k|  retcode = formatf(fd, fputc_wrapper, format, args);
 1237|       |  va_end(args);
 1238|  1.71k|  return retcode;
 1239|  1.71k|}
mprintf.c:formatf:
  976|   748k|{
  977|   748k|  int done = 0;   /* number of characters written */
  978|   748k|  int i;
  979|   748k|  int ocount = 0; /* number of output segments */
  980|   748k|  int icount = 0; /* number of input arguments */
  981|       |
  982|   748k|  struct outsegment output[MAX_SEGMENTS];
  983|   748k|  struct va_input input[MAX_PARAMETERS];
  984|   748k|  char work[BUFFSIZE + 2];
  985|       |
  986|       |  /* Parse the format string */
  987|   748k|  if(parsefmt(format, output, input, &ocount, &icount, ap_save))
  ------------------
  |  Branch (987:6): [True: 0, False: 748k]
  ------------------
  988|      0|    return 0;
  989|       |
  990|  2.79M|  for(i = 0; i < ocount; i++) {
  ------------------
  |  Branch (990:14): [True: 2.05M, False: 748k]
  ------------------
  991|  2.05M|    struct outsegment *optr = &output[i];
  992|  2.05M|    struct va_input *iptr = &input[optr->input];
  993|  2.05M|    struct mproperty p;
  994|  2.05M|    size_t outlen = optr->outlen;
  995|       |
  996|  2.05M|    if(outlen) {
  ------------------
  |  Branch (996:8): [True: 864k, False: 1.18M]
  ------------------
  997|   864k|      const char *str = optr->start;
  998|  4.94M|      for(; outlen && *str; outlen--) {
  ------------------
  |  Branch (998:13): [True: 4.07M, False: 864k]
  |  Branch (998:23): [True: 4.07M, False: 0]
  ------------------
  999|  4.07M|        if(stream(*str++, userp))
  ------------------
  |  Branch (999:12): [True: 2, False: 4.07M]
  ------------------
 1000|      2|          return done;
 1001|  4.07M|        done++;
 1002|  4.07M|      }
 1003|   864k|      if(optr->flags & FLAGS_SUBSTR)
  ------------------
  |  Branch (1003:10): [True: 96.6k, False: 767k]
  ------------------
 1004|       |        /* this is a substring */
 1005|  96.6k|        continue;
 1006|   864k|    }
 1007|       |
 1008|  1.95M|    p.flags = optr->flags;
 1009|       |
 1010|       |    /* pick up the specified width */
 1011|  1.95M|    if(p.flags & FLAGS_WIDTHPARAM) {
  ------------------
  |  Branch (1011:8): [True: 0, False: 1.95M]
  ------------------
 1012|      0|      p.width = (int)input[optr->width].val.nums;
 1013|      0|      if(p.width < 0) {
  ------------------
  |  Branch (1013:10): [True: 0, False: 0]
  ------------------
 1014|       |        /* "A negative field width is taken as a '-' flag followed by a
 1015|       |           positive field width." */
 1016|      0|        if(p.width == INT_MIN)
  ------------------
  |  Branch (1016:12): [True: 0, False: 0]
  ------------------
 1017|      0|          p.width = INT_MAX;
 1018|      0|        else
 1019|      0|          p.width = -p.width;
 1020|      0|        p.flags |= FLAGS_LEFT;
 1021|      0|        p.flags &= ~(unsigned int)FLAGS_PAD_NIL;
 1022|      0|      }
 1023|      0|    }
 1024|  1.95M|    else
 1025|  1.95M|      p.width = optr->width;
 1026|       |
 1027|       |    /* pick up the specified precision */
 1028|  1.95M|    if(p.flags & FLAGS_PRECPARAM) {
  ------------------
  |  Branch (1028:8): [True: 60.7k, False: 1.89M]
  ------------------
 1029|  60.7k|      p.prec = (int)input[optr->precision].val.nums;
 1030|  60.7k|      if(p.prec < 0)
  ------------------
  |  Branch (1030:10): [True: 0, False: 60.7k]
  ------------------
 1031|       |        /* "A negative precision is taken as if the precision were
 1032|       |           omitted." */
 1033|      0|        p.prec = -1;
 1034|  60.7k|    }
 1035|  1.89M|    else if(p.flags & FLAGS_PREC)
  ------------------
  |  Branch (1035:13): [True: 0, False: 1.89M]
  ------------------
 1036|      0|      p.prec = optr->precision;
 1037|  1.89M|    else
 1038|  1.89M|      p.prec = -1;
 1039|       |
 1040|  1.95M|    switch(iptr->type) {
 1041|   498k|    case MTYPE_INTU:
  ------------------
  |  Branch (1041:5): [True: 498k, False: 1.45M]
  ------------------
 1042|   498k|    case MTYPE_LONGU:
  ------------------
  |  Branch (1042:5): [True: 42, False: 1.95M]
  ------------------
 1043|   498k|    case MTYPE_LONGLONGU:
  ------------------
  |  Branch (1043:5): [True: 0, False: 1.95M]
  ------------------
 1044|   498k|      p.flags |= FLAGS_UNSIGNED;
 1045|   498k|      if(out_number(userp, stream, &p, iptr->val.numu, 0, work, &done))
  ------------------
  |  Branch (1045:10): [True: 3, False: 498k]
  ------------------
 1046|      3|        return done;
 1047|   498k|      break;
 1048|       |
 1049|   498k|    case MTYPE_INT:
  ------------------
  |  Branch (1049:5): [True: 24.6k, False: 1.93M]
  ------------------
 1050|  30.2k|    case MTYPE_LONG:
  ------------------
  |  Branch (1050:5): [True: 5.57k, False: 1.94M]
  ------------------
 1051|  30.2k|    case MTYPE_LONGLONG:
  ------------------
  |  Branch (1051:5): [True: 0, False: 1.95M]
  ------------------
 1052|  30.2k|      if(out_number(userp, stream, &p, iptr->val.numu,
  ------------------
  |  Branch (1052:10): [True: 1, False: 30.2k]
  ------------------
 1053|  30.2k|                    iptr->val.nums, work, &done))
 1054|      1|        return done;
 1055|  30.2k|      break;
 1056|       |
 1057|  1.42M|    case MTYPE_STRING:
  ------------------
  |  Branch (1057:5): [True: 1.42M, False: 529k]
  ------------------
 1058|  1.42M|      if(out_string(userp, stream, &p, iptr->val.str, &done))
  ------------------
  |  Branch (1058:10): [True: 44, False: 1.42M]
  ------------------
 1059|     44|        return done;
 1060|  1.42M|      break;
 1061|       |
 1062|  1.42M|    case MTYPE_PTR:
  ------------------
  |  Branch (1062:5): [True: 0, False: 1.95M]
  ------------------
 1063|      0|      if(out_pointer(userp, stream, &p, iptr->val.ptr, work, &done))
  ------------------
  |  Branch (1063:10): [True: 0, False: 0]
  ------------------
 1064|      0|        return done;
 1065|      0|      break;
 1066|       |
 1067|      0|    case MTYPE_DOUBLE:
  ------------------
  |  Branch (1067:5): [True: 0, False: 1.95M]
  ------------------
 1068|      0|      if(out_double(userp, stream, &p, iptr->val.dnum, work, &done))
  ------------------
  |  Branch (1068:10): [True: 0, False: 0]
  ------------------
 1069|      0|        return done;
 1070|      0|      break;
 1071|       |
 1072|      0|    case MTYPE_INTPTR:
  ------------------
  |  Branch (1072:5): [True: 0, False: 1.95M]
  ------------------
 1073|       |      /* Answer the count of characters written. */
 1074|      0|      if(p.flags & FLAGS_LONGLONG)
  ------------------
  |  Branch (1074:10): [True: 0, False: 0]
  ------------------
 1075|      0|        *(int64_t *)iptr->val.ptr = (int64_t)done;
 1076|      0|      else if(p.flags & FLAGS_LONG)
  ------------------
  |  Branch (1076:15): [True: 0, False: 0]
  ------------------
 1077|      0|        *(long *)iptr->val.ptr = (long)done;
 1078|      0|      else if(!(p.flags & FLAGS_SHORT))
  ------------------
  |  Branch (1078:15): [True: 0, False: 0]
  ------------------
 1079|      0|        *(int *)iptr->val.ptr = done;
 1080|      0|      else
 1081|      0|        *(short *)iptr->val.ptr = (short)done;
 1082|      0|      break;
 1083|       |
 1084|      0|    default:
  ------------------
  |  Branch (1084:5): [True: 0, False: 1.95M]
  ------------------
 1085|      0|      break;
 1086|  1.95M|    }
 1087|  1.95M|  }
 1088|   748k|  return done;
 1089|   748k|}
mprintf.c:parsefmt:
  431|   748k|{
  432|   748k|  const char *fmt = format;
  433|   748k|  int param_num = 0;
  434|   748k|  int max_param = -1;
  435|   748k|  int i;
  436|   748k|  int ocount = 0;
  437|   748k|  unsigned char usedinput[MAX_PARAMETERS / 8];
  438|   748k|  size_t outlen = 0;
  439|   748k|  struct outsegment *optr;
  440|   748k|  int use_dollar = DOLLAR_UNKNOWN;
  441|   748k|  const char *start = fmt;
  442|       |
  443|       |  /* clear, set a bit for each used input */
  444|   748k|  memset(usedinput, 0, sizeof(usedinput));
  445|       |
  446|  6.77M|  while(*fmt) {
  ------------------
  |  Branch (446:9): [True: 6.03M, False: 748k]
  ------------------
  447|  6.03M|    if(*fmt == '%') {
  ------------------
  |  Branch (447:8): [True: 2.02M, False: 4.00M]
  ------------------
  448|  2.02M|      struct va_input *iptr;
  449|  2.02M|      FormatType type;
  450|  2.02M|      unsigned int flags = 0;
  451|  2.02M|      int width = 0;
  452|  2.02M|      int precision = 0;
  453|  2.02M|      int param = -1;
  454|  2.02M|      int rc;
  455|  2.02M|      fmt++;
  456|  2.02M|      outlen = (size_t)(fmt - start - 1);
  457|  2.02M|      if(*fmt == '%') {
  ------------------
  |  Branch (457:10): [True: 68.6k, False: 1.95M]
  ------------------
  458|       |        /* this means a %% that should be output only as %. Create an output
  459|       |           segment. */
  460|  68.6k|        if(outlen) {
  ------------------
  |  Branch (460:12): [True: 159, False: 68.5k]
  ------------------
  461|    159|          optr = &out[ocount++];
  462|    159|          if(ocount > MAX_SEGMENTS)
  ------------------
  |  |   34|    159|#define MAX_SEGMENTS   128 /* number of output segments */
  ------------------
  |  Branch (462:14): [True: 0, False: 159]
  ------------------
  463|      0|            return PFMT_MANYSEGS;
  ------------------
  |  |  170|      0|#define PFMT_MANYSEGS   11 /* maxed out output segments */
  ------------------
  464|    159|          optr->input = 0;
  465|    159|          optr->flags = FLAGS_SUBSTR;
  466|    159|          optr->start = start;
  467|    159|          optr->outlen = outlen;
  468|    159|        }
  469|  68.6k|        start = fmt;
  470|  68.6k|        fmt++;
  471|  68.6k|        continue; /* while */
  472|  68.6k|      }
  473|       |
  474|  1.95M|      if(use_dollar != DOLLAR_NOPE) {
  ------------------
  |  Branch (474:10): [True: 745k, False: 1.20M]
  ------------------
  475|   745k|        param = dollarstring(fmt, &fmt);
  476|   745k|        if(param < 0) {
  ------------------
  |  Branch (476:12): [True: 745k, False: 11]
  ------------------
  477|   745k|          if(use_dollar == DOLLAR_USE)
  ------------------
  |  Branch (477:14): [True: 0, False: 745k]
  ------------------
  478|       |            /* illegal combo */
  479|      0|            return PFMT_DOLLAR;
  ------------------
  |  |  160|      0|#define PFMT_DOLLAR      1 /* bad dollar for main param */
  ------------------
  480|       |
  481|       |          /* we got no positional, get the next arg */
  482|   745k|          param = -1;
  483|   745k|          use_dollar = DOLLAR_NOPE;
  484|   745k|        }
  485|     11|        else
  486|     11|          use_dollar = DOLLAR_USE;
  487|   745k|      }
  488|       |
  489|  1.95M|      rc = parse_flags(&fmt, &flags, use_dollar, &precision, &width);
  490|  1.95M|      if(rc)
  ------------------
  |  Branch (490:10): [True: 0, False: 1.95M]
  ------------------
  491|      0|        return rc;
  492|       |
  493|  1.95M|      if(parse_conversion(*fmt, &flags, &type))
  ------------------
  |  Branch (493:10): [True: 0, False: 1.95M]
  ------------------
  494|      0|        continue;
  495|       |
  496|  1.95M|      if(flags & FLAGS_WIDTHPARAM) {
  ------------------
  |  Branch (496:10): [True: 0, False: 1.95M]
  ------------------
  497|      0|        if(width < 0)
  ------------------
  |  Branch (497:12): [True: 0, False: 0]
  ------------------
  498|      0|          width = param_num++;
  499|      0|        else {
  500|       |          /* if this identifies a parameter already used, this is illegal */
  501|      0|          if(is_arg_used(usedinput, width))
  ------------------
  |  |  148|      0|#define is_arg_used(x, y)   ((x)[(y) / 8] & (1 << ((y) & 7)))
  |  |  ------------------
  |  |  |  Branch (148:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  502|      0|            return PFMT_WIDTHARG;
  ------------------
  |  |  168|      0|#define PFMT_WIDTHARG    9 /* attempted to use same arg twice, for width */
  ------------------
  503|      0|        }
  504|      0|        if(width >= MAX_PARAMETERS)
  ------------------
  |  |   33|      0|#define MAX_PARAMETERS 128 /* number of input arguments */
  ------------------
  |  Branch (504:12): [True: 0, False: 0]
  ------------------
  505|      0|          return PFMT_MANYARGS;
  ------------------
  |  |  163|      0|#define PFMT_MANYARGS    4 /* too many input arguments used */
  ------------------
  506|      0|        if(width >= max_param)
  ------------------
  |  Branch (506:12): [True: 0, False: 0]
  ------------------
  507|      0|          max_param = width;
  508|       |
  509|      0|        in[width].type = MTYPE_WIDTH;
  510|       |        /* mark as used */
  511|      0|        mark_arg_used(usedinput, width);
  ------------------
  |  |  149|      0|#define mark_arg_used(x, y) ((x)[(y) / 8] |= (unsigned char)(1 << ((y) & 7)))
  ------------------
  512|      0|      }
  513|       |
  514|  1.95M|      if(flags & FLAGS_PRECPARAM) {
  ------------------
  |  Branch (514:10): [True: 60.7k, False: 1.89M]
  ------------------
  515|  60.7k|        if(precision < 0)
  ------------------
  |  Branch (515:12): [True: 60.7k, False: 0]
  ------------------
  516|  60.7k|          precision = param_num++;
  517|      0|        else {
  518|       |          /* if this identifies a parameter already used, this is illegal */
  519|      0|          if(is_arg_used(usedinput, precision))
  ------------------
  |  |  148|      0|#define is_arg_used(x, y)   ((x)[(y) / 8] & (1 << ((y) & 7)))
  |  |  ------------------
  |  |  |  Branch (148:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  520|      0|            return PFMT_PRECARG;
  ------------------
  |  |  169|      0|#define PFMT_PRECARG    10 /* attempted to use same arg twice, for prec */
  ------------------
  521|      0|        }
  522|  60.7k|        if(precision >= MAX_PARAMETERS)
  ------------------
  |  |   33|  60.7k|#define MAX_PARAMETERS 128 /* number of input arguments */
  ------------------
  |  Branch (522:12): [True: 0, False: 60.7k]
  ------------------
  523|      0|          return PFMT_MANYARGS;
  ------------------
  |  |  163|      0|#define PFMT_MANYARGS    4 /* too many input arguments used */
  ------------------
  524|  60.7k|        if(precision >= max_param)
  ------------------
  |  Branch (524:12): [True: 60.7k, False: 0]
  ------------------
  525|  60.7k|          max_param = precision;
  526|       |
  527|  60.7k|        in[precision].type = MTYPE_PRECISION;
  528|  60.7k|        mark_arg_used(usedinput, precision);
  ------------------
  |  |  149|  60.7k|#define mark_arg_used(x, y) ((x)[(y) / 8] |= (unsigned char)(1 << ((y) & 7)))
  ------------------
  529|  60.7k|      }
  530|       |
  531|       |      /* Handle the specifier */
  532|  1.95M|      if(param < 0)
  ------------------
  |  Branch (532:10): [True: 1.95M, False: 22]
  ------------------
  533|  1.95M|        param = param_num++;
  534|  1.95M|      if(param >= MAX_PARAMETERS)
  ------------------
  |  |   33|  1.95M|#define MAX_PARAMETERS 128 /* number of input arguments */
  ------------------
  |  Branch (534:10): [True: 0, False: 1.95M]
  ------------------
  535|      0|        return PFMT_MANYARGS;
  ------------------
  |  |  163|      0|#define PFMT_MANYARGS    4 /* too many input arguments used */
  ------------------
  536|  1.95M|      if(param >= max_param)
  ------------------
  |  Branch (536:10): [True: 1.95M, False: 25]
  ------------------
  537|  1.95M|        max_param = param;
  538|       |
  539|  1.95M|      iptr = &in[param];
  540|  1.95M|      iptr->type = type;
  541|       |
  542|       |      /* mark this input as used */
  543|  1.95M|      mark_arg_used(usedinput, param);
  ------------------
  |  |  149|  1.95M|#define mark_arg_used(x, y) ((x)[(y) / 8] |= (unsigned char)(1 << ((y) & 7)))
  ------------------
  544|       |
  545|  1.95M|      fmt++;
  546|  1.95M|      optr = &out[ocount++];
  547|  1.95M|      if(ocount > MAX_SEGMENTS)
  ------------------
  |  |   34|  1.95M|#define MAX_SEGMENTS   128 /* number of output segments */
  ------------------
  |  Branch (547:10): [True: 0, False: 1.95M]
  ------------------
  548|      0|        return PFMT_MANYSEGS;
  ------------------
  |  |  170|      0|#define PFMT_MANYSEGS   11 /* maxed out output segments */
  ------------------
  549|  1.95M|      optr->input = (unsigned int)param;
  550|  1.95M|      optr->flags = flags;
  551|  1.95M|      optr->width = width;
  552|  1.95M|      optr->precision = precision;
  553|  1.95M|      optr->start = start;
  554|  1.95M|      optr->outlen = outlen;
  555|  1.95M|      start = fmt;
  556|  1.95M|    }
  557|  4.00M|    else
  558|  4.00M|      fmt++;
  559|  6.03M|  }
  560|       |
  561|       |  /* is there a trailing piece */
  562|   748k|  outlen = (size_t)(fmt - start);
  563|   748k|  if(outlen) {
  ------------------
  |  Branch (563:6): [True: 96.5k, False: 651k]
  ------------------
  564|  96.5k|    optr = &out[ocount++];
  565|  96.5k|    if(ocount > MAX_SEGMENTS)
  ------------------
  |  |   34|  96.5k|#define MAX_SEGMENTS   128 /* number of output segments */
  ------------------
  |  Branch (565:8): [True: 0, False: 96.5k]
  ------------------
  566|      0|      return PFMT_MANYSEGS;
  ------------------
  |  |  170|      0|#define PFMT_MANYSEGS   11 /* maxed out output segments */
  ------------------
  567|  96.5k|    optr->input = 0;
  568|  96.5k|    optr->flags = FLAGS_SUBSTR;
  569|  96.5k|    optr->start = start;
  570|  96.5k|    optr->outlen = outlen;
  571|  96.5k|  }
  572|       |
  573|       |  /* Read the arg list parameters into our data list */
  574|  2.76M|  for(i = 0; i < max_param + 1; i++) {
  ------------------
  |  Branch (574:14): [True: 2.01M, False: 748k]
  ------------------
  575|  2.01M|    struct va_input *iptr = &in[i];
  576|  2.01M|    if(!is_arg_used(usedinput, i))
  ------------------
  |  |  148|  2.01M|#define is_arg_used(x, y)   ((x)[(y) / 8] & (1 << ((y) & 7)))
  ------------------
  |  Branch (576:8): [True: 0, False: 2.01M]
  ------------------
  577|       |      /* bad input */
  578|      0|      return PFMT_INPUTGAP;
  ------------------
  |  |  167|      0|#define PFMT_INPUTGAP    8 /* gap in arguments */
  ------------------
  579|       |
  580|       |    /* based on the type, read the correct argument */
  581|  2.01M|    switch(iptr->type) {
  582|  1.42M|    case MTYPE_STRING:
  ------------------
  |  Branch (582:5): [True: 1.42M, False: 589k]
  ------------------
  583|  1.42M|      iptr->val.str = va_arg(arglist, const char *);
  584|  1.42M|      break;
  585|       |
  586|      0|    case MTYPE_INTPTR:
  ------------------
  |  Branch (586:5): [True: 0, False: 2.01M]
  ------------------
  587|      0|    case MTYPE_PTR:
  ------------------
  |  Branch (587:5): [True: 0, False: 2.01M]
  ------------------
  588|      0|      iptr->val.ptr = va_arg(arglist, void *);
  589|      0|      break;
  590|       |
  591|      0|    case MTYPE_LONGLONGU:
  ------------------
  |  Branch (591:5): [True: 0, False: 2.01M]
  ------------------
  592|      0|      iptr->val.numu = va_arg(arglist, uint64_t);
  593|      0|      break;
  594|       |
  595|      0|    case MTYPE_LONGLONG:
  ------------------
  |  Branch (595:5): [True: 0, False: 2.01M]
  ------------------
  596|      0|      iptr->val.nums = va_arg(arglist, int64_t);
  597|      0|      break;
  598|       |
  599|     42|    case MTYPE_LONGU:
  ------------------
  |  Branch (599:5): [True: 42, False: 2.01M]
  ------------------
  600|     42|      iptr->val.numu = va_arg(arglist, unsigned long);
  601|     42|      break;
  602|       |
  603|  5.57k|    case MTYPE_LONG:
  ------------------
  |  Branch (603:5): [True: 5.57k, False: 2.01M]
  ------------------
  604|  5.57k|      iptr->val.nums = va_arg(arglist, long);
  605|  5.57k|      break;
  606|       |
  607|   498k|    case MTYPE_INTU:
  ------------------
  |  Branch (607:5): [True: 498k, False: 1.51M]
  ------------------
  608|   498k|      iptr->val.numu = va_arg(arglist, unsigned int);
  609|   498k|      break;
  610|       |
  611|  24.6k|    case MTYPE_INT:
  ------------------
  |  Branch (611:5): [True: 24.6k, False: 1.99M]
  ------------------
  612|  24.6k|    case MTYPE_WIDTH:
  ------------------
  |  Branch (612:5): [True: 0, False: 2.01M]
  ------------------
  613|  85.4k|    case MTYPE_PRECISION:
  ------------------
  |  Branch (613:5): [True: 60.7k, False: 1.95M]
  ------------------
  614|  85.4k|      iptr->val.nums = va_arg(arglist, int);
  615|  85.4k|      break;
  616|       |
  617|      0|    case MTYPE_DOUBLE:
  ------------------
  |  Branch (617:5): [True: 0, False: 2.01M]
  ------------------
  618|      0|      iptr->val.dnum = va_arg(arglist, double);
  619|      0|      break;
  620|       |
  621|      0|    default:
  ------------------
  |  Branch (621:5): [True: 0, False: 2.01M]
  ------------------
  622|      0|      DEBUGASSERT(NULL); /* unexpected */
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (622:7): [True: 0, False: 0]
  |  Branch (622:7): [True: 0, False: 0]
  ------------------
  623|      0|      break;
  624|  2.01M|    }
  625|  2.01M|  }
  626|   748k|  *ipieces = max_param + 1;
  627|   748k|  *opieces = ocount;
  628|       |
  629|   748k|  return PFMT_OK;
  ------------------
  |  |  159|   748k|#define PFMT_OK          0
  ------------------
  630|   748k|}
mprintf.c:dollarstring:
  139|   745k|{
  140|   745k|  curl_off_t num;
  141|   745k|  if(curlx_str_number(&p, &num, MAX_PARAMETERS) ||
  ------------------
  |  |   33|   745k|#define MAX_PARAMETERS 128 /* number of input arguments */
  ------------------
  |  Branch (141:6): [True: 676k, False: 69.6k]
  ------------------
  142|  69.6k|     curlx_str_single(&p, '$') || !num)
  ------------------
  |  Branch (142:6): [True: 69.6k, False: 0]
  |  Branch (142:35): [True: 0, False: 0]
  ------------------
  143|   745k|    return -1;
  144|      6|  *end = p;
  145|      6|  return (int)num - 1;
  146|   745k|}
mprintf.c:parse_flags:
  174|  1.95M|{
  175|  1.95M|  const char *fmt = *fmtp;
  176|  1.95M|  bool loopit = TRUE;
  ------------------
  |  | 1055|  1.95M|#define TRUE true
  ------------------
  177|  1.95M|  unsigned int flags = 0;
  178|  1.95M|  int width = 0;
  179|  1.95M|  int precision = 0;
  180|       |
  181|       |  /* Handle the flags */
  182|  2.09M|  do {
  183|  2.09M|    switch(*fmt++) {
  184|      0|    case ' ':
  ------------------
  |  Branch (184:5): [True: 0, False: 2.09M]
  ------------------
  185|      0|      flags |= FLAGS_SPACE;
  186|      0|      break;
  187|      0|    case '+':
  ------------------
  |  Branch (187:5): [True: 0, False: 2.09M]
  ------------------
  188|      0|      flags |= FLAGS_SHOWSIGN;
  189|      0|      break;
  190|      0|    case '-':
  ------------------
  |  Branch (190:5): [True: 0, False: 2.09M]
  ------------------
  191|      0|      flags |= FLAGS_LEFT;
  192|      0|      flags &= ~(unsigned int)FLAGS_PAD_NIL;
  193|      0|      break;
  194|      0|    case '#':
  ------------------
  |  Branch (194:5): [True: 0, False: 2.09M]
  ------------------
  195|      0|      flags |= FLAGS_ALT;
  196|      0|      break;
  197|  60.7k|    case '.':
  ------------------
  |  Branch (197:5): [True: 60.7k, False: 2.03M]
  ------------------
  198|  60.7k|      if('*' == *fmt) {
  ------------------
  |  Branch (198:10): [True: 60.7k, False: 0]
  ------------------
  199|       |        /* The precision is picked from a specified parameter */
  200|  60.7k|        flags |= FLAGS_PRECPARAM;
  201|  60.7k|        fmt++;
  202|       |
  203|  60.7k|        if(use_dollar == DOLLAR_USE) {
  ------------------
  |  Branch (203:12): [True: 0, False: 60.7k]
  ------------------
  204|      0|          precision = dollarstring(fmt, &fmt);
  205|      0|          if(precision < 0)
  ------------------
  |  Branch (205:14): [True: 0, False: 0]
  ------------------
  206|       |            /* illegal combo */
  207|      0|            return PFMT_DOLLARPREC;
  ------------------
  |  |  162|      0|#define PFMT_DOLLARPREC  3 /* bad dollar use for precision */
  ------------------
  208|      0|        }
  209|  60.7k|        else
  210|       |          /* get it from the next argument */
  211|  60.7k|          precision = -1;
  212|  60.7k|      }
  213|      0|      else {
  214|      0|        bool is_neg;
  215|      0|        curl_off_t num;
  216|      0|        flags |= FLAGS_PREC;
  217|      0|        is_neg = ('-' == *fmt);
  218|      0|        if(is_neg)
  ------------------
  |  Branch (218:12): [True: 0, False: 0]
  ------------------
  219|      0|          fmt++;
  220|      0|        if(curlx_str_number(&fmt, &num, INT_MAX))
  ------------------
  |  Branch (220:12): [True: 0, False: 0]
  ------------------
  221|      0|          return PFMT_PREC;
  ------------------
  |  |  164|      0|#define PFMT_PREC        5 /* precision overflow */
  ------------------
  222|      0|        precision = (int)num;
  223|      0|        if(is_neg)
  ------------------
  |  Branch (223:12): [True: 0, False: 0]
  ------------------
  224|      0|          precision = -precision;
  225|      0|      }
  226|  60.7k|      if((flags & (FLAGS_PREC | FLAGS_PRECPARAM)) ==
  ------------------
  |  Branch (226:10): [True: 0, False: 60.7k]
  ------------------
  227|  60.7k|         (FLAGS_PREC | FLAGS_PRECPARAM))
  228|       |        /* it is not permitted to use both kinds of precision for the same
  229|       |           argument */
  230|      0|        return PFMT_PRECMIX;
  ------------------
  |  |  165|      0|#define PFMT_PRECMIX     6 /* bad mix of precision specifiers */
  ------------------
  231|  60.7k|      break;
  232|  60.7k|    case 'h':
  ------------------
  |  Branch (232:5): [True: 0, False: 2.09M]
  ------------------
  233|      0|      flags |= FLAGS_SHORT;
  234|      0|      break;
  235|       |#ifdef _WIN32
  236|       |    case 'I':
  237|       |      /* Non-ANSI integer extensions I32 I64 */
  238|       |      if((fmt[0] == '3') && (fmt[1] == '2')) {
  239|       |        flags |= FLAGS_LONG;
  240|       |        fmt += 2;
  241|       |      }
  242|       |      else if((fmt[0] == '6') && (fmt[1] == '4')) {
  243|       |        flags |= FLAGS_LONGLONG;
  244|       |        fmt += 2;
  245|       |      }
  246|       |      else {
  247|       |#if (SIZEOF_CURL_OFF_T > SIZEOF_LONG)
  248|       |        flags |= FLAGS_LONGLONG;
  249|       |#else
  250|       |        flags |= FLAGS_LONG;
  251|       |#endif
  252|       |      }
  253|       |      break;
  254|       |#endif /* _WIN32 */
  255|  5.57k|    case 'l':
  ------------------
  |  Branch (255:5): [True: 5.57k, False: 2.08M]
  ------------------
  256|  5.57k|      if(flags & FLAGS_LONG)
  ------------------
  |  Branch (256:10): [True: 0, False: 5.57k]
  ------------------
  257|      0|        flags |= FLAGS_LONGLONG;
  258|  5.57k|      else
  259|  5.57k|        flags |= FLAGS_LONG;
  260|  5.57k|      break;
  261|      0|    case 'L':
  ------------------
  |  Branch (261:5): [True: 0, False: 2.09M]
  ------------------
  262|      0|      flags |= FLAGS_LONGDOUBLE;
  263|      0|      break;
  264|      0|    case 'q':
  ------------------
  |  Branch (264:5): [True: 0, False: 2.09M]
  ------------------
  265|      0|      flags |= FLAGS_LONGLONG;
  266|      0|      break;
  267|     42|    case 'z':
  ------------------
  |  Branch (267:5): [True: 42, False: 2.09M]
  ------------------
  268|       |      /* the code below generates a warning if -Wunreachable-code is
  269|       |         used */
  270|       |#if (SIZEOF_SIZE_T > SIZEOF_LONG)
  271|       |      flags |= FLAGS_LONGLONG;
  272|       |#else
  273|     42|      flags |= FLAGS_LONG;
  274|     42|#endif
  275|     42|      break;
  276|      0|    case 'O':
  ------------------
  |  Branch (276:5): [True: 0, False: 2.09M]
  ------------------
  277|       |#if (SIZEOF_CURL_OFF_T > SIZEOF_LONG)
  278|       |      flags |= FLAGS_LONGLONG;
  279|       |#else
  280|      0|      flags |= FLAGS_LONG;
  281|      0|#endif
  282|      0|      break;
  283|  68.7k|    case '0':
  ------------------
  |  Branch (283:5): [True: 68.7k, False: 2.02M]
  ------------------
  284|  68.7k|      if(!(flags & FLAGS_LEFT))
  ------------------
  |  Branch (284:10): [True: 68.7k, False: 0]
  ------------------
  285|  68.7k|        flags |= FLAGS_PAD_NIL;
  286|  68.7k|      FALLTHROUGH();
  ------------------
  |  |  821|  68.7k|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  287|  68.7k|    case '1':
  ------------------
  |  Branch (287:5): [True: 0, False: 2.09M]
  ------------------
  288|  68.8k|    case '2':
  ------------------
  |  Branch (288:5): [True: 20, False: 2.09M]
  ------------------
  289|  69.4k|    case '3':
  ------------------
  |  Branch (289:5): [True: 598, False: 2.09M]
  ------------------
  290|  69.4k|    case '4':
  ------------------
  |  Branch (290:5): [True: 62, False: 2.09M]
  ------------------
  291|  69.4k|    case '5':
  ------------------
  |  Branch (291:5): [True: 0, False: 2.09M]
  ------------------
  292|  70.3k|    case '6':
  ------------------
  |  Branch (292:5): [True: 894, False: 2.09M]
  ------------------
  293|  70.3k|    case '7':
  ------------------
  |  Branch (293:5): [True: 0, False: 2.09M]
  ------------------
  294|  70.3k|    case '8':
  ------------------
  |  Branch (294:5): [True: 0, False: 2.09M]
  ------------------
  295|  70.3k|    case '9': {
  ------------------
  |  Branch (295:5): [True: 0, False: 2.09M]
  ------------------
  296|  70.3k|      curl_off_t num;
  297|  70.3k|      flags |= FLAGS_WIDTH;
  298|  70.3k|      fmt--;
  299|  70.3k|      if(curlx_str_number(&fmt, &num, INT_MAX))
  ------------------
  |  Branch (299:10): [True: 0, False: 70.3k]
  ------------------
  300|      0|        return PFMT_WIDTH;
  ------------------
  |  |  166|      0|#define PFMT_WIDTH       7 /* width overflow */
  ------------------
  301|  70.3k|      width = (int)num;
  302|  70.3k|      break;
  303|  70.3k|    }
  304|      0|    case '*':  /* read width from argument list */
  ------------------
  |  Branch (304:5): [True: 0, False: 2.09M]
  ------------------
  305|      0|      flags |= FLAGS_WIDTHPARAM;
  306|      0|      if(use_dollar == DOLLAR_USE) {
  ------------------
  |  Branch (306:10): [True: 0, False: 0]
  ------------------
  307|      0|        width = dollarstring(fmt, &fmt);
  308|      0|        if(width < 0)
  ------------------
  |  Branch (308:12): [True: 0, False: 0]
  ------------------
  309|       |          /* illegal combo */
  310|      0|          return PFMT_DOLLARWIDTH;
  ------------------
  |  |  161|      0|#define PFMT_DOLLARWIDTH 2 /* bad dollar use for width */
  ------------------
  311|      0|      }
  312|      0|      else
  313|       |        /* pick from the next argument */
  314|      0|        width = -1;
  315|      0|      break;
  316|  1.95M|    default:
  ------------------
  |  Branch (316:5): [True: 1.95M, False: 136k]
  ------------------
  317|  1.95M|      loopit = FALSE;
  ------------------
  |  | 1058|  1.95M|#define FALSE false
  ------------------
  318|  1.95M|      fmt--;
  319|  1.95M|      break;
  320|  2.09M|    } /* switch */
  321|  2.09M|  } while(loopit); /* do */
  ------------------
  |  Branch (321:11): [True: 136k, False: 1.95M]
  ------------------
  322|  1.95M|  *flagsp = flags;
  323|  1.95M|  *precp = precision;
  324|  1.95M|  *widthp = width;
  325|  1.95M|  *fmtp = fmt;
  326|  1.95M|  return PFMT_OK;
  ------------------
  |  |  159|  1.95M|#define PFMT_OK          0
  ------------------
  327|  1.95M|}
mprintf.c:parse_conversion:
  331|  1.95M|{
  332|  1.95M|  unsigned int flags = *flagp;
  333|  1.95M|  FormatType type;
  334|  1.95M|  switch(f) {
  335|      0|  case 'S':
  ------------------
  |  Branch (335:3): [True: 0, False: 1.95M]
  ------------------
  336|      0|    flags |= FLAGS_ALT;
  337|      0|    type = MTYPE_STRING;
  338|      0|    break;
  339|  1.42M|  case 's':
  ------------------
  |  Branch (339:3): [True: 1.42M, False: 529k]
  ------------------
  340|  1.42M|    type = MTYPE_STRING;
  341|  1.42M|    break;
  342|      0|  case 'n':
  ------------------
  |  Branch (342:3): [True: 0, False: 1.95M]
  ------------------
  343|      0|    type = MTYPE_INTPTR;
  344|      0|    break;
  345|      0|  case 'p':
  ------------------
  |  Branch (345:3): [True: 0, False: 1.95M]
  ------------------
  346|      0|    type = MTYPE_PTR;
  347|      0|    break;
  348|  28.9k|  case 'd':
  ------------------
  |  Branch (348:3): [True: 28.9k, False: 1.92M]
  ------------------
  349|  29.2k|  case 'i':
  ------------------
  |  Branch (349:3): [True: 254, False: 1.95M]
  ------------------
  350|  29.2k|    if(flags & FLAGS_LONGLONG)
  ------------------
  |  Branch (350:8): [True: 0, False: 29.2k]
  ------------------
  351|      0|      type = MTYPE_LONGLONG;
  352|  29.2k|    else if(flags & FLAGS_LONG)
  ------------------
  |  Branch (352:13): [True: 5.57k, False: 23.6k]
  ------------------
  353|  5.57k|      type = MTYPE_LONG;
  354|  23.6k|    else
  355|  23.6k|      type = MTYPE_INT;
  356|  29.2k|    break;
  357|   430k|  case 'u':
  ------------------
  |  Branch (357:3): [True: 430k, False: 1.52M]
  ------------------
  358|   430k|    if(flags & FLAGS_LONGLONG)
  ------------------
  |  Branch (358:8): [True: 0, False: 430k]
  ------------------
  359|      0|      type = MTYPE_LONGLONGU;
  360|   430k|    else if(flags & FLAGS_LONG)
  ------------------
  |  Branch (360:13): [True: 0, False: 430k]
  ------------------
  361|      0|      type = MTYPE_LONGU;
  362|   430k|    else
  363|   430k|      type = MTYPE_INTU;
  364|   430k|    flags |= FLAGS_UNSIGNED;
  365|   430k|    break;
  366|      0|  case 'o':
  ------------------
  |  Branch (366:3): [True: 0, False: 1.95M]
  ------------------
  367|      0|    if(flags & FLAGS_LONGLONG)
  ------------------
  |  Branch (367:8): [True: 0, False: 0]
  ------------------
  368|      0|      type = MTYPE_LONGLONGU;
  369|      0|    else if(flags & FLAGS_LONG)
  ------------------
  |  Branch (369:13): [True: 0, False: 0]
  ------------------
  370|      0|      type = MTYPE_LONGU;
  371|      0|    else
  372|      0|      type = MTYPE_INTU;
  373|      0|    flags |= FLAGS_OCTAL | FLAGS_UNSIGNED;
  374|      0|    break;
  375|     45|  case 'x':
  ------------------
  |  Branch (375:3): [True: 45, False: 1.95M]
  ------------------
  376|     45|    if(flags & FLAGS_LONGLONG)
  ------------------
  |  Branch (376:8): [True: 0, False: 45]
  ------------------
  377|      0|      type = MTYPE_LONGLONGU;
  378|     45|    else if(flags & FLAGS_LONG)
  ------------------
  |  Branch (378:13): [True: 42, False: 3]
  ------------------
  379|     42|      type = MTYPE_LONGU;
  380|      3|    else
  381|      3|      type = MTYPE_INTU;
  382|     45|    flags |= FLAGS_HEX | FLAGS_UNSIGNED;
  383|     45|    break;
  384|  68.4k|  case 'X':
  ------------------
  |  Branch (384:3): [True: 68.4k, False: 1.88M]
  ------------------
  385|  68.4k|    if(flags & FLAGS_LONGLONG)
  ------------------
  |  Branch (385:8): [True: 0, False: 68.4k]
  ------------------
  386|      0|      type = MTYPE_LONGLONGU;
  387|  68.4k|    else if(flags & FLAGS_LONG)
  ------------------
  |  Branch (387:13): [True: 0, False: 68.4k]
  ------------------
  388|      0|      type = MTYPE_LONGU;
  389|  68.4k|    else
  390|  68.4k|      type = MTYPE_INTU;
  391|  68.4k|    flags |= FLAGS_HEX | FLAGS_UPPER | FLAGS_UNSIGNED;
  392|  68.4k|    break;
  393|  1.05k|  case 'c':
  ------------------
  |  Branch (393:3): [True: 1.05k, False: 1.95M]
  ------------------
  394|  1.05k|    type = MTYPE_INT;
  395|  1.05k|    flags |= FLAGS_CHAR;
  396|  1.05k|    break;
  397|      0|  case 'f':
  ------------------
  |  Branch (397:3): [True: 0, False: 1.95M]
  ------------------
  398|      0|    type = MTYPE_DOUBLE;
  399|      0|    break;
  400|      0|  case 'e':
  ------------------
  |  Branch (400:3): [True: 0, False: 1.95M]
  ------------------
  401|      0|    type = MTYPE_DOUBLE;
  402|      0|    flags |= FLAGS_FLOATE;
  403|      0|    break;
  404|      0|  case 'E':
  ------------------
  |  Branch (404:3): [True: 0, False: 1.95M]
  ------------------
  405|      0|    type = MTYPE_DOUBLE;
  406|      0|    flags |= FLAGS_FLOATE | FLAGS_UPPER;
  407|      0|    break;
  408|      0|  case 'g':
  ------------------
  |  Branch (408:3): [True: 0, False: 1.95M]
  ------------------
  409|      0|    type = MTYPE_DOUBLE;
  410|      0|    flags |= FLAGS_FLOATG;
  411|      0|    break;
  412|      0|  case 'G':
  ------------------
  |  Branch (412:3): [True: 0, False: 1.95M]
  ------------------
  413|      0|    type = MTYPE_DOUBLE;
  414|      0|    flags |= FLAGS_FLOATG | FLAGS_UPPER;
  415|      0|    break;
  416|      0|  default:
  ------------------
  |  Branch (416:3): [True: 0, False: 1.95M]
  ------------------
  417|       |    /* invalid instruction, disregard and continue */
  418|      0|    return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  419|  1.95M|  } /* switch */
  420|       |
  421|  1.95M|  *flagp |= flags;
  422|  1.95M|  *typep = type;
  423|       |  return FALSE;
  ------------------
  |  | 1058|  1.95M|#define FALSE false
  ------------------
  424|  1.95M|}
mprintf.c:out_number:
  738|   529k|{
  739|   529k|  const unsigned char *digits = Curl_ldigits;
  740|   529k|  int flags = p->flags;
  741|   529k|  int width = p->width;
  742|   529k|  int prec = p->prec;
  743|   529k|  bool is_alt = flags & FLAGS_ALT;
  744|   529k|  bool is_neg = FALSE;
  ------------------
  |  | 1058|   529k|#define FALSE false
  ------------------
  745|   529k|  int base = 10;
  746|       |
  747|       |  /* 'workend' points to the final buffer byte position, but with an extra
  748|       |     byte as margin to avoid the (FALSE?) warning Coverity gives us
  749|       |     otherwise */
  750|   529k|  char *workend = &work[BUFFSIZE - 2];
  ------------------
  |  |   31|   529k|#define BUFFSIZE 326 /* buffer for long-to-str and float-to-str calcs, should
  ------------------
  751|   529k|  char *w;
  752|       |
  753|   529k|  if(flags & FLAGS_CHAR) {
  ------------------
  |  Branch (753:6): [True: 1.05k, False: 528k]
  ------------------
  754|       |    /* Character. */
  755|  1.05k|    if(!(flags & FLAGS_LEFT))
  ------------------
  |  Branch (755:8): [True: 1.05k, False: 0]
  ------------------
  756|  1.05k|      while(--width > 0)
  ------------------
  |  Branch (756:13): [True: 0, False: 1.05k]
  ------------------
  757|      0|        OUTCHAR(' ');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  758|  1.05k|    OUTCHAR((char)num);
  ------------------
  |  |   43|  1.05k|  do {                                    \
  |  |   44|  1.05k|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 1.05k]
  |  |  ------------------
  |  |   45|  1.05k|      return TRUE;                        \
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  |  |   46|  1.05k|    (*donep)++;                           \
  |  |   47|  1.05k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 1.05k]
  |  |  ------------------
  ------------------
  759|  1.05k|    if(flags & FLAGS_LEFT)
  ------------------
  |  Branch (759:8): [True: 0, False: 1.05k]
  ------------------
  760|      0|      while(--width > 0)
  ------------------
  |  Branch (760:13): [True: 0, False: 0]
  ------------------
  761|      0|        OUTCHAR(' ');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  762|  1.05k|    return FALSE;
  ------------------
  |  | 1058|  1.05k|#define FALSE false
  ------------------
  763|  1.05k|  }
  764|   528k|  if(flags & FLAGS_OCTAL)
  ------------------
  |  Branch (764:6): [True: 0, False: 528k]
  ------------------
  765|       |    /* Octal unsigned integer */
  766|      0|    base = 8;
  767|       |
  768|   528k|  else if(flags & FLAGS_HEX) {
  ------------------
  |  Branch (768:11): [True: 68.5k, False: 459k]
  ------------------
  769|       |    /* Hexadecimal unsigned integer */
  770|  68.5k|    digits = (flags & FLAGS_UPPER) ? Curl_udigits : Curl_ldigits;
  ------------------
  |  Branch (770:14): [True: 68.4k, False: 45]
  ------------------
  771|  68.5k|    base = 16;
  772|  68.5k|  }
  773|   459k|  else if(flags & FLAGS_UNSIGNED)
  ------------------
  |  Branch (773:11): [True: 430k, False: 29.2k]
  ------------------
  774|       |    /* Decimal unsigned integer */
  775|   430k|    ;
  776|       |
  777|  29.2k|  else {
  778|       |    /* Decimal integer. */
  779|  29.2k|    is_neg = (nums < 0);
  780|  29.2k|    if(is_neg) {
  ------------------
  |  Branch (780:8): [True: 75, False: 29.1k]
  ------------------
  781|       |      /* signed_num might fail to hold absolute negative minimum by 1 */
  782|     75|      int64_t signed_num; /* Used to convert negative in positive. */
  783|     75|      signed_num = nums + (int64_t)1;
  784|     75|      signed_num = -signed_num;
  785|     75|      num = (uint64_t)signed_num;
  786|     75|      num += (uint64_t)1;
  787|     75|    }
  788|  29.2k|  }
  789|       |
  790|       |  /* Supply a default precision if none was given. */
  791|   528k|  if(prec == -1)
  ------------------
  |  Branch (791:6): [True: 528k, False: 0]
  ------------------
  792|   528k|    prec = 1;
  793|       |
  794|       |  /* Put the number in WORK. */
  795|   528k|  w = workend;
  796|   528k|  DEBUGASSERT(base <= 16);
  ------------------
  |  | 1081|   528k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (796:3): [True: 0, False: 528k]
  |  Branch (796:3): [True: 528k, False: 0]
  ------------------
  797|   528k|  switch(base) {
  798|   459k|  case 10:
  ------------------
  |  Branch (798:3): [True: 459k, False: 68.5k]
  ------------------
  799|  1.81M|    while(num > 0) {
  ------------------
  |  Branch (799:11): [True: 1.35M, False: 459k]
  ------------------
  800|  1.35M|      *w-- = (char)('0' + (num % 10));
  801|  1.35M|      num /= 10;
  802|  1.35M|    }
  803|   459k|    break;
  804|  68.5k|  default:
  ------------------
  |  Branch (804:3): [True: 68.5k, False: 459k]
  ------------------
  805|   203k|    while(num > 0) {
  ------------------
  |  Branch (805:11): [True: 135k, False: 68.5k]
  ------------------
  806|   135k|      *w-- = digits[num % base];
  807|   135k|      num /= base;
  808|   135k|    }
  809|  68.5k|    break;
  810|   528k|  }
  811|   528k|  width -= (int)(workend - w);
  812|   528k|  prec -= (int)(workend - w);
  813|       |
  814|   528k|  if(is_alt && base == 8 && prec <= 0) {
  ------------------
  |  Branch (814:6): [True: 0, False: 528k]
  |  Branch (814:16): [True: 0, False: 0]
  |  Branch (814:29): [True: 0, False: 0]
  ------------------
  815|      0|    *w-- = '0';
  816|      0|    --width;
  817|      0|  }
  818|       |
  819|   528k|  if(prec > 0) {
  ------------------
  |  Branch (819:6): [True: 53.7k, False: 474k]
  ------------------
  820|  53.7k|    width -= prec;
  821|   107k|    while(prec-- > 0 && w >= work)
  ------------------
  |  Branch (821:11): [True: 53.7k, False: 53.7k]
  |  Branch (821:25): [True: 53.7k, False: 0]
  ------------------
  822|  53.7k|      *w-- = '0';
  823|  53.7k|  }
  824|       |
  825|   528k|  if(is_alt && base == 16)
  ------------------
  |  Branch (825:6): [True: 0, False: 528k]
  |  Branch (825:16): [True: 0, False: 0]
  ------------------
  826|      0|    width -= 2;
  827|       |
  828|   528k|  if(is_neg || (flags & FLAGS_SHOWSIGN) || (flags & FLAGS_SPACE))
  ------------------
  |  Branch (828:6): [True: 75, False: 527k]
  |  Branch (828:16): [True: 0, False: 527k]
  |  Branch (828:44): [True: 0, False: 527k]
  ------------------
  829|     75|    --width;
  830|       |
  831|   528k|  if(!(flags & FLAGS_LEFT) && !(flags & FLAGS_PAD_NIL))
  ------------------
  |  Branch (831:6): [True: 528k, False: 0]
  |  Branch (831:31): [True: 459k, False: 68.7k]
  ------------------
  832|   464k|    while(width-- > 0)
  ------------------
  |  Branch (832:11): [True: 4.78k, False: 459k]
  ------------------
  833|  4.78k|      OUTCHAR(' ');
  ------------------
  |  |   43|  4.78k|  do {                                    \
  |  |   44|  4.78k|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 4.78k]
  |  |  ------------------
  |  |   45|  4.78k|      return TRUE;                        \
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  |  |   46|  4.78k|    (*donep)++;                           \
  |  |   47|  4.78k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 4.78k]
  |  |  ------------------
  ------------------
  834|       |
  835|   528k|  if(is_neg)
  ------------------
  |  Branch (835:6): [True: 75, False: 527k]
  ------------------
  836|     75|    OUTCHAR('-');
  ------------------
  |  |   43|     75|  do {                                    \
  |  |   44|     75|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 75]
  |  |  ------------------
  |  |   45|     75|      return TRUE;                        \
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  |  |   46|     75|    (*donep)++;                           \
  |  |   47|     75|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 75]
  |  |  ------------------
  ------------------
  837|   527k|  else if(flags & FLAGS_SHOWSIGN)
  ------------------
  |  Branch (837:11): [True: 0, False: 527k]
  ------------------
  838|      0|    OUTCHAR('+');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  839|   527k|  else if(flags & FLAGS_SPACE)
  ------------------
  |  Branch (839:11): [True: 0, False: 527k]
  ------------------
  840|      0|    OUTCHAR(' ');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  841|       |
  842|   528k|  if(is_alt && base == 16) {
  ------------------
  |  Branch (842:6): [True: 0, False: 528k]
  |  Branch (842:16): [True: 0, False: 0]
  ------------------
  843|      0|    OUTCHAR('0');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  844|      0|    if(flags & FLAGS_UPPER)
  ------------------
  |  Branch (844:8): [True: 0, False: 0]
  ------------------
  845|      0|      OUTCHAR('X');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  846|      0|    else
  847|      0|      OUTCHAR('x');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  848|      0|  }
  849|       |
  850|   528k|  if(!(flags & FLAGS_LEFT) && (flags & FLAGS_PAD_NIL))
  ------------------
  |  Branch (850:6): [True: 528k, False: 1]
  |  Branch (850:31): [True: 68.7k, False: 459k]
  ------------------
  851|  70.6k|    while(width-- > 0)
  ------------------
  |  Branch (851:11): [True: 1.90k, False: 68.7k]
  ------------------
  852|  1.90k|      OUTCHAR('0');
  ------------------
  |  |   43|  1.90k|  do {                                    \
  |  |   44|  1.90k|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 1.90k]
  |  |  ------------------
  |  |   45|  1.90k|      return TRUE;                        \
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  |  |   46|  1.90k|    (*donep)++;                           \
  |  |   47|  1.90k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 1.90k]
  |  |  ------------------
  ------------------
  853|       |
  854|       |  /* Write the number. */
  855|  2.07M|  while(++w <= workend) {
  ------------------
  |  Branch (855:9): [True: 1.54M, False: 528k]
  ------------------
  856|  1.54M|    OUTCHAR(*w);
  ------------------
  |  |   43|  1.54M|  do {                                    \
  |  |   44|  1.54M|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 4, False: 1.54M]
  |  |  ------------------
  |  |   45|  1.54M|      return TRUE;                        \
  |  |  ------------------
  |  |  |  | 1055|      4|#define TRUE true
  |  |  ------------------
  |  |   46|  1.54M|    (*donep)++;                           \
  |  |   47|  1.54M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 1.54M]
  |  |  ------------------
  ------------------
  857|  1.54M|  }
  858|       |
  859|   528k|  if(flags & FLAGS_LEFT)
  ------------------
  |  Branch (859:6): [True: 0, False: 528k]
  ------------------
  860|      0|    while(width-- > 0)
  ------------------
  |  Branch (860:11): [True: 0, False: 0]
  ------------------
  861|      0|      OUTCHAR(' ');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  862|       |
  863|   528k|  return FALSE;
  ------------------
  |  | 1058|   528k|#define FALSE false
  ------------------
  864|   528k|}
mprintf.c:out_string:
  873|  1.42M|{
  874|  1.42M|  int flags = p->flags;
  875|  1.42M|  int width = p->width;
  876|  1.42M|  int prec = p->prec;
  877|  1.42M|  size_t len;
  878|       |
  879|  1.42M|  if(!str) {
  ------------------
  |  Branch (879:6): [True: 592, False: 1.42M]
  ------------------
  880|       |    /* Write null string if there is space. */
  881|    592|    if(prec == -1 || prec >= (int)sizeof(nilstr) - 1) {
  ------------------
  |  Branch (881:8): [True: 592, False: 0]
  |  Branch (881:22): [True: 0, False: 0]
  ------------------
  882|    592|      str = nilstr;
  883|    592|      len = sizeof(nilstr) - 1;
  884|       |      /* Disable quotes around (nil) */
  885|    592|      flags &= ~(unsigned int)FLAGS_ALT;
  886|    592|    }
  887|      0|    else {
  888|      0|      str = "";
  889|      0|      len = 0;
  890|      0|    }
  891|    592|  }
  892|  1.42M|  else if(prec != -1)
  ------------------
  |  Branch (892:11): [True: 60.7k, False: 1.36M]
  ------------------
  893|  60.7k|    len = (size_t)prec;
  894|  1.36M|  else if(*str == '\0')
  ------------------
  |  Branch (894:11): [True: 971k, False: 392k]
  ------------------
  895|   971k|    len = 0;
  896|   392k|  else
  897|   392k|    len = strlen(str);
  898|       |
  899|  1.42M|  width -= (len > INT_MAX) ? INT_MAX : (int)len;
  ------------------
  |  Branch (899:12): [True: 0, False: 1.42M]
  ------------------
  900|       |
  901|  1.42M|  if(flags & FLAGS_ALT)
  ------------------
  |  Branch (901:6): [True: 0, False: 1.42M]
  ------------------
  902|      0|    OUTCHAR('"');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  903|       |
  904|  1.42M|  if(!(flags & FLAGS_LEFT))
  ------------------
  |  Branch (904:6): [True: 1.42M, False: 0]
  ------------------
  905|  1.42M|    while(width-- > 0)
  ------------------
  |  Branch (905:11): [True: 0, False: 1.42M]
  ------------------
  906|      0|      OUTCHAR(' ');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  907|       |
  908|  22.5M|  for(; len && *str; len--)
  ------------------
  |  Branch (908:9): [True: 21.1M, False: 1.42M]
  |  Branch (908:16): [True: 21.1M, False: 0]
  ------------------
  909|  21.1M|    OUTCHAR(*str++);
  ------------------
  |  |   43|  22.5M|  do {                                    \
  |  |   44|  21.1M|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 44, False: 21.1M]
  |  |  ------------------
  |  |   45|  21.1M|      return TRUE;                        \
  |  |  ------------------
  |  |  |  | 1055|     44|#define TRUE true
  |  |  ------------------
  |  |   46|  21.1M|    (*donep)++;                           \
  |  |   47|  21.1M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 21.1M]
  |  |  ------------------
  ------------------
  910|  1.42M|  if(flags & FLAGS_LEFT)
  ------------------
  |  Branch (910:6): [True: 0, False: 1.42M]
  ------------------
  911|      0|    while(width-- > 0)
  ------------------
  |  Branch (911:11): [True: 0, False: 0]
  ------------------
  912|      0|      OUTCHAR(' ');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  913|       |
  914|  1.42M|  if(flags & FLAGS_ALT)
  ------------------
  |  Branch (914:6): [True: 0, False: 1.42M]
  ------------------
  915|      0|    OUTCHAR('"');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  916|       |
  917|  1.42M|  return FALSE;
  ------------------
  |  | 1058|  1.42M|#define FALSE false
  ------------------
  918|  1.42M|}
mprintf.c:addbyter:
 1093|  2.01M|{
 1094|  2.01M|  struct nsprintf *infop = f;
 1095|  2.01M|  if(infop->length < infop->max) {
  ------------------
  |  Branch (1095:6): [True: 2.01M, False: 40]
  ------------------
 1096|       |    /* only do this if we have not reached max length yet */
 1097|  2.01M|    *infop->buffer++ = (char)outc; /* store */
 1098|  2.01M|    infop->length++; /* we are now one byte larger */
 1099|  2.01M|    return 0;     /* fputc() returns like this on success */
 1100|  2.01M|  }
 1101|     40|  return 1;
 1102|  2.01M|}
mprintf.c:alloc_addbyter:
 1141|  24.6M|{
 1142|  24.6M|  struct asprintf *infop = f;
 1143|  24.6M|  CURLcode result = curlx_dyn_addn(infop->b, &outc, 1);
 1144|  24.6M|  if(result) {
  ------------------
  |  Branch (1144:6): [True: 11, False: 24.6M]
  ------------------
 1145|     11|    infop->merr = result == CURLE_TOO_LARGE ? MERR_TOO_LARGE : MERR_MEM;
  ------------------
  |  |   29|     11|#define MERR_TOO_LARGE 2
  ------------------
                  infop->merr = result == CURLE_TOO_LARGE ? MERR_TOO_LARGE : MERR_MEM;
  ------------------
  |  |   28|     11|#define MERR_MEM       1
  ------------------
  |  Branch (1145:19): [True: 11, False: 0]
  ------------------
 1146|     11|    return 1; /* fail */
 1147|     11|  }
 1148|  24.6M|  return 0;
 1149|  24.6M|}
mprintf.c:fputc_wrapper:
 1214|  86.9k|{
 1215|  86.9k|  int out = outc;
 1216|  86.9k|  FILE *s = f;
 1217|  86.9k|  int rc = fputc(out, s);
 1218|       |  return rc == EOF;
 1219|  86.9k|}

Curl_multi_handle:
  232|  17.2k|{
  233|  17.2k|  struct Curl_multi *multi = curlx_calloc(1, sizeof(struct Curl_multi));
  ------------------
  |  | 1480|  17.2k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  234|       |
  235|  17.2k|  if(!multi)
  ------------------
  |  Branch (235:6): [True: 0, False: 17.2k]
  ------------------
  236|      0|    return NULL;
  237|       |
  238|  17.2k|  multi->magic = CURL_MULTI_HANDLE;
  ------------------
  |  |   75|  17.2k|#define CURL_MULTI_HANDLE 0x000bab1e
  ------------------
  239|       |
  240|  17.2k|  Curl_dnscache_init(&multi->dnscache, dnssize);
  241|  17.2k|  Curl_mntfy_init(multi);
  242|  17.2k|  Curl_multi_ev_init(multi, ev_hashsize);
  243|  17.2k|  Curl_uint32_tbl_init(&multi->xfers, NULL);
  244|  17.2k|  Curl_uint32_bset_init(&multi->process);
  245|  17.2k|  Curl_uint32_bset_init(&multi->dirty);
  246|  17.2k|  Curl_uint32_bset_init(&multi->pending);
  247|  17.2k|  Curl_uint32_bset_init(&multi->msgsent);
  248|  17.2k|  Curl_hash_init(&multi->proto_hash, 23,
  249|  17.2k|                 Curl_hash_str, curlx_str_key_compare, ph_freeentry);
  250|  17.2k|  Curl_llist_init(&multi->msglist, NULL);
  251|       |
  252|  17.2k|  multi->multiplexing = TRUE;
  ------------------
  |  | 1055|  17.2k|#define TRUE true
  ------------------
  253|  17.2k|  multi->max_concurrent_streams = 100;
  254|  17.2k|  multi->last_timeout_ms = -1;
  255|  17.2k|#ifdef ENABLE_WAKEUP
  256|  17.2k|  multi->wakeup_pair[0] = CURL_SOCKET_BAD;
  ------------------
  |  |  145|  17.2k|#define CURL_SOCKET_BAD (-1)
  ------------------
  257|  17.2k|  multi->wakeup_pair[1] = CURL_SOCKET_BAD;
  ------------------
  |  |  145|  17.2k|#define CURL_SOCKET_BAD (-1)
  ------------------
  258|  17.2k|#endif
  259|       |
  260|  17.2k|  if(Curl_mntfy_resize(multi) ||
  ------------------
  |  Branch (260:6): [True: 0, False: 17.2k]
  ------------------
  261|  17.2k|     Curl_uint32_bset_resize(&multi->process, xfer_table_size) ||
  ------------------
  |  Branch (261:6): [True: 0, False: 17.2k]
  ------------------
  262|  17.2k|     Curl_uint32_bset_resize(&multi->pending, xfer_table_size) ||
  ------------------
  |  Branch (262:6): [True: 0, False: 17.2k]
  ------------------
  263|  17.2k|     Curl_uint32_bset_resize(&multi->dirty, xfer_table_size) ||
  ------------------
  |  Branch (263:6): [True: 0, False: 17.2k]
  ------------------
  264|  17.2k|     Curl_uint32_bset_resize(&multi->msgsent, xfer_table_size) ||
  ------------------
  |  Branch (264:6): [True: 0, False: 17.2k]
  ------------------
  265|  17.2k|     Curl_uint32_tbl_resize(&multi->xfers, xfer_table_size))
  ------------------
  |  Branch (265:6): [True: 0, False: 17.2k]
  ------------------
  266|      0|    goto error;
  267|       |
  268|  17.2k|  multi->admin = curl_easy_init();
  269|  17.2k|  if(!multi->admin)
  ------------------
  |  Branch (269:6): [True: 0, False: 17.2k]
  ------------------
  270|      0|    goto error;
  271|       |  /* Initialize admin handle to operate inside this multi */
  272|  17.2k|  multi->admin->multi = multi;
  273|  17.2k|  multi->admin->state.internal = TRUE;
  ------------------
  |  | 1055|  17.2k|#define TRUE true
  ------------------
  274|  17.2k|  Curl_llist_init(&multi->admin->state.timeoutlist, NULL);
  275|       |
  276|  17.2k|#ifdef DEBUGBUILD
  277|  17.2k|  if(getenv("CURL_DEBUG"))
  ------------------
  |  Branch (277:6): [True: 0, False: 17.2k]
  ------------------
  278|      0|    multi->admin->set.verbose = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  279|  17.2k|#endif
  280|  17.2k|  Curl_uint32_tbl_add(&multi->xfers, multi->admin, &multi->admin->mid);
  281|  17.2k|  Curl_uint32_bset_add(&multi->process, multi->admin->mid);
  282|       |
  283|  17.2k|  if(Curl_cshutdn_init(&multi->cshutdn, multi))
  ------------------
  |  Branch (283:6): [True: 0, False: 17.2k]
  ------------------
  284|      0|    goto error;
  285|       |
  286|  17.2k|  Curl_cpool_init(&multi->cpool, multi->admin, NULL, chashsize);
  287|       |
  288|  17.2k|#ifdef USE_SSL
  289|  17.2k|  if(Curl_ssl_scache_create(sesssize, 2, &multi->ssl_scache))
  ------------------
  |  Branch (289:6): [True: 0, False: 17.2k]
  ------------------
  290|      0|    goto error;
  291|       |#else
  292|       |  (void)sesssize;
  293|       |#endif
  294|       |
  295|       |#ifdef USE_WINSOCK
  296|       |  multi->wsa_event = WSACreateEvent();
  297|       |  if(multi->wsa_event == WSA_INVALID_EVENT)
  298|       |    goto error;
  299|       |#endif
  300|  17.2k|#ifdef ENABLE_WAKEUP
  301|       |  /* When enabled, rely on this to work. We ignore this in previous
  302|       |   * versions, but that seems an unnecessary complication. */
  303|  17.2k|  if(Curl_wakeup_init(multi->wakeup_pair, TRUE) < 0)
  ------------------
  |  | 1055|  17.2k|#define TRUE true
  ------------------
  |  Branch (303:6): [True: 0, False: 17.2k]
  ------------------
  304|      0|    goto error;
  305|  17.2k|#endif
  306|       |
  307|  17.2k|  if(Curl_probeipv6(multi))
  ------------------
  |  Branch (307:6): [True: 0, False: 17.2k]
  ------------------
  308|      0|    goto error;
  309|       |
  310|  17.2k|#ifdef USE_RESOLV_THREADED
  311|  17.2k|  if(xfer_table_size < CURL_XFER_TABLE_SIZE) { /* easy multi */
  ------------------
  |  |   52|  17.2k|#define CURL_XFER_TABLE_SIZE 512
  ------------------
  |  Branch (311:6): [True: 0, False: 17.2k]
  ------------------
  312|      0|    if(Curl_async_thrdd_multi_init(multi, 0, 2, 10))
  ------------------
  |  Branch (312:8): [True: 0, False: 0]
  ------------------
  313|      0|      goto error;
  314|      0|  }
  315|  17.2k|  else { /* real multi handle */
  316|  17.2k|    if(Curl_async_thrdd_multi_init(multi, 0, 20, 2000))
  ------------------
  |  Branch (316:8): [True: 0, False: 17.2k]
  ------------------
  317|      0|      goto error;
  318|  17.2k|  }
  319|  17.2k|#endif
  320|       |
  321|  17.2k|  return multi;
  322|       |
  323|      0|error:
  324|       |
  325|      0|#ifdef USE_RESOLV_THREADED
  326|      0|  Curl_async_thrdd_multi_destroy(multi, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  327|      0|#endif
  328|      0|  Curl_multi_ev_cleanup(multi);
  329|      0|  Curl_hash_destroy(&multi->proto_hash);
  330|      0|  Curl_dnscache_destroy(&multi->dnscache);
  331|      0|  Curl_cpool_destroy(&multi->cpool);
  332|      0|  Curl_cshutdn_destroy(&multi->cshutdn, multi->admin);
  333|      0|#ifdef USE_SSL
  334|      0|  Curl_ssl_scache_destroy(multi->ssl_scache);
  335|      0|#endif
  336|      0|  if(multi->admin) {
  ------------------
  |  Branch (336:6): [True: 0, False: 0]
  ------------------
  337|      0|    Curl_multi_ev_xfer_done(multi, multi->admin);
  338|      0|    multi->admin->multi = NULL;
  339|      0|    Curl_close(&multi->admin);
  340|      0|  }
  341|      0|  Curl_mntfy_cleanup(multi);
  342|       |
  343|      0|  Curl_uint32_bset_destroy(&multi->process);
  344|      0|  Curl_uint32_bset_destroy(&multi->dirty);
  345|      0|  Curl_uint32_bset_destroy(&multi->pending);
  346|      0|  Curl_uint32_bset_destroy(&multi->msgsent);
  347|      0|  Curl_uint32_tbl_destroy(&multi->xfers);
  348|      0|#ifdef ENABLE_WAKEUP
  349|      0|  Curl_wakeup_destroy(multi->wakeup_pair);
  350|      0|#endif
  351|       |
  352|      0|  curlx_free(multi);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  353|       |  return NULL;
  354|  17.2k|}
curl_multi_init:
  357|  17.2k|{
  358|  17.2k|  return Curl_multi_handle(CURL_XFER_TABLE_SIZE,
  ------------------
  |  |   52|  17.2k|#define CURL_XFER_TABLE_SIZE 512
  ------------------
  359|  17.2k|                           CURL_SOCKET_HASH_TABLE_SIZE,
  ------------------
  |  |   60|  17.2k|#define CURL_SOCKET_HASH_TABLE_SIZE 911
  ------------------
  360|  17.2k|                           CURL_CONNECTION_HASH_SIZE,
  ------------------
  |  |   64|  17.2k|#define CURL_CONNECTION_HASH_SIZE 97
  ------------------
  361|  17.2k|                           CURL_DNS_HASH_SIZE,
  ------------------
  |  |   68|  17.2k|#define CURL_DNS_HASH_SIZE 71
  ------------------
  362|  17.2k|                           CURL_TLS_SESSION_SIZE);
  ------------------
  |  |   72|  17.2k|#define CURL_TLS_SESSION_SIZE 25
  ------------------
  363|  17.2k|}
Curl_is_connecting:
  380|  7.26M|{
  381|  7.26M|  return data->mstate < MSTATE_DO;
  382|  7.26M|}
curl_multi_add_handle:
  455|  17.8k|{
  456|  17.8k|  CURLMcode mresult;
  457|  17.8k|  struct Curl_multi *multi = m;
  458|  17.8k|  struct Curl_easy *data = curl;
  459|       |
  460|       |  /* First, make some basic checks that the CURLM handle is a good handle */
  461|  17.8k|  if(!GOOD_MULTI_HANDLE(multi))
  ------------------
  |  |   82|  17.8k|  (((x) && (x)->magic == CURL_MULTI_HANDLE) ? TRUE : \
  |  |  ------------------
  |  |  |  |   75|  17.8k|#define CURL_MULTI_HANDLE 0x000bab1e
  |  |  ------------------
  |  |                 (((x) && (x)->magic == CURL_MULTI_HANDLE) ? TRUE : \
  |  |  ------------------
  |  |  |  | 1055|  17.8k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (82:5): [True: 17.8k, False: 0]
  |  |  |  Branch (82:12): [True: 17.8k, False: 0]
  |  |  ------------------
  |  |   83|  17.8k|  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                 (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (461:6): [True: 0, False: 17.8k]
  |  Branch (461:7): [True: 0, False: 0]
  |  Branch (461:7): [True: 0, False: 0]
  ------------------
  462|      0|    return CURLM_BAD_HANDLE;
  463|       |
  464|       |  /* Verify that we got a somewhat good easy handle too */
  465|  17.8k|  if(!GOOD_EASY_HANDLE(data))
  ------------------
  |  |  136|  17.8k|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  130|  17.8k|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  | 1055|  17.8k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (136:5): [True: 17.8k, False: 0]
  |  |  |  Branch (136:12): [True: 17.8k, False: 0]
  |  |  ------------------
  |  |  137|  17.8k|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (465:6): [True: 0, False: 17.8k]
  |  Branch (465:7): [True: 0, False: 0]
  |  Branch (465:7): [True: 0, False: 0]
  ------------------
  466|      0|    return CURLM_BAD_EASY_HANDLE;
  467|       |
  468|       |  /* Prevent users from adding same easy handle more than once and prevent
  469|       |     adding to more than one multi stack */
  470|  17.8k|  if(data->multi)
  ------------------
  |  Branch (470:6): [True: 0, False: 17.8k]
  ------------------
  471|      0|    return CURLM_ADDED_ALREADY;
  472|       |
  473|  17.8k|  if(multi->in_callback)
  ------------------
  |  Branch (473:6): [True: 0, False: 17.8k]
  ------------------
  474|      0|    return CURLM_RECURSIVE_API_CALL;
  475|       |
  476|  17.8k|  if(multi->dead) {
  ------------------
  |  Branch (476:6): [True: 0, False: 17.8k]
  ------------------
  477|       |    /* a "dead" handle cannot get added transfers while any existing easy
  478|       |       handles are still alive - but if there are none alive anymore, it is
  479|       |       fine to start over and unmark the "deadness" of this handle.
  480|       |       This means only the admin handle MUST be present. */
  481|      0|    if((Curl_uint32_tbl_count(&multi->xfers) != 1) ||
  ------------------
  |  Branch (481:8): [True: 0, False: 0]
  ------------------
  482|      0|       !Curl_uint32_tbl_contains(&multi->xfers, 0))
  ------------------
  |  Branch (482:8): [True: 0, False: 0]
  ------------------
  483|      0|      return CURLM_ABORTED_BY_CALLBACK;
  484|      0|    multi->dead = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  485|      0|    Curl_uint32_bset_clear(&multi->process);
  486|      0|    Curl_uint32_bset_clear(&multi->dirty);
  487|      0|    Curl_uint32_bset_clear(&multi->pending);
  488|      0|    Curl_uint32_bset_clear(&multi->msgsent);
  489|      0|  }
  490|       |
  491|  17.8k|  if(data->multi_easy) {
  ------------------
  |  Branch (491:6): [True: 0, False: 17.8k]
  ------------------
  492|       |    /* if this easy handle was previously used for curl_easy_perform(), there
  493|       |       is a private multi handle here that we can kill */
  494|      0|    curl_multi_cleanup(data->multi_easy);
  495|      0|    data->multi_easy = NULL;
  496|      0|  }
  497|       |
  498|       |  /* Insert the easy into the multi->xfers table, assigning it a `mid`. */
  499|  17.8k|  if(multi_xfers_add(multi, data))
  ------------------
  |  Branch (499:6): [True: 0, False: 17.8k]
  ------------------
  500|      0|    return CURLM_OUT_OF_MEMORY;
  501|       |
  502|       |  /* Initialize timeout list for this handle */
  503|  17.8k|  Curl_llist_init(&data->state.timeoutlist, NULL);
  504|       |
  505|       |  /*
  506|       |   * No failure allowed in this function beyond this point. No modification of
  507|       |   * easy nor multi handle allowed before this except for potential multi's
  508|       |   * connection pool growing which will not be undone in this function no
  509|       |   * matter what.
  510|       |   */
  511|  17.8k|  if(data->set.errorbuffer)
  ------------------
  |  Branch (511:6): [True: 0, False: 17.8k]
  ------------------
  512|      0|    data->set.errorbuffer[0] = 0;
  513|       |
  514|  17.8k|  data->state.os_errno = 0;
  515|       |
  516|       |  /* make the Curl_easy refer back to this multi handle - before Curl_expire()
  517|       |     is called. */
  518|  17.8k|  data->multi = multi;
  519|       |
  520|       |  /* set the easy handle */
  521|  17.8k|  multistate(data, MSTATE_INIT);
  ------------------
  |  |  200|  17.8k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
  522|       |
  523|       |#ifdef USE_LIBPSL
  524|       |  /* Do the same for PSL. */
  525|       |  if(data->share && (data->share->specifier & (1 << CURL_LOCK_DATA_PSL)))
  526|       |    data->psl = &data->share->psl;
  527|       |  else
  528|       |    data->psl = &multi->psl;
  529|       |#endif
  530|       |
  531|       |  /* add the easy handle to the process set */
  532|  17.8k|  Curl_uint32_bset_add(&multi->process, data->mid);
  533|  17.8k|  ++multi->xfers_alive;
  534|  17.8k|  ++multi->xfers_total_ever;
  535|       |
  536|  17.8k|  Curl_cpool_xfer_init(data);
  537|  17.8k|  multi_warn_debug(multi, data);
  538|       |
  539|       |  /* Make sure the new handle will run */
  540|  17.8k|  Curl_multi_mark_dirty(data);
  541|       |
  542|       |  /* Necessary in event based processing, where dirty handles trigger
  543|       |   * a timeout callback invocation. */
  544|  17.8k|  mresult = Curl_update_timer(multi);
  545|  17.8k|  if(mresult) {
  ------------------
  |  Branch (545:6): [True: 0, False: 17.8k]
  ------------------
  546|      0|    data->multi = NULL; /* not anymore */
  547|      0|    Curl_uint32_tbl_remove(&multi->xfers, data->mid);
  548|      0|    data->mid = UINT32_MAX;
  549|      0|    return mresult;
  550|      0|  }
  551|       |
  552|       |  /* The admin handle only ever has default timeouts set. To improve the
  553|       |     state somewhat we clone the timeouts from each added handle so that the
  554|       |     admin handle always has the same timeouts as the most recently added
  555|       |     easy handle. */
  556|  17.8k|  multi->admin->set.timeout = data->set.timeout;
  557|  17.8k|  multi->admin->set.server_response_timeout =
  558|  17.8k|    data->set.server_response_timeout;
  559|  17.8k|  multi->admin->set.no_signal = data->set.no_signal;
  560|       |
  561|  17.8k|  mresult = multi_assess_wakeup(multi);
  562|  17.8k|  if(mresult) {
  ------------------
  |  Branch (562:6): [True: 0, False: 17.8k]
  ------------------
  563|      0|    failf(data, "error enabling wakeup listening: %d", mresult);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  564|      0|    return mresult;
  565|      0|  }
  566|       |
  567|  17.8k|  CURL_TRC_M(data, "added to multi, mid=%u, running=%u, total=%u",
  ------------------
  |  |  148|  17.8k|  do {                                   \
  |  |  149|  17.8k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  17.8k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  17.8k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  35.6k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 17.8k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 17.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  35.6k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  17.8k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  17.8k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  17.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 17.8k]
  |  |  ------------------
  ------------------
  568|  17.8k|             data->mid, Curl_multi_xfers_running(multi),
  569|  17.8k|             Curl_uint32_tbl_count(&multi->xfers));
  570|  17.8k|  return CURLM_OK;
  571|  17.8k|}
curl_multi_remove_handle:
  777|  17.8k|{
  778|  17.8k|  struct Curl_multi *multi = m;
  779|  17.8k|  struct Curl_easy *data = curl;
  780|  17.8k|  bool premature;
  781|  17.8k|  struct Curl_llist_node *e;
  782|  17.8k|  CURLMcode mresult;
  783|  17.8k|  uint32_t mid;
  784|       |
  785|       |  /* First, make some basic checks that the CURLM handle is a good handle */
  786|  17.8k|  if(!GOOD_MULTI_HANDLE(multi))
  ------------------
  |  |   82|  17.8k|  (((x) && (x)->magic == CURL_MULTI_HANDLE) ? TRUE : \
  |  |  ------------------
  |  |  |  |   75|  17.8k|#define CURL_MULTI_HANDLE 0x000bab1e
  |  |  ------------------
  |  |                 (((x) && (x)->magic == CURL_MULTI_HANDLE) ? TRUE : \
  |  |  ------------------
  |  |  |  | 1055|  17.8k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (82:5): [True: 17.8k, False: 0]
  |  |  |  Branch (82:12): [True: 17.8k, False: 0]
  |  |  ------------------
  |  |   83|  17.8k|  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                 (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (786:6): [True: 0, False: 17.8k]
  |  Branch (786:7): [True: 0, False: 0]
  |  Branch (786:7): [True: 0, False: 0]
  ------------------
  787|      0|    return CURLM_BAD_HANDLE;
  788|       |
  789|       |  /* Verify that we got a somewhat good easy handle too */
  790|  17.8k|  if(!GOOD_EASY_HANDLE(data))
  ------------------
  |  |  136|  17.8k|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  130|  17.8k|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  | 1055|  17.8k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (136:5): [True: 17.8k, False: 0]
  |  |  |  Branch (136:12): [True: 17.8k, False: 0]
  |  |  ------------------
  |  |  137|  17.8k|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (790:6): [True: 0, False: 17.8k]
  |  Branch (790:7): [True: 0, False: 0]
  |  Branch (790:7): [True: 0, False: 0]
  ------------------
  791|      0|    return CURLM_BAD_EASY_HANDLE;
  792|       |
  793|       |  /* Prevent users from trying to remove same easy handle more than once */
  794|  17.8k|  if(!data->multi)
  ------------------
  |  Branch (794:6): [True: 0, False: 17.8k]
  ------------------
  795|      0|    return CURLM_OK; /* it is already removed so let's say it is fine! */
  796|       |
  797|       |  /* Prevent users from trying to remove an easy handle from the wrong multi */
  798|  17.8k|  if(data->multi != multi)
  ------------------
  |  Branch (798:6): [True: 0, False: 17.8k]
  ------------------
  799|      0|    return CURLM_BAD_EASY_HANDLE;
  800|       |
  801|  17.8k|  if(data->mid == UINT32_MAX) {
  ------------------
  |  Branch (801:6): [True: 0, False: 17.8k]
  ------------------
  802|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (802:5): [Folded, False: 0]
  |  Branch (802:5): [Folded, False: 0]
  ------------------
  803|      0|    return CURLM_INTERNAL_ERROR;
  804|      0|  }
  805|  17.8k|  if(Curl_uint32_tbl_get(&multi->xfers, data->mid) != data) {
  ------------------
  |  Branch (805:6): [True: 0, False: 17.8k]
  ------------------
  806|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (806:5): [Folded, False: 0]
  |  Branch (806:5): [Folded, False: 0]
  ------------------
  807|      0|    return CURLM_INTERNAL_ERROR;
  808|      0|  }
  809|       |
  810|  17.8k|  if(multi->in_callback)
  ------------------
  |  Branch (810:6): [True: 0, False: 17.8k]
  ------------------
  811|      0|    return CURLM_RECURSIVE_API_CALL;
  812|       |
  813|  17.8k|  premature = (data->mstate < MSTATE_COMPLETED);
  814|       |
  815|       |  /* If the 'state' is not INIT or COMPLETED, we might need to do something
  816|       |     nice to put the easy_handle in a good known state when this returns. */
  817|  17.8k|  if(data->conn &&
  ------------------
  |  Branch (817:6): [True: 441, False: 17.4k]
  ------------------
  818|    441|     data->mstate > MSTATE_DO &&
  ------------------
  |  Branch (818:6): [True: 189, False: 252]
  ------------------
  819|    189|     data->mstate < MSTATE_COMPLETED) {
  ------------------
  |  Branch (819:6): [True: 189, False: 0]
  ------------------
  820|       |    /* Set connection owner so that the DONE function closes it. We can
  821|       |       safely do this here since connection is killed. */
  822|    189|    streamclose(data->conn, "Removed with partial response");
  ------------------
  |  |  102|    189|#define streamclose(x, y) Curl_conncontrol(x, CONNCTRL_STREAM, y)
  |  |  ------------------
  |  |  |  |   92|    189|#define CONNCTRL_STREAM     2
  |  |  ------------------
  ------------------
  823|    189|  }
  824|       |
  825|  17.8k|  if(data->conn) {
  ------------------
  |  Branch (825:6): [True: 441, False: 17.4k]
  ------------------
  826|       |    /* multi_done() clears the association between the easy handle and the
  827|       |       connection.
  828|       |
  829|       |       Note that this ignores the return code because there is
  830|       |       nothing really useful to do with it anyway! */
  831|    441|    (void)multi_done(data, data->result, premature);
  832|    441|  }
  833|       |
  834|       |  /* The timer must be shut down before data->multi is set to NULL, else the
  835|       |     timenode will remain in the splay tree after curl_easy_cleanup is
  836|       |     called. Do it after multi_done() in case that sets another time! */
  837|  17.8k|  Curl_expire_clear(data);
  838|       |
  839|       |  /* If in `msgsent`, it was deducted from `multi->xfers_alive` already. */
  840|  17.8k|  if(!Curl_uint32_bset_contains(&multi->msgsent, data->mid))
  ------------------
  |  Branch (840:6): [True: 541, False: 17.3k]
  ------------------
  841|    541|    --multi->xfers_alive;
  842|       |
  843|  17.8k|  Curl_wildcard_dtor(&data->wildcard);
  844|       |
  845|  17.8k|  data->mstate = MSTATE_COMPLETED;
  846|       |
  847|       |  /* Remove the association between the connection and the handle */
  848|  17.8k|  Curl_detach_connection(data);
  849|       |
  850|       |  /* Tell event handling that this transfer is definitely going away */
  851|  17.8k|  Curl_multi_ev_xfer_done(multi, data);
  852|       |
  853|  17.8k|  if(data->set.connect_only && !data->multi_easy) {
  ------------------
  |  Branch (853:6): [True: 68, False: 17.7k]
  |  Branch (853:32): [True: 68, False: 0]
  ------------------
  854|       |    /* This removes a handle that was part the multi interface that used
  855|       |       CONNECT_ONLY, that connection is now left alive but since this handle
  856|       |       has bits.close set nothing can use that transfer anymore and it is
  857|       |       forbidden from reuse. This easy handle cannot find the connection
  858|       |       anymore once removed from the multi handle
  859|       |
  860|       |       Better close the connection here, at once.
  861|       |    */
  862|     68|    struct connectdata *c;
  863|     68|    curl_socket_t s;
  864|     68|    s = Curl_getconnectinfo(data, &c);
  865|     68|    if((s != CURL_SOCKET_BAD) && c) {
  ------------------
  |  |  145|     68|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (865:8): [True: 53, False: 15]
  |  Branch (865:34): [True: 53, False: 0]
  ------------------
  866|     53|      Curl_conn_terminate(data, c, TRUE);
  ------------------
  |  | 1055|     53|#define TRUE true
  ------------------
  867|     53|    }
  868|     68|  }
  869|       |
  870|  17.8k|  if(data->state.lastconnect_id != -1) {
  ------------------
  |  Branch (870:6): [True: 2.33k, False: 15.5k]
  ------------------
  871|       |    /* Mark any connect-only connection for closure */
  872|  2.33k|    Curl_cpool_do_by_id(data, data->state.lastconnect_id,
  873|  2.33k|                        close_connect_only, NULL);
  874|  2.33k|  }
  875|       |
  876|       |#ifdef USE_LIBPSL
  877|       |  /* Remove the PSL association. */
  878|       |  if(data->psl == &multi->psl)
  879|       |    data->psl = NULL;
  880|       |#endif
  881|       |
  882|       |  /* make sure there is no pending message in the queue sent from this easy
  883|       |     handle */
  884|  17.8k|  for(e = Curl_llist_head(&multi->msglist); e; e = Curl_node_next(e)) {
  ------------------
  |  Branch (884:45): [True: 16.8k, False: 987]
  ------------------
  885|  16.8k|    struct Curl_message *msg = Curl_node_elem(e);
  886|       |
  887|  16.8k|    if(msg->extmsg.easy_handle == data) {
  ------------------
  |  Branch (887:8): [True: 16.8k, False: 0]
  ------------------
  888|  16.8k|      Curl_node_remove(e);
  889|       |      /* there can only be one from this specific handle */
  890|  16.8k|      break;
  891|  16.8k|    }
  892|  16.8k|  }
  893|       |
  894|       |  /* clear the association to this multi handle */
  895|  17.8k|  mid = data->mid;
  896|  17.8k|  DEBUGASSERT(Curl_uint32_tbl_contains(&multi->xfers, mid));
  ------------------
  |  | 1081|  17.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (896:3): [True: 0, False: 17.8k]
  |  Branch (896:3): [True: 17.8k, False: 0]
  ------------------
  897|  17.8k|  Curl_uint32_tbl_remove(&multi->xfers, mid);
  898|  17.8k|  Curl_uint32_bset_remove(&multi->process, mid);
  899|  17.8k|  Curl_uint32_bset_remove(&multi->dirty, mid);
  900|  17.8k|  Curl_uint32_bset_remove(&multi->pending, mid);
  901|  17.8k|  Curl_uint32_bset_remove(&multi->msgsent, mid);
  902|  17.8k|  data->multi = NULL;
  903|  17.8k|  data->mid = UINT32_MAX;
  904|  17.8k|  data->master_mid = UINT32_MAX;
  905|       |
  906|       |  /* NOTE NOTE NOTE
  907|       |     We do not touch the easy handle here! */
  908|  17.8k|  process_pending_handles(multi);
  909|       |
  910|  17.8k|  mresult = Curl_update_timer(multi);
  911|  17.8k|  if(mresult)
  ------------------
  |  Branch (911:6): [True: 0, False: 17.8k]
  ------------------
  912|      0|    return mresult;
  913|       |
  914|  17.8k|  mresult = multi_assess_wakeup(multi);
  915|  17.8k|  if(mresult) {
  ------------------
  |  Branch (915:6): [True: 0, False: 17.8k]
  ------------------
  916|      0|    failf(data, "error enabling wakeup listening: %d", mresult);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  917|      0|    return mresult;
  918|      0|  }
  919|       |
  920|  17.8k|  CURL_TRC_M(data, "removed from multi, mid=%u, running=%u, total=%u",
  ------------------
  |  |  148|  17.8k|  do {                                   \
  |  |  149|  17.8k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  17.8k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  17.8k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  35.6k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 17.8k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 17.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  35.6k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  17.8k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  17.8k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  17.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 17.8k]
  |  |  ------------------
  ------------------
  921|  17.8k|             mid, Curl_multi_xfers_running(multi),
  922|  17.8k|             Curl_uint32_tbl_count(&multi->xfers));
  923|  17.8k|  return CURLM_OK;
  924|  17.8k|}
Curl_multiplex_wanted:
  928|  9.08k|{
  929|  9.08k|  return multi && multi->multiplexing;
  ------------------
  |  Branch (929:10): [True: 9.08k, False: 0]
  |  Branch (929:19): [True: 9.08k, False: 0]
  ------------------
  930|  9.08k|}
Curl_detach_connection:
  939|   103k|{
  940|   103k|  struct connectdata *conn = data->conn;
  941|   103k|  if(conn) {
  ------------------
  |  Branch (941:6): [True: 31.7k, False: 71.7k]
  ------------------
  942|       |    /* this should never happen, prevent underflow */
  943|  31.7k|    DEBUGASSERT(conn->attached_xfers);
  ------------------
  |  | 1081|  31.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (943:5): [True: 0, False: 31.7k]
  |  Branch (943:5): [True: 31.7k, False: 0]
  ------------------
  944|  31.7k|    if(conn->attached_xfers) {
  ------------------
  |  Branch (944:8): [True: 31.7k, False: 0]
  ------------------
  945|  31.7k|      conn->attached_xfers--;
  946|  31.7k|      if(!conn->attached_xfers)
  ------------------
  |  Branch (946:10): [True: 31.7k, False: 0]
  ------------------
  947|  31.7k|        conn->attached_multi = NULL;
  948|  31.7k|    }
  949|  31.7k|  }
  950|   103k|  data->conn = NULL;
  951|   103k|}
Curl_attach_connection:
  960|  31.7k|{
  961|  31.7k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  31.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (961:3): [True: 0, False: 31.7k]
  |  Branch (961:3): [True: 31.7k, False: 0]
  ------------------
  962|  31.7k|  DEBUGASSERT(!data->conn);
  ------------------
  |  | 1081|  31.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (962:3): [True: 0, False: 31.7k]
  |  Branch (962:3): [True: 31.7k, False: 0]
  ------------------
  963|  31.7k|  DEBUGASSERT(conn);
  ------------------
  |  | 1081|  31.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (963:3): [True: 0, False: 31.7k]
  |  Branch (963:3): [True: 31.7k, False: 0]
  ------------------
  964|  31.7k|  DEBUGASSERT(conn->attached_xfers < UINT32_MAX);
  ------------------
  |  | 1081|  31.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (964:3): [True: 0, False: 31.7k]
  |  Branch (964:3): [True: 31.7k, False: 0]
  ------------------
  965|  31.7k|  data->conn = conn;
  966|  31.7k|  conn->attached_xfers++;
  967|       |  /* all attached transfers must be from the same multi */
  968|  31.7k|  if(!conn->attached_multi)
  ------------------
  |  Branch (968:6): [True: 31.7k, False: 0]
  ------------------
  969|  31.7k|    conn->attached_multi = data->multi;
  970|  31.7k|  DEBUGASSERT(conn->attached_multi == data->multi);
  ------------------
  |  | 1081|  31.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (970:3): [True: 0, False: 31.7k]
  |  Branch (970:3): [True: 31.7k, False: 0]
  ------------------
  971|       |
  972|  31.7k|  if(conn->scheme && conn->scheme->run->attach)
  ------------------
  |  Branch (972:6): [True: 31.7k, False: 0]
  |  Branch (972:22): [True: 0, False: 31.7k]
  ------------------
  973|      0|    conn->scheme->run->attach(data, conn);
  974|  31.7k|}
Curl_multi_pollset:
 1134|  7.07M|{
 1135|  7.07M|  CURLcode result = CURLE_OK;
 1136|       |
 1137|  7.07M|  Curl_pollset_reset(ps);
 1138|  7.07M|#ifdef ENABLE_WAKEUP
 1139|       |  /* The admin handle always listens on the wakeup socket when there
 1140|       |   * are transfers alive. */
 1141|  7.07M|  if(data->multi && (data == data->multi->admin) &&
  ------------------
  |  Branch (1141:6): [True: 7.07M, False: 0]
  |  Branch (1141:21): [True: 3.50M, False: 3.57M]
  ------------------
 1142|  3.50M|     data->multi->xfers_alive) {
  ------------------
  |  Branch (1142:6): [True: 3.50M, False: 0]
  ------------------
 1143|  3.50M|    result = Curl_pollset_add_in(data, ps, data->multi->wakeup_pair[0]);
  ------------------
  |  |  162|  3.50M|  Curl_pollset_change(data, ps, sock, CURL_POLL_IN, 0)
  |  |  ------------------
  |  |  |  |  283|  3.50M|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
 1144|  3.50M|  }
 1145|  7.07M|#endif
 1146|       |  /* If the transfer has no connection, this is fine. Happens when
 1147|       |     called via curl_multi_remove_handle() => Curl_multi_ev_assess() =>
 1148|       |     Curl_multi_pollset(). */
 1149|  7.07M|  if(!result && data->conn) {
  ------------------
  |  Branch (1149:6): [True: 7.07M, False: 0]
  |  Branch (1149:17): [True: 3.57M, False: 3.50M]
  ------------------
 1150|  3.57M|    switch(data->mstate) {
 1151|      0|    case MSTATE_INIT:
  ------------------
  |  Branch (1151:5): [True: 0, False: 3.57M]
  ------------------
 1152|      0|    case MSTATE_PENDING:
  ------------------
  |  Branch (1152:5): [True: 0, False: 3.57M]
  ------------------
 1153|      0|    case MSTATE_SETUP:
  ------------------
  |  Branch (1153:5): [True: 0, False: 3.57M]
  ------------------
 1154|      0|    case MSTATE_CONNECT:
  ------------------
  |  Branch (1154:5): [True: 0, False: 3.57M]
  ------------------
 1155|       |      /* nothing to poll for yet */
 1156|      0|      break;
 1157|       |
 1158|   150k|    case MSTATE_CONNECTING:
  ------------------
  |  Branch (1158:5): [True: 150k, False: 3.42M]
  ------------------
 1159|   150k|      if(data->conn && !data->conn->bits.dns_resolved)
  ------------------
  |  Branch (1159:10): [True: 150k, False: 0]
  |  Branch (1159:24): [True: 77.8k, False: 72.6k]
  ------------------
 1160|  77.8k|        result = Curl_resolv_pollset(data, ps);
 1161|   150k|      if(!result)
  ------------------
  |  Branch (1161:10): [True: 150k, False: 0]
  ------------------
 1162|   150k|        result = mstate_connecting_pollset(data, ps);
 1163|   150k|      break;
 1164|       |
 1165|      0|    case MSTATE_PROTOCONNECT:
  ------------------
  |  Branch (1165:5): [True: 0, False: 3.57M]
  ------------------
 1166|  6.06k|    case MSTATE_PROTOCONNECTING:
  ------------------
  |  Branch (1166:5): [True: 6.06k, False: 3.57M]
  ------------------
 1167|  6.06k|      result = mstate_protocol_pollset(data, ps);
 1168|  6.06k|      break;
 1169|       |
 1170|      0|    case MSTATE_DO:
  ------------------
  |  Branch (1170:5): [True: 0, False: 3.57M]
  ------------------
 1171|  1.14k|    case MSTATE_DOING:
  ------------------
  |  Branch (1171:5): [True: 1.14k, False: 3.57M]
  ------------------
 1172|  1.14k|      result = mstate_do_pollset(data, ps);
 1173|  1.14k|      break;
 1174|       |
 1175|   154k|    case MSTATE_DOING_MORE:
  ------------------
  |  Branch (1175:5): [True: 154k, False: 3.42M]
  ------------------
 1176|   154k|      result = mstate_domore_pollset(data, ps);
 1177|   154k|      break;
 1178|       |
 1179|      0|    case MSTATE_DID: /* same as PERFORMING in regard to polling */
  ------------------
  |  Branch (1179:5): [True: 0, False: 3.57M]
  ------------------
 1180|  3.26M|    case MSTATE_PERFORMING:
  ------------------
  |  Branch (1180:5): [True: 3.26M, False: 312k]
  ------------------
 1181|  3.26M|      result = mstate_perform_pollset(data, ps);
 1182|  3.26M|      break;
 1183|       |
 1184|    259|    case MSTATE_RATELIMITING:
  ------------------
  |  Branch (1184:5): [True: 259, False: 3.57M]
  ------------------
 1185|       |      /* we need to let time pass, ignore socket(s) */
 1186|    259|      break;
 1187|       |
 1188|      0|    case MSTATE_DONE:
  ------------------
  |  Branch (1188:5): [True: 0, False: 3.57M]
  ------------------
 1189|      0|    case MSTATE_COMPLETED:
  ------------------
  |  Branch (1189:5): [True: 0, False: 3.57M]
  ------------------
 1190|      0|    case MSTATE_MSGSENT:
  ------------------
  |  Branch (1190:5): [True: 0, False: 3.57M]
  ------------------
 1191|       |      /* nothing more to poll for */
 1192|      0|      break;
 1193|       |
 1194|      0|    default:
  ------------------
  |  Branch (1194:5): [True: 0, False: 3.57M]
  ------------------
 1195|      0|      failf(data, "multi_getsock: unexpected multi state %d", data->mstate);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1196|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1196:7): [Folded, False: 0]
  |  Branch (1196:7): [Folded, False: 0]
  ------------------
 1197|      0|      break;
 1198|  3.57M|    }
 1199|  3.57M|  }
 1200|       |
 1201|  7.07M|  if(result) {
  ------------------
  |  Branch (1201:6): [True: 0, False: 7.07M]
  ------------------
 1202|      0|    if(result == CURLE_OUT_OF_MEMORY)
  ------------------
  |  Branch (1202:8): [True: 0, False: 0]
  ------------------
 1203|      0|      return CURLM_OUT_OF_MEMORY;
 1204|      0|    failf(data, "error determining pollset: %d", result);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1205|      0|    return CURLM_INTERNAL_ERROR;
 1206|      0|  }
 1207|       |
 1208|  7.07M|#ifdef CURLVERBOSE
 1209|  7.07M|  if(CURL_TRC_M_is_verbose(data)) {
  ------------------
  |  |  135|  7.07M|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  ------------------
  |  |  |  |  326|  7.07M|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  14.1M|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 7.07M, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 7.07M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  14.1M|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  7.07M|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1210|      0|    size_t timeout_count = Curl_llist_count(&data->state.timeoutlist);
 1211|      0|    switch(ps->n) {
 1212|      0|    case 0:
  ------------------
  |  Branch (1212:5): [True: 0, False: 0]
  ------------------
 1213|      0|      CURL_TRC_M(data, "pollset[], timeouts=%zu, paused %d/%d (r/w)",
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1214|      0|                 timeout_count,
 1215|      0|                 Curl_xfer_send_is_paused(data),
 1216|      0|                 Curl_xfer_recv_is_paused(data));
 1217|      0|      break;
 1218|      0|    case 1:
  ------------------
  |  Branch (1218:5): [True: 0, False: 0]
  ------------------
 1219|      0|      CURL_TRC_M(data, "pollset[fd=%" FMT_SOCKET_T " %s%s], timeouts=%zu",
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1220|      0|                 ps->sockets[0],
 1221|      0|                 (ps->actions[0] & CURL_POLL_IN) ? "IN" : "",
 1222|      0|                 (ps->actions[0] & CURL_POLL_OUT) ? "OUT" : "",
 1223|      0|                 timeout_count);
 1224|      0|      break;
 1225|      0|    case 2:
  ------------------
  |  Branch (1225:5): [True: 0, False: 0]
  ------------------
 1226|      0|      CURL_TRC_M(data, "pollset[fd=%" FMT_SOCKET_T " %s%s, "
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1227|      0|                 "fd=%" FMT_SOCKET_T " %s%s], timeouts=%zu",
 1228|      0|                 ps->sockets[0],
 1229|      0|                 (ps->actions[0] & CURL_POLL_IN) ? "IN" : "",
 1230|      0|                 (ps->actions[0] & CURL_POLL_OUT) ? "OUT" : "",
 1231|      0|                 ps->sockets[1],
 1232|      0|                 (ps->actions[1] & CURL_POLL_IN) ? "IN" : "",
 1233|      0|                 (ps->actions[1] & CURL_POLL_OUT) ? "OUT" : "",
 1234|      0|                 timeout_count);
 1235|      0|      break;
 1236|      0|    default:
  ------------------
  |  Branch (1236:5): [True: 0, False: 0]
  ------------------
 1237|      0|      CURL_TRC_M(data, "pollset[fds=%u], timeouts=%zu", ps->n, timeout_count);
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1238|      0|      break;
 1239|      0|    }
 1240|      0|    CURL_TRC_EASY_TIMERS(data);
  ------------------
  |  |  330|      0|  do {                                  \
  |  |  331|      0|    if(CURL_TRC_TIMER_is_verbose(data)) \
  |  |  ------------------
  |  |  |  |  139|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_timer)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  332|      0|      Curl_trc_easy_timers(data);       \
  |  |  333|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (333:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1241|      0|  }
 1242|  7.07M|#endif
 1243|       |
 1244|  7.07M|  return CURLM_OK;
 1245|  7.07M|}
curl_multi_fdset:
 1250|  3.50M|{
 1251|       |  /* Scan through all the easy handles to get the file descriptors set.
 1252|       |     Some easy handles may not have connected to the remote host yet,
 1253|       |     and then we must make sure that is done. */
 1254|  3.50M|  int this_max_fd = -1;
 1255|  3.50M|  struct Curl_multi *multi = m;
 1256|  3.50M|  struct easy_pollset ps;
 1257|  3.50M|  unsigned int i;
 1258|  3.50M|  uint32_t mid;
 1259|  3.50M|  (void)exc_fd_set;
 1260|       |
 1261|  3.50M|  if(!GOOD_MULTI_HANDLE(multi))
  ------------------
  |  |   82|  3.50M|  (((x) && (x)->magic == CURL_MULTI_HANDLE) ? TRUE : \
  |  |  ------------------
  |  |  |  |   75|  3.50M|#define CURL_MULTI_HANDLE 0x000bab1e
  |  |  ------------------
  |  |                 (((x) && (x)->magic == CURL_MULTI_HANDLE) ? TRUE : \
  |  |  ------------------
  |  |  |  | 1055|  3.50M|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (82:5): [True: 3.50M, False: 0]
  |  |  |  Branch (82:12): [True: 3.50M, False: 0]
  |  |  ------------------
  |  |   83|  3.50M|  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                 (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (1261:6): [True: 0, False: 3.50M]
  |  Branch (1261:7): [True: 0, False: 0]
  |  Branch (1261:7): [True: 0, False: 0]
  ------------------
 1262|      0|    return CURLM_BAD_HANDLE;
 1263|       |
 1264|  3.50M|  if(multi->in_callback)
  ------------------
  |  Branch (1264:6): [True: 0, False: 3.50M]
  ------------------
 1265|      0|    return CURLM_RECURSIVE_API_CALL;
 1266|       |
 1267|  3.50M|  Curl_pollset_init(&ps);
 1268|  3.50M|  if(Curl_uint32_bset_first(&multi->process, &mid)) {
  ------------------
  |  Branch (1268:6): [True: 3.50M, False: 0]
  ------------------
 1269|  7.07M|    do {
 1270|  7.07M|      struct Curl_easy *data = Curl_multi_get_easy(multi, mid);
 1271|       |
 1272|  7.07M|      if(!data) {
  ------------------
  |  Branch (1272:10): [True: 0, False: 7.07M]
  ------------------
 1273|      0|        DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1273:9): [Folded, False: 0]
  |  Branch (1273:9): [Folded, False: 0]
  ------------------
 1274|      0|        continue;
 1275|      0|      }
 1276|       |
 1277|  7.07M|      Curl_multi_pollset(data, &ps);
 1278|  14.0M|      for(i = 0; i < ps.n; i++) {
  ------------------
  |  Branch (1278:18): [True: 7.00M, False: 7.07M]
  ------------------
 1279|  7.00M|        if(!FDSET_SOCK(ps.sockets[i]))
  ------------------
  |  |  101|  7.00M|#define FDSET_SOCK(s) ((s) < FD_SETSIZE)
  ------------------
  |  Branch (1279:12): [True: 0, False: 7.00M]
  ------------------
 1280|       |          /* pretend it does not exist */
 1281|      0|          continue;
 1282|  7.00M|        if(ps.actions[i] & CURL_POLL_IN)
  ------------------
  |  |  283|  7.00M|#define CURL_POLL_IN     1
  ------------------
  |  Branch (1282:12): [True: 7.00M, False: 127]
  ------------------
 1283|  7.00M|          FD_SET(ps.sockets[i], read_fd_set);
 1284|  7.00M|        if(ps.actions[i] & CURL_POLL_OUT)
  ------------------
  |  |  284|  7.00M|#define CURL_POLL_OUT    2
  ------------------
  |  Branch (1284:12): [True: 3.25M, False: 3.74M]
  ------------------
 1285|  7.00M|          FD_SET(ps.sockets[i], write_fd_set);
 1286|  7.00M|        if((int)ps.sockets[i] > this_max_fd)
  ------------------
  |  Branch (1286:12): [True: 7.00M, False: 0]
  ------------------
 1287|  7.00M|          this_max_fd = (int)ps.sockets[i];
 1288|  7.00M|      }
 1289|  7.07M|    } while(Curl_uint32_bset_next(&multi->process, mid, &mid));
  ------------------
  |  Branch (1289:13): [True: 3.57M, False: 3.50M]
  ------------------
 1290|  3.50M|  }
 1291|       |
 1292|  3.50M|  Curl_cshutdn_setfds(&multi->cshutdn, multi->admin,
 1293|  3.50M|                      read_fd_set, write_fd_set, &this_max_fd);
 1294|       |
 1295|  3.50M|  *max_fd = this_max_fd;
 1296|  3.50M|  Curl_pollset_cleanup(&ps);
 1297|       |
 1298|  3.50M|  return CURLM_OK;
 1299|  3.50M|}
curl_multi_wakeup:
 1675|    456|{
 1676|       |  /* this function is usually called from another thread,
 1677|       |     it has to be careful only to access parts of the
 1678|       |     Curl_multi struct that are constant */
 1679|    456|  struct Curl_multi *multi = m;
 1680|    456|  CURLMcode mresult = CURLM_WAKEUP_FAILURE;
 1681|       |
 1682|       |  /* GOOD_MULTI_HANDLE can be safely called */
 1683|    456|  if(!GOOD_MULTI_HANDLE(multi))
  ------------------
  |  |   82|    456|  (((x) && (x)->magic == CURL_MULTI_HANDLE) ? TRUE : \
  |  |  ------------------
  |  |  |  |   75|    456|#define CURL_MULTI_HANDLE 0x000bab1e
  |  |  ------------------
  |  |                 (((x) && (x)->magic == CURL_MULTI_HANDLE) ? TRUE : \
  |  |  ------------------
  |  |  |  | 1055|    456|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (82:5): [True: 456, False: 0]
  |  |  |  Branch (82:12): [True: 456, False: 0]
  |  |  ------------------
  |  |   83|    456|  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                 (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (1683:6): [True: 0, False: 456]
  |  Branch (1683:7): [True: 0, False: 0]
  |  Branch (1683:7): [True: 0, False: 0]
  ------------------
 1684|      0|    return CURLM_BAD_HANDLE;
 1685|       |
 1686|    456|#ifdef ENABLE_WAKEUP
 1687|       |  /* the wakeup_pair variable is only written during init and cleanup,
 1688|       |     making it safe to access from another thread after the init part
 1689|       |     and before cleanup */
 1690|    456|  if(!Curl_wakeup_signal(multi->wakeup_pair))
  ------------------
  |  Branch (1690:6): [True: 456, False: 0]
  ------------------
 1691|    456|    mresult = CURLM_OK;
 1692|    456|#endif
 1693|       |#ifdef USE_WINSOCK
 1694|       |  if(WSASetEvent(multi->wsa_event))
 1695|       |    mresult = CURLM_OK;
 1696|       |#endif
 1697|    456|  return mresult;
 1698|    456|}
Curl_multi_connchanged:
 1728|  21.9k|{
 1729|       |  multi->recheckstate = TRUE;
  ------------------
  |  | 1055|  21.9k|#define TRUE true
  ------------------
 1730|  21.9k|}
curl_multi_perform:
 2937|  3.51M|{
 2938|  3.51M|  struct Curl_multi *multi = m;
 2939|       |
 2940|  3.51M|  if(!GOOD_MULTI_HANDLE(multi))
  ------------------
  |  |   82|  3.51M|  (((x) && (x)->magic == CURL_MULTI_HANDLE) ? TRUE : \
  |  |  ------------------
  |  |  |  |   75|  3.51M|#define CURL_MULTI_HANDLE 0x000bab1e
  |  |  ------------------
  |  |                 (((x) && (x)->magic == CURL_MULTI_HANDLE) ? TRUE : \
  |  |  ------------------
  |  |  |  | 1055|  3.51M|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (82:5): [True: 3.51M, False: 0]
  |  |  |  Branch (82:12): [True: 3.51M, False: 0]
  |  |  ------------------
  |  |   83|  3.51M|  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                 (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (2940:6): [True: 0, False: 3.51M]
  |  Branch (2940:7): [True: 0, False: 0]
  |  Branch (2940:7): [True: 0, False: 0]
  ------------------
 2941|      0|    return CURLM_BAD_HANDLE;
 2942|       |
 2943|  3.51M|  return multi_perform(multi, running_handles);
 2944|  3.51M|}
curl_multi_cleanup:
 2947|  17.2k|{
 2948|  17.2k|  struct Curl_multi *multi = m;
 2949|  17.2k|  if(GOOD_MULTI_HANDLE(multi)) {
  ------------------
  |  |   82|  17.2k|  (((x) && (x)->magic == CURL_MULTI_HANDLE) ? TRUE : \
  |  |  ------------------
  |  |  |  |   75|  17.2k|#define CURL_MULTI_HANDLE 0x000bab1e
  |  |  ------------------
  |  |                 (((x) && (x)->magic == CURL_MULTI_HANDLE) ? TRUE : \
  |  |  ------------------
  |  |  |  | 1055|  17.2k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (82:3): [True: 17.2k, False: 0]
  |  |  |  Branch (82:5): [True: 17.2k, False: 0]
  |  |  |  Branch (82:12): [True: 17.2k, False: 0]
  |  |  ------------------
  |  |   83|  17.2k|  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                 (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (2949:6): [True: 0, False: 0]
  |  Branch (2949:6): [True: 0, False: 0]
  ------------------
 2950|  17.2k|    void *entry;
 2951|  17.2k|    uint32_t mid;
 2952|  17.2k|    if(multi->in_callback)
  ------------------
  |  Branch (2952:8): [True: 0, False: 17.2k]
  ------------------
 2953|      0|      return CURLM_RECURSIVE_API_CALL;
 2954|  17.2k|    if(multi->in_ntfy_callback)
  ------------------
  |  Branch (2954:8): [True: 0, False: 17.2k]
  ------------------
 2955|      0|      return CURLM_RECURSIVE_API_CALL;
 2956|       |
 2957|       |    /* First remove all remaining easy handles,
 2958|       |     * close internal ones. admin handle is special */
 2959|  17.2k|    if(Curl_uint32_tbl_first(&multi->xfers, &mid, &entry)) {
  ------------------
  |  Branch (2959:8): [True: 17.2k, False: 0]
  ------------------
 2960|  17.2k|      do {
 2961|  17.2k|        struct Curl_easy *data = entry;
 2962|  17.2k|        if(!GOOD_EASY_HANDLE(data))
  ------------------
  |  |  136|  17.2k|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  130|  17.2k|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  | 1055|  17.2k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (136:5): [True: 17.2k, False: 0]
  |  |  |  Branch (136:12): [True: 17.2k, False: 0]
  |  |  ------------------
  |  |  137|  17.2k|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (2962:12): [True: 0, False: 17.2k]
  |  Branch (2962:13): [True: 0, False: 0]
  |  Branch (2962:13): [True: 0, False: 0]
  ------------------
 2963|      0|          return CURLM_BAD_HANDLE;
 2964|       |
 2965|  17.2k|#ifdef DEBUGBUILD
 2966|  17.2k|        if(mid != data->mid) {
  ------------------
  |  Branch (2966:12): [True: 0, False: 17.2k]
  ------------------
 2967|      0|          CURL_TRC_M(data, "multi_cleanup: still present with mid=%u, "
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2968|      0|                     "but unexpected data->mid=%u\n", mid, data->mid);
 2969|      0|          DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2969:11): [Folded, False: 0]
  |  Branch (2969:11): [Folded, False: 0]
  ------------------
 2970|      0|        }
 2971|  17.2k|#endif
 2972|       |
 2973|  17.2k|        if(data == multi->admin)
  ------------------
  |  Branch (2973:12): [True: 17.2k, False: 0]
  ------------------
 2974|  17.2k|          continue;
 2975|       |
 2976|      0|        if(!data->state.done && data->conn)
  ------------------
  |  Branch (2976:12): [True: 0, False: 0]
  |  Branch (2976:33): [True: 0, False: 0]
  ------------------
 2977|       |          /* if DONE was never called for this handle */
 2978|      0|          (void)multi_done(data, CURLE_OK, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2979|       |
 2980|      0|        data->multi = NULL; /* clear the association */
 2981|      0|        Curl_uint32_tbl_remove(&multi->xfers, mid);
 2982|      0|        data->mid = UINT32_MAX;
 2983|       |
 2984|       |#ifdef USE_LIBPSL
 2985|       |        if(data->psl == &multi->psl)
 2986|       |          data->psl = NULL;
 2987|       |#endif
 2988|      0|        if(data->state.internal)
  ------------------
  |  Branch (2988:12): [True: 0, False: 0]
  ------------------
 2989|      0|          Curl_close(&data);
 2990|  17.2k|      } while(Curl_uint32_tbl_next(&multi->xfers, mid, &mid, &entry));
  ------------------
  |  Branch (2990:15): [True: 0, False: 17.2k]
  ------------------
 2991|  17.2k|    }
 2992|       |
 2993|  17.2k|#ifdef USE_RESOLV_THREADED
 2994|  17.2k|    Curl_async_thrdd_multi_destroy(multi, !multi->quick_exit);
 2995|  17.2k|#endif
 2996|  17.2k|    Curl_cpool_destroy(&multi->cpool);
 2997|  17.2k|    Curl_cshutdn_destroy(&multi->cshutdn, multi->admin);
 2998|  17.2k|    if(multi->admin) {
  ------------------
  |  Branch (2998:8): [True: 17.2k, False: 0]
  ------------------
 2999|  17.2k|      CURL_TRC_M(multi->admin, "multi_cleanup, closing admin handle, done");
  ------------------
  |  |  148|  17.2k|  do {                                   \
  |  |  149|  17.2k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  17.2k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  17.2k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  34.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 17.2k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 17.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  34.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  17.2k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  17.2k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  17.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 17.2k]
  |  |  ------------------
  ------------------
 3000|  17.2k|      multi->admin->multi = NULL;
 3001|  17.2k|      Curl_uint32_tbl_remove(&multi->xfers, multi->admin->mid);
 3002|  17.2k|      Curl_close(&multi->admin);
 3003|  17.2k|    }
 3004|       |
 3005|  17.2k|    multi->magic = 0; /* not good anymore */
 3006|       |
 3007|  17.2k|    Curl_multi_ev_cleanup(multi);
 3008|  17.2k|    Curl_hash_destroy(&multi->proto_hash);
 3009|  17.2k|    Curl_dnscache_destroy(&multi->dnscache);
 3010|  17.2k|    Curl_psl_destroy(&multi->psl);
 3011|  17.2k|#ifdef USE_SSL
 3012|  17.2k|    Curl_ssl_scache_destroy(multi->ssl_scache);
 3013|  17.2k|#endif
 3014|       |
 3015|       |#ifdef USE_WINSOCK
 3016|       |    WSACloseEvent(multi->wsa_event);
 3017|       |#endif
 3018|  17.2k|#ifdef ENABLE_WAKEUP
 3019|  17.2k|  Curl_wakeup_destroy(multi->wakeup_pair);
 3020|  17.2k|#endif
 3021|       |
 3022|  17.2k|    multi_xfer_bufs_free(multi);
 3023|  17.2k|    Curl_mntfy_cleanup(multi);
 3024|  17.2k|#ifdef DEBUGBUILD
 3025|  17.2k|    if(Curl_uint32_tbl_count(&multi->xfers)) {
  ------------------
  |  Branch (3025:8): [True: 0, False: 17.2k]
  ------------------
 3026|      0|      multi_xfer_tbl_dump(multi);
 3027|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3027:7): [Folded, False: 0]
  |  Branch (3027:7): [Folded, False: 0]
  ------------------
 3028|      0|    }
 3029|  17.2k|#endif
 3030|  17.2k|    Curl_uint32_bset_destroy(&multi->process);
 3031|  17.2k|    Curl_uint32_bset_destroy(&multi->dirty);
 3032|  17.2k|    Curl_uint32_bset_destroy(&multi->pending);
 3033|  17.2k|    Curl_uint32_bset_destroy(&multi->msgsent);
 3034|  17.2k|    Curl_uint32_tbl_destroy(&multi->xfers);
 3035|  17.2k|    curlx_free(multi);
  ------------------
  |  | 1483|  17.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3036|       |
 3037|  17.2k|    return CURLM_OK;
 3038|  17.2k|  }
 3039|      0|  return CURLM_BAD_HANDLE;
 3040|  17.2k|}
Curl_multi_will_close:
 3081|  13.9k|{
 3082|  13.9k|  if(data) {
  ------------------
  |  Branch (3082:6): [True: 13.9k, False: 0]
  ------------------
 3083|  13.9k|    struct Curl_multi *multi = data->multi;
 3084|  13.9k|    if(multi) {
  ------------------
  |  Branch (3084:8): [True: 13.9k, False: 0]
  ------------------
 3085|  13.9k|      CURL_TRC_M(data, "Curl_multi_will_close fd=%" FMT_SOCKET_T, s);
  ------------------
  |  |  148|  13.9k|  do {                                   \
  |  |  149|  13.9k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  13.9k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  13.9k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  27.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 13.9k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 13.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  27.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  13.9k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  13.9k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  13.9k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 13.9k]
  |  |  ------------------
  ------------------
 3086|  13.9k|      Curl_multi_ev_socket_done(multi, data, s);
 3087|  13.9k|    }
 3088|  13.9k|  }
 3089|  13.9k|}
Curl_update_timer:
 3566|  3.55M|{
 3567|  3.55M|  struct curltime expire_ts;
 3568|  3.55M|  long timeout_ms;
 3569|  3.55M|  int rc;
 3570|  3.55M|  bool set_value = FALSE;
  ------------------
  |  | 1058|  3.55M|#define FALSE false
  ------------------
 3571|       |
 3572|  3.55M|  if(!multi->timer_cb || multi->dead)
  ------------------
  |  Branch (3572:6): [True: 3.55M, False: 0]
  |  Branch (3572:26): [True: 0, False: 0]
  ------------------
 3573|  3.55M|    return CURLM_OK;
 3574|      0|  multi_timeout(multi, &expire_ts, &timeout_ms);
 3575|       |
 3576|      0|  if(timeout_ms < 0 && multi->last_timeout_ms < 0) {
  ------------------
  |  Branch (3576:6): [True: 0, False: 0]
  |  Branch (3576:24): [True: 0, False: 0]
  ------------------
 3577|       |    /* nothing to do */
 3578|      0|  }
 3579|      0|  else if(timeout_ms < 0) {
  ------------------
  |  Branch (3579:11): [True: 0, False: 0]
  ------------------
 3580|       |    /* there is no timeout now but there was one previously */
 3581|      0|    CURL_TRC_M(multi->admin, "[TIMER] clear");
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3582|      0|    timeout_ms = -1; /* normalize */
 3583|      0|    set_value = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 3584|      0|  }
 3585|      0|  else if(multi->last_timeout_ms < 0) {
  ------------------
  |  Branch (3585:11): [True: 0, False: 0]
  ------------------
 3586|      0|    CURL_TRC_M(multi->admin, "[TIMER] set %ldms, none before", timeout_ms);
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3587|      0|    set_value = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 3588|      0|  }
 3589|      0|  else if(curlx_ptimediff_us(&multi->last_expire_ts, &expire_ts)) {
  ------------------
  |  Branch (3589:11): [True: 0, False: 0]
  ------------------
 3590|       |    /* We had a timeout before and have one now, the absolute timestamp
 3591|       |     * differs. The relative timeout_ms may be the same, but the starting
 3592|       |     * point differs. Let the application restart its timer. */
 3593|      0|    CURL_TRC_M(multi->admin, "[TIMER] set %ldms, replace previous",
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3594|      0|               timeout_ms);
 3595|      0|    set_value = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 3596|      0|  }
 3597|      0|  else {
 3598|       |    /* We have same expire time as previously. Our relative 'timeout_ms'
 3599|       |     * may be different now, but the application has the timer running
 3600|       |     * and we do not to tell it to start this again. */
 3601|      0|  }
 3602|       |
 3603|      0|  if(set_value) {
  ------------------
  |  Branch (3603:6): [True: 0, False: 0]
  ------------------
 3604|      0|    multi->last_expire_ts = expire_ts;
 3605|      0|    multi->last_timeout_ms = timeout_ms;
 3606|      0|    set_in_callback(multi, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 3607|      0|    rc = multi->timer_cb(multi, timeout_ms, multi->timer_userp);
 3608|      0|    set_in_callback(multi, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 3609|      0|    if(rc == -1) {
  ------------------
  |  Branch (3609:8): [True: 0, False: 0]
  ------------------
 3610|      0|      multi->dead = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 3611|      0|      return CURLM_ABORTED_BY_CALLBACK;
 3612|      0|    }
 3613|      0|  }
 3614|      0|  return CURLM_OK;
 3615|      0|}
Curl_expire_ex:
 3681|  4.22M|{
 3682|  4.22M|  struct Curl_multi *multi = data->multi;
 3683|  4.22M|  struct curltime *curr_expire = &data->state.expiretime;
 3684|  4.22M|  struct curltime set;
 3685|       |
 3686|       |  /* this is only interesting while there is still an associated multi struct
 3687|       |     remaining! */
 3688|  4.22M|  if(!multi)
  ------------------
  |  Branch (3688:6): [True: 0, False: 4.22M]
  ------------------
 3689|      0|    return;
 3690|       |
 3691|  4.22M|  DEBUGASSERT(id < EXPIRE_LAST);
  ------------------
  |  | 1081|  4.22M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3691:3): [True: 0, False: 4.22M]
  |  Branch (3691:3): [True: 4.22M, False: 0]
  ------------------
 3692|       |
 3693|  4.22M|  set = *Curl_pgrs_now(data);
 3694|  4.22M|  set.tv_sec += (time_t)(milli / 1000); /* may be a 64 to 32-bit conversion */
 3695|  4.22M|  set.tv_usec += (int)(milli % 1000) * 1000;
 3696|       |
 3697|  4.22M|  if(set.tv_usec >= 1000000) {
  ------------------
  |  Branch (3697:6): [True: 3.77M, False: 451k]
  ------------------
 3698|  3.77M|    set.tv_sec++;
 3699|  3.77M|    set.tv_usec -= 1000000;
 3700|  3.77M|  }
 3701|       |
 3702|       |  /* Remove any timer with the same id */
 3703|  4.22M|  multi_deltimeout(data, id);
 3704|       |
 3705|       |  /* Add it to the timer list. It must stay in the list until it has expired
 3706|       |     in case we need to recompute the minimum timer later. */
 3707|  4.22M|  multi_addtimeout(data, &set, id);
 3708|       |
 3709|  4.22M|  if(curr_expire->tv_sec || curr_expire->tv_usec) {
  ------------------
  |  Branch (3709:6): [True: 4.21M, False: 14.5k]
  |  Branch (3709:29): [True: 0, False: 14.5k]
  ------------------
 3710|       |    /* This means that the struct is added as a node in the splay tree.
 3711|       |       Compare if the new time is earlier, and only remove-old/add-new if it
 3712|       |       is. */
 3713|  4.21M|    timediff_t diff = curlx_ptimediff_ms(&set, curr_expire);
 3714|  4.21M|    int rc;
 3715|       |
 3716|  4.21M|    if(diff > 0) {
  ------------------
  |  Branch (3716:8): [True: 4.06M, False: 150k]
  ------------------
 3717|       |      /* The current splay tree entry is sooner than this new expiry time.
 3718|       |         We do not need to update our splay tree entry. */
 3719|  4.06M|      return;
 3720|  4.06M|    }
 3721|       |
 3722|       |    /* Since this is an updated time, we must remove the previous entry from
 3723|       |       the splay tree first and then re-add the new value */
 3724|   150k|    rc = Curl_splayremove(multi->timetree, &data->state.timenode,
 3725|   150k|                          &multi->timetree);
 3726|   150k|    if(rc)
  ------------------
  |  Branch (3726:8): [True: 0, False: 150k]
  ------------------
 3727|      0|      infof(data, "Internal error removing splay node = %d", rc);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3728|   150k|  }
 3729|       |
 3730|       |  /* Indicate that we are in the splay tree and insert the new timer expiry
 3731|       |     value since it is our local minimum. */
 3732|   164k|  *curr_expire = set;
 3733|   164k|  Curl_splayset(&data->state.timenode, data);
 3734|   164k|  multi->timetree = Curl_splayinsert(curr_expire, multi->timetree,
 3735|   164k|                                     &data->state.timenode);
 3736|   164k|}
Curl_expire:
 3750|  4.22M|{
 3751|  4.22M|  Curl_expire_ex(data, milli, id);
 3752|  4.22M|}
Curl_expire_done:
 3761|  14.1k|{
 3762|       |  /* remove the timer, if there */
 3763|  14.1k|  multi_deltimeout(data, id);
 3764|  14.1k|  CURL_TRC_TIMER(data, id, "cleared");
  ------------------
  |  |  173|  14.1k|  do {                                        \
  |  |  174|  14.1k|    if(CURL_TRC_TIMER_is_verbose(data))       \
  |  |  ------------------
  |  |  |  |  139|  14.1k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_timer)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  14.1k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  28.2k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 14.1k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 14.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  28.2k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  14.1k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  14.1k|      Curl_trc_timer(data, tid, __VA_ARGS__); \
  |  |  176|  14.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (176:11): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
 3765|  14.1k|}
Curl_expire_clear:
 3773|  71.7k|{
 3774|  71.7k|  struct Curl_multi *multi = data->multi;
 3775|  71.7k|  struct curltime *nowp = &data->state.expiretime;
 3776|       |
 3777|       |  /* this is only interesting while there is still an associated multi struct
 3778|       |     remaining! */
 3779|  71.7k|  if(!multi)
  ------------------
  |  Branch (3779:6): [True: 36.6k, False: 35.1k]
  ------------------
 3780|  36.6k|    return;
 3781|       |
 3782|  35.1k|  if(nowp->tv_sec || nowp->tv_usec) {
  ------------------
  |  Branch (3782:6): [True: 14.5k, False: 20.6k]
  |  Branch (3782:22): [True: 0, False: 20.6k]
  ------------------
 3783|       |    /* Since this is an cleared time, we must remove the previous entry from
 3784|       |       the splay tree */
 3785|  14.5k|    struct Curl_llist *list = &data->state.timeoutlist;
 3786|  14.5k|    int rc;
 3787|       |
 3788|  14.5k|    rc = Curl_splayremove(multi->timetree, &data->state.timenode,
 3789|  14.5k|                          &multi->timetree);
 3790|  14.5k|    if(rc)
  ------------------
  |  Branch (3790:8): [True: 0, False: 14.5k]
  ------------------
 3791|      0|      infof(data, "Internal error clearing splay node = %d", rc);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3792|       |
 3793|       |    /* clear the timeout list too */
 3794|  14.5k|    Curl_llist_destroy(list, NULL);
 3795|       |
 3796|  14.5k|    if(data->id >= 0)
  ------------------
  |  Branch (3796:8): [True: 14.5k, False: 0]
  ------------------
 3797|  14.5k|      CURL_TRC_M(data, "[TIMEOUT] all cleared");
  ------------------
  |  |  148|  14.5k|  do {                                   \
  |  |  149|  14.5k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  14.5k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  14.5k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  29.0k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 14.5k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 14.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  29.0k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  14.5k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  14.5k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  14.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 14.5k]
  |  |  ------------------
  ------------------
 3798|  14.5k|    nowp->tv_sec = 0;
 3799|  14.5k|    nowp->tv_usec = 0;
 3800|  14.5k|  }
 3801|  35.1k|}
Curl_set_in_callback:
 3877|  76.1k|{
 3878|  76.1k|  if(data && data->multi)
  ------------------
  |  Branch (3878:6): [True: 76.1k, False: 0]
  |  Branch (3878:14): [True: 76.1k, False: 0]
  ------------------
 3879|  76.1k|    data->multi->in_callback = value;
 3880|  76.1k|}
Curl_multi_max_concurrent_streams:
 3888|  4.47k|{
 3889|  4.47k|  DEBUGASSERT(multi);
  ------------------
  |  | 1081|  4.47k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3889:3): [True: 0, False: 4.47k]
  |  Branch (3889:3): [True: 4.47k, False: 0]
  ------------------
 3890|  4.47k|  return multi->max_concurrent_streams;
 3891|  4.47k|}
Curl_multi_xfer_buf_borrow:
 3958|  3.27M|{
 3959|  3.27M|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  3.27M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3959:3): [True: 0, False: 3.27M]
  |  Branch (3959:3): [True: 3.27M, False: 0]
  ------------------
 3960|  3.27M|  DEBUGASSERT(data->multi);
  ------------------
  |  | 1081|  3.27M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3960:3): [True: 0, False: 3.27M]
  |  Branch (3960:3): [True: 3.27M, False: 0]
  ------------------
 3961|  3.27M|  *pbuf = NULL;
 3962|  3.27M|  *pbuflen = 0;
 3963|  3.27M|  if(!data->multi) {
  ------------------
  |  Branch (3963:6): [True: 0, False: 3.27M]
  ------------------
 3964|      0|    failf(data, "transfer has no multi handle");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3965|      0|    return CURLE_FAILED_INIT;
 3966|      0|  }
 3967|  3.27M|  if(!data->set.buffer_size) {
  ------------------
  |  Branch (3967:6): [True: 0, False: 3.27M]
  ------------------
 3968|      0|    failf(data, "transfer buffer size is 0");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3969|      0|    return CURLE_FAILED_INIT;
 3970|      0|  }
 3971|  3.27M|  if(data->multi->xfer_buf_borrowed) {
  ------------------
  |  Branch (3971:6): [True: 0, False: 3.27M]
  ------------------
 3972|      0|    failf(data, "attempt to borrow xfer_buf when already borrowed");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3973|      0|    return CURLE_AGAIN;
 3974|      0|  }
 3975|       |
 3976|  3.27M|  if(data->multi->xfer_buf &&
  ------------------
  |  Branch (3976:6): [True: 3.26M, False: 7.08k]
  ------------------
 3977|  3.26M|     data->set.buffer_size > data->multi->xfer_buf_len) {
  ------------------
  |  Branch (3977:6): [True: 0, False: 3.26M]
  ------------------
 3978|       |    /* not large enough, get a new one */
 3979|      0|    curlx_safefree(data->multi->xfer_buf);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3980|      0|    data->multi->xfer_buf_len = 0;
 3981|      0|  }
 3982|       |
 3983|  3.27M|  if(!data->multi->xfer_buf) {
  ------------------
  |  Branch (3983:6): [True: 7.08k, False: 3.26M]
  ------------------
 3984|  7.08k|    data->multi->xfer_buf = curlx_malloc(curlx_uitouz(data->set.buffer_size));
  ------------------
  |  | 1478|  7.08k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
 3985|  7.08k|    if(!data->multi->xfer_buf) {
  ------------------
  |  Branch (3985:8): [True: 0, False: 7.08k]
  ------------------
 3986|      0|      failf(data, "could not allocate xfer_buf of %u bytes",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3987|      0|            data->set.buffer_size);
 3988|      0|      return CURLE_OUT_OF_MEMORY;
 3989|      0|    }
 3990|  7.08k|    data->multi->xfer_buf_len = data->set.buffer_size;
 3991|  7.08k|  }
 3992|       |
 3993|  3.27M|  data->multi->xfer_buf_borrowed = TRUE;
  ------------------
  |  | 1055|  3.27M|#define TRUE true
  ------------------
 3994|  3.27M|  *pbuf = data->multi->xfer_buf;
 3995|  3.27M|  *pbuflen = data->multi->xfer_buf_len;
 3996|  3.27M|  return CURLE_OK;
 3997|  3.27M|}
Curl_multi_xfer_buf_release:
 4000|  3.27M|{
 4001|  3.27M|  (void)buf;
 4002|  3.27M|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  3.27M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4002:3): [True: 0, False: 3.27M]
  |  Branch (4002:3): [True: 3.27M, False: 0]
  ------------------
 4003|  3.27M|  DEBUGASSERT(data->multi);
  ------------------
  |  | 1081|  3.27M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4003:3): [True: 0, False: 3.27M]
  |  Branch (4003:3): [True: 3.27M, False: 0]
  ------------------
 4004|  3.27M|  DEBUGASSERT(!buf || data->multi->xfer_buf == buf);
  ------------------
  |  | 1081|  3.27M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4004:3): [True: 3.27M, False: 0]
  |  Branch (4004:3): [True: 0, False: 0]
  |  Branch (4004:3): [True: 0, False: 3.27M]
  |  Branch (4004:3): [True: 3.27M, False: 0]
  ------------------
 4005|  3.27M|  data->multi->xfer_buf_borrowed = FALSE;
  ------------------
  |  | 1058|  3.27M|#define FALSE false
  ------------------
 4006|  3.27M|}
Curl_multi_get_easy:
 4121|  14.1M|{
 4122|  14.1M|  struct Curl_easy *data = Curl_uint32_tbl_get(&multi->xfers, mid);
 4123|  14.1M|  if(GOOD_EASY_HANDLE(data))
  ------------------
  |  |  136|  14.1M|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  130|  14.1M|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  | 1055|  14.1M|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (136:3): [True: 14.1M, False: 0]
  |  |  |  Branch (136:5): [True: 14.1M, False: 0]
  |  |  |  Branch (136:12): [True: 14.1M, False: 0]
  |  |  ------------------
  |  |  137|  14.1M|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (4123:6): [True: 0, False: 0]
  |  Branch (4123:6): [True: 0, False: 0]
  ------------------
 4124|  14.1M|    return data;
 4125|      0|  CURL_TRC_M(multi->admin, "invalid easy handle in xfer table for mid=%u",
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4126|      0|             mid);
 4127|      0|  Curl_uint32_tbl_remove(&multi->xfers, mid);
 4128|       |  return NULL;
 4129|  14.1M|}
Curl_multi_xfers_running:
 4132|  3.52M|{
 4133|  3.52M|  DEBUGASSERT(multi);
  ------------------
  |  | 1081|  3.52M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4133:3): [True: 0, False: 3.52M]
  |  Branch (4133:3): [True: 3.52M, False: 0]
  ------------------
 4134|  3.52M|  if(!multi)
  ------------------
  |  Branch (4134:6): [True: 0, False: 3.52M]
  ------------------
 4135|      0|    return 0;
 4136|  3.52M|  return multi->xfers_alive;
 4137|  3.52M|}
Curl_multi_mark_dirty:
 4140|  29.5k|{
 4141|  29.5k|  if(data->multi && data->mid != UINT32_MAX)
  ------------------
  |  Branch (4141:6): [True: 29.5k, False: 0]
  |  Branch (4141:21): [True: 29.5k, False: 0]
  ------------------
 4142|  29.5k|    Curl_uint32_bset_add(&data->multi->dirty, data->mid);
 4143|  29.5k|}
Curl_multi_clear_dirty:
 4146|    287|{
 4147|    287|  if(data->multi && data->mid != UINT32_MAX)
  ------------------
  |  Branch (4147:6): [True: 287, False: 0]
  |  Branch (4147:21): [True: 287, False: 0]
  ------------------
 4148|    287|    Curl_uint32_bset_remove(&data->multi->dirty, data->mid);
 4149|    287|}
multi.c:multi_xfers_add:
  397|  17.8k|{
  398|  17.8k|  uint32_t capacity = Curl_uint32_tbl_capacity(&multi->xfers);
  399|  17.8k|  uint32_t new_size = 0;
  400|       |  /* Prepare to make this into a CURLMOPT_MAX_TRANSFERS, because some
  401|       |   * applications may want to prevent a run-away of their memory use. */
  402|       |  /* UINT_MAX is our "invalid" id, do not let the table grow up to that. */
  403|  17.8k|  const uint32_t max_capacity = UINT_MAX - 1;
  404|       |
  405|  17.8k|  if(capacity < max_capacity) {
  ------------------
  |  Branch (405:6): [True: 17.8k, False: 0]
  ------------------
  406|       |    /* We want `multi->xfers` to have "sufficient" free rows, so that we do
  407|       |     * not have to reuse the `mid` from a removed easy right away.
  408|       |     * Since uint_tbl and uint_bset are memory efficient,
  409|       |     * regard less than 25% free as insufficient.
  410|       |     * (for low capacities, e.g. multi_easy, 4 or less). */
  411|  17.8k|    uint32_t used = Curl_uint32_tbl_count(&multi->xfers);
  412|  17.8k|    uint32_t unused = capacity - used;
  413|  17.8k|    uint32_t min_unused = CURLMAX(capacity >> 2, 4);
  ------------------
  |  | 1286|  17.8k|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1286:24): [True: 17.8k, False: 0]
  |  |  ------------------
  ------------------
  414|  17.8k|    if(unused <= min_unused) {
  ------------------
  |  Branch (414:8): [True: 0, False: 17.8k]
  ------------------
  415|       |      /* Make sure the uint arithmetic here works on the corner
  416|       |       * cases where we are close to max_capacity or UINT_MAX */
  417|      0|      if((min_unused >= max_capacity) ||
  ------------------
  |  Branch (417:10): [True: 0, False: 0]
  ------------------
  418|      0|         ((max_capacity - min_unused) <= capacity) ||
  ------------------
  |  Branch (418:10): [True: 0, False: 0]
  ------------------
  419|      0|         ((UINT_MAX - min_unused - 63) <= capacity)) {
  ------------------
  |  Branch (419:10): [True: 0, False: 0]
  ------------------
  420|      0|        new_size = max_capacity; /* can not be larger than this */
  421|      0|      }
  422|      0|      else {
  423|       |        /* make it a 64 multiple, since our bitsets grow by that and
  424|       |         * small (easy_multi) grows to at least 64 on first resize. */
  425|      0|        new_size = (((used + min_unused) + 63) / 64) * 64;
  426|      0|      }
  427|      0|    }
  428|  17.8k|  }
  429|       |
  430|  17.8k|  if(new_size > capacity) {
  ------------------
  |  Branch (430:6): [True: 0, False: 17.8k]
  ------------------
  431|       |    /* Grow the bitsets first. Should one fail, we do not need
  432|       |     * to downsize the already resized ones. The sets continue
  433|       |     * to work properly when larger than the table, but not
  434|       |     * the other way around. */
  435|      0|    CURL_TRC_M(data, "increasing xfer table size to %u", new_size);
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  436|      0|    if(Curl_uint32_bset_resize(&multi->process, new_size) ||
  ------------------
  |  Branch (436:8): [True: 0, False: 0]
  ------------------
  437|      0|       Curl_uint32_bset_resize(&multi->dirty, new_size) ||
  ------------------
  |  Branch (437:8): [True: 0, False: 0]
  ------------------
  438|      0|       Curl_uint32_bset_resize(&multi->pending, new_size) ||
  ------------------
  |  Branch (438:8): [True: 0, False: 0]
  ------------------
  439|      0|       Curl_uint32_bset_resize(&multi->msgsent, new_size) ||
  ------------------
  |  Branch (439:8): [True: 0, False: 0]
  ------------------
  440|      0|       Curl_uint32_tbl_resize(&multi->xfers, new_size))
  ------------------
  |  Branch (440:8): [True: 0, False: 0]
  ------------------
  441|      0|      return CURLM_OUT_OF_MEMORY;
  442|      0|  }
  443|       |
  444|       |  /* Insert the easy into the table now */
  445|  17.8k|  if(!Curl_uint32_tbl_add(&multi->xfers, data, &data->mid)) {
  ------------------
  |  Branch (445:6): [True: 0, False: 17.8k]
  ------------------
  446|       |    /* MUST only happen when table is full */
  447|      0|    DEBUGASSERT(Curl_uint32_tbl_capacity(&multi->xfers) <=
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (447:5): [True: 0, False: 0]
  |  Branch (447:5): [True: 0, False: 0]
  ------------------
  448|      0|                Curl_uint32_tbl_count(&multi->xfers));
  449|      0|    return CURLM_OUT_OF_MEMORY;
  450|      0|  }
  451|  17.8k|  return CURLM_OK;
  452|  17.8k|}
multi.c:mstate:
  135|   136k|{
  136|   136k|  CURLMstate oldstate = data->mstate;
  137|   136k|  static const init_multistate_func finit[MSTATE_LAST] = {
  138|   136k|    NULL,              /* INIT */
  139|   136k|    NULL,              /* PENDING */
  140|   136k|    NULL,              /* SETUP */
  141|   136k|    Curl_init_CONNECT, /* CONNECT */
  142|   136k|    NULL,              /* CONNECTING */
  143|   136k|    NULL,              /* PROTOCONNECT */
  144|   136k|    NULL,              /* PROTOCONNECTING */
  145|   136k|    NULL,              /* DO */
  146|   136k|    NULL,              /* DOING */
  147|   136k|    NULL,              /* DOING_MORE */
  148|   136k|    before_perform,    /* DID */
  149|   136k|    NULL,              /* PERFORMING */
  150|   136k|    NULL,              /* RATELIMITING */
  151|   136k|    NULL,              /* DONE */
  152|   136k|    init_completed,    /* COMPLETED */
  153|       |    NULL               /* MSGSENT */
  154|   136k|  };
  155|       |
  156|   136k|  if(oldstate == state)
  ------------------
  |  Branch (156:6): [True: 17.8k, False: 118k]
  ------------------
  157|       |    /* do not bother when the new state is the same as the old state */
  158|  17.8k|    return;
  159|       |
  160|   118k|#ifdef DEBUGBUILD
  161|   118k|  NOVERBOSE((void)lineno);
  ------------------
  |  | 1619|   118k|#define NOVERBOSE(x) Curl_nop_stmt
  |  |  ------------------
  |  |  |  | 1180|   118k|#define Curl_nop_stmt do {} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1180:35): [Folded, False: 118k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  162|   118k|  CURL_TRC_M(data, "-> [%s] (line %d)", CURL_MSTATE_NAME(state), lineno);
  ------------------
  |  |  148|   118k|  do {                                   \
  |  |  149|   118k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|   118k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|   118k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|   236k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 118k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 118k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|   236k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|   118k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|   118k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|   118k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  163|       |#else
  164|       |  CURL_TRC_M(data, "-> [%s]", CURL_MSTATE_NAME(state));
  165|       |#endif
  166|       |
  167|       |  /* really switching state */
  168|   118k|  data->mstate = state;
  169|   118k|  switch(state) {
  170|  1.42k|  case MSTATE_DONE:
  ------------------
  |  Branch (170:3): [True: 1.42k, False: 116k]
  ------------------
  171|  1.42k|    CURLM_NTFY(data, CURLMNOTIFY_EASY_DONE);
  ------------------
  |  |   51|  1.42k|  do {                                                \
  |  |   52|  1.42k|    if((d) && (d)->multi && (d)->multi->ntfy.ntfy_cb) \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 1.42k, False: 0]
  |  |  |  Branch (52:15): [True: 1.42k, False: 0]
  |  |  |  Branch (52:29): [True: 0, False: 1.42k]
  |  |  ------------------
  |  |   53|  1.42k|      Curl_mntfy_add((d), (t));                       \
  |  |   54|  1.42k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (54:11): [Folded, False: 1.42k]
  |  |  ------------------
  ------------------
  172|  1.42k|    break;
  173|  17.3k|  case MSTATE_COMPLETED:
  ------------------
  |  Branch (173:3): [True: 17.3k, False: 100k]
  ------------------
  174|       |    /* we sometimes directly jump to COMPLETED, trigger also a notification
  175|       |     * in that case. */
  176|  17.3k|    if(oldstate < MSTATE_DONE)
  ------------------
  |  Branch (176:8): [True: 16.4k, False: 841]
  ------------------
  177|  16.4k|      CURLM_NTFY(data, CURLMNOTIFY_EASY_DONE);
  ------------------
  |  |   51|  16.4k|  do {                                                \
  |  |   52|  16.4k|    if((d) && (d)->multi && (d)->multi->ntfy.ntfy_cb) \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 16.4k, False: 0]
  |  |  |  Branch (52:15): [True: 16.4k, False: 0]
  |  |  |  Branch (52:29): [True: 0, False: 16.4k]
  |  |  ------------------
  |  |   53|  16.4k|      Curl_mntfy_add((d), (t));                       \
  |  |   54|  16.4k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (54:11): [Folded, False: 16.4k]
  |  |  ------------------
  ------------------
  178|       |    /* changing to COMPLETED means it is in process and needs to go */
  179|  17.3k|    DEBUGASSERT(Curl_uint32_bset_contains(&data->multi->process, data->mid));
  ------------------
  |  | 1081|  17.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (179:5): [True: 0, False: 17.3k]
  |  Branch (179:5): [True: 17.3k, False: 0]
  ------------------
  180|  17.3k|    Curl_uint32_bset_remove(&data->multi->process, data->mid);
  181|  17.3k|    Curl_uint32_bset_remove(&data->multi->pending, data->mid); /* to be sure */
  182|       |
  183|  17.3k|    if(Curl_uint32_bset_empty(&data->multi->process)) {
  ------------------
  |  Branch (183:8): [True: 0, False: 17.3k]
  ------------------
  184|       |      /* free the transfer buffer when we have no more active transfers */
  185|      0|      multi_xfer_bufs_free(data->multi);
  186|      0|    }
  187|  17.3k|    break;
  188|  99.4k|  default:
  ------------------
  |  Branch (188:3): [True: 99.4k, False: 18.7k]
  ------------------
  189|  99.4k|    break;
  190|   118k|  }
  191|       |
  192|       |  /* if this state has an init-function, run it */
  193|   118k|  if(finit[state])
  ------------------
  |  Branch (193:6): [True: 40.5k, False: 77.6k]
  ------------------
  194|  40.5k|    finit[state](data);
  195|   118k|}
multi.c:before_perform:
  114|  7.56k|{
  115|       |  data->req.chunk = FALSE;
  ------------------
  |  | 1058|  7.56k|#define FALSE false
  ------------------
  116|  7.56k|  Curl_pgrsTime(data, TIMER_PRETRANSFER);
  117|  7.56k|}
multi.c:init_completed:
  120|  17.3k|{
  121|       |  /* this is a completed transfer */
  122|       |
  123|       |  /* Important: reset the conn pointer so that we do not point to memory
  124|       |     that could be freed anytime */
  125|  17.3k|  Curl_detach_connection(data);
  126|  17.3k|  Curl_expire_clear(data); /* stop all timers */
  127|  17.3k|}
multi.c:multi_warn_debug:
  367|  7.13M|{
  368|  7.13M|  if(!multi->warned) {
  ------------------
  |  Branch (368:6): [True: 17.2k, False: 7.11M]
  ------------------
  369|  17.2k|    infof(data, "!!! WARNING !!!");
  ------------------
  |  |  143|  17.2k|  do {                               \
  |  |  144|  17.2k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  17.2k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 17.2k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 17.2k]
  |  |  |  |  ------------------
  |  |  |  |  320|  17.2k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  17.2k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  17.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 17.2k]
  |  |  ------------------
  ------------------
  370|  17.2k|    infof(data, "This is a debug build of libcurl, "
  ------------------
  |  |  143|  17.2k|  do {                               \
  |  |  144|  17.2k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  17.2k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 17.2k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 17.2k]
  |  |  |  |  ------------------
  |  |  |  |  320|  17.2k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  17.2k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  17.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 17.2k]
  |  |  ------------------
  ------------------
  371|  17.2k|                "do not use in production.");
  372|       |    multi->warned = TRUE;
  ------------------
  |  | 1055|  17.2k|#define TRUE true
  ------------------
  373|  17.2k|  }
  374|  7.13M|}
multi.c:multi_assess_wakeup:
  385|  52.5k|{
  386|  52.5k|#ifdef ENABLE_WAKEUP
  387|  52.5k|  if(multi->socket_cb)
  ------------------
  |  Branch (387:6): [True: 0, False: 52.5k]
  ------------------
  388|      0|    return Curl_multi_ev_assess_xfer(multi, multi->admin);
  389|       |#else
  390|       |  (void)multi;
  391|       |#endif
  392|  52.5k|  return CURLM_OK;
  393|  52.5k|}
multi.c:multi_done:
  690|  13.8k|{
  691|  13.8k|  CURLcode result;
  692|  13.8k|  struct connectdata *conn = data->conn;
  693|       |
  694|  13.8k|  CURL_TRC_M(data, "multi_done: status: %d prem: %d done: %d",
  ------------------
  |  |  148|  13.8k|  do {                                   \
  |  |  149|  13.8k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  13.8k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  13.8k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  27.7k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 13.8k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 13.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  27.7k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  13.8k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  13.8k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  13.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 13.8k]
  |  |  ------------------
  ------------------
  695|  13.8k|             (int)status, (int)premature, data->state.done);
  696|       |
  697|  13.8k|  if(data->state.done)
  ------------------
  |  Branch (697:6): [True: 0, False: 13.8k]
  ------------------
  698|       |    /* Stop if multi_done() has already been called */
  699|      0|    return CURLE_OK;
  700|       |
  701|       |  /* Shut down any ongoing async resolver operation. */
  702|  13.8k|  Curl_resolv_shutdown_all(data);
  703|       |
  704|       |  /* Cleanup possible redirect junk */
  705|  13.8k|  curlx_safefree(data->req.newurl);
  ------------------
  |  | 1327|  13.8k|  do {                      \
  |  | 1328|  13.8k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  13.8k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  13.8k|    (ptr) = NULL;           \
  |  | 1330|  13.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 13.8k]
  |  |  ------------------
  ------------------
  706|  13.8k|  curlx_safefree(data->req.location);
  ------------------
  |  | 1327|  13.8k|  do {                      \
  |  | 1328|  13.8k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  13.8k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  13.8k|    (ptr) = NULL;           \
  |  | 1330|  13.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 13.8k]
  |  |  ------------------
  ------------------
  707|       |
  708|  13.8k|  switch(status) {
  709|      8|  case CURLE_ABORTED_BY_CALLBACK:
  ------------------
  |  Branch (709:3): [True: 8, False: 13.8k]
  ------------------
  710|     44|  case CURLE_READ_ERROR:
  ------------------
  |  Branch (710:3): [True: 36, False: 13.8k]
  ------------------
  711|     62|  case CURLE_WRITE_ERROR:
  ------------------
  |  Branch (711:3): [True: 18, False: 13.8k]
  ------------------
  712|       |    /* When we are aborted due to a callback return code it has to be counted
  713|       |       as premature as there is trouble ahead if we do not. We have many
  714|       |       callbacks and protocols work differently, we could potentially do this
  715|       |       more fine-grained in the future. */
  716|     62|    premature = TRUE;
  ------------------
  |  | 1055|     62|#define TRUE true
  ------------------
  717|     62|    FALLTHROUGH();
  ------------------
  |  |  821|     62|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  718|  13.8k|  default:
  ------------------
  |  Branch (718:3): [True: 13.8k, False: 62]
  ------------------
  719|  13.8k|    break;
  720|  13.8k|  }
  721|       |
  722|       |  /* this calls the protocol-specific function pointer previously set */
  723|  13.8k|  if(conn && conn->scheme->run->done && (data->mstate >= MSTATE_PROTOCONNECT))
  ------------------
  |  Branch (723:6): [True: 13.8k, False: 0]
  |  Branch (723:14): [True: 13.8k, False: 0]
  |  Branch (723:41): [True: 9.00k, False: 4.87k]
  ------------------
  724|  9.00k|    result = conn->scheme->run->done(data, status, premature);
  725|  4.87k|  else
  726|  4.87k|    result = status;
  727|       |
  728|  13.8k|  if(data->mstate > MSTATE_CONNECTING &&
  ------------------
  |  Branch (728:6): [True: 9.00k, False: 4.87k]
  ------------------
  729|  9.00k|     (result != CURLE_ABORTED_BY_CALLBACK)) {
  ------------------
  |  Branch (729:6): [True: 8.99k, False: 8]
  ------------------
  730|       |    /* avoid this if
  731|       |     * - the transfer has not connected
  732|       |     * - we already aborted by callback to avoid this calling another callback
  733|       |     */
  734|  8.99k|    int rc = Curl_pgrsDone(data);
  735|  8.99k|    if(!result && rc)
  ------------------
  |  Branch (735:8): [True: 1.82k, False: 7.17k]
  |  Branch (735:19): [True: 0, False: 1.82k]
  ------------------
  736|      0|      result = CURLE_ABORTED_BY_CALLBACK;
  737|  8.99k|  }
  738|       |
  739|       |  /* Make sure that transfer client writes are really done now. */
  740|  13.8k|  result = Curl_1st_fatal(result, Curl_xfer_write_done(data, premature));
  741|       |
  742|       |  /* Inform connection filters that this transfer is done */
  743|  13.8k|  if(conn)
  ------------------
  |  Branch (743:6): [True: 13.8k, False: 0]
  ------------------
  744|  13.8k|    Curl_conn_ev_data_done(data, premature);
  745|       |
  746|  13.8k|  process_pending_handles(data->multi); /* connection / multiplex */
  747|       |
  748|  13.8k|  if(!result)
  ------------------
  |  Branch (748:6): [True: 2.05k, False: 11.8k]
  ------------------
  749|  2.05k|    result = Curl_req_done(&data->req, data, premature);
  750|       |
  751|  13.8k|  if(conn) {
  ------------------
  |  Branch (751:6): [True: 13.8k, False: 0]
  ------------------
  752|       |    /* Under the potential connection pool's share lock, decide what to
  753|       |     * do with the transfer's connection. */
  754|  13.8k|    struct multi_done_ctx mdctx;
  755|       |
  756|  13.8k|    memset(&mdctx, 0, sizeof(mdctx));
  757|  13.8k|    mdctx.premature = premature;
  758|  13.8k|    Curl_cpool_do_locked(data, data->conn, multi_done_locked, &mdctx);
  759|  13.8k|  }
  760|       |
  761|       |  /* flush the netrc cache */
  762|  13.8k|  Curl_netrc_cleanup(&data->state.netrc);
  763|  13.8k|  return result;
  764|  13.8k|}
multi.c:multi_done_locked:
  637|  13.8k|{
  638|  13.8k|  struct multi_done_ctx *mdctx = userdata;
  639|       |
  640|  13.8k|  Curl_detach_connection(data);
  641|       |
  642|  13.8k|  CURL_TRC_M(data, "multi_done_locked, in use=%u", conn->attached_xfers);
  ------------------
  |  |  148|  13.8k|  do {                                   \
  |  |  149|  13.8k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  13.8k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  13.8k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  27.7k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 13.8k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 13.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  27.7k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  13.8k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  13.8k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  13.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 13.8k]
  |  |  ------------------
  ------------------
  643|  13.8k|  if(CONN_INUSE(conn)) {
  ------------------
  |  |  346|  13.8k|#define CONN_INUSE(c) (!!(c)->attached_xfers)
  |  |  ------------------
  |  |  |  Branch (346:23): [True: 0, False: 13.8k]
  |  |  ------------------
  ------------------
  644|       |    /* Stop if still used. */
  645|      0|    CURL_TRC_M(data, "Connection still in use %u, no more multi_done now!",
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  646|      0|               conn->attached_xfers);
  647|      0|    return;
  648|      0|  }
  649|       |
  650|  13.8k|  data->state.done = TRUE; /* called now! */
  ------------------
  |  | 1055|  13.8k|#define TRUE true
  ------------------
  651|  13.8k|  data->state.recent_conn_id = conn->connection_id;
  652|       |
  653|  13.8k|  Curl_dnscache_prune(data);
  654|       |
  655|  13.8k|  if(multi_conn_should_close(conn, data, (bool)mdctx->premature)) {
  ------------------
  |  Branch (655:6): [True: 11.4k, False: 2.42k]
  ------------------
  656|  11.4k|    CURL_TRC_M(data, "multi_done, terminating conn #%" FMT_OFF_T " to %s, "
  ------------------
  |  |  148|  11.4k|  do {                                   \
  |  |  149|  11.4k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  11.4k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  11.4k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  22.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 11.4k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 11.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  22.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  11.4k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  11.4k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  11.4k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 11.4k]
  |  |  ------------------
  ------------------
  657|  11.4k|               "forbid=%d, close=%d, premature=%d, conn_multiplex=%d",
  658|  11.4k|               conn->connection_id, conn->destination,
  659|  11.4k|               data->set.reuse_forbid, conn->bits.close, mdctx->premature,
  660|  11.4k|               Curl_conn_is_multiplex(conn, FIRSTSOCKET));
  661|  11.4k|    connclose(conn, "disconnecting");
  ------------------
  |  |  103|  11.4k|#define connclose(x, y)   Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
  |  |  ------------------
  |  |  |  |   91|  11.4k|#define CONNCTRL_CONNECTION 1
  |  |  ------------------
  ------------------
  662|  11.4k|    Curl_conn_terminate(data, conn, (bool)mdctx->premature);
  663|  11.4k|  }
  664|  2.42k|  else if(!Curl_conn_get_max_concurrent(data, conn, FIRSTSOCKET)) {
  ------------------
  |  |  303|  2.42k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (664:11): [True: 18, False: 2.40k]
  ------------------
  665|     18|    CURL_TRC_M(data, "multi_done, conn #%" FMT_OFF_T " to %s was shutdown"
  ------------------
  |  |  148|     18|  do {                                   \
  |  |  149|     18|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|     18|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|     18|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|     36|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 18, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 18]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|     36|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|     18|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|     18|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|     18|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 18]
  |  |  ------------------
  ------------------
  666|     18|               " by server, not reusing", conn->connection_id,
  667|     18|               conn->destination);
  668|     18|    connclose(conn, "server shutdown");
  ------------------
  |  |  103|     18|#define connclose(x, y)   Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
  |  |  ------------------
  |  |  |  |   91|     18|#define CONNCTRL_CONNECTION 1
  |  |  ------------------
  ------------------
  669|     18|    Curl_conn_terminate(data, conn, (bool)mdctx->premature);
  670|     18|  }
  671|  2.40k|  else {
  672|       |    /* the connection is no longer in use by any transfer */
  673|  2.40k|    if(Curl_cpool_conn_now_idle(data, conn)) {
  ------------------
  |  Branch (673:8): [True: 2.40k, False: 0]
  ------------------
  674|       |      /* connection kept in the cpool */
  675|  2.40k|      data->state.lastconnect_id = conn->connection_id;
  676|  2.40k|      infof(data, "Connection #%" FMT_OFF_T " to host %s left intact",
  ------------------
  |  |  143|  2.40k|  do {                               \
  |  |  144|  2.40k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  2.40k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 2.40k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 2.40k]
  |  |  |  |  ------------------
  |  |  |  |  320|  2.40k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  2.40k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  2.40k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 2.40k]
  |  |  ------------------
  ------------------
  677|  2.40k|            conn->connection_id, conn->destination);
  678|  2.40k|    }
  679|      0|    else {
  680|       |      /* connection was removed from the cpool and destroyed. */
  681|      0|      data->state.lastconnect_id = -1;
  682|      0|    }
  683|  2.40k|  }
  684|  13.8k|}
multi.c:multi_conn_should_close:
  596|  13.8k|{
  597|       |  /* if conn->bits.close is TRUE, it means that the connection should be
  598|       |     closed in spite of everything else. */
  599|  13.8k|  if(conn->bits.close)
  ------------------
  |  Branch (599:6): [True: 6.53k, False: 7.35k]
  ------------------
  600|  6.53k|    return TRUE;
  ------------------
  |  | 1055|  6.53k|#define TRUE true
  ------------------
  601|       |
  602|       |  /* if data->set.reuse_forbid is TRUE, it means the libcurl client has
  603|       |     forced us to close this connection. This is ignored for requests taking
  604|       |     place in a NTLM/NEGOTIATE authentication handshake. */
  605|  7.35k|  if(data->set.reuse_forbid
  ------------------
  |  Branch (605:6): [True: 33, False: 7.31k]
  ------------------
  606|       |#ifdef USE_NTLM
  607|       |     && !(conn->http_ntlm_state == NTLMSTATE_TYPE2 ||
  608|       |          conn->proxy_ntlm_state == NTLMSTATE_TYPE2)
  609|       |#endif
  610|       |#ifdef USE_SPNEGO
  611|       |     && !(conn->http_negotiate_state == GSS_AUTHRECV ||
  612|       |          conn->proxy_negotiate_state == GSS_AUTHRECV)
  613|       |#endif
  614|  7.35k|    )
  615|     33|    return TRUE;
  ------------------
  |  | 1055|     33|#define TRUE true
  ------------------
  616|       |
  617|       |  /* Unless this connection is for a "connect-only" transfer, it
  618|       |   * needs to be closed if the protocol handler does not support reuse. */
  619|  7.31k|  if(!data->set.connect_only && conn->scheme &&
  ------------------
  |  Branch (619:6): [True: 7.19k, False: 118]
  |  Branch (619:33): [True: 7.19k, False: 0]
  ------------------
  620|  7.19k|     !(conn->scheme->flags & PROTOPT_CONN_REUSE))
  ------------------
  |  |  238|  7.19k|#define PROTOPT_CONN_REUSE (1 << 16)  /* this protocol can reuse connections */
  ------------------
  |  Branch (620:6): [True: 0, False: 7.19k]
  ------------------
  621|      0|    return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  622|       |
  623|       |  /* if premature is TRUE, it means this connection was said to be DONE before
  624|       |     the entire request operation is complete and thus we cannot know in what
  625|       |     state it is for reusing, so we are forced to close it. In a perfect world
  626|       |     we can add code that keep track of if we really must close it here or not,
  627|       |     but currently we have no such detail knowledge. */
  628|  7.31k|  if(premature && !Curl_conn_is_multiplex(conn, FIRSTSOCKET))
  ------------------
  |  |  303|  5.89k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (628:6): [True: 5.89k, False: 1.42k]
  |  Branch (628:19): [True: 4.89k, False: 1.00k]
  ------------------
  629|  4.89k|    return TRUE;
  ------------------
  |  | 1055|  4.89k|#define TRUE true
  ------------------
  630|       |
  631|  2.42k|  return FALSE;
  ------------------
  |  | 1058|  2.42k|#define FALSE false
  ------------------
  632|  7.31k|}
multi.c:close_connect_only:
  769|  1.90k|{
  770|  1.90k|  (void)userdata;
  771|  1.90k|  (void)data;
  772|  1.90k|  if(conn->bits.connect_only)
  ------------------
  |  Branch (772:6): [True: 0, False: 1.90k]
  ------------------
  773|      0|    connclose(conn, "Removing connect-only easy handle");
  ------------------
  |  |  103|      0|#define connclose(x, y)   Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
  |  |  ------------------
  |  |  |  |   91|      0|#define CONNCTRL_CONNECTION 1
  |  |  ------------------
  ------------------
  774|  1.90k|}
multi.c:mstate_connecting_pollset:
 1024|   150k|{
 1025|   150k|  struct connectdata *conn = data->conn;
 1026|   150k|  curl_socket_t sockfd;
 1027|   150k|  CURLcode result = CURLE_OK;
 1028|       |
 1029|   150k|  if(Curl_xfer_recv_is_paused(data))
  ------------------
  |  Branch (1029:6): [True: 0, False: 150k]
  ------------------
 1030|      0|    return CURLE_OK;
 1031|       |  /* If a socket is set, receiving is default. If the socket
 1032|       |   * has not been determined yet (eyeballing), always ask the
 1033|       |   * connection filters for what to monitor. */
 1034|   150k|  sockfd = Curl_conn_get_first_socket(data);
 1035|   150k|  if(sockfd != CURL_SOCKET_BAD) {
  ------------------
  |  |  145|   150k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1035:6): [True: 72.5k, False: 77.9k]
  ------------------
 1036|  72.5k|    result = Curl_pollset_change(data, ps, sockfd, CURL_POLL_IN, 0);
  ------------------
  |  |  283|  72.5k|#define CURL_POLL_IN     1
  ------------------
 1037|  72.5k|    if(!result)
  ------------------
  |  Branch (1037:8): [True: 72.5k, False: 0]
  ------------------
 1038|  72.5k|      result = multi_adjust_pollset(data, ps);
 1039|  72.5k|  }
 1040|   150k|  if(!result)
  ------------------
  |  Branch (1040:6): [True: 150k, False: 0]
  ------------------
 1041|   150k|    result = Curl_conn_adjust_pollset(data, conn, ps);
 1042|   150k|  return result;
 1043|   150k|}
multi.c:multi_adjust_pollset:
  979|  3.50M|{
  980|  3.50M|  CURLcode result = CURLE_OK;
  981|       |
  982|  3.50M|  if(ps->n) {
  ------------------
  |  Branch (982:6): [True: 3.50M, False: 2]
  ------------------
  983|  3.50M|    const struct curltime *pnow = Curl_pgrs_now(data);
  984|  3.50M|    bool send_blocked, recv_blocked;
  985|       |
  986|  3.50M|    recv_blocked = (Curl_rlimit_avail(&data->progress.dl.rlimit, pnow) <= 0);
  987|  3.50M|    send_blocked = (Curl_rlimit_avail(&data->progress.ul.rlimit, pnow) <= 0);
  988|  3.50M|    if(send_blocked || recv_blocked) {
  ------------------
  |  Branch (988:8): [True: 0, False: 3.50M]
  |  Branch (988:24): [True: 0, False: 3.50M]
  ------------------
  989|      0|      int i;
  990|      0|      for(i = 0; i <= SECONDARYSOCKET; ++i) {
  ------------------
  |  |  304|      0|#define SECONDARYSOCKET 1
  ------------------
  |  Branch (990:18): [True: 0, False: 0]
  ------------------
  991|      0|        curl_socket_t sock = data->conn->sock[i];
  992|      0|        if(sock == CURL_SOCKET_BAD)
  ------------------
  |  |  145|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (992:12): [True: 0, False: 0]
  ------------------
  993|      0|          continue;
  994|      0|        if(recv_blocked && Curl_pollset_want_recv(data, ps, sock)) {
  ------------------
  |  Branch (994:12): [True: 0, False: 0]
  |  Branch (994:28): [True: 0, False: 0]
  ------------------
  995|      0|          result = Curl_pollset_remove_in(data, ps, sock);
  ------------------
  |  |  164|      0|  Curl_pollset_change(data, ps, sock, 0, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  283|      0|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
  996|      0|          if(result)
  ------------------
  |  Branch (996:14): [True: 0, False: 0]
  ------------------
  997|      0|            break;
  998|      0|        }
  999|      0|        if(send_blocked && Curl_pollset_want_send(data, ps, sock)) {
  ------------------
  |  Branch (999:12): [True: 0, False: 0]
  |  Branch (999:28): [True: 0, False: 0]
  ------------------
 1000|      0|          result = Curl_pollset_remove_out(data, ps, sock);
  ------------------
  |  |  168|      0|  Curl_pollset_change(data, ps, sock, 0, CURL_POLL_OUT)
  |  |  ------------------
  |  |  |  |  284|      0|#define CURL_POLL_OUT    2
  |  |  ------------------
  ------------------
 1001|      0|          if(result)
  ------------------
  |  Branch (1001:14): [True: 0, False: 0]
  ------------------
 1002|      0|            break;
 1003|      0|        }
 1004|      0|      }
 1005|      0|    }
 1006|       |
 1007|       |    /* Not blocked and wanting to receive. If there is data pending
 1008|       |     * in the connection filters, make transfer run again. */
 1009|  3.50M|    if(!recv_blocked &&
  ------------------
  |  Branch (1009:8): [True: 3.50M, False: 0]
  ------------------
 1010|  3.50M|       ((Curl_pollset_want_recv(data, ps, data->conn->sock[FIRSTSOCKET]) &&
  ------------------
  |  |  303|  3.50M|#define FIRSTSOCKET     0
  ------------------
  |  Branch (1010:10): [True: 3.42M, False: 72.6k]
  ------------------
 1011|  3.42M|         Curl_conn_data_pending(data, FIRSTSOCKET)) ||
  ------------------
  |  |  303|  3.42M|#define FIRSTSOCKET     0
  ------------------
  |  Branch (1011:10): [True: 0, False: 3.42M]
  ------------------
 1012|  3.50M|        (Curl_pollset_want_recv(data, ps, data->conn->sock[SECONDARYSOCKET]) &&
  ------------------
  |  |  304|  3.50M|#define SECONDARYSOCKET 1
  ------------------
  |  Branch (1012:10): [True: 2, False: 3.50M]
  ------------------
 1013|      2|         Curl_conn_data_pending(data, SECONDARYSOCKET)))) {
  ------------------
  |  |  304|      2|#define SECONDARYSOCKET 1
  ------------------
  |  Branch (1013:10): [True: 0, False: 2]
  ------------------
 1014|      0|      CURL_TRC_M(data, "pollset[] has POLLIN, but there is still "
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1015|      0|                 "buffered input -> mark as dirty");
 1016|      0|      Curl_multi_mark_dirty(data);
 1017|      0|    }
 1018|  3.50M|  }
 1019|  3.50M|  return result;
 1020|  3.50M|}
multi.c:mstate_protocol_pollset:
 1047|  6.06k|{
 1048|  6.06k|  struct connectdata *conn = data->conn;
 1049|  6.06k|  CURLcode result = CURLE_OK;
 1050|       |
 1051|  6.06k|  if(conn->scheme->run->proto_pollset)
  ------------------
  |  Branch (1051:6): [True: 6.06k, False: 0]
  ------------------
 1052|  6.06k|    result = conn->scheme->run->proto_pollset(data, ps);
 1053|      0|  else {
 1054|      0|    curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
  ------------------
  |  |  303|      0|#define FIRSTSOCKET     0
  ------------------
 1055|      0|    if(sockfd != CURL_SOCKET_BAD) {
  ------------------
  |  |  145|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1055:8): [True: 0, False: 0]
  ------------------
 1056|       |      /* Default is to wait to something from the server */
 1057|      0|      result = Curl_pollset_change(data, ps, sockfd, CURL_POLL_IN, 0);
  ------------------
  |  |  283|      0|#define CURL_POLL_IN     1
  ------------------
 1058|      0|    }
 1059|      0|  }
 1060|  6.06k|  if(!result)
  ------------------
  |  Branch (1060:6): [True: 6.06k, False: 0]
  ------------------
 1061|  6.06k|    result = multi_adjust_pollset(data, ps);
 1062|  6.06k|  if(!result)
  ------------------
  |  Branch (1062:6): [True: 6.06k, False: 0]
  ------------------
 1063|  6.06k|    result = Curl_conn_adjust_pollset(data, conn, ps);
 1064|  6.06k|  return result;
 1065|  6.06k|}
multi.c:mstate_do_pollset:
 1069|  1.14k|{
 1070|  1.14k|  struct connectdata *conn = data->conn;
 1071|  1.14k|  CURLcode result = CURLE_OK;
 1072|       |
 1073|  1.14k|  if(conn->scheme->run->doing_pollset)
  ------------------
  |  Branch (1073:6): [True: 1.14k, False: 0]
  ------------------
 1074|  1.14k|    result = conn->scheme->run->doing_pollset(data, ps);
 1075|      0|  else if(CONN_SOCK_IDX_VALID(conn->send_idx)) {
  ------------------
  |  |  382|      0|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 0, False: 0]
  |  |  |  Branch (382:50): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1076|       |    /* Default is that we want to send something to the server */
 1077|      0|    result = Curl_pollset_add_out(data, ps, conn->sock[conn->send_idx]);
  ------------------
  |  |  166|      0|  Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, 0)
  |  |  ------------------
  |  |  |  |  284|      0|#define CURL_POLL_OUT    2
  |  |  ------------------
  ------------------
 1078|      0|  }
 1079|  1.14k|  if(!result)
  ------------------
  |  Branch (1079:6): [True: 1.14k, False: 0]
  ------------------
 1080|  1.14k|    result = multi_adjust_pollset(data, ps);
 1081|  1.14k|  if(!result)
  ------------------
  |  Branch (1081:6): [True: 1.14k, False: 0]
  ------------------
 1082|  1.14k|    result = Curl_conn_adjust_pollset(data, conn, ps);
 1083|  1.14k|  return result;
 1084|  1.14k|}
multi.c:mstate_domore_pollset:
 1088|   154k|{
 1089|   154k|  struct connectdata *conn = data->conn;
 1090|   154k|  CURLcode result = CURLE_OK;
 1091|       |
 1092|   154k|  if(conn->scheme->run->domore_pollset)
  ------------------
  |  Branch (1092:6): [True: 154k, False: 0]
  ------------------
 1093|   154k|    result = conn->scheme->run->domore_pollset(data, ps);
 1094|      0|  else if(CONN_SOCK_IDX_VALID(conn->send_idx)) {
  ------------------
  |  |  382|      0|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 0, False: 0]
  |  |  |  Branch (382:50): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1095|       |    /* Default is that we want to send something to the server */
 1096|      0|    result = Curl_pollset_add_out(data, ps, conn->sock[conn->send_idx]);
  ------------------
  |  |  166|      0|  Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, 0)
  |  |  ------------------
  |  |  |  |  284|      0|#define CURL_POLL_OUT    2
  |  |  ------------------
  ------------------
 1097|      0|  }
 1098|   154k|  if(!result)
  ------------------
  |  Branch (1098:6): [True: 154k, False: 0]
  ------------------
 1099|   154k|    result = multi_adjust_pollset(data, ps);
 1100|   154k|  if(!result)
  ------------------
  |  Branch (1100:6): [True: 154k, False: 0]
  ------------------
 1101|   154k|    result = Curl_conn_adjust_pollset(data, conn, ps);
 1102|   154k|  return result;
 1103|   154k|}
multi.c:mstate_perform_pollset:
 1107|  3.26M|{
 1108|  3.26M|  struct connectdata *conn = data->conn;
 1109|  3.26M|  CURLcode result = CURLE_OK;
 1110|       |
 1111|  3.26M|  if(conn->scheme->run->perform_pollset)
  ------------------
  |  Branch (1111:6): [True: 3.26M, False: 64]
  ------------------
 1112|  3.26M|    result = conn->scheme->run->perform_pollset(data, ps);
 1113|     64|  else {
 1114|       |    /* Default is to obey the request flags for send/recv */
 1115|     64|    if(Curl_req_want_recv(data) && CONN_SOCK_IDX_VALID(conn->recv_idx)) {
  ------------------
  |  |  382|      2|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 2, False: 0]
  |  |  |  Branch (382:50): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1115:8): [True: 2, False: 62]
  ------------------
 1116|      2|      result = Curl_pollset_add_in(data, ps, conn->sock[conn->recv_idx]);
  ------------------
  |  |  162|      2|  Curl_pollset_change(data, ps, sock, CURL_POLL_IN, 0)
  |  |  ------------------
  |  |  |  |  283|      2|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
 1117|      2|    }
 1118|     64|    if(!result && Curl_req_want_send(data) &&
  ------------------
  |  Branch (1118:8): [True: 64, False: 0]
  |  Branch (1118:19): [True: 62, False: 2]
  ------------------
 1119|     62|       CONN_SOCK_IDX_VALID(conn->send_idx)) {
  ------------------
  |  |  382|     62|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 62, False: 0]
  |  |  |  Branch (382:50): [True: 62, False: 0]
  |  |  ------------------
  ------------------
 1120|     62|      result = Curl_pollset_add_out(data, ps, conn->sock[conn->send_idx]);
  ------------------
  |  |  166|     62|  Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, 0)
  |  |  ------------------
  |  |  |  |  284|     62|#define CURL_POLL_OUT    2
  |  |  ------------------
  ------------------
 1121|     62|    }
 1122|     64|  }
 1123|  3.26M|  if(!result)
  ------------------
  |  Branch (1123:6): [True: 3.26M, False: 0]
  ------------------
 1124|  3.26M|    result = multi_adjust_pollset(data, ps);
 1125|  3.26M|  if(!result)
  ------------------
  |  Branch (1125:6): [True: 3.26M, False: 0]
  ------------------
 1126|  3.26M|    result = Curl_conn_adjust_pollset(data, conn, ps);
 1127|  3.26M|  return result;
 1128|  3.26M|}
multi.c:multi_perform:
 2856|  3.51M|{
 2857|  3.51M|  CURLMcode returncode = CURLM_OK;
 2858|  3.51M|  struct curltime start = *multi_now(multi);
 2859|  3.51M|  uint32_t mid;
 2860|  3.51M|  struct Curl_sigpipe_ctx sigpipe_ctx;
 2861|       |
 2862|  3.51M|  if(multi->in_callback)
  ------------------
  |  Branch (2862:6): [True: 0, False: 3.51M]
  ------------------
 2863|      0|    return CURLM_RECURSIVE_API_CALL;
 2864|       |
 2865|  3.51M|  if(multi->in_ntfy_callback)
  ------------------
  |  Branch (2865:6): [True: 0, False: 3.51M]
  ------------------
 2866|      0|    return CURLM_RECURSIVE_API_CALL;
 2867|       |
 2868|  3.51M|  sigpipe_init(&sigpipe_ctx);
 2869|       |
 2870|  3.51M|  if(Curl_uint32_bset_first(&multi->process, &mid)) {
  ------------------
  |  Branch (2870:6): [True: 3.51M, False: 0]
  ------------------
 2871|  3.51M|    CURL_TRC_M(multi->admin, "multi_perform(running=%u)",
  ------------------
  |  |  148|  3.51M|  do {                                   \
  |  |  149|  3.51M|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  3.51M|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  3.51M|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  7.03M|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 3.51M, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 3.51M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  7.03M|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  3.51M|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.51M|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  3.51M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 3.51M]
  |  |  ------------------
  ------------------
 2872|  3.51M|               Curl_multi_xfers_running(multi));
 2873|  7.11M|    do {
 2874|  7.11M|      struct Curl_easy *data = Curl_multi_get_easy(multi, mid);
 2875|  7.11M|      CURLMcode mresult;
 2876|  7.11M|      if(!data) {
  ------------------
  |  Branch (2876:10): [True: 0, False: 7.11M]
  ------------------
 2877|      0|        DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2877:9): [Folded, False: 0]
  |  Branch (2877:9): [Folded, False: 0]
  ------------------
 2878|      0|        Curl_uint32_bset_remove(&multi->process, mid);
 2879|      0|        Curl_uint32_bset_remove(&multi->dirty, mid);
 2880|      0|        continue;
 2881|      0|      }
 2882|  7.11M|      mresult = multi_runsingle(multi, data, &sigpipe_ctx);
 2883|  7.11M|      if(mresult)
  ------------------
  |  Branch (2883:10): [True: 0, False: 7.11M]
  ------------------
 2884|      0|        returncode = mresult;
 2885|  7.11M|    } while(Curl_uint32_bset_next(&multi->process, mid, &mid));
  ------------------
  |  Branch (2885:13): [True: 3.59M, False: 3.51M]
  ------------------
 2886|  3.51M|  }
 2887|  3.51M|  sigpipe_restore(&sigpipe_ctx);
 2888|       |
 2889|  3.51M|  if(multi_ischanged(multi, TRUE))
  ------------------
  |  | 1055|  3.51M|#define TRUE true
  ------------------
  |  Branch (2889:6): [True: 11.0k, False: 3.50M]
  ------------------
 2890|  11.0k|    process_pending_handles(multi);
 2891|       |
 2892|  3.51M|  if(!returncode && CURL_MNTFY_HAS_ENTRIES(multi))
  ------------------
  |  |   56|  3.51M|#define CURL_MNTFY_HAS_ENTRIES(m)       ((m)->ntfy.has_entries)
  |  |  ------------------
  |  |  |  Branch (56:41): [True: 0, False: 3.51M]
  |  |  ------------------
  ------------------
  |  Branch (2892:6): [True: 3.51M, False: 0]
  ------------------
 2893|      0|    returncode = Curl_mntfy_dispatch_all(multi);
 2894|       |
 2895|       |  /*
 2896|       |   * Remove all expired timers from the splay since handles are dealt
 2897|       |   * with unconditionally by this function and curl_multi_timeout() requires
 2898|       |   * that already passed/handled expire times are removed from the splay.
 2899|       |   *
 2900|       |   * It is important that the 'now' value is set at the entry of this function
 2901|       |   * and not for the current time as it may have ticked a little while since
 2902|       |   * then and then we risk this loop to remove timers that actually have not
 2903|       |   * been handled!
 2904|       |   */
 2905|  3.51M|  if(multi->timetree) {
  ------------------
  |  Branch (2905:6): [True: 3.50M, False: 16.8k]
  ------------------
 2906|  3.50M|    struct Curl_tree *t = NULL;
 2907|  3.50M|    do {
 2908|  3.50M|      multi->timetree = Curl_splaygetbest(&start, multi->timetree, &t);
 2909|  3.50M|      if(t) {
  ------------------
  |  Branch (2909:10): [True: 11, False: 3.50M]
  ------------------
 2910|       |        /* the removed may have another timeout in queue */
 2911|     11|        struct Curl_easy *data = Curl_splayget(t);
 2912|     11|        (void)add_next_timeout(&start, multi, data);
 2913|     11|        if(data->mstate == MSTATE_PENDING) {
  ------------------
  |  Branch (2913:12): [True: 0, False: 11]
  ------------------
 2914|      0|          bool stream_unused;
 2915|      0|          CURLcode result_unused;
 2916|      0|          if(multi_handle_timeout(data, &stream_unused, &result_unused)) {
  ------------------
  |  Branch (2916:14): [True: 0, False: 0]
  ------------------
 2917|      0|            infof(data, "PENDING handle timeout");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2918|      0|            move_pending_to_connect(multi, data);
 2919|      0|          }
 2920|      0|        }
 2921|     11|      }
 2922|  3.50M|    } while(t);
  ------------------
  |  Branch (2922:13): [True: 11, False: 3.50M]
  ------------------
 2923|  3.50M|  }
 2924|       |
 2925|  3.51M|  if(running_handles) {
  ------------------
  |  Branch (2925:6): [True: 3.51M, False: 0]
  ------------------
 2926|  3.51M|    unsigned int running = Curl_multi_xfers_running(multi);
 2927|  3.51M|    *running_handles = (running < INT_MAX) ? (int)running : INT_MAX;
  ------------------
  |  Branch (2927:24): [True: 3.51M, False: 0]
  ------------------
 2928|  3.51M|  }
 2929|       |
 2930|  3.51M|  if(CURLM_OK >= returncode)
  ------------------
  |  Branch (2930:6): [True: 3.51M, False: 0]
  ------------------
 2931|  3.51M|    returncode = Curl_update_timer(multi);
 2932|       |
 2933|  3.51M|  return returncode;
 2934|  3.51M|}
multi.c:multi_now:
  104|  3.51M|{
  105|  3.51M|  curlx_pnow(&multi->now);
  106|  3.51M|  return &multi->now;
  107|  3.51M|}
multi.c:multi_runsingle:
 2687|  7.11M|{
 2688|  7.11M|  CURLMcode mresult;
 2689|  7.11M|  CURLcode result = CURLE_OK;
 2690|       |
 2691|  7.11M|  if(!GOOD_EASY_HANDLE(data))
  ------------------
  |  |  136|  7.11M|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  130|  7.11M|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  | 1055|  7.11M|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (136:5): [True: 7.11M, False: 0]
  |  |  |  Branch (136:12): [True: 7.11M, False: 0]
  |  |  ------------------
  |  |  137|  7.11M|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (2691:6): [True: 0, False: 7.11M]
  |  Branch (2691:7): [True: 0, False: 0]
  |  Branch (2691:7): [True: 0, False: 0]
  ------------------
 2692|      0|    return CURLM_BAD_EASY_HANDLE;
 2693|       |
 2694|  7.11M|  if(multi->dead) {
  ------------------
  |  Branch (2694:6): [True: 0, False: 7.11M]
  ------------------
 2695|       |    /* a multi-level callback returned error before, meaning every individual
 2696|       |     transfer now has failed */
 2697|      0|    result = CURLE_ABORTED_BY_CALLBACK;
 2698|      0|    multi_posttransfer(data);
 2699|      0|    multi_done(data, result, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2700|      0|    multistate(data, MSTATE_COMPLETED);
  ------------------
  |  |  200|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2701|      0|  }
 2702|       |
 2703|  7.11M|  multi_warn_debug(multi, data);
 2704|       |
 2705|       |  /* transfer runs now, clear the dirty bit. This may be set
 2706|       |   * again during processing, triggering a re-run later. */
 2707|  7.11M|  Curl_uint32_bset_remove(&multi->dirty, data->mid);
 2708|       |
 2709|  7.11M|  if(data == multi->admin) {
  ------------------
  |  Branch (2709:6): [True: 3.51M, False: 3.59M]
  ------------------
 2710|  3.51M|#ifdef ENABLE_WAKEUP
 2711|       |    /* Consume any pending wakeup signals before processing.
 2712|       |     * This is necessary for event based processing. See #21547 */
 2713|  3.51M|    (void)Curl_wakeup_consume(multi->wakeup_pair, TRUE);
  ------------------
  |  | 1055|  3.51M|#define TRUE true
  ------------------
 2714|  3.51M|#endif
 2715|  3.51M|#ifdef USE_RESOLV_THREADED
 2716|  3.51M|    Curl_async_thrdd_multi_process(multi);
 2717|  3.51M|#endif
 2718|  3.51M|    Curl_cshutdn_perform(&multi->cshutdn, multi->admin, sigpipe_ctx);
 2719|  3.51M|    return CURLM_OK;
 2720|  3.51M|  }
 2721|       |
 2722|  3.59M|  sigpipe_apply(data, sigpipe_ctx);
 2723|  3.67M|  do {
 2724|       |    /* A "stream" here is a logical stream if the protocol can handle that
 2725|       |       (HTTP/2), or the full connection for older protocols */
 2726|  3.67M|    bool stream_error = FALSE;
  ------------------
  |  | 1058|  3.67M|#define FALSE false
  ------------------
 2727|  3.67M|    mresult = CURLM_OK;
 2728|       |
 2729|  3.67M|    if(multi_ischanged(multi, TRUE)) {
  ------------------
  |  | 1055|  3.67M|#define TRUE true
  ------------------
  |  Branch (2729:8): [True: 5.66k, False: 3.67M]
  ------------------
 2730|  5.66k|      CURL_TRC_M(data, "multi changed, check CONNECT_PEND queue");
  ------------------
  |  |  148|  5.66k|  do {                                   \
  |  |  149|  5.66k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  5.66k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  5.66k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  11.3k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 5.66k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 5.66k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  11.3k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  5.66k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  5.66k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  5.66k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 5.66k]
  |  |  ------------------
  ------------------
 2731|  5.66k|      process_pending_handles(multi); /* multiplexed */
 2732|  5.66k|    }
 2733|       |
 2734|  3.67M|    if(data->mstate > MSTATE_CONNECT &&
  ------------------
  |  Branch (2734:8): [True: 3.62M, False: 49.1k]
  ------------------
 2735|  3.62M|       data->mstate < MSTATE_COMPLETED) {
  ------------------
  |  Branch (2735:8): [True: 3.62M, False: 0]
  ------------------
 2736|       |      /* Make sure we set the connection's current owner */
 2737|  3.62M|      DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|  3.62M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2737:7): [True: 0, False: 3.62M]
  |  Branch (2737:7): [True: 3.62M, False: 0]
  ------------------
 2738|  3.62M|      if(!data->conn)
  ------------------
  |  Branch (2738:10): [True: 0, False: 3.62M]
  ------------------
 2739|      0|        return CURLM_INTERNAL_ERROR;
 2740|  3.62M|    }
 2741|       |
 2742|       |    /* Wait for the connect state as only then is the start time stored, but
 2743|       |       we must not check already completed handles */
 2744|  3.67M|    if((data->mstate >= MSTATE_CONNECT) && (data->mstate < MSTATE_COMPLETED) &&
  ------------------
  |  Branch (2744:8): [True: 3.64M, False: 33.5k]
  |  Branch (2744:44): [True: 3.64M, False: 0]
  ------------------
 2745|  3.64M|       multi_handle_timeout(data, &stream_error, &result))
  ------------------
  |  Branch (2745:8): [True: 119, False: 3.64M]
  ------------------
 2746|       |      /* Skip the statemachine and go directly to error handling section. */
 2747|    119|      goto statemachine_end;
 2748|       |
 2749|  3.67M|    switch(data->mstate) {
 2750|  18.0k|    case MSTATE_INIT:
  ------------------
  |  Branch (2750:5): [True: 18.0k, False: 3.66M]
  ------------------
 2751|       |      /* Transitional state. init this transfer. A handle never comes back to
 2752|       |         this state. */
 2753|  18.0k|      mresult = multistate_init(data, &result);
 2754|  18.0k|      break;
 2755|       |
 2756|  15.4k|    case MSTATE_SETUP:
  ------------------
  |  Branch (2756:5): [True: 15.4k, False: 3.66M]
  ------------------
 2757|       |      /* Transitional state. Setup things for a new transfer. The handle
 2758|       |         can come back to this state on a redirect. */
 2759|  15.4k|      mresult = multistate_setup(data);
 2760|  15.4k|      break;
 2761|       |
 2762|  15.5k|    case MSTATE_CONNECT:
  ------------------
  |  Branch (2762:5): [True: 15.5k, False: 3.66M]
  ------------------
 2763|  15.5k|      mresult = multistate_connect(multi, data, &result);
 2764|  15.5k|      break;
 2765|       |
 2766|   164k|    case MSTATE_CONNECTING:
  ------------------
  |  Branch (2766:5): [True: 164k, False: 3.51M]
  ------------------
 2767|       |      /* awaiting a completion of an asynch TCP connect */
 2768|   164k|      mresult = multistate_connecting(data, &stream_error, &result);
 2769|   164k|      break;
 2770|       |
 2771|  9.00k|    case MSTATE_PROTOCONNECT:
  ------------------
  |  Branch (2771:5): [True: 9.00k, False: 3.66M]
  ------------------
 2772|  9.00k|      mresult = multistate_protoconnect(data, &stream_error, &result);
 2773|  9.00k|      break;
 2774|       |
 2775|  7.66k|    case MSTATE_PROTOCONNECTING:
  ------------------
  |  Branch (2775:5): [True: 7.66k, False: 3.67M]
  ------------------
 2776|       |      /* protocol-specific connect phase */
 2777|  7.66k|      mresult = multistate_protoconnecting(data, &stream_error, &result);
 2778|  7.66k|      break;
 2779|       |
 2780|  8.35k|    case MSTATE_DO:
  ------------------
  |  Branch (2780:5): [True: 8.35k, False: 3.67M]
  ------------------
 2781|  8.35k|      mresult = multistate_do(data, &stream_error, &result);
 2782|  8.35k|      break;
 2783|       |
 2784|  2.36k|    case MSTATE_DOING:
  ------------------
  |  Branch (2784:5): [True: 2.36k, False: 3.67M]
  ------------------
 2785|       |      /* we continue DOING until the DO phase is complete */
 2786|  2.36k|      mresult = multistate_doing(data, &stream_error, &result);
 2787|  2.36k|      break;
 2788|       |
 2789|   155k|    case MSTATE_DOING_MORE:
  ------------------
  |  Branch (2789:5): [True: 155k, False: 3.52M]
  ------------------
 2790|       |      /*
 2791|       |       * When we are connected, DOING MORE and then go DID
 2792|       |       */
 2793|   155k|      mresult = multistate_doing_more(data, &stream_error, &result);
 2794|   155k|      break;
 2795|       |
 2796|  7.56k|    case MSTATE_DID:
  ------------------
  |  Branch (2796:5): [True: 7.56k, False: 3.67M]
  ------------------
 2797|  7.56k|      mresult = multistate_did(multi, data);
 2798|  7.56k|      break;
 2799|       |
 2800|    160|    case MSTATE_RATELIMITING: /* limit-rate exceeded in either direction */
  ------------------
  |  Branch (2800:5): [True: 160, False: 3.67M]
  ------------------
 2801|    160|      mresult = multistate_ratelimiting(data, &result);
 2802|    160|      break;
 2803|       |
 2804|  3.27M|    case MSTATE_PERFORMING:
  ------------------
  |  Branch (2804:5): [True: 3.27M, False: 404k]
  ------------------
 2805|  3.27M|      mresult = multistate_performing(data, &stream_error, &result);
 2806|  3.27M|      break;
 2807|       |
 2808|  1.42k|    case MSTATE_DONE:
  ------------------
  |  Branch (2808:5): [True: 1.42k, False: 3.67M]
  ------------------
 2809|  1.42k|      mresult = multistate_done(data, &result);
 2810|  1.42k|      break;
 2811|       |
 2812|      0|    case MSTATE_COMPLETED:
  ------------------
  |  Branch (2812:5): [True: 0, False: 3.67M]
  ------------------
 2813|      0|      break;
 2814|       |
 2815|      0|    case MSTATE_PENDING:
  ------------------
  |  Branch (2815:5): [True: 0, False: 3.67M]
  ------------------
 2816|      0|    case MSTATE_MSGSENT:
  ------------------
  |  Branch (2816:5): [True: 0, False: 3.67M]
  ------------------
 2817|       |      /* handles in these states should NOT be in this list */
 2818|      0|      break;
 2819|       |
 2820|      0|    default:
  ------------------
  |  Branch (2820:5): [True: 0, False: 3.67M]
  ------------------
 2821|      0|      return CURLM_INTERNAL_ERROR;
 2822|  3.67M|    }
 2823|       |
 2824|  3.67M|    if(data->mstate >= MSTATE_CONNECT &&
  ------------------
  |  Branch (2824:8): [True: 3.65M, False: 19.6k]
  ------------------
 2825|  3.65M|       data->mstate < MSTATE_DO &&
  ------------------
  |  Branch (2825:8): [True: 203k, False: 3.45M]
  ------------------
 2826|   203k|       mresult != CURLM_CALL_MULTI_PERFORM &&
  ------------------
  |  Branch (2826:8): [True: 163k, False: 40.0k]
  ------------------
 2827|   163k|       !multi_ischanged(multi, FALSE)) {
  ------------------
  |  | 1058|   163k|#define FALSE false
  ------------------
  |  Branch (2827:8): [True: 158k, False: 5.26k]
  ------------------
 2828|       |      /* We now handle stream timeouts if and only if this will be the last
 2829|       |       * loop iteration. We only check this on the last iteration to ensure
 2830|       |       * that if we know we have additional work to do immediately
 2831|       |       * (i.e. CURLM_CALL_MULTI_PERFORM == TRUE) then we should do that before
 2832|       |       * declaring the connection timed out as we may almost have a completed
 2833|       |       * connection. */
 2834|   158k|      multi_handle_timeout(data, &stream_error, &result);
 2835|   158k|    }
 2836|       |
 2837|  3.67M|statemachine_end:
 2838|       |
 2839|  3.67M|    result = is_finished(multi, data, stream_error, result);
 2840|  3.67M|    if(result)
  ------------------
  |  Branch (2840:8): [True: 16.8k, False: 3.66M]
  ------------------
 2841|  16.8k|      mresult = CURLM_CALL_MULTI_PERFORM;
 2842|       |
 2843|  3.67M|    if(MSTATE_COMPLETED == data->mstate) {
  ------------------
  |  Branch (2843:8): [True: 17.3k, False: 3.66M]
  ------------------
 2844|  17.3k|      handle_completed(multi, data, result);
 2845|  17.3k|      return CURLM_OK;
 2846|  17.3k|    }
 2847|  3.67M|  } while((mresult == CURLM_CALL_MULTI_PERFORM) ||
  ------------------
  |  Branch (2847:11): [True: 82.6k, False: 3.57M]
  ------------------
 2848|  3.57M|          multi_ischanged(multi, FALSE));
  ------------------
  |  | 1058|  3.57M|#define FALSE false
  ------------------
  |  Branch (2848:11): [True: 315, False: 3.57M]
  ------------------
 2849|       |
 2850|  3.57M|  data->result = result;
 2851|  3.57M|  return mresult;
 2852|  3.59M|}
multi.c:multi_posttransfer:
 1931|  14.6k|{
 1932|       |#if defined(HAVE_SIGNAL) && defined(SIGPIPE) && !defined(MSG_NOSIGNAL)
 1933|       |  /* restore the signal handler for SIGPIPE before we get back */
 1934|       |  if(!data->set.no_signal)
 1935|       |    signal(SIGPIPE, data->state.prev_signal);
 1936|       |#else
 1937|  14.6k|  (void)data;
 1938|  14.6k|#endif
 1939|  14.6k|}
multi.c:multistate_init:
 2457|  18.0k|{
 2458|  18.0k|  *result = Curl_pretransfer(data);
 2459|  18.0k|  if(*result)
  ------------------
  |  Branch (2459:6): [True: 3.34k, False: 14.6k]
  ------------------
 2460|  3.34k|    return CURLM_OK;
 2461|       |
 2462|       |  /* after init, go SETUP */
 2463|  14.6k|  multistate(data, MSTATE_SETUP);
  ------------------
  |  |  200|  14.6k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2464|  14.6k|  Curl_pgrsTime(data, TIMER_STARTOP);
 2465|  14.6k|  return CURLM_CALL_MULTI_PERFORM;
 2466|  18.0k|}
multi.c:multistate_setup:
 2469|  15.4k|{
 2470|  15.4k|  Curl_pgrsTime(data, TIMER_STARTSINGLE);
 2471|  15.4k|  if(data->set.timeout)
  ------------------
  |  Branch (2471:6): [True: 15.4k, False: 0]
  ------------------
 2472|  15.4k|    Curl_expire(data, data->set.timeout, EXPIRE_TIMEOUT);
 2473|  15.4k|  if(data->set.connecttimeout)
  ------------------
  |  Branch (2473:6): [True: 350, False: 15.1k]
  ------------------
 2474|       |    /* Since a connection might go to pending and back to CONNECT several
 2475|       |       times before it actually takes off, we need to set the timeout once
 2476|       |       in SETUP before we enter CONNECT the first time. */
 2477|    350|    Curl_expire(data, data->set.connecttimeout, EXPIRE_CONNECTTIMEOUT);
 2478|       |
 2479|  15.4k|  multistate(data, MSTATE_CONNECT);
  ------------------
  |  |  200|  15.4k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2480|  15.4k|  return CURLM_CALL_MULTI_PERFORM;
 2481|  15.4k|}
multi.c:multistate_connect:
 2311|  15.5k|{
 2312|       |  /* Connect. We want to get a connection identifier filled in. This state can
 2313|       |     be entered from SETUP and from PENDING. */
 2314|  15.5k|  bool connected;
 2315|  15.5k|  CURLMcode mresult = CURLM_OK;
 2316|  15.5k|  CURLcode result = Curl_connect(data, &connected);
 2317|  15.5k|  if(result == CURLE_NO_CONNECTION_AVAILABLE) {
  ------------------
  |  Branch (2317:6): [True: 204, False: 15.3k]
  ------------------
 2318|       |    /* There was no connection available. We will go to the pending state and
 2319|       |       wait for an available connection. */
 2320|    204|    multistate(data, MSTATE_PENDING);
  ------------------
  |  |  200|    204|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2321|       |    /* move from process to pending set */
 2322|    204|    Curl_uint32_bset_remove(&multi->process, data->mid);
 2323|    204|    Curl_uint32_bset_remove(&multi->dirty, data->mid);
 2324|    204|    Curl_uint32_bset_add(&multi->pending, data->mid);
 2325|    204|    *resultp = CURLE_OK;
 2326|    204|    return mresult;
 2327|    204|  }
 2328|  15.3k|  else
 2329|  15.3k|    process_pending_handles(data->multi);
 2330|       |
 2331|  15.3k|  if(!result) {
  ------------------
  |  Branch (2331:6): [True: 13.8k, False: 1.51k]
  ------------------
 2332|       |    /* after the connect has been sent off, go WAITCONNECT unless the
 2333|       |       protocol connect is already done and we can go directly to WAITDO or
 2334|       |       DO! */
 2335|  13.8k|    mresult = CURLM_CALL_MULTI_PERFORM;
 2336|       |
 2337|  13.8k|    if(connected) {
  ------------------
  |  Branch (2337:8): [True: 0, False: 13.8k]
  ------------------
 2338|      0|      if(!data->conn->bits.reuse &&
  ------------------
  |  Branch (2338:10): [True: 0, False: 0]
  ------------------
 2339|      0|         Curl_conn_is_multiplex(data->conn, FIRSTSOCKET)) {
  ------------------
  |  |  303|      0|#define FIRSTSOCKET     0
  ------------------
  |  Branch (2339:10): [True: 0, False: 0]
  ------------------
 2340|       |        /* new connection, can multiplex, wake pending handles */
 2341|      0|        process_pending_handles(data->multi);
 2342|      0|      }
 2343|      0|      multistate(data, MSTATE_PROTOCONNECT);
  ------------------
  |  |  200|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2344|      0|    }
 2345|  13.8k|    else {
 2346|  13.8k|      multistate(data, MSTATE_CONNECTING);
  ------------------
  |  |  200|  13.8k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2347|  13.8k|    }
 2348|  13.8k|  }
 2349|  15.3k|  *resultp = result;
 2350|  15.3k|  return mresult;
 2351|  15.5k|}
multi.c:multistate_connecting:
 2486|   164k|{
 2487|   164k|  bool connected;
 2488|       |
 2489|   164k|  if(!data->conn) {
  ------------------
  |  Branch (2489:6): [True: 0, False: 164k]
  ------------------
 2490|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2490:5): [Folded, False: 0]
  |  Branch (2490:5): [Folded, False: 0]
  ------------------
 2491|      0|    *result = CURLE_FAILED_INIT;
 2492|      0|    return CURLM_OK;
 2493|      0|  }
 2494|   164k|  if(!Curl_xfer_recv_is_paused(data)) {
  ------------------
  |  Branch (2494:6): [True: 164k, False: 0]
  ------------------
 2495|   164k|    *result = Curl_conn_connect(data, FIRSTSOCKET, FALSE, &connected);
  ------------------
  |  |  303|   164k|#define FIRSTSOCKET     0
  ------------------
                  *result = Curl_conn_connect(data, FIRSTSOCKET, FALSE, &connected);
  ------------------
  |  | 1058|   164k|#define FALSE false
  ------------------
 2496|   164k|    if(connected && !(*result)) {
  ------------------
  |  Branch (2496:8): [True: 9.00k, False: 155k]
  |  Branch (2496:21): [True: 9.00k, False: 0]
  ------------------
 2497|  9.00k|      if(!data->conn->bits.reuse &&
  ------------------
  |  Branch (2497:10): [True: 8.89k, False: 109]
  ------------------
 2498|  8.89k|         Curl_conn_is_multiplex(data->conn, FIRSTSOCKET)) {
  ------------------
  |  |  303|  8.89k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (2498:10): [True: 0, False: 8.89k]
  ------------------
 2499|       |        /* new connection, can multiplex, wake pending handles */
 2500|      0|        process_pending_handles(data->multi);
 2501|      0|      }
 2502|  9.00k|      multistate(data, MSTATE_PROTOCONNECT);
  ------------------
  |  |  200|  9.00k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2503|  9.00k|      return CURLM_CALL_MULTI_PERFORM;
 2504|  9.00k|    }
 2505|   155k|    else if(*result) {
  ------------------
  |  Branch (2505:13): [True: 4.63k, False: 150k]
  ------------------
 2506|       |      /* failure detected */
 2507|  4.63k|      CURL_TRC_M(data, "connect failed -> %d", *result);
  ------------------
  |  |  148|  4.63k|  do {                                   \
  |  |  149|  4.63k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  4.63k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  4.63k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  9.27k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 4.63k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4.63k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  9.27k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  4.63k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  4.63k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  4.63k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 4.63k]
  |  |  ------------------
  ------------------
 2508|  4.63k|      multi_posttransfer(data);
 2509|  4.63k|      multi_done(data, *result, TRUE);
  ------------------
  |  | 1055|  4.63k|#define TRUE true
  ------------------
 2510|  4.63k|      *stream_error = TRUE;
  ------------------
  |  | 1055|  4.63k|#define TRUE true
  ------------------
 2511|  4.63k|      return CURLM_OK;
 2512|  4.63k|    }
 2513|   164k|  }
 2514|   150k|  return CURLM_OK;
 2515|   164k|}
multi.c:multistate_protoconnect:
 2520|  9.00k|{
 2521|  9.00k|  bool protocol_connected = FALSE;
  ------------------
  |  | 1058|  9.00k|#define FALSE false
  ------------------
 2522|       |
 2523|  9.00k|  if(!(*result) && data->conn->bits.reuse) {
  ------------------
  |  Branch (2523:6): [True: 9.00k, False: 0]
  |  Branch (2523:20): [True: 109, False: 8.89k]
  ------------------
 2524|       |    /* ftp seems to hang when protoconnect on reused connection since we
 2525|       |     * handle PROTOCONNECT in general inside the filters, it seems wrong to
 2526|       |     * restart this on a reused connection.
 2527|       |     */
 2528|    109|    multistate(data, MSTATE_DO);
  ------------------
  |  |  200|    109|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2529|    109|    return CURLM_CALL_MULTI_PERFORM;
 2530|    109|  }
 2531|  8.89k|  if(!(*result))
  ------------------
  |  Branch (2531:6): [True: 8.89k, False: 0]
  ------------------
 2532|  8.89k|    *result = protocol_connect(data, &protocol_connected);
 2533|  8.89k|  if(!(*result) && !protocol_connected) {
  ------------------
  |  Branch (2533:6): [True: 8.39k, False: 504]
  |  Branch (2533:20): [True: 1.62k, False: 6.76k]
  ------------------
 2534|       |    /* switch to waiting state */
 2535|  1.62k|    multistate(data, MSTATE_PROTOCONNECTING);
  ------------------
  |  |  200|  1.62k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2536|  1.62k|    return CURLM_CALL_MULTI_PERFORM;
 2537|  1.62k|  }
 2538|  7.26k|  else if(!(*result)) {
  ------------------
  |  Branch (2538:11): [True: 6.76k, False: 504]
  ------------------
 2539|       |    /* protocol connect has completed, go WAITDO or DO */
 2540|  6.76k|    multistate(data, MSTATE_DO);
  ------------------
  |  |  200|  6.76k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2541|  6.76k|    return CURLM_CALL_MULTI_PERFORM;
 2542|  6.76k|  }
 2543|       |
 2544|       |  /* failure detected */
 2545|    504|  multi_posttransfer(data);
 2546|    504|  multi_done(data, *result, TRUE);
  ------------------
  |  | 1055|    504|#define TRUE true
  ------------------
 2547|       |  *stream_error = TRUE;
  ------------------
  |  | 1055|    504|#define TRUE true
  ------------------
 2548|    504|  return CURLM_OK;
 2549|  8.89k|}
multi.c:protocol_connect:
 1896|  8.89k|{
 1897|  8.89k|  struct connectdata *conn = data->conn;
 1898|  8.89k|  CURLcode result = CURLE_OK;
 1899|       |
 1900|  8.89k|  DEBUGASSERT(conn);
  ------------------
  |  | 1081|  8.89k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1900:3): [True: 0, False: 8.89k]
  |  Branch (1900:3): [True: 8.89k, False: 0]
  ------------------
 1901|  8.89k|  DEBUGASSERT(protocol_done);
  ------------------
  |  | 1081|  8.89k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1901:3): [True: 0, False: 8.89k]
  |  Branch (1901:3): [True: 8.89k, False: 0]
  ------------------
 1902|  8.89k|  DEBUGASSERT(Curl_conn_is_connected(conn, FIRSTSOCKET));
  ------------------
  |  | 1081|  8.89k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1902:3): [True: 0, False: 8.89k]
  |  Branch (1902:3): [True: 8.89k, False: 0]
  ------------------
 1903|       |
 1904|  8.89k|  *protocol_done = FALSE;
  ------------------
  |  | 1058|  8.89k|#define FALSE false
  ------------------
 1905|  8.89k|  if(!conn->bits.protoconnstart) {
  ------------------
  |  Branch (1905:6): [True: 8.89k, False: 0]
  ------------------
 1906|  8.89k|    if(conn->scheme->run->connect_it) {
  ------------------
  |  Branch (1906:8): [True: 2.13k, False: 6.76k]
  ------------------
 1907|       |      /* Call the protocol-specific connect function */
 1908|  2.13k|      result = conn->scheme->run->connect_it(data, protocol_done);
 1909|  2.13k|      if(result)
  ------------------
  |  Branch (1909:10): [True: 504, False: 1.62k]
  ------------------
 1910|    504|        return result;
 1911|  2.13k|    }
 1912|  8.39k|    conn->bits.protoconnstart = TRUE;
  ------------------
  |  | 1055|  8.39k|#define TRUE true
  ------------------
 1913|  8.39k|  }
 1914|       |
 1915|       |  /* Unless this protocol does not have any protocol-connect callback, as
 1916|       |     then we know we are done. */
 1917|  8.39k|  if(!conn->scheme->run->connecting)
  ------------------
  |  Branch (1917:6): [True: 6.76k, False: 1.62k]
  ------------------
 1918|  6.76k|    *protocol_done = TRUE;
  ------------------
  |  | 1055|  6.76k|#define TRUE true
  ------------------
 1919|  8.39k|  return CURLE_OK;
 1920|  8.89k|}
multi.c:multistate_protoconnecting:
 2554|  7.66k|{
 2555|  7.66k|  bool protocol_connected = FALSE;
  ------------------
  |  | 1058|  7.66k|#define FALSE false
  ------------------
 2556|       |
 2557|       |  /* protocol-specific connect phase */
 2558|  7.66k|  *result = protocol_connecting(data, &protocol_connected);
 2559|  7.66k|  if(!(*result) && protocol_connected) {
  ------------------
  |  Branch (2559:6): [True: 7.54k, False: 124]
  |  Branch (2559:20): [True: 1.47k, False: 6.06k]
  ------------------
 2560|       |    /* after the connect has completed, go WAITDO or DO */
 2561|  1.47k|    multistate(data, MSTATE_DO);
  ------------------
  |  |  200|  1.47k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2562|  1.47k|    return CURLM_CALL_MULTI_PERFORM;
 2563|  1.47k|  }
 2564|  6.19k|  else if(*result) {
  ------------------
  |  Branch (2564:11): [True: 124, False: 6.06k]
  ------------------
 2565|       |    /* failure detected */
 2566|    124|    multi_posttransfer(data);
 2567|    124|    multi_done(data, *result, TRUE);
  ------------------
  |  | 1055|    124|#define TRUE true
  ------------------
 2568|    124|    *stream_error = TRUE;
  ------------------
  |  | 1055|    124|#define TRUE true
  ------------------
 2569|    124|  }
 2570|  6.19k|  return CURLM_OK;
 2571|  7.66k|}
multi.c:protocol_connecting:
 1856|  7.66k|{
 1857|  7.66k|  CURLcode result = CURLE_OK;
 1858|  7.66k|  struct connectdata *conn = data->conn;
 1859|       |
 1860|  7.66k|  if(conn && conn->scheme->run->connecting) {
  ------------------
  |  Branch (1860:6): [True: 7.66k, False: 0]
  |  Branch (1860:14): [True: 7.66k, False: 0]
  ------------------
 1861|  7.66k|    *done = FALSE;
  ------------------
  |  | 1058|  7.66k|#define FALSE false
  ------------------
 1862|  7.66k|    result = conn->scheme->run->connecting(data, done);
 1863|  7.66k|  }
 1864|      0|  else
 1865|      0|    *done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1866|       |
 1867|  7.66k|  return result;
 1868|  7.66k|}
multi.c:multistate_do:
 2149|  8.35k|{
 2150|  8.35k|  CURLMcode mresult = CURLM_OK;
 2151|  8.35k|  CURLcode result = CURLE_OK;
 2152|  8.35k|  if(data->set.fprereq) {
  ------------------
  |  Branch (2152:6): [True: 0, False: 8.35k]
  ------------------
 2153|      0|    int prereq_rc;
 2154|       |
 2155|       |    /* call the prerequest callback function */
 2156|      0|    Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2157|      0|    prereq_rc = data->set.fprereq(data->set.prereq_userp,
 2158|      0|                                  data->info.primary.remote_ip,
 2159|      0|                                  data->info.primary.local_ip,
 2160|      0|                                  data->info.primary.remote_port,
 2161|      0|                                  data->info.primary.local_port);
 2162|      0|    Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2163|      0|    if(prereq_rc != CURL_PREREQFUNC_OK) {
  ------------------
  |  |  506|      0|#define CURL_PREREQFUNC_OK 0
  ------------------
  |  Branch (2163:8): [True: 0, False: 0]
  ------------------
 2164|      0|      failf(data, "operation aborted by pre-request callback");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2165|       |      /* failure in pre-request callback - do not do any other processing */
 2166|      0|      result = CURLE_ABORTED_BY_CALLBACK;
 2167|      0|      multi_posttransfer(data);
 2168|      0|      multi_done(data, result, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2169|      0|      *stream_errorp = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2170|      0|      goto end;
 2171|      0|    }
 2172|      0|  }
 2173|       |
 2174|  8.35k|  if(data->set.connect_only && !data->set.connect_only_ws) {
  ------------------
  |  Branch (2174:6): [True: 97, False: 8.25k]
  |  Branch (2174:32): [True: 79, False: 18]
  ------------------
 2175|     79|    multistate(data, MSTATE_DONE);
  ------------------
  |  |  200|     79|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2176|     79|    mresult = CURLM_CALL_MULTI_PERFORM;
 2177|     79|  }
 2178|  8.27k|  else {
 2179|  8.27k|    bool dophase_done = FALSE;
  ------------------
  |  | 1058|  8.27k|#define FALSE false
  ------------------
 2180|       |    /* Perform the protocol's DO action */
 2181|  8.27k|    result = multi_do(data, &dophase_done);
 2182|       |
 2183|       |    /* When multi_do() returns failure, data->conn might be NULL! */
 2184|       |
 2185|  8.27k|    if(!result) {
  ------------------
  |  Branch (2185:8): [True: 8.10k, False: 163]
  ------------------
 2186|  8.10k|      if(!dophase_done) {
  ------------------
  |  Branch (2186:10): [True: 1.23k, False: 6.87k]
  ------------------
 2187|  1.23k|#ifndef CURL_DISABLE_FTP
 2188|       |        /* some steps needed for wildcard matching */
 2189|  1.23k|        if(data->state.wildcardmatch) {
  ------------------
  |  Branch (2189:12): [True: 440, False: 791]
  ------------------
 2190|    440|          struct WildcardData *wc = data->wildcard;
 2191|    440|          if(wc->state == CURLWC_DONE || wc->state == CURLWC_SKIP) {
  ------------------
  |  Branch (2191:14): [True: 7, False: 433]
  |  Branch (2191:42): [True: 0, False: 433]
  ------------------
 2192|       |            /* skip some states if it is important */
 2193|      7|            multi_done(data, CURLE_OK, FALSE);
  ------------------
  |  | 1058|      7|#define FALSE false
  ------------------
 2194|       |
 2195|       |            /* if there is no connection left, skip the DONE state */
 2196|      7|            multistate(data, data->conn ? MSTATE_DONE : MSTATE_COMPLETED);
  ------------------
  |  |  200|     14|#define multistate(x, y) mstate(x, y, __LINE__)
  |  |  ------------------
  |  |  |  Branch (200:36): [True: 0, False: 7]
  |  |  ------------------
  ------------------
 2197|      7|            mresult = CURLM_CALL_MULTI_PERFORM;
 2198|      7|            goto end;
 2199|      7|          }
 2200|    440|        }
 2201|  1.22k|#endif
 2202|       |        /* DO was not completed in one function call, we must continue
 2203|       |           DOING... */
 2204|  1.22k|        multistate(data, MSTATE_DOING);
  ------------------
  |  |  200|  1.22k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2205|  1.22k|        mresult = CURLM_CALL_MULTI_PERFORM;
 2206|  1.22k|      }
 2207|       |
 2208|       |      /* after DO, go DO_DONE... or DO_MORE */
 2209|  6.87k|      else if(data->conn->bits.do_more) {
  ------------------
  |  Branch (2209:15): [True: 2, False: 6.87k]
  ------------------
 2210|       |        /* we are supposed to do more, but we need to sit down, relax and wait
 2211|       |           a little while first */
 2212|      2|        multistate(data, MSTATE_DOING_MORE);
  ------------------
  |  |  200|      2|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2213|      2|        mresult = CURLM_CALL_MULTI_PERFORM;
 2214|      2|      }
 2215|  6.87k|      else {
 2216|       |        /* we are done with the DO, now DID */
 2217|  6.87k|        multistate(data, MSTATE_DID);
  ------------------
  |  |  200|  6.87k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2218|  6.87k|        mresult = CURLM_CALL_MULTI_PERFORM;
 2219|  6.87k|      }
 2220|  8.10k|    }
 2221|    163|    else if((result == CURLE_SEND_ERROR) &&
  ------------------
  |  Branch (2221:13): [True: 1, False: 162]
  ------------------
 2222|      1|            data->conn->bits.reuse) {
  ------------------
  |  Branch (2222:13): [True: 0, False: 1]
  ------------------
 2223|       |      /*
 2224|       |       * In this situation, a connection that we were trying to use may have
 2225|       |       * unexpectedly died. If possible, send the connection back to the
 2226|       |       * CONNECT phase so we can try again.
 2227|       |       */
 2228|      0|      const struct Curl_scheme *handler = data->conn->scheme;
 2229|      0|      char *newurl = NULL;
 2230|      0|      followtype follow = FOLLOW_NONE;
 2231|      0|      CURLcode drc;
 2232|       |
 2233|      0|      drc = Curl_retry_request(data, &newurl);
 2234|      0|      if(drc) {
  ------------------
  |  Branch (2234:10): [True: 0, False: 0]
  ------------------
 2235|       |        /* a failure here pretty much implies an out of memory */
 2236|      0|        result = drc;
 2237|      0|        *stream_errorp = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2238|      0|      }
 2239|       |
 2240|      0|      multi_posttransfer(data);
 2241|      0|      drc = multi_done(data, result, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2242|       |
 2243|       |      /* When set to retry the connection, we must go back to the CONNECT
 2244|       |       * state */
 2245|      0|      if(newurl) {
  ------------------
  |  Branch (2245:10): [True: 0, False: 0]
  ------------------
 2246|      0|        if(!drc || (drc == CURLE_SEND_ERROR)) {
  ------------------
  |  Branch (2246:12): [True: 0, False: 0]
  |  Branch (2246:20): [True: 0, False: 0]
  ------------------
 2247|      0|          follow = FOLLOW_RETRY;
 2248|      0|          drc = multi_follow(data, handler, newurl, follow);
 2249|      0|          if(!drc) {
  ------------------
  |  Branch (2249:14): [True: 0, False: 0]
  ------------------
 2250|      0|            multistate(data, MSTATE_SETUP);
  ------------------
  |  |  200|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2251|      0|            mresult = CURLM_CALL_MULTI_PERFORM;
 2252|      0|            result = CURLE_OK;
 2253|      0|          }
 2254|      0|          else {
 2255|       |            /* Follow failed */
 2256|      0|            result = drc;
 2257|      0|          }
 2258|      0|        }
 2259|      0|        else {
 2260|       |          /* done did not return OK or SEND_ERROR */
 2261|      0|          result = drc;
 2262|      0|        }
 2263|      0|      }
 2264|      0|      else {
 2265|       |        /* Have error handler disconnect conn if we cannot retry */
 2266|      0|        *stream_errorp = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2267|      0|      }
 2268|      0|      curlx_free(newurl);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2269|      0|    }
 2270|    163|    else {
 2271|       |      /* failure detected */
 2272|    163|      multi_posttransfer(data);
 2273|    163|      if(data->conn)
  ------------------
  |  Branch (2273:10): [True: 163, False: 0]
  ------------------
 2274|    163|        multi_done(data, result, FALSE);
  ------------------
  |  | 1058|    163|#define FALSE false
  ------------------
 2275|    163|      *stream_errorp = TRUE;
  ------------------
  |  | 1055|    163|#define TRUE true
  ------------------
 2276|    163|    }
 2277|  8.27k|  }
 2278|  8.35k|end:
 2279|  8.35k|  *resultp = result;
 2280|  8.35k|  return mresult;
 2281|  8.35k|}
multi.c:multi_do:
 1762|  8.27k|{
 1763|  8.27k|  CURLcode result = CURLE_OK;
 1764|  8.27k|  struct connectdata *conn = data->conn;
 1765|       |
 1766|  8.27k|  DEBUGASSERT(conn);
  ------------------
  |  | 1081|  8.27k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1766:3): [True: 0, False: 8.27k]
  |  Branch (1766:3): [True: 8.27k, False: 0]
  ------------------
 1767|  8.27k|  DEBUGASSERT(conn->scheme);
  ------------------
  |  | 1081|  8.27k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1767:3): [True: 0, False: 8.27k]
  |  Branch (1767:3): [True: 8.27k, False: 0]
  ------------------
 1768|       |
 1769|  8.27k|  if(conn->scheme->run->do_it)
  ------------------
  |  Branch (1769:6): [True: 8.27k, False: 0]
  ------------------
 1770|  8.27k|    result = conn->scheme->run->do_it(data, done);
 1771|       |
 1772|  8.27k|  return result;
 1773|  8.27k|}
multi.c:multi_follow:
 1951|    949|{
 1952|    949|  if(handler && handler->run->follow)
  ------------------
  |  Branch (1952:6): [True: 949, False: 0]
  |  Branch (1952:17): [True: 949, False: 0]
  ------------------
 1953|    949|    return handler->run->follow(data, newurl, type);
 1954|       |
 1955|      0|  if(type == FOLLOW_RETRY)
  ------------------
  |  Branch (1955:6): [True: 0, False: 0]
  ------------------
 1956|       |    /* Retries are generic and do not require protocol-specific redirect
 1957|       |       handling. */
 1958|      0|    return CURLE_OK;
 1959|       |
 1960|      0|  return CURLE_TOO_MANY_REDIRECTS;
 1961|      0|}
multi.c:multistate_doing:
 2576|  2.36k|{
 2577|  2.36k|  bool dophase_done = FALSE;
  ------------------
  |  | 1058|  2.36k|#define FALSE false
  ------------------
 2578|       |
 2579|       |  /* we continue DOING until the DO phase is complete */
 2580|  2.36k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|  2.36k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2580:3): [True: 0, False: 2.36k]
  |  Branch (2580:3): [True: 2.36k, False: 0]
  ------------------
 2581|  2.36k|  *result = protocol_doing(data, &dophase_done);
 2582|  2.36k|  if(!(*result)) {
  ------------------
  |  Branch (2582:6): [True: 2.10k, False: 254]
  ------------------
 2583|  2.10k|    if(dophase_done) {
  ------------------
  |  Branch (2583:8): [True: 963, False: 1.14k]
  ------------------
 2584|       |      /* after DO, go DO_DONE or DO_MORE */
 2585|    963|      multistate(data, data->conn->bits.do_more ?
  ------------------
  |  |  200|  1.92k|#define multistate(x, y) mstate(x, y, __LINE__)
  |  |  ------------------
  |  |  |  Branch (200:36): [True: 957, False: 6]
  |  |  ------------------
  ------------------
 2586|    963|                 MSTATE_DOING_MORE : MSTATE_DID);
 2587|    963|      return CURLM_CALL_MULTI_PERFORM;
 2588|    963|    } /* dophase_done */
 2589|  2.10k|  }
 2590|    254|  else {
 2591|       |    /* failure detected */
 2592|    254|    multi_posttransfer(data);
 2593|    254|    multi_done(data, *result, FALSE);
  ------------------
  |  | 1058|    254|#define FALSE false
  ------------------
 2594|    254|    *stream_error = TRUE;
  ------------------
  |  | 1055|    254|#define TRUE true
  ------------------
 2595|    254|  }
 2596|  1.39k|  return CURLM_OK;
 2597|  2.36k|}
multi.c:protocol_doing:
 1876|  2.36k|{
 1877|  2.36k|  CURLcode result = CURLE_OK;
 1878|  2.36k|  struct connectdata *conn = data->conn;
 1879|       |
 1880|  2.36k|  if(conn && conn->scheme->run->doing) {
  ------------------
  |  Branch (1880:6): [True: 2.36k, False: 0]
  |  Branch (1880:14): [True: 2.36k, False: 0]
  ------------------
 1881|  2.36k|    *done = FALSE;
  ------------------
  |  | 1058|  2.36k|#define FALSE false
  ------------------
 1882|  2.36k|    result = conn->scheme->run->doing(data, done);
 1883|  2.36k|  }
 1884|      0|  else
 1885|      0|    *done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1886|       |
 1887|  2.36k|  return result;
 1888|  2.36k|}
multi.c:multistate_doing_more:
 2602|   155k|{
 2603|   155k|  domore control;
 2604|       |
 2605|       |  /*
 2606|       |   * When we are connected, DOING MORE and then go DID
 2607|       |   */
 2608|   155k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|   155k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2608:3): [True: 0, False: 155k]
  |  Branch (2608:3): [True: 155k, False: 0]
  ------------------
 2609|   155k|  *result = multi_do_more(data, &control);
 2610|       |
 2611|   155k|  if(!(*result)) {
  ------------------
  |  Branch (2611:6): [True: 154k, False: 271]
  ------------------
 2612|   154k|    if(control != DOMORE_INCOMPLETE) {
  ------------------
  |  Branch (2612:8): [True: 678, False: 154k]
  ------------------
 2613|       |      /* if DONE, advance to DO_DONE
 2614|       |         if GOBACK, go back to DOING */
 2615|    678|      multistate(data, control == DOMORE_DONE ? MSTATE_DID : MSTATE_DOING);
  ------------------
  |  |  200|  1.35k|#define multistate(x, y) mstate(x, y, __LINE__)
  |  |  ------------------
  |  |  |  Branch (200:36): [True: 678, False: 0]
  |  |  ------------------
  ------------------
 2616|    678|      return CURLM_CALL_MULTI_PERFORM;
 2617|    678|    }
 2618|       |    /* else
 2619|       |       stay in DO_MORE */
 2620|   154k|  }
 2621|    271|  else {
 2622|       |    /* failure detected */
 2623|    271|    multi_posttransfer(data);
 2624|    271|    multi_done(data, *result, FALSE);
  ------------------
  |  | 1058|    271|#define FALSE false
  ------------------
 2625|    271|    *stream_error = TRUE;
  ------------------
  |  | 1055|    271|#define TRUE true
  ------------------
 2626|    271|  }
 2627|   154k|  return CURLM_OK;
 2628|   155k|}
multi.c:multi_do_more:
 1785|   155k|{
 1786|   155k|  CURLcode result = CURLE_OK;
 1787|   155k|  struct connectdata *conn = data->conn;
 1788|       |
 1789|   155k|  *complete = DOMORE_INCOMPLETE;
 1790|       |
 1791|   155k|  if(conn->scheme->run->do_more)
  ------------------
  |  Branch (1791:6): [True: 155k, False: 0]
  ------------------
 1792|   155k|    result = conn->scheme->run->do_more(data, complete);
 1793|       |
 1794|   155k|  return result;
 1795|   155k|}
multi.c:multistate_did:
 2632|  7.56k|{
 2633|  7.56k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|  7.56k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2633:3): [True: 0, False: 7.56k]
  |  Branch (2633:3): [True: 7.56k, False: 0]
  ------------------
 2634|  7.56k|  if(data->conn->bits.multiplex)
  ------------------
  |  Branch (2634:6): [True: 4.40k, False: 3.15k]
  ------------------
 2635|       |    /* Check if we can move pending requests to send pipe */
 2636|  4.40k|    process_pending_handles(multi); /* multiplexed */
 2637|       |
 2638|       |  /* Only perform the transfer if there is a good socket to work with.
 2639|       |     Having both BAD is a signal to skip immediately to DONE */
 2640|  7.56k|  if(CONN_SOCK_IDX_VALID(data->conn->recv_idx) ||
  ------------------
  |  |  382|  15.1k|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 7.42k, False: 134]
  |  |  |  Branch (382:50): [True: 7.42k, False: 0]
  |  |  ------------------
  ------------------
 2641|    134|     CONN_SOCK_IDX_VALID(data->conn->send_idx))
  ------------------
  |  |  382|    134|#define CONN_SOCK_IDX_VALID(i)    (((i) >= 0) && ((i) < 2))
  |  |  ------------------
  |  |  |  Branch (382:36): [True: 34, False: 100]
  |  |  |  Branch (382:50): [True: 34, False: 0]
  |  |  ------------------
  ------------------
 2642|  7.46k|    multistate(data, MSTATE_PERFORMING);
  ------------------
  |  |  200|  7.46k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2643|    100|  else {
 2644|    100|#ifndef CURL_DISABLE_FTP
 2645|    100|    if(data->state.wildcardmatch &&
  ------------------
  |  Branch (2645:8): [True: 85, False: 15]
  ------------------
 2646|     85|       ((data->conn->scheme->flags & PROTOPT_WILDCARD) == 0)) {
  ------------------
  |  |  231|     85|#define PROTOPT_WILDCARD (1 << 12)  /* protocol supports wildcard matching */
  ------------------
  |  Branch (2646:8): [True: 0, False: 85]
  ------------------
 2647|      0|      data->wildcard->state = CURLWC_DONE;
 2648|      0|    }
 2649|    100|#endif
 2650|    100|    multistate(data, MSTATE_DONE);
  ------------------
  |  |  200|    100|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2651|    100|  }
 2652|  7.56k|  return CURLM_CALL_MULTI_PERFORM;
 2653|  7.56k|}
multi.c:multistate_ratelimiting:
 2285|    160|{
 2286|    160|  CURLcode result = CURLE_OK;
 2287|    160|  CURLMcode mresult = CURLM_OK;
 2288|    160|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|    160|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2288:3): [True: 0, False: 160]
  |  Branch (2288:3): [True: 160, False: 0]
  ------------------
 2289|       |  /* if both rates are within spec, resume transfer */
 2290|    160|  result = Curl_pgrsCheck(data);
 2291|       |
 2292|    160|  if(result) {
  ------------------
  |  Branch (2292:6): [True: 0, False: 160]
  ------------------
 2293|      0|    if(!(data->conn->scheme->flags & PROTOPT_DUAL) &&
  ------------------
  |  |  208|      0|#define PROTOPT_DUAL (1 << 1)      /* this protocol uses two connections */
  ------------------
  |  Branch (2293:8): [True: 0, False: 0]
  ------------------
 2294|      0|       result != CURLE_HTTP2_STREAM)
  ------------------
  |  Branch (2294:8): [True: 0, False: 0]
  ------------------
 2295|      0|      streamclose(data->conn, "Transfer returned error");
  ------------------
  |  |  102|      0|#define streamclose(x, y) Curl_conncontrol(x, CONNCTRL_STREAM, y)
  |  |  ------------------
  |  |  |  |   92|      0|#define CONNCTRL_STREAM     2
  |  |  ------------------
  ------------------
 2296|       |
 2297|      0|    multi_posttransfer(data);
 2298|      0|    multi_done(data, result, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2299|      0|  }
 2300|    160|  else {
 2301|    160|    if(!mspeed_check(data))
  ------------------
  |  Branch (2301:8): [True: 0, False: 160]
  ------------------
 2302|      0|      mresult = CURLM_CALL_MULTI_PERFORM;
 2303|    160|  }
 2304|    160|  *resultp = result;
 2305|    160|  return mresult;
 2306|    160|}
multi.c:mspeed_check:
 1964|  6.54M|{
 1965|  6.54M|  if(Curl_rlimit_active(&data->progress.dl.rlimit) ||
  ------------------
  |  Branch (1965:6): [True: 3.72M, False: 2.81M]
  ------------------
 1966|  4.06M|     Curl_rlimit_active(&data->progress.ul.rlimit)) {
  ------------------
  |  Branch (1966:6): [True: 336k, False: 2.48M]
  ------------------
 1967|       |    /* check if our send/recv limits require idle waits */
 1968|  4.06M|    const struct curltime *pnow = Curl_pgrs_now(data);
 1969|  4.06M|    timediff_t recv_ms, send_ms;
 1970|       |
 1971|  4.06M|    send_ms = Curl_rlimit_wait_ms(&data->progress.ul.rlimit, pnow);
 1972|  4.06M|    recv_ms = Curl_rlimit_wait_ms(&data->progress.dl.rlimit, pnow);
 1973|       |
 1974|  4.06M|    if(send_ms || recv_ms) {
  ------------------
  |  Branch (1974:8): [True: 39, False: 4.06M]
  |  Branch (1974:19): [True: 248, False: 4.06M]
  ------------------
 1975|    287|      if(data->mstate != MSTATE_RATELIMITING) {
  ------------------
  |  Branch (1975:10): [True: 127, False: 160]
  ------------------
 1976|    127|        multistate(data, MSTATE_RATELIMITING);
  ------------------
  |  |  200|    127|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 1977|    127|      }
 1978|    287|      Curl_expire(data, CURLMAX(send_ms, recv_ms), EXPIRE_TOOFAST);
  ------------------
  |  | 1286|    287|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1286:24): [True: 39, False: 248]
  |  |  ------------------
  ------------------
 1979|    287|      Curl_multi_clear_dirty(data);
 1980|    287|      CURL_TRC_M(data, "[RLIMIT] waiting %" FMT_TIMEDIFF_T "ms",
  ------------------
  |  |  148|    287|  do {                                   \
  |  |  149|    287|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|    287|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|    287|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|    574|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 287, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 287]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|    574|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|    287|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|    287|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|    287|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 287]
  |  |  ------------------
  ------------------
 1981|    287|                 CURLMAX(send_ms, recv_ms));
 1982|    287|      return CURLE_AGAIN;
 1983|    287|    }
 1984|  4.06M|    else {
 1985|       |      /* when will the rate limits increase next? The transfer needs
 1986|       |       * to run again at that time or it may stall. */
 1987|  4.06M|      send_ms = Curl_rlimit_next_step_ms(&data->progress.ul.rlimit, pnow);
 1988|  4.06M|      recv_ms = Curl_rlimit_next_step_ms(&data->progress.dl.rlimit, pnow);
 1989|  4.06M|      if(send_ms || recv_ms) {
  ------------------
  |  Branch (1989:10): [True: 1.78M, False: 2.27M]
  |  Branch (1989:21): [True: 2.27M, False: 0]
  ------------------
 1990|  4.06M|        timediff_t next_ms = CURLMIN(send_ms, recv_ms);
  ------------------
  |  | 1287|  4.06M|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 2.61M, False: 1.44M]
  |  |  ------------------
  ------------------
 1991|  4.06M|        if(!next_ms)
  ------------------
  |  Branch (1991:12): [True: 2.60M, False: 1.45M]
  ------------------
 1992|  2.60M|          next_ms = CURLMAX(send_ms, recv_ms);
  ------------------
  |  | 1286|  2.60M|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1286:24): [True: 336k, False: 2.27M]
  |  |  ------------------
  ------------------
 1993|  4.06M|        Curl_expire(data, next_ms, EXPIRE_TOOFAST);
 1994|  4.06M|        CURL_TRC_M(data, "[RLIMIT] next token update in %" FMT_TIMEDIFF_T "ms",
  ------------------
  |  |  148|  4.06M|  do {                                   \
  |  |  149|  4.06M|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  4.06M|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  4.06M|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  8.12M|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 4.06M, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4.06M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  8.12M|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  4.06M|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  4.06M|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  4.06M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 4.06M]
  |  |  ------------------
  ------------------
 1995|  4.06M|                   next_ms);
 1996|  4.06M|      }
 1997|  4.06M|    }
 1998|  4.06M|  }
 1999|       |
 2000|  6.54M|  if(data->mstate != MSTATE_PERFORMING) {
  ------------------
  |  Branch (2000:6): [True: 0, False: 6.54M]
  ------------------
 2001|      0|    CURL_TRC_M(data, "[RLIMIT] wait over, continue");
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2002|      0|    multistate(data, MSTATE_PERFORMING);
  ------------------
  |  |  200|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2003|      0|  }
 2004|  6.54M|  return CURLE_OK;
 2005|  6.54M|}
multi.c:multistate_performing:
 2010|  3.27M|{
 2011|  3.27M|  char *newurl = NULL;
 2012|  3.27M|  bool retry = FALSE;
  ------------------
  |  | 1058|  3.27M|#define FALSE false
  ------------------
 2013|  3.27M|  CURLMcode mresult = CURLM_OK;
 2014|  3.27M|  CURLcode result = *resultp = CURLE_OK;
 2015|  3.27M|  *stream_errorp = FALSE;
  ------------------
  |  | 1058|  3.27M|#define FALSE false
  ------------------
 2016|       |
 2017|  3.27M|  if(mspeed_check(data) == CURLE_AGAIN)
  ------------------
  |  Branch (2017:6): [True: 14, False: 3.27M]
  ------------------
 2018|     14|    return CURLM_OK;
 2019|       |
 2020|       |  /* read/write data if it is ready to do so */
 2021|  3.27M|  result = Curl_sendrecv(data);
 2022|       |
 2023|  3.27M|  if(data->req.done || (result == CURLE_RECV_ERROR)) {
  ------------------
  |  Branch (2023:6): [True: 1.75k, False: 3.27M]
  |  Branch (2023:24): [True: 351, False: 3.27M]
  ------------------
 2024|       |    /* If CURLE_RECV_ERROR happens early enough, we assume it was a race
 2025|       |     * condition and the server closed the reused connection exactly when we
 2026|       |     * wanted to use it, so figure out if that is indeed the case.
 2027|       |     */
 2028|  2.10k|    CURLcode ret = Curl_retry_request(data, &newurl);
 2029|  2.10k|    if(!ret)
  ------------------
  |  Branch (2029:8): [True: 2.10k, False: 0]
  ------------------
 2030|  2.10k|      retry = !!newurl;
 2031|      0|    else if(!result)
  ------------------
  |  Branch (2031:13): [True: 0, False: 0]
  ------------------
 2032|      0|      result = ret;
 2033|       |
 2034|  2.10k|    if(retry) {
  ------------------
  |  Branch (2034:8): [True: 418, False: 1.68k]
  ------------------
 2035|       |      /* if we are to retry, set the result to OK and consider the
 2036|       |         request as done */
 2037|    418|      result = CURLE_OK;
 2038|    418|      data->req.done = TRUE;
  ------------------
  |  | 1055|    418|#define TRUE true
  ------------------
 2039|    418|    }
 2040|  2.10k|  }
 2041|  3.27M|#ifndef CURL_DISABLE_HTTP
 2042|  3.27M|  else if((result == CURLE_HTTP2_STREAM) &&
  ------------------
  |  Branch (2042:11): [True: 680, False: 3.27M]
  ------------------
 2043|    680|          Curl_h2_http_1_1_error(data)) {
  ------------------
  |  Branch (2043:11): [True: 22, False: 658]
  ------------------
 2044|     22|    CURLcode ret = Curl_retry_request(data, &newurl);
 2045|       |
 2046|     22|    if(!ret) {
  ------------------
  |  Branch (2046:8): [True: 22, False: 0]
  ------------------
 2047|     22|      infof(data, "Downgrades to HTTP/1.1");
  ------------------
  |  |  143|     22|  do {                               \
  |  |  144|     22|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     22|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 22, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 22]
  |  |  |  |  ------------------
  |  |  |  |  320|     22|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     22|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     22|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 22]
  |  |  ------------------
  ------------------
 2048|     22|      streamclose(data->conn, "Disconnect HTTP/2 for HTTP/1");
  ------------------
  |  |  102|     22|#define streamclose(x, y) Curl_conncontrol(x, CONNCTRL_STREAM, y)
  |  |  ------------------
  |  |  |  |   92|     22|#define CONNCTRL_STREAM     2
  |  |  ------------------
  ------------------
 2049|     22|      data->state.http_neg.wanted = CURL_HTTP_V1x;
  ------------------
  |  |   40|     22|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
 2050|     22|      data->state.http_neg.allowed = CURL_HTTP_V1x;
  ------------------
  |  |   40|     22|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
 2051|       |      /* clear the error message bit too as we ignore the one we got */
 2052|     22|      data->state.errorbuf = FALSE;
  ------------------
  |  | 1058|     22|#define FALSE false
  ------------------
 2053|     22|      if(!newurl)
  ------------------
  |  Branch (2053:10): [True: 22, False: 0]
  ------------------
 2054|       |        /* typically for HTTP_1_1_REQUIRED error on first flight */
 2055|     22|        newurl = Curl_bufref_dup(&data->state.url);
  ------------------
  |  |   49|     22|#define Curl_bufref_dup(x) curlx_strdup(Curl_bufref_ptr(x))
  |  |  ------------------
  |  |  |  | 1477|     22|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
 2056|     22|      if(!newurl) {
  ------------------
  |  Branch (2056:10): [True: 0, False: 22]
  ------------------
 2057|      0|        result = CURLE_OUT_OF_MEMORY;
 2058|      0|      }
 2059|     22|      else {
 2060|       |        /* if we are to retry, set the result to OK and consider the request
 2061|       |          as done */
 2062|     22|        retry = TRUE;
  ------------------
  |  | 1055|     22|#define TRUE true
  ------------------
 2063|     22|        result = CURLE_OK;
 2064|     22|        data->req.done = TRUE;
  ------------------
  |  | 1055|     22|#define TRUE true
  ------------------
 2065|     22|      }
 2066|     22|    }
 2067|      0|    else
 2068|      0|      result = ret;
 2069|     22|  }
 2070|  3.27M|#endif
 2071|       |
 2072|  3.27M|  if(result) {
  ------------------
  |  Branch (2072:6): [True: 5.07k, False: 3.26M]
  ------------------
 2073|       |    /*
 2074|       |     * The transfer phase returned error, we mark the connection to get closed
 2075|       |     * to prevent being reused. This is because we cannot possibly know if the
 2076|       |     * connection is in a good shape or not now. Unless it is a protocol which
 2077|       |     * uses two "channels" like FTP, as then the error happened in the data
 2078|       |     * connection.
 2079|       |     */
 2080|       |
 2081|  5.07k|    if(!(data->conn->scheme->flags & PROTOPT_DUAL) &&
  ------------------
  |  |  208|  5.07k|#define PROTOPT_DUAL (1 << 1)      /* this protocol uses two connections */
  ------------------
  |  Branch (2081:8): [True: 5.07k, False: 5]
  ------------------
 2082|  5.07k|       result != CURLE_HTTP2_STREAM)
  ------------------
  |  Branch (2082:8): [True: 4.41k, False: 658]
  ------------------
 2083|  4.41k|      streamclose(data->conn, "Transfer returned error");
  ------------------
  |  |  102|  4.41k|#define streamclose(x, y) Curl_conncontrol(x, CONNCTRL_STREAM, y)
  |  |  ------------------
  |  |  |  |   92|  4.41k|#define CONNCTRL_STREAM     2
  |  |  ------------------
  ------------------
 2084|       |
 2085|  5.07k|    multi_posttransfer(data);
 2086|  5.07k|    multi_done(data, result, TRUE);
  ------------------
  |  | 1055|  5.07k|#define TRUE true
  ------------------
 2087|  5.07k|  }
 2088|  3.26M|  else if(data->req.done && !Curl_cwriter_is_paused(data)) {
  ------------------
  |  Branch (2088:11): [True: 2.10k, False: 3.26M]
  |  Branch (2088:29): [True: 2.10k, False: 0]
  ------------------
 2089|  2.10k|    const struct Curl_scheme *handler = data->conn->scheme;
 2090|       |
 2091|       |    /* call this even if the readwrite function returned error */
 2092|  2.10k|    multi_posttransfer(data);
 2093|       |
 2094|       |    /* When we follow redirects or is set to retry the connection, we must to
 2095|       |       go back to the CONNECT state */
 2096|  2.10k|    if(data->req.newurl || retry) {
  ------------------
  |  Branch (2096:8): [True: 418, False: 1.68k]
  |  Branch (2096:28): [True: 440, False: 1.24k]
  ------------------
 2097|    858|      followtype follow = FOLLOW_NONE;
 2098|    858|      if(!retry) {
  ------------------
  |  Branch (2098:10): [True: 418, False: 440]
  ------------------
 2099|       |        /* if the URL is a follow-location and not a retried request then
 2100|       |           figure out the URL here */
 2101|    418|        curlx_free(newurl);
  ------------------
  |  | 1483|    418|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2102|    418|        newurl = data->req.newurl;
 2103|    418|        data->req.newurl = NULL;
 2104|    418|        follow = FOLLOW_REDIR;
 2105|    418|      }
 2106|    440|      else
 2107|    440|        follow = FOLLOW_RETRY;
 2108|    858|      (void)multi_done(data, CURLE_OK, FALSE);
  ------------------
  |  | 1058|    858|#define FALSE false
  ------------------
 2109|       |      /* multi_done() might return CURLE_GOT_NOTHING */
 2110|    858|      result = multi_follow(data, handler, newurl, follow);
 2111|    858|      if(!result) {
  ------------------
  |  Branch (2111:10): [True: 800, False: 58]
  ------------------
 2112|    800|        multistate(data, MSTATE_SETUP);
  ------------------
  |  |  200|    800|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2113|    800|        mresult = CURLM_CALL_MULTI_PERFORM;
 2114|    800|      }
 2115|    858|    }
 2116|  1.24k|    else {
 2117|       |      /* after the transfer is done, go DONE */
 2118|       |
 2119|       |      /* but first check to see if we got a location info even though we are
 2120|       |         not following redirects */
 2121|  1.24k|      if(data->req.location) {
  ------------------
  |  Branch (2121:10): [True: 91, False: 1.15k]
  ------------------
 2122|     91|        curlx_free(newurl);
  ------------------
  |  | 1483|     91|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2123|     91|        newurl = data->req.location;
 2124|     91|        data->req.location = NULL;
 2125|     91|        result = multi_follow(data, handler, newurl, FOLLOW_FAKE);
 2126|     91|        if(result) {
  ------------------
  |  Branch (2126:12): [True: 0, False: 91]
  ------------------
 2127|      0|          *stream_errorp = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2128|      0|          result = multi_done(data, result, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2129|      0|        }
 2130|     91|      }
 2131|       |
 2132|  1.24k|      if(!result) {
  ------------------
  |  Branch (2132:10): [True: 1.24k, False: 0]
  ------------------
 2133|  1.24k|        multistate(data, MSTATE_DONE);
  ------------------
  |  |  200|  1.24k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2134|  1.24k|        mresult = CURLM_CALL_MULTI_PERFORM;
 2135|  1.24k|      }
 2136|  1.24k|    }
 2137|  2.10k|  }
 2138|  3.26M|  else { /* not errored, not done */
 2139|  3.26M|    mspeed_check(data);
 2140|  3.26M|  }
 2141|  3.27M|  curlx_free(newurl);
  ------------------
  |  | 1483|  3.27M|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2142|  3.27M|  *resultp = result;
 2143|  3.27M|  return mresult;
 2144|  3.27M|}
multi.c:multistate_done:
 2656|  1.42k|{
 2657|  1.42k|  if(data->conn) {
  ------------------
  |  Branch (2657:6): [True: 1.42k, False: 0]
  ------------------
 2658|  1.42k|    CURLcode result;
 2659|       |
 2660|       |    /* post-transfer command */
 2661|  1.42k|    result = multi_done(data, *presult, FALSE);
  ------------------
  |  | 1058|  1.42k|#define FALSE false
  ------------------
 2662|       |
 2663|       |    /* allow a previously set error code take precedence */
 2664|  1.42k|    if(!(*presult))
  ------------------
  |  Branch (2664:8): [True: 1.42k, False: 0]
  ------------------
 2665|  1.42k|      *presult = result;
 2666|  1.42k|  }
 2667|       |
 2668|  1.42k|#ifndef CURL_DISABLE_FTP
 2669|  1.42k|  if(data->state.wildcardmatch) {
  ------------------
  |  Branch (2669:6): [True: 583, False: 841]
  ------------------
 2670|    583|    if(data->wildcard->state != CURLWC_DONE) {
  ------------------
  |  Branch (2670:8): [True: 583, False: 0]
  ------------------
 2671|       |      /* if a wildcard is set and we are not ending -> lets start again
 2672|       |         with MSTATE_INIT */
 2673|    583|      multistate(data, MSTATE_INIT);
  ------------------
  |  |  200|    583|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2674|    583|      return CURLM_CALL_MULTI_PERFORM;
 2675|    583|    }
 2676|    583|  }
 2677|    841|#endif
 2678|       |  /* after we have DONE what we are supposed to do, go COMPLETED, and
 2679|       |     it does not matter what the multi_done() returned! */
 2680|    841|  multistate(data, MSTATE_COMPLETED);
  ------------------
  |  |  200|    841|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2681|    841|  return CURLM_CALL_MULTI_PERFORM;
 2682|  1.42k|}
multi.c:is_finished:
 2358|  3.67M|{
 2359|  3.67M|  if(data->mstate < MSTATE_COMPLETED) {
  ------------------
  |  Branch (2359:6): [True: 3.67M, False: 848]
  ------------------
 2360|  3.67M|    if(result) {
  ------------------
  |  Branch (2360:8): [True: 16.4k, False: 3.66M]
  ------------------
 2361|       |      /*
 2362|       |       * If an error was returned, and we are not in completed state now,
 2363|       |       * then we go to completed and consider this transfer aborted.
 2364|       |       */
 2365|       |
 2366|       |      /* No attempt to disconnect connections must be made before this -
 2367|       |         connection detach and termination happens only here */
 2368|       |
 2369|       |      /* Check if we can move pending requests to send pipe */
 2370|  16.4k|      process_pending_handles(multi); /* connection */
 2371|       |
 2372|  16.4k|      if(data->conn) {
  ------------------
  |  Branch (2372:10): [True: 0, False: 16.4k]
  ------------------
 2373|      0|        if(stream_error) {
  ------------------
  |  Branch (2373:12): [True: 0, False: 0]
  ------------------
 2374|       |          /* Do not attempt to send data over a connection that timed out */
 2375|      0|          bool dead_connection = result == CURLE_OPERATION_TIMEDOUT;
 2376|      0|          struct connectdata *conn = data->conn;
 2377|       |
 2378|       |          /* This is where we make sure that the conn pointer is reset.
 2379|       |             We do not have to do this in every case block above where a
 2380|       |             failure is detected */
 2381|      0|          Curl_detach_connection(data);
 2382|      0|          Curl_conn_terminate(data, conn, dead_connection);
 2383|      0|        }
 2384|      0|      }
 2385|  16.4k|      else if(data->mstate == MSTATE_CONNECT) {
  ------------------
  |  Branch (2385:15): [True: 1.51k, False: 14.9k]
  ------------------
 2386|       |        /* Curl_connect() failed */
 2387|  1.51k|        multi_posttransfer(data);
 2388|  1.51k|        Curl_pgrsUpdate_nometer(data);
 2389|  1.51k|      }
 2390|       |
 2391|  16.4k|      multistate(data, MSTATE_COMPLETED);
  ------------------
  |  |  200|  16.4k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2392|  16.4k|      return result;
 2393|  16.4k|    }
 2394|       |    /* if there is still a connection to use, call the progress function */
 2395|  3.66M|    else if(data->conn && Curl_conn_is_connected(data->conn, FIRSTSOCKET)) {
  ------------------
  |  |  303|  3.63M|#define FIRSTSOCKET     0
  ------------------
  |  Branch (2395:13): [True: 3.63M, False: 31.3k]
  |  Branch (2395:27): [True: 3.46M, False: 164k]
  ------------------
 2396|  3.46M|      result = Curl_pgrsUpdate(data);
 2397|  3.46M|      if(result) {
  ------------------
  |  Branch (2397:10): [True: 0, False: 3.46M]
  ------------------
 2398|       |        /* aborted due to progress callback return code must close the
 2399|       |           connection */
 2400|      0|        streamclose(data->conn, "Aborted by callback");
  ------------------
  |  |  102|      0|#define streamclose(x, y) Curl_conncontrol(x, CONNCTRL_STREAM, y)
  |  |  ------------------
  |  |  |  |   92|      0|#define CONNCTRL_STREAM     2
  |  |  ------------------
  ------------------
 2401|       |
 2402|       |        /* if not yet in DONE state, go there, otherwise COMPLETED */
 2403|      0|        multistate(data, (data->mstate < MSTATE_DONE) ?
  ------------------
  |  |  200|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  |  |  ------------------
  |  |  |  Branch (200:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2404|      0|                   MSTATE_DONE : MSTATE_COMPLETED);
 2405|      0|        return result;
 2406|      0|      }
 2407|  3.46M|    }
 2408|  3.67M|  }
 2409|  3.66M|  return result;
 2410|  3.67M|}
multi.c:handle_completed:
 2415|  17.3k|{
 2416|  17.3k|  if(data->master_mid != UINT32_MAX) {
  ------------------
  |  Branch (2416:6): [True: 446, False: 16.8k]
  ------------------
 2417|       |    /* A sub transfer, not for msgsent to application */
 2418|    446|    struct Curl_easy *mdata;
 2419|       |
 2420|    446|    CURL_TRC_M(data, "sub xfer done for master %u", data->master_mid);
  ------------------
  |  |  148|    446|  do {                                   \
  |  |  149|    446|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|    446|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|    446|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|    892|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 446, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 446]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|    892|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|    446|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|    446|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|    446|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 446]
  |  |  ------------------
  ------------------
 2421|    446|    mdata = Curl_multi_get_easy(multi, data->master_mid);
 2422|    446|    if(mdata) {
  ------------------
  |  Branch (2422:8): [True: 446, False: 0]
  ------------------
 2423|    446|      if(mdata->sub_xfer_done)
  ------------------
  |  Branch (2423:10): [True: 446, False: 0]
  ------------------
 2424|    446|        mdata->sub_xfer_done(mdata, data, result);
 2425|      0|      else
 2426|      0|        CURL_TRC_M(data, "master easy %u without sub_xfer_done callback.",
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2427|    446|                   data->master_mid);
 2428|    446|    }
 2429|      0|    else {
 2430|      0|      CURL_TRC_M(data, "master easy %u already gone.", data->master_mid);
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2431|      0|    }
 2432|    446|  }
 2433|  16.8k|  else {
 2434|       |    /* now fill in the Curl_message with this info */
 2435|  16.8k|    struct Curl_message *msg = &data->msg;
 2436|       |
 2437|  16.8k|    msg->extmsg.msg = CURLMSG_DONE;
 2438|  16.8k|    msg->extmsg.easy_handle = data;
 2439|  16.8k|    msg->extmsg.data.result = result;
 2440|       |
 2441|  16.8k|    multi_addmsg(multi, msg);
 2442|  16.8k|    DEBUGASSERT(!data->conn);
  ------------------
  |  | 1081|  16.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2442:5): [True: 0, False: 16.8k]
  |  Branch (2442:5): [True: 16.8k, False: 0]
  ------------------
 2443|  16.8k|  }
 2444|  17.3k|  multistate(data, MSTATE_MSGSENT);
  ------------------
  |  |  200|  17.3k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2445|       |
 2446|       |  /* remove from the other sets, add to msgsent */
 2447|  17.3k|  Curl_uint32_bset_remove(&multi->process, data->mid);
 2448|  17.3k|  Curl_uint32_bset_remove(&multi->dirty, data->mid);
 2449|  17.3k|  Curl_uint32_bset_remove(&multi->pending, data->mid);
 2450|  17.3k|  Curl_uint32_bset_add(&multi->msgsent, data->mid);
 2451|  17.3k|  --multi->xfers_alive;
 2452|  17.3k|  if(!multi->xfers_alive)
  ------------------
  |  Branch (2452:6): [True: 16.8k, False: 446]
  ------------------
 2453|  16.8k|    multi_assess_wakeup(multi);
 2454|  17.3k|}
multi.c:multi_addmsg:
  221|  16.8k|{
  222|  16.8k|  if(!Curl_llist_count(&multi->msglist))
  ------------------
  |  Branch (222:6): [True: 16.8k, False: 0]
  ------------------
  223|  16.8k|    CURLM_NTFY(multi->admin, CURLMNOTIFY_INFO_READ);
  ------------------
  |  |   51|  16.8k|  do {                                                \
  |  |   52|  16.8k|    if((d) && (d)->multi && (d)->multi->ntfy.ntfy_cb) \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 16.8k, False: 0]
  |  |  |  Branch (52:15): [True: 16.8k, False: 0]
  |  |  |  Branch (52:29): [True: 0, False: 16.8k]
  |  |  ------------------
  |  |   53|  16.8k|      Curl_mntfy_add((d), (t));                       \
  |  |   54|  16.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (54:11): [Folded, False: 16.8k]
  |  |  ------------------
  ------------------
  224|  16.8k|  Curl_llist_append(&multi->msglist, msg, &msg->list);
  225|  16.8k|}
multi.c:multi_ischanged:
 1709|  10.9M|{
 1710|  10.9M|  bool retval = FALSE;
  ------------------
  |  | 1058|  10.9M|#define FALSE false
  ------------------
 1711|  10.9M|  DEBUGASSERT(multi);
  ------------------
  |  | 1081|  10.9M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1711:3): [True: 0, False: 10.9M]
  |  Branch (1711:3): [True: 10.9M, False: 0]
  ------------------
 1712|  10.9M|  if(multi) {
  ------------------
  |  Branch (1712:6): [True: 10.9M, False: 0]
  ------------------
 1713|  10.9M|    retval = (bool)multi->recheckstate;
 1714|  10.9M|    if(clear)
  ------------------
  |  Branch (1714:8): [True: 7.19M, False: 3.74M]
  ------------------
 1715|  7.19M|      multi->recheckstate = FALSE;
  ------------------
  |  | 1058|  7.19M|#define FALSE false
  ------------------
 1716|  10.9M|  }
 1717|  10.9M|  return retval;
 1718|  10.9M|}
multi.c:add_next_timeout:
 3106|     11|{
 3107|     11|  struct curltime *tv = &d->state.expiretime;
 3108|     11|  struct Curl_llist *list = &d->state.timeoutlist;
 3109|     11|  struct Curl_llist_node *e;
 3110|       |
 3111|       |  /* move over the timeout list for this specific handle and remove all
 3112|       |     timeouts that are now passed tense and store the next pending
 3113|       |     timeout in *tv */
 3114|     22|  for(e = Curl_llist_head(list); e;) {
  ------------------
  |  Branch (3114:34): [True: 22, False: 0]
  ------------------
 3115|     22|    struct Curl_llist_node *n = Curl_node_next(e);
 3116|     22|    struct time_node *node = Curl_node_elem(e);
 3117|     22|    timediff_t diff = curlx_ptimediff_us(&node->time, pnow);
 3118|     22|    if(diff <= 0)
  ------------------
  |  Branch (3118:8): [True: 11, False: 11]
  ------------------
 3119|       |      /* remove outdated entry */
 3120|     11|      Curl_node_remove(e);
 3121|     11|    else
 3122|       |      /* the list is sorted so get out on the first mismatch */
 3123|     11|      break;
 3124|     11|    e = n;
 3125|     11|  }
 3126|     11|  e = Curl_llist_head(list);
 3127|     11|  if(!e) {
  ------------------
  |  Branch (3127:6): [True: 0, False: 11]
  ------------------
 3128|       |    /* clear the expire times within the handles that we remove from the
 3129|       |       splay tree */
 3130|      0|    tv->tv_sec = 0;
 3131|      0|    tv->tv_usec = 0;
 3132|      0|  }
 3133|     11|  else {
 3134|     11|    struct time_node *node = Curl_node_elem(e);
 3135|       |    /* copy the first entry to 'tv' */
 3136|     11|    memcpy(tv, &node->time, sizeof(*tv));
 3137|       |
 3138|       |    /* Insert this node again into the splay. Keep the timer in the list in
 3139|       |       case we need to recompute future timers. */
 3140|     11|    multi->timetree = Curl_splayinsert(tv, multi->timetree,
 3141|     11|                                       &d->state.timenode);
 3142|     11|  }
 3143|     11|  return CURLM_OK;
 3144|     11|}
multi.c:multi_handle_timeout:
 1803|  3.80M|{
 1804|  3.80M|  timediff_t timeout_ms;
 1805|       |
 1806|  3.80M|  timeout_ms = Curl_timeleft_ms(data);
 1807|  3.80M|  if(timeout_ms < 0) {
  ------------------
  |  Branch (1807:6): [True: 119, False: 3.80M]
  ------------------
 1808|       |    /* Handle timed out */
 1809|    119|    struct curltime since;
 1810|    119|    if(Curl_is_connecting(data))
  ------------------
  |  Branch (1810:8): [True: 11, False: 108]
  ------------------
 1811|     11|      since = data->progress.t_startsingle;
 1812|    108|    else
 1813|    108|      since = data->progress.t_startop;
 1814|    119|    if(data->mstate == MSTATE_CONNECTING)
  ------------------
  |  Branch (1814:8): [True: 10, False: 109]
  ------------------
 1815|     10|      failf(data, "%s timed out after %" FMT_TIMEDIFF_T " milliseconds",
  ------------------
  |  |   62|     10|#define failf Curl_failf
  ------------------
 1816|     10|            data->conn->bits.dns_resolved ? "Connection" : "Resolving",
  ------------------
  |  Branch (1816:13): [True: 3, False: 7]
  ------------------
 1817|     10|            curlx_ptimediff_ms(Curl_pgrs_now(data), &since));
 1818|    109|    else {
 1819|    109|      struct SingleRequest *k = &data->req;
 1820|    109|      if(k->size != -1) {
  ------------------
  |  Branch (1820:10): [True: 5, False: 104]
  ------------------
 1821|      5|        failf(data, "Operation timed out after %" FMT_TIMEDIFF_T
  ------------------
  |  |   62|      5|#define failf Curl_failf
  ------------------
 1822|      5|              " milliseconds with %" FMT_OFF_T " out of %"
 1823|      5|              FMT_OFF_T " bytes received",
 1824|      5|              curlx_ptimediff_ms(Curl_pgrs_now(data), &since),
 1825|      5|              k->bytecount, k->size);
 1826|      5|      }
 1827|    104|      else {
 1828|    104|        failf(data, "Operation timed out after %" FMT_TIMEDIFF_T
  ------------------
  |  |   62|    104|#define failf Curl_failf
  ------------------
 1829|    104|              " milliseconds with %" FMT_OFF_T " bytes received",
 1830|    104|              curlx_ptimediff_ms(Curl_pgrs_now(data), &since),
 1831|    104|              k->bytecount);
 1832|    104|      }
 1833|    109|    }
 1834|    119|    *result = CURLE_OPERATION_TIMEDOUT;
 1835|    119|    if(data->conn) {
  ------------------
  |  Branch (1835:8): [True: 119, False: 0]
  ------------------
 1836|       |      /* Force connection closed if the connection has indeed been used */
 1837|    119|      if(data->mstate > MSTATE_DO) {
  ------------------
  |  Branch (1837:10): [True: 108, False: 11]
  ------------------
 1838|    108|        streamclose(data->conn, "Disconnect due to timeout");
  ------------------
  |  |  102|    108|#define streamclose(x, y) Curl_conncontrol(x, CONNCTRL_STREAM, y)
  |  |  ------------------
  |  |  |  |   92|    108|#define CONNCTRL_STREAM     2
  |  |  ------------------
  ------------------
 1839|    108|        *stream_error = TRUE;
  ------------------
  |  | 1055|    108|#define TRUE true
  ------------------
 1840|    108|      }
 1841|    119|      (void)multi_done(data, *result, TRUE);
  ------------------
  |  | 1055|    119|#define TRUE true
  ------------------
 1842|    119|    }
 1843|    119|    return TRUE;
  ------------------
  |  | 1055|    119|#define TRUE true
  ------------------
 1844|    119|  }
 1845|       |
 1846|  3.80M|  return FALSE;
  ------------------
  |  | 1058|  3.80M|#define FALSE false
  ------------------
 1847|  3.80M|}
multi.c:move_pending_to_connect:
 3815|    204|{
 3816|    204|  DEBUGASSERT(data->mstate == MSTATE_PENDING);
  ------------------
  |  | 1081|    204|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3816:3): [True: 0, False: 204]
  |  Branch (3816:3): [True: 204, False: 0]
  ------------------
 3817|       |
 3818|       |  /* Remove this node from the pending set, add into process set */
 3819|    204|  Curl_uint32_bset_remove(&multi->pending, data->mid);
 3820|    204|  Curl_uint32_bset_add(&multi->process, data->mid);
 3821|       |
 3822|    204|  multistate(data, MSTATE_CONNECT);
  ------------------
  |  |  200|    204|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 3823|    204|  Curl_multi_mark_dirty(data); /* make it run */
 3824|    204|}
multi.c:multi_deltimeout:
 3623|  4.24M|{
 3624|  4.24M|  struct Curl_llist_node *e;
 3625|  4.24M|  struct Curl_llist *timeoutlist = &data->state.timeoutlist;
 3626|       |  /* find and remove the specific node from the list */
 3627|  8.47M|  for(e = Curl_llist_head(timeoutlist); e; e = Curl_node_next(e)) {
  ------------------
  |  Branch (3627:41): [True: 8.44M, False: 30.5k]
  ------------------
 3628|  8.44M|    struct time_node *n = Curl_node_elem(e);
 3629|  8.44M|    if(n->eid == eid) {
  ------------------
  |  Branch (3629:8): [True: 4.21M, False: 4.23M]
  ------------------
 3630|  4.21M|      Curl_node_remove(e);
 3631|  4.21M|      return;
 3632|  4.21M|    }
 3633|  8.44M|  }
 3634|  4.24M|}
multi.c:multi_addtimeout:
 3646|  4.22M|{
 3647|  4.22M|  struct Curl_llist_node *e;
 3648|  4.22M|  struct time_node *node;
 3649|  4.22M|  struct Curl_llist_node *prev = NULL;
 3650|  4.22M|  size_t n;
 3651|  4.22M|  struct Curl_llist *timeoutlist = &data->state.timeoutlist;
 3652|       |
 3653|  4.22M|  node = &data->state.expires[eid];
 3654|       |
 3655|       |  /* copy the timestamp and id */
 3656|  4.22M|  memcpy(&node->time, stamp, sizeof(*stamp));
 3657|  4.22M|  node->eid = eid; /* also marks it as in use */
 3658|       |
 3659|  4.22M|  n = Curl_llist_count(timeoutlist);
 3660|  4.22M|  if(n) {
  ------------------
  |  Branch (3660:6): [True: 4.21M, False: 15.4k]
  ------------------
 3661|       |    /* find the correct spot in the list */
 3662|  8.43M|    for(e = Curl_llist_head(timeoutlist); e; e = Curl_node_next(e)) {
  ------------------
  |  Branch (3662:43): [True: 6.00M, False: 2.42M]
  ------------------
 3663|  6.00M|      struct time_node *check = Curl_node_elem(e);
 3664|  6.00M|      timediff_t diff = curlx_ptimediff_ms(&check->time, &node->time);
 3665|  6.00M|      if(diff > 0)
  ------------------
  |  Branch (3665:10): [True: 1.78M, False: 4.22M]
  ------------------
 3666|  1.78M|        break;
 3667|  4.22M|      prev = e;
 3668|  4.22M|    }
 3669|  4.21M|  }
 3670|       |  /* else
 3671|       |     this is the first timeout on the list */
 3672|       |
 3673|  4.22M|  Curl_llist_insert_next(timeoutlist, prev, node, &node->list);
 3674|  4.22M|  CURL_TRC_TIMER(data, eid, "set for %" FMT_TIMEDIFF_T "ns",
  ------------------
  |  |  173|  4.22M|  do {                                        \
  |  |  174|  4.22M|    if(CURL_TRC_TIMER_is_verbose(data))       \
  |  |  ------------------
  |  |  |  |  139|  4.22M|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_timer)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  4.22M|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  8.45M|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 4.22M, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4.22M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  8.45M|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  4.22M|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  4.22M|      Curl_trc_timer(data, tid, __VA_ARGS__); \
  |  |  176|  4.22M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (176:11): [Folded, False: 4.22M]
  |  |  ------------------
  ------------------
 3675|  4.22M|                 curlx_ptimediff_us(&node->time, Curl_pgrs_now(data)));
 3676|  4.22M|  return CURLM_OK;
 3677|  4.22M|}
multi.c:process_pending_handles:
 3841|  84.7k|{
 3842|  84.7k|  uint32_t mid = multi->last_pending_mid;
 3843|       |
 3844|  84.7k|  if(mid) {
  ------------------
  |  Branch (3844:6): [True: 204, False: 84.5k]
  ------------------
 3845|    204|    while(Curl_uint32_bset_next(&multi->pending, mid, &mid)) {
  ------------------
  |  Branch (3845:11): [True: 0, False: 204]
  ------------------
 3846|      0|      struct Curl_easy *data = Curl_multi_get_easy(multi, mid);
 3847|      0|      if(data) {
  ------------------
  |  Branch (3847:10): [True: 0, False: 0]
  ------------------
 3848|      0|        move_pending_to_connect(multi, data);
 3849|      0|        multi->last_pending_mid = mid;
 3850|      0|        return;
 3851|      0|      }
 3852|       |      /* transfer no longer known, should not happen */
 3853|      0|      Curl_uint32_bset_remove(&multi->pending, mid);
 3854|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3854:7): [Folded, False: 0]
  |  Branch (3854:7): [Folded, False: 0]
  ------------------
 3855|      0|    }
 3856|       |    /* found no pending transfers with `mid` larger than `last_pending_mid`.
 3857|       |     * Start at the beginning of the pending set again. */
 3858|    204|    multi->last_pending_mid = 0;
 3859|    204|  }
 3860|       |
 3861|  84.7k|  if(Curl_uint32_bset_first(&multi->pending, &mid)) {
  ------------------
  |  Branch (3861:6): [True: 204, False: 84.5k]
  ------------------
 3862|    204|    do {
 3863|    204|      struct Curl_easy *data = Curl_multi_get_easy(multi, mid);
 3864|    204|      if(data) {
  ------------------
  |  Branch (3864:10): [True: 204, False: 0]
  ------------------
 3865|    204|        move_pending_to_connect(multi, data);
 3866|    204|        multi->last_pending_mid = mid;
 3867|    204|        return;
 3868|    204|      }
 3869|       |      /* transfer no longer known, should not happen */
 3870|      0|      Curl_uint32_bset_remove(&multi->pending, mid);
 3871|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3871:7): [Folded, False: 0]
  |  Branch (3871:7): [Folded, False: 0]
  ------------------
 3872|      0|    } while(Curl_uint32_bset_next(&multi->pending, mid, &mid));
  ------------------
  |  Branch (3872:13): [True: 0, False: 0]
  ------------------
 3873|    204|  }
 3874|  84.7k|}
multi.c:multi_xfer_bufs_free:
 4106|  17.2k|{
 4107|  17.2k|  DEBUGASSERT(multi);
  ------------------
  |  | 1081|  17.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4107:3): [True: 0, False: 17.2k]
  |  Branch (4107:3): [True: 17.2k, False: 0]
  ------------------
 4108|  17.2k|  curlx_safefree(multi->xfer_buf);
  ------------------
  |  | 1327|  17.2k|  do {                      \
  |  | 1328|  17.2k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  17.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  17.2k|    (ptr) = NULL;           \
  |  | 1330|  17.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 17.2k]
  |  |  ------------------
  ------------------
 4109|  17.2k|  multi->xfer_buf_len = 0;
 4110|  17.2k|  multi->xfer_buf_borrowed = FALSE;
  ------------------
  |  | 1058|  17.2k|#define FALSE false
  ------------------
 4111|  17.2k|  curlx_safefree(multi->xfer_ulbuf);
  ------------------
  |  | 1327|  17.2k|  do {                      \
  |  | 1328|  17.2k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  17.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  17.2k|    (ptr) = NULL;           \
  |  | 1330|  17.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 17.2k]
  |  |  ------------------
  ------------------
 4112|  17.2k|  multi->xfer_ulbuf_len = 0;
 4113|  17.2k|  multi->xfer_ulbuf_borrowed = FALSE;
  ------------------
  |  | 1058|  17.2k|#define FALSE false
  ------------------
 4114|  17.2k|  curlx_safefree(multi->xfer_sockbuf);
  ------------------
  |  | 1327|  17.2k|  do {                      \
  |  | 1328|  17.2k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  17.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  17.2k|    (ptr) = NULL;           \
  |  | 1330|  17.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 17.2k]
  |  |  ------------------
  ------------------
 4115|  17.2k|  multi->xfer_sockbuf_len = 0;
 4116|       |  multi->xfer_sockbuf_borrowed = FALSE;
  ------------------
  |  | 1058|  17.2k|#define FALSE false
  ------------------
 4117|  17.2k|}

Curl_multi_ev_socket_done:
  617|  13.9k|{
  618|  13.9k|  mev_forget_socket(multi, data, s, "socket done");
  619|  13.9k|}
Curl_multi_ev_xfer_done:
  623|  17.8k|{
  624|  17.8k|  DEBUGASSERT(!data->conn); /* transfer should have been detached */
  ------------------
  |  | 1081|  17.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (624:3): [True: 0, False: 17.8k]
  |  Branch (624:3): [True: 17.8k, False: 0]
  ------------------
  625|  17.8k|  (void)mev_assess(multi, data, NULL);
  626|  17.8k|  Curl_meta_remove(data, CURL_META_MEV_POLLSET);
  ------------------
  |  |   34|  17.8k|#define CURL_META_MEV_POLLSET   "meta:mev:ps"
  ------------------
  627|  17.8k|}
Curl_multi_ev_conn_done:
  632|  13.7k|{
  633|  13.7k|  (void)mev_assess(multi, data, conn);
  634|  13.7k|  Curl_conn_meta_remove(conn, CURL_META_MEV_POLLSET);
  ------------------
  |  |   34|  13.7k|#define CURL_META_MEV_POLLSET   "meta:mev:ps"
  ------------------
  635|  13.7k|}
Curl_multi_ev_init:
  638|  17.2k|{
  639|  17.2k|  Curl_hash_init(&multi->ev.sh_entries, hashsize, mev_sh_entry_hash,
  640|  17.2k|                 mev_sh_entry_compare, mev_sh_entry_dtor);
  641|  17.2k|}
Curl_multi_ev_cleanup:
  644|  17.2k|{
  645|  17.2k|  Curl_hash_destroy(&multi->ev.sh_entries);
  646|  17.2k|}
multi_ev.c:mev_assess:
  499|  31.6k|{
  500|  31.6k|  struct easy_pollset ps, *last_ps;
  501|  31.6k|  CURLMcode mresult = CURLM_OK;
  502|       |
  503|  31.6k|  if(!multi || !multi->socket_cb)
  ------------------
  |  Branch (503:6): [True: 0, False: 31.6k]
  |  Branch (503:16): [True: 31.6k, False: 0]
  ------------------
  504|  31.6k|    return CURLM_OK;
  505|       |
  506|      0|  Curl_pollset_init(&ps);
  507|      0|  if(conn) {
  ------------------
  |  Branch (507:6): [True: 0, False: 0]
  ------------------
  508|      0|    CURLcode result = Curl_conn_adjust_pollset(data, conn, &ps);
  509|      0|    if(result) {
  ------------------
  |  Branch (509:8): [True: 0, False: 0]
  ------------------
  510|      0|      mresult = (result == CURLE_OUT_OF_MEMORY) ?
  ------------------
  |  Branch (510:17): [True: 0, False: 0]
  ------------------
  511|      0|        CURLM_OUT_OF_MEMORY : CURLM_INTERNAL_ERROR;
  512|      0|      goto out;
  513|      0|    }
  514|      0|  }
  515|      0|  else
  516|      0|    Curl_multi_pollset(data, &ps);
  517|      0|  last_ps = mev_get_last_pollset(data, conn);
  518|       |
  519|      0|  if(!last_ps && ps.n) {
  ------------------
  |  Branch (519:6): [True: 0, False: 0]
  |  Branch (519:18): [True: 0, False: 0]
  ------------------
  520|      0|    if(conn)
  ------------------
  |  Branch (520:8): [True: 0, False: 0]
  ------------------
  521|      0|      last_ps = mev_add_new_conn_pollset(conn);
  522|      0|    else
  523|      0|      last_ps = mev_add_new_xfer_pollset(data);
  524|      0|    if(!last_ps) {
  ------------------
  |  Branch (524:8): [True: 0, False: 0]
  ------------------
  525|      0|      mresult = CURLM_OUT_OF_MEMORY;
  526|      0|      goto out;
  527|      0|    }
  528|      0|  }
  529|       |
  530|      0|  if(last_ps)
  ------------------
  |  Branch (530:6): [True: 0, False: 0]
  ------------------
  531|      0|    mresult = mev_pollset_diff(multi, data, conn, &ps, last_ps);
  532|      0|  else
  533|      0|    DEBUGASSERT(!ps.n);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (533:5): [True: 0, False: 0]
  |  Branch (533:5): [True: 0, False: 0]
  ------------------
  534|      0|out:
  535|      0|  Curl_pollset_cleanup(&ps);
  536|      0|  return mresult;
  537|      0|}
multi_ev.c:mev_sh_entry_get:
   94|  13.9k|{
   95|  13.9k|  if(s != CURL_SOCKET_BAD) {
  ------------------
  |  |  145|  13.9k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (95:6): [True: 13.9k, False: 0]
  ------------------
   96|       |    /* only look for proper sockets */
   97|  13.9k|    return Curl_hash_pick(sh, (char *)&s, sizeof(curl_socket_t));
   98|  13.9k|  }
   99|      0|  return NULL;
  100|  13.9k|}
multi_ev.c:mev_forget_socket:
  201|  13.9k|{
  202|  13.9k|  struct mev_sh_entry *entry = mev_sh_entry_get(&multi->ev.sh_entries, s);
  203|  13.9k|  int rc = 0;
  204|       |
  205|  13.9k|  if(!entry) /* we never knew or already forgot about this socket */
  ------------------
  |  Branch (205:6): [True: 13.9k, False: 0]
  ------------------
  206|  13.9k|    return CURLM_OK;
  207|       |
  208|       |  /* We managed this socket before, tell the socket callback to forget it. */
  209|      0|  if(entry->announced && multi->socket_cb) {
  ------------------
  |  Branch (209:6): [True: 0, False: 0]
  |  Branch (209:26): [True: 0, False: 0]
  ------------------
  210|      0|    NOVERBOSE((void)cause);
  ------------------
  |  | 1619|      0|#define NOVERBOSE(x) Curl_nop_stmt
  |  |  ------------------
  |  |  |  | 1180|      0|#define Curl_nop_stmt do {} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1180:35): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  211|      0|    CURL_TRC_M(data, "ev %s, call(fd=%" FMT_SOCKET_T ", ev=REMOVE)", cause, s);
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  212|      0|    mev_in_callback(multi, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  213|      0|    rc = multi->socket_cb(data, s, CURL_POLL_REMOVE,
  ------------------
  |  |  286|      0|#define CURL_POLL_REMOVE 4
  ------------------
  214|      0|                          multi->socket_userp, entry->user_data);
  215|      0|    mev_in_callback(multi, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  216|      0|    entry->announced = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  217|      0|  }
  218|       |
  219|      0|  mev_sh_entry_kill(multi, s);
  220|      0|  if(rc == -1) {
  ------------------
  |  Branch (220:6): [True: 0, False: 0]
  ------------------
  221|      0|    multi->dead = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  222|      0|    return CURLM_ABORTED_BY_CALLBACK;
  223|      0|  }
  224|      0|  return CURLM_OK;
  225|      0|}

Curl_mntfy_init:
  125|  17.2k|{
  126|  17.2k|  memset(&multi->ntfy, 0, sizeof(multi->ntfy));
  127|  17.2k|  Curl_uint32_bset_init(&multi->ntfy.enabled);
  128|  17.2k|}
Curl_mntfy_resize:
  131|  17.2k|{
  132|  17.2k|  if(Curl_uint32_bset_resize(&multi->ntfy.enabled, CURLMNOTIFY_EASY_DONE + 1))
  ------------------
  |  |  540|  17.2k|#define CURLMNOTIFY_EASY_DONE    1
  ------------------
  |  Branch (132:6): [True: 0, False: 17.2k]
  ------------------
  133|      0|    return CURLM_OUT_OF_MEMORY;
  134|  17.2k|  return CURLM_OK;
  135|  17.2k|}
Curl_mntfy_cleanup:
  138|  17.2k|{
  139|  17.2k|  while(multi->ntfy.head) {
  ------------------
  |  Branch (139:9): [True: 0, False: 17.2k]
  ------------------
  140|      0|    struct mntfy_chunk *chunk = multi->ntfy.head;
  141|      0|    multi->ntfy.head = chunk->next;
  142|      0|    mnfty_chunk_destroy(chunk);
  143|      0|  }
  144|       |  multi->ntfy.tail = NULL;
  145|  17.2k|  Curl_uint32_bset_destroy(&multi->ntfy.enabled);
  146|  17.2k|}

Curl_netrc_scan:
  572|     21|{
  573|     21|  NETRCcode retcode = NETRC_OK;
  574|     21|  char *filealloc = NULL;
  575|       |
  576|     21|  CURL_TRC_M(data, "[NETRC] scanning '%s' for host '%s' user '%s'",
  ------------------
  |  |  148|     21|  do {                                   \
  |  |  149|     21|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|     21|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|     21|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|     42|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 21, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 21]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|     42|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|     21|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|     21|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|     21|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 21]
  |  |  ------------------
  ------------------
  577|     21|             netrcfile, hostname, user);
  578|     21|  Curl_creds_unlink(pcreds);
  579|     21|  if(!netrcfile) {
  ------------------
  |  Branch (579:6): [True: 0, False: 21]
  ------------------
  580|      0|    char *home = NULL;
  581|      0|    char *homea = NULL;
  582|      0|#if defined(HAVE_GETPWUID_R) && defined(HAVE_GETEUID)
  583|      0|    char pwbuf[1024];
  584|      0|#endif
  585|      0|    filealloc = curl_getenv("NETRC");
  586|      0|    if(!filealloc) {
  ------------------
  |  Branch (586:8): [True: 0, False: 0]
  ------------------
  587|      0|      homea = curl_getenv("HOME"); /* portable environment reader */
  588|      0|      if(homea) {
  ------------------
  |  Branch (588:10): [True: 0, False: 0]
  ------------------
  589|      0|        home = homea;
  590|      0|#if defined(HAVE_GETPWUID_R) && defined(HAVE_GETEUID)
  591|      0|      }
  592|      0|      else {
  593|      0|        struct passwd pw, *pw_res;
  594|      0|        if(!getpwuid_r(geteuid(), &pw, pwbuf, sizeof(pwbuf), &pw_res) &&
  ------------------
  |  Branch (594:12): [True: 0, False: 0]
  ------------------
  595|      0|           pw_res) {
  ------------------
  |  Branch (595:12): [True: 0, False: 0]
  ------------------
  596|      0|          home = pw.pw_dir;
  597|      0|        }
  598|       |#elif defined(HAVE_GETPWUID) && defined(HAVE_GETEUID)
  599|       |      }
  600|       |      else {
  601|       |        struct passwd *pw;
  602|       |        pw = getpwuid(geteuid());
  603|       |        if(pw) {
  604|       |          home = pw->pw_dir;
  605|       |        }
  606|       |#elif defined(_WIN32)
  607|       |      }
  608|       |      else {
  609|       |        homea = curl_getenv("USERPROFILE");
  610|       |        if(homea) {
  611|       |          home = homea;
  612|       |        }
  613|       |#endif
  614|      0|      }
  615|       |
  616|      0|      if(!home)
  ------------------
  |  Branch (616:10): [True: 0, False: 0]
  ------------------
  617|      0|        return NETRC_FILE_MISSING; /* no home directory found (or possibly out
  618|       |                                      of memory) */
  619|       |
  620|      0|      filealloc = curl_maprintf("%s%s.netrc", home, DIR_CHAR);
  ------------------
  |  |  679|      0|#  define DIR_CHAR      "/"
  ------------------
  621|      0|      if(!filealloc) {
  ------------------
  |  Branch (621:10): [True: 0, False: 0]
  ------------------
  622|      0|        curlx_free(homea);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  623|      0|        retcode = NETRC_OUT_OF_MEMORY;
  624|      0|        goto out;
  625|      0|      }
  626|      0|    }
  627|      0|    retcode = netrc_scan_file(
  628|      0|      data, store, hostname, user, filealloc, pcreds);
  629|      0|    curlx_free(filealloc);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  630|       |#ifdef _WIN32
  631|       |    if(retcode == NETRC_FILE_MISSING) {
  632|       |      /* fallback to the old-style "_netrc" file */
  633|       |      filealloc = curl_maprintf("%s%s_netrc", home, DIR_CHAR);
  634|       |      if(!filealloc) {
  635|       |        curlx_free(homea);
  636|       |        return NETRC_OUT_OF_MEMORY;
  637|       |      }
  638|       |      retcode = netrc_scan_file(
  639|       |        data, store, hostname, user, filealloc, pcreds);
  640|       |      curlx_free(filealloc);
  641|       |    }
  642|       |#endif
  643|      0|    curlx_free(homea);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  644|      0|  }
  645|     21|  else
  646|     21|    retcode = netrc_scan_file(
  647|     21|      data, store, hostname, user, netrcfile, pcreds);
  648|       |
  649|     21|out:
  650|     21|  if(retcode)
  ------------------
  |  Branch (650:6): [True: 21, False: 0]
  ------------------
  651|     21|    Curl_creds_unlink(pcreds);
  652|     21|  return retcode;
  653|     21|}
Curl_netrc_init:
  656|  36.6k|{
  657|  36.6k|  curlx_dyn_init(&store->filebuf, MAX_NETRC_FILE);
  ------------------
  |  |   77|  36.6k|#define MAX_NETRC_FILE  (128 * 1024)
  ------------------
  658|       |  store->loaded = FALSE;
  ------------------
  |  | 1058|  36.6k|#define FALSE false
  ------------------
  659|  36.6k|}
Curl_netrc_cleanup:
  661|  50.5k|{
  662|  50.5k|  curlx_dyn_free(&store->filebuf);
  663|       |  store->loaded = FALSE;
  ------------------
  |  | 1058|  50.5k|#define FALSE false
  ------------------
  664|  50.5k|}
netrc.c:netrc_scan_file:
  545|     21|{
  546|     21|  struct dynbuf *filebuf = &store->filebuf;
  547|       |
  548|     21|  if(!store->loaded) {
  ------------------
  |  Branch (548:6): [True: 21, False: 0]
  ------------------
  549|     21|    NETRCcode ret = file2memory(netrcfile, filebuf);
  550|     21|    if(ret) {
  ------------------
  |  Branch (550:8): [True: 0, False: 21]
  ------------------
  551|      0|      CURL_TRC_M(data, "[NETRC] could not load '%s'", netrcfile);
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  552|      0|      return ret;
  553|      0|    }
  554|     21|    store->loaded = TRUE;
  ------------------
  |  | 1055|     21|#define TRUE true
  ------------------
  555|     21|  }
  556|       |
  557|     21|  return netrc_scan(data, curlx_dyn_ptr(filebuf), hostname, user, pcreds);
  558|     21|}
netrc.c:file2memory:
  502|     21|{
  503|     21|  NETRCcode ret = NETRC_FILE_MISSING; /* if it cannot open the file */
  504|     21|  FILE *file = curlx_fopen(filename, FOPEN_READTEXT);
  ------------------
  |  |   74|     21|#define curlx_fopen(file, mode) curl_dbg_fopen(file, mode, __LINE__, __FILE__)
  ------------------
  505|       |
  506|     21|  if(file) {
  ------------------
  |  Branch (506:6): [True: 21, False: 0]
  ------------------
  507|     21|    curlx_struct_stat stat;
  ------------------
  |  |   63|     21|#define curlx_struct_stat       struct stat
  ------------------
  508|     21|    if((curlx_fstat(fileno(file), &stat) == -1) || !S_ISDIR(stat.st_mode)) {
  ------------------
  |  |   62|     21|#define curlx_fstat             fstat
  ------------------
  |  Branch (508:8): [True: 0, False: 21]
  |  Branch (508:52): [True: 21, False: 0]
  ------------------
  509|     21|      CURLcode result = CURLE_OK;
  510|     21|      bool eof;
  511|     21|      struct dynbuf linebuf;
  512|     21|      curlx_dyn_init(&linebuf, MAX_NETRC_LINE);
  ------------------
  |  |   76|     21|#define MAX_NETRC_LINE  16384
  ------------------
  513|     21|      ret = NETRC_OK;
  514|     21|      do {
  515|     21|        const char *line;
  516|       |        /* Curl_get_line always returns lines ending with a newline */
  517|     21|        result = Curl_get_line(&linebuf, file, &eof);
  518|     21|        if(!result) {
  ------------------
  |  Branch (518:12): [True: 21, False: 0]
  ------------------
  519|     21|          line = curlx_dyn_ptr(&linebuf);
  520|       |          /* skip comments on load */
  521|     21|          curlx_str_passblanks(&line);
  522|     21|          if(*line == '#')
  ------------------
  |  Branch (522:14): [True: 0, False: 21]
  ------------------
  523|      0|            continue;
  524|     21|          result = curlx_dyn_add(filebuf, line);
  525|     21|        }
  526|     21|        if(result) {
  ------------------
  |  Branch (526:12): [True: 0, False: 21]
  ------------------
  527|      0|          curlx_dyn_free(filebuf);
  528|      0|          ret = curl2netrc(result);
  ------------------
  |  |   84|      0|  ((!(r)) ? NETRC_OK : (((r) == CURLE_OUT_OF_MEMORY) ? \
  |  |  ------------------
  |  |  |  Branch (84:4): [True: 0, False: 0]
  |  |  |  Branch (84:25): [True: 0, False: 0]
  |  |  ------------------
  |  |   85|      0|   NETRC_OUT_OF_MEMORY : NETRC_SYNTAX_ERROR))
  ------------------
  529|      0|          break;
  530|      0|        }
  531|     21|      } while(!eof);
  ------------------
  |  Branch (531:15): [True: 0, False: 21]
  ------------------
  532|     21|      curlx_dyn_free(&linebuf);
  533|     21|    }
  534|     21|    curlx_fclose(file);
  ------------------
  |  |   79|     21|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
  535|     21|  }
  536|     21|  return ret;
  537|     21|}
netrc.c:netrc_scan:
  426|     21|{
  427|     21|  struct netrc_scanner sc;
  428|     21|  NETRCcode rc = NETRC_OK;
  429|       |
  430|     21|  Curl_creds_unlink(pcreds);
  431|     21|  netrc_scan_init(&sc, data, content, hostname, user);
  432|       |
  433|     21|  while(!rc && !sc.found) {
  ------------------
  |  Branch (433:9): [True: 21, False: 0]
  |  Branch (433:16): [True: 21, False: 0]
  ------------------
  434|     21|    rc = netrc_lexer_next(&sc.lexer, FALSE);
  ------------------
  |  | 1058|     21|#define FALSE false
  ------------------
  435|     21|    if(!rc) {
  ------------------
  |  Branch (435:8): [True: 21, False: 0]
  ------------------
  436|       |      /* Does this token end any previous entry? */
  437|     21|      switch(sc.lexer.token) {
  438|     21|      case NETRC_TOK_EOF:
  ------------------
  |  Branch (438:7): [True: 21, False: 0]
  ------------------
  439|     21|      case NETRC_TOK_MACHINE:
  ------------------
  |  Branch (439:7): [True: 0, False: 21]
  ------------------
  440|     21|      case NETRC_TOK_DEFAULT:
  ------------------
  |  Branch (440:7): [True: 0, False: 21]
  ------------------
  441|     21|      case NETRC_TOK_MACDEF:
  ------------------
  |  Branch (441:7): [True: 0, False: 21]
  ------------------
  442|     21|        rc = netrc_scan_end_entry(&sc);
  443|     21|        if(rc || sc.found)
  ------------------
  |  Branch (443:12): [True: 0, False: 21]
  |  Branch (443:18): [True: 0, False: 21]
  ------------------
  444|      0|          goto out;
  445|     21|        break;
  446|     21|      default:
  ------------------
  |  Branch (446:7): [True: 0, False: 21]
  ------------------
  447|      0|        break;
  448|     21|      }
  449|       |
  450|     21|      switch(sc.lexer.token) {
  451|     21|      case NETRC_TOK_EOF:
  ------------------
  |  Branch (451:7): [True: 21, False: 0]
  ------------------
  452|     21|        goto out;
  453|      0|      case NETRC_TOK_MACHINE:
  ------------------
  |  Branch (453:7): [True: 0, False: 21]
  ------------------
  454|      0|        rc = netrc_lexer_next(&sc.lexer, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  455|      0|        if(!rc) {
  ------------------
  |  Branch (455:12): [True: 0, False: 0]
  ------------------
  456|      0|          if(sc.lexer.token == NETRC_TOK_LITERAL) {
  ------------------
  |  Branch (456:14): [True: 0, False: 0]
  ------------------
  457|      0|            sc.matches_host = curl_strequal(
  458|      0|              sc.hostname, curlx_dyn_ptr(&sc.lexer.literal));
  459|      0|          }
  460|      0|          else {
  461|      0|            sc.matches_host = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  462|      0|            netrc_lexer_push(&sc.lexer);
  463|      0|          }
  464|      0|        }
  465|      0|        break;
  466|      0|      case NETRC_TOK_DEFAULT:
  ------------------
  |  Branch (466:7): [True: 0, False: 21]
  ------------------
  467|      0|        sc.matches_host = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  468|      0|        break;
  469|      0|      case NETRC_TOK_ACCOUNT:
  ------------------
  |  Branch (469:7): [True: 0, False: 21]
  ------------------
  470|      0|        rc = netrc_scan_literal(&sc, NULL); /* ignore, not used */
  471|      0|        break;
  472|      0|      case NETRC_TOK_LOGIN:
  ------------------
  |  Branch (472:7): [True: 0, False: 21]
  ------------------
  473|      0|        rc = netrc_scan_literal(&sc, &sc.login);
  474|      0|        break;
  475|      0|      case NETRC_TOK_PASSWD:
  ------------------
  |  Branch (475:7): [True: 0, False: 21]
  ------------------
  476|      0|        rc = netrc_scan_literal(&sc, &sc.passwd);
  477|      0|        break;
  478|      0|      case NETRC_TOK_MACDEF:
  ------------------
  |  Branch (478:7): [True: 0, False: 21]
  ------------------
  479|      0|        netrc_skip_to_empty_line(&sc.lexer);
  480|      0|        break;
  481|      0|      case NETRC_TOK_LITERAL:
  ------------------
  |  Branch (481:7): [True: 0, False: 21]
  ------------------
  482|      0|      case NETRC_TOK_JUNK:
  ------------------
  |  Branch (482:7): [True: 0, False: 21]
  ------------------
  483|      0|      default:
  ------------------
  |  Branch (483:7): [True: 0, False: 21]
  ------------------
  484|       |        /* skip this */
  485|      0|        break;
  486|     21|      }
  487|     21|    }
  488|     21|  }
  489|       |
  490|     21|out:
  491|     21|  if(!rc) {
  ------------------
  |  Branch (491:6): [True: 21, False: 0]
  ------------------
  492|     21|    if(sc.creds)
  ------------------
  |  Branch (492:8): [True: 0, False: 21]
  ------------------
  493|      0|      Curl_creds_link(pcreds, sc.creds);
  494|     21|    else
  495|     21|      rc = NETRC_NO_MATCH;
  496|     21|  }
  497|     21|  netrc_scan_cleanup(&sc);
  498|     21|  return rc;
  499|     21|}
netrc.c:netrc_scan_init:
  343|     21|{
  344|     21|  memset(sc, 0, sizeof(*sc));
  345|     21|  netrc_lexer_init(&sc->lexer, data, content);
  346|     21|  sc->hostname = hostname;
  347|     21|  sc->user = (user && user[0]) ? user : NULL;
  ------------------
  |  Branch (347:15): [True: 21, False: 0]
  |  Branch (347:23): [True: 3, False: 18]
  ------------------
  348|     21|  netrc_scan_reset(sc);
  349|     21|}
netrc.c:netrc_lexer_init:
  139|     21|{
  140|     21|  curlx_dyn_init(&lexer->literal, MAX_NETRC_TOKEN);
  ------------------
  |  |   78|     21|#define MAX_NETRC_TOKEN 4096
  ------------------
  141|     21|  lexer->data = data;
  142|     21|  lexer->content = lexer->pos = content;
  143|     21|}
netrc.c:netrc_scan_reset:
  332|     63|{
  333|     63|  curlx_safefree(sc->login);
  ------------------
  |  | 1327|     63|  do {                      \
  |  | 1328|     63|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|     63|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|     63|    (ptr) = NULL;           \
  |  | 1330|     63|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 63]
  |  |  ------------------
  ------------------
  334|     63|  curlx_safefree(sc->passwd);
  ------------------
  |  | 1327|     63|  do {                      \
  |  | 1328|     63|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|     63|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|     63|    (ptr) = NULL;           \
  |  | 1330|     63|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 63]
  |  |  ------------------
  ------------------
  335|       |  sc->matches_host = FALSE;
  ------------------
  |  | 1058|     63|#define FALSE false
  ------------------
  336|     63|}
netrc.c:netrc_lexer_next:
  248|     21|{
  249|     21|  const char *s = lexer->pos, *start;
  250|     21|  NETRCcode rc = NETRC_OK;
  251|     21|  size_t slen;
  252|     21|  CURLcode result;
  253|       |
  254|     21|  if(lexer->pushed) {
  ------------------
  |  Branch (254:6): [True: 0, False: 21]
  ------------------
  255|      0|    lexer->pushed = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  256|      0|    goto out;
  257|      0|  }
  258|       |
  259|     21|  curlx_dyn_reset(&lexer->literal);
  260|     21|  netrc_skip_blanks(lexer);
  261|     21|  s = lexer->pos;
  262|       |
  263|     21|  switch(*s) {
  264|     21|  case 0:
  ------------------
  |  Branch (264:3): [True: 21, False: 0]
  ------------------
  265|     21|    lexer->token = NETRC_TOK_EOF;
  266|     21|    break;
  267|      0|  case '\"':
  ------------------
  |  Branch (267:3): [True: 0, False: 21]
  ------------------
  268|      0|    rc = netrc_lexer_quoted(lexer);
  269|      0|    lexer->token = NETRC_TOK_LITERAL;
  270|      0|    s = lexer->pos;
  271|      0|    break;
  272|      0|  default:
  ------------------
  |  Branch (272:3): [True: 0, False: 21]
  ------------------
  273|       |    /* unquoted token */
  274|      0|    start = s;
  275|      0|    while(*s && !ISBLANK(*s) && !ISNEWLINE(*s))
  ------------------
  |  |   45|      0|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 0, False: 0]
  |  |  |  Branch (45:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                  while(*s && !ISBLANK(*s) && !ISNEWLINE(*s))
  ------------------
  |  |   50|      0|#define ISNEWLINE(x)    (((x) == '\n') || (x) == '\r')
  |  |  ------------------
  |  |  |  Branch (50:26): [True: 0, False: 0]
  |  |  |  Branch (50:43): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (275:11): [True: 0, False: 0]
  ------------------
  276|      0|      ++s;
  277|      0|    slen = s - start;
  278|      0|    if(!slen) {
  ------------------
  |  Branch (278:8): [True: 0, False: 0]
  ------------------
  279|      0|      rc = NETRC_SYNTAX_ERROR;
  280|      0|    }
  281|      0|    if(want_literal) {
  ------------------
  |  Branch (281:8): [True: 0, False: 0]
  ------------------
  282|      0|      lexer->token = NETRC_TOK_LITERAL;
  283|      0|      result = curlx_dyn_addn(&lexer->literal, start, slen);
  284|      0|      rc = curl2netrc(result);
  ------------------
  |  |   84|      0|  ((!(r)) ? NETRC_OK : (((r) == CURLE_OUT_OF_MEMORY) ? \
  |  |  ------------------
  |  |  |  Branch (84:4): [True: 0, False: 0]
  |  |  |  Branch (84:25): [True: 0, False: 0]
  |  |  ------------------
  |  |   85|      0|   NETRC_OUT_OF_MEMORY : NETRC_SYNTAX_ERROR))
  ------------------
  285|      0|    }
  286|      0|    else if((slen == 7) && curl_strnequal(start, "machine", slen)) {
  ------------------
  |  Branch (286:13): [True: 0, False: 0]
  |  Branch (286:28): [True: 0, False: 0]
  ------------------
  287|      0|      lexer->token = NETRC_TOK_MACHINE;
  288|      0|    }
  289|      0|    else if((slen == 7) && curl_strnequal(start, "default", slen)) {
  ------------------
  |  Branch (289:13): [True: 0, False: 0]
  |  Branch (289:28): [True: 0, False: 0]
  ------------------
  290|      0|      lexer->token = NETRC_TOK_DEFAULT;
  291|      0|    }
  292|      0|    else if((slen == 7) && curl_strnequal(start, "account", slen)) {
  ------------------
  |  Branch (292:13): [True: 0, False: 0]
  |  Branch (292:28): [True: 0, False: 0]
  ------------------
  293|      0|      lexer->token = NETRC_TOK_ACCOUNT;
  294|      0|    }
  295|      0|    else if((slen == 5) && curl_strnequal(start, "login", slen)) {
  ------------------
  |  Branch (295:13): [True: 0, False: 0]
  |  Branch (295:28): [True: 0, False: 0]
  ------------------
  296|      0|      lexer->token = NETRC_TOK_LOGIN;
  297|      0|    }
  298|      0|    else if((slen == 8) && curl_strnequal(start, "password", slen)) {
  ------------------
  |  Branch (298:13): [True: 0, False: 0]
  |  Branch (298:28): [True: 0, False: 0]
  ------------------
  299|      0|      lexer->token = NETRC_TOK_PASSWD;
  300|      0|    }
  301|      0|    else if((slen == 6) && curl_strnequal(start, "macdef", slen)) {
  ------------------
  |  Branch (301:13): [True: 0, False: 0]
  |  Branch (301:28): [True: 0, False: 0]
  ------------------
  302|      0|      lexer->token = NETRC_TOK_MACDEF;
  303|      0|    }
  304|      0|    else {
  305|      0|      lexer->token = NETRC_TOK_JUNK;
  306|      0|    }
  307|      0|    break;
  308|     21|  }
  309|       |
  310|     21|out:
  311|       |#if NETRC_DEBUG
  312|       |  CURL_TRC_M(lexer->data, "[NETRC] token %s '%s', rc=%d",
  313|       |             netrc_tokenstr(lexer->token),
  314|       |             curlx_dyn_ptr(&lexer->literal), rc);
  315|       |#endif
  316|     21|  lexer->pos = s;
  317|     21|  return rc;
  318|     21|}
netrc.c:netrc_skip_blanks:
  153|     21|{
  154|     21|  const char *s = lexer->pos;
  155|     42|  while(*s) {
  ------------------
  |  Branch (155:9): [True: 21, False: 21]
  ------------------
  156|     21|    curlx_str_passblanks(&s);
  157|     21|    while(*s == '\r')
  ------------------
  |  Branch (157:11): [True: 0, False: 21]
  ------------------
  158|      0|      ++s;
  159|     21|    if(*s == '\n') {
  ------------------
  |  Branch (159:8): [True: 21, False: 0]
  ------------------
  160|     21|      ++s;
  161|     21|    }
  162|      0|    else
  163|      0|      break;
  164|     21|  }
  165|     21|  lexer->pos = s;
  166|     21|}
netrc.c:netrc_scan_end_entry:
  380|     21|{
  381|     21|  NETRCcode rc = NETRC_OK;
  382|       |#if NETRC_DEBUG
  383|       |  CURL_TRC_M(sc->lexer.data,
  384|       |             "[NETRC] entry matches_host=%d, login='%s', passwd='%s'",
  385|       |             sc->matches_host, sc->login, sc->passwd);
  386|       |#endif
  387|     21|  if(sc->matches_host) {
  ------------------
  |  Branch (387:6): [True: 0, False: 21]
  ------------------
  388|      0|    if(sc->login) {
  ------------------
  |  Branch (388:8): [True: 0, False: 0]
  ------------------
  389|      0|      if(sc->user) {
  ------------------
  |  Branch (389:10): [True: 0, False: 0]
  ------------------
  390|      0|        if(Curl_timestrcmp(sc->user, sc->login))
  ------------------
  |  Branch (390:12): [True: 0, False: 0]
  ------------------
  391|      0|          goto out;
  392|       |        /* We look for a specific user,
  393|       |         * entry is only interesting with password */
  394|      0|        sc->found = !!sc->passwd;
  395|      0|      }
  396|      0|      else {
  397|      0|        sc->found = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  398|      0|      }
  399|      0|    }
  400|      0|    else if(sc->passwd) {
  ------------------
  |  Branch (400:13): [True: 0, False: 0]
  ------------------
  401|       |      /* found a passwd that applies to any user */
  402|      0|      sc->found = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  403|      0|    }
  404|      0|    else {
  405|       |      /* entry has nothing interesting */
  406|      0|    }
  407|      0|    if(sc->found) {
  ------------------
  |  Branch (407:8): [True: 0, False: 0]
  ------------------
  408|       |#if NETRC_DEBUG
  409|       |      CURL_TRC_M(sc->lexer.data, "[NETRC] entry match found");
  410|       |#endif
  411|      0|      if(Curl_creds_create(sc->user ? sc->user : sc->login, sc->passwd,
  ------------------
  |  Branch (411:10): [True: 0, False: 0]
  |  Branch (411:28): [True: 0, False: 0]
  ------------------
  412|      0|                           NULL, NULL, NULL, CREDS_NETRC, &sc->creds))
  ------------------
  |  |   32|      0|#define CREDS_NETRC  3 /* username/passwd found in netrc */
  ------------------
  413|      0|        rc = NETRC_OUT_OF_MEMORY;
  414|      0|    }
  415|      0|  }
  416|     21|out:
  417|     21|  netrc_scan_reset(sc);
  418|     21|  return rc;
  419|     21|}
netrc.c:netrc_scan_cleanup:
  352|     21|{
  353|     21|  netrc_scan_reset(sc);
  354|     21|  sc->hostname = NULL;
  355|       |  sc->user = NULL;
  356|     21|  Curl_creds_unlink(&sc->creds);
  357|     21|  netrc_lexer_cleanup(&sc->lexer);
  358|     21|}
netrc.c:netrc_lexer_cleanup:
  146|     21|{
  147|     21|  lexer->content = lexer->pos = NULL;
  148|       |  lexer->data = NULL;
  149|     21|  curlx_dyn_free(&lexer->literal);
  150|     21|}

cidr4_match:
   52|    576|{
   53|    576|  unsigned int address = 0;
   54|    576|  unsigned int check = 0;
   55|       |
   56|    576|  if(bits > 32)
  ------------------
  |  Branch (56:6): [True: 6, False: 570]
  ------------------
   57|       |    /* strange input */
   58|      6|    return FALSE;
  ------------------
  |  | 1058|      6|#define FALSE false
  ------------------
   59|       |
   60|    570|  if(curlx_inet_pton(AF_INET, ipv4, &address) != 1)
  ------------------
  |  |   43|    570|  inet_pton(x, y, z)
  ------------------
  |  Branch (60:6): [True: 0, False: 570]
  ------------------
   61|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
   62|    570|  if(curlx_inet_pton(AF_INET, network, &check) != 1)
  ------------------
  |  |   43|    570|  inet_pton(x, y, z)
  ------------------
  |  Branch (62:6): [True: 523, False: 47]
  ------------------
   63|    523|    return FALSE;
  ------------------
  |  | 1058|    523|#define FALSE false
  ------------------
   64|       |
   65|     47|  if(bits && (bits != 32)) {
  ------------------
  |  Branch (65:6): [True: 31, False: 16]
  |  Branch (65:14): [True: 17, False: 14]
  ------------------
   66|     17|    unsigned int mask = 0xffffffff << (32 - bits);
   67|     17|    unsigned int haddr = htonl(address);
   68|     17|    unsigned int hcheck = htonl(check);
   69|       |#if 0
   70|       |    curl_mfprintf(stderr, "Host %s (%x) network %s (%x) "
   71|       |                  "bits %u mask %x => %x\n",
   72|       |                  ipv4, haddr, network, hcheck, bits, mask,
   73|       |                  (haddr ^ hcheck) & mask);
   74|       |#endif
   75|     17|    if((haddr ^ hcheck) & mask)
  ------------------
  |  Branch (75:8): [True: 16, False: 1]
  ------------------
   76|     16|      return FALSE;
  ------------------
  |  | 1058|     16|#define FALSE false
  ------------------
   77|      1|    return TRUE;
  ------------------
  |  | 1055|      1|#define TRUE true
  ------------------
   78|     17|  }
   79|     30|  return address == check;
   80|     47|}
cidr6_match:
   87|     87|{
   88|     87|#ifdef USE_IPV6
   89|     87|  unsigned int bytes;
   90|     87|  unsigned int rest;
   91|     87|  unsigned char address[16];
   92|     87|  unsigned char check[16];
   93|       |
   94|     87|  if(!bits)
  ------------------
  |  Branch (94:6): [True: 66, False: 21]
  ------------------
   95|     66|    bits = 128;
   96|       |
   97|     87|  bytes = bits / 8;
   98|     87|  rest = bits & 0x07;
   99|     87|  if((bytes > 16) || ((bytes == 16) && rest))
  ------------------
  |  Branch (99:6): [True: 0, False: 87]
  |  Branch (99:23): [True: 66, False: 21]
  |  Branch (99:40): [True: 0, False: 66]
  ------------------
  100|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  101|     87|  if(curlx_inet_pton(AF_INET6, ipv6, address) != 1)
  ------------------
  |  |   43|     87|  inet_pton(x, y, z)
  ------------------
  |  Branch (101:6): [True: 0, False: 87]
  ------------------
  102|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  103|     87|  if(curlx_inet_pton(AF_INET6, network, check) != 1)
  ------------------
  |  |   43|     87|  inet_pton(x, y, z)
  ------------------
  |  Branch (103:6): [True: 56, False: 31]
  ------------------
  104|     56|    return FALSE;
  ------------------
  |  | 1058|     56|#define FALSE false
  ------------------
  105|     31|  if(bytes && memcmp(address, check, bytes))
  ------------------
  |  Branch (105:6): [True: 30, False: 1]
  |  Branch (105:15): [True: 20, False: 10]
  ------------------
  106|     20|    return FALSE;
  ------------------
  |  | 1058|     20|#define FALSE false
  ------------------
  107|     11|  if(rest && ((address[bytes] ^ check[bytes]) & (0xff << (8 - rest))))
  ------------------
  |  Branch (107:6): [True: 7, False: 4]
  |  Branch (107:14): [True: 6, False: 1]
  ------------------
  108|      6|    return FALSE;
  ------------------
  |  | 1058|      6|#define FALSE false
  ------------------
  109|       |
  110|      5|  return TRUE;
  ------------------
  |  | 1055|      5|#define TRUE true
  ------------------
  111|       |#else
  112|       |  (void)ipv6;
  113|       |  (void)network;
  114|       |  (void)bits;
  115|       |  return FALSE;
  116|       |#endif
  117|     11|}
Curl_check_noproxy:
  190|  13.9k|{
  191|       |  /*
  192|       |   * If we do not have a hostname at all, like for example with a FILE
  193|       |   * transfer, we have nothing to interrogate the noproxy list with.
  194|       |   */
  195|  13.9k|  if(!name || name[0] == '\0')
  ------------------
  |  Branch (195:6): [True: 0, False: 13.9k]
  |  Branch (195:15): [True: 0, False: 13.9k]
  ------------------
  196|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  197|       |
  198|       |  /* no_proxy=domain1.dom,host.domain2.dom
  199|       |   *   (a comma-separated list of hosts which should
  200|       |   *   not be proxied, or an asterisk to override
  201|       |   *   all proxy variables)
  202|       |   */
  203|  13.9k|  if(no_proxy && no_proxy[0]) {
  ------------------
  |  Branch (203:6): [True: 326, False: 13.6k]
  |  Branch (203:18): [True: 297, False: 29]
  ------------------
  204|    297|    const char *p = no_proxy;
  205|    297|    size_t namelen;
  206|    297|    char address[16];
  207|    297|    enum nametype type = TYPE_HOST;
  208|    297|    if(!strcmp("*", no_proxy))
  ------------------
  |  Branch (208:8): [True: 3, False: 294]
  ------------------
  209|      3|      return TRUE;
  ------------------
  |  | 1055|      3|#define TRUE true
  ------------------
  210|       |
  211|       |    /* NO_PROXY was specified and it was not only an asterisk */
  212|       |
  213|       |    /* Check if name is an IP address; if not, assume it being a hostname. */
  214|    294|    namelen = strlen(name);
  215|    294|    if(curlx_inet_pton(AF_INET, name, &address) == 1)
  ------------------
  |  |   43|    294|  inet_pton(x, y, z)
  ------------------
  |  Branch (215:8): [True: 70, False: 224]
  ------------------
  216|     70|      type = TYPE_IPV4;
  217|    224|#ifdef USE_IPV6
  218|    224|    else if(curlx_inet_pton(AF_INET6, name, &address) == 1)
  ------------------
  |  |   43|    224|  inet_pton(x, y, z)
  ------------------
  |  Branch (218:13): [True: 19, False: 205]
  ------------------
  219|     19|      type = TYPE_IPV6;
  220|    205|#endif
  221|    205|    else {
  222|       |      /* ignore trailing dots in the hostname */
  223|    205|      if(name[namelen - 1] == '.')
  ------------------
  |  Branch (223:10): [True: 84, False: 121]
  ------------------
  224|     84|        namelen--;
  225|    205|    }
  226|       |
  227|  1.98k|    while(*p) {
  ------------------
  |  Branch (227:11): [True: 1.96k, False: 20]
  ------------------
  228|  1.96k|      const char *token;
  229|  1.96k|      size_t tokenlen = 0;
  230|       |
  231|       |      /* pass blanks */
  232|  1.96k|      curlx_str_passblanks(&p);
  233|       |
  234|  1.96k|      token = p;
  235|       |      /* pass over the pattern */
  236|  20.8k|      while(*p && !ISBLANK(*p) && (*p != ',')) {
  ------------------
  |  |   45|  41.5k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 38, False: 20.5k]
  |  |  |  Branch (45:38): [True: 20, False: 20.5k]
  |  |  ------------------
  ------------------
  |  Branch (236:13): [True: 20.6k, False: 251]
  |  Branch (236:35): [True: 18.9k, False: 1.65k]
  ------------------
  237|  18.9k|        p++;
  238|  18.9k|        tokenlen++;
  239|  18.9k|      }
  240|       |
  241|  1.96k|      if(tokenlen) {
  ------------------
  |  Branch (241:10): [True: 1.90k, False: 57]
  ------------------
  242|  1.90k|        bool match = FALSE;
  ------------------
  |  | 1058|  1.90k|#define FALSE false
  ------------------
  243|  1.90k|        if(type == TYPE_HOST)
  ------------------
  |  Branch (243:12): [True: 1.08k, False: 818]
  ------------------
  244|  1.08k|          match = match_host(token, tokenlen, name, namelen);
  245|    818|        else
  246|    818|          match = match_ip(type, token, tokenlen, name);
  247|       |
  248|  1.90k|        if(match)
  ------------------
  |  Branch (248:12): [True: 8, False: 1.89k]
  ------------------
  249|      8|          return TRUE;
  ------------------
  |  | 1055|      8|#define TRUE true
  ------------------
  250|  1.90k|      }
  251|       |
  252|       |      /* pass blanks after pattern */
  253|  1.95k|      curlx_str_passblanks(&p);
  254|       |      /* if not a comma, this ends the loop */
  255|  1.95k|      if(*p != ',')
  ------------------
  |  Branch (255:10): [True: 266, False: 1.68k]
  ------------------
  256|    266|        break;
  257|       |      /* pass any number of commas */
  258|  4.13k|      while(*p == ',')
  ------------------
  |  Branch (258:13): [True: 2.44k, False: 1.68k]
  ------------------
  259|  2.44k|        p++;
  260|  1.68k|    } /* while(*p) */
  261|    294|  } /* NO_PROXY was specified and it was not only an asterisk */
  262|       |
  263|  13.9k|  return FALSE;
  ------------------
  |  | 1058|  13.9k|#define FALSE false
  ------------------
  264|  13.9k|}
noproxy.c:match_host:
  127|  1.08k|{
  128|  1.08k|  bool match = FALSE;
  ------------------
  |  | 1058|  1.08k|#define FALSE false
  ------------------
  129|       |
  130|       |  /* ignore trailing dots in the token to check */
  131|  1.08k|  if(token[tokenlen - 1] == '.')
  ------------------
  |  Branch (131:6): [True: 192, False: 894]
  ------------------
  132|    192|    tokenlen--;
  133|       |
  134|  1.08k|  if(tokenlen && (*token == '.')) {
  ------------------
  |  Branch (134:6): [True: 1.00k, False: 82]
  |  Branch (134:18): [True: 45, False: 959]
  ------------------
  135|       |    /* ignore leading token dot as well */
  136|     45|    token++;
  137|     45|    tokenlen--;
  138|     45|  }
  139|       |  /* A: example.com matches 'example.com'
  140|       |     B: www.example.com matches 'example.com'
  141|       |     C: nonexample.com DOES NOT match 'example.com'
  142|       |  */
  143|  1.08k|  if(tokenlen == namelen)
  ------------------
  |  Branch (143:6): [True: 332, False: 754]
  ------------------
  144|       |    /* case A, exact match */
  145|    332|    match = curl_strnequal(token, name, namelen);
  146|    754|  else if(tokenlen < namelen) {
  ------------------
  |  Branch (146:11): [True: 285, False: 469]
  ------------------
  147|       |    /* case B, tailmatch domain */
  148|    285|    match = (name[namelen - tokenlen - 1] == '.') &&
  ------------------
  |  Branch (148:13): [True: 38, False: 247]
  ------------------
  149|     38|            curl_strnequal(token, name + (namelen - tokenlen), tokenlen);
  ------------------
  |  Branch (149:13): [True: 0, False: 38]
  ------------------
  150|    285|  }
  151|       |  /* case C passes through, not a match */
  152|  1.08k|  return match;
  153|  1.08k|}
noproxy.c:match_ip:
  157|    818|{
  158|    818|  char *slash;
  159|    818|  unsigned int bits = 0;
  160|    818|  char checkip[128];
  161|    818|  if(tokenlen >= sizeof(checkip))
  ------------------
  |  Branch (161:6): [True: 17, False: 801]
  ------------------
  162|       |    /* this cannot match */
  163|     17|    return FALSE;
  ------------------
  |  | 1058|     17|#define FALSE false
  ------------------
  164|       |  /* copy the check name to a temp buffer */
  165|    801|  memcpy(checkip, token, tokenlen);
  166|    801|  checkip[tokenlen] = 0;
  167|       |
  168|    801|  slash = strchr(checkip, '/');
  169|       |  /* if the slash is part of this token, use it */
  170|    801|  if(slash) {
  ------------------
  |  Branch (170:6): [True: 213, False: 588]
  ------------------
  171|    213|    curl_off_t value;
  172|    213|    const char *p = &slash[1];
  173|    213|    if(curlx_str_number(&p, &value, 128) || *p)
  ------------------
  |  Branch (173:8): [True: 84, False: 129]
  |  Branch (173:45): [True: 54, False: 75]
  ------------------
  174|    138|      return FALSE;
  ------------------
  |  | 1058|    138|#define FALSE false
  ------------------
  175|       |    /* a too large value is rejected in the cidr function below */
  176|     75|    bits = (unsigned int)value;
  177|     75|    *slash = 0; /* null-terminate there */
  178|     75|  }
  179|    663|  if(type == TYPE_IPV6)
  ------------------
  |  Branch (179:6): [True: 87, False: 576]
  ------------------
  180|     87|    return cidr6_match(name, checkip, bits);
  181|    576|  else
  182|    576|    return cidr4_match(name, checkip, bits);
  183|    663|}

Curl_getdate_capped:
  606|  18.1k|{
  607|  18.1k|  int rc = parsedate(p, tp);
  608|  18.1k|  return (rc == PARSEDATE_FAIL);
  ------------------
  |  |   97|  18.1k|#define PARSEDATE_FAIL   (-1)
  ------------------
  609|  18.1k|}
parsedate.c:parsedate:
  543|  18.1k|{
  544|  18.1k|  curl_off_t seconds = 0;
  545|  18.1k|  enum assume dignext = DATE_MDAY;
  546|  18.1k|  const char *indate = date; /* save the original pointer */
  547|  18.1k|  int part = 0; /* max 6 parts */
  548|  18.1k|  int rc = 0;
  549|  18.1k|  struct when w;
  550|  18.1k|  initwhen(&w);
  551|       |
  552|  55.2k|  while(*date && (part < 6)) {
  ------------------
  |  Branch (552:9): [True: 47.2k, False: 8.02k]
  |  Branch (552:18): [True: 47.2k, False: 0]
  ------------------
  553|  47.2k|    skip(&date);
  554|       |
  555|  47.2k|    if(ISALPHA(*date))
  ------------------
  |  |   38|  47.2k|#define ISALPHA(x)  (ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   43|  94.4k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:22): [True: 8.31k, False: 38.9k]
  |  |  |  |  |  Branch (43:38): [True: 8.31k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALPHA(x)  (ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   42|  38.9k|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 8.60k, False: 30.3k]
  |  |  |  |  |  Branch (42:38): [True: 8.60k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  556|  16.9k|      rc = datestring(&date, &w);
  557|  30.3k|    else if(ISDIGIT(*date))
  ------------------
  |  |   44|  30.3k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 25.7k, False: 4.57k]
  |  |  |  Branch (44:38): [True: 25.7k, False: 0]
  |  |  ------------------
  ------------------
  558|  25.7k|      rc = datenum(indate, &date, &w, &dignext);
  559|  47.2k|    if(rc)
  ------------------
  |  Branch (559:8): [True: 10.1k, False: 37.0k]
  ------------------
  560|  10.1k|      return rc;
  561|       |
  562|  37.0k|    part++;
  563|  37.0k|  }
  564|       |
  565|  8.02k|  rc = datecheck(&w);
  566|  8.02k|  if(rc)
  ------------------
  |  Branch (566:6): [True: 5.75k, False: 2.26k]
  ------------------
  567|  5.75k|    return rc;
  568|       |
  569|  2.26k|  seconds = time2epoch(&w); /* get number of seconds */
  570|  2.26k|  tzadjust(&seconds, &w); /* handle the time zone offset */
  571|  2.26k|  rc = mktimet(seconds, output); /* squeeze seconds into a time_t */
  572|       |
  573|  2.26k|  return rc;
  574|  8.02k|}
parsedate.c:initwhen:
  360|  18.1k|{
  361|  18.1k|  w->wday = w->mon = w->mday = w->hour = w->min = w->sec = w->year = w->tzoff =
  362|  18.1k|    -1;
  363|  18.1k|}
parsedate.c:skip:
  256|  47.2k|{
  257|       |  /* skip everything that are not letters or digits */
  258|   142k|  while(**date && !ISALNUM(**date))
  ------------------
  |  |   41|   137k|#define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   44|   275k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 59.4k, False: 78.3k]
  |  |  |  |  |  Branch (44:38): [True: 25.7k, False: 33.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   43|   249k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:22): [True: 11.6k, False: 100k]
  |  |  |  |  |  Branch (43:38): [True: 8.31k, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   42|   103k|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 14.6k, False: 89.0k]
  |  |  |  |  |  Branch (42:38): [True: 8.60k, False: 6.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (258:9): [True: 137k, False: 4.57k]
  ------------------
  259|  95.1k|    (*date)++;
  260|  47.2k|}
parsedate.c:datestring:
  366|  16.9k|{
  367|       |  /* a name coming up */
  368|  16.9k|  size_t len = 0;
  369|  16.9k|  const char *p = *datep;
  370|  16.9k|  bool found = FALSE;
  ------------------
  |  | 1058|  16.9k|#define FALSE false
  ------------------
  371|  57.5k|  while(ISALPHA(*p) && (len < NAME_LEN)) {
  ------------------
  |  |   38|   115k|#define ISALPHA(x)  (ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   43|   115k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:22): [True: 23.3k, False: 34.1k]
  |  |  |  |  |  Branch (43:38): [True: 23.1k, False: 274]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALPHA(x)  (ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   42|  34.4k|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 19.0k, False: 15.3k]
  |  |  |  |  |  Branch (42:38): [True: 17.7k, False: 1.28k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                while(ISALPHA(*p) && (len < NAME_LEN)) {
  ------------------
  |  |  357|  40.8k|#define NAME_LEN 12
  ------------------
  |  Branch (371:24): [True: 40.6k, False: 267]
  ------------------
  372|  40.6k|    p++;
  373|  40.6k|    len++;
  374|  40.6k|  }
  375|       |
  376|  16.9k|  if(len != NAME_LEN) {
  ------------------
  |  |  357|  16.9k|#define NAME_LEN 12
  ------------------
  |  Branch (376:6): [True: 16.5k, False: 316]
  ------------------
  377|  16.5k|    if(w->wday == -1) {
  ------------------
  |  Branch (377:8): [True: 15.2k, False: 1.33k]
  ------------------
  378|  15.2k|      w->wday = checkday(*datep, len);
  379|  15.2k|      if(w->wday != -1)
  ------------------
  |  Branch (379:10): [True: 1.96k, False: 13.2k]
  ------------------
  380|  1.96k|        found = TRUE;
  ------------------
  |  | 1055|  1.96k|#define TRUE true
  ------------------
  381|  15.2k|    }
  382|  16.5k|    if(!found && (w->mon == -1)) {
  ------------------
  |  Branch (382:8): [True: 14.6k, False: 1.96k]
  |  Branch (382:18): [True: 13.0k, False: 1.57k]
  ------------------
  383|  13.0k|      w->mon = checkmonth(*datep, len);
  384|  13.0k|      if(w->mon != -1)
  ------------------
  |  Branch (384:10): [True: 3.70k, False: 9.35k]
  ------------------
  385|  3.70k|        found = TRUE;
  ------------------
  |  | 1055|  3.70k|#define TRUE true
  ------------------
  386|  13.0k|    }
  387|       |
  388|  16.5k|    if(!found && (w->tzoff == -1)) {
  ------------------
  |  Branch (388:8): [True: 10.9k, False: 5.67k]
  |  Branch (388:18): [True: 9.99k, False: 923]
  ------------------
  389|       |      /* this must be a time zone string */
  390|  9.99k|      w->tzoff = checktz(*datep, len);
  391|  9.99k|      if(w->tzoff != -1)
  ------------------
  |  Branch (391:10): [True: 3.95k, False: 6.04k]
  ------------------
  392|  3.95k|        found = TRUE;
  ------------------
  |  | 1055|  3.95k|#define TRUE true
  ------------------
  393|  9.99k|    }
  394|  16.5k|  }
  395|  16.9k|  if(!found)
  ------------------
  |  Branch (395:6): [True: 7.28k, False: 9.62k]
  ------------------
  396|  7.28k|    return PARSEDATE_FAIL; /* bad string */
  ------------------
  |  |   97|  7.28k|#define PARSEDATE_FAIL   (-1)
  ------------------
  397|       |
  398|  9.62k|  *datep += len;
  399|  9.62k|  return PARSEDATE_OK;
  ------------------
  |  |   96|  9.62k|#define PARSEDATE_OK     0
  ------------------
  400|  16.9k|}
parsedate.c:checkday:
  199|  15.2k|{
  200|  15.2k|  int i;
  201|  15.2k|  const char * const *what;
  202|  15.2k|  if(len > 3)
  ------------------
  |  Branch (202:6): [True: 847, False: 14.4k]
  ------------------
  203|    847|    what = &weekday[0];
  204|  14.4k|  else if(len == 3)
  ------------------
  |  Branch (204:11): [True: 6.08k, False: 8.33k]
  ------------------
  205|  6.08k|    what = &Curl_wkday[0];
  206|  8.33k|  else
  207|  8.33k|    return -1; /* too short */
  208|  50.9k|  for(i = 0; i < 7; i++) {
  ------------------
  |  Branch (208:14): [True: 45.9k, False: 4.96k]
  ------------------
  209|  45.9k|    size_t ilen = strlen(what[0]);
  210|  45.9k|    if((ilen == len) &&
  ------------------
  |  Branch (210:8): [True: 41.1k, False: 4.82k]
  ------------------
  211|  41.1k|       curl_strnequal(check, what[0], len))
  ------------------
  |  Branch (211:8): [True: 1.96k, False: 39.1k]
  ------------------
  212|  1.96k|      return i;
  213|  43.9k|    what++;
  214|  43.9k|  }
  215|  4.96k|  return -1;
  216|  6.93k|}
parsedate.c:checkmonth:
  219|  13.0k|{
  220|  13.0k|  int i;
  221|  13.0k|  const char * const *what = &Curl_month[0];
  222|  13.0k|  if(len != 3)
  ------------------
  |  Branch (222:6): [True: 8.21k, False: 4.84k]
  ------------------
  223|  8.21k|    return -1; /* not a month */
  224|       |
  225|  40.9k|  for(i = 0; i < 12; i++) {
  ------------------
  |  Branch (225:14): [True: 39.8k, False: 1.13k]
  ------------------
  226|  39.8k|    if(curl_strnequal(check, what[0], 3))
  ------------------
  |  Branch (226:8): [True: 3.70k, False: 36.0k]
  ------------------
  227|  3.70k|      return i;
  228|  36.0k|    what++;
  229|  36.0k|  }
  230|  1.13k|  return -1; /* return the offset or -1, no real offset is -1 */
  231|  4.84k|}
parsedate.c:checktz:
  243|  9.99k|{
  244|  9.99k|  if(len <= 4) {
  ------------------
  |  Branch (244:6): [True: 9.60k, False: 390]
  ------------------
  245|  9.60k|    const struct tzinfo *what;
  246|  9.60k|    struct tzinfo find;
  247|  9.60k|    curlx_strcopy(find.name, sizeof(find.name), check, len);
  248|  9.60k|    what = bsearch(&find, tz, CURL_ARRAYSIZE(tz), sizeof(tz[0]), tzcompare);
  ------------------
  |  | 1294|  9.60k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  249|  9.60k|    if(what)
  ------------------
  |  Branch (249:8): [True: 3.95k, False: 5.65k]
  ------------------
  250|  3.95k|      return what->offset * 60;
  251|  9.60k|  }
  252|  6.04k|  return -1;
  253|  9.99k|}
parsedate.c:tzcompare:
  234|  53.2k|{
  235|  53.2k|  const struct tzinfo *tz1 = m1;
  236|  53.2k|  const struct tzinfo *tz2 = m2;
  237|  53.2k|  return strcmp(tz1->name, tz2->name);
  238|  53.2k|}
parsedate.c:datenum:
  404|  25.7k|{
  405|       |  /* a digit */
  406|  25.7k|  unsigned int val;
  407|  25.7k|  char *end;
  408|  25.7k|  const char *date = *datep;
  409|  25.7k|  enum assume dignext = *dignextp;
  410|       |
  411|  25.7k|  if((w->sec == -1) && match_time(date, w, &end)) {
  ------------------
  |  Branch (411:6): [True: 24.2k, False: 1.44k]
  |  Branch (411:24): [True: 3.84k, False: 20.4k]
  ------------------
  412|       |    /* time stamp */
  413|  3.84k|    date = end;
  414|  3.84k|  }
  415|  21.8k|  else {
  416|  21.8k|    bool found = FALSE;
  ------------------
  |  | 1058|  21.8k|#define FALSE false
  ------------------
  417|  21.8k|    curl_off_t lval;
  418|  21.8k|    int num_digits = 0;
  419|  21.8k|    const char *p = *datep;
  420|  21.8k|    if(curlx_str_number(&p, &lval, 99999999))
  ------------------
  |  Branch (420:8): [True: 440, False: 21.4k]
  ------------------
  421|    440|      return PARSEDATE_FAIL;
  ------------------
  |  |   97|    440|#define PARSEDATE_FAIL   (-1)
  ------------------
  422|       |
  423|       |    /* we know num_digits cannot be larger than 8 */
  424|  21.4k|    num_digits = (int)(p - *datep);
  425|  21.4k|    val = (unsigned int)lval;
  426|       |
  427|  21.4k|    if((w->tzoff == -1) &&
  ------------------
  |  Branch (427:8): [True: 18.6k, False: 2.77k]
  ------------------
  428|  18.6k|       (num_digits == 4) &&
  ------------------
  |  Branch (428:8): [True: 1.78k, False: 16.8k]
  ------------------
  429|  1.78k|       (val <= 1400) &&
  ------------------
  |  Branch (429:8): [True: 1.00k, False: 780]
  ------------------
  430|  1.00k|       (indate < date) &&
  ------------------
  |  Branch (430:8): [True: 611, False: 392]
  ------------------
  431|    611|       (date[-1] == '+' || date[-1] == '-')) {
  ------------------
  |  Branch (431:9): [True: 93, False: 518]
  |  Branch (431:28): [True: 256, False: 262]
  ------------------
  432|       |      /* four digits and a value less than or equal to 1400 (to take into
  433|       |         account all sorts of funny time zone diffs) and it is preceded
  434|       |         with a plus or minus. This is a time zone indication. 1400 is
  435|       |         picked since +1300 is frequently used and +1400 is mentioned as
  436|       |         an edge number in the document "ISO C 200X Proposal: Timezone
  437|       |         Functions" at http://david.tribble.com/text/c0xtimezone.html If
  438|       |         anyone has a more authoritative source for the exact maximum time
  439|       |         zone offsets, please speak up! */
  440|    349|      found = TRUE;
  ------------------
  |  | 1055|    349|#define TRUE true
  ------------------
  441|    349|      w->tzoff = ((val / 100 * 60) + (val % 100)) * 60;
  442|       |
  443|       |      /* the + and - prefix indicates the local time compared to GMT,
  444|       |         this we need their reversed math to get what we want */
  445|    349|      w->tzoff = date[-1] == '+' ? -w->tzoff : w->tzoff;
  ------------------
  |  Branch (445:18): [True: 93, False: 256]
  ------------------
  446|    349|    }
  447|       |
  448|  21.1k|    else if((num_digits == 8) && (w->year == -1) &&
  ------------------
  |  Branch (448:13): [True: 2.93k, False: 18.1k]
  |  Branch (448:34): [True: 2.63k, False: 307]
  ------------------
  449|  2.63k|            (w->mon == -1) && (w->mday == -1)) {
  ------------------
  |  Branch (449:13): [True: 2.05k, False: 574]
  |  Branch (449:31): [True: 1.78k, False: 271]
  ------------------
  450|       |      /* 8 digits, no year, month or day yet. This is YYYYMMDD */
  451|  1.78k|      found = TRUE;
  ------------------
  |  | 1055|  1.78k|#define TRUE true
  ------------------
  452|  1.78k|      w->year = val / 10000;
  453|  1.78k|      w->mon = ((val % 10000) / 100) - 1; /* month is 0 - 11 */
  454|  1.78k|      w->mday = val % 100;
  455|  1.78k|    }
  456|       |
  457|  21.4k|    if(!found && (dignext == DATE_MDAY) && (w->mday == -1)) {
  ------------------
  |  Branch (457:8): [True: 19.3k, False: 2.13k]
  |  Branch (457:18): [True: 15.2k, False: 4.07k]
  |  Branch (457:44): [True: 14.9k, False: 276]
  ------------------
  458|  14.9k|      if((val > 0) && (val < 32)) {
  ------------------
  |  Branch (458:10): [True: 12.9k, False: 2.03k]
  |  Branch (458:23): [True: 7.44k, False: 5.49k]
  ------------------
  459|  7.44k|        w->mday = val;
  460|  7.44k|        found = TRUE;
  ------------------
  |  | 1055|  7.44k|#define TRUE true
  ------------------
  461|  7.44k|      }
  462|  14.9k|      dignext = DATE_YEAR;
  463|  14.9k|    }
  464|       |
  465|  21.4k|    if(!found && (dignext == DATE_YEAR) && (w->year == -1)) {
  ------------------
  |  Branch (465:8): [True: 11.8k, False: 9.57k]
  |  Branch (465:18): [True: 11.6k, False: 276]
  |  Branch (465:44): [True: 9.48k, False: 2.12k]
  ------------------
  466|  9.48k|      w->year = val;
  467|  9.48k|      found = TRUE;
  ------------------
  |  | 1055|  9.48k|#define TRUE true
  ------------------
  468|  9.48k|      if(w->year < 100) {
  ------------------
  |  Branch (468:10): [True: 4.89k, False: 4.58k]
  ------------------
  469|  4.89k|        if(w->year > 70)
  ------------------
  |  Branch (469:12): [True: 746, False: 4.14k]
  ------------------
  470|    746|          w->year += 1900;
  471|  4.14k|        else
  472|  4.14k|          w->year += 2000;
  473|  4.89k|      }
  474|  9.48k|      if(w->mday == -1)
  ------------------
  |  Branch (474:10): [True: 6.34k, False: 3.14k]
  ------------------
  475|  6.34k|        dignext = DATE_MDAY;
  476|  9.48k|    }
  477|       |
  478|  21.4k|    if(!found)
  ------------------
  |  Branch (478:8): [True: 2.39k, False: 19.0k]
  ------------------
  479|  2.39k|      return PARSEDATE_FAIL;
  ------------------
  |  |   97|  2.39k|#define PARSEDATE_FAIL   (-1)
  ------------------
  480|       |
  481|  19.0k|    date = p;
  482|  19.0k|  }
  483|  22.9k|  *datep = date;
  484|  22.9k|  *dignextp = dignext;
  485|  22.9k|  return PARSEDATE_OK;
  ------------------
  |  |   96|  22.9k|#define PARSEDATE_OK     0
  ------------------
  486|  25.7k|}
parsedate.c:match_time:
  316|  24.2k|{
  317|  24.2k|  const char *p;
  318|  24.2k|  int hh, mm, ss = 0;
  319|  24.2k|  hh = oneortwodigit(date, &p);
  320|  24.2k|  if((hh < 24) && (*p == ':') && ISDIGIT(p[1])) {
  ------------------
  |  |   44|  6.23k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 5.37k, False: 854]
  |  |  |  Branch (44:38): [True: 4.71k, False: 661]
  |  |  ------------------
  ------------------
  |  Branch (320:6): [True: 18.5k, False: 5.74k]
  |  Branch (320:19): [True: 6.23k, False: 12.3k]
  ------------------
  321|  4.71k|    mm = oneortwodigit(&p[1], &p);
  322|  4.71k|    if(mm < 60) {
  ------------------
  |  Branch (322:8): [True: 4.17k, False: 544]
  ------------------
  323|  4.17k|      if((*p == ':') && ISDIGIT(p[1])) {
  ------------------
  |  |   44|  3.01k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.77k, False: 1.23k]
  |  |  |  Branch (44:38): [True: 1.48k, False: 295]
  |  |  ------------------
  ------------------
  |  Branch (323:10): [True: 3.01k, False: 1.15k]
  ------------------
  324|  1.48k|        ss = oneortwodigit(&p[1], &p);
  325|  1.48k|        if(ss <= 60) {
  ------------------
  |  Branch (325:12): [True: 1.15k, False: 328]
  ------------------
  326|       |          /* valid HH:MM:SS */
  327|  1.15k|          goto match;
  328|  1.15k|        }
  329|  1.48k|      }
  330|  2.69k|      else {
  331|       |        /* valid HH:MM */
  332|  2.69k|        goto match;
  333|  2.69k|      }
  334|  4.17k|    }
  335|  4.71k|  }
  336|  20.4k|  return FALSE; /* not a time string */
  ------------------
  |  | 1058|  20.4k|#define FALSE false
  ------------------
  337|  3.84k|match:
  338|  3.84k|  w->hour = hh;
  339|  3.84k|  w->min = mm;
  340|  3.84k|  w->sec = ss;
  341|  3.84k|  *endp = (char *)CURL_UNCONST(p);
  ------------------
  |  |  866|  3.84k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  342|       |  return TRUE;
  ------------------
  |  | 1055|  3.84k|#define TRUE true
  ------------------
  343|  24.2k|}
parsedate.c:oneortwodigit:
  304|  30.4k|{
  305|  30.4k|  int num = date[0] - '0';
  306|  30.4k|  if(ISDIGIT(date[1])) {
  ------------------
  |  |   44|  30.4k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 26.1k, False: 4.33k]
  |  |  |  Branch (44:38): [True: 16.1k, False: 10.0k]
  |  |  ------------------
  ------------------
  307|  16.1k|    *endp = &date[2];
  308|  16.1k|    return (num * 10) + (date[1] - '0');
  309|  16.1k|  }
  310|  14.3k|  *endp = &date[1];
  311|  14.3k|  return num;
  312|  30.4k|}
parsedate.c:datecheck:
  489|  8.02k|{
  490|  8.02k|  if(w->sec == -1)
  ------------------
  |  Branch (490:6): [True: 5.30k, False: 2.71k]
  ------------------
  491|  5.30k|    w->sec = w->min = w->hour = 0; /* no time, make it zero */
  492|       |
  493|  8.02k|  if((w->mday == -1) || (w->mon == -1) || (w->year == -1))
  ------------------
  |  Branch (493:6): [True: 1.80k, False: 6.21k]
  |  Branch (493:25): [True: 2.49k, False: 3.71k]
  |  Branch (493:43): [True: 243, False: 3.46k]
  ------------------
  494|       |    /* lacks vital info, fail */
  495|  4.55k|    return PARSEDATE_FAIL;
  ------------------
  |  |   97|  4.55k|#define PARSEDATE_FAIL   (-1)
  ------------------
  496|       |
  497|       |  /* The Gregorian calendar was introduced 1582 */
  498|  3.46k|  else if(w->year < 1583)
  ------------------
  |  Branch (498:11): [True: 366, False: 3.10k]
  ------------------
  499|    366|    return PARSEDATE_FAIL;
  ------------------
  |  |   97|    366|#define PARSEDATE_FAIL   (-1)
  ------------------
  500|       |
  501|  3.10k|  else if((w->mday > 31) || (w->mon > 11) || (w->hour > 23) ||
  ------------------
  |  Branch (501:11): [True: 294, False: 2.80k]
  |  Branch (501:29): [True: 540, False: 2.26k]
  |  Branch (501:46): [True: 0, False: 2.26k]
  ------------------
  502|  2.26k|          (w->min > 59) || (w->sec > 60))
  ------------------
  |  Branch (502:11): [True: 0, False: 2.26k]
  |  Branch (502:28): [True: 0, False: 2.26k]
  ------------------
  503|    834|    return PARSEDATE_FAIL; /* clearly an illegal date */
  ------------------
  |  |   97|    834|#define PARSEDATE_FAIL   (-1)
  ------------------
  504|       |
  505|  2.26k|  return PARSEDATE_OK;
  ------------------
  |  |   96|  2.26k|#define PARSEDATE_OK     0
  ------------------
  506|  8.02k|}
parsedate.c:time2epoch:
  288|  2.26k|{
  289|  2.26k|  static const int cumulative_days[12] = {
  290|  2.26k|    0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
  291|  2.26k|  };
  292|  2.26k|  int y = w->year - (w->mon <= 1);
  293|  2.26k|  int leap_days = (y / 4) - (y / 100) + (y / 400) - LEAP_DAYS_BEFORE_1969;
  ------------------
  |  |  281|  2.26k|#define LEAP_DAYS_BEFORE_1969 477
  ------------------
  294|  2.26k|  curl_off_t days = (curl_off_t)(w->year - 1970) * 365 + leap_days +
  295|  2.26k|    cumulative_days[w->mon] + w->mday - 1;
  296|       |
  297|  2.26k|  return (((days * 24 + w->hour) * 60 + w->min) * 60) + w->sec;
  298|  2.26k|}
parsedate.c:tzadjust:
  509|  2.26k|{
  510|  2.26k|  if(w->tzoff == -1) /* unknown tz means no offset */
  ------------------
  |  Branch (510:6): [True: 1.48k, False: 789]
  ------------------
  511|  1.48k|    w->tzoff = 0;
  512|       |
  513|       |  /* Add the time zone diff between local time zone and GMT. */
  514|  2.26k|  if((w->tzoff > 0) && (*tp > (curl_off_t)(CURL_OFF_T_MAX - w->tzoff)))
  ------------------
  |  |  594|     92|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (514:6): [True: 92, False: 2.17k]
  |  Branch (514:24): [True: 0, False: 92]
  ------------------
  515|      0|    *tp = CURL_OFF_T_MAX;
  ------------------
  |  |  594|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  516|  2.26k|  else
  517|  2.26k|    *tp += w->tzoff;
  518|       |  /* this needs no minimum check since we require a year > 1582 */
  519|  2.26k|}
parsedate.c:mktimet:
  522|  2.26k|{
  523|       |#if SIZEOF_TIME_T < 5
  524|       |  if(seconds > TIME_T_MAX) {
  525|       |    *output = TIME_T_MAX;
  526|       |    return PARSEDATE_LATER;
  527|       |  }
  528|       |  else if(seconds < TIME_T_MIN) {
  529|       |    *output = TIME_T_MIN;
  530|       |    return PARSEDATE_SOONER;
  531|       |  }
  532|       |#elif defined(HAVE_TIME_T_UNSIGNED)
  533|       |  if(seconds < 0) {
  534|       |    *output = 0;
  535|       |    return PARSEDATE_SOONER;
  536|       |  }
  537|       |#endif
  538|  2.26k|  *output = (time_t)seconds;
  539|  2.26k|  return PARSEDATE_OK;
  ------------------
  |  |   96|  2.26k|#define PARSEDATE_OK     0
  ------------------
  540|  2.26k|}

Curl_peer_create:
  238|  1.94k|{
  239|  1.94k|  struct peer_parse pp;
  240|  1.94k|  CURLcode result;
  241|       |
  242|  1.94k|  Curl_peer_unlink(ppeer);
  243|  1.94k|  memset(&pp, 0, sizeof(pp));
  244|  1.94k|  pp.scheme = scheme;
  245|  1.94k|  pp.host_user.str = hostname;
  246|  1.94k|  pp.host_user.len = strlen(hostname);
  247|  1.94k|  pp.port = port;
  248|       |
  249|  1.94k|  result = peer_parse_host(data, &pp, TRUE);
  ------------------
  |  | 1055|  1.94k|#define TRUE true
  ------------------
  250|  1.94k|  if(!result)
  ------------------
  |  Branch (250:6): [True: 1.93k, False: 5]
  ------------------
  251|  1.93k|    result = peer_create(&pp, ppeer);
  252|       |
  253|  1.94k|  peer_parse_clear(&pp);
  254|  1.94k|  return result;
  255|  1.94k|}
Curl_peer_uds_create:
  262|    113|{
  263|    113|  struct peer_parse pp;
  264|    113|  size_t pathlen = path ? strlen(path) : 0;
  ------------------
  |  Branch (264:20): [True: 113, False: 0]
  ------------------
  265|    113|  CURLcode result = CURLE_OK;
  266|       |
  267|    113|  Curl_peer_unlink(ppeer);
  268|    113|  memset(&pp, 0, sizeof(pp));
  269|    113|  if(!scheme)
  ------------------
  |  Branch (269:6): [True: 0, False: 113]
  ------------------
  270|      0|    return CURLE_FAILED_INIT;
  271|    113|  if(!pathlen)
  ------------------
  |  Branch (271:6): [True: 2, False: 111]
  ------------------
  272|      2|    return CURLE_FAILED_INIT;
  273|       |
  274|    111|  pp.scheme = scheme;
  275|    111|  pp.host_user.str = pp.host.str = path;
  276|    111|  pp.host_user.len = pp.host.len = pathlen;
  277|    111|  pp.unix_socket = TRUE;
  ------------------
  |  | 1055|    111|#define TRUE true
  ------------------
  278|    111|  pp.abstract_uds = abstract_unix_socket;
  279|       |
  280|    111|  result = peer_create(&pp, ppeer);
  281|    111|  peer_parse_clear(&pp);
  282|    111|  return result;
  283|    113|}
Curl_peer_link:
  287|  61.6k|{
  288|  61.6k|  if(*pdest != src) {
  ------------------
  |  Branch (288:6): [True: 61.4k, False: 184]
  ------------------
  289|  61.4k|    Curl_peer_unlink(pdest);
  290|  61.4k|    *pdest = src;
  291|  61.4k|    if(src) {
  ------------------
  |  Branch (291:8): [True: 61.4k, False: 34]
  ------------------
  292|  61.4k|      DEBUGASSERT(src->refcount < UINT32_MAX);
  ------------------
  |  | 1081|  61.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (292:7): [True: 0, False: 61.4k]
  |  Branch (292:7): [True: 61.4k, False: 0]
  ------------------
  293|  61.4k|      src->refcount++;
  294|  61.4k|    }
  295|  61.4k|  }
  296|  61.6k|}
Curl_peer_unlink:
  299|   312k|{
  300|   312k|  if(*ppeer) {
  ------------------
  |  Branch (300:6): [True: 100k, False: 211k]
  ------------------
  301|   100k|    struct Curl_peer *peer = *ppeer;
  302|       |
  303|   100k|    DEBUGASSERT(peer->refcount);
  ------------------
  |  | 1081|   100k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (303:5): [True: 0, False: 100k]
  |  Branch (303:5): [True: 100k, False: 0]
  ------------------
  304|   100k|    *ppeer = NULL;
  305|   100k|    if(peer->refcount)
  ------------------
  |  Branch (305:8): [True: 100k, False: 0]
  ------------------
  306|   100k|      peer->refcount--;
  307|   100k|    if(!peer->refcount) {
  ------------------
  |  Branch (307:8): [True: 39.2k, False: 61.4k]
  ------------------
  308|  39.2k|      curlx_free(peer);
  ------------------
  |  | 1483|  39.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  309|  39.2k|    }
  310|   100k|  }
  311|   312k|}
Curl_peer_equal:
  314|  17.5k|{
  315|  17.5k|  return (p1 == p2) ||
  ------------------
  |  Branch (315:10): [True: 2.85k, False: 14.7k]
  ------------------
  316|  14.7k|         (p1 && p2 &&
  ------------------
  |  Branch (316:11): [True: 14.7k, False: 0]
  |  Branch (316:17): [True: 14.1k, False: 536]
  ------------------
  317|  14.1k|          (p1->scheme == p2->scheme) &&
  ------------------
  |  Branch (317:11): [True: 14.1k, False: 0]
  ------------------
  318|  14.1k|          Curl_peer_same_destination(p1, p2));
  ------------------
  |  Branch (318:11): [True: 797, False: 13.3k]
  ------------------
  319|  17.5k|}
Curl_peer_same_destination:
  334|  15.7k|{
  335|  15.7k|  return (p1 == p2) ||
  ------------------
  |  Branch (335:10): [True: 205, False: 15.5k]
  ------------------
  336|  15.5k|         (p1 && p2 &&
  ------------------
  |  Branch (336:11): [True: 15.5k, False: 0]
  |  Branch (336:17): [True: 15.5k, False: 0]
  ------------------
  337|  15.5k|          (p1->port == p2->port) &&
  ------------------
  |  Branch (337:11): [True: 15.4k, False: 110]
  ------------------
  338|  15.4k|          peer_same_hostname(p1, p2) &&
  ------------------
  |  Branch (338:11): [True: 2.18k, False: 13.2k]
  ------------------
  339|  2.18k|          (p1->scopeid == p2->scopeid) &&
  ------------------
  |  Branch (339:11): [True: 2.16k, False: 16]
  ------------------
  340|  2.16k|          (p1->scopeid || curl_strequal(p1->zoneid, p2->zoneid)));
  ------------------
  |  Branch (340:12): [True: 316, False: 1.85k]
  |  Branch (340:27): [True: 1.85k, False: 0]
  ------------------
  341|  15.7k|}
Curl_peer_from_url:
  348|  14.7k|{
  349|  14.7k|  struct peer_parse pp;
  350|  14.7k|  char *zoneid = NULL;
  351|  14.7k|  CURLUcode uc;
  352|  14.7k|  CURLcode result;
  353|       |
  354|  14.7k|  Curl_peer_unlink(ppeer);
  355|  14.7k|  memset(&pp, 0, sizeof(pp));
  356|       |
  357|  14.7k|  curlx_safefree(up->scheme);
  ------------------
  |  | 1327|  14.7k|  do {                      \
  |  | 1328|  14.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  14.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  14.7k|    (ptr) = NULL;           \
  |  | 1330|  14.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 14.7k]
  |  |  ------------------
  ------------------
  358|  14.7k|  uc = curl_url_get(uh, CURLUPART_SCHEME, &up->scheme, 0);
  359|  14.7k|  if(uc)
  ------------------
  |  Branch (359:6): [True: 0, False: 14.7k]
  ------------------
  360|      0|    return Curl_uc_to_curlcode(uc);
  361|  14.7k|  pp.scheme = Curl_get_scheme(up->scheme);
  362|  14.7k|  if(!pp.scheme) {
  ------------------
  |  Branch (362:6): [True: 29, False: 14.6k]
  ------------------
  363|     29|    failf(data, "Protocol \"%s\" not supported%s", up->scheme,
  ------------------
  |  |   62|     29|#define failf Curl_failf
  ------------------
  364|     29|          data->state.this_is_a_follow ? " (in redirect)" : "");
  ------------------
  |  Branch (364:11): [True: 0, False: 29]
  ------------------
  365|     29|    result = CURLE_UNSUPPORTED_PROTOCOL;
  366|     29|    goto out;
  367|     29|  }
  368|       |
  369|  14.6k|  curlx_safefree(up->hostname);
  ------------------
  |  | 1327|  14.6k|  do {                      \
  |  | 1328|  14.6k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  14.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  14.6k|    (ptr) = NULL;           \
  |  | 1330|  14.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 14.6k]
  |  |  ------------------
  ------------------
  370|  14.6k|  uc = curl_url_get(uh, CURLUPART_HOST, &up->hostname, 0);
  371|  14.6k|  if(uc) {
  ------------------
  |  Branch (371:6): [True: 25, False: 14.6k]
  ------------------
  372|     25|    if((uc == CURLUE_NO_HOST) && (pp.scheme->flags & PROTOPT_NONETWORK))
  ------------------
  |  |  215|     25|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (372:8): [True: 25, False: 0]
  |  Branch (372:34): [True: 25, False: 0]
  ------------------
  373|     25|      ; /* acceptable */
  374|      0|    else {
  375|      0|      result = CURLE_OUT_OF_MEMORY;
  376|      0|      goto out;
  377|      0|    }
  378|     25|  }
  379|  14.6k|  else if(strlen(up->hostname) > MAX_URL_LEN) {
  ------------------
  |  |   29|  14.6k|#define MAX_URL_LEN 0xffff
  ------------------
  |  Branch (379:11): [True: 1, False: 14.6k]
  ------------------
  380|      1|    failf(data, "Too long hostname (maximum is %d)", MAX_URL_LEN);
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
                  failf(data, "Too long hostname (maximum is %d)", MAX_URL_LEN);
  ------------------
  |  |   29|      1|#define MAX_URL_LEN 0xffff
  ------------------
  381|      1|    result = CURLE_URL_MALFORMAT;
  382|      1|    goto out;
  383|      1|  }
  384|       |
  385|  14.6k|  pp.host_user.str = up->hostname ? up->hostname : "";
  ------------------
  |  Branch (385:22): [True: 14.6k, False: 25]
  ------------------
  386|  14.6k|  pp.host_user.len = strlen(pp.host_user.str);
  387|  14.6k|  if(pp.host_user.len) {
  ------------------
  |  Branch (387:6): [True: 14.6k, False: 25]
  ------------------
  388|  14.6k|    result = peer_parse_host(data, &pp, FALSE);
  ------------------
  |  | 1058|  14.6k|#define FALSE false
  ------------------
  389|  14.6k|    if(result)
  ------------------
  |  Branch (389:8): [True: 122, False: 14.5k]
  ------------------
  390|    122|      goto out;
  391|  14.6k|  }
  392|     25|  else
  393|     25|    pp.host = pp.host_user;
  394|       |
  395|  14.5k|  curlx_safefree(up->port);
  ------------------
  |  | 1327|  14.5k|  do {                      \
  |  | 1328|  14.5k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  14.5k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  14.5k|    (ptr) = NULL;           \
  |  | 1330|  14.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 14.5k]
  |  |  ------------------
  ------------------
  396|  14.5k|  if(port_override) {
  ------------------
  |  Branch (396:6): [True: 46, False: 14.5k]
  ------------------
  397|       |    /* if set, we use this instead of the port possibly given in the URL */
  398|     46|    char portbuf[16];
  399|     46|    curl_msnprintf(portbuf, sizeof(portbuf), "%d", port_override);
  400|     46|    uc = curl_url_set(uh, CURLUPART_PORT, portbuf, 0);
  401|     46|    if(uc) {
  ------------------
  |  Branch (401:8): [True: 0, False: 46]
  ------------------
  402|      0|      result = CURLE_OUT_OF_MEMORY;
  403|      0|      goto out;
  404|      0|    }
  405|     46|    else
  406|     46|      pp.port = port_override;
  407|     46|  }
  408|  14.5k|  else {
  409|  14.5k|    uc = curl_url_get(uh, CURLUPART_PORT, &up->port, CURLU_DEFAULT_PORT);
  ------------------
  |  |   84|  14.5k|#define CURLU_DEFAULT_PORT (1 << 0)       /* return default port number */
  ------------------
  410|  14.5k|    if(uc) {
  ------------------
  |  Branch (410:8): [True: 0, False: 14.5k]
  ------------------
  411|      0|      if(uc == CURLUE_OUT_OF_MEMORY) {
  ------------------
  |  Branch (411:10): [True: 0, False: 0]
  ------------------
  412|      0|        result = CURLE_OUT_OF_MEMORY;
  413|      0|        goto out;
  414|      0|      }
  415|      0|      else if(!(pp.scheme->flags & PROTOPT_NONETWORK)) {
  ------------------
  |  |  215|      0|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (415:15): [True: 0, False: 0]
  ------------------
  416|      0|        result = CURLE_URL_MALFORMAT;
  417|      0|        goto out;
  418|      0|      }
  419|       |      /* no port ok when not a network scheme */
  420|      0|    }
  421|  14.5k|    else {
  422|  14.5k|      const char *p = up->port;
  423|  14.5k|      curl_off_t offt;
  424|  14.5k|      if(curlx_str_number(&p, &offt, 0xffff))
  ------------------
  |  Branch (424:10): [True: 0, False: 14.5k]
  ------------------
  425|      0|        return CURLE_URL_MALFORMAT;
  426|  14.5k|      pp.port = (uint16_t)offt;
  427|  14.5k|    }
  428|  14.5k|  }
  429|       |
  430|  14.5k|  if(scopeid_override)
  ------------------
  |  Branch (430:6): [True: 433, False: 14.1k]
  ------------------
  431|       |    /* Override any scope id from an url zone. */
  432|    433|    pp.scopeid = scopeid_override;
  433|  14.1k|  else {
  434|  14.1k|    if(curl_url_get(uh, CURLUPART_ZONEID, &zoneid, 0) ==
  ------------------
  |  Branch (434:8): [True: 0, False: 14.1k]
  ------------------
  435|  14.1k|       CURLUE_OUT_OF_MEMORY) {
  436|      0|      result = CURLE_OUT_OF_MEMORY;
  437|      0|      goto out;
  438|      0|    }
  439|  14.1k|    if(zoneid) {
  ------------------
  |  Branch (439:8): [True: 39, False: 14.0k]
  ------------------
  440|     39|      pp.zoneid.str = zoneid;
  441|     39|      pp.zoneid.len = strlen(zoneid);
  442|     39|    }
  443|  14.1k|  }
  444|       |
  445|  14.5k|  result = peer_create(&pp, ppeer);
  446|  14.5k|  if(result)
  ------------------
  |  Branch (446:6): [True: 0, False: 14.5k]
  ------------------
  447|      0|    failf(data, "Error %d creating peer for %s:%u",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  448|      0|          result, pp.host_user.str, pp.port);
  449|       |
  450|  14.7k|out:
  451|  14.7k|  peer_parse_clear(&pp);
  452|  14.7k|  curlx_free(zoneid);
  ------------------
  |  | 1483|  14.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  453|  14.7k|  return result;
  454|  14.5k|}
Curl_peer_from_connect_to:
  462|  13.4k|{
  463|  13.4k|  struct peer_parse pp;
  464|  13.4k|  const char *portstr = NULL;
  465|  13.4k|  CURLcode result;
  466|       |
  467|  13.4k|  Curl_peer_unlink(ppeer);
  468|  13.4k|  memset(&pp, 0, sizeof(pp));
  469|  13.4k|  if(!connect_to || !*connect_to)
  ------------------
  |  Branch (469:6): [True: 0, False: 13.4k]
  |  Branch (469:21): [True: 0, False: 13.4k]
  ------------------
  470|      0|    return CURLE_FAILED_INIT;
  471|       |
  472|  13.4k|  pp.scheme = dest->scheme;
  473|       |
  474|       |  /* detect and extract RFC6874-style IPv6-addresses */
  475|  13.4k|  if(connect_to[0] == '[') {
  ------------------
  |  Branch (475:6): [True: 0, False: 13.4k]
  ------------------
  476|      0|    const char *s = strchr(connect_to + 1, ']');
  477|      0|    if(!s) {
  ------------------
  |  Branch (477:8): [True: 0, False: 0]
  ------------------
  478|      0|      failf(data, "Invalid IPv6 address format in '%s'", connect_to);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  479|      0|      result = CURLE_SETOPT_OPTION_SYNTAX;
  480|      0|      goto out;
  481|      0|    }
  482|      0|    portstr = strchr(s, ':');
  483|      0|    pp.host_user.str = connect_to;
  484|      0|    pp.host_user.len = s - pp.host_user.str + 1;
  485|      0|    pp.ipv6 = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  486|      0|  }
  487|  13.4k|  else {
  488|  13.4k|    portstr = strchr(connect_to, ':');
  489|  13.4k|    pp.host_user.str = connect_to;
  490|  13.4k|    pp.host_user.len = portstr ?
  ------------------
  |  Branch (490:24): [True: 13.4k, False: 0]
  ------------------
  491|  13.4k|      (size_t)(portstr - connect_to) : strlen(connect_to);
  492|  13.4k|  }
  493|       |
  494|  13.4k|  if(!pp.host_user.len) { /* no hostname found, only port switch */
  ------------------
  |  Branch (494:6): [True: 0, False: 13.4k]
  ------------------
  495|      0|    pp.host_user.str = dest->user_hostname;
  496|      0|    pp.host_user.len = strlen(dest->user_hostname);
  497|      0|  }
  498|       |
  499|  13.4k|  result = peer_parse_host(data, &pp, FALSE);
  ------------------
  |  | 1058|  13.4k|#define FALSE false
  ------------------
  500|  13.4k|  if(result)
  ------------------
  |  Branch (500:6): [True: 0, False: 13.4k]
  ------------------
  501|      0|    goto out;
  502|       |
  503|  13.4k|  if(portstr && portstr[1]) {
  ------------------
  |  Branch (503:6): [True: 13.4k, False: 0]
  |  Branch (503:17): [True: 0, False: 13.4k]
  ------------------
  504|      0|    const char *p = portstr + 1;
  505|      0|    curl_off_t portparse;
  506|      0|    if(curlx_str_number(&p, &portparse, 0xffff)) {
  ------------------
  |  Branch (506:8): [True: 0, False: 0]
  ------------------
  507|      0|      failf(data, "No valid port number in '%s'", connect_to);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  508|      0|      result = CURLE_SETOPT_OPTION_SYNTAX;
  509|      0|      goto out;
  510|      0|    }
  511|      0|    pp.port = (uint16_t)portparse; /* we know it will fit */
  512|      0|  }
  513|  13.4k|  else
  514|  13.4k|    pp.port = dest->port;
  515|       |
  516|       |#ifndef USE_IPV6
  517|       |  if(pp.ipv6) {
  518|       |    failf(data, "Use of IPv6 in *_CONNECT_TO without IPv6 support built-in");
  519|       |    result = CURLE_NOT_BUILT_IN;
  520|       |    goto out;
  521|       |  }
  522|       |#endif
  523|       |
  524|  13.4k|  result = peer_create(&pp, ppeer);
  525|  13.4k|  CURL_TRC_M(data, "connect-to peer_create2 -> %d", result);
  ------------------
  |  |  148|  13.4k|  do {                                   \
  |  |  149|  13.4k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  13.4k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  13.4k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  26.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 13.4k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 13.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  26.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  13.4k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  13.4k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  13.4k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 13.4k]
  |  |  ------------------
  ------------------
  526|       |
  527|  13.4k|out:
  528|  13.4k|  CURL_TRC_M(data, "parse connect_to peer: %s -> %d", connect_to, result);
  ------------------
  |  |  148|  13.4k|  do {                                   \
  |  |  149|  13.4k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  13.4k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  13.4k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  26.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 13.4k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 13.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  26.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  13.4k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  13.4k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  13.4k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 13.4k]
  |  |  ------------------
  ------------------
  529|  13.4k|  peer_parse_clear(&pp);
  530|  13.4k|  return result;
  531|  13.4k|}
Curl_scheme_to_proxytype:
  542|      7|{
  543|      7|  if(!scheme)
  ------------------
  |  Branch (543:6): [True: 0, False: 7]
  ------------------
  544|      0|    return CURLE_OK;
  545|       |
  546|      7|  if(curl_strequal("https", scheme)) {
  ------------------
  |  Branch (546:6): [True: 2, False: 5]
  ------------------
  547|      2|    if(*proxytype != CURLPROXY_HTTPS2 && *proxytype != CURLPROXY_HTTPS3)
  ------------------
  |  |  796|      4|#define CURLPROXY_HTTPS2          3L /* HTTPS and attempt HTTP/2
  ------------------
                  if(*proxytype != CURLPROXY_HTTPS2 && *proxytype != CURLPROXY_HTTPS3)
  ------------------
  |  |  805|      2|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  ------------------
  |  Branch (547:8): [True: 2, False: 0]
  |  Branch (547:42): [True: 2, False: 0]
  ------------------
  548|      2|      *proxytype = CURLPROXY_HTTPS;
  ------------------
  |  |  794|      2|#define CURLPROXY_HTTPS           2L /* HTTPS but stick to HTTP/1
  ------------------
  549|      2|  }
  550|      5|  else if(curl_strequal("socks5h", scheme))
  ------------------
  |  Branch (550:11): [True: 0, False: 5]
  ------------------
  551|      0|    *proxytype = CURLPROXY_SOCKS5_HOSTNAME;
  ------------------
  |  |  802|      0|#define CURLPROXY_SOCKS5_HOSTNAME 7L /* Use the SOCKS5 protocol but pass along
  ------------------
  552|      5|  else if(curl_strequal("socks5", scheme))
  ------------------
  |  Branch (552:11): [True: 0, False: 5]
  ------------------
  553|      0|    *proxytype = CURLPROXY_SOCKS5;
  ------------------
  |  |  800|      0|#define CURLPROXY_SOCKS5          5L /* added in 7.10 */
  ------------------
  554|      5|  else if(curl_strequal("socks4a", scheme))
  ------------------
  |  Branch (554:11): [True: 0, False: 5]
  ------------------
  555|      0|    *proxytype = CURLPROXY_SOCKS4A;
  ------------------
  |  |  801|      0|#define CURLPROXY_SOCKS4A         6L /* added in 7.18.0 */
  ------------------
  556|      5|  else if(curl_strequal("socks4", scheme) || curl_strequal("socks", scheme))
  ------------------
  |  Branch (556:11): [True: 0, False: 5]
  |  Branch (556:46): [True: 0, False: 5]
  ------------------
  557|      0|    *proxytype = CURLPROXY_SOCKS4;
  ------------------
  |  |  798|      0|#define CURLPROXY_SOCKS4          4L /* support added in 7.15.2, enum existed
  ------------------
  558|      5|  else if(curl_strequal("http", scheme)) {
  ------------------
  |  Branch (558:11): [True: 2, False: 3]
  ------------------
  559|      2|    if(*proxytype != CURLPROXY_HTTP_1_0)
  ------------------
  |  |  792|      2|#define CURLPROXY_HTTP_1_0        1L /* force to use CONNECT HTTP/1.0
  ------------------
  |  Branch (559:8): [True: 2, False: 0]
  ------------------
  560|      2|      *proxytype = CURLPROXY_HTTP;
  ------------------
  |  |  790|      2|#define CURLPROXY_HTTP            0L /* added in 7.10, new in 7.19.4 default is
  ------------------
  561|      2|  }
  562|      3|  else {
  563|       |    /* Any other xxx:// reject! */
  564|      3|    failf(data, "Unsupported proxy scheme for \'%s\'", url);
  ------------------
  |  |   62|      3|#define failf Curl_failf
  ------------------
  565|      3|    return CURLE_COULDNT_CONNECT;
  566|      3|  }
  567|      4|  return CURLE_OK;
  568|      7|}
Curl_peer_from_proxy_url:
  576|  9.17k|{
  577|  9.17k|  struct peer_parse pp;
  578|  9.17k|  char *scheme = NULL;
  579|  9.17k|  char *portptr = NULL;
  580|  9.17k|#ifdef USE_UNIX_SOCKETS
  581|  9.17k|  bool is_socks = FALSE;
  ------------------
  |  | 1058|  9.17k|#define FALSE false
  ------------------
  582|  9.17k|#endif
  583|  9.17k|  CURLUcode uc;
  584|  9.17k|  CURLcode result = CURLE_OK;
  585|       |
  586|  9.17k|  Curl_peer_unlink(ppeer);
  587|  9.17k|  memset(&pp, 0, sizeof(pp));
  588|  9.17k|  pp.port = CURL_DEFAULT_PROXY_PORT;
  ------------------
  |  |   70|  9.17k|#define CURL_DEFAULT_PROXY_PORT 1080 /* default proxy port unless specified */
  ------------------
  589|  9.17k|  uc = curl_url_get(uh, CURLUPART_SCHEME, &scheme,
  590|  9.17k|                    CURLU_NON_SUPPORT_SCHEME | CURLU_NO_GUESS_SCHEME);
  ------------------
  |  |   90|  9.17k|#define CURLU_NON_SUPPORT_SCHEME (1 << 3) /* allow non-supported scheme */
  ------------------
                                  CURLU_NON_SUPPORT_SCHEME | CURLU_NO_GUESS_SCHEME);
  ------------------
  |  |  105|  9.17k|#define CURLU_NO_GUESS_SCHEME (1 << 15)   /* for get, do not accept a guess */
  ------------------
  591|  9.17k|  if(uc) {
  ------------------
  |  Branch (591:6): [True: 9.17k, False: 2]
  ------------------
  592|  9.17k|    if(uc == CURLUE_OUT_OF_MEMORY) {
  ------------------
  |  Branch (592:8): [True: 0, False: 9.17k]
  ------------------
  593|      0|      result = CURLE_OUT_OF_MEMORY;
  594|      0|      goto out;
  595|      0|    }
  596|       |    /* url came without scheme, the passed `proxytype` determines it */
  597|  9.17k|    switch(proxytype) {
  598|  8.32k|    case CURLPROXY_HTTP:
  ------------------
  |  |  790|  8.32k|#define CURLPROXY_HTTP            0L /* added in 7.10, new in 7.19.4 default is
  ------------------
  |  Branch (598:5): [True: 8.32k, False: 848]
  ------------------
  599|  8.32k|    case CURLPROXY_HTTP_1_0:
  ------------------
  |  |  792|  8.32k|#define CURLPROXY_HTTP_1_0        1L /* force to use CONNECT HTTP/1.0
  ------------------
  |  Branch (599:5): [True: 3, False: 9.17k]
  ------------------
  600|  8.32k|      pp.scheme = &Curl_scheme_http;
  601|  8.32k|      break;
  602|     35|    case CURLPROXY_HTTPS:
  ------------------
  |  |  794|     35|#define CURLPROXY_HTTPS           2L /* HTTPS but stick to HTTP/1
  ------------------
  |  Branch (602:5): [True: 35, False: 9.13k]
  ------------------
  603|    417|    case CURLPROXY_HTTPS2:
  ------------------
  |  |  796|    417|#define CURLPROXY_HTTPS2          3L /* HTTPS and attempt HTTP/2
  ------------------
  |  Branch (603:5): [True: 382, False: 8.79k]
  ------------------
  604|    417|    case CURLPROXY_HTTPS3:
  ------------------
  |  |  805|    417|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  ------------------
  |  Branch (604:5): [True: 0, False: 9.17k]
  ------------------
  605|    417|      pp.scheme = &Curl_scheme_https;
  606|    417|      break;
  607|    379|    case CURLPROXY_SOCKS4:
  ------------------
  |  |  798|    379|#define CURLPROXY_SOCKS4          4L /* support added in 7.15.2, enum existed
  ------------------
  |  Branch (607:5): [True: 379, False: 8.79k]
  ------------------
  608|    379|      pp.scheme = &Curl_scheme_socks4;
  609|    379|      break;
  610|      5|    case CURLPROXY_SOCKS4A:
  ------------------
  |  |  801|      5|#define CURLPROXY_SOCKS4A         6L /* added in 7.18.0 */
  ------------------
  |  Branch (610:5): [True: 5, False: 9.16k]
  ------------------
  611|      5|      pp.scheme = &Curl_scheme_socks4a;
  612|      5|      break;
  613|     18|    case CURLPROXY_SOCKS5:
  ------------------
  |  |  800|     18|#define CURLPROXY_SOCKS5          5L /* added in 7.10 */
  ------------------
  |  Branch (613:5): [True: 18, False: 9.15k]
  ------------------
  614|     18|      pp.scheme = &Curl_scheme_socks5;
  615|     18|      break;
  616|     26|    case CURLPROXY_SOCKS5_HOSTNAME:
  ------------------
  |  |  802|     26|#define CURLPROXY_SOCKS5_HOSTNAME 7L /* Use the SOCKS5 protocol but pass along
  ------------------
  |  Branch (616:5): [True: 26, False: 9.14k]
  ------------------
  617|     26|      pp.scheme = &Curl_scheme_socks5h;
  618|     26|      break;
  619|      0|    default:
  ------------------
  |  Branch (619:5): [True: 0, False: 9.17k]
  ------------------
  620|      0|      failf(data, "Unsupported proxy type %u for \'%s\'", proxytype, url);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  621|      0|      result = CURLE_COULDNT_RESOLVE_PROXY;
  622|      0|      goto out;
  623|  9.17k|    }
  624|  9.17k|  }
  625|      2|  else {
  626|      2|    pp.scheme = Curl_get_scheme(scheme);
  627|      2|    result = Curl_scheme_to_proxytype(data, scheme, &proxytype, url);
  628|      2|    if(result)
  ------------------
  |  Branch (628:8): [True: 0, False: 2]
  ------------------
  629|      0|      goto out;
  630|      2|  }
  631|  9.17k|  DEBUGASSERT(pp.scheme);
  ------------------
  |  | 1081|  9.17k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (631:3): [True: 0, False: 9.17k]
  |  Branch (631:3): [True: 9.17k, False: 0]
  ------------------
  632|       |
  633|  9.17k|  if(IS_HTTPS_PROXY(proxytype) &&
  ------------------
  |  |   80|  18.3k|  (((t) == CURLPROXY_HTTPS) ||  \
  |  |  ------------------
  |  |  |  |  794|  9.17k|#define CURLPROXY_HTTPS           2L /* HTTPS but stick to HTTP/1
  |  |  ------------------
  |  |  |  Branch (80:4): [True: 36, False: 9.14k]
  |  |  ------------------
  |  |   81|  9.17k|   ((t) == CURLPROXY_HTTPS2) || \
  |  |  ------------------
  |  |  |  |  796|  9.14k|#define CURLPROXY_HTTPS2          3L /* HTTPS and attempt HTTP/2
  |  |  ------------------
  |  |  |  Branch (81:4): [True: 382, False: 8.75k]
  |  |  ------------------
  |  |   82|  18.3k|   ((t) == CURLPROXY_HTTPS3))
  |  |  ------------------
  |  |  |  |  805|  8.75k|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  |  |  ------------------
  |  |  |  Branch (82:4): [True: 0, False: 8.75k]
  |  |  ------------------
  ------------------
  634|    418|     !Curl_ssl_supports(data, SSLSUPP_HTTPS_PROXY)) {
  ------------------
  |  |   39|    418|#define SSLSUPP_HTTPS_PROXY  (1 << 4) /* supports access via HTTPS proxies */
  ------------------
  |  Branch (634:6): [True: 0, False: 418]
  ------------------
  635|      0|    failf(data, "Unsupported proxy \'%s\', libcurl is built without the "
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  636|      0|          "HTTPS-proxy support.", url);
  637|      0|    result = CURLE_NOT_BUILT_IN;
  638|      0|    goto out;
  639|      0|  }
  640|       |
  641|  9.17k|  switch(pp.scheme->family) {
  642|    428|  case CURLPROTO_SOCKS:
  ------------------
  |  |   66|    428|#define CURLPROTO_SOCKS  (1LL << 33)
  ------------------
  |  Branch (642:3): [True: 428, False: 8.74k]
  ------------------
  643|    428|#ifdef USE_UNIX_SOCKETS
  644|    428|    is_socks = TRUE;
  ------------------
  |  | 1055|    428|#define TRUE true
  ------------------
  645|    428|#endif
  646|    428|    break;
  647|  8.74k|  case CURLPROTO_HTTP:
  ------------------
  |  | 1078|  8.74k|#define CURLPROTO_HTTP    (1L << 0)
  ------------------
  |  Branch (647:3): [True: 8.74k, False: 428]
  ------------------
  648|  8.74k|    break;
  649|      0|  default:
  ------------------
  |  Branch (649:3): [True: 0, False: 9.17k]
  ------------------
  650|      0|    failf(data, "Unsupported proxy protocol for \'%s\'", url);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  651|      0|    result = CURLE_COULDNT_CONNECT;
  652|      0|    goto out;
  653|  9.17k|  }
  654|       |
  655|  9.17k|  uc = curl_url_get(uh, CURLUPART_PORT, &portptr, CURLU_NO_DEFAULT_PORT);
  ------------------
  |  |   85|  9.17k|#define CURLU_NO_DEFAULT_PORT (1 << 1)    /* act as if no port number was set,
  ------------------
  656|  9.17k|  if(uc == CURLUE_OUT_OF_MEMORY) {
  ------------------
  |  Branch (656:6): [True: 0, False: 9.17k]
  ------------------
  657|      0|    result = CURLE_OUT_OF_MEMORY;
  658|      0|    goto out;
  659|      0|  }
  660|  9.17k|  if(portptr) {
  ------------------
  |  Branch (660:6): [True: 70, False: 9.10k]
  ------------------
  661|     70|    curl_off_t num;
  662|     70|    const char *p = portptr;
  663|     70|    if(!curlx_str_number(&p, &num, UINT16_MAX))
  ------------------
  |  Branch (663:8): [True: 70, False: 0]
  ------------------
  664|     70|      pp.port = (uint16_t)num;
  665|       |    /* Should we not error out when the port number is invalid? */
  666|     70|    curlx_free(portptr);
  ------------------
  |  | 1483|     70|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  667|     70|  }
  668|  9.10k|  else {
  669|       |    /* No port in url, take the set one or the scheme's default */
  670|  9.10k|    if(data->set.proxyport)
  ------------------
  |  Branch (670:8): [True: 34, False: 9.07k]
  ------------------
  671|     34|      pp.port = data->set.proxyport;
  672|  9.07k|    else
  673|  9.07k|      pp.port = pp.scheme->defport;
  674|  9.10k|  }
  675|       |
  676|       |  /* now, clone the proxy hostname */
  677|  9.17k|  uc = curl_url_get(uh, CURLUPART_HOST, &pp.tmp_host_user, CURLU_URLDECODE);
  ------------------
  |  |   93|  9.17k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  ------------------
  678|  9.17k|  if(uc) {
  ------------------
  |  Branch (678:6): [True: 0, False: 9.17k]
  ------------------
  679|      0|    result = CURLE_OUT_OF_MEMORY;
  680|      0|    goto out;
  681|      0|  }
  682|  9.17k|  pp.host_user.str = pp.tmp_host_user;
  683|  9.17k|  pp.host_user.len = strlen(pp.tmp_host_user);
  684|       |
  685|  9.17k|#ifdef USE_UNIX_SOCKETS
  686|  9.17k|  if(is_socks && curl_strequal(UNIX_SOCKET_PREFIX, pp.tmp_host_user)) {
  ------------------
  |  |  536|    428|#define UNIX_SOCKET_PREFIX "localhost"
  ------------------
  |  Branch (686:6): [True: 428, False: 8.74k]
  |  Branch (686:18): [True: 4, False: 424]
  ------------------
  687|      4|    uc = curl_url_get(uh, CURLUPART_PATH, &pp.tmp_host, CURLU_URLDECODE);
  ------------------
  |  |   93|      4|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  ------------------
  688|      4|    if(uc) {
  ------------------
  |  Branch (688:8): [True: 0, False: 4]
  ------------------
  689|      0|      result = CURLE_OUT_OF_MEMORY;
  690|      0|      goto out;
  691|      0|    }
  692|       |    /* path will be "/", if no path was found */
  693|      4|    if(strcmp("/", pp.tmp_host)) {
  ------------------
  |  Branch (693:8): [True: 1, False: 3]
  ------------------
  694|      1|      pp.host.str = pp.tmp_host;
  695|      1|      pp.host.len = strlen(pp.tmp_host);
  696|      1|      pp.unix_socket = TRUE;
  ------------------
  |  | 1055|      1|#define TRUE true
  ------------------
  697|      1|    }
  698|      3|    else {
  699|      3|      pp.host = pp.host_user;
  700|      3|    }
  701|      4|  }
  702|  9.17k|#endif /* USE_UNIX_SOCKETS */
  703|       |
  704|  9.17k|  if(!pp.host.len) {
  ------------------
  |  Branch (704:6): [True: 9.17k, False: 4]
  ------------------
  705|  9.17k|    result = peer_parse_host(data, &pp, FALSE);
  ------------------
  |  | 1058|  9.17k|#define FALSE false
  ------------------
  706|  9.17k|    if(result)
  ------------------
  |  Branch (706:8): [True: 2, False: 9.17k]
  ------------------
  707|      2|      goto out;
  708|  9.17k|  }
  709|       |
  710|  9.17k|  uc = curl_url_get(uh, CURLUPART_ZONEID, &pp.tmp_zoneid, 0);
  711|  9.17k|  if(uc == CURLUE_OUT_OF_MEMORY) {
  ------------------
  |  Branch (711:6): [True: 0, False: 9.17k]
  ------------------
  712|      0|    result = CURLE_OUT_OF_MEMORY;
  713|      0|    goto out;
  714|      0|  }
  715|  9.17k|  if(pp.tmp_zoneid) {
  ------------------
  |  Branch (715:6): [True: 73, False: 9.10k]
  ------------------
  716|     73|    pp.zoneid.str = pp.tmp_zoneid;
  717|     73|    pp.zoneid.len = strlen(pp.tmp_zoneid);
  718|     73|  }
  719|       |
  720|  9.17k|  *pproxytype = proxytype;
  721|  9.17k|  result = peer_create(&pp, ppeer);
  722|       |
  723|  9.17k|out:
  724|  9.17k|  peer_parse_clear(&pp);
  725|  9.17k|  curlx_free(scheme);
  ------------------
  |  | 1483|  9.17k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  726|  9.17k|#ifdef DEBUGBUILD
  727|  9.17k|  if(!result)
  ------------------
  |  Branch (727:6): [True: 9.17k, False: 2]
  ------------------
  728|  9.17k|    DEBUGASSERT(*ppeer);
  ------------------
  |  | 1081|  9.17k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (728:5): [True: 0, False: 9.17k]
  |  Branch (728:5): [True: 9.17k, False: 0]
  ------------------
  729|  9.17k|#endif
  730|  9.17k|  return result;
  731|  9.17k|}
peer.c:peer_parse_host:
  185|  39.2k|{
  186|  39.2k|  if(!pp || !pp->host_user.str || !pp->host_user.len)
  ------------------
  |  Branch (186:6): [True: 0, False: 39.2k]
  |  Branch (186:13): [True: 0, False: 39.2k]
  |  Branch (186:35): [True: 0, False: 39.2k]
  ------------------
  187|      0|    return CURLE_FAILED_INIT;
  188|       |
  189|  39.2k|  if(pp->host_user.str[0] == '[') {
  ------------------
  |  Branch (189:6): [True: 149, False: 39.0k]
  ------------------
  190|    149|    const char *s = pp->host_user.str + 1;
  191|    149|    struct Curl_str tmp;
  192|    149|    if(curlx_str_until(&s, &tmp, pp->host_user.len - 1, ']'))
  ------------------
  |  Branch (192:8): [True: 1, False: 148]
  ------------------
  193|      1|      return CURLE_URL_MALFORMAT;
  194|       |
  195|    148|    if(!Curl_looks_like_ipv6(tmp.str, tmp.len, TRUE,
  ------------------
  |  | 1055|    148|#define TRUE true
  ------------------
  |  Branch (195:8): [True: 1, False: 147]
  ------------------
  196|    148|                             &pp->host, &pp->zoneid)) {
  197|      1|      failf(data, "Invalid IPv6 address format in '%.*s'",
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  198|      1|            (int)pp->host_user.len, pp->host_user.str);
  199|      1|      return CURLE_URL_MALFORMAT;
  200|      1|    }
  201|    147|    pp->ipv6 = TRUE;
  ------------------
  |  | 1055|    147|#define TRUE true
  ------------------
  202|    147|  }
  203|  39.0k|  else {
  204|  39.0k|#ifdef USE_IDN
  205|  39.0k|    if(!Curl_is_ASCII_str(&pp->host_user)) {
  ------------------
  |  Branch (205:8): [True: 127, False: 38.9k]
  ------------------
  206|    127|      CURLcode result;
  207|    127|      if(!pp->tmp_host_user) {
  ------------------
  |  Branch (207:10): [True: 125, False: 2]
  ------------------
  208|       |        /* need a null-terminated string for IDN */
  209|    125|        pp->tmp_host_user = curlx_memdup0(pp->host_user.str,
  210|    125|                                          pp->host_user.len);
  211|    125|        if(!pp->tmp_host_user)
  ------------------
  |  Branch (211:12): [True: 0, False: 125]
  ------------------
  212|      0|          return CURLE_OUT_OF_MEMORY;
  213|    125|      }
  214|    127|      result = Curl_idn_decode(pp->tmp_host_user, &pp->tmp_host);
  215|    127|      if(result)
  ------------------
  |  Branch (215:10): [True: 127, False: 0]
  ------------------
  216|    127|        return result;
  217|      0|      pp->host.str = pp->tmp_host;
  218|      0|      pp->host.len = strlen(pp->host.str);
  219|      0|    }
  220|  38.9k|    else
  221|  38.9k|#endif
  222|  38.9k|    if(scan_for_ipv6 &&
  ------------------
  |  Branch (222:8): [True: 1.93k, False: 37.0k]
  ------------------
  223|  1.93k|       Curl_looks_like_ipv6(pp->host_user.str, pp->host_user.len, TRUE,
  ------------------
  |  | 1055|  1.93k|#define TRUE true
  ------------------
  |  Branch (223:8): [True: 1.83k, False: 103]
  ------------------
  224|  1.93k|                            &pp->host, &pp->zoneid)) {
  225|  1.83k|      pp->ipv6 = TRUE;
  ------------------
  |  | 1055|  1.83k|#define TRUE true
  ------------------
  226|  1.83k|    }
  227|  37.1k|    else
  228|  37.1k|      pp->host = pp->host_user;
  229|  39.0k|  }
  230|  39.0k|  return CURLE_OK;
  231|  39.2k|}
peer.c:peer_create:
  104|  39.2k|{
  105|  39.2k|  struct Curl_peer *peer = NULL;
  106|  39.2k|  CURLcode result = CURLE_OK;
  107|  39.2k|  size_t zone_alen = 0, host_alen = 0;
  108|       |
  109|  39.2k|  if(!pp || !pp->scheme)
  ------------------
  |  Branch (109:6): [True: 0, False: 39.2k]
  |  Branch (109:13): [True: 0, False: 39.2k]
  ------------------
  110|      0|    return CURLE_FAILED_INIT;
  111|  39.2k|  if(!pp->host.len && !(pp->scheme->flags & PROTOPT_NONETWORK))
  ------------------
  |  |  215|     41|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (111:6): [True: 41, False: 39.1k]
  |  Branch (111:23): [True: 16, False: 25]
  ------------------
  112|     16|    return CURLE_FAILED_INIT;
  113|       |
  114|  39.2k|  if((pp->host.str != pp->host_user.str) ||
  ------------------
  |  Branch (114:6): [True: 148, False: 39.0k]
  ------------------
  115|  39.0k|     (pp->host.len != pp->host_user.len)) {
  ------------------
  |  Branch (115:6): [True: 8, False: 39.0k]
  ------------------
  116|    156|    host_alen = pp->host.len + 1;
  117|    156|  }
  118|  39.2k|  zone_alen = pp->zoneid.len ? (pp->zoneid.len + 1) : 0;
  ------------------
  |  Branch (118:15): [True: 118, False: 39.1k]
  ------------------
  119|       |
  120|       |  /* null-terminator already part of struct */
  121|  39.2k|  peer = curlx_calloc(1, sizeof(*peer) +
  ------------------
  |  | 1480|  39.2k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  122|  39.2k|                         pp->host_user.len + host_alen + zone_alen);
  123|  39.2k|  if(!peer) {
  ------------------
  |  Branch (123:6): [True: 0, False: 39.2k]
  ------------------
  124|      0|    result = CURLE_OUT_OF_MEMORY;
  125|      0|    goto out;
  126|      0|  }
  127|       |
  128|  39.2k|  peer->refcount = 1;
  129|  39.2k|  peer->scheme = pp->scheme;
  130|  39.2k|  peer->hostname = peer->user_hostname;
  131|  39.2k|  peer->port = pp->port;
  132|  39.2k|  peer->scopeid = pp->scopeid;
  133|  39.2k|  peer->ipv6 = pp->ipv6;
  134|  39.2k|  peer->unix_socket = pp->unix_socket;
  135|  39.2k|  peer->abstract_uds = pp->abstract_uds;
  136|       |
  137|  39.2k|  if(pp->host_user.len)
  ------------------
  |  Branch (137:6): [True: 39.1k, False: 25]
  ------------------
  138|  39.1k|    memcpy(peer->user_hostname, pp->host_user.str, pp->host_user.len);
  139|       |
  140|  39.2k|  if(host_alen) {
  ------------------
  |  Branch (140:6): [True: 156, False: 39.0k]
  ------------------
  141|    156|    peer->hostname = peer->user_hostname + pp->host_user.len + 1;
  142|    156|    memcpy(peer->hostname, pp->host.str, pp->host.len);
  143|    156|  }
  144|       |
  145|  39.2k|  if(zone_alen) {
  ------------------
  |  Branch (145:6): [True: 118, False: 39.1k]
  ------------------
  146|    118|    peer->zoneid = peer->user_hostname + pp->host_user.len + 1 + host_alen;
  147|    118|    memcpy(peer->zoneid, pp->zoneid.str, pp->zoneid.len);
  148|    118|#ifdef USE_IPV6
  149|       |    /* Determine scope_id if not already provided */
  150|    118|    if(!peer->scopeid) {
  ------------------
  |  Branch (150:8): [True: 118, False: 0]
  ------------------
  151|    118|      const char *p = peer->zoneid;
  152|    118|      curl_off_t scope;
  153|    118|      if(!curlx_str_number(&p, &scope, UINT_MAX)) {
  ------------------
  |  Branch (153:10): [True: 18, False: 100]
  ------------------
  154|       |        /* A plain number, use it directly as a scope id. */
  155|     18|        peer->scopeid = (uint32_t)scope;
  156|     18|      }
  157|    100|#ifdef HAVE_IF_NAMETOINDEX
  158|    100|      else {
  159|       |        /* Zone identifier is not numeric */
  160|    100|        unsigned int idx = 0;
  161|    100|        idx = if_nametoindex(peer->zoneid);
  162|    100|        if(idx) {
  ------------------
  |  Branch (162:12): [True: 3, False: 97]
  ------------------
  163|      3|          peer->scopeid = (uint32_t)idx;
  164|      3|        }
  165|     97|        else {
  166|       |          /* Do we want to return an error here? */
  167|     97|        }
  168|    100|      }
  169|    118|#endif /* HAVE_IF_NAMETOINDEX */
  170|    118|    }
  171|    118|#endif /* USE_IPV6 */
  172|    118|  }
  173|       |
  174|  39.2k|out:
  175|  39.2k|  if(!result)
  ------------------
  |  Branch (175:6): [True: 39.2k, False: 0]
  ------------------
  176|  39.2k|    *ppeer = peer;
  177|      0|  else
  178|      0|    Curl_peer_unlink(&peer);
  179|  39.2k|  return result;
  180|  39.2k|}
peer.c:peer_parse_clear:
   95|  39.3k|{
   96|  39.3k|  curlx_free(pp->tmp_host_user);
  ------------------
  |  | 1483|  39.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   97|  39.3k|  curlx_free(pp->tmp_host);
  ------------------
  |  | 1483|  39.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   98|  39.3k|  curlx_free(pp->tmp_zoneid);
  ------------------
  |  | 1483|  39.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   99|  39.3k|  memset(pp, 0, sizeof(*pp));
  100|  39.3k|}
peer.c:peer_same_hostname:
  322|  15.4k|{
  323|       |  /* UNIX domain socket paths must be compared case-sensitive,
  324|       |   * as many filesystem are like that. */
  325|  15.4k|  return (p1->unix_socket == p2->unix_socket) &&
  ------------------
  |  Branch (325:10): [True: 15.4k, False: 1]
  ------------------
  326|  15.4k|         (p1->abstract_uds == p2->abstract_uds) &&
  ------------------
  |  Branch (326:10): [True: 15.4k, False: 0]
  ------------------
  327|  15.4k|         (p1->ipv6 == p2->ipv6) &&
  ------------------
  |  Branch (327:10): [True: 15.4k, False: 43]
  ------------------
  328|  15.4k|         (p1->unix_socket ?
  ------------------
  |  Branch (328:10): [True: 2.18k, False: 13.2k]
  |  Branch (328:11): [True: 3, False: 15.4k]
  ------------------
  329|      3|          !strcmp(p1->hostname, p2->hostname) :
  330|  15.4k|          curl_strequal(p1->hostname, p2->hostname));
  331|  15.4k|}

Curl_pp_state_timeleft_ms:
   44|  21.5k|{
   45|  21.5k|  timediff_t xfer_remain_ms;
   46|  21.5k|  timediff_t remain_ms = data->set.server_response_timeout ?
  ------------------
  |  Branch (46:26): [True: 21.5k, False: 0]
  ------------------
   47|  21.5k|    data->set.server_response_timeout : PINGPONG_TIMEOUT_MS;
  ------------------
  |  |   75|      0|#define PINGPONG_TIMEOUT_MS      (60 * 1000)
  ------------------
   48|       |
   49|       |  /* If the overall transfer has less time remaining than pingpong
   50|       |   * has otherwise for the state, return that. */
   51|  21.5k|  remain_ms -= curlx_ptimediff_ms(Curl_pgrs_now(data), &pp->response);
   52|       |  /* transfer remaining time is 0, when it has no timeout. */
   53|  21.5k|  xfer_remain_ms = Curl_timeleft_ms(data);
   54|  21.5k|  if(xfer_remain_ms)
  ------------------
  |  Branch (54:6): [True: 21.5k, False: 31]
  ------------------
   55|  21.5k|    return CURLMIN(remain_ms, xfer_remain_ms);
  ------------------
  |  | 1287|  21.5k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 899, False: 20.6k]
  |  |  ------------------
  ------------------
   56|     31|  return remain_ms;
   57|  21.5k|}
Curl_pp_statemach:
   65|  16.8k|{
   66|  16.8k|  struct connectdata *conn = data->conn;
   67|  16.8k|  curl_socket_t sock = conn->sock[FIRSTSOCKET];
  ------------------
  |  |  303|  16.8k|#define FIRSTSOCKET     0
  ------------------
   68|  16.8k|  int rc;
   69|  16.8k|  timediff_t interval_ms;
   70|  16.8k|  timediff_t timeout_ms = Curl_pp_state_timeleft_ms(data, pp);
   71|  16.8k|  CURLcode result = CURLE_OK;
   72|       |
   73|  16.8k|  if(timeout_ms <= 0) {
  ------------------
  |  Branch (73:6): [True: 0, False: 16.8k]
  ------------------
   74|      0|    failf(data, "server response timeout");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
   75|      0|    return CURLE_OPERATION_TIMEDOUT; /* already too little time */
   76|      0|  }
   77|       |
   78|  16.8k|  if(block) {
  ------------------
  |  Branch (78:6): [True: 899, False: 15.9k]
  ------------------
   79|    899|    interval_ms = 1000;  /* use 1 second timeout intervals */
   80|    899|    if(timeout_ms < interval_ms)
  ------------------
  |  Branch (80:8): [True: 0, False: 899]
  ------------------
   81|      0|      interval_ms = timeout_ms;
   82|    899|  }
   83|  15.9k|  else
   84|  15.9k|    interval_ms = 0; /* immediate */
   85|       |
   86|  16.8k|  if(Curl_conn_data_pending(data, FIRSTSOCKET))
  ------------------
  |  |  303|  16.8k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (86:6): [True: 0, False: 16.8k]
  ------------------
   87|      0|    rc = 1;
   88|  16.8k|  else if(pp->overflow)
  ------------------
  |  Branch (88:11): [True: 10.8k, False: 6.06k]
  ------------------
   89|       |    /* We are receiving and there is data in the cache so read it */
   90|  10.8k|    rc = 1;
   91|  6.06k|  else if(!pp->sendleft && Curl_conn_data_pending(data, FIRSTSOCKET))
  ------------------
  |  |  303|  6.06k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (91:11): [True: 6.06k, False: 0]
  |  Branch (91:28): [True: 0, False: 6.06k]
  ------------------
   92|       |    /* We are receiving and there is data ready in the SSL library */
   93|      0|    rc = 1;
   94|  6.06k|  else {
   95|  6.06k|    rc = Curl_socket_check(pp->sendleft ? CURL_SOCKET_BAD : sock, /* reading */
  ------------------
  |  |  145|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (95:28): [True: 0, False: 6.06k]
  ------------------
   96|  6.06k|                           CURL_SOCKET_BAD,
  ------------------
  |  |  145|  6.06k|#define CURL_SOCKET_BAD (-1)
  ------------------
   97|  6.06k|                           pp->sendleft ? sock : CURL_SOCKET_BAD, /* writing */
  ------------------
  |  |  145|  6.06k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (97:28): [True: 0, False: 6.06k]
  ------------------
   98|  6.06k|                           interval_ms);
   99|  6.06k|  }
  100|       |
  101|  16.8k|  if(block) {
  ------------------
  |  Branch (101:6): [True: 899, False: 15.9k]
  ------------------
  102|       |    /* if we did not wait, we do not have to spend time on this now */
  103|    899|    result = Curl_pgrsCheck(data);
  104|    899|    if(result)
  ------------------
  |  Branch (104:8): [True: 0, False: 899]
  ------------------
  105|      0|      return result;
  106|    899|  }
  107|       |
  108|  16.8k|  if(rc == -1) {
  ------------------
  |  Branch (108:6): [True: 0, False: 16.8k]
  ------------------
  109|      0|    failf(data, "select/poll error");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  110|      0|    result = CURLE_OUT_OF_MEMORY;
  111|      0|  }
  112|  16.8k|  else if(rc)
  ------------------
  |  Branch (112:11): [True: 15.9k, False: 930]
  ------------------
  113|  15.9k|    result = pp->statemachine(data, data->conn);
  114|    930|  else if(disconnecting)
  ------------------
  |  Branch (114:11): [True: 26, False: 904]
  ------------------
  115|     26|    return CURLE_OPERATION_TIMEDOUT;
  116|       |
  117|  16.8k|  return result;
  118|  16.8k|}
Curl_pp_init:
  122|  2.13k|{
  123|  2.13k|  DEBUGASSERT(!pp->initialized);
  ------------------
  |  | 1081|  2.13k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (123:3): [True: 0, False: 2.13k]
  |  Branch (123:3): [True: 2.13k, False: 0]
  ------------------
  124|  2.13k|  pp->nread_resp = 0;
  125|  2.13k|  pp->response = *pnow; /* start response time-out */
  126|  2.13k|  pp->pending_resp = TRUE;
  ------------------
  |  | 1055|  2.13k|#define TRUE true
  ------------------
  127|  2.13k|  curlx_dyn_init(&pp->sendbuf, DYN_PINGPPONG_CMD);
  ------------------
  |  |   76|  2.13k|#define DYN_PINGPPONG_CMD   (64 * 1024)
  ------------------
  128|  2.13k|  curlx_dyn_init(&pp->recvbuf, DYN_PINGPPONG_CMD);
  ------------------
  |  |   76|  2.13k|#define DYN_PINGPPONG_CMD   (64 * 1024)
  ------------------
  129|       |  pp->initialized = TRUE;
  ------------------
  |  | 1055|  2.13k|#define TRUE true
  ------------------
  130|  2.13k|}
Curl_pp_vsendf:
  146|  7.47k|{
  147|  7.47k|  size_t bytes_written = 0;
  148|  7.47k|  size_t write_len;
  149|  7.47k|  char *s;
  150|  7.47k|  CURLcode result;
  151|  7.47k|  struct connectdata *conn = data->conn;
  152|       |
  153|  7.47k|  DEBUGASSERT(pp->sendleft == 0);
  ------------------
  |  | 1081|  7.47k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (153:3): [True: 0, False: 7.47k]
  |  Branch (153:3): [True: 7.47k, False: 0]
  ------------------
  154|  7.47k|  DEBUGASSERT(pp->sendsize == 0);
  ------------------
  |  | 1081|  7.47k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (154:3): [True: 0, False: 7.47k]
  |  Branch (154:3): [True: 7.47k, False: 0]
  ------------------
  155|  7.47k|  DEBUGASSERT(pp->sendthis == NULL);
  ------------------
  |  | 1081|  7.47k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (155:3): [True: 0, False: 7.47k]
  |  Branch (155:3): [True: 7.47k, False: 0]
  ------------------
  156|       |
  157|  7.47k|  if(!conn)
  ------------------
  |  Branch (157:6): [True: 0, False: 7.47k]
  ------------------
  158|       |    /* cannot send without a connection! */
  159|      0|    return CURLE_SEND_ERROR;
  160|       |
  161|  7.47k|  curlx_dyn_reset(&pp->sendbuf);
  162|  7.47k|  result = curlx_dyn_vaddf(&pp->sendbuf, fmt, args);
  163|  7.47k|  if(result)
  ------------------
  |  Branch (163:6): [True: 0, False: 7.47k]
  ------------------
  164|      0|    return result;
  165|       |
  166|       |  /* append CRLF */
  167|  7.47k|  result = curlx_dyn_addn(&pp->sendbuf, "\r\n", 2);
  168|  7.47k|  if(result)
  ------------------
  |  Branch (168:6): [True: 0, False: 7.47k]
  ------------------
  169|      0|    return result;
  170|       |
  171|  7.47k|  pp->pending_resp = TRUE;
  ------------------
  |  | 1055|  7.47k|#define TRUE true
  ------------------
  172|  7.47k|  write_len = curlx_dyn_len(&pp->sendbuf);
  173|  7.47k|  s = curlx_dyn_ptr(&pp->sendbuf);
  174|       |
  175|  7.47k|  result = Curl_conn_send(data, FIRSTSOCKET, s, write_len, FALSE,
  ------------------
  |  |  303|  7.47k|#define FIRSTSOCKET     0
  ------------------
                result = Curl_conn_send(data, FIRSTSOCKET, s, write_len, FALSE,
  ------------------
  |  | 1058|  7.47k|#define FALSE false
  ------------------
  176|  7.47k|                          &bytes_written);
  177|  7.47k|  if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (177:6): [True: 0, False: 7.47k]
  ------------------
  178|      0|    bytes_written = 0;
  179|      0|  }
  180|  7.47k|  else if(result)
  ------------------
  |  Branch (180:11): [True: 0, False: 7.47k]
  ------------------
  181|      0|    return result;
  182|       |
  183|  7.47k|  Curl_debug(data, CURLINFO_HEADER_OUT, s, bytes_written);
  184|       |
  185|  7.47k|  if(bytes_written != write_len) {
  ------------------
  |  Branch (185:6): [True: 0, False: 7.47k]
  ------------------
  186|       |    /* the whole chunk was not sent, keep it around and adjust sizes */
  187|      0|    pp->sendthis = s;
  188|      0|    pp->sendsize = write_len;
  189|      0|    pp->sendleft = write_len - bytes_written;
  190|      0|  }
  191|  7.47k|  else {
  192|  7.47k|    pp->sendthis = NULL;
  193|  7.47k|    pp->sendleft = pp->sendsize = 0;
  194|  7.47k|    pp->response = *Curl_pgrs_now(data);
  195|  7.47k|  }
  196|       |
  197|  7.47k|  return CURLE_OK;
  198|  7.47k|}
Curl_pp_sendf:
  212|  7.47k|{
  213|  7.47k|  CURLcode result;
  214|  7.47k|  va_list ap;
  215|  7.47k|  va_start(ap, fmt);
  216|       |
  217|  7.47k|  result = Curl_pp_vsendf(data, pp, fmt, ap);
  218|       |
  219|  7.47k|  va_end(ap);
  220|       |
  221|  7.47k|  return result;
  222|  7.47k|}
Curl_pp_readresp:
  243|  19.7k|{
  244|  19.7k|  struct connectdata *conn = data->conn;
  245|  19.7k|  CURLcode result = CURLE_OK;
  246|  19.7k|  size_t gotbytes;
  247|  19.7k|  char buffer[900];
  248|       |
  249|  19.7k|  *code = 0; /* 0 for errors or not done */
  250|  19.7k|  *size = 0;
  251|       |
  252|  20.6k|  do {
  253|  20.6k|    gotbytes = 0;
  254|  20.6k|    if(pp->nfinal) {
  ------------------
  |  Branch (254:8): [True: 15.9k, False: 4.68k]
  ------------------
  255|       |      /* a previous call left this many bytes in the beginning of the buffer as
  256|       |         that was the final line; now ditch that */
  257|  15.9k|      size_t full = curlx_dyn_len(&pp->recvbuf);
  258|       |
  259|       |      /* trim off the "final" leading part */
  260|  15.9k|      curlx_dyn_tail(&pp->recvbuf, full - pp->nfinal);
  261|       |
  262|  15.9k|      pp->nfinal = 0; /* now gone */
  263|  15.9k|    }
  264|  20.6k|    if(!pp->overflow) {
  ------------------
  |  Branch (264:8): [True: 6.24k, False: 14.4k]
  ------------------
  265|  6.24k|      result = pingpong_read(data, sockindex, buffer, sizeof(buffer),
  266|  6.24k|                             &gotbytes);
  267|  6.24k|      if(result == CURLE_AGAIN)
  ------------------
  |  Branch (267:10): [True: 2, False: 6.24k]
  ------------------
  268|      2|        return CURLE_OK;
  269|       |
  270|  6.24k|      if(result)
  ------------------
  |  Branch (270:10): [True: 0, False: 6.24k]
  ------------------
  271|      0|        return result;
  272|       |
  273|  6.24k|      if(!gotbytes) {
  ------------------
  |  Branch (273:10): [True: 1.52k, False: 4.72k]
  ------------------
  274|  1.52k|        failf(data, "response reading failed (errno: %d)", SOCKERRNO);
  ------------------
  |  |   62|  1.52k|#define failf Curl_failf
  ------------------
                      failf(data, "response reading failed (errno: %d)", SOCKERRNO);
  ------------------
  |  | 1095|  1.52k|#define SOCKERRNO         errno
  ------------------
  275|  1.52k|        return CURLE_RECV_ERROR;
  276|  1.52k|      }
  277|       |
  278|  4.72k|      result = curlx_dyn_addn(&pp->recvbuf, buffer, gotbytes);
  279|  4.72k|      if(result)
  ------------------
  |  Branch (279:10): [True: 2, False: 4.72k]
  ------------------
  280|      2|        return result;
  281|       |
  282|  4.72k|      data->req.headerbytecount += (unsigned int)gotbytes;
  283|       |
  284|  4.72k|      pp->nread_resp += gotbytes;
  285|  4.72k|    }
  286|       |
  287|   836k|    do {
  288|   836k|      const char *line = curlx_dyn_ptr(&pp->recvbuf);
  289|   836k|      const char *nl = memchr(line, '\n', curlx_dyn_len(&pp->recvbuf));
  290|   836k|      if(nl) {
  ------------------
  |  Branch (290:10): [True: 833k, False: 2.68k]
  ------------------
  291|       |        /* a newline is CRLF in pp-talk, so the CR is ignored as
  292|       |           the line is not really terminated until the LF comes */
  293|   833k|        size_t length = nl - line + 1;
  294|       |
  295|       |        /* output debug output if that is requested */
  296|   833k|        Curl_debug(data, CURLINFO_HEADER_IN, line, length);
  297|       |
  298|       |        /*
  299|       |         * Pass all response-lines to the callback function registered for
  300|       |         * "headers". The response lines can be seen as a kind of headers.
  301|       |         */
  302|   833k|        result = Curl_client_write(data, CLIENTWRITE_INFO, line, length);
  ------------------
  |  |   43|   833k|#define CLIENTWRITE_INFO    (1 << 1) /* meta information, not a HEADER */
  ------------------
  303|   833k|        if(result)
  ------------------
  |  Branch (303:12): [True: 0, False: 833k]
  ------------------
  304|      0|          return result;
  305|       |
  306|   833k|        if(pp->endofresp(data, conn, line, length, code)) {
  ------------------
  |  Branch (306:12): [True: 16.4k, False: 817k]
  ------------------
  307|       |          /* When at "end of response", keep the endofresp line first in the
  308|       |             buffer since it will be accessed outside (by pingpong
  309|       |             parsers). Store the overflow counter to inform about additional
  310|       |             data in this buffer after the endofresp line. */
  311|  16.4k|          pp->nfinal = length;
  312|  16.4k|          if(curlx_dyn_len(&pp->recvbuf) > length)
  ------------------
  |  Branch (312:14): [True: 14.7k, False: 1.71k]
  ------------------
  313|  14.7k|            pp->overflow = curlx_dyn_len(&pp->recvbuf) - length;
  314|  1.71k|          else
  315|  1.71k|            pp->overflow = 0;
  316|  16.4k|          *size = pp->nread_resp; /* size of the response */
  317|  16.4k|          pp->nread_resp = 0; /* restart */
  318|  16.4k|          gotbytes = 0; /* force break out of outer loop */
  319|  16.4k|          break;
  320|  16.4k|        }
  321|   817k|        if(curlx_dyn_len(&pp->recvbuf) > length)
  ------------------
  |  Branch (321:12): [True: 816k, False: 1.01k]
  ------------------
  322|       |          /* keep the remaining piece */
  323|   816k|          curlx_dyn_tail((&pp->recvbuf), curlx_dyn_len(&pp->recvbuf) - length);
  324|  1.01k|        else
  325|  1.01k|          curlx_dyn_reset(&pp->recvbuf);
  326|   817k|      }
  327|  2.68k|      else {
  328|       |        /* without a newline, there is no overflow */
  329|  2.68k|        pp->overflow = 0;
  330|  2.68k|        break;
  331|  2.68k|      }
  332|       |
  333|   836k|    } while(1); /* while there is buffer left to scan */
  ------------------
  |  Branch (333:13): [True: 817k, Folded]
  ------------------
  334|       |
  335|  19.1k|  } while(gotbytes == sizeof(buffer));
  ------------------
  |  Branch (335:11): [True: 901, False: 18.2k]
  ------------------
  336|       |
  337|  18.2k|  pp->pending_resp = FALSE;
  ------------------
  |  | 1058|  18.2k|#define FALSE false
  ------------------
  338|       |
  339|  18.2k|  return result;
  340|  19.7k|}
Curl_pp_pollset:
  345|  8.73k|{
  346|  8.73k|  int flags = pp->sendleft ? CURL_POLL_OUT : CURL_POLL_IN;
  ------------------
  |  |  284|      0|#define CURL_POLL_OUT    2
  ------------------
                int flags = pp->sendleft ? CURL_POLL_OUT : CURL_POLL_IN;
  ------------------
  |  |  283|  8.73k|#define CURL_POLL_IN     1
  ------------------
  |  Branch (346:15): [True: 0, False: 8.73k]
  ------------------
  347|  8.73k|  return Curl_pollset_change(data, ps, data->conn->sock[FIRSTSOCKET],
  ------------------
  |  |  303|  8.73k|#define FIRSTSOCKET     0
  ------------------
  348|  8.73k|                             flags, 0);
  349|  8.73k|}
Curl_pp_needs_flush:
  353|  8.95k|{
  354|  8.95k|  (void)data;
  355|  8.95k|  return pp->sendleft > 0;
  356|  8.95k|}
Curl_pp_disconnect:
  391|  4.96k|{
  392|  4.96k|  if(pp->initialized) {
  ------------------
  |  Branch (392:6): [True: 2.13k, False: 2.82k]
  ------------------
  393|  2.13k|    curlx_dyn_free(&pp->sendbuf);
  394|  2.13k|    curlx_dyn_free(&pp->recvbuf);
  395|  2.13k|    memset(pp, 0, sizeof(*pp));
  396|  2.13k|  }
  397|  4.96k|  return CURLE_OK;
  398|  4.96k|}
pingpong.c:pingpong_read:
  229|  6.24k|{
  230|  6.24k|  return Curl_conn_recv(data, sockindex, buffer, buflen, nread);
  231|  6.24k|}

time2str:
   40|    504|{
   41|    504|  curl_off_t h;
   42|    504|  if(seconds <= 0) {
  ------------------
  |  Branch (42:6): [True: 504, False: 0]
  ------------------
   43|    504|    curlx_strcopy(r, rsize, STRCONST("       "));
  ------------------
  |  | 1292|    504|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
   44|    504|    return;
   45|    504|  }
   46|      0|  h = seconds / 3600;
   47|      0|  if(h <= 99) {
  ------------------
  |  Branch (47:6): [True: 0, False: 0]
  ------------------
   48|      0|    curl_off_t m = (seconds - (h * 3600)) / 60;
   49|      0|    if(h <= 9) {
  ------------------
  |  Branch (49:8): [True: 0, False: 0]
  ------------------
   50|      0|      curl_off_t s = (seconds - (h * 3600)) - (m * 60);
   51|      0|      if(h)
  ------------------
  |  Branch (51:10): [True: 0, False: 0]
  ------------------
   52|      0|        curl_msnprintf(r, rsize, "%" FMT_OFF_T ":%02" FMT_OFF_T ":"
   53|      0|                       "%02" FMT_OFF_T, h, m, s);
  ------------------
  |  |  598|      0|#define FMT_OFF_T  CURL_FORMAT_CURL_OFF_T
  |  |  ------------------
  |  |  |  |  341|      0|#    define CURL_FORMAT_CURL_OFF_T     "ld"
  |  |  ------------------
  ------------------
   54|      0|      else
   55|      0|        curl_msnprintf(r, rsize, "  %02" FMT_OFF_T ":%02" FMT_OFF_T, m, s);
  ------------------
  |  |  598|      0|#define FMT_OFF_T  CURL_FORMAT_CURL_OFF_T
  |  |  ------------------
  |  |  |  |  341|      0|#    define CURL_FORMAT_CURL_OFF_T     "ld"
  |  |  ------------------
  ------------------
   56|      0|    }
   57|      0|    else
   58|      0|      curl_msnprintf(r, rsize, "%" FMT_OFF_T "h %02" FMT_OFF_T "m", h, m);
   59|      0|  }
   60|      0|  else {
   61|      0|    curl_off_t d = seconds / 86400;
   62|      0|    h = (seconds - (d * 86400)) / 3600;
   63|      0|    if(d <= 99)
  ------------------
  |  Branch (63:8): [True: 0, False: 0]
  ------------------
   64|      0|      curl_msnprintf(r, rsize, "%2" FMT_OFF_T "d %02" FMT_OFF_T "h", d, h);
   65|      0|    else if(d <= 999)
  ------------------
  |  Branch (65:13): [True: 0, False: 0]
  ------------------
   66|      0|      curl_msnprintf(r, rsize, "%6" FMT_OFF_T "d", d);
   67|      0|    else { /* more than 999 days */
   68|      0|      curl_off_t m = d / 30;
   69|      0|      if(m <= 999)
  ------------------
  |  Branch (69:10): [True: 0, False: 0]
  ------------------
   70|      0|        curl_msnprintf(r, rsize, "%6" FMT_OFF_T "m", m);
   71|      0|      else { /* more than 999 months */
   72|      0|        curl_off_t y = d / 365;
   73|      0|        if(y <= 99999)
  ------------------
  |  Branch (73:12): [True: 0, False: 0]
  ------------------
   74|      0|          curl_msnprintf(r, rsize, "%6" FMT_OFF_T "y", y);
   75|      0|        else
   76|      0|          curlx_strcopy(r, rsize, STRCONST(">99999y"));
  ------------------
  |  | 1292|      0|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
   77|      0|      }
   78|      0|    }
   79|      0|  }
   80|      0|}
max6out:
   90|  1.00k|{
   91|       |  /* a signed 64-bit value is 8192 petabytes maximum, shown as
   92|       |     8.0E (exabytes)*/
   93|  1.00k|  if(bytes < 100000)
  ------------------
  |  Branch (93:6): [True: 894, False: 114]
  ------------------
   94|    894|    curl_msnprintf(max6, mlen, "%6" CURL_FORMAT_CURL_OFF_T, bytes);
  ------------------
  |  |  341|    894|#    define CURL_FORMAT_CURL_OFF_T     "ld"
  ------------------
   95|    114|  else {
   96|    114|    const char unit[] = { 'k', 'M', 'G', 'T', 'P', 'E', 0 };
   97|    114|    int k = 0;
   98|    114|    curl_off_t nbytes;
   99|    114|    curl_off_t rest;
  100|    134|    do {
  101|    134|      nbytes = bytes / 1024;
  102|    134|      if(nbytes < 1000)
  ------------------
  |  Branch (102:10): [True: 114, False: 20]
  ------------------
  103|    114|        break;
  104|     20|      bytes = nbytes;
  105|     20|      k++;
  106|     20|      DEBUGASSERT(unit[k]);
  ------------------
  |  | 1081|     20|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (106:7): [True: 0, False: 20]
  |  Branch (106:7): [True: 20, False: 0]
  ------------------
  107|     20|    } while(unit[k]);
  ------------------
  |  Branch (107:13): [True: 20, False: 0]
  ------------------
  108|    114|    rest = bytes % 1024;
  109|    114|    if(nbytes <= 99)
  ------------------
  |  Branch (109:8): [True: 20, False: 94]
  ------------------
  110|       |      /* xx.yyU */
  111|     20|      curl_msnprintf(max6, mlen, "%2" CURL_FORMAT_CURL_OFF_T
  112|     20|                     ".%02" CURL_FORMAT_CURL_OFF_T "%c", nbytes,
  113|     20|                     rest * 100 / 1024, unit[k]);
  114|     94|    else
  115|       |      /* xxx.yU */
  116|     94|      curl_msnprintf(max6, mlen, "%3" CURL_FORMAT_CURL_OFF_T
  117|     94|                     ".%" CURL_FORMAT_CURL_OFF_T "%c", nbytes,
  118|     94|                     rest * 10 / 1024, unit[k]);
  119|    114|  }
  120|  1.00k|  return max6;
  121|  1.00k|}
pgrs_speedcheck:
  136|  3.26M|{
  137|  3.26M|  if(!data->set.low_speed_time || !data->set.low_speed_limit ||
  ------------------
  |  Branch (137:6): [True: 3.19M, False: 75.4k]
  |  Branch (137:35): [True: 74.9k, False: 541]
  ------------------
  138|    541|     Curl_xfer_recv_is_paused(data) || Curl_xfer_send_is_paused(data))
  ------------------
  |  Branch (138:6): [True: 0, False: 541]
  |  Branch (138:40): [True: 0, False: 541]
  ------------------
  139|       |    /* A paused transfer is not qualified for speed checks */
  140|  3.26M|    return CURLE_OK;
  141|       |
  142|    541|  if(data->progress.current_speed >= 0) {
  ------------------
  |  Branch (142:6): [True: 541, False: 0]
  ------------------
  143|    541|    if(data->progress.current_speed < data->set.low_speed_limit) {
  ------------------
  |  Branch (143:8): [True: 541, False: 0]
  ------------------
  144|    541|      if(!data->state.keeps_speed.tv_sec)
  ------------------
  |  Branch (144:10): [True: 21, False: 520]
  ------------------
  145|       |        /* under the limit at this moment */
  146|     21|        data->state.keeps_speed = *pnow;
  147|    520|      else {
  148|       |        /* how long has it been under the limit */
  149|    520|        timediff_t howlong =
  150|    520|          curlx_ptimediff_ms(pnow, &data->state.keeps_speed);
  151|       |
  152|    520|        if(howlong >= data->set.low_speed_time * 1000) {
  ------------------
  |  Branch (152:12): [True: 0, False: 520]
  ------------------
  153|       |          /* too long */
  154|      0|          failf(data, "Operation too slow. Less than %" FMT_OFF_T
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  155|      0|                " bytes/sec transferred the last %u seconds",
  156|      0|                data->set.low_speed_limit, data->set.low_speed_time);
  157|      0|          return CURLE_OPERATION_TIMEDOUT;
  158|      0|        }
  159|    520|      }
  160|    541|    }
  161|      0|    else
  162|       |      /* faster right now */
  163|      0|      data->state.keeps_speed.tv_sec = 0;
  164|    541|  }
  165|       |
  166|       |  /* since low speed limit is enabled, set the expire timer to make this
  167|       |     connection's speed get checked again in a second */
  168|    541|  Curl_expire(data, 1000, EXPIRE_SPEEDCHECK);
  169|       |
  170|    541|  return CURLE_OK;
  171|    541|}
Curl_pgrs_now:
  174|  43.2M|{
  175|  43.2M|  struct curltime *pnow = data->multi ?
  ------------------
  |  Branch (175:27): [True: 43.2M, False: 1.02k]
  ------------------
  176|  43.2M|                          &data->multi->now : &data->progress.now;
  177|  43.2M|  curlx_pnow(pnow);
  178|  43.2M|  return pnow;
  179|  43.2M|}
Curl_pgrsDone:
  194|  8.99k|{
  195|  8.99k|  int rc;
  196|  8.99k|  data->progress.lastshow = 0;
  197|  8.99k|  rc = Curl_pgrsUpdate(data); /* the final (forced) update */
  198|  8.99k|  if(rc)
  ------------------
  |  Branch (198:6): [True: 0, False: 8.99k]
  ------------------
  199|      0|    return rc;
  200|       |
  201|  8.99k|  if(!data->progress.hide && !data->progress.callback)
  ------------------
  |  Branch (201:6): [True: 51, False: 8.94k]
  |  Branch (201:30): [True: 51, False: 0]
  ------------------
  202|       |    /* only output if we do not use a progress callback and we are not
  203|       |     * hidden */
  204|     51|    curl_mfprintf(data->set.err, "\n");
  205|       |
  206|  8.99k|  return 0;
  207|  8.99k|}
Curl_pgrsReset:
  210|  21.8k|{
  211|  21.8k|  Curl_pgrsSetUploadCounter(data, 0);
  212|  21.8k|  data->progress.dl.cur_size = 0;
  213|  21.8k|  Curl_pgrsSetUploadSize(data, -1);
  214|  21.8k|  Curl_pgrsSetDownloadSize(data, -1);
  215|  21.8k|  data->progress.speeder_c = 0; /* reset speed records */
  216|  21.8k|  data->progress.deliver = 0;
  217|  21.8k|  pgrs_speedinit(data);
  218|  21.8k|}
Curl_pgrsResetTransferSizes:
  222|  15.4k|{
  223|  15.4k|  Curl_pgrsSetDownloadSize(data, -1);
  224|  15.4k|  Curl_pgrsSetUploadSize(data, -1);
  225|  15.4k|}
Curl_pgrsTimeWas:
  248|  94.8k|{
  249|  94.8k|  timediff_t *delta = NULL;
  250|       |
  251|  94.8k|  switch(timer) {
  252|      0|  default:
  ------------------
  |  Branch (252:3): [True: 0, False: 94.8k]
  ------------------
  253|      0|  case TIMER_NONE:
  ------------------
  |  Branch (253:3): [True: 0, False: 94.8k]
  ------------------
  254|       |    /* mistake filter */
  255|      0|    break;
  256|  19.6k|  case TIMER_STARTOP:
  ------------------
  |  Branch (256:3): [True: 19.6k, False: 75.2k]
  ------------------
  257|       |    /* This is set at the start of a transfer */
  258|  19.6k|    data->progress.t_startop = timestamp;
  259|  19.6k|    data->progress.t_startqueue = timestamp;
  260|  19.6k|    data->progress.t_postqueue = 0;
  261|  19.6k|    break;
  262|  15.4k|  case TIMER_STARTSINGLE:
  ------------------
  |  Branch (262:3): [True: 15.4k, False: 79.3k]
  ------------------
  263|       |    /* This is set at the start of each single transfer */
  264|  15.4k|    data->progress.t_startsingle = timestamp;
  265|  15.4k|    data->progress.is_t_startransfer_set = FALSE;
  ------------------
  |  | 1058|  15.4k|#define FALSE false
  ------------------
  266|  15.4k|    break;
  267|  13.8k|  case TIMER_POSTQUEUE:
  ------------------
  |  Branch (267:3): [True: 13.8k, False: 80.9k]
  ------------------
  268|       |    /* Queue time is accumulative from all involved redirects */
  269|  13.8k|    data->progress.t_postqueue +=
  270|  13.8k|      curlx_ptimediff_us(&timestamp, &data->progress.t_startqueue);
  271|  13.8k|    break;
  272|      0|  case TIMER_STARTACCEPT:
  ------------------
  |  Branch (272:3): [True: 0, False: 94.8k]
  ------------------
  273|      0|    data->progress.t_acceptdata = timestamp;
  274|      0|    break;
  275|  13.1k|  case TIMER_NAMELOOKUP:
  ------------------
  |  Branch (275:3): [True: 13.1k, False: 81.6k]
  ------------------
  276|  13.1k|    delta = &data->progress.t_nslookup;
  277|  13.1k|    break;
  278|  13.8k|  case TIMER_CONNECT:
  ------------------
  |  Branch (278:3): [True: 13.8k, False: 81.0k]
  ------------------
  279|  13.8k|    delta = &data->progress.t_connect;
  280|  13.8k|    break;
  281|      0|  case TIMER_APPCONNECT:
  ------------------
  |  Branch (281:3): [True: 0, False: 94.8k]
  ------------------
  282|      0|    delta = &data->progress.t_appconnect;
  283|      0|    break;
  284|  7.56k|  case TIMER_PRETRANSFER:
  ------------------
  |  Branch (284:3): [True: 7.56k, False: 87.3k]
  ------------------
  285|  7.56k|    delta = &data->progress.t_pretransfer;
  286|  7.56k|    break;
  287|  3.80k|  case TIMER_STARTTRANSFER:
  ------------------
  |  Branch (287:3): [True: 3.80k, False: 91.0k]
  ------------------
  288|  3.80k|    delta = &data->progress.t_starttransfer;
  289|       |    /* prevent updating t_starttransfer unless:
  290|       |     *   1. this is the first time we are setting t_starttransfer
  291|       |     *   2. a redirect has occurred since the last time t_starttransfer was set
  292|       |     * This prevents repeated invocations of the function from incorrectly
  293|       |     * changing the t_starttransfer time.
  294|       |     */
  295|  3.80k|    if(data->progress.is_t_startransfer_set) {
  ------------------
  |  Branch (295:8): [True: 0, False: 3.80k]
  ------------------
  296|      0|      return;
  297|      0|    }
  298|  3.80k|    else {
  299|  3.80k|      data->progress.is_t_startransfer_set = TRUE;
  ------------------
  |  | 1055|  3.80k|#define TRUE true
  ------------------
  300|  3.80k|      break;
  301|  3.80k|    }
  302|  6.70k|  case TIMER_POSTRANSFER:
  ------------------
  |  Branch (302:3): [True: 6.70k, False: 88.1k]
  ------------------
  303|  6.70k|    delta = &data->progress.t_posttransfer;
  304|  6.70k|    break;
  305|    800|  case TIMER_REDIRECT:
  ------------------
  |  Branch (305:3): [True: 800, False: 94.0k]
  ------------------
  306|    800|    data->progress.t_redirect = curlx_ptimediff_us(&timestamp,
  307|    800|                                                   &data->progress.start);
  308|    800|    data->progress.t_startqueue = timestamp;
  309|    800|    break;
  310|  94.8k|  }
  311|  94.8k|  if(delta) {
  ------------------
  |  Branch (311:6): [True: 45.0k, False: 49.8k]
  ------------------
  312|  45.0k|    timediff_t us = curlx_ptimediff_us(&timestamp,
  313|  45.0k|                                       &data->progress.t_startsingle);
  314|  45.0k|    if(us < 1)
  ------------------
  |  Branch (314:8): [True: 0, False: 45.0k]
  ------------------
  315|      0|      us = 1; /* make sure at least one microsecond passed */
  316|  45.0k|    *delta += us;
  317|  45.0k|  }
  318|  94.8k|}
Curl_pgrsTime:
  327|  81.0k|{
  328|  81.0k|  Curl_pgrsTimeWas(data, timer, *Curl_pgrs_now(data));
  329|  81.0k|}
Curl_pgrsStartNow:
  332|  14.6k|{
  333|  14.6k|  struct Progress *p = &data->progress;
  334|       |
  335|  14.6k|  p->speeder_c = 0; /* reset the progress meter display */
  336|  14.6k|  p->start = *Curl_pgrs_now(data);
  337|  14.6k|  p->is_t_startransfer_set = FALSE;
  ------------------
  |  | 1058|  14.6k|#define FALSE false
  ------------------
  338|  14.6k|  p->dl.cur_size = 0;
  339|  14.6k|  p->ul.cur_size = 0;
  340|       |  /* the sizes are unknown at start */
  341|  14.6k|  p->dl_size_known = FALSE;
  ------------------
  |  | 1058|  14.6k|#define FALSE false
  ------------------
  342|       |  p->ul_size_known = FALSE;
  ------------------
  |  | 1058|  14.6k|#define FALSE false
  ------------------
  343|  14.6k|}
Curl_pgrs_deliver_check:
  348|  9.53k|{
  349|  9.53k|  if(data->set.max_filesize &&
  ------------------
  |  Branch (349:6): [True: 852, False: 8.67k]
  ------------------
  350|    852|     ((curl_off_t)delta > data->set.max_filesize - data->progress.deliver)) {
  ------------------
  |  Branch (350:6): [True: 4, False: 848]
  ------------------
  351|      4|    failf(data, "Would have exceeded max file size");
  ------------------
  |  |   62|      4|#define failf Curl_failf
  ------------------
  352|      4|    return CURLE_FILESIZE_EXCEEDED;
  353|      4|  }
  354|  9.52k|  return CURLE_OK;
  355|  9.53k|}
Curl_pgrs_deliver_inc:
  360|  9.52k|{
  361|  9.52k|  data->progress.deliver += delta;
  362|  9.52k|}
Curl_pgrs_download_inc:
  365|  6.38k|{
  366|  6.38k|  if(delta) {
  ------------------
  |  Branch (366:6): [True: 6.38k, False: 0]
  ------------------
  367|  6.38k|    data->progress.dl.cur_size += delta;
  368|  6.38k|    Curl_rlimit_drain(&data->progress.dl.rlimit, delta, Curl_pgrs_now(data));
  369|  6.38k|  }
  370|  6.38k|}
Curl_pgrs_upload_inc:
  373|    962|{
  374|    962|  if(delta) {
  ------------------
  |  Branch (374:6): [True: 962, False: 0]
  ------------------
  375|    962|    data->progress.ul.cur_size += delta;
  376|    962|    Curl_rlimit_drain(&data->progress.ul.rlimit, delta, Curl_pgrs_now(data));
  377|    962|  }
  378|    962|}
Curl_pgrsSetUploadCounter:
  384|  21.8k|{
  385|  21.8k|  data->progress.ul.cur_size = size;
  386|  21.8k|}
Curl_pgrsSetDownloadSize:
  389|  37.9k|{
  390|  37.9k|  if(size >= 0) {
  ------------------
  |  Branch (390:6): [True: 412, False: 37.5k]
  ------------------
  391|    412|    data->progress.dl.total_size = size;
  392|    412|    data->progress.dl_size_known = TRUE;
  ------------------
  |  | 1055|    412|#define TRUE true
  ------------------
  393|    412|  }
  394|  37.5k|  else {
  395|  37.5k|    data->progress.dl.total_size = 0;
  396|       |    data->progress.dl_size_known = FALSE;
  ------------------
  |  | 1058|  37.5k|#define FALSE false
  ------------------
  397|  37.5k|  }
  398|  37.9k|}
Curl_pgrsSetUploadSize:
  401|  44.2k|{
  402|  44.2k|  if(size >= 0) {
  ------------------
  |  Branch (402:6): [True: 6.72k, False: 37.5k]
  ------------------
  403|  6.72k|    data->progress.ul.total_size = size;
  404|  6.72k|    data->progress.ul_size_known = TRUE;
  ------------------
  |  | 1055|  6.72k|#define TRUE true
  ------------------
  405|  6.72k|  }
  406|  37.5k|  else {
  407|  37.5k|    data->progress.ul.total_size = 0;
  408|       |    data->progress.ul_size_known = FALSE;
  ------------------
  |  | 1058|  37.5k|#define FALSE false
  ------------------
  409|  37.5k|  }
  410|  44.2k|}
Curl_pgrsUpdate:
  685|  8.18M|{
  686|  8.18M|  return pgrs_update(data, Curl_pgrs_now(data));
  687|  8.18M|}
Curl_pgrsCheck:
  690|  3.26M|{
  691|  3.26M|  CURLcode result;
  692|       |
  693|  3.26M|  result = pgrs_update(data, Curl_pgrs_now(data));
  694|  3.26M|  if(!result && !data->req.done)
  ------------------
  |  Branch (694:6): [True: 3.26M, False: 0]
  |  Branch (694:17): [True: 3.26M, False: 0]
  ------------------
  695|  3.26M|    result = pgrs_speedcheck(data, Curl_pgrs_now(data));
  696|  3.26M|  return result;
  697|  3.26M|}
Curl_pgrsUpdate_nometer:
  703|  1.51k|{
  704|  1.51k|  (void)progress_calc(data, Curl_pgrs_now(data));
  705|  1.51k|}
progress.c:pgrs_speedinit:
  125|  21.8k|{
  126|  21.8k|  memset(&data->state.keeps_speed, 0, sizeof(struct curltime));
  127|  21.8k|}
progress.c:pgrs_update:
  679|  11.4M|{
  680|       |  bool showprogress = progress_calc(data, pnow);
  681|  11.4M|  return pgrsupdate(data, showprogress);
  682|  11.4M|}
progress.c:pgrsupdate:
  632|  11.4M|{
  633|  11.4M|  if(!data->progress.hide) {
  ------------------
  |  Branch (633:6): [True: 4.82k, False: 11.4M]
  ------------------
  634|  4.82k|    int rc;
  635|  4.82k|    if(data->set.fxferinfo) {
  ------------------
  |  Branch (635:8): [True: 0, False: 4.82k]
  ------------------
  636|       |      /* There is a callback set, call that */
  637|      0|      Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  638|      0|      rc = data->set.fxferinfo(data->set.progress_client,
  639|      0|                               data->progress.dl.total_size,
  640|      0|                               data->progress.dl.cur_size,
  641|      0|                               data->progress.ul.total_size,
  642|      0|                               data->progress.ul.cur_size);
  643|      0|      Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  644|      0|      if(rc != CURL_PROGRESSFUNC_CONTINUE) {
  ------------------
  |  |  234|      0|#define CURL_PROGRESSFUNC_CONTINUE 0x10000001
  ------------------
  |  Branch (644:10): [True: 0, False: 0]
  ------------------
  645|      0|        if(rc) {
  ------------------
  |  Branch (645:12): [True: 0, False: 0]
  ------------------
  646|      0|          failf(data, "Callback aborted");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  647|      0|          return CURLE_ABORTED_BY_CALLBACK;
  648|      0|        }
  649|      0|        return CURLE_OK;
  650|      0|      }
  651|      0|    }
  652|  4.82k|    else if(data->set.fprogress) {
  ------------------
  |  Branch (652:13): [True: 0, False: 4.82k]
  ------------------
  653|       |      /* The older deprecated callback is set, call that */
  654|      0|      Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  655|      0|      rc = data->set.fprogress(data->set.progress_client,
  656|      0|                               (double)data->progress.dl.total_size,
  657|      0|                               (double)data->progress.dl.cur_size,
  658|      0|                               (double)data->progress.ul.total_size,
  659|      0|                               (double)data->progress.ul.cur_size);
  660|      0|      Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  661|      0|      if(rc != CURL_PROGRESSFUNC_CONTINUE) {
  ------------------
  |  |  234|      0|#define CURL_PROGRESSFUNC_CONTINUE 0x10000001
  ------------------
  |  Branch (661:10): [True: 0, False: 0]
  ------------------
  662|      0|        if(rc) {
  ------------------
  |  Branch (662:12): [True: 0, False: 0]
  ------------------
  663|      0|          failf(data, "Callback aborted");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  664|      0|          return CURLE_ABORTED_BY_CALLBACK;
  665|      0|        }
  666|      0|        return CURLE_OK;
  667|      0|      }
  668|      0|    }
  669|       |
  670|  4.82k|    if(showprogress)
  ------------------
  |  Branch (670:8): [True: 168, False: 4.66k]
  ------------------
  671|    168|      progress_meter(data);
  672|  4.82k|  }
  673|       |
  674|  11.4M|  return CURLE_OK;
  675|  11.4M|}
progress.c:progress_meter:
  538|    168|{
  539|    168|  struct Progress *p = &data->progress;
  540|    168|  char max6[6][7];
  541|    168|  struct pgrs_estimate dl_estm;
  542|    168|  struct pgrs_estimate ul_estm;
  543|    168|  struct pgrs_estimate total_estm;
  544|    168|  curl_off_t total_cur_size;
  545|    168|  curl_off_t total_expected_size;
  546|    168|  curl_off_t dl_size;
  547|    168|  char time_left[8];
  548|    168|  char time_total[8];
  549|    168|  char time_spent[8];
  550|    168|  curl_off_t cur_secs = (curl_off_t)p->timespent / 1000000; /* seconds */
  551|       |
  552|    168|  if(!p->headers_out) {
  ------------------
  |  Branch (552:6): [True: 53, False: 115]
  ------------------
  553|     53|    if(data->state.resume_from) {
  ------------------
  |  Branch (553:8): [True: 15, False: 38]
  ------------------
  554|     15|      curl_mfprintf(data->set.err,
  555|     15|                    "** Resuming transfer from byte position %" FMT_OFF_T "\n",
  556|     15|                    data->state.resume_from);
  557|     15|    }
  558|     53|    curl_mfprintf(data->set.err,
  559|     53|                  "  %% Total    %% Received %% Xferd  Average Speed  "
  560|     53|                  "Time    Time    Time   Current\n"
  561|     53|                  "                                 Dload  Upload  "
  562|     53|                  "Total   Spent   Left   Speed\n");
  563|     53|    p->headers_out = TRUE; /* headers are shown */
  ------------------
  |  | 1055|     53|#define TRUE true
  ------------------
  564|     53|  }
  565|       |
  566|       |  /* Figure out the estimated time of arrival for upload and download */
  567|    168|  pgrs_estimates(&p->ul, (bool)p->ul_size_known, &ul_estm);
  568|    168|  pgrs_estimates(&p->dl, (bool)p->dl_size_known, &dl_estm);
  569|       |
  570|       |  /* Since both happen at the same time, total expected duration is max. */
  571|    168|  total_estm.secs = CURLMAX(ul_estm.secs, dl_estm.secs);
  ------------------
  |  | 1286|    168|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1286:24): [True: 0, False: 168]
  |  |  ------------------
  ------------------
  572|       |  /* create the three time strings */
  573|    168|  time2str(time_left, sizeof(time_left),
  574|    168|           total_estm.secs > 0 ? (total_estm.secs - cur_secs) : 0);
  ------------------
  |  Branch (574:12): [True: 0, False: 168]
  ------------------
  575|    168|  time2str(time_total, sizeof(time_total), total_estm.secs);
  576|    168|  time2str(time_spent, sizeof(time_spent), cur_secs);
  577|       |
  578|       |  /* Get the total amount of data expected to get transferred */
  579|    168|  total_expected_size = p->ul_size_known ? p->ul.total_size : p->ul.cur_size;
  ------------------
  |  Branch (579:25): [True: 78, False: 90]
  ------------------
  580|       |
  581|    168|  dl_size = p->dl_size_known ? p->dl.total_size : p->dl.cur_size;
  ------------------
  |  Branch (581:13): [True: 8, False: 160]
  ------------------
  582|       |
  583|       |  /* integer overflow check */
  584|    168|  if((CURL_OFF_T_MAX - total_expected_size) < dl_size)
  ------------------
  |  |  594|    168|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (584:6): [True: 0, False: 168]
  ------------------
  585|      0|    total_expected_size = CURL_OFF_T_MAX; /* capped */
  ------------------
  |  |  594|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  586|    168|  else
  587|    168|    total_expected_size += dl_size;
  588|       |
  589|       |  /* We have transferred this much so far */
  590|    168|  total_cur_size = p->dl.cur_size + p->ul.cur_size;
  591|       |
  592|       |  /* Get the percentage of data transferred so far */
  593|    168|  total_estm.percent = pgrs_est_percent(total_expected_size, total_cur_size);
  594|       |
  595|    168|  curl_mfprintf(data->set.err,
  596|    168|                "\r"
  597|    168|                "%3" FMT_OFF_T " %s "
  598|    168|                "%3" FMT_OFF_T " %s "
  599|    168|                "%3" FMT_OFF_T " %s %s %s %s %s %s %s",
  600|    168|                total_estm.percent, /* 3 letters */    /* total % */
  601|    168|                max6out(total_expected_size, max6[2],
  602|    168|                        sizeof(max6[2])),              /* total size */
  603|    168|                dl_estm.percent, /* 3 letters */       /* rcvd % */
  604|    168|                max6out(p->dl.cur_size, max6[0],
  605|    168|                        sizeof(max6[0])),              /* rcvd size */
  606|    168|                ul_estm.percent, /* 3 letters */       /* xfer % */
  607|    168|                max6out(p->ul.cur_size, max6[1],
  608|    168|                        sizeof(max6[1])),              /* xfer size */
  609|    168|                max6out(p->dl.speed, max6[3],
  610|    168|                        sizeof(max6[3])),              /* avrg dl speed */
  611|    168|                max6out(p->ul.speed, max6[4],
  612|    168|                        sizeof(max6[4])),              /* avrg ul speed */
  613|    168|                time_total,    /* 7 letters */         /* total time */
  614|    168|                time_spent,    /* 7 letters */         /* time spent */
  615|    168|                time_left,     /* 7 letters */         /* time left */
  616|    168|                max6out(p->current_speed, max6[5],
  617|    168|                        sizeof(max6[5]))               /* current speed */
  618|    168|    );
  619|       |
  620|       |  /* we flush the output stream to make it appear as soon as possible */
  621|    168|  fflush(data->set.err);
  622|    168|}
progress.c:pgrs_estimates:
  528|    336|{
  529|    336|  est->secs = 0;
  530|    336|  est->percent = 0;
  531|    336|  if(total_known && (d->speed > 0)) {
  ------------------
  |  Branch (531:6): [True: 86, False: 250]
  |  Branch (531:21): [True: 66, False: 20]
  ------------------
  532|     66|    est->secs = d->total_size / d->speed;
  533|     66|    est->percent = pgrs_est_percent(d->total_size, d->cur_size);
  534|     66|  }
  535|    336|}
progress.c:pgrs_est_percent:
  517|    234|{
  518|    234|  if(total > 10000)
  ------------------
  |  Branch (518:6): [True: 0, False: 234]
  ------------------
  519|      0|    return cur / (total / 100);
  520|    234|  else if(total > 0)
  ------------------
  |  Branch (520:11): [True: 141, False: 93]
  ------------------
  521|    141|    return (cur * 100) / total;
  522|     93|  return 0;
  523|    234|}
progress.c:progress_calc:
  434|  11.4M|{
  435|  11.4M|  struct Progress * const p = &data->progress;
  436|  11.4M|  int i_next, i_oldest, i_latest;
  437|  11.4M|  timediff_t duration_us;
  438|  11.4M|  curl_off_t amount;
  439|       |
  440|       |  /* The time spent so far (from the start) in microseconds */
  441|  11.4M|  p->timespent = curlx_ptimediff_us(pnow, &p->start);
  442|  11.4M|  p->dl.speed = trspeed(p->dl.cur_size, p->timespent);
  443|  11.4M|  p->ul.speed = trspeed(p->ul.cur_size, p->timespent);
  444|       |
  445|  11.4M|  if(!p->speeder_c) { /* no previous record exists */
  ------------------
  |  Branch (445:6): [True: 20.7k, False: 11.4M]
  ------------------
  446|  20.7k|    p->speed_amount[0] = p->dl.cur_size + p->ul.cur_size;
  447|  20.7k|    p->speed_time[0] = *pnow;
  448|  20.7k|    p->speeder_c++;
  449|       |    /* use the overall average at the start */
  450|  20.7k|    p->current_speed = p->ul.speed + p->dl.speed;
  451|  20.7k|    p->lastshow = pnow->tv_sec;
  452|  20.7k|    return TRUE;
  ------------------
  |  | 1055|  20.7k|#define TRUE true
  ------------------
  453|  20.7k|  }
  454|       |  /* We have at least one record now. Where to put the next and
  455|       |   * where is the latest one? */
  456|  11.4M|  i_next = p->speeder_c % CURL_SPEED_RECORDS;
  ------------------
  |  |  542|  11.4M|#define CURL_SPEED_RECORDS (5 + 1) /* 6 entries for 5 seconds */
  ------------------
  457|  11.4M|  i_latest = (i_next > 0) ? (i_next - 1) : (CURL_SPEED_RECORDS - 1);
  ------------------
  |  |  542|      0|#define CURL_SPEED_RECORDS (5 + 1) /* 6 entries for 5 seconds */
  ------------------
  |  Branch (457:14): [True: 11.4M, False: 0]
  ------------------
  458|       |
  459|       |  /* Make a new record only when some time has passed.
  460|       |   * Too frequent calls otherwise ruin the history. */
  461|  11.4M|  if(curlx_ptimediff_ms(pnow, &p->speed_time[i_latest]) >= 1000) {
  ------------------
  |  Branch (461:6): [True: 0, False: 11.4M]
  ------------------
  462|      0|    p->speeder_c++;
  463|      0|    i_latest = i_next;
  464|      0|    p->speed_amount[i_latest] = p->dl.cur_size + p->ul.cur_size;
  465|      0|    p->speed_time[i_latest] = *pnow;
  466|      0|  }
  467|  11.4M|  else if(data->req.done) {
  ------------------
  |  Branch (467:11): [True: 5.06k, False: 11.4M]
  ------------------
  468|       |    /* When a transfer is done, and we did not have a current speed
  469|       |     * already, update the last record. Otherwise, stay at the speed
  470|       |     * we have. The last chunk of data, when rate limiting, would increase
  471|       |     * reported speed since it no longer measures a full second. */
  472|  5.06k|    if(!p->current_speed) {
  ------------------
  |  Branch (472:8): [True: 5.06k, False: 0]
  ------------------
  473|  5.06k|      p->speed_amount[i_latest] = p->dl.cur_size + p->ul.cur_size;
  474|  5.06k|      p->speed_time[i_latest] = *pnow;
  475|  5.06k|    }
  476|  5.06k|  }
  477|  11.4M|  else {
  478|       |    /* transfer ongoing, wait for more time to pass. */
  479|  11.4M|    return FALSE;
  ------------------
  |  | 1058|  11.4M|#define FALSE false
  ------------------
  480|  11.4M|  }
  481|       |
  482|  5.06k|  i_oldest = (p->speeder_c < CURL_SPEED_RECORDS) ? 0 :
  ------------------
  |  |  542|  5.06k|#define CURL_SPEED_RECORDS (5 + 1) /* 6 entries for 5 seconds */
  ------------------
  |  Branch (482:14): [True: 5.06k, False: 0]
  ------------------
  483|  5.06k|             ((i_latest + 1) % CURL_SPEED_RECORDS);
  ------------------
  |  |  542|      0|#define CURL_SPEED_RECORDS (5 + 1) /* 6 entries for 5 seconds */
  ------------------
  484|       |
  485|       |  /* How much we transferred between oldest and current records */
  486|  5.06k|  amount = p->speed_amount[i_latest] - p->speed_amount[i_oldest];
  487|       |  /* How long this took */
  488|  5.06k|  duration_us = curlx_ptimediff_us(&p->speed_time[i_latest],
  489|  5.06k|                                   &p->speed_time[i_oldest]);
  490|  5.06k|  if(duration_us <= 0)
  ------------------
  |  Branch (490:6): [True: 5.06k, False: 0]
  ------------------
  491|  5.06k|    duration_us = 1;
  492|       |
  493|  5.06k|  if(amount > (CURL_OFF_T_MAX / 1000000)) {
  ------------------
  |  |  594|  5.06k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (493:6): [True: 0, False: 5.06k]
  ------------------
  494|       |    /* the 'amount' value is bigger than would fit in 64 bits if
  495|       |       multiplied with 1000000, so we use the double math for this */
  496|      0|    p->current_speed =
  497|      0|      (curl_off_t)(((double)amount * 1000000.0) / (double)duration_us);
  498|      0|  }
  499|  5.06k|  else {
  500|  5.06k|    p->current_speed = amount * 1000000 / duration_us;
  501|  5.06k|  }
  502|       |
  503|  5.06k|  if((p->lastshow == pnow->tv_sec) && !data->req.done)
  ------------------
  |  Branch (503:6): [True: 2.95k, False: 2.10k]
  |  Branch (503:39): [True: 0, False: 2.95k]
  ------------------
  504|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  505|  5.06k|  p->lastshow = pnow->tv_sec;
  506|       |  return TRUE;
  ------------------
  |  | 1055|  5.06k|#define TRUE true
  ------------------
  507|  5.06k|}
progress.c:trspeed:
  420|  22.9M|{
  421|  22.9M|  if(us < 1)
  ------------------
  |  Branch (421:6): [True: 0, False: 22.9M]
  ------------------
  422|      0|    return size * 1000000;
  423|  22.9M|  else if(size < CURL_OFF_T_MAX / 1000000)
  ------------------
  |  |  594|  22.9M|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (423:11): [True: 22.9M, False: 0]
  ------------------
  424|  22.9M|    return (size * 1000000) / us;
  425|      0|  else if(us >= 1000000)
  ------------------
  |  Branch (425:11): [True: 0, False: 0]
  ------------------
  426|      0|    return size / (us / 1000000);
  427|      0|  else
  428|      0|    return CURL_OFF_T_MAX;
  ------------------
  |  |  594|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  429|  22.9M|}

Curl_getn_scheme:
  469|  96.6k|{
  470|       |  /* table generated by schemetable.c:
  471|       |     1. gcc schemetable.c && ./a.out
  472|       |     2. check how small the table gets
  473|       |     3. tweak the hash algorithm, then rerun from 1
  474|       |     4. when the table is good enough
  475|       |     5. copy the table into this source code
  476|       |     6. make sure this function uses the same hash function that worked for
  477|       |     schemetable.c
  478|       |     */
  479|  96.6k|  static const struct Curl_scheme * const all_schemes[59] = { NULL,
  480|  96.6k|    &Curl_scheme_pop3, NULL,
  481|  96.6k|    &Curl_scheme_smtps,
  482|  96.6k|    &Curl_scheme_socks,
  483|  96.6k|    &Curl_scheme_socks4,
  484|  96.6k|    &Curl_scheme_socks5, NULL, NULL,
  485|  96.6k|    &Curl_scheme_gophers,
  486|  96.6k|    &Curl_scheme_ws,
  487|  96.6k|    &Curl_scheme_sftp,
  488|  96.6k|    &Curl_scheme_socks4a,
  489|  96.6k|    &Curl_scheme_scp,
  490|  96.6k|    &Curl_scheme_rtsp,
  491|  96.6k|    &Curl_scheme_dict, NULL, NULL,
  492|  96.6k|    &Curl_scheme_gopher, NULL, NULL, NULL,
  493|  96.6k|    &Curl_scheme_wss, NULL,
  494|  96.6k|    &Curl_scheme_smb, NULL,
  495|  96.6k|    &Curl_scheme_ldap,
  496|  96.6k|    &Curl_scheme_ldaps,
  497|  96.6k|    &Curl_scheme_imap, NULL, NULL, NULL,
  498|  96.6k|    &Curl_scheme_imaps,
  499|  96.6k|    &Curl_scheme_https,
  500|  96.6k|    &Curl_scheme_tftp,
  501|  96.6k|    &Curl_scheme_telnet, NULL, NULL, NULL,
  502|  96.6k|    &Curl_scheme_file,
  503|  96.6k|    &Curl_scheme_smtp, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
  504|  96.6k|    &Curl_scheme_ftp,
  505|  96.6k|    &Curl_scheme_mqtt, NULL,
  506|  96.6k|    &Curl_scheme_socks5h,
  507|  96.6k|    &Curl_scheme_http,
  508|  96.6k|    &Curl_scheme_pop3s, NULL,
  509|  96.6k|    &Curl_scheme_mqtts, NULL,
  510|  96.6k|    &Curl_scheme_smbs,
  511|  96.6k|    &Curl_scheme_ftps,
  512|  96.6k|  };
  513|       |
  514|  96.6k|  if(len && (len <= 7)) {
  ------------------
  |  Branch (514:6): [True: 96.6k, False: 0]
  |  Branch (514:13): [True: 96.6k, False: 40]
  ------------------
  515|  96.6k|    const char *s = scheme;
  516|  96.6k|    size_t l = len;
  517|  96.6k|    const struct Curl_scheme *h;
  518|  96.6k|    unsigned int c = 443;
  519|   419k|    while(l) {
  ------------------
  |  Branch (519:11): [True: 323k, False: 96.6k]
  ------------------
  520|   323k|      c <<= 5;
  521|   323k|      c += (unsigned int)Curl_raw_tolower(*s);
  522|   323k|      s++;
  523|   323k|      l--;
  524|   323k|    }
  525|       |
  526|  96.6k|    h = all_schemes[c % 59];
  527|  96.6k|    if(h && curl_strnequal(scheme, h->name, len) && !h->name[len])
  ------------------
  |  Branch (527:8): [True: 96.6k, False: 43]
  |  Branch (527:13): [True: 96.5k, False: 55]
  |  Branch (527:53): [True: 96.5k, False: 19]
  ------------------
  528|  96.5k|      return h;
  529|  96.6k|  }
  530|    157|  return NULL;
  531|  96.6k|}
Curl_get_scheme:
  534|  62.1k|{
  535|  62.1k|  return Curl_getn_scheme(scheme, strlen(scheme));
  536|  62.1k|}

Curl_rand_bytes:
  160|      3|{
  161|      3|  CURLcode result = CURLE_BAD_FUNCTION_ARGUMENT;
  162|       |#ifndef DEBUGBUILD
  163|       |  const bool env_override = FALSE;
  164|       |#endif
  165|       |
  166|      3|  DEBUGASSERT(num);
  ------------------
  |  | 1081|      3|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (166:3): [True: 0, False: 3]
  |  Branch (166:3): [True: 3, False: 0]
  ------------------
  167|       |
  168|      9|  while(num) {
  ------------------
  |  Branch (168:9): [True: 6, False: 3]
  ------------------
  169|      6|    unsigned int r;
  170|      6|    size_t left = num < sizeof(unsigned int) ? num : sizeof(unsigned int);
  ------------------
  |  Branch (170:19): [True: 0, False: 6]
  ------------------
  171|       |
  172|      6|    result = randit(data, &r, env_override);
  173|      6|    if(result)
  ------------------
  |  Branch (173:8): [True: 0, False: 6]
  ------------------
  174|      0|      return result;
  175|       |
  176|     30|    while(left) {
  ------------------
  |  Branch (176:11): [True: 24, False: 6]
  ------------------
  177|     24|      *rnd++ = (unsigned char)(r & 0xFF);
  178|     24|      r >>= 8;
  179|     24|      --num;
  180|     24|      --left;
  181|     24|    }
  182|      6|  }
  183|       |
  184|      3|  return result;
  185|      3|}
Curl_rand_alnum:
  225|    643|{
  226|    643|  CURLcode result = CURLE_OK;
  227|    643|  const unsigned int alnumspace = sizeof(alnum) - 1;
  228|    643|  unsigned int r;
  229|    643|  DEBUGASSERT(num > 1);
  ------------------
  |  | 1081|    643|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (229:3): [True: 0, False: 643]
  |  Branch (229:3): [True: 643, False: 0]
  ------------------
  230|       |
  231|    643|  num--; /* save one for null-termination */
  232|       |
  233|  14.7k|  while(num) {
  ------------------
  |  Branch (233:9): [True: 14.1k, False: 643]
  ------------------
  234|  14.1k|    do {
  235|  14.1k|      result = randit(data, &r, TRUE);
  ------------------
  |  | 1055|  14.1k|#define TRUE true
  ------------------
  236|  14.1k|      if(result)
  ------------------
  |  Branch (236:10): [True: 0, False: 14.1k]
  ------------------
  237|      0|        return result;
  238|  14.1k|    } while(r >= (UINT_MAX - UINT_MAX % alnumspace));
  ------------------
  |  Branch (238:13): [True: 0, False: 14.1k]
  ------------------
  239|       |
  240|  14.1k|    *rnd++ = (unsigned char)alnum[r % alnumspace];
  241|  14.1k|    num--;
  242|  14.1k|  }
  243|    643|  *rnd = 0;
  244|       |
  245|    643|  return result;
  246|    643|}
rand.c:randit:
  105|  14.1k|{
  106|  14.1k|#ifdef DEBUGBUILD
  107|  14.1k|  if(env_override) {
  ------------------
  |  Branch (107:6): [True: 14.1k, False: 0]
  ------------------
  108|  14.1k|    char *force_entropy = getenv("CURL_ENTROPY");
  109|  14.1k|    if(force_entropy) {
  ------------------
  |  Branch (109:8): [True: 0, False: 14.1k]
  ------------------
  110|      0|      static unsigned int randseed;
  111|      0|      static bool seeded = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  112|       |
  113|      0|      if(!seeded) {
  ------------------
  |  Branch (113:10): [True: 0, False: 0]
  ------------------
  114|      0|        unsigned int seed = 0;
  115|      0|        size_t elen = strlen(force_entropy);
  116|      0|        size_t clen = sizeof(seed);
  117|      0|        size_t min = elen < clen ? elen : clen;
  ------------------
  |  Branch (117:22): [True: 0, False: 0]
  ------------------
  118|      0|        memcpy((char *)&seed, force_entropy, min);
  119|      0|        randseed = ntohl(seed);
  120|      0|        seeded = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  121|      0|      }
  122|      0|      else
  123|      0|        randseed++;
  124|      0|      *rnd = randseed;
  125|      0|      return CURLE_OK;
  126|      0|    }
  127|  14.1k|  }
  128|       |#else
  129|       |  (void)env_override;
  130|       |#endif
  131|       |
  132|       |  /* data may be NULL! */
  133|  14.1k|#ifdef USE_SSL
  134|  14.1k|  return Curl_ssl_random(data, (unsigned char *)rnd, sizeof(*rnd));
  135|       |#else
  136|       |  return weak_random(data, (unsigned char *)rnd, sizeof(*rnd));
  137|       |#endif
  138|  14.1k|}

Curl_rlimit_init:
  156|  1.02k|{
  157|  1.02k|  DEBUGASSERT(rate_per_sec >= 0);
  ------------------
  |  | 1081|  1.02k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (157:3): [True: 0, False: 1.02k]
  |  Branch (157:3): [True: 1.02k, False: 0]
  ------------------
  158|  1.02k|  DEBUGASSERT(burst_per_sec >= rate_per_sec || !burst_per_sec);
  ------------------
  |  | 1081|  1.02k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (158:3): [True: 1.02k, False: 0]
  |  Branch (158:3): [True: 0, False: 0]
  |  Branch (158:3): [True: 1.02k, False: 0]
  |  Branch (158:3): [True: 0, False: 0]
  ------------------
  159|  1.02k|  DEBUGASSERT(pts);
  ------------------
  |  | 1081|  1.02k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (159:3): [True: 0, False: 1.02k]
  |  Branch (159:3): [True: 1.02k, False: 0]
  ------------------
  160|  1.02k|  r->rate_per_step = r->rate_per_sec = rate_per_sec;
  161|  1.02k|  r->burst_per_step = r->burst_per_sec = burst_per_sec;
  162|  1.02k|  r->step_us = CURL_US_PER_SEC;
  ------------------
  |  |   29|  1.02k|#define CURL_US_PER_SEC         1000000
  ------------------
  163|  1.02k|  r->spare_us = 0;
  164|  1.02k|  r->tokens = r->rate_per_step;
  165|  1.02k|  r->ts = *pts;
  166|       |  r->blocked = FALSE;
  ------------------
  |  | 1058|  1.02k|#define FALSE false
  ------------------
  167|  1.02k|}
Curl_rlimit_start:
  171|  2.49k|{
  172|       |  /* A start always resets the values to initial defaults, then
  173|       |   * fine tunes the intervals for the total_tokens expected. */
  174|  2.49k|  r->rate_per_step = r->rate_per_sec;
  175|  2.49k|  r->burst_per_step = r->burst_per_sec;
  176|  2.49k|  r->step_us = CURL_US_PER_SEC;
  ------------------
  |  |   29|  2.49k|#define CURL_US_PER_SEC         1000000
  ------------------
  177|  2.49k|  r->spare_us = 0;
  178|  2.49k|  r->tokens = r->rate_per_step;
  179|  2.49k|  r->ts = *pts;
  180|  2.49k|  rlimit_tune_steps(r, total_tokens);
  181|  2.49k|}
Curl_rlimit_per_step:
  184|  8.88k|{
  185|  8.88k|  return r->rate_per_step;
  186|  8.88k|}
Curl_rlimit_active:
  189|  12.7M|{
  190|  12.7M|  return (r->rate_per_step > 0) || r->blocked;
  ------------------
  |  Branch (190:10): [True: 6.00M, False: 6.71M]
  |  Branch (190:36): [True: 0, False: 6.71M]
  ------------------
  191|  12.7M|}
Curl_rlimit_is_blocked:
  194|  16.2M|{
  195|  16.2M|  return (bool)r->blocked;
  196|  16.2M|}
Curl_rlimit_avail:
  200|  15.5M|{
  201|  15.5M|  if(r->blocked)
  ------------------
  |  Branch (201:6): [True: 0, False: 15.5M]
  ------------------
  202|      0|    return 0;
  203|  15.5M|  else if(r->rate_per_step) {
  ------------------
  |  Branch (203:11): [True: 8.41M, False: 7.09M]
  ------------------
  204|  8.41M|    rlimit_update(r, pts);
  205|  8.41M|    return r->tokens;
  206|  8.41M|  }
  207|  7.09M|  else
  208|  7.09M|    return INT64_MAX;
  209|  15.5M|}
Curl_rlimit_drain:
  214|  7.34k|{
  215|  7.34k|  if(r->blocked || !r->rate_per_step)
  ------------------
  |  Branch (215:6): [True: 0, False: 7.34k]
  |  Branch (215:20): [True: 6.34k, False: 995]
  ------------------
  216|  6.34k|    return;
  217|       |
  218|    995|  rlimit_update(r, pts);
  219|    995|#if 8 <= SIZEOF_SIZE_T
  220|    995|  if(tokens > INT64_MAX) {
  ------------------
  |  Branch (220:6): [True: 0, False: 995]
  ------------------
  221|      0|    r->tokens = INT64_MAX;
  222|      0|  }
  223|    995|  else
  224|    995|#endif
  225|    995|  {
  226|    995|    int64_t val = (int64_t)tokens;
  227|    995|    if((INT64_MIN + val) < r->tokens)
  ------------------
  |  Branch (227:8): [True: 995, False: 0]
  ------------------
  228|    995|      r->tokens -= val;
  229|      0|    else
  230|      0|      r->tokens = INT64_MIN;
  231|    995|  }
  232|    995|}
Curl_rlimit_wait_ms:
  236|  8.12M|{
  237|  8.12M|  timediff_t wait_us, elapsed_us;
  238|       |
  239|  8.12M|  if(r->blocked || !r->rate_per_step)
  ------------------
  |  Branch (239:6): [True: 0, False: 8.12M]
  |  Branch (239:20): [True: 2.60M, False: 5.51M]
  ------------------
  240|  2.60M|    return 0;
  241|  5.51M|  rlimit_update(r, pts);
  242|  5.51M|  if(r->tokens > 0)
  ------------------
  |  Branch (242:6): [True: 5.51M, False: 287]
  ------------------
  243|  5.51M|    return 0;
  244|       |
  245|       |  /* How much time will it take tokens to become positive again?
  246|       |   * Deduct `spare_us` and check against already elapsed time */
  247|    287|  wait_us = r->step_us - r->spare_us;
  248|    287|  if(r->tokens < 0) {
  ------------------
  |  Branch (248:6): [True: 118, False: 169]
  ------------------
  249|    118|    curl_off_t debt_pct = ((-r->tokens) * 100 / r->rate_per_step);
  250|    118|    if(debt_pct)
  ------------------
  |  Branch (250:8): [True: 109, False: 9]
  ------------------
  251|    109|      wait_us += (r->step_us * debt_pct / 100);
  252|    118|  }
  253|       |
  254|    287|  elapsed_us = curlx_ptimediff_us(pts, &r->ts);
  255|    287|  if(elapsed_us >= wait_us)
  ------------------
  |  Branch (255:6): [True: 0, False: 287]
  ------------------
  256|      0|    return 0;
  257|    287|  wait_us -= elapsed_us;
  258|    287|  return (wait_us + 999) / 1000; /* in milliseconds */
  259|    287|}
Curl_rlimit_next_step_ms:
  263|  8.12M|{
  264|  8.12M|  if(!r->blocked && r->rate_per_step) {
  ------------------
  |  Branch (264:6): [True: 8.12M, False: 0]
  |  Branch (264:21): [True: 5.51M, False: 2.60M]
  ------------------
  265|  5.51M|    timediff_t elapsed_us, next_us;
  266|       |
  267|  5.51M|    elapsed_us = curlx_ptimediff_us(pts, &r->ts) + r->spare_us;
  268|  5.51M|    if(r->step_us > elapsed_us) {
  ------------------
  |  Branch (268:8): [True: 5.51M, False: 0]
  ------------------
  269|  5.51M|      next_us = r->step_us - elapsed_us;
  270|  5.51M|      return (next_us + 999) / 1000; /* in milliseconds */
  271|  5.51M|    }
  272|  5.51M|  }
  273|  2.60M|  return 0;
  274|  8.12M|}
Curl_rlimit_block:
  279|  31.1k|{
  280|  31.1k|  if(!activate == !r->blocked)
  ------------------
  |  Branch (280:6): [True: 31.1k, False: 0]
  ------------------
  281|  31.1k|    return;
  282|       |
  283|      0|  r->ts = *pts;
  284|      0|  r->blocked = activate;
  285|      0|  if(!r->blocked) {
  ------------------
  |  Branch (285:6): [True: 0, False: 0]
  ------------------
  286|       |    /* Start rate limiting fresh. The amount of time this was blocked
  287|       |     * does not generate extra tokens. */
  288|      0|    Curl_rlimit_start(r, pts, -1);
  289|      0|  }
  290|      0|  else {
  291|      0|    r->tokens = 0;
  292|      0|  }
  293|      0|}
ratelimit.c:rlimit_tune_steps:
   79|  2.49k|{
   80|  2.49k|  int64_t tokens_last, tokens_main, msteps;
   81|       |
   82|       |  /* Tune the ratelimit at the start *if* we know how many tokens
   83|       |   * are expected to be consumed in total.
   84|       |   * The reason for tuning is that rlimit provides tokens to be consumed
   85|       |   * per "step" which starts out to be a second. The tokens may be consumed
   86|       |   * in full at the beginning of a step. The remainder of the second will
   87|       |   * have no tokens available, effectively blocking the consumption and
   88|       |   * so keeping the "step average" in line.
   89|       |   * This works will up to the last step. When no more tokens are needed,
   90|       |   * no wait will happen and the last step would be too fast. This is
   91|       |   * especially noticeable when only a few steps are needed.
   92|       |   *
   93|       |   * Example: downloading 1.5kb with a ratelimit of 1k could be done in
   94|       |   * roughly 1 second (1k in the first second and the 0.5 at the start of
   95|       |   * the second one).
   96|       |   *
   97|       |   * The tuning tries to make the last step small, using only
   98|       |   * 1 percent of the total tokens (at least 1). The rest of the tokens
   99|       |   * are to be consumed in the steps before by adjusting the duration of
  100|       |   * the step and the amount of tokens it provides. */
  101|  2.49k|  if(!r->rate_per_step ||
  ------------------
  |  Branch (101:6): [True: 2.16k, False: 330]
  ------------------
  102|    330|     (tokens_total <= 1) ||
  ------------------
  |  Branch (102:6): [True: 230, False: 100]
  ------------------
  103|    100|     (tokens_total > (INT64_MAX / 1000)))
  ------------------
  |  Branch (103:6): [True: 20, False: 80]
  ------------------
  104|  2.41k|    return;
  105|       |
  106|       |  /* Calculate tokens for the last step and the ones before. */
  107|     80|  tokens_last = tokens_total / 100;
  108|     80|  if(!tokens_last) /* less than 100 total, use 1 */
  ------------------
  |  Branch (108:6): [True: 3, False: 77]
  ------------------
  109|      3|    tokens_last = 1;
  110|     77|  else if(tokens_last > CURL_RLIMIT_MIN_RATE)
  ------------------
  |  |   30|     77|#define CURL_RLIMIT_MIN_RATE    (4 * 1024)  /* minimum step rate */
  ------------------
  |  Branch (110:11): [True: 66, False: 11]
  ------------------
  111|     66|    tokens_last = CURL_RLIMIT_MIN_RATE;
  ------------------
  |  |   30|     66|#define CURL_RLIMIT_MIN_RATE    (4 * 1024)  /* minimum step rate */
  ------------------
  112|     80|  DEBUGASSERT(tokens_last);
  ------------------
  |  | 1081|     80|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (112:3): [True: 0, False: 80]
  |  Branch (112:3): [True: 80, False: 0]
  ------------------
  113|     80|  tokens_main = tokens_total - tokens_last;
  114|     80|  DEBUGASSERT(tokens_main);
  ------------------
  |  | 1081|     80|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (114:3): [True: 0, False: 80]
  |  Branch (114:3): [True: 80, False: 0]
  ------------------
  115|       |
  116|       |  /* how many milli-steps will it take to consume those, give the
  117|       |  * original rate limit per second? */
  118|     80|  DEBUGASSERT(r->step_us == CURL_US_PER_SEC);
  ------------------
  |  | 1081|     80|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (118:3): [True: 0, False: 80]
  |  Branch (118:3): [True: 80, False: 0]
  ------------------
  119|       |
  120|     80|  msteps = (tokens_main * 1000 / r->rate_per_step);
  121|     80|  if(msteps < CURL_RLIMIT_STEP_MIN_MS) {
  ------------------
  |  |   31|     80|#define CURL_RLIMIT_STEP_MIN_MS 2  /* minimum step duration */
  ------------------
  |  Branch (121:6): [True: 5, False: 75]
  ------------------
  122|       |    /* Steps this small will not work. Do not tune. */
  123|      5|    return;
  124|      5|  }
  125|     75|  else if(msteps < 1000) {
  ------------------
  |  Branch (125:11): [True: 6, False: 69]
  ------------------
  126|       |    /* It needs less than one step to provide the needed tokens.
  127|       |     * Make it exactly that long and with exactly those tokens. */
  128|      6|    r->step_us = (timediff_t)msteps * 1000;
  129|      6|    r->rate_per_step = tokens_main;
  130|      6|    r->tokens = r->rate_per_step;
  131|      6|  }
  132|     69|  else {
  133|       |    /* More than 1 step. Spread the remainder milli steps and
  134|       |     * the tokens they need to provide across all steps. If integer
  135|       |     * arithmetic can do it. */
  136|     69|    curl_off_t ms_unaccounted = (msteps % 1000);
  137|     69|    curl_off_t mstep_inc = (ms_unaccounted / (msteps / 1000));
  138|     69|    if(mstep_inc) {
  ------------------
  |  Branch (138:8): [True: 6, False: 63]
  ------------------
  139|      6|      curl_off_t rate_inc = ((r->rate_per_step * mstep_inc) / 1000);
  140|      6|      if(rate_inc) {
  ------------------
  |  Branch (140:10): [True: 5, False: 1]
  ------------------
  141|      5|        r->step_us = CURL_US_PER_SEC + ((timediff_t)mstep_inc * 1000);
  ------------------
  |  |   29|      5|#define CURL_US_PER_SEC         1000000
  ------------------
  142|      5|        r->rate_per_step += rate_inc;
  143|      5|        r->tokens = r->rate_per_step;
  144|      5|      }
  145|      6|    }
  146|     69|  }
  147|       |
  148|     75|  if(r->burst_per_step)
  ------------------
  |  Branch (148:6): [True: 75, False: 0]
  ------------------
  149|     75|    r->burst_per_step = r->rate_per_step;
  150|     75|}
ratelimit.c:rlimit_update:
   35|  13.9M|{
   36|  13.9M|  timediff_t elapsed_us, elapsed_steps;
   37|  13.9M|  int64_t token_gain;
   38|       |
   39|  13.9M|  DEBUGASSERT(r->rate_per_step);
  ------------------
  |  | 1081|  13.9M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (39:3): [True: 0, False: 13.9M]
  |  Branch (39:3): [True: 13.9M, False: 0]
  ------------------
   40|  13.9M|  if((r->ts.tv_sec == pts->tv_sec) && (r->ts.tv_usec == pts->tv_usec))
  ------------------
  |  Branch (40:6): [True: 12.9M, False: 1.02M]
  |  Branch (40:39): [True: 180, False: 12.9M]
  ------------------
   41|    180|    return;
   42|       |
   43|  13.9M|  elapsed_us = curlx_ptimediff_us(pts, &r->ts);
   44|  13.9M|  if(elapsed_us < 0) { /* not going back in time */
  ------------------
  |  Branch (44:6): [True: 0, False: 13.9M]
  ------------------
   45|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (45:5): [Folded, False: 0]
  |  Branch (45:5): [Folded, False: 0]
  ------------------
   46|      0|    return;
   47|      0|  }
   48|       |
   49|  13.9M|  elapsed_us += r->spare_us;
   50|  13.9M|  if(elapsed_us < r->step_us)
  ------------------
  |  Branch (50:6): [True: 13.9M, False: 0]
  ------------------
   51|  13.9M|    return;
   52|       |
   53|       |  /* we do the update */
   54|      0|  r->ts = *pts;
   55|      0|  elapsed_steps = elapsed_us / r->step_us;
   56|      0|  r->spare_us = elapsed_us % r->step_us;
   57|       |
   58|       |  /* How many tokens did we gain since the last update? */
   59|      0|  if(r->rate_per_step > (INT64_MAX / elapsed_steps))
  ------------------
  |  Branch (59:6): [True: 0, False: 0]
  ------------------
   60|      0|    token_gain = INT64_MAX;
   61|      0|  else {
   62|      0|    token_gain = r->rate_per_step * elapsed_steps;
   63|      0|  }
   64|       |
   65|      0|  if((INT64_MAX - token_gain) > r->tokens)
  ------------------
  |  Branch (65:6): [True: 0, False: 0]
  ------------------
   66|      0|    r->tokens += token_gain;
   67|      0|  else
   68|      0|    r->tokens = INT64_MAX;
   69|       |
   70|       |  /* Limit the token again by the burst rate (if set), so we
   71|       |   * do not suddenly have a huge number of tokens after inactivity. */
   72|      0|  if(r->burst_per_step && (r->tokens > r->burst_per_step)) {
  ------------------
  |  Branch (72:6): [True: 0, False: 0]
  |  Branch (72:27): [True: 0, False: 0]
  ------------------
   73|      0|    r->tokens = r->burst_per_step;
   74|      0|  }
   75|      0|}

Curl_req_init:
   39|  36.6k|{
   40|  36.6k|  memset(req, 0, sizeof(*req));
   41|  36.6k|}
Curl_req_soft_reset:
   45|  21.3k|{
   46|  21.3k|  CURLcode result;
   47|       |
   48|  21.3k|  req->done = FALSE;
  ------------------
  |  | 1058|  21.3k|#define FALSE false
  ------------------
   49|  21.3k|  req->upload_done = FALSE;
  ------------------
  |  | 1058|  21.3k|#define FALSE false
  ------------------
   50|  21.3k|  req->upload_aborted = FALSE;
  ------------------
  |  | 1058|  21.3k|#define FALSE false
  ------------------
   51|  21.3k|  req->download_done = FALSE;
  ------------------
  |  | 1058|  21.3k|#define FALSE false
  ------------------
   52|  21.3k|  req->eos_written = FALSE;
  ------------------
  |  | 1058|  21.3k|#define FALSE false
  ------------------
   53|  21.3k|  req->eos_read = FALSE;
  ------------------
  |  | 1058|  21.3k|#define FALSE false
  ------------------
   54|  21.3k|  req->eos_sent = FALSE;
  ------------------
  |  | 1058|  21.3k|#define FALSE false
  ------------------
   55|  21.3k|  req->ignorebody = FALSE;
  ------------------
  |  | 1058|  21.3k|#define FALSE false
  ------------------
   56|  21.3k|  req->shutdown = FALSE;
  ------------------
  |  | 1058|  21.3k|#define FALSE false
  ------------------
   57|  21.3k|  req->bytecount = 0;
   58|  21.3k|  req->writebytecount = 0;
   59|  21.3k|  req->header = FALSE;
  ------------------
  |  | 1058|  21.3k|#define FALSE false
  ------------------
   60|  21.3k|  req->headerline = 0;
   61|  21.3k|  req->headerbytecount = 0;
   62|  21.3k|  req->allheadercount = 0;
   63|  21.3k|  req->deductheadercount = 0;
   64|  21.3k|  req->httpversion_sent = 0;
   65|  21.3k|  req->httpversion = 0;
   66|  21.3k|  req->sendbuf_hds_len = 0;
   67|       |
   68|  21.3k|  curlx_safefree(req->hd_auth);
  ------------------
  |  | 1327|  21.3k|  do {                      \
  |  | 1328|  21.3k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  21.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  21.3k|    (ptr) = NULL;           \
  |  | 1330|  21.3k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 21.3k]
  |  |  ------------------
  ------------------
   69|  21.3k|#ifndef CURL_DISABLE_PROXY
   70|  21.3k|  curlx_safefree(req->hd_proxy_auth);
  ------------------
  |  | 1327|  21.3k|  do {                      \
  |  | 1328|  21.3k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  21.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  21.3k|    (ptr) = NULL;           \
  |  | 1330|  21.3k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 21.3k]
  |  |  ------------------
  ------------------
   71|  21.3k|#endif
   72|       |
   73|  21.3k|  result = Curl_client_start(data);
   74|  21.3k|  if(result)
  ------------------
  |  Branch (74:6): [True: 62, False: 21.2k]
  ------------------
   75|     62|    return result;
   76|       |
   77|  21.2k|  if(!req->sendbuf_init) {
  ------------------
  |  Branch (77:6): [True: 12.8k, False: 8.39k]
  ------------------
   78|  12.8k|    Curl_bufq_init2(&req->sendbuf, data->set.upload_buffer_size, 1,
   79|  12.8k|                    BUFQ_OPT_SOFT_LIMIT);
  ------------------
  |  |  111|  12.8k|#define BUFQ_OPT_SOFT_LIMIT  (1 << 0)
  ------------------
   80|  12.8k|    req->sendbuf_init = TRUE;
  ------------------
  |  | 1055|  12.8k|#define TRUE true
  ------------------
   81|  12.8k|  }
   82|  8.39k|  else {
   83|  8.39k|    Curl_bufq_reset(&req->sendbuf);
   84|  8.39k|    if(data->set.upload_buffer_size != req->sendbuf.chunk_size) {
  ------------------
  |  Branch (84:8): [True: 0, False: 8.39k]
  ------------------
   85|      0|      Curl_bufq_free(&req->sendbuf);
   86|      0|      Curl_bufq_init2(&req->sendbuf, data->set.upload_buffer_size, 1,
   87|      0|                      BUFQ_OPT_SOFT_LIMIT);
  ------------------
  |  |  111|      0|#define BUFQ_OPT_SOFT_LIMIT  (1 << 0)
  ------------------
   88|      0|    }
   89|  8.39k|  }
   90|       |
   91|  21.2k|  return CURLE_OK;
   92|  21.3k|}
Curl_req_start:
   96|  13.8k|{
   97|  13.8k|  req->start = *Curl_pgrs_now(data);
   98|  13.8k|  return Curl_req_soft_reset(req, data);
   99|  13.8k|}
Curl_req_done:
  105|  2.05k|{
  106|  2.05k|  (void)req;
  107|  2.05k|  if(!aborted)
  ------------------
  |  Branch (107:6): [True: 1.61k, False: 441]
  ------------------
  108|  1.61k|    (void)req_flush(data);
  109|  2.05k|  Curl_client_reset(data);
  110|  2.05k|  return CURLE_OK;
  111|  2.05k|}
Curl_req_hard_reset:
  114|  15.5k|{
  115|  15.5k|  struct curltime t0 = { 0, 0 };
  116|       |
  117|  15.5k|  curlx_safefree(req->newurl);
  ------------------
  |  | 1327|  15.5k|  do {                      \
  |  | 1328|  15.5k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  15.5k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  15.5k|    (ptr) = NULL;           \
  |  | 1330|  15.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
  118|  15.5k|  curlx_safefree(req->hd_auth);
  ------------------
  |  | 1327|  15.5k|  do {                      \
  |  | 1328|  15.5k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  15.5k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  15.5k|    (ptr) = NULL;           \
  |  | 1330|  15.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
  119|  15.5k|#ifndef CURL_DISABLE_PROXY
  120|  15.5k|  curlx_safefree(req->hd_proxy_auth);
  ------------------
  |  | 1327|  15.5k|  do {                      \
  |  | 1328|  15.5k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  15.5k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  15.5k|    (ptr) = NULL;           \
  |  | 1330|  15.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
  121|  15.5k|#endif
  122|  15.5k|#ifndef CURL_DISABLE_COOKIES
  123|  15.5k|  curlx_safefree(req->cookiehost);
  ------------------
  |  | 1327|  15.5k|  do {                      \
  |  | 1328|  15.5k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  15.5k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  15.5k|    (ptr) = NULL;           \
  |  | 1330|  15.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
  124|  15.5k|#endif
  125|  15.5k|  Curl_client_reset(data);
  126|  15.5k|  if(req->sendbuf_init)
  ------------------
  |  Branch (126:6): [True: 984, False: 14.6k]
  ------------------
  127|    984|    Curl_bufq_reset(&req->sendbuf);
  128|       |
  129|       |  /* clear any resolve data */
  130|  15.5k|  Curl_resolv_destroy_all(data);
  131|       |  /* Can no longer memset() this struct as we need to keep some state */
  132|  15.5k|  req->size = -1;
  133|  15.5k|  req->maxdownload = -1;
  134|  15.5k|  req->bytecount = 0;
  135|  15.5k|  req->writebytecount = 0;
  136|  15.5k|  req->start = t0;
  137|  15.5k|  req->headerbytecount = 0;
  138|  15.5k|  req->allheadercount = 0;
  139|  15.5k|  req->deductheadercount = 0;
  140|  15.5k|  req->headerline = 0;
  141|  15.5k|  req->offset = 0;
  142|  15.5k|  req->httpcode = 0;
  143|  15.5k|  req->io_flags = 0;
  144|  15.5k|  req->upgr101 = UPGR101_NONE;
  145|  15.5k|  req->sendbuf_hds_len = 0;
  146|  15.5k|  req->timeofdoc = 0;
  147|  15.5k|  req->location = NULL;
  148|  15.5k|  req->newurl = NULL;
  149|  15.5k|#ifndef CURL_DISABLE_COOKIES
  150|  15.5k|  req->setcookies = 0;
  151|  15.5k|#endif
  152|  15.5k|  req->header = FALSE;
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
  153|  15.5k|  req->content_range = FALSE;
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
  154|  15.5k|  req->download_done = FALSE;
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
  155|  15.5k|  req->eos_written = FALSE;
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
  156|  15.5k|  req->eos_read = FALSE;
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
  157|  15.5k|  req->eos_sent = FALSE;
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
  158|  15.5k|  req->rewind_read = FALSE;
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
  159|  15.5k|  req->upload_done = FALSE;
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
  160|  15.5k|  req->upload_aborted = FALSE;
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
  161|  15.5k|  req->ignorebody = FALSE;
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
  162|  15.5k|  req->http_bodyless = FALSE;
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
  163|  15.5k|  req->chunk = FALSE;
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
  164|  15.5k|  req->resp_trailer = FALSE;
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
  165|  15.5k|  req->ignore_cl = FALSE;
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
  166|  15.5k|  req->upload_chunky = FALSE;
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
  167|  15.5k|  req->no_body = data->set.opt_no_body;
  168|  15.5k|  req->authneg = FALSE;
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
  169|  15.5k|  req->shutdown = FALSE;
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
  170|       |  /* Unpause all directions */
  171|  15.5k|  Curl_rlimit_block(&data->progress.dl.rlimit, FALSE, &t0);
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
  172|       |  Curl_rlimit_block(&data->progress.ul.rlimit, FALSE, &t0);
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
  173|  15.5k|}
Curl_req_free:
  176|  36.6k|{
  177|  36.6k|  curlx_safefree(req->newurl);
  ------------------
  |  | 1327|  36.6k|  do {                      \
  |  | 1328|  36.6k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  36.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  36.6k|    (ptr) = NULL;           \
  |  | 1330|  36.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 36.6k]
  |  |  ------------------
  ------------------
  178|  36.6k|  curlx_safefree(req->hd_auth);
  ------------------
  |  | 1327|  36.6k|  do {                      \
  |  | 1328|  36.6k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  36.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  36.6k|    (ptr) = NULL;           \
  |  | 1330|  36.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 36.6k]
  |  |  ------------------
  ------------------
  179|  36.6k|#ifndef CURL_DISABLE_PROXY
  180|  36.6k|  curlx_safefree(req->hd_proxy_auth);
  ------------------
  |  | 1327|  36.6k|  do {                      \
  |  | 1328|  36.6k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  36.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  36.6k|    (ptr) = NULL;           \
  |  | 1330|  36.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 36.6k]
  |  |  ------------------
  ------------------
  181|  36.6k|#endif
  182|  36.6k|  if(req->sendbuf_init)
  ------------------
  |  Branch (182:6): [True: 12.8k, False: 23.7k]
  ------------------
  183|  12.8k|    Curl_bufq_free(&req->sendbuf);
  184|  36.6k|  Curl_client_cleanup(data);
  185|  36.6k|}
Curl_req_send:
  382|  6.82k|{
  383|  6.82k|  CURLcode result;
  384|  6.82k|  const char *buf;
  385|  6.82k|  size_t blen, nwritten;
  386|       |
  387|  6.82k|  if(!data || !data->conn)
  ------------------
  |  Branch (387:6): [True: 0, False: 6.82k]
  |  Branch (387:15): [True: 0, False: 6.82k]
  ------------------
  388|      0|    return CURLE_FAILED_INIT;
  389|       |
  390|  6.82k|  data->req.httpversion_sent = httpversion;
  391|  6.82k|  buf = curlx_dyn_ptr(req);
  392|  6.82k|  blen = curlx_dyn_len(req);
  393|       |  /* if the sendbuf is empty and the request without body and
  394|       |   * the length to send fits info a sendbuf chunk, we send it directly.
  395|       |   * If `blen` is larger then `chunk_size`, we can not. Because we
  396|       |   * might have to retry a blocked send later from sendbuf and that
  397|       |   * would result in retry sends with a shrunken length. That is trouble. */
  398|  6.82k|  if(Curl_bufq_is_empty(&data->req.sendbuf) &&
  ------------------
  |  Branch (398:6): [True: 6.82k, False: 0]
  ------------------
  399|  6.82k|     !Curl_creader_total_length(data) &&
  ------------------
  |  Branch (399:6): [True: 5.95k, False: 866]
  ------------------
  400|  5.95k|     (blen <= data->req.sendbuf.chunk_size)) {
  ------------------
  |  Branch (400:6): [True: 5.93k, False: 20]
  ------------------
  401|  5.93k|    data->req.eos_read = TRUE;
  ------------------
  |  | 1055|  5.93k|#define TRUE true
  ------------------
  402|  5.93k|    result = xfer_send(data, buf, blen, blen, &nwritten);
  403|  5.93k|    if(result)
  ------------------
  |  Branch (403:8): [True: 28, False: 5.90k]
  ------------------
  404|     28|      return result;
  405|  5.90k|    buf += nwritten;
  406|  5.90k|    blen -= nwritten;
  407|  5.90k|    if(!blen) {
  ------------------
  |  Branch (407:8): [True: 5.90k, False: 0]
  ------------------
  408|  5.90k|      result = req_set_upload_done(data);
  409|  5.90k|      if(result)
  ------------------
  |  Branch (409:10): [True: 0, False: 5.90k]
  ------------------
  410|      0|        return result;
  411|  5.90k|    }
  412|  5.90k|  }
  413|       |
  414|  6.79k|  if(blen) {
  ------------------
  |  Branch (414:6): [True: 886, False: 5.90k]
  ------------------
  415|       |    /* Either we have a request body, or we could not send the complete
  416|       |     * request in one go. Buffer the remainder and try to add as much
  417|       |     * body bytes as room is left in the buffer. Then flush. */
  418|    886|    result = req_send_buffer_add(data, buf, blen, blen);
  419|    886|    if(result)
  ------------------
  |  Branch (419:8): [True: 0, False: 886]
  ------------------
  420|      0|      return result;
  421|       |
  422|    886|    return Curl_req_send_more(data);
  423|    886|  }
  424|  5.90k|  return CURLE_OK;
  425|  6.79k|}
Curl_req_sendbuf_empty:
  428|  11.9M|{
  429|  11.9M|  return !data->req.sendbuf_init || Curl_bufq_is_empty(&data->req.sendbuf);
  ------------------
  |  Branch (429:10): [True: 0, False: 11.9M]
  |  Branch (429:37): [True: 11.9M, False: 57]
  ------------------
  430|  11.9M|}
Curl_req_want_send:
  433|  12.5M|{
  434|       |  /* Not done and upload not blocked and either one of
  435|       |   * - REQ_IO_SEND
  436|       |   * - request has buffered data to send
  437|       |   * - connection has pending data to send */
  438|  12.5M|  return !data->req.done &&
  ------------------
  |  Branch (438:10): [True: 12.5M, False: 0]
  ------------------
  439|  12.5M|         !Curl_rlimit_is_blocked(&data->progress.ul.rlimit) &&
  ------------------
  |  Branch (439:10): [True: 12.5M, False: 0]
  ------------------
  440|  12.5M|         (CURL_REQ_WANT_SEND(data) ||
  ------------------
  |  |   39|  25.0M|#define CURL_REQ_WANT_SEND(d)  ((d)->req.io_flags & REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|  12.5M|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  |  |  |  Branch (39:32): [True: 546k, False: 11.9M]
  |  |  ------------------
  ------------------
  441|  11.9M|          !Curl_req_sendbuf_empty(data) ||
  ------------------
  |  Branch (441:11): [True: 0, False: 11.9M]
  ------------------
  442|  11.9M|          Curl_xfer_needs_flush(data));
  ------------------
  |  Branch (442:11): [True: 11.9M, False: 19.1k]
  ------------------
  443|  12.5M|}
Curl_req_want_recv:
  446|     64|{
  447|       |  /* Not done and download not blocked and want RECV */
  448|     64|  return !data->req.done &&
  ------------------
  |  Branch (448:10): [True: 64, False: 0]
  ------------------
  449|     64|         !Curl_rlimit_is_blocked(&data->progress.dl.rlimit) &&
  ------------------
  |  Branch (449:10): [True: 64, False: 0]
  ------------------
  450|     64|         CURL_REQ_WANT_RECV(data);
  ------------------
  |  |   40|    128|#define CURL_REQ_WANT_RECV(d)  ((d)->req.io_flags & REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|     64|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  |  |  |  Branch (40:32): [True: 2, False: 62]
  |  |  ------------------
  ------------------
  451|     64|}
Curl_req_done_sending:
  454|  6.51M|{
  455|  6.51M|  return data->req.upload_done && !Curl_req_want_send(data);
  ------------------
  |  Branch (455:10): [True: 5.97M, False: 546k]
  |  Branch (455:35): [True: 47, False: 5.97M]
  ------------------
  456|  6.51M|}
Curl_req_send_more:
  459|  3.25M|{
  460|  3.25M|  CURLcode result;
  461|       |
  462|       |  /* Fill our send buffer if more from client can be read. */
  463|  3.25M|  if(!data->req.upload_aborted &&
  ------------------
  |  Branch (463:6): [True: 3.25M, False: 0]
  ------------------
  464|  3.25M|     !data->req.eos_read &&
  ------------------
  |  Branch (464:6): [True: 150k, False: 3.10M]
  ------------------
  465|   150k|     !Curl_xfer_send_is_paused(data) &&
  ------------------
  |  Branch (465:6): [True: 150k, False: 0]
  ------------------
  466|   150k|     !Curl_bufq_is_full(&data->req.sendbuf)) {
  ------------------
  |  Branch (466:6): [True: 1.55k, False: 148k]
  ------------------
  467|  1.55k|    size_t nread;
  468|  1.55k|    result = Curl_bufq_sipn(&data->req.sendbuf, 0,
  469|  1.55k|                            add_from_client, data, &nread);
  470|  1.55k|    if(result && result != CURLE_AGAIN)
  ------------------
  |  Branch (470:8): [True: 11, False: 1.54k]
  |  Branch (470:18): [True: 11, False: 0]
  ------------------
  471|     11|      return result;
  472|  1.55k|  }
  473|       |
  474|  3.25M|  result = req_flush(data);
  475|  3.25M|  if(result == CURLE_AGAIN)
  ------------------
  |  Branch (475:6): [True: 272k, False: 2.98M]
  ------------------
  476|   272k|    result = CURLE_OK;
  477|       |
  478|  3.25M|  return result;
  479|  3.25M|}
Curl_req_abort_sending:
  482|     28|{
  483|     28|  if(!data->req.upload_done) {
  ------------------
  |  Branch (483:6): [True: 28, False: 0]
  ------------------
  484|     28|    Curl_bufq_reset(&data->req.sendbuf);
  485|     28|    data->req.upload_aborted = TRUE;
  ------------------
  |  | 1055|     28|#define TRUE true
  ------------------
  486|     28|    CURL_REQ_CLEAR_SEND(data);
  ------------------
  |  |   47|     28|  ((d)->req.io_flags &= (uint8_t)~REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|     28|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  ------------------
  487|     28|    return req_set_upload_done(data);
  488|     28|  }
  489|      0|  return CURLE_OK;
  490|     28|}
Curl_req_stop_send_recv:
  493|  1.63k|{
  494|       |  /* stop receiving and ALL sending as well, including PAUSE and HOLD.
  495|       |   * We might still be paused on receive client writes though, so
  496|       |   * keep those bits around. */
  497|  1.63k|  CURLcode result = CURLE_OK;
  498|  1.63k|  if(CURL_REQ_WANT_SEND(data))
  ------------------
  |  |   39|  1.63k|#define CURL_REQ_WANT_SEND(d)  ((d)->req.io_flags & REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|  1.63k|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  |  |  |  Branch (39:32): [True: 21, False: 1.61k]
  |  |  ------------------
  ------------------
  499|     21|    result = Curl_req_abort_sending(data);
  500|  1.63k|  CURL_REQ_CLEAR_IO(data);
  ------------------
  |  |   51|  1.63k|  ((d)->req.io_flags &= (uint8_t)~(REQ_IO_RECV | REQ_IO_SEND))
  |  |  ------------------
  |  |  |  |   35|  1.63k|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  |  |                 ((d)->req.io_flags &= (uint8_t)~(REQ_IO_RECV | REQ_IO_SEND))
  |  |  ------------------
  |  |  |  |   36|  1.63k|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  ------------------
  501|  1.63k|  return result;
  502|  1.63k|}
request.c:req_flush:
  299|  3.26M|{
  300|  3.26M|  CURLcode result;
  301|       |
  302|  3.26M|  if(!data || !data->conn)
  ------------------
  |  Branch (302:6): [True: 0, False: 3.26M]
  |  Branch (302:15): [True: 0, False: 3.26M]
  ------------------
  303|      0|    return CURLE_FAILED_INIT;
  304|       |
  305|  3.26M|  if(!Curl_bufq_is_empty(&data->req.sendbuf)) {
  ------------------
  |  Branch (305:6): [True: 273k, False: 2.98M]
  ------------------
  306|   273k|    result = req_send_buffer_flush(data);
  307|   273k|    if(result)
  ------------------
  |  Branch (307:8): [True: 12, False: 273k]
  ------------------
  308|     12|      return result;
  309|   273k|    if(!Curl_bufq_is_empty(&data->req.sendbuf)) {
  ------------------
  |  Branch (309:8): [True: 272k, False: 1.03k]
  ------------------
  310|   272k|      DEBUGF(infof(data, "Curl_req_flush(len=%zu) -> EAGAIN",
  ------------------
  |  | 1067|  1.90M|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 272k, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 272k]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 272k]
  |  |  ------------------
  ------------------
  311|   272k|                   Curl_bufq_len(&data->req.sendbuf)));
  312|   272k|      return CURLE_AGAIN;
  313|   272k|    }
  314|   273k|  }
  315|  2.98M|  else if(Curl_xfer_needs_flush(data)) {
  ------------------
  |  Branch (315:11): [True: 2.98M, False: 2.11k]
  ------------------
  316|  2.98M|    DEBUGF(infof(data, "Curl_req_flush(), xfer send_pending"));
  ------------------
  |  | 1067|  20.8M|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 2.98M, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 2.98M]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 2.98M]
  |  |  ------------------
  ------------------
  317|  2.98M|    return Curl_xfer_flush(data);
  318|  2.98M|  }
  319|       |
  320|  3.14k|  if(data->req.eos_read && !data->req.eos_sent) {
  ------------------
  |  Branch (320:6): [True: 2.00k, False: 1.14k]
  |  Branch (320:28): [True: 25, False: 1.97k]
  ------------------
  321|     25|    char tmp = 0;
  322|     25|    size_t nwritten;
  323|     25|    result = xfer_send(data, &tmp, 0, 0, &nwritten);
  324|     25|    if(result)
  ------------------
  |  Branch (324:8): [True: 2, False: 23]
  ------------------
  325|      2|      return result;
  326|     23|    DEBUGASSERT(data->req.eos_sent);
  ------------------
  |  | 1081|     23|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (326:5): [True: 0, False: 23]
  |  Branch (326:5): [True: 23, False: 0]
  ------------------
  327|     23|  }
  328|       |
  329|  3.14k|  if(!data->req.upload_done && data->req.eos_read && data->req.eos_sent) {
  ------------------
  |  Branch (329:6): [True: 1.89k, False: 1.25k]
  |  Branch (329:32): [True: 772, False: 1.11k]
  |  Branch (329:54): [True: 772, False: 0]
  ------------------
  330|    772|    DEBUGASSERT(Curl_bufq_is_empty(&data->req.sendbuf));
  ------------------
  |  | 1081|    772|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (330:5): [True: 0, False: 772]
  |  Branch (330:5): [True: 772, False: 0]
  ------------------
  331|    772|    if(data->req.shutdown) {
  ------------------
  |  Branch (331:8): [True: 27, False: 745]
  ------------------
  332|     27|      bool done;
  333|     27|      result = Curl_xfer_send_shutdown(data, &done);
  334|     27|      if(result && data->req.shutdown_err_ignore) {
  ------------------
  |  Branch (334:10): [True: 0, False: 27]
  |  Branch (334:20): [True: 0, False: 0]
  ------------------
  335|      0|        infof(data, "Shutdown send direction error: %d. Broken server? "
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  336|      0|              "Proceeding as if everything is ok.", result);
  337|      0|        result = CURLE_OK;
  338|      0|        done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  339|      0|      }
  340|       |
  341|     27|      if(result)
  ------------------
  |  Branch (341:10): [True: 0, False: 27]
  ------------------
  342|      0|        return result;
  343|     27|      if(!done)
  ------------------
  |  Branch (343:10): [True: 0, False: 27]
  ------------------
  344|      0|        return CURLE_AGAIN;
  345|     27|    }
  346|    772|    return req_set_upload_done(data);
  347|    772|  }
  348|  2.37k|  return CURLE_OK;
  349|  3.14k|}
request.c:req_send_buffer_flush:
  245|   273k|{
  246|   273k|  CURLcode result = CURLE_OK;
  247|   273k|  const unsigned char *buf;
  248|   273k|  size_t blen;
  249|       |
  250|   274k|  while(Curl_bufq_peek(&data->req.sendbuf, &buf, &blen)) {
  ------------------
  |  Branch (250:9): [True: 273k, False: 1.03k]
  ------------------
  251|   273k|    size_t nwritten, hds_len = CURLMIN(data->req.sendbuf_hds_len, blen);
  ------------------
  |  | 1287|   273k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 273k, False: 104]
  |  |  ------------------
  ------------------
  252|   273k|    result = xfer_send(data, (const char *)buf, blen, hds_len, &nwritten);
  253|   273k|    if(result)
  ------------------
  |  Branch (253:8): [True: 12, False: 273k]
  ------------------
  254|     12|      break;
  255|       |
  256|   273k|    Curl_bufq_skip(&data->req.sendbuf, nwritten);
  257|   273k|    if(hds_len) {
  ------------------
  |  Branch (257:8): [True: 901, False: 272k]
  ------------------
  258|    901|      data->req.sendbuf_hds_len -= CURLMIN(hds_len, nwritten);
  ------------------
  |  | 1287|    901|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 797, False: 104]
  |  |  ------------------
  ------------------
  259|    901|    }
  260|       |    /* leave if we could not send all. Maybe network blocking or
  261|       |     * speed limits on transfer */
  262|   273k|    if(nwritten < blen)
  ------------------
  |  Branch (262:8): [True: 272k, False: 1.05k]
  ------------------
  263|   272k|      break;
  264|   273k|  }
  265|   273k|  return result;
  266|   273k|}
request.c:xfer_send:
  190|   279k|{
  191|   279k|  CURLcode result = CURLE_OK;
  192|   279k|  bool eos = FALSE;
  ------------------
  |  | 1058|   279k|#define FALSE false
  ------------------
  193|       |
  194|   279k|  *pnwritten = 0;
  195|   279k|  DEBUGASSERT(hds_len <= blen);
  ------------------
  |  | 1081|   279k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (195:3): [True: 0, False: 279k]
  |  Branch (195:3): [True: 279k, False: 0]
  ------------------
  196|   279k|#ifdef DEBUGBUILD
  197|   279k|  {
  198|       |    /* Allow debug builds to override this logic to force short initial
  199|       |       sends */
  200|   279k|    size_t body_len = blen - hds_len;
  201|   279k|    if(body_len) {
  ------------------
  |  Branch (201:8): [True: 273k, False: 6.06k]
  ------------------
  202|   273k|      const char *p = getenv("CURL_SMALLREQSEND");
  203|   273k|      if(p) {
  ------------------
  |  Branch (203:10): [True: 0, False: 273k]
  ------------------
  204|      0|        curl_off_t body_small;
  205|      0|        if(!curlx_str_number(&p, &body_small, body_len))
  ------------------
  |  Branch (205:12): [True: 0, False: 0]
  ------------------
  206|      0|          blen = hds_len + (size_t)body_small;
  207|      0|      }
  208|   273k|    }
  209|   279k|  }
  210|   279k|#endif
  211|       |  /* Make sure this does not send more body bytes than what the max send
  212|       |     speed says. The headers do not count to the max speed. */
  213|   279k|  if(data->set.max_send_speed) {
  ------------------
  |  Branch (213:6): [True: 302, False: 279k]
  ------------------
  214|    302|    size_t body_bytes = blen - hds_len;
  215|    302|    if((curl_off_t)body_bytes > data->set.max_send_speed)
  ------------------
  |  Branch (215:8): [True: 0, False: 302]
  ------------------
  216|      0|      blen = hds_len + (size_t)data->set.max_send_speed;
  217|    302|  }
  218|       |
  219|   279k|  if(data->req.eos_read &&
  ------------------
  |  Branch (219:6): [True: 130k, False: 148k]
  ------------------
  220|   130k|    (Curl_bufq_is_empty(&data->req.sendbuf) ||
  ------------------
  |  Branch (220:6): [True: 5.96k, False: 124k]
  ------------------
  221|   130k|     Curl_bufq_len(&data->req.sendbuf) == blen)) {
  ------------------
  |  Branch (221:6): [True: 124k, False: 0]
  ------------------
  222|   130k|    DEBUGF(infof(data, "sending last upload chunk of %zu bytes", blen));
  ------------------
  |  | 1067|   916k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 130k, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 130k]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 130k]
  |  |  ------------------
  ------------------
  223|   130k|    eos = TRUE;
  ------------------
  |  | 1055|   130k|#define TRUE true
  ------------------
  224|   130k|  }
  225|   279k|  result = Curl_xfer_send(data, buf, blen, eos, pnwritten);
  226|   279k|  if(!result) {
  ------------------
  |  Branch (226:6): [True: 279k, False: 42]
  ------------------
  227|   279k|    if(eos && (blen == *pnwritten))
  ------------------
  |  Branch (227:8): [True: 130k, False: 148k]
  |  Branch (227:15): [True: 6.67k, False: 124k]
  ------------------
  228|  6.67k|      data->req.eos_sent = TRUE;
  ------------------
  |  | 1055|  6.67k|#define TRUE true
  ------------------
  229|   279k|    if(*pnwritten) {
  ------------------
  |  Branch (229:8): [True: 6.97k, False: 272k]
  ------------------
  230|  6.97k|      if(hds_len)
  ------------------
  |  Branch (230:10): [True: 6.80k, False: 165]
  ------------------
  231|  6.80k|        Curl_debug(data, CURLINFO_HEADER_OUT, buf,
  232|  6.80k|                   CURLMIN(hds_len, *pnwritten));
  ------------------
  |  | 1287|  6.80k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 797, False: 6.01k]
  |  |  ------------------
  ------------------
  233|  6.97k|      if(*pnwritten > hds_len) {
  ------------------
  |  Branch (233:10): [True: 962, False: 6.01k]
  ------------------
  234|    962|        size_t body_len = *pnwritten - hds_len;
  235|    962|        Curl_debug(data, CURLINFO_DATA_OUT, buf + hds_len, body_len);
  236|    962|        data->req.writebytecount += body_len;
  237|    962|        Curl_pgrs_upload_inc(data, body_len);
  238|    962|      }
  239|  6.97k|    }
  240|   279k|  }
  241|   279k|  return result;
  242|   279k|}
request.c:req_set_upload_done:
  269|  6.70k|{
  270|  6.70k|  DEBUGASSERT(!data->req.upload_done);
  ------------------
  |  | 1081|  6.70k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (270:3): [True: 0, False: 6.70k]
  |  Branch (270:3): [True: 6.70k, False: 0]
  ------------------
  271|  6.70k|  data->req.upload_done = TRUE;
  ------------------
  |  | 1055|  6.70k|#define TRUE true
  ------------------
  272|  6.70k|  CURL_REQ_CLEAR_SEND(data);
  ------------------
  |  |   47|  6.70k|  ((d)->req.io_flags &= (uint8_t)~REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|  6.70k|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  ------------------
  273|       |
  274|  6.70k|  Curl_pgrsTime(data, TIMER_POSTRANSFER);
  275|  6.70k|  Curl_creader_done(data, data->req.upload_aborted);
  276|       |
  277|  6.70k|  if(data->req.upload_aborted) {
  ------------------
  |  Branch (277:6): [True: 28, False: 6.67k]
  ------------------
  278|     28|    Curl_bufq_reset(&data->req.sendbuf);
  279|     28|    if(data->req.writebytecount)
  ------------------
  |  Branch (279:8): [True: 2, False: 26]
  ------------------
  280|      2|      infof(data, "abort upload after having sent %" FMT_OFF_T " bytes",
  ------------------
  |  |  143|      2|  do {                               \
  |  |  144|      2|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      2|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 2, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  320|      2|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      2|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      2|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 2]
  |  |  ------------------
  ------------------
  281|     28|            data->req.writebytecount);
  282|     26|    else
  283|     26|      infof(data, "abort upload");
  ------------------
  |  |  143|     26|  do {                               \
  |  |  144|     26|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     26|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 26, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 26]
  |  |  |  |  ------------------
  |  |  |  |  320|     26|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     26|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     26|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 26]
  |  |  ------------------
  ------------------
  284|     28|  }
  285|  6.67k|  else if(data->req.writebytecount)
  ------------------
  |  Branch (285:11): [True: 751, False: 5.92k]
  ------------------
  286|    751|    infof(data, "upload completely sent off: %" FMT_OFF_T " bytes",
  ------------------
  |  |  143|    751|  do {                               \
  |  |  144|    751|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    751|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 751, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 751]
  |  |  |  |  ------------------
  |  |  |  |  320|    751|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    751|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    751|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 751]
  |  |  ------------------
  ------------------
  287|  6.67k|          data->req.writebytecount);
  288|  5.92k|  else if(!data->req.download_done) {
  ------------------
  |  Branch (288:11): [True: 5.92k, False: 0]
  ------------------
  289|  5.92k|    DEBUGASSERT(Curl_bufq_is_empty(&data->req.sendbuf));
  ------------------
  |  | 1081|  5.92k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (289:5): [True: 0, False: 5.92k]
  |  Branch (289:5): [True: 5.92k, False: 0]
  ------------------
  290|  5.92k|    infof(data, Curl_creader_total_length(data) ?
  ------------------
  |  |  143|  5.92k|  do {                               \
  |  |  144|  5.92k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  5.92k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 5.92k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 5.92k]
  |  |  |  |  ------------------
  |  |  |  |  320|  5.92k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  5.92k|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|  5.92k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 5.92k]
  |  |  ------------------
  ------------------
  291|  5.92k|          "We are completely uploaded and fine" :
  292|  5.92k|          "Request completely sent off");
  293|  5.92k|  }
  294|       |
  295|  6.70k|  return Curl_xfer_send_close(data);
  296|  6.70k|}
request.c:req_send_buffer_add:
  368|    886|{
  369|    886|  CURLcode result = CURLE_OK;
  370|    886|  size_t n;
  371|    886|  result = Curl_bufq_cwrite(&data->req.sendbuf, buf, blen, &n);
  372|    886|  if(result)
  ------------------
  |  Branch (372:6): [True: 0, False: 886]
  ------------------
  373|      0|    return result;
  374|       |  /* We rely on a SOFTLIMIT on sendbuf, so it can take all data in */
  375|    886|  DEBUGASSERT(n == blen);
  ------------------
  |  | 1081|    886|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (375:3): [True: 0, False: 886]
  |  Branch (375:3): [True: 886, False: 0]
  ------------------
  376|    886|  data->req.sendbuf_hds_len += hds_len;
  377|    886|  return CURLE_OK;
  378|    886|}
request.c:add_from_client:
  354|  1.55k|{
  355|  1.55k|  struct Curl_easy *data = reader_ctx;
  356|  1.55k|  CURLcode result;
  357|  1.55k|  bool eos;
  358|       |
  359|  1.55k|  result = Curl_client_read(data, (char *)buf, buflen, pnread, &eos);
  360|  1.55k|  if(!result && eos)
  ------------------
  |  Branch (360:6): [True: 1.54k, False: 11]
  |  Branch (360:17): [True: 798, False: 748]
  ------------------
  361|    798|    data->req.eos_read = TRUE;
  ------------------
  |  | 1055|    798|#define TRUE true
  ------------------
  362|  1.55k|  return result;
  363|  1.55k|}

Curl_socket_check:
  124|  8.99k|{
  125|  8.99k|  struct pollfd pfd[3];
  126|  8.99k|  int num;
  127|  8.99k|  int r;
  128|       |
  129|  8.99k|  if((readfd0 == CURL_SOCKET_BAD) && (readfd1 == CURL_SOCKET_BAD) &&
  ------------------
  |  |  145|  8.99k|#define CURL_SOCKET_BAD (-1)
  ------------------
                if((readfd0 == CURL_SOCKET_BAD) && (readfd1 == CURL_SOCKET_BAD) &&
  ------------------
  |  |  145|     40|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (129:6): [True: 40, False: 8.95k]
  |  Branch (129:38): [True: 40, False: 0]
  ------------------
  130|     40|     (writefd == CURL_SOCKET_BAD)) {
  ------------------
  |  |  145|     40|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (130:6): [True: 0, False: 40]
  ------------------
  131|       |    /* no sockets, wait */
  132|      0|    return curlx_wait_ms(timeout_ms);
  133|      0|  }
  134|       |
  135|       |  /* Avoid initial timestamp, avoid curlx_now() call, when elapsed
  136|       |     time in this function does not need to be measured. This happens
  137|       |     when function is called with a zero timeout or a negative timeout
  138|       |     value indicating a blocking call should be performed. */
  139|       |
  140|  8.99k|  num = 0;
  141|  8.99k|  if(readfd0 != CURL_SOCKET_BAD) {
  ------------------
  |  |  145|  8.99k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (141:6): [True: 8.95k, False: 40]
  ------------------
  142|  8.95k|    pfd[num].fd = readfd0;
  143|  8.95k|    pfd[num].events = POLLRDNORM | POLLIN | POLLRDBAND | POLLPRI;
  144|  8.95k|    pfd[num].revents = 0;
  145|  8.95k|    num++;
  146|  8.95k|  }
  147|  8.99k|  if(readfd1 != CURL_SOCKET_BAD) {
  ------------------
  |  |  145|  8.99k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (147:6): [True: 0, False: 8.99k]
  ------------------
  148|      0|    pfd[num].fd = readfd1;
  149|      0|    pfd[num].events = POLLRDNORM | POLLIN | POLLRDBAND | POLLPRI;
  150|      0|    pfd[num].revents = 0;
  151|      0|    num++;
  152|      0|  }
  153|  8.99k|  if(writefd != CURL_SOCKET_BAD) {
  ------------------
  |  |  145|  8.99k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (153:6): [True: 40, False: 8.95k]
  ------------------
  154|     40|    pfd[num].fd = writefd;
  155|     40|    pfd[num].events = POLLWRNORM | POLLOUT | POLLPRI;
  156|     40|    pfd[num].revents = 0;
  157|     40|    num++;
  158|     40|  }
  159|       |
  160|  8.99k|  r = Curl_poll(pfd, (unsigned int)num, timeout_ms);
  161|  8.99k|  if(r <= 0)
  ------------------
  |  Branch (161:6): [True: 963, False: 8.02k]
  ------------------
  162|    963|    return r;
  163|       |
  164|  8.02k|  r = 0;
  165|  8.02k|  num = 0;
  166|  8.02k|  if(readfd0 != CURL_SOCKET_BAD) {
  ------------------
  |  |  145|  8.02k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (166:6): [True: 8.01k, False: 15]
  ------------------
  167|  8.01k|    if(pfd[num].revents & (POLLRDNORM | POLLIN | POLLERR | POLLHUP))
  ------------------
  |  Branch (167:8): [True: 8.01k, False: 0]
  ------------------
  168|  8.01k|      r |= CURL_CSELECT_IN;
  ------------------
  |  |  290|  8.01k|#define CURL_CSELECT_IN   0x01
  ------------------
  169|  8.01k|    if(pfd[num].revents & (POLLPRI | POLLNVAL))
  ------------------
  |  Branch (169:8): [True: 0, False: 8.01k]
  ------------------
  170|      0|      r |= CURL_CSELECT_ERR;
  ------------------
  |  |  292|      0|#define CURL_CSELECT_ERR  0x04
  ------------------
  171|  8.01k|    num++;
  172|  8.01k|  }
  173|  8.02k|  if(readfd1 != CURL_SOCKET_BAD) {
  ------------------
  |  |  145|  8.02k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (173:6): [True: 0, False: 8.02k]
  ------------------
  174|      0|    if(pfd[num].revents & (POLLRDNORM | POLLIN | POLLERR | POLLHUP))
  ------------------
  |  Branch (174:8): [True: 0, False: 0]
  ------------------
  175|      0|      r |= CURL_CSELECT_IN2;
  ------------------
  |  |   70|      0|#define CURL_CSELECT_IN2 (CURL_CSELECT_ERR << 1)
  |  |  ------------------
  |  |  |  |  292|      0|#define CURL_CSELECT_ERR  0x04
  |  |  ------------------
  ------------------
  176|      0|    if(pfd[num].revents & (POLLPRI | POLLNVAL))
  ------------------
  |  Branch (176:8): [True: 0, False: 0]
  ------------------
  177|      0|      r |= CURL_CSELECT_ERR;
  ------------------
  |  |  292|      0|#define CURL_CSELECT_ERR  0x04
  ------------------
  178|      0|    num++;
  179|      0|  }
  180|  8.02k|  if(writefd != CURL_SOCKET_BAD) {
  ------------------
  |  |  145|  8.02k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (180:6): [True: 15, False: 8.01k]
  ------------------
  181|     15|    if(pfd[num].revents & (POLLWRNORM | POLLOUT))
  ------------------
  |  Branch (181:8): [True: 15, False: 0]
  ------------------
  182|     15|      r |= CURL_CSELECT_OUT;
  ------------------
  |  |  291|     15|#define CURL_CSELECT_OUT  0x02
  ------------------
  183|     15|    if(pfd[num].revents & (POLLERR | POLLHUP | POLLPRI | POLLNVAL))
  ------------------
  |  Branch (183:8): [True: 15, False: 0]
  ------------------
  184|     15|      r |= CURL_CSELECT_ERR;
  ------------------
  |  |  292|     15|#define CURL_CSELECT_ERR  0x04
  ------------------
  185|     15|  }
  186|       |
  187|  8.02k|  return r;
  188|  8.99k|}
Curl_poll:
  204|  9.40k|{
  205|  9.40k|#ifdef HAVE_POLL
  206|  9.40k|  int pending_ms;
  207|       |#else
  208|       |  fd_set fds_read;
  209|       |  fd_set fds_write;
  210|       |  fd_set fds_err;
  211|       |  curl_socket_t maxfd;
  212|       |#endif
  213|  9.40k|  bool fds_none = TRUE;
  ------------------
  |  | 1055|  9.40k|#define TRUE true
  ------------------
  214|  9.40k|  unsigned int i;
  215|  9.40k|  int r;
  216|       |
  217|  9.40k|  if(ufds) {
  ------------------
  |  Branch (217:6): [True: 9.40k, False: 0]
  ------------------
  218|  9.40k|    for(i = 0; i < nfds; i++) {
  ------------------
  |  Branch (218:16): [True: 9.40k, False: 0]
  ------------------
  219|  9.40k|      if(ufds[i].fd != CURL_SOCKET_BAD) {
  ------------------
  |  |  145|  9.40k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (219:10): [True: 9.40k, False: 0]
  ------------------
  220|  9.40k|        fds_none = FALSE;
  ------------------
  |  | 1058|  9.40k|#define FALSE false
  ------------------
  221|  9.40k|        break;
  222|  9.40k|      }
  223|  9.40k|    }
  224|  9.40k|  }
  225|  9.40k|  if(fds_none) {
  ------------------
  |  Branch (225:6): [True: 0, False: 9.40k]
  ------------------
  226|       |    /* no sockets, wait */
  227|      0|    return curlx_wait_ms(timeout_ms);
  228|      0|  }
  229|       |
  230|       |  /* Avoid initial timestamp, avoid curlx_now() call, when elapsed
  231|       |     time in this function does not need to be measured. This happens
  232|       |     when function is called with a zero timeout or a negative timeout
  233|       |     value indicating a blocking call should be performed. */
  234|       |
  235|  9.40k|#ifdef HAVE_POLL
  236|       |
  237|       |  /* prevent overflow, timeout_ms is typecast to int. */
  238|  9.40k|#if TIMEDIFF_T_MAX > INT_MAX
  239|  9.40k|  if(timeout_ms > INT_MAX)
  ------------------
  |  Branch (239:6): [True: 0, False: 9.40k]
  ------------------
  240|      0|    timeout_ms = INT_MAX;
  241|  9.40k|#endif
  242|  9.40k|  if(timeout_ms > 0)
  ------------------
  |  Branch (242:6): [True: 3.63k, False: 5.76k]
  ------------------
  243|  3.63k|    pending_ms = (int)timeout_ms;
  244|  5.76k|  else if(timeout_ms < 0)
  ------------------
  |  Branch (244:11): [True: 0, False: 5.76k]
  ------------------
  245|      0|    pending_ms = -1;
  246|  5.76k|  else
  247|  5.76k|    pending_ms = 0;
  248|  9.40k|  r = poll(ufds, nfds, pending_ms);
  249|  9.40k|  if(r <= 0) {
  ------------------
  |  Branch (249:6): [True: 1.07k, False: 8.33k]
  ------------------
  250|  1.07k|    if((r == -1) && (SOCKERRNO == SOCKEINTR))
  ------------------
  |  | 1095|      0|#define SOCKERRNO         errno
  ------------------
                  if((r == -1) && (SOCKERRNO == SOCKEINTR))
  ------------------
  |  | 1129|      0|#define SOCKEINTR         EINTR
  ------------------
  |  Branch (250:8): [True: 0, False: 1.07k]
  |  Branch (250:21): [True: 0, False: 0]
  ------------------
  251|       |      /* make EINTR from select or poll not a "lethal" error */
  252|      0|      r = 0;
  253|  1.07k|    return r;
  254|  1.07k|  }
  255|       |
  256|  16.6k|  for(i = 0; i < nfds; i++) {
  ------------------
  |  Branch (256:14): [True: 8.33k, False: 8.33k]
  ------------------
  257|  8.33k|    if(ufds[i].fd == CURL_SOCKET_BAD)
  ------------------
  |  |  145|  8.33k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (257:8): [True: 0, False: 8.33k]
  ------------------
  258|      0|      continue;
  259|  8.33k|    if(ufds[i].revents & POLLHUP)
  ------------------
  |  Branch (259:8): [True: 15, False: 8.31k]
  ------------------
  260|     15|      ufds[i].revents |= POLLIN;
  261|  8.33k|    if(ufds[i].revents & POLLERR)
  ------------------
  |  Branch (261:8): [True: 15, False: 8.31k]
  ------------------
  262|     15|      ufds[i].revents |= POLLIN | POLLOUT;
  263|  8.33k|  }
  264|       |
  265|       |#else /* !HAVE_POLL */
  266|       |
  267|       |  FD_ZERO(&fds_read);
  268|       |  FD_ZERO(&fds_write);
  269|       |  FD_ZERO(&fds_err);
  270|       |  maxfd = (curl_socket_t)-1;
  271|       |
  272|       |  for(i = 0; i < nfds; i++) {
  273|       |    ufds[i].revents = 0;
  274|       |    if(ufds[i].fd == CURL_SOCKET_BAD)
  275|       |      continue;
  276|       |    VERIFY_SOCK(ufds[i].fd);
  277|       |    if(ufds[i].events & (POLLIN | POLLOUT | POLLPRI |
  278|       |                         POLLRDNORM | POLLWRNORM | POLLRDBAND)) {
  279|       |      if(ufds[i].fd > maxfd)
  280|       |        maxfd = ufds[i].fd;
  281|       |      if(ufds[i].events & (POLLRDNORM | POLLIN))
  282|       |        FD_SET(ufds[i].fd, &fds_read);
  283|       |      if(ufds[i].events & (POLLWRNORM | POLLOUT))
  284|       |        FD_SET(ufds[i].fd, &fds_write);
  285|       |      if(ufds[i].events & (POLLRDBAND | POLLPRI))
  286|       |        FD_SET(ufds[i].fd, &fds_err);
  287|       |    }
  288|       |  }
  289|       |
  290|       |  /*
  291|       |     Note also that Winsock ignores the first argument, so we do not worry
  292|       |     about the fact that maxfd is computed incorrectly with Winsock (since
  293|       |     curl_socket_t is unsigned in such cases and thus -1 is the largest
  294|       |     value).
  295|       |  */
  296|       |  r = our_select(maxfd, &fds_read, &fds_write, &fds_err, timeout_ms);
  297|       |  if(r <= 0) {
  298|       |    if((r == -1) && (SOCKERRNO == SOCKEINTR))
  299|       |      /* make EINTR from select or poll not a "lethal" error */
  300|       |      r = 0;
  301|       |    return r;
  302|       |  }
  303|       |
  304|       |  r = 0;
  305|       |  for(i = 0; i < nfds; i++) {
  306|       |    ufds[i].revents = 0;
  307|       |    if(ufds[i].fd == CURL_SOCKET_BAD)
  308|       |      continue;
  309|       |    if(FD_ISSET(ufds[i].fd, &fds_read)) {
  310|       |      if(ufds[i].events & POLLRDNORM)
  311|       |        ufds[i].revents |= POLLRDNORM;
  312|       |      if(ufds[i].events & POLLIN)
  313|       |        ufds[i].revents |= POLLIN;
  314|       |    }
  315|       |    if(FD_ISSET(ufds[i].fd, &fds_write)) {
  316|       |      if(ufds[i].events & POLLWRNORM)
  317|       |        ufds[i].revents |= POLLWRNORM;
  318|       |      if(ufds[i].events & POLLOUT)
  319|       |        ufds[i].revents |= POLLOUT;
  320|       |    }
  321|       |    if(FD_ISSET(ufds[i].fd, &fds_err)) {
  322|       |      if(ufds[i].events & POLLRDBAND)
  323|       |        ufds[i].revents |= POLLRDBAND;
  324|       |      if(ufds[i].events & POLLPRI)
  325|       |        ufds[i].revents |= POLLPRI;
  326|       |    }
  327|       |    if(ufds[i].revents)
  328|       |      r++;
  329|       |  }
  330|       |
  331|       |#endif /* HAVE_POLL */
  332|       |
  333|  8.33k|  return r;
  334|  9.40k|}
Curl_pollfds_init:
  339|   317k|{
  340|   317k|  DEBUGASSERT(cpfds);
  ------------------
  |  | 1081|   317k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (340:3): [True: 0, False: 317k]
  |  Branch (340:3): [True: 317k, False: 0]
  ------------------
  341|   317k|  memset(cpfds, 0, sizeof(*cpfds));
  342|   317k|  if(static_pfds && static_count) {
  ------------------
  |  Branch (342:6): [True: 317k, False: 0]
  |  Branch (342:21): [True: 317k, False: 0]
  ------------------
  343|   317k|    cpfds->pfds = static_pfds;
  344|   317k|    cpfds->count = static_count;
  345|   317k|  }
  346|   317k|}
Curl_pollfds_cleanup:
  354|   317k|{
  355|   317k|  DEBUGASSERT(cpfds);
  ------------------
  |  | 1081|   317k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (355:3): [True: 0, False: 317k]
  |  Branch (355:3): [True: 317k, False: 0]
  ------------------
  356|   317k|  if(cpfds->allocated_pfds) {
  ------------------
  |  Branch (356:6): [True: 0, False: 317k]
  ------------------
  357|      0|    curlx_free(cpfds->pfds);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  358|      0|  }
  359|   317k|  memset(cpfds, 0, sizeof(*cpfds));
  360|   317k|}
Curl_pollset_reset:
  488|  14.7M|{
  489|  14.7M|  unsigned int i;
  490|  14.7M|  ps->n = 0;
  491|  14.7M|#ifdef DEBUGBUILD
  492|  14.7M|  DEBUGASSERT(ps->init == CURL_EASY_POLLSET_MAGIC);
  ------------------
  |  | 1081|  14.7M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (492:3): [True: 0, False: 14.7M]
  |  Branch (492:3): [True: 14.7M, False: 0]
  ------------------
  493|  14.7M|#endif
  494|  14.7M|  DEBUGASSERT(ps->count);
  ------------------
  |  | 1081|  14.7M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (494:3): [True: 0, False: 14.7M]
  |  Branch (494:3): [True: 14.7M, False: 0]
  ------------------
  495|  44.1M|  for(i = 0; i < ps->count; i++)
  ------------------
  |  Branch (495:14): [True: 29.4M, False: 14.7M]
  ------------------
  496|  29.4M|    ps->sockets[i] = CURL_SOCKET_BAD;
  ------------------
  |  |  145|  44.1M|#define CURL_SOCKET_BAD (-1)
  ------------------
  497|  14.7M|  memset(ps->actions, 0, ps->count * sizeof(ps->actions[0]));
  498|  14.7M|}
Curl_pollset_init:
  501|  3.81M|{
  502|  3.81M|#ifdef DEBUGBUILD
  503|  3.81M|  ps->init = CURL_EASY_POLLSET_MAGIC;
  ------------------
  |  |  131|  3.81M|#define CURL_EASY_POLLSET_MAGIC  0x7a657370
  ------------------
  504|  3.81M|#endif
  505|  3.81M|  ps->sockets = ps->def_sockets;
  506|  3.81M|  ps->actions = ps->def_actions;
  507|  3.81M|  ps->count = CURL_ARRAYSIZE(ps->def_sockets);
  ------------------
  |  | 1294|  3.81M|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  508|  3.81M|  ps->n = 0;
  509|  3.81M|  Curl_pollset_reset(ps);
  510|  3.81M|}
Curl_pollset_cleanup:
  521|  3.81M|{
  522|  3.81M|#ifdef DEBUGBUILD
  523|  3.81M|  DEBUGASSERT(ps->init == CURL_EASY_POLLSET_MAGIC);
  ------------------
  |  | 1081|  3.81M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (523:3): [True: 0, False: 3.81M]
  |  Branch (523:3): [True: 3.81M, False: 0]
  ------------------
  524|  3.81M|#endif
  525|  3.81M|  if(ps->sockets != ps->def_sockets) {
  ------------------
  |  Branch (525:6): [True: 0, False: 3.81M]
  ------------------
  526|      0|    curlx_free(ps->sockets);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  527|      0|    ps->sockets = ps->def_sockets;
  528|      0|  }
  529|  3.81M|  if(ps->actions != ps->def_actions) {
  ------------------
  |  Branch (529:6): [True: 0, False: 3.81M]
  ------------------
  530|      0|    curlx_free(ps->actions);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  531|      0|    ps->actions = ps->def_actions;
  532|      0|  }
  533|  3.81M|  ps->count = CURL_ARRAYSIZE(ps->def_sockets);
  ------------------
  |  | 1294|  3.81M|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  534|  3.81M|  Curl_pollset_reset(ps);
  535|  3.81M|}
Curl_pollset_change:
  564|  13.5M|{
  565|  13.5M|  unsigned int i;
  566|       |
  567|  13.5M|#ifdef DEBUGBUILD
  568|  13.5M|  DEBUGASSERT(ps->init == CURL_EASY_POLLSET_MAGIC);
  ------------------
  |  | 1081|  13.5M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (568:3): [True: 0, False: 13.5M]
  |  Branch (568:3): [True: 13.5M, False: 0]
  ------------------
  569|  13.5M|#endif
  570|       |
  571|  13.5M|  DEBUGASSERT(VALID_SOCK(sock));
  ------------------
  |  | 1081|  13.5M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (571:3): [True: 0, False: 13.5M]
  |  Branch (571:3): [True: 13.5M, False: 0]
  ------------------
  572|  13.5M|  if(!VALID_SOCK(sock))
  ------------------
  |  |   98|  13.5M|#define VALID_SOCK(s) ((s) >= 0)
  ------------------
  |  Branch (572:6): [True: 0, False: 13.5M]
  ------------------
  573|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  574|       |
  575|  13.5M|  DEBUGASSERT(add_flags <= (CURL_POLL_IN | CURL_POLL_OUT));
  ------------------
  |  | 1081|  13.5M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (575:3): [True: 0, False: 13.5M]
  |  Branch (575:3): [True: 13.5M, False: 0]
  ------------------
  576|  13.5M|  DEBUGASSERT(remove_flags <= (CURL_POLL_IN | CURL_POLL_OUT));
  ------------------
  |  | 1081|  13.5M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (576:3): [True: 0, False: 13.5M]
  |  Branch (576:3): [True: 13.5M, False: 0]
  ------------------
  577|  13.5M|  DEBUGASSERT((add_flags & remove_flags) == 0); /* no overlap */
  ------------------
  |  | 1081|  13.5M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (577:3): [True: 0, False: 13.5M]
  |  Branch (577:3): [True: 13.5M, False: 0]
  ------------------
  578|  13.5M|  for(i = 0; i < ps->n; ++i) {
  ------------------
  |  Branch (578:14): [True: 6.58M, False: 7.00M]
  ------------------
  579|  6.58M|    if(ps->sockets[i] == sock) {
  ------------------
  |  Branch (579:8): [True: 6.58M, False: 0]
  ------------------
  580|  6.58M|      ps->actions[i] &= (unsigned char)(~remove_flags);
  581|  6.58M|      ps->actions[i] |= (unsigned char)add_flags;
  582|       |      /* all gone? remove socket */
  583|  6.58M|      if(!ps->actions[i]) {
  ------------------
  |  Branch (583:10): [True: 0, False: 6.58M]
  ------------------
  584|      0|        if((i + 1) < ps->n) {
  ------------------
  |  Branch (584:12): [True: 0, False: 0]
  ------------------
  585|      0|          memmove(&ps->sockets[i], &ps->sockets[i + 1],
  586|      0|                  (ps->n - (i + 1)) * sizeof(ps->sockets[0]));
  587|      0|          memmove(&ps->actions[i], &ps->actions[i + 1],
  588|      0|                  (ps->n - (i + 1)) * sizeof(ps->actions[0]));
  589|      0|        }
  590|      0|        --ps->n;
  591|      0|      }
  592|  6.58M|      return CURLE_OK;
  593|  6.58M|    }
  594|  6.58M|  }
  595|       |  /* not present */
  596|  7.00M|  if(add_flags) {
  ------------------
  |  Branch (596:6): [True: 7.00M, False: 0]
  ------------------
  597|  7.00M|    if(i >= ps->count) { /* need to grow */
  ------------------
  |  Branch (597:8): [True: 0, False: 7.00M]
  ------------------
  598|      0|      unsigned int new_count = CURLMAX(ps->count * 2, 8);
  ------------------
  |  | 1286|      0|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1286:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  599|      0|      curl_socket_t *nsockets;
  600|      0|      unsigned char *nactions;
  601|       |
  602|      0|      CURL_TRC_M(data, "growing pollset capacity from %u to %u",
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  603|      0|                 ps->count, new_count);
  604|      0|      if(new_count <= ps->count)
  ------------------
  |  Branch (604:10): [True: 0, False: 0]
  ------------------
  605|      0|        return CURLE_OUT_OF_MEMORY;
  606|      0|      nsockets = curlx_calloc(new_count, sizeof(nsockets[0]));
  ------------------
  |  | 1480|      0|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  607|      0|      if(!nsockets)
  ------------------
  |  Branch (607:10): [True: 0, False: 0]
  ------------------
  608|      0|        return CURLE_OUT_OF_MEMORY;
  609|      0|      nactions = curlx_calloc(new_count, sizeof(nactions[0]));
  ------------------
  |  | 1480|      0|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  610|      0|      if(!nactions) {
  ------------------
  |  Branch (610:10): [True: 0, False: 0]
  ------------------
  611|      0|        curlx_free(nsockets);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  612|      0|        return CURLE_OUT_OF_MEMORY;
  613|      0|      }
  614|      0|      memcpy(nsockets, ps->sockets, ps->count * sizeof(ps->sockets[0]));
  615|      0|      memcpy(nactions, ps->actions, ps->count * sizeof(ps->actions[0]));
  616|      0|      if(ps->sockets != ps->def_sockets)
  ------------------
  |  Branch (616:10): [True: 0, False: 0]
  ------------------
  617|      0|        curlx_free(ps->sockets);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  618|      0|      ps->sockets = nsockets;
  619|      0|      if(ps->actions != ps->def_actions)
  ------------------
  |  Branch (619:10): [True: 0, False: 0]
  ------------------
  620|      0|        curlx_free(ps->actions);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  621|      0|      ps->actions = nactions;
  622|      0|      ps->count = new_count;
  623|      0|    }
  624|  7.00M|    DEBUGASSERT(i < ps->count);
  ------------------
  |  | 1081|  7.00M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (624:5): [True: 0, False: 7.00M]
  |  Branch (624:5): [True: 7.00M, False: 0]
  ------------------
  625|  7.00M|    if(i < ps->count) {
  ------------------
  |  Branch (625:8): [True: 7.00M, False: 0]
  ------------------
  626|  7.00M|      ps->sockets[i] = sock;
  627|  7.00M|      ps->actions[i] = (unsigned char)add_flags;
  628|  7.00M|      ps->n = i + 1;
  629|  7.00M|    }
  630|  7.00M|  }
  631|  7.00M|  return CURLE_OK;
  632|  7.00M|}
Curl_pollset_set:
  637|  3.25M|{
  638|  3.25M|  return Curl_pollset_change(data, ps, sock,
  639|  3.25M|                             (do_in ? CURL_POLL_IN : 0) |
  ------------------
  |  |  283|  3.25M|#define CURL_POLL_IN     1
  ------------------
  |  Branch (639:31): [True: 3.25M, False: 0]
  ------------------
  640|  3.25M|                             (do_out ? CURL_POLL_OUT : 0),
  ------------------
  |  |  284|  3.25M|#define CURL_POLL_OUT    2
  ------------------
  |  Branch (640:31): [True: 3.25M, False: 189]
  ------------------
  641|  3.25M|                             (!do_in ? CURL_POLL_IN : 0) |
  ------------------
  |  |  283|      0|#define CURL_POLL_IN     1
  ------------------
  |  Branch (641:31): [True: 0, False: 3.25M]
  ------------------
  642|  3.25M|                             (!do_out ? CURL_POLL_OUT : 0));
  ------------------
  |  |  284|    189|#define CURL_POLL_OUT    2
  ------------------
  |  Branch (642:31): [True: 189, False: 3.25M]
  ------------------
  643|  3.25M|}
Curl_pollset_check:
  694|  3.25M|{
  695|  3.25M|  unsigned int i;
  696|       |
  697|  3.25M|  (void)data;
  698|  3.25M|  DEBUGASSERT(VALID_SOCK(sock));
  ------------------
  |  | 1081|  3.25M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (698:3): [True: 0, False: 3.25M]
  |  Branch (698:3): [True: 3.25M, False: 0]
  ------------------
  699|  3.25M|  for(i = 0; i < ps->n; ++i) {
  ------------------
  |  Branch (699:14): [True: 3.25M, False: 0]
  ------------------
  700|  3.25M|    if(ps->sockets[i] == sock) {
  ------------------
  |  Branch (700:8): [True: 3.25M, False: 0]
  ------------------
  701|  3.25M|      *pwant_read = !!(ps->actions[i] & CURL_POLL_IN);
  ------------------
  |  |  283|  3.25M|#define CURL_POLL_IN     1
  ------------------
  702|  3.25M|      *pwant_write = !!(ps->actions[i] & CURL_POLL_OUT);
  ------------------
  |  |  284|  3.25M|#define CURL_POLL_OUT    2
  ------------------
  703|  3.25M|      return;
  704|  3.25M|    }
  705|  3.25M|  }
  706|      0|  *pwant_read = *pwant_write = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  707|      0|}
Curl_pollset_want_recv:
  712|  7.00M|{
  713|  7.00M|  unsigned int i;
  714|  7.00M|  (void)data;
  715|  10.5M|  for(i = 0; i < ps->n; ++i) {
  ------------------
  |  Branch (715:14): [True: 7.00M, False: 3.57M]
  ------------------
  716|  7.00M|    if((ps->sockets[i] == sock) && (ps->actions[i] & CURL_POLL_IN))
  ------------------
  |  |  283|  3.42M|#define CURL_POLL_IN     1
  ------------------
  |  Branch (716:8): [True: 3.42M, False: 3.57M]
  |  Branch (716:36): [True: 3.42M, False: 62]
  ------------------
  717|  3.42M|      return TRUE;
  ------------------
  |  | 1055|  3.42M|#define TRUE true
  ------------------
  718|  7.00M|  }
  719|  3.57M|  return FALSE;
  ------------------
  |  | 1058|  3.57M|#define FALSE false
  ------------------
  720|  7.00M|}

Curl_client_cleanup:
   71|  36.6k|{
   72|  36.6k|  cl_reset_reader(data);
   73|  36.6k|  cl_reset_writer(data);
   74|       |
   75|  36.6k|  data->req.bytecount = 0;
   76|  36.6k|  data->req.headerline = 0;
   77|  36.6k|}
Curl_client_reset:
   80|  24.2k|{
   81|  24.2k|  if(data->req.rewind_read) {
  ------------------
  |  Branch (81:6): [True: 474, False: 23.7k]
  ------------------
   82|       |    /* already requested */
   83|    474|    CURL_TRC_READ(data, "client_reset, will rewind reader");
  ------------------
  |  |  163|    474|  do {                                                    \
  |  |  164|    474|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|    474|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    948|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 474, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 474]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    948|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    474|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|    474|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|    474|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 474]
  |  |  ------------------
  ------------------
   84|    474|  }
   85|  23.7k|  else {
   86|  23.7k|    CURL_TRC_READ(data, "client_reset, clear readers");
  ------------------
  |  |  163|  23.7k|  do {                                                    \
  |  |  164|  23.7k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|  23.7k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  47.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 23.7k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 23.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  47.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  23.7k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|  23.7k|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|  23.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 23.7k]
  |  |  ------------------
  ------------------
   87|  23.7k|    cl_reset_reader(data);
   88|  23.7k|  }
   89|  24.2k|  cl_reset_writer(data);
   90|       |
   91|  24.2k|  data->req.bytecount = 0;
   92|  24.2k|  data->req.headerline = 0;
   93|  24.2k|}
Curl_client_start:
   96|  21.3k|{
   97|  21.3k|  if(data->req.rewind_read) {
  ------------------
  |  Branch (97:6): [True: 467, False: 20.8k]
  ------------------
   98|    467|    struct Curl_creader *r = data->req.reader_stack;
   99|    467|    CURLcode result = CURLE_OK;
  100|       |
  101|    467|    CURL_TRC_READ(data, "client start, rewind readers");
  ------------------
  |  |  163|    467|  do {                                                    \
  |  |  164|    467|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|    467|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    934|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 467, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 467]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    934|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    467|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|    467|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|    467|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 467]
  |  |  ------------------
  ------------------
  102|    885|    while(r) {
  ------------------
  |  Branch (102:11): [True: 480, False: 405]
  ------------------
  103|    480|      result = r->crt->cntrl(data, r, CURL_CRCNTRL_REWIND);
  104|    480|      if(result) {
  ------------------
  |  Branch (104:10): [True: 62, False: 418]
  ------------------
  105|     62|        failf(data, "rewind of client reader '%s' failed: %d",
  ------------------
  |  |   62|     62|#define failf Curl_failf
  ------------------
  106|     62|              r->crt->name, result);
  107|     62|        return result;
  108|     62|      }
  109|    418|      r = r->next;
  110|    418|    }
  111|    405|    data->req.rewind_read = FALSE;
  ------------------
  |  | 1058|    405|#define FALSE false
  ------------------
  112|    405|    cl_reset_reader(data);
  113|    405|  }
  114|  21.2k|  return CURLE_OK;
  115|  21.3k|}
Curl_creader_will_rewind:
  118|    860|{
  119|    860|  return (bool)data->req.rewind_read;
  120|    860|}
Curl_creader_set_rewind:
  123|    497|{
  124|    497|  data->req.rewind_read = !!enable;
  125|    497|}
Curl_cwriter_write:
  131|  4.40M|{
  132|  4.40M|  if(!writer)
  ------------------
  |  Branch (132:6): [True: 0, False: 4.40M]
  ------------------
  133|      0|    return CURLE_WRITE_ERROR;
  134|  4.40M|  return writer->cwt->do_write(data, writer, type, buf, nbytes);
  135|  4.40M|}
Curl_cwriter_def_init:
  139|  51.3k|{
  140|  51.3k|  (void)data;
  141|  51.3k|  (void)writer;
  142|  51.3k|  return CURLE_OK;
  143|  51.3k|}
Curl_cwriter_def_close:
  154|  51.3k|{
  155|  51.3k|  (void)data;
  156|  51.3k|  (void)writer;
  157|  51.3k|}
Curl_client_write:
  377|   942k|{
  378|   942k|  CURLcode result;
  379|       |
  380|       |  /* it is one of those, at least */
  381|   942k|  DEBUGASSERT(type &
  ------------------
  |  | 1081|   942k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (381:3): [True: 0, False: 942k]
  |  Branch (381:3): [True: 942k, False: 0]
  ------------------
  382|   942k|              (CLIENTWRITE_BODY | CLIENTWRITE_HEADER | CLIENTWRITE_INFO));
  383|       |  /* BODY is only BODY (with optional EOS) */
  384|   942k|  DEBUGASSERT(!(type & CLIENTWRITE_BODY) ||
  ------------------
  |  | 1081|   942k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (384:3): [True: 942k, False: 0]
  |  Branch (384:3): [True: 0, False: 0]
  |  Branch (384:3): [True: 937k, False: 4.14k]
  |  Branch (384:3): [True: 4.14k, False: 0]
  ------------------
  385|   942k|              ((type & ~(CLIENTWRITE_BODY | CLIENTWRITE_EOS)) == 0));
  386|       |  /* INFO is only INFO (with optional EOS) */
  387|   942k|  DEBUGASSERT(!(type & CLIENTWRITE_INFO) ||
  ------------------
  |  | 1081|   942k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (387:3): [True: 942k, False: 0]
  |  Branch (387:3): [True: 0, False: 0]
  |  Branch (387:3): [True: 108k, False: 833k]
  |  Branch (387:3): [True: 833k, False: 0]
  ------------------
  388|   942k|              ((type & ~(CLIENTWRITE_INFO | CLIENTWRITE_EOS)) == 0));
  389|       |
  390|   942k|  if(!data->req.writer_stack) {
  ------------------
  |  Branch (390:6): [True: 1.63k, False: 940k]
  ------------------
  391|  1.63k|    result = do_init_writer_stack(data);
  392|  1.63k|    if(result)
  ------------------
  |  Branch (392:8): [True: 0, False: 1.63k]
  ------------------
  393|      0|      return result;
  394|  1.63k|    DEBUGASSERT(data->req.writer_stack);
  ------------------
  |  | 1081|  1.63k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (394:5): [True: 0, False: 1.63k]
  |  Branch (394:5): [True: 1.63k, False: 0]
  ------------------
  395|  1.63k|  }
  396|       |
  397|   942k|  result = Curl_cwriter_write(data, data->req.writer_stack, type, buf, len);
  398|   942k|  CURL_TRC_WRITE(data, "client_write(type=%x, len=%zu) -> %d",
  ------------------
  |  |  158|   942k|  do {                                                     \
  |  |  159|   942k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|   942k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  1.88M|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 942k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 942k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  1.88M|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|   942k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|   942k|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|   942k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 942k]
  |  |  ------------------
  ------------------
  399|   942k|                 type, len, result);
  400|   942k|  return result;
  401|   942k|}
Curl_cwriter_create:
  408|  86.6k|{
  409|  86.6k|  struct Curl_cwriter *writer = NULL;
  410|  86.6k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  411|  86.6k|  void *p;
  412|       |
  413|  86.6k|  DEBUGASSERT(cwt->cwriter_size >= sizeof(struct Curl_cwriter));
  ------------------
  |  | 1081|  86.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (413:3): [True: 0, False: 86.6k]
  |  Branch (413:3): [True: 86.6k, False: 0]
  ------------------
  414|  86.6k|  p = curlx_calloc(1, cwt->cwriter_size);
  ------------------
  |  | 1480|  86.6k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  415|  86.6k|  if(!p)
  ------------------
  |  Branch (415:6): [True: 0, False: 86.6k]
  ------------------
  416|      0|    goto out;
  417|       |
  418|  86.6k|  writer = (struct Curl_cwriter *)p;
  419|  86.6k|  writer->cwt = cwt;
  420|  86.6k|  writer->ctx = p;
  421|  86.6k|  writer->phase = phase;
  422|  86.6k|  result = cwt->do_init(data, writer);
  423|       |
  424|  86.6k|out:
  425|  86.6k|  *pwriter = result ? NULL : writer;
  ------------------
  |  Branch (425:14): [True: 0, False: 86.6k]
  ------------------
  426|  86.6k|  if(result)
  ------------------
  |  Branch (426:6): [True: 0, False: 86.6k]
  ------------------
  427|      0|    curlx_free(writer);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  428|  86.6k|  return result;
  429|  86.6k|}
Curl_cwriter_count:
  441|    952|{
  442|    952|  struct Curl_cwriter *w;
  443|    952|  size_t n = 0;
  444|       |
  445|  6.30k|  for(w = data->req.writer_stack; w; w = w->next) {
  ------------------
  |  Branch (445:35): [True: 5.35k, False: 952]
  ------------------
  446|  5.35k|    if(w->phase == phase)
  ------------------
  |  Branch (446:8): [True: 590, False: 4.76k]
  ------------------
  447|    590|      ++n;
  448|  5.35k|  }
  449|    952|  return n;
  450|    952|}
Curl_cwriter_add:
  454|  69.4k|{
  455|  69.4k|  CURLcode result;
  456|  69.4k|  struct Curl_cwriter **anchor = &data->req.writer_stack;
  457|       |
  458|  69.4k|  if(!*anchor) {
  ------------------
  |  Branch (458:6): [True: 15.5k, False: 53.8k]
  ------------------
  459|  15.5k|    result = do_init_writer_stack(data);
  460|  15.5k|    if(result)
  ------------------
  |  Branch (460:8): [True: 0, False: 15.5k]
  ------------------
  461|      0|      return result;
  462|  15.5k|  }
  463|       |
  464|       |  /* Insert the writer as first in its phase.
  465|       |   * Skip existing writers of lower phases. */
  466|  90.4k|  while(*anchor && (*anchor)->phase < writer->phase)
  ------------------
  |  Branch (466:9): [True: 90.4k, False: 0]
  |  Branch (466:20): [True: 20.9k, False: 69.4k]
  ------------------
  467|  20.9k|    anchor = &((*anchor)->next);
  468|  69.4k|  writer->next = *anchor;
  469|  69.4k|  *anchor = writer;
  470|  69.4k|  return CURLE_OK;
  471|  69.4k|}
Curl_cwriter_get_by_name:
  475|  16.4k|{
  476|  16.4k|  struct Curl_cwriter *writer;
  477|  20.8k|  for(writer = data->req.writer_stack; writer; writer = writer->next) {
  ------------------
  |  Branch (477:40): [True: 4.50k, False: 16.3k]
  ------------------
  478|  4.50k|    if(!strcmp(name, writer->cwt->name))
  ------------------
  |  Branch (478:8): [True: 148, False: 4.35k]
  ------------------
  479|    148|      return writer;
  480|  4.50k|  }
  481|  16.3k|  return NULL;
  482|  16.4k|}
Curl_cwriter_get_by_type:
  486|   971k|{
  487|   971k|  struct Curl_cwriter *writer;
  488|  4.52M|  for(writer = data->req.writer_stack; writer; writer = writer->next) {
  ------------------
  |  Branch (488:40): [True: 4.52M, False: 3.37k]
  ------------------
  489|  4.52M|    if(writer->cwt == cwt)
  ------------------
  |  Branch (489:8): [True: 968k, False: 3.55M]
  ------------------
  490|   968k|      return writer;
  491|  4.52M|  }
  492|  3.37k|  return NULL;
  493|   971k|}
Curl_cwriter_is_content_decoding:
  496|   954k|{
  497|   954k|  struct Curl_cwriter *writer;
  498|  4.39M|  for(writer = data->req.writer_stack; writer; writer = writer->next) {
  ------------------
  |  Branch (498:40): [True: 3.95M, False: 441k]
  ------------------
  499|  3.95M|    if(writer->phase == CURL_CW_CONTENT_DECODE)
  ------------------
  |  Branch (499:8): [True: 512k, False: 3.44M]
  ------------------
  500|   512k|      return TRUE;
  ------------------
  |  | 1055|   512k|#define TRUE true
  ------------------
  501|  3.95M|  }
  502|   441k|  return FALSE;
  ------------------
  |  | 1058|   441k|#define FALSE false
  ------------------
  503|   954k|}
Curl_cwriter_is_paused:
  506|   946k|{
  507|   946k|  return Curl_cw_out_is_paused(data);
  508|   946k|}
Curl_creader_read:
  518|  2.26k|{
  519|  2.26k|  *nread = 0;
  520|  2.26k|  *eos = FALSE;
  ------------------
  |  | 1058|  2.26k|#define FALSE false
  ------------------
  521|  2.26k|  if(!reader)
  ------------------
  |  Branch (521:6): [True: 0, False: 2.26k]
  ------------------
  522|      0|    return CURLE_READ_ERROR;
  523|  2.26k|  return reader->crt->do_read(data, reader, buf, blen, nread, eos);
  524|  2.26k|}
Curl_creader_def_init:
  537|  14.1k|{
  538|  14.1k|  (void)data;
  539|  14.1k|  (void)reader;
  540|  14.1k|  return CURLE_OK;
  541|  14.1k|}
Curl_creader_def_close:
  545|  14.3k|{
  546|  14.3k|  (void)data;
  547|  14.3k|  (void)reader;
  548|  14.3k|}
Curl_creader_def_needs_rewind:
  567|    412|{
  568|    412|  (void)data;
  569|    412|  (void)reader;
  570|       |  return FALSE;
  ------------------
  |  | 1058|    412|#define FALSE false
  ------------------
  571|    412|}
Curl_creader_def_resume_from:
  583|      1|{
  584|      1|  (void)data;
  585|      1|  (void)reader;
  586|      1|  (void)offset;
  587|      1|  return CURLE_READ_ERROR;
  588|      1|}
Curl_creader_def_cntrl:
  593|    344|{
  594|    344|  (void)data;
  595|    344|  (void)reader;
  596|    344|  (void)opcode;
  597|    344|  return CURLE_OK;
  598|    344|}
Curl_creader_def_done:
  610|  6.84k|{
  611|  6.84k|  (void)data;
  612|  6.84k|  (void)reader;
  613|  6.84k|  (void)premature;
  614|  6.84k|}
Curl_creader_create:
  926|  15.1k|{
  927|  15.1k|  struct Curl_creader *reader = NULL;
  928|  15.1k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  929|  15.1k|  void *p;
  930|       |
  931|  15.1k|  DEBUGASSERT(crt->creader_size >= sizeof(struct Curl_creader));
  ------------------
  |  | 1081|  15.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (931:3): [True: 0, False: 15.1k]
  |  Branch (931:3): [True: 15.1k, False: 0]
  ------------------
  932|  15.1k|  p = curlx_calloc(1, crt->creader_size);
  ------------------
  |  | 1480|  15.1k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  933|  15.1k|  if(!p)
  ------------------
  |  Branch (933:6): [True: 0, False: 15.1k]
  ------------------
  934|      0|    goto out;
  935|       |
  936|  15.1k|  reader = (struct Curl_creader *)p;
  937|  15.1k|  reader->crt = crt;
  938|  15.1k|  reader->ctx = p;
  939|  15.1k|  reader->phase = phase;
  940|  15.1k|  result = crt->do_init(data, reader);
  941|       |
  942|  15.1k|out:
  943|  15.1k|  *preader = result ? NULL : reader;
  ------------------
  |  Branch (943:14): [True: 0, False: 15.1k]
  ------------------
  944|  15.1k|  if(result)
  ------------------
  |  Branch (944:6): [True: 0, False: 15.1k]
  ------------------
  945|      0|    curlx_free(reader);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  946|  15.1k|  return result;
  947|  15.1k|}
Curl_creader_set_fread:
 1127|    264|{
 1128|    264|  CURLcode result;
 1129|    264|  struct Curl_creader *r;
 1130|    264|  struct cr_in_ctx *ctx;
 1131|       |
 1132|    264|  result = Curl_creader_create(&r, data, &cr_in, CURL_CR_CLIENT);
 1133|    264|  if(result || !r)
  ------------------
  |  Branch (1133:6): [True: 0, False: 264]
  |  Branch (1133:16): [True: 0, False: 264]
  ------------------
 1134|      0|    goto out;
 1135|    264|  ctx = r->ctx;
 1136|    264|  ctx->total_len = len;
 1137|       |
 1138|    264|  cl_reset_reader(data);
 1139|    264|  result = do_init_reader_stack(data, r);
 1140|    264|out:
 1141|    264|  CURL_TRC_READ(data, "add fread reader, len=%" FMT_OFF_T " -> %d",
  ------------------
  |  |  163|    264|  do {                                                    \
  |  |  164|    264|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|    264|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    528|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 264, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 264]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    528|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    264|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|    264|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|    264|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 264]
  |  |  ------------------
  ------------------
 1142|    264|                len, result);
 1143|    264|  return result;
 1144|    264|}
Curl_creader_add:
 1148|    256|{
 1149|    256|  CURLcode result;
 1150|    256|  struct Curl_creader **anchor = &data->req.reader_stack;
 1151|       |
 1152|    256|  if(!*anchor) {
  ------------------
  |  Branch (1152:6): [True: 0, False: 256]
  ------------------
 1153|      0|    result = Curl_creader_set_fread(data, data->state.infilesize);
 1154|      0|    if(result)
  ------------------
  |  Branch (1154:8): [True: 0, False: 0]
  ------------------
 1155|      0|      return result;
 1156|      0|  }
 1157|       |
 1158|       |  /* Insert the writer as first in its phase.
 1159|       |   * Skip existing readers of lower phases. */
 1160|    313|  while(*anchor && (*anchor)->phase < reader->phase)
  ------------------
  |  Branch (1160:9): [True: 313, False: 0]
  |  Branch (1160:20): [True: 57, False: 256]
  ------------------
 1161|     57|    anchor = &((*anchor)->next);
 1162|    256|  reader->next = *anchor;
 1163|    256|  *anchor = reader;
 1164|    256|  return CURLE_OK;
 1165|    256|}
Curl_creader_set:
 1168|    536|{
 1169|    536|  CURLcode result;
 1170|       |
 1171|    536|  DEBUGASSERT(r);
  ------------------
  |  | 1081|    536|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1171:3): [True: 0, False: 536]
  |  Branch (1171:3): [True: 536, False: 0]
  ------------------
 1172|    536|  DEBUGASSERT(r->crt);
  ------------------
  |  | 1081|    536|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1172:3): [True: 0, False: 536]
  |  Branch (1172:3): [True: 536, False: 0]
  ------------------
 1173|    536|  DEBUGASSERT(r->phase == CURL_CR_CLIENT);
  ------------------
  |  | 1081|    536|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1173:3): [True: 0, False: 536]
  |  Branch (1173:3): [True: 536, False: 0]
  ------------------
 1174|       |
 1175|    536|  cl_reset_reader(data);
 1176|    536|  result = do_init_reader_stack(data, r);
 1177|    536|  if(result)
  ------------------
  |  Branch (1177:6): [True: 0, False: 536]
  ------------------
 1178|      0|    Curl_creader_free(data, r);
 1179|    536|  return result;
 1180|    536|}
Curl_client_read:
 1184|  1.55k|{
 1185|  1.55k|  CURLcode result;
 1186|       |
 1187|  1.55k|  DEBUGASSERT(buf);
  ------------------
  |  | 1081|  1.55k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1187:3): [True: 0, False: 1.55k]
  |  Branch (1187:3): [True: 1.55k, False: 0]
  ------------------
 1188|  1.55k|  DEBUGASSERT(blen);
  ------------------
  |  | 1081|  1.55k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1188:3): [True: 0, False: 1.55k]
  |  Branch (1188:3): [True: 1.55k, False: 0]
  ------------------
 1189|  1.55k|  DEBUGASSERT(nread);
  ------------------
  |  | 1081|  1.55k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1189:3): [True: 0, False: 1.55k]
  |  Branch (1189:3): [True: 1.55k, False: 0]
  ------------------
 1190|  1.55k|  DEBUGASSERT(eos);
  ------------------
  |  | 1081|  1.55k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1190:3): [True: 0, False: 1.55k]
  |  Branch (1190:3): [True: 1.55k, False: 0]
  ------------------
 1191|  1.55k|  *nread = 0;
 1192|       |
 1193|  1.55k|  if(!data->req.reader_stack) {
  ------------------
  |  Branch (1193:6): [True: 34, False: 1.52k]
  ------------------
 1194|     34|    result = Curl_creader_set_fread(data, data->state.infilesize);
 1195|     34|    if(result)
  ------------------
  |  Branch (1195:8): [True: 0, False: 34]
  ------------------
 1196|      0|      return result;
 1197|     34|    DEBUGASSERT(data->req.reader_stack);
  ------------------
  |  | 1081|     34|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1197:5): [True: 0, False: 34]
  |  Branch (1197:5): [True: 34, False: 0]
  ------------------
 1198|     34|  }
 1199|  1.55k|  if(!data->req.reader_started) {
  ------------------
  |  Branch (1199:6): [True: 920, False: 637]
  ------------------
 1200|    920|    Curl_rlimit_start(&data->progress.ul.rlimit, Curl_pgrs_now(data), -1);
 1201|    920|    data->req.reader_started = TRUE;
  ------------------
  |  | 1055|    920|#define TRUE true
  ------------------
 1202|    920|  }
 1203|       |
 1204|  1.55k|  if(Curl_rlimit_active(&data->progress.ul.rlimit)) {
  ------------------
  |  Branch (1204:6): [True: 319, False: 1.23k]
  ------------------
 1205|    319|    curl_off_t ul_avail = Curl_rlimit_avail(&data->progress.ul.rlimit,
 1206|    319|                                            Curl_pgrs_now(data));
 1207|    319|    if(ul_avail <= 0) {
  ------------------
  |  Branch (1207:8): [True: 0, False: 319]
  ------------------
 1208|      0|      result = CURLE_OK;
 1209|      0|      *eos = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1210|      0|      goto out;
 1211|      0|    }
 1212|    319|    if(ul_avail < (curl_off_t)blen)
  ------------------
  |  Branch (1212:8): [True: 116, False: 203]
  ------------------
 1213|    116|      blen = (size_t)ul_avail;
 1214|    319|  }
 1215|  1.55k|  result = Curl_creader_read(data, data->req.reader_stack, buf, blen,
 1216|  1.55k|                             nread, eos);
 1217|       |
 1218|  1.55k|out:
 1219|  1.55k|  CURL_TRC_READ(data, "client_read(len=%zu) -> %d, nread=%zu, eos=%d",
  ------------------
  |  |  163|  1.55k|  do {                                                    \
  |  |  164|  1.55k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|  1.55k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  3.11k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 1.55k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.55k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  3.11k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.55k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|  1.55k|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|  1.55k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 1.55k]
  |  |  ------------------
  ------------------
 1220|  1.55k|                blen, result, *nread, *eos);
 1221|  1.55k|  return result;
 1222|  1.55k|}
Curl_creader_needs_rewind:
 1225|    451|{
 1226|    451|  struct Curl_creader *reader = data->req.reader_stack;
 1227|    871|  while(reader) {
  ------------------
  |  Branch (1227:9): [True: 480, False: 391]
  ------------------
 1228|    480|    if(reader->crt->needs_rewind(data, reader)) {
  ------------------
  |  Branch (1228:8): [True: 60, False: 420]
  ------------------
 1229|     60|      CURL_TRC_READ(data, "client reader needs rewind before next request");
  ------------------
  |  |  163|     60|  do {                                                    \
  |  |  164|     60|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|     60|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    120|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 60, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 60]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    120|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|     60|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|     60|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|     60|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 60]
  |  |  ------------------
  ------------------
 1230|     60|      return TRUE;
  ------------------
  |  | 1055|     60|#define TRUE true
  ------------------
 1231|     60|    }
 1232|    420|    reader = reader->next;
 1233|    420|  }
 1234|    391|  return FALSE;
  ------------------
  |  | 1058|    391|#define FALSE false
  ------------------
 1235|    451|}
Curl_creader_set_null:
 1275|  13.9k|{
 1276|  13.9k|  struct Curl_creader *r;
 1277|  13.9k|  CURLcode result;
 1278|       |
 1279|  13.9k|  result = Curl_creader_create(&r, data, &cr_null, CURL_CR_CLIENT);
 1280|  13.9k|  if(result)
  ------------------
  |  Branch (1280:6): [True: 0, False: 13.9k]
  ------------------
 1281|      0|    return result;
 1282|       |
 1283|  13.9k|  cl_reset_reader(data);
 1284|  13.9k|  return do_init_reader_stack(data, r);
 1285|  13.9k|}
Curl_creader_set_buf:
 1390|    133|{
 1391|    133|  CURLcode result;
 1392|    133|  struct Curl_creader *r;
 1393|    133|  struct cr_buf_ctx *ctx;
 1394|       |
 1395|    133|  result = Curl_creader_create(&r, data, &cr_buf, CURL_CR_CLIENT);
 1396|    133|  if(result)
  ------------------
  |  Branch (1396:6): [True: 0, False: 133]
  ------------------
 1397|      0|    goto out;
 1398|    133|  ctx = r->ctx;
 1399|    133|  ctx->buf = buf;
 1400|    133|  ctx->blen = blen;
 1401|    133|  ctx->index = 0;
 1402|       |
 1403|    133|  cl_reset_reader(data);
 1404|    133|  result = do_init_reader_stack(data, r);
 1405|    133|out:
 1406|    133|  CURL_TRC_READ(data, "add buf reader, len=%zu -> %d", blen, result);
  ------------------
  |  |  163|    133|  do {                                                    \
  |  |  164|    133|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|    133|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    266|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 133, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 133]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    266|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    133|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|    133|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|    133|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 133]
  |  |  ------------------
  ------------------
 1407|    133|  return result;
 1408|    133|}
Curl_creader_total_length:
 1411|  21.4k|{
 1412|  21.4k|  struct Curl_creader *r = data->req.reader_stack;
 1413|  21.4k|  return r ? r->crt->total_length(data, r) : -1;
  ------------------
  |  Branch (1413:10): [True: 21.4k, False: 0]
  ------------------
 1414|  21.4k|}
Curl_creader_client_length:
 1417|    462|{
 1418|    462|  struct Curl_creader *r = data->req.reader_stack;
 1419|    605|  while(r && r->phase != CURL_CR_CLIENT)
  ------------------
  |  Branch (1419:9): [True: 605, False: 0]
  |  Branch (1419:14): [True: 143, False: 462]
  ------------------
 1420|    143|    r = r->next;
 1421|    462|  return r ? r->crt->total_length(data, r) : -1;
  ------------------
  |  Branch (1421:10): [True: 462, False: 0]
  ------------------
 1422|    462|}
Curl_creader_resume_from:
 1425|     37|{
 1426|     37|  struct Curl_creader *r = data->req.reader_stack;
 1427|     40|  while(r && r->phase != CURL_CR_CLIENT)
  ------------------
  |  Branch (1427:9): [True: 40, False: 0]
  |  Branch (1427:14): [True: 3, False: 37]
  ------------------
 1428|      3|    r = r->next;
 1429|     37|  return r ? r->crt->resume_from(data, r, offset) : CURLE_READ_ERROR;
  ------------------
  |  Branch (1429:10): [True: 37, False: 0]
  ------------------
 1430|     37|}
Curl_creader_done:
 1460|  6.70k|{
 1461|  6.70k|  struct Curl_creader *reader = data->req.reader_stack;
 1462|  13.5k|  while(reader) {
  ------------------
  |  Branch (1462:9): [True: 6.87k, False: 6.70k]
  ------------------
 1463|  6.87k|    reader->crt->done(data, reader, premature);
 1464|  6.87k|    reader = reader->next;
 1465|  6.87k|  }
 1466|  6.70k|}
Curl_creader_get_by_type:
 1470|  3.25M|{
 1471|  3.25M|  struct Curl_creader *r;
 1472|  6.51M|  for(r = data->req.reader_stack; r; r = r->next) {
  ------------------
  |  Branch (1472:35): [True: 3.25M, False: 3.25M]
  ------------------
 1473|  3.25M|    if(r->crt == crt)
  ------------------
  |  Branch (1473:8): [True: 504, False: 3.25M]
  ------------------
 1474|    504|      return r;
 1475|  3.25M|  }
 1476|  3.25M|  return NULL;
 1477|  3.25M|}
sendf.c:cl_reset_reader:
   59|  75.7k|{
   60|  75.7k|  struct Curl_creader *reader = data->req.reader_stack;
   61|  75.7k|  data->req.reader_started = FALSE;
  ------------------
  |  | 1058|  75.7k|#define FALSE false
  ------------------
   62|  90.8k|  while(reader) {
  ------------------
  |  Branch (62:9): [True: 15.1k, False: 75.7k]
  ------------------
   63|  15.1k|    data->req.reader_stack = reader->next;
   64|  15.1k|    reader->crt->do_close(data, reader);
   65|  15.1k|    curlx_free(reader);
  ------------------
  |  | 1483|  15.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   66|  15.1k|    reader = data->req.reader_stack;
   67|  15.1k|  }
   68|  75.7k|}
sendf.c:cl_reset_writer:
   48|  60.9k|{
   49|  60.9k|  struct Curl_cwriter *writer = data->req.writer_stack;
   50|   147k|  while(writer) {
  ------------------
  |  Branch (50:9): [True: 86.6k, False: 60.9k]
  ------------------
   51|  86.6k|    data->req.writer_stack = writer->next;
   52|  86.6k|    writer->cwt->do_close(data, writer);
   53|  86.6k|    curlx_free(writer);
  ------------------
  |  | 1483|  86.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   54|  86.6k|    writer = data->req.writer_stack;
   55|  86.6k|  }
   56|  60.9k|}
sendf.c:do_init_writer_stack:
  326|  17.1k|{
  327|  17.1k|  struct Curl_cwriter *writer;
  328|  17.1k|  CURLcode result;
  329|       |
  330|  17.1k|  DEBUGASSERT(!data->req.writer_stack);
  ------------------
  |  | 1081|  17.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (330:3): [True: 0, False: 17.1k]
  |  Branch (330:3): [True: 17.1k, False: 0]
  ------------------
  331|  17.1k|  result = Curl_cwriter_create(&data->req.writer_stack,
  332|  17.1k|                               data, &Curl_cwt_out, CURL_CW_CLIENT);
  333|  17.1k|  if(result)
  ------------------
  |  Branch (333:6): [True: 0, False: 17.1k]
  ------------------
  334|      0|    return result;
  335|       |
  336|       |  /* This places the "pause" writer behind the "download" writer that
  337|       |   * is added below. Meaning the "download" can do checks on content length
  338|       |   * and other things *before* write outs are buffered for paused transfers. */
  339|  17.1k|  result = Curl_cwriter_create(&writer, data, &Curl_cwt_pause,
  340|  17.1k|                               CURL_CW_PROTOCOL);
  341|  17.1k|  if(!result) {
  ------------------
  |  Branch (341:6): [True: 17.1k, False: 0]
  ------------------
  342|  17.1k|    result = Curl_cwriter_add(data, writer);
  343|  17.1k|    if(result)
  ------------------
  |  Branch (343:8): [True: 0, False: 17.1k]
  ------------------
  344|      0|      Curl_cwriter_free(data, writer);
  345|  17.1k|  }
  346|  17.1k|  if(result)
  ------------------
  |  Branch (346:6): [True: 0, False: 17.1k]
  ------------------
  347|      0|    return result;
  348|       |
  349|  17.1k|  result = Curl_cwriter_create(&writer, data, &cw_download, CURL_CW_PROTOCOL);
  350|  17.1k|  if(!result) {
  ------------------
  |  Branch (350:6): [True: 17.1k, False: 0]
  ------------------
  351|  17.1k|    result = Curl_cwriter_add(data, writer);
  352|  17.1k|    if(result)
  ------------------
  |  Branch (352:8): [True: 0, False: 17.1k]
  ------------------
  353|      0|      Curl_cwriter_free(data, writer);
  354|  17.1k|  }
  355|  17.1k|  if(result)
  ------------------
  |  Branch (355:6): [True: 0, False: 17.1k]
  ------------------
  356|      0|    return result;
  357|       |
  358|  17.1k|  result = Curl_cwriter_create(&writer, data, &cw_raw, CURL_CW_RAW);
  359|  17.1k|  if(!result) {
  ------------------
  |  Branch (359:6): [True: 17.1k, False: 0]
  ------------------
  360|  17.1k|    result = Curl_cwriter_add(data, writer);
  361|  17.1k|    if(result)
  ------------------
  |  Branch (361:8): [True: 0, False: 17.1k]
  ------------------
  362|      0|      Curl_cwriter_free(data, writer);
  363|  17.1k|  }
  364|  17.1k|  if(result)
  ------------------
  |  Branch (364:6): [True: 0, False: 17.1k]
  ------------------
  365|      0|    return result;
  366|       |
  367|  17.1k|  return result;
  368|  17.1k|}
sendf.c:cw_download_write:
  179|   944k|{
  180|   944k|  struct cw_download_ctx *ctx = writer->ctx;
  181|   944k|  CURLcode result;
  182|   944k|  size_t nwrite, excess_len = 0;
  183|   944k|  bool is_connect = !!(type & CLIENTWRITE_CONNECT);
  ------------------
  |  |   46|   944k|#define CLIENTWRITE_CONNECT (1 << 4) /* a CONNECT related HEADER */
  ------------------
  184|       |
  185|   944k|  if(!ctx->started_response &&
  ------------------
  |  Branch (185:6): [True: 384k, False: 560k]
  ------------------
  186|   384k|     !(type & (CLIENTWRITE_INFO | CLIENTWRITE_CONNECT))) {
  ------------------
  |  |   43|   384k|#define CLIENTWRITE_INFO    (1 << 1) /* meta information, not a HEADER */
  ------------------
                   !(type & (CLIENTWRITE_INFO | CLIENTWRITE_CONNECT))) {
  ------------------
  |  |   46|   384k|#define CLIENTWRITE_CONNECT (1 << 4) /* a CONNECT related HEADER */
  ------------------
  |  Branch (186:6): [True: 3.80k, False: 380k]
  ------------------
  187|  3.80k|    Curl_pgrsTime(data, TIMER_STARTTRANSFER);
  188|  3.80k|    ctx->started_response = TRUE;
  ------------------
  |  | 1055|  3.80k|#define TRUE true
  ------------------
  189|  3.80k|  }
  190|       |
  191|   944k|  if(!(type & CLIENTWRITE_BODY)) {
  ------------------
  |  |   42|   944k|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  |  Branch (191:6): [True: 937k, False: 7.46k]
  ------------------
  192|   937k|    if(is_connect && data->set.suppress_connect_headers)
  ------------------
  |  Branch (192:8): [True: 47.1k, False: 890k]
  |  Branch (192:22): [True: 74, False: 47.0k]
  ------------------
  193|     74|      return CURLE_OK;
  194|   937k|    result = Curl_cwriter_write(data, writer->next, type, buf, nbytes);
  195|   937k|    CURL_TRC_WRITE(data, "download_write header(type=%x, blen=%zu) -> %d",
  ------------------
  |  |  158|   937k|  do {                                                     \
  |  |  159|   937k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|   937k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  1.87M|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 937k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 937k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  1.87M|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|   937k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|   937k|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|   937k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 937k]
  |  |  ------------------
  ------------------
  196|   937k|                   type, nbytes, result);
  197|   937k|    return result;
  198|   937k|  }
  199|       |
  200|  7.46k|  if(!ctx->started_body &&
  ------------------
  |  Branch (200:6): [True: 1.57k, False: 5.88k]
  ------------------
  201|  1.57k|     !(type & (CLIENTWRITE_INFO | CLIENTWRITE_CONNECT))) {
  ------------------
  |  |   43|  1.57k|#define CLIENTWRITE_INFO    (1 << 1) /* meta information, not a HEADER */
  ------------------
                   !(type & (CLIENTWRITE_INFO | CLIENTWRITE_CONNECT))) {
  ------------------
  |  |   46|  1.57k|#define CLIENTWRITE_CONNECT (1 << 4) /* a CONNECT related HEADER */
  ------------------
  |  Branch (201:6): [True: 1.57k, False: 0]
  ------------------
  202|  1.57k|    Curl_rlimit_start(&data->progress.dl.rlimit, Curl_pgrs_now(data),
  203|  1.57k|                      data->req.size);
  204|  1.57k|    ctx->started_body = TRUE;
  ------------------
  |  | 1055|  1.57k|#define TRUE true
  ------------------
  205|  1.57k|  }
  206|       |
  207|       |  /* Here, we deal with REAL BODY bytes. All filtering and transfer
  208|       |   * encodings have been applied and only the true content, e.g. BODY,
  209|       |   * bytes are passed here.
  210|       |   * This allows us to check sizes, update stats, etc. independent
  211|       |   * from the protocol in play. */
  212|       |
  213|  7.46k|  if(data->req.no_body && nbytes > 0) {
  ------------------
  |  Branch (213:6): [True: 5, False: 7.45k]
  |  Branch (213:27): [True: 4, False: 1]
  ------------------
  214|       |    /* BODY arrives although we want none, bail out */
  215|      4|    streamclose(data->conn, "ignoring body");
  ------------------
  |  |  102|      4|#define streamclose(x, y) Curl_conncontrol(x, CONNCTRL_STREAM, y)
  |  |  ------------------
  |  |  |  |   92|      4|#define CONNCTRL_STREAM     2
  |  |  ------------------
  ------------------
  216|      4|    CURL_TRC_WRITE(data, "download_write body(type=%x, blen=%zu), "
  ------------------
  |  |  158|      4|  do {                                                     \
  |  |  159|      4|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|      4|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      8|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 4, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      8|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      4|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|      4|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|      4|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 4]
  |  |  ------------------
  ------------------
  217|      4|                   "did not want a BODY", type, nbytes);
  218|      4|    data->req.download_done = TRUE;
  ------------------
  |  | 1055|      4|#define TRUE true
  ------------------
  219|      4|    if(data->info.header_size)
  ------------------
  |  Branch (219:8): [True: 4, False: 0]
  ------------------
  220|       |      /* if headers have been received, this is fine */
  221|      4|      return CURLE_OK;
  222|      0|    return CURLE_WEIRD_SERVER_REPLY;
  223|      4|  }
  224|       |
  225|       |  /* Determine if we see any bytes in excess to what is allowed.
  226|       |   * We write the allowed bytes and handle excess further below.
  227|       |   * This gives deterministic BODY writes on varying buffer receive
  228|       |   * lengths. */
  229|  7.45k|  nwrite = nbytes;
  230|  7.45k|  if(data->req.maxdownload != -1) {
  ------------------
  |  Branch (230:6): [True: 569, False: 6.89k]
  ------------------
  231|    569|    size_t wmax = get_max_body_write_len(data, data->req.maxdownload);
  232|    569|    if(nwrite > wmax) {
  ------------------
  |  Branch (232:8): [True: 173, False: 396]
  ------------------
  233|    173|      excess_len = nbytes - wmax;
  234|    173|      nwrite = wmax;
  235|    173|    }
  236|       |
  237|    569|    if(nwrite == wmax) {
  ------------------
  |  Branch (237:8): [True: 179, False: 390]
  ------------------
  238|    179|      data->req.download_done = TRUE;
  ------------------
  |  | 1055|    179|#define TRUE true
  ------------------
  239|    179|    }
  240|       |
  241|    569|    if((type & CLIENTWRITE_EOS) && !data->req.no_body &&
  ------------------
  |  |   49|    569|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
  |  Branch (241:8): [True: 210, False: 359]
  |  Branch (241:36): [True: 209, False: 1]
  ------------------
  242|    209|       (data->req.size > data->req.bytecount)) {
  ------------------
  |  Branch (242:8): [True: 107, False: 102]
  ------------------
  243|    107|      failf(data, "end of response with %" FMT_OFF_T " bytes missing",
  ------------------
  |  |   62|    107|#define failf Curl_failf
  ------------------
  244|    107|            data->req.size - data->req.bytecount);
  245|    107|      return CURLE_PARTIAL_FILE;
  246|    107|    }
  247|    569|  }
  248|       |
  249|       |  /* Error on too large filesize is handled below, after writing
  250|       |   * the permitted bytes */
  251|  7.35k|  if(data->set.max_filesize && !data->req.ignorebody) {
  ------------------
  |  Branch (251:6): [True: 322, False: 7.03k]
  |  Branch (251:32): [True: 321, False: 1]
  ------------------
  252|    321|    size_t wmax = get_max_body_write_len(data, data->set.max_filesize);
  253|    321|    if(nwrite > wmax) {
  ------------------
  |  Branch (253:8): [True: 4, False: 317]
  ------------------
  254|      4|      nwrite = wmax;
  255|      4|    }
  256|    321|  }
  257|       |
  258|  7.35k|  if(!data->req.ignorebody && (nwrite || (type & CLIENTWRITE_EOS))) {
  ------------------
  |  |   49|    816|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
  |  Branch (258:6): [True: 7.18k, False: 165]
  |  Branch (258:32): [True: 6.37k, False: 816]
  |  Branch (258:42): [True: 798, False: 18]
  ------------------
  259|  7.16k|    result = Curl_cwriter_write(data, writer->next, type, buf, nwrite);
  260|  7.16k|    CURL_TRC_WRITE(data, "download_write body(type=%x, blen=%zu) -> %d",
  ------------------
  |  |  158|  7.16k|  do {                                                     \
  |  |  159|  7.16k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|  7.16k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  14.3k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 7.16k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 7.16k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  14.3k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  7.16k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|  7.16k|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|  7.16k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 7.16k]
  |  |  ------------------
  ------------------
  261|  7.16k|                   type, nbytes, result);
  262|  7.16k|    if(result)
  ------------------
  |  Branch (262:8): [True: 1, False: 7.16k]
  ------------------
  263|      1|      return result;
  264|  7.16k|  }
  265|       |
  266|       |  /* Update stats, write and report progress */
  267|  7.35k|  if(nwrite) {
  ------------------
  |  Branch (267:6): [True: 6.38k, False: 971]
  ------------------
  268|  6.38k|    data->req.bytecount += nwrite;
  269|  6.38k|    Curl_pgrs_download_inc(data, nwrite);
  270|  6.38k|  }
  271|       |
  272|  7.35k|  if(excess_len) {
  ------------------
  |  Branch (272:6): [True: 173, False: 7.17k]
  ------------------
  273|    173|    if(!data->req.ignorebody) {
  ------------------
  |  Branch (273:8): [True: 18, False: 155]
  ------------------
  274|     18|      infof(data,
  ------------------
  |  |  143|     18|  do {                               \
  |  |  144|     18|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     18|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 18, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 18]
  |  |  |  |  ------------------
  |  |  |  |  320|     18|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     18|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     18|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 18]
  |  |  ------------------
  ------------------
  275|     18|            "Excess found writing body:"
  276|     18|            " excess = %zu"
  277|     18|            ", size = %" FMT_OFF_T
  278|     18|            ", maxdownload = %" FMT_OFF_T
  279|     18|            ", bytecount = %" FMT_OFF_T,
  280|     18|            excess_len, data->req.size, data->req.maxdownload,
  281|     18|            data->req.bytecount);
  282|     18|      connclose(data->conn, "excess found in a read");
  ------------------
  |  |  103|     18|#define connclose(x, y)   Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
  |  |  ------------------
  |  |  |  |   91|     18|#define CONNCTRL_CONNECTION 1
  |  |  ------------------
  ------------------
  283|     18|    }
  284|    173|  }
  285|  7.17k|  else if((nwrite < nbytes) && !data->req.ignorebody) {
  ------------------
  |  Branch (285:11): [True: 3, False: 7.17k]
  |  Branch (285:32): [True: 3, False: 0]
  ------------------
  286|      3|    failf(data, "Exceeded the maximum allowed file size "
  ------------------
  |  |   62|      3|#define failf Curl_failf
  ------------------
  287|      3|          "(%" FMT_OFF_T ") with %" FMT_OFF_T " bytes",
  288|      3|          data->set.max_filesize, data->req.bytecount);
  289|      3|    return CURLE_FILESIZE_EXCEEDED;
  290|      3|  }
  291|       |
  292|  7.34k|  return CURLE_OK;
  293|  7.35k|}
sendf.c:get_max_body_write_len:
  160|    890|{
  161|    890|  if(limit != -1) {
  ------------------
  |  Branch (161:6): [True: 890, False: 0]
  ------------------
  162|       |    /* How much more are we allowed to write? */
  163|    890|    return curlx_sotouz_range(limit - data->req.bytecount, 0, SIZE_MAX);
  164|    890|  }
  165|      0|  return SIZE_MAX;
  166|    890|}
sendf.c:cw_raw_write:
  309|   942k|{
  310|   942k|  if(type & CLIENTWRITE_BODY && data->set.verbose && !data->req.ignorebody) {
  ------------------
  |  |   42|  1.88M|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  |  Branch (310:6): [True: 4.14k, False: 937k]
  |  Branch (310:33): [True: 0, False: 4.14k]
  |  Branch (310:54): [True: 0, False: 0]
  ------------------
  311|      0|    Curl_debug(data, CURLINFO_DATA_IN, buf, nbytes);
  312|      0|  }
  313|   942k|  return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
  314|   942k|}
sendf.c:cr_in_init:
  630|    264|{
  631|    264|  struct cr_in_ctx *ctx = reader->ctx;
  632|    264|  ctx->read_cb = data->state.fread_func;
  633|    264|  ctx->cb_user_data = data->state.in;
  634|    264|  ctx->total_len = -1;
  635|    264|  ctx->read_len = 0;
  636|    264|  return CURLE_OK;
  637|    264|}
sendf.c:cr_in_read:
  644|    207|{
  645|    207|  struct cr_in_ctx *ctx = reader->ctx;
  646|    207|  CURLcode result = CURLE_OK;
  647|    207|  size_t nread;
  648|       |
  649|    207|  ctx->is_paused = FALSE;
  ------------------
  |  | 1058|    207|#define FALSE false
  ------------------
  650|       |
  651|       |  /* Once we have errored, we will return the same error forever */
  652|    207|  if(ctx->errored) {
  ------------------
  |  Branch (652:6): [True: 0, False: 207]
  ------------------
  653|      0|    *pnread = 0;
  654|      0|    *peos = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  655|      0|    return ctx->error_result;
  656|      0|  }
  657|    207|  if(ctx->seen_eos) {
  ------------------
  |  Branch (657:6): [True: 0, False: 207]
  ------------------
  658|      0|    *pnread = 0;
  659|      0|    *peos = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  660|      0|    return CURLE_OK;
  661|      0|  }
  662|       |  /* respect length limitations */
  663|    207|  if(ctx->total_len >= 0) {
  ------------------
  |  Branch (663:6): [True: 188, False: 19]
  ------------------
  664|    188|    blen = curlx_sotouz_range(ctx->total_len - ctx->read_len, 0, blen);
  665|    188|  }
  666|    207|  nread = 0;
  667|    207|  if(ctx->read_cb && blen) {
  ------------------
  |  Branch (667:6): [True: 207, False: 0]
  |  Branch (667:22): [True: 206, False: 1]
  ------------------
  668|    206|    Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|    206|#define TRUE true
  ------------------
  669|    206|    nread = ctx->read_cb(buf, 1, blen, ctx->cb_user_data);
  670|    206|    Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|    206|#define FALSE false
  ------------------
  671|    206|    ctx->has_used_cb = TRUE;
  ------------------
  |  | 1055|    206|#define TRUE true
  ------------------
  672|    206|  }
  673|       |
  674|    207|  switch(nread) {
  675|      8|  case 0:
  ------------------
  |  Branch (675:3): [True: 8, False: 199]
  ------------------
  676|      8|    if((ctx->total_len >= 0) && (ctx->read_len < ctx->total_len)) {
  ------------------
  |  Branch (676:8): [True: 4, False: 4]
  |  Branch (676:33): [True: 3, False: 1]
  ------------------
  677|      3|      failf(data, "client read function EOF fail, "
  ------------------
  |  |   62|      3|#define failf Curl_failf
  ------------------
  678|      3|            "only %" FMT_OFF_T "/%" FMT_OFF_T " of needed bytes read",
  679|      3|            ctx->read_len, ctx->total_len);
  680|      3|      result = CURLE_READ_ERROR;
  681|      3|      break;
  682|      3|    }
  683|      5|    *pnread = 0;
  684|      5|    *peos = TRUE;
  ------------------
  |  | 1055|      5|#define TRUE true
  ------------------
  685|      5|    ctx->seen_eos = TRUE;
  ------------------
  |  | 1055|      5|#define TRUE true
  ------------------
  686|      5|    break;
  687|       |
  688|      8|  case CURL_READFUNC_ABORT:
  ------------------
  |  |  390|      8|#define CURL_READFUNC_ABORT 0x10000000
  ------------------
  |  Branch (688:3): [True: 8, False: 199]
  ------------------
  689|      8|    failf(data, "operation aborted by callback");
  ------------------
  |  |   62|      8|#define failf Curl_failf
  ------------------
  690|      8|    *pnread = 0;
  691|      8|    *peos = FALSE;
  ------------------
  |  | 1058|      8|#define FALSE false
  ------------------
  692|      8|    ctx->errored = TRUE;
  ------------------
  |  | 1055|      8|#define TRUE true
  ------------------
  693|      8|    ctx->error_result = CURLE_ABORTED_BY_CALLBACK;
  694|      8|    result = CURLE_ABORTED_BY_CALLBACK;
  695|      8|    break;
  696|       |
  697|      0|  case CURL_READFUNC_PAUSE:
  ------------------
  |  |  393|      0|#define CURL_READFUNC_PAUSE 0x10000001
  ------------------
  |  Branch (697:3): [True: 0, False: 207]
  ------------------
  698|      0|    if(data->conn->scheme->flags & PROTOPT_NONETWORK) {
  ------------------
  |  |  215|      0|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (698:8): [True: 0, False: 0]
  ------------------
  699|       |      /* protocols that work without network cannot be paused. This is
  700|       |         actually only file:// now, and it cannot pause since the transfer
  701|       |         is not done using the "normal" procedure. */
  702|      0|      failf(data, "Read callback asked for PAUSE when not supported");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  703|      0|      result = CURLE_READ_ERROR;
  704|      0|      break;
  705|      0|    }
  706|       |    /* CURL_READFUNC_PAUSE pauses read callbacks that feed socket writes */
  707|      0|    CURL_TRC_READ(data, "cr_in_read, callback returned CURL_READFUNC_PAUSE");
  ------------------
  |  |  163|      0|  do {                                                    \
  |  |  164|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|      0|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  708|      0|    ctx->is_paused = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  709|      0|    *pnread = 0;
  710|      0|    *peos = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  711|      0|    result = Curl_xfer_pause_send(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  712|      0|    break; /* nothing was read */
  713|       |
  714|    191|  default:
  ------------------
  |  Branch (714:3): [True: 191, False: 16]
  ------------------
  715|    191|    if(nread > blen) {
  ------------------
  |  Branch (715:8): [True: 0, False: 191]
  ------------------
  716|       |      /* the read function returned a too large value */
  717|      0|      failf(data, "read function returned funny value");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  718|      0|      *pnread = 0;
  719|      0|      *peos = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  720|      0|      ctx->errored = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  721|      0|      ctx->error_result = CURLE_READ_ERROR;
  722|      0|      result = CURLE_READ_ERROR;
  723|      0|      break;
  724|      0|    }
  725|    191|    ctx->read_len += nread;
  726|    191|    if(ctx->total_len >= 0)
  ------------------
  |  Branch (726:8): [True: 184, False: 7]
  ------------------
  727|    184|      ctx->seen_eos = (ctx->read_len >= ctx->total_len);
  728|    191|    *pnread = nread;
  729|    191|    *peos = (bool)ctx->seen_eos;
  730|    191|    break;
  731|    207|  }
  732|    207|  CURL_TRC_READ(data, "cr_in_read(len=%zu, total=%" FMT_OFF_T
  ------------------
  |  |  163|    207|  do {                                                    \
  |  |  164|    207|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|    207|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    414|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 207, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 207]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    414|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    207|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|    207|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|    207|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 207]
  |  |  ------------------
  ------------------
  733|    207|                ", read=%" FMT_OFF_T ") -> %d, nread=%zu, eos=%d",
  734|    207|                blen, ctx->total_len, ctx->read_len, result,
  735|    207|                *pnread, *peos);
  736|    207|  return result;
  737|    207|}
sendf.c:cr_in_needs_rewind:
  741|      9|{
  742|      9|  struct cr_in_ctx *ctx = reader->ctx;
  743|      9|  (void)data;
  744|      9|  return (bool)ctx->has_used_cb;
  745|      9|}
sendf.c:cr_in_total_length:
  749|    857|{
  750|    857|  struct cr_in_ctx *ctx = reader->ctx;
  751|    857|  (void)data;
  752|    857|  return ctx->total_len;
  753|    857|}
sendf.c:cr_in_resume_from:
  758|     36|{
  759|     36|  struct cr_in_ctx *ctx = reader->ctx;
  760|     36|  int seekerr = CURL_SEEKFUNC_CANTSEEK;
  ------------------
  |  |  382|     36|#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking cannot be done, so
  ------------------
  761|       |
  762|     36|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|     36|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (762:3): [True: 0, False: 36]
  |  Branch (762:3): [True: 36, False: 0]
  ------------------
  763|       |  /* already started reading? */
  764|     36|  if(ctx->read_len)
  ------------------
  |  Branch (764:6): [True: 0, False: 36]
  ------------------
  765|      0|    return CURLE_READ_ERROR;
  766|       |
  767|     36|  if(data->set.seek_func) {
  ------------------
  |  Branch (767:6): [True: 0, False: 36]
  ------------------
  768|      0|    Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  769|      0|    seekerr = data->set.seek_func(data->set.seek_client, offset, SEEK_SET);
  770|      0|    Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  771|      0|  }
  772|       |
  773|     36|  if(seekerr != CURL_SEEKFUNC_OK) {
  ------------------
  |  |  380|     36|#define CURL_SEEKFUNC_OK       0
  ------------------
  |  Branch (773:6): [True: 36, False: 0]
  ------------------
  774|     36|    curl_off_t passed = 0;
  775|       |
  776|     36|    if(seekerr != CURL_SEEKFUNC_CANTSEEK) {
  ------------------
  |  |  382|     36|#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking cannot be done, so
  ------------------
  |  Branch (776:8): [True: 0, False: 36]
  ------------------
  777|      0|      failf(data, "Could not seek stream");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  778|      0|      return CURLE_READ_ERROR;
  779|      0|    }
  780|       |    /* when seekerr == CURL_SEEKFUNC_CANTSEEK (cannot seek to offset) */
  781|     61|    do {
  782|     61|      char scratch[4 * 1024];
  783|     61|      size_t readthisamountnow =
  784|     61|        (offset - passed > (curl_off_t)sizeof(scratch)) ?
  ------------------
  |  Branch (784:9): [True: 51, False: 10]
  ------------------
  785|     51|        sizeof(scratch) :
  786|     61|        curlx_sotouz(offset - passed);
  787|     61|      size_t actuallyread;
  788|       |
  789|     61|      Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|     61|#define TRUE true
  ------------------
  790|     61|      actuallyread = ctx->read_cb(scratch, 1, readthisamountnow,
  791|     61|                                  ctx->cb_user_data);
  792|     61|      Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|     61|#define FALSE false
  ------------------
  793|       |
  794|     61|      passed += actuallyread;
  795|     61|      if((actuallyread == 0) || (actuallyread > readthisamountnow)) {
  ------------------
  |  Branch (795:10): [True: 25, False: 36]
  |  Branch (795:33): [True: 7, False: 29]
  ------------------
  796|       |        /* this checks for greater-than only to make sure that the
  797|       |           CURL_READFUNC_ABORT return code still aborts */
  798|     32|        failf(data, "Could only read %" FMT_OFF_T " bytes from the input",
  ------------------
  |  |   62|     32|#define failf Curl_failf
  ------------------
  799|     32|              passed);
  800|     32|        return CURLE_READ_ERROR;
  801|     32|      }
  802|     61|    } while(passed < offset);
  ------------------
  |  Branch (802:13): [True: 25, False: 4]
  ------------------
  803|     36|  }
  804|       |
  805|       |  /* now, decrease the size of the read */
  806|      4|  if(ctx->total_len > 0) {
  ------------------
  |  Branch (806:6): [True: 3, False: 1]
  ------------------
  807|      3|    ctx->total_len -= offset;
  808|       |
  809|      3|    if(ctx->total_len <= 0) {
  ------------------
  |  Branch (809:8): [True: 1, False: 2]
  ------------------
  810|      1|      failf(data, "File already completely uploaded");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  811|      1|      return CURLE_PARTIAL_FILE;
  812|      1|    }
  813|      3|  }
  814|       |  /* we have passed, proceed as normal */
  815|      3|  return CURLE_OK;
  816|      4|}
sendf.c:cr_in_cntrl:
  882|      2|{
  883|      2|  struct cr_in_ctx *ctx = reader->ctx;
  884|       |
  885|      2|  switch(opcode) {
  886|      2|  case CURL_CRCNTRL_REWIND:
  ------------------
  |  Branch (886:3): [True: 2, False: 0]
  ------------------
  887|      2|    return cr_in_rewind(data, reader);
  888|      0|  case CURL_CRCNTRL_UNPAUSE:
  ------------------
  |  Branch (888:3): [True: 0, False: 2]
  ------------------
  889|      0|    ctx->is_paused = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  890|      0|    break;
  891|      0|  case CURL_CRCNTRL_CLEAR_EOS:
  ------------------
  |  Branch (891:3): [True: 0, False: 2]
  ------------------
  892|      0|    ctx->seen_eos = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  893|      0|    break;
  894|      0|  default:
  ------------------
  |  Branch (894:3): [True: 0, False: 2]
  ------------------
  895|      0|    break;
  896|      2|  }
  897|      0|  return CURLE_OK;
  898|      2|}
sendf.c:cr_in_rewind:
  820|      2|{
  821|      2|  struct cr_in_ctx *ctx = reader->ctx;
  822|       |
  823|       |  /* If we never invoked the callback, there is noting to rewind */
  824|      2|  if(!ctx->has_used_cb)
  ------------------
  |  Branch (824:6): [True: 0, False: 2]
  ------------------
  825|      0|    return CURLE_OK;
  826|       |
  827|      2|  if(data->set.seek_func) {
  ------------------
  |  Branch (827:6): [True: 0, False: 2]
  ------------------
  828|      0|    int err;
  829|       |
  830|      0|    Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  831|      0|    err = (data->set.seek_func)(data->set.seek_client, 0, SEEK_SET);
  832|      0|    Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  833|      0|    CURL_TRC_READ(data, "cr_in, rewind via set.seek_func -> %d", err);
  ------------------
  |  |  163|      0|  do {                                                    \
  |  |  164|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|      0|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  834|      0|    if(err) {
  ------------------
  |  Branch (834:8): [True: 0, False: 0]
  ------------------
  835|      0|      failf(data, "seek callback returned error %d", err);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  836|      0|      return CURLE_SEND_FAIL_REWIND;
  837|      0|    }
  838|      0|  }
  839|      2|  else if(data->set.ioctl_func) {
  ------------------
  |  Branch (839:11): [True: 0, False: 2]
  ------------------
  840|      0|    curlioerr err;
  841|       |
  842|      0|    Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  843|      0|    err = (data->set.ioctl_func)(data, CURLIOCMD_RESTARTREAD,
  844|      0|                                 data->set.ioctl_client);
  845|      0|    Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  846|      0|    CURL_TRC_READ(data, "cr_in, rewind via set.ioctl_func -> %d", (int)err);
  ------------------
  |  |  163|      0|  do {                                                    \
  |  |  164|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|      0|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  847|      0|    if(err) {
  ------------------
  |  Branch (847:8): [True: 0, False: 0]
  ------------------
  848|      0|      failf(data, "ioctl callback returned error %d", (int)err);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  849|      0|      return CURLE_SEND_FAIL_REWIND;
  850|      0|    }
  851|      0|  }
  852|      2|  else {
  853|       |    /* If no CURLOPT_READFUNCTION is used, we know that we operate on a
  854|       |       given FILE * stream and we can actually attempt to rewind that
  855|       |       ourselves with fseek() */
  856|      2|#if defined(__clang__) && __clang_major__ >= 16
  857|      2|#pragma clang diagnostic push
  858|      2|#pragma clang diagnostic ignored "-Wcast-function-type-strict"
  859|      2|#endif
  860|      2|    if(data->state.fread_func == (curl_read_callback)fread) {
  ------------------
  |  Branch (860:8): [True: 0, False: 2]
  ------------------
  861|      0|#if defined(__clang__) && __clang_major__ >= 16
  862|      0|#pragma clang diagnostic pop
  863|      0|#endif
  864|      0|      int err = fseek(data->state.in, 0, SEEK_SET);
  865|      0|      CURL_TRC_READ(data, "cr_in, rewind via fseek -> %d(%d)",
  ------------------
  |  |  163|      0|  do {                                                    \
  |  |  164|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|      0|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  866|      0|                    (int)err, (int)errno);
  867|      0|      if(err != -1)
  ------------------
  |  Branch (867:10): [True: 0, False: 0]
  ------------------
  868|       |        /* successful rewind */
  869|      0|        return CURLE_OK;
  870|      0|    }
  871|       |
  872|       |    /* no callback set or failure above, makes us fail at once */
  873|      2|    failf(data, "necessary data rewind was not possible");
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
  874|      2|    return CURLE_SEND_FAIL_REWIND;
  875|      2|  }
  876|      0|  return CURLE_OK;
  877|      2|}
sendf.c:do_init_reader_stack:
 1100|  14.8k|{
 1101|  14.8k|  CURLcode result = CURLE_OK;
 1102|  14.8k|  curl_off_t clen;
 1103|       |
 1104|  14.8k|  DEBUGASSERT(r);
  ------------------
  |  | 1081|  14.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1104:3): [True: 0, False: 14.8k]
  |  Branch (1104:3): [True: 14.8k, False: 0]
  ------------------
 1105|  14.8k|  DEBUGASSERT(r->crt);
  ------------------
  |  | 1081|  14.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1105:3): [True: 0, False: 14.8k]
  |  Branch (1105:3): [True: 14.8k, False: 0]
  ------------------
 1106|  14.8k|  DEBUGASSERT(r->phase == CURL_CR_CLIENT);
  ------------------
  |  | 1081|  14.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1106:3): [True: 0, False: 14.8k]
  |  Branch (1106:3): [True: 14.8k, False: 0]
  ------------------
 1107|  14.8k|  DEBUGASSERT(!data->req.reader_stack);
  ------------------
  |  | 1081|  14.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1107:3): [True: 0, False: 14.8k]
  |  Branch (1107:3): [True: 14.8k, False: 0]
  ------------------
 1108|       |
 1109|  14.8k|  data->req.reader_stack = r;
 1110|  14.8k|  clen = r->crt->total_length(data, r);
 1111|       |  /* if we do not have 0 length init, and crlf conversion is wanted,
 1112|       |   * add the reader for it */
 1113|  14.8k|  if(clen && (data->set.crlf
  ------------------
  |  Branch (1113:6): [True: 932, False: 13.9k]
  |  Branch (1113:15): [True: 0, False: 932]
  ------------------
 1114|    932|#ifdef CURL_PREFER_LF_LINEENDS
 1115|    932|     || data->state.prefer_ascii
  ------------------
  |  Branch (1115:9): [True: 98, False: 834]
  ------------------
 1116|    932|#endif
 1117|    932|    )) {
 1118|     98|    result = cr_lc_add(data);
 1119|     98|    if(result)
  ------------------
  |  Branch (1119:8): [True: 0, False: 98]
  ------------------
 1120|      0|      return result;
 1121|     98|  }
 1122|       |
 1123|  14.8k|  return result;
 1124|  14.8k|}
sendf.c:cr_lc_add:
 1085|     98|{
 1086|     98|  struct Curl_creader *reader = NULL;
 1087|     98|  CURLcode result;
 1088|       |
 1089|     98|  result = Curl_creader_create(&reader, data, &cr_lc, CURL_CR_CONTENT_ENCODE);
 1090|     98|  if(!result)
  ------------------
  |  Branch (1090:6): [True: 98, False: 0]
  ------------------
 1091|     98|    result = Curl_creader_add(data, reader);
 1092|       |
 1093|     98|  if(result && reader)
  ------------------
  |  Branch (1093:6): [True: 0, False: 98]
  |  Branch (1093:16): [True: 0, False: 0]
  ------------------
 1094|      0|    Curl_creader_free(data, reader);
 1095|     98|  return result;
 1096|     98|}
sendf.c:cr_lc_init:
  966|     98|{
  967|     98|  struct cr_lc_ctx *ctx = reader->ctx;
  968|     98|  (void)data;
  969|     98|  Curl_bufq_init2(&ctx->buf, (16 * 1024), 1, BUFQ_OPT_SOFT_LIMIT);
  ------------------
  |  |  111|     98|#define BUFQ_OPT_SOFT_LIMIT  (1 << 0)
  ------------------
  970|     98|  return CURLE_OK;
  971|     98|}
sendf.c:cr_lc_read:
  985|    155|{
  986|    155|  struct cr_lc_ctx *ctx = reader->ctx;
  987|    155|  CURLcode result;
  988|    155|  size_t nread, i, start, n;
  989|    155|  bool eos;
  990|       |
  991|    155|  if(ctx->eos) {
  ------------------
  |  Branch (991:6): [True: 0, False: 155]
  ------------------
  992|      0|    *pnread = 0;
  993|      0|    *peos = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  994|      0|    return CURLE_OK;
  995|      0|  }
  996|       |
  997|    155|  if(Curl_bufq_is_empty(&ctx->buf)) {
  ------------------
  |  Branch (997:6): [True: 122, False: 33]
  ------------------
  998|    122|    if(ctx->read_eos) {
  ------------------
  |  Branch (998:8): [True: 0, False: 122]
  ------------------
  999|      0|      ctx->eos = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1000|      0|      *pnread = 0;
 1001|      0|      *peos = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1002|      0|      return CURLE_OK;
 1003|      0|    }
 1004|       |    /* Still getting data form the next reader, ctx->buf is empty */
 1005|    122|    result = Curl_creader_read(data, reader->next, buf, blen, &nread, &eos);
 1006|    122|    if(result)
  ------------------
  |  Branch (1006:8): [True: 2, False: 120]
  ------------------
 1007|      2|      return result;
 1008|    120|    ctx->read_eos = eos;
 1009|       |
 1010|    120|    if(!nread || !memchr(buf, '\n', nread)) {
  ------------------
  |  Branch (1010:8): [True: 1, False: 119]
  |  Branch (1010:18): [True: 6, False: 113]
  ------------------
 1011|       |      /* nothing to convert, return this right away */
 1012|      7|      if(nread)
  ------------------
  |  Branch (1012:10): [True: 6, False: 1]
  ------------------
 1013|      6|        ctx->prev_cr = (buf[nread - 1] == '\r');
 1014|      7|      if(ctx->read_eos)
  ------------------
  |  Branch (1014:10): [True: 6, False: 1]
  ------------------
 1015|      6|        ctx->eos = TRUE;
  ------------------
  |  | 1055|      6|#define TRUE true
  ------------------
 1016|      7|      *pnread = nread;
 1017|      7|      *peos = (bool)ctx->eos;
 1018|      7|      goto out;
 1019|      7|    }
 1020|       |
 1021|       |    /* at least one \n might need conversion to '\r\n', place into ctx->buf */
 1022|  1.15M|    for(i = start = 0; i < nread; ++i) {
  ------------------
  |  Branch (1022:24): [True: 1.15M, False: 113]
  ------------------
 1023|       |      /* if this byte is not an LF character, or if the preceding character is
 1024|       |         a CR (meaning this already is a CRLF pair), go to next */
 1025|  1.15M|      if((buf[i] != '\n') || ctx->prev_cr) {
  ------------------
  |  Branch (1025:10): [True: 546k, False: 608k]
  |  Branch (1025:30): [True: 13.3k, False: 594k]
  ------------------
 1026|   560k|        ctx->prev_cr = (buf[i] == '\r');
 1027|   560k|        continue;
 1028|   560k|      }
 1029|   594k|      ctx->prev_cr = FALSE;
  ------------------
  |  | 1058|   594k|#define FALSE false
  ------------------
 1030|       |      /* on a soft limit bufq, we do not need to check length */
 1031|   594k|      result = Curl_bufq_cwrite(&ctx->buf, buf + start, i - start, &n);
 1032|   594k|      if(!result)
  ------------------
  |  Branch (1032:10): [True: 594k, False: 0]
  ------------------
 1033|   594k|        result = Curl_bufq_cwrite(&ctx->buf, STRCONST("\r\n"), &n);
  ------------------
  |  | 1292|   594k|#define STRCONST(x) x, sizeof(x) - 1
  ------------------
 1034|   594k|      if(result)
  ------------------
  |  Branch (1034:10): [True: 0, False: 594k]
  ------------------
 1035|      0|        return result;
 1036|   594k|      start = i + 1;
 1037|   594k|    }
 1038|       |
 1039|    113|    if(start < i) { /* leftover */
  ------------------
  |  Branch (1039:8): [True: 66, False: 47]
  ------------------
 1040|     66|      result = Curl_bufq_cwrite(&ctx->buf, buf + start, i - start, &n);
 1041|     66|      if(result)
  ------------------
  |  Branch (1041:10): [True: 0, False: 66]
  ------------------
 1042|      0|        return result;
 1043|     66|    }
 1044|    113|  }
 1045|       |
 1046|    146|  DEBUGASSERT(!Curl_bufq_is_empty(&ctx->buf));
  ------------------
  |  | 1081|    146|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1046:3): [True: 0, False: 146]
  |  Branch (1046:3): [True: 146, False: 0]
  ------------------
 1047|    146|  *peos = FALSE;
  ------------------
  |  | 1058|    146|#define FALSE false
  ------------------
 1048|    146|  result = Curl_bufq_cread(&ctx->buf, buf, blen, pnread);
 1049|    146|  if(!result && ctx->read_eos && Curl_bufq_is_empty(&ctx->buf)) {
  ------------------
  |  Branch (1049:6): [True: 146, False: 0]
  |  Branch (1049:17): [True: 83, False: 63]
  |  Branch (1049:34): [True: 75, False: 8]
  ------------------
 1050|       |    /* no more data, read all, done. */
 1051|     75|    ctx->eos = TRUE;
  ------------------
  |  | 1055|     75|#define TRUE true
  ------------------
 1052|     75|    *peos = TRUE;
  ------------------
  |  | 1055|     75|#define TRUE true
  ------------------
 1053|     75|  }
 1054|       |
 1055|    153|out:
 1056|    153|  CURL_TRC_READ(data, "cr_lc_read(len=%zu) -> %d, nread=%zu, eos=%d",
  ------------------
  |  |  163|    153|  do {                                                    \
  |  |  164|    153|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|    153|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    306|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 153, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 153]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    306|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    153|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|    153|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|    153|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 153]
  |  |  ------------------
  ------------------
 1057|    153|                blen, result, *pnread, *peos);
 1058|    153|  return result;
 1059|    146|}
sendf.c:cr_lc_close:
  974|     98|{
  975|     98|  struct cr_lc_ctx *ctx = reader->ctx;
  976|     98|  (void)data;
  977|     98|  Curl_bufq_free(&ctx->buf);
  978|     98|}
sendf.c:cr_lc_total_length:
 1063|    154|{
 1064|       |  /* this reader changes length depending on input */
 1065|    154|  (void)data;
 1066|    154|  (void)reader;
 1067|    154|  return -1;
 1068|    154|}
sendf.c:cr_null_read:
 1241|     21|{
 1242|     21|  (void)data;
 1243|     21|  (void)reader;
 1244|     21|  (void)buf;
 1245|     21|  (void)blen;
 1246|     21|  *pnread = 0;
 1247|       |  *peos = TRUE;
  ------------------
  |  | 1055|     21|#define TRUE true
  ------------------
 1248|     21|  return CURLE_OK;
 1249|     21|}
sendf.c:cr_null_total_length:
 1253|  32.2k|{
 1254|       |  /* this reader changes length depending on input */
 1255|  32.2k|  (void)data;
 1256|  32.2k|  (void)reader;
 1257|  32.2k|  return 0;
 1258|  32.2k|}
sendf.c:cr_buf_read:
 1298|    133|{
 1299|    133|  struct cr_buf_ctx *ctx = reader->ctx;
 1300|    133|  size_t nread = ctx->blen - ctx->index;
 1301|       |
 1302|    133|  if(!nread || !ctx->buf) {
  ------------------
  |  Branch (1302:6): [True: 0, False: 133]
  |  Branch (1302:16): [True: 0, False: 133]
  ------------------
 1303|      0|    *pnread = 0;
 1304|      0|    *peos = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1305|      0|  }
 1306|    133|  else {
 1307|    133|    if(nread > blen)
  ------------------
  |  Branch (1307:8): [True: 1, False: 132]
  ------------------
 1308|      1|      nread = blen;
 1309|    133|    memcpy(buf, ctx->buf + ctx->index, nread);
 1310|    133|    *pnread = nread;
 1311|    133|    ctx->index += nread;
 1312|    133|    *peos = (ctx->index == ctx->blen);
 1313|    133|  }
 1314|    133|  CURL_TRC_READ(data, "cr_buf_read(len=%zu) -> 0, nread=%zu, eos=%d",
  ------------------
  |  |  163|    133|  do {                                                    \
  |  |  164|    133|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  326|    133|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    266|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 133, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 133]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    266|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    133|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|    133|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|    133|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 133]
  |  |  ------------------
  ------------------
 1315|    133|                blen, *pnread, *peos);
 1316|    133|  return CURLE_OK;
 1317|    133|}
sendf.c:cr_buf_needs_rewind:
 1321|      6|{
 1322|      6|  struct cr_buf_ctx *ctx = reader->ctx;
 1323|      6|  (void)data;
 1324|      6|  return ctx->index > 0;
 1325|      6|}
sendf.c:cr_buf_total_length:
 1345|    603|{
 1346|    603|  struct cr_buf_ctx *ctx = reader->ctx;
 1347|    603|  (void)data;
 1348|    603|  return (curl_off_t)ctx->blen;
 1349|    603|}
sendf.c:cr_buf_cntrl:
 1330|     25|{
 1331|     25|  struct cr_buf_ctx *ctx = reader->ctx;
 1332|     25|  (void)data;
 1333|     25|  switch(opcode) {
 1334|     25|  case CURL_CRCNTRL_REWIND:
  ------------------
  |  Branch (1334:3): [True: 25, False: 0]
  ------------------
 1335|     25|    ctx->index = 0;
 1336|     25|    break;
 1337|      0|  default:
  ------------------
  |  Branch (1337:3): [True: 0, False: 25]
  ------------------
 1338|      0|    break;
 1339|     25|  }
 1340|     25|  return CURLE_OK;
 1341|     25|}

Curl_setstropt:
   83|   171k|{
   84|       |  /* Release the previous storage at `charp' and replace by a dynamic storage
   85|       |     copy of `s'. Return CURLE_OK or CURLE_OUT_OF_MEMORY. */
   86|       |
   87|   171k|  curlx_safefree(*charp);
  ------------------
  |  | 1327|   171k|  do {                      \
  |  | 1328|   171k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|   171k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|   171k|    (ptr) = NULL;           \
  |  | 1330|   171k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 171k]
  |  |  ------------------
  ------------------
   88|       |
   89|   171k|  if(s) {
  ------------------
  |  Branch (89:6): [True: 171k, False: 0]
  ------------------
   90|   171k|    if(strlen(s) > CURL_MAX_INPUT_LENGTH)
  ------------------
  |  |   45|   171k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (90:8): [True: 0, False: 171k]
  ------------------
   91|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
   92|       |
   93|   171k|    *charp = curlx_strdup(s);
  ------------------
  |  | 1477|   171k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
   94|   171k|    if(!*charp)
  ------------------
  |  Branch (94:8): [True: 0, False: 171k]
  ------------------
   95|      0|      return CURLE_OUT_OF_MEMORY;
   96|   171k|  }
   97|       |
   98|   171k|  return CURLE_OK;
   99|   171k|}
Curl_setopt_SSLVERSION:
  317|  73.3k|{
  318|       |  /*
  319|       |   * Set explicit SSL version to try to connect with, as some SSL
  320|       |   * implementations are lame.
  321|       |   */
  322|  73.3k|  {
  323|  73.3k|    long version, version_max;
  324|  73.3k|    struct ssl_primary_config *primary = &data->set.ssl.primary;
  325|  73.3k|#ifndef CURL_DISABLE_PROXY
  326|  73.3k|    if(option != CURLOPT_SSLVERSION)
  ------------------
  |  Branch (326:8): [True: 36.6k, False: 36.6k]
  ------------------
  327|  36.6k|      primary = &data->set.proxy_ssl.primary;
  328|       |#else
  329|       |    if(option) {}
  330|       |#endif
  331|  73.3k|    version = C_SSLVERSION_VALUE(arg);
  ------------------
  |  |  194|  73.3k|#define C_SSLVERSION_VALUE(x)     ((x) & 0xffff)
  ------------------
  332|  73.3k|    version_max = (long)C_SSLVERSION_MAX_VALUE(arg);
  ------------------
  |  |  195|  73.3k|#define C_SSLVERSION_MAX_VALUE(x) ((unsigned long)(x) & 0xffff0000)
  ------------------
  333|       |
  334|  73.3k|    if(version < CURL_SSLVERSION_DEFAULT ||
  ------------------
  |  | 2368|   146k|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  |  Branch (334:8): [True: 0, False: 73.3k]
  ------------------
  335|  73.3k|       version == CURL_SSLVERSION_SSLv2 ||
  ------------------
  |  | 2370|   146k|#define CURL_SSLVERSION_SSLv2   2L
  ------------------
  |  Branch (335:8): [True: 1, False: 73.3k]
  ------------------
  336|  73.3k|       version == CURL_SSLVERSION_SSLv3 ||
  ------------------
  |  | 2371|   146k|#define CURL_SSLVERSION_SSLv3   3L
  ------------------
  |  Branch (336:8): [True: 1, False: 73.3k]
  ------------------
  337|  73.3k|       version >= CURL_SSLVERSION_LAST ||
  ------------------
  |  | 2377|   146k|#define CURL_SSLVERSION_LAST    8L /* never use, keep last */
  ------------------
  |  Branch (337:8): [True: 22, False: 73.3k]
  ------------------
  338|  73.3k|       version_max < CURL_SSLVERSION_MAX_NONE ||
  ------------------
  |  | 2379|   146k|#define CURL_SSLVERSION_MAX_NONE 0L
  ------------------
  |  Branch (338:8): [True: 0, False: 73.3k]
  ------------------
  339|  73.3k|       version_max >= CURL_SSLVERSION_MAX_LAST)
  ------------------
  |  | 2387|  73.3k|#define CURL_SSLVERSION_MAX_LAST    (CURL_SSLVERSION_LAST    << 16)
  |  |  ------------------
  |  |  |  | 2377|  73.3k|#define CURL_SSLVERSION_LAST    8L /* never use, keep last */
  |  |  ------------------
  ------------------
  |  Branch (339:8): [True: 4, False: 73.3k]
  ------------------
  340|     28|      return CURLE_BAD_FUNCTION_ARGUMENT;
  341|  73.3k|    if(version == CURL_SSLVERSION_DEFAULT)
  ------------------
  |  | 2368|  73.3k|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  |  Branch (341:8): [True: 73.2k, False: 35]
  ------------------
  342|  73.2k|      version = CURL_SSLVERSION_TLSv1_2;
  ------------------
  |  | 2374|  73.2k|#define CURL_SSLVERSION_TLSv1_2 6L
  ------------------
  343|       |
  344|  73.3k|    primary->version = (unsigned char)version;
  345|  73.3k|    primary->version_max = (unsigned int)version_max;
  346|  73.3k|  }
  347|      0|  return CURLE_OK;
  348|  73.3k|}
Curl_vsetopt:
 2896|   354k|{
 2897|   354k|  if(option < CURLOPTTYPE_OBJECTPOINT)
  ------------------
  |  | 1114|   354k|#define CURLOPTTYPE_OBJECTPOINT   10000
  ------------------
  |  Branch (2897:6): [True: 53.2k, False: 301k]
  ------------------
 2898|  53.2k|    return setopt_long(data, option, va_arg(param, long));
 2899|   301k|  else if(option < CURLOPTTYPE_FUNCTIONPOINT) {
  ------------------
  |  | 1115|   301k|#define CURLOPTTYPE_FUNCTIONPOINT 20000
  ------------------
  |  Branch (2899:11): [True: 230k, False: 71.1k]
  ------------------
 2900|       |    /* unfortunately, different pointer types cannot be identified any other
 2901|       |       way than being listed explicitly */
 2902|   230k|    switch(option) {
 2903|  1.52k|    case CURLOPT_HTTPHEADER:
  ------------------
  |  Branch (2903:5): [True: 1.52k, False: 228k]
  ------------------
 2904|  1.52k|    case CURLOPT_QUOTE:
  ------------------
  |  Branch (2904:5): [True: 0, False: 230k]
  ------------------
 2905|  1.52k|    case CURLOPT_POSTQUOTE:
  ------------------
  |  Branch (2905:5): [True: 0, False: 230k]
  ------------------
 2906|  1.52k|    case CURLOPT_TELNETOPTIONS:
  ------------------
  |  Branch (2906:5): [True: 0, False: 230k]
  ------------------
 2907|  1.52k|    case CURLOPT_PREQUOTE:
  ------------------
  |  Branch (2907:5): [True: 0, False: 230k]
  ------------------
 2908|  1.52k|    case CURLOPT_HTTP200ALIASES:
  ------------------
  |  Branch (2908:5): [True: 0, False: 230k]
  ------------------
 2909|  1.55k|    case CURLOPT_MAIL_RCPT:
  ------------------
  |  Branch (2909:5): [True: 27, False: 230k]
  ------------------
 2910|  1.55k|    case CURLOPT_RESOLVE:
  ------------------
  |  Branch (2910:5): [True: 0, False: 230k]
  ------------------
 2911|  1.55k|    case CURLOPT_PROXYHEADER:
  ------------------
  |  Branch (2911:5): [True: 0, False: 230k]
  ------------------
 2912|  18.7k|    case CURLOPT_CONNECT_TO:
  ------------------
  |  Branch (2912:5): [True: 17.2k, False: 213k]
  ------------------
 2913|  18.7k|      return setopt_slist(data, option, va_arg(param, struct curl_slist *));
 2914|    314|    case CURLOPT_HTTPPOST:         /* curl_httppost * */
  ------------------
  |  Branch (2914:5): [True: 314, False: 230k]
  ------------------
 2915|    841|    case CURLOPT_MIMEPOST:         /* curl_mime * */
  ------------------
  |  Branch (2915:5): [True: 527, False: 229k]
  ------------------
 2916|    841|    case CURLOPT_STDERR:           /* FILE * */
  ------------------
  |  Branch (2916:5): [True: 0, False: 230k]
  ------------------
 2917|  1.49k|    case CURLOPT_SHARE:            /* CURLSH * */
  ------------------
  |  Branch (2917:5): [True: 649, False: 229k]
  ------------------
 2918|  1.49k|    case CURLOPT_STREAM_DEPENDS:   /* CURL * */
  ------------------
  |  Branch (2918:5): [True: 0, False: 230k]
  ------------------
 2919|  1.49k|    case CURLOPT_STREAM_DEPENDS_E: /* CURL * */
  ------------------
  |  Branch (2919:5): [True: 0, False: 230k]
  ------------------
 2920|  1.49k|    case CURLOPT_CURLU:            /* CURLU * */
  ------------------
  |  Branch (2920:5): [True: 0, False: 230k]
  ------------------
 2921|  1.49k|      return setopt_pointers(data, option, param);
 2922|   210k|    default:
  ------------------
  |  Branch (2922:5): [True: 210k, False: 20.2k]
  ------------------
 2923|   210k|      break;
 2924|   230k|    }
 2925|       |    /* the char pointer options */
 2926|   210k|    return setopt_cptr(data, option, va_arg(param, char *));
 2927|   230k|  }
 2928|  71.1k|  else if(option < CURLOPTTYPE_OFF_T)
  ------------------
  |  | 1116|  71.1k|#define CURLOPTTYPE_OFF_T         30000
  ------------------
  |  Branch (2928:11): [True: 69.4k, False: 1.70k]
  ------------------
 2929|  69.4k|    return setopt_func(data, option, param);
 2930|  1.70k|  else if(option < CURLOPTTYPE_BLOB)
  ------------------
  |  | 1117|  1.70k|#define CURLOPTTYPE_BLOB          40000
  ------------------
  |  Branch (2930:11): [True: 1.70k, False: 0]
  ------------------
 2931|  1.70k|    return setopt_offt(data, option, va_arg(param, curl_off_t));
 2932|      0|  return setopt_blob(data, option, va_arg(param, struct curl_blob *));
 2933|   354k|}
curl_easy_setopt:
 2945|   354k|{
 2946|   354k|  va_list arg;
 2947|   354k|  CURLcode result;
 2948|   354k|  struct Curl_easy *data = curl;
 2949|       |
 2950|   354k|  if(!data)
  ------------------
  |  Branch (2950:6): [True: 0, False: 354k]
  ------------------
 2951|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 2952|       |
 2953|   354k|  va_start(arg, option);
 2954|       |
 2955|   354k|  result = Curl_vsetopt(data, option, arg);
 2956|       |
 2957|   354k|  va_end(arg);
 2958|   354k|  if(result == CURLE_BAD_FUNCTION_ARGUMENT)
  ------------------
  |  Branch (2958:6): [True: 577, False: 354k]
  ------------------
 2959|    577|    failf(data, "setopt 0x%x got bad argument", option);
  ------------------
  |  |   62|    577|#define failf Curl_failf
  ------------------
 2960|   354k|  return result;
 2961|   354k|}
setopt.c:setopt_long:
 1317|  53.2k|{
 1318|  53.2k|  typedef CURLcode (*setoptfunc)(struct Curl_easy *data,
 1319|  53.2k|                                 CURLoption option, long arg);
 1320|  53.2k|  static const setoptfunc setopt_call[] = {
 1321|  53.2k|    setopt_long_bool,
 1322|  53.2k|    setopt_long_net,
 1323|  53.2k|    setopt_long_http,
 1324|  53.2k|    setopt_long_proxy,
 1325|  53.2k|    setopt_long_ssl,
 1326|  53.2k|    setopt_long_proto,
 1327|  53.2k|    setopt_long_misc
 1328|  53.2k|  };
 1329|  53.2k|  size_t i;
 1330|       |
 1331|   122k|  for(i = 0; i < CURL_ARRAYSIZE(setopt_call); i++) {
  ------------------
  |  | 1294|   122k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (1331:14): [True: 122k, False: 7]
  ------------------
 1332|   122k|    CURLcode result = setopt_call[i](data, option, arg);
 1333|   122k|    if(result != CURLE_UNKNOWN_OPTION)
  ------------------
  |  Branch (1333:8): [True: 53.2k, False: 68.9k]
  ------------------
 1334|  53.2k|      return result;
 1335|   122k|  }
 1336|      7|  return CURLE_UNKNOWN_OPTION;
 1337|  53.2k|}
setopt.c:setopt_long_bool:
  420|  53.2k|{
  421|  53.2k|  bool enabled = !!arg;
  422|  53.2k|  int ok = 1;
  423|  53.2k|  struct UserDefined *s = &data->set;
  424|  53.2k|  switch(option) {
  425|     56|  case CURLOPT_FORBID_REUSE:
  ------------------
  |  Branch (425:3): [True: 56, False: 53.2k]
  ------------------
  426|       |    /*
  427|       |     * When this transfer is done, it must not be left to be reused by a
  428|       |     * subsequent transfer but shall be closed immediately.
  429|       |     */
  430|     56|    s->reuse_forbid = enabled;
  431|     56|    break;
  432|     40|  case CURLOPT_FRESH_CONNECT:
  ------------------
  |  Branch (432:3): [True: 40, False: 53.2k]
  ------------------
  433|       |    /*
  434|       |     * This transfer shall not use a previously cached connection but
  435|       |     * should be made with a fresh new connect!
  436|       |     */
  437|     40|    s->reuse_fresh = enabled;
  438|     40|    break;
  439|      0|  case CURLOPT_VERBOSE:
  ------------------
  |  Branch (439:3): [True: 0, False: 53.2k]
  ------------------
  440|       |    /*
  441|       |     * Verbose means infof() calls that give a lot of information about
  442|       |     * the connection and transfer procedures as well as internal choices.
  443|       |     */
  444|      0|    s->verbose = enabled;
  445|      0|    break;
  446|     24|  case CURLOPT_HEADER:
  ------------------
  |  Branch (446:3): [True: 24, False: 53.2k]
  ------------------
  447|       |    /*
  448|       |     * Set to include the header in the general data output stream.
  449|       |     */
  450|     24|    s->include_header = enabled;
  451|     24|    break;
  452|     58|  case CURLOPT_NOPROGRESS:
  ------------------
  |  Branch (452:3): [True: 58, False: 53.2k]
  ------------------
  453|       |    /*
  454|       |     * Shut off the internal supported progress meter
  455|       |     */
  456|     58|    data->progress.hide = enabled;
  457|     58|    break;
  458|    185|  case CURLOPT_NOBODY:
  ------------------
  |  Branch (458:3): [True: 185, False: 53.0k]
  ------------------
  459|       |    /*
  460|       |     * Do not include the body part in the output data stream.
  461|       |     */
  462|    185|    s->opt_no_body = enabled;
  463|    185|#ifndef CURL_DISABLE_HTTP
  464|    185|    if(s->opt_no_body)
  ------------------
  |  Branch (464:8): [True: 183, False: 2]
  ------------------
  465|       |      /* in HTTP lingo, no body means using the HEAD request... */
  466|    183|      s->method = HTTPREQ_HEAD;
  467|      2|    else if(s->method == HTTPREQ_HEAD)
  ------------------
  |  Branch (467:13): [True: 0, False: 2]
  ------------------
  468|      0|      s->method = HTTPREQ_GET;
  469|    185|#endif
  470|    185|    break;
  471|     18|  case CURLOPT_FAILONERROR:
  ------------------
  |  Branch (471:3): [True: 18, False: 53.2k]
  ------------------
  472|       |    /*
  473|       |     * Do not output the >=400 error code HTML-page, but instead only
  474|       |     * return error.
  475|       |     */
  476|     18|    s->http_fail_on_error = enabled;
  477|     18|    break;
  478|      2|  case CURLOPT_KEEP_SENDING_ON_ERROR:
  ------------------
  |  Branch (478:3): [True: 2, False: 53.2k]
  ------------------
  479|      2|    s->http_keep_sending_on_error = enabled;
  480|      2|    break;
  481|    388|  case CURLOPT_UPLOAD:
  ------------------
  |  Branch (481:3): [True: 388, False: 52.8k]
  ------------------
  482|    388|  case CURLOPT_PUT:
  ------------------
  |  Branch (482:3): [True: 0, False: 53.2k]
  ------------------
  483|       |    /*
  484|       |     * We want to send data to the remote host. If this is HTTP, that equals
  485|       |     * using the PUT request.
  486|       |     */
  487|    388|    if(enabled) {
  ------------------
  |  Branch (487:8): [True: 388, False: 0]
  ------------------
  488|       |      /* If this is HTTP, PUT is what's needed to "upload" */
  489|    388|      s->method = HTTPREQ_PUT;
  490|    388|      s->opt_no_body = FALSE; /* this is implied */
  ------------------
  |  | 1058|    388|#define FALSE false
  ------------------
  491|    388|    }
  492|      0|    else
  493|       |      /* In HTTP, the opposite of upload is GET (unless NOBODY is true as
  494|       |         then this can be changed to HEAD later on) */
  495|      0|      s->method = HTTPREQ_GET;
  496|    388|    break;
  497|     49|  case CURLOPT_FILETIME:
  ------------------
  |  Branch (497:3): [True: 49, False: 53.2k]
  ------------------
  498|       |    /*
  499|       |     * Try to get the file time of the remote document. The time will
  500|       |     * later (possibly) become available using curl_easy_getinfo().
  501|       |     */
  502|     49|    s->get_filetime = enabled;
  503|     49|    break;
  504|      0|#ifndef CURL_DISABLE_HTTP
  505|      7|  case CURLOPT_HTTP09_ALLOWED:
  ------------------
  |  Branch (505:3): [True: 7, False: 53.2k]
  ------------------
  506|      7|    s->http09_allowed = enabled;
  507|      7|    break;
  508|      0|#ifndef CURL_DISABLE_COOKIES
  509|      2|  case CURLOPT_COOKIESESSION:
  ------------------
  |  Branch (509:3): [True: 2, False: 53.2k]
  ------------------
  510|       |    /*
  511|       |     * Set this option to TRUE to start a new "cookie session". It will
  512|       |     * prevent the forthcoming read-cookies-from-file actions to accept
  513|       |     * cookies that are marked as being session cookies, as they belong to a
  514|       |     * previous session.
  515|       |     */
  516|      2|    s->cookiesession = enabled;
  517|      2|    break;
  518|      0|#endif
  519|     23|  case CURLOPT_AUTOREFERER:
  ------------------
  |  Branch (519:3): [True: 23, False: 53.2k]
  ------------------
  520|       |    /*
  521|       |     * Switch on automatic referer that gets set if curl follows locations.
  522|       |     */
  523|     23|    s->http_auto_referer = enabled;
  524|     23|    break;
  525|    462|  case CURLOPT_TRANSFER_ENCODING:
  ------------------
  |  Branch (525:3): [True: 462, False: 52.8k]
  ------------------
  526|    462|    s->http_transfer_encoding = enabled;
  527|    462|    break;
  528|     13|  case CURLOPT_UNRESTRICTED_AUTH:
  ------------------
  |  Branch (528:3): [True: 13, False: 53.2k]
  ------------------
  529|       |    /*
  530|       |     * Send authentication (user+password) when following locations, even when
  531|       |     * hostname changed.
  532|       |     */
  533|     13|    s->allow_auth_to_other_hosts = enabled;
  534|     13|    break;
  535|     56|  case CURLOPT_HTTP_TRANSFER_DECODING:
  ------------------
  |  Branch (535:3): [True: 56, False: 53.2k]
  ------------------
  536|       |    /*
  537|       |     * disable libcurl transfer encoding is used
  538|       |     */
  539|     56|    s->http_te_skip = !enabled; /* reversed */
  540|     56|    break;
  541|      3|  case CURLOPT_HTTP_CONTENT_DECODING:
  ------------------
  |  Branch (541:3): [True: 3, False: 53.2k]
  ------------------
  542|       |    /*
  543|       |     * raw data passed to the application when content encoding is used
  544|       |     */
  545|      3|    s->http_ce_skip = !enabled; /* reversed */
  546|      3|    break;
  547|      3|  case CURLOPT_HTTPGET:
  ------------------
  |  Branch (547:3): [True: 3, False: 53.2k]
  ------------------
  548|       |    /*
  549|       |     * Set to force us do HTTP GET
  550|       |     */
  551|      3|    if(enabled) {
  ------------------
  |  Branch (551:8): [True: 2, False: 1]
  ------------------
  552|      2|      s->method = HTTPREQ_GET;
  553|      2|      s->opt_no_body = FALSE; /* this is implied */
  ------------------
  |  | 1058|      2|#define FALSE false
  ------------------
  554|      2|    }
  555|      3|    break;
  556|     91|  case CURLOPT_POST:
  ------------------
  |  Branch (556:3): [True: 91, False: 53.1k]
  ------------------
  557|       |    /* Does this option serve a purpose anymore? Yes it does, when
  558|       |       CURLOPT_POSTFIELDS is not used and the POST data is read off the
  559|       |       callback! */
  560|     91|    if(enabled) {
  ------------------
  |  Branch (560:8): [True: 89, False: 2]
  ------------------
  561|     89|      s->method = HTTPREQ_POST;
  562|     89|      s->opt_no_body = FALSE; /* this is implied */
  ------------------
  |  | 1058|     89|#define FALSE false
  ------------------
  563|     89|    }
  564|      2|    else
  565|      2|      s->method = HTTPREQ_GET;
  566|     91|    break;
  567|      0|#endif /* !CURL_DISABLE_HTTP */
  568|      0|#ifndef CURL_DISABLE_PROXY
  569|      7|  case CURLOPT_HTTPPROXYTUNNEL:
  ------------------
  |  Branch (569:3): [True: 7, False: 53.2k]
  ------------------
  570|       |    /*
  571|       |     * Tunnel operations through the proxy instead of normal proxy use
  572|       |     */
  573|      7|    s->tunnel_thru_httpproxy = enabled;
  574|      7|    break;
  575|     17|  case CURLOPT_HAPROXYPROTOCOL:
  ------------------
  |  Branch (575:3): [True: 17, False: 53.2k]
  ------------------
  576|       |    /*
  577|       |     * Set to send the HAProxy Proxy Protocol header
  578|       |     */
  579|     17|    s->haproxyprotocol = enabled;
  580|     17|    break;
  581|     38|  case CURLOPT_PROXY_SSL_VERIFYPEER:
  ------------------
  |  Branch (581:3): [True: 38, False: 53.2k]
  ------------------
  582|       |    /*
  583|       |     * Enable peer SSL verifying for proxy.
  584|       |     */
  585|     38|    s->proxy_ssl.primary.verifypeer = enabled;
  586|       |
  587|       |    /* Update the current connection proxy_ssl_config. */
  588|     38|    Curl_ssl_conn_config_update(data, TRUE);
  ------------------
  |  | 1055|     38|#define TRUE true
  ------------------
  589|     38|    break;
  590|      9|  case CURLOPT_PROXY_SSL_VERIFYHOST:
  ------------------
  |  Branch (590:3): [True: 9, False: 53.2k]
  ------------------
  591|       |    /*
  592|       |     * Enable verification of the hostname in the peer certificate for proxy
  593|       |     */
  594|      9|    s->proxy_ssl.primary.verifyhost = enabled;
  595|      9|    ok = 2;
  596|       |    /* Update the current connection proxy_ssl_config. */
  597|      9|    Curl_ssl_conn_config_update(data, TRUE);
  ------------------
  |  | 1055|      9|#define TRUE true
  ------------------
  598|      9|    break;
  599|      6|  case CURLOPT_PROXY_TRANSFER_MODE:
  ------------------
  |  Branch (599:3): [True: 6, False: 53.2k]
  ------------------
  600|       |    /*
  601|       |     * set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy
  602|       |     */
  603|      6|    s->proxy_transfer_mode = enabled;
  604|      6|    break;
  605|      0|#endif /* !CURL_DISABLE_PROXY */
  606|       |#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
  607|       |  case CURLOPT_SOCKS5_GSSAPI_NEC:
  608|       |    /*
  609|       |     * Set flag for NEC SOCKS5 support
  610|       |     */
  611|       |    s->socks5_gssapi_nec = enabled;
  612|       |    break;
  613|       |#endif
  614|      0|#ifdef CURL_LIST_ONLY_PROTOCOL
  615|      3|  case CURLOPT_DIRLISTONLY:
  ------------------
  |  Branch (615:3): [True: 3, False: 53.2k]
  ------------------
  616|       |    /*
  617|       |     * An option that changes the command to one that asks for a list only, no
  618|       |     * file info details. Used for FTP, POP3 and SFTP.
  619|       |     */
  620|      3|    s->list_only = enabled;
  621|      3|    break;
  622|      0|#endif
  623|      6|  case CURLOPT_APPEND:
  ------------------
  |  Branch (623:3): [True: 6, False: 53.2k]
  ------------------
  624|       |    /*
  625|       |     * We want to upload and append to an existing file. Used for FTP and
  626|       |     * SFTP.
  627|       |     */
  628|      6|    s->remote_append = enabled;
  629|      6|    break;
  630|      0|#ifndef CURL_DISABLE_FTP
  631|      4|  case CURLOPT_FTP_USE_EPRT:
  ------------------
  |  Branch (631:3): [True: 4, False: 53.2k]
  ------------------
  632|      4|    s->ftp_use_eprt = enabled;
  633|      4|    break;
  634|      2|  case CURLOPT_FTP_USE_EPSV:
  ------------------
  |  Branch (634:3): [True: 2, False: 53.2k]
  ------------------
  635|      2|    s->ftp_use_epsv = enabled;
  636|      2|    break;
  637|      7|  case CURLOPT_FTP_USE_PRET:
  ------------------
  |  Branch (637:3): [True: 7, False: 53.2k]
  ------------------
  638|      7|    s->ftp_use_pret = enabled;
  639|      7|    break;
  640|      4|  case CURLOPT_FTP_SKIP_PASV_IP:
  ------------------
  |  Branch (640:3): [True: 4, False: 53.2k]
  ------------------
  641|       |    /*
  642|       |     * Enable or disable FTP_SKIP_PASV_IP, which will disable/enable the
  643|       |     * bypass of the IP address in PASV responses.
  644|       |     */
  645|      4|    s->ftp_skip_ip = enabled;
  646|      4|    break;
  647|    588|  case CURLOPT_WILDCARDMATCH:
  ------------------
  |  Branch (647:3): [True: 588, False: 52.6k]
  ------------------
  648|    588|    s->wildcard_enabled = enabled;
  649|    588|    break;
  650|      0|#endif
  651|      0|  case CURLOPT_CRLF:
  ------------------
  |  Branch (651:3): [True: 0, False: 53.2k]
  ------------------
  652|       |    /*
  653|       |     * Kludgy option to enable CRLF conversions. Subject for removal.
  654|       |     */
  655|      0|    s->crlf = enabled;
  656|      0|    break;
  657|      0|#ifndef CURL_DISABLE_TFTP
  658|      7|  case CURLOPT_TFTP_NO_OPTIONS:
  ------------------
  |  Branch (658:3): [True: 7, False: 53.2k]
  ------------------
  659|       |    /*
  660|       |     * Option that prevents libcurl from sending TFTP option requests to the
  661|       |     * server.
  662|       |     */
  663|      7|    s->tftp_no_options = enabled;
  664|      7|    break;
  665|      0|#endif /* !CURL_DISABLE_TFTP */
  666|     76|  case CURLOPT_TRANSFERTEXT:
  ------------------
  |  Branch (666:3): [True: 76, False: 53.2k]
  ------------------
  667|       |    /*
  668|       |     * This option was previously named 'FTPASCII'. Renamed to work with
  669|       |     * more protocols than merely FTP.
  670|       |     *
  671|       |     * Transfer using ASCII (instead of BINARY).
  672|       |     */
  673|     76|    s->prefer_ascii = enabled;
  674|     76|    break;
  675|    659|  case CURLOPT_SSL_VERIFYPEER:
  ------------------
  |  Branch (675:3): [True: 659, False: 52.6k]
  ------------------
  676|       |    /*
  677|       |     * Enable peer SSL verifying.
  678|       |     */
  679|    659|    s->ssl.primary.verifypeer = enabled;
  680|       |
  681|       |    /* Update the current connection ssl_config. */
  682|    659|    Curl_ssl_conn_config_update(data, FALSE);
  ------------------
  |  | 1058|    659|#define FALSE false
  ------------------
  683|    659|    break;
  684|      0|#ifndef CURL_DISABLE_DOH
  685|      3|  case CURLOPT_DOH_SSL_VERIFYPEER:
  ------------------
  |  Branch (685:3): [True: 3, False: 53.2k]
  ------------------
  686|       |    /*
  687|       |     * Enable peer SSL verifying for DoH.
  688|       |     */
  689|      3|    s->doh_verifypeer = enabled;
  690|      3|    break;
  691|      5|  case CURLOPT_DOH_SSL_VERIFYHOST:
  ------------------
  |  Branch (691:3): [True: 5, False: 53.2k]
  ------------------
  692|       |    /*
  693|       |     * Enable verification of the hostname in the peer certificate for DoH
  694|       |     */
  695|      5|    s->doh_verifyhost = enabled;
  696|      5|    ok = 2;
  697|      5|    break;
  698|      8|  case CURLOPT_DOH_SSL_VERIFYSTATUS:
  ------------------
  |  Branch (698:3): [True: 8, False: 53.2k]
  ------------------
  699|       |    /*
  700|       |     * Enable certificate status verifying for DoH.
  701|       |     */
  702|      8|    if(!Curl_ssl_cert_status_request())
  ------------------
  |  Branch (702:8): [True: 0, False: 8]
  ------------------
  703|      0|      return CURLE_NOT_BUILT_IN;
  704|       |
  705|      8|    s->doh_verifystatus = enabled;
  706|      8|    ok = 2;
  707|      8|    break;
  708|      0|#endif /* !CURL_DISABLE_DOH */
  709|    658|  case CURLOPT_SSL_VERIFYHOST:
  ------------------
  |  Branch (709:3): [True: 658, False: 52.6k]
  ------------------
  710|       |    /*
  711|       |     * Enable verification of the hostname in the peer certificate
  712|       |     */
  713|       |
  714|       |    /* Obviously people are not reading documentation and too many thought
  715|       |       this argument took a boolean when it was not and misused it.
  716|       |       Treat 1 and 2 the same */
  717|    658|    s->ssl.primary.verifyhost = enabled;
  718|    658|    ok = 2;
  719|       |
  720|       |    /* Update the current connection ssl_config. */
  721|    658|    Curl_ssl_conn_config_update(data, FALSE);
  ------------------
  |  | 1058|    658|#define FALSE false
  ------------------
  722|    658|    break;
  723|    658|  case CURLOPT_SSL_VERIFYSTATUS:
  ------------------
  |  Branch (723:3): [True: 658, False: 52.6k]
  ------------------
  724|       |    /*
  725|       |     * Enable certificate status verifying.
  726|       |     */
  727|    658|    if(!Curl_ssl_cert_status_request())
  ------------------
  |  Branch (727:8): [True: 0, False: 658]
  ------------------
  728|      0|      return CURLE_NOT_BUILT_IN;
  729|       |
  730|    658|    s->ssl.primary.verifystatus = enabled;
  731|       |
  732|       |    /* Update the current connection ssl_config. */
  733|    658|    Curl_ssl_conn_config_update(data, FALSE);
  ------------------
  |  | 1058|    658|#define FALSE false
  ------------------
  734|    658|    break;
  735|      8|  case CURLOPT_CERTINFO:
  ------------------
  |  Branch (735:3): [True: 8, False: 53.2k]
  ------------------
  736|      8|#ifdef USE_SSL
  737|      8|    if(Curl_ssl_supports(data, SSLSUPP_CERTINFO))
  ------------------
  |  |   36|      8|#define SSLSUPP_CERTINFO     (1 << 1) /* supports CURLOPT_CERTINFO */
  ------------------
  |  Branch (737:8): [True: 8, False: 0]
  ------------------
  738|      8|      s->ssl.certinfo = enabled;
  739|      0|    else
  740|      0|#endif
  741|      0|      return CURLE_NOT_BUILT_IN;
  742|      8|    break;
  743|     16|  case CURLOPT_NOSIGNAL:
  ------------------
  |  Branch (743:3): [True: 16, False: 53.2k]
  ------------------
  744|       |    /*
  745|       |     * The application asks not to set any signal() or alarm() handlers,
  746|       |     * even when using a timeout.
  747|       |     */
  748|     16|    s->no_signal = enabled;
  749|     16|    break;
  750|      4|  case CURLOPT_TCP_NODELAY:
  ------------------
  |  Branch (750:3): [True: 4, False: 53.2k]
  ------------------
  751|       |    /*
  752|       |     * Enable or disable TCP_NODELAY, which will disable/enable the Nagle
  753|       |     * algorithm
  754|       |     */
  755|      4|    s->tcp_nodelay = enabled;
  756|      4|    break;
  757|     15|  case CURLOPT_IGNORE_CONTENT_LENGTH:
  ------------------
  |  Branch (757:3): [True: 15, False: 53.2k]
  ------------------
  758|     15|    s->ignorecl = enabled;
  759|     15|    break;
  760|      4|  case CURLOPT_SSL_SESSIONID_CACHE:
  ------------------
  |  Branch (760:3): [True: 4, False: 53.2k]
  ------------------
  761|      4|    s->ssl.primary.cache_session = enabled;
  762|      4|#ifndef CURL_DISABLE_PROXY
  763|      4|    s->proxy_ssl.primary.cache_session = s->ssl.primary.cache_session;
  764|      4|#endif
  765|      4|    break;
  766|       |#ifdef USE_SSH
  767|       |  case CURLOPT_SSH_COMPRESSION:
  768|       |    s->ssh_compression = enabled;
  769|       |    break;
  770|       |#endif /* !USE_SSH */
  771|      0|#ifndef CURL_DISABLE_SMTP
  772|      5|  case CURLOPT_MAIL_RCPT_ALLOWFAILS:
  ------------------
  |  Branch (772:3): [True: 5, False: 53.2k]
  ------------------
  773|       |    /* allow RCPT TO command to fail for some recipients */
  774|      5|    s->mail_rcpt_allowfails = enabled;
  775|      5|    break;
  776|      0|#endif /* !CURL_DISABLE_SMTP */
  777|      3|  case CURLOPT_SASL_IR:
  ------------------
  |  Branch (777:3): [True: 3, False: 53.2k]
  ------------------
  778|       |    /* Enable/disable SASL initial response */
  779|      3|    s->sasl_ir = enabled;
  780|      3|    break;
  781|     33|  case CURLOPT_TCP_KEEPALIVE:
  ------------------
  |  Branch (781:3): [True: 33, False: 53.2k]
  ------------------
  782|     33|    s->tcp_keepalive = enabled;
  783|     33|    break;
  784|      4|  case CURLOPT_TCP_FASTOPEN:
  ------------------
  |  Branch (784:3): [True: 4, False: 53.2k]
  ------------------
  785|      4|#if defined(CONNECT_DATA_IDEMPOTENT) || defined(MSG_FASTOPEN) || \
  786|      4|  defined(TCP_FASTOPEN_CONNECT)
  787|      4|    s->tcp_fastopen = enabled;
  788|      4|    break;
  789|       |#else
  790|       |    return CURLE_NOT_BUILT_IN;
  791|       |#endif
  792|     16|  case CURLOPT_SSL_ENABLE_ALPN:
  ------------------
  |  Branch (792:3): [True: 16, False: 53.2k]
  ------------------
  793|     16|    s->ssl_enable_alpn = enabled;
  794|     16|    break;
  795|      4|  case CURLOPT_PATH_AS_IS:
  ------------------
  |  Branch (795:3): [True: 4, False: 53.2k]
  ------------------
  796|      4|    s->path_as_is = enabled;
  797|      4|    break;
  798|    670|  case CURLOPT_PIPEWAIT:
  ------------------
  |  Branch (798:3): [True: 670, False: 52.6k]
  ------------------
  799|    670|    s->pipewait = enabled;
  800|    670|    break;
  801|     17|  case CURLOPT_SUPPRESS_CONNECT_HEADERS:
  ------------------
  |  Branch (801:3): [True: 17, False: 53.2k]
  ------------------
  802|     17|    s->suppress_connect_headers = enabled;
  803|     17|    break;
  804|      0|#ifndef CURL_DISABLE_SHUFFLE_DNS
  805|     46|  case CURLOPT_DNS_SHUFFLE_ADDRESSES:
  ------------------
  |  Branch (805:3): [True: 46, False: 53.2k]
  ------------------
  806|     46|    s->dns_shuffle_addresses = enabled;
  807|     46|    break;
  808|      0|#endif
  809|      5|  case CURLOPT_DISALLOW_USERNAME_IN_URL:
  ------------------
  |  Branch (809:3): [True: 5, False: 53.2k]
  ------------------
  810|      5|    s->disallow_username_in_url = enabled;
  811|      5|    break;
  812|      5|  case CURLOPT_QUICK_EXIT:
  ------------------
  |  Branch (812:3): [True: 5, False: 53.2k]
  ------------------
  813|      5|    s->quick_exit = enabled;
  814|      5|    break;
  815|  48.1k|  default:
  ------------------
  |  Branch (815:3): [True: 48.1k, False: 5.10k]
  ------------------
  816|  48.1k|    return CURLE_UNKNOWN_OPTION;
  817|  53.2k|  }
  818|  5.10k|  if((arg > ok) || (arg < 0))
  ------------------
  |  Branch (818:6): [True: 1.90k, False: 3.20k]
  |  Branch (818:20): [True: 0, False: 3.20k]
  ------------------
  819|       |    /* reserve other values for future use */
  820|  1.90k|    infof(data, "boolean setopt(%d) got unsupported argument %ld,"
  ------------------
  |  |  143|  1.90k|  do {                               \
  |  |  144|  1.90k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  1.90k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 1.90k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.90k]
  |  |  |  |  ------------------
  |  |  |  |  320|  1.90k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.90k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  1.90k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1.90k]
  |  |  ------------------
  ------------------
  821|  5.10k|          " treated as %d", option, arg, enabled);
  822|       |
  823|  5.10k|  return CURLE_OK;
  824|  53.2k|}
setopt.c:setopt_long_net:
  839|  48.1k|{
  840|  48.1k|  CURLcode result = CURLE_OK;
  841|  48.1k|  struct UserDefined *s = &data->set;
  842|       |
  843|  48.1k|  switch(option) {
  844|    109|  case CURLOPT_DNS_CACHE_TIMEOUT:
  ------------------
  |  Branch (844:3): [True: 109, False: 48.0k]
  ------------------
  845|    109|    if(arg != -1)
  ------------------
  |  Branch (845:8): [True: 109, False: 0]
  ------------------
  846|    109|      return setopt_set_timeout_sec(&s->dns_cache_timeout_ms, arg);
  847|      0|    s->dns_cache_timeout_ms = -1;
  848|      0|    break;
  849|     54|  case CURLOPT_MAXCONNECTS:
  ------------------
  |  Branch (849:3): [True: 54, False: 48.1k]
  ------------------
  850|     54|    result = value_range(&arg, 1, 1, INT_MAX);
  851|     54|    if(!result)
  ------------------
  |  Branch (851:8): [True: 53, False: 1]
  ------------------
  852|     53|      s->maxconnects = (uint32_t)arg;
  853|     54|    break;
  854|  17.2k|  case CURLOPT_SERVER_RESPONSE_TIMEOUT:
  ------------------
  |  Branch (854:3): [True: 17.2k, False: 30.9k]
  ------------------
  855|  17.2k|    return setopt_set_timeout_sec(&s->server_response_timeout, arg);
  856|     41|  case CURLOPT_SERVER_RESPONSE_TIMEOUT_MS:
  ------------------
  |  Branch (856:3): [True: 41, False: 48.1k]
  ------------------
  857|     41|    return setopt_set_timeout_ms(&s->server_response_timeout, arg);
  858|    125|  case CURLOPT_LOW_SPEED_LIMIT:
  ------------------
  |  Branch (858:3): [True: 125, False: 48.0k]
  ------------------
  859|    125|    if(arg < 0)
  ------------------
  |  Branch (859:8): [True: 0, False: 125]
  ------------------
  860|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  861|    125|    else
  862|    125|      s->low_speed_limit = arg;
  863|    125|    break;
  864|    116|  case CURLOPT_LOW_SPEED_TIME:
  ------------------
  |  Branch (864:3): [True: 116, False: 48.0k]
  ------------------
  865|    116|    result = value_range(&arg, 0, 0, USHRT_MAX);
  866|    116|    if(!result)
  ------------------
  |  Branch (866:8): [True: 116, False: 0]
  ------------------
  867|    116|      s->low_speed_time = (uint16_t)arg;
  868|    116|    break;
  869|     68|  case CURLOPT_PORT:
  ------------------
  |  Branch (869:3): [True: 68, False: 48.1k]
  ------------------
  870|     68|    if((arg < 0) || (arg > 65535))
  ------------------
  |  Branch (870:8): [True: 0, False: 68]
  |  Branch (870:21): [True: 24, False: 44]
  ------------------
  871|     24|      return CURLE_BAD_FUNCTION_ARGUMENT;
  872|     44|    s->use_port = (unsigned short)arg;
  873|     44|    break;
  874|      0|  case CURLOPT_TIMEOUT:
  ------------------
  |  Branch (874:3): [True: 0, False: 48.1k]
  ------------------
  875|      0|    return setopt_set_timeout_sec(&s->timeout, arg);
  876|  17.8k|  case CURLOPT_TIMEOUT_MS:
  ------------------
  |  Branch (876:3): [True: 17.8k, False: 30.3k]
  ------------------
  877|  17.8k|    return setopt_set_timeout_ms(&s->timeout, arg);
  878|    190|  case CURLOPT_CONNECTTIMEOUT:
  ------------------
  |  Branch (878:3): [True: 190, False: 47.9k]
  ------------------
  879|    190|    return setopt_set_timeout_sec(&s->connecttimeout, arg);
  880|    213|  case CURLOPT_CONNECTTIMEOUT_MS:
  ------------------
  |  Branch (880:3): [True: 213, False: 47.9k]
  ------------------
  881|    213|    return setopt_set_timeout_ms(&s->connecttimeout, arg);
  882|      0|#ifndef CURL_DISABLE_BINDLOCAL
  883|     68|  case CURLOPT_LOCALPORT:
  ------------------
  |  Branch (883:3): [True: 68, False: 48.1k]
  ------------------
  884|     68|    if((arg < 0) || (arg > 65535))
  ------------------
  |  Branch (884:8): [True: 0, False: 68]
  |  Branch (884:21): [True: 32, False: 36]
  ------------------
  885|     32|      return CURLE_BAD_FUNCTION_ARGUMENT;
  886|     36|    s->localport = curlx_sltous(arg);
  887|     36|    break;
  888|     60|  case CURLOPT_LOCALPORTRANGE:
  ------------------
  |  Branch (888:3): [True: 60, False: 48.1k]
  ------------------
  889|     60|    if((arg < 0) || (arg > 65535))
  ------------------
  |  Branch (889:8): [True: 0, False: 60]
  |  Branch (889:21): [True: 28, False: 32]
  ------------------
  890|     28|      return CURLE_BAD_FUNCTION_ARGUMENT;
  891|     32|    s->localportrange = curlx_sltous(arg);
  892|     32|    break;
  893|      0|#endif
  894|     70|  case CURLOPT_BUFFERSIZE:
  ------------------
  |  Branch (894:3): [True: 70, False: 48.1k]
  ------------------
  895|     70|    result = value_range(&arg, 0, READBUFFER_MIN, READBUFFER_MAX);
  ------------------
  |  |  116|     70|#define READBUFFER_MIN  1024
  ------------------
                  result = value_range(&arg, 0, READBUFFER_MIN, READBUFFER_MAX);
  ------------------
  |  |  115|     70|#define READBUFFER_MAX  CURL_MAX_READ_SIZE
  |  |  ------------------
  |  |  |  |  255|     70|#define CURL_MAX_READ_SIZE (10 * 1024 * 1024)
  |  |  ------------------
  ------------------
  896|     70|    if(!result)
  ------------------
  |  Branch (896:8): [True: 70, False: 0]
  ------------------
  897|     70|      s->buffer_size = (unsigned int)arg;
  898|     70|    break;
  899|    149|  case CURLOPT_UPLOAD_BUFFERSIZE:
  ------------------
  |  Branch (899:3): [True: 149, False: 48.0k]
  ------------------
  900|    149|    result = value_range(&arg, 0, UPLOADBUFFER_MIN, UPLOADBUFFER_MAX);
  ------------------
  |  |  128|    149|#define UPLOADBUFFER_MIN     CURL_MAX_WRITE_SIZE
  |  |  ------------------
  |  |  |  |  265|    149|#define CURL_MAX_WRITE_SIZE 16384
  |  |  ------------------
  ------------------
                  result = value_range(&arg, 0, UPLOADBUFFER_MIN, UPLOADBUFFER_MAX);
  ------------------
  |  |  127|    149|#define UPLOADBUFFER_MAX     (2 * 1024 * 1024)
  ------------------
  901|    149|    if(!result)
  ------------------
  |  Branch (901:8): [True: 149, False: 0]
  ------------------
  902|    149|      s->upload_buffer_size = (unsigned int)arg;
  903|    149|    break;
  904|     83|  case CURLOPT_MAXFILESIZE:
  ------------------
  |  Branch (904:3): [True: 83, False: 48.0k]
  ------------------
  905|     83|    if(arg < 0)
  ------------------
  |  Branch (905:8): [True: 0, False: 83]
  ------------------
  906|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  907|     83|    else
  908|     83|      s->max_filesize = arg;
  909|     83|    break;
  910|     39|  case CURLOPT_IPRESOLVE:
  ------------------
  |  Branch (910:3): [True: 39, False: 48.1k]
  ------------------
  911|     39|    if((arg < CURL_IPRESOLVE_WHATEVER) || (arg > CURL_IPRESOLVE_V6))
  ------------------
  |  | 2303|     39|#define CURL_IPRESOLVE_WHATEVER 0L /* default, uses addresses to all IP
  ------------------
                  if((arg < CURL_IPRESOLVE_WHATEVER) || (arg > CURL_IPRESOLVE_V6))
  ------------------
  |  | 2306|     39|#define CURL_IPRESOLVE_V6       2L /* uses only IPv6 addresses/connections */
  ------------------
  |  Branch (911:8): [True: 0, False: 39]
  |  Branch (911:43): [True: 26, False: 13]
  ------------------
  912|     26|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  913|     13|    else
  914|     13|      s->ipver = (unsigned char)arg;
  915|     39|    break;
  916|     97|  case CURLOPT_CONNECT_ONLY:
  ------------------
  |  Branch (916:3): [True: 97, False: 48.0k]
  ------------------
  917|     97|    if(arg < 0 || arg > 2)
  ------------------
  |  Branch (917:8): [True: 0, False: 97]
  |  Branch (917:19): [True: 27, False: 70]
  ------------------
  918|     27|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  919|     70|    else {
  920|     70|      s->connect_only = !!arg;
  921|     70|      s->connect_only_ws = (arg == 2);
  922|     70|    }
  923|     97|    break;
  924|      0|#ifdef USE_IPV6
  925|    305|  case CURLOPT_ADDRESS_SCOPE:
  ------------------
  |  Branch (925:3): [True: 305, False: 47.8k]
  ------------------
  926|    305|#if SIZEOF_LONG > 4
  927|    305|    if((unsigned long)arg > UINT_MAX)
  ------------------
  |  Branch (927:8): [True: 0, False: 305]
  ------------------
  928|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  929|    305|    else
  930|    305|#endif
  931|    305|    s->scope_id = (unsigned int)arg;
  932|    305|    break;
  933|      0|#endif
  934|     55|  case CURLOPT_TCP_KEEPIDLE:
  ------------------
  |  Branch (934:3): [True: 55, False: 48.1k]
  ------------------
  935|     55|    result = value_range(&arg, 0, 0, INT_MAX);
  936|     55|    if(!result)
  ------------------
  |  Branch (936:8): [True: 55, False: 0]
  ------------------
  937|     55|      s->tcp_keepidle = (int)arg;
  938|     55|    break;
  939|    119|  case CURLOPT_TCP_KEEPINTVL:
  ------------------
  |  Branch (939:3): [True: 119, False: 48.0k]
  ------------------
  940|    119|    result = value_range(&arg, 0, 0, INT_MAX);
  941|    119|    if(!result)
  ------------------
  |  Branch (941:8): [True: 119, False: 0]
  ------------------
  942|    119|      s->tcp_keepintvl = (int)arg;
  943|    119|    break;
  944|     50|  case CURLOPT_TCP_KEEPCNT:
  ------------------
  |  Branch (944:3): [True: 50, False: 48.1k]
  ------------------
  945|     50|    result = value_range(&arg, 0, 0, INT_MAX);
  946|     50|    if(!result)
  ------------------
  |  Branch (946:8): [True: 50, False: 0]
  ------------------
  947|     50|      s->tcp_keepcnt = (int)arg;
  948|     50|    break;
  949|     31|  case CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS:
  ------------------
  |  Branch (949:3): [True: 31, False: 48.1k]
  ------------------
  950|     31|    return setopt_set_timeout_ms(&s->happy_eyeballs_timeout, arg);
  951|     29|  case CURLOPT_UPKEEP_INTERVAL_MS:
  ------------------
  |  Branch (951:3): [True: 29, False: 48.1k]
  ------------------
  952|     29|    return setopt_set_timeout_ms(&s->upkeep_interval_ms, arg);
  953|     57|  case CURLOPT_MAXAGE_CONN:
  ------------------
  |  Branch (953:3): [True: 57, False: 48.1k]
  ------------------
  954|     57|    return setopt_set_timeout_sec(&s->conn_max_idle_ms, arg);
  955|     52|  case CURLOPT_MAXLIFETIME_CONN:
  ------------------
  |  Branch (955:3): [True: 52, False: 48.1k]
  ------------------
  956|     52|    return setopt_set_timeout_sec(&s->conn_max_age_ms, arg);
  957|      0|  case CURLOPT_DNS_USE_GLOBAL_CACHE:
  ------------------
  |  Branch (957:3): [True: 0, False: 48.1k]
  ------------------
  958|       |    /* deprecated */
  959|      0|    break;
  960|  10.9k|  default:
  ------------------
  |  Branch (960:3): [True: 10.9k, False: 37.2k]
  ------------------
  961|  10.9k|    return CURLE_UNKNOWN_OPTION;
  962|  48.1k|  }
  963|  1.37k|  return result;
  964|  48.1k|}
setopt.c:setopt_set_timeout_sec:
   55|  17.6k|{
   56|  17.6k|  if(secs < 0)
  ------------------
  |  Branch (56:6): [True: 0, False: 17.6k]
  ------------------
   57|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
   58|  17.6k|#if LONG_MAX > (TIMEDIFF_T_MAX / 1000)
   59|  17.6k|  if(secs > (TIMEDIFF_T_MAX / 1000)) {
  ------------------
  |  |   33|  17.6k|#define TIMEDIFF_T_MAX CURL_OFF_T_MAX
  |  |  ------------------
  |  |  |  |  594|  17.6k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  ------------------
  ------------------
  |  Branch (59:6): [True: 0, False: 17.6k]
  ------------------
   60|      0|    *ptimeout_ms = TIMEDIFF_T_MAX;
  ------------------
  |  |   33|      0|#define TIMEDIFF_T_MAX CURL_OFF_T_MAX
  |  |  ------------------
  |  |  |  |  594|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  ------------------
  ------------------
   61|      0|    return CURLE_OK;
   62|      0|  }
   63|  17.6k|#endif
   64|  17.6k|  *ptimeout_ms = (timediff_t)secs * 1000;
   65|  17.6k|  return CURLE_OK;
   66|  17.6k|}
setopt.c:value_range:
  827|    957|{
  828|    957|  if(*value < below_error)
  ------------------
  |  Branch (828:6): [True: 1, False: 956]
  ------------------
  829|      1|    return CURLE_BAD_FUNCTION_ARGUMENT;
  830|    956|  else if(*value < min)
  ------------------
  |  Branch (830:11): [True: 35, False: 921]
  ------------------
  831|     35|    *value = min;
  832|    921|  else if(*value > max)
  ------------------
  |  Branch (832:11): [True: 355, False: 566]
  ------------------
  833|    355|    *value = max;
  834|    956|  return CURLE_OK;
  835|    957|}
setopt.c:setopt_set_timeout_ms:
   69|  18.1k|{
   70|  18.1k|  if(ms < 0)
  ------------------
  |  Branch (70:6): [True: 0, False: 18.1k]
  ------------------
   71|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
   72|       |#if LONG_MAX > TIMEDIFF_T_MAX
   73|       |  if(ms > TIMEDIFF_T_MAX) {
   74|       |    *ptimeout_ms = TIMEDIFF_T_MAX;
   75|       |    return CURLE_OK;
   76|       |  }
   77|       |#endif
   78|  18.1k|  *ptimeout_ms = (timediff_t)ms;
   79|  18.1k|  return CURLE_OK;
   80|  18.1k|}
setopt.c:setopt_long_http:
 1076|  10.9k|{
 1077|  10.9k|#ifndef CURL_DISABLE_HTTP
 1078|  10.9k|  CURLcode result = CURLE_OK;
 1079|  10.9k|  struct UserDefined *s = &data->set;
 1080|       |
 1081|  10.9k|  switch(option) {
 1082|  1.01k|  case CURLOPT_FOLLOWLOCATION:
  ------------------
  |  Branch (1082:3): [True: 1.01k, False: 9.93k]
  ------------------
 1083|  1.01k|    if((unsigned long)arg > 3)
  ------------------
  |  Branch (1083:8): [True: 14, False: 998]
  ------------------
 1084|     14|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1085|    998|    else
 1086|    998|      s->http_follow_mode = (unsigned char)arg;
 1087|  1.01k|    break;
 1088|     39|  case CURLOPT_MAXREDIRS:
  ------------------
  |  Branch (1088:3): [True: 39, False: 10.9k]
  ------------------
 1089|     39|    result = value_range(&arg, -1, -1, 0x7fff);
 1090|     39|    if(!result)
  ------------------
  |  Branch (1090:8): [True: 39, False: 0]
  ------------------
 1091|     39|      s->maxredirs = (short)arg;
 1092|     39|    break;
 1093|     34|  case CURLOPT_POSTREDIR:
  ------------------
  |  Branch (1093:3): [True: 34, False: 10.9k]
  ------------------
 1094|     34|    if(arg < CURL_REDIR_GET_ALL)
  ------------------
  |  | 2403|     34|#define CURL_REDIR_GET_ALL  0L
  ------------------
  |  Branch (1094:8): [True: 0, False: 34]
  ------------------
 1095|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1096|     34|    else {
 1097|     34|      s->post301 = !!(arg & CURL_REDIR_POST_301);
  ------------------
  |  | 2404|     34|#define CURL_REDIR_POST_301 1L
  ------------------
 1098|     34|      s->post302 = !!(arg & CURL_REDIR_POST_302);
  ------------------
  |  | 2405|     34|#define CURL_REDIR_POST_302 2L
  ------------------
 1099|     34|      s->post303 = !!(arg & CURL_REDIR_POST_303);
  ------------------
  |  | 2406|     34|#define CURL_REDIR_POST_303 4L
  ------------------
 1100|     34|    }
 1101|     34|    break;
 1102|    349|  case CURLOPT_HEADEROPT:
  ------------------
  |  Branch (1102:3): [True: 349, False: 10.6k]
  ------------------
 1103|    349|    s->sep_headers = !!(arg & CURLHEADER_SEPARATE);
  ------------------
  |  | 1031|    349|#define CURLHEADER_SEPARATE (1L << 0)
  ------------------
 1104|    349|    break;
 1105|    461|  case CURLOPT_HTTPAUTH:
  ------------------
  |  Branch (1105:3): [True: 461, False: 10.4k]
  ------------------
 1106|    461|    return httpauth(data, FALSE, (unsigned long)arg);
  ------------------
  |  | 1058|    461|#define FALSE false
  ------------------
 1107|  5.19k|  case CURLOPT_HTTP_VERSION:
  ------------------
  |  Branch (1107:3): [True: 5.19k, False: 5.75k]
  ------------------
 1108|  5.19k|    return setopt_HTTP_VERSION(data, arg);
 1109|     80|  case CURLOPT_EXPECT_100_TIMEOUT_MS:
  ------------------
  |  Branch (1109:3): [True: 80, False: 10.8k]
  ------------------
 1110|     80|    result = value_range(&arg, 0, 0, 0xffff);
 1111|     80|    if(!result)
  ------------------
  |  Branch (1111:8): [True: 80, False: 0]
  ------------------
 1112|     80|      s->expect_100_timeout = (unsigned short)arg;
 1113|     80|    break;
 1114|     55|  case CURLOPT_STREAM_WEIGHT:
  ------------------
  |  Branch (1114:3): [True: 55, False: 10.8k]
  ------------------
 1115|     55|#if defined(USE_HTTP2) || defined(USE_HTTP3)
 1116|     55|    if((arg >= 1) && (arg <= 256))
  ------------------
  |  Branch (1116:8): [True: 53, False: 2]
  |  Branch (1116:22): [True: 21, False: 32]
  ------------------
 1117|     21|      s->priority.weight = (int)arg;
 1118|     55|    break;
 1119|       |#else
 1120|       |    result = CURLE_NOT_BUILT_IN;
 1121|       |    break;
 1122|       |#endif
 1123|  3.72k|  default:
  ------------------
  |  Branch (1123:3): [True: 3.72k, False: 7.22k]
  ------------------
 1124|  3.72k|    return CURLE_UNKNOWN_OPTION;
 1125|  10.9k|  }
 1126|  1.56k|  return result;
 1127|       |#else
 1128|       |  (void)data;
 1129|       |  (void)option;
 1130|       |  (void)arg;
 1131|       |  return CURLE_UNKNOWN_OPTION;
 1132|       |#endif
 1133|  10.9k|}
setopt.c:httpauth:
  239|    541|{
  240|    541|  if(auth != CURLAUTH_NONE) {
  ------------------
  |  |  830|    541|#define CURLAUTH_NONE         ((unsigned long)0)
  ------------------
  |  Branch (240:6): [True: 522, False: 19]
  ------------------
  241|    522|    int bitcheck = 0;
  242|    522|    bool authbits = FALSE;
  ------------------
  |  | 1058|    522|#define FALSE false
  ------------------
  243|    522|    if(auth & CURLAUTH_DIGEST_IE) {
  ------------------
  |  |  839|    522|#define CURLAUTH_DIGEST_IE    (((unsigned long)1) << 4)
  ------------------
  |  Branch (243:8): [True: 363, False: 159]
  ------------------
  244|    363|      auth |= CURLAUTH_DIGEST; /* set standard digest bit */
  ------------------
  |  |  832|    363|#define CURLAUTH_DIGEST       (((unsigned long)1) << 1)
  ------------------
  245|    363|      auth &= ~CURLAUTH_DIGEST_IE; /* drop the legacy bit */
  ------------------
  |  |  839|    363|#define CURLAUTH_DIGEST_IE    (((unsigned long)1) << 4)
  ------------------
  246|    363|    }
  247|       |
  248|       |    /* switch off bits we cannot support */
  249|    522|#ifndef USE_NTLM
  250|    522|    auth &= ~CURLAUTH_NTLM; /* no NTLM support */
  ------------------
  |  |  838|    522|#define CURLAUTH_NTLM         (((unsigned long)1) << 3)
  ------------------
  251|    522|#endif
  252|    522|#ifndef USE_SPNEGO
  253|    522|    auth &= ~CURLAUTH_NEGOTIATE; /* no Negotiate (SPNEGO) auth without GSS-API
  ------------------
  |  |  833|    522|#define CURLAUTH_NEGOTIATE    (((unsigned long)1) << 2)
  ------------------
  254|       |                                    or SSPI */
  255|    522|#endif
  256|       |
  257|       |    /* check if any auth bit lower than CURLAUTH_ONLY is still set */
  258|  1.79k|    while(bitcheck < 31) {
  ------------------
  |  Branch (258:11): [True: 1.79k, False: 2]
  ------------------
  259|  1.79k|      if(auth & (1UL << bitcheck++)) {
  ------------------
  |  Branch (259:10): [True: 520, False: 1.27k]
  ------------------
  260|    520|        authbits = TRUE;
  ------------------
  |  | 1055|    520|#define TRUE true
  ------------------
  261|    520|        break;
  262|    520|      }
  263|  1.79k|    }
  264|    522|    if(!authbits)
  ------------------
  |  Branch (264:8): [True: 2, False: 520]
  ------------------
  265|      2|      return CURLE_NOT_BUILT_IN; /* no supported types left! */
  266|    522|  }
  267|    539|  if(proxy)
  ------------------
  |  Branch (267:6): [True: 79, False: 460]
  ------------------
  268|     79|    data->set.proxyauth = (uint32_t)auth;
  269|    460|  else
  270|    460|    data->set.httpauth = (uint32_t)auth;
  271|    539|  return CURLE_OK;
  272|    541|}
setopt.c:setopt_HTTP_VERSION:
  277|  5.19k|{
  278|       |  /*
  279|       |   * This sets a requested HTTP version to be used. The value is one of
  280|       |   * the listed enums in curl/curl.h.
  281|       |   */
  282|  5.19k|  switch(arg) {
  283|     10|  case CURL_HTTP_VERSION_NONE:
  ------------------
  |  | 2312|     10|#define CURL_HTTP_VERSION_NONE  0L /* setting this means we do not care, and
  ------------------
  |  Branch (283:3): [True: 10, False: 5.18k]
  ------------------
  284|       |    /* accepted */
  285|     10|    break;
  286|     10|  case CURL_HTTP_VERSION_1_0:
  ------------------
  |  | 2315|     10|#define CURL_HTTP_VERSION_1_0   1L /* please use HTTP 1.0 in the request */
  ------------------
  |  Branch (286:3): [True: 10, False: 5.18k]
  ------------------
  287|     14|  case CURL_HTTP_VERSION_1_1:
  ------------------
  |  | 2316|     14|#define CURL_HTTP_VERSION_1_1   2L /* please use HTTP 1.1 in the request */
  ------------------
  |  Branch (287:3): [True: 4, False: 5.18k]
  ------------------
  288|       |    /* accepted */
  289|     14|    break;
  290|      0|#ifdef USE_HTTP2
  291|     30|  case CURL_HTTP_VERSION_2_0:
  ------------------
  |  | 2317|     30|#define CURL_HTTP_VERSION_2_0   3L /* please use HTTP 2 in the request */
  ------------------
  |  Branch (291:3): [True: 30, False: 5.16k]
  ------------------
  292|    682|  case CURL_HTTP_VERSION_2TLS:
  ------------------
  |  | 2318|    682|#define CURL_HTTP_VERSION_2TLS  4L /* use version 2 for HTTPS, version 1.1 for
  ------------------
  |  Branch (292:3): [True: 652, False: 4.54k]
  ------------------
  293|  5.13k|  case CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE:
  ------------------
  |  | 2320|  5.13k|#define CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE 5L /* please use HTTP 2 without
  ------------------
  |  Branch (293:3): [True: 4.44k, False: 744]
  ------------------
  294|       |    /* accepted */
  295|  5.13k|    break;
  296|      0|#endif
  297|       |#ifdef USE_HTTP3
  298|       |  case CURL_HTTP_VERSION_3:
  299|       |  case CURL_HTTP_VERSION_3ONLY:
  300|       |    /* accepted */
  301|       |    break;
  302|       |#endif
  303|     38|  default:
  ------------------
  |  Branch (303:3): [True: 38, False: 5.15k]
  ------------------
  304|       |    /* not accepted */
  305|     38|    if(arg < CURL_HTTP_VERSION_NONE)
  ------------------
  |  | 2312|     38|#define CURL_HTTP_VERSION_NONE  0L /* setting this means we do not care, and
  ------------------
  |  Branch (305:8): [True: 0, False: 38]
  ------------------
  306|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  307|     38|    return CURLE_UNSUPPORTED_PROTOCOL;
  308|  5.19k|  }
  309|  5.15k|  data->set.httpwant = (unsigned char)arg;
  310|  5.15k|  return CURLE_OK;
  311|  5.19k|}
setopt.c:setopt_long_proxy:
 1031|  3.72k|{
 1032|  3.72k|  struct UserDefined *s = &data->set;
 1033|       |
 1034|  3.72k|  switch(option) {
 1035|     78|  case CURLOPT_PROXYPORT:
  ------------------
  |  Branch (1035:3): [True: 78, False: 3.64k]
  ------------------
 1036|     78|    if((arg < 0) || (arg > UINT16_MAX))
  ------------------
  |  Branch (1036:8): [True: 0, False: 78]
  |  Branch (1036:21): [True: 19, False: 59]
  ------------------
 1037|     19|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1038|     59|    if(arg != s->proxyport)
  ------------------
  |  Branch (1038:8): [True: 57, False: 2]
  ------------------
 1039|     57|      changeproxy(data);
 1040|     59|    s->proxyport = (uint16_t)arg;
 1041|     59|    break;
 1042|     80|  case CURLOPT_PROXYAUTH:
  ------------------
  |  Branch (1042:3): [True: 80, False: 3.64k]
  ------------------
 1043|     80|    return httpauth(data, TRUE, (unsigned long)arg);
  ------------------
  |  | 1055|     80|#define TRUE true
  ------------------
 1044|    555|  case CURLOPT_PROXYTYPE:
  ------------------
  |  Branch (1044:3): [True: 555, False: 3.17k]
  ------------------
 1045|    555|    if((arg < CURLPROXY_HTTP) || (arg > CURLPROXY_HTTPS3))
  ------------------
  |  |  790|    555|#define CURLPROXY_HTTP            0L /* added in 7.10, new in 7.19.4 default is
  ------------------
                  if((arg < CURLPROXY_HTTP) || (arg > CURLPROXY_HTTPS3))
  ------------------
  |  |  805|    555|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  ------------------
  |  Branch (1045:8): [True: 0, False: 555]
  |  Branch (1045:34): [True: 34, False: 521]
  ------------------
 1046|     34|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1047|    521|#ifndef USE_PROXY_HTTP3
 1048|    521|    if(arg == CURLPROXY_HTTPS3)
  ------------------
  |  |  805|    521|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  ------------------
  |  Branch (1048:8): [True: 0, False: 521]
  ------------------
 1049|      0|      return CURLE_NOT_BUILT_IN;
 1050|    521|#endif
 1051|    521|    s->proxytype = (unsigned char)arg;
 1052|    521|    break;
 1053|     12|  case CURLOPT_SOCKS5_AUTH:
  ------------------
  |  Branch (1053:3): [True: 12, False: 3.71k]
  ------------------
 1054|     12|    if(arg & ~(CURLAUTH_BASIC | CURLAUTH_GSSAPI))
  ------------------
  |  |  831|     12|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
                  if(arg & ~(CURLAUTH_BASIC | CURLAUTH_GSSAPI))
  ------------------
  |  |  837|     12|#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE
  |  |  ------------------
  |  |  |  |  833|     12|#define CURLAUTH_NEGOTIATE    (((unsigned long)1) << 2)
  |  |  ------------------
  ------------------
  |  Branch (1054:8): [True: 7, False: 5]
  ------------------
 1055|      7|      return CURLE_NOT_BUILT_IN;
 1056|      5|    s->socks5auth = (unsigned char)arg;
 1057|      5|    break;
 1058|  3.00k|  default:
  ------------------
  |  Branch (1058:3): [True: 3.00k, False: 725]
  ------------------
 1059|  3.00k|    return CURLE_UNKNOWN_OPTION;
 1060|  3.72k|  }
 1061|    585|  return CURLE_OK;
 1062|  3.72k|}
setopt.c:changeproxy:
 1024|  8.16k|{
 1025|  8.16k|  Curl_auth_digest_cleanup(&data->state.proxydigest);
 1026|  8.16k|  memset(&data->state.authproxy, 0, sizeof(data->state.authproxy));
 1027|  8.16k|}
setopt.c:setopt_long_ssl:
  968|  3.00k|{
  969|  3.00k|#ifdef USE_SSL
  970|  3.00k|  CURLcode result = CURLE_OK;
  971|  3.00k|  struct UserDefined *s = &data->set;
  972|  3.00k|  switch(option) {
  973|     51|  case CURLOPT_CA_CACHE_TIMEOUT:
  ------------------
  |  Branch (973:3): [True: 51, False: 2.95k]
  ------------------
  974|     51|    if(Curl_ssl_supports(data, SSLSUPP_CA_CACHE)) {
  ------------------
  |  |   43|     51|#define SSLSUPP_CA_CACHE     (1 << 8)
  ------------------
  |  Branch (974:8): [True: 51, False: 0]
  ------------------
  975|     51|      result = value_range(&arg, -1, -1, INT_MAX);
  976|     51|      if(!result)
  ------------------
  |  Branch (976:10): [True: 51, False: 0]
  ------------------
  977|     51|        s->general_ssl.ca_cache_timeout = (int)arg;
  978|     51|    }
  979|      0|    else
  980|      0|      result = CURLE_NOT_BUILT_IN;
  981|     51|    break;
  982|     50|  case CURLOPT_SSLVERSION:
  ------------------
  |  Branch (982:3): [True: 50, False: 2.95k]
  ------------------
  983|     50|#ifndef CURL_DISABLE_PROXY
  984|     71|  case CURLOPT_PROXY_SSLVERSION:
  ------------------
  |  Branch (984:3): [True: 21, False: 2.98k]
  ------------------
  985|     71|#endif
  986|     71|    return Curl_setopt_SSLVERSION(data, option, arg);
  987|      1|  case CURLOPT_SSL_FALSESTART:
  ------------------
  |  Branch (987:3): [True: 1, False: 3.00k]
  ------------------
  988|      1|    result = CURLE_NOT_BUILT_IN;
  989|      1|    break;
  990|     41|  case CURLOPT_USE_SSL:
  ------------------
  |  Branch (990:3): [True: 41, False: 2.96k]
  ------------------
  991|     41|    if((arg < CURLUSESSL_NONE) || (arg >= CURLUSESSL_LAST))
  ------------------
  |  |  924|     41|#define CURLUSESSL_NONE    0L /* do not attempt to use SSL */
  ------------------
  |  Branch (991:8): [True: 0, False: 41]
  |  Branch (991:35): [True: 30, False: 11]
  ------------------
  992|     30|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  993|     11|    else
  994|     11|      s->use_ssl = (unsigned char)arg;
  995|     41|    break;
  996|    658|  case CURLOPT_SSL_OPTIONS:
  ------------------
  |  Branch (996:3): [True: 658, False: 2.34k]
  ------------------
  997|    658|    set_ssl_options(&s->ssl, &s->ssl.primary, arg);
  998|    658|    break;
  999|      0|#ifndef CURL_DISABLE_PROXY
 1000|     49|  case CURLOPT_PROXY_SSL_OPTIONS:
  ------------------
  |  Branch (1000:3): [True: 49, False: 2.95k]
  ------------------
 1001|     49|    set_ssl_options(&s->proxy_ssl, &s->proxy_ssl.primary, arg);
 1002|     49|    break;
 1003|      0|#endif
 1004|      0|  case CURLOPT_SSL_ENABLE_NPN:
  ------------------
  |  Branch (1004:3): [True: 0, False: 3.00k]
  ------------------
 1005|      0|    break;
 1006|      4|  case CURLOPT_SSLENGINE_DEFAULT:
  ------------------
  |  Branch (1006:3): [True: 4, False: 2.99k]
  ------------------
 1007|      4|    curlx_safefree(s->str[STRING_SSL_ENGINE]);
  ------------------
  |  | 1327|      4|  do {                      \
  |  | 1328|      4|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      4|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      4|    (ptr) = NULL;           \
  |  | 1330|      4|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 4]
  |  |  ------------------
  ------------------
 1008|      4|    result = Curl_ssl_set_engine_default(data);
 1009|      4|    break;
 1010|  2.12k|  default:
  ------------------
  |  Branch (1010:3): [True: 2.12k, False: 875]
  ------------------
 1011|  2.12k|    return CURLE_UNKNOWN_OPTION;
 1012|  3.00k|  }
 1013|    804|  return result;
 1014|       |#else  /* USE_SSL */
 1015|       |  (void)data;
 1016|       |  (void)option;
 1017|       |  (void)arg;
 1018|       |  return CURLE_UNKNOWN_OPTION;
 1019|       |#endif /* !USE_SSL */
 1020|  3.00k|}
setopt.c:set_ssl_options:
  406|    707|{
  407|    707|  config->ssl_options = (unsigned char)(arg & 0xff);
  408|    707|  ssl->enable_beast = !!(arg & CURLSSLOPT_ALLOW_BEAST);
  ------------------
  |  |  940|    707|#define CURLSSLOPT_ALLOW_BEAST (1L << 0)
  ------------------
  409|    707|  ssl->no_revoke = !!(arg & CURLSSLOPT_NO_REVOKE);
  ------------------
  |  |  944|    707|#define CURLSSLOPT_NO_REVOKE (1L << 1)
  ------------------
  410|    707|  ssl->no_partialchain = !!(arg & CURLSSLOPT_NO_PARTIALCHAIN);
  ------------------
  |  |  948|    707|#define CURLSSLOPT_NO_PARTIALCHAIN (1L << 2)
  ------------------
  411|    707|  ssl->revoke_best_effort = !!(arg & CURLSSLOPT_REVOKE_BEST_EFFORT);
  ------------------
  |  |  953|    707|#define CURLSSLOPT_REVOKE_BEST_EFFORT (1L << 3)
  ------------------
  412|    707|  ssl->native_ca_store = !!(arg & CURLSSLOPT_NATIVE_CA);
  ------------------
  |  |  957|    707|#define CURLSSLOPT_NATIVE_CA (1L << 4)
  ------------------
  413|    707|  ssl->auto_client_cert = !!(arg & CURLSSLOPT_AUTO_CLIENT_CERT);
  ------------------
  |  |  961|    707|#define CURLSSLOPT_AUTO_CLIENT_CERT (1L << 5)
  ------------------
  414|    707|  ssl->earlydata = !!(arg & CURLSSLOPT_EARLYDATA);
  ------------------
  |  |  964|    707|#define CURLSSLOPT_EARLYDATA (1L << 6)
  ------------------
  415|    707|}
setopt.c:setopt_long_proto:
 1137|  2.12k|{
 1138|  2.12k|  CURLcode result = CURLE_OK;
 1139|  2.12k|  struct UserDefined *s = &data->set;
 1140|       |
 1141|  2.12k|  switch(option) {
 1142|      0|#ifndef CURL_DISABLE_TFTP
 1143|     58|  case CURLOPT_TFTP_BLKSIZE:
  ------------------
  |  Branch (1143:3): [True: 58, False: 2.06k]
  ------------------
 1144|     58|    result = value_range(&arg, 0, TFTP_BLKSIZE_MIN, TFTP_BLKSIZE_MAX);
  ------------------
  |  |   30|     58|#define TFTP_BLKSIZE_MIN 8
  ------------------
                  result = value_range(&arg, 0, TFTP_BLKSIZE_MIN, TFTP_BLKSIZE_MAX);
  ------------------
  |  |   31|     58|#define TFTP_BLKSIZE_MAX 65464
  ------------------
 1145|     58|    if(!result)
  ------------------
  |  Branch (1145:8): [True: 58, False: 0]
  ------------------
 1146|     58|      s->tftp_blksize = (unsigned short)arg;
 1147|     58|    break;
 1148|      0|#endif
 1149|      0|#ifndef CURL_DISABLE_NETRC
 1150|     56|  case CURLOPT_NETRC:
  ------------------
  |  Branch (1150:3): [True: 56, False: 2.07k]
  ------------------
 1151|     56|    if((arg < CURL_NETRC_IGNORED) || (arg >= CURL_NETRC_LAST))
  ------------------
  |  | 2355|     56|#define CURL_NETRC_IGNORED  0L /* The .netrc is never read.
  ------------------
  |  Branch (1151:8): [True: 0, False: 56]
  |  Branch (1151:38): [True: 35, False: 21]
  ------------------
 1152|     35|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1153|     21|    else
 1154|     21|      s->use_netrc = (unsigned char)arg;
 1155|     56|    break;
 1156|      0|#endif
 1157|      0|#ifndef CURL_DISABLE_FTP
 1158|     43|  case CURLOPT_FTP_FILEMETHOD:
  ------------------
  |  Branch (1158:3): [True: 43, False: 2.08k]
  ------------------
 1159|     43|    if((arg < CURLFTPMETHOD_DEFAULT) || (arg >= CURLFTPMETHOD_LAST))
  ------------------
  |  | 1019|     43|#define CURLFTPMETHOD_DEFAULT   0L /* let libcurl pick */
  ------------------
  |  Branch (1159:8): [True: 0, False: 43]
  |  Branch (1159:41): [True: 28, False: 15]
  ------------------
 1160|     28|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1161|     15|    else
 1162|     15|      s->ftp_filemethod = (unsigned char)arg;
 1163|     43|    break;
 1164|     35|  case CURLOPT_FTP_SSL_CCC:
  ------------------
  |  Branch (1164:3): [True: 35, False: 2.09k]
  ------------------
 1165|     35|    if((arg < CURLFTPSSL_CCC_NONE) || (arg >= CURLFTPSSL_CCC_LAST))
  ------------------
  |  |  989|     35|#define CURLFTPSSL_CCC_NONE    0L /* do not send CCC */
  ------------------
  |  Branch (1165:8): [True: 0, False: 35]
  |  Branch (1165:39): [True: 33, False: 2]
  ------------------
 1166|     33|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1167|      2|    else
 1168|      2|      s->ftp_ccc = (unsigned char)arg;
 1169|     35|    break;
 1170|     45|  case CURLOPT_FTPSSLAUTH:
  ------------------
  |  Branch (1170:3): [True: 45, False: 2.08k]
  ------------------
 1171|     45|    if((arg < CURLFTPAUTH_DEFAULT) || (arg >= CURLFTPAUTH_LAST))
  ------------------
  |  |  998|     45|#define CURLFTPAUTH_DEFAULT 0L /* let libcurl decide */
  ------------------
  |  Branch (1171:8): [True: 0, False: 45]
  |  Branch (1171:39): [True: 36, False: 9]
  ------------------
 1172|     36|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1173|      9|    else
 1174|      9|      s->ftpsslauth = (unsigned char)arg;
 1175|     45|    break;
 1176|     20|  case CURLOPT_ACCEPTTIMEOUT_MS:
  ------------------
  |  Branch (1176:3): [True: 20, False: 2.10k]
  ------------------
 1177|     20|    return setopt_set_timeout_ms(&s->accepttimeout, arg);
 1178|      0|#endif
 1179|      0|#if !defined(CURL_DISABLE_FTP) || defined(USE_SSH)
 1180|     55|  case CURLOPT_FTP_CREATE_MISSING_DIRS:
  ------------------
  |  Branch (1180:3): [True: 55, False: 2.07k]
  ------------------
 1181|     55|    if((arg < CURLFTP_CREATE_DIR_NONE) || (arg > CURLFTP_CREATE_DIR_RETRY))
  ------------------
  |  | 1007|     55|#define CURLFTP_CREATE_DIR_NONE  0L /* do NOT create missing dirs! */
  ------------------
                  if((arg < CURLFTP_CREATE_DIR_NONE) || (arg > CURLFTP_CREATE_DIR_RETRY))
  ------------------
  |  | 1011|     55|#define CURLFTP_CREATE_DIR_RETRY 2L /* (FTP only) if CWD fails, try MKD and
  ------------------
  |  Branch (1181:8): [True: 0, False: 55]
  |  Branch (1181:43): [True: 35, False: 20]
  ------------------
 1182|     35|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1183|     20|    else
 1184|     20|      s->ftp_create_missing_dirs = (unsigned char)arg;
 1185|     55|    break;
 1186|     42|  case CURLOPT_NEW_FILE_PERMS:
  ------------------
  |  Branch (1186:3): [True: 42, False: 2.08k]
  ------------------
 1187|     42|    if((arg < 0) || (arg > 0777))
  ------------------
  |  Branch (1187:8): [True: 0, False: 42]
  |  Branch (1187:21): [True: 32, False: 10]
  ------------------
 1188|     32|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1189|     10|    else
 1190|     10|      s->new_file_perms = (unsigned int)arg;
 1191|     42|    break;
 1192|      0|#endif
 1193|      0|#ifndef CURL_DISABLE_RTSP
 1194|     32|  case CURLOPT_RTSP_REQUEST:
  ------------------
  |  Branch (1194:3): [True: 32, False: 2.09k]
  ------------------
 1195|     32|    return setopt_RTSP_REQUEST(data, arg);
 1196|     65|  case CURLOPT_RTSP_CLIENT_CSEQ:
  ------------------
  |  Branch (1196:3): [True: 65, False: 2.06k]
  ------------------
 1197|     65|    result = value_range(&arg, 0, 0, INT_MAX);
 1198|     65|    if(!result)
  ------------------
  |  Branch (1198:8): [True: 65, False: 0]
  ------------------
 1199|     65|      data->state.rtsp_next_client_CSeq = (uint32_t)arg;
 1200|     65|    break;
 1201|     51|  case CURLOPT_RTSP_SERVER_CSEQ:
  ------------------
  |  Branch (1201:3): [True: 51, False: 2.07k]
  ------------------
 1202|     51|    result = value_range(&arg, 0, 0, INT_MAX);
 1203|     51|    if(!result)
  ------------------
  |  Branch (1203:8): [True: 51, False: 0]
  ------------------
 1204|     51|      data->state.rtsp_next_server_CSeq = (uint32_t)arg;
 1205|     51|    break;
 1206|      0|#endif
 1207|       |#ifdef USE_SSH
 1208|       |  case CURLOPT_SSH_AUTH_TYPES:
 1209|       |    s->ssh_auth_types = (uint32_t)arg;
 1210|       |    break;
 1211|       |  case CURLOPT_NEW_DIRECTORY_PERMS:
 1212|       |    if((arg < 0) || (arg > 0777))
 1213|       |      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1214|       |    else
 1215|       |      s->new_directory_perms = (unsigned int)arg;
 1216|       |    break;
 1217|       |#endif
 1218|    649|  case CURLOPT_PROTOCOLS:
  ------------------
  |  Branch (1218:3): [True: 649, False: 1.47k]
  ------------------
 1219|    649|    s->allowed_protocols = (curl_prot_t)arg;
 1220|    649|    break;
 1221|      0|  case CURLOPT_REDIR_PROTOCOLS:
  ------------------
  |  Branch (1221:3): [True: 0, False: 2.12k]
  ------------------
 1222|      0|    s->redir_protocols = (curl_prot_t)arg;
 1223|      0|    break;
 1224|      0|#ifndef CURL_DISABLE_WEBSOCKETS
 1225|      7|  case CURLOPT_WS_OPTIONS:
  ------------------
  |  Branch (1225:3): [True: 7, False: 2.12k]
  ------------------
 1226|      7|    s->ws_raw_mode = (bool)(arg & CURLWS_RAW_MODE);
  ------------------
  |  |   89|      7|#define CURLWS_RAW_MODE   (1L << 0)
  ------------------
 1227|      7|    s->ws_no_auto_pong = (bool)(arg & CURLWS_NOAUTOPONG);
  ------------------
  |  |   90|      7|#define CURLWS_NOAUTOPONG (1L << 1)
  ------------------
 1228|      7|    break;
 1229|      0|#endif
 1230|    969|  default:
  ------------------
  |  Branch (1230:3): [True: 969, False: 1.15k]
  ------------------
 1231|    969|    return CURLE_UNKNOWN_OPTION;
 1232|  2.12k|  }
 1233|  1.10k|  return result;
 1234|  2.12k|}
setopt.c:setopt_RTSP_REQUEST:
  353|     32|{
  354|       |  /*
  355|       |   * Set the RTSP request method (OPTIONS, SETUP, PLAY, etc...) Would this be
  356|       |   * better if the RTSPREQ_* were moved into here?
  357|       |   */
  358|     32|  Curl_RtspReq rtspreq = RTSPREQ_NONE;
  359|     32|  switch(arg) {
  360|      0|  case CURL_RTSPREQ_OPTIONS:
  ------------------
  |  | 2341|      0|#define CURL_RTSPREQ_OPTIONS       1L
  ------------------
  |  Branch (360:3): [True: 0, False: 32]
  ------------------
  361|      0|    rtspreq = RTSPREQ_OPTIONS;
  362|      0|    break;
  363|      1|  case CURL_RTSPREQ_DESCRIBE:
  ------------------
  |  | 2342|      1|#define CURL_RTSPREQ_DESCRIBE      2L
  ------------------
  |  Branch (363:3): [True: 1, False: 31]
  ------------------
  364|      1|    rtspreq = RTSPREQ_DESCRIBE;
  365|      1|    break;
  366|      0|  case CURL_RTSPREQ_ANNOUNCE:
  ------------------
  |  | 2343|      0|#define CURL_RTSPREQ_ANNOUNCE      3L
  ------------------
  |  Branch (366:3): [True: 0, False: 32]
  ------------------
  367|      0|    rtspreq = RTSPREQ_ANNOUNCE;
  368|      0|    break;
  369|      0|  case CURL_RTSPREQ_SETUP:
  ------------------
  |  | 2344|      0|#define CURL_RTSPREQ_SETUP         4L
  ------------------
  |  Branch (369:3): [True: 0, False: 32]
  ------------------
  370|      0|    rtspreq = RTSPREQ_SETUP;
  371|      0|    break;
  372|      0|  case CURL_RTSPREQ_PLAY:
  ------------------
  |  | 2345|      0|#define CURL_RTSPREQ_PLAY          5L
  ------------------
  |  Branch (372:3): [True: 0, False: 32]
  ------------------
  373|      0|    rtspreq = RTSPREQ_PLAY;
  374|      0|    break;
  375|      0|  case CURL_RTSPREQ_PAUSE:
  ------------------
  |  | 2346|      0|#define CURL_RTSPREQ_PAUSE         6L
  ------------------
  |  Branch (375:3): [True: 0, False: 32]
  ------------------
  376|      0|    rtspreq = RTSPREQ_PAUSE;
  377|      0|    break;
  378|      0|  case CURL_RTSPREQ_TEARDOWN:
  ------------------
  |  | 2347|      0|#define CURL_RTSPREQ_TEARDOWN      7L
  ------------------
  |  Branch (378:3): [True: 0, False: 32]
  ------------------
  379|      0|    rtspreq = RTSPREQ_TEARDOWN;
  380|      0|    break;
  381|      1|  case CURL_RTSPREQ_GET_PARAMETER:
  ------------------
  |  | 2348|      1|#define CURL_RTSPREQ_GET_PARAMETER 8L
  ------------------
  |  Branch (381:3): [True: 1, False: 31]
  ------------------
  382|      1|    rtspreq = RTSPREQ_GET_PARAMETER;
  383|      1|    break;
  384|      1|  case CURL_RTSPREQ_SET_PARAMETER:
  ------------------
  |  | 2349|      1|#define CURL_RTSPREQ_SET_PARAMETER 9L
  ------------------
  |  Branch (384:3): [True: 1, False: 31]
  ------------------
  385|      1|    rtspreq = RTSPREQ_SET_PARAMETER;
  386|      1|    break;
  387|      1|  case CURL_RTSPREQ_RECORD:
  ------------------
  |  | 2350|      1|#define CURL_RTSPREQ_RECORD        10L
  ------------------
  |  Branch (387:3): [True: 1, False: 31]
  ------------------
  388|      1|    rtspreq = RTSPREQ_RECORD;
  389|      1|    break;
  390|      0|  case CURL_RTSPREQ_RECEIVE:
  ------------------
  |  | 2351|      0|#define CURL_RTSPREQ_RECEIVE       11L
  ------------------
  |  Branch (390:3): [True: 0, False: 32]
  ------------------
  391|      0|    rtspreq = RTSPREQ_RECEIVE;
  392|      0|    break;
  393|     28|  default:
  ------------------
  |  Branch (393:3): [True: 28, False: 4]
  ------------------
  394|     28|    return CURLE_BAD_FUNCTION_ARGUMENT;
  395|     32|  }
  396|       |
  397|      4|  data->set.rtspreq = rtspreq;
  398|      4|  return CURLE_OK;
  399|     32|}
setopt.c:setopt_long_misc:
 1238|    969|{
 1239|    969|  struct UserDefined *s = &data->set;
 1240|       |
 1241|    969|  switch(option) {
 1242|    143|  case CURLOPT_TIMECONDITION:
  ------------------
  |  Branch (1242:3): [True: 143, False: 826]
  ------------------
 1243|    143|    if((arg < CURL_TIMECOND_NONE) || (arg >= CURL_TIMECOND_LAST))
  ------------------
  |  | 2410|    143|#define CURL_TIMECOND_NONE         0L
  ------------------
  |  Branch (1243:8): [True: 0, False: 143]
  |  Branch (1243:38): [True: 34, False: 109]
  ------------------
 1244|     34|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1245|    109|    s->timecondition = (unsigned char)arg;
 1246|    109|    break;
 1247|      8|  case CURLOPT_TIMEVALUE:
  ------------------
  |  Branch (1247:3): [True: 8, False: 961]
  ------------------
 1248|      8|    s->timevalue = (time_t)arg;
 1249|      8|    break;
 1250|    649|  case CURLOPT_POSTFIELDSIZE:
  ------------------
  |  Branch (1250:3): [True: 649, False: 320]
  ------------------
 1251|    649|    if(arg < -1)
  ------------------
  |  Branch (1251:8): [True: 0, False: 649]
  ------------------
 1252|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1253|    649|    if(s->postfieldsize < arg &&
  ------------------
  |  Branch (1253:8): [True: 649, False: 0]
  ------------------
 1254|    649|       s->postfields == s->str[STRING_COPYPOSTFIELDS]) {
  ------------------
  |  Branch (1254:8): [True: 0, False: 649]
  ------------------
 1255|      0|      curlx_safefree(s->str[STRING_COPYPOSTFIELDS]);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1256|      0|      s->postfields = NULL;
 1257|      0|    }
 1258|    649|    s->postfieldsize = arg;
 1259|    649|    break;
 1260|      0|  case CURLOPT_INFILESIZE:
  ------------------
  |  Branch (1260:3): [True: 0, False: 969]
  ------------------
 1261|      0|    if(arg < -1)
  ------------------
  |  Branch (1261:8): [True: 0, False: 0]
  ------------------
 1262|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1263|      0|    s->filesize = arg;
 1264|      0|    break;
 1265|    105|  case CURLOPT_RESUME_FROM:
  ------------------
  |  Branch (1265:3): [True: 105, False: 864]
  ------------------
 1266|    105|    if(arg < -1)
  ------------------
  |  Branch (1266:8): [True: 0, False: 105]
  ------------------
 1267|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1268|    105|    s->set_resume_from = arg;
 1269|    105|    break;
 1270|      0|  case CURLOPT_UPLOAD_FLAGS:
  ------------------
  |  Branch (1270:3): [True: 0, False: 969]
  ------------------
 1271|      0|    s->upload_flags = (unsigned char)arg;
 1272|      0|    break;
 1273|      0|#ifndef CURL_DISABLE_MIME
 1274|     11|  case CURLOPT_MIME_OPTIONS:
  ------------------
  |  Branch (1274:3): [True: 11, False: 958]
  ------------------
 1275|     11|    s->mime_formescape = !!(arg & CURLMIMEOPT_FORMESCAPE);
  ------------------
  |  | 2435|     11|#define CURLMIMEOPT_FORMESCAPE (1L << 0) /* Use backslash-escaping for forms */
  ------------------
 1276|     11|    break;
 1277|      0|#endif
 1278|      0|#ifndef CURL_DISABLE_HSTS
 1279|      6|  case CURLOPT_HSTS_CTRL:
  ------------------
  |  Branch (1279:3): [True: 6, False: 963]
  ------------------
 1280|      6|    if(arg & CURLHSTS_ENABLE) {
  ------------------
  |  | 1073|      6|#define CURLHSTS_ENABLE       (1L << 0)
  ------------------
  |  Branch (1280:8): [True: 3, False: 3]
  ------------------
 1281|      3|      if(!data->hsts) {
  ------------------
  |  Branch (1281:10): [True: 3, False: 0]
  ------------------
 1282|      3|        data->hsts = Curl_hsts_init();
 1283|      3|        if(!data->hsts)
  ------------------
  |  Branch (1283:12): [True: 0, False: 3]
  ------------------
 1284|      0|          return CURLE_OUT_OF_MEMORY;
 1285|      3|      }
 1286|      3|    }
 1287|      3|    else if(!data->share || !data->share->hsts) {
  ------------------
  |  Branch (1287:13): [True: 3, False: 0]
  |  Branch (1287:29): [True: 0, False: 0]
  ------------------
 1288|       |      /* throw away the HSTS cache unless shared */
 1289|      3|      Curl_hsts_cleanup(&data->hsts);
 1290|       |      /* flush all the entries */
 1291|      3|      curl_slist_free_all(data->state.hstslist);
 1292|      3|      data->state.hstslist = NULL;
 1293|      3|    }
 1294|      0|    else
 1295|       |      /* detach from shared HSTS cache without freeing it */
 1296|      0|      data->hsts = NULL;
 1297|      6|    break;
 1298|      6|#endif
 1299|      6|#ifndef CURL_DISABLE_ALTSVC
 1300|     40|  case CURLOPT_ALTSVC_CTRL:
  ------------------
  |  Branch (1300:3): [True: 40, False: 929]
  ------------------
 1301|     40|    return Curl_altsvc_ctrl(data, arg);
 1302|      0|#endif
 1303|       |#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
 1304|       |  case CURLOPT_GSSAPI_DELEGATION:
 1305|       |    s->gssapi_delegation = (unsigned char)arg &
 1306|       |      (CURLGSSAPI_DELEGATION_POLICY_FLAG | CURLGSSAPI_DELEGATION_FLAG);
 1307|       |    break;
 1308|       |#endif
 1309|      7|  default:
  ------------------
  |  Branch (1309:3): [True: 7, False: 962]
  ------------------
 1310|      7|    return CURLE_UNKNOWN_OPTION;
 1311|    969|  }
 1312|    888|  return CURLE_OK;
 1313|    969|}
setopt.c:setopt_slist:
 1341|  18.7k|{
 1342|  18.7k|  CURLcode result = CURLE_OK;
 1343|  18.7k|  struct UserDefined *s = &data->set;
 1344|  18.7k|  switch(option) {
 1345|      0|#ifndef CURL_DISABLE_PROXY
 1346|      0|  case CURLOPT_PROXYHEADER:
  ------------------
  |  Branch (1346:3): [True: 0, False: 18.7k]
  ------------------
 1347|       |    /*
 1348|       |     * Set a list with proxy headers to use (or replace internals with)
 1349|       |     *
 1350|       |     * Since CURLOPT_HTTPHEADER was the only way to set HTTP headers for a
 1351|       |     * long time we remain doing it this way until CURLOPT_PROXYHEADER is
 1352|       |     * used. As soon as this option has been used, if set to anything but
 1353|       |     * NULL, custom headers for proxies are only picked from this list.
 1354|       |     *
 1355|       |     * Set this option to NULL to restore the previous behavior.
 1356|       |     */
 1357|      0|    s->proxyheaders = slist;
 1358|      0|    break;
 1359|      0|#endif
 1360|      0|#ifndef CURL_DISABLE_HTTP
 1361|      0|  case CURLOPT_HTTP200ALIASES:
  ------------------
  |  Branch (1361:3): [True: 0, False: 18.7k]
  ------------------
 1362|       |    /*
 1363|       |     * Set a list of aliases for HTTP 200 in response header
 1364|       |     */
 1365|      0|    s->http200aliases = slist;
 1366|      0|    break;
 1367|      0|#endif
 1368|      0|#if !defined(CURL_DISABLE_FTP) || defined(USE_SSH)
 1369|      0|  case CURLOPT_POSTQUOTE:
  ------------------
  |  Branch (1369:3): [True: 0, False: 18.7k]
  ------------------
 1370|       |    /*
 1371|       |     * List of RAW FTP commands to use after a transfer
 1372|       |     */
 1373|      0|    s->postquote = slist;
 1374|      0|    break;
 1375|      0|  case CURLOPT_PREQUOTE:
  ------------------
  |  Branch (1375:3): [True: 0, False: 18.7k]
  ------------------
 1376|       |    /*
 1377|       |     * List of RAW FTP commands to use prior to RETR (Wesley Laxton)
 1378|       |     */
 1379|      0|    s->prequote = slist;
 1380|      0|    break;
 1381|      0|  case CURLOPT_QUOTE:
  ------------------
  |  Branch (1381:3): [True: 0, False: 18.7k]
  ------------------
 1382|       |    /*
 1383|       |     * List of RAW FTP commands to use before a transfer
 1384|       |     */
 1385|      0|    s->quote = slist;
 1386|      0|    break;
 1387|      0|#endif
 1388|      0|  case CURLOPT_RESOLVE:
  ------------------
  |  Branch (1388:3): [True: 0, False: 18.7k]
  ------------------
 1389|       |    /*
 1390|       |     * List of HOST:PORT:[addresses] strings to populate the DNS cache with
 1391|       |     * Entries added this way will remain in the cache until explicitly
 1392|       |     * removed or the handle is cleaned up.
 1393|       |     *
 1394|       |     * Prefix the HOST with plus sign (+) to have the entry expire like
 1395|       |     * automatically added entries.
 1396|       |     *
 1397|       |     * Prefix the HOST with dash (-) to _remove_ the entry from the cache.
 1398|       |     *
 1399|       |     * This API can remove any entry from the DNS cache, but only entries
 1400|       |     * that are not actually in use right now will be pruned immediately.
 1401|       |     */
 1402|      0|    s->resolve = slist;
 1403|      0|    data->state.resolve = s->resolve;
 1404|      0|    break;
 1405|      0|#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_MIME)
 1406|  1.52k|  case CURLOPT_HTTPHEADER:
  ------------------
  |  Branch (1406:3): [True: 1.52k, False: 17.2k]
  ------------------
 1407|       |    /*
 1408|       |     * Set a list with HTTP headers to use (or replace internals with)
 1409|       |     */
 1410|  1.52k|    s->headers = slist;
 1411|  1.52k|    break;
 1412|      0|#endif
 1413|      0|#ifndef CURL_DISABLE_TELNET
 1414|      0|  case CURLOPT_TELNETOPTIONS:
  ------------------
  |  Branch (1414:3): [True: 0, False: 18.7k]
  ------------------
 1415|       |    /*
 1416|       |     * Set a linked list of telnet options
 1417|       |     */
 1418|      0|    s->telnet_options = slist;
 1419|      0|    break;
 1420|      0|#endif
 1421|      0|#ifndef CURL_DISABLE_SMTP
 1422|     27|  case CURLOPT_MAIL_RCPT:
  ------------------
  |  Branch (1422:3): [True: 27, False: 18.7k]
  ------------------
 1423|       |    /* Set the list of mail recipients */
 1424|     27|    s->mail_rcpt = slist;
 1425|     27|    break;
 1426|      0|#endif
 1427|  17.2k|  case CURLOPT_CONNECT_TO:
  ------------------
  |  Branch (1427:3): [True: 17.2k, False: 1.55k]
  ------------------
 1428|  17.2k|    s->connect_to = slist;
 1429|  17.2k|    break;
 1430|      0|  default:
  ------------------
  |  Branch (1430:3): [True: 0, False: 18.7k]
  ------------------
 1431|      0|    return CURLE_UNKNOWN_OPTION;
 1432|  18.7k|  }
 1433|  18.7k|  return result;
 1434|  18.7k|}
setopt.c:setopt_pointers:
 1471|  1.49k|{
 1472|  1.49k|  CURLcode result = CURLE_OK;
 1473|  1.49k|  struct UserDefined *s = &data->set;
 1474|  1.49k|  switch(option) {
 1475|      0|  case CURLOPT_CURLU:
  ------------------
  |  Branch (1475:3): [True: 0, False: 1.49k]
  ------------------
 1476|       |    /*
 1477|       |     * pass CURLU to set URL
 1478|       |     */
 1479|      0|    Curl_bufref_free(&data->state.url);
 1480|      0|    curlx_safefree(s->str[STRING_SET_URL]);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1481|      0|    s->uh = va_arg(param, CURLU *);
 1482|      0|    break;
 1483|      0|#ifndef CURL_DISABLE_HTTP
 1484|      0|#ifndef CURL_DISABLE_FORM_API
 1485|    314|  case CURLOPT_HTTPPOST:
  ------------------
  |  Branch (1485:3): [True: 314, False: 1.17k]
  ------------------
 1486|       |    /*
 1487|       |     * Set to make us do HTTP POST. Legacy API-style.
 1488|       |     */
 1489|    314|    s->httppost = va_arg(param, struct curl_httppost *);
 1490|    314|    s->method = HTTPREQ_POST_FORM;
 1491|    314|    s->opt_no_body = FALSE; /* this is implied */
  ------------------
  |  | 1058|    314|#define FALSE false
  ------------------
 1492|    314|    Curl_mime_cleanpart(data->state.formp);
 1493|    314|    curlx_safefree(data->state.formp);
  ------------------
  |  | 1327|    314|  do {                      \
  |  | 1328|    314|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|    314|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|    314|    (ptr) = NULL;           \
  |  | 1330|    314|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 314]
  |  |  ------------------
  ------------------
 1494|    314|    data->state.mimepost = NULL;
 1495|    314|    break;
 1496|      0|#endif /* !CURL_DISABLE_FORM_API */
 1497|      0|#endif /* !CURL_DISABLE_HTTP */
 1498|      0|#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_SMTP) ||       \
 1499|      0|  !defined(CURL_DISABLE_IMAP)
 1500|      0|#ifndef CURL_DISABLE_MIME
 1501|    527|  case CURLOPT_MIMEPOST:
  ------------------
  |  Branch (1501:3): [True: 527, False: 963]
  ------------------
 1502|    527|    result = setopt_mimepost(data, va_arg(param, curl_mime *));
 1503|    527|    break;
 1504|      0|#endif /* !CURL_DISABLE_MIME */
 1505|      0|#endif /* !CURL_DISABLE_HTTP || !CURL_DISABLE_SMTP || !CURL_DISABLE_IMAP */
 1506|      0|  case CURLOPT_STDERR:
  ------------------
  |  Branch (1506:3): [True: 0, False: 1.49k]
  ------------------
 1507|       |    /*
 1508|       |     * Set to a FILE * that should receive all error writes. This
 1509|       |     * defaults to stderr for normal operations.
 1510|       |     */
 1511|      0|    s->err = va_arg(param, FILE *);
 1512|      0|    if(!s->err)
  ------------------
  |  Branch (1512:8): [True: 0, False: 0]
  ------------------
 1513|      0|      s->err = stderr;
 1514|      0|    break;
 1515|    649|  case CURLOPT_SHARE: {
  ------------------
  |  Branch (1515:3): [True: 649, False: 841]
  ------------------
 1516|    649|    struct Curl_share *set = va_arg(param, struct Curl_share *);
 1517|       |
 1518|       |    /* disconnect from old share, if any and possible */
 1519|    649|    result = Curl_share_easy_unlink(data);
 1520|    649|    if(result)
  ------------------
  |  Branch (1520:8): [True: 0, False: 649]
  ------------------
 1521|      0|      return result;
 1522|       |
 1523|       |    /* use new share if it set */
 1524|    649|    if(GOOD_SHARE_HANDLE(set)) {
  ------------------
  |  |   38|    649|#define GOOD_SHARE_HANDLE(x) ((x) && (x)->magic == CURL_GOOD_SHARE)
  |  |  ------------------
  |  |  |  |   37|      0|#define CURL_GOOD_SHARE 0x7e117a1e
  |  |  ------------------
  |  |  |  Branch (38:31): [True: 0, False: 649]
  |  |  |  Branch (38:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1525|      0|      result = Curl_share_easy_link(data, set);
 1526|      0|      if(result)
  ------------------
  |  Branch (1526:10): [True: 0, False: 0]
  ------------------
 1527|      0|        return result;
 1528|      0|    }
 1529|    649|    break;
 1530|    649|  }
 1531|       |
 1532|    649|#ifdef USE_HTTP2
 1533|    649|  case CURLOPT_STREAM_DEPENDS:
  ------------------
  |  Branch (1533:3): [True: 0, False: 1.49k]
  ------------------
 1534|      0|  case CURLOPT_STREAM_DEPENDS_E:
  ------------------
  |  Branch (1534:3): [True: 0, False: 1.49k]
  ------------------
 1535|       |    /* not doing stream dependencies any longer, but accept options
 1536|       |     * for backward compatibility */
 1537|      0|    break;
 1538|      0|#endif
 1539|       |
 1540|      0|  default:
  ------------------
  |  Branch (1540:3): [True: 0, False: 1.49k]
  ------------------
 1541|      0|    return CURLE_UNKNOWN_OPTION;
 1542|  1.49k|  }
 1543|  1.49k|  return result;
 1544|  1.49k|}
setopt.c:setopt_mimepost:
 1440|    527|{
 1441|       |  /*
 1442|       |   * Set to make us do MIME POST
 1443|       |   */
 1444|    527|  CURLcode result;
 1445|    527|  struct UserDefined *s = &data->set;
 1446|    527|  if(!s->mimepostp) {
  ------------------
  |  Branch (1446:6): [True: 527, False: 0]
  ------------------
 1447|    527|    s->mimepostp = curlx_malloc(sizeof(*s->mimepostp));
  ------------------
  |  | 1478|    527|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
 1448|    527|    if(!s->mimepostp)
  ------------------
  |  Branch (1448:8): [True: 0, False: 527]
  ------------------
 1449|      0|      return CURLE_OUT_OF_MEMORY;
 1450|    527|    Curl_mime_initpart(s->mimepostp);
 1451|    527|  }
 1452|       |
 1453|    527|  result = Curl_mime_set_subparts(s->mimepostp, mimep, FALSE);
  ------------------
  |  | 1058|    527|#define FALSE false
  ------------------
 1454|    527|  if(!result) {
  ------------------
  |  Branch (1454:6): [True: 527, False: 0]
  ------------------
 1455|    527|    s->method = HTTPREQ_POST_MIME;
 1456|    527|    s->opt_no_body = FALSE; /* this is implied */
  ------------------
  |  | 1058|    527|#define FALSE false
  ------------------
 1457|    527|#ifndef CURL_DISABLE_FORM_API
 1458|    527|    Curl_mime_cleanpart(data->state.formp);
 1459|    527|    curlx_safefree(data->state.formp);
  ------------------
  |  | 1327|    527|  do {                      \
  |  | 1328|    527|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|    527|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|    527|    (ptr) = NULL;           \
  |  | 1330|    527|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 527]
  |  |  ------------------
  ------------------
 1460|       |    data->state.mimepost = NULL;
 1461|    527|#endif
 1462|    527|  }
 1463|    527|  return result;
 1464|    527|}
setopt.c:setopt_cptr:
 1903|   210k|{
 1904|   210k|  CURLcode result;
 1905|   210k|  struct UserDefined *s = &data->set;
 1906|   210k|#ifndef CURL_DISABLE_PROXY
 1907|   210k|  result = setopt_cptr_proxy(data, option, ptr);
 1908|   210k|  if(result != CURLE_UNKNOWN_OPTION)
  ------------------
  |  Branch (1908:6): [True: 9.72k, False: 200k]
  ------------------
 1909|  9.72k|    return result;
 1910|   200k|#endif
 1911|   200k|  result = CURLE_OK;
 1912|       |
 1913|   200k|  switch(option) {
 1914|    803|  case CURLOPT_CAINFO:
  ------------------
  |  Branch (1914:3): [True: 803, False: 199k]
  ------------------
 1915|       |    /*
 1916|       |     * Set CA info for SSL connection. Specify filename of the CA certificate
 1917|       |     */
 1918|    803|    s->ssl.custom_cafile = TRUE;
  ------------------
  |  | 1055|    803|#define TRUE true
  ------------------
 1919|    803|    return Curl_setstropt(&s->str[STRING_SSL_CAFILE], ptr);
 1920|    813|  case CURLOPT_CAPATH:
  ------------------
  |  Branch (1920:3): [True: 813, False: 199k]
  ------------------
 1921|       |    /*
 1922|       |     * Set CA path info for SSL connection. Specify directory name of the CA
 1923|       |     * certificates which have been prepared using openssl c_rehash utility.
 1924|       |     */
 1925|    813|#ifdef USE_SSL
 1926|    813|    if(Curl_ssl_supports(data, SSLSUPP_CA_PATH)) {
  ------------------
  |  |   35|    813|#define SSLSUPP_CA_PATH      (1 << 0) /* supports CAPATH */
  ------------------
  |  Branch (1926:8): [True: 813, False: 0]
  ------------------
 1927|       |      /* This does not work on Windows. */
 1928|    813|      s->ssl.custom_capath = TRUE;
  ------------------
  |  | 1055|    813|#define TRUE true
  ------------------
 1929|    813|      return Curl_setstropt(&s->str[STRING_SSL_CAPATH], ptr);
 1930|    813|    }
 1931|      0|#endif
 1932|      0|    return CURLE_NOT_BUILT_IN;
 1933|  17.8k|  case CURLOPT_CRLFILE:
  ------------------
  |  Branch (1933:3): [True: 17.8k, False: 182k]
  ------------------
 1934|       |    /*
 1935|       |     * Set CRL file info for SSL connection. Specify filename of the CRL
 1936|       |     * to check certificates revocation
 1937|       |     */
 1938|  17.8k|    if(Curl_ssl_supports(data, SSLSUPP_CRLFILE))
  ------------------
  |  |   48|  17.8k|#define SSLSUPP_CRLFILE      (1 << 13) /* supports CURLOPT_CRLFILE */
  ------------------
  |  Branch (1938:8): [True: 17.8k, False: 0]
  ------------------
 1939|  17.8k|      return Curl_setstropt(&s->str[STRING_SSL_CRLFILE], ptr);
 1940|      0|    return CURLE_NOT_BUILT_IN;
 1941|    915|  case CURLOPT_SSL_CIPHER_LIST:
  ------------------
  |  Branch (1941:3): [True: 915, False: 199k]
  ------------------
 1942|    915|    if(Curl_ssl_supports(data, SSLSUPP_CIPHER_LIST))
  ------------------
  |  |   44|    915|#define SSLSUPP_CIPHER_LIST  (1 << 9) /* supports TLS 1.0-1.2 ciphersuites */
  ------------------
  |  Branch (1942:8): [True: 915, False: 0]
  ------------------
 1943|       |      /* set a list of cipher we want to use in the SSL connection */
 1944|    915|      return Curl_setstropt(&s->str[STRING_SSL_CIPHER_LIST], ptr);
 1945|      0|    else
 1946|      0|      return CURLE_NOT_BUILT_IN;
 1947|    203|  case CURLOPT_TLS13_CIPHERS:
  ------------------
  |  Branch (1947:3): [True: 203, False: 200k]
  ------------------
 1948|    203|    if(Curl_ssl_supports(data, SSLSUPP_TLS13_CIPHERSUITES)) {
  ------------------
  |  |   40|    203|#define SSLSUPP_TLS13_CIPHERSUITES (1 << 5) /* supports TLS 1.3 ciphersuites */
  ------------------
  |  Branch (1948:8): [True: 203, False: 0]
  ------------------
 1949|       |      /* set preferred list of TLS 1.3 cipher suites */
 1950|    203|      return Curl_setstropt(&s->str[STRING_SSL_CIPHER13_LIST], ptr);
 1951|    203|    }
 1952|      0|    else
 1953|      0|      return CURLE_NOT_BUILT_IN;
 1954|      0|  case CURLOPT_RANDOM_FILE:
  ------------------
  |  Branch (1954:3): [True: 0, False: 200k]
  ------------------
 1955|      0|    break;
 1956|      0|  case CURLOPT_EGDSOCKET:
  ------------------
  |  Branch (1956:3): [True: 0, False: 200k]
  ------------------
 1957|      0|    break;
 1958|     87|  case CURLOPT_REQUEST_TARGET:
  ------------------
  |  Branch (1958:3): [True: 87, False: 200k]
  ------------------
 1959|     87|    return Curl_setstropt(&s->str[STRING_TARGET], ptr);
 1960|      0|#ifndef CURL_DISABLE_NETRC
 1961|  17.2k|  case CURLOPT_NETRC_FILE:
  ------------------
  |  Branch (1961:3): [True: 17.2k, False: 183k]
  ------------------
 1962|       |    /*
 1963|       |     * Use this file instead of the $HOME/.netrc file
 1964|       |     */
 1965|  17.2k|    return Curl_setstropt(&s->str[STRING_NETRC_FILE], ptr);
 1966|      0|#endif
 1967|       |
 1968|      0|#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_MQTT)
 1969|      0|  case CURLOPT_COPYPOSTFIELDS:
  ------------------
  |  Branch (1969:3): [True: 0, False: 200k]
  ------------------
 1970|      0|    return setopt_copypostfields(ptr, s);
 1971|       |
 1972|    879|  case CURLOPT_POSTFIELDS:
  ------------------
  |  Branch (1972:3): [True: 879, False: 199k]
  ------------------
 1973|       |    /*
 1974|       |     * Like above, but use static data instead of copying it.
 1975|       |     */
 1976|    879|    s->postfields = ptr;
 1977|       |    /* Release old copied data. */
 1978|    879|    curlx_safefree(s->str[STRING_COPYPOSTFIELDS]);
  ------------------
  |  | 1327|    879|  do {                      \
  |  | 1328|    879|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|    879|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|    879|    (ptr) = NULL;           \
  |  | 1330|    879|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 879]
  |  |  ------------------
  ------------------
 1979|    879|    s->method = HTTPREQ_POST;
 1980|    879|    break;
 1981|      0|#endif /* !CURL_DISABLE_HTTP || !CURL_DISABLE_MQTT */
 1982|       |
 1983|      0|#ifndef CURL_DISABLE_HTTP
 1984|      0|  case CURLOPT_TRAILERDATA:
  ------------------
  |  Branch (1984:3): [True: 0, False: 200k]
  ------------------
 1985|      0|    s->trailer_data = ptr;
 1986|      0|    break;
 1987|    174|  case CURLOPT_ACCEPT_ENCODING:
  ------------------
  |  Branch (1987:3): [True: 174, False: 200k]
  ------------------
 1988|       |    /*
 1989|       |     * String to use at the value of Accept-Encoding header.
 1990|       |     *
 1991|       |     * If the encoding is set to "" we use an Accept-Encoding header that
 1992|       |     * encompasses all the encodings we support.
 1993|       |     * If the encoding is set to NULL we do not send an Accept-Encoding header
 1994|       |     * and ignore an received Content-Encoding header.
 1995|       |     *
 1996|       |     */
 1997|    174|    if(ptr && !*ptr) {
  ------------------
  |  Branch (1997:8): [True: 174, False: 0]
  |  Branch (1997:15): [True: 15, False: 159]
  ------------------
 1998|     15|      ptr = Curl_get_content_encodings();
 1999|     15|      if(ptr) {
  ------------------
  |  Branch (1999:10): [True: 15, False: 0]
  ------------------
 2000|     15|        curlx_free(s->str[STRING_ENCODING]);
  ------------------
  |  | 1483|     15|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2001|     15|        s->str[STRING_ENCODING] = ptr;
 2002|     15|      }
 2003|      0|      else
 2004|      0|        result = CURLE_OUT_OF_MEMORY;
 2005|     15|      return result;
 2006|     15|    }
 2007|    159|    return Curl_setstropt(&s->str[STRING_ENCODING], ptr);
 2008|       |
 2009|      0|#ifndef CURL_DISABLE_AWS
 2010|  1.16k|  case CURLOPT_AWS_SIGV4:
  ------------------
  |  Branch (2010:3): [True: 1.16k, False: 199k]
  ------------------
 2011|       |    /*
 2012|       |     * String that is merged to some authentication
 2013|       |     * parameters are used by the algorithm.
 2014|       |     */
 2015|  1.16k|    result = Curl_setstropt(&s->str[STRING_AWS_SIGV4], ptr);
 2016|       |    /*
 2017|       |     * Basic been set by default it need to be unset here
 2018|       |     */
 2019|  1.16k|    if(s->str[STRING_AWS_SIGV4])
  ------------------
  |  Branch (2019:8): [True: 1.16k, False: 0]
  ------------------
 2020|  1.16k|      s->httpauth = CURLAUTH_AWS_SIGV4;
  ------------------
  |  |  845|  1.16k|#define CURLAUTH_AWS_SIGV4    (((unsigned long)1) << 7)
  ------------------
 2021|  1.16k|    break;
 2022|      0|#endif
 2023|    172|  case CURLOPT_REFERER:
  ------------------
  |  Branch (2023:3): [True: 172, False: 200k]
  ------------------
 2024|       |    /*
 2025|       |     * String to set in the HTTP Referer: field.
 2026|       |     */
 2027|    172|    result = Curl_setstropt(&s->str[STRING_SET_REFERER], ptr);
 2028|    172|    break;
 2029|       |
 2030|    991|  case CURLOPT_USERAGENT:
  ------------------
  |  Branch (2030:3): [True: 991, False: 199k]
  ------------------
 2031|       |    /*
 2032|       |     * String to use in the HTTP User-Agent field
 2033|       |     */
 2034|    991|    return Curl_setstropt(&s->str[STRING_USERAGENT], ptr);
 2035|       |
 2036|      0|#ifndef CURL_DISABLE_COOKIES
 2037|    179|  case CURLOPT_COOKIE:
  ------------------
  |  Branch (2037:3): [True: 179, False: 200k]
  ------------------
 2038|       |    /*
 2039|       |     * Cookie string to send to the remote server in the request.
 2040|       |     */
 2041|    179|    return Curl_setstropt(&s->str[STRING_COOKIE], ptr);
 2042|       |
 2043|  17.2k|  case CURLOPT_COOKIEFILE:
  ------------------
  |  Branch (2043:3): [True: 17.2k, False: 183k]
  ------------------
 2044|  17.2k|    return cookiefile(data, ptr);
 2045|       |
 2046|  17.2k|  case CURLOPT_COOKIEJAR:
  ------------------
  |  Branch (2046:3): [True: 17.2k, False: 183k]
  ------------------
 2047|       |    /*
 2048|       |     * Set cookie filename to dump all cookies to when we are done.
 2049|       |     */
 2050|  17.2k|    result = Curl_setstropt(&s->str[STRING_COOKIEJAR], ptr);
 2051|  17.2k|    if(!result) {
  ------------------
  |  Branch (2051:8): [True: 17.2k, False: 0]
  ------------------
 2052|       |      /*
 2053|       |       * Activate the cookie parser. This may or may not already
 2054|       |       * have been made.
 2055|       |       */
 2056|  17.2k|      if(!data->cookies)
  ------------------
  |  Branch (2056:10): [True: 15.7k, False: 1.45k]
  ------------------
 2057|  15.7k|        data->cookies = Curl_cookie_init();
 2058|  17.2k|      if(!data->cookies)
  ------------------
  |  Branch (2058:10): [True: 0, False: 17.2k]
  ------------------
 2059|      0|        result = CURLE_OUT_OF_MEMORY;
 2060|  17.2k|      else
 2061|  17.2k|        data->state.cookie_engine = TRUE;
  ------------------
  |  | 1055|  17.2k|#define TRUE true
  ------------------
 2062|  17.2k|    }
 2063|  17.2k|    break;
 2064|       |
 2065|  1.49k|  case CURLOPT_COOKIELIST:
  ------------------
  |  Branch (2065:3): [True: 1.49k, False: 198k]
  ------------------
 2066|  1.49k|    return cookielist(data, ptr);
 2067|      0|#endif /* !CURL_DISABLE_COOKIES */
 2068|       |
 2069|      0|#endif /* !CURL_DISABLE_HTTP */
 2070|       |
 2071|    124|  case CURLOPT_CUSTOMREQUEST:
  ------------------
  |  Branch (2071:3): [True: 124, False: 200k]
  ------------------
 2072|       |    /*
 2073|       |     * Set a custom string to use as request
 2074|       |     */
 2075|    124|    return Curl_setstropt(&s->str[STRING_CUSTOMREQUEST], ptr);
 2076|       |
 2077|       |    /* we do not set s->method = HTTPREQ_CUSTOM; here, we continue as if we
 2078|       |       were using the already set type and this changes the actual request
 2079|       |       keyword */
 2080|     19|  case CURLOPT_SERVICE_NAME:
  ------------------
  |  Branch (2080:3): [True: 19, False: 200k]
  ------------------
 2081|       |    /*
 2082|       |     * Set authentication service name for DIGEST-MD5, Kerberos 5 and SPNEGO
 2083|       |     */
 2084|     19|    return Curl_setstropt(&s->str[STRING_SERVICE_NAME], ptr);
 2085|       |
 2086|      0|  case CURLOPT_HEADERDATA:
  ------------------
  |  Branch (2086:3): [True: 0, False: 200k]
  ------------------
 2087|       |    /*
 2088|       |     * Custom pointer to pass the header write callback function
 2089|       |     */
 2090|      0|    s->writeheader = ptr;
 2091|      0|    break;
 2092|  17.2k|  case CURLOPT_READDATA:
  ------------------
  |  Branch (2092:3): [True: 17.2k, False: 183k]
  ------------------
 2093|       |    /*
 2094|       |     * FILE pointer to read the file to be uploaded from. Or possibly used as
 2095|       |     * argument to the read callback.
 2096|       |     */
 2097|  17.2k|    s->in_set = ptr;
 2098|  17.2k|    break;
 2099|  17.8k|  case CURLOPT_WRITEDATA:
  ------------------
  |  Branch (2099:3): [True: 17.8k, False: 182k]
  ------------------
 2100|       |    /*
 2101|       |     * FILE pointer to write to. Or possibly used as argument to the write
 2102|       |     * callback.
 2103|       |     */
 2104|  17.8k|    s->out = ptr;
 2105|  17.8k|    break;
 2106|      0|  case CURLOPT_DEBUGDATA:
  ------------------
  |  Branch (2106:3): [True: 0, False: 200k]
  ------------------
 2107|       |    /*
 2108|       |     * Set to a void * that should receive all error writes. This
 2109|       |     * defaults to CURLOPT_STDERR for normal operations.
 2110|       |     */
 2111|      0|    s->debugdata = ptr;
 2112|      0|    break;
 2113|      0|  case CURLOPT_PROGRESSDATA:
  ------------------
  |  | 1343|      0|#define CURLOPT_PROGRESSDATA CURLOPT_XFERINFODATA
  ------------------
  |  Branch (2113:3): [True: 0, False: 200k]
  ------------------
 2114|       |    /*
 2115|       |     * Custom client data to pass to the progress callback
 2116|       |     */
 2117|      0|    s->progress_client = ptr;
 2118|      0|    break;
 2119|      0|  case CURLOPT_SEEKDATA:
  ------------------
  |  Branch (2119:3): [True: 0, False: 200k]
  ------------------
 2120|       |    /*
 2121|       |     * Seek control callback. Might be NULL.
 2122|       |     */
 2123|      0|    s->seek_client = ptr;
 2124|      0|    break;
 2125|      0|  case CURLOPT_IOCTLDATA:
  ------------------
  |  Branch (2125:3): [True: 0, False: 200k]
  ------------------
 2126|       |    /*
 2127|       |     * I/O control data pointer. Might be NULL.
 2128|       |     */
 2129|      0|    s->ioctl_client = ptr;
 2130|      0|    break;
 2131|      0|  case CURLOPT_SSL_CTX_DATA:
  ------------------
  |  Branch (2131:3): [True: 0, False: 200k]
  ------------------
 2132|       |    /*
 2133|       |     * Set an SSL_CTX callback parameter pointer
 2134|       |     */
 2135|      0|#ifdef USE_SSL
 2136|      0|    if(Curl_ssl_supports(data, SSLSUPP_SSL_CTX)) {
  ------------------
  |  |   38|      0|#define SSLSUPP_SSL_CTX      (1 << 3) /* supports CURLOPT_SSL_CTX */
  ------------------
  |  Branch (2136:8): [True: 0, False: 0]
  ------------------
 2137|      0|      s->ssl.fsslctxp = ptr;
 2138|      0|      break;
 2139|      0|    }
 2140|      0|    else
 2141|      0|#endif
 2142|      0|      return CURLE_NOT_BUILT_IN;
 2143|      0|  case CURLOPT_SOCKOPTDATA:
  ------------------
  |  Branch (2143:3): [True: 0, False: 200k]
  ------------------
 2144|       |    /*
 2145|       |     * socket callback data pointer. Might be NULL.
 2146|       |     */
 2147|      0|    s->sockopt_client = ptr;
 2148|      0|    break;
 2149|  17.2k|  case CURLOPT_OPENSOCKETDATA:
  ------------------
  |  Branch (2149:3): [True: 17.2k, False: 183k]
  ------------------
 2150|       |    /*
 2151|       |     * socket callback data pointer. Might be NULL.
 2152|       |     */
 2153|  17.2k|    s->opensocket_client = ptr;
 2154|  17.2k|    break;
 2155|      0|  case CURLOPT_RESOLVER_START_DATA:
  ------------------
  |  Branch (2155:3): [True: 0, False: 200k]
  ------------------
 2156|       |    /*
 2157|       |     * resolver start callback data pointer. Might be NULL.
 2158|       |     */
 2159|      0|    s->resolver_start_client = ptr;
 2160|      0|    break;
 2161|      0|  case CURLOPT_CLOSESOCKETDATA:
  ------------------
  |  Branch (2161:3): [True: 0, False: 200k]
  ------------------
 2162|       |    /*
 2163|       |     * socket callback data pointer. Might be NULL.
 2164|       |     */
 2165|      0|    s->closesocket_client = ptr;
 2166|      0|    break;
 2167|      0|  case CURLOPT_PREREQDATA:
  ------------------
  |  Branch (2167:3): [True: 0, False: 200k]
  ------------------
 2168|      0|    s->prereq_userp = ptr;
 2169|      0|    break;
 2170|      0|  case CURLOPT_ERRORBUFFER:
  ------------------
  |  Branch (2170:3): [True: 0, False: 200k]
  ------------------
 2171|       |    /*
 2172|       |     * Error buffer provided by the caller to get the human readable error
 2173|       |     * string in.
 2174|       |     */
 2175|      0|    s->errorbuffer = ptr;
 2176|      0|    break;
 2177|       |
 2178|      0|#ifndef CURL_DISABLE_FTP
 2179|     23|  case CURLOPT_FTPPORT:
  ------------------
  |  Branch (2179:3): [True: 23, False: 200k]
  ------------------
 2180|       |    /*
 2181|       |     * Use FTP PORT, this also specifies which IP address to use
 2182|       |     */
 2183|     23|    result = Curl_setstropt(&s->str[STRING_FTPPORT], ptr);
 2184|     23|    s->ftp_use_port = !!(s->str[STRING_FTPPORT]);
 2185|     23|    break;
 2186|       |
 2187|    350|  case CURLOPT_FTP_ACCOUNT:
  ------------------
  |  Branch (2187:3): [True: 350, False: 200k]
  ------------------
 2188|    350|    return Curl_setstropt(&s->str[STRING_FTP_ACCOUNT], ptr);
 2189|       |
 2190|     11|  case CURLOPT_FTP_ALTERNATIVE_TO_USER:
  ------------------
  |  Branch (2190:3): [True: 11, False: 200k]
  ------------------
 2191|     11|    return Curl_setstropt(&s->str[STRING_FTP_ALTERNATIVE_TO_USER], ptr);
 2192|       |
 2193|      1|  case CURLOPT_KRBLEVEL:
  ------------------
  |  Branch (2193:3): [True: 1, False: 200k]
  ------------------
 2194|      1|    return CURLE_NOT_BUILT_IN; /* removed in 8.17.0 */
 2195|      0|  case CURLOPT_CHUNK_DATA:
  ------------------
  |  Branch (2195:3): [True: 0, False: 200k]
  ------------------
 2196|      0|    s->wildcardptr = ptr;
 2197|      0|    break;
 2198|      0|  case CURLOPT_FNMATCH_DATA:
  ------------------
  |  Branch (2198:3): [True: 0, False: 200k]
  ------------------
 2199|      0|    s->fnmatch_data = ptr;
 2200|      0|    break;
 2201|      0|#endif
 2202|  14.5k|  case CURLOPT_URL:
  ------------------
  |  Branch (2202:3): [True: 14.5k, False: 185k]
  ------------------
 2203|       |    /*
 2204|       |     * The URL to fetch.
 2205|       |     */
 2206|  14.5k|    result = Curl_setstropt(&s->str[STRING_SET_URL], ptr);
 2207|  14.5k|    Curl_bufref_set(&data->state.url, s->str[STRING_SET_URL], 0, NULL);
 2208|  14.5k|    break;
 2209|       |
 2210|    117|  case CURLOPT_USERPWD:
  ------------------
  |  Branch (2210:3): [True: 117, False: 200k]
  ------------------
 2211|       |    /*
 2212|       |     * user:password to use in the operation
 2213|       |     */
 2214|    117|    return setstropt_userpwd(ptr, &s->str[STRING_USERNAME],
 2215|    117|                             &s->str[STRING_PASSWORD]);
 2216|       |
 2217|     41|  case CURLOPT_USERNAME:
  ------------------
  |  Branch (2217:3): [True: 41, False: 200k]
  ------------------
 2218|       |    /*
 2219|       |     * authentication username to use in the operation
 2220|       |     */
 2221|     41|    return Curl_setstropt(&s->str[STRING_USERNAME], ptr);
 2222|       |
 2223|    120|  case CURLOPT_PASSWORD:
  ------------------
  |  Branch (2223:3): [True: 120, False: 200k]
  ------------------
 2224|       |    /*
 2225|       |     * authentication password to use in the operation
 2226|       |     */
 2227|    120|    return Curl_setstropt(&s->str[STRING_PASSWORD], ptr);
 2228|       |
 2229|     85|  case CURLOPT_LOGIN_OPTIONS:
  ------------------
  |  Branch (2229:3): [True: 85, False: 200k]
  ------------------
 2230|       |    /*
 2231|       |     * authentication options to use in the operation
 2232|       |     */
 2233|     85|    return Curl_setstropt(&s->str[STRING_OPTIONS], ptr);
 2234|       |
 2235|    275|  case CURLOPT_XOAUTH2_BEARER:
  ------------------
  |  Branch (2235:3): [True: 275, False: 200k]
  ------------------
 2236|       |    /*
 2237|       |     * OAuth 2.0 bearer token to use in the operation
 2238|       |     */
 2239|    275|    return Curl_setstropt(&s->str[STRING_BEARER], ptr);
 2240|    355|  case CURLOPT_RANGE:
  ------------------
  |  Branch (2240:3): [True: 355, False: 200k]
  ------------------
 2241|       |    /*
 2242|       |     * What range of the file you want to transfer
 2243|       |     */
 2244|    355|    return Curl_setstropt(&s->str[STRING_SET_RANGE], ptr);
 2245|     30|  case CURLOPT_SSLCERT:
  ------------------
  |  Branch (2245:3): [True: 30, False: 200k]
  ------------------
 2246|       |    /*
 2247|       |     * String that holds filename of the SSL certificate to use
 2248|       |     */
 2249|     30|    return Curl_setstropt(&s->str[STRING_CERT], ptr);
 2250|     19|  case CURLOPT_SSLCERTTYPE:
  ------------------
  |  Branch (2250:3): [True: 19, False: 200k]
  ------------------
 2251|       |    /*
 2252|       |     * String that holds file type of the SSL certificate to use
 2253|       |     */
 2254|     19|    return Curl_setstropt(&s->str[STRING_CERT_TYPE], ptr);
 2255|      9|  case CURLOPT_SSLKEY:
  ------------------
  |  Branch (2255:3): [True: 9, False: 200k]
  ------------------
 2256|       |    /*
 2257|       |     * String that holds filename of the SSL key to use
 2258|       |     */
 2259|      9|    return Curl_setstropt(&s->str[STRING_KEY], ptr);
 2260|     49|  case CURLOPT_SSLKEYTYPE:
  ------------------
  |  Branch (2260:3): [True: 49, False: 200k]
  ------------------
 2261|       |    /*
 2262|       |     * String that holds file type of the SSL key to use
 2263|       |     */
 2264|     49|    return Curl_setstropt(&s->str[STRING_KEY_TYPE], ptr);
 2265|      6|  case CURLOPT_KEYPASSWD:
  ------------------
  |  Branch (2265:3): [True: 6, False: 200k]
  ------------------
 2266|       |    /*
 2267|       |     * String that holds the SSL or SSH private key password.
 2268|       |     */
 2269|      6|    return Curl_setstropt(&s->str[STRING_KEY_PASSWD], ptr);
 2270|    827|  case CURLOPT_SSLENGINE:
  ------------------
  |  Branch (2270:3): [True: 827, False: 199k]
  ------------------
 2271|       |    /*
 2272|       |     * String that holds the SSL crypto engine.
 2273|       |     */
 2274|    827|    if(ptr && ptr[0]) {
  ------------------
  |  Branch (2274:8): [True: 827, False: 0]
  |  Branch (2274:15): [True: 824, False: 3]
  ------------------
 2275|    824|      result = Curl_setstropt(&s->str[STRING_SSL_ENGINE], ptr);
 2276|    824|      if(!result) {
  ------------------
  |  Branch (2276:10): [True: 824, False: 0]
  ------------------
 2277|    824|        result = Curl_ssl_set_engine(data, ptr);
 2278|    824|      }
 2279|    824|    }
 2280|    827|    break;
 2281|    191|  case CURLOPT_INTERFACE:
  ------------------
  |  Branch (2281:3): [True: 191, False: 200k]
  ------------------
 2282|       |    /*
 2283|       |     * Set what interface or address/hostname to bind the socket to when
 2284|       |     * performing an operation and thus what from-IP your connection will use.
 2285|       |     */
 2286|    191|    return setstropt_interface(ptr,
 2287|    191|                               &s->str[STRING_DEVICE],
 2288|    191|                               &s->str[STRING_INTERFACE],
 2289|    191|                               &s->str[STRING_BINDHOST]);
 2290|     18|  case CURLOPT_ISSUERCERT:
  ------------------
  |  Branch (2290:3): [True: 18, False: 200k]
  ------------------
 2291|       |    /*
 2292|       |     * Set Issuer certificate file
 2293|       |     * to check certificates issuer
 2294|       |     */
 2295|     18|    if(Curl_ssl_supports(data, SSLSUPP_ISSUERCERT))
  ------------------
  |  |   46|     18|#define SSLSUPP_ISSUERCERT   (1 << 11) /* supports CURLOPT_ISSUERCERT */
  ------------------
  |  Branch (2295:8): [True: 18, False: 0]
  ------------------
 2296|     18|      return Curl_setstropt(&s->str[STRING_SSL_ISSUERCERT], ptr);
 2297|      0|    return CURLE_NOT_BUILT_IN;
 2298|      0|  case CURLOPT_PRIVATE:
  ------------------
  |  Branch (2298:3): [True: 0, False: 200k]
  ------------------
 2299|       |    /*
 2300|       |     * Set private data pointer.
 2301|       |     */
 2302|      0|    s->private_data = ptr;
 2303|      0|    break;
 2304|      0|#ifdef USE_SSL
 2305|    468|  case CURLOPT_SSL_EC_CURVES:
  ------------------
  |  Branch (2305:3): [True: 468, False: 199k]
  ------------------
 2306|       |    /*
 2307|       |     * Set accepted curves in SSL connection setup.
 2308|       |     * Specify colon-delimited list of curve algorithm names.
 2309|       |     */
 2310|    468|    if(Curl_ssl_supports(data, SSLSUPP_SSL_EC_CURVES))
  ------------------
  |  |   47|    468|#define SSLSUPP_SSL_EC_CURVES (1 << 12) /* supports CURLOPT_SSL_EC_CURVES */
  ------------------
  |  Branch (2310:8): [True: 468, False: 0]
  ------------------
 2311|    468|      return Curl_setstropt(&s->str[STRING_SSL_EC_CURVES], ptr);
 2312|      0|    return CURLE_NOT_BUILT_IN;
 2313|      0|  case CURLOPT_SSL_SIGNATURE_ALGORITHMS:
  ------------------
  |  Branch (2313:3): [True: 0, False: 200k]
  ------------------
 2314|       |    /*
 2315|       |     * Set accepted signature algorithms.
 2316|       |     * Specify colon-delimited list of signature scheme names.
 2317|       |     */
 2318|      0|    if(Curl_ssl_supports(data, SSLSUPP_SIGNATURE_ALGORITHMS))
  ------------------
  |  |   45|      0|#define SSLSUPP_SIGNATURE_ALGORITHMS (1 << 10) /* supports TLS sigalgs */
  ------------------
  |  Branch (2318:8): [True: 0, False: 0]
  ------------------
 2319|      0|      return Curl_setstropt(&s->str[STRING_SSL_SIGNATURE_ALGORITHMS], ptr);
 2320|      0|    return CURLE_NOT_BUILT_IN;
 2321|     60|  case CURLOPT_PINNEDPUBLICKEY:
  ------------------
  |  Branch (2321:3): [True: 60, False: 200k]
  ------------------
 2322|       |    /*
 2323|       |     * Set pinned public key for SSL connection.
 2324|       |     * Specify filename of the public key in DER format.
 2325|       |     */
 2326|     60|    if(Curl_ssl_supports(data, SSLSUPP_PINNEDPUBKEY))
  ------------------
  |  |   37|     60|#define SSLSUPP_PINNEDPUBKEY (1 << 2) /* supports CURLOPT_PINNEDPUBLICKEY */
  ------------------
  |  Branch (2326:8): [True: 60, False: 0]
  ------------------
 2327|     60|      return Curl_setstropt(&s->str[STRING_SSL_PINNEDPUBLICKEY], ptr);
 2328|      0|    return CURLE_NOT_BUILT_IN;
 2329|      0|#endif
 2330|       |#ifdef USE_SSH
 2331|       |  case CURLOPT_SSH_PUBLIC_KEYFILE:
 2332|       |    /*
 2333|       |     * Use this file instead of the $HOME/.ssh/id_dsa.pub file
 2334|       |     */
 2335|       |    return Curl_setstropt(&s->str[STRING_SSH_PUBLIC_KEY], ptr);
 2336|       |  case CURLOPT_SSH_PRIVATE_KEYFILE:
 2337|       |    /*
 2338|       |     * Use this file instead of the $HOME/.ssh/id_dsa file
 2339|       |     */
 2340|       |    return Curl_setstropt(&s->str[STRING_SSH_PRIVATE_KEY], ptr);
 2341|       |  case CURLOPT_SSH_KEYDATA:
 2342|       |    /*
 2343|       |     * Custom client data to pass to the SSH keyfunc callback
 2344|       |     */
 2345|       |    s->ssh_keyfunc_userp = ptr;
 2346|       |    break;
 2347|       |#if defined(USE_LIBSSH2) || defined(USE_LIBSSH)
 2348|       |  case CURLOPT_SSH_HOST_PUBLIC_KEY_MD5:
 2349|       |    /*
 2350|       |     * Option to allow for the MD5 of the host public key to be checked
 2351|       |     * for validation purposes.
 2352|       |     */
 2353|       |    return Curl_setstropt(&s->str[STRING_SSH_HOST_PUBLIC_KEY_MD5], ptr);
 2354|       |  case CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256:
 2355|       |    /*
 2356|       |     * Option to allow for the SHA256 of the host public key to be checked
 2357|       |     * for validation purposes.
 2358|       |     */
 2359|       |    return Curl_setstropt(&s->str[STRING_SSH_HOST_PUBLIC_KEY_SHA256], ptr);
 2360|       |  case CURLOPT_SSH_KNOWNHOSTS:
 2361|       |    /*
 2362|       |     * Store the filename to read known hosts from.
 2363|       |     */
 2364|       |    return Curl_setstropt(&s->str[STRING_SSH_KNOWNHOSTS], ptr);
 2365|       |#endif
 2366|       |#ifdef USE_LIBSSH2
 2367|       |  case CURLOPT_SSH_HOSTKEYDATA:
 2368|       |    /*
 2369|       |     * Custom client data to pass to the SSH keyfunc callback
 2370|       |     */
 2371|       |    s->ssh_hostkeyfunc_userp = ptr;
 2372|       |    break;
 2373|       |#endif /* USE_LIBSSH2 */
 2374|       |#endif /* USE_SSH */
 2375|  17.2k|  case CURLOPT_PROTOCOLS_STR:
  ------------------
  |  Branch (2375:3): [True: 17.2k, False: 183k]
  ------------------
 2376|  17.2k|    if(ptr) {
  ------------------
  |  Branch (2376:8): [True: 17.2k, False: 0]
  ------------------
 2377|  17.2k|      curl_prot_t protos;
 2378|  17.2k|      result = protocol2num(ptr, &protos);
 2379|  17.2k|      if(!result)
  ------------------
  |  Branch (2379:10): [True: 17.2k, False: 0]
  ------------------
 2380|  17.2k|        s->allowed_protocols = protos;
 2381|  17.2k|    }
 2382|      0|    else
 2383|       |      /* make a NULL argument reset to default */
 2384|      0|      s->allowed_protocols = (curl_prot_t)CURLPROTO_64ALL;
  ------------------
  |  |   68|      0|#define CURLPROTO_64ALL ((uint64_t)0xffffffffffffffff)
  ------------------
 2385|  17.2k|    break;
 2386|     37|  case CURLOPT_REDIR_PROTOCOLS_STR:
  ------------------
  |  Branch (2386:3): [True: 37, False: 200k]
  ------------------
 2387|     37|    if(ptr) {
  ------------------
  |  Branch (2387:8): [True: 37, False: 0]
  ------------------
 2388|     37|      curl_prot_t protos;
 2389|     37|      result = protocol2num(ptr, &protos);
 2390|     37|      if(!result)
  ------------------
  |  Branch (2390:10): [True: 8, False: 29]
  ------------------
 2391|      8|        s->redir_protocols = protos;
 2392|     37|    }
 2393|      0|    else
 2394|       |      /* make a NULL argument reset to default */
 2395|      0|      s->redir_protocols = (curl_prot_t)CURLPROTO_REDIR;
  ------------------
  |  |   71|      0|#define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1078|      0|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1079|      0|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1080|      0|#define CURLPROTO_FTP     (1L << 2)
  |  |  ------------------
  |  |   72|      0|                         CURLPROTO_FTPS)
  |  |  ------------------
  |  |  |  | 1081|      0|#define CURLPROTO_FTPS    (1L << 3)
  |  |  ------------------
  ------------------
 2396|     37|    break;
 2397|    707|  case CURLOPT_DEFAULT_PROTOCOL:
  ------------------
  |  Branch (2397:3): [True: 707, False: 199k]
  ------------------
 2398|       |    /* Set the protocol to use when the URL does not include any protocol */
 2399|    707|    return Curl_setstropt(&s->str[STRING_DEFAULT_PROTOCOL], ptr);
 2400|      0|#ifndef CURL_DISABLE_SMTP
 2401|     59|  case CURLOPT_MAIL_FROM:
  ------------------
  |  Branch (2401:3): [True: 59, False: 200k]
  ------------------
 2402|       |    /* Set the SMTP mail originator */
 2403|     59|    return Curl_setstropt(&s->str[STRING_MAIL_FROM], ptr);
 2404|     21|  case CURLOPT_MAIL_AUTH:
  ------------------
  |  Branch (2404:3): [True: 21, False: 200k]
  ------------------
 2405|       |    /* Set the SMTP auth originator */
 2406|     21|    return Curl_setstropt(&s->str[STRING_MAIL_AUTH], ptr);
 2407|      0|#endif
 2408|    101|  case CURLOPT_SASL_AUTHZID:
  ------------------
  |  Branch (2408:3): [True: 101, False: 200k]
  ------------------
 2409|       |    /* Authorization identity (identity to act as) */
 2410|    101|    return Curl_setstropt(&s->str[STRING_SASL_AUTHZID], ptr);
 2411|      0|#ifndef CURL_DISABLE_RTSP
 2412|     29|  case CURLOPT_RTSP_SESSION_ID:
  ------------------
  |  Branch (2412:3): [True: 29, False: 200k]
  ------------------
 2413|       |    /*
 2414|       |     * Set the RTSP Session ID manually. Useful if the application is
 2415|       |     * resuming a previously established RTSP session
 2416|       |     */
 2417|     29|    return Curl_setstropt(&s->str[STRING_RTSP_SESSION_ID], ptr);
 2418|     15|  case CURLOPT_RTSP_STREAM_URI:
  ------------------
  |  Branch (2418:3): [True: 15, False: 200k]
  ------------------
 2419|       |    /*
 2420|       |     * Set the Stream URI for the RTSP request. Unless the request is
 2421|       |     * for generic server options, the application will need to set this.
 2422|       |     */
 2423|     15|    return Curl_setstropt(&s->str[STRING_RTSP_STREAM_URI], ptr);
 2424|      5|  case CURLOPT_RTSP_TRANSPORT:
  ------------------
  |  Branch (2424:3): [True: 5, False: 200k]
  ------------------
 2425|       |    /*
 2426|       |     * The content of the Transport: header for the RTSP request
 2427|       |     */
 2428|      5|    return Curl_setstropt(&s->str[STRING_RTSP_TRANSPORT], ptr);
 2429|      0|  case CURLOPT_INTERLEAVEDATA:
  ------------------
  |  Branch (2429:3): [True: 0, False: 200k]
  ------------------
 2430|      0|    s->rtp_out = ptr;
 2431|      0|    break;
 2432|      0|#endif /* !CURL_DISABLE_RTSP */
 2433|      0|#ifdef USE_TLS_SRP
 2434|     12|  case CURLOPT_TLSAUTH_USERNAME:
  ------------------
  |  Branch (2434:3): [True: 12, False: 200k]
  ------------------
 2435|     12|    return Curl_setstropt(&s->str[STRING_TLSAUTH_USERNAME], ptr);
 2436|     10|  case CURLOPT_TLSAUTH_PASSWORD:
  ------------------
  |  Branch (2436:3): [True: 10, False: 200k]
  ------------------
 2437|     10|    return Curl_setstropt(&s->str[STRING_TLSAUTH_PASSWORD], ptr);
 2438|      4|  case CURLOPT_TLSAUTH_TYPE:
  ------------------
  |  Branch (2438:3): [True: 4, False: 200k]
  ------------------
 2439|      4|    if(ptr && !curl_strequal(ptr, "SRP"))
  ------------------
  |  Branch (2439:8): [True: 4, False: 0]
  |  Branch (2439:15): [True: 2, False: 2]
  ------------------
 2440|      2|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 2441|      4|    break;
 2442|      0|#ifndef CURL_DISABLE_PROXY
 2443|     19|  case CURLOPT_PROXY_TLSAUTH_USERNAME:
  ------------------
  |  Branch (2443:3): [True: 19, False: 200k]
  ------------------
 2444|     19|    return Curl_setstropt(&s->str[STRING_TLSAUTH_USERNAME_PROXY], ptr);
 2445|      4|  case CURLOPT_PROXY_TLSAUTH_PASSWORD:
  ------------------
  |  Branch (2445:3): [True: 4, False: 200k]
  ------------------
 2446|      4|    return Curl_setstropt(&s->str[STRING_TLSAUTH_PASSWORD_PROXY], ptr);
 2447|      3|  case CURLOPT_PROXY_TLSAUTH_TYPE:
  ------------------
  |  Branch (2447:3): [True: 3, False: 200k]
  ------------------
 2448|      3|    if(ptr && !curl_strequal(ptr, "SRP"))
  ------------------
  |  Branch (2448:8): [True: 3, False: 0]
  |  Branch (2448:15): [True: 1, False: 2]
  ------------------
 2449|      1|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 2450|      3|    break;
 2451|      0|#endif
 2452|      0|#endif
 2453|       |#ifdef USE_RESOLV_ARES
 2454|       |  case CURLOPT_DNS_SERVERS:
 2455|       |    return Curl_setstropt(&s->str[STRING_DNS_SERVERS], ptr);
 2456|       |
 2457|       |  case CURLOPT_DNS_INTERFACE:
 2458|       |    return Curl_setstropt(&s->str[STRING_DNS_INTERFACE], ptr);
 2459|       |
 2460|       |  case CURLOPT_DNS_LOCAL_IP4:
 2461|       |    return Curl_setstropt(&s->str[STRING_DNS_LOCAL_IP4], ptr);
 2462|       |
 2463|       |  case CURLOPT_DNS_LOCAL_IP6:
 2464|       |    return Curl_setstropt(&s->str[STRING_DNS_LOCAL_IP6], ptr);
 2465|       |
 2466|       |#endif
 2467|      0|#ifdef USE_UNIX_SOCKETS
 2468|     94|  case CURLOPT_UNIX_SOCKET_PATH:
  ------------------
  |  Branch (2468:3): [True: 94, False: 200k]
  ------------------
 2469|     94|    s->abstract_unix_socket = FALSE;
  ------------------
  |  | 1058|     94|#define FALSE false
  ------------------
 2470|     94|    return Curl_setstropt(&s->str[STRING_UNIX_SOCKET_PATH], ptr);
 2471|       |
 2472|     13|  case CURLOPT_ABSTRACT_UNIX_SOCKET:
  ------------------
  |  Branch (2472:3): [True: 13, False: 200k]
  ------------------
 2473|     13|    s->abstract_unix_socket = TRUE;
  ------------------
  |  | 1055|     13|#define TRUE true
  ------------------
 2474|     13|    return Curl_setstropt(&s->str[STRING_UNIX_SOCKET_PATH], ptr);
 2475|       |
 2476|      0|#endif
 2477|       |
 2478|      0|#ifndef CURL_DISABLE_DOH
 2479|    355|  case CURLOPT_DOH_URL:
  ------------------
  |  Branch (2479:3): [True: 355, False: 200k]
  ------------------
 2480|    355|    result = Curl_setstropt(&s->str[STRING_DOH], ptr);
 2481|    355|    s->doh = !!(s->str[STRING_DOH]);
 2482|    355|    break;
 2483|      0|#endif
 2484|      0|#ifndef CURL_DISABLE_HSTS
 2485|      0|  case CURLOPT_HSTSREADDATA:
  ------------------
  |  Branch (2485:3): [True: 0, False: 200k]
  ------------------
 2486|      0|    s->hsts_read_userp = ptr;
 2487|      0|    break;
 2488|      0|  case CURLOPT_HSTSWRITEDATA:
  ------------------
  |  Branch (2488:3): [True: 0, False: 200k]
  ------------------
 2489|      0|    s->hsts_write_userp = ptr;
 2490|      0|    break;
 2491|  17.2k|  case CURLOPT_HSTS: {
  ------------------
  |  Branch (2491:3): [True: 17.2k, False: 183k]
  ------------------
 2492|  17.2k|    struct curl_slist *h;
 2493|  17.2k|    if(!data->hsts) {
  ------------------
  |  Branch (2493:8): [True: 17.1k, False: 1]
  ------------------
 2494|  17.1k|      data->hsts = Curl_hsts_init();
 2495|  17.1k|      if(!data->hsts)
  ------------------
  |  Branch (2495:10): [True: 0, False: 17.1k]
  ------------------
 2496|      0|        return CURLE_OUT_OF_MEMORY;
 2497|  17.1k|    }
 2498|  17.2k|    if(ptr) {
  ------------------
  |  Branch (2498:8): [True: 17.2k, False: 0]
  ------------------
 2499|  17.2k|      result = Curl_setstropt(&s->str[STRING_HSTS], ptr);
 2500|  17.2k|      if(result)
  ------------------
  |  Branch (2500:10): [True: 0, False: 17.2k]
  ------------------
 2501|      0|        return result;
 2502|       |      /* this needs to build a list of filenames to read from, so that it can
 2503|       |         read them later, as we might get a shared HSTS handle to load them
 2504|       |         into */
 2505|  17.2k|      h = curl_slist_append(data->state.hstslist, ptr);
 2506|  17.2k|      if(!h) {
  ------------------
  |  Branch (2506:10): [True: 0, False: 17.2k]
  ------------------
 2507|      0|        curl_slist_free_all(data->state.hstslist);
 2508|      0|        data->state.hstslist = NULL;
 2509|      0|        return CURLE_OUT_OF_MEMORY;
 2510|      0|      }
 2511|  17.2k|      data->state.hstslist = h; /* store the list for later use */
 2512|  17.2k|    }
 2513|      0|    else {
 2514|       |      /* clear the list of HSTS files */
 2515|      0|      curl_slist_free_all(data->state.hstslist);
 2516|      0|      data->state.hstslist = NULL;
 2517|      0|      if(!data->share || !data->share->hsts)
  ------------------
  |  Branch (2517:10): [True: 0, False: 0]
  |  Branch (2517:26): [True: 0, False: 0]
  ------------------
 2518|       |        /* throw away the HSTS cache unless shared */
 2519|      0|        Curl_hsts_cleanup(&data->hsts);
 2520|      0|    }
 2521|  17.2k|    break;
 2522|  17.2k|  }
 2523|  17.2k|#endif /* !CURL_DISABLE_HSTS */
 2524|  17.2k|#ifndef CURL_DISABLE_ALTSVC
 2525|  17.2k|  case CURLOPT_ALTSVC:
  ------------------
  |  Branch (2525:3): [True: 17.2k, False: 183k]
  ------------------
 2526|  17.2k|    if(!data->asi) {
  ------------------
  |  Branch (2526:8): [True: 17.1k, False: 32]
  ------------------
 2527|  17.1k|      data->asi = Curl_altsvc_init();
 2528|  17.1k|      if(!data->asi)
  ------------------
  |  Branch (2528:10): [True: 0, False: 17.1k]
  ------------------
 2529|      0|        return CURLE_OUT_OF_MEMORY;
 2530|  17.1k|    }
 2531|  17.2k|    result = Curl_setstropt(&s->str[STRING_ALTSVC], ptr);
 2532|  17.2k|    if(result)
  ------------------
  |  Branch (2532:8): [True: 0, False: 17.2k]
  ------------------
 2533|      0|      break;
 2534|  17.2k|    if(ptr)
  ------------------
  |  Branch (2534:8): [True: 17.2k, False: 0]
  ------------------
 2535|  17.2k|      return Curl_altsvc_load(data->asi, ptr);
 2536|      0|    break;
 2537|      0|#endif /* !CURL_DISABLE_ALTSVC */
 2538|      1|  case CURLOPT_ECH:
  ------------------
  |  Branch (2538:3): [True: 1, False: 200k]
  ------------------
 2539|      1|    return setopt_ech(data, ptr);
  ------------------
  |  | 1898|      1|#define setopt_ech(x,y) CURLE_NOT_BUILT_IN
  ------------------
 2540|     12|  default:
  ------------------
  |  Branch (2540:3): [True: 12, False: 200k]
  ------------------
 2541|     12|    return CURLE_UNKNOWN_OPTION;
 2542|   200k|  }
 2543|   121k|  return result;
 2544|   200k|}
setopt.c:setopt_cptr_proxy:
 1652|   210k|{
 1653|   210k|  CURLcode result = CURLE_OK;
 1654|   210k|  struct UserDefined *s = &data->set;
 1655|   210k|  switch(option) {
 1656|    402|  case CURLOPT_PROXYUSERPWD: {
  ------------------
  |  Branch (1656:3): [True: 402, False: 209k]
  ------------------
 1657|       |    /*
 1658|       |     * user:password needed to use the proxy
 1659|       |     */
 1660|    402|    char *u = NULL;
 1661|    402|    char *p = NULL;
 1662|    402|    result = setstropt_userpwd(ptr, &u, &p);
 1663|       |
 1664|       |    /* URL decode the components */
 1665|    402|    if(!result) {
  ------------------
  |  Branch (1665:8): [True: 402, False: 0]
  ------------------
 1666|    402|      curlx_safefree(s->str[STRING_PROXYUSERNAME]);
  ------------------
  |  | 1327|    402|  do {                      \
  |  | 1328|    402|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|    402|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|    402|    (ptr) = NULL;           \
  |  | 1330|    402|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 402]
  |  |  ------------------
  ------------------
 1667|    402|      curlx_safefree(s->str[STRING_PROXYPASSWORD]);
  ------------------
  |  | 1327|    402|  do {                      \
  |  | 1328|    402|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|    402|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|    402|    (ptr) = NULL;           \
  |  | 1330|    402|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 402]
  |  |  ------------------
  ------------------
 1668|    402|      if(u)
  ------------------
  |  Branch (1668:10): [True: 402, False: 0]
  ------------------
 1669|    402|        result = Curl_urldecode(u, 0, &s->str[STRING_PROXYUSERNAME], NULL,
 1670|    402|                                REJECT_ZERO);
 1671|    402|    }
 1672|    402|    if(!result && p)
  ------------------
  |  Branch (1672:8): [True: 400, False: 2]
  |  Branch (1672:19): [True: 33, False: 367]
  ------------------
 1673|     33|      result = Curl_urldecode(p, 0, &s->str[STRING_PROXYPASSWORD], NULL,
 1674|     33|                              REJECT_ZERO);
 1675|    402|    curlx_free(u);
  ------------------
  |  | 1483|    402|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1676|    402|    curlx_free(p);
  ------------------
  |  | 1483|    402|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1677|    402|    break;
 1678|      0|  }
 1679|     21|  case CURLOPT_PROXYUSERNAME:
  ------------------
  |  Branch (1679:3): [True: 21, False: 210k]
  ------------------
 1680|       |    /*
 1681|       |     * authentication username to use in the operation
 1682|       |     */
 1683|     21|    return Curl_setstropt(&s->str[STRING_PROXYUSERNAME], ptr);
 1684|       |
 1685|     28|  case CURLOPT_PROXYPASSWORD:
  ------------------
  |  Branch (1685:3): [True: 28, False: 210k]
  ------------------
 1686|       |    /*
 1687|       |     * authentication password to use in the operation
 1688|       |     */
 1689|     28|    return Curl_setstropt(&s->str[STRING_PROXYPASSWORD], ptr);
 1690|       |
 1691|    294|  case CURLOPT_NOPROXY:
  ------------------
  |  Branch (1691:3): [True: 294, False: 209k]
  ------------------
 1692|       |    /*
 1693|       |     * proxy exception list
 1694|       |     */
 1695|    294|    return Curl_setstropt(&s->str[STRING_NOPROXY], ptr);
 1696|     21|  case CURLOPT_PROXY_SSLCERT:
  ------------------
  |  Branch (1696:3): [True: 21, False: 210k]
  ------------------
 1697|       |    /*
 1698|       |     * String that holds filename of the SSL certificate to use for proxy
 1699|       |     */
 1700|     21|    return Curl_setstropt(&s->str[STRING_CERT_PROXY], ptr);
 1701|     12|  case CURLOPT_PROXY_SSLCERTTYPE:
  ------------------
  |  Branch (1701:3): [True: 12, False: 210k]
  ------------------
 1702|       |    /*
 1703|       |     * String that holds file type of the SSL certificate to use for proxy
 1704|       |     */
 1705|     12|    return Curl_setstropt(&s->str[STRING_CERT_TYPE_PROXY], ptr);
 1706|      9|  case CURLOPT_PROXY_SSLKEY:
  ------------------
  |  Branch (1706:3): [True: 9, False: 210k]
  ------------------
 1707|       |    /*
 1708|       |     * String that holds filename of the SSL key to use for proxy
 1709|       |     */
 1710|      9|    return Curl_setstropt(&s->str[STRING_KEY_PROXY], ptr);
 1711|     18|  case CURLOPT_PROXY_KEYPASSWD:
  ------------------
  |  Branch (1711:3): [True: 18, False: 210k]
  ------------------
 1712|       |    /*
 1713|       |     * String that holds the SSL private key password for proxy.
 1714|       |     */
 1715|     18|    return Curl_setstropt(&s->str[STRING_KEY_PASSWD_PROXY], ptr);
 1716|     20|  case CURLOPT_PROXY_SSLKEYTYPE:
  ------------------
  |  Branch (1716:3): [True: 20, False: 210k]
  ------------------
 1717|       |    /*
 1718|       |     * String that holds file type of the SSL key to use for proxy
 1719|       |     */
 1720|     20|    return Curl_setstropt(&s->str[STRING_KEY_TYPE_PROXY], ptr);
 1721|     92|  case CURLOPT_PROXY_SSL_CIPHER_LIST:
  ------------------
  |  Branch (1721:3): [True: 92, False: 210k]
  ------------------
 1722|     92|    if(Curl_ssl_supports(data, SSLSUPP_CIPHER_LIST)) {
  ------------------
  |  |   44|     92|#define SSLSUPP_CIPHER_LIST  (1 << 9) /* supports TLS 1.0-1.2 ciphersuites */
  ------------------
  |  Branch (1722:8): [True: 92, False: 0]
  ------------------
 1723|       |      /* set a list of cipher we want to use in the SSL connection for proxy */
 1724|     92|      return Curl_setstropt(&s->str[STRING_SSL_CIPHER_LIST_PROXY], ptr);
 1725|     92|    }
 1726|      0|    else
 1727|      0|      return CURLE_NOT_BUILT_IN;
 1728|     20|  case CURLOPT_PROXY_TLS13_CIPHERS:
  ------------------
  |  Branch (1728:3): [True: 20, False: 210k]
  ------------------
 1729|     20|    if(Curl_ssl_supports(data, SSLSUPP_TLS13_CIPHERSUITES))
  ------------------
  |  |   40|     20|#define SSLSUPP_TLS13_CIPHERSUITES (1 << 5) /* supports TLS 1.3 ciphersuites */
  ------------------
  |  Branch (1729:8): [True: 20, False: 0]
  ------------------
 1730|       |      /* set preferred list of TLS 1.3 cipher suites for proxy */
 1731|     20|      return Curl_setstropt(&s->str[STRING_SSL_CIPHER13_LIST_PROXY], ptr);
 1732|      0|    else
 1733|      0|      return CURLE_NOT_BUILT_IN;
 1734|  8.11k|  case CURLOPT_PROXY:
  ------------------
  |  Branch (1734:3): [True: 8.11k, False: 202k]
  ------------------
 1735|       |    /*
 1736|       |     * Set proxy server:port to use as proxy.
 1737|       |     *
 1738|       |     * If the proxy is set to "" (and CURLOPT_PRE_PROXY is set to "" or NULL)
 1739|       |     * we explicitly say that we do not want to use a proxy (even though there
 1740|       |     * might be environment variables saying so).
 1741|       |     *
 1742|       |     * Setting it to NULL, means no proxy but allows the environment variables
 1743|       |     * to decide for us (if CURLOPT_PRE_PROXY setting it to NULL).
 1744|       |     */
 1745|  8.11k|    return setproxy(data, ptr);
 1746|    441|  case CURLOPT_PRE_PROXY:
  ------------------
  |  Branch (1746:3): [True: 441, False: 209k]
  ------------------
 1747|       |    /*
 1748|       |     * Set proxy server:port to use as SOCKS proxy.
 1749|       |     *
 1750|       |     * If the proxy is set to "" or NULL we explicitly say that we do not want
 1751|       |     * to use the socks proxy.
 1752|       |     */
 1753|    441|    return Curl_setstropt(&s->str[STRING_PRE_PROXY], ptr);
 1754|      0|  case CURLOPT_SOCKS5_GSSAPI_SERVICE:
  ------------------
  |  Branch (1754:3): [True: 0, False: 210k]
  ------------------
 1755|     22|  case CURLOPT_PROXY_SERVICE_NAME:
  ------------------
  |  Branch (1755:3): [True: 22, False: 210k]
  ------------------
 1756|       |    /*
 1757|       |     * Set proxy authentication service name for Kerberos 5 and SPNEGO
 1758|       |     */
 1759|     22|    return Curl_setstropt(&s->str[STRING_PROXY_SERVICE_NAME], ptr);
 1760|     32|  case CURLOPT_PROXY_PINNEDPUBLICKEY:
  ------------------
  |  Branch (1760:3): [True: 32, False: 210k]
  ------------------
 1761|       |    /*
 1762|       |     * Set pinned public key for SSL connection.
 1763|       |     * Specify filename of the public key in DER format.
 1764|       |     */
 1765|     32|#ifdef USE_SSL
 1766|     32|    if(Curl_ssl_supports(data, SSLSUPP_PINNEDPUBKEY))
  ------------------
  |  |   37|     32|#define SSLSUPP_PINNEDPUBKEY (1 << 2) /* supports CURLOPT_PINNEDPUBLICKEY */
  ------------------
  |  Branch (1766:8): [True: 32, False: 0]
  ------------------
 1767|     32|      return Curl_setstropt(&s->str[STRING_SSL_PINNEDPUBLICKEY_PROXY], ptr);
 1768|      0|#endif
 1769|      0|    return CURLE_NOT_BUILT_IN;
 1770|       |
 1771|     89|  case CURLOPT_HAPROXY_CLIENT_IP:
  ------------------
  |  Branch (1771:3): [True: 89, False: 210k]
  ------------------
 1772|       |    /*
 1773|       |     * Set the client IP to send through HAProxy PROXY protocol
 1774|       |     */
 1775|     89|    result = Curl_setstropt(&s->str[STRING_HAPROXY_CLIENT_IP], ptr);
 1776|       |
 1777|       |    /* enable the HAProxy protocol if an IP is provided */
 1778|     89|    s->haproxyprotocol = !!s->str[STRING_HAPROXY_CLIENT_IP];
 1779|     89|    break;
 1780|     21|  case CURLOPT_PROXY_CAINFO:
  ------------------
  |  Branch (1780:3): [True: 21, False: 210k]
  ------------------
 1781|       |    /*
 1782|       |     * Set CA info SSL connection for proxy. Specify filename of the
 1783|       |     * CA certificate
 1784|       |     */
 1785|     21|    s->proxy_ssl.custom_cafile = TRUE;
  ------------------
  |  | 1055|     21|#define TRUE true
  ------------------
 1786|     21|    return Curl_setstropt(&s->str[STRING_SSL_CAFILE_PROXY], ptr);
 1787|     32|  case CURLOPT_PROXY_CRLFILE:
  ------------------
  |  Branch (1787:3): [True: 32, False: 210k]
  ------------------
 1788|       |    /*
 1789|       |     * Set CRL file info for SSL connection for proxy. Specify filename of the
 1790|       |     * CRL to check certificates revocation
 1791|       |     */
 1792|     32|    if(Curl_ssl_supports(data, SSLSUPP_CRLFILE))
  ------------------
  |  |   48|     32|#define SSLSUPP_CRLFILE      (1 << 13) /* supports CURLOPT_CRLFILE */
  ------------------
  |  Branch (1792:8): [True: 32, False: 0]
  ------------------
 1793|     32|      return Curl_setstropt(&s->str[STRING_SSL_CRLFILE_PROXY], ptr);
 1794|      0|    return CURLE_NOT_BUILT_IN;
 1795|     12|  case CURLOPT_PROXY_ISSUERCERT:
  ------------------
  |  Branch (1795:3): [True: 12, False: 210k]
  ------------------
 1796|       |    /*
 1797|       |     * Set Issuer certificate file to check certificates issuer
 1798|       |     */
 1799|     12|    if(Curl_ssl_supports(data, SSLSUPP_ISSUERCERT))
  ------------------
  |  |   46|     12|#define SSLSUPP_ISSUERCERT   (1 << 11) /* supports CURLOPT_ISSUERCERT */
  ------------------
  |  Branch (1799:8): [True: 12, False: 0]
  ------------------
 1800|     12|      return Curl_setstropt(&s->str[STRING_SSL_ISSUERCERT_PROXY], ptr);
 1801|      0|    return CURLE_NOT_BUILT_IN;
 1802|     24|  case CURLOPT_PROXY_CAPATH:
  ------------------
  |  Branch (1802:3): [True: 24, False: 210k]
  ------------------
 1803|       |    /*
 1804|       |     * Set CA path info for SSL connection proxy. Specify directory name of the
 1805|       |     * CA certificates which have been prepared using openssl c_rehash utility.
 1806|       |     */
 1807|     24|#ifdef USE_SSL
 1808|     24|    if(Curl_ssl_supports(data, SSLSUPP_CA_PATH)) {
  ------------------
  |  |   35|     24|#define SSLSUPP_CA_PATH      (1 << 0) /* supports CAPATH */
  ------------------
  |  Branch (1808:8): [True: 24, False: 0]
  ------------------
 1809|       |      /* This does not work on Windows. */
 1810|     24|      s->proxy_ssl.custom_capath = TRUE;
  ------------------
  |  | 1055|     24|#define TRUE true
  ------------------
 1811|     24|      return Curl_setstropt(&s->str[STRING_SSL_CAPATH_PROXY], ptr);
 1812|     24|    }
 1813|      0|#endif
 1814|      0|    return CURLE_NOT_BUILT_IN;
 1815|   200k|  default:
  ------------------
  |  Branch (1815:3): [True: 200k, False: 9.72k]
  ------------------
 1816|   200k|    return CURLE_UNKNOWN_OPTION;
 1817|   210k|  }
 1818|    491|  return result;
 1819|   210k|}
setopt.c:setproxy:
 1640|  8.11k|{
 1641|  8.11k|  if((data->set.str[STRING_PROXY] && proxy) &&
  ------------------
  |  Branch (1641:7): [True: 0, False: 8.11k]
  |  Branch (1641:38): [True: 0, False: 0]
  ------------------
 1642|       |     /* there was one set, is this a new one? */
 1643|      0|     !strcmp(data->set.str[STRING_PROXY], proxy))
  ------------------
  |  Branch (1643:6): [True: 0, False: 0]
  ------------------
 1644|      0|    return CURLE_OK; /* same one as before */
 1645|       |
 1646|  8.11k|  changeproxy(data);
 1647|  8.11k|  return Curl_setstropt(&data->set.str[STRING_PROXY], proxy);
 1648|  8.11k|}
setopt.c:cookiefile:
 1601|  17.2k|{
 1602|       |  /*
 1603|       |   * Set cookie file to read and parse. Can be used multiple times.
 1604|       |   */
 1605|  17.2k|  if(ptr) {
  ------------------
  |  Branch (1605:6): [True: 17.2k, False: 0]
  ------------------
 1606|  17.2k|    struct curl_slist *cl;
 1607|       |    /* general protection against mistakes and abuse */
 1608|  17.2k|    if(strlen(ptr) > CURL_MAX_INPUT_LENGTH)
  ------------------
  |  |   45|  17.2k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (1608:8): [True: 0, False: 17.2k]
  ------------------
 1609|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1610|       |    /* append the cookie filename to the list of filenames, and deal with
 1611|       |       them later */
 1612|  17.2k|    cl = curl_slist_append(data->state.cookielist, ptr);
 1613|  17.2k|    if(!cl) {
  ------------------
  |  Branch (1613:8): [True: 0, False: 17.2k]
  ------------------
 1614|      0|      curl_slist_free_all(data->state.cookielist);
 1615|      0|      data->state.cookielist = NULL;
 1616|      0|      return CURLE_OUT_OF_MEMORY;
 1617|      0|    }
 1618|  17.2k|    data->state.cookielist = cl; /* store the list for later use */
 1619|  17.2k|  }
 1620|      0|  else {
 1621|       |    /* clear the list of cookie files */
 1622|      0|    curl_slist_free_all(data->state.cookielist);
 1623|      0|    data->state.cookielist = NULL;
 1624|       |
 1625|      0|    if(!data->share || !data->share->cookies) {
  ------------------
  |  Branch (1625:8): [True: 0, False: 0]
  |  Branch (1625:24): [True: 0, False: 0]
  ------------------
 1626|       |      /* throw away all existing cookies if this is not a shared cookie
 1627|       |         container */
 1628|      0|      Curl_cookie_clearall(data->cookies);
 1629|      0|      Curl_cookie_cleanup(data->cookies);
 1630|      0|    }
 1631|       |    /* disable the cookie engine */
 1632|      0|    data->cookies = NULL;
 1633|      0|  }
 1634|  17.2k|  return CURLE_OK;
 1635|  17.2k|}
setopt.c:cookielist:
 1548|  1.49k|{
 1549|  1.49k|  CURLcode result = CURLE_OK;
 1550|  1.49k|  if(!ptr)
  ------------------
  |  Branch (1550:6): [True: 0, False: 1.49k]
  ------------------
 1551|      0|    return CURLE_OK;
 1552|       |
 1553|  1.49k|  if(curl_strequal(ptr, "ALL")) {
  ------------------
  |  Branch (1553:6): [True: 1, False: 1.49k]
  ------------------
 1554|       |    /* clear all cookies */
 1555|      1|    Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 1556|      1|    Curl_cookie_clearall(data->cookies);
 1557|      1|    Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 1558|      1|  }
 1559|  1.49k|  else if(curl_strequal(ptr, "SESS")) {
  ------------------
  |  Branch (1559:11): [True: 1, False: 1.49k]
  ------------------
 1560|       |    /* clear session cookies */
 1561|      1|    Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 1562|      1|    Curl_cookie_clearsess(data->cookies);
 1563|      1|    Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 1564|      1|  }
 1565|  1.49k|  else if(curl_strequal(ptr, "FLUSH")) {
  ------------------
  |  Branch (1565:11): [True: 1, False: 1.48k]
  ------------------
 1566|       |    /* flush cookies to file, takes care of the locking */
 1567|      1|    Curl_flush_cookies(data, FALSE);
  ------------------
  |  | 1058|      1|#define FALSE false
  ------------------
 1568|      1|  }
 1569|  1.48k|  else if(curl_strequal(ptr, "RELOAD")) {
  ------------------
  |  Branch (1569:11): [True: 2, False: 1.48k]
  ------------------
 1570|       |    /* reload cookies from file */
 1571|      2|    return Curl_cookie_loadfiles(data);
 1572|      2|  }
 1573|  1.48k|  else {
 1574|  1.48k|    if(!data->cookies) {
  ------------------
  |  Branch (1574:8): [True: 1.48k, False: 0]
  ------------------
 1575|       |      /* if cookie engine was not running, activate it */
 1576|  1.48k|      data->cookies = Curl_cookie_init();
 1577|  1.48k|      if(!data->cookies)
  ------------------
  |  Branch (1577:10): [True: 0, False: 1.48k]
  ------------------
 1578|      0|        return CURLE_OUT_OF_MEMORY;
 1579|  1.48k|      data->state.cookie_engine = TRUE;
  ------------------
  |  | 1055|  1.48k|#define TRUE true
  ------------------
 1580|  1.48k|    }
 1581|       |
 1582|       |    /* general protection against mistakes and abuse */
 1583|  1.48k|    if(strlen(ptr) > CURL_MAX_INPUT_LENGTH)
  ------------------
  |  |   45|  1.48k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (1583:8): [True: 0, False: 1.48k]
  ------------------
 1584|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1585|       |
 1586|  1.48k|    Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 1587|  1.48k|    if(checkprefix("Set-Cookie:", ptr))
  ------------------
  |  |   33|  1.48k|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1292|  1.48k|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |  |  Branch (33:27): [True: 963, False: 524]
  |  |  ------------------
  ------------------
 1588|       |      /* HTTP Header format line */
 1589|    963|      result = Curl_cookie_add(data, data->cookies, TRUE, FALSE, ptr + 11,
  ------------------
  |  | 1055|    963|#define TRUE true
  ------------------
                    result = Curl_cookie_add(data, data->cookies, TRUE, FALSE, ptr + 11,
  ------------------
  |  | 1058|    963|#define FALSE false
  ------------------
 1590|    963|                               NULL, NULL, TRUE);
  ------------------
  |  | 1055|    963|#define TRUE true
  ------------------
 1591|    524|    else
 1592|       |      /* Netscape format line */
 1593|    524|      result = Curl_cookie_add(data, data->cookies, FALSE, FALSE, ptr, NULL,
  ------------------
  |  | 1058|    524|#define FALSE false
  ------------------
                    result = Curl_cookie_add(data, data->cookies, FALSE, FALSE, ptr, NULL,
  ------------------
  |  | 1058|    524|#define FALSE false
  ------------------
 1594|    524|                               NULL, TRUE);
  ------------------
  |  | 1055|    524|#define TRUE true
  ------------------
 1595|  1.48k|    Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 1596|  1.48k|  }
 1597|  1.49k|  return result;
 1598|  1.49k|}
setopt.c:setstropt_userpwd:
  134|    519|{
  135|    519|  char *user = NULL;
  136|    519|  char *passwd = NULL;
  137|       |
  138|    519|  DEBUGASSERT(userp);
  ------------------
  |  | 1081|    519|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (138:3): [True: 0, False: 519]
  |  Branch (138:3): [True: 519, False: 0]
  ------------------
  139|    519|  DEBUGASSERT(passwdp);
  ------------------
  |  | 1081|    519|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (139:3): [True: 0, False: 519]
  |  Branch (139:3): [True: 519, False: 0]
  ------------------
  140|       |
  141|       |  /* Parse the login details if specified. If not, then we treat NULL as a
  142|       |     hint to clear the existing data */
  143|    519|  if(option) {
  ------------------
  |  Branch (143:6): [True: 519, False: 0]
  ------------------
  144|    519|    size_t len = strlen(option);
  145|    519|    CURLcode result;
  146|    519|    if(len > CURL_MAX_INPUT_LENGTH)
  ------------------
  |  |   45|    519|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (146:8): [True: 0, False: 519]
  ------------------
  147|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  148|       |
  149|    519|    result = Curl_parse_login_details(option, len, &user, &passwd, NULL);
  150|    519|    if(result)
  ------------------
  |  Branch (150:8): [True: 0, False: 519]
  ------------------
  151|      0|      return result;
  152|    519|  }
  153|       |
  154|    519|  curlx_free(*userp);
  ------------------
  |  | 1483|    519|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  155|    519|  *userp = user;
  156|       |
  157|    519|  curlx_free(*passwdp);
  ------------------
  |  | 1483|    519|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  158|    519|  *passwdp = passwd;
  159|       |
  160|    519|  return CURLE_OK;
  161|    519|}
setopt.c:setstropt_interface:
  165|    191|{
  166|    191|  char *dev = NULL;
  167|    191|  char *iface = NULL;
  168|    191|  char *host = NULL;
  169|    191|  CURLcode result;
  170|       |
  171|    191|  DEBUGASSERT(devp);
  ------------------
  |  | 1081|    191|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (171:3): [True: 0, False: 191]
  |  Branch (171:3): [True: 191, False: 0]
  ------------------
  172|    191|  DEBUGASSERT(ifacep);
  ------------------
  |  | 1081|    191|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (172:3): [True: 0, False: 191]
  |  Branch (172:3): [True: 191, False: 0]
  ------------------
  173|    191|  DEBUGASSERT(hostp);
  ------------------
  |  | 1081|    191|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (173:3): [True: 0, False: 191]
  |  Branch (173:3): [True: 191, False: 0]
  ------------------
  174|       |
  175|    191|  if(option) {
  ------------------
  |  Branch (175:6): [True: 191, False: 0]
  ------------------
  176|       |    /* Parse the interface details if set, otherwise clear them all */
  177|    191|    result = Curl_parse_interface(option, &dev, &iface, &host);
  178|    191|    if(result)
  ------------------
  |  Branch (178:8): [True: 7, False: 184]
  ------------------
  179|      7|      return result;
  180|    191|  }
  181|    184|  curlx_free(*devp);
  ------------------
  |  | 1483|    184|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  182|    184|  *devp = dev;
  183|       |
  184|    184|  curlx_free(*ifacep);
  ------------------
  |  | 1483|    184|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  185|    184|  *ifacep = iface;
  186|       |
  187|    184|  curlx_free(*hostp);
  ------------------
  |  | 1483|    184|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  188|    184|  *hostp = host;
  189|       |
  190|    184|  return CURLE_OK;
  191|    191|}
setopt.c:protocol2num:
  199|  17.2k|{
  200|       |  /*
  201|       |   * We are asked to cherry-pick protocols, so play it safe and disallow all
  202|       |   * protocols to start with, and re-add the wanted ones back in.
  203|       |   */
  204|  17.2k|  *val = 0;
  205|       |
  206|  17.2k|  if(!str)
  ------------------
  |  Branch (206:6): [True: 0, False: 17.2k]
  ------------------
  207|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  208|       |
  209|  17.2k|  if(curl_strequal(str, "all")) {
  ------------------
  |  Branch (209:6): [True: 1, False: 17.2k]
  ------------------
  210|      1|    *val = ~(curl_prot_t)0;
  211|      1|    return CURLE_OK;
  212|      1|  }
  213|       |
  214|  34.8k|  do {
  215|  34.8k|    const char *token = str;
  216|  34.8k|    size_t tlen;
  217|       |
  218|  34.8k|    str = strchr(str, ',');
  219|  34.8k|    tlen = str ? (size_t)(str - token) : strlen(token);
  ------------------
  |  Branch (219:12): [True: 17.6k, False: 17.2k]
  ------------------
  220|  34.8k|    if(tlen) {
  ------------------
  |  Branch (220:8): [True: 34.5k, False: 309]
  ------------------
  221|  34.5k|      const struct Curl_scheme *h = Curl_getn_scheme(token, tlen);
  222|       |
  223|  34.5k|      if(!h || !h->run)
  ------------------
  |  Branch (223:10): [True: 17, False: 34.5k]
  |  Branch (223:16): [True: 1, False: 34.5k]
  ------------------
  224|     18|        return CURLE_UNSUPPORTED_PROTOCOL;
  225|       |
  226|  34.5k|      *val |= h->protocol;
  227|  34.5k|    }
  228|  34.8k|  } while(str && str++);
  ------------------
  |  Branch (228:11): [True: 17.6k, False: 17.2k]
  |  Branch (228:18): [True: 17.6k, False: 0]
  ------------------
  229|       |
  230|  17.2k|  if(!*val)
  ------------------
  |  Branch (230:6): [True: 11, False: 17.2k]
  ------------------
  231|       |    /* no protocol listed */
  232|     11|    return CURLE_BAD_FUNCTION_ARGUMENT;
  233|  17.2k|  return CURLE_OK;
  234|  17.2k|}
setopt.c:setopt_func:
 2548|  69.4k|{
 2549|  69.4k|  struct UserDefined *s = &data->set;
 2550|  69.4k|  switch(option) {
 2551|      0|  case CURLOPT_PROGRESSFUNCTION:
  ------------------
  |  Branch (2551:3): [True: 0, False: 69.4k]
  ------------------
 2552|       |    /*
 2553|       |     * Progress callback function
 2554|       |     */
 2555|      0|    s->fprogress = va_arg(param, curl_progress_callback);
 2556|      0|    if(s->fprogress)
  ------------------
  |  Branch (2556:8): [True: 0, False: 0]
  ------------------
 2557|      0|      data->progress.callback = TRUE; /* no longer internal */
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2558|      0|    else
 2559|      0|      data->progress.callback = FALSE; /* NULL enforces internal */
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2560|      0|    break;
 2561|       |
 2562|      0|  case CURLOPT_XFERINFOFUNCTION:
  ------------------
  |  Branch (2562:3): [True: 0, False: 69.4k]
  ------------------
 2563|       |    /*
 2564|       |     * Transfer info callback function
 2565|       |     */
 2566|      0|    s->fxferinfo = va_arg(param, curl_xferinfo_callback);
 2567|      0|    if(s->fxferinfo)
  ------------------
  |  Branch (2567:8): [True: 0, False: 0]
  ------------------
 2568|      0|      data->progress.callback = TRUE; /* no longer internal */
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2569|      0|    else
 2570|      0|      data->progress.callback = FALSE; /* NULL enforces internal */
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2571|       |
 2572|      0|    break;
 2573|      0|  case CURLOPT_DEBUGFUNCTION:
  ------------------
  |  Branch (2573:3): [True: 0, False: 69.4k]
  ------------------
 2574|       |    /*
 2575|       |     * stderr write callback.
 2576|       |     */
 2577|      0|    s->fdebug = va_arg(param, curl_debug_callback);
 2578|       |    /*
 2579|       |     * if the callback provided is NULL, it will use the default callback
 2580|       |     */
 2581|      0|    break;
 2582|      0|  case CURLOPT_HEADERFUNCTION:
  ------------------
  |  Branch (2582:3): [True: 0, False: 69.4k]
  ------------------
 2583|       |    /*
 2584|       |     * Set header write callback
 2585|       |     */
 2586|      0|    s->fwrite_header = va_arg(param, curl_write_callback);
 2587|      0|    break;
 2588|  17.8k|  case CURLOPT_WRITEFUNCTION:
  ------------------
  |  Branch (2588:3): [True: 17.8k, False: 51.6k]
  ------------------
 2589|       |    /*
 2590|       |     * Set data write callback
 2591|       |     */
 2592|  17.8k|    s->fwrite_func = va_arg(param, curl_write_callback);
 2593|  17.8k|    if(!s->fwrite_func)
  ------------------
  |  Branch (2593:8): [True: 0, False: 17.8k]
  ------------------
 2594|      0|#if defined(__clang__) && __clang_major__ >= 16
 2595|      0|#pragma clang diagnostic push
 2596|      0|#pragma clang diagnostic ignored "-Wcast-function-type-strict"
 2597|      0|#endif
 2598|       |      /* When set to NULL, reset to our internal default function */
 2599|      0|      s->fwrite_func = (curl_write_callback)fwrite;
 2600|  17.8k|#if defined(__clang__) && __clang_major__ >= 16
 2601|  17.8k|#pragma clang diagnostic pop
 2602|  17.8k|#endif
 2603|  17.8k|    break;
 2604|  17.2k|  case CURLOPT_READFUNCTION:
  ------------------
  |  Branch (2604:3): [True: 17.2k, False: 52.2k]
  ------------------
 2605|       |    /*
 2606|       |     * Read data callback
 2607|       |     */
 2608|  17.2k|    s->fread_func_set = va_arg(param, curl_read_callback);
 2609|  17.2k|    if(!s->fread_func_set) {
  ------------------
  |  Branch (2609:8): [True: 0, False: 17.2k]
  ------------------
 2610|      0|      s->is_fread_set = 0;
 2611|      0|#if defined(__clang__) && __clang_major__ >= 16
 2612|      0|#pragma clang diagnostic push
 2613|      0|#pragma clang diagnostic ignored "-Wcast-function-type-strict"
 2614|      0|#endif
 2615|       |      /* When set to NULL, reset to our internal default function */
 2616|      0|      s->fread_func_set = (curl_read_callback)fread;
 2617|      0|#if defined(__clang__) && __clang_major__ >= 16
 2618|      0|#pragma clang diagnostic pop
 2619|      0|#endif
 2620|      0|    }
 2621|  17.2k|    else
 2622|  17.2k|      s->is_fread_set = 1;
 2623|  17.2k|    break;
 2624|      0|  case CURLOPT_SEEKFUNCTION:
  ------------------
  |  Branch (2624:3): [True: 0, False: 69.4k]
  ------------------
 2625|       |    /*
 2626|       |     * Seek callback. Might be NULL.
 2627|       |     */
 2628|      0|    s->seek_func = va_arg(param, curl_seek_callback);
 2629|      0|    break;
 2630|      0|  case CURLOPT_IOCTLFUNCTION:
  ------------------
  |  Branch (2630:3): [True: 0, False: 69.4k]
  ------------------
 2631|       |    /*
 2632|       |     * I/O control callback. Might be NULL.
 2633|       |     */
 2634|      0|    s->ioctl_func = va_arg(param, curl_ioctl_callback);
 2635|      0|    break;
 2636|      0|  case CURLOPT_SSL_CTX_FUNCTION:
  ------------------
  |  Branch (2636:3): [True: 0, False: 69.4k]
  ------------------
 2637|       |    /*
 2638|       |     * Set an SSL_CTX callback
 2639|       |     */
 2640|      0|#ifdef USE_SSL
 2641|      0|    if(Curl_ssl_supports(data, SSLSUPP_SSL_CTX)) {
  ------------------
  |  |   38|      0|#define SSLSUPP_SSL_CTX      (1 << 3) /* supports CURLOPT_SSL_CTX */
  ------------------
  |  Branch (2641:8): [True: 0, False: 0]
  ------------------
 2642|      0|      s->ssl.fsslctx = va_arg(param, curl_ssl_ctx_callback);
 2643|      0|      break;
 2644|      0|    }
 2645|      0|    else
 2646|      0|#endif
 2647|      0|      return CURLE_NOT_BUILT_IN;
 2648|       |
 2649|  17.2k|  case CURLOPT_SOCKOPTFUNCTION:
  ------------------
  |  Branch (2649:3): [True: 17.2k, False: 52.2k]
  ------------------
 2650|       |    /*
 2651|       |     * socket callback function: called after socket() but before connect()
 2652|       |     */
 2653|  17.2k|    s->fsockopt = va_arg(param, curl_sockopt_callback);
 2654|  17.2k|    break;
 2655|       |
 2656|  17.2k|  case CURLOPT_OPENSOCKETFUNCTION:
  ------------------
  |  Branch (2656:3): [True: 17.2k, False: 52.2k]
  ------------------
 2657|       |    /*
 2658|       |     * open/create socket callback function: called instead of socket(),
 2659|       |     * before connect()
 2660|       |     */
 2661|  17.2k|    s->fopensocket = va_arg(param, curl_opensocket_callback);
 2662|  17.2k|    break;
 2663|       |
 2664|      0|  case CURLOPT_CLOSESOCKETFUNCTION:
  ------------------
  |  Branch (2664:3): [True: 0, False: 69.4k]
  ------------------
 2665|       |    /*
 2666|       |     * close socket callback function: called instead of close()
 2667|       |     * when shutting down a connection
 2668|       |     */
 2669|      0|    s->fclosesocket = va_arg(param, curl_closesocket_callback);
 2670|      0|    break;
 2671|       |
 2672|      0|  case CURLOPT_RESOLVER_START_FUNCTION:
  ------------------
  |  Branch (2672:3): [True: 0, False: 69.4k]
  ------------------
 2673|       |    /*
 2674|       |     * resolver start callback function: called before a new resolver request
 2675|       |     * is started
 2676|       |     */
 2677|      0|    s->resolver_start = va_arg(param, curl_resolver_start_callback);
 2678|      0|    break;
 2679|       |
 2680|       |#ifdef USE_SSH
 2681|       |#ifdef USE_LIBSSH2
 2682|       |  case CURLOPT_SSH_HOSTKEYFUNCTION:
 2683|       |    /* the callback to check the hostkey without the knownhost file */
 2684|       |    s->ssh_hostkeyfunc = va_arg(param, curl_sshhostkeycallback);
 2685|       |    break;
 2686|       |#endif
 2687|       |
 2688|       |  case CURLOPT_SSH_KEYFUNCTION:
 2689|       |    /* setting to NULL is fine since the ssh.c functions themselves will
 2690|       |       then revert to use the internal default */
 2691|       |    s->ssh_keyfunc = va_arg(param, curl_sshkeycallback);
 2692|       |    break;
 2693|       |
 2694|       |#endif /* USE_SSH */
 2695|       |
 2696|      0|#ifndef CURL_DISABLE_RTSP
 2697|      0|  case CURLOPT_INTERLEAVEFUNCTION:
  ------------------
  |  Branch (2697:3): [True: 0, False: 69.4k]
  ------------------
 2698|       |    /* Set the user defined RTP write function */
 2699|      0|    s->fwrite_rtp = va_arg(param, curl_write_callback);
 2700|      0|    break;
 2701|      0|#endif
 2702|      0|#ifndef CURL_DISABLE_FTP
 2703|      0|  case CURLOPT_CHUNK_BGN_FUNCTION:
  ------------------
  |  Branch (2703:3): [True: 0, False: 69.4k]
  ------------------
 2704|      0|    s->chunk_bgn = va_arg(param, curl_chunk_bgn_callback);
 2705|      0|    break;
 2706|      0|  case CURLOPT_CHUNK_END_FUNCTION:
  ------------------
  |  Branch (2706:3): [True: 0, False: 69.4k]
  ------------------
 2707|      0|    s->chunk_end = va_arg(param, curl_chunk_end_callback);
 2708|      0|    break;
 2709|      0|  case CURLOPT_FNMATCH_FUNCTION:
  ------------------
  |  Branch (2709:3): [True: 0, False: 69.4k]
  ------------------
 2710|      0|    s->fnmatch = va_arg(param, curl_fnmatch_callback);
 2711|      0|    break;
 2712|      0|#endif
 2713|      0|#ifndef CURL_DISABLE_HTTP
 2714|      0|  case CURLOPT_TRAILERFUNCTION:
  ------------------
  |  Branch (2714:3): [True: 0, False: 69.4k]
  ------------------
 2715|      0|    s->trailer_callback = va_arg(param, curl_trailer_callback);
 2716|      0|    break;
 2717|      0|#endif
 2718|      0|#ifndef CURL_DISABLE_HSTS
 2719|      0|  case CURLOPT_HSTSREADFUNCTION:
  ------------------
  |  Branch (2719:3): [True: 0, False: 69.4k]
  ------------------
 2720|      0|    s->hsts_read = va_arg(param, curl_hstsread_callback);
 2721|      0|    break;
 2722|      0|  case CURLOPT_HSTSWRITEFUNCTION:
  ------------------
  |  Branch (2722:3): [True: 0, False: 69.4k]
  ------------------
 2723|      0|    s->hsts_write = va_arg(param, curl_hstswrite_callback);
 2724|      0|    break;
 2725|      0|#endif
 2726|      0|  case CURLOPT_PREREQFUNCTION:
  ------------------
  |  Branch (2726:3): [True: 0, False: 69.4k]
  ------------------
 2727|      0|    s->fprereq = va_arg(param, curl_prereq_callback);
 2728|      0|    break;
 2729|      0|  default:
  ------------------
  |  Branch (2729:3): [True: 0, False: 69.4k]
  ------------------
 2730|      0|    return CURLE_UNKNOWN_OPTION;
 2731|  69.4k|  }
 2732|  69.4k|  return CURLE_OK;
 2733|  69.4k|}
setopt.c:setopt_offt:
 2737|  1.70k|{
 2738|  1.70k|  struct UserDefined *s = &data->set;
 2739|  1.70k|  switch(option) {
 2740|      4|  case CURLOPT_TIMEVALUE_LARGE:
  ------------------
  |  Branch (2740:3): [True: 4, False: 1.69k]
  ------------------
 2741|       |    /*
 2742|       |     * This is the value to compare with the remote document with the
 2743|       |     * method set with CURLOPT_TIMECONDITION
 2744|       |     */
 2745|      4|    s->timevalue = (time_t)offt;
 2746|      4|    break;
 2747|       |
 2748|       |    /* MQTT "borrows" some of the HTTP options */
 2749|      0|  case CURLOPT_POSTFIELDSIZE_LARGE:
  ------------------
  |  Branch (2749:3): [True: 0, False: 1.70k]
  ------------------
 2750|       |    /*
 2751|       |     * The size of the POSTFIELD data to prevent libcurl to do strlen() to
 2752|       |     * figure it out. Enables binary posts.
 2753|       |     */
 2754|      0|    if(offt < -1)
  ------------------
  |  Branch (2754:8): [True: 0, False: 0]
  ------------------
 2755|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 2756|       |
 2757|      0|    if(s->postfieldsize < offt &&
  ------------------
  |  Branch (2757:8): [True: 0, False: 0]
  ------------------
 2758|      0|       s->postfields == s->str[STRING_COPYPOSTFIELDS]) {
  ------------------
  |  Branch (2758:8): [True: 0, False: 0]
  ------------------
 2759|       |      /* Previous CURLOPT_COPYPOSTFIELDS is no longer valid. */
 2760|      0|      curlx_safefree(s->str[STRING_COPYPOSTFIELDS]);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2761|      0|      s->postfields = NULL;
 2762|      0|    }
 2763|      0|    s->postfieldsize = offt;
 2764|      0|    break;
 2765|    388|  case CURLOPT_INFILESIZE_LARGE:
  ------------------
  |  Branch (2765:3): [True: 388, False: 1.31k]
  ------------------
 2766|       |    /*
 2767|       |     * If known, this should inform curl about the file size of the
 2768|       |     * to-be-uploaded file.
 2769|       |     */
 2770|    388|    if(offt < -1)
  ------------------
  |  Branch (2770:8): [True: 0, False: 388]
  ------------------
 2771|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 2772|    388|    s->filesize = offt;
 2773|    388|    break;
 2774|    293|  case CURLOPT_MAX_SEND_SPEED_LARGE:
  ------------------
  |  Branch (2774:3): [True: 293, False: 1.40k]
  ------------------
 2775|       |    /*
 2776|       |     * When transfer uploads are faster then CURLOPT_MAX_SEND_SPEED_LARGE
 2777|       |     * bytes per second the transfer is throttled..
 2778|       |     */
 2779|    293|    if(offt < 0)
  ------------------
  |  Branch (2779:8): [True: 0, False: 293]
  ------------------
 2780|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 2781|    293|    s->max_send_speed = offt;
 2782|    293|    Curl_rlimit_init(&data->progress.ul.rlimit, offt, offt,
 2783|    293|                     Curl_pgrs_now(data));
 2784|    293|    break;
 2785|    732|  case CURLOPT_MAX_RECV_SPEED_LARGE:
  ------------------
  |  Branch (2785:3): [True: 732, False: 969]
  ------------------
 2786|       |    /*
 2787|       |     * When receiving data faster than CURLOPT_MAX_RECV_SPEED_LARGE bytes per
 2788|       |     * second the transfer is throttled..
 2789|       |     */
 2790|    732|    if(offt < 0)
  ------------------
  |  Branch (2790:8): [True: 0, False: 732]
  ------------------
 2791|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 2792|    732|    s->max_recv_speed = offt;
 2793|    732|    Curl_rlimit_init(&data->progress.dl.rlimit, offt, offt,
 2794|    732|                     Curl_pgrs_now(data));
 2795|    732|    break;
 2796|    210|  case CURLOPT_RESUME_FROM_LARGE:
  ------------------
  |  Branch (2796:3): [True: 210, False: 1.49k]
  ------------------
 2797|       |    /*
 2798|       |     * Resume transfer at the given file position
 2799|       |     */
 2800|    210|    if(offt < -1)
  ------------------
  |  Branch (2800:8): [True: 0, False: 210]
  ------------------
 2801|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 2802|    210|    s->set_resume_from = offt;
 2803|    210|    break;
 2804|     74|  case CURLOPT_MAXFILESIZE_LARGE:
  ------------------
  |  Branch (2804:3): [True: 74, False: 1.62k]
  ------------------
 2805|       |    /*
 2806|       |     * Set the maximum size of a file to download.
 2807|       |     */
 2808|     74|    if(offt < 0)
  ------------------
  |  Branch (2808:8): [True: 0, False: 74]
  ------------------
 2809|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 2810|     74|    s->max_filesize = offt;
 2811|     74|    break;
 2812|       |
 2813|      0|  default:
  ------------------
  |  Branch (2813:3): [True: 0, False: 1.70k]
  ------------------
 2814|      0|    return CURLE_UNKNOWN_OPTION;
 2815|  1.70k|  }
 2816|  1.70k|  return CURLE_OK;
 2817|  1.70k|}

Curl_sha256it:
  487|  4.03k|{
  488|  4.03k|  CURLcode result;
  489|  4.03k|  my_sha256_ctx ctx;
  490|       |
  491|  4.03k|  result = my_sha256_init(&ctx);
  492|  4.03k|  if(!result) {
  ------------------
  |  Branch (492:6): [True: 4.03k, False: 0]
  ------------------
  493|  4.03k|    do {
  494|  4.03k|      unsigned int ilen = (unsigned int)CURLMIN(len, UINT_MAX);
  ------------------
  |  | 1287|  4.03k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 4.03k, False: 0]
  |  |  ------------------
  ------------------
  495|  4.03k|      my_sha256_update(&ctx, input, ilen);
  496|  4.03k|      len -= ilen;
  497|  4.03k|      input += ilen;
  498|  4.03k|    } while(len);
  ------------------
  |  Branch (498:13): [True: 0, False: 4.03k]
  ------------------
  499|  4.03k|    my_sha256_final(output, &ctx);
  500|  4.03k|  }
  501|  4.03k|  return result;
  502|  4.03k|}
sha256.c:my_sha256_init:
   62|  24.2k|{
   63|  24.2k|  my_sha256_ctx *ctx = (my_sha256_ctx *)in;
   64|  24.2k|  ctx->openssl_ctx = EVP_MD_CTX_create();
   65|  24.2k|  if(!ctx->openssl_ctx)
  ------------------
  |  Branch (65:6): [True: 0, False: 24.2k]
  ------------------
   66|      0|    return CURLE_OUT_OF_MEMORY;
   67|       |
   68|  24.2k|  if(!EVP_DigestInit_ex(ctx->openssl_ctx, EVP_sha256(), NULL)) {
  ------------------
  |  Branch (68:6): [True: 0, False: 24.2k]
  ------------------
   69|      0|    EVP_MD_CTX_destroy(ctx->openssl_ctx);
   70|      0|    return CURLE_FAILED_INIT;
   71|      0|  }
   72|  24.2k|  return CURLE_OK;
   73|  24.2k|}
sha256.c:my_sha256_update:
   78|  1.31M|{
   79|  1.31M|  my_sha256_ctx *ctx = (my_sha256_ctx *)in;
   80|  1.31M|  EVP_DigestUpdate(ctx->openssl_ctx, data, length);
   81|  1.31M|}
sha256.c:my_sha256_final:
   84|  24.2k|{
   85|  24.2k|  my_sha256_ctx *ctx = (my_sha256_ctx *)in;
   86|  24.2k|  EVP_DigestFinal_ex(ctx->openssl_ctx, digest, NULL);
   87|       |  EVP_MD_CTX_destroy(ctx->openssl_ctx);
   88|  24.2k|}

easy.c:sigpipe_ignore:
   49|  18.7k|{
   50|       |  /* get a local copy of no_signal because the Curl_easy might not be
   51|       |     around when we restore */
   52|  18.7k|  ig->no_signal = data->set.no_signal;
   53|  18.7k|  if(!data->set.no_signal) {
  ------------------
  |  Branch (53:6): [True: 18.7k, False: 14]
  ------------------
   54|  18.7k|    struct sigaction action;
   55|       |    /* first, extract the existing situation */
   56|  18.7k|    sigaction(SIGPIPE, NULL, &ig->old_pipe_act);
   57|  18.7k|    action = ig->old_pipe_act;
   58|       |    /* ignore this signal */
   59|  18.7k|    action.sa_handler = SIG_IGN;
   60|  18.7k|#ifdef SA_SIGINFO
   61|       |    /* clear SA_SIGINFO flag since we are using sa_handler */
   62|  18.7k|    action.sa_flags &= ~SA_SIGINFO;
   63|  18.7k|#endif
   64|  18.7k|    sigaction(SIGPIPE, &action, NULL);
   65|  18.7k|  }
   66|  18.7k|}
easy.c:sigpipe_restore:
   74|  18.7k|{
   75|  18.7k|  if(!ig->no_signal)
  ------------------
  |  Branch (75:6): [True: 18.7k, False: 14]
  ------------------
   76|       |    /* restore the outside state */
   77|  18.7k|    sigaction(SIGPIPE, &ig->old_pipe_act, NULL);
   78|  18.7k|}
multi.c:sigpipe_init:
   37|  3.51M|{
   38|  3.51M|  memset(ig, 0, sizeof(*ig));
   39|       |  ig->no_signal = TRUE;
  ------------------
  |  | 1055|  3.51M|#define TRUE true
  ------------------
   40|  3.51M|}
multi.c:sigpipe_apply:
   82|  3.59M|{
   83|  3.59M|  if(data && (data->set.no_signal != ig->no_signal)) {
  ------------------
  |  Branch (83:6): [True: 3.59M, False: 0]
  |  Branch (83:14): [True: 3.37M, False: 225k]
  ------------------
   84|  3.37M|    sigpipe_restore(ig);
   85|  3.37M|    sigpipe_ignore(data, ig);
   86|  3.37M|  }
   87|  3.59M|}
multi.c:sigpipe_ignore:
   49|  3.37M|{
   50|       |  /* get a local copy of no_signal because the Curl_easy might not be
   51|       |     around when we restore */
   52|  3.37M|  ig->no_signal = data->set.no_signal;
   53|  3.37M|  if(!data->set.no_signal) {
  ------------------
  |  Branch (53:6): [True: 3.37M, False: 0]
  ------------------
   54|  3.37M|    struct sigaction action;
   55|       |    /* first, extract the existing situation */
   56|  3.37M|    sigaction(SIGPIPE, NULL, &ig->old_pipe_act);
   57|  3.37M|    action = ig->old_pipe_act;
   58|       |    /* ignore this signal */
   59|  3.37M|    action.sa_handler = SIG_IGN;
   60|  3.37M|#ifdef SA_SIGINFO
   61|       |    /* clear SA_SIGINFO flag since we are using sa_handler */
   62|  3.37M|    action.sa_flags &= ~SA_SIGINFO;
   63|  3.37M|#endif
   64|  3.37M|    sigaction(SIGPIPE, &action, NULL);
   65|  3.37M|  }
   66|  3.37M|}
multi.c:sigpipe_restore:
   74|  6.88M|{
   75|  6.88M|  if(!ig->no_signal)
  ------------------
  |  Branch (75:6): [True: 3.37M, False: 3.51M]
  ------------------
   76|       |    /* restore the outside state */
   77|  3.37M|    sigaction(SIGPIPE, &ig->old_pipe_act, NULL);
   78|  6.88M|}
conncache.c:sigpipe_init:
   37|  17.2k|{
   38|  17.2k|  memset(ig, 0, sizeof(*ig));
   39|       |  ig->no_signal = TRUE;
  ------------------
  |  | 1055|  17.2k|#define TRUE true
  ------------------
   40|  17.2k|}
conncache.c:sigpipe_apply:
   82|  1.93k|{
   83|  1.93k|  if(data && (data->set.no_signal != ig->no_signal)) {
  ------------------
  |  Branch (83:6): [True: 1.93k, False: 0]
  |  Branch (83:14): [True: 1.93k, False: 6]
  ------------------
   84|  1.93k|    sigpipe_restore(ig);
   85|  1.93k|    sigpipe_ignore(data, ig);
   86|  1.93k|  }
   87|  1.93k|}
conncache.c:sigpipe_ignore:
   49|  1.93k|{
   50|       |  /* get a local copy of no_signal because the Curl_easy might not be
   51|       |     around when we restore */
   52|  1.93k|  ig->no_signal = data->set.no_signal;
   53|  1.93k|  if(!data->set.no_signal) {
  ------------------
  |  Branch (53:6): [True: 1.93k, False: 0]
  ------------------
   54|  1.93k|    struct sigaction action;
   55|       |    /* first, extract the existing situation */
   56|  1.93k|    sigaction(SIGPIPE, NULL, &ig->old_pipe_act);
   57|  1.93k|    action = ig->old_pipe_act;
   58|       |    /* ignore this signal */
   59|  1.93k|    action.sa_handler = SIG_IGN;
   60|  1.93k|#ifdef SA_SIGINFO
   61|       |    /* clear SA_SIGINFO flag since we are using sa_handler */
   62|  1.93k|    action.sa_flags &= ~SA_SIGINFO;
   63|  1.93k|#endif
   64|  1.93k|    sigaction(SIGPIPE, &action, NULL);
   65|  1.93k|  }
   66|  1.93k|}
conncache.c:sigpipe_restore:
   74|  19.1k|{
   75|  19.1k|  if(!ig->no_signal)
  ------------------
  |  Branch (75:6): [True: 1.93k, False: 17.2k]
  ------------------
   76|       |    /* restore the outside state */
   77|  1.93k|    sigaction(SIGPIPE, &ig->old_pipe_act, NULL);
   78|  19.1k|}
cshutdn.c:sigpipe_init:
   37|  17.2k|{
   38|  17.2k|  memset(ig, 0, sizeof(*ig));
   39|       |  ig->no_signal = TRUE;
  ------------------
  |  | 1055|  17.2k|#define TRUE true
  ------------------
   40|  17.2k|}
cshutdn.c:sigpipe_restore:
   74|  17.2k|{
   75|  17.2k|  if(!ig->no_signal)
  ------------------
  |  Branch (75:6): [True: 0, False: 17.2k]
  ------------------
   76|       |    /* restore the outside state */
   77|      0|    sigaction(SIGPIPE, &ig->old_pipe_act, NULL);
   78|  17.2k|}

Curl_slist_append_nodup:
   56|   199k|{
   57|   199k|  struct curl_slist *last;
   58|   199k|  struct curl_slist *new_item;
   59|       |
   60|   199k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|   199k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (60:3): [True: 0, False: 199k]
  |  Branch (60:3): [True: 199k, False: 0]
  ------------------
   61|       |
   62|   199k|  new_item = curlx_malloc(sizeof(struct curl_slist));
  ------------------
  |  | 1478|   199k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
   63|   199k|  if(!new_item)
  ------------------
  |  Branch (63:6): [True: 0, False: 199k]
  ------------------
   64|      0|    return NULL;
   65|       |
   66|   199k|  new_item->next = NULL;
   67|   199k|  new_item->data = CURL_UNCONST(data);
  ------------------
  |  |  866|   199k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
   68|       |
   69|       |  /* if this is the first item, then new_item *is* the list */
   70|   199k|  if(!list)
  ------------------
  |  Branch (70:6): [True: 177k, False: 21.1k]
  ------------------
   71|   177k|    return new_item;
   72|       |
   73|  21.1k|  last = slist_get_last(list);
   74|  21.1k|  last->next = new_item;
   75|  21.1k|  return list;
   76|   199k|}
curl_slist_append:
   86|  69.3k|{
   87|  69.3k|  char *dupdata = curlx_strdup(data);
  ------------------
  |  | 1477|  69.3k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
   88|       |
   89|  69.3k|  if(!dupdata)
  ------------------
  |  Branch (89:6): [True: 0, False: 69.3k]
  ------------------
   90|      0|    return NULL;
   91|       |
   92|  69.3k|  list = Curl_slist_append_nodup(list, dupdata);
   93|  69.3k|  if(!list)
  ------------------
  |  Branch (93:6): [True: 0, False: 69.3k]
  ------------------
   94|      0|    curlx_free(dupdata);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   95|       |
   96|  69.3k|  return list;
   97|  69.3k|}
curl_slist_free_all:
  125|   342k|{
  126|   342k|  struct curl_slist *next;
  127|   342k|  struct curl_slist *item;
  128|       |
  129|   342k|  if(!list)
  ------------------
  |  Branch (129:6): [True: 164k, False: 177k]
  ------------------
  130|   164k|    return;
  131|       |
  132|   177k|  item = list;
  133|   196k|  do {
  134|   196k|    next = item->next;
  135|   196k|    curlx_safefree(item->data);
  ------------------
  |  | 1327|   196k|  do {                      \
  |  | 1328|   196k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|   196k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|   196k|    (ptr) = NULL;           \
  |  | 1330|   196k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 196k]
  |  |  ------------------
  ------------------
  136|   196k|    curlx_free(item);
  ------------------
  |  | 1483|   196k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  137|   196k|    item = next;
  138|   196k|  } while(next);
  ------------------
  |  Branch (138:11): [True: 18.4k, False: 177k]
  ------------------
  139|   177k|}
slist.c:slist_get_last:
   30|  21.1k|{
   31|  21.1k|  struct curl_slist *item;
   32|       |
   33|       |  /* if caller passed us a NULL, return now */
   34|  21.1k|  if(!list)
  ------------------
  |  Branch (34:6): [True: 0, False: 21.1k]
  ------------------
   35|      0|    return NULL;
   36|       |
   37|       |  /* loop through to find the last item */
   38|  21.1k|  item = list;
   39|  8.11M|  while(item->next) {
  ------------------
  |  Branch (39:9): [True: 8.09M, False: 21.1k]
  ------------------
   40|  8.09M|    item = item->next;
   41|  8.09M|  }
   42|  21.1k|  return item;
   43|  21.1k|}

Curl_wakeup_init:
  284|  17.2k|{
  285|  17.2k|#ifdef USE_EVENTFD
  286|  17.2k|  return wakeup_eventfd(socks, nonblocking);
  287|       |#elif defined(HAVE_PIPE)
  288|       |  return wakeup_pipe(socks, nonblocking);
  289|       |#elif defined(HAVE_SOCKETPAIR)
  290|       |  return wakeup_socketpair(socks, nonblocking);
  291|       |#else
  292|       |  return wakeup_inet(socks, nonblocking);
  293|       |#endif
  294|  17.2k|}
Curl_wakeup_signal:
  311|    456|{
  312|    456|  int err = 0;
  313|    456|#ifdef USE_EVENTFD
  314|    456|  const uint64_t buf[1] = { 1 };
  315|       |#else
  316|       |  const char buf[1] = { 1 };
  317|       |#endif
  318|       |
  319|    456|  while(1) {
  ------------------
  |  Branch (319:9): [True: 456, Folded]
  ------------------
  320|    456|    err = 0;
  321|    456|    if(wakeup_write(socks[1], buf, sizeof(buf)) < 0) {
  ------------------
  |  |  298|    456|#define wakeup_write        write
  ------------------
  |  Branch (321:8): [True: 0, False: 456]
  ------------------
  322|      0|      err = SOCKERRNO;
  ------------------
  |  | 1095|      0|#define SOCKERRNO         errno
  ------------------
  323|       |#ifdef USE_WINSOCK
  324|       |      if(err == SOCKEWOULDBLOCK)
  325|       |        err = 0; /* wakeup is already ongoing */
  326|       |#else
  327|      0|      if(SOCKEINTR == err)
  ------------------
  |  | 1129|      0|#define SOCKEINTR         EINTR
  ------------------
  |  Branch (327:10): [True: 0, False: 0]
  ------------------
  328|      0|        continue;
  329|      0|      if((err == SOCKEWOULDBLOCK) || (err == EAGAIN))
  ------------------
  |  | 1137|      0|#define SOCKEWOULDBLOCK   EWOULDBLOCK
  ------------------
  |  Branch (329:10): [True: 0, False: 0]
  |  Branch (329:38): [True: 0, False: 0]
  ------------------
  330|      0|        err = 0; /* wakeup is already ongoing */
  331|      0|#endif
  332|      0|    }
  333|    456|    break;
  334|    456|  }
  335|    456|  return err;
  336|    456|}
Curl_wakeup_consume:
  339|  3.51M|{
  340|  3.51M|  char buf[64];
  341|  3.51M|  ssize_t rc;
  342|  3.51M|  CURLcode result = CURLE_OK;
  343|       |
  344|  3.51M|  do {
  345|  3.51M|    rc = wakeup_read(socks[0], buf, sizeof(buf));
  ------------------
  |  |  299|  3.51M|#define wakeup_read         read
  ------------------
  346|  3.51M|    if(!rc)
  ------------------
  |  Branch (346:8): [True: 0, False: 3.51M]
  ------------------
  347|      0|      break;
  348|  3.51M|    else if(rc < 0) {
  ------------------
  |  Branch (348:13): [True: 3.51M, False: 322]
  ------------------
  349|       |#ifdef USE_WINSOCK
  350|       |      if(SOCKERRNO == SOCKEWOULDBLOCK)
  351|       |        break;
  352|       |#else
  353|  3.51M|      if(SOCKEINTR == SOCKERRNO)
  ------------------
  |  | 1129|  3.51M|#define SOCKEINTR         EINTR
  ------------------
                    if(SOCKEINTR == SOCKERRNO)
  ------------------
  |  | 1095|  3.51M|#define SOCKERRNO         errno
  ------------------
  |  Branch (353:10): [True: 0, False: 3.51M]
  ------------------
  354|      0|        continue;
  355|  3.51M|      if((SOCKERRNO == SOCKEWOULDBLOCK) || (SOCKERRNO == EAGAIN))
  ------------------
  |  | 1095|  3.51M|#define SOCKERRNO         errno
  ------------------
                    if((SOCKERRNO == SOCKEWOULDBLOCK) || (SOCKERRNO == EAGAIN))
  ------------------
  |  | 1137|  3.51M|#define SOCKEWOULDBLOCK   EWOULDBLOCK
  ------------------
                    if((SOCKERRNO == SOCKEWOULDBLOCK) || (SOCKERRNO == EAGAIN))
  ------------------
  |  | 1095|      0|#define SOCKERRNO         errno
  ------------------
  |  Branch (355:10): [True: 3.51M, False: 0]
  |  Branch (355:44): [True: 0, False: 0]
  ------------------
  356|  3.51M|        break;
  357|      0|#endif
  358|      0|      result = CURLE_READ_ERROR;
  359|      0|      break;
  360|  3.51M|    }
  361|  3.51M|  } while(all);
  ------------------
  |  Branch (361:11): [True: 322, False: 0]
  ------------------
  362|  3.51M|  return result;
  363|  3.51M|}
Curl_wakeup_destroy:
  366|  17.2k|{
  367|       |#ifndef USE_EVENTFD
  368|       |  if(socks[1] != CURL_SOCKET_BAD)
  369|       |    wakeup_close(socks[1]);
  370|       |#endif
  371|  17.2k|  if(socks[0] != CURL_SOCKET_BAD)
  ------------------
  |  |  145|  17.2k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (371:6): [True: 17.2k, False: 0]
  ------------------
  372|  17.2k|    wakeup_close(socks[0]);
  ------------------
  |  |  300|  17.2k|#define wakeup_close        close
  ------------------
  373|  17.2k|  socks[0] = socks[1] = CURL_SOCKET_BAD;
  ------------------
  |  |  145|  17.2k|#define CURL_SOCKET_BAD (-1)
  ------------------
  374|  17.2k|}
socketpair.c:wakeup_eventfd:
   39|  17.2k|{
   40|  17.2k|  int efd = eventfd(0, nonblocking ? EFD_CLOEXEC | EFD_NONBLOCK : EFD_CLOEXEC);
  ------------------
  |  Branch (40:24): [True: 17.2k, False: 0]
  ------------------
   41|  17.2k|  if(efd == -1) {
  ------------------
  |  Branch (41:6): [True: 0, False: 17.2k]
  ------------------
   42|      0|    socks[0] = socks[1] = CURL_SOCKET_BAD;
  ------------------
  |  |  145|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
   43|      0|    return -1;
   44|      0|  }
   45|  17.2k|  socks[0] = socks[1] = efd;
   46|  17.2k|  return 0;
   47|  17.2k|}

Curl_cf_socks_proxy_insert_after:
 1360|    104|{
 1361|    104|  struct Curl_cfilter *cf;
 1362|    104|  struct socks_ctx *ctx;
 1363|    104|  CURLcode result;
 1364|       |
 1365|    104|  if(!dest)
  ------------------
  |  Branch (1365:6): [True: 0, False: 104]
  ------------------
 1366|      0|    return CURLE_FAILED_INIT;
 1367|       |
 1368|    104|  switch(proxy_type) {
 1369|     18|  case CURLPROXY_SOCKS5:
  ------------------
  |  |  800|     18|#define CURLPROXY_SOCKS5          5L /* added in 7.10 */
  ------------------
  |  Branch (1369:3): [True: 18, False: 86]
  ------------------
 1370|     45|  case CURLPROXY_SOCKS5_HOSTNAME:
  ------------------
  |  |  802|     45|#define CURLPROXY_SOCKS5_HOSTNAME 7L /* Use the SOCKS5 protocol but pass along
  ------------------
  |  Branch (1370:3): [True: 27, False: 77]
  ------------------
 1371|    100|  case CURLPROXY_SOCKS4:
  ------------------
  |  |  798|    100|#define CURLPROXY_SOCKS4          4L /* support added in 7.15.2, enum existed
  ------------------
  |  Branch (1371:3): [True: 55, False: 49]
  ------------------
 1372|    104|  case CURLPROXY_SOCKS4A:
  ------------------
  |  |  801|    104|#define CURLPROXY_SOCKS4A         6L /* added in 7.18.0 */
  ------------------
  |  Branch (1372:3): [True: 4, False: 100]
  ------------------
 1373|    104|    break; /* all supported */
 1374|      0|  default:
  ------------------
  |  Branch (1374:3): [True: 0, False: 104]
  ------------------
 1375|      0|    failf(data, "unknown proxytype %d option given", proxy_type);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1376|      0|    return CURLE_COULDNT_CONNECT;
 1377|    104|  }
 1378|       |
 1379|       |  /* NUL byte already part of struct size */
 1380|    104|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1480|    104|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1381|    104|  if(!ctx) {
  ------------------
  |  Branch (1381:6): [True: 0, False: 104]
  ------------------
 1382|      0|    return CURLE_OUT_OF_MEMORY;
 1383|      0|  }
 1384|       |
 1385|    104|  Curl_peer_link(&ctx->dest, dest);
 1386|    104|  ctx->ip_version = ip_version;
 1387|    104|  ctx->proxy_type = proxy_type;
 1388|    104|  Curl_creds_link(&ctx->creds, creds);
 1389|    104|  Curl_bufq_init2(&ctx->iobuf, SOCKS_CHUNK_SIZE, SOCKS_CHUNKS,
  ------------------
  |  |   94|    104|#define SOCKS_CHUNK_SIZE    1024
  ------------------
                Curl_bufq_init2(&ctx->iobuf, SOCKS_CHUNK_SIZE, SOCKS_CHUNKS,
  ------------------
  |  |   95|    104|#define SOCKS_CHUNKS        1
  ------------------
 1390|    104|                  BUFQ_OPT_SOFT_LIMIT);
  ------------------
  |  |  111|    104|#define BUFQ_OPT_SOFT_LIMIT  (1 << 0)
  ------------------
 1391|       |
 1392|    104|  result = Curl_cf_create(&cf, &Curl_cft_socks_proxy, ctx);
 1393|    104|  if(!result)
  ------------------
  |  Branch (1393:6): [True: 104, False: 0]
  ------------------
 1394|    104|    Curl_conn_cf_insert_after(cf_at, cf);
 1395|      0|  else
 1396|      0|    socks_proxy_ctx_free(ctx);
 1397|    104|  return result;
 1398|    104|}
socks.c:socks_proxy_cf_destroy:
 1302|    104|{
 1303|    104|  (void)data;
 1304|    104|  socks_proxy_ctx_free(cf->ctx);
 1305|       |  cf->ctx = NULL;
 1306|    104|}
socks.c:socks_proxy_cf_connect:
 1200|  72.0k|{
 1201|  72.0k|  struct socks_ctx *ctx = cf->ctx;
 1202|  72.0k|  CURLproxycode pxresult = CURLPX_OK;
 1203|  72.0k|  CURLcode result;
 1204|       |
 1205|  72.0k|  if(cf->connected) {
  ------------------
  |  Branch (1205:6): [True: 6, False: 72.0k]
  ------------------
 1206|      6|    *done = TRUE;
  ------------------
  |  | 1055|      6|#define TRUE true
  ------------------
 1207|      6|    return CURLE_OK;
 1208|      6|  }
 1209|       |
 1210|  72.0k|  result = cf->next->cft->do_connect(cf->next, data, done);
 1211|  72.0k|  if(result || !*done)
  ------------------
  |  Branch (1211:6): [True: 17, False: 72.0k]
  |  Branch (1211:16): [True: 71.8k, False: 155]
  ------------------
 1212|  71.8k|    return result;
 1213|       |
 1214|    155|  switch(ctx->proxy_type) {
 1215|     35|  case CURLPROXY_SOCKS5:
  ------------------
  |  |  800|     35|#define CURLPROXY_SOCKS5          5L /* added in 7.10 */
  ------------------
  |  Branch (1215:3): [True: 35, False: 120]
  ------------------
 1216|     88|  case CURLPROXY_SOCKS5_HOSTNAME:
  ------------------
  |  |  802|     88|#define CURLPROXY_SOCKS5_HOSTNAME 7L /* Use the SOCKS5 protocol but pass along
  ------------------
  |  Branch (1216:3): [True: 53, False: 102]
  ------------------
 1217|     88|    pxresult = socks5_connect(cf, ctx, data);
 1218|     88|    break;
 1219|       |
 1220|     60|  case CURLPROXY_SOCKS4:
  ------------------
  |  |  798|     60|#define CURLPROXY_SOCKS4          4L /* support added in 7.15.2, enum existed
  ------------------
  |  Branch (1220:3): [True: 60, False: 95]
  ------------------
 1221|     67|  case CURLPROXY_SOCKS4A:
  ------------------
  |  |  801|     67|#define CURLPROXY_SOCKS4A         6L /* added in 7.18.0 */
  ------------------
  |  Branch (1221:3): [True: 7, False: 148]
  ------------------
 1222|     67|    pxresult = socks4_connect(cf, ctx, data);
 1223|     67|    break;
 1224|       |
 1225|      0|  default:
  ------------------
  |  Branch (1225:3): [True: 0, False: 155]
  ------------------
 1226|      0|    DEBUGASSERT(0); /* should not come here, checked it at creation time */
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1226:5): [Folded, False: 0]
  |  Branch (1226:5): [Folded, False: 0]
  ------------------
 1227|      0|    result = CURLE_COULDNT_CONNECT;
 1228|      0|    goto out;
 1229|    155|  }
 1230|       |
 1231|    155|  if(pxresult) {
  ------------------
  |  Branch (1231:6): [True: 63, False: 92]
  ------------------
 1232|     63|    result = CURLE_PROXY;
 1233|     63|    data->info.pxcode = pxresult;
 1234|     63|    goto out;
 1235|     63|  }
 1236|     92|  else if(ctx->state != SOCKS_ST_SUCCESS)
  ------------------
  |  Branch (1236:11): [True: 74, False: 18]
  ------------------
 1237|     74|    goto out;
 1238|       |
 1239|     18|#ifdef CURLVERBOSE
 1240|     18|  if(Curl_trc_is_verbose(data)) {
  ------------------
  |  |  319|     18|  ((data) && (data)->set.verbose &&                        \
  |  |  ------------------
  |  |  |  Branch (319:4): [True: 18, False: 0]
  |  |  |  Branch (319:14): [True: 0, False: 18]
  |  |  ------------------
  |  |  320|     18|   (!(data)->state.feat ||                                 \
  |  |  ------------------
  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  ------------------
  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1241|      0|    struct ip_quadruple ipquad;
 1242|      0|    bool is_ipv6;
 1243|      0|    if(!Curl_conn_cf_get_ip_info(cf->next, data, &is_ipv6, &ipquad))
  ------------------
  |  Branch (1243:8): [True: 0, False: 0]
  ------------------
 1244|      0|      infof(data, "Opened %sSOCKS connection from %s port %d to %s port %d "
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1245|      0|            "(via %s port %u)",
 1246|      0|            (cf->sockindex == SECONDARYSOCKET) ? "2nd " : "",
 1247|      0|            ipquad.local_ip, ipquad.local_port,
 1248|      0|            ctx->dest->hostname, ctx->dest->port,
 1249|      0|            ipquad.remote_ip, ipquad.remote_port);
 1250|      0|    else
 1251|      0|      infof(data, "Opened %sSOCKS connection",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1252|      0|            (cf->sockindex == SECONDARYSOCKET) ? "2nd " : "");
 1253|      0|  }
 1254|     18|#endif
 1255|     18|  cf->connected = TRUE;
  ------------------
  |  | 1055|     18|#define TRUE true
  ------------------
 1256|       |
 1257|    155|out:
 1258|    155|  *done = (bool)cf->connected;
 1259|    155|  if(*done || result)
  ------------------
  |  Branch (1259:6): [True: 18, False: 137]
  |  Branch (1259:15): [True: 63, False: 74]
  ------------------
 1260|     81|    Curl_creds_unlink(&ctx->creds);
 1261|    155|  return result;
 1262|     18|}
socks.c:socks5_connect:
 1032|     88|{
 1033|     88|  CURLproxycode presult;
 1034|     88|  bool done;
 1035|       |
 1036|    139|process_state:
 1037|    139|  switch(sx->state) {
 1038|     45|  case SOCKS_ST_INIT:
  ------------------
  |  Branch (1038:3): [True: 45, False: 94]
  ------------------
 1039|     45|    sx->version = 5;
 1040|     45|    sx->resolve_local = (sx->proxy_type == CURLPROXY_SOCKS5);
  ------------------
  |  |  800|     45|#define CURLPROXY_SOCKS5          5L /* added in 7.10 */
  ------------------
 1041|     45|    sxstate(sx, cf, data, SOCKS5_ST_START);
  ------------------
  |  |  162|     45|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
 1042|     45|    FALLTHROUGH();
  ------------------
  |  |  821|     45|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
 1043|       |
 1044|     45|  case SOCKS5_ST_START:
  ------------------
  |  Branch (1044:3): [True: 0, False: 139]
  ------------------
 1045|     45|    CURL_TRC_CF(data, cf, "SOCKS5: connecting to %s:%u",
  ------------------
  |  |  153|     45|  do {                                          \
  |  |  154|     45|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     45|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     90|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 45, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 45]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     90|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     45|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     45|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     45|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 45]
  |  |  ------------------
  ------------------
 1046|     45|                sx->dest->hostname, sx->dest->port);
 1047|     45|    presult = socks5_req0_init(cf, sx, data);
 1048|     45|    if(presult)
  ------------------
  |  Branch (1048:8): [True: 0, False: 45]
  ------------------
 1049|      0|      return socks_failed(sx, cf, data, presult);
 1050|     45|    sxstate(sx, cf, data, SOCKS5_ST_REQ0_SEND);
  ------------------
  |  |  162|     45|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
 1051|     45|    FALLTHROUGH();
  ------------------
  |  |  821|     45|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
 1052|       |
 1053|     45|  case SOCKS5_ST_REQ0_SEND:
  ------------------
  |  Branch (1053:3): [True: 0, False: 139]
  ------------------
 1054|     45|    presult = socks_flush(sx, cf, data, &done);
 1055|     45|    if(presult)
  ------------------
  |  Branch (1055:8): [True: 0, False: 45]
  ------------------
 1056|      0|      return socks_failed(sx, cf, data, presult);
 1057|     45|    else if(!done)
  ------------------
  |  Branch (1057:13): [True: 0, False: 45]
  ------------------
 1058|      0|      return CURLPX_OK;
 1059|       |    /* done sending! */
 1060|     45|    sxstate(sx, cf, data, SOCKS5_ST_RESP0_RECV);
  ------------------
  |  |  162|     45|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
 1061|     45|    FALLTHROUGH();
  ------------------
  |  |  821|     45|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
 1062|       |
 1063|     86|  case SOCKS5_ST_RESP0_RECV:
  ------------------
  |  Branch (1063:3): [True: 41, False: 98]
  ------------------
 1064|     86|    presult = socks_recv(sx, cf, data, 2, &done);
 1065|     86|    if(presult)
  ------------------
  |  Branch (1065:8): [True: 5, False: 81]
  ------------------
 1066|      5|      return socks_failed(sx, cf, data, presult);
 1067|     81|    else if(!done)
  ------------------
  |  Branch (1067:13): [True: 42, False: 39]
  ------------------
 1068|     42|      return CURLPX_OK;
 1069|     39|    presult = socks5_check_resp0(sx, cf, data);
 1070|     39|    if(presult)
  ------------------
  |  Branch (1070:8): [True: 6, False: 33]
  ------------------
 1071|      6|      return socks_failed(sx, cf, data, presult);
 1072|       |    /* socks5_check_resp0() sets next socks state */
 1073|     33|    goto process_state;
 1074|       |
 1075|     33|  case SOCKS5_ST_GSSAPI_INIT: {
  ------------------
  |  Branch (1075:3): [True: 1, False: 138]
  ------------------
 1076|       |#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
 1077|       |    /* GSSAPI stuff done non-blocking */
 1078|       |    CURLcode result = Curl_SOCKS5_gssapi_negotiate(cf, data, sx->creds);
 1079|       |    if(result) {
 1080|       |      failf(data, "Unable to negotiate SOCKS5 GSS-API context.");
 1081|       |      return CURLPX_GSSAPI;
 1082|       |    }
 1083|       |    sxstate(sx, cf, data, SOCKS5_ST_REQ1_INIT);
 1084|       |    goto process_state;
 1085|       |#else
 1086|      1|    failf(data, "SOCKS5 GSSAPI per-message authentication is not supported.");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
 1087|      1|    return socks_failed(sx, cf, data, CURLPX_GSSAPI_PERMSG);
 1088|     39|#endif
 1089|     39|  }
 1090|       |
 1091|     13|  case SOCKS5_ST_AUTH_INIT:
  ------------------
  |  Branch (1091:3): [True: 13, False: 126]
  ------------------
 1092|     13|    presult = socks5_auth_init(cf, sx, data);
 1093|     13|    if(presult)
  ------------------
  |  Branch (1093:8): [True: 2, False: 11]
  ------------------
 1094|      2|      return socks_failed(sx, cf, data, presult);
 1095|     11|    sxstate(sx, cf, data, SOCKS5_ST_AUTH_SEND);
  ------------------
  |  |  162|     11|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
 1096|     11|    FALLTHROUGH();
  ------------------
  |  |  821|     11|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
 1097|       |
 1098|     11|  case SOCKS5_ST_AUTH_SEND:
  ------------------
  |  Branch (1098:3): [True: 0, False: 139]
  ------------------
 1099|     11|    presult = socks_flush(sx, cf, data, &done);
 1100|     11|    if(presult)
  ------------------
  |  Branch (1100:8): [True: 0, False: 11]
  ------------------
 1101|      0|      return socks_failed(sx, cf, data, presult);
 1102|     11|    else if(!done)
  ------------------
  |  Branch (1102:13): [True: 0, False: 11]
  ------------------
 1103|      0|      return CURLPX_OK;
 1104|     11|    sxstate(sx, cf, data, SOCKS5_ST_AUTH_RECV);
  ------------------
  |  |  162|     11|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
 1105|     11|    FALLTHROUGH();
  ------------------
  |  |  821|     11|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
 1106|       |
 1107|     11|  case SOCKS5_ST_AUTH_RECV:
  ------------------
  |  Branch (1107:3): [True: 0, False: 139]
  ------------------
 1108|     11|    presult = socks_recv(sx, cf, data, 2, &done);
 1109|     11|    if(presult)
  ------------------
  |  Branch (1109:8): [True: 0, False: 11]
  ------------------
 1110|      0|      return socks_failed(sx, cf, data, presult);
 1111|     11|    else if(!done)
  ------------------
  |  Branch (1111:13): [True: 0, False: 11]
  ------------------
 1112|      0|      return CURLPX_OK;
 1113|     11|    presult = socks5_check_auth_resp(sx, cf, data);
 1114|     11|    if(presult)
  ------------------
  |  Branch (1114:8): [True: 7, False: 4]
  ------------------
 1115|      7|      return socks_failed(sx, cf, data, presult);
 1116|       |    /* Everything is good so far, user was authenticated! */
 1117|      4|    sxstate(sx, cf, data, SOCKS5_ST_REQ1_INIT);
  ------------------
  |  |  162|      4|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
 1118|      4|    FALLTHROUGH();
  ------------------
  |  |  821|      4|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
 1119|       |
 1120|     23|  case SOCKS5_ST_REQ1_INIT:
  ------------------
  |  Branch (1120:3): [True: 19, False: 120]
  ------------------
 1121|     23|    presult = socks5_req1_init(sx, cf, data);
 1122|     23|    if(presult)
  ------------------
  |  Branch (1122:8): [True: 0, False: 23]
  ------------------
 1123|      0|      return socks_failed(sx, cf, data, presult);
 1124|     23|    if(!sx->resolve_local) {
  ------------------
  |  Branch (1124:8): [True: 18, False: 5]
  ------------------
 1125|       |      /* we do not resolve, request is complete */
 1126|     18|      sxstate(sx, cf, data, SOCKS5_ST_REQ1_SEND);
  ------------------
  |  |  162|     18|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
 1127|     18|      goto process_state;
 1128|     18|    }
 1129|      5|    sx->start_resolving = TRUE;
  ------------------
  |  | 1055|      5|#define TRUE true
  ------------------
 1130|      5|    sxstate(sx, cf, data, SOCKS5_ST_RESOLVING);
  ------------------
  |  |  162|      5|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
 1131|      5|    FALLTHROUGH();
  ------------------
  |  |  821|      5|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
 1132|       |
 1133|      5|  case SOCKS5_ST_RESOLVING:
  ------------------
  |  Branch (1133:3): [True: 0, False: 139]
  ------------------
 1134|      5|    presult = socks5_resolving(sx, cf, data, &done);
 1135|      5|    if(presult)
  ------------------
  |  Branch (1135:8): [True: 0, False: 5]
  ------------------
 1136|      0|      return socks_failed(sx, cf, data, presult);
 1137|      5|    if(!done)
  ------------------
  |  Branch (1137:8): [True: 0, False: 5]
  ------------------
 1138|      0|      return CURLPX_OK;
 1139|      5|    sxstate(sx, cf, data, SOCKS5_ST_REQ1_SEND);
  ------------------
  |  |  162|      5|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
 1140|      5|    FALLTHROUGH();
  ------------------
  |  |  821|      5|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
 1141|       |
 1142|     23|  case SOCKS5_ST_REQ1_SEND:
  ------------------
  |  Branch (1142:3): [True: 18, False: 121]
  ------------------
 1143|     23|    presult = socks_flush(sx, cf, data, &done);
 1144|     23|    if(presult)
  ------------------
  |  Branch (1144:8): [True: 0, False: 23]
  ------------------
 1145|      0|      return socks_failed(sx, cf, data, presult);
 1146|     23|    else if(!done)
  ------------------
  |  Branch (1146:13): [True: 0, False: 23]
  ------------------
 1147|      0|      return CURLPX_OK;
 1148|       |#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
 1149|       |    if(cf->conn->socks5_gssapi_enctype) {
 1150|       |      failf(data, "SOCKS5 GSS-API protection not yet implemented.");
 1151|       |      return CURLPX_GSSAPI_PROTECTION;
 1152|       |    }
 1153|       |#endif
 1154|     23|    sxstate(sx, cf, data, SOCKS5_ST_RESP1_RECV);
  ------------------
  |  |  162|     23|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
 1155|     23|    FALLTHROUGH();
  ------------------
  |  |  821|     23|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
 1156|       |
 1157|     25|  case SOCKS5_ST_RESP1_RECV:
  ------------------
  |  Branch (1157:3): [True: 2, False: 137]
  ------------------
 1158|     25|    presult = socks5_recv_resp1(sx, cf, data, &done);
 1159|     25|    if(presult)
  ------------------
  |  Branch (1159:8): [True: 8, False: 17]
  ------------------
 1160|      8|      return socks_failed(sx, cf, data, presult);
 1161|     17|    if(!done)
  ------------------
  |  Branch (1161:8): [True: 2, False: 15]
  ------------------
 1162|      2|      return CURLPX_OK;
 1163|     15|    CURL_TRC_CF(data, cf, "SOCKS5 request granted.");
  ------------------
  |  |  153|     15|  do {                                          \
  |  |  154|     15|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     15|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     30|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 15, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 15]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     30|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     15|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     15|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     15|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 15]
  |  |  ------------------
  ------------------
 1164|     15|    sxstate(sx, cf, data, SOCKS_ST_SUCCESS);
  ------------------
  |  |  162|     15|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
 1165|     15|    FALLTHROUGH();
  ------------------
  |  |  821|     15|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
 1166|       |
 1167|     15|  case SOCKS_ST_SUCCESS:
  ------------------
  |  Branch (1167:3): [True: 0, False: 139]
  ------------------
 1168|     15|    return CURLPX_OK;
 1169|       |
 1170|      0|  case SOCKS_ST_FAILED:
  ------------------
  |  Branch (1170:3): [True: 0, False: 139]
  ------------------
 1171|      0|    DEBUGASSERT(sx->presult);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1171:5): [True: 0, False: 0]
  |  Branch (1171:5): [True: 0, False: 0]
  ------------------
 1172|      0|    return sx->presult;
 1173|       |
 1174|      0|  default:
  ------------------
  |  Branch (1174:3): [True: 0, False: 139]
  ------------------
 1175|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1175:5): [Folded, False: 0]
  |  Branch (1175:5): [Folded, False: 0]
  ------------------
 1176|      0|    return socks_failed(sx, cf, data, CURLPX_SEND_REQUEST);
 1177|    139|  }
 1178|    139|}
socks.c:socksstate:
  176|    527|{
  177|    527|  enum socks_state_t oldstate = sx->state;
  178|       |
  179|    527|  if(oldstate == state)
  ------------------
  |  Branch (179:6): [True: 11, False: 516]
  ------------------
  180|       |    /* do not bother when the new state is the same as the old state */
  181|     11|    return;
  182|       |
  183|    516|  sx->state = state;
  184|       |
  185|    516|#if defined(DEBUGBUILD) && defined(CURLVERBOSE)
  186|    516|  CURL_TRC_CF(data, cf, "[%s] -> [%s] (line %d)",
  ------------------
  |  |  153|    516|  do {                                          \
  |  |  154|    516|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    516|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  1.03k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 516, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 516]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  1.03k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    516|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    516|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    516|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 516]
  |  |  ------------------
  ------------------
  187|    516|              cf_socks_statename[oldstate],
  188|    516|              cf_socks_statename[sx->state], lineno);
  189|       |#else
  190|       |  (void)cf;
  191|       |  (void)data;
  192|       |#endif
  193|    516|}
socks.c:socks5_req0_init:
  584|     45|{
  585|     45|  const unsigned char auth = data->set.socks5auth;
  586|     45|  unsigned char req[5]; /* version + len + 3 possible auth methods */
  587|     45|  unsigned char nauths;
  588|     45|  size_t req_len, nwritten;
  589|     45|  CURLcode result;
  590|       |
  591|     45|  (void)cf;
  592|       |  /* RFC1928 chapter 5 specifies max 255 chars for domain name in packet */
  593|     45|  if(!sx->resolve_local && strlen(sx->dest->hostname) > 255) {
  ------------------
  |  Branch (593:6): [True: 27, False: 18]
  |  Branch (593:28): [True: 0, False: 27]
  ------------------
  594|      0|    failf(data, "SOCKS5: the destination hostname is too long to be "
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  595|      0|          "resolved remotely by the proxy.");
  596|      0|    return CURLPX_LONG_HOSTNAME;
  597|      0|  }
  598|       |
  599|     45|  if(auth & ~(CURLAUTH_BASIC | CURLAUTH_GSSAPI))
  ------------------
  |  |  831|     45|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
                if(auth & ~(CURLAUTH_BASIC | CURLAUTH_GSSAPI))
  ------------------
  |  |  837|     45|#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE
  |  |  ------------------
  |  |  |  |  833|     45|#define CURLAUTH_NEGOTIATE    (((unsigned long)1) << 2)
  |  |  ------------------
  ------------------
  |  Branch (599:6): [True: 0, False: 45]
  ------------------
  600|      0|    infof(data, "warning: unsupported value passed to "
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  601|     45|          "CURLOPT_SOCKS5_AUTH: %u", auth);
  602|     45|  if(!(auth & CURLAUTH_BASIC))
  ------------------
  |  |  831|     45|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
  |  Branch (602:6): [True: 3, False: 42]
  ------------------
  603|       |    /* disable username/password auth */
  604|      3|    Curl_creds_unlink(&sx->creds);
  605|       |
  606|     45|  req[0] = 5;   /* version */
  607|     45|  nauths = 1;
  608|     45|  req[1 + nauths] = 0;   /* 1. no authentication */
  609|       |#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
  610|       |  if(auth & CURLAUTH_GSSAPI) {
  611|       |    ++nauths;
  612|       |    req[1 + nauths] = 1; /* GSS-API */
  613|       |  }
  614|       |#endif
  615|     45|  if(sx->creds) {
  ------------------
  |  Branch (615:6): [True: 11, False: 34]
  ------------------
  616|     11|    ++nauths;
  617|     11|    req[1 + nauths] = 2; /* username/password */
  618|     11|  }
  619|     45|  req[1] = nauths;
  620|     45|  req_len = 2 + nauths;
  621|       |
  622|     45|  result = Curl_bufq_write(&sx->iobuf, req, req_len, &nwritten);
  623|     45|  if(result || (nwritten != req_len))
  ------------------
  |  Branch (623:6): [True: 0, False: 45]
  |  Branch (623:16): [True: 0, False: 45]
  ------------------
  624|      0|    return CURLPX_SEND_REQUEST;
  625|     45|  return CURLPX_OK;
  626|     45|}
socks.c:socks_failed:
  199|     63|{
  200|     63|  sxstate(sx, cf, data, SOCKS_ST_FAILED);
  ------------------
  |  |  162|     63|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
  201|     63|  sx->presult = presult;
  202|     63|  return presult;
  203|     63|}
socks.c:socks_flush:
  209|    117|{
  210|    117|  CURLcode result;
  211|    117|  size_t nwritten;
  212|       |
  213|    117|  *done = FALSE;
  ------------------
  |  | 1058|    117|#define FALSE false
  ------------------
  214|    234|  while(!Curl_bufq_is_empty(&sx->iobuf)) {
  ------------------
  |  Branch (214:9): [True: 117, False: 117]
  ------------------
  215|    117|    result = Curl_cf_send_bufq(cf->next, data, &sx->iobuf, NULL, 0,
  216|    117|                               &nwritten);
  217|    117|    if(result == CURLE_AGAIN)
  ------------------
  |  Branch (217:8): [True: 0, False: 117]
  ------------------
  218|      0|      return CURLPX_OK;
  219|    117|    else if(result) {
  ------------------
  |  Branch (219:13): [True: 0, False: 117]
  ------------------
  220|      0|      failf(data, "Failed to send SOCKS request: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  221|      0|            curl_easy_strerror(result));
  222|      0|      return socks_failed(sx, cf, data, CURLPX_SEND_CONNECT);
  223|      0|    }
  224|    117|  }
  225|    117|  *done = TRUE;
  ------------------
  |  | 1055|    117|#define TRUE true
  ------------------
  226|    117|  return CURLPX_OK;
  227|    117|}
socks.c:socks_recv:
  234|    185|{
  235|    185|  CURLcode result;
  236|    185|  size_t nread;
  237|       |
  238|    185|  *done = FALSE;
  ------------------
  |  | 1058|    185|#define FALSE false
  ------------------
  239|    288|  while(Curl_bufq_len(&sx->iobuf) < min_bytes) {
  ------------------
  |  Branch (239:9): [True: 192, False: 96]
  ------------------
  240|    192|    result = Curl_cf_recv_bufq(cf->next, data, &sx->iobuf,
  241|    192|                               min_bytes - Curl_bufq_len(&sx->iobuf),
  242|    192|                               &nread);
  243|    192|    if(result == CURLE_AGAIN)
  ------------------
  |  Branch (243:8): [True: 55, False: 137]
  ------------------
  244|     55|      return CURLPX_OK;
  245|    137|    else if(result) {
  ------------------
  |  Branch (245:13): [True: 0, False: 137]
  ------------------
  246|      0|      failf(data, "Failed to receive SOCKS response: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  247|      0|            curl_easy_strerror(result));
  248|      0|      return CURLPX_RECV_CONNECT;
  249|      0|    }
  250|    137|    else if(!nread) { /* EOF */
  ------------------
  |  Branch (250:13): [True: 34, False: 103]
  ------------------
  251|     34|      if(Curl_bufq_len(&sx->iobuf) < min_bytes) {
  ------------------
  |  Branch (251:10): [True: 34, False: 0]
  ------------------
  252|     34|        failf(data, "Failed to receive SOCKS response, "
  ------------------
  |  |   62|     34|#define failf Curl_failf
  ------------------
  253|     34|              "proxy closed connection");
  254|     34|        return CURLPX_RECV_CONNECT;
  255|     34|      }
  256|      0|      break;
  257|     34|    }
  258|    192|  }
  259|     96|  *done = TRUE;
  ------------------
  |  | 1055|     96|#define TRUE true
  ------------------
  260|     96|  return CURLPX_OK;
  261|    185|}
socks.c:socks5_check_resp0:
  631|     39|{
  632|     39|  const unsigned char *resp;
  633|     39|  unsigned char auth_mode;
  634|     39|  size_t rlen;
  635|       |
  636|     39|  if(!Curl_bufq_peek(&sx->iobuf, &resp, &rlen) || rlen < 2) {
  ------------------
  |  Branch (636:6): [True: 0, False: 39]
  |  Branch (636:51): [True: 0, False: 39]
  ------------------
  637|      0|    failf(data, "SOCKS5 initial reply is incomplete.");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  638|      0|    return CURLPX_RECV_CONNECT;
  639|      0|  }
  640|       |
  641|     39|  if(resp[0] != 5) {
  ------------------
  |  Branch (641:6): [True: 2, False: 37]
  ------------------
  642|      2|    failf(data, "Received invalid version in initial SOCKS5 response.");
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
  643|      2|    return CURLPX_BAD_VERSION;
  644|      2|  }
  645|       |
  646|     37|  auth_mode = resp[1];
  647|     37|  Curl_bufq_skip(&sx->iobuf, 2);
  648|       |
  649|     37|  switch(auth_mode) {
  650|     19|  case 0:
  ------------------
  |  Branch (650:3): [True: 19, False: 18]
  ------------------
  651|       |    /* DONE! No authentication needed. Send request. */
  652|     19|    sxstate(sx, cf, data, SOCKS5_ST_REQ1_INIT);
  ------------------
  |  |  162|     19|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
  653|     19|    return CURLPX_OK;
  654|      2|  case 1:
  ------------------
  |  Branch (654:3): [True: 2, False: 35]
  ------------------
  655|      2|    if(data->set.socks5auth & CURLAUTH_GSSAPI) {
  ------------------
  |  |  837|      2|#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE
  |  |  ------------------
  |  |  |  |  833|      2|#define CURLAUTH_NEGOTIATE    (((unsigned long)1) << 2)
  |  |  ------------------
  ------------------
  |  Branch (655:8): [True: 1, False: 1]
  ------------------
  656|      1|      sxstate(sx, cf, data, SOCKS5_ST_GSSAPI_INIT);
  ------------------
  |  |  162|      1|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
  657|      1|      return CURLPX_OK;
  658|      1|    }
  659|      1|    failf(data, "SOCKS5 GSSAPI per-message authentication is not enabled.");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  660|      1|    return CURLPX_GSSAPI_PERMSG;
  661|     14|  case 2:
  ------------------
  |  Branch (661:3): [True: 14, False: 23]
  ------------------
  662|       |    /* regular name + password authentication */
  663|     14|    if(data->set.socks5auth & CURLAUTH_BASIC) {
  ------------------
  |  |  831|     14|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
  |  Branch (663:8): [True: 13, False: 1]
  ------------------
  664|     13|      sxstate(sx, cf, data, SOCKS5_ST_AUTH_INIT);
  ------------------
  |  |  162|     13|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
  665|     13|      return CURLPX_OK;
  666|     13|    }
  667|      1|    failf(data, "BASIC authentication proposed but not enabled.");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  668|      1|    return CURLPX_NO_AUTH;
  669|      1|  case 255:
  ------------------
  |  Branch (669:3): [True: 1, False: 36]
  ------------------
  670|      1|    failf(data, "No authentication method was acceptable.");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  671|      1|    return CURLPX_NO_AUTH;
  672|      1|  default:
  ------------------
  |  Branch (672:3): [True: 1, False: 36]
  ------------------
  673|      1|    failf(data, "Unknown SOCKS5 mode attempted to be used by server.");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  674|      1|    return CURLPX_UNKNOWN_MODE;
  675|     37|  }
  676|     37|}
socks.c:socks5_auth_init:
  681|     13|{
  682|       |  /* Needs username and password */
  683|     13|  size_t ulen = 0, plen = 0, nwritten;
  684|     13|  unsigned char buf[2];
  685|     13|  CURLcode result;
  686|       |
  687|     13|  if(sx->creds) {
  ------------------
  |  Branch (687:6): [True: 8, False: 5]
  ------------------
  688|      8|    ulen = strlen(sx->creds->user);
  689|      8|    plen = strlen(sx->creds->passwd);
  690|       |    /* the lengths must fit in a single byte */
  691|      8|    if(ulen > 255) {
  ------------------
  |  Branch (691:8): [True: 1, False: 7]
  ------------------
  692|      1|      failf(data, "Excessive username length for proxy auth");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  693|      1|      return CURLPX_LONG_USER;
  694|      1|    }
  695|      7|    if(plen > 255) {
  ------------------
  |  Branch (695:8): [True: 1, False: 6]
  ------------------
  696|      1|      failf(data, "Excessive password length for proxy auth");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  697|      1|      return CURLPX_LONG_PASSWD;
  698|      1|    }
  699|      7|  }
  700|       |
  701|       |  /*   username/password request looks like
  702|       |   * +----+------+----------+------+----------+
  703|       |   * |VER | ULEN |  UNAME   | PLEN |  PASSWD  |
  704|       |   * +----+------+----------+------+----------+
  705|       |   * | 1  |  1   | 1 to 255 |  1   | 1 to 255 |
  706|       |   * +----+------+----------+------+----------+
  707|       |   */
  708|     11|  buf[0] = 1;    /* username/pw subnegotiation version */
  709|     11|  buf[1] = (unsigned char)ulen;
  710|     11|  result = Curl_bufq_write(&sx->iobuf, buf, 2, &nwritten);
  711|     11|  if(result || (nwritten != 2))
  ------------------
  |  Branch (711:6): [True: 0, False: 11]
  |  Branch (711:16): [True: 0, False: 11]
  ------------------
  712|      0|    return CURLPX_SEND_REQUEST;
  713|     11|  if(ulen) {
  ------------------
  |  Branch (713:6): [True: 6, False: 5]
  ------------------
  714|      6|    result = Curl_bufq_cwrite(&sx->iobuf, sx->creds->user, ulen, &nwritten);
  715|      6|    if(result || (nwritten != ulen))
  ------------------
  |  Branch (715:8): [True: 0, False: 6]
  |  Branch (715:18): [True: 0, False: 6]
  ------------------
  716|      0|      return CURLPX_SEND_REQUEST;
  717|      6|  }
  718|     11|  buf[0] = (unsigned char)plen;
  719|     11|  result = Curl_bufq_write(&sx->iobuf, buf, 1, &nwritten);
  720|     11|  if(result || (nwritten != 1))
  ------------------
  |  Branch (720:6): [True: 0, False: 11]
  |  Branch (720:16): [True: 0, False: 11]
  ------------------
  721|      0|    return CURLPX_SEND_REQUEST;
  722|     11|  if(plen) {
  ------------------
  |  Branch (722:6): [True: 5, False: 6]
  ------------------
  723|      5|    result = Curl_bufq_cwrite(&sx->iobuf, sx->creds->passwd, plen, &nwritten);
  724|      5|    if(result || (nwritten != plen))
  ------------------
  |  Branch (724:8): [True: 0, False: 5]
  |  Branch (724:18): [True: 0, False: 5]
  ------------------
  725|      0|      return CURLPX_SEND_REQUEST;
  726|      5|  }
  727|     11|  sxstate(sx, cf, data, SOCKS5_ST_AUTH_SEND);
  ------------------
  |  |  162|     11|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
  728|     11|  return CURLPX_OK;
  729|     11|}
socks.c:socks5_check_auth_resp:
  734|     11|{
  735|     11|  const unsigned char *resp;
  736|     11|  unsigned char auth_status;
  737|     11|  size_t rlen;
  738|       |
  739|     11|  (void)cf;
  740|     11|  if(!Curl_bufq_peek(&sx->iobuf, &resp, &rlen) || rlen < 2) {
  ------------------
  |  Branch (740:6): [True: 0, False: 11]
  |  Branch (740:51): [True: 0, False: 11]
  ------------------
  741|      0|    failf(data, "SOCKS5 sub-negotiation response incomplete.");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  742|      0|    return CURLPX_RECV_CONNECT;
  743|      0|  }
  744|       |
  745|       |  /* ignore the first (VER) byte */
  746|     11|  auth_status = resp[1];
  747|     11|  if(auth_status) {
  ------------------
  |  Branch (747:6): [True: 7, False: 4]
  ------------------
  748|      7|    failf(data, "User was rejected by the SOCKS5 server (%d %d).",
  ------------------
  |  |   62|      7|#define failf Curl_failf
  ------------------
  749|      7|          resp[0], resp[1]);
  750|      7|    return CURLPX_USER_REJECTED;
  751|      7|  }
  752|      4|  Curl_bufq_skip(&sx->iobuf, 2);
  753|      4|  return CURLPX_OK;
  754|     11|}
socks.c:socks5_req1_init:
  759|     23|{
  760|     23|  unsigned char req[5];
  761|     23|  unsigned char ipbuf[16];
  762|     23|  const unsigned char *destination;
  763|     23|  unsigned char desttype, destlen, hdlen;
  764|     23|  size_t nwritten;
  765|     23|  CURLcode result;
  766|       |
  767|     23|  req[0] = 5; /* version (SOCKS5) */
  768|     23|  req[1] = 1; /* connect */
  769|     23|  req[2] = 0; /* must be zero */
  770|     23|  if(sx->resolve_local) {
  ------------------
  |  Branch (770:6): [True: 5, False: 18]
  ------------------
  771|       |    /* rest of request is added after resolving */
  772|      5|    result = Curl_bufq_write(&sx->iobuf, req, 3, &nwritten);
  773|      5|    if(result || (nwritten != 3))
  ------------------
  |  Branch (773:8): [True: 0, False: 5]
  |  Branch (773:18): [True: 0, False: 5]
  ------------------
  774|      0|      return CURLPX_SEND_REQUEST;
  775|      5|    return CURLPX_OK;
  776|      5|  }
  777|       |
  778|       |  /* remote resolving, send what type+addr/string to resolve */
  779|     18|#ifdef USE_IPV6
  780|     18|  if(strchr(sx->dest->hostname, ':')) {
  ------------------
  |  Branch (780:6): [True: 0, False: 18]
  ------------------
  781|      0|    desttype = 4;
  782|      0|    destination = ipbuf;
  783|      0|    destlen = 16;
  784|      0|    if(curlx_inet_pton(AF_INET6, sx->dest->hostname, ipbuf) != 1)
  ------------------
  |  |   43|      0|  inet_pton(x, y, z)
  ------------------
  |  Branch (784:8): [True: 0, False: 0]
  ------------------
  785|      0|      return CURLPX_BAD_ADDRESS_TYPE;
  786|      0|  }
  787|     18|  else
  788|     18|#endif
  789|     18|  if(curlx_inet_pton(AF_INET, sx->dest->hostname, ipbuf) == 1) {
  ------------------
  |  |   43|     18|  inet_pton(x, y, z)
  ------------------
  |  Branch (789:6): [True: 18, False: 0]
  ------------------
  790|     18|    desttype = 1;
  791|     18|    destination = ipbuf;
  792|     18|    destlen = 4;
  793|     18|  }
  794|      0|  else {
  795|      0|    const size_t hostname_len = strlen(sx->dest->hostname);
  796|       |    /* socks5_req0_init() already rejects hostnames longer than 255 bytes, so
  797|       |       this cast to unsigned char is safe. Assert to guard against future
  798|       |       refactoring that might remove or reorder that earlier check. */
  799|      0|    DEBUGASSERT(hostname_len <= 255);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (799:5): [True: 0, False: 0]
  |  Branch (799:5): [True: 0, False: 0]
  ------------------
  800|      0|    desttype = 3;
  801|      0|    destination = (const unsigned char *)sx->dest->hostname;
  802|      0|    destlen = (unsigned char)hostname_len; /* one byte length */
  803|      0|  }
  804|       |
  805|     18|  req[3] = desttype;
  806|     18|  req[4] = destlen;
  807|     18|  hdlen = (desttype == 3) ? 5 : 4; /* no length byte for ip addresses */
  ------------------
  |  Branch (807:11): [True: 0, False: 18]
  ------------------
  808|     18|  result = Curl_bufq_write(&sx->iobuf, req, hdlen, &nwritten);
  809|     18|  if(result || (nwritten != hdlen))
  ------------------
  |  Branch (809:6): [True: 0, False: 18]
  |  Branch (809:16): [True: 0, False: 18]
  ------------------
  810|      0|    return CURLPX_SEND_REQUEST;
  811|     18|  result = Curl_bufq_write(&sx->iobuf, destination, destlen, &nwritten);
  812|     18|  if(result || (nwritten != destlen))
  ------------------
  |  Branch (812:6): [True: 0, False: 18]
  |  Branch (812:16): [True: 0, False: 18]
  ------------------
  813|      0|    return CURLPX_SEND_REQUEST;
  814|       |  /* PORT MSB+LSB */
  815|     18|  req[0] = (unsigned char)((sx->dest->port >> 8) & 0xff);
  816|     18|  req[1] = (unsigned char)(sx->dest->port & 0xff);
  817|     18|  result = Curl_bufq_write(&sx->iobuf, req, 2, &nwritten);
  818|     18|  if(result || (nwritten != 2))
  ------------------
  |  Branch (818:6): [True: 0, False: 18]
  |  Branch (818:16): [True: 0, False: 18]
  ------------------
  819|      0|    return CURLPX_SEND_REQUEST;
  820|     18|  CURL_TRC_CF(data, cf, "SOCKS5 connect to %s:%u (remotely resolved)",
  ------------------
  |  |  153|     18|  do {                                          \
  |  |  154|     18|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     18|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     36|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 18, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 18]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     36|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     18|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     18|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     18|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 18]
  |  |  ------------------
  ------------------
  821|     18|              sx->dest->hostname, sx->dest->port);
  822|     18|  return CURLPX_OK;
  823|     18|}
socks.c:socks5_resolving:
  829|      5|{
  830|      5|  const struct Curl_addrinfo *ai = NULL;
  831|      5|  char dest[MAX_IPADR_LEN];  /* printable address */
  832|      5|  const unsigned char *destination = NULL;
  833|      5|  unsigned char desttype = 1, destlen = 4;
  834|      5|  unsigned char req[2];
  835|      5|  CURLcode result;
  836|      5|  CURLproxycode presult = CURLPX_OK;
  837|      5|  size_t nwritten;
  838|      5|  bool dns_done;
  839|       |
  840|      5|  *done = FALSE;
  ------------------
  |  | 1058|      5|#define FALSE false
  ------------------
  841|      5|  if(sx->start_resolving) {
  ------------------
  |  Branch (841:6): [True: 5, False: 0]
  ------------------
  842|       |    /* need to resolve hostname to add destination address */
  843|      5|    sx->start_resolving = FALSE;
  ------------------
  |  | 1058|      5|#define FALSE false
  ------------------
  844|      5|    result = Curl_cf_dns_insert_after(
  845|      5|      cf, data, Curl_resolv_dns_queries(data, sx->ip_version),
  846|      5|      sx->dest, TRNSPRT_TCP, TRUE);
  ------------------
  |  |  307|      5|#define TRNSPRT_TCP  3
  ------------------
                    sx->dest, TRNSPRT_TCP, TRUE);
  ------------------
  |  | 1055|      5|#define TRUE true
  ------------------
  847|      5|    if(result) {
  ------------------
  |  Branch (847:8): [True: 0, False: 5]
  ------------------
  848|      0|      failf(data, "unable to create DNS filter for socks");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  849|      0|      return CURLPX_UNKNOWN_FAIL;
  850|      0|    }
  851|      5|  }
  852|       |
  853|       |  /* resolve the hostname by connecting the DNS filter */
  854|      5|  result = Curl_conn_cf_connect(cf->next, data, &dns_done);
  855|      5|  if(result) {
  ------------------
  |  Branch (855:6): [True: 0, False: 5]
  ------------------
  856|      0|    failf(data, "Failed to resolve \"%s\" for SOCKS5 connect.",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  857|      0|          sx->dest->hostname);
  858|      0|    return CURLPX_RESOLVE_HOST;
  859|      0|  }
  860|      5|  else if(!dns_done)
  ------------------
  |  Branch (860:11): [True: 0, False: 5]
  ------------------
  861|      0|    return CURLPX_OK;
  862|       |
  863|      5|#ifdef USE_IPV6
  864|      5|  if(data->set.ipver != CURL_IPRESOLVE_V4)
  ------------------
  |  | 2305|      5|#define CURL_IPRESOLVE_V4       1L /* uses only IPv4 addresses/connections */
  ------------------
  |  Branch (864:6): [True: 5, False: 0]
  ------------------
  865|      5|    ai = Curl_cf_dns_get_ai(cf->next, data, AF_INET6, 0);
  866|      5|#endif
  867|      5|  if(!ai)
  ------------------
  |  Branch (867:6): [True: 5, False: 0]
  ------------------
  868|      5|    ai = Curl_cf_dns_get_ai(cf->next, data, AF_INET, 0);
  869|       |
  870|      5|  if(!ai) {
  ------------------
  |  Branch (870:6): [True: 0, False: 5]
  ------------------
  871|      0|    failf(data, "Failed to resolve \"%s\" for SOCKS5 connect.",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  872|      0|          sx->dest->hostname);
  873|      0|    presult = CURLPX_RESOLVE_HOST;
  874|      0|    goto out;
  875|      0|  }
  876|       |
  877|      5|  Curl_printable_address(ai, dest, sizeof(dest));
  878|       |
  879|      5|  if(ai->ai_family == AF_INET) {
  ------------------
  |  Branch (879:6): [True: 5, False: 0]
  ------------------
  880|      5|    struct sockaddr_in *saddr_in;
  881|      5|    desttype = 1; /* ATYP: IPv4 = 1 */
  882|      5|    destlen = 4;
  883|      5|    saddr_in = (struct sockaddr_in *)(void *)ai->ai_addr;
  884|      5|    destination = (const unsigned char *)&saddr_in->sin_addr.s_addr;
  885|      5|    CURL_TRC_CF(data, cf, "SOCKS5 connect to %s:%u (locally resolved)",
  ------------------
  |  |  153|      5|  do {                                          \
  |  |  154|      5|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      5|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     10|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 5, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     10|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      5|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      5|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      5|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 5]
  |  |  ------------------
  ------------------
  886|      5|                dest, sx->dest->port);
  887|      5|  }
  888|      0|#ifdef USE_IPV6
  889|      0|  else if(ai->ai_family == AF_INET6) {
  ------------------
  |  Branch (889:11): [True: 0, False: 0]
  ------------------
  890|      0|    struct sockaddr_in6 *saddr_in6;
  891|      0|    desttype = 4; /* ATYP: IPv6 = 4 */
  892|      0|    destlen = 16;
  893|      0|    saddr_in6 = (struct sockaddr_in6 *)(void *)ai->ai_addr;
  894|      0|    destination = (const unsigned char *)&saddr_in6->sin6_addr.s6_addr;
  895|      0|    CURL_TRC_CF(data, cf, "SOCKS5 connect to [%s]:%u (locally resolved)",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  896|      0|                dest, sx->dest->port);
  897|      0|  }
  898|      5|#endif
  899|       |
  900|      5|  if(!destination) {
  ------------------
  |  Branch (900:6): [True: 0, False: 5]
  ------------------
  901|      0|    failf(data, "SOCKS5 connection to %s not supported", dest);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  902|      0|    presult = CURLPX_RESOLVE_HOST;
  903|      0|    goto out;
  904|      0|  }
  905|       |
  906|      5|  req[0] = desttype;
  907|      5|  result = Curl_bufq_write(&sx->iobuf, req, 1, &nwritten);
  908|      5|  if(result || (nwritten != 1)) {
  ------------------
  |  Branch (908:6): [True: 0, False: 5]
  |  Branch (908:16): [True: 0, False: 5]
  ------------------
  909|      0|    presult = CURLPX_SEND_REQUEST;
  910|      0|    goto out;
  911|      0|  }
  912|      5|  result = Curl_bufq_write(&sx->iobuf, destination, destlen, &nwritten);
  913|      5|  if(result || (nwritten != destlen)) {
  ------------------
  |  Branch (913:6): [True: 0, False: 5]
  |  Branch (913:16): [True: 0, False: 5]
  ------------------
  914|      0|    presult = CURLPX_SEND_REQUEST;
  915|      0|    goto out;
  916|      0|  }
  917|       |  /* PORT MSB+LSB */
  918|      5|  req[0] = (unsigned char)((sx->dest->port >> 8) & 0xffU);
  919|      5|  req[1] = (unsigned char)(sx->dest->port & 0xffU);
  920|      5|  result = Curl_bufq_write(&sx->iobuf, req, 2, &nwritten);
  921|      5|  if(result || (nwritten != 2)) {
  ------------------
  |  Branch (921:6): [True: 0, False: 5]
  |  Branch (921:16): [True: 0, False: 5]
  ------------------
  922|      0|    presult = CURLPX_SEND_REQUEST;
  923|      0|    goto out;
  924|      0|  }
  925|       |
  926|      5|out:
  927|      5|  *done = (presult == CURLPX_OK);
  928|      5|  return presult;
  929|      5|}
socks.c:socks5_recv_resp1:
  935|     25|{
  936|     25|  const unsigned char *resp;
  937|     25|  size_t rlen, resp_len = 8; /* minimum response length */
  938|     25|  CURLproxycode presult;
  939|       |
  940|     25|  presult = socks_recv(sx, cf, data, resp_len, done);
  941|     25|  if(presult)
  ------------------
  |  Branch (941:6): [True: 2, False: 23]
  ------------------
  942|      2|    return presult;
  943|     23|  else if(!*done)
  ------------------
  |  Branch (943:11): [True: 1, False: 22]
  ------------------
  944|      1|    return CURLPX_OK;
  945|       |
  946|     22|  if(!Curl_bufq_peek(&sx->iobuf, &resp, &rlen) || rlen < resp_len) {
  ------------------
  |  Branch (946:6): [True: 0, False: 22]
  |  Branch (946:51): [True: 0, False: 22]
  ------------------
  947|      0|    failf(data, "SOCKS5 response is incomplete.");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  948|      0|    return CURLPX_RECV_CONNECT;
  949|      0|  }
  950|       |
  951|       |  /* Response packet includes BND.ADDR is variable length parameter by RFC
  952|       |     1928, so the response packet MUST be read until the end to avoid errors
  953|       |     at subsequent protocol level.
  954|       |
  955|       |     +----+-----+-------+------+----------+----------+
  956|       |     |VER | REP |  RSV  | ATYP | BND.ADDR | BND.PORT |
  957|       |     +----+-----+-------+------+----------+----------+
  958|       |     | 1  |  1  | 0x00  |  1   | Variable |    2     |
  959|       |     +----+-----+-------+------+----------+----------+
  960|       |
  961|       |     ATYP:
  962|       |     o IPv4 address: 0x01, BND.ADDR = 4 byte
  963|       |     o domain name:  0x03, BND.ADDR = [ 1 byte length, string ]
  964|       |     o IPv6 address: 0x04, BND.ADDR = 16 byte
  965|       |  */
  966|     22|  if(resp[0] != 5) { /* version */
  ------------------
  |  Branch (966:6): [True: 2, False: 20]
  ------------------
  967|      2|    failf(data, "SOCKS5 reply has wrong version, version should be 5.");
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
  968|      2|    return CURLPX_BAD_VERSION;
  969|      2|  }
  970|     20|  else if(resp[1]) { /* Anything besides 0 is an error */
  ------------------
  |  Branch (970:11): [True: 2, False: 18]
  ------------------
  971|      2|    CURLproxycode rc = CURLPX_REPLY_UNASSIGNED;
  972|      2|    int code = resp[1];
  973|      2|    failf(data, "cannot complete SOCKS5 connection to %s. (%d)",
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
  974|      2|          sx->dest->hostname, code);
  975|      2|    if(code < 9) {
  ------------------
  |  Branch (975:8): [True: 1, False: 1]
  ------------------
  976|       |      /* RFC 1928 section 6 lists: */
  977|      1|      static const CURLproxycode lookup[] = {
  978|      1|        CURLPX_OK,
  979|      1|        CURLPX_REPLY_GENERAL_SERVER_FAILURE,
  980|      1|        CURLPX_REPLY_NOT_ALLOWED,
  981|      1|        CURLPX_REPLY_NETWORK_UNREACHABLE,
  982|      1|        CURLPX_REPLY_HOST_UNREACHABLE,
  983|      1|        CURLPX_REPLY_CONNECTION_REFUSED,
  984|      1|        CURLPX_REPLY_TTL_EXPIRED,
  985|      1|        CURLPX_REPLY_COMMAND_NOT_SUPPORTED,
  986|      1|        CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED,
  987|      1|      };
  988|      1|      rc = lookup[code];
  989|      1|    }
  990|      2|    return rc;
  991|      2|  }
  992|       |
  993|       |  /* Calculate real packet size */
  994|     18|  switch(resp[3]) {
  995|      8|  case 1: /* IPv4 */
  ------------------
  |  Branch (995:3): [True: 8, False: 10]
  ------------------
  996|      8|    resp_len = 4 + 4 + 2;
  997|      8|    break;
  998|      7|  case 3: /* domain name */
  ------------------
  |  Branch (998:3): [True: 7, False: 11]
  ------------------
  999|      7|    resp_len = 4 + 1 + resp[4] + 2; /* header, var length, var bytes, port */
 1000|      7|    break;
 1001|      2|  case 4: /* IPv6 */
  ------------------
  |  Branch (1001:3): [True: 2, False: 16]
  ------------------
 1002|      2|    resp_len = 4 + 16 + 2;
 1003|      2|    break;
 1004|      1|  default:
  ------------------
  |  Branch (1004:3): [True: 1, False: 17]
  ------------------
 1005|      1|    failf(data, "SOCKS5 reply has wrong address type.");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
 1006|      1|    return CURLPX_BAD_ADDRESS_TYPE;
 1007|     18|  }
 1008|       |
 1009|       |  /* receive the rest of the response */
 1010|     17|  presult = socks_recv(sx, cf, data, resp_len, done);
 1011|     17|  if(presult)
  ------------------
  |  Branch (1011:6): [True: 1, False: 16]
  ------------------
 1012|      1|    return presult;
 1013|     16|  else if(!*done)
  ------------------
  |  Branch (1013:11): [True: 1, False: 15]
  ------------------
 1014|      1|    return CURLPX_OK;
 1015|       |
 1016|     15|  if(!Curl_bufq_peek(&sx->iobuf, &resp, &rlen) || rlen < resp_len) {
  ------------------
  |  Branch (1016:6): [True: 0, False: 15]
  |  Branch (1016:51): [True: 0, False: 15]
  ------------------
 1017|      0|    failf(data, "SOCKS5 response is incomplete.");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1018|      0|    return CURLPX_RECV_CONNECT;
 1019|      0|  }
 1020|       |  /* got it all */
 1021|     15|  *done = TRUE;
  ------------------
  |  | 1055|     15|#define TRUE true
  ------------------
 1022|     15|  return CURLPX_OK;
 1023|     15|}
socks.c:socks4_connect:
  464|     67|{
  465|     67|  size_t nwritten;
  466|     67|  CURLproxycode presult;
  467|     67|  CURLcode result;
  468|     67|  bool done;
  469|       |
  470|     70|process_state:
  471|     70|  switch(sx->state) {
  472|     59|  case SOCKS_ST_INIT:
  ------------------
  |  Branch (472:3): [True: 59, False: 11]
  ------------------
  473|     59|    sx->version = 4;
  474|     59|    sxstate(sx, cf, data, SOCKS4_ST_START);
  ------------------
  |  |  162|     59|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
  475|     59|    FALLTHROUGH();
  ------------------
  |  |  821|     59|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  476|       |
  477|     59|  case SOCKS4_ST_START:
  ------------------
  |  Branch (477:3): [True: 0, False: 70]
  ------------------
  478|     59|    Curl_bufq_reset(&sx->iobuf);
  479|     59|    sx->start_resolving = FALSE;
  ------------------
  |  | 1058|     59|#define FALSE false
  ------------------
  480|     59|    sx->socks4a = (sx->proxy_type == CURLPROXY_SOCKS4A);
  ------------------
  |  |  801|     59|#define CURLPROXY_SOCKS4A         6L /* added in 7.18.0 */
  ------------------
  481|     59|    sx->resolve_local = !sx->socks4a;
  482|     59|    sx->presult = CURLPX_OK;
  483|       |
  484|       |    /* SOCKS4 can only do IPv4, insist! */
  485|     59|    sx->ip_version = CURL_IPRESOLVE_V4;
  ------------------
  |  | 2305|     59|#define CURL_IPRESOLVE_V4       1L /* uses only IPv4 addresses/connections */
  ------------------
  486|     59|    CURL_TRC_CF(data, cf, "SOCKS4%s connecting to %s:%u",
  ------------------
  |  |  153|     59|  do {                                          \
  |  |  154|     59|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     59|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    118|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 59, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 59]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    118|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     59|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     59|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|     59|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 59]
  |  |  ------------------
  ------------------
  487|     59|                sx->socks4a ? "a" : "",
  488|     59|                sx->dest->hostname, sx->dest->port);
  489|       |
  490|       |    /*
  491|       |     * Compose socks4 request
  492|       |     *
  493|       |     * Request format
  494|       |     *
  495|       |     *     +----+----+----+----+----+----+----+----+----+----+....+----+
  496|       |     *     | VN | CD | DSTPORT |      DSTIP        | USERID       |NULL|
  497|       |     *     +----+----+----+----+----+----+----+----+----+----+....+----+
  498|       |     * # of bytes:  1    1      2              4           variable       1
  499|       |     */
  500|     59|    presult = socks4_req_add_hd(sx, data);
  501|     59|    if(presult)
  ------------------
  |  Branch (501:8): [True: 0, False: 59]
  ------------------
  502|      0|      return socks_failed(sx, cf, data, presult);
  503|       |
  504|       |    /* DNS resolve only for SOCKS4, not SOCKS4a */
  505|     59|    if(!sx->resolve_local) {
  ------------------
  |  Branch (505:8): [True: 4, False: 55]
  ------------------
  506|       |      /* socks4a, not resolving locally, sends the hostname.
  507|       |       * add an invalid address + user + hostname */
  508|      4|      unsigned char buf[4] = { 0, 0, 0, 1 };
  509|      4|      size_t hlen = strlen(sx->dest->hostname) + 1; /* including NUL */
  510|       |
  511|      4|      if(hlen > 255) {
  ------------------
  |  Branch (511:10): [True: 0, False: 4]
  ------------------
  512|      0|        failf(data, "SOCKS4: too long hostname");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  513|      0|        return socks_failed(sx, cf, data, CURLPX_LONG_HOSTNAME);
  514|      0|      }
  515|      4|      result = Curl_bufq_write(&sx->iobuf, buf, 4, &nwritten);
  516|      4|      if(result || (nwritten != 4))
  ------------------
  |  Branch (516:10): [True: 0, False: 4]
  |  Branch (516:20): [True: 0, False: 4]
  ------------------
  517|      0|        return socks_failed(sx, cf, data, CURLPX_SEND_REQUEST);
  518|      4|      presult = socks4_req_add_user(sx, data);
  519|      4|      if(presult)
  ------------------
  |  Branch (519:10): [True: 1, False: 3]
  ------------------
  520|      1|        return socks_failed(sx, cf, data, presult);
  521|      3|      result = Curl_bufq_cwrite(&sx->iobuf, sx->dest->hostname, hlen,
  522|      3|                                &nwritten);
  523|      3|      if(result || (nwritten != hlen))
  ------------------
  |  Branch (523:10): [True: 0, False: 3]
  |  Branch (523:20): [True: 0, False: 3]
  ------------------
  524|      0|        return socks_failed(sx, cf, data, CURLPX_SEND_REQUEST);
  525|       |      /* request complete */
  526|      3|      sxstate(sx, cf, data, SOCKS4_ST_SEND);
  ------------------
  |  |  162|      3|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
  527|      3|      goto process_state;
  528|      3|    }
  529|     55|    sx->start_resolving = TRUE;
  ------------------
  |  | 1055|     55|#define TRUE true
  ------------------
  530|     55|    sxstate(sx, cf, data, SOCKS4_ST_RESOLVING);
  ------------------
  |  |  162|     55|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
  531|     55|    FALLTHROUGH();
  ------------------
  |  |  821|     55|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  532|       |
  533|     55|  case SOCKS4_ST_RESOLVING:
  ------------------
  |  Branch (533:3): [True: 0, False: 70]
  ------------------
  534|     55|    presult = socks4_resolving(sx, cf, data, &done);
  535|     55|    if(presult)
  ------------------
  |  Branch (535:8): [True: 0, False: 55]
  ------------------
  536|      0|      return socks_failed(sx, cf, data, presult);
  537|     55|    if(!done)
  ------------------
  |  Branch (537:8): [True: 19, False: 36]
  ------------------
  538|     19|      return CURLPX_OK;
  539|       |    /* append user */
  540|     36|    presult = socks4_req_add_user(sx, data);
  541|     36|    if(presult)
  ------------------
  |  Branch (541:8): [True: 1, False: 35]
  ------------------
  542|      1|      return socks_failed(sx, cf, data, presult);
  543|     35|    sxstate(sx, cf, data, SOCKS4_ST_SEND);
  ------------------
  |  |  162|     35|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
  544|     35|    FALLTHROUGH();
  ------------------
  |  |  821|     35|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  545|       |
  546|     38|  case SOCKS4_ST_SEND:
  ------------------
  |  Branch (546:3): [True: 3, False: 67]
  ------------------
  547|     38|    presult = socks_flush(sx, cf, data, &done);
  548|     38|    if(presult)
  ------------------
  |  Branch (548:8): [True: 0, False: 38]
  ------------------
  549|      0|      return socks_failed(sx, cf, data, presult);
  550|     38|    else if(!done)
  ------------------
  |  Branch (550:13): [True: 0, False: 38]
  ------------------
  551|      0|      return CURLPX_OK;
  552|     38|    sxstate(sx, cf, data, SOCKS4_ST_RECV);
  ------------------
  |  |  162|     38|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
  553|     38|    FALLTHROUGH();
  ------------------
  |  |  821|     38|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  554|       |
  555|     46|  case SOCKS4_ST_RECV:
  ------------------
  |  Branch (555:3): [True: 8, False: 62]
  ------------------
  556|       |    /* Receive 8 byte response */
  557|     46|    presult = socks_recv(sx, cf, data, 8, &done);
  558|     46|    if(presult)
  ------------------
  |  Branch (558:8): [True: 26, False: 20]
  ------------------
  559|     26|      return socks_failed(sx, cf, data, presult);
  560|     20|    else if(!done)
  ------------------
  |  Branch (560:13): [True: 11, False: 9]
  ------------------
  561|     11|      return CURLPX_OK;
  562|      9|    presult = socks4_check_resp(sx, cf, data);
  563|      9|    if(presult)
  ------------------
  |  Branch (563:8): [True: 6, False: 3]
  ------------------
  564|      6|      return socks_failed(sx, cf, data, presult);
  565|      3|    sxstate(sx, cf, data, SOCKS_ST_SUCCESS);
  ------------------
  |  |  162|      3|#define sxstate(x, c, d, y) socksstate(x, c, d, y, __LINE__)
  ------------------
  566|      3|    FALLTHROUGH();
  ------------------
  |  |  821|      3|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  567|       |
  568|      3|  case SOCKS_ST_SUCCESS:
  ------------------
  |  Branch (568:3): [True: 0, False: 70]
  ------------------
  569|      3|    return CURLPX_OK;
  570|       |
  571|      0|  case SOCKS_ST_FAILED:
  ------------------
  |  Branch (571:3): [True: 0, False: 70]
  ------------------
  572|      0|    DEBUGASSERT(sx->presult);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (572:5): [True: 0, False: 0]
  |  Branch (572:5): [True: 0, False: 0]
  ------------------
  573|      0|    return sx->presult;
  574|       |
  575|      0|  default:
  ------------------
  |  Branch (575:3): [True: 0, False: 70]
  ------------------
  576|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (576:5): [Folded, False: 0]
  |  Branch (576:5): [Folded, False: 0]
  ------------------
  577|      0|    return socks_failed(sx, cf, data, CURLPX_SEND_REQUEST);
  578|     70|  }
  579|     70|}
socks.c:socks4_req_add_hd:
  265|     59|{
  266|     59|  unsigned char buf[4];
  267|     59|  size_t nwritten;
  268|     59|  CURLcode result;
  269|       |
  270|     59|  (void)data;
  271|     59|  buf[0] = 4; /* version (SOCKS4) */
  272|     59|  buf[1] = 1; /* connect */
  273|     59|  buf[2] = (unsigned char)((sx->dest->port >> 8) & 0xffU); /* MSB */
  274|     59|  buf[3] = (unsigned char)(sx->dest->port & 0xffU);        /* LSB */
  275|       |
  276|     59|  result = Curl_bufq_write(&sx->iobuf, buf, 4, &nwritten);
  277|     59|  if(result || (nwritten != 4))
  ------------------
  |  Branch (277:6): [True: 0, False: 59]
  |  Branch (277:16): [True: 0, False: 59]
  ------------------
  278|      0|    return CURLPX_SEND_REQUEST;
  279|     59|  return CURLPX_OK;
  280|     59|}
socks.c:socks4_req_add_user:
  284|     40|{
  285|     40|  CURLcode result;
  286|     40|  size_t nwritten;
  287|       |
  288|     40|  if(sx->creds) {
  ------------------
  |  Branch (288:6): [True: 8, False: 32]
  ------------------
  289|      8|    size_t plen = strlen(sx->creds->user);
  290|      8|    if(plen > 255) {
  ------------------
  |  Branch (290:8): [True: 2, False: 6]
  ------------------
  291|       |      /* there is no real size limit to this field in the protocol, but
  292|       |         SOCKS5 limits the proxy user field to 255 bytes and it seems likely
  293|       |         that a longer field is either a mistake or malicious input */
  294|      2|      failf(data, "Too long SOCKS proxy username");
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
  295|      2|      return CURLPX_LONG_USER;
  296|      2|    }
  297|       |    /* add proxy name WITH trailing zero */
  298|      6|    result = Curl_bufq_cwrite(&sx->iobuf, sx->creds->user, plen + 1,
  299|      6|                              &nwritten);
  300|      6|    if(result || (nwritten != (plen + 1)))
  ------------------
  |  Branch (300:8): [True: 0, False: 6]
  |  Branch (300:18): [True: 0, False: 6]
  ------------------
  301|      0|      return CURLPX_SEND_REQUEST;
  302|      6|  }
  303|     32|  else {
  304|       |    /* empty username */
  305|     32|    unsigned char b = 0;
  306|     32|    result = Curl_bufq_write(&sx->iobuf, &b, 1, &nwritten);
  307|     32|    if(result || (nwritten != 1))
  ------------------
  |  Branch (307:8): [True: 0, False: 32]
  |  Branch (307:18): [True: 0, False: 32]
  ------------------
  308|      0|      return CURLPX_SEND_REQUEST;
  309|     32|  }
  310|     38|  return CURLPX_OK;
  311|     40|}
socks.c:socks4_resolving:
  317|     55|{
  318|     55|  const struct Curl_addrinfo *ai = NULL;
  319|     55|  CURLcode result;
  320|     55|  size_t nwritten;
  321|     55|  bool dns_done;
  322|       |
  323|     55|  *done = FALSE;
  ------------------
  |  | 1058|     55|#define FALSE false
  ------------------
  324|     55|  if(sx->start_resolving) {
  ------------------
  |  Branch (324:6): [True: 55, False: 0]
  ------------------
  325|       |    /* need to resolve hostname to add destination address */
  326|     55|    sx->start_resolving = FALSE;
  ------------------
  |  | 1058|     55|#define FALSE false
  ------------------
  327|     55|    result = Curl_cf_dns_insert_after(
  328|     55|      cf, data, Curl_resolv_dns_queries(data, sx->ip_version),
  329|     55|      sx->dest, TRNSPRT_TCP, TRUE);
  ------------------
  |  |  307|     55|#define TRNSPRT_TCP  3
  ------------------
                    sx->dest, TRNSPRT_TCP, TRUE);
  ------------------
  |  | 1055|     55|#define TRUE true
  ------------------
  330|     55|    if(result) {
  ------------------
  |  Branch (330:8): [True: 0, False: 55]
  ------------------
  331|      0|      failf(data, "unable to create DNS filter for socks");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  332|      0|      return CURLPX_UNKNOWN_FAIL;
  333|      0|    }
  334|     55|  }
  335|       |
  336|       |  /* resolve the hostname by connecting the DNS filter */
  337|     55|  result = Curl_conn_cf_connect(cf->next, data, &dns_done);
  338|     55|  if(result) {
  ------------------
  |  Branch (338:6): [True: 0, False: 55]
  ------------------
  339|      0|    failf(data, "Failed to resolve \"%s\" for SOCKS4 connect.",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  340|      0|          sx->dest->hostname);
  341|      0|    return CURLPX_RESOLVE_HOST;
  342|      0|  }
  343|     55|  else if(!dns_done)
  ------------------
  |  Branch (343:11): [True: 19, False: 36]
  ------------------
  344|     19|    return CURLPX_OK;
  345|       |
  346|     36|  ai = Curl_cf_dns_get_ai(cf->next, data, AF_INET, 0);
  347|     36|  if(ai) {
  ------------------
  |  Branch (347:6): [True: 36, False: 0]
  ------------------
  348|     36|    struct sockaddr_in *saddr_in;
  349|     36|    char ipbuf[64];
  350|       |
  351|     36|    Curl_printable_address(ai, ipbuf, sizeof(ipbuf));
  352|     36|    CURL_TRC_CF(data, cf, "SOCKS4 connect to IPv4 %s (locally resolved)",
  ------------------
  |  |  153|     36|  do {                                          \
  |  |  154|     36|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     36|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|     72|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 36, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 36]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|     72|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     36|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     36|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     36|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 36]
  |  |  ------------------
  ------------------
  353|     36|                ipbuf);
  354|       |
  355|     36|    saddr_in = (struct sockaddr_in *)(void *)ai->ai_addr;
  356|     36|    result = Curl_bufq_write(&sx->iobuf,
  357|     36|                             (unsigned char *)&saddr_in->sin_addr.s_addr, 4,
  358|     36|                             &nwritten);
  359|       |
  360|     36|    if(result || (nwritten != 4))
  ------------------
  |  Branch (360:8): [True: 0, False: 36]
  |  Branch (360:18): [True: 0, False: 36]
  ------------------
  361|      0|      return CURLPX_SEND_REQUEST;
  362|     36|  }
  363|      0|  else {
  364|       |    /* No ipv4 address resolved */
  365|      0|    failf(data, "SOCKS4 connection to %s not supported", sx->dest->hostname);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  366|      0|    return CURLPX_RESOLVE_HOST;
  367|      0|  }
  368|       |
  369|     36|  *done = TRUE;
  ------------------
  |  | 1055|     36|#define TRUE true
  ------------------
  370|     36|  return CURLPX_OK;
  371|     36|}
socks.c:socks4_check_resp:
  376|      9|{
  377|      9|  const unsigned char *resp;
  378|      9|  size_t rlen;
  379|       |
  380|      9|  if(!Curl_bufq_peek(&sx->iobuf, &resp, &rlen) || rlen < 8) {
  ------------------
  |  Branch (380:6): [True: 0, False: 9]
  |  Branch (380:51): [True: 0, False: 9]
  ------------------
  381|      0|    failf(data, "SOCKS4 reply is incomplete.");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  382|      0|    return CURLPX_RECV_CONNECT;
  383|      0|  }
  384|       |
  385|      9|  DEBUGASSERT(rlen == 8);
  ------------------
  |  | 1081|      9|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (385:3): [True: 0, False: 9]
  |  Branch (385:3): [True: 9, False: 0]
  ------------------
  386|       |  /*
  387|       |   * Response format
  388|       |   *
  389|       |   *     +----+----+----+----+----+----+----+----+
  390|       |   *     | VN | CD | DSTPORT |      DSTIP        |
  391|       |   *     +----+----+----+----+----+----+----+----+
  392|       |   * # of bytes:  1    1      2              4
  393|       |   *
  394|       |   * VN is the version of the reply code and should be 0. CD is the result
  395|       |   * code with one of the following values:
  396|       |   *
  397|       |   * 90: request granted
  398|       |   * 91: request rejected or failed
  399|       |   * 92: request rejected because SOCKS server cannot connect to
  400|       |   *     identd on the client
  401|       |   * 93: request rejected because the client program and identd
  402|       |   *     report different user-ids
  403|       |   */
  404|       |
  405|       |  /* wrong version ? */
  406|      9|  if(resp[0]) {
  ------------------
  |  Branch (406:6): [True: 1, False: 8]
  ------------------
  407|      1|    failf(data, "SOCKS4 reply has wrong version, version should be 0.");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  408|      1|    return CURLPX_BAD_VERSION;
  409|      1|  }
  410|       |
  411|       |  /* Result */
  412|      8|  switch(resp[1]) {
  413|      3|  case 90:
  ------------------
  |  Branch (413:3): [True: 3, False: 5]
  ------------------
  414|      3|    CURL_TRC_CF(data, cf, "SOCKS4%s request granted.", sx->socks4a ? "a" : "");
  ------------------
  |  |  153|      3|  do {                                          \
  |  |  154|      3|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      3|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      6|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 3, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      6|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      3|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      3|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|      3|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3]
  |  |  ------------------
  ------------------
  415|      3|    Curl_bufq_skip(&sx->iobuf, 8);
  416|      3|    return CURLPX_OK;
  417|      1|  case 91:
  ------------------
  |  Branch (417:3): [True: 1, False: 7]
  ------------------
  418|      1|    failf(data,
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  419|      1|          "[SOCKS] cannot complete SOCKS4 connection to %u.%u.%u.%u:%u. (%u)"
  420|      1|          ", request rejected or failed.",
  421|      1|          resp[4], resp[5], resp[6], resp[7],
  422|      1|          (unsigned int)((resp[2] << 8) | resp[3]), resp[1]);
  423|      1|    return CURLPX_REQUEST_FAILED;
  424|      1|  case 92:
  ------------------
  |  Branch (424:3): [True: 1, False: 7]
  ------------------
  425|      1|    failf(data,
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  426|      1|          "[SOCKS] cannot complete SOCKS4 connection to %u.%u.%u.%u:%u. (%u)"
  427|      1|          ", request rejected because SOCKS server cannot connect to "
  428|      1|          "identd on the client.",
  429|      1|          resp[4], resp[5], resp[6], resp[7],
  430|      1|          (unsigned int)((resp[2] << 8) | resp[3]), resp[1]);
  431|      1|    return CURLPX_IDENTD;
  432|      1|  case 93:
  ------------------
  |  Branch (432:3): [True: 1, False: 7]
  ------------------
  433|      1|    failf(data,
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  434|      1|          "[SOCKS] cannot complete SOCKS4 connection to %u.%u.%u.%u:%u. (%u)"
  435|      1|          ", request rejected because the client program and identd "
  436|      1|          "report different user-ids.",
  437|      1|          resp[4], resp[5], resp[6], resp[7],
  438|      1|          (unsigned int)((resp[2] << 8) | resp[3]), resp[1]);
  439|      1|    return CURLPX_IDENTD_DIFFER;
  440|      2|  default:
  ------------------
  |  Branch (440:3): [True: 2, False: 6]
  ------------------
  441|      2|    failf(data,
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
  442|      2|          "[SOCKS] cannot complete SOCKS4 connection to %u.%u.%u.%u:%u. (%u)"
  443|      2|          ", Unknown.",
  444|      2|          resp[4], resp[5], resp[6], resp[7],
  445|      2|          (unsigned int)((resp[2] << 8) | resp[3]), resp[1]);
  446|      2|    return CURLPX_UNKNOWN_FAIL;
  447|      8|  }
  448|      8|}
socks.c:socks_proxy_cf_close:
 1294|    104|{
 1295|    104|  cf->connected = FALSE;
  ------------------
  |  | 1058|    104|#define FALSE false
  ------------------
 1296|    104|  if(cf->next)
  ------------------
  |  Branch (1296:6): [True: 104, False: 0]
  ------------------
 1297|    104|    cf->next->cft->do_close(cf->next, data);
 1298|    104|}
socks.c:socks_cf_adjust_pollset:
 1267|     99|{
 1268|     99|  struct socks_ctx *sx = cf->ctx;
 1269|     99|  CURLcode result = CURLE_OK;
 1270|       |
 1271|     99|  if(!cf->connected && sx) {
  ------------------
  |  Branch (1271:6): [True: 55, False: 44]
  |  Branch (1271:24): [True: 55, False: 0]
  ------------------
 1272|       |    /* If we are not connected, the filter below is and has nothing
 1273|       |     * to wait on, we determine what to wait for. */
 1274|     55|    curl_socket_t sock = Curl_conn_cf_get_socket(cf, data);
 1275|     55|    switch(sx->state) {
 1276|      0|    case SOCKS4_ST_SEND:
  ------------------
  |  Branch (1276:5): [True: 0, False: 55]
  ------------------
 1277|      0|    case SOCKS5_ST_REQ0_SEND:
  ------------------
  |  Branch (1277:5): [True: 0, False: 55]
  ------------------
 1278|      0|    case SOCKS5_ST_AUTH_SEND:
  ------------------
  |  Branch (1278:5): [True: 0, False: 55]
  ------------------
 1279|      0|    case SOCKS5_ST_REQ1_SEND:
  ------------------
  |  Branch (1279:5): [True: 0, False: 55]
  ------------------
 1280|      0|      CURL_TRC_CF(data, cf, "adjust pollset out (%d)", sx->state);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1281|      0|      result = Curl_pollset_set_out_only(data, ps, sock);
  ------------------
  |  |  174|      0|  Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  284|      0|#define CURL_POLL_OUT    2
  |  |  ------------------
  |  |                 Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  283|      0|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
 1282|      0|      break;
 1283|     55|    default:
  ------------------
  |  Branch (1283:5): [True: 55, False: 0]
  ------------------
 1284|     55|      CURL_TRC_CF(data, cf, "adjust pollset in (%d)", sx->state);
  ------------------
  |  |  153|     55|  do {                                          \
  |  |  154|     55|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|     55|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    110|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 55, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 55]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    110|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|     55|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     55|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     55|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 55]
  |  |  ------------------
  ------------------
 1285|     55|      result = Curl_pollset_set_in_only(data, ps, sock);
  ------------------
  |  |  172|     55|  Curl_pollset_change(data, ps, sock, CURL_POLL_IN, CURL_POLL_OUT)
  |  |  ------------------
  |  |  |  |  283|     55|#define CURL_POLL_IN     1
  |  |  ------------------
  |  |                 Curl_pollset_change(data, ps, sock, CURL_POLL_IN, CURL_POLL_OUT)
  |  |  ------------------
  |  |  |  |  284|     55|#define CURL_POLL_OUT    2
  |  |  ------------------
  ------------------
 1286|     55|      break;
 1287|     55|    }
 1288|     55|  }
 1289|     99|  return result;
 1290|     99|}
socks.c:socks_cf_query:
 1311|   144k|{
 1312|   144k|  struct socks_ctx *sx = cf->ctx;
 1313|       |
 1314|   144k|  switch(query) {
 1315|      0|  case CF_QUERY_HOST_PORT:
  ------------------
  |  |  177|      0|#define CF_QUERY_HOST_PORT         11  /* port       const char * */
  ------------------
  |  Branch (1315:3): [True: 0, False: 144k]
  ------------------
 1316|      0|    if(sx) {
  ------------------
  |  Branch (1316:8): [True: 0, False: 0]
  ------------------
 1317|      0|      *pres1 = sx->dest->port;
 1318|      0|      *((const char **)pres2) = sx->dest->hostname;
 1319|      0|      return CURLE_OK;
 1320|      0|    }
 1321|      0|    break;
 1322|      2|  case CF_QUERY_ALPN_NEGOTIATED: {
  ------------------
  |  |  181|      2|#define CF_QUERY_ALPN_NEGOTIATED   15  /* -          const char * */
  ------------------
  |  Branch (1322:3): [True: 2, False: 144k]
  ------------------
 1323|      2|    const char **palpn = pres2;
 1324|      2|    DEBUGASSERT(palpn);
  ------------------
  |  | 1081|      2|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1324:5): [True: 0, False: 2]
  |  Branch (1324:5): [True: 2, False: 0]
  ------------------
 1325|      2|    *palpn = NULL;
 1326|      2|    return CURLE_OK;
 1327|      2|  }
 1328|   144k|  default:
  ------------------
  |  Branch (1328:3): [True: 144k, False: 2]
  ------------------
 1329|   144k|    break;
 1330|   144k|  }
 1331|   144k|  return cf->next ?
  ------------------
  |  Branch (1331:10): [True: 144k, False: 0]
  ------------------
 1332|   144k|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
 1333|   144k|    CURLE_UNKNOWN_OPTION;
 1334|   144k|}
socks.c:socks_proxy_ctx_free:
 1181|    104|{
 1182|    104|  if(ctx) {
  ------------------
  |  Branch (1182:6): [True: 104, False: 0]
  ------------------
 1183|    104|    Curl_peer_unlink(&ctx->dest);
 1184|    104|    Curl_creds_unlink(&ctx->creds);
 1185|    104|    Curl_bufq_free(&ctx->iobuf);
 1186|    104|    curlx_free(ctx);
  ------------------
  |  | 1483|    104|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1187|    104|  }
 1188|    104|}

Curl_splay:
   43|  3.82M|{
   44|  3.82M|  struct Curl_tree N, *l, *r, *y;
   45|       |
   46|  3.82M|  if(!t)
  ------------------
  |  Branch (46:6): [True: 0, False: 3.82M]
  ------------------
   47|      0|    return NULL;
   48|  3.82M|  N.smaller = N.larger = NULL;
   49|  3.82M|  l = r = &N;
   50|       |
   51|  3.97M|  for(;;) {
   52|  3.97M|    timediff_t comp = splay_compare(pkey, &t->key);
  ------------------
  |  |   35|  3.97M|#define splay_compare(i, j) curlx_ptimediff_us(i, j)
  ------------------
   53|  3.97M|    if(comp < 0) {
  ------------------
  |  Branch (53:8): [True: 3.57M, False: 397k]
  ------------------
   54|  3.57M|      if(!t->smaller)
  ------------------
  |  Branch (54:10): [True: 3.50M, False: 77.7k]
  ------------------
   55|  3.50M|        break;
   56|  77.7k|      if(splay_compare(pkey, &t->smaller->key) < 0) {
  ------------------
  |  |   35|  77.7k|#define splay_compare(i, j) curlx_ptimediff_us(i, j)
  ------------------
  |  Branch (56:10): [True: 77.2k, False: 573]
  ------------------
   57|  77.2k|        y = t->smaller;                           /* rotate smaller */
   58|  77.2k|        t->smaller = y->larger;
   59|  77.2k|        y->larger = t;
   60|  77.2k|        t = y;
   61|  77.2k|        if(!t->smaller)
  ------------------
  |  Branch (61:12): [True: 5.25k, False: 71.9k]
  ------------------
   62|  5.25k|          break;
   63|  77.2k|      }
   64|  72.5k|      r->smaller = t;                               /* link smaller */
   65|  72.5k|      r = t;
   66|  72.5k|      t = t->smaller;
   67|  72.5k|    }
   68|   397k|    else if(comp > 0) {
  ------------------
  |  Branch (68:13): [True: 232k, False: 164k]
  ------------------
   69|   232k|      if(!t->larger)
  ------------------
  |  Branch (69:10): [True: 150k, False: 82.5k]
  ------------------
   70|   150k|        break;
   71|  82.5k|      if(splay_compare(pkey, &t->larger->key) > 0) {
  ------------------
  |  |   35|  82.5k|#define splay_compare(i, j) curlx_ptimediff_us(i, j)
  ------------------
  |  Branch (71:10): [True: 72.4k, False: 10.1k]
  ------------------
   72|  72.4k|        y = t->larger;                          /* rotate larger */
   73|  72.4k|        t->larger = y->smaller;
   74|  72.4k|        y->smaller = t;
   75|  72.4k|        t = y;
   76|  72.4k|        if(!t->larger)
  ------------------
  |  Branch (76:12): [True: 743, False: 71.7k]
  ------------------
   77|    743|          break;
   78|  72.4k|      }
   79|  81.8k|      l->larger = t;                              /* link larger */
   80|  81.8k|      l = t;
   81|  81.8k|      t = t->larger;
   82|  81.8k|    }
   83|   164k|    else
   84|   164k|      break;
   85|  3.97M|  }
   86|       |
   87|  3.82M|  l->larger = t->smaller;                                /* assemble */
   88|  3.82M|  r->smaller = t->larger;
   89|  3.82M|  t->smaller = N.larger;
   90|  3.82M|  t->larger = N.smaller;
   91|       |
   92|  3.82M|  return t;
   93|  3.82M|}
Curl_splayinsert:
  107|   164k|{
  108|   164k|  DEBUGASSERT(node);
  ------------------
  |  | 1081|   164k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (108:3): [True: 0, False: 164k]
  |  Branch (108:3): [True: 164k, False: 0]
  ------------------
  109|       |
  110|   164k|  if(t) {
  ------------------
  |  Branch (110:6): [True: 77.8k, False: 86.8k]
  ------------------
  111|  77.8k|    t = Curl_splay(pkey, t);
  112|  77.8k|    DEBUGASSERT(t);
  ------------------
  |  | 1081|  77.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (112:5): [True: 0, False: 77.8k]
  |  Branch (112:5): [True: 77.8k, False: 0]
  ------------------
  113|  77.8k|    if(splay_compare(pkey, &t->key) == 0) {
  ------------------
  |  |   35|  77.8k|#define splay_compare(i, j) curlx_ptimediff_us(i, j)
  ------------------
  |  Branch (113:8): [True: 68, False: 77.7k]
  ------------------
  114|       |      /* There already exists a node in the tree with the same key. Build a
  115|       |         doubly-linked circular list of nodes. We add the new 'node' struct to
  116|       |         the end of this list. */
  117|       |
  118|     68|      node->key = SPLAY_SUBNODE; /* identify this node as a subnode */
  119|     68|      node->samen = t;
  120|     68|      node->samep = t->samep;
  121|     68|      t->samep->samen = node;
  122|     68|      t->samep = node;
  123|       |
  124|     68|      return t; /* the root node always stays the same */
  125|     68|    }
  126|  77.8k|  }
  127|       |
  128|   164k|  if(!t) {
  ------------------
  |  Branch (128:6): [True: 86.8k, False: 77.7k]
  ------------------
  129|  86.8k|    node->smaller = node->larger = NULL;
  130|  86.8k|  }
  131|  77.7k|  else if(splay_compare(pkey, &t->key) < 0) {
  ------------------
  |  |   35|  77.7k|#define splay_compare(i, j) curlx_ptimediff_us(i, j)
  ------------------
  |  Branch (131:11): [True: 4.61k, False: 73.1k]
  ------------------
  132|  4.61k|    node->smaller = t->smaller;
  133|  4.61k|    node->larger = t;
  134|  4.61k|    t->smaller = NULL;
  135|  4.61k|  }
  136|  73.1k|  else {
  137|  73.1k|    node->larger = t->larger;
  138|  73.1k|    node->smaller = t;
  139|  73.1k|    t->larger = NULL;
  140|  73.1k|  }
  141|   164k|  node->key = *pkey;
  142|       |
  143|       |  /* no identical nodes (yet), we are the only one in the list of nodes */
  144|   164k|  node->samen = node;
  145|   164k|  node->samep = node;
  146|   164k|  return node;
  147|   164k|}
Curl_splaygetbest:
  155|  3.50M|{
  156|  3.50M|  static const struct curltime tv_zero = { 0, 0 };
  157|  3.50M|  struct Curl_tree *x;
  158|       |
  159|  3.50M|  if(!t) {
  ------------------
  |  Branch (159:6): [True: 0, False: 3.50M]
  ------------------
  160|      0|    *removed = NULL; /* none removed since there was no root */
  161|      0|    return NULL;
  162|      0|  }
  163|       |
  164|       |  /* find smallest */
  165|  3.50M|  t = Curl_splay(&tv_zero, t);
  166|  3.50M|  DEBUGASSERT(t);
  ------------------
  |  | 1081|  3.50M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (166:3): [True: 0, False: 3.50M]
  |  Branch (166:3): [True: 3.50M, False: 0]
  ------------------
  167|  3.50M|  if(splay_compare(pkey, &t->key) < 0) {
  ------------------
  |  |   35|  3.50M|#define splay_compare(i, j) curlx_ptimediff_us(i, j)
  ------------------
  |  Branch (167:6): [True: 3.50M, False: 11]
  ------------------
  168|       |    /* even the smallest is too big */
  169|  3.50M|    *removed = NULL;
  170|  3.50M|    return t;
  171|  3.50M|  }
  172|       |
  173|       |  /* FIRST! Check if there is a list with identical keys */
  174|     11|  x = t->samen;
  175|     11|  if(x != t) {
  ------------------
  |  Branch (175:6): [True: 0, False: 11]
  ------------------
  176|       |    /* there is, pick one from the list */
  177|       |
  178|       |    /* 'x' is the new root node */
  179|       |
  180|      0|    x->key = t->key;
  181|      0|    x->larger = t->larger;
  182|      0|    x->smaller = t->smaller;
  183|      0|    x->samep = t->samep;
  184|      0|    t->samep->samen = x;
  185|       |
  186|      0|    *removed = t;
  187|      0|    return x; /* new root */
  188|      0|  }
  189|       |
  190|       |  /* we splayed the tree to the smallest element, there is no smaller */
  191|     11|  x = t->larger;
  192|     11|  *removed = t;
  193|       |
  194|     11|  return x;
  195|     11|}
Curl_splayremove:
  211|   164k|{
  212|   164k|  struct Curl_tree *x;
  213|       |
  214|   164k|  if(!t)
  ------------------
  |  Branch (214:6): [True: 0, False: 164k]
  ------------------
  215|      0|    return 1;
  216|       |
  217|   164k|  DEBUGASSERT(removenode);
  ------------------
  |  | 1081|   164k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (217:3): [True: 0, False: 164k]
  |  Branch (217:3): [True: 164k, False: 0]
  ------------------
  218|       |
  219|   164k|  if(splay_compare(&SPLAY_SUBNODE, &removenode->key) == 0) {
  ------------------
  |  |   35|   164k|#define splay_compare(i, j) curlx_ptimediff_us(i, j)
  ------------------
  |  Branch (219:6): [True: 68, False: 164k]
  ------------------
  220|       |    /* It is a subnode within a 'same' linked list and thus we can unlink it
  221|       |       easily. */
  222|     68|    DEBUGASSERT(removenode->samen != removenode);
  ------------------
  |  | 1081|     68|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (222:5): [True: 0, False: 68]
  |  Branch (222:5): [True: 68, False: 0]
  ------------------
  223|     68|    if(removenode->samen == removenode)
  ------------------
  |  Branch (223:8): [True: 0, False: 68]
  ------------------
  224|       |      /* A non-subnode should never be set to SPLAY_SUBNODE */
  225|      0|      return 3;
  226|       |
  227|     68|    removenode->samep->samen = removenode->samen;
  228|     68|    removenode->samen->samep = removenode->samep;
  229|       |
  230|       |    /* Ensures that double-remove gets caught. */
  231|     68|    removenode->samen = removenode;
  232|       |
  233|     68|    *newroot = t; /* return the same root */
  234|     68|    return 0;
  235|     68|  }
  236|       |
  237|   164k|  t = Curl_splay(&removenode->key, t);
  238|   164k|  DEBUGASSERT(t);
  ------------------
  |  | 1081|   164k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (238:3): [True: 0, False: 164k]
  |  Branch (238:3): [True: 164k, False: 0]
  ------------------
  239|       |
  240|       |  /* First make sure that we got the same root node as the one we want
  241|       |     to remove, as otherwise we might be trying to remove a node that
  242|       |     is not actually in the tree.
  243|       |
  244|       |     We cannot compare the keys here as a double remove in quick
  245|       |     succession of a node with key != SPLAY_SUBNODE && same != NULL
  246|       |     could return the same key but a different node. */
  247|   164k|  DEBUGASSERT(t == removenode);
  ------------------
  |  | 1081|   164k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (247:3): [True: 0, False: 164k]
  |  Branch (247:3): [True: 164k, False: 0]
  ------------------
  248|   164k|  if(t != removenode)
  ------------------
  |  Branch (248:6): [True: 0, False: 164k]
  ------------------
  249|      0|    return 2;
  250|       |
  251|       |  /* Check if there is a list with identical sizes, as then we are trying to
  252|       |     remove the root node of a list of nodes with identical keys. */
  253|   164k|  x = t->samen;
  254|   164k|  if(x != t) {
  ------------------
  |  Branch (254:6): [True: 0, False: 164k]
  ------------------
  255|       |    /* 'x' is the new root node, we make it use the root node's
  256|       |       smaller/larger links */
  257|       |
  258|      0|    x->key = t->key;
  259|      0|    x->larger = t->larger;
  260|      0|    x->smaller = t->smaller;
  261|      0|    x->samep = t->samep;
  262|      0|    t->samep->samen = x;
  263|      0|  }
  264|   164k|  else {
  265|       |    /* Remove the root node */
  266|   164k|    if(!t->smaller)
  ------------------
  |  Branch (266:8): [True: 86.8k, False: 77.7k]
  ------------------
  267|  86.8k|      x = t->larger;
  268|  77.7k|    else {
  269|  77.7k|      x = Curl_splay(&removenode->key, t->smaller);
  270|  77.7k|      DEBUGASSERT(x);
  ------------------
  |  | 1081|  77.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (270:7): [True: 0, False: 77.7k]
  |  Branch (270:7): [True: 77.7k, False: 0]
  ------------------
  271|  77.7k|      x->larger = t->larger;
  272|  77.7k|    }
  273|   164k|  }
  274|       |
  275|   164k|  *newroot = x; /* store new root pointer */
  276|       |
  277|   164k|  return 0;
  278|   164k|}
Curl_splayset:
  282|   164k|{
  283|   164k|  DEBUGASSERT(node);
  ------------------
  |  | 1081|   164k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (283:3): [True: 0, False: 164k]
  |  Branch (283:3): [True: 164k, False: 0]
  ------------------
  284|   164k|  node->ptr = payload;
  285|   164k|}
Curl_splayget:
  288|     11|{
  289|     11|  DEBUGASSERT(node);
  ------------------
  |  | 1081|     11|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (289:3): [True: 0, False: 11]
  |  Branch (289:3): [True: 11, False: 0]
  ------------------
  290|     11|  return node->ptr;
  291|     11|}

Curl_raw_toupper:
   75|  4.40M|{
   76|  4.40M|  return (char)touppermap[(unsigned char)in];
   77|  4.40M|}
Curl_raw_tolower:
   82|  5.75M|{
   83|  5.75M|  return (char)tolowermap[(unsigned char)in];
   84|  5.75M|}
Curl_strntoupper:
   92|  10.8k|{
   93|  10.8k|  if(n < 1)
  ------------------
  |  Branch (93:6): [True: 0, False: 10.8k]
  ------------------
   94|      0|    return;
   95|       |
   96|  85.3k|  do {
   97|  85.3k|    *dest++ = Curl_raw_toupper(*src);
   98|  85.3k|  } while(*src++ && --n);
  ------------------
  |  Branch (98:11): [True: 80.5k, False: 4.80k]
  |  Branch (98:21): [True: 74.5k, False: 6.05k]
  ------------------
   99|  10.8k|}
Curl_strntolower:
  107|   515k|{
  108|   515k|  if(n < 1)
  ------------------
  |  Branch (108:6): [True: 3.24k, False: 512k]
  ------------------
  109|  3.24k|    return;
  110|       |
  111|  5.42M|  do {
  112|  5.42M|    *dest++ = Curl_raw_tolower(*src);
  113|  5.42M|  } while(*src++ && --n);
  ------------------
  |  Branch (113:11): [True: 5.42M, False: 0]
  |  Branch (113:21): [True: 4.91M, False: 512k]
  ------------------
  114|   512k|}
Curl_safecmp:
  120|  8.76k|{
  121|  8.76k|  if(a && b)
  ------------------
  |  Branch (121:6): [True: 806, False: 7.95k]
  |  Branch (121:11): [True: 806, False: 0]
  ------------------
  122|    806|    return !strcmp(a, b);
  123|  7.95k|  return !a && !b;
  ------------------
  |  Branch (123:10): [True: 7.95k, False: 0]
  |  Branch (123:16): [True: 8, False: 7.94k]
  ------------------
  124|  8.76k|}
Curl_timestrcmp:
  131|  1.77k|{
  132|  1.77k|  int match = 0;
  133|  1.77k|  int i = 0;
  134|       |
  135|  1.77k|  if(a && b) {
  ------------------
  |  Branch (135:6): [True: 1.55k, False: 214]
  |  Branch (135:11): [True: 1.55k, False: 0]
  ------------------
  136|  4.95k|    while(1) {
  ------------------
  |  Branch (136:11): [True: 4.95k, Folded]
  ------------------
  137|  4.95k|      match |= a[i] ^ b[i];
  138|  4.95k|      if(!a[i] || !b[i])
  ------------------
  |  Branch (138:10): [True: 1.55k, False: 3.39k]
  |  Branch (138:19): [True: 0, False: 3.39k]
  ------------------
  139|  1.55k|        break;
  140|  3.39k|      i++;
  141|  3.39k|    }
  142|  1.55k|  }
  143|    214|  else
  144|    214|    return a || b;
  ------------------
  |  Branch (144:12): [True: 0, False: 214]
  |  Branch (144:17): [True: 0, False: 214]
  ------------------
  145|  1.55k|  return match;
  146|  1.77k|}

curl_strequal:
   77|   270k|{
   78|   270k|  if(s1 && s2)
  ------------------
  |  Branch (78:6): [True: 267k, False: 2.77k]
  |  Branch (78:12): [True: 267k, False: 0]
  ------------------
   79|       |    /* both pointers point to something then compare them */
   80|   267k|    return casecompare(s1, s2);
   81|       |
   82|       |  /* if both pointers are NULL then treat them as equal */
   83|  2.77k|  return NULL == s1 && NULL == s2;
  ------------------
  |  Branch (83:10): [True: 2.77k, False: 0]
  |  Branch (83:24): [True: 2.76k, False: 11]
  ------------------
   84|   270k|}
curl_strnequal:
   88|   774k|{
   89|   774k|  if(s1 && s2)
  ------------------
  |  Branch (89:6): [True: 774k, False: 0]
  |  Branch (89:12): [True: 774k, False: 0]
  ------------------
   90|       |    /* both pointers point to something then compare them */
   91|   774k|    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|   774k|}
strequal.c:casecompare:
   36|   267k|{
   37|   368k|  while(*first) {
  ------------------
  |  Branch (37:9): [True: 353k, False: 14.2k]
  ------------------
   38|   353k|    if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second))
  ------------------
  |  Branch (38:8): [True: 253k, False: 100k]
  ------------------
   39|       |      /* get out of the loop as soon as they do not match */
   40|   253k|      return 0;
   41|   100k|    first++;
   42|   100k|    second++;
   43|   100k|  }
   44|       |  /* If we are here either the strings are the same or the length is different.
   45|       |     We can test if the "current" character is non-zero for one and zero
   46|       |     for the other. Note that the characters may not be exactly the same even
   47|       |     if they match, we only want to compare zero-ness. */
   48|  14.2k|  return !*first == !*second;
   49|   267k|}
strequal.c:ncasecompare:
   52|   774k|{
   53|  1.93M|  while(*first && max) {
  ------------------
  |  Branch (53:9): [True: 1.77M, False: 155k]
  |  Branch (53:19): [True: 1.72M, False: 49.3k]
  ------------------
   54|  1.72M|    if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second))
  ------------------
  |  Branch (54:8): [True: 569k, False: 1.15M]
  ------------------
   55|   569k|      return 0;
   56|  1.15M|    max--;
   57|  1.15M|    first++;
   58|  1.15M|    second++;
   59|  1.15M|  }
   60|   204k|  if(max == 0)
  ------------------
  |  Branch (60:6): [True: 180k, False: 23.6k]
  ------------------
   61|   180k|    return 1; /* they are equal this far */
   62|       |
   63|  23.6k|  return Curl_raw_toupper(*first) == Curl_raw_toupper(*second);
   64|   204k|}

curl_easy_strerror:
   35|    195|{
   36|    195|#ifdef CURLVERBOSE
   37|    195|  switch(error) {
   38|      0|  case CURLE_OK:
  ------------------
  |  Branch (38:3): [True: 0, False: 195]
  ------------------
   39|      0|    return "No error";
   40|       |
   41|      0|  case CURLE_UNSUPPORTED_PROTOCOL:
  ------------------
  |  Branch (41:3): [True: 0, False: 195]
  ------------------
   42|      0|    return "Unsupported protocol";
   43|       |
   44|      0|  case CURLE_FAILED_INIT:
  ------------------
  |  Branch (44:3): [True: 0, False: 195]
  ------------------
   45|      0|    return "Failed initialization";
   46|       |
   47|      0|  case CURLE_URL_MALFORMAT:
  ------------------
  |  Branch (47:3): [True: 0, False: 195]
  ------------------
   48|      0|    return "URL using bad/illegal format or missing URL";
   49|       |
   50|      0|  case CURLE_NOT_BUILT_IN:
  ------------------
  |  Branch (50:3): [True: 0, False: 195]
  ------------------
   51|      0|    return "A requested feature, protocol or option was not found built-in in"
   52|      0|           " this libcurl due to a build-time decision.";
   53|       |
   54|      0|  case CURLE_COULDNT_RESOLVE_PROXY:
  ------------------
  |  Branch (54:3): [True: 0, False: 195]
  ------------------
   55|      0|    return "Could not resolve proxy name";
   56|       |
   57|      0|  case CURLE_COULDNT_RESOLVE_HOST:
  ------------------
  |  Branch (57:3): [True: 0, False: 195]
  ------------------
   58|      0|    return "Could not resolve hostname";
   59|       |
   60|    110|  case CURLE_COULDNT_CONNECT:
  ------------------
  |  Branch (60:3): [True: 110, False: 85]
  ------------------
   61|    110|    return "Could not connect to server";
   62|       |
   63|      0|  case CURLE_WEIRD_SERVER_REPLY:
  ------------------
  |  Branch (63:3): [True: 0, False: 195]
  ------------------
   64|      0|    return "Weird server reply";
   65|       |
   66|      0|  case CURLE_REMOTE_ACCESS_DENIED:
  ------------------
  |  Branch (66:3): [True: 0, False: 195]
  ------------------
   67|      0|    return "Access denied to remote resource";
   68|       |
   69|      0|  case CURLE_FTP_ACCEPT_FAILED:
  ------------------
  |  Branch (69:3): [True: 0, False: 195]
  ------------------
   70|      0|    return "FTP: The server failed to connect to data port";
   71|       |
   72|      0|  case CURLE_FTP_ACCEPT_TIMEOUT:
  ------------------
  |  Branch (72:3): [True: 0, False: 195]
  ------------------
   73|      0|    return "FTP: Accepting server connect has timed out";
   74|       |
   75|      0|  case CURLE_FTP_PRET_FAILED:
  ------------------
  |  Branch (75:3): [True: 0, False: 195]
  ------------------
   76|      0|    return "FTP: The server did not accept the PRET command.";
   77|       |
   78|      0|  case CURLE_FTP_WEIRD_PASS_REPLY:
  ------------------
  |  Branch (78:3): [True: 0, False: 195]
  ------------------
   79|      0|    return "FTP: unknown PASS reply";
   80|       |
   81|      0|  case CURLE_FTP_WEIRD_PASV_REPLY:
  ------------------
  |  Branch (81:3): [True: 0, False: 195]
  ------------------
   82|      0|    return "FTP: unknown PASV reply";
   83|       |
   84|      0|  case CURLE_FTP_WEIRD_227_FORMAT:
  ------------------
  |  Branch (84:3): [True: 0, False: 195]
  ------------------
   85|      0|    return "FTP: unknown 227 response format";
   86|       |
   87|      0|  case CURLE_FTP_CANT_GET_HOST:
  ------------------
  |  Branch (87:3): [True: 0, False: 195]
  ------------------
   88|      0|    return "FTP: cannot figure out the host in the PASV response";
   89|       |
   90|      0|  case CURLE_HTTP2:
  ------------------
  |  Branch (90:3): [True: 0, False: 195]
  ------------------
   91|      0|    return "Error in the HTTP2 framing layer";
   92|       |
   93|      0|  case CURLE_FTP_COULDNT_SET_TYPE:
  ------------------
  |  Branch (93:3): [True: 0, False: 195]
  ------------------
   94|      0|    return "FTP: could not set file type";
   95|       |
   96|      0|  case CURLE_PARTIAL_FILE:
  ------------------
  |  Branch (96:3): [True: 0, False: 195]
  ------------------
   97|      0|    return "Transferred a partial file";
   98|       |
   99|      0|  case CURLE_FTP_COULDNT_RETR_FILE:
  ------------------
  |  Branch (99:3): [True: 0, False: 195]
  ------------------
  100|      0|    return "FTP: could not retrieve (RETR failed) the specified file";
  101|       |
  102|      0|  case CURLE_QUOTE_ERROR:
  ------------------
  |  Branch (102:3): [True: 0, False: 195]
  ------------------
  103|      0|    return "Quote command returned error";
  104|       |
  105|      0|  case CURLE_HTTP_RETURNED_ERROR:
  ------------------
  |  Branch (105:3): [True: 0, False: 195]
  ------------------
  106|      0|    return "HTTP response code said error";
  107|       |
  108|      0|  case CURLE_WRITE_ERROR:
  ------------------
  |  Branch (108:3): [True: 0, False: 195]
  ------------------
  109|      0|    return "Failed writing received data to disk/application";
  110|       |
  111|      0|  case CURLE_UPLOAD_FAILED:
  ------------------
  |  Branch (111:3): [True: 0, False: 195]
  ------------------
  112|      0|    return "Upload failed (at start/before it took off)";
  113|       |
  114|      0|  case CURLE_READ_ERROR:
  ------------------
  |  Branch (114:3): [True: 0, False: 195]
  ------------------
  115|      0|    return "Failed to open/read local data from file/application";
  116|       |
  117|      0|  case CURLE_OUT_OF_MEMORY:
  ------------------
  |  Branch (117:3): [True: 0, False: 195]
  ------------------
  118|      0|    return "Out of memory";
  119|       |
  120|      0|  case CURLE_OPERATION_TIMEDOUT:
  ------------------
  |  Branch (120:3): [True: 0, False: 195]
  ------------------
  121|      0|    return "Timeout was reached";
  122|       |
  123|      0|  case CURLE_FTP_PORT_FAILED:
  ------------------
  |  Branch (123:3): [True: 0, False: 195]
  ------------------
  124|      0|    return "FTP: command PORT failed";
  125|       |
  126|      0|  case CURLE_FTP_COULDNT_USE_REST:
  ------------------
  |  Branch (126:3): [True: 0, False: 195]
  ------------------
  127|      0|    return "FTP: command REST failed";
  128|       |
  129|      0|  case CURLE_RANGE_ERROR:
  ------------------
  |  Branch (129:3): [True: 0, False: 195]
  ------------------
  130|      0|    return "Requested range was not delivered by the server";
  131|       |
  132|      0|  case CURLE_SSL_CONNECT_ERROR:
  ------------------
  |  Branch (132:3): [True: 0, False: 195]
  ------------------
  133|      0|    return "SSL connect error";
  134|       |
  135|      0|  case CURLE_BAD_DOWNLOAD_RESUME:
  ------------------
  |  Branch (135:3): [True: 0, False: 195]
  ------------------
  136|      0|    return "Could not resume download";
  137|       |
  138|      0|  case CURLE_FILE_COULDNT_READ_FILE:
  ------------------
  |  Branch (138:3): [True: 0, False: 195]
  ------------------
  139|      0|    return "Could not read a file:// file";
  140|       |
  141|      0|  case CURLE_LDAP_CANNOT_BIND:
  ------------------
  |  Branch (141:3): [True: 0, False: 195]
  ------------------
  142|      0|    return "LDAP: cannot bind";
  143|       |
  144|      0|  case CURLE_LDAP_SEARCH_FAILED:
  ------------------
  |  Branch (144:3): [True: 0, False: 195]
  ------------------
  145|      0|    return "LDAP: search failed";
  146|       |
  147|      0|  case CURLE_ABORTED_BY_CALLBACK:
  ------------------
  |  Branch (147:3): [True: 0, False: 195]
  ------------------
  148|      0|    return "Operation was aborted by an application callback";
  149|       |
  150|      1|  case CURLE_BAD_FUNCTION_ARGUMENT:
  ------------------
  |  Branch (150:3): [True: 1, False: 194]
  ------------------
  151|      1|    return "A libcurl function was given a bad argument";
  152|       |
  153|     84|  case CURLE_INTERFACE_FAILED:
  ------------------
  |  Branch (153:3): [True: 84, False: 111]
  ------------------
  154|     84|    return "Failed binding local connection end";
  155|       |
  156|      0|  case CURLE_TOO_MANY_REDIRECTS:
  ------------------
  |  Branch (156:3): [True: 0, False: 195]
  ------------------
  157|      0|    return "Number of redirects hit maximum amount";
  158|       |
  159|      0|  case CURLE_UNKNOWN_OPTION:
  ------------------
  |  Branch (159:3): [True: 0, False: 195]
  ------------------
  160|      0|    return "An unknown option was passed in to libcurl";
  161|       |
  162|      0|  case CURLE_SETOPT_OPTION_SYNTAX:
  ------------------
  |  Branch (162:3): [True: 0, False: 195]
  ------------------
  163|      0|    return "Malformed option provided in a setopt";
  164|       |
  165|      0|  case CURLE_GOT_NOTHING:
  ------------------
  |  Branch (165:3): [True: 0, False: 195]
  ------------------
  166|      0|    return "Server returned nothing (no headers, no data)";
  167|       |
  168|      0|  case CURLE_SSL_ENGINE_NOTFOUND:
  ------------------
  |  Branch (168:3): [True: 0, False: 195]
  ------------------
  169|      0|    return "SSL crypto engine not found";
  170|       |
  171|      0|  case CURLE_SSL_ENGINE_SETFAILED:
  ------------------
  |  Branch (171:3): [True: 0, False: 195]
  ------------------
  172|      0|    return "Can not set SSL crypto engine as default";
  173|       |
  174|      0|  case CURLE_SSL_ENGINE_INITFAILED:
  ------------------
  |  Branch (174:3): [True: 0, False: 195]
  ------------------
  175|      0|    return "Failed to initialize SSL crypto engine";
  176|       |
  177|      0|  case CURLE_SEND_ERROR:
  ------------------
  |  Branch (177:3): [True: 0, False: 195]
  ------------------
  178|      0|    return "Failed sending data to the peer";
  179|       |
  180|      0|  case CURLE_RECV_ERROR:
  ------------------
  |  Branch (180:3): [True: 0, False: 195]
  ------------------
  181|      0|    return "Failure when receiving data from the peer";
  182|       |
  183|      0|  case CURLE_SSL_CERTPROBLEM:
  ------------------
  |  Branch (183:3): [True: 0, False: 195]
  ------------------
  184|      0|    return "Problem with the local SSL certificate";
  185|       |
  186|      0|  case CURLE_SSL_CIPHER:
  ------------------
  |  Branch (186:3): [True: 0, False: 195]
  ------------------
  187|      0|    return "Could not use specified SSL cipher";
  188|       |
  189|      0|  case CURLE_PEER_FAILED_VERIFICATION:
  ------------------
  |  Branch (189:3): [True: 0, False: 195]
  ------------------
  190|      0|    return "SSL peer certificate or SSH remote key was not OK";
  191|       |
  192|      0|  case CURLE_SSL_CACERT_BADFILE:
  ------------------
  |  Branch (192:3): [True: 0, False: 195]
  ------------------
  193|      0|    return "Problem with the SSL CA cert (path? access rights?)";
  194|       |
  195|      0|  case CURLE_BAD_CONTENT_ENCODING:
  ------------------
  |  Branch (195:3): [True: 0, False: 195]
  ------------------
  196|      0|    return "Unrecognized or bad HTTP Content or Transfer-Encoding";
  197|       |
  198|      0|  case CURLE_FILESIZE_EXCEEDED:
  ------------------
  |  Branch (198:3): [True: 0, False: 195]
  ------------------
  199|      0|    return "Maximum file size exceeded";
  200|       |
  201|      0|  case CURLE_USE_SSL_FAILED:
  ------------------
  |  Branch (201:3): [True: 0, False: 195]
  ------------------
  202|      0|    return "Requested SSL level failed";
  203|       |
  204|      0|  case CURLE_SSL_SHUTDOWN_FAILED:
  ------------------
  |  Branch (204:3): [True: 0, False: 195]
  ------------------
  205|      0|    return "Failed to shut down the SSL connection";
  206|       |
  207|      0|  case CURLE_SSL_CRL_BADFILE:
  ------------------
  |  Branch (207:3): [True: 0, False: 195]
  ------------------
  208|      0|    return "Failed to load CRL file (path? access rights?, format?)";
  209|       |
  210|      0|  case CURLE_SSL_ISSUER_ERROR:
  ------------------
  |  Branch (210:3): [True: 0, False: 195]
  ------------------
  211|      0|    return "Issuer check against peer certificate failed";
  212|       |
  213|      0|  case CURLE_SEND_FAIL_REWIND:
  ------------------
  |  Branch (213:3): [True: 0, False: 195]
  ------------------
  214|      0|    return "Send failed since rewinding of the data stream failed";
  215|       |
  216|      0|  case CURLE_LOGIN_DENIED:
  ------------------
  |  Branch (216:3): [True: 0, False: 195]
  ------------------
  217|      0|    return "Login denied";
  218|       |
  219|      0|  case CURLE_TFTP_NOTFOUND:
  ------------------
  |  Branch (219:3): [True: 0, False: 195]
  ------------------
  220|      0|    return "TFTP: File Not Found";
  221|       |
  222|      0|  case CURLE_TFTP_PERM:
  ------------------
  |  Branch (222:3): [True: 0, False: 195]
  ------------------
  223|      0|    return "TFTP: Access Violation";
  224|       |
  225|      0|  case CURLE_REMOTE_DISK_FULL:
  ------------------
  |  Branch (225:3): [True: 0, False: 195]
  ------------------
  226|      0|    return "Disk full or allocation exceeded";
  227|       |
  228|      0|  case CURLE_TFTP_ILLEGAL:
  ------------------
  |  Branch (228:3): [True: 0, False: 195]
  ------------------
  229|      0|    return "TFTP: Illegal operation";
  230|       |
  231|      0|  case CURLE_TFTP_UNKNOWNID:
  ------------------
  |  Branch (231:3): [True: 0, False: 195]
  ------------------
  232|      0|    return "TFTP: Unknown transfer ID";
  233|       |
  234|      0|  case CURLE_REMOTE_FILE_EXISTS:
  ------------------
  |  Branch (234:3): [True: 0, False: 195]
  ------------------
  235|      0|    return "Remote file already exists";
  236|       |
  237|      0|  case CURLE_TFTP_NOSUCHUSER:
  ------------------
  |  Branch (237:3): [True: 0, False: 195]
  ------------------
  238|      0|    return "TFTP: No such user";
  239|       |
  240|      0|  case CURLE_REMOTE_FILE_NOT_FOUND:
  ------------------
  |  Branch (240:3): [True: 0, False: 195]
  ------------------
  241|      0|    return "Remote file not found";
  242|       |
  243|      0|  case CURLE_SSH:
  ------------------
  |  Branch (243:3): [True: 0, False: 195]
  ------------------
  244|      0|    return "Error in the SSH layer";
  245|       |
  246|      0|  case CURLE_AGAIN:
  ------------------
  |  Branch (246:3): [True: 0, False: 195]
  ------------------
  247|      0|    return "Socket not ready for send/recv";
  248|       |
  249|      0|  case CURLE_RTSP_CSEQ_ERROR:
  ------------------
  |  Branch (249:3): [True: 0, False: 195]
  ------------------
  250|      0|    return "RTSP CSeq mismatch or invalid CSeq";
  251|       |
  252|      0|  case CURLE_RTSP_SESSION_ERROR:
  ------------------
  |  Branch (252:3): [True: 0, False: 195]
  ------------------
  253|      0|    return "RTSP session error";
  254|       |
  255|      0|  case CURLE_FTP_BAD_FILE_LIST:
  ------------------
  |  Branch (255:3): [True: 0, False: 195]
  ------------------
  256|      0|    return "Unable to parse FTP file list";
  257|       |
  258|      0|  case CURLE_CHUNK_FAILED:
  ------------------
  |  Branch (258:3): [True: 0, False: 195]
  ------------------
  259|      0|    return "Chunk callback failed";
  260|       |
  261|      0|  case CURLE_NO_CONNECTION_AVAILABLE:
  ------------------
  |  Branch (261:3): [True: 0, False: 195]
  ------------------
  262|      0|    return "The max connection limit is reached";
  263|       |
  264|      0|  case CURLE_SSL_PINNEDPUBKEYNOTMATCH:
  ------------------
  |  Branch (264:3): [True: 0, False: 195]
  ------------------
  265|      0|    return "SSL public key does not match pinned public key";
  266|       |
  267|      0|  case CURLE_SSL_INVALIDCERTSTATUS:
  ------------------
  |  Branch (267:3): [True: 0, False: 195]
  ------------------
  268|      0|    return "SSL server certificate status verification FAILED";
  269|       |
  270|      0|  case CURLE_HTTP2_STREAM:
  ------------------
  |  Branch (270:3): [True: 0, False: 195]
  ------------------
  271|      0|    return "Stream error in the HTTP/2 framing layer";
  272|       |
  273|      0|  case CURLE_RECURSIVE_API_CALL:
  ------------------
  |  Branch (273:3): [True: 0, False: 195]
  ------------------
  274|      0|    return "API function called from within callback";
  275|       |
  276|      0|  case CURLE_AUTH_ERROR:
  ------------------
  |  Branch (276:3): [True: 0, False: 195]
  ------------------
  277|      0|    return "An authentication function returned an error";
  278|       |
  279|      0|  case CURLE_HTTP3:
  ------------------
  |  Branch (279:3): [True: 0, False: 195]
  ------------------
  280|      0|    return "HTTP/3 error";
  281|       |
  282|      0|  case CURLE_QUIC_CONNECT_ERROR:
  ------------------
  |  Branch (282:3): [True: 0, False: 195]
  ------------------
  283|      0|    return "QUIC connection error";
  284|       |
  285|      0|  case CURLE_PROXY:
  ------------------
  |  Branch (285:3): [True: 0, False: 195]
  ------------------
  286|      0|    return "proxy handshake error";
  287|       |
  288|      0|  case CURLE_SSL_CLIENTCERT:
  ------------------
  |  Branch (288:3): [True: 0, False: 195]
  ------------------
  289|      0|    return "SSL Client Certificate required";
  290|       |
  291|      0|  case CURLE_UNRECOVERABLE_POLL:
  ------------------
  |  Branch (291:3): [True: 0, False: 195]
  ------------------
  292|      0|    return "Unrecoverable error in select/poll";
  293|       |
  294|      0|  case CURLE_TOO_LARGE:
  ------------------
  |  Branch (294:3): [True: 0, False: 195]
  ------------------
  295|      0|    return "A value or data field grew larger than allowed";
  296|       |
  297|      0|  case CURLE_ECH_REQUIRED:
  ------------------
  |  Branch (297:3): [True: 0, False: 195]
  ------------------
  298|      0|    return "ECH attempted but failed";
  299|       |
  300|       |    /* error codes not used by current libcurl */
  301|      0|  default:
  ------------------
  |  Branch (301:3): [True: 0, False: 195]
  ------------------
  302|      0|    break;
  303|    195|  }
  304|       |  /*
  305|       |   * By using a switch, gcc -Wall will complain about enum values
  306|       |   * which do not appear, helping keep this function up-to-date.
  307|       |   * By using gcc -Wall -Werror, you cannot forget.
  308|       |   *
  309|       |   * A table would not have the same benefit. Most compilers will generate
  310|       |   * code similar to a table in any case, so there is little performance gain
  311|       |   * from a table. Something is broken for the user's application, anyways, so
  312|       |   * does it matter how fast it _does not_ work?
  313|       |   *
  314|       |   * The line number for the error will be near this comment, which is why it
  315|       |   * is here, and not at the start of the switch.
  316|       |   */
  317|      0|  return "Unknown error";
  318|       |#else
  319|       |  if(!error)
  320|       |    return "No error";
  321|       |  else
  322|       |    return "Error";
  323|       |#endif
  324|    195|}
curl_url_strerror:
  421|    893|{
  422|    893|#ifdef CURLVERBOSE
  423|    893|  switch(error) {
  ------------------
  |  Branch (423:10): [True: 893, False: 0]
  ------------------
  424|      0|  case CURLUE_OK:
  ------------------
  |  Branch (424:3): [True: 0, False: 893]
  ------------------
  425|      0|    return "No error";
  426|       |
  427|      0|  case CURLUE_BAD_HANDLE:
  ------------------
  |  Branch (427:3): [True: 0, False: 893]
  ------------------
  428|      0|    return "An invalid CURLU pointer was passed as argument";
  429|       |
  430|      0|  case CURLUE_BAD_PARTPOINTER:
  ------------------
  |  Branch (430:3): [True: 0, False: 893]
  ------------------
  431|      0|    return "An invalid 'part' argument was passed as argument";
  432|       |
  433|    246|  case CURLUE_MALFORMED_INPUT:
  ------------------
  |  Branch (433:3): [True: 246, False: 647]
  ------------------
  434|    246|    return "Malformed input to a URL function";
  435|       |
  436|     79|  case CURLUE_BAD_PORT_NUMBER:
  ------------------
  |  Branch (436:3): [True: 79, False: 814]
  ------------------
  437|     79|    return "Port number was not a decimal number between 0 and 65535";
  438|       |
  439|      1|  case CURLUE_UNSUPPORTED_SCHEME:
  ------------------
  |  Branch (439:3): [True: 1, False: 892]
  ------------------
  440|      1|    return "Unsupported URL scheme";
  441|       |
  442|      0|  case CURLUE_URLDECODE:
  ------------------
  |  Branch (442:3): [True: 0, False: 893]
  ------------------
  443|      0|    return "URL decode error, most likely because of rubbish in the input";
  444|       |
  445|      0|  case CURLUE_OUT_OF_MEMORY:
  ------------------
  |  Branch (445:3): [True: 0, False: 893]
  ------------------
  446|      0|    return "A memory function failed";
  447|       |
  448|      1|  case CURLUE_USER_NOT_ALLOWED:
  ------------------
  |  Branch (448:3): [True: 1, False: 892]
  ------------------
  449|      1|    return "Credentials was passed in the URL when prohibited";
  450|       |
  451|      0|  case CURLUE_UNKNOWN_PART:
  ------------------
  |  Branch (451:3): [True: 0, False: 893]
  ------------------
  452|      0|    return "An unknown part ID was passed to a URL API function";
  453|       |
  454|      0|  case CURLUE_NO_SCHEME:
  ------------------
  |  Branch (454:3): [True: 0, False: 893]
  ------------------
  455|      0|    return "No scheme part in the URL";
  456|       |
  457|      0|  case CURLUE_NO_USER:
  ------------------
  |  Branch (457:3): [True: 0, False: 893]
  ------------------
  458|      0|    return "No user part in the URL";
  459|       |
  460|      0|  case CURLUE_NO_PASSWORD:
  ------------------
  |  Branch (460:3): [True: 0, False: 893]
  ------------------
  461|      0|    return "No password part in the URL";
  462|       |
  463|      0|  case CURLUE_NO_OPTIONS:
  ------------------
  |  Branch (463:3): [True: 0, False: 893]
  ------------------
  464|      0|    return "No options part in the URL";
  465|       |
  466|     80|  case CURLUE_NO_HOST:
  ------------------
  |  Branch (466:3): [True: 80, False: 813]
  ------------------
  467|     80|    return "No host part in the URL";
  468|       |
  469|      0|  case CURLUE_NO_PORT:
  ------------------
  |  Branch (469:3): [True: 0, False: 893]
  ------------------
  470|      0|    return "No port part in the URL";
  471|       |
  472|      0|  case CURLUE_NO_QUERY:
  ------------------
  |  Branch (472:3): [True: 0, False: 893]
  ------------------
  473|      0|    return "No query part in the URL";
  474|       |
  475|      0|  case CURLUE_NO_FRAGMENT:
  ------------------
  |  Branch (475:3): [True: 0, False: 893]
  ------------------
  476|      0|    return "No fragment part in the URL";
  477|       |
  478|      0|  case CURLUE_NO_ZONEID:
  ------------------
  |  Branch (478:3): [True: 0, False: 893]
  ------------------
  479|      0|    return "No zoneid part in the URL";
  480|       |
  481|      0|  case CURLUE_BAD_LOGIN:
  ------------------
  |  Branch (481:3): [True: 0, False: 893]
  ------------------
  482|      0|    return "Bad login part";
  483|       |
  484|     55|  case CURLUE_BAD_IPV6:
  ------------------
  |  Branch (484:3): [True: 55, False: 838]
  ------------------
  485|     55|    return "Bad IPv6 address";
  486|       |
  487|    385|  case CURLUE_BAD_HOSTNAME:
  ------------------
  |  Branch (487:3): [True: 385, False: 508]
  ------------------
  488|    385|    return "Bad hostname";
  489|       |
  490|     43|  case CURLUE_BAD_FILE_URL:
  ------------------
  |  Branch (490:3): [True: 43, False: 850]
  ------------------
  491|     43|    return "Bad file:// URL";
  492|       |
  493|      3|  case CURLUE_BAD_SLASHES:
  ------------------
  |  Branch (493:3): [True: 3, False: 890]
  ------------------
  494|      3|    return "Unsupported number of slashes following scheme";
  495|       |
  496|      0|  case CURLUE_BAD_SCHEME:
  ------------------
  |  Branch (496:3): [True: 0, False: 893]
  ------------------
  497|      0|    return "Bad scheme";
  498|       |
  499|      0|  case CURLUE_BAD_PATH:
  ------------------
  |  Branch (499:3): [True: 0, False: 893]
  ------------------
  500|      0|    return "Bad path";
  501|       |
  502|      0|  case CURLUE_BAD_FRAGMENT:
  ------------------
  |  Branch (502:3): [True: 0, False: 893]
  ------------------
  503|      0|    return "Bad fragment";
  504|       |
  505|      0|  case CURLUE_BAD_QUERY:
  ------------------
  |  Branch (505:3): [True: 0, False: 893]
  ------------------
  506|      0|    return "Bad query";
  507|       |
  508|      0|  case CURLUE_BAD_PASSWORD:
  ------------------
  |  Branch (508:3): [True: 0, False: 893]
  ------------------
  509|      0|    return "Bad password";
  510|       |
  511|      0|  case CURLUE_BAD_USER:
  ------------------
  |  Branch (511:3): [True: 0, False: 893]
  ------------------
  512|      0|    return "Bad user";
  513|       |
  514|      0|  case CURLUE_LACKS_IDN:
  ------------------
  |  Branch (514:3): [True: 0, False: 893]
  ------------------
  515|      0|    return "libcurl lacks IDN support";
  516|       |
  517|      0|  case CURLUE_TOO_LARGE:
  ------------------
  |  Branch (517:3): [True: 0, False: 893]
  ------------------
  518|      0|    return "A value or data field is larger than allowed";
  519|       |
  520|      0|  case CURLUE_LAST:
  ------------------
  |  Branch (520:3): [True: 0, False: 893]
  ------------------
  521|      0|    break;
  522|    893|  }
  523|       |
  524|      0|  return "CURLUcode unknown";
  525|       |#else
  526|       |  if(error == CURLUE_OK)
  527|       |    return "No error";
  528|       |  else
  529|       |    return "Error";
  530|       |#endif
  531|    893|}

Curl_thrdpool_set_props:
  272|  17.2k|{
  273|  17.2k|  CURLcode result = CURLE_OK;
  274|  17.2k|  size_t running;
  275|       |
  276|  17.2k|  if(!max_threads || (min_threads > max_threads))
  ------------------
  |  Branch (276:6): [True: 0, False: 17.2k]
  |  Branch (276:22): [True: 0, False: 17.2k]
  ------------------
  277|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  278|       |
  279|  17.2k|  Curl_mutex_acquire(&tpool->lock);
  ------------------
  |  |   36|  17.2k|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  280|  17.2k|  tpool->min_threads = min_threads;
  281|  17.2k|  tpool->max_threads = max_threads;
  282|  17.2k|  tpool->idle_time_ms = idle_time_ms;
  283|  17.2k|  running = Curl_llist_count(&tpool->slots);
  284|  17.2k|  if(tpool->min_threads > running) {
  ------------------
  |  Branch (284:6): [True: 0, False: 17.2k]
  ------------------
  285|      0|    result = thrdpool_signal(tpool, tpool->min_threads - (uint32_t)running);
  286|      0|  }
  287|  17.2k|  Curl_mutex_release(&tpool->lock);
  ------------------
  |  |   37|  17.2k|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  288|       |
  289|  17.2k|  return result;
  290|  17.2k|}
Curl_thrdpool_create:
  301|  17.2k|{
  302|  17.2k|  struct curl_thrdpool *tpool;
  303|  17.2k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  304|       |
  305|  17.2k|  tpool = curlx_calloc(1, sizeof(*tpool));
  ------------------
  |  | 1480|  17.2k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  306|  17.2k|  if(!tpool)
  ------------------
  |  Branch (306:6): [True: 0, False: 17.2k]
  ------------------
  307|      0|    goto out;
  308|  17.2k|  tpool->refcount = 1;
  309|       |
  310|  17.2k|  Curl_mutex_init(&tpool->lock);
  ------------------
  |  |   35|  17.2k|#  define Curl_mutex_init(m)     pthread_mutex_init(m, NULL)
  ------------------
  311|  17.2k|  Curl_cond_init(&tpool->await);
  ------------------
  |  |   40|  17.2k|#  define Curl_cond_init(c)      pthread_cond_init(c, NULL)
  ------------------
  312|  17.2k|  Curl_llist_init(&tpool->slots, NULL);
  313|  17.2k|  Curl_llist_init(&tpool->zombies, NULL);
  314|  17.2k|  tpool->fn_take = fn_take;
  315|  17.2k|  tpool->fn_process = fn_process;
  316|  17.2k|  tpool->fn_return = fn_return;
  317|  17.2k|  tpool->fn_user_data = user_data;
  318|       |
  319|  17.2k|  tpool->name = curlx_strdup(name);
  ------------------
  |  | 1477|  17.2k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  320|  17.2k|  if(!tpool->name)
  ------------------
  |  Branch (320:6): [True: 0, False: 17.2k]
  ------------------
  321|      0|    goto out;
  322|       |
  323|  17.2k|  result = Curl_thrdpool_set_props(tpool, min_threads, max_threads,
  324|  17.2k|                                   idle_time_ms);
  325|       |
  326|  17.2k|out:
  327|  17.2k|  if(result && tpool) {
  ------------------
  |  Branch (327:6): [True: 0, False: 17.2k]
  |  Branch (327:16): [True: 0, False: 0]
  ------------------
  328|      0|    tpool->aborted = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  329|      0|    thrdpool_unlink(tpool, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  330|       |    tpool = NULL;
  331|      0|  }
  332|  17.2k|  *ptpool = tpool;
  333|  17.2k|  return result;
  334|  17.2k|}
Curl_thrdpool_destroy:
  337|  17.2k|{
  338|  17.2k|  Curl_mutex_acquire(&tpool->lock);
  ------------------
  |  |   36|  17.2k|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  339|       |
  340|  17.2k|  tpool->aborted = TRUE;
  ------------------
  |  | 1055|  17.2k|#define TRUE true
  ------------------
  341|       |
  342|  17.7k|  while(join && Curl_llist_count(&tpool->slots)) {
  ------------------
  |  Branch (342:9): [True: 17.7k, False: 0]
  |  Branch (342:17): [True: 523, False: 17.2k]
  ------------------
  343|    523|    thrdpool_wake_all(tpool);
  344|    523|    Curl_cond_wait(&tpool->await, &tpool->lock);
  345|    523|  }
  346|       |
  347|  17.2k|  thrdpool_join_zombies(tpool);
  348|       |
  349|       |  /* detach all still running threads */
  350|  17.2k|  if(Curl_llist_count(&tpool->slots)) {
  ------------------
  |  Branch (350:6): [True: 0, False: 17.2k]
  ------------------
  351|      0|    struct Curl_llist_node *e;
  352|      0|    for(e = Curl_llist_head(&tpool->slots); e; e = Curl_node_next(e)) {
  ------------------
  |  Branch (352:45): [True: 0, False: 0]
  ------------------
  353|      0|      struct thrdslot *tslot = Curl_node_elem(e);
  354|      0|      if(tslot->thread != curl_thread_t_null)
  ------------------
  |  |   34|      0|#  define curl_thread_t_null     (pthread_t *)0
  ------------------
  |  Branch (354:10): [True: 0, False: 0]
  ------------------
  355|      0|        Curl_thread_destroy(&tslot->thread);
  356|      0|    }
  357|      0|    tpool->detached = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  358|      0|  }
  359|       |
  360|  17.2k|  if(!thrdpool_unlink(tpool, TRUE)) {
  ------------------
  |  | 1055|  17.2k|#define TRUE true
  ------------------
  |  Branch (360:6): [True: 0, False: 17.2k]
  ------------------
  361|       |    /* tpool not destroyed */
  362|      0|    Curl_mutex_release(&tpool->lock);
  ------------------
  |  |   37|      0|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  363|      0|  }
  364|  17.2k|}
Curl_thrdpool_signal:
  367|    617|{
  368|    617|  CURLcode result;
  369|       |
  370|    617|  Curl_mutex_acquire(&tpool->lock);
  ------------------
  |  |   36|    617|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  371|    617|  result = thrdpool_signal(tpool, nthreads);
  372|    617|  Curl_mutex_release(&tpool->lock);
  ------------------
  |  |   37|    617|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  373|    617|  return result;
  374|    617|}
thrdpool.c:thrdpool_signal:
  237|    617|{
  238|    617|  struct Curl_llist_node *e, *n;
  239|    617|  CURLcode result = CURLE_OK;
  240|       |
  241|    617|  DEBUGASSERT(!tpool->aborted);
  ------------------
  |  | 1081|    617|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (241:3): [True: 0, False: 617]
  |  Branch (241:3): [True: 617, False: 0]
  ------------------
  242|    617|  thrdpool_join_zombies(tpool);
  243|       |
  244|    885|  for(e = Curl_llist_head(&tpool->slots); e && nthreads; e = n) {
  ------------------
  |  Branch (244:43): [True: 269, False: 616]
  |  Branch (244:48): [True: 268, False: 1]
  ------------------
  245|    268|    struct thrdslot *tslot = Curl_node_elem(e);
  246|    268|    n = Curl_node_next(e);
  247|    268|    if(tslot->idle) {
  ------------------
  |  Branch (247:8): [True: 3, False: 265]
  ------------------
  248|      3|      Curl_cond_signal(&tslot->await);
  249|      3|      --nthreads;
  250|      3|    }
  251|    265|    else if(!tslot->starttime.tv_sec && !tslot->starttime.tv_usec) {
  ------------------
  |  Branch (251:13): [True: 265, False: 0]
  |  Branch (251:41): [True: 265, False: 0]
  ------------------
  252|       |      /* starting thread, queries for work soon. */
  253|    265|      --nthreads;
  254|    265|    }
  255|    268|  }
  256|       |
  257|  1.23k|  while(nthreads && !result &&
  ------------------
  |  Branch (257:9): [True: 614, False: 617]
  |  Branch (257:21): [True: 614, False: 0]
  ------------------
  258|    614|        Curl_llist_count(&tpool->slots) < tpool->max_threads) {
  ------------------
  |  Branch (258:9): [True: 614, False: 0]
  ------------------
  259|    614|    result = thrdslot_start(tpool);
  260|    614|    if(result)
  ------------------
  |  Branch (260:8): [True: 0, False: 614]
  ------------------
  261|      0|      break;
  262|    614|    --nthreads;
  263|    614|  }
  264|       |
  265|    617|  return result;
  266|    617|}
thrdpool.c:thrdslot_start:
  155|    614|{
  156|    614|  struct thrdslot *tslot;
  157|    614|  CURLcode result = CURLE_OUT_OF_MEMORY;
  158|       |
  159|    614|  tslot = curlx_calloc(1, sizeof(*tslot));
  ------------------
  |  | 1480|    614|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  160|    614|  if(!tslot)
  ------------------
  |  Branch (160:6): [True: 0, False: 614]
  ------------------
  161|      0|    goto out;
  162|    614|  tslot->id = tpool->next_id++;
  163|    614|  tslot->tpool = tpool;
  164|    614|  tslot->thread = curl_thread_t_null;
  ------------------
  |  |   34|    614|#  define curl_thread_t_null     (pthread_t *)0
  ------------------
  165|    614|  Curl_cond_init(&tslot->await);
  ------------------
  |  |   40|    614|#  define Curl_cond_init(c)      pthread_cond_init(c, NULL)
  ------------------
  166|       |
  167|    614|  tpool->refcount++;
  168|    614|  tslot->running = TRUE;
  ------------------
  |  | 1055|    614|#define TRUE true
  ------------------
  169|    614|  tslot->thread = Curl_thread_create(thrdslot_run, tslot);
  170|    614|  if(tslot->thread == curl_thread_t_null) { /* never started */
  ------------------
  |  |   34|    614|#  define curl_thread_t_null     (pthread_t *)0
  ------------------
  |  Branch (170:6): [True: 0, False: 614]
  ------------------
  171|      0|    tslot->running = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  172|      0|    thrdpool_unlink(tpool, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  173|      0|    result = CURLE_FAILED_INIT;
  174|      0|    goto out;
  175|      0|  }
  176|       |
  177|    614|  Curl_llist_append(&tpool->slots, tslot, &tslot->node);
  178|    614|  tslot = NULL;
  179|    614|  result = CURLE_OK;
  180|       |
  181|    614|out:
  182|    614|  if(tslot)
  ------------------
  |  Branch (182:6): [True: 0, False: 614]
  ------------------
  183|      0|    thrdslot_destroy(tslot);
  184|    614|  return result;
  185|    614|}
thrdpool.c:thrdslot_run:
   94|    614|{
   95|    614|  struct thrdslot *tslot = arg;
   96|    614|  struct curl_thrdpool *tpool = tslot->tpool;
   97|    614|  void *item;
   98|       |
   99|    614|  Curl_mutex_acquire(&tpool->lock);
  ------------------
  |  |   36|    614|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  100|    614|  DEBUGASSERT(Curl_node_llist(&tslot->node) == &tpool->slots);
  ------------------
  |  | 1081|    614|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (100:3): [True: 0, False: 614]
  |  Branch (100:3): [True: 614, False: 0]
  ------------------
  101|  1.07k|  for(;;) {
  102|  1.68k|    while(!tpool->aborted) {
  ------------------
  |  Branch (102:11): [True: 1.07k, False: 614]
  ------------------
  103|  1.07k|      tslot->work_description = NULL;
  104|  1.07k|      tslot->work_timeout_ms = 0;
  105|  1.07k|      item = tpool->fn_take(tpool->fn_user_data, &tslot->work_description,
  106|  1.07k|                            &tslot->work_timeout_ms);
  107|  1.07k|      if(!item)
  ------------------
  |  Branch (107:10): [True: 456, False: 617]
  ------------------
  108|    456|        break;
  109|    617|      tslot->starttime = curlx_now();
  110|    617|      tslot->idle = FALSE;
  ------------------
  |  | 1058|    617|#define FALSE false
  ------------------
  111|    617|      Curl_mutex_release(&tpool->lock);
  ------------------
  |  |   37|    617|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  112|       |
  113|    617|      tpool->fn_process(item);
  114|       |
  115|    617|      Curl_mutex_acquire(&tpool->lock);
  ------------------
  |  |   36|    617|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  116|    617|      tslot->work_description = NULL;
  117|    617|      tpool->fn_return(item, tpool->aborted ? NULL : tpool->fn_user_data);
  ------------------
  |  Branch (117:30): [True: 161, False: 456]
  ------------------
  118|    617|    }
  119|       |
  120|  1.07k|    if(tpool->aborted ||
  ------------------
  |  Branch (120:8): [True: 614, False: 456]
  ------------------
  121|    456|       (Curl_llist_count(&tpool->slots) > tpool->max_threads))
  ------------------
  |  Branch (121:8): [True: 0, False: 456]
  ------------------
  122|    614|      goto out;
  123|       |
  124|    456|    tslot->idle = TRUE;
  ------------------
  |  | 1055|    456|#define TRUE true
  ------------------
  125|    456|    tslot->starttime = curlx_now();
  126|    456|    thrdpool_join_zombies(tpool);
  127|    456|    Curl_cond_signal(&tpool->await);
  128|       |    /* Only wait with idle timeout when we are above the minimum
  129|       |     * number of threads. Otherwise short idle timeouts will keep
  130|       |     * on activating threads that have no means to shut down. */
  131|    456|    if((tpool->idle_time_ms > 0) &&
  ------------------
  |  Branch (131:8): [True: 456, False: 0]
  ------------------
  132|    456|       (Curl_llist_count(&tpool->slots) > tpool->min_threads)) {
  ------------------
  |  Branch (132:8): [True: 456, False: 0]
  ------------------
  133|    456|      CURLcode result = Curl_cond_timedwait(&tslot->await, &tpool->lock,
  134|    456|                                            tpool->idle_time_ms);
  135|    456|      if((result == CURLE_OPERATION_TIMEDOUT) &&
  ------------------
  |  Branch (135:10): [True: 0, False: 456]
  ------------------
  136|      0|         (Curl_llist_count(&tpool->slots) > tpool->min_threads)) {
  ------------------
  |  Branch (136:10): [True: 0, False: 0]
  ------------------
  137|      0|        goto out;
  138|      0|      }
  139|    456|    }
  140|      0|    else {
  141|      0|      Curl_cond_wait(&tslot->await, &tpool->lock);
  142|      0|    }
  143|    456|  }
  144|       |
  145|    614|out:
  146|    614|  thrdslot_done(tslot);
  147|    614|  if(!thrdpool_unlink(tslot->tpool, TRUE)) {
  ------------------
  |  | 1055|    614|#define TRUE true
  ------------------
  |  Branch (147:6): [True: 614, False: 0]
  ------------------
  148|       |    /* tpool not destroyed */
  149|    614|    Curl_mutex_release(&tpool->lock);
  ------------------
  |  |   37|    614|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  150|    614|  }
  151|    614|  return 0;
  152|    614|}
thrdpool.c:thrdslot_done:
   83|    614|{
   84|    614|  struct curl_thrdpool *tpool = tslot->tpool;
   85|       |
   86|    614|  DEBUGASSERT(Curl_node_llist(&tslot->node) == &tpool->slots);
  ------------------
  |  | 1081|    614|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (86:3): [True: 0, False: 614]
  |  Branch (86:3): [True: 614, False: 0]
  ------------------
   87|    614|  Curl_node_remove(&tslot->node);
   88|       |  tslot->running = FALSE;
  ------------------
  |  | 1058|    614|#define FALSE false
  ------------------
   89|    614|  Curl_llist_append(&tpool->zombies, tslot, &tslot->node);
   90|    614|  Curl_cond_signal(&tpool->await);
   91|    614|}
thrdpool.c:thrdslot_destroy:
   75|    614|{
   76|    614|  DEBUGASSERT(tslot->thread == curl_thread_t_null);
  ------------------
  |  | 1081|    614|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (76:3): [True: 0, False: 614]
  |  Branch (76:3): [True: 614, False: 0]
  ------------------
   77|    614|  DEBUGASSERT(!tslot->running);
  ------------------
  |  | 1081|    614|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (77:3): [True: 0, False: 614]
  |  Branch (77:3): [True: 614, False: 0]
  ------------------
   78|    614|  Curl_cond_destroy(&tslot->await);
  ------------------
  |  |   41|    614|#  define Curl_cond_destroy(c)   pthread_cond_destroy(c)
  ------------------
   79|    614|  curlx_free(tslot);
  ------------------
  |  | 1483|    614|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   80|    614|}
thrdpool.c:thrdpool_unlink:
  216|  17.8k|{
  217|  17.8k|  DEBUGASSERT(tpool->refcount);
  ------------------
  |  | 1081|  17.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (217:3): [True: 0, False: 17.8k]
  |  Branch (217:3): [True: 17.8k, False: 0]
  ------------------
  218|  17.8k|  if(tpool->refcount)
  ------------------
  |  Branch (218:6): [True: 17.8k, False: 0]
  ------------------
  219|  17.8k|    tpool->refcount--;
  220|  17.8k|  if(tpool->refcount)
  ------------------
  |  Branch (220:6): [True: 614, False: 17.2k]
  ------------------
  221|    614|    return FALSE;
  ------------------
  |  | 1058|    614|#define FALSE false
  ------------------
  222|       |
  223|       |  /* no more references, free */
  224|  17.2k|  DEBUGASSERT(tpool->aborted);
  ------------------
  |  | 1081|  17.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (224:3): [True: 0, False: 17.2k]
  |  Branch (224:3): [True: 17.2k, False: 0]
  ------------------
  225|  17.2k|  thrdpool_join_zombies(tpool);
  226|  17.2k|  if(locked)
  ------------------
  |  Branch (226:6): [True: 17.2k, False: 0]
  ------------------
  227|  17.2k|    Curl_mutex_release(&tpool->lock);
  ------------------
  |  |   37|  17.2k|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  228|  17.2k|  curlx_free(tpool->name);
  ------------------
  |  | 1483|  17.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  229|  17.2k|  Curl_cond_destroy(&tpool->await);
  ------------------
  |  |   41|  17.2k|#  define Curl_cond_destroy(c)   pthread_cond_destroy(c)
  ------------------
  230|  17.2k|  Curl_mutex_destroy(&tpool->lock);
  ------------------
  |  |   38|  17.2k|#  define Curl_mutex_destroy(m)  pthread_mutex_destroy(m)
  ------------------
  231|  17.2k|  curlx_free(tpool);
  ------------------
  |  | 1483|  17.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  232|       |  return TRUE;
  ------------------
  |  | 1055|  17.2k|#define TRUE true
  ------------------
  233|  17.2k|}
thrdpool.c:thrdpool_wake_all:
  188|    523|{
  189|    523|  struct Curl_llist_node *e;
  190|  1.31k|  for(e = Curl_llist_head(&tpool->slots); e; e = Curl_node_next(e)) {
  ------------------
  |  Branch (190:43): [True: 788, False: 523]
  ------------------
  191|    788|    struct thrdslot *tslot = Curl_node_elem(e);
  192|    788|    Curl_cond_signal(&tslot->await);
  193|    788|  }
  194|    523|}
thrdpool.c:thrdpool_join_zombies:
  197|  35.4k|{
  198|  35.4k|  struct Curl_llist_node *e;
  199|       |
  200|  36.0k|  for(e = Curl_llist_head(&tpool->zombies); e;
  ------------------
  |  Branch (200:45): [True: 614, False: 35.4k]
  ------------------
  201|  35.4k|      e = Curl_llist_head(&tpool->zombies)) {
  202|    614|    struct thrdslot *tslot = Curl_node_elem(e);
  203|       |
  204|    614|    Curl_node_remove(&tslot->node);
  205|    614|    if(tslot->thread != curl_thread_t_null) {
  ------------------
  |  |   34|    614|#  define curl_thread_t_null     (pthread_t *)0
  ------------------
  |  Branch (205:8): [True: 614, False: 0]
  ------------------
  206|    614|      Curl_mutex_release(&tpool->lock);
  ------------------
  |  |   37|    614|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  207|    614|      Curl_thread_join(&tslot->thread);
  208|    614|      Curl_mutex_acquire(&tpool->lock);
  ------------------
  |  |   36|    614|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  209|    614|      tslot->thread = curl_thread_t_null;
  ------------------
  |  |   34|    614|#  define curl_thread_t_null     (pthread_t *)0
  ------------------
  210|    614|    }
  211|    614|    thrdslot_destroy(tslot);
  212|    614|  }
  213|  35.4k|}

Curl_thrdq_create:
  209|  17.2k|{
  210|  17.2k|  struct curl_thrdq *tqueue;
  211|  17.2k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  212|       |
  213|  17.2k|  tqueue = curlx_calloc(1, sizeof(*tqueue));
  ------------------
  |  | 1480|  17.2k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  214|  17.2k|  if(!tqueue)
  ------------------
  |  Branch (214:6): [True: 0, False: 17.2k]
  ------------------
  215|      0|    goto out;
  216|       |
  217|  17.2k|  Curl_mutex_init(&tqueue->lock);
  ------------------
  |  |   35|  17.2k|#  define Curl_mutex_init(m)     pthread_mutex_init(m, NULL)
  ------------------
  218|  17.2k|  Curl_cond_init(&tqueue->await);
  ------------------
  |  |   40|  17.2k|#  define Curl_cond_init(c)      pthread_cond_init(c, NULL)
  ------------------
  219|  17.2k|  Curl_llist_init(&tqueue->sendq, thrdq_item_list_dtor);
  220|  17.2k|  Curl_llist_init(&tqueue->recvq, thrdq_item_list_dtor);
  221|  17.2k|  tqueue->fn_free = fn_free;
  222|  17.2k|  tqueue->fn_process = fn_process;
  223|  17.2k|  tqueue->fn_event = fn_event;
  224|  17.2k|  tqueue->fn_user_data = user_data;
  225|  17.2k|  tqueue->send_max_len = max_len;
  226|       |
  227|  17.2k|  tqueue->name = curlx_strdup(name);
  ------------------
  |  | 1477|  17.2k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  228|  17.2k|  if(!tqueue->name)
  ------------------
  |  Branch (228:6): [True: 0, False: 17.2k]
  ------------------
  229|      0|    goto out;
  230|       |
  231|  17.2k|  result = Curl_thrdpool_create(&tqueue->tpool, name,
  232|  17.2k|                                min_threads, max_threads, idle_time_ms,
  233|  17.2k|                                thrdq_tpool_take,
  234|  17.2k|                                thrdq_tpool_process,
  235|  17.2k|                                thrdq_tpool_return,
  236|  17.2k|                                tqueue);
  237|       |
  238|  17.2k|out:
  239|  17.2k|  if(result && tqueue) {
  ------------------
  |  Branch (239:6): [True: 0, False: 17.2k]
  |  Branch (239:16): [True: 0, False: 0]
  ------------------
  240|      0|    tqueue->aborted = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  241|      0|    thrdq_unlink(tqueue, FALSE, TRUE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
                  thrdq_unlink(tqueue, FALSE, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  242|       |    tqueue = NULL;
  243|      0|  }
  244|  17.2k|  *ptqueue = tqueue;
  245|  17.2k|  return result;
  246|  17.2k|}
Curl_thrdq_destroy:
  249|  17.2k|{
  250|  17.2k|  Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   36|  17.2k|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  251|  17.2k|  DEBUGASSERT(!tqueue->aborted);
  ------------------
  |  | 1081|  17.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (251:3): [True: 0, False: 17.2k]
  |  Branch (251:3): [True: 17.2k, False: 0]
  ------------------
  252|  17.2k|  tqueue->aborted = TRUE;
  ------------------
  |  | 1055|  17.2k|#define TRUE true
  ------------------
  253|       |  thrdq_unlink(tqueue, TRUE, join);
  ------------------
  |  | 1055|  17.2k|#define TRUE true
  ------------------
  254|  17.2k|}
Curl_thrdq_send:
  258|    617|{
  259|    617|  CURLcode result = CURLE_AGAIN;
  260|    617|  size_t signals = 0;
  261|       |
  262|    617|  Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   36|    617|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  263|    617|  if(tqueue->aborted) {
  ------------------
  |  Branch (263:6): [True: 0, False: 617]
  ------------------
  264|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (264:5): [Folded, False: 0]
  |  Branch (264:5): [Folded, False: 0]
  ------------------
  265|      0|    result = CURLE_SEND_ERROR;
  266|      0|    goto out;
  267|      0|  }
  268|    617|  if(timeout_ms < 0) {
  ------------------
  |  Branch (268:6): [True: 0, False: 617]
  ------------------
  269|      0|    result = CURLE_OPERATION_TIMEDOUT;
  270|      0|    goto out;
  271|      0|  }
  272|       |
  273|    617|  if(!tqueue->send_max_len ||
  ------------------
  |  Branch (273:6): [True: 617, False: 0]
  ------------------
  274|    617|     (Curl_llist_count(&tqueue->sendq) < tqueue->send_max_len)) {
  ------------------
  |  Branch (274:6): [True: 0, False: 0]
  ------------------
  275|    617|    struct thrdq_item *qitem = thrdq_item_create(tqueue, item, description,
  276|    617|                                                 timeout_ms);
  277|    617|    if(!qitem) {
  ------------------
  |  Branch (277:8): [True: 0, False: 617]
  ------------------
  278|      0|      result = CURLE_OUT_OF_MEMORY;
  279|      0|      goto out;
  280|      0|    }
  281|    617|    item = NULL;
  282|    617|    Curl_llist_append(&tqueue->sendq, qitem, &qitem->node);
  283|    617|    signals = Curl_llist_count(&tqueue->sendq);
  284|    617|    result = CURLE_OK;
  285|    617|  }
  286|       |
  287|    617|out:
  288|    617|  Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   37|    617|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  289|       |  /* Signal thread pool unlocked to avoid deadlocks. Since we added
  290|       |   * item to the queue already, it might have been taken for processing
  291|       |   * already. Any error in signalling the pool cannot be reported to
  292|       |   * the caller since it needs to give up ownership of item. */
  293|    617|  if(!result && signals)
  ------------------
  |  Branch (293:6): [True: 617, False: 0]
  |  Branch (293:17): [True: 617, False: 0]
  ------------------
  294|    617|    (void)Curl_thrdpool_signal(tqueue->tpool, (uint32_t)signals);
  295|    617|  return result;
  296|    617|}
Curl_thrdq_recv:
  299|  3.81M|{
  300|  3.81M|  CURLcode result = CURLE_AGAIN;
  301|  3.81M|  struct Curl_llist_node *e;
  302|       |
  303|  3.81M|  *pitem = NULL;
  304|  3.81M|  Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   36|  3.81M|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  305|  3.81M|  if(tqueue->aborted) {
  ------------------
  |  Branch (305:6): [True: 0, False: 3.81M]
  ------------------
  306|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (306:5): [Folded, False: 0]
  |  Branch (306:5): [Folded, False: 0]
  ------------------
  307|      0|    result = CURLE_RECV_ERROR;
  308|      0|    goto out;
  309|      0|  }
  310|       |
  311|  3.81M|  e = Curl_llist_head(&tqueue->recvq);
  312|  3.81M|  if(e) {
  ------------------
  |  Branch (312:6): [True: 456, False: 3.81M]
  ------------------
  313|    456|    struct thrdq_item *qitem = Curl_node_take_elem(e);
  314|    456|    *pitem = qitem->item;
  315|    456|    qitem->item = NULL;
  316|    456|    thrdq_item_destroy(qitem);
  317|    456|    result = CURLE_OK;
  318|    456|  }
  319|  3.81M|out:
  320|  3.81M|  Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   37|  3.81M|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  321|  3.81M|  return result;
  322|  3.81M|}
Curl_thrdq_clear:
  342|     98|{
  343|     98|  Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   36|     98|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  344|     98|  if(tqueue->aborted) {
  ------------------
  |  Branch (344:6): [True: 0, False: 98]
  ------------------
  345|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (345:5): [Folded, False: 0]
  |  Branch (345:5): [Folded, False: 0]
  ------------------
  346|      0|    goto out;
  347|      0|  }
  348|     98|  thrdq_llist_clean_matches(&tqueue->sendq, fn_match, match_data);
  349|     98|  thrdq_llist_clean_matches(&tqueue->recvq, fn_match, match_data);
  350|     98|out:
  351|     98|  Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   37|     98|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  352|     98|}
Curl_thrdq_trace:
  389|  3.83M|{
  390|  3.83M|  struct curl_trc_feat *feat = &Curl_trc_feat_threads;
  391|  3.83M|  if(Curl_trc_ft_is_verbose(data, feat)) {
  ------------------
  |  |  326|  3.83M|  (Curl_trc_is_verbose(data) &&          \
  |  |  ------------------
  |  |  |  |  319|  7.66M|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 3.83M, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 3.83M]
  |  |  |  |  ------------------
  |  |  |  |  320|  7.66M|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  327|  3.83M|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  392|      0|    struct Curl_llist_node *e;
  393|      0|    struct thrdq_item *qitem;
  394|       |
  395|      0|    Curl_thrdpool_trace(tqueue->tpool, data);
  396|      0|    Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   36|      0|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  397|      0|    if(!Curl_llist_count(&tqueue->sendq) &&
  ------------------
  |  Branch (397:8): [True: 0, False: 0]
  ------------------
  398|      0|       !Curl_llist_count(&tqueue->recvq)) {
  ------------------
  |  Branch (398:8): [True: 0, False: 0]
  ------------------
  399|      0|      Curl_trc_feat_infof(data, feat, "[TQUEUE-%s] empty", tqueue->name);
  400|      0|    }
  401|      0|    for(e = Curl_llist_head(&tqueue->sendq); e; e = Curl_node_next(e)) {
  ------------------
  |  Branch (401:46): [True: 0, False: 0]
  ------------------
  402|      0|      qitem = Curl_node_elem(e);
  403|      0|      Curl_trc_feat_infof(data, feat, "[TQUEUE-%s] in: %s",
  404|      0|                          tqueue->name, qitem->description);
  405|      0|    }
  406|      0|    for(e = Curl_llist_head(&tqueue->recvq); e; e = Curl_node_next(e)) {
  ------------------
  |  Branch (406:46): [True: 0, False: 0]
  ------------------
  407|      0|      qitem = Curl_node_elem(e);
  408|      0|      Curl_trc_feat_infof(data, feat, "[TQUEUE-%s] out: %s",
  409|      0|                          tqueue->name, qitem->description);
  410|      0|    }
  411|      0|    Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   37|      0|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  412|      0|  }
  413|  3.83M|}
thrdqueue.c:thrdq_tpool_take:
  100|  1.07k|{
  101|  1.07k|  struct curl_thrdq *tqueue = user_data;
  102|  1.07k|  struct thrdq_item *qitem = NULL;
  103|  1.07k|  struct Curl_llist_node *e;
  104|  1.07k|  Curl_thrdq_ev_cb *fn_event = NULL;
  105|  1.07k|  void *fn_user_data = NULL;
  106|       |
  107|  1.07k|  Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   36|  1.07k|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  108|  1.07k|  *pdescription = NULL;
  109|  1.07k|  *ptimeout_ms = 0;
  110|  1.07k|  if(!tqueue->aborted) {
  ------------------
  |  Branch (110:6): [True: 1.07k, False: 0]
  ------------------
  111|  1.07k|    e = Curl_llist_head(&tqueue->sendq);
  112|  1.07k|    if(e) {
  ------------------
  |  Branch (112:8): [True: 617, False: 456]
  ------------------
  113|    617|      struct curltime now = curlx_now();
  114|    617|      timediff_t timeout_ms;
  115|    617|      while(e) {
  ------------------
  |  Branch (115:13): [True: 617, False: 0]
  ------------------
  116|    617|        qitem = Curl_node_take_elem(e);
  117|    617|        timeout_ms = (!qitem->timeout_ms) ? 0 :
  ------------------
  |  Branch (117:22): [True: 86, False: 531]
  ------------------
  118|    617|          (qitem->timeout_ms - curlx_ptimediff_ms(&now, &qitem->start));
  119|    617|        if(timeout_ms < 0) {
  ------------------
  |  Branch (119:12): [True: 0, False: 617]
  ------------------
  120|       |          /* timed out while queued, place on receive queue */
  121|      0|          Curl_llist_append(&tqueue->recvq, qitem, &qitem->node);
  122|      0|          fn_event = tqueue->fn_event;
  123|      0|          fn_user_data = tqueue->fn_user_data;
  124|      0|          qitem = NULL;
  125|      0|          e = Curl_llist_head(&tqueue->sendq);
  126|      0|          continue;
  127|      0|        }
  128|    617|        else {
  129|    617|          *pdescription = qitem->description;
  130|    617|          *ptimeout_ms = timeout_ms;
  131|    617|          break;
  132|    617|        }
  133|    617|      }
  134|    617|    }
  135|  1.07k|  }
  136|  1.07k|  Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   37|  1.07k|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  137|       |  /* avoiding deadlocks */
  138|  1.07k|  if(fn_event)
  ------------------
  |  Branch (138:6): [True: 0, False: 1.07k]
  ------------------
  139|      0|    fn_event(tqueue, CURL_THRDQ_EV_ITEM_DONE, fn_user_data);
  140|  1.07k|  return qitem;
  141|  1.07k|}
thrdqueue.c:thrdq_tpool_process:
  172|    617|{
  173|    617|  struct thrdq_item *qitem = item;
  174|    617|  qitem->fn_process(qitem->item);
  175|    617|}
thrdqueue.c:thrdq_tpool_return:
  144|    617|{
  145|    617|  struct curl_thrdq *tqueue = user_data;
  146|    617|  struct thrdq_item *qitem = item;
  147|    617|  Curl_thrdq_ev_cb *fn_event = NULL;
  148|    617|  void *fn_user_data = NULL;
  149|       |
  150|    617|  if(!tqueue) {
  ------------------
  |  Branch (150:6): [True: 161, False: 456]
  ------------------
  151|    161|    thrdq_item_destroy(item);
  152|    161|    return;
  153|    161|  }
  154|       |
  155|    456|  Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   36|    456|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  156|    456|  if(tqueue->aborted) {
  ------------------
  |  Branch (156:6): [True: 0, False: 456]
  ------------------
  157|      0|    thrdq_item_destroy(qitem);
  158|      0|  }
  159|    456|  else {
  160|    456|    DEBUGASSERT(!Curl_node_llist(&qitem->node));
  ------------------
  |  | 1081|    456|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (160:5): [True: 0, False: 456]
  |  Branch (160:5): [True: 456, False: 0]
  ------------------
  161|    456|    Curl_llist_append(&tqueue->recvq, qitem, &qitem->node);
  162|    456|    fn_event = tqueue->fn_event;
  163|    456|    fn_user_data = tqueue->fn_user_data;
  164|    456|  }
  165|    456|  Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   37|    456|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  166|       |  /* avoiding deadlocks */
  167|    456|  if(fn_event)
  ------------------
  |  Branch (167:6): [True: 456, False: 0]
  ------------------
  168|    456|    fn_event(tqueue, CURL_THRDQ_EV_ITEM_DONE, fn_user_data);
  169|    456|}
thrdqueue.c:thrdq_unlink:
  178|  17.2k|{
  179|  17.2k|  DEBUGASSERT(tqueue->aborted);
  ------------------
  |  | 1081|  17.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (179:3): [True: 0, False: 17.2k]
  |  Branch (179:3): [True: 17.2k, False: 0]
  ------------------
  180|  17.2k|  if(tqueue->tpool) {
  ------------------
  |  Branch (180:6): [True: 17.2k, False: 0]
  ------------------
  181|  17.2k|    if(locked)
  ------------------
  |  Branch (181:8): [True: 17.2k, False: 0]
  ------------------
  182|  17.2k|      Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   37|  17.2k|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  183|  17.2k|    Curl_thrdpool_destroy(tqueue->tpool, join);
  184|  17.2k|    tqueue->tpool = NULL;
  185|  17.2k|    if(locked)
  ------------------
  |  Branch (185:8): [True: 17.2k, False: 0]
  ------------------
  186|  17.2k|      Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   36|  17.2k|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  187|  17.2k|  }
  188|       |
  189|  17.2k|  Curl_llist_destroy(&tqueue->sendq, NULL);
  190|  17.2k|  Curl_llist_destroy(&tqueue->recvq, NULL);
  191|  17.2k|  curlx_free(tqueue->name);
  ------------------
  |  | 1483|  17.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  192|  17.2k|  Curl_cond_destroy(&tqueue->await);
  ------------------
  |  |   41|  17.2k|#  define Curl_cond_destroy(c)   pthread_cond_destroy(c)
  ------------------
  193|  17.2k|  if(locked)
  ------------------
  |  Branch (193:6): [True: 17.2k, False: 0]
  ------------------
  194|  17.2k|    Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   37|  17.2k|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  195|  17.2k|  Curl_mutex_destroy(&tqueue->lock);
  ------------------
  |  |   38|  17.2k|#  define Curl_mutex_destroy(m)  pthread_mutex_destroy(m)
  ------------------
  196|  17.2k|  curlx_free(tqueue);
  ------------------
  |  | 1483|  17.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  197|  17.2k|}
thrdqueue.c:thrdq_item_create:
   68|    617|{
   69|    617|  struct thrdq_item *qitem;
   70|       |
   71|    617|  qitem = curlx_calloc(1, sizeof(*qitem));
  ------------------
  |  | 1480|    617|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   72|    617|  if(!qitem)
  ------------------
  |  Branch (72:6): [True: 0, False: 617]
  ------------------
   73|      0|    return NULL;
   74|    617|  qitem->item = item;
   75|    617|  qitem->description = description;
   76|    617|  qitem->fn_free = tqueue->fn_free;
   77|    617|  qitem->fn_process = tqueue->fn_process;
   78|    617|  if(timeout_ms) {
  ------------------
  |  Branch (78:6): [True: 531, False: 86]
  ------------------
   79|    531|    qitem->start = curlx_now();
   80|    531|    qitem->timeout_ms = timeout_ms;
   81|    531|  }
   82|    617|  return qitem;
   83|    617|}
thrdqueue.c:thrdq_item_destroy:
   86|    617|{
   87|    617|  if(qitem->item)
  ------------------
  |  Branch (87:6): [True: 161, False: 456]
  ------------------
   88|    161|    qitem->fn_free(qitem->item);
   89|    617|  curlx_free(qitem);
  ------------------
  |  | 1483|    617|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   90|    617|}
thrdqueue.c:thrdq_llist_clean_matches:
  327|    196|{
  328|    196|  struct Curl_llist_node *e, *n;
  329|    196|  struct thrdq_item *qitem;
  330|       |
  331|    196|  for(e = Curl_llist_head(llist); e; e = n) {
  ------------------
  |  Branch (331:35): [True: 0, False: 196]
  ------------------
  332|      0|    n = Curl_node_next(e);
  333|      0|    qitem = Curl_node_elem(e);
  334|      0|    if(fn_match(qitem->item, match_data))
  ------------------
  |  Branch (334:8): [True: 0, False: 0]
  ------------------
  335|      0|      Curl_node_remove(e);
  336|      0|  }
  337|    196|}

Curl_checkheaders:
   88|  65.1k|{
   89|  65.1k|  struct curl_slist *head;
   90|  65.1k|  DEBUGASSERT(thislen);
  ------------------
  |  | 1081|  65.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (90:3): [True: 0, False: 65.1k]
  |  Branch (90:3): [True: 65.1k, False: 0]
  ------------------
   91|  65.1k|  DEBUGASSERT(thisheader[thislen - 1] != ':');
  ------------------
  |  | 1081|  65.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (91:3): [True: 0, False: 65.1k]
  |  Branch (91:3): [True: 65.1k, False: 0]
  ------------------
   92|       |
   93|   143k|  for(head = data->set.headers; head; head = head->next) {
  ------------------
  |  Branch (93:33): [True: 78.1k, False: 64.9k]
  ------------------
   94|  78.1k|    if(curl_strnequal(head->data, thisheader, thislen) &&
  ------------------
  |  Branch (94:8): [True: 388, False: 77.7k]
  ------------------
   95|    388|       Curl_headersep(head->data[thislen]))
  ------------------
  |  |   26|    388|#define Curl_headersep(x) ((((x) == ':') || ((x) == ';')))
  |  |  ------------------
  |  |  |  Branch (26:29): [True: 215, False: 173]
  |  |  |  Branch (26:45): [True: 46, False: 127]
  |  |  ------------------
  ------------------
   96|    261|      return head->data;
   97|  78.1k|  }
   98|       |
   99|  64.9k|  return NULL;
  100|  65.1k|}
Curl_meets_timecondition:
  122|      2|{
  123|      2|  if((timeofdoc == 0) || (data->set.timevalue == 0))
  ------------------
  |  Branch (123:6): [True: 2, False: 0]
  |  Branch (123:26): [True: 0, False: 0]
  ------------------
  124|      2|    return TRUE;
  ------------------
  |  | 1055|      2|#define TRUE true
  ------------------
  125|       |
  126|      0|  switch(data->set.timecondition) {
  127|      0|  case CURL_TIMECOND_IFMODSINCE:
  ------------------
  |  | 2411|      0|#define CURL_TIMECOND_IFMODSINCE   1L
  ------------------
  |  Branch (127:3): [True: 0, False: 0]
  ------------------
  128|      0|  default:
  ------------------
  |  Branch (128:3): [True: 0, False: 0]
  ------------------
  129|      0|    if(timeofdoc <= data->set.timevalue) {
  ------------------
  |  Branch (129:8): [True: 0, False: 0]
  ------------------
  130|      0|      infof(data, "The requested document is not new enough");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  131|      0|      data->info.timecond = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  132|      0|      return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  133|      0|    }
  134|      0|    break;
  135|      0|  case CURL_TIMECOND_IFUNMODSINCE:
  ------------------
  |  | 2412|      0|#define CURL_TIMECOND_IFUNMODSINCE 2L
  ------------------
  |  Branch (135:3): [True: 0, False: 0]
  ------------------
  136|      0|    if(timeofdoc >= data->set.timevalue) {
  ------------------
  |  Branch (136:8): [True: 0, False: 0]
  ------------------
  137|      0|      infof(data, "The requested document is not old enough");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  138|      0|      data->info.timecond = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  139|      0|      return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  140|      0|    }
  141|      0|    break;
  142|      0|  }
  143|       |
  144|      0|  return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  145|      0|}
Curl_xfer_send_shutdown:
  162|     27|{
  163|     27|  if(!data || !data->conn)
  ------------------
  |  Branch (163:6): [True: 0, False: 27]
  |  Branch (163:15): [True: 0, False: 27]
  ------------------
  164|      0|    return CURLE_FAILED_INIT;
  165|     27|  return Curl_conn_shutdown(data, data->conn->send_idx, done);
  166|     27|}
Curl_sendrecv:
  357|  3.27M|{
  358|  3.27M|  struct SingleRequest *k = &data->req;
  359|  3.27M|  CURLcode result = CURLE_OK;
  360|       |
  361|  3.27M|  if(Curl_xfer_is_blocked(data)) {
  ------------------
  |  Branch (361:6): [True: 0, False: 3.27M]
  ------------------
  362|      0|    result = CURLE_OK;
  363|      0|    goto out;
  364|      0|  }
  365|       |
  366|       |  /* We go ahead and do a read if we have a readable socket or if the stream
  367|       |     was rewound (in which case we have data in a buffer) */
  368|  3.27M|  if(CURL_REQ_WANT_RECV(data)) {
  ------------------
  |  |   40|  3.27M|#define CURL_REQ_WANT_RECV(d)  ((d)->req.io_flags & REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|  3.27M|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  |  |  |  Branch (40:32): [True: 3.27M, False: 111]
  |  |  ------------------
  ------------------
  369|  3.27M|    result = sendrecv_dl(data, k);
  370|  3.27M|    if(result || data->req.done)
  ------------------
  |  Branch (370:8): [True: 5.34k, False: 3.26M]
  |  Branch (370:18): [True: 45, False: 3.26M]
  ------------------
  371|  5.38k|      goto out;
  372|  3.27M|  }
  373|       |
  374|       |  /* If we still have writing to do, we check if we have a writable socket. */
  375|  3.26M|  if(Curl_req_want_send(data)) {
  ------------------
  |  Branch (375:6): [True: 3.25M, False: 10.1k]
  ------------------
  376|  3.25M|    result = sendrecv_ul(data);
  377|  3.25M|    if(result)
  ------------------
  |  Branch (377:8): [True: 14, False: 3.25M]
  ------------------
  378|     14|      goto out;
  379|  3.25M|  }
  380|       |
  381|  3.26M|  result = Curl_pgrsCheck(data);
  382|  3.26M|  if(result)
  ------------------
  |  Branch (382:6): [True: 0, False: 3.26M]
  ------------------
  383|      0|    goto out;
  384|       |
  385|  3.26M|  if(CURL_REQ_WANT_IO(data)) {
  ------------------
  |  |   42|  3.26M|  ((d)->req.io_flags & (REQ_IO_RECV | REQ_IO_SEND))
  |  |  ------------------
  |  |  |  |   35|  3.26M|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  |  |                 ((d)->req.io_flags & (REQ_IO_RECV | REQ_IO_SEND))
  |  |  ------------------
  |  |  |  |   36|  3.26M|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  |  |  |  Branch (42:3): [True: 3.26M, False: 1.74k]
  |  |  ------------------
  ------------------
  386|  3.26M|    if(Curl_timeleft_ms(data) < 0) {
  ------------------
  |  Branch (386:8): [True: 30, False: 3.26M]
  ------------------
  387|     30|      if(k->size != -1) {
  ------------------
  |  Branch (387:10): [True: 0, False: 30]
  ------------------
  388|      0|        failf(data, "Operation timed out after %" FMT_TIMEDIFF_T
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  389|      0|              " milliseconds with %" FMT_OFF_T " out of %"
  390|      0|              FMT_OFF_T " bytes received",
  391|      0|              curlx_ptimediff_ms(Curl_pgrs_now(data),
  392|      0|                                 &data->progress.t_startsingle),
  393|      0|              k->bytecount, k->size);
  394|      0|      }
  395|     30|      else {
  396|     30|        failf(data, "Operation timed out after %" FMT_TIMEDIFF_T
  ------------------
  |  |   62|     30|#define failf Curl_failf
  ------------------
  397|     30|              " milliseconds with %" FMT_OFF_T " bytes received",
  398|     30|              curlx_ptimediff_ms(Curl_pgrs_now(data),
  399|     30|                                 &data->progress.t_startsingle),
  400|     30|              k->bytecount);
  401|     30|      }
  402|     30|      result = CURLE_OPERATION_TIMEDOUT;
  403|     30|      goto out;
  404|     30|    }
  405|  3.26M|  }
  406|  1.74k|  else {
  407|       |    /*
  408|       |     * The transfer has been performed. Make some general checks before
  409|       |     * returning.
  410|       |     */
  411|  1.74k|    if(!(data->req.no_body) && (k->size != -1) &&
  ------------------
  |  Branch (411:8): [True: 1.73k, False: 9]
  |  Branch (411:32): [True: 423, False: 1.31k]
  ------------------
  412|    423|       (k->bytecount != k->size) && !k->newurl) {
  ------------------
  |  Branch (412:8): [True: 41, False: 382]
  |  Branch (412:37): [True: 40, False: 1]
  ------------------
  413|     40|      failf(data, "transfer closed with %" FMT_OFF_T
  ------------------
  |  |   62|     40|#define failf Curl_failf
  ------------------
  414|     40|            " bytes remaining to read", k->size - k->bytecount);
  415|     40|      result = CURLE_PARTIAL_FILE;
  416|     40|      goto out;
  417|     40|    }
  418|  1.74k|  }
  419|       |
  420|       |  /* If there is nothing more to send/recv, the request is done */
  421|  3.26M|  if(!CURL_REQ_WANT_IO(data))
  ------------------
  |  |   42|  3.26M|  ((d)->req.io_flags & (REQ_IO_RECV | REQ_IO_SEND))
  |  |  ------------------
  |  |  |  |   35|  3.26M|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  |  |                 ((d)->req.io_flags & (REQ_IO_RECV | REQ_IO_SEND))
  |  |  ------------------
  |  |  |  |   36|  3.26M|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  ------------------
  |  Branch (421:6): [True: 1.70k, False: 3.26M]
  ------------------
  422|  1.70k|    data->req.done = TRUE;
  ------------------
  |  | 1055|  1.70k|#define TRUE true
  ------------------
  423|       |
  424|  3.26M|  result = Curl_pgrsUpdate(data);
  425|       |
  426|  3.27M|out:
  427|  3.27M|  if(result)
  ------------------
  |  Branch (427:6): [True: 5.42k, False: 3.26M]
  ------------------
  428|  5.42k|    DEBUGF(infof(data, "Curl_sendrecv() -> %d", result));
  ------------------
  |  | 1067|  3.31M|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 5.42k, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 5.42k]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 5.42k]
  |  |  ------------------
  ------------------
  429|  3.27M|  return result;
  430|  3.26M|}
Curl_init_CONNECT:
  435|  15.6k|{
  436|  15.6k|  data->state.fread_func = data->set.fread_func_set;
  437|  15.6k|  data->state.in = data->set.in_set;
  438|  15.6k|  data->state.upload = (data->state.httpreq == HTTPREQ_PUT);
  439|  15.6k|}
Curl_pretransfer:
  447|  18.0k|{
  448|  18.0k|  CURLcode result = CURLE_OK;
  449|       |
  450|       |  /* Reset the retry count at the start of each request.
  451|       |   * If the retry count is not reset, when the connection drops,
  452|       |   * it will not enter the retry mechanism on CONN_MAX_RETRIES + 1 attempts
  453|       |   * and will immediately throw
  454|       |   * "Connection died, tried CONN_MAX_RETRIES times before giving up".
  455|       |   * By resetting it here, we ensure each new request starts fresh. */
  456|  18.0k|  data->state.retrycount = 0;
  457|       |
  458|  18.0k|  if(!data->set.str[STRING_SET_URL] && !data->set.uh) {
  ------------------
  |  Branch (458:6): [True: 3.32k, False: 14.7k]
  |  Branch (458:40): [True: 3.32k, False: 0]
  ------------------
  459|       |    /* we cannot do anything without URL */
  460|  3.32k|    failf(data, "No URL set");
  ------------------
  |  |   62|  3.32k|#define failf Curl_failf
  ------------------
  461|  3.32k|    return CURLE_URL_MALFORMAT;
  462|  3.32k|  }
  463|       |
  464|       |  /* CURLOPT_CURLU overrides CURLOPT_URL and the contents of the CURLU handle
  465|       |     is allowed to be changed by the user between transfers */
  466|  14.7k|  if(data->set.uh) {
  ------------------
  |  Branch (466:6): [True: 0, False: 14.7k]
  ------------------
  467|      0|    CURLUcode uc;
  468|      0|    curlx_free(data->set.str[STRING_SET_URL]);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  469|      0|    uc = curl_url_get(data->set.uh,
  470|      0|                      CURLUPART_URL, &data->set.str[STRING_SET_URL], 0);
  471|      0|    if(uc) {
  ------------------
  |  Branch (471:8): [True: 0, False: 0]
  ------------------
  472|       |      /* clear the pointer to not point to freed memory anymore */
  473|      0|      Curl_bufref_set(&data->state.url, NULL, 0, NULL);
  474|      0|      failf(data, "No URL set");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  475|      0|      return CURLE_URL_MALFORMAT;
  476|      0|    }
  477|      0|  }
  478|       |
  479|  14.7k|  Curl_bufref_set(&data->state.url, data->set.str[STRING_SET_URL], 0, NULL);
  480|       |
  481|  14.7k|  if(data->set.postfields && data->set.set_resume_from) {
  ------------------
  |  Branch (481:6): [True: 878, False: 13.8k]
  |  Branch (481:30): [True: 14, False: 864]
  ------------------
  482|       |    /* we cannot */
  483|     14|    failf(data, "cannot mix POSTFIELDS with RESUME_FROM");
  ------------------
  |  |   62|     14|#define failf Curl_failf
  ------------------
  484|     14|    return CURLE_BAD_FUNCTION_ARGUMENT;
  485|     14|  }
  486|       |
  487|  14.6k|  data->state.prefer_ascii = data->set.prefer_ascii;
  488|  14.6k|#ifdef CURL_LIST_ONLY_PROTOCOL
  489|  14.6k|  data->state.list_only = data->set.list_only;
  490|  14.6k|#endif
  491|  14.6k|  data->state.httpreq = data->set.method;
  492|       |
  493|       |  /* initial transfer request coming up, forget the initial origin
  494|       |   * from a previous perform() on this handle. */
  495|  14.6k|  Curl_peer_unlink(&data->state.initial_origin);
  496|  14.6k|  data->state.requests = 0;
  497|  14.6k|  data->state.followlocation = 0; /* reset the location-follow counter */
  498|  14.6k|  data->state.this_is_a_follow = FALSE; /* reset this */
  ------------------
  |  | 1058|  14.6k|#define FALSE false
  ------------------
  499|  14.6k|  data->state.http_ignorecustom = FALSE; /* use custom HTTP method */
  ------------------
  |  | 1058|  14.6k|#define FALSE false
  ------------------
  500|  14.6k|  data->state.errorbuf = FALSE; /* no error has occurred */
  ------------------
  |  | 1058|  14.6k|#define FALSE false
  ------------------
  501|  14.6k|#ifndef CURL_DISABLE_HTTP
  502|  14.6k|  Curl_http_neg_init(data, &data->state.http_neg);
  503|  14.6k|#endif
  504|  14.6k|  data->state.authproblem = FALSE;
  ------------------
  |  | 1058|  14.6k|#define FALSE false
  ------------------
  505|  14.6k|  data->state.authhost.want = data->set.httpauth;
  506|  14.6k|  data->state.authproxy.want = data->set.proxyauth;
  507|  14.6k|  curlx_safefree(data->info.wouldredirect);
  ------------------
  |  | 1327|  14.6k|  do {                      \
  |  | 1328|  14.6k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  14.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  14.6k|    (ptr) = NULL;           \
  |  | 1330|  14.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 14.6k]
  |  |  ------------------
  ------------------
  508|  14.6k|  Curl_data_priority_clear_state(data);
  509|  14.6k|  if(data->set.http_auto_referer)
  ------------------
  |  Branch (509:6): [True: 23, False: 14.6k]
  ------------------
  510|     23|    Curl_bufref_free(&data->state.referer);
  511|  14.6k|  if(data->set.str[STRING_SET_REFERER])
  ------------------
  |  Branch (511:6): [True: 173, False: 14.5k]
  ------------------
  512|    173|    Curl_bufref_set(&data->state.referer, data->set.str[STRING_SET_REFERER],
  513|    173|                    0, NULL);
  514|  14.5k|  else
  515|  14.5k|    Curl_bufref_free(&data->state.referer);
  516|       |
  517|  14.6k|  if(data->state.httpreq == HTTPREQ_PUT)
  ------------------
  |  Branch (517:6): [True: 266, False: 14.4k]
  ------------------
  518|    266|    data->state.infilesize = data->set.filesize;
  519|  14.4k|  else if((data->state.httpreq != HTTPREQ_GET) &&
  ------------------
  |  Branch (519:11): [True: 1.77k, False: 12.6k]
  ------------------
  520|  1.77k|          (data->state.httpreq != HTTPREQ_HEAD)) {
  ------------------
  |  Branch (520:11): [True: 1.51k, False: 266]
  ------------------
  521|  1.51k|    data->state.infilesize = data->set.postfieldsize;
  522|  1.51k|    if(data->set.postfields && (data->state.infilesize == -1))
  ------------------
  |  Branch (522:8): [True: 864, False: 647]
  |  Branch (522:32): [True: 215, False: 649]
  ------------------
  523|    215|      data->state.infilesize = (curl_off_t)strlen(data->set.postfields);
  524|  1.51k|  }
  525|  12.9k|  else
  526|  12.9k|    data->state.infilesize = 0;
  527|       |
  528|       |  /* If there is a list of cookie files to read, do it now! */
  529|  14.6k|  result = Curl_cookie_loadfiles(data);
  530|  14.6k|  if(!result)
  ------------------
  |  Branch (530:6): [True: 14.6k, False: 0]
  ------------------
  531|  14.6k|    Curl_cookie_run(data); /* activate */
  532|       |
  533|       |  /* If there is a list of host pairs to deal with */
  534|  14.6k|  if(!result && data->state.resolve)
  ------------------
  |  Branch (534:6): [True: 14.6k, False: 0]
  |  Branch (534:17): [True: 0, False: 14.6k]
  ------------------
  535|      0|    result = Curl_loadhostpairs(data);
  536|       |
  537|  14.6k|  if(!result)
  ------------------
  |  Branch (537:6): [True: 14.6k, False: 0]
  ------------------
  538|       |    /* If there is a list of hsts files to read */
  539|  14.6k|    result = Curl_hsts_loadfiles(data);
  540|       |
  541|  14.6k|  if(!result) {
  ------------------
  |  Branch (541:6): [True: 14.6k, False: 0]
  ------------------
  542|       |    /* Allow data->set.use_port to set which port to use. This needs to be
  543|       |     * disabled for example when we follow Location: headers to URLs using
  544|       |     * different ports! */
  545|  14.6k|    data->state.allow_port = TRUE;
  ------------------
  |  | 1055|  14.6k|#define TRUE true
  ------------------
  546|       |
  547|       |#if defined(HAVE_SIGNAL) && defined(SIGPIPE) && !defined(MSG_NOSIGNAL)
  548|       |    /*************************************************************
  549|       |     * Tell signal handler to ignore SIGPIPE
  550|       |     *************************************************************/
  551|       |    if(!data->set.no_signal)
  552|       |      data->state.prev_signal = signal(SIGPIPE, SIG_IGN);
  553|       |#endif
  554|       |
  555|  14.6k|    Curl_initinfo(data); /* reset session-specific information "variables" */
  556|  14.6k|    Curl_pgrsResetTransferSizes(data);
  557|  14.6k|    Curl_pgrsStartNow(data);
  558|       |
  559|       |    /* In case the handle is reused and an authentication method was picked
  560|       |       in the session we need to make sure we only use the one(s) we now
  561|       |       consider to be fine */
  562|  14.6k|    data->state.authhost.picked &= data->state.authhost.want;
  563|  14.6k|    data->state.authproxy.picked &= data->state.authproxy.want;
  564|       |
  565|  14.6k|#ifndef CURL_DISABLE_FTP
  566|  14.6k|    data->state.wildcardmatch = data->set.wildcard_enabled;
  567|  14.6k|    if(data->state.wildcardmatch) {
  ------------------
  |  Branch (567:8): [True: 768, False: 13.9k]
  ------------------
  568|    768|      struct WildcardData *wc;
  569|    768|      if(!data->wildcard) {
  ------------------
  |  Branch (569:10): [True: 584, False: 184]
  ------------------
  570|    584|        data->wildcard = curlx_calloc(1, sizeof(struct WildcardData));
  ------------------
  |  | 1480|    584|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  571|    584|        if(!data->wildcard)
  ------------------
  |  Branch (571:12): [True: 0, False: 584]
  ------------------
  572|      0|          return CURLE_OUT_OF_MEMORY;
  573|    584|      }
  574|    768|      wc = data->wildcard;
  575|    768|      if(wc->state < CURLWC_INIT) {
  ------------------
  |  Branch (575:10): [True: 584, False: 184]
  ------------------
  576|    584|        if(wc->ftpwc)
  ------------------
  |  Branch (576:12): [True: 0, False: 584]
  ------------------
  577|      0|          wc->dtor(wc->ftpwc);
  578|    584|        curlx_safefree(wc->pattern);
  ------------------
  |  | 1327|    584|  do {                      \
  |  | 1328|    584|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|    584|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|    584|    (ptr) = NULL;           \
  |  | 1330|    584|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 584]
  |  |  ------------------
  ------------------
  579|    584|        curlx_safefree(wc->path);
  ------------------
  |  | 1327|    584|  do {                      \
  |  | 1328|    584|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|    584|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|    584|    (ptr) = NULL;           \
  |  | 1330|    584|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 584]
  |  |  ------------------
  ------------------
  580|    584|        Curl_wildcard_init(wc); /* init wildcard structures */
  581|    584|      }
  582|    768|    }
  583|  14.6k|#endif
  584|  14.6k|    result = Curl_hsts_loadcb(data, data->hsts);
  585|  14.6k|  }
  586|       |
  587|       |  /*
  588|       |   * Set user-agent. Used for HTTP, but since we can attempt to tunnel
  589|       |   * anything through an HTTP proxy we cannot limit this based on protocol.
  590|       |   */
  591|  14.6k|  if(!result && data->set.str[STRING_USERAGENT]) {
  ------------------
  |  Branch (591:6): [True: 14.6k, False: 0]
  |  Branch (591:17): [True: 990, False: 13.7k]
  ------------------
  592|    990|    curlx_free(data->state.aptr.uagent);
  ------------------
  |  | 1483|    990|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  593|    990|    data->state.aptr.uagent =
  594|    990|      curl_maprintf("User-Agent: %s\r\n", data->set.str[STRING_USERAGENT]);
  595|    990|    if(!data->state.aptr.uagent)
  ------------------
  |  Branch (595:8): [True: 0, False: 990]
  ------------------
  596|      0|      return CURLE_OUT_OF_MEMORY;
  597|    990|  }
  598|       |
  599|  14.6k|  data->req.headerbytecount = 0;
  600|  14.6k|  Curl_headers_cleanup(data);
  601|  14.6k|  return result;
  602|  14.6k|}
Curl_retry_request:
  608|  2.12k|{
  609|  2.12k|  struct connectdata *conn = data->conn;
  610|  2.12k|  bool retry = FALSE;
  ------------------
  |  | 1058|  2.12k|#define FALSE false
  ------------------
  611|  2.12k|  *url = NULL;
  612|       |
  613|       |  /* if we are talking upload, we cannot do the checks below, unless the
  614|       |     protocol is HTTP as when uploading over HTTP we will still get a
  615|       |     response */
  616|  2.12k|  if(data->state.upload &&
  ------------------
  |  Branch (616:6): [True: 93, False: 2.03k]
  ------------------
  617|     93|     !(conn->scheme->protocol & (PROTO_FAMILY_HTTP | CURLPROTO_RTSP)))
  ------------------
  |  |   84|     93|#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1078|     93|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1079|     93|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  |   63|     93|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   85|     93|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   64|     93|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
                   !(conn->scheme->protocol & (PROTO_FAMILY_HTTP | CURLPROTO_RTSP)))
  ------------------
  |  | 1096|     93|#define CURLPROTO_RTSP    (1L << 18)
  ------------------
  |  Branch (617:6): [True: 27, False: 66]
  ------------------
  618|     27|    return CURLE_OK;
  619|       |
  620|  2.09k|  if(conn->bits.reuse &&
  ------------------
  |  Branch (620:6): [True: 89, False: 2.00k]
  ------------------
  621|     89|     (data->req.bytecount + data->req.headerbytecount == 0) &&
  ------------------
  |  Branch (621:6): [True: 89, False: 0]
  ------------------
  622|     89|     ((!data->req.no_body && !data->req.done) ||
  ------------------
  |  Branch (622:8): [True: 89, False: 0]
  |  Branch (622:30): [True: 0, False: 89]
  ------------------
  623|     89|      (conn->scheme->protocol & PROTO_FAMILY_HTTP))
  ------------------
  |  |   84|     89|#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1078|     89|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1079|     89|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  |   63|     89|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   85|     89|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   64|     89|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
  |  Branch (623:7): [True: 89, False: 0]
  ------------------
  624|     89|#ifndef CURL_DISABLE_RTSP
  625|     89|     && (data->set.rtspreq != RTSPREQ_RECEIVE)
  ------------------
  |  Branch (625:9): [True: 89, False: 0]
  ------------------
  626|  2.09k|#endif
  627|  2.09k|    )
  628|       |    /* We got no data, we attempted to reuse a connection. For HTTP this
  629|       |       can be a retry so we try again regardless if we expected a body.
  630|       |       For other protocols we only try again only if we expected a body.
  631|       |
  632|       |       This might happen if the connection was left alive when we were
  633|       |       done using it before, but that was closed when we wanted to read from
  634|       |       it again. Bad luck. Retry the same request on a fresh connect! */
  635|     89|    retry = TRUE;
  ------------------
  |  | 1055|     89|#define TRUE true
  ------------------
  636|  2.00k|  else if(data->state.refused_stream &&
  ------------------
  |  Branch (636:11): [True: 330, False: 1.67k]
  ------------------
  637|    330|          (data->req.bytecount + data->req.headerbytecount == 0)) {
  ------------------
  |  Branch (637:11): [True: 329, False: 1]
  ------------------
  638|       |    /* This was sent on a refused stream, safe to rerun. A refused stream
  639|       |       error can typically only happen on HTTP/2 level if the stream is safe
  640|       |       to issue again, but the nghttp2 API can deliver the message to other
  641|       |       streams as well, which is why this adds the check the data counters
  642|       |       too. */
  643|    329|    infof(data, "REFUSED_STREAM, retrying a fresh connect");
  ------------------
  |  |  143|    329|  do {                               \
  |  |  144|    329|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    329|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 329, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 329]
  |  |  |  |  ------------------
  |  |  |  |  320|    329|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    329|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    329|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 329]
  |  |  ------------------
  ------------------
  644|    329|    data->state.refused_stream = FALSE; /* clear again */
  ------------------
  |  | 1058|    329|#define FALSE false
  ------------------
  645|    329|    retry = TRUE;
  ------------------
  |  | 1055|    329|#define TRUE true
  ------------------
  646|    329|  }
  647|  2.09k|  if(retry) {
  ------------------
  |  Branch (647:6): [True: 418, False: 1.68k]
  ------------------
  648|    418|#define CONN_MAX_RETRIES 5
  649|    418|    if(data->state.retrycount++ >= CONN_MAX_RETRIES) {
  ------------------
  |  |  648|    418|#define CONN_MAX_RETRIES 5
  ------------------
  |  Branch (649:8): [True: 0, False: 418]
  ------------------
  650|      0|      failf(data, "Connection died, tried %d times before giving up",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  651|      0|            CONN_MAX_RETRIES);
  ------------------
  |  |  648|      0|#define CONN_MAX_RETRIES 5
  ------------------
  652|      0|      data->state.retrycount = 0;
  653|      0|      return CURLE_SEND_ERROR;
  654|      0|    }
  655|    418|    infof(data, "Connection died, retrying a fresh connect (retry count: %d)",
  ------------------
  |  |  143|    418|  do {                               \
  |  |  144|    418|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    418|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 418, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 418]
  |  |  |  |  ------------------
  |  |  |  |  320|    418|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    418|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    418|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 418]
  |  |  ------------------
  ------------------
  656|    418|          data->state.retrycount);
  657|    418|    *url = Curl_bufref_dup(&data->state.url);
  ------------------
  |  |   49|    418|#define Curl_bufref_dup(x) curlx_strdup(Curl_bufref_ptr(x))
  |  |  ------------------
  |  |  |  | 1477|    418|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
  658|    418|    if(!*url)
  ------------------
  |  Branch (658:8): [True: 0, False: 418]
  ------------------
  659|      0|      return CURLE_OUT_OF_MEMORY;
  660|       |
  661|    418|    connclose(conn, "retry"); /* close this connection */
  ------------------
  |  |  103|    418|#define connclose(x, y)   Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
  |  |  ------------------
  |  |  |  |   91|    418|#define CONNCTRL_CONNECTION 1
  |  |  ------------------
  ------------------
  662|    418|    conn->bits.retry = TRUE; /* mark this as a connection we are about to
  ------------------
  |  | 1055|    418|#define TRUE true
  ------------------
  663|       |                                retry. Marking it this way should prevent i.e
  664|       |                                HTTP transfers to return error because nothing
  665|       |                                has been transferred! */
  666|    418|    Curl_creader_set_rewind(data, TRUE);
  ------------------
  |  | 1055|    418|#define TRUE true
  ------------------
  667|    418|  }
  668|  2.09k|  return CURLE_OK;
  669|  2.09k|}
Curl_xfer_setup_nop:
  717|    100|{
  718|    100|  xfer_setup(data, -1, -1, -1);
  719|    100|}
Curl_xfer_setup_sendrecv:
  724|  6.82k|{
  725|  6.82k|  xfer_setup(data, sockindex, sockindex, recv_size);
  726|  6.82k|}
Curl_xfer_setup_send:
  730|     34|{
  731|     34|  xfer_setup(data, sockindex, -1, -1);
  732|     34|}
Curl_xfer_setup_recv:
  737|    630|{
  738|    630|  xfer_setup(data, -1, sockindex, recv_size);
  739|    630|}
Curl_xfer_set_shutdown:
  744|    664|{
  745|       |  /* Shutdown should only be set when the transfer only sends or receives. */
  746|    664|  DEBUGASSERT(!shutdown ||
  ------------------
  |  | 1081|    664|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (746:3): [True: 664, False: 0]
  |  Branch (746:3): [True: 0, False: 0]
  |  Branch (746:3): [True: 0, False: 0]
  |  Branch (746:3): [True: 0, False: 664]
  |  Branch (746:3): [True: 630, False: 34]
  |  Branch (746:3): [True: 34, False: 0]
  ------------------
  747|    664|              (data->conn->send_idx < 0) || (data->conn->recv_idx < 0));
  748|    664|  data->req.shutdown = shutdown;
  749|    664|  data->req.shutdown_err_ignore = ignore_errors;
  750|    664|}
Curl_xfer_write_resp:
  755|  97.5k|{
  756|  97.5k|  CURLcode result = CURLE_OK;
  757|       |
  758|  97.5k|  if(data->conn->scheme->run->write_resp) {
  ------------------
  |  Branch (758:6): [True: 96.4k, False: 1.07k]
  ------------------
  759|       |    /* protocol handlers offering this function take full responsibility
  760|       |     * for writing all received download data to the client. */
  761|  96.4k|    result = data->conn->scheme->run->write_resp(data, buf, blen, is_eos);
  762|  96.4k|  }
  763|  1.07k|  else {
  764|       |    /* No special handling by protocol handler, write all received data
  765|       |     * as BODY to the client. */
  766|  1.07k|    if(blen || is_eos) {
  ------------------
  |  Branch (766:8): [True: 448, False: 628]
  |  Branch (766:16): [True: 628, False: 0]
  ------------------
  767|  1.07k|      int cwtype = CLIENTWRITE_BODY;
  ------------------
  |  |   42|  1.07k|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  768|  1.07k|      if(is_eos)
  ------------------
  |  Branch (768:10): [True: 628, False: 448]
  ------------------
  769|    628|        cwtype |= CLIENTWRITE_EOS;
  ------------------
  |  |   49|    628|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
  770|  1.07k|      result = Curl_client_write(data, cwtype, buf, blen);
  771|  1.07k|    }
  772|  1.07k|  }
  773|       |
  774|  97.5k|  if(!result && is_eos) {
  ------------------
  |  Branch (774:6): [True: 96.3k, False: 1.18k]
  |  Branch (774:17): [True: 1.51k, False: 94.8k]
  ------------------
  775|       |    /* If we wrote the EOS, we are definitely done */
  776|  1.51k|    data->req.eos_written = TRUE;
  ------------------
  |  | 1055|  1.51k|#define TRUE true
  ------------------
  777|  1.51k|    data->req.download_done = TRUE;
  ------------------
  |  | 1055|  1.51k|#define TRUE true
  ------------------
  778|  1.51k|  }
  779|  97.5k|  CURL_TRC_WRITE(data, "xfer_write_resp(len=%zu, eos=%d) -> %d",
  ------------------
  |  |  158|  97.5k|  do {                                                     \
  |  |  159|  97.5k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  326|  97.5k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|   195k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 97.5k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 97.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|   195k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  97.5k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|  97.5k|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|  97.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 97.5k]
  |  |  ------------------
  ------------------
  780|  97.5k|                 blen, is_eos, result);
  781|  97.5k|  return result;
  782|  97.5k|}
Curl_xfer_write_is_paused:
  785|    402|{
  786|    402|  return Curl_cwriter_is_paused(data);
  787|    402|}
Curl_xfer_write_resp_hd:
  791|  32.7k|{
  792|  32.7k|  if(data->conn->scheme->run->write_resp_hd) {
  ------------------
  |  Branch (792:6): [True: 32.7k, False: 0]
  ------------------
  793|  32.7k|    DEBUGASSERT(!hd0[hdlen]); /* null-terminated */
  ------------------
  |  | 1081|  32.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (793:5): [True: 0, False: 32.7k]
  |  Branch (793:5): [True: 32.7k, False: 0]
  ------------------
  794|       |    /* protocol handlers offering this function take full responsibility
  795|       |     * for writing all received download data to the client. */
  796|  32.7k|    return data->conn->scheme->run->write_resp_hd(data, hd0, hdlen, is_eos);
  797|  32.7k|  }
  798|       |  /* No special handling by protocol handler, write as response bytes */
  799|      0|  return Curl_xfer_write_resp(data, hd0, hdlen, is_eos);
  800|  32.7k|}
Curl_xfer_write_done:
  803|  13.8k|{
  804|  13.8k|  (void)premature;
  805|  13.8k|  return Curl_cw_out_done(data);
  806|  13.8k|}
Curl_xfer_needs_flush:
  809|  14.9M|{
  810|  14.9M|  return Curl_conn_needs_flush(data, data->conn->send_idx);
  811|  14.9M|}
Curl_xfer_flush:
  814|  2.98M|{
  815|  2.98M|  return Curl_conn_flush(data, data->conn->send_idx);
  816|  2.98M|}
Curl_xfer_send:
  821|   279k|{
  822|   279k|  CURLcode result;
  823|       |
  824|   279k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|   279k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (824:3): [True: 0, False: 279k]
  |  Branch (824:3): [True: 279k, False: 0]
  ------------------
  825|   279k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|   279k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (825:3): [True: 0, False: 279k]
  |  Branch (825:3): [True: 279k, False: 0]
  ------------------
  826|       |
  827|   279k|  result = Curl_conn_send(data, data->conn->send_idx,
  828|   279k|                          buf, blen, eos, pnwritten);
  829|   279k|  if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (829:6): [True: 272k, False: 7.03k]
  ------------------
  830|   272k|    result = CURLE_OK;
  831|   272k|    *pnwritten = 0;
  832|   272k|  }
  833|  7.03k|  else if(!result && *pnwritten)
  ------------------
  |  Branch (833:11): [True: 6.99k, False: 42]
  |  Branch (833:22): [True: 6.97k, False: 23]
  ------------------
  834|  6.97k|    data->info.request_size += *pnwritten;
  835|       |
  836|   279k|  DEBUGF(infof(data, "Curl_xfer_send(len=%zu, eos=%d) -> %d, %zu",
  ------------------
  |  | 1067|  1.95M|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 279k, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 279k]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 279k]
  |  |  ------------------
  ------------------
  837|   279k|               blen, eos, result, *pnwritten));
  838|   279k|  return result;
  839|   279k|}
Curl_xfer_recv:
  844|  3.35M|{
  845|  3.35M|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  3.35M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (845:3): [True: 0, False: 3.35M]
  |  Branch (845:3): [True: 3.35M, False: 0]
  ------------------
  846|  3.35M|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|  3.35M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (846:3): [True: 0, False: 3.35M]
  |  Branch (846:3): [True: 3.35M, False: 0]
  ------------------
  847|  3.35M|  DEBUGASSERT(data->set.buffer_size > 0);
  ------------------
  |  | 1081|  3.35M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (847:3): [True: 0, False: 3.35M]
  |  Branch (847:3): [True: 3.35M, False: 0]
  ------------------
  848|       |
  849|  3.35M|  if(curlx_uitouz(data->set.buffer_size) < blen)
  ------------------
  |  Branch (849:6): [True: 0, False: 3.35M]
  ------------------
  850|      0|    blen = curlx_uitouz(data->set.buffer_size);
  851|  3.35M|  return Curl_conn_recv(data, data->conn->recv_idx, buf, blen, pnrcvd);
  852|  3.35M|}
Curl_xfer_send_close:
  855|  6.70k|{
  856|  6.70k|  Curl_conn_ev_data_done_send(data);
  857|  6.70k|  return CURLE_OK;
  858|  6.70k|}
Curl_xfer_is_blocked:
  861|  3.27M|{
  862|  3.27M|  bool want_send = CURL_REQ_WANT_SEND(data);
  ------------------
  |  |   39|  3.27M|#define CURL_REQ_WANT_SEND(d)  ((d)->req.io_flags & REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|  3.27M|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  ------------------
  863|  3.27M|  bool want_recv = CURL_REQ_WANT_RECV(data);
  ------------------
  |  |   40|  3.27M|#define CURL_REQ_WANT_RECV(d)  ((d)->req.io_flags & REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|  3.27M|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  ------------------
  864|  3.27M|  if(!want_send)
  ------------------
  |  Branch (864:6): [True: 3.00M, False: 273k]
  ------------------
  865|  3.00M|    return want_recv && Curl_xfer_recv_is_paused(data);
  ------------------
  |  Branch (865:12): [True: 3.00M, False: 14]
  |  Branch (865:25): [True: 0, False: 3.00M]
  ------------------
  866|   273k|  else if(!want_recv)
  ------------------
  |  Branch (866:11): [True: 97, False: 273k]
  ------------------
  867|     97|    return want_send && Curl_xfer_send_is_paused(data);
  ------------------
  |  Branch (867:12): [True: 97, False: 0]
  |  Branch (867:25): [True: 0, False: 97]
  ------------------
  868|   273k|  else
  869|   273k|    return Curl_xfer_recv_is_paused(data) && Curl_xfer_send_is_paused(data);
  ------------------
  |  Branch (869:12): [True: 0, False: 273k]
  |  Branch (869:46): [True: 0, False: 0]
  ------------------
  870|  3.27M|}
Curl_xfer_send_is_paused:
  873|   150k|{
  874|   150k|  return Curl_rlimit_is_blocked(&data->progress.ul.rlimit);
  875|   150k|}
Curl_xfer_recv_is_paused:
  878|  3.58M|{
  879|  3.58M|  return Curl_rlimit_is_blocked(&data->progress.dl.rlimit);
  880|  3.58M|}
Curl_xfer_is_secure:
  904|  10.0k|{
  905|  10.0k|  const struct Curl_scheme *scheme = NULL;
  906|       |
  907|  10.0k|  if(data->conn) {
  ------------------
  |  Branch (907:6): [True: 10.0k, False: 0]
  ------------------
  908|  10.0k|    scheme = data->conn->scheme;
  909|       |    /* if we are connected, but not use SSL, the transfer is not secure.
  910|       |     * This covers an insecure http:// proxy that is not tunneling.
  911|       |     * We enforce tunneling for such cases, but better be sure here. */
  912|  10.0k|    if(Curl_conn_is_connected(data->conn, FIRSTSOCKET) &&
  ------------------
  |  |  303|  10.0k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (912:8): [True: 10.0k, False: 0]
  ------------------
  913|  10.0k|       !Curl_conn_is_ssl(data->conn, FIRSTSOCKET))
  ------------------
  |  |  303|  10.0k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (913:8): [True: 10.0k, False: 0]
  ------------------
  914|  10.0k|      return FALSE;
  ------------------
  |  | 1058|  10.0k|#define FALSE false
  ------------------
  915|  10.0k|  }
  916|      0|  else if(data->info.conn_scheme) { /* was connected once */
  ------------------
  |  Branch (916:11): [True: 0, False: 0]
  ------------------
  917|      0|    scheme = Curl_get_scheme(data->info.conn_scheme);
  918|      0|  }
  919|      0|  else { /* never connected (yet?) */
  920|      0|    DEBUGASSERT(0); /* not implemented, would need to parse URL */
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (920:5): [Folded, False: 0]
  |  Branch (920:5): [Folded, False: 0]
  ------------------
  921|      0|  }
  922|      0|  return scheme ? (scheme->flags & PROTOPT_SSL) : FALSE;
  ------------------
  |  |  207|      0|#define PROTOPT_SSL (1 << 0)       /* uses SSL */
  ------------------
                return scheme ? (scheme->flags & PROTOPT_SSL) : FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  |  Branch (922:10): [True: 0, False: 0]
  ------------------
  923|  10.0k|}
transfer.c:sendrecv_dl:
  223|  3.27M|{
  224|  3.27M|  struct connectdata *conn = data->conn;
  225|  3.27M|  CURLcode result = CURLE_OK;
  226|  3.27M|  char *buf, *xfer_buf;
  227|  3.27M|  size_t blen, xfer_blen;
  228|  3.27M|  int maxloops = 10;
  229|  3.27M|  bool is_multiplex = FALSE;
  ------------------
  |  | 1058|  3.27M|#define FALSE false
  ------------------
  230|  3.27M|  bool rcvd_eagain = FALSE;
  ------------------
  |  | 1058|  3.27M|#define FALSE false
  ------------------
  231|  3.27M|  bool is_eos = FALSE, rate_limited = FALSE;
  ------------------
  |  | 1058|  3.27M|#define FALSE false
  ------------------
                bool is_eos = FALSE, rate_limited = FALSE;
  ------------------
  |  | 1058|  3.27M|#define FALSE false
  ------------------
  232|       |
  233|  3.27M|  result = Curl_multi_xfer_buf_borrow(data, &xfer_buf, &xfer_blen);
  234|  3.27M|  if(result)
  ------------------
  |  Branch (234:6): [True: 0, False: 3.27M]
  ------------------
  235|      0|    goto out;
  236|       |
  237|       |  /* This is where we loop until we have read everything there is to
  238|       |     read or we get a CURLE_AGAIN */
  239|  3.35M|  do {
  240|  3.35M|    size_t bytestoread;
  241|       |
  242|  3.35M|    if(!is_multiplex) {
  ------------------
  |  Branch (242:8): [True: 3.35M, False: 0]
  ------------------
  243|       |      /* Multiplexed connection have inherent handling of EOF and we do not
  244|       |       * have to carefully restrict the amount we try to read.
  245|       |       * Multiplexed changes only in one direction. */
  246|  3.35M|      is_multiplex = Curl_conn_is_multiplex(conn, FIRSTSOCKET);
  ------------------
  |  |  303|  3.35M|#define FIRSTSOCKET     0
  ------------------
  247|  3.35M|    }
  248|       |
  249|  3.35M|    buf = xfer_buf;
  250|  3.35M|    bytestoread = xfer_blen;
  251|       |
  252|  3.35M|    if(bytestoread && Curl_rlimit_active(&data->progress.dl.rlimit)) {
  ------------------
  |  Branch (252:8): [True: 3.35M, False: 0]
  |  Branch (252:23): [True: 1.94M, False: 1.41M]
  ------------------
  253|  1.94M|      curl_off_t dl_avail = Curl_rlimit_avail(&data->progress.dl.rlimit,
  254|  1.94M|                                              Curl_pgrs_now(data));
  255|       |#if 0
  256|       |      DEBUGF(infof(data, "dl_rlimit, available=%" FMT_OFF_T, dl_avail));
  257|       |#endif
  258|       |      /* In case of rate limited downloads: if this loop already got data and
  259|       |       * less than 16k is left in the limit, break out. We want to stutter a
  260|       |       * bit to keep in the limit, but too small receives will cost cpu
  261|       |       * unnecessarily. */
  262|  1.94M|      if(dl_avail <= 0) {
  ------------------
  |  Branch (262:10): [True: 71, False: 1.94M]
  ------------------
  263|     71|        rate_limited = TRUE;
  ------------------
  |  | 1055|     71|#define TRUE true
  ------------------
  264|     71|        break;
  265|     71|      }
  266|  1.94M|      if(dl_avail < (curl_off_t)bytestoread)
  ------------------
  |  Branch (266:10): [True: 402k, False: 1.54M]
  ------------------
  267|   402k|        bytestoread = (size_t)dl_avail;
  268|  1.94M|    }
  269|       |
  270|  3.35M|    rcvd_eagain = FALSE;
  ------------------
  |  | 1058|  3.35M|#define FALSE false
  ------------------
  271|  3.35M|    result = xfer_recv_resp(data, buf, bytestoread, is_multiplex, &blen);
  272|  3.35M|    if(result) {
  ------------------
  |  Branch (272:8): [True: 3.26M, False: 97.1k]
  ------------------
  273|  3.26M|      if(result != CURLE_AGAIN)
  ------------------
  |  Branch (273:10): [True: 4.15k, False: 3.25M]
  ------------------
  274|  4.15k|        goto out; /* real error */
  275|  3.25M|      rcvd_eagain = TRUE;
  ------------------
  |  | 1055|  3.25M|#define TRUE true
  ------------------
  276|  3.25M|      result = CURLE_OK;
  277|  3.25M|      if(data->req.download_done && data->req.no_body &&
  ------------------
  |  Branch (277:10): [True: 0, False: 3.25M]
  |  Branch (277:37): [True: 0, False: 0]
  ------------------
  278|      0|         !data->req.resp_trailer) {
  ------------------
  |  Branch (278:10): [True: 0, False: 0]
  ------------------
  279|      0|        DEBUGF(infof(data, "EAGAIN, download done, no trailer announced, "
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
  280|      0|                     "not waiting for EOS"));
  281|      0|        blen = 0;
  282|       |        /* continue as if we received the EOS */
  283|      0|      }
  284|  3.25M|      else
  285|  3.25M|        break; /* get out of loop */
  286|  3.25M|    }
  287|       |
  288|       |    /* We only get a 0-length receive at the end of the response */
  289|  97.1k|    is_eos = (blen == 0);
  290|       |
  291|  97.1k|    if(!blen) {
  ------------------
  |  Branch (291:8): [True: 1.63k, False: 95.5k]
  ------------------
  292|  1.63k|      result = Curl_req_stop_send_recv(data);
  293|  1.63k|      if(result)
  ------------------
  |  Branch (293:10): [True: 0, False: 1.63k]
  ------------------
  294|      0|        goto out;
  295|  1.63k|      if(k->eos_written) /* already did write this to client, leave */
  ------------------
  |  Branch (295:10): [True: 0, False: 1.63k]
  ------------------
  296|      0|        break;
  297|  1.63k|    }
  298|       |
  299|  97.1k|    result = Curl_xfer_write_resp(data, buf, blen, is_eos);
  300|  97.1k|    if(result || data->req.done)
  ------------------
  |  Branch (300:8): [True: 1.18k, False: 95.9k]
  |  Branch (300:18): [True: 45, False: 95.9k]
  ------------------
  301|  1.23k|      goto out;
  302|       |
  303|       |    /* if we are done, we stop receiving. On multiplexed connections,
  304|       |     * we should read the EOS. Which may arrive as meta data after
  305|       |     * the bytes. Not taking it in might lead to RST of streams. */
  306|  95.9k|    if((!is_multiplex && data->req.download_done) || is_eos) {
  ------------------
  |  Branch (306:9): [True: 95.8k, False: 29]
  |  Branch (306:26): [True: 1.67k, False: 94.2k]
  |  Branch (306:54): [True: 29, False: 94.2k]
  ------------------
  307|  1.70k|      CURL_REQ_CLEAR_RECV(data);
  ------------------
  |  |   49|  1.70k|  ((d)->req.io_flags &= (uint8_t)~REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|  1.70k|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  ------------------
  308|  1.70k|    }
  309|       |    /* if we stopped receiving, leave the loop */
  310|  95.9k|    if(!CURL_REQ_WANT_RECV(data))
  ------------------
  |  |   40|  95.9k|#define CURL_REQ_WANT_RECV(d)  ((d)->req.io_flags & REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|  95.9k|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  ------------------
  |  Branch (310:8): [True: 1.70k, False: 94.2k]
  ------------------
  311|  1.70k|      break;
  312|       |
  313|  95.9k|  } while(maxloops--);
  ------------------
  |  Branch (313:11): [True: 85.8k, False: 8.34k]
  ------------------
  314|       |
  315|  3.26M|  if(!is_eos && !rate_limited && CURL_REQ_WANT_RECV(data) &&
  ------------------
  |  |   40|  6.53M|#define CURL_REQ_WANT_RECV(d)  ((d)->req.io_flags & REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|  3.26M|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  |  |  |  Branch (40:32): [True: 3.26M, False: 190]
  |  |  ------------------
  ------------------
  |  Branch (315:6): [True: 3.26M, False: 1.51k]
  |  Branch (315:17): [True: 3.26M, False: 71]
  ------------------
  316|  3.26M|     (!rcvd_eagain || data_pending(data, rcvd_eagain))) {
  ------------------
  |  Branch (316:7): [True: 8.34k, False: 3.25M]
  |  Branch (316:23): [True: 0, False: 3.25M]
  ------------------
  317|       |    /* Did not read until EAGAIN/EOS or there is still data pending
  318|       |     * in buffers. Mark as read-again via simulated SELECT results. */
  319|  8.34k|    Curl_multi_mark_dirty(data);
  320|  8.34k|    CURL_TRC_M(data, "sendrecv_dl() no EAGAIN/pending data, mark as dirty");
  ------------------
  |  |  148|  8.34k|  do {                                   \
  |  |  149|  8.34k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  8.34k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  8.34k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  16.6k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 8.34k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 8.34k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  16.6k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  8.34k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  8.34k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  8.34k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 8.34k]
  |  |  ------------------
  ------------------
  321|  8.34k|  }
  322|       |
  323|  3.26M|  if(!CURL_REQ_WANT_RECV(data) && CURL_REQ_WANT_SEND(data) &&
  ------------------
  |  |   40|  6.53M|#define CURL_REQ_WANT_RECV(d)  ((d)->req.io_flags & REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|  3.26M|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  ------------------
                if(!CURL_REQ_WANT_RECV(data) && CURL_REQ_WANT_SEND(data) &&
  ------------------
  |  |   39|  3.27M|#define CURL_REQ_WANT_SEND(d)  ((d)->req.io_flags & REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|  1.70k|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  |  |  |  Branch (39:32): [True: 5, False: 1.70k]
  |  |  ------------------
  ------------------
  |  Branch (323:6): [True: 1.70k, False: 3.26M]
  ------------------
  324|      5|     (conn->bits.close || is_multiplex)) {
  ------------------
  |  Branch (324:7): [True: 1, False: 4]
  |  Branch (324:27): [True: 0, False: 4]
  ------------------
  325|       |    /* When we have read the entire thing and the close bit is set, the server
  326|       |       may now close the connection. If there is now any kind of sending going
  327|       |       on from our side, we need to stop that immediately. */
  328|      1|    infof(data, "we are done reading and this is set to close, stop send");
  ------------------
  |  |  143|      1|  do {                               \
  |  |  144|      1|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      1|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 1, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  320|      1|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      1|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      1|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1]
  |  |  ------------------
  ------------------
  329|      1|    Curl_req_abort_sending(data);
  330|      1|  }
  331|       |
  332|  3.27M|out:
  333|  3.27M|  Curl_multi_xfer_buf_release(data, xfer_buf);
  334|  3.27M|  if(result)
  ------------------
  |  Branch (334:6): [True: 5.34k, False: 3.26M]
  ------------------
  335|  5.34k|    DEBUGF(infof(data, "sendrecv_dl() -> %d", result));
  ------------------
  |  | 1067|  3.31M|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 5.34k, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 5.34k]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 5.34k]
  |  |  ------------------
  ------------------
  336|  3.27M|  return result;
  337|  3.26M|}
transfer.c:xfer_recv_resp:
  180|  3.35M|{
  181|  3.35M|  CURLcode result;
  182|       |
  183|  3.35M|  DEBUGASSERT(blen > 0);
  ------------------
  |  | 1081|  3.35M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (183:3): [True: 0, False: 3.35M]
  |  Branch (183:3): [True: 3.35M, False: 0]
  ------------------
  184|  3.35M|  *pnread = 0;
  185|       |  /* If we are reading BODY data and the connection does NOT handle EOF
  186|       |   * and we know the size of the BODY data, limit the read amount */
  187|  3.35M|  if(!eos_reliable && !data->req.header && data->req.size != -1) {
  ------------------
  |  Branch (187:6): [True: 97.3k, False: 3.26M]
  |  Branch (187:23): [True: 2.94k, False: 94.3k]
  |  Branch (187:44): [True: 226, False: 2.72k]
  ------------------
  188|    226|    blen = curlx_sotouz_range(data->req.size - data->req.bytecount, 0, blen);
  189|    226|  }
  190|  3.35M|  else if(xfer_recv_shutdown_started(data)) {
  ------------------
  |  Branch (190:11): [True: 0, False: 3.35M]
  ------------------
  191|       |    /* we already received everything. Do not try more. */
  192|      0|    blen = 0;
  193|      0|  }
  194|       |
  195|  3.35M|  if(blen) {
  ------------------
  |  Branch (195:6): [True: 3.35M, False: 1]
  ------------------
  196|  3.35M|    result = Curl_xfer_recv(data, buf, blen, pnread);
  197|  3.35M|    if(result)
  ------------------
  |  Branch (197:8): [True: 3.26M, False: 97.1k]
  ------------------
  198|  3.26M|      return result;
  199|  3.35M|  }
  200|       |
  201|  97.1k|  if(*pnread == 0) {
  ------------------
  |  Branch (201:6): [True: 1.63k, False: 95.5k]
  ------------------
  202|  1.63k|    if(data->req.shutdown) {
  ------------------
  |  Branch (202:8): [True: 628, False: 1.00k]
  ------------------
  203|    628|      bool done;
  204|    628|      result = xfer_recv_shutdown(data, &done);
  205|    628|      if(result)
  ------------------
  |  Branch (205:10): [True: 0, False: 628]
  ------------------
  206|      0|        return result;
  207|    628|      if(!done) {
  ------------------
  |  Branch (207:10): [True: 0, False: 628]
  ------------------
  208|      0|        return CURLE_AGAIN;
  209|      0|      }
  210|    628|    }
  211|  1.63k|    DEBUGF(infof(data, "sendrecv_dl: we are done"));
  ------------------
  |  | 1067|  11.4k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 1.63k, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 1.63k]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 1.63k]
  |  |  ------------------
  ------------------
  212|  1.63k|  }
  213|  97.1k|  return CURLE_OK;
  214|  97.1k|}
transfer.c:xfer_recv_shutdown_started:
  155|  3.35M|{
  156|  3.35M|  if(!data || !data->conn)
  ------------------
  |  Branch (156:6): [True: 0, False: 3.35M]
  |  Branch (156:15): [True: 0, False: 3.35M]
  ------------------
  157|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  158|  3.35M|  return Curl_shutdown_started(data, data->conn->recv_idx);
  159|  3.35M|}
transfer.c:xfer_recv_shutdown:
  148|    628|{
  149|    628|  if(!data || !data->conn)
  ------------------
  |  Branch (149:6): [True: 0, False: 628]
  |  Branch (149:15): [True: 0, False: 628]
  ------------------
  150|      0|    return CURLE_FAILED_INIT;
  151|    628|  return Curl_conn_shutdown(data, data->conn->recv_idx, done);
  152|    628|}
transfer.c:data_pending:
  104|  3.25M|{
  105|  3.25M|  struct connectdata *conn = data->conn;
  106|       |
  107|  3.25M|  if(conn->scheme->protocol & PROTO_FAMILY_FTP)
  ------------------
  |  |   86|  3.25M|#define PROTO_FAMILY_FTP  (CURLPROTO_FTP | CURLPROTO_FTPS)
  |  |  ------------------
  |  |  |  | 1080|  3.25M|#define CURLPROTO_FTP     (1L << 2)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_FTP  (CURLPROTO_FTP | CURLPROTO_FTPS)
  |  |  ------------------
  |  |  |  | 1081|  3.25M|#define CURLPROTO_FTPS    (1L << 3)
  |  |  ------------------
  ------------------
  |  Branch (107:6): [True: 2, False: 3.25M]
  ------------------
  108|      2|    return Curl_conn_data_pending(data, SECONDARYSOCKET);
  ------------------
  |  |  304|      2|#define SECONDARYSOCKET 1
  ------------------
  109|       |
  110|       |  /* in the case of libssh2, we can never be really sure that we have emptied
  111|       |     its internal buffers so we MUST always try until we get EAGAIN back */
  112|  3.25M|  return (!rcvd_eagain &&
  ------------------
  |  Branch (112:11): [True: 0, False: 3.25M]
  ------------------
  113|      0|          conn->scheme->protocol & (CURLPROTO_SCP | CURLPROTO_SFTP)) ||
  ------------------
  |  | 1082|      0|#define CURLPROTO_SCP     (1L << 4)
  ------------------
                        conn->scheme->protocol & (CURLPROTO_SCP | CURLPROTO_SFTP)) ||
  ------------------
  |  | 1083|      0|#define CURLPROTO_SFTP    (1L << 5)
  ------------------
  |  Branch (113:11): [True: 0, False: 0]
  ------------------
  114|  3.25M|         Curl_conn_data_pending(data, FIRSTSOCKET);
  ------------------
  |  |  303|  3.25M|#define FIRSTSOCKET     0
  ------------------
  |  Branch (114:10): [True: 0, False: 3.25M]
  ------------------
  115|  3.25M|}
transfer.c:sendrecv_ul:
  343|  3.25M|{
  344|       |  /* We should not get here when the sending is already done. */
  345|  3.25M|  DEBUGASSERT(!Curl_req_done_sending(data));
  ------------------
  |  | 1081|  3.25M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (345:3): [True: 0, False: 3.25M]
  |  Branch (345:3): [True: 3.25M, False: 0]
  ------------------
  346|       |
  347|  3.25M|  if(!Curl_req_done_sending(data))
  ------------------
  |  Branch (347:6): [True: 3.25M, False: 0]
  ------------------
  348|  3.25M|    return Curl_req_send_more(data);
  349|      0|  return CURLE_OK;
  350|  3.25M|}
transfer.c:xfer_setup:
  677|  7.58k|{
  678|  7.58k|  struct SingleRequest *k = &data->req;
  679|  7.58k|  struct connectdata *conn = data->conn;
  680|       |
  681|  7.58k|  DEBUGASSERT(conn != NULL);
  ------------------
  |  | 1081|  7.58k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (681:3): [True: 0, False: 7.58k]
  |  Branch (681:3): [True: 7.58k, False: 0]
  ------------------
  682|       |  /* indexes are in range */
  683|  7.58k|  DEBUGASSERT((send_idx <= 1) && (send_idx >= -1));
  ------------------
  |  | 1081|  7.58k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (683:3): [True: 0, False: 7.58k]
  |  Branch (683:3): [True: 0, False: 0]
  |  Branch (683:3): [True: 7.58k, False: 0]
  |  Branch (683:3): [True: 7.58k, False: 0]
  ------------------
  684|  7.58k|  DEBUGASSERT((recv_idx <= 1) && (recv_idx >= -1));
  ------------------
  |  | 1081|  7.58k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (684:3): [True: 0, False: 7.58k]
  |  Branch (684:3): [True: 0, False: 0]
  |  Branch (684:3): [True: 7.58k, False: 0]
  |  Branch (684:3): [True: 7.58k, False: 0]
  ------------------
  685|       |  /* if request wants to send, switching off the send direction is wrong */
  686|  7.58k|  DEBUGASSERT((send_idx >= 0) || !Curl_req_want_send(data));
  ------------------
  |  | 1081|  7.58k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (686:3): [True: 7.58k, False: 0]
  |  Branch (686:3): [True: 0, False: 0]
  |  Branch (686:3): [True: 6.85k, False: 730]
  |  Branch (686:3): [True: 730, False: 0]
  ------------------
  687|       |
  688|  7.58k|  conn->send_idx = send_idx;
  689|  7.58k|  conn->recv_idx = recv_idx;
  690|       |
  691|       |  /* without receiving, there should be not recv_size */
  692|  7.58k|  DEBUGASSERT((conn->recv_idx >= 0) || (recv_size == -1));
  ------------------
  |  | 1081|  7.58k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (692:3): [True: 7.58k, False: 0]
  |  Branch (692:3): [True: 0, False: 0]
  |  Branch (692:3): [True: 7.45k, False: 134]
  |  Branch (692:3): [True: 134, False: 0]
  ------------------
  693|  7.58k|  k->size = recv_size;
  694|  7.58k|  k->header = !!conn->scheme->run->write_resp_hd;
  695|       |  /* by default, we do not shutdown at the end of the transfer */
  696|  7.58k|  k->shutdown = FALSE;
  ------------------
  |  | 1058|  7.58k|#define FALSE false
  ------------------
  697|  7.58k|  k->shutdown_err_ignore = FALSE;
  ------------------
  |  | 1058|  7.58k|#define FALSE false
  ------------------
  698|       |
  699|       |  /* The code sequence below is placed in this function because all necessary
  700|       |     input is not always known in do_complete() as this function may be called
  701|       |     after that */
  702|  7.58k|  if(!k->header && (recv_size > 0))
  ------------------
  |  Branch (702:6): [True: 764, False: 6.82k]
  |  Branch (702:20): [True: 4, False: 760]
  ------------------
  703|      4|    Curl_pgrsSetDownloadSize(data, recv_size);
  704|       |
  705|       |  /* we want header and/or body, if neither then do not do this! */
  706|  7.58k|  if(conn->scheme->run->write_resp_hd || !data->req.no_body) {
  ------------------
  |  Branch (706:6): [True: 6.82k, False: 764]
  |  Branch (706:42): [True: 664, False: 100]
  ------------------
  707|  7.48k|    if(conn->recv_idx != -1)
  ------------------
  |  Branch (707:8): [True: 7.45k, False: 34]
  ------------------
  708|  7.45k|      CURL_REQ_SET_RECV(data);
  ------------------
  |  |   45|  7.45k|#define CURL_REQ_SET_RECV(d)   ((d)->req.io_flags |= REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|  7.45k|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  ------------------
  709|  7.48k|    if(conn->send_idx != -1)
  ------------------
  |  Branch (709:8): [True: 6.85k, False: 630]
  ------------------
  710|  6.85k|      CURL_REQ_SET_SEND(data);
  ------------------
  |  |   44|  6.85k|#define CURL_REQ_SET_SEND(d)   ((d)->req.io_flags |= REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|  6.85k|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  ------------------
  711|  7.48k|  }
  712|  7.58k|  CURL_TRC_M(data, "xfer_setup: recv_idx=%d, send_idx=%d",
  ------------------
  |  |  148|  7.58k|  do {                                   \
  |  |  149|  7.58k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  7.58k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  7.58k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  15.1k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 7.58k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 7.58k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  15.1k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  7.58k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  7.58k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  7.58k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 7.58k]
  |  |  ------------------
  ------------------
  713|  7.58k|             conn->recv_idx, conn->send_idx);
  714|  7.58k|}

Curl_uint32_bset_init:
   33|  86.0k|{
   34|  86.0k|  memset(bset, 0, sizeof(*bset));
   35|  86.0k|#ifdef DEBUGBUILD
   36|  86.0k|  bset->init = CURL_UINT32_BSET_MAGIC;
  ------------------
  |  |   29|  86.0k|#define CURL_UINT32_BSET_MAGIC  0x62757473
  ------------------
   37|  86.0k|#endif
   38|  86.0k|}
Curl_uint32_bset_resize:
   41|  86.0k|{
   42|  86.0k|  uint32_t nslots = (nmax < (UINT32_MAX - 63)) ?
  ------------------
  |  Branch (42:21): [True: 86.0k, False: 0]
  ------------------
   43|  86.0k|                    ((nmax + 63) / 64) : (UINT32_MAX / 64);
   44|       |
   45|  86.0k|  DEBUGASSERT(bset->init == CURL_UINT32_BSET_MAGIC);
  ------------------
  |  | 1081|  86.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (45:3): [True: 0, False: 86.0k]
  |  Branch (45:3): [True: 86.0k, False: 0]
  ------------------
   46|  86.0k|  if(nslots != bset->nslots) {
  ------------------
  |  Branch (46:6): [True: 86.0k, False: 0]
  ------------------
   47|  86.0k|    uint64_t *slots = curlx_calloc(nslots, sizeof(uint64_t));
  ------------------
  |  | 1480|  86.0k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   48|  86.0k|    if(!slots)
  ------------------
  |  Branch (48:8): [True: 0, False: 86.0k]
  ------------------
   49|      0|      return CURLE_OUT_OF_MEMORY;
   50|       |
   51|  86.0k|    if(bset->slots) {
  ------------------
  |  Branch (51:8): [True: 0, False: 86.0k]
  ------------------
   52|      0|      memcpy(slots, bset->slots,
   53|      0|             (CURLMIN(nslots, bset->nslots) * sizeof(uint64_t)));
  ------------------
  |  | 1287|      0|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   54|      0|      curlx_free(bset->slots);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   55|      0|    }
   56|  86.0k|    bset->slots = slots;
   57|  86.0k|    bset->nslots = nslots;
   58|  86.0k|    bset->first_slot_used = 0;
   59|  86.0k|  }
   60|  86.0k|  return CURLE_OK;
   61|  86.0k|}
Curl_uint32_bset_destroy:
   64|  86.0k|{
   65|  86.0k|  DEBUGASSERT(bset->init == CURL_UINT32_BSET_MAGIC);
  ------------------
  |  | 1081|  86.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (65:3): [True: 0, False: 86.0k]
  |  Branch (65:3): [True: 86.0k, False: 0]
  ------------------
   66|  86.0k|  curlx_free(bset->slots);
  ------------------
  |  | 1483|  86.0k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   67|  86.0k|  memset(bset, 0, sizeof(*bset));
   68|  86.0k|}
Curl_uint32_bset_empty:
   91|  17.3k|{
   92|  17.3k|  uint32_t i;
   93|  17.3k|  for(i = bset->first_slot_used; i < bset->nslots; ++i) {
  ------------------
  |  Branch (93:34): [True: 17.3k, False: 0]
  ------------------
   94|  17.3k|    if(bset->slots[i])
  ------------------
  |  Branch (94:8): [True: 17.3k, False: 0]
  ------------------
   95|  17.3k|      return FALSE;
  ------------------
  |  | 1058|  17.3k|#define FALSE false
  ------------------
   96|  17.3k|  }
   97|      0|  return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
   98|  17.3k|}
Curl_uint32_bset_add:
  109|  82.2k|{
  110|  82.2k|  uint32_t islot = i / 64;
  111|  82.2k|  if(islot >= bset->nslots)
  ------------------
  |  Branch (111:6): [True: 0, False: 82.2k]
  ------------------
  112|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  113|  82.2k|  bset->slots[islot] |= ((uint64_t)1 << (i % 64));
  114|  82.2k|  if(islot < bset->first_slot_used)
  ------------------
  |  Branch (114:6): [True: 204, False: 82.0k]
  ------------------
  115|    204|    bset->first_slot_used = islot;
  116|       |  return TRUE;
  ------------------
  |  | 1055|  82.2k|#define TRUE true
  ------------------
  117|  82.2k|}
Curl_uint32_bset_remove:
  120|  7.27M|{
  121|  7.27M|  size_t islot = i / 64;
  122|  7.27M|  if(islot < bset->nslots)
  ------------------
  |  Branch (122:6): [True: 7.27M, False: 0]
  ------------------
  123|  7.27M|    bset->slots[islot] &= ~((uint64_t)1 << (i % 64));
  124|  7.27M|}
Curl_uint32_bset_contains:
  127|  35.1k|{
  128|  35.1k|  uint32_t islot = i / 64;
  129|  35.1k|  if(islot >= bset->nslots)
  ------------------
  |  Branch (129:6): [True: 0, False: 35.1k]
  ------------------
  130|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  131|  35.1k|  return (bset->slots[islot] & ((uint64_t)1 << (i % 64))) != 0;
  132|  35.1k|}
Curl_uint32_bset_first:
  135|  7.10M|{
  136|  7.10M|  uint32_t i;
  137|  7.24M|  for(i = bset->first_slot_used; i < bset->nslots; ++i) {
  ------------------
  |  Branch (137:34): [True: 7.15M, False: 84.5k]
  ------------------
  138|  7.15M|    if(bset->slots[i]) {
  ------------------
  |  Branch (138:8): [True: 7.01M, False: 139k]
  ------------------
  139|  7.01M|      *pfirst = (i * 64) + CURL_CTZ64(bset->slots[i]);
  ------------------
  |  |  348|  7.01M|#      define CURL_CTZ64(x)            __builtin_ctzl(x)
  ------------------
  140|  7.01M|      bset->first_slot_used = i;
  141|  7.01M|      return TRUE;
  ------------------
  |  | 1055|  7.01M|#define TRUE true
  ------------------
  142|  7.01M|    }
  143|  7.15M|  }
  144|  84.5k|  bset->first_slot_used = *pfirst = UINT32_MAX;
  145|       |  return FALSE;
  ------------------
  |  | 1058|  84.5k|#define FALSE false
  ------------------
  146|  7.10M|}
Curl_uint32_bset_next:
  150|  14.1M|{
  151|  14.1M|  uint32_t islot;
  152|  14.1M|  uint64_t x;
  153|       |
  154|  14.1M|  ++last; /* look for number one higher than last */
  155|  14.1M|  islot = last / 64; /* the slot this would be in */
  156|  14.1M|  if(islot < bset->nslots) {
  ------------------
  |  Branch (156:6): [True: 14.1M, False: 0]
  ------------------
  157|       |    /* shift away the bits we already iterated in this slot */
  158|  14.1M|    x = (bset->slots[islot] >> (last % 64));
  159|  14.1M|    if(x) {
  ------------------
  |  Branch (159:8): [True: 7.17M, False: 7.01M]
  ------------------
  160|       |      /* more bits set, next is `last` + trailing 0s of the shifted slot */
  161|  7.17M|      *pnext = last + CURL_CTZ64(x);
  ------------------
  |  |  348|  7.17M|#      define CURL_CTZ64(x)            __builtin_ctzl(x)
  ------------------
  162|  7.17M|      return TRUE;
  ------------------
  |  | 1055|  7.17M|#define TRUE true
  ------------------
  163|  7.17M|    }
  164|       |    /* no more bits set in the last slot, scan forward */
  165|  56.1M|    for(islot = islot + 1; islot < bset->nslots; ++islot) {
  ------------------
  |  Branch (165:28): [True: 49.1M, False: 7.01M]
  ------------------
  166|  49.1M|      if(bset->slots[islot]) {
  ------------------
  |  Branch (166:10): [True: 0, False: 49.1M]
  ------------------
  167|      0|        *pnext = (islot * 64) + CURL_CTZ64(bset->slots[islot]);
  ------------------
  |  |  348|      0|#      define CURL_CTZ64(x)            __builtin_ctzl(x)
  ------------------
  168|      0|        return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  169|      0|      }
  170|  49.1M|    }
  171|  7.01M|  }
  172|  7.01M|  *pnext = UINT32_MAX; /* a value we cannot store */
  173|       |  return FALSE;
  ------------------
  |  | 1058|  7.01M|#define FALSE false
  ------------------
  174|  14.1M|}

Curl_uint32_hash_init:
   47|  4.44k|{
   48|  4.44k|  DEBUGASSERT(h);
  ------------------
  |  | 1081|  4.44k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (48:3): [True: 0, False: 4.44k]
  |  Branch (48:3): [True: 4.44k, False: 0]
  ------------------
   49|  4.44k|  DEBUGASSERT(slots);
  ------------------
  |  | 1081|  4.44k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (49:3): [True: 0, False: 4.44k]
  |  Branch (49:3): [True: 4.44k, False: 0]
  ------------------
   50|       |
   51|  4.44k|  h->table = NULL;
   52|  4.44k|  h->dtor = dtor;
   53|  4.44k|  h->size = 0;
   54|  4.44k|  h->slots = slots;
   55|  4.44k|#ifdef DEBUGBUILD
   56|  4.44k|  h->init = CURL_UINT32_HASHINIT;
  ------------------
  |  |   30|  4.44k|#define CURL_UINT32_HASHINIT 0x7117e779
  ------------------
   57|  4.44k|#endif
   58|  4.44k|}
Curl_uint32_hash_set:
  114|  4.43k|{
  115|  4.43k|  struct uint_hash_entry *he, **slot;
  116|       |
  117|  4.43k|  DEBUGASSERT(h);
  ------------------
  |  | 1081|  4.43k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (117:3): [True: 0, False: 4.43k]
  |  Branch (117:3): [True: 4.43k, False: 0]
  ------------------
  118|  4.43k|  DEBUGASSERT(h->slots);
  ------------------
  |  | 1081|  4.43k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (118:3): [True: 0, False: 4.43k]
  |  Branch (118:3): [True: 4.43k, False: 0]
  ------------------
  119|  4.43k|  DEBUGASSERT(h->init == CURL_UINT32_HASHINIT);
  ------------------
  |  | 1081|  4.43k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (119:3): [True: 0, False: 4.43k]
  |  Branch (119:3): [True: 4.43k, False: 0]
  ------------------
  120|  4.43k|  if(!h->table) {
  ------------------
  |  Branch (120:6): [True: 4.43k, False: 0]
  ------------------
  121|  4.43k|    h->table = curlx_calloc(h->slots, sizeof(*he));
  ------------------
  |  | 1480|  4.43k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  122|  4.43k|    if(!h->table)
  ------------------
  |  Branch (122:8): [True: 0, False: 4.43k]
  ------------------
  123|      0|      return FALSE; /* OOM */
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  124|  4.43k|  }
  125|       |
  126|  4.43k|  slot = CURL_UINT32_HASH_SLOT_ADDR(h, id);
  ------------------
  |  |  111|  4.43k|#define CURL_UINT32_HASH_SLOT_ADDR(h, id) &CURL_UINT32_HASH_SLOT(h, id)
  |  |  ------------------
  |  |  |  |  110|  4.43k|#define CURL_UINT32_HASH_SLOT(h, id) h->table[uint32_hash_hash(id, (h)->slots)]
  |  |  ------------------
  ------------------
  127|  4.43k|  for(he = *slot; he; he = he->next) {
  ------------------
  |  Branch (127:19): [True: 0, False: 4.43k]
  ------------------
  128|      0|    if(he->id == id) {
  ------------------
  |  Branch (128:8): [True: 0, False: 0]
  ------------------
  129|       |      /* existing key entry, overwrite by clearing old pointer */
  130|      0|      uint32_hash_entry_clear(h, he);
  131|      0|      he->value = value;
  132|      0|      return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  133|      0|    }
  134|      0|  }
  135|       |
  136|  4.43k|  he = uint32_hash_mk_entry(id, value);
  137|  4.43k|  if(!he)
  ------------------
  |  Branch (137:6): [True: 0, False: 4.43k]
  ------------------
  138|      0|    return FALSE; /* OOM */
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  139|       |
  140|  4.43k|  uint32_hash_elem_link(h, slot, he);
  141|       |  return TRUE;
  ------------------
  |  | 1055|  4.43k|#define TRUE true
  ------------------
  142|  4.43k|}
Curl_uint32_hash_remove:
  145|  4.43k|{
  146|  4.43k|  DEBUGASSERT(h);
  ------------------
  |  | 1081|  4.43k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (146:3): [True: 0, False: 4.43k]
  |  Branch (146:3): [True: 4.43k, False: 0]
  ------------------
  147|  4.43k|  DEBUGASSERT(h->slots);
  ------------------
  |  | 1081|  4.43k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (147:3): [True: 0, False: 4.43k]
  |  Branch (147:3): [True: 4.43k, False: 0]
  ------------------
  148|  4.43k|  DEBUGASSERT(h->init == CURL_UINT32_HASHINIT);
  ------------------
  |  | 1081|  4.43k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (148:3): [True: 0, False: 4.43k]
  |  Branch (148:3): [True: 4.43k, False: 0]
  ------------------
  149|  4.43k|  if(h->table) {
  ------------------
  |  Branch (149:6): [True: 4.43k, False: 0]
  ------------------
  150|  4.43k|    struct uint_hash_entry *he, **he_anchor;
  151|       |
  152|  4.43k|    he_anchor = CURL_UINT32_HASH_SLOT_ADDR(h, id);
  ------------------
  |  |  111|  4.43k|#define CURL_UINT32_HASH_SLOT_ADDR(h, id) &CURL_UINT32_HASH_SLOT(h, id)
  |  |  ------------------
  |  |  |  |  110|  4.43k|#define CURL_UINT32_HASH_SLOT(h, id) h->table[uint32_hash_hash(id, (h)->slots)]
  |  |  ------------------
  ------------------
  153|  4.43k|    while(*he_anchor) {
  ------------------
  |  Branch (153:11): [True: 4.43k, False: 0]
  ------------------
  154|  4.43k|      he = *he_anchor;
  155|  4.43k|      if(id == he->id) {
  ------------------
  |  Branch (155:10): [True: 4.43k, False: 0]
  ------------------
  156|  4.43k|        uint32_hash_entry_unlink(h, he_anchor, he);
  157|  4.43k|        uint32_hash_entry_destroy(h, he);
  158|  4.43k|        return TRUE;
  ------------------
  |  | 1055|  4.43k|#define TRUE true
  ------------------
  159|  4.43k|      }
  160|      0|      he_anchor = &he->next;
  161|      0|    }
  162|  4.43k|  }
  163|      0|  return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  164|  4.43k|}
Curl_uint32_hash_get:
  167|  34.5M|{
  168|  34.5M|  DEBUGASSERT(h);
  ------------------
  |  | 1081|  34.5M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (168:3): [True: 0, False: 34.5M]
  |  Branch (168:3): [True: 34.5M, False: 0]
  ------------------
  169|  34.5M|  DEBUGASSERT(h->init == CURL_UINT32_HASHINIT);
  ------------------
  |  | 1081|  34.5M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (169:3): [True: 0, False: 34.5M]
  |  Branch (169:3): [True: 34.5M, False: 0]
  ------------------
  170|  34.5M|  if(h->table) {
  ------------------
  |  Branch (170:6): [True: 34.5M, False: 13.3k]
  ------------------
  171|  34.5M|    struct uint_hash_entry *he;
  172|  34.5M|    DEBUGASSERT(h->slots);
  ------------------
  |  | 1081|  34.5M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (172:5): [True: 0, False: 34.5M]
  |  Branch (172:5): [True: 34.5M, False: 0]
  ------------------
  173|  34.5M|    he = CURL_UINT32_HASH_SLOT(h, id);
  ------------------
  |  |  110|  34.5M|#define CURL_UINT32_HASH_SLOT(h, id) h->table[uint32_hash_hash(id, (h)->slots)]
  ------------------
  174|  34.5M|    while(he) {
  ------------------
  |  Branch (174:11): [True: 34.5M, False: 1.47k]
  ------------------
  175|  34.5M|      if(id == he->id) {
  ------------------
  |  Branch (175:10): [True: 34.5M, False: 0]
  ------------------
  176|  34.5M|        return he->value;
  177|  34.5M|      }
  178|      0|      he = he->next;
  179|      0|    }
  180|  34.5M|  }
  181|  14.8k|  return NULL;
  182|  34.5M|}
uint_hash_clear:
  187|  4.43k|{
  188|  4.43k|  if(h && h->table) {
  ------------------
  |  Branch (188:6): [True: 4.43k, False: 0]
  |  Branch (188:11): [True: 4.43k, False: 0]
  ------------------
  189|  4.43k|    struct uint_hash_entry *he, **he_anchor;
  190|  4.43k|    size_t i;
  191|  4.43k|    DEBUGASSERT(h->init == CURL_UINT32_HASHINIT);
  ------------------
  |  | 1081|  4.43k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (191:5): [True: 0, False: 4.43k]
  |  Branch (191:5): [True: 4.43k, False: 0]
  ------------------
  192|   283k|    for(i = 0; i < h->slots; ++i) {
  ------------------
  |  Branch (192:16): [True: 279k, False: 4.43k]
  ------------------
  193|   279k|      he_anchor = &h->table[i];
  194|   279k|      while(*he_anchor) {
  ------------------
  |  Branch (194:13): [True: 0, False: 279k]
  ------------------
  195|      0|        he = *he_anchor;
  196|      0|        uint32_hash_entry_unlink(h, he_anchor, he);
  197|      0|        uint32_hash_entry_destroy(h, he);
  198|      0|      }
  199|   279k|    }
  200|  4.43k|  }
  201|  4.43k|}
Curl_uint32_hash_destroy:
  204|  4.44k|{
  205|  4.44k|  DEBUGASSERT(h->init == CURL_UINT32_HASHINIT);
  ------------------
  |  | 1081|  4.44k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (205:3): [True: 0, False: 4.44k]
  |  Branch (205:3): [True: 4.44k, False: 0]
  ------------------
  206|  4.44k|  if(h->table) {
  ------------------
  |  Branch (206:6): [True: 4.43k, False: 13]
  ------------------
  207|  4.43k|    uint_hash_clear(h);
  208|  4.43k|    curlx_safefree(h->table);
  ------------------
  |  | 1327|  4.43k|  do {                      \
  |  | 1328|  4.43k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  4.43k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  4.43k|    (ptr) = NULL;           \
  |  | 1330|  4.43k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 4.43k]
  |  |  ------------------
  ------------------
  209|  4.43k|  }
  210|  4.44k|  DEBUGASSERT(h->size == 0);
  ------------------
  |  | 1081|  4.44k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (210:3): [True: 0, False: 4.44k]
  |  Branch (210:3): [True: 4.44k, False: 0]
  ------------------
  211|  4.44k|  h->slots = 0;
  212|  4.44k|}
uint-hash.c:uint32_hash_hash:
   34|  34.5M|{
   35|  34.5M|  return (id % slots);
   36|  34.5M|}
uint-hash.c:uint32_hash_entry_clear:
   76|  4.43k|{
   77|  4.43k|  DEBUGASSERT(h);
  ------------------
  |  | 1081|  4.43k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (77:3): [True: 0, False: 4.43k]
  |  Branch (77:3): [True: 4.43k, False: 0]
  ------------------
   78|  4.43k|  DEBUGASSERT(e);
  ------------------
  |  | 1081|  4.43k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (78:3): [True: 0, False: 4.43k]
  |  Branch (78:3): [True: 4.43k, False: 0]
  ------------------
   79|  4.43k|  if(e->value) {
  ------------------
  |  Branch (79:6): [True: 4.43k, False: 0]
  ------------------
   80|  4.43k|    if(h->dtor)
  ------------------
  |  Branch (80:8): [True: 4.43k, False: 0]
  ------------------
   81|  4.43k|      h->dtor(e->id, e->value);
   82|       |    e->value = NULL;
   83|  4.43k|  }
   84|  4.43k|}
uint-hash.c:uint32_hash_mk_entry:
   61|  4.43k|{
   62|  4.43k|  struct uint_hash_entry *e;
   63|       |
   64|       |  /* allocate the struct for the hash entry */
   65|  4.43k|  e = curlx_malloc(sizeof(*e));
  ------------------
  |  | 1478|  4.43k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
   66|  4.43k|  if(e) {
  ------------------
  |  Branch (66:6): [True: 4.43k, False: 0]
  ------------------
   67|  4.43k|    e->id = id;
   68|       |    e->next = NULL;
   69|  4.43k|    e->value = value;
   70|  4.43k|  }
   71|  4.43k|  return e;
   72|  4.43k|}
uint-hash.c:uint32_hash_elem_link:
  104|  4.43k|{
  105|  4.43k|  he->next = *he_anchor;
  106|  4.43k|  *he_anchor = he;
  107|  4.43k|  ++h->size;
  108|  4.43k|}
uint-hash.c:uint32_hash_entry_unlink:
   96|  4.43k|{
   97|  4.43k|  *he_anchor = he->next;
   98|  4.43k|  --h->size;
   99|  4.43k|}
uint-hash.c:uint32_hash_entry_destroy:
   88|  4.43k|{
   89|  4.43k|  uint32_hash_entry_clear(h, e);
   90|  4.43k|  curlx_free(e);
  ------------------
  |  | 1483|  4.43k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   91|  4.43k|}

Curl_uint32_tbl_init:
   34|  17.2k|{
   35|  17.2k|  memset(tbl, 0, sizeof(*tbl));
   36|  17.2k|  tbl->entry_dtor = entry_dtor;
   37|  17.2k|  tbl->last_key_added = UINT32_MAX;
   38|  17.2k|#ifdef DEBUGBUILD
   39|  17.2k|  tbl->init = CURL_UINT32_TBL_MAGIC;
  ------------------
  |  |   29|  17.2k|#define CURL_UINT32_TBL_MAGIC  0x62757473
  ------------------
   40|  17.2k|#endif
   41|  17.2k|}
Curl_uint32_tbl_resize:
   61|  17.2k|{
   62|       |  /* we use `tbl->nrows + 1` during iteration, want that to work */
   63|  17.2k|  DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC);
  ------------------
  |  | 1081|  17.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (63:3): [True: 0, False: 17.2k]
  |  Branch (63:3): [True: 17.2k, False: 0]
  ------------------
   64|  17.2k|  if(!nrows)
  ------------------
  |  Branch (64:6): [True: 0, False: 17.2k]
  ------------------
   65|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
   66|  17.2k|  if(nrows != tbl->nrows) {
  ------------------
  |  Branch (66:6): [True: 17.2k, False: 0]
  ------------------
   67|  17.2k|    void **rows = curlx_calloc(nrows, sizeof(void *));
  ------------------
  |  | 1480|  17.2k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   68|  17.2k|    if(!rows)
  ------------------
  |  Branch (68:8): [True: 0, False: 17.2k]
  ------------------
   69|      0|      return CURLE_OUT_OF_MEMORY;
   70|  17.2k|    if(tbl->rows) {
  ------------------
  |  Branch (70:8): [True: 0, False: 17.2k]
  ------------------
   71|      0|      memcpy(rows, tbl->rows, (CURLMIN(nrows, tbl->nrows) * sizeof(void *)));
  ------------------
  |  | 1287|      0|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   72|      0|      if(nrows < tbl->nrows)
  ------------------
  |  Branch (72:10): [True: 0, False: 0]
  ------------------
   73|      0|        uint32_tbl_clear_rows(tbl, nrows, tbl->nrows);
   74|      0|      curlx_free(tbl->rows);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   75|      0|    }
   76|  17.2k|    tbl->rows = rows;
   77|  17.2k|    tbl->nrows = nrows;
   78|  17.2k|  }
   79|  17.2k|  return CURLE_OK;
   80|  17.2k|}
uint32_tbl_clear:
   88|  17.2k|{
   89|  17.2k|  DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC);
  ------------------
  |  | 1081|  17.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (89:3): [True: 0, False: 17.2k]
  |  Branch (89:3): [True: 17.2k, False: 0]
  ------------------
   90|  17.2k|  uint32_tbl_clear_rows(tbl, 0, tbl->nrows);
   91|  17.2k|  DEBUGASSERT(!tbl->nentries);
  ------------------
  |  | 1081|  17.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (91:3): [True: 0, False: 17.2k]
  |  Branch (91:3): [True: 17.2k, False: 0]
  ------------------
   92|  17.2k|  tbl->last_key_added = UINT32_MAX;
   93|  17.2k|}
Curl_uint32_tbl_destroy:
   96|  17.2k|{
   97|  17.2k|  DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC);
  ------------------
  |  | 1081|  17.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (97:3): [True: 0, False: 17.2k]
  |  Branch (97:3): [True: 17.2k, False: 0]
  ------------------
   98|  17.2k|  uint32_tbl_clear(tbl);
   99|  17.2k|  curlx_free(tbl->rows);
  ------------------
  |  | 1483|  17.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  100|  17.2k|  memset(tbl, 0, sizeof(*tbl));
  101|  17.2k|}
Curl_uint32_tbl_capacity:
  104|  17.8k|{
  105|  17.8k|  return tbl->nrows;
  106|  17.8k|}
Curl_uint32_tbl_count:
  109|  35.0k|{
  110|  35.0k|  return tbl->nentries;
  111|  35.0k|}
Curl_uint32_tbl_get:
  114|  14.2M|{
  115|  14.2M|  return (key < tbl->nrows) ? tbl->rows[key] : NULL;
  ------------------
  |  Branch (115:10): [True: 14.2M, False: 0]
  ------------------
  116|  14.2M|}
Curl_uint32_tbl_add:
  119|  35.0k|{
  120|  35.0k|  uint32_t key, start_pos;
  121|       |
  122|  35.0k|  DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC);
  ------------------
  |  | 1081|  35.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (122:3): [True: 0, False: 35.0k]
  |  Branch (122:3): [True: 35.0k, False: 0]
  ------------------
  123|  35.0k|  if(!entry || !pkey)
  ------------------
  |  Branch (123:6): [True: 0, False: 35.0k]
  |  Branch (123:16): [True: 0, False: 35.0k]
  ------------------
  124|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  125|  35.0k|  *pkey = UINT32_MAX;
  126|  35.0k|  if(tbl->nentries == tbl->nrows)  /* full */
  ------------------
  |  Branch (126:6): [True: 0, False: 35.0k]
  ------------------
  127|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  128|       |
  129|  35.0k|  start_pos = CURLMIN(tbl->last_key_added, tbl->nrows) + 1;
  ------------------
  |  | 1287|  35.0k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 17.8k, False: 17.2k]
  |  |  ------------------
  ------------------
  130|  35.0k|  for(key = start_pos; key < tbl->nrows; ++key) {
  ------------------
  |  Branch (130:24): [True: 17.8k, False: 17.2k]
  ------------------
  131|  17.8k|    if(!tbl->rows[key]) {
  ------------------
  |  Branch (131:8): [True: 17.8k, False: 0]
  ------------------
  132|  17.8k|      tbl->rows[key] = entry;
  133|  17.8k|      tbl->nentries++;
  134|  17.8k|      tbl->last_key_added = key;
  135|  17.8k|      *pkey = key;
  136|  17.8k|      return TRUE;
  ------------------
  |  | 1055|  17.8k|#define TRUE true
  ------------------
  137|  17.8k|    }
  138|  17.8k|  }
  139|       |  /* no free entry at or above tbl->maybe_next_key, wrap around */
  140|  17.2k|  for(key = 0; key < start_pos; ++key) {
  ------------------
  |  Branch (140:16): [True: 17.2k, False: 0]
  ------------------
  141|  17.2k|    if(!tbl->rows[key]) {
  ------------------
  |  Branch (141:8): [True: 17.2k, False: 0]
  ------------------
  142|  17.2k|      tbl->rows[key] = entry;
  143|  17.2k|      tbl->nentries++;
  144|  17.2k|      tbl->last_key_added = key;
  145|  17.2k|      *pkey = key;
  146|  17.2k|      return TRUE;
  ------------------
  |  | 1055|  17.2k|#define TRUE true
  ------------------
  147|  17.2k|    }
  148|  17.2k|  }
  149|       |  /* Did not find any free row? Should not happen */
  150|      0|  DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (150:3): [Folded, False: 0]
  |  Branch (150:3): [Folded, False: 0]
  ------------------
  151|      0|  return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  152|      0|}
Curl_uint32_tbl_remove:
  155|  35.0k|{
  156|  35.0k|  uint32_tbl_clear_rows(tbl, key, key + 1);
  157|  35.0k|}
Curl_uint32_tbl_contains:
  160|  17.8k|{
  161|  17.8k|  return (key < tbl->nrows) ? !!tbl->rows[key] : FALSE;
  ------------------
  |  | 1058|  17.8k|#define FALSE false
  ------------------
  |  Branch (161:10): [True: 17.8k, False: 0]
  ------------------
  162|  17.8k|}
Curl_uint32_tbl_first:
  181|  17.2k|{
  182|  17.2k|  if(!pkey || !pentry)
  ------------------
  |  Branch (182:6): [True: 0, False: 17.2k]
  |  Branch (182:15): [True: 0, False: 17.2k]
  ------------------
  183|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  184|  17.2k|  if(tbl->nentries && uint32_tbl_next_at(tbl, 0, pkey, pentry))
  ------------------
  |  Branch (184:6): [True: 17.2k, False: 0]
  |  Branch (184:23): [True: 17.2k, False: 0]
  ------------------
  185|  17.2k|    return TRUE;
  ------------------
  |  | 1055|  17.2k|#define TRUE true
  ------------------
  186|      0|  DEBUGASSERT(!tbl->nentries);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (186:3): [True: 0, False: 0]
  |  Branch (186:3): [True: 0, False: 0]
  ------------------
  187|      0|  *pkey = UINT32_MAX;  /* always invalid */
  188|      0|  *pentry = NULL;
  189|       |  return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  190|      0|}
Curl_uint32_tbl_next:
  194|  17.2k|{
  195|  17.2k|  if(!pkey || !pentry)
  ------------------
  |  Branch (195:6): [True: 0, False: 17.2k]
  |  Branch (195:15): [True: 0, False: 17.2k]
  ------------------
  196|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  197|  17.2k|  if(uint32_tbl_next_at(tbl, last_key + 1, pkey, pentry))
  ------------------
  |  Branch (197:6): [True: 0, False: 17.2k]
  ------------------
  198|      0|    return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  199|  17.2k|  *pkey = UINT32_MAX;  /* always invalid */
  200|  17.2k|  *pentry = NULL;
  201|       |  return FALSE;
  ------------------
  |  | 1058|  17.2k|#define FALSE false
  ------------------
  202|  17.2k|}
uint-table.c:uint32_tbl_clear_rows:
   46|  52.2k|{
   47|  52.2k|  uint32_t i, end;
   48|       |
   49|  52.2k|  end = CURLMIN(upto_excluding, tbl->nrows);
  ------------------
  |  | 1287|  52.2k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1287:24): [True: 35.0k, False: 17.2k]
  |  |  ------------------
  ------------------
   50|  8.89M|  for(i = from; i < end; ++i) {
  ------------------
  |  Branch (50:17): [True: 8.84M, False: 52.2k]
  ------------------
   51|  8.84M|    if(tbl->rows[i]) {
  ------------------
  |  Branch (51:8): [True: 35.0k, False: 8.80M]
  ------------------
   52|  35.0k|      if(tbl->entry_dtor)
  ------------------
  |  Branch (52:10): [True: 0, False: 35.0k]
  ------------------
   53|      0|        tbl->entry_dtor(i, tbl->rows[i]);
   54|       |      tbl->rows[i] = NULL;
   55|  35.0k|      tbl->nentries--;
   56|  35.0k|    }
   57|  8.84M|  }
   58|  52.2k|}
uint-table.c:uint32_tbl_next_at:
  166|  34.4k|{
  167|  8.82M|  for(; key < tbl->nrows; ++key) {
  ------------------
  |  Branch (167:9): [True: 8.80M, False: 17.2k]
  ------------------
  168|  8.80M|    if(tbl->rows[key]) {
  ------------------
  |  Branch (168:8): [True: 17.2k, False: 8.78M]
  ------------------
  169|  17.2k|      *pkey = key;
  170|  17.2k|      *pentry = tbl->rows[key];
  171|  17.2k|      return TRUE;
  ------------------
  |  | 1055|  17.2k|#define TRUE true
  ------------------
  172|  17.2k|    }
  173|  8.80M|  }
  174|  17.2k|  *pkey = UINT32_MAX;  /* always invalid */
  175|  17.2k|  *pentry = NULL;
  176|       |  return FALSE;
  ------------------
  |  | 1058|  17.2k|#define FALSE false
  ------------------
  177|  34.4k|}

Curl_freeset:
  150|  36.6k|{
  151|       |  /* Free all dynamic strings stored in the data->set substructure. */
  152|  36.6k|  enum dupstring i;
  153|  36.6k|  enum dupblob j;
  154|       |
  155|  2.78M|  for(i = (enum dupstring)0; i < STRING_LAST; i++) {
  ------------------
  |  Branch (155:30): [True: 2.74M, False: 36.6k]
  ------------------
  156|  2.74M|    curlx_safefree(data->set.str[i]);
  ------------------
  |  | 1327|  2.74M|  do {                      \
  |  | 1328|  2.74M|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  2.74M|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  2.74M|    (ptr) = NULL;           \
  |  | 1330|  2.74M|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 2.74M]
  |  |  ------------------
  ------------------
  157|  2.74M|  }
  158|       |
  159|   329k|  for(j = (enum dupblob)0; j < BLOB_LAST; j++) {
  ------------------
  |  Branch (159:28): [True: 293k, False: 36.6k]
  ------------------
  160|   293k|    curlx_safefree(data->set.blobs[j]);
  ------------------
  |  | 1327|   293k|  do {                      \
  |  | 1328|   293k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|   293k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|   293k|    (ptr) = NULL;           \
  |  | 1330|   293k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 293k]
  |  |  ------------------
  ------------------
  161|   293k|  }
  162|       |
  163|  36.6k|  Curl_bufref_free(&data->state.referer);
  164|  36.6k|  Curl_bufref_free(&data->state.url);
  165|       |
  166|  36.6k|#if !defined(CURL_DISABLE_MIME) || !defined(CURL_DISABLE_FORM_API)
  167|  36.6k|  Curl_mime_cleanpart(data->set.mimepostp);
  168|  36.6k|  curlx_safefree(data->set.mimepostp);
  ------------------
  |  | 1327|  36.6k|  do {                      \
  |  | 1328|  36.6k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  36.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  36.6k|    (ptr) = NULL;           \
  |  | 1330|  36.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 36.6k]
  |  |  ------------------
  ------------------
  169|  36.6k|#endif
  170|       |
  171|  36.6k|#ifndef CURL_DISABLE_COOKIES
  172|  36.6k|  curl_slist_free_all(data->state.cookielist);
  173|       |  data->state.cookielist = NULL;
  174|  36.6k|#endif
  175|  36.6k|}
Curl_close:
  201|  36.6k|{
  202|  36.6k|  struct Curl_easy *data;
  203|       |
  204|  36.6k|  if(!datap || !*datap)
  ------------------
  |  Branch (204:6): [True: 0, False: 36.6k]
  |  Branch (204:16): [True: 8, False: 36.6k]
  ------------------
  205|      8|    return CURLE_OK;
  206|       |
  207|  36.6k|  data = *datap;
  208|  36.6k|  *datap = NULL;
  209|       |
  210|  36.6k|  if(!data->state.internal && data->multi) {
  ------------------
  |  Branch (210:6): [True: 18.7k, False: 17.8k]
  |  Branch (210:31): [True: 0, False: 18.7k]
  ------------------
  211|       |    /* This handle is still part of a multi handle, take care of this first
  212|       |       and detach this handle from there.
  213|       |       This detaches the connection. */
  214|      0|    curl_multi_remove_handle(data->multi, data);
  215|      0|  }
  216|  36.6k|  else {
  217|       |    /* Detach connection if any is left. This should not be normal, but can be
  218|       |       the case for example with CONNECT_ONLY + recv/send (test 556) */
  219|  36.6k|    Curl_detach_connection(data);
  220|  36.6k|    if(!data->state.internal && data->multi_easy) {
  ------------------
  |  Branch (220:8): [True: 18.7k, False: 17.8k]
  |  Branch (220:33): [True: 0, False: 18.7k]
  ------------------
  221|       |      /* when curl_easy_perform() is used, it creates its own multi handle to
  222|       |         use and this is the one */
  223|      0|      curl_multi_cleanup(data->multi_easy);
  224|      0|      data->multi_easy = NULL;
  225|      0|    }
  226|  36.6k|  }
  227|  36.6k|  DEBUGASSERT(!data->conn || data->state.internal);
  ------------------
  |  | 1081|  36.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (227:3): [True: 36.6k, False: 0]
  |  Branch (227:3): [True: 0, False: 0]
  |  Branch (227:3): [True: 36.6k, False: 0]
  |  Branch (227:3): [True: 0, False: 0]
  ------------------
  228|       |
  229|  36.6k|  Curl_expire_clear(data); /* shut off any timers left */
  230|       |
  231|  36.6k|  if(data->state.rangestringalloc)
  ------------------
  |  Branch (231:6): [True: 574, False: 36.0k]
  ------------------
  232|    574|    curlx_free(data->state.range);
  ------------------
  |  | 1483|    574|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  233|       |
  234|       |  /* release any resolve information this transfer kept */
  235|  36.6k|  Curl_resolv_destroy_all(data);
  236|       |
  237|  36.6k|  data->set.verbose = FALSE; /* no more calls to DEBUGFUNCTION */
  ------------------
  |  | 1058|  36.6k|#define FALSE false
  ------------------
  238|  36.6k|  data->magic = 0; /* force a clear AFTER the possibly enforced removal from
  239|       |                    * the multi handle and async dns shutdown. The multi
  240|       |                    * handle might check the magic and so might any
  241|       |                    * DEBUGFUNCTION invoked for tracing */
  242|       |
  243|       |  /* freed here in case DONE was not called */
  244|  36.6k|  Curl_req_free(&data->req, data);
  245|       |
  246|       |  /* Close down all open SSL info and sessions */
  247|  36.6k|  Curl_ssl_close_all(data);
  248|  36.6k|  Curl_peer_unlink(&data->state.initial_origin);
  249|  36.6k|  Curl_ssl_free_certinfo(data);
  250|       |
  251|  36.6k|  Curl_bufref_free(&data->state.referer);
  252|       |
  253|  36.6k|  up_free(data);
  254|  36.6k|  curlx_dyn_free(&data->state.headerb);
  255|  36.6k|  Curl_flush_cookies(data, TRUE);
  ------------------
  |  | 1055|  36.6k|#define TRUE true
  ------------------
  256|  36.6k|#ifndef CURL_DISABLE_ALTSVC
  257|  36.6k|  Curl_altsvc_save(data, data->asi, data->set.str[STRING_ALTSVC]);
  258|  36.6k|  Curl_altsvc_cleanup(&data->asi);
  259|  36.6k|#endif
  260|  36.6k|#ifndef CURL_DISABLE_HSTS
  261|  36.6k|  Curl_hsts_save(data, data->hsts, data->set.str[STRING_HSTS]);
  262|  36.6k|  if(!data->share || !data->share->hsts)
  ------------------
  |  Branch (262:6): [True: 36.6k, False: 0]
  |  Branch (262:22): [True: 0, False: 0]
  ------------------
  263|  36.6k|    Curl_hsts_cleanup(&data->hsts);
  264|  36.6k|  curl_slist_free_all(data->state.hstslist); /* clean up list */
  265|  36.6k|#endif
  266|  36.6k|#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_DIGEST_AUTH)
  267|  36.6k|  Curl_http_auth_cleanup_digest(data);
  268|  36.6k|#endif
  269|  36.6k|  curlx_safefree(data->state.most_recent_ftp_entrypath);
  ------------------
  |  | 1327|  36.6k|  do {                      \
  |  | 1328|  36.6k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  36.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  36.6k|    (ptr) = NULL;           \
  |  | 1330|  36.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 36.6k]
  |  |  ------------------
  ------------------
  270|  36.6k|  curlx_safefree(data->info.contenttype);
  ------------------
  |  | 1327|  36.6k|  do {                      \
  |  | 1328|  36.6k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  36.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  36.6k|    (ptr) = NULL;           \
  |  | 1330|  36.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 36.6k]
  |  |  ------------------
  ------------------
  271|  36.6k|  curlx_safefree(data->info.wouldredirect);
  ------------------
  |  | 1327|  36.6k|  do {                      \
  |  | 1328|  36.6k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  36.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  36.6k|    (ptr) = NULL;           \
  |  | 1330|  36.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 36.6k]
  |  |  ------------------
  ------------------
  272|       |
  273|       |  /* No longer a dirty share, if it exists */
  274|  36.6k|  if(Curl_share_easy_unlink(data))
  ------------------
  |  Branch (274:6): [True: 0, False: 36.6k]
  ------------------
  275|  36.6k|    DEBUGASSERT(0);
  ------------------
  |  | 1081|  36.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (275:5): [Folded, False: 0]
  |  Branch (275:5): [Folded, False: 0]
  ------------------
  276|       |
  277|  36.6k|  Curl_hash_destroy(&data->meta_hash);
  278|  36.6k|  Curl_creds_unlink(&data->state.creds);
  279|  36.6k|  curlx_safefree(data->state.aptr.uagent);
  ------------------
  |  | 1327|  36.6k|  do {                      \
  |  | 1328|  36.6k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  36.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  36.6k|    (ptr) = NULL;           \
  |  | 1330|  36.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 36.6k]
  |  |  ------------------
  ------------------
  280|  36.6k|  curlx_safefree(data->state.aptr.accept_encoding);
  ------------------
  |  | 1327|  36.6k|  do {                      \
  |  | 1328|  36.6k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  36.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  36.6k|    (ptr) = NULL;           \
  |  | 1330|  36.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 36.6k]
  |  |  ------------------
  ------------------
  281|  36.6k|  curlx_safefree(data->state.aptr.rangeline);
  ------------------
  |  | 1327|  36.6k|  do {                      \
  |  | 1328|  36.6k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  36.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  36.6k|    (ptr) = NULL;           \
  |  | 1330|  36.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 36.6k]
  |  |  ------------------
  ------------------
  282|  36.6k|  curlx_safefree(data->state.aptr.ref);
  ------------------
  |  | 1327|  36.6k|  do {                      \
  |  | 1328|  36.6k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  36.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  36.6k|    (ptr) = NULL;           \
  |  | 1330|  36.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 36.6k]
  |  |  ------------------
  ------------------
  283|  36.6k|  curlx_safefree(data->state.aptr.host);
  ------------------
  |  | 1327|  36.6k|  do {                      \
  |  | 1328|  36.6k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  36.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  36.6k|    (ptr) = NULL;           \
  |  | 1330|  36.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 36.6k]
  |  |  ------------------
  ------------------
  284|  36.6k|#ifndef CURL_DISABLE_COOKIES
  285|  36.6k|  curlx_safefree(data->req.cookiehost);
  ------------------
  |  | 1327|  36.6k|  do {                      \
  |  | 1328|  36.6k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  36.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  36.6k|    (ptr) = NULL;           \
  |  | 1330|  36.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 36.6k]
  |  |  ------------------
  ------------------
  286|  36.6k|#endif
  287|  36.6k|#ifndef CURL_DISABLE_RTSP
  288|  36.6k|  curlx_safefree(data->state.aptr.rtsp_transport);
  ------------------
  |  | 1327|  36.6k|  do {                      \
  |  | 1328|  36.6k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  36.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  36.6k|    (ptr) = NULL;           \
  |  | 1330|  36.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 36.6k]
  |  |  ------------------
  ------------------
  289|  36.6k|#endif
  290|       |
  291|  36.6k|#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_FORM_API)
  292|  36.6k|  Curl_mime_cleanpart(data->state.formp);
  293|  36.6k|  curlx_safefree(data->state.formp);
  ------------------
  |  | 1327|  36.6k|  do {                      \
  |  | 1328|  36.6k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  36.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  36.6k|    (ptr) = NULL;           \
  |  | 1330|  36.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 36.6k]
  |  |  ------------------
  ------------------
  294|  36.6k|#endif
  295|       |
  296|       |  /* destruct wildcard structures if it is needed */
  297|  36.6k|  Curl_wildcard_dtor(&data->wildcard);
  298|  36.6k|  Curl_freeset(data);
  299|  36.6k|  Curl_headers_cleanup(data);
  300|  36.6k|  Curl_netrc_cleanup(&data->state.netrc);
  301|  36.6k|#ifndef CURL_DISABLE_DIGEST_AUTH
  302|  36.6k|  curlx_free(data->state.envproxy);
  ------------------
  |  | 1483|  36.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  303|  36.6k|#endif
  304|  36.6k|  curlx_free(data);
  ------------------
  |  | 1483|  36.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  305|  36.6k|  return CURLE_OK;
  306|  36.6k|}
Curl_init_userdefined:
  313|  36.6k|{
  314|  36.6k|  struct UserDefined *set = &data->set;
  315|       |
  316|  36.6k|  set->out = stdout;  /* default output to stdout */
  317|  36.6k|  set->in_set = stdin;  /* default input from stdin */
  318|  36.6k|  set->err = stderr;  /* default stderr to stderr */
  319|       |
  320|  36.6k|#if defined(__clang__) && __clang_major__ >= 16
  321|  36.6k|#pragma clang diagnostic push
  322|  36.6k|#pragma clang diagnostic ignored "-Wcast-function-type-strict"
  323|  36.6k|#endif
  324|       |  /* use fwrite as default function to store output */
  325|  36.6k|  set->fwrite_func = (curl_write_callback)fwrite;
  326|       |
  327|       |  /* use fread as default function to read input */
  328|  36.6k|  set->fread_func_set = (curl_read_callback)fread;
  329|  36.6k|#if defined(__clang__) && __clang_major__ >= 16
  330|  36.6k|#pragma clang diagnostic pop
  331|  36.6k|#endif
  332|  36.6k|  set->is_fread_set = 0;
  333|       |
  334|  36.6k|  set->seek_client = ZERO_NULL;
  ------------------
  |  | 1155|  36.6k|#define ZERO_NULL 0
  ------------------
  335|       |
  336|  36.6k|  set->filesize = -1;        /* we do not know the size */
  337|  36.6k|  set->postfieldsize = -1;   /* unknown size */
  338|  36.6k|  set->maxredirs = 30;       /* sensible default */
  339|       |
  340|  36.6k|  set->method = HTTPREQ_GET; /* Default HTTP request */
  341|  36.6k|#ifndef CURL_DISABLE_RTSP
  342|  36.6k|  set->rtspreq = RTSPREQ_OPTIONS; /* Default RTSP request */
  343|  36.6k|#endif
  344|  36.6k|#ifndef CURL_DISABLE_FTP
  345|  36.6k|  set->ftp_use_epsv = TRUE;   /* FTP defaults to EPSV operations */
  ------------------
  |  | 1055|  36.6k|#define TRUE true
  ------------------
  346|  36.6k|  set->ftp_use_eprt = TRUE;   /* FTP defaults to EPRT operations */
  ------------------
  |  | 1055|  36.6k|#define TRUE true
  ------------------
  347|  36.6k|  set->ftp_use_pret = FALSE;  /* mainly useful for drftpd servers */
  ------------------
  |  | 1058|  36.6k|#define FALSE false
  ------------------
  348|  36.6k|  set->ftp_filemethod = FTPFILE_MULTICWD;
  349|  36.6k|  set->ftp_skip_ip = TRUE;    /* skip PASV IP by default */
  ------------------
  |  | 1055|  36.6k|#define TRUE true
  ------------------
  350|  36.6k|#endif
  351|  36.6k|  set->dns_cache_timeout_ms = 60000; /* Timeout every 60 seconds by default */
  352|       |
  353|       |  /* Timeout every 24 hours by default */
  354|  36.6k|  set->general_ssl.ca_cache_timeout = 24 * 60 * 60;
  355|       |
  356|  36.6k|  set->httpauth = CURLAUTH_BASIC;  /* defaults to basic */
  ------------------
  |  |  831|  36.6k|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
  357|       |
  358|  36.6k|#ifndef CURL_DISABLE_PROXY
  359|  36.6k|  set->proxyport = 0;
  360|  36.6k|  set->proxytype = CURLPROXY_HTTP; /* defaults to HTTP proxy */
  ------------------
  |  |  790|  36.6k|#define CURLPROXY_HTTP            0L /* added in 7.10, new in 7.19.4 default is
  ------------------
  361|  36.6k|  set->proxyauth = CURLAUTH_BASIC; /* defaults to basic */
  ------------------
  |  |  831|  36.6k|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
  362|       |  /* SOCKS5 proxy auth defaults to username/password + GSS-API */
  363|  36.6k|  set->socks5auth = CURLAUTH_BASIC | CURLAUTH_GSSAPI;
  ------------------
  |  |  831|  36.6k|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
                set->socks5auth = CURLAUTH_BASIC | CURLAUTH_GSSAPI;
  ------------------
  |  |  837|  36.6k|#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE
  |  |  ------------------
  |  |  |  |  833|  36.6k|#define CURLAUTH_NEGOTIATE    (((unsigned long)1) << 2)
  |  |  ------------------
  ------------------
  364|  36.6k|#endif
  365|       |
  366|  36.6k|  Curl_ssl_easy_config_init(data);
  367|  36.6k|#ifndef CURL_DISABLE_DOH
  368|  36.6k|  set->doh_verifyhost = TRUE;
  ------------------
  |  | 1055|  36.6k|#define TRUE true
  ------------------
  369|  36.6k|  set->doh_verifypeer = TRUE;
  ------------------
  |  | 1055|  36.6k|#define TRUE true
  ------------------
  370|  36.6k|#endif
  371|       |#ifdef USE_SSH
  372|       |  /* defaults to any auth type */
  373|       |  set->ssh_auth_types = CURLSSH_AUTH_DEFAULT;
  374|       |  set->new_directory_perms = 0755; /* Default permissions */
  375|       |#endif
  376|       |
  377|  36.6k|  set->new_file_perms = 0644;    /* Default permissions */
  378|  36.6k|  set->allowed_protocols = (curl_prot_t)CURLPROTO_64ALL;
  ------------------
  |  |   68|  36.6k|#define CURLPROTO_64ALL ((uint64_t)0xffffffffffffffff)
  ------------------
  379|  36.6k|  set->redir_protocols = CURLPROTO_REDIR;
  ------------------
  |  |   71|  36.6k|#define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1078|  36.6k|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1079|  36.6k|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1080|  36.6k|#define CURLPROTO_FTP     (1L << 2)
  |  |  ------------------
  |  |   72|  36.6k|                         CURLPROTO_FTPS)
  |  |  ------------------
  |  |  |  | 1081|  36.6k|#define CURLPROTO_FTPS    (1L << 3)
  |  |  ------------------
  ------------------
  380|       |
  381|       |#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
  382|       |  /*
  383|       |   * disallow unprotected protection negotiation NEC reference implementation
  384|       |   * seem not to follow rfc1961 section 4.3/4.4
  385|       |   */
  386|       |  set->socks5_gssapi_nec = FALSE;
  387|       |#endif
  388|       |
  389|       |  /* set default minimum TLS version */
  390|  36.6k|#ifdef USE_SSL
  391|  36.6k|  Curl_setopt_SSLVERSION(data, CURLOPT_SSLVERSION, CURL_SSLVERSION_DEFAULT);
  ------------------
  |  | 2368|  36.6k|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  392|  36.6k|#ifndef CURL_DISABLE_PROXY
  393|  36.6k|  Curl_setopt_SSLVERSION(data, CURLOPT_PROXY_SSLVERSION,
  394|  36.6k|                         CURL_SSLVERSION_DEFAULT);
  ------------------
  |  | 2368|  36.6k|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  395|  36.6k|#endif
  396|  36.6k|#endif
  397|  36.6k|#ifndef CURL_DISABLE_FTP
  398|  36.6k|  set->wildcard_enabled = FALSE;
  ------------------
  |  | 1058|  36.6k|#define FALSE false
  ------------------
  399|  36.6k|  set->chunk_bgn = ZERO_NULL;
  ------------------
  |  | 1155|  36.6k|#define ZERO_NULL 0
  ------------------
  400|  36.6k|  set->chunk_end = ZERO_NULL;
  ------------------
  |  | 1155|  36.6k|#define ZERO_NULL 0
  ------------------
  401|  36.6k|  set->fnmatch = ZERO_NULL;
  ------------------
  |  | 1155|  36.6k|#define ZERO_NULL 0
  ------------------
  402|  36.6k|#endif
  403|  36.6k|  set->tcp_keepalive = FALSE;
  ------------------
  |  | 1058|  36.6k|#define FALSE false
  ------------------
  404|  36.6k|  set->tcp_keepintvl = 60;
  405|  36.6k|  set->tcp_keepidle = 60;
  406|  36.6k|  set->tcp_keepcnt = 9;
  407|  36.6k|  set->tcp_fastopen = FALSE;
  ------------------
  |  | 1058|  36.6k|#define FALSE false
  ------------------
  408|  36.6k|  set->tcp_nodelay = TRUE;
  ------------------
  |  | 1055|  36.6k|#define TRUE true
  ------------------
  409|  36.6k|  set->ssl_enable_alpn = TRUE;
  ------------------
  |  | 1055|  36.6k|#define TRUE true
  ------------------
  410|  36.6k|  set->expect_100_timeout = 1000L; /* Wait for a second by default. */
  411|  36.6k|  set->sep_headers = TRUE; /* separated header lists by default */
  ------------------
  |  | 1055|  36.6k|#define TRUE true
  ------------------
  412|  36.6k|  set->buffer_size = READBUFFER_SIZE;
  ------------------
  |  |  114|  36.6k|#define READBUFFER_SIZE CURL_MAX_WRITE_SIZE
  |  |  ------------------
  |  |  |  |  265|  36.6k|#define CURL_MAX_WRITE_SIZE 16384
  |  |  ------------------
  ------------------
  413|  36.6k|  set->upload_buffer_size = UPLOADBUFFER_DEFAULT;
  ------------------
  |  |  126|  36.6k|#define UPLOADBUFFER_DEFAULT 65536
  ------------------
  414|  36.6k|  set->upload_flags = CURLULFLAG_SEEN;
  ------------------
  |  | 1044|  36.6k|#define CURLULFLAG_SEEN     (1L << 4)
  ------------------
  415|  36.6k|  set->happy_eyeballs_timeout = CURL_HET_DEFAULT;
  ------------------
  |  |  969|  36.6k|#define CURL_HET_DEFAULT 200L
  ------------------
  416|  36.6k|  set->upkeep_interval_ms = CURL_UPKEEP_INTERVAL_DEFAULT;
  ------------------
  |  |  972|  36.6k|#define CURL_UPKEEP_INTERVAL_DEFAULT 60000L
  ------------------
  417|  36.6k|  set->maxconnects = DEFAULT_CONNCACHE_SIZE; /* for easy handles */
  ------------------
  |  |   38|  36.6k|#define DEFAULT_CONNCACHE_SIZE 5
  ------------------
  418|  36.6k|  set->conn_max_idle_ms = 118 * 1000;
  419|  36.6k|  set->conn_max_age_ms = 24 * 3600 * 1000;
  420|  36.6k|  set->http09_allowed = FALSE;
  ------------------
  |  | 1058|  36.6k|#define FALSE false
  ------------------
  421|  36.6k|  set->httpwant = CURL_HTTP_VERSION_NONE;
  ------------------
  |  | 2312|  36.6k|#define CURL_HTTP_VERSION_NONE  0L /* setting this means we do not care, and
  ------------------
  422|  36.6k|#if defined(USE_HTTP2) || defined(USE_HTTP3)
  423|  36.6k|  memset(&set->priority, 0, sizeof(set->priority));
  424|  36.6k|#endif
  425|  36.6k|  set->quick_exit = 0L;
  426|  36.6k|#ifndef CURL_DISABLE_WEBSOCKETS
  427|  36.6k|  set->ws_raw_mode = FALSE;
  ------------------
  |  | 1058|  36.6k|#define FALSE false
  ------------------
  428|       |  set->ws_no_auto_pong = FALSE;
  ------------------
  |  | 1058|  36.6k|#define FALSE false
  ------------------
  429|  36.6k|#endif
  430|  36.6k|}
Curl_open:
  452|  36.6k|{
  453|  36.6k|  struct Curl_easy *data;
  454|       |
  455|       |  /* simple start-up: alloc the struct, init it with zeroes and return */
  456|  36.6k|  data = curlx_calloc(1, sizeof(struct Curl_easy));
  ------------------
  |  | 1480|  36.6k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  457|  36.6k|  if(!data) {
  ------------------
  |  Branch (457:6): [True: 0, False: 36.6k]
  ------------------
  458|       |    /* this is a serious error */
  459|      0|    DEBUGF(curl_mfprintf(stderr, "Error: calloc of Curl_easy failed\n"));
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  ------------------
  460|      0|    return CURLE_OUT_OF_MEMORY;
  461|      0|  }
  462|       |
  463|  36.6k|  data->magic = CURLEASY_MAGIC_NUMBER;
  ------------------
  |  |  130|  36.6k|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  ------------------
  464|       |  /* most recent connection is not yet defined */
  465|  36.6k|  data->state.lastconnect_id = -1;
  466|  36.6k|  data->state.recent_conn_id = -1;
  467|       |  /* and not assigned an id yet */
  468|  36.6k|  data->id = -1;
  469|  36.6k|  data->mid = UINT32_MAX;
  470|  36.6k|  data->master_mid = UINT32_MAX;
  471|  36.6k|  data->progress.hide = TRUE;
  ------------------
  |  | 1055|  36.6k|#define TRUE true
  ------------------
  472|  36.6k|  data->state.current_speed = -1; /* init to negative == impossible */
  473|       |
  474|  36.6k|  Curl_hash_init(&data->meta_hash, 23,
  475|  36.6k|                 Curl_hash_str, curlx_str_key_compare, easy_meta_freeentry);
  476|  36.6k|  curlx_dyn_init(&data->state.headerb, CURL_MAX_HTTP_HEADER);
  ------------------
  |  |  272|  36.6k|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
  477|  36.6k|  Curl_bufref_init(&data->state.url);
  478|  36.6k|  Curl_bufref_init(&data->state.referer);
  479|  36.6k|  Curl_req_init(&data->req);
  480|  36.6k|  Curl_initinfo(data);
  481|  36.6k|#ifndef CURL_DISABLE_HTTP
  482|  36.6k|  Curl_llist_init(&data->state.httphdrs, NULL);
  483|  36.6k|#endif
  484|  36.6k|  Curl_netrc_init(&data->state.netrc);
  485|  36.6k|  Curl_init_userdefined(data);
  486|       |
  487|  36.6k|  *curl = data;
  488|  36.6k|  return CURLE_OK;
  489|  36.6k|}
Curl_conn_free:
  492|  15.5k|{
  493|  15.5k|  size_t i;
  494|       |
  495|  15.5k|  DEBUGASSERT(conn);
  ------------------
  |  | 1081|  15.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (495:3): [True: 0, False: 15.5k]
  |  Branch (495:3): [True: 15.5k, False: 0]
  ------------------
  496|       |
  497|  15.5k|  if(conn->scheme && conn->scheme->run->disconnect &&
  ------------------
  |  Branch (497:6): [True: 14.1k, False: 1.48k]
  |  Branch (497:22): [True: 4.98k, False: 9.12k]
  ------------------
  498|  4.98k|     !conn->bits.shutdown_handler)
  ------------------
  |  Branch (498:6): [True: 39, False: 4.94k]
  ------------------
  499|     39|    conn->scheme->run->disconnect(data, conn, TRUE);
  ------------------
  |  | 1055|     39|#define TRUE true
  ------------------
  500|       |
  501|  46.7k|  for(i = 0; i < CURL_ARRAYSIZE(conn->cfilter); ++i) {
  ------------------
  |  | 1294|  46.7k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (501:14): [True: 31.1k, False: 15.5k]
  ------------------
  502|  31.1k|    Curl_conn_cf_discard_all(data, conn, (int)i);
  503|  31.1k|  }
  504|       |
  505|  15.5k|#ifndef CURL_DISABLE_PROXY
  506|  15.5k|  Curl_peer_unlink(&conn->http_proxy.peer);
  507|  15.5k|  Curl_peer_unlink(&conn->socks_proxy.peer);
  508|  15.5k|  Curl_creds_unlink(&conn->http_proxy.creds);
  509|  15.5k|  Curl_creds_unlink(&conn->socks_proxy.creds);
  510|  15.5k|#endif
  511|  15.5k|  Curl_creds_unlink(&conn->creds);
  512|  15.5k|  curlx_safefree(conn->options);
  ------------------
  |  | 1327|  15.5k|  do {                      \
  |  | 1328|  15.5k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  15.5k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  15.5k|    (ptr) = NULL;           \
  |  | 1330|  15.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
  513|  15.5k|  curlx_safefree(conn->localdev);
  ------------------
  |  | 1327|  15.5k|  do {                      \
  |  | 1328|  15.5k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  15.5k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  15.5k|    (ptr) = NULL;           \
  |  | 1330|  15.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
  514|  15.5k|  Curl_ssl_conn_config_cleanup(conn);
  515|       |
  516|  15.5k|  curlx_safefree(conn->destination);
  ------------------
  |  | 1327|  15.5k|  do {                      \
  |  | 1328|  15.5k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  15.5k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  15.5k|    (ptr) = NULL;           \
  |  | 1330|  15.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
  517|  15.5k|  Curl_hash_destroy(&conn->meta_hash);
  518|  15.5k|  Curl_peer_unlink(&conn->origin);
  519|  15.5k|  Curl_peer_unlink(&conn->via_peer);
  520|  15.5k|  Curl_peer_unlink(&conn->origin2);
  521|  15.5k|  Curl_peer_unlink(&conn->via_peer2);
  522|       |
  523|  15.5k|  curlx_free(conn); /* free all the connection oriented data */
  ------------------
  |  | 1483|  15.5k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  524|  15.5k|}
Curl_conn_seems_dead:
  603|    416|{
  604|    416|  DEBUGASSERT(!data->conn);
  ------------------
  |  | 1081|    416|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (604:3): [True: 0, False: 416]
  |  Branch (604:3): [True: 416, False: 0]
  ------------------
  605|    416|  if(!CONN_INUSE(conn)) {
  ------------------
  |  |  346|    416|#define CONN_INUSE(c) (!!(c)->attached_xfers)
  ------------------
  |  Branch (605:6): [True: 416, False: 0]
  ------------------
  606|       |    /* The check for a dead socket makes sense only if the connection is not in
  607|       |       use */
  608|    416|    bool dead;
  609|       |
  610|    416|    if(conn_maxage(data, conn, *Curl_pgrs_now(data))) {
  ------------------
  |  Branch (610:8): [True: 0, False: 416]
  ------------------
  611|       |      /* avoid check if already too old */
  612|      0|      dead = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  613|      0|    }
  614|    416|    else if(conn->scheme->run->connection_is_dead) {
  ------------------
  |  Branch (614:13): [True: 0, False: 416]
  ------------------
  615|       |      /* The protocol has a special method for checking the state of the
  616|       |         connection. Use it to check if the connection is dead. */
  617|       |      /* briefly attach the connection for the check */
  618|      0|      Curl_attach_connection(data, conn);
  619|      0|      dead = conn->scheme->run->connection_is_dead(data, conn);
  620|      0|      Curl_detach_connection(data);
  621|      0|    }
  622|    416|    else {
  623|    416|      bool input_pending = FALSE;
  ------------------
  |  | 1058|    416|#define FALSE false
  ------------------
  624|       |
  625|    416|      Curl_attach_connection(data, conn);
  626|    416|      dead = !Curl_conn_is_alive(data, conn, &input_pending);
  627|    416|      if(input_pending) {
  ------------------
  |  Branch (627:10): [True: 307, False: 109]
  ------------------
  628|       |        /* For reuse, we want a "clean" connection state. This includes
  629|       |         * that we expect - in general - no waiting input data. Input
  630|       |         * waiting might be a TLS Notify Close, for example. We reject
  631|       |         * that.
  632|       |         * For protocols where data from other end may arrive at
  633|       |         * any time (HTTP/2 PING for example), the protocol handler needs
  634|       |         * to install its own `connection_check` callback.
  635|       |         */
  636|    307|        DEBUGF(infof(data, "connection has input pending, not reusable"));
  ------------------
  |  | 1067|  2.14k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 307, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 307]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 307]
  |  |  ------------------
  ------------------
  637|    307|        dead = TRUE;
  ------------------
  |  | 1055|    307|#define TRUE true
  ------------------
  638|    307|      }
  639|    416|      Curl_detach_connection(data);
  640|    416|    }
  641|       |
  642|    416|    if(dead) {
  ------------------
  |  Branch (642:8): [True: 307, False: 109]
  ------------------
  643|       |      /* remove connection from cpool */
  644|    307|      infof(data, "Connection %" FMT_OFF_T " seems to be dead",
  ------------------
  |  |  143|    307|  do {                               \
  |  |  144|    307|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    307|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 307, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 307]
  |  |  |  |  ------------------
  |  |  |  |  320|    307|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    307|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    307|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 307]
  |  |  ------------------
  ------------------
  645|    307|            conn->connection_id);
  646|    307|      return TRUE;
  ------------------
  |  | 1055|    307|#define TRUE true
  ------------------
  647|    307|    }
  648|    416|  }
  649|    109|  return FALSE;
  ------------------
  |  | 1058|    109|#define FALSE false
  ------------------
  650|    416|}
Curl_uc_to_curlcode:
 1373|    888|{
 1374|    888|  switch(uc) {
 1375|    886|  default:
  ------------------
  |  Branch (1375:3): [True: 886, False: 2]
  ------------------
 1376|    886|    return CURLE_URL_MALFORMAT;
 1377|      1|  case CURLUE_UNSUPPORTED_SCHEME:
  ------------------
  |  Branch (1377:3): [True: 1, False: 887]
  ------------------
 1378|      1|    return CURLE_UNSUPPORTED_PROTOCOL;
 1379|      0|  case CURLUE_OUT_OF_MEMORY:
  ------------------
  |  Branch (1379:3): [True: 0, False: 888]
  ------------------
 1380|      0|    return CURLE_OUT_OF_MEMORY;
 1381|      1|  case CURLUE_USER_NOT_ALLOWED:
  ------------------
  |  Branch (1381:3): [True: 1, False: 887]
  ------------------
 1382|      1|    return CURLE_LOGIN_DENIED;
 1383|    888|  }
 1384|    888|}
Curl_parse_login_details:
 2103|  6.60k|{
 2104|  6.60k|  char *ubuf = NULL;
 2105|  6.60k|  char *pbuf = NULL;
 2106|  6.60k|  const char *psep = NULL;
 2107|  6.60k|  const char *osep = NULL;
 2108|  6.60k|  size_t ulen;
 2109|  6.60k|  size_t plen;
 2110|  6.60k|  size_t olen;
 2111|       |
 2112|  6.60k|  DEBUGASSERT(userp);
  ------------------
  |  | 1081|  6.60k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2112:3): [True: 0, False: 6.60k]
  |  Branch (2112:3): [True: 6.60k, False: 0]
  ------------------
 2113|  6.60k|  DEBUGASSERT(passwdp);
  ------------------
  |  | 1081|  6.60k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2113:3): [True: 0, False: 6.60k]
  |  Branch (2113:3): [True: 6.60k, False: 0]
  ------------------
 2114|       |
 2115|       |  /* Attempt to find the password separator */
 2116|  6.60k|  psep = memchr(login, ':', len);
 2117|       |
 2118|       |  /* Attempt to find the options separator */
 2119|  6.60k|  if(optionsp)
  ------------------
  |  Branch (2119:6): [True: 13, False: 6.59k]
  ------------------
 2120|     13|    osep = memchr(login, ';', len);
 2121|       |
 2122|       |  /* Calculate the portion lengths */
 2123|  6.60k|  ulen = (psep ?
  ------------------
  |  Branch (2123:11): [True: 2.09k, False: 4.51k]
  ------------------
 2124|  2.09k|          (size_t)(osep && psep > osep ? osep - login : psep - login) :
  ------------------
  |  Branch (2124:20): [True: 4, False: 2.09k]
  |  Branch (2124:28): [True: 1, False: 3]
  ------------------
 2125|  6.60k|          (osep ? (size_t)(osep - login) : len));
  ------------------
  |  Branch (2125:12): [True: 6, False: 4.50k]
  ------------------
 2126|  6.60k|  plen = (psep ?
  ------------------
  |  Branch (2126:11): [True: 2.09k, False: 4.51k]
  ------------------
 2127|  2.09k|          (osep && osep > psep ? (size_t)(osep - psep) :
  ------------------
  |  Branch (2127:12): [True: 4, False: 2.09k]
  |  Branch (2127:20): [True: 3, False: 1]
  ------------------
 2128|  4.51k|           (size_t)(login + len - psep)) - 1 : 0);
 2129|  6.60k|  olen = (osep ?
  ------------------
  |  Branch (2129:11): [True: 10, False: 6.59k]
  ------------------
 2130|     10|          (psep && psep > osep ? (size_t)(psep - osep) :
  ------------------
  |  Branch (2130:12): [True: 4, False: 6]
  |  Branch (2130:20): [True: 1, False: 3]
  ------------------
 2131|  6.59k|           (size_t)(login + len - osep)) - 1 : 0);
 2132|       |
 2133|       |  /* Clone the user portion buffer, which can be zero length */
 2134|  6.60k|  ubuf = curlx_memdup0(login, ulen);
 2135|  6.60k|  if(!ubuf)
  ------------------
  |  Branch (2135:6): [True: 0, False: 6.60k]
  ------------------
 2136|      0|    goto error;
 2137|       |
 2138|       |  /* Clone the password portion buffer */
 2139|  6.60k|  if(psep) {
  ------------------
  |  Branch (2139:6): [True: 2.09k, False: 4.51k]
  ------------------
 2140|  2.09k|    pbuf = curlx_memdup0(&psep[1], plen);
 2141|  2.09k|    if(!pbuf)
  ------------------
  |  Branch (2141:8): [True: 0, False: 2.09k]
  ------------------
 2142|      0|      goto error;
 2143|  2.09k|  }
 2144|       |
 2145|       |  /* Allocate the options portion buffer */
 2146|  6.60k|  if(optionsp) {
  ------------------
  |  Branch (2146:6): [True: 13, False: 6.59k]
  ------------------
 2147|     13|    char *obuf = NULL;
 2148|     13|    if(olen) {
  ------------------
  |  Branch (2148:8): [True: 7, False: 6]
  ------------------
 2149|      7|      obuf = curlx_memdup0(&osep[1], olen);
 2150|      7|      if(!obuf)
  ------------------
  |  Branch (2150:10): [True: 0, False: 7]
  ------------------
 2151|      0|        goto error;
 2152|      7|    }
 2153|     13|    *optionsp = obuf;
 2154|     13|  }
 2155|  6.60k|  *userp = ubuf;
 2156|  6.60k|  *passwdp = pbuf;
 2157|  6.60k|  return CURLE_OK;
 2158|      0|error:
 2159|      0|  curlx_free(ubuf);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2160|      0|  curlx_free(pbuf);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2161|      0|  return CURLE_OUT_OF_MEMORY;
 2162|  6.60k|}
Curl_connect:
 2935|  15.5k|{
 2936|  15.5k|  CURLcode result;
 2937|  15.5k|  struct connectdata *conn;
 2938|       |
 2939|  15.5k|  *pconnected = FALSE;
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
 2940|       |
 2941|       |  /* Set the request to virgin state based on transfer settings */
 2942|  15.5k|  Curl_req_hard_reset(&data->req, data);
 2943|       |
 2944|       |  /* Get or create a connection for the transfer. */
 2945|  15.5k|  result = url_find_or_create_conn(data);
 2946|  15.5k|  conn = data->conn;
 2947|       |
 2948|  15.5k|  if(result)
  ------------------
  |  Branch (2948:6): [True: 1.71k, False: 13.8k]
  ------------------
 2949|  1.71k|    goto out;
 2950|       |
 2951|  13.8k|  DEBUGASSERT(conn);
  ------------------
  |  | 1081|  13.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2951:3): [True: 0, False: 13.8k]
  |  Branch (2951:3): [True: 13.8k, False: 0]
  ------------------
 2952|  13.8k|  Curl_pgrsTime(data, TIMER_POSTQUEUE);
 2953|  13.8k|  if(conn->bits.reuse) {
  ------------------
  |  Branch (2953:6): [True: 109, False: 13.7k]
  ------------------
 2954|    109|    if(conn->attached_xfers > 1)
  ------------------
  |  Branch (2954:8): [True: 0, False: 109]
  ------------------
 2955|       |      /* multiplexed */
 2956|      0|      *pconnected = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2957|    109|  }
 2958|  13.7k|  else if(conn->scheme->flags & PROTOPT_NONETWORK) {
  ------------------
  |  |  215|  13.7k|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (2958:11): [True: 0, False: 13.7k]
  ------------------
 2959|      0|    Curl_pgrsTime(data, TIMER_NAMELOOKUP);
 2960|      0|    *pconnected = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2961|      0|  }
 2962|  13.7k|  else {
 2963|  13.7k|    result = Curl_conn_setup(data, conn, FIRSTSOCKET, CURL_CF_SSL_DEFAULT);
  ------------------
  |  |  303|  13.7k|#define FIRSTSOCKET     0
  ------------------
                  result = Curl_conn_setup(data, conn, FIRSTSOCKET, CURL_CF_SSL_DEFAULT);
  ------------------
  |  |  363|  13.7k|#define CURL_CF_SSL_DEFAULT  (-1)
  ------------------
 2964|  13.7k|    if(!result)
  ------------------
  |  Branch (2964:8): [True: 13.7k, False: 0]
  ------------------
 2965|  13.7k|      result = Curl_headers_init(data);
 2966|  13.7k|    CURL_TRC_M(data, "Curl_conn_setup() -> %d", result);
  ------------------
  |  |  148|  13.7k|  do {                                   \
  |  |  149|  13.7k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  13.7k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|  13.7k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|  27.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 13.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 13.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|  27.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|  13.7k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  13.7k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  13.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 2967|  13.7k|  }
 2968|       |
 2969|  15.5k|out:
 2970|  15.5k|  if(result == CURLE_NO_CONNECTION_AVAILABLE)
  ------------------
  |  Branch (2970:6): [True: 204, False: 15.3k]
  ------------------
 2971|  15.5k|    DEBUGASSERT(!conn);
  ------------------
  |  | 1081|  15.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2971:5): [True: 0, False: 204]
  |  Branch (2971:5): [True: 204, False: 0]
  ------------------
 2972|       |
 2973|  15.5k|  if(result && conn) {
  ------------------
  |  Branch (2973:6): [True: 1.71k, False: 13.8k]
  |  Branch (2973:16): [True: 0, False: 1.71k]
  ------------------
 2974|       |    /* We are not allowed to return failure with memory left allocated in the
 2975|       |       connectdata struct, free those here */
 2976|      0|    Curl_detach_connection(data);
 2977|      0|    Curl_conn_terminate(data, conn, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2978|      0|  }
 2979|       |
 2980|  15.5k|  return result;
 2981|  15.5k|}
Curl_init_do:
 2994|  13.8k|{
 2995|  13.8k|  CURLcode result;
 2996|       |
 2997|  13.8k|  if(conn) {
  ------------------
  |  Branch (2997:6): [True: 13.8k, False: 0]
  ------------------
 2998|  13.8k|    conn->bits.do_more = FALSE; /* by default there is no curl_do_more() to
  ------------------
  |  | 1058|  13.8k|#define FALSE false
  ------------------
 2999|       |                                   use */
 3000|       |    /* if the protocol used does not support wildcards, switch it off */
 3001|  13.8k|    if(data->state.wildcardmatch &&
  ------------------
  |  Branch (3001:8): [True: 767, False: 13.1k]
  ------------------
 3002|    767|       !(conn->scheme->flags & PROTOPT_WILDCARD))
  ------------------
  |  |  231|    767|#define PROTOPT_WILDCARD (1 << 12)  /* protocol supports wildcard matching */
  ------------------
  |  Branch (3002:8): [True: 18, False: 749]
  ------------------
 3003|     18|      data->state.wildcardmatch = FALSE;
  ------------------
  |  | 1058|     18|#define FALSE false
  ------------------
 3004|  13.8k|  }
 3005|       |
 3006|  13.8k|  data->state.done = FALSE; /* *_done() is not called yet */
  ------------------
  |  | 1058|  13.8k|#define FALSE false
  ------------------
 3007|       |
 3008|  13.8k|  data->req.no_body = data->set.opt_no_body;
 3009|  13.8k|  if(data->req.no_body)
  ------------------
  |  Branch (3009:6): [True: 268, False: 13.6k]
  ------------------
 3010|       |    /* in HTTP lingo, no body means using the HEAD request... */
 3011|    268|    data->state.httpreq = HTTPREQ_HEAD;
 3012|       |
 3013|  13.8k|  result = Curl_req_start(&data->req, data);
 3014|  13.8k|  if(!result) {
  ------------------
  |  Branch (3014:6): [True: 13.8k, False: 0]
  ------------------
 3015|  13.8k|    Curl_pgrsReset(data);
 3016|  13.8k|  }
 3017|  13.8k|  return result;
 3018|  13.8k|}
Curl_data_priority_clear_state:
 3023|  14.6k|{
 3024|  14.6k|  memset(&data->state.priority, 0, sizeof(data->state.priority));
 3025|  14.6k|}
Curl_conn_meta_set:
 3031|  4.96k|{
 3032|  4.96k|  if(!Curl_hash_add2(&conn->meta_hash, CURL_UNCONST(key), strlen(key) + 1,
  ------------------
  |  |  866|  4.96k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  |  Branch (3032:6): [True: 0, False: 4.96k]
  ------------------
 3033|  4.96k|                     meta_data, meta_dtor)) {
 3034|      0|    meta_dtor(CURL_UNCONST(key), strlen(key) + 1, meta_data);
  ------------------
  |  |  866|      0|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
 3035|      0|    return CURLE_OUT_OF_MEMORY;
 3036|      0|  }
 3037|  4.96k|  return CURLE_OK;
 3038|  4.96k|}
Curl_conn_meta_remove:
 3041|  13.7k|{
 3042|  13.7k|  Curl_hash_delete(&conn->meta_hash, CURL_UNCONST(key), strlen(key) + 1);
  ------------------
  |  |  866|  13.7k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
 3043|  13.7k|}
Curl_conn_meta_get:
 3046|   864k|{
 3047|   864k|  return Curl_hash_pick(&conn->meta_hash, CURL_UNCONST(key), strlen(key) + 1);
  ------------------
  |  |  866|   864k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
 3048|   864k|}
Curl_1st_fatal:
 3051|  15.0k|{
 3052|  15.0k|  if(r1 && (r1 != CURLE_AGAIN))
  ------------------
  |  Branch (3052:6): [True: 11.9k, False: 3.19k]
  |  Branch (3052:12): [True: 11.9k, False: 0]
  ------------------
 3053|  11.9k|    return r1;
 3054|  3.19k|  if(r2 && (r2 != CURLE_AGAIN))
  ------------------
  |  Branch (3054:6): [True: 1, False: 3.19k]
  |  Branch (3054:12): [True: 1, False: 0]
  ------------------
 3055|      1|    return r2;
 3056|  3.19k|  return r1;
 3057|  3.19k|}
url.c:up_free:
  179|  52.2k|{
  180|  52.2k|  struct urlpieces *up = &data->state.up;
  181|  52.2k|  curlx_safefree(up->scheme);
  ------------------
  |  | 1327|  52.2k|  do {                      \
  |  | 1328|  52.2k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  52.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  52.2k|    (ptr) = NULL;           \
  |  | 1330|  52.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 52.2k]
  |  |  ------------------
  ------------------
  182|  52.2k|  curlx_safefree(up->hostname);
  ------------------
  |  | 1327|  52.2k|  do {                      \
  |  | 1328|  52.2k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  52.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  52.2k|    (ptr) = NULL;           \
  |  | 1330|  52.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 52.2k]
  |  |  ------------------
  ------------------
  183|  52.2k|  curlx_safefree(up->port);
  ------------------
  |  | 1327|  52.2k|  do {                      \
  |  | 1328|  52.2k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  52.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  52.2k|    (ptr) = NULL;           \
  |  | 1330|  52.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 52.2k]
  |  |  ------------------
  ------------------
  184|  52.2k|  curlx_safefree(up->user);
  ------------------
  |  | 1327|  52.2k|  do {                      \
  |  | 1328|  52.2k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  52.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  52.2k|    (ptr) = NULL;           \
  |  | 1330|  52.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 52.2k]
  |  |  ------------------
  ------------------
  185|  52.2k|  curlx_safefree(up->password);
  ------------------
  |  | 1327|  52.2k|  do {                      \
  |  | 1328|  52.2k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  52.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  52.2k|    (ptr) = NULL;           \
  |  | 1330|  52.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 52.2k]
  |  |  ------------------
  ------------------
  186|  52.2k|  curlx_safefree(up->options);
  ------------------
  |  | 1327|  52.2k|  do {                      \
  |  | 1328|  52.2k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  52.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  52.2k|    (ptr) = NULL;           \
  |  | 1330|  52.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 52.2k]
  |  |  ------------------
  ------------------
  187|  52.2k|  curlx_safefree(up->path);
  ------------------
  |  | 1327|  52.2k|  do {                      \
  |  | 1328|  52.2k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  52.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  52.2k|    (ptr) = NULL;           \
  |  | 1330|  52.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 52.2k]
  |  |  ------------------
  ------------------
  188|  52.2k|  curlx_safefree(up->query);
  ------------------
  |  | 1327|  52.2k|  do {                      \
  |  | 1328|  52.2k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  52.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  52.2k|    (ptr) = NULL;           \
  |  | 1330|  52.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 52.2k]
  |  |  ------------------
  ------------------
  189|  52.2k|  curl_url_cleanup(data->state.uh);
  190|       |  data->state.uh = NULL;
  191|  52.2k|}
url.c:conn_maxage:
  571|    416|{
  572|    416|  timediff_t age_ms;
  573|       |
  574|    416|  if(data->set.conn_max_idle_ms) {
  ------------------
  |  Branch (574:6): [True: 411, False: 5]
  ------------------
  575|    411|    age_ms = curlx_ptimediff_ms(&now, &conn->lastused);
  576|    411|    if(age_ms > data->set.conn_max_idle_ms) {
  ------------------
  |  Branch (576:8): [True: 0, False: 411]
  ------------------
  577|      0|      infof(data, "Too old connection (%" FMT_TIMEDIFF_T
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  578|      0|            " ms idle, max idle is %" FMT_TIMEDIFF_T " ms), disconnect it",
  579|      0|            age_ms, data->set.conn_max_idle_ms);
  580|      0|      return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  581|      0|    }
  582|    411|  }
  583|       |
  584|    416|  if(data->set.conn_max_age_ms) {
  ------------------
  |  Branch (584:6): [True: 415, False: 1]
  ------------------
  585|    415|    age_ms = curlx_ptimediff_ms(&now, &conn->created);
  586|    415|    if(age_ms > data->set.conn_max_age_ms) {
  ------------------
  |  Branch (586:8): [True: 0, False: 415]
  ------------------
  587|      0|      infof(data,
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  588|      0|            "Too old connection (created %" FMT_TIMEDIFF_T
  589|      0|            " ms ago, max lifetime is %" FMT_TIMEDIFF_T " ms), disconnect it",
  590|      0|            age_ms, data->set.conn_max_age_ms);
  591|      0|      return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  592|      0|    }
  593|    415|  }
  594|       |
  595|    416|  return FALSE;
  ------------------
  |  | 1058|    416|#define FALSE false
  ------------------
  596|    416|}
url.c:url_find_or_create_conn:
 2736|  15.5k|{
 2737|  15.5k|  struct connectdata *needle = NULL;
 2738|  15.5k|  bool waitpipe = FALSE;
  ------------------
  |  | 1058|  15.5k|#define FALSE false
  ------------------
 2739|  15.5k|  CURLcode result;
 2740|       |
 2741|       |  /* create the template connection for transfer data. Use this needle to
 2742|       |   * find an existing connection or, if none exists, convert needle
 2743|       |   * to a full connection and attach it to data. */
 2744|  15.5k|  result = url_create_needle(data, &needle);
 2745|  15.5k|  if(result)
  ------------------
  |  Branch (2745:6): [True: 1.51k, False: 14.0k]
  ------------------
 2746|  1.51k|    goto out;
 2747|  14.0k|  DEBUGASSERT(needle);
  ------------------
  |  | 1081|  14.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2747:3): [True: 0, False: 14.0k]
  |  Branch (2747:3): [True: 14.0k, False: 0]
  ------------------
 2748|       |
 2749|       |  /***********************************************************************
 2750|       |   * file: is a special case in that it does not need a network connection
 2751|       |   ***********************************************************************/
 2752|  14.0k|#ifndef CURL_DISABLE_FILE
 2753|  14.0k|  if(needle->scheme->flags & PROTOPT_NONETWORK) {
  ------------------
  |  |  215|  14.0k|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (2753:6): [True: 0, False: 14.0k]
  ------------------
 2754|      0|    bool done;
 2755|       |    /* this is supposed to be the connect function so we better at least check
 2756|       |       that the file is present here! */
 2757|      0|    DEBUGASSERT(needle->scheme->run->connect_it);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2757:5): [True: 0, False: 0]
  |  Branch (2757:5): [True: 0, False: 0]
  ------------------
 2758|      0|    data->info.conn_scheme = needle->scheme->name;
 2759|       |    /* conn_protocol can only provide "old" protocols */
 2760|      0|    data->info.conn_protocol = (needle->scheme->protocol) & CURLPROTO_MASK;
  ------------------
  |  |   79|      0|#define CURLPROTO_MASK   0x3fffffff
  ------------------
 2761|      0|    result = needle->scheme->run->connect_it(data, &done);
 2762|      0|    if(result)
  ------------------
  |  Branch (2762:8): [True: 0, False: 0]
  ------------------
 2763|      0|      goto out;
 2764|       |
 2765|       |    /* Setup a "faked" transfer that will do nothing */
 2766|      0|    Curl_attach_connection(data, needle);
 2767|      0|    needle = NULL;
 2768|      0|    result = Curl_cpool_add(data, data->conn);
 2769|      0|    if(!result) {
  ------------------
  |  Branch (2769:8): [True: 0, False: 0]
  ------------------
 2770|       |      /* Setup whatever necessary for a resumed transfer */
 2771|      0|      result = setup_range(data);
 2772|      0|      if(!result) {
  ------------------
  |  Branch (2772:10): [True: 0, False: 0]
  ------------------
 2773|      0|        Curl_xfer_setup_nop(data);
 2774|      0|        result = Curl_init_do(data, data->conn);
 2775|      0|      }
 2776|      0|    }
 2777|       |
 2778|      0|    if(result) {
  ------------------
  |  Branch (2778:8): [True: 0, False: 0]
  ------------------
 2779|      0|      DEBUGASSERT(data->conn->scheme->run->done);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2779:7): [True: 0, False: 0]
  |  Branch (2779:7): [True: 0, False: 0]
  ------------------
 2780|       |      /* we ignore the return code for the protocol-specific DONE */
 2781|      0|      (void)data->conn->scheme->run->done(data, result, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2782|      0|    }
 2783|      0|    goto out;
 2784|      0|  }
 2785|  14.0k|#endif
 2786|       |
 2787|       |  /* Complete the easy's SSL configuration for connection cache matching */
 2788|  14.0k|  result = Curl_ssl_easy_config_complete(data);
 2789|  14.0k|  if(result)
  ------------------
  |  Branch (2789:6): [True: 0, False: 14.0k]
  ------------------
 2790|      0|    goto out;
 2791|       |
 2792|       |  /* Get rid of any dead connections so limit are easier kept. */
 2793|  14.0k|  Curl_cpool_prune_dead(data);
 2794|       |
 2795|       |  /*************************************************************
 2796|       |   * Reuse of existing connection is not allowed when
 2797|       |   * - connect_only is set or
 2798|       |   * - reuse_fresh is set and this is not a follow-up request
 2799|       |   *   (like with HTTP followlocation)
 2800|       |   *************************************************************/
 2801|  14.0k|  if((!data->set.reuse_fresh || data->state.followlocation) &&
  ------------------
  |  Branch (2801:7): [True: 14.0k, False: 78]
  |  Branch (2801:33): [True: 38, False: 40]
  ------------------
 2802|  14.0k|     !data->set.connect_only) {
  ------------------
  |  Branch (2802:6): [True: 13.9k, False: 142]
  ------------------
 2803|       |    /* Ok, try to find and attach an existing one */
 2804|  13.9k|    url_attach_existing(data, needle, &waitpipe);
 2805|  13.9k|  }
 2806|       |
 2807|  14.0k|  if(data->conn) {
  ------------------
  |  Branch (2807:6): [True: 109, False: 13.9k]
  ------------------
 2808|       |    /* We attached an existing connection for this transfer. Copy
 2809|       |     * over transfer specific properties over from needle. */
 2810|    109|    struct connectdata *conn = data->conn;
 2811|    109|    VERBOSE(bool tls_upgraded = (!(needle->given->flags & PROTOPT_SSL) &&
  ------------------
  |  | 1618|    327|#define VERBOSE(x) x
  |  |  ------------------
  |  |  |  Branch (1618:20): [True: 109, False: 0]
  |  |  |  Branch (1618:20): [True: 0, False: 109]
  |  |  ------------------
  ------------------
 2812|    109|                                 Curl_conn_is_ssl(conn, FIRSTSOCKET)));
 2813|       |
 2814|    109|    conn->bits.reuse = TRUE;
  ------------------
  |  | 1055|    109|#define TRUE true
  ------------------
 2815|    109|    url_conn_reuse_adjust(data, needle);
 2816|       |
 2817|    109|#ifndef CURL_DISABLE_PROXY
 2818|    109|    infof(data, "Reusing existing %s: connection%s with %s %s",
  ------------------
  |  |  143|    109|  do {                               \
  |  |  144|    109|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    109|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 109, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 109]
  |  |  |  |  ------------------
  |  |  |  |  320|    109|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    109|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|    109|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 109]
  |  |  ------------------
  ------------------
 2819|    109|          conn->given->name,
 2820|    109|          tls_upgraded ? " (upgraded to SSL)" : "",
 2821|    109|          conn->bits.proxy ? "proxy" : "host",
 2822|    109|          conn->socks_proxy.peer ? conn->socks_proxy.peer->user_hostname :
 2823|    109|          conn->http_proxy.peer ? conn->http_proxy.peer->user_hostname :
 2824|    109|          conn->origin->hostname);
 2825|       |#else
 2826|       |    infof(data, "Reusing existing %s: connection%s with host %s",
 2827|       |          conn->given->name,
 2828|       |          tls_upgraded ? " (upgraded to SSL)" : "",
 2829|       |          conn->origin->hostname);
 2830|       |#endif
 2831|    109|  }
 2832|  13.9k|  else {
 2833|       |    /* We have decided that we want a new connection. We may not be able to do
 2834|       |       that if we have reached the limit of how many connections we are
 2835|       |       allowed to open. */
 2836|  13.9k|    DEBUGF(infof(data, "new connection, bits.close=%d", needle->bits.close));
  ------------------
  |  | 1067|  97.8k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 13.9k, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 13.9k]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 13.9k]
  |  |  ------------------
  ------------------
 2837|       |
 2838|  13.9k|    if(waitpipe) {
  ------------------
  |  Branch (2838:8): [True: 204, False: 13.7k]
  ------------------
 2839|       |      /* There is a connection that *might* become usable for multiplexing
 2840|       |         "soon", and we wait for that */
 2841|    204|      infof(data, "Waiting on connection to negotiate possible multiplexing.");
  ------------------
  |  |  143|    204|  do {                               \
  |  |  144|    204|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    204|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 204, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 204]
  |  |  |  |  ------------------
  |  |  |  |  320|    204|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    204|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    204|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 204]
  |  |  ------------------
  ------------------
 2842|    204|      result = CURLE_NO_CONNECTION_AVAILABLE;
 2843|    204|      goto out;
 2844|    204|    }
 2845|  13.7k|    else {
 2846|  13.7k|      switch(Curl_cpool_check_limits(data, needle)) {
 2847|      0|      case CPOOL_LIMIT_DEST:
  ------------------
  |  |   91|      0|#define CPOOL_LIMIT_DEST   1
  ------------------
  |  Branch (2847:7): [True: 0, False: 13.7k]
  ------------------
 2848|      0|        infof(data, "No more connections allowed to host");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2849|      0|        result = CURLE_NO_CONNECTION_AVAILABLE;
 2850|      0|        goto out;
 2851|      0|      case CPOOL_LIMIT_TOTAL:
  ------------------
  |  |   92|      0|#define CPOOL_LIMIT_TOTAL  2
  ------------------
  |  Branch (2851:7): [True: 0, False: 13.7k]
  ------------------
 2852|      0|        if(data->master_mid != UINT32_MAX)
  ------------------
  |  Branch (2852:12): [True: 0, False: 0]
  ------------------
 2853|      0|          CURL_TRC_M(data, "Allowing sub-requests (like DoH) to override "
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2854|      0|                     "max connection limit");
 2855|      0|        else {
 2856|      0|          infof(data, "No connections available, total of %zu reached.",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2857|      0|                data->multi->max_total_connections);
 2858|      0|          result = CURLE_NO_CONNECTION_AVAILABLE;
 2859|      0|          goto out;
 2860|      0|        }
 2861|      0|        break;
 2862|  13.7k|      default:
  ------------------
  |  Branch (2862:7): [True: 13.7k, False: 0]
  ------------------
 2863|  13.7k|        break;
 2864|  13.7k|      }
 2865|  13.7k|    }
 2866|       |
 2867|       |    /* Convert needle into a full connection by filling in all the
 2868|       |     * remaining parts like the cloned SSL configuration. */
 2869|  13.7k|    result = Curl_ssl_conn_config_init(data, needle);
 2870|  13.7k|    if(result) {
  ------------------
  |  Branch (2870:8): [True: 0, False: 13.7k]
  ------------------
 2871|      0|      DEBUGF(curl_mfprintf(stderr, "Error: init connection SSL config\n"));
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  ------------------
 2872|      0|      goto out;
 2873|      0|    }
 2874|       |    /* attach it and no longer own it */
 2875|  13.7k|    Curl_attach_connection(data, needle);
 2876|  13.7k|    needle = NULL;
 2877|       |
 2878|  13.7k|    result = Curl_cpool_add(data, data->conn);
 2879|  13.7k|    if(result)
  ------------------
  |  Branch (2879:8): [True: 0, False: 13.7k]
  ------------------
 2880|      0|      goto out;
 2881|       |
 2882|       |#ifdef USE_NTLM
 2883|       |    /* If NTLM is requested in a part of this connection, make sure we do not
 2884|       |       assume the state is fine as this is a fresh connection and NTLM is
 2885|       |       connection based. */
 2886|       |    if((data->state.authhost.picked & CURLAUTH_NTLM) &&
 2887|       |       data->state.authhost.done) {
 2888|       |      infof(data, "NTLM picked AND auth done set, clear picked");
 2889|       |      data->state.authhost.picked = CURLAUTH_NONE;
 2890|       |      data->state.authhost.done = FALSE;
 2891|       |    }
 2892|       |
 2893|       |    if((data->state.authproxy.picked & CURLAUTH_NTLM) &&
 2894|       |       data->state.authproxy.done) {
 2895|       |      infof(data, "NTLM-proxy picked AND auth done set, clear picked");
 2896|       |      data->state.authproxy.picked = CURLAUTH_NONE;
 2897|       |      data->state.authproxy.done = FALSE;
 2898|       |    }
 2899|       |#endif
 2900|  13.7k|  }
 2901|       |
 2902|       |  /* Setup and init stuff before DO starts, in preparing for the transfer. */
 2903|  13.8k|  result = Curl_init_do(data, data->conn);
 2904|  13.8k|  if(result)
  ------------------
  |  Branch (2904:6): [True: 0, False: 13.8k]
  ------------------
 2905|      0|    goto out;
 2906|       |
 2907|       |  /* Setup whatever necessary for a resumed transfer */
 2908|  13.8k|  result = setup_range(data);
 2909|  13.8k|  if(result)
  ------------------
  |  Branch (2909:6): [True: 0, False: 13.8k]
  ------------------
 2910|      0|    goto out;
 2911|       |
 2912|       |  /* persist the scheme and handler the transfer is using */
 2913|  13.8k|  data->info.conn_scheme = data->conn->scheme->name;
 2914|       |  /* conn_protocol can only provide "old" protocols */
 2915|  13.8k|  data->info.conn_protocol = (data->conn->scheme->protocol) & CURLPROTO_MASK;
  ------------------
  |  |   79|  13.8k|#define CURLPROTO_MASK   0x3fffffff
  ------------------
 2916|  13.8k|  data->info.used_proxy =
 2917|       |#ifdef CURL_DISABLE_PROXY
 2918|       |    0
 2919|       |#else
 2920|  13.8k|    data->conn->bits.proxy
 2921|  13.8k|#endif
 2922|  13.8k|    ;
 2923|       |
 2924|       |  /* Lastly, inform connection filters that a new transfer is attached */
 2925|  13.8k|  result = Curl_conn_ev_data_setup(data);
 2926|       |
 2927|  15.5k|out:
 2928|  15.5k|  if(needle)
  ------------------
  |  Branch (2928:6): [True: 313, False: 15.2k]
  ------------------
 2929|    313|    Curl_conn_free(data, needle);
 2930|  15.5k|  DEBUGASSERT(result || data->conn);
  ------------------
  |  | 1081|  15.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2930:3): [True: 15.5k, False: 0]
  |  Branch (2930:3): [True: 0, False: 0]
  |  Branch (2930:3): [True: 1.71k, False: 13.8k]
  |  Branch (2930:3): [True: 13.8k, False: 0]
  ------------------
 2931|  15.5k|  return result;
 2932|  15.5k|}
url.c:url_create_needle:
 2575|  15.5k|{
 2576|  15.5k|  struct connectdata *needle = NULL;
 2577|  15.5k|  CURLcode result = CURLE_OK;
 2578|  15.5k|  bool network_scheme = TRUE; /* almost all are */
  ------------------
  |  | 1055|  15.5k|#define TRUE true
  ------------------
 2579|       |
 2580|       |  /*************************************************************
 2581|       |   * Check input data
 2582|       |   *************************************************************/
 2583|  15.5k|  if(!Curl_bufref_ptr(&data->state.url)) {
  ------------------
  |  Branch (2583:6): [True: 0, False: 15.5k]
  ------------------
 2584|      0|    result = CURLE_URL_MALFORMAT;
 2585|      0|    goto out;
 2586|      0|  }
 2587|       |
 2588|       |  /* First, split up the current URL in parts so that we can use the
 2589|       |     parts for checking against the already present connections. In order
 2590|       |     to not have to modify everything at once, we allocate a temporary
 2591|       |     connection data struct and fill in for comparison purposes. */
 2592|  15.5k|  needle = allocate_conn(data);
 2593|  15.5k|  if(!needle) {
  ------------------
  |  Branch (2593:6): [True: 0, False: 15.5k]
  ------------------
 2594|      0|    result = CURLE_OUT_OF_MEMORY;
 2595|      0|    goto out;
 2596|      0|  }
 2597|       |
 2598|       |  /* Do the unfailable inits first, before checks that may early return */
 2599|  15.5k|  Curl_hash_init(&needle->meta_hash, 23,
 2600|  15.5k|                 Curl_hash_str, curlx_str_key_compare, conn_meta_freeentry);
 2601|       |
 2602|       |  /*************************************************************
 2603|       |   * Determine `conn->origin` and propulate `data->state.up` and
 2604|       |   * other URL related properties.
 2605|       |   *************************************************************/
 2606|  15.5k|  result = parseurlandfillconn(data, needle);
 2607|  15.5k|  if(result)
  ------------------
  |  Branch (2607:6): [True: 1.49k, False: 14.1k]
  ------------------
 2608|  1.49k|    goto out;
 2609|  14.1k|  DEBUGASSERT(needle->origin);
  ------------------
  |  | 1081|  14.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2609:3): [True: 0, False: 14.1k]
  |  Branch (2609:3): [True: 14.1k, False: 0]
  ------------------
 2610|  14.1k|  network_scheme = !(needle->origin->scheme->flags & PROTOPT_NONETWORK);
  ------------------
  |  |  215|  14.1k|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
 2611|       |
 2612|  14.1k|#ifdef USE_UNIX_SOCKETS
 2613|       |  /*************************************************************
 2614|       |   * Set UDS first. It overrides "via_peer" and proxy settings.
 2615|       |   *************************************************************/
 2616|  14.1k|  if(network_scheme && data->set.str[STRING_UNIX_SOCKET_PATH]) {
  ------------------
  |  Branch (2616:6): [True: 14.1k, False: 0]
  |  Branch (2616:24): [True: 113, False: 13.9k]
  ------------------
 2617|    113|    result = Curl_peer_uds_create(needle->origin->scheme,
 2618|    113|                                  data->set.str[STRING_UNIX_SOCKET_PATH],
 2619|    113|                                  (bool)data->set.abstract_unix_socket,
 2620|    113|                                  &needle->via_peer);
 2621|    113|    if(result)
  ------------------
  |  Branch (2621:8): [True: 2, False: 111]
  ------------------
 2622|      2|      goto out;
 2623|    113|  }
 2624|  14.1k|#endif /* USE_UNIX_SOCKETS */
 2625|       |
 2626|  14.1k|  if(network_scheme && !needle->via_peer) {
  ------------------
  |  Branch (2626:6): [True: 14.1k, False: 0]
  |  Branch (2626:24): [True: 13.9k, False: 111]
  ------------------
 2627|       |    /*************************************************************
 2628|       |     * If the `via_peer` is not already set (via UDS above),
 2629|       |     * determine if we talk to `conn->origin` directly or use
 2630|       |     * `conn->via_peer` using "connect to" and "alt-svc" properties.
 2631|       |     *************************************************************/
 2632|  13.9k|    result = url_set_conn_peer(data, needle);
 2633|  13.9k|    if(result)
  ------------------
  |  Branch (2633:8): [True: 0, False: 13.9k]
  ------------------
 2634|      0|      goto out;
 2635|  13.9k|  }
 2636|       |
 2637|  14.1k|#ifndef CURL_DISABLE_PROXY
 2638|       |  /* Going via a unix socket ignores any proxy settings */
 2639|  14.1k|  if(needle->via_peer && needle->via_peer->unix_socket) {
  ------------------
  |  Branch (2639:6): [True: 13.5k, False: 536]
  |  Branch (2639:26): [True: 111, False: 13.4k]
  ------------------
 2640|    111|    needle->bits.socksproxy = FALSE;
  ------------------
  |  | 1058|    111|#define FALSE false
  ------------------
 2641|    111|    needle->bits.httpproxy = FALSE;
  ------------------
  |  | 1058|    111|#define FALSE false
  ------------------
 2642|    111|    needle->bits.proxy = FALSE;
  ------------------
  |  | 1058|    111|#define FALSE false
  ------------------
 2643|    111|  }
 2644|  13.9k|  else if(network_scheme) {
  ------------------
  |  Branch (2644:11): [True: 13.9k, False: 0]
  ------------------
 2645|  13.9k|    result = url_set_conn_proxies(data, needle);
 2646|  13.9k|    if(result)
  ------------------
  |  Branch (2646:8): [True: 18, False: 13.9k]
  ------------------
 2647|     18|      goto out;
 2648|       |
 2649|       |    /*************************************************************
 2650|       |     * If the protocol is using SSL and HTTP proxy is used, we set
 2651|       |     * the tunnel_proxy bit.
 2652|       |     *************************************************************/
 2653|  13.9k|    if((needle->given->flags & PROTOPT_SSL) && needle->bits.httpproxy)
  ------------------
  |  |  207|  13.9k|#define PROTOPT_SSL (1 << 0)       /* uses SSL */
  ------------------
  |  Branch (2653:8): [True: 2.86k, False: 11.1k]
  |  Branch (2653:48): [True: 153, False: 2.71k]
  ------------------
 2654|    153|      needle->bits.tunnel_proxy = TRUE;
  ------------------
  |  | 1055|    153|#define TRUE true
  ------------------
 2655|  13.9k|  }
 2656|  14.0k|#endif /* CURL_DISABLE_PROXY */
 2657|       |
 2658|       |  /* Check for overridden login details and set them accordingly so that
 2659|       |     they are known when protocol->setup_connection is called! */
 2660|  14.0k|  result = override_login(data, needle);
 2661|  14.0k|  if(result)
  ------------------
  |  Branch (2661:6): [True: 0, False: 14.0k]
  ------------------
 2662|      0|    goto out;
 2663|       |
 2664|  14.0k|  result = url_set_conn_login(data, needle); /* default credentials */
 2665|  14.0k|  if(result)
  ------------------
  |  Branch (2665:6): [True: 0, False: 14.0k]
  ------------------
 2666|      0|    goto out;
 2667|       |
 2668|       |  /*************************************************************
 2669|       |   * Check whether the host and the "connect to host" are equal.
 2670|       |   * Do this after the hostnames have been IDN-converted.
 2671|       |   *************************************************************/
 2672|  14.0k|  if(Curl_peer_equal(needle->origin, needle->via_peer)) {
  ------------------
  |  Branch (2672:6): [True: 155, False: 13.9k]
  ------------------
 2673|    155|    Curl_peer_unlink(&needle->via_peer);
 2674|    155|  }
 2675|       |
 2676|  14.0k|#ifndef CURL_DISABLE_PROXY
 2677|       |  /*************************************************************
 2678|       |   * If the "connect to" feature is used with an HTTP proxy,
 2679|       |   * we set the tunnel_proxy bit.
 2680|       |   *************************************************************/
 2681|  14.0k|  if(needle->via_peer && needle->bits.httpproxy)
  ------------------
  |  Branch (2681:6): [True: 13.3k, False: 691]
  |  Branch (2681:26): [True: 8.59k, False: 4.79k]
  ------------------
 2682|  8.59k|    needle->bits.tunnel_proxy = TRUE;
  ------------------
  |  | 1055|  8.59k|#define TRUE true
  ------------------
 2683|  14.0k|#endif
 2684|       |
 2685|       |  /*************************************************************
 2686|       |   * Setup internals depending on protocol. Needs to be done after
 2687|       |   * we figured out what/if proxy to use.
 2688|       |   *************************************************************/
 2689|  14.0k|  result = setup_connection_internals(data, needle);
 2690|  14.0k|  if(result)
  ------------------
  |  Branch (2690:6): [True: 0, False: 14.0k]
  ------------------
 2691|      0|    goto out;
 2692|       |
 2693|  14.0k|  if(needle->scheme->flags & PROTOPT_ALPN) {
  ------------------
  |  |  223|  14.0k|#define PROTOPT_ALPN (1 << 8) /* set ALPN for this */
  ------------------
  |  Branch (2693:6): [True: 531, False: 13.5k]
  ------------------
 2694|       |    /* The protocol wants it, so set the bits if enabled in the easy handle
 2695|       |       (default) */
 2696|    531|    if(data->set.ssl_enable_alpn)
  ------------------
  |  Branch (2696:8): [True: 531, False: 0]
  ------------------
 2697|    531|      needle->bits.tls_enable_alpn = TRUE;
  ------------------
  |  | 1055|    531|#define TRUE true
  ------------------
 2698|    531|  }
 2699|       |
 2700|  14.0k|  if(network_scheme) {
  ------------------
  |  Branch (2700:6): [True: 14.0k, False: 0]
  ------------------
 2701|       |    /* Setup callbacks for network connections */
 2702|  14.0k|    needle->recv[FIRSTSOCKET] = Curl_cf_recv;
  ------------------
  |  |  303|  14.0k|#define FIRSTSOCKET     0
  ------------------
 2703|  14.0k|    needle->send[FIRSTSOCKET] = Curl_cf_send;
  ------------------
  |  |  303|  14.0k|#define FIRSTSOCKET     0
  ------------------
 2704|  14.0k|    needle->recv[SECONDARYSOCKET] = Curl_cf_recv;
  ------------------
  |  |  304|  14.0k|#define SECONDARYSOCKET 1
  ------------------
 2705|  14.0k|    needle->send[SECONDARYSOCKET] = Curl_cf_send;
  ------------------
  |  |  304|  14.0k|#define SECONDARYSOCKET 1
  ------------------
 2706|  14.0k|    needle->bits.tcp_fastopen = data->set.tcp_fastopen;
 2707|  14.0k|#ifdef USE_UNIX_SOCKETS
 2708|  14.0k|    if(Curl_conn_get_first_peer(needle, FIRSTSOCKET)->unix_socket)
  ------------------
  |  |  303|  14.0k|#define FIRSTSOCKET     0
  ------------------
  |  Branch (2708:8): [True: 112, False: 13.9k]
  ------------------
 2709|    112|      needle->transport_wanted = TRNSPRT_UNIX;
  ------------------
  |  |  310|    112|#define TRNSPRT_UNIX 6
  ------------------
 2710|  14.0k|#endif
 2711|  14.0k|  }
 2712|       |
 2713|  15.5k|out:
 2714|  15.5k|  if(!result) {
  ------------------
  |  Branch (2714:6): [True: 14.0k, False: 1.51k]
  ------------------
 2715|  14.0k|    DEBUGASSERT(needle);
  ------------------
  |  | 1081|  14.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2715:5): [True: 0, False: 14.0k]
  |  Branch (2715:5): [True: 14.0k, False: 0]
  ------------------
 2716|  14.0k|    DEBUGASSERT(needle->origin);
  ------------------
  |  | 1081|  14.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2716:5): [True: 0, False: 14.0k]
  |  Branch (2716:5): [True: 14.0k, False: 0]
  ------------------
 2717|  14.0k|    *pneedle = needle;
 2718|  14.0k|  }
 2719|  1.51k|  else {
 2720|  1.51k|    *pneedle = NULL;
 2721|  1.51k|    if(needle)
  ------------------
  |  Branch (2721:8): [True: 1.51k, False: 0]
  ------------------
 2722|  1.51k|      Curl_conn_free(data, needle);
 2723|  1.51k|  }
 2724|  15.5k|  return result;
 2725|  15.5k|}
url.c:allocate_conn:
 1272|  15.5k|{
 1273|  15.5k|  struct connectdata *conn = curlx_calloc(1, sizeof(struct connectdata));
  ------------------
  |  | 1480|  15.5k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1274|  15.5k|  if(!conn)
  ------------------
  |  Branch (1274:6): [True: 0, False: 15.5k]
  ------------------
 1275|      0|    return NULL;
 1276|       |
 1277|       |  /* and we setup a few fields in case we end up actually using this struct */
 1278|       |
 1279|  15.5k|  conn->sock[FIRSTSOCKET] = CURL_SOCKET_BAD;     /* no file descriptor */
  ------------------
  |  |  303|  15.5k|#define FIRSTSOCKET     0
  ------------------
                conn->sock[FIRSTSOCKET] = CURL_SOCKET_BAD;     /* no file descriptor */
  ------------------
  |  |  145|  15.5k|#define CURL_SOCKET_BAD (-1)
  ------------------
 1280|  15.5k|  conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; /* no file descriptor */
  ------------------
  |  |  304|  15.5k|#define SECONDARYSOCKET 1
  ------------------
                conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; /* no file descriptor */
  ------------------
  |  |  145|  15.5k|#define CURL_SOCKET_BAD (-1)
  ------------------
 1281|  15.5k|  conn->recv_idx = 0; /* default for receiving transfer data */
 1282|  15.5k|  conn->send_idx = 0; /* default for sending transfer data */
 1283|  15.5k|  conn->connection_id = -1;    /* no ID */
 1284|  15.5k|  conn->attached_xfers = 0;
 1285|       |
 1286|       |  /* Store creation time to help future close decision making */
 1287|  15.5k|  conn->created = *Curl_pgrs_now(data);
 1288|       |
 1289|       |  /* Store current time to give a baseline to keepalive connection times. */
 1290|  15.5k|  conn->keepalive = conn->created;
 1291|       |
 1292|  15.5k|#ifndef CURL_DISABLE_PROXY
 1293|  15.5k|  conn->http_proxy.proxytype = data->set.proxytype;
 1294|  15.5k|  conn->socks_proxy.proxytype = CURLPROXY_SOCKS4;
  ------------------
  |  |  798|  15.5k|#define CURLPROXY_SOCKS4          4L /* support added in 7.15.2, enum existed
  ------------------
 1295|       |
 1296|       |  /* note that these two proxy bits are set on what looks to be
 1297|       |     requested, they may be altered down the road */
 1298|  15.5k|  conn->bits.proxy = (data->set.str[STRING_PROXY] &&
  ------------------
  |  Branch (1298:23): [True: 8.90k, False: 6.68k]
  ------------------
 1299|  8.90k|                      *data->set.str[STRING_PROXY]);
  ------------------
  |  Branch (1299:23): [True: 8.90k, False: 4]
  ------------------
 1300|  15.5k|  conn->bits.httpproxy = (conn->bits.proxy &&
  ------------------
  |  Branch (1300:27): [True: 8.90k, False: 6.69k]
  ------------------
 1301|  8.90k|                          (conn->http_proxy.proxytype == CURLPROXY_HTTP ||
  ------------------
  |  |  790|  17.8k|#define CURLPROXY_HTTP            0L /* added in 7.10, new in 7.19.4 default is
  ------------------
  |  Branch (1301:28): [True: 8.38k, False: 521]
  ------------------
 1302|    521|                           conn->http_proxy.proxytype == CURLPROXY_HTTP_1_0 ||
  ------------------
  |  |  792|  9.42k|#define CURLPROXY_HTTP_1_0        1L /* force to use CONNECT HTTP/1.0
  ------------------
  |  Branch (1302:28): [True: 4, False: 517]
  ------------------
 1303|    517|                           IS_HTTPS_PROXY(conn->http_proxy.proxytype)));
  ------------------
  |  |   80|    517|  (((t) == CURLPROXY_HTTPS) ||  \
  |  |  ------------------
  |  |  |  |  794|    517|#define CURLPROXY_HTTPS           2L /* HTTPS but stick to HTTP/1
  |  |  ------------------
  |  |  |  Branch (80:4): [True: 42, False: 475]
  |  |  ------------------
  |  |   81|    517|   ((t) == CURLPROXY_HTTPS2) || \
  |  |  ------------------
  |  |  |  |  796|    475|#define CURLPROXY_HTTPS2          3L /* HTTPS and attempt HTTP/2
  |  |  ------------------
  |  |  |  Branch (81:4): [True: 420, False: 55]
  |  |  ------------------
  |  |   82|    517|   ((t) == CURLPROXY_HTTPS3))
  |  |  ------------------
  |  |  |  |  805|     55|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  |  |  ------------------
  |  |  |  Branch (82:4): [True: 0, False: 55]
  |  |  ------------------
  ------------------
 1304|  15.5k|  conn->bits.socksproxy = (conn->bits.proxy && !conn->bits.httpproxy);
  ------------------
  |  Branch (1304:28): [True: 8.90k, False: 6.69k]
  |  Branch (1304:48): [True: 55, False: 8.84k]
  ------------------
 1305|       |
 1306|  15.5k|  if(data->set.str[STRING_PRE_PROXY] && *data->set.str[STRING_PRE_PROXY]) {
  ------------------
  |  Branch (1306:6): [True: 437, False: 15.1k]
  |  Branch (1306:41): [True: 387, False: 50]
  ------------------
 1307|    387|    conn->bits.proxy = TRUE;
  ------------------
  |  | 1055|    387|#define TRUE true
  ------------------
 1308|    387|    conn->bits.socksproxy = TRUE;
  ------------------
  |  | 1055|    387|#define TRUE true
  ------------------
 1309|    387|  }
 1310|       |
 1311|  15.5k|  conn->bits.tunnel_proxy = data->set.tunnel_thru_httpproxy;
 1312|  15.5k|#endif /* CURL_DISABLE_PROXY */
 1313|       |
 1314|  15.5k|#ifndef CURL_DISABLE_FTP
 1315|  15.5k|  conn->bits.ftp_use_epsv = data->set.ftp_use_epsv;
 1316|  15.5k|  conn->bits.ftp_use_eprt = data->set.ftp_use_eprt;
 1317|  15.5k|#endif
 1318|  15.5k|  conn->ip_version = data->set.ipver;
 1319|  15.5k|  conn->bits.connect_only = (bool)data->set.connect_only;
 1320|  15.5k|  conn->transport_wanted = TRNSPRT_TCP; /* most of them are TCP streams */
  ------------------
  |  |  307|  15.5k|#define TRNSPRT_TCP  3
  ------------------
 1321|       |
 1322|       |  /* Store the local bind parameters that will be used for this connection */
 1323|  15.5k|  if(data->set.str[STRING_DEVICE]) {
  ------------------
  |  Branch (1323:6): [True: 67, False: 15.5k]
  ------------------
 1324|     67|    conn->localdev = curlx_strdup(data->set.str[STRING_DEVICE]);
  ------------------
  |  | 1477|     67|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1325|     67|    if(!conn->localdev)
  ------------------
  |  Branch (1325:8): [True: 0, False: 67]
  ------------------
 1326|      0|      goto error;
 1327|     67|  }
 1328|  15.5k|#ifndef CURL_DISABLE_BINDLOCAL
 1329|  15.5k|  conn->localportrange = data->set.localportrange;
 1330|  15.5k|  conn->localport = data->set.localport;
 1331|  15.5k|#endif
 1332|       |
 1333|       |  /* the close socket stuff needs to be copied to the connection struct as
 1334|       |     it may live on without (this specific) Curl_easy */
 1335|  15.5k|  conn->fclosesocket = data->set.fclosesocket;
 1336|  15.5k|  conn->closesocket_client = data->set.closesocket_client;
 1337|  15.5k|  conn->lastused = conn->created;
 1338|       |#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
 1339|       |  conn->gssapi_delegation = data->set.gssapi_delegation;
 1340|       |#endif
 1341|  15.5k|  DEBUGF(infof(data, "alloc connection, bits.close=%d", conn->bits.close));
  ------------------
  |  | 1067|   109k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 15.5k, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 15.5k]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
 1342|  15.5k|  return conn;
 1343|      0|error:
 1344|       |
 1345|      0|  curlx_free(conn->localdev);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1346|      0|  curlx_free(conn);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1347|       |  return NULL;
 1348|  15.5k|}
url.c:parseurlandfillconn:
 1492|  15.5k|{
 1493|  15.5k|  CURLcode result = CURLE_OK;
 1494|  15.5k|  CURLU *uh;
 1495|  15.5k|  CURLUcode uc;
 1496|  15.5k|  bool use_set_uh = (data->set.uh && !data->state.this_is_a_follow);
  ------------------
  |  Branch (1496:22): [True: 0, False: 15.5k]
  |  Branch (1496:38): [True: 0, False: 0]
  ------------------
 1497|  15.5k|  uint16_t port_override = data->state.allow_port ? data->set.use_port : 0;
  ------------------
  |  Branch (1497:28): [True: 15.5k, False: 3]
  ------------------
 1498|  15.5k|  uint32_t scope_id = 0;
 1499|       |
 1500|  15.5k|  up_free(data); /* cleanup previous leftovers first */
 1501|       |
 1502|       |  /* parse the URL */
 1503|  15.5k|  if(use_set_uh)
  ------------------
  |  Branch (1503:6): [True: 0, False: 15.5k]
  ------------------
 1504|      0|    uh = data->state.uh = curl_url_dup(data->set.uh);
 1505|  15.5k|  else
 1506|  15.5k|    uh = data->state.uh = curl_url();
 1507|  15.5k|  if(!uh) {
  ------------------
  |  Branch (1507:6): [True: 0, False: 15.5k]
  ------------------
 1508|      0|    result = CURLE_OUT_OF_MEMORY;
 1509|      0|    goto out;
 1510|      0|  }
 1511|       |
 1512|       |  /* Calculate the *real* URL this transfer uses, applying defaults
 1513|       |   * where information is missing. */
 1514|  15.5k|  if(data->set.str[STRING_DEFAULT_PROTOCOL] &&
  ------------------
  |  Branch (1514:6): [True: 809, False: 14.7k]
  ------------------
 1515|    809|     !Curl_is_absolute_url(Curl_bufref_ptr(&data->state.url), NULL, 0, TRUE)) {
  ------------------
  |  | 1055|    809|#define TRUE true
  ------------------
  |  Branch (1515:6): [True: 640, False: 169]
  ------------------
 1516|    640|    char *url = curl_maprintf("%s://%s",
 1517|    640|                              data->set.str[STRING_DEFAULT_PROTOCOL],
 1518|    640|                              Curl_bufref_ptr(&data->state.url));
 1519|    640|    if(!url) {
  ------------------
  |  Branch (1519:8): [True: 0, False: 640]
  ------------------
 1520|      0|      result = CURLE_OUT_OF_MEMORY;
 1521|      0|      goto out;
 1522|      0|    }
 1523|    640|    Curl_bufref_set(&data->state.url, url, 0, curl_free);
 1524|    640|  }
 1525|       |
 1526|  15.5k|  if(!use_set_uh) {
  ------------------
  |  Branch (1526:6): [True: 15.5k, False: 0]
  ------------------
 1527|  15.5k|    char *newurl;
 1528|  15.5k|    uc = curl_url_set(uh, CURLUPART_URL, Curl_bufref_ptr(&data->state.url),
 1529|  15.5k|                      (unsigned int)(CURLU_GUESS_SCHEME |
  ------------------
  |  |   96|  15.5k|#define CURLU_GUESS_SCHEME (1 << 9)       /* legacy curl-style guessing */
  ------------------
 1530|  15.5k|                       CURLU_NON_SUPPORT_SCHEME |
  ------------------
  |  |   90|  15.5k|#define CURLU_NON_SUPPORT_SCHEME (1 << 3) /* allow non-supported scheme */
  ------------------
 1531|  15.5k|                       (data->set.disallow_username_in_url ?
  ------------------
  |  Branch (1531:25): [True: 1, False: 15.5k]
  ------------------
 1532|  15.5k|                        CURLU_DISALLOW_USER : 0) |
  ------------------
  |  |   92|      1|#define CURLU_DISALLOW_USER (1 << 5)      /* no user+password allowed */
  ------------------
 1533|  15.5k|                       (data->set.path_as_is ? CURLU_PATH_AS_IS : 0)));
  ------------------
  |  |   91|      3|#define CURLU_PATH_AS_IS (1 << 4)         /* leave dot sequences */
  ------------------
  |  Branch (1533:25): [True: 3, False: 15.5k]
  ------------------
 1534|  15.5k|    if(uc) {
  ------------------
  |  Branch (1534:8): [True: 884, False: 14.7k]
  ------------------
 1535|    884|      failf(data, "URL rejected: %s", curl_url_strerror(uc));
  ------------------
  |  |   62|    884|#define failf Curl_failf
  ------------------
 1536|    884|      result = Curl_uc_to_curlcode(uc);
 1537|    884|      goto out;
 1538|    884|    }
 1539|       |
 1540|       |    /* after it was parsed, get the generated normalized version */
 1541|  14.7k|    uc = curl_url_get(uh, CURLUPART_URL, &newurl, CURLU_GET_EMPTY);
  ------------------
  |  |  102|  14.7k|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
 1542|  14.7k|    if(uc) {
  ------------------
  |  Branch (1542:8): [True: 0, False: 14.7k]
  ------------------
 1543|      0|      result = Curl_uc_to_curlcode(uc);
 1544|      0|      goto out;
 1545|      0|    }
 1546|  14.7k|    Curl_bufref_set(&data->state.url, newurl, 0, curl_free);
 1547|  14.7k|  }
 1548|       |
 1549|  14.7k|#ifdef USE_IPV6
 1550|  14.7k|  scope_id = data->set.scope_id;
 1551|  14.7k|#endif
 1552|       |
 1553|       |  /* `uh` is now as the connection should use it, probably. */
 1554|  14.7k|  result = Curl_peer_from_url(uh, data, port_override, scope_id,
 1555|  14.7k|                              &data->state.up, &conn->origin);
 1556|  14.7k|  if(result)
  ------------------
  |  Branch (1556:6): [True: 152, False: 14.5k]
  ------------------
 1557|    152|    goto out;
 1558|       |
 1559|  14.5k|  result = hsts_upgrade(data, conn, uh, port_override, scope_id);
 1560|  14.5k|  if(result)
  ------------------
  |  Branch (1560:6): [True: 0, False: 14.5k]
  ------------------
 1561|      0|    goto out;
 1562|       |
 1563|       |  /* now that the origin is fixed, check and set the connection scheme */
 1564|  14.5k|  result = url_set_conn_scheme(data, conn, conn->origin->scheme);
 1565|  14.5k|  if(result)
  ------------------
  |  Branch (1565:6): [True: 449, False: 14.1k]
  ------------------
 1566|    449|    goto out;
 1567|       |
 1568|       |  /* When the transfers initial_origin is not set, this is the initial
 1569|       |   * request. Remember this starting point. This is used to
 1570|       |   * select credentials. */
 1571|  14.1k|  if(!data->state.initial_origin)
  ------------------
  |  Branch (1571:6): [True: 13.2k, False: 904]
  ------------------
 1572|  13.2k|    Curl_peer_link(&data->state.initial_origin, conn->origin);
 1573|       |
 1574|  14.1k|  result = url_set_data_creds(data, conn, uh);
 1575|  14.1k|  if(result)
  ------------------
  |  Branch (1575:6): [True: 5, False: 14.1k]
  ------------------
 1576|      5|    goto out;
 1577|       |
 1578|  14.1k|  uc = curl_url_get(uh, CURLUPART_OPTIONS, &data->state.up.options,
 1579|  14.1k|                    CURLU_URLDECODE);
  ------------------
  |  |   93|  14.1k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  ------------------
 1580|  14.1k|  if(!uc) {
  ------------------
  |  Branch (1580:6): [True: 0, False: 14.1k]
  ------------------
 1581|      0|    conn->options = curlx_strdup(data->state.up.options);
  ------------------
  |  | 1477|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1582|      0|    if(!conn->options) {
  ------------------
  |  Branch (1582:8): [True: 0, False: 0]
  ------------------
 1583|      0|      result = CURLE_OUT_OF_MEMORY;
 1584|      0|      goto out;
 1585|      0|    }
 1586|      0|  }
 1587|  14.1k|  else if(uc != CURLUE_NO_OPTIONS) {
  ------------------
  |  Branch (1587:11): [True: 0, False: 14.1k]
  ------------------
 1588|      0|    result = Curl_uc_to_curlcode(uc);
 1589|      0|    goto out;
 1590|      0|  }
 1591|       |
 1592|  14.1k|  uc = curl_url_get(uh, CURLUPART_PATH, &data->state.up.path, CURLU_URLENCODE);
  ------------------
  |  |   94|  14.1k|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
 1593|  14.1k|  if(uc) {
  ------------------
  |  Branch (1593:6): [True: 0, False: 14.1k]
  ------------------
 1594|      0|    result = Curl_uc_to_curlcode(uc);
 1595|      0|    goto out;
 1596|      0|  }
 1597|       |
 1598|  14.1k|  uc = curl_url_get(uh, CURLUPART_QUERY, &data->state.up.query,
 1599|  14.1k|                    CURLU_GET_EMPTY);
  ------------------
  |  |  102|  14.1k|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
 1600|  14.1k|  if(uc && (uc != CURLUE_NO_QUERY)) {
  ------------------
  |  Branch (1600:6): [True: 11.8k, False: 2.27k]
  |  Branch (1600:12): [True: 0, False: 11.8k]
  ------------------
 1601|      0|    result = CURLE_OUT_OF_MEMORY;
 1602|      0|    goto out;
 1603|      0|  }
 1604|       |
 1605|  14.1k|#ifdef USE_IPV6
 1606|       |  /* Fill in the conn parts that do not use authority, yet. */
 1607|  14.1k|  conn->scope_id = conn->origin->scopeid;
 1608|  14.1k|#endif
 1609|       |
 1610|  14.1k|#ifdef CURLVERBOSE
 1611|  14.1k|  Curl_creds_trace(data, data->state.creds, "transfer credentials");
 1612|  14.1k|#endif
 1613|       |
 1614|  15.5k|out:
 1615|  15.5k|  return result;
 1616|  14.1k|}
url.c:hsts_upgrade:
 1392|  14.5k|{
 1393|       |  /* HSTS upgrade */
 1394|  14.5k|  if(data->hsts && (conn->origin->scheme == &Curl_scheme_http) &&
  ------------------
  |  Branch (1394:6): [True: 14.0k, False: 552]
  |  Branch (1394:20): [True: 418, False: 13.5k]
  ------------------
 1395|    418|     Curl_hsts_applies(data->hsts, conn->origin)) {
  ------------------
  |  Branch (1395:6): [True: 0, False: 418]
  ------------------
 1396|      0|    char *url;
 1397|      0|    CURLUcode uc;
 1398|      0|    CURLcode result;
 1399|       |
 1400|      0|    curlx_safefree(data->state.up.scheme);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1401|      0|    uc = curl_url_set(uh, CURLUPART_SCHEME, "https", 0);
 1402|      0|    if(uc)
  ------------------
  |  Branch (1402:8): [True: 0, False: 0]
  ------------------
 1403|      0|      return Curl_uc_to_curlcode(uc);
 1404|      0|    Curl_bufref_free(&data->state.url);
 1405|       |    /* after update, get the updated version */
 1406|      0|    uc = curl_url_get(uh, CURLUPART_URL, &url, 0);
 1407|      0|    if(uc)
  ------------------
  |  Branch (1407:8): [True: 0, False: 0]
  ------------------
 1408|      0|      return Curl_uc_to_curlcode(uc);
 1409|      0|    Curl_bufref_set(&data->state.url, url, 0, curl_free);
 1410|       |
 1411|      0|    result = Curl_peer_from_url(uh, data, port_override, scope_id,
 1412|      0|                                &data->state.up, &conn->origin);
 1413|      0|    if(result)
  ------------------
  |  Branch (1413:8): [True: 0, False: 0]
  ------------------
 1414|      0|      return result;
 1415|      0|    infof(data, "Switched from HTTP to HTTPS due to HSTS => %s", url);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1416|      0|  }
 1417|  14.5k|  return CURLE_OK;
 1418|  14.5k|}
url.c:url_set_conn_scheme:
 1353|  14.5k|{
 1354|       |  /* URL scheme is usable for connection when it is
 1355|       |   * - allowed
 1356|       |   * - not from a redirect or an allowed redirect protocol */
 1357|  14.5k|  if(scheme->run &&
  ------------------
  |  Branch (1357:6): [True: 14.5k, False: 1]
  ------------------
 1358|  14.5k|     (data->set.allowed_protocols & scheme->protocol) &&
  ------------------
  |  Branch (1358:6): [True: 14.1k, False: 448]
  ------------------
 1359|  14.1k|     (!data->state.this_is_a_follow ||
  ------------------
  |  Branch (1359:7): [True: 13.6k, False: 475]
  ------------------
 1360|  14.1k|       (data->set.redir_protocols & scheme->protocol))) {
  ------------------
  |  Branch (1360:8): [True: 475, False: 0]
  ------------------
 1361|  14.1k|    conn->scheme = conn->given = scheme;
 1362|  14.1k|    return CURLE_OK;
 1363|  14.1k|  }
 1364|    449|  if(scheme->flags & PROTOPT_NO_TRANSFER)
  ------------------
  |  |  239|    449|#define PROTOPT_NO_TRANSFER (1 << 17) /* this protocol is not for transfers */
  ------------------
  |  Branch (1364:6): [True: 0, False: 449]
  ------------------
 1365|      0|    failf(data, "Protocol \"%s\" is not for transfers", scheme->name);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1366|    449|  else
 1367|    449|    failf(data, "Protocol \"%s\" is disabled%s", scheme->name,
  ------------------
  |  |   62|    449|#define failf Curl_failf
  ------------------
 1368|    449|          data->state.this_is_a_follow ? " (in redirect)" : "");
  ------------------
  |  Branch (1368:11): [True: 0, False: 449]
  ------------------
 1369|    449|  return CURLE_UNSUPPORTED_PROTOCOL;
 1370|  14.5k|}
url.c:url_set_data_creds:
 1426|  14.1k|{
 1427|  14.1k|  CURLcode result = CURLE_OK;
 1428|       |
 1429|       |  /* We reset any existing credentials on the transfer. Then
 1430|       |   * set the CURLOPT_* credentials ONLY IF the origin is the initial one. */
 1431|  14.1k|  Curl_creds_unlink(&data->state.creds);
 1432|  14.1k|  if((data->set.str[STRING_USERNAME] ||
  ------------------
  |  Branch (1432:7): [True: 175, False: 13.9k]
  ------------------
 1433|  13.9k|      data->set.str[STRING_PASSWORD] ||
  ------------------
  |  Branch (1433:7): [True: 140, False: 13.7k]
  ------------------
 1434|  13.7k|      data->set.str[STRING_BEARER] ||
  ------------------
  |  Branch (1434:7): [True: 291, False: 13.5k]
  ------------------
 1435|  13.5k|      data->set.str[STRING_SASL_AUTHZID] ||
  ------------------
  |  Branch (1435:7): [True: 40, False: 13.4k]
  ------------------
 1436|  13.4k|      data->set.str[STRING_SERVICE_NAME]) &&
  ------------------
  |  Branch (1436:7): [True: 28, False: 13.4k]
  ------------------
 1437|    674|     Curl_auth_allowed_to_origin(data, conn->origin)) {
  ------------------
  |  Branch (1437:6): [True: 673, False: 1]
  ------------------
 1438|    673|    result = Curl_creds_create(data->set.str[STRING_USERNAME],
 1439|    673|                               data->set.str[STRING_PASSWORD],
 1440|    673|                               data->set.str[STRING_BEARER],
 1441|    673|                               data->set.str[STRING_SASL_AUTHZID],
 1442|    673|                               data->set.str[STRING_SERVICE_NAME],
 1443|    673|                               CREDS_OPTION, &data->state.creds);
  ------------------
  |  |   31|    673|#define CREDS_OPTION 2 /* username/passwd set with a CURLOPT_ */
  ------------------
 1444|    673|    if(result)
  ------------------
  |  Branch (1444:8): [True: 0, False: 673]
  ------------------
 1445|      0|      return result;
 1446|    673|  }
 1447|       |
 1448|       |  /* Extract credentials from the URL only if there are none OR
 1449|       |   * if no CURLOPT_USER was set. */
 1450|  14.1k|  if(!data->state.creds || !Curl_creds_has_user(data->state.creds)) {
  ------------------
  |  |   71|    362|#define Curl_creds_has_user(c)           ((c) && (c)->user[0])
  |  |  ------------------
  |  |  |  Branch (71:43): [True: 362, False: 0]
  |  |  |  Branch (71:50): [True: 128, False: 234]
  |  |  ------------------
  ------------------
  |  Branch (1450:6): [True: 13.7k, False: 362]
  ------------------
 1451|  13.9k|    char *udecoded = NULL;
 1452|  13.9k|    char *pdecoded = NULL;
 1453|  13.9k|    CURLUcode uc;
 1454|       |
 1455|  13.9k|    uc = curl_url_get(uh, CURLUPART_USER, &data->state.up.user, 0);
 1456|  13.9k|    if(uc && (uc != CURLUE_NO_USER)) {
  ------------------
  |  Branch (1456:8): [True: 9.47k, False: 4.51k]
  |  Branch (1456:14): [True: 0, False: 9.47k]
  ------------------
 1457|      0|      result = Curl_uc_to_curlcode(uc);
 1458|      0|      goto out;
 1459|      0|    }
 1460|  13.9k|    uc = curl_url_get(uh, CURLUPART_PASSWORD, &data->state.up.password, 0);
 1461|  13.9k|    if(uc && (uc != CURLUE_NO_PASSWORD)) {
  ------------------
  |  Branch (1461:8): [True: 12.3k, False: 1.59k]
  |  Branch (1461:14): [True: 0, False: 12.3k]
  ------------------
 1462|      0|      result = Curl_uc_to_curlcode(uc);
 1463|      0|      goto out;
 1464|      0|    }
 1465|  13.9k|    if(data->state.up.user) {
  ------------------
  |  Branch (1465:8): [True: 4.51k, False: 9.47k]
  ------------------
 1466|  4.51k|      result = Curl_urldecode(data->state.up.user, 0, &udecoded, NULL,
 1467|  4.51k|                              conn->scheme->flags&PROTOPT_USERPWDCTRL ?
  ------------------
  |  |  232|  4.51k|#define PROTOPT_USERPWDCTRL (1 << 13) /* Allow "control bytes" (< 32 ASCII) in
  ------------------
  |  Branch (1467:31): [True: 75, False: 4.43k]
  ------------------
 1468|  4.43k|                              REJECT_ZERO : REJECT_CTRL);
 1469|  4.51k|    }
 1470|  13.9k|    if(!result && data->state.up.password) {
  ------------------
  |  Branch (1470:8): [True: 13.9k, False: 3]
  |  Branch (1470:19): [True: 1.59k, False: 12.3k]
  ------------------
 1471|  1.59k|      result = Curl_urldecode(data->state.up.password, 0, &pdecoded, NULL,
 1472|  1.59k|                              conn->scheme->flags&PROTOPT_USERPWDCTRL ?
  ------------------
  |  |  232|  1.59k|#define PROTOPT_USERPWDCTRL (1 << 13) /* Allow "control bytes" (< 32 ASCII) in
  ------------------
  |  Branch (1472:31): [True: 29, False: 1.56k]
  ------------------
 1473|  1.56k|                              REJECT_ZERO : REJECT_CTRL);
 1474|  1.59k|    }
 1475|  13.9k|    if(!result)
  ------------------
  |  Branch (1475:8): [True: 13.9k, False: 5]
  ------------------
 1476|  13.9k|      result = Curl_creds_merge(udecoded, pdecoded, data->state.creds,
 1477|  13.9k|                                CREDS_URL, &data->state.creds);
  ------------------
  |  |   30|  13.9k|#define CREDS_URL    1 /* username/passwd from URL */
  ------------------
 1478|  13.9k|out:
 1479|  13.9k|    curlx_free(udecoded);
  ------------------
  |  | 1483|  13.9k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1480|  13.9k|    curlx_free(pdecoded);
  ------------------
  |  | 1483|  13.9k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1481|  13.9k|    if(result)
  ------------------
  |  Branch (1481:8): [True: 5, False: 13.9k]
  ------------------
 1482|      5|      failf(data, "error extracting credentials from URL");
  ------------------
  |  |   62|      5|#define failf Curl_failf
  ------------------
 1483|  13.9k|  }
 1484|  14.1k|  return result;
 1485|  14.1k|}
url.c:url_set_conn_peer:
 2387|  13.9k|{
 2388|  13.9k|  CURLcode result = CURLE_OK;
 2389|  13.9k|  const struct Curl_peer *origin = conn->origin;
 2390|  13.9k|  struct Curl_peer *via_peer = NULL;
 2391|  13.9k|  struct curl_slist *conn_to_entry = data->set.connect_to;
 2392|       |
 2393|  13.9k|  DEBUGASSERT(!conn->via_peer);
  ------------------
  |  | 1081|  13.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2393:3): [True: 0, False: 13.9k]
  |  Branch (2393:3): [True: 13.9k, False: 0]
  ------------------
 2394|  13.9k|  Curl_peer_unlink(&conn->via_peer);
 2395|       |
 2396|  27.4k|  while(conn_to_entry && !via_peer) {
  ------------------
  |  Branch (2396:9): [True: 13.4k, False: 13.9k]
  |  Branch (2396:26): [True: 13.4k, False: 0]
  ------------------
 2397|  13.4k|    result = parse_connect_to_string(data, origin, conn_to_entry->data,
 2398|  13.4k|                                     &via_peer);
 2399|  13.4k|    if(result)
  ------------------
  |  Branch (2399:8): [True: 0, False: 13.4k]
  ------------------
 2400|      0|      return result;
 2401|  13.4k|    conn_to_entry = conn_to_entry->next;
 2402|  13.4k|  }
 2403|       |
 2404|  13.9k|#ifndef CURL_DISABLE_ALTSVC
 2405|  13.9k|  if(data->asi && !via_peer &&
  ------------------
  |  Branch (2405:6): [True: 13.4k, False: 536]
  |  Branch (2405:19): [True: 0, False: 13.4k]
  ------------------
 2406|      0|     ((conn->scheme->protocol == CURLPROTO_HTTPS) ||
  ------------------
  |  | 1079|      0|#define CURLPROTO_HTTPS   (1L << 1)
  ------------------
  |  Branch (2406:7): [True: 0, False: 0]
  ------------------
 2407|      0|#ifdef DEBUGBUILD
 2408|       |      /* allow debug builds to circumvent the HTTPS restriction */
 2409|      0|      getenv("CURL_ALTSVC_HTTP")
  ------------------
  |  Branch (2409:7): [True: 0, False: 0]
  ------------------
 2410|       |#else
 2411|       |      0
 2412|       |#endif
 2413|      0|       )) {
 2414|       |    /* no connect_to match, try alt-svc! */
 2415|      0|    enum alpnid srcalpnid = ALPN_none;
 2416|      0|    bool hit = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2417|      0|    struct altsvc *as = NULL;
 2418|      0|    int allowed_alpns = ALPN_none;
 2419|      0|    struct http_negotiation *neg = &data->state.http_neg;
 2420|      0|    bool same_dest = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2421|       |
 2422|      0|    DEBUGF(infof(data, "Alt-svc check wanted=%x, allowed=%x",
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2423|      0|                 neg->wanted, neg->allowed));
 2424|       |#ifdef USE_HTTP3
 2425|       |    if(neg->allowed & CURL_HTTP_V3x)
 2426|       |      allowed_alpns |= ALPN_h3;
 2427|       |#endif
 2428|      0|#ifdef USE_HTTP2
 2429|      0|    if(neg->allowed & CURL_HTTP_V2x)
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  |  Branch (2429:8): [True: 0, False: 0]
  ------------------
 2430|      0|      allowed_alpns |= ALPN_h2;
 2431|      0|#endif
 2432|      0|    if(neg->allowed & CURL_HTTP_V1x)
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
  |  Branch (2432:8): [True: 0, False: 0]
  ------------------
 2433|      0|      allowed_alpns |= ALPN_h1;
 2434|      0|    allowed_alpns &= (int)data->asi->flags;
 2435|       |
 2436|      0|    DEBUGF(infof(data, "check Alt-Svc for host '%s'", origin->hostname));
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2437|       |#ifdef USE_HTTP3
 2438|       |    if(!hit && (neg->wanted & CURL_HTTP_V3x)) {
 2439|       |      srcalpnid = ALPN_h3;
 2440|       |      hit = Curl_altsvc_lookup(data->asi,
 2441|       |                               ALPN_h3, origin->hostname,
 2442|       |                               origin->port, /* from */
 2443|       |                               &as /* to */,
 2444|       |                               allowed_alpns, &same_dest);
 2445|       |    }
 2446|       |#endif
 2447|      0|#ifdef USE_HTTP2
 2448|      0|    if(!hit && (neg->wanted & CURL_HTTP_V2x) &&
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  |  Branch (2448:8): [True: 0, False: 0]
  |  Branch (2448:16): [True: 0, False: 0]
  ------------------
 2449|      0|       !neg->h2_prior_knowledge) {
  ------------------
  |  Branch (2449:8): [True: 0, False: 0]
  ------------------
 2450|      0|      srcalpnid = ALPN_h2;
 2451|      0|      hit = Curl_altsvc_lookup(data->asi,
 2452|      0|                               ALPN_h2, origin->hostname,
 2453|      0|                               origin->port, /* from */
 2454|      0|                               &as /* to */,
 2455|      0|                               allowed_alpns, &same_dest);
 2456|      0|    }
 2457|      0|#endif
 2458|      0|    if(!hit && (neg->wanted & CURL_HTTP_V1x) &&
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
  |  Branch (2458:8): [True: 0, False: 0]
  |  Branch (2458:16): [True: 0, False: 0]
  ------------------
 2459|      0|       !neg->only_10) {
  ------------------
  |  Branch (2459:8): [True: 0, False: 0]
  ------------------
 2460|      0|      srcalpnid = ALPN_h1;
 2461|      0|      hit = Curl_altsvc_lookup(data->asi,
 2462|      0|                               ALPN_h1, origin->hostname,
 2463|      0|                               origin->port, /* from */
 2464|      0|                               &as /* to */,
 2465|      0|                               allowed_alpns, &same_dest);
 2466|      0|    }
 2467|       |
 2468|      0|    if(hit && same_dest) {
  ------------------
  |  Branch (2468:8): [True: 0, False: 0]
  |  Branch (2468:15): [True: 0, False: 0]
  ------------------
 2469|       |      /* same destination, but more HTTPS version options */
 2470|      0|      switch(as->dst.alpnid) {
 2471|      0|      case ALPN_h1:
  ------------------
  |  Branch (2471:7): [True: 0, False: 0]
  ------------------
 2472|      0|        neg->wanted |= CURL_HTTP_V1x;
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
 2473|      0|        neg->preferred = CURL_HTTP_V1x;
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
 2474|      0|        break;
 2475|      0|      case ALPN_h2:
  ------------------
  |  Branch (2475:7): [True: 0, False: 0]
  ------------------
 2476|      0|        neg->wanted |= CURL_HTTP_V2x;
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
 2477|      0|        neg->preferred = CURL_HTTP_V2x;
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
 2478|      0|        break;
 2479|      0|      case ALPN_h3:
  ------------------
  |  Branch (2479:7): [True: 0, False: 0]
  ------------------
 2480|      0|        neg->wanted |= CURL_HTTP_V3x;
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
 2481|      0|        neg->preferred = CURL_HTTP_V3x;
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
 2482|      0|        break;
 2483|      0|      default: /* should not be possible */
  ------------------
  |  Branch (2483:7): [True: 0, False: 0]
  ------------------
 2484|      0|        break;
 2485|      0|      }
 2486|      0|    }
 2487|      0|    else if(hit) {
  ------------------
  |  Branch (2487:13): [True: 0, False: 0]
  ------------------
 2488|      0|      result = Curl_peer_create(data, conn->origin->scheme,
 2489|      0|                                as->dst.host, as->dst.port,
 2490|      0|                                &via_peer);
 2491|      0|      if(result)
  ------------------
  |  Branch (2491:10): [True: 0, False: 0]
  ------------------
 2492|      0|        return result;
 2493|      0|      infof(data, "Alt-svc connecting from [%s]%s:%u to [%s]%s:%u",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2494|      0|            Curl_alpnid2str(srcalpnid), origin->hostname, origin->port,
 2495|      0|            Curl_alpnid2str(as->dst.alpnid),
 2496|      0|            via_peer->hostname, via_peer->port);
 2497|      0|      conn->bits.altused = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2498|      0|      if(srcalpnid != as->dst.alpnid) {
  ------------------
  |  Branch (2498:10): [True: 0, False: 0]
  ------------------
 2499|       |        /* protocol version switch */
 2500|      0|        switch(as->dst.alpnid) {
 2501|      0|        case ALPN_h1:
  ------------------
  |  Branch (2501:9): [True: 0, False: 0]
  ------------------
 2502|      0|          neg->wanted = neg->allowed = CURL_HTTP_V1x;
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
 2503|      0|          neg->only_10 = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2504|      0|          break;
 2505|      0|        case ALPN_h2:
  ------------------
  |  Branch (2505:9): [True: 0, False: 0]
  ------------------
 2506|      0|          neg->wanted = neg->allowed = CURL_HTTP_V2x;
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
 2507|      0|          break;
 2508|      0|        case ALPN_h3:
  ------------------
  |  Branch (2508:9): [True: 0, False: 0]
  ------------------
 2509|      0|          conn->transport_wanted = TRNSPRT_QUIC;
  ------------------
  |  |  309|      0|#define TRNSPRT_QUIC 5
  ------------------
 2510|      0|          neg->wanted = neg->allowed = CURL_HTTP_V3x;
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
 2511|      0|          break;
 2512|      0|        default: /* should not be possible */
  ------------------
  |  Branch (2512:9): [True: 0, False: 0]
  ------------------
 2513|      0|          break;
 2514|      0|        }
 2515|      0|      }
 2516|      0|    }
 2517|      0|  }
 2518|  13.9k|#endif
 2519|       |
 2520|  13.9k|  if(via_peer)
  ------------------
  |  Branch (2520:6): [True: 13.4k, False: 536]
  ------------------
 2521|  13.4k|    conn->via_peer = via_peer;
 2522|       |
 2523|  13.9k|  return result;
 2524|  13.9k|}
url.c:parse_connect_to_string:
 2329|  13.4k|{
 2330|  13.4k|  CURLcode result = CURLE_OK;
 2331|  13.4k|  const char *ptr = conn_to_line;
 2332|  13.4k|  bool host_match = FALSE;
  ------------------
  |  | 1058|  13.4k|#define FALSE false
  ------------------
 2333|  13.4k|  bool port_match = FALSE;
  ------------------
  |  | 1058|  13.4k|#define FALSE false
  ------------------
 2334|       |
 2335|  13.4k|  *pvia_dest = NULL;
 2336|       |
 2337|  13.4k|  if(*ptr == ':') {
  ------------------
  |  Branch (2337:6): [True: 13.4k, False: 0]
  ------------------
 2338|       |    /* an empty hostname always matches */
 2339|  13.4k|    host_match = TRUE;
  ------------------
  |  | 1055|  13.4k|#define TRUE true
  ------------------
 2340|  13.4k|    ptr++;
 2341|  13.4k|  }
 2342|      0|  else {
 2343|       |    /* check whether the URL's hostname matches. Use the URL hostname
 2344|       |     * when it was an IPv6 address. Otherwise use the connection's hostname
 2345|       |     * that has IDN conversion. */
 2346|      0|    const char *hostname_to_match = (dest->user_hostname[0] == '[') ?
  ------------------
  |  Branch (2346:37): [True: 0, False: 0]
  ------------------
 2347|      0|      dest->user_hostname : dest->hostname;
 2348|      0|    size_t hlen = strlen(hostname_to_match);
 2349|      0|    host_match = curl_strnequal(ptr, hostname_to_match, hlen);
 2350|      0|    ptr += hlen;
 2351|       |
 2352|      0|    host_match = host_match && *ptr == ':';
  ------------------
  |  Branch (2352:18): [True: 0, False: 0]
  |  Branch (2352:32): [True: 0, False: 0]
  ------------------
 2353|      0|    ptr++;
 2354|      0|  }
 2355|       |
 2356|  13.4k|  if(host_match) {
  ------------------
  |  Branch (2356:6): [True: 13.4k, False: 0]
  ------------------
 2357|  13.4k|    if(*ptr == ':') {
  ------------------
  |  Branch (2357:8): [True: 13.4k, False: 0]
  ------------------
 2358|       |      /* an empty port always matches */
 2359|  13.4k|      port_match = TRUE;
  ------------------
  |  | 1055|  13.4k|#define TRUE true
  ------------------
 2360|  13.4k|      ptr++;
 2361|  13.4k|    }
 2362|      0|    else {
 2363|       |      /* check whether the URL's port matches */
 2364|      0|      const char *ptr_next = strchr(ptr, ':');
 2365|      0|      if(ptr_next) {
  ------------------
  |  Branch (2365:10): [True: 0, False: 0]
  ------------------
 2366|      0|        curl_off_t port_to_match;
 2367|      0|        if(!curlx_str_number(&ptr, &port_to_match, 0xffff) &&
  ------------------
  |  Branch (2367:12): [True: 0, False: 0]
  ------------------
 2368|      0|           ((uint16_t)port_to_match == dest->port)) {
  ------------------
  |  Branch (2368:12): [True: 0, False: 0]
  ------------------
 2369|      0|          port_match = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2370|      0|        }
 2371|      0|        ptr = ptr_next + 1;
 2372|      0|      }
 2373|      0|    }
 2374|  13.4k|  }
 2375|       |
 2376|  13.4k|  if(host_match && port_match && ptr && *ptr)
  ------------------
  |  Branch (2376:6): [True: 13.4k, False: 0]
  |  Branch (2376:20): [True: 13.4k, False: 0]
  |  Branch (2376:34): [True: 13.4k, False: 0]
  |  Branch (2376:41): [True: 13.4k, False: 0]
  ------------------
 2377|  13.4k|    result = Curl_peer_from_connect_to(data, dest, ptr, pvia_dest);
 2378|       |
 2379|  13.4k|  return result;
 2380|  13.4k|}
url.c:url_set_conn_proxies:
 1913|  13.9k|{
 1914|  13.9k|  char *proxy = NULL;
 1915|  13.9k|  char *pre_proxy = NULL;
 1916|  13.9k|  char *no_proxy = NULL;
 1917|  13.9k|  CURLcode result = CURLE_OK;
 1918|       |
 1919|       |  /*************************************************************
 1920|       |   * Detect what (if any) proxy to use
 1921|       |   *************************************************************/
 1922|  13.9k|  if(data->set.str[STRING_PROXY]) {
  ------------------
  |  Branch (1922:6): [True: 8.80k, False: 5.18k]
  ------------------
 1923|  8.80k|    proxy = curlx_strdup(data->set.str[STRING_PROXY]);
  ------------------
  |  | 1477|  8.80k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1924|       |    /* if global proxy is set, this is it */
 1925|  8.80k|    if(!proxy) {
  ------------------
  |  Branch (1925:8): [True: 0, False: 8.80k]
  ------------------
 1926|      0|      failf(data, "memory shortage");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1927|      0|      result = CURLE_OUT_OF_MEMORY;
 1928|      0|      goto out;
 1929|      0|    }
 1930|  8.80k|  }
 1931|       |
 1932|  13.9k|  if(data->set.str[STRING_PRE_PROXY]) {
  ------------------
  |  Branch (1932:6): [True: 435, False: 13.5k]
  ------------------
 1933|    435|    pre_proxy = curlx_strdup(data->set.str[STRING_PRE_PROXY]);
  ------------------
  |  | 1477|    435|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1934|       |    /* if global socks proxy is set, this is it */
 1935|    435|    if(!pre_proxy) {
  ------------------
  |  Branch (1935:8): [True: 0, False: 435]
  ------------------
 1936|      0|      failf(data, "memory shortage");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1937|      0|      result = CURLE_OUT_OF_MEMORY;
 1938|      0|      goto out;
 1939|      0|    }
 1940|    435|  }
 1941|       |
 1942|  13.9k|  if(!data->set.str[STRING_NOPROXY]) {
  ------------------
  |  Branch (1942:6): [True: 13.6k, False: 326]
  ------------------
 1943|  13.6k|    const char *p = "no_proxy";
 1944|  13.6k|    no_proxy = curl_getenv(p);
 1945|  13.6k|    if(!no_proxy) {
  ------------------
  |  Branch (1945:8): [True: 13.6k, False: 0]
  ------------------
 1946|  13.6k|      p = "NO_PROXY";
 1947|  13.6k|      no_proxy = curl_getenv(p);
 1948|  13.6k|    }
 1949|  13.6k|    if(no_proxy) {
  ------------------
  |  Branch (1949:8): [True: 0, False: 13.6k]
  ------------------
 1950|      0|      infof(data, "Uses proxy env variable %s == '%s'", p, no_proxy);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1951|      0|    }
 1952|  13.6k|  }
 1953|       |
 1954|  13.9k|  if(Curl_check_noproxy(conn->origin->hostname, data->set.str[STRING_NOPROXY] ?
  ------------------
  |  Branch (1954:6): [True: 11, False: 13.9k]
  |  Branch (1954:49): [True: 326, False: 13.6k]
  ------------------
 1955|  13.6k|                        data->set.str[STRING_NOPROXY] : no_proxy)) {
 1956|     11|    curlx_safefree(proxy);
  ------------------
  |  | 1327|     11|  do {                      \
  |  | 1328|     11|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|     11|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|     11|    (ptr) = NULL;           \
  |  | 1330|     11|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 11]
  |  |  ------------------
  ------------------
 1957|     11|    curlx_safefree(pre_proxy);
  ------------------
  |  | 1327|     11|  do {                      \
  |  | 1328|     11|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|     11|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|     11|    (ptr) = NULL;           \
  |  | 1330|     11|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 11]
  |  |  ------------------
  ------------------
 1958|     11|  }
 1959|  13.9k|#ifndef CURL_DISABLE_HTTP
 1960|  13.9k|  else if(!proxy && !pre_proxy)
  ------------------
  |  Branch (1960:11): [True: 5.17k, False: 8.80k]
  |  Branch (1960:21): [True: 4.81k, False: 362]
  ------------------
 1961|       |    /* if the host is not in the noproxy list, detect proxy. */
 1962|  4.81k|    proxy = url_detect_proxy(data, conn);
 1963|  13.9k|#endif /* CURL_DISABLE_HTTP */
 1964|  13.9k|  curlx_safefree(no_proxy);
  ------------------
  |  | 1327|  13.9k|  do {                      \
  |  | 1328|  13.9k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  13.9k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  13.9k|    (ptr) = NULL;           \
  |  | 1330|  13.9k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 13.9k]
  |  |  ------------------
  ------------------
 1965|       |
 1966|  13.9k|  if(proxy && (!*proxy || (conn->scheme->flags & PROTOPT_NONETWORK))) {
  ------------------
  |  |  215|  8.80k|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (1966:6): [True: 8.80k, False: 5.18k]
  |  Branch (1966:16): [True: 3, False: 8.80k]
  |  Branch (1966:27): [True: 0, False: 8.80k]
  ------------------
 1967|      3|    curlx_safefree(proxy);  /* Do not bother with an empty proxy string
  ------------------
  |  | 1327|      3|  do {                      \
  |  | 1328|      3|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      3|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      3|    (ptr) = NULL;           \
  |  | 1330|      3|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 3]
  |  |  ------------------
  ------------------
 1968|       |                               or if the protocol does not work with network */
 1969|      3|  }
 1970|  13.9k|  if(pre_proxy && (!*pre_proxy ||
  ------------------
  |  Branch (1970:6): [True: 435, False: 13.5k]
  |  Branch (1970:20): [True: 50, False: 385]
  ------------------
 1971|    385|                    (conn->scheme->flags & PROTOPT_NONETWORK))) {
  ------------------
  |  |  215|    385|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (1971:21): [True: 0, False: 385]
  ------------------
 1972|     50|    curlx_safefree(pre_proxy);  /* Do not bother with an empty socks proxy
  ------------------
  |  | 1327|     50|  do {                      \
  |  | 1328|     50|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|     50|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|     50|    (ptr) = NULL;           \
  |  | 1330|     50|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 50]
  |  |  ------------------
  ------------------
 1973|       |                                   string or if the protocol does not work
 1974|       |                                   with network */
 1975|     50|  }
 1976|       |
 1977|       |  /***********************************************************************
 1978|       |   * If this is supposed to use a proxy, we need to figure out the proxy host
 1979|       |   * name, proxy type and port number, so that we can reuse an existing
 1980|       |   * connection that may exist registered to the same proxy host.
 1981|       |   ***********************************************************************/
 1982|  13.9k|  if(proxy || pre_proxy) {
  ------------------
  |  Branch (1982:6): [True: 8.80k, False: 5.19k]
  |  Branch (1982:15): [True: 359, False: 4.83k]
  ------------------
 1983|  9.16k|    if(pre_proxy) {
  ------------------
  |  Branch (1983:8): [True: 385, False: 8.77k]
  ------------------
 1984|    385|      result = parse_proxy(data, pre_proxy, TRUE, &conn->socks_proxy);
  ------------------
  |  | 1055|    385|#define TRUE true
  ------------------
 1985|    385|      if(result)
  ------------------
  |  Branch (1985:10): [True: 13, False: 372]
  ------------------
 1986|     13|        goto out;
 1987|    385|    }
 1988|       |
 1989|  9.14k|    if(proxy) {
  ------------------
  |  Branch (1989:8): [True: 8.80k, False: 346]
  ------------------
 1990|  8.80k|      result = parse_proxy(data, proxy, FALSE, &conn->http_proxy);
  ------------------
  |  | 1058|  8.80k|#define FALSE false
  ------------------
 1991|  8.80k|      if(result)
  ------------------
  |  Branch (1991:10): [True: 3, False: 8.79k]
  ------------------
 1992|      3|        goto out;
 1993|  8.79k|      switch(conn->http_proxy.proxytype) {
 1994|      3|      case CURLPROXY_SOCKS4:
  ------------------
  |  |  798|      3|#define CURLPROXY_SOCKS4          4L /* support added in 7.15.2, enum existed
  ------------------
  |  Branch (1994:7): [True: 3, False: 8.79k]
  ------------------
 1995|      8|      case CURLPROXY_SOCKS4A:
  ------------------
  |  |  801|      8|#define CURLPROXY_SOCKS4A         6L /* added in 7.18.0 */
  ------------------
  |  Branch (1995:7): [True: 5, False: 8.79k]
  ------------------
 1996|     26|      case CURLPROXY_SOCKS5:
  ------------------
  |  |  800|     26|#define CURLPROXY_SOCKS5          5L /* added in 7.10 */
  ------------------
  |  Branch (1996:7): [True: 18, False: 8.78k]
  ------------------
 1997|     52|      case CURLPROXY_SOCKS5_HOSTNAME:
  ------------------
  |  |  802|     52|#define CURLPROXY_SOCKS5_HOSTNAME 7L /* Use the SOCKS5 protocol but pass along
  ------------------
  |  Branch (1997:7): [True: 26, False: 8.77k]
  ------------------
 1998|       |        /* Whoops, it's not a HTTP proxy */
 1999|     52|        if(conn->socks_proxy.peer) {
  ------------------
  |  Branch (1999:12): [True: 2, False: 50]
  ------------------
 2000|       |          /* and we already have a SOCKS pre-proxy. Cannot have both */
 2001|      2|          failf(data, "Having a SOCKS pre-proxy and proxy is not "
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
 2002|      2|                "supported with \'%s\'", proxy);
 2003|      2|          result = CURLE_COULDNT_RESOLVE_PROXY;
 2004|      2|          goto out;
 2005|      2|        }
 2006|       |        /* switch */
 2007|     50|        conn->socks_proxy = conn->http_proxy;
 2008|     50|        memset(&conn->http_proxy, 0, sizeof(conn->http_proxy));
 2009|     50|        break;
 2010|  8.74k|      default:
  ------------------
  |  Branch (2010:7): [True: 8.74k, False: 52]
  ------------------
 2011|  8.74k|        break;
 2012|  8.79k|      }
 2013|  8.79k|    }
 2014|       |
 2015|  9.14k|    if(conn->http_proxy.peer) {
  ------------------
  |  Branch (2015:8): [True: 8.74k, False: 396]
  ------------------
 2016|       |#ifdef CURL_DISABLE_HTTP
 2017|       |      /* asking for an HTTP proxy is a bit funny when HTTP is disabled... */
 2018|       |      result = CURLE_UNSUPPORTED_PROTOCOL;
 2019|       |      goto out;
 2020|       |#else
 2021|  8.74k|#ifndef CURL_DISABLE_DIGEST_AUTH
 2022|  8.74k|      if(!Curl_safecmp(data->state.envproxy, proxy)) {
  ------------------
  |  Branch (2022:10): [True: 7.94k, False: 800]
  ------------------
 2023|       |        /* proxy changed */
 2024|  7.94k|        Curl_auth_digest_cleanup(&data->state.proxydigest);
 2025|  7.94k|        curlx_free(data->state.envproxy);
  ------------------
  |  | 1483|  7.94k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2026|  7.94k|        data->state.envproxy = curlx_strdup(proxy);
  ------------------
  |  | 1477|  7.94k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 2027|  7.94k|      }
 2028|  8.74k|#endif
 2029|  8.74k|      if(conn->scheme->flags & PROTOPT_HTTP_PROXY_TUNNEL) {
  ------------------
  |  |  240|  8.74k|#define PROTOPT_HTTP_PROXY_TUNNEL (1 << 18) /* Using this protocol with a
  ------------------
  |  Branch (2029:10): [True: 0, False: 8.74k]
  ------------------
 2030|      0|        conn->bits.tunnel_proxy = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2031|      0|      }
 2032|  8.74k|      else if(!(conn->scheme->protocol & PROTO_FAMILY_HTTP)) {
  ------------------
  |  |   84|  8.74k|#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1078|  8.74k|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1079|  8.74k|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  |   63|  8.74k|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   85|  8.74k|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   64|  8.74k|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
  |  Branch (2032:15): [True: 8.74k, False: 0]
  ------------------
 2033|       |        /* force this connection's protocol to become HTTP if compatible */
 2034|  8.74k|        if((conn->scheme->flags & PROTOPT_PROXY_AS_HTTP) &&
  ------------------
  |  |  227|  8.74k|#define PROTOPT_PROXY_AS_HTTP (1 << 11) /* allow this non-HTTP scheme over a
  ------------------
  |  Branch (2034:12): [True: 8.59k, False: 153]
  ------------------
 2035|  8.59k|           !conn->bits.tunnel_proxy)
  ------------------
  |  Branch (2035:12): [True: 8.58k, False: 5]
  ------------------
 2036|  8.58k|          conn->scheme = &Curl_scheme_http;
 2037|    158|        else
 2038|       |          /* if not converting to HTTP over the proxy, enforce tunneling */
 2039|    158|          conn->bits.tunnel_proxy = TRUE;
  ------------------
  |  | 1055|    158|#define TRUE true
  ------------------
 2040|  8.74k|      }
 2041|  8.74k|#endif
 2042|  8.74k|    }
 2043|    396|    else
 2044|    396|      conn->bits.tunnel_proxy = FALSE; /* no tunneling if not HTTP */
  ------------------
  |  | 1058|    396|#define FALSE false
  ------------------
 2045|  9.14k|  }
 2046|       |
 2047|  13.9k|  conn->bits.socksproxy = !!conn->socks_proxy.peer;
 2048|  13.9k|  conn->bits.httpproxy = !!conn->http_proxy.peer;
 2049|  13.9k|  conn->bits.proxy = conn->bits.httpproxy || conn->bits.socksproxy;
  ------------------
  |  Branch (2049:22): [True: 8.74k, False: 5.22k]
  |  Branch (2049:46): [True: 396, False: 4.83k]
  ------------------
 2050|       |
 2051|  13.9k|  if(!conn->bits.proxy) {
  ------------------
  |  Branch (2051:6): [True: 4.83k, False: 9.14k]
  ------------------
 2052|       |    /* we are not using the proxy after all... */
 2053|  4.83k|    conn->bits.proxy = FALSE;
  ------------------
  |  | 1058|  4.83k|#define FALSE false
  ------------------
 2054|  4.83k|    conn->bits.httpproxy = FALSE;
  ------------------
  |  | 1058|  4.83k|#define FALSE false
  ------------------
 2055|  4.83k|    conn->bits.socksproxy = FALSE;
  ------------------
  |  | 1058|  4.83k|#define FALSE false
  ------------------
 2056|  4.83k|    conn->bits.tunnel_proxy = FALSE;
  ------------------
  |  | 1058|  4.83k|#define FALSE false
  ------------------
 2057|       |    /* CURLPROXY_HTTPS does not have its own flag in conn->bits, yet we need
 2058|       |       to signal that CURLPROXY_HTTPS is not used for this connection */
 2059|  4.83k|    conn->http_proxy.proxytype = CURLPROXY_HTTP;
  ------------------
  |  |  790|  4.83k|#define CURLPROXY_HTTP            0L /* added in 7.10, new in 7.19.4 default is
  ------------------
 2060|  4.83k|  }
 2061|       |
 2062|  13.9k|out:
 2063|       |
 2064|  13.9k|  curlx_free(pre_proxy);
  ------------------
  |  | 1483|  13.9k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2065|  13.9k|  curlx_free(proxy);
  ------------------
  |  | 1483|  13.9k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2066|  13.9k|  return result;
 2067|  13.9k|}
url.c:url_detect_proxy:
 1707|  4.81k|{
 1708|  4.81k|  char *proxy = NULL;
 1709|       |
 1710|       |  /* If proxy was not specified, we check for default proxy environment
 1711|       |   * variables, to enable i.e Lynx compliance:
 1712|       |   *
 1713|       |   * http_proxy=http://some.server.dom:port/
 1714|       |   * https_proxy=http://some.server.dom:port/
 1715|       |   * ftp_proxy=http://some.server.dom:port/
 1716|       |   * no_proxy=domain1.dom,host.domain2.dom
 1717|       |   *   (a comma-separated list of hosts which should
 1718|       |   *   not be proxied, or an asterisk to override
 1719|       |   *   all proxy variables)
 1720|       |   * all_proxy=http://some.server.dom:port/
 1721|       |   *   (seems to exist for the CERN www lib. Probably
 1722|       |   *   the first to check for.)
 1723|       |   *
 1724|       |   * For compatibility, the all-uppercase versions of these variables are
 1725|       |   * checked if the lowercase versions do not exist.
 1726|       |   */
 1727|  4.81k|  char proxy_env[20];
 1728|  4.81k|  const char *envp;
 1729|  4.81k|  VERBOSE(envp = proxy_env);
  ------------------
  |  | 1618|  4.81k|#define VERBOSE(x) x
  ------------------
 1730|       |
 1731|  4.81k|  curl_msnprintf(proxy_env, sizeof(proxy_env), "%s_proxy",
 1732|  4.81k|                 conn->scheme->name);
 1733|       |
 1734|       |  /* read the protocol proxy: */
 1735|  4.81k|  proxy = curl_getenv(proxy_env);
 1736|       |
 1737|       |  /*
 1738|       |   * We do not try the uppercase version of HTTP_PROXY because of
 1739|       |   * security reasons:
 1740|       |   *
 1741|       |   * When curl is used in a webserver application
 1742|       |   * environment (cgi or php), this environment variable can
 1743|       |   * be controlled by the web server user by setting the
 1744|       |   * http header 'Proxy:' to some value.
 1745|       |   *
 1746|       |   * This can cause 'internal' http/ftp requests to be
 1747|       |   * arbitrarily redirected by any external attacker.
 1748|       |   */
 1749|  4.81k|  if(!proxy && !curl_strequal("http_proxy", proxy_env)) {
  ------------------
  |  Branch (1749:6): [True: 4.81k, False: 0]
  |  Branch (1749:16): [True: 4.80k, False: 5]
  ------------------
 1750|       |    /* There was no lowercase variable, try the uppercase version: */
 1751|  4.80k|    Curl_strntoupper(proxy_env, proxy_env, sizeof(proxy_env));
 1752|  4.80k|    proxy = curl_getenv(proxy_env);
 1753|  4.80k|  }
 1754|       |
 1755|  4.81k|  if(!proxy) {
  ------------------
  |  Branch (1755:6): [True: 4.81k, False: 0]
  ------------------
 1756|  4.81k|#ifndef CURL_DISABLE_WEBSOCKETS
 1757|       |    /* websocket proxy fallbacks */
 1758|  4.81k|    if(curl_strequal("ws_proxy", proxy_env)) {
  ------------------
  |  Branch (1758:8): [True: 0, False: 4.81k]
  ------------------
 1759|      0|      proxy = curl_getenv("http_proxy");
 1760|      0|    }
 1761|  4.81k|    else if(curl_strequal("wss_proxy", proxy_env)) {
  ------------------
  |  Branch (1761:13): [True: 0, False: 4.81k]
  ------------------
 1762|      0|      proxy = curl_getenv("https_proxy");
 1763|      0|      if(!proxy)
  ------------------
  |  Branch (1763:10): [True: 0, False: 0]
  ------------------
 1764|      0|        proxy = curl_getenv("HTTPS_PROXY");
 1765|      0|    }
 1766|  4.81k|    if(!proxy) {
  ------------------
  |  Branch (1766:8): [True: 4.81k, False: 0]
  ------------------
 1767|  4.81k|#endif
 1768|  4.81k|      envp = "all_proxy";
 1769|  4.81k|      proxy = curl_getenv(envp); /* default proxy to use */
 1770|  4.81k|      if(!proxy) {
  ------------------
  |  Branch (1770:10): [True: 4.81k, False: 0]
  ------------------
 1771|  4.81k|        envp = "ALL_PROXY";
 1772|  4.81k|        proxy = curl_getenv(envp);
 1773|  4.81k|      }
 1774|  4.81k|#ifndef CURL_DISABLE_WEBSOCKETS
 1775|  4.81k|    }
 1776|  4.81k|#endif
 1777|  4.81k|  }
 1778|  4.81k|  if(proxy)
  ------------------
  |  Branch (1778:6): [True: 0, False: 4.81k]
  ------------------
 1779|      0|    infof(data, "Uses proxy env variable %s == '%s'", envp, proxy);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1780|       |
 1781|  4.81k|  return proxy;
 1782|  4.81k|}
url.c:parse_proxy:
 1794|  9.18k|{
 1795|  9.18k|  char *proxyuser = NULL;
 1796|  9.18k|  char *proxypasswd = NULL;
 1797|  9.18k|  char *scheme = NULL;
 1798|  9.18k|  CURLcode result = CURLE_OK;
 1799|       |  /* Set the start proxy type for url scheme guessing */
 1800|  9.18k|  uint8_t proxytype = for_pre_proxy ? CURLPROXY_SOCKS4 : data->set.proxytype;
  ------------------
  |  |  798|    385|#define CURLPROXY_SOCKS4          4L /* support added in 7.15.2, enum existed
  ------------------
  |  Branch (1800:23): [True: 385, False: 8.80k]
  ------------------
 1801|  9.18k|  CURLU *uhp = curl_url();
 1802|  9.18k|  CURLUcode uc;
 1803|       |
 1804|  9.18k|  if(!uhp) {
  ------------------
  |  Branch (1804:6): [True: 0, False: 9.18k]
  ------------------
 1805|      0|    result = CURLE_OUT_OF_MEMORY;
 1806|      0|    goto error;
 1807|      0|  }
 1808|       |  /* When parsing the proxy, allowing non-supported schemes since we have
 1809|       |     these made up ones for proxies. Guess scheme for URLs without it. */
 1810|  9.18k|  uc = curl_url_set(uhp, CURLUPART_URL, proxy,
 1811|  9.18k|                    CURLU_NON_SUPPORT_SCHEME | CURLU_GUESS_SCHEME);
  ------------------
  |  |   90|  9.18k|#define CURLU_NON_SUPPORT_SCHEME (1 << 3) /* allow non-supported scheme */
  ------------------
                                  CURLU_NON_SUPPORT_SCHEME | CURLU_GUESS_SCHEME);
  ------------------
  |  |   96|  9.18k|#define CURLU_GUESS_SCHEME (1 << 9)       /* legacy curl-style guessing */
  ------------------
 1812|  9.18k|  if(!uc) {
  ------------------
  |  Branch (1812:6): [True: 9.17k, False: 7]
  ------------------
 1813|       |    /* parsed okay as a URL - only update proxytype when scheme was explicit */
 1814|  9.17k|    uc = curl_url_get(uhp, CURLUPART_SCHEME, &scheme, CURLU_NO_GUESS_SCHEME);
  ------------------
  |  |  105|  9.17k|#define CURLU_NO_GUESS_SCHEME (1 << 15)   /* for get, do not accept a guess */
  ------------------
 1815|  9.17k|    if(!uc) {
  ------------------
  |  Branch (1815:8): [True: 5, False: 9.17k]
  ------------------
 1816|      5|      result = Curl_scheme_to_proxytype(data, scheme, &proxytype, proxy);
 1817|      5|      if(result)
  ------------------
  |  Branch (1817:10): [True: 3, False: 2]
  ------------------
 1818|      3|        goto error;
 1819|      5|    }
 1820|  9.17k|    else if(uc != CURLUE_NO_SCHEME) {
  ------------------
  |  Branch (1820:13): [True: 0, False: 9.17k]
  ------------------
 1821|      0|      result = CURLE_OUT_OF_MEMORY;
 1822|      0|      goto error;
 1823|      0|    }
 1824|       |    /* else: no explicit scheme, keep the configured proxytype */
 1825|  9.17k|  }
 1826|      7|  else {
 1827|      7|    failf(data, "Unsupported proxy syntax in \'%s\': %s", proxy,
  ------------------
  |  |   62|      7|#define failf Curl_failf
  ------------------
 1828|      7|          curl_url_strerror(uc));
 1829|      7|    result = CURLE_COULDNT_RESOLVE_PROXY;
 1830|      7|    goto error;
 1831|      7|  }
 1832|       |
 1833|  9.17k|  result = Curl_peer_from_proxy_url(uhp, data, proxy, proxytype,
 1834|  9.17k|                                    &proxyinfo->peer, &proxytype);
 1835|  9.17k|  if(result)
  ------------------
  |  Branch (1835:6): [True: 2, False: 9.17k]
  ------------------
 1836|      2|    goto error;
 1837|       |
 1838|  9.17k|  switch(proxytype) {
 1839|  8.32k|    case CURLPROXY_HTTP:
  ------------------
  |  |  790|  8.32k|#define CURLPROXY_HTTP            0L /* added in 7.10, new in 7.19.4 default is
  ------------------
  |  Branch (1839:5): [True: 8.32k, False: 847]
  ------------------
 1840|  8.33k|    case CURLPROXY_HTTP_1_0:
  ------------------
  |  |  792|  8.33k|#define CURLPROXY_HTTP_1_0        1L /* force to use CONNECT HTTP/1.0
  ------------------
  |  Branch (1840:5): [True: 3, False: 9.17k]
  ------------------
 1841|  8.36k|    case CURLPROXY_HTTPS:
  ------------------
  |  |  794|  8.36k|#define CURLPROXY_HTTPS           2L /* HTTPS but stick to HTTP/1
  ------------------
  |  Branch (1841:5): [True: 36, False: 9.13k]
  ------------------
 1842|  8.74k|    case CURLPROXY_HTTPS2:
  ------------------
  |  |  796|  8.74k|#define CURLPROXY_HTTPS2          3L /* HTTPS and attempt HTTP/2
  ------------------
  |  Branch (1842:5): [True: 382, False: 8.79k]
  ------------------
 1843|  8.74k|    case CURLPROXY_HTTPS3:
  ------------------
  |  |  805|  8.74k|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  ------------------
  |  Branch (1843:5): [True: 0, False: 9.17k]
  ------------------
 1844|  8.74k|      if(for_pre_proxy) {
  ------------------
  |  Branch (1844:10): [True: 2, False: 8.74k]
  ------------------
 1845|      2|        failf(data, "Unsupported pre-proxy type for \'%s\'", proxy);
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
 1846|      2|        result = CURLE_COULDNT_RESOLVE_PROXY;
 1847|      2|        goto error;
 1848|      2|      }
 1849|  8.74k|      break;
 1850|  8.74k|    case CURLPROXY_SOCKS4:
  ------------------
  |  |  798|    377|#define CURLPROXY_SOCKS4          4L /* support added in 7.15.2, enum existed
  ------------------
  |  Branch (1850:5): [True: 377, False: 8.79k]
  ------------------
 1851|    382|    case CURLPROXY_SOCKS4A:
  ------------------
  |  |  801|    382|#define CURLPROXY_SOCKS4A         6L /* added in 7.18.0 */
  ------------------
  |  Branch (1851:5): [True: 5, False: 9.16k]
  ------------------
 1852|    400|    case CURLPROXY_SOCKS5:
  ------------------
  |  |  800|    400|#define CURLPROXY_SOCKS5          5L /* added in 7.10 */
  ------------------
  |  Branch (1852:5): [True: 18, False: 9.15k]
  ------------------
 1853|    426|    case CURLPROXY_SOCKS5_HOSTNAME:
  ------------------
  |  |  802|    426|#define CURLPROXY_SOCKS5_HOSTNAME 7L /* Use the SOCKS5 protocol but pass along
  ------------------
  |  Branch (1853:5): [True: 26, False: 9.14k]
  ------------------
 1854|    426|      break;
 1855|      0|    default:
  ------------------
  |  Branch (1855:5): [True: 0, False: 9.17k]
  ------------------
 1856|      0|      failf(data, "Unsupported proxy type %u for \'%s\'", proxytype, proxy);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1857|      0|      result = CURLE_COULDNT_RESOLVE_PROXY;
 1858|      0|      goto error;
 1859|  9.17k|  }
 1860|       |
 1861|       |  /* Is there a username and password given in this proxy URL? */
 1862|  9.17k|  uc = curl_url_get(uhp, CURLUPART_USER, &proxyuser, CURLU_URLDECODE);
  ------------------
  |  |   93|  9.17k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  ------------------
 1863|  9.17k|  if(uc && (uc != CURLUE_NO_USER)) {
  ------------------
  |  Branch (1863:6): [True: 8.35k, False: 814]
  |  Branch (1863:12): [True: 1, False: 8.35k]
  ------------------
 1864|      1|    result = Curl_uc_to_curlcode(uc);
 1865|      1|    goto error;
 1866|      1|  }
 1867|  9.17k|  uc = curl_url_get(uhp, CURLUPART_PASSWORD, &proxypasswd, CURLU_URLDECODE);
  ------------------
  |  |   93|  9.17k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  ------------------
 1868|  9.17k|  if(uc && (uc != CURLUE_NO_PASSWORD)) {
  ------------------
  |  Branch (1868:6): [True: 9.03k, False: 139]
  |  Branch (1868:12): [True: 1, False: 9.03k]
  ------------------
 1869|      1|    result = Curl_uc_to_curlcode(uc);
 1870|      1|    goto error;
 1871|      1|  }
 1872|       |
 1873|  9.17k|  if(proxyuser || proxypasswd) {
  ------------------
  |  Branch (1873:6): [True: 813, False: 8.35k]
  |  Branch (1873:19): [True: 0, False: 8.35k]
  ------------------
 1874|    813|    result = Curl_creds_create(proxyuser, proxypasswd, NULL, NULL,
 1875|    813|                               data->set.str[STRING_PROXY_SERVICE_NAME],
 1876|    813|                               CREDS_URL, &proxyinfo->creds);
  ------------------
  |  |   30|    813|#define CREDS_URL    1 /* username/passwd from URL */
  ------------------
 1877|    813|    if(result)
  ------------------
  |  Branch (1877:8): [True: 0, False: 813]
  ------------------
 1878|      0|      goto error;
 1879|    813|  }
 1880|  8.35k|  else if(!for_pre_proxy &&
  ------------------
  |  Branch (1880:11): [True: 8.00k, False: 354]
  ------------------
 1881|  8.00k|          (data->set.str[STRING_PROXYUSERNAME] ||
  ------------------
  |  Branch (1881:12): [True: 504, False: 7.49k]
  ------------------
 1882|  7.49k|           data->set.str[STRING_PROXYPASSWORD] ||
  ------------------
  |  Branch (1882:12): [True: 33, False: 7.46k]
  ------------------
 1883|  7.46k|           data->set.str[STRING_PROXY_SERVICE_NAME])) {
  ------------------
  |  Branch (1883:12): [True: 31, False: 7.43k]
  ------------------
 1884|       |    /* No user/passwd in URL, if this is not a pre-proxy, the
 1885|       |     * CURLOPT_PROXY* settings apply. */
 1886|    568|    result = Curl_creds_create(data->set.str[STRING_PROXYUSERNAME],
 1887|    568|                               data->set.str[STRING_PROXYPASSWORD],
 1888|    568|                               NULL, NULL,
 1889|    568|                               data->set.str[STRING_PROXY_SERVICE_NAME],
 1890|    568|                               CREDS_OPTION, &proxyinfo->creds);
  ------------------
  |  |   31|    568|#define CREDS_OPTION 2 /* username/passwd set with a CURLOPT_ */
  ------------------
 1891|    568|  }
 1892|  7.78k|  else
 1893|  7.78k|    Curl_creds_unlink(&proxyinfo->creds);
 1894|       |
 1895|  9.17k|  proxyinfo->proxytype = proxytype;
 1896|       |
 1897|  9.18k|error:
 1898|  9.18k|  curlx_free(scheme);
  ------------------
  |  | 1483|  9.18k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1899|  9.18k|  curlx_free(proxyuser);
  ------------------
  |  | 1483|  9.18k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1900|  9.18k|  curlx_free(proxypasswd);
  ------------------
  |  | 1483|  9.18k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1901|  9.18k|  curl_url_cleanup(uhp);
 1902|  9.18k|#ifdef DEBUGBUILD
 1903|  9.18k|  if(!result) {
  ------------------
  |  Branch (1903:6): [True: 9.17k, False: 16]
  ------------------
 1904|  9.17k|    DEBUGASSERT(proxyinfo);
  ------------------
  |  | 1081|  9.17k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1904:5): [True: 0, False: 9.17k]
  |  Branch (1904:5): [True: 9.17k, False: 0]
  ------------------
 1905|  9.17k|    DEBUGASSERT(proxyinfo->peer);
  ------------------
  |  | 1081|  9.17k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1905:5): [True: 0, False: 9.17k]
  |  Branch (1905:5): [True: 9.17k, False: 0]
  ------------------
 1906|  9.17k|  }
 1907|  9.18k|#endif
 1908|  9.18k|  return result;
 1909|  9.18k|}
url.c:override_login:
 2185|  14.0k|{
 2186|  14.0k|  char **optionsp = &conn->options;
 2187|  14.0k|#ifndef CURL_DISABLE_NETRC
 2188|  14.0k|  struct Curl_creds *ncreds_out = NULL;
 2189|  14.0k|#endif
 2190|  14.0k|  CURLcode result = CURLE_OK;
 2191|       |
 2192|  14.0k|  if(data->set.str[STRING_OPTIONS]) {
  ------------------
  |  Branch (2192:6): [True: 102, False: 13.9k]
  ------------------
 2193|    102|    curlx_free(*optionsp);
  ------------------
  |  | 1483|    102|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2194|    102|    *optionsp = curlx_strdup(data->set.str[STRING_OPTIONS]);
  ------------------
  |  | 1477|    102|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 2195|    102|    if(!*optionsp) {
  ------------------
  |  Branch (2195:8): [True: 0, False: 102]
  ------------------
 2196|      0|      result = CURLE_OUT_OF_MEMORY;
 2197|      0|      goto out;
 2198|      0|    }
 2199|    102|  }
 2200|       |
 2201|  14.0k|#ifndef CURL_DISABLE_NETRC
 2202|  14.0k|  if(data->set.use_netrc) { /* not CURL_NETRC_IGNORED */
  ------------------
  |  Branch (2202:6): [True: 26, False: 14.0k]
  ------------------
 2203|     26|    struct Curl_creds *ncreds_in = NULL;
 2204|     26|    bool scan_netrc = TRUE;
  ------------------
  |  | 1055|     26|#define TRUE true
  ------------------
 2205|     26|    NETRCcode ret;
 2206|     26|    CURLUcode uc;
 2207|       |
 2208|     26|    if(data->state.creds) {
  ------------------
  |  Branch (2208:8): [True: 15, False: 11]
  ------------------
 2209|     15|      switch(data->state.creds->source) {
 2210|      3|      case CREDS_OPTION:
  ------------------
  |  |   31|      3|#define CREDS_OPTION 2 /* username/passwd set with a CURLOPT_ */
  ------------------
  |  Branch (2210:7): [True: 3, False: 12]
  ------------------
 2211|       |        /* we never override credentials set via CURLOPT_*, leave. */
 2212|      3|        scan_netrc = FALSE;
  ------------------
  |  | 1058|      3|#define FALSE false
  ------------------
 2213|      3|        break;
 2214|     12|      case CREDS_URL: /* only apply when netrc is not required */
  ------------------
  |  |   30|     12|#define CREDS_URL    1 /* username/passwd from URL */
  ------------------
  |  Branch (2214:7): [True: 12, False: 3]
  ------------------
 2215|     12|        if(data->set.use_netrc == CURL_NETRC_REQUIRED) {
  ------------------
  |  | 2359|     12|#define CURL_NETRC_REQUIRED 2L /* A user:password in the URL is ignored.
  ------------------
  |  Branch (2215:12): [True: 3, False: 9]
  ------------------
 2216|       |          /* We ignore password from URL */
 2217|      3|          ncreds_in = data->state.creds;
 2218|      3|        }
 2219|      9|        else if(!Curl_creds_has_user(data->state.creds) ||
  ------------------
  |  |   71|     18|#define Curl_creds_has_user(c)           ((c) && (c)->user[0])
  |  |  ------------------
  |  |  |  Branch (71:43): [True: 9, False: 0]
  |  |  |  Branch (71:50): [True: 3, False: 6]
  |  |  ------------------
  ------------------
 2220|      7|                !Curl_creds_has_passwd(data->state.creds)) {
  ------------------
  |  |   72|      3|#define Curl_creds_has_passwd(c)         ((c) && (c)->passwd[0])
  |  |  ------------------
  |  |  |  Branch (72:43): [True: 3, False: 0]
  |  |  |  Branch (72:50): [True: 2, False: 1]
  |  |  ------------------
  ------------------
 2221|       |          /* We use netrc to complete what is missing */
 2222|      7|          ncreds_in = data->state.creds;
 2223|      7|        }
 2224|      2|        else
 2225|      2|          scan_netrc = FALSE;
  ------------------
  |  | 1058|      2|#define FALSE false
  ------------------
 2226|     12|        break;
 2227|      0|      default: /* ignore credentials from other sources */
  ------------------
  |  Branch (2227:7): [True: 0, False: 15]
  ------------------
 2228|      0|        break;
 2229|     15|      }
 2230|     15|    }
 2231|       |
 2232|     26|    if(!scan_netrc)
  ------------------
  |  Branch (2232:8): [True: 5, False: 21]
  ------------------
 2233|      5|      goto out;
 2234|       |
 2235|     21|    ret = Curl_netrc_scan(data, &data->state.netrc,
 2236|     21|                          conn->origin->hostname,
 2237|     21|                          Curl_creds_user(ncreds_in),
  ------------------
  |  |   75|     21|#define Curl_creds_user(c)               ((c) ? (c)->user : "")
  |  |  ------------------
  |  |  |  Branch (75:43): [True: 10, False: 11]
  |  |  ------------------
  ------------------
 2238|     21|                          data->set.str[STRING_NETRC_FILE],
 2239|     21|                          &ncreds_out);
 2240|     21|    DEBUGASSERT(!ret || !ncreds_out);
  ------------------
  |  | 1081|     21|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2240:5): [True: 21, False: 0]
  |  Branch (2240:5): [True: 0, False: 0]
  |  Branch (2240:5): [True: 0, False: 21]
  |  Branch (2240:5): [True: 21, False: 0]
  ------------------
 2241|     21|    if(ret == NETRC_OUT_OF_MEMORY) {
  ------------------
  |  Branch (2241:8): [True: 0, False: 21]
  ------------------
 2242|      0|      result = CURLE_OUT_OF_MEMORY;
 2243|      0|      goto out;
 2244|      0|    }
 2245|     21|    else if(ret && ((ret == NETRC_NO_MATCH) ||
  ------------------
  |  Branch (2245:13): [True: 21, False: 0]
  |  Branch (2245:21): [True: 21, False: 0]
  ------------------
 2246|     21|                    (data->set.use_netrc == CURL_NETRC_OPTIONAL))) {
  ------------------
  |  | 2357|      0|#define CURL_NETRC_OPTIONAL 1L /* A user:password in the URL is preferred
  ------------------
  |  Branch (2246:21): [True: 0, False: 0]
  ------------------
 2247|     21|      infof(data, "Could not find host %s in the %s file; using defaults",
  ------------------
  |  |  143|     21|  do {                               \
  |  |  144|     21|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     21|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 21, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 21]
  |  |  |  |  ------------------
  |  |  |  |  320|     21|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     21|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|     21|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 21]
  |  |  ------------------
  ------------------
 2248|     21|            conn->origin->hostname,
 2249|     21|            (data->set.str[STRING_NETRC_FILE] ?
 2250|     21|             data->set.str[STRING_NETRC_FILE] : ".netrc"));
 2251|     21|    }
 2252|      0|    else if(ret) {
  ------------------
  |  Branch (2252:13): [True: 0, False: 0]
  ------------------
 2253|      0|      const char *m = Curl_netrc_strerror(ret);
 2254|      0|      failf(data, ".netrc error: %s", m);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2255|      0|      result = CURLE_READ_ERROR;
 2256|      0|      goto out;
 2257|      0|    }
 2258|      0|    else if(ncreds_out) {
  ------------------
  |  Branch (2258:13): [True: 0, False: 0]
  ------------------
 2259|      0|      if(!(conn->scheme->flags & PROTOPT_USERPWDCTRL)) {
  ------------------
  |  |  232|      0|#define PROTOPT_USERPWDCTRL (1 << 13) /* Allow "control bytes" (< 32 ASCII) in
  ------------------
  |  Branch (2259:10): [True: 0, False: 0]
  ------------------
 2260|       |        /* if the protocol cannot handle control codes in credentials, make
 2261|       |           sure there are none */
 2262|      0|        if(str_has_ctrl(ncreds_out->user) ||
  ------------------
  |  Branch (2262:12): [True: 0, False: 0]
  ------------------
 2263|      0|           str_has_ctrl(ncreds_out->passwd)) {
  ------------------
  |  Branch (2263:12): [True: 0, False: 0]
  ------------------
 2264|      0|          failf(data, "control code detected in .netrc credentials");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2265|      0|          result = CURLE_READ_ERROR;
 2266|      0|          goto out;
 2267|      0|        }
 2268|      0|      }
 2269|      0|      CURL_TRC_M(data, "netrc: using credentials for %s as %s",
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2270|      0|                 conn->origin->hostname, ncreds_out->user);
 2271|      0|      result = Curl_creds_merge(ncreds_out->user, ncreds_out->passwd,
 2272|      0|                                data->state.creds, CREDS_NETRC,
  ------------------
  |  |   32|      0|#define CREDS_NETRC  3 /* username/passwd found in netrc */
  ------------------
 2273|      0|                                &data->state.creds);
 2274|      0|      if(result)
  ------------------
  |  Branch (2274:10): [True: 0, False: 0]
  ------------------
 2275|      0|        goto out;
 2276|       |      /* for updated strings, we update them in the URL */
 2277|      0|      uc = curl_url_set(data->state.uh, CURLUPART_USER,
 2278|      0|                        Curl_creds_user(data->state.creds), CURLU_URLENCODE);
  ------------------
  |  |   75|      0|#define Curl_creds_user(c)               ((c) ? (c)->user : "")
  |  |  ------------------
  |  |  |  Branch (75:43): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                      Curl_creds_user(data->state.creds), CURLU_URLENCODE);
  ------------------
  |  |   94|      0|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
 2279|      0|      if(!uc)
  ------------------
  |  Branch (2279:10): [True: 0, False: 0]
  ------------------
 2280|      0|        uc = curl_url_set(data->state.uh, CURLUPART_PASSWORD,
 2281|      0|                          Curl_creds_passwd(data->state.creds),
  ------------------
  |  |   76|      0|#define Curl_creds_passwd(c)             ((c) ? (c)->passwd : "")
  |  |  ------------------
  |  |  |  Branch (76:43): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2282|      0|                          CURLU_URLENCODE);
  ------------------
  |  |   94|      0|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
 2283|      0|      if(uc)
  ------------------
  |  Branch (2283:10): [True: 0, False: 0]
  ------------------
 2284|      0|        result = Curl_uc_to_curlcode(uc);
 2285|      0|    }
 2286|      0|    else
 2287|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2287:7): [Folded, False: 0]
  |  Branch (2287:7): [Folded, False: 0]
  ------------------
 2288|     21|  }
 2289|  14.0k|#endif
 2290|       |
 2291|  14.0k|out:
 2292|  14.0k|#ifndef CURL_DISABLE_NETRC
 2293|  14.0k|  Curl_creds_unlink(&ncreds_out);
 2294|  14.0k|#endif
 2295|  14.0k|  return result;
 2296|  14.0k|}
url.c:url_set_conn_login:
 2303|  14.0k|{
 2304|       |  /* If our protocol needs a password and we have none, use the defaults */
 2305|  14.0k|  if((conn->scheme->flags & PROTOPT_NEEDSPWD) && !conn->creds) {
  ------------------
  |  |  216|  14.0k|#define PROTOPT_NEEDSPWD (1 << 5)  /* needs a password, and if none is set it
  ------------------
  |  Branch (2305:6): [True: 4.96k, False: 9.12k]
  |  Branch (2305:50): [True: 4.96k, False: 0]
  ------------------
 2306|  4.96k|    if(data->state.creds)
  ------------------
  |  Branch (2306:8): [True: 223, False: 4.73k]
  ------------------
 2307|    223|      Curl_creds_link(&conn->creds, data->state.creds);
 2308|  4.73k|    else
 2309|  4.73k|      return Curl_creds_create(CURL_DEFAULT_USER, CURL_DEFAULT_PASSWORD,
  ------------------
  |  |   29|  4.73k|#define CURL_DEFAULT_USER     "anonymous"
  ------------------
                    return Curl_creds_create(CURL_DEFAULT_USER, CURL_DEFAULT_PASSWORD,
  ------------------
  |  |   30|  4.73k|#define CURL_DEFAULT_PASSWORD "ftp@example.com"
  ------------------
 2310|  4.73k|                               NULL, NULL, NULL, CREDS_NONE, &conn->creds);
  ------------------
  |  |   29|  4.73k|#define CREDS_NONE   0 /* used for default username/passwd */
  ------------------
 2311|  4.96k|  }
 2312|  9.12k|  else if(!(conn->scheme->flags & PROTOPT_CREDSPERREQUEST)) {
  ------------------
  |  |  220|  9.12k|#define PROTOPT_CREDSPERREQUEST (1 << 7) /* requires login credentials per
  ------------------
  |  Branch (2312:11): [True: 0, False: 9.12k]
  ------------------
 2313|       |    /* for protocols that do not handle credentials per request,
 2314|       |     * the connection credentials are set by the initial transfer. */
 2315|      0|    Curl_creds_link(&conn->creds, data->state.creds);
 2316|      0|  }
 2317|       |
 2318|  9.34k|  return CURLE_OK;
 2319|  14.0k|}
url.c:setup_connection_internals:
 1660|  14.0k|{
 1661|  14.0k|  struct Curl_peer *peer = NULL;
 1662|  14.0k|  CURLcode result;
 1663|       |
 1664|  14.0k|  DEBUGF(infof(data, "setup connection, bits.close=%d", conn->bits.close));
  ------------------
  |  | 1067|  98.5k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 14.0k, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 14.0k]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 14.0k]
  |  |  ------------------
  ------------------
 1665|  14.0k|  if(conn->scheme->run->setup_connection) {
  ------------------
  |  Branch (1665:6): [True: 14.0k, False: 0]
  ------------------
 1666|  14.0k|    result = conn->scheme->run->setup_connection(data, conn);
 1667|  14.0k|    if(result)
  ------------------
  |  Branch (1667:8): [True: 0, False: 14.0k]
  ------------------
 1668|      0|      return result;
 1669|  14.0k|  }
 1670|  14.0k|  DEBUGF(infof(data, "setup connection, bits.close=%d", conn->bits.close));
  ------------------
  |  | 1067|  98.5k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 14.0k, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 14.0k]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 14.0k]
  |  |  ------------------
  ------------------
 1671|       |
 1672|       |  /* Now create the destination name */
 1673|  14.0k|  peer = Curl_conn_get_destination(conn, FIRSTSOCKET);
  ------------------
  |  |  303|  14.0k|#define FIRSTSOCKET     0
  ------------------
 1674|  14.0k|  if(!peer)
  ------------------
  |  Branch (1674:6): [True: 0, False: 14.0k]
  ------------------
 1675|      0|    return CURLE_FAILED_INIT;
 1676|       |
 1677|       |  /* IPv6 addresses with a scope_id (0 is default == global) have a
 1678|       |   * printable representation with a '%<scope_id>' suffix. */
 1679|  14.0k|  if(peer->ipv6)
  ------------------
  |  Branch (1679:6): [True: 16, False: 14.0k]
  ------------------
 1680|     16|    if(peer->scopeid)
  ------------------
  |  Branch (1680:8): [True: 4, False: 12]
  ------------------
 1681|      4|      conn->destination = curl_maprintf("[%s%%%u]:%u",
 1682|      4|        peer->hostname, peer->scopeid, peer->port);
 1683|     12|    else
 1684|     12|      conn->destination = curl_maprintf("[%s]:%u",
 1685|     12|        peer->hostname, peer->port);
 1686|  14.0k|  else
 1687|  14.0k|    conn->destination = curl_maprintf("%s:%u", peer->hostname, peer->port);
 1688|  14.0k|  if(!conn->destination)
  ------------------
  |  Branch (1688:6): [True: 0, False: 14.0k]
  ------------------
 1689|      0|    return CURLE_OUT_OF_MEMORY;
 1690|       |
 1691|  14.0k|  Curl_strntolower(conn->destination, conn->destination,
 1692|  14.0k|                   strlen(conn->destination));
 1693|       |
 1694|  14.0k|  return CURLE_OK;
 1695|  14.0k|}
url.c:setup_range:
 1623|  13.8k|{
 1624|  13.8k|  struct UrlState *s = &data->state;
 1625|  13.8k|  s->resume_from = data->set.set_resume_from;
 1626|  13.8k|  if(s->resume_from || data->set.str[STRING_SET_RANGE]) {
  ------------------
  |  Branch (1626:6): [True: 236, False: 13.6k]
  |  Branch (1626:24): [True: 375, False: 13.2k]
  ------------------
 1627|    611|    if(s->rangestringalloc)
  ------------------
  |  Branch (1627:8): [True: 37, False: 574]
  ------------------
 1628|     37|      curlx_free(s->range);
  ------------------
  |  | 1483|     37|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1629|       |
 1630|    611|    if(s->resume_from)
  ------------------
  |  Branch (1630:8): [True: 236, False: 375]
  ------------------
 1631|    236|      s->range = curl_maprintf("%" FMT_OFF_T "-", s->resume_from);
 1632|    375|    else
 1633|    375|      s->range = curlx_strdup(data->set.str[STRING_SET_RANGE]);
  ------------------
  |  | 1477|    375|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1634|       |
 1635|    611|    if(!s->range)
  ------------------
  |  Branch (1635:8): [True: 0, False: 611]
  ------------------
 1636|      0|      return CURLE_OUT_OF_MEMORY;
 1637|       |
 1638|    611|    s->rangestringalloc = TRUE;
  ------------------
  |  | 1055|    611|#define TRUE true
  ------------------
 1639|       |
 1640|       |    /* tell ourselves to fetch this range */
 1641|    611|    s->use_range = TRUE;        /* enable range download */
  ------------------
  |  | 1055|    611|#define TRUE true
  ------------------
 1642|    611|  }
 1643|  13.2k|  else
 1644|  13.2k|    s->use_range = FALSE; /* disable range download */
  ------------------
  |  | 1058|  13.2k|#define FALSE false
  ------------------
 1645|       |
 1646|  13.8k|  return CURLE_OK;
 1647|  13.8k|}
url.c:url_attach_existing:
 1221|  13.9k|{
 1222|  13.9k|  struct url_conn_match match;
 1223|  13.9k|  bool success;
 1224|       |
 1225|  13.9k|  DEBUGASSERT(!data->conn);
  ------------------
  |  | 1081|  13.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1225:3): [True: 0, False: 13.9k]
  |  Branch (1225:3): [True: 13.9k, False: 0]
  ------------------
 1226|  13.9k|  memset(&match, 0, sizeof(match));
 1227|  13.9k|  match.data = data;
 1228|  13.9k|  match.needle = needle;
 1229|  13.9k|  match.may_multiplex = xfer_may_multiplex(data, needle);
 1230|       |
 1231|       |#ifdef USE_NTLM
 1232|       |  match.want_ntlm_http =
 1233|       |    (data->state.authhost.want & CURLAUTH_NTLM) &&
 1234|       |    (needle->scheme->protocol & PROTO_FAMILY_HTTP);
 1235|       |#ifndef CURL_DISABLE_PROXY
 1236|       |  match.want_proxy_ntlm_http =
 1237|       |    needle->http_proxy.creds &&
 1238|       |    (data->state.authproxy.want & CURLAUTH_NTLM) &&
 1239|       |    (needle->scheme->protocol & PROTO_FAMILY_HTTP);
 1240|       |#endif
 1241|       |#endif
 1242|       |
 1243|       |#if !defined(CURL_DISABLE_HTTP) && defined(USE_SPNEGO)
 1244|       |  match.want_nego_http =
 1245|       |    (data->state.authhost.want & CURLAUTH_NEGOTIATE) &&
 1246|       |    (needle->scheme->protocol & PROTO_FAMILY_HTTP);
 1247|       |#ifndef CURL_DISABLE_PROXY
 1248|       |  match.want_proxy_nego_http =
 1249|       |    needle->http_proxy.creds &&
 1250|       |    (data->state.authproxy.want & CURLAUTH_NEGOTIATE) &&
 1251|       |    (needle->scheme->protocol & PROTO_FAMILY_HTTP);
 1252|       |#endif
 1253|       |#endif
 1254|  13.9k|  match.require_tls = data->set.use_ssl >= CURLUSESSL_CONTROL;
  ------------------
  |  |  926|  13.9k|#define CURLUSESSL_CONTROL 2L /* SSL for the control connection or fail */
  ------------------
 1255|  13.9k|  match.may_tls = data->set.use_ssl > CURLUSESSL_NONE;
  ------------------
  |  |  924|  13.9k|#define CURLUSESSL_NONE    0L /* do not attempt to use SSL */
  ------------------
 1256|       |
 1257|       |  /* Find a connection in the pool that matches what "data + needle"
 1258|       |   * requires. If a suitable candidate is found, it is attached to "data". */
 1259|  13.9k|  success = Curl_cpool_find(data, needle->destination,
 1260|  13.9k|                            url_match_conn, url_match_result, &match);
 1261|       |
 1262|       |  /* wait_pipe is TRUE if we encounter a bundle that is undecided. There
 1263|       |   * is no matching connection then, yet. */
 1264|  13.9k|  *waitpipe = (bool)match.wait_pipe;
 1265|  13.9k|  return success;
 1266|  13.9k|}
url.c:xfer_may_multiplex:
  534|  13.9k|{
  535|  13.9k|#ifndef CURL_DISABLE_HTTP
  536|       |  /* If an HTTP protocol and multiplexing is enabled */
  537|  13.9k|  if((conn->scheme->protocol & PROTO_FAMILY_HTTP) &&
  ------------------
  |  |   84|  13.9k|#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1078|  13.9k|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1079|  13.9k|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  |   63|  13.9k|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   85|  13.9k|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   64|  13.9k|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
  |  Branch (537:6): [True: 9.08k, False: 4.81k]
  ------------------
  538|  9.08k|     (!conn->bits.protoconnstart || !conn->bits.close)) {
  ------------------
  |  Branch (538:7): [True: 9.08k, False: 0]
  |  Branch (538:37): [True: 0, False: 0]
  ------------------
  539|       |
  540|  9.08k|    if(Curl_multiplex_wanted(data->multi) &&
  ------------------
  |  Branch (540:8): [True: 9.08k, False: 0]
  ------------------
  541|  9.08k|       (data->state.http_neg.allowed & (CURL_HTTP_V2x | CURL_HTTP_V3x)))
  ------------------
  |  |   41|  9.08k|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
                     (data->state.http_neg.allowed & (CURL_HTTP_V2x | CURL_HTTP_V3x)))
  ------------------
  |  |   42|  9.08k|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  |  Branch (541:8): [True: 9.05k, False: 35]
  ------------------
  542|       |      /* allows HTTP/2 or newer */
  543|  9.05k|      return TRUE;
  ------------------
  |  | 1055|  9.05k|#define TRUE true
  ------------------
  544|  9.08k|  }
  545|       |#else
  546|       |  (void)data;
  547|       |  (void)conn;
  548|       |#endif
  549|  4.85k|  return FALSE;
  ------------------
  |  | 1058|  4.85k|#define FALSE false
  ------------------
  550|  13.9k|}
url.c:url_match_conn:
 1126|    628|{
 1127|    628|  struct url_conn_match *m = userdata;
 1128|       |  /* Check if `conn` can be used for transfer `m->data` */
 1129|       |
 1130|       |  /* general connect config setting match? */
 1131|    628|  if(!url_match_connect_config(conn, m))
  ------------------
  |  Branch (1131:6): [True: 0, False: 628]
  ------------------
 1132|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1133|       |
 1134|       |  /* match for destination and protocol? */
 1135|    628|  if(!url_match_destination(conn, m))
  ------------------
  |  Branch (1135:6): [True: 2, False: 626]
  ------------------
 1136|      2|    return FALSE;
  ------------------
  |  | 1058|      2|#define FALSE false
  ------------------
 1137|       |
 1138|    626|  if(!url_match_fully_connected(conn, m))
  ------------------
  |  Branch (1138:6): [True: 204, False: 422]
  ------------------
 1139|    204|    return FALSE;
  ------------------
  |  | 1058|    204|#define FALSE false
  ------------------
 1140|       |
 1141|    422|  if(!url_match_multiplex_needs(conn, m))
  ------------------
  |  Branch (1141:6): [True: 0, False: 422]
  ------------------
 1142|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1143|       |
 1144|    422|  if(!url_match_proxy_use(conn, m))
  ------------------
  |  Branch (1144:6): [True: 0, False: 422]
  ------------------
 1145|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1146|    422|  if(!url_match_ssl_config(conn, m))
  ------------------
  |  Branch (1146:6): [True: 0, False: 422]
  ------------------
 1147|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1148|       |
 1149|    422|  if(!url_match_http_multiplex(conn, m))
  ------------------
  |  Branch (1149:6): [True: 0, False: 422]
  ------------------
 1150|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1151|    422|  else if(m->wait_pipe)
  ------------------
  |  Branch (1151:11): [True: 0, False: 422]
  ------------------
 1152|       |    /* we decided to wait on PIPELINING */
 1153|      0|    return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1154|       |
 1155|    422|  if(!url_match_auth(conn, m))
  ------------------
  |  Branch (1155:6): [True: 0, False: 422]
  ------------------
 1156|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1157|       |
 1158|    422|  if(!url_match_proto_config(conn, m))
  ------------------
  |  Branch (1158:6): [True: 6, False: 416]
  ------------------
 1159|      6|    return FALSE;
  ------------------
  |  | 1058|      6|#define FALSE false
  ------------------
 1160|       |
 1161|    416|  if(!url_match_auth_ntlm(conn, m))
  ------------------
  |  | 1069|    416|#define url_match_auth_ntlm(c, m) ((void)(c), (void)(m), TRUE)
  |  |  ------------------
  |  |  |  | 1055|    416|#define TRUE true
  |  |  ------------------
  ------------------
  |  Branch (1161:6): [True: 0, False: 416]
  ------------------
 1162|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1163|    416|  else if(m->force_reuse)
  ------------------
  |  Branch (1163:11): [True: 0, False: 416]
  ------------------
 1164|      0|    return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1165|       |
 1166|    416|  if(!url_match_auth_nego(conn, m))
  ------------------
  |  | 1122|    416|#define url_match_auth_nego(c, m) ((void)(c), (void)(m), TRUE)
  |  |  ------------------
  |  |  |  | 1055|    416|#define TRUE true
  |  |  ------------------
  ------------------
  |  Branch (1166:6): [True: 0, False: 416]
  ------------------
 1167|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1168|    416|  else if(m->force_reuse)
  ------------------
  |  Branch (1168:11): [True: 0, False: 416]
  ------------------
 1169|      0|    return TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1170|       |
 1171|    416|  if(!url_match_multiplex_limits(conn, m))
  ------------------
  |  Branch (1171:6): [True: 0, False: 416]
  ------------------
 1172|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1173|       |
 1174|    416|  if(!CONN_INUSE(conn) && Curl_conn_seems_dead(conn, m->data)) {
  ------------------
  |  |  346|    832|#define CONN_INUSE(c) (!!(c)->attached_xfers)
  ------------------
  |  Branch (1174:6): [True: 416, False: 0]
  |  Branch (1174:27): [True: 307, False: 109]
  ------------------
 1175|       |    /* remove and disconnect. */
 1176|    307|    Curl_conn_terminate(m->data, conn, FALSE);
  ------------------
  |  | 1058|    307|#define FALSE false
  ------------------
 1177|    307|    return FALSE;
  ------------------
  |  | 1058|    307|#define FALSE false
  ------------------
 1178|    307|  }
 1179|       |
 1180|       |  /* conn matches our needs. */
 1181|    109|  m->found = conn;
 1182|       |  return TRUE;
  ------------------
  |  | 1055|    109|#define TRUE true
  ------------------
 1183|    416|}
url.c:url_match_connect_config:
  692|    628|{
  693|       |  /* connect-only or to-be-closed connections will not be reused */
  694|    628|  if(conn->bits.connect_only || conn->bits.close || conn->bits.no_reuse)
  ------------------
  |  Branch (694:6): [True: 0, False: 628]
  |  Branch (694:33): [True: 0, False: 628]
  |  Branch (694:53): [True: 0, False: 628]
  ------------------
  695|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  696|       |
  697|       |  /* ip_version must match */
  698|    628|  if(m->data->set.ipver != CURL_IPRESOLVE_WHATEVER &&
  ------------------
  |  | 2303|  1.25k|#define CURL_IPRESOLVE_WHATEVER 0L /* default, uses addresses to all IP
  ------------------
  |  Branch (698:6): [True: 1, False: 627]
  ------------------
  699|      1|     m->data->set.ipver != conn->ip_version)
  ------------------
  |  Branch (699:6): [True: 0, False: 1]
  ------------------
  700|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  701|       |
  702|    628|  if(m->needle->localdev || m->needle->localport) {
  ------------------
  |  Branch (702:6): [True: 0, False: 628]
  |  Branch (702:29): [True: 0, False: 628]
  ------------------
  703|       |    /* If we are bound to a specific local end (IP+port), we must not reuse a
  704|       |       random other one, although if we did not ask for a particular one we
  705|       |       can reuse one that was bound.
  706|       |
  707|       |       This comparison is a bit rough and too strict. Since the input
  708|       |       parameters can be specified in numerous ways and still end up the same
  709|       |       it would take a lot of processing to make it really accurate. Instead,
  710|       |       this matching will assume that reuses of bound connections will most
  711|       |       likely also reuse the exact same binding parameters and missing out a
  712|       |       few edge cases should not hurt anyone much.
  713|       |    */
  714|      0|    if((conn->localport != m->needle->localport) ||
  ------------------
  |  Branch (714:8): [True: 0, False: 0]
  ------------------
  715|      0|       (conn->localportrange != m->needle->localportrange) ||
  ------------------
  |  Branch (715:8): [True: 0, False: 0]
  ------------------
  716|      0|       (m->needle->localdev &&
  ------------------
  |  Branch (716:9): [True: 0, False: 0]
  ------------------
  717|      0|        (!conn->localdev || strcmp(conn->localdev, m->needle->localdev))))
  ------------------
  |  Branch (717:10): [True: 0, False: 0]
  |  Branch (717:29): [True: 0, False: 0]
  ------------------
  718|      0|      return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  719|      0|  }
  720|       |
  721|    628|  if(!m->needle->via_peer != !conn->via_peer)
  ------------------
  |  Branch (721:6): [True: 0, False: 628]
  ------------------
  722|       |    /* do not mix connections that use the "connect to host" feature and
  723|       |     * connections that do not use this feature */
  724|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  725|       |
  726|    628|  return TRUE;
  ------------------
  |  | 1055|    628|#define TRUE true
  ------------------
  727|    628|}
url.c:url_match_destination:
  955|    628|{
  956|       |  /* Different connect-to peers never match */
  957|    628|  if(!Curl_peer_same_destination(m->needle->via_peer, conn->via_peer))
  ------------------
  |  Branch (957:6): [True: 0, False: 628]
  ------------------
  958|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  959|       |
  960|    628|#ifndef CURL_DISABLE_PROXY
  961|    628|  if(m->needle->bits.httpproxy && !m->needle->bits.tunnel_proxy) {
  ------------------
  |  Branch (961:6): [True: 319, False: 309]
  |  Branch (961:35): [True: 0, False: 319]
  ------------------
  962|       |    /* Talking to a non-tunneling HTTP proxy matches on proxy peers. */
  963|      0|    return Curl_peer_equal(m->needle->http_proxy.peer,
  964|      0|                           conn->http_proxy.peer);
  965|      0|  }
  966|    628|#endif
  967|       |
  968|    628|  if(m->needle->origin->scheme != conn->origin->scheme) {
  ------------------
  |  Branch (968:6): [True: 0, False: 628]
  ------------------
  969|       |    /* `needle` and `conn` not having the same scheme.
  970|       |     * This is allowed for the same family *if* conn is using TLS.
  971|       |     * - IMAP+STARTTLS works for IMAPS.
  972|       |     * - IMAPS works for IMAP. */
  973|      0|    if(get_protocol_family(conn->origin->scheme) !=
  ------------------
  |  Branch (973:8): [True: 0, False: 0]
  ------------------
  974|      0|       m->needle->scheme->protocol) {
  975|      0|      return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  976|      0|    }
  977|      0|    if(!url_match_ssl_use(conn, m)) {
  ------------------
  |  Branch (977:8): [True: 0, False: 0]
  ------------------
  978|      0|      DEBUGF(infof(m->data, "Connection #%" FMT_OFF_T
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
  979|      0|                   " has compatible protocol family, but no SSL, no match",
  980|      0|                   conn->connection_id));
  981|      0|      return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  982|      0|    }
  983|      0|  }
  984|       |  /* Scheme mismatch is acceptable, just compare hostname/port */
  985|    628|  return Curl_peer_same_destination(m->needle->origin, conn->origin);
  986|    628|}
url.c:get_protocol_family:
  143|    416|{
  144|    416|  DEBUGASSERT(s);
  ------------------
  |  | 1081|    416|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (144:3): [True: 0, False: 416]
  |  Branch (144:3): [True: 416, False: 0]
  ------------------
  145|    416|  DEBUGASSERT(s->family);
  ------------------
  |  | 1081|    416|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (145:3): [True: 0, False: 416]
  |  Branch (145:3): [True: 416, False: 0]
  ------------------
  146|    416|  return s->family;
  147|    416|}
url.c:url_match_fully_connected:
  731|    626|{
  732|    626|  if(!Curl_conn_is_connected(conn, FIRSTSOCKET) ||
  ------------------
  |  |  303|    626|#define FIRSTSOCKET     0
  ------------------
  |  Branch (732:6): [True: 204, False: 422]
  ------------------
  733|    422|     conn->bits.upgrade_in_progress) {
  ------------------
  |  Branch (733:6): [True: 0, False: 422]
  ------------------
  734|       |    /* Not yet connected, or a protocol upgrade is in progress. The later
  735|       |     * happens for HTTP/2 Upgrade: requests that need a response. */
  736|    204|    if(m->may_multiplex) {
  ------------------
  |  Branch (736:8): [True: 204, False: 0]
  ------------------
  737|    204|      m->seen_pending_conn = TRUE;
  ------------------
  |  | 1055|    204|#define TRUE true
  ------------------
  738|       |      /* Do not pick a connection that has not connected yet */
  739|    204|      infof(m->data, "Connection #%" FMT_OFF_T
  ------------------
  |  |  143|    204|  do {                               \
  |  |  144|    204|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    204|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 204, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 204]
  |  |  |  |  ------------------
  |  |  |  |  320|    204|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    204|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    204|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 204]
  |  |  ------------------
  ------------------
  740|    204|            " is not open enough, cannot reuse", conn->connection_id);
  741|    204|    }
  742|       |    /* Do not pick a connection that has not connected yet */
  743|    204|    return FALSE;
  ------------------
  |  | 1058|    204|#define FALSE false
  ------------------
  744|    204|  }
  745|    422|  return TRUE;
  ------------------
  |  | 1055|    422|#define TRUE true
  ------------------
  746|    626|}
url.c:url_match_multiplex_needs:
  761|    422|{
  762|    422|  if(CONN_INUSE(conn)) {
  ------------------
  |  |  346|    422|#define CONN_INUSE(c) (!!(c)->attached_xfers)
  |  |  ------------------
  |  |  |  Branch (346:23): [True: 0, False: 422]
  |  |  ------------------
  ------------------
  763|      0|    if(!conn->bits.multiplex) {
  ------------------
  |  Branch (763:8): [True: 0, False: 0]
  ------------------
  764|       |      /* conn busy and conn cannot take more transfers */
  765|      0|      m->seen_single_use_conn = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  766|      0|      return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  767|      0|    }
  768|      0|    m->seen_multiplex_conn = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  769|      0|    if(!m->may_multiplex || !url_match_multi(conn, m))
  ------------------
  |  Branch (769:8): [True: 0, False: 0]
  |  Branch (769:29): [True: 0, False: 0]
  ------------------
  770|       |      /* conn busy and transfer cannot be multiplexed */
  771|      0|      return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  772|      0|  }
  773|    422|  return TRUE;
  ------------------
  |  | 1055|    422|#define TRUE true
  ------------------
  774|    422|}
url.c:url_match_proxy_use:
  824|    422|{
  825|    422|  if(m->needle->bits.httpproxy != conn->bits.httpproxy ||
  ------------------
  |  Branch (825:6): [True: 0, False: 422]
  ------------------
  826|    422|     m->needle->bits.socksproxy != conn->bits.socksproxy)
  ------------------
  |  Branch (826:6): [True: 0, False: 422]
  ------------------
  827|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  828|       |
  829|    422|  if(m->needle->bits.socksproxy &&
  ------------------
  |  Branch (829:6): [True: 3, False: 419]
  ------------------
  830|      3|     !proxy_info_matches(&m->needle->socks_proxy, &conn->socks_proxy))
  ------------------
  |  Branch (830:6): [True: 0, False: 3]
  ------------------
  831|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  832|       |
  833|    422|  if(m->needle->bits.httpproxy) {
  ------------------
  |  Branch (833:6): [True: 317, False: 105]
  ------------------
  834|    317|    if(m->needle->bits.tunnel_proxy != conn->bits.tunnel_proxy)
  ------------------
  |  Branch (834:8): [True: 0, False: 317]
  ------------------
  835|      0|      return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  836|       |
  837|    317|    if(!proxy_info_matches(&m->needle->http_proxy, &conn->http_proxy))
  ------------------
  |  Branch (837:8): [True: 0, False: 317]
  ------------------
  838|      0|      return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  839|       |
  840|    317|    if(IS_HTTPS_PROXY(m->needle->http_proxy.proxytype)) {
  ------------------
  |  |   80|    317|  (((t) == CURLPROXY_HTTPS) ||  \
  |  |  ------------------
  |  |  |  |  794|    317|#define CURLPROXY_HTTPS           2L /* HTTPS but stick to HTTP/1
  |  |  ------------------
  |  |  |  Branch (80:4): [True: 0, False: 317]
  |  |  ------------------
  |  |   81|    317|   ((t) == CURLPROXY_HTTPS2) || \
  |  |  ------------------
  |  |  |  |  796|    317|#define CURLPROXY_HTTPS2          3L /* HTTPS and attempt HTTP/2
  |  |  ------------------
  |  |  |  Branch (81:4): [True: 0, False: 317]
  |  |  ------------------
  |  |   82|    317|   ((t) == CURLPROXY_HTTPS3))
  |  |  ------------------
  |  |  |  |  805|    317|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  |  |  ------------------
  |  |  |  Branch (82:4): [True: 0, False: 317]
  |  |  ------------------
  ------------------
  841|       |      /* https proxies come in different types, http/1.1, h2, ... */
  842|      0|      if(m->needle->http_proxy.proxytype != conn->http_proxy.proxytype)
  ------------------
  |  Branch (842:10): [True: 0, False: 0]
  ------------------
  843|      0|        return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  844|       |      /* match SSL config to proxy */
  845|      0|      if(!Curl_ssl_conn_config_match(m->data, conn, TRUE)) {
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  |  Branch (845:10): [True: 0, False: 0]
  ------------------
  846|      0|        DEBUGF(infof(m->data,
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
  847|      0|                     "Connection #%" FMT_OFF_T
  848|      0|                     " has different SSL proxy parameters, cannot reuse",
  849|      0|                     conn->connection_id));
  850|      0|        return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  851|      0|      }
  852|       |      /* the SSL config to the server, which may apply here is checked
  853|       |       * further below */
  854|      0|    }
  855|    317|  }
  856|    422|  return TRUE;
  ------------------
  |  | 1055|    422|#define TRUE true
  ------------------
  857|    422|}
url.c:proxy_info_matches:
  555|    320|{
  556|    320|  if((data->proxytype == needle->proxytype) &&
  ------------------
  |  Branch (556:6): [True: 320, False: 0]
  ------------------
  557|    320|     Curl_peer_same_destination(data->peer, needle->peer) &&
  ------------------
  |  Branch (557:6): [True: 320, False: 0]
  ------------------
  558|    320|     Curl_creds_same(data->creds, needle->creds)) {
  ------------------
  |  Branch (558:6): [True: 320, False: 0]
  ------------------
  559|    320|    return TRUE;
  ------------------
  |  | 1055|    320|#define TRUE true
  ------------------
  560|    320|  }
  561|      0|  return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  562|    320|}
url.c:url_match_ssl_config:
  990|    422|{
  991|       |  /* If talking/upgrading to TLS, conn needs to use the same SSL options. */
  992|    422|  if(((m->needle->scheme->flags & PROTOPT_SSL) || m->may_tls) &&
  ------------------
  |  |  207|    422|#define PROTOPT_SSL (1 << 0)       /* uses SSL */
  ------------------
  |  Branch (992:7): [True: 0, False: 422]
  |  Branch (992:51): [True: 2, False: 420]
  ------------------
  993|      2|     !Curl_ssl_conn_config_match(m->data, conn, FALSE)) {
  ------------------
  |  | 1058|      2|#define FALSE false
  ------------------
  |  Branch (993:6): [True: 0, False: 2]
  ------------------
  994|      0|    DEBUGF(infof(m->data, "Connection #%" FMT_OFF_T
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
  995|      0|                 " has different SSL parameters, cannot reuse",
  996|      0|                 conn->connection_id));
  997|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  998|      0|  }
  999|    422|  return TRUE;
  ------------------
  |  | 1055|    422|#define TRUE true
  ------------------
 1000|    422|}
url.c:url_match_http_multiplex:
  865|    422|{
  866|    422|  if(m->may_multiplex &&
  ------------------
  |  Branch (866:6): [True: 309, False: 113]
  ------------------
  867|    309|     (m->data->state.http_neg.allowed & (CURL_HTTP_V2x | CURL_HTTP_V3x)) &&
  ------------------
  |  |   41|    309|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
                   (m->data->state.http_neg.allowed & (CURL_HTTP_V2x | CURL_HTTP_V3x)) &&
  ------------------
  |  |   42|    309|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  |  Branch (867:6): [True: 309, False: 0]
  ------------------
  868|    309|     (m->needle->scheme->protocol & CURLPROTO_HTTP) &&
  ------------------
  |  | 1078|    309|#define CURLPROTO_HTTP    (1L << 0)
  ------------------
  |  Branch (868:6): [True: 309, False: 0]
  ------------------
  869|    309|     !conn->httpversion_seen) {
  ------------------
  |  Branch (869:6): [True: 0, False: 309]
  ------------------
  870|      0|    if(m->data->set.pipewait) {
  ------------------
  |  Branch (870:8): [True: 0, False: 0]
  ------------------
  871|      0|      infof(m->data, "Server upgrade does not support multiplex yet, wait");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  872|      0|      m->found = NULL;
  873|      0|      m->wait_pipe = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  874|      0|      return TRUE; /* stop searching, we want to wait */
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  875|      0|    }
  876|      0|    infof(m->data, "Server upgrade cannot be used");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  877|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  878|      0|  }
  879|    422|  return TRUE;
  ------------------
  |  | 1055|    422|#define TRUE true
  ------------------
  880|    422|}
url.c:url_match_auth:
  936|    422|{
  937|    422|  if(!Curl_creds_same(m->needle->creds, conn->creds)) {
  ------------------
  |  Branch (937:6): [True: 0, False: 422]
  ------------------
  938|      0|    if(m->needle->creds)
  ------------------
  |  Branch (938:8): [True: 0, False: 0]
  ------------------
  939|      0|      return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  940|      0|    if(!Curl_creds_same(m->data->state.creds, conn->creds))
  ------------------
  |  Branch (940:8): [True: 0, False: 0]
  ------------------
  941|      0|      return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  942|      0|  }
  943|       |#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
  944|       |  /* GSS delegation differences do not actually affect every connection and
  945|       |     auth method, but this check takes precaution before efficiency */
  946|       |  if(m->needle->gssapi_delegation != conn->gssapi_delegation)
  947|       |    return FALSE;
  948|       |#endif
  949|       |
  950|    422|  return TRUE;
  ------------------
  |  | 1055|    422|#define TRUE true
  ------------------
  951|    422|}
url.c:url_match_proto_config:
  921|    422|{
  922|    422|  if(!url_match_http_version(conn, m))
  ------------------
  |  Branch (922:6): [True: 6, False: 416]
  ------------------
  923|      6|    return FALSE;
  ------------------
  |  | 1058|      6|#define FALSE false
  ------------------
  924|       |
  925|    416|#ifndef CURL_DISABLE_FTP
  926|    416|  else if(get_protocol_family(m->needle->scheme) & PROTO_FAMILY_FTP) {
  ------------------
  |  |   86|    416|#define PROTO_FAMILY_FTP  (CURLPROTO_FTP | CURLPROTO_FTPS)
  |  |  ------------------
  |  |  |  | 1080|    416|#define CURLPROTO_FTP     (1L << 2)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_FTP  (CURLPROTO_FTP | CURLPROTO_FTPS)
  |  |  ------------------
  |  |  |  | 1081|    416|#define CURLPROTO_FTPS    (1L << 3)
  |  |  ------------------
  ------------------
  |  Branch (926:11): [True: 105, False: 311]
  ------------------
  927|    105|    if(!ftp_conns_match(m->needle, conn))
  ------------------
  |  Branch (927:8): [True: 0, False: 105]
  ------------------
  928|      0|      return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  929|    105|  }
  930|    416|#endif
  931|    416|  return TRUE;
  ------------------
  |  | 1055|    416|#define TRUE true
  ------------------
  932|    422|}
url.c:url_match_http_version:
  884|    422|{
  885|       |  /* If looking for HTTP and the HTTP versions allowed do not include
  886|       |   * the HTTP version of conn, continue looking. */
  887|    422|  if((m->needle->scheme->protocol & PROTO_FAMILY_HTTP)) {
  ------------------
  |  |   84|    422|#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1078|    422|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1079|    422|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  |   63|    422|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   85|    422|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   64|    422|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
  |  Branch (887:6): [True: 317, False: 105]
  ------------------
  888|    317|    switch(Curl_conn_http_version(m->data, conn)) {
  889|      0|    case 30:
  ------------------
  |  Branch (889:5): [True: 0, False: 317]
  ------------------
  890|      0|      if(!(m->data->state.http_neg.allowed & CURL_HTTP_V3x)) {
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  |  Branch (890:10): [True: 0, False: 0]
  ------------------
  891|      0|        DEBUGF(infof(m->data, "not reusing conn #%" CURL_FORMAT_CURL_OFF_T
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
  892|      0|                     ", we do not want h3", conn->connection_id));
  893|      0|        return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  894|      0|      }
  895|      0|      break;
  896|      6|    case 20:
  ------------------
  |  Branch (896:5): [True: 6, False: 311]
  ------------------
  897|      6|      if(!(m->data->state.http_neg.allowed & CURL_HTTP_V2x)) {
  ------------------
  |  |   41|      6|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  |  Branch (897:10): [True: 6, False: 0]
  ------------------
  898|      6|        DEBUGF(infof(m->data, "not reusing conn #%" CURL_FORMAT_CURL_OFF_T
  ------------------
  |  | 1067|     42|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 6, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 6]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 6]
  |  |  ------------------
  ------------------
  899|      6|                     ", we do not want h2", conn->connection_id));
  900|      6|        return FALSE;
  ------------------
  |  | 1058|      6|#define FALSE false
  ------------------
  901|      6|      }
  902|      0|      break;
  903|    311|    default:
  ------------------
  |  Branch (903:5): [True: 311, False: 6]
  ------------------
  904|    311|      if(!(m->data->state.http_neg.allowed & CURL_HTTP_V1x)) {
  ------------------
  |  |   40|    311|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
  |  Branch (904:10): [True: 0, False: 311]
  ------------------
  905|      0|        DEBUGF(infof(m->data, "not reusing conn #%" CURL_FORMAT_CURL_OFF_T
  ------------------
  |  | 1067|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [True: 0, False: 0]
  |  |  |  Branch (1067:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
  906|      0|                     ", we do not want h1", conn->connection_id));
  907|      0|        return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  908|      0|      }
  909|    311|      break;
  910|    317|    }
  911|    317|  }
  912|    416|  return TRUE;
  ------------------
  |  | 1055|    416|#define TRUE true
  ------------------
  913|    422|}
url.c:url_match_multiplex_limits:
  778|    416|{
  779|    416|  if(CONN_INUSE(conn) && m->may_multiplex) {
  ------------------
  |  |  346|    832|#define CONN_INUSE(c) (!!(c)->attached_xfers)
  |  |  ------------------
  |  |  |  Branch (346:23): [True: 0, False: 416]
  |  |  ------------------
  ------------------
  |  Branch (779:26): [True: 0, False: 0]
  ------------------
  780|      0|    DEBUGASSERT(conn->bits.multiplex);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (780:5): [True: 0, False: 0]
  |  Branch (780:5): [True: 0, False: 0]
  ------------------
  781|       |    /* If multiplexed, make sure we do not go over concurrency limit */
  782|      0|    if(conn->attached_xfers >=
  ------------------
  |  Branch (782:8): [True: 0, False: 0]
  ------------------
  783|      0|            Curl_multi_max_concurrent_streams(m->data->multi)) {
  784|      0|      infof(m->data, "client side MAX_CONCURRENT_STREAMS reached"
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  785|      0|            ", skip (%u)", conn->attached_xfers);
  786|      0|      return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  787|      0|    }
  788|      0|    if(conn->attached_xfers >=
  ------------------
  |  Branch (788:8): [True: 0, False: 0]
  ------------------
  789|      0|       Curl_conn_get_max_concurrent(m->data, conn, FIRSTSOCKET)) {
  ------------------
  |  |  303|      0|#define FIRSTSOCKET     0
  ------------------
  790|      0|      infof(m->data, "MAX_CONCURRENT_STREAMS reached, skip (%u)",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  791|      0|            conn->attached_xfers);
  792|      0|      return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  793|      0|    }
  794|       |    /* When not multiplexed, we have a match here! */
  795|      0|    infof(m->data, "Multiplexed connection found");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  796|      0|  }
  797|    416|  return TRUE;
  ------------------
  |  | 1055|    416|#define TRUE true
  ------------------
  798|    416|}
url.c:url_match_result:
 1186|  13.9k|{
 1187|  13.9k|  struct url_conn_match *match = userdata;
 1188|  13.9k|  if(match->found) {
  ------------------
  |  Branch (1188:6): [True: 109, False: 13.7k]
  ------------------
 1189|       |    /* Attach it now while still under lock, so the connection does
 1190|       |     * no longer appear idle and can be reaped. */
 1191|    109|    Curl_attach_connection(match->data, match->found);
 1192|    109|    return TRUE;
  ------------------
  |  | 1055|    109|#define TRUE true
  ------------------
 1193|    109|  }
 1194|  13.7k|  else if(match->seen_single_use_conn && !match->seen_multiplex_conn) {
  ------------------
  |  Branch (1194:11): [True: 0, False: 13.7k]
  |  Branch (1194:42): [True: 0, False: 0]
  ------------------
 1195|       |    /* We have seen a single-use, existing connection to the destination and
 1196|       |     * no multiplexed one. It seems safe to assume that the server does
 1197|       |     * not support multiplexing. */
 1198|      0|    match->wait_pipe = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1199|      0|  }
 1200|  13.7k|  else if(match->seen_pending_conn && match->data->set.pipewait) {
  ------------------
  |  Branch (1200:11): [True: 204, False: 13.5k]
  |  Branch (1200:39): [True: 204, False: 0]
  ------------------
 1201|    204|    infof(match->data,
  ------------------
  |  |  143|    204|  do {                               \
  |  |  144|    204|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    204|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 204, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 204]
  |  |  |  |  ------------------
  |  |  |  |  320|    204|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    204|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    204|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 204]
  |  |  ------------------
  ------------------
 1202|    204|          "Found pending candidate for reuse and CURLOPT_PIPEWAIT is set");
 1203|    204|    match->wait_pipe = TRUE;
  ------------------
  |  | 1055|    204|#define TRUE true
  ------------------
 1204|    204|  }
 1205|  13.7k|  match->force_reuse = FALSE;
  ------------------
  |  | 1058|  13.7k|#define FALSE false
  ------------------
 1206|       |  return FALSE;
  ------------------
  |  | 1058|  13.7k|#define FALSE false
  ------------------
 1207|  13.9k|}
url.c:url_conn_reuse_adjust:
 2531|    109|{
 2532|    109|  struct connectdata *conn = data->conn;
 2533|       |
 2534|       |  /* get the user+password information from the needle since it may
 2535|       |   * be new for this request even when we reuse conn */
 2536|    109|  if(needle->creds) {
  ------------------
  |  Branch (2536:6): [True: 18, False: 91]
  ------------------
 2537|       |    /* use the new username and password though */
 2538|     18|    Curl_creds_link(&conn->creds, needle->creds);
 2539|     18|  }
 2540|       |
 2541|    109|#ifndef CURL_DISABLE_PROXY
 2542|       |  /* use the new proxy username and proxy password though */
 2543|    109|  Curl_creds_link(&conn->http_proxy.creds, needle->http_proxy.creds);
 2544|    109|  Curl_creds_link(&conn->socks_proxy.creds, needle->socks_proxy.creds);
 2545|    109|#endif
 2546|       |
 2547|       |  /* Finding a connection for reuse in the cpool matches, among other
 2548|       |   * things on the "remote-relevant" hostname. This is not necessarily
 2549|       |   * the authority of the URL, e.g. conn->origin. For example:
 2550|       |   * - we use a proxy (not tunneling). we want to send all requests
 2551|       |   *   that use the same proxy on this connection.
 2552|       |   * - we have a "connect-to" setting that may redirect the hostname of
 2553|       |   *   a new request to the same remote endpoint of an existing conn.
 2554|       |   *   We want to reuse an existing conn to the remote endpoint.
 2555|       |   * Since connection reuse does not match on conn->origin necessarily, we
 2556|       |   * switch conn to needle's host settings.
 2557|       |   */
 2558|    109|  Curl_peer_link(&conn->origin, needle->origin);
 2559|    109|  Curl_peer_link(&conn->via_peer, needle->via_peer);
 2560|    109|  Curl_peer_link(&conn->origin2, needle->origin2);
 2561|    109|  Curl_peer_link(&conn->via_peer2, needle->via_peer2);
 2562|    109|}

urlencode_str:
  129|  16.4k|{
  130|       |  /* we must add this with whitespace-replacing */
  131|  16.4k|  const unsigned char *iptr;
  132|  16.4k|  const unsigned char *host_sep = (const unsigned char *)url;
  133|  16.4k|  CURLcode result = CURLE_OK;
  134|       |
  135|  16.4k|  DEBUGASSERT((query >= QUERY_NO) && (query <= QUERY_YES));
  ------------------
  |  | 1081|  16.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (135:3): [True: 0, False: 16.4k]
  |  Branch (135:3): [True: 0, False: 0]
  |  Branch (135:3): [True: 16.4k, False: 0]
  |  Branch (135:3): [True: 16.4k, False: 0]
  ------------------
  136|       |
  137|  16.4k|  if(!relative) {
  ------------------
  |  Branch (137:6): [True: 9, False: 16.4k]
  ------------------
  138|      9|    size_t n;
  139|      9|    host_sep = (const unsigned char *)find_host_sep(url);
  140|       |
  141|       |    /* output the first piece as-is */
  142|      9|    n = (const char *)host_sep - url;
  143|      9|    result = curlx_dyn_addn(o, url, n);
  144|      9|    len -= n;
  145|      9|  }
  146|       |
  147|   730k|  for(iptr = host_sep; len && !result; iptr++, len--) {
  ------------------
  |  Branch (147:24): [True: 713k, False: 16.4k]
  |  Branch (147:31): [True: 713k, False: 0]
  ------------------
  148|   713k|    if(*iptr == ' ') {
  ------------------
  |  Branch (148:8): [True: 4.78k, False: 709k]
  ------------------
  149|  4.78k|      if(query != QUERY_YES)
  ------------------
  |  |   54|  4.78k|#define QUERY_YES     4
  ------------------
  |  Branch (149:10): [True: 1.51k, False: 3.26k]
  ------------------
  150|  1.51k|        result = curlx_dyn_addn(o, "%20", 3);
  151|  3.26k|      else
  152|  3.26k|        result = curlx_dyn_addn(o, "+", 1);
  153|  4.78k|    }
  154|   709k|    else if((*iptr < ' ') || (*iptr >= 0x7f)) {
  ------------------
  |  Branch (154:13): [True: 7.52k, False: 701k]
  |  Branch (154:30): [True: 54.7k, False: 646k]
  ------------------
  155|  62.2k|      unsigned char out[3] = { '%' };
  156|  62.2k|      Curl_hexbyte(&out[1], *iptr);
  157|  62.2k|      result = curlx_dyn_addn(o, out, 3);
  158|  62.2k|    }
  159|   646k|    else if(*iptr == '%' && (len >= 3) &&
  ------------------
  |  Branch (159:13): [True: 110k, False: 536k]
  |  Branch (159:29): [True: 110k, False: 309]
  ------------------
  160|   110k|            ISXDIGIT(iptr[1]) && ISXDIGIT(iptr[2]) &&
  ------------------
  |  |   39|   756k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   44|   220k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 98.5k, False: 11.5k]
  |  |  |  |  |  Branch (44:38): [True: 31.0k, False: 67.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|   189k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 10.3k, False: 68.6k]
  |  |  |  |  |  Branch (27:43): [True: 7.14k, False: 3.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|  71.8k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 59.5k, False: 12.2k]
  |  |  |  |  |  Branch (28:43): [True: 54.3k, False: 5.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          ISXDIGIT(iptr[1]) && ISXDIGIT(iptr[2]) &&
  ------------------
  |  |   39|   739k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   44|   185k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 85.9k, False: 6.53k]
  |  |  |  |  |  Branch (44:38): [True: 31.1k, False: 54.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|   153k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 2.66k, False: 58.7k]
  |  |  |  |  |  Branch (27:43): [True: 916, False: 1.75k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|  60.4k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 53.7k, False: 6.73k]
  |  |  |  |  |  Branch (28:43): [True: 51.0k, False: 2.74k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  161|  83.0k|            (ISLOWER(iptr[1]) || ISLOWER(iptr[2]))) {
  ------------------
  |  |   43|   166k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 648, False: 82.3k]
  |  |  |  Branch (43:38): [True: 648, False: 0]
  |  |  ------------------
  ------------------
                          (ISLOWER(iptr[1]) || ISLOWER(iptr[2]))) {
  ------------------
  |  |   43|  82.3k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 352, False: 82.0k]
  |  |  |  Branch (43:38): [True: 352, False: 0]
  |  |  ------------------
  ------------------
  162|       |      /* uppercase it */
  163|  1.00k|      unsigned char hex = (unsigned char)((curlx_hexval(iptr[1]) << 4) |
  ------------------
  |  |  112|  1.00k|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  164|  1.00k|                                          curlx_hexval(iptr[2]));
  ------------------
  |  |  112|  1.00k|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  165|  1.00k|      unsigned char out[3] = { '%' };
  166|  1.00k|      Curl_hexbyte(&out[1], hex);
  167|  1.00k|      result = curlx_dyn_addn(o, out, 3);
  168|  1.00k|      iptr += 2;
  169|  1.00k|      len -= 2;
  170|  1.00k|    }
  171|   645k|    else {
  172|   645k|      result = curlx_dyn_addn(o, iptr, 1);
  173|   645k|      if(*iptr == '?' && (query == QUERY_NOT_YET))
  ------------------
  |  |   53|  2.19k|#define QUERY_NOT_YET 3 /* allow to change to query */
  ------------------
  |  Branch (173:10): [True: 2.19k, False: 643k]
  |  Branch (173:26): [True: 265, False: 1.92k]
  ------------------
  174|    265|        query = QUERY_YES;
  ------------------
  |  |   54|    265|#define QUERY_YES     4
  ------------------
  175|   645k|    }
  176|   713k|  }
  177|       |
  178|  16.4k|  if(result)
  ------------------
  |  Branch (178:6): [True: 0, False: 16.4k]
  ------------------
  179|      0|    return cc2cu(result);
  ------------------
  |  |  104|      0|  ((x) == CURLE_TOO_LARGE ? CURLUE_TOO_LARGE : CURLUE_OUT_OF_MEMORY)
  |  |  ------------------
  |  |  |  Branch (104:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  180|  16.4k|  return CURLUE_OK;
  181|  16.4k|}
Curl_is_absolute_url:
  193|  54.2k|{
  194|  54.2k|  size_t i = 0;
  195|  54.2k|  DEBUGASSERT(!buf || (buflen > MAX_SCHEME_LEN));
  ------------------
  |  | 1081|  54.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (195:3): [True: 54.2k, False: 0]
  |  Branch (195:3): [True: 0, False: 0]
  |  Branch (195:3): [True: 27.8k, False: 26.4k]
  |  Branch (195:3): [True: 26.4k, False: 0]
  ------------------
  196|  54.2k|  (void)buflen; /* only used in debug-builds */
  197|  54.2k|  if(buf)
  ------------------
  |  Branch (197:6): [True: 26.4k, False: 27.8k]
  ------------------
  198|  26.4k|    buf[0] = 0; /* always leave a defined value in buf */
  199|       |#ifdef _WIN32
  200|       |  if(guess_scheme && STARTS_WITH_DRIVE_PREFIX(url))
  201|       |    return 0;
  202|       |#endif
  203|  54.2k|  if(ISALPHA(url[0]))
  ------------------
  |  |   38|  54.2k|#define ISALPHA(x)  (ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   43|   108k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:22): [True: 31.8k, False: 22.4k]
  |  |  |  |  |  Branch (43:38): [True: 31.7k, False: 127]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALPHA(x)  (ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   42|  22.5k|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 3.25k, False: 19.2k]
  |  |  |  |  |  Branch (42:38): [True: 2.95k, False: 302]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  204|   129k|    for(i = 1; i < MAX_SCHEME_LEN; ++i) {
  ------------------
  |  |   55|   129k|#define MAX_SCHEME_LEN 40
  ------------------
  |  Branch (204:16): [True: 129k, False: 63]
  ------------------
  205|   129k|      char s = url[i];
  206|   129k|      if(s && (ISALNUM(s) || (s == '+') || (s == '-') || (s == '.'))) {
  ------------------
  |  |   41|   240k|#define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   44|   240k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 105k, False: 14.9k]
  |  |  |  |  |  Branch (44:38): [True: 3.12k, False: 102k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   43|   237k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (43:22): [True: 61.2k, False: 56.0k]
  |  |  |  |  |  Branch (43:38): [True: 61.2k, False: 43]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   42|  56.0k|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 18.0k, False: 38.0k]
  |  |  |  |  |  Branch (42:38): [True: 17.9k, False: 183]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (206:10): [True: 120k, False: 8.54k]
  |  Branch (206:30): [True: 234, False: 37.9k]
  |  Branch (206:44): [True: 312, False: 37.6k]
  |  Branch (206:58): [True: 11.5k, False: 26.0k]
  ------------------
  207|       |        /* RFC 3986 3.1 explains:
  208|       |           scheme      = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
  209|       |        */
  210|  94.4k|      }
  211|  34.6k|      else {
  212|  34.6k|        break;
  213|  34.6k|      }
  214|   129k|    }
  215|  54.2k|  if(i && (url[i] == ':') && ((url[i + 1] == '/') || !guess_scheme)) {
  ------------------
  |  Branch (215:6): [True: 34.6k, False: 19.5k]
  |  Branch (215:11): [True: 22.8k, False: 11.8k]
  |  Branch (215:31): [True: 22.5k, False: 311]
  |  Branch (215:54): [True: 13, False: 298]
  ------------------
  216|       |    /* If this does not guess scheme, the scheme always ends with the colon so
  217|       |       that this also detects data: URLs etc. In guessing mode, data: could
  218|       |       be the hostname "data" with a specified port number. */
  219|       |
  220|       |    /* the length of the scheme is the name part only */
  221|  22.5k|    size_t len = i;
  222|  22.5k|    if(buf) {
  ------------------
  |  Branch (222:8): [True: 11.4k, False: 11.1k]
  ------------------
  223|  11.4k|      Curl_strntolower(buf, url, i);
  224|  11.4k|      buf[i] = 0;
  225|  11.4k|    }
  226|  22.5k|    return len;
  227|  22.5k|  }
  228|  31.7k|  return 0;
  229|  54.2k|}
Curl_junkscan:
  233|  26.4k|{
  234|  26.4k|  size_t n = strlen(url);
  235|  26.4k|  size_t i;
  236|  26.4k|  unsigned char control;
  237|  26.4k|  const unsigned char *p = (const unsigned char *)url;
  238|  26.4k|  if(n > CURL_MAX_INPUT_LENGTH)
  ------------------
  |  |   45|  26.4k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (238:6): [True: 0, False: 26.4k]
  ------------------
  239|      0|    return CURLUE_MALFORMED_INPUT;
  240|       |
  241|  26.4k|  control = allowspace ? 0x1f : 0x20;
  ------------------
  |  Branch (241:13): [True: 1.80k, False: 24.6k]
  ------------------
  242|  15.2M|  for(i = 0; i < n; i++) {
  ------------------
  |  Branch (242:14): [True: 15.2M, False: 26.4k]
  ------------------
  243|  15.2M|    if(p[i] <= control || p[i] == 127)
  ------------------
  |  Branch (243:8): [True: 26, False: 15.2M]
  |  Branch (243:27): [True: 7, False: 15.2M]
  ------------------
  244|     33|      return CURLUE_MALFORMED_INPUT;
  245|  15.2M|  }
  246|  26.4k|  *urllen = n;
  247|  26.4k|  return CURLUE_OK;
  248|  26.4k|}
parse_port:
  349|  26.3k|{
  350|  26.3k|  const char *portptr;
  351|  26.3k|  const char *hostname = curlx_dyn_ptr(host);
  352|       |  /*
  353|       |   * Find the end of an IPv6 address on the ']' ending bracket.
  354|       |   */
  355|  26.3k|  if(hostname[0] == '[') {
  ------------------
  |  Branch (355:6): [True: 190, False: 26.1k]
  ------------------
  356|    190|    portptr = strchr(hostname, ']');
  357|    190|    if(!portptr)
  ------------------
  |  Branch (357:8): [True: 3, False: 187]
  ------------------
  358|      3|      return CURLUE_BAD_IPV6;
  359|    187|    portptr++;
  360|       |    /* this is a RFC2732-style specified IP-address */
  361|    187|    if(*portptr) {
  ------------------
  |  Branch (361:8): [True: 7, False: 180]
  ------------------
  362|      7|      if(*portptr != ':')
  ------------------
  |  Branch (362:10): [True: 4, False: 3]
  ------------------
  363|      4|        return CURLUE_BAD_PORT_NUMBER;
  364|      7|    }
  365|    180|    else
  366|    180|      portptr = NULL;
  367|    187|  }
  368|  26.1k|  else
  369|  26.1k|    portptr = strchr(hostname, ':');
  370|       |
  371|  26.2k|  if(portptr) {
  ------------------
  |  Branch (371:6): [True: 1.58k, False: 24.7k]
  ------------------
  372|  1.58k|    curl_off_t port;
  373|  1.58k|    size_t keep = portptr - hostname;
  374|       |
  375|       |    /* Browser behavior adaptation. If there is a colon with no digits after,
  376|       |       cut off the name there which makes us ignore the colon and use the
  377|       |       default port. Firefox, Chrome and Safari all do that.
  378|       |
  379|       |       Do not do it if the URL has no scheme, to make something that looks like
  380|       |       a scheme not work!
  381|       |    */
  382|  1.58k|    curlx_dyn_setlen(host, keep);
  383|  1.58k|    portptr++;
  384|  1.58k|    if(!*portptr)
  ------------------
  |  Branch (384:8): [True: 923, False: 666]
  ------------------
  385|    923|      return has_scheme ? CURLUE_OK : CURLUE_BAD_PORT_NUMBER;
  ------------------
  |  Branch (385:14): [True: 883, False: 40]
  ------------------
  386|       |
  387|    666|    if(curlx_str_number(&portptr, &port, 0xffff) || *portptr)
  ------------------
  |  Branch (387:8): [True: 29, False: 637]
  |  Branch (387:53): [True: 6, False: 631]
  ------------------
  388|     35|      return CURLUE_BAD_PORT_NUMBER;
  389|       |
  390|    631|    u->portnum = (unsigned short)port;
  391|       |    /* generate a new port number string to get rid of leading zeroes etc */
  392|    631|    curlx_free(u->port);
  ------------------
  |  | 1483|    631|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  393|    631|    u->port = curl_maprintf("%" CURL_FORMAT_CURL_OFF_T, port);
  ------------------
  |  |  341|    631|#    define CURL_FORMAT_CURL_OFF_T     "ld"
  ------------------
  394|    631|    if(!u->port)
  ------------------
  |  Branch (394:8): [True: 0, False: 631]
  ------------------
  395|      0|      return CURLUE_OUT_OF_MEMORY;
  396|    631|  }
  397|       |
  398|  25.3k|  return CURLUE_OK;
  399|  26.2k|}
ipv6_parse:
  410|    209|{
  411|    209|  size_t len;
  412|    209|  DEBUGASSERT(*hostname == '[');
  ------------------
  |  | 1081|    209|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (412:3): [True: 0, False: 209]
  |  Branch (412:3): [True: 209, False: 0]
  ------------------
  413|    209|  if(hlen < 4) /* '[::]' is the shortest possible valid string */
  ------------------
  |  Branch (413:6): [True: 6, False: 203]
  ------------------
  414|      6|    return CURLUE_BAD_IPV6;
  415|    203|  hostname++;
  416|    203|  hlen -= 2;
  417|       |
  418|       |  /* only valid IPv6 letters are ok */
  419|    203|  len = strspn(hostname, "0123456789abcdefABCDEF:.");
  420|       |
  421|    203|  if(hlen != len) {
  ------------------
  |  Branch (421:6): [True: 160, False: 43]
  ------------------
  422|    160|    hlen = len;
  423|    160|    if(hostname[len] == '%') {
  ------------------
  |  Branch (423:8): [True: 156, False: 4]
  ------------------
  424|       |      /* this could now be '%[zone id]' */
  425|    156|      char zoneid[16];
  426|    156|      int i = 0;
  427|    156|      char *h = &hostname[len + 1];
  428|       |      /* pass '25' if present and is a URL encoded percent sign */
  429|    156|      if(!strncmp(h, "25", 2) && h[2] && (h[2] != ']'))
  ------------------
  |  Branch (429:10): [True: 20, False: 136]
  |  Branch (429:34): [True: 17, False: 3]
  |  Branch (429:42): [True: 9, False: 8]
  ------------------
  430|      9|        h += 2;
  431|  1.55k|      while(*h && (*h != ']') && (i < 15))
  ------------------
  |  Branch (431:13): [True: 1.53k, False: 14]
  |  Branch (431:19): [True: 1.40k, False: 131]
  |  Branch (431:34): [True: 1.39k, False: 11]
  ------------------
  432|  1.39k|        zoneid[i++] = *h++;
  433|    156|      if(!i || (']' != *h))
  ------------------
  |  Branch (433:10): [True: 3, False: 153]
  |  Branch (433:16): [True: 25, False: 128]
  ------------------
  434|     28|        return CURLUE_BAD_IPV6;
  435|    128|      zoneid[i] = 0;
  436|    128|      u->zoneid = curlx_strdup(zoneid);
  ------------------
  |  | 1477|    128|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  437|    128|      if(!u->zoneid)
  ------------------
  |  Branch (437:10): [True: 0, False: 128]
  ------------------
  438|      0|        return CURLUE_OUT_OF_MEMORY;
  439|    128|      hostname[len] = ']'; /* insert end bracket */
  440|    128|      hostname[len + 1] = 0; /* terminate the hostname */
  441|    128|    }
  442|      4|    else
  443|      4|      return CURLUE_BAD_IPV6;
  444|       |    /* hostname is fine */
  445|    160|  }
  446|       |
  447|       |  /* Normalize the IPv6 address */
  448|    171|  {
  449|    171|    char dest[16]; /* fits a binary IPv6 address */
  450|    171|    hostname[hlen] = 0; /* end the address there */
  451|    171|    if(curlx_inet_pton(AF_INET6, hostname, dest) != 1)
  ------------------
  |  |   43|    171|  inet_pton(x, y, z)
  ------------------
  |  Branch (451:8): [True: 14, False: 157]
  ------------------
  452|     14|      return CURLUE_BAD_IPV6;
  453|    157|    if(curlx_inet_ntop(AF_INET6, dest, hostname, hlen + 1)) {
  ------------------
  |  |   44|    157|  inet_ntop(af, src, buf, (curl_socklen_t)(size))
  |  |  ------------------
  |  |  |  Branch (44:3): [True: 140, False: 17]
  |  |  ------------------
  ------------------
  454|    140|      hlen = strlen(hostname); /* might be shorter now */
  455|    140|      hostname[hlen + 1] = 0;
  456|    140|    }
  457|    157|    hostname[hlen] = ']'; /* restore ending bracket */
  458|    157|  }
  459|      0|  return CURLUE_OK;
  460|    171|}
ipv4_normalize:
  509|  26.1k|{
  510|  26.1k|  bool done = FALSE;
  ------------------
  |  | 1058|  26.1k|#define FALSE false
  ------------------
  511|  26.1k|  int n = 0;
  512|  26.1k|  const char *c = curlx_dyn_ptr(host);
  513|  26.1k|  unsigned int parts[4] = { 0, 0, 0, 0 };
  514|  26.1k|  CURLcode result = CURLE_OK;
  515|       |
  516|  26.1k|  if(*c == '[')
  ------------------
  |  Branch (516:6): [True: 180, False: 26.0k]
  ------------------
  517|    180|    return HOST_IPV6;
  ------------------
  |  |   50|    180|#define HOST_IPV6    3
  ------------------
  518|       |
  519|  46.7k|  while(!done) {
  ------------------
  |  Branch (519:9): [True: 31.7k, False: 15.0k]
  ------------------
  520|  31.7k|    int rc;
  521|  31.7k|    curl_off_t l;
  522|  31.7k|    if(*c == '0') {
  ------------------
  |  Branch (522:8): [True: 8.71k, False: 23.0k]
  ------------------
  523|  8.71k|      if(c[1] == 'x') {
  ------------------
  |  Branch (523:10): [True: 56, False: 8.65k]
  ------------------
  524|     56|        c += 2; /* skip the prefix */
  525|     56|        rc = curlx_str_hex(&c, &l, UINT_MAX);
  526|     56|        if(rc)
  ------------------
  |  Branch (526:12): [True: 43, False: 13]
  ------------------
  527|     43|          return HOST_NAME;
  ------------------
  |  |   48|     43|#define HOST_NAME    1
  ------------------
  528|     56|      }
  529|  8.65k|      else
  530|  8.65k|        rc = curlx_str_octal(&c, &l, UINT_MAX);
  531|  8.71k|    }
  532|  23.0k|    else
  533|  23.0k|      rc = curlx_str_number(&c, &l, UINT_MAX);
  534|       |
  535|  31.6k|    if(rc) {
  ------------------
  |  Branch (535:8): [True: 10.1k, False: 21.4k]
  ------------------
  536|  10.1k|      if(!n || (rc != STRE_NO_NUM) || *c)
  ------------------
  |  |   36|    114|#define STRE_NO_NUM   8
  ------------------
  |  Branch (536:10): [True: 10.0k, False: 114]
  |  Branch (536:16): [True: 11, False: 103]
  |  Branch (536:39): [True: 62, False: 41]
  ------------------
  537|  10.1k|        return HOST_NAME;
  ------------------
  |  |   48|  10.1k|#define HOST_NAME    1
  ------------------
  538|     41|      n--;
  539|     41|    }
  540|  21.4k|    else
  541|  21.4k|      parts[n] = (unsigned int)l;
  542|       |
  543|  21.5k|    switch(*c) {
  544|  5.74k|    case '.':
  ------------------
  |  Branch (544:5): [True: 5.74k, False: 15.7k]
  ------------------
  545|  5.74k|      if(n == 3) {
  ------------------
  |  Branch (545:10): [True: 28, False: 5.71k]
  ------------------
  546|     28|        if(c[1])
  ------------------
  |  Branch (546:12): [True: 16, False: 12]
  ------------------
  547|       |          /* something follows this dot */
  548|     16|          return HOST_NAME;
  ------------------
  |  |   48|     16|#define HOST_NAME    1
  ------------------
  549|     12|        done = TRUE;
  ------------------
  |  | 1055|     12|#define TRUE true
  ------------------
  550|     12|      }
  551|  5.71k|      else {
  552|  5.71k|        n++;
  553|  5.71k|        c++;
  554|  5.71k|      }
  555|  5.72k|      break;
  556|       |
  557|  15.0k|    case '\0':
  ------------------
  |  Branch (557:5): [True: 15.0k, False: 6.52k]
  ------------------
  558|  15.0k|      done = TRUE;
  ------------------
  |  | 1055|  15.0k|#define TRUE true
  ------------------
  559|  15.0k|      break;
  560|       |
  561|    783|    default:
  ------------------
  |  Branch (561:5): [True: 783, False: 20.7k]
  ------------------
  562|    783|      return HOST_NAME;
  ------------------
  |  |   48|    783|#define HOST_NAME    1
  ------------------
  563|  21.5k|    }
  564|  21.5k|  }
  565|       |
  566|  15.0k|  switch(n) {
  ------------------
  |  Branch (566:10): [True: 15.0k, False: 0]
  ------------------
  567|  12.9k|  case 0: /* a -- 32 bits */
  ------------------
  |  Branch (567:3): [True: 12.9k, False: 2.02k]
  ------------------
  568|  12.9k|    curlx_dyn_reset(host);
  569|       |
  570|  12.9k|    result = curlx_dyn_addf(host, "%u.%u.%u.%u",
  571|  12.9k|                            (parts[0] >> 24),
  572|  12.9k|                            ((parts[0] >> 16) & 0xff),
  573|  12.9k|                            ((parts[0] >> 8) & 0xff),
  574|  12.9k|                            (parts[0] & 0xff));
  575|  12.9k|    break;
  576|    250|  case 1: /* a.b -- 8.24 bits */
  ------------------
  |  Branch (576:3): [True: 250, False: 14.7k]
  ------------------
  577|    250|    if((parts[0] > 0xff) || (parts[1] > 0xffffff))
  ------------------
  |  Branch (577:8): [True: 44, False: 206]
  |  Branch (577:29): [True: 19, False: 187]
  ------------------
  578|     63|      return HOST_NAME;
  ------------------
  |  |   48|     63|#define HOST_NAME    1
  ------------------
  579|    187|    curlx_dyn_reset(host);
  580|    187|    result = curlx_dyn_addf(host, "%u.%u.%u.%u",
  581|    187|                            (parts[0]),
  582|    187|                            ((parts[1] >> 16) & 0xff),
  583|    187|                            ((parts[1] >> 8) & 0xff),
  584|    187|                            (parts[1] & 0xff));
  585|    187|    break;
  586|    246|  case 2: /* a.b.c -- 8.8.16 bits */
  ------------------
  |  Branch (586:3): [True: 246, False: 14.7k]
  ------------------
  587|    246|    if((parts[0] > 0xff) || (parts[1] > 0xff) || (parts[2] > 0xffff))
  ------------------
  |  Branch (587:8): [True: 73, False: 173]
  |  Branch (587:29): [True: 37, False: 136]
  |  Branch (587:50): [True: 32, False: 104]
  ------------------
  588|    142|      return HOST_NAME;
  ------------------
  |  |   48|    142|#define HOST_NAME    1
  ------------------
  589|    104|    curlx_dyn_reset(host);
  590|    104|    result = curlx_dyn_addf(host, "%u.%u.%u.%u",
  591|    104|                            (parts[0]),
  592|    104|                            (parts[1]),
  593|    104|                            ((parts[2] >> 8) & 0xff),
  594|    104|                            (parts[2] & 0xff));
  595|    104|    break;
  596|  1.53k|  case 3: /* a.b.c.d -- 8.8.8.8 bits */
  ------------------
  |  Branch (596:3): [True: 1.53k, False: 13.4k]
  ------------------
  597|  1.53k|    if((parts[0] > 0xff) || (parts[1] > 0xff) || (parts[2] > 0xff) ||
  ------------------
  |  Branch (597:8): [True: 42, False: 1.48k]
  |  Branch (597:29): [True: 39, False: 1.44k]
  |  Branch (597:50): [True: 38, False: 1.41k]
  ------------------
  598|  1.41k|       (parts[3] > 0xff))
  ------------------
  |  Branch (598:8): [True: 44, False: 1.36k]
  ------------------
  599|    163|      return HOST_NAME;
  ------------------
  |  |   48|    163|#define HOST_NAME    1
  ------------------
  600|  1.36k|    curlx_dyn_reset(host);
  601|  1.36k|    result = curlx_dyn_addf(host, "%u.%u.%u.%u",
  602|  1.36k|                            (parts[0]),
  603|  1.36k|                            (parts[1]),
  604|  1.36k|                            (parts[2]),
  605|  1.36k|                            (parts[3]));
  606|  1.36k|    break;
  607|  15.0k|  }
  608|  14.6k|  if(result)
  ------------------
  |  Branch (608:6): [True: 0, False: 14.6k]
  ------------------
  609|      0|    return HOST_ERROR;
  ------------------
  |  |   47|      0|#define HOST_ERROR   (-1) /* out of memory */
  ------------------
  610|  14.6k|  return HOST_IPV4;
  ------------------
  |  |   49|  14.6k|#define HOST_IPV4    2
  ------------------
  611|  14.6k|}
dedotdotify:
  754|  5.49k|{
  755|  5.49k|  struct dynbuf out;
  756|  5.49k|  CURLcode result = CURLE_OK;
  757|       |
  758|       |  /* variables for leading dot checks */
  759|  5.49k|  const char *dinput = input;
  760|  5.49k|  size_t dlen = clen;
  761|       |
  762|  5.49k|  *outp = NULL;
  763|       |  /* a single byte path cannot be cleaned up */
  764|  5.49k|  if(clen < 2)
  ------------------
  |  Branch (764:6): [True: 9, False: 5.48k]
  ------------------
  765|      9|    return 0;
  766|       |
  767|  5.48k|  curlx_dyn_init(&out, clen + 1);
  768|       |
  769|       |  /* if the input buffer begins with a prefix of "../" or "./", then remove
  770|       |     that prefix from the input buffer; otherwise, */
  771|  5.48k|  if(is_dot(&dinput, &dlen)) {
  ------------------
  |  Branch (771:6): [True: 0, False: 5.48k]
  ------------------
  772|      0|    if(ISSLASH(*dinput)) {
  ------------------
  |  |  735|      0|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (735:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  773|       |      /* one dot followed by a slash */
  774|      0|      input = dinput + 1;
  775|      0|      clen = dlen - 1;
  776|      0|    }
  777|       |
  778|       |    /* if the input buffer consists only of "." or "..", then remove
  779|       |       that from the input buffer; otherwise, */
  780|      0|    else if(is_dot(&dinput, &dlen)) {
  ------------------
  |  Branch (780:13): [True: 0, False: 0]
  ------------------
  781|      0|      if(!dlen)
  ------------------
  |  Branch (781:10): [True: 0, False: 0]
  ------------------
  782|       |        /* .. [end] */
  783|      0|        goto end;
  784|      0|      else if(ISSLASH(*dinput)) {
  ------------------
  |  |  735|      0|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (735:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  785|       |        /* ../ */
  786|      0|        input = dinput + 1;
  787|      0|        clen = dlen - 1;
  788|      0|      }
  789|      0|    }
  790|      0|  }
  791|       |
  792|  6.10M|  while(clen && !result) { /* until end of path content */
  ------------------
  |  Branch (792:9): [True: 6.09M, False: 5.44k]
  |  Branch (792:17): [True: 6.09M, False: 0]
  ------------------
  793|  6.09M|    if(ISSLASH(*input)) {
  ------------------
  |  |  735|  6.09M|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (735:20): [True: 35.2k, False: 6.06M]
  |  |  ------------------
  ------------------
  794|  35.2k|      const char *p = &input[1];
  795|  35.2k|      size_t blen = clen - 1;
  796|       |      /* if the input buffer begins with a prefix of "/./" or "/.", where "."
  797|       |         is a complete path segment, then replace that prefix with "/" in the
  798|       |         input buffer; otherwise, */
  799|  35.2k|      if(is_dot(&p, &blen)) {
  ------------------
  |  Branch (799:10): [True: 7.96k, False: 27.2k]
  ------------------
  800|  7.96k|        if(!blen) { /* /. */
  ------------------
  |  Branch (800:12): [True: 21, False: 7.94k]
  ------------------
  801|     21|          result = curlx_dyn_addn(&out, "/", 1);
  802|     21|          break;
  803|     21|        }
  804|  7.94k|        else if(ISSLASH(*p)) { /* /./ */
  ------------------
  |  |  735|  7.94k|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (735:20): [True: 3.77k, False: 4.17k]
  |  |  ------------------
  ------------------
  805|  3.77k|          input = p;
  806|  3.77k|          clen = blen;
  807|  3.77k|          continue;
  808|  3.77k|        }
  809|       |
  810|       |        /* if the input buffer begins with a prefix of "/../" or "/..", where
  811|       |           ".." is a complete path segment, then replace that prefix with "/"
  812|       |           in the input buffer and remove the last segment and its preceding
  813|       |           "/" (if any) from the output buffer; otherwise, */
  814|  4.17k|        else if(is_dot(&p, &blen) && (ISSLASH(*p) || !blen)) {
  ------------------
  |  |  735|  4.53k|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (735:20): [True: 1.27k, False: 998]
  |  |  ------------------
  ------------------
  |  Branch (814:17): [True: 2.26k, False: 1.90k]
  |  Branch (814:54): [True: 23, False: 975]
  ------------------
  815|       |          /* remove the last segment from the output buffer */
  816|  1.29k|          size_t len = curlx_dyn_len(&out);
  817|  1.29k|          if(len) {
  ------------------
  |  Branch (817:14): [True: 1.15k, False: 143]
  ------------------
  818|  1.15k|            const char *ptr = curlx_dyn_ptr(&out);
  819|  1.15k|            const char *last = memrchr(ptr, '/', len);
  820|  1.15k|            if(last)
  ------------------
  |  Branch (820:16): [True: 1.15k, False: 0]
  ------------------
  821|       |              /* trim the output at the slash */
  822|  1.15k|              curlx_dyn_setlen(&out, last - ptr);
  823|  1.15k|          }
  824|       |
  825|  1.29k|          if(blen) { /* /../ */
  ------------------
  |  Branch (825:14): [True: 1.27k, False: 23]
  ------------------
  826|  1.27k|            input = p;
  827|  1.27k|            clen = blen;
  828|  1.27k|            continue;
  829|  1.27k|          }
  830|     23|          result = curlx_dyn_addn(&out, "/", 1);
  831|     23|          break;
  832|  1.29k|        }
  833|  7.96k|      }
  834|  35.2k|    }
  835|       |
  836|       |    /* move the first path segment in the input buffer to the end of the
  837|       |       output buffer, including the initial "/" character (if any) and any
  838|       |       subsequent characters up to, but not including, the next "/" character
  839|       |       or the end of the input buffer. */
  840|       |
  841|  6.09M|    result = curlx_dyn_addn(&out, input, 1);
  842|  6.09M|    input++;
  843|  6.09M|    clen--;
  844|  6.09M|  }
  845|  5.48k|end:
  846|  5.48k|  if(!result) {
  ------------------
  |  Branch (846:6): [True: 5.48k, False: 0]
  ------------------
  847|  5.48k|    if(curlx_dyn_len(&out))
  ------------------
  |  Branch (847:8): [True: 5.48k, False: 0]
  ------------------
  848|  5.48k|      *outp = curlx_dyn_ptr(&out);
  849|      0|    else {
  850|      0|      *outp = curlx_strdup("");
  ------------------
  |  | 1477|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  851|      0|      if(!*outp)
  ------------------
  |  Branch (851:10): [True: 0, False: 0]
  ------------------
  852|      0|        return 1;
  853|      0|    }
  854|  5.48k|  }
  855|  5.48k|  return result ? 1 : 0; /* success */
  ------------------
  |  Branch (855:10): [True: 0, False: 5.48k]
  ------------------
  856|  5.48k|}
parse_file:
  865|     69|{
  866|     69|  const char *path;
  867|     69|  size_t pathlen;
  868|       |
  869|     69|  *pathp = NULL;
  870|     69|  *pathlenp = 0;
  871|     69|  if(urllen <= 6)
  ------------------
  |  Branch (871:6): [True: 5, False: 64]
  ------------------
  872|       |    /* file:/ is not enough to actually be a complete file: URL */
  873|      5|    return CURLUE_BAD_FILE_URL;
  874|       |
  875|       |  /* path has been allocated large enough to hold this */
  876|     64|  path = &url[5];
  877|     64|  pathlen = urllen - 5;
  878|       |
  879|       |  /* RFC 8089: file-hier-part = ( "//" auth-path ) / local-path, where
  880|       |     local-path also starts with a "/". So reject anything that doesn't
  881|       |     start with at least one "/" */
  882|     64|  if(path[0] != '/')
  ------------------
  |  Branch (882:6): [True: 0, False: 64]
  ------------------
  883|      0|    return CURLUE_BAD_FILE_URL;
  884|       |
  885|       |  /* Extra handling URLs with an authority component (i.e. that start with
  886|       |   * "file://")
  887|       |   *
  888|       |   * We allow omitted hostname (e.g. file:/<path>) -- valid according to
  889|       |   * RFC 8089, but not the (current) WHAT-WG URL spec.
  890|       |   */
  891|     64|  if(path[1] == '/') {
  ------------------
  |  Branch (891:6): [True: 35, False: 29]
  ------------------
  892|       |    /* swallow the two slashes */
  893|     35|    const char *ptr = &path[2];
  894|       |
  895|       |    /*
  896|       |     * According to RFC 8089, a file: URL can be reliably dereferenced if:
  897|       |     *
  898|       |     *  o it has no/blank hostname, or
  899|       |     *
  900|       |     *  o the hostname matches "localhost" (case-insensitively), or
  901|       |     *
  902|       |     *  o the hostname is a FQDN that resolves to this machine, or
  903|       |     *
  904|       |     * For brevity, we only consider URLs with empty, "localhost", or
  905|       |     * "127.0.0.1" hostnames as local, otherwise as an UNC String.
  906|       |     *
  907|       |     * Additionally, there is an exception for URLs with a Windows drive
  908|       |     * letter in the authority (which was accidentally omitted from RFC 8089
  909|       |     * Appendix E, but believe me, it was meant to be there. --MK)
  910|       |     */
  911|     35|    if(ptr[0] != '/' && !STARTS_WITH_URL_DRIVE_PREFIX(ptr)) {
  ------------------
  |  |   49|     32|  ((('a' <= (str)[0] && (str)[0] <= 'z') ||                \
  |  |  ------------------
  |  |  |  Branch (49:6): [True: 11, False: 21]
  |  |  |  Branch (49:25): [True: 8, False: 3]
  |  |  ------------------
  |  |   50|     32|    ('A' <= (str)[0] && (str)[0] <= 'Z')) &&               \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 18, False: 6]
  |  |  |  Branch (50:25): [True: 15, False: 3]
  |  |  ------------------
  |  |   51|     32|   ((str)[1] == ':' || (str)[1] == '|') &&                 \
  |  |  ------------------
  |  |  |  Branch (51:5): [True: 14, False: 9]
  |  |  |  Branch (51:24): [True: 3, False: 6]
  |  |  ------------------
  |  |   52|     32|   ((str)[2] == '/' || (str)[2] == '\\' || (str)[2] == 0))
  |  |  ------------------
  |  |  |  Branch (52:5): [True: 3, False: 14]
  |  |  |  Branch (52:24): [True: 3, False: 11]
  |  |  |  Branch (52:44): [True: 6, False: 5]
  |  |  ------------------
  ------------------
  |  Branch (911:8): [True: 32, False: 3]
  ------------------
  912|       |      /* the URL includes a hostname, it must match "localhost" or
  913|       |         "127.0.0.1" to be valid */
  914|     20|      if(checkprefix("localhost/", ptr) ||
  ------------------
  |  |   33|     40|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1292|     20|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |  |  Branch (33:27): [True: 1, False: 19]
  |  |  ------------------
  ------------------
  915|     19|         checkprefix("127.0.0.1/", ptr)) {
  ------------------
  |  |   33|     19|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1292|     19|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |  |  Branch (33:27): [True: 1, False: 18]
  |  |  ------------------
  ------------------
  916|      2|        ptr += 9; /* now points to the slash after the host */
  917|      2|      }
  918|     18|      else
  919|       |        /* Invalid file://hostname/, expected localhost or 127.0.0.1 or
  920|       |           none */
  921|     18|        return CURLUE_BAD_FILE_URL;
  922|     20|    }
  923|       |
  924|     17|    path = ptr;
  925|     17|    pathlen = urllen - (ptr - url);
  926|     17|  }
  927|       |
  928|     46|#if !defined(_WIN32) && !defined(MSDOS) && !defined(__CYGWIN__)
  929|       |  /* Do not allow Windows drive letters when not in Windows.
  930|       |   * This catches both "file:/c:" and "file:c:" */
  931|     46|  if(('/' == path[0] && STARTS_WITH_URL_DRIVE_PREFIX(&path[1])) ||
  ------------------
  |  |   49|     34|  ((('a' <= (str)[0] && (str)[0] <= 'z') ||                \
  |  |  ------------------
  |  |  |  Branch (49:6): [True: 13, False: 21]
  |  |  |  Branch (49:25): [True: 10, False: 3]
  |  |  ------------------
  |  |   50|     34|    ('A' <= (str)[0] && (str)[0] <= 'Z')) &&               \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 12, False: 12]
  |  |  |  Branch (50:25): [True: 9, False: 3]
  |  |  ------------------
  |  |   51|     34|   ((str)[1] == ':' || (str)[1] == '|') &&                 \
  |  |  ------------------
  |  |  |  Branch (51:5): [True: 8, False: 11]
  |  |  |  Branch (51:24): [True: 3, False: 8]
  |  |  ------------------
  |  |   52|     34|   ((str)[2] == '/' || (str)[2] == '\\' || (str)[2] == 0))
  |  |  ------------------
  |  |  |  Branch (52:5): [True: 4, False: 7]
  |  |  |  Branch (52:24): [True: 1, False: 6]
  |  |  |  Branch (52:44): [True: 3, False: 3]
  |  |  ------------------
  ------------------
  |  Branch (931:7): [True: 34, False: 12]
  ------------------
  932|     38|     STARTS_WITH_URL_DRIVE_PREFIX(path)) {
  ------------------
  |  |   49|     38|  ((('a' <= (str)[0] && (str)[0] <= 'z') ||                \
  |  |  ------------------
  |  |  |  Branch (49:6): [True: 5, False: 33]
  |  |  |  Branch (49:25): [True: 5, False: 0]
  |  |  ------------------
  |  |   50|     38|    ('A' <= (str)[0] && (str)[0] <= 'Z')) &&               \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 7, False: 26]
  |  |  |  Branch (50:25): [True: 7, False: 0]
  |  |  ------------------
  |  |   51|     38|   ((str)[1] == ':' || (str)[1] == '|') &&                 \
  |  |  ------------------
  |  |  |  Branch (51:5): [True: 9, False: 3]
  |  |  |  Branch (51:24): [True: 3, False: 0]
  |  |  ------------------
  |  |   52|     38|   ((str)[2] == '/' || (str)[2] == '\\' || (str)[2] == 0))
  |  |  ------------------
  |  |  |  Branch (52:5): [True: 3, False: 9]
  |  |  |  Branch (52:24): [True: 3, False: 6]
  |  |  |  Branch (52:44): [True: 6, False: 0]
  |  |  ------------------
  ------------------
  933|       |    /* File drive letters are only accepted in MS-DOS/Windows */
  934|     20|    return CURLUE_BAD_FILE_URL;
  935|     20|  }
  936|       |#else
  937|       |  /* If the path starts with a slash and a drive letter, ditch the slash */
  938|       |  if('/' == path[0] && STARTS_WITH_URL_DRIVE_PREFIX(&path[1])) {
  939|       |    /* This cannot be done with strcpy, as the memory chunks overlap! */
  940|       |    path++;
  941|       |    pathlen--;
  942|       |  }
  943|       |#endif
  944|     26|  u->scheme = curlx_strdup("file");
  ------------------
  |  | 1477|     26|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  945|     26|  if(!u->scheme)
  ------------------
  |  Branch (945:6): [True: 0, False: 26]
  ------------------
  946|      0|    return CURLUE_OUT_OF_MEMORY;
  947|       |
  948|     26|  *pathp = path;
  949|     26|  *pathlenp = pathlen;
  950|     26|  return CURLUE_OK;
  951|     26|}
curl_url:
 1312|  25.7k|{
 1313|  25.7k|  return curlx_calloc(1, sizeof(struct Curl_URL));
  ------------------
  |  | 1480|  25.7k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1314|  25.7k|}
curl_url_cleanup:
 1317|  66.9k|{
 1318|  66.9k|  if(u) {
  ------------------
  |  Branch (1318:6): [True: 25.8k, False: 41.0k]
  ------------------
 1319|  25.8k|    free_urlhandle(u);
 1320|  25.8k|    curlx_free(u);
  ------------------
  |  | 1483|  25.8k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1321|  25.8k|  }
 1322|  66.9k|}
curl_url_dup:
 1334|    126|{
 1335|    126|  struct Curl_URL *u = curlx_calloc(1, sizeof(struct Curl_URL));
  ------------------
  |  | 1480|    126|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1336|    126|  if(u) {
  ------------------
  |  Branch (1336:6): [True: 126, False: 0]
  ------------------
 1337|    126|    DUP(u, in, scheme);
  ------------------
  |  | 1325|    126|  do {                                          \
  |  | 1326|    126|    if((src)->name) {                           \
  |  |  ------------------
  |  |  |  Branch (1326:8): [True: 126, False: 0]
  |  |  ------------------
  |  | 1327|    126|      (dest)->name = curlx_strdup((src)->name); \
  |  |  ------------------
  |  |  |  | 1477|    126|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1328|    126|      if(!(dest)->name)                         \
  |  |  ------------------
  |  |  |  Branch (1328:10): [True: 0, False: 126]
  |  |  ------------------
  |  | 1329|    126|        goto fail;                              \
  |  | 1330|    126|    }                                           \
  |  | 1331|    126|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1331:11): [Folded, False: 126]
  |  |  ------------------
  ------------------
 1338|    126|    DUP(u, in, user);
  ------------------
  |  | 1325|    126|  do {                                          \
  |  | 1326|    126|    if((src)->name) {                           \
  |  |  ------------------
  |  |  |  Branch (1326:8): [True: 1, False: 125]
  |  |  ------------------
  |  | 1327|      1|      (dest)->name = curlx_strdup((src)->name); \
  |  |  ------------------
  |  |  |  | 1477|      1|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1328|      1|      if(!(dest)->name)                         \
  |  |  ------------------
  |  |  |  Branch (1328:10): [True: 0, False: 1]
  |  |  ------------------
  |  | 1329|      1|        goto fail;                              \
  |  | 1330|      1|    }                                           \
  |  | 1331|    126|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1331:11): [Folded, False: 126]
  |  |  ------------------
  ------------------
 1339|    126|    DUP(u, in, password);
  ------------------
  |  | 1325|    126|  do {                                          \
  |  | 1326|    126|    if((src)->name) {                           \
  |  |  ------------------
  |  |  |  Branch (1326:8): [True: 0, False: 126]
  |  |  ------------------
  |  | 1327|      0|      (dest)->name = curlx_strdup((src)->name); \
  |  |  ------------------
  |  |  |  | 1477|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1328|      0|      if(!(dest)->name)                         \
  |  |  ------------------
  |  |  |  Branch (1328:10): [True: 0, False: 0]
  |  |  ------------------
  |  | 1329|      0|        goto fail;                              \
  |  | 1330|      0|    }                                           \
  |  | 1331|    126|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1331:11): [Folded, False: 126]
  |  |  ------------------
  ------------------
 1340|    126|    DUP(u, in, options);
  ------------------
  |  | 1325|    126|  do {                                          \
  |  | 1326|    126|    if((src)->name) {                           \
  |  |  ------------------
  |  |  |  Branch (1326:8): [True: 0, False: 126]
  |  |  ------------------
  |  | 1327|      0|      (dest)->name = curlx_strdup((src)->name); \
  |  |  ------------------
  |  |  |  | 1477|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1328|      0|      if(!(dest)->name)                         \
  |  |  ------------------
  |  |  |  Branch (1328:10): [True: 0, False: 0]
  |  |  ------------------
  |  | 1329|      0|        goto fail;                              \
  |  | 1330|      0|    }                                           \
  |  | 1331|    126|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1331:11): [Folded, False: 126]
  |  |  ------------------
  ------------------
 1341|    126|    DUP(u, in, host);
  ------------------
  |  | 1325|    126|  do {                                          \
  |  | 1326|    126|    if((src)->name) {                           \
  |  |  ------------------
  |  |  |  Branch (1326:8): [True: 126, False: 0]
  |  |  ------------------
  |  | 1327|    126|      (dest)->name = curlx_strdup((src)->name); \
  |  |  ------------------
  |  |  |  | 1477|    126|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1328|    126|      if(!(dest)->name)                         \
  |  |  ------------------
  |  |  |  Branch (1328:10): [True: 0, False: 126]
  |  |  ------------------
  |  | 1329|    126|        goto fail;                              \
  |  | 1330|    126|    }                                           \
  |  | 1331|    126|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1331:11): [Folded, False: 126]
  |  |  ------------------
  ------------------
 1342|    126|    DUP(u, in, port);
  ------------------
  |  | 1325|    126|  do {                                          \
  |  | 1326|    126|    if((src)->name) {                           \
  |  |  ------------------
  |  |  |  Branch (1326:8): [True: 112, False: 14]
  |  |  ------------------
  |  | 1327|    112|      (dest)->name = curlx_strdup((src)->name); \
  |  |  ------------------
  |  |  |  | 1477|    112|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1328|    112|      if(!(dest)->name)                         \
  |  |  ------------------
  |  |  |  Branch (1328:10): [True: 0, False: 112]
  |  |  ------------------
  |  | 1329|    112|        goto fail;                              \
  |  | 1330|    112|    }                                           \
  |  | 1331|    126|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1331:11): [Folded, False: 126]
  |  |  ------------------
  ------------------
 1343|    126|    DUP(u, in, path);
  ------------------
  |  | 1325|    126|  do {                                          \
  |  | 1326|    126|    if((src)->name) {                           \
  |  |  ------------------
  |  |  |  Branch (1326:8): [True: 6, False: 120]
  |  |  ------------------
  |  | 1327|      6|      (dest)->name = curlx_strdup((src)->name); \
  |  |  ------------------
  |  |  |  | 1477|      6|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1328|      6|      if(!(dest)->name)                         \
  |  |  ------------------
  |  |  |  Branch (1328:10): [True: 0, False: 6]
  |  |  ------------------
  |  | 1329|      6|        goto fail;                              \
  |  | 1330|      6|    }                                           \
  |  | 1331|    126|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1331:11): [Folded, False: 126]
  |  |  ------------------
  ------------------
 1344|    126|    DUP(u, in, query);
  ------------------
  |  | 1325|    126|  do {                                          \
  |  | 1326|    126|    if((src)->name) {                           \
  |  |  ------------------
  |  |  |  Branch (1326:8): [True: 5, False: 121]
  |  |  ------------------
  |  | 1327|      5|      (dest)->name = curlx_strdup((src)->name); \
  |  |  ------------------
  |  |  |  | 1477|      5|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1328|      5|      if(!(dest)->name)                         \
  |  |  ------------------
  |  |  |  Branch (1328:10): [True: 0, False: 5]
  |  |  ------------------
  |  | 1329|      5|        goto fail;                              \
  |  | 1330|      5|    }                                           \
  |  | 1331|    126|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1331:11): [Folded, False: 126]
  |  |  ------------------
  ------------------
 1345|    126|    DUP(u, in, fragment);
  ------------------
  |  | 1325|    126|  do {                                          \
  |  | 1326|    126|    if((src)->name) {                           \
  |  |  ------------------
  |  |  |  Branch (1326:8): [True: 87, False: 39]
  |  |  ------------------
  |  | 1327|     87|      (dest)->name = curlx_strdup((src)->name); \
  |  |  ------------------
  |  |  |  | 1477|     87|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1328|     87|      if(!(dest)->name)                         \
  |  |  ------------------
  |  |  |  Branch (1328:10): [True: 0, False: 87]
  |  |  ------------------
  |  | 1329|     87|        goto fail;                              \
  |  | 1330|     87|    }                                           \
  |  | 1331|    126|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1331:11): [Folded, False: 126]
  |  |  ------------------
  ------------------
 1346|    126|    DUP(u, in, zoneid);
  ------------------
  |  | 1325|    126|  do {                                          \
  |  | 1326|    126|    if((src)->name) {                           \
  |  |  ------------------
  |  |  |  Branch (1326:8): [True: 0, False: 126]
  |  |  ------------------
  |  | 1327|      0|      (dest)->name = curlx_strdup((src)->name); \
  |  |  ------------------
  |  |  |  | 1477|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1328|      0|      if(!(dest)->name)                         \
  |  |  ------------------
  |  |  |  Branch (1328:10): [True: 0, False: 0]
  |  |  ------------------
  |  | 1329|      0|        goto fail;                              \
  |  | 1330|      0|    }                                           \
  |  | 1331|    126|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1331:11): [Folded, False: 126]
  |  |  ------------------
  ------------------
 1347|    126|    u->portnum = in->portnum;
 1348|    126|    u->fragment_present = in->fragment_present;
 1349|    126|    u->query_present = in->query_present;
 1350|    126|  }
 1351|    126|  return u;
 1352|      0|fail:
 1353|      0|  curl_url_cleanup(u);
 1354|       |  return NULL;
 1355|    126|}
curl_url_get:
 1564|   224k|{
 1565|   224k|  const char *ptr;
 1566|   224k|  CURLUcode ifmissing = CURLUE_UNKNOWN_PART;
 1567|   224k|  char portbuf[7];
 1568|   224k|  bool plusdecode = FALSE;
  ------------------
  |  | 1058|   224k|#define FALSE false
  ------------------
 1569|   224k|  if(!u)
  ------------------
  |  Branch (1569:6): [True: 0, False: 224k]
  ------------------
 1570|      0|    return CURLUE_BAD_HANDLE;
 1571|   224k|  if(!part)
  ------------------
  |  Branch (1571:6): [True: 0, False: 224k]
  ------------------
 1572|      0|    return CURLUE_BAD_PARTPOINTER;
 1573|   224k|  *part = NULL;
 1574|       |
 1575|   224k|  switch(what) {
 1576|  33.0k|  case CURLUPART_SCHEME:
  ------------------
  |  Branch (1576:3): [True: 33.0k, False: 191k]
  ------------------
 1577|  33.0k|    ptr = u->scheme;
 1578|  33.0k|    ifmissing = CURLUE_NO_SCHEME;
 1579|  33.0k|    flags &= ~U_CURLU_URLDECODE; /* never for schemes */
  ------------------
  |  |   63|  33.0k|#define U_CURLU_URLDECODE  (unsigned int)CURLU_URLDECODE
  |  |  ------------------
  |  |  |  |   93|  33.0k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  |  |  ------------------
  ------------------
 1580|  33.0k|    if((flags & CURLU_NO_GUESS_SCHEME) && u->guessed_scheme)
  ------------------
  |  |  105|  33.0k|#define CURLU_NO_GUESS_SCHEME (1 << 15)   /* for get, do not accept a guess */
  ------------------
  |  Branch (1580:8): [True: 18.3k, False: 14.7k]
  |  Branch (1580:43): [True: 18.3k, False: 7]
  ------------------
 1581|  18.3k|      return CURLUE_NO_SCHEME;
 1582|  14.7k|    break;
 1583|  23.1k|  case CURLUPART_USER:
  ------------------
  |  Branch (1583:3): [True: 23.1k, False: 200k]
  ------------------
 1584|  23.1k|    ptr = u->user;
 1585|  23.1k|    ifmissing = CURLUE_NO_USER;
 1586|  23.1k|    break;
 1587|  23.1k|  case CURLUPART_PASSWORD:
  ------------------
  |  Branch (1587:3): [True: 23.1k, False: 200k]
  ------------------
 1588|  23.1k|    ptr = u->password;
 1589|  23.1k|    ifmissing = CURLUE_NO_PASSWORD;
 1590|  23.1k|    break;
 1591|  14.1k|  case CURLUPART_OPTIONS:
  ------------------
  |  Branch (1591:3): [True: 14.1k, False: 209k]
  ------------------
 1592|  14.1k|    ptr = u->options;
 1593|  14.1k|    ifmissing = CURLUE_NO_OPTIONS;
 1594|  14.1k|    break;
 1595|  23.8k|  case CURLUPART_HOST:
  ------------------
  |  Branch (1595:3): [True: 23.8k, False: 200k]
  ------------------
 1596|  23.8k|    ptr = u->host;
 1597|  23.8k|    ifmissing = CURLUE_NO_HOST;
 1598|  23.8k|    break;
 1599|  23.2k|  case CURLUPART_ZONEID:
  ------------------
  |  Branch (1599:3): [True: 23.2k, False: 200k]
  ------------------
 1600|  23.2k|    ptr = u->zoneid;
 1601|  23.2k|    ifmissing = CURLUE_NO_ZONEID;
 1602|  23.2k|    break;
 1603|  23.6k|  case CURLUPART_PORT:
  ------------------
  |  Branch (1603:3): [True: 23.6k, False: 200k]
  ------------------
 1604|  23.6k|    ptr = u->port;
 1605|  23.6k|    ifmissing = CURLUE_NO_PORT;
 1606|  23.6k|    flags &= ~U_CURLU_URLDECODE; /* never for port */
  ------------------
  |  |   63|  23.6k|#define U_CURLU_URLDECODE  (unsigned int)CURLU_URLDECODE
  |  |  ------------------
  |  |  |  |   93|  23.6k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  |  |  ------------------
  ------------------
 1607|  23.6k|    if(!ptr && (flags & CURLU_DEFAULT_PORT) && u->scheme) {
  ------------------
  |  |   84|  23.1k|#define CURLU_DEFAULT_PORT (1 << 0)       /* return default port number */
  ------------------
  |  Branch (1607:8): [True: 23.1k, False: 571]
  |  Branch (1607:16): [True: 14.0k, False: 9.10k]
  |  Branch (1607:48): [True: 14.0k, False: 0]
  ------------------
 1608|       |      /* there is no stored port number, but asked to deliver
 1609|       |         a default one for the scheme */
 1610|  14.0k|      const struct Curl_scheme *h = Curl_get_scheme(u->scheme);
 1611|  14.0k|      if(h) {
  ------------------
  |  Branch (1611:10): [True: 14.0k, False: 0]
  ------------------
 1612|  14.0k|        curl_msnprintf(portbuf, sizeof(portbuf), "%u", h->defport);
 1613|  14.0k|        ptr = portbuf;
 1614|  14.0k|      }
 1615|  14.0k|    }
 1616|  9.67k|    else if(ptr && u->scheme) {
  ------------------
  |  Branch (1616:13): [True: 571, False: 9.10k]
  |  Branch (1616:20): [True: 571, False: 0]
  ------------------
 1617|       |      /* there is a stored port number, but ask to inhibit if
 1618|       |         it matches the default one for the scheme */
 1619|    571|      const struct Curl_scheme *h = Curl_get_scheme(u->scheme);
 1620|    571|      if(h && (h->defport == u->portnum) &&
  ------------------
  |  Branch (1620:10): [True: 570, False: 1]
  |  Branch (1620:15): [True: 50, False: 520]
  ------------------
 1621|     50|         (flags & CURLU_NO_DEFAULT_PORT))
  ------------------
  |  |   85|     50|#define CURLU_NO_DEFAULT_PORT (1 << 1)    /* act as if no port number was set,
  ------------------
  |  Branch (1621:10): [True: 1, False: 49]
  ------------------
 1622|      1|        ptr = NULL;
 1623|    571|    }
 1624|  23.6k|    break;
 1625|  14.1k|  case CURLUPART_PATH:
  ------------------
  |  Branch (1625:3): [True: 14.1k, False: 209k]
  ------------------
 1626|  14.1k|    ptr = u->path;
 1627|  14.1k|    if(!ptr)
  ------------------
  |  Branch (1627:8): [True: 9.89k, False: 4.21k]
  ------------------
 1628|  9.89k|      ptr = "/";
 1629|  14.1k|    break;
 1630|  14.1k|  case CURLUPART_QUERY:
  ------------------
  |  Branch (1630:3): [True: 14.1k, False: 209k]
  ------------------
 1631|  14.1k|    ptr = u->query;
 1632|  14.1k|    ifmissing = CURLUE_NO_QUERY;
 1633|  14.1k|    plusdecode = flags & CURLU_URLDECODE;
  ------------------
  |  |   93|  14.1k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  ------------------
 1634|  14.1k|    if(ptr && !ptr[0] && !(flags & CURLU_GET_EMPTY))
  ------------------
  |  |  102|     76|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
  |  Branch (1634:8): [True: 2.27k, False: 11.8k]
  |  Branch (1634:15): [True: 76, False: 2.19k]
  |  Branch (1634:26): [True: 1, False: 75]
  ------------------
 1635|       |      /* there was a blank query and the user do not ask for it */
 1636|      1|      ptr = NULL;
 1637|  14.1k|    break;
 1638|      0|  case CURLUPART_FRAGMENT:
  ------------------
  |  Branch (1638:3): [True: 0, False: 224k]
  ------------------
 1639|      0|    ptr = u->fragment;
 1640|      0|    ifmissing = CURLUE_NO_FRAGMENT;
 1641|      0|    if(!ptr && u->fragment_present && flags & CURLU_GET_EMPTY)
  ------------------
  |  |  102|      0|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
  |  Branch (1641:8): [True: 0, False: 0]
  |  Branch (1641:16): [True: 0, False: 0]
  |  Branch (1641:39): [True: 0, False: 0]
  ------------------
 1642|       |      /* there was a blank fragment and the user asks for it */
 1643|      0|      ptr = "";
 1644|      0|    break;
 1645|  31.5k|  case CURLUPART_URL:
  ------------------
  |  Branch (1645:3): [True: 31.5k, False: 192k]
  ------------------
 1646|  31.5k|    return urlget_url(u, part, flags);
 1647|      0|  default:
  ------------------
  |  Branch (1647:3): [True: 0, False: 224k]
  ------------------
 1648|      0|    ptr = NULL;
 1649|      0|    break;
 1650|   224k|  }
 1651|   174k|  if(ptr)
  ------------------
  |  Branch (1651:6): [True: 76.6k, False: 97.5k]
  ------------------
 1652|  76.6k|    return urlget_format(u, what, ptr, part, plusdecode, flags);
 1653|       |
 1654|  97.5k|  return ifmissing;
 1655|   174k|}
curl_url_set:
 1830|  27.0k|{
 1831|  27.0k|  char **storep = NULL;
 1832|  27.0k|  bool urlencode = (flags & CURLU_URLENCODE) ? 1 : 0;
  ------------------
  |  |   94|  27.0k|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1832:20): [True: 1.50k, False: 25.5k]
  ------------------
 1833|  27.0k|  bool plusencode = FALSE;
  ------------------
  |  | 1058|  27.0k|#define FALSE false
  ------------------
 1834|  27.0k|  bool pathmode = FALSE;
  ------------------
  |  | 1058|  27.0k|#define FALSE false
  ------------------
 1835|  27.0k|  bool leadingslash = FALSE;
  ------------------
  |  | 1058|  27.0k|#define FALSE false
  ------------------
 1836|  27.0k|  bool appendquery = FALSE;
  ------------------
  |  | 1058|  27.0k|#define FALSE false
  ------------------
 1837|  27.0k|  bool equalsencode = FALSE;
  ------------------
  |  | 1058|  27.0k|#define FALSE false
  ------------------
 1838|  27.0k|  size_t nalloc;
 1839|       |
 1840|  27.0k|  if(!u)
  ------------------
  |  Branch (1840:6): [True: 0, False: 27.0k]
  ------------------
 1841|      0|    return CURLUE_BAD_HANDLE;
 1842|  27.0k|  if(!part)
  ------------------
  |  Branch (1842:6): [True: 174, False: 26.8k]
  ------------------
 1843|       |    /* setting a part to NULL clears it */
 1844|    174|    return urlset_clear(u, what);
 1845|       |
 1846|  26.8k|  nalloc = strlen(part);
 1847|  26.8k|  if(nalloc > CURL_MAX_INPUT_LENGTH)
  ------------------
  |  |   45|  26.8k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (1847:6): [True: 0, False: 26.8k]
  ------------------
 1848|       |    /* excessive input length */
 1849|      0|    return CURLUE_MALFORMED_INPUT;
 1850|       |
 1851|  26.8k|  switch(what) {
 1852|      0|  case CURLUPART_SCHEME: {
  ------------------
  |  Branch (1852:3): [True: 0, False: 26.8k]
  ------------------
 1853|      0|    CURLUcode status = set_url_scheme(u, part, flags);
 1854|      0|    if(status)
  ------------------
  |  Branch (1854:8): [True: 0, False: 0]
  ------------------
 1855|      0|      return status;
 1856|      0|    storep = &u->scheme;
 1857|      0|    urlencode = FALSE; /* never */
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1858|      0|    break;
 1859|      0|  }
 1860|     74|  case CURLUPART_USER:
  ------------------
  |  Branch (1860:3): [True: 74, False: 26.8k]
  ------------------
 1861|     74|    storep = &u->user;
 1862|     74|    break;
 1863|     74|  case CURLUPART_PASSWORD:
  ------------------
  |  Branch (1863:3): [True: 74, False: 26.8k]
  ------------------
 1864|     74|    storep = &u->password;
 1865|     74|    break;
 1866|      0|  case CURLUPART_OPTIONS:
  ------------------
  |  Branch (1866:3): [True: 0, False: 26.8k]
  ------------------
 1867|      0|    storep = &u->options;
 1868|      0|    break;
 1869|      0|  case CURLUPART_HOST:
  ------------------
  |  Branch (1869:3): [True: 0, False: 26.8k]
  ------------------
 1870|      0|    storep = &u->host;
 1871|      0|    curlx_safefree(u->zoneid);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1872|      0|    break;
 1873|      0|  case CURLUPART_ZONEID:
  ------------------
  |  Branch (1873:3): [True: 0, False: 26.8k]
  ------------------
 1874|      0|    storep = &u->zoneid;
 1875|      0|    break;
 1876|     46|  case CURLUPART_PORT:
  ------------------
  |  Branch (1876:3): [True: 46, False: 26.8k]
  ------------------
 1877|     46|    return set_url_port(u, part);
 1878|      0|  case CURLUPART_PATH:
  ------------------
  |  Branch (1878:3): [True: 0, False: 26.8k]
  ------------------
 1879|      0|    pathmode = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1880|      0|    leadingslash = TRUE; /* enforce */
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1881|      0|    storep = &u->path;
 1882|      0|    break;
 1883|      0|  case CURLUPART_QUERY:
  ------------------
  |  Branch (1883:3): [True: 0, False: 26.8k]
  ------------------
 1884|      0|    plusencode = urlencode;
 1885|      0|    appendquery = (flags & CURLU_APPENDQUERY) ? 1 : 0;
  ------------------
  |  |   95|      0|#define CURLU_APPENDQUERY (1 << 8)        /* append a form style part */
  ------------------
  |  Branch (1885:19): [True: 0, False: 0]
  ------------------
 1886|      0|    equalsencode = appendquery;
 1887|      0|    storep = &u->query;
 1888|      0|    u->query_present = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1889|      0|    break;
 1890|      0|  case CURLUPART_FRAGMENT:
  ------------------
  |  Branch (1890:3): [True: 0, False: 26.8k]
  ------------------
 1891|      0|    storep = &u->fragment;
 1892|      0|    u->fragment_present = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1893|      0|    break;
 1894|  26.6k|  case CURLUPART_URL:
  ------------------
  |  Branch (1894:3): [True: 26.6k, False: 194]
  ------------------
 1895|  26.6k|    return set_url(u, part, nalloc, flags);
 1896|      0|  default:
  ------------------
  |  Branch (1896:3): [True: 0, False: 26.8k]
  ------------------
 1897|      0|    return CURLUE_UNKNOWN_PART;
 1898|  26.8k|  }
 1899|    148|  DEBUGASSERT(storep);
  ------------------
  |  | 1081|    148|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1899:3): [True: 0, False: 148]
  |  Branch (1899:3): [True: 148, False: 0]
  ------------------
 1900|    148|  {
 1901|    148|    const char *newp;
 1902|    148|    struct dynbuf enc;
 1903|    148|    curlx_dyn_init(&enc, (nalloc * 3) + 1 + leadingslash);
 1904|       |
 1905|    148|    if(leadingslash && (part[0] != '/')) {
  ------------------
  |  Branch (1905:8): [True: 0, False: 148]
  |  Branch (1905:24): [True: 0, False: 0]
  ------------------
 1906|      0|      CURLcode result = curlx_dyn_addn(&enc, "/", 1);
 1907|      0|      if(result)
  ------------------
  |  Branch (1907:10): [True: 0, False: 0]
  ------------------
 1908|      0|        return cc2cu(result);
  ------------------
  |  |  104|      0|  ((x) == CURLE_TOO_LARGE ? CURLUE_TOO_LARGE : CURLUE_OUT_OF_MEMORY)
  |  |  ------------------
  |  |  |  Branch (104:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1909|      0|    }
 1910|    148|    if(urlencode) {
  ------------------
  |  Branch (1910:8): [True: 148, False: 0]
  ------------------
 1911|    148|      const unsigned char *i;
 1912|       |
 1913|   641k|      for(i = (const unsigned char *)part; *i; i++) {
  ------------------
  |  Branch (1913:44): [True: 641k, False: 148]
  ------------------
 1914|   641k|        CURLcode result;
 1915|   641k|        if((*i == ' ') && plusencode) {
  ------------------
  |  Branch (1915:12): [True: 890, False: 640k]
  |  Branch (1915:27): [True: 0, False: 890]
  ------------------
 1916|      0|          result = curlx_dyn_addn(&enc, "+", 1);
 1917|      0|          if(result)
  ------------------
  |  Branch (1917:14): [True: 0, False: 0]
  ------------------
 1918|      0|            return CURLUE_OUT_OF_MEMORY;
 1919|      0|        }
 1920|   641k|        else if(ISUNRESERVED(*i) ||
  ------------------
  |  |   49|  1.28M|#define ISUNRESERVED(x) (ISALNUM(x) || ISURLPUNTCS(x))
  |  |  ------------------
  |  |  |  |   41|  1.28M|#define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   44|  1.28M|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (44:22): [True: 365k, False: 275k]
  |  |  |  |  |  |  |  Branch (44:38): [True: 15.4k, False: 350k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  1.26M|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (43:22): [True: 249k, False: 376k]
  |  |  |  |  |  |  |  Branch (43:38): [True: 55.6k, False: 193k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   570k|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (42:22): [True: 274k, False: 295k]
  |  |  |  |  |  |  |  Branch (42:38): [True: 79.8k, False: 194k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISUNRESERVED(x) (ISALNUM(x) || ISURLPUNTCS(x))
  |  |  ------------------
  |  |  |  |   48|   490k|  (((x) == '-') || ((x) == '.') || ((x) == '_') || ((x) == '~'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (48:4): [True: 704, False: 489k]
  |  |  |  |  |  Branch (48:20): [True: 990, False: 488k]
  |  |  |  |  |  Branch (48:36): [True: 708, False: 487k]
  |  |  |  |  |  Branch (48:52): [True: 492, False: 487k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1921|   487k|                (pathmode && allowed_in_path(*i)) ||
  ------------------
  |  Branch (1921:18): [True: 0, False: 487k]
  |  Branch (1921:30): [True: 0, False: 0]
  ------------------
 1922|   487k|                ((*i == '=') && equalsencode)) {
  ------------------
  |  Branch (1922:18): [True: 6.69k, False: 480k]
  |  Branch (1922:33): [True: 0, False: 6.69k]
  ------------------
 1923|   153k|          if((*i == '=') && equalsencode)
  ------------------
  |  Branch (1923:14): [True: 0, False: 153k]
  |  Branch (1923:29): [True: 0, False: 0]
  ------------------
 1924|       |            /* only skip the first equals sign */
 1925|      0|            equalsencode = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1926|   153k|          result = curlx_dyn_addn(&enc, i, 1);
 1927|   153k|          if(result)
  ------------------
  |  Branch (1927:14): [True: 0, False: 153k]
  ------------------
 1928|      0|            return cc2cu(result);
  ------------------
  |  |  104|      0|  ((x) == CURLE_TOO_LARGE ? CURLUE_TOO_LARGE : CURLUE_OUT_OF_MEMORY)
  |  |  ------------------
  |  |  |  Branch (104:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1929|   153k|        }
 1930|   487k|        else {
 1931|   487k|          unsigned char out[3] = { '%' };
 1932|   487k|          Curl_hexbyte(&out[1], *i);
 1933|   487k|          result = curlx_dyn_addn(&enc, out, 3);
 1934|   487k|          if(result)
  ------------------
  |  Branch (1934:14): [True: 0, False: 487k]
  ------------------
 1935|      0|            return cc2cu(result);
  ------------------
  |  |  104|      0|  ((x) == CURLE_TOO_LARGE ? CURLUE_TOO_LARGE : CURLUE_OUT_OF_MEMORY)
  |  |  ------------------
  |  |  |  Branch (104:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1936|   487k|        }
 1937|   641k|      }
 1938|    148|    }
 1939|      0|    else {
 1940|      0|      char *p;
 1941|      0|      CURLcode result = curlx_dyn_add(&enc, part);
 1942|      0|      if(result)
  ------------------
  |  Branch (1942:10): [True: 0, False: 0]
  ------------------
 1943|      0|        return cc2cu(result);
  ------------------
  |  |  104|      0|  ((x) == CURLE_TOO_LARGE ? CURLUE_TOO_LARGE : CURLUE_OUT_OF_MEMORY)
  |  |  ------------------
  |  |  |  Branch (104:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1944|      0|      p = curlx_dyn_ptr(&enc);
 1945|      0|      while(*p) {
  ------------------
  |  Branch (1945:13): [True: 0, False: 0]
  ------------------
 1946|       |        /* make sure percent encoded are upper case */
 1947|      0|        if((*p == '%') && ISXDIGIT(p[1]) && ISXDIGIT(p[2]) &&
  ------------------
  |  |   39|      0|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   44|      0|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 0, False: 0]
  |  |  |  |  |  Branch (44: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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if((*p == '%') && ISXDIGIT(p[1]) && ISXDIGIT(p[2]) &&
  ------------------
  |  |   39|      0|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   44|      0|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (44:22): [True: 0, False: 0]
  |  |  |  |  |  Branch (44: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 (1947:12): [True: 0, False: 0]
  ------------------
 1948|      0|           (ISLOWER(p[1]) || ISLOWER(p[2]))) {
  ------------------
  |  |   43|      0|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 0, False: 0]
  |  |  |  Branch (43:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                         (ISLOWER(p[1]) || ISLOWER(p[2]))) {
  ------------------
  |  |   43|      0|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 0, False: 0]
  |  |  |  Branch (43:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1949|      0|          p[1] = Curl_raw_toupper(p[1]);
 1950|      0|          p[2] = Curl_raw_toupper(p[2]);
 1951|      0|          p += 3;
 1952|      0|        }
 1953|      0|        else
 1954|      0|          p++;
 1955|      0|      }
 1956|      0|    }
 1957|    148|    newp = curlx_dyn_ptr(&enc);
 1958|       |
 1959|    148|    if(appendquery && newp) {
  ------------------
  |  Branch (1959:8): [True: 0, False: 148]
  |  Branch (1959:23): [True: 0, False: 0]
  ------------------
 1960|       |      /* Append the 'newp' string onto the old query. Add a '&' separator if
 1961|       |         none is present at the end of the existing query already */
 1962|       |
 1963|      0|      size_t querylen = u->query ? strlen(u->query) : 0;
  ------------------
  |  Branch (1963:25): [True: 0, False: 0]
  ------------------
 1964|      0|      bool addamperand = querylen && (u->query[querylen - 1] != '&');
  ------------------
  |  Branch (1964:26): [True: 0, False: 0]
  |  Branch (1964:38): [True: 0, False: 0]
  ------------------
 1965|      0|      if(querylen) {
  ------------------
  |  Branch (1965:10): [True: 0, False: 0]
  ------------------
 1966|      0|        struct dynbuf qbuf;
 1967|      0|        curlx_dyn_init(&qbuf, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|      0|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1968|       |
 1969|      0|        if(curlx_dyn_addn(&qbuf, u->query, querylen)) /* add original query */
  ------------------
  |  Branch (1969:12): [True: 0, False: 0]
  ------------------
 1970|      0|          goto nomem;
 1971|       |
 1972|      0|        if(addamperand) {
  ------------------
  |  Branch (1972:12): [True: 0, False: 0]
  ------------------
 1973|      0|          if(curlx_dyn_addn(&qbuf, "&", 1))
  ------------------
  |  Branch (1973:14): [True: 0, False: 0]
  ------------------
 1974|      0|            goto nomem;
 1975|      0|        }
 1976|      0|        if(curlx_dyn_add(&qbuf, newp))
  ------------------
  |  Branch (1976:12): [True: 0, False: 0]
  ------------------
 1977|      0|          goto nomem;
 1978|      0|        curlx_dyn_free(&enc);
 1979|      0|        curlx_free(*storep);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1980|      0|        *storep = curlx_dyn_ptr(&qbuf);
 1981|      0|        return CURLUE_OK;
 1982|      0|nomem:
 1983|      0|        curlx_dyn_free(&enc);
 1984|      0|        return CURLUE_OUT_OF_MEMORY;
 1985|      0|      }
 1986|      0|    }
 1987|    148|    else if(what == CURLUPART_HOST) {
  ------------------
  |  Branch (1987:13): [True: 0, False: 148]
  ------------------
 1988|      0|      size_t n = curlx_dyn_len(&enc);
 1989|      0|      if(!n && (flags & CURLU_NO_AUTHORITY)) {
  ------------------
  |  |   97|      0|#define CURLU_NO_AUTHORITY (1 << 10)      /* Allow empty authority when the
  ------------------
  |  Branch (1989:10): [True: 0, False: 0]
  |  Branch (1989:16): [True: 0, False: 0]
  ------------------
 1990|       |        /* Skip hostname check, it is allowed to be empty. */
 1991|      0|      }
 1992|      0|      else {
 1993|      0|        bool bad = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1994|      0|        if(!n)
  ------------------
  |  Branch (1994:12): [True: 0, False: 0]
  ------------------
 1995|      0|          bad = TRUE; /* empty hostname is not okay */
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1996|      0|        else if(!urlencode) {
  ------------------
  |  Branch (1996:17): [True: 0, False: 0]
  ------------------
 1997|       |          /* if the hostname part was not URL encoded here, it was set ready
 1998|       |             URL encoded so we need to decode it to check */
 1999|      0|          size_t dlen;
 2000|      0|          char *decoded = NULL;
 2001|      0|          CURLcode result =
 2002|      0|            Curl_urldecode(newp, n, &decoded, &dlen, REJECT_CTRL);
 2003|      0|          if(result || hostname_check(u, decoded, dlen))
  ------------------
  |  Branch (2003:14): [True: 0, False: 0]
  |  Branch (2003:24): [True: 0, False: 0]
  ------------------
 2004|      0|            bad = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2005|      0|          curlx_free(decoded);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2006|      0|        }
 2007|      0|        else if(hostname_check(u, (char *)CURL_UNCONST(newp), n))
  ------------------
  |  |  866|      0|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  |  Branch (2007:17): [True: 0, False: 0]
  ------------------
 2008|      0|          bad = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 2009|      0|        if(bad) {
  ------------------
  |  Branch (2009:12): [True: 0, False: 0]
  ------------------
 2010|      0|          curlx_dyn_free(&enc);
 2011|      0|          return CURLUE_BAD_HOSTNAME;
 2012|      0|        }
 2013|      0|      }
 2014|      0|    }
 2015|       |
 2016|    148|    curlx_free(*storep);
  ------------------
  |  | 1483|    148|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2017|    148|    *storep = (char *)CURL_UNCONST(newp);
  ------------------
  |  |  866|    148|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
 2018|    148|  }
 2019|      0|  return CURLUE_OK;
 2020|    148|}
Curl_url_same_origin:
 2023|    937|{
 2024|    937|  const struct Curl_scheme *s = NULL;
 2025|       |
 2026|       |  /* base must be an absolute URL */
 2027|    937|  if(!base->scheme || !base->host)
  ------------------
  |  Branch (2027:6): [True: 0, False: 937]
  |  Branch (2027:23): [True: 0, False: 937]
  ------------------
 2028|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2029|    937|  if(href->scheme && !curl_strequal(base->scheme, href->scheme))
  ------------------
  |  Branch (2029:6): [True: 937, False: 0]
  |  Branch (2029:22): [True: 1, False: 936]
  ------------------
 2030|      1|    return FALSE;
  ------------------
  |  | 1058|      1|#define FALSE false
  ------------------
 2031|    936|  if(href->host) {
  ------------------
  |  Branch (2031:6): [True: 936, False: 0]
  ------------------
 2032|    936|    if(!curl_strequal(base->host, href->host))
  ------------------
  |  Branch (2032:8): [True: 3, False: 933]
  ------------------
 2033|      3|      return FALSE;
  ------------------
  |  | 1058|      3|#define FALSE false
  ------------------
 2034|    933|    if(!curl_strequal(base->zoneid ? base->zoneid : "",
  ------------------
  |  Branch (2034:8): [True: 0, False: 933]
  |  Branch (2034:23): [True: 2, False: 931]
  ------------------
 2035|    933|                      href->zoneid ? href->zoneid : ""))
  ------------------
  |  Branch (2035:23): [True: 2, False: 931]
  ------------------
 2036|      0|      return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2037|    933|    if(!curl_strequal(base->port, href->port)) {
  ------------------
  |  Branch (2037:8): [True: 12, False: 921]
  ------------------
 2038|       |      /* This may still match if only one has an explicit port
 2039|       |       * and it is the default for the scheme. */
 2040|     12|      if(base->port && href->port)
  ------------------
  |  Branch (2040:10): [True: 1, False: 11]
  |  Branch (2040:24): [True: 1, False: 0]
  ------------------
 2041|      1|        return FALSE;
  ------------------
  |  | 1058|      1|#define FALSE false
  ------------------
 2042|       |
 2043|     11|      s = Curl_get_scheme(base->scheme);
 2044|     11|      if(!s) /* Cannot match default port for unknown scheme */
  ------------------
  |  Branch (2044:10): [True: 0, False: 11]
  ------------------
 2045|      0|        return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2046|       |
 2047|       |      /* The port which is set must be the default one */
 2048|     11|      if((base->port && (base->portnum != s->defport)) ||
  ------------------
  |  Branch (2048:11): [True: 0, False: 11]
  |  Branch (2048:25): [True: 0, False: 0]
  ------------------
 2049|     11|         (href->port && (href->portnum != s->defport)))
  ------------------
  |  Branch (2049:11): [True: 11, False: 0]
  |  Branch (2049:25): [True: 11, False: 0]
  ------------------
 2050|     11|        return FALSE;
  ------------------
  |  | 1058|     11|#define FALSE false
  ------------------
 2051|     11|    }
 2052|    933|  }
 2053|      0|  else if(href->port) /* no host in href, then there must be no port */
  ------------------
  |  Branch (2053:11): [True: 0, False: 0]
  ------------------
 2054|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 2055|    921|  return TRUE;
  ------------------
  |  | 1055|    921|#define TRUE true
  ------------------
 2056|    936|}
urlapi.c:find_host_sep:
   87|      9|{
   88|       |  /* Find the start of the hostname */
   89|      9|  const char *sep = strstr(url, "//");
   90|      9|  if(!sep)
  ------------------
  |  Branch (90:6): [True: 5, False: 4]
  ------------------
   91|      5|    sep = url;
   92|      4|  else
   93|      4|    sep += 2;
   94|       |
   95|       |  /* Find first / or ? */
   96|    117|  while(*sep && *sep != '/' && *sep != '?')
  ------------------
  |  Branch (96:9): [True: 114, False: 3]
  |  Branch (96:17): [True: 109, False: 5]
  |  Branch (96:32): [True: 108, False: 1]
  ------------------
   97|    108|    sep++;
   98|       |
   99|      9|  return sep;
  100|      9|}
urlapi.c:parse_authority:
  645|  26.3k|{
  646|  26.3k|  size_t offset;
  647|  26.3k|  CURLUcode uc;
  648|  26.3k|  CURLcode result;
  649|       |
  650|       |  /*
  651|       |   * Parse the login details and strip them out of the hostname.
  652|       |   */
  653|  26.3k|  uc = parse_hostname_login(u, auth, authlen, flags, &offset);
  654|  26.3k|  if(uc)
  ------------------
  |  Branch (654:6): [True: 1, False: 26.3k]
  ------------------
  655|      1|    goto out;
  656|       |
  657|  26.3k|  result = curlx_dyn_addn(host, auth + offset, authlen - offset);
  658|  26.3k|  if(result) {
  ------------------
  |  Branch (658:6): [True: 0, False: 26.3k]
  ------------------
  659|      0|    uc = cc2cu(result);
  ------------------
  |  |  104|      0|  ((x) == CURLE_TOO_LARGE ? CURLUE_TOO_LARGE : CURLUE_OUT_OF_MEMORY)
  |  |  ------------------
  |  |  |  Branch (104:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  660|      0|    goto out;
  661|      0|  }
  662|       |
  663|  26.3k|  uc = parse_port(u, host, has_scheme);
  664|  26.3k|  if(uc)
  ------------------
  |  Branch (664:6): [True: 82, False: 26.2k]
  ------------------
  665|     82|    goto out;
  666|       |
  667|  26.2k|  if(!curlx_dyn_len(host))
  ------------------
  |  Branch (667:6): [True: 24, False: 26.1k]
  ------------------
  668|     24|    return CURLUE_NO_HOST;
  669|       |
  670|  26.1k|  switch(ipv4_normalize(host)) {
  671|  14.6k|  case HOST_IPV4:
  ------------------
  |  |   49|  14.6k|#define HOST_IPV4    2
  ------------------
  |  Branch (671:3): [True: 14.6k, False: 11.5k]
  ------------------
  672|  14.6k|    break;
  673|    180|  case HOST_IPV6:
  ------------------
  |  |   50|    180|#define HOST_IPV6    3
  ------------------
  |  Branch (673:3): [True: 180, False: 26.0k]
  ------------------
  674|    180|    uc = ipv6_parse(u, curlx_dyn_ptr(host), curlx_dyn_len(host));
  675|    180|    break;
  676|  11.3k|  case HOST_NAME:
  ------------------
  |  |   48|  11.3k|#define HOST_NAME    1
  ------------------
  |  Branch (676:3): [True: 11.3k, False: 14.8k]
  ------------------
  677|  11.3k|    uc = urldecode_host(host);
  678|  11.3k|    if(!uc)
  ------------------
  |  Branch (678:8): [True: 11.3k, False: 4]
  ------------------
  679|  11.3k|      uc = hostname_check(u, curlx_dyn_ptr(host), curlx_dyn_len(host));
  680|  11.3k|    break;
  681|      0|  case HOST_ERROR:
  ------------------
  |  |   47|      0|#define HOST_ERROR   (-1) /* out of memory */
  ------------------
  |  Branch (681:3): [True: 0, False: 26.1k]
  ------------------
  682|      0|    uc = CURLUE_OUT_OF_MEMORY;
  683|      0|    break;
  684|      0|  default:
  ------------------
  |  Branch (684:3): [True: 0, False: 26.1k]
  ------------------
  685|      0|    uc = CURLUE_BAD_HOSTNAME; /* Bad IPv4 address even */
  686|      0|    break;
  687|  26.1k|  }
  688|       |
  689|  26.2k|out:
  690|  26.2k|  return uc;
  691|  26.1k|}
urlapi.c:parse_hostname_login:
  262|  26.3k|{
  263|  26.3k|  CURLUcode ures = CURLUE_OK;
  264|  26.3k|  CURLcode result;
  265|  26.3k|  char *userp = NULL;
  266|  26.3k|  char *passwdp = NULL;
  267|  26.3k|  char *optionsp = NULL;
  268|  26.3k|  const struct Curl_scheme *h = NULL;
  269|       |
  270|       |  /* At this point, we assume all the other special cases have been taken
  271|       |   * care of, so the host is at most
  272|       |   *
  273|       |   *   [user[:password][;options]]@]hostname
  274|       |   *
  275|       |   * We need somewhere to put the embedded details, so do that first.
  276|       |   */
  277|  26.3k|  const char *ptr;
  278|       |
  279|  26.3k|  DEBUGASSERT(login);
  ------------------
  |  | 1081|  26.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (279:3): [True: 0, False: 26.3k]
  |  Branch (279:3): [True: 26.3k, False: 0]
  ------------------
  280|       |
  281|  26.3k|  *offset = 0;
  282|  26.3k|  ptr = memchr(login, '@', len);
  283|  26.3k|  if(!ptr)
  ------------------
  |  Branch (283:6): [True: 20.2k, False: 6.08k]
  ------------------
  284|  20.2k|    goto out;
  285|       |
  286|       |  /* We will now try to extract the
  287|       |   * possible login information in a string like:
  288|       |   * ftp://user:password@ftp.site.example:8021/README */
  289|  6.08k|  ptr++;
  290|       |
  291|       |  /* if this is a known scheme, get some details */
  292|  6.08k|  if(u->scheme)
  ------------------
  |  Branch (292:6): [True: 5.24k, False: 846]
  ------------------
  293|  5.24k|    h = Curl_get_scheme(u->scheme);
  294|       |
  295|       |  /* We could use the login information in the URL so extract it. Only parse
  296|       |     options if the handler says we should. Note that 'h' might be NULL! */
  297|  6.08k|  result = Curl_parse_login_details(login, ptr - login - 1,
  298|  6.08k|                                    &userp, &passwdp,
  299|  6.08k|                                    (h && (h->flags & PROTOPT_URLOPTIONS)) ?
  ------------------
  |  |  225|  5.22k|#define PROTOPT_URLOPTIONS (1 << 10) /* allow options part in the userinfo
  ------------------
  |  Branch (299:38): [True: 5.22k, False: 862]
  |  Branch (299:43): [True: 13, False: 5.21k]
  ------------------
  300|  6.08k|                                    &optionsp : NULL);
  301|  6.08k|  if(result) {
  ------------------
  |  Branch (301:6): [True: 0, False: 6.08k]
  ------------------
  302|       |    /* the only possible error from Curl_parse_login_details is out of
  303|       |       memory: */
  304|      0|    ures = CURLUE_OUT_OF_MEMORY;
  305|      0|    goto out;
  306|      0|  }
  307|       |
  308|  6.08k|  if(userp) {
  ------------------
  |  Branch (308:6): [True: 6.08k, False: 0]
  ------------------
  309|  6.08k|    if(flags & CURLU_DISALLOW_USER) {
  ------------------
  |  |   92|  6.08k|#define CURLU_DISALLOW_USER (1 << 5)      /* no user+password allowed */
  ------------------
  |  Branch (309:8): [True: 1, False: 6.08k]
  ------------------
  310|       |      /* Option DISALLOW_USER is set and URL contains username. */
  311|      1|      ures = CURLUE_USER_NOT_ALLOWED;
  312|      1|      goto out;
  313|      1|    }
  314|  6.08k|    curlx_free(u->user);
  ------------------
  |  | 1483|  6.08k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  315|  6.08k|    u->user = userp;
  316|  6.08k|  }
  317|       |
  318|  6.08k|  if(passwdp) {
  ------------------
  |  Branch (318:6): [True: 2.01k, False: 4.07k]
  ------------------
  319|  2.01k|    curlx_free(u->password);
  ------------------
  |  | 1483|  2.01k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  320|  2.01k|    u->password = passwdp;
  321|  2.01k|  }
  322|       |
  323|  6.08k|  if(optionsp) {
  ------------------
  |  Branch (323:6): [True: 7, False: 6.08k]
  ------------------
  324|      7|    curlx_free(u->options);
  ------------------
  |  | 1483|      7|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  325|      7|    u->options = optionsp;
  326|      7|  }
  327|       |
  328|       |  /* the hostname starts at this offset */
  329|  6.08k|  *offset = ptr - login;
  330|  6.08k|  return CURLUE_OK;
  331|       |
  332|  20.2k|out:
  333|       |
  334|  20.2k|  curlx_free(userp);
  ------------------
  |  | 1483|  20.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  335|  20.2k|  curlx_free(passwdp);
  ------------------
  |  | 1483|  20.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  336|  20.2k|  curlx_free(optionsp);
  ------------------
  |  | 1483|  20.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  337|  20.2k|  u->user = NULL;
  338|  20.2k|  u->password = NULL;
  339|  20.2k|  u->options = NULL;
  340|       |
  341|  20.2k|  return ures;
  342|  6.08k|}
urlapi.c:urldecode_host:
  615|  11.3k|{
  616|  11.3k|  const char *per;
  617|  11.3k|  const char *hostname = curlx_dyn_ptr(host);
  618|  11.3k|  per = strchr(hostname, '%');
  619|  11.3k|  if(!per)
  ------------------
  |  Branch (619:6): [True: 11.2k, False: 98]
  ------------------
  620|       |    /* nothing to decode */
  621|  11.2k|    return CURLUE_OK;
  622|     98|  else {
  623|       |    /* encoded */
  624|     98|    size_t dlen;
  625|     98|    char *decoded;
  626|     98|    CURLcode result = Curl_urldecode(hostname, 0, &decoded, &dlen,
  627|     98|                                     REJECT_CTRL);
  628|     98|    if(result)
  ------------------
  |  Branch (628:8): [True: 4, False: 94]
  ------------------
  629|      4|      return CURLUE_BAD_HOSTNAME;
  630|     94|    curlx_dyn_reset(host);
  631|     94|    result = curlx_dyn_addn(host, decoded, dlen);
  632|     94|    curlx_free(decoded);
  ------------------
  |  | 1483|     94|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  633|     94|    if(result)
  ------------------
  |  Branch (633:8): [True: 0, False: 94]
  ------------------
  634|      0|      return cc2cu(result);
  ------------------
  |  |  104|      0|  ((x) == CURLE_TOO_LARGE ? CURLUE_TOO_LARGE : CURLUE_OUT_OF_MEMORY)
  |  |  ------------------
  |  |  |  Branch (104:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  635|     94|  }
  636|       |
  637|     94|  return CURLUE_OK;
  638|  11.3k|}
urlapi.c:is_dot:
  719|  44.9k|{
  720|  44.9k|  const char *p = *str;
  721|  44.9k|  if(*p == '.') {
  ------------------
  |  Branch (721:6): [True: 10.1k, False: 34.7k]
  ------------------
  722|  10.1k|    (*str)++;
  723|  10.1k|    (*clen)--;
  724|  10.1k|    return TRUE;
  ------------------
  |  | 1055|  10.1k|#define TRUE true
  ------------------
  725|  10.1k|  }
  726|  34.7k|  else if((*clen >= 3) &&
  ------------------
  |  Branch (726:11): [True: 30.6k, False: 4.14k]
  ------------------
  727|  30.6k|          (p[0] == '%') && (p[1] == '2') && ((p[2] | 0x20) == 'e')) {
  ------------------
  |  Branch (727:11): [True: 1.46k, False: 29.1k]
  |  Branch (727:28): [True: 224, False: 1.24k]
  |  Branch (727:45): [True: 86, False: 138]
  ------------------
  728|     86|    *str += 3;
  729|     86|    *clen -= 3;
  730|     86|    return TRUE;
  ------------------
  |  | 1055|     86|#define TRUE true
  ------------------
  731|     86|  }
  732|  34.6k|  return FALSE;
  ------------------
  |  | 1058|  34.6k|#define FALSE false
  ------------------
  733|  44.9k|}
urlapi.c:free_urlhandle:
   69|  52.3k|{
   70|  52.3k|  curlx_free(u->scheme);
  ------------------
  |  | 1483|  52.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   71|  52.3k|  curlx_free(u->user);
  ------------------
  |  | 1483|  52.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   72|  52.3k|  curlx_free(u->password);
  ------------------
  |  | 1483|  52.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   73|  52.3k|  curlx_free(u->options);
  ------------------
  |  | 1483|  52.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   74|  52.3k|  curlx_free(u->host);
  ------------------
  |  | 1483|  52.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   75|  52.3k|  curlx_free(u->zoneid);
  ------------------
  |  | 1483|  52.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   76|  52.3k|  curlx_free(u->port);
  ------------------
  |  | 1483|  52.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   77|  52.3k|  curlx_free(u->path);
  ------------------
  |  | 1483|  52.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   78|  52.3k|  curlx_free(u->query);
  ------------------
  |  | 1483|  52.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   79|  52.3k|  curlx_free(u->fragment);
  ------------------
  |  | 1483|  52.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   80|  52.3k|}
urlapi.c:urlget_url:
 1451|  31.5k|{
 1452|  31.5k|  char *url;
 1453|  31.5k|  char *allochost = NULL;
 1454|  31.5k|  const char *fragmentsep =
 1455|  31.5k|    (u->fragment || (u->fragment_present && flags & CURLU_GET_EMPTY)) ?
  ------------------
  |  |  102|    150|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
  |  Branch (1455:6): [True: 768, False: 30.7k]
  |  Branch (1455:22): [True: 150, False: 30.6k]
  |  Branch (1455:45): [True: 135, False: 15]
  ------------------
 1456|  30.6k|    "#" : "";
 1457|  31.5k|  const char *querysep = ((u->query && u->query[0]) ||
  ------------------
  |  Branch (1457:28): [True: 2.69k, False: 28.8k]
  |  Branch (1457:40): [True: 2.60k, False: 90]
  ------------------
 1458|  28.9k|                          (u->query_present && flags & CURLU_GET_EMPTY)) ?
  ------------------
  |  |  102|     90|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
  |  Branch (1458:28): [True: 90, False: 28.8k]
  |  Branch (1458:48): [True: 80, False: 10]
  ------------------
 1459|  28.8k|    "?" : "";
 1460|  31.5k|  char portbuf[7];
 1461|  31.5k|  if(u->scheme && curl_strequal("file", u->scheme)) {
  ------------------
  |  Branch (1461:6): [True: 16.2k, False: 15.2k]
  |  Branch (1461:19): [True: 25, False: 16.2k]
  ------------------
 1462|     25|    url = curl_maprintf("file://%s%s%s%s%s",
 1463|     25|                        u->path, querysep, u->query ? u->query : "",
  ------------------
  |  Branch (1463:44): [True: 3, False: 22]
  ------------------
 1464|     25|                        fragmentsep, u->fragment ? u->fragment : "");
  ------------------
  |  Branch (1464:38): [True: 3, False: 22]
  ------------------
 1465|     25|  }
 1466|  31.5k|  else if(!u->host)
  ------------------
  |  Branch (1466:11): [True: 15.2k, False: 16.2k]
  ------------------
 1467|  15.2k|    return CURLUE_NO_HOST;
 1468|  16.2k|  else {
 1469|  16.2k|    const char *scheme;
 1470|  16.2k|    char *options = u->options;
 1471|  16.2k|    char *port = u->port;
 1472|  16.2k|    const struct Curl_scheme *h = NULL;
 1473|  16.2k|    char schemebuf[MAX_SCHEME_LEN + 5];
 1474|  16.2k|    if(u->scheme)
  ------------------
  |  Branch (1474:8): [True: 16.2k, False: 0]
  ------------------
 1475|  16.2k|      scheme = u->scheme;
 1476|      0|    else if(flags & CURLU_DEFAULT_SCHEME)
  ------------------
  |  |   88|      0|#define CURLU_DEFAULT_SCHEME (1 << 2)     /* return default scheme if
  ------------------
  |  Branch (1476:13): [True: 0, False: 0]
  ------------------
 1477|      0|      scheme = DEFAULT_SCHEME;
  ------------------
  |  |   66|      0|#define DEFAULT_SCHEME "https"
  ------------------
 1478|      0|    else
 1479|      0|      return CURLUE_NO_SCHEME;
 1480|       |
 1481|  16.2k|    h = Curl_get_scheme(scheme);
 1482|  16.2k|    if(!port && (flags & CURLU_DEFAULT_PORT)) {
  ------------------
  |  |   84|  15.5k|#define CURLU_DEFAULT_PORT (1 << 0)       /* return default port number */
  ------------------
  |  Branch (1482:8): [True: 15.5k, False: 667]
  |  Branch (1482:17): [True: 0, False: 15.5k]
  ------------------
 1483|       |      /* there is no stored port number, but asked to deliver
 1484|       |         a default one for the scheme */
 1485|      0|      if(h) {
  ------------------
  |  Branch (1485:10): [True: 0, False: 0]
  ------------------
 1486|      0|        curl_msnprintf(portbuf, sizeof(portbuf), "%u", h->defport);
 1487|      0|        port = portbuf;
 1488|      0|      }
 1489|      0|    }
 1490|  16.2k|    else if(port) {
  ------------------
  |  Branch (1490:13): [True: 667, False: 15.5k]
  ------------------
 1491|       |      /* there is a stored port number, but asked to inhibit if it matches
 1492|       |         the default one for the scheme */
 1493|    667|      if(h && (h->defport == u->portnum) &&
  ------------------
  |  Branch (1493:10): [True: 664, False: 3]
  |  Branch (1493:15): [True: 90, False: 574]
  ------------------
 1494|     90|         (flags & CURLU_NO_DEFAULT_PORT))
  ------------------
  |  |   85|     90|#define CURLU_NO_DEFAULT_PORT (1 << 1)    /* act as if no port number was set,
  ------------------
  |  Branch (1494:10): [True: 41, False: 49]
  ------------------
 1495|     41|        port = NULL;
 1496|    667|    }
 1497|       |
 1498|  16.2k|    if(h && !(h->flags & PROTOPT_URLOPTIONS))
  ------------------
  |  |  225|  16.2k|#define PROTOPT_URLOPTIONS (1 << 10) /* allow options part in the userinfo
  ------------------
  |  Branch (1498:8): [True: 16.2k, False: 30]
  |  Branch (1498:13): [True: 16.2k, False: 10]
  ------------------
 1499|  16.2k|      options = NULL;
 1500|       |
 1501|  16.2k|    if(u->host[0] == '[') {
  ------------------
  |  Branch (1501:8): [True: 74, False: 16.1k]
  ------------------
 1502|     74|      if(u->zoneid) {
  ------------------
  |  Branch (1502:10): [True: 41, False: 33]
  ------------------
 1503|       |        /* make it '[ host %25 zoneid ]' */
 1504|     41|        struct dynbuf enc;
 1505|     41|        size_t hostlen = strlen(u->host);
 1506|     41|        curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|     41|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1507|     41|        if(curlx_dyn_addf(&enc, "%.*s%%25%s]", (int)hostlen - 1, u->host,
  ------------------
  |  Branch (1507:12): [True: 0, False: 41]
  ------------------
 1508|     41|                          u->zoneid))
 1509|      0|          return CURLUE_OUT_OF_MEMORY;
 1510|     41|        allochost = curlx_dyn_ptr(&enc);
 1511|     41|      }
 1512|     74|    }
 1513|  16.1k|    else if(flags & CURLU_URLENCODE) {
  ------------------
  |  |   94|  16.1k|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1513:13): [True: 413, False: 15.7k]
  ------------------
 1514|    413|      allochost = curl_easy_escape(NULL, u->host, 0);
 1515|    413|      if(!allochost)
  ------------------
  |  Branch (1515:10): [True: 0, False: 413]
  ------------------
 1516|      0|        return CURLUE_OUT_OF_MEMORY;
 1517|    413|    }
 1518|  15.7k|    else if(flags & CURLU_PUNYCODE) {
  ------------------
  |  |  100|  15.7k|#define CURLU_PUNYCODE (1 << 12)          /* get the hostname in punycode */
  ------------------
  |  Branch (1518:13): [True: 0, False: 15.7k]
  ------------------
 1519|      0|      if(!Curl_is_ASCII_name(u->host)) {
  ------------------
  |  Branch (1519:10): [True: 0, False: 0]
  ------------------
 1520|      0|        CURLUcode ret = host_decode(u->host, &allochost);
 1521|      0|        if(ret)
  ------------------
  |  Branch (1521:12): [True: 0, False: 0]
  ------------------
 1522|      0|          return ret;
 1523|      0|      }
 1524|      0|    }
 1525|  15.7k|    else if(flags & CURLU_PUNY2IDN) {
  ------------------
  |  |  101|  15.7k|#define CURLU_PUNY2IDN (1 << 13)          /* punycode => IDN conversion */
  ------------------
  |  Branch (1525:13): [True: 0, False: 15.7k]
  ------------------
 1526|      0|      if(Curl_is_ASCII_name(u->host)) {
  ------------------
  |  Branch (1526:10): [True: 0, False: 0]
  ------------------
 1527|      0|        CURLUcode ret = host_encode(u->host, &allochost);
 1528|      0|        if(ret)
  ------------------
  |  Branch (1528:12): [True: 0, False: 0]
  ------------------
 1529|      0|          return ret;
 1530|      0|      }
 1531|      0|    }
 1532|       |
 1533|  16.2k|    if(!(flags & CURLU_NO_GUESS_SCHEME) || !u->guessed_scheme)
  ------------------
  |  |  105|  16.2k|#define CURLU_NO_GUESS_SCHEME (1 << 15)   /* for get, do not accept a guess */
  ------------------
  |  Branch (1533:8): [True: 16.2k, False: 0]
  |  Branch (1533:44): [True: 0, False: 0]
  ------------------
 1534|  16.2k|      curl_msnprintf(schemebuf, sizeof(schemebuf), "%s://", scheme);
 1535|      0|    else
 1536|      0|      schemebuf[0] = 0;
 1537|       |
 1538|  16.2k|    url = curl_maprintf("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
 1539|  16.2k|                        schemebuf,
 1540|  16.2k|                        u->user ? u->user : "",
  ------------------
  |  Branch (1540:25): [True: 5.03k, False: 11.2k]
  ------------------
 1541|  16.2k|                        u->password ? ":" : "",
  ------------------
  |  Branch (1541:25): [True: 1.80k, False: 14.4k]
  ------------------
 1542|  16.2k|                        u->password ? u->password : "",
  ------------------
  |  Branch (1542:25): [True: 1.80k, False: 14.4k]
  ------------------
 1543|  16.2k|                        options ? ";" : "",
  ------------------
  |  Branch (1543:25): [True: 3, False: 16.2k]
  ------------------
 1544|  16.2k|                        options ? options : "",
  ------------------
  |  Branch (1544:25): [True: 3, False: 16.2k]
  ------------------
 1545|  16.2k|                        (u->user || u->password || options) ? "@" : "",
  ------------------
  |  Branch (1545:26): [True: 5.03k, False: 11.2k]
  |  Branch (1545:37): [True: 0, False: 11.2k]
  |  Branch (1545:52): [True: 0, False: 11.2k]
  ------------------
 1546|  16.2k|                        allochost ? allochost : u->host,
  ------------------
  |  Branch (1546:25): [True: 454, False: 15.8k]
  ------------------
 1547|  16.2k|                        port ? ":" : "",
  ------------------
  |  Branch (1547:25): [True: 626, False: 15.6k]
  ------------------
 1548|  16.2k|                        port ? port : "",
  ------------------
  |  Branch (1548:25): [True: 626, False: 15.6k]
  ------------------
 1549|  16.2k|                        u->path ? u->path : "/",
  ------------------
  |  Branch (1549:25): [True: 5.19k, False: 11.0k]
  ------------------
 1550|  16.2k|                        querysep,
 1551|  16.2k|                        u->query ? u->query : "",
  ------------------
  |  Branch (1551:25): [True: 2.69k, False: 13.5k]
  ------------------
 1552|  16.2k|                        fragmentsep,
 1553|  16.2k|                        u->fragment ? u->fragment : "");
  ------------------
  |  Branch (1553:25): [True: 765, False: 15.4k]
  ------------------
 1554|  16.2k|    curlx_free(allochost);
  ------------------
  |  | 1483|  16.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1555|  16.2k|  }
 1556|  16.2k|  if(!url)
  ------------------
  |  Branch (1556:6): [True: 0, False: 16.2k]
  ------------------
 1557|      0|    return CURLUE_OUT_OF_MEMORY;
 1558|  16.2k|  *part = url;
 1559|  16.2k|  return CURLUE_OK;
 1560|  16.2k|}
urlapi.c:urlget_format:
 1383|  76.6k|{
 1384|  76.6k|  CURLUcode uc = CURLUE_OK;
 1385|  76.6k|  size_t partlen = strlen(ptr);
 1386|  76.6k|  bool urldecode = (flags & CURLU_URLDECODE) ? 1 : 0;
  ------------------
  |  |   93|  76.6k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  ------------------
  |  Branch (1386:20): [True: 10.1k, False: 66.5k]
  ------------------
 1387|  76.6k|  bool urlencode = (flags & CURLU_URLENCODE) ? 1 : 0;
  ------------------
  |  |   94|  76.6k|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1387:20): [True: 14.1k, False: 62.5k]
  ------------------
 1388|  76.6k|  bool punycode = (flags & CURLU_PUNYCODE) && (what == CURLUPART_HOST);
  ------------------
  |  |  100|  76.6k|#define CURLU_PUNYCODE (1 << 12)          /* get the hostname in punycode */
  ------------------
  |  Branch (1388:19): [True: 0, False: 76.6k]
  |  Branch (1388:47): [True: 0, False: 0]
  ------------------
 1389|  76.6k|  bool depunyfy = (flags & CURLU_PUNY2IDN) && (what == CURLUPART_HOST);
  ------------------
  |  |  101|  76.6k|#define CURLU_PUNY2IDN (1 << 13)          /* punycode => IDN conversion */
  ------------------
  |  Branch (1389:19): [True: 0, False: 76.6k]
  |  Branch (1389:47): [True: 0, False: 0]
  ------------------
 1390|  76.6k|  char *part = curlx_memdup0(ptr, partlen);
 1391|  76.6k|  *partp = NULL;
 1392|  76.6k|  if(!part)
  ------------------
  |  Branch (1392:6): [True: 0, False: 76.6k]
  ------------------
 1393|      0|    return CURLUE_OUT_OF_MEMORY;
 1394|  76.6k|  if(plusdecode) {
  ------------------
  |  Branch (1394:6): [True: 0, False: 76.6k]
  ------------------
 1395|       |    /* convert + to space */
 1396|      0|    char *plus = part;
 1397|      0|    size_t i = 0;
 1398|      0|    for(i = 0; i < partlen; ++plus, i++) {
  ------------------
  |  Branch (1398:16): [True: 0, False: 0]
  ------------------
 1399|      0|      if(*plus == '+')
  ------------------
  |  Branch (1399:10): [True: 0, False: 0]
  ------------------
 1400|      0|        *plus = ' ';
 1401|      0|    }
 1402|      0|  }
 1403|  76.6k|  if(urldecode) {
  ------------------
  |  Branch (1403:6): [True: 10.1k, False: 66.5k]
  ------------------
 1404|  10.1k|    char *decoded;
 1405|  10.1k|    size_t dlen;
 1406|       |    /* this unconditional rejection of control bytes is documented API
 1407|       |       behavior */
 1408|  10.1k|    CURLcode result = Curl_urldecode(part, partlen, &decoded, &dlen,
 1409|  10.1k|                                     REJECT_CTRL);
 1410|  10.1k|    curlx_free(part);
  ------------------
  |  | 1483|  10.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1411|  10.1k|    if(result)
  ------------------
  |  Branch (1411:8): [True: 2, False: 10.1k]
  ------------------
 1412|      2|      return CURLUE_URLDECODE;
 1413|  10.1k|    part = decoded;
 1414|  10.1k|    partlen = dlen;
 1415|  10.1k|  }
 1416|  76.6k|  if(urlencode) {
  ------------------
  |  Branch (1416:6): [True: 14.1k, False: 62.5k]
  ------------------
 1417|  14.1k|    struct dynbuf enc;
 1418|  14.1k|    curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|  14.1k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1419|  14.1k|    uc = urlencode_str(&enc, part, partlen, TRUE, what == CURLUPART_QUERY ?
  ------------------
  |  | 1055|  14.1k|#define TRUE true
  ------------------
  |  Branch (1419:51): [True: 0, False: 14.1k]
  ------------------
 1420|  14.1k|                       QUERY_YES : QUERY_NO);
  ------------------
  |  |   54|      0|#define QUERY_YES     4
  ------------------
                                     QUERY_YES : QUERY_NO);
  ------------------
  |  |   52|  28.2k|#define QUERY_NO      2
  ------------------
 1421|  14.1k|    curlx_free(part);
  ------------------
  |  | 1483|  14.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1422|  14.1k|    if(uc)
  ------------------
  |  Branch (1422:8): [True: 0, False: 14.1k]
  ------------------
 1423|      0|      return uc;
 1424|  14.1k|    part = curlx_dyn_ptr(&enc);
 1425|  14.1k|  }
 1426|  62.5k|  else if(punycode) {
  ------------------
  |  Branch (1426:11): [True: 0, False: 62.5k]
  ------------------
 1427|      0|    if(!Curl_is_ASCII_name(u->host)) {
  ------------------
  |  Branch (1427:8): [True: 0, False: 0]
  ------------------
 1428|      0|      char *punyversion = NULL;
 1429|      0|      uc = host_decode(part, &punyversion);
 1430|      0|      curlx_free(part);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1431|      0|      if(uc)
  ------------------
  |  Branch (1431:10): [True: 0, False: 0]
  ------------------
 1432|      0|        return uc;
 1433|      0|      part = punyversion;
 1434|      0|    }
 1435|      0|  }
 1436|  62.5k|  else if(depunyfy) {
  ------------------
  |  Branch (1436:11): [True: 0, False: 62.5k]
  ------------------
 1437|      0|    if(Curl_is_ASCII_name(u->host)) {
  ------------------
  |  Branch (1437:8): [True: 0, False: 0]
  ------------------
 1438|      0|      char *unpunified = NULL;
 1439|      0|      uc = host_encode(part, &unpunified);
 1440|      0|      curlx_free(part);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1441|      0|      if(uc)
  ------------------
  |  Branch (1441:10): [True: 0, False: 0]
  ------------------
 1442|      0|        return uc;
 1443|      0|      part = unpunified;
 1444|      0|    }
 1445|      0|  }
 1446|  76.6k|  *partp = part;
 1447|  76.6k|  return CURLUE_OK;
 1448|  76.6k|}
urlapi.c:urlset_clear:
 1756|    174|{
 1757|    174|  switch(what) {
 1758|      0|  case CURLUPART_URL:
  ------------------
  |  Branch (1758:3): [True: 0, False: 174]
  ------------------
 1759|      0|    free_urlhandle(u);
 1760|      0|    memset(u, 0, sizeof(struct Curl_URL));
 1761|      0|    break;
 1762|      0|  case CURLUPART_SCHEME:
  ------------------
  |  Branch (1762:3): [True: 0, False: 174]
  ------------------
 1763|      0|    curlx_safefree(u->scheme);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1764|      0|    u->guessed_scheme = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1765|      0|    break;
 1766|     16|  case CURLUPART_USER:
  ------------------
  |  Branch (1766:3): [True: 16, False: 158]
  ------------------
 1767|     16|    curlx_safefree(u->user);
  ------------------
  |  | 1327|     16|  do {                      \
  |  | 1328|     16|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|     16|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|     16|    (ptr) = NULL;           \
  |  | 1330|     16|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 16]
  |  |  ------------------
  ------------------
 1768|     16|    break;
 1769|     16|  case CURLUPART_PASSWORD:
  ------------------
  |  Branch (1769:3): [True: 16, False: 158]
  ------------------
 1770|     16|    curlx_safefree(u->password);
  ------------------
  |  | 1327|     16|  do {                      \
  |  | 1328|     16|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|     16|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|     16|    (ptr) = NULL;           \
  |  | 1330|     16|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 16]
  |  |  ------------------
  ------------------
 1771|     16|    break;
 1772|      0|  case CURLUPART_OPTIONS:
  ------------------
  |  Branch (1772:3): [True: 0, False: 174]
  ------------------
 1773|      0|    curlx_safefree(u->options);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1774|      0|    break;
 1775|      0|  case CURLUPART_HOST:
  ------------------
  |  Branch (1775:3): [True: 0, False: 174]
  ------------------
 1776|      0|    curlx_safefree(u->host);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1777|      0|    break;
 1778|      0|  case CURLUPART_ZONEID:
  ------------------
  |  Branch (1778:3): [True: 0, False: 174]
  ------------------
 1779|      0|    curlx_safefree(u->zoneid);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1780|      0|    break;
 1781|      0|  case CURLUPART_PORT:
  ------------------
  |  Branch (1781:3): [True: 0, False: 174]
  ------------------
 1782|      0|    u->portnum = 0;
 1783|      0|    curlx_safefree(u->port);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1784|      0|    break;
 1785|      0|  case CURLUPART_PATH:
  ------------------
  |  Branch (1785:3): [True: 0, False: 174]
  ------------------
 1786|      0|    curlx_safefree(u->path);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1787|      0|    break;
 1788|      0|  case CURLUPART_QUERY:
  ------------------
  |  Branch (1788:3): [True: 0, False: 174]
  ------------------
 1789|      0|    curlx_safefree(u->query);
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1790|      0|    u->query_present = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1791|      0|    break;
 1792|    142|  case CURLUPART_FRAGMENT:
  ------------------
  |  Branch (1792:3): [True: 142, False: 32]
  ------------------
 1793|    142|    curlx_safefree(u->fragment);
  ------------------
  |  | 1327|    142|  do {                      \
  |  | 1328|    142|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|    142|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|    142|    (ptr) = NULL;           \
  |  | 1330|    142|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 142]
  |  |  ------------------
  ------------------
 1794|    142|    u->fragment_present = FALSE;
  ------------------
  |  | 1058|    142|#define FALSE false
  ------------------
 1795|    142|    break;
 1796|      0|  default:
  ------------------
  |  Branch (1796:3): [True: 0, False: 174]
  ------------------
 1797|      0|    return CURLUE_UNKNOWN_PART;
 1798|    174|  }
 1799|    174|  return CURLUE_OK;
 1800|    174|}
urlapi.c:set_url_port:
 1689|     46|{
 1690|     46|  char *tmp;
 1691|     46|  curl_off_t port;
 1692|     46|  if(!ISDIGIT(provided_port[0]))
  ------------------
  |  |   44|     46|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 46, False: 0]
  |  |  |  Branch (44:38): [True: 46, False: 0]
  |  |  ------------------
  ------------------
 1693|       |    /* not a number */
 1694|      0|    return CURLUE_BAD_PORT_NUMBER;
 1695|     46|  if(curlx_str_number(&provided_port, &port, 0xffff) || *provided_port)
  ------------------
  |  Branch (1695:6): [True: 0, False: 46]
  |  Branch (1695:57): [True: 0, False: 46]
  ------------------
 1696|       |    /* weirdly provided number, not good! */
 1697|      0|    return CURLUE_BAD_PORT_NUMBER;
 1698|     46|  tmp = curl_maprintf("%" CURL_FORMAT_CURL_OFF_T, port);
  ------------------
  |  |  341|     46|#    define CURL_FORMAT_CURL_OFF_T     "ld"
  ------------------
 1699|     46|  if(!tmp)
  ------------------
  |  Branch (1699:6): [True: 0, False: 46]
  ------------------
 1700|      0|    return CURLUE_OUT_OF_MEMORY;
 1701|     46|  curlx_free(u->port);
  ------------------
  |  | 1483|     46|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1702|     46|  u->port = tmp;
 1703|     46|  u->portnum = (unsigned short)port;
 1704|     46|  return CURLUE_OK;
 1705|     46|}
urlapi.c:set_url:
 1709|  26.6k|{
 1710|       |  /*
 1711|       |   * Allow a new URL to replace the existing (if any) contents.
 1712|       |   *
 1713|       |   * If the existing contents is enough for a URL, allow a relative URL to
 1714|       |   * replace it.
 1715|       |   */
 1716|  26.6k|  CURLUcode uc;
 1717|  26.6k|  char *oldurl = NULL;
 1718|       |
 1719|  26.6k|  if(!part_size) {
  ------------------
  |  Branch (1719:6): [True: 219, False: 26.4k]
  ------------------
 1720|       |    /* a blank URL is not a valid URL unless we already have a complete one
 1721|       |       and this is a redirect */
 1722|    219|    uc = curl_url_get(u, CURLUPART_URL, &oldurl, flags);
 1723|    219|    if(!uc) {
  ------------------
  |  Branch (1723:8): [True: 0, False: 219]
  ------------------
 1724|       |      /* success, meaning the "" is a fine relative URL, but nothing
 1725|       |         changes */
 1726|      0|      curlx_free(oldurl);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1727|      0|      return CURLUE_OK;
 1728|      0|    }
 1729|    219|    if(uc == CURLUE_OUT_OF_MEMORY)
  ------------------
  |  Branch (1729:8): [True: 0, False: 219]
  ------------------
 1730|      0|      return uc;
 1731|    219|    return CURLUE_MALFORMED_INPUT;
 1732|    219|  }
 1733|       |
 1734|       |  /* if the new URL is absolute replace the existing with the new. */
 1735|  26.4k|  if(Curl_is_absolute_url(url, NULL, 0,
  ------------------
  |  Branch (1735:6): [True: 10.9k, False: 15.5k]
  ------------------
 1736|  26.4k|                          flags & (CURLU_GUESS_SCHEME | CURLU_DEFAULT_SCHEME)))
  ------------------
  |  |   96|  26.4k|#define CURLU_GUESS_SCHEME (1 << 9)       /* legacy curl-style guessing */
  ------------------
                                        flags & (CURLU_GUESS_SCHEME | CURLU_DEFAULT_SCHEME)))
  ------------------
  |  |   88|  26.4k|#define CURLU_DEFAULT_SCHEME (1 << 2)     /* return default scheme if
  ------------------
 1737|  10.9k|    return parseurl_and_replace(url, u, flags);
 1738|       |
 1739|       |  /* if the old URL is incomplete (we cannot get an absolute URL in
 1740|       |     'oldurl'), replace the existing with the new.
 1741|       |     Always include "scheme://" to make the URL "complete" */
 1742|  15.5k|  uc = curl_url_get(u, CURLUPART_URL, &oldurl, flags& ~CURLU_NO_GUESS_SCHEME);
  ------------------
  |  |  105|  15.5k|#define CURLU_NO_GUESS_SCHEME (1 << 15)   /* for get, do not accept a guess */
  ------------------
 1743|  15.5k|  if(uc == CURLUE_OUT_OF_MEMORY)
  ------------------
  |  Branch (1743:6): [True: 0, False: 15.5k]
  ------------------
 1744|      0|    return uc;
 1745|  15.5k|  else if(uc)
  ------------------
  |  Branch (1745:11): [True: 15.0k, False: 499]
  ------------------
 1746|  15.0k|    return parseurl_and_replace(url, u, flags);
 1747|       |
 1748|    499|  DEBUGASSERT(oldurl); /* it is set here */
  ------------------
  |  | 1081|    499|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1748:3): [True: 0, False: 499]
  |  Branch (1748:3): [True: 499, False: 0]
  ------------------
 1749|       |  /* apply the relative part to create a new URL */
 1750|    499|  uc = redirect_url(oldurl, url, u, flags);
 1751|    499|  curlx_free(oldurl);
  ------------------
  |  | 1483|    499|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1752|    499|  return uc;
 1753|    499|}
urlapi.c:parseurl_and_replace:
 1218|  26.4k|{
 1219|  26.4k|  CURLUcode ures;
 1220|  26.4k|  CURLU tmpurl;
 1221|  26.4k|  memset(&tmpurl, 0, sizeof(tmpurl));
 1222|  26.4k|  ures = parseurl(url, &tmpurl, flags);
 1223|  26.4k|  if(!ures) {
  ------------------
  |  Branch (1223:6): [True: 25.7k, False: 685]
  ------------------
 1224|  25.7k|    free_urlhandle(u);
 1225|  25.7k|    *u = tmpurl;
 1226|  25.7k|  }
 1227|  26.4k|  return ures;
 1228|  26.4k|}
urlapi.c:parseurl:
 1127|  26.4k|{
 1128|  26.4k|  const char *path;
 1129|  26.4k|  size_t pathlen;
 1130|  26.4k|  char schemebuf[MAX_SCHEME_LEN + 1];
 1131|  26.4k|  size_t schemelen = 0;
 1132|  26.4k|  size_t urllen;
 1133|  26.4k|  CURLUcode ures = CURLUE_OK;
 1134|  26.4k|  struct dynbuf host;
 1135|  26.4k|  bool is_file = FALSE;
  ------------------
  |  | 1058|  26.4k|#define FALSE false
  ------------------
 1136|       |
 1137|  26.4k|  DEBUGASSERT(url);
  ------------------
  |  | 1081|  26.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1137:3): [True: 0, False: 26.4k]
  |  Branch (1137:3): [True: 26.4k, False: 0]
  ------------------
 1138|       |
 1139|  26.4k|  curlx_dyn_init(&host, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|  26.4k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1140|       |
 1141|  26.4k|  ures = Curl_junkscan(url, &urllen, !!(flags & CURLU_ALLOW_SPACE));
  ------------------
  |  |   99|  26.4k|#define CURLU_ALLOW_SPACE (1 << 11)       /* Allow spaces in the URL */
  ------------------
 1142|  26.4k|  if(ures)
  ------------------
  |  Branch (1142:6): [True: 33, False: 26.4k]
  ------------------
 1143|     33|    goto fail;
 1144|       |
 1145|  26.4k|  schemelen = Curl_is_absolute_url(url, schemebuf, sizeof(schemebuf),
 1146|  26.4k|                                   flags & (CURLU_GUESS_SCHEME |
  ------------------
  |  |   96|  26.4k|#define CURLU_GUESS_SCHEME (1 << 9)       /* legacy curl-style guessing */
  ------------------
 1147|  26.4k|                                            CURLU_DEFAULT_SCHEME));
  ------------------
  |  |   88|  26.4k|#define CURLU_DEFAULT_SCHEME (1 << 2)     /* return default scheme if
  ------------------
 1148|       |
 1149|       |  /* handle the file: scheme */
 1150|  26.4k|  if(schemelen && !strcmp(schemebuf, "file")) {
  ------------------
  |  Branch (1150:6): [True: 11.4k, False: 15.0k]
  |  Branch (1150:19): [True: 69, False: 11.3k]
  ------------------
 1151|     69|    is_file = TRUE;
  ------------------
  |  | 1055|     69|#define TRUE true
  ------------------
 1152|     69|    ures = parse_file(url, urllen, u, &path, &pathlen);
 1153|     69|  }
 1154|  26.3k|  else {
 1155|  26.3k|    const char *hostp = NULL;
 1156|  26.3k|    size_t hostlen;
 1157|  26.3k|    ures = parse_scheme(url, u, schemebuf, schemelen, flags, &hostp);
 1158|  26.3k|    if(ures)
  ------------------
  |  Branch (1158:8): [True: 6, False: 26.3k]
  ------------------
 1159|      6|      goto fail;
 1160|       |
 1161|       |    /* find the end of the hostname + port number */
 1162|  26.3k|    hostlen = strcspn(hostp, "/?#");
 1163|  26.3k|    path = &hostp[hostlen];
 1164|       |
 1165|       |    /* this pathlen also contains the query and the fragment */
 1166|  26.3k|    pathlen = urllen - (path - url);
 1167|  26.3k|    if(hostlen) {
  ------------------
  |  Branch (1167:8): [True: 26.3k, False: 58]
  ------------------
 1168|  26.3k|      ures = parse_authority(u, hostp, hostlen, flags, &host,
 1169|  26.3k|                             u->scheme != NULL);
 1170|  26.3k|      if(!ures && (flags & CURLU_GUESS_SCHEME) && !u->scheme)
  ------------------
  |  |   96|  25.7k|#define CURLU_GUESS_SCHEME (1 << 9)       /* legacy curl-style guessing */
  ------------------
  |  Branch (1170:10): [True: 25.7k, False: 545]
  |  Branch (1170:19): [True: 23.8k, False: 1.89k]
  |  Branch (1170:51): [True: 14.8k, False: 9.01k]
  ------------------
 1171|  14.8k|        ures = guess_scheme(u, &host);
 1172|  26.3k|    }
 1173|     58|    else if(flags & CURLU_NO_AUTHORITY) {
  ------------------
  |  |   97|     58|#define CURLU_NO_AUTHORITY (1 << 10)      /* Allow empty authority when the
  ------------------
  |  Branch (1173:13): [True: 0, False: 58]
  ------------------
 1174|       |      /* allowed to be empty. */
 1175|      0|      if(curlx_dyn_add(&host, ""))
  ------------------
  |  Branch (1175:10): [True: 0, False: 0]
  ------------------
 1176|      0|        ures = CURLUE_OUT_OF_MEMORY;
 1177|      0|    }
 1178|     58|    else
 1179|     58|      ures = CURLUE_NO_HOST;
 1180|  26.3k|  }
 1181|  26.4k|  if(!ures) {
  ------------------
  |  Branch (1181:6): [True: 25.7k, False: 646]
  ------------------
 1182|       |    /* The path might at this point contain a fragment and/or a query to
 1183|       |       handle */
 1184|  25.7k|    const char *fragment = strchr(path, '#');
 1185|  25.7k|    if(fragment) {
  ------------------
  |  Branch (1185:8): [True: 1.61k, False: 24.1k]
  ------------------
 1186|  1.61k|      size_t fraglen = pathlen - (fragment - path);
 1187|  1.61k|      ures = handle_fragment(u, fragment, fraglen, flags);
 1188|       |      /* after this, pathlen still contains the query */
 1189|  1.61k|      pathlen -= fraglen;
 1190|  1.61k|    }
 1191|  25.7k|  }
 1192|  26.4k|  if(!ures) {
  ------------------
  |  Branch (1192:6): [True: 25.7k, False: 646]
  ------------------
 1193|  25.7k|    const char *query = memchr(path, '?', pathlen);
 1194|  25.7k|    if(query) {
  ------------------
  |  Branch (1194:8): [True: 2.85k, False: 22.9k]
  ------------------
 1195|  2.85k|      size_t qlen = pathlen - (query - path);
 1196|  2.85k|      ures = handle_query(u, query, qlen, flags);
 1197|  2.85k|      pathlen -= qlen;
 1198|  2.85k|    }
 1199|  25.7k|  }
 1200|  26.4k|  if(!ures)
  ------------------
  |  Branch (1200:6): [True: 25.7k, False: 646]
  ------------------
 1201|       |    /* the fragment and query parts are trimmed off from the path */
 1202|  25.7k|    ures = handle_path(u, path, pathlen, flags, is_file);
 1203|  26.4k|  if(!ures) {
  ------------------
  |  Branch (1203:6): [True: 25.7k, False: 646]
  ------------------
 1204|  25.7k|    u->host = curlx_dyn_ptr(&host);
 1205|  25.7k|    return CURLUE_OK;
 1206|  25.7k|  }
 1207|    685|fail:
 1208|    685|  curlx_dyn_free(&host);
 1209|    685|  free_urlhandle(u);
 1210|    685|  return ures;
 1211|  26.4k|}
urlapi.c:parse_scheme:
  956|  26.3k|{
  957|       |  /* clear path */
  958|  26.3k|  const char *schemep = NULL;
  959|       |
  960|  26.3k|  if(schemelen) {
  ------------------
  |  Branch (960:6): [True: 11.3k, False: 15.0k]
  ------------------
  961|  11.3k|    int i = 0;
  962|  11.3k|    const char *p = &url[schemelen + 1];
  963|  26.6k|    while((*p == '/') && (i < 4)) {
  ------------------
  |  Branch (963:11): [True: 15.3k, False: 11.3k]
  |  Branch (963:26): [True: 15.3k, False: 0]
  ------------------
  964|  15.3k|      p++;
  965|  15.3k|      i++;
  966|  15.3k|    }
  967|       |
  968|  11.3k|    schemep = schemebuf;
  969|  11.3k|    if(!Curl_get_scheme(schemep) &&
  ------------------
  |  Branch (969:8): [True: 64, False: 11.2k]
  ------------------
  970|     64|       !(flags & CURLU_NON_SUPPORT_SCHEME))
  ------------------
  |  |   90|     64|#define CURLU_NON_SUPPORT_SCHEME (1 << 3) /* allow non-supported scheme */
  ------------------
  |  Branch (970:8): [True: 1, False: 63]
  ------------------
  971|      1|      return CURLUE_UNSUPPORTED_SCHEME;
  972|       |
  973|  11.3k|    if((i < 1) || (i > 3))
  ------------------
  |  Branch (973:8): [True: 2, False: 11.3k]
  |  Branch (973:19): [True: 3, False: 11.3k]
  ------------------
  974|       |      /* less than one or more than three slashes */
  975|      5|      return CURLUE_BAD_SLASHES;
  976|       |
  977|  11.3k|    *hostpp = p; /* hostname starts here */
  978|  11.3k|  }
  979|  15.0k|  else {
  980|       |    /* no scheme! */
  981|       |
  982|  15.0k|    if(!(flags & (CURLU_DEFAULT_SCHEME | CURLU_GUESS_SCHEME)))
  ------------------
  |  |   88|  15.0k|#define CURLU_DEFAULT_SCHEME (1 << 2)     /* return default scheme if
  ------------------
                  if(!(flags & (CURLU_DEFAULT_SCHEME | CURLU_GUESS_SCHEME)))
  ------------------
  |  |   96|  15.0k|#define CURLU_GUESS_SCHEME (1 << 9)       /* legacy curl-style guessing */
  ------------------
  |  Branch (982:8): [True: 0, False: 15.0k]
  ------------------
  983|      0|      return CURLUE_BAD_SCHEME;
  984|       |
  985|  15.0k|    if(flags & CURLU_DEFAULT_SCHEME)
  ------------------
  |  |   88|  15.0k|#define CURLU_DEFAULT_SCHEME (1 << 2)     /* return default scheme if
  ------------------
  |  Branch (985:8): [True: 0, False: 15.0k]
  ------------------
  986|      0|      schemep = DEFAULT_SCHEME;
  ------------------
  |  |   66|      0|#define DEFAULT_SCHEME "https"
  ------------------
  987|       |
  988|       |    /*
  989|       |     * The URL was badly formatted, let's try without scheme specified.
  990|       |     */
  991|  15.0k|    *hostpp = url;
  992|  15.0k|  }
  993|       |
  994|  26.3k|  if(schemep) {
  ------------------
  |  Branch (994:6): [True: 11.3k, False: 15.0k]
  ------------------
  995|  11.3k|    u->scheme = curlx_strdup(schemep);
  ------------------
  |  | 1477|  11.3k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  996|  11.3k|    if(!u->scheme)
  ------------------
  |  Branch (996:8): [True: 0, False: 11.3k]
  ------------------
  997|      0|      return CURLUE_OUT_OF_MEMORY;
  998|  11.3k|  }
  999|  26.3k|  return CURLUE_OK;
 1000|  26.3k|}
urlapi.c:guess_scheme:
 1003|  14.8k|{
 1004|  14.8k|  const char *hostname = curlx_dyn_ptr(host);
 1005|  14.8k|  const char *schemep = NULL;
 1006|       |  /* legacy curl-style guess based on hostname */
 1007|  14.8k|  if(checkprefix("ftp.", hostname))
  ------------------
  |  |   33|  14.8k|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1292|  14.8k|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |  |  Branch (33:27): [True: 5.18k, False: 9.66k]
  |  |  ------------------
  ------------------
 1008|  5.18k|    schemep = "ftp";
 1009|  9.66k|  else if(checkprefix("dict.", hostname))
  ------------------
  |  |   33|  9.66k|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1292|  9.66k|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |  |  Branch (33:27): [True: 1, False: 9.65k]
  |  |  ------------------
  ------------------
 1010|      1|    schemep = "dict";
 1011|  9.65k|  else if(checkprefix("ldap.", hostname))
  ------------------
  |  |   33|  9.65k|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1292|  9.65k|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |  |  Branch (33:27): [True: 1, False: 9.65k]
  |  |  ------------------
  ------------------
 1012|      1|    schemep = "ldap";
 1013|  9.65k|  else if(checkprefix("imap.", hostname))
  ------------------
  |  |   33|  9.65k|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1292|  9.65k|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |  |  Branch (33:27): [True: 1, False: 9.65k]
  |  |  ------------------
  ------------------
 1014|      1|    schemep = "imap";
 1015|  9.65k|  else if(checkprefix("smtp.", hostname))
  ------------------
  |  |   33|  9.65k|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1292|  9.65k|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |  |  Branch (33:27): [True: 1, False: 9.65k]
  |  |  ------------------
  ------------------
 1016|      1|    schemep = "smtp";
 1017|  9.65k|  else if(checkprefix("pop3.", hostname))
  ------------------
  |  |   33|  9.65k|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1292|  9.65k|#define STRCONST(x) x, sizeof(x) - 1
  |  |  ------------------
  |  |  |  Branch (33:27): [True: 1, False: 9.65k]
  |  |  ------------------
  ------------------
 1018|      1|    schemep = "pop3";
 1019|  9.65k|  else
 1020|  9.65k|    schemep = "http";
 1021|       |
 1022|  14.8k|  u->scheme = curlx_strdup(schemep);
  ------------------
  |  | 1477|  14.8k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1023|  14.8k|  if(!u->scheme)
  ------------------
  |  Branch (1023:6): [True: 0, False: 14.8k]
  ------------------
 1024|      0|    return CURLUE_OUT_OF_MEMORY;
 1025|       |
 1026|  14.8k|  u->guessed_scheme = TRUE;
  ------------------
  |  | 1055|  14.8k|#define TRUE true
  ------------------
 1027|  14.8k|  return CURLUE_OK;
 1028|  14.8k|}
urlapi.c:handle_fragment:
 1032|  1.61k|{
 1033|  1.61k|  CURLUcode ures;
 1034|  1.61k|  u->fragment_present = TRUE;
  ------------------
  |  | 1055|  1.61k|#define TRUE true
  ------------------
 1035|  1.61k|  if(fraglen > 1) {
  ------------------
  |  Branch (1035:6): [True: 1.41k, False: 200]
  ------------------
 1036|       |    /* skip the leading '#' in the copy but include the terminating null */
 1037|  1.41k|    if(flags & CURLU_URLENCODE) {
  ------------------
  |  |   94|  1.41k|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1037:8): [True: 134, False: 1.28k]
  ------------------
 1038|    134|      struct dynbuf enc;
 1039|    134|      curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|    134|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1040|    134|      ures = urlencode_str(&enc, fragment + 1, fraglen - 1, TRUE, QUERY_NO);
  ------------------
  |  | 1055|    134|#define TRUE true
  ------------------
                    ures = urlencode_str(&enc, fragment + 1, fraglen - 1, TRUE, QUERY_NO);
  ------------------
  |  |   52|    134|#define QUERY_NO      2
  ------------------
 1041|    134|      if(ures)
  ------------------
  |  Branch (1041:10): [True: 0, False: 134]
  ------------------
 1042|      0|        return ures;
 1043|    134|      u->fragment = curlx_dyn_ptr(&enc);
 1044|    134|    }
 1045|  1.28k|    else {
 1046|  1.28k|      u->fragment = curlx_memdup0(fragment + 1, fraglen - 1);
 1047|  1.28k|      if(!u->fragment)
  ------------------
  |  Branch (1047:10): [True: 0, False: 1.28k]
  ------------------
 1048|      0|        return CURLUE_OUT_OF_MEMORY;
 1049|  1.28k|    }
 1050|  1.41k|  }
 1051|  1.61k|  return CURLUE_OK;
 1052|  1.61k|}
urlapi.c:handle_query:
 1056|  2.85k|{
 1057|  2.85k|  u->query_present = TRUE;
  ------------------
  |  | 1055|  2.85k|#define TRUE true
  ------------------
 1058|  2.85k|  if(qlen > 1) {
  ------------------
  |  Branch (1058:6): [True: 2.74k, False: 115]
  ------------------
 1059|  2.74k|    if(flags & CURLU_URLENCODE) {
  ------------------
  |  |   94|  2.74k|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1059:8): [True: 358, False: 2.38k]
  ------------------
 1060|    358|      struct dynbuf enc;
 1061|    358|      CURLUcode ures;
 1062|    358|      curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|    358|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1063|       |      /* skip the leading question mark */
 1064|    358|      ures = urlencode_str(&enc, query + 1, qlen - 1, TRUE, QUERY_YES);
  ------------------
  |  | 1055|    358|#define TRUE true
  ------------------
                    ures = urlencode_str(&enc, query + 1, qlen - 1, TRUE, QUERY_YES);
  ------------------
  |  |   54|    358|#define QUERY_YES     4
  ------------------
 1065|    358|      if(ures)
  ------------------
  |  Branch (1065:10): [True: 0, False: 358]
  ------------------
 1066|      0|        return ures;
 1067|    358|      u->query = curlx_dyn_ptr(&enc);
 1068|    358|    }
 1069|  2.38k|    else {
 1070|  2.38k|      u->query = curlx_memdup0(query + 1, qlen - 1);
 1071|  2.38k|      if(!u->query)
  ------------------
  |  Branch (1071:10): [True: 0, False: 2.38k]
  ------------------
 1072|      0|        return CURLUE_OUT_OF_MEMORY;
 1073|  2.38k|    }
 1074|  2.74k|  }
 1075|    115|  else {
 1076|       |    /* single byte query */
 1077|    115|    u->query = curlx_strdup("");
  ------------------
  |  | 1477|    115|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1078|    115|    if(!u->query)
  ------------------
  |  Branch (1078:8): [True: 0, False: 115]
  ------------------
 1079|      0|      return CURLUE_OUT_OF_MEMORY;
 1080|    115|  }
 1081|  2.85k|  return CURLUE_OK;
 1082|  2.85k|}
urlapi.c:handle_path:
 1087|  25.7k|{
 1088|  25.7k|  CURLUcode ures;
 1089|  25.7k|  if(pathlen && (flags & CURLU_URLENCODE)) {
  ------------------
  |  |   94|  6.96k|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1089:6): [True: 6.96k, False: 18.8k]
  |  Branch (1089:17): [True: 1.35k, False: 5.60k]
  ------------------
 1090|  1.35k|    struct dynbuf enc;
 1091|  1.35k|    curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|  1.35k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1092|  1.35k|    ures = urlencode_str(&enc, path, pathlen, TRUE, QUERY_NO);
  ------------------
  |  | 1055|  1.35k|#define TRUE true
  ------------------
                  ures = urlencode_str(&enc, path, pathlen, TRUE, QUERY_NO);
  ------------------
  |  |   52|  1.35k|#define QUERY_NO      2
  ------------------
 1093|  1.35k|    if(ures)
  ------------------
  |  Branch (1093:8): [True: 0, False: 1.35k]
  ------------------
 1094|      0|      return ures;
 1095|  1.35k|    pathlen = curlx_dyn_len(&enc);
 1096|  1.35k|    path = u->path = curlx_dyn_ptr(&enc);
 1097|  1.35k|  }
 1098|       |
 1099|  25.7k|  if(pathlen >= (size_t)(1 + !is_file)) {
  ------------------
  |  Branch (1099:6): [True: 5.50k, False: 20.2k]
  ------------------
 1100|       |    /* paths for file:// scheme can be one byte, others need to be two */
 1101|  5.50k|    if(!u->path) {
  ------------------
  |  Branch (1101:8): [True: 4.74k, False: 753]
  ------------------
 1102|  4.74k|      u->path = curlx_memdup0(path, pathlen);
 1103|  4.74k|      if(!u->path)
  ------------------
  |  Branch (1103:10): [True: 0, False: 4.74k]
  ------------------
 1104|      0|        return CURLUE_OUT_OF_MEMORY;
 1105|  4.74k|      path = u->path;
 1106|  4.74k|    }
 1107|    753|    else if(flags & CURLU_URLENCODE)
  ------------------
  |  |   94|    753|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1107:13): [True: 753, False: 0]
  ------------------
 1108|       |      /* it might have encoded more than the path so cut it */
 1109|    753|      u->path[pathlen] = 0;
 1110|       |
 1111|  5.50k|    if(!(flags & CURLU_PATH_AS_IS)) {
  ------------------
  |  |   91|  5.50k|#define CURLU_PATH_AS_IS (1 << 4)         /* leave dot sequences */
  ------------------
  |  Branch (1111:8): [True: 5.49k, False: 6]
  ------------------
 1112|       |      /* remove ../ and ./ sequences according to RFC3986 */
 1113|  5.49k|      char *dedot;
 1114|  5.49k|      int err = dedotdotify(path, pathlen, &dedot);
 1115|  5.49k|      if(err)
  ------------------
  |  Branch (1115:10): [True: 0, False: 5.49k]
  ------------------
 1116|      0|        return CURLUE_OUT_OF_MEMORY;
 1117|  5.49k|      if(dedot) {
  ------------------
  |  Branch (1117:10): [True: 5.48k, False: 9]
  ------------------
 1118|  5.48k|        curlx_free(u->path);
  ------------------
  |  | 1483|  5.48k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1119|  5.48k|        u->path = dedot;
 1120|  5.48k|      }
 1121|  5.49k|    }
 1122|  5.50k|  }
 1123|  25.7k|  return CURLUE_OK;
 1124|  25.7k|}
urlapi.c:redirect_url:
 1235|    499|{
 1236|    499|  struct dynbuf urlbuf;
 1237|    499|  bool host_changed = FALSE;
  ------------------
  |  | 1058|    499|#define FALSE false
  ------------------
 1238|    499|  const char *useurl = relurl;
 1239|    499|  const char *cutoff = NULL;
 1240|    499|  size_t prelen;
 1241|    499|  CURLUcode uc;
 1242|       |  /* this can get here with a NULL u->scheme only if asked to use the default
 1243|       |     scheme, so allow fallback to that */
 1244|    499|  const char *scheme = u->scheme ? u->scheme : DEFAULT_SCHEME;
  ------------------
  |  |   66|      0|#define DEFAULT_SCHEME "https"
  ------------------
  |  Branch (1244:24): [True: 499, False: 0]
  ------------------
 1245|       |
 1246|       |  /* protsep points to the start of the hostname, after [scheme]:// */
 1247|    499|  const char *protsep = base + strlen(scheme) + 3;
 1248|    499|  DEBUGASSERT(base && relurl && u); /* all set here */
  ------------------
  |  | 1081|    499|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1248:3): [True: 0, False: 499]
  |  Branch (1248:3): [True: 0, False: 0]
  |  Branch (1248:3): [True: 0, False: 0]
  |  Branch (1248:3): [True: 499, False: 0]
  |  Branch (1248:3): [True: 499, False: 0]
  |  Branch (1248:3): [True: 499, False: 0]
  ------------------
 1249|    499|  if(!base)
  ------------------
  |  Branch (1249:6): [True: 0, False: 499]
  ------------------
 1250|      0|    return CURLUE_MALFORMED_INPUT; /* should never happen */
 1251|       |
 1252|       |  /* handle different relative URL types */
 1253|    499|  switch(relurl[0]) {
 1254|     14|  case '/':
  ------------------
  |  Branch (1254:3): [True: 14, False: 485]
  ------------------
 1255|     14|    if(relurl[1] == '/') {
  ------------------
  |  Branch (1255:8): [True: 9, False: 5]
  ------------------
 1256|       |      /* protocol-relative URL: //example.com/path */
 1257|      9|      cutoff = protsep;
 1258|      9|      useurl = &relurl[2];
 1259|      9|      host_changed = TRUE;
  ------------------
  |  | 1055|      9|#define TRUE true
  ------------------
 1260|      9|    }
 1261|      5|    else
 1262|       |      /* absolute /path */
 1263|      5|      cutoff = strchr(protsep, '/');
 1264|     14|    break;
 1265|       |
 1266|      5|  case '#':
  ------------------
  |  Branch (1266:3): [True: 5, False: 494]
  ------------------
 1267|       |    /* fragment-only change */
 1268|      5|    if(u->fragment)
  ------------------
  |  Branch (1268:8): [True: 3, False: 2]
  ------------------
 1269|      3|      cutoff = strchr(protsep, '#');
 1270|      5|    break;
 1271|       |
 1272|    480|  default:
  ------------------
  |  Branch (1272:3): [True: 480, False: 19]
  ------------------
 1273|       |    /* path or query-only change */
 1274|    480|    if(u->query && u->query[0])
  ------------------
  |  Branch (1274:8): [True: 33, False: 447]
  |  Branch (1274:20): [True: 28, False: 5]
  ------------------
 1275|       |      /* remove existing query */
 1276|     28|      cutoff = strchr(protsep, '?');
 1277|    452|    else if(u->fragment && u->fragment[0])
  ------------------
  |  Branch (1277:13): [True: 28, False: 424]
  |  Branch (1277:28): [True: 28, False: 0]
  ------------------
 1278|       |      /* Remove existing fragment */
 1279|     28|      cutoff = strchr(protsep, '#');
 1280|       |
 1281|    480|    if(relurl[0] != '?') {
  ------------------
  |  Branch (1281:8): [True: 461, False: 19]
  ------------------
 1282|       |      /* append a relative path after the last slash */
 1283|    461|      cutoff = memrchr(protsep, '/',
 1284|    461|                       cutoff ? (size_t)(cutoff - protsep) : strlen(protsep));
  ------------------
  |  Branch (1284:24): [True: 51, False: 410]
  ------------------
 1285|    461|      if(cutoff)
  ------------------
  |  Branch (1285:10): [True: 461, False: 0]
  ------------------
 1286|    461|        cutoff++; /* truncate after last slash */
 1287|    461|    }
 1288|    480|    break;
 1289|    499|  }
 1290|       |
 1291|    499|  prelen = cutoff ? (size_t)(cutoff - base) : strlen(base);
  ------------------
  |  Branch (1291:12): [True: 483, False: 16]
  ------------------
 1292|       |
 1293|       |  /* build new URL */
 1294|    499|  curlx_dyn_init(&urlbuf, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|    499|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1295|       |
 1296|    499|  if(!curlx_dyn_addn(&urlbuf, base, prelen) &&
  ------------------
  |  Branch (1296:6): [True: 499, False: 0]
  ------------------
 1297|    499|     !urlencode_str(&urlbuf, useurl, strlen(useurl), !host_changed,
  ------------------
  |  Branch (1297:6): [True: 499, False: 0]
  ------------------
 1298|    499|                    QUERY_NOT_YET)) {
  ------------------
  |  |   53|    499|#define QUERY_NOT_YET 3 /* allow to change to query */
  ------------------
 1299|    499|    uc = parseurl_and_replace(curlx_dyn_ptr(&urlbuf), u,
 1300|    499|                              flags & ~U_CURLU_PATH_AS_IS);
  ------------------
  |  |   64|    499|#define U_CURLU_PATH_AS_IS (unsigned int)CURLU_PATH_AS_IS
  |  |  ------------------
  |  |  |  |   91|    499|#define CURLU_PATH_AS_IS (1 << 4)         /* leave dot sequences */
  |  |  ------------------
  ------------------
 1301|    499|  }
 1302|      0|  else
 1303|      0|    uc = CURLUE_OUT_OF_MEMORY;
 1304|       |
 1305|    499|  curlx_dyn_free(&urlbuf);
 1306|    499|  return uc;
 1307|    499|}
urlapi.c:hostname_check:
  464|  11.3k|{
  465|  11.3k|  size_t len;
  466|  11.3k|  DEBUGASSERT(hostname);
  ------------------
  |  | 1081|  11.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (466:3): [True: 0, False: 11.3k]
  |  Branch (466:3): [True: 11.3k, False: 0]
  ------------------
  467|       |
  468|  11.3k|  if(!hlen)
  ------------------
  |  Branch (468:6): [True: 0, False: 11.3k]
  ------------------
  469|      0|    return CURLUE_NO_HOST;
  470|  11.3k|  else if(hostname[0] == '[')
  ------------------
  |  Branch (470:11): [True: 29, False: 11.3k]
  ------------------
  471|     29|    return ipv6_parse(u, hostname, hlen);
  472|  11.3k|  else {
  473|       |    /* letters from the second string are not ok */
  474|  11.3k|    len = strcspn(hostname, " \r\n\t/:#?!@{}[]\\$\'\"^`*<>=;,+&()%|");
  475|  11.3k|    if(hlen != len)
  ------------------
  |  Branch (475:8): [True: 371, False: 10.9k]
  ------------------
  476|       |      /* hostname with bad content */
  477|    371|      return CURLUE_BAD_HOSTNAME;
  478|  10.9k|    else if((hlen >= 2) &&
  ------------------
  |  Branch (478:13): [True: 8.76k, False: 2.19k]
  ------------------
  479|  8.76k|            (hostname[hlen - 1] == '.') && (hostname[hlen - 2] == '.'))
  ------------------
  |  Branch (479:13): [True: 6.28k, False: 2.47k]
  |  Branch (479:44): [True: 8, False: 6.28k]
  ------------------
  480|       |      /* more than one trailing dot is not allowed */
  481|      8|      return CURLUE_BAD_HOSTNAME;
  482|  10.9k|    else if((hlen == 1) && (hostname[0] == '.'))
  ------------------
  |  Branch (482:13): [True: 2.19k, False: 8.75k]
  |  Branch (482:28): [True: 3, False: 2.19k]
  ------------------
  483|       |      /* just a single dot is not allowed */
  484|      3|      return CURLUE_BAD_HOSTNAME;
  485|  11.3k|  }
  486|  10.9k|  return CURLUE_OK;
  487|  11.3k|}

Curl_auth_digest_cleanup:
 1035|  89.4k|{
 1036|  89.4k|  curlx_safefree(digest->nonce);
  ------------------
  |  | 1327|  89.4k|  do {                      \
  |  | 1328|  89.4k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  89.4k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  89.4k|    (ptr) = NULL;           \
  |  | 1330|  89.4k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 89.4k]
  |  |  ------------------
  ------------------
 1037|  89.4k|  curlx_safefree(digest->cnonce);
  ------------------
  |  | 1327|  89.4k|  do {                      \
  |  | 1328|  89.4k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  89.4k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  89.4k|    (ptr) = NULL;           \
  |  | 1330|  89.4k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 89.4k]
  |  |  ------------------
  ------------------
 1038|  89.4k|  curlx_safefree(digest->realm);
  ------------------
  |  | 1327|  89.4k|  do {                      \
  |  | 1328|  89.4k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  89.4k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  89.4k|    (ptr) = NULL;           \
  |  | 1330|  89.4k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 89.4k]
  |  |  ------------------
  ------------------
 1039|  89.4k|  curlx_safefree(digest->opaque);
  ------------------
  |  | 1327|  89.4k|  do {                      \
  |  | 1328|  89.4k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  89.4k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  89.4k|    (ptr) = NULL;           \
  |  | 1330|  89.4k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 89.4k]
  |  |  ------------------
  ------------------
 1040|  89.4k|  curlx_safefree(digest->qop);
  ------------------
  |  | 1327|  89.4k|  do {                      \
  |  | 1328|  89.4k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  89.4k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  89.4k|    (ptr) = NULL;           \
  |  | 1330|  89.4k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 89.4k]
  |  |  ------------------
  ------------------
 1041|  89.4k|  curlx_safefree(digest->algorithm);
  ------------------
  |  | 1327|  89.4k|  do {                      \
  |  | 1328|  89.4k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  89.4k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  89.4k|    (ptr) = NULL;           \
  |  | 1330|  89.4k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 89.4k]
  |  |  ------------------
  ------------------
 1042|       |
 1043|  89.4k|  digest->nc = 0;
 1044|  89.4k|  digest->algo = ALGO_MD5; /* default algorithm */
  ------------------
  |  |   43|  89.4k|#define ALGO_MD5 0
  ------------------
 1045|  89.4k|  digest->stale = FALSE;   /* default means normal, not stale */
  ------------------
  |  | 1058|  89.4k|#define FALSE false
  ------------------
 1046|       |  digest->userhash = FALSE;
  ------------------
  |  | 1058|  89.4k|#define FALSE false
  ------------------
 1047|  89.4k|}

Curl_auth_allowed_to_host:
  141|  2.85k|{
  142|  2.85k|  return Curl_auth_allowed_to_origin(data, data->conn->origin);
  143|  2.85k|}
Curl_auth_allowed_to_origin:
  147|  3.52k|{
  148|  3.52k|  return data->set.allow_auth_to_other_hosts ||
  ------------------
  |  Branch (148:10): [True: 30, False: 3.49k]
  ------------------
  149|  3.49k|         Curl_peer_equal(data->state.initial_origin, origin);
  ------------------
  |  Branch (149:10): [True: 3.49k, False: 2]
  ------------------
  150|  3.52k|}

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);
  ------------------
  |  |   74|      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);
  ------------------
  |  |   79|      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_enabled:
   68|  1.77k|{
   69|       |  return keylog_file_fp != NULL;
   70|  1.77k|}

Curl_ssl_setup_x509_store:
 3289|  2.99k|{
 3290|  2.99k|  struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf);
 3291|  2.99k|  struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data);
 3292|  2.99k|  CURLcode result = CURLE_OK;
 3293|  2.99k|  X509_STORE *cached_store;
 3294|  2.99k|  bool cache_criteria_met, is_empty;
 3295|       |
 3296|       |  /* Consider the X509 store cacheable if it comes exclusively from a CAfile,
 3297|       |     or no source is provided and we are falling back to OpenSSL's built-in
 3298|       |     default. */
 3299|  2.99k|  cache_criteria_met = (data->set.general_ssl.ca_cache_timeout != 0) &&
  ------------------
  |  Branch (3299:24): [True: 2.99k, False: 4]
  ------------------
 3300|  2.99k|    conn_config->verifypeer &&
  ------------------
  |  Branch (3300:5): [True: 2.97k, False: 23]
  ------------------
 3301|  2.97k|    !conn_config->CApath &&
  ------------------
  |  Branch (3301:5): [True: 0, False: 2.97k]
  ------------------
 3302|      0|    !conn_config->ca_info_blob &&
  ------------------
  |  Branch (3302:5): [True: 0, False: 0]
  ------------------
 3303|      0|    !ssl_config->primary.CRLfile &&
  ------------------
  |  Branch (3303:5): [True: 0, False: 0]
  ------------------
 3304|      0|    !ssl_config->native_ca_store;
  ------------------
  |  Branch (3304:5): [True: 0, False: 0]
  ------------------
 3305|       |
 3306|  2.99k|  ERR_set_mark();
 3307|       |
 3308|  2.99k|  cached_store = ossl_get_cached_x509_store(cf, data, &is_empty);
 3309|  2.99k|  if(cached_store && cache_criteria_met && X509_STORE_up_ref(cached_store)) {
  ------------------
  |  Branch (3309:6): [True: 0, False: 2.99k]
  |  Branch (3309:22): [True: 0, False: 0]
  |  Branch (3309:44): [True: 0, False: 0]
  ------------------
 3310|      0|    SSL_CTX_set_cert_store(octx->ssl_ctx, cached_store);
 3311|      0|    octx->store_is_empty = is_empty;
 3312|      0|  }
 3313|  2.99k|  else {
 3314|  2.99k|    X509_STORE *store = SSL_CTX_get_cert_store(octx->ssl_ctx);
 3315|       |
 3316|  2.99k|    result = ossl_populate_x509_store(cf, data, octx, store);
 3317|  2.99k|    if(result == CURLE_OK && cache_criteria_met) {
  ------------------
  |  Branch (3317:8): [True: 417, False: 2.58k]
  |  Branch (3317:30): [True: 0, False: 417]
  ------------------
 3318|      0|      ossl_set_cached_x509_store(cf, data, store, (bool)octx->store_is_empty);
 3319|      0|    }
 3320|  2.99k|  }
 3321|       |
 3322|  2.99k|  ERR_pop_to_mark();
 3323|       |
 3324|  2.99k|  return result;
 3325|  2.99k|}
Curl_ossl_need_httpsrr:
 3557|  2.56k|{
 3558|  2.56k|  (void)data;
 3559|       |  return FALSE;
  ------------------
  |  | 1058|  2.56k|#define FALSE false
  ------------------
 3560|  2.56k|}
Curl_ossl_ctx_init:
 3671|  2.56k|{
 3672|  2.56k|  CURLcode result = CURLE_OK;
 3673|  2.56k|  const char *ciphers;
 3674|  2.56k|  const SSL_METHOD *req_method = NULL;
 3675|  2.56k|  ctx_option_t ctx_options = 0;
 3676|  2.56k|  struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf);
 3677|  2.56k|  struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data);
 3678|  2.56k|  char * const ssl_cert = ssl_config->primary.clientcert;
 3679|  2.56k|  const struct curl_blob *ssl_cert_blob = ssl_config->primary.cert_blob;
 3680|  2.56k|  const char * const ssl_cert_type = ssl_config->primary.cert_type;
 3681|  2.56k|  unsigned int ssl_version_min;
 3682|  2.56k|  char error_buffer[256];
 3683|       |
 3684|       |  /* Make funny stuff to get random input */
 3685|  2.56k|  result = ossl_seed(data);
 3686|  2.56k|  if(result)
  ------------------
  |  Branch (3686:6): [True: 0, False: 2.56k]
  ------------------
 3687|      0|    return result;
 3688|       |
 3689|  2.56k|  ssl_config->certverifyresult = !X509_V_OK;
 3690|       |
 3691|  2.56k|  result = ossl_init_method(cf, data, peer, &req_method, &ssl_version_min);
 3692|  2.56k|  if(result)
  ------------------
  |  Branch (3692:6): [True: 0, False: 2.56k]
  ------------------
 3693|      0|    return result;
 3694|  2.56k|  DEBUGASSERT(req_method);
  ------------------
  |  | 1081|  2.56k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3694:3): [True: 0, False: 2.56k]
  |  Branch (3694:3): [True: 2.56k, False: 0]
  ------------------
 3695|       |
 3696|  2.56k|  DEBUGASSERT(!octx->ssl_ctx);
  ------------------
  |  | 1081|  2.56k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3696:3): [True: 0, False: 2.56k]
  |  Branch (3696:3): [True: 2.56k, False: 0]
  ------------------
 3697|  2.56k|  octx->ssl_ctx =
 3698|  2.56k|#ifdef OPENSSL_HAS_PROVIDERS
 3699|  2.56k|    data->state.libctx ?
  ------------------
  |  Branch (3699:5): [True: 631, False: 1.93k]
  ------------------
 3700|    631|    SSL_CTX_new_ex(data->state.libctx, data->state.propq, req_method):
 3701|  2.56k|#endif
 3702|  2.56k|    SSL_CTX_new(req_method);
 3703|       |
 3704|  2.56k|  if(!octx->ssl_ctx) {
  ------------------
  |  Branch (3704:6): [True: 83, False: 2.47k]
  ------------------
 3705|     83|    failf(data, "SSL: could not create a context: %s",
  ------------------
  |  |   62|     83|#define failf Curl_failf
  ------------------
 3706|     83|          ossl_strerror(ERR_peek_error(), error_buffer, sizeof(error_buffer)));
 3707|     83|    return CURLE_OUT_OF_MEMORY;
 3708|     83|  }
 3709|       |
 3710|  2.47k|  if(cb_setup) {
  ------------------
  |  Branch (3710:6): [True: 0, False: 2.47k]
  ------------------
 3711|      0|    result = cb_setup(cf, data, cb_user_data);
 3712|      0|    if(result)
  ------------------
  |  Branch (3712:8): [True: 0, False: 0]
  ------------------
 3713|      0|      return result;
 3714|      0|  }
 3715|       |
 3716|  2.47k|  if(data->set.fdebug && data->set.verbose &&
  ------------------
  |  Branch (3716:6): [True: 0, False: 2.47k]
  |  Branch (3716:26): [True: 0, False: 0]
  ------------------
 3717|      0|     (peer->transport != TRNSPRT_QUIC)) {
  ------------------
  |  |  309|      0|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (3717:6): [True: 0, False: 0]
  ------------------
 3718|       |    /* the SSL trace callback is only used for verbose logging;
 3719|       |     * QUIC connections use a different TLS record format that
 3720|       |     * ossl_trace cannot handle */
 3721|      0|    SSL_CTX_set_msg_callback(octx->ssl_ctx, ossl_trace);
 3722|      0|    SSL_CTX_set_msg_callback_arg(octx->ssl_ctx, cf);
 3723|      0|  }
 3724|       |
 3725|       |  /* OpenSSL contains code to work around lots of bugs and flaws in various
 3726|       |     SSL-implementations. SSL_CTX_set_options() is used to enabled those
 3727|       |     work-arounds. The man page for this option states that SSL_OP_ALL enables
 3728|       |     all the work-arounds and that "It is usually safe to use SSL_OP_ALL to
 3729|       |     enable the bug workaround options if compatibility with somewhat broken
 3730|       |     implementations is desired."
 3731|       |
 3732|       |     The "-no_ticket" option was introduced in OpenSSL 0.9.8j. it is a flag to
 3733|       |     disable "rfc4507bis session ticket support". rfc4507bis was later turned
 3734|       |     into the proper RFC5077: https://datatracker.ietf.org/doc/html/rfc5077
 3735|       |
 3736|       |     The enabled extension concerns the session management. I wonder how often
 3737|       |     libcurl stops a connection and then resumes a TLS session. Also, sending
 3738|       |     the session data is some overhead. I suggest that you use your proposed
 3739|       |     patch (which explicitly disables TICKET).
 3740|       |
 3741|       |     If someone writes an application with libcurl and OpenSSL who wants to
 3742|       |     enable the feature, one can do this in the SSL callback.
 3743|       |
 3744|       |     SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG option enabling allowed proper
 3745|       |     interoperability with web server Netscape Enterprise Server 2.0.1 which
 3746|       |     was released back in 1996.
 3747|       |
 3748|       |     Due to CVE-2010-4180, option SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG has
 3749|       |     become ineffective as of OpenSSL 0.9.8q and 1.0.0c. In order to mitigate
 3750|       |     CVE-2010-4180 when using previous OpenSSL versions we no longer enable
 3751|       |     this option regardless of OpenSSL version and SSL_OP_ALL definition.
 3752|       |
 3753|       |     OpenSSL added a work-around for an SSL 3.0/TLS 1.0 CBC vulnerability:
 3754|       |     https://web.archive.org/web/20240114184648/openssl.org/~bodo/tls-cbc.txt.
 3755|       |     In 0.9.6e they added a bit to SSL_OP_ALL that _disables_ that work-around
 3756|       |     despite the fact that SSL_OP_ALL is documented to do "rather harmless"
 3757|       |     workarounds. In order to keep the secure work-around, the
 3758|       |     SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS bit must not be set.
 3759|       |  */
 3760|       |
 3761|  2.47k|  ctx_options = SSL_OP_ALL | SSL_OP_NO_TICKET | SSL_OP_NO_COMPRESSION;
 3762|       |
 3763|       |  /* mitigate CVE-2010-4180 */
 3764|  2.47k|  ctx_options &= ~(ctx_option_t)SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG;
 3765|       |
 3766|       |  /* unless the user explicitly asks to allow the protocol vulnerability we
 3767|       |     use the work-around */
 3768|  2.47k|  if(!ssl_config->enable_beast)
  ------------------
  |  Branch (3768:6): [True: 2.47k, False: 3]
  ------------------
 3769|  2.47k|    ctx_options &= ~(ctx_option_t)SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS;
 3770|       |
 3771|  2.47k|  DEBUGASSERT(ssl_version_min != CURL_SSLVERSION_DEFAULT);
  ------------------
  |  | 1081|  2.47k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3771:3): [True: 0, False: 2.47k]
  |  Branch (3771:3): [True: 2.47k, False: 0]
  ------------------
 3772|  2.47k|  switch(ssl_version_min) {
 3773|      0|  case CURL_SSLVERSION_SSLv2:
  ------------------
  |  | 2370|      0|#define CURL_SSLVERSION_SSLv2   2L
  ------------------
  |  Branch (3773:3): [True: 0, False: 2.47k]
  ------------------
 3774|      0|  case CURL_SSLVERSION_SSLv3:
  ------------------
  |  | 2371|      0|#define CURL_SSLVERSION_SSLv3   3L
  ------------------
  |  Branch (3774:3): [True: 0, False: 2.47k]
  ------------------
 3775|      0|    return CURLE_NOT_BUILT_IN;
 3776|       |
 3777|       |    /* "--tlsv<x.y>" options mean TLS >= version <x.y> */
 3778|      6|  case CURL_SSLVERSION_TLSv1:   /* TLS >= version 1.0 */
  ------------------
  |  | 2369|      6|#define CURL_SSLVERSION_TLSv1   1L /* TLS 1.x */
  ------------------
  |  Branch (3778:3): [True: 6, False: 2.47k]
  ------------------
 3779|     15|  case CURL_SSLVERSION_TLSv1_0: /* TLS >= version 1.0 */
  ------------------
  |  | 2372|     15|#define CURL_SSLVERSION_TLSv1_0 4L
  ------------------
  |  Branch (3779:3): [True: 9, False: 2.47k]
  ------------------
 3780|     22|  case CURL_SSLVERSION_TLSv1_1: /* TLS >= version 1.1 */
  ------------------
  |  | 2373|     22|#define CURL_SSLVERSION_TLSv1_1 5L
  ------------------
  |  Branch (3780:3): [True: 7, False: 2.47k]
  ------------------
 3781|  2.47k|  case CURL_SSLVERSION_TLSv1_2: /* TLS >= version 1.2 */
  ------------------
  |  | 2374|  2.47k|#define CURL_SSLVERSION_TLSv1_2 6L
  ------------------
  |  Branch (3781:3): [True: 2.45k, False: 28]
  ------------------
 3782|  2.47k|  case CURL_SSLVERSION_TLSv1_3: /* TLS >= version 1.3 */
  ------------------
  |  | 2375|  2.47k|#define CURL_SSLVERSION_TLSv1_3 7L
  ------------------
  |  Branch (3782:3): [True: 6, False: 2.47k]
  ------------------
 3783|       |    /* asking for any TLS version as the minimum, means no SSL versions
 3784|       |       allowed */
 3785|  2.47k|    ctx_options |= SSL_OP_NO_SSLv2;
 3786|  2.47k|    ctx_options |= SSL_OP_NO_SSLv3;
 3787|       |
 3788|  2.47k|    result = ossl_set_ssl_version_min_max(cf, octx->ssl_ctx, ssl_version_min);
 3789|  2.47k|    if(result)
  ------------------
  |  Branch (3789:8): [True: 0, False: 2.47k]
  ------------------
 3790|      0|      return result;
 3791|  2.47k|    break;
 3792|       |
 3793|  2.47k|  default:
  ------------------
  |  Branch (3793:3): [True: 0, False: 2.47k]
  ------------------
 3794|      0|    failf(data, "Unrecognized parameter passed via CURLOPT_SSLVERSION");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3795|      0|    return CURLE_SSL_CONNECT_ERROR;
 3796|  2.47k|  }
 3797|       |
 3798|  2.47k|  SSL_CTX_set_options(octx->ssl_ctx, ctx_options);
 3799|  2.47k|  SSL_CTX_set_read_ahead(octx->ssl_ctx, 1);
 3800|       |
 3801|       |  /* Max TLS1.2 record size 0x4000 + 0x800.
 3802|       |     OpenSSL supports processing "jumbo TLS record" (8 TLS records) in one go
 3803|       |     for some algorithms, so match that here.
 3804|       |     Experimentation shows that a slightly larger buffer is needed
 3805|       |     to avoid short reads.
 3806|       |
 3807|       |     However using a large buffer (8 packets) actually decreases performance.
 3808|       |     4 packets is better.
 3809|       |   */
 3810|  2.47k|#ifdef HAVE_SSL_CTX_SET_DEFAULT_READ_BUFFER_LEN
 3811|  2.47k|  SSL_CTX_set_default_read_buffer_len(octx->ssl_ctx, 0x401e * 4);
 3812|  2.47k|#endif
 3813|       |
 3814|       |  /* We do retry writes sometimes from another buffer address */
 3815|  2.47k|  SSL_CTX_set_mode(octx->ssl_ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
 3816|       |
 3817|  2.47k|  ciphers = conn_config->cipher_list;
 3818|  2.47k|  if(!ciphers && (peer->transport != TRNSPRT_QUIC))
  ------------------
  |  |  309|  1.69k|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (3818:6): [True: 1.69k, False: 783]
  |  Branch (3818:18): [True: 1.69k, False: 0]
  ------------------
 3819|  1.69k|    ciphers = NULL;
 3820|  2.47k|  if(ciphers && (ssl_version_min < CURL_SSLVERSION_TLSv1_3)) {
  ------------------
  |  | 2375|    783|#define CURL_SSLVERSION_TLSv1_3 7L
  ------------------
  |  Branch (3820:6): [True: 783, False: 1.69k]
  |  Branch (3820:17): [True: 782, False: 1]
  ------------------
 3821|    782|    if(!SSL_CTX_set_cipher_list(octx->ssl_ctx, ciphers)) {
  ------------------
  |  Branch (3821:8): [True: 550, False: 232]
  ------------------
 3822|    550|      failf(data, "failed setting cipher list: %s", ciphers);
  ------------------
  |  |   62|    550|#define failf Curl_failf
  ------------------
 3823|    550|      return CURLE_SSL_CIPHER;
 3824|    550|    }
 3825|    232|    infof(data, "Cipher selection: %s", ciphers);
  ------------------
  |  |  143|    232|  do {                               \
  |  |  144|    232|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    232|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 232, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 232]
  |  |  |  |  ------------------
  |  |  |  |  320|    232|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    232|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    232|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 232]
  |  |  ------------------
  ------------------
 3826|    232|  }
 3827|       |
 3828|  1.92k|#ifdef HAVE_SSL_CTX_SET_CIPHERSUITES
 3829|  1.92k|  {
 3830|  1.92k|    const char *ciphers13 = conn_config->cipher_list13;
 3831|  1.92k|    if(ciphers13 &&
  ------------------
  |  Branch (3831:8): [True: 148, False: 1.78k]
  ------------------
 3832|    148|       (!conn_config->version_max ||
  ------------------
  |  Branch (3832:9): [True: 143, False: 5]
  ------------------
 3833|      5|        (conn_config->version_max == CURL_SSLVERSION_MAX_DEFAULT) ||
  ------------------
  |  | 2380|      5|#define CURL_SSLVERSION_MAX_DEFAULT (CURL_SSLVERSION_TLSv1   << 16)
  |  |  ------------------
  |  |  |  | 2369|      5|#define CURL_SSLVERSION_TLSv1   1L /* TLS 1.x */
  |  |  ------------------
  ------------------
  |  Branch (3833:9): [True: 1, False: 4]
  ------------------
 3834|    147|        (conn_config->version_max >= CURL_SSLVERSION_MAX_TLSv1_3))) {
  ------------------
  |  | 2384|      4|#define CURL_SSLVERSION_MAX_TLSv1_3 (CURL_SSLVERSION_TLSv1_3 << 16)
  |  |  ------------------
  |  |  |  | 2375|      4|#define CURL_SSLVERSION_TLSv1_3 7L
  |  |  ------------------
  ------------------
  |  Branch (3834:9): [True: 3, False: 1]
  ------------------
 3835|    147|      if(!SSL_CTX_set_ciphersuites(octx->ssl_ctx, ciphers13)) {
  ------------------
  |  Branch (3835:10): [True: 82, False: 65]
  ------------------
 3836|     82|        failf(data, "failed setting TLS 1.3 cipher suite: %s", ciphers13);
  ------------------
  |  |   62|     82|#define failf Curl_failf
  ------------------
 3837|     82|        return CURLE_SSL_CIPHER;
 3838|     82|      }
 3839|     65|      infof(data, "TLS 1.3 cipher selection: %s", ciphers13);
  ------------------
  |  |  143|     65|  do {                               \
  |  |  144|     65|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     65|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 65, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 65]
  |  |  |  |  ------------------
  |  |  |  |  320|     65|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     65|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     65|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 65]
  |  |  ------------------
  ------------------
 3840|     65|    }
 3841|  1.92k|  }
 3842|  1.84k|#endif
 3843|       |
 3844|  1.84k|  if(ssl_cert || ssl_cert_blob || ssl_cert_type) {
  ------------------
  |  Branch (3844:6): [True: 11, False: 1.83k]
  |  Branch (3844:18): [True: 0, False: 1.83k]
  |  Branch (3844:35): [True: 12, False: 1.82k]
  ------------------
 3845|     23|    result = client_cert(data, octx->ssl_ctx,
 3846|     23|                         ssl_cert, ssl_cert_blob, ssl_cert_type,
 3847|     23|                         ssl_config->primary.key, ssl_config->primary.key_blob,
 3848|     23|                         ssl_config->primary.key_type,
 3849|     23|                         ssl_config->primary.key_passwd);
 3850|     23|    if(result)
  ------------------
  |  Branch (3850:8): [True: 11, False: 12]
  ------------------
 3851|       |      /* failf() is already done in client_cert() */
 3852|     11|      return result;
 3853|     23|  }
 3854|       |
 3855|  1.83k|#ifdef HAVE_SSL_CTX_SET_POST_HANDSHAKE_AUTH
 3856|       |  /* OpenSSL 1.1.1 requires clients to opt-in for PHA */
 3857|  1.83k|  SSL_CTX_set_post_handshake_auth(octx->ssl_ctx, 1);
 3858|  1.83k|#endif
 3859|       |
 3860|  1.83k|  {
 3861|  1.83k|    const char *curves = conn_config->curves;
 3862|  1.83k|    if(curves) {
  ------------------
  |  Branch (3862:8): [True: 427, False: 1.40k]
  ------------------
 3863|       |#ifdef HAVE_BORINGSSL_LIKE
 3864|       |#define OSSL_CURVE_CAST(x) (x)
 3865|       |#else
 3866|    427|#define OSSL_CURVE_CAST(x) (char *)CURL_UNCONST(x)
 3867|    427|#endif
 3868|    427|      if(!SSL_CTX_set1_curves_list(octx->ssl_ctx, OSSL_CURVE_CAST(curves))) {
  ------------------
  |  Branch (3868:10): [True: 63, False: 364]
  ------------------
 3869|     63|        failf(data, "failed setting curves list: '%s'", curves);
  ------------------
  |  |   62|     63|#define failf Curl_failf
  ------------------
 3870|     63|        return CURLE_SSL_CIPHER;
 3871|     63|      }
 3872|    427|    }
 3873|  1.83k|  }
 3874|       |
 3875|  1.77k|#ifdef HAVE_SSL_CTX_SET1_SIGALGS
 3876|  1.77k|#define OSSL_SIGALG_CAST(x) OSSL_CURVE_CAST(x)
 3877|  1.77k|  {
 3878|  1.77k|    const char *signature_algorithms = conn_config->signature_algorithms;
 3879|  1.77k|    if(signature_algorithms) {
  ------------------
  |  Branch (3879:8): [True: 0, False: 1.77k]
  ------------------
 3880|      0|      if(!SSL_CTX_set1_sigalgs_list(octx->ssl_ctx,
  ------------------
  |  Branch (3880:10): [True: 0, False: 0]
  ------------------
 3881|      0|                                    OSSL_SIGALG_CAST(signature_algorithms))) {
 3882|      0|        failf(data, "failed setting signature algorithms: '%s'",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3883|      0|              signature_algorithms);
 3884|      0|        return CURLE_SSL_CIPHER;
 3885|      0|      }
 3886|      0|    }
 3887|  1.77k|  }
 3888|  1.77k|#endif
 3889|       |
 3890|  1.77k|#if defined(HAVE_OPENSSL_SRP) && defined(USE_TLS_SRP)
 3891|  1.77k|  if(ssl_config->primary.username && Curl_auth_allowed_to_host(data)) {
  ------------------
  |  Branch (3891:6): [True: 5, False: 1.76k]
  |  Branch (3891:38): [True: 5, False: 0]
  ------------------
 3892|      5|    char * const ssl_username = ssl_config->primary.username;
 3893|      5|    char * const ssl_password = ssl_config->primary.password;
 3894|      5|    infof(data, "Using TLS-SRP username: %s", ssl_username);
  ------------------
  |  |  143|      5|  do {                               \
  |  |  144|      5|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      5|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 5, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 5]
  |  |  |  |  ------------------
  |  |  |  |  320|      5|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      5|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      5|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 5]
  |  |  ------------------
  ------------------
 3895|       |
 3896|      5|    if(!SSL_CTX_set_srp_username(octx->ssl_ctx, ssl_username)) {
  ------------------
  |  Branch (3896:8): [True: 1, False: 4]
  ------------------
 3897|      1|      failf(data, "Unable to set SRP username");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
 3898|      1|      return CURLE_BAD_FUNCTION_ARGUMENT;
 3899|      1|    }
 3900|      4|    if(!SSL_CTX_set_srp_password(octx->ssl_ctx, ssl_password)) {
  ------------------
  |  Branch (3900:8): [True: 2, False: 2]
  ------------------
 3901|      2|      failf(data, "failed setting SRP password");
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
 3902|      2|      return CURLE_BAD_FUNCTION_ARGUMENT;
 3903|      2|    }
 3904|      2|    if(!conn_config->cipher_list) {
  ------------------
  |  Branch (3904:8): [True: 2, False: 0]
  ------------------
 3905|      2|      infof(data, "Setting cipher list SRP");
  ------------------
  |  |  143|      2|  do {                               \
  |  |  144|      2|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      2|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 2, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  320|      2|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      2|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      2|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 2]
  |  |  ------------------
  ------------------
 3906|       |
 3907|      2|      if(!SSL_CTX_set_cipher_list(octx->ssl_ctx, "SRP")) {
  ------------------
  |  Branch (3907:10): [True: 0, False: 2]
  ------------------
 3908|      0|        failf(data, "failed setting SRP cipher list");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3909|      0|        return CURLE_SSL_CIPHER;
 3910|      0|      }
 3911|      2|    }
 3912|      2|  }
 3913|  1.77k|#endif /* HAVE_OPENSSL_SRP && USE_TLS_SRP */
 3914|       |
 3915|       |  /* OpenSSL always tries to verify the peer. By setting the failure mode
 3916|       |   * to NONE, we allow the connect to complete, regardless of the outcome.
 3917|       |   * We then explicitly check the result and may try alternatives like
 3918|       |   * Apple's SecTrust for verification. */
 3919|  1.77k|  SSL_CTX_set_verify(octx->ssl_ctx, SSL_VERIFY_NONE, NULL);
 3920|       |
 3921|       |  /* Enable logging of secrets to the file specified in env SSLKEYLOGFILE. */
 3922|  1.77k|#if !defined(HAVE_KEYLOG_UPSTREAM) && defined(HAVE_KEYLOG_CALLBACK)
 3923|  1.77k|  if(Curl_tls_keylog_enabled()) {
  ------------------
  |  Branch (3923:6): [True: 0, False: 1.77k]
  ------------------
 3924|      0|    SSL_CTX_set_keylog_callback(octx->ssl_ctx, ossl_keylog_callback);
 3925|      0|  }
 3926|  1.77k|#endif
 3927|       |
 3928|  1.77k|  if(cb_new_session) {
  ------------------
  |  Branch (3928:6): [True: 1.77k, False: 0]
  ------------------
 3929|       |    /* Enable the session cache because it is a prerequisite for the
 3930|       |     * "new session" callback. Use the "external storage" mode to prevent
 3931|       |     * OpenSSL from creating an internal session cache.
 3932|       |     */
 3933|  1.77k|    SSL_CTX_set_session_cache_mode(octx->ssl_ctx,
 3934|  1.77k|                                   SSL_SESS_CACHE_CLIENT |
 3935|  1.77k|                                   SSL_SESS_CACHE_NO_INTERNAL);
 3936|  1.77k|    SSL_CTX_sess_set_new_cb(octx->ssl_ctx, cb_new_session);
 3937|  1.77k|  }
 3938|       |
 3939|       |  /* give application a chance to interfere with SSL set up. */
 3940|  1.77k|  if(data->set.ssl.fsslctx) {
  ------------------
  |  Branch (3940:6): [True: 0, False: 1.77k]
  ------------------
 3941|       |    /* When a user callback is installed to modify the SSL_CTX,
 3942|       |     * we need to do the full initialization before calling it.
 3943|       |     * See: #11800 */
 3944|      0|    if(!octx->x509_store_setup) {
  ------------------
  |  Branch (3944:8): [True: 0, False: 0]
  ------------------
 3945|      0|      result = Curl_ssl_setup_x509_store(cf, data, octx);
 3946|      0|      if(result)
  ------------------
  |  Branch (3946:10): [True: 0, False: 0]
  ------------------
 3947|      0|        return result;
 3948|      0|      octx->x509_store_setup = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 3949|      0|    }
 3950|      0|    Curl_set_in_callback(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 3951|      0|    result = (*data->set.ssl.fsslctx)(data, octx->ssl_ctx,
 3952|      0|                                      data->set.ssl.fsslctxp);
 3953|      0|    Curl_set_in_callback(data, FALSE);
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 3954|      0|    if(result) {
  ------------------
  |  Branch (3954:8): [True: 0, False: 0]
  ------------------
 3955|      0|      failf(data, "error signaled by SSL ctx callback");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3956|      0|      return result;
 3957|      0|    }
 3958|      0|  }
 3959|       |
 3960|  1.77k|  return ossl_init_ssl(octx, cf, data, peer, alpns_requested,
 3961|  1.77k|                       ssl_user_data, sess_reuse_cb);
 3962|  1.77k|}
Curl_ossl_version:
 5408|  3.21k|{
 5409|       |#ifdef LIBRESSL_VERSION_NUMBER
 5410|       |  char *p;
 5411|       |  size_t count;
 5412|       |  const char *ver = OpenSSL_version(OPENSSL_VERSION);
 5413|       |  const char expected[] = OSSL_PACKAGE " "; /* ie "LibreSSL " */
 5414|       |  if(curl_strnequal(ver, expected, sizeof(expected) - 1)) {
 5415|       |    ver += sizeof(expected) - 1;
 5416|       |  }
 5417|       |  count = curl_msnprintf(buffer, size, "%s/%s", OSSL_PACKAGE, ver);
 5418|       |  for(p = buffer; *p; ++p) {
 5419|       |    if(ISBLANK(*p))
 5420|       |      *p = '_';
 5421|       |  }
 5422|       |  return count;
 5423|       |#elif defined(OPENSSL_IS_AWSLC)
 5424|       |  return curl_msnprintf(buffer, size, "%s/%s",
 5425|       |                        OSSL_PACKAGE, AWSLC_VERSION_NUMBER_STRING);
 5426|       |#elif defined(OPENSSL_IS_BORINGSSL)
 5427|       |#ifdef CURL_BORINGSSL_VERSION
 5428|       |  return curl_msnprintf(buffer, size, "%s/%s",
 5429|       |                        OSSL_PACKAGE, CURL_BORINGSSL_VERSION);
 5430|       |#else
 5431|       |  return curl_msnprintf(buffer, size, OSSL_PACKAGE);
 5432|       |#endif
 5433|       |#else /* OpenSSL 3+ */
 5434|  3.21k|  return curl_msnprintf(buffer, size, "%s/%s",
 5435|  3.21k|                        OSSL_PACKAGE, OpenSSL_version(OPENSSL_VERSION_STRING));
  ------------------
  |  |  163|  3.21k|#define OSSL_PACKAGE "OpenSSL"
  ------------------
 5436|  3.21k|#endif
 5437|  3.21k|}
openssl.c:ossl_get_cached_x509_store:
 3211|  2.99k|{
 3212|  2.99k|  struct Curl_multi *multi = data->multi;
 3213|  2.99k|  struct ossl_x509_share *share;
 3214|  2.99k|  X509_STORE *store = NULL;
 3215|       |
 3216|  2.99k|  DEBUGASSERT(multi);
  ------------------
  |  | 1081|  2.99k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3216:3): [True: 0, False: 2.99k]
  |  Branch (3216:3): [True: 2.99k, False: 0]
  ------------------
 3217|  2.99k|  *pempty = TRUE;
  ------------------
  |  | 1055|  2.99k|#define TRUE true
  ------------------
 3218|  2.99k|  share = multi ? Curl_hash_pick(&multi->proto_hash,
  ------------------
  |  Branch (3218:11): [True: 2.99k, False: 0]
  ------------------
 3219|  2.99k|                                 CURL_UNCONST(MPROTO_OSSL_X509_KEY),
  ------------------
  |  |  866|  2.99k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
 3220|  2.99k|                                 sizeof(MPROTO_OSSL_X509_KEY) - 1) : NULL;
  ------------------
  |  | 3156|  2.99k|#define MPROTO_OSSL_X509_KEY  "tls:ossl:x509:share"
  ------------------
 3221|  2.99k|  if(share && share->store &&
  ------------------
  |  Branch (3221:6): [True: 0, False: 2.99k]
  |  Branch (3221:15): [True: 0, False: 0]
  ------------------
 3222|      0|     !ossl_cached_x509_store_expired(data, share) &&
  ------------------
  |  Branch (3222:6): [True: 0, False: 0]
  ------------------
 3223|      0|     !ossl_cached_x509_store_different(cf, data, share)) {
  ------------------
  |  Branch (3223:6): [True: 0, False: 0]
  ------------------
 3224|      0|    store = share->store;
 3225|      0|    *pempty = (bool)share->store_is_empty;
 3226|      0|  }
 3227|       |
 3228|  2.99k|  return store;
 3229|  2.99k|}
openssl.c:ossl_populate_x509_store:
 3095|  2.99k|{
 3096|  2.99k|  struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf);
 3097|  2.99k|  struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data);
 3098|  2.99k|  CURLcode result = CURLE_OK;
 3099|  2.99k|  X509_LOOKUP *lookup = NULL;
 3100|  2.99k|  const char * const ssl_crlfile = ssl_config->primary.CRLfile;
 3101|  2.99k|  unsigned long x509flags = 0;
 3102|       |
 3103|  2.99k|  CURL_TRC_CF(data, cf, "configuring OpenSSL's x509 trust store");
  ------------------
  |  |  153|  2.99k|  do {                                          \
  |  |  154|  2.99k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  2.99k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  5.99k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 2.99k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 2.99k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  5.99k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  2.99k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  2.99k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  2.99k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
 3104|  2.99k|  if(!store)
  ------------------
  |  Branch (3104:6): [True: 0, False: 2.99k]
  ------------------
 3105|      0|    return CURLE_OUT_OF_MEMORY;
 3106|       |
 3107|  2.99k|  if(!conn_config->verifypeer) {
  ------------------
  |  Branch (3107:6): [True: 23, False: 2.97k]
  ------------------
 3108|     23|    infof(data, "SSL Trust: peer verification disabled");
  ------------------
  |  |  143|     23|  do {                               \
  |  |  144|     23|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|     23|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 23, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 23]
  |  |  |  |  ------------------
  |  |  |  |  320|     23|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     23|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     23|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 23]
  |  |  ------------------
  ------------------
 3109|     23|    return CURLE_OK;
 3110|     23|  }
 3111|       |
 3112|  2.97k|  infof(data, "SSL Trust Anchors:");
  ------------------
  |  |  143|  2.97k|  do {                               \
  |  |  144|  2.97k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  2.97k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 2.97k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 2.97k]
  |  |  |  |  ------------------
  |  |  |  |  320|  2.97k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  2.97k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  2.97k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 2.97k]
  |  |  ------------------
  ------------------
 3113|  2.97k|  result = ossl_load_trust_anchors(cf, data, octx, store);
 3114|  2.97k|  if(result)
  ------------------
  |  Branch (3114:6): [True: 151, False: 2.82k]
  ------------------
 3115|    151|    return result;
 3116|       |
 3117|       |  /* Does not make sense to load a CRL file without peer verification */
 3118|  2.82k|  if(ssl_crlfile) {
  ------------------
  |  Branch (3118:6): [True: 2.43k, False: 394]
  ------------------
 3119|       |    /* tell OpenSSL where to find CRL file that is used to check certificate
 3120|       |     * revocation */
 3121|  2.43k|    lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file());
 3122|  2.43k|    if(!lookup ||
  ------------------
  |  Branch (3122:8): [True: 0, False: 2.43k]
  ------------------
 3123|  2.43k|       (!X509_load_crl_file(lookup, ssl_crlfile, X509_FILETYPE_PEM))) {
  ------------------
  |  Branch (3123:8): [True: 2.43k, False: 0]
  ------------------
 3124|  2.43k|      failf(data, "error loading CRL file: %s", ssl_crlfile);
  ------------------
  |  |   62|  2.43k|#define failf Curl_failf
  ------------------
 3125|  2.43k|      return CURLE_SSL_CRL_BADFILE;
 3126|  2.43k|    }
 3127|      0|    x509flags = X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL;
 3128|      0|    infof(data, " CRLfile: %s", ssl_crlfile);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3129|      0|  }
 3130|       |
 3131|       |  /* Try building a chain using issuers in the trusted store first to avoid
 3132|       |     problems with server-sent legacy intermediates. Newer versions of
 3133|       |     OpenSSL do alternate chain checking by default but we do not know how to
 3134|       |     determine that in a reliable manner.
 3135|       |     https://web.archive.org/web/20190422050538/rt.openssl.org/Ticket/Display.html?id=3621
 3136|       |  */
 3137|    394|  x509flags |= X509_V_FLAG_TRUSTED_FIRST;
 3138|       |
 3139|    394|  if(!ssl_config->no_partialchain && !ssl_crlfile) {
  ------------------
  |  Branch (3139:6): [True: 393, False: 1]
  |  Branch (3139:38): [True: 393, False: 0]
  ------------------
 3140|       |    /* Have intermediate certificates in the trust store be treated as
 3141|       |       trust-anchors, in the same way as self-signed root CA certificates are.
 3142|       |       This allows users to verify servers using the intermediate cert only,
 3143|       |       instead of needing the whole chain.
 3144|       |
 3145|       |       Due to OpenSSL bug https://github.com/openssl/openssl/issues/5081 we
 3146|       |       cannot do partial chains with a CRL check.
 3147|       |    */
 3148|    393|    x509flags |= X509_V_FLAG_PARTIAL_CHAIN;
 3149|    393|  }
 3150|    394|  (void)X509_STORE_set_flags(store, x509flags);
 3151|       |
 3152|    394|  return result;
 3153|  2.82k|}
openssl.c:ossl_load_trust_anchors:
 2984|  2.97k|{
 2985|  2.97k|  struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf);
 2986|  2.97k|  struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data);
 2987|  2.97k|  CURLcode result = CURLE_OK;
 2988|  2.97k|  const char * const ssl_cafile =
 2989|       |    /* CURLOPT_CAINFO_BLOB overrides CURLOPT_CAINFO */
 2990|  2.97k|    (conn_config->ca_info_blob ? NULL : conn_config->CAfile);
  ------------------
  |  Branch (2990:6): [True: 0, False: 2.97k]
  ------------------
 2991|  2.97k|  const char * const ssl_capath = conn_config->CApath;
 2992|  2.97k|  bool have_native_check = FALSE;
  ------------------
  |  | 1058|  2.97k|#define FALSE false
  ------------------
 2993|       |
 2994|  2.97k|  octx->store_is_empty = TRUE;
  ------------------
  |  | 1055|  2.97k|#define TRUE true
  ------------------
 2995|  2.97k|  if(ssl_config->native_ca_store) {
  ------------------
  |  Branch (2995:6): [True: 2, False: 2.97k]
  ------------------
 2996|       |#ifdef USE_WIN32_CRYPTO
 2997|       |    bool added = FALSE;
 2998|       |    result = ossl_windows_load_anchors(cf, data, store, &added);
 2999|       |    if(result)
 3000|       |      return result;
 3001|       |    if(added) {
 3002|       |      infof(data, "  Native: Windows System Stores ROOT+CA");
 3003|       |      octx->store_is_empty = FALSE;
 3004|       |    }
 3005|       |#elif defined(USE_APPLE_SECTRUST)
 3006|       |    infof(data, "  Native: Apple SecTrust");
 3007|       |    have_native_check = TRUE;
 3008|       |#endif
 3009|      2|  }
 3010|       |
 3011|  2.97k|  if(conn_config->ca_info_blob) {
  ------------------
  |  Branch (3011:6): [True: 0, False: 2.97k]
  ------------------
 3012|      0|    result = load_cacert_from_memory(store, conn_config->ca_info_blob);
 3013|      0|    if(result) {
  ------------------
  |  Branch (3013:8): [True: 0, False: 0]
  ------------------
 3014|      0|      failf(data, "error adding trust anchors from certificate blob: %d",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3015|      0|            result);
 3016|      0|      return result;
 3017|      0|    }
 3018|      0|    infof(data, "  CA Blob from configuration");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3019|      0|    octx->store_is_empty = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 3020|      0|  }
 3021|       |
 3022|  2.97k|  if(ssl_cafile || ssl_capath) {
  ------------------
  |  Branch (3022:6): [True: 2.97k, False: 0]
  |  Branch (3022:20): [True: 0, False: 0]
  ------------------
 3023|  2.97k|#ifdef HAVE_OPENSSL3
 3024|       |    /* OpenSSL 3.0.0 has deprecated SSL_CTX_load_verify_locations */
 3025|  2.97k|    if(ssl_cafile) {
  ------------------
  |  Branch (3025:8): [True: 2.97k, False: 0]
  ------------------
 3026|  2.97k|      if(!X509_STORE_load_file(store, ssl_cafile)) {
  ------------------
  |  Branch (3026:10): [True: 151, False: 2.82k]
  ------------------
 3027|    151|        if(octx->store_is_empty && !have_native_check) {
  ------------------
  |  Branch (3027:12): [True: 151, False: 0]
  |  Branch (3027:36): [True: 151, False: 0]
  ------------------
 3028|       |          /* Fail if we insist on successfully verifying the server. */
 3029|    151|          failf(data, "error adding trust anchors from file: %s", ssl_cafile);
  ------------------
  |  |   62|    151|#define failf Curl_failf
  ------------------
 3030|    151|          return CURLE_SSL_CACERT_BADFILE;
 3031|    151|        }
 3032|      0|        else
 3033|      0|          infof(data, "error setting certificate file, continuing anyway");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3034|    151|      }
 3035|  2.82k|      infof(data, "  CAfile: %s", ssl_cafile);
  ------------------
  |  |  143|  2.82k|  do {                               \
  |  |  144|  2.82k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  2.82k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 2.82k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 2.82k]
  |  |  |  |  ------------------
  |  |  |  |  320|  2.82k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  2.82k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  2.82k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 2.82k]
  |  |  ------------------
  ------------------
 3036|  2.82k|      octx->store_is_empty = FALSE;
  ------------------
  |  | 1058|  2.82k|#define FALSE false
  ------------------
 3037|  2.82k|    }
 3038|  2.82k|    if(ssl_capath) {
  ------------------
  |  Branch (3038:8): [True: 2.82k, False: 0]
  ------------------
 3039|  2.82k|      if(!X509_STORE_load_path(store, ssl_capath)) {
  ------------------
  |  Branch (3039:10): [True: 3, False: 2.82k]
  ------------------
 3040|      3|        if(octx->store_is_empty && !have_native_check) {
  ------------------
  |  Branch (3040:12): [True: 0, False: 3]
  |  Branch (3040:36): [True: 0, False: 0]
  ------------------
 3041|       |          /* Fail if we insist on successfully verifying the server. */
 3042|      0|          failf(data, "error adding trust anchors from path: %s", ssl_capath);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3043|      0|          return CURLE_SSL_CACERT_BADFILE;
 3044|      0|        }
 3045|      3|        else
 3046|      3|          infof(data, "error setting certificate path, continuing anyway");
  ------------------
  |  |  143|      3|  do {                               \
  |  |  144|      3|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      3|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 3, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  |  |  320|      3|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      3|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      3|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 3]
  |  |  ------------------
  ------------------
 3047|      3|      }
 3048|  2.82k|      infof(data, "  CApath: %s", ssl_capath);
  ------------------
  |  |  143|  2.82k|  do {                               \
  |  |  144|  2.82k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|  2.82k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 2.82k, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 2.82k]
  |  |  |  |  ------------------
  |  |  |  |  320|  2.82k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  2.82k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  2.82k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 2.82k]
  |  |  ------------------
  ------------------
 3049|  2.82k|      octx->store_is_empty = FALSE;
  ------------------
  |  | 1058|  2.82k|#define FALSE false
  ------------------
 3050|  2.82k|    }
 3051|       |#else
 3052|       |    /* tell OpenSSL where to find CA certificates that are used to verify the
 3053|       |       server's certificate. */
 3054|       |    if(!X509_STORE_load_locations(store, ssl_cafile, ssl_capath)) {
 3055|       |      if(octx->store_is_empty && !have_native_check) {
 3056|       |        /* Fail if we insist on successfully verifying the server. */
 3057|       |        failf(data, "error adding trust anchors from locations:"
 3058|       |              "  CAfile: %s CApath: %s",
 3059|       |              ssl_cafile ? ssl_cafile : "none",
 3060|       |              ssl_capath ? ssl_capath : "none");
 3061|       |        return CURLE_SSL_CACERT_BADFILE;
 3062|       |      }
 3063|       |      else {
 3064|       |        infof(data, "error setting certificate verify locations,"
 3065|       |              " continuing anyway");
 3066|       |      }
 3067|       |    }
 3068|       |    if(ssl_cafile)
 3069|       |      infof(data, "  CAfile: %s", ssl_cafile);
 3070|       |    if(ssl_capath)
 3071|       |      infof(data, "  CApath: %s", ssl_capath);
 3072|       |    octx->store_is_empty = FALSE;
 3073|       |#endif
 3074|  2.82k|  }
 3075|       |
 3076|       |#ifdef CURL_CA_FALLBACK
 3077|       |  if(octx->store_is_empty) {
 3078|       |    /* verifying the peer without any CA certificates does not
 3079|       |       work so use OpenSSL's built-in default as fallback */
 3080|       |    X509_STORE_set_default_paths(store);
 3081|       |    infof(data, "  OpenSSL default paths (fallback)");
 3082|       |    octx->store_is_empty = FALSE;
 3083|       |  }
 3084|       |#endif
 3085|  2.82k|  if(octx->store_is_empty && !have_native_check)
  ------------------
  |  Branch (3085:6): [True: 0, False: 2.82k]
  |  Branch (3085:30): [True: 0, False: 0]
  ------------------
 3086|      0|    infof(data, "  no trust anchors configured");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3087|       |
 3088|  2.82k|  return result;
 3089|  2.97k|}
openssl.c:ossl_seed:
  801|  16.7k|{
  802|       |  /* This might get called before it has been added to a multi handle */
  803|  16.7k|  if(data->multi && data->multi->ssl_seeded)
  ------------------
  |  Branch (803:6): [True: 4.90k, False: 11.8k]
  |  Branch (803:21): [True: 2.22k, False: 2.67k]
  ------------------
  804|  2.22k|    return CURLE_OK;
  805|       |
  806|  14.4k|  if(rand_enough()) {
  ------------------
  |  Branch (806:6): [True: 14.4k, False: 0]
  ------------------
  807|       |    /* OpenSSL 1.1.0+ should return here */
  808|  14.4k|    if(data->multi)
  ------------------
  |  Branch (808:8): [True: 2.67k, False: 11.8k]
  ------------------
  809|  2.67k|      data->multi->ssl_seeded = TRUE;
  ------------------
  |  | 1055|  2.67k|#define TRUE true
  ------------------
  810|  14.4k|    return CURLE_OK;
  811|  14.4k|  }
  812|      0|  failf(data, "Insufficient randomness");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  813|      0|  return CURLE_SSL_CONNECT_ERROR;
  814|  14.4k|}
openssl.c:rand_enough:
  796|  14.4k|{
  797|  14.4k|  return RAND_status() != 0;
  798|  14.4k|}
openssl.c:ossl_init_method:
 3613|  2.56k|{
 3614|  2.56k|  struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf);
 3615|       |
 3616|  2.56k|  *pmethod = NULL;
 3617|  2.56k|  *pssl_version_min = conn_config->version;
 3618|  2.56k|  DEBUGASSERT(conn_config->version != CURL_SSLVERSION_DEFAULT);
  ------------------
  |  | 1081|  2.56k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3618:3): [True: 0, False: 2.56k]
  |  Branch (3618:3): [True: 2.56k, False: 0]
  ------------------
 3619|  2.56k|  switch(peer->transport) {
 3620|  2.56k|  case TRNSPRT_TCP:
  ------------------
  |  |  307|  2.56k|#define TRNSPRT_TCP  3
  ------------------
  |  Branch (3620:3): [True: 2.56k, False: 0]
  ------------------
 3621|       |    /* check to see if we have been told to use an explicit SSL/TLS version */
 3622|  2.56k|    switch(*pssl_version_min) {
 3623|      6|    case CURL_SSLVERSION_TLSv1:
  ------------------
  |  | 2369|      6|#define CURL_SSLVERSION_TLSv1   1L /* TLS 1.x */
  ------------------
  |  Branch (3623:5): [True: 6, False: 2.55k]
  ------------------
 3624|     15|    case CURL_SSLVERSION_TLSv1_0:
  ------------------
  |  | 2372|     15|#define CURL_SSLVERSION_TLSv1_0 4L
  ------------------
  |  Branch (3624:5): [True: 9, False: 2.55k]
  ------------------
 3625|     22|    case CURL_SSLVERSION_TLSv1_1:
  ------------------
  |  | 2373|     22|#define CURL_SSLVERSION_TLSv1_1 5L
  ------------------
  |  Branch (3625:5): [True: 7, False: 2.55k]
  ------------------
 3626|  2.55k|    case CURL_SSLVERSION_TLSv1_2:
  ------------------
  |  | 2374|  2.55k|#define CURL_SSLVERSION_TLSv1_2 6L
  ------------------
  |  Branch (3626:5): [True: 2.53k, False: 28]
  ------------------
 3627|  2.56k|    case CURL_SSLVERSION_TLSv1_3:
  ------------------
  |  | 2375|  2.56k|#define CURL_SSLVERSION_TLSv1_3 7L
  ------------------
  |  Branch (3627:5): [True: 6, False: 2.55k]
  ------------------
 3628|       |      /* it is handled later with the context options */
 3629|  2.56k|      *pmethod = TLS_client_method();
 3630|  2.56k|      break;
 3631|      0|    case CURL_SSLVERSION_SSLv2:
  ------------------
  |  | 2370|      0|#define CURL_SSLVERSION_SSLv2   2L
  ------------------
  |  Branch (3631:5): [True: 0, False: 2.56k]
  ------------------
 3632|      0|      failf(data, "No SSLv2 support");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3633|      0|      return CURLE_NOT_BUILT_IN;
 3634|      0|    case CURL_SSLVERSION_SSLv3:
  ------------------
  |  | 2371|      0|#define CURL_SSLVERSION_SSLv3   3L
  ------------------
  |  Branch (3634:5): [True: 0, False: 2.56k]
  ------------------
 3635|      0|      failf(data, "No SSLv3 support");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3636|      0|      return CURLE_NOT_BUILT_IN;
 3637|      0|    default:
  ------------------
  |  Branch (3637:5): [True: 0, False: 2.56k]
  ------------------
 3638|      0|      failf(data, "Unrecognized parameter passed via CURLOPT_SSLVERSION");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3639|      0|      return CURLE_SSL_CONNECT_ERROR;
 3640|  2.56k|    }
 3641|  2.56k|    break;
 3642|  2.56k|  case TRNSPRT_QUIC:
  ------------------
  |  |  309|      0|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (3642:3): [True: 0, False: 2.56k]
  ------------------
 3643|      0|    *pssl_version_min = CURL_SSLVERSION_TLSv1_3;
  ------------------
  |  | 2375|      0|#define CURL_SSLVERSION_TLSv1_3 7L
  ------------------
 3644|      0|    if(conn_config->version_max &&
  ------------------
  |  Branch (3644:8): [True: 0, False: 0]
  ------------------
 3645|      0|       (conn_config->version_max != CURL_SSLVERSION_MAX_DEFAULT) &&
  ------------------
  |  | 2380|      0|#define CURL_SSLVERSION_MAX_DEFAULT (CURL_SSLVERSION_TLSv1   << 16)
  |  |  ------------------
  |  |  |  | 2369|      0|#define CURL_SSLVERSION_TLSv1   1L /* TLS 1.x */
  |  |  ------------------
  ------------------
  |  Branch (3645:8): [True: 0, False: 0]
  ------------------
 3646|      0|       (conn_config->version_max != CURL_SSLVERSION_MAX_TLSv1_3)) {
  ------------------
  |  | 2384|      0|#define CURL_SSLVERSION_MAX_TLSv1_3 (CURL_SSLVERSION_TLSv1_3 << 16)
  |  |  ------------------
  |  |  |  | 2375|      0|#define CURL_SSLVERSION_TLSv1_3 7L
  |  |  ------------------
  ------------------
  |  Branch (3646:8): [True: 0, False: 0]
  ------------------
 3647|      0|      failf(data, "QUIC needs at least TLS version 1.3");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3648|      0|      return CURLE_SSL_CONNECT_ERROR;
 3649|      0|    }
 3650|       |
 3651|      0|    *pmethod = TLS_method();
 3652|      0|    break;
 3653|      0|  default:
  ------------------
  |  Branch (3653:3): [True: 0, False: 2.56k]
  ------------------
 3654|      0|    failf(data, "unsupported transport %d in SSL init", peer->transport);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3655|      0|    return CURLE_SSL_CONNECT_ERROR;
 3656|  2.56k|  }
 3657|       |
 3658|  2.56k|  return *pmethod ? CURLE_OK : CURLE_SSL_CONNECT_ERROR;
  ------------------
  |  Branch (3658:10): [True: 2.56k, False: 0]
  ------------------
 3659|  2.56k|}
openssl.c:ossl_strerror:
  749|    643|{
  750|    643|  size_t len;
  751|    643|  DEBUGASSERT(size);
  ------------------
  |  | 1081|    643|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (751:3): [True: 0, False: 643]
  |  Branch (751:3): [True: 643, False: 0]
  ------------------
  752|    643|  *buf = '\0';
  753|       |
  754|    643|  len = Curl_ossl_version(buf, size);
  755|    643|  DEBUGASSERT(len < (size - 2));
  ------------------
  |  | 1081|    643|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (755:3): [True: 0, False: 643]
  |  Branch (755:3): [True: 643, False: 0]
  ------------------
  756|    643|  if(len < (size - 2)) {
  ------------------
  |  Branch (756:6): [True: 643, False: 0]
  ------------------
  757|    643|    buf += len;
  758|    643|    size -= (len + 2);
  759|    643|    *buf++ = ':';
  760|    643|    *buf++ = ' ';
  761|    643|    *buf = '\0';
  762|    643|  }
  763|       |
  764|       |#ifdef HAVE_BORINGSSL_LIKE
  765|       |  ERR_error_string_n((uint32_t)error, buf, size);
  766|       |#else
  767|    643|  ERR_error_string_n(error, buf, size);
  768|    643|#endif
  769|       |
  770|    643|  if(!*buf) {
  ------------------
  |  Branch (770:6): [True: 0, False: 643]
  ------------------
  771|      0|    const char *msg = error ? "Unknown error" : "No error";
  ------------------
  |  Branch (771:23): [True: 0, False: 0]
  ------------------
  772|      0|    curlx_strcopy(buf, size, msg, strlen(msg));
  773|      0|  }
  774|       |
  775|    643|  return buf;
  776|    643|}
openssl.c:ossl_set_ssl_version_min_max:
 2567|  2.47k|{
 2568|  2.47k|  struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf);
 2569|       |  /* first, TLS min version... */
 2570|  2.47k|  long curl_ssl_version_min = (long)ssl_version_min;
 2571|  2.47k|  long curl_ssl_version_max;
 2572|       |
 2573|       |  /* convert curl min SSL version option to OpenSSL constant */
 2574|       |#if defined(HAVE_BORINGSSL_LIKE) || defined(LIBRESSL_VERSION_NUMBER)
 2575|       |  uint16_t ossl_ssl_version_min = 0;
 2576|       |  uint16_t ossl_ssl_version_max = 0;
 2577|       |#else
 2578|  2.47k|  long ossl_ssl_version_min = 0;
 2579|  2.47k|  long ossl_ssl_version_max = 0;
 2580|  2.47k|#endif
 2581|       |  /* it cannot be default here */
 2582|  2.47k|  DEBUGASSERT(curl_ssl_version_min != CURL_SSLVERSION_DEFAULT);
  ------------------
  |  | 1081|  2.47k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2582:3): [True: 0, False: 2.47k]
  |  Branch (2582:3): [True: 2.47k, False: 0]
  ------------------
 2583|  2.47k|  switch(curl_ssl_version_min) {
  ------------------
  |  Branch (2583:10): [True: 2.47k, False: 0]
  ------------------
 2584|      6|  case CURL_SSLVERSION_TLSv1: /* TLS 1.x */
  ------------------
  |  | 2369|      6|#define CURL_SSLVERSION_TLSv1   1L /* TLS 1.x */
  ------------------
  |  Branch (2584:3): [True: 6, False: 2.47k]
  ------------------
 2585|     15|  case CURL_SSLVERSION_TLSv1_0:
  ------------------
  |  | 2372|     15|#define CURL_SSLVERSION_TLSv1_0 4L
  ------------------
  |  Branch (2585:3): [True: 9, False: 2.47k]
  ------------------
 2586|     15|    ossl_ssl_version_min = TLS1_VERSION;
 2587|     15|    break;
 2588|      7|  case CURL_SSLVERSION_TLSv1_1:
  ------------------
  |  | 2373|      7|#define CURL_SSLVERSION_TLSv1_1 5L
  ------------------
  |  Branch (2588:3): [True: 7, False: 2.47k]
  ------------------
 2589|      7|    ossl_ssl_version_min = TLS1_1_VERSION;
 2590|      7|    break;
 2591|  2.45k|  case CURL_SSLVERSION_TLSv1_2:
  ------------------
  |  | 2374|  2.45k|#define CURL_SSLVERSION_TLSv1_2 6L
  ------------------
  |  Branch (2591:3): [True: 2.45k, False: 28]
  ------------------
 2592|  2.45k|    ossl_ssl_version_min = TLS1_2_VERSION;
 2593|  2.45k|    break;
 2594|      6|  case CURL_SSLVERSION_TLSv1_3:
  ------------------
  |  | 2375|      6|#define CURL_SSLVERSION_TLSv1_3 7L
  ------------------
  |  Branch (2594:3): [True: 6, False: 2.47k]
  ------------------
 2595|      6|    ossl_ssl_version_min = TLS1_3_VERSION;
 2596|      6|    break;
 2597|  2.47k|  }
 2598|       |
 2599|       |  /* ... then, TLS max version */
 2600|  2.47k|  curl_ssl_version_max = (long)conn_config->version_max;
 2601|       |
 2602|       |  /* convert curl max SSL version option to OpenSSL constant */
 2603|  2.47k|  switch(curl_ssl_version_max) {
 2604|      2|  case CURL_SSLVERSION_MAX_TLSv1_0:
  ------------------
  |  | 2381|      2|#define CURL_SSLVERSION_MAX_TLSv1_0 (CURL_SSLVERSION_TLSv1_0 << 16)
  |  |  ------------------
  |  |  |  | 2372|      2|#define CURL_SSLVERSION_TLSv1_0 4L
  |  |  ------------------
  ------------------
  |  Branch (2604:3): [True: 2, False: 2.47k]
  ------------------
 2605|      2|    ossl_ssl_version_max = TLS1_VERSION;
 2606|      2|    break;
 2607|      6|  case CURL_SSLVERSION_MAX_TLSv1_1:
  ------------------
  |  | 2382|      6|#define CURL_SSLVERSION_MAX_TLSv1_1 (CURL_SSLVERSION_TLSv1_1 << 16)
  |  |  ------------------
  |  |  |  | 2373|      6|#define CURL_SSLVERSION_TLSv1_1 5L
  |  |  ------------------
  ------------------
  |  Branch (2607:3): [True: 6, False: 2.47k]
  ------------------
 2608|      6|    ossl_ssl_version_max = TLS1_1_VERSION;
 2609|      6|    break;
 2610|     10|  case CURL_SSLVERSION_MAX_TLSv1_2:
  ------------------
  |  | 2383|     10|#define CURL_SSLVERSION_MAX_TLSv1_2 (CURL_SSLVERSION_TLSv1_2 << 16)
  |  |  ------------------
  |  |  |  | 2374|     10|#define CURL_SSLVERSION_TLSv1_2 6L
  |  |  ------------------
  ------------------
  |  Branch (2610:3): [True: 10, False: 2.46k]
  ------------------
 2611|     10|    ossl_ssl_version_max = TLS1_2_VERSION;
 2612|     10|    break;
 2613|      5|  case CURL_SSLVERSION_MAX_TLSv1_3:
  ------------------
  |  | 2384|      5|#define CURL_SSLVERSION_MAX_TLSv1_3 (CURL_SSLVERSION_TLSv1_3 << 16)
  |  |  ------------------
  |  |  |  | 2375|      5|#define CURL_SSLVERSION_TLSv1_3 7L
  |  |  ------------------
  ------------------
  |  Branch (2613:3): [True: 5, False: 2.47k]
  ------------------
 2614|      5|    ossl_ssl_version_max = TLS1_3_VERSION;
 2615|      5|    break;
 2616|  2.45k|  case CURL_SSLVERSION_MAX_NONE:  /* none selected */
  ------------------
  |  | 2379|  2.45k|#define CURL_SSLVERSION_MAX_NONE 0L
  ------------------
  |  Branch (2616:3): [True: 2.45k, False: 28]
  ------------------
 2617|  2.45k|  case CURL_SSLVERSION_MAX_DEFAULT:  /* max selected */
  ------------------
  |  | 2380|  2.45k|#define CURL_SSLVERSION_MAX_DEFAULT (CURL_SSLVERSION_TLSv1   << 16)
  |  |  ------------------
  |  |  |  | 2369|  2.45k|#define CURL_SSLVERSION_TLSv1   1L /* TLS 1.x */
  |  |  ------------------
  ------------------
  |  Branch (2617:3): [True: 4, False: 2.47k]
  ------------------
 2618|  2.45k|  default:
  ------------------
  |  Branch (2618:3): [True: 1, False: 2.47k]
  ------------------
 2619|       |    /* SSL_CTX_set_max_proto_version states that: setting the maximum to 0
 2620|       |       enables protocol versions up to the highest version supported by
 2621|       |       the library */
 2622|  2.45k|    ossl_ssl_version_max = 0;
 2623|  2.45k|    break;
 2624|  2.47k|  }
 2625|       |
 2626|  2.47k|  if(!SSL_CTX_set_min_proto_version(ctx, ossl_ssl_version_min) ||
  ------------------
  |  Branch (2626:6): [True: 0, False: 2.47k]
  ------------------
 2627|  2.47k|     !SSL_CTX_set_max_proto_version(ctx, ossl_ssl_version_max))
  ------------------
  |  Branch (2627:6): [True: 0, False: 2.47k]
  ------------------
 2628|      0|    return CURLE_SSL_CONNECT_ERROR;
 2629|       |
 2630|  2.47k|  return CURLE_OK;
 2631|  2.47k|}
openssl.c:client_cert:
 1431|     23|{
 1432|     23|  char error_buffer[256];
 1433|     23|  bool check_privkey = TRUE;
  ------------------
  |  | 1055|     23|#define TRUE true
  ------------------
 1434|     23|  int file_type = ossl_do_file_type(cert_type);
 1435|       |
 1436|     23|  if(cert_file || cert_blob || (file_type == SSL_FILETYPE_ENGINE) ||
  ------------------
  |  |  817|     12|#define SSL_FILETYPE_ENGINE 42
  ------------------
  |  Branch (1436:6): [True: 11, False: 12]
  |  Branch (1436:19): [True: 0, False: 12]
  |  Branch (1436:32): [True: 0, False: 12]
  ------------------
 1437|     12|     (file_type == SSL_FILETYPE_PROVIDER)) {
  ------------------
  |  |  823|     12|#define SSL_FILETYPE_PROVIDER 44
  ------------------
  |  Branch (1437:6): [True: 0, False: 12]
  ------------------
 1438|     11|    SSL *ssl;
 1439|     11|    X509 *x509;
 1440|     11|    bool pcks12_done = FALSE;
  ------------------
  |  | 1058|     11|#define FALSE false
  ------------------
 1441|     11|    int cert_use_result;
 1442|       |
 1443|     11|    if(key_passwd) {
  ------------------
  |  Branch (1443:8): [True: 1, False: 10]
  ------------------
 1444|       |      /* set the password in the callback userdata */
 1445|      1|      SSL_CTX_set_default_passwd_cb_userdata(ctx, key_passwd);
 1446|       |      /* Set passwd callback: */
 1447|      1|      SSL_CTX_set_default_passwd_cb(ctx, passwd_callback);
 1448|      1|    }
 1449|       |
 1450|     11|    switch(file_type) {
 1451|     10|    case SSL_FILETYPE_PEM:
  ------------------
  |  Branch (1451:5): [True: 10, False: 1]
  ------------------
 1452|       |      /* SSL_CTX_use_certificate_chain_file() only works on PEM files */
 1453|     10|      cert_use_result = cert_blob ?
  ------------------
  |  Branch (1453:25): [True: 0, False: 10]
  ------------------
 1454|      0|        use_certificate_chain_blob(ctx, cert_blob, key_passwd) :
 1455|     10|        SSL_CTX_use_certificate_chain_file(ctx, cert_file);
 1456|     10|      if(cert_use_result != 1) {
  ------------------
  |  Branch (1456:10): [True: 10, False: 0]
  ------------------
 1457|     10|        failf(data,
  ------------------
  |  |   62|     10|#define failf Curl_failf
  ------------------
 1458|     10|              "could not load PEM client certificate from %s, " OSSL_PACKAGE
 1459|     10|              " error %s, "
 1460|     10|              "(no key found, wrong passphrase, or wrong file format?)",
 1461|     10|              (cert_blob ? "CURLOPT_SSLCERT_BLOB" : cert_file),
  ------------------
  |  Branch (1461:16): [True: 0, False: 10]
  ------------------
 1462|     10|              ossl_strerror(ERR_get_error(), error_buffer,
 1463|     10|                            sizeof(error_buffer)));
 1464|     10|        return CURLE_SSL_CERTPROBLEM;
 1465|     10|      }
 1466|      0|      break;
 1467|       |
 1468|      0|    case SSL_FILETYPE_ASN1:
  ------------------
  |  Branch (1468:5): [True: 0, False: 11]
  ------------------
 1469|       |      /* SSL_CTX_use_certificate_file() works with either PEM or ASN1, but
 1470|       |         we use the case above for PEM so this can only be performed with
 1471|       |         ASN1 files. */
 1472|       |
 1473|      0|      cert_use_result = cert_blob ?
  ------------------
  |  Branch (1473:25): [True: 0, False: 0]
  ------------------
 1474|      0|        use_certificate_blob(ctx, cert_blob, file_type, key_passwd) :
 1475|      0|      SSL_CTX_use_certificate_file(ctx, cert_file, file_type);
 1476|      0|      if(cert_use_result != 1) {
  ------------------
  |  Branch (1476:10): [True: 0, False: 0]
  ------------------
 1477|      0|        failf(data,
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1478|      0|              "could not load ASN1 client certificate from %s, " OSSL_PACKAGE
 1479|      0|              " error %s, "
 1480|      0|              "(no key found, wrong passphrase, or wrong file format?)",
 1481|      0|              (cert_blob ? "CURLOPT_SSLCERT_BLOB" : cert_file),
  ------------------
  |  Branch (1481:16): [True: 0, False: 0]
  ------------------
 1482|      0|              ossl_strerror(ERR_get_error(), error_buffer,
 1483|      0|                            sizeof(error_buffer)));
 1484|      0|        return CURLE_SSL_CERTPROBLEM;
 1485|      0|      }
 1486|      0|      break;
 1487|       |
 1488|      0|    case SSL_FILETYPE_ENGINE:
  ------------------
  |  |  817|      0|#define SSL_FILETYPE_ENGINE 42
  ------------------
  |  Branch (1488:5): [True: 0, False: 11]
  ------------------
 1489|      0|      if(!cert_file || !engineload(data, ctx, cert_file))
  ------------------
  |  Branch (1489:10): [True: 0, False: 0]
  |  Branch (1489:24): [True: 0, False: 0]
  ------------------
 1490|      0|        return CURLE_SSL_CERTPROBLEM;
 1491|      0|      break;
 1492|       |
 1493|      0|    case SSL_FILETYPE_PROVIDER:
  ------------------
  |  |  823|      0|#define SSL_FILETYPE_PROVIDER 44
  ------------------
  |  Branch (1493:5): [True: 0, False: 11]
  ------------------
 1494|      0|      if(!cert_file || !providerload(data, ctx, cert_file))
  ------------------
  |  Branch (1494:10): [True: 0, False: 0]
  |  Branch (1494:24): [True: 0, False: 0]
  ------------------
 1495|      0|        return CURLE_SSL_CERTPROBLEM;
 1496|      0|      break;
 1497|       |
 1498|      0|    case SSL_FILETYPE_PKCS12:
  ------------------
  |  |  820|      0|#define SSL_FILETYPE_PKCS12 43
  ------------------
  |  Branch (1498:5): [True: 0, False: 11]
  ------------------
 1499|      0|      if(!pkcs12load(data, ctx, cert_blob, cert_file, key_passwd))
  ------------------
  |  Branch (1499:10): [True: 0, False: 0]
  ------------------
 1500|      0|        return CURLE_SSL_CERTPROBLEM;
 1501|      0|      pcks12_done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1502|      0|      break;
 1503|       |
 1504|      1|    default:
  ------------------
  |  Branch (1504:5): [True: 1, False: 10]
  ------------------
 1505|      1|      failf(data, "not supported file type '%s' for certificate", cert_type);
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
 1506|      1|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1507|     11|    }
 1508|       |
 1509|      0|    if(!key_file && !key_blob) {
  ------------------
  |  Branch (1509:8): [True: 0, False: 0]
  |  Branch (1509:21): [True: 0, False: 0]
  ------------------
 1510|      0|      key_file = cert_file;
 1511|      0|      key_blob = cert_blob;
 1512|      0|    }
 1513|      0|    else
 1514|      0|      file_type = ossl_do_file_type(key_type);
 1515|       |
 1516|      0|    switch(file_type) {
 1517|      0|    case SSL_FILETYPE_PEM:
  ------------------
  |  Branch (1517:5): [True: 0, False: 0]
  ------------------
 1518|      0|    case SSL_FILETYPE_ASN1:
  ------------------
  |  Branch (1518:5): [True: 0, False: 0]
  ------------------
 1519|      0|      cert_use_result = key_blob ?
  ------------------
  |  Branch (1519:25): [True: 0, False: 0]
  ------------------
 1520|      0|        use_privatekey_blob(ctx, key_blob, file_type, key_passwd) :
 1521|      0|      SSL_CTX_use_PrivateKey_file(ctx, key_file, file_type);
 1522|      0|      if(cert_use_result != 1) {
  ------------------
  |  Branch (1522:10): [True: 0, False: 0]
  ------------------
 1523|      0|        failf(data, "unable to set private key file: '%s' type %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1524|      0|              key_file ? key_file : "(memory blob)",
  ------------------
  |  Branch (1524:15): [True: 0, False: 0]
  ------------------
 1525|      0|              key_type ? key_type : "PEM");
  ------------------
  |  Branch (1525:15): [True: 0, False: 0]
  ------------------
 1526|      0|        return CURLE_BAD_FUNCTION_ARGUMENT;
 1527|      0|      }
 1528|      0|      break;
 1529|      0|    case SSL_FILETYPE_ENGINE:
  ------------------
  |  |  817|      0|#define SSL_FILETYPE_ENGINE 42
  ------------------
  |  Branch (1529:5): [True: 0, False: 0]
  ------------------
 1530|      0|      if(!enginecheck(data, ctx, key_file, key_passwd))
  ------------------
  |  Branch (1530:10): [True: 0, False: 0]
  ------------------
 1531|      0|        return CURLE_SSL_CERTPROBLEM;
 1532|      0|      break;
 1533|       |
 1534|      0|    case SSL_FILETYPE_PROVIDER:
  ------------------
  |  |  823|      0|#define SSL_FILETYPE_PROVIDER 44
  ------------------
  |  Branch (1534:5): [True: 0, False: 0]
  ------------------
 1535|      0|      if(!providercheck(data, ctx, key_file))
  ------------------
  |  Branch (1535:10): [True: 0, False: 0]
  ------------------
 1536|      0|        return CURLE_SSL_CERTPROBLEM;
 1537|      0|      break;
 1538|       |
 1539|      0|    case SSL_FILETYPE_PKCS12:
  ------------------
  |  |  820|      0|#define SSL_FILETYPE_PKCS12 43
  ------------------
  |  Branch (1539:5): [True: 0, False: 0]
  ------------------
 1540|      0|      if(!pcks12_done) {
  ------------------
  |  Branch (1540:10): [True: 0, False: 0]
  ------------------
 1541|      0|        failf(data, "file type P12 for private key not supported");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1542|      0|        return CURLE_SSL_CERTPROBLEM;
 1543|      0|      }
 1544|      0|      break;
 1545|      0|    default:
  ------------------
  |  Branch (1545:5): [True: 0, False: 0]
  ------------------
 1546|      0|      failf(data, "not supported file type for private key");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1547|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1548|      0|    }
 1549|       |
 1550|      0|    ssl = SSL_new(ctx);
 1551|      0|    if(!ssl) {
  ------------------
  |  Branch (1551:8): [True: 0, False: 0]
  ------------------
 1552|      0|      failf(data, "unable to create an SSL structure");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1553|      0|      return CURLE_OUT_OF_MEMORY;
 1554|      0|    }
 1555|       |
 1556|      0|    x509 = SSL_get_certificate(ssl);
 1557|       |
 1558|      0|    if(x509) {
  ------------------
  |  Branch (1558:8): [True: 0, False: 0]
  ------------------
 1559|      0|      EVP_PKEY *pktmp = X509_get_pubkey(x509);
 1560|      0|      EVP_PKEY_copy_parameters(pktmp, SSL_get_privatekey(ssl));
 1561|      0|      EVP_PKEY_free(pktmp);
 1562|      0|    }
 1563|       |
 1564|      0|#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)
 1565|      0|    {
 1566|       |      /* If RSA is used, do not check the private key if its flags indicate
 1567|       |       * it does not support it. */
 1568|      0|      EVP_PKEY *priv_key = SSL_get_privatekey(ssl);
 1569|      0|      if(EVP_PKEY_id(priv_key) == EVP_PKEY_RSA) {
  ------------------
  |  Branch (1569:10): [True: 0, False: 0]
  ------------------
 1570|      0|        RSA *rsa = EVP_PKEY_get1_RSA(priv_key);
 1571|      0|        if(RSA_flags(rsa) & RSA_METHOD_FLAG_NO_CHECK)
  ------------------
  |  Branch (1571:12): [True: 0, False: 0]
  ------------------
 1572|      0|          check_privkey = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1573|      0|        RSA_free(rsa); /* Decrement reference count */
 1574|      0|      }
 1575|      0|    }
 1576|      0|#endif
 1577|       |
 1578|      0|    SSL_free(ssl);
 1579|       |
 1580|       |    /* If we are using DSA, we can copy the parameters from
 1581|       |     * the private key */
 1582|       |
 1583|      0|    if(check_privkey == TRUE) {
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
  |  Branch (1583:8): [True: 0, False: 0]
  ------------------
 1584|       |      /* Now we know that a key and cert have been set against
 1585|       |       * the SSL context */
 1586|      0|      if(!SSL_CTX_check_private_key(ctx)) {
  ------------------
  |  Branch (1586:10): [True: 0, False: 0]
  ------------------
 1587|      0|        failf(data, "Private key does not match the certificate public key");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1588|      0|        return CURLE_SSL_CERTPROBLEM;
 1589|      0|      }
 1590|      0|    }
 1591|      0|  }
 1592|     12|  return CURLE_OK;
 1593|     23|}
openssl.c:ossl_do_file_type:
  826|     23|{
  827|     23|  if(!type || !type[0])
  ------------------
  |  Branch (827:6): [True: 10, False: 13]
  |  Branch (827:15): [True: 1, False: 12]
  ------------------
  828|     11|    return SSL_FILETYPE_PEM;
  829|     12|  if(curl_strequal(type, "PEM"))
  ------------------
  |  Branch (829:6): [True: 0, False: 12]
  ------------------
  830|      0|    return SSL_FILETYPE_PEM;
  831|     12|  if(curl_strequal(type, "DER"))
  ------------------
  |  Branch (831:6): [True: 0, False: 12]
  ------------------
  832|      0|    return SSL_FILETYPE_ASN1;
  833|     12|  if(curl_strequal(type, "PROV"))
  ------------------
  |  Branch (833:6): [True: 0, False: 12]
  ------------------
  834|      0|    return SSL_FILETYPE_PROVIDER;
  ------------------
  |  |  823|      0|#define SSL_FILETYPE_PROVIDER 44
  ------------------
  835|     12|  if(curl_strequal(type, "ENG"))
  ------------------
  |  Branch (835:6): [True: 0, False: 12]
  ------------------
  836|      0|    return SSL_FILETYPE_ENGINE;
  ------------------
  |  |  817|      0|#define SSL_FILETYPE_ENGINE 42
  ------------------
  837|     12|  if(curl_strequal(type, "P12"))
  ------------------
  |  Branch (837:6): [True: 0, False: 12]
  ------------------
  838|      0|    return SSL_FILETYPE_PKCS12;
  ------------------
  |  |  820|      0|#define SSL_FILETYPE_PKCS12 43
  ------------------
  839|     12|  return -1;
  840|     12|}
openssl.c:ossl_set_provider:
 1768|    817|{
 1769|    817|  char name[MAX_PROVIDER_LEN + 1];
 1770|    817|  struct Curl_str prov;
 1771|    817|  const char *propq = NULL;
 1772|       |
 1773|    817|  if(!iname) {
  ------------------
  |  Branch (1773:6): [True: 0, False: 817]
  ------------------
 1774|       |    /* clear and cleanup provider use */
 1775|      0|    ossl_provider_cleanup(data);
 1776|      0|    return CURLE_OK;
 1777|      0|  }
 1778|    817|  if(curlx_str_until(&iname, &prov, MAX_PROVIDER_LEN, ':'))
  ------------------
  |  | 1757|    817|#define MAX_PROVIDER_LEN 128 /* reasonable */
  ------------------
  |  Branch (1778:6): [True: 31, False: 786]
  ------------------
 1779|     31|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1780|       |
 1781|    786|  if(!curlx_str_single(&iname, ':'))
  ------------------
  |  Branch (1781:6): [True: 635, False: 151]
  ------------------
 1782|       |    /* there was a colon, get the propq until the end of string */
 1783|    635|    propq = iname;
 1784|       |
 1785|       |  /* we need the name in a buffer, null-terminated */
 1786|    786|  memcpy(name, curlx_str(&prov), curlx_strlen(&prov));
  ------------------
  |  |   49|    786|#define curlx_str(x)    ((x)->str)
  ------------------
                memcpy(name, curlx_str(&prov), curlx_strlen(&prov));
  ------------------
  |  |   50|    786|#define curlx_strlen(x) ((x)->len)
  ------------------
 1787|    786|  name[curlx_strlen(&prov)] = 0;
  ------------------
  |  |   50|    786|#define curlx_strlen(x) ((x)->len)
  ------------------
 1788|       |
 1789|    786|  if(!data->state.libctx) {
  ------------------
  |  Branch (1789:6): [True: 786, False: 0]
  ------------------
 1790|    786|    OSSL_LIB_CTX *libctx = OSSL_LIB_CTX_new();
 1791|    786|    if(!libctx)
  ------------------
  |  Branch (1791:8): [True: 0, False: 786]
  ------------------
 1792|      0|      return CURLE_OUT_OF_MEMORY;
 1793|    786|    if(propq) {
  ------------------
  |  Branch (1793:8): [True: 635, False: 151]
  ------------------
 1794|    635|      data->state.propq = curlx_strdup(propq);
  ------------------
  |  | 1477|    635|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1795|    635|      if(!data->state.propq) {
  ------------------
  |  Branch (1795:10): [True: 0, False: 635]
  ------------------
 1796|      0|        OSSL_LIB_CTX_free(libctx);
 1797|      0|        return CURLE_OUT_OF_MEMORY;
 1798|      0|      }
 1799|    635|    }
 1800|    786|    data->state.libctx = libctx;
 1801|    786|  }
 1802|       |
 1803|    786|#ifndef CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG
 1804|       |  /* load the configuration file into the library context before checking the
 1805|       |   * provider availability */
 1806|    786|  if(!OSSL_LIB_CTX_load_config(data->state.libctx, NULL)) {
  ------------------
  |  Branch (1806:6): [True: 786, False: 0]
  ------------------
 1807|    786|    infof(data, "Failed to load default openssl config. Proceeding.");
  ------------------
  |  |  143|    786|  do {                               \
  |  |  144|    786|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    786|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 786, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 786]
  |  |  |  |  ------------------
  |  |  |  |  320|    786|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    786|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    786|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 786]
  |  |  ------------------
  ------------------
 1808|    786|  }
 1809|    786|#endif
 1810|       |
 1811|    786|  if(OSSL_PROVIDER_available(data->state.libctx, name)) {
  ------------------
  |  Branch (1811:6): [True: 24, False: 762]
  ------------------
 1812|       |    /* already loaded through the configuration - no action needed */
 1813|     24|    data->state.provider_loaded = TRUE;
  ------------------
  |  | 1055|     24|#define TRUE true
  ------------------
 1814|     24|    return CURLE_OK;
 1815|     24|  }
 1816|       |
 1817|    762|  data->state.provider = OSSL_PROVIDER_try_load(data->state.libctx, name, 1);
 1818|    762|  if(!data->state.provider) {
  ------------------
  |  Branch (1818:6): [True: 135, False: 627]
  ------------------
 1819|    135|    char error_buffer[256];
 1820|    135|    failf(data, "Failed to initialize provider: %s",
  ------------------
  |  |   62|    135|#define failf Curl_failf
  ------------------
 1821|    135|          ossl_strerror(ERR_get_error(), error_buffer, sizeof(error_buffer)));
 1822|    135|    ossl_provider_cleanup(data);
 1823|    135|    return CURLE_SSL_ENGINE_NOTFOUND;
 1824|    135|  }
 1825|       |
 1826|       |  /* load the base provider as well */
 1827|    627|  data->state.baseprov = OSSL_PROVIDER_try_load(data->state.libctx, "base", 1);
 1828|    627|  if(!data->state.baseprov) {
  ------------------
  |  Branch (1828:6): [True: 0, False: 627]
  ------------------
 1829|      0|    ossl_provider_cleanup(data);
 1830|      0|    failf(data, "Failed to load base");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1831|      0|    return CURLE_SSL_ENGINE_NOTFOUND;
 1832|      0|  }
 1833|    627|  else
 1834|    627|    data->state.provider_loaded = TRUE;
  ------------------
  |  | 1055|    627|#define TRUE true
  ------------------
 1835|    627|  return CURLE_OK;
 1836|    627|}
openssl.c:ossl_provider_cleanup:
 1742|  36.7k|{
 1743|  36.7k|  if(data->state.baseprov) {
  ------------------
  |  Branch (1743:6): [True: 627, False: 36.1k]
  ------------------
 1744|    627|    OSSL_PROVIDER_unload(data->state.baseprov);
 1745|    627|    data->state.baseprov = NULL;
 1746|    627|  }
 1747|  36.7k|  if(data->state.provider) {
  ------------------
  |  Branch (1747:6): [True: 627, False: 36.1k]
  ------------------
 1748|    627|    OSSL_PROVIDER_unload(data->state.provider);
 1749|    627|    data->state.provider = NULL;
 1750|    627|  }
 1751|  36.7k|  OSSL_LIB_CTX_free(data->state.libctx);
 1752|  36.7k|  data->state.libctx = NULL;
 1753|  36.7k|  curlx_safefree(data->state.propq);
  ------------------
  |  | 1327|  36.7k|  do {                      \
  |  | 1328|  36.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  36.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  36.7k|    (ptr) = NULL;           \
  |  | 1330|  36.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 36.7k]
  |  |  ------------------
  ------------------
 1754|       |  data->state.provider_loaded = FALSE;
  ------------------
  |  | 1058|  36.7k|#define FALSE false
  ------------------
 1755|  36.7k|}
openssl.c:ossl_init_ssl:
 3570|  1.77k|{
 3571|       |  /* Let's make an SSL structure */
 3572|  1.77k|  if(octx->ssl)
  ------------------
  |  Branch (3572:6): [True: 0, False: 1.77k]
  ------------------
 3573|      0|    SSL_free(octx->ssl);
 3574|  1.77k|  octx->ssl = SSL_new(octx->ssl_ctx);
 3575|  1.77k|  if(!octx->ssl) {
  ------------------
  |  Branch (3575:6): [True: 0, False: 1.77k]
  ------------------
 3576|      0|    failf(data, "SSL: could not create a context (handle)");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3577|      0|    return CURLE_OUT_OF_MEMORY;
 3578|      0|  }
 3579|       |
 3580|  1.77k|  SSL_set_app_data(octx->ssl, ssl_user_data);
 3581|       |
 3582|  1.77k|#ifndef OPENSSL_NO_OCSP
 3583|  1.77k|  if(Curl_ssl_cf_get_primary_config(cf)->verifystatus)
  ------------------
  |  Branch (3583:6): [True: 2, False: 1.76k]
  ------------------
 3584|  1.77k|    SSL_set_tlsext_status_type(octx->ssl, TLSEXT_STATUSTYPE_ocsp);
 3585|  1.77k|#endif
 3586|       |
 3587|  1.77k|  SSL_set_connect_state(octx->ssl);
 3588|       |
 3589|  1.77k|  if(peer->sni) {
  ------------------
  |  Branch (3589:6): [True: 576, False: 1.19k]
  ------------------
 3590|    576|    if(!SSL_set_tlsext_host_name(octx->ssl, peer->sni)) {
  ------------------
  |  Branch (3590:8): [True: 0, False: 576]
  ------------------
 3591|      0|      failf(data, "Failed set SNI");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3592|      0|      return CURLE_SSL_CONNECT_ERROR;
 3593|      0|    }
 3594|    576|  }
 3595|       |
 3596|       |#ifdef HAVE_SSL_SET1_ECH_CONFIG_LIST
 3597|       |  {
 3598|       |    CURLcode result = ossl_init_ech(octx, cf, data, peer);
 3599|       |    if(result)
 3600|       |      return result;
 3601|       |  }
 3602|       |#endif /* HAVE_SSL_SET1_ECH_CONFIG_LIST */
 3603|       |
 3604|  1.77k|  return ossl_init_session_and_alpns(octx, cf, data, peer,
 3605|  1.77k|                                     alpns_requested, sess_reuse_cb);
 3606|  1.77k|}
openssl.c:ossl_init_session_and_alpns:
 3334|  1.77k|{
 3335|  1.77k|  struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data);
 3336|  1.77k|  struct ssl_primary_config *conn_cfg = Curl_ssl_cf_get_primary_config(cf);
 3337|  1.77k|  struct alpn_spec alpns;
 3338|  1.77k|  CURLcode result;
 3339|       |
 3340|  1.77k|  Curl_alpn_copy(&alpns, alpns_requested);
 3341|       |
 3342|  1.77k|  octx->reused_session = FALSE;
  ------------------
  |  | 1058|  1.77k|#define FALSE false
  ------------------
 3343|  1.77k|  if(Curl_ssl_scache_use(cf, data) && !conn_cfg->verifystatus) {
  ------------------
  |  Branch (3343:6): [True: 1.76k, False: 1]
  |  Branch (3343:39): [True: 1.76k, False: 2]
  ------------------
 3344|  1.76k|    struct Curl_ssl_session *scs = NULL;
 3345|       |
 3346|  1.76k|    result = Curl_ssl_scache_take(cf, data, peer->scache_key, &scs);
 3347|  1.76k|    if(!result && scs && scs->sdata && scs->sdata_len) {
  ------------------
  |  Branch (3347:8): [True: 1.76k, False: 0]
  |  Branch (3347:19): [True: 0, False: 1.76k]
  |  Branch (3347:26): [True: 0, False: 0]
  |  Branch (3347:40): [True: 0, False: 0]
  ------------------
 3348|      0|      const unsigned char *der_sessionid = scs->sdata;
 3349|      0|      size_t der_sessionid_size = scs->sdata_len;
 3350|      0|      SSL_SESSION *ssl_session = NULL;
 3351|       |
 3352|       |      /* If OpenSSL does not accept the session from the cache, this
 3353|       |       * is not an error. We continue without it. */
 3354|      0|      ssl_session = d2i_SSL_SESSION(NULL, &der_sessionid,
 3355|      0|                                    (long)der_sessionid_size);
 3356|      0|      if(ssl_session) {
  ------------------
  |  Branch (3356:10): [True: 0, False: 0]
  ------------------
 3357|      0|        if(!SSL_set_session(octx->ssl, ssl_session)) {
  ------------------
  |  Branch (3357:12): [True: 0, False: 0]
  ------------------
 3358|      0|          VERBOSE(char error_buffer[256]);
  ------------------
  |  | 1618|      0|#define VERBOSE(x) x
  ------------------
 3359|      0|          infof(data, "SSL: SSL_set_session not accepted, "
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3360|      0|                "continuing without: %s",
 3361|      0|                ossl_strerror(ERR_get_error(), error_buffer,
 3362|      0|                              sizeof(error_buffer)));
 3363|      0|        }
 3364|      0|        else {
 3365|      0|          if(conn_cfg->verifypeer &&
  ------------------
  |  Branch (3365:14): [True: 0, False: 0]
  ------------------
 3366|      0|             (SSL_get_verify_result(octx->ssl) != X509_V_OK)) {
  ------------------
  |  Branch (3366:14): [True: 0, False: 0]
  ------------------
 3367|       |            /* Session was from unverified connection, cannot reuse here */
 3368|      0|            SSL_set_session(octx->ssl, NULL);
 3369|      0|            infof(data, "SSL session not peer verified, not reusing");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3370|      0|          }
 3371|      0|          else {
 3372|      0|            infof(data, "SSL reusing session with ALPN '%s'",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3373|      0|                  scs->alpn ? scs->alpn : "-");
 3374|      0|            octx->reused_session = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 3375|      0|            infof(data, "SSL verify result: %lx",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3376|      0|                  SSL_get_verify_result(octx->ssl));
 3377|      0|#ifdef HAVE_OPENSSL_EARLYDATA
 3378|      0|            if(ssl_config->earlydata && scs->alpn &&
  ------------------
  |  Branch (3378:16): [True: 0, False: 0]
  |  Branch (3378:41): [True: 0, False: 0]
  ------------------
 3379|      0|               SSL_SESSION_get_max_early_data(ssl_session) &&
  ------------------
  |  Branch (3379:16): [True: 0, False: 0]
  ------------------
 3380|      0|               !cf->conn->bits.connect_only &&
  ------------------
  |  Branch (3380:16): [True: 0, False: 0]
  ------------------
 3381|      0|               (SSL_version(octx->ssl) == TLS1_3_VERSION)) {
  ------------------
  |  Branch (3381:16): [True: 0, False: 0]
  ------------------
 3382|      0|              bool do_early_data = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 3383|      0|              if(sess_reuse_cb) {
  ------------------
  |  Branch (3383:18): [True: 0, False: 0]
  ------------------
 3384|      0|                result = sess_reuse_cb(cf, data, &alpns, scs, &do_early_data);
 3385|      0|                if(result) {
  ------------------
  |  Branch (3385:20): [True: 0, False: 0]
  ------------------
 3386|      0|                  SSL_SESSION_free(ssl_session);
 3387|      0|                  return result;
 3388|      0|                }
 3389|      0|              }
 3390|      0|              if(do_early_data) {
  ------------------
  |  Branch (3390:18): [True: 0, False: 0]
  ------------------
 3391|       |                /* We only try the ALPN protocol the session used before,
 3392|       |                 * otherwise we might send early data for the wrong protocol */
 3393|      0|                Curl_alpn_restrict_to(&alpns, scs->alpn);
 3394|      0|              }
 3395|      0|            }
 3396|       |#else
 3397|       |            (void)ssl_config;
 3398|       |            (void)sess_reuse_cb;
 3399|       |#endif
 3400|      0|          }
 3401|      0|        }
 3402|      0|        SSL_SESSION_free(ssl_session);
 3403|      0|      }
 3404|      0|      else {
 3405|      0|        infof(data, "SSL session not accepted by OpenSSL, continuing without");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3406|      0|      }
 3407|      0|    }
 3408|  1.76k|    Curl_ssl_scache_return(cf, data, peer->scache_key, scs);
 3409|  1.76k|  }
 3410|       |
 3411|  1.77k|  if(alpns.count) {
  ------------------
  |  Branch (3411:6): [True: 415, False: 1.35k]
  ------------------
 3412|    415|    struct alpn_proto_buf proto;
 3413|    415|    memset(&proto, 0, sizeof(proto));
 3414|    415|    result = Curl_alpn_to_proto_buf(&proto, &alpns);
 3415|    415|    if(result) {
  ------------------
  |  Branch (3415:8): [True: 0, False: 415]
  ------------------
 3416|      0|      failf(data, "Error determining ALPN");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3417|      0|      return CURLE_SSL_CONNECT_ERROR;
 3418|      0|    }
 3419|    415|    if(SSL_set_alpn_protos(octx->ssl, proto.data, proto.len)) {
  ------------------
  |  Branch (3419:8): [True: 0, False: 415]
  ------------------
 3420|      0|      failf(data, "Error setting ALPN");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3421|      0|      return CURLE_SSL_CONNECT_ERROR;
 3422|      0|    }
 3423|    415|  }
 3424|       |
 3425|  1.77k|  return CURLE_OK;
 3426|  1.77k|}
openssl.c:ossl_init:
 1626|      1|{
 1627|      1|  const uint64_t flags =
 1628|      1|#ifdef OPENSSL_INIT_ENGINE_ALL_BUILTIN
 1629|       |    /* not present in BoringSSL */
 1630|      1|    OPENSSL_INIT_ENGINE_ALL_BUILTIN |
 1631|      1|#endif
 1632|       |#ifdef CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG
 1633|       |    OPENSSL_INIT_NO_LOAD_CONFIG |
 1634|       |#else
 1635|      1|    OPENSSL_INIT_LOAD_CONFIG |
 1636|      1|#endif
 1637|      1|    0;
 1638|      1|  OPENSSL_init_ssl(flags, NULL);
 1639|       |
 1640|      1|#ifndef HAVE_KEYLOG_UPSTREAM
 1641|      1|  Curl_tls_keylog_open();
 1642|      1|#endif
 1643|       |
 1644|      1|  return 1;
 1645|      1|}
openssl.c:SSL_ERROR_to_str:
  709|      3|{
  710|      3|  switch(err) {
  711|      0|  case SSL_ERROR_NONE:
  ------------------
  |  Branch (711:3): [True: 0, False: 3]
  ------------------
  712|      0|    return "SSL_ERROR_NONE";
  713|      0|  case SSL_ERROR_SSL:
  ------------------
  |  Branch (713:3): [True: 0, False: 3]
  ------------------
  714|      0|    return "SSL_ERROR_SSL";
  715|      0|  case SSL_ERROR_WANT_READ:
  ------------------
  |  Branch (715:3): [True: 0, False: 3]
  ------------------
  716|      0|    return "SSL_ERROR_WANT_READ";
  717|      0|  case SSL_ERROR_WANT_WRITE:
  ------------------
  |  Branch (717:3): [True: 0, False: 3]
  ------------------
  718|      0|    return "SSL_ERROR_WANT_WRITE";
  719|      0|  case SSL_ERROR_WANT_X509_LOOKUP:
  ------------------
  |  Branch (719:3): [True: 0, False: 3]
  ------------------
  720|      0|    return "SSL_ERROR_WANT_X509_LOOKUP";
  721|      0|  case SSL_ERROR_SYSCALL:
  ------------------
  |  Branch (721:3): [True: 0, False: 3]
  ------------------
  722|      0|    return "SSL_ERROR_SYSCALL";
  723|      3|  case SSL_ERROR_ZERO_RETURN:
  ------------------
  |  Branch (723:3): [True: 3, False: 0]
  ------------------
  724|      3|    return "SSL_ERROR_ZERO_RETURN";
  725|      0|  case SSL_ERROR_WANT_CONNECT:
  ------------------
  |  Branch (725:3): [True: 0, False: 3]
  ------------------
  726|      0|    return "SSL_ERROR_WANT_CONNECT";
  727|      0|  case SSL_ERROR_WANT_ACCEPT:
  ------------------
  |  Branch (727:3): [True: 0, False: 3]
  ------------------
  728|      0|    return "SSL_ERROR_WANT_ACCEPT";
  729|      0|#ifdef SSL_ERROR_WANT_ASYNC  /* OpenSSL 1.1.0+, LibreSSL 3.6.0+ */
  730|      0|  case SSL_ERROR_WANT_ASYNC:
  ------------------
  |  Branch (730:3): [True: 0, False: 3]
  ------------------
  731|      0|    return "SSL_ERROR_WANT_ASYNC";
  732|      0|#endif
  733|      0|#ifdef SSL_ERROR_WANT_ASYNC_JOB  /* OpenSSL 1.1.0+, LibreSSL 3.6.0+ */
  734|      0|  case SSL_ERROR_WANT_ASYNC_JOB:
  ------------------
  |  Branch (734:3): [True: 0, False: 3]
  ------------------
  735|      0|    return "SSL_ERROR_WANT_ASYNC_JOB";
  736|      0|#endif
  737|      0|#ifdef SSL_ERROR_WANT_CLIENT_HELLO_CB  /* OpenSSL 1.1.1, LibreSSL 3.6.0+ */
  738|      0|  case SSL_ERROR_WANT_CLIENT_HELLO_CB:
  ------------------
  |  Branch (738:3): [True: 0, False: 3]
  ------------------
  739|      0|    return "SSL_ERROR_WANT_CLIENT_HELLO_CB";
  740|      0|#endif
  741|      0|  default:
  ------------------
  |  Branch (741:3): [True: 0, False: 3]
  ------------------
  742|      0|    return "SSL_ERROR unknown";
  743|      3|  }
  744|      3|}
openssl.c:ossl_random:
 5442|  14.1k|{
 5443|  14.1k|  int rc;
 5444|  14.1k|  if(data) {
  ------------------
  |  Branch (5444:6): [True: 14.1k, False: 0]
  ------------------
 5445|  14.1k|    if(ossl_seed(data)) /* Initiate the seed if not already done */
  ------------------
  |  Branch (5445:8): [True: 0, False: 14.1k]
  ------------------
 5446|      0|      return CURLE_FAILED_INIT; /* could not seed for some reason */
 5447|  14.1k|  }
 5448|      0|  else {
 5449|      0|    if(!rand_enough())
  ------------------
  |  Branch (5449:8): [True: 0, False: 0]
  ------------------
 5450|      0|      return CURLE_FAILED_INIT;
 5451|      0|  }
 5452|       |  /* RAND_bytes() returns 1 on success, 0 otherwise. */
 5453|  14.1k|  rc = RAND_bytes(entropy, (ossl_valsize_t)curlx_uztosi(length));
 5454|  14.1k|  return rc == 1 ? CURLE_OK : CURLE_FAILED_INIT;
  ------------------
  |  Branch (5454:10): [True: 14.1k, False: 0]
  ------------------
 5455|  14.1k|}
openssl.c:ossl_cert_status_request:
 5482|    666|{
 5483|    666|#ifndef OPENSSL_NO_OCSP
 5484|    666|  return TRUE;
  ------------------
  |  | 1055|    666|#define TRUE true
  ------------------
 5485|       |#else
 5486|       |  return FALSE;
 5487|       |#endif
 5488|    666|}
openssl.c:ossl_connect:
 4964|  2.86k|{
 4965|  2.86k|  CURLcode result = CURLE_OK;
 4966|  2.86k|  struct ssl_connect_data *connssl = cf->ctx;
 4967|       |
 4968|       |  /* check if the connection has already been established */
 4969|  2.86k|  if(ssl_connection_complete == connssl->state) {
  ------------------
  |  Branch (4969:6): [True: 0, False: 2.86k]
  ------------------
 4970|      0|    *done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 4971|      0|    return CURLE_OK;
 4972|      0|  }
 4973|       |
 4974|  2.86k|  *done = FALSE;
  ------------------
  |  | 1058|  2.86k|#define FALSE false
  ------------------
 4975|  2.86k|  connssl->io_need = CURL_SSL_IO_NEED_NONE;
  ------------------
  |  |  105|  2.86k|#define CURL_SSL_IO_NEED_NONE   0
  ------------------
 4976|       |
 4977|  2.86k|  if(ssl_connect_1 == connssl->connecting_state) {
  ------------------
  |  Branch (4977:6): [True: 2.56k, False: 305]
  ------------------
 4978|  2.56k|    if(Curl_ossl_need_httpsrr(data) &&
  ------------------
  |  Branch (4978:8): [True: 0, False: 2.56k]
  ------------------
 4979|      0|       !Curl_conn_dns_resolved_https(data, cf->sockindex)) {
  ------------------
  |  |   66|      0|#define Curl_conn_dns_resolved_https(a, b)   TRUE
  |  |  ------------------
  |  |  |  | 1055|      0|#define TRUE true
  |  |  ------------------
  ------------------
  |  Branch (4979:8): [Folded, False: 0]
  ------------------
 4980|      0|      CURL_TRC_CF(data, cf, "need HTTPS-RR, delaying connect");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4981|      0|      return CURLE_OK;
 4982|      0|    }
 4983|  2.56k|    CURL_TRC_CF(data, cf, "ossl_connect, step1");
  ------------------
  |  |  153|  2.56k|  do {                                          \
  |  |  154|  2.56k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  2.56k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  5.12k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 2.56k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 2.56k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  5.12k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  2.56k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  2.56k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  2.56k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.56k]
  |  |  ------------------
  ------------------
 4984|  2.56k|    result = ossl_connect_step1(cf, data);
 4985|  2.56k|    if(result)
  ------------------
  |  Branch (4985:8): [True: 792, False: 1.77k]
  ------------------
 4986|    792|      goto out;
 4987|  2.56k|  }
 4988|       |
 4989|  2.07k|  if(ssl_connect_2 == connssl->connecting_state) {
  ------------------
  |  Branch (4989:6): [True: 2.07k, False: 0]
  ------------------
 4990|  2.07k|    CURL_TRC_CF(data, cf, "ossl_connect, step2");
  ------------------
  |  |  153|  2.07k|  do {                                          \
  |  |  154|  2.07k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  2.07k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  4.15k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 2.07k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 2.07k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  4.15k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  2.07k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  2.07k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  2.07k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.07k]
  |  |  ------------------
  ------------------
 4991|  2.07k|#ifdef HAVE_OPENSSL_EARLYDATA
 4992|  2.07k|    if(connssl->earlydata_state == ssl_earlydata_await) {
  ------------------
  |  Branch (4992:8): [True: 0, False: 2.07k]
  ------------------
 4993|      0|      goto out;
 4994|      0|    }
 4995|  2.07k|    else if(connssl->earlydata_state == ssl_earlydata_sending) {
  ------------------
  |  Branch (4995:13): [True: 0, False: 2.07k]
  ------------------
 4996|      0|      result = ossl_send_earlydata(cf, data);
 4997|      0|      if(result)
  ------------------
  |  Branch (4997:10): [True: 0, False: 0]
  ------------------
 4998|      0|        goto out;
 4999|      0|      connssl->earlydata_state = ssl_earlydata_sent;
 5000|      0|    }
 5001|  2.07k|#endif
 5002|  2.07k|    DEBUGASSERT((connssl->earlydata_state == ssl_earlydata_none) ||
  ------------------
  |  | 1081|  2.07k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (5002:5): [True: 2.07k, False: 0]
  |  Branch (5002:5): [True: 0, False: 0]
  |  Branch (5002:5): [True: 2.07k, False: 0]
  |  Branch (5002:5): [True: 0, False: 0]
  ------------------
 5003|  2.07k|                (connssl->earlydata_state == ssl_earlydata_sent));
 5004|       |
 5005|  2.07k|    result = ossl_connect_step2(cf, data);
 5006|  2.07k|    if(result)
  ------------------
  |  Branch (5006:8): [True: 2.07k, False: 0]
  ------------------
 5007|  2.07k|      goto out;
 5008|  2.07k|  }
 5009|       |
 5010|      0|  if(ssl_connect_3 == connssl->connecting_state) {
  ------------------
  |  Branch (5010:6): [True: 0, False: 0]
  ------------------
 5011|      0|    CURL_TRC_CF(data, cf, "ossl_connect, step3");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 5012|      0|    result = ossl_connect_step3(cf, data);
 5013|      0|    if(result)
  ------------------
  |  Branch (5013:8): [True: 0, False: 0]
  ------------------
 5014|      0|      goto out;
 5015|      0|    connssl->connecting_state = ssl_connect_done;
 5016|      0|#ifdef HAVE_OPENSSL_EARLYDATA
 5017|      0|    if(connssl->earlydata_state > ssl_earlydata_none) {
  ------------------
  |  Branch (5017:8): [True: 0, False: 0]
  ------------------
 5018|      0|      struct ossl_ctx *octx = (struct ossl_ctx *)connssl->backend;
 5019|       |      /* We should be in this state by now */
 5020|      0|      DEBUGASSERT(connssl->earlydata_state == ssl_earlydata_sent);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (5020:7): [True: 0, False: 0]
  |  Branch (5020:7): [True: 0, False: 0]
  ------------------
 5021|      0|      connssl->earlydata_state =
 5022|      0|        (SSL_get_early_data_status(octx->ssl) == SSL_EARLY_DATA_ACCEPTED) ?
  ------------------
  |  Branch (5022:9): [True: 0, False: 0]
  ------------------
 5023|      0|        ssl_earlydata_accepted : ssl_earlydata_rejected;
 5024|      0|    }
 5025|      0|#endif
 5026|      0|  }
 5027|       |
 5028|      0|  if(ssl_connect_done == connssl->connecting_state) {
  ------------------
  |  Branch (5028:6): [True: 0, False: 0]
  ------------------
 5029|      0|    CURL_TRC_CF(data, cf, "ossl_connect, done");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 5030|      0|    connssl->state = ssl_connection_complete;
 5031|      0|  }
 5032|       |
 5033|  2.86k|out:
 5034|  2.86k|  if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (5034:6): [True: 310, False: 2.55k]
  ------------------
 5035|    310|    *done = FALSE;
  ------------------
  |  | 1058|    310|#define FALSE false
  ------------------
 5036|    310|    return CURLE_OK;
 5037|    310|  }
 5038|  2.55k|  *done = ((connssl->state == ssl_connection_complete) ||
  ------------------
  |  Branch (5038:12): [True: 0, False: 2.55k]
  ------------------
 5039|  2.55k|           (connssl->state == ssl_connection_deferred));
  ------------------
  |  Branch (5039:12): [True: 0, False: 2.55k]
  ------------------
 5040|  2.55k|  return result;
 5041|  2.86k|}
openssl.c:ossl_connect_step1:
 4010|  2.56k|{
 4011|  2.56k|  struct ssl_connect_data *connssl = cf->ctx;
 4012|  2.56k|  struct ossl_ctx *octx = (struct ossl_ctx *)connssl->backend;
 4013|  2.56k|  char tls_id[80];
 4014|  2.56k|  BIO *bio;
 4015|  2.56k|  CURLcode result;
 4016|       |
 4017|  2.56k|  DEBUGASSERT(ssl_connect_1 == connssl->connecting_state);
  ------------------
  |  | 1081|  2.56k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4017:3): [True: 0, False: 2.56k]
  |  Branch (4017:3): [True: 2.56k, False: 0]
  ------------------
 4018|  2.56k|  DEBUGASSERT(octx);
  ------------------
  |  | 1081|  2.56k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4018:3): [True: 0, False: 2.56k]
  |  Branch (4018:3): [True: 2.56k, False: 0]
  ------------------
 4019|       |
 4020|  2.56k|  if(!connssl->peer.dest) {
  ------------------
  |  Branch (4020:6): [True: 0, False: 2.56k]
  ------------------
 4021|      0|    Curl_ossl_version(tls_id, sizeof(tls_id));
 4022|      0|    result = Curl_ssl_peer_init(&connssl->peer, cf, tls_id, TRNSPRT_TCP);
  ------------------
  |  |  307|      0|#define TRNSPRT_TCP  3
  ------------------
 4023|      0|    if(result)
  ------------------
  |  Branch (4023:8): [True: 0, False: 0]
  ------------------
 4024|      0|      return result;
 4025|      0|  }
 4026|       |
 4027|  2.56k|  result = Curl_ossl_ctx_init(octx, cf, data, &connssl->peer,
 4028|  2.56k|                              connssl->alpn, NULL, NULL,
 4029|  2.56k|                              ossl_new_session_cb, cf,
 4030|  2.56k|                              ossl_on_session_reuse);
 4031|  2.56k|  if(result)
  ------------------
  |  Branch (4031:6): [True: 792, False: 1.77k]
  ------------------
 4032|    792|    return result;
 4033|       |
 4034|  1.77k|  octx->bio_method = ossl_bio_cf_method_create();
 4035|  1.77k|  if(!octx->bio_method)
  ------------------
  |  Branch (4035:6): [True: 0, False: 1.77k]
  ------------------
 4036|      0|    return CURLE_OUT_OF_MEMORY;
 4037|  1.77k|  bio = BIO_new(octx->bio_method);
 4038|  1.77k|  if(!bio)
  ------------------
  |  Branch (4038:6): [True: 0, False: 1.77k]
  ------------------
 4039|      0|    return CURLE_OUT_OF_MEMORY;
 4040|       |
 4041|  1.77k|  BIO_set_data(bio, cf);
 4042|  1.77k|#ifdef HAVE_SSL_SET0_WBIO
 4043|       |  /* with OpenSSL v1.1.1 we get an alternative to SSL_set_bio() that works
 4044|       |   * without backward compat quirks. Every call takes one reference, so we
 4045|       |   * up it and pass. SSL* then owns and frees it.
 4046|       |   * We check on the function in configure, since LibreSSL and friends
 4047|       |   * each have their own versions to add support for this. */
 4048|  1.77k|  BIO_up_ref(bio);
 4049|  1.77k|  SSL_set0_rbio(octx->ssl, bio);
 4050|  1.77k|  SSL_set0_wbio(octx->ssl, bio);
 4051|       |#else
 4052|       |  SSL_set_bio(octx->ssl, bio, bio);
 4053|       |#endif
 4054|       |
 4055|  1.77k|  if(connssl->alpn && (connssl->state != ssl_connection_deferred)) {
  ------------------
  |  Branch (4055:6): [True: 415, False: 1.35k]
  |  Branch (4055:23): [True: 415, False: 0]
  ------------------
 4056|    415|    struct alpn_proto_buf proto;
 4057|    415|    memset(&proto, 0, sizeof(proto));
 4058|    415|    Curl_alpn_to_proto_str(&proto, connssl->alpn);
 4059|    415|    infof(data, VTLS_INFOF_ALPN_OFFER_1STR, proto.data);
  ------------------
  |  |  143|    415|  do {                               \
  |  |  144|    415|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|    415|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 415, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 415]
  |  |  |  |  ------------------
  |  |  |  |  320|    415|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    415|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    415|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 415]
  |  |  ------------------
  ------------------
 4060|    415|  }
 4061|       |
 4062|  1.77k|  connssl->connecting_state = ssl_connect_2;
 4063|  1.77k|  return CURLE_OK;
 4064|  1.77k|}
openssl.c:ossl_bio_cf_method_create:
  642|  1.77k|{
  643|  1.77k|  BIO_METHOD *m = BIO_meth_new(BIO_TYPE_MEM, "OpenSSL CF BIO");
  644|  1.77k|  if(m) {
  ------------------
  |  Branch (644:6): [True: 1.77k, False: 0]
  ------------------
  645|  1.77k|    BIO_meth_set_write(m, &ossl_bio_cf_out_write);
  646|  1.77k|    BIO_meth_set_read(m, &ossl_bio_cf_in_read);
  647|  1.77k|    BIO_meth_set_ctrl(m, &ossl_bio_cf_ctrl);
  648|  1.77k|    BIO_meth_set_create(m, &ossl_bio_cf_create);
  649|  1.77k|    BIO_meth_set_destroy(m, &ossl_bio_cf_destroy);
  650|  1.77k|  }
  651|  1.77k|  return m;
  652|  1.77k|}
openssl.c:ossl_bio_cf_out_write:
  568|  3.25k|{
  569|  3.25k|  struct Curl_cfilter *cf = BIO_get_data(bio);
  570|  3.25k|  struct ssl_connect_data *connssl = cf->ctx;
  571|  3.25k|  struct ossl_ctx *octx = (struct ossl_ctx *)connssl->backend;
  572|  3.25k|  struct Curl_easy *data = CF_DATA_CURRENT(cf);
  ------------------
  |  |  699|  3.25k|#define CF_DATA_CURRENT(cf) ((cf) ? (CF_CTX_CALL_DATA(cf).data) : NULL)
  |  |  ------------------
  |  |  |  |  213|  3.25k|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  |  Branch (699:30): [True: 3.25k, False: 0]
  |  |  ------------------
  ------------------
  573|  3.25k|  size_t nwritten;
  574|  3.25k|  CURLcode result;
  575|       |
  576|  3.25k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  3.25k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (576:3): [True: 0, False: 3.25k]
  |  Branch (576:3): [True: 3.25k, False: 0]
  ------------------
  577|  3.25k|  if(blen < 0)
  ------------------
  |  Branch (577:6): [True: 0, False: 3.25k]
  ------------------
  578|      0|    return 0;
  579|       |
  580|  3.25k|  result = Curl_conn_cf_send(cf->next, data,
  581|  3.25k|                             (const uint8_t *)buf, (size_t)blen, FALSE,
  ------------------
  |  | 1058|  3.25k|#define FALSE false
  ------------------
  582|  3.25k|                             &nwritten);
  583|  3.25k|  CURL_TRC_CF(data, cf, "ossl_bio_cf_out_write(len=%d) -> %d, %zu",
  ------------------
  |  |  153|  3.25k|  do {                                          \
  |  |  154|  3.25k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  3.25k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  6.51k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 3.25k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 3.25k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  6.51k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  3.25k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.25k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.25k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.25k]
  |  |  ------------------
  ------------------
  584|  3.25k|              blen, result, nwritten);
  585|  3.25k|  BIO_clear_retry_flags(bio);
  586|  3.25k|  octx->io_result = result;
  587|  3.25k|  if(result) {
  ------------------
  |  Branch (587:6): [True: 0, False: 3.25k]
  ------------------
  588|      0|    if(result == CURLE_AGAIN)
  ------------------
  |  Branch (588:8): [True: 0, False: 0]
  ------------------
  589|      0|      BIO_set_retry_write(bio);
  590|      0|    return -1;
  591|      0|  }
  592|  3.25k|  return (int)nwritten;
  593|  3.25k|}
openssl.c:ossl_bio_cf_in_read:
  596|  2.38k|{
  597|  2.38k|  struct Curl_cfilter *cf = BIO_get_data(bio);
  598|  2.38k|  struct ssl_connect_data *connssl = cf->ctx;
  599|  2.38k|  struct ossl_ctx *octx = (struct ossl_ctx *)connssl->backend;
  600|  2.38k|  struct Curl_easy *data = CF_DATA_CURRENT(cf);
  ------------------
  |  |  699|  2.38k|#define CF_DATA_CURRENT(cf) ((cf) ? (CF_CTX_CALL_DATA(cf).data) : NULL)
  |  |  ------------------
  |  |  |  |  213|  2.38k|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  |  Branch (699:30): [True: 2.38k, False: 0]
  |  |  ------------------
  ------------------
  601|  2.38k|  size_t nread;
  602|  2.38k|  CURLcode result, r2;
  603|       |
  604|  2.38k|  DEBUGASSERT(data);
  ------------------
  |  | 1081|  2.38k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (604:3): [True: 0, False: 2.38k]
  |  Branch (604:3): [True: 2.38k, False: 0]
  ------------------
  605|       |  /* OpenSSL catches this case, so should we. */
  606|  2.38k|  if(!buf)
  ------------------
  |  Branch (606:6): [True: 0, False: 2.38k]
  ------------------
  607|      0|    return 0;
  608|  2.38k|  if(blen < 0)
  ------------------
  |  Branch (608:6): [True: 0, False: 2.38k]
  ------------------
  609|      0|    return 0;
  610|       |
  611|  2.38k|  result = Curl_conn_cf_recv(cf->next, data, buf, (size_t)blen, &nread);
  612|  2.38k|  CURL_TRC_CF(data, cf, "ossl_bio_cf_in_read(len=%d) -> %d, %zu",
  ------------------
  |  |  153|  2.38k|  do {                                          \
  |  |  154|  2.38k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  2.38k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  4.77k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 2.38k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 2.38k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  4.77k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  2.38k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  2.38k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  2.38k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.38k]
  |  |  ------------------
  ------------------
  613|  2.38k|              blen, result, nread);
  614|  2.38k|  BIO_clear_retry_flags(bio);
  615|  2.38k|  octx->io_result = result;
  616|  2.38k|  if(result) {
  ------------------
  |  Branch (616:6): [True: 316, False: 2.07k]
  ------------------
  617|    316|    if(result == CURLE_AGAIN)
  ------------------
  |  Branch (617:8): [True: 316, False: 0]
  ------------------
  618|    316|      BIO_set_retry_read(bio);
  619|    316|  }
  620|  2.07k|  else {
  621|       |    /* feeding data to OpenSSL means SSL_read() might succeed */
  622|  2.07k|    connssl->input_pending = TRUE;
  ------------------
  |  | 1055|  2.07k|#define TRUE true
  ------------------
  623|  2.07k|    if(nread == 0)
  ------------------
  |  Branch (623:8): [True: 1.26k, False: 808]
  ------------------
  624|  1.26k|      connssl->peer_closed = TRUE;
  ------------------
  |  | 1055|  1.26k|#define TRUE true
  ------------------
  625|  2.07k|  }
  626|       |
  627|       |  /* Before returning server replies to the SSL instance, we need
  628|       |   * to have setup the x509 store or verification fails. */
  629|  2.38k|  if(!octx->x509_store_setup) {
  ------------------
  |  Branch (629:6): [True: 1.64k, False: 745]
  ------------------
  630|  1.64k|    r2 = Curl_ssl_setup_x509_store(cf, data, octx);
  631|  1.64k|    if(r2) {
  ------------------
  |  Branch (631:8): [True: 1.22k, False: 415]
  ------------------
  632|  1.22k|      BIO_clear_retry_flags(bio);
  633|  1.22k|      octx->io_result = r2;
  634|  1.22k|      return -1;
  635|  1.22k|    }
  636|    415|    octx->x509_store_setup = TRUE;
  ------------------
  |  | 1055|    415|#define TRUE true
  ------------------
  637|    415|  }
  638|  1.16k|  return result ? -1 : (int)nread;
  ------------------
  |  Branch (638:10): [True: 310, False: 850]
  ------------------
  639|  2.38k|}
openssl.c:ossl_bio_cf_ctrl:
  534|  8.07k|{
  535|  8.07k|  struct Curl_cfilter *cf = BIO_get_data(bio);
  536|  8.07k|  long ret = 1;
  537|       |
  538|  8.07k|  (void)cf;
  539|  8.07k|  (void)ptr;
  540|  8.07k|  switch(cmd) {
  541|      0|  case BIO_CTRL_GET_CLOSE:
  ------------------
  |  Branch (541:3): [True: 0, False: 8.07k]
  ------------------
  542|      0|    ret = (long)BIO_get_shutdown(bio);
  543|      0|    break;
  544|      0|  case BIO_CTRL_SET_CLOSE:
  ------------------
  |  Branch (544:3): [True: 0, False: 8.07k]
  ------------------
  545|      0|    BIO_set_shutdown(bio, (int)num);
  546|      0|    break;
  547|  3.25k|  case BIO_CTRL_FLUSH:
  ------------------
  |  Branch (547:3): [True: 3.25k, False: 4.81k]
  ------------------
  548|       |    /* we do no delayed writes, but if we ever would, this
  549|       |     * needs to trigger it. */
  550|  3.25k|    ret = 1;
  551|  3.25k|    break;
  552|      0|  case BIO_CTRL_DUP:
  ------------------
  |  Branch (552:3): [True: 0, False: 8.07k]
  ------------------
  553|      0|    ret = 1;
  554|      0|    break;
  555|  1.27k|  case BIO_CTRL_EOF: {
  ------------------
  |  Branch (555:3): [True: 1.27k, False: 6.79k]
  ------------------
  556|       |    /* EOF has been reached on input? */
  557|  1.27k|    struct ssl_connect_data *connssl = cf->ctx;
  558|  1.27k|    return connssl->peer_closed;
  559|      0|  }
  560|  3.54k|  default:
  ------------------
  |  Branch (560:3): [True: 3.54k, False: 4.53k]
  ------------------
  561|  3.54k|    ret = 0;
  562|  3.54k|    break;
  563|  8.07k|  }
  564|  6.79k|  return ret;
  565|  8.07k|}
openssl.c:ossl_bio_cf_create:
  519|  1.77k|{
  520|  1.77k|  BIO_set_shutdown(bio, 1);
  521|  1.77k|  BIO_set_init(bio, 1);
  522|       |  BIO_set_data(bio, NULL);
  523|  1.77k|  return 1;
  524|  1.77k|}
openssl.c:ossl_bio_cf_destroy:
  527|  1.77k|{
  528|  1.77k|  if(!bio)
  ------------------
  |  Branch (528:6): [True: 0, False: 1.77k]
  ------------------
  529|      0|    return 0;
  530|  1.77k|  return 1;
  531|  1.77k|}
openssl.c:ossl_connect_step2:
 4133|  2.07k|{
 4134|  2.07k|  int err;
 4135|  2.07k|  struct ssl_connect_data *connssl = cf->ctx;
 4136|  2.07k|  struct ossl_ctx *octx = (struct ossl_ctx *)connssl->backend;
 4137|  2.07k|  struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data);
 4138|  2.07k|  DEBUGASSERT(ssl_connect_2 == connssl->connecting_state);
  ------------------
  |  | 1081|  2.07k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4138:3): [True: 0, False: 2.07k]
  |  Branch (4138:3): [True: 2.07k, False: 0]
  ------------------
 4139|  2.07k|  DEBUGASSERT(octx);
  ------------------
  |  | 1081|  2.07k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4139:3): [True: 0, False: 2.07k]
  |  Branch (4139:3): [True: 2.07k, False: 0]
  ------------------
 4140|       |
 4141|  2.07k|  connssl->io_need = CURL_SSL_IO_NEED_NONE;
  ------------------
  |  |  105|  2.07k|#define CURL_SSL_IO_NEED_NONE   0
  ------------------
 4142|  2.07k|  ERR_clear_error();
 4143|       |
 4144|  2.07k|  err = SSL_connect(octx->ssl);
 4145|       |
 4146|  2.07k|  if(!octx->x509_store_setup) {
  ------------------
  |  Branch (4146:6): [True: 1.35k, False: 720]
  ------------------
 4147|       |    /* After having send off the ClientHello, we prepare the x509
 4148|       |     * store to verify the coming certificate from the server */
 4149|  1.35k|    CURLcode result = Curl_ssl_setup_x509_store(cf, data, octx);
 4150|  1.35k|    if(result)
  ------------------
  |  Branch (4150:8): [True: 1.35k, False: 2]
  ------------------
 4151|  1.35k|      return result;
 4152|      2|    octx->x509_store_setup = TRUE;
  ------------------
  |  | 1055|      2|#define TRUE true
  ------------------
 4153|      2|  }
 4154|       |
 4155|       |#if !defined(HAVE_KEYLOG_UPSTREAM) && !defined(HAVE_KEYLOG_CALLBACK)
 4156|       |  /* If key logging is enabled, wait for the handshake to complete and then
 4157|       |   * proceed with logging secrets (for TLS 1.2 or older).
 4158|       |   */
 4159|       |  if(Curl_tls_keylog_enabled() && !octx->keylog_done)
 4160|       |    ossl_log_tls12_secret(octx->ssl, &octx->keylog_done);
 4161|       |#endif
 4162|       |
 4163|       |  /* 1  is fine
 4164|       |     0  is "not successful but was shut down controlled"
 4165|       |     <0 is "handshake was not successful, because a fatal error occurred" */
 4166|    722|  if(err != 1) {
  ------------------
  |  Branch (4166:6): [True: 722, False: 0]
  ------------------
 4167|    722|    int detail = SSL_get_error(octx->ssl, err);
 4168|    722|    CURL_TRC_CF(data, cf, "SSL_connect() -> err=%d, detail=%d", err, detail);
  ------------------
  |  |  153|    722|  do {                                          \
  |  |  154|    722|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    722|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  1.44k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 722, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 722]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  1.44k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    722|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    722|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    722|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 722]
  |  |  ------------------
  ------------------
 4169|       |
 4170|    722|    if(SSL_ERROR_WANT_READ == detail) {
  ------------------
  |  Branch (4170:8): [True: 310, False: 412]
  ------------------
 4171|    310|      CURL_TRC_CF(data, cf, "SSL_connect() -> want recv");
  ------------------
  |  |  153|    310|  do {                                          \
  |  |  154|    310|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    310|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    620|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 310, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 310]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    620|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    310|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    310|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    310|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 310]
  |  |  ------------------
  ------------------
 4172|    310|      connssl->io_need = CURL_SSL_IO_NEED_RECV;
  ------------------
  |  |  106|    310|#define CURL_SSL_IO_NEED_RECV   (1 << 0)
  ------------------
 4173|    310|      return CURLE_AGAIN;
 4174|    310|    }
 4175|    412|    if(SSL_ERROR_WANT_WRITE == detail) {
  ------------------
  |  Branch (4175:8): [True: 0, False: 412]
  ------------------
 4176|      0|      CURL_TRC_CF(data, cf, "SSL_connect() -> want send");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4177|      0|      connssl->io_need = CURL_SSL_IO_NEED_SEND;
  ------------------
  |  |  107|      0|#define CURL_SSL_IO_NEED_SEND   (1 << 1)
  ------------------
 4178|      0|      return CURLE_AGAIN;
 4179|      0|    }
 4180|    412|#ifdef SSL_ERROR_WANT_ASYNC
 4181|    412|    if(SSL_ERROR_WANT_ASYNC == detail) {
  ------------------
  |  Branch (4181:8): [True: 0, False: 412]
  ------------------
 4182|      0|      CURL_TRC_CF(data, cf, "SSL_connect() -> want async");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4183|      0|      connssl->io_need = CURL_SSL_IO_NEED_RECV;
  ------------------
  |  |  106|      0|#define CURL_SSL_IO_NEED_RECV   (1 << 0)
  ------------------
 4184|      0|      return CURLE_AGAIN;
 4185|      0|    }
 4186|    412|#endif
 4187|    412|#ifdef SSL_ERROR_WANT_RETRY_VERIFY
 4188|    412|    if(SSL_ERROR_WANT_RETRY_VERIFY == detail) {
  ------------------
  |  Branch (4188:8): [True: 0, False: 412]
  ------------------
 4189|      0|      CURL_TRC_CF(data, cf, "SSL_connect() -> want retry_verify");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4190|      0|      Curl_xfer_pause_recv(data, TRUE);
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 4191|      0|      return CURLE_AGAIN;
 4192|      0|    }
 4193|    412|#endif
 4194|    412|    else {
 4195|       |      /* untreated error */
 4196|    412|      sslerr_t errdetail;
 4197|    412|      char error_buffer[256] = "";
 4198|    412|      CURLcode result;
 4199|    412|      long lerr;
 4200|    412|      int lib;
 4201|    412|      int reason;
 4202|       |
 4203|       |      /* the connection failed, we are not waiting for anything else. */
 4204|    412|      connssl->connecting_state = ssl_connect_2;
 4205|       |
 4206|       |      /* Get the earliest error code from the thread's error queue and remove
 4207|       |         the entry. */
 4208|    412|      errdetail = ERR_get_error();
 4209|       |
 4210|       |      /* Extract which lib and reason */
 4211|    412|      lib = ERR_GET_LIB(errdetail);
 4212|    412|      reason = ERR_GET_REASON(errdetail);
 4213|       |
 4214|    412|      if((lib == ERR_LIB_SSL) &&
  ------------------
  |  Branch (4214:10): [True: 409, False: 3]
  ------------------
 4215|    409|         ((reason == SSL_R_CERTIFICATE_VERIFY_FAILED)
  ------------------
  |  Branch (4215:11): [True: 0, False: 409]
  ------------------
 4216|       |/* Missing from OpenSSL 4+ OPENSSL_NO_DEPRECATED_3_0 builds */
 4217|    409|#ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED
 4218|    409|          || (reason == SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED)
  ------------------
  |  Branch (4218:14): [True: 1, False: 408]
  ------------------
 4219|    409|#endif
 4220|    409|         )) {
 4221|      1|        result = CURLE_PEER_FAILED_VERIFICATION;
 4222|       |
 4223|      1|        lerr = SSL_get_verify_result(octx->ssl);
 4224|      1|        if(lerr != X509_V_OK) {
  ------------------
  |  Branch (4224:12): [True: 0, False: 1]
  ------------------
 4225|      0|          ssl_config->certverifyresult = lerr;
 4226|      0|          failf(data, "SSL certificate problem: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4227|      0|                X509_verify_cert_error_string(lerr));
 4228|      0|        }
 4229|      1|        else
 4230|      1|          failf(data, "%s", "SSL certificate verification failed");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
 4231|      1|      }
 4232|    411|#ifdef SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED
 4233|       |      /* SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED is only available on
 4234|       |         OpenSSL version above v1.1.1, not AWS-LC, BoringSSL, or LibreSSL */
 4235|    411|      else if((lib == ERR_LIB_SSL) &&
  ------------------
  |  Branch (4235:15): [True: 408, False: 3]
  ------------------
 4236|    408|              (reason == SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED)) {
  ------------------
  |  Branch (4236:15): [True: 1, False: 407]
  ------------------
 4237|       |        /* If client certificate is required, communicate the
 4238|       |           error to client */
 4239|      1|        result = CURLE_SSL_CLIENTCERT;
 4240|      1|        failf(data, "TLS cert problem: %s",
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
 4241|      1|              ossl_strerror(errdetail, error_buffer, sizeof(error_buffer)));
 4242|      1|      }
 4243|    410|#endif
 4244|       |#ifdef HAVE_SSL_SET1_ECH_CONFIG_LIST
 4245|       |      else if((lib == ERR_LIB_SSL) &&
 4246|       |#ifndef HAVE_BORINGSSL_LIKE
 4247|       |              (reason == SSL_R_ECH_REQUIRED)) {
 4248|       |#else
 4249|       |              (reason == SSL_R_ECH_REJECTED)) {
 4250|       |#endif /* HAVE_BORINGSSL_LIKE */
 4251|       |
 4252|       |        /* trace retry_configs if we got some */
 4253|       |        ossl_trace_ech_retry_configs(data, octx->ssl, reason);
 4254|       |
 4255|       |        result = CURLE_ECH_REQUIRED;
 4256|       |        failf(data, "ECH required: %s",
 4257|       |              ossl_strerror(errdetail, error_buffer, sizeof(error_buffer)));
 4258|       |      }
 4259|       |#endif
 4260|    410|      else {
 4261|    410|        result = CURLE_SSL_CONNECT_ERROR;
 4262|    410|        failf(data, "TLS connect error: %s",
  ------------------
  |  |   62|    410|#define failf Curl_failf
  ------------------
 4263|    410|              ossl_strerror(errdetail, error_buffer, sizeof(error_buffer)));
 4264|    410|      }
 4265|       |
 4266|       |      /* detail is already set to the SSL error above */
 4267|       |
 4268|       |      /* If we e.g. use SSLv2 request-method and the server does not like us
 4269|       |       * (RST connection, etc.), OpenSSL gives no explanation whatsoever and
 4270|       |       * the SO_ERROR is also lost.
 4271|       |       */
 4272|    412|      if(result == CURLE_SSL_CONNECT_ERROR && errdetail == 0) {
  ------------------
  |  Branch (4272:10): [True: 410, False: 2]
  |  Branch (4272:47): [True: 3, False: 407]
  ------------------
 4273|      3|        char extramsg[80] = "";
 4274|      3|        int sockerr = SOCKERRNO;
  ------------------
  |  | 1095|      3|#define SOCKERRNO         errno
  ------------------
 4275|       |
 4276|      3|        if(sockerr && detail == SSL_ERROR_SYSCALL)
  ------------------
  |  Branch (4276:12): [True: 0, False: 3]
  |  Branch (4276:23): [True: 0, False: 0]
  ------------------
 4277|      0|          curlx_strerror(sockerr, extramsg, sizeof(extramsg));
 4278|      3|        failf(data, OSSL_PACKAGE " SSL_connect: %s in connection to %s:%d ",
  ------------------
  |  |   62|      3|#define failf Curl_failf
  ------------------
                      failf(data, OSSL_PACKAGE " SSL_connect: %s in connection to %s:%d ",
  ------------------
  |  |  163|      3|#define OSSL_PACKAGE "OpenSSL"
  ------------------
 4279|      3|              extramsg[0] ? extramsg : SSL_ERROR_to_str(detail),
  ------------------
  |  Branch (4279:15): [True: 0, False: 3]
  ------------------
 4280|      3|              connssl->peer.dest->hostname, connssl->peer.dest->port);
 4281|      3|      }
 4282|       |
 4283|    412|      return result;
 4284|    412|    }
 4285|    412|  }
 4286|      0|  else {
 4287|       |    /* we connected fine, we are not waiting for anything else. */
 4288|      0|    connssl->connecting_state = ssl_connect_3;
 4289|      0|    Curl_ossl_report_handshake(data, octx);
 4290|       |
 4291|       |#if defined(HAVE_SSL_SET1_ECH_CONFIG_LIST) && !defined(HAVE_BORINGSSL_LIKE)
 4292|       |    if(CURLECH_ENABLED(data)) {
 4293|       |      char *inner = NULL, *outer = NULL;
 4294|       |      int rv;
 4295|       |      VERBOSE(const char *status);
 4296|       |
 4297|       |      rv = SSL_ech_get1_status(octx->ssl, &inner, &outer);
 4298|       |      switch(rv) {
 4299|       |      case SSL_ECH_STATUS_SUCCESS:
 4300|       |        VERBOSE(status = "succeeded");
 4301|       |        break;
 4302|       |      case SSL_ECH_STATUS_GREASE_ECH:
 4303|       |        VERBOSE(status = "sent GREASE, got retry-configs");
 4304|       |        break;
 4305|       |      case SSL_ECH_STATUS_GREASE:
 4306|       |        VERBOSE(status = "sent GREASE");
 4307|       |        break;
 4308|       |      case SSL_ECH_STATUS_NOT_TRIED:
 4309|       |        VERBOSE(status = "not attempted");
 4310|       |        break;
 4311|       |      case SSL_ECH_STATUS_NOT_CONFIGURED:
 4312|       |        VERBOSE(status = "not configured");
 4313|       |        break;
 4314|       |      case SSL_ECH_STATUS_BACKEND:
 4315|       |        VERBOSE(status = "backend (unexpected)");
 4316|       |        break;
 4317|       |      case SSL_ECH_STATUS_FAILED:
 4318|       |        VERBOSE(status = "failed");
 4319|       |        break;
 4320|       |      case SSL_ECH_STATUS_BAD_CALL:
 4321|       |        VERBOSE(status = "bad call (unexpected)");
 4322|       |        break;
 4323|       |      case SSL_ECH_STATUS_BAD_NAME: {
 4324|       |        struct ssl_primary_config *conn_config =
 4325|       |          Curl_ssl_cf_get_primary_config(cf);
 4326|       |        if(!conn_config->verifypeer && !conn_config->verifyhost &&
 4327|       |           inner && !strcmp(inner, connssl->peer.dest->hostname)) {
 4328|       |          VERBOSE(status = "bad name (tolerated without peer verification)");
 4329|       |          rv = SSL_ECH_STATUS_SUCCESS;
 4330|       |        }
 4331|       |        else {
 4332|       |          VERBOSE(status = "bad name (unexpected)");
 4333|       |        }
 4334|       |        break;
 4335|       |      }
 4336|       |      default:
 4337|       |        VERBOSE(status = "unexpected status");
 4338|       |        infof(data, "ECH: unexpected status %d", rv);
 4339|       |      }
 4340|       |      infof(data, "ECH: result: status is %s, inner is %s, outer is %s",
 4341|       |            (status ? status : "NULL"),
 4342|       |            (inner ? inner : "NULL"),
 4343|       |            (outer ? outer : "NULL"));
 4344|       |      OPENSSL_free(inner);
 4345|       |      OPENSSL_free(outer);
 4346|       |      if(rv == SSL_ECH_STATUS_GREASE_ECH) {
 4347|       |        /* trace retry_configs if we got some */
 4348|       |        ossl_trace_ech_retry_configs(data, octx->ssl, 0);
 4349|       |      }
 4350|       |      if(rv != SSL_ECH_STATUS_SUCCESS && (data->set.tls_ech == CURLECH_HARD)) {
 4351|       |        infof(data, "ECH: ech-hard failed");
 4352|       |        return CURLE_SSL_CONNECT_ERROR;
 4353|       |      }
 4354|       |    }
 4355|       |    else {
 4356|       |      infof(data, "ECH: result: status is not attempted");
 4357|       |    }
 4358|       |#endif /* HAVE_SSL_SET1_ECH_CONFIG_LIST && !HAVE_BORINGSSL_LIKE */
 4359|       |
 4360|       |    /* Sets data and len to negotiated protocol, len is 0 if no protocol was
 4361|       |     * negotiated
 4362|       |     */
 4363|      0|    if(connssl->alpn) {
  ------------------
  |  Branch (4363:8): [True: 0, False: 0]
  ------------------
 4364|      0|      const unsigned char *neg_protocol;
 4365|      0|      unsigned int len;
 4366|      0|      SSL_get0_alpn_selected(octx->ssl, &neg_protocol, &len);
 4367|       |
 4368|      0|      return Curl_alpn_set_negotiated(cf, data, connssl, neg_protocol, len);
 4369|      0|    }
 4370|       |
 4371|      0|    return CURLE_OK;
 4372|      0|  }
 4373|    722|}
openssl.c:ossl_close:
 1961|  5.15k|{
 1962|  5.15k|  struct ssl_connect_data *connssl = cf->ctx;
 1963|  5.15k|  struct ossl_ctx *octx = (struct ossl_ctx *)connssl->backend;
 1964|       |
 1965|  5.15k|  (void)data;
 1966|  5.15k|  DEBUGASSERT(octx);
  ------------------
  |  | 1081|  5.15k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1966:3): [True: 0, False: 5.15k]
  |  Branch (1966:3): [True: 5.15k, False: 0]
  ------------------
 1967|       |
 1968|  5.15k|  connssl->input_pending = FALSE;
  ------------------
  |  | 1058|  5.15k|#define FALSE false
  ------------------
 1969|  5.15k|  if(octx->ssl) {
  ------------------
  |  Branch (1969:6): [True: 1.77k, False: 3.38k]
  ------------------
 1970|  1.77k|    SSL_free(octx->ssl);
 1971|  1.77k|    octx->ssl = NULL;
 1972|  1.77k|  }
 1973|  5.15k|  if(octx->ssl_ctx) {
  ------------------
  |  Branch (1973:6): [True: 2.47k, False: 2.67k]
  ------------------
 1974|  2.47k|    SSL_CTX_free(octx->ssl_ctx);
 1975|  2.47k|    octx->ssl_ctx = NULL;
 1976|  2.47k|    octx->x509_store_setup = FALSE;
  ------------------
  |  | 1058|  2.47k|#define FALSE false
  ------------------
 1977|  2.47k|  }
 1978|  5.15k|  if(octx->bio_method) {
  ------------------
  |  Branch (1978:6): [True: 1.77k, False: 3.38k]
  ------------------
 1979|  1.77k|    ossl_bio_cf_method_free(octx->bio_method);
 1980|       |    octx->bio_method = NULL;
 1981|  1.77k|  }
 1982|  5.15k|}
openssl.c:ossl_bio_cf_method_free:
  655|  1.77k|{
  656|  1.77k|  if(m)
  ------------------
  |  Branch (656:6): [True: 1.77k, False: 0]
  ------------------
  657|  1.77k|    BIO_meth_free(m);
  658|  1.77k|}
openssl.c:ossl_close_all:
 1989|  36.6k|{
 1990|  36.6k|#ifdef USE_OPENSSL_ENGINE
 1991|  36.6k|  if(data->state.engine) {
  ------------------
  |  Branch (1991:6): [True: 3, False: 36.6k]
  ------------------
 1992|      3|    ENGINE_finish(data->state.engine);
 1993|      3|    ENGINE_free(data->state.engine);
 1994|      3|    data->state.engine = NULL;
 1995|      3|  }
 1996|       |#else
 1997|       |  (void)data;
 1998|       |#endif
 1999|  36.6k|#ifdef OPENSSL_HAS_PROVIDERS
 2000|  36.6k|  ossl_provider_cleanup(data);
 2001|  36.6k|#endif
 2002|  36.6k|}
openssl.c:ossl_set_engine:
 1658|    824|{
 1659|    824|#ifdef USE_OPENSSL_ENGINE
 1660|    824|  CURLcode result = CURLE_SSL_ENGINE_NOTFOUND;
 1661|    824|  ENGINE *e = ENGINE_by_id(name);
 1662|       |
 1663|    824|  if(e) {
  ------------------
  |  Branch (1663:6): [True: 7, False: 817]
  ------------------
 1664|       |
 1665|      7|    if(data->state.engine) {
  ------------------
  |  Branch (1665:8): [True: 0, False: 7]
  ------------------
 1666|      0|      ENGINE_finish(data->state.engine);
 1667|      0|      ENGINE_free(data->state.engine);
 1668|      0|      data->state.engine = NULL;
 1669|      0|    }
 1670|      7|    if(!ENGINE_init(e)) {
  ------------------
  |  Branch (1670:8): [True: 4, False: 3]
  ------------------
 1671|      4|      char buf[256];
 1672|       |
 1673|      4|      ENGINE_free(e);
 1674|      4|      failf(data, "Failed to initialize SSL Engine '%s': %s",
  ------------------
  |  |   62|      4|#define failf Curl_failf
  ------------------
 1675|      4|            name, ossl_strerror(ERR_get_error(), buf, sizeof(buf)));
 1676|      4|      result = CURLE_SSL_ENGINE_INITFAILED;
 1677|      4|      e = NULL;
 1678|      4|    }
 1679|      3|    else {
 1680|      3|      result = CURLE_OK;
 1681|      3|    }
 1682|      7|    data->state.engine = e;
 1683|      7|    return result;
 1684|      7|  }
 1685|    817|#endif
 1686|    817|#ifdef OPENSSL_HAS_PROVIDERS
 1687|    817|  return ossl_set_provider(data, name);
 1688|       |#else
 1689|       |  (void)name;
 1690|       |  failf(data, "OpenSSL engine not found");
 1691|       |  return CURLE_SSL_ENGINE_NOTFOUND;
 1692|       |#endif
 1693|    824|}
openssl.c:ossl_set_engine_default:
 1698|      4|{
 1699|      4|#ifdef USE_OPENSSL_ENGINE
 1700|      4|  if(data->state.engine) {
  ------------------
  |  Branch (1700:6): [True: 2, False: 2]
  ------------------
 1701|      2|    if(ENGINE_set_default(data->state.engine, ENGINE_METHOD_ALL) > 0) {
  ------------------
  |  Branch (1701:8): [True: 2, False: 0]
  ------------------
 1702|      2|      infof(data, "set default crypto engine '%s'",
  ------------------
  |  |  143|      2|  do {                               \
  |  |  144|      2|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      2|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 2, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  320|      2|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      2|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      2|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 2]
  |  |  ------------------
  ------------------
 1703|      2|            ENGINE_get_id(data->state.engine));
 1704|      2|    }
 1705|      0|    else {
 1706|      0|      failf(data, "set default crypto engine '%s' failed",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1707|      0|            ENGINE_get_id(data->state.engine));
 1708|      0|      return CURLE_SSL_ENGINE_SETFAILED;
 1709|      0|    }
 1710|      2|  }
 1711|       |#else
 1712|       |  (void)data;
 1713|       |#endif
 1714|      4|  return CURLE_OK;
 1715|      4|}

Curl_ssl_easy_config_init:
  181|  36.6k|{
  182|       |  /*
  183|       |   * libcurl 7.10 introduced SSL verification *by default*! This needs to be
  184|       |   * switched off unless wanted.
  185|       |   */
  186|  36.6k|  data->set.ssl.primary.verifypeer = TRUE;
  ------------------
  |  | 1055|  36.6k|#define TRUE true
  ------------------
  187|  36.6k|  data->set.ssl.primary.verifyhost = TRUE;
  ------------------
  |  | 1055|  36.6k|#define TRUE true
  ------------------
  188|       |  data->set.ssl.primary.cache_session = TRUE; /* caching by default */
  ------------------
  |  | 1055|  36.6k|#define TRUE true
  ------------------
  189|  36.6k|#ifndef CURL_DISABLE_PROXY
  190|  36.6k|  data->set.proxy_ssl = data->set.ssl;
  191|  36.6k|#endif
  192|  36.6k|}
Curl_ssl_conn_config_match:
  235|      2|{
  236|      2|#ifndef CURL_DISABLE_PROXY
  237|      2|  if(proxy)
  ------------------
  |  Branch (237:6): [True: 0, False: 2]
  ------------------
  238|      0|    return match_ssl_primary_config(data, &data->set.proxy_ssl.primary,
  239|      0|                                    &candidate->proxy_ssl_config);
  240|       |#else
  241|       |  (void)proxy;
  242|       |#endif
  243|      2|  return match_ssl_primary_config(data, &data->set.ssl.primary,
  244|      2|                                  &candidate->ssl_config);
  245|      2|}
Curl_ssl_easy_config_complete:
  311|  14.0k|{
  312|  14.0k|  struct ssl_config_data *sslc = &data->set.ssl;
  313|  14.0k|#if defined(CURL_CA_PATH) || defined(CURL_CA_BUNDLE)
  314|  14.0k|  struct UserDefined *set = &data->set;
  315|  14.0k|  CURLcode result;
  316|  14.0k|#endif
  317|       |
  318|  14.0k|  if(Curl_ssl_backend() != CURLSSLBACKEND_SCHANNEL) {
  ------------------
  |  Branch (318:6): [True: 14.0k, False: 0]
  ------------------
  319|       |#if defined(USE_APPLE_SECTRUST) || defined(CURL_CA_NATIVE)
  320|       |    if(!sslc->custom_capath && !sslc->custom_cafile && !sslc->custom_cablob)
  321|       |      sslc->native_ca_store = TRUE;
  322|       |#endif
  323|  14.0k|#ifdef CURL_CA_PATH
  324|  14.0k|    if(!sslc->custom_capath && !set->str[STRING_SSL_CAPATH]) {
  ------------------
  |  Branch (324:8): [True: 13.3k, False: 694]
  |  Branch (324:32): [True: 12.4k, False: 984]
  ------------------
  325|  12.4k|      result = Curl_setstropt(&set->str[STRING_SSL_CAPATH], CURL_CA_PATH);
  ------------------
  |  |   32|  12.4k|#define CURL_CA_PATH "/etc/ssl/certs"
  ------------------
  326|  12.4k|      if(result)
  ------------------
  |  Branch (326:10): [True: 0, False: 12.4k]
  ------------------
  327|      0|        return result;
  328|  12.4k|    }
  329|  14.0k|#endif
  330|  14.0k|#ifdef CURL_CA_BUNDLE
  331|  14.0k|    if(!sslc->custom_cafile && !set->str[STRING_SSL_CAFILE]) {
  ------------------
  |  Branch (331:8): [True: 13.3k, False: 692]
  |  Branch (331:32): [True: 12.4k, False: 974]
  ------------------
  332|  12.4k|      result = Curl_setstropt(&set->str[STRING_SSL_CAFILE], CURL_CA_BUNDLE);
  ------------------
  |  |   26|  12.4k|#define CURL_CA_BUNDLE "/etc/ssl/certs/ca-certificates.crt"
  ------------------
  333|  12.4k|      if(result)
  ------------------
  |  Branch (333:10): [True: 0, False: 12.4k]
  ------------------
  334|      0|        return result;
  335|  12.4k|    }
  336|  14.0k|#endif
  337|  14.0k|  }
  338|  14.0k|  sslc->primary.CAfile = data->set.str[STRING_SSL_CAFILE];
  339|  14.0k|  sslc->primary.CRLfile = data->set.str[STRING_SSL_CRLFILE];
  340|  14.0k|  sslc->primary.CApath = data->set.str[STRING_SSL_CAPATH];
  341|  14.0k|  sslc->primary.issuercert = data->set.str[STRING_SSL_ISSUERCERT];
  342|  14.0k|  sslc->primary.issuercert_blob = data->set.blobs[BLOB_SSL_ISSUERCERT];
  343|  14.0k|  sslc->primary.cipher_list = data->set.str[STRING_SSL_CIPHER_LIST];
  344|  14.0k|  sslc->primary.cipher_list13 = data->set.str[STRING_SSL_CIPHER13_LIST];
  345|  14.0k|  sslc->primary.signature_algorithms =
  346|  14.0k|    data->set.str[STRING_SSL_SIGNATURE_ALGORITHMS];
  347|  14.0k|  sslc->primary.pinned_key = data->set.str[STRING_SSL_PINNEDPUBLICKEY];
  348|  14.0k|  sslc->primary.cert_blob = data->set.blobs[BLOB_CERT];
  349|  14.0k|  sslc->primary.ca_info_blob = data->set.blobs[BLOB_CAINFO];
  350|  14.0k|  sslc->primary.curves = data->set.str[STRING_SSL_EC_CURVES];
  351|  14.0k|#ifdef USE_TLS_SRP
  352|  14.0k|  sslc->primary.username = data->set.str[STRING_TLSAUTH_USERNAME];
  353|  14.0k|  sslc->primary.password = data->set.str[STRING_TLSAUTH_PASSWORD];
  354|  14.0k|#endif
  355|  14.0k|  sslc->primary.cert_type = data->set.str[STRING_CERT_TYPE];
  356|  14.0k|  sslc->primary.key = data->set.str[STRING_KEY];
  357|  14.0k|  sslc->primary.key_type = data->set.str[STRING_KEY_TYPE];
  358|  14.0k|  sslc->primary.key_passwd = data->set.str[STRING_KEY_PASSWD];
  359|  14.0k|  sslc->primary.clientcert = data->set.str[STRING_CERT];
  360|  14.0k|  sslc->primary.key_blob = data->set.blobs[BLOB_KEY];
  361|       |
  362|  14.0k|#ifndef CURL_DISABLE_PROXY
  363|  14.0k|  sslc = &data->set.proxy_ssl;
  364|  14.0k|  if(Curl_ssl_backend() != CURLSSLBACKEND_SCHANNEL) {
  ------------------
  |  Branch (364:6): [True: 14.0k, False: 0]
  ------------------
  365|       |#if defined(USE_APPLE_SECTRUST) || defined(CURL_CA_NATIVE)
  366|       |    if(!sslc->custom_capath && !sslc->custom_cafile && !sslc->custom_cablob)
  367|       |      sslc->native_ca_store = TRUE;
  368|       |#endif
  369|  14.0k|#ifdef CURL_CA_PATH
  370|  14.0k|    if(!sslc->custom_capath && !set->str[STRING_SSL_CAPATH_PROXY]) {
  ------------------
  |  Branch (370:8): [True: 14.0k, False: 21]
  |  Branch (370:32): [True: 12.9k, False: 1.08k]
  ------------------
  371|  12.9k|      result = Curl_setstropt(&set->str[STRING_SSL_CAPATH_PROXY],
  372|  12.9k|                              CURL_CA_PATH);
  ------------------
  |  |   32|  12.9k|#define CURL_CA_PATH "/etc/ssl/certs"
  ------------------
  373|  12.9k|      if(result)
  ------------------
  |  Branch (373:10): [True: 0, False: 12.9k]
  ------------------
  374|      0|        return result;
  375|  12.9k|    }
  376|  14.0k|#endif
  377|  14.0k|#ifdef CURL_CA_BUNDLE
  378|  14.0k|    if(!sslc->custom_cafile && !set->str[STRING_SSL_CAFILE_PROXY]) {
  ------------------
  |  Branch (378:8): [True: 14.0k, False: 37]
  |  Branch (378:32): [True: 12.9k, False: 1.06k]
  ------------------
  379|  12.9k|      result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_PROXY],
  380|  12.9k|                              CURL_CA_BUNDLE);
  ------------------
  |  |   26|  12.9k|#define CURL_CA_BUNDLE "/etc/ssl/certs/ca-certificates.crt"
  ------------------
  381|  12.9k|      if(result)
  ------------------
  |  Branch (381:10): [True: 0, False: 12.9k]
  ------------------
  382|      0|        return result;
  383|  12.9k|    }
  384|  14.0k|#endif
  385|  14.0k|  }
  386|  14.0k|  sslc->primary.CAfile = data->set.str[STRING_SSL_CAFILE_PROXY];
  387|  14.0k|  sslc->primary.CApath = data->set.str[STRING_SSL_CAPATH_PROXY];
  388|  14.0k|  sslc->primary.cipher_list = data->set.str[STRING_SSL_CIPHER_LIST_PROXY];
  389|  14.0k|  sslc->primary.cipher_list13 = data->set.str[STRING_SSL_CIPHER13_LIST_PROXY];
  390|  14.0k|  sslc->primary.pinned_key = data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY];
  391|  14.0k|  sslc->primary.cert_blob = data->set.blobs[BLOB_CERT_PROXY];
  392|  14.0k|  sslc->primary.ca_info_blob = data->set.blobs[BLOB_CAINFO_PROXY];
  393|  14.0k|  sslc->primary.issuercert = data->set.str[STRING_SSL_ISSUERCERT_PROXY];
  394|  14.0k|  sslc->primary.issuercert_blob = data->set.blobs[BLOB_SSL_ISSUERCERT_PROXY];
  395|  14.0k|  sslc->primary.CRLfile = data->set.str[STRING_SSL_CRLFILE_PROXY];
  396|  14.0k|  sslc->primary.cert_type = data->set.str[STRING_CERT_TYPE_PROXY];
  397|  14.0k|  sslc->primary.key = data->set.str[STRING_KEY_PROXY];
  398|  14.0k|  sslc->primary.key_type = data->set.str[STRING_KEY_TYPE_PROXY];
  399|  14.0k|  sslc->primary.key_passwd = data->set.str[STRING_KEY_PASSWD_PROXY];
  400|  14.0k|  sslc->primary.clientcert = data->set.str[STRING_CERT_PROXY];
  401|  14.0k|  sslc->primary.key_blob = data->set.blobs[BLOB_KEY_PROXY];
  402|  14.0k|#ifdef USE_TLS_SRP
  403|  14.0k|  sslc->primary.username = data->set.str[STRING_TLSAUTH_USERNAME_PROXY];
  404|  14.0k|  sslc->primary.password = data->set.str[STRING_TLSAUTH_PASSWORD_PROXY];
  405|  14.0k|#endif
  406|  14.0k|#endif /* CURL_DISABLE_PROXY */
  407|       |
  408|  14.0k|  return CURLE_OK;
  409|  14.0k|}
Curl_ssl_conn_config_init:
  413|  13.7k|{
  414|       |  /* Clone "primary" SSL configurations from the easy handle to
  415|       |   * the connection. They are used for connection cache matching and
  416|       |   * probably outlive the easy handle */
  417|  13.7k|  if(!clone_ssl_primary_config(&data->set.ssl.primary, &conn->ssl_config))
  ------------------
  |  Branch (417:6): [True: 0, False: 13.7k]
  ------------------
  418|      0|    return CURLE_OUT_OF_MEMORY;
  419|  13.7k|#ifndef CURL_DISABLE_PROXY
  420|  13.7k|  if(!clone_ssl_primary_config(&data->set.proxy_ssl.primary,
  ------------------
  |  Branch (420:6): [True: 0, False: 13.7k]
  ------------------
  421|  13.7k|                               &conn->proxy_ssl_config))
  422|      0|    return CURLE_OUT_OF_MEMORY;
  423|  13.7k|#endif
  424|  13.7k|  return CURLE_OK;
  425|  13.7k|}
Curl_ssl_conn_config_cleanup:
  428|  15.5k|{
  429|  15.5k|  free_primary_ssl_config(&conn->ssl_config);
  430|  15.5k|#ifndef CURL_DISABLE_PROXY
  431|  15.5k|  free_primary_ssl_config(&conn->proxy_ssl_config);
  432|  15.5k|#endif
  433|  15.5k|}
Curl_ssl_conn_config_update:
  436|  2.02k|{
  437|       |  /* May be called on an easy that has no connection yet */
  438|  2.02k|  if(data->conn) {
  ------------------
  |  Branch (438:6): [True: 0, False: 2.02k]
  ------------------
  439|      0|    struct ssl_primary_config *src, *dest;
  440|      0|#ifndef CURL_DISABLE_PROXY
  441|      0|    src = for_proxy ? &data->set.proxy_ssl.primary : &data->set.ssl.primary;
  ------------------
  |  Branch (441:11): [True: 0, False: 0]
  ------------------
  442|      0|    dest = for_proxy ? &data->conn->proxy_ssl_config : &data->conn->ssl_config;
  ------------------
  |  Branch (442:12): [True: 0, False: 0]
  ------------------
  443|       |#else
  444|       |    (void)for_proxy;
  445|       |    src = &data->set.ssl.primary;
  446|       |    dest = &data->conn->ssl_config;
  447|       |#endif
  448|      0|    dest->verifyhost = src->verifyhost;
  449|      0|    dest->verifypeer = src->verifypeer;
  450|      0|    dest->verifystatus = src->verifystatus;
  451|      0|  }
  452|  2.02k|}
Curl_ssl_backend:
  459|  28.1k|{
  460|  28.1k|#ifdef USE_SSL
  461|  28.1k|  multissl_setup(NULL);
  462|  28.1k|  return Curl_ssl->info.id;
  463|       |#else
  464|       |  return CURLSSLBACKEND_NONE;
  465|       |#endif
  466|  28.1k|}
Curl_ssl_init:
  480|      1|{
  481|       |  /* make sure this is only done once */
  482|      1|  if(init_ssl)
  ------------------
  |  Branch (482:6): [True: 0, False: 1]
  ------------------
  483|      0|    return 1;
  484|      1|  init_ssl = TRUE; /* never again */
  ------------------
  |  | 1055|      1|#define TRUE true
  ------------------
  485|       |
  486|      1|  if(Curl_ssl->init)
  ------------------
  |  Branch (486:6): [True: 1, False: 0]
  ------------------
  487|      1|    return Curl_ssl->init();
  488|      0|  return 1;
  489|      1|}
Curl_ssl_close_all:
  555|  36.6k|{
  556|  36.6k|  if(Curl_ssl->close_all)
  ------------------
  |  Branch (556:6): [True: 36.6k, False: 0]
  ------------------
  557|  36.6k|    Curl_ssl->close_all(data);
  558|  36.6k|}
Curl_ssl_adjust_pollset:
  563|    310|{
  564|    310|  struct ssl_connect_data *connssl = cf->ctx;
  565|       |
  566|    310|  if(connssl->io_need) {
  ------------------
  |  Branch (566:6): [True: 310, False: 0]
  ------------------
  567|    310|    curl_socket_t sock = Curl_conn_cf_get_socket(cf->next, data);
  568|    310|    CURLcode result = CURLE_OK;
  569|    310|    if(sock != CURL_SOCKET_BAD) {
  ------------------
  |  |  145|    310|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (569:8): [True: 310, False: 0]
  ------------------
  570|    310|      if(connssl->io_need & CURL_SSL_IO_NEED_SEND) {
  ------------------
  |  |  107|    310|#define CURL_SSL_IO_NEED_SEND   (1 << 1)
  ------------------
  |  Branch (570:10): [True: 0, False: 310]
  ------------------
  571|      0|        result = Curl_pollset_set_out_only(data, ps, sock);
  ------------------
  |  |  174|      0|  Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  284|      0|#define CURL_POLL_OUT    2
  |  |  ------------------
  |  |                 Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  283|      0|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
  572|      0|        CURL_TRC_CF(data, cf, "adjust_pollset, POLLOUT fd=%" FMT_SOCKET_T,
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  573|      0|                    sock);
  574|      0|      }
  575|    310|      else {
  576|    310|        result = Curl_pollset_set_in_only(data, ps, sock);
  ------------------
  |  |  172|    310|  Curl_pollset_change(data, ps, sock, CURL_POLL_IN, CURL_POLL_OUT)
  |  |  ------------------
  |  |  |  |  283|    310|#define CURL_POLL_IN     1
  |  |  ------------------
  |  |                 Curl_pollset_change(data, ps, sock, CURL_POLL_IN, CURL_POLL_OUT)
  |  |  ------------------
  |  |  |  |  284|    310|#define CURL_POLL_OUT    2
  |  |  ------------------
  ------------------
  577|    310|        CURL_TRC_CF(data, cf, "adjust_pollset, POLLIN fd=%" FMT_SOCKET_T,
  ------------------
  |  |  153|    310|  do {                                          \
  |  |  154|    310|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|    310|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|    620|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 310, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 310]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|    620|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|    310|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    310|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    310|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 310]
  |  |  ------------------
  ------------------
  578|    310|                    sock);
  579|    310|      }
  580|    310|    }
  581|    310|    return result;
  582|    310|  }
  583|      0|  return CURLE_OK;
  584|    310|}
Curl_ssl_set_engine:
  589|    824|{
  590|    824|  if(Curl_ssl->set_engine)
  ------------------
  |  Branch (590:6): [True: 824, False: 0]
  ------------------
  591|    824|    return Curl_ssl->set_engine(data, engine);
  592|      0|  return CURLE_NOT_BUILT_IN;
  593|    824|}
Curl_ssl_set_engine_default:
  598|      4|{
  599|      4|  if(Curl_ssl->set_engine_default)
  ------------------
  |  Branch (599:6): [True: 4, False: 0]
  ------------------
  600|      4|    return Curl_ssl->set_engine_default(data);
  601|      0|  return CURLE_NOT_BUILT_IN;
  602|      4|}
Curl_ssl_free_certinfo:
  624|  87.9k|{
  625|  87.9k|  struct curl_certinfo *ci = &data->info.certs;
  626|       |
  627|  87.9k|  if(ci->num_of_certs) {
  ------------------
  |  Branch (627:6): [True: 0, False: 87.9k]
  ------------------
  628|       |    /* free all individual lists used */
  629|      0|    int i;
  630|      0|    for(i = 0; i < ci->num_of_certs; i++) {
  ------------------
  |  Branch (630:16): [True: 0, False: 0]
  ------------------
  631|      0|      curl_slist_free_all(ci->certinfo[i]);
  632|      0|      ci->certinfo[i] = NULL;
  633|      0|    }
  634|       |
  635|       |    curlx_safefree(ci->certinfo); /* free the actual array too */
  ------------------
  |  | 1327|      0|  do {                      \
  |  | 1328|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|      0|    (ptr) = NULL;           \
  |  | 1330|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  636|      0|    ci->num_of_certs = 0;
  637|      0|  }
  638|  87.9k|}
Curl_ssl_random:
  696|  14.1k|{
  697|  14.1k|  DEBUGASSERT(length == sizeof(int));
  ------------------
  |  | 1081|  14.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (697:3): [True: 0, False: 14.1k]
  |  Branch (697:3): [True: 14.1k, False: 0]
  ------------------
  698|  14.1k|  if(Curl_ssl->random)
  ------------------
  |  Branch (698:6): [True: 14.1k, False: 0]
  ------------------
  699|  14.1k|    return Curl_ssl->random(data, buffer, length);
  700|      0|  else
  701|      0|    return CURLE_NOT_BUILT_IN;
  702|  14.1k|}
Curl_ssl_cert_status_request:
  914|    666|{
  915|    666|  if(Curl_ssl->cert_status_request)
  ------------------
  |  Branch (915:6): [True: 666, False: 0]
  ------------------
  916|    666|    return Curl_ssl->cert_status_request();
  917|      0|  return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  918|    666|}
Curl_ssl_peer_cleanup:
 1196|  5.16k|{
 1197|  5.16k|  Curl_peer_unlink(&peer->dest);
 1198|  5.16k|  curlx_safefree(peer->sni);
  ------------------
  |  | 1327|  5.16k|  do {                      \
  |  | 1328|  5.16k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  5.16k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  5.16k|    (ptr) = NULL;           \
  |  | 1330|  5.16k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 5.16k]
  |  |  ------------------
  ------------------
 1199|  5.16k|  curlx_safefree(peer->scache_key);
  ------------------
  |  | 1327|  5.16k|  do {                      \
  |  | 1328|  5.16k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  5.16k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  5.16k|    (ptr) = NULL;           \
  |  | 1330|  5.16k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 5.16k]
  |  |  ------------------
  ------------------
 1200|  5.16k|  peer->transport = TRNSPRT_NONE;
  ------------------
  |  |  306|  5.16k|#define TRNSPRT_NONE 0
  ------------------
 1201|  5.16k|  peer->type = CURL_SSL_PEER_DNS;
 1202|  5.16k|}
Curl_ssl_peer_init:
 1240|  2.57k|{
 1241|  2.57k|  struct Curl_peer *dest = NULL;
 1242|  2.57k|  CURLcode result = CURLE_OUT_OF_MEMORY;
 1243|       |
 1244|       |  /* We expect a clean struct, e.g. called only ONCE */
 1245|  2.57k|  DEBUGASSERT(peer);
  ------------------
  |  | 1081|  2.57k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1245:3): [True: 0, False: 2.57k]
  |  Branch (1245:3): [True: 2.57k, False: 0]
  ------------------
 1246|  2.57k|  DEBUGASSERT(!peer->dest);
  ------------------
  |  | 1081|  2.57k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1246:3): [True: 0, False: 2.57k]
  |  Branch (1246:3): [True: 2.57k, False: 0]
  ------------------
 1247|  2.57k|  DEBUGASSERT(!peer->sni);
  ------------------
  |  | 1081|  2.57k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1247:3): [True: 0, False: 2.57k]
  |  Branch (1247:3): [True: 2.57k, False: 0]
  ------------------
 1248|       |  /* We need the hostname for SNI negotiation. Once handshaked, this remains
 1249|       |   * the SNI hostname for the TLS connection. When the connection is reused,
 1250|       |   * the settings in cf->conn might change. We keep a copy of the hostname we
 1251|       |   * use for SNI.
 1252|       |   */
 1253|  2.57k|  peer->transport = transport;
 1254|  2.57k|#ifndef CURL_DISABLE_PROXY
 1255|  2.57k|  if(Curl_ssl_cf_is_proxy(cf)) {
  ------------------
  |  Branch (1255:6): [True: 417, False: 2.15k]
  ------------------
 1256|    417|    dest = cf->conn->http_proxy.peer;
 1257|    417|  }
 1258|  2.15k|  else
 1259|  2.15k|#endif
 1260|  2.15k|  {
 1261|  2.15k|    dest = cf->conn->origin;
 1262|  2.15k|  }
 1263|       |
 1264|       |  /* hostname MUST exist and not be empty */
 1265|  2.57k|  if(!dest) {
  ------------------
  |  Branch (1265:6): [True: 0, False: 2.57k]
  ------------------
 1266|      0|    result = CURLE_FAILED_INIT;
 1267|      0|    goto out;
 1268|      0|  }
 1269|       |
 1270|  2.57k|  Curl_peer_link(&peer->dest, dest);
 1271|  2.57k|  peer->type = get_peer_type(dest->hostname);
 1272|  2.57k|  if(peer->type == CURL_SSL_PEER_DNS) {
  ------------------
  |  Branch (1272:6): [True: 1.10k, False: 1.46k]
  ------------------
 1273|       |    /* not an IP address, normalize according to RCC 6066 ch. 3,
 1274|       |     * max len of SNI is 2^16-1, no trailing dot */
 1275|  1.10k|    size_t len = strlen(dest->hostname);
 1276|  1.10k|    if(len && (dest->hostname[len - 1] == '.'))
  ------------------
  |  Branch (1276:8): [True: 1.10k, False: 0]
  |  Branch (1276:15): [True: 1, False: 1.10k]
  ------------------
 1277|      1|      len--;
 1278|  1.10k|    if(len < USHRT_MAX) {
  ------------------
  |  Branch (1278:8): [True: 1.10k, False: 0]
  ------------------
 1279|  1.10k|      peer->sni = curlx_calloc(1, len + 1);
  ------------------
  |  | 1480|  1.10k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1280|  1.10k|      if(!peer->sni)
  ------------------
  |  Branch (1280:10): [True: 0, False: 1.10k]
  ------------------
 1281|      0|        goto out;
 1282|  1.10k|      Curl_strntolower(peer->sni, dest->hostname, len);
 1283|  1.10k|      peer->sni[len] = 0;
 1284|  1.10k|    }
 1285|  1.10k|  }
 1286|       |
 1287|  2.57k|  result = Curl_ssl_peer_key_make(cf, peer, tls_id, &peer->scache_key);
 1288|       |
 1289|  2.57k|out:
 1290|  2.57k|  if(result)
  ------------------
  |  Branch (1290:6): [True: 12, False: 2.56k]
  ------------------
 1291|     12|    Curl_ssl_peer_cleanup(peer);
 1292|  2.57k|  return result;
 1293|  2.57k|}
Curl_ssl_cfilter_add:
 1751|      2|{
 1752|      2|  struct Curl_cfilter *cf;
 1753|      2|  CURLcode result;
 1754|       |
 1755|      2|  result = cf_ssl_create(&cf, data, conn);
 1756|      2|  if(!result)
  ------------------
  |  Branch (1756:6): [True: 2, False: 0]
  ------------------
 1757|      2|    Curl_conn_cf_add(data, conn, sockindex, cf);
 1758|      2|  return result;
 1759|      2|}
Curl_cf_ssl_insert_after:
 1763|  2.15k|{
 1764|  2.15k|  struct Curl_cfilter *cf;
 1765|  2.15k|  CURLcode result;
 1766|       |
 1767|  2.15k|  result = cf_ssl_create(&cf, data, cf_at->conn);
 1768|  2.15k|  if(!result)
  ------------------
  |  Branch (1768:6): [True: 2.15k, False: 0]
  ------------------
 1769|  2.15k|    Curl_conn_cf_insert_after(cf_at, cf);
 1770|  2.15k|  return result;
 1771|  2.15k|}
Curl_cf_ssl_proxy_insert_after:
 1810|    417|{
 1811|    417|  struct Curl_cfilter *cf;
 1812|    417|  CURLcode result;
 1813|       |
 1814|    417|  result = cf_ssl_proxy_create(&cf, data, cf_at->conn);
 1815|    417|  if(!result)
  ------------------
  |  Branch (1815:6): [True: 417, False: 0]
  ------------------
 1816|    417|    Curl_conn_cf_insert_after(cf_at, cf);
 1817|    417|  return result;
 1818|    417|}
Curl_ssl_supports:
 1823|  21.0k|{
 1824|  21.0k|  (void)data;
 1825|  21.0k|  return (Curl_ssl->supports & ssl_option);
 1826|  21.0k|}
Curl_ssl_cf_is_proxy:
 1907|  44.1k|{
 1908|  44.1k|  return (cf->cft->flags & CF_TYPE_SSL) && (cf->cft->flags & CF_TYPE_PROXY);
  ------------------
  |  |  207|  44.1k|#define CF_TYPE_SSL         (1 << 1)
  ------------------
                return (cf->cft->flags & CF_TYPE_SSL) && (cf->cft->flags & CF_TYPE_PROXY);
  ------------------
  |  |  209|  44.1k|#define CF_TYPE_PROXY       (1 << 3)
  ------------------
  |  Branch (1908:10): [True: 44.1k, False: 0]
  |  Branch (1908:44): [True: 7.76k, False: 36.4k]
  ------------------
 1909|  44.1k|}
Curl_ssl_cf_get_config:
 1913|  17.1k|{
 1914|       |#ifdef CURL_DISABLE_PROXY
 1915|       |  (void)cf;
 1916|       |  return &data->set.ssl;
 1917|       |#else
 1918|  17.1k|  return Curl_ssl_cf_is_proxy(cf) ? &data->set.proxy_ssl : &data->set.ssl;
  ------------------
  |  Branch (1918:10): [True: 3.20k, False: 13.9k]
  ------------------
 1919|  17.1k|#endif
 1920|  17.1k|}
Curl_ssl_cf_get_primary_config:
 1924|  24.4k|{
 1925|       |#ifdef CURL_DISABLE_PROXY
 1926|       |  return &cf->conn->ssl_config;
 1927|       |#else
 1928|  24.4k|  return Curl_ssl_cf_is_proxy(cf) ?
  ------------------
  |  Branch (1928:10): [True: 4.14k, False: 20.3k]
  ------------------
 1929|  20.3k|    &cf->conn->proxy_ssl_config : &cf->conn->ssl_config;
 1930|  24.4k|#endif
 1931|  24.4k|}
Curl_alpn_to_proto_buf:
 1935|    415|{
 1936|    415|  size_t i, len;
 1937|    415|  int off = 0;
 1938|    415|  unsigned char blen;
 1939|       |
 1940|    415|  memset(buf, 0, sizeof(*buf));
 1941|  1.21k|  for(i = 0; spec && i < spec->count; ++i) {
  ------------------
  |  Branch (1941:14): [True: 1.21k, False: 0]
  |  Branch (1941:22): [True: 796, False: 415]
  ------------------
 1942|    796|    len = strlen(spec->entries[i]);
 1943|    796|    if(len >= ALPN_NAME_MAX)
  ------------------
  |  |   52|    796|#define ALPN_NAME_MAX      10
  ------------------
  |  Branch (1943:8): [True: 0, False: 796]
  ------------------
 1944|      0|      return CURLE_FAILED_INIT;
 1945|    796|    blen = (unsigned char)len;
 1946|    796|    if(off + blen + 1 >= (int)sizeof(buf->data))
  ------------------
  |  Branch (1946:8): [True: 0, False: 796]
  ------------------
 1947|      0|      return CURLE_FAILED_INIT;
 1948|    796|    buf->data[off++] = blen;
 1949|    796|    memcpy(buf->data + off, spec->entries[i], blen);
 1950|    796|    off += blen;
 1951|    796|  }
 1952|    415|  buf->len = off;
 1953|    415|  return CURLE_OK;
 1954|    415|}
Curl_alpn_to_proto_str:
 1958|    415|{
 1959|    415|  size_t i, len;
 1960|    415|  size_t off = 0;
 1961|       |
 1962|    415|  memset(buf, 0, sizeof(*buf));
 1963|  1.21k|  for(i = 0; spec && i < spec->count; ++i) {
  ------------------
  |  Branch (1963:14): [True: 1.21k, False: 0]
  |  Branch (1963:22): [True: 796, False: 415]
  ------------------
 1964|    796|    len = strlen(spec->entries[i]);
 1965|    796|    if(len >= ALPN_NAME_MAX)
  ------------------
  |  |   52|    796|#define ALPN_NAME_MAX      10
  ------------------
  |  Branch (1965:8): [True: 0, False: 796]
  ------------------
 1966|      0|      return CURLE_FAILED_INIT;
 1967|    796|    if(off + len + 2 >= sizeof(buf->data))
  ------------------
  |  Branch (1967:8): [True: 0, False: 796]
  ------------------
 1968|      0|      return CURLE_FAILED_INIT;
 1969|    796|    if(off)
  ------------------
  |  Branch (1969:8): [True: 381, False: 415]
  ------------------
 1970|    381|      buf->data[off++] = ',';
 1971|    796|    memcpy(buf->data + off, spec->entries[i], len);
 1972|    796|    off += len;
 1973|    796|  }
 1974|    415|  buf->data[off] = '\0';
 1975|    415|  buf->len = (int)off;
 1976|    415|  return CURLE_OK;
 1977|    415|}
Curl_alpn_copy:
 2002|  1.77k|{
 2003|  1.77k|  if(src)
  ------------------
  |  Branch (2003:6): [True: 415, False: 1.35k]
  ------------------
 2004|    415|    memcpy(dest, src, sizeof(*dest));
 2005|  1.35k|  else
 2006|  1.35k|    memset(dest, 0, sizeof(*dest));
 2007|  1.77k|}
vtls.c:match_ssl_primary_config:
  197|      2|{
  198|      2|  (void)data;
  199|      2|  if((c1->version == c2->version) &&
  ------------------
  |  Branch (199:6): [True: 2, False: 0]
  ------------------
  200|      2|     (c1->version_max == c2->version_max) &&
  ------------------
  |  Branch (200:6): [True: 2, False: 0]
  ------------------
  201|      2|     (c1->ssl_options == c2->ssl_options) &&
  ------------------
  |  Branch (201:6): [True: 2, False: 0]
  ------------------
  202|      2|     (c1->verifypeer == c2->verifypeer) &&
  ------------------
  |  Branch (202:6): [True: 2, False: 0]
  ------------------
  203|      2|     (c1->verifyhost == c2->verifyhost) &&
  ------------------
  |  Branch (203:6): [True: 2, False: 0]
  ------------------
  204|      2|     (c1->verifystatus == c2->verifystatus) &&
  ------------------
  |  Branch (204:6): [True: 2, False: 0]
  ------------------
  205|      2|     blobcmp(c1->cert_blob, c2->cert_blob) &&
  ------------------
  |  Branch (205:6): [True: 2, False: 0]
  ------------------
  206|      2|     blobcmp(c1->ca_info_blob, c2->ca_info_blob) &&
  ------------------
  |  Branch (206:6): [True: 2, False: 0]
  ------------------
  207|      2|     blobcmp(c1->issuercert_blob, c2->issuercert_blob) &&
  ------------------
  |  Branch (207:6): [True: 2, False: 0]
  ------------------
  208|      2|     blobcmp(c1->key_blob, c2->key_blob) &&
  ------------------
  |  Branch (208:6): [True: 2, False: 0]
  ------------------
  209|      2|     Curl_safecmp(c1->CApath, c2->CApath) &&
  ------------------
  |  Branch (209:6): [True: 2, False: 0]
  ------------------
  210|      2|     Curl_safecmp(c1->CAfile, c2->CAfile) &&
  ------------------
  |  Branch (210:6): [True: 2, False: 0]
  ------------------
  211|      2|     Curl_safecmp(c1->issuercert, c2->issuercert) &&
  ------------------
  |  Branch (211:6): [True: 2, False: 0]
  ------------------
  212|      2|     Curl_safecmp(c1->clientcert, c2->clientcert) &&
  ------------------
  |  Branch (212:6): [True: 2, False: 0]
  ------------------
  213|      2|#ifdef USE_TLS_SRP
  214|      2|     !Curl_timestrcmp(c1->username, c2->username) &&
  ------------------
  |  Branch (214:6): [True: 2, False: 0]
  ------------------
  215|      2|     !Curl_timestrcmp(c1->password, c2->password) &&
  ------------------
  |  Branch (215:6): [True: 2, False: 0]
  ------------------
  216|      2|#endif
  217|      2|     curl_strequal(c1->cipher_list, c2->cipher_list) &&
  ------------------
  |  Branch (217:6): [True: 2, False: 0]
  ------------------
  218|      2|     curl_strequal(c1->cipher_list13, c2->cipher_list13) &&
  ------------------
  |  Branch (218:6): [True: 2, False: 0]
  ------------------
  219|      2|     curl_strequal(c1->curves, c2->curves) &&
  ------------------
  |  Branch (219:6): [True: 2, False: 0]
  ------------------
  220|      2|     curl_strequal(c1->signature_algorithms, c2->signature_algorithms) &&
  ------------------
  |  Branch (220:6): [True: 2, False: 0]
  ------------------
  221|      2|     Curl_safecmp(c1->CRLfile, c2->CRLfile) &&
  ------------------
  |  Branch (221:6): [True: 2, False: 0]
  ------------------
  222|      2|     Curl_safecmp(c1->pinned_key, c2->pinned_key) &&
  ------------------
  |  Branch (222:6): [True: 2, False: 0]
  ------------------
  223|      2|     curl_strequal(c1->cert_type, c2->cert_type) &&
  ------------------
  |  Branch (223:6): [True: 2, False: 0]
  ------------------
  224|      2|     Curl_safecmp(c1->key, c2->key) &&
  ------------------
  |  Branch (224:6): [True: 2, False: 0]
  ------------------
  225|      2|     curl_strequal(c1->key_type, c2->key_type) &&
  ------------------
  |  Branch (225:6): [True: 2, False: 0]
  ------------------
  226|      2|     !Curl_timestrcmp(c1->key_passwd, c2->key_passwd))
  ------------------
  |  Branch (226:6): [True: 2, False: 0]
  ------------------
  227|      2|    return TRUE;
  ------------------
  |  | 1055|      2|#define TRUE true
  ------------------
  228|       |
  229|      0|  return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  230|      2|}
vtls.c:blobcmp:
  122|      8|{
  123|      8|  if(!first && !second) /* both are NULL */
  ------------------
  |  Branch (123:6): [True: 8, False: 0]
  |  Branch (123:16): [True: 8, False: 0]
  ------------------
  124|      8|    return TRUE;
  ------------------
  |  | 1055|      8|#define TRUE true
  ------------------
  125|      0|  if(!first || !second) /* one is NULL */
  ------------------
  |  Branch (125:6): [True: 0, False: 0]
  |  Branch (125:16): [True: 0, False: 0]
  ------------------
  126|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  127|      0|  if(first->len != second->len) /* different sizes */
  ------------------
  |  Branch (127:6): [True: 0, False: 0]
  ------------------
  128|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  129|      0|  return !memcmp(first->data, second->data, first->len); /* same data */
  130|      0|}
vtls.c:clone_ssl_primary_config:
  249|  27.5k|{
  250|  27.5k|  dest->version = source->version;
  251|  27.5k|  dest->version_max = source->version_max;
  252|  27.5k|  dest->verifypeer = source->verifypeer;
  253|  27.5k|  dest->verifyhost = source->verifyhost;
  254|  27.5k|  dest->verifystatus = source->verifystatus;
  255|  27.5k|  dest->cache_session = source->cache_session;
  256|  27.5k|  dest->ssl_options = source->ssl_options;
  257|       |
  258|  27.5k|  CLONE_BLOB(cert_blob);
  ------------------
  |  |   94|  27.5k|  do {                                   \
  |  |   95|  27.5k|    if(blobdup(&dest->var, source->var)) \
  |  |  ------------------
  |  |  |  Branch (95:8): [True: 0, False: 27.5k]
  |  |  ------------------
  |  |   96|  27.5k|      return FALSE;                      \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   97|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (97:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  259|  27.5k|  CLONE_BLOB(ca_info_blob);
  ------------------
  |  |   94|  27.5k|  do {                                   \
  |  |   95|  27.5k|    if(blobdup(&dest->var, source->var)) \
  |  |  ------------------
  |  |  |  Branch (95:8): [True: 0, False: 27.5k]
  |  |  ------------------
  |  |   96|  27.5k|      return FALSE;                      \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   97|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (97:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  260|  27.5k|  CLONE_BLOB(issuercert_blob);
  ------------------
  |  |   94|  27.5k|  do {                                   \
  |  |   95|  27.5k|    if(blobdup(&dest->var, source->var)) \
  |  |  ------------------
  |  |  |  Branch (95:8): [True: 0, False: 27.5k]
  |  |  ------------------
  |  |   96|  27.5k|      return FALSE;                      \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   97|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (97:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  261|  27.5k|  CLONE_BLOB(key_blob);
  ------------------
  |  |   94|  27.5k|  do {                                   \
  |  |   95|  27.5k|    if(blobdup(&dest->var, source->var)) \
  |  |  ------------------
  |  |  |  Branch (95:8): [True: 0, False: 27.5k]
  |  |  ------------------
  |  |   96|  27.5k|      return FALSE;                      \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   97|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (97:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  262|  27.5k|  CLONE_STRING(CApath);
  ------------------
  |  |   83|  27.5k|  do {                                       \
  |  |   84|  27.5k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (84:8): [True: 27.5k, False: 0]
  |  |  ------------------
  |  |   85|  27.5k|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1477|  27.5k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   86|  27.5k|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 27.5k]
  |  |  ------------------
  |  |   87|  27.5k|        return FALSE;                        \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   88|  27.5k|    }                                        \
  |  |   89|  27.5k|    else                                     \
  |  |   90|  27.5k|      dest->var = NULL;                      \
  |  |   91|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (91:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  263|  27.5k|  CLONE_STRING(CAfile);
  ------------------
  |  |   83|  27.5k|  do {                                       \
  |  |   84|  27.5k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (84:8): [True: 27.5k, False: 0]
  |  |  ------------------
  |  |   85|  27.5k|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1477|  27.5k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   86|  27.5k|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 27.5k]
  |  |  ------------------
  |  |   87|  27.5k|        return FALSE;                        \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   88|  27.5k|    }                                        \
  |  |   89|  27.5k|    else                                     \
  |  |   90|  27.5k|      dest->var = NULL;                      \
  |  |   91|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (91:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  264|  27.5k|  CLONE_STRING(issuercert);
  ------------------
  |  |   83|  27.5k|  do {                                       \
  |  |   84|  27.5k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (84:8): [True: 23, False: 27.5k]
  |  |  ------------------
  |  |   85|     23|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1477|     23|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   86|     23|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 23]
  |  |  ------------------
  |  |   87|     23|        return FALSE;                        \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   88|     23|    }                                        \
  |  |   89|  27.5k|    else                                     \
  |  |   90|  27.5k|      dest->var = NULL;                      \
  |  |   91|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (91:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  265|  27.5k|  CLONE_STRING(clientcert);
  ------------------
  |  |   83|  27.5k|  do {                                       \
  |  |   84|  27.5k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (84:8): [True: 39, False: 27.5k]
  |  |  ------------------
  |  |   85|     39|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1477|     39|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   86|     39|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 39]
  |  |  ------------------
  |  |   87|     39|        return FALSE;                        \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   88|     39|    }                                        \
  |  |   89|  27.5k|    else                                     \
  |  |   90|  27.5k|      dest->var = NULL;                      \
  |  |   91|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (91:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  266|  27.5k|  CLONE_STRING(cipher_list);
  ------------------
  |  |   83|  27.5k|  do {                                       \
  |  |   84|  27.5k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (84:8): [True: 902, False: 26.6k]
  |  |  ------------------
  |  |   85|    902|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1477|    902|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   86|    902|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 902]
  |  |  ------------------
  |  |   87|    902|        return FALSE;                        \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   88|    902|    }                                        \
  |  |   89|  27.5k|    else                                     \
  |  |   90|  27.5k|      dest->var = NULL;                      \
  |  |   91|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (91:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  267|  27.5k|  CLONE_STRING(cipher_list13);
  ------------------
  |  |   83|  27.5k|  do {                                       \
  |  |   84|  27.5k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (84:8): [True: 184, False: 27.3k]
  |  |  ------------------
  |  |   85|    184|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1477|    184|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   86|    184|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 184]
  |  |  ------------------
  |  |   87|    184|        return FALSE;                        \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   88|    184|    }                                        \
  |  |   89|  27.5k|    else                                     \
  |  |   90|  27.5k|      dest->var = NULL;                      \
  |  |   91|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (91:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  268|  27.5k|  CLONE_STRING(pinned_key);
  ------------------
  |  |   83|  27.5k|  do {                                       \
  |  |   84|  27.5k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (84:8): [True: 119, False: 27.4k]
  |  |  ------------------
  |  |   85|    119|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1477|    119|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   86|    119|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 119]
  |  |  ------------------
  |  |   87|    119|        return FALSE;                        \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   88|    119|    }                                        \
  |  |   89|  27.5k|    else                                     \
  |  |   90|  27.5k|      dest->var = NULL;                      \
  |  |   91|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (91:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  269|  27.5k|  CLONE_STRING(curves);
  ------------------
  |  |   83|  27.5k|  do {                                       \
  |  |   84|  27.5k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (84:8): [True: 451, False: 27.0k]
  |  |  ------------------
  |  |   85|    451|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1477|    451|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   86|    451|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 451]
  |  |  ------------------
  |  |   87|    451|        return FALSE;                        \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   88|    451|    }                                        \
  |  |   89|  27.5k|    else                                     \
  |  |   90|  27.5k|      dest->var = NULL;                      \
  |  |   91|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (91:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  270|  27.5k|  CLONE_STRING(signature_algorithms);
  ------------------
  |  |   83|  27.5k|  do {                                       \
  |  |   84|  27.5k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (84:8): [True: 0, False: 27.5k]
  |  |  ------------------
  |  |   85|      0|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1477|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   86|      0|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   87|      0|        return FALSE;                        \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   88|      0|    }                                        \
  |  |   89|  27.5k|    else                                     \
  |  |   90|  27.5k|      dest->var = NULL;                      \
  |  |   91|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (91:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  271|  27.5k|  CLONE_STRING(CRLfile);
  ------------------
  |  |   83|  27.5k|  do {                                       \
  |  |   84|  27.5k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (84:8): [True: 13.7k, False: 13.7k]
  |  |  ------------------
  |  |   85|  13.7k|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1477|  13.7k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   86|  13.7k|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |   87|  13.7k|        return FALSE;                        \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   88|  13.7k|    }                                        \
  |  |   89|  27.5k|    else                                     \
  |  |   90|  27.5k|      dest->var = NULL;                      \
  |  |   91|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (91:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  272|  27.5k|  CLONE_STRING(cert_type);
  ------------------
  |  |   83|  27.5k|  do {                                       \
  |  |   84|  27.5k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (84:8): [True: 27, False: 27.5k]
  |  |  ------------------
  |  |   85|     27|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1477|     27|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   86|     27|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 27]
  |  |  ------------------
  |  |   87|     27|        return FALSE;                        \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   88|     27|    }                                        \
  |  |   89|  27.5k|    else                                     \
  |  |   90|  27.5k|      dest->var = NULL;                      \
  |  |   91|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (91:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  273|  27.5k|  CLONE_STRING(key);
  ------------------
  |  |   83|  27.5k|  do {                                       \
  |  |   84|  27.5k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (84:8): [True: 12, False: 27.5k]
  |  |  ------------------
  |  |   85|     12|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1477|     12|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   86|     12|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 12]
  |  |  ------------------
  |  |   87|     12|        return FALSE;                        \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   88|     12|    }                                        \
  |  |   89|  27.5k|    else                                     \
  |  |   90|  27.5k|      dest->var = NULL;                      \
  |  |   91|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (91:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  274|  27.5k|  CLONE_STRING(key_type);
  ------------------
  |  |   83|  27.5k|  do {                                       \
  |  |   84|  27.5k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (84:8): [True: 65, False: 27.4k]
  |  |  ------------------
  |  |   85|     65|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1477|     65|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   86|     65|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 65]
  |  |  ------------------
  |  |   87|     65|        return FALSE;                        \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   88|     65|    }                                        \
  |  |   89|  27.5k|    else                                     \
  |  |   90|  27.5k|      dest->var = NULL;                      \
  |  |   91|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (91:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  275|  27.5k|  CLONE_STRING(key_passwd);
  ------------------
  |  |   83|  27.5k|  do {                                       \
  |  |   84|  27.5k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (84:8): [True: 16, False: 27.5k]
  |  |  ------------------
  |  |   85|     16|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1477|     16|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   86|     16|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 16]
  |  |  ------------------
  |  |   87|     16|        return FALSE;                        \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   88|     16|    }                                        \
  |  |   89|  27.5k|    else                                     \
  |  |   90|  27.5k|      dest->var = NULL;                      \
  |  |   91|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (91:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  276|  27.5k|#ifdef USE_TLS_SRP
  277|  27.5k|  CLONE_STRING(username);
  ------------------
  |  |   83|  27.5k|  do {                                       \
  |  |   84|  27.5k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (84:8): [True: 41, False: 27.5k]
  |  |  ------------------
  |  |   85|     41|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1477|     41|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   86|     41|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 41]
  |  |  ------------------
  |  |   87|     41|        return FALSE;                        \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   88|     41|    }                                        \
  |  |   89|  27.5k|    else                                     \
  |  |   90|  27.5k|      dest->var = NULL;                      \
  |  |   91|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (91:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  278|  27.5k|  CLONE_STRING(password);
  ------------------
  |  |   83|  27.5k|  do {                                       \
  |  |   84|  27.5k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (84:8): [True: 12, False: 27.5k]
  |  |  ------------------
  |  |   85|     12|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1477|     12|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   86|     12|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 12]
  |  |  ------------------
  |  |   87|     12|        return FALSE;                        \
  |  |  ------------------
  |  |  |  | 1058|      0|#define FALSE false
  |  |  ------------------
  |  |   88|     12|    }                                        \
  |  |   89|  27.5k|    else                                     \
  |  |   90|  27.5k|      dest->var = NULL;                      \
  |  |   91|  27.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (91:11): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  279|  27.5k|#endif
  280|       |
  281|  27.5k|  return TRUE;
  ------------------
  |  | 1055|  27.5k|#define TRUE true
  ------------------
  282|  27.5k|}
vtls.c:blobdup:
  100|   110k|{
  101|   110k|  DEBUGASSERT(dest);
  ------------------
  |  | 1081|   110k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (101:3): [True: 0, False: 110k]
  |  Branch (101:3): [True: 110k, False: 0]
  ------------------
  102|   110k|  DEBUGASSERT(!*dest);
  ------------------
  |  | 1081|   110k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (102:3): [True: 0, False: 110k]
  |  Branch (102:3): [True: 110k, False: 0]
  ------------------
  103|   110k|  if(src) {
  ------------------
  |  Branch (103:6): [True: 0, False: 110k]
  ------------------
  104|       |    /* only if there is data to dupe! */
  105|      0|    struct curl_blob *d;
  106|      0|    d = curlx_malloc(sizeof(struct curl_blob) + src->len);
  ------------------
  |  | 1478|      0|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  107|      0|    if(!d)
  ------------------
  |  Branch (107:8): [True: 0, False: 0]
  ------------------
  108|      0|      return CURLE_OUT_OF_MEMORY;
  109|      0|    d->len = src->len;
  110|       |    /* Always duplicate because the connection may survive longer than the
  111|       |       handle that passed in the blob. */
  112|      0|    d->flags = CURL_BLOB_COPY;
  ------------------
  |  |   31|      0|#define CURL_BLOB_COPY   1 /* tell libcurl to copy the data */
  ------------------
  113|      0|    d->data = (void *)((char *)d + sizeof(struct curl_blob));
  114|      0|    memcpy(d->data, src->data, src->len);
  115|      0|    *dest = d;
  116|      0|  }
  117|   110k|  return CURLE_OK;
  118|   110k|}
vtls.c:free_primary_ssl_config:
  285|  31.1k|{
  286|  31.1k|  curlx_safefree(sslc->CApath);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  287|  31.1k|  curlx_safefree(sslc->CAfile);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  288|  31.1k|  curlx_safefree(sslc->issuercert);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  289|  31.1k|  curlx_safefree(sslc->clientcert);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  290|  31.1k|  curlx_safefree(sslc->cipher_list);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  291|  31.1k|  curlx_safefree(sslc->cipher_list13);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  292|  31.1k|  curlx_safefree(sslc->pinned_key);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  293|  31.1k|  curlx_safefree(sslc->cert_blob);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  294|  31.1k|  curlx_safefree(sslc->ca_info_blob);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  295|  31.1k|  curlx_safefree(sslc->issuercert_blob);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  296|  31.1k|  curlx_safefree(sslc->key_blob);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  297|  31.1k|  curlx_safefree(sslc->curves);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  298|  31.1k|  curlx_safefree(sslc->signature_algorithms);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  299|  31.1k|  curlx_safefree(sslc->CRLfile);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  300|  31.1k|  curlx_safefree(sslc->cert_type);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  301|  31.1k|  curlx_safefree(sslc->key);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  302|  31.1k|  curlx_safefree(sslc->key_type);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  303|  31.1k|  curlx_safefree(sslc->key_passwd);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  304|  31.1k|#ifdef USE_TLS_SRP
  305|  31.1k|  curlx_safefree(sslc->username);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  306|       |  curlx_safefree(sslc->password);
  ------------------
  |  | 1327|  31.1k|  do {                      \
  |  | 1328|  31.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  31.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  31.1k|    (ptr) = NULL;           \
  |  | 1330|  31.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
  307|  31.1k|#endif
  308|  31.1k|}
vtls.c:multissl_setup:
 1107|  28.1k|{
 1108|  28.1k|  int i;
 1109|  28.1k|  char *env;
 1110|       |
 1111|  28.1k|  if(Curl_ssl != &Curl_ssl_multi)
  ------------------
  |  Branch (1111:6): [True: 28.1k, False: 0]
  ------------------
 1112|  28.1k|    return 1;
 1113|       |
 1114|      0|  if(backend) {
  ------------------
  |  Branch (1114:6): [True: 0, False: 0]
  ------------------
 1115|      0|    Curl_ssl = backend;
 1116|      0|    return 0;
 1117|      0|  }
 1118|       |
 1119|      0|  if(!available_backends[0])
  ------------------
  |  Branch (1119:6): [True: 0, False: 0]
  ------------------
 1120|      0|    return 1;
 1121|       |
 1122|      0|  env = curl_getenv("CURL_SSL_BACKEND");
 1123|      0|  if(env) {
  ------------------
  |  Branch (1123:6): [True: 0, False: 0]
  ------------------
 1124|      0|    for(i = 0; available_backends[i]; i++) {
  ------------------
  |  Branch (1124:16): [True: 0, False: 0]
  ------------------
 1125|      0|      if(curl_strequal(env, available_backends[i]->info.name)) {
  ------------------
  |  Branch (1125:10): [True: 0, False: 0]
  ------------------
 1126|      0|        Curl_ssl = available_backends[i];
 1127|      0|        curlx_free(env);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1128|      0|        return 0;
 1129|      0|      }
 1130|      0|    }
 1131|      0|  }
 1132|       |
 1133|       |#ifdef CURL_DEFAULT_SSL_BACKEND
 1134|       |  for(i = 0; available_backends[i]; i++) {
 1135|       |    if(curl_strequal(CURL_DEFAULT_SSL_BACKEND,
 1136|       |                     available_backends[i]->info.name)) {
 1137|       |      Curl_ssl = available_backends[i];
 1138|       |      curlx_free(env);
 1139|       |      return 0;
 1140|       |    }
 1141|       |  }
 1142|       |#endif
 1143|       |
 1144|       |  /* Fall back to first available backend */
 1145|      0|  Curl_ssl = available_backends[0];
 1146|      0|  curlx_free(env);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1147|      0|  return 0;
 1148|      0|}
vtls.c:get_peer_type:
 1218|  2.57k|{
 1219|  2.57k|  if(hostname && hostname[0]) {
  ------------------
  |  Branch (1219:6): [True: 2.57k, False: 0]
  |  Branch (1219:18): [True: 2.57k, False: 0]
  ------------------
 1220|  2.57k|#ifdef USE_IPV6
 1221|  2.57k|    struct in6_addr addr;
 1222|       |#else
 1223|       |    struct in_addr addr;
 1224|       |#endif
 1225|  2.57k|    if(curlx_inet_pton(AF_INET, hostname, &addr))
  ------------------
  |  |   43|  2.57k|  inet_pton(x, y, z)
  |  |  ------------------
  |  |  |  Branch (43:3): [True: 1.46k, False: 1.10k]
  |  |  ------------------
  ------------------
 1226|  1.46k|      return CURL_SSL_PEER_IPV4;
 1227|  1.10k|#ifdef USE_IPV6
 1228|  1.10k|    else if(curlx_inet_pton(AF_INET6, hostname, &addr)) {
  ------------------
  |  |   43|  1.10k|  inet_pton(x, y, z)
  |  |  ------------------
  |  |  |  Branch (43:3): [True: 1, False: 1.10k]
  |  |  ------------------
  ------------------
 1229|      1|      return CURL_SSL_PEER_IPV6;
 1230|      1|    }
 1231|  2.57k|#endif
 1232|  2.57k|  }
 1233|  1.10k|  return CURL_SSL_PEER_DNS;
 1234|  2.57k|}
vtls.c:ssl_cf_destroy:
 1296|  2.57k|{
 1297|  2.57k|  struct cf_call_data save;
 1298|       |
 1299|  2.57k|  CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  670|  2.57k|  do { \
  |  |  671|  2.57k|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  213|  2.57k|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  672|  2.57k|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  2.57k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  673|  2.57k|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  213|  2.57k|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  674|  2.57k|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  213|  2.57k|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  866|  2.57k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  675|  2.57k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (675:11): [Folded, False: 2.57k]
  |  |  ------------------
  ------------------
  |  Branch (1299:3): [True: 2.57k, False: 0]
  |  Branch (1299:3): [True: 0, False: 0]
  |  Branch (1299:3): [True: 2.57k, False: 0]
  |  Branch (1299:3): [True: 0, False: 0]
  ------------------
 1300|  2.57k|  cf_close(cf, data);
 1301|  2.57k|  CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  678|  2.57k|  do { \
  |  |  679|  2.57k|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1081|  2.57k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  680|  2.57k|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  2.57k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  681|  2.57k|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  213|  2.57k|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  682|  2.57k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (682:11): [Folded, False: 2.57k]
  |  |  ------------------
  ------------------
  |  Branch (1301:3): [True: 0, False: 2.57k]
  |  Branch (1301:3): [True: 2.57k, False: 0]
  |  Branch (1301:3): [True: 2.57k, False: 0]
  |  Branch (1301:3): [True: 0, False: 0]
  |  Branch (1301:3): [True: 2.57k, False: 0]
  |  Branch (1301:3): [True: 0, False: 0]
  ------------------
 1302|  2.57k|  cf_ctx_free(cf->ctx);
 1303|       |  cf->ctx = NULL;
 1304|  2.57k|}
vtls.c:cf_close:
 1205|  5.15k|{
 1206|  5.15k|  struct ssl_connect_data *connssl = cf->ctx;
 1207|  5.15k|  if(connssl) {
  ------------------
  |  Branch (1207:6): [True: 5.15k, False: 0]
  ------------------
 1208|  5.15k|    connssl->ssl_impl->close(cf, data);
 1209|  5.15k|    connssl->state = ssl_connection_none;
 1210|  5.15k|    connssl->connecting_state = ssl_connect_1;
 1211|  5.15k|    connssl->prefs_checked = FALSE;
  ------------------
  |  | 1058|  5.15k|#define FALSE false
  ------------------
 1212|  5.15k|    Curl_ssl_peer_cleanup(&connssl->peer);
 1213|  5.15k|  }
 1214|       |  cf->connected = FALSE;
  ------------------
  |  | 1058|  5.15k|#define FALSE false
  ------------------
 1215|  5.15k|}
vtls.c:cf_ctx_free:
  537|  2.57k|{
  538|  2.57k|  if(ctx) {
  ------------------
  |  Branch (538:6): [True: 2.57k, False: 0]
  ------------------
  539|  2.57k|    curlx_safefree(ctx->negotiated.alpn);
  ------------------
  |  | 1327|  2.57k|  do {                      \
  |  | 1328|  2.57k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|  2.57k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|  2.57k|    (ptr) = NULL;           \
  |  | 1330|  2.57k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 2.57k]
  |  |  ------------------
  ------------------
  540|  2.57k|    Curl_bufq_free(&ctx->earlydata);
  541|  2.57k|    curlx_free(ctx->backend);
  ------------------
  |  | 1483|  2.57k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  542|  2.57k|    curlx_free(ctx);
  ------------------
  |  | 1483|  2.57k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  543|  2.57k|  }
  544|  2.57k|}
vtls.c:ssl_cf_connect:
 1321|  2.88k|{
 1322|  2.88k|  struct ssl_connect_data *connssl = cf->ctx;
 1323|  2.88k|  struct cf_call_data save;
 1324|  2.88k|  CURLcode result;
 1325|       |
 1326|  2.88k|  if(cf->connected && (connssl->state != ssl_connection_deferred)) {
  ------------------
  |  Branch (1326:6): [True: 0, False: 2.88k]
  |  Branch (1326:23): [True: 0, False: 0]
  ------------------
 1327|      0|    *done = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1328|      0|    return CURLE_OK;
 1329|      0|  }
 1330|       |
 1331|  2.88k|  if(!cf->next) {
  ------------------
  |  Branch (1331:6): [True: 0, False: 2.88k]
  ------------------
 1332|      0|    *done = FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
 1333|      0|    return CURLE_FAILED_INIT;
 1334|      0|  }
 1335|       |
 1336|  2.88k|  if(!cf->next->connected) {
  ------------------
  |  Branch (1336:6): [True: 0, False: 2.88k]
  ------------------
 1337|      0|    result = cf->next->cft->do_connect(cf->next, data, done);
 1338|      0|    if(result || !*done)
  ------------------
  |  Branch (1338:8): [True: 0, False: 0]
  |  Branch (1338:18): [True: 0, False: 0]
  ------------------
 1339|      0|      return result;
 1340|      0|  }
 1341|       |
 1342|  2.88k|  CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  670|  2.88k|  do { \
  |  |  671|  2.88k|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  213|  2.88k|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  672|  2.88k|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  2.88k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  673|  2.88k|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  213|  2.88k|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  674|  2.88k|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  213|  2.88k|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  866|  2.88k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  675|  2.88k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (675:11): [Folded, False: 2.88k]
  |  |  ------------------
  ------------------
  |  Branch (1342:3): [True: 2.88k, False: 0]
  |  Branch (1342:3): [True: 0, False: 0]
  |  Branch (1342:3): [True: 2.88k, False: 0]
  |  Branch (1342:3): [True: 0, False: 0]
  ------------------
 1343|  2.88k|  CURL_TRC_CF(data, cf, "cf_connect()");
  ------------------
  |  |  153|  2.88k|  do {                                          \
  |  |  154|  2.88k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  2.88k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  5.76k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 2.88k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 2.88k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  5.76k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  2.88k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  2.88k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  2.88k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.88k]
  |  |  ------------------
  ------------------
 1344|  2.88k|  DEBUGASSERT(connssl);
  ------------------
  |  | 1081|  2.88k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1344:3): [True: 0, False: 2.88k]
  |  Branch (1344:3): [True: 2.88k, False: 0]
  ------------------
 1345|       |
 1346|  2.88k|  *done = FALSE;
  ------------------
  |  | 1058|  2.88k|#define FALSE false
  ------------------
 1347|       |
 1348|  2.88k|  if(!connssl->prefs_checked) {
  ------------------
  |  Branch (1348:6): [True: 2.57k, False: 305]
  ------------------
 1349|  2.57k|    if(!ssl_prefs_check(data)) {
  ------------------
  |  Branch (1349:8): [True: 2, False: 2.57k]
  ------------------
 1350|      2|      result = CURLE_SSL_CONNECT_ERROR;
 1351|      2|      goto out;
 1352|      2|    }
 1353|  2.57k|    connssl->prefs_checked = TRUE;
  ------------------
  |  | 1055|  2.57k|#define TRUE true
  ------------------
 1354|  2.57k|  }
 1355|       |
 1356|  2.87k|  if(!connssl->peer.dest) {
  ------------------
  |  Branch (1356:6): [True: 2.57k, False: 305]
  ------------------
 1357|  2.57k|    char tls_id[80];
 1358|  2.57k|    connssl->ssl_impl->version(tls_id, sizeof(tls_id) - 1);
 1359|  2.57k|    result = Curl_ssl_peer_init(&connssl->peer, cf, tls_id, TRNSPRT_TCP);
  ------------------
  |  |  307|  2.57k|#define TRNSPRT_TCP  3
  ------------------
 1360|  2.57k|    if(result)
  ------------------
  |  Branch (1360:8): [True: 12, False: 2.56k]
  ------------------
 1361|     12|      goto out;
 1362|  2.57k|  }
 1363|       |
 1364|  2.86k|  result = connssl->ssl_impl->do_connect(cf, data, done);
 1365|       |
 1366|  2.86k|  if(!result && *done) {
  ------------------
  |  Branch (1366:6): [True: 310, False: 2.55k]
  |  Branch (1366:17): [True: 0, False: 310]
  ------------------
 1367|      0|    cf->connected = TRUE;
  ------------------
  |  | 1055|      0|#define TRUE true
  ------------------
 1368|      0|    if(connssl->state == ssl_connection_complete) {
  ------------------
  |  Branch (1368:8): [True: 0, False: 0]
  ------------------
 1369|      0|      connssl->handshake_done = *Curl_pgrs_now(data);
 1370|      0|    }
 1371|      0|    if(Curl_tls_keylog_enabled()) {
  ------------------
  |  Branch (1371:8): [True: 0, False: 0]
  ------------------
 1372|      0|      infof(data, "SSLKEYLOGFILE set, all TLS secrets are logged to '%s'",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1373|      0|            Curl_tls_keylog_file_name());
 1374|       |#ifdef LIBRESSL_VERSION_NUMBER
 1375|       |      infof(data, "Note LibreSSL only supports SSLKEYLOGFILE for TLS <= 1.2");
 1376|       |#endif
 1377|      0|    }
 1378|       |    /* Connection can be deferred when sending early data */
 1379|      0|    DEBUGASSERT(connssl->state == ssl_connection_complete ||
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1379:5): [True: 0, False: 0]
  |  Branch (1379:5): [True: 0, False: 0]
  |  Branch (1379:5): [True: 0, False: 0]
  |  Branch (1379:5): [True: 0, False: 0]
  ------------------
 1380|      0|                connssl->state == ssl_connection_deferred);
 1381|      0|    DEBUGASSERT(connssl->state != ssl_connection_deferred ||
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1381:5): [True: 0, False: 0]
  |  Branch (1381:5): [True: 0, False: 0]
  |  Branch (1381:5): [True: 0, False: 0]
  |  Branch (1381:5): [True: 0, False: 0]
  ------------------
 1382|      0|                connssl->earlydata_state > ssl_earlydata_none);
 1383|      0|  }
 1384|  2.88k|out:
 1385|  2.88k|  CURL_TRC_CF(data, cf, "cf_connect() -> %d, done=%d", result, *done);
  ------------------
  |  |  153|  2.88k|  do {                                          \
  |  |  154|  2.88k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|  2.88k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  5.76k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 2.88k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 2.88k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  5.76k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|  2.88k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  2.88k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  2.88k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.88k]
  |  |  ------------------
  ------------------
 1386|  2.88k|  CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  678|  2.88k|  do { \
  |  |  679|  2.88k|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1081|  2.88k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  680|  2.88k|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  2.88k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  681|  2.88k|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  213|  2.88k|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  682|  2.88k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (682:11): [Folded, False: 2.88k]
  |  |  ------------------
  ------------------
  |  Branch (1386:3): [True: 0, False: 2.88k]
  |  Branch (1386:3): [True: 2.88k, False: 0]
  |  Branch (1386:3): [True: 2.88k, False: 0]
  |  Branch (1386:3): [True: 0, False: 0]
  |  Branch (1386:3): [True: 2.88k, False: 0]
  |  Branch (1386:3): [True: 0, False: 0]
  ------------------
 1387|  2.88k|  return result;
 1388|  2.88k|}
vtls.c:ssl_prefs_check:
  492|  2.57k|{
  493|       |  /* check for CURLOPT_SSLVERSION invalid parameter value */
  494|  2.57k|  const unsigned char sslver = data->set.ssl.primary.version;
  495|  2.57k|  if(sslver >= CURL_SSLVERSION_LAST) {
  ------------------
  |  | 2377|  2.57k|#define CURL_SSLVERSION_LAST    8L /* never use, keep last */
  ------------------
  |  Branch (495:6): [True: 0, False: 2.57k]
  ------------------
  496|      0|    failf(data, "Unrecognized parameter value passed via CURLOPT_SSLVERSION");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  497|      0|    return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  498|      0|  }
  499|       |
  500|  2.57k|  switch(data->set.ssl.primary.version_max) {
  501|  2.54k|  case CURL_SSLVERSION_MAX_NONE:
  ------------------
  |  | 2379|  2.54k|#define CURL_SSLVERSION_MAX_NONE 0L
  ------------------
  |  Branch (501:3): [True: 2.54k, False: 28]
  ------------------
  502|  2.55k|  case CURL_SSLVERSION_MAX_DEFAULT:
  ------------------
  |  | 2380|  2.55k|#define CURL_SSLVERSION_MAX_DEFAULT (CURL_SSLVERSION_TLSv1   << 16)
  |  |  ------------------
  |  |  |  | 2369|  2.55k|#define CURL_SSLVERSION_TLSv1   1L /* TLS 1.x */
  |  |  ------------------
  ------------------
  |  Branch (502:3): [True: 4, False: 2.57k]
  ------------------
  503|  2.55k|    break;
  504|       |
  505|     24|  default:
  ------------------
  |  Branch (505:3): [True: 24, False: 2.55k]
  ------------------
  506|     24|    if((data->set.ssl.primary.version_max >> 16) < sslver) {
  ------------------
  |  Branch (506:8): [True: 2, False: 22]
  ------------------
  507|      2|      failf(data, "CURL_SSLVERSION_MAX incompatible with CURL_SSLVERSION");
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
  508|      2|      return FALSE;
  ------------------
  |  | 1058|      2|#define FALSE false
  ------------------
  509|      2|    }
  510|  2.57k|  }
  511|       |
  512|  2.57k|  return TRUE;
  ------------------
  |  | 1055|  2.57k|#define TRUE true
  ------------------
  513|  2.57k|}
vtls.c:ssl_cf_close:
 1308|  2.57k|{
 1309|  2.57k|  struct cf_call_data save;
 1310|       |
 1311|  2.57k|  CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  670|  2.57k|  do { \
  |  |  671|  2.57k|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  213|  2.57k|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  672|  2.57k|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  2.57k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  673|  2.57k|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  213|  2.57k|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  674|  2.57k|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  213|  2.57k|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  866|  2.57k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  675|  2.57k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (675:11): [Folded, False: 2.57k]
  |  |  ------------------
  ------------------
  |  Branch (1311:3): [True: 2.57k, False: 0]
  |  Branch (1311:3): [True: 0, False: 0]
  |  Branch (1311:3): [True: 2.57k, False: 0]
  |  Branch (1311:3): [True: 0, False: 0]
  ------------------
 1312|  2.57k|  cf_close(cf, data);
 1313|  2.57k|  if(cf->next)
  ------------------
  |  Branch (1313:6): [True: 2.57k, False: 0]
  ------------------
 1314|  2.57k|    cf->next->cft->do_close(cf->next, data);
 1315|       |  CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  678|  2.57k|  do { \
  |  |  679|  2.57k|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1081|  2.57k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  680|  2.57k|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|  2.57k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  681|  2.57k|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  213|  2.57k|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  682|  2.57k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (682:11): [Folded, False: 2.57k]
  |  |  ------------------
  ------------------
  |  Branch (1315:3): [True: 0, False: 2.57k]
  |  Branch (1315:3): [True: 2.57k, False: 0]
  |  Branch (1315:3): [True: 2.57k, False: 0]
  |  Branch (1315:3): [True: 0, False: 0]
  |  Branch (1315:3): [True: 2.57k, False: 0]
  |  Branch (1315:3): [True: 0, False: 0]
  ------------------
 1316|  2.57k|}
vtls.c:ssl_cf_adjust_pollset:
 1585|    310|{
 1586|    310|  struct ssl_connect_data *connssl = cf->ctx;
 1587|    310|  struct cf_call_data save;
 1588|    310|  CURLcode result;
 1589|       |
 1590|    310|  CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  670|    310|  do { \
  |  |  671|    310|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  213|    310|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  672|    310|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|    310|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  673|    310|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  213|    310|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  674|    310|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  213|    310|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  866|    310|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  675|    310|  } while(0)
  |  |  ------------------
  |  |  |  Branch (675:11): [Folded, False: 310]
  |  |  ------------------
  ------------------
  |  Branch (1590:3): [True: 310, False: 0]
  |  Branch (1590:3): [True: 0, False: 0]
  |  Branch (1590:3): [True: 310, False: 0]
  |  Branch (1590:3): [True: 0, False: 0]
  ------------------
 1591|    310|  result = connssl->ssl_impl->adjust_pollset(cf, data, ps);
 1592|    310|  CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  678|    310|  do { \
  |  |  679|    310|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1081|    310|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  680|    310|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|    310|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  681|    310|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  213|    310|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  682|    310|  } while(0)
  |  |  ------------------
  |  |  |  Branch (682:11): [Folded, False: 310]
  |  |  ------------------
  ------------------
  |  Branch (1592:3): [True: 0, False: 310]
  |  Branch (1592:3): [True: 310, False: 0]
  |  Branch (1592:3): [True: 310, False: 0]
  |  Branch (1592:3): [True: 0, False: 0]
  |  Branch (1592:3): [True: 310, False: 0]
  |  Branch (1592:3): [True: 0, False: 0]
  ------------------
 1593|    310|  return result;
 1594|    310|}
vtls.c:ssl_cf_cntrl:
 1641|  2.15k|{
 1642|  2.15k|  struct ssl_connect_data *connssl = cf->ctx;
 1643|       |
 1644|  2.15k|  (void)arg1;
 1645|  2.15k|  (void)arg2;
 1646|  2.15k|  (void)data;
 1647|  2.15k|  switch(event) {
  ------------------
  |  Branch (1647:10): [True: 0, False: 2.15k]
  ------------------
 1648|      0|  case CF_CTRL_CONN_INFO_UPDATE:
  ------------------
  |  |  125|      0|#define CF_CTRL_CONN_INFO_UPDATE (256 + 0) /* 0          NULL     ignored */
  ------------------
  |  Branch (1648:3): [True: 0, False: 2.15k]
  ------------------
 1649|      0|    if(connssl->negotiated.alpn && !cf->sockindex) {
  ------------------
  |  Branch (1649:8): [True: 0, False: 0]
  |  Branch (1649:36): [True: 0, False: 0]
  ------------------
 1650|      0|      if(!strcmp("http/1.1", connssl->negotiated.alpn))
  ------------------
  |  Branch (1650:10): [True: 0, False: 0]
  ------------------
 1651|      0|        cf->conn->httpversion_seen = 11;
 1652|      0|      else if(!strcmp("h2", connssl->negotiated.alpn))
  ------------------
  |  Branch (1652:15): [True: 0, False: 0]
  ------------------
 1653|      0|        cf->conn->httpversion_seen = 20;
 1654|      0|      else if(!strcmp("h3", connssl->negotiated.alpn))
  ------------------
  |  Branch (1654:15): [True: 0, False: 0]
  ------------------
 1655|      0|        cf->conn->httpversion_seen = 30;
 1656|      0|    }
 1657|      0|    break;
 1658|  2.15k|  }
 1659|  2.15k|  return CURLE_OK;
 1660|  2.15k|}
vtls.c:ssl_cf_query:
 1599|  5.75k|{
 1600|  5.75k|  struct ssl_connect_data *connssl = cf->ctx;
 1601|       |
 1602|  5.75k|  switch(query) {
 1603|  2.57k|  case CF_QUERY_TIMER_APPCONNECT: {
  ------------------
  |  |  169|  2.57k|#define CF_QUERY_TIMER_APPCONNECT   5  /* -          struct curltime */
  ------------------
  |  Branch (1603:3): [True: 2.57k, False: 3.18k]
  ------------------
 1604|  2.57k|    struct curltime *when = pres2;
 1605|  2.57k|    if(cf->connected && !Curl_ssl_cf_is_proxy(cf))
  ------------------
  |  Branch (1605:8): [True: 0, False: 2.57k]
  |  Branch (1605:25): [True: 0, False: 0]
  ------------------
 1606|      0|      *when = connssl->handshake_done;
 1607|  2.57k|    return CURLE_OK;
 1608|      0|  }
 1609|      0|  case CF_QUERY_SSL_INFO:
  ------------------
  |  |  178|      0|#define CF_QUERY_SSL_INFO          12  /* -    struct curl_tlssessioninfo * */
  ------------------
  |  Branch (1609:3): [True: 0, False: 5.75k]
  ------------------
 1610|      0|  case CF_QUERY_SSL_CTX_INFO:
  ------------------
  |  |  179|      0|#define CF_QUERY_SSL_CTX_INFO      13  /* -    struct curl_tlssessioninfo * */
  ------------------
  |  Branch (1610:3): [True: 0, False: 5.75k]
  ------------------
 1611|      0|    if(!Curl_ssl_cf_is_proxy(cf)) {
  ------------------
  |  Branch (1611:8): [True: 0, False: 0]
  ------------------
 1612|      0|      struct curl_tlssessioninfo *info = pres2;
 1613|      0|      struct cf_call_data save;
 1614|      0|      CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  670|      0|  do { \
  |  |  671|      0|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  213|      0|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  672|      0|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  673|      0|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  213|      0|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  674|      0|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  213|      0|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  866|      0|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  675|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (675:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1614:7): [True: 0, False: 0]
  |  Branch (1614:7): [True: 0, False: 0]
  |  Branch (1614:7): [True: 0, False: 0]
  |  Branch (1614:7): [True: 0, False: 0]
  ------------------
 1615|      0|      info->backend = Curl_ssl_backend();
 1616|      0|      info->internals = connssl->ssl_impl->get_internals(
 1617|      0|        cf->ctx, (query == CF_QUERY_SSL_INFO) ?
  ------------------
  |  |  178|      0|#define CF_QUERY_SSL_INFO          12  /* -    struct curl_tlssessioninfo * */
  ------------------
  |  Branch (1617:18): [True: 0, False: 0]
  ------------------
 1618|      0|        CURLINFO_TLS_SSL_PTR : CURLINFO_TLS_SESSION);
 1619|      0|      CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  678|      0|  do { \
  |  |  679|      0|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  680|      0|    DEBUGASSERT((save).data == NULL || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  681|      0|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  213|      0|#define CF_CTX_CALL_DATA(cf) ((struct ssl_connect_data *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  682|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (682:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1619:7): [True: 0, False: 0]
  |  Branch (1619:7): [True: 0, False: 0]
  |  Branch (1619:7): [True: 0, False: 0]
  |  Branch (1619:7): [True: 0, False: 0]
  |  Branch (1619:7): [True: 0, False: 0]
  |  Branch (1619:7): [True: 0, False: 0]
  ------------------
 1620|      0|      return CURLE_OK;
 1621|      0|    }
 1622|      0|    break;
 1623|      0|  case CF_QUERY_ALPN_NEGOTIATED: {
  ------------------
  |  |  181|      0|#define CF_QUERY_ALPN_NEGOTIATED   15  /* -          const char * */
  ------------------
  |  Branch (1623:3): [True: 0, False: 5.75k]
  ------------------
 1624|      0|    const char **palpn = pres2;
 1625|      0|    DEBUGASSERT(palpn);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1625:5): [True: 0, False: 0]
  |  Branch (1625:5): [True: 0, False: 0]
  ------------------
 1626|      0|    *palpn = connssl->negotiated.alpn;
 1627|      0|    CURL_TRC_CF(data, cf, "query ALPN: returning '%s'", *palpn);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  323|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  324|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (324:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1628|      0|    return CURLE_OK;
 1629|      0|  }
 1630|  3.18k|  default:
  ------------------
  |  Branch (1630:3): [True: 3.18k, False: 2.57k]
  ------------------
 1631|  3.18k|    break;
 1632|  5.75k|  }
 1633|  3.18k|  return cf->next ?
  ------------------
  |  Branch (1633:10): [True: 3.18k, False: 0]
  ------------------
 1634|  3.18k|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
 1635|  3.18k|    CURLE_UNKNOWN_OPTION;
 1636|  5.75k|}
vtls.c:cf_ssl_create:
 1716|  2.15k|{
 1717|  2.15k|  struct Curl_cfilter *cf = NULL;
 1718|  2.15k|  struct ssl_connect_data *ctx;
 1719|  2.15k|  CURLcode result;
 1720|       |
 1721|  2.15k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1081|  2.15k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1721:3): [True: 0, False: 2.15k]
  |  Branch (1721:3): [True: 2.15k, False: 0]
  ------------------
 1722|       |
 1723|       |#ifdef CURL_DISABLE_HTTP
 1724|       |  (void)conn;
 1725|       |  /* We only support ALPN for HTTP so far. */
 1726|       |  DEBUGASSERT(!conn->bits.tls_enable_alpn);
 1727|       |  ctx = cf_ctx_new(data, NULL);
 1728|       |#else
 1729|  2.15k|  ctx = cf_ctx_new(data, alpn_get_spec(data->state.http_neg.wanted,
 1730|  2.15k|                                       data->state.http_neg.preferred,
 1731|  2.15k|                                       (bool)data->state.http_neg.only_10,
 1732|  2.15k|                                       (bool)conn->bits.tls_enable_alpn));
 1733|  2.15k|#endif
 1734|  2.15k|  if(!ctx) {
  ------------------
  |  Branch (1734:6): [True: 0, False: 2.15k]
  ------------------
 1735|      0|    result = CURLE_OUT_OF_MEMORY;
 1736|      0|    goto out;
 1737|      0|  }
 1738|       |
 1739|  2.15k|  result = Curl_cf_create(&cf, &Curl_cft_ssl, ctx);
 1740|       |
 1741|  2.15k|out:
 1742|  2.15k|  if(result)
  ------------------
  |  Branch (1742:6): [True: 0, False: 2.15k]
  ------------------
 1743|      0|    cf_ctx_free(ctx);
 1744|  2.15k|  *pcf = result ? NULL : cf;
  ------------------
  |  Branch (1744:10): [True: 0, False: 2.15k]
  ------------------
 1745|  2.15k|  return result;
 1746|  2.15k|}
vtls.c:cf_ctx_new:
  517|  2.57k|{
  518|  2.57k|  struct ssl_connect_data *ctx;
  519|       |
  520|  2.57k|  (void)data;
  521|  2.57k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1480|  2.57k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  522|  2.57k|  if(!ctx)
  ------------------
  |  Branch (522:6): [True: 0, False: 2.57k]
  ------------------
  523|      0|    return NULL;
  524|       |
  525|  2.57k|  ctx->ssl_impl = Curl_ssl;
  526|  2.57k|  ctx->alpn = alpn;
  527|  2.57k|  Curl_bufq_init2(&ctx->earlydata, CURL_SSL_EARLY_MAX, 1, BUFQ_OPT_NO_SPARES);
  ------------------
  |  |  110|  2.57k|#define CURL_SSL_EARLY_MAX      (64 * 1024)
  ------------------
                Curl_bufq_init2(&ctx->earlydata, CURL_SSL_EARLY_MAX, 1, BUFQ_OPT_NO_SPARES);
  ------------------
  |  |  115|  2.57k|#define BUFQ_OPT_NO_SPARES   (1 << 1)
  ------------------
  528|  2.57k|  ctx->backend = curlx_calloc(1, ctx->ssl_impl->sizeof_ssl_backend_data);
  ------------------
  |  | 1480|  2.57k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  529|  2.57k|  if(!ctx->backend) {
  ------------------
  |  Branch (529:6): [True: 0, False: 2.57k]
  ------------------
  530|      0|    curlx_free(ctx);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  531|      0|    return NULL;
  532|      0|  }
  533|  2.57k|  return ctx;
  534|  2.57k|}
vtls.c:alpn_get_spec:
  156|  2.57k|{
  157|  2.57k|  if(!use_alpn)
  ------------------
  |  Branch (157:6): [True: 2.16k, False: 416]
  ------------------
  158|  2.16k|    return NULL;
  159|       |  /* If HTTP/1.0 is the wanted protocol then use ALPN http/1.0 and http/1.1.
  160|       |     This is for compatibility reasons since some HTTP/1.0 servers with old
  161|       |     ALPN implementations understand ALPN http/1.1 but not http/1.0. */
  162|    416|  if(only_http_10 && (wanted & CURL_HTTP_V1x))
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
  |  Branch (162:6): [True: 0, False: 416]
  |  Branch (162:22): [True: 0, False: 0]
  ------------------
  163|      0|    return &ALPN_SPEC_H10_H11;
  164|    416|#ifdef USE_HTTP2
  165|    416|  if(wanted & CURL_HTTP_V2x) {
  ------------------
  |  |   41|    416|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  |  Branch (165:6): [True: 382, False: 34]
  ------------------
  166|    382|    if(wanted & CURL_HTTP_V1x)
  ------------------
  |  |   40|    382|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
  |  Branch (166:8): [True: 382, False: 0]
  ------------------
  167|    382|      return (preferred == CURL_HTTP_V1x) ?
  ------------------
  |  |   40|    382|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
  |  Branch (167:14): [True: 0, False: 382]
  ------------------
  168|    382|        &ALPN_SPEC_H11_H2 : &ALPN_SPEC_H2_H11;
  169|      0|    return &ALPN_SPEC_H2;
  170|    382|  }
  171|       |#else
  172|       |  (void)wanted;
  173|       |  (void)preferred;
  174|       |#endif
  175|     34|  return &ALPN_SPEC_H11;
  176|    416|}
vtls.c:cf_ssl_proxy_create:
 1778|    417|{
 1779|    417|  struct Curl_cfilter *cf = NULL;
 1780|    417|  struct ssl_connect_data *ctx;
 1781|    417|  CURLcode result;
 1782|       |  /* ALPN is default, but if user explicitly disables it, obey */
 1783|    417|  bool use_alpn = (bool)data->set.ssl_enable_alpn;
 1784|    417|  http_majors wanted = CURL_HTTP_V1x;
  ------------------
  |  |   40|    417|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
 1785|       |
 1786|    417|  (void)conn;
 1787|    417|#ifdef USE_HTTP2
 1788|    417|  if(conn->http_proxy.proxytype == CURLPROXY_HTTPS2) {
  ------------------
  |  |  796|    417|#define CURLPROXY_HTTPS2          3L /* HTTPS and attempt HTTP/2
  ------------------
  |  Branch (1788:6): [True: 382, False: 35]
  ------------------
 1789|    382|    use_alpn = TRUE;
  ------------------
  |  | 1055|    382|#define TRUE true
  ------------------
 1790|    382|    wanted = (CURL_HTTP_V1x | CURL_HTTP_V2x);
  ------------------
  |  |   40|    382|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
                  wanted = (CURL_HTTP_V1x | CURL_HTTP_V2x);
  ------------------
  |  |   41|    382|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
 1791|    382|  }
 1792|    417|#endif
 1793|       |
 1794|    417|  ctx = cf_ctx_new(data, alpn_get_spec(wanted, 0, false, use_alpn));
 1795|    417|  if(!ctx) {
  ------------------
  |  Branch (1795:6): [True: 0, False: 417]
  ------------------
 1796|      0|    result = CURLE_OUT_OF_MEMORY;
 1797|      0|    goto out;
 1798|      0|  }
 1799|    417|  result = Curl_cf_create(&cf, &Curl_cft_ssl_proxy, ctx);
 1800|       |
 1801|    417|out:
 1802|    417|  if(result)
  ------------------
  |  Branch (1802:6): [True: 0, False: 417]
  ------------------
 1803|      0|    cf_ctx_free(ctx);
 1804|    417|  *pcf = result ? NULL : cf;
  ------------------
  |  Branch (1804:10): [True: 0, False: 417]
  ------------------
 1805|    417|  return result;
 1806|    417|}

Curl_ssl_peer_key_build:
  185|  2.57k|{
  186|  2.57k|  struct dynbuf buf;
  187|  2.57k|  size_t key_len;
  188|  2.57k|  bool is_local = FALSE;
  ------------------
  |  | 1058|  2.57k|#define FALSE false
  ------------------
  189|  2.57k|  CURLcode result;
  190|       |
  191|  2.57k|  *ppeer_key = NULL;
  192|  2.57k|  curlx_dyn_init(&buf, 10 * 1024);
  193|       |
  194|  2.57k|  result = curlx_dyn_addf(&buf, "%s:%d",
  195|  2.57k|                          peer->dest->hostname, peer->dest->port);
  196|  2.57k|  if(result)
  ------------------
  |  Branch (196:6): [True: 0, False: 2.57k]
  ------------------
  197|      0|    goto out;
  198|       |
  199|  2.57k|  switch(peer->transport) {
  200|  2.57k|  case TRNSPRT_TCP:
  ------------------
  |  |  307|  2.57k|#define TRNSPRT_TCP  3
  ------------------
  |  Branch (200:3): [True: 2.57k, False: 0]
  ------------------
  201|  2.57k|    break;
  202|      0|  case TRNSPRT_UDP:
  ------------------
  |  |  308|      0|#define TRNSPRT_UDP  4
  ------------------
  |  Branch (202:3): [True: 0, False: 2.57k]
  ------------------
  203|      0|    result = curlx_dyn_add(&buf, ":UDP");
  204|      0|    break;
  205|      0|  case TRNSPRT_QUIC:
  ------------------
  |  |  309|      0|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (205:3): [True: 0, False: 2.57k]
  ------------------
  206|      0|    result = curlx_dyn_add(&buf, ":QUIC");
  207|      0|    break;
  208|      0|  case TRNSPRT_UNIX:
  ------------------
  |  |  310|      0|#define TRNSPRT_UNIX 6
  ------------------
  |  Branch (208:3): [True: 0, False: 2.57k]
  ------------------
  209|      0|    result = curlx_dyn_add(&buf, ":UNIX");
  210|      0|    break;
  211|      0|  default:
  ------------------
  |  Branch (211:3): [True: 0, False: 2.57k]
  ------------------
  212|      0|    result = curlx_dyn_addf(&buf, ":TRNSPRT-%d", peer->transport);
  213|      0|    break;
  214|  2.57k|  }
  215|  2.57k|  if(result)
  ------------------
  |  Branch (215:6): [True: 0, False: 2.57k]
  ------------------
  216|      0|    goto out;
  217|       |
  218|  2.57k|  if(!ssl->verifypeer) {
  ------------------
  |  Branch (218:6): [True: 23, False: 2.55k]
  ------------------
  219|     23|    result = curlx_dyn_add(&buf, ":NO-VRFY-PEER");
  220|     23|    if(result)
  ------------------
  |  Branch (220:8): [True: 0, False: 23]
  ------------------
  221|      0|      goto out;
  222|     23|  }
  223|  2.57k|  if(!ssl->verifyhost) {
  ------------------
  |  Branch (223:6): [True: 2, False: 2.57k]
  ------------------
  224|      2|    result = curlx_dyn_add(&buf, ":NO-VRFY-HOST");
  225|      2|    if(result)
  ------------------
  |  Branch (225:8): [True: 0, False: 2]
  ------------------
  226|      0|      goto out;
  227|      2|  }
  228|  2.57k|  if(ssl->verifystatus) {
  ------------------
  |  Branch (228:6): [True: 2, False: 2.57k]
  ------------------
  229|      2|    result = curlx_dyn_add(&buf, ":VRFY-STATUS");
  230|      2|    if(result)
  ------------------
  |  Branch (230:8): [True: 0, False: 2]
  ------------------
  231|      0|      goto out;
  232|      2|  }
  233|  2.57k|  if(!ssl->verifypeer || !ssl->verifyhost) {
  ------------------
  |  Branch (233:6): [True: 23, False: 2.55k]
  |  Branch (233:26): [True: 2, False: 2.54k]
  ------------------
  234|     25|    if(via_peer) {
  ------------------
  |  Branch (234:8): [True: 24, False: 1]
  ------------------
  235|     24|      result = curlx_dyn_addf(&buf, ":CHOST-%s:CPORT-%u",
  236|     24|                              via_peer->hostname,
  237|     24|                              via_peer->port);
  238|     24|      if(result)
  ------------------
  |  Branch (238:10): [True: 0, False: 24]
  ------------------
  239|      0|        goto out;
  240|     24|    }
  241|     25|  }
  242|       |
  243|  2.57k|  if(ssl->version || ssl->version_max) {
  ------------------
  |  Branch (243:6): [True: 2.57k, False: 0]
  |  Branch (243:22): [True: 0, False: 0]
  ------------------
  244|  2.57k|    result = curlx_dyn_addf(&buf, ":TLSVER-%d-%u", ssl->version,
  245|  2.57k|                            (ssl->version_max >> 16));
  246|  2.57k|    if(result)
  ------------------
  |  Branch (246:8): [True: 0, False: 2.57k]
  ------------------
  247|      0|      goto out;
  248|  2.57k|  }
  249|  2.57k|  if(ssl->ssl_options) {
  ------------------
  |  Branch (249:6): [True: 3, False: 2.57k]
  ------------------
  250|      3|    result = curlx_dyn_addf(&buf, ":TLSOPT-%x", ssl->ssl_options);
  251|      3|    if(result)
  ------------------
  |  Branch (251:8): [True: 0, False: 3]
  ------------------
  252|      0|      goto out;
  253|      3|  }
  254|  2.57k|  if(ssl->cipher_list) {
  ------------------
  |  Branch (254:6): [True: 784, False: 1.79k]
  ------------------
  255|    784|    result = curlx_dyn_addf(&buf, ":CIPHER-%s", ssl->cipher_list);
  256|    784|    if(result)
  ------------------
  |  Branch (256:8): [True: 1, False: 783]
  ------------------
  257|      1|      goto out;
  258|    784|  }
  259|  2.57k|  if(ssl->cipher_list13) {
  ------------------
  |  Branch (259:6): [True: 148, False: 2.42k]
  ------------------
  260|    148|    result = curlx_dyn_addf(&buf, ":CIPHER13-%s", ssl->cipher_list13);
  261|    148|    if(result)
  ------------------
  |  Branch (261:8): [True: 0, False: 148]
  ------------------
  262|      0|      goto out;
  263|    148|  }
  264|  2.57k|  if(ssl->curves) {
  ------------------
  |  Branch (264:6): [True: 441, False: 2.13k]
  ------------------
  265|    441|    result = curlx_dyn_addf(&buf, ":CURVES-%s", ssl->curves);
  266|    441|    if(result)
  ------------------
  |  Branch (266:8): [True: 0, False: 441]
  ------------------
  267|      0|      goto out;
  268|    441|  }
  269|  2.57k|  if(ssl->signature_algorithms) {
  ------------------
  |  Branch (269:6): [True: 0, False: 2.57k]
  ------------------
  270|      0|    result = curlx_dyn_addf(&buf, ":SIGALGS-%s",
  271|      0|                            ssl->signature_algorithms);
  272|      0|    if(result)
  ------------------
  |  Branch (272:8): [True: 0, False: 0]
  ------------------
  273|      0|      goto out;
  274|      0|  }
  275|  2.57k|  if(ssl->verifypeer) {
  ------------------
  |  Branch (275:6): [True: 2.55k, False: 23]
  ------------------
  276|  2.55k|    result = cf_ssl_peer_key_add_path(&buf, "CA", ssl->CAfile, &is_local);
  277|  2.55k|    if(result)
  ------------------
  |  Branch (277:8): [True: 1, False: 2.54k]
  ------------------
  278|      1|      goto out;
  279|  2.54k|    result = cf_ssl_peer_key_add_path(&buf, "CApath", ssl->CApath, &is_local);
  280|  2.54k|    if(result)
  ------------------
  |  Branch (280:8): [True: 1, False: 2.54k]
  ------------------
  281|      1|      goto out;
  282|  2.54k|    result = cf_ssl_peer_key_add_path(&buf, "CRL", ssl->CRLfile, &is_local);
  283|  2.54k|    if(result)
  ------------------
  |  Branch (283:8): [True: 1, False: 2.54k]
  ------------------
  284|      1|      goto out;
  285|  2.54k|    result = cf_ssl_peer_key_add_path(&buf, "Issuer", ssl->issuercert,
  286|  2.54k|                                      &is_local);
  287|  2.54k|    if(result)
  ------------------
  |  Branch (287:8): [True: 1, False: 2.54k]
  ------------------
  288|      1|      goto out;
  289|  2.54k|    if(ssl->ca_info_blob) {
  ------------------
  |  Branch (289:8): [True: 0, False: 2.54k]
  ------------------
  290|      0|      result = cf_ssl_peer_key_add_hash(&buf, "CAInfoBlob", ssl->ca_info_blob);
  291|      0|      if(result)
  ------------------
  |  Branch (291:10): [True: 0, False: 0]
  ------------------
  292|      0|        goto out;
  293|      0|    }
  294|  2.54k|    if(ssl->issuercert_blob) {
  ------------------
  |  Branch (294:8): [True: 0, False: 2.54k]
  ------------------
  295|      0|      result = cf_ssl_peer_key_add_hash(&buf, "IssuerBlob",
  296|      0|                                        ssl->issuercert_blob);
  297|      0|      if(result)
  ------------------
  |  Branch (297:10): [True: 0, False: 0]
  ------------------
  298|      0|        goto out;
  299|      0|    }
  300|  2.54k|  }
  301|  2.56k|  if(ssl->cert_blob) {
  ------------------
  |  Branch (301:6): [True: 0, False: 2.56k]
  ------------------
  302|      0|    result = cf_ssl_peer_key_add_hash(&buf, "CertBlob", ssl->cert_blob);
  303|      0|    if(result)
  ------------------
  |  Branch (303:8): [True: 0, False: 0]
  ------------------
  304|      0|      goto out;
  305|      0|  }
  306|  2.56k|  if(ssl->pinned_key && ssl->pinned_key[0]) {
  ------------------
  |  Branch (306:6): [True: 4, False: 2.56k]
  |  Branch (306:25): [True: 2, False: 2]
  ------------------
  307|      2|    result = curlx_dyn_addf(&buf, ":Pinned-%s", ssl->pinned_key);
  308|      2|    if(result)
  ------------------
  |  Branch (308:8): [True: 1, False: 1]
  ------------------
  309|      1|      goto out;
  310|      2|  }
  311|       |
  312|  2.56k|  result = cf_ssl_peer_key_add_mtls(&buf, ssl, &is_local);
  313|  2.56k|  if(result)
  ------------------
  |  Branch (313:6): [True: 4, False: 2.56k]
  ------------------
  314|      4|    goto out;
  315|  2.56k|#ifdef USE_TLS_SRP
  316|  2.56k|  if(ssl->username || ssl->password) {
  ------------------
  |  Branch (316:6): [True: 5, False: 2.55k]
  |  Branch (316:23): [True: 1, False: 2.55k]
  ------------------
  317|      6|    result = curlx_dyn_add(&buf, ":SRP-AUTH");
  318|      6|    if(result)
  ------------------
  |  Branch (318:8): [True: 0, False: 6]
  ------------------
  319|      0|      goto out;
  320|      6|  }
  321|  2.56k|#endif
  322|       |
  323|  2.56k|  if(!tls_id || !tls_id[0]) {
  ------------------
  |  Branch (323:6): [True: 0, False: 2.56k]
  |  Branch (323:17): [True: 0, False: 2.56k]
  ------------------
  324|      0|    result = CURLE_FAILED_INIT;
  325|      0|    goto out;
  326|      0|  }
  327|  2.56k|  result = curlx_dyn_addf(&buf, ":IMPL-%s", tls_id);
  328|  2.56k|  if(result)
  ------------------
  |  Branch (328:6): [True: 1, False: 2.56k]
  ------------------
  329|      1|    goto out;
  330|       |
  331|  2.56k|  result = curlx_dyn_addf(&buf, is_local ?
  ------------------
  |  Branch (331:33): [True: 181, False: 2.38k]
  ------------------
  332|  2.38k|                          CURL_SSLS_LOCAL_SUFFIX : CURL_SSLS_GLOBAL_SUFFIX);
  ------------------
  |  |  169|    181|#define CURL_SSLS_LOCAL_SUFFIX     ":L"
  ------------------
                                        CURL_SSLS_LOCAL_SUFFIX : CURL_SSLS_GLOBAL_SUFFIX);
  ------------------
  |  |  170|  2.38k|#define CURL_SSLS_GLOBAL_SUFFIX    ":G"
  ------------------
  333|  2.56k|  if(result)
  ------------------
  |  Branch (333:6): [True: 1, False: 2.56k]
  ------------------
  334|      1|    goto out;
  335|       |
  336|  2.56k|  *ppeer_key = curlx_dyn_take(&buf, &key_len);
  337|       |  /* we added printable char, and dynbuf always null-terminates, no need
  338|       |   * to track length */
  339|       |
  340|  2.57k|out:
  341|  2.57k|  curlx_dyn_free(&buf);
  342|  2.57k|  return result;
  343|  2.56k|}
Curl_ssl_peer_key_make:
  349|  2.57k|{
  350|  2.57k|  struct ssl_primary_config *ssl = Curl_ssl_cf_get_primary_config(cf);
  351|  2.57k|  return Curl_ssl_peer_key_build(ssl, peer, cf->conn->via_peer, tls_id,
  352|  2.57k|                                 ppeer_key);
  353|  2.57k|}
Curl_ssl_session_destroy:
  441|  1.76k|{
  442|  1.76k|  if(s) {
  ------------------
  |  Branch (442:6): [True: 0, False: 1.76k]
  ------------------
  443|       |    /* if in the list, the list destructor takes care of it */
  444|      0|    if(Curl_node_llist(&s->list))
  ------------------
  |  Branch (444:8): [True: 0, False: 0]
  ------------------
  445|      0|      Curl_node_remove(&s->list);
  446|      0|    else {
  447|       |      cf_ssl_scache_session_ldestroy(NULL, s);
  448|      0|    }
  449|      0|  }
  450|  1.76k|}
Curl_ssl_scache_create:
  594|  17.2k|{
  595|  17.2k|  struct Curl_ssl_scache *scache;
  596|  17.2k|  struct Curl_ssl_scache_peer *peers;
  597|  17.2k|  size_t i;
  598|       |
  599|  17.2k|  *pscache = NULL;
  600|  17.2k|  peers = curlx_calloc(max_peers, sizeof(*peers));
  ------------------
  |  | 1480|  17.2k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  601|  17.2k|  if(!peers)
  ------------------
  |  Branch (601:6): [True: 0, False: 17.2k]
  ------------------
  602|      0|    return CURLE_OUT_OF_MEMORY;
  603|       |
  604|  17.2k|  scache = curlx_calloc(1, sizeof(*scache));
  ------------------
  |  | 1480|  17.2k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  605|  17.2k|  if(!scache) {
  ------------------
  |  Branch (605:6): [True: 0, False: 17.2k]
  ------------------
  606|      0|    curlx_free(peers);
  ------------------
  |  | 1483|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  607|      0|    return CURLE_OUT_OF_MEMORY;
  608|      0|  }
  609|       |
  610|  17.2k|  scache->magic = CURL_SCACHE_MAGIC;
  ------------------
  |  |   67|  17.2k|#define CURL_SCACHE_MAGIC 0x000e1551
  ------------------
  611|  17.2k|  scache->default_lifetime_secs = (24 * 60 * 60); /* 1 day */
  612|  17.2k|  scache->peer_count = max_peers;
  613|  17.2k|  scache->peers = peers;
  614|  17.2k|  scache->age = 1;
  615|   447k|  for(i = 0; i < scache->peer_count; ++i) {
  ------------------
  |  Branch (615:14): [True: 430k, False: 17.2k]
  ------------------
  616|   430k|    scache->peers[i].max_sessions = max_sessions_per_peer;
  617|   430k|    Curl_llist_init(&scache->peers[i].sessions,
  618|   430k|                    cf_ssl_scache_session_ldestroy);
  619|   430k|  }
  620|       |
  621|  17.2k|  *pscache = scache;
  622|  17.2k|  return CURLE_OK;
  623|  17.2k|}
Curl_ssl_scache_destroy:
  626|  17.2k|{
  627|  17.2k|  if(GOOD_SCACHE(scache)) {
  ------------------
  |  |   69|  17.2k|#define GOOD_SCACHE(x) ((x) && (x)->magic == CURL_SCACHE_MAGIC)
  |  |  ------------------
  |  |  |  |   67|  17.2k|#define CURL_SCACHE_MAGIC 0x000e1551
  |  |  ------------------
  |  |  |  Branch (69:25): [True: 17.2k, False: 0]
  |  |  |  Branch (69:32): [True: 17.2k, False: 0]
  |  |  ------------------
  ------------------
  628|  17.2k|    size_t i;
  629|  17.2k|    scache->magic = 0;
  630|   447k|    for(i = 0; i < scache->peer_count; ++i) {
  ------------------
  |  Branch (630:16): [True: 430k, False: 17.2k]
  ------------------
  631|   430k|      cf_ssl_scache_clear_peer(&scache->peers[i]);
  632|   430k|    }
  633|  17.2k|    curlx_free(scache->peers);
  ------------------
  |  | 1483|  17.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  634|  17.2k|    curlx_free(scache);
  ------------------
  |  | 1483|  17.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  635|  17.2k|  }
  636|  17.2k|}
Curl_ssl_scache_use:
  639|  1.77k|{
  640|  1.77k|  if(cf_ssl_scache_get(data)) {
  ------------------
  |  Branch (640:6): [True: 1.77k, False: 0]
  ------------------
  641|  1.77k|    struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data);
  642|  1.77k|    return ssl_config ? ssl_config->primary.cache_session : FALSE;
  ------------------
  |  | 1058|  1.77k|#define FALSE false
  ------------------
  |  Branch (642:12): [True: 1.77k, False: 0]
  ------------------
  643|  1.77k|  }
  644|      0|  return FALSE;
  ------------------
  |  | 1058|      0|#define FALSE false
  ------------------
  645|  1.77k|}
Curl_ssl_scache_lock:
  649|  1.76k|{
  650|  1.76k|  struct Curl_ssl_scache *scache = cf_ssl_scache_get(data);
  651|  1.76k|  if(scache) {
  ------------------
  |  Branch (651:6): [True: 1.76k, False: 0]
  ------------------
  652|  1.76k|    if(CURL_SHARE_ssl_scache(data))
  ------------------
  |  |   85|  1.76k|  ((data)->share &&                                                \
  |  |  ------------------
  |  |  |  Branch (85:4): [True: 0, False: 1.76k]
  |  |  ------------------
  |  |   86|  1.76k|   ((data)->share->specifier & (1 << CURL_LOCK_DATA_SSL_SESSION)))
  |  |  ------------------
  |  |  |  Branch (86:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  653|      0|      Curl_share_lock(data, CURL_LOCK_DATA_SSL_SESSION,
  654|      0|                      CURL_LOCK_ACCESS_SINGLE);
  655|  1.76k|    DEBUGASSERT(!scache->is_locked);
  ------------------
  |  | 1081|  1.76k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (655:5): [True: 0, False: 1.76k]
  |  Branch (655:5): [True: 1.76k, False: 0]
  ------------------
  656|  1.76k|    scache->is_locked = TRUE;
  ------------------
  |  | 1055|  1.76k|#define TRUE true
  ------------------
  657|  1.76k|  }
  658|  1.76k|}
Curl_ssl_scache_unlock:
  662|  1.76k|{
  663|  1.76k|  struct Curl_ssl_scache *scache = cf_ssl_scache_get(data);
  664|  1.76k|  if(scache) {
  ------------------
  |  Branch (664:6): [True: 1.76k, False: 0]
  ------------------
  665|  1.76k|    DEBUGASSERT(scache->is_locked);
  ------------------
  |  | 1081|  1.76k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (665:5): [True: 0, False: 1.76k]
  |  Branch (665:5): [True: 1.76k, False: 0]
  ------------------
  666|  1.76k|    scache->is_locked = FALSE;
  ------------------
  |  | 1058|  1.76k|#define FALSE false
  ------------------
  667|  1.76k|    if(CURL_SHARE_ssl_scache(data))
  ------------------
  |  |   85|  1.76k|  ((data)->share &&                                                \
  |  |  ------------------
  |  |  |  Branch (85:4): [True: 0, False: 1.76k]
  |  |  ------------------
  |  |   86|  1.76k|   ((data)->share->specifier & (1 << CURL_LOCK_DATA_SSL_SESSION)))
  |  |  ------------------
  |  |  |  Branch (86:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  668|      0|      Curl_share_unlock(data, CURL_LOCK_DATA_SSL_SESSION);
  669|  1.76k|  }
  670|  1.76k|}
Curl_ssl_scache_return:
  945|  1.76k|{
  946|       |  /* See RFC 8446 C.4:
  947|       |   * "Clients SHOULD NOT reuse a ticket for multiple connections." */
  948|  1.76k|  if(s && s->ietf_tls_id < 0x304)
  ------------------
  |  Branch (948:6): [True: 0, False: 1.76k]
  |  Branch (948:11): [True: 0, False: 0]
  ------------------
  949|      0|    (void)Curl_ssl_scache_put(cf, data, ssl_peer_key, s);
  950|  1.76k|  else
  951|  1.76k|    Curl_ssl_session_destroy(s);
  952|  1.76k|}
Curl_ssl_scache_take:
  958|  1.76k|{
  959|  1.76k|  struct Curl_ssl_scache *scache = cf_ssl_scache_get(data);
  960|  1.76k|  struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf);
  961|  1.76k|  struct Curl_ssl_scache_peer *peer = NULL;
  962|  1.76k|  struct Curl_llist_node *n;
  963|  1.76k|  struct Curl_ssl_session *s = NULL;
  964|  1.76k|  CURLcode result;
  965|       |
  966|  1.76k|  *ps = NULL;
  967|  1.76k|  if(!scache)
  ------------------
  |  Branch (967:6): [True: 0, False: 1.76k]
  ------------------
  968|      0|    return CURLE_OK;
  969|       |
  970|  1.76k|  Curl_ssl_scache_lock(data);
  971|  1.76k|  result = cf_ssl_find_peer_by_key(data, scache, ssl_peer_key, conn_config,
  972|  1.76k|                                   &peer);
  973|  1.76k|  if(!result && peer) {
  ------------------
  |  Branch (973:6): [True: 1.76k, False: 0]
  |  Branch (973:17): [True: 0, False: 1.76k]
  ------------------
  974|      0|    cf_scache_peer_remove_expired(peer, (curl_off_t)time(NULL));
  975|      0|    n = Curl_llist_head(&peer->sessions);
  976|      0|    if(n) {
  ------------------
  |  Branch (976:8): [True: 0, False: 0]
  ------------------
  977|      0|      s = Curl_node_take_elem(n);
  978|      0|      (scache->age)++;            /* increase general age */
  979|      0|      peer->age = scache->age; /* set this as used in this age */
  980|      0|    }
  981|      0|  }
  982|  1.76k|  if(s) {
  ------------------
  |  Branch (982:6): [True: 0, False: 1.76k]
  ------------------
  983|      0|    *ps = s;
  984|      0|    CURL_TRC_SSLS(data, "took session for %s [proto=0x%x, "
  ------------------
  |  |  194|      0|  do {                                                    \
  |  |  195|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  196|      0|      Curl_trc_ssls(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (196:27): [True: 0, False: 0]
  |  |  ------------------
  |  |  197|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (197:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  985|      0|                  "alpn=%s, earlydata=%zu, quic_tp=%s], %zu sessions remain",
  986|      0|                  ssl_peer_key, s->ietf_tls_id, s->alpn,
  987|      0|                  s->earlydata_max, s->quic_tp ? "yes" : "no",
  988|      0|                  Curl_llist_count(&peer->sessions));
  989|      0|  }
  990|  1.76k|  else {
  991|  1.76k|    CURL_TRC_SSLS(data, "no cached session for %s", ssl_peer_key);
  ------------------
  |  |  194|  1.76k|  do {                                                    \
  |  |  195|  1.76k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) \
  |  |  ------------------
  |  |  |  |  326|  1.76k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  3.53k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 1.76k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.76k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  3.53k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.76k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  196|  1.76k|      Curl_trc_ssls(data, __VA_ARGS__);                   \
  |  |  197|  1.76k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (197:11): [Folded, False: 1.76k]
  |  |  ------------------
  ------------------
  992|  1.76k|  }
  993|  1.76k|  Curl_ssl_scache_unlock(data);
  994|  1.76k|  return result;
  995|  1.76k|}
vtls_scache.c:cf_ssl_peer_key_add_path:
   75|  10.2k|{
   76|  10.2k|  if(path && path[0]) {
  ------------------
  |  Branch (76:6): [True: 7.27k, False: 2.93k]
  |  Branch (76:14): [True: 7.20k, False: 61]
  ------------------
   77|       |    /* We try to add absolute paths, so that the session key can stay valid
   78|       |     * when used in another process with different CWD. When a path does not
   79|       |     * exist, this does not work. Then, we add the path as is. */
   80|       |#ifdef _WIN32
   81|       |    char abspath[_MAX_PATH];
   82|       |    if(_fullpath(abspath, path, _MAX_PATH))
   83|       |      return curlx_dyn_addf(buf, ":%s-%s", name, abspath);
   84|       |    *is_local = TRUE;
   85|       |#elif defined(HAVE_REALPATH)
   86|  7.20k|    if(path[0] != '/') {
  ------------------
  |  Branch (86:8): [True: 200, False: 7.00k]
  ------------------
   87|    200|      char *abspath = realpath(path, NULL);
   88|    200|      if(abspath) {
  ------------------
  |  Branch (88:10): [True: 9, False: 191]
  ------------------
   89|      9|        CURLcode result = curlx_dyn_addf(buf, ":%s-%s", name, abspath);
   90|       |        /* !checksrc! disable BANNEDFUNC 1 */
   91|      9|        free(abspath); /* allocated by libc, free without memdebug */
   92|      9|        return result;
   93|      9|      }
   94|    191|      *is_local = TRUE;
  ------------------
  |  | 1055|    191|#define TRUE true
  ------------------
   95|    191|    }
   96|  7.20k|#endif
   97|  7.20k|    return curlx_dyn_addf(buf, ":%s-%s", name, path);
   98|  7.20k|  }
   99|  2.99k|  return CURLE_OK;
  100|  10.2k|}
vtls_scache.c:cf_ssl_peer_key_add_mtls:
  130|  2.56k|{
  131|  2.56k|  CURLcode result = CURLE_OK;
  132|  2.56k|  if(ssl->clientcert && ssl->clientcert[0]) {
  ------------------
  |  Branch (132:6): [True: 12, False: 2.55k]
  |  Branch (132:25): [True: 8, False: 4]
  ------------------
  133|      8|    result = cf_ssl_peer_key_add_path(buf, "CCERT", ssl->clientcert, is_local);
  134|      8|    if(result)
  ------------------
  |  Branch (134:8): [True: 1, False: 7]
  ------------------
  135|      1|      goto out;
  136|      8|  }
  137|  2.56k|  if(ssl->key && ssl->key[0]) {
  ------------------
  |  Branch (137:6): [True: 6, False: 2.56k]
  |  Branch (137:18): [True: 5, False: 1]
  ------------------
  138|      5|    result = cf_ssl_peer_key_add_path(buf, "KEY", ssl->key, is_local);
  139|      5|    if(result)
  ------------------
  |  Branch (139:8): [True: 1, False: 4]
  ------------------
  140|      1|      goto out;
  141|      5|  }
  142|  2.56k|  if(ssl->key_blob) {
  ------------------
  |  Branch (142:6): [True: 0, False: 2.56k]
  ------------------
  143|      0|    result = cf_ssl_peer_key_add_hash(buf, "KEYBlob", ssl->key_blob);
  144|      0|    if(result)
  ------------------
  |  Branch (144:8): [True: 0, False: 0]
  ------------------
  145|      0|      goto out;
  146|      0|  }
  147|  2.56k|  if(ssl->cert_type && ssl->cert_type[0]) {
  ------------------
  |  Branch (147:6): [True: 14, False: 2.55k]
  |  Branch (147:24): [True: 13, False: 1]
  ------------------
  148|     13|    size_t i;
  149|     13|    result = curlx_dyn_add(buf, ":CT-");
  150|  10.3k|    for(i = 0; !result && ssl->cert_type[i]; i++) {
  ------------------
  |  Branch (150:16): [True: 10.3k, False: 1]
  |  Branch (150:27): [True: 10.3k, False: 12]
  ------------------
  151|  10.3k|      char c = Curl_raw_toupper(ssl->cert_type[i]);
  152|  10.3k|      result = curlx_dyn_addn(buf, &c, 1);
  153|  10.3k|    }
  154|     13|    if(result)
  ------------------
  |  Branch (154:8): [True: 1, False: 12]
  ------------------
  155|      1|      goto out;
  156|     13|  }
  157|  2.56k|  if(ssl->key_type && ssl->key_type[0]) {
  ------------------
  |  Branch (157:6): [True: 12, False: 2.55k]
  |  Branch (157:23): [True: 11, False: 1]
  ------------------
  158|     11|    size_t i;
  159|     11|    result = curlx_dyn_add(buf, ":KT-");
  160|  10.3k|    for(i = 0; !result && ssl->key_type[i]; i++) {
  ------------------
  |  Branch (160:16): [True: 10.3k, False: 1]
  |  Branch (160:27): [True: 10.3k, False: 10]
  ------------------
  161|  10.3k|      char c = Curl_raw_toupper(ssl->key_type[i]);
  162|  10.3k|      result = curlx_dyn_addn(buf, &c, 1);
  163|  10.3k|    }
  164|     11|  }
  165|  2.56k|out:
  166|  2.56k|  return result;
  167|  2.56k|}
vtls_scache.c:cf_ssl_scache_clear_peer:
  453|   430k|{
  454|   430k|  Curl_llist_destroy(&peer->sessions, NULL);
  455|   430k|  if(peer->sobj) {
  ------------------
  |  Branch (455:6): [True: 0, False: 430k]
  ------------------
  456|      0|    DEBUGASSERT(peer->sobj_free);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (456:5): [True: 0, False: 0]
  |  Branch (456:5): [True: 0, False: 0]
  ------------------
  457|      0|    if(peer->sobj_free)
  ------------------
  |  Branch (457:8): [True: 0, False: 0]
  ------------------
  458|      0|      peer->sobj_free(peer->sobj);
  459|      0|    peer->sobj = NULL;
  460|      0|  }
  461|   430k|  peer->sobj_free = NULL;
  462|   430k|  curlx_safefree(peer->clientcert);
  ------------------
  |  | 1327|   430k|  do {                      \
  |  | 1328|   430k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|   430k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|   430k|    (ptr) = NULL;           \
  |  | 1330|   430k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 430k]
  |  |  ------------------
  ------------------
  463|   430k|  curlx_safefree(peer->key_passwd);
  ------------------
  |  | 1327|   430k|  do {                      \
  |  | 1328|   430k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|   430k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|   430k|    (ptr) = NULL;           \
  |  | 1330|   430k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 430k]
  |  |  ------------------
  ------------------
  464|   430k|#ifdef USE_TLS_SRP
  465|   430k|  curlx_safefree(peer->srp_username);
  ------------------
  |  | 1327|   430k|  do {                      \
  |  | 1328|   430k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|   430k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|   430k|    (ptr) = NULL;           \
  |  | 1330|   430k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 430k]
  |  |  ------------------
  ------------------
  466|   430k|  curlx_safefree(peer->srp_password);
  ------------------
  |  | 1327|   430k|  do {                      \
  |  | 1328|   430k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|   430k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|   430k|    (ptr) = NULL;           \
  |  | 1330|   430k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 430k]
  |  |  ------------------
  ------------------
  467|   430k|#endif
  468|   430k|  curlx_safefree(peer->ssl_peer_key);
  ------------------
  |  | 1327|   430k|  do {                      \
  |  | 1328|   430k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1483|   430k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1329|   430k|    (ptr) = NULL;           \
  |  | 1330|   430k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1330:11): [Folded, False: 430k]
  |  |  ------------------
  ------------------
  469|   430k|  peer->age = 0;
  470|       |  peer->hmac_set = FALSE;
  ------------------
  |  | 1058|   430k|#define FALSE false
  ------------------
  471|   430k|}
vtls_scache.c:cf_ssl_scache_get:
  365|  7.07k|{
  366|  7.07k|  struct Curl_ssl_scache *scache = NULL;
  367|       |  /* If a share is present, its ssl_scache has preference over the multi */
  368|  7.07k|  if(data->share && data->share->ssl_scache)
  ------------------
  |  Branch (368:6): [True: 0, False: 7.07k]
  |  Branch (368:21): [True: 0, False: 0]
  ------------------
  369|      0|    scache = data->share->ssl_scache;
  370|  7.07k|  else if(data->multi && data->multi->ssl_scache)
  ------------------
  |  Branch (370:11): [True: 7.07k, False: 0]
  |  Branch (370:26): [True: 7.07k, False: 0]
  ------------------
  371|  7.07k|    scache = data->multi->ssl_scache;
  372|  7.07k|  if(scache && !GOOD_SCACHE(scache)) {
  ------------------
  |  |   69|  7.07k|#define GOOD_SCACHE(x) ((x) && (x)->magic == CURL_SCACHE_MAGIC)
  |  |  ------------------
  |  |  |  |   67|  7.07k|#define CURL_SCACHE_MAGIC 0x000e1551
  |  |  ------------------
  |  |  |  Branch (69:25): [True: 7.07k, False: 0]
  |  |  |  Branch (69:32): [True: 7.07k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (372:6): [True: 7.07k, False: 0]
  ------------------
  373|      0|    failf(data, "transfer would use an invalid scache at %p, denied",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  374|      0|          (void *)scache);
  375|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1081|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (375:5): [Folded, False: 0]
  |  Branch (375:5): [Folded, False: 0]
  ------------------
  376|      0|    return NULL;
  377|      0|  }
  378|  7.07k|  return scache;
  379|  7.07k|}
vtls_scache.c:cf_ssl_find_peer_by_key:
  701|  1.76k|{
  702|  1.76k|  size_t i, peer_key_len = 0;
  703|  1.76k|  CURLcode result = CURLE_OK;
  704|       |
  705|  1.76k|  *ppeer = NULL;
  706|  1.76k|  if(!GOOD_SCACHE(scache)) {
  ------------------
  |  |   69|  1.76k|#define GOOD_SCACHE(x) ((x) && (x)->magic == CURL_SCACHE_MAGIC)
  |  |  ------------------
  |  |  |  |   67|  1.76k|#define CURL_SCACHE_MAGIC 0x000e1551
  |  |  ------------------
  |  |  |  Branch (69:25): [True: 1.76k, False: 0]
  |  |  |  Branch (69:32): [True: 1.76k, False: 0]
  |  |  ------------------
  ------------------
  707|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  708|      0|  }
  709|       |
  710|  1.76k|  CURL_TRC_SSLS(data, "find peer slot for %s among %zu slots",
  ------------------
  |  |  194|  1.76k|  do {                                                    \
  |  |  195|  1.76k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) \
  |  |  ------------------
  |  |  |  |  326|  1.76k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  3.53k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 1.76k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.76k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  3.53k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.76k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  196|  1.76k|      Curl_trc_ssls(data, __VA_ARGS__);                   \
  |  |  197|  1.76k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (197:11): [Folded, False: 1.76k]
  |  |  ------------------
  ------------------
  711|  1.76k|                ssl_peer_key, scache->peer_count);
  712|       |
  713|       |  /* check for entries with known peer_key */
  714|  45.9k|  for(i = 0; scache && i < scache->peer_count; i++) {
  ------------------
  |  Branch (714:14): [True: 45.9k, False: 0]
  |  Branch (714:24): [True: 44.1k, False: 1.76k]
  ------------------
  715|  44.1k|    if(scache->peers[i].ssl_peer_key &&
  ------------------
  |  Branch (715:8): [True: 0, False: 44.1k]
  ------------------
  716|      0|       curl_strequal(ssl_peer_key, scache->peers[i].ssl_peer_key) &&
  ------------------
  |  Branch (716:8): [True: 0, False: 0]
  ------------------
  717|      0|       cf_ssl_scache_match_auth(&scache->peers[i], conn_config)) {
  ------------------
  |  Branch (717:8): [True: 0, False: 0]
  ------------------
  718|       |      /* yes, we have a cached session for this! */
  719|      0|      *ppeer = &scache->peers[i];
  720|      0|      goto out;
  721|      0|    }
  722|  44.1k|  }
  723|       |  /* check for entries with HMAC set but no known peer_key */
  724|  45.9k|  for(i = 0; scache && i < scache->peer_count; i++) {
  ------------------
  |  Branch (724:14): [True: 45.9k, False: 0]
  |  Branch (724:24): [True: 44.1k, False: 1.76k]
  ------------------
  725|  44.1k|    if(!scache->peers[i].ssl_peer_key &&
  ------------------
  |  Branch (725:8): [True: 44.1k, False: 0]
  ------------------
  726|  44.1k|       scache->peers[i].hmac_set &&
  ------------------
  |  Branch (726:8): [True: 0, False: 44.1k]
  ------------------
  727|      0|       cf_ssl_scache_match_auth(&scache->peers[i], conn_config)) {
  ------------------
  |  Branch (727:8): [True: 0, False: 0]
  ------------------
  728|       |      /* possible entry with unknown peer_key, check hmac */
  729|      0|      unsigned char my_hmac[CURL_SHA256_DIGEST_LENGTH];
  730|      0|      if(!peer_key_len) /* we are lazy */
  ------------------
  |  Branch (730:10): [True: 0, False: 0]
  ------------------
  731|      0|        peer_key_len = strlen(ssl_peer_key);
  732|      0|      result = Curl_hmacit(&Curl_HMAC_SHA256,
  733|      0|                           scache->peers[i].key_salt,
  734|      0|                           sizeof(scache->peers[i].key_salt),
  735|      0|                           (const unsigned char *)ssl_peer_key,
  736|      0|                           peer_key_len,
  737|      0|                           my_hmac);
  738|      0|      if(result)
  ------------------
  |  Branch (738:10): [True: 0, False: 0]
  ------------------
  739|      0|        goto out;
  740|      0|      if(!memcmp(scache->peers[i].key_hmac, my_hmac, sizeof(my_hmac))) {
  ------------------
  |  Branch (740:10): [True: 0, False: 0]
  ------------------
  741|       |        /* remember peer_key for future lookups */
  742|      0|        CURL_TRC_SSLS(data, "peer entry %zu key recovered: %s",
  ------------------
  |  |  194|      0|  do {                                                    \
  |  |  195|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  196|      0|      Curl_trc_ssls(data, __VA_ARGS__);                   \
  |  |  197|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (197:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  743|      0|                      i, ssl_peer_key);
  744|      0|        scache->peers[i].ssl_peer_key = curlx_strdup(ssl_peer_key);
  ------------------
  |  | 1477|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  745|      0|        if(!scache->peers[i].ssl_peer_key) {
  ------------------
  |  Branch (745:12): [True: 0, False: 0]
  ------------------
  746|      0|          result = CURLE_OUT_OF_MEMORY;
  747|      0|          goto out;
  748|      0|        }
  749|      0|        cf_ssl_cache_peer_update(&scache->peers[i]);
  750|      0|        *ppeer = &scache->peers[i];
  751|      0|        goto out;
  752|      0|      }
  753|      0|    }
  754|  44.1k|  }
  755|  1.76k|  CURL_TRC_SSLS(data, "peer not found for %s", ssl_peer_key);
  ------------------
  |  |  194|  1.76k|  do {                                                    \
  |  |  195|  1.76k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) \
  |  |  ------------------
  |  |  |  |  326|  1.76k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  3.53k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:4): [True: 1.76k, False: 0]
  |  |  |  |  |  |  |  Branch (319:14): [True: 0, False: 1.76k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  3.53k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (320:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  321|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (321:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.76k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  196|  1.76k|      Curl_trc_ssls(data, __VA_ARGS__);                   \
  |  |  197|  1.76k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (197:11): [Folded, False: 1.76k]
  |  |  ------------------
  ------------------
  756|  1.76k|out:
  757|  1.76k|  return result;
  758|  1.76k|}

freea:
  107|    254|{
  108|       |  /* Check argument.  */
  109|    254|  uintptr_t u = (uintptr_t) p;
  110|    254|  if (u & (sa_alignment_max - 1))
  ------------------
  |  Branch (110:7): [True: 0, False: 254]
  ------------------
  111|      0|    {
  112|       |      /* p was not the result of a malloca() call.  Invalid argument.  */
  113|      0|      abort ();
  114|      0|    }
  115|       |  /* Determine whether p was a non-NULL pointer returned by mmalloca().  */
  116|    254|  if (u & sa_alignment_max)
  ------------------
  |  Branch (116:7): [True: 0, False: 254]
  ------------------
  117|      0|    {
  118|      0|      char *cp = p;
  119|      0|      small_t *sp = p;
  120|       |# if defined __CHERI_PURE_CAPABILITY__
  121|       |      void *mem = (void *) sp[-1];
  122|       |# else
  123|      0|      void *mem = cp - sp[-1];
  124|      0|# endif
  125|      0|      free (mem);
  126|      0|    }
  127|    254|}

idn2_lookup_ul:
  656|    254|{
  657|    254|  uint8_t *utf8src = NULL;
  658|    254|  int rc;
  659|       |
  660|    254|  if (src)
  ------------------
  |  Branch (660:7): [True: 254, False: 0]
  ------------------
  661|    254|    {
  662|    254|      const char *encoding = locale_charset ();
  663|       |
  664|    254|      utf8src = u8_strconv_from_encoding (src, encoding, iconveh_error);
  665|       |
  666|    254|      if (!utf8src)
  ------------------
  |  Branch (666:11): [True: 254, False: 0]
  ------------------
  667|    254|	{
  668|    254|	  if (errno == ENOMEM)
  ------------------
  |  Branch (668:8): [True: 0, False: 254]
  ------------------
  669|      0|	    return IDN2_MALLOC;
  670|    254|	  return IDN2_ICONV_FAIL;
  671|    254|	}
  672|    254|    }
  673|       |
  674|      0|  rc = idn2_lookup_u8 (utf8src, (uint8_t **) lookupname,
  675|      0|		       flags | IDN2_NFC_INPUT);
  676|       |
  677|      0|  free (utf8src);
  678|       |
  679|      0|  return rc;
  680|    254|}

idn2_check_version:
   62|    127|{
   63|    127|  if (!req_version || strverscmp (req_version, IDN2_VERSION) <= 0)
  ------------------
  |  |  119|    127|# define IDN2_VERSION "2.3.8"
  ------------------
  |  Branch (63:7): [True: 0, False: 127]
  |  Branch (63:23): [True: 127, False: 0]
  ------------------
   64|    127|    return IDN2_VERSION;
  ------------------
  |  |  119|    127|# define IDN2_VERSION "2.3.8"
  ------------------
   65|       |
   66|      0|  return NULL;
   67|    127|}

c_tolower:
  338|  8.63k|{
  339|  8.63k|  switch (c)
  340|  8.63k|    {
  341|  6.09k|    _C_CTYPE_UPPER:
  ------------------
  |  |  148|      0|#define _C_CTYPE_UPPER _C_CTYPE_LOWER_N ('A' - 'a')
  |  |  ------------------
  |  |  |  |  122|  1.27k|   _C_CTYPE_LOWER_A_THRU_F_N(N): \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|    762|   case 'a' + (N): case 'b' + (N): case 'c' + (N): case 'd' + (N): \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (119:4): [True: 762, False: 7.87k]
  |  |  |  |  |  |  |  Branch (119:20): [True: 0, False: 8.63k]
  |  |  |  |  |  |  |  Branch (119:36): [True: 0, False: 8.63k]
  |  |  |  |  |  |  |  Branch (119:52): [True: 0, False: 8.63k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  120|  1.27k|   case 'e' + (N): case 'f' + (N)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (120:4): [True: 0, False: 8.63k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (122:4): [True: 508, False: 8.12k]
  |  |  |  |  ------------------
  |  |  |  |  123|  1.77k|   case 'g' + (N): case 'h' + (N): case 'i' + (N): case 'j' + (N): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (123:4): [True: 0, False: 8.63k]
  |  |  |  |  |  Branch (123:20): [True: 0, False: 8.63k]
  |  |  |  |  |  Branch (123:36): [True: 508, False: 8.12k]
  |  |  |  |  |  Branch (123:52): [True: 0, False: 8.63k]
  |  |  |  |  ------------------
  |  |  |  |  124|  2.79k|   case 'k' + (N): case 'l' + (N): case 'm' + (N): case 'n' + (N): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:4): [True: 0, False: 8.63k]
  |  |  |  |  |  Branch (124:20): [True: 508, False: 8.12k]
  |  |  |  |  |  Branch (124:36): [True: 0, False: 8.63k]
  |  |  |  |  |  Branch (124:52): [True: 508, False: 8.12k]
  |  |  |  |  ------------------
  |  |  |  |  125|  3.30k|   case 'o' + (N): case 'p' + (N): case 'q' + (N): case 'r' + (N): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (125:4): [True: 0, False: 8.63k]
  |  |  |  |  |  Branch (125:20): [True: 0, False: 8.63k]
  |  |  |  |  |  Branch (125:36): [True: 0, False: 8.63k]
  |  |  |  |  |  Branch (125:52): [True: 508, False: 8.12k]
  |  |  |  |  ------------------
  |  |  |  |  126|  6.09k|   case 's' + (N): case 't' + (N): case 'u' + (N): case 'v' + (N): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (126:4): [True: 508, False: 8.12k]
  |  |  |  |  |  Branch (126:20): [True: 1.52k, False: 7.11k]
  |  |  |  |  |  Branch (126:36): [True: 762, False: 7.87k]
  |  |  |  |  |  Branch (126:52): [True: 0, False: 8.63k]
  |  |  |  |  ------------------
  |  |  |  |  127|  6.09k|   case 'w' + (N): case 'x' + (N): case 'y' + (N): case 'z' + (N)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (127:4): [True: 0, False: 8.63k]
  |  |  |  |  |  Branch (127:20): [True: 0, False: 8.63k]
  |  |  |  |  |  Branch (127:36): [True: 0, False: 8.63k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  342|  6.09k|      return c - 'A' + 'a';
  343|  2.54k|    default:
  ------------------
  |  Branch (343:5): [True: 2.54k, False: 6.09k]
  ------------------
  344|  2.54k|      return c;
  345|  8.63k|    }
  346|  8.63k|}
c_isupper:
  313|  2.03k|{
  314|  2.03k|  switch (c)
  315|  2.03k|    {
  316|  1.27k|    _C_CTYPE_UPPER:
  ------------------
  |  |  148|      0|#define _C_CTYPE_UPPER _C_CTYPE_LOWER_N ('A' - 'a')
  |  |  ------------------
  |  |  |  |  122|    254|   _C_CTYPE_LOWER_A_THRU_F_N(N): \
  |  |  |  |  ------------------
  |  |  |  |  |  |  119|      0|   case 'a' + (N): case 'b' + (N): case 'c' + (N): case 'd' + (N): \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (119:4): [True: 0, False: 2.03k]
  |  |  |  |  |  |  |  Branch (119:20): [True: 0, False: 2.03k]
  |  |  |  |  |  |  |  Branch (119:36): [True: 0, False: 2.03k]
  |  |  |  |  |  |  |  Branch (119:52): [True: 0, False: 2.03k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  120|    254|   case 'e' + (N): case 'f' + (N)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (120:4): [True: 0, False: 2.03k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (122:4): [True: 254, False: 1.77k]
  |  |  |  |  ------------------
  |  |  |  |  123|    254|   case 'g' + (N): case 'h' + (N): case 'i' + (N): case 'j' + (N): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (123:4): [True: 0, False: 2.03k]
  |  |  |  |  |  Branch (123:20): [True: 0, False: 2.03k]
  |  |  |  |  |  Branch (123:36): [True: 0, False: 2.03k]
  |  |  |  |  |  Branch (123:52): [True: 0, False: 2.03k]
  |  |  |  |  ------------------
  |  |  |  |  124|    254|   case 'k' + (N): case 'l' + (N): case 'm' + (N): case 'n' + (N): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:4): [True: 0, False: 2.03k]
  |  |  |  |  |  Branch (124:20): [True: 0, False: 2.03k]
  |  |  |  |  |  Branch (124:36): [True: 0, False: 2.03k]
  |  |  |  |  |  Branch (124:52): [True: 0, False: 2.03k]
  |  |  |  |  ------------------
  |  |  |  |  125|    254|   case 'o' + (N): case 'p' + (N): case 'q' + (N): case 'r' + (N): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (125:4): [True: 0, False: 2.03k]
  |  |  |  |  |  Branch (125:20): [True: 0, False: 2.03k]
  |  |  |  |  |  Branch (125:36): [True: 0, False: 2.03k]
  |  |  |  |  |  Branch (125:52): [True: 0, False: 2.03k]
  |  |  |  |  ------------------
  |  |  |  |  126|  1.27k|   case 's' + (N): case 't' + (N): case 'u' + (N): case 'v' + (N): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (126:4): [True: 0, False: 2.03k]
  |  |  |  |  |  Branch (126:20): [True: 254, False: 1.77k]
  |  |  |  |  |  Branch (126:36): [True: 762, False: 1.27k]
  |  |  |  |  |  Branch (126:52): [True: 0, False: 2.03k]
  |  |  |  |  ------------------
  |  |  |  |  127|  1.27k|   case 'w' + (N): case 'x' + (N): case 'y' + (N): case 'z' + (N)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (127:4): [True: 0, False: 2.03k]
  |  |  |  |  |  Branch (127:20): [True: 0, False: 2.03k]
  |  |  |  |  |  Branch (127:36): [True: 0, False: 2.03k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  317|  1.27k|      return true;
  318|    762|    default:
  ------------------
  |  Branch (318:5): [True: 762, False: 1.27k]
  ------------------
  319|       |      return false;
  320|  2.03k|    }
  321|  2.03k|}

c_strcasecmp:
   28|    508|{
   29|    508|  register const unsigned char *p1 = (const unsigned char *) s1;
   30|    508|  register const unsigned char *p2 = (const unsigned char *) s2;
   31|    508|  unsigned char c1, c2;
   32|       |
   33|    508|  if (p1 == p2)
  ------------------
  |  Branch (33:7): [True: 0, False: 508]
  ------------------
   34|      0|    return 0;
   35|       |
   36|    508|  do
   37|  4.31k|    {
   38|  4.31k|      c1 = c_tolower (*p1);
   39|  4.31k|      c2 = c_tolower (*p2);
   40|       |
   41|  4.31k|      if (c1 == '\0')
  ------------------
  |  Branch (41:11): [True: 254, False: 4.06k]
  ------------------
   42|    254|        break;
   43|       |
   44|  4.06k|      ++p1;
   45|  4.06k|      ++p2;
   46|  4.06k|    }
   47|  4.06k|  while (c1 == c2);
  ------------------
  |  Branch (47:10): [True: 3.81k, False: 254]
  ------------------
   48|       |
   49|    508|  if (UCHAR_MAX <= INT_MAX)
  ------------------
  |  Branch (49:7): [True: 508, Folded]
  ------------------
   50|    508|    return c1 - c2;
   51|      0|  else
   52|       |    /* On machines where 'char' and 'int' are types of the same size, the
   53|       |       difference of two 'unsigned char' values - including the sign bit -
   54|       |       doesn't fit in an 'int'.  */
   55|      0|    return _GL_CMP (c1, c2);
  ------------------
  |  | 1797|      0|#define _GL_CMP(n1, n2) (((n1) > (n2)) - ((n1) < (n2)))
  ------------------
   56|    508|}

u8-conv-from-enc.c:strcaseeq0:
  166|    254|{
  167|    254|  if (CASEEQ (s1[0], s20))
  ------------------
  |  |   40|    254|     (c_isupper (upper) ? ((other) & ~0x20) == (upper) : (other) == (upper))
  |  |  ------------------
  |  |  |  Branch (40:6): [True: 0, False: 254]
  |  |  |  Branch (40:7): [True: 254, False: 0]
  |  |  ------------------
  ------------------
  168|      0|    {
  169|      0|      if (s20 == 0)
  ------------------
  |  Branch (169:11): [True: 0, False: 0]
  ------------------
  170|      0|        return 1;
  171|      0|      else
  172|      0|        return strcaseeq1 (s1, s2, s21, s22, s23, s24, s25, s26, s27, s28);
  173|      0|    }
  174|    254|  else
  175|    254|    return 0;
  176|    254|}
striconveh.c:strcaseeq0:
  166|    508|{
  167|    508|  if (CASEEQ (s1[0], s20))
  ------------------
  |  |   40|    508|     (c_isupper (upper) ? ((other) & ~0x20) == (upper) : (other) == (upper))
  |  |  ------------------
  |  |  |  Branch (40:6): [True: 254, False: 254]
  |  |  |  Branch (40:7): [True: 508, False: 0]
  |  |  ------------------
  ------------------
  168|    254|    {
  169|    254|      if (s20 == 0)
  ------------------
  |  Branch (169:11): [True: 0, False: 254]
  ------------------
  170|      0|        return 1;
  171|    254|      else
  172|    254|        return strcaseeq1 (s1, s2, s21, s22, s23, s24, s25, s26, s27, s28);
  173|    254|    }
  174|    254|  else
  175|    254|    return 0;
  176|    508|}
striconveh.c:strcaseeq1:
  152|    254|{
  153|    254|  if (CASEEQ (s1[1], s21))
  ------------------
  |  |   40|    254|     (c_isupper (upper) ? ((other) & ~0x20) == (upper) : (other) == (upper))
  |  |  ------------------
  |  |  |  Branch (40:6): [True: 254, False: 0]
  |  |  |  Branch (40:7): [True: 254, False: 0]
  |  |  ------------------
  ------------------
  154|    254|    {
  155|    254|      if (s21 == 0)
  ------------------
  |  Branch (155:11): [True: 0, False: 254]
  ------------------
  156|      0|        return 1;
  157|    254|      else
  158|    254|        return strcaseeq2 (s1, s2, s22, s23, s24, s25, s26, s27, s28);
  159|    254|    }
  160|      0|  else
  161|      0|    return 0;
  162|    254|}
striconveh.c:strcaseeq2:
  138|    254|{
  139|    254|  if (CASEEQ (s1[2], s22))
  ------------------
  |  |   40|    254|     (c_isupper (upper) ? ((other) & ~0x20) == (upper) : (other) == (upper))
  |  |  ------------------
  |  |  |  Branch (40:6): [True: 254, False: 0]
  |  |  |  Branch (40:7): [True: 254, False: 0]
  |  |  ------------------
  ------------------
  140|    254|    {
  141|    254|      if (s22 == 0)
  ------------------
  |  Branch (141:11): [True: 0, False: 254]
  ------------------
  142|      0|        return 1;
  143|    254|      else
  144|    254|        return strcaseeq3 (s1, s2, s23, s24, s25, s26, s27, s28);
  145|    254|    }
  146|      0|  else
  147|      0|    return 0;
  148|    254|}
striconveh.c:strcaseeq3:
  124|    254|{
  125|    254|  if (CASEEQ (s1[3], s23))
  ------------------
  |  |   40|    254|     (c_isupper (upper) ? ((other) & ~0x20) == (upper) : (other) == (upper))
  |  |  ------------------
  |  |  |  Branch (40:6): [True: 254, False: 0]
  |  |  |  Branch (40:7): [True: 0, False: 254]
  |  |  ------------------
  ------------------
  126|    254|    {
  127|    254|      if (s23 == 0)
  ------------------
  |  Branch (127:11): [True: 0, False: 254]
  ------------------
  128|      0|        return 1;
  129|    254|      else
  130|    254|        return strcaseeq4 (s1, s2, s24, s25, s26, s27, s28);
  131|    254|    }
  132|      0|  else
  133|      0|    return 0;
  134|    254|}
striconveh.c:strcaseeq4:
  110|    254|{
  111|    254|  if (CASEEQ (s1[4], s24))
  ------------------
  |  |   40|    254|     (c_isupper (upper) ? ((other) & ~0x20) == (upper) : (other) == (upper))
  |  |  ------------------
  |  |  |  Branch (40:6): [True: 254, False: 0]
  |  |  |  Branch (40:7): [True: 0, False: 254]
  |  |  ------------------
  ------------------
  112|    254|    {
  113|    254|      if (s24 == 0)
  ------------------
  |  Branch (113:11): [True: 0, False: 254]
  ------------------
  114|      0|        return 1;
  115|    254|      else
  116|    254|        return strcaseeq5 (s1, s2, s25, s26, s27, s28);
  117|    254|    }
  118|      0|  else
  119|      0|    return 0;
  120|    254|}
striconveh.c:strcaseeq5:
   96|    254|{
   97|    254|  if (CASEEQ (s1[5], s25))
  ------------------
  |  |   40|    254|     (c_isupper (upper) ? ((other) & ~0x20) == (upper) : (other) == (upper))
  |  |  ------------------
  |  |  |  Branch (40:6): [True: 0, False: 254]
  |  |  |  Branch (40:7): [True: 0, False: 254]
  |  |  ------------------
  ------------------
   98|      0|    {
   99|      0|      if (s25 == 0)
  ------------------
  |  Branch (99:11): [True: 0, False: 0]
  ------------------
  100|      0|        return 1;
  101|      0|      else
  102|      0|        return strcaseeq6 (s1, s2, s26, s27, s28);
  103|      0|    }
  104|    254|  else
  105|    254|    return 0;
  106|    254|}

locale_charset:
  832|    254|{
  833|    254|  const char *codeset;
  834|       |
  835|       |  /* This function must be multithread-safe.  To achieve this without using
  836|       |     thread-local storage, we use a simple strcpy or memcpy to fill this static
  837|       |     buffer.  Filling it through, for example, strcpy + strcat would not be
  838|       |     guaranteed to leave the buffer's contents intact if another thread is
  839|       |     currently accessing it.  If necessary, the contents is first assembled in
  840|       |     a stack-allocated buffer.  */
  841|       |
  842|    254|#if HAVE_LANGINFO_CODESET || defined WINDOWS_NATIVE || defined OS2
  843|       |
  844|    254|# if HAVE_LANGINFO_CODESET
  845|       |
  846|       |  /* Most systems support nl_langinfo (CODESET) nowadays.  */
  847|    254|  codeset = nl_langinfo (CODESET);
  848|       |
  849|       |#  ifdef __CYGWIN__
  850|       |  /* Cygwin < 1.7 does not have locales.  nl_langinfo (CODESET) always
  851|       |     returns "US-ASCII".  Return the suffix of the locale name from the
  852|       |     environment variables (if present) or the codepage as a number.  */
  853|       |  if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
  854|       |    {
  855|       |      const char *locale;
  856|       |      static char resultbuf[2 + 10 + 1];
  857|       |
  858|       |      locale = getenv ("LC_ALL");
  859|       |      if (locale == NULL || locale[0] == '\0')
  860|       |        {
  861|       |          locale = getenv ("LC_CTYPE");
  862|       |          if (locale == NULL || locale[0] == '\0')
  863|       |            locale = getenv ("LANG");
  864|       |        }
  865|       |      if (locale != NULL && locale[0] != '\0')
  866|       |        {
  867|       |          /* If the locale name contains an encoding after the dot, return
  868|       |             it.  */
  869|       |          const char *dot = strchr (locale, '.');
  870|       |
  871|       |          if (dot != NULL)
  872|       |            {
  873|       |              const char *modifier;
  874|       |
  875|       |              dot++;
  876|       |              /* Look for the possible @... trailer and remove it, if any.  */
  877|       |              modifier = strchr (dot, '@');
  878|       |              if (modifier == NULL)
  879|       |                return dot;
  880|       |              if (modifier - dot < sizeof (resultbuf))
  881|       |                {
  882|       |                  /* This way of filling resultbuf is multithread-safe.  */
  883|       |                  memcpy (resultbuf, dot, modifier - dot);
  884|       |                  resultbuf [modifier - dot] = '\0';
  885|       |                  return resultbuf;
  886|       |                }
  887|       |            }
  888|       |        }
  889|       |
  890|       |      /* The Windows API has a function returning the locale's codepage as a
  891|       |         number: GetACP().  This encoding is used by Cygwin, unless the user
  892|       |         has set the environment variable CYGWIN=codepage:oem (which very few
  893|       |         people do).
  894|       |         Output directed to console windows needs to be converted (to
  895|       |         GetOEMCP() if the console is using a raster font, or to
  896|       |         GetConsoleOutputCP() if it is using a TrueType font).  Cygwin does
  897|       |         this conversion transparently (see winsup/cygwin/fhandler_console.cc),
  898|       |         converting to GetConsoleOutputCP().  This leads to correct results,
  899|       |         except when SetConsoleOutputCP has been called and a raster font is
  900|       |         in use.  */
  901|       |      {
  902|       |        char buf[2 + 10 + 1];
  903|       |
  904|       |        sprintf (buf, "CP%u", GetACP ());
  905|       |        strcpy (resultbuf, buf);
  906|       |        codeset = resultbuf;
  907|       |      }
  908|       |    }
  909|       |#  endif
  910|       |
  911|    254|  if (codeset == NULL)
  ------------------
  |  Branch (911:7): [True: 0, False: 254]
  ------------------
  912|       |    /* The canonical name cannot be determined.  */
  913|      0|    codeset = "";
  914|       |
  915|       |# elif defined WINDOWS_NATIVE
  916|       |
  917|       |  char buf[2 + 10 + 1];
  918|       |  static char resultbuf[2 + 10 + 1];
  919|       |
  920|       |  /* The Windows API has a function returning the locale's codepage as
  921|       |     a number, but the value doesn't change according to what the
  922|       |     'setlocale' call specified.  So we use it as a last resort, in
  923|       |     case the string returned by 'setlocale' doesn't specify the
  924|       |     codepage.  */
  925|       |  char *current_locale = setlocale (LC_CTYPE, NULL);
  926|       |  char *pdot = strrchr (current_locale, '.');
  927|       |
  928|       |  if (pdot && 2 + strlen (pdot + 1) + 1 <= sizeof (buf))
  929|       |    sprintf (buf, "CP%s", pdot + 1);
  930|       |  else
  931|       |    {
  932|       |      /* The Windows API has a function returning the locale's codepage as a
  933|       |         number: GetACP().
  934|       |         When the output goes to a console window, it needs to be provided in
  935|       |         GetOEMCP() encoding if the console is using a raster font, or in
  936|       |         GetConsoleOutputCP() encoding if it is using a TrueType font.
  937|       |         But in GUI programs and for output sent to files and pipes, GetACP()
  938|       |         encoding is the best bet.  */
  939|       |      sprintf (buf, "CP%u", GetACP ());
  940|       |    }
  941|       |  /* For a locale name such as "French_France.65001", in Windows 10,
  942|       |     setlocale now returns "French_France.utf8" instead, or in the UTF-8
  943|       |     environment (with modern system settings) "fr_FR.UTF-8".  */
  944|       |  if (strcmp (buf + 2, "65001") == 0 || strcmp (buf + 2, "utf8") == 0
  945|       |      || strcmp (buf + 2, "UTF-8") == 0)
  946|       |    codeset = "UTF-8";
  947|       |  else
  948|       |    {
  949|       |      strcpy (resultbuf, buf);
  950|       |      codeset = resultbuf;
  951|       |    }
  952|       |
  953|       |# elif defined OS2
  954|       |
  955|       |  const char *locale;
  956|       |  static char resultbuf[2 + 10 + 1];
  957|       |  ULONG cp[3];
  958|       |  ULONG cplen;
  959|       |
  960|       |  codeset = NULL;
  961|       |
  962|       |  /* Allow user to override the codeset, as set in the operating system,
  963|       |     with standard language environment variables.  */
  964|       |  locale = getenv ("LC_ALL");
  965|       |  if (locale == NULL || locale[0] == '\0')
  966|       |    {
  967|       |      locale = getenv ("LC_CTYPE");
  968|       |      if (locale == NULL || locale[0] == '\0')
  969|       |        locale = getenv ("LANG");
  970|       |    }
  971|       |  if (locale != NULL && locale[0] != '\0')
  972|       |    {
  973|       |      /* If the locale name contains an encoding after the dot, return it.  */
  974|       |      const char *dot = strchr (locale, '.');
  975|       |
  976|       |      if (dot != NULL)
  977|       |        {
  978|       |          const char *modifier;
  979|       |
  980|       |          dot++;
  981|       |          /* Look for the possible @... trailer and remove it, if any.  */
  982|       |          modifier = strchr (dot, '@');
  983|       |          if (modifier == NULL)
  984|       |            return dot;
  985|       |          if (modifier - dot < sizeof (resultbuf))
  986|       |            {
  987|       |              /* This way of filling resultbuf is multithread-safe.  */
  988|       |              memcpy (resultbuf, dot, modifier - dot);
  989|       |              resultbuf [modifier - dot] = '\0';
  990|       |              return resultbuf;
  991|       |            }
  992|       |        }
  993|       |
  994|       |      /* For the POSIX locale, don't use the system's codepage.  */
  995|       |      if (strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0)
  996|       |        codeset = "";
  997|       |    }
  998|       |
  999|       |  if (codeset == NULL)
 1000|       |    {
 1001|       |      /* OS/2 has a function returning the locale's codepage as a number.  */
 1002|       |      if (DosQueryCp (sizeof (cp), cp, &cplen))
 1003|       |        codeset = "";
 1004|       |      else
 1005|       |        {
 1006|       |          char buf[2 + 10 + 1];
 1007|       |
 1008|       |          sprintf (buf, "CP%u", cp[0]);
 1009|       |          strcpy (resultbuf, buf);
 1010|       |          codeset = resultbuf;
 1011|       |        }
 1012|       |    }
 1013|       |
 1014|       |# else
 1015|       |
 1016|       |#  error "Add code for other platforms here."
 1017|       |
 1018|       |# endif
 1019|       |
 1020|       |  /* Resolve alias.  */
 1021|    254|  {
 1022|       |# ifdef alias_table_defined
 1023|       |    /* On some platforms, UTF-8 locales are the most frequently used ones.
 1024|       |       Speed up the common case and slow down the less common cases by
 1025|       |       testing for this case first.  */
 1026|       |#  if defined __OpenBSD__ || (defined __APPLE__ && defined __MACH__) || defined __sun || defined __CYGWIN__
 1027|       |    if (strcmp (codeset, "UTF-8") == 0)
 1028|       |      goto done_table_lookup;
 1029|       |    else
 1030|       |#  endif
 1031|       |      {
 1032|       |        const struct table_entry * const table = alias_table;
 1033|       |        size_t const table_size =
 1034|       |          sizeof (alias_table) / sizeof (struct table_entry);
 1035|       |        /* The table is sorted.  Perform a binary search.  */
 1036|       |        size_t hi = table_size;
 1037|       |        size_t lo = 0;
 1038|       |        while (lo < hi)
 1039|       |          {
 1040|       |            /* Invariant:
 1041|       |               for i < lo, strcmp (table[i].alias, codeset) < 0,
 1042|       |               for i >= hi, strcmp (table[i].alias, codeset) > 0.  */
 1043|       |            size_t mid = (hi + lo) >> 1; /* >= lo, < hi */
 1044|       |            int cmp = strcmp (table[mid].alias, codeset);
 1045|       |            if (cmp < 0)
 1046|       |              lo = mid + 1;
 1047|       |            else if (cmp > 0)
 1048|       |              hi = mid;
 1049|       |            else
 1050|       |              {
 1051|       |                /* Found an i with
 1052|       |                     strcmp (table[i].alias, codeset) == 0.  */
 1053|       |                codeset = table[mid].canonical;
 1054|       |                goto done_table_lookup;
 1055|       |              }
 1056|       |          }
 1057|       |      }
 1058|       |    if (0)
 1059|       |      done_table_lookup: {}
 1060|       |    else
 1061|       |# endif
 1062|    254|      {
 1063|       |        /* Did not find it in the table.  */
 1064|       |        /* On Mac OS X, all modern locales use the UTF-8 encoding.
 1065|       |           BeOS and Haiku have a single locale, and it has UTF-8 encoding.  */
 1066|       |# if (defined __APPLE__ && defined __MACH__) || defined __BEOS__ || defined __HAIKU__
 1067|       |        codeset = "UTF-8";
 1068|       |# else
 1069|       |        /* Don't return an empty string.  GNU libc and GNU libiconv interpret
 1070|       |           the empty string as denoting "the locale's character encoding",
 1071|       |           thus GNU libiconv would call this function a second time.  */
 1072|    254|        if (codeset[0] == '\0')
  ------------------
  |  Branch (1072:13): [True: 0, False: 254]
  ------------------
 1073|      0|          codeset = "ASCII";
 1074|    254|# endif
 1075|    254|      }
 1076|    254|  }
 1077|       |
 1078|       |#else
 1079|       |
 1080|       |  /* On old systems which lack it, use setlocale or getenv.  */
 1081|       |  const char *locale = NULL;
 1082|       |
 1083|       |  /* But most old systems don't have a complete set of locales.  Some
 1084|       |     (like DJGPP) have only the C locale.  Therefore we don't use setlocale
 1085|       |     here; it would return "C" when it doesn't support the locale name the
 1086|       |     user has set.  */
 1087|       |# if 0
 1088|       |  locale = setlocale (LC_CTYPE, NULL);
 1089|       |# endif
 1090|       |  if (locale == NULL || locale[0] == '\0')
 1091|       |    {
 1092|       |      locale = getenv ("LC_ALL");
 1093|       |      if (locale == NULL || locale[0] == '\0')
 1094|       |        {
 1095|       |          locale = getenv ("LC_CTYPE");
 1096|       |          if (locale == NULL || locale[0] == '\0')
 1097|       |            locale = getenv ("LANG");
 1098|       |            if (locale == NULL)
 1099|       |              locale = "";
 1100|       |        }
 1101|       |    }
 1102|       |
 1103|       |  /* Map locale name to canonical encoding name.  */
 1104|       |  {
 1105|       |# ifdef locale_table_defined
 1106|       |    const struct table_entry * const table = locale_table;
 1107|       |    size_t const table_size =
 1108|       |      sizeof (locale_table) / sizeof (struct table_entry);
 1109|       |    /* The table is sorted.  Perform a binary search.  */
 1110|       |    size_t hi = table_size;
 1111|       |    size_t lo = 0;
 1112|       |    while (lo < hi)
 1113|       |      {
 1114|       |        /* Invariant:
 1115|       |           for i < lo, strcmp (table[i].locale, locale) < 0,
 1116|       |           for i >= hi, strcmp (table[i].locale, locale) > 0.  */
 1117|       |        size_t mid = (hi + lo) >> 1; /* >= lo, < hi */
 1118|       |        int cmp = strcmp (table[mid].locale, locale);
 1119|       |        if (cmp < 0)
 1120|       |          lo = mid + 1;
 1121|       |        else if (cmp > 0)
 1122|       |          hi = mid;
 1123|       |        else
 1124|       |          {
 1125|       |            /* Found an i with
 1126|       |                 strcmp (table[i].locale, locale) == 0.  */
 1127|       |            codeset = table[mid].canonical;
 1128|       |            goto done_table_lookup;
 1129|       |          }
 1130|       |      }
 1131|       |    if (0)
 1132|       |      done_table_lookup: ;
 1133|       |    else
 1134|       |# endif
 1135|       |      {
 1136|       |        /* Did not find it in the table.  */
 1137|       |        /* On Mac OS X, all modern locales use the UTF-8 encoding.
 1138|       |           BeOS and Haiku have a single locale, and it has UTF-8 encoding.  */
 1139|       |# if (defined __APPLE__ && defined __MACH__) || defined __BEOS__ || defined __HAIKU__
 1140|       |        codeset = "UTF-8";
 1141|       |# else
 1142|       |        /* The canonical name cannot be determined.  */
 1143|       |        /* Don't return an empty string.  GNU libc and GNU libiconv interpret
 1144|       |           the empty string as denoting "the locale's character encoding",
 1145|       |           thus GNU libiconv would call this function a second time.  */
 1146|       |        codeset = "ASCII";
 1147|       |# endif
 1148|       |      }
 1149|       |  }
 1150|       |
 1151|       |#endif
 1152|       |
 1153|       |#ifdef DARWIN7
 1154|       |  /* Mac OS X sets MB_CUR_MAX to 1 when LC_ALL=C, and "UTF-8"
 1155|       |     (the default codeset) does not work when MB_CUR_MAX is 1.  */
 1156|       |  if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX_L (uselocale (NULL)) <= 1)
 1157|       |    codeset = "ASCII";
 1158|       |#endif
 1159|       |
 1160|    254|  return codeset;
 1161|    254|}

iconveh_open:
   48|    254|{
   49|    254|  iconv_t cd;
   50|    254|  iconv_t cd1;
   51|    254|  iconv_t cd2;
   52|       |
   53|    254|  cd = iconv_open (to_codeset, from_codeset);
   54|       |
   55|    254|  if (STRCASEEQ (from_codeset, "UTF-8", 'U','T','F','-','8',0,0,0,0))
  ------------------
  |  |  179|    254|  strcaseeq0 (s1, s2, s20, s21, s22, s23, s24, s25, s26, s27, s28)
  |  |  ------------------
  |  |  |  Branch (179:3): [True: 0, False: 254]
  |  |  ------------------
  ------------------
   56|      0|    cd1 = (iconv_t)(-1);
   57|    254|  else
   58|    254|    {
   59|    254|      cd1 = iconv_open ("UTF-8", from_codeset);
   60|    254|      if (cd1 == (iconv_t)(-1))
  ------------------
  |  Branch (60:11): [True: 0, False: 254]
  ------------------
   61|      0|        {
   62|      0|          int saved_errno = errno;
   63|      0|          if (cd != (iconv_t)(-1))
  ------------------
  |  Branch (63:15): [True: 0, False: 0]
  ------------------
   64|      0|            iconv_close (cd);
   65|      0|          errno = saved_errno;
   66|      0|          return -1;
   67|      0|        }
   68|    254|    }
   69|       |
   70|    254|  if (STRCASEEQ (to_codeset, "UTF-8", 'U','T','F','-','8',0,0,0,0)
  ------------------
  |  |  179|    508|  strcaseeq0 (s1, s2, s20, s21, s22, s23, s24, s25, s26, s27, s28)
  |  |  ------------------
  |  |  |  Branch (179:3): [True: 0, False: 254]
  |  |  ------------------
  ------------------
   71|    254|# if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) \
   72|    254|      && !defined __UCLIBC__) \
   73|    254|     || _LIBICONV_VERSION >= 0x0105 \
   74|    254|     || defined ICONV_SET_TRANSLITERATE
   75|    254|      || c_strcasecmp (to_codeset, "UTF-8//TRANSLIT") == 0
  ------------------
  |  Branch (75:10): [True: 254, False: 0]
  ------------------
   76|    254|# endif
   77|    254|     )
   78|    254|    cd2 = (iconv_t)(-1);
   79|      0|  else
   80|      0|    {
   81|      0|      cd2 = iconv_open (to_codeset, "UTF-8");
   82|      0|      if (cd2 == (iconv_t)(-1))
  ------------------
  |  Branch (82:11): [True: 0, False: 0]
  ------------------
   83|      0|        {
   84|      0|          int saved_errno = errno;
   85|      0|          if (cd1 != (iconv_t)(-1))
  ------------------
  |  Branch (85:15): [True: 0, False: 0]
  ------------------
   86|      0|            iconv_close (cd1);
   87|      0|          if (cd != (iconv_t)(-1))
  ------------------
  |  Branch (87:15): [True: 0, False: 0]
  ------------------
   88|      0|            iconv_close (cd);
   89|      0|          errno = saved_errno;
   90|      0|          return -1;
   91|      0|        }
   92|      0|    }
   93|       |
   94|    254|  cdp->cd = cd;
   95|    254|  cdp->cd1 = cd1;
   96|    254|  cdp->cd2 = cd2;
   97|    254|  return 0;
   98|    254|}
iconveh_close:
  102|    254|{
  103|    254|  if (cd->cd2 != (iconv_t)(-1) && iconv_close (cd->cd2) < 0)
  ------------------
  |  Branch (103:7): [True: 0, False: 254]
  |  Branch (103:35): [True: 0, False: 0]
  ------------------
  104|      0|    {
  105|       |      /* Return -1, but preserve the errno from iconv_close.  */
  106|      0|      int saved_errno = errno;
  107|      0|      if (cd->cd1 != (iconv_t)(-1))
  ------------------
  |  Branch (107:11): [True: 0, False: 0]
  ------------------
  108|      0|        iconv_close (cd->cd1);
  109|      0|      if (cd->cd != (iconv_t)(-1))
  ------------------
  |  Branch (109:11): [True: 0, False: 0]
  ------------------
  110|      0|        iconv_close (cd->cd);
  111|      0|      errno = saved_errno;
  112|      0|      return -1;
  113|      0|    }
  114|    254|  if (cd->cd1 != (iconv_t)(-1) && iconv_close (cd->cd1) < 0)
  ------------------
  |  Branch (114:7): [True: 254, False: 0]
  |  Branch (114:35): [True: 0, False: 254]
  ------------------
  115|      0|    {
  116|       |      /* Return -1, but preserve the errno from iconv_close.  */
  117|      0|      int saved_errno = errno;
  118|      0|      if (cd->cd != (iconv_t)(-1))
  ------------------
  |  Branch (118:11): [True: 0, False: 0]
  ------------------
  119|      0|        iconv_close (cd->cd);
  120|      0|      errno = saved_errno;
  121|      0|      return -1;
  122|      0|    }
  123|    254|  if (cd->cd != (iconv_t)(-1) && iconv_close (cd->cd) < 0)
  ------------------
  |  Branch (123:7): [True: 254, False: 0]
  |  Branch (123:34): [True: 0, False: 254]
  ------------------
  124|      0|    return -1;
  125|    254|  return 0;
  126|    254|}
mem_cd_iconveh:
 1055|    254|{
 1056|    254|  return mem_cd_iconveh_internal (src, srclen, cd->cd, cd->cd1, cd->cd2,
 1057|    254|                                  handler, 0, offsets, resultp, lengthp);
 1058|    254|}
mem_iconveh:
 1095|    254|{
 1096|    254|  if (srclen == 0)
  ------------------
  |  Branch (1096:7): [True: 0, False: 254]
  ------------------
 1097|      0|    {
 1098|       |      /* Nothing to convert.  */
 1099|      0|      *lengthp = 0;
 1100|      0|      return 0;
 1101|      0|    }
 1102|    254|  else if (offsets == NULL && c_strcasecmp (from_codeset, to_codeset) == 0)
  ------------------
  |  Branch (1102:12): [True: 254, False: 0]
  |  Branch (1102:31): [True: 0, False: 254]
  ------------------
 1103|      0|    {
 1104|      0|      char *result;
 1105|       |
 1106|      0|      if (*resultp != NULL && *lengthp >= srclen)
  ------------------
  |  Branch (1106:11): [True: 0, False: 0]
  |  Branch (1106:31): [True: 0, False: 0]
  ------------------
 1107|      0|        result = *resultp;
 1108|      0|      else
 1109|      0|        {
 1110|      0|          result = (char *) malloc (srclen);
 1111|      0|          if (result == NULL)
  ------------------
  |  Branch (1111:15): [True: 0, False: 0]
  ------------------
 1112|      0|            {
 1113|      0|              errno = ENOMEM;
 1114|      0|              return -1;
 1115|      0|            }
 1116|      0|        }
 1117|      0|      memcpy (result, src, srclen);
 1118|      0|      *resultp = result;
 1119|      0|      *lengthp = srclen;
 1120|      0|      return 0;
 1121|      0|    }
 1122|    254|  else
 1123|    254|    {
 1124|    254|#if HAVE_ICONV
 1125|    254|      iconveh_t cd;
 1126|    254|      char *result;
 1127|    254|      size_t length;
 1128|    254|      int retval;
 1129|       |
 1130|    254|      if (iconveh_open (to_codeset, from_codeset, &cd) < 0)
  ------------------
  |  Branch (1130:11): [True: 0, False: 254]
  ------------------
 1131|      0|        return -1;
 1132|       |
 1133|    254|      result = *resultp;
 1134|    254|      length = *lengthp;
 1135|    254|      retval = mem_cd_iconveh (src, srclen, &cd, handler, offsets,
 1136|    254|                               &result, &length);
 1137|       |
 1138|    254|      if (retval < 0)
  ------------------
  |  Branch (1138:11): [True: 254, False: 0]
  ------------------
 1139|    254|        {
 1140|       |          /* Close cd, but preserve the errno from str_cd_iconv.  */
 1141|    254|          int saved_errno = errno;
 1142|    254|          iconveh_close (&cd);
 1143|    254|          errno = saved_errno;
 1144|    254|        }
 1145|      0|      else
 1146|      0|        {
 1147|      0|          if (iconveh_close (&cd) < 0)
  ------------------
  |  Branch (1147:15): [True: 0, False: 0]
  ------------------
 1148|      0|            {
 1149|      0|              if (result != *resultp)
  ------------------
  |  Branch (1149:19): [True: 0, False: 0]
  ------------------
 1150|      0|                free (result);
 1151|      0|              return -1;
 1152|      0|            }
 1153|      0|          *resultp = result;
 1154|      0|          *lengthp = length;
 1155|      0|        }
 1156|    254|      return retval;
 1157|       |#else
 1158|       |      /* This is a different error code than if iconv_open existed but didn't
 1159|       |         support from_codeset and to_codeset, so that the caller can emit
 1160|       |         an error message such as
 1161|       |           "iconv() is not supported. Installing GNU libiconv and
 1162|       |            then reinstalling this package would fix this."  */
 1163|       |      errno = ENOSYS;
 1164|       |      return -1;
 1165|       |#endif
 1166|    254|    }
 1167|    254|}
striconveh.c:mem_cd_iconveh_internal:
  347|    254|{
  348|       |  /* When a conversion error occurs, we cannot start using CD1 and CD2 at
  349|       |     this point: FROM_CODESET may be a stateful encoding like ISO-2022-KR.
  350|       |     Instead, we have to start afresh from the beginning of SRC.  */
  351|       |  /* Use a temporary buffer, so that for small strings, a single malloc()
  352|       |     call will be sufficient.  */
  353|    254|# define tmpbufsize 4096
  354|       |  /* The alignment is needed when converting e.g. to glibc's WCHAR_T or
  355|       |     libiconv's UCS-4-INTERNAL encoding.  */
  356|    254|  union { unsigned int align; char buf[tmpbufsize]; } tmp;
  357|    254|# define tmpbuf tmp.buf
  358|       |
  359|    254|  char *initial_result;
  360|    254|  char *result;
  361|    254|  size_t allocated;
  362|    254|  size_t length;
  363|    254|  size_t last_length = (size_t)(-1); /* only needed if offsets != NULL */
  364|       |
  365|    254|  if (*resultp != NULL && *lengthp >= sizeof (tmpbuf))
  ------------------
  |  |  357|      0|# define tmpbuf tmp.buf
  ------------------
  |  Branch (365:7): [True: 0, False: 254]
  |  Branch (365:27): [True: 0, False: 0]
  ------------------
  366|      0|    {
  367|      0|      initial_result = *resultp;
  368|      0|      allocated = *lengthp;
  369|      0|    }
  370|    254|  else
  371|    254|    {
  372|    254|      initial_result = tmpbuf;
  ------------------
  |  |  357|    254|# define tmpbuf tmp.buf
  ------------------
  373|    254|      allocated = sizeof (tmpbuf);
  ------------------
  |  |  357|    254|# define tmpbuf tmp.buf
  ------------------
  374|    254|    }
  375|    254|  result = initial_result;
  376|       |
  377|       |  /* Test whether a direct conversion is possible at all.  */
  378|    254|  if (cd == (iconv_t)(-1))
  ------------------
  |  Branch (378:7): [True: 0, False: 254]
  ------------------
  379|      0|    goto indirectly;
  380|       |
  381|    254|  if (offsets != NULL)
  ------------------
  |  Branch (381:7): [True: 0, False: 254]
  ------------------
  382|      0|    {
  383|      0|      size_t i;
  384|       |
  385|      0|      for (i = 0; i < srclen; i++)
  ------------------
  |  Branch (385:19): [True: 0, False: 0]
  ------------------
  386|      0|        offsets[i] = (size_t)(-1);
  387|       |
  388|      0|      last_length = (size_t)(-1);
  389|      0|    }
  390|    254|  length = 0;
  391|       |
  392|       |  /* First, try a direct conversion, and see whether a conversion error
  393|       |     occurs at all.  */
  394|    254|  {
  395|    254|    const char *inptr = src;
  396|    254|    size_t insize = srclen;
  397|       |
  398|       |    /* Set to the initial state.  */
  399|    254|    iconv (cd, NULL, NULL, NULL, NULL);
  400|       |
  401|    332|    while (insize > 0)
  ------------------
  |  Branch (401:12): [True: 332, False: 0]
  ------------------
  402|    332|      {
  403|    332|        char *outptr = result + length;
  404|    332|        size_t outsize = allocated - extra_alloc - length;
  405|    332|        bool incremented;
  406|    332|        size_t res;
  407|    332|        bool grow;
  408|       |
  409|    332|        if (offsets != NULL)
  ------------------
  |  Branch (409:13): [True: 0, False: 332]
  ------------------
  410|      0|          {
  411|      0|            if (length != last_length) /* ensure that offset[] be increasing */
  ------------------
  |  Branch (411:17): [True: 0, False: 0]
  ------------------
  412|      0|              {
  413|      0|                offsets[inptr - src] = length;
  414|      0|                last_length = length;
  415|      0|              }
  416|      0|            res = iconv_carefully_1 (cd,
  417|      0|                                     &inptr, &insize,
  418|      0|                                     &outptr, &outsize,
  419|      0|                                     &incremented);
  420|      0|          }
  421|    332|        else
  422|       |          /* Use iconv_carefully instead of iconv here, because:
  423|       |             - If TO_CODESET is UTF-8, we can do the error handling in this
  424|       |               loop, no need for a second loop,
  425|       |             - With iconv() implementations other than GNU libiconv and GNU
  426|       |               libc, if we use iconv() in a big swoop, checking for an E2BIG
  427|       |               return, we lose the number of irreversible conversions.  */
  428|    332|          res = iconv_carefully (cd,
  ------------------
  |  |  201|    332|     (*(incremented) = false, \
  |  |  202|    332|      iconv (cd, (ICONV_CONST char **) (inbuf), inbytesleft, outbuf, outbytesleft))
  ------------------
  429|    332|                                 &inptr, &insize,
  430|    332|                                 &outptr, &outsize,
  431|    332|                                 &incremented);
  432|       |
  433|    332|        length = outptr - result;
  434|    332|        grow = (length + extra_alloc > allocated / 2);
  435|    332|        if (res == (size_t)(-1))
  ------------------
  |  Branch (435:13): [True: 332, False: 0]
  ------------------
  436|    332|          {
  437|    332|            if (errno == E2BIG)
  ------------------
  |  Branch (437:17): [True: 78, False: 254]
  ------------------
  438|     78|              grow = true;
  439|    254|            else if (errno == EINVAL)
  ------------------
  |  Branch (439:22): [True: 0, False: 254]
  ------------------
  440|      0|              break;
  441|    254|            else if (errno == EILSEQ && handler != iconveh_error)
  ------------------
  |  Branch (441:22): [True: 254, False: 0]
  |  Branch (441:41): [True: 0, False: 254]
  ------------------
  442|      0|              {
  443|      0|                if (cd2 == (iconv_t)(-1))
  ------------------
  |  Branch (443:21): [True: 0, False: 0]
  ------------------
  444|      0|                  {
  445|       |                    /* TO_CODESET is UTF-8.  */
  446|       |                    /* Error handling can produce up to 1 or 3 bytes of
  447|       |                       output.  */
  448|      0|                    size_t extra_need =
  449|      0|                      (handler == iconveh_replacement_character ? 3 : 1);
  ------------------
  |  Branch (449:24): [True: 0, False: 0]
  ------------------
  450|      0|                    if (length + extra_need + extra_alloc > allocated)
  ------------------
  |  Branch (450:25): [True: 0, False: 0]
  ------------------
  451|      0|                      {
  452|      0|                        char *memory;
  453|       |
  454|      0|                        allocated = 2 * allocated;
  455|      0|                        if (length + extra_need + extra_alloc > allocated)
  ------------------
  |  Branch (455:29): [True: 0, False: 0]
  ------------------
  456|      0|                          allocated = 2 * allocated;
  457|      0|                        if (length + extra_need + extra_alloc > allocated)
  ------------------
  |  Branch (457:29): [True: 0, False: 0]
  ------------------
  458|      0|                          abort ();
  459|      0|                        if (result == initial_result)
  ------------------
  |  Branch (459:29): [True: 0, False: 0]
  ------------------
  460|      0|                          memory = (char *) malloc (allocated);
  461|      0|                        else
  462|      0|                          memory = (char *) realloc (result, allocated);
  463|      0|                        if (memory == NULL)
  ------------------
  |  Branch (463:29): [True: 0, False: 0]
  ------------------
  464|      0|                          {
  465|      0|                            if (result != initial_result)
  ------------------
  |  Branch (465:33): [True: 0, False: 0]
  ------------------
  466|      0|                              free (result);
  467|      0|                            errno = ENOMEM;
  468|      0|                            return -1;
  469|      0|                          }
  470|      0|                        if (result == initial_result)
  ------------------
  |  Branch (470:29): [True: 0, False: 0]
  ------------------
  471|      0|                          memcpy (memory, initial_result, length);
  472|      0|                        result = memory;
  473|      0|                        grow = false;
  474|      0|                      }
  475|       |                    /* The input is invalid in FROM_CODESET.  Eat up one byte
  476|       |                       and emit a replacement character or a question mark.  */
  477|      0|                    if (!incremented)
  ------------------
  |  Branch (477:25): [True: 0, False: 0]
  ------------------
  478|      0|                      {
  479|      0|                        if (insize == 0)
  ------------------
  |  Branch (479:29): [True: 0, False: 0]
  ------------------
  480|      0|                          abort ();
  481|      0|                        inptr++;
  482|      0|                        insize--;
  483|      0|                      }
  484|      0|                    if (handler == iconveh_replacement_character)
  ------------------
  |  Branch (484:25): [True: 0, False: 0]
  ------------------
  485|      0|                      {
  486|       |                        /* U+FFFD in UTF-8 encoding.  */
  487|      0|                        result[length+0] = '\357';
  488|      0|                        result[length+1] = '\277';
  489|      0|                        result[length+2] = '\275';
  490|      0|                        length += 3;
  491|      0|                      }
  492|      0|                    else
  493|      0|                      {
  494|      0|                        result[length] = '?';
  495|      0|                        length++;
  496|      0|                      }
  497|      0|                  }
  498|      0|                else
  499|      0|                  goto indirectly;
  500|      0|              }
  501|    254|            else
  502|    254|              {
  503|    254|                if (result != initial_result)
  ------------------
  |  Branch (503:21): [True: 30, False: 224]
  ------------------
  504|     30|                  free (result);
  505|    254|                return -1;
  506|    254|              }
  507|    332|          }
  508|     78|        if (insize == 0)
  ------------------
  |  Branch (508:13): [True: 0, False: 78]
  ------------------
  509|      0|          break;
  510|     78|        if (grow)
  ------------------
  |  Branch (510:13): [True: 78, False: 0]
  ------------------
  511|     78|          {
  512|     78|            char *memory;
  513|       |
  514|     78|            allocated = 2 * allocated;
  515|     78|            if (result == initial_result)
  ------------------
  |  Branch (515:17): [True: 30, False: 48]
  ------------------
  516|     30|              memory = (char *) malloc (allocated);
  517|     48|            else
  518|     48|              memory = (char *) realloc (result, allocated);
  519|     78|            if (memory == NULL)
  ------------------
  |  Branch (519:17): [True: 0, False: 78]
  ------------------
  520|      0|              {
  521|      0|                if (result != initial_result)
  ------------------
  |  Branch (521:21): [True: 0, False: 0]
  ------------------
  522|      0|                  free (result);
  523|      0|                errno = ENOMEM;
  524|      0|                return -1;
  525|      0|              }
  526|     78|            if (result == initial_result)
  ------------------
  |  Branch (526:17): [True: 30, False: 48]
  ------------------
  527|     30|              memcpy (memory, initial_result, length);
  528|     78|            result = memory;
  529|     78|          }
  530|     78|      }
  531|    254|  }
  532|       |
  533|       |  /* Now get the conversion state back to the initial state.
  534|       |     But avoid glibc-2.1 bug and Solaris 2.7 bug.  */
  535|      0|#if defined _LIBICONV_VERSION \
  536|      0|    || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
  537|      0|         || defined __sun)
  538|      0|  for (;;)
  539|      0|    {
  540|      0|      char *outptr = result + length;
  541|      0|      size_t outsize = allocated - extra_alloc - length;
  542|      0|      size_t res;
  543|       |
  544|      0|      res = iconv (cd, NULL, NULL, &outptr, &outsize);
  545|      0|      length = outptr - result;
  546|      0|      if (res == (size_t)(-1))
  ------------------
  |  Branch (546:11): [True: 0, False: 0]
  ------------------
  547|      0|        {
  548|      0|          if (errno == E2BIG)
  ------------------
  |  Branch (548:15): [True: 0, False: 0]
  ------------------
  549|      0|            {
  550|      0|              char *memory;
  551|       |
  552|      0|              allocated = 2 * allocated;
  553|      0|              if (result == initial_result)
  ------------------
  |  Branch (553:19): [True: 0, False: 0]
  ------------------
  554|      0|                memory = (char *) malloc (allocated);
  555|      0|              else
  556|      0|                memory = (char *) realloc (result, allocated);
  557|      0|              if (memory == NULL)
  ------------------
  |  Branch (557:19): [True: 0, False: 0]
  ------------------
  558|      0|                {
  559|      0|                  if (result != initial_result)
  ------------------
  |  Branch (559:23): [True: 0, False: 0]
  ------------------
  560|      0|                    free (result);
  561|      0|                  errno = ENOMEM;
  562|      0|                  return -1;
  563|      0|                }
  564|      0|              if (result == initial_result)
  ------------------
  |  Branch (564:19): [True: 0, False: 0]
  ------------------
  565|      0|                memcpy (memory, initial_result, length);
  566|      0|              result = memory;
  567|      0|            }
  568|      0|          else
  569|      0|            {
  570|      0|              if (result != initial_result)
  ------------------
  |  Branch (570:19): [True: 0, False: 0]
  ------------------
  571|      0|                free (result);
  572|      0|              return -1;
  573|      0|            }
  574|      0|        }
  575|      0|      else
  576|      0|        break;
  577|      0|    }
  578|      0|#endif
  579|       |
  580|       |  /* The direct conversion succeeded.  */
  581|      0|  goto done;
  582|       |
  583|      0| indirectly:
  584|       |  /* The direct conversion failed.
  585|       |     Use a conversion through UTF-8.  */
  586|      0|  if (offsets != NULL)
  ------------------
  |  Branch (586:7): [True: 0, False: 0]
  ------------------
  587|      0|    {
  588|      0|      size_t i;
  589|       |
  590|      0|      for (i = 0; i < srclen; i++)
  ------------------
  |  Branch (590:19): [True: 0, False: 0]
  ------------------
  591|      0|        offsets[i] = (size_t)(-1);
  592|       |
  593|      0|      last_length = (size_t)(-1);
  594|      0|    }
  595|      0|  length = 0;
  596|      0|  {
  597|      0|    const bool slowly = (offsets != NULL || handler == iconveh_error);
  ------------------
  |  Branch (597:26): [True: 0, False: 0]
  |  Branch (597:45): [True: 0, False: 0]
  ------------------
  598|      0|# define utf8bufsize 4096 /* may also be smaller or larger than tmpbufsize */
  599|      0|    char utf8buf[utf8bufsize + 3];
  600|      0|    size_t utf8len = 0;
  601|      0|    const char *in1ptr = src;
  602|      0|    size_t in1size = srclen;
  603|      0|    bool do_final_flush1 = true;
  604|      0|    bool do_final_flush2 = true;
  605|       |
  606|       |    /* Set to the initial state.  */
  607|      0|    if (cd1 != (iconv_t)(-1))
  ------------------
  |  Branch (607:9): [True: 0, False: 0]
  ------------------
  608|      0|      iconv (cd1, NULL, NULL, NULL, NULL);
  609|      0|    if (cd2 != (iconv_t)(-1))
  ------------------
  |  Branch (609:9): [True: 0, False: 0]
  ------------------
  610|      0|      iconv (cd2, NULL, NULL, NULL, NULL);
  611|       |
  612|      0|    while (in1size > 0 || do_final_flush1 || utf8len > 0 || do_final_flush2)
  ------------------
  |  Branch (612:12): [True: 0, False: 0]
  |  Branch (612:27): [True: 0, False: 0]
  |  Branch (612:46): [True: 0, False: 0]
  |  Branch (612:61): [True: 0, False: 0]
  ------------------
  613|      0|      {
  614|      0|        char *out1ptr = utf8buf + utf8len;
  615|      0|        size_t out1size = utf8bufsize - utf8len;
  ------------------
  |  |  598|      0|# define utf8bufsize 4096 /* may also be smaller or larger than tmpbufsize */
  ------------------
  616|      0|        bool incremented1;
  617|      0|        size_t res1;
  618|      0|        int errno1;
  619|       |
  620|       |        /* Conversion step 1: from FROM_CODESET to UTF-8.  */
  621|      0|        if (in1size > 0)
  ------------------
  |  Branch (621:13): [True: 0, False: 0]
  ------------------
  622|      0|          {
  623|      0|            if (offsets != NULL
  ------------------
  |  Branch (623:17): [True: 0, False: 0]
  ------------------
  624|      0|                && length != last_length) /* ensure that offset[] be increasing */
  ------------------
  |  Branch (624:20): [True: 0, False: 0]
  ------------------
  625|      0|              {
  626|      0|                offsets[in1ptr - src] = length;
  627|      0|                last_length = length;
  628|      0|              }
  629|      0|            if (cd1 != (iconv_t)(-1))
  ------------------
  |  Branch (629:17): [True: 0, False: 0]
  ------------------
  630|      0|              {
  631|      0|                if (slowly)
  ------------------
  |  Branch (631:21): [True: 0, False: 0]
  ------------------
  632|      0|                  res1 = iconv_carefully_1 (cd1,
  633|      0|                                            &in1ptr, &in1size,
  634|      0|                                            &out1ptr, &out1size,
  635|      0|                                            &incremented1);
  636|      0|                else
  637|      0|                  res1 = iconv_carefully (cd1,
  ------------------
  |  |  201|      0|     (*(incremented) = false, \
  |  |  202|      0|      iconv (cd, (ICONV_CONST char **) (inbuf), inbytesleft, outbuf, outbytesleft))
  ------------------
  638|      0|                                          &in1ptr, &in1size,
  639|      0|                                          &out1ptr, &out1size,
  640|      0|                                          &incremented1);
  641|      0|              }
  642|      0|            else
  643|      0|              {
  644|       |                /* FROM_CODESET is UTF-8.  */
  645|      0|                res1 = utf8conv_carefully (slowly,
  646|      0|                                           &in1ptr, &in1size,
  647|      0|                                           &out1ptr, &out1size,
  648|      0|                                           &incremented1);
  649|      0|              }
  650|      0|          }
  651|      0|        else if (do_final_flush1)
  ------------------
  |  Branch (651:18): [True: 0, False: 0]
  ------------------
  652|      0|          {
  653|       |            /* Now get the conversion state of CD1 back to the initial state.
  654|       |               But avoid glibc-2.1 bug and Solaris 2.7 bug.  */
  655|      0|# if defined _LIBICONV_VERSION \
  656|      0|     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
  657|      0|          || defined __sun)
  658|      0|            if (cd1 != (iconv_t)(-1))
  ------------------
  |  Branch (658:17): [True: 0, False: 0]
  ------------------
  659|      0|              res1 = iconv (cd1, NULL, NULL, &out1ptr, &out1size);
  660|      0|            else
  661|      0|# endif
  662|      0|              res1 = 0;
  663|      0|            do_final_flush1 = false;
  664|      0|            incremented1 = true;
  665|      0|          }
  666|      0|        else
  667|      0|          {
  668|      0|            res1 = 0;
  669|      0|            incremented1 = true;
  670|      0|          }
  671|      0|        if (res1 == (size_t)(-1)
  ------------------
  |  Branch (671:13): [True: 0, False: 0]
  ------------------
  672|      0|            && !(errno == E2BIG || errno == EINVAL || errno == EILSEQ))
  ------------------
  |  Branch (672:18): [True: 0, False: 0]
  |  Branch (672:36): [True: 0, False: 0]
  |  Branch (672:55): [True: 0, False: 0]
  ------------------
  673|      0|          {
  674|      0|            if (result != initial_result)
  ------------------
  |  Branch (674:17): [True: 0, False: 0]
  ------------------
  675|      0|              free (result);
  676|      0|            return -1;
  677|      0|          }
  678|      0|        if (res1 == (size_t)(-1)
  ------------------
  |  Branch (678:13): [True: 0, False: 0]
  ------------------
  679|      0|            && errno == EILSEQ && handler != iconveh_error)
  ------------------
  |  Branch (679:16): [True: 0, False: 0]
  |  Branch (679:35): [True: 0, False: 0]
  ------------------
  680|      0|          {
  681|       |            /* The input is invalid in FROM_CODESET.  Eat up one byte and
  682|       |               emit a U+FFFD character or a question mark.  Room for this
  683|       |               character was allocated at the end of utf8buf.  */
  684|      0|            if (!incremented1)
  ------------------
  |  Branch (684:17): [True: 0, False: 0]
  ------------------
  685|      0|              {
  686|      0|                if (in1size == 0)
  ------------------
  |  Branch (686:21): [True: 0, False: 0]
  ------------------
  687|      0|                  abort ();
  688|      0|                in1ptr++;
  689|      0|                in1size--;
  690|      0|              }
  691|      0|            if (handler == iconveh_replacement_character)
  ------------------
  |  Branch (691:17): [True: 0, False: 0]
  ------------------
  692|      0|              {
  693|       |                /* U+FFFD in UTF-8 encoding.  */
  694|      0|                out1ptr[0] = '\357';
  695|      0|                out1ptr[1] = '\277';
  696|      0|                out1ptr[2] = '\275';
  697|      0|                out1ptr += 3;
  698|      0|              }
  699|      0|            else
  700|      0|              *out1ptr++ = '?';
  701|      0|            res1 = 0;
  702|      0|          }
  703|      0|        errno1 = errno;
  704|      0|        utf8len = out1ptr - utf8buf;
  705|       |
  706|      0|        if (offsets != NULL
  ------------------
  |  Branch (706:13): [True: 0, False: 0]
  ------------------
  707|      0|            || in1size == 0
  ------------------
  |  Branch (707:16): [True: 0, False: 0]
  ------------------
  708|      0|            || utf8len > utf8bufsize / 2
  ------------------
  |  |  598|      0|# define utf8bufsize 4096 /* may also be smaller or larger than tmpbufsize */
  ------------------
  |  Branch (708:16): [True: 0, False: 0]
  ------------------
  709|      0|            || (res1 == (size_t)(-1) && errno1 == E2BIG))
  ------------------
  |  Branch (709:17): [True: 0, False: 0]
  |  Branch (709:41): [True: 0, False: 0]
  ------------------
  710|      0|          {
  711|       |            /* Conversion step 2: from UTF-8 to TO_CODESET.  */
  712|      0|            const char *in2ptr = utf8buf;
  713|      0|            size_t in2size = utf8len;
  714|       |
  715|      0|            while (in2size > 0
  ------------------
  |  Branch (715:20): [True: 0, False: 0]
  ------------------
  716|      0|                   || (in1size == 0 && !do_final_flush1 && do_final_flush2))
  ------------------
  |  Branch (716:24): [True: 0, False: 0]
  |  Branch (716:40): [True: 0, False: 0]
  |  Branch (716:60): [True: 0, False: 0]
  ------------------
  717|      0|              {
  718|      0|                char *out2ptr = result + length;
  719|      0|                size_t out2size = allocated - extra_alloc - length;
  720|      0|                bool incremented2;
  721|      0|                size_t res2;
  722|      0|                bool grow;
  723|       |
  724|      0|                if (in2size > 0)
  ------------------
  |  Branch (724:21): [True: 0, False: 0]
  ------------------
  725|      0|                  {
  726|      0|                    if (cd2 != (iconv_t)(-1))
  ------------------
  |  Branch (726:25): [True: 0, False: 0]
  ------------------
  727|      0|                      res2 = iconv_carefully (cd2,
  ------------------
  |  |  201|      0|     (*(incremented) = false, \
  |  |  202|      0|      iconv (cd, (ICONV_CONST char **) (inbuf), inbytesleft, outbuf, outbytesleft))
  ------------------
  728|      0|                                              &in2ptr, &in2size,
  729|      0|                                              &out2ptr, &out2size,
  730|      0|                                              &incremented2);
  731|      0|                    else
  732|       |                      /* TO_CODESET is UTF-8.  */
  733|      0|                      res2 = utf8conv_carefully (false,
  734|      0|                                                 &in2ptr, &in2size,
  735|      0|                                                 &out2ptr, &out2size,
  736|      0|                                                 &incremented2);
  737|      0|                  }
  738|      0|                else /* in1size == 0 && !do_final_flush1
  739|       |                        && in2size == 0 && do_final_flush2 */
  740|      0|                  {
  741|       |                    /* Now get the conversion state of CD1 back to the initial
  742|       |                       state.  But avoid glibc-2.1 bug and Solaris 2.7 bug.  */
  743|      0|# if defined _LIBICONV_VERSION \
  744|      0|     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
  745|      0|          || defined __sun)
  746|      0|                    if (cd2 != (iconv_t)(-1))
  ------------------
  |  Branch (746:25): [True: 0, False: 0]
  ------------------
  747|      0|                      res2 = iconv (cd2, NULL, NULL, &out2ptr, &out2size);
  748|      0|                    else
  749|      0|# endif
  750|      0|                      res2 = 0;
  751|      0|                    do_final_flush2 = false;
  752|      0|                    incremented2 = true;
  753|      0|                  }
  754|       |
  755|      0|                length = out2ptr - result;
  756|      0|                grow = (length + extra_alloc > allocated / 2);
  757|      0|                if (res2 == (size_t)(-1))
  ------------------
  |  Branch (757:21): [True: 0, False: 0]
  ------------------
  758|      0|                  {
  759|      0|                    if (errno == E2BIG)
  ------------------
  |  Branch (759:25): [True: 0, False: 0]
  ------------------
  760|      0|                      grow = true;
  761|      0|                    else if (errno == EINVAL)
  ------------------
  |  Branch (761:30): [True: 0, False: 0]
  ------------------
  762|      0|                      break;
  763|      0|                    else if (errno == EILSEQ && handler != iconveh_error)
  ------------------
  |  Branch (763:30): [True: 0, False: 0]
  |  Branch (763:49): [True: 0, False: 0]
  ------------------
  764|      0|                      {
  765|       |                        /* Error handling can produce up to 10 bytes of UTF-8
  766|       |                           output.  But TO_CODESET may be UCS-2, UTF-16 or
  767|       |                           UCS-4, so use CD2 here as well.  */
  768|      0|                        char scratchbuf[10];
  769|      0|                        size_t scratchlen;
  770|      0|                        ucs4_t uc;
  771|      0|                        const char *inptr;
  772|      0|                        size_t insize;
  773|      0|                        size_t res;
  774|       |
  775|      0|                        if (incremented2)
  ------------------
  |  Branch (775:29): [True: 0, False: 0]
  ------------------
  776|      0|                          {
  777|      0|                            if (u8_prev (&uc, (const uint8_t *) in2ptr,
  ------------------
  |  Branch (777:33): [True: 0, False: 0]
  ------------------
  778|      0|                                         (const uint8_t *) utf8buf)
  779|      0|                                == NULL)
  780|      0|                              abort ();
  781|      0|                          }
  782|      0|                        else
  783|      0|                          {
  784|      0|                            int n;
  785|      0|                            if (in2size == 0)
  ------------------
  |  Branch (785:33): [True: 0, False: 0]
  ------------------
  786|      0|                              abort ();
  787|      0|                            n = u8_mbtouc_unsafe (&uc, (const uint8_t *) in2ptr,
  788|      0|                                                  in2size);
  789|      0|                            in2ptr += n;
  790|      0|                            in2size -= n;
  791|      0|                          }
  792|       |
  793|      0|                        if (handler == iconveh_escape_sequence)
  ------------------
  |  Branch (793:29): [True: 0, False: 0]
  ------------------
  794|      0|                          {
  795|      0|                            static char const hex[16] = "0123456789ABCDEF";
  796|      0|                            scratchlen = 0;
  797|      0|                            scratchbuf[scratchlen++] = '\\';
  798|      0|                            if (uc < 0x10000)
  ------------------
  |  Branch (798:33): [True: 0, False: 0]
  ------------------
  799|      0|                              scratchbuf[scratchlen++] = 'u';
  800|      0|                            else
  801|      0|                              {
  802|      0|                                scratchbuf[scratchlen++] = 'U';
  803|      0|                                scratchbuf[scratchlen++] = hex[(uc>>28) & 15];
  804|      0|                                scratchbuf[scratchlen++] = hex[(uc>>24) & 15];
  805|      0|                                scratchbuf[scratchlen++] = hex[(uc>>20) & 15];
  806|      0|                                scratchbuf[scratchlen++] = hex[(uc>>16) & 15];
  807|      0|                              }
  808|      0|                            scratchbuf[scratchlen++] = hex[(uc>>12) & 15];
  809|      0|                            scratchbuf[scratchlen++] = hex[(uc>>8) & 15];
  810|      0|                            scratchbuf[scratchlen++] = hex[(uc>>4) & 15];
  811|      0|                            scratchbuf[scratchlen++] = hex[uc & 15];
  812|      0|                          }
  813|      0|                        else if (handler == iconveh_replacement_character)
  ------------------
  |  Branch (813:34): [True: 0, False: 0]
  ------------------
  814|      0|                          {
  815|       |                            /* U+FFFD in UTF-8 encoding.  */
  816|      0|                            scratchbuf[0] = '\357';
  817|      0|                            scratchbuf[1] = '\277';
  818|      0|                            scratchbuf[2] = '\275';
  819|      0|                            scratchlen = 3;
  820|      0|                          }
  821|      0|                        else
  822|      0|                          {
  823|      0|                            scratchbuf[0] = '?';
  824|      0|                            scratchlen = 1;
  825|      0|                          }
  826|       |
  827|      0|                        inptr = scratchbuf;
  828|      0|                        insize = scratchlen;
  829|      0|                        if (cd2 != (iconv_t)(-1))
  ------------------
  |  Branch (829:29): [True: 0, False: 0]
  ------------------
  830|      0|                          {
  831|      0|                            char *out2ptr_try = out2ptr;
  832|      0|                            size_t out2size_try = out2size;
  833|      0|                            res = iconv (cd2,
  834|      0|                                         (ICONV_CONST char **) &inptr, &insize,
  835|      0|                                         &out2ptr_try, &out2size_try);
  836|      0|                            if (handler == iconveh_replacement_character
  ------------------
  |  Branch (836:33): [True: 0, False: 0]
  ------------------
  837|      0|                                && (res == (size_t)(-1)
  ------------------
  |  Branch (837:36): [True: 0, False: 0]
  |  Branch (837:37): [True: 0, False: 0]
  ------------------
  838|      0|                                    ? errno == EILSEQ
  839|       |                                    /* FreeBSD iconv(), NetBSD iconv(), and
  840|       |                                       Solaris 11 iconv() insert a '?' if they
  841|       |                                       cannot convert.  This is what we want.
  842|       |                                       But IRIX iconv() inserts a NUL byte if it
  843|       |                                       cannot convert.
  844|       |                                       And musl libc iconv() inserts a '*' if it
  845|       |                                       cannot convert.  */
  846|      0|                                    : (res > 0
  ------------------
  |  Branch (846:40): [True: 0, False: 0]
  ------------------
  847|      0|                                       && !(out2ptr_try - out2ptr == 1
  ------------------
  |  Branch (847:45): [True: 0, False: 0]
  ------------------
  848|      0|                                            && *out2ptr == '?'))))
  ------------------
  |  Branch (848:48): [True: 0, False: 0]
  ------------------
  849|      0|                              {
  850|       |                                /* The iconv() call failed.
  851|       |                                   U+FFFD can't be converted to TO_CODESET.
  852|       |                                   Use '?' instead.  */
  853|      0|                                scratchbuf[0] = '?';
  854|      0|                                scratchlen = 1;
  855|      0|                                inptr = scratchbuf;
  856|      0|                                insize = scratchlen;
  857|      0|                                res = iconv (cd2,
  858|      0|                                             (ICONV_CONST char **) &inptr, &insize,
  859|      0|                                             &out2ptr, &out2size);
  860|      0|                              }
  861|      0|                            else
  862|      0|                              {
  863|       |                                /* Accept the results of the iconv() call.  */
  864|      0|                                out2ptr = out2ptr_try;
  865|      0|                                out2size = out2size_try;
  866|      0|                                res = 0;
  867|      0|                              }
  868|      0|                          }
  869|      0|                        else
  870|      0|                          {
  871|       |                            /* TO_CODESET is UTF-8.  */
  872|      0|                            if (out2size >= insize)
  ------------------
  |  Branch (872:33): [True: 0, False: 0]
  ------------------
  873|      0|                              {
  874|      0|                                memcpy (out2ptr, inptr, insize);
  875|      0|                                out2ptr += insize;
  876|      0|                                out2size -= insize;
  877|      0|                                inptr += insize;
  878|      0|                                insize = 0;
  879|      0|                                res = 0;
  880|      0|                              }
  881|      0|                            else
  882|      0|                              {
  883|      0|                                errno = E2BIG;
  884|      0|                                res = (size_t)(-1);
  885|      0|                              }
  886|      0|                          }
  887|      0|                        length = out2ptr - result;
  888|      0|                        if (res == (size_t)(-1) && errno == E2BIG)
  ------------------
  |  Branch (888:29): [True: 0, False: 0]
  |  Branch (888:52): [True: 0, False: 0]
  ------------------
  889|      0|                          {
  890|      0|                            char *memory;
  891|       |
  892|      0|                            allocated = 2 * allocated;
  893|      0|                            if (length + 1 + extra_alloc > allocated)
  ------------------
  |  Branch (893:33): [True: 0, False: 0]
  ------------------
  894|      0|                              abort ();
  895|      0|                            if (result == initial_result)
  ------------------
  |  Branch (895:33): [True: 0, False: 0]
  ------------------
  896|      0|                              memory = (char *) malloc (allocated);
  897|      0|                            else
  898|      0|                              memory = (char *) realloc (result, allocated);
  899|      0|                            if (memory == NULL)
  ------------------
  |  Branch (899:33): [True: 0, False: 0]
  ------------------
  900|      0|                              {
  901|      0|                                if (result != initial_result)
  ------------------
  |  Branch (901:37): [True: 0, False: 0]
  ------------------
  902|      0|                                  free (result);
  903|      0|                                errno = ENOMEM;
  904|      0|                                return -1;
  905|      0|                              }
  906|      0|                            if (result == initial_result)
  ------------------
  |  Branch (906:33): [True: 0, False: 0]
  ------------------
  907|      0|                              memcpy (memory, initial_result, length);
  908|      0|                            result = memory;
  909|      0|                            grow = false;
  910|       |
  911|      0|                            out2ptr = result + length;
  912|      0|                            out2size = allocated - extra_alloc - length;
  913|      0|                            if (cd2 != (iconv_t)(-1))
  ------------------
  |  Branch (913:33): [True: 0, False: 0]
  ------------------
  914|      0|                              res = iconv (cd2,
  915|      0|                                           (ICONV_CONST char **) &inptr,
  916|      0|                                           &insize,
  917|      0|                                           &out2ptr, &out2size);
  918|      0|                            else
  919|      0|                              {
  920|       |                                /* TO_CODESET is UTF-8.  */
  921|      0|                                if (!(out2size >= insize))
  ------------------
  |  Branch (921:37): [True: 0, False: 0]
  ------------------
  922|      0|                                  abort ();
  923|      0|                                memcpy (out2ptr, inptr, insize);
  924|      0|                                out2ptr += insize;
  925|      0|                                out2size -= insize;
  926|      0|                                inptr += insize;
  927|      0|                                insize = 0;
  928|      0|                                res = 0;
  929|      0|                              }
  930|      0|                            length = out2ptr - result;
  931|      0|                          }
  932|       |# if !(defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
  933|       |     && !(defined __GLIBC__ && !defined __UCLIBC__)
  934|       |                        /* IRIX iconv() inserts a NUL byte if it cannot convert.
  935|       |                           FreeBSD iconv(), NetBSD iconv(), and Solaris 11
  936|       |                           iconv() insert a '?' if they cannot convert.
  937|       |                           musl libc iconv() inserts a '*' if it cannot convert.
  938|       |                           Only GNU libiconv (excluding the bastard Apple iconv)
  939|       |                           and GNU libc are known to prefer to fail rather than
  940|       |                           doing a lossy conversion.  */
  941|       |                        if (res != (size_t)(-1) && res > 0)
  942|       |                          {
  943|       |                            errno = EILSEQ;
  944|       |                            res = (size_t)(-1);
  945|       |                          }
  946|       |# endif
  947|      0|                        if (res == (size_t)(-1))
  ------------------
  |  Branch (947:29): [True: 0, False: 0]
  ------------------
  948|      0|                          {
  949|       |                            /* Failure converting the ASCII replacement.  */
  950|      0|                            if (result != initial_result)
  ------------------
  |  Branch (950:33): [True: 0, False: 0]
  ------------------
  951|      0|                              free (result);
  952|      0|                            return -1;
  953|      0|                          }
  954|      0|                      }
  955|      0|                    else
  956|      0|                      {
  957|      0|                        if (result != initial_result)
  ------------------
  |  Branch (957:29): [True: 0, False: 0]
  ------------------
  958|      0|                          free (result);
  959|      0|                        return -1;
  960|      0|                      }
  961|      0|                  }
  962|      0|                if (!(in2size > 0
  ------------------
  |  Branch (962:23): [True: 0, False: 0]
  ------------------
  963|      0|                      || (in1size == 0 && !do_final_flush1 && do_final_flush2)))
  ------------------
  |  Branch (963:27): [True: 0, False: 0]
  |  Branch (963:43): [True: 0, False: 0]
  |  Branch (963:63): [True: 0, False: 0]
  ------------------
  964|      0|                  break;
  965|      0|                if (grow)
  ------------------
  |  Branch (965:21): [True: 0, False: 0]
  ------------------
  966|      0|                  {
  967|      0|                    char *memory;
  968|       |
  969|      0|                    allocated = 2 * allocated;
  970|      0|                    if (result == initial_result)
  ------------------
  |  Branch (970:25): [True: 0, False: 0]
  ------------------
  971|      0|                      memory = (char *) malloc (allocated);
  972|      0|                    else
  973|      0|                      memory = (char *) realloc (result, allocated);
  974|      0|                    if (memory == NULL)
  ------------------
  |  Branch (974:25): [True: 0, False: 0]
  ------------------
  975|      0|                      {
  976|      0|                        if (result != initial_result)
  ------------------
  |  Branch (976:29): [True: 0, False: 0]
  ------------------
  977|      0|                          free (result);
  978|      0|                        errno = ENOMEM;
  979|      0|                        return -1;
  980|      0|                      }
  981|      0|                    if (result == initial_result)
  ------------------
  |  Branch (981:25): [True: 0, False: 0]
  ------------------
  982|      0|                      memcpy (memory, initial_result, length);
  983|      0|                    result = memory;
  984|      0|                  }
  985|      0|              }
  986|       |
  987|       |            /* Move the remaining bytes to the beginning of utf8buf.  */
  988|      0|            if (in2size > 0)
  ------------------
  |  Branch (988:17): [True: 0, False: 0]
  ------------------
  989|      0|              memmove (utf8buf, in2ptr, in2size);
  990|      0|            utf8len = in2size;
  991|      0|          }
  992|       |
  993|      0|        if (res1 == (size_t)(-1))
  ------------------
  |  Branch (993:13): [True: 0, False: 0]
  ------------------
  994|      0|          {
  995|      0|            if (errno1 == EINVAL)
  ------------------
  |  Branch (995:17): [True: 0, False: 0]
  ------------------
  996|      0|              in1size = 0;
  997|      0|            else if (errno1 == EILSEQ)
  ------------------
  |  Branch (997:22): [True: 0, False: 0]
  ------------------
  998|      0|              {
  999|      0|                if (result != initial_result)
  ------------------
  |  Branch (999:21): [True: 0, False: 0]
  ------------------
 1000|      0|                  free (result);
 1001|      0|                errno = errno1;
 1002|      0|                return -1;
 1003|      0|              }
 1004|      0|          }
 1005|      0|      }
 1006|      0|# undef utf8bufsize
 1007|      0|  }
 1008|       |
 1009|      0| done:
 1010|       |  /* Now the final memory allocation.  */
 1011|      0|  if (result == tmpbuf)
  ------------------
  |  |  357|      0|# define tmpbuf tmp.buf
  ------------------
  |  Branch (1011:7): [True: 0, False: 0]
  ------------------
 1012|      0|    {
 1013|      0|      size_t memsize = length + extra_alloc;
 1014|       |
 1015|      0|      if (*resultp != NULL && *lengthp >= memsize)
  ------------------
  |  Branch (1015:11): [True: 0, False: 0]
  |  Branch (1015:31): [True: 0, False: 0]
  ------------------
 1016|      0|        result = *resultp;
 1017|      0|      else
 1018|      0|        {
 1019|      0|          char *memory;
 1020|       |
 1021|      0|          memory = (char *) malloc (memsize > 0 ? memsize : 1);
  ------------------
  |  Branch (1021:37): [True: 0, False: 0]
  ------------------
 1022|      0|          if (memory != NULL)
  ------------------
  |  Branch (1022:15): [True: 0, False: 0]
  ------------------
 1023|      0|            result = memory;
 1024|      0|          else
 1025|      0|            {
 1026|      0|              errno = ENOMEM;
 1027|      0|              return -1;
 1028|      0|            }
 1029|      0|        }
 1030|      0|      memcpy (result, tmpbuf, length);
  ------------------
  |  |  357|      0|# define tmpbuf tmp.buf
  ------------------
 1031|      0|    }
 1032|      0|  else if (result != *resultp && length + extra_alloc < allocated)
  ------------------
  |  Branch (1032:12): [True: 0, False: 0]
  |  Branch (1032:34): [True: 0, False: 0]
  ------------------
 1033|      0|    {
 1034|       |      /* Shrink the allocated memory if possible.  */
 1035|      0|      size_t memsize = length + extra_alloc;
 1036|      0|      char *memory;
 1037|       |
 1038|      0|      memory = (char *) realloc (result, memsize > 0 ? memsize : 1);
  ------------------
  |  Branch (1038:42): [True: 0, False: 0]
  ------------------
 1039|      0|      if (memory != NULL)
  ------------------
  |  Branch (1039:11): [True: 0, False: 0]
  ------------------
 1040|      0|        result = memory;
 1041|      0|    }
 1042|      0|  *resultp = result;
 1043|      0|  *lengthp = length;
 1044|      0|  return 0;
 1045|      0|# undef tmpbuf
 1046|      0|# undef tmpbufsize
 1047|      0|}

mem_iconveha:
  214|    254|{
  215|    254|  if (srclen == 0)
  ------------------
  |  Branch (215:7): [True: 0, False: 254]
  ------------------
  216|      0|    {
  217|       |      /* Nothing to convert.  */
  218|      0|      *lengthp = 0;
  219|      0|      return 0;
  220|      0|    }
  221|       |
  222|       |  /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5 or Citrus/FreeBSD/macOS
  223|       |     iconv, we want to use transliteration.  */
  224|    254|#if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) \
  225|    254|     && !defined __UCLIBC__) \
  226|    254|    || _LIBICONV_VERSION >= 0x0105 \
  227|    254|    || defined ICONV_SET_TRANSLITERATE
  228|    254|  if (transliterate)
  ------------------
  |  Branch (228:7): [True: 254, False: 0]
  ------------------
  229|    254|    {
  230|    254|      int retval;
  231|    254|      size_t len = strlen (to_codeset);
  232|    254|      char *to_codeset_suffixed = (char *) malloca (len + 10 + 1);
  ------------------
  |  |   86|    254|    ((N) < 4032 - (2 * sa_alignment_max - 1)                                   \
  |  |  ------------------
  |  |  |  Branch (86:6): [True: 254, False: 0]
  |  |  ------------------
  |  |   87|    254|     ? (void *) (((uintptr_t) (char *) alloca ((N) + 2 * sa_alignment_max - 1) \
  |  |   88|    254|                  + (2 * sa_alignment_max - 1))                                \
  |  |   89|    254|                 & ~(uintptr_t)(2 * sa_alignment_max - 1))                     \
  |  |   90|    254|     : mmalloca (N))
  ------------------
  233|    254|      if (to_codeset_suffixed == NULL)
  ------------------
  |  Branch (233:11): [True: 0, False: 254]
  ------------------
  234|      0|        {
  235|      0|          errno = ENOMEM;
  236|      0|          return -1;
  237|      0|        }
  238|    254|      memcpy (to_codeset_suffixed, to_codeset, len);
  239|    254|      memcpy (to_codeset_suffixed + len, "//TRANSLIT", 10 + 1);
  240|       |
  241|    254|      retval = mem_iconveha_notranslit (src, srclen,
  242|    254|                                        from_codeset, to_codeset_suffixed,
  243|    254|                                        handler, offsets, resultp, lengthp);
  244|       |
  245|    254|      freea (to_codeset_suffixed);
  246|       |
  247|    254|      return retval;
  248|    254|    }
  249|      0|  else
  250|      0|#endif
  251|      0|    return mem_iconveha_notranslit (src, srclen,
  252|      0|                                    from_codeset, to_codeset,
  253|      0|                                    handler, offsets, resultp, lengthp);
  254|    254|}
striconveha.c:mem_iconveha_notranslit:
  151|    254|{
  152|    254|  int retval = mem_iconveh (src, srclen, from_codeset, to_codeset, handler,
  153|    254|                            offsets, resultp, lengthp);
  154|    254|  if (retval >= 0 || errno != EINVAL)
  ------------------
  |  Branch (154:7): [True: 0, False: 254]
  |  Branch (154:22): [True: 254, False: 0]
  ------------------
  155|    254|    return retval;
  156|      0|  else
  157|      0|    {
  158|      0|      struct autodetect_alias *alias;
  159|       |
  160|       |      /* Unsupported from_codeset or to_codeset. Check whether the caller
  161|       |         requested autodetection.  */
  162|      0|      for (alias = autodetect_list; alias != NULL; alias = alias->next)
  ------------------
  |  Branch (162:37): [True: 0, False: 0]
  ------------------
  163|      0|        if (strcmp (from_codeset, alias->name) == 0)
  ------------------
  |  Branch (163:13): [True: 0, False: 0]
  ------------------
  164|      0|          {
  165|      0|            const char * const *encodings;
  166|       |
  167|      0|            if (handler != iconveh_error)
  ------------------
  |  Branch (167:17): [True: 0, False: 0]
  ------------------
  168|      0|              {
  169|       |                /* First try all encodings without any forgiving.  */
  170|      0|                encodings = alias->encodings_to_try;
  171|      0|                do
  172|      0|                  {
  173|      0|                    retval = mem_iconveha_notranslit (src, srclen,
  174|      0|                                                      *encodings, to_codeset,
  175|      0|                                                      iconveh_error, offsets,
  176|      0|                                                      resultp, lengthp);
  177|      0|                    if (!(retval < 0 && errno == EILSEQ))
  ------------------
  |  Branch (177:27): [True: 0, False: 0]
  |  Branch (177:41): [True: 0, False: 0]
  ------------------
  178|      0|                      return retval;
  179|      0|                    encodings++;
  180|      0|                  }
  181|      0|                while (*encodings != NULL);
  ------------------
  |  Branch (181:24): [True: 0, False: 0]
  ------------------
  182|      0|              }
  183|       |
  184|      0|            encodings = alias->encodings_to_try;
  185|      0|            do
  186|      0|              {
  187|      0|                retval = mem_iconveha_notranslit (src, srclen,
  188|      0|                                                  *encodings, to_codeset,
  189|      0|                                                  handler, offsets,
  190|      0|                                                  resultp, lengthp);
  191|      0|                if (!(retval < 0 && errno == EILSEQ))
  ------------------
  |  Branch (191:23): [True: 0, False: 0]
  |  Branch (191:37): [True: 0, False: 0]
  ------------------
  192|      0|                  return retval;
  193|      0|                encodings++;
  194|      0|              }
  195|      0|            while (*encodings != NULL);
  ------------------
  |  Branch (195:20): [True: 0, False: 0]
  ------------------
  196|       |
  197|       |            /* Return the last call's result.  */
  198|      0|            return -1;
  199|      0|          }
  200|       |
  201|       |      /* It wasn't an autodetection name.  */
  202|      0|      errno = EINVAL;
  203|      0|      return -1;
  204|      0|    }
  205|    254|}

u8_strconv_from_encoding:
   21|    254|{
   22|    254|  UNIT *result;
  ------------------
  |  |   31|    254|#define UNIT uint8_t
  ------------------
   23|    254|  size_t length;
   24|       |
   25|    254|  result =
   26|    254|    U_CONV_FROM_ENCODING (fromcode, handler,
  ------------------
  |  |   32|    254|#define U_CONV_FROM_ENCODING u8_conv_from_encoding
  ------------------
   27|    254|                          string, strlen (string) + 1, NULL,
   28|    254|                          NULL, &length);
   29|    254|  if (result == NULL)
  ------------------
  |  Branch (29:7): [True: 254, False: 0]
  ------------------
   30|    254|    return NULL;
   31|       |  /* Verify the result has exactly one NUL unit, at the end.  */
   32|      0|  if (!(length > 0 && result[length-1] == 0
  ------------------
  |  Branch (32:9): [True: 0, False: 0]
  |  Branch (32:23): [True: 0, False: 0]
  ------------------
   33|      0|        && U_STRLEN (result) == length-1))
  ------------------
  |  |   33|      0|#define U_STRLEN u8_strlen
  ------------------
  |  Branch (33:12): [True: 0, False: 0]
  ------------------
   34|      0|    {
   35|      0|      free (result);
   36|      0|      errno = EILSEQ;
   37|      0|      return NULL;
   38|      0|    }
   39|      0|  return result;
   40|      0|}

u8_conv_from_encoding:
   38|    254|{
   39|    254|  if (STRCASEEQ (fromcode, "UTF-8", 'U','T','F','-','8',0,0,0,0))
  ------------------
  |  |  179|    254|  strcaseeq0 (s1, s2, s20, s21, s22, s23, s24, s25, s26, s27, s28)
  |  |  ------------------
  |  |  |  Branch (179:3): [True: 0, False: 254]
  |  |  ------------------
  ------------------
   40|      0|    {
   41|       |      /* Conversion from UTF-8 to UTF-8.  No need to go through iconv().  */
   42|      0|      uint8_t *result;
   43|       |
   44|      0|      if (u8_check ((const uint8_t *) src, srclen))
  ------------------
  |  Branch (44:11): [True: 0, False: 0]
  ------------------
   45|      0|        {
   46|      0|          errno = EILSEQ;
   47|      0|          return NULL;
   48|      0|        }
   49|       |
   50|      0|      if (offsets != NULL)
  ------------------
  |  Branch (50:11): [True: 0, False: 0]
  ------------------
   51|      0|        {
   52|      0|          size_t i;
   53|       |
   54|      0|          for (i = 0; i < srclen; )
  ------------------
  |  Branch (54:23): [True: 0, False: 0]
  ------------------
   55|      0|            {
   56|      0|              int count = u8_mblen ((const uint8_t *) src + i, srclen - i);
   57|       |              /* We can rely on count > 0 because of the previous u8_check.  */
   58|      0|              if (count <= 0)
  ------------------
  |  Branch (58:19): [True: 0, False: 0]
  ------------------
   59|      0|                abort ();
   60|      0|              offsets[i] = i;
   61|      0|              i++;
   62|      0|              while (--count > 0)
  ------------------
  |  Branch (62:22): [True: 0, False: 0]
  ------------------
   63|      0|                offsets[i++] = (size_t)(-1);
   64|      0|            }
   65|      0|        }
   66|       |
   67|       |      /* Memory allocation.  */
   68|      0|      if (resultbuf != NULL && *lengthp >= srclen)
  ------------------
  |  Branch (68:11): [True: 0, False: 0]
  |  Branch (68:32): [True: 0, False: 0]
  ------------------
   69|      0|        result = resultbuf;
   70|      0|      else
   71|      0|        {
   72|      0|          result = (uint8_t *) malloc (srclen > 0 ? srclen : 1);
  ------------------
  |  Branch (72:40): [True: 0, False: 0]
  ------------------
   73|      0|          if (result == NULL)
  ------------------
  |  Branch (73:15): [True: 0, False: 0]
  ------------------
   74|      0|            {
   75|      0|              errno = ENOMEM;
   76|      0|              return NULL;
   77|      0|            }
   78|      0|        }
   79|       |
   80|      0|      if (srclen > 0)
  ------------------
  |  Branch (80:11): [True: 0, False: 0]
  ------------------
   81|      0|        memcpy ((char *) result, src, srclen);
   82|      0|      *lengthp = srclen;
   83|      0|      return result;
   84|      0|    }
   85|    254|  else
   86|    254|    {
   87|    254|      char *result = (char *) resultbuf;
   88|    254|      size_t length = *lengthp;
   89|       |
   90|    254|      if (mem_iconveha (src, srclen, fromcode, "UTF-8", true, handler,
  ------------------
  |  Branch (90:11): [True: 254, False: 0]
  ------------------
   91|    254|                        offsets, &result, &length) < 0)
   92|    254|        return NULL;
   93|       |
   94|      0|      if (result == NULL) /* when (resultbuf == NULL && length == 0)  */
  ------------------
  |  Branch (94:11): [True: 0, False: 0]
  ------------------
   95|      0|        {
   96|      0|          result = (char *) malloc (1);
   97|      0|          if (result == NULL)
  ------------------
  |  Branch (97:15): [True: 0, False: 0]
  ------------------
   98|      0|            {
   99|      0|              errno = ENOMEM;
  100|      0|              return NULL;
  101|      0|            }
  102|      0|        }
  103|      0|      *lengthp = length;
  104|      0|      return (uint8_t *) result;
  105|      0|    }
  106|    254|}

nghttp2_buf_init:
   32|  13.4k|void nghttp2_buf_init(nghttp2_buf *buf) {
   33|  13.4k|  buf->begin = NULL;
   34|  13.4k|  buf->end = NULL;
   35|  13.4k|  buf->pos = NULL;
   36|  13.4k|  buf->last = NULL;
   37|       |  buf->mark = NULL;
   38|  13.4k|}
nghttp2_buf_init2:
   40|  4.53k|int nghttp2_buf_init2(nghttp2_buf *buf, size_t initial, nghttp2_mem *mem) {
   41|  4.53k|  nghttp2_buf_init(buf);
   42|  4.53k|  return nghttp2_buf_reserve(buf, initial, mem);
   43|  4.53k|}
nghttp2_buf_free:
   45|  20.8k|void nghttp2_buf_free(nghttp2_buf *buf, nghttp2_mem *mem) {
   46|  20.8k|  if (buf == NULL) {
  ------------------
  |  Branch (46:7): [True: 0, False: 20.8k]
  ------------------
   47|      0|    return;
   48|      0|  }
   49|       |
   50|  20.8k|  nghttp2_mem_free(mem, buf->begin);
   51|       |  buf->begin = NULL;
   52|  20.8k|}
nghttp2_buf_reserve:
   54|  4.53k|int nghttp2_buf_reserve(nghttp2_buf *buf, size_t new_cap, nghttp2_mem *mem) {
   55|  4.53k|  uint8_t *ptr;
   56|  4.53k|  size_t cap;
   57|       |
   58|  4.53k|  cap = nghttp2_buf_cap(buf);
  ------------------
  |  |   57|  4.53k|#define nghttp2_buf_cap(BUF) ((size_t)((BUF)->end - (BUF)->begin))
  ------------------
   59|       |
   60|  4.53k|  if (cap >= new_cap) {
  ------------------
  |  Branch (60:7): [True: 0, False: 4.53k]
  ------------------
   61|      0|    return 0;
   62|      0|  }
   63|       |
   64|  4.53k|  new_cap = nghttp2_max_size(new_cap, cap * 2);
   65|       |
   66|  4.53k|  ptr = nghttp2_mem_realloc(mem, buf->begin, new_cap);
   67|  4.53k|  if (ptr == NULL) {
  ------------------
  |  Branch (67:7): [True: 0, False: 4.53k]
  ------------------
   68|      0|    return NGHTTP2_ERR_NOMEM;
   69|      0|  }
   70|       |
   71|  4.53k|  buf->pos = ptr + (buf->pos - buf->begin);
   72|  4.53k|  buf->last = ptr + (buf->last - buf->begin);
   73|  4.53k|  buf->mark = ptr + (buf->mark - buf->begin);
   74|  4.53k|  buf->begin = ptr;
   75|  4.53k|  buf->end = ptr + new_cap;
   76|       |
   77|  4.53k|  return 0;
   78|  4.53k|}
nghttp2_buf_reset:
   80|  67.6k|void nghttp2_buf_reset(nghttp2_buf *buf) {
   81|  67.6k|  buf->pos = buf->last = buf->mark = buf->begin;
   82|  67.6k|}
nghttp2_buf_wrap_init:
   84|  51.1k|void nghttp2_buf_wrap_init(nghttp2_buf *buf, uint8_t *begin, size_t len) {
   85|  51.1k|  buf->begin = buf->pos = buf->last = buf->mark = buf->end = begin;
   86|  51.1k|  if (len) {
  ------------------
  |  Branch (86:7): [True: 34.3k, False: 16.8k]
  ------------------
   87|  34.3k|    buf->end += len;
   88|  34.3k|  }
   89|  51.1k|}
nghttp2_bufs_init3:
  129|  4.44k|                       nghttp2_mem *mem) {
  130|  4.44k|  int rv;
  131|  4.44k|  nghttp2_buf_chain *chain;
  132|       |
  133|  4.44k|  if (chunk_keep == 0 || max_chunk < chunk_keep || chunk_length < offset) {
  ------------------
  |  Branch (133:7): [True: 0, False: 4.44k]
  |  Branch (133:26): [True: 0, False: 4.44k]
  |  Branch (133:52): [True: 0, False: 4.44k]
  ------------------
  134|      0|    return NGHTTP2_ERR_INVALID_ARGUMENT;
  135|      0|  }
  136|       |
  137|  4.44k|  rv = buf_chain_new(&chain, chunk_length, mem);
  138|  4.44k|  if (rv != 0) {
  ------------------
  |  Branch (138:7): [True: 0, False: 4.44k]
  ------------------
  139|      0|    return rv;
  140|      0|  }
  141|       |
  142|  4.44k|  bufs->mem = mem;
  143|  4.44k|  bufs->offset = offset;
  144|       |
  145|  4.44k|  bufs->head = chain;
  146|  4.44k|  bufs->cur = bufs->head;
  147|       |
  148|  4.44k|  nghttp2_buf_shift_right(&bufs->cur->buf, offset);
  ------------------
  |  |   63|  4.44k|  do {                                                                         \
  |  |   64|  4.44k|    (BUF)->pos += AMT;                                                         \
  |  |   65|  4.44k|    (BUF)->last += AMT;                                                        \
  |  |   66|  4.44k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (66:12): [Folded, False: 4.44k]
  |  |  ------------------
  ------------------
  149|       |
  150|  4.44k|  bufs->chunk_length = chunk_length;
  151|  4.44k|  bufs->chunk_used = 1;
  152|  4.44k|  bufs->max_chunk = max_chunk;
  153|  4.44k|  bufs->chunk_keep = chunk_keep;
  154|       |
  155|  4.44k|  return 0;
  156|  4.44k|}
nghttp2_bufs_free:
  184|  4.44k|void nghttp2_bufs_free(nghttp2_bufs *bufs) {
  185|  4.44k|  nghttp2_buf_chain *chain, *next_chain;
  186|       |
  187|  4.44k|  if (bufs == NULL) {
  ------------------
  |  Branch (187:7): [True: 0, False: 4.44k]
  ------------------
  188|      0|    return;
  189|      0|  }
  190|       |
  191|  8.89k|  for (chain = bufs->head; chain;) {
  ------------------
  |  Branch (191:28): [True: 4.44k, False: 4.44k]
  ------------------
  192|  4.44k|    next_chain = chain->next;
  193|       |
  194|  4.44k|    buf_chain_del(chain, bufs->mem);
  195|       |
  196|  4.44k|    chain = next_chain;
  197|  4.44k|  }
  198|       |
  199|       |  bufs->head = NULL;
  200|  4.44k|}
nghttp2_bufs_len:
  291|  4.40k|size_t nghttp2_bufs_len(nghttp2_bufs *bufs) {
  292|  4.40k|  nghttp2_buf_chain *ci;
  293|  4.40k|  size_t len;
  294|       |
  295|  4.40k|  len = 0;
  296|  8.89k|  for (ci = bufs->head; ci; ci = ci->next) {
  ------------------
  |  Branch (296:25): [True: 4.49k, False: 4.40k]
  ------------------
  297|  4.49k|    len += nghttp2_buf_len(&ci->buf);
  ------------------
  |  |   54|  4.49k|#define nghttp2_buf_len(BUF) ((size_t)((BUF)->last - (BUF)->pos))
  ------------------
  298|  4.49k|  }
  299|       |
  300|  4.40k|  return len;
  301|  4.40k|}
nghttp2_bufs_add:
  335|   267k|int nghttp2_bufs_add(nghttp2_bufs *bufs, const void *data, size_t len) {
  336|   267k|  int rv;
  337|   267k|  size_t nwrite;
  338|   267k|  nghttp2_buf *buf;
  339|   267k|  const uint8_t *p;
  340|       |
  341|   267k|  p = data;
  342|       |
  343|   522k|  while (len) {
  ------------------
  |  Branch (343:10): [True: 255k, False: 267k]
  ------------------
  344|   255k|    buf = &bufs->cur->buf;
  345|       |
  346|   255k|    nwrite = nghttp2_min_size(nghttp2_buf_avail(buf), len);
  ------------------
  |  |   55|   255k|#define nghttp2_buf_avail(BUF) ((size_t)((BUF)->end - (BUF)->last))
  ------------------
  347|   255k|    if (nwrite == 0) {
  ------------------
  |  Branch (347:9): [True: 72, False: 255k]
  ------------------
  348|     72|      rv = bufs_alloc_chain(bufs);
  349|     72|      if (rv != 0) {
  ------------------
  |  Branch (349:11): [True: 0, False: 72]
  ------------------
  350|      0|        return rv;
  351|      0|      }
  352|     72|      continue;
  353|     72|    }
  354|       |
  355|   255k|    buf->last = nghttp2_cpymem(buf->last, p, nwrite);
  356|   255k|    p += nwrite;
  357|   255k|    len -= nwrite;
  358|   255k|  }
  359|       |
  360|   267k|  return 0;
  361|   267k|}
nghttp2_bufs_addb:
  381|   109k|int nghttp2_bufs_addb(nghttp2_bufs *bufs, uint8_t b) {
  382|   109k|  int rv;
  383|       |
  384|   109k|  rv = bufs_ensure_addb(bufs);
  385|   109k|  if (rv != 0) {
  ------------------
  |  Branch (385:7): [True: 0, False: 109k]
  ------------------
  386|      0|    return rv;
  387|      0|  }
  388|       |
  389|   109k|  *bufs->cur->buf.last++ = b;
  390|       |
  391|   109k|  return 0;
  392|   109k|}
nghttp2_bufs_reset:
  486|  48.1k|void nghttp2_bufs_reset(nghttp2_bufs *bufs) {
  487|  48.1k|  nghttp2_buf_chain *chain, *ci;
  488|  48.1k|  size_t k;
  489|       |
  490|  48.1k|  k = bufs->chunk_keep;
  491|       |
  492|  48.1k|  for (ci = bufs->head; ci; ci = ci->next) {
  ------------------
  |  Branch (492:25): [True: 48.1k, False: 0]
  ------------------
  493|  48.1k|    nghttp2_buf_reset(&ci->buf);
  494|  48.1k|    nghttp2_buf_shift_right(&ci->buf, bufs->offset);
  ------------------
  |  |   63|  48.1k|  do {                                                                         \
  |  |   64|  48.1k|    (BUF)->pos += AMT;                                                         \
  |  |   65|  48.1k|    (BUF)->last += AMT;                                                        \
  |  |   66|  48.1k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (66:12): [Folded, False: 48.1k]
  |  |  ------------------
  ------------------
  495|       |
  496|  48.1k|    if (--k == 0) {
  ------------------
  |  Branch (496:9): [True: 48.1k, False: 0]
  ------------------
  497|  48.1k|      break;
  498|  48.1k|    }
  499|  48.1k|  }
  500|       |
  501|  48.1k|  if (ci) {
  ------------------
  |  Branch (501:7): [True: 48.1k, False: 0]
  ------------------
  502|  48.1k|    chain = ci->next;
  503|  48.1k|    ci->next = NULL;
  504|       |
  505|  48.2k|    for (ci = chain; ci;) {
  ------------------
  |  Branch (505:22): [True: 88, False: 48.1k]
  ------------------
  506|     88|      chain = ci->next;
  507|       |
  508|     88|      buf_chain_del(ci, bufs->mem);
  509|       |
  510|     88|      ci = chain;
  511|     88|    }
  512|       |
  513|  48.1k|    bufs->chunk_used = bufs->chunk_keep;
  514|  48.1k|  }
  515|       |
  516|  48.1k|  bufs->cur = bufs->head;
  517|  48.1k|}
nghttp2_bufs_next_present:
  521|  8.98k|int nghttp2_bufs_next_present(nghttp2_bufs *bufs) {
  522|  8.98k|  nghttp2_buf_chain *chain;
  523|       |
  524|  8.98k|  chain = bufs->cur->next;
  525|       |
  526|  8.98k|  return chain && nghttp2_buf_len(&chain->buf);
  ------------------
  |  |   54|    176|#define nghttp2_buf_len(BUF) ((size_t)((BUF)->last - (BUF)->pos))
  |  |  ------------------
  |  |  |  Branch (54:30): [True: 176, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (526:10): [True: 176, False: 8.80k]
  ------------------
  527|  8.98k|}
nghttp2_buf.c:buf_chain_new:
   92|  4.53k|                         nghttp2_mem *mem) {
   93|  4.53k|  int rv;
   94|       |
   95|  4.53k|  *chain = nghttp2_mem_malloc(mem, sizeof(nghttp2_buf_chain));
   96|  4.53k|  if (*chain == NULL) {
  ------------------
  |  Branch (96:7): [True: 0, False: 4.53k]
  ------------------
   97|      0|    return NGHTTP2_ERR_NOMEM;
   98|      0|  }
   99|       |
  100|  4.53k|  (*chain)->next = NULL;
  101|       |
  102|  4.53k|  rv = nghttp2_buf_init2(&(*chain)->buf, chunk_length, mem);
  103|  4.53k|  if (rv != 0) {
  ------------------
  |  Branch (103:7): [True: 0, False: 4.53k]
  ------------------
  104|      0|    nghttp2_mem_free(mem, *chain);
  105|      0|    return NGHTTP2_ERR_NOMEM;
  106|      0|  }
  107|       |
  108|  4.53k|  return 0;
  109|  4.53k|}
nghttp2_buf.c:buf_chain_del:
  111|  4.53k|static void buf_chain_del(nghttp2_buf_chain *chain, nghttp2_mem *mem) {
  112|  4.53k|  nghttp2_buf_free(&chain->buf, mem);
  113|  4.53k|  nghttp2_mem_free(mem, chain);
  114|  4.53k|}
nghttp2_buf.c:bufs_alloc_chain:
  303|     88|static int bufs_alloc_chain(nghttp2_bufs *bufs) {
  304|     88|  int rv;
  305|     88|  nghttp2_buf_chain *chain;
  306|       |
  307|     88|  if (bufs->cur->next) {
  ------------------
  |  Branch (307:7): [True: 0, False: 88]
  ------------------
  308|      0|    bufs->cur = bufs->cur->next;
  309|       |
  310|      0|    return 0;
  311|      0|  }
  312|       |
  313|     88|  if (bufs->max_chunk == bufs->chunk_used) {
  ------------------
  |  Branch (313:7): [True: 0, False: 88]
  ------------------
  314|      0|    return NGHTTP2_ERR_BUFFER_ERROR;
  315|      0|  }
  316|       |
  317|     88|  rv = buf_chain_new(&chain, bufs->chunk_length, bufs->mem);
  318|     88|  if (rv != 0) {
  ------------------
  |  Branch (318:7): [True: 0, False: 88]
  ------------------
  319|      0|    return rv;
  320|      0|  }
  321|       |
  322|     88|  DEBUGF("new buffer %zu bytes allocated for bufs %p, used %zu\n",
  ------------------
  |  |   39|     88|    do {                                                                       \
  |  |   40|     88|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 88]
  |  |  ------------------
  ------------------
  323|     88|         bufs->chunk_length, bufs, bufs->chunk_used);
  324|       |
  325|     88|  ++bufs->chunk_used;
  326|       |
  327|     88|  bufs->cur->next = chain;
  328|     88|  bufs->cur = chain;
  329|       |
  330|     88|  nghttp2_buf_shift_right(&bufs->cur->buf, bufs->offset);
  ------------------
  |  |   63|     88|  do {                                                                         \
  |  |   64|     88|    (BUF)->pos += AMT;                                                         \
  |  |   65|     88|    (BUF)->last += AMT;                                                        \
  |  |   66|     88|  } while (0)
  |  |  ------------------
  |  |  |  Branch (66:12): [Folded, False: 88]
  |  |  ------------------
  ------------------
  331|       |
  332|     88|  return 0;
  333|     88|}
nghttp2_buf.c:bufs_ensure_addb:
  363|   109k|static int bufs_ensure_addb(nghttp2_bufs *bufs) {
  364|   109k|  int rv;
  365|   109k|  nghttp2_buf *buf;
  366|       |
  367|   109k|  buf = &bufs->cur->buf;
  368|       |
  369|   109k|  if (nghttp2_buf_avail(buf) > 0) {
  ------------------
  |  |   55|   109k|#define nghttp2_buf_avail(BUF) ((size_t)((BUF)->end - (BUF)->last))
  ------------------
  |  Branch (369:7): [True: 109k, False: 16]
  ------------------
  370|   109k|    return 0;
  371|   109k|  }
  372|       |
  373|     16|  rv = bufs_alloc_chain(bufs);
  374|     16|  if (rv != 0) {
  ------------------
  |  Branch (374:7): [True: 0, False: 16]
  ------------------
  375|      0|    return rv;
  376|      0|  }
  377|       |
  378|     16|  return 0;
  379|     16|}

nghttp2_session_callbacks_new:
   29|  4.44k|int nghttp2_session_callbacks_new(nghttp2_session_callbacks **callbacks_ptr) {
   30|  4.44k|  *callbacks_ptr = calloc(1, sizeof(nghttp2_session_callbacks));
   31|       |
   32|  4.44k|  if (*callbacks_ptr == NULL) {
  ------------------
  |  Branch (32:7): [True: 0, False: 4.44k]
  ------------------
   33|      0|    return NGHTTP2_ERR_NOMEM;
   34|      0|  }
   35|       |
   36|  4.44k|  return 0;
   37|  4.44k|}
nghttp2_session_callbacks_del:
   39|  4.44k|void nghttp2_session_callbacks_del(nghttp2_session_callbacks *callbacks) {
   40|  4.44k|  free(callbacks);
   41|  4.44k|}
nghttp2_session_callbacks_set_send_callback:
   44|  4.44k|  nghttp2_session_callbacks *cbs, nghttp2_send_callback send_callback) {
   45|  4.44k|  cbs->send_callback = send_callback;
   46|  4.44k|}
nghttp2_session_callbacks_set_on_frame_recv_callback:
   65|  4.44k|  nghttp2_on_frame_recv_callback on_frame_recv_callback) {
   66|  4.44k|  cbs->on_frame_recv_callback = on_frame_recv_callback;
   67|  4.44k|}
nghttp2_session_callbacks_set_on_invalid_frame_recv_callback:
   71|  4.44k|  nghttp2_on_invalid_frame_recv_callback on_invalid_frame_recv_callback) {
   72|  4.44k|  cbs->on_invalid_frame_recv_callback = on_invalid_frame_recv_callback;
   73|  4.44k|}
nghttp2_session_callbacks_set_on_data_chunk_recv_callback:
   77|  4.44k|  nghttp2_on_data_chunk_recv_callback on_data_chunk_recv_callback) {
   78|  4.44k|  cbs->on_data_chunk_recv_callback = on_data_chunk_recv_callback;
   79|  4.44k|}
nghttp2_session_callbacks_set_on_frame_send_callback:
   89|  4.44k|  nghttp2_on_frame_send_callback on_frame_send_callback) {
   90|  4.44k|  cbs->on_frame_send_callback = on_frame_send_callback;
   91|  4.44k|}
nghttp2_session_callbacks_set_on_stream_close_callback:
  101|  4.44k|  nghttp2_on_stream_close_callback on_stream_close_callback) {
  102|  4.44k|  cbs->on_stream_close_callback = on_stream_close_callback;
  103|  4.44k|}
nghttp2_session_callbacks_set_on_begin_headers_callback:
  107|  4.44k|  nghttp2_on_begin_headers_callback on_begin_headers_callback) {
  108|  4.44k|  cbs->on_begin_headers_callback = on_begin_headers_callback;
  109|  4.44k|}
nghttp2_session_callbacks_set_on_header_callback:
  113|  4.44k|  nghttp2_on_header_callback on_header_callback) {
  114|  4.44k|  cbs->on_header_callback = on_header_callback;
  115|  4.44k|}
nghttp2_session_callbacks_set_error_callback:
  196|  4.44k|  nghttp2_session_callbacks *cbs, nghttp2_error_callback error_callback) {
  197|  4.44k|  cbs->error_callback = error_callback;
  198|  4.44k|}

nghttp2_frame_pack_frame_hd:
   37|  23.7k|void nghttp2_frame_pack_frame_hd(uint8_t *buf, const nghttp2_frame_hd *hd) {
   38|  23.7k|  nghttp2_put_uint32be(&buf[0], (uint32_t)(hd->length << 8));
   39|  23.7k|  buf[3] = hd->type;
   40|  23.7k|  buf[4] = hd->flags;
   41|  23.7k|  nghttp2_put_uint32be(&buf[5], (uint32_t)hd->stream_id);
   42|       |  /* ignore hd->reserved for now */
   43|  23.7k|}
nghttp2_frame_unpack_frame_hd:
   45|  11.0k|void nghttp2_frame_unpack_frame_hd(nghttp2_frame_hd *hd, const uint8_t *buf) {
   46|  11.0k|  hd->length = nghttp2_get_uint32(&buf[0]) >> 8;
   47|  11.0k|  hd->type = buf[3];
   48|  11.0k|  hd->flags = buf[4];
   49|  11.0k|  hd->stream_id = nghttp2_get_uint32(&buf[5]) & NGHTTP2_STREAM_ID_MASK;
  ------------------
  |  |   36|  11.0k|#define NGHTTP2_STREAM_ID_MASK ((1u << 31) - 1)
  ------------------
   50|  11.0k|  hd->reserved = 0;
   51|  11.0k|}
nghttp2_frame_hd_init:
   54|  34.3k|                           uint8_t flags, int32_t stream_id) {
   55|  34.3k|  hd->length = length;
   56|  34.3k|  hd->type = type;
   57|  34.3k|  hd->flags = flags;
   58|  34.3k|  hd->stream_id = stream_id;
   59|  34.3k|  hd->reserved = 0;
   60|  34.3k|}
nghttp2_frame_headers_init:
   65|  4.40k|                                nghttp2_nv *nva, size_t nvlen) {
   66|  4.40k|  nghttp2_frame_hd_init(&frame->hd, 0, NGHTTP2_HEADERS, flags, stream_id);
   67|  4.40k|  frame->padlen = 0;
   68|  4.40k|  frame->nva = nva;
   69|  4.40k|  frame->nvlen = nvlen;
   70|  4.40k|  frame->cat = cat;
   71|       |
   72|  4.40k|  if (pri_spec) {
  ------------------
  |  Branch (72:7): [True: 0, False: 4.40k]
  ------------------
   73|      0|    frame->pri_spec = *pri_spec;
   74|  4.40k|  } else {
   75|  4.40k|    nghttp2_priority_spec_default_init(&frame->pri_spec);
   76|  4.40k|  }
   77|  4.40k|}
nghttp2_frame_headers_free:
   79|  6.55k|void nghttp2_frame_headers_free(nghttp2_headers *frame, nghttp2_mem *mem) {
   80|  6.55k|  nghttp2_nv_array_del(frame->nva, mem);
   81|  6.55k|}
nghttp2_frame_priority_free:
   90|     17|void nghttp2_frame_priority_free(nghttp2_priority *frame) { (void)frame; }
nghttp2_frame_rst_stream_init:
   93|  4.03k|                                   uint32_t error_code) {
   94|  4.03k|  nghttp2_frame_hd_init(&frame->hd, 4, NGHTTP2_RST_STREAM, NGHTTP2_FLAG_NONE,
   95|  4.03k|                        stream_id);
   96|  4.03k|  frame->error_code = error_code;
   97|  4.03k|}
nghttp2_frame_rst_stream_free:
   99|  4.32k|void nghttp2_frame_rst_stream_free(nghttp2_rst_stream *frame) { (void)frame; }
nghttp2_frame_settings_init:
  102|  8.43k|                                 nghttp2_settings_entry *iv, size_t niv) {
  103|  8.43k|  nghttp2_frame_hd_init(&frame->hd, niv * NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH,
  ------------------
  |  |   61|  8.43k|#define NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH 6
  ------------------
  104|  8.43k|                        NGHTTP2_SETTINGS, flags, 0);
  105|  8.43k|  frame->niv = niv;
  106|  8.43k|  frame->iv = iv;
  107|  8.43k|}
nghttp2_frame_settings_free:
  109|  12.8k|void nghttp2_frame_settings_free(nghttp2_settings *frame, nghttp2_mem *mem) {
  110|  12.8k|  nghttp2_mem_free(mem, frame->iv);
  111|  12.8k|}
nghttp2_frame_push_promise_free:
  126|    227|                                     nghttp2_mem *mem) {
  127|    227|  nghttp2_nv_array_del(frame->nva, mem);
  128|    227|}
nghttp2_frame_ping_init:
  131|     98|                             const uint8_t *opaque_data) {
  132|     98|  nghttp2_frame_hd_init(&frame->hd, 8, NGHTTP2_PING, flags, 0);
  133|     98|  if (opaque_data) {
  ------------------
  |  Branch (133:7): [True: 98, False: 0]
  ------------------
  134|     98|    memcpy(frame->opaque_data, opaque_data, sizeof(frame->opaque_data));
  135|     98|  } else {
  136|      0|    memset(frame->opaque_data, 0, sizeof(frame->opaque_data));
  137|      0|  }
  138|     98|}
nghttp2_frame_ping_free:
  140|    251|void nghttp2_frame_ping_free(nghttp2_ping *frame) { (void)frame; }
nghttp2_frame_goaway_init:
  144|  3.85k|                               size_t opaque_data_len) {
  145|  3.85k|  nghttp2_frame_hd_init(&frame->hd, 8 + opaque_data_len, NGHTTP2_GOAWAY,
  146|  3.85k|                        NGHTTP2_FLAG_NONE, 0);
  147|  3.85k|  frame->last_stream_id = last_stream_id;
  148|  3.85k|  frame->error_code = error_code;
  149|  3.85k|  frame->opaque_data = opaque_data;
  150|  3.85k|  frame->opaque_data_len = opaque_data_len;
  151|  3.85k|  frame->reserved = 0;
  152|  3.85k|}
nghttp2_frame_goaway_free:
  154|  4.37k|void nghttp2_frame_goaway_free(nghttp2_goaway *frame, nghttp2_mem *mem) {
  155|  4.37k|  nghttp2_mem_free(mem, frame->opaque_data);
  156|  4.37k|}
nghttp2_frame_window_update_init:
  160|  13.0k|                                      int32_t window_size_increment) {
  161|  13.0k|  nghttp2_frame_hd_init(&frame->hd, 4, NGHTTP2_WINDOW_UPDATE, flags, stream_id);
  162|  13.0k|  frame->window_size_increment = window_size_increment;
  163|  13.0k|  frame->reserved = 0;
  164|  13.0k|}
nghttp2_frame_window_update_free:
  166|  13.2k|void nghttp2_frame_window_update_free(nghttp2_window_update *frame) {
  167|  13.2k|  (void)frame;
  168|  13.2k|}
nghttp2_frame_trail_padlen:
  170|  6.21k|size_t nghttp2_frame_trail_padlen(nghttp2_frame *frame, size_t padlen) {
  171|       |  /* We have iframe->padlen == 0, but iframe->frame.hd.flags may have
  172|       |     NGHTTP2_FLAG_PADDED set.  This happens when receiving
  173|       |     CONTINUATION frame, since we don't reset flags after HEADERS was
  174|       |     received. */
  175|  6.21k|  if (padlen == 0) {
  ------------------
  |  Branch (175:7): [True: 3.43k, False: 2.77k]
  ------------------
  176|  3.43k|    return 0;
  177|  3.43k|  }
  178|  2.77k|  return padlen - ((frame->hd.flags & NGHTTP2_FLAG_PADDED) > 0);
  179|  6.21k|}
nghttp2_frame_data_init:
  182|    487|                             int32_t stream_id) {
  183|       |  /* At this moment, the length of DATA frame is unknown */
  184|    487|  nghttp2_frame_hd_init(&frame->hd, 0, NGHTTP2_DATA, flags, stream_id);
  185|    487|  frame->padlen = 0;
  186|    487|}
nghttp2_frame_data_free:
  188|    487|void nghttp2_frame_data_free(nghttp2_data *frame) { (void)frame; }
nghttp2_frame_priority_len:
  281|  6.50k|size_t nghttp2_frame_priority_len(uint8_t flags) {
  282|  6.50k|  if (flags & NGHTTP2_FLAG_PRIORITY) {
  ------------------
  |  Branch (282:7): [True: 534, False: 5.97k]
  ------------------
  283|    534|    return NGHTTP2_PRIORITY_SPECLEN;
  ------------------
  |  |   64|    534|#define NGHTTP2_PRIORITY_SPECLEN 5
  ------------------
  284|    534|  }
  285|       |
  286|  5.97k|  return 0;
  287|  6.50k|}
nghttp2_frame_headers_payload_nv_offset:
  289|  4.40k|size_t nghttp2_frame_headers_payload_nv_offset(nghttp2_headers *frame) {
  290|  4.40k|  return nghttp2_frame_priority_len(frame->hd.flags);
  291|  4.40k|}
nghttp2_frame_pack_headers:
  362|  4.40k|                               nghttp2_hd_deflater *deflater) {
  363|  4.40k|  size_t nv_offset;
  364|  4.40k|  int rv;
  365|  4.40k|  nghttp2_buf *buf;
  366|       |
  367|  4.40k|  assert(bufs->head == bufs->cur);
  ------------------
  |  Branch (367:3): [True: 0, False: 4.40k]
  |  Branch (367:3): [True: 4.40k, False: 0]
  ------------------
  368|       |
  369|  4.40k|  nv_offset = nghttp2_frame_headers_payload_nv_offset(frame);
  370|       |
  371|  4.40k|  buf = &bufs->cur->buf;
  372|       |
  373|  4.40k|  buf->pos += nv_offset;
  374|  4.40k|  buf->last = buf->pos;
  375|       |
  376|       |  /* This call will adjust buf->last to the correct position */
  377|  4.40k|  rv = nghttp2_hd_deflate_hd_bufs(deflater, bufs, frame->nva, frame->nvlen);
  378|       |
  379|  4.40k|  if (rv == NGHTTP2_ERR_BUFFER_ERROR) {
  ------------------
  |  Branch (379:7): [True: 0, False: 4.40k]
  ------------------
  380|      0|    rv = NGHTTP2_ERR_HEADER_COMP;
  381|      0|  }
  382|       |
  383|  4.40k|  buf->pos -= nv_offset;
  384|       |
  385|  4.40k|  if (rv != 0) {
  ------------------
  |  Branch (385:7): [True: 0, False: 4.40k]
  ------------------
  386|      0|    return rv;
  387|      0|  }
  388|       |
  389|  4.40k|  if (frame->hd.flags & NGHTTP2_FLAG_PRIORITY) {
  ------------------
  |  Branch (389:7): [True: 0, False: 4.40k]
  ------------------
  390|      0|    nghttp2_frame_pack_priority_spec(buf->pos, &frame->pri_spec);
  391|      0|  }
  392|       |
  393|  4.40k|  frame->padlen = 0;
  394|  4.40k|  frame->hd.length = nghttp2_bufs_len(bufs);
  395|       |
  396|  4.40k|  return frame_pack_headers_shared(bufs, &frame->hd);
  397|  4.40k|}
nghttp2_frame_unpack_priority_spec:
  409|    526|                                        const uint8_t *payload) {
  410|    526|  int32_t dep_stream_id;
  411|    526|  uint8_t exclusive;
  412|    526|  int32_t weight;
  413|       |
  414|    526|  dep_stream_id = nghttp2_get_uint32(payload) & NGHTTP2_STREAM_ID_MASK;
  ------------------
  |  |   36|    526|#define NGHTTP2_STREAM_ID_MASK ((1u << 31) - 1)
  ------------------
  415|    526|  exclusive = (payload[0] & 0x80) > 0;
  416|    526|  weight = payload[4] + 1;
  417|       |
  418|    526|  nghttp2_priority_spec_init(pri_spec, dep_stream_id, weight, exclusive);
  419|    526|}
nghttp2_frame_unpack_headers_payload:
  422|  2.09k|                                          const uint8_t *payload) {
  423|  2.09k|  if (frame->hd.flags & NGHTTP2_FLAG_PRIORITY) {
  ------------------
  |  Branch (423:7): [True: 526, False: 1.56k]
  ------------------
  424|    526|    nghttp2_frame_unpack_priority_spec(&frame->pri_spec, payload);
  425|  1.56k|  } else {
  426|  1.56k|    nghttp2_priority_spec_default_init(&frame->pri_spec);
  427|  1.56k|  }
  428|       |
  429|       |  frame->nva = NULL;
  430|  2.09k|  frame->nvlen = 0;
  431|  2.09k|}
nghttp2_frame_pack_rst_stream:
  457|  1.56k|                                   nghttp2_rst_stream *frame) {
  458|  1.56k|  nghttp2_buf *buf;
  459|       |
  460|  1.56k|  assert(bufs->head == bufs->cur);
  ------------------
  |  Branch (460:3): [True: 0, False: 1.56k]
  |  Branch (460:3): [True: 1.56k, False: 0]
  ------------------
  461|       |
  462|  1.56k|  buf = &bufs->head->buf;
  463|       |
  464|  1.56k|  assert(nghttp2_buf_avail(buf) >= 4);
  ------------------
  |  Branch (464:3): [True: 0, False: 1.56k]
  |  Branch (464:3): [True: 1.56k, False: 0]
  ------------------
  465|       |
  466|  1.56k|  buf->pos -= NGHTTP2_FRAME_HDLEN;
  ------------------
  |  |   40|  1.56k|#define NGHTTP2_FRAME_HDLEN 9
  ------------------
  467|       |
  468|  1.56k|  nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
  469|       |
  470|  1.56k|  nghttp2_put_uint32be(buf->last, frame->error_code);
  471|  1.56k|  buf->last += 4;
  472|  1.56k|}
nghttp2_frame_unpack_rst_stream_payload:
  475|    276|                                             const uint8_t *payload) {
  476|    276|  frame->error_code = nghttp2_get_uint32(payload);
  477|    276|}
nghttp2_frame_pack_settings:
  479|  6.13k|int nghttp2_frame_pack_settings(nghttp2_bufs *bufs, nghttp2_settings *frame) {
  480|  6.13k|  nghttp2_buf *buf;
  481|       |
  482|  6.13k|  assert(bufs->head == bufs->cur);
  ------------------
  |  Branch (482:3): [True: 0, False: 6.13k]
  |  Branch (482:3): [True: 6.13k, False: 0]
  ------------------
  483|       |
  484|  6.13k|  buf = &bufs->head->buf;
  485|       |
  486|  6.13k|  if (nghttp2_buf_avail(buf) < frame->hd.length) {
  ------------------
  |  |   55|  6.13k|#define nghttp2_buf_avail(BUF) ((size_t)((BUF)->end - (BUF)->last))
  ------------------
  |  Branch (486:7): [True: 0, False: 6.13k]
  ------------------
  487|      0|    return NGHTTP2_ERR_FRAME_SIZE_ERROR;
  488|      0|  }
  489|       |
  490|  6.13k|  buf->pos -= NGHTTP2_FRAME_HDLEN;
  ------------------
  |  |   40|  6.13k|#define NGHTTP2_FRAME_HDLEN 9
  ------------------
  491|       |
  492|  6.13k|  nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
  493|       |
  494|  6.13k|  buf->last +=
  495|  6.13k|    nghttp2_frame_pack_settings_payload(buf->last, frame->iv, frame->niv);
  496|       |
  497|  6.13k|  return 0;
  498|  6.13k|}
nghttp2_frame_pack_settings_payload:
  502|  6.15k|                                           size_t niv) {
  503|  6.15k|  size_t i;
  504|  19.5k|  for (i = 0; i < niv; ++i, buf += NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH) {
  ------------------
  |  |   61|  13.4k|#define NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH 6
  ------------------
  |  Branch (504:15): [True: 13.4k, False: 6.15k]
  ------------------
  505|  13.4k|    nghttp2_put_uint16be(buf, (uint16_t)iv[i].settings_id);
  506|  13.4k|    nghttp2_put_uint32be(buf + 2, iv[i].value);
  507|  13.4k|  }
  508|  6.15k|  return NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH * niv;
  ------------------
  |  |   61|  6.15k|#define NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH 6
  ------------------
  509|  6.15k|}
nghttp2_frame_unpack_settings_payload:
  513|  4.34k|                                           size_t niv) {
  514|  4.34k|  frame->iv = iv;
  515|  4.34k|  frame->niv = niv;
  516|  4.34k|}
nghttp2_frame_unpack_settings_entry:
  519|  12.2k|                                         const uint8_t *payload) {
  520|  12.2k|  iv->settings_id = nghttp2_get_uint16(&payload[0]);
  521|  12.2k|  iv->value = nghttp2_get_uint32(&payload[2]);
  522|  12.2k|}
nghttp2_frame_unpack_push_promise_payload:
  590|    212|                                               const uint8_t *payload) {
  591|    212|  frame->promised_stream_id =
  592|    212|    nghttp2_get_uint32(payload) & NGHTTP2_STREAM_ID_MASK;
  ------------------
  |  |   36|    212|#define NGHTTP2_STREAM_ID_MASK ((1u << 31) - 1)
  ------------------
  593|       |  frame->nva = NULL;
  594|    212|  frame->nvlen = 0;
  595|    212|}
nghttp2_frame_pack_ping:
  597|     52|void nghttp2_frame_pack_ping(nghttp2_bufs *bufs, nghttp2_ping *frame) {
  598|     52|  nghttp2_buf *buf;
  599|       |
  600|     52|  assert(bufs->head == bufs->cur);
  ------------------
  |  Branch (600:3): [True: 0, False: 52]
  |  Branch (600:3): [True: 52, False: 0]
  ------------------
  601|       |
  602|     52|  buf = &bufs->head->buf;
  603|       |
  604|     52|  assert(nghttp2_buf_avail(buf) >= 8);
  ------------------
  |  Branch (604:3): [True: 0, False: 52]
  |  Branch (604:3): [True: 52, False: 0]
  ------------------
  605|       |
  606|     52|  buf->pos -= NGHTTP2_FRAME_HDLEN;
  ------------------
  |  |   40|     52|#define NGHTTP2_FRAME_HDLEN 9
  ------------------
  607|       |
  608|     52|  nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
  609|       |
  610|     52|  buf->last =
  611|     52|    nghttp2_cpymem(buf->last, frame->opaque_data, sizeof(frame->opaque_data));
  612|     52|}
nghttp2_frame_unpack_ping_payload:
  615|    135|                                       const uint8_t *payload) {
  616|    135|  memcpy(frame->opaque_data, payload, sizeof(frame->opaque_data));
  617|    135|}
nghttp2_frame_pack_goaway:
  619|  3.85k|int nghttp2_frame_pack_goaway(nghttp2_bufs *bufs, nghttp2_goaway *frame) {
  620|  3.85k|  int rv;
  621|  3.85k|  nghttp2_buf *buf;
  622|       |
  623|  3.85k|  assert(bufs->head == bufs->cur);
  ------------------
  |  Branch (623:3): [True: 0, False: 3.85k]
  |  Branch (623:3): [True: 3.85k, False: 0]
  ------------------
  624|       |
  625|  3.85k|  buf = &bufs->head->buf;
  626|       |
  627|  3.85k|  buf->pos -= NGHTTP2_FRAME_HDLEN;
  ------------------
  |  |   40|  3.85k|#define NGHTTP2_FRAME_HDLEN 9
  ------------------
  628|       |
  629|  3.85k|  nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
  630|       |
  631|  3.85k|  nghttp2_put_uint32be(buf->last, (uint32_t)frame->last_stream_id);
  632|  3.85k|  buf->last += 4;
  633|       |
  634|  3.85k|  nghttp2_put_uint32be(buf->last, frame->error_code);
  635|  3.85k|  buf->last += 4;
  636|       |
  637|  3.85k|  rv = nghttp2_bufs_add(bufs, frame->opaque_data, frame->opaque_data_len);
  638|       |
  639|  3.85k|  if (rv == NGHTTP2_ERR_BUFFER_ERROR) {
  ------------------
  |  Branch (639:7): [True: 0, False: 3.85k]
  ------------------
  640|      0|    return NGHTTP2_ERR_FRAME_SIZE_ERROR;
  641|      0|  }
  642|       |
  643|  3.85k|  if (rv != 0) {
  ------------------
  |  Branch (643:7): [True: 0, False: 3.85k]
  ------------------
  644|      0|    return rv;
  645|      0|  }
  646|       |
  647|  3.85k|  return 0;
  648|  3.85k|}
nghttp2_frame_unpack_goaway_payload:
  653|    493|                                         size_t var_gift_payloadlen) {
  654|    493|  frame->last_stream_id = nghttp2_get_uint32(payload) & NGHTTP2_STREAM_ID_MASK;
  ------------------
  |  |   36|    493|#define NGHTTP2_STREAM_ID_MASK ((1u << 31) - 1)
  ------------------
  655|    493|  frame->error_code = nghttp2_get_uint32(payload + 4);
  656|       |
  657|    493|  frame->opaque_data = var_gift_payload;
  658|    493|  frame->opaque_data_len = var_gift_payloadlen;
  659|    493|}
nghttp2_frame_pack_window_update:
  692|  6.84k|                                      nghttp2_window_update *frame) {
  693|  6.84k|  nghttp2_buf *buf;
  694|       |
  695|  6.84k|  assert(bufs->head == bufs->cur);
  ------------------
  |  Branch (695:3): [True: 0, False: 6.84k]
  |  Branch (695:3): [True: 6.84k, False: 0]
  ------------------
  696|       |
  697|  6.84k|  buf = &bufs->head->buf;
  698|       |
  699|  6.84k|  assert(nghttp2_buf_avail(buf) >= 4);
  ------------------
  |  Branch (699:3): [True: 0, False: 6.84k]
  |  Branch (699:3): [True: 6.84k, False: 0]
  ------------------
  700|       |
  701|  6.84k|  buf->pos -= NGHTTP2_FRAME_HDLEN;
  ------------------
  |  |   40|  6.84k|#define NGHTTP2_FRAME_HDLEN 9
  ------------------
  702|       |
  703|  6.84k|  nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
  704|       |
  705|  6.84k|  nghttp2_put_uint32be(buf->last, (uint32_t)frame->window_size_increment);
  706|  6.84k|  buf->last += 4;
  707|  6.84k|}
nghttp2_frame_unpack_window_update_payload:
  710|    209|                                                const uint8_t *payload) {
  711|    209|  frame->window_size_increment =
  712|    209|    nghttp2_get_uint32(payload) & NGHTTP2_WINDOW_SIZE_INCREMENT_MASK;
  ------------------
  |  |   37|    209|#define NGHTTP2_WINDOW_SIZE_INCREMENT_MASK ((1u << 31) - 1)
  ------------------
  713|    209|}
nghttp2_frame_iv_copy:
  951|  8.89k|                                              size_t niv, nghttp2_mem *mem) {
  952|  8.89k|  nghttp2_settings_entry *iv_copy;
  953|  8.89k|  size_t len = niv * sizeof(nghttp2_settings_entry);
  954|       |
  955|  8.89k|  if (len == 0) {
  ------------------
  |  Branch (955:7): [True: 0, False: 8.89k]
  ------------------
  956|      0|    return NULL;
  957|      0|  }
  958|       |
  959|  8.89k|  iv_copy = nghttp2_mem_malloc(mem, len);
  960|       |
  961|  8.89k|  if (iv_copy == NULL) {
  ------------------
  |  Branch (961:7): [True: 0, False: 8.89k]
  ------------------
  962|      0|    return NULL;
  963|      0|  }
  964|       |
  965|  8.89k|  memcpy(iv_copy, iv, len);
  966|       |
  967|  8.89k|  return iv_copy;
  968|  8.89k|}
nghttp2_nv_array_del:
  992|  6.77k|void nghttp2_nv_array_del(nghttp2_nv *nva, nghttp2_mem *mem) {
  993|  6.77k|  nghttp2_mem_free(mem, nva);
  994|  6.77k|}
nghttp2_nv_array_copy:
 1046|  4.40k|                          size_t nvlen, nghttp2_mem *mem) {
 1047|  4.40k|  size_t i;
 1048|  4.40k|  uint8_t *data = NULL;
 1049|  4.40k|  size_t buflen = 0;
 1050|  4.40k|  nghttp2_nv *p;
 1051|       |
 1052|  4.40k|  if (nvlen == 0) {
  ------------------
  |  Branch (1052:7): [True: 0, False: 4.40k]
  ------------------
 1053|      0|    *nva_ptr = NULL;
 1054|       |
 1055|      0|    return 0;
 1056|      0|  }
 1057|       |
 1058|   149k|  for (i = 0; i < nvlen; ++i) {
  ------------------
  |  Branch (1058:15): [True: 144k, False: 4.40k]
  ------------------
 1059|       |    /* + 1 for null-termination */
 1060|   144k|    if ((nva[i].flags & NGHTTP2_NV_FLAG_NO_COPY_NAME) == 0) {
  ------------------
  |  Branch (1060:9): [True: 144k, False: 0]
  ------------------
 1061|   144k|      buflen += nva[i].namelen + 1;
 1062|   144k|    }
 1063|   144k|    if ((nva[i].flags & NGHTTP2_NV_FLAG_NO_COPY_VALUE) == 0) {
  ------------------
  |  Branch (1063:9): [True: 144k, False: 0]
  ------------------
 1064|   144k|      buflen += nva[i].valuelen + 1;
 1065|   144k|    }
 1066|   144k|  }
 1067|       |
 1068|  4.40k|  buflen += sizeof(nghttp2_nv) * nvlen;
 1069|       |
 1070|  4.40k|  *nva_ptr = nghttp2_mem_malloc(mem, buflen);
 1071|       |
 1072|  4.40k|  if (*nva_ptr == NULL) {
  ------------------
  |  Branch (1072:7): [True: 0, False: 4.40k]
  ------------------
 1073|      0|    return NGHTTP2_ERR_NOMEM;
 1074|      0|  }
 1075|       |
 1076|  4.40k|  p = *nva_ptr;
 1077|  4.40k|  data = (uint8_t *)(*nva_ptr) + sizeof(nghttp2_nv) * nvlen;
 1078|       |
 1079|   149k|  for (i = 0; i < nvlen; ++i) {
  ------------------
  |  Branch (1079:15): [True: 144k, False: 4.40k]
  ------------------
 1080|   144k|    p->flags = nva[i].flags;
 1081|       |
 1082|   144k|    if (nva[i].flags & NGHTTP2_NV_FLAG_NO_COPY_NAME) {
  ------------------
  |  Branch (1082:9): [True: 0, False: 144k]
  ------------------
 1083|      0|      p->name = nva[i].name;
 1084|      0|      p->namelen = nva[i].namelen;
 1085|   144k|    } else {
 1086|   144k|      if (nva[i].namelen) {
  ------------------
  |  Branch (1086:11): [True: 143k, False: 1.62k]
  ------------------
 1087|   143k|        memcpy(data, nva[i].name, nva[i].namelen);
 1088|   143k|      }
 1089|   144k|      p->name = data;
 1090|   144k|      p->namelen = nva[i].namelen;
 1091|   144k|      data[p->namelen] = '\0';
 1092|   144k|      nghttp2_downcase(p->name, p->namelen);
 1093|   144k|      data += nva[i].namelen + 1;
 1094|   144k|    }
 1095|       |
 1096|   144k|    if (nva[i].flags & NGHTTP2_NV_FLAG_NO_COPY_VALUE) {
  ------------------
  |  Branch (1096:9): [True: 0, False: 144k]
  ------------------
 1097|      0|      p->value = nva[i].value;
 1098|      0|      p->valuelen = nva[i].valuelen;
 1099|   144k|    } else {
 1100|   144k|      if (nva[i].valuelen) {
  ------------------
  |  Branch (1100:11): [True: 100k, False: 44.3k]
  ------------------
 1101|   100k|        memcpy(data, nva[i].value, nva[i].valuelen);
 1102|   100k|      }
 1103|   144k|      p->value = data;
 1104|   144k|      p->valuelen = nva[i].valuelen;
 1105|   144k|      data[p->valuelen] = '\0';
 1106|   144k|      data += nva[i].valuelen + 1;
 1107|   144k|    }
 1108|       |
 1109|   144k|    ++p;
 1110|   144k|  }
 1111|  4.40k|  return 0;
 1112|  4.40k|}
nghttp2_iv_check:
 1114|  8.46k|int nghttp2_iv_check(const nghttp2_settings_entry *iv, size_t niv) {
 1115|  8.46k|  size_t i;
 1116|  21.8k|  for (i = 0; i < niv; ++i) {
  ------------------
  |  Branch (1116:15): [True: 13.4k, False: 8.46k]
  ------------------
 1117|  13.4k|    switch (iv[i].settings_id) {
  ------------------
  |  Branch (1117:13): [True: 13.4k, False: 0]
  ------------------
 1118|      0|    case NGHTTP2_SETTINGS_HEADER_TABLE_SIZE:
  ------------------
  |  Branch (1118:5): [True: 0, False: 13.4k]
  ------------------
 1119|      0|      break;
 1120|  4.47k|    case NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS:
  ------------------
  |  Branch (1120:5): [True: 4.47k, False: 8.95k]
  ------------------
 1121|  4.47k|      break;
 1122|  4.47k|    case NGHTTP2_SETTINGS_ENABLE_PUSH:
  ------------------
  |  Branch (1122:5): [True: 4.47k, False: 8.95k]
  ------------------
 1123|  4.47k|      if (iv[i].value != 0 && iv[i].value != 1) {
  ------------------
  |  Branch (1123:11): [True: 0, False: 4.47k]
  |  Branch (1123:31): [True: 0, False: 0]
  ------------------
 1124|      0|        return 0;
 1125|      0|      }
 1126|  4.47k|      break;
 1127|  4.47k|    case NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE:
  ------------------
  |  Branch (1127:5): [True: 4.47k, False: 8.95k]
  ------------------
 1128|  4.47k|      if (iv[i].value > (uint32_t)NGHTTP2_MAX_WINDOW_SIZE) {
  ------------------
  |  |  224|  4.47k|#define NGHTTP2_MAX_WINDOW_SIZE ((int32_t)((1U << 31) - 1))
  ------------------
  |  Branch (1128:11): [True: 0, False: 4.47k]
  ------------------
 1129|      0|        return 0;
 1130|      0|      }
 1131|  4.47k|      break;
 1132|  4.47k|    case NGHTTP2_SETTINGS_MAX_FRAME_SIZE:
  ------------------
  |  Branch (1132:5): [True: 0, False: 13.4k]
  ------------------
 1133|      0|      if (iv[i].value < NGHTTP2_MAX_FRAME_SIZE_MIN ||
  ------------------
  |  |   43|      0|#define NGHTTP2_MAX_FRAME_SIZE_MIN (1 << 14)
  ------------------
  |  Branch (1133:11): [True: 0, False: 0]
  ------------------
 1134|      0|          iv[i].value > NGHTTP2_MAX_FRAME_SIZE_MAX) {
  ------------------
  |  |   42|      0|#define NGHTTP2_MAX_FRAME_SIZE_MAX ((1 << 24) - 1)
  ------------------
  |  Branch (1134:11): [True: 0, False: 0]
  ------------------
 1135|      0|        return 0;
 1136|      0|      }
 1137|      0|      break;
 1138|      0|    case NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE:
  ------------------
  |  Branch (1138:5): [True: 0, False: 13.4k]
  ------------------
 1139|      0|      break;
 1140|      0|    case NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL:
  ------------------
  |  Branch (1140:5): [True: 0, False: 13.4k]
  ------------------
 1141|      0|      if (iv[i].value != 0 && iv[i].value != 1) {
  ------------------
  |  Branch (1141:11): [True: 0, False: 0]
  |  Branch (1141:31): [True: 0, False: 0]
  ------------------
 1142|      0|        return 0;
 1143|      0|      }
 1144|      0|      break;
 1145|      0|    case NGHTTP2_SETTINGS_NO_RFC7540_PRIORITIES:
  ------------------
  |  Branch (1145:5): [True: 0, False: 13.4k]
  ------------------
 1146|      0|      if (iv[i].value != 0 && iv[i].value != 1) {
  ------------------
  |  Branch (1146:11): [True: 0, False: 0]
  |  Branch (1146:31): [True: 0, False: 0]
  ------------------
 1147|      0|        return 0;
 1148|      0|      }
 1149|      0|      break;
 1150|  13.4k|    }
 1151|  13.4k|  }
 1152|  8.46k|  return 1;
 1153|  8.46k|}
nghttp2_frame_add_pad:
 1185|  5.20k|                           size_t padlen, int framehd_only) {
 1186|  5.20k|  nghttp2_buf *buf;
 1187|       |
 1188|  5.20k|  if (padlen == 0) {
  ------------------
  |  Branch (1188:7): [True: 5.20k, False: 0]
  ------------------
 1189|  5.20k|    DEBUGF("send: padlen = 0, nothing to do\n");
  ------------------
  |  |   39|  5.20k|    do {                                                                       \
  |  |   40|  5.20k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 5.20k]
  |  |  ------------------
  ------------------
 1190|       |
 1191|  5.20k|    return;
 1192|  5.20k|  }
 1193|       |
 1194|       |  /*
 1195|       |   * We have arranged bufs like this:
 1196|       |   *
 1197|       |   *  0                   1                   2                   3
 1198|       |   *  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 1199|       |   * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 1200|       |   * | |Frame header     | Frame payload...                          :
 1201|       |   * +-+-----------------+-------------------------------------------+
 1202|       |   * | |Frame header     | Frame payload...                          :
 1203|       |   * +-+-----------------+-------------------------------------------+
 1204|       |   * | |Frame header     | Frame payload...                          :
 1205|       |   * +-+-----------------+-------------------------------------------+
 1206|       |   *
 1207|       |   * We arranged padding so that it is included in the first frame
 1208|       |   * completely.  For padded frame, we are going to adjust buf->pos of
 1209|       |   * frame which includes padding and serialize (memmove) frame header
 1210|       |   * in the correct position.  Also extends buf->last to include
 1211|       |   * padding.
 1212|       |   */
 1213|       |
 1214|      0|  buf = &bufs->head->buf;
 1215|       |
 1216|      0|  assert(nghttp2_buf_avail(buf) >= padlen - 1);
  ------------------
  |  Branch (1216:3): [True: 0, False: 0]
  |  Branch (1216:3): [True: 0, False: 0]
  ------------------
 1217|       |
 1218|      0|  frame_set_pad(buf, padlen, framehd_only);
 1219|       |
 1220|      0|  hd->length += padlen;
 1221|      0|  hd->flags |= NGHTTP2_FLAG_PADDED;
 1222|       |
 1223|      0|  DEBUGF("send: final payloadlen=%zu, padlen=%zu\n", hd->length, padlen);
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1224|      0|}
nghttp2_frame.c:frame_pack_headers_shared:
  306|  4.40k|                                     nghttp2_frame_hd *frame_hd) {
  307|  4.40k|  nghttp2_buf *buf;
  308|  4.40k|  nghttp2_buf_chain *ci, *ce;
  309|  4.40k|  nghttp2_frame_hd hd;
  310|       |
  311|  4.40k|  buf = &bufs->head->buf;
  312|       |
  313|  4.40k|  hd = *frame_hd;
  314|  4.40k|  hd.length = nghttp2_buf_len(buf);
  ------------------
  |  |   54|  4.40k|#define nghttp2_buf_len(BUF) ((size_t)((BUF)->last - (BUF)->pos))
  ------------------
  315|       |
  316|  4.40k|  DEBUGF("send: HEADERS/PUSH_PROMISE, payloadlen=%zu\n", hd.length);
  ------------------
  |  |   39|  4.40k|    do {                                                                       \
  |  |   40|  4.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 4.40k]
  |  |  ------------------
  ------------------
  317|       |
  318|       |  /* We have multiple frame buffers, which means one or more
  319|       |     CONTINUATION frame is involved. Remove END_HEADERS flag from the
  320|       |     first frame. */
  321|  4.40k|  if (bufs->head != bufs->cur) {
  ------------------
  |  Branch (321:7): [True: 73, False: 4.33k]
  ------------------
  322|     73|    hd.flags = (uint8_t)(hd.flags & ~NGHTTP2_FLAG_END_HEADERS);
  323|     73|  }
  324|       |
  325|  4.40k|  buf->pos -= NGHTTP2_FRAME_HDLEN;
  ------------------
  |  |   40|  4.40k|#define NGHTTP2_FRAME_HDLEN 9
  ------------------
  326|  4.40k|  nghttp2_frame_pack_frame_hd(buf->pos, &hd);
  327|       |
  328|  4.40k|  if (bufs->head != bufs->cur) {
  ------------------
  |  Branch (328:7): [True: 73, False: 4.33k]
  ------------------
  329|       |    /* 2nd and later frames are CONTINUATION frames. */
  330|     73|    hd.type = NGHTTP2_CONTINUATION;
  331|       |    /* We don't have no flags except for last CONTINUATION */
  332|     73|    hd.flags = NGHTTP2_FLAG_NONE;
  333|       |
  334|     73|    ce = bufs->cur;
  335|       |
  336|     88|    for (ci = bufs->head->next; ci != ce; ci = ci->next) {
  ------------------
  |  Branch (336:33): [True: 15, False: 73]
  ------------------
  337|     15|      buf = &ci->buf;
  338|       |
  339|     15|      hd.length = nghttp2_buf_len(buf);
  ------------------
  |  |   54|     15|#define nghttp2_buf_len(BUF) ((size_t)((BUF)->last - (BUF)->pos))
  ------------------
  340|       |
  341|     15|      DEBUGF("send: int CONTINUATION, payloadlen=%zu\n", hd.length);
  ------------------
  |  |   39|     15|    do {                                                                       \
  |  |   40|     15|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 15]
  |  |  ------------------
  ------------------
  342|       |
  343|     15|      buf->pos -= NGHTTP2_FRAME_HDLEN;
  ------------------
  |  |   40|     15|#define NGHTTP2_FRAME_HDLEN 9
  ------------------
  344|     15|      nghttp2_frame_pack_frame_hd(buf->pos, &hd);
  345|     15|    }
  346|       |
  347|     73|    buf = &ci->buf;
  348|     73|    hd.length = nghttp2_buf_len(buf);
  ------------------
  |  |   54|     73|#define nghttp2_buf_len(BUF) ((size_t)((BUF)->last - (BUF)->pos))
  ------------------
  349|       |    /* Set END_HEADERS flag for last CONTINUATION */
  350|     73|    hd.flags = NGHTTP2_FLAG_END_HEADERS;
  351|       |
  352|     73|    DEBUGF("send: last CONTINUATION, payloadlen=%zu\n", hd.length);
  ------------------
  |  |   39|     73|    do {                                                                       \
  |  |   40|     73|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 73]
  |  |  ------------------
  ------------------
  353|       |
  354|     73|    buf->pos -= NGHTTP2_FRAME_HDLEN;
  ------------------
  |  |   40|     73|#define NGHTTP2_FRAME_HDLEN 9
  ------------------
  355|     73|    nghttp2_frame_pack_frame_hd(buf->pos, &hd);
  356|     73|  }
  357|       |
  358|  4.40k|  return 0;
  359|  4.40k|}

nghttp2_hd_entry_init:
  489|  52.1k|void nghttp2_hd_entry_init(nghttp2_hd_entry *ent, nghttp2_hd_nv *nv) {
  490|  52.1k|  ent->nv = *nv;
  491|  52.1k|  ent->cnv.name = nv->name->base;
  492|  52.1k|  ent->cnv.namelen = nv->name->len;
  493|  52.1k|  ent->cnv.value = nv->value->base;
  494|  52.1k|  ent->cnv.valuelen = nv->value->len;
  495|  52.1k|  ent->cnv.flags = nv->flags;
  496|  52.1k|  ent->next = NULL;
  497|  52.1k|  ent->hash = 0;
  498|       |
  499|  52.1k|  nghttp2_rcbuf_incref(ent->nv.name);
  500|  52.1k|  nghttp2_rcbuf_incref(ent->nv.value);
  501|  52.1k|}
nghttp2_hd_entry_free:
  503|  52.1k|void nghttp2_hd_entry_free(nghttp2_hd_entry *ent) {
  504|  52.1k|  nghttp2_rcbuf_decref(ent->nv.value);
  505|  52.1k|  nghttp2_rcbuf_decref(ent->nv.name);
  506|  52.1k|}
nghttp2_hd_deflate_init2:
  716|  4.44k|                             nghttp2_mem *mem) {
  717|  4.44k|  int rv;
  718|  4.44k|  rv = hd_context_init(&deflater->ctx, mem);
  719|  4.44k|  if (rv != 0) {
  ------------------
  |  Branch (719:7): [True: 0, False: 4.44k]
  ------------------
  720|      0|    return rv;
  721|      0|  }
  722|       |
  723|  4.44k|  hd_map_init(&deflater->map);
  724|       |
  725|  4.44k|  if (max_deflate_dynamic_table_size < NGHTTP2_HD_DEFAULT_MAX_BUFFER_SIZE) {
  ------------------
  |  |   39|  4.44k|#define NGHTTP2_HD_DEFAULT_MAX_BUFFER_SIZE NGHTTP2_DEFAULT_HEADER_TABLE_SIZE
  |  |  ------------------
  |  |  |  |  244|  4.44k|#define NGHTTP2_DEFAULT_HEADER_TABLE_SIZE (1 << 12)
  |  |  ------------------
  ------------------
  |  Branch (725:7): [True: 0, False: 4.44k]
  ------------------
  726|      0|    deflater->notify_table_size_change = 1;
  727|      0|    deflater->ctx.hd_table_bufsize_max = max_deflate_dynamic_table_size;
  728|  4.44k|  } else {
  729|  4.44k|    deflater->notify_table_size_change = 0;
  730|  4.44k|  }
  731|       |
  732|  4.44k|  deflater->deflate_hd_table_bufsize_max = max_deflate_dynamic_table_size;
  733|  4.44k|  deflater->min_hd_table_bufsize_max = UINT32_MAX;
  734|       |
  735|  4.44k|  return 0;
  736|  4.44k|}
nghttp2_hd_inflate_init:
  738|  4.44k|int nghttp2_hd_inflate_init(nghttp2_hd_inflater *inflater, nghttp2_mem *mem) {
  739|  4.44k|  int rv;
  740|       |
  741|  4.44k|  rv = hd_context_init(&inflater->ctx, mem);
  742|  4.44k|  if (rv != 0) {
  ------------------
  |  Branch (742:7): [True: 0, False: 4.44k]
  ------------------
  743|      0|    goto fail;
  744|      0|  }
  745|       |
  746|  4.44k|  inflater->settings_hd_table_bufsize_max = NGHTTP2_HD_DEFAULT_MAX_BUFFER_SIZE;
  ------------------
  |  |   39|  4.44k|#define NGHTTP2_HD_DEFAULT_MAX_BUFFER_SIZE NGHTTP2_DEFAULT_HEADER_TABLE_SIZE
  |  |  ------------------
  |  |  |  |  244|  4.44k|#define NGHTTP2_DEFAULT_HEADER_TABLE_SIZE (1 << 12)
  |  |  ------------------
  ------------------
  747|  4.44k|  inflater->min_hd_table_bufsize_max = UINT32_MAX;
  748|       |
  749|  4.44k|  inflater->nv_name_keep = NULL;
  750|  4.44k|  inflater->nv_value_keep = NULL;
  751|       |
  752|  4.44k|  inflater->opcode = NGHTTP2_HD_OPCODE_NONE;
  753|  4.44k|  inflater->state = NGHTTP2_HD_STATE_INFLATE_START;
  754|       |
  755|  4.44k|  nghttp2_buf_init(&inflater->namebuf);
  756|  4.44k|  nghttp2_buf_init(&inflater->valuebuf);
  757|       |
  758|  4.44k|  inflater->namercbuf = NULL;
  759|  4.44k|  inflater->valuercbuf = NULL;
  760|       |
  761|  4.44k|  inflater->huffman_encoded = 0;
  762|  4.44k|  inflater->index = 0;
  763|  4.44k|  inflater->left = 0;
  764|  4.44k|  inflater->shift = 0;
  765|  4.44k|  inflater->index_required = 0;
  766|  4.44k|  inflater->no_index = 0;
  767|       |
  768|  4.44k|  return 0;
  769|       |
  770|      0|fail:
  771|      0|  return rv;
  772|  4.44k|}
nghttp2_hd_deflate_free:
  782|  4.44k|void nghttp2_hd_deflate_free(nghttp2_hd_deflater *deflater) {
  783|  4.44k|  hd_context_free(&deflater->ctx);
  784|  4.44k|}
nghttp2_hd_inflate_free:
  786|  4.44k|void nghttp2_hd_inflate_free(nghttp2_hd_inflater *inflater) {
  787|  4.44k|  hd_inflate_keep_free(inflater);
  788|       |
  789|  4.44k|  nghttp2_rcbuf_decref(inflater->valuercbuf);
  790|  4.44k|  nghttp2_rcbuf_decref(inflater->namercbuf);
  791|       |
  792|  4.44k|  hd_context_free(&inflater->ctx);
  793|  4.44k|}
nghttp2_hd_deflate_change_table_size:
 1259|    440|  nghttp2_hd_deflater *deflater, size_t settings_max_dynamic_table_size) {
 1260|    440|  size_t next_bufsize = nghttp2_min_size(
 1261|    440|    settings_max_dynamic_table_size, deflater->deflate_hd_table_bufsize_max);
 1262|       |
 1263|    440|  deflater->ctx.hd_table_bufsize_max = next_bufsize;
 1264|       |
 1265|    440|  deflater->min_hd_table_bufsize_max =
 1266|    440|    nghttp2_min_size(deflater->min_hd_table_bufsize_max, next_bufsize);
 1267|       |
 1268|    440|  deflater->notify_table_size_change = 1;
 1269|       |
 1270|    440|  hd_context_shrink_table_size(&deflater->ctx, &deflater->map);
 1271|    440|  return 0;
 1272|    440|}
nghttp2_hd_table_get:
 1314|  62.2k|nghttp2_hd_nv nghttp2_hd_table_get(nghttp2_hd_context *context, size_t idx) {
 1315|  62.2k|  assert(INDEX_RANGE_VALID(context, idx));
  ------------------
  |  Branch (1315:3): [True: 0, False: 62.2k]
  |  Branch (1315:3): [True: 62.2k, False: 0]
  ------------------
 1316|  62.2k|  if (idx >= NGHTTP2_STATIC_TABLE_LENGTH) {
  ------------------
  |  |   53|  62.2k|#define NGHTTP2_STATIC_TABLE_LENGTH 61
  ------------------
  |  Branch (1316:7): [True: 37.9k, False: 24.2k]
  ------------------
 1317|  37.9k|    return hd_ringbuf_get(&context->hd_table, idx - NGHTTP2_STATIC_TABLE_LENGTH)
  ------------------
  |  |   53|  37.9k|#define NGHTTP2_STATIC_TABLE_LENGTH 61
  ------------------
 1318|  37.9k|      ->nv;
 1319|  37.9k|  } else {
 1320|  24.2k|    const nghttp2_hd_static_entry *ent = &static_table[idx];
 1321|  24.2k|    nghttp2_hd_nv nv = {(nghttp2_rcbuf *)&ent->name,
 1322|  24.2k|                        (nghttp2_rcbuf *)&ent->value, ent->token,
 1323|  24.2k|                        NGHTTP2_NV_FLAG_NONE};
 1324|  24.2k|    return nv;
 1325|  24.2k|  }
 1326|  62.2k|}
nghttp2_hd_deflate_hd_bufs:
 1453|  4.40k|                               size_t nvlen) {
 1454|  4.40k|  size_t i;
 1455|  4.40k|  int rv = 0;
 1456|       |
 1457|  4.40k|  if (deflater->ctx.bad) {
  ------------------
  |  Branch (1457:7): [True: 0, False: 4.40k]
  ------------------
 1458|      0|    return NGHTTP2_ERR_HEADER_COMP;
 1459|      0|  }
 1460|       |
 1461|  4.40k|  if (deflater->notify_table_size_change) {
  ------------------
  |  Branch (1461:7): [True: 0, False: 4.40k]
  ------------------
 1462|      0|    size_t min_hd_table_bufsize_max;
 1463|       |
 1464|      0|    min_hd_table_bufsize_max = deflater->min_hd_table_bufsize_max;
 1465|       |
 1466|      0|    deflater->notify_table_size_change = 0;
 1467|      0|    deflater->min_hd_table_bufsize_max = UINT32_MAX;
 1468|       |
 1469|      0|    if (deflater->ctx.hd_table_bufsize_max > min_hd_table_bufsize_max) {
  ------------------
  |  Branch (1469:9): [True: 0, False: 0]
  ------------------
 1470|      0|      rv = emit_table_size(bufs, min_hd_table_bufsize_max);
 1471|       |
 1472|      0|      if (rv != 0) {
  ------------------
  |  Branch (1472:11): [True: 0, False: 0]
  ------------------
 1473|      0|        goto fail;
 1474|      0|      }
 1475|      0|    }
 1476|       |
 1477|      0|    rv = emit_table_size(bufs, deflater->ctx.hd_table_bufsize_max);
 1478|       |
 1479|      0|    if (rv != 0) {
  ------------------
  |  Branch (1479:9): [True: 0, False: 0]
  ------------------
 1480|      0|      goto fail;
 1481|      0|    }
 1482|      0|  }
 1483|       |
 1484|   146k|  for (i = 0; i < nvlen; ++i) {
  ------------------
  |  Branch (1484:15): [True: 141k, False: 4.40k]
  ------------------
 1485|   141k|    rv = deflate_nv(deflater, bufs, &nv[i]);
 1486|   141k|    if (rv != 0) {
  ------------------
  |  Branch (1486:9): [True: 0, False: 141k]
  ------------------
 1487|      0|      goto fail;
 1488|      0|    }
 1489|   141k|  }
 1490|       |
 1491|  4.40k|  DEBUGF("deflatehd: all input name/value pairs were deflated\n");
  ------------------
  |  |   39|  4.40k|    do {                                                                       \
  |  |   40|  4.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 4.40k]
  |  |  ------------------
  ------------------
 1492|       |
 1493|  4.40k|  return 0;
 1494|      0|fail:
 1495|      0|  DEBUGF("deflatehd: error return %d\n", rv);
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1496|       |
 1497|      0|  deflater->ctx.bad = 1;
 1498|      0|  return rv;
 1499|  4.40k|}
nghttp2_hd_deflate_bound:
 1579|  4.40k|                                const nghttp2_nv *nva, size_t nvlen) {
 1580|  4.40k|  size_t n = 0;
 1581|  4.40k|  size_t i;
 1582|  4.40k|  (void)deflater;
 1583|       |
 1584|       |  /* Possible Maximum Header Table Size Change.  Encoding (1u << 31) -
 1585|       |     1 using 4 bit prefix requires 6 bytes.  We may emit this at most
 1586|       |     twice. */
 1587|  4.40k|  n += 12;
 1588|       |
 1589|       |  /* Use Literal Header Field without indexing - New Name, since it is
 1590|       |     most space consuming format.  Also we choose the less one between
 1591|       |     non-huffman and huffman, so using literal byte count is
 1592|       |     sufficient for upper bound.
 1593|       |
 1594|       |     Encoding (1u << 31) - 1 using 7 bit prefix requires 6 bytes.  We
 1595|       |     need 2 of this for |nvlen| header fields. */
 1596|  4.40k|  n += 6 * 2 * nvlen;
 1597|       |
 1598|   149k|  for (i = 0; i < nvlen; ++i) {
  ------------------
  |  Branch (1598:15): [True: 144k, False: 4.40k]
  ------------------
 1599|   144k|    n += nva[i].namelen + nva[i].valuelen;
 1600|   144k|  }
 1601|       |
 1602|  4.40k|  return n;
 1603|  4.40k|}
nghttp2_hd_inflate_hd_nv:
 1904|  52.8k|                                       size_t inlen, int in_final) {
 1905|  52.8k|  nghttp2_ssize rv = 0;
 1906|  52.8k|  const uint8_t *first = in;
 1907|  52.8k|  const uint8_t *last = in + inlen;
 1908|  52.8k|  int rfin = 0;
 1909|  52.8k|  int busy = 0;
 1910|  52.8k|  nghttp2_mem *mem;
 1911|       |
 1912|  52.8k|  mem = inflater->ctx.mem;
 1913|       |
 1914|  52.8k|  if (inflater->ctx.bad) {
  ------------------
  |  Branch (1914:7): [True: 0, False: 52.8k]
  ------------------
 1915|      0|    return NGHTTP2_ERR_HEADER_COMP;
 1916|      0|  }
 1917|       |
 1918|  52.8k|  DEBUGF("inflatehd: start state=%d\n", inflater->state);
  ------------------
  |  |   39|  52.8k|    do {                                                                       \
  |  |   40|  52.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 52.8k]
  |  |  ------------------
  ------------------
 1919|  52.8k|  hd_inflate_keep_free(inflater);
 1920|  52.8k|  *inflate_flags = NGHTTP2_HD_INFLATE_NONE;
 1921|   136k|  for (; in != last || busy;) {
  ------------------
  |  Branch (1921:10): [True: 136k, False: 642]
  |  Branch (1921:24): [True: 52, False: 590]
  ------------------
 1922|   136k|    busy = 0;
 1923|   136k|    switch (inflater->state) {
  ------------------
  |  Branch (1923:13): [True: 136k, False: 0]
  ------------------
 1924|      0|    case NGHTTP2_HD_STATE_EXPECT_TABLE_SIZE:
  ------------------
  |  Branch (1924:5): [True: 0, False: 136k]
  ------------------
 1925|      0|      if ((*in & 0xe0u) != 0x20u) {
  ------------------
  |  Branch (1925:11): [True: 0, False: 0]
  ------------------
 1926|      0|        DEBUGF("inflatehd: header table size change was expected, but saw "
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1927|      0|               "0x%02x as first byte",
 1928|      0|               *in);
 1929|      0|        rv = NGHTTP2_ERR_HEADER_COMP;
 1930|      0|        goto fail;
 1931|      0|      }
 1932|       |    /* fall through */
 1933|  3.97k|    case NGHTTP2_HD_STATE_INFLATE_START:
  ------------------
  |  Branch (1933:5): [True: 3.97k, False: 132k]
  ------------------
 1934|  54.1k|    case NGHTTP2_HD_STATE_OPCODE:
  ------------------
  |  Branch (1934:5): [True: 50.2k, False: 86.0k]
  ------------------
 1935|  54.1k|      if ((*in & 0xe0u) == 0x20u) {
  ------------------
  |  Branch (1935:11): [True: 2.36k, False: 51.8k]
  ------------------
 1936|  2.36k|        DEBUGF("inflatehd: header table size change\n");
  ------------------
  |  |   39|  2.36k|    do {                                                                       \
  |  |   40|  2.36k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 2.36k]
  |  |  ------------------
  ------------------
 1937|  2.36k|        if (inflater->state == NGHTTP2_HD_STATE_OPCODE) {
  ------------------
  |  Branch (1937:13): [True: 292, False: 2.06k]
  ------------------
 1938|    292|          DEBUGF("inflatehd: header table size change must appear at the head "
  ------------------
  |  |   39|    292|    do {                                                                       \
  |  |   40|    292|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 292]
  |  |  ------------------
  ------------------
 1939|    292|                 "of header block\n");
 1940|    292|          rv = NGHTTP2_ERR_HEADER_COMP;
 1941|    292|          goto fail;
 1942|    292|        }
 1943|  2.06k|        inflater->opcode = NGHTTP2_HD_OPCODE_INDEXED;
 1944|  2.06k|        inflater->state = NGHTTP2_HD_STATE_READ_TABLE_SIZE;
 1945|  51.8k|      } else if (*in & 0x80u) {
  ------------------
  |  Branch (1945:18): [True: 41.0k, False: 10.7k]
  ------------------
 1946|  41.0k|        DEBUGF("inflatehd: indexed repr\n");
  ------------------
  |  |   39|  41.0k|    do {                                                                       \
  |  |   40|  41.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 41.0k]
  |  |  ------------------
  ------------------
 1947|  41.0k|        inflater->opcode = NGHTTP2_HD_OPCODE_INDEXED;
 1948|  41.0k|        inflater->state = NGHTTP2_HD_STATE_READ_INDEX;
 1949|  41.0k|      } else {
 1950|  10.7k|        if (*in == 0x40u || *in == 0 || *in == 0x10u) {
  ------------------
  |  Branch (1950:13): [True: 196, False: 10.6k]
  |  Branch (1950:29): [True: 6.92k, False: 3.67k]
  |  Branch (1950:41): [True: 198, False: 3.48k]
  ------------------
 1951|  7.31k|          DEBUGF("inflatehd: literal header repr - new name\n");
  ------------------
  |  |   39|  7.31k|    do {                                                                       \
  |  |   40|  7.31k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 7.31k]
  |  |  ------------------
  ------------------
 1952|  7.31k|          inflater->opcode = NGHTTP2_HD_OPCODE_NEWNAME;
 1953|  7.31k|          inflater->state = NGHTTP2_HD_STATE_NEWNAME_CHECK_NAMELEN;
 1954|  7.31k|        } else {
 1955|  3.48k|          DEBUGF("inflatehd: literal header repr - indexed name\n");
  ------------------
  |  |   39|  3.48k|    do {                                                                       \
  |  |   40|  3.48k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 3.48k]
  |  |  ------------------
  ------------------
 1956|  3.48k|          inflater->opcode = NGHTTP2_HD_OPCODE_INDNAME;
 1957|  3.48k|          inflater->state = NGHTTP2_HD_STATE_READ_INDEX;
 1958|  3.48k|        }
 1959|  10.7k|        inflater->index_required = (*in & 0x40) != 0;
 1960|  10.7k|        inflater->no_index = (*in & 0xf0u) == 0x10u;
 1961|  10.7k|        DEBUGF("inflatehd: indexing required=%d, no_index=%d\n",
  ------------------
  |  |   39|  10.7k|    do {                                                                       \
  |  |   40|  10.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 10.7k]
  |  |  ------------------
  ------------------
 1962|  10.7k|               inflater->index_required, inflater->no_index);
 1963|  10.7k|        if (inflater->opcode == NGHTTP2_HD_OPCODE_NEWNAME) {
  ------------------
  |  Branch (1963:13): [True: 7.31k, False: 3.48k]
  ------------------
 1964|  7.31k|          ++in;
 1965|  7.31k|        }
 1966|  10.7k|      }
 1967|  53.9k|      inflater->left = 0;
 1968|  53.9k|      inflater->shift = 0;
 1969|  53.9k|      break;
 1970|  2.06k|    case NGHTTP2_HD_STATE_READ_TABLE_SIZE:
  ------------------
  |  Branch (1970:5): [True: 2.06k, False: 134k]
  ------------------
 1971|  2.06k|      rfin = 0;
 1972|  2.06k|      rv = hd_inflate_read_len(
 1973|  2.06k|        inflater, &rfin, in, last, 5,
 1974|  2.06k|        nghttp2_min_size(inflater->min_hd_table_bufsize_max,
 1975|  2.06k|                         inflater->settings_hd_table_bufsize_max));
 1976|  2.06k|      if (rv < 0) {
  ------------------
  |  Branch (1976:11): [True: 41, False: 2.02k]
  ------------------
 1977|     41|        goto fail;
 1978|     41|      }
 1979|  2.02k|      in += rv;
 1980|  2.02k|      if (!rfin) {
  ------------------
  |  Branch (1980:11): [True: 3, False: 2.02k]
  ------------------
 1981|      3|        goto almost_ok;
 1982|      3|      }
 1983|  2.02k|      DEBUGF("inflatehd: table_size=%zu\n", inflater->left);
  ------------------
  |  |   39|  2.02k|    do {                                                                       \
  |  |   40|  2.02k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 2.02k]
  |  |  ------------------
  ------------------
 1984|  2.02k|      inflater->min_hd_table_bufsize_max = UINT32_MAX;
 1985|  2.02k|      inflater->ctx.hd_table_bufsize_max = inflater->left;
 1986|  2.02k|      hd_context_shrink_table_size(&inflater->ctx, NULL);
 1987|  2.02k|      inflater->state = NGHTTP2_HD_STATE_INFLATE_START;
 1988|  2.02k|      break;
 1989|  44.5k|    case NGHTTP2_HD_STATE_READ_INDEX: {
  ------------------
  |  Branch (1989:5): [True: 44.5k, False: 91.7k]
  ------------------
 1990|  44.5k|      size_t prefixlen;
 1991|       |
 1992|  44.5k|      if (inflater->opcode == NGHTTP2_HD_OPCODE_INDEXED) {
  ------------------
  |  Branch (1992:11): [True: 41.0k, False: 3.49k]
  ------------------
 1993|  41.0k|        prefixlen = 7;
 1994|  41.0k|      } else if (inflater->index_required) {
  ------------------
  |  Branch (1994:18): [True: 2.30k, False: 1.19k]
  ------------------
 1995|  2.30k|        prefixlen = 6;
 1996|  2.30k|      } else {
 1997|  1.19k|        prefixlen = 4;
 1998|  1.19k|      }
 1999|       |
 2000|  44.5k|      rfin = 0;
 2001|  44.5k|      rv = hd_inflate_read_len(inflater, &rfin, in, last, prefixlen,
 2002|  44.5k|                               get_max_index(&inflater->ctx));
 2003|  44.5k|      if (rv < 0) {
  ------------------
  |  Branch (2003:11): [True: 343, False: 44.1k]
  ------------------
 2004|    343|        goto fail;
 2005|    343|      }
 2006|       |
 2007|  44.1k|      in += rv;
 2008|       |
 2009|  44.1k|      if (!rfin) {
  ------------------
  |  Branch (2009:11): [True: 29, False: 44.1k]
  ------------------
 2010|     29|        goto almost_ok;
 2011|     29|      }
 2012|       |
 2013|  44.1k|      if (inflater->left == 0) {
  ------------------
  |  Branch (2013:11): [True: 6, False: 44.1k]
  ------------------
 2014|      6|        rv = NGHTTP2_ERR_HEADER_COMP;
 2015|      6|        goto fail;
 2016|      6|      }
 2017|       |
 2018|  44.1k|      DEBUGF("inflatehd: index=%zu\n", inflater->left);
  ------------------
  |  |   39|  44.1k|    do {                                                                       \
  |  |   40|  44.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 44.1k]
  |  |  ------------------
  ------------------
 2019|  44.1k|      if (inflater->opcode == NGHTTP2_HD_OPCODE_INDEXED) {
  ------------------
  |  Branch (2019:11): [True: 40.6k, False: 3.46k]
  ------------------
 2020|  40.6k|        inflater->index = inflater->left;
 2021|  40.6k|        --inflater->index;
 2022|       |
 2023|  40.6k|        hd_inflate_commit_indexed(inflater, nv_out);
 2024|       |
 2025|  40.6k|        inflater->state = NGHTTP2_HD_STATE_OPCODE;
 2026|  40.6k|        *inflate_flags |= NGHTTP2_HD_INFLATE_EMIT;
 2027|  40.6k|        return (nghttp2_ssize)(in - first);
 2028|  40.6k|      } else {
 2029|  3.46k|        inflater->index = inflater->left;
 2030|  3.46k|        --inflater->index;
 2031|       |
 2032|  3.46k|        inflater->state = NGHTTP2_HD_STATE_CHECK_VALUELEN;
 2033|  3.46k|      }
 2034|  3.46k|      break;
 2035|  44.1k|    }
 2036|  7.29k|    case NGHTTP2_HD_STATE_NEWNAME_CHECK_NAMELEN:
  ------------------
  |  Branch (2036:5): [True: 7.29k, False: 128k]
  ------------------
 2037|  7.29k|      hd_inflate_set_huffman_encoded(inflater, in);
 2038|  7.29k|      inflater->state = NGHTTP2_HD_STATE_NEWNAME_READ_NAMELEN;
 2039|  7.29k|      inflater->left = 0;
 2040|  7.29k|      inflater->shift = 0;
 2041|  7.29k|      DEBUGF("inflatehd: huffman encoded=%d\n", inflater->huffman_encoded != 0);
  ------------------
  |  |   39|  7.29k|    do {                                                                       \
  |  |   40|  7.29k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 7.29k]
  |  |  ------------------
  ------------------
 2042|       |    /* Fall through */
 2043|  7.31k|    case NGHTTP2_HD_STATE_NEWNAME_READ_NAMELEN:
  ------------------
  |  Branch (2043:5): [True: 25, False: 136k]
  ------------------
 2044|  7.31k|      rfin = 0;
 2045|  7.31k|      rv = hd_inflate_read_len(inflater, &rfin, in, last, 7, NGHTTP2_HD_MAX_NV);
  ------------------
  |  |   45|  7.31k|#define NGHTTP2_HD_MAX_NV 65536
  ------------------
 2046|  7.31k|      if (rv < 0) {
  ------------------
  |  Branch (2046:11): [True: 58, False: 7.25k]
  ------------------
 2047|     58|        goto fail;
 2048|     58|      }
 2049|  7.25k|      in += rv;
 2050|  7.25k|      if (!rfin) {
  ------------------
  |  Branch (2050:11): [True: 35, False: 7.22k]
  ------------------
 2051|     35|        DEBUGF("inflatehd: integer not fully decoded. current=%zu\n",
  ------------------
  |  |   39|     35|    do {                                                                       \
  |  |   40|     35|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 35]
  |  |  ------------------
  ------------------
 2052|     35|               inflater->left);
 2053|       |
 2054|     35|        goto almost_ok;
 2055|     35|      }
 2056|       |
 2057|  7.22k|      if (inflater->huffman_encoded) {
  ------------------
  |  Branch (2057:11): [True: 197, False: 7.02k]
  ------------------
 2058|    197|        nghttp2_hd_huff_decode_context_init(&inflater->huff_decode_ctx);
 2059|       |
 2060|    197|        inflater->state = NGHTTP2_HD_STATE_NEWNAME_READ_NAMEHUFF;
 2061|       |
 2062|    197|        rv = nghttp2_rcbuf_new(
 2063|    197|          &inflater->namercbuf,
 2064|    197|          nghttp2_huff_estimate_decode_length(inflater->left) + 1, mem);
 2065|  7.02k|      } else {
 2066|  7.02k|        inflater->state = NGHTTP2_HD_STATE_NEWNAME_READ_NAME;
 2067|  7.02k|        rv = nghttp2_rcbuf_new(&inflater->namercbuf, inflater->left + 1, mem);
 2068|  7.02k|      }
 2069|       |
 2070|  7.22k|      if (rv != 0) {
  ------------------
  |  Branch (2070:11): [True: 0, False: 7.22k]
  ------------------
 2071|      0|        goto fail;
 2072|      0|      }
 2073|       |
 2074|  7.22k|      nghttp2_buf_wrap_init(&inflater->namebuf, inflater->namercbuf->base,
 2075|  7.22k|                            inflater->namercbuf->len);
 2076|       |
 2077|  7.22k|      break;
 2078|    210|    case NGHTTP2_HD_STATE_NEWNAME_READ_NAMEHUFF:
  ------------------
  |  Branch (2078:5): [True: 210, False: 136k]
  ------------------
 2079|    210|      rv = hd_inflate_read_huff(inflater, &inflater->namebuf, in, last);
 2080|    210|      if (rv < 0) {
  ------------------
  |  Branch (2080:11): [True: 43, False: 167]
  ------------------
 2081|     43|        goto fail;
 2082|     43|      }
 2083|       |
 2084|    167|      in += rv;
 2085|       |
 2086|    167|      DEBUGF("inflatehd: %td bytes read\n", rv);
  ------------------
  |  |   39|    167|    do {                                                                       \
  |  |   40|    167|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 167]
  |  |  ------------------
  ------------------
 2087|       |
 2088|    167|      if (inflater->left) {
  ------------------
  |  Branch (2088:11): [True: 98, False: 69]
  ------------------
 2089|     98|        DEBUGF("inflatehd: still %zu bytes to go\n", inflater->left);
  ------------------
  |  |   39|     98|    do {                                                                       \
  |  |   40|     98|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 98]
  |  |  ------------------
  ------------------
 2090|       |
 2091|     98|        goto almost_ok;
 2092|     98|      }
 2093|       |
 2094|     69|      *inflater->namebuf.last = '\0';
 2095|     69|      inflater->namercbuf->len = nghttp2_buf_len(&inflater->namebuf);
  ------------------
  |  |   54|     69|#define nghttp2_buf_len(BUF) ((size_t)((BUF)->last - (BUF)->pos))
  ------------------
 2096|       |
 2097|     69|      inflater->state = NGHTTP2_HD_STATE_CHECK_VALUELEN;
 2098|       |
 2099|     69|      break;
 2100|  7.01k|    case NGHTTP2_HD_STATE_NEWNAME_READ_NAME:
  ------------------
  |  Branch (2100:5): [True: 7.01k, False: 129k]
  ------------------
 2101|  7.01k|      rv = hd_inflate_read(inflater, &inflater->namebuf, in, last);
 2102|  7.01k|      if (rv < 0) {
  ------------------
  |  Branch (2102:11): [True: 0, False: 7.01k]
  ------------------
 2103|      0|        goto fail;
 2104|      0|      }
 2105|       |
 2106|  7.01k|      in += rv;
 2107|       |
 2108|  7.01k|      DEBUGF("inflatehd: %td bytes read\n", rv);
  ------------------
  |  |   39|  7.01k|    do {                                                                       \
  |  |   40|  7.01k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 7.01k]
  |  |  ------------------
  ------------------
 2109|  7.01k|      if (inflater->left) {
  ------------------
  |  Branch (2109:11): [True: 70, False: 6.94k]
  ------------------
 2110|     70|        DEBUGF("inflatehd: still %zu bytes to go\n", inflater->left);
  ------------------
  |  |   39|     70|    do {                                                                       \
  |  |   40|     70|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 70]
  |  |  ------------------
  ------------------
 2111|       |
 2112|     70|        goto almost_ok;
 2113|     70|      }
 2114|       |
 2115|  6.94k|      *inflater->namebuf.last = '\0';
 2116|  6.94k|      inflater->namercbuf->len = nghttp2_buf_len(&inflater->namebuf);
  ------------------
  |  |   54|  6.94k|#define nghttp2_buf_len(BUF) ((size_t)((BUF)->last - (BUF)->pos))
  ------------------
 2117|       |
 2118|  6.94k|      inflater->state = NGHTTP2_HD_STATE_CHECK_VALUELEN;
 2119|       |
 2120|  6.94k|      break;
 2121|  10.4k|    case NGHTTP2_HD_STATE_CHECK_VALUELEN:
  ------------------
  |  Branch (2121:5): [True: 10.4k, False: 125k]
  ------------------
 2122|  10.4k|      hd_inflate_set_huffman_encoded(inflater, in);
 2123|  10.4k|      inflater->state = NGHTTP2_HD_STATE_READ_VALUELEN;
 2124|  10.4k|      inflater->left = 0;
 2125|  10.4k|      inflater->shift = 0;
 2126|  10.4k|      DEBUGF("inflatehd: huffman encoded=%d\n", inflater->huffman_encoded != 0);
  ------------------
  |  |   39|  10.4k|    do {                                                                       \
  |  |   40|  10.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 10.4k]
  |  |  ------------------
  ------------------
 2127|       |    /* Fall through */
 2128|  10.4k|    case NGHTTP2_HD_STATE_READ_VALUELEN:
  ------------------
  |  Branch (2128:5): [True: 28, False: 136k]
  ------------------
 2129|  10.4k|      rfin = 0;
 2130|  10.4k|      rv = hd_inflate_read_len(inflater, &rfin, in, last, 7, NGHTTP2_HD_MAX_NV);
  ------------------
  |  |   45|  10.4k|#define NGHTTP2_HD_MAX_NV 65536
  ------------------
 2131|  10.4k|      if (rv < 0) {
  ------------------
  |  Branch (2131:11): [True: 70, False: 10.4k]
  ------------------
 2132|     70|        goto fail;
 2133|     70|      }
 2134|       |
 2135|  10.4k|      in += rv;
 2136|       |
 2137|  10.4k|      if (!rfin) {
  ------------------
  |  Branch (2137:11): [True: 36, False: 10.3k]
  ------------------
 2138|     36|        goto almost_ok;
 2139|     36|      }
 2140|       |
 2141|  10.3k|      DEBUGF("inflatehd: valuelen=%zu\n", inflater->left);
  ------------------
  |  |   39|  10.3k|    do {                                                                       \
  |  |   40|  10.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 10.3k]
  |  |  ------------------
  ------------------
 2142|       |
 2143|  10.3k|      if (inflater->huffman_encoded) {
  ------------------
  |  Branch (2143:11): [True: 570, False: 9.82k]
  ------------------
 2144|    570|        nghttp2_hd_huff_decode_context_init(&inflater->huff_decode_ctx);
 2145|       |
 2146|    570|        inflater->state = NGHTTP2_HD_STATE_READ_VALUEHUFF;
 2147|       |
 2148|    570|        rv = nghttp2_rcbuf_new(
 2149|    570|          &inflater->valuercbuf,
 2150|    570|          nghttp2_huff_estimate_decode_length(inflater->left) + 1, mem);
 2151|  9.82k|      } else {
 2152|  9.82k|        inflater->state = NGHTTP2_HD_STATE_READ_VALUE;
 2153|       |
 2154|  9.82k|        rv = nghttp2_rcbuf_new(&inflater->valuercbuf, inflater->left + 1, mem);
 2155|  9.82k|      }
 2156|       |
 2157|  10.3k|      if (rv != 0) {
  ------------------
  |  Branch (2157:11): [True: 0, False: 10.3k]
  ------------------
 2158|      0|        goto fail;
 2159|      0|      }
 2160|       |
 2161|  10.3k|      nghttp2_buf_wrap_init(&inflater->valuebuf, inflater->valuercbuf->base,
 2162|  10.3k|                            inflater->valuercbuf->len);
 2163|       |
 2164|  10.3k|      busy = 1;
 2165|       |
 2166|  10.3k|      break;
 2167|    581|    case NGHTTP2_HD_STATE_READ_VALUEHUFF:
  ------------------
  |  Branch (2167:5): [True: 581, False: 135k]
  ------------------
 2168|    581|      rv = hd_inflate_read_huff(inflater, &inflater->valuebuf, in, last);
 2169|    581|      if (rv < 0) {
  ------------------
  |  Branch (2169:11): [True: 123, False: 458]
  ------------------
 2170|    123|        goto fail;
 2171|    123|      }
 2172|       |
 2173|    458|      in += rv;
 2174|       |
 2175|    458|      DEBUGF("inflatehd: %td bytes read\n", rv);
  ------------------
  |  |   39|    458|    do {                                                                       \
  |  |   40|    458|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 458]
  |  |  ------------------
  ------------------
 2176|       |
 2177|    458|      if (inflater->left) {
  ------------------
  |  Branch (2177:11): [True: 214, False: 244]
  ------------------
 2178|    214|        DEBUGF("inflatehd: still %zu bytes to go\n", inflater->left);
  ------------------
  |  |   39|    214|    do {                                                                       \
  |  |   40|    214|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 214]
  |  |  ------------------
  ------------------
 2179|       |
 2180|    214|        goto almost_ok;
 2181|    214|      }
 2182|       |
 2183|    244|      *inflater->valuebuf.last = '\0';
 2184|    244|      inflater->valuercbuf->len = nghttp2_buf_len(&inflater->valuebuf);
  ------------------
  |  |   54|    244|#define nghttp2_buf_len(BUF) ((size_t)((BUF)->last - (BUF)->pos))
  ------------------
 2185|       |
 2186|    244|      if (inflater->opcode == NGHTTP2_HD_OPCODE_NEWNAME) {
  ------------------
  |  Branch (2186:11): [True: 99, False: 145]
  ------------------
 2187|     99|        rv = hd_inflate_commit_newname(inflater, nv_out);
 2188|    145|      } else {
 2189|    145|        rv = hd_inflate_commit_indname(inflater, nv_out);
 2190|    145|      }
 2191|       |
 2192|    244|      if (rv != 0) {
  ------------------
  |  Branch (2192:11): [True: 0, False: 244]
  ------------------
 2193|      0|        goto fail;
 2194|      0|      }
 2195|       |
 2196|    244|      inflater->state = NGHTTP2_HD_STATE_OPCODE;
 2197|    244|      *inflate_flags |= NGHTTP2_HD_INFLATE_EMIT;
 2198|       |
 2199|    244|      return (nghttp2_ssize)(in - first);
 2200|  9.85k|    case NGHTTP2_HD_STATE_READ_VALUE:
  ------------------
  |  Branch (2200:5): [True: 9.85k, False: 126k]
  ------------------
 2201|  9.85k|      rv = hd_inflate_read(inflater, &inflater->valuebuf, in, last);
 2202|  9.85k|      if (rv < 0) {
  ------------------
  |  Branch (2202:11): [True: 0, False: 9.85k]
  ------------------
 2203|      0|        DEBUGF("inflatehd: value read failure %td: %s\n", rv,
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2204|      0|               nghttp2_strerror((int)rv));
 2205|      0|        goto fail;
 2206|      0|      }
 2207|       |
 2208|  9.85k|      in += rv;
 2209|       |
 2210|  9.85k|      DEBUGF("inflatehd: %td bytes read\n", rv);
  ------------------
  |  |   39|  9.85k|    do {                                                                       \
  |  |   40|  9.85k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 9.85k]
  |  |  ------------------
  ------------------
 2211|       |
 2212|  9.85k|      if (inflater->left) {
  ------------------
  |  Branch (2212:11): [True: 262, False: 9.59k]
  ------------------
 2213|    262|        DEBUGF("inflatehd: still %zu bytes to go\n", inflater->left);
  ------------------
  |  |   39|    262|    do {                                                                       \
  |  |   40|    262|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 262]
  |  |  ------------------
  ------------------
 2214|    262|        goto almost_ok;
 2215|    262|      }
 2216|       |
 2217|  9.59k|      *inflater->valuebuf.last = '\0';
 2218|  9.59k|      inflater->valuercbuf->len = nghttp2_buf_len(&inflater->valuebuf);
  ------------------
  |  |   54|  9.59k|#define nghttp2_buf_len(BUF) ((size_t)((BUF)->last - (BUF)->pos))
  ------------------
 2219|       |
 2220|  9.59k|      if (inflater->opcode == NGHTTP2_HD_OPCODE_NEWNAME) {
  ------------------
  |  Branch (2220:11): [True: 6.71k, False: 2.88k]
  ------------------
 2221|  6.71k|        rv = hd_inflate_commit_newname(inflater, nv_out);
 2222|  6.71k|      } else {
 2223|  2.88k|        rv = hd_inflate_commit_indname(inflater, nv_out);
 2224|  2.88k|      }
 2225|       |
 2226|  9.59k|      if (rv != 0) {
  ------------------
  |  Branch (2226:11): [True: 0, False: 9.59k]
  ------------------
 2227|      0|        goto fail;
 2228|      0|      }
 2229|       |
 2230|  9.59k|      inflater->state = NGHTTP2_HD_STATE_OPCODE;
 2231|  9.59k|      *inflate_flags |= NGHTTP2_HD_INFLATE_EMIT;
 2232|       |
 2233|  9.59k|      return (nghttp2_ssize)(in - first);
 2234|   136k|    }
 2235|   136k|  }
 2236|       |
 2237|  52.8k|  assert(in == last);
  ------------------
  |  Branch (2237:3): [True: 0, False: 590]
  |  Branch (2237:3): [True: 590, False: 0]
  ------------------
 2238|       |
 2239|    590|  DEBUGF("inflatehd: all input bytes were processed\n");
  ------------------
  |  |   39|    590|    do {                                                                       \
  |  |   40|    590|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 590]
  |  |  ------------------
  ------------------
 2240|       |
 2241|    590|  if (in_final) {
  ------------------
  |  Branch (2241:7): [True: 484, False: 106]
  ------------------
 2242|    484|    DEBUGF("inflatehd: in_final set\n");
  ------------------
  |  |   39|    484|    do {                                                                       \
  |  |   40|    484|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 484]
  |  |  ------------------
  ------------------
 2243|       |
 2244|    484|    if (inflater->state != NGHTTP2_HD_STATE_OPCODE &&
  ------------------
  |  Branch (2244:9): [True: 207, False: 277]
  ------------------
 2245|    207|        inflater->state != NGHTTP2_HD_STATE_INFLATE_START) {
  ------------------
  |  Branch (2245:9): [True: 2, False: 205]
  ------------------
 2246|      2|      DEBUGF("inflatehd: unacceptable state=%d\n", inflater->state);
  ------------------
  |  |   39|      2|    do {                                                                       \
  |  |   40|      2|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
 2247|      2|      rv = NGHTTP2_ERR_HEADER_COMP;
 2248|       |
 2249|      2|      goto fail;
 2250|      2|    }
 2251|    482|    *inflate_flags |= NGHTTP2_HD_INFLATE_FINAL;
 2252|    482|  }
 2253|    588|  return (nghttp2_ssize)(in - first);
 2254|       |
 2255|    747|almost_ok:
 2256|    747|  if (in_final) {
  ------------------
  |  Branch (2256:7): [True: 22, False: 725]
  ------------------
 2257|     22|    DEBUGF("inflatehd: input ended prematurely\n");
  ------------------
  |  |   39|     22|    do {                                                                       \
  |  |   40|     22|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 22]
  |  |  ------------------
  ------------------
 2258|       |
 2259|     22|    rv = NGHTTP2_ERR_HEADER_COMP;
 2260|       |
 2261|     22|    goto fail;
 2262|     22|  }
 2263|    725|  return (nghttp2_ssize)(in - first);
 2264|       |
 2265|  1.00k|fail:
 2266|  1.00k|  DEBUGF("inflatehd: error return %td\n", rv);
  ------------------
  |  |   39|  1.00k|    do {                                                                       \
  |  |   40|  1.00k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 1.00k]
  |  |  ------------------
  ------------------
 2267|       |
 2268|  1.00k|  inflater->ctx.bad = 1;
 2269|  1.00k|  return rv;
 2270|    747|}
nghttp2_hd_inflate_end_headers:
 2272|    482|int nghttp2_hd_inflate_end_headers(nghttp2_hd_inflater *inflater) {
 2273|    482|  hd_inflate_keep_free(inflater);
 2274|    482|  inflater->state = NGHTTP2_HD_STATE_INFLATE_START;
 2275|    482|  return 0;
 2276|    482|}
nghttp2_hd.c:hd_context_init:
  687|  8.89k|static int hd_context_init(nghttp2_hd_context *context, nghttp2_mem *mem) {
  688|  8.89k|  int rv;
  689|  8.89k|  context->mem = mem;
  690|  8.89k|  context->bad = 0;
  691|  8.89k|  context->hd_table_bufsize_max = NGHTTP2_HD_DEFAULT_MAX_BUFFER_SIZE;
  ------------------
  |  |   39|  8.89k|#define NGHTTP2_HD_DEFAULT_MAX_BUFFER_SIZE NGHTTP2_DEFAULT_HEADER_TABLE_SIZE
  |  |  ------------------
  |  |  |  |  244|  8.89k|#define NGHTTP2_DEFAULT_HEADER_TABLE_SIZE (1 << 12)
  |  |  ------------------
  ------------------
  692|  8.89k|  rv = hd_ringbuf_init(
  693|  8.89k|    &context->hd_table,
  694|  8.89k|    context->hd_table_bufsize_max / NGHTTP2_HD_ENTRY_OVERHEAD, mem);
  ------------------
  |  |   40|  8.89k|#define NGHTTP2_HD_ENTRY_OVERHEAD 32
  ------------------
  695|  8.89k|  if (rv != 0) {
  ------------------
  |  Branch (695:7): [True: 0, False: 8.89k]
  ------------------
  696|      0|    return rv;
  697|      0|  }
  698|       |
  699|  8.89k|  context->hd_table_bufsize = 0;
  700|  8.89k|  context->next_seq = 0;
  701|       |
  702|  8.89k|  return 0;
  703|  8.89k|}
nghttp2_hd.c:hd_ringbuf_init:
  596|  8.89k|                           nghttp2_mem *mem) {
  597|  8.89k|  size_t size;
  598|  8.89k|  const size_t max_size = SIZE_MAX / sizeof(nghttp2_hd_entry *);
  599|       |
  600|  8.89k|  if (bufsize > max_size) {
  ------------------
  |  Branch (600:7): [True: 0, False: 8.89k]
  ------------------
  601|      0|    return NGHTTP2_ERR_NOMEM;
  602|      0|  }
  603|       |
  604|  71.1k|  for (size = 1; size < bufsize; size <<= 1)
  ------------------
  |  Branch (604:18): [True: 62.2k, False: 8.89k]
  ------------------
  605|  62.2k|    ;
  606|       |
  607|  8.89k|  if (size > max_size) {
  ------------------
  |  Branch (607:7): [True: 0, False: 8.89k]
  ------------------
  608|      0|    return NGHTTP2_ERR_NOMEM;
  609|      0|  }
  610|       |
  611|  8.89k|  ringbuf->buffer = nghttp2_mem_malloc(mem, sizeof(nghttp2_hd_entry *) * size);
  612|  8.89k|  if (ringbuf->buffer == NULL) {
  ------------------
  |  Branch (612:7): [True: 0, False: 8.89k]
  ------------------
  613|      0|    return NGHTTP2_ERR_NOMEM;
  614|      0|  }
  615|  8.89k|  ringbuf->mask = size - 1;
  616|  8.89k|  ringbuf->first = 0;
  617|  8.89k|  ringbuf->len = 0;
  618|  8.89k|  return 0;
  619|  8.89k|}
nghttp2_hd.c:hd_map_init:
  531|  4.44k|static void hd_map_init(nghttp2_hd_map *map) {
  532|  4.44k|  memset(map, 0, sizeof(nghttp2_hd_map));
  533|  4.44k|}
nghttp2_hd.c:hd_context_free:
  705|  8.89k|static void hd_context_free(nghttp2_hd_context *context) {
  706|  8.89k|  hd_ringbuf_free(&context->hd_table, context->mem);
  707|  8.89k|}
nghttp2_hd.c:hd_ringbuf_free:
  652|  8.89k|static void hd_ringbuf_free(nghttp2_hd_ringbuf *ringbuf, nghttp2_mem *mem) {
  653|  8.89k|  size_t i;
  654|  8.89k|  if (ringbuf == NULL) {
  ------------------
  |  Branch (654:7): [True: 0, False: 8.89k]
  ------------------
  655|      0|    return;
  656|      0|  }
  657|  37.6k|  for (i = 0; i < ringbuf->len; ++i) {
  ------------------
  |  Branch (657:15): [True: 28.7k, False: 8.89k]
  ------------------
  658|  28.7k|    nghttp2_hd_entry *ent = hd_ringbuf_get(ringbuf, i);
  659|       |
  660|  28.7k|    nghttp2_hd_entry_free(ent);
  661|  28.7k|    nghttp2_mem_free(mem, ent);
  662|  28.7k|  }
  663|  8.89k|  nghttp2_mem_free(mem, ringbuf->buffer);
  664|  8.89k|}
nghttp2_hd.c:hd_inflate_keep_free:
  774|  57.7k|static void hd_inflate_keep_free(nghttp2_hd_inflater *inflater) {
  775|  57.7k|  nghttp2_rcbuf_decref(inflater->nv_value_keep);
  776|  57.7k|  nghttp2_rcbuf_decref(inflater->nv_name_keep);
  777|       |
  778|  57.7k|  inflater->nv_value_keep = NULL;
  779|       |  inflater->nv_name_keep = NULL;
  780|  57.7k|}
nghttp2_hd.c:hd_context_shrink_table_size:
 1237|  2.46k|                                         nghttp2_hd_map *map) {
 1238|  2.46k|  nghttp2_mem *mem;
 1239|       |
 1240|  2.46k|  mem = context->mem;
 1241|       |
 1242|  2.69k|  while (context->hd_table_bufsize > context->hd_table_bufsize_max &&
  ------------------
  |  Branch (1242:10): [True: 229, False: 2.46k]
  ------------------
 1243|    229|         context->hd_table.len > 0) {
  ------------------
  |  Branch (1243:10): [True: 229, False: 0]
  ------------------
 1244|    229|    size_t idx = context->hd_table.len - 1;
 1245|    229|    nghttp2_hd_entry *ent = hd_ringbuf_get(&context->hd_table, idx);
 1246|    229|    context->hd_table_bufsize -=
 1247|    229|      entry_room(ent->nv.name->len, ent->nv.value->len);
 1248|    229|    hd_ringbuf_pop_back(&context->hd_table);
 1249|    229|    if (map) {
  ------------------
  |  Branch (1249:9): [True: 223, False: 6]
  ------------------
 1250|    223|      hd_map_remove(map, ent);
 1251|    223|    }
 1252|       |
 1253|    229|    nghttp2_hd_entry_free(ent);
 1254|    229|    nghttp2_mem_free(mem, ent);
 1255|    229|  }
 1256|  2.46k|}
nghttp2_hd.c:entry_room:
  795|   207k|static size_t entry_room(size_t namelen, size_t valuelen) {
  796|   207k|  return NGHTTP2_HD_ENTRY_OVERHEAD + namelen + valuelen;
  ------------------
  |  |   40|   207k|#define NGHTTP2_HD_ENTRY_OVERHEAD 32
  ------------------
  797|   207k|}
nghttp2_hd.c:hd_ringbuf_pop_back:
  682|  23.3k|static void hd_ringbuf_pop_back(nghttp2_hd_ringbuf *ringbuf) {
  683|  23.3k|  assert(ringbuf->len > 0);
  ------------------
  |  Branch (683:3): [True: 0, False: 23.3k]
  |  Branch (683:3): [True: 23.3k, False: 0]
  ------------------
  684|  23.3k|  --ringbuf->len;
  685|  23.3k|}
nghttp2_hd.c:hd_map_remove:
  579|  23.2k|static void hd_map_remove(nghttp2_hd_map *map, nghttp2_hd_entry *ent) {
  580|  23.2k|  nghttp2_hd_entry **dst;
  581|       |
  582|  23.2k|  dst = &map->table[ent->hash & (HD_MAP_SIZE - 1)];
  ------------------
  |  |  214|  23.2k|#define HD_MAP_SIZE 128
  ------------------
  583|       |
  584|  36.6k|  for (; *dst; dst = &(*dst)->next) {
  ------------------
  |  Branch (584:10): [True: 36.6k, False: 0]
  ------------------
  585|  36.6k|    if (*dst != ent) {
  ------------------
  |  Branch (585:9): [True: 13.3k, False: 23.2k]
  ------------------
  586|  13.3k|      continue;
  587|  13.3k|    }
  588|       |
  589|  23.2k|    *dst = ent->next;
  590|       |    ent->next = NULL;
  591|  23.2k|    return;
  592|  36.6k|  }
  593|  23.2k|}
nghttp2_hd.c:hd_ringbuf_get:
  622|  90.0k|                                        size_t idx) {
  623|  90.0k|  assert(idx < ringbuf->len);
  ------------------
  |  Branch (623:3): [True: 0, False: 90.0k]
  |  Branch (623:3): [True: 90.0k, False: 0]
  ------------------
  624|  90.0k|  return ringbuf->buffer[(ringbuf->first + idx) & ringbuf->mask];
  625|  90.0k|}
nghttp2_hd.c:count_encoded_length:
  807|   200k|static size_t count_encoded_length(size_t n, size_t prefix) {
  808|   200k|  size_t k = (size_t)((1 << prefix) - 1);
  809|   200k|  size_t len = 0;
  810|       |
  811|   200k|  if (n < k) {
  ------------------
  |  Branch (811:7): [True: 185k, False: 15.4k]
  ------------------
  812|   185k|    return 1;
  813|   185k|  }
  814|       |
  815|  15.4k|  n -= k;
  816|  15.4k|  ++len;
  817|       |
  818|  17.1k|  for (; n >= 128; n >>= 7, ++len)
  ------------------
  |  Branch (818:10): [True: 1.79k, False: 15.4k]
  ------------------
  819|  1.79k|    ;
  820|       |
  821|  15.4k|  return len + 1;
  822|   200k|}
nghttp2_hd.c:encode_length:
  824|   200k|static size_t encode_length(uint8_t *buf, size_t n, size_t prefix) {
  825|   200k|  size_t k = (size_t)((1 << prefix) - 1);
  826|   200k|  uint8_t *begin = buf;
  827|       |
  828|   200k|  *buf = (uint8_t)(*buf & ~k);
  829|       |
  830|   200k|  if (n < k) {
  ------------------
  |  Branch (830:7): [True: 185k, False: 15.4k]
  ------------------
  831|   185k|    *buf = (uint8_t)(*buf | n);
  832|   185k|    return 1;
  833|   185k|  }
  834|       |
  835|  15.4k|  *buf = (uint8_t)(*buf | k);
  836|  15.4k|  ++buf;
  837|       |
  838|  15.4k|  n -= k;
  839|       |
  840|  17.1k|  for (; n >= 128; n >>= 7) {
  ------------------
  |  Branch (840:10): [True: 1.79k, False: 15.4k]
  ------------------
  841|  1.79k|    *buf++ = (uint8_t)((1 << 7) | (n & 0x7f));
  842|  1.79k|  }
  843|       |
  844|  15.4k|  *buf++ = (uint8_t)n;
  845|       |
  846|  15.4k|  return (size_t)(buf - begin);
  847|   200k|}
nghttp2_hd.c:deflate_nv:
 1356|   141k|                      const nghttp2_nv *nv) {
 1357|   141k|  int rv;
 1358|   141k|  search_result res;
 1359|   141k|  nghttp2_ssize idx;
 1360|   141k|  int indexing_mode;
 1361|   141k|  int32_t token;
 1362|   141k|  nghttp2_mem *mem;
 1363|   141k|  uint32_t hash = 0;
 1364|       |
 1365|   141k|  DEBUGF("deflatehd: deflating %.*s: %.*s\n", (int)nv->namelen, nv->name,
  ------------------
  |  |   39|   141k|    do {                                                                       \
  |  |   40|   141k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 141k]
  |  |  ------------------
  ------------------
 1366|   141k|         (int)nv->valuelen, nv->value);
 1367|       |
 1368|   141k|  mem = deflater->ctx.mem;
 1369|       |
 1370|   141k|  token = lookup_token(nv->name, nv->namelen);
 1371|   141k|  if (token == -1) {
  ------------------
  |  Branch (1371:7): [True: 101k, False: 40.4k]
  ------------------
 1372|   101k|    hash = name_hash(nv);
 1373|   101k|  } else if (token <= NGHTTP2_TOKEN_WWW_AUTHENTICATE) {
  ------------------
  |  Branch (1373:14): [True: 40.4k, False: 54]
  ------------------
 1374|  40.4k|    hash = static_table[token].hash;
 1375|  40.4k|  }
 1376|       |
 1377|       |  /* Don't index authorization header field since it may contain low
 1378|       |     entropy secret data (e.g., id/password).  Also cookie header
 1379|       |     field with less than 20 bytes value is also never indexed.  This
 1380|       |     is the same criteria used in Firefox codebase. */
 1381|   141k|  indexing_mode = token == NGHTTP2_TOKEN_AUTHORIZATION ||
  ------------------
  |  Branch (1381:19): [True: 2.90k, False: 139k]
  ------------------
 1382|   139k|                      (token == NGHTTP2_TOKEN_COOKIE && nv->valuelen < 20) ||
  ------------------
  |  Branch (1382:24): [True: 436, False: 138k]
  |  Branch (1382:57): [True: 287, False: 149]
  ------------------
 1383|   138k|                      (nv->flags & NGHTTP2_NV_FLAG_NO_INDEX)
  ------------------
  |  Branch (1383:23): [True: 0, False: 138k]
  ------------------
 1384|   141k|                    ? NGHTTP2_HD_NEVER_INDEXING
 1385|   141k|                    : hd_deflate_decide_indexing(deflater, nv, token);
 1386|       |
 1387|   141k|  res = search_hd_table(&deflater->ctx, nv, token, indexing_mode,
 1388|   141k|                        &deflater->map, hash);
 1389|       |
 1390|   141k|  idx = res.index;
 1391|       |
 1392|   141k|  if (res.name_value_match) {
  ------------------
  |  Branch (1392:7): [True: 83.4k, False: 58.5k]
  ------------------
 1393|  83.4k|    DEBUGF("deflatehd: name/value match index=%td\n", idx);
  ------------------
  |  |   39|  83.4k|    do {                                                                       \
  |  |   40|  83.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 83.4k]
  |  |  ------------------
  ------------------
 1394|       |
 1395|  83.4k|    rv = emit_indexed_block(bufs, (size_t)idx);
 1396|  83.4k|    if (rv != 0) {
  ------------------
  |  Branch (1396:9): [True: 0, False: 83.4k]
  ------------------
 1397|      0|      return rv;
 1398|      0|    }
 1399|       |
 1400|  83.4k|    return 0;
 1401|  83.4k|  }
 1402|       |
 1403|  58.5k|  if (res.index != -1) {
  ------------------
  |  Branch (1403:7): [True: 26.7k, False: 31.7k]
  ------------------
 1404|  26.7k|    DEBUGF("deflatehd: name match index=%td\n", res.index);
  ------------------
  |  |   39|  26.7k|    do {                                                                       \
  |  |   40|  26.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 26.7k]
  |  |  ------------------
  ------------------
 1405|  26.7k|  }
 1406|       |
 1407|  58.5k|  if (indexing_mode == NGHTTP2_HD_WITH_INDEXING) {
  ------------------
  |  Branch (1407:7): [True: 50.1k, False: 8.34k]
  ------------------
 1408|  50.1k|    nghttp2_hd_nv hd_nv;
 1409|       |
 1410|  50.1k|    if (idx != -1) {
  ------------------
  |  Branch (1410:9): [True: 18.4k, False: 31.6k]
  ------------------
 1411|  18.4k|      hd_nv.name = nghttp2_hd_table_get(&deflater->ctx, (size_t)idx).name;
 1412|  18.4k|      nghttp2_rcbuf_incref(hd_nv.name);
 1413|  31.6k|    } else {
 1414|  31.6k|      rv = nghttp2_rcbuf_new2(&hd_nv.name, nv->name, nv->namelen, mem);
 1415|  31.6k|      if (rv != 0) {
  ------------------
  |  Branch (1415:11): [True: 0, False: 31.6k]
  ------------------
 1416|      0|        return rv;
 1417|      0|      }
 1418|  31.6k|    }
 1419|       |
 1420|  50.1k|    rv = nghttp2_rcbuf_new2(&hd_nv.value, nv->value, nv->valuelen, mem);
 1421|       |
 1422|  50.1k|    if (rv != 0) {
  ------------------
  |  Branch (1422:9): [True: 0, False: 50.1k]
  ------------------
 1423|      0|      nghttp2_rcbuf_decref(hd_nv.name);
 1424|      0|      return rv;
 1425|      0|    }
 1426|       |
 1427|  50.1k|    hd_nv.token = token;
 1428|  50.1k|    hd_nv.flags = NGHTTP2_NV_FLAG_NONE;
 1429|       |
 1430|  50.1k|    rv = add_hd_table_incremental(&deflater->ctx, &hd_nv, &deflater->map, hash);
 1431|       |
 1432|  50.1k|    nghttp2_rcbuf_decref(hd_nv.value);
 1433|  50.1k|    nghttp2_rcbuf_decref(hd_nv.name);
 1434|       |
 1435|  50.1k|    if (rv != 0) {
  ------------------
  |  Branch (1435:9): [True: 0, False: 50.1k]
  ------------------
 1436|      0|      return NGHTTP2_ERR_HEADER_COMP;
 1437|      0|    }
 1438|  50.1k|  }
 1439|  58.5k|  if (idx == -1) {
  ------------------
  |  Branch (1439:7): [True: 31.7k, False: 26.7k]
  ------------------
 1440|  31.7k|    rv = emit_newname_block(bufs, nv, indexing_mode);
 1441|  31.7k|  } else {
 1442|  26.7k|    rv = emit_indname_block(bufs, (size_t)idx, nv, indexing_mode);
 1443|  26.7k|  }
 1444|  58.5k|  if (rv != 0) {
  ------------------
  |  Branch (1444:7): [True: 0, False: 58.5k]
  ------------------
 1445|      0|    return rv;
 1446|      0|  }
 1447|       |
 1448|  58.5k|  return 0;
 1449|  58.5k|}
nghttp2_hd.c:lookup_token:
  122|   148k|static int32_t lookup_token(const uint8_t *name, size_t namelen) {
  123|   148k|  switch (namelen) {
  ------------------
  |  Branch (123:11): [True: 130k, False: 18.0k]
  ------------------
  124|  14.6k|  case 2:
  ------------------
  |  Branch (124:3): [True: 14.6k, False: 134k]
  ------------------
  125|  14.6k|    switch (name[1]) {
  ------------------
  |  Branch (125:13): [True: 939, False: 13.7k]
  ------------------
  126|    939|    case 'e':
  ------------------
  |  Branch (126:5): [True: 939, False: 13.7k]
  ------------------
  127|    939|      if (memeq("t", name, 1)) {
  ------------------
  |  Branch (127:11): [True: 91, False: 848]
  ------------------
  128|     91|        return NGHTTP2_TOKEN_TE;
  129|     91|      }
  130|    848|      break;
  131|  14.6k|    }
  132|  14.5k|    break;
  133|  18.9k|  case 3:
  ------------------
  |  Branch (133:3): [True: 18.9k, False: 129k]
  ------------------
  134|  18.9k|    switch (name[2]) {
  ------------------
  |  Branch (134:13): [True: 8.18k, False: 10.7k]
  ------------------
  135|  6.27k|    case 'a':
  ------------------
  |  Branch (135:5): [True: 6.27k, False: 12.6k]
  ------------------
  136|  6.27k|      if (memeq("vi", name, 2)) {
  ------------------
  |  Branch (136:11): [True: 1.80k, False: 4.47k]
  ------------------
  137|  1.80k|        return NGHTTP2_TOKEN_VIA;
  138|  1.80k|      }
  139|  4.47k|      break;
  140|  4.47k|    case 'e':
  ------------------
  |  Branch (140:5): [True: 1.90k, False: 17.0k]
  ------------------
  141|  1.90k|      if (memeq("ag", name, 2)) {
  ------------------
  |  Branch (141:11): [True: 728, False: 1.17k]
  ------------------
  142|    728|        return NGHTTP2_TOKEN_AGE;
  143|    728|      }
  144|  1.17k|      break;
  145|  18.9k|    }
  146|  16.4k|    break;
  147|  16.4k|  case 4:
  ------------------
  |  Branch (147:3): [True: 12.7k, False: 136k]
  ------------------
  148|  12.7k|    switch (name[3]) {
  ------------------
  |  Branch (148:13): [True: 11.3k, False: 1.43k]
  ------------------
  149|  2.12k|    case 'e':
  ------------------
  |  Branch (149:5): [True: 2.12k, False: 10.6k]
  ------------------
  150|  2.12k|      if (memeq("dat", name, 3)) {
  ------------------
  |  Branch (150:11): [True: 24, False: 2.10k]
  ------------------
  151|     24|        return NGHTTP2_TOKEN_DATE;
  152|     24|      }
  153|  2.10k|      break;
  154|  2.10k|    case 'g':
  ------------------
  |  Branch (154:5): [True: 220, False: 12.5k]
  ------------------
  155|    220|      if (memeq("eta", name, 3)) {
  ------------------
  |  Branch (155:11): [True: 85, False: 135]
  ------------------
  156|     85|        return NGHTTP2_TOKEN_ETAG;
  157|     85|      }
  158|    135|      break;
  159|  7.70k|    case 'k':
  ------------------
  |  Branch (159:5): [True: 7.70k, False: 5.06k]
  ------------------
  160|  7.70k|      if (memeq("lin", name, 3)) {
  ------------------
  |  Branch (160:11): [True: 7.55k, False: 152]
  ------------------
  161|  7.55k|        return NGHTTP2_TOKEN_LINK;
  162|  7.55k|      }
  163|    152|      break;
  164|    163|    case 'm':
  ------------------
  |  Branch (164:5): [True: 163, False: 12.6k]
  ------------------
  165|    163|      if (memeq("fro", name, 3)) {
  ------------------
  |  Branch (165:11): [True: 43, False: 120]
  ------------------
  166|     43|        return NGHTTP2_TOKEN_FROM;
  167|     43|      }
  168|    120|      break;
  169|    235|    case 't':
  ------------------
  |  Branch (169:5): [True: 235, False: 12.5k]
  ------------------
  170|    235|      if (memeq("hos", name, 3)) {
  ------------------
  |  Branch (170:11): [True: 1, False: 234]
  ------------------
  171|      1|        return NGHTTP2_TOKEN_HOST;
  172|      1|      }
  173|    234|      break;
  174|    890|    case 'y':
  ------------------
  |  Branch (174:5): [True: 890, False: 11.8k]
  ------------------
  175|    890|      if (memeq("var", name, 3)) {
  ------------------
  |  Branch (175:11): [True: 238, False: 652]
  ------------------
  176|    238|        return NGHTTP2_TOKEN_VARY;
  177|    238|      }
  178|    652|      break;
  179|  12.7k|    }
  180|  4.82k|    break;
  181|  14.7k|  case 5:
  ------------------
  |  Branch (181:3): [True: 14.7k, False: 134k]
  ------------------
  182|  14.7k|    switch (name[4]) {
  ------------------
  |  Branch (182:13): [True: 6.30k, False: 8.39k]
  ------------------
  183|  1.75k|    case 'e':
  ------------------
  |  Branch (183:5): [True: 1.75k, False: 12.9k]
  ------------------
  184|  1.75k|      if (memeq("rang", name, 4)) {
  ------------------
  |  Branch (184:11): [True: 58, False: 1.69k]
  ------------------
  185|     58|        return NGHTTP2_TOKEN_RANGE;
  186|     58|      }
  187|  1.69k|      break;
  188|  4.47k|    case 'h':
  ------------------
  |  Branch (188:5): [True: 4.47k, False: 10.2k]
  ------------------
  189|  4.47k|      if (memeq(":pat", name, 4)) {
  ------------------
  |  Branch (189:11): [True: 4.39k, False: 79]
  ------------------
  190|  4.39k|        return NGHTTP2_TOKEN__PATH;
  191|  4.39k|      }
  192|     79|      break;
  193|     79|    case 'w':
  ------------------
  |  Branch (193:5): [True: 79, False: 14.6k]
  ------------------
  194|     79|      if (memeq("allo", name, 4)) {
  ------------------
  |  Branch (194:11): [True: 21, False: 58]
  ------------------
  195|     21|        return NGHTTP2_TOKEN_ALLOW;
  196|     21|      }
  197|     58|      break;
  198|  14.7k|    }
  199|  10.2k|    break;
  200|  10.2k|  case 6:
  ------------------
  |  Branch (200:3): [True: 9.19k, False: 139k]
  ------------------
  201|  9.19k|    switch (name[5]) {
  ------------------
  |  Branch (201:13): [True: 5.98k, False: 3.20k]
  ------------------
  202|    700|    case 'e':
  ------------------
  |  Branch (202:5): [True: 700, False: 8.49k]
  ------------------
  203|    700|      if (memeq("cooki", name, 5)) {
  ------------------
  |  Branch (203:11): [True: 436, False: 264]
  ------------------
  204|    436|        return NGHTTP2_TOKEN_COOKIE;
  205|    436|      }
  206|    264|      break;
  207|    264|    case 'r':
  ------------------
  |  Branch (207:5): [True: 176, False: 9.01k]
  ------------------
  208|    176|      if (memeq("serve", name, 5)) {
  ------------------
  |  Branch (208:11): [True: 26, False: 150]
  ------------------
  209|     26|        return NGHTTP2_TOKEN_SERVER;
  210|     26|      }
  211|    150|      break;
  212|  5.10k|    case 't':
  ------------------
  |  Branch (212:5): [True: 5.10k, False: 4.08k]
  ------------------
  213|  5.10k|      if (memeq("accep", name, 5)) {
  ------------------
  |  Branch (213:11): [True: 4.21k, False: 893]
  ------------------
  214|  4.21k|        return NGHTTP2_TOKEN_ACCEPT;
  215|  4.21k|      }
  216|    893|      if (memeq("expec", name, 5)) {
  ------------------
  |  Branch (216:11): [True: 46, False: 847]
  ------------------
  217|     46|        return NGHTTP2_TOKEN_EXPECT;
  218|     46|      }
  219|    847|      break;
  220|  9.19k|    }
  221|  4.46k|    break;
  222|  13.8k|  case 7:
  ------------------
  |  Branch (222:3): [True: 13.8k, False: 134k]
  ------------------
  223|  13.8k|    switch (name[6]) {
  ------------------
  |  Branch (223:13): [True: 11.7k, False: 2.06k]
  ------------------
  224|  4.77k|    case 'd':
  ------------------
  |  Branch (224:5): [True: 4.77k, False: 9.03k]
  ------------------
  225|  4.77k|      if (memeq(":metho", name, 6)) {
  ------------------
  |  Branch (225:11): [True: 4.40k, False: 366]
  ------------------
  226|  4.40k|        return NGHTTP2_TOKEN__METHOD;
  227|  4.40k|      }
  228|    366|      break;
  229|  4.76k|    case 'e':
  ------------------
  |  Branch (229:5): [True: 4.76k, False: 9.03k]
  ------------------
  230|  4.76k|      if (memeq(":schem", name, 6)) {
  ------------------
  |  Branch (230:11): [True: 4.40k, False: 360]
  ------------------
  231|  4.40k|        return NGHTTP2_TOKEN__SCHEME;
  232|  4.40k|      }
  233|    360|      if (memeq("upgrad", name, 6)) {
  ------------------
  |  Branch (233:11): [True: 28, False: 332]
  ------------------
  234|     28|        return NGHTTP2_TOKEN_UPGRADE;
  235|     28|      }
  236|    332|      break;
  237|    695|    case 'h':
  ------------------
  |  Branch (237:5): [True: 695, False: 13.1k]
  ------------------
  238|    695|      if (memeq("refres", name, 6)) {
  ------------------
  |  Branch (238:11): [True: 57, False: 638]
  ------------------
  239|     57|        return NGHTTP2_TOKEN_REFRESH;
  240|     57|      }
  241|    638|      break;
  242|    638|    case 'r':
  ------------------
  |  Branch (242:5): [True: 194, False: 13.6k]
  ------------------
  243|    194|      if (memeq("refere", name, 6)) {
  ------------------
  |  Branch (243:11): [True: 118, False: 76]
  ------------------
  244|    118|        return NGHTTP2_TOKEN_REFERER;
  245|    118|      }
  246|     76|      break;
  247|  1.31k|    case 's':
  ------------------
  |  Branch (247:5): [True: 1.31k, False: 12.4k]
  ------------------
  248|  1.31k|      if (memeq(":statu", name, 6)) {
  ------------------
  |  Branch (248:11): [True: 13, False: 1.30k]
  ------------------
  249|     13|        return NGHTTP2_TOKEN__STATUS;
  250|     13|      }
  251|  1.30k|      if (memeq("expire", name, 6)) {
  ------------------
  |  Branch (251:11): [True: 78, False: 1.22k]
  ------------------
  252|     78|        return NGHTTP2_TOKEN_EXPIRES;
  253|     78|      }
  254|  1.22k|      break;
  255|  13.8k|    }
  256|  4.69k|    break;
  257|  4.69k|  case 8:
  ------------------
  |  Branch (257:3): [True: 4.35k, False: 144k]
  ------------------
  258|  4.35k|    switch (name[7]) {
  ------------------
  |  Branch (258:13): [True: 2.68k, False: 1.66k]
  ------------------
  259|    306|    case 'e':
  ------------------
  |  Branch (259:5): [True: 306, False: 4.04k]
  ------------------
  260|    306|      if (memeq("if-rang", name, 7)) {
  ------------------
  |  Branch (260:11): [True: 48, False: 258]
  ------------------
  261|     48|        return NGHTTP2_TOKEN_IF_RANGE;
  262|     48|      }
  263|    258|      break;
  264|  1.76k|    case 'h':
  ------------------
  |  Branch (264:5): [True: 1.76k, False: 2.58k]
  ------------------
  265|  1.76k|      if (memeq("if-matc", name, 7)) {
  ------------------
  |  Branch (265:11): [True: 49, False: 1.71k]
  ------------------
  266|     49|        return NGHTTP2_TOKEN_IF_MATCH;
  267|     49|      }
  268|  1.71k|      break;
  269|  1.71k|    case 'n':
  ------------------
  |  Branch (269:5): [True: 315, False: 4.03k]
  ------------------
  270|    315|      if (memeq("locatio", name, 7)) {
  ------------------
  |  Branch (270:11): [True: 33, False: 282]
  ------------------
  271|     33|        return NGHTTP2_TOKEN_LOCATION;
  272|     33|      }
  273|    282|      break;
  274|    294|    case 'y':
  ------------------
  |  Branch (274:5): [True: 294, False: 4.05k]
  ------------------
  275|    294|      if (memeq("priorit", name, 7)) {
  ------------------
  |  Branch (275:11): [True: 54, False: 240]
  ------------------
  276|     54|        return NGHTTP2_TOKEN_PRIORITY;
  277|     54|      }
  278|    240|      break;
  279|  4.35k|    }
  280|  4.16k|    break;
  281|  4.16k|  case 9:
  ------------------
  |  Branch (281:3): [True: 2.42k, False: 146k]
  ------------------
  282|  2.42k|    switch (name[8]) {
  ------------------
  |  Branch (282:13): [True: 62, False: 2.35k]
  ------------------
  283|     62|    case 'l':
  ------------------
  |  Branch (283:5): [True: 62, False: 2.35k]
  ------------------
  284|     62|      if (memeq(":protoco", name, 8)) {
  ------------------
  |  Branch (284:11): [True: 14, False: 48]
  ------------------
  285|     14|        return NGHTTP2_TOKEN__PROTOCOL;
  286|     14|      }
  287|     48|      break;
  288|  2.42k|    }
  289|  2.40k|    break;
  290|  9.22k|  case 10:
  ------------------
  |  Branch (290:3): [True: 9.22k, False: 139k]
  ------------------
  291|  9.22k|    switch (name[9]) {
  ------------------
  |  Branch (291:13): [True: 8.83k, False: 397]
  ------------------
  292|  1.68k|    case 'e':
  ------------------
  |  Branch (292:5): [True: 1.68k, False: 7.54k]
  ------------------
  293|  1.68k|      if (memeq("keep-aliv", name, 9)) {
  ------------------
  |  Branch (293:11): [True: 11, False: 1.67k]
  ------------------
  294|     11|        return NGHTTP2_TOKEN_KEEP_ALIVE;
  295|     11|      }
  296|  1.67k|      if (memeq("set-cooki", name, 9)) {
  ------------------
  |  Branch (296:11): [True: 636, False: 1.03k]
  ------------------
  297|    636|        return NGHTTP2_TOKEN_SET_COOKIE;
  298|    636|      }
  299|  1.03k|      break;
  300|  1.03k|    case 'n':
  ------------------
  |  Branch (300:5): [True: 82, False: 9.14k]
  ------------------
  301|     82|      if (memeq("connectio", name, 9)) {
  ------------------
  |  Branch (301:11): [True: 5, False: 77]
  ------------------
  302|      5|        return NGHTTP2_TOKEN_CONNECTION;
  303|      5|      }
  304|     77|      break;
  305|  1.08k|    case 't':
  ------------------
  |  Branch (305:5): [True: 1.08k, False: 8.14k]
  ------------------
  306|  1.08k|      if (memeq("user-agen", name, 9)) {
  ------------------
  |  Branch (306:11): [True: 793, False: 293]
  ------------------
  307|    793|        return NGHTTP2_TOKEN_USER_AGENT;
  308|    793|      }
  309|    293|      break;
  310|  5.98k|    case 'y':
  ------------------
  |  Branch (310:5): [True: 5.98k, False: 3.24k]
  ------------------
  311|  5.98k|      if (memeq(":authorit", name, 9)) {
  ------------------
  |  Branch (311:11): [True: 4.38k, False: 1.59k]
  ------------------
  312|  4.38k|        return NGHTTP2_TOKEN__AUTHORITY;
  313|  4.38k|      }
  314|  1.59k|      break;
  315|  9.22k|    }
  316|  3.39k|    break;
  317|  4.35k|  case 11:
  ------------------
  |  Branch (317:3): [True: 4.35k, False: 144k]
  ------------------
  318|  4.35k|    switch (name[10]) {
  ------------------
  |  Branch (318:13): [True: 189, False: 4.16k]
  ------------------
  319|    189|    case 'r':
  ------------------
  |  Branch (319:5): [True: 189, False: 4.16k]
  ------------------
  320|    189|      if (memeq("retry-afte", name, 10)) {
  ------------------
  |  Branch (320:11): [True: 17, False: 172]
  ------------------
  321|     17|        return NGHTTP2_TOKEN_RETRY_AFTER;
  322|     17|      }
  323|    172|      break;
  324|  4.35k|    }
  325|  4.33k|    break;
  326|  4.33k|  case 12:
  ------------------
  |  Branch (326:3): [True: 4.22k, False: 144k]
  ------------------
  327|  4.22k|    switch (name[11]) {
  ------------------
  |  Branch (327:13): [True: 3.43k, False: 792]
  ------------------
  328|    872|    case 'e':
  ------------------
  |  Branch (328:5): [True: 872, False: 3.35k]
  ------------------
  329|    872|      if (memeq("content-typ", name, 11)) {
  ------------------
  |  Branch (329:11): [True: 415, False: 457]
  ------------------
  330|    415|        return NGHTTP2_TOKEN_CONTENT_TYPE;
  331|    415|      }
  332|    457|      break;
  333|  2.55k|    case 's':
  ------------------
  |  Branch (333:5): [True: 2.55k, False: 1.66k]
  ------------------
  334|  2.55k|      if (memeq("max-forward", name, 11)) {
  ------------------
  |  Branch (334:11): [True: 106, False: 2.45k]
  ------------------
  335|    106|        return NGHTTP2_TOKEN_MAX_FORWARDS;
  336|    106|      }
  337|  2.45k|      break;
  338|  4.22k|    }
  339|  3.70k|    break;
  340|  8.03k|  case 13:
  ------------------
  |  Branch (340:3): [True: 8.03k, False: 140k]
  ------------------
  341|  8.03k|    switch (name[12]) {
  ------------------
  |  Branch (341:13): [True: 5.24k, False: 2.79k]
  ------------------
  342|    104|    case 'd':
  ------------------
  |  Branch (342:5): [True: 104, False: 7.93k]
  ------------------
  343|    104|      if (memeq("last-modifie", name, 12)) {
  ------------------
  |  Branch (343:11): [True: 70, False: 34]
  ------------------
  344|     70|        return NGHTTP2_TOKEN_LAST_MODIFIED;
  345|     70|      }
  346|     34|      break;
  347|    741|    case 'e':
  ------------------
  |  Branch (347:5): [True: 741, False: 7.29k]
  ------------------
  348|    741|      if (memeq("content-rang", name, 12)) {
  ------------------
  |  Branch (348:11): [True: 59, False: 682]
  ------------------
  349|     59|        return NGHTTP2_TOKEN_CONTENT_RANGE;
  350|     59|      }
  351|    682|      break;
  352|    682|    case 'h':
  ------------------
  |  Branch (352:5): [True: 131, False: 7.90k]
  ------------------
  353|    131|      if (memeq("if-none-matc", name, 12)) {
  ------------------
  |  Branch (353:11): [True: 22, False: 109]
  ------------------
  354|     22|        return NGHTTP2_TOKEN_IF_NONE_MATCH;
  355|     22|      }
  356|    109|      break;
  357|    109|    case 'l':
  ------------------
  |  Branch (357:5): [True: 54, False: 7.98k]
  ------------------
  358|     54|      if (memeq("cache-contro", name, 12)) {
  ------------------
  |  Branch (358:11): [True: 18, False: 36]
  ------------------
  359|     18|        return NGHTTP2_TOKEN_CACHE_CONTROL;
  360|     18|      }
  361|     36|      break;
  362|  3.46k|    case 'n':
  ------------------
  |  Branch (362:5): [True: 3.46k, False: 4.57k]
  ------------------
  363|  3.46k|      if (memeq("authorizatio", name, 12)) {
  ------------------
  |  Branch (363:11): [True: 2.90k, False: 561]
  ------------------
  364|  2.90k|        return NGHTTP2_TOKEN_AUTHORIZATION;
  365|  2.90k|      }
  366|    561|      break;
  367|    754|    case 's':
  ------------------
  |  Branch (367:5): [True: 754, False: 7.28k]
  ------------------
  368|    754|      if (memeq("accept-range", name, 12)) {
  ------------------
  |  Branch (368:11): [True: 45, False: 709]
  ------------------
  369|     45|        return NGHTTP2_TOKEN_ACCEPT_RANGES;
  370|     45|      }
  371|    709|      break;
  372|  8.03k|    }
  373|  4.92k|    break;
  374|  4.92k|  case 14:
  ------------------
  |  Branch (374:3): [True: 2.41k, False: 146k]
  ------------------
  375|  2.41k|    switch (name[13]) {
  ------------------
  |  Branch (375:13): [True: 1.17k, False: 1.24k]
  ------------------
  376|    515|    case 'h':
  ------------------
  |  Branch (376:5): [True: 515, False: 1.90k]
  ------------------
  377|    515|      if (memeq("content-lengt", name, 13)) {
  ------------------
  |  Branch (377:11): [True: 443, False: 72]
  ------------------
  378|    443|        return NGHTTP2_TOKEN_CONTENT_LENGTH;
  379|    443|      }
  380|     72|      break;
  381|    656|    case 't':
  ------------------
  |  Branch (381:5): [True: 656, False: 1.76k]
  ------------------
  382|    656|      if (memeq("accept-charse", name, 13)) {
  ------------------
  |  Branch (382:11): [True: 37, False: 619]
  ------------------
  383|     37|        return NGHTTP2_TOKEN_ACCEPT_CHARSET;
  384|     37|      }
  385|    619|      break;
  386|  2.41k|    }
  387|  1.93k|    break;
  388|  5.39k|  case 15:
  ------------------
  |  Branch (388:3): [True: 5.39k, False: 143k]
  ------------------
  389|  5.39k|    switch (name[14]) {
  ------------------
  |  Branch (389:13): [True: 3.43k, False: 1.95k]
  ------------------
  390|    296|    case 'e':
  ------------------
  |  Branch (390:5): [True: 296, False: 5.09k]
  ------------------
  391|    296|      if (memeq("accept-languag", name, 14)) {
  ------------------
  |  Branch (391:11): [True: 26, False: 270]
  ------------------
  392|     26|        return NGHTTP2_TOKEN_ACCEPT_LANGUAGE;
  393|     26|      }
  394|    270|      break;
  395|  3.14k|    case 'g':
  ------------------
  |  Branch (395:5): [True: 3.14k, False: 2.25k]
  ------------------
  396|  3.14k|      if (memeq("accept-encodin", name, 14)) {
  ------------------
  |  Branch (396:11): [True: 947, False: 2.19k]
  ------------------
  397|    947|        return NGHTTP2_TOKEN_ACCEPT_ENCODING;
  398|    947|      }
  399|  2.19k|      break;
  400|  5.39k|    }
  401|  4.41k|    break;
  402|  4.41k|  case 16:
  ------------------
  |  Branch (402:3): [True: 2.81k, False: 145k]
  ------------------
  403|  2.81k|    switch (name[15]) {
  ------------------
  |  Branch (403:13): [True: 681, False: 2.13k]
  ------------------
  404|    466|    case 'e':
  ------------------
  |  Branch (404:5): [True: 466, False: 2.34k]
  ------------------
  405|    466|      if (memeq("content-languag", name, 15)) {
  ------------------
  |  Branch (405:11): [True: 24, False: 442]
  ------------------
  406|     24|        return NGHTTP2_TOKEN_CONTENT_LANGUAGE;
  407|     24|      }
  408|    442|      if (memeq("www-authenticat", name, 15)) {
  ------------------
  |  Branch (408:11): [True: 23, False: 419]
  ------------------
  409|     23|        return NGHTTP2_TOKEN_WWW_AUTHENTICATE;
  410|     23|      }
  411|    419|      break;
  412|    419|    case 'g':
  ------------------
  |  Branch (412:5): [True: 132, False: 2.68k]
  ------------------
  413|    132|      if (memeq("content-encodin", name, 15)) {
  ------------------
  |  Branch (413:11): [True: 30, False: 102]
  ------------------
  414|     30|        return NGHTTP2_TOKEN_CONTENT_ENCODING;
  415|     30|      }
  416|    102|      break;
  417|    102|    case 'n':
  ------------------
  |  Branch (417:5): [True: 83, False: 2.73k]
  ------------------
  418|     83|      if (memeq("content-locatio", name, 15)) {
  ------------------
  |  Branch (418:11): [True: 11, False: 72]
  ------------------
  419|     11|        return NGHTTP2_TOKEN_CONTENT_LOCATION;
  420|     11|      }
  421|     72|      if (memeq("proxy-connectio", name, 15)) {
  ------------------
  |  Branch (421:11): [True: 0, False: 72]
  ------------------
  422|      0|        return NGHTTP2_TOKEN_PROXY_CONNECTION;
  423|      0|      }
  424|     72|      break;
  425|  2.81k|    }
  426|  2.72k|    break;
  427|  2.72k|  case 17:
  ------------------
  |  Branch (427:3): [True: 1.47k, False: 147k]
  ------------------
  428|  1.47k|    switch (name[16]) {
  ------------------
  |  Branch (428:13): [True: 1.18k, False: 289]
  ------------------
  429|    652|    case 'e':
  ------------------
  |  Branch (429:5): [True: 652, False: 825]
  ------------------
  430|    652|      if (memeq("if-modified-sinc", name, 16)) {
  ------------------
  |  Branch (430:11): [True: 443, False: 209]
  ------------------
  431|    443|        return NGHTTP2_TOKEN_IF_MODIFIED_SINCE;
  432|    443|      }
  433|    209|      break;
  434|    536|    case 'g':
  ------------------
  |  Branch (434:5): [True: 536, False: 941]
  ------------------
  435|    536|      if (memeq("transfer-encodin", name, 16)) {
  ------------------
  |  Branch (435:11): [True: 0, False: 536]
  ------------------
  436|      0|        return NGHTTP2_TOKEN_TRANSFER_ENCODING;
  437|      0|      }
  438|    536|      break;
  439|  1.47k|    }
  440|  1.03k|    break;
  441|  1.08k|  case 18:
  ------------------
  |  Branch (441:3): [True: 1.08k, False: 147k]
  ------------------
  442|  1.08k|    switch (name[17]) {
  ------------------
  |  Branch (442:13): [True: 124, False: 958]
  ------------------
  443|    124|    case 'e':
  ------------------
  |  Branch (443:5): [True: 124, False: 958]
  ------------------
  444|    124|      if (memeq("proxy-authenticat", name, 17)) {
  ------------------
  |  Branch (444:11): [True: 23, False: 101]
  ------------------
  445|     23|        return NGHTTP2_TOKEN_PROXY_AUTHENTICATE;
  446|     23|      }
  447|    101|      break;
  448|  1.08k|    }
  449|  1.05k|    break;
  450|  1.05k|  case 19:
  ------------------
  |  Branch (450:3): [True: 564, False: 148k]
  ------------------
  451|    564|    switch (name[18]) {
  ------------------
  |  Branch (451:13): [True: 195, False: 369]
  ------------------
  452|     76|    case 'e':
  ------------------
  |  Branch (452:5): [True: 76, False: 488]
  ------------------
  453|     76|      if (memeq("if-unmodified-sinc", name, 18)) {
  ------------------
  |  Branch (453:11): [True: 11, False: 65]
  ------------------
  454|     11|        return NGHTTP2_TOKEN_IF_UNMODIFIED_SINCE;
  455|     11|      }
  456|     65|      break;
  457|    119|    case 'n':
  ------------------
  |  Branch (457:5): [True: 119, False: 445]
  ------------------
  458|    119|      if (memeq("content-dispositio", name, 18)) {
  ------------------
  |  Branch (458:11): [True: 10, False: 109]
  ------------------
  459|     10|        return NGHTTP2_TOKEN_CONTENT_DISPOSITION;
  460|     10|      }
  461|    109|      if (memeq("proxy-authorizatio", name, 18)) {
  ------------------
  |  Branch (461:11): [True: 21, False: 88]
  ------------------
  462|     21|        return NGHTTP2_TOKEN_PROXY_AUTHORIZATION;
  463|     21|      }
  464|     88|      break;
  465|    564|    }
  466|    522|    break;
  467|    522|  case 25:
  ------------------
  |  Branch (467:3): [True: 129, False: 148k]
  ------------------
  468|    129|    switch (name[24]) {
  ------------------
  |  Branch (468:13): [True: 62, False: 67]
  ------------------
  469|     62|    case 'y':
  ------------------
  |  Branch (469:5): [True: 62, False: 67]
  ------------------
  470|     62|      if (memeq("strict-transport-securit", name, 24)) {
  ------------------
  |  Branch (470:11): [True: 15, False: 47]
  ------------------
  471|     15|        return NGHTTP2_TOKEN_STRICT_TRANSPORT_SECURITY;
  472|     15|      }
  473|     47|      break;
  474|    129|    }
  475|    114|    break;
  476|    171|  case 27:
  ------------------
  |  Branch (476:3): [True: 171, False: 148k]
  ------------------
  477|    171|    switch (name[26]) {
  ------------------
  |  Branch (477:13): [True: 70, False: 101]
  ------------------
  478|     70|    case 'n':
  ------------------
  |  Branch (478:5): [True: 70, False: 101]
  ------------------
  479|     70|      if (memeq("access-control-allow-origi", name, 26)) {
  ------------------
  |  Branch (479:11): [True: 21, False: 49]
  ------------------
  480|     21|        return NGHTTP2_TOKEN_ACCESS_CONTROL_ALLOW_ORIGIN;
  481|     21|      }
  482|     49|      break;
  483|    171|    }
  484|    150|    break;
  485|   148k|  }
  486|   108k|  return -1;
  487|   148k|}
nghttp2_hd.c:memeq:
  114|   232k|static int memeq(const void *s1, const void *s2, size_t n) {
  115|   232k|  return memcmp(s1, s2, n) == 0;
  116|   232k|}
nghttp2_hd.c:name_hash:
  518|   101k|static uint32_t name_hash(const nghttp2_nv *nv) {
  519|       |  /* 32 bit FNV-1a: http://isthe.com/chongo/tech/comp/fnv/ */
  520|   101k|  uint32_t h = 2166136261u;
  521|   101k|  size_t i;
  522|       |
  523|  1.11M|  for (i = 0; i < nv->namelen; ++i) {
  ------------------
  |  Branch (523:15): [True: 1.00M, False: 101k]
  ------------------
  524|  1.00M|    h ^= nv->name[i];
  525|  1.00M|    h += (h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24);
  526|  1.00M|  }
  527|       |
  528|   101k|  return h;
  529|   101k|}
nghttp2_hd.c:hd_deflate_decide_indexing:
 1341|   138k|                                      const nghttp2_nv *nv, int32_t token) {
 1342|   138k|  if (token == NGHTTP2_TOKEN__PATH || token == NGHTTP2_TOKEN_AGE ||
  ------------------
  |  Branch (1342:7): [True: 4.39k, False: 134k]
  |  Branch (1342:39): [True: 728, False: 133k]
  ------------------
 1343|   133k|      token == NGHTTP2_TOKEN_CONTENT_LENGTH || token == NGHTTP2_TOKEN_ETAG ||
  ------------------
  |  Branch (1343:7): [True: 443, False: 133k]
  |  Branch (1343:48): [True: 85, False: 133k]
  ------------------
 1344|   133k|      token == NGHTTP2_TOKEN_IF_MODIFIED_SINCE ||
  ------------------
  |  Branch (1344:7): [True: 443, False: 132k]
  ------------------
 1345|   132k|      token == NGHTTP2_TOKEN_IF_NONE_MATCH || token == NGHTTP2_TOKEN_LOCATION ||
  ------------------
  |  Branch (1345:7): [True: 22, False: 132k]
  |  Branch (1345:47): [True: 33, False: 132k]
  ------------------
 1346|   132k|      token == NGHTTP2_TOKEN_SET_COOKIE ||
  ------------------
  |  Branch (1346:7): [True: 636, False: 132k]
  ------------------
 1347|   132k|      entry_room(nv->namelen, nv->valuelen) >
  ------------------
  |  Branch (1347:7): [True: 42, False: 131k]
  ------------------
 1348|   132k|        deflater->ctx.hd_table_bufsize_max * 3 / 4) {
 1349|  6.82k|    return NGHTTP2_HD_WITHOUT_INDEXING;
 1350|  6.82k|  }
 1351|       |
 1352|   131k|  return NGHTTP2_HD_WITH_INDEXING;
 1353|   138k|}
nghttp2_hd.c:search_hd_table:
 1212|   141k|                                     uint32_t hash) {
 1213|   141k|  search_result res = {-1, 0};
 1214|   141k|  const nghttp2_hd_entry *ent;
 1215|   141k|  int exact_match;
 1216|   141k|  int name_only = indexing_mode == NGHTTP2_HD_NEVER_INDEXING;
 1217|       |
 1218|   141k|  exact_match = 0;
 1219|   141k|  ent = hd_map_find(map, &exact_match, nv, token, hash, name_only);
 1220|       |
 1221|   141k|  if (!exact_match && token >= 0 && token <= NGHTTP2_TOKEN_WWW_AUTHENTICATE) {
  ------------------
  |  Branch (1221:7): [True: 76.9k, False: 65.0k]
  |  Branch (1221:23): [True: 38.8k, False: 38.1k]
  |  Branch (1221:37): [True: 38.7k, False: 38]
  ------------------
 1222|  38.7k|    return search_static_table(nv, token, name_only);
 1223|  38.7k|  }
 1224|       |
 1225|   103k|  if (ent == NULL) {
  ------------------
  |  Branch (1225:7): [True: 31.7k, False: 71.4k]
  ------------------
 1226|  31.7k|    return res;
 1227|  31.7k|  }
 1228|       |
 1229|  71.4k|  res.index = (nghttp2_ssize)(context->next_seq - 1 - ent->seq +
 1230|  71.4k|                              NGHTTP2_STATIC_TABLE_LENGTH);
  ------------------
  |  |   53|  71.4k|#define NGHTTP2_STATIC_TABLE_LENGTH 61
  ------------------
 1231|  71.4k|  res.name_value_match = exact_match;
 1232|       |
 1233|  71.4k|  return res;
 1234|   103k|}
nghttp2_hd.c:hd_map_find:
  552|   141k|                                     uint32_t hash, int name_only) {
  553|   141k|  nghttp2_hd_entry *p;
  554|   141k|  nghttp2_hd_entry *res = NULL;
  555|       |
  556|   141k|  *exact_match = 0;
  557|       |
  558|   201k|  for (p = map->table[hash & (HD_MAP_SIZE - 1)]; p; p = p->next) {
  ------------------
  |  |  214|   141k|#define HD_MAP_SIZE 128
  ------------------
  |  Branch (558:50): [True: 124k, False: 76.8k]
  ------------------
  559|   124k|    if (token != p->nv.token ||
  ------------------
  |  Branch (559:9): [True: 9.27k, False: 115k]
  ------------------
  560|   115k|        (token == -1 && (hash != p->hash || !name_eq(&p->nv, nv)))) {
  ------------------
  |  Branch (560:10): [True: 108k, False: 6.29k]
  |  Branch (560:26): [True: 22.9k, False: 85.8k]
  |  Branch (560:45): [True: 100, False: 85.7k]
  ------------------
  561|  32.3k|      continue;
  562|  32.3k|    }
  563|  92.0k|    if (!res) {
  ------------------
  |  Branch (563:9): [True: 72.8k, False: 19.1k]
  ------------------
  564|  72.8k|      res = p;
  565|  72.8k|      if (name_only) {
  ------------------
  |  Branch (565:11): [True: 86, False: 72.7k]
  ------------------
  566|     86|        break;
  567|     86|      }
  568|  72.8k|    }
  569|  91.9k|    if (value_eq(&p->nv, nv)) {
  ------------------
  |  Branch (569:9): [True: 65.0k, False: 26.9k]
  ------------------
  570|  65.0k|      res = p;
  571|  65.0k|      *exact_match = 1;
  572|  65.0k|      break;
  573|  65.0k|    }
  574|  91.9k|  }
  575|       |
  576|   141k|  return res;
  577|   141k|}
nghttp2_hd.c:name_eq:
  508|  85.8k|static int name_eq(const nghttp2_hd_nv *a, const nghttp2_nv *b) {
  509|  85.8k|  return a->name->len == b->namelen &&
  ------------------
  |  Branch (509:10): [True: 85.7k, False: 100]
  ------------------
  510|  85.7k|         memeq(a->name->base, b->name, b->namelen);
  ------------------
  |  Branch (510:10): [True: 85.7k, False: 0]
  ------------------
  511|  85.8k|}
nghttp2_hd.c:value_eq:
  513|  91.9k|static int value_eq(const nghttp2_hd_nv *a, const nghttp2_nv *b) {
  514|  91.9k|  return a->value->len == b->valuelen &&
  ------------------
  |  Branch (514:10): [True: 70.1k, False: 21.8k]
  ------------------
  515|  70.1k|         memeq(a->value->base, b->value, b->valuelen);
  ------------------
  |  Branch (515:10): [True: 65.0k, False: 5.11k]
  ------------------
  516|  91.9k|}
nghttp2_hd.c:search_static_table:
 1186|  38.7k|                                         int name_only) {
 1187|  38.7k|  search_result res = {token, 0};
 1188|  38.7k|  int i;
 1189|  38.7k|  const nghttp2_hd_static_entry *ent;
 1190|       |
 1191|  38.7k|  if (name_only) {
  ------------------
  |  Branch (1191:7): [True: 3.18k, False: 35.6k]
  ------------------
 1192|  3.18k|    return res;
 1193|  3.18k|  }
 1194|       |
 1195|  35.6k|  for (i = token;
 1196|  56.0k|       i <= NGHTTP2_TOKEN_WWW_AUTHENTICATE && static_table[i].token == token;
  ------------------
  |  Branch (1196:8): [True: 56.0k, False: 21]
  |  Branch (1196:47): [True: 38.9k, False: 17.1k]
  ------------------
 1197|  38.9k|       ++i) {
 1198|  38.9k|    ent = &static_table[i];
 1199|  38.9k|    if (ent->value.len == nv->valuelen &&
  ------------------
  |  Branch (1199:9): [True: 18.7k, False: 20.1k]
  ------------------
 1200|  18.7k|        memcmp(ent->value.base, nv->value, nv->valuelen) == 0) {
  ------------------
  |  Branch (1200:9): [True: 18.4k, False: 330]
  ------------------
 1201|  18.4k|      res.index = i;
 1202|  18.4k|      res.name_value_match = 1;
 1203|  18.4k|      return res;
 1204|  18.4k|    }
 1205|  38.9k|  }
 1206|  17.1k|  return res;
 1207|  35.6k|}
nghttp2_hd.c:emit_indexed_block:
  959|  83.4k|static int emit_indexed_block(nghttp2_bufs *bufs, size_t idx) {
  960|  83.4k|  int rv;
  961|  83.4k|  size_t blocklen;
  962|  83.4k|  uint8_t sb[16];
  963|  83.4k|  uint8_t *bufp;
  964|       |
  965|  83.4k|  blocklen = count_encoded_length(idx + 1, 7);
  966|       |
  967|  83.4k|  DEBUGF("deflatehd: emit indexed index=%zu, %zu bytes\n", idx, blocklen);
  ------------------
  |  |   39|  83.4k|    do {                                                                       \
  |  |   40|  83.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 83.4k]
  |  |  ------------------
  ------------------
  968|       |
  969|  83.4k|  if (sizeof(sb) < blocklen) {
  ------------------
  |  Branch (969:7): [True: 0, False: 83.4k]
  ------------------
  970|      0|    return NGHTTP2_ERR_HEADER_COMP;
  971|      0|  }
  972|       |
  973|  83.4k|  bufp = sb;
  974|  83.4k|  *bufp = 0x80u;
  975|  83.4k|  encode_length(bufp, idx + 1, 7);
  976|       |
  977|  83.4k|  rv = nghttp2_bufs_add(bufs, sb, blocklen);
  978|  83.4k|  if (rv != 0) {
  ------------------
  |  Branch (978:7): [True: 0, False: 83.4k]
  ------------------
  979|      0|    return rv;
  980|      0|  }
  981|       |
  982|  83.4k|  return 0;
  983|  83.4k|}
nghttp2_hd.c:add_hd_table_incremental:
 1116|  52.3k|                                    uint32_t hash) {
 1117|  52.3k|  int rv;
 1118|  52.3k|  nghttp2_hd_entry *new_ent;
 1119|  52.3k|  size_t room;
 1120|  52.3k|  nghttp2_mem *mem;
 1121|       |
 1122|  52.3k|  mem = context->mem;
 1123|  52.3k|  room = entry_room(nv->name->len, nv->value->len);
 1124|       |
 1125|  75.4k|  while (context->hd_table_bufsize + room > context->hd_table_bufsize_max &&
  ------------------
  |  Branch (1125:10): [True: 23.3k, False: 52.1k]
  ------------------
 1126|  23.3k|         context->hd_table.len > 0) {
  ------------------
  |  Branch (1126:10): [True: 23.1k, False: 163]
  ------------------
 1127|  23.1k|    size_t idx = context->hd_table.len - 1;
 1128|  23.1k|    nghttp2_hd_entry *ent = hd_ringbuf_get(&context->hd_table, idx);
 1129|       |
 1130|  23.1k|    context->hd_table_bufsize -=
 1131|  23.1k|      entry_room(ent->nv.name->len, ent->nv.value->len);
 1132|       |
 1133|  23.1k|    DEBUGF("hpack: remove item from header table: %s: %s\n",
  ------------------
  |  |   39|  23.1k|    do {                                                                       \
  |  |   40|  23.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 23.1k]
  |  |  ------------------
  ------------------
 1134|  23.1k|           (char *)ent->nv.name->base, (char *)ent->nv.value->base);
 1135|       |
 1136|  23.1k|    hd_ringbuf_pop_back(&context->hd_table);
 1137|  23.1k|    if (map) {
  ------------------
  |  Branch (1137:9): [True: 23.0k, False: 91]
  ------------------
 1138|  23.0k|      hd_map_remove(map, ent);
 1139|  23.0k|    }
 1140|       |
 1141|  23.1k|    nghttp2_hd_entry_free(ent);
 1142|  23.1k|    nghttp2_mem_free(mem, ent);
 1143|  23.1k|  }
 1144|       |
 1145|  52.3k|  if (room > context->hd_table_bufsize_max) {
  ------------------
  |  Branch (1145:7): [True: 163, False: 52.1k]
  ------------------
 1146|       |    /* The entry taking more than NGHTTP2_HD_MAX_BUFFER_SIZE is
 1147|       |       immediately evicted.  So we don't allocate memory for it. */
 1148|    163|    return 0;
 1149|    163|  }
 1150|       |
 1151|  52.1k|  new_ent = nghttp2_mem_malloc(mem, sizeof(nghttp2_hd_entry));
 1152|  52.1k|  if (new_ent == NULL) {
  ------------------
  |  Branch (1152:7): [True: 0, False: 52.1k]
  ------------------
 1153|      0|    return NGHTTP2_ERR_NOMEM;
 1154|      0|  }
 1155|       |
 1156|  52.1k|  nghttp2_hd_entry_init(new_ent, nv);
 1157|       |
 1158|  52.1k|  rv = hd_ringbuf_push_front(&context->hd_table, new_ent, mem);
 1159|       |
 1160|  52.1k|  if (rv != 0) {
  ------------------
  |  Branch (1160:7): [True: 0, False: 52.1k]
  ------------------
 1161|      0|    nghttp2_hd_entry_free(new_ent);
 1162|      0|    nghttp2_mem_free(mem, new_ent);
 1163|       |
 1164|      0|    return rv;
 1165|      0|  }
 1166|       |
 1167|  52.1k|  new_ent->seq = context->next_seq++;
 1168|  52.1k|  new_ent->hash = hash;
 1169|       |
 1170|  52.1k|  if (map) {
  ------------------
  |  Branch (1170:7): [True: 50.1k, False: 2.00k]
  ------------------
 1171|  50.1k|    hd_map_insert(map, new_ent);
 1172|  50.1k|  }
 1173|       |
 1174|  52.1k|  context->hd_table_bufsize += room;
 1175|       |
 1176|  52.1k|  return 0;
 1177|  52.1k|}
nghttp2_hd.c:hd_ringbuf_push_front:
  667|  52.1k|                                 nghttp2_hd_entry *ent, nghttp2_mem *mem) {
  668|  52.1k|  int rv;
  669|       |
  670|  52.1k|  rv = hd_ringbuf_reserve(ringbuf, ringbuf->len + 1, mem);
  671|       |
  672|  52.1k|  if (rv != 0) {
  ------------------
  |  Branch (672:7): [True: 0, False: 52.1k]
  ------------------
  673|      0|    return rv;
  674|      0|  }
  675|       |
  676|  52.1k|  ringbuf->buffer[--ringbuf->first & ringbuf->mask] = ent;
  677|  52.1k|  ++ringbuf->len;
  678|       |
  679|  52.1k|  return 0;
  680|  52.1k|}
nghttp2_hd.c:hd_ringbuf_reserve:
  628|  52.1k|                              nghttp2_mem *mem) {
  629|  52.1k|  size_t i;
  630|  52.1k|  size_t size;
  631|  52.1k|  nghttp2_hd_entry **buffer;
  632|       |
  633|  52.1k|  if (ringbuf->mask + 1 >= bufsize) {
  ------------------
  |  Branch (633:7): [True: 52.1k, False: 0]
  ------------------
  634|  52.1k|    return 0;
  635|  52.1k|  }
  636|      0|  for (size = 1; size < bufsize; size <<= 1)
  ------------------
  |  Branch (636:18): [True: 0, False: 0]
  ------------------
  637|      0|    ;
  638|      0|  buffer = nghttp2_mem_malloc(mem, sizeof(nghttp2_hd_entry *) * size);
  639|      0|  if (buffer == NULL) {
  ------------------
  |  Branch (639:7): [True: 0, False: 0]
  ------------------
  640|      0|    return NGHTTP2_ERR_NOMEM;
  641|      0|  }
  642|      0|  for (i = 0; i < ringbuf->len; ++i) {
  ------------------
  |  Branch (642:15): [True: 0, False: 0]
  ------------------
  643|      0|    buffer[i] = hd_ringbuf_get(ringbuf, i);
  644|      0|  }
  645|      0|  nghttp2_mem_free(mem, ringbuf->buffer);
  646|      0|  ringbuf->buffer = buffer;
  647|      0|  ringbuf->mask = size - 1;
  648|      0|  ringbuf->first = 0;
  649|      0|  return 0;
  650|      0|}
nghttp2_hd.c:hd_map_insert:
  535|  50.1k|static void hd_map_insert(nghttp2_hd_map *map, nghttp2_hd_entry *ent) {
  536|  50.1k|  nghttp2_hd_entry **bucket;
  537|       |
  538|  50.1k|  bucket = &map->table[ent->hash & (HD_MAP_SIZE - 1)];
  ------------------
  |  |  214|  50.1k|#define HD_MAP_SIZE 128
  ------------------
  539|       |
  540|  50.1k|  if (*bucket == NULL) {
  ------------------
  |  Branch (540:7): [True: 36.2k, False: 13.9k]
  ------------------
  541|  36.2k|    *bucket = ent;
  542|  36.2k|    return;
  543|  36.2k|  }
  544|       |
  545|       |  /* lower index is linked near the root */
  546|  13.9k|  ent->next = *bucket;
  547|  13.9k|  *bucket = ent;
  548|  13.9k|}
nghttp2_hd.c:hd_inflate_read_len:
 1671|  64.4k|                                         size_t maxlen) {
 1672|  64.4k|  nghttp2_ssize rv;
 1673|  64.4k|  uint32_t out;
 1674|       |
 1675|  64.4k|  *rfin = 0;
 1676|       |
 1677|  64.4k|  rv = decode_length(&out, &inflater->shift, rfin, (uint32_t)inflater->left,
 1678|  64.4k|                     inflater->shift, in, last, prefix);
 1679|       |
 1680|  64.4k|  if (rv == -1) {
  ------------------
  |  Branch (1680:7): [True: 77, False: 64.3k]
  ------------------
 1681|     77|    DEBUGF("inflatehd: integer decoding failed\n");
  ------------------
  |  |   39|     77|    do {                                                                       \
  |  |   40|     77|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 77]
  |  |  ------------------
  ------------------
 1682|     77|    return NGHTTP2_ERR_HEADER_COMP;
 1683|     77|  }
 1684|       |
 1685|  64.3k|  if (out > maxlen) {
  ------------------
  |  Branch (1685:7): [True: 435, False: 63.9k]
  ------------------
 1686|    435|    DEBUGF("inflatehd: integer exceeded the maximum value %zu\n", maxlen);
  ------------------
  |  |   39|    435|    do {                                                                       \
  |  |   40|    435|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 435]
  |  |  ------------------
  ------------------
 1687|    435|    return NGHTTP2_ERR_HEADER_COMP;
 1688|    435|  }
 1689|       |
 1690|  63.9k|  inflater->left = out;
 1691|       |
 1692|  63.9k|  DEBUGF("inflatehd: decoded integer is %u\n", out);
  ------------------
  |  |   39|  63.9k|    do {                                                                       \
  |  |   40|  63.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 63.9k]
  |  |  ------------------
  ------------------
 1693|       |
 1694|  63.9k|  return rv;
 1695|  64.3k|}
nghttp2_hd.c:get_max_index:
 1310|  44.5k|static size_t get_max_index(nghttp2_hd_context *context) {
 1311|  44.5k|  return context->hd_table.len + NGHTTP2_STATIC_TABLE_LENGTH;
  ------------------
  |  |   53|  44.5k|#define NGHTTP2_STATIC_TABLE_LENGTH 61
  ------------------
 1312|  44.5k|}
nghttp2_hd.c:hd_inflate_commit_indexed:
 1763|  40.6k|                                      nghttp2_hd_nv *nv_out) {
 1764|  40.6k|  nghttp2_hd_nv nv = nghttp2_hd_table_get(&inflater->ctx, inflater->index);
 1765|       |
 1766|  40.6k|  emit_header(nv_out, &nv);
 1767|  40.6k|}
nghttp2_hd.c:emit_header:
  799|  50.5k|static void emit_header(nghttp2_hd_nv *nv_out, nghttp2_hd_nv *nv) {
  800|  50.5k|  DEBUGF("inflatehd: header emission: %s: %s\n", nv->name->base,
  ------------------
  |  |   39|  50.5k|    do {                                                                       \
  |  |   40|  50.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 50.5k]
  |  |  ------------------
  ------------------
  801|  50.5k|         nv->value->base);
  802|       |  /* ent->ref may be 0. This happens if the encoder emits literal
  803|       |     block larger than header table capacity with indexing. */
  804|  50.5k|  *nv_out = *nv;
  805|  50.5k|}
nghttp2_hd.c:hd_inflate_set_huffman_encoded:
 1651|  17.7k|                                           const uint8_t *in) {
 1652|  17.7k|  inflater->huffman_encoded = (*in & (1 << 7)) != 0;
 1653|  17.7k|}
nghttp2_hd.c:hd_inflate_read_huff:
 1712|    791|                                          const uint8_t *last) {
 1713|    791|  nghttp2_ssize readlen;
 1714|    791|  int fin = 0;
 1715|    791|  if ((size_t)(last - in) >= inflater->left) {
  ------------------
  |  Branch (1715:7): [True: 452, False: 339]
  ------------------
 1716|    452|    last = in + inflater->left;
 1717|    452|    fin = 1;
 1718|    452|  }
 1719|    791|  readlen = nghttp2_hd_huff_decode(&inflater->huff_decode_ctx, buf, in,
 1720|    791|                                   (size_t)(last - in), fin);
 1721|       |
 1722|    791|  if (readlen < 0) {
  ------------------
  |  Branch (1722:7): [True: 139, False: 652]
  ------------------
 1723|    139|    DEBUGF("inflatehd: huffman decoding failed\n");
  ------------------
  |  |   39|    139|    do {                                                                       \
  |  |   40|    139|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 139]
  |  |  ------------------
  ------------------
 1724|    139|    return readlen;
 1725|    139|  }
 1726|    652|  if (nghttp2_hd_huff_decode_failure_state(&inflater->huff_decode_ctx)) {
  ------------------
  |  Branch (1726:7): [True: 27, False: 625]
  ------------------
 1727|     27|    DEBUGF("inflatehd: huffman decoding failed\n");
  ------------------
  |  |   39|     27|    do {                                                                       \
  |  |   40|     27|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 27]
  |  |  ------------------
  ------------------
 1728|     27|    return NGHTTP2_ERR_HEADER_COMP;
 1729|     27|  }
 1730|       |
 1731|    625|  inflater->left -= (size_t)readlen;
 1732|    625|  return readlen;
 1733|    652|}
nghttp2_hd.c:hd_inflate_read:
 1749|  16.8k|                                     const uint8_t *last) {
 1750|  16.8k|  size_t len = nghttp2_min_size((size_t)(last - in), inflater->left);
 1751|       |
 1752|  16.8k|  buf->last = nghttp2_cpymem(buf->last, in, len);
 1753|       |
 1754|  16.8k|  inflater->left -= len;
 1755|  16.8k|  return (nghttp2_ssize)len;
 1756|  16.8k|}
nghttp2_hd.c:hd_inflate_commit_newname:
 1781|  6.81k|                                     nghttp2_hd_nv *nv_out) {
 1782|  6.81k|  nghttp2_hd_nv nv;
 1783|  6.81k|  int rv;
 1784|       |
 1785|  6.81k|  if (inflater->no_index) {
  ------------------
  |  Branch (1785:7): [True: 174, False: 6.63k]
  ------------------
 1786|    174|    nv.flags = NGHTTP2_NV_FLAG_NO_INDEX;
 1787|  6.63k|  } else {
 1788|  6.63k|    nv.flags = NGHTTP2_NV_FLAG_NONE;
 1789|  6.63k|  }
 1790|       |
 1791|  6.81k|  nv.name = inflater->namercbuf;
 1792|  6.81k|  nv.value = inflater->valuercbuf;
 1793|  6.81k|  nv.token = lookup_token(inflater->namercbuf->base, inflater->namercbuf->len);
 1794|       |
 1795|  6.81k|  if (inflater->index_required) {
  ------------------
  |  Branch (1795:7): [True: 174, False: 6.63k]
  ------------------
 1796|    174|    rv = add_hd_table_incremental(&inflater->ctx, &nv, NULL, 0);
 1797|       |
 1798|    174|    if (rv != 0) {
  ------------------
  |  Branch (1798:9): [True: 0, False: 174]
  ------------------
 1799|      0|      return rv;
 1800|      0|    }
 1801|    174|  }
 1802|       |
 1803|  6.81k|  emit_header(nv_out, &nv);
 1804|       |
 1805|  6.81k|  inflater->nv_name_keep = nv.name;
 1806|  6.81k|  inflater->nv_value_keep = nv.value;
 1807|       |
 1808|  6.81k|  inflater->namercbuf = NULL;
 1809|  6.81k|  inflater->valuercbuf = NULL;
 1810|       |
 1811|  6.81k|  return 0;
 1812|  6.81k|}
nghttp2_hd.c:hd_inflate_commit_indname:
 1826|  3.02k|                                     nghttp2_hd_nv *nv_out) {
 1827|  3.02k|  nghttp2_hd_nv nv;
 1828|  3.02k|  int rv;
 1829|       |
 1830|  3.02k|  nv = nghttp2_hd_table_get(&inflater->ctx, inflater->index);
 1831|       |
 1832|  3.02k|  if (inflater->no_index) {
  ------------------
  |  Branch (1832:7): [True: 220, False: 2.80k]
  ------------------
 1833|    220|    nv.flags = NGHTTP2_NV_FLAG_NO_INDEX;
 1834|  2.80k|  } else {
 1835|  2.80k|    nv.flags = NGHTTP2_NV_FLAG_NONE;
 1836|  2.80k|  }
 1837|       |
 1838|  3.02k|  nghttp2_rcbuf_incref(nv.name);
 1839|       |
 1840|  3.02k|  nv.value = inflater->valuercbuf;
 1841|       |
 1842|  3.02k|  if (inflater->index_required) {
  ------------------
  |  Branch (1842:7): [True: 1.99k, False: 1.03k]
  ------------------
 1843|  1.99k|    rv = add_hd_table_incremental(&inflater->ctx, &nv, NULL, 0);
 1844|  1.99k|    if (rv != 0) {
  ------------------
  |  Branch (1844:9): [True: 0, False: 1.99k]
  ------------------
 1845|      0|      nghttp2_rcbuf_decref(nv.name);
 1846|      0|      return NGHTTP2_ERR_NOMEM;
 1847|      0|    }
 1848|  1.99k|  }
 1849|       |
 1850|  3.02k|  emit_header(nv_out, &nv);
 1851|       |
 1852|  3.02k|  inflater->nv_name_keep = nv.name;
 1853|  3.02k|  inflater->nv_value_keep = nv.value;
 1854|       |
 1855|  3.02k|  inflater->valuercbuf = NULL;
 1856|       |
 1857|  3.02k|  return 0;
 1858|  3.02k|}
nghttp2_hd.c:emit_indname_block:
 1047|  26.7k|                              const nghttp2_nv *nv, int indexing_mode) {
 1048|  26.7k|  int rv;
 1049|  26.7k|  uint8_t *bufp;
 1050|  26.7k|  size_t blocklen;
 1051|  26.7k|  uint8_t sb[16];
 1052|  26.7k|  size_t prefixlen;
 1053|       |
 1054|  26.7k|  if (indexing_mode == NGHTTP2_HD_WITH_INDEXING) {
  ------------------
  |  Branch (1054:7): [True: 18.4k, False: 8.30k]
  ------------------
 1055|  18.4k|    prefixlen = 6;
 1056|  18.4k|  } else {
 1057|  8.30k|    prefixlen = 4;
 1058|  8.30k|  }
 1059|       |
 1060|  26.7k|  DEBUGF("deflatehd: emit indname index=%zu, valuelen=%zu, indexing_mode=%d\n",
  ------------------
  |  |   39|  26.7k|    do {                                                                       \
  |  |   40|  26.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 26.7k]
  |  |  ------------------
  ------------------
 1061|  26.7k|         idx, nv->valuelen, indexing_mode);
 1062|       |
 1063|  26.7k|  blocklen = count_encoded_length(idx + 1, prefixlen);
 1064|       |
 1065|  26.7k|  if (sizeof(sb) < blocklen) {
  ------------------
  |  Branch (1065:7): [True: 0, False: 26.7k]
  ------------------
 1066|      0|    return NGHTTP2_ERR_HEADER_COMP;
 1067|      0|  }
 1068|       |
 1069|  26.7k|  bufp = sb;
 1070|       |
 1071|  26.7k|  *bufp = pack_first_byte(indexing_mode);
 1072|       |
 1073|  26.7k|  encode_length(bufp, idx + 1, prefixlen);
 1074|       |
 1075|  26.7k|  rv = nghttp2_bufs_add(bufs, sb, blocklen);
 1076|  26.7k|  if (rv != 0) {
  ------------------
  |  Branch (1076:7): [True: 0, False: 26.7k]
  ------------------
 1077|      0|    return rv;
 1078|      0|  }
 1079|       |
 1080|  26.7k|  rv = emit_string(bufs, nv->value, nv->valuelen);
 1081|  26.7k|  if (rv != 0) {
  ------------------
  |  Branch (1081:7): [True: 0, False: 26.7k]
  ------------------
 1082|      0|    return rv;
 1083|      0|  }
 1084|       |
 1085|  26.7k|  return 0;
 1086|  26.7k|}
nghttp2_hd.c:pack_first_byte:
 1030|  58.5k|static uint8_t pack_first_byte(int indexing_mode) {
 1031|  58.5k|  switch (indexing_mode) {
 1032|  50.1k|  case NGHTTP2_HD_WITH_INDEXING:
  ------------------
  |  Branch (1032:3): [True: 50.1k, False: 8.34k]
  ------------------
 1033|  50.1k|    return 0x40u;
 1034|  5.15k|  case NGHTTP2_HD_WITHOUT_INDEXING:
  ------------------
  |  Branch (1034:3): [True: 5.15k, False: 53.3k]
  ------------------
 1035|  5.15k|    return 0;
 1036|  3.18k|  case NGHTTP2_HD_NEVER_INDEXING:
  ------------------
  |  Branch (1036:3): [True: 3.18k, False: 55.3k]
  ------------------
 1037|  3.18k|    return 0x10u;
 1038|      0|  default:
  ------------------
  |  Branch (1038:3): [True: 0, False: 58.5k]
  ------------------
 1039|      0|    assert(0);
  ------------------
  |  Branch (1039:5): [Folded, False: 0]
  |  Branch (1039:5): [Folded, False: 0]
  ------------------
 1040|  58.5k|  }
 1041|       |  /* This is required to compile with android NDK r10d +
 1042|       |     --enable-werror */
 1043|      0|  return 0;
 1044|  58.5k|}
nghttp2_hd.c:emit_string:
  985|  90.2k|static int emit_string(nghttp2_bufs *bufs, const uint8_t *str, size_t len) {
  986|  90.2k|  int rv;
  987|  90.2k|  uint8_t sb[16];
  988|  90.2k|  uint8_t *bufp;
  989|  90.2k|  size_t blocklen;
  990|  90.2k|  size_t enclen;
  991|  90.2k|  int huffman = 0;
  992|       |
  993|  90.2k|  enclen = nghttp2_hd_huff_encode_count(str, len);
  994|       |
  995|  90.2k|  if (enclen < len) {
  ------------------
  |  Branch (995:7): [True: 31.3k, False: 58.8k]
  ------------------
  996|  31.3k|    huffman = 1;
  997|  58.8k|  } else {
  998|  58.8k|    enclen = len;
  999|  58.8k|  }
 1000|       |
 1001|  90.2k|  blocklen = count_encoded_length(enclen, 7);
 1002|       |
 1003|  90.2k|  DEBUGF("deflatehd: emit string str=%.*s, length=%zu, huffman=%d, "
  ------------------
  |  |   39|  90.2k|    do {                                                                       \
  |  |   40|  90.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 90.2k]
  |  |  ------------------
  ------------------
 1004|  90.2k|         "encoded_length=%zu\n",
 1005|  90.2k|         (int)len, (const char *)str, len, huffman, enclen);
 1006|       |
 1007|  90.2k|  if (sizeof(sb) < blocklen) {
  ------------------
  |  Branch (1007:7): [True: 0, False: 90.2k]
  ------------------
 1008|      0|    return NGHTTP2_ERR_HEADER_COMP;
 1009|      0|  }
 1010|       |
 1011|  90.2k|  bufp = sb;
 1012|  90.2k|  *bufp = huffman ? 1 << 7 : 0;
  ------------------
  |  Branch (1012:11): [True: 31.3k, False: 58.8k]
  ------------------
 1013|  90.2k|  encode_length(bufp, enclen, 7);
 1014|       |
 1015|  90.2k|  rv = nghttp2_bufs_add(bufs, sb, blocklen);
 1016|  90.2k|  if (rv != 0) {
  ------------------
  |  Branch (1016:7): [True: 0, False: 90.2k]
  ------------------
 1017|      0|    return rv;
 1018|      0|  }
 1019|       |
 1020|  90.2k|  if (huffman) {
  ------------------
  |  Branch (1020:7): [True: 31.3k, False: 58.8k]
  ------------------
 1021|  31.3k|    rv = nghttp2_hd_huff_encode(bufs, str, len);
 1022|  58.8k|  } else {
 1023|  58.8k|    assert(enclen == len);
  ------------------
  |  Branch (1023:5): [True: 0, False: 58.8k]
  |  Branch (1023:5): [True: 58.8k, False: 0]
  ------------------
 1024|  58.8k|    rv = nghttp2_bufs_add(bufs, str, len);
 1025|  58.8k|  }
 1026|       |
 1027|  90.2k|  return rv;
 1028|  90.2k|}
nghttp2_hd.c:emit_newname_block:
 1089|  31.7k|                              int indexing_mode) {
 1090|  31.7k|  int rv;
 1091|       |
 1092|  31.7k|  DEBUGF(
  ------------------
  |  |   39|  31.7k|    do {                                                                       \
  |  |   40|  31.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 31.7k]
  |  |  ------------------
  ------------------
 1093|  31.7k|    "deflatehd: emit newname namelen=%zu, valuelen=%zu, indexing_mode=%d\n",
 1094|  31.7k|    nv->namelen, nv->valuelen, indexing_mode);
 1095|       |
 1096|  31.7k|  rv = nghttp2_bufs_addb(bufs, pack_first_byte(indexing_mode));
 1097|  31.7k|  if (rv != 0) {
  ------------------
  |  Branch (1097:7): [True: 0, False: 31.7k]
  ------------------
 1098|      0|    return rv;
 1099|      0|  }
 1100|       |
 1101|  31.7k|  rv = emit_string(bufs, nv->name, nv->namelen);
 1102|  31.7k|  if (rv != 0) {
  ------------------
  |  Branch (1102:7): [True: 0, False: 31.7k]
  ------------------
 1103|      0|    return rv;
 1104|      0|  }
 1105|       |
 1106|  31.7k|  rv = emit_string(bufs, nv->value, nv->valuelen);
 1107|  31.7k|  if (rv != 0) {
  ------------------
  |  Branch (1107:7): [True: 0, False: 31.7k]
  ------------------
 1108|      0|    return rv;
 1109|      0|  }
 1110|       |
 1111|  31.7k|  return 0;
 1112|  31.7k|}
nghttp2_hd.c:decode_length:
  869|  64.4k|                                   size_t prefix) {
  870|  64.4k|  uint32_t k = (uint8_t)((1 << prefix) - 1);
  871|  64.4k|  uint32_t n = initial;
  872|  64.4k|  const uint8_t *start = in;
  873|       |
  874|  64.4k|  *shift_ptr = 0;
  875|  64.4k|  *fin = 0;
  876|       |
  877|  64.4k|  if (n == 0) {
  ------------------
  |  Branch (877:7): [True: 64.3k, False: 72]
  ------------------
  878|  64.3k|    if ((*in & k) != k) {
  ------------------
  |  Branch (878:9): [True: 63.1k, False: 1.18k]
  ------------------
  879|  63.1k|      *res = (*in) & k;
  880|  63.1k|      *fin = 1;
  881|  63.1k|      return 1;
  882|  63.1k|    }
  883|       |
  884|  1.18k|    n = k;
  885|       |
  886|  1.18k|    if (++in == last) {
  ------------------
  |  Branch (886:9): [True: 36, False: 1.14k]
  ------------------
  887|     36|      *res = n;
  888|     36|      return (nghttp2_ssize)(in - start);
  889|     36|    }
  890|  1.18k|  }
  891|       |
  892|  2.47k|  for (; in != last; ++in, shift += 7) {
  ------------------
  |  Branch (892:10): [True: 2.38k, False: 92]
  ------------------
  893|  2.38k|    uint32_t add = *in & 0x7f;
  894|       |
  895|  2.38k|    if (shift >= 32) {
  ------------------
  |  Branch (895:9): [True: 14, False: 2.37k]
  ------------------
  896|     14|      DEBUGF("inflate: shift exponent overflow\n");
  ------------------
  |  |   39|     14|    do {                                                                       \
  |  |   40|     14|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 14]
  |  |  ------------------
  ------------------
  897|     14|      return -1;
  898|     14|    }
  899|       |
  900|  2.37k|    if ((UINT32_MAX >> shift) < add) {
  ------------------
  |  Branch (900:9): [True: 58, False: 2.31k]
  ------------------
  901|     58|      DEBUGF("inflate: integer overflow on shift\n");
  ------------------
  |  |   39|     58|    do {                                                                       \
  |  |   40|     58|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 58]
  |  |  ------------------
  ------------------
  902|     58|      return -1;
  903|     58|    }
  904|       |
  905|  2.31k|    add <<= shift;
  906|       |
  907|  2.31k|    if (UINT32_MAX - add < n) {
  ------------------
  |  Branch (907:9): [True: 5, False: 2.31k]
  ------------------
  908|      5|      DEBUGF("inflate: integer overflow on addition\n");
  ------------------
  |  |   39|      5|    do {                                                                       \
  |  |   40|      5|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 5]
  |  |  ------------------
  ------------------
  909|      5|      return -1;
  910|      5|    }
  911|       |
  912|  2.31k|    n += add;
  913|       |
  914|  2.31k|    if ((*in & (1 << 7)) == 0) {
  ------------------
  |  Branch (914:9): [True: 1.05k, False: 1.26k]
  ------------------
  915|  1.05k|      break;
  916|  1.05k|    }
  917|  2.31k|  }
  918|       |
  919|  1.14k|  *shift_ptr = shift;
  920|       |
  921|  1.14k|  if (in == last) {
  ------------------
  |  Branch (921:7): [True: 92, False: 1.05k]
  ------------------
  922|     92|    *res = n;
  923|     92|    return (nghttp2_ssize)(in - start);
  924|     92|  }
  925|       |
  926|  1.05k|  *res = n;
  927|  1.05k|  *fin = 1;
  928|  1.05k|  return (nghttp2_ssize)(in + 1 - start);
  929|  1.14k|}

nghttp2_hd_huff_encode_count:
   34|  90.2k|size_t nghttp2_hd_huff_encode_count(const uint8_t *src, size_t len) {
   35|  90.2k|  size_t i;
   36|  90.2k|  size_t nbits = 0;
   37|       |
   38|  2.75M|  for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (38:15): [True: 2.66M, False: 90.2k]
  ------------------
   39|  2.66M|    nbits += huff_sym_table[src[i]].nbits;
   40|  2.66M|  }
   41|       |  /* pad the prefix of EOS (256) */
   42|  90.2k|  return (nbits + 7) / 8;
   43|  90.2k|}
nghttp2_hd_huff_encode:
   46|  31.3k|                           size_t srclen) {
   47|  31.3k|  const nghttp2_huff_sym *sym;
   48|  31.3k|  const uint8_t *end = src + srclen;
   49|  31.3k|  uint64_t code = 0;
   50|  31.3k|  uint32_t x;
   51|  31.3k|  size_t nbits = 0;
   52|  31.3k|  size_t avail;
   53|  31.3k|  int rv;
   54|       |
   55|  31.3k|  avail = nghttp2_bufs_cur_avail(bufs);
  ------------------
  |  |  405|  31.3k|#define nghttp2_bufs_cur_avail(BUFS) nghttp2_buf_avail(&(BUFS)->cur->buf)
  |  |  ------------------
  |  |  |  |   55|  31.3k|#define nghttp2_buf_avail(BUF) ((size_t)((BUF)->end - (BUF)->last))
  |  |  ------------------
  ------------------
   56|       |
   57|   749k|  for (; src != end;) {
  ------------------
  |  Branch (57:10): [True: 718k, False: 31.3k]
  ------------------
   58|   718k|    sym = &huff_sym_table[*src++];
   59|   718k|    code |= (uint64_t)sym->code << (32 - nbits);
   60|   718k|    nbits += sym->nbits;
   61|   718k|    if (nbits < 32) {
  ------------------
  |  Branch (61:9): [True: 587k, False: 130k]
  ------------------
   62|   587k|      continue;
   63|   587k|    }
   64|   130k|    if (avail >= 4) {
  ------------------
  |  Branch (64:9): [True: 130k, False: 14]
  ------------------
   65|   130k|      x = htonl((uint32_t)(code >> 32));
   66|   130k|      memcpy(bufs->cur->buf.last, &x, 4);
   67|   130k|      bufs->cur->buf.last += 4;
   68|   130k|      avail -= 4;
   69|   130k|      code <<= 32;
   70|   130k|      nbits -= 32;
   71|   130k|      continue;
   72|   130k|    }
   73|       |
   74|     76|    for (; nbits >= 8;) {
  ------------------
  |  Branch (74:12): [True: 62, False: 14]
  ------------------
   75|     62|      rv = nghttp2_bufs_addb(bufs, (uint8_t)(code >> 56));
   76|     62|      if (rv != 0) {
  ------------------
  |  Branch (76:11): [True: 0, False: 62]
  ------------------
   77|      0|        return rv;
   78|      0|      }
   79|     62|      code <<= 8;
   80|     62|      nbits -= 8;
   81|     62|    }
   82|       |
   83|     14|    avail = nghttp2_bufs_cur_avail(bufs);
  ------------------
  |  |  405|     14|#define nghttp2_bufs_cur_avail(BUFS) nghttp2_buf_avail(&(BUFS)->cur->buf)
  |  |  ------------------
  |  |  |  |   55|     14|#define nghttp2_buf_avail(BUF) ((size_t)((BUF)->end - (BUF)->last))
  |  |  ------------------
  ------------------
   84|     14|  }
   85|       |
   86|  81.7k|  for (; nbits >= 8;) {
  ------------------
  |  Branch (86:10): [True: 50.4k, False: 31.3k]
  ------------------
   87|  50.4k|    rv = nghttp2_bufs_addb(bufs, (uint8_t)(code >> 56));
   88|  50.4k|    if (rv != 0) {
  ------------------
  |  Branch (88:9): [True: 0, False: 50.4k]
  ------------------
   89|      0|      return rv;
   90|      0|    }
   91|  50.4k|    code <<= 8;
   92|  50.4k|    nbits -= 8;
   93|  50.4k|  }
   94|       |
   95|  31.3k|  if (nbits) {
  ------------------
  |  Branch (95:7): [True: 27.1k, False: 4.16k]
  ------------------
   96|  27.1k|    rv = nghttp2_bufs_addb(
   97|  27.1k|      bufs, (uint8_t)((uint8_t)(code >> 56) | ((1 << (8 - nbits)) - 1)));
   98|  27.1k|    if (rv != 0) {
  ------------------
  |  Branch (98:9): [True: 0, False: 27.1k]
  ------------------
   99|      0|      return rv;
  100|      0|    }
  101|  27.1k|  }
  102|       |
  103|  31.3k|  return 0;
  104|  31.3k|}
nghttp2_hd_huff_decode_context_init:
  106|    767|void nghttp2_hd_huff_decode_context_init(nghttp2_hd_huff_decode_context *ctx) {
  107|    767|  ctx->fstate = 0;
  108|    767|  ctx->flags = NGHTTP2_HUFF_ACCEPTED;
  109|    767|}
nghttp2_hd_huff_decode:
  113|    791|                                     size_t srclen, int final) {
  114|    791|  const uint8_t *end = src + srclen;
  115|    791|  nghttp2_huff_decode t = {ctx->fstate, ctx->flags, 0};
  116|    791|  uint8_t c;
  117|       |
  118|       |  /* We use the decoding algorithm described in
  119|       |      - http://graphics.ics.uci.edu/pub/Prefix.pdf [!!! NO LONGER VALID !!!]
  120|       |      - https://ics.uci.edu/~dan/pubs/Prefix.pdf
  121|       |      - https://github.com/nghttp2/nghttp2/files/15141264/Prefix.pdf */
  122|  34.9k|  for (; src != end;) {
  ------------------
  |  Branch (122:10): [True: 34.2k, False: 791]
  ------------------
  123|  34.2k|    c = *src++;
  124|  34.2k|    t = huff_decode_table[t.fstate][c >> 4];
  125|  34.2k|    if (t.flags & NGHTTP2_HUFF_SYM) {
  ------------------
  |  Branch (125:9): [True: 21.5k, False: 12.6k]
  ------------------
  126|  21.5k|      *buf->last++ = t.sym;
  127|  21.5k|    }
  128|       |
  129|  34.2k|    t = huff_decode_table[t.fstate][c & 0xf];
  130|  34.2k|    if (t.flags & NGHTTP2_HUFF_SYM) {
  ------------------
  |  Branch (130:9): [True: 14.8k, False: 19.3k]
  ------------------
  131|  14.8k|      *buf->last++ = t.sym;
  132|  14.8k|    }
  133|  34.2k|  }
  134|       |
  135|    791|  ctx->fstate = t.fstate;
  136|    791|  ctx->flags = t.flags;
  137|       |
  138|    791|  if (final && !(ctx->flags & NGHTTP2_HUFF_ACCEPTED)) {
  ------------------
  |  Branch (138:7): [True: 452, False: 339]
  |  Branch (138:16): [True: 139, False: 313]
  ------------------
  139|    139|    return NGHTTP2_ERR_HEADER_COMP;
  140|    139|  }
  141|       |
  142|    652|  return (nghttp2_ssize)srclen;
  143|    791|}
nghttp2_hd_huff_decode_failure_state:
  145|    652|int nghttp2_hd_huff_decode_failure_state(nghttp2_hd_huff_decode_context *ctx) {
  146|    652|  return ctx->fstate == 0x100;
  147|    652|}

nghttp2_hd.c:nghttp2_huff_estimate_decode_length:
   78|    767|static inline size_t nghttp2_huff_estimate_decode_length(size_t len) {
   79|    767|  return len * 8 / 5;
   80|    767|}

nghttp2_put_uint16be:
   32|  13.4k|void nghttp2_put_uint16be(uint8_t *buf, uint16_t n) {
   33|       |  uint16_t x = htons(n);
   34|  13.4k|  memcpy(buf, &x, sizeof(uint16_t));
   35|  13.4k|}
nghttp2_put_uint32be:
   37|  77.0k|void nghttp2_put_uint32be(uint8_t *buf, uint32_t n) {
   38|       |  uint32_t x = htonl(n);
   39|  77.0k|  memcpy(buf, &x, sizeof(uint32_t));
   40|  77.0k|}
nghttp2_get_uint16:
   42|  12.2k|uint16_t nghttp2_get_uint16(const uint8_t *data) {
   43|  12.2k|  uint16_t n;
   44|  12.2k|  memcpy(&n, data, sizeof(uint16_t));
   45|       |  return ntohs(n);
   46|  12.2k|}
nghttp2_get_uint32:
   48|  36.5k|uint32_t nghttp2_get_uint32(const uint8_t *data) {
   49|  36.5k|  uint32_t n;
   50|  36.5k|  memcpy(&n, data, sizeof(uint32_t));
   51|       |  return ntohl(n);
   52|  36.5k|}
nghttp2_downcase:
  122|   144k|void nghttp2_downcase(uint8_t *s, size_t len) {
  123|   144k|  size_t i;
  124|  1.46M|  for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (124:15): [True: 1.31M, False: 144k]
  ------------------
  125|  1.31M|    s[i] = DOWNCASE_TBL[s[i]];
  126|  1.31M|  }
  127|   144k|}
nghttp2_adjust_local_window_size:
  158|  4.56k|                                     int32_t *delta_ptr) {
  159|  4.56k|  if (*delta_ptr > 0) {
  ------------------
  |  Branch (159:7): [True: 4.30k, False: 257]
  ------------------
  160|  4.30k|    int32_t recv_reduction_delta;
  161|  4.30k|    int32_t delta;
  162|  4.30k|    int32_t new_recv_window_size =
  163|  4.30k|      nghttp2_max_int32(0, *recv_window_size_ptr) - *delta_ptr;
  164|       |
  165|  4.30k|    if (new_recv_window_size >= 0) {
  ------------------
  |  Branch (165:9): [True: 0, False: 4.30k]
  ------------------
  166|      0|      *recv_window_size_ptr = new_recv_window_size;
  167|      0|      return 0;
  168|      0|    }
  169|       |
  170|  4.30k|    delta = -new_recv_window_size;
  171|       |
  172|       |    /* The delta size is strictly more than received bytes. Increase
  173|       |       local_window_size by that difference |delta|. */
  174|  4.30k|    if (*local_window_size_ptr > NGHTTP2_MAX_WINDOW_SIZE - delta) {
  ------------------
  |  |  224|  4.30k|#define NGHTTP2_MAX_WINDOW_SIZE ((int32_t)((1U << 31) - 1))
  ------------------
  |  Branch (174:9): [True: 20, False: 4.28k]
  ------------------
  175|     20|      return NGHTTP2_ERR_FLOW_CONTROL;
  176|     20|    }
  177|  4.28k|    *local_window_size_ptr += delta;
  178|       |    /* If there is recv_reduction due to earlier window_size
  179|       |       reduction, we have to adjust it too. */
  180|  4.28k|    recv_reduction_delta = nghttp2_min_int32(*recv_reduction_ptr, delta);
  181|  4.28k|    *recv_reduction_ptr -= recv_reduction_delta;
  182|  4.28k|    if (*recv_window_size_ptr < 0) {
  ------------------
  |  Branch (182:9): [True: 8, False: 4.27k]
  ------------------
  183|      8|      *recv_window_size_ptr += recv_reduction_delta;
  184|  4.27k|    } else {
  185|       |      /* If *recv_window_size_ptr > 0, then those bytes are going to
  186|       |         be returned to the remote peer (by WINDOW_UPDATE with the
  187|       |         adjusted *delta_ptr), so it is effectively 0 now.  We set to
  188|       |         *recv_reduction_delta, because caller does not take into
  189|       |         account it in *delta_ptr. */
  190|  4.27k|      *recv_window_size_ptr = recv_reduction_delta;
  191|  4.27k|    }
  192|       |    /* recv_reduction_delta must be paid from *delta_ptr, since it was
  193|       |       added in window size reduction (see below). */
  194|  4.28k|    *delta_ptr -= recv_reduction_delta;
  195|       |
  196|  4.28k|    return 0;
  197|  4.30k|  }
  198|       |
  199|    257|  if (*local_window_size_ptr + *delta_ptr < 0 ||
  ------------------
  |  Branch (199:7): [True: 0, False: 257]
  ------------------
  200|    257|      *recv_window_size_ptr < INT32_MIN - *delta_ptr ||
  ------------------
  |  Branch (200:7): [True: 0, False: 257]
  ------------------
  201|    257|      *recv_reduction_ptr > INT32_MAX + *delta_ptr) {
  ------------------
  |  Branch (201:7): [True: 0, False: 257]
  ------------------
  202|      0|    return NGHTTP2_ERR_FLOW_CONTROL;
  203|      0|  }
  204|       |  /* Decreasing local window size. Note that we achieve this without
  205|       |     noticing to the remote peer. To do this, we cut
  206|       |     recv_window_size by -delta. This means that we don't send
  207|       |     WINDOW_UPDATE for -delta bytes. */
  208|    257|  *local_window_size_ptr += *delta_ptr;
  209|    257|  *recv_window_size_ptr += *delta_ptr;
  210|    257|  *recv_reduction_ptr -= *delta_ptr;
  211|    257|  *delta_ptr = 0;
  212|       |
  213|    257|  return 0;
  214|    257|}
nghttp2_increase_local_window_size:
  219|  8.75k|                                       int32_t *delta_ptr) {
  220|  8.75k|  int32_t recv_reduction_delta;
  221|  8.75k|  int32_t delta;
  222|       |
  223|  8.75k|  delta = *delta_ptr;
  224|       |
  225|  8.75k|  assert(delta >= 0);
  ------------------
  |  Branch (225:3): [True: 0, False: 8.75k]
  |  Branch (225:3): [True: 8.75k, False: 0]
  ------------------
  226|       |
  227|       |  /* The delta size is strictly more than received bytes. Increase
  228|       |     local_window_size by that difference |delta|. */
  229|  8.75k|  if (*local_window_size_ptr > NGHTTP2_MAX_WINDOW_SIZE - delta) {
  ------------------
  |  |  224|  8.75k|#define NGHTTP2_MAX_WINDOW_SIZE ((int32_t)((1U << 31) - 1))
  ------------------
  |  Branch (229:7): [True: 0, False: 8.75k]
  ------------------
  230|      0|    return NGHTTP2_ERR_FLOW_CONTROL;
  231|      0|  }
  232|       |
  233|  8.75k|  *local_window_size_ptr += delta;
  234|       |  /* If there is recv_reduction due to earlier window_size
  235|       |     reduction, we have to adjust it too. */
  236|  8.75k|  recv_reduction_delta = nghttp2_min_int32(*recv_reduction_ptr, delta);
  237|  8.75k|  *recv_reduction_ptr -= recv_reduction_delta;
  238|       |
  239|  8.75k|  *recv_window_size_ptr += recv_reduction_delta;
  240|       |
  241|       |  /* recv_reduction_delta must be paid from *delta_ptr, since it was
  242|       |     added in window size reduction (see below). */
  243|  8.75k|  *delta_ptr -= recv_reduction_delta;
  244|       |
  245|  8.75k|  return 0;
  246|  8.75k|}
nghttp2_should_send_window_update:
  249|  7.97k|                                      int32_t recv_window_size) {
  250|  7.97k|  return recv_window_size > 0 && recv_window_size >= local_window_size / 2;
  ------------------
  |  Branch (250:10): [True: 957, False: 7.01k]
  |  Branch (250:34): [True: 0, False: 957]
  ------------------
  251|  7.97k|}
nghttp2_strerror:
  253|  1.17k|const char *nghttp2_strerror(int error_code) {
  254|  1.17k|  switch (error_code) {
  255|      0|  case 0:
  ------------------
  |  Branch (255:3): [True: 0, False: 1.17k]
  ------------------
  256|      0|    return "Success";
  257|      0|  case NGHTTP2_ERR_INVALID_ARGUMENT:
  ------------------
  |  Branch (257:3): [True: 0, False: 1.17k]
  ------------------
  258|      0|    return "Invalid argument";
  259|      0|  case NGHTTP2_ERR_BUFFER_ERROR:
  ------------------
  |  Branch (259:3): [True: 0, False: 1.17k]
  ------------------
  260|      0|    return "Out of buffer space";
  261|      0|  case NGHTTP2_ERR_UNSUPPORTED_VERSION:
  ------------------
  |  Branch (261:3): [True: 0, False: 1.17k]
  ------------------
  262|      0|    return "Unsupported SPDY version";
  263|      0|  case NGHTTP2_ERR_WOULDBLOCK:
  ------------------
  |  Branch (263:3): [True: 0, False: 1.17k]
  ------------------
  264|      0|    return "Operation would block";
  265|     36|  case NGHTTP2_ERR_PROTO:
  ------------------
  |  Branch (265:3): [True: 36, False: 1.13k]
  ------------------
  266|     36|    return "Protocol error";
  267|      0|  case NGHTTP2_ERR_INVALID_FRAME:
  ------------------
  |  Branch (267:3): [True: 0, False: 1.17k]
  ------------------
  268|      0|    return "Invalid frame octets";
  269|      0|  case NGHTTP2_ERR_EOF:
  ------------------
  |  Branch (269:3): [True: 0, False: 1.17k]
  ------------------
  270|      0|    return "EOF";
  271|      0|  case NGHTTP2_ERR_DEFERRED:
  ------------------
  |  Branch (271:3): [True: 0, False: 1.17k]
  ------------------
  272|      0|    return "Data transfer deferred";
  273|      0|  case NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE:
  ------------------
  |  Branch (273:3): [True: 0, False: 1.17k]
  ------------------
  274|      0|    return "No more Stream ID available";
  275|      2|  case NGHTTP2_ERR_STREAM_CLOSED:
  ------------------
  |  Branch (275:3): [True: 2, False: 1.16k]
  ------------------
  276|      2|    return "Stream was already closed or invalid";
  277|      0|  case NGHTTP2_ERR_STREAM_CLOSING:
  ------------------
  |  Branch (277:3): [True: 0, False: 1.17k]
  ------------------
  278|      0|    return "Stream is closing";
  279|      0|  case NGHTTP2_ERR_STREAM_SHUT_WR:
  ------------------
  |  Branch (279:3): [True: 0, False: 1.17k]
  ------------------
  280|      0|    return "The transmission is not allowed for this stream";
  281|      0|  case NGHTTP2_ERR_INVALID_STREAM_ID:
  ------------------
  |  Branch (281:3): [True: 0, False: 1.17k]
  ------------------
  282|      0|    return "Stream ID is invalid";
  283|      0|  case NGHTTP2_ERR_INVALID_STREAM_STATE:
  ------------------
  |  Branch (283:3): [True: 0, False: 1.17k]
  ------------------
  284|      0|    return "Invalid stream state";
  285|      0|  case NGHTTP2_ERR_DEFERRED_DATA_EXIST:
  ------------------
  |  Branch (285:3): [True: 0, False: 1.17k]
  ------------------
  286|      0|    return "Another DATA frame has already been deferred";
  287|      0|  case NGHTTP2_ERR_START_STREAM_NOT_ALLOWED:
  ------------------
  |  Branch (287:3): [True: 0, False: 1.17k]
  ------------------
  288|      0|    return "request HEADERS is not allowed";
  289|      0|  case NGHTTP2_ERR_GOAWAY_ALREADY_SENT:
  ------------------
  |  Branch (289:3): [True: 0, False: 1.17k]
  ------------------
  290|      0|    return "GOAWAY has already been sent";
  291|      0|  case NGHTTP2_ERR_INVALID_HEADER_BLOCK:
  ------------------
  |  Branch (291:3): [True: 0, False: 1.17k]
  ------------------
  292|      0|    return "Invalid header block";
  293|      0|  case NGHTTP2_ERR_INVALID_STATE:
  ------------------
  |  Branch (293:3): [True: 0, False: 1.17k]
  ------------------
  294|      0|    return "Invalid state";
  295|      0|  case NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE:
  ------------------
  |  Branch (295:3): [True: 0, False: 1.17k]
  ------------------
  296|      0|    return "The user callback function failed due to the temporal error";
  297|      0|  case NGHTTP2_ERR_FRAME_SIZE_ERROR:
  ------------------
  |  Branch (297:3): [True: 0, False: 1.17k]
  ------------------
  298|      0|    return "The length of the frame is invalid";
  299|      0|  case NGHTTP2_ERR_HEADER_COMP:
  ------------------
  |  Branch (299:3): [True: 0, False: 1.17k]
  ------------------
  300|      0|    return "Header compression/decompression error";
  301|     21|  case NGHTTP2_ERR_FLOW_CONTROL:
  ------------------
  |  Branch (301:3): [True: 21, False: 1.15k]
  ------------------
  302|     21|    return "Flow control error";
  303|      0|  case NGHTTP2_ERR_INSUFF_BUFSIZE:
  ------------------
  |  Branch (303:3): [True: 0, False: 1.17k]
  ------------------
  304|      0|    return "Insufficient buffer size given to function";
  305|      0|  case NGHTTP2_ERR_PAUSE:
  ------------------
  |  Branch (305:3): [True: 0, False: 1.17k]
  ------------------
  306|      0|    return "Callback was paused by the application";
  307|      0|  case NGHTTP2_ERR_TOO_MANY_INFLIGHT_SETTINGS:
  ------------------
  |  Branch (307:3): [True: 0, False: 1.17k]
  ------------------
  308|      0|    return "Too many inflight SETTINGS";
  309|      0|  case NGHTTP2_ERR_PUSH_DISABLED:
  ------------------
  |  Branch (309:3): [True: 0, False: 1.17k]
  ------------------
  310|      0|    return "Server push is disabled by peer";
  311|      0|  case NGHTTP2_ERR_DATA_EXIST:
  ------------------
  |  Branch (311:3): [True: 0, False: 1.17k]
  ------------------
  312|      0|    return "DATA or HEADERS frame has already been submitted for the stream";
  313|      0|  case NGHTTP2_ERR_SESSION_CLOSING:
  ------------------
  |  Branch (313:3): [True: 0, False: 1.17k]
  ------------------
  314|      0|    return "The current session is closing";
  315|    564|  case NGHTTP2_ERR_HTTP_HEADER:
  ------------------
  |  Branch (315:3): [True: 564, False: 607]
  ------------------
  316|    564|    return "Invalid HTTP header field was received";
  317|     10|  case NGHTTP2_ERR_HTTP_MESSAGING:
  ------------------
  |  Branch (317:3): [True: 10, False: 1.16k]
  ------------------
  318|     10|    return "Violation in HTTP messaging rule";
  319|      0|  case NGHTTP2_ERR_REFUSED_STREAM:
  ------------------
  |  Branch (319:3): [True: 0, False: 1.17k]
  ------------------
  320|      0|    return "Stream was refused";
  321|      0|  case NGHTTP2_ERR_INTERNAL:
  ------------------
  |  Branch (321:3): [True: 0, False: 1.17k]
  ------------------
  322|      0|    return "Internal error";
  323|      0|  case NGHTTP2_ERR_CANCEL:
  ------------------
  |  Branch (323:3): [True: 0, False: 1.17k]
  ------------------
  324|      0|    return "Cancel";
  325|      0|  case NGHTTP2_ERR_SETTINGS_EXPECTED:
  ------------------
  |  Branch (325:3): [True: 0, False: 1.17k]
  ------------------
  326|      0|    return "When a local endpoint expects to receive SETTINGS frame, it "
  327|      0|           "receives an other type of frame";
  328|      0|  case NGHTTP2_ERR_NOMEM:
  ------------------
  |  Branch (328:3): [True: 0, False: 1.17k]
  ------------------
  329|      0|    return "Out of memory";
  330|    538|  case NGHTTP2_ERR_CALLBACK_FAILURE:
  ------------------
  |  Branch (330:3): [True: 538, False: 633]
  ------------------
  331|    538|    return "The user callback function failed";
  332|      0|  case NGHTTP2_ERR_BAD_CLIENT_MAGIC:
  ------------------
  |  Branch (332:3): [True: 0, False: 1.17k]
  ------------------
  333|      0|    return "Received bad client magic byte string";
  334|      0|  case NGHTTP2_ERR_FLOODED:
  ------------------
  |  Branch (334:3): [True: 0, False: 1.17k]
  ------------------
  335|      0|    return "Flooding was detected in this HTTP/2 session, and it must be "
  336|      0|           "closed";
  337|      0|  case NGHTTP2_ERR_TOO_MANY_SETTINGS:
  ------------------
  |  Branch (337:3): [True: 0, False: 1.17k]
  ------------------
  338|      0|    return "SETTINGS frame contained more than the maximum allowed entries";
  339|      0|  case NGHTTP2_ERR_TOO_MANY_CONTINUATIONS:
  ------------------
  |  Branch (339:3): [True: 0, False: 1.17k]
  ------------------
  340|      0|    return "Too many CONTINUATION frames following a HEADER frame";
  341|      0|  default:
  ------------------
  |  Branch (341:3): [True: 0, False: 1.17k]
  ------------------
  342|      0|    return "Unknown error code";
  343|  1.17k|  }
  344|  1.17k|}
nghttp2_check_header_name:
  414|  44.0k|int nghttp2_check_header_name(const uint8_t *name, size_t len) {
  415|  44.0k|  const uint8_t *last;
  416|  44.0k|  if (len == 0) {
  ------------------
  |  Branch (416:7): [True: 3.50k, False: 40.5k]
  ------------------
  417|  3.50k|    return 0;
  418|  3.50k|  }
  419|  40.5k|  if (*name == ':') {
  ------------------
  |  Branch (419:7): [True: 1.61k, False: 38.9k]
  ------------------
  420|  1.61k|    if (len == 1) {
  ------------------
  |  Branch (420:9): [True: 1, False: 1.61k]
  ------------------
  421|      1|      return 0;
  422|      1|    }
  423|  1.61k|    ++name;
  424|  1.61k|    --len;
  425|  1.61k|  }
  426|   452k|  for (last = name + len; name != last; ++name) {
  ------------------
  |  Branch (426:27): [True: 413k, False: 39.8k]
  ------------------
  427|   413k|    if (!VALID_HD_NAME_CHARS[*name]) {
  ------------------
  |  Branch (427:9): [True: 695, False: 412k]
  ------------------
  428|    695|      return 0;
  429|    695|    }
  430|   413k|  }
  431|  39.8k|  return 1;
  432|  40.5k|}
nghttp2_check_header_value:
  502|  39.6k|int nghttp2_check_header_value(const uint8_t *value, size_t len) {
  503|  39.6k|  const uint8_t *last;
  504|  1.83M|  for (last = value + len; value != last; ++value) {
  ------------------
  |  Branch (504:28): [True: 1.80M, False: 34.6k]
  ------------------
  505|  1.80M|    if (!VALID_HD_VALUE_CHARS[*value]) {
  ------------------
  |  Branch (505:9): [True: 4.94k, False: 1.79M]
  ------------------
  506|  4.94k|      return 0;
  507|  4.94k|    }
  508|  1.80M|  }
  509|  34.6k|  return 1;
  510|  39.6k|}
nghttp2_check_method:
  593|     38|int nghttp2_check_method(const uint8_t *value, size_t len) {
  594|     38|  const uint8_t *last;
  595|     38|  if (len == 0) {
  ------------------
  |  Branch (595:7): [True: 10, False: 28]
  ------------------
  596|     10|    return 0;
  597|     10|  }
  598|    324|  for (last = value + len; value != last; ++value) {
  ------------------
  |  Branch (598:28): [True: 316, False: 8]
  ------------------
  599|    316|    if (!VALID_METHOD_CHARS[*value]) {
  ------------------
  |  Branch (599:9): [True: 20, False: 296]
  ------------------
  600|     20|      return 0;
  601|     20|    }
  602|    316|  }
  603|      8|  return 1;
  604|     28|}
nghttp2_check_path:
  674|     49|int nghttp2_check_path(const uint8_t *value, size_t len) {
  675|     49|  const uint8_t *last;
  676|    617|  for (last = value + len; value != last; ++value) {
  ------------------
  |  Branch (676:28): [True: 588, False: 29]
  ------------------
  677|    588|    if (!VALID_PATH_CHARS[*value]) {
  ------------------
  |  Branch (677:9): [True: 20, False: 568]
  ------------------
  678|     20|      return 0;
  679|     20|    }
  680|    588|  }
  681|     29|  return 1;
  682|     49|}
nghttp2_cpymem:
  762|   388k|uint8_t *nghttp2_cpymem(uint8_t *dest, const void *src, size_t len) {
  763|   388k|  if (len == 0) {
  ------------------
  |  Branch (763:7): [True: 30.3k, False: 357k]
  ------------------
  764|  30.3k|    return dest;
  765|  30.3k|  }
  766|       |
  767|   357k|  memcpy(dest, src, len);
  768|       |
  769|   357k|  return dest + len;
  770|   388k|}
nghttp2_http2_strerror:
  772|  3.41k|const char *nghttp2_http2_strerror(uint32_t error_code) {
  773|  3.41k|  switch (error_code) {
  774|      2|  case NGHTTP2_NO_ERROR:
  ------------------
  |  Branch (774:3): [True: 2, False: 3.40k]
  ------------------
  775|      2|    return "NO_ERROR";
  776|  1.15k|  case NGHTTP2_PROTOCOL_ERROR:
  ------------------
  |  Branch (776:3): [True: 1.15k, False: 2.25k]
  ------------------
  777|  1.15k|    return "PROTOCOL_ERROR";
  778|      1|  case NGHTTP2_INTERNAL_ERROR:
  ------------------
  |  Branch (778:3): [True: 1, False: 3.41k]
  ------------------
  779|      1|    return "INTERNAL_ERROR";
  780|      1|  case NGHTTP2_FLOW_CONTROL_ERROR:
  ------------------
  |  Branch (780:3): [True: 1, False: 3.41k]
  ------------------
  781|      1|    return "FLOW_CONTROL_ERROR";
  782|      1|  case NGHTTP2_SETTINGS_TIMEOUT:
  ------------------
  |  Branch (782:3): [True: 1, False: 3.41k]
  ------------------
  783|      1|    return "SETTINGS_TIMEOUT";
  784|      3|  case NGHTTP2_STREAM_CLOSED:
  ------------------
  |  Branch (784:3): [True: 3, False: 3.40k]
  ------------------
  785|      3|    return "STREAM_CLOSED";
  786|    569|  case NGHTTP2_FRAME_SIZE_ERROR:
  ------------------
  |  Branch (786:3): [True: 569, False: 2.84k]
  ------------------
  787|    569|    return "FRAME_SIZE_ERROR";
  788|      0|  case NGHTTP2_REFUSED_STREAM:
  ------------------
  |  Branch (788:3): [True: 0, False: 3.41k]
  ------------------
  789|      0|    return "REFUSED_STREAM";
  790|      1|  case NGHTTP2_CANCEL:
  ------------------
  |  Branch (790:3): [True: 1, False: 3.41k]
  ------------------
  791|      1|    return "CANCEL";
  792|  1.00k|  case NGHTTP2_COMPRESSION_ERROR:
  ------------------
  |  Branch (792:3): [True: 1.00k, False: 2.41k]
  ------------------
  793|  1.00k|    return "COMPRESSION_ERROR";
  794|      1|  case NGHTTP2_CONNECT_ERROR:
  ------------------
  |  Branch (794:3): [True: 1, False: 3.41k]
  ------------------
  795|      1|    return "CONNECT_ERROR";
  796|      3|  case NGHTTP2_ENHANCE_YOUR_CALM:
  ------------------
  |  Branch (796:3): [True: 3, False: 3.40k]
  ------------------
  797|      3|    return "ENHANCE_YOUR_CALM";
  798|      1|  case NGHTTP2_INADEQUATE_SECURITY:
  ------------------
  |  Branch (798:3): [True: 1, False: 3.41k]
  ------------------
  799|      1|    return "INADEQUATE_SECURITY";
  800|     22|  case NGHTTP2_HTTP_1_1_REQUIRED:
  ------------------
  |  Branch (800:3): [True: 22, False: 3.38k]
  ------------------
  801|     22|    return "HTTP_1_1_REQUIRED";
  802|    652|  default:
  ------------------
  |  Branch (802:3): [True: 652, False: 2.75k]
  ------------------
  803|    652|    return "unknown";
  804|  3.41k|  }
  805|  3.41k|}

nghttp2_session.c:nghttp2_min_size:
   52|  44.9k|  static inline T nghttp2_min_##SUFFIX(T a, T b) { return a < b ? a : b; }
  ------------------
  |  Branch (52:59): [True: 3.18k, False: 41.7k]
  ------------------
nghttp2_session.c:nghttp2_min_int32:
   52|  14.5k|  static inline T nghttp2_min_##SUFFIX(T a, T b) { return a < b ? a : b; }
  ------------------
  |  Branch (52:59): [True: 5.58k, False: 8.98k]
  ------------------
nghttp2_session.c:nghttp2_max_int32:
   39|  3.25M|  static inline T nghttp2_max_##SUFFIX(T a, T b) { return a < b ? b : a; }
  ------------------
  |  Branch (39:59): [True: 3.25M, False: 38]
  ------------------
nghttp2_submit.c:nghttp2_max_int32:
   39|  4.28k|  static inline T nghttp2_max_##SUFFIX(T a, T b) { return a < b ? b : a; }
  ------------------
  |  Branch (39:59): [True: 0, False: 4.28k]
  ------------------
nghttp2_helper.c:nghttp2_max_int32:
   39|  4.30k|  static inline T nghttp2_max_##SUFFIX(T a, T b) { return a < b ? b : a; }
  ------------------
  |  Branch (39:59): [True: 7, False: 4.30k]
  ------------------
nghttp2_helper.c:nghttp2_min_int32:
   52|  13.0k|  static inline T nghttp2_min_##SUFFIX(T a, T b) { return a < b ? a : b; }
  ------------------
  |  Branch (52:59): [True: 13.0k, False: 13]
  ------------------
nghttp2_hd.c:nghttp2_min_size:
   52|  19.8k|  static inline T nghttp2_min_##SUFFIX(T a, T b) { return a < b ? a : b; }
  ------------------
  |  Branch (52:59): [True: 483, False: 19.3k]
  ------------------
nghttp2_ratelim.c:nghttp2_min_uint64:
   52|  1.52k|  static inline T nghttp2_min_##SUFFIX(T a, T b) { return a < b ? a : b; }
  ------------------
  |  Branch (52:59): [True: 0, False: 1.52k]
  ------------------
nghttp2_pq.c:nghttp2_max_size:
   39|    487|  static inline T nghttp2_max_##SUFFIX(T a, T b) { return a < b ? b : a; }
  ------------------
  |  Branch (39:59): [True: 0, False: 487]
  ------------------
nghttp2_buf.c:nghttp2_max_size:
   39|  4.53k|  static inline T nghttp2_max_##SUFFIX(T a, T b) { return a < b ? b : a; }
  ------------------
  |  Branch (39:59): [True: 0, False: 4.53k]
  ------------------
nghttp2_buf.c:nghttp2_min_size:
   52|   255k|  static inline T nghttp2_min_##SUFFIX(T a, T b) { return a < b ? a : b; }
  ------------------
  |  Branch (52:59): [True: 137, False: 254k]
  ------------------

nghttp2_http_on_header:
  430|  44.0k|                           int trailer) {
  431|  44.0k|  int rv;
  432|       |
  433|       |  /* We are strict for pseudo header field.  One bad character should
  434|       |     lead to fail.  OTOH, we should be a bit forgiving for regular
  435|       |     headers, since existing public internet has so much illegal
  436|       |     headers floating around and if we kill the stream because of
  437|       |     this, we may disrupt many web sites and/or libraries.  So we
  438|       |     become conservative here, and just ignore those illegal regular
  439|       |     headers. */
  440|  44.0k|  if (!nghttp2_check_header_name(nv->name->base, nv->name->len)) {
  ------------------
  |  Branch (440:7): [True: 4.19k, False: 39.8k]
  ------------------
  441|  4.19k|    size_t i;
  442|  4.19k|    if (nv->name->len > 0 && nv->name->base[0] == ':') {
  ------------------
  |  Branch (442:9): [True: 696, False: 3.50k]
  |  Branch (442:30): [True: 9, False: 687]
  ------------------
  443|      9|      return NGHTTP2_ERR_HTTP_HEADER;
  444|      9|    }
  445|       |    /* header field name must be lower-cased without exception */
  446|  17.4k|    for (i = 0; i < nv->name->len; ++i) {
  ------------------
  |  Branch (446:17): [True: 13.3k, False: 4.13k]
  ------------------
  447|  13.3k|      uint8_t c = nv->name->base[i];
  448|  13.3k|      if ('A' <= c && c <= 'Z') {
  ------------------
  |  Branch (448:11): [True: 1.96k, False: 11.3k]
  |  Branch (448:23): [True: 56, False: 1.91k]
  ------------------
  449|     56|        return NGHTTP2_ERR_HTTP_HEADER;
  450|     56|      }
  451|  13.3k|    }
  452|       |    /* When ignoring regular headers, we set this flag so that we
  453|       |       still enforce header field ordering rule for pseudo header
  454|       |       fields. */
  455|  4.13k|    stream->http_flags |= NGHTTP2_HTTP_FLAG_PSEUDO_HEADER_DISALLOWED;
  456|  4.13k|    return NGHTTP2_ERR_IGN_HTTP_HEADER;
  457|  4.18k|  }
  458|       |
  459|  39.8k|  switch (nv->token) {
  460|     38|  case NGHTTP2_TOKEN__METHOD:
  ------------------
  |  Branch (460:3): [True: 38, False: 39.7k]
  ------------------
  461|     38|    rv = nghttp2_check_method(nv->value->base, nv->value->len);
  462|     38|    break;
  463|     49|  case NGHTTP2_TOKEN__PATH:
  ------------------
  |  Branch (463:3): [True: 49, False: 39.7k]
  ------------------
  464|     49|    rv = nghttp2_check_path(nv->value->base, nv->value->len);
  465|     49|    break;
  466|     74|  case NGHTTP2_TOKEN__AUTHORITY:
  ------------------
  |  Branch (466:3): [True: 74, False: 39.7k]
  ------------------
  467|    664|  case NGHTTP2_TOKEN_HOST:
  ------------------
  |  Branch (467:3): [True: 590, False: 39.2k]
  ------------------
  468|    664|    if (session->server || frame->hd.type == NGHTTP2_PUSH_PROMISE) {
  ------------------
  |  Branch (468:9): [True: 0, False: 664]
  |  Branch (468:28): [True: 0, False: 664]
  ------------------
  469|      0|      rv = check_authority(nv->value->base, nv->value->len);
  470|    664|    } else if (
  471|    664|      stream->flags &
  ------------------
  |  Branch (471:7): [True: 664, False: 0]
  ------------------
  472|    664|      NGHTTP2_STREAM_FLAG_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION) {
  473|    664|      rv = nghttp2_check_header_value(nv->value->base, nv->value->len);
  474|    664|    } else {
  475|      0|      rv = nghttp2_check_header_value_rfc9113(nv->value->base, nv->value->len);
  476|      0|    }
  477|    664|    break;
  478|    102|  case NGHTTP2_TOKEN__SCHEME:
  ------------------
  |  Branch (478:3): [True: 102, False: 39.7k]
  ------------------
  479|    102|    rv = check_scheme(nv->value->base, nv->value->len);
  480|    102|    break;
  481|     11|  case NGHTTP2_TOKEN__PROTOCOL:
  ------------------
  |  Branch (481:3): [True: 11, False: 39.8k]
  ------------------
  482|       |    /* Check the value consists of just white spaces, which was done
  483|       |       in check_pseudo_header before
  484|       |       nghttp2_check_header_value_rfc9113 has been introduced. */
  485|     11|    if ((stream->flags &
  ------------------
  |  Branch (485:9): [True: 11, False: 0]
  ------------------
  486|     11|         NGHTTP2_STREAM_FLAG_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION) &&
  487|     11|        lws(nv->value->base, nv->value->len)) {
  ------------------
  |  Branch (487:9): [True: 3, False: 8]
  ------------------
  488|      3|      rv = 0;
  489|      3|      break;
  490|      3|    }
  491|       |    /* fall through */
  492|  38.9k|  default:
  ------------------
  |  Branch (492:3): [True: 38.9k, False: 864]
  ------------------
  493|  38.9k|    if (stream->flags &
  ------------------
  |  Branch (493:9): [True: 38.9k, False: 0]
  ------------------
  494|  38.9k|        NGHTTP2_STREAM_FLAG_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION) {
  495|  38.9k|      rv = nghttp2_check_header_value(nv->value->base, nv->value->len);
  496|  38.9k|    } else {
  497|      0|      rv = nghttp2_check_header_value_rfc9113(nv->value->base, nv->value->len);
  498|      0|    }
  499|  39.8k|  }
  500|       |
  501|  39.8k|  if (rv == 0) {
  ------------------
  |  Branch (501:7): [True: 5.07k, False: 34.7k]
  ------------------
  502|  5.07k|    assert(nv->name->len > 0);
  ------------------
  |  Branch (502:5): [True: 0, False: 5.07k]
  |  Branch (502:5): [True: 5.07k, False: 0]
  ------------------
  503|  5.07k|    if (nv->name->base[0] == ':') {
  ------------------
  |  Branch (503:9): [True: 194, False: 4.87k]
  ------------------
  504|    194|      return NGHTTP2_ERR_HTTP_HEADER;
  505|    194|    }
  506|       |    /* When ignoring regular headers, we set this flag so that we
  507|       |       still enforce header field ordering rule for pseudo header
  508|       |       fields. */
  509|  4.87k|    stream->http_flags |= NGHTTP2_HTTP_FLAG_PSEUDO_HEADER_DISALLOWED;
  510|  4.87k|    return NGHTTP2_ERR_IGN_HTTP_HEADER;
  511|  5.07k|  }
  512|       |
  513|  34.7k|  if (session->server || frame->hd.type == NGHTTP2_PUSH_PROMISE) {
  ------------------
  |  Branch (513:7): [True: 0, False: 34.7k]
  |  Branch (513:26): [True: 0, False: 34.7k]
  ------------------
  514|      0|    return http_request_on_header(stream, nv, trailer,
  515|      0|                                  session->server &&
  ------------------
  |  Branch (515:35): [True: 0, False: 0]
  ------------------
  516|      0|                                    session->pending_enable_connect_protocol);
  ------------------
  |  Branch (516:37): [True: 0, False: 0]
  ------------------
  517|      0|  }
  518|       |
  519|  34.7k|  return http_response_on_header(stream, nv, trailer);
  520|  34.7k|}
nghttp2_http_on_response_headers:
  559|    243|int nghttp2_http_on_response_headers(nghttp2_stream *stream) {
  560|    243|  if ((stream->http_flags & NGHTTP2_HTTP_FLAG__STATUS) == 0) {
  ------------------
  |  Branch (560:7): [True: 9, False: 234]
  ------------------
  561|      9|    return -1;
  562|      9|  }
  563|       |
  564|    234|  if (stream->status_code / 100 == 1) {
  ------------------
  |  Branch (564:7): [True: 0, False: 234]
  ------------------
  565|       |    /* non-final response */
  566|      0|    stream->http_flags = (stream->http_flags & NGHTTP2_HTTP_FLAG_METH_ALL) |
  567|      0|                         NGHTTP2_HTTP_FLAG_EXPECT_FINAL_RESPONSE;
  568|      0|    stream->content_length = -1;
  569|      0|    stream->status_code = -1;
  570|      0|    return 0;
  571|      0|  }
  572|       |
  573|    234|  stream->http_flags =
  574|    234|    stream->http_flags & (uint32_t)~NGHTTP2_HTTP_FLAG_EXPECT_FINAL_RESPONSE;
  575|       |
  576|    234|  if (!expect_response_body(stream)) {
  ------------------
  |  Branch (576:7): [True: 19, False: 215]
  ------------------
  577|     19|    stream->content_length = 0;
  578|    215|  } else if (stream->http_flags & (NGHTTP2_HTTP_FLAG_METH_CONNECT |
  ------------------
  |  Branch (578:14): [True: 2, False: 213]
  ------------------
  579|    215|                                   NGHTTP2_HTTP_FLAG_METH_UPGRADE_WORKAROUND)) {
  580|      2|    stream->content_length = -1;
  581|      2|  }
  582|       |
  583|    234|  return 0;
  584|    234|}
nghttp2_http_on_trailer_headers:
  587|      7|                                    nghttp2_frame *frame) {
  588|      7|  (void)stream;
  589|       |
  590|      7|  if ((frame->hd.flags & NGHTTP2_FLAG_END_STREAM) == 0) {
  ------------------
  |  Branch (590:7): [True: 1, False: 6]
  ------------------
  591|      1|    return -1;
  592|      1|  }
  593|       |
  594|      6|  return 0;
  595|      7|}
nghttp2_http_on_remote_end_stream:
  597|     37|int nghttp2_http_on_remote_end_stream(nghttp2_stream *stream) {
  598|     37|  if (stream->http_flags & NGHTTP2_HTTP_FLAG_EXPECT_FINAL_RESPONSE) {
  ------------------
  |  Branch (598:7): [True: 0, False: 37]
  ------------------
  599|      0|    return -1;
  600|      0|  }
  601|       |
  602|     37|  if (stream->content_length != -1 &&
  ------------------
  |  Branch (602:7): [True: 6, False: 31]
  ------------------
  603|      6|      stream->content_length != stream->recv_content_length) {
  ------------------
  |  Branch (603:7): [True: 0, False: 6]
  ------------------
  604|      0|    return -1;
  605|      0|  }
  606|       |
  607|     37|  return 0;
  608|     37|}
nghttp2_http_on_data_chunk:
  610|    426|int nghttp2_http_on_data_chunk(nghttp2_stream *stream, size_t n) {
  611|    426|  stream->recv_content_length += (int64_t)n;
  612|       |
  613|    426|  if ((stream->http_flags & NGHTTP2_HTTP_FLAG_EXPECT_FINAL_RESPONSE) ||
  ------------------
  |  Branch (613:7): [True: 0, False: 426]
  ------------------
  614|    426|      (stream->content_length != -1 &&
  ------------------
  |  Branch (614:8): [True: 10, False: 416]
  ------------------
  615|     10|       stream->recv_content_length > stream->content_length)) {
  ------------------
  |  Branch (615:8): [True: 10, False: 0]
  ------------------
  616|     10|    return -1;
  617|     10|  }
  618|       |
  619|    416|  return 0;
  620|    426|}
nghttp2_http_record_request_method:
  623|  4.40k|                                        nghttp2_frame *frame) {
  624|  4.40k|  const nghttp2_nv *nva;
  625|  4.40k|  size_t nvlen;
  626|  4.40k|  size_t i;
  627|       |
  628|  4.40k|  switch (frame->hd.type) {
  629|  4.40k|  case NGHTTP2_HEADERS:
  ------------------
  |  Branch (629:3): [True: 4.40k, False: 0]
  ------------------
  630|  4.40k|    nva = frame->headers.nva;
  631|  4.40k|    nvlen = frame->headers.nvlen;
  632|  4.40k|    break;
  633|      0|  case NGHTTP2_PUSH_PROMISE:
  ------------------
  |  Branch (633:3): [True: 0, False: 4.40k]
  ------------------
  634|      0|    nva = frame->push_promise.nva;
  635|      0|    nvlen = frame->push_promise.nvlen;
  636|      0|    break;
  637|      0|  default:
  ------------------
  |  Branch (637:3): [True: 0, False: 4.40k]
  ------------------
  638|      0|    return;
  639|  4.40k|  }
  640|       |
  641|       |  /* TODO we should do this strictly. */
  642|  4.40k|  for (i = 0; i < nvlen; ++i) {
  ------------------
  |  Branch (642:15): [True: 4.40k, False: 0]
  ------------------
  643|  4.40k|    const nghttp2_nv *nv = &nva[i];
  644|  4.40k|    if (!(nv->namelen == 7 && nv->name[6] == 'd' &&
  ------------------
  |  Branch (644:11): [True: 4.40k, False: 0]
  |  Branch (644:31): [True: 4.40k, False: 0]
  ------------------
  645|  4.40k|          memcmp(":metho", nv->name, nv->namelen - 1) == 0)) {
  ------------------
  |  Branch (645:11): [True: 4.40k, False: 0]
  ------------------
  646|      0|      continue;
  647|      0|    }
  648|  4.40k|    if (lstreq("CONNECT", nv->value, nv->valuelen)) {
  ------------------
  |  |   72|  4.40k|  (nghttp2_strlen_lit((A)) == (N) && memcmp((A), (B), (N)) == 0)
  |  |  ------------------
  |  |  |  |   69|  4.40k|#define nghttp2_strlen_lit(S) (sizeof(S) - 1)
  |  |  ------------------
  |  |  |  Branch (72:4): [True: 45, False: 4.36k]
  |  |  |  Branch (72:38): [True: 5, False: 40]
  |  |  ------------------
  ------------------
  649|      5|      stream->http_flags |= NGHTTP2_HTTP_FLAG_METH_CONNECT;
  650|      5|      return;
  651|      5|    }
  652|  4.40k|    if (lstreq("HEAD", nv->value, nv->valuelen)) {
  ------------------
  |  |   72|  4.40k|  (nghttp2_strlen_lit((A)) == (N) && memcmp((A), (B), (N)) == 0)
  |  |  ------------------
  |  |  |  |   69|  4.40k|#define nghttp2_strlen_lit(S) (sizeof(S) - 1)
  |  |  ------------------
  |  |  |  Branch (72:4): [True: 452, False: 3.94k]
  |  |  |  Branch (72:38): [True: 14, False: 438]
  |  |  ------------------
  ------------------
  653|     14|      stream->http_flags |= NGHTTP2_HTTP_FLAG_METH_HEAD;
  654|     14|      return;
  655|     14|    }
  656|  4.38k|    return;
  657|  4.40k|  }
  658|  4.40k|}
nghttp2_http.c:check_scheme:
  316|    102|static int check_scheme(const uint8_t *value, size_t len) {
  317|    102|  const uint8_t *last;
  318|    102|  if (len == 0) {
  ------------------
  |  Branch (318:7): [True: 9, False: 93]
  ------------------
  319|      9|    return 0;
  320|      9|  }
  321|       |
  322|     93|  if (!(('A' <= *value && *value <= 'Z') || ('a' <= *value && *value <= 'z'))) {
  ------------------
  |  Branch (322:10): [True: 82, False: 11]
  |  Branch (322:27): [True: 34, False: 48]
  |  Branch (322:46): [True: 45, False: 14]
  |  Branch (322:63): [True: 40, False: 5]
  ------------------
  323|     19|    return 0;
  324|     19|  }
  325|       |
  326|     74|  last = value + len;
  327|     74|  ++value;
  328|       |
  329|  1.64k|  for (; value != last; ++value) {
  ------------------
  |  Branch (329:10): [True: 1.61k, False: 30]
  ------------------
  330|  1.61k|    if (!(('A' <= *value && *value <= 'Z') ||
  ------------------
  |  Branch (330:12): [True: 830, False: 789]
  |  Branch (330:29): [True: 247, False: 583]
  ------------------
  331|  1.37k|          ('a' <= *value && *value <= 'z') ||
  ------------------
  |  Branch (331:12): [True: 579, False: 793]
  |  Branch (331:29): [True: 569, False: 10]
  ------------------
  332|    803|          ('0' <= *value && *value <= '9') || *value == '+' || *value == '-' ||
  ------------------
  |  Branch (332:12): [True: 487, False: 316]
  |  Branch (332:29): [True: 464, False: 23]
  |  Branch (332:47): [True: 78, False: 261]
  |  Branch (332:64): [True: 111, False: 150]
  ------------------
  333|    150|          *value == '.')) {
  ------------------
  |  Branch (333:11): [True: 106, False: 44]
  ------------------
  334|     44|      return 0;
  335|     44|    }
  336|  1.61k|  }
  337|     30|  return 1;
  338|     74|}
nghttp2_http.c:lws:
  340|     11|static int lws(const uint8_t *s, size_t n) {
  341|     11|  size_t i;
  342|    152|  for (i = 0; i < n; ++i) {
  ------------------
  |  Branch (342:15): [True: 149, False: 3]
  ------------------
  343|    149|    if (s[i] != ' ' && s[i] != '\t') {
  ------------------
  |  Branch (343:9): [True: 51, False: 98]
  |  Branch (343:24): [True: 8, False: 43]
  ------------------
  344|      8|      return 0;
  345|      8|    }
  346|    149|  }
  347|      3|  return 1;
  348|     11|}
nghttp2_http.c:check_pseudo_header:
   79|  1.22k|                               uint32_t flag) {
   80|  1.22k|  if ((stream->http_flags & flag) || nv->value->len == 0) {
  ------------------
  |  Branch (80:7): [True: 2, False: 1.22k]
  |  Branch (80:38): [True: 6, False: 1.21k]
  ------------------
   81|      8|    return 0;
   82|      8|  }
   83|  1.21k|  stream->http_flags = stream->http_flags | flag;
   84|  1.21k|  return 1;
   85|  1.22k|}
nghttp2_http.c:memieq:
   40|  1.20k|static int memieq(const void *a, const void *b, size_t n) {
   41|  1.20k|  size_t i;
   42|  1.20k|  const uint8_t *aa = a, *bb = b;
   43|       |
   44|  10.7k|  for (i = 0; i < n; ++i) {
  ------------------
  |  Branch (44:15): [True: 9.54k, False: 1.17k]
  ------------------
   45|  9.54k|    if (downcase(aa[i]) != downcase(bb[i])) {
  ------------------
  |  Branch (45:9): [True: 26, False: 9.51k]
  ------------------
   46|     26|      return 0;
   47|     26|    }
   48|  9.54k|  }
   49|  1.17k|  return 1;
   50|  1.20k|}
nghttp2_http.c:downcase:
   36|  19.0k|static uint8_t downcase(uint8_t c) {
   37|  19.0k|  return 'A' <= c && c <= 'Z' ? (uint8_t)(c - 'A' + 'a') : c;
  ------------------
  |  Branch (37:10): [True: 19.0k, False: 17]
  |  Branch (37:22): [True: 4.68k, False: 14.3k]
  ------------------
   38|  19.0k|}
nghttp2_http.c:parse_uint:
   55|  1.27k|static int64_t parse_uint(const uint8_t *s, size_t len) {
   56|  1.27k|  int64_t n = 0;
   57|  1.27k|  size_t i;
   58|  1.27k|  if (len == 0) {
  ------------------
  |  Branch (58:7): [True: 5, False: 1.27k]
  ------------------
   59|      5|    return -1;
   60|      5|  }
   61|  6.49k|  for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (61:15): [True: 5.25k, False: 1.24k]
  ------------------
   62|  5.25k|    if ('0' <= s[i] && s[i] <= '9') {
  ------------------
  |  Branch (62:9): [True: 5.25k, False: 2]
  |  Branch (62:24): [True: 5.23k, False: 21]
  ------------------
   63|  5.23k|      if (n > INT64_MAX / 10) {
  ------------------
  |  Branch (63:11): [True: 4, False: 5.22k]
  ------------------
   64|      4|        return -1;
   65|      4|      }
   66|  5.22k|      n *= 10;
   67|  5.22k|      if (n > INT64_MAX - (s[i] - '0')) {
  ------------------
  |  Branch (67:11): [True: 0, False: 5.22k]
  ------------------
   68|      0|        return -1;
   69|      0|      }
   70|  5.22k|      n += s[i] - '0';
   71|  5.22k|      continue;
   72|  5.22k|    }
   73|     23|    return -1;
   74|  5.25k|  }
   75|  1.24k|  return n;
   76|  1.27k|}
nghttp2_http.c:http_response_on_header:
  237|  34.7k|                                   int trailer) {
  238|  34.7k|  if (nv->name->base[0] == ':') {
  ------------------
  |  Branch (238:7): [True: 1.41k, False: 33.3k]
  ------------------
  239|  1.41k|    if (trailer ||
  ------------------
  |  Branch (239:9): [True: 8, False: 1.40k]
  ------------------
  240|  1.40k|        (stream->http_flags & NGHTTP2_HTTP_FLAG_PSEUDO_HEADER_DISALLOWED)) {
  ------------------
  |  Branch (240:9): [True: 148, False: 1.25k]
  ------------------
  241|    156|      return NGHTTP2_ERR_HTTP_HEADER;
  242|    156|    }
  243|  1.41k|  }
  244|       |
  245|  34.6k|  switch (nv->token) {
  246|  1.22k|  case NGHTTP2_TOKEN__STATUS: {
  ------------------
  |  Branch (246:3): [True: 1.22k, False: 33.3k]
  ------------------
  247|  1.22k|    if (!check_pseudo_header(stream, nv, NGHTTP2_HTTP_FLAG__STATUS)) {
  ------------------
  |  Branch (247:9): [True: 8, False: 1.21k]
  ------------------
  248|      8|      return NGHTTP2_ERR_HTTP_HEADER;
  249|      8|    }
  250|  1.21k|    if (nv->value->len != 3) {
  ------------------
  |  Branch (250:9): [True: 5, False: 1.21k]
  ------------------
  251|      5|      return NGHTTP2_ERR_HTTP_HEADER;
  252|      5|    }
  253|  1.21k|    stream->status_code = (int16_t)parse_uint(nv->value->base, nv->value->len);
  254|  1.21k|    if (stream->status_code == -1 || stream->status_code == 101) {
  ------------------
  |  Branch (254:9): [True: 5, False: 1.20k]
  |  Branch (254:38): [True: 1, False: 1.20k]
  ------------------
  255|      6|      return NGHTTP2_ERR_HTTP_HEADER;
  256|      6|    }
  257|  1.20k|    break;
  258|  1.21k|  }
  259|  1.20k|  case NGHTTP2_TOKEN_CONTENT_LENGTH: {
  ------------------
  |  Branch (259:3): [True: 102, False: 34.5k]
  ------------------
  260|    102|    if (stream->status_code == 204) {
  ------------------
  |  Branch (260:9): [True: 4, False: 98]
  ------------------
  261|       |      /* content-length header field in 204 response is prohibited by
  262|       |         RFC 7230.  But some widely used servers send content-length:
  263|       |         0.  Until they get fixed, we ignore it. */
  264|      4|      if (stream->content_length != -1) {
  ------------------
  |  Branch (264:11): [True: 0, False: 4]
  ------------------
  265|       |        /* Found multiple content-length field */
  266|      0|        return NGHTTP2_ERR_HTTP_HEADER;
  267|      0|      }
  268|      4|      if (!lstrieq("0", nv->value->base, nv->value->len)) {
  ------------------
  |  |   53|      4|  (nghttp2_strlen_lit((A)) == (N) && memieq((A), (B), (N)))
  |  |  ------------------
  |  |  |  |   69|      4|#define nghttp2_strlen_lit(S) (sizeof(S) - 1)
  |  |  ------------------
  |  |  |  Branch (53:4): [True: 3, False: 1]
  |  |  |  Branch (53:38): [True: 1, False: 2]
  |  |  ------------------
  ------------------
  269|      3|        return NGHTTP2_ERR_HTTP_HEADER;
  270|      3|      }
  271|      1|      stream->content_length = 0;
  272|      1|      return NGHTTP2_ERR_REMOVE_HTTP_HEADER;
  273|      4|    }
  274|     98|    if (stream->status_code / 100 == 1) {
  ------------------
  |  Branch (274:9): [True: 0, False: 98]
  ------------------
  275|      0|      return NGHTTP2_ERR_HTTP_HEADER;
  276|      0|    }
  277|       |    /* https://tools.ietf.org/html/rfc7230#section-3.3.3 */
  278|     98|    if (stream->status_code / 100 == 2 &&
  ------------------
  |  Branch (278:9): [True: 3, False: 95]
  ------------------
  279|      3|        (stream->http_flags & NGHTTP2_HTTP_FLAG_METH_CONNECT)) {
  ------------------
  |  Branch (279:9): [True: 0, False: 3]
  ------------------
  280|      0|      return NGHTTP2_ERR_REMOVE_HTTP_HEADER;
  281|      0|    }
  282|     98|    if (stream->content_length != -1) {
  ------------------
  |  Branch (282:9): [True: 33, False: 65]
  ------------------
  283|     33|      return NGHTTP2_ERR_HTTP_HEADER;
  284|     33|    }
  285|     65|    stream->content_length = parse_uint(nv->value->base, nv->value->len);
  286|     65|    if (stream->content_length == -1) {
  ------------------
  |  Branch (286:9): [True: 27, False: 38]
  ------------------
  287|     27|      return NGHTTP2_ERR_HTTP_HEADER;
  288|     27|    }
  289|     38|    break;
  290|     65|  }
  291|       |  /* disallowed header fields */
  292|     38|  case NGHTTP2_TOKEN_CONNECTION:
  ------------------
  |  Branch (292:3): [True: 0, False: 34.6k]
  ------------------
  293|      5|  case NGHTTP2_TOKEN_KEEP_ALIVE:
  ------------------
  |  Branch (293:3): [True: 5, False: 34.6k]
  ------------------
  294|      5|  case NGHTTP2_TOKEN_PROXY_CONNECTION:
  ------------------
  |  Branch (294:3): [True: 0, False: 34.6k]
  ------------------
  295|      8|  case NGHTTP2_TOKEN_TRANSFER_ENCODING:
  ------------------
  |  Branch (295:3): [True: 3, False: 34.6k]
  ------------------
  296|      9|  case NGHTTP2_TOKEN_UPGRADE:
  ------------------
  |  Branch (296:3): [True: 1, False: 34.6k]
  ------------------
  297|      9|    return NGHTTP2_ERR_HTTP_HEADER;
  298|  1.20k|  case NGHTTP2_TOKEN_TE:
  ------------------
  |  Branch (298:3): [True: 1.20k, False: 33.4k]
  ------------------
  299|  1.20k|    if (!lstrieq("trailers", nv->value->base, nv->value->len)) {
  ------------------
  |  |   53|  1.20k|  (nghttp2_strlen_lit((A)) == (N) && memieq((A), (B), (N)))
  |  |  ------------------
  |  |  |  |   69|  1.20k|#define nghttp2_strlen_lit(S) (sizeof(S) - 1)
  |  |  ------------------
  |  |  |  Branch (53:4): [True: 1.20k, False: 2]
  |  |  |  Branch (53:38): [True: 1.17k, False: 24]
  |  |  ------------------
  ------------------
  300|     26|      return NGHTTP2_ERR_HTTP_HEADER;
  301|     26|    }
  302|  1.17k|    break;
  303|  32.0k|  default:
  ------------------
  |  Branch (303:3): [True: 32.0k, False: 2.53k]
  ------------------
  304|  32.0k|    if (nv->name->base[0] == ':') {
  ------------------
  |  Branch (304:9): [True: 32, False: 32.0k]
  ------------------
  305|     32|      return NGHTTP2_ERR_HTTP_HEADER;
  306|     32|    }
  307|  34.6k|  }
  308|       |
  309|  34.4k|  if (nv->name->base[0] != ':') {
  ------------------
  |  Branch (309:7): [True: 33.2k, False: 1.20k]
  ------------------
  310|  33.2k|    stream->http_flags |= NGHTTP2_HTTP_FLAG_PSEUDO_HEADER_DISALLOWED;
  311|  33.2k|  }
  312|       |
  313|  34.4k|  return 0;
  314|  34.6k|}
nghttp2_http.c:expect_response_body:
   87|    234|static int expect_response_body(nghttp2_stream *stream) {
   88|    234|  return (stream->http_flags & NGHTTP2_HTTP_FLAG_METH_HEAD) == 0 &&
  ------------------
  |  Branch (88:10): [True: 233, False: 1]
  ------------------
   89|    233|         stream->status_code / 100 != 1 && stream->status_code != 304 &&
  ------------------
  |  Branch (89:10): [True: 233, False: 0]
  |  Branch (89:44): [True: 216, False: 17]
  ------------------
   90|    216|         stream->status_code != 204;
  ------------------
  |  Branch (90:10): [True: 215, False: 1]
  ------------------
   91|    234|}

nghttp2_map_init:
   36|  4.44k|void nghttp2_map_init(nghttp2_map *map, uint64_t seed, nghttp2_mem *mem) {
   37|  4.44k|  *map = (nghttp2_map){
   38|  4.44k|    .mem = mem,
   39|  4.44k|    .seed = seed,
   40|  4.44k|  };
   41|  4.44k|}
nghttp2_map_free:
   43|  4.44k|void nghttp2_map_free(nghttp2_map *map) {
   44|  4.44k|  if (!map) {
  ------------------
  |  Branch (44:7): [True: 0, False: 4.44k]
  ------------------
   45|      0|    return;
   46|      0|  }
   47|       |
   48|  4.44k|  nghttp2_mem_free(map->mem, map->keys);
   49|  4.44k|}
nghttp2_map_each:
   52|  9.18k|                     void *ptr) {
   53|  9.18k|  int rv;
   54|  9.18k|  size_t i;
   55|  9.18k|  size_t tablelen;
   56|       |
   57|  9.18k|  if (map->size == 0) {
  ------------------
  |  Branch (57:7): [True: 3.57k, False: 5.61k]
  ------------------
   58|  3.57k|    return 0;
   59|  3.57k|  }
   60|       |
   61|  5.61k|  tablelen = (size_t)1 << map->hashbits;
   62|       |
   63|  95.3k|  for (i = 0; i < tablelen; ++i) {
  ------------------
  |  Branch (63:15): [True: 89.7k, False: 5.61k]
  ------------------
   64|  89.7k|    if (map->psl[i] == 0) {
  ------------------
  |  Branch (64:9): [True: 84.1k, False: 5.61k]
  ------------------
   65|  84.1k|      continue;
   66|  84.1k|    }
   67|       |
   68|  5.61k|    rv = func(map->data[i], ptr);
   69|  5.61k|    if (rv != 0) {
  ------------------
  |  Branch (69:9): [True: 0, False: 5.61k]
  ------------------
   70|      0|      return rv;
   71|      0|    }
   72|  5.61k|  }
   73|       |
   74|  5.61k|  return 0;
   75|  5.61k|}
nghttp2_map_insert:
  239|  4.40k|int nghttp2_map_insert(nghttp2_map *map, nghttp2_map_key_type key, void *data) {
  240|  4.40k|  int rv;
  241|  4.40k|  size_t tablelen;
  242|  4.40k|  nghttp2_ssize idx;
  243|       |
  244|  4.40k|  assert(data);
  ------------------
  |  Branch (244:3): [True: 0, False: 4.40k]
  |  Branch (244:3): [True: 4.40k, False: 0]
  ------------------
  245|       |
  246|       |  /* tablelen is incorrect if map->hashbits == 0 which leads to
  247|       |     tablelen = 1, but it is only used to check the load factor, and
  248|       |     it works in this special case. */
  249|  4.40k|  tablelen = (size_t)1 << map->hashbits;
  250|       |
  251|       |  /* Load factor is 7 / 8.  Because tablelen is power of 2, (tablelen
  252|       |     - (tablelen >> 3)) computes tablelen * 7 / 8. */
  253|  4.40k|  if (map->size + 1 >= (tablelen - (tablelen >> 3))) {
  ------------------
  |  Branch (253:7): [True: 4.40k, False: 0]
  ------------------
  254|  4.40k|    rv = map_resize(map, map->hashbits ? map->hashbits + 1
  ------------------
  |  Branch (254:26): [True: 0, False: 4.40k]
  ------------------
  255|  4.40k|                                       : NGHTTP2_INITIAL_HASHBITS);
  ------------------
  |  |   34|  4.40k|#define NGHTTP2_INITIAL_HASHBITS 4
  ------------------
  256|  4.40k|    if (rv != 0) {
  ------------------
  |  Branch (256:9): [True: 0, False: 4.40k]
  ------------------
  257|      0|      return rv;
  258|      0|    }
  259|       |
  260|  4.40k|    idx = map_insert(map, key, data);
  261|  4.40k|    if (idx < 0) {
  ------------------
  |  Branch (261:9): [True: 0, False: 4.40k]
  ------------------
  262|      0|      return (int)idx;
  263|      0|    }
  264|       |
  265|  4.40k|    return 0;
  266|  4.40k|  }
  267|       |
  268|      0|  idx = map_insert(map, key, data);
  269|      0|  if (idx < 0) {
  ------------------
  |  Branch (269:7): [True: 0, False: 0]
  ------------------
  270|      0|    return (int)idx;
  271|      0|  }
  272|       |
  273|       |  /* Resize if psl reaches really large value which is almost
  274|       |     improbable, but just in case. */
  275|      0|  if (map->psl[idx] - 1 < NGHTTP2_MAX_PSL_RESIZE_THRESH) {
  ------------------
  |  |  237|      0|#define NGHTTP2_MAX_PSL_RESIZE_THRESH 128
  ------------------
  |  Branch (275:7): [True: 0, False: 0]
  ------------------
  276|      0|    return 0;
  277|      0|  }
  278|       |
  279|      0|  return map_resize(map, map->hashbits + 1);
  280|      0|}
nghttp2_map_find:
  282|  6.37M|void *nghttp2_map_find(const nghttp2_map *map, nghttp2_map_key_type key) {
  283|  6.37M|  size_t idx;
  284|  6.37M|  size_t psl = 1;
  285|  6.37M|  size_t mask;
  286|       |
  287|  6.37M|  if (map->size == 0) {
  ------------------
  |  Branch (287:7): [True: 25.5k, False: 6.35M]
  ------------------
  288|  25.5k|    return NULL;
  289|  25.5k|  }
  290|       |
  291|  6.35M|  idx = map_index(map, key);
  292|  6.35M|  mask = ((size_t)1 << map->hashbits) - 1;
  293|       |
  294|  6.35M|  for (;;) {
  295|  6.35M|    if (psl > map->psl[idx]) {
  ------------------
  |  Branch (295:9): [True: 7.81k, False: 6.34M]
  ------------------
  296|  7.81k|      return NULL;
  297|  7.81k|    }
  298|       |
  299|  6.34M|    if (map->keys[idx] == key) {
  ------------------
  |  Branch (299:9): [True: 6.34M, False: 128]
  ------------------
  300|  6.34M|      return map->data[idx];
  301|  6.34M|    }
  302|       |
  303|    128|    ++psl;
  304|    128|    idx = (idx + 1) & mask;
  305|    128|  }
  306|  6.35M|}
nghttp2_map_remove:
  308|  2.03k|int nghttp2_map_remove(nghttp2_map *map, nghttp2_map_key_type key) {
  309|  2.03k|  size_t idx;
  310|  2.03k|  size_t dest;
  311|  2.03k|  size_t psl = 1, kpsl;
  312|  2.03k|  size_t mask;
  313|       |
  314|  2.03k|  if (map->size == 0) {
  ------------------
  |  Branch (314:7): [True: 0, False: 2.03k]
  ------------------
  315|      0|    return NGHTTP2_ERR_INVALID_ARGUMENT;
  316|      0|  }
  317|       |
  318|  2.03k|  idx = map_index(map, key);
  319|  2.03k|  mask = ((size_t)1 << map->hashbits) - 1;
  320|       |
  321|  2.03k|  for (;;) {
  322|  2.03k|    if (psl > map->psl[idx]) {
  ------------------
  |  Branch (322:9): [True: 0, False: 2.03k]
  ------------------
  323|      0|      return NGHTTP2_ERR_INVALID_ARGUMENT;
  324|      0|    }
  325|       |
  326|  2.03k|    if (map->keys[idx] == key) {
  ------------------
  |  Branch (326:9): [True: 2.03k, False: 0]
  ------------------
  327|  2.03k|      dest = idx;
  328|  2.03k|      idx = (idx + 1) & mask;
  329|       |
  330|  2.03k|      for (;;) {
  331|  2.03k|        kpsl = map->psl[idx];
  332|  2.03k|        if (kpsl <= 1) {
  ------------------
  |  Branch (332:13): [True: 2.03k, False: 0]
  ------------------
  333|  2.03k|          map->psl[dest] = 0;
  334|  2.03k|          break;
  335|  2.03k|        }
  336|       |
  337|      0|        map_set_entry(map, dest, map->keys[idx], map->data[idx], kpsl - 1);
  338|       |
  339|      0|        dest = idx;
  340|       |
  341|      0|        idx = (idx + 1) & mask;
  342|      0|      }
  343|       |
  344|  2.03k|      --map->size;
  345|       |
  346|  2.03k|      return 0;
  347|  2.03k|    }
  348|       |
  349|      0|    ++psl;
  350|      0|    idx = (idx + 1) & mask;
  351|      0|  }
  352|  2.03k|}
nghttp2_map_size:
  363|  3.57M|size_t nghttp2_map_size(const nghttp2_map *map) { return map->size; }
nghttp2_map.c:map_index:
   85|  6.35M|static size_t map_index(const nghttp2_map *map, nghttp2_map_key_type key32) {
   86|  6.35M|  uint64_t key = (uint64_t)key32;
   87|       |
   88|  6.35M|  key += map->seed;
   89|  6.35M|  key *= NGHTTP2_MAP_HASHER;
  ------------------
  |  |   80|  6.35M|#define NGHTTP2_MAP_HASHER 0xf1357aea2e62a9c5ull
  ------------------
   90|  6.35M|  return (size_t)((key * NGHTTP2_MAP_FIBO) >> (64 - map->hashbits));
  ------------------
  |  |   83|  6.35M|#define NGHTTP2_MAP_FIBO 0x9e3779b97f4a7c15ull
  ------------------
   91|  6.35M|}
nghttp2_map.c:map_resize:
  180|  4.40k|static int map_resize(nghttp2_map *map, size_t new_hashbits) {
  181|  4.40k|  size_t i;
  182|  4.40k|  size_t tablelen;
  183|  4.40k|  nghttp2_ssize idx;
  184|  4.40k|  nghttp2_map new_map = {
  185|  4.40k|    .mem = map->mem,
  186|  4.40k|    .seed = map->seed,
  187|  4.40k|    .hashbits = new_hashbits,
  188|  4.40k|  };
  189|  4.40k|  void *buf;
  190|  4.40k|  (void)idx;
  191|       |
  192|  4.40k|  if (new_hashbits > NGHTTP2_MAP_MAX_HASHBITS) {
  ------------------
  |  |  178|  4.40k|#define NGHTTP2_MAP_MAX_HASHBITS (sizeof(size_t) * 8 - 1)
  ------------------
  |  Branch (192:7): [True: 0, False: 4.40k]
  ------------------
  193|      0|    return NGHTTP2_ERR_NOMEM;
  194|      0|  }
  195|       |
  196|  4.40k|  tablelen = (size_t)1 << new_hashbits;
  197|       |
  198|  4.40k|  buf = nghttp2_mem_calloc(map->mem, tablelen,
  199|  4.40k|                           sizeof(nghttp2_map_key_type) + sizeof(void *) +
  200|  4.40k|                             sizeof(uint8_t));
  201|  4.40k|  if (buf == NULL) {
  ------------------
  |  Branch (201:7): [True: 0, False: 4.40k]
  ------------------
  202|      0|    return NGHTTP2_ERR_NOMEM;
  203|      0|  }
  204|       |
  205|  4.40k|  new_map.keys = buf;
  206|  4.40k|  new_map.data =
  207|  4.40k|    (void *)((uint8_t *)new_map.keys + tablelen * sizeof(nghttp2_map_key_type));
  208|  4.40k|  new_map.psl = (uint8_t *)new_map.data + tablelen * sizeof(void *);
  209|       |
  210|  4.40k|  if (map->size) {
  ------------------
  |  Branch (210:7): [True: 0, False: 4.40k]
  ------------------
  211|      0|    tablelen = (size_t)1 << map->hashbits;
  212|       |
  213|      0|    for (i = 0; i < tablelen; ++i) {
  ------------------
  |  Branch (213:17): [True: 0, False: 0]
  ------------------
  214|      0|      if (map->psl[i] == 0) {
  ------------------
  |  Branch (214:11): [True: 0, False: 0]
  ------------------
  215|      0|        continue;
  216|      0|      }
  217|       |
  218|      0|      idx = map_insert(&new_map, map->keys[i], map->data[i]);
  219|       |
  220|       |      /* map_insert must not fail because all keys are unique during
  221|       |         resize. */
  222|      0|      assert(idx >= 0);
  ------------------
  |  Branch (222:7): [True: 0, False: 0]
  |  Branch (222:7): [True: 0, False: 0]
  ------------------
  223|      0|    }
  224|      0|  }
  225|       |
  226|  4.40k|  nghttp2_mem_free(map->mem, map->keys);
  227|  4.40k|  map->keys = new_map.keys;
  228|  4.40k|  map->data = new_map.data;
  229|  4.40k|  map->psl = new_map.psl;
  230|  4.40k|  map->hashbits = new_hashbits;
  231|       |
  232|  4.40k|  return 0;
  233|  4.40k|}
nghttp2_map.c:map_insert:
  142|  4.40k|                                void *data) {
  143|  4.40k|  size_t idx = map_index(map, key);
  144|  4.40k|  size_t mask = ((size_t)1 << map->hashbits) - 1;
  145|  4.40k|  size_t psl = 1;
  146|  4.40k|  size_t kpsl;
  147|       |
  148|  4.40k|  for (;;) {
  149|  4.40k|    kpsl = map->psl[idx];
  150|       |
  151|  4.40k|    if (kpsl == 0) {
  ------------------
  |  Branch (151:9): [True: 4.40k, False: 0]
  ------------------
  152|  4.40k|      map_set_entry(map, idx, key, data, psl);
  153|  4.40k|      ++map->size;
  154|       |
  155|  4.40k|      return (nghttp2_ssize)idx;
  156|  4.40k|    }
  157|       |
  158|      0|    if (psl > kpsl) {
  ------------------
  |  Branch (158:9): [True: 0, False: 0]
  ------------------
  159|      0|      NGHTTP2_SWAP(nghttp2_map_key_type, &key, &map->keys[idx]);
  ------------------
  |  |  126|      0|  do {                                                                         \
  |  |  127|      0|    TYPE t = (TYPE) * (A);                                                     \
  |  |  128|      0|                                                                               \
  |  |  129|      0|    *(A) = *(B);                                                               \
  |  |  130|      0|    *(B) = t;                                                                  \
  |  |  131|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (131:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  160|      0|      NGHTTP2_SWAP(void *, &data, &map->data[idx]);
  ------------------
  |  |  126|      0|  do {                                                                         \
  |  |  127|      0|    TYPE t = (TYPE) * (A);                                                     \
  |  |  128|      0|                                                                               \
  |  |  129|      0|    *(A) = *(B);                                                               \
  |  |  130|      0|    *(B) = t;                                                                  \
  |  |  131|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (131:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  161|      0|      NGHTTP2_SWAP(uint8_t, &psl, &map->psl[idx]);
  ------------------
  |  |  126|      0|  do {                                                                         \
  |  |  127|      0|    TYPE t = (TYPE) * (A);                                                     \
  |  |  128|      0|                                                                               \
  |  |  129|      0|    *(A) = *(B);                                                               \
  |  |  130|      0|    *(B) = t;                                                                  \
  |  |  131|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (131:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  162|      0|    } else if (map->keys[idx] == key) {
  ------------------
  |  Branch (162:16): [True: 0, False: 0]
  ------------------
  163|       |      /* This check ensures that no duplicate keys are inserted.  But
  164|       |         it is just a waste after first swap or if this function is
  165|       |         called from map_resize.  That said, there is no difference
  166|       |         with or without this conditional in performance wise. */
  167|      0|      return NGHTTP2_ERR_INVALID_ARGUMENT;
  168|      0|    }
  169|       |
  170|      0|    ++psl;
  171|      0|    idx = (idx + 1) & mask;
  172|      0|  }
  173|  4.40k|}
nghttp2_map.c:map_set_entry:
  119|  4.40k|                          nghttp2_map_key_type key, void *data, size_t psl) {
  120|  4.40k|  map->keys[idx] = key;
  121|  4.40k|  map->data[idx] = data;
  122|  4.40k|  map->psl[idx] = (uint8_t)psl;
  123|  4.40k|}

nghttp2_mem_malloc:
   56|   236k|void *nghttp2_mem_malloc(nghttp2_mem *mem, size_t size) {
   57|   236k|  return mem->malloc(size, mem->mem_user_data);
   58|   236k|}
nghttp2_mem_free:
   60|   246k|void nghttp2_mem_free(nghttp2_mem *mem, void *ptr) {
   61|   246k|  mem->free(ptr, mem->mem_user_data);
   62|   246k|}
nghttp2_mem_free2:
   64|  99.4k|void nghttp2_mem_free2(nghttp2_free free_func, void *ptr, void *mem_user_data) {
   65|  99.4k|  free_func(ptr, mem_user_data);
   66|  99.4k|}
nghttp2_mem_calloc:
   68|  8.85k|void *nghttp2_mem_calloc(nghttp2_mem *mem, size_t nmemb, size_t size) {
   69|  8.85k|  return mem->calloc(nmemb, size, mem->mem_user_data);
   70|  8.85k|}
nghttp2_mem_realloc:
   72|  5.02k|void *nghttp2_mem_realloc(nghttp2_mem *mem, void *ptr, size_t size) {
   73|  5.02k|  return mem->realloc(ptr, size, mem->mem_user_data);
   74|  5.02k|}

nghttp2_option_new:
   29|  4.44k|int nghttp2_option_new(nghttp2_option **option_ptr) {
   30|  4.44k|  *option_ptr = calloc(1, sizeof(nghttp2_option));
   31|       |
   32|  4.44k|  if (*option_ptr == NULL) {
  ------------------
  |  Branch (32:7): [True: 0, False: 4.44k]
  ------------------
   33|      0|    return NGHTTP2_ERR_NOMEM;
   34|      0|  }
   35|       |
   36|  4.44k|  return 0;
   37|  4.44k|}
nghttp2_option_del:
   39|  4.44k|void nghttp2_option_del(nghttp2_option *option) { free(option); }
nghttp2_option_set_no_auto_window_update:
   41|  4.44k|void nghttp2_option_set_no_auto_window_update(nghttp2_option *option, int val) {
   42|  4.44k|  option->opt_set_mask |= NGHTTP2_OPT_NO_AUTO_WINDOW_UPDATE;
   43|  4.44k|  option->no_auto_window_update = val;
   44|  4.44k|}
nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation:
  141|  4.44k|  nghttp2_option *option, int val) {
  142|  4.44k|  option->opt_set_mask |=
  143|  4.44k|    NGHTTP2_OPT_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION;
  144|  4.44k|  option->no_rfc9113_leading_and_trailing_ws_validation = val;
  145|  4.44k|}

nghttp2_data_provider_wrap_v1:
   32|  4.40k|                              const nghttp2_data_provider *data_prd) {
   33|  4.40k|  if (!data_prd) {
  ------------------
  |  Branch (33:7): [True: 3.91k, False: 487]
  ------------------
   34|  3.91k|    return NULL;
   35|  3.91k|  }
   36|       |
   37|    487|  dpw->version = NGHTTP2_DATA_PROVIDER_V1;
  ------------------
  |  |   36|    487|#define NGHTTP2_DATA_PROVIDER_V1 1
  ------------------
   38|    487|  dpw->data_prd.v1 = *data_prd;
   39|       |
   40|    487|  return dpw;
   41|  4.40k|}
nghttp2_data_provider_wrap_contains_read_callback:
   57|  5.37k|  const nghttp2_data_provider_wrap *dpw) {
   58|  5.37k|  switch (dpw->version) {
   59|  1.46k|  case NGHTTP2_DATA_PROVIDER_V1:
  ------------------
  |  |   36|  1.46k|#define NGHTTP2_DATA_PROVIDER_V1 1
  ------------------
  |  Branch (59:3): [True: 1.46k, False: 3.91k]
  ------------------
   60|  1.46k|    return dpw->data_prd.v1.read_callback != NULL;
   61|      0|  case NGHTTP2_DATA_PROVIDER_V2:
  ------------------
  |  |   37|      0|#define NGHTTP2_DATA_PROVIDER_V2 2
  ------------------
  |  Branch (61:3): [True: 0, False: 5.37k]
  ------------------
   62|      0|    return dpw->data_prd.v2.read_callback != NULL;
   63|  3.91k|  default:
  ------------------
  |  Branch (63:3): [True: 3.91k, False: 1.46k]
  ------------------
   64|  3.91k|    return 0;
   65|  5.37k|  }
   66|  5.37k|}
nghttp2_outbound_item_init:
   68|  34.3k|void nghttp2_outbound_item_init(nghttp2_outbound_item *item) {
   69|  34.3k|  item->cycle = 0;
   70|  34.3k|  item->qnext = NULL;
   71|  34.3k|  item->queued = 0;
   72|       |
   73|  34.3k|  memset(&item->aux_data, 0, sizeof(nghttp2_aux_data));
   74|  34.3k|}
nghttp2_outbound_item_free:
   76|  59.2k|void nghttp2_outbound_item_free(nghttp2_outbound_item *item, nghttp2_mem *mem) {
   77|  59.2k|  nghttp2_frame *frame;
   78|       |
   79|  59.2k|  if (item == NULL) {
  ------------------
  |  Branch (79:7): [True: 24.8k, False: 34.3k]
  ------------------
   80|  24.8k|    return;
   81|  24.8k|  }
   82|       |
   83|  34.3k|  frame = &item->frame;
   84|       |
   85|  34.3k|  switch (frame->hd.type) {
   86|    487|  case NGHTTP2_DATA:
  ------------------
  |  Branch (86:3): [True: 487, False: 33.8k]
  ------------------
   87|    487|    nghttp2_frame_data_free(&frame->data);
   88|    487|    break;
   89|  4.40k|  case NGHTTP2_HEADERS:
  ------------------
  |  Branch (89:3): [True: 4.40k, False: 29.9k]
  ------------------
   90|  4.40k|    nghttp2_frame_headers_free(&frame->headers, mem);
   91|  4.40k|    break;
   92|      0|  case NGHTTP2_PRIORITY:
  ------------------
  |  Branch (92:3): [True: 0, False: 34.3k]
  ------------------
   93|      0|    nghttp2_frame_priority_free(&frame->priority);
   94|      0|    break;
   95|  4.03k|  case NGHTTP2_RST_STREAM:
  ------------------
  |  Branch (95:3): [True: 4.03k, False: 30.3k]
  ------------------
   96|  4.03k|    nghttp2_frame_rst_stream_free(&frame->rst_stream);
   97|  4.03k|    break;
   98|  8.43k|  case NGHTTP2_SETTINGS:
  ------------------
  |  Branch (98:3): [True: 8.43k, False: 25.9k]
  ------------------
   99|  8.43k|    nghttp2_frame_settings_free(&frame->settings, mem);
  100|  8.43k|    break;
  101|      0|  case NGHTTP2_PUSH_PROMISE:
  ------------------
  |  Branch (101:3): [True: 0, False: 34.3k]
  ------------------
  102|      0|    nghttp2_frame_push_promise_free(&frame->push_promise, mem);
  103|      0|    break;
  104|     98|  case NGHTTP2_PING:
  ------------------
  |  Branch (104:3): [True: 98, False: 34.2k]
  ------------------
  105|     98|    nghttp2_frame_ping_free(&frame->ping);
  106|     98|    break;
  107|  3.85k|  case NGHTTP2_GOAWAY:
  ------------------
  |  Branch (107:3): [True: 3.85k, False: 30.4k]
  ------------------
  108|  3.85k|    nghttp2_frame_goaway_free(&frame->goaway, mem);
  109|  3.85k|    break;
  110|  13.0k|  case NGHTTP2_WINDOW_UPDATE:
  ------------------
  |  Branch (110:3): [True: 13.0k, False: 21.3k]
  ------------------
  111|  13.0k|    nghttp2_frame_window_update_free(&frame->window_update);
  112|  13.0k|    break;
  113|      0|  default: {
  ------------------
  |  Branch (113:3): [True: 0, False: 34.3k]
  ------------------
  114|      0|    nghttp2_ext_aux_data *aux_data;
  115|       |
  116|      0|    aux_data = &item->aux_data.ext;
  117|       |
  118|      0|    if (aux_data->builtin == 0) {
  ------------------
  |  Branch (118:9): [True: 0, False: 0]
  ------------------
  119|      0|      nghttp2_frame_extension_free(&frame->ext);
  120|      0|      break;
  121|      0|    }
  122|       |
  123|      0|    switch (frame->hd.type) {
  124|      0|    case NGHTTP2_ALTSVC:
  ------------------
  |  Branch (124:5): [True: 0, False: 0]
  ------------------
  125|      0|      nghttp2_frame_altsvc_free(&frame->ext, mem);
  126|      0|      break;
  127|      0|    case NGHTTP2_ORIGIN:
  ------------------
  |  Branch (127:5): [True: 0, False: 0]
  ------------------
  128|      0|      nghttp2_frame_origin_free(&frame->ext, mem);
  129|      0|      break;
  130|      0|    case NGHTTP2_PRIORITY_UPDATE:
  ------------------
  |  Branch (130:5): [True: 0, False: 0]
  ------------------
  131|      0|      nghttp2_frame_priority_update_free(&frame->ext, mem);
  132|      0|      break;
  133|      0|    default:
  ------------------
  |  Branch (133:5): [True: 0, False: 0]
  ------------------
  134|      0|      assert(0);
  ------------------
  |  Branch (134:7): [Folded, False: 0]
  |  Branch (134:7): [Folded, False: 0]
  ------------------
  135|      0|      break;
  136|      0|    }
  137|      0|  }
  138|  34.3k|  }
  139|  34.3k|}
nghttp2_outbound_queue_push:
  147|  33.8k|                                 nghttp2_outbound_item *item) {
  148|  33.8k|  if (q->tail) {
  ------------------
  |  Branch (148:7): [True: 9.30k, False: 24.5k]
  ------------------
  149|  9.30k|    q->tail = q->tail->qnext = item;
  150|  24.5k|  } else {
  151|  24.5k|    q->head = q->tail = item;
  152|  24.5k|  }
  153|  33.8k|  ++q->n;
  154|  33.8k|}
nghttp2_outbound_queue_pop:
  156|  33.8k|void nghttp2_outbound_queue_pop(nghttp2_outbound_queue *q) {
  157|  33.8k|  nghttp2_outbound_item *item;
  158|  33.8k|  if (!q->head) {
  ------------------
  |  Branch (158:7): [True: 0, False: 33.8k]
  ------------------
  159|      0|    return;
  160|      0|  }
  161|  33.8k|  item = q->head;
  162|  33.8k|  q->head = q->head->qnext;
  163|  33.8k|  item->qnext = NULL;
  164|  33.8k|  if (!q->head) {
  ------------------
  |  Branch (164:7): [True: 24.5k, False: 9.30k]
  ------------------
  165|       |    q->tail = NULL;
  166|  24.5k|  }
  167|  33.8k|  --q->n;
  168|  33.8k|}

nghttp2_pq_init:
   32|  35.5k|void nghttp2_pq_init(nghttp2_pq *pq, nghttp2_less less, nghttp2_mem *mem) {
   33|  35.5k|  pq->mem = mem;
   34|  35.5k|  pq->capacity = 0;
   35|       |  pq->q = NULL;
   36|  35.5k|  pq->length = 0;
   37|  35.5k|  pq->less = less;
   38|  35.5k|}
nghttp2_pq_free:
   40|  35.5k|void nghttp2_pq_free(nghttp2_pq *pq) {
   41|  35.5k|  nghttp2_mem_free(pq->mem, pq->q);
   42|       |  pq->q = NULL;
   43|  35.5k|}
nghttp2_pq_push:
   67|    555|int nghttp2_pq_push(nghttp2_pq *pq, nghttp2_pq_entry *item) {
   68|    555|  if (pq->capacity <= pq->length) {
  ------------------
  |  Branch (68:7): [True: 487, False: 68]
  ------------------
   69|    487|    void *nq;
   70|    487|    size_t ncapacity;
   71|       |
   72|    487|    ncapacity = nghttp2_max_size(4, (pq->capacity * 2));
   73|       |
   74|    487|    nq = nghttp2_mem_realloc(pq->mem, pq->q,
   75|    487|                             ncapacity * sizeof(nghttp2_pq_entry *));
   76|    487|    if (nq == NULL) {
  ------------------
  |  Branch (76:9): [True: 0, False: 487]
  ------------------
   77|      0|      return NGHTTP2_ERR_NOMEM;
   78|      0|    }
   79|    487|    pq->capacity = ncapacity;
   80|    487|    pq->q = nq;
   81|    487|  }
   82|    555|  pq->q[pq->length] = item;
   83|    555|  item->index = pq->length;
   84|    555|  ++pq->length;
   85|    555|  bubble_up(pq, pq->length - 1);
   86|    555|  return 0;
   87|    555|}
nghttp2_pq_top:
   89|   144k|nghttp2_pq_entry *nghttp2_pq_top(nghttp2_pq *pq) {
   90|   144k|  if (pq->length == 0) {
  ------------------
  |  Branch (90:7): [True: 143k, False: 916]
  ------------------
   91|   143k|    return NULL;
   92|   143k|  } else {
   93|    916|    return pq->q[0];
   94|    916|  }
   95|   144k|}
nghttp2_pq_pop:
  118|    548|void nghttp2_pq_pop(nghttp2_pq *pq) {
  119|    548|  if (pq->length > 0) {
  ------------------
  |  Branch (119:7): [True: 548, False: 0]
  ------------------
  120|    548|    pq->q[0] = pq->q[pq->length - 1];
  121|    548|    pq->q[0]->index = 0;
  122|    548|    --pq->length;
  123|    548|    bubble_down(pq, 0);
  124|    548|  }
  125|    548|}
nghttp2_pq_remove:
  127|    548|void nghttp2_pq_remove(nghttp2_pq *pq, nghttp2_pq_entry *item) {
  128|    548|  assert(pq->q[item->index] == item);
  ------------------
  |  Branch (128:3): [True: 0, False: 548]
  |  Branch (128:3): [True: 548, False: 0]
  ------------------
  129|       |
  130|    548|  if (item->index == 0) {
  ------------------
  |  Branch (130:7): [True: 548, False: 0]
  ------------------
  131|    548|    nghttp2_pq_pop(pq);
  132|    548|    return;
  133|    548|  }
  134|       |
  135|      0|  if (item->index == pq->length - 1) {
  ------------------
  |  Branch (135:7): [True: 0, False: 0]
  ------------------
  136|      0|    --pq->length;
  137|      0|    return;
  138|      0|  }
  139|       |
  140|      0|  pq->q[item->index] = pq->q[pq->length - 1];
  141|      0|  pq->q[item->index]->index = item->index;
  142|      0|  --pq->length;
  143|       |
  144|      0|  if (pq->less(item, pq->q[item->index])) {
  ------------------
  |  Branch (144:7): [True: 0, False: 0]
  ------------------
  145|      0|    bubble_down(pq, item->index);
  146|      0|  } else {
  147|      0|    bubble_up(pq, item->index);
  148|      0|  }
  149|      0|}
nghttp2_pq_empty:
  151|  47.6M|int nghttp2_pq_empty(nghttp2_pq *pq) { return pq->length == 0; }
nghttp2_pq.c:bubble_up:
   55|    555|static void bubble_up(nghttp2_pq *pq, size_t index) {
   56|    555|  size_t parent;
   57|    555|  while (index != 0) {
  ------------------
  |  Branch (57:10): [True: 0, False: 555]
  ------------------
   58|      0|    parent = (index - 1) / 2;
   59|      0|    if (!pq->less(pq->q[index], pq->q[parent])) {
  ------------------
  |  Branch (59:9): [True: 0, False: 0]
  ------------------
   60|      0|      return;
   61|      0|    }
   62|      0|    swap(pq, parent, index);
   63|      0|    index = parent;
   64|      0|  }
   65|    555|}
nghttp2_pq.c:bubble_down:
   97|    548|static void bubble_down(nghttp2_pq *pq, size_t index) {
   98|    548|  size_t i, j, minindex;
   99|    548|  for (;;) {
  100|    548|    j = index * 2 + 1;
  101|    548|    minindex = index;
  102|    548|    for (i = 0; i < 2; ++i, ++j) {
  ------------------
  |  Branch (102:17): [True: 548, False: 0]
  ------------------
  103|    548|      if (j >= pq->length) {
  ------------------
  |  Branch (103:11): [True: 548, False: 0]
  ------------------
  104|    548|        break;
  105|    548|      }
  106|      0|      if (pq->less(pq->q[j], pq->q[minindex])) {
  ------------------
  |  Branch (106:11): [True: 0, False: 0]
  ------------------
  107|      0|        minindex = j;
  108|      0|      }
  109|      0|    }
  110|    548|    if (minindex == index) {
  ------------------
  |  Branch (110:9): [True: 548, False: 0]
  ------------------
  111|    548|      return;
  112|    548|    }
  113|      0|    swap(pq, index, minindex);
  114|      0|    index = minindex;
  115|      0|  }
  116|    548|}

nghttp2_priority_spec_init:
   29|  4.93k|                                int exclusive) {
   30|  4.93k|  pri_spec->stream_id = stream_id;
   31|  4.93k|  pri_spec->weight = weight;
   32|  4.93k|  pri_spec->exclusive = exclusive != 0;
   33|  4.93k|}
nghttp2_priority_spec_default_init:
   35|  5.97k|void nghttp2_priority_spec_default_init(nghttp2_priority_spec *pri_spec) {
   36|  5.97k|  pri_spec->stream_id = 0;
   37|  5.97k|  pri_spec->weight = NGHTTP2_DEFAULT_WEIGHT;
  ------------------
  |  |  191|  5.97k|#define NGHTTP2_DEFAULT_WEIGHT 16
  ------------------
   38|  5.97k|  pri_spec->exclusive = 0;
   39|  5.97k|}

nghttp2_ratelim_init:
   28|  8.89k|void nghttp2_ratelim_init(nghttp2_ratelim *rl, uint64_t burst, uint64_t rate) {
   29|  8.89k|  rl->val = rl->burst = burst;
   30|  8.89k|  rl->rate = rate;
   31|  8.89k|  rl->tstamp = 0;
   32|  8.89k|}
nghttp2_ratelim_update:
   34|  2.35k|void nghttp2_ratelim_update(nghttp2_ratelim *rl, uint64_t tstamp) {
   35|  2.35k|  uint64_t d, gain;
   36|       |
   37|  2.35k|  if (tstamp == rl->tstamp) {
  ------------------
  |  Branch (37:7): [True: 829, False: 1.52k]
  ------------------
   38|    829|    return;
   39|    829|  }
   40|       |
   41|  1.52k|  if (tstamp > rl->tstamp) {
  ------------------
  |  Branch (41:7): [True: 1.52k, False: 0]
  ------------------
   42|  1.52k|    d = tstamp - rl->tstamp;
   43|  1.52k|  } else {
   44|      0|    d = 1;
   45|      0|  }
   46|       |
   47|  1.52k|  rl->tstamp = tstamp;
   48|       |
   49|  1.52k|  if (UINT64_MAX / d < rl->rate) {
  ------------------
  |  Branch (49:7): [True: 0, False: 1.52k]
  ------------------
   50|      0|    rl->val = rl->burst;
   51|       |
   52|      0|    return;
   53|      0|  }
   54|       |
   55|  1.52k|  gain = rl->rate * d;
   56|       |
   57|  1.52k|  if (UINT64_MAX - gain < rl->val) {
  ------------------
  |  Branch (57:7): [True: 0, False: 1.52k]
  ------------------
   58|      0|    rl->val = rl->burst;
   59|       |
   60|      0|    return;
   61|      0|  }
   62|       |
   63|  1.52k|  rl->val += gain;
   64|  1.52k|  rl->val = nghttp2_min_uint64(rl->val, rl->burst);
   65|  1.52k|}
nghttp2_ratelim_drain:
   67|  2.35k|int nghttp2_ratelim_drain(nghttp2_ratelim *rl, uint64_t n) {
   68|  2.35k|  if (rl->val < n) {
  ------------------
  |  Branch (68:7): [True: 0, False: 2.35k]
  ------------------
   69|      0|    return -1;
   70|      0|  }
   71|       |
   72|  2.35k|  rl->val -= n;
   73|       |
   74|  2.35k|  return 0;
   75|  2.35k|}

nghttp2_rcbuf_new:
   34|  99.4k|                      nghttp2_mem *mem) {
   35|  99.4k|  uint8_t *p;
   36|       |
   37|  99.4k|  p = nghttp2_mem_malloc(mem, sizeof(nghttp2_rcbuf) + size);
   38|  99.4k|  if (p == NULL) {
  ------------------
  |  Branch (38:7): [True: 0, False: 99.4k]
  ------------------
   39|      0|    return NGHTTP2_ERR_NOMEM;
   40|      0|  }
   41|       |
   42|  99.4k|  *rcbuf_ptr = (void *)p;
   43|       |
   44|  99.4k|  (*rcbuf_ptr)->mem_user_data = mem->mem_user_data;
   45|  99.4k|  (*rcbuf_ptr)->free = mem->free;
   46|  99.4k|  (*rcbuf_ptr)->base = p + sizeof(nghttp2_rcbuf);
   47|  99.4k|  (*rcbuf_ptr)->len = size;
   48|  99.4k|  (*rcbuf_ptr)->ref = 1;
   49|       |
   50|  99.4k|  return 0;
   51|  99.4k|}
nghttp2_rcbuf_new2:
   54|  81.8k|                       size_t srclen, nghttp2_mem *mem) {
   55|  81.8k|  int rv;
   56|       |
   57|  81.8k|  rv = nghttp2_rcbuf_new(rcbuf_ptr, srclen + 1, mem);
   58|  81.8k|  if (rv != 0) {
  ------------------
  |  Branch (58:7): [True: 0, False: 81.8k]
  ------------------
   59|      0|    return rv;
   60|      0|  }
   61|       |
   62|  81.8k|  (*rcbuf_ptr)->len = srclen;
   63|  81.8k|  *nghttp2_cpymem((*rcbuf_ptr)->base, src, srclen) = '\0';
   64|       |
   65|  81.8k|  return 0;
   66|  81.8k|}
nghttp2_rcbuf_del:
   71|  99.4k|void nghttp2_rcbuf_del(nghttp2_rcbuf *rcbuf) {
   72|  99.4k|  nghttp2_mem_free2(rcbuf->free, rcbuf, rcbuf->mem_user_data);
   73|  99.4k|}
nghttp2_rcbuf_incref:
   75|   125k|void nghttp2_rcbuf_incref(nghttp2_rcbuf *rcbuf) {
   76|   125k|  if (rcbuf->ref == -1) {
  ------------------
  |  Branch (76:7): [True: 28.9k, False: 96.8k]
  ------------------
   77|  28.9k|    return;
   78|  28.9k|  }
   79|       |
   80|  96.8k|  ++rcbuf->ref;
   81|  96.8k|}
nghttp2_rcbuf_decref:
   83|   329k|void nghttp2_rcbuf_decref(nghttp2_rcbuf *rcbuf) {
   84|   329k|  if (rcbuf == NULL || rcbuf->ref == -1) {
  ------------------
  |  Branch (84:7): [True: 103k, False: 225k]
  |  Branch (84:24): [True: 28.9k, False: 196k]
  ------------------
   85|   132k|    return;
   86|   132k|  }
   87|       |
   88|   329k|  assert(rcbuf->ref > 0);
  ------------------
  |  Branch (88:3): [True: 0, False: 196k]
  |  Branch (88:3): [True: 196k, False: 0]
  ------------------
   89|       |
   90|   196k|  if (--rcbuf->ref == 0) {
  ------------------
  |  Branch (90:7): [True: 99.4k, False: 96.8k]
  ------------------
   91|  99.4k|    nghttp2_rcbuf_del(rcbuf);
   92|  99.4k|  }
   93|   196k|}

nghttp2_is_fatal:
   86|  9.70M|int nghttp2_is_fatal(int lib_error_code) {
   87|  9.70M|  return lib_error_code < NGHTTP2_ERR_FATAL;
   88|  9.70M|}
nghttp2_session_terminate_session:
  253|  1.07k|                                      uint32_t error_code) {
  254|  1.07k|  return session_terminate_session(session, session->last_proc_stream_id,
  255|       |                                   error_code, NULL);
  256|  1.07k|}
nghttp2_session_terminate_session_with_reason:
  266|  1.65k|                                                  const char *reason) {
  267|  1.65k|  return session_terminate_session(session, session->last_proc_stream_id,
  268|  1.65k|                                   error_code, reason);
  269|  1.65k|}
nghttp2_session_is_my_stream_id:
  272|  30.1k|                                    int32_t stream_id) {
  273|  30.1k|  int rem;
  274|  30.1k|  if (stream_id == 0) {
  ------------------
  |  Branch (274:7): [True: 3.85k, False: 26.2k]
  ------------------
  275|  3.85k|    return 0;
  276|  3.85k|  }
  277|  26.2k|  rem = stream_id & 0x1;
  278|  26.2k|  if (session->server) {
  ------------------
  |  Branch (278:7): [True: 0, False: 26.2k]
  ------------------
  279|      0|    return rem == 0;
  280|      0|  }
  281|  26.2k|  return rem == 1;
  282|  26.2k|}
nghttp2_session_get_stream:
  285|  6.37M|                                           int32_t stream_id) {
  286|  6.37M|  nghttp2_stream *stream;
  287|       |
  288|  6.37M|  stream = (nghttp2_stream *)nghttp2_map_find(&session->streams, stream_id);
  289|       |
  290|  6.37M|  if (stream == NULL || (stream->flags & NGHTTP2_STREAM_FLAG_CLOSED) ||
  ------------------
  |  Branch (290:7): [True: 28.7k, False: 6.34M]
  |  Branch (290:25): [True: 0, False: 6.34M]
  ------------------
  291|  6.34M|      stream->state == NGHTTP2_STREAM_IDLE) {
  ------------------
  |  Branch (291:7): [True: 0, False: 6.34M]
  ------------------
  292|  28.7k|    return NULL;
  293|  28.7k|  }
  294|       |
  295|  6.34M|  return stream;
  296|  6.37M|}
nghttp2_session_get_stream_raw:
  299|  4.63k|                                               int32_t stream_id) {
  300|  4.63k|  return (nghttp2_stream *)nghttp2_map_find(&session->streams, stream_id);
  301|  4.63k|}
nghttp2_session_client_new3:
  673|  4.44k|                                nghttp2_mem *mem) {
  674|  4.44k|  int rv;
  675|  4.44k|  nghttp2_session *session;
  676|       |
  677|  4.44k|  rv = session_new(&session, callbacks, user_data, 0, option, mem);
  678|       |
  679|  4.44k|  if (rv != 0) {
  ------------------
  |  Branch (679:7): [True: 0, False: 4.44k]
  ------------------
  680|      0|    return rv;
  681|      0|  }
  682|       |  /* IDs for use in client */
  683|  4.44k|  session->next_stream_id = 1;
  684|       |
  685|  4.44k|  *session_ptr = session;
  686|       |
  687|  4.44k|  return 0;
  688|  4.44k|}
nghttp2_session_del:
  790|  4.44k|void nghttp2_session_del(nghttp2_session *session) {
  791|  4.44k|  nghttp2_mem *mem;
  792|  4.44k|  nghttp2_inflight_settings *settings;
  793|  4.44k|  size_t i;
  794|       |
  795|  4.44k|  if (session == NULL) {
  ------------------
  |  Branch (795:7): [True: 0, False: 4.44k]
  ------------------
  796|      0|    return;
  797|      0|  }
  798|       |
  799|  4.44k|  mem = &session->mem;
  800|       |
  801|  8.84k|  for (settings = session->inflight_settings_head; settings;) {
  ------------------
  |  Branch (801:52): [True: 4.39k, False: 4.44k]
  ------------------
  802|  4.39k|    nghttp2_inflight_settings *next = settings->next;
  803|  4.39k|    inflight_settings_del(settings, mem);
  804|  4.39k|    settings = next;
  805|  4.39k|  }
  806|       |
  807|  40.0k|  for (i = 0; i < NGHTTP2_EXTPRI_URGENCY_LEVELS; ++i) {
  ------------------
  |  | 5028|  40.0k|#define NGHTTP2_EXTPRI_URGENCY_LEVELS (NGHTTP2_EXTPRI_URGENCY_LOW + 1)
  |  |  ------------------
  |  |  |  | 5020|  40.0k|#define NGHTTP2_EXTPRI_URGENCY_LOW 7
  |  |  ------------------
  ------------------
  |  Branch (807:15): [True: 35.5k, False: 4.44k]
  ------------------
  808|  35.5k|    nghttp2_pq_free(&session->sched[i].ob_data);
  809|  35.5k|  }
  810|       |
  811|       |  /* Have to free streams first, so that we can check
  812|       |     stream->item->queued */
  813|  4.44k|  nghttp2_map_each(&session->streams, free_streams, session);
  814|  4.44k|  nghttp2_map_free(&session->streams);
  815|       |
  816|  4.44k|  ob_q_free(&session->ob_urgent, mem);
  817|  4.44k|  ob_q_free(&session->ob_reg, mem);
  818|  4.44k|  ob_q_free(&session->ob_syn, mem);
  819|       |
  820|  4.44k|  active_outbound_item_reset(&session->aob, mem);
  821|  4.44k|  session_inbound_frame_reset(session);
  822|  4.44k|  nghttp2_hd_deflate_free(&session->hd_deflater);
  823|  4.44k|  nghttp2_hd_inflate_free(&session->hd_inflater);
  824|  4.44k|  nghttp2_bufs_free(&session->aob.framebufs);
  825|  4.44k|  nghttp2_mem_free(mem, session);
  826|  4.44k|}
nghttp2_session_add_item:
 1015|  34.3k|                             nghttp2_outbound_item *item) {
 1016|       |  /* TODO Return error if stream is not found for the frame requiring
 1017|       |     stream presence. */
 1018|  34.3k|  int rv = 0;
 1019|  34.3k|  nghttp2_stream *stream;
 1020|  34.3k|  nghttp2_frame *frame;
 1021|       |
 1022|  34.3k|  frame = &item->frame;
 1023|  34.3k|  stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
 1024|       |
 1025|  34.3k|  switch (frame->hd.type) {
 1026|    487|  case NGHTTP2_DATA:
  ------------------
  |  Branch (1026:3): [True: 487, False: 33.8k]
  ------------------
 1027|    487|    if (!stream) {
  ------------------
  |  Branch (1027:9): [True: 0, False: 487]
  ------------------
 1028|      0|      return NGHTTP2_ERR_STREAM_CLOSED;
 1029|      0|    }
 1030|       |
 1031|    487|    if (stream->item) {
  ------------------
  |  Branch (1031:9): [True: 0, False: 487]
  ------------------
 1032|      0|      return NGHTTP2_ERR_DATA_EXIST;
 1033|      0|    }
 1034|       |
 1035|    487|    rv = session_attach_stream_item(session, stream, item);
 1036|       |
 1037|    487|    if (rv != 0) {
  ------------------
  |  Branch (1037:9): [True: 0, False: 487]
  ------------------
 1038|      0|      return rv;
 1039|      0|    }
 1040|       |
 1041|    487|    return 0;
 1042|  4.40k|  case NGHTTP2_HEADERS:
  ------------------
  |  Branch (1042:3): [True: 4.40k, False: 29.9k]
  ------------------
 1043|       |    /* We push request HEADERS and push response HEADERS to
 1044|       |       dedicated queue because their transmission is affected by
 1045|       |       SETTINGS_MAX_CONCURRENT_STREAMS */
 1046|       |    /* TODO If 2 HEADERS are submitted for reserved stream, then
 1047|       |       both of them are queued into ob_syn, which is not
 1048|       |       desirable. */
 1049|  4.40k|    if (frame->headers.cat == NGHTTP2_HCAT_REQUEST ||
  ------------------
  |  Branch (1049:9): [True: 4.40k, False: 0]
  ------------------
 1050|  4.40k|        (stream && stream->state == NGHTTP2_STREAM_RESERVED)) {
  ------------------
  |  Branch (1050:10): [True: 0, False: 0]
  |  Branch (1050:20): [True: 0, False: 0]
  ------------------
 1051|  4.40k|      nghttp2_outbound_queue_push(&session->ob_syn, item);
 1052|  4.40k|      item->queued = 1;
 1053|  4.40k|      return 0;
 1054|  4.40k|    }
 1055|       |
 1056|      0|    nghttp2_outbound_queue_push(&session->ob_reg, item);
 1057|      0|    item->queued = 1;
 1058|      0|    return 0;
 1059|  8.43k|  case NGHTTP2_SETTINGS:
  ------------------
  |  Branch (1059:3): [True: 8.43k, False: 25.9k]
  ------------------
 1060|  8.53k|  case NGHTTP2_PING:
  ------------------
  |  Branch (1060:3): [True: 98, False: 34.2k]
  ------------------
 1061|  8.53k|    nghttp2_outbound_queue_push(&session->ob_urgent, item);
 1062|  8.53k|    item->queued = 1;
 1063|  8.53k|    return 0;
 1064|  4.03k|  case NGHTTP2_RST_STREAM:
  ------------------
  |  Branch (1064:3): [True: 4.03k, False: 30.3k]
  ------------------
 1065|  4.03k|    if (stream) {
  ------------------
  |  Branch (1065:9): [True: 3.88k, False: 155]
  ------------------
 1066|  3.88k|      stream->state = NGHTTP2_STREAM_CLOSING;
 1067|  3.88k|    }
 1068|  4.03k|    nghttp2_outbound_queue_push(&session->ob_reg, item);
 1069|  4.03k|    item->queued = 1;
 1070|  4.03k|    return 0;
 1071|      0|  case NGHTTP2_PUSH_PROMISE: {
  ------------------
  |  Branch (1071:3): [True: 0, False: 34.3k]
  ------------------
 1072|      0|    nghttp2_headers_aux_data *aux_data;
 1073|       |
 1074|      0|    aux_data = &item->aux_data.headers;
 1075|       |
 1076|      0|    if (!stream) {
  ------------------
  |  Branch (1076:9): [True: 0, False: 0]
  ------------------
 1077|      0|      return NGHTTP2_ERR_STREAM_CLOSED;
 1078|      0|    }
 1079|       |
 1080|      0|    if (!nghttp2_session_open_stream(
  ------------------
  |  Branch (1080:9): [True: 0, False: 0]
  ------------------
 1081|      0|          session, frame->push_promise.promised_stream_id,
 1082|      0|          NGHTTP2_STREAM_FLAG_NONE, NGHTTP2_STREAM_RESERVED,
 1083|      0|          aux_data->stream_user_data)) {
 1084|      0|      return NGHTTP2_ERR_NOMEM;
 1085|      0|    }
 1086|       |
 1087|      0|    nghttp2_outbound_queue_push(&session->ob_reg, item);
 1088|      0|    item->queued = 1;
 1089|       |
 1090|      0|    return 0;
 1091|      0|  }
 1092|  13.0k|  case NGHTTP2_WINDOW_UPDATE:
  ------------------
  |  Branch (1092:3): [True: 13.0k, False: 21.3k]
  ------------------
 1093|  13.0k|    if (stream) {
  ------------------
  |  Branch (1093:9): [True: 8.58k, False: 4.44k]
  ------------------
 1094|  8.58k|      stream->window_update_queued = 1;
 1095|  8.58k|    } else if (frame->hd.stream_id == 0) {
  ------------------
  |  Branch (1095:16): [True: 4.44k, False: 0]
  ------------------
 1096|  4.44k|      session->window_update_queued = 1;
 1097|  4.44k|    }
 1098|  13.0k|    nghttp2_outbound_queue_push(&session->ob_reg, item);
 1099|  13.0k|    item->queued = 1;
 1100|  13.0k|    return 0;
 1101|  3.85k|  default:
  ------------------
  |  Branch (1101:3): [True: 3.85k, False: 30.4k]
  ------------------
 1102|  3.85k|    nghttp2_outbound_queue_push(&session->ob_reg, item);
 1103|  3.85k|    item->queued = 1;
 1104|  3.85k|    return 0;
 1105|  34.3k|  }
 1106|  34.3k|}
nghttp2_session_add_rst_stream:
 1109|  1.92k|                                   uint32_t error_code) {
 1110|  1.92k|  return nghttp2_session_add_rst_stream_continue(
 1111|  1.92k|    session, stream_id, error_code,
 1112|  1.92k|    /* continue_without_stream = */ 1);
 1113|  1.92k|}
nghttp2_session_add_rst_stream_continue:
 1118|  5.81k|                                            int continue_without_stream) {
 1119|  5.81k|  int rv;
 1120|  5.81k|  nghttp2_outbound_item *item;
 1121|  5.81k|  nghttp2_frame *frame;
 1122|  5.81k|  nghttp2_stream *stream;
 1123|  5.81k|  nghttp2_mem *mem;
 1124|       |
 1125|  5.81k|  mem = &session->mem;
 1126|  5.81k|  stream = nghttp2_session_get_stream(session, stream_id);
 1127|  5.81k|  if (stream && stream->state == NGHTTP2_STREAM_CLOSING) {
  ------------------
  |  Branch (1127:7): [True: 5.66k, False: 155]
  |  Branch (1127:17): [True: 1.78k, False: 3.88k]
  ------------------
 1128|  1.78k|    return 0;
 1129|  1.78k|  }
 1130|       |
 1131|       |  /* Sending RST_STREAM to an idle stream is subject to protocol
 1132|       |     violation.  Historically, nghttp2 allows this.  In order not to
 1133|       |     disrupt the existing applications, we don't error out this case
 1134|       |     and simply ignore it. */
 1135|  4.03k|  if (nghttp2_session_is_my_stream_id(session, stream_id)) {
  ------------------
  |  Branch (1135:7): [True: 3.88k, False: 155]
  ------------------
 1136|  3.88k|    if ((uint32_t)stream_id >= session->next_stream_id) {
  ------------------
  |  Branch (1136:9): [True: 0, False: 3.88k]
  ------------------
 1137|      0|      return 0;
 1138|      0|    }
 1139|  3.88k|  } else if (session->last_recv_stream_id < stream_id) {
  ------------------
  |  Branch (1139:14): [True: 0, False: 155]
  ------------------
 1140|      0|    return 0;
 1141|      0|  }
 1142|       |
 1143|       |  /* Cancel pending request HEADERS in ob_syn if this RST_STREAM
 1144|       |     refers to that stream. */
 1145|  4.03k|  if (!session->server && nghttp2_session_is_my_stream_id(session, stream_id) &&
  ------------------
  |  Branch (1145:7): [True: 4.03k, False: 0]
  |  Branch (1145:27): [True: 3.88k, False: 155]
  ------------------
 1146|  3.88k|      nghttp2_outbound_queue_top(&session->ob_syn)) {
  ------------------
  |  |  192|  3.88k|#define nghttp2_outbound_queue_top(Q) ((Q)->head)
  |  |  ------------------
  |  |  |  Branch (192:39): [True: 0, False: 3.88k]
  |  |  ------------------
  ------------------
 1147|      0|    nghttp2_headers_aux_data *aux_data;
 1148|      0|    nghttp2_frame *headers_frame;
 1149|       |
 1150|      0|    headers_frame = &nghttp2_outbound_queue_top(&session->ob_syn)->frame;
  ------------------
  |  |  192|      0|#define nghttp2_outbound_queue_top(Q) ((Q)->head)
  ------------------
 1151|      0|    assert(headers_frame->hd.type == NGHTTP2_HEADERS);
  ------------------
  |  Branch (1151:5): [True: 0, False: 0]
  |  Branch (1151:5): [True: 0, False: 0]
  ------------------
 1152|       |
 1153|      0|    if (headers_frame->hd.stream_id <= stream_id) {
  ------------------
  |  Branch (1153:9): [True: 0, False: 0]
  ------------------
 1154|      0|      for (item = session->ob_syn.head; item; item = item->qnext) {
  ------------------
  |  Branch (1154:41): [True: 0, False: 0]
  ------------------
 1155|      0|        aux_data = &item->aux_data.headers;
 1156|       |
 1157|      0|        if (item->frame.hd.stream_id < stream_id) {
  ------------------
  |  Branch (1157:13): [True: 0, False: 0]
  ------------------
 1158|      0|          continue;
 1159|      0|        }
 1160|       |
 1161|       |        /* stream_id in ob_syn queue must be strictly increasing.  If
 1162|       |           we found larger ID, then we can break here. */
 1163|      0|        if (item->frame.hd.stream_id > stream_id || aux_data->canceled) {
  ------------------
  |  Branch (1163:13): [True: 0, False: 0]
  |  Branch (1163:53): [True: 0, False: 0]
  ------------------
 1164|      0|          break;
 1165|      0|        }
 1166|       |
 1167|      0|        aux_data->error_code = error_code;
 1168|      0|        aux_data->canceled = 1;
 1169|       |
 1170|      0|        return 0;
 1171|      0|      }
 1172|      0|    }
 1173|      0|  }
 1174|       |
 1175|       |  /* To keep the old behaviour, do not fail if stream was not
 1176|       |     found. */
 1177|  4.03k|  if (!continue_without_stream && !stream) {
  ------------------
  |  Branch (1177:7): [True: 2.67k, False: 1.36k]
  |  Branch (1177:35): [True: 0, False: 2.67k]
  ------------------
 1178|      0|    return 0;
 1179|      0|  }
 1180|       |
 1181|  4.03k|  item = nghttp2_mem_malloc(mem, sizeof(nghttp2_outbound_item));
 1182|  4.03k|  if (item == NULL) {
  ------------------
  |  Branch (1182:7): [True: 0, False: 4.03k]
  ------------------
 1183|      0|    return NGHTTP2_ERR_NOMEM;
 1184|      0|  }
 1185|       |
 1186|  4.03k|  nghttp2_outbound_item_init(item);
 1187|       |
 1188|  4.03k|  frame = &item->frame;
 1189|       |
 1190|  4.03k|  nghttp2_frame_rst_stream_init(&frame->rst_stream, stream_id, error_code);
 1191|       |
 1192|  4.03k|  item->aux_data.rst_stream.continue_without_stream =
 1193|  4.03k|    (uint8_t)(continue_without_stream != 0);
 1194|       |
 1195|  4.03k|  rv = nghttp2_session_add_item(session, item);
 1196|  4.03k|  if (rv != 0) {
  ------------------
  |  Branch (1196:7): [True: 0, False: 4.03k]
  ------------------
 1197|      0|    nghttp2_frame_rst_stream_free(&frame->rst_stream);
 1198|      0|    nghttp2_mem_free(mem, item);
 1199|      0|    return rv;
 1200|      0|  }
 1201|  4.03k|  return 0;
 1202|  4.03k|}
nghttp2_session_open_stream:
 1207|  4.40k|                                            void *stream_user_data) {
 1208|  4.40k|  int rv;
 1209|  4.40k|  nghttp2_stream *stream;
 1210|  4.40k|  int stream_alloc = 0;
 1211|  4.40k|  nghttp2_mem *mem;
 1212|       |
 1213|  4.40k|  mem = &session->mem;
 1214|  4.40k|  stream = nghttp2_session_get_stream_raw(session, stream_id);
 1215|       |
 1216|  4.40k|  if (session->opt_flags &
  ------------------
  |  Branch (1216:7): [True: 4.40k, False: 0]
  ------------------
 1217|  4.40k|      NGHTTP2_OPTMASK_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION) {
 1218|  4.40k|    flags |= NGHTTP2_STREAM_FLAG_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION;
 1219|  4.40k|  }
 1220|       |
 1221|  4.40k|  if (stream) {
  ------------------
  |  Branch (1221:7): [True: 0, False: 4.40k]
  ------------------
 1222|      0|    assert(stream->state == NGHTTP2_STREAM_IDLE);
  ------------------
  |  Branch (1222:5): [True: 0, False: 0]
  |  Branch (1222:5): [True: 0, False: 0]
  ------------------
 1223|      0|    assert(initial_state != NGHTTP2_STREAM_IDLE);
  ------------------
  |  Branch (1223:5): [True: 0, False: 0]
  |  Branch (1223:5): [True: 0, False: 0]
  ------------------
 1224|       |
 1225|      0|    --session->num_idle_streams;
 1226|  4.40k|  } else {
 1227|  4.40k|    stream = nghttp2_mem_malloc(mem, sizeof(nghttp2_stream));
 1228|  4.40k|    if (stream == NULL) {
  ------------------
  |  Branch (1228:9): [True: 0, False: 4.40k]
  ------------------
 1229|      0|      return NULL;
 1230|      0|    }
 1231|       |
 1232|  4.40k|    stream_alloc = 1;
 1233|  4.40k|  }
 1234|       |
 1235|  4.40k|  if (initial_state == NGHTTP2_STREAM_RESERVED) {
  ------------------
  |  Branch (1235:7): [True: 0, False: 4.40k]
  ------------------
 1236|      0|    flags |= NGHTTP2_STREAM_FLAG_PUSH;
 1237|      0|  }
 1238|       |
 1239|  4.40k|  if (stream_alloc) {
  ------------------
  |  Branch (1239:7): [True: 4.40k, False: 0]
  ------------------
 1240|  4.40k|    nghttp2_stream_init(stream, stream_id, flags, initial_state,
 1241|  4.40k|                        (int32_t)session->remote_settings.initial_window_size,
 1242|  4.40k|                        (int32_t)session->local_settings.initial_window_size,
 1243|  4.40k|                        stream_user_data);
 1244|  4.40k|    stream->seq = session->stream_seq++;
 1245|       |
 1246|  4.40k|    rv = nghttp2_map_insert(&session->streams, stream_id, stream);
 1247|  4.40k|    if (rv != 0) {
  ------------------
  |  Branch (1247:9): [True: 0, False: 4.40k]
  ------------------
 1248|      0|      nghttp2_stream_free(stream);
 1249|      0|      nghttp2_mem_free(mem, stream);
 1250|      0|      return NULL;
 1251|      0|    }
 1252|  4.40k|  } else {
 1253|      0|    stream->flags = flags;
 1254|      0|    stream->state = initial_state;
 1255|      0|    stream->stream_user_data = stream_user_data;
 1256|      0|  }
 1257|       |
 1258|  4.40k|  switch (initial_state) {
 1259|      0|  case NGHTTP2_STREAM_RESERVED:
  ------------------
  |  Branch (1259:3): [True: 0, False: 4.40k]
  ------------------
 1260|      0|    if (nghttp2_session_is_my_stream_id(session, stream_id)) {
  ------------------
  |  Branch (1260:9): [True: 0, False: 0]
  ------------------
 1261|       |      /* reserved (local) */
 1262|      0|      nghttp2_stream_shutdown(stream, NGHTTP2_SHUT_RD);
 1263|      0|    } else {
 1264|       |      /* reserved (remote) */
 1265|      0|      nghttp2_stream_shutdown(stream, NGHTTP2_SHUT_WR);
 1266|      0|      ++session->num_incoming_reserved_streams;
 1267|      0|    }
 1268|       |    /* Reserved stream does not count in the concurrent streams
 1269|       |       limit. That is one of the DOS vector. */
 1270|      0|    break;
 1271|      0|  case NGHTTP2_STREAM_IDLE:
  ------------------
  |  Branch (1271:3): [True: 0, False: 4.40k]
  ------------------
 1272|      0|    ++session->num_idle_streams;
 1273|      0|    break;
 1274|  4.40k|  default:
  ------------------
  |  Branch (1274:3): [True: 4.40k, False: 0]
  ------------------
 1275|  4.40k|    if (nghttp2_session_is_my_stream_id(session, stream_id)) {
  ------------------
  |  Branch (1275:9): [True: 4.40k, False: 0]
  ------------------
 1276|  4.40k|      ++session->num_outgoing_streams;
 1277|  4.40k|    } else {
 1278|      0|      ++session->num_incoming_streams;
 1279|      0|    }
 1280|  4.40k|  }
 1281|       |
 1282|  4.40k|  return stream;
 1283|  4.40k|}
nghttp2_session_close_stream:
 1286|  2.17k|                                 uint32_t error_code) {
 1287|  2.17k|  nghttp2_stream *stream;
 1288|  2.17k|  nghttp2_mem *mem;
 1289|  2.17k|  int is_my_stream_id;
 1290|       |
 1291|  2.17k|  mem = &session->mem;
 1292|  2.17k|  stream = nghttp2_session_get_stream(session, stream_id);
 1293|       |
 1294|  2.17k|  if (!stream) {
  ------------------
  |  Branch (1294:7): [True: 139, False: 2.03k]
  ------------------
 1295|    139|    return NGHTTP2_ERR_INVALID_ARGUMENT;
 1296|    139|  }
 1297|       |
 1298|  2.03k|  DEBUGF("stream: stream(%p)=%d close\n", stream, stream->stream_id);
  ------------------
  |  |   39|  2.03k|    do {                                                                       \
  |  |   40|  2.03k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 2.03k]
  |  |  ------------------
  ------------------
 1299|       |
 1300|       |  /* We call on_stream_close_callback even if stream->state is
 1301|       |     NGHTTP2_STREAM_INITIAL. This will happen while sending request
 1302|       |     HEADERS, a local endpoint receives RST_STREAM for that stream. It
 1303|       |     may be PROTOCOL_ERROR, but without notifying stream closure will
 1304|       |     hang the stream in a local endpoint.
 1305|       |  */
 1306|       |
 1307|  2.03k|  if (session->callbacks.on_stream_close_callback) {
  ------------------
  |  Branch (1307:7): [True: 2.03k, False: 0]
  ------------------
 1308|  2.03k|    if (session->callbacks.on_stream_close_callback(
  ------------------
  |  Branch (1308:9): [True: 0, False: 2.03k]
  ------------------
 1309|  2.03k|          session, stream_id, error_code, session->user_data) != 0) {
 1310|      0|      return NGHTTP2_ERR_CALLBACK_FAILURE;
 1311|      0|    }
 1312|  2.03k|  }
 1313|       |
 1314|  2.03k|  if (stream->item) {
  ------------------
  |  Branch (1314:7): [True: 67, False: 1.96k]
  ------------------
 1315|     67|    nghttp2_outbound_item *item;
 1316|       |
 1317|     67|    item = stream->item;
 1318|       |
 1319|     67|    session_detach_stream_item(session, stream);
 1320|       |
 1321|       |    /* If item is queued, it will be deleted when it is popped
 1322|       |       (nghttp2_session_prep_frame() will fail).  If session->aob.item
 1323|       |       points to this item, let active_outbound_item_reset()
 1324|       |       free the item. */
 1325|     67|    if (!item->queued && item != session->aob.item) {
  ------------------
  |  Branch (1325:9): [True: 67, False: 0]
  |  Branch (1325:26): [True: 67, False: 0]
  ------------------
 1326|     67|      nghttp2_outbound_item_free(item, mem);
 1327|     67|      nghttp2_mem_free(mem, item);
 1328|     67|    }
 1329|     67|  }
 1330|       |
 1331|  2.03k|  is_my_stream_id = nghttp2_session_is_my_stream_id(session, stream_id);
 1332|       |
 1333|       |  /* pushed streams which is not opened yet is not counted toward max
 1334|       |     concurrent limits */
 1335|  2.03k|  if ((stream->flags & NGHTTP2_STREAM_FLAG_PUSH)) {
  ------------------
  |  Branch (1335:7): [True: 0, False: 2.03k]
  ------------------
 1336|      0|    if (!is_my_stream_id) {
  ------------------
  |  Branch (1336:9): [True: 0, False: 0]
  ------------------
 1337|      0|      --session->num_incoming_reserved_streams;
 1338|      0|    }
 1339|  2.03k|  } else {
 1340|  2.03k|    if (is_my_stream_id) {
  ------------------
  |  Branch (1340:9): [True: 2.03k, False: 0]
  ------------------
 1341|  2.03k|      --session->num_outgoing_streams;
 1342|  2.03k|    } else {
 1343|      0|      --session->num_incoming_streams;
 1344|      0|    }
 1345|  2.03k|  }
 1346|       |
 1347|       |  /* Closes both directions just in case they are not closed yet */
 1348|  2.03k|  stream->flags |= NGHTTP2_STREAM_FLAG_CLOSED;
 1349|       |
 1350|  2.03k|  nghttp2_session_destroy_stream(session, stream);
 1351|       |
 1352|  2.03k|  return 0;
 1353|  2.03k|}
nghttp2_session_destroy_stream:
 1356|  2.03k|                                    nghttp2_stream *stream) {
 1357|  2.03k|  nghttp2_mem *mem;
 1358|       |
 1359|  2.03k|  DEBUGF("stream: destroy closed stream(%p)=%d\n", stream, stream->stream_id);
  ------------------
  |  |   39|  2.03k|    do {                                                                       \
  |  |   40|  2.03k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 2.03k]
  |  |  ------------------
  ------------------
 1360|       |
 1361|  2.03k|  mem = &session->mem;
 1362|       |
 1363|  2.03k|  if (stream->queued) {
  ------------------
  |  Branch (1363:7): [True: 0, False: 2.03k]
  ------------------
 1364|      0|    session_ob_data_remove(session, stream);
 1365|      0|  }
 1366|       |
 1367|  2.03k|  nghttp2_map_remove(&session->streams, stream->stream_id);
 1368|  2.03k|  nghttp2_stream_free(stream);
 1369|  2.03k|  nghttp2_mem_free(mem, stream);
 1370|  2.03k|}
nghttp2_session_close_stream_if_shut_rdwr:
 1386|  4.84k|                                              nghttp2_stream *stream) {
 1387|  4.84k|  if ((stream->shut_flags & NGHTTP2_SHUT_RDWR) == NGHTTP2_SHUT_RDWR) {
  ------------------
  |  Branch (1387:7): [True: 34, False: 4.81k]
  ------------------
 1388|     34|    return nghttp2_session_close_stream(session, stream->stream_id,
 1389|     34|                                        NGHTTP2_NO_ERROR);
 1390|     34|  }
 1391|  4.81k|  return 0;
 1392|  4.84k|}
nghttp2_session_check_request_allowed:
 1438|  9.48k|int nghttp2_session_check_request_allowed(nghttp2_session *session) {
 1439|  9.48k|  return !session->server && session->next_stream_id <= INT32_MAX &&
  ------------------
  |  Branch (1439:10): [True: 9.48k, False: 0]
  |  Branch (1439:30): [True: 9.48k, False: 0]
  ------------------
 1440|  9.48k|         (session->goaway_flags & NGHTTP2_GOAWAY_RECV) == 0 &&
  ------------------
  |  Branch (1440:10): [True: 9.10k, False: 385]
  ------------------
 1441|  9.10k|         !session_is_closing(session);
  ------------------
  |  Branch (1441:10): [True: 6.61k, False: 2.48k]
  ------------------
 1442|  9.48k|}
nghttp2_session_pop_next_ob_item:
 2327|  52.4k|nghttp2_session_pop_next_ob_item(nghttp2_session *session) {
 2328|  52.4k|  nghttp2_outbound_item *item;
 2329|       |
 2330|  52.4k|  item = nghttp2_outbound_queue_top(&session->ob_urgent);
  ------------------
  |  |  192|  52.4k|#define nghttp2_outbound_queue_top(Q) ((Q)->head)
  ------------------
 2331|  52.4k|  if (item) {
  ------------------
  |  Branch (2331:7): [True: 8.53k, False: 43.9k]
  ------------------
 2332|  8.53k|    nghttp2_outbound_queue_pop(&session->ob_urgent);
 2333|  8.53k|    item->queued = 0;
 2334|  8.53k|    return item;
 2335|  8.53k|  }
 2336|       |
 2337|  43.9k|  item = nghttp2_outbound_queue_top(&session->ob_reg);
  ------------------
  |  |  192|  43.9k|#define nghttp2_outbound_queue_top(Q) ((Q)->head)
  ------------------
 2338|  43.9k|  if (item) {
  ------------------
  |  Branch (2338:7): [True: 20.9k, False: 23.0k]
  ------------------
 2339|  20.9k|    nghttp2_outbound_queue_pop(&session->ob_reg);
 2340|  20.9k|    item->queued = 0;
 2341|  20.9k|    return item;
 2342|  20.9k|  }
 2343|       |
 2344|  23.0k|  if (!session_is_outgoing_concurrent_streams_max(session)) {
  ------------------
  |  Branch (2344:7): [True: 22.9k, False: 43]
  ------------------
 2345|  22.9k|    item = nghttp2_outbound_queue_top(&session->ob_syn);
  ------------------
  |  |  192|  22.9k|#define nghttp2_outbound_queue_top(Q) ((Q)->head)
  ------------------
 2346|  22.9k|    if (item) {
  ------------------
  |  Branch (2346:9): [True: 4.40k, False: 18.5k]
  ------------------
 2347|  4.40k|      nghttp2_outbound_queue_pop(&session->ob_syn);
 2348|  4.40k|      item->queued = 0;
 2349|  4.40k|      return item;
 2350|  4.40k|    }
 2351|  22.9k|  }
 2352|       |
 2353|  18.6k|  if (session->remote_window_size > 0) {
  ------------------
  |  Branch (2353:7): [True: 18.5k, False: 107]
  ------------------
 2354|  18.5k|    return session_sched_get_next_outbound_item(session);
 2355|  18.5k|  }
 2356|       |
 2357|    107|  return NULL;
 2358|  18.6k|}
nghttp2_session_send:
 3154|  17.7k|int nghttp2_session_send(nghttp2_session *session) {
 3155|  17.7k|  const uint8_t *data = NULL;
 3156|  17.7k|  nghttp2_ssize datalen;
 3157|  17.7k|  nghttp2_ssize sentlen;
 3158|  17.7k|  nghttp2_bufs *framebufs;
 3159|       |
 3160|  17.7k|  framebufs = &session->aob.framebufs;
 3161|       |
 3162|  45.9k|  for (;;) {
 3163|  45.9k|    datalen = nghttp2_session_mem_send_internal(session, &data, 0);
 3164|  45.9k|    if (datalen <= 0) {
  ------------------
  |  Branch (3164:9): [True: 17.7k, False: 28.1k]
  ------------------
 3165|  17.7k|      return (int)datalen;
 3166|  17.7k|    }
 3167|  28.1k|    if (session->callbacks.send_callback2) {
  ------------------
  |  Branch (3167:9): [True: 0, False: 28.1k]
  ------------------
 3168|      0|      sentlen = session->callbacks.send_callback2(
 3169|      0|        session, data, (size_t)datalen, 0, session->user_data);
 3170|  28.1k|    } else {
 3171|  28.1k|      sentlen = (nghttp2_ssize)session->callbacks.send_callback(
 3172|  28.1k|        session, data, (size_t)datalen, 0, session->user_data);
 3173|  28.1k|    }
 3174|  28.1k|    if (sentlen < 0) {
  ------------------
  |  Branch (3174:9): [True: 0, False: 28.1k]
  ------------------
 3175|      0|      if (sentlen == NGHTTP2_ERR_WOULDBLOCK) {
  ------------------
  |  Branch (3175:11): [True: 0, False: 0]
  ------------------
 3176|       |        /* Transmission canceled. Rewind the offset */
 3177|      0|        framebufs->cur->buf.pos -= datalen;
 3178|       |
 3179|      0|        return 0;
 3180|      0|      }
 3181|      0|      return NGHTTP2_ERR_CALLBACK_FAILURE;
 3182|      0|    }
 3183|       |    /* Rewind the offset to the amount of unsent bytes */
 3184|  28.1k|    framebufs->cur->buf.pos -= datalen - sentlen;
 3185|  28.1k|  }
 3186|  17.7k|}
nghttp2_session_on_request_headers_received:
 3828|    230|                                                nghttp2_frame *frame) {
 3829|    230|  int rv = 0;
 3830|    230|  nghttp2_stream *stream;
 3831|    230|  if (frame->hd.stream_id == 0) {
  ------------------
  |  Branch (3831:7): [True: 3, False: 227]
  ------------------
 3832|      3|    return session_inflate_handle_invalid_connection(
 3833|      3|      session, frame, NGHTTP2_ERR_PROTO, "request HEADERS: stream_id == 0");
 3834|      3|  }
 3835|       |
 3836|       |  /* If client receives idle stream from server, it is invalid
 3837|       |     regardless stream ID is even or odd.  This is because client is
 3838|       |     not expected to receive request from server. */
 3839|    227|  if (!session->server) {
  ------------------
  |  Branch (3839:7): [True: 227, False: 0]
  ------------------
 3840|    227|    if (session_detect_idle_stream(session, frame->hd.stream_id)) {
  ------------------
  |  Branch (3840:9): [True: 77, False: 150]
  ------------------
 3841|     77|      return session_inflate_handle_invalid_connection(
 3842|     77|        session, frame, NGHTTP2_ERR_PROTO,
 3843|     77|        "request HEADERS: client received request");
 3844|     77|    }
 3845|       |
 3846|    150|    return NGHTTP2_ERR_IGN_HEADER_BLOCK;
 3847|    227|  }
 3848|       |
 3849|    227|  assert(session->server);
  ------------------
  |  Branch (3849:3): [True: 0, False: 0]
  |  Branch (3849:3): [True: 0, False: 0]
  ------------------
 3850|       |
 3851|      0|  if (!session_is_new_peer_stream_id(session, frame->hd.stream_id)) {
  ------------------
  |  Branch (3851:7): [True: 0, False: 0]
  ------------------
 3852|      0|    if (frame->hd.stream_id == 0 ||
  ------------------
  |  Branch (3852:9): [True: 0, False: 0]
  ------------------
 3853|      0|        nghttp2_session_is_my_stream_id(session, frame->hd.stream_id)) {
  ------------------
  |  Branch (3853:9): [True: 0, False: 0]
  ------------------
 3854|      0|      return session_inflate_handle_invalid_connection(
 3855|      0|        session, frame, NGHTTP2_ERR_PROTO,
 3856|      0|        "request HEADERS: invalid stream_id");
 3857|      0|    }
 3858|       |
 3859|       |    /* RFC 7540 says if an endpoint receives a HEADERS with invalid
 3860|       |     * stream ID (e.g, numerically smaller than previous), it MUST
 3861|       |     * issue connection error with error code PROTOCOL_ERROR.  It is a
 3862|       |     * bit hard to detect this, since we cannot remember all streams
 3863|       |     * we observed so far.
 3864|       |     *
 3865|       |     * You might imagine this is really easy.  But no.  HTTP/2 is
 3866|       |     * asynchronous protocol, and usually client and server do not
 3867|       |     * share the complete picture of open/closed stream status.  For
 3868|       |     * example, after server sends RST_STREAM for a stream, client may
 3869|       |     * send trailer HEADERS for that stream.  If naive server detects
 3870|       |     * that, and issued connection error, then it is a bug of server
 3871|       |     * implementation since client is not wrong if it did not get
 3872|       |     * RST_STREAM when it issued trailer HEADERS.
 3873|       |     *
 3874|       |     * At the moment, we are very conservative here.  We only use
 3875|       |     * connection error if stream ID refers idle stream, or we are
 3876|       |     * sure that stream is half-closed(remote) or closed.  Otherwise
 3877|       |     * we just ignore HEADERS for now.
 3878|       |     */
 3879|      0|    stream = nghttp2_session_get_stream_raw(session, frame->hd.stream_id);
 3880|      0|    if (stream && (stream->shut_flags & NGHTTP2_SHUT_RD)) {
  ------------------
  |  Branch (3880:9): [True: 0, False: 0]
  |  Branch (3880:19): [True: 0, False: 0]
  ------------------
 3881|      0|      return session_inflate_handle_invalid_connection(
 3882|      0|        session, frame, NGHTTP2_ERR_STREAM_CLOSED, "HEADERS: stream closed");
 3883|      0|    }
 3884|       |
 3885|      0|    return NGHTTP2_ERR_IGN_HEADER_BLOCK;
 3886|      0|  }
 3887|      0|  session->last_recv_stream_id = frame->hd.stream_id;
 3888|       |
 3889|      0|  if (session_is_incoming_concurrent_streams_max(session)) {
  ------------------
  |  Branch (3889:7): [True: 0, False: 0]
  ------------------
 3890|      0|    return session_inflate_handle_invalid_connection(
 3891|      0|      session, frame, NGHTTP2_ERR_PROTO,
 3892|      0|      "request HEADERS: max concurrent streams exceeded");
 3893|      0|  }
 3894|       |
 3895|      0|  if (!session_allow_incoming_new_stream(session)) {
  ------------------
  |  Branch (3895:7): [True: 0, False: 0]
  ------------------
 3896|       |    /* We just ignore stream after GOAWAY was sent */
 3897|      0|    return NGHTTP2_ERR_IGN_HEADER_BLOCK;
 3898|      0|  }
 3899|       |
 3900|      0|  if (frame->headers.pri_spec.stream_id == frame->hd.stream_id) {
  ------------------
  |  Branch (3900:7): [True: 0, False: 0]
  ------------------
 3901|      0|    return session_inflate_handle_invalid_connection(
 3902|      0|      session, frame, NGHTTP2_ERR_PROTO, "request HEADERS: depend on itself");
 3903|      0|  }
 3904|       |
 3905|      0|  if (session_is_incoming_concurrent_streams_pending_max(session)) {
  ------------------
  |  Branch (3905:7): [True: 0, False: 0]
  ------------------
 3906|      0|    return session_inflate_handle_invalid_stream(session, frame,
 3907|      0|                                                 NGHTTP2_ERR_REFUSED_STREAM);
 3908|      0|  }
 3909|       |
 3910|      0|  stream = nghttp2_session_open_stream(session, frame->hd.stream_id,
 3911|      0|                                       NGHTTP2_STREAM_FLAG_NONE,
 3912|      0|                                       NGHTTP2_STREAM_OPENING, NULL);
 3913|      0|  if (!stream) {
  ------------------
  |  Branch (3913:7): [True: 0, False: 0]
  ------------------
 3914|      0|    return NGHTTP2_ERR_NOMEM;
 3915|      0|  }
 3916|       |
 3917|      0|  session->last_proc_stream_id = session->last_recv_stream_id;
 3918|       |
 3919|      0|  rv = session_call_on_begin_headers(session, frame);
 3920|      0|  if (rv != 0) {
  ------------------
  |  Branch (3920:7): [True: 0, False: 0]
  ------------------
 3921|      0|    return rv;
 3922|      0|  }
 3923|      0|  return 0;
 3924|      0|}
nghttp2_session_on_response_headers_received:
 3928|  1.79k|                                                 nghttp2_stream *stream) {
 3929|  1.79k|  int rv;
 3930|       |  /* This function is only called if stream->state ==
 3931|       |     NGHTTP2_STREAM_OPENING and stream_id is local side initiated. */
 3932|  1.79k|  assert(stream->state == NGHTTP2_STREAM_OPENING &&
  ------------------
  |  Branch (3932:3): [True: 0, False: 1.79k]
  |  Branch (3932:3): [True: 0, False: 0]
  |  Branch (3932:3): [True: 1.79k, False: 0]
  |  Branch (3932:3): [True: 1.79k, False: 0]
  ------------------
 3933|  1.79k|         nghttp2_session_is_my_stream_id(session, frame->hd.stream_id));
 3934|  1.79k|  if (frame->hd.stream_id == 0) {
  ------------------
  |  Branch (3934:7): [True: 0, False: 1.79k]
  ------------------
 3935|      0|    return session_inflate_handle_invalid_connection(
 3936|      0|      session, frame, NGHTTP2_ERR_PROTO, "response HEADERS: stream_id == 0");
 3937|      0|  }
 3938|  1.79k|  if (stream->shut_flags & NGHTTP2_SHUT_RD) {
  ------------------
  |  Branch (3938:7): [True: 0, False: 1.79k]
  ------------------
 3939|       |    /* half closed (remote): from the spec:
 3940|       |
 3941|       |       If an endpoint receives additional frames for a stream that is
 3942|       |       in this state it MUST respond with a stream error (Section
 3943|       |       5.4.2) of type STREAM_CLOSED.
 3944|       |
 3945|       |       We go further, and make it connection error.
 3946|       |    */
 3947|      0|    return session_inflate_handle_invalid_connection(
 3948|      0|      session, frame, NGHTTP2_ERR_STREAM_CLOSED, "HEADERS: stream closed");
 3949|      0|  }
 3950|  1.79k|  stream->state = NGHTTP2_STREAM_OPENED;
 3951|  1.79k|  rv = session_call_on_begin_headers(session, frame);
 3952|  1.79k|  if (rv != 0) {
  ------------------
  |  Branch (3952:7): [True: 0, False: 1.79k]
  ------------------
 3953|      0|    return rv;
 3954|      0|  }
 3955|  1.79k|  return 0;
 3956|  1.79k|}
nghttp2_session_on_headers_received:
 4005|     69|                                        nghttp2_stream *stream) {
 4006|     69|  int rv = 0;
 4007|     69|  if (frame->hd.stream_id == 0) {
  ------------------
  |  Branch (4007:7): [True: 0, False: 69]
  ------------------
 4008|      0|    return session_inflate_handle_invalid_connection(
 4009|      0|      session, frame, NGHTTP2_ERR_PROTO, "HEADERS: stream_id == 0");
 4010|      0|  }
 4011|     69|  if ((stream->shut_flags & NGHTTP2_SHUT_RD)) {
  ------------------
  |  Branch (4011:7): [True: 2, False: 67]
  ------------------
 4012|       |    /* half closed (remote): from the spec:
 4013|       |
 4014|       |       If an endpoint receives additional frames for a stream that is
 4015|       |       in this state it MUST respond with a stream error (Section
 4016|       |       5.4.2) of type STREAM_CLOSED.
 4017|       |
 4018|       |       we go further, and make it connection error.
 4019|       |    */
 4020|      2|    return session_inflate_handle_invalid_connection(
 4021|      2|      session, frame, NGHTTP2_ERR_STREAM_CLOSED, "HEADERS: stream closed");
 4022|      2|  }
 4023|     67|  if (nghttp2_session_is_my_stream_id(session, frame->hd.stream_id)) {
  ------------------
  |  Branch (4023:7): [True: 67, False: 0]
  ------------------
 4024|     67|    if (stream->state == NGHTTP2_STREAM_OPENED) {
  ------------------
  |  Branch (4024:9): [True: 23, False: 44]
  ------------------
 4025|     23|      rv = session_call_on_begin_headers(session, frame);
 4026|     23|      if (rv != 0) {
  ------------------
  |  Branch (4026:11): [True: 0, False: 23]
  ------------------
 4027|      0|        return rv;
 4028|      0|      }
 4029|     23|      return 0;
 4030|     23|    }
 4031|       |
 4032|     44|    return NGHTTP2_ERR_IGN_HEADER_BLOCK;
 4033|     67|  }
 4034|       |  /* If this is remote peer initiated stream, it is OK unless it
 4035|       |     has sent END_STREAM frame already. But if stream is in
 4036|       |     NGHTTP2_STREAM_CLOSING, we discard the frame. This is a race
 4037|       |     condition. */
 4038|      0|  if (stream->state != NGHTTP2_STREAM_CLOSING) {
  ------------------
  |  Branch (4038:7): [True: 0, False: 0]
  ------------------
 4039|      0|    rv = session_call_on_begin_headers(session, frame);
 4040|      0|    if (rv != 0) {
  ------------------
  |  Branch (4040:9): [True: 0, False: 0]
  ------------------
 4041|      0|      return rv;
 4042|      0|    }
 4043|      0|    return 0;
 4044|      0|  }
 4045|      0|  return NGHTTP2_ERR_IGN_HEADER_BLOCK;
 4046|      0|}
nghttp2_session_on_rst_stream_received:
 4095|    276|                                           nghttp2_frame *frame) {
 4096|    276|  int rv;
 4097|    276|  nghttp2_stream *stream;
 4098|    276|  if (frame->hd.stream_id == 0) {
  ------------------
  |  Branch (4098:7): [True: 1, False: 275]
  ------------------
 4099|      1|    return session_handle_invalid_connection(session, frame, NGHTTP2_ERR_PROTO,
 4100|      1|                                             "RST_STREAM: stream_id == 0");
 4101|      1|  }
 4102|       |
 4103|    275|  if (session_detect_idle_stream(session, frame->hd.stream_id)) {
  ------------------
  |  Branch (4103:7): [True: 31, False: 244]
  ------------------
 4104|     31|    return session_handle_invalid_connection(session, frame, NGHTTP2_ERR_PROTO,
 4105|     31|                                             "RST_STREAM: stream in idle");
 4106|     31|  }
 4107|       |
 4108|    244|  stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
 4109|    244|  if (stream) {
  ------------------
  |  Branch (4109:7): [True: 169, False: 75]
  ------------------
 4110|       |    /* We may use stream->shut_flags for strict error checking. */
 4111|    169|    nghttp2_stream_shutdown(stream, NGHTTP2_SHUT_RD);
 4112|    169|  }
 4113|       |
 4114|    244|  rv = session_call_on_frame_received(session, frame);
 4115|    244|  if (rv != 0) {
  ------------------
  |  Branch (4115:7): [True: 0, False: 244]
  ------------------
 4116|      0|    return rv;
 4117|      0|  }
 4118|    244|  rv = nghttp2_session_close_stream(session, frame->hd.stream_id,
 4119|    244|                                    frame->rst_stream.error_code);
 4120|    244|  if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (4120:7): [True: 0, False: 244]
  ------------------
 4121|      0|    return rv;
 4122|      0|  }
 4123|       |
 4124|    244|  return session_update_stream_reset_ratelim(session);
 4125|    244|}
nghttp2_session_update_local_settings:
 4262|     47|                                          size_t niv) {
 4263|     47|  int rv;
 4264|     47|  size_t i;
 4265|     47|  int32_t new_initial_window_size = -1;
 4266|     47|  uint32_t header_table_size = 0;
 4267|     47|  uint32_t min_header_table_size = UINT32_MAX;
 4268|     47|  uint8_t header_table_size_seen = 0;
 4269|       |  /* For NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE, use the value last
 4270|       |     seen.  For NGHTTP2_SETTINGS_HEADER_TABLE_SIZE, use both minimum
 4271|       |     value and last seen value. */
 4272|    188|  for (i = 0; i < niv; ++i) {
  ------------------
  |  Branch (4272:15): [True: 141, False: 47]
  ------------------
 4273|    141|    switch (iv[i].settings_id) {
  ------------------
  |  Branch (4273:13): [True: 47, False: 94]
  ------------------
 4274|      0|    case NGHTTP2_SETTINGS_HEADER_TABLE_SIZE:
  ------------------
  |  Branch (4274:5): [True: 0, False: 141]
  ------------------
 4275|      0|      header_table_size_seen = 1;
 4276|      0|      header_table_size = iv[i].value;
 4277|      0|      min_header_table_size =
 4278|      0|        nghttp2_min_uint32(min_header_table_size, iv[i].value);
 4279|      0|      break;
 4280|     47|    case NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE:
  ------------------
  |  Branch (4280:5): [True: 47, False: 94]
  ------------------
 4281|     47|      new_initial_window_size = (int32_t)iv[i].value;
 4282|     47|      break;
 4283|    141|    }
 4284|    141|  }
 4285|     47|  if (header_table_size_seen) {
  ------------------
  |  Branch (4285:7): [True: 0, False: 47]
  ------------------
 4286|      0|    if (min_header_table_size < header_table_size) {
  ------------------
  |  Branch (4286:9): [True: 0, False: 0]
  ------------------
 4287|      0|      rv = nghttp2_hd_inflate_change_table_size(&session->hd_inflater,
 4288|      0|                                                min_header_table_size);
 4289|      0|      if (rv != 0) {
  ------------------
  |  Branch (4289:11): [True: 0, False: 0]
  ------------------
 4290|      0|        return rv;
 4291|      0|      }
 4292|      0|    }
 4293|       |
 4294|      0|    rv = nghttp2_hd_inflate_change_table_size(&session->hd_inflater,
 4295|      0|                                              header_table_size);
 4296|      0|    if (rv != 0) {
  ------------------
  |  Branch (4296:9): [True: 0, False: 0]
  ------------------
 4297|      0|      return rv;
 4298|      0|    }
 4299|      0|  }
 4300|     47|  if (new_initial_window_size != -1) {
  ------------------
  |  Branch (4300:7): [True: 47, False: 0]
  ------------------
 4301|     47|    rv = session_update_local_initial_window_size(
 4302|     47|      session, new_initial_window_size,
 4303|     47|      (int32_t)session->local_settings.initial_window_size);
 4304|     47|    if (rv != 0) {
  ------------------
  |  Branch (4304:9): [True: 0, False: 47]
  ------------------
 4305|      0|      return rv;
 4306|      0|    }
 4307|     47|  }
 4308|       |
 4309|    188|  for (i = 0; i < niv; ++i) {
  ------------------
  |  Branch (4309:15): [True: 141, False: 47]
  ------------------
 4310|    141|    switch (iv[i].settings_id) {
  ------------------
  |  Branch (4310:13): [True: 141, False: 0]
  ------------------
 4311|      0|    case NGHTTP2_SETTINGS_HEADER_TABLE_SIZE:
  ------------------
  |  Branch (4311:5): [True: 0, False: 141]
  ------------------
 4312|      0|      session->local_settings.header_table_size = iv[i].value;
 4313|      0|      break;
 4314|     47|    case NGHTTP2_SETTINGS_ENABLE_PUSH:
  ------------------
  |  Branch (4314:5): [True: 47, False: 94]
  ------------------
 4315|     47|      session->local_settings.enable_push = iv[i].value;
 4316|     47|      break;
 4317|     47|    case NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS:
  ------------------
  |  Branch (4317:5): [True: 47, False: 94]
  ------------------
 4318|     47|      session->local_settings.max_concurrent_streams = iv[i].value;
 4319|     47|      break;
 4320|     47|    case NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE:
  ------------------
  |  Branch (4320:5): [True: 47, False: 94]
  ------------------
 4321|     47|      session->local_settings.initial_window_size = iv[i].value;
 4322|     47|      break;
 4323|      0|    case NGHTTP2_SETTINGS_MAX_FRAME_SIZE:
  ------------------
  |  Branch (4323:5): [True: 0, False: 141]
  ------------------
 4324|      0|      session->local_settings.max_frame_size = iv[i].value;
 4325|      0|      break;
 4326|      0|    case NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE:
  ------------------
  |  Branch (4326:5): [True: 0, False: 141]
  ------------------
 4327|      0|      session->local_settings.max_header_list_size = iv[i].value;
 4328|      0|      break;
 4329|      0|    case NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL:
  ------------------
  |  Branch (4329:5): [True: 0, False: 141]
  ------------------
 4330|      0|      session->local_settings.enable_connect_protocol = iv[i].value;
 4331|      0|      break;
 4332|      0|    case NGHTTP2_SETTINGS_NO_RFC7540_PRIORITIES:
  ------------------
  |  Branch (4332:5): [True: 0, False: 141]
  ------------------
 4333|      0|      session->local_settings.no_rfc7540_priorities = iv[i].value;
 4334|      0|      break;
 4335|    141|    }
 4336|    141|  }
 4337|       |
 4338|     47|  return 0;
 4339|     47|}
nghttp2_session_on_settings_received:
 4342|  4.34k|                                         nghttp2_frame *frame, int noack) {
 4343|  4.34k|  int rv;
 4344|  4.34k|  size_t i;
 4345|  4.34k|  nghttp2_mem *mem;
 4346|  4.34k|  nghttp2_inflight_settings *settings;
 4347|       |
 4348|  4.34k|  mem = &session->mem;
 4349|       |
 4350|  4.34k|  if (frame->hd.stream_id != 0) {
  ------------------
  |  Branch (4350:7): [True: 132, False: 4.21k]
  ------------------
 4351|    132|    return session_handle_invalid_connection(session, frame, NGHTTP2_ERR_PROTO,
 4352|    132|                                             "SETTINGS: stream_id != 0");
 4353|    132|  }
 4354|  4.21k|  if (frame->hd.flags & NGHTTP2_FLAG_ACK) {
  ------------------
  |  Branch (4354:7): [True: 49, False: 4.16k]
  ------------------
 4355|     49|    if (frame->settings.niv != 0) {
  ------------------
  |  Branch (4355:9): [True: 0, False: 49]
  ------------------
 4356|      0|      return session_handle_invalid_connection(
 4357|      0|        session, frame, NGHTTP2_ERR_FRAME_SIZE_ERROR,
 4358|      0|        "SETTINGS: ACK and payload != 0");
 4359|      0|    }
 4360|       |
 4361|     49|    settings = session->inflight_settings_head;
 4362|       |
 4363|     49|    if (!settings) {
  ------------------
  |  Branch (4363:9): [True: 2, False: 47]
  ------------------
 4364|      2|      return session_handle_invalid_connection(
 4365|      2|        session, frame, NGHTTP2_ERR_PROTO, "SETTINGS: unexpected ACK");
 4366|      2|    }
 4367|       |
 4368|     47|    rv = nghttp2_session_update_local_settings(session, settings->iv,
 4369|     47|                                               settings->niv);
 4370|       |
 4371|     47|    session->inflight_settings_head = settings->next;
 4372|       |
 4373|     47|    inflight_settings_del(settings, mem);
 4374|       |
 4375|     47|    if (rv != 0) {
  ------------------
  |  Branch (4375:9): [True: 0, False: 47]
  ------------------
 4376|      0|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (4376:11): [True: 0, False: 0]
  ------------------
 4377|      0|        return rv;
 4378|      0|      }
 4379|      0|      return session_handle_invalid_connection(session, frame, rv, NULL);
 4380|      0|    }
 4381|     47|    return session_call_on_frame_received(session, frame);
 4382|     47|  }
 4383|       |
 4384|  4.16k|  if (!session->remote_settings_received) {
  ------------------
  |  Branch (4384:7): [True: 3.31k, False: 856]
  ------------------
 4385|  3.31k|    session->remote_settings.max_concurrent_streams =
 4386|  3.31k|      NGHTTP2_DEFAULT_MAX_CONCURRENT_STREAMS;
  ------------------
  |  |  103|  3.31k|#define NGHTTP2_DEFAULT_MAX_CONCURRENT_STREAMS 0xffffffffu
  ------------------
 4387|  3.31k|    session->remote_settings_received = 1;
 4388|  3.31k|  }
 4389|       |
 4390|  13.5k|  for (i = 0; i < frame->settings.niv; ++i) {
  ------------------
  |  Branch (4390:15): [True: 9.59k, False: 3.98k]
  ------------------
 4391|  9.59k|    nghttp2_settings_entry *entry = &frame->settings.iv[i];
 4392|       |
 4393|  9.59k|    switch (entry->settings_id) {
  ------------------
  |  Branch (4393:13): [True: 1.28k, False: 8.30k]
  ------------------
 4394|    440|    case NGHTTP2_SETTINGS_HEADER_TABLE_SIZE:
  ------------------
  |  Branch (4394:5): [True: 440, False: 9.15k]
  ------------------
 4395|       |
 4396|    440|      rv = nghttp2_hd_deflate_change_table_size(&session->hd_deflater,
 4397|    440|                                                entry->value);
 4398|    440|      if (rv != 0) {
  ------------------
  |  Branch (4398:11): [True: 0, False: 440]
  ------------------
 4399|      0|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (4399:13): [True: 0, False: 0]
  ------------------
 4400|      0|          return rv;
 4401|      0|        } else {
 4402|      0|          return session_handle_invalid_connection(
 4403|      0|            session, frame, NGHTTP2_ERR_HEADER_COMP, NULL);
 4404|      0|        }
 4405|      0|      }
 4406|       |
 4407|    440|      session->remote_settings.header_table_size = entry->value;
 4408|       |
 4409|    440|      break;
 4410|     82|    case NGHTTP2_SETTINGS_ENABLE_PUSH:
  ------------------
  |  Branch (4410:5): [True: 82, False: 9.51k]
  ------------------
 4411|       |
 4412|     82|      if (entry->value != 0 && entry->value != 1) {
  ------------------
  |  Branch (4412:11): [True: 55, False: 27]
  |  Branch (4412:32): [True: 54, False: 1]
  ------------------
 4413|     54|        return session_handle_invalid_connection(
 4414|     54|          session, frame, NGHTTP2_ERR_PROTO,
 4415|     54|          "SETTINGS: invalid SETTINGS_ENBLE_PUSH");
 4416|     54|      }
 4417|       |
 4418|     28|      if (!session->server && entry->value != 0) {
  ------------------
  |  Branch (4418:11): [True: 28, False: 0]
  |  Branch (4418:31): [True: 1, False: 27]
  ------------------
 4419|      1|        return session_handle_invalid_connection(
 4420|      1|          session, frame, NGHTTP2_ERR_PROTO,
 4421|      1|          "SETTINGS: server attempted to enable push");
 4422|      1|      }
 4423|       |
 4424|     27|      session->remote_settings.enable_push = entry->value;
 4425|       |
 4426|     27|      break;
 4427|    135|    case NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS:
  ------------------
  |  Branch (4427:5): [True: 135, False: 9.46k]
  ------------------
 4428|       |
 4429|    135|      session->remote_settings.max_concurrent_streams = entry->value;
 4430|       |
 4431|    135|      break;
 4432|    389|    case NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE:
  ------------------
  |  Branch (4432:5): [True: 389, False: 9.20k]
  ------------------
 4433|       |
 4434|       |      /* Update the initial window size of the all active streams */
 4435|       |      /* Check that initial_window_size < (1u << 31) */
 4436|    389|      if (entry->value > NGHTTP2_MAX_WINDOW_SIZE) {
  ------------------
  |  |  224|    389|#define NGHTTP2_MAX_WINDOW_SIZE ((int32_t)((1U << 31) - 1))
  ------------------
  |  Branch (4436:11): [True: 20, False: 369]
  ------------------
 4437|     20|        return session_handle_invalid_connection(
 4438|     20|          session, frame, NGHTTP2_ERR_FLOW_CONTROL,
 4439|     20|          "SETTINGS: too large SETTINGS_INITIAL_WINDOW_SIZE");
 4440|     20|      }
 4441|       |
 4442|    369|      rv = session_update_remote_initial_window_size(session,
 4443|    369|                                                     (int32_t)entry->value);
 4444|       |
 4445|    369|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (4445:11): [True: 0, False: 369]
  ------------------
 4446|      0|        return rv;
 4447|      0|      }
 4448|       |
 4449|    369|      if (rv != 0) {
  ------------------
  |  Branch (4449:11): [True: 0, False: 369]
  ------------------
 4450|      0|        return session_handle_invalid_connection(
 4451|      0|          session, frame, NGHTTP2_ERR_FLOW_CONTROL, NULL);
 4452|      0|      }
 4453|       |
 4454|    369|      session->remote_settings.initial_window_size = entry->value;
 4455|       |
 4456|    369|      break;
 4457|     94|    case NGHTTP2_SETTINGS_MAX_FRAME_SIZE:
  ------------------
  |  Branch (4457:5): [True: 94, False: 9.50k]
  ------------------
 4458|       |
 4459|     94|      if (entry->value < NGHTTP2_MAX_FRAME_SIZE_MIN ||
  ------------------
  |  |   43|    188|#define NGHTTP2_MAX_FRAME_SIZE_MIN (1 << 14)
  ------------------
  |  Branch (4459:11): [True: 6, False: 88]
  ------------------
 4460|     88|          entry->value > NGHTTP2_MAX_FRAME_SIZE_MAX) {
  ------------------
  |  |   42|     88|#define NGHTTP2_MAX_FRAME_SIZE_MAX ((1 << 24) - 1)
  ------------------
  |  Branch (4460:11): [True: 36, False: 52]
  ------------------
 4461|     42|        return session_handle_invalid_connection(
 4462|     42|          session, frame, NGHTTP2_ERR_PROTO,
 4463|     42|          "SETTINGS: invalid SETTINGS_MAX_FRAME_SIZE");
 4464|     42|      }
 4465|       |
 4466|     52|      session->remote_settings.max_frame_size = entry->value;
 4467|       |
 4468|     52|      break;
 4469|     39|    case NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE:
  ------------------
  |  Branch (4469:5): [True: 39, False: 9.55k]
  ------------------
 4470|       |
 4471|     39|      session->remote_settings.max_header_list_size = entry->value;
 4472|       |
 4473|     39|      break;
 4474|     64|    case NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL:
  ------------------
  |  Branch (4474:5): [True: 64, False: 9.53k]
  ------------------
 4475|       |
 4476|     64|      if (entry->value != 0 && entry->value != 1) {
  ------------------
  |  Branch (4476:11): [True: 53, False: 11]
  |  Branch (4476:32): [True: 41, False: 12]
  ------------------
 4477|     41|        return session_handle_invalid_connection(
 4478|     41|          session, frame, NGHTTP2_ERR_PROTO,
 4479|     41|          "SETTINGS: invalid SETTINGS_ENABLE_CONNECT_PROTOCOL");
 4480|     41|      }
 4481|       |
 4482|     23|      if (!session->server &&
  ------------------
  |  Branch (4482:11): [True: 23, False: 0]
  ------------------
 4483|     23|          session->remote_settings.enable_connect_protocol &&
  ------------------
  |  Branch (4483:11): [True: 4, False: 19]
  ------------------
 4484|      4|          entry->value == 0) {
  ------------------
  |  Branch (4484:11): [True: 1, False: 3]
  ------------------
 4485|      1|        return session_handle_invalid_connection(
 4486|      1|          session, frame, NGHTTP2_ERR_PROTO,
 4487|      1|          "SETTINGS: server attempted to disable "
 4488|      1|          "SETTINGS_ENABLE_CONNECT_PROTOCOL");
 4489|      1|      }
 4490|       |
 4491|     22|      session->remote_settings.enable_connect_protocol = entry->value;
 4492|       |
 4493|     22|      break;
 4494|     45|    case NGHTTP2_SETTINGS_NO_RFC7540_PRIORITIES:
  ------------------
  |  Branch (4494:5): [True: 45, False: 9.55k]
  ------------------
 4495|       |
 4496|     45|      if (entry->value != 0 && entry->value != 1) {
  ------------------
  |  Branch (4496:11): [True: 25, False: 20]
  |  Branch (4496:32): [True: 19, False: 6]
  ------------------
 4497|     19|        return session_handle_invalid_connection(
 4498|     19|          session, frame, NGHTTP2_ERR_PROTO,
 4499|     19|          "SETTINGS: invalid SETTINGS_NO_RFC7540_PRIORITIES");
 4500|     19|      }
 4501|       |
 4502|     26|      if (session->remote_settings.no_rfc7540_priorities != UINT32_MAX &&
  ------------------
  |  Branch (4502:11): [True: 10, False: 16]
  ------------------
 4503|     10|          session->remote_settings.no_rfc7540_priorities != entry->value) {
  ------------------
  |  Branch (4503:11): [True: 1, False: 9]
  ------------------
 4504|      1|        return session_handle_invalid_connection(
 4505|      1|          session, frame, NGHTTP2_ERR_PROTO,
 4506|      1|          "SETTINGS: SETTINGS_NO_RFC7540_PRIORITIES cannot be changed");
 4507|      1|      }
 4508|       |
 4509|     25|      session->remote_settings.no_rfc7540_priorities = entry->value;
 4510|       |
 4511|     25|      break;
 4512|  9.59k|    }
 4513|  9.59k|  }
 4514|       |
 4515|  3.98k|  if (session->remote_settings.no_rfc7540_priorities == UINT32_MAX) {
  ------------------
  |  Branch (4515:7): [True: 3.14k, False: 845]
  ------------------
 4516|  3.14k|    session->remote_settings.no_rfc7540_priorities = 0;
 4517|  3.14k|  }
 4518|       |
 4519|  3.98k|  if (!noack && !session_is_closing(session)) {
  ------------------
  |  Branch (4519:7): [True: 3.98k, False: 0]
  |  Branch (4519:17): [True: 3.98k, False: 0]
  ------------------
 4520|  3.98k|    rv = nghttp2_session_add_settings(session, NGHTTP2_FLAG_ACK, NULL, 0);
 4521|       |
 4522|  3.98k|    if (rv != 0) {
  ------------------
  |  Branch (4522:9): [True: 0, False: 3.98k]
  ------------------
 4523|      0|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (4523:11): [True: 0, False: 0]
  ------------------
 4524|      0|        return rv;
 4525|      0|      }
 4526|       |
 4527|      0|      return session_handle_invalid_connection(session, frame,
 4528|      0|                                               NGHTTP2_ERR_INTERNAL, NULL);
 4529|      0|    }
 4530|  3.98k|  }
 4531|       |
 4532|  3.98k|  return session_call_on_frame_received(session, frame);
 4533|  3.98k|}
nghttp2_session_on_push_promise_received:
 4573|    212|                                             nghttp2_frame *frame) {
 4574|    212|  int rv;
 4575|    212|  nghttp2_stream *stream;
 4576|    212|  nghttp2_stream *promised_stream;
 4577|       |
 4578|    212|  if (frame->hd.stream_id == 0) {
  ------------------
  |  Branch (4578:7): [True: 4, False: 208]
  ------------------
 4579|      4|    return session_inflate_handle_invalid_connection(
 4580|      4|      session, frame, NGHTTP2_ERR_PROTO, "PUSH_PROMISE: stream_id == 0");
 4581|      4|  }
 4582|    208|  if (session->server || session->local_settings.enable_push == 0) {
  ------------------
  |  Branch (4582:7): [True: 0, False: 208]
  |  Branch (4582:26): [True: 2, False: 206]
  ------------------
 4583|      2|    return session_inflate_handle_invalid_connection(
 4584|      2|      session, frame, NGHTTP2_ERR_PROTO, "PUSH_PROMISE: push disabled");
 4585|      2|  }
 4586|       |
 4587|    206|  if (!nghttp2_session_is_my_stream_id(session, frame->hd.stream_id)) {
  ------------------
  |  Branch (4587:7): [True: 5, False: 201]
  ------------------
 4588|      5|    return session_inflate_handle_invalid_connection(
 4589|      5|      session, frame, NGHTTP2_ERR_PROTO, "PUSH_PROMISE: invalid stream_id");
 4590|      5|  }
 4591|       |
 4592|    201|  if (!session_allow_incoming_new_stream(session)) {
  ------------------
  |  Branch (4592:7): [True: 0, False: 201]
  ------------------
 4593|       |    /* We just discard PUSH_PROMISE after GOAWAY was sent */
 4594|      0|    return NGHTTP2_ERR_IGN_HEADER_BLOCK;
 4595|      0|  }
 4596|       |
 4597|    201|  if (!session_is_new_peer_stream_id(session,
  ------------------
  |  Branch (4597:7): [True: 26, False: 175]
  ------------------
 4598|    201|                                     frame->push_promise.promised_stream_id)) {
 4599|       |    /* The spec says if an endpoint receives a PUSH_PROMISE with
 4600|       |       illegal stream ID is subject to a connection error of type
 4601|       |       PROTOCOL_ERROR. */
 4602|     26|    return session_inflate_handle_invalid_connection(
 4603|     26|      session, frame, NGHTTP2_ERR_PROTO,
 4604|     26|      "PUSH_PROMISE: invalid promised_stream_id");
 4605|     26|  }
 4606|       |
 4607|    175|  if (session_detect_idle_stream(session, frame->hd.stream_id)) {
  ------------------
  |  Branch (4607:7): [True: 20, False: 155]
  ------------------
 4608|     20|    return session_inflate_handle_invalid_connection(
 4609|     20|      session, frame, NGHTTP2_ERR_PROTO, "PUSH_PROMISE: stream in idle");
 4610|     20|  }
 4611|       |
 4612|    155|  session->last_recv_stream_id = frame->push_promise.promised_stream_id;
 4613|    155|  stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
 4614|    155|  if (!stream || stream->state == NGHTTP2_STREAM_CLOSING ||
  ------------------
  |  Branch (4614:7): [True: 36, False: 119]
  |  Branch (4614:18): [True: 15, False: 104]
  ------------------
 4615|    104|      !session->pending_enable_push ||
  ------------------
  |  Branch (4615:7): [True: 104, False: 0]
  ------------------
 4616|      0|      session->num_incoming_reserved_streams >=
  ------------------
  |  Branch (4616:7): [True: 0, False: 0]
  ------------------
 4617|    155|        session->max_incoming_reserved_streams) {
 4618|       |    /* Currently, client does not retain closed stream, so we don't
 4619|       |       check NGHTTP2_SHUT_RD condition here. */
 4620|    155|    rv = session_handle_invalid_stream2(session,
 4621|    155|                                        frame->push_promise.promised_stream_id,
 4622|    155|                                        NULL, NGHTTP2_ERR_PUSH_CANCEL);
 4623|    155|    if (rv != 0) {
  ------------------
  |  Branch (4623:9): [True: 0, False: 155]
  ------------------
 4624|      0|      return rv;
 4625|      0|    }
 4626|    155|    return NGHTTP2_ERR_IGN_HEADER_BLOCK;
 4627|    155|  }
 4628|       |
 4629|      0|  if (stream->shut_flags & NGHTTP2_SHUT_RD) {
  ------------------
  |  Branch (4629:7): [True: 0, False: 0]
  ------------------
 4630|      0|    return session_inflate_handle_invalid_connection(
 4631|      0|      session, frame, NGHTTP2_ERR_STREAM_CLOSED, "PUSH_PROMISE: stream closed");
 4632|      0|  }
 4633|       |
 4634|      0|  promised_stream = nghttp2_session_open_stream(
 4635|      0|    session, frame->push_promise.promised_stream_id, NGHTTP2_STREAM_FLAG_NONE,
 4636|      0|    NGHTTP2_STREAM_RESERVED, NULL);
 4637|       |
 4638|      0|  if (!promised_stream) {
  ------------------
  |  Branch (4638:7): [True: 0, False: 0]
  ------------------
 4639|      0|    return NGHTTP2_ERR_NOMEM;
 4640|      0|  }
 4641|       |
 4642|      0|  session->last_proc_stream_id = session->last_recv_stream_id;
 4643|      0|  rv = session_call_on_begin_headers(session, frame);
 4644|      0|  if (rv != 0) {
  ------------------
  |  Branch (4644:7): [True: 0, False: 0]
  ------------------
 4645|      0|    return rv;
 4646|      0|  }
 4647|      0|  return 0;
 4648|      0|}
nghttp2_session_on_ping_received:
 4661|    135|                                     nghttp2_frame *frame) {
 4662|    135|  int rv = 0;
 4663|    135|  if (frame->hd.stream_id != 0) {
  ------------------
  |  Branch (4663:7): [True: 16, False: 119]
  ------------------
 4664|     16|    return session_handle_invalid_connection(session, frame, NGHTTP2_ERR_PROTO,
 4665|     16|                                             "PING: stream_id != 0");
 4666|     16|  }
 4667|    119|  if ((session->opt_flags & NGHTTP2_OPTMASK_NO_AUTO_PING_ACK) == 0 &&
  ------------------
  |  Branch (4667:7): [True: 119, False: 0]
  ------------------
 4668|    119|      (frame->hd.flags & NGHTTP2_FLAG_ACK) == 0 &&
  ------------------
  |  Branch (4668:7): [True: 98, False: 21]
  ------------------
 4669|     98|      !session_is_closing(session)) {
  ------------------
  |  Branch (4669:7): [True: 98, False: 0]
  ------------------
 4670|       |    /* Peer sent ping, so ping it back */
 4671|     98|    rv = nghttp2_session_add_ping(session, NGHTTP2_FLAG_ACK,
 4672|     98|                                  frame->ping.opaque_data);
 4673|     98|    if (rv != 0) {
  ------------------
  |  Branch (4673:9): [True: 0, False: 98]
  ------------------
 4674|      0|      return rv;
 4675|      0|    }
 4676|     98|  }
 4677|    119|  return session_call_on_frame_received(session, frame);
 4678|    119|}
nghttp2_session_on_goaway_received:
 4690|    493|                                       nghttp2_frame *frame) {
 4691|    493|  int rv;
 4692|       |
 4693|    493|  if (frame->hd.stream_id != 0) {
  ------------------
  |  Branch (4693:7): [True: 19, False: 474]
  ------------------
 4694|     19|    return session_handle_invalid_connection(session, frame, NGHTTP2_ERR_PROTO,
 4695|     19|                                             "GOAWAY: stream_id != 0");
 4696|     19|  }
 4697|       |  /* Spec says Endpoints MUST NOT increase the value they send in the
 4698|       |     last stream identifier. */
 4699|    474|  if ((frame->goaway.last_stream_id > 0 &&
  ------------------
  |  Branch (4699:8): [True: 135, False: 339]
  ------------------
 4700|    135|       !nghttp2_session_is_my_stream_id(session,
  ------------------
  |  Branch (4700:8): [True: 8, False: 127]
  ------------------
 4701|    135|                                        frame->goaway.last_stream_id)) ||
 4702|    466|      session->remote_last_stream_id < frame->goaway.last_stream_id) {
  ------------------
  |  Branch (4702:7): [True: 2, False: 464]
  ------------------
 4703|     10|    return session_handle_invalid_connection(session, frame, NGHTTP2_ERR_PROTO,
 4704|     10|                                             "GOAWAY: invalid last_stream_id");
 4705|     10|  }
 4706|       |
 4707|    464|  session->goaway_flags |= NGHTTP2_GOAWAY_RECV;
 4708|       |
 4709|    464|  session->remote_last_stream_id = frame->goaway.last_stream_id;
 4710|       |
 4711|    464|  rv = session_call_on_frame_received(session, frame);
 4712|       |
 4713|    464|  if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (4713:7): [True: 0, False: 464]
  ------------------
 4714|      0|    return rv;
 4715|      0|  }
 4716|       |
 4717|    464|  return session_close_stream_on_goaway(session, frame->goaway.last_stream_id,
 4718|    464|                                        0);
 4719|    464|}
nghttp2_session_on_window_update_received:
 4798|    209|                                              nghttp2_frame *frame) {
 4799|    209|  if (frame->hd.stream_id == 0) {
  ------------------
  |  Branch (4799:7): [True: 27, False: 182]
  ------------------
 4800|     27|    return session_on_connection_window_update_received(session, frame);
 4801|    182|  } else {
 4802|    182|    return session_on_stream_window_update_received(session, frame);
 4803|    182|  }
 4804|    209|}
nghttp2_session_on_data_received:
 4994|    310|                                     nghttp2_frame *frame) {
 4995|    310|  int rv = 0;
 4996|    310|  nghttp2_stream *stream;
 4997|    310|  nghttp2_inbound_frame *iframe = &session->iframe;
 4998|       |
 4999|       |  /* We don't call on_frame_recv_callback if stream has been closed
 5000|       |     already or being closed. */
 5001|    310|  stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
 5002|    310|  if (!stream || stream->state == NGHTTP2_STREAM_CLOSING) {
  ------------------
  |  Branch (5002:7): [True: 0, False: 310]
  |  Branch (5002:18): [True: 11, False: 299]
  ------------------
 5003|       |    /* This should be treated as stream error, but it results in lots
 5004|       |       of RST_STREAM. So just ignore frame against nonexistent stream
 5005|       |       for now. */
 5006|     11|    return 0;
 5007|     11|  }
 5008|       |
 5009|    299|  if (session_enforce_http_messaging(session) &&
  ------------------
  |  Branch (5009:7): [True: 299, False: 0]
  ------------------
 5010|    299|      (frame->hd.flags & NGHTTP2_FLAG_END_STREAM)) {
  ------------------
  |  Branch (5010:7): [True: 19, False: 280]
  ------------------
 5011|     19|    if (nghttp2_http_on_remote_end_stream(stream) != 0) {
  ------------------
  |  Branch (5011:9): [True: 0, False: 19]
  ------------------
 5012|      0|      rv = session_handle_invalid_stream2(session, stream->stream_id, frame,
 5013|      0|                                          NGHTTP2_ERR_HTTP_MESSAGING);
 5014|      0|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (5014:11): [True: 0, False: 0]
  ------------------
 5015|      0|        return rv;
 5016|      0|      }
 5017|       |
 5018|      0|      rv = session_update_glitch_ratelim(session);
 5019|      0|      if (rv != 0) {
  ------------------
  |  Branch (5019:11): [True: 0, False: 0]
  ------------------
 5020|      0|        return rv;
 5021|      0|      }
 5022|       |
 5023|      0|      if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (5023:11): [True: 0, False: 0]
  ------------------
 5024|      0|        return 0;
 5025|      0|      }
 5026|       |
 5027|      0|      nghttp2_stream_shutdown(stream, NGHTTP2_SHUT_RD);
 5028|       |
 5029|       |      /* Don't call nghttp2_session_close_stream_if_shut_rdwr because
 5030|       |         RST_STREAM has been submitted. */
 5031|       |
 5032|      0|      return 0;
 5033|      0|    }
 5034|     19|  }
 5035|       |
 5036|    299|  rv = session_call_on_frame_received(session, frame);
 5037|    299|  if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (5037:7): [True: 0, False: 299]
  ------------------
 5038|      0|    return rv;
 5039|      0|  }
 5040|       |
 5041|    299|  if (frame->hd.flags & NGHTTP2_FLAG_END_STREAM) {
  ------------------
  |  Branch (5041:7): [True: 19, False: 280]
  ------------------
 5042|     19|    nghttp2_stream_shutdown(stream, NGHTTP2_SHUT_RD);
 5043|     19|    rv = nghttp2_session_close_stream_if_shut_rdwr(session, stream);
 5044|     19|    if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (5044:9): [True: 0, False: 19]
  ------------------
 5045|      0|      return rv;
 5046|      0|    }
 5047|     19|  }
 5048|    299|  return 0;
 5049|    299|}
nghttp2_session_update_recv_stream_window_size:
 5085|    639|                                                   int send_window_update) {
 5086|    639|  int rv;
 5087|    639|  rv = adjust_recv_window_size(&stream->recv_window_size, delta_size,
 5088|    639|                               stream->local_window_size);
 5089|    639|  if (rv != 0) {
  ------------------
  |  Branch (5089:7): [True: 0, False: 639]
  ------------------
 5090|      0|    return nghttp2_session_terminate_session(session,
 5091|      0|                                             NGHTTP2_FLOW_CONTROL_ERROR);
 5092|      0|  }
 5093|       |  /* We don't have to send WINDOW_UPDATE if the data received is the
 5094|       |     last chunk in the incoming stream. */
 5095|       |  /* We have to use local_settings here because it is the constraint
 5096|       |     the remote endpoint should honor. */
 5097|    639|  if (send_window_update &&
  ------------------
  |  Branch (5097:7): [True: 622, False: 17]
  ------------------
 5098|    622|      !(session->opt_flags & NGHTTP2_OPTMASK_NO_AUTO_WINDOW_UPDATE) &&
  ------------------
  |  Branch (5098:7): [True: 0, False: 622]
  ------------------
 5099|      0|      stream->window_update_queued == 0 &&
  ------------------
  |  Branch (5099:7): [True: 0, False: 0]
  ------------------
 5100|      0|      nghttp2_should_send_window_update(stream->local_window_size,
  ------------------
  |  Branch (5100:7): [True: 0, False: 0]
  ------------------
 5101|      0|                                        stream->recv_window_size)) {
 5102|      0|    rv = nghttp2_session_add_window_update(
 5103|      0|      session, NGHTTP2_FLAG_NONE, stream->stream_id, stream->recv_window_size);
 5104|      0|    if (rv != 0) {
  ------------------
  |  Branch (5104:9): [True: 0, False: 0]
  ------------------
 5105|      0|      return rv;
 5106|      0|    }
 5107|       |
 5108|      0|    stream->recv_window_size = 0;
 5109|      0|  }
 5110|    639|  return 0;
 5111|    639|}
nghttp2_session_update_recv_connection_window_size:
 5114|    851|                                                       size_t delta_size) {
 5115|    851|  int rv;
 5116|    851|  rv = adjust_recv_window_size(&session->recv_window_size, delta_size,
 5117|    851|                               session->local_window_size);
 5118|    851|  if (rv != 0) {
  ------------------
  |  Branch (5118:7): [True: 0, False: 851]
  ------------------
 5119|      0|    return nghttp2_session_terminate_session(session,
 5120|      0|                                             NGHTTP2_FLOW_CONTROL_ERROR);
 5121|      0|  }
 5122|    851|  if (!(session->opt_flags & NGHTTP2_OPTMASK_NO_AUTO_WINDOW_UPDATE) &&
  ------------------
  |  Branch (5122:7): [True: 0, False: 851]
  ------------------
 5123|      0|      session->window_update_queued == 0 &&
  ------------------
  |  Branch (5123:7): [True: 0, False: 0]
  ------------------
 5124|      0|      nghttp2_should_send_window_update(session->local_window_size,
  ------------------
  |  Branch (5124:7): [True: 0, False: 0]
  ------------------
 5125|      0|                                        session->recv_window_size)) {
 5126|       |    /* Use stream ID 0 to update connection-level flow control
 5127|       |       window */
 5128|      0|    rv = nghttp2_session_add_window_update(session, NGHTTP2_FLAG_NONE, 0,
 5129|      0|                                           session->recv_window_size);
 5130|      0|    if (rv != 0) {
  ------------------
  |  Branch (5130:9): [True: 0, False: 0]
  ------------------
 5131|      0|      return rv;
 5132|      0|    }
 5133|       |
 5134|      0|    session->recv_window_size = 0;
 5135|      0|  }
 5136|    851|  return 0;
 5137|    851|}
nghttp2_session_mem_recv:
 5420|  4.57k|                                 size_t inlen) {
 5421|  4.57k|  return (ssize_t)nghttp2_session_mem_recv2(session, in, inlen);
 5422|  4.57k|}
nghttp2_session_mem_recv2:
 5425|  4.57k|                                        const uint8_t *in, size_t inlen) {
 5426|  4.57k|  const uint8_t *first, *last;
 5427|  4.57k|  nghttp2_inbound_frame *iframe = &session->iframe;
 5428|  4.57k|  size_t readlen;
 5429|  4.57k|  nghttp2_ssize padlen;
 5430|  4.57k|  int rv;
 5431|  4.57k|  int busy = 0;
 5432|  4.57k|  nghttp2_frame_hd cont_hd;
 5433|  4.57k|  nghttp2_stream *stream;
 5434|  4.57k|  size_t pri_fieldlen;
 5435|  4.57k|  nghttp2_mem *mem;
 5436|       |
 5437|  4.57k|  if (in == NULL) {
  ------------------
  |  Branch (5437:7): [True: 0, False: 4.57k]
  ------------------
 5438|      0|    assert(inlen == 0);
  ------------------
  |  Branch (5438:5): [True: 0, False: 0]
  |  Branch (5438:5): [True: 0, False: 0]
  ------------------
 5439|      0|    in = static_in;
 5440|      0|  }
 5441|       |
 5442|  4.57k|  first = in;
 5443|  4.57k|  last = in + inlen;
 5444|       |
 5445|  4.57k|  DEBUGF("recv: connection recv_window_size=%d, local_window=%d\n",
  ------------------
  |  |   39|  4.57k|    do {                                                                       \
  |  |   40|  4.57k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 4.57k]
  |  |  ------------------
  ------------------
 5446|  4.57k|         session->recv_window_size, session->local_window_size);
 5447|       |
 5448|  4.57k|  mem = &session->mem;
 5449|       |
 5450|  4.57k|  if (!nghttp2_session_want_read(session)) {
  ------------------
  |  Branch (5450:7): [True: 0, False: 4.57k]
  ------------------
 5451|      0|    return (nghttp2_ssize)inlen;
 5452|      0|  }
 5453|       |
 5454|  36.3k|  for (;;) {
 5455|  36.3k|    switch (iframe->state) {
  ------------------
  |  Branch (5455:13): [True: 36.3k, False: 0]
  ------------------
 5456|      0|    case NGHTTP2_IB_READ_CLIENT_MAGIC:
  ------------------
  |  Branch (5456:5): [True: 0, False: 36.3k]
  ------------------
 5457|      0|      readlen = nghttp2_min_size(inlen, iframe->payloadleft);
 5458|       |
 5459|      0|      if (memcmp(&NGHTTP2_CLIENT_MAGIC[NGHTTP2_CLIENT_MAGIC_LEN -
  ------------------
  |  |  252|      0|#define NGHTTP2_CLIENT_MAGIC "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
  ------------------
                    if (memcmp(&NGHTTP2_CLIENT_MAGIC[NGHTTP2_CLIENT_MAGIC_LEN -
  ------------------
  |  |  259|      0|#define NGHTTP2_CLIENT_MAGIC_LEN 24
  ------------------
  |  Branch (5459:11): [True: 0, False: 0]
  ------------------
 5460|      0|                                       iframe->payloadleft],
 5461|      0|                 in, readlen) != 0) {
 5462|      0|        return NGHTTP2_ERR_BAD_CLIENT_MAGIC;
 5463|      0|      }
 5464|       |
 5465|      0|      iframe->payloadleft -= readlen;
 5466|      0|      in += readlen;
 5467|       |
 5468|      0|      if (iframe->payloadleft == 0) {
  ------------------
  |  Branch (5468:11): [True: 0, False: 0]
  ------------------
 5469|      0|        session_inbound_frame_reset(session);
 5470|      0|        iframe->state = NGHTTP2_IB_READ_FIRST_SETTINGS;
 5471|      0|      }
 5472|       |
 5473|      0|      break;
 5474|  4.38k|    case NGHTTP2_IB_READ_FIRST_SETTINGS:
  ------------------
  |  Branch (5474:5): [True: 4.38k, False: 31.9k]
  ------------------
 5475|  4.38k|      DEBUGF("recv: [IB_READ_FIRST_SETTINGS]\n");
  ------------------
  |  |   39|  4.38k|    do {                                                                       \
  |  |   40|  4.38k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 4.38k]
  |  |  ------------------
  ------------------
 5476|       |
 5477|  4.38k|      readlen = inbound_frame_buf_read(iframe, in, last);
 5478|  4.38k|      in += readlen;
 5479|       |
 5480|  4.38k|      if (nghttp2_buf_mark_avail(&iframe->sbuf)) {
  ------------------
  |  |   56|  4.38k|#define nghttp2_buf_mark_avail(BUF) ((size_t)((BUF)->mark - (BUF)->last))
  |  |  ------------------
  |  |  |  Branch (56:37): [True: 13, False: 4.37k]
  |  |  ------------------
  ------------------
 5481|     13|        return (nghttp2_ssize)(in - first);
 5482|     13|      }
 5483|       |
 5484|  4.37k|      if (iframe->sbuf.pos[3] != NGHTTP2_SETTINGS ||
  ------------------
  |  Branch (5484:11): [True: 496, False: 3.87k]
  ------------------
 5485|  3.87k|          (iframe->sbuf.pos[4] & NGHTTP2_FLAG_ACK)) {
  ------------------
  |  Branch (5485:11): [True: 406, False: 3.47k]
  ------------------
 5486|    902|        rv = session_call_error_callback(
 5487|    902|          session, NGHTTP2_ERR_SETTINGS_EXPECTED,
 5488|    902|          "Remote peer returned unexpected data while we expected "
 5489|    902|          "SETTINGS frame.  Perhaps, peer does not support HTTP/2 "
 5490|    902|          "properly.");
 5491|       |
 5492|    902|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (5492:13): [True: 0, False: 902]
  ------------------
 5493|      0|          return rv;
 5494|      0|        }
 5495|       |
 5496|    902|        rv = nghttp2_session_terminate_session_with_reason(
 5497|    902|          session, NGHTTP2_PROTOCOL_ERROR, "SETTINGS expected");
 5498|       |
 5499|    902|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (5499:13): [True: 0, False: 902]
  ------------------
 5500|      0|          return rv;
 5501|      0|        }
 5502|       |
 5503|    902|        return (nghttp2_ssize)inlen;
 5504|    902|      }
 5505|       |
 5506|  3.47k|      iframe->state = NGHTTP2_IB_READ_HEAD;
 5507|       |
 5508|       |    /* Fall through */
 5509|  10.9k|    case NGHTTP2_IB_READ_HEAD: {
  ------------------
  |  Branch (5509:5): [True: 7.45k, False: 28.9k]
  ------------------
 5510|  10.9k|      int on_begin_frame_called = 0;
 5511|       |
 5512|  10.9k|      DEBUGF("recv: [IB_READ_HEAD]\n");
  ------------------
  |  |   39|  10.9k|    do {                                                                       \
  |  |   40|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 5513|       |
 5514|  10.9k|      readlen = inbound_frame_buf_read(iframe, in, last);
 5515|  10.9k|      in += readlen;
 5516|       |
 5517|  10.9k|      if (nghttp2_buf_mark_avail(&iframe->sbuf)) {
  ------------------
  |  |   56|  10.9k|#define nghttp2_buf_mark_avail(BUF) ((size_t)((BUF)->mark - (BUF)->last))
  |  |  ------------------
  |  |  |  Branch (56:37): [True: 51, False: 10.8k]
  |  |  ------------------
  ------------------
 5518|     51|        return (nghttp2_ssize)(in - first);
 5519|     51|      }
 5520|       |
 5521|  10.8k|      nghttp2_frame_unpack_frame_hd(&iframe->frame.hd, iframe->sbuf.pos);
 5522|  10.8k|      iframe->payloadleft = iframe->frame.hd.length;
 5523|       |
 5524|  10.8k|      DEBUGF("recv: payloadlen=%zu, type=%u, flags=0x%02x, stream_id=%d\n",
  ------------------
  |  |   39|  10.8k|    do {                                                                       \
  |  |   40|  10.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 10.8k]
  |  |  ------------------
  ------------------
 5525|  10.8k|             iframe->frame.hd.length, iframe->frame.hd.type,
 5526|  10.8k|             iframe->frame.hd.flags, iframe->frame.hd.stream_id);
 5527|       |
 5528|  10.8k|      if (iframe->frame.hd.length > session->local_settings.max_frame_size) {
  ------------------
  |  Branch (5528:11): [True: 497, False: 10.3k]
  ------------------
 5529|    497|        DEBUGF("recv: length is too large %zu > %u\n", iframe->frame.hd.length,
  ------------------
  |  |   39|    497|    do {                                                                       \
  |  |   40|    497|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 497]
  |  |  ------------------
  ------------------
 5530|    497|               session->local_settings.max_frame_size);
 5531|       |
 5532|    497|        rv = nghttp2_session_terminate_session_with_reason(
 5533|    497|          session, NGHTTP2_FRAME_SIZE_ERROR, "too large frame size");
 5534|       |
 5535|    497|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (5535:13): [True: 0, False: 497]
  ------------------
 5536|      0|          return rv;
 5537|      0|        }
 5538|       |
 5539|    497|        return (nghttp2_ssize)inlen;
 5540|    497|      }
 5541|       |
 5542|  10.3k|      switch (iframe->frame.hd.type) {
 5543|    888|      case NGHTTP2_DATA: {
  ------------------
  |  Branch (5543:7): [True: 888, False: 9.48k]
  ------------------
 5544|    888|        DEBUGF("recv: DATA\n");
  ------------------
  |  |   39|    888|    do {                                                                       \
  |  |   40|    888|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 888]
  |  |  ------------------
  ------------------
 5545|       |
 5546|    888|        iframe->frame.hd.flags &=
 5547|    888|          (NGHTTP2_FLAG_END_STREAM | NGHTTP2_FLAG_PADDED);
 5548|       |        /* Check stream is open. If it is not open or closing,
 5549|       |           ignore payload. */
 5550|    888|        busy = 1;
 5551|       |
 5552|    888|        rv = session_on_data_received_fail_fast(session);
 5553|    888|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (5553:13): [True: 0, False: 888]
  ------------------
 5554|      0|          return rv;
 5555|      0|        }
 5556|       |
 5557|    888|        if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (5557:13): [True: 139, False: 749]
  ------------------
 5558|    139|          return (nghttp2_ssize)inlen;
 5559|    139|        }
 5560|    749|        if (rv == NGHTTP2_ERR_IGN_PAYLOAD) {
  ------------------
  |  Branch (5560:13): [True: 339, False: 410]
  ------------------
 5561|    339|          DEBUGF("recv: DATA not allowed stream_id=%d\n",
  ------------------
  |  |   39|    339|    do {                                                                       \
  |  |   40|    339|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 339]
  |  |  ------------------
  ------------------
 5562|    339|                 iframe->frame.hd.stream_id);
 5563|       |
 5564|    339|          iframe->state = NGHTTP2_IB_IGN_DATA;
 5565|    339|          break;
 5566|    339|        }
 5567|       |
 5568|    410|        rv = inbound_frame_handle_pad(iframe, &iframe->frame.hd);
 5569|    410|        if (rv < 0) {
  ------------------
  |  Branch (5569:13): [True: 1, False: 409]
  ------------------
 5570|      1|          rv = nghttp2_session_terminate_session_with_reason(
 5571|      1|            session, NGHTTP2_PROTOCOL_ERROR,
 5572|      1|            "DATA: insufficient padding space");
 5573|       |
 5574|      1|          if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (5574:15): [True: 0, False: 1]
  ------------------
 5575|      0|            return rv;
 5576|      0|          }
 5577|      1|          return (nghttp2_ssize)inlen;
 5578|      1|        }
 5579|       |
 5580|    409|        if (rv == 1) {
  ------------------
  |  Branch (5580:13): [True: 190, False: 219]
  ------------------
 5581|    190|          iframe->state = NGHTTP2_IB_READ_PAD_DATA;
 5582|    190|          break;
 5583|    190|        }
 5584|       |
 5585|       |        /* Empty DATA frame without END_STREAM flag set is
 5586|       |           suspicious. */
 5587|    219|        if (iframe->payloadleft == 0 &&
  ------------------
  |  Branch (5587:13): [True: 12, False: 207]
  ------------------
 5588|     12|            (iframe->frame.hd.flags & NGHTTP2_FLAG_END_STREAM) == 0) {
  ------------------
  |  Branch (5588:13): [True: 10, False: 2]
  ------------------
 5589|     10|          rv = session_update_glitch_ratelim(session);
 5590|     10|          if (rv != 0) {
  ------------------
  |  Branch (5590:15): [True: 0, False: 10]
  ------------------
 5591|      0|            return rv;
 5592|      0|          }
 5593|       |
 5594|     10|          if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (5594:15): [True: 0, False: 10]
  ------------------
 5595|      0|            return (nghttp2_ssize)inlen;
 5596|      0|          }
 5597|     10|        }
 5598|       |
 5599|    219|        iframe->state = NGHTTP2_IB_READ_DATA;
 5600|    219|        break;
 5601|    219|      }
 5602|  2.10k|      case NGHTTP2_HEADERS:
  ------------------
  |  Branch (5602:7): [True: 2.10k, False: 8.27k]
  ------------------
 5603|       |
 5604|  2.10k|        DEBUGF("recv: HEADERS\n");
  ------------------
  |  |   39|  2.10k|    do {                                                                       \
  |  |   40|  2.10k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 2.10k]
  |  |  ------------------
  ------------------
 5605|       |
 5606|  2.10k|        iframe->frame.hd.flags &=
 5607|  2.10k|          (NGHTTP2_FLAG_END_STREAM | NGHTTP2_FLAG_END_HEADERS |
 5608|  2.10k|           NGHTTP2_FLAG_PADDED | NGHTTP2_FLAG_PRIORITY);
 5609|       |
 5610|  2.10k|        rv = inbound_frame_handle_pad(iframe, &iframe->frame.hd);
 5611|  2.10k|        if (rv < 0) {
  ------------------
  |  Branch (5611:13): [True: 4, False: 2.10k]
  ------------------
 5612|      4|          rv = nghttp2_session_terminate_session_with_reason(
 5613|      4|            session, NGHTTP2_PROTOCOL_ERROR,
 5614|      4|            "HEADERS: insufficient padding space");
 5615|      4|          if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (5615:15): [True: 0, False: 4]
  ------------------
 5616|      0|            return rv;
 5617|      0|          }
 5618|      4|          return (nghttp2_ssize)inlen;
 5619|      4|        }
 5620|       |
 5621|  2.10k|        if (rv == 1) {
  ------------------
  |  Branch (5621:13): [True: 1.01k, False: 1.08k]
  ------------------
 5622|  1.01k|          iframe->state = NGHTTP2_IB_READ_NBYTE;
 5623|  1.01k|          break;
 5624|  1.01k|        }
 5625|       |
 5626|  1.08k|        pri_fieldlen = nghttp2_frame_priority_len(iframe->frame.hd.flags);
 5627|       |
 5628|  1.08k|        if (pri_fieldlen > 0) {
  ------------------
  |  Branch (5628:13): [True: 456, False: 628]
  ------------------
 5629|    456|          if (iframe->payloadleft < pri_fieldlen) {
  ------------------
  |  Branch (5629:15): [True: 2, False: 454]
  ------------------
 5630|      2|            busy = 1;
 5631|      2|            iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR;
 5632|      2|            break;
 5633|      2|          }
 5634|       |
 5635|    454|          iframe->state = NGHTTP2_IB_READ_NBYTE;
 5636|       |
 5637|    454|          inbound_frame_set_mark(iframe, pri_fieldlen);
 5638|       |
 5639|    454|          break;
 5640|    456|        }
 5641|       |
 5642|       |        /* Call on_begin_frame_callback here because
 5643|       |           session_process_headers_frame() may call
 5644|       |           on_begin_headers_callback */
 5645|    628|        rv = session_call_on_begin_frame(session, &iframe->frame.hd);
 5646|       |
 5647|    628|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (5647:13): [True: 0, False: 628]
  ------------------
 5648|      0|          return rv;
 5649|      0|        }
 5650|       |
 5651|    628|        if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (5651:13): [True: 0, False: 628]
  ------------------
 5652|      0|          return (nghttp2_ssize)inlen;
 5653|      0|        }
 5654|       |
 5655|    628|        on_begin_frame_called = 1;
 5656|       |
 5657|    628|        rv = session_process_headers_frame(session);
 5658|    628|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (5658:13): [True: 31, False: 597]
  ------------------
 5659|     31|          return rv;
 5660|     31|        }
 5661|       |
 5662|    597|        busy = 1;
 5663|       |
 5664|    597|        if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (5664:13): [True: 1, False: 596]
  ------------------
 5665|      1|          return (nghttp2_ssize)inlen;
 5666|      1|        }
 5667|       |
 5668|    596|        if (rv == NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE) {
  ------------------
  |  Branch (5668:13): [True: 0, False: 596]
  ------------------
 5669|      0|          rv = session_handle_invalid_stream2(
 5670|      0|            session, iframe->frame.hd.stream_id, NULL, NGHTTP2_ERR_INTERNAL);
 5671|      0|          if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (5671:15): [True: 0, False: 0]
  ------------------
 5672|      0|            return rv;
 5673|      0|          }
 5674|      0|          iframe->state = NGHTTP2_IB_IGN_HEADER_BLOCK;
 5675|      0|          break;
 5676|      0|        }
 5677|       |
 5678|    596|        if (rv == NGHTTP2_ERR_IGN_HEADER_BLOCK) {
  ------------------
  |  Branch (5678:13): [True: 157, False: 439]
  ------------------
 5679|    157|          rv = session_update_glitch_ratelim(session);
 5680|    157|          if (rv != 0) {
  ------------------
  |  Branch (5680:15): [True: 0, False: 157]
  ------------------
 5681|      0|            return rv;
 5682|      0|          }
 5683|       |
 5684|    157|          if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (5684:15): [True: 0, False: 157]
  ------------------
 5685|      0|            return (nghttp2_ssize)inlen;
 5686|      0|          }
 5687|       |
 5688|    157|          iframe->state = NGHTTP2_IB_IGN_HEADER_BLOCK;
 5689|    157|          break;
 5690|    157|        }
 5691|       |
 5692|    439|        iframe->state = NGHTTP2_IB_READ_HEADER_BLOCK;
 5693|       |
 5694|    439|        break;
 5695|      8|      case NGHTTP2_PRIORITY:
  ------------------
  |  Branch (5695:7): [True: 8, False: 10.3k]
  ------------------
 5696|      8|        DEBUGF("recv: PRIORITY\n");
  ------------------
  |  |   39|      8|    do {                                                                       \
  |  |   40|      8|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 8]
  |  |  ------------------
  ------------------
 5697|       |
 5698|      8|        iframe->frame.hd.flags = NGHTTP2_FLAG_NONE;
 5699|       |
 5700|      8|        if (iframe->payloadleft != NGHTTP2_PRIORITY_SPECLEN) {
  ------------------
  |  |   64|      8|#define NGHTTP2_PRIORITY_SPECLEN 5
  ------------------
  |  Branch (5700:13): [True: 3, False: 5]
  ------------------
 5701|      3|          busy = 1;
 5702|       |
 5703|      3|          iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR;
 5704|       |
 5705|      3|          break;
 5706|      3|        }
 5707|       |
 5708|       |        /* This is deprecated RFC 7540 priorities mechanism which is
 5709|       |           very unpopular.  We do not expect it is received so
 5710|       |           frequently. */
 5711|      5|        rv = session_update_glitch_ratelim(session);
 5712|      5|        if (rv != 0) {
  ------------------
  |  Branch (5712:13): [True: 0, False: 5]
  ------------------
 5713|      0|          return rv;
 5714|      0|        }
 5715|       |
 5716|      5|        if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (5716:13): [True: 0, False: 5]
  ------------------
 5717|      0|          return (nghttp2_ssize)inlen;
 5718|      0|        }
 5719|       |
 5720|      5|        iframe->state = NGHTTP2_IB_READ_NBYTE;
 5721|       |
 5722|      5|        inbound_frame_set_mark(iframe, NGHTTP2_PRIORITY_SPECLEN);
  ------------------
  |  |   64|      5|#define NGHTTP2_PRIORITY_SPECLEN 5
  ------------------
 5723|       |
 5724|      5|        break;
 5725|    282|      case NGHTTP2_RST_STREAM:
  ------------------
  |  Branch (5725:7): [True: 282, False: 10.0k]
  ------------------
 5726|    496|      case NGHTTP2_WINDOW_UPDATE:
  ------------------
  |  Branch (5726:7): [True: 214, False: 10.1k]
  ------------------
 5727|       |#ifdef DEBUGBUILD
 5728|       |        switch (iframe->frame.hd.type) {
 5729|       |        case NGHTTP2_RST_STREAM:
 5730|       |          DEBUGF("recv: RST_STREAM\n");
 5731|       |          break;
 5732|       |        case NGHTTP2_WINDOW_UPDATE:
 5733|       |          DEBUGF("recv: WINDOW_UPDATE\n");
 5734|       |          break;
 5735|       |        }
 5736|       |#endif /* defined(DEBUGBUILD) */
 5737|       |
 5738|    496|        iframe->frame.hd.flags = NGHTTP2_FLAG_NONE;
 5739|       |
 5740|    496|        if (iframe->payloadleft != 4) {
  ------------------
  |  Branch (5740:13): [True: 11, False: 485]
  ------------------
 5741|     11|          busy = 1;
 5742|     11|          iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR;
 5743|     11|          break;
 5744|     11|        }
 5745|       |
 5746|    485|        iframe->state = NGHTTP2_IB_READ_NBYTE;
 5747|       |
 5748|    485|        inbound_frame_set_mark(iframe, 4);
 5749|       |
 5750|    485|        break;
 5751|  4.42k|      case NGHTTP2_SETTINGS:
  ------------------
  |  Branch (5751:7): [True: 4.42k, False: 5.95k]
  ------------------
 5752|  4.42k|        DEBUGF("recv: SETTINGS\n");
  ------------------
  |  |   39|  4.42k|    do {                                                                       \
  |  |   40|  4.42k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 4.42k]
  |  |  ------------------
  ------------------
 5753|       |
 5754|  4.42k|        iframe->frame.hd.flags &= NGHTTP2_FLAG_ACK;
 5755|       |
 5756|  4.42k|        if ((iframe->frame.hd.length % NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH) ||
  ------------------
  |  |   61|  4.42k|#define NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH 6
  ------------------
  |  Branch (5756:13): [True: 36, False: 4.39k]
  ------------------
 5757|  4.39k|            ((iframe->frame.hd.flags & NGHTTP2_FLAG_ACK) &&
  ------------------
  |  Branch (5757:14): [True: 60, False: 4.33k]
  ------------------
 5758|     60|             iframe->payloadleft > 0)) {
  ------------------
  |  Branch (5758:14): [True: 3, False: 57]
  ------------------
 5759|     39|          busy = 1;
 5760|     39|          iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR;
 5761|     39|          break;
 5762|     39|        }
 5763|       |
 5764|       |        /* Check the settings flood counter early to be safe */
 5765|  4.38k|        if (session->obq_flood_counter_ >= session->max_outbound_ack &&
  ------------------
  |  Branch (5765:13): [True: 0, False: 4.38k]
  ------------------
 5766|      0|            !(iframe->frame.hd.flags & NGHTTP2_FLAG_ACK)) {
  ------------------
  |  Branch (5766:13): [True: 0, False: 0]
  ------------------
 5767|      0|          return NGHTTP2_ERR_FLOODED;
 5768|      0|        }
 5769|       |
 5770|  4.38k|        iframe->state = NGHTTP2_IB_READ_SETTINGS;
 5771|       |
 5772|  4.38k|        if (iframe->payloadleft) {
  ------------------
  |  Branch (5772:13): [True: 1.39k, False: 2.99k]
  ------------------
 5773|  1.39k|          nghttp2_settings_entry *min_header_table_size_entry;
 5774|       |
 5775|       |          /* We allocate iv with additional one entry, to store the
 5776|       |             minimum header table size. */
 5777|  1.39k|          iframe->max_niv =
 5778|  1.39k|            iframe->frame.hd.length / NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH + 1;
  ------------------
  |  |   61|  1.39k|#define NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH 6
  ------------------
 5779|       |
 5780|  1.39k|          if (iframe->max_niv - 1 > session->max_settings) {
  ------------------
  |  Branch (5780:15): [True: 3, False: 1.39k]
  ------------------
 5781|      3|            rv = nghttp2_session_terminate_session_with_reason(
 5782|      3|              session, NGHTTP2_ENHANCE_YOUR_CALM,
 5783|      3|              "SETTINGS: too many setting entries");
 5784|      3|            if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (5784:17): [True: 0, False: 3]
  ------------------
 5785|      0|              return rv;
 5786|      0|            }
 5787|      3|            return (nghttp2_ssize)inlen;
 5788|      3|          }
 5789|       |
 5790|  1.39k|          iframe->iv = nghttp2_mem_malloc(mem, sizeof(nghttp2_settings_entry) *
 5791|  1.39k|                                                 iframe->max_niv);
 5792|       |
 5793|  1.39k|          if (!iframe->iv) {
  ------------------
  |  Branch (5793:15): [True: 0, False: 1.39k]
  ------------------
 5794|      0|            return NGHTTP2_ERR_NOMEM;
 5795|      0|          }
 5796|       |
 5797|  1.39k|          min_header_table_size_entry = &iframe->iv[iframe->max_niv - 1];
 5798|  1.39k|          min_header_table_size_entry->settings_id =
 5799|  1.39k|            NGHTTP2_SETTINGS_HEADER_TABLE_SIZE;
 5800|  1.39k|          min_header_table_size_entry->value = UINT32_MAX;
 5801|       |
 5802|  1.39k|          inbound_frame_set_mark(iframe, NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH);
  ------------------
  |  |   61|  1.39k|#define NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH 6
  ------------------
 5803|  1.39k|          break;
 5804|  1.39k|        }
 5805|       |
 5806|  2.99k|        busy = 1;
 5807|       |
 5808|  2.99k|        inbound_frame_set_mark(iframe, 0);
 5809|       |
 5810|  2.99k|        break;
 5811|    224|      case NGHTTP2_PUSH_PROMISE:
  ------------------
  |  Branch (5811:7): [True: 224, False: 10.1k]
  ------------------
 5812|    224|        DEBUGF("recv: PUSH_PROMISE\n");
  ------------------
  |  |   39|    224|    do {                                                                       \
  |  |   40|    224|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 224]
  |  |  ------------------
  ------------------
 5813|       |
 5814|    224|        iframe->frame.hd.flags &=
 5815|    224|          (NGHTTP2_FLAG_END_HEADERS | NGHTTP2_FLAG_PADDED);
 5816|       |
 5817|    224|        rv = inbound_frame_handle_pad(iframe, &iframe->frame.hd);
 5818|    224|        if (rv < 0) {
  ------------------
  |  Branch (5818:13): [True: 2, False: 222]
  ------------------
 5819|      2|          rv = nghttp2_session_terminate_session_with_reason(
 5820|      2|            session, NGHTTP2_PROTOCOL_ERROR,
 5821|      2|            "PUSH_PROMISE: insufficient padding space");
 5822|      2|          if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (5822:15): [True: 0, False: 2]
  ------------------
 5823|      0|            return rv;
 5824|      0|          }
 5825|      2|          return (nghttp2_ssize)inlen;
 5826|      2|        }
 5827|       |
 5828|    222|        if (rv == 1) {
  ------------------
  |  Branch (5828:13): [True: 38, False: 184]
  ------------------
 5829|     38|          iframe->state = NGHTTP2_IB_READ_NBYTE;
 5830|     38|          break;
 5831|     38|        }
 5832|       |
 5833|    184|        if (iframe->payloadleft < 4) {
  ------------------
  |  Branch (5833:13): [True: 5, False: 179]
  ------------------
 5834|      5|          busy = 1;
 5835|      5|          iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR;
 5836|      5|          break;
 5837|      5|        }
 5838|       |
 5839|    179|        iframe->state = NGHTTP2_IB_READ_NBYTE;
 5840|       |
 5841|    179|        inbound_frame_set_mark(iframe, 4);
 5842|       |
 5843|    179|        break;
 5844|    142|      case NGHTTP2_PING:
  ------------------
  |  Branch (5844:7): [True: 142, False: 10.2k]
  ------------------
 5845|    142|        DEBUGF("recv: PING\n");
  ------------------
  |  |   39|    142|    do {                                                                       \
  |  |   40|    142|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 142]
  |  |  ------------------
  ------------------
 5846|       |
 5847|    142|        iframe->frame.hd.flags &= NGHTTP2_FLAG_ACK;
 5848|       |
 5849|    142|        if (iframe->payloadleft != 8) {
  ------------------
  |  Branch (5849:13): [True: 5, False: 137]
  ------------------
 5850|      5|          busy = 1;
 5851|      5|          iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR;
 5852|      5|          break;
 5853|      5|        }
 5854|       |
 5855|    137|        iframe->state = NGHTTP2_IB_READ_NBYTE;
 5856|    137|        inbound_frame_set_mark(iframe, 8);
 5857|       |
 5858|    137|        break;
 5859|    513|      case NGHTTP2_GOAWAY:
  ------------------
  |  Branch (5859:7): [True: 513, False: 9.86k]
  ------------------
 5860|    513|        DEBUGF("recv: GOAWAY\n");
  ------------------
  |  |   39|    513|    do {                                                                       \
  |  |   40|    513|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 513]
  |  |  ------------------
  ------------------
 5861|       |
 5862|    513|        iframe->frame.hd.flags = NGHTTP2_FLAG_NONE;
 5863|       |
 5864|    513|        if (iframe->payloadleft < 8) {
  ------------------
  |  Branch (5864:13): [True: 7, False: 506]
  ------------------
 5865|      7|          busy = 1;
 5866|      7|          iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR;
 5867|      7|          break;
 5868|      7|        }
 5869|       |
 5870|    506|        iframe->state = NGHTTP2_IB_READ_NBYTE;
 5871|    506|        inbound_frame_set_mark(iframe, 8);
 5872|       |
 5873|    506|        break;
 5874|     14|      case NGHTTP2_CONTINUATION:
  ------------------
  |  Branch (5874:7): [True: 14, False: 10.3k]
  ------------------
 5875|     14|        DEBUGF("recv: unexpected CONTINUATION\n");
  ------------------
  |  |   39|     14|    do {                                                                       \
  |  |   40|     14|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 14]
  |  |  ------------------
  ------------------
 5876|       |
 5877|       |        /* Receiving CONTINUATION in this state are subject to
 5878|       |           connection error of type PROTOCOL_ERROR */
 5879|     14|        rv = nghttp2_session_terminate_session_with_reason(
 5880|     14|          session, NGHTTP2_PROTOCOL_ERROR, "CONTINUATION: unexpected");
 5881|     14|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (5881:13): [True: 0, False: 14]
  ------------------
 5882|      0|          return rv;
 5883|      0|        }
 5884|       |
 5885|     14|        return (nghttp2_ssize)inlen;
 5886|  1.56k|      default:
  ------------------
  |  Branch (5886:7): [True: 1.56k, False: 8.81k]
  ------------------
 5887|  1.56k|        DEBUGF("recv: extension frame\n");
  ------------------
  |  |   39|  1.56k|    do {                                                                       \
  |  |   40|  1.56k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 1.56k]
  |  |  ------------------
  ------------------
 5888|       |
 5889|  1.56k|        if (check_ext_type_set(session->user_recv_ext_types,
  ------------------
  |  Branch (5889:13): [True: 0, False: 1.56k]
  ------------------
 5890|  1.56k|                               iframe->frame.hd.type)) {
 5891|      0|          if (!session->callbacks.unpack_extension_callback) {
  ------------------
  |  Branch (5891:15): [True: 0, False: 0]
  ------------------
 5892|       |            /* Receiving too frequent unknown frames is suspicious. */
 5893|      0|            rv = session_update_glitch_ratelim(session);
 5894|      0|            if (rv != 0) {
  ------------------
  |  Branch (5894:17): [True: 0, False: 0]
  ------------------
 5895|      0|              return rv;
 5896|      0|            }
 5897|       |
 5898|      0|            if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (5898:17): [True: 0, False: 0]
  ------------------
 5899|      0|              return (nghttp2_ssize)inlen;
 5900|      0|            }
 5901|       |
 5902|       |            /* Silently ignore unknown frame type. */
 5903|      0|            busy = 1;
 5904|       |
 5905|      0|            iframe->state = NGHTTP2_IB_IGN_PAYLOAD;
 5906|       |
 5907|      0|            break;
 5908|      0|          }
 5909|       |
 5910|      0|          busy = 1;
 5911|       |
 5912|      0|          iframe->state = NGHTTP2_IB_READ_EXTENSION_PAYLOAD;
 5913|       |
 5914|      0|          break;
 5915|  1.56k|        } else {
 5916|  1.56k|          switch (iframe->frame.hd.type) {
 5917|     43|          case NGHTTP2_ALTSVC:
  ------------------
  |  Branch (5917:11): [True: 43, False: 1.51k]
  ------------------
 5918|     43|            if ((session->builtin_recv_ext_types & NGHTTP2_TYPEMASK_ALTSVC) ==
  ------------------
  |  Branch (5918:17): [True: 43, False: 0]
  ------------------
 5919|     43|                0) {
 5920|       |              /* Receiving too frequent unknown frames is suspicious. */
 5921|     43|              rv = session_update_glitch_ratelim(session);
 5922|     43|              if (rv != 0) {
  ------------------
  |  Branch (5922:19): [True: 0, False: 43]
  ------------------
 5923|      0|                return rv;
 5924|      0|              }
 5925|       |
 5926|     43|              if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (5926:19): [True: 0, False: 43]
  ------------------
 5927|      0|                return (nghttp2_ssize)inlen;
 5928|      0|              }
 5929|       |
 5930|     43|              busy = 1;
 5931|     43|              iframe->state = NGHTTP2_IB_IGN_PAYLOAD;
 5932|     43|              break;
 5933|     43|            }
 5934|       |
 5935|      0|            DEBUGF("recv: ALTSVC\n");
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 5936|       |
 5937|      0|            iframe->frame.hd.flags = NGHTTP2_FLAG_NONE;
 5938|      0|            iframe->frame.ext.payload = &iframe->ext_frame_payload.altsvc;
 5939|       |
 5940|      0|            if (session->server) {
  ------------------
  |  Branch (5940:17): [True: 0, False: 0]
  ------------------
 5941|       |              /* Receiving too frequent ALTSVC from client is
 5942|       |                 suspicious. */
 5943|      0|              rv = session_update_glitch_ratelim(session);
 5944|      0|              if (rv != 0) {
  ------------------
  |  Branch (5944:19): [True: 0, False: 0]
  ------------------
 5945|      0|                return rv;
 5946|      0|              }
 5947|       |
 5948|      0|              if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (5948:19): [True: 0, False: 0]
  ------------------
 5949|      0|                return (nghttp2_ssize)inlen;
 5950|      0|              }
 5951|       |
 5952|      0|              busy = 1;
 5953|      0|              iframe->state = NGHTTP2_IB_IGN_PAYLOAD;
 5954|      0|              break;
 5955|      0|            }
 5956|       |
 5957|      0|            if (iframe->payloadleft < 2) {
  ------------------
  |  Branch (5957:17): [True: 0, False: 0]
  ------------------
 5958|      0|              busy = 1;
 5959|      0|              iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR;
 5960|      0|              break;
 5961|      0|            }
 5962|       |
 5963|      0|            busy = 1;
 5964|       |
 5965|      0|            iframe->state = NGHTTP2_IB_READ_NBYTE;
 5966|      0|            inbound_frame_set_mark(iframe, 2);
 5967|       |
 5968|      0|            break;
 5969|     24|          case NGHTTP2_ORIGIN:
  ------------------
  |  Branch (5969:11): [True: 24, False: 1.53k]
  ------------------
 5970|     24|            if (!(session->builtin_recv_ext_types & NGHTTP2_TYPEMASK_ORIGIN)) {
  ------------------
  |  Branch (5970:17): [True: 24, False: 0]
  ------------------
 5971|       |              /* Receiving too frequent unknown frames is suspicious. */
 5972|     24|              rv = session_update_glitch_ratelim(session);
 5973|     24|              if (rv != 0) {
  ------------------
  |  Branch (5973:19): [True: 0, False: 24]
  ------------------
 5974|      0|                return rv;
 5975|      0|              }
 5976|       |
 5977|     24|              if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (5977:19): [True: 0, False: 24]
  ------------------
 5978|      0|                return (nghttp2_ssize)inlen;
 5979|      0|              }
 5980|       |
 5981|     24|              busy = 1;
 5982|     24|              iframe->state = NGHTTP2_IB_IGN_PAYLOAD;
 5983|     24|              break;
 5984|     24|            }
 5985|       |
 5986|      0|            DEBUGF("recv: ORIGIN\n");
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 5987|       |
 5988|      0|            iframe->frame.ext.payload = &iframe->ext_frame_payload.origin;
 5989|       |
 5990|      0|            if (session->server || iframe->frame.hd.stream_id ||
  ------------------
  |  Branch (5990:17): [True: 0, False: 0]
  |  Branch (5990:36): [True: 0, False: 0]
  ------------------
 5991|      0|                (iframe->frame.hd.flags & 0xf0)) {
  ------------------
  |  Branch (5991:17): [True: 0, False: 0]
  ------------------
 5992|       |              /* Receiving too frequent invalid frames is
 5993|       |                 suspicious. */
 5994|      0|              rv = session_update_glitch_ratelim(session);
 5995|      0|              if (rv != 0) {
  ------------------
  |  Branch (5995:19): [True: 0, False: 0]
  ------------------
 5996|      0|                return rv;
 5997|      0|              }
 5998|       |
 5999|      0|              if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (5999:19): [True: 0, False: 0]
  ------------------
 6000|      0|                return (nghttp2_ssize)inlen;
 6001|      0|              }
 6002|       |
 6003|      0|              busy = 1;
 6004|      0|              iframe->state = NGHTTP2_IB_IGN_PAYLOAD;
 6005|      0|              break;
 6006|      0|            }
 6007|       |
 6008|      0|            iframe->frame.hd.flags = NGHTTP2_FLAG_NONE;
 6009|       |
 6010|      0|            if (iframe->payloadleft) {
  ------------------
  |  Branch (6010:17): [True: 0, False: 0]
  ------------------
 6011|      0|              iframe->raw_lbuf = nghttp2_mem_malloc(mem, iframe->payloadleft);
 6012|       |
 6013|      0|              if (iframe->raw_lbuf == NULL) {
  ------------------
  |  Branch (6013:19): [True: 0, False: 0]
  ------------------
 6014|      0|                return NGHTTP2_ERR_NOMEM;
 6015|      0|              }
 6016|       |
 6017|      0|              nghttp2_buf_wrap_init(&iframe->lbuf, iframe->raw_lbuf,
 6018|      0|                                    iframe->payloadleft);
 6019|      0|            } else {
 6020|      0|              busy = 1;
 6021|      0|            }
 6022|       |
 6023|      0|            iframe->state = NGHTTP2_IB_READ_ORIGIN_PAYLOAD;
 6024|       |
 6025|      0|            break;
 6026|     77|          case NGHTTP2_PRIORITY_UPDATE:
  ------------------
  |  Branch (6026:11): [True: 77, False: 1.48k]
  ------------------
 6027|     77|            if ((session->builtin_recv_ext_types &
  ------------------
  |  Branch (6027:17): [True: 77, False: 0]
  ------------------
 6028|     77|                 NGHTTP2_TYPEMASK_PRIORITY_UPDATE) == 0) {
 6029|       |              /* Receiving too frequent unknown frames is suspicious. */
 6030|     77|              rv = session_update_glitch_ratelim(session);
 6031|     77|              if (rv != 0) {
  ------------------
  |  Branch (6031:19): [True: 0, False: 77]
  ------------------
 6032|      0|                return rv;
 6033|      0|              }
 6034|       |
 6035|     77|              if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6035:19): [True: 0, False: 77]
  ------------------
 6036|      0|                return (nghttp2_ssize)inlen;
 6037|      0|              }
 6038|       |
 6039|     77|              busy = 1;
 6040|     77|              iframe->state = NGHTTP2_IB_IGN_PAYLOAD;
 6041|     77|              break;
 6042|     77|            }
 6043|       |
 6044|      0|            DEBUGF("recv: PRIORITY_UPDATE\n");
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6045|       |
 6046|      0|            iframe->frame.hd.flags = NGHTTP2_FLAG_NONE;
 6047|      0|            iframe->frame.ext.payload =
 6048|      0|              &iframe->ext_frame_payload.priority_update;
 6049|       |
 6050|      0|            if (!session->server) {
  ------------------
  |  Branch (6050:17): [True: 0, False: 0]
  ------------------
 6051|      0|              rv = nghttp2_session_terminate_session_with_reason(
 6052|      0|                session, NGHTTP2_PROTOCOL_ERROR,
 6053|      0|                "PRIORITY_UPDATE is received from server");
 6054|      0|              if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6054:19): [True: 0, False: 0]
  ------------------
 6055|      0|                return rv;
 6056|      0|              }
 6057|      0|              return (nghttp2_ssize)inlen;
 6058|      0|            }
 6059|       |
 6060|      0|            if (iframe->payloadleft < 4) {
  ------------------
  |  Branch (6060:17): [True: 0, False: 0]
  ------------------
 6061|      0|              busy = 1;
 6062|      0|              iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR;
 6063|      0|              break;
 6064|      0|            }
 6065|       |
 6066|       |            /* Receiving too frequent PRIORITY_UPDATE is
 6067|       |               suspicious. */
 6068|      0|            rv = session_update_glitch_ratelim(session);
 6069|      0|            if (rv != 0) {
  ------------------
  |  Branch (6069:17): [True: 0, False: 0]
  ------------------
 6070|      0|              return rv;
 6071|      0|            }
 6072|       |
 6073|      0|            if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6073:17): [True: 0, False: 0]
  ------------------
 6074|      0|              return (nghttp2_ssize)inlen;
 6075|      0|            }
 6076|       |
 6077|      0|            if (iframe->payloadleft > sizeof(iframe->raw_sbuf)) {
  ------------------
  |  Branch (6077:17): [True: 0, False: 0]
  ------------------
 6078|      0|              busy = 1;
 6079|      0|              iframe->state = NGHTTP2_IB_IGN_PAYLOAD;
 6080|      0|              break;
 6081|      0|            }
 6082|       |
 6083|      0|            busy = 1;
 6084|       |
 6085|      0|            iframe->state = NGHTTP2_IB_READ_NBYTE;
 6086|      0|            inbound_frame_set_mark(iframe, iframe->payloadleft);
 6087|       |
 6088|      0|            break;
 6089|  1.41k|          default:
  ------------------
  |  Branch (6089:11): [True: 1.41k, False: 144]
  ------------------
 6090|       |            /* Receiving too frequent unknown frames is suspicious. */
 6091|  1.41k|            rv = session_update_glitch_ratelim(session);
 6092|  1.41k|            if (rv != 0) {
  ------------------
  |  Branch (6092:17): [True: 0, False: 1.41k]
  ------------------
 6093|      0|              return rv;
 6094|      0|            }
 6095|       |
 6096|  1.41k|            if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6096:17): [True: 0, False: 1.41k]
  ------------------
 6097|      0|              return (nghttp2_ssize)inlen;
 6098|      0|            }
 6099|       |
 6100|  1.41k|            busy = 1;
 6101|       |
 6102|  1.41k|            iframe->state = NGHTTP2_IB_IGN_PAYLOAD;
 6103|       |
 6104|  1.41k|            break;
 6105|  1.56k|          }
 6106|  1.56k|        }
 6107|  10.3k|      }
 6108|       |
 6109|  10.1k|      if (!on_begin_frame_called) {
  ------------------
  |  Branch (6109:11): [True: 9.58k, False: 596]
  ------------------
 6110|  9.58k|        switch (iframe->state) {
 6111|      0|        case NGHTTP2_IB_IGN_HEADER_BLOCK:
  ------------------
  |  Branch (6111:9): [True: 0, False: 9.58k]
  ------------------
 6112|  1.56k|        case NGHTTP2_IB_IGN_PAYLOAD:
  ------------------
  |  Branch (6112:9): [True: 1.56k, False: 8.02k]
  ------------------
 6113|  1.63k|        case NGHTTP2_IB_FRAME_SIZE_ERROR:
  ------------------
  |  Branch (6113:9): [True: 72, False: 9.51k]
  ------------------
 6114|  1.97k|        case NGHTTP2_IB_IGN_DATA:
  ------------------
  |  Branch (6114:9): [True: 339, False: 9.24k]
  ------------------
 6115|  1.97k|        case NGHTTP2_IB_IGN_ALL:
  ------------------
  |  Branch (6115:9): [True: 0, False: 9.58k]
  ------------------
 6116|  1.97k|          break;
 6117|  7.61k|        default:
  ------------------
  |  Branch (6117:9): [True: 7.61k, False: 1.97k]
  ------------------
 6118|  7.61k|          rv = session_call_on_begin_frame(session, &iframe->frame.hd);
 6119|       |
 6120|  7.61k|          if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6120:15): [True: 0, False: 7.61k]
  ------------------
 6121|      0|            return rv;
 6122|      0|          }
 6123|       |
 6124|  7.61k|          if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6124:15): [True: 0, False: 7.61k]
  ------------------
 6125|      0|            return (nghttp2_ssize)inlen;
 6126|      0|          }
 6127|  9.58k|        }
 6128|  9.58k|      }
 6129|       |
 6130|  10.1k|      break;
 6131|  10.1k|    }
 6132|  10.1k|    case NGHTTP2_IB_READ_NBYTE:
  ------------------
  |  Branch (6132:5): [True: 2.92k, False: 33.4k]
  ------------------
 6133|  2.92k|      DEBUGF("recv: [IB_READ_NBYTE]\n");
  ------------------
  |  |   39|  2.92k|    do {                                                                       \
  |  |   40|  2.92k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 2.92k]
  |  |  ------------------
  ------------------
 6134|       |
 6135|  2.92k|      readlen = inbound_frame_buf_read(iframe, in, last);
 6136|  2.92k|      in += readlen;
 6137|  2.92k|      iframe->payloadleft -= readlen;
 6138|       |
 6139|  2.92k|      DEBUGF("recv: readlen=%zu, payloadleft=%zu, left=%zu\n", readlen,
  ------------------
  |  |   39|  2.92k|    do {                                                                       \
  |  |   40|  2.92k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 2.92k]
  |  |  ------------------
  ------------------
 6140|  2.92k|             iframe->payloadleft, nghttp2_buf_mark_avail(&iframe->sbuf));
 6141|       |
 6142|  2.92k|      if (nghttp2_buf_mark_avail(&iframe->sbuf)) {
  ------------------
  |  |   56|  2.92k|#define nghttp2_buf_mark_avail(BUF) ((size_t)((BUF)->mark - (BUF)->last))
  |  |  ------------------
  |  |  |  Branch (56:37): [True: 4, False: 2.92k]
  |  |  ------------------
  ------------------
 6143|      4|        return (nghttp2_ssize)(in - first);
 6144|      4|      }
 6145|       |
 6146|  2.92k|      switch (iframe->frame.hd.type) {
 6147|  1.54k|      case NGHTTP2_HEADERS:
  ------------------
  |  Branch (6147:7): [True: 1.54k, False: 1.38k]
  ------------------
 6148|  1.54k|        if (iframe->padlen == 0 &&
  ------------------
  |  Branch (6148:13): [True: 1.46k, False: 73]
  ------------------
 6149|  1.46k|            (iframe->frame.hd.flags & NGHTTP2_FLAG_PADDED)) {
  ------------------
  |  Branch (6149:13): [True: 1.01k, False: 453]
  ------------------
 6150|  1.01k|          pri_fieldlen = nghttp2_frame_priority_len(iframe->frame.hd.flags);
 6151|  1.01k|          padlen = inbound_frame_compute_pad(iframe);
 6152|  1.01k|          if (padlen < 0 ||
  ------------------
  |  Branch (6152:15): [True: 4, False: 1.01k]
  ------------------
 6153|  1.01k|              (size_t)padlen + pri_fieldlen > 1 + iframe->payloadleft) {
  ------------------
  |  Branch (6153:15): [True: 2, False: 1.01k]
  ------------------
 6154|      6|            rv = nghttp2_session_terminate_session_with_reason(
 6155|      6|              session, NGHTTP2_PROTOCOL_ERROR, "HEADERS: invalid padding");
 6156|      6|            if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6156:17): [True: 0, False: 6]
  ------------------
 6157|      0|              return rv;
 6158|      0|            }
 6159|      6|            return (nghttp2_ssize)inlen;
 6160|      6|          }
 6161|  1.01k|          iframe->frame.headers.padlen = (size_t)padlen;
 6162|       |
 6163|  1.01k|          if (pri_fieldlen > 0) {
  ------------------
  |  Branch (6163:15): [True: 73, False: 937]
  ------------------
 6164|     73|            if (iframe->payloadleft < pri_fieldlen) {
  ------------------
  |  Branch (6164:17): [True: 0, False: 73]
  ------------------
 6165|      0|              busy = 1;
 6166|      0|              iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR;
 6167|      0|              break;
 6168|      0|            }
 6169|     73|            iframe->state = NGHTTP2_IB_READ_NBYTE;
 6170|     73|            inbound_frame_set_mark(iframe, pri_fieldlen);
 6171|     73|            break;
 6172|    937|          } else {
 6173|       |            /* Truncate buffers used for padding spec */
 6174|    937|            inbound_frame_set_mark(iframe, 0);
 6175|    937|          }
 6176|  1.01k|        }
 6177|       |
 6178|  1.46k|        rv = session_process_headers_frame(session);
 6179|  1.46k|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6179:13): [True: 49, False: 1.41k]
  ------------------
 6180|     49|          return rv;
 6181|     49|        }
 6182|       |
 6183|  1.41k|        busy = 1;
 6184|       |
 6185|  1.41k|        if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6185:13): [True: 1, False: 1.41k]
  ------------------
 6186|      1|          return (nghttp2_ssize)inlen;
 6187|      1|        }
 6188|       |
 6189|  1.41k|        if (rv == NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE) {
  ------------------
  |  Branch (6189:13): [True: 0, False: 1.41k]
  ------------------
 6190|      0|          rv = session_handle_invalid_stream2(
 6191|      0|            session, iframe->frame.hd.stream_id, NULL, NGHTTP2_ERR_INTERNAL);
 6192|      0|          if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6192:15): [True: 0, False: 0]
  ------------------
 6193|      0|            return rv;
 6194|      0|          }
 6195|      0|          iframe->state = NGHTTP2_IB_IGN_HEADER_BLOCK;
 6196|      0|          break;
 6197|      0|        }
 6198|       |
 6199|  1.41k|        if (rv == NGHTTP2_ERR_IGN_HEADER_BLOCK) {
  ------------------
  |  Branch (6199:13): [True: 37, False: 1.37k]
  ------------------
 6200|     37|          rv = session_update_glitch_ratelim(session);
 6201|     37|          if (rv != 0) {
  ------------------
  |  Branch (6201:15): [True: 0, False: 37]
  ------------------
 6202|      0|            return rv;
 6203|      0|          }
 6204|       |
 6205|     37|          if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6205:15): [True: 0, False: 37]
  ------------------
 6206|      0|            return (nghttp2_ssize)inlen;
 6207|      0|          }
 6208|       |
 6209|     37|          iframe->state = NGHTTP2_IB_IGN_HEADER_BLOCK;
 6210|     37|          break;
 6211|     37|        }
 6212|       |
 6213|  1.37k|        iframe->state = NGHTTP2_IB_READ_HEADER_BLOCK;
 6214|       |
 6215|  1.37k|        break;
 6216|      5|      case NGHTTP2_PRIORITY:
  ------------------
  |  Branch (6216:7): [True: 5, False: 2.91k]
  ------------------
 6217|      5|        session_inbound_frame_reset(session);
 6218|       |
 6219|      5|        break;
 6220|    276|      case NGHTTP2_RST_STREAM:
  ------------------
  |  Branch (6220:7): [True: 276, False: 2.64k]
  ------------------
 6221|    276|        rv = session_process_rst_stream_frame(session);
 6222|    276|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6222:13): [True: 32, False: 244]
  ------------------
 6223|     32|          return rv;
 6224|     32|        }
 6225|       |
 6226|    244|        if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6226:13): [True: 0, False: 244]
  ------------------
 6227|      0|          return (nghttp2_ssize)inlen;
 6228|      0|        }
 6229|       |
 6230|    244|        session_inbound_frame_reset(session);
 6231|       |
 6232|    244|        break;
 6233|    250|      case NGHTTP2_PUSH_PROMISE:
  ------------------
  |  Branch (6233:7): [True: 250, False: 2.67k]
  ------------------
 6234|    250|        if (iframe->padlen == 0 &&
  ------------------
  |  Branch (6234:13): [True: 217, False: 33]
  ------------------
 6235|    217|            (iframe->frame.hd.flags & NGHTTP2_FLAG_PADDED)) {
  ------------------
  |  Branch (6235:13): [True: 38, False: 179]
  ------------------
 6236|     38|          padlen = inbound_frame_compute_pad(iframe);
 6237|     38|          if (padlen < 0 || (size_t)padlen + 4 /* promised stream id */
  ------------------
  |  Branch (6237:15): [True: 3, False: 35]
  |  Branch (6237:29): [True: 2, False: 33]
  ------------------
 6238|     35|                              > 1 + iframe->payloadleft) {
 6239|      5|            rv = nghttp2_session_terminate_session_with_reason(
 6240|      5|              session, NGHTTP2_PROTOCOL_ERROR, "PUSH_PROMISE: invalid padding");
 6241|      5|            if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6241:17): [True: 0, False: 5]
  ------------------
 6242|      0|              return rv;
 6243|      0|            }
 6244|      5|            return (nghttp2_ssize)inlen;
 6245|      5|          }
 6246|       |
 6247|     33|          iframe->frame.push_promise.padlen = (size_t)padlen;
 6248|       |
 6249|     33|          if (iframe->payloadleft < 4) {
  ------------------
  |  Branch (6249:15): [True: 0, False: 33]
  ------------------
 6250|      0|            busy = 1;
 6251|      0|            iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR;
 6252|      0|            break;
 6253|      0|          }
 6254|       |
 6255|     33|          iframe->state = NGHTTP2_IB_READ_NBYTE;
 6256|       |
 6257|     33|          inbound_frame_set_mark(iframe, 4);
 6258|       |
 6259|     33|          break;
 6260|     33|        }
 6261|       |
 6262|    212|        rv = session_process_push_promise_frame(session);
 6263|    212|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6263:13): [True: 45, False: 167]
  ------------------
 6264|     45|          return rv;
 6265|     45|        }
 6266|       |
 6267|    167|        busy = 1;
 6268|       |
 6269|    167|        if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6269:13): [True: 12, False: 155]
  ------------------
 6270|     12|          return (nghttp2_ssize)inlen;
 6271|     12|        }
 6272|       |
 6273|    155|        if (rv == NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE) {
  ------------------
  |  Branch (6273:13): [True: 0, False: 155]
  ------------------
 6274|      0|          rv = session_handle_invalid_stream2(
 6275|      0|            session, iframe->frame.push_promise.promised_stream_id, NULL,
 6276|      0|            NGHTTP2_ERR_INTERNAL);
 6277|      0|          if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6277:15): [True: 0, False: 0]
  ------------------
 6278|      0|            return rv;
 6279|      0|          }
 6280|      0|          iframe->state = NGHTTP2_IB_IGN_HEADER_BLOCK;
 6281|      0|          break;
 6282|      0|        }
 6283|       |
 6284|    155|        if (rv == NGHTTP2_ERR_IGN_HEADER_BLOCK) {
  ------------------
  |  Branch (6284:13): [True: 155, False: 0]
  ------------------
 6285|    155|          iframe->state = NGHTTP2_IB_IGN_HEADER_BLOCK;
 6286|    155|          break;
 6287|    155|        }
 6288|       |
 6289|      0|        iframe->state = NGHTTP2_IB_READ_HEADER_BLOCK;
 6290|       |
 6291|      0|        break;
 6292|    135|      case NGHTTP2_PING:
  ------------------
  |  Branch (6292:7): [True: 135, False: 2.78k]
  ------------------
 6293|    135|        rv = session_process_ping_frame(session);
 6294|    135|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6294:13): [True: 15, False: 120]
  ------------------
 6295|     15|          return rv;
 6296|     15|        }
 6297|       |
 6298|    120|        if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6298:13): [True: 1, False: 119]
  ------------------
 6299|      1|          return (nghttp2_ssize)inlen;
 6300|      1|        }
 6301|       |
 6302|    119|        session_inbound_frame_reset(session);
 6303|       |
 6304|    119|        break;
 6305|    506|      case NGHTTP2_GOAWAY: {
  ------------------
  |  Branch (6305:7): [True: 506, False: 2.41k]
  ------------------
 6306|    506|        size_t debuglen;
 6307|       |
 6308|       |        /* 8 is Last-stream-ID + Error Code */
 6309|    506|        debuglen = iframe->frame.hd.length - 8;
 6310|       |
 6311|    506|        if (debuglen > 0) {
  ------------------
  |  Branch (6311:13): [True: 355, False: 151]
  ------------------
 6312|    355|          iframe->raw_lbuf = nghttp2_mem_malloc(mem, debuglen);
 6313|       |
 6314|    355|          if (iframe->raw_lbuf == NULL) {
  ------------------
  |  Branch (6314:15): [True: 0, False: 355]
  ------------------
 6315|      0|            return NGHTTP2_ERR_NOMEM;
 6316|      0|          }
 6317|       |
 6318|    355|          nghttp2_buf_wrap_init(&iframe->lbuf, iframe->raw_lbuf, debuglen);
 6319|    355|        }
 6320|       |
 6321|    506|        busy = 1;
 6322|       |
 6323|    506|        iframe->state = NGHTTP2_IB_READ_GOAWAY_DEBUG;
 6324|       |
 6325|    506|        break;
 6326|    506|      }
 6327|    209|      case NGHTTP2_WINDOW_UPDATE:
  ------------------
  |  Branch (6327:7): [True: 209, False: 2.71k]
  ------------------
 6328|    209|        rv = session_process_window_update_frame(session);
 6329|    209|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6329:13): [True: 36, False: 173]
  ------------------
 6330|     36|          return rv;
 6331|     36|        }
 6332|       |
 6333|    173|        if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6333:13): [True: 2, False: 171]
  ------------------
 6334|      2|          return (nghttp2_ssize)inlen;
 6335|      2|        }
 6336|       |
 6337|    171|        session_inbound_frame_reset(session);
 6338|       |
 6339|    171|        break;
 6340|      0|      case NGHTTP2_ALTSVC: {
  ------------------
  |  Branch (6340:7): [True: 0, False: 2.92k]
  ------------------
 6341|      0|        size_t origin_len;
 6342|       |
 6343|      0|        origin_len = nghttp2_get_uint16(iframe->sbuf.pos);
 6344|       |
 6345|      0|        DEBUGF("recv: origin_len=%zu\n", origin_len);
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6346|       |
 6347|      0|        if (origin_len > iframe->payloadleft) {
  ------------------
  |  Branch (6347:13): [True: 0, False: 0]
  ------------------
 6348|      0|          busy = 1;
 6349|      0|          iframe->state = NGHTTP2_IB_FRAME_SIZE_ERROR;
 6350|      0|          break;
 6351|      0|        }
 6352|       |
 6353|      0|        if (iframe->frame.hd.length > 2) {
  ------------------
  |  Branch (6353:13): [True: 0, False: 0]
  ------------------
 6354|      0|          iframe->raw_lbuf =
 6355|      0|            nghttp2_mem_malloc(mem, iframe->frame.hd.length - 2);
 6356|       |
 6357|      0|          if (iframe->raw_lbuf == NULL) {
  ------------------
  |  Branch (6357:15): [True: 0, False: 0]
  ------------------
 6358|      0|            return NGHTTP2_ERR_NOMEM;
 6359|      0|          }
 6360|       |
 6361|      0|          nghttp2_buf_wrap_init(&iframe->lbuf, iframe->raw_lbuf,
 6362|      0|                                iframe->frame.hd.length);
 6363|      0|        }
 6364|       |
 6365|      0|        busy = 1;
 6366|       |
 6367|      0|        iframe->state = NGHTTP2_IB_READ_ALTSVC_PAYLOAD;
 6368|       |
 6369|      0|        break;
 6370|      0|      case NGHTTP2_PRIORITY_UPDATE:
  ------------------
  |  Branch (6370:7): [True: 0, False: 2.92k]
  ------------------
 6371|      0|        DEBUGF("recv: prioritized_stream_id=%d\n",
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6372|      0|               nghttp2_get_uint32(iframe->sbuf.pos) & NGHTTP2_STREAM_ID_MASK);
 6373|       |
 6374|      0|        rv = session_process_priority_update_frame(session);
 6375|      0|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6375:13): [True: 0, False: 0]
  ------------------
 6376|      0|          return rv;
 6377|      0|        }
 6378|       |
 6379|      0|        if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6379:13): [True: 0, False: 0]
  ------------------
 6380|      0|          return (nghttp2_ssize)inlen;
 6381|      0|        }
 6382|       |
 6383|      0|        session_inbound_frame_reset(session);
 6384|       |
 6385|      0|        break;
 6386|      0|      }
 6387|      0|      default:
  ------------------
  |  Branch (6387:7): [True: 0, False: 2.92k]
  ------------------
 6388|       |        /* This is unknown frame */
 6389|      0|        session_inbound_frame_reset(session);
 6390|       |
 6391|      0|        break;
 6392|  2.92k|      }
 6393|  2.71k|      break;
 6394|  2.71k|    case NGHTTP2_IB_READ_HEADER_BLOCK:
  ------------------
  |  Branch (6394:5): [True: 1.91k, False: 34.4k]
  ------------------
 6395|  2.88k|    case NGHTTP2_IB_IGN_HEADER_BLOCK: {
  ------------------
  |  Branch (6395:5): [True: 977, False: 35.3k]
  ------------------
 6396|  2.88k|      nghttp2_ssize data_readlen;
 6397|  2.88k|      size_t trail_padlen;
 6398|  2.88k|      int final;
 6399|       |#ifdef DEBUGBUILD
 6400|       |      if (iframe->state == NGHTTP2_IB_READ_HEADER_BLOCK) {
 6401|       |        DEBUGF("recv: [IB_READ_HEADER_BLOCK]\n");
 6402|       |      } else {
 6403|       |        DEBUGF("recv: [IB_IGN_HEADER_BLOCK]\n");
 6404|       |      }
 6405|       |#endif /* defined(DEBUGBUILD) */
 6406|       |
 6407|  2.88k|      readlen = inbound_frame_payload_readlen(iframe, in, last);
 6408|       |
 6409|  2.88k|      DEBUGF("recv: readlen=%zu, payloadleft=%zu\n", readlen,
  ------------------
  |  |   39|  2.88k|    do {                                                                       \
  |  |   40|  2.88k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 2.88k]
  |  |  ------------------
  ------------------
 6410|  2.88k|             iframe->payloadleft - readlen);
 6411|       |
 6412|  2.88k|      data_readlen = inbound_frame_effective_readlen(
 6413|  2.88k|        iframe, iframe->payloadleft - readlen, readlen);
 6414|       |
 6415|  2.88k|      if (data_readlen == -1) {
  ------------------
  |  Branch (6415:11): [True: 1, False: 2.88k]
  ------------------
 6416|       |        /* everything is padding */
 6417|      1|        data_readlen = 0;
 6418|      1|      }
 6419|       |
 6420|  2.88k|      trail_padlen = nghttp2_frame_trail_padlen(&iframe->frame, iframe->padlen);
 6421|       |
 6422|  2.88k|      final = (iframe->frame.hd.flags & NGHTTP2_FLAG_END_HEADERS) &&
  ------------------
  |  Branch (6422:15): [True: 2.41k, False: 472]
  ------------------
 6423|  2.41k|              iframe->payloadleft - (size_t)data_readlen == trail_padlen;
  ------------------
  |  Branch (6423:15): [True: 566, False: 1.85k]
  ------------------
 6424|       |
 6425|  2.88k|      if (data_readlen > 0 || (data_readlen == 0 && final)) {
  ------------------
  |  Branch (6425:11): [True: 2.65k, False: 237]
  |  Branch (6425:32): [True: 237, False: 0]
  |  Branch (6425:53): [True: 225, False: 12]
  ------------------
 6426|  2.87k|        size_t hd_proclen = 0;
 6427|       |
 6428|  2.87k|        DEBUGF("recv: block final=%d\n", final);
  ------------------
  |  |   39|  2.87k|    do {                                                                       \
  |  |   40|  2.87k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 2.87k]
  |  |  ------------------
  ------------------
 6429|       |
 6430|  2.87k|        rv =
 6431|  2.87k|          inflate_header_block(session, &iframe->frame, &hd_proclen,
 6432|  2.87k|                               (uint8_t *)in, (size_t)data_readlen, final,
 6433|  2.87k|                               iframe->state == NGHTTP2_IB_READ_HEADER_BLOCK);
 6434|       |
 6435|  2.87k|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6435:13): [True: 0, False: 2.87k]
  ------------------
 6436|      0|          return rv;
 6437|      0|        }
 6438|       |
 6439|  2.87k|        if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6439:13): [True: 1.00k, False: 1.87k]
  ------------------
 6440|  1.00k|          return (nghttp2_ssize)inlen;
 6441|  1.00k|        }
 6442|       |
 6443|  1.87k|        if (rv == NGHTTP2_ERR_PAUSE) {
  ------------------
  |  Branch (6443:13): [True: 0, False: 1.87k]
  ------------------
 6444|      0|          in += hd_proclen;
 6445|      0|          iframe->payloadleft -= hd_proclen;
 6446|       |
 6447|      0|          return (nghttp2_ssize)(in - first);
 6448|      0|        }
 6449|       |
 6450|  1.87k|        if (rv == NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE) {
  ------------------
  |  Branch (6450:13): [True: 564, False: 1.31k]
  ------------------
 6451|       |          /* The application says no more headers. We decompress the
 6452|       |             rest of the header block but not invoke on_header_callback
 6453|       |             and on_frame_recv_callback. */
 6454|    564|          in += hd_proclen;
 6455|    564|          iframe->payloadleft -= hd_proclen;
 6456|       |
 6457|       |          /* Use promised stream ID for PUSH_PROMISE */
 6458|    564|          rv = session_handle_invalid_stream2(
 6459|    564|            session,
 6460|    564|            iframe->frame.hd.type == NGHTTP2_PUSH_PROMISE
  ------------------
  |  Branch (6460:13): [True: 0, False: 564]
  ------------------
 6461|    564|              ? iframe->frame.push_promise.promised_stream_id
 6462|    564|              : iframe->frame.hd.stream_id,
 6463|    564|            NULL, NGHTTP2_ERR_INTERNAL);
 6464|    564|          if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6464:15): [True: 0, False: 564]
  ------------------
 6465|      0|            return rv;
 6466|      0|          }
 6467|    564|          busy = 1;
 6468|    564|          iframe->state = NGHTTP2_IB_IGN_HEADER_BLOCK;
 6469|    564|          break;
 6470|    564|        }
 6471|       |
 6472|  1.31k|        in += readlen;
 6473|  1.31k|        iframe->payloadleft -= readlen;
 6474|       |
 6475|  1.31k|        if (rv == NGHTTP2_ERR_HEADER_COMP) {
  ------------------
  |  Branch (6475:13): [True: 0, False: 1.31k]
  ------------------
 6476|       |          /* GOAWAY is already issued */
 6477|      0|          if (iframe->payloadleft == 0) {
  ------------------
  |  Branch (6477:15): [True: 0, False: 0]
  ------------------
 6478|      0|            session_inbound_frame_reset(session);
 6479|      0|          } else {
 6480|      0|            busy = 1;
 6481|      0|            iframe->state = NGHTTP2_IB_IGN_PAYLOAD;
 6482|      0|          }
 6483|      0|          break;
 6484|      0|        }
 6485|  1.31k|      } else {
 6486|     12|        in += readlen;
 6487|     12|        iframe->payloadleft -= readlen;
 6488|     12|      }
 6489|       |
 6490|  1.32k|      if (iframe->payloadleft) {
  ------------------
  |  Branch (6490:11): [True: 651, False: 674]
  ------------------
 6491|    651|        break;
 6492|    651|      }
 6493|       |
 6494|    674|      if ((iframe->frame.hd.flags & NGHTTP2_FLAG_END_HEADERS) == 0) {
  ------------------
  |  Branch (6494:11): [True: 192, False: 482]
  ------------------
 6495|    192|        inbound_frame_set_mark(iframe, NGHTTP2_FRAME_HDLEN);
  ------------------
  |  |   40|    192|#define NGHTTP2_FRAME_HDLEN 9
  ------------------
 6496|       |
 6497|    192|        iframe->padlen = 0;
 6498|       |
 6499|    192|        if (iframe->state == NGHTTP2_IB_READ_HEADER_BLOCK) {
  ------------------
  |  Branch (6499:13): [True: 96, False: 96]
  ------------------
 6500|     96|          iframe->state = NGHTTP2_IB_EXPECT_CONTINUATION;
 6501|     96|        } else {
 6502|     96|          iframe->state = NGHTTP2_IB_IGN_CONTINUATION;
 6503|     96|        }
 6504|    482|      } else {
 6505|    482|        if (iframe->state == NGHTTP2_IB_READ_HEADER_BLOCK) {
  ------------------
  |  Branch (6505:13): [True: 250, False: 232]
  ------------------
 6506|    250|          rv = session_after_header_block_received(session);
 6507|    250|          if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6507:15): [True: 0, False: 250]
  ------------------
 6508|      0|            return rv;
 6509|      0|          }
 6510|       |
 6511|    250|          if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6511:15): [True: 0, False: 250]
  ------------------
 6512|      0|            return (nghttp2_ssize)inlen;
 6513|      0|          }
 6514|    250|        }
 6515|    482|        session_inbound_frame_reset(session);
 6516|       |
 6517|    482|        session->num_continuations = 0;
 6518|    482|      }
 6519|    674|      break;
 6520|    674|    }
 6521|  1.64k|    case NGHTTP2_IB_IGN_PAYLOAD:
  ------------------
  |  Branch (6521:5): [True: 1.64k, False: 34.7k]
  ------------------
 6522|  1.64k|      DEBUGF("recv: [IB_IGN_PAYLOAD]\n");
  ------------------
  |  |   39|  1.64k|    do {                                                                       \
  |  |   40|  1.64k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 1.64k]
  |  |  ------------------
  ------------------
 6523|       |
 6524|  1.64k|      readlen = inbound_frame_payload_readlen(iframe, in, last);
 6525|  1.64k|      iframe->payloadleft -= readlen;
 6526|  1.64k|      in += readlen;
 6527|       |
 6528|  1.64k|      DEBUGF("recv: readlen=%zu, payloadleft=%zu\n", readlen,
  ------------------
  |  |   39|  1.64k|    do {                                                                       \
  |  |   40|  1.64k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 1.64k]
  |  |  ------------------
  ------------------
 6529|  1.64k|             iframe->payloadleft);
 6530|       |
 6531|  1.64k|      if (iframe->payloadleft) {
  ------------------
  |  Branch (6531:11): [True: 367, False: 1.28k]
  ------------------
 6532|    367|        break;
 6533|    367|      }
 6534|       |
 6535|  1.28k|      switch (iframe->frame.hd.type) {
 6536|      0|      case NGHTTP2_HEADERS:
  ------------------
  |  Branch (6536:7): [True: 0, False: 1.28k]
  ------------------
 6537|      0|      case NGHTTP2_PUSH_PROMISE:
  ------------------
  |  Branch (6537:7): [True: 0, False: 1.28k]
  ------------------
 6538|      0|      case NGHTTP2_CONTINUATION:
  ------------------
  |  Branch (6538:7): [True: 0, False: 1.28k]
  ------------------
 6539|       |        /* Mark inflater bad so that we won't perform further decoding */
 6540|      0|        session->hd_inflater.ctx.bad = 1;
 6541|      0|        break;
 6542|  1.28k|      default:
  ------------------
  |  Branch (6542:7): [True: 1.28k, False: 0]
  ------------------
 6543|  1.28k|        break;
 6544|  1.28k|      }
 6545|       |
 6546|  1.28k|      session_inbound_frame_reset(session);
 6547|       |
 6548|  1.28k|      break;
 6549|     72|    case NGHTTP2_IB_FRAME_SIZE_ERROR:
  ------------------
  |  Branch (6549:5): [True: 72, False: 36.2k]
  ------------------
 6550|     72|      DEBUGF("recv: [IB_FRAME_SIZE_ERROR]\n");
  ------------------
  |  |   39|     72|    do {                                                                       \
  |  |   40|     72|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 72]
  |  |  ------------------
  ------------------
 6551|       |
 6552|     72|      rv = session_handle_frame_size_error(session);
 6553|     72|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6553:11): [True: 0, False: 72]
  ------------------
 6554|      0|        return rv;
 6555|      0|      }
 6556|       |
 6557|     72|      assert(iframe->state == NGHTTP2_IB_IGN_ALL);
  ------------------
  |  Branch (6557:7): [True: 0, False: 72]
  |  Branch (6557:7): [True: 72, False: 0]
  ------------------
 6558|       |
 6559|     72|      return (nghttp2_ssize)inlen;
 6560|  15.2k|    case NGHTTP2_IB_READ_SETTINGS:
  ------------------
  |  Branch (6560:5): [True: 15.2k, False: 21.0k]
  ------------------
 6561|  15.2k|      DEBUGF("recv: [IB_READ_SETTINGS]\n");
  ------------------
  |  |   39|  15.2k|    do {                                                                       \
  |  |   40|  15.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 15.2k]
  |  |  ------------------
  ------------------
 6562|       |
 6563|  15.2k|      readlen = inbound_frame_buf_read(iframe, in, last);
 6564|  15.2k|      iframe->payloadleft -= readlen;
 6565|  15.2k|      in += readlen;
 6566|       |
 6567|  15.2k|      DEBUGF("recv: readlen=%zu, payloadleft=%zu\n", readlen,
  ------------------
  |  |   39|  15.2k|    do {                                                                       \
  |  |   40|  15.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 15.2k]
  |  |  ------------------
  ------------------
 6568|  15.2k|             iframe->payloadleft);
 6569|       |
 6570|  15.2k|      if (nghttp2_buf_mark_avail(&iframe->sbuf)) {
  ------------------
  |  |   56|  15.2k|#define nghttp2_buf_mark_avail(BUF) ((size_t)((BUF)->mark - (BUF)->last))
  |  |  ------------------
  |  |  |  Branch (56:37): [True: 38, False: 15.2k]
  |  |  ------------------
  ------------------
 6571|     38|        break;
 6572|     38|      }
 6573|       |
 6574|  15.2k|      if (readlen > 0) {
  ------------------
  |  Branch (6574:11): [True: 12.2k, False: 2.99k]
  ------------------
 6575|  12.2k|        inbound_frame_set_settings_entry(iframe);
 6576|  12.2k|      }
 6577|  15.2k|      if (iframe->payloadleft) {
  ------------------
  |  Branch (6577:11): [True: 10.9k, False: 4.34k]
  ------------------
 6578|  10.9k|        inbound_frame_set_mark(iframe, NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH);
  ------------------
  |  |   61|  10.9k|#define NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH 6
  ------------------
 6579|  10.9k|        break;
 6580|  10.9k|      }
 6581|       |
 6582|  4.34k|      rv = session_process_settings_frame(session);
 6583|       |
 6584|  4.34k|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6584:11): [True: 305, False: 4.04k]
  ------------------
 6585|    305|        return rv;
 6586|    305|      }
 6587|       |
 6588|  4.04k|      if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6588:11): [True: 8, False: 4.03k]
  ------------------
 6589|      8|        return (nghttp2_ssize)inlen;
 6590|      8|      }
 6591|       |
 6592|  4.03k|      session_inbound_frame_reset(session);
 6593|       |
 6594|  4.03k|      break;
 6595|    516|    case NGHTTP2_IB_READ_GOAWAY_DEBUG:
  ------------------
  |  Branch (6595:5): [True: 516, False: 35.8k]
  ------------------
 6596|    516|      DEBUGF("recv: [IB_READ_GOAWAY_DEBUG]\n");
  ------------------
  |  |   39|    516|    do {                                                                       \
  |  |   40|    516|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 516]
  |  |  ------------------
  ------------------
 6597|       |
 6598|    516|      readlen = inbound_frame_payload_readlen(iframe, in, last);
 6599|       |
 6600|    516|      if (readlen > 0) {
  ------------------
  |  Branch (6600:11): [True: 365, False: 151]
  ------------------
 6601|    365|        iframe->lbuf.last = nghttp2_cpymem(iframe->lbuf.last, in, readlen);
 6602|       |
 6603|    365|        iframe->payloadleft -= readlen;
 6604|    365|        in += readlen;
 6605|    365|      }
 6606|       |
 6607|    516|      DEBUGF("recv: readlen=%zu, payloadleft=%zu\n", readlen,
  ------------------
  |  |   39|    516|    do {                                                                       \
  |  |   40|    516|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 516]
  |  |  ------------------
  ------------------
 6608|    516|             iframe->payloadleft);
 6609|       |
 6610|    516|      if (iframe->payloadleft) {
  ------------------
  |  Branch (6610:11): [True: 23, False: 493]
  ------------------
 6611|     23|        assert(nghttp2_buf_avail(&iframe->lbuf) > 0);
  ------------------
  |  Branch (6611:9): [True: 0, False: 23]
  |  Branch (6611:9): [True: 23, False: 0]
  ------------------
 6612|       |
 6613|     23|        break;
 6614|     23|      }
 6615|       |
 6616|    493|      rv = session_process_goaway_frame(session);
 6617|       |
 6618|    493|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6618:11): [True: 25, False: 468]
  ------------------
 6619|     25|        return rv;
 6620|     25|      }
 6621|       |
 6622|    468|      if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6622:11): [True: 4, False: 464]
  ------------------
 6623|      4|        return (nghttp2_ssize)inlen;
 6624|      4|      }
 6625|       |
 6626|    464|      session_inbound_frame_reset(session);
 6627|       |
 6628|    464|      break;
 6629|     97|    case NGHTTP2_IB_EXPECT_CONTINUATION:
  ------------------
  |  Branch (6629:5): [True: 97, False: 36.2k]
  ------------------
 6630|    193|    case NGHTTP2_IB_IGN_CONTINUATION:
  ------------------
  |  Branch (6630:5): [True: 96, False: 36.2k]
  ------------------
 6631|       |#ifdef DEBUGBUILD
 6632|       |      if (iframe->state == NGHTTP2_IB_EXPECT_CONTINUATION) {
 6633|       |        fprintf(stderr, "recv: [IB_EXPECT_CONTINUATION]\n");
 6634|       |      } else {
 6635|       |        fprintf(stderr, "recv: [IB_IGN_CONTINUATION]\n");
 6636|       |      }
 6637|       |#endif /* defined(DEBUGBUILD) */
 6638|       |
 6639|    193|      if (++session->num_continuations > session->max_continuations) {
  ------------------
  |  Branch (6639:11): [True: 0, False: 193]
  ------------------
 6640|      0|        return NGHTTP2_ERR_TOO_MANY_CONTINUATIONS;
 6641|      0|      }
 6642|       |
 6643|    193|      readlen = inbound_frame_buf_read(iframe, in, last);
 6644|    193|      in += readlen;
 6645|       |
 6646|    193|      if (nghttp2_buf_mark_avail(&iframe->sbuf)) {
  ------------------
  |  |   56|    193|#define nghttp2_buf_mark_avail(BUF) ((size_t)((BUF)->mark - (BUF)->last))
  |  |  ------------------
  |  |  |  Branch (56:37): [True: 2, False: 191]
  |  |  ------------------
  ------------------
 6647|      2|        return (nghttp2_ssize)(in - first);
 6648|      2|      }
 6649|       |
 6650|    191|      nghttp2_frame_unpack_frame_hd(&cont_hd, iframe->sbuf.pos);
 6651|    191|      iframe->payloadleft = cont_hd.length;
 6652|       |
 6653|    191|      DEBUGF("recv: payloadlen=%zu, type=%u, flags=0x%02x, stream_id=%d\n",
  ------------------
  |  |   39|    191|    do {                                                                       \
  |  |   40|    191|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 191]
  |  |  ------------------
  ------------------
 6654|    191|             cont_hd.length, cont_hd.type, cont_hd.flags, cont_hd.stream_id);
 6655|       |
 6656|    191|      if (cont_hd.type != NGHTTP2_CONTINUATION ||
  ------------------
  |  Branch (6656:11): [True: 17, False: 174]
  ------------------
 6657|    174|          cont_hd.stream_id != iframe->frame.hd.stream_id) {
  ------------------
  |  Branch (6657:11): [True: 38, False: 136]
  ------------------
 6658|     55|        DEBUGF("recv: expected stream_id=%d, type=%d, but got stream_id=%d, "
  ------------------
  |  |   39|     55|    do {                                                                       \
  |  |   40|     55|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 55]
  |  |  ------------------
  ------------------
 6659|     55|               "type=%u\n",
 6660|     55|               iframe->frame.hd.stream_id, NGHTTP2_CONTINUATION,
 6661|     55|               cont_hd.stream_id, cont_hd.type);
 6662|     55|        rv = nghttp2_session_terminate_session_with_reason(
 6663|     55|          session, NGHTTP2_PROTOCOL_ERROR,
 6664|     55|          "unexpected non-CONTINUATION frame or stream_id is invalid");
 6665|     55|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6665:13): [True: 0, False: 55]
  ------------------
 6666|      0|          return rv;
 6667|      0|        }
 6668|       |
 6669|     55|        return (nghttp2_ssize)inlen;
 6670|     55|      }
 6671|       |
 6672|       |      /* CONTINUATION won't bear NGHTTP2_PADDED flag */
 6673|       |
 6674|    136|      iframe->frame.hd.flags =
 6675|    136|        (uint8_t)(iframe->frame.hd.flags |
 6676|    136|                  (cont_hd.flags & NGHTTP2_FLAG_END_HEADERS));
 6677|    136|      iframe->frame.hd.length += cont_hd.length;
 6678|       |
 6679|    136|      busy = 1;
 6680|       |
 6681|    136|      if (iframe->state == NGHTTP2_IB_EXPECT_CONTINUATION) {
  ------------------
  |  Branch (6681:11): [True: 75, False: 61]
  ------------------
 6682|     75|        iframe->state = NGHTTP2_IB_READ_HEADER_BLOCK;
 6683|       |
 6684|     75|        rv = session_call_on_begin_frame(session, &cont_hd);
 6685|       |
 6686|     75|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6686:13): [True: 0, False: 75]
  ------------------
 6687|      0|          return rv;
 6688|      0|        }
 6689|       |
 6690|     75|        if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6690:13): [True: 0, False: 75]
  ------------------
 6691|      0|          return (nghttp2_ssize)inlen;
 6692|      0|        }
 6693|     75|      } else {
 6694|     61|        iframe->state = NGHTTP2_IB_IGN_HEADER_BLOCK;
 6695|     61|      }
 6696|       |
 6697|    136|      break;
 6698|    190|    case NGHTTP2_IB_READ_PAD_DATA:
  ------------------
  |  Branch (6698:5): [True: 190, False: 36.1k]
  ------------------
 6699|    190|      DEBUGF("recv: [IB_READ_PAD_DATA]\n");
  ------------------
  |  |   39|    190|    do {                                                                       \
  |  |   40|    190|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 190]
  |  |  ------------------
  ------------------
 6700|       |
 6701|    190|      readlen = inbound_frame_buf_read(iframe, in, last);
 6702|    190|      in += readlen;
 6703|    190|      iframe->payloadleft -= readlen;
 6704|       |
 6705|    190|      DEBUGF("recv: readlen=%zu, payloadleft=%zu, left=%zu\n", readlen,
  ------------------
  |  |   39|    190|    do {                                                                       \
  |  |   40|    190|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 190]
  |  |  ------------------
  ------------------
 6706|    190|             iframe->payloadleft, nghttp2_buf_mark_avail(&iframe->sbuf));
 6707|       |
 6708|    190|      if (nghttp2_buf_mark_avail(&iframe->sbuf)) {
  ------------------
  |  |   56|    190|#define nghttp2_buf_mark_avail(BUF) ((size_t)((BUF)->mark - (BUF)->last))
  |  |  ------------------
  |  |  |  Branch (56:37): [True: 1, False: 189]
  |  |  ------------------
  ------------------
 6709|      1|        return (nghttp2_ssize)(in - first);
 6710|      1|      }
 6711|       |
 6712|       |      /* Pad Length field is subject to flow control */
 6713|    189|      rv = nghttp2_session_update_recv_connection_window_size(session, readlen);
 6714|    189|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6714:11): [True: 0, False: 189]
  ------------------
 6715|      0|        return rv;
 6716|      0|      }
 6717|       |
 6718|    189|      if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6718:11): [True: 0, False: 189]
  ------------------
 6719|      0|        return (nghttp2_ssize)inlen;
 6720|      0|      }
 6721|       |
 6722|       |      /* Pad Length field is consumed immediately */
 6723|    189|      rv =
 6724|    189|        nghttp2_session_consume(session, iframe->frame.hd.stream_id, readlen);
 6725|       |
 6726|    189|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6726:11): [True: 0, False: 189]
  ------------------
 6727|      0|        return rv;
 6728|      0|      }
 6729|       |
 6730|    189|      if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6730:11): [True: 0, False: 189]
  ------------------
 6731|      0|        return (nghttp2_ssize)inlen;
 6732|      0|      }
 6733|       |
 6734|    189|      stream = nghttp2_session_get_stream(session, iframe->frame.hd.stream_id);
 6735|    189|      if (stream) {
  ------------------
  |  Branch (6735:11): [True: 189, False: 0]
  ------------------
 6736|    189|        rv = nghttp2_session_update_recv_stream_window_size(
 6737|    189|          session, stream, readlen,
 6738|    189|          iframe->payloadleft ||
  ------------------
  |  Branch (6738:11): [True: 186, False: 3]
  ------------------
 6739|      3|            (iframe->frame.hd.flags & NGHTTP2_FLAG_END_STREAM) == 0);
  ------------------
  |  Branch (6739:13): [True: 1, False: 2]
  ------------------
 6740|    189|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6740:13): [True: 0, False: 189]
  ------------------
 6741|      0|          return rv;
 6742|      0|        }
 6743|       |
 6744|    189|        if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6744:13): [True: 0, False: 189]
  ------------------
 6745|      0|          return (nghttp2_ssize)inlen;
 6746|      0|        }
 6747|    189|      }
 6748|       |
 6749|    189|      busy = 1;
 6750|       |
 6751|    189|      padlen = inbound_frame_compute_pad(iframe);
 6752|    189|      if (padlen < 0) {
  ------------------
  |  Branch (6752:11): [True: 1, False: 188]
  ------------------
 6753|      1|        rv = nghttp2_session_terminate_session_with_reason(
 6754|      1|          session, NGHTTP2_PROTOCOL_ERROR, "DATA: invalid padding");
 6755|      1|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6755:13): [True: 0, False: 1]
  ------------------
 6756|      0|          return rv;
 6757|      0|        }
 6758|      1|        return (nghttp2_ssize)inlen;
 6759|      1|      }
 6760|       |
 6761|    188|      iframe->frame.data.padlen = (size_t)padlen;
 6762|       |
 6763|       |      /* Empty DATA frame without END_STREAM flag set is
 6764|       |         suspicious. */
 6765|    188|      if (iframe->payloadleft == 0 &&
  ------------------
  |  Branch (6765:11): [True: 3, False: 185]
  ------------------
 6766|      3|          (iframe->frame.hd.flags & NGHTTP2_FLAG_END_STREAM) == 0) {
  ------------------
  |  Branch (6766:11): [True: 1, False: 2]
  ------------------
 6767|      1|        rv = session_update_glitch_ratelim(session);
 6768|      1|        if (rv != 0) {
  ------------------
  |  Branch (6768:13): [True: 0, False: 1]
  ------------------
 6769|      0|          return rv;
 6770|      0|        }
 6771|       |
 6772|      1|        if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6772:13): [True: 0, False: 1]
  ------------------
 6773|      0|          return (nghttp2_ssize)inlen;
 6774|      0|        }
 6775|      1|      }
 6776|       |
 6777|    188|      iframe->state = NGHTTP2_IB_READ_DATA;
 6778|       |
 6779|    188|      break;
 6780|    452|    case NGHTTP2_IB_READ_DATA:
  ------------------
  |  Branch (6780:5): [True: 452, False: 35.9k]
  ------------------
 6781|    452|      stream = nghttp2_session_get_stream(session, iframe->frame.hd.stream_id);
 6782|       |
 6783|    452|      if (!stream) {
  ------------------
  |  Branch (6783:11): [True: 0, False: 452]
  ------------------
 6784|      0|        busy = 1;
 6785|      0|        iframe->state = NGHTTP2_IB_IGN_DATA;
 6786|      0|        break;
 6787|      0|      }
 6788|       |
 6789|    452|      DEBUGF("recv: [IB_READ_DATA]\n");
  ------------------
  |  |   39|    452|    do {                                                                       \
  |  |   40|    452|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 452]
  |  |  ------------------
  ------------------
 6790|       |
 6791|    452|      readlen = inbound_frame_payload_readlen(iframe, in, last);
 6792|    452|      iframe->payloadleft -= readlen;
 6793|    452|      in += readlen;
 6794|       |
 6795|    452|      DEBUGF("recv: readlen=%zu, payloadleft=%zu\n", readlen,
  ------------------
  |  |   39|    452|    do {                                                                       \
  |  |   40|    452|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 452]
  |  |  ------------------
  ------------------
 6796|    452|             iframe->payloadleft);
 6797|       |
 6798|    452|      if (readlen > 0) {
  ------------------
  |  Branch (6798:11): [True: 437, False: 15]
  ------------------
 6799|    437|        nghttp2_ssize data_readlen;
 6800|       |
 6801|    437|        rv =
 6802|    437|          nghttp2_session_update_recv_connection_window_size(session, readlen);
 6803|    437|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6803:13): [True: 0, False: 437]
  ------------------
 6804|      0|          return rv;
 6805|      0|        }
 6806|       |
 6807|    437|        if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6807:13): [True: 0, False: 437]
  ------------------
 6808|      0|          return (nghttp2_ssize)inlen;
 6809|      0|        }
 6810|       |
 6811|    437|        rv = nghttp2_session_update_recv_stream_window_size(
 6812|    437|          session, stream, readlen,
 6813|    437|          iframe->payloadleft ||
  ------------------
  |  Branch (6813:11): [True: 134, False: 303]
  ------------------
 6814|    303|            (iframe->frame.hd.flags & NGHTTP2_FLAG_END_STREAM) == 0);
  ------------------
  |  Branch (6814:13): [True: 288, False: 15]
  ------------------
 6815|    437|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6815:13): [True: 0, False: 437]
  ------------------
 6816|      0|          return rv;
 6817|      0|        }
 6818|       |
 6819|    437|        if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6819:13): [True: 0, False: 437]
  ------------------
 6820|      0|          return (nghttp2_ssize)inlen;
 6821|      0|        }
 6822|       |
 6823|    437|        data_readlen =
 6824|    437|          inbound_frame_effective_readlen(iframe, iframe->payloadleft, readlen);
 6825|       |
 6826|    437|        if (data_readlen == -1) {
  ------------------
  |  Branch (6826:13): [True: 1, False: 436]
  ------------------
 6827|       |          /* everything is padding */
 6828|      1|          data_readlen = 0;
 6829|      1|        }
 6830|       |
 6831|    437|        padlen = (nghttp2_ssize)readlen - data_readlen;
 6832|       |
 6833|    437|        if (padlen > 0) {
  ------------------
  |  Branch (6833:13): [True: 52, False: 385]
  ------------------
 6834|       |          /* Padding is considered as "consumed" immediately */
 6835|     52|          rv = nghttp2_session_consume(session, iframe->frame.hd.stream_id,
 6836|     52|                                       (size_t)padlen);
 6837|       |
 6838|     52|          if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6838:15): [True: 0, False: 52]
  ------------------
 6839|      0|            return rv;
 6840|      0|          }
 6841|       |
 6842|     52|          if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6842:15): [True: 0, False: 52]
  ------------------
 6843|      0|            return (nghttp2_ssize)inlen;
 6844|      0|          }
 6845|     52|        }
 6846|       |
 6847|    437|        DEBUGF("recv: data_readlen=%td\n", data_readlen);
  ------------------
  |  |   39|    437|    do {                                                                       \
  |  |   40|    437|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 437]
  |  |  ------------------
  ------------------
 6848|       |
 6849|    437|        if (data_readlen > 0) {
  ------------------
  |  Branch (6849:13): [True: 426, False: 11]
  ------------------
 6850|    426|          if (session_enforce_http_messaging(session)) {
  ------------------
  |  Branch (6850:15): [True: 426, False: 0]
  ------------------
 6851|    426|            if (nghttp2_http_on_data_chunk(stream, (size_t)data_readlen) != 0) {
  ------------------
  |  Branch (6851:17): [True: 10, False: 416]
  ------------------
 6852|     10|              if (session->opt_flags & NGHTTP2_OPTMASK_NO_AUTO_WINDOW_UPDATE) {
  ------------------
  |  Branch (6852:19): [True: 10, False: 0]
  ------------------
 6853|       |                /* Consume all data for connection immediately here */
 6854|     10|                rv = session_update_connection_consumed_size(
 6855|     10|                  session, (size_t)data_readlen);
 6856|       |
 6857|     10|                if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6857:21): [True: 0, False: 10]
  ------------------
 6858|      0|                  return rv;
 6859|      0|                }
 6860|       |
 6861|     10|                if (iframe->state == NGHTTP2_IB_IGN_DATA) {
  ------------------
  |  Branch (6861:21): [True: 0, False: 10]
  ------------------
 6862|      0|                  return (nghttp2_ssize)inlen;
 6863|      0|                }
 6864|     10|              }
 6865|       |
 6866|     10|              rv = session_handle_invalid_stream2(
 6867|     10|                session, iframe->frame.hd.stream_id, &iframe->frame,
 6868|     10|                NGHTTP2_ERR_PROTO);
 6869|     10|              if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6869:19): [True: 0, False: 10]
  ------------------
 6870|      0|                return rv;
 6871|      0|              }
 6872|       |
 6873|     10|              rv = session_update_glitch_ratelim(session);
 6874|     10|              if (rv != 0) {
  ------------------
  |  Branch (6874:19): [True: 0, False: 10]
  ------------------
 6875|      0|                return rv;
 6876|      0|              }
 6877|       |
 6878|     10|              if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6878:19): [True: 0, False: 10]
  ------------------
 6879|      0|                return (nghttp2_ssize)inlen;
 6880|      0|              }
 6881|       |
 6882|     10|              busy = 1;
 6883|     10|              iframe->state = NGHTTP2_IB_IGN_DATA;
 6884|       |
 6885|     10|              break;
 6886|     10|            }
 6887|    426|          }
 6888|    416|          if (session->callbacks.on_data_chunk_recv_callback) {
  ------------------
  |  Branch (6888:15): [True: 416, False: 0]
  ------------------
 6889|    416|            rv = session->callbacks.on_data_chunk_recv_callback(
 6890|    416|              session, iframe->frame.hd.flags, iframe->frame.hd.stream_id,
 6891|    416|              in - readlen, (size_t)data_readlen, session->user_data);
 6892|    416|            if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6892:17): [True: 0, False: 416]
  ------------------
 6893|      0|              return NGHTTP2_ERR_CALLBACK_FAILURE;
 6894|      0|            }
 6895|       |
 6896|    416|            if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6896:17): [True: 0, False: 416]
  ------------------
 6897|      0|              return (nghttp2_ssize)inlen;
 6898|      0|            }
 6899|       |
 6900|    416|            if (rv == NGHTTP2_ERR_PAUSE) {
  ------------------
  |  Branch (6900:17): [True: 0, False: 416]
  ------------------
 6901|      0|              return (nghttp2_ssize)(in - first);
 6902|      0|            }
 6903|    416|          }
 6904|    416|        }
 6905|    437|      }
 6906|       |
 6907|    442|      if (iframe->payloadleft) {
  ------------------
  |  Branch (6907:11): [True: 132, False: 310]
  ------------------
 6908|    132|        break;
 6909|    132|      }
 6910|       |
 6911|    310|      rv = session_process_data_frame(session);
 6912|    310|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6912:11): [True: 0, False: 310]
  ------------------
 6913|      0|        return rv;
 6914|      0|      }
 6915|       |
 6916|    310|      if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6916:11): [True: 0, False: 310]
  ------------------
 6917|      0|        return (nghttp2_ssize)inlen;
 6918|      0|      }
 6919|       |
 6920|    310|      session_inbound_frame_reset(session);
 6921|       |
 6922|    310|      break;
 6923|    351|    case NGHTTP2_IB_IGN_DATA:
  ------------------
  |  Branch (6923:5): [True: 351, False: 36.0k]
  ------------------
 6924|    351|      DEBUGF("recv: [IB_IGN_DATA]\n");
  ------------------
  |  |   39|    351|    do {                                                                       \
  |  |   40|    351|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 351]
  |  |  ------------------
  ------------------
 6925|       |
 6926|    351|      readlen = inbound_frame_payload_readlen(iframe, in, last);
 6927|    351|      iframe->payloadleft -= readlen;
 6928|    351|      in += readlen;
 6929|       |
 6930|    351|      DEBUGF("recv: readlen=%zu, payloadleft=%zu\n", readlen,
  ------------------
  |  |   39|    351|    do {                                                                       \
  |  |   40|    351|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 351]
  |  |  ------------------
  ------------------
 6931|    351|             iframe->payloadleft);
 6932|       |
 6933|    351|      if (readlen > 0) {
  ------------------
  |  Branch (6933:11): [True: 225, False: 126]
  ------------------
 6934|       |        /* Update connection-level flow control window for ignored
 6935|       |           DATA frame too */
 6936|    225|        rv =
 6937|    225|          nghttp2_session_update_recv_connection_window_size(session, readlen);
 6938|    225|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6938:13): [True: 0, False: 225]
  ------------------
 6939|      0|          return rv;
 6940|      0|        }
 6941|       |
 6942|    225|        if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6942:13): [True: 0, False: 225]
  ------------------
 6943|      0|          return (nghttp2_ssize)inlen;
 6944|      0|        }
 6945|       |
 6946|    225|        if (session->opt_flags & NGHTTP2_OPTMASK_NO_AUTO_WINDOW_UPDATE) {
  ------------------
  |  Branch (6946:13): [True: 225, False: 0]
  ------------------
 6947|       |          /* Ignored DATA is considered as "consumed" immediately. */
 6948|    225|          rv = session_update_connection_consumed_size(session, readlen);
 6949|       |
 6950|    225|          if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6950:15): [True: 0, False: 225]
  ------------------
 6951|      0|            return rv;
 6952|      0|          }
 6953|       |
 6954|    225|          if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6954:15): [True: 0, False: 225]
  ------------------
 6955|      0|            return (nghttp2_ssize)inlen;
 6956|      0|          }
 6957|    225|        }
 6958|    225|      }
 6959|       |
 6960|    351|      if (iframe->payloadleft) {
  ------------------
  |  Branch (6960:11): [True: 16, False: 335]
  ------------------
 6961|     16|        break;
 6962|     16|      }
 6963|       |
 6964|    335|      session_inbound_frame_reset(session);
 6965|       |
 6966|    335|      break;
 6967|      0|    case NGHTTP2_IB_IGN_ALL:
  ------------------
  |  Branch (6967:5): [True: 0, False: 36.3k]
  ------------------
 6968|      0|      return (nghttp2_ssize)inlen;
 6969|      0|    case NGHTTP2_IB_READ_EXTENSION_PAYLOAD:
  ------------------
  |  Branch (6969:5): [True: 0, False: 36.3k]
  ------------------
 6970|      0|      DEBUGF("recv: [IB_READ_EXTENSION_PAYLOAD]\n");
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6971|       |
 6972|      0|      readlen = inbound_frame_payload_readlen(iframe, in, last);
 6973|      0|      iframe->payloadleft -= readlen;
 6974|      0|      in += readlen;
 6975|       |
 6976|      0|      DEBUGF("recv: readlen=%zu, payloadleft=%zu\n", readlen,
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6977|      0|             iframe->payloadleft);
 6978|       |
 6979|      0|      if (readlen > 0) {
  ------------------
  |  Branch (6979:11): [True: 0, False: 0]
  ------------------
 6980|      0|        rv = session_call_on_extension_chunk_recv_callback(
 6981|      0|          session, in - readlen, readlen);
 6982|      0|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (6982:13): [True: 0, False: 0]
  ------------------
 6983|      0|          return rv;
 6984|      0|        }
 6985|       |
 6986|      0|        if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (6986:13): [True: 0, False: 0]
  ------------------
 6987|      0|          return (nghttp2_ssize)inlen;
 6988|      0|        }
 6989|       |
 6990|      0|        if (rv != 0) {
  ------------------
  |  Branch (6990:13): [True: 0, False: 0]
  ------------------
 6991|      0|          busy = 1;
 6992|       |
 6993|      0|          iframe->state = NGHTTP2_IB_IGN_PAYLOAD;
 6994|       |
 6995|      0|          break;
 6996|      0|        }
 6997|      0|      }
 6998|       |
 6999|      0|      if (iframe->payloadleft > 0) {
  ------------------
  |  Branch (6999:11): [True: 0, False: 0]
  ------------------
 7000|      0|        break;
 7001|      0|      }
 7002|       |
 7003|      0|      rv = session_process_extension_frame(session);
 7004|      0|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (7004:11): [True: 0, False: 0]
  ------------------
 7005|      0|        return rv;
 7006|      0|      }
 7007|       |
 7008|      0|      if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (7008:11): [True: 0, False: 0]
  ------------------
 7009|      0|        return (nghttp2_ssize)inlen;
 7010|      0|      }
 7011|       |
 7012|      0|      session_inbound_frame_reset(session);
 7013|       |
 7014|      0|      break;
 7015|      0|    case NGHTTP2_IB_READ_ALTSVC_PAYLOAD:
  ------------------
  |  Branch (7015:5): [True: 0, False: 36.3k]
  ------------------
 7016|      0|      DEBUGF("recv: [IB_READ_ALTSVC_PAYLOAD]\n");
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 7017|       |
 7018|      0|      readlen = inbound_frame_payload_readlen(iframe, in, last);
 7019|      0|      if (readlen > 0) {
  ------------------
  |  Branch (7019:11): [True: 0, False: 0]
  ------------------
 7020|      0|        iframe->lbuf.last = nghttp2_cpymem(iframe->lbuf.last, in, readlen);
 7021|       |
 7022|      0|        iframe->payloadleft -= readlen;
 7023|      0|        in += readlen;
 7024|      0|      }
 7025|       |
 7026|      0|      DEBUGF("recv: readlen=%zu, payloadleft=%zu\n", readlen,
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 7027|      0|             iframe->payloadleft);
 7028|       |
 7029|      0|      if (iframe->payloadleft) {
  ------------------
  |  Branch (7029:11): [True: 0, False: 0]
  ------------------
 7030|      0|        assert(nghttp2_buf_avail(&iframe->lbuf) > 0);
  ------------------
  |  Branch (7030:9): [True: 0, False: 0]
  |  Branch (7030:9): [True: 0, False: 0]
  ------------------
 7031|       |
 7032|      0|        break;
 7033|      0|      }
 7034|       |
 7035|      0|      rv = session_process_altsvc_frame(session);
 7036|      0|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (7036:11): [True: 0, False: 0]
  ------------------
 7037|      0|        return rv;
 7038|      0|      }
 7039|       |
 7040|      0|      if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (7040:11): [True: 0, False: 0]
  ------------------
 7041|      0|        return (nghttp2_ssize)inlen;
 7042|      0|      }
 7043|       |
 7044|      0|      session_inbound_frame_reset(session);
 7045|       |
 7046|      0|      break;
 7047|      0|    case NGHTTP2_IB_READ_ORIGIN_PAYLOAD:
  ------------------
  |  Branch (7047:5): [True: 0, False: 36.3k]
  ------------------
 7048|      0|      DEBUGF("recv: [IB_READ_ORIGIN_PAYLOAD]\n");
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 7049|       |
 7050|      0|      readlen = inbound_frame_payload_readlen(iframe, in, last);
 7051|       |
 7052|      0|      if (readlen > 0) {
  ------------------
  |  Branch (7052:11): [True: 0, False: 0]
  ------------------
 7053|      0|        iframe->lbuf.last = nghttp2_cpymem(iframe->lbuf.last, in, readlen);
 7054|       |
 7055|      0|        iframe->payloadleft -= readlen;
 7056|      0|        in += readlen;
 7057|      0|      }
 7058|       |
 7059|      0|      DEBUGF("recv: readlen=%zu, payloadleft=%zu\n", readlen,
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 7060|      0|             iframe->payloadleft);
 7061|       |
 7062|      0|      if (iframe->payloadleft) {
  ------------------
  |  Branch (7062:11): [True: 0, False: 0]
  ------------------
 7063|      0|        assert(nghttp2_buf_avail(&iframe->lbuf) > 0);
  ------------------
  |  Branch (7063:9): [True: 0, False: 0]
  |  Branch (7063:9): [True: 0, False: 0]
  ------------------
 7064|       |
 7065|      0|        break;
 7066|      0|      }
 7067|       |
 7068|      0|      rv = session_process_origin_frame(session);
 7069|       |
 7070|      0|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (7070:11): [True: 0, False: 0]
  ------------------
 7071|      0|        return rv;
 7072|      0|      }
 7073|       |
 7074|      0|      if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (7074:11): [True: 0, False: 0]
  ------------------
 7075|      0|        return (nghttp2_ssize)inlen;
 7076|      0|      }
 7077|       |
 7078|      0|      session_inbound_frame_reset(session);
 7079|       |
 7080|      0|      break;
 7081|  36.3k|    }
 7082|       |
 7083|  33.0k|    if (!busy && in == last) {
  ------------------
  |  Branch (7083:9): [True: 24.0k, False: 8.94k]
  |  Branch (7083:18): [True: 1.23k, False: 22.8k]
  ------------------
 7084|  1.23k|      break;
 7085|  1.23k|    }
 7086|       |
 7087|  31.7k|    busy = 0;
 7088|  31.7k|  }
 7089|       |
 7090|  4.57k|  assert(in == last);
  ------------------
  |  Branch (7090:3): [True: 0, False: 1.23k]
  |  Branch (7090:3): [True: 1.23k, False: 0]
  ------------------
 7091|       |
 7092|  1.23k|  return (nghttp2_ssize)(in - first);
 7093|  1.23k|}
nghttp2_session_want_read:
 7126|  3.57M|int nghttp2_session_want_read(nghttp2_session *session) {
 7127|  3.57M|  size_t num_active_streams;
 7128|       |
 7129|       |  /* If this flag is set, we don't want to read. The application
 7130|       |     should drop the connection. */
 7131|  3.57M|  if (session->goaway_flags & NGHTTP2_GOAWAY_TERM_SENT) {
  ------------------
  |  Branch (7131:7): [True: 594, False: 3.57M]
  ------------------
 7132|    594|    return 0;
 7133|    594|  }
 7134|       |
 7135|  3.57M|  num_active_streams = session_get_num_active_streams(session);
 7136|       |
 7137|       |  /* Unless termination GOAWAY is sent or received, we always want to
 7138|       |     read incoming frames. */
 7139|       |
 7140|  3.57M|  if (num_active_streams > 0) {
  ------------------
  |  Branch (7140:7): [True: 3.56M, False: 12.9k]
  ------------------
 7141|  3.56M|    return 1;
 7142|  3.56M|  }
 7143|       |
 7144|       |  /* If there is no active streams and GOAWAY has been sent or
 7145|       |     received, we are done with this session. */
 7146|  12.9k|  return (session->goaway_flags &
 7147|  12.9k|          (NGHTTP2_GOAWAY_SENT | NGHTTP2_GOAWAY_RECV)) == 0;
 7148|  3.57M|}
nghttp2_session_want_write:
 7150|  6.54M|int nghttp2_session_want_write(nghttp2_session *session) {
 7151|       |  /* If these flag is set, we don't want to write any data. The
 7152|       |     application should drop the connection. */
 7153|  6.54M|  if (session->goaway_flags & NGHTTP2_GOAWAY_TERM_SENT) {
  ------------------
  |  Branch (7153:7): [True: 3.42k, False: 6.54M]
  ------------------
 7154|  3.42k|    return 0;
 7155|  3.42k|  }
 7156|       |
 7157|       |  /*
 7158|       |   * Unless termination GOAWAY is sent or received, we want to write
 7159|       |   * frames if there is pending ones. If pending frame is request/push
 7160|       |   * response HEADERS and concurrent stream limit is reached, we don't
 7161|       |   * want to write them.
 7162|       |   */
 7163|  6.54M|  return session->aob.item || nghttp2_outbound_queue_top(&session->ob_urgent) ||
  ------------------
  |  |  192|  13.0M|#define nghttp2_outbound_queue_top(Q) ((Q)->head)
  |  |  ------------------
  |  |  |  Branch (192:39): [True: 7.68k, False: 6.53M]
  |  |  ------------------
  ------------------
  |  Branch (7163:10): [True: 0, False: 6.54M]
  ------------------
 7164|  6.53M|         nghttp2_outbound_queue_top(&session->ob_reg) ||
  ------------------
  |  |  192|  13.0M|#define nghttp2_outbound_queue_top(Q) ((Q)->head)
  |  |  ------------------
  |  |  |  Branch (192:39): [True: 3.70k, False: 6.53M]
  |  |  ------------------
  ------------------
 7165|  6.53M|         (!session_sched_empty(session) && session->remote_window_size > 0) ||
  ------------------
  |  Branch (7165:11): [True: 1.14M, False: 5.38M]
  |  Branch (7165:44): [True: 63, False: 1.14M]
  ------------------
 7166|  6.53M|         (nghttp2_outbound_queue_top(&session->ob_syn) &&
  ------------------
  |  |  192|  13.0M|#define nghttp2_outbound_queue_top(Q) ((Q)->head)
  |  |  ------------------
  |  |  |  Branch (192:39): [True: 4.40k, False: 6.52M]
  |  |  ------------------
  ------------------
 7167|  4.40k|          !session_is_outgoing_concurrent_streams_max(session));
  ------------------
  |  Branch (7167:11): [True: 4.40k, False: 0]
  ------------------
 7168|  6.54M|}
nghttp2_session_add_ping:
 7171|     98|                             const uint8_t *opaque_data) {
 7172|     98|  int rv;
 7173|     98|  nghttp2_outbound_item *item;
 7174|     98|  nghttp2_frame *frame;
 7175|     98|  nghttp2_mem *mem;
 7176|       |
 7177|     98|  mem = &session->mem;
 7178|       |
 7179|     98|  if ((flags & NGHTTP2_FLAG_ACK) &&
  ------------------
  |  Branch (7179:7): [True: 98, False: 0]
  ------------------
 7180|     98|      session->obq_flood_counter_ >= session->max_outbound_ack) {
  ------------------
  |  Branch (7180:7): [True: 0, False: 98]
  ------------------
 7181|      0|    return NGHTTP2_ERR_FLOODED;
 7182|      0|  }
 7183|       |
 7184|     98|  item = nghttp2_mem_malloc(mem, sizeof(nghttp2_outbound_item));
 7185|     98|  if (item == NULL) {
  ------------------
  |  Branch (7185:7): [True: 0, False: 98]
  ------------------
 7186|      0|    return NGHTTP2_ERR_NOMEM;
 7187|      0|  }
 7188|       |
 7189|     98|  nghttp2_outbound_item_init(item);
 7190|       |
 7191|     98|  frame = &item->frame;
 7192|       |
 7193|     98|  nghttp2_frame_ping_init(&frame->ping, flags, opaque_data);
 7194|       |
 7195|     98|  rv = nghttp2_session_add_item(session, item);
 7196|       |
 7197|     98|  if (rv != 0) {
  ------------------
  |  Branch (7197:7): [True: 0, False: 98]
  ------------------
 7198|      0|    nghttp2_frame_ping_free(&frame->ping);
 7199|      0|    nghttp2_mem_free(mem, item);
 7200|      0|    return rv;
 7201|      0|  }
 7202|       |
 7203|     98|  if (flags & NGHTTP2_FLAG_ACK) {
  ------------------
  |  Branch (7203:7): [True: 98, False: 0]
  ------------------
 7204|     98|    ++session->obq_flood_counter_;
 7205|     98|  }
 7206|       |
 7207|     98|  return 0;
 7208|     98|}
nghttp2_session_add_goaway:
 7212|  3.85k|                               size_t opaque_data_len, uint8_t aux_flags) {
 7213|  3.85k|  int rv;
 7214|  3.85k|  nghttp2_outbound_item *item;
 7215|  3.85k|  nghttp2_frame *frame;
 7216|  3.85k|  uint8_t *opaque_data_copy = NULL;
 7217|  3.85k|  nghttp2_goaway_aux_data *aux_data;
 7218|  3.85k|  nghttp2_mem *mem;
 7219|       |
 7220|  3.85k|  mem = &session->mem;
 7221|       |
 7222|  3.85k|  if (nghttp2_session_is_my_stream_id(session, last_stream_id)) {
  ------------------
  |  Branch (7222:7): [True: 0, False: 3.85k]
  ------------------
 7223|      0|    return NGHTTP2_ERR_INVALID_ARGUMENT;
 7224|      0|  }
 7225|       |
 7226|  3.85k|  if (opaque_data_len) {
  ------------------
  |  Branch (7226:7): [True: 2.78k, False: 1.07k]
  ------------------
 7227|  2.78k|    if (opaque_data_len + 8 > NGHTTP2_MAX_PAYLOADLEN) {
  ------------------
  |  |   45|  2.78k|#define NGHTTP2_MAX_PAYLOADLEN 16384
  ------------------
  |  Branch (7227:9): [True: 0, False: 2.78k]
  ------------------
 7228|      0|      return NGHTTP2_ERR_INVALID_ARGUMENT;
 7229|      0|    }
 7230|  2.78k|    opaque_data_copy = nghttp2_mem_malloc(mem, opaque_data_len);
 7231|  2.78k|    if (opaque_data_copy == NULL) {
  ------------------
  |  Branch (7231:9): [True: 0, False: 2.78k]
  ------------------
 7232|      0|      return NGHTTP2_ERR_NOMEM;
 7233|      0|    }
 7234|  2.78k|    memcpy(opaque_data_copy, opaque_data, opaque_data_len);
 7235|  2.78k|  }
 7236|       |
 7237|  3.85k|  item = nghttp2_mem_malloc(mem, sizeof(nghttp2_outbound_item));
 7238|  3.85k|  if (item == NULL) {
  ------------------
  |  Branch (7238:7): [True: 0, False: 3.85k]
  ------------------
 7239|      0|    nghttp2_mem_free(mem, opaque_data_copy);
 7240|      0|    return NGHTTP2_ERR_NOMEM;
 7241|      0|  }
 7242|       |
 7243|  3.85k|  nghttp2_outbound_item_init(item);
 7244|       |
 7245|  3.85k|  frame = &item->frame;
 7246|       |
 7247|       |  /* last_stream_id must not be increased from the value previously
 7248|       |     sent */
 7249|  3.85k|  last_stream_id =
 7250|  3.85k|    nghttp2_min_int32(last_stream_id, session->local_last_stream_id);
 7251|       |
 7252|  3.85k|  nghttp2_frame_goaway_init(&frame->goaway, last_stream_id, error_code,
 7253|  3.85k|                            opaque_data_copy, opaque_data_len);
 7254|       |
 7255|  3.85k|  aux_data = &item->aux_data.goaway;
 7256|  3.85k|  aux_data->flags = aux_flags;
 7257|       |
 7258|  3.85k|  rv = nghttp2_session_add_item(session, item);
 7259|  3.85k|  if (rv != 0) {
  ------------------
  |  Branch (7259:7): [True: 0, False: 3.85k]
  ------------------
 7260|      0|    nghttp2_frame_goaway_free(&frame->goaway, mem);
 7261|      0|    nghttp2_mem_free(mem, item);
 7262|      0|    return rv;
 7263|      0|  }
 7264|       |
 7265|  3.85k|  session->goaway_flags |= NGHTTP2_GOAWAY_SUBMITTED;
 7266|       |
 7267|  3.85k|  return 0;
 7268|  3.85k|}
nghttp2_session_add_window_update:
 7272|  13.0k|                                      int32_t window_size_increment) {
 7273|  13.0k|  int rv;
 7274|  13.0k|  nghttp2_outbound_item *item;
 7275|  13.0k|  nghttp2_frame *frame;
 7276|  13.0k|  nghttp2_mem *mem;
 7277|       |
 7278|  13.0k|  mem = &session->mem;
 7279|  13.0k|  item = nghttp2_mem_malloc(mem, sizeof(nghttp2_outbound_item));
 7280|  13.0k|  if (item == NULL) {
  ------------------
  |  Branch (7280:7): [True: 0, False: 13.0k]
  ------------------
 7281|      0|    return NGHTTP2_ERR_NOMEM;
 7282|      0|  }
 7283|       |
 7284|  13.0k|  nghttp2_outbound_item_init(item);
 7285|       |
 7286|  13.0k|  frame = &item->frame;
 7287|       |
 7288|  13.0k|  nghttp2_frame_window_update_init(&frame->window_update, flags, stream_id,
 7289|  13.0k|                                   window_size_increment);
 7290|       |
 7291|  13.0k|  rv = nghttp2_session_add_item(session, item);
 7292|       |
 7293|  13.0k|  if (rv != 0) {
  ------------------
  |  Branch (7293:7): [True: 0, False: 13.0k]
  ------------------
 7294|      0|    nghttp2_frame_window_update_free(&frame->window_update);
 7295|      0|    nghttp2_mem_free(mem, item);
 7296|      0|    return rv;
 7297|      0|  }
 7298|  13.0k|  return 0;
 7299|  13.0k|}
nghttp2_session_add_settings:
 7313|  8.43k|                                 const nghttp2_settings_entry *iv, size_t niv) {
 7314|  8.43k|  nghttp2_outbound_item *item;
 7315|  8.43k|  nghttp2_frame *frame;
 7316|  8.43k|  nghttp2_settings_entry *iv_copy;
 7317|  8.43k|  size_t i;
 7318|  8.43k|  int rv;
 7319|  8.43k|  nghttp2_mem *mem;
 7320|  8.43k|  nghttp2_inflight_settings *inflight_settings = NULL;
 7321|  8.43k|  uint8_t no_rfc7540_pri = session->pending_no_rfc7540_priorities;
 7322|       |
 7323|  8.43k|  mem = &session->mem;
 7324|       |
 7325|  8.43k|  if (flags & NGHTTP2_FLAG_ACK) {
  ------------------
  |  Branch (7325:7): [True: 3.98k, False: 4.44k]
  ------------------
 7326|  3.98k|    if (niv != 0) {
  ------------------
  |  Branch (7326:9): [True: 0, False: 3.98k]
  ------------------
 7327|      0|      return NGHTTP2_ERR_INVALID_ARGUMENT;
 7328|      0|    }
 7329|       |
 7330|  3.98k|    if (session->obq_flood_counter_ >= session->max_outbound_ack) {
  ------------------
  |  Branch (7330:9): [True: 0, False: 3.98k]
  ------------------
 7331|      0|      return NGHTTP2_ERR_FLOODED;
 7332|      0|    }
 7333|  3.98k|  }
 7334|       |
 7335|  8.43k|  if (!nghttp2_iv_check(iv, niv)) {
  ------------------
  |  Branch (7335:7): [True: 0, False: 8.43k]
  ------------------
 7336|      0|    return NGHTTP2_ERR_INVALID_ARGUMENT;
 7337|      0|  }
 7338|       |
 7339|  21.7k|  for (i = 0; i < niv; ++i) {
  ------------------
  |  Branch (7339:15): [True: 13.3k, False: 8.43k]
  ------------------
 7340|  13.3k|    if (iv[i].settings_id != NGHTTP2_SETTINGS_NO_RFC7540_PRIORITIES) {
  ------------------
  |  Branch (7340:9): [True: 13.3k, False: 0]
  ------------------
 7341|  13.3k|      continue;
 7342|  13.3k|    }
 7343|       |
 7344|      0|    if (no_rfc7540_pri == UINT8_MAX) {
  ------------------
  |  Branch (7344:9): [True: 0, False: 0]
  ------------------
 7345|      0|      no_rfc7540_pri = (uint8_t)iv[i].value;
 7346|      0|      continue;
 7347|      0|    }
 7348|       |
 7349|      0|    if (iv[i].value != (uint32_t)no_rfc7540_pri) {
  ------------------
  |  Branch (7349:9): [True: 0, False: 0]
  ------------------
 7350|      0|      return NGHTTP2_ERR_INVALID_ARGUMENT;
 7351|      0|    }
 7352|      0|  }
 7353|       |
 7354|  8.43k|  item = nghttp2_mem_malloc(mem, sizeof(nghttp2_outbound_item));
 7355|  8.43k|  if (item == NULL) {
  ------------------
  |  Branch (7355:7): [True: 0, False: 8.43k]
  ------------------
 7356|      0|    return NGHTTP2_ERR_NOMEM;
 7357|      0|  }
 7358|       |
 7359|  8.43k|  if (niv > 0) {
  ------------------
  |  Branch (7359:7): [True: 4.44k, False: 3.98k]
  ------------------
 7360|  4.44k|    iv_copy = nghttp2_frame_iv_copy(iv, niv, mem);
 7361|  4.44k|    if (iv_copy == NULL) {
  ------------------
  |  Branch (7361:9): [True: 0, False: 4.44k]
  ------------------
 7362|      0|      nghttp2_mem_free(mem, item);
 7363|      0|      return NGHTTP2_ERR_NOMEM;
 7364|      0|    }
 7365|  4.44k|  } else {
 7366|  3.98k|    iv_copy = NULL;
 7367|  3.98k|  }
 7368|       |
 7369|  8.43k|  if ((flags & NGHTTP2_FLAG_ACK) == 0) {
  ------------------
  |  Branch (7369:7): [True: 4.44k, False: 3.98k]
  ------------------
 7370|  4.44k|    rv = inflight_settings_new(&inflight_settings, iv, niv, mem);
 7371|  4.44k|    if (rv != 0) {
  ------------------
  |  Branch (7371:9): [True: 0, False: 4.44k]
  ------------------
 7372|      0|      assert(nghttp2_is_fatal(rv));
  ------------------
  |  Branch (7372:7): [True: 0, False: 0]
  |  Branch (7372:7): [True: 0, False: 0]
  ------------------
 7373|      0|      nghttp2_mem_free(mem, iv_copy);
 7374|      0|      nghttp2_mem_free(mem, item);
 7375|      0|      return rv;
 7376|      0|    }
 7377|  4.44k|  }
 7378|       |
 7379|  8.43k|  nghttp2_outbound_item_init(item);
 7380|       |
 7381|  8.43k|  frame = &item->frame;
 7382|       |
 7383|  8.43k|  nghttp2_frame_settings_init(&frame->settings, flags, iv_copy, niv);
 7384|  8.43k|  rv = nghttp2_session_add_item(session, item);
 7385|  8.43k|  if (rv != 0) {
  ------------------
  |  Branch (7385:7): [True: 0, False: 8.43k]
  ------------------
 7386|       |    /* The only expected error is fatal one */
 7387|      0|    assert(nghttp2_is_fatal(rv));
  ------------------
  |  Branch (7387:5): [True: 0, False: 0]
  |  Branch (7387:5): [True: 0, False: 0]
  ------------------
 7388|       |
 7389|      0|    inflight_settings_del(inflight_settings, mem);
 7390|       |
 7391|      0|    nghttp2_frame_settings_free(&frame->settings, mem);
 7392|      0|    nghttp2_mem_free(mem, item);
 7393|       |
 7394|      0|    return rv;
 7395|      0|  }
 7396|       |
 7397|  8.43k|  if (flags & NGHTTP2_FLAG_ACK) {
  ------------------
  |  Branch (7397:7): [True: 3.98k, False: 4.44k]
  ------------------
 7398|  3.98k|    ++session->obq_flood_counter_;
 7399|  4.44k|  } else {
 7400|  4.44k|    session_append_inflight_settings(session, inflight_settings);
 7401|  4.44k|  }
 7402|       |
 7403|       |  /* Extract NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS and ENABLE_PUSH
 7404|       |     here.  We use it to refuse the incoming stream and PUSH_PROMISE
 7405|       |     with RST_STREAM. */
 7406|       |
 7407|  17.3k|  for (i = niv; i > 0; --i) {
  ------------------
  |  Branch (7407:17): [True: 13.3k, False: 3.98k]
  ------------------
 7408|  13.3k|    if (iv[i - 1].settings_id == NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS) {
  ------------------
  |  Branch (7408:9): [True: 4.44k, False: 8.89k]
  ------------------
 7409|  4.44k|      session->pending_local_max_concurrent_stream = iv[i - 1].value;
 7410|  4.44k|      break;
 7411|  4.44k|    }
 7412|  13.3k|  }
 7413|       |
 7414|  8.43k|  for (i = niv; i > 0; --i) {
  ------------------
  |  Branch (7414:17): [True: 4.44k, False: 3.98k]
  ------------------
 7415|  4.44k|    if (iv[i - 1].settings_id == NGHTTP2_SETTINGS_ENABLE_PUSH) {
  ------------------
  |  Branch (7415:9): [True: 4.44k, False: 0]
  ------------------
 7416|  4.44k|      session->pending_enable_push = (uint8_t)iv[i - 1].value;
 7417|  4.44k|      break;
 7418|  4.44k|    }
 7419|  4.44k|  }
 7420|       |
 7421|  21.7k|  for (i = niv; i > 0; --i) {
  ------------------
  |  Branch (7421:17): [True: 13.3k, False: 8.43k]
  ------------------
 7422|  13.3k|    if (iv[i - 1].settings_id == NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL) {
  ------------------
  |  Branch (7422:9): [True: 0, False: 13.3k]
  ------------------
 7423|      0|      session->pending_enable_connect_protocol = (uint8_t)iv[i - 1].value;
 7424|      0|      break;
 7425|      0|    }
 7426|  13.3k|  }
 7427|       |
 7428|  8.43k|  if (no_rfc7540_pri == UINT8_MAX) {
  ------------------
  |  Branch (7428:7): [True: 4.44k, False: 3.98k]
  ------------------
 7429|  4.44k|    session->pending_no_rfc7540_priorities = 0;
 7430|  4.44k|  } else {
 7431|  3.98k|    session->pending_no_rfc7540_priorities = no_rfc7540_pri;
 7432|  3.98k|  }
 7433|       |
 7434|  8.43k|  return 0;
 7435|  8.43k|}
nghttp2_session_pack_data:
 7440|    894|                              nghttp2_stream *stream) {
 7441|    894|  int rv;
 7442|    894|  uint32_t data_flags;
 7443|    894|  nghttp2_ssize payloadlen;
 7444|    894|  nghttp2_ssize padded_payloadlen;
 7445|    894|  nghttp2_buf *buf;
 7446|    894|  size_t max_payloadlen;
 7447|       |
 7448|    894|  assert(bufs->head == bufs->cur);
  ------------------
  |  Branch (7448:3): [True: 0, False: 894]
  |  Branch (7448:3): [True: 894, False: 0]
  ------------------
 7449|       |
 7450|    894|  buf = &bufs->cur->buf;
 7451|       |
 7452|    894|  if (session->callbacks.read_length_callback2 ||
  ------------------
  |  Branch (7452:7): [True: 0, False: 894]
  ------------------
 7453|    894|      session->callbacks.read_length_callback) {
  ------------------
  |  Branch (7453:7): [True: 0, False: 894]
  ------------------
 7454|      0|    if (session->callbacks.read_length_callback2) {
  ------------------
  |  Branch (7454:9): [True: 0, False: 0]
  ------------------
 7455|      0|      payloadlen = session->callbacks.read_length_callback2(
 7456|      0|        session, frame->hd.type, stream->stream_id, session->remote_window_size,
 7457|      0|        stream->remote_window_size, session->remote_settings.max_frame_size,
 7458|      0|        session->user_data);
 7459|      0|    } else {
 7460|      0|      payloadlen = (nghttp2_ssize)session->callbacks.read_length_callback(
 7461|      0|        session, frame->hd.type, stream->stream_id, session->remote_window_size,
 7462|      0|        stream->remote_window_size, session->remote_settings.max_frame_size,
 7463|      0|        session->user_data);
 7464|      0|    }
 7465|       |
 7466|      0|    DEBUGF("send: read_length_callback=%td\n", payloadlen);
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 7467|       |
 7468|      0|    payloadlen =
 7469|      0|      nghttp2_session_enforce_flow_control_limits(session, stream, payloadlen);
 7470|       |
 7471|      0|    DEBUGF("send: read_length_callback after flow control=%td\n", payloadlen);
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 7472|       |
 7473|      0|    if (payloadlen <= 0) {
  ------------------
  |  Branch (7473:9): [True: 0, False: 0]
  ------------------
 7474|      0|      return NGHTTP2_ERR_CALLBACK_FAILURE;
 7475|      0|    }
 7476|       |
 7477|      0|    if ((size_t)payloadlen > nghttp2_buf_avail(buf)) {
  ------------------
  |  |   55|      0|#define nghttp2_buf_avail(BUF) ((size_t)((BUF)->end - (BUF)->last))
  ------------------
  |  Branch (7477:9): [True: 0, False: 0]
  ------------------
 7478|       |      /* Resize the current buffer(s).  The reason why we do +1 for
 7479|       |         buffer size is for possible padding field. */
 7480|      0|      rv = nghttp2_bufs_realloc(&session->aob.framebufs,
 7481|      0|                                (size_t)(NGHTTP2_FRAME_HDLEN + 1 + payloadlen));
  ------------------
  |  |   40|      0|#define NGHTTP2_FRAME_HDLEN 9
  ------------------
 7482|       |
 7483|      0|      if (rv != 0) {
  ------------------
  |  Branch (7483:11): [True: 0, False: 0]
  ------------------
 7484|      0|        DEBUGF("send: realloc buffer failed rv=%d", rv);
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 7485|       |        /* If reallocation failed, old buffers are still in tact.  So
 7486|       |           use safe limit. */
 7487|      0|        payloadlen = (nghttp2_ssize)datamax;
 7488|       |
 7489|      0|        DEBUGF("send: use safe limit payloadlen=%td", payloadlen);
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 7490|      0|      } else {
 7491|      0|        assert(&session->aob.framebufs == bufs);
  ------------------
  |  Branch (7491:9): [True: 0, False: 0]
  |  Branch (7491:9): [True: 0, False: 0]
  ------------------
 7492|       |
 7493|      0|        buf = &bufs->cur->buf;
 7494|      0|      }
 7495|      0|    }
 7496|      0|    datamax = (size_t)payloadlen;
 7497|      0|  }
 7498|       |
 7499|       |  /* Current max DATA length is less then buffer chunk size */
 7500|    894|  assert(nghttp2_buf_avail(buf) >= datamax);
  ------------------
  |  Branch (7500:3): [True: 0, False: 894]
  |  Branch (7500:3): [True: 894, False: 0]
  ------------------
 7501|       |
 7502|    894|  data_flags = NGHTTP2_DATA_FLAG_NONE;
 7503|    894|  switch (aux_data->dpw.version) {
 7504|    894|  case NGHTTP2_DATA_PROVIDER_V1:
  ------------------
  |  |   36|    894|#define NGHTTP2_DATA_PROVIDER_V1 1
  ------------------
  |  Branch (7504:3): [True: 894, False: 0]
  ------------------
 7505|    894|    payloadlen = (nghttp2_ssize)aux_data->dpw.data_prd.v1.read_callback(
 7506|    894|      session, frame->hd.stream_id, buf->pos, datamax, &data_flags,
 7507|    894|      &aux_data->dpw.data_prd.v1.source, session->user_data);
 7508|       |
 7509|    894|    break;
 7510|      0|  case NGHTTP2_DATA_PROVIDER_V2:
  ------------------
  |  |   37|      0|#define NGHTTP2_DATA_PROVIDER_V2 2
  ------------------
  |  Branch (7510:3): [True: 0, False: 894]
  ------------------
 7511|      0|    payloadlen = aux_data->dpw.data_prd.v2.read_callback(
 7512|      0|      session, frame->hd.stream_id, buf->pos, datamax, &data_flags,
 7513|      0|      &aux_data->dpw.data_prd.v2.source, session->user_data);
 7514|       |
 7515|      0|    break;
 7516|      0|  default:
  ------------------
  |  Branch (7516:3): [True: 0, False: 894]
  ------------------
 7517|      0|    assert(0);
  ------------------
  |  Branch (7517:5): [Folded, False: 0]
  |  Branch (7517:5): [Folded, False: 0]
  ------------------
 7518|      0|    abort();
 7519|    894|  }
 7520|       |
 7521|    894|  if (payloadlen == NGHTTP2_ERR_DEFERRED ||
  ------------------
  |  Branch (7521:7): [True: 91, False: 803]
  ------------------
 7522|    803|      payloadlen == NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE ||
  ------------------
  |  Branch (7522:7): [True: 0, False: 803]
  ------------------
 7523|    803|      payloadlen == NGHTTP2_ERR_PAUSE) {
  ------------------
  |  Branch (7523:7): [True: 0, False: 803]
  ------------------
 7524|     91|    DEBUGF("send: DATA postponed due to %s\n",
  ------------------
  |  |   39|     91|    do {                                                                       \
  |  |   40|     91|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 91]
  |  |  ------------------
  ------------------
 7525|     91|           nghttp2_strerror((int)payloadlen));
 7526|       |
 7527|     91|    return (int)payloadlen;
 7528|     91|  }
 7529|       |
 7530|    803|  if (payloadlen < 0 || datamax < (size_t)payloadlen) {
  ------------------
  |  Branch (7530:7): [True: 0, False: 803]
  |  Branch (7530:25): [True: 0, False: 803]
  ------------------
 7531|       |    /* This is the error code when callback is failed. */
 7532|      0|    return NGHTTP2_ERR_CALLBACK_FAILURE;
 7533|      0|  }
 7534|       |
 7535|    803|  buf->last = buf->pos + payloadlen;
 7536|    803|  buf->pos -= NGHTTP2_FRAME_HDLEN;
  ------------------
  |  |   40|    803|#define NGHTTP2_FRAME_HDLEN 9
  ------------------
 7537|       |
 7538|       |  /* Clear flags, because this may contain previous flags of previous
 7539|       |     DATA */
 7540|    803|  frame->hd.flags = NGHTTP2_FLAG_NONE;
 7541|       |
 7542|    803|  if (data_flags & NGHTTP2_DATA_FLAG_EOF) {
  ------------------
  |  Branch (7542:7): [True: 405, False: 398]
  ------------------
 7543|    405|    aux_data->eof = 1;
 7544|       |    /* If NGHTTP2_DATA_FLAG_NO_END_STREAM is set, don't set
 7545|       |       NGHTTP2_FLAG_END_STREAM */
 7546|    405|    if ((aux_data->flags & NGHTTP2_FLAG_END_STREAM) &&
  ------------------
  |  Branch (7546:9): [True: 405, False: 0]
  ------------------
 7547|    405|        (data_flags & NGHTTP2_DATA_FLAG_NO_END_STREAM) == 0) {
  ------------------
  |  Branch (7547:9): [True: 405, False: 0]
  ------------------
 7548|    405|      frame->hd.flags |= NGHTTP2_FLAG_END_STREAM;
 7549|    405|    }
 7550|    405|  }
 7551|       |
 7552|    803|  if (data_flags & NGHTTP2_DATA_FLAG_NO_COPY) {
  ------------------
  |  Branch (7552:7): [True: 0, False: 803]
  ------------------
 7553|      0|    if (session->callbacks.send_data_callback == NULL) {
  ------------------
  |  Branch (7553:9): [True: 0, False: 0]
  ------------------
 7554|      0|      DEBUGF("NGHTTP2_DATA_FLAG_NO_COPY requires send_data_callback set\n");
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 7555|       |
 7556|      0|      return NGHTTP2_ERR_CALLBACK_FAILURE;
 7557|      0|    }
 7558|      0|    aux_data->no_copy = 1;
 7559|      0|  }
 7560|       |
 7561|    803|  frame->hd.length = (size_t)payloadlen;
 7562|    803|  frame->data.padlen = 0;
 7563|       |
 7564|    803|  max_payloadlen =
 7565|    803|    nghttp2_min_size(datamax, frame->hd.length + NGHTTP2_MAX_PADLEN);
  ------------------
  |  |   67|    803|#define NGHTTP2_MAX_PADLEN 256
  ------------------
 7566|       |
 7567|    803|  padded_payloadlen =
 7568|    803|    session_call_select_padding(session, frame, max_payloadlen);
 7569|       |
 7570|    803|  if (nghttp2_is_fatal((int)padded_payloadlen)) {
  ------------------
  |  Branch (7570:7): [True: 0, False: 803]
  ------------------
 7571|      0|    return (int)padded_payloadlen;
 7572|      0|  }
 7573|       |
 7574|    803|  frame->data.padlen = (size_t)(padded_payloadlen - payloadlen);
 7575|       |
 7576|    803|  nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
 7577|       |
 7578|    803|  nghttp2_frame_add_pad(bufs, &frame->hd, frame->data.padlen,
 7579|    803|                        aux_data->no_copy);
 7580|       |
 7581|    803|  session_reschedule_stream(session, stream);
 7582|       |
 7583|    803|  if (frame->hd.length == 0 && (data_flags & NGHTTP2_DATA_FLAG_EOF) &&
  ------------------
  |  Branch (7583:7): [True: 41, False: 762]
  |  Branch (7583:32): [True: 41, False: 0]
  ------------------
 7584|     41|      (data_flags & NGHTTP2_DATA_FLAG_NO_END_STREAM)) {
  ------------------
  |  Branch (7584:7): [True: 0, False: 41]
  ------------------
 7585|       |    /* DATA payload length is 0, and DATA frame does not bear
 7586|       |       END_STREAM.  In this case, there is no point to send 0 length
 7587|       |       DATA frame. */
 7588|      0|    return NGHTTP2_ERR_CANCEL;
 7589|      0|  }
 7590|       |
 7591|    803|  return 0;
 7592|    803|}
nghttp2_session_get_stream_user_data:
 7595|  41.6k|                                           int32_t stream_id) {
 7596|  41.6k|  nghttp2_stream *stream;
 7597|  41.6k|  stream = nghttp2_session_get_stream(session, stream_id);
 7598|  41.6k|  if (stream) {
  ------------------
  |  Branch (7598:7): [True: 41.0k, False: 613]
  ------------------
 7599|  41.0k|    return stream->stream_user_data;
 7600|  41.0k|  } else {
 7601|       |    return NULL;
 7602|    613|  }
 7603|  41.6k|}
nghttp2_session_set_stream_user_data:
 7607|  5.20k|                                         void *stream_user_data) {
 7608|  5.20k|  nghttp2_stream *stream;
 7609|  5.20k|  nghttp2_frame *frame;
 7610|  5.20k|  nghttp2_outbound_item *item;
 7611|       |
 7612|  5.20k|  stream = nghttp2_session_get_stream(session, stream_id);
 7613|  5.20k|  if (stream) {
  ------------------
  |  Branch (7613:7): [True: 4.40k, False: 797]
  ------------------
 7614|  4.40k|    stream->stream_user_data = stream_user_data;
 7615|  4.40k|    return 0;
 7616|  4.40k|  }
 7617|       |
 7618|    797|  if (session->server || !nghttp2_session_is_my_stream_id(session, stream_id) ||
  ------------------
  |  Branch (7618:7): [True: 0, False: 797]
  |  Branch (7618:26): [True: 0, False: 797]
  ------------------
 7619|    797|      !nghttp2_outbound_queue_top(&session->ob_syn)) {
  ------------------
  |  |  192|    797|#define nghttp2_outbound_queue_top(Q) ((Q)->head)
  ------------------
  |  Branch (7619:7): [True: 797, False: 0]
  ------------------
 7620|    797|    return NGHTTP2_ERR_INVALID_ARGUMENT;
 7621|    797|  }
 7622|       |
 7623|      0|  frame = &nghttp2_outbound_queue_top(&session->ob_syn)->frame;
  ------------------
  |  |  192|      0|#define nghttp2_outbound_queue_top(Q) ((Q)->head)
  ------------------
 7624|      0|  assert(frame->hd.type == NGHTTP2_HEADERS);
  ------------------
  |  Branch (7624:3): [True: 0, False: 0]
  |  Branch (7624:3): [True: 0, False: 0]
  ------------------
 7625|       |
 7626|      0|  if (frame->hd.stream_id > stream_id ||
  ------------------
  |  Branch (7626:7): [True: 0, False: 0]
  ------------------
 7627|      0|      (uint32_t)stream_id >= session->next_stream_id) {
  ------------------
  |  Branch (7627:7): [True: 0, False: 0]
  ------------------
 7628|      0|    return NGHTTP2_ERR_INVALID_ARGUMENT;
 7629|      0|  }
 7630|       |
 7631|      0|  for (item = session->ob_syn.head; item; item = item->qnext) {
  ------------------
  |  Branch (7631:37): [True: 0, False: 0]
  ------------------
 7632|      0|    if (item->frame.hd.stream_id < stream_id) {
  ------------------
  |  Branch (7632:9): [True: 0, False: 0]
  ------------------
 7633|      0|      continue;
 7634|      0|    }
 7635|       |
 7636|      0|    if (item->frame.hd.stream_id > stream_id) {
  ------------------
  |  Branch (7636:9): [True: 0, False: 0]
  ------------------
 7637|      0|      break;
 7638|      0|    }
 7639|       |
 7640|      0|    item->aux_data.headers.stream_user_data = stream_user_data;
 7641|      0|    return 0;
 7642|      0|  }
 7643|       |
 7644|      0|  return NGHTTP2_ERR_INVALID_ARGUMENT;
 7645|      0|}
nghttp2_session_resume_data:
 7647|  2.98M|int nghttp2_session_resume_data(nghttp2_session *session, int32_t stream_id) {
 7648|  2.98M|  int rv;
 7649|  2.98M|  nghttp2_stream *stream;
 7650|  2.98M|  stream = nghttp2_session_get_stream(session, stream_id);
 7651|  2.98M|  if (stream == NULL || !nghttp2_stream_check_deferred_item(stream)) {
  ------------------
  |  Branch (7651:7): [True: 4.40k, False: 2.98M]
  |  Branch (7651:25): [True: 2.98M, False: 85]
  ------------------
 7652|  2.98M|    return NGHTTP2_ERR_INVALID_ARGUMENT;
 7653|  2.98M|  }
 7654|       |
 7655|     85|  rv = session_resume_deferred_stream_item(session, stream,
 7656|     85|                                           NGHTTP2_STREAM_FLAG_DEFERRED_USER);
 7657|       |
 7658|     85|  if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (7658:7): [True: 0, False: 85]
  ------------------
 7659|      0|    return rv;
 7660|      0|  }
 7661|       |
 7662|     85|  return 0;
 7663|     85|}
nghttp2_session_get_stream_effective_local_window_size:
 7685|  4.56k|                                                       int32_t stream_id) {
 7686|  4.56k|  nghttp2_stream *stream;
 7687|  4.56k|  stream = nghttp2_session_get_stream(session, stream_id);
 7688|  4.56k|  if (stream == NULL) {
  ------------------
  |  Branch (7688:7): [True: 0, False: 4.56k]
  ------------------
 7689|      0|    return -1;
 7690|      0|  }
 7691|  4.56k|  return stream->local_window_size;
 7692|  4.56k|}
nghttp2_session_get_stream_remote_window_size:
 7729|  3.25M|                                                      int32_t stream_id) {
 7730|  3.25M|  nghttp2_stream *stream;
 7731|       |
 7732|  3.25M|  stream = nghttp2_session_get_stream(session, stream_id);
 7733|  3.25M|  if (stream == NULL) {
  ------------------
  |  Branch (7733:7): [True: 0, False: 3.25M]
  ------------------
 7734|      0|    return -1;
 7735|      0|  }
 7736|       |
 7737|       |  /* stream->remote_window_size can be negative when
 7738|       |     SETTINGS_INITIAL_WINDOW_SIZE is changed. */
 7739|  3.25M|  return nghttp2_max_int32(0, stream->remote_window_size);
 7740|  3.25M|}
nghttp2_session_get_remote_window_size:
 7742|  3.25M|int32_t nghttp2_session_get_remote_window_size(nghttp2_session *session) {
 7743|  3.25M|  return session->remote_window_size;
 7744|  3.25M|}
nghttp2_session_get_remote_settings:
 7747|  7.97k|                                             nghttp2_settings_id id) {
 7748|  7.97k|  switch (id) {
  ------------------
  |  Branch (7748:11): [True: 7.97k, False: 0]
  ------------------
 7749|      0|  case NGHTTP2_SETTINGS_HEADER_TABLE_SIZE:
  ------------------
  |  Branch (7749:3): [True: 0, False: 7.97k]
  ------------------
 7750|      0|    return session->remote_settings.header_table_size;
 7751|  3.98k|  case NGHTTP2_SETTINGS_ENABLE_PUSH:
  ------------------
  |  Branch (7751:3): [True: 3.98k, False: 3.98k]
  ------------------
 7752|  3.98k|    return session->remote_settings.enable_push;
 7753|  3.98k|  case NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS:
  ------------------
  |  Branch (7753:3): [True: 3.98k, False: 3.98k]
  ------------------
 7754|  3.98k|    return session->remote_settings.max_concurrent_streams;
 7755|      0|  case NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE:
  ------------------
  |  Branch (7755:3): [True: 0, False: 7.97k]
  ------------------
 7756|      0|    return session->remote_settings.initial_window_size;
 7757|      0|  case NGHTTP2_SETTINGS_MAX_FRAME_SIZE:
  ------------------
  |  Branch (7757:3): [True: 0, False: 7.97k]
  ------------------
 7758|      0|    return session->remote_settings.max_frame_size;
 7759|      0|  case NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE:
  ------------------
  |  Branch (7759:3): [True: 0, False: 7.97k]
  ------------------
 7760|      0|    return session->remote_settings.max_header_list_size;
 7761|      0|  case NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL:
  ------------------
  |  Branch (7761:3): [True: 0, False: 7.97k]
  ------------------
 7762|      0|    return session->remote_settings.enable_connect_protocol;
 7763|      0|  case NGHTTP2_SETTINGS_NO_RFC7540_PRIORITIES:
  ------------------
  |  Branch (7763:3): [True: 0, False: 7.97k]
  ------------------
 7764|      0|    return session->remote_settings.no_rfc7540_priorities;
 7765|  7.97k|  }
 7766|       |
 7767|  7.97k|  assert(0);
  ------------------
  |  Branch (7767:3): [Folded, False: 0]
  |  Branch (7767:3): [Folded, False: 0]
  ------------------
 7768|      0|  abort(); /* if NDEBUG is set */
 7769|      0|}
nghttp2_session_consume:
 7939|    657|                            size_t size) {
 7940|    657|  int rv;
 7941|    657|  nghttp2_stream *stream;
 7942|       |
 7943|    657|  if (stream_id == 0) {
  ------------------
  |  Branch (7943:7): [True: 0, False: 657]
  ------------------
 7944|      0|    return NGHTTP2_ERR_INVALID_ARGUMENT;
 7945|      0|  }
 7946|       |
 7947|    657|  if (!(session->opt_flags & NGHTTP2_OPTMASK_NO_AUTO_WINDOW_UPDATE)) {
  ------------------
  |  Branch (7947:7): [True: 0, False: 657]
  ------------------
 7948|      0|    return NGHTTP2_ERR_INVALID_STATE;
 7949|      0|  }
 7950|       |
 7951|    657|  rv = session_update_connection_consumed_size(session, size);
 7952|       |
 7953|    657|  if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (7953:7): [True: 0, False: 657]
  ------------------
 7954|      0|    return rv;
 7955|      0|  }
 7956|       |
 7957|    657|  stream = nghttp2_session_get_stream(session, stream_id);
 7958|       |
 7959|    657|  if (!stream) {
  ------------------
  |  Branch (7959:7): [True: 0, False: 657]
  ------------------
 7960|      0|    return 0;
 7961|      0|  }
 7962|       |
 7963|    657|  rv = session_update_stream_consumed_size(session, stream, size);
 7964|       |
 7965|    657|  if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (7965:7): [True: 0, False: 657]
  ------------------
 7966|      0|    return rv;
 7967|      0|  }
 7968|       |
 7969|    657|  return 0;
 7970|    657|}
nghttp2_session.c:session_terminate_session:
  218|  2.73k|                                     uint32_t error_code, const char *reason) {
  219|  2.73k|  int rv;
  220|  2.73k|  const uint8_t *debug_data;
  221|  2.73k|  size_t debug_datalen;
  222|       |
  223|  2.73k|  if (session->goaway_flags & NGHTTP2_GOAWAY_TERM_ON_SEND) {
  ------------------
  |  Branch (223:7): [True: 0, False: 2.73k]
  ------------------
  224|      0|    return 0;
  225|      0|  }
  226|       |
  227|       |  /* Ignore all incoming frames because we are going to tear down the
  228|       |     session. */
  229|  2.73k|  session->iframe.state = NGHTTP2_IB_IGN_ALL;
  230|       |
  231|  2.73k|  if (reason == NULL) {
  ------------------
  |  Branch (231:7): [True: 1.07k, False: 1.65k]
  ------------------
  232|  1.07k|    debug_data = NULL;
  233|  1.07k|    debug_datalen = 0;
  234|  1.65k|  } else {
  235|  1.65k|    debug_data = (const uint8_t *)reason;
  236|  1.65k|    debug_datalen = strlen(reason);
  237|  1.65k|  }
  238|       |
  239|  2.73k|  rv =
  240|  2.73k|    nghttp2_session_add_goaway(session, last_stream_id, error_code, debug_data,
  241|  2.73k|                               debug_datalen, NGHTTP2_GOAWAY_AUX_TERM_ON_SEND);
  242|       |
  243|  2.73k|  if (rv != 0) {
  ------------------
  |  Branch (243:7): [True: 0, False: 2.73k]
  ------------------
  244|      0|    return rv;
  245|      0|  }
  246|       |
  247|  2.73k|  session->goaway_flags |= NGHTTP2_GOAWAY_TERM_ON_SEND;
  248|       |
  249|  2.73k|  return 0;
  250|  2.73k|}
nghttp2_session.c:session_new:
  435|  4.44k|                       const nghttp2_option *option, nghttp2_mem *mem) {
  436|  4.44k|  int rv;
  437|  4.44k|  size_t nbuffer;
  438|  4.44k|  size_t max_deflate_dynamic_table_size =
  439|  4.44k|    NGHTTP2_HD_DEFAULT_MAX_DEFLATE_BUFFER_SIZE;
  ------------------
  |  |   50|  4.44k|#define NGHTTP2_HD_DEFAULT_MAX_DEFLATE_BUFFER_SIZE (1 << 12)
  ------------------
  440|  4.44k|  size_t i;
  441|  4.44k|  uint64_t map_seed;
  442|       |
  443|  4.44k|  if (mem == NULL) {
  ------------------
  |  Branch (443:7): [True: 0, False: 4.44k]
  ------------------
  444|      0|    mem = nghttp2_mem_default();
  445|      0|  }
  446|       |
  447|  4.44k|  *session_ptr = nghttp2_mem_calloc(mem, 1, sizeof(nghttp2_session));
  448|  4.44k|  if (*session_ptr == NULL) {
  ------------------
  |  Branch (448:7): [True: 0, False: 4.44k]
  ------------------
  449|      0|    rv = NGHTTP2_ERR_NOMEM;
  450|      0|    goto fail_session;
  451|      0|  }
  452|       |
  453|  4.44k|  (*session_ptr)->mem = *mem;
  454|  4.44k|  mem = &(*session_ptr)->mem;
  455|       |
  456|       |  /* next_stream_id is initialized in either
  457|       |     nghttp2_session_client_new2 or nghttp2_session_server_new2 */
  458|       |
  459|  4.44k|  (*session_ptr)->remote_window_size = NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE;
  ------------------
  |  |  237|  4.44k|#define NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE ((1 << 16) - 1)
  ------------------
  460|  4.44k|  (*session_ptr)->recv_window_size = 0;
  461|  4.44k|  (*session_ptr)->consumed_size = 0;
  462|  4.44k|  (*session_ptr)->recv_reduction = 0;
  463|  4.44k|  (*session_ptr)->local_window_size = NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE;
  ------------------
  |  |  237|  4.44k|#define NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE ((1 << 16) - 1)
  ------------------
  464|       |
  465|  4.44k|  (*session_ptr)->goaway_flags = NGHTTP2_GOAWAY_NONE;
  466|  4.44k|  (*session_ptr)->local_last_stream_id = (1u << 31) - 1;
  467|  4.44k|  (*session_ptr)->remote_last_stream_id = (1u << 31) - 1;
  468|       |
  469|  4.44k|  (*session_ptr)->pending_local_max_concurrent_stream =
  470|  4.44k|    NGHTTP2_DEFAULT_MAX_CONCURRENT_STREAMS;
  ------------------
  |  |  103|  4.44k|#define NGHTTP2_DEFAULT_MAX_CONCURRENT_STREAMS 0xffffffffu
  ------------------
  471|  4.44k|  (*session_ptr)->pending_enable_push = 1;
  472|  4.44k|  (*session_ptr)->pending_no_rfc7540_priorities = UINT8_MAX;
  473|       |
  474|  4.44k|  nghttp2_ratelim_init(&(*session_ptr)->stream_reset_ratelim,
  475|  4.44k|                       NGHTTP2_DEFAULT_STREAM_RESET_BURST,
  ------------------
  |  |  106|  4.44k|#define NGHTTP2_DEFAULT_STREAM_RESET_BURST 1000
  ------------------
  476|  4.44k|                       NGHTTP2_DEFAULT_STREAM_RESET_RATE);
  ------------------
  |  |  107|  4.44k|#define NGHTTP2_DEFAULT_STREAM_RESET_RATE 33
  ------------------
  477|       |
  478|  4.44k|  nghttp2_ratelim_init(&(*session_ptr)->glitch_ratelim,
  479|  4.44k|                       NGHTTP2_DEFAULT_GLITCH_BURST,
  ------------------
  |  |  110|  4.44k|#define NGHTTP2_DEFAULT_GLITCH_BURST 10000
  ------------------
  480|  4.44k|                       NGHTTP2_DEFAULT_GLITCH_RATE);
  ------------------
  |  |  111|  4.44k|#define NGHTTP2_DEFAULT_GLITCH_RATE 330
  ------------------
  481|       |
  482|  4.44k|  if (server) {
  ------------------
  |  Branch (482:7): [True: 0, False: 4.44k]
  ------------------
  483|      0|    (*session_ptr)->server = 1;
  484|      0|  }
  485|       |
  486|  4.44k|  init_settings(&(*session_ptr)->remote_settings);
  487|  4.44k|  init_settings(&(*session_ptr)->local_settings);
  488|       |
  489|  4.44k|  (*session_ptr)->max_incoming_reserved_streams =
  490|  4.44k|    NGHTTP2_MAX_INCOMING_RESERVED_STREAMS;
  ------------------
  |  |   90|  4.44k|#define NGHTTP2_MAX_INCOMING_RESERVED_STREAMS 200
  ------------------
  491|       |
  492|       |  /* Limit max outgoing concurrent streams to sensible value */
  493|  4.44k|  (*session_ptr)->remote_settings.max_concurrent_streams = 100;
  494|       |
  495|  4.44k|  (*session_ptr)->max_send_header_block_length = NGHTTP2_MAX_HEADERSLEN;
  ------------------
  |  |   58|  4.44k|#define NGHTTP2_MAX_HEADERSLEN 65536
  ------------------
  496|  4.44k|  (*session_ptr)->max_outbound_ack = NGHTTP2_DEFAULT_MAX_OBQ_FLOOD_ITEM;
  ------------------
  |  |  100|  4.44k|#define NGHTTP2_DEFAULT_MAX_OBQ_FLOOD_ITEM 1000
  ------------------
  497|  4.44k|  (*session_ptr)->max_settings = NGHTTP2_DEFAULT_MAX_SETTINGS;
  ------------------
  |  |  266|  4.44k|#define NGHTTP2_DEFAULT_MAX_SETTINGS 32
  ------------------
  498|  4.44k|  (*session_ptr)->max_continuations = NGHTTP2_DEFAULT_MAX_CONTINUATIONS;
  ------------------
  |  |  115|  4.44k|#define NGHTTP2_DEFAULT_MAX_CONTINUATIONS 8
  ------------------
  499|       |
  500|  4.44k|  if (option) {
  ------------------
  |  Branch (500:7): [True: 4.44k, False: 0]
  ------------------
  501|  4.44k|    if ((option->opt_set_mask & NGHTTP2_OPT_NO_AUTO_WINDOW_UPDATE) &&
  ------------------
  |  Branch (501:9): [True: 4.44k, False: 0]
  ------------------
  502|  4.44k|        option->no_auto_window_update) {
  ------------------
  |  Branch (502:9): [True: 4.44k, False: 0]
  ------------------
  503|  4.44k|      (*session_ptr)->opt_flags |= NGHTTP2_OPTMASK_NO_AUTO_WINDOW_UPDATE;
  504|  4.44k|    }
  505|       |
  506|  4.44k|    if (option->opt_set_mask & NGHTTP2_OPT_PEER_MAX_CONCURRENT_STREAMS) {
  ------------------
  |  Branch (506:9): [True: 0, False: 4.44k]
  ------------------
  507|      0|      (*session_ptr)->remote_settings.max_concurrent_streams =
  508|      0|        option->peer_max_concurrent_streams;
  509|      0|    }
  510|       |
  511|  4.44k|    if (option->opt_set_mask & NGHTTP2_OPT_MAX_RESERVED_REMOTE_STREAMS) {
  ------------------
  |  Branch (511:9): [True: 0, False: 4.44k]
  ------------------
  512|      0|      (*session_ptr)->max_incoming_reserved_streams =
  513|      0|        option->max_reserved_remote_streams;
  514|      0|    }
  515|       |
  516|  4.44k|    if ((option->opt_set_mask & NGHTTP2_OPT_NO_RECV_CLIENT_MAGIC) &&
  ------------------
  |  Branch (516:9): [True: 0, False: 4.44k]
  ------------------
  517|      0|        option->no_recv_client_magic) {
  ------------------
  |  Branch (517:9): [True: 0, False: 0]
  ------------------
  518|      0|      (*session_ptr)->opt_flags |= NGHTTP2_OPTMASK_NO_RECV_CLIENT_MAGIC;
  519|      0|    }
  520|       |
  521|  4.44k|    if ((option->opt_set_mask & NGHTTP2_OPT_NO_HTTP_MESSAGING) &&
  ------------------
  |  Branch (521:9): [True: 0, False: 4.44k]
  ------------------
  522|      0|        option->no_http_messaging) {
  ------------------
  |  Branch (522:9): [True: 0, False: 0]
  ------------------
  523|      0|      (*session_ptr)->opt_flags |= NGHTTP2_OPTMASK_NO_HTTP_MESSAGING;
  524|      0|    }
  525|       |
  526|  4.44k|    if (option->opt_set_mask & NGHTTP2_OPT_USER_RECV_EXT_TYPES) {
  ------------------
  |  Branch (526:9): [True: 0, False: 4.44k]
  ------------------
  527|      0|      memcpy((*session_ptr)->user_recv_ext_types, option->user_recv_ext_types,
  528|      0|             sizeof((*session_ptr)->user_recv_ext_types));
  529|      0|    }
  530|       |
  531|  4.44k|    if (option->opt_set_mask & NGHTTP2_OPT_BUILTIN_RECV_EXT_TYPES) {
  ------------------
  |  Branch (531:9): [True: 0, False: 4.44k]
  ------------------
  532|      0|      (*session_ptr)->builtin_recv_ext_types = option->builtin_recv_ext_types;
  533|      0|    }
  534|       |
  535|  4.44k|    if ((option->opt_set_mask & NGHTTP2_OPT_NO_AUTO_PING_ACK) &&
  ------------------
  |  Branch (535:9): [True: 0, False: 4.44k]
  ------------------
  536|      0|        option->no_auto_ping_ack) {
  ------------------
  |  Branch (536:9): [True: 0, False: 0]
  ------------------
  537|      0|      (*session_ptr)->opt_flags |= NGHTTP2_OPTMASK_NO_AUTO_PING_ACK;
  538|      0|    }
  539|       |
  540|  4.44k|    if (option->opt_set_mask & NGHTTP2_OPT_MAX_SEND_HEADER_BLOCK_LENGTH) {
  ------------------
  |  Branch (540:9): [True: 0, False: 4.44k]
  ------------------
  541|      0|      (*session_ptr)->max_send_header_block_length =
  542|      0|        option->max_send_header_block_length;
  543|      0|    }
  544|       |
  545|  4.44k|    if (option->opt_set_mask & NGHTTP2_OPT_MAX_DEFLATE_DYNAMIC_TABLE_SIZE) {
  ------------------
  |  Branch (545:9): [True: 0, False: 4.44k]
  ------------------
  546|      0|      max_deflate_dynamic_table_size = option->max_deflate_dynamic_table_size;
  547|      0|    }
  548|       |
  549|  4.44k|    if (option->opt_set_mask & NGHTTP2_OPT_MAX_OUTBOUND_ACK) {
  ------------------
  |  Branch (549:9): [True: 0, False: 4.44k]
  ------------------
  550|      0|      (*session_ptr)->max_outbound_ack = option->max_outbound_ack;
  551|      0|    }
  552|       |
  553|  4.44k|    if ((option->opt_set_mask & NGHTTP2_OPT_MAX_SETTINGS) &&
  ------------------
  |  Branch (553:9): [True: 0, False: 4.44k]
  ------------------
  554|      0|        option->max_settings) {
  ------------------
  |  Branch (554:9): [True: 0, False: 0]
  ------------------
  555|      0|      (*session_ptr)->max_settings = option->max_settings;
  556|      0|    }
  557|       |
  558|  4.44k|    if ((option->opt_set_mask &
  ------------------
  |  Branch (558:9): [True: 4.44k, False: 0]
  ------------------
  559|  4.44k|         NGHTTP2_OPT_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION) &&
  560|  4.44k|        option->no_rfc9113_leading_and_trailing_ws_validation) {
  ------------------
  |  Branch (560:9): [True: 4.44k, False: 0]
  ------------------
  561|  4.44k|      (*session_ptr)->opt_flags |=
  562|  4.44k|        NGHTTP2_OPTMASK_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION;
  563|  4.44k|    }
  564|       |
  565|  4.44k|    if (option->opt_set_mask & NGHTTP2_OPT_STREAM_RESET_RATE_LIMIT) {
  ------------------
  |  Branch (565:9): [True: 0, False: 4.44k]
  ------------------
  566|      0|      nghttp2_ratelim_init(&(*session_ptr)->stream_reset_ratelim,
  567|      0|                           option->stream_reset_burst,
  568|      0|                           option->stream_reset_rate);
  569|      0|    }
  570|       |
  571|  4.44k|    if (option->opt_set_mask & NGHTTP2_OPT_MAX_CONTINUATIONS) {
  ------------------
  |  Branch (571:9): [True: 0, False: 4.44k]
  ------------------
  572|      0|      (*session_ptr)->max_continuations = option->max_continuations;
  573|      0|    }
  574|       |
  575|  4.44k|    if (option->opt_set_mask & NGHTTP2_OPT_GLITCH_RATE_LIMIT) {
  ------------------
  |  Branch (575:9): [True: 0, False: 4.44k]
  ------------------
  576|      0|      nghttp2_ratelim_init(&(*session_ptr)->glitch_ratelim,
  577|      0|                           option->glitch_burst, option->glitch_rate);
  578|      0|    }
  579|  4.44k|  }
  580|       |
  581|  4.44k|  rv = nghttp2_hd_deflate_init2(&(*session_ptr)->hd_deflater,
  582|  4.44k|                                max_deflate_dynamic_table_size, mem);
  583|  4.44k|  if (rv != 0) {
  ------------------
  |  Branch (583:7): [True: 0, False: 4.44k]
  ------------------
  584|      0|    goto fail_hd_deflater;
  585|      0|  }
  586|  4.44k|  rv = nghttp2_hd_inflate_init(&(*session_ptr)->hd_inflater, mem);
  587|  4.44k|  if (rv != 0) {
  ------------------
  |  Branch (587:7): [True: 0, False: 4.44k]
  ------------------
  588|      0|    goto fail_hd_inflater;
  589|      0|  }
  590|       |
  591|  4.44k|  nbuffer = ((*session_ptr)->max_send_header_block_length +
  592|  4.44k|             NGHTTP2_FRAMEBUF_CHUNKLEN - 1) /
  ------------------
  |  |   50|  4.44k|  (NGHTTP2_FRAME_HDLEN + 1 + NGHTTP2_MAX_PAYLOADLEN)
  |  |  ------------------
  |  |  |  |   40|  4.44k|#define NGHTTP2_FRAME_HDLEN 9
  |  |  ------------------
  |  |                 (NGHTTP2_FRAME_HDLEN + 1 + NGHTTP2_MAX_PAYLOADLEN)
  |  |  ------------------
  |  |  |  |   45|  4.44k|#define NGHTTP2_MAX_PAYLOADLEN 16384
  |  |  ------------------
  ------------------
  593|  4.44k|            NGHTTP2_FRAMEBUF_CHUNKLEN;
  ------------------
  |  |   50|  4.44k|  (NGHTTP2_FRAME_HDLEN + 1 + NGHTTP2_MAX_PAYLOADLEN)
  |  |  ------------------
  |  |  |  |   40|  4.44k|#define NGHTTP2_FRAME_HDLEN 9
  |  |  ------------------
  |  |                 (NGHTTP2_FRAME_HDLEN + 1 + NGHTTP2_MAX_PAYLOADLEN)
  |  |  ------------------
  |  |  |  |   45|  4.44k|#define NGHTTP2_MAX_PAYLOADLEN 16384
  |  |  ------------------
  ------------------
  594|       |
  595|  4.44k|  if (nbuffer == 0) {
  ------------------
  |  Branch (595:7): [True: 0, False: 4.44k]
  ------------------
  596|      0|    nbuffer = 1;
  597|      0|  }
  598|       |
  599|       |  /* 1 for Pad Field. */
  600|  4.44k|  rv = nghttp2_bufs_init3(&(*session_ptr)->aob.framebufs,
  601|  4.44k|                          NGHTTP2_FRAMEBUF_CHUNKLEN, nbuffer, 1,
  ------------------
  |  |   50|  4.44k|  (NGHTTP2_FRAME_HDLEN + 1 + NGHTTP2_MAX_PAYLOADLEN)
  |  |  ------------------
  |  |  |  |   40|  4.44k|#define NGHTTP2_FRAME_HDLEN 9
  |  |  ------------------
  |  |                 (NGHTTP2_FRAME_HDLEN + 1 + NGHTTP2_MAX_PAYLOADLEN)
  |  |  ------------------
  |  |  |  |   45|  4.44k|#define NGHTTP2_MAX_PAYLOADLEN 16384
  |  |  ------------------
  ------------------
  602|  4.44k|                          NGHTTP2_FRAME_HDLEN + 1, mem);
  ------------------
  |  |   40|  4.44k|#define NGHTTP2_FRAME_HDLEN 9
  ------------------
  603|  4.44k|  if (rv != 0) {
  ------------------
  |  Branch (603:7): [True: 0, False: 4.44k]
  ------------------
  604|      0|    goto fail_aob_framebuf;
  605|      0|  }
  606|       |
  607|  4.44k|  if (callbacks->rand_callback) {
  ------------------
  |  Branch (607:7): [True: 0, False: 4.44k]
  ------------------
  608|      0|    callbacks->rand_callback((uint8_t *)&map_seed, sizeof(map_seed));
  609|  4.44k|  } else {
  610|  4.44k|    map_seed = 0;
  611|  4.44k|  }
  612|       |
  613|  4.44k|  nghttp2_map_init(&(*session_ptr)->streams, map_seed, mem);
  614|       |
  615|  4.44k|  active_outbound_item_reset(&(*session_ptr)->aob, mem);
  616|       |
  617|  4.44k|  (*session_ptr)->callbacks = *callbacks;
  618|  4.44k|  (*session_ptr)->user_data = user_data;
  619|       |
  620|  4.44k|  session_inbound_frame_reset(*session_ptr);
  621|       |
  622|  4.44k|  if (nghttp2_enable_strict_preface) {
  ------------------
  |  Branch (622:7): [True: 4.44k, False: 0]
  ------------------
  623|  4.44k|    nghttp2_inbound_frame *iframe = &(*session_ptr)->iframe;
  624|       |
  625|  4.44k|    if (server && ((*session_ptr)->opt_flags &
  ------------------
  |  Branch (625:9): [True: 0, False: 4.44k]
  |  Branch (625:19): [True: 0, False: 0]
  ------------------
  626|      0|                   NGHTTP2_OPTMASK_NO_RECV_CLIENT_MAGIC) == 0) {
  627|      0|      iframe->state = NGHTTP2_IB_READ_CLIENT_MAGIC;
  628|      0|      iframe->payloadleft = NGHTTP2_CLIENT_MAGIC_LEN;
  ------------------
  |  |  259|      0|#define NGHTTP2_CLIENT_MAGIC_LEN 24
  ------------------
  629|  4.44k|    } else {
  630|  4.44k|      iframe->state = NGHTTP2_IB_READ_FIRST_SETTINGS;
  631|  4.44k|    }
  632|       |
  633|  4.44k|    if (!server) {
  ------------------
  |  Branch (633:9): [True: 4.44k, False: 0]
  ------------------
  634|  4.44k|      (*session_ptr)->aob.state = NGHTTP2_OB_SEND_CLIENT_MAGIC;
  635|  4.44k|      nghttp2_bufs_add(&(*session_ptr)->aob.framebufs, NGHTTP2_CLIENT_MAGIC,
  ------------------
  |  |  252|  4.44k|#define NGHTTP2_CLIENT_MAGIC "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
  ------------------
  636|  4.44k|                       NGHTTP2_CLIENT_MAGIC_LEN);
  ------------------
  |  |  259|  4.44k|#define NGHTTP2_CLIENT_MAGIC_LEN 24
  ------------------
  637|  4.44k|    }
  638|  4.44k|  }
  639|       |
  640|  40.0k|  for (i = 0; i < NGHTTP2_EXTPRI_URGENCY_LEVELS; ++i) {
  ------------------
  |  | 5028|  40.0k|#define NGHTTP2_EXTPRI_URGENCY_LEVELS (NGHTTP2_EXTPRI_URGENCY_LOW + 1)
  |  |  ------------------
  |  |  |  | 5020|  40.0k|#define NGHTTP2_EXTPRI_URGENCY_LOW 7
  |  |  ------------------
  ------------------
  |  Branch (640:15): [True: 35.5k, False: 4.44k]
  ------------------
  641|  35.5k|    nghttp2_pq_init(&(*session_ptr)->sched[i].ob_data, stream_less, mem);
  642|  35.5k|  }
  643|       |
  644|  4.44k|  return 0;
  645|       |
  646|      0|fail_aob_framebuf:
  647|      0|  nghttp2_hd_inflate_free(&(*session_ptr)->hd_inflater);
  648|      0|fail_hd_inflater:
  649|      0|  nghttp2_hd_deflate_free(&(*session_ptr)->hd_deflater);
  650|      0|fail_hd_deflater:
  651|      0|  nghttp2_mem_free(mem, *session_ptr);
  652|      0|fail_session:
  653|      0|  return rv;
  654|      0|}
nghttp2_session.c:init_settings:
  394|  8.89k|static void init_settings(nghttp2_settings_storage *settings) {
  395|  8.89k|  settings->header_table_size = NGHTTP2_HD_DEFAULT_MAX_BUFFER_SIZE;
  ------------------
  |  |   39|  8.89k|#define NGHTTP2_HD_DEFAULT_MAX_BUFFER_SIZE NGHTTP2_DEFAULT_HEADER_TABLE_SIZE
  |  |  ------------------
  |  |  |  |  244|  8.89k|#define NGHTTP2_DEFAULT_HEADER_TABLE_SIZE (1 << 12)
  |  |  ------------------
  ------------------
  396|  8.89k|  settings->enable_push = 1;
  397|  8.89k|  settings->max_concurrent_streams = NGHTTP2_DEFAULT_MAX_CONCURRENT_STREAMS;
  ------------------
  |  |  103|  8.89k|#define NGHTTP2_DEFAULT_MAX_CONCURRENT_STREAMS 0xffffffffu
  ------------------
  398|  8.89k|  settings->initial_window_size = NGHTTP2_INITIAL_WINDOW_SIZE;
  ------------------
  |  |  231|  8.89k|#define NGHTTP2_INITIAL_WINDOW_SIZE ((1 << 16) - 1)
  ------------------
  399|  8.89k|  settings->max_frame_size = NGHTTP2_MAX_FRAME_SIZE_MIN;
  ------------------
  |  |   43|  8.89k|#define NGHTTP2_MAX_FRAME_SIZE_MIN (1 << 14)
  ------------------
  400|  8.89k|  settings->max_header_list_size = UINT32_MAX;
  401|       |  settings->no_rfc7540_priorities = UINT32_MAX;
  402|  8.89k|}
nghttp2_session.c:inflight_settings_del:
  781|  4.44k|                                  nghttp2_mem *mem) {
  782|  4.44k|  if (!settings) {
  ------------------
  |  Branch (782:7): [True: 0, False: 4.44k]
  ------------------
  783|      0|    return;
  784|      0|  }
  785|       |
  786|  4.44k|  nghttp2_mem_free(mem, settings->iv);
  787|  4.44k|  nghttp2_mem_free(mem, settings);
  788|  4.44k|}
nghttp2_session.c:free_streams:
  724|  2.37k|static int free_streams(void *entry, void *ptr) {
  725|  2.37k|  nghttp2_session *session;
  726|  2.37k|  nghttp2_stream *stream;
  727|  2.37k|  nghttp2_outbound_item *item;
  728|  2.37k|  nghttp2_mem *mem;
  729|       |
  730|  2.37k|  session = (nghttp2_session *)ptr;
  731|  2.37k|  mem = &session->mem;
  732|  2.37k|  stream = (nghttp2_stream *)entry;
  733|  2.37k|  item = stream->item;
  734|       |
  735|  2.37k|  if (item && !item->queued && item != session->aob.item) {
  ------------------
  |  Branch (735:7): [True: 10, False: 2.36k]
  |  Branch (735:15): [True: 10, False: 0]
  |  Branch (735:32): [True: 10, False: 0]
  ------------------
  736|     10|    nghttp2_outbound_item_free(item, mem);
  737|     10|    nghttp2_mem_free(mem, item);
  738|     10|  }
  739|       |
  740|  2.37k|  nghttp2_stream_free(stream);
  741|  2.37k|  nghttp2_mem_free(mem, stream);
  742|       |
  743|  2.37k|  return 0;
  744|  2.37k|}
nghttp2_session.c:ob_q_free:
  746|  13.3k|static void ob_q_free(nghttp2_outbound_queue *q, nghttp2_mem *mem) {
  747|  13.3k|  nghttp2_outbound_item *item, *next;
  748|  13.3k|  for (item = q->head; item;) {
  ------------------
  |  Branch (748:24): [True: 0, False: 13.3k]
  ------------------
  749|      0|    next = item->qnext;
  750|      0|    nghttp2_outbound_item_free(item, mem);
  751|      0|    nghttp2_mem_free(mem, item);
  752|      0|    item = next;
  753|      0|  }
  754|  13.3k|}
nghttp2_session.c:active_outbound_item_reset:
  405|  48.1k|                                       nghttp2_mem *mem) {
  406|  48.1k|  DEBUGF("send: reset nghttp2_active_outbound_item\n");
  ------------------
  |  |   39|  48.1k|    do {                                                                       \
  |  |   40|  48.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 48.1k]
  |  |  ------------------
  ------------------
  407|  48.1k|  DEBUGF("send: aob->item = %p\n", aob->item);
  ------------------
  |  |   39|  48.1k|    do {                                                                       \
  |  |   40|  48.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 48.1k]
  |  |  ------------------
  ------------------
  408|  48.1k|  nghttp2_outbound_item_free(aob->item, mem);
  409|  48.1k|  nghttp2_mem_free(mem, aob->item);
  410|       |  aob->item = NULL;
  411|  48.1k|  nghttp2_bufs_reset(&aob->framebufs);
  412|  48.1k|  aob->state = NGHTTP2_OB_POP_ITEM;
  413|  48.1k|}
nghttp2_session.c:session_inbound_frame_reset:
  303|  16.3k|static void session_inbound_frame_reset(nghttp2_session *session) {
  304|  16.3k|  nghttp2_inbound_frame *iframe = &session->iframe;
  305|  16.3k|  nghttp2_mem *mem = &session->mem;
  306|       |  /* A bit risky code, since if this function is called from
  307|       |     nghttp2_session_new(), we rely on the fact that
  308|       |     iframe->frame.hd.type is 0, so that no free is performed. */
  309|  16.3k|  switch (iframe->frame.hd.type) {
  310|  6.47k|  case NGHTTP2_DATA:
  ------------------
  |  Branch (310:3): [True: 6.47k, False: 9.86k]
  ------------------
  311|  6.47k|    break;
  312|  2.14k|  case NGHTTP2_HEADERS:
  ------------------
  |  Branch (312:3): [True: 2.14k, False: 14.1k]
  ------------------
  313|  2.14k|    nghttp2_frame_headers_free(&iframe->frame.headers, mem);
  314|  2.14k|    break;
  315|     17|  case NGHTTP2_PRIORITY:
  ------------------
  |  Branch (315:3): [True: 17, False: 16.3k]
  ------------------
  316|     17|    nghttp2_frame_priority_free(&iframe->frame.priority);
  317|     17|    break;
  318|    284|  case NGHTTP2_RST_STREAM:
  ------------------
  |  Branch (318:3): [True: 284, False: 16.0k]
  ------------------
  319|    284|    nghttp2_frame_rst_stream_free(&iframe->frame.rst_stream);
  320|    284|    break;
  321|  4.45k|  case NGHTTP2_SETTINGS:
  ------------------
  |  Branch (321:3): [True: 4.45k, False: 11.8k]
  ------------------
  322|  4.45k|    nghttp2_frame_settings_free(&iframe->frame.settings, mem);
  323|       |
  324|  4.45k|    nghttp2_mem_free(mem, iframe->iv);
  325|       |
  326|  4.45k|    iframe->iv = NULL;
  327|  4.45k|    iframe->niv = 0;
  328|  4.45k|    iframe->max_niv = 0;
  329|       |
  330|  4.45k|    break;
  331|    227|  case NGHTTP2_PUSH_PROMISE:
  ------------------
  |  Branch (331:3): [True: 227, False: 16.1k]
  ------------------
  332|    227|    nghttp2_frame_push_promise_free(&iframe->frame.push_promise, mem);
  333|    227|    break;
  334|    153|  case NGHTTP2_PING:
  ------------------
  |  Branch (334:3): [True: 153, False: 16.1k]
  ------------------
  335|    153|    nghttp2_frame_ping_free(&iframe->frame.ping);
  336|    153|    break;
  337|    517|  case NGHTTP2_GOAWAY:
  ------------------
  |  Branch (337:3): [True: 517, False: 15.8k]
  ------------------
  338|    517|    nghttp2_frame_goaway_free(&iframe->frame.goaway, mem);
  339|    517|    break;
  340|    231|  case NGHTTP2_WINDOW_UPDATE:
  ------------------
  |  Branch (340:3): [True: 231, False: 16.1k]
  ------------------
  341|    231|    nghttp2_frame_window_update_free(&iframe->frame.window_update);
  342|    231|    break;
  343|  1.83k|  default:
  ------------------
  |  Branch (343:3): [True: 1.83k, False: 14.5k]
  ------------------
  344|       |    /* extension frame */
  345|  1.83k|    if (check_ext_type_set(session->user_recv_ext_types,
  ------------------
  |  Branch (345:9): [True: 0, False: 1.83k]
  ------------------
  346|  1.83k|                           iframe->frame.hd.type)) {
  347|      0|      nghttp2_frame_extension_free(&iframe->frame.ext);
  348|  1.83k|    } else {
  349|  1.83k|      switch (iframe->frame.hd.type) {
  ------------------
  |  Branch (349:15): [True: 159, False: 1.67k]
  ------------------
  350|     52|      case NGHTTP2_ALTSVC:
  ------------------
  |  Branch (350:7): [True: 52, False: 1.78k]
  ------------------
  351|     52|        if ((session->builtin_recv_ext_types & NGHTTP2_TYPEMASK_ALTSVC) == 0) {
  ------------------
  |  Branch (351:13): [True: 52, False: 0]
  ------------------
  352|     52|          break;
  353|     52|        }
  354|      0|        nghttp2_frame_altsvc_free(&iframe->frame.ext, mem);
  355|      0|        break;
  356|     27|      case NGHTTP2_ORIGIN:
  ------------------
  |  Branch (356:7): [True: 27, False: 1.80k]
  ------------------
  357|     27|        if ((session->builtin_recv_ext_types & NGHTTP2_TYPEMASK_ORIGIN) == 0) {
  ------------------
  |  Branch (357:13): [True: 27, False: 0]
  ------------------
  358|     27|          break;
  359|     27|        }
  360|      0|        nghttp2_frame_origin_free(&iframe->frame.ext, mem);
  361|      0|        break;
  362|     80|      case NGHTTP2_PRIORITY_UPDATE:
  ------------------
  |  Branch (362:7): [True: 80, False: 1.75k]
  ------------------
  363|     80|        if ((session->builtin_recv_ext_types &
  ------------------
  |  Branch (363:13): [True: 80, False: 0]
  ------------------
  364|     80|             NGHTTP2_TYPEMASK_PRIORITY_UPDATE) == 0) {
  365|     80|          break;
  366|     80|        }
  367|       |        /* Do not call nghttp2_frame_priority_update_free, because all
  368|       |           fields point to sbuf. */
  369|      0|        break;
  370|  1.83k|      }
  371|  1.83k|    }
  372|       |
  373|  1.83k|    break;
  374|  16.3k|  }
  375|       |
  376|  16.3k|  memset(&iframe->frame, 0, sizeof(nghttp2_frame));
  377|  16.3k|  memset(&iframe->ext_frame_payload, 0, sizeof(nghttp2_ext_frame_payload));
  378|       |
  379|  16.3k|  iframe->state = NGHTTP2_IB_READ_HEAD;
  380|       |
  381|  16.3k|  nghttp2_buf_wrap_init(&iframe->sbuf, iframe->raw_sbuf,
  382|  16.3k|                        sizeof(iframe->raw_sbuf));
  383|  16.3k|  iframe->sbuf.mark += NGHTTP2_FRAME_HDLEN;
  ------------------
  |  |   40|  16.3k|#define NGHTTP2_FRAME_HDLEN 9
  ------------------
  384|       |
  385|  16.3k|  nghttp2_buf_free(&iframe->lbuf, mem);
  386|  16.3k|  nghttp2_buf_wrap_init(&iframe->lbuf, NULL, 0);
  387|       |
  388|  16.3k|  iframe->raw_lbuf = NULL;
  389|       |
  390|  16.3k|  iframe->payloadleft = 0;
  391|  16.3k|  iframe->padlen = 0;
  392|  16.3k|}
nghttp2_session.c:session_attach_stream_item:
  887|    487|                                      nghttp2_outbound_item *item) {
  888|    487|  int rv;
  889|       |
  890|    487|  nghttp2_stream_attach_item(stream, item);
  891|       |
  892|    487|  rv = session_ob_data_push(session, stream);
  893|    487|  if (rv != 0) {
  ------------------
  |  Branch (893:7): [True: 0, False: 487]
  ------------------
  894|      0|    nghttp2_stream_detach_item(stream);
  895|       |
  896|      0|    return rv;
  897|      0|  }
  898|       |
  899|    487|  return 0;
  900|    487|}
nghttp2_session.c:session_ob_data_push:
  840|    555|                                nghttp2_stream *stream) {
  841|    555|  int rv;
  842|    555|  uint32_t urgency;
  843|    555|  int inc;
  844|    555|  nghttp2_pq *pq;
  845|       |
  846|    555|  assert(stream->queued == 0);
  ------------------
  |  Branch (846:3): [True: 0, False: 555]
  |  Branch (846:3): [True: 555, False: 0]
  ------------------
  847|       |
  848|    555|  urgency = nghttp2_extpri_uint8_urgency(stream->extpri);
  ------------------
  |  |   57|    555|  ((uint32_t)((PRI) & ~NGHTTP2_EXTPRI_INC_MASK))
  |  |  ------------------
  |  |  |  |   39|    555|#define NGHTTP2_EXTPRI_INC_MASK (1 << 7)
  |  |  ------------------
  ------------------
  849|    555|  inc = nghttp2_extpri_uint8_inc(stream->extpri);
  ------------------
  |  |   63|    555|#define nghttp2_extpri_uint8_inc(PRI) (((PRI) & NGHTTP2_EXTPRI_INC_MASK) != 0)
  |  |  ------------------
  |  |  |  |   39|    555|#define NGHTTP2_EXTPRI_INC_MASK (1 << 7)
  |  |  ------------------
  ------------------
  850|       |
  851|    555|  assert(urgency < NGHTTP2_EXTPRI_URGENCY_LEVELS);
  ------------------
  |  Branch (851:3): [True: 0, False: 555]
  |  Branch (851:3): [True: 555, False: 0]
  ------------------
  852|       |
  853|    555|  pq = &session->sched[urgency].ob_data;
  854|       |
  855|    555|  stream->cycle = pq_get_first_cycle(pq);
  856|    555|  if (inc) {
  ------------------
  |  Branch (856:7): [True: 0, False: 555]
  ------------------
  857|      0|    stream->cycle += stream->last_writelen;
  858|      0|  }
  859|       |
  860|    555|  rv = nghttp2_pq_push(pq, &stream->pq_entry);
  861|    555|  if (rv != 0) {
  ------------------
  |  Branch (861:7): [True: 0, False: 555]
  ------------------
  862|      0|    return rv;
  863|      0|  }
  864|       |
  865|    555|  stream->queued = 1;
  866|       |
  867|    555|  return 0;
  868|    555|}
nghttp2_session.c:pq_get_first_cycle:
  828|    555|static uint64_t pq_get_first_cycle(nghttp2_pq *pq) {
  829|    555|  nghttp2_stream *stream;
  830|       |
  831|    555|  if (nghttp2_pq_empty(pq)) {
  ------------------
  |  Branch (831:7): [True: 555, False: 0]
  ------------------
  832|    555|    return 0;
  833|    555|  }
  834|       |
  835|      0|  stream = nghttp2_struct_of(nghttp2_pq_top(pq), nghttp2_stream, pq_entry);
  ------------------
  |  |   75|      0|  ((type *)(void *)((char *)(ptr) - offsetof(type, member)))
  ------------------
  836|      0|  return stream->cycle;
  837|    555|}
nghttp2_session.c:session_detach_stream_item:
  903|    477|                                       nghttp2_stream *stream) {
  904|    477|  nghttp2_stream_detach_item(stream);
  905|       |
  906|    477|  if (!stream->queued) {
  ------------------
  |  Branch (906:7): [True: 37, False: 440]
  ------------------
  907|     37|    return;
  908|     37|  }
  909|       |
  910|    440|  session_ob_data_remove(session, stream);
  911|    440|}
nghttp2_session.c:session_ob_data_remove:
  871|    548|                                   nghttp2_stream *stream) {
  872|    548|  uint32_t urgency;
  873|       |
  874|    548|  assert(stream->queued == 1);
  ------------------
  |  Branch (874:3): [True: 0, False: 548]
  |  Branch (874:3): [True: 548, False: 0]
  ------------------
  875|       |
  876|    548|  urgency = nghttp2_extpri_uint8_urgency(stream->extpri);
  ------------------
  |  |   57|    548|  ((uint32_t)((PRI) & ~NGHTTP2_EXTPRI_INC_MASK))
  |  |  ------------------
  |  |  |  |   39|    548|#define NGHTTP2_EXTPRI_INC_MASK (1 << 7)
  |  |  ------------------
  ------------------
  877|       |
  878|    548|  assert(urgency < NGHTTP2_EXTPRI_URGENCY_LEVELS);
  ------------------
  |  Branch (878:3): [True: 0, False: 548]
  |  Branch (878:3): [True: 548, False: 0]
  ------------------
  879|       |
  880|    548|  nghttp2_pq_remove(&session->sched[urgency].ob_data, &stream->pq_entry);
  881|       |
  882|    548|  stream->queued = 0;
  883|    548|}
nghttp2_session.c:session_is_closing:
 1406|  39.9k|static int session_is_closing(nghttp2_session *session) {
 1407|  39.9k|  return (session->goaway_flags & NGHTTP2_GOAWAY_TERM_ON_SEND) != 0 ||
  ------------------
  |  Branch (1407:10): [True: 12.6k, False: 27.3k]
  ------------------
 1408|  27.3k|         (nghttp2_session_want_read(session) == 0 &&
  ------------------
  |  Branch (1408:11): [True: 380, False: 26.9k]
  ------------------
 1409|    380|          nghttp2_session_want_write(session) == 0);
  ------------------
  |  Branch (1409:11): [True: 102, False: 278]
  ------------------
 1410|  39.9k|}
nghttp2_session.c:session_is_outgoing_concurrent_streams_max:
   52|  27.4k|session_is_outgoing_concurrent_streams_max(nghttp2_session *session) {
   53|  27.4k|  return session->remote_settings.max_concurrent_streams <=
   54|  27.4k|         session->num_outgoing_streams;
   55|  27.4k|}
nghttp2_session.c:session_sched_get_next_outbound_item:
  937|  18.5k|session_sched_get_next_outbound_item(nghttp2_session *session) {
  938|  18.5k|  size_t i;
  939|  18.5k|  nghttp2_pq_entry *ent;
  940|  18.5k|  nghttp2_stream *stream;
  941|       |
  942|   162k|  for (i = 0; i < NGHTTP2_EXTPRI_URGENCY_LEVELS; ++i) {
  ------------------
  |  | 5028|   162k|#define NGHTTP2_EXTPRI_URGENCY_LEVELS (NGHTTP2_EXTPRI_URGENCY_LOW + 1)
  |  |  ------------------
  |  |  |  | 5020|   162k|#define NGHTTP2_EXTPRI_URGENCY_LOW 7
  |  |  ------------------
  ------------------
  |  Branch (942:15): [True: 144k, False: 17.6k]
  ------------------
  943|   144k|    ent = nghttp2_pq_top(&session->sched[i].ob_data);
  944|   144k|    if (!ent) {
  ------------------
  |  Branch (944:9): [True: 143k, False: 916]
  ------------------
  945|   143k|      continue;
  946|   143k|    }
  947|       |
  948|    916|    stream = nghttp2_struct_of(ent, nghttp2_stream, pq_entry);
  ------------------
  |  |   75|    916|  ((type *)(void *)((char *)(ptr) - offsetof(type, member)))
  ------------------
  949|    916|    return stream->item;
  950|   144k|  }
  951|       |
  952|  17.6k|  return NULL;
  953|  18.5k|}
nghttp2_session.c:nghttp2_session_mem_send_internal:
 2826|  45.9k|                                                       int fast_cb) {
 2827|  45.9k|  int rv;
 2828|  45.9k|  nghttp2_active_outbound_item *aob;
 2829|  45.9k|  nghttp2_bufs *framebufs;
 2830|  45.9k|  nghttp2_mem *mem;
 2831|       |
 2832|  45.9k|  mem = &session->mem;
 2833|  45.9k|  aob = &session->aob;
 2834|  45.9k|  framebufs = &aob->framebufs;
 2835|       |
 2836|   108k|  for (;;) {
 2837|   108k|    switch (aob->state) {
  ------------------
  |  Branch (2837:13): [True: 108k, False: 0]
  ------------------
 2838|  52.4k|    case NGHTTP2_OB_POP_ITEM: {
  ------------------
  |  Branch (2838:5): [True: 52.4k, False: 56.3k]
  ------------------
 2839|  52.4k|      nghttp2_outbound_item *item;
 2840|       |
 2841|  52.4k|      item = nghttp2_session_pop_next_ob_item(session);
 2842|  52.4k|      if (item == NULL) {
  ------------------
  |  Branch (2842:11): [True: 17.7k, False: 34.7k]
  ------------------
 2843|  17.7k|        return 0;
 2844|  17.7k|      }
 2845|       |
 2846|  34.7k|      rv = session_prep_frame(session, item);
 2847|  34.7k|      if (rv == NGHTTP2_ERR_PAUSE) {
  ------------------
  |  Branch (2847:11): [True: 0, False: 34.7k]
  ------------------
 2848|      0|        return 0;
 2849|      0|      }
 2850|  34.7k|      if (rv == NGHTTP2_ERR_DEFERRED) {
  ------------------
  |  Branch (2850:11): [True: 108, False: 34.6k]
  ------------------
 2851|    108|        DEBUGF("send: frame transmission deferred\n");
  ------------------
  |  |   39|    108|    do {                                                                       \
  |  |   40|    108|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 108]
  |  |  ------------------
  ------------------
 2852|    108|        break;
 2853|    108|      }
 2854|  34.6k|      if (rv < 0) {
  ------------------
  |  Branch (2854:11): [True: 11.0k, False: 23.6k]
  ------------------
 2855|  11.0k|        int32_t opened_stream_id = 0;
 2856|  11.0k|        uint32_t error_code = NGHTTP2_INTERNAL_ERROR;
 2857|  11.0k|        int rv2 = 0;
 2858|       |
 2859|  11.0k|        DEBUGF("send: frame preparation failed with %s\n",
  ------------------
  |  |   39|  11.0k|    do {                                                                       \
  |  |   40|  11.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 11.0k]
  |  |  ------------------
  ------------------
 2860|  11.0k|               nghttp2_strerror(rv));
 2861|       |        /* TODO If the error comes from compressor, the connection
 2862|       |           must be closed. */
 2863|  11.0k|        if (item->frame.hd.type != NGHTTP2_DATA &&
  ------------------
  |  Branch (2863:13): [True: 11.0k, False: 5]
  ------------------
 2864|  11.0k|            session->callbacks.on_frame_not_send_callback && is_non_fatal(rv)) {
  ------------------
  |  Branch (2864:13): [True: 0, False: 11.0k]
  |  Branch (2864:62): [True: 0, False: 0]
  ------------------
 2865|      0|          nghttp2_frame *frame = &item->frame;
 2866|       |          /* The library is responsible for the transmission of
 2867|       |             WINDOW_UPDATE frame, so we don't call error callback for
 2868|       |             it.  As for RST_STREAM, if it is not sent due to missing
 2869|       |             stream, we also do not call error callback because it may
 2870|       |             cause a lot of noises.*/
 2871|      0|          if (frame->hd.type != NGHTTP2_WINDOW_UPDATE &&
  ------------------
  |  Branch (2871:15): [True: 0, False: 0]
  ------------------
 2872|      0|              (frame->hd.type != NGHTTP2_RST_STREAM ||
  ------------------
  |  Branch (2872:16): [True: 0, False: 0]
  ------------------
 2873|      0|               rv != NGHTTP2_ERR_STREAM_CLOSED) &&
  ------------------
  |  Branch (2873:16): [True: 0, False: 0]
  ------------------
 2874|      0|              session->callbacks.on_frame_not_send_callback(
  ------------------
  |  Branch (2874:15): [True: 0, False: 0]
  ------------------
 2875|      0|                session, frame, rv, session->user_data) != 0) {
 2876|      0|            nghttp2_outbound_item_free(item, mem);
 2877|      0|            nghttp2_mem_free(mem, item);
 2878|       |
 2879|      0|            return NGHTTP2_ERR_CALLBACK_FAILURE;
 2880|      0|          }
 2881|      0|        }
 2882|       |        /* We have to close stream opened by failed request HEADERS
 2883|       |           or PUSH_PROMISE. */
 2884|  11.0k|        switch (item->frame.hd.type) {
  ------------------
  |  Branch (2884:17): [True: 1, False: 11.0k]
  ------------------
 2885|      1|        case NGHTTP2_HEADERS:
  ------------------
  |  Branch (2885:9): [True: 1, False: 11.0k]
  ------------------
 2886|      1|          if (item->frame.headers.cat == NGHTTP2_HCAT_REQUEST) {
  ------------------
  |  Branch (2886:15): [True: 1, False: 0]
  ------------------
 2887|      1|            opened_stream_id = item->frame.hd.stream_id;
 2888|      1|            if (item->aux_data.headers.canceled) {
  ------------------
  |  Branch (2888:17): [True: 0, False: 1]
  ------------------
 2889|      0|              error_code = item->aux_data.headers.error_code;
 2890|      1|            } else {
 2891|       |              /* Set error_code to REFUSED_STREAM so that application
 2892|       |                 can send request again. */
 2893|      1|              error_code = NGHTTP2_REFUSED_STREAM;
 2894|      1|            }
 2895|      1|          }
 2896|      1|          break;
 2897|      0|        case NGHTTP2_PUSH_PROMISE:
  ------------------
  |  Branch (2897:9): [True: 0, False: 11.0k]
  ------------------
 2898|      0|          opened_stream_id = item->frame.push_promise.promised_stream_id;
 2899|      0|          break;
 2900|  11.0k|        }
 2901|  11.0k|        if (opened_stream_id) {
  ------------------
  |  Branch (2901:13): [True: 1, False: 11.0k]
  ------------------
 2902|       |          /* careful not to override rv */
 2903|      1|          rv2 =
 2904|      1|            nghttp2_session_close_stream(session, opened_stream_id, error_code);
 2905|      1|        }
 2906|       |
 2907|  11.0k|        nghttp2_outbound_item_free(item, mem);
 2908|  11.0k|        nghttp2_mem_free(mem, item);
 2909|  11.0k|        active_outbound_item_reset(aob, mem);
 2910|       |
 2911|  11.0k|        if (nghttp2_is_fatal(rv2)) {
  ------------------
  |  Branch (2911:13): [True: 0, False: 11.0k]
  ------------------
 2912|      0|          return rv2;
 2913|      0|        }
 2914|       |
 2915|  11.0k|        if (rv == NGHTTP2_ERR_HEADER_COMP) {
  ------------------
  |  Branch (2915:13): [True: 0, False: 11.0k]
  ------------------
 2916|       |          /* If header compression error occurred, should terminate
 2917|       |             connection. */
 2918|      0|          rv =
 2919|      0|            nghttp2_session_terminate_session(session, NGHTTP2_INTERNAL_ERROR);
 2920|      0|        }
 2921|  11.0k|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (2921:13): [True: 0, False: 11.0k]
  ------------------
 2922|      0|          return rv;
 2923|      0|        }
 2924|  11.0k|        break;
 2925|  11.0k|      }
 2926|       |
 2927|  23.6k|      aob->item = item;
 2928|       |
 2929|  23.6k|      nghttp2_bufs_rewind(framebufs);
  ------------------
  |  |  387|  23.6k|  do {                                                                         \
  |  |  388|  23.6k|    (BUFS)->cur = (BUFS)->head;                                                \
  |  |  389|  23.6k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (389:12): [Folded, False: 23.6k]
  |  |  ------------------
  ------------------
 2930|       |
 2931|  23.6k|      if (item->frame.hd.type != NGHTTP2_DATA) {
  ------------------
  |  Branch (2931:11): [True: 22.8k, False: 803]
  ------------------
 2932|  22.8k|        nghttp2_frame *frame;
 2933|       |
 2934|  22.8k|        frame = &item->frame;
 2935|       |
 2936|  22.8k|        DEBUGF("send: next frame: payloadlen=%zu, type=%u, flags=0x%02x, "
  ------------------
  |  |   39|  22.8k|    do {                                                                       \
  |  |   40|  22.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 22.8k]
  |  |  ------------------
  ------------------
 2937|  22.8k|               "stream_id=%d\n",
 2938|  22.8k|               frame->hd.length, frame->hd.type, frame->hd.flags,
 2939|  22.8k|               frame->hd.stream_id);
 2940|       |
 2941|  22.8k|        rv = session_call_before_frame_send(session, frame);
 2942|  22.8k|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (2942:13): [True: 0, False: 22.8k]
  ------------------
 2943|      0|          return rv;
 2944|      0|        }
 2945|       |
 2946|  22.8k|        if (rv == NGHTTP2_ERR_CANCEL) {
  ------------------
  |  Branch (2946:13): [True: 0, False: 22.8k]
  ------------------
 2947|      0|          int32_t opened_stream_id = 0;
 2948|      0|          uint32_t error_code = NGHTTP2_INTERNAL_ERROR;
 2949|       |
 2950|      0|          if (session->callbacks.on_frame_not_send_callback) {
  ------------------
  |  Branch (2950:15): [True: 0, False: 0]
  ------------------
 2951|      0|            if (session->callbacks.on_frame_not_send_callback(
  ------------------
  |  Branch (2951:17): [True: 0, False: 0]
  ------------------
 2952|      0|                  session, frame, rv, session->user_data) != 0) {
 2953|      0|              return NGHTTP2_ERR_CALLBACK_FAILURE;
 2954|      0|            }
 2955|      0|          }
 2956|       |
 2957|       |          /* We have to close stream opened by canceled request
 2958|       |             HEADERS or PUSH_PROMISE. */
 2959|      0|          switch (item->frame.hd.type) {
  ------------------
  |  Branch (2959:19): [True: 0, False: 0]
  ------------------
 2960|      0|          case NGHTTP2_HEADERS:
  ------------------
  |  Branch (2960:11): [True: 0, False: 0]
  ------------------
 2961|      0|            if (item->frame.headers.cat == NGHTTP2_HCAT_REQUEST) {
  ------------------
  |  Branch (2961:17): [True: 0, False: 0]
  ------------------
 2962|      0|              opened_stream_id = item->frame.hd.stream_id;
 2963|       |              /* We don't have to check
 2964|       |                 item->aux_data.headers.canceled since it has already
 2965|       |                 been checked. */
 2966|       |              /* Set error_code to REFUSED_STREAM so that application
 2967|       |                 can send request again. */
 2968|      0|              error_code = NGHTTP2_REFUSED_STREAM;
 2969|      0|            }
 2970|      0|            break;
 2971|      0|          case NGHTTP2_PUSH_PROMISE:
  ------------------
  |  Branch (2971:11): [True: 0, False: 0]
  ------------------
 2972|      0|            opened_stream_id = item->frame.push_promise.promised_stream_id;
 2973|      0|            break;
 2974|      0|          }
 2975|      0|          if (opened_stream_id) {
  ------------------
  |  Branch (2975:15): [True: 0, False: 0]
  ------------------
 2976|       |            /* careful not to override rv */
 2977|      0|            int rv2;
 2978|      0|            rv2 = nghttp2_session_close_stream(session, opened_stream_id,
 2979|      0|                                               error_code);
 2980|       |
 2981|      0|            if (nghttp2_is_fatal(rv2)) {
  ------------------
  |  Branch (2981:17): [True: 0, False: 0]
  ------------------
 2982|      0|              return rv2;
 2983|      0|            }
 2984|      0|          }
 2985|       |
 2986|      0|          active_outbound_item_reset(aob, mem);
 2987|       |
 2988|      0|          break;
 2989|      0|        }
 2990|  22.8k|      } else {
 2991|    803|        DEBUGF("send: next frame: DATA\n");
  ------------------
  |  |   39|    803|    do {                                                                       \
  |  |   40|    803|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 803]
  |  |  ------------------
  ------------------
 2992|       |
 2993|    803|        if (item->aux_data.data.no_copy) {
  ------------------
  |  Branch (2993:13): [True: 0, False: 803]
  ------------------
 2994|      0|          aob->state = NGHTTP2_OB_SEND_NO_COPY;
 2995|      0|          break;
 2996|      0|        }
 2997|    803|      }
 2998|       |
 2999|  23.6k|      DEBUGF("send: start transmitting frame type=%u, length=%td\n",
  ------------------
  |  |   39|  23.6k|    do {                                                                       \
  |  |   40|  23.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 23.6k]
  |  |  ------------------
  ------------------
 3000|  23.6k|             framebufs->cur->buf.pos[3],
 3001|  23.6k|             framebufs->cur->buf.last - framebufs->cur->buf.pos);
 3002|       |
 3003|  23.6k|      aob->state = NGHTTP2_OB_SEND_DATA;
 3004|       |
 3005|  23.6k|      break;
 3006|  23.6k|    }
 3007|  47.4k|    case NGHTTP2_OB_SEND_DATA: {
  ------------------
  |  Branch (3007:5): [True: 47.4k, False: 61.3k]
  ------------------
 3008|  47.4k|      size_t datalen;
 3009|  47.4k|      nghttp2_buf *buf;
 3010|       |
 3011|  47.4k|      buf = &framebufs->cur->buf;
 3012|       |
 3013|  47.4k|      if (buf->pos == buf->last) {
  ------------------
  |  Branch (3013:11): [True: 23.7k, False: 23.7k]
  ------------------
 3014|  23.7k|        DEBUGF("send: end transmission of a frame\n");
  ------------------
  |  |   39|  23.7k|    do {                                                                       \
  |  |   40|  23.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 23.7k]
  |  |  ------------------
  ------------------
 3015|       |
 3016|       |        /* Frame has completely sent */
 3017|  23.7k|        if (fast_cb) {
  ------------------
  |  Branch (3017:13): [True: 0, False: 23.7k]
  ------------------
 3018|      0|          session_after_frame_sent2(session);
 3019|  23.7k|        } else {
 3020|  23.7k|          rv = session_after_frame_sent1(session);
 3021|  23.7k|          if (rv < 0) {
  ------------------
  |  Branch (3021:15): [True: 0, False: 23.7k]
  ------------------
 3022|       |            /* FATAL */
 3023|      0|            assert(nghttp2_is_fatal(rv));
  ------------------
  |  Branch (3023:13): [True: 0, False: 0]
  |  Branch (3023:13): [True: 0, False: 0]
  ------------------
 3024|      0|            return rv;
 3025|      0|          }
 3026|  23.7k|          session_after_frame_sent2(session);
 3027|  23.7k|        }
 3028|       |        /* We have already adjusted the next state */
 3029|  23.7k|        break;
 3030|  23.7k|      }
 3031|       |
 3032|  23.7k|      *data_ptr = buf->pos;
 3033|  23.7k|      datalen = nghttp2_buf_len(buf);
  ------------------
  |  |   54|  23.7k|#define nghttp2_buf_len(BUF) ((size_t)((BUF)->last - (BUF)->pos))
  ------------------
 3034|       |
 3035|       |      /* We increment the offset here. If send_callback does not send
 3036|       |         everything, we will adjust it. */
 3037|  23.7k|      buf->pos += datalen;
 3038|       |
 3039|  23.7k|      return (nghttp2_ssize)datalen;
 3040|  47.4k|    }
 3041|      0|    case NGHTTP2_OB_SEND_NO_COPY: {
  ------------------
  |  Branch (3041:5): [True: 0, False: 108k]
  ------------------
 3042|      0|      nghttp2_stream *stream;
 3043|      0|      nghttp2_frame *frame;
 3044|      0|      int pause;
 3045|       |
 3046|      0|      DEBUGF("send: no copy DATA\n");
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3047|       |
 3048|      0|      frame = &aob->item->frame;
 3049|       |
 3050|      0|      stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
 3051|      0|      if (stream == NULL) {
  ------------------
  |  Branch (3051:11): [True: 0, False: 0]
  ------------------
 3052|      0|        DEBUGF("send: no copy DATA cancelled because stream was closed\n");
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3053|       |
 3054|      0|        active_outbound_item_reset(aob, mem);
 3055|       |
 3056|      0|        break;
 3057|      0|      }
 3058|       |
 3059|      0|      rv = session_call_send_data(session, aob->item, framebufs);
 3060|      0|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (3060:11): [True: 0, False: 0]
  ------------------
 3061|      0|        return rv;
 3062|      0|      }
 3063|       |
 3064|      0|      if (rv == NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE) {
  ------------------
  |  Branch (3064:11): [True: 0, False: 0]
  ------------------
 3065|      0|        session_detach_stream_item(session, stream);
 3066|       |
 3067|      0|        rv = nghttp2_session_add_rst_stream(session, frame->hd.stream_id,
 3068|      0|                                            NGHTTP2_INTERNAL_ERROR);
 3069|      0|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (3069:13): [True: 0, False: 0]
  ------------------
 3070|      0|          return rv;
 3071|      0|        }
 3072|       |
 3073|      0|        active_outbound_item_reset(aob, mem);
 3074|       |
 3075|      0|        break;
 3076|      0|      }
 3077|       |
 3078|      0|      if (rv == NGHTTP2_ERR_WOULDBLOCK) {
  ------------------
  |  Branch (3078:11): [True: 0, False: 0]
  ------------------
 3079|      0|        return 0;
 3080|      0|      }
 3081|       |
 3082|      0|      pause = (rv == NGHTTP2_ERR_PAUSE);
 3083|       |
 3084|      0|      rv = session_after_frame_sent1(session);
 3085|      0|      if (rv < 0) {
  ------------------
  |  Branch (3085:11): [True: 0, False: 0]
  ------------------
 3086|      0|        assert(nghttp2_is_fatal(rv));
  ------------------
  |  Branch (3086:9): [True: 0, False: 0]
  |  Branch (3086:9): [True: 0, False: 0]
  ------------------
 3087|      0|        return rv;
 3088|      0|      }
 3089|      0|      session_after_frame_sent2(session);
 3090|       |
 3091|       |      /* We have already adjusted the next state */
 3092|       |
 3093|      0|      if (pause) {
  ------------------
  |  Branch (3093:11): [True: 0, False: 0]
  ------------------
 3094|      0|        return 0;
 3095|      0|      }
 3096|       |
 3097|      0|      break;
 3098|      0|    }
 3099|  8.89k|    case NGHTTP2_OB_SEND_CLIENT_MAGIC: {
  ------------------
  |  Branch (3099:5): [True: 8.89k, False: 99.9k]
  ------------------
 3100|  8.89k|      size_t datalen;
 3101|  8.89k|      nghttp2_buf *buf;
 3102|       |
 3103|  8.89k|      buf = &framebufs->cur->buf;
 3104|       |
 3105|  8.89k|      if (buf->pos == buf->last) {
  ------------------
  |  Branch (3105:11): [True: 4.44k, False: 4.44k]
  ------------------
 3106|  4.44k|        DEBUGF("send: end transmission of client magic\n");
  ------------------
  |  |   39|  4.44k|    do {                                                                       \
  |  |   40|  4.44k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 4.44k]
  |  |  ------------------
  ------------------
 3107|  4.44k|        active_outbound_item_reset(aob, mem);
 3108|  4.44k|        break;
 3109|  4.44k|      }
 3110|       |
 3111|  4.44k|      *data_ptr = buf->pos;
 3112|  4.44k|      datalen = nghttp2_buf_len(buf);
  ------------------
  |  |   54|  4.44k|#define nghttp2_buf_len(BUF) ((size_t)((BUF)->last - (BUF)->pos))
  ------------------
 3113|       |
 3114|  4.44k|      buf->pos += datalen;
 3115|       |
 3116|  4.44k|      return (nghttp2_ssize)datalen;
 3117|  8.89k|    }
 3118|   108k|    }
 3119|   108k|  }
 3120|  45.9k|}
nghttp2_session.c:session_prep_frame:
 1961|  34.7k|                              nghttp2_outbound_item *item) {
 1962|  34.7k|  int rv;
 1963|  34.7k|  nghttp2_frame *frame;
 1964|  34.7k|  nghttp2_mem *mem;
 1965|       |
 1966|  34.7k|  mem = &session->mem;
 1967|  34.7k|  frame = &item->frame;
 1968|       |
 1969|  34.7k|  switch (frame->hd.type) {
 1970|    916|  case NGHTTP2_DATA: {
  ------------------
  |  Branch (1970:3): [True: 916, False: 33.8k]
  ------------------
 1971|    916|    size_t next_readmax;
 1972|    916|    nghttp2_stream *stream;
 1973|       |
 1974|    916|    stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
 1975|       |
 1976|    916|    if (stream) {
  ------------------
  |  Branch (1976:9): [True: 916, False: 0]
  ------------------
 1977|    916|      assert(stream->item == item);
  ------------------
  |  Branch (1977:7): [True: 0, False: 916]
  |  Branch (1977:7): [True: 916, False: 0]
  ------------------
 1978|    916|    }
 1979|       |
 1980|    916|    rv = nghttp2_session_predicate_data_send(session, stream);
 1981|    916|    if (rv != 0) {
  ------------------
  |  Branch (1981:9): [True: 5, False: 911]
  ------------------
 1982|       |      // If stream was already closed, nghttp2_session_get_stream()
 1983|       |      // returns NULL, but item is still attached to the stream.
 1984|       |      // Search stream including closed again.
 1985|      5|      stream = nghttp2_session_get_stream_raw(session, frame->hd.stream_id);
 1986|      5|      if (stream) {
  ------------------
  |  Branch (1986:11): [True: 5, False: 0]
  ------------------
 1987|      5|        session_detach_stream_item(session, stream);
 1988|      5|      }
 1989|       |
 1990|      5|      return rv;
 1991|      5|    }
 1992|       |    /* Assuming stream is not NULL */
 1993|    916|    assert(stream);
  ------------------
  |  Branch (1993:5): [True: 0, False: 911]
  |  Branch (1993:5): [True: 911, False: 0]
  ------------------
 1994|    911|    next_readmax = nghttp2_session_next_data_read(session, stream);
 1995|       |
 1996|    911|    if (next_readmax == 0) {
  ------------------
  |  Branch (1996:9): [True: 17, False: 894]
  ------------------
 1997|       |      /* This must be true since we only pop DATA frame item from
 1998|       |         queue when session->remote_window_size > 0 */
 1999|     17|      assert(session->remote_window_size > 0);
  ------------------
  |  Branch (1999:7): [True: 0, False: 17]
  |  Branch (1999:7): [True: 17, False: 0]
  ------------------
 2000|       |
 2001|     17|      session_defer_stream_item(session, stream,
 2002|     17|                                NGHTTP2_STREAM_FLAG_DEFERRED_FLOW_CONTROL);
 2003|       |
 2004|     17|      session->aob.item = NULL;
 2005|     17|      active_outbound_item_reset(&session->aob, mem);
 2006|     17|      return NGHTTP2_ERR_DEFERRED;
 2007|     17|    }
 2008|       |
 2009|    894|    rv =
 2010|    894|      nghttp2_session_pack_data(session, &session->aob.framebufs, next_readmax,
 2011|    894|                                frame, &item->aux_data.data, stream);
 2012|    894|    if (rv == NGHTTP2_ERR_PAUSE) {
  ------------------
  |  Branch (2012:9): [True: 0, False: 894]
  ------------------
 2013|      0|      return rv;
 2014|      0|    }
 2015|    894|    if (rv == NGHTTP2_ERR_DEFERRED) {
  ------------------
  |  Branch (2015:9): [True: 91, False: 803]
  ------------------
 2016|     91|      session_defer_stream_item(session, stream,
 2017|     91|                                NGHTTP2_STREAM_FLAG_DEFERRED_USER);
 2018|       |
 2019|     91|      session->aob.item = NULL;
 2020|     91|      active_outbound_item_reset(&session->aob, mem);
 2021|     91|      return NGHTTP2_ERR_DEFERRED;
 2022|     91|    }
 2023|    803|    if (rv == NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE) {
  ------------------
  |  Branch (2023:9): [True: 0, False: 803]
  ------------------
 2024|      0|      session_detach_stream_item(session, stream);
 2025|       |
 2026|      0|      rv = nghttp2_session_add_rst_stream(session, frame->hd.stream_id,
 2027|      0|                                          NGHTTP2_INTERNAL_ERROR);
 2028|      0|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (2028:11): [True: 0, False: 0]
  ------------------
 2029|      0|        return rv;
 2030|      0|      }
 2031|      0|      return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE;
 2032|      0|    }
 2033|    803|    if (rv != 0) {
  ------------------
  |  Branch (2033:9): [True: 0, False: 803]
  ------------------
 2034|      0|      session_detach_stream_item(session, stream);
 2035|       |
 2036|      0|      return rv;
 2037|      0|    }
 2038|    803|    return 0;
 2039|    803|  }
 2040|  4.40k|  case NGHTTP2_HEADERS: {
  ------------------
  |  Branch (2040:3): [True: 4.40k, False: 30.3k]
  ------------------
 2041|  4.40k|    nghttp2_headers_aux_data *aux_data;
 2042|  4.40k|    size_t estimated_payloadlen;
 2043|       |
 2044|  4.40k|    aux_data = &item->aux_data.headers;
 2045|       |
 2046|  4.40k|    if (frame->headers.cat == NGHTTP2_HCAT_REQUEST) {
  ------------------
  |  Branch (2046:9): [True: 4.40k, False: 0]
  ------------------
 2047|       |      /* initial HEADERS, which opens stream */
 2048|  4.40k|      nghttp2_stream *stream;
 2049|       |
 2050|  4.40k|      stream = nghttp2_session_open_stream(
 2051|  4.40k|        session, frame->hd.stream_id, NGHTTP2_STREAM_FLAG_NONE,
 2052|  4.40k|        NGHTTP2_STREAM_INITIAL, aux_data->stream_user_data);
 2053|       |
 2054|  4.40k|      if (stream == NULL) {
  ------------------
  |  Branch (2054:11): [True: 0, False: 4.40k]
  ------------------
 2055|      0|        return NGHTTP2_ERR_NOMEM;
 2056|      0|      }
 2057|       |
 2058|  4.40k|      rv = session_predicate_request_headers_send(session, item);
 2059|  4.40k|      if (rv != 0) {
  ------------------
  |  Branch (2059:11): [True: 0, False: 4.40k]
  ------------------
 2060|      0|        return rv;
 2061|      0|      }
 2062|       |
 2063|  4.40k|      if (session_enforce_http_messaging(session)) {
  ------------------
  |  Branch (2063:11): [True: 4.40k, False: 0]
  ------------------
 2064|  4.40k|        nghttp2_http_record_request_method(stream, frame);
 2065|  4.40k|      }
 2066|  4.40k|    } else {
 2067|      0|      nghttp2_stream *stream;
 2068|       |
 2069|      0|      stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
 2070|       |
 2071|      0|      if (stream && stream->state == NGHTTP2_STREAM_RESERVED) {
  ------------------
  |  Branch (2071:11): [True: 0, False: 0]
  |  Branch (2071:21): [True: 0, False: 0]
  ------------------
 2072|      0|        rv = session_predicate_push_response_headers_send(session, stream);
 2073|      0|        if (rv == 0) {
  ------------------
  |  Branch (2073:13): [True: 0, False: 0]
  ------------------
 2074|      0|          frame->headers.cat = NGHTTP2_HCAT_PUSH_RESPONSE;
 2075|       |
 2076|      0|          if (aux_data->stream_user_data) {
  ------------------
  |  Branch (2076:15): [True: 0, False: 0]
  ------------------
 2077|      0|            stream->stream_user_data = aux_data->stream_user_data;
 2078|      0|          }
 2079|      0|        }
 2080|      0|      } else if (session_predicate_response_headers_send(session, stream) ==
  ------------------
  |  Branch (2080:18): [True: 0, False: 0]
  ------------------
 2081|      0|                 0) {
 2082|      0|        frame->headers.cat = NGHTTP2_HCAT_RESPONSE;
 2083|      0|        rv = 0;
 2084|      0|      } else {
 2085|      0|        frame->headers.cat = NGHTTP2_HCAT_HEADERS;
 2086|       |
 2087|      0|        rv = session_predicate_headers_send(session, stream);
 2088|      0|      }
 2089|       |
 2090|      0|      if (rv != 0) {
  ------------------
  |  Branch (2090:11): [True: 0, False: 0]
  ------------------
 2091|      0|        return rv;
 2092|      0|      }
 2093|      0|    }
 2094|       |
 2095|  4.40k|    estimated_payloadlen = session_estimate_headers_payload(
 2096|  4.40k|      session, frame->headers.nva, frame->headers.nvlen,
 2097|  4.40k|      NGHTTP2_PRIORITY_SPECLEN);
  ------------------
  |  |   64|  4.40k|#define NGHTTP2_PRIORITY_SPECLEN 5
  ------------------
 2098|       |
 2099|  4.40k|    if (estimated_payloadlen > session->max_send_header_block_length) {
  ------------------
  |  Branch (2099:9): [True: 1, False: 4.40k]
  ------------------
 2100|      1|      return NGHTTP2_ERR_FRAME_SIZE_ERROR;
 2101|      1|    }
 2102|       |
 2103|  4.40k|    rv = nghttp2_frame_pack_headers(&session->aob.framebufs, &frame->headers,
 2104|  4.40k|                                    &session->hd_deflater);
 2105|       |
 2106|  4.40k|    if (rv != 0) {
  ------------------
  |  Branch (2106:9): [True: 0, False: 4.40k]
  ------------------
 2107|      0|      return rv;
 2108|      0|    }
 2109|       |
 2110|  4.40k|    DEBUGF("send: before padding, HEADERS serialized in %zu bytes\n",
  ------------------
  |  |   39|  4.40k|    do {                                                                       \
  |  |   40|  4.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 4.40k]
  |  |  ------------------
  ------------------
 2111|  4.40k|           nghttp2_bufs_len(&session->aob.framebufs));
 2112|       |
 2113|  4.40k|    rv = session_headers_add_pad(session, frame);
 2114|       |
 2115|  4.40k|    if (rv != 0) {
  ------------------
  |  Branch (2115:9): [True: 0, False: 4.40k]
  ------------------
 2116|      0|      return rv;
 2117|      0|    }
 2118|       |
 2119|  4.40k|    DEBUGF("send: HEADERS finally serialized in %zu bytes\n",
  ------------------
  |  |   39|  4.40k|    do {                                                                       \
  |  |   40|  4.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 4.40k]
  |  |  ------------------
  ------------------
 2120|  4.40k|           nghttp2_bufs_len(&session->aob.framebufs));
 2121|       |
 2122|  4.40k|    if (frame->headers.cat == NGHTTP2_HCAT_REQUEST) {
  ------------------
  |  Branch (2122:9): [True: 4.40k, False: 0]
  ------------------
 2123|  4.40k|      assert(session->last_sent_stream_id < frame->hd.stream_id);
  ------------------
  |  Branch (2123:7): [True: 0, False: 4.40k]
  |  Branch (2123:7): [True: 4.40k, False: 0]
  ------------------
 2124|  4.40k|      session->last_sent_stream_id = frame->hd.stream_id;
 2125|  4.40k|    }
 2126|       |
 2127|  4.40k|    return 0;
 2128|  4.40k|  }
 2129|      0|  case NGHTTP2_PRIORITY: {
  ------------------
  |  Branch (2129:3): [True: 0, False: 34.7k]
  ------------------
 2130|      0|    if (session_is_closing(session)) {
  ------------------
  |  Branch (2130:9): [True: 0, False: 0]
  ------------------
 2131|      0|      return NGHTTP2_ERR_SESSION_CLOSING;
 2132|      0|    }
 2133|       |    /* PRIORITY frame can be sent at any time and to any stream
 2134|       |       ID. */
 2135|      0|    nghttp2_frame_pack_priority(&session->aob.framebufs, &frame->priority);
 2136|       |
 2137|       |    /* Peer can send PRIORITY frame against idle stream to create
 2138|       |       "anchor" in dependency tree.  Only client can do this in
 2139|       |       nghttp2.  In nghttp2, only server retains non-active (closed
 2140|       |       or idle) streams in memory, so we don't open stream here. */
 2141|      0|    return 0;
 2142|      0|  }
 2143|  4.03k|  case NGHTTP2_RST_STREAM:
  ------------------
  |  Branch (2143:3): [True: 4.03k, False: 30.7k]
  ------------------
 2144|  4.03k|    if (session_is_closing(session)) {
  ------------------
  |  Branch (2144:9): [True: 2.46k, False: 1.56k]
  ------------------
 2145|  2.46k|      return NGHTTP2_ERR_SESSION_CLOSING;
 2146|  2.46k|    }
 2147|       |
 2148|  1.56k|    if (!item->aux_data.rst_stream.continue_without_stream &&
  ------------------
  |  Branch (2148:9): [True: 1.27k, False: 297]
  ------------------
 2149|  1.27k|        !nghttp2_session_get_stream(session, frame->rst_stream.hd.stream_id)) {
  ------------------
  |  Branch (2149:9): [True: 3, False: 1.26k]
  ------------------
 2150|      3|      return NGHTTP2_ERR_STREAM_CLOSED;
 2151|      3|    }
 2152|       |
 2153|  1.56k|    nghttp2_frame_pack_rst_stream(&session->aob.framebufs, &frame->rst_stream);
 2154|  1.56k|    return 0;
 2155|  8.43k|  case NGHTTP2_SETTINGS: {
  ------------------
  |  Branch (2155:3): [True: 8.43k, False: 26.3k]
  ------------------
 2156|  8.43k|    if (frame->hd.flags & NGHTTP2_FLAG_ACK) {
  ------------------
  |  Branch (2156:9): [True: 3.98k, False: 4.44k]
  ------------------
 2157|  3.98k|      assert(session->obq_flood_counter_ > 0);
  ------------------
  |  Branch (2157:7): [True: 0, False: 3.98k]
  |  Branch (2157:7): [True: 3.98k, False: 0]
  ------------------
 2158|  3.98k|      --session->obq_flood_counter_;
 2159|       |      /* When session is about to close, don't send SETTINGS ACK.
 2160|       |         We are required to send SETTINGS without ACK though; for
 2161|       |         example, we have to send SETTINGS as a part of connection
 2162|       |         preface. */
 2163|  3.98k|      if (session_is_closing(session)) {
  ------------------
  |  Branch (2163:11): [True: 2.30k, False: 1.68k]
  ------------------
 2164|  2.30k|        return NGHTTP2_ERR_SESSION_CLOSING;
 2165|  2.30k|      }
 2166|  3.98k|    }
 2167|       |
 2168|  6.13k|    rv = nghttp2_frame_pack_settings(&session->aob.framebufs, &frame->settings);
 2169|  6.13k|    if (rv != 0) {
  ------------------
  |  Branch (2169:9): [True: 0, False: 6.13k]
  ------------------
 2170|      0|      return rv;
 2171|      0|    }
 2172|  6.13k|    return 0;
 2173|  6.13k|  }
 2174|      0|  case NGHTTP2_PUSH_PROMISE: {
  ------------------
  |  Branch (2174:3): [True: 0, False: 34.7k]
  ------------------
 2175|      0|    nghttp2_stream *stream;
 2176|      0|    size_t estimated_payloadlen;
 2177|       |
 2178|       |    /* stream could be NULL if associated stream was already
 2179|       |       closed. */
 2180|      0|    stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
 2181|       |
 2182|       |    /* predicate should fail if stream is NULL. */
 2183|      0|    rv = session_predicate_push_promise_send(session, stream);
 2184|      0|    if (rv != 0) {
  ------------------
  |  Branch (2184:9): [True: 0, False: 0]
  ------------------
 2185|      0|      return rv;
 2186|      0|    }
 2187|       |
 2188|      0|    assert(stream);
  ------------------
  |  Branch (2188:5): [True: 0, False: 0]
  |  Branch (2188:5): [True: 0, False: 0]
  ------------------
 2189|       |
 2190|      0|    estimated_payloadlen = session_estimate_headers_payload(
 2191|      0|      session, frame->push_promise.nva, frame->push_promise.nvlen, 0);
 2192|       |
 2193|      0|    if (estimated_payloadlen > session->max_send_header_block_length) {
  ------------------
  |  Branch (2193:9): [True: 0, False: 0]
  ------------------
 2194|      0|      return NGHTTP2_ERR_FRAME_SIZE_ERROR;
 2195|      0|    }
 2196|       |
 2197|      0|    rv = nghttp2_frame_pack_push_promise(
 2198|      0|      &session->aob.framebufs, &frame->push_promise, &session->hd_deflater);
 2199|      0|    if (rv != 0) {
  ------------------
  |  Branch (2199:9): [True: 0, False: 0]
  ------------------
 2200|      0|      return rv;
 2201|      0|    }
 2202|      0|    rv = session_headers_add_pad(session, frame);
 2203|      0|    if (rv != 0) {
  ------------------
  |  Branch (2203:9): [True: 0, False: 0]
  ------------------
 2204|      0|      return rv;
 2205|      0|    }
 2206|       |
 2207|      0|    assert(session->last_sent_stream_id + 2 <=
  ------------------
  |  Branch (2207:5): [True: 0, False: 0]
  |  Branch (2207:5): [True: 0, False: 0]
  ------------------
 2208|      0|           frame->push_promise.promised_stream_id);
 2209|      0|    session->last_sent_stream_id = frame->push_promise.promised_stream_id;
 2210|       |
 2211|      0|    return 0;
 2212|      0|  }
 2213|     98|  case NGHTTP2_PING:
  ------------------
  |  Branch (2213:3): [True: 98, False: 34.6k]
  ------------------
 2214|     98|    if (frame->hd.flags & NGHTTP2_FLAG_ACK) {
  ------------------
  |  Branch (2214:9): [True: 98, False: 0]
  ------------------
 2215|     98|      assert(session->obq_flood_counter_ > 0);
  ------------------
  |  Branch (2215:7): [True: 0, False: 98]
  |  Branch (2215:7): [True: 98, False: 0]
  ------------------
 2216|     98|      --session->obq_flood_counter_;
 2217|     98|    }
 2218|       |    /* PING frame is allowed to be sent unless termination GOAWAY is
 2219|       |       sent */
 2220|     98|    if (session->goaway_flags & NGHTTP2_GOAWAY_TERM_ON_SEND) {
  ------------------
  |  Branch (2220:9): [True: 46, False: 52]
  ------------------
 2221|     46|      return NGHTTP2_ERR_SESSION_CLOSING;
 2222|     46|    }
 2223|     52|    nghttp2_frame_pack_ping(&session->aob.framebufs, &frame->ping);
 2224|     52|    return 0;
 2225|  3.85k|  case NGHTTP2_GOAWAY:
  ------------------
  |  Branch (2225:3): [True: 3.85k, False: 30.9k]
  ------------------
 2226|  3.85k|    rv = nghttp2_frame_pack_goaway(&session->aob.framebufs, &frame->goaway);
 2227|  3.85k|    if (rv != 0) {
  ------------------
  |  Branch (2227:9): [True: 0, False: 3.85k]
  ------------------
 2228|      0|      return rv;
 2229|      0|    }
 2230|  3.85k|    session->local_last_stream_id = frame->goaway.last_stream_id;
 2231|       |
 2232|  3.85k|    return 0;
 2233|  13.0k|  case NGHTTP2_WINDOW_UPDATE:
  ------------------
  |  Branch (2233:3): [True: 13.0k, False: 21.7k]
  ------------------
 2234|  13.0k|    rv = session_predicate_window_update_send(session, frame->hd.stream_id);
 2235|  13.0k|    if (rv != 0) {
  ------------------
  |  Branch (2235:9): [True: 6.18k, False: 6.84k]
  ------------------
 2236|  6.18k|      return rv;
 2237|  6.18k|    }
 2238|  6.84k|    nghttp2_frame_pack_window_update(&session->aob.framebufs,
 2239|  6.84k|                                     &frame->window_update);
 2240|  6.84k|    return 0;
 2241|      0|  case NGHTTP2_CONTINUATION:
  ------------------
  |  Branch (2241:3): [True: 0, False: 34.7k]
  ------------------
 2242|       |    /* We never handle CONTINUATION here. */
 2243|      0|    assert(0);
  ------------------
  |  Branch (2243:5): [Folded, False: 0]
  |  Branch (2243:5): [Folded, False: 0]
  ------------------
 2244|      0|    return 0;
 2245|      0|  default: {
  ------------------
  |  Branch (2245:3): [True: 0, False: 34.7k]
  ------------------
 2246|      0|    nghttp2_ext_aux_data *aux_data;
 2247|       |
 2248|       |    /* extension frame */
 2249|       |
 2250|      0|    aux_data = &item->aux_data.ext;
 2251|       |
 2252|      0|    if (aux_data->builtin == 0) {
  ------------------
  |  Branch (2252:9): [True: 0, False: 0]
  ------------------
 2253|      0|      if (session_is_closing(session)) {
  ------------------
  |  Branch (2253:11): [True: 0, False: 0]
  ------------------
 2254|      0|        return NGHTTP2_ERR_SESSION_CLOSING;
 2255|      0|      }
 2256|       |
 2257|      0|      return session_pack_extension(session, &session->aob.framebufs, frame);
 2258|      0|    }
 2259|       |
 2260|      0|    switch (frame->hd.type) {
 2261|      0|    case NGHTTP2_ALTSVC:
  ------------------
  |  Branch (2261:5): [True: 0, False: 0]
  ------------------
 2262|      0|      rv = session_predicate_altsvc_send(session, frame->hd.stream_id);
 2263|      0|      if (rv != 0) {
  ------------------
  |  Branch (2263:11): [True: 0, False: 0]
  ------------------
 2264|      0|        return rv;
 2265|      0|      }
 2266|       |
 2267|      0|      nghttp2_frame_pack_altsvc(&session->aob.framebufs, &frame->ext);
 2268|       |
 2269|      0|      return 0;
 2270|      0|    case NGHTTP2_ORIGIN:
  ------------------
  |  Branch (2270:5): [True: 0, False: 0]
  ------------------
 2271|      0|      rv = session_predicate_origin_send(session);
 2272|      0|      if (rv != 0) {
  ------------------
  |  Branch (2272:11): [True: 0, False: 0]
  ------------------
 2273|      0|        return rv;
 2274|      0|      }
 2275|       |
 2276|      0|      rv = nghttp2_frame_pack_origin(&session->aob.framebufs, &frame->ext);
 2277|      0|      if (rv != 0) {
  ------------------
  |  Branch (2277:11): [True: 0, False: 0]
  ------------------
 2278|      0|        return rv;
 2279|      0|      }
 2280|       |
 2281|      0|      return 0;
 2282|      0|    case NGHTTP2_PRIORITY_UPDATE: {
  ------------------
  |  Branch (2282:5): [True: 0, False: 0]
  ------------------
 2283|      0|      nghttp2_ext_priority_update *priority_update = frame->ext.payload;
 2284|      0|      rv = session_predicate_priority_update_send(session,
 2285|      0|                                                  priority_update->stream_id);
 2286|      0|      if (rv != 0) {
  ------------------
  |  Branch (2286:11): [True: 0, False: 0]
  ------------------
 2287|      0|        return rv;
 2288|      0|      }
 2289|       |
 2290|      0|      nghttp2_frame_pack_priority_update(&session->aob.framebufs, &frame->ext);
 2291|       |
 2292|      0|      return 0;
 2293|      0|    }
 2294|      0|    default:
  ------------------
  |  Branch (2294:5): [True: 0, False: 0]
  ------------------
 2295|       |      /* Unreachable here */
 2296|      0|      assert(0);
  ------------------
  |  Branch (2296:7): [Folded, False: 0]
  |  Branch (2296:7): [Folded, False: 0]
  ------------------
 2297|      0|      return 0;
 2298|      0|    }
 2299|      0|  }
 2300|  34.7k|  }
 2301|  34.7k|}
nghttp2_session.c:nghttp2_session_predicate_data_send:
 1810|  1.31k|                                               nghttp2_stream *stream) {
 1811|  1.31k|  int rv;
 1812|  1.31k|  rv = session_predicate_for_stream_send(session, stream);
 1813|  1.31k|  if (rv != 0) {
  ------------------
  |  Branch (1813:7): [True: 5, False: 1.30k]
  ------------------
 1814|      5|    return rv;
 1815|      5|  }
 1816|  1.31k|  assert(stream);
  ------------------
  |  Branch (1816:3): [True: 0, False: 1.30k]
  |  Branch (1816:3): [True: 1.30k, False: 0]
  ------------------
 1817|  1.30k|  if (nghttp2_session_is_my_stream_id(session, stream->stream_id)) {
  ------------------
  |  Branch (1817:7): [True: 1.30k, False: 0]
  ------------------
 1818|       |    /* Request body data */
 1819|       |    /* If stream->state is NGHTTP2_STREAM_CLOSING, RST_STREAM was
 1820|       |       queued but not yet sent. In this case, we won't send DATA
 1821|       |       frames. */
 1822|  1.30k|    if (stream->state == NGHTTP2_STREAM_CLOSING) {
  ------------------
  |  Branch (1822:9): [True: 0, False: 1.30k]
  ------------------
 1823|      0|      return NGHTTP2_ERR_STREAM_CLOSING;
 1824|      0|    }
 1825|  1.30k|    if (stream->state == NGHTTP2_STREAM_RESERVED) {
  ------------------
  |  Branch (1825:9): [True: 0, False: 1.30k]
  ------------------
 1826|      0|      return NGHTTP2_ERR_INVALID_STREAM_STATE;
 1827|      0|    }
 1828|  1.30k|    return 0;
 1829|  1.30k|  }
 1830|       |  /* Response body data */
 1831|      0|  if (stream->state == NGHTTP2_STREAM_OPENED) {
  ------------------
  |  Branch (1831:7): [True: 0, False: 0]
  ------------------
 1832|      0|    return 0;
 1833|      0|  }
 1834|      0|  if (stream->state == NGHTTP2_STREAM_CLOSING) {
  ------------------
  |  Branch (1834:7): [True: 0, False: 0]
  ------------------
 1835|      0|    return NGHTTP2_ERR_STREAM_CLOSING;
 1836|      0|  }
 1837|      0|  return NGHTTP2_ERR_INVALID_STREAM_STATE;
 1838|      0|}
nghttp2_session.c:session_predicate_for_stream_send:
 1425|  1.31k|                                             nghttp2_stream *stream) {
 1426|  1.31k|  if (stream == NULL) {
  ------------------
  |  Branch (1426:7): [True: 0, False: 1.31k]
  ------------------
 1427|      0|    return NGHTTP2_ERR_STREAM_CLOSED;
 1428|      0|  }
 1429|  1.31k|  if (session_is_closing(session)) {
  ------------------
  |  Branch (1429:7): [True: 5, False: 1.30k]
  ------------------
 1430|      5|    return NGHTTP2_ERR_SESSION_CLOSING;
 1431|      5|  }
 1432|  1.30k|  if (stream->shut_flags & NGHTTP2_SHUT_WR) {
  ------------------
  |  Branch (1432:7): [True: 0, False: 1.30k]
  ------------------
 1433|      0|    return NGHTTP2_ERR_STREAM_SHUT_WR;
 1434|      0|  }
 1435|  1.30k|  return 0;
 1436|  1.30k|}
nghttp2_session.c:nghttp2_session_next_data_read:
 1779|    911|                                             nghttp2_stream *stream) {
 1780|    911|  nghttp2_ssize window_size;
 1781|       |
 1782|    911|  window_size = nghttp2_session_enforce_flow_control_limits(
 1783|    911|    session, stream, NGHTTP2_DATA_PAYLOADLEN);
  ------------------
  |  |   53|    911|#define NGHTTP2_DATA_PAYLOADLEN NGHTTP2_MAX_FRAME_SIZE_MIN
  |  |  ------------------
  |  |  |  |   43|    911|#define NGHTTP2_MAX_FRAME_SIZE_MIN (1 << 14)
  |  |  ------------------
  ------------------
 1784|       |
 1785|    911|  DEBUGF("send: available window=%td\n", window_size);
  ------------------
  |  |   39|    911|    do {                                                                       \
  |  |   40|    911|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 911]
  |  |  ------------------
  ------------------
 1786|       |
 1787|    911|  return window_size > 0 ? (size_t)window_size : 0;
  ------------------
  |  Branch (1787:10): [True: 894, False: 17]
  ------------------
 1788|    911|}
nghttp2_session.c:session_defer_stream_item:
  914|    108|                                      nghttp2_stream *stream, uint8_t flags) {
  915|    108|  nghttp2_stream_defer_item(stream, flags);
  916|       |
  917|    108|  if (!stream->queued) {
  ------------------
  |  Branch (917:7): [True: 0, False: 108]
  ------------------
  918|      0|    return;
  919|      0|  }
  920|       |
  921|    108|  session_ob_data_remove(session, stream);
  922|    108|}
nghttp2_session.c:session_predicate_request_headers_send:
 1459|  4.40k|                                                  nghttp2_outbound_item *item) {
 1460|  4.40k|  if (item->aux_data.headers.canceled) {
  ------------------
  |  Branch (1460:7): [True: 0, False: 4.40k]
  ------------------
 1461|      0|    return NGHTTP2_ERR_STREAM_CLOSING;
 1462|      0|  }
 1463|       |  /* If we are terminating session (NGHTTP2_GOAWAY_TERM_ON_SEND),
 1464|       |     GOAWAY was received from peer, or session is about to close, new
 1465|       |     request is not allowed. */
 1466|  4.40k|  if ((session->goaway_flags & NGHTTP2_GOAWAY_RECV) ||
  ------------------
  |  Branch (1466:7): [True: 0, False: 4.40k]
  ------------------
 1467|  4.40k|      session_is_closing(session)) {
  ------------------
  |  Branch (1467:7): [True: 0, False: 4.40k]
  ------------------
 1468|      0|    return NGHTTP2_ERR_START_STREAM_NOT_ALLOWED;
 1469|      0|  }
 1470|  4.40k|  return 0;
 1471|  4.40k|}
nghttp2_session.c:session_estimate_headers_payload:
 1908|  4.40k|                                               size_t additional) {
 1909|  4.40k|  return nghttp2_hd_deflate_bound(&session->hd_deflater, nva, nvlen) +
 1910|  4.40k|         additional;
 1911|  4.40k|}
nghttp2_session.c:session_headers_add_pad:
 1873|  4.40k|                                   nghttp2_frame *frame) {
 1874|  4.40k|  nghttp2_ssize padded_payloadlen;
 1875|  4.40k|  nghttp2_active_outbound_item *aob;
 1876|  4.40k|  nghttp2_bufs *framebufs;
 1877|  4.40k|  size_t padlen;
 1878|  4.40k|  size_t max_payloadlen;
 1879|       |
 1880|  4.40k|  aob = &session->aob;
 1881|  4.40k|  framebufs = &aob->framebufs;
 1882|       |
 1883|  4.40k|  max_payloadlen = nghttp2_min_size(NGHTTP2_MAX_PAYLOADLEN,
  ------------------
  |  |   45|  4.40k|#define NGHTTP2_MAX_PAYLOADLEN 16384
  ------------------
 1884|  4.40k|                                    frame->hd.length + NGHTTP2_MAX_PADLEN);
  ------------------
  |  |   67|  4.40k|#define NGHTTP2_MAX_PADLEN 256
  ------------------
 1885|       |
 1886|  4.40k|  padded_payloadlen =
 1887|  4.40k|    session_call_select_padding(session, frame, max_payloadlen);
 1888|       |
 1889|  4.40k|  if (nghttp2_is_fatal((int)padded_payloadlen)) {
  ------------------
  |  Branch (1889:7): [True: 0, False: 4.40k]
  ------------------
 1890|      0|    return (int)padded_payloadlen;
 1891|      0|  }
 1892|       |
 1893|  4.40k|  padlen = (size_t)padded_payloadlen - frame->hd.length;
 1894|       |
 1895|  4.40k|  DEBUGF("send: padding selected: payloadlen=%td, padlen=%zu\n",
  ------------------
  |  |   39|  4.40k|    do {                                                                       \
  |  |   40|  4.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 4.40k]
  |  |  ------------------
  ------------------
 1896|  4.40k|         padded_payloadlen, padlen);
 1897|       |
 1898|  4.40k|  nghttp2_frame_add_pad(framebufs, &frame->hd, padlen, 0);
 1899|       |
 1900|  4.40k|  frame->headers.padlen = padlen;
 1901|       |
 1902|  4.40k|  return 0;
 1903|  4.40k|}
nghttp2_session.c:session_predicate_window_update_send:
 1679|  13.0k|                                                int32_t stream_id) {
 1680|  13.0k|  nghttp2_stream *stream;
 1681|       |
 1682|  13.0k|  if (session_is_closing(session)) {
  ------------------
  |  Branch (1682:7): [True: 5.47k, False: 7.55k]
  ------------------
 1683|  5.47k|    return NGHTTP2_ERR_SESSION_CLOSING;
 1684|  5.47k|  }
 1685|       |
 1686|  7.55k|  if (stream_id == 0) {
  ------------------
  |  Branch (1686:7): [True: 4.44k, False: 3.10k]
  ------------------
 1687|       |    /* Connection-level window update */
 1688|  4.44k|    return 0;
 1689|  4.44k|  }
 1690|  3.10k|  stream = nghttp2_session_get_stream(session, stream_id);
 1691|  3.10k|  if (stream == NULL) {
  ------------------
  |  Branch (1691:7): [True: 228, False: 2.88k]
  ------------------
 1692|    228|    return NGHTTP2_ERR_STREAM_CLOSED;
 1693|    228|  }
 1694|  2.88k|  if (stream->state == NGHTTP2_STREAM_CLOSING) {
  ------------------
  |  Branch (1694:7): [True: 480, False: 2.40k]
  ------------------
 1695|    480|    return NGHTTP2_ERR_STREAM_CLOSING;
 1696|    480|  }
 1697|  2.40k|  if (state_reserved_local(session, stream)) {
  ------------------
  |  Branch (1697:7): [True: 0, False: 2.40k]
  ------------------
 1698|      0|    return NGHTTP2_ERR_INVALID_STREAM_STATE;
 1699|      0|  }
 1700|  2.40k|  return 0;
 1701|  2.40k|}
nghttp2_session.c:state_reserved_local:
  120|  2.40k|                                nghttp2_stream *stream) {
  121|  2.40k|  return stream->state == NGHTTP2_STREAM_RESERVED &&
  ------------------
  |  Branch (121:10): [True: 0, False: 2.40k]
  ------------------
  122|      0|         nghttp2_session_is_my_stream_id(session, stream->stream_id);
  ------------------
  |  Branch (122:10): [True: 0, False: 0]
  ------------------
  123|  2.40k|}
nghttp2_session.c:session_call_before_frame_send:
 2361|  22.8k|                                          nghttp2_frame *frame) {
 2362|  22.8k|  int rv;
 2363|  22.8k|  if (session->callbacks.before_frame_send_callback) {
  ------------------
  |  Branch (2363:7): [True: 0, False: 22.8k]
  ------------------
 2364|      0|    rv = session->callbacks.before_frame_send_callback(session, frame,
 2365|      0|                                                       session->user_data);
 2366|      0|    if (rv == NGHTTP2_ERR_CANCEL) {
  ------------------
  |  Branch (2366:9): [True: 0, False: 0]
  ------------------
 2367|      0|      return rv;
 2368|      0|    }
 2369|       |
 2370|      0|    if (rv != 0) {
  ------------------
  |  Branch (2370:9): [True: 0, False: 0]
  ------------------
 2371|      0|      return NGHTTP2_ERR_CALLBACK_FAILURE;
 2372|      0|    }
 2373|      0|  }
 2374|  22.8k|  return 0;
 2375|  22.8k|}
nghttp2_session.c:session_after_frame_sent2:
 2725|  23.7k|static void session_after_frame_sent2(nghttp2_session *session) {
 2726|  23.7k|  nghttp2_active_outbound_item *aob = &session->aob;
 2727|  23.7k|  nghttp2_outbound_item *item = aob->item;
 2728|  23.7k|  nghttp2_bufs *framebufs = &aob->framebufs;
 2729|  23.7k|  nghttp2_frame *frame;
 2730|  23.7k|  nghttp2_mem *mem;
 2731|  23.7k|  nghttp2_stream *stream;
 2732|  23.7k|  nghttp2_data_aux_data *aux_data;
 2733|       |
 2734|  23.7k|  mem = &session->mem;
 2735|  23.7k|  frame = &item->frame;
 2736|       |
 2737|  23.7k|  if (frame->hd.type != NGHTTP2_DATA) {
  ------------------
  |  Branch (2737:7): [True: 22.9k, False: 803]
  ------------------
 2738|  22.9k|    if (frame->hd.type == NGHTTP2_HEADERS ||
  ------------------
  |  Branch (2738:9): [True: 4.49k, False: 18.4k]
  ------------------
 2739|  18.4k|        frame->hd.type == NGHTTP2_PUSH_PROMISE) {
  ------------------
  |  Branch (2739:9): [True: 0, False: 18.4k]
  ------------------
 2740|  4.49k|      if (nghttp2_bufs_next_present(framebufs)) {
  ------------------
  |  Branch (2740:11): [True: 88, False: 4.40k]
  ------------------
 2741|     88|        framebufs->cur = framebufs->cur->next;
 2742|       |
 2743|     88|        DEBUGF("send: next CONTINUATION frame, %zu bytes\n",
  ------------------
  |  |   39|     88|    do {                                                                       \
  |  |   40|     88|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 88]
  |  |  ------------------
  ------------------
 2744|     88|               nghttp2_buf_len(&framebufs->cur->buf));
 2745|       |
 2746|     88|        return;
 2747|     88|      }
 2748|  4.49k|    }
 2749|       |
 2750|  22.8k|    active_outbound_item_reset(&session->aob, mem);
 2751|       |
 2752|  22.8k|    return;
 2753|  22.9k|  }
 2754|       |
 2755|       |  /* DATA frame */
 2756|       |
 2757|    803|  aux_data = &item->aux_data.data;
 2758|       |
 2759|       |  /* On EOF, we have already detached data.  Please note that
 2760|       |     application may issue nghttp2_submit_data2() in
 2761|       |     on_frame_send_callback (call from session_after_frame_sent1),
 2762|       |     which attach data to stream.  We don't want to detach it. */
 2763|    803|  if (aux_data->eof) {
  ------------------
  |  Branch (2763:7): [True: 405, False: 398]
  ------------------
 2764|    405|    active_outbound_item_reset(aob, mem);
 2765|       |
 2766|    405|    return;
 2767|    405|  }
 2768|       |
 2769|       |  /* Reset no_copy here because next write may not use this. */
 2770|    398|  aux_data->no_copy = 0;
 2771|       |
 2772|    398|  stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
 2773|       |
 2774|       |  /* If session is closed or RST_STREAM was queued, we won't send
 2775|       |     further data. */
 2776|    398|  if (nghttp2_session_predicate_data_send(session, stream) != 0) {
  ------------------
  |  Branch (2776:7): [True: 0, False: 398]
  ------------------
 2777|      0|    if (stream) {
  ------------------
  |  Branch (2777:9): [True: 0, False: 0]
  ------------------
 2778|      0|      session_detach_stream_item(session, stream);
 2779|      0|    }
 2780|       |
 2781|      0|    active_outbound_item_reset(aob, mem);
 2782|       |
 2783|      0|    return;
 2784|      0|  }
 2785|       |
 2786|    398|  aob->item = NULL;
 2787|    398|  active_outbound_item_reset(&session->aob, mem);
 2788|       |
 2789|    398|  return;
 2790|    398|}
nghttp2_session.c:session_after_frame_sent1:
 2495|  23.7k|static int session_after_frame_sent1(nghttp2_session *session) {
 2496|  23.7k|  int rv;
 2497|  23.7k|  nghttp2_active_outbound_item *aob = &session->aob;
 2498|  23.7k|  nghttp2_outbound_item *item = aob->item;
 2499|  23.7k|  nghttp2_bufs *framebufs = &aob->framebufs;
 2500|  23.7k|  nghttp2_frame *frame;
 2501|  23.7k|  nghttp2_stream *stream;
 2502|       |
 2503|  23.7k|  frame = &item->frame;
 2504|       |
 2505|  23.7k|  if (frame->hd.type == NGHTTP2_DATA) {
  ------------------
  |  Branch (2505:7): [True: 803, False: 22.9k]
  ------------------
 2506|    803|    nghttp2_data_aux_data *aux_data;
 2507|       |
 2508|    803|    aux_data = &item->aux_data.data;
 2509|       |
 2510|    803|    stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
 2511|       |    /* We update flow control window after a frame was completely
 2512|       |       sent. This is possible because we choose payload length not to
 2513|       |       exceed the window */
 2514|    803|    session->remote_window_size -= (int32_t)frame->hd.length;
 2515|    803|    if (stream) {
  ------------------
  |  Branch (2515:9): [True: 803, False: 0]
  ------------------
 2516|    803|      stream->remote_window_size -= (int32_t)frame->hd.length;
 2517|    803|    }
 2518|       |
 2519|    803|    if (stream && aux_data->eof) {
  ------------------
  |  Branch (2519:9): [True: 803, False: 0]
  |  Branch (2519:19): [True: 405, False: 398]
  ------------------
 2520|    405|      session_detach_stream_item(session, stream);
 2521|       |
 2522|       |      /* Call on_frame_send_callback after
 2523|       |         nghttp2_stream_detach_item(), so that application can issue
 2524|       |         nghttp2_submit_data2() in the callback. */
 2525|    405|      if (session->callbacks.on_frame_send_callback) {
  ------------------
  |  Branch (2525:11): [True: 405, False: 0]
  ------------------
 2526|    405|        rv = session_call_on_frame_send(session, frame);
 2527|    405|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (2527:13): [True: 0, False: 405]
  ------------------
 2528|      0|          return rv;
 2529|      0|        }
 2530|    405|      }
 2531|       |
 2532|    405|      if (frame->hd.flags & NGHTTP2_FLAG_END_STREAM) {
  ------------------
  |  Branch (2532:11): [True: 405, False: 0]
  ------------------
 2533|    405|        int stream_closed;
 2534|       |
 2535|    405|        stream_closed =
 2536|    405|          (stream->shut_flags & NGHTTP2_SHUT_RDWR) == NGHTTP2_SHUT_RDWR;
 2537|       |
 2538|    405|        nghttp2_stream_shutdown(stream, NGHTTP2_SHUT_WR);
 2539|       |
 2540|    405|        rv = nghttp2_session_close_stream_if_shut_rdwr(session, stream);
 2541|    405|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (2541:13): [True: 0, False: 405]
  ------------------
 2542|      0|          return rv;
 2543|      0|        }
 2544|       |        /* stream may be NULL if it was closed */
 2545|    405|        if (stream_closed) {
  ------------------
  |  Branch (2545:13): [True: 0, False: 405]
  ------------------
 2546|      0|          stream = NULL;
 2547|      0|        }
 2548|    405|      }
 2549|    405|      return 0;
 2550|    405|    }
 2551|       |
 2552|    398|    if (session->callbacks.on_frame_send_callback) {
  ------------------
  |  Branch (2552:9): [True: 398, False: 0]
  ------------------
 2553|    398|      rv = session_call_on_frame_send(session, frame);
 2554|    398|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (2554:11): [True: 0, False: 398]
  ------------------
 2555|      0|        return rv;
 2556|      0|      }
 2557|    398|    }
 2558|       |
 2559|    398|    return 0;
 2560|    398|  }
 2561|       |
 2562|       |  /* non-DATA frame */
 2563|       |
 2564|  22.9k|  if (frame->hd.type == NGHTTP2_HEADERS ||
  ------------------
  |  Branch (2564:7): [True: 4.49k, False: 18.4k]
  ------------------
 2565|  18.4k|      frame->hd.type == NGHTTP2_PUSH_PROMISE) {
  ------------------
  |  Branch (2565:7): [True: 0, False: 18.4k]
  ------------------
 2566|  4.49k|    if (nghttp2_bufs_next_present(framebufs)) {
  ------------------
  |  Branch (2566:9): [True: 88, False: 4.40k]
  ------------------
 2567|     88|      DEBUGF("send: CONTINUATION exists, just return\n");
  ------------------
  |  |   39|     88|    do {                                                                       \
  |  |   40|     88|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 88]
  |  |  ------------------
  ------------------
 2568|     88|      return 0;
 2569|     88|    }
 2570|  4.49k|  }
 2571|  22.8k|  rv = session_call_on_frame_send(session, frame);
 2572|  22.8k|  if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (2572:7): [True: 0, False: 22.8k]
  ------------------
 2573|      0|    return rv;
 2574|      0|  }
 2575|  22.8k|  switch (frame->hd.type) {
 2576|  4.40k|  case NGHTTP2_HEADERS: {
  ------------------
  |  Branch (2576:3): [True: 4.40k, False: 18.4k]
  ------------------
 2577|  4.40k|    nghttp2_headers_aux_data *aux_data;
 2578|       |
 2579|  4.40k|    stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
 2580|  4.40k|    if (!stream) {
  ------------------
  |  Branch (2580:9): [True: 0, False: 4.40k]
  ------------------
 2581|      0|      return 0;
 2582|      0|    }
 2583|       |
 2584|  4.40k|    switch (frame->headers.cat) {
 2585|  4.40k|    case NGHTTP2_HCAT_REQUEST: {
  ------------------
  |  Branch (2585:5): [True: 4.40k, False: 0]
  ------------------
 2586|  4.40k|      stream->state = NGHTTP2_STREAM_OPENING;
 2587|  4.40k|      if (frame->hd.flags & NGHTTP2_FLAG_END_STREAM) {
  ------------------
  |  Branch (2587:11): [True: 3.91k, False: 487]
  ------------------
 2588|  3.91k|        nghttp2_stream_shutdown(stream, NGHTTP2_SHUT_WR);
 2589|  3.91k|      }
 2590|  4.40k|      rv = nghttp2_session_close_stream_if_shut_rdwr(session, stream);
 2591|  4.40k|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (2591:11): [True: 0, False: 4.40k]
  ------------------
 2592|      0|        return rv;
 2593|      0|      }
 2594|       |      /* We assume aux_data is a pointer to nghttp2_headers_aux_data */
 2595|  4.40k|      aux_data = &item->aux_data.headers;
 2596|  4.40k|      if (nghttp2_data_provider_wrap_contains_read_callback(&aux_data->dpw)) {
  ------------------
  |  Branch (2596:11): [True: 487, False: 3.91k]
  ------------------
 2597|       |        /* nghttp2_submit_data_shared() makes a copy of
 2598|       |           aux_data->dpw */
 2599|    487|        rv = nghttp2_submit_data_shared(session, NGHTTP2_FLAG_END_STREAM,
 2600|    487|                                        frame->hd.stream_id, &aux_data->dpw);
 2601|    487|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (2601:13): [True: 0, False: 487]
  ------------------
 2602|      0|          return rv;
 2603|      0|        }
 2604|       |        /* TODO nghttp2_submit_data_shared() may fail if stream has
 2605|       |           already DATA frame item.  We might have to handle it
 2606|       |           here. */
 2607|    487|      }
 2608|  4.40k|      return 0;
 2609|  4.40k|    }
 2610|      0|    case NGHTTP2_HCAT_PUSH_RESPONSE:
  ------------------
  |  Branch (2610:5): [True: 0, False: 4.40k]
  ------------------
 2611|      0|      stream->flags = (uint8_t)(stream->flags & ~NGHTTP2_STREAM_FLAG_PUSH);
 2612|      0|      ++session->num_outgoing_streams;
 2613|       |    /* Fall through */
 2614|      0|    case NGHTTP2_HCAT_RESPONSE:
  ------------------
  |  Branch (2614:5): [True: 0, False: 4.40k]
  ------------------
 2615|      0|      stream->state = NGHTTP2_STREAM_OPENED;
 2616|       |    /* Fall through */
 2617|      0|    case NGHTTP2_HCAT_HEADERS:
  ------------------
  |  Branch (2617:5): [True: 0, False: 4.40k]
  ------------------
 2618|      0|      if (frame->hd.flags & NGHTTP2_FLAG_END_STREAM) {
  ------------------
  |  Branch (2618:11): [True: 0, False: 0]
  ------------------
 2619|      0|        nghttp2_stream_shutdown(stream, NGHTTP2_SHUT_WR);
 2620|      0|      }
 2621|      0|      rv = nghttp2_session_close_stream_if_shut_rdwr(session, stream);
 2622|      0|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (2622:11): [True: 0, False: 0]
  ------------------
 2623|      0|        return rv;
 2624|      0|      }
 2625|       |      /* We assume aux_data is a pointer to nghttp2_headers_aux_data */
 2626|      0|      aux_data = &item->aux_data.headers;
 2627|      0|      if (nghttp2_data_provider_wrap_contains_read_callback(&aux_data->dpw)) {
  ------------------
  |  Branch (2627:11): [True: 0, False: 0]
  ------------------
 2628|      0|        rv = nghttp2_submit_data_shared(session, NGHTTP2_FLAG_END_STREAM,
 2629|      0|                                        frame->hd.stream_id, &aux_data->dpw);
 2630|      0|        if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (2630:13): [True: 0, False: 0]
  ------------------
 2631|      0|          return rv;
 2632|      0|        }
 2633|       |        /* TODO nghttp2_submit_data_shared() may fail if stream has
 2634|       |           already DATA frame item.  We might have to handle it
 2635|       |           here. */
 2636|      0|      }
 2637|      0|      return 0;
 2638|      0|    default:
  ------------------
  |  Branch (2638:5): [True: 0, False: 4.40k]
  ------------------
 2639|       |      /* Unreachable */
 2640|      0|      assert(0);
  ------------------
  |  Branch (2640:7): [Folded, False: 0]
  |  Branch (2640:7): [Folded, False: 0]
  ------------------
 2641|      0|      return 0;
 2642|  4.40k|    }
 2643|  4.40k|  }
 2644|      0|  case NGHTTP2_PRIORITY:
  ------------------
  |  Branch (2644:3): [True: 0, False: 22.8k]
  ------------------
 2645|      0|    return 0;
 2646|  1.56k|  case NGHTTP2_RST_STREAM:
  ------------------
  |  Branch (2646:3): [True: 1.56k, False: 21.2k]
  ------------------
 2647|  1.56k|    rv = nghttp2_session_close_stream(session, frame->hd.stream_id,
 2648|  1.56k|                                      frame->rst_stream.error_code);
 2649|  1.56k|    if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (2649:9): [True: 0, False: 1.56k]
  ------------------
 2650|      0|      return rv;
 2651|      0|    }
 2652|  1.56k|    return 0;
 2653|  3.85k|  case NGHTTP2_GOAWAY: {
  ------------------
  |  Branch (2653:3): [True: 3.85k, False: 18.9k]
  ------------------
 2654|  3.85k|    nghttp2_goaway_aux_data *aux_data;
 2655|       |
 2656|  3.85k|    aux_data = &item->aux_data.goaway;
 2657|       |
 2658|  3.85k|    if ((aux_data->flags & NGHTTP2_GOAWAY_AUX_SHUTDOWN_NOTICE) == 0) {
  ------------------
  |  Branch (2658:9): [True: 3.85k, False: 0]
  ------------------
 2659|  3.85k|      if (aux_data->flags & NGHTTP2_GOAWAY_AUX_TERM_ON_SEND) {
  ------------------
  |  Branch (2659:11): [True: 2.73k, False: 1.12k]
  ------------------
 2660|  2.73k|        session->goaway_flags |= NGHTTP2_GOAWAY_TERM_SENT;
 2661|  2.73k|      }
 2662|       |
 2663|  3.85k|      session->goaway_flags |= NGHTTP2_GOAWAY_SENT;
 2664|       |
 2665|  3.85k|      rv = session_close_stream_on_goaway(session, frame->goaway.last_stream_id,
 2666|  3.85k|                                          1);
 2667|       |
 2668|  3.85k|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (2668:11): [True: 0, False: 3.85k]
  ------------------
 2669|      0|        return rv;
 2670|      0|      }
 2671|  3.85k|    }
 2672|       |
 2673|  3.85k|    return 0;
 2674|  3.85k|  }
 2675|  6.84k|  case NGHTTP2_WINDOW_UPDATE:
  ------------------
  |  Branch (2675:3): [True: 6.84k, False: 16.0k]
  ------------------
 2676|  6.84k|    if (frame->hd.stream_id == 0) {
  ------------------
  |  Branch (2676:9): [True: 4.44k, False: 2.40k]
  ------------------
 2677|  4.44k|      session->window_update_queued = 0;
 2678|  4.44k|      if (session->opt_flags & NGHTTP2_OPTMASK_NO_AUTO_WINDOW_UPDATE) {
  ------------------
  |  Branch (2678:11): [True: 4.44k, False: 0]
  ------------------
 2679|  4.44k|        rv = session_update_connection_consumed_size(session, 0);
 2680|  4.44k|      } else {
 2681|      0|        rv = nghttp2_session_update_recv_connection_window_size(session, 0);
 2682|      0|      }
 2683|       |
 2684|  4.44k|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (2684:11): [True: 0, False: 4.44k]
  ------------------
 2685|      0|        return rv;
 2686|      0|      }
 2687|       |
 2688|  4.44k|      return 0;
 2689|  4.44k|    }
 2690|       |
 2691|  2.40k|    stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
 2692|  2.40k|    if (!stream) {
  ------------------
  |  Branch (2692:9): [True: 0, False: 2.40k]
  ------------------
 2693|      0|      return 0;
 2694|      0|    }
 2695|       |
 2696|  2.40k|    stream->window_update_queued = 0;
 2697|       |
 2698|       |    /* We don't have to send WINDOW_UPDATE if END_STREAM from peer
 2699|       |       is seen. */
 2700|  2.40k|    if (stream->shut_flags & NGHTTP2_SHUT_RD) {
  ------------------
  |  Branch (2700:9): [True: 6, False: 2.39k]
  ------------------
 2701|      6|      return 0;
 2702|      6|    }
 2703|       |
 2704|  2.39k|    if (session->opt_flags & NGHTTP2_OPTMASK_NO_AUTO_WINDOW_UPDATE) {
  ------------------
  |  Branch (2704:9): [True: 2.39k, False: 0]
  ------------------
 2705|  2.39k|      rv = session_update_stream_consumed_size(session, stream, 0);
 2706|  2.39k|    } else {
 2707|      0|      rv =
 2708|      0|        nghttp2_session_update_recv_stream_window_size(session, stream, 0, 1);
 2709|      0|    }
 2710|       |
 2711|  2.39k|    if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (2711:9): [True: 0, False: 2.39k]
  ------------------
 2712|      0|      return rv;
 2713|      0|    }
 2714|       |
 2715|  2.39k|    return 0;
 2716|  6.18k|  default:
  ------------------
  |  Branch (2716:3): [True: 6.18k, False: 16.6k]
  ------------------
 2717|  6.18k|    return 0;
 2718|  22.8k|  }
 2719|  22.8k|}
nghttp2_session.c:session_call_on_frame_send:
 2378|  23.6k|                                      nghttp2_frame *frame) {
 2379|  23.6k|  int rv;
 2380|  23.6k|  if (session->callbacks.on_frame_send_callback) {
  ------------------
  |  Branch (2380:7): [True: 23.6k, False: 0]
  ------------------
 2381|  23.6k|    rv = session->callbacks.on_frame_send_callback(session, frame,
 2382|  23.6k|                                                   session->user_data);
 2383|  23.6k|    if (rv != 0) {
  ------------------
  |  Branch (2383:9): [True: 0, False: 23.6k]
  ------------------
 2384|      0|      return NGHTTP2_ERR_CALLBACK_FAILURE;
 2385|      0|    }
 2386|  23.6k|  }
 2387|  23.6k|  return 0;
 2388|  23.6k|}
nghttp2_session.c:session_inflate_handle_invalid_connection:
 3480|    139|                                                     const char *reason) {
 3481|    139|  int rv;
 3482|    139|  rv =
 3483|    139|    session_handle_invalid_connection(session, frame, lib_error_code, reason);
 3484|    139|  if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (3484:7): [True: 125, False: 14]
  ------------------
 3485|    125|    return rv;
 3486|    125|  }
 3487|     14|  return NGHTTP2_ERR_IGN_HEADER_BLOCK;
 3488|    139|}
nghttp2_session.c:session_detect_idle_stream:
  137|  1.73k|                                      int32_t stream_id) {
  138|       |  /* Assume that stream object with stream_id does not exist */
  139|  1.73k|  if (nghttp2_session_is_my_stream_id(session, stream_id)) {
  ------------------
  |  Branch (139:7): [True: 1.34k, False: 392]
  ------------------
  140|  1.34k|    if (session->last_sent_stream_id < stream_id) {
  ------------------
  |  Branch (140:9): [True: 136, False: 1.20k]
  ------------------
  141|    136|      return 1;
  142|    136|    }
  143|  1.20k|    return 0;
  144|  1.34k|  }
  145|    392|  if (session_is_new_peer_stream_id(session, stream_id)) {
  ------------------
  |  Branch (145:7): [True: 149, False: 243]
  ------------------
  146|    149|    return 1;
  147|    149|  }
  148|    243|  return 0;
  149|    392|}
nghttp2_session.c:session_is_new_peer_stream_id:
  130|    593|                                         int32_t stream_id) {
  131|    593|  return stream_id != 0 &&
  ------------------
  |  Branch (131:10): [True: 592, False: 1]
  ------------------
  132|    592|         !nghttp2_session_is_my_stream_id(session, stream_id) &&
  ------------------
  |  Branch (132:10): [True: 584, False: 8]
  ------------------
  133|    584|         session->last_recv_stream_id < stream_id;
  ------------------
  |  Branch (133:10): [True: 324, False: 260]
  ------------------
  134|    593|}
nghttp2_session.c:session_allow_incoming_new_stream:
 1398|    201|static int session_allow_incoming_new_stream(nghttp2_session *session) {
 1399|    201|  return (session->goaway_flags &
 1400|    201|          (NGHTTP2_GOAWAY_TERM_ON_SEND | NGHTTP2_GOAWAY_SENT)) == 0;
 1401|    201|}
nghttp2_session.c:session_call_on_begin_headers:
 3239|  1.81k|                                         nghttp2_frame *frame) {
 3240|  1.81k|  int rv;
 3241|  1.81k|  DEBUGF("recv: call on_begin_headers callback stream_id=%d\n",
  ------------------
  |  |   39|  1.81k|    do {                                                                       \
  |  |   40|  1.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 1.81k]
  |  |  ------------------
  ------------------
 3242|  1.81k|         frame->hd.stream_id);
 3243|  1.81k|  if (session->callbacks.on_begin_headers_callback) {
  ------------------
  |  Branch (3243:7): [True: 1.81k, False: 0]
  ------------------
 3244|  1.81k|    rv = session->callbacks.on_begin_headers_callback(session, frame,
 3245|  1.81k|                                                      session->user_data);
 3246|  1.81k|    if (rv == NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE) {
  ------------------
  |  Branch (3246:9): [True: 0, False: 1.81k]
  ------------------
 3247|      0|      return rv;
 3248|      0|    }
 3249|  1.81k|    if (rv != 0) {
  ------------------
  |  Branch (3249:9): [True: 0, False: 1.81k]
  ------------------
 3250|      0|      return NGHTTP2_ERR_CALLBACK_FAILURE;
 3251|      0|    }
 3252|  1.81k|  }
 3253|  1.81k|  return 0;
 3254|  1.81k|}
nghttp2_session.c:session_handle_invalid_connection:
 3466|    567|                                             const char *reason) {
 3467|    567|  if (session->callbacks.on_invalid_frame_recv_callback) {
  ------------------
  |  Branch (3467:7): [True: 567, False: 0]
  ------------------
 3468|    567|    if (session->callbacks.on_invalid_frame_recv_callback(
  ------------------
  |  Branch (3468:9): [True: 538, False: 29]
  ------------------
 3469|    567|          session, frame, lib_error_code, session->user_data) != 0) {
 3470|    538|      return NGHTTP2_ERR_CALLBACK_FAILURE;
 3471|    538|    }
 3472|    567|  }
 3473|     29|  return nghttp2_session_terminate_session_with_reason(
 3474|     29|    session, get_error_code_from_lib_error_code(lib_error_code), reason);
 3475|    567|}
nghttp2_session.c:get_error_code_from_lib_error_code:
 3362|  1.33k|static uint32_t get_error_code_from_lib_error_code(int lib_error_code) {
 3363|  1.33k|  switch (lib_error_code) {
 3364|      2|  case NGHTTP2_ERR_STREAM_CLOSED:
  ------------------
  |  Branch (3364:3): [True: 2, False: 1.33k]
  ------------------
 3365|      2|    return NGHTTP2_STREAM_CLOSED;
 3366|      0|  case NGHTTP2_ERR_HEADER_COMP:
  ------------------
  |  Branch (3366:3): [True: 0, False: 1.33k]
  ------------------
 3367|      0|    return NGHTTP2_COMPRESSION_ERROR;
 3368|      0|  case NGHTTP2_ERR_FRAME_SIZE_ERROR:
  ------------------
  |  Branch (3368:3): [True: 0, False: 1.33k]
  ------------------
 3369|      0|    return NGHTTP2_FRAME_SIZE_ERROR;
 3370|      1|  case NGHTTP2_ERR_FLOW_CONTROL:
  ------------------
  |  Branch (3370:3): [True: 1, False: 1.33k]
  ------------------
 3371|      1|    return NGHTTP2_FLOW_CONTROL_ERROR;
 3372|      0|  case NGHTTP2_ERR_REFUSED_STREAM:
  ------------------
  |  Branch (3372:3): [True: 0, False: 1.33k]
  ------------------
 3373|      0|    return NGHTTP2_REFUSED_STREAM;
 3374|     36|  case NGHTTP2_ERR_PROTO:
  ------------------
  |  Branch (3374:3): [True: 36, False: 1.29k]
  ------------------
 3375|    600|  case NGHTTP2_ERR_HTTP_HEADER:
  ------------------
  |  Branch (3375:3): [True: 564, False: 768]
  ------------------
 3376|    610|  case NGHTTP2_ERR_HTTP_MESSAGING:
  ------------------
  |  Branch (3376:3): [True: 10, False: 1.32k]
  ------------------
 3377|    610|    return NGHTTP2_PROTOCOL_ERROR;
 3378|    564|  case NGHTTP2_ERR_INTERNAL:
  ------------------
  |  Branch (3378:3): [True: 564, False: 768]
  ------------------
 3379|    564|    return NGHTTP2_INTERNAL_ERROR;
 3380|    155|  case NGHTTP2_ERR_PUSH_CANCEL:
  ------------------
  |  Branch (3380:3): [True: 155, False: 1.17k]
  ------------------
 3381|    155|    return NGHTTP2_CANCEL;
 3382|      0|  default:
  ------------------
  |  Branch (3382:3): [True: 0, False: 1.33k]
  ------------------
 3383|      0|    return NGHTTP2_INTERNAL_ERROR;
 3384|  1.33k|  }
 3385|  1.33k|}
nghttp2_session.c:session_call_on_frame_received:
 3226|  5.51k|                                          nghttp2_frame *frame) {
 3227|  5.51k|  int rv;
 3228|  5.51k|  if (session->callbacks.on_frame_recv_callback) {
  ------------------
  |  Branch (3228:7): [True: 5.51k, False: 0]
  ------------------
 3229|  5.51k|    rv = session->callbacks.on_frame_recv_callback(session, frame,
 3230|  5.51k|                                                   session->user_data);
 3231|  5.51k|    if (rv != 0) {
  ------------------
  |  Branch (3231:9): [True: 0, False: 5.51k]
  ------------------
 3232|      0|      return NGHTTP2_ERR_CALLBACK_FAILURE;
 3233|      0|    }
 3234|  5.51k|  }
 3235|  5.51k|  return 0;
 3236|  5.51k|}
nghttp2_session.c:session_update_stream_reset_ratelim:
 4077|    244|static int session_update_stream_reset_ratelim(nghttp2_session *session) {
 4078|    244|  if (!session->server || (session->goaway_flags & NGHTTP2_GOAWAY_SUBMITTED)) {
  ------------------
  |  Branch (4078:7): [True: 244, False: 0]
  |  Branch (4078:27): [True: 0, False: 0]
  ------------------
 4079|    244|    return 0;
 4080|    244|  }
 4081|       |
 4082|      0|  nghttp2_ratelim_update(&session->stream_reset_ratelim,
 4083|      0|                         nghttp2_time_now_sec());
 4084|       |
 4085|      0|  if (nghttp2_ratelim_drain(&session->stream_reset_ratelim, 1) == 0) {
  ------------------
  |  Branch (4085:7): [True: 0, False: 0]
  ------------------
 4086|      0|    return 0;
 4087|      0|  }
 4088|       |
 4089|      0|  return nghttp2_session_add_goaway(session, session->last_recv_stream_id,
 4090|       |                                    NGHTTP2_INTERNAL_ERROR, NULL, 0,
 4091|      0|                                    NGHTTP2_GOAWAY_AUX_NONE);
 4092|      0|}
nghttp2_session.c:session_update_local_initial_window_size:
 4238|     47|                                         int32_t old_initial_window_size) {
 4239|     47|  nghttp2_update_window_size_arg arg;
 4240|     47|  arg.session = session;
 4241|     47|  arg.new_window_size = new_initial_window_size;
 4242|     47|  arg.old_window_size = old_initial_window_size;
 4243|     47|  return nghttp2_map_each(&session->streams,
 4244|     47|                          update_local_initial_window_size_func, &arg);
 4245|     47|}
nghttp2_session.c:update_local_initial_window_size_func:
 4189|     44|static int update_local_initial_window_size_func(void *entry, void *ptr) {
 4190|     44|  int rv;
 4191|     44|  nghttp2_update_window_size_arg *arg;
 4192|     44|  nghttp2_stream *stream;
 4193|     44|  arg = (nghttp2_update_window_size_arg *)ptr;
 4194|     44|  stream = (nghttp2_stream *)entry;
 4195|     44|  rv = nghttp2_stream_update_local_initial_window_size(
 4196|     44|    stream, arg->new_window_size, arg->old_window_size);
 4197|     44|  if (rv != 0) {
  ------------------
  |  Branch (4197:7): [True: 0, False: 44]
  ------------------
 4198|      0|    return NGHTTP2_ERR_FLOW_CONTROL;
 4199|      0|  }
 4200|       |
 4201|     44|  if (stream->window_update_queued) {
  ------------------
  |  Branch (4201:7): [True: 24, False: 20]
  ------------------
 4202|     24|    return 0;
 4203|     24|  }
 4204|       |
 4205|     20|  if (arg->session->opt_flags & NGHTTP2_OPTMASK_NO_AUTO_WINDOW_UPDATE) {
  ------------------
  |  Branch (4205:7): [True: 20, False: 0]
  ------------------
 4206|     20|    return session_update_stream_consumed_size(arg->session, stream, 0);
 4207|     20|  }
 4208|       |
 4209|      0|  if (nghttp2_should_send_window_update(stream->local_window_size,
  ------------------
  |  Branch (4209:7): [True: 0, False: 0]
  ------------------
 4210|      0|                                        stream->recv_window_size)) {
 4211|      0|    rv = nghttp2_session_add_window_update(arg->session, NGHTTP2_FLAG_NONE,
 4212|      0|                                           stream->stream_id,
 4213|      0|                                           stream->recv_window_size);
 4214|      0|    if (rv != 0) {
  ------------------
  |  Branch (4214:9): [True: 0, False: 0]
  ------------------
 4215|      0|      return rv;
 4216|      0|    }
 4217|       |
 4218|      0|    stream->recv_window_size = 0;
 4219|      0|  }
 4220|      0|  return 0;
 4221|      0|}
nghttp2_session.c:session_update_remote_initial_window_size:
 4178|    369|                                          int32_t new_initial_window_size) {
 4179|    369|  nghttp2_update_window_size_arg arg;
 4180|       |
 4181|    369|  arg.session = session;
 4182|    369|  arg.new_window_size = new_initial_window_size;
 4183|    369|  arg.old_window_size = (int32_t)session->remote_settings.initial_window_size;
 4184|       |
 4185|    369|  return nghttp2_map_each(&session->streams,
 4186|    369|                          update_remote_initial_window_size_func, &arg);
 4187|    369|}
nghttp2_session.c:update_remote_initial_window_size_func:
 4136|    368|static int update_remote_initial_window_size_func(void *entry, void *ptr) {
 4137|    368|  int rv;
 4138|    368|  nghttp2_update_window_size_arg *arg;
 4139|    368|  nghttp2_stream *stream;
 4140|       |
 4141|    368|  arg = (nghttp2_update_window_size_arg *)ptr;
 4142|    368|  stream = (nghttp2_stream *)entry;
 4143|       |
 4144|    368|  rv = nghttp2_stream_update_remote_initial_window_size(
 4145|    368|    stream, arg->new_window_size, arg->old_window_size);
 4146|    368|  if (rv != 0) {
  ------------------
  |  Branch (4146:7): [True: 0, False: 368]
  ------------------
 4147|      0|    return NGHTTP2_ERR_FLOW_CONTROL;
 4148|      0|  }
 4149|       |
 4150|       |  /* If window size gets positive, push deferred DATA frame to
 4151|       |     outbound queue. */
 4152|    368|  if (stream->remote_window_size > 0 &&
  ------------------
  |  Branch (4152:7): [True: 302, False: 66]
  ------------------
 4153|    302|      nghttp2_stream_check_deferred_by_flow_control(stream)) {
  ------------------
  |  Branch (4153:7): [True: 0, False: 302]
  ------------------
 4154|      0|    rv = session_resume_deferred_stream_item(
 4155|      0|      arg->session, stream, NGHTTP2_STREAM_FLAG_DEFERRED_FLOW_CONTROL);
 4156|       |
 4157|      0|    if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (4157:9): [True: 0, False: 0]
  ------------------
 4158|      0|      return rv;
 4159|      0|    }
 4160|      0|  }
 4161|    368|  return 0;
 4162|    368|}
nghttp2_session.c:session_handle_invalid_stream2:
 3425|  1.30k|                                          int lib_error_code) {
 3426|  1.30k|  int rv;
 3427|       |
 3428|  1.30k|  rv = nghttp2_session_add_rst_stream(
 3429|  1.30k|    session, stream_id, get_error_code_from_lib_error_code(lib_error_code));
 3430|  1.30k|  if (rv != 0) {
  ------------------
  |  Branch (3430:7): [True: 0, False: 1.30k]
  ------------------
 3431|      0|    return rv;
 3432|      0|  }
 3433|  1.30k|  if (frame && session->callbacks.on_invalid_frame_recv_callback) {
  ------------------
  |  Branch (3433:7): [True: 584, False: 719]
  |  Branch (3433:16): [True: 584, False: 0]
  ------------------
 3434|    584|    if (session->callbacks.on_invalid_frame_recv_callback(
  ------------------
  |  Branch (3434:9): [True: 0, False: 584]
  ------------------
 3435|    584|          session, frame, lib_error_code, session->user_data) != 0) {
 3436|      0|      return NGHTTP2_ERR_CALLBACK_FAILURE;
 3437|      0|    }
 3438|    584|  }
 3439|  1.30k|  return 0;
 3440|  1.30k|}
nghttp2_session.c:session_close_stream_on_goaway:
 2429|  4.32k|                                          int incoming) {
 2430|  4.32k|  int rv;
 2431|  4.32k|  nghttp2_stream *stream, *next_stream;
 2432|  4.32k|  nghttp2_close_stream_on_goaway_arg arg = {session, NULL, last_stream_id,
 2433|  4.32k|                                            incoming};
 2434|       |
 2435|  4.32k|  rv = nghttp2_map_each(&session->streams, find_stream_on_goaway_func, &arg);
 2436|  4.32k|  assert(rv == 0);
  ------------------
  |  Branch (2436:3): [True: 0, False: 4.32k]
  |  Branch (2436:3): [True: 4.32k, False: 0]
  ------------------
 2437|       |
 2438|  4.32k|  stream = arg.head;
 2439|  4.64k|  while (stream) {
  ------------------
  |  Branch (2439:10): [True: 325, False: 4.32k]
  ------------------
 2440|    325|    next_stream = stream->closed_next;
 2441|    325|    stream->closed_next = NULL;
 2442|    325|    rv = nghttp2_session_close_stream(session, stream->stream_id,
 2443|    325|                                      NGHTTP2_REFUSED_STREAM);
 2444|       |
 2445|       |    /* stream may be deleted here */
 2446|       |
 2447|    325|    stream = next_stream;
 2448|       |
 2449|    325|    if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (2449:9): [True: 0, False: 325]
  ------------------
 2450|       |      /* Clean up closed_next member just in case */
 2451|      0|      while (stream) {
  ------------------
  |  Branch (2451:14): [True: 0, False: 0]
  ------------------
 2452|      0|        next_stream = stream->closed_next;
 2453|      0|        stream->closed_next = NULL;
 2454|      0|        stream = next_stream;
 2455|      0|      }
 2456|      0|      return rv;
 2457|      0|    }
 2458|    325|  }
 2459|       |
 2460|  4.32k|  return 0;
 2461|  4.32k|}
nghttp2_session.c:find_stream_on_goaway_func:
 2390|  2.82k|static int find_stream_on_goaway_func(void *entry, void *ptr) {
 2391|  2.82k|  nghttp2_close_stream_on_goaway_arg *arg;
 2392|  2.82k|  nghttp2_stream *stream;
 2393|       |
 2394|  2.82k|  arg = (nghttp2_close_stream_on_goaway_arg *)ptr;
 2395|  2.82k|  stream = (nghttp2_stream *)entry;
 2396|       |
 2397|  2.82k|  if (nghttp2_session_is_my_stream_id(arg->session, stream->stream_id)) {
  ------------------
  |  Branch (2397:7): [True: 2.82k, False: 0]
  ------------------
 2398|  2.82k|    if (arg->incoming) {
  ------------------
  |  Branch (2398:9): [True: 2.37k, False: 450]
  ------------------
 2399|  2.37k|      return 0;
 2400|  2.37k|    }
 2401|  2.82k|  } else if (!arg->incoming) {
  ------------------
  |  Branch (2401:14): [True: 0, False: 0]
  ------------------
 2402|      0|    return 0;
 2403|      0|  }
 2404|       |
 2405|    450|  if (stream->state != NGHTTP2_STREAM_IDLE &&
  ------------------
  |  Branch (2405:7): [True: 450, False: 0]
  ------------------
 2406|    450|      (stream->flags & NGHTTP2_STREAM_FLAG_CLOSED) == 0 &&
  ------------------
  |  Branch (2406:7): [True: 450, False: 0]
  ------------------
 2407|    450|      stream->stream_id > arg->last_stream_id) {
  ------------------
  |  Branch (2407:7): [True: 325, False: 125]
  ------------------
 2408|       |    /* We are collecting streams to close because we cannot call
 2409|       |       nghttp2_session_close_stream() inside nghttp2_map_each().
 2410|       |       Reuse closed_next member.. bad choice? */
 2411|    325|    assert(stream->closed_next == NULL);
  ------------------
  |  Branch (2411:5): [True: 0, False: 325]
  |  Branch (2411:5): [True: 325, False: 0]
  ------------------
 2412|       |
 2413|    325|    if (arg->head) {
  ------------------
  |  Branch (2413:9): [True: 0, False: 325]
  ------------------
 2414|      0|      stream->closed_next = arg->head;
 2415|      0|      arg->head = stream;
 2416|    325|    } else {
 2417|    325|      arg->head = stream;
 2418|    325|    }
 2419|    325|  }
 2420|       |
 2421|    450|  return 0;
 2422|    450|}
nghttp2_session.c:session_on_connection_window_update_received:
 4736|     27|                                             nghttp2_frame *frame) {
 4737|       |  /* Handle connection-level flow control */
 4738|     27|  if (frame->window_update.window_size_increment == 0) {
  ------------------
  |  Branch (4738:7): [True: 2, False: 25]
  ------------------
 4739|      2|    return session_handle_invalid_connection(
 4740|      2|      session, frame, NGHTTP2_ERR_PROTO,
 4741|      2|      "WINDOW_UPDATE: window_size_increment == 0");
 4742|      2|  }
 4743|       |
 4744|     25|  if (NGHTTP2_MAX_WINDOW_SIZE - frame->window_update.window_size_increment <
  ------------------
  |  |  224|     25|#define NGHTTP2_MAX_WINDOW_SIZE ((int32_t)((1U << 31) - 1))
  ------------------
  |  Branch (4744:7): [True: 1, False: 24]
  ------------------
 4745|     25|      session->remote_window_size) {
 4746|      1|    return session_handle_invalid_connection(session, frame,
 4747|      1|                                             NGHTTP2_ERR_FLOW_CONTROL, NULL);
 4748|      1|  }
 4749|     24|  session->remote_window_size += frame->window_update.window_size_increment;
 4750|       |
 4751|     24|  return session_call_on_frame_received(session, frame);
 4752|     25|}
nghttp2_session.c:session_on_stream_window_update_received:
 4755|    182|                                                    nghttp2_frame *frame) {
 4756|    182|  int rv;
 4757|    182|  nghttp2_stream *stream;
 4758|       |
 4759|    182|  if (session_detect_idle_stream(session, frame->hd.stream_id)) {
  ------------------
  |  Branch (4759:7): [True: 33, False: 149]
  ------------------
 4760|     33|    return session_handle_invalid_connection(session, frame, NGHTTP2_ERR_PROTO,
 4761|     33|                                             "WINDOW_UPDATE to idle stream");
 4762|     33|  }
 4763|       |
 4764|    149|  stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
 4765|    149|  if (!stream) {
  ------------------
  |  Branch (4765:7): [True: 60, False: 89]
  ------------------
 4766|     60|    return 0;
 4767|     60|  }
 4768|     89|  if (state_reserved_remote(session, stream)) {
  ------------------
  |  Branch (4768:7): [True: 0, False: 89]
  ------------------
 4769|      0|    return session_handle_invalid_connection(
 4770|      0|      session, frame, NGHTTP2_ERR_PROTO, "WINDOW_UPADATE to reserved stream");
 4771|      0|  }
 4772|     89|  if (frame->window_update.window_size_increment == 0) {
  ------------------
  |  Branch (4772:7): [True: 1, False: 88]
  ------------------
 4773|      1|    return session_handle_invalid_connection(
 4774|      1|      session, frame, NGHTTP2_ERR_PROTO,
 4775|      1|      "WINDOW_UPDATE: window_size_increment == 0");
 4776|      1|  }
 4777|     88|  if (NGHTTP2_MAX_WINDOW_SIZE - frame->window_update.window_size_increment <
  ------------------
  |  |  224|     88|#define NGHTTP2_MAX_WINDOW_SIZE ((int32_t)((1U << 31) - 1))
  ------------------
  |  Branch (4777:7): [True: 1, False: 87]
  ------------------
 4778|     88|      stream->remote_window_size) {
 4779|      1|    return session_handle_invalid_connection(
 4780|      1|      session, frame, NGHTTP2_ERR_FLOW_CONTROL,
 4781|      1|      "WINDOW_UPDATE: window size overflow");
 4782|      1|  }
 4783|     87|  stream->remote_window_size += frame->window_update.window_size_increment;
 4784|       |
 4785|     87|  if (stream->remote_window_size > 0 &&
  ------------------
  |  Branch (4785:7): [True: 87, False: 0]
  ------------------
 4786|     87|      nghttp2_stream_check_deferred_by_flow_control(stream)) {
  ------------------
  |  Branch (4786:7): [True: 0, False: 87]
  ------------------
 4787|      0|    rv = session_resume_deferred_stream_item(
 4788|      0|      session, stream, NGHTTP2_STREAM_FLAG_DEFERRED_FLOW_CONTROL);
 4789|       |
 4790|      0|    if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (4790:9): [True: 0, False: 0]
  ------------------
 4791|      0|      return rv;
 4792|      0|    }
 4793|      0|  }
 4794|     87|  return session_call_on_frame_received(session, frame);
 4795|     87|}
nghttp2_session.c:state_reserved_remote:
  113|     89|                                 nghttp2_stream *stream) {
  114|     89|  return stream->state == NGHTTP2_STREAM_RESERVED &&
  ------------------
  |  Branch (114:10): [True: 0, False: 89]
  ------------------
  115|      0|         !nghttp2_session_is_my_stream_id(session, stream->stream_id);
  ------------------
  |  Branch (115:10): [True: 0, False: 0]
  ------------------
  116|     89|}
nghttp2_session.c:session_enforce_http_messaging:
   90|  49.4k|static int session_enforce_http_messaging(nghttp2_session *session) {
   91|  49.4k|  return (session->opt_flags & NGHTTP2_OPTMASK_NO_HTTP_MESSAGING) == 0;
   92|  49.4k|}
nghttp2_session.c:session_update_glitch_ratelim:
 3408|  2.35k|static int session_update_glitch_ratelim(nghttp2_session *session) {
 3409|  2.35k|  if (session->goaway_flags & NGHTTP2_GOAWAY_TERM_ON_SEND) {
  ------------------
  |  Branch (3409:7): [True: 0, False: 2.35k]
  ------------------
 3410|      0|    return 0;
 3411|      0|  }
 3412|       |
 3413|  2.35k|  nghttp2_ratelim_update(&session->glitch_ratelim, nghttp2_time_now_sec());
 3414|       |
 3415|  2.35k|  if (nghttp2_ratelim_drain(&session->glitch_ratelim, 1) == 0) {
  ------------------
  |  Branch (3415:7): [True: 2.35k, False: 0]
  ------------------
 3416|  2.35k|    return 0;
 3417|  2.35k|  }
 3418|       |
 3419|      0|  return nghttp2_session_terminate_session(session, NGHTTP2_ENHANCE_YOUR_CALM);
 3420|  2.35k|}
nghttp2_session.c:adjust_recv_window_size:
 5073|  1.49k|                                   int32_t local_window_size) {
 5074|  1.49k|  if (*recv_window_size_ptr > local_window_size - (int32_t)delta ||
  ------------------
  |  Branch (5074:7): [True: 0, False: 1.49k]
  ------------------
 5075|  1.49k|      *recv_window_size_ptr > NGHTTP2_MAX_WINDOW_SIZE - (int32_t)delta) {
  ------------------
  |  |  224|  1.49k|#define NGHTTP2_MAX_WINDOW_SIZE ((int32_t)((1U << 31) - 1))
  ------------------
  |  Branch (5075:7): [True: 0, False: 1.49k]
  ------------------
 5076|      0|    return -1;
 5077|      0|  }
 5078|  1.49k|  *recv_window_size_ptr += (int32_t)delta;
 5079|  1.49k|  return 0;
 5080|  1.49k|}
nghttp2_session.c:inbound_frame_buf_read:
 5294|  33.9k|                                     const uint8_t *in, const uint8_t *last) {
 5295|  33.9k|  size_t readlen;
 5296|       |
 5297|  33.9k|  readlen = nghttp2_min_size((size_t)(last - in),
 5298|  33.9k|                             nghttp2_buf_mark_avail(&iframe->sbuf));
  ------------------
  |  |   56|  33.9k|#define nghttp2_buf_mark_avail(BUF) ((size_t)((BUF)->mark - (BUF)->last))
  ------------------
 5299|       |
 5300|  33.9k|  iframe->sbuf.last = nghttp2_cpymem(iframe->sbuf.last, in, readlen);
 5301|       |
 5302|  33.9k|  return readlen;
 5303|  33.9k|}
nghttp2_session.c:session_call_error_callback:
  157|  10.4k|                                       ...) {
  158|  10.4k|  size_t bufsize;
  159|  10.4k|  va_list ap;
  160|  10.4k|  char *buf;
  161|  10.4k|  int rv;
  162|  10.4k|  nghttp2_mem *mem;
  163|       |
  164|  10.4k|  if (!session->callbacks.error_callback &&
  ------------------
  |  Branch (164:7): [True: 0, False: 10.4k]
  ------------------
  165|      0|      !session->callbacks.error_callback2) {
  ------------------
  |  Branch (165:7): [True: 0, False: 0]
  ------------------
  166|      0|    return 0;
  167|      0|  }
  168|       |
  169|  10.4k|  mem = &session->mem;
  170|       |
  171|  10.4k|  va_start(ap, fmt);
  172|  10.4k|  rv = vsnprintf(NULL, 0, fmt, ap);
  173|  10.4k|  va_end(ap);
  174|       |
  175|  10.4k|  if (rv < 0) {
  ------------------
  |  Branch (175:7): [True: 0, False: 10.4k]
  ------------------
  176|      0|    return NGHTTP2_ERR_NOMEM;
  177|      0|  }
  178|       |
  179|  10.4k|  bufsize = (size_t)(rv + 1);
  180|       |
  181|  10.4k|  buf = nghttp2_mem_malloc(mem, bufsize);
  182|  10.4k|  if (buf == NULL) {
  ------------------
  |  Branch (182:7): [True: 0, False: 10.4k]
  ------------------
  183|      0|    return NGHTTP2_ERR_NOMEM;
  184|      0|  }
  185|       |
  186|  10.4k|  va_start(ap, fmt);
  187|  10.4k|  rv = vsnprintf(buf, bufsize, fmt, ap);
  188|  10.4k|  va_end(ap);
  189|       |
  190|  10.4k|  if (rv < 0) {
  ------------------
  |  Branch (190:7): [True: 0, False: 10.4k]
  ------------------
  191|      0|    nghttp2_mem_free(mem, buf);
  192|       |    /* vsnprintf may return error because of various things we can
  193|       |       imagine, but typically we don't want to drop session just for
  194|       |       debug callback. */
  195|      0|    DEBUGF("error_callback: vsnprintf failed. The template was %s\n", fmt);
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  196|      0|    return 0;
  197|      0|  }
  198|       |
  199|  10.4k|  if (session->callbacks.error_callback2) {
  ------------------
  |  Branch (199:7): [True: 0, False: 10.4k]
  ------------------
  200|      0|    rv = session->callbacks.error_callback2(session, lib_error_code, buf,
  201|      0|                                            (size_t)rv, session->user_data);
  202|  10.4k|  } else {
  203|  10.4k|    rv = session->callbacks.error_callback(session, buf, (size_t)rv,
  204|  10.4k|                                           session->user_data);
  205|  10.4k|  }
  206|       |
  207|  10.4k|  nghttp2_mem_free(mem, buf);
  208|       |
  209|  10.4k|  if (rv != 0) {
  ------------------
  |  Branch (209:7): [True: 0, False: 10.4k]
  ------------------
  210|      0|    return NGHTTP2_ERR_CALLBACK_FAILURE;
  211|      0|  }
  212|       |
  213|  10.4k|  return 0;
  214|  10.4k|}
nghttp2_session.c:session_on_data_received_fail_fast:
 5210|    888|static int session_on_data_received_fail_fast(nghttp2_session *session) {
 5211|    888|  int rv;
 5212|    888|  nghttp2_stream *stream;
 5213|    888|  nghttp2_inbound_frame *iframe;
 5214|    888|  int32_t stream_id;
 5215|    888|  const char *failure_reason;
 5216|    888|  uint32_t error_code = NGHTTP2_PROTOCOL_ERROR;
 5217|       |
 5218|    888|  iframe = &session->iframe;
 5219|    888|  stream_id = iframe->frame.hd.stream_id;
 5220|       |
 5221|    888|  if (stream_id == 0) {
  ------------------
  |  Branch (5221:7): [True: 12, False: 876]
  ------------------
 5222|       |    /* The spec says that if a DATA frame is received whose stream ID
 5223|       |       is 0, the recipient MUST respond with a connection error of
 5224|       |       type PROTOCOL_ERROR. */
 5225|     12|    failure_reason = "DATA: stream_id == 0";
 5226|     12|    goto fail;
 5227|     12|  }
 5228|       |
 5229|    876|  if (session_detect_idle_stream(session, stream_id)) {
  ------------------
  |  Branch (5229:7): [True: 124, False: 752]
  ------------------
 5230|    124|    failure_reason = "DATA: stream in idle";
 5231|    124|    error_code = NGHTTP2_PROTOCOL_ERROR;
 5232|    124|    goto fail;
 5233|    124|  }
 5234|       |
 5235|    752|  stream = nghttp2_session_get_stream(session, stream_id);
 5236|    752|  if (!stream) {
  ------------------
  |  Branch (5236:7): [True: 223, False: 529]
  ------------------
 5237|    223|    stream = nghttp2_session_get_stream_raw(session, stream_id);
 5238|    223|    if (stream && (stream->shut_flags & NGHTTP2_SHUT_RD)) {
  ------------------
  |  Branch (5238:9): [True: 0, False: 223]
  |  Branch (5238:19): [True: 0, False: 0]
  ------------------
 5239|      0|      failure_reason = "DATA: stream closed";
 5240|      0|      error_code = NGHTTP2_STREAM_CLOSED;
 5241|      0|      goto fail;
 5242|      0|    }
 5243|       |
 5244|    223|    return NGHTTP2_ERR_IGN_PAYLOAD;
 5245|    223|  }
 5246|    529|  if (stream->shut_flags & NGHTTP2_SHUT_RD) {
  ------------------
  |  Branch (5246:7): [True: 1, False: 528]
  ------------------
 5247|      1|    failure_reason = "DATA: stream in half-closed(remote)";
 5248|      1|    error_code = NGHTTP2_STREAM_CLOSED;
 5249|      1|    goto fail;
 5250|      1|  }
 5251|       |
 5252|    528|  if (nghttp2_session_is_my_stream_id(session, stream_id)) {
  ------------------
  |  Branch (5252:7): [True: 528, False: 0]
  ------------------
 5253|    528|    if (stream->state == NGHTTP2_STREAM_CLOSING) {
  ------------------
  |  Branch (5253:9): [True: 116, False: 412]
  ------------------
 5254|    116|      return NGHTTP2_ERR_IGN_PAYLOAD;
 5255|    116|    }
 5256|    412|    if (stream->state != NGHTTP2_STREAM_OPENED) {
  ------------------
  |  Branch (5256:9): [True: 2, False: 410]
  ------------------
 5257|      2|      failure_reason = "DATA: stream not opened";
 5258|      2|      goto fail;
 5259|      2|    }
 5260|    410|    return 0;
 5261|    412|  }
 5262|      0|  if (stream->state == NGHTTP2_STREAM_RESERVED) {
  ------------------
  |  Branch (5262:7): [True: 0, False: 0]
  ------------------
 5263|      0|    failure_reason = "DATA: stream in reserved";
 5264|      0|    goto fail;
 5265|      0|  }
 5266|      0|  if (stream->state == NGHTTP2_STREAM_CLOSING) {
  ------------------
  |  Branch (5266:7): [True: 0, False: 0]
  ------------------
 5267|      0|    return NGHTTP2_ERR_IGN_PAYLOAD;
 5268|      0|  }
 5269|      0|  return 0;
 5270|    139|fail:
 5271|    139|  rv = nghttp2_session_terminate_session_with_reason(session, error_code,
 5272|    139|                                                     failure_reason);
 5273|    139|  if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (5273:7): [True: 0, False: 139]
  ------------------
 5274|      0|    return rv;
 5275|      0|  }
 5276|    139|  return NGHTTP2_ERR_IGN_PAYLOAD;
 5277|    139|}
nghttp2_session.c:inbound_frame_handle_pad:
 5360|  2.73k|                                    nghttp2_frame_hd *hd) {
 5361|  2.73k|  if (hd->flags & NGHTTP2_FLAG_PADDED) {
  ------------------
  |  Branch (5361:7): [True: 1.25k, False: 1.48k]
  ------------------
 5362|  1.25k|    if (hd->length < 1) {
  ------------------
  |  Branch (5362:9): [True: 7, False: 1.24k]
  ------------------
 5363|      7|      return -1;
 5364|      7|    }
 5365|  1.24k|    inbound_frame_set_mark(iframe, 1);
 5366|  1.24k|    return 1;
 5367|  1.25k|  }
 5368|  1.48k|  DEBUGF("recv: no padding in payload\n");
  ------------------
  |  |   39|  1.48k|    do {                                                                       \
  |  |   40|  1.48k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 1.48k]
  |  |  ------------------
  ------------------
 5369|  1.48k|  return 0;
 5370|  2.73k|}
nghttp2_session.c:inbound_frame_set_mark:
 5288|  19.5k|static void inbound_frame_set_mark(nghttp2_inbound_frame *iframe, size_t left) {
 5289|  19.5k|  nghttp2_buf_reset(&iframe->sbuf);
 5290|  19.5k|  iframe->sbuf.mark += left;
 5291|  19.5k|}
nghttp2_session.c:session_call_on_begin_frame:
 3210|  8.31k|                                       const nghttp2_frame_hd *hd) {
 3211|  8.31k|  int rv;
 3212|       |
 3213|  8.31k|  if (session->callbacks.on_begin_frame_callback) {
  ------------------
  |  Branch (3213:7): [True: 0, False: 8.31k]
  ------------------
 3214|      0|    rv = session->callbacks.on_begin_frame_callback(session, hd,
 3215|      0|                                                    session->user_data);
 3216|       |
 3217|      0|    if (rv != 0) {
  ------------------
  |  Branch (3217:9): [True: 0, False: 0]
  ------------------
 3218|      0|      return NGHTTP2_ERR_CALLBACK_FAILURE;
 3219|      0|    }
 3220|      0|  }
 3221|       |
 3222|  8.31k|  return 0;
 3223|  8.31k|}
nghttp2_session.c:session_process_headers_frame:
 4048|  2.09k|static int session_process_headers_frame(nghttp2_session *session) {
 4049|  2.09k|  nghttp2_inbound_frame *iframe = &session->iframe;
 4050|  2.09k|  nghttp2_frame *frame = &iframe->frame;
 4051|  2.09k|  nghttp2_stream *stream;
 4052|       |
 4053|  2.09k|  nghttp2_frame_unpack_headers_payload(&frame->headers, iframe->sbuf.pos);
 4054|       |
 4055|  2.09k|  stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
 4056|  2.09k|  if (!stream) {
  ------------------
  |  Branch (4056:7): [True: 230, False: 1.86k]
  ------------------
 4057|    230|    frame->headers.cat = NGHTTP2_HCAT_REQUEST;
 4058|    230|    return nghttp2_session_on_request_headers_received(session, frame);
 4059|    230|  }
 4060|       |
 4061|  1.86k|  if (stream->state == NGHTTP2_STREAM_RESERVED) {
  ------------------
  |  Branch (4061:7): [True: 0, False: 1.86k]
  ------------------
 4062|      0|    frame->headers.cat = NGHTTP2_HCAT_PUSH_RESPONSE;
 4063|      0|    return nghttp2_session_on_push_response_headers_received(session, frame,
 4064|      0|                                                             stream);
 4065|      0|  }
 4066|       |
 4067|  1.86k|  if (stream->state == NGHTTP2_STREAM_OPENING &&
  ------------------
  |  Branch (4067:7): [True: 1.79k, False: 69]
  ------------------
 4068|  1.79k|      nghttp2_session_is_my_stream_id(session, frame->hd.stream_id)) {
  ------------------
  |  Branch (4068:7): [True: 1.79k, False: 0]
  ------------------
 4069|  1.79k|    frame->headers.cat = NGHTTP2_HCAT_RESPONSE;
 4070|  1.79k|    return nghttp2_session_on_response_headers_received(session, frame, stream);
 4071|  1.79k|  }
 4072|       |
 4073|     69|  frame->headers.cat = NGHTTP2_HCAT_HEADERS;
 4074|     69|  return nghttp2_session_on_headers_received(session, frame, stream);
 4075|  1.86k|}
nghttp2_session.c:check_ext_type_set:
  151|  3.39k|static int check_ext_type_set(const uint8_t *ext_types, uint8_t type) {
  152|  3.39k|  return (ext_types[type / 8] & (1 << (type & 0x7))) > 0;
  153|  3.39k|}
nghttp2_session.c:inbound_frame_compute_pad:
 5376|  1.24k|static nghttp2_ssize inbound_frame_compute_pad(nghttp2_inbound_frame *iframe) {
 5377|  1.24k|  size_t padlen;
 5378|       |
 5379|       |  /* 1 for Pad Length field */
 5380|  1.24k|  padlen = (size_t)(iframe->sbuf.pos[0] + 1);
 5381|       |
 5382|  1.24k|  DEBUGF("recv: padlen=%zu\n", padlen);
  ------------------
  |  |   39|  1.24k|    do {                                                                       \
  |  |   40|  1.24k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 1.24k]
  |  |  ------------------
  ------------------
 5383|       |
 5384|       |  /* We cannot use iframe->frame.hd.length because of CONTINUATION */
 5385|  1.24k|  if (padlen - 1 > iframe->payloadleft) {
  ------------------
  |  Branch (5385:7): [True: 8, False: 1.23k]
  ------------------
 5386|      8|    return -1;
 5387|      8|  }
 5388|       |
 5389|  1.23k|  iframe->padlen = padlen;
 5390|       |
 5391|  1.23k|  return (nghttp2_ssize)padlen;
 5392|  1.24k|}
nghttp2_session.c:session_process_rst_stream_frame:
 4127|    276|static int session_process_rst_stream_frame(nghttp2_session *session) {
 4128|    276|  nghttp2_inbound_frame *iframe = &session->iframe;
 4129|    276|  nghttp2_frame *frame = &iframe->frame;
 4130|       |
 4131|    276|  nghttp2_frame_unpack_rst_stream_payload(&frame->rst_stream, iframe->sbuf.pos);
 4132|       |
 4133|    276|  return nghttp2_session_on_rst_stream_received(session, frame);
 4134|    276|}
nghttp2_session.c:session_process_push_promise_frame:
 4650|    212|static int session_process_push_promise_frame(nghttp2_session *session) {
 4651|    212|  nghttp2_inbound_frame *iframe = &session->iframe;
 4652|    212|  nghttp2_frame *frame = &iframe->frame;
 4653|       |
 4654|    212|  nghttp2_frame_unpack_push_promise_payload(&frame->push_promise,
 4655|    212|                                            iframe->sbuf.pos);
 4656|       |
 4657|    212|  return nghttp2_session_on_push_promise_received(session, frame);
 4658|    212|}
nghttp2_session.c:session_process_ping_frame:
 4680|    135|static int session_process_ping_frame(nghttp2_session *session) {
 4681|    135|  nghttp2_inbound_frame *iframe = &session->iframe;
 4682|    135|  nghttp2_frame *frame = &iframe->frame;
 4683|       |
 4684|    135|  nghttp2_frame_unpack_ping_payload(&frame->ping, iframe->sbuf.pos);
 4685|       |
 4686|    135|  return nghttp2_session_on_ping_received(session, frame);
 4687|    135|}
nghttp2_session.c:session_process_window_update_frame:
 4806|    209|static int session_process_window_update_frame(nghttp2_session *session) {
 4807|    209|  nghttp2_inbound_frame *iframe = &session->iframe;
 4808|    209|  nghttp2_frame *frame = &iframe->frame;
 4809|       |
 4810|    209|  nghttp2_frame_unpack_window_update_payload(&frame->window_update,
 4811|    209|                                             iframe->sbuf.pos);
 4812|       |
 4813|    209|  return nghttp2_session_on_window_update_received(session, frame);
 4814|    209|}
nghttp2_session.c:inbound_frame_payload_readlen:
 5281|  5.85k|                                            const uint8_t *last) {
 5282|  5.85k|  return nghttp2_min_size((size_t)(last - in), iframe->payloadleft);
 5283|  5.85k|}
nghttp2_session.c:inbound_frame_effective_readlen:
 5402|  3.32k|                                size_t payloadleft, size_t readlen) {
 5403|  3.32k|  size_t trail_padlen =
 5404|  3.32k|    nghttp2_frame_trail_padlen(&iframe->frame, iframe->padlen);
 5405|       |
 5406|  3.32k|  if (trail_padlen > payloadleft) {
  ------------------
  |  Branch (5406:7): [True: 80, False: 3.24k]
  ------------------
 5407|     80|    size_t padlen;
 5408|     80|    padlen = trail_padlen - payloadleft;
 5409|     80|    if (readlen < padlen) {
  ------------------
  |  Branch (5409:9): [True: 2, False: 78]
  ------------------
 5410|      2|      return -1;
 5411|      2|    }
 5412|     78|    return (nghttp2_ssize)(readlen - padlen);
 5413|     80|  }
 5414|  3.24k|  return (nghttp2_ssize)(readlen);
 5415|  3.32k|}
nghttp2_session.c:inflate_header_block:
 3519|  2.87k|                                int final, int call_header_cb) {
 3520|  2.87k|  nghttp2_inbound_frame *iframe = &session->iframe;
 3521|  2.87k|  nghttp2_ssize proclen;
 3522|  2.87k|  int rv;
 3523|  2.87k|  int inflate_flags;
 3524|  2.87k|  nghttp2_hd_nv nv;
 3525|  2.87k|  nghttp2_stream *stream;
 3526|  2.87k|  nghttp2_stream *subject_stream;
 3527|  2.87k|  int trailer = 0;
 3528|       |
 3529|  2.87k|  *readlen_ptr = 0;
 3530|  2.87k|  stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
 3531|       |
 3532|  2.87k|  if (frame->hd.type == NGHTTP2_PUSH_PROMISE) {
  ------------------
  |  Branch (3532:7): [True: 155, False: 2.72k]
  ------------------
 3533|    155|    subject_stream = nghttp2_session_get_stream(
 3534|    155|      session, frame->push_promise.promised_stream_id);
 3535|  2.72k|  } else {
 3536|  2.72k|    subject_stream = stream;
 3537|  2.72k|    trailer = session_trailer_headers(session, stream, frame);
 3538|  2.72k|  }
 3539|       |
 3540|  2.87k|  DEBUGF("recv: decoding header block %zu bytes\n", inlen);
  ------------------
  |  |   39|  2.87k|    do {                                                                       \
  |  |   40|  2.87k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 2.87k]
  |  |  ------------------
  ------------------
 3541|  52.8k|  for (;;) {
 3542|  52.8k|    inflate_flags = 0;
 3543|  52.8k|    proclen = nghttp2_hd_inflate_hd_nv(&session->hd_inflater, &nv,
 3544|  52.8k|                                       &inflate_flags, in, inlen, final);
 3545|  52.8k|    if (nghttp2_is_fatal((int)proclen)) {
  ------------------
  |  Branch (3545:9): [True: 0, False: 52.8k]
  ------------------
 3546|      0|      return (int)proclen;
 3547|      0|    }
 3548|  52.8k|    if (proclen < 0) {
  ------------------
  |  Branch (3548:9): [True: 1.00k, False: 51.8k]
  ------------------
 3549|  1.00k|      if (session->iframe.state == NGHTTP2_IB_READ_HEADER_BLOCK) {
  ------------------
  |  Branch (3549:11): [True: 621, False: 379]
  ------------------
 3550|    621|        if (subject_stream && subject_stream->state != NGHTTP2_STREAM_CLOSING) {
  ------------------
  |  Branch (3550:13): [True: 621, False: 0]
  |  Branch (3550:31): [True: 621, False: 0]
  ------------------
 3551|       |          /* Adding RST_STREAM here is very important. It prevents
 3552|       |             from invoking subsequent callbacks for the same stream
 3553|       |             ID. */
 3554|    621|          rv = nghttp2_session_add_rst_stream(
 3555|    621|            session, subject_stream->stream_id, NGHTTP2_COMPRESSION_ERROR);
 3556|       |
 3557|    621|          if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (3557:15): [True: 0, False: 621]
  ------------------
 3558|      0|            return rv;
 3559|      0|          }
 3560|    621|        }
 3561|    621|      }
 3562|  1.00k|      rv =
 3563|  1.00k|        nghttp2_session_terminate_session(session, NGHTTP2_COMPRESSION_ERROR);
 3564|  1.00k|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (3564:11): [True: 0, False: 1.00k]
  ------------------
 3565|      0|        return rv;
 3566|      0|      }
 3567|       |
 3568|  1.00k|      return NGHTTP2_ERR_HEADER_COMP;
 3569|  1.00k|    }
 3570|  51.8k|    in += proclen;
 3571|  51.8k|    inlen -= (size_t)proclen;
 3572|  51.8k|    *readlen_ptr += (size_t)proclen;
 3573|       |
 3574|  51.8k|    DEBUGF("recv: proclen=%td\n", proclen);
  ------------------
  |  |   39|  51.8k|    do {                                                                       \
  |  |   40|  51.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 51.8k]
  |  |  ------------------
  ------------------
 3575|       |
 3576|  51.8k|    if (call_header_cb && (inflate_flags & NGHTTP2_HD_INFLATE_EMIT)) {
  ------------------
  |  Branch (3576:9): [True: 44.7k, False: 7.09k]
  |  Branch (3576:27): [True: 44.0k, False: 725]
  ------------------
 3577|  44.0k|      rv = 0;
 3578|  44.0k|      if (subject_stream) {
  ------------------
  |  Branch (3578:11): [True: 44.0k, False: 0]
  ------------------
 3579|  44.0k|        if (session_enforce_http_messaging(session)) {
  ------------------
  |  Branch (3579:13): [True: 44.0k, False: 0]
  ------------------
 3580|  44.0k|          rv = nghttp2_http_on_header(session, subject_stream, frame, &nv,
 3581|  44.0k|                                      trailer);
 3582|       |
 3583|  44.0k|          if (rv == NGHTTP2_ERR_IGN_HTTP_HEADER) {
  ------------------
  |  Branch (3583:15): [True: 9.01k, False: 35.0k]
  ------------------
 3584|       |            /* Don't overwrite rv here */
 3585|  9.01k|            int rv2;
 3586|       |
 3587|  9.01k|            rv2 = session_call_on_invalid_header(session, frame, &nv);
 3588|  9.01k|            if (rv2 == NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE) {
  ------------------
  |  Branch (3588:17): [True: 0, False: 9.01k]
  ------------------
 3589|      0|              DEBUGF("recv: HTTP error: type=%u, id=%d, header %.*s: %.*s\n",
  ------------------
  |  |   39|      0|    do {                                                                       \
  |  |   40|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3590|      0|                     frame->hd.type, frame->hd.stream_id, (int)nv.name->len,
 3591|      0|                     nv.name->base, (int)nv.value->len, nv.value->base);
 3592|       |
 3593|      0|              rv = session_call_error_callback(
 3594|      0|                session, NGHTTP2_ERR_HTTP_HEADER,
 3595|      0|                "Invalid HTTP header field was received: frame type: "
 3596|      0|                "%u, stream: %d, name: [%.*s], value: [%.*s]",
 3597|      0|                frame->hd.type, frame->hd.stream_id, (int)nv.name->len,
 3598|      0|                nv.name->base, (int)nv.value->len, nv.value->base);
 3599|       |
 3600|      0|              if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (3600:19): [True: 0, False: 0]
  ------------------
 3601|      0|                return rv;
 3602|      0|              }
 3603|       |
 3604|      0|              rv = session_handle_invalid_stream2(
 3605|      0|                session, subject_stream->stream_id, frame,
 3606|      0|                NGHTTP2_ERR_HTTP_HEADER);
 3607|      0|              if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (3607:19): [True: 0, False: 0]
  ------------------
 3608|      0|                return rv;
 3609|      0|              }
 3610|       |
 3611|      0|              return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE;
 3612|  9.01k|            } else {
 3613|  9.01k|              if (rv2 != 0) {
  ------------------
  |  Branch (3613:19): [True: 0, False: 9.01k]
  ------------------
 3614|      0|                return rv2;
 3615|      0|              }
 3616|       |
 3617|       |              /* header is ignored */
 3618|  9.01k|              DEBUGF("recv: HTTP ignored: type=%u, id=%d, header %.*s: %.*s\n",
  ------------------
  |  |   39|  9.01k|    do {                                                                       \
  |  |   40|  9.01k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 9.01k]
  |  |  ------------------
  ------------------
 3619|  9.01k|                     frame->hd.type, frame->hd.stream_id, (int)nv.name->len,
 3620|  9.01k|                     nv.name->base, (int)nv.value->len, nv.value->base);
 3621|       |
 3622|  9.01k|              rv2 = session_call_error_callback(
 3623|  9.01k|                session, NGHTTP2_ERR_HTTP_HEADER,
 3624|  9.01k|                "Ignoring received invalid HTTP header field: frame type: "
 3625|  9.01k|                "%u, stream: %d, name: [%.*s], value: [%.*s]",
 3626|  9.01k|                frame->hd.type, frame->hd.stream_id, (int)nv.name->len,
 3627|  9.01k|                nv.name->base, (int)nv.value->len, nv.value->base);
 3628|       |
 3629|  9.01k|              if (nghttp2_is_fatal(rv2)) {
  ------------------
  |  Branch (3629:19): [True: 0, False: 9.01k]
  ------------------
 3630|      0|                return rv2;
 3631|      0|              }
 3632|  9.01k|            }
 3633|  9.01k|          }
 3634|       |
 3635|  44.0k|          if (rv == NGHTTP2_ERR_HTTP_HEADER) {
  ------------------
  |  Branch (3635:15): [True: 564, False: 43.4k]
  ------------------
 3636|    564|            DEBUGF("recv: HTTP error: type=%u, id=%d, header %.*s: %.*s\n",
  ------------------
  |  |   39|    564|    do {                                                                       \
  |  |   40|    564|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 564]
  |  |  ------------------
  ------------------
 3637|    564|                   frame->hd.type, frame->hd.stream_id, (int)nv.name->len,
 3638|    564|                   nv.name->base, (int)nv.value->len, nv.value->base);
 3639|       |
 3640|    564|            rv = session_call_error_callback(
 3641|    564|              session, NGHTTP2_ERR_HTTP_HEADER,
 3642|    564|              "Invalid HTTP header field was received: frame type: "
 3643|    564|              "%u, stream: %d, name: [%.*s], value: [%.*s]",
 3644|    564|              frame->hd.type, frame->hd.stream_id, (int)nv.name->len,
 3645|    564|              nv.name->base, (int)nv.value->len, nv.value->base);
 3646|       |
 3647|    564|            if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (3647:17): [True: 0, False: 564]
  ------------------
 3648|      0|              return rv;
 3649|      0|            }
 3650|       |
 3651|    564|            rv =
 3652|    564|              session_handle_invalid_stream2(session, subject_stream->stream_id,
 3653|    564|                                             frame, NGHTTP2_ERR_HTTP_HEADER);
 3654|    564|            if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (3654:17): [True: 0, False: 564]
  ------------------
 3655|      0|              return rv;
 3656|      0|            }
 3657|       |
 3658|    564|            rv = session_update_glitch_ratelim(session);
 3659|    564|            if (rv != 0) {
  ------------------
  |  Branch (3659:17): [True: 0, False: 564]
  ------------------
 3660|      0|              return rv;
 3661|      0|            }
 3662|       |
 3663|    564|            if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (3663:17): [True: 0, False: 564]
  ------------------
 3664|      0|              return 0;
 3665|      0|            }
 3666|       |
 3667|    564|            return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE;
 3668|    564|          }
 3669|  44.0k|        }
 3670|  43.4k|        if (rv == 0) {
  ------------------
  |  Branch (3670:13): [True: 34.4k, False: 9.01k]
  ------------------
 3671|  34.4k|          rv = session_call_on_header(session, frame, &nv);
 3672|       |          /* This handles NGHTTP2_ERR_PAUSE and
 3673|       |             NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE as well */
 3674|  34.4k|          if (rv != 0) {
  ------------------
  |  Branch (3674:15): [True: 0, False: 34.4k]
  ------------------
 3675|      0|            return rv;
 3676|      0|          }
 3677|  34.4k|        }
 3678|  43.4k|      }
 3679|  44.0k|    }
 3680|  51.2k|    if (inflate_flags & NGHTTP2_HD_INFLATE_FINAL) {
  ------------------
  |  Branch (3680:9): [True: 482, False: 50.8k]
  ------------------
 3681|    482|      nghttp2_hd_inflate_end_headers(&session->hd_inflater);
 3682|    482|      break;
 3683|    482|    }
 3684|  50.8k|    if ((inflate_flags & NGHTTP2_HD_INFLATE_EMIT) == 0 && inlen == 0) {
  ------------------
  |  Branch (3684:9): [True: 831, False: 49.9k]
  |  Branch (3684:59): [True: 831, False: 0]
  ------------------
 3685|    831|      break;
 3686|    831|    }
 3687|  50.8k|  }
 3688|  1.31k|  return 0;
 3689|  2.87k|}
nghttp2_session.c:session_trailer_headers:
   99|  2.72k|                                   nghttp2_frame *frame) {
  100|  2.72k|  if (!stream || frame->hd.type != NGHTTP2_HEADERS) {
  ------------------
  |  Branch (100:7): [True: 201, False: 2.52k]
  |  Branch (100:18): [True: 0, False: 2.52k]
  ------------------
  101|    201|    return 0;
  102|    201|  }
  103|  2.52k|  if (session->server) {
  ------------------
  |  Branch (103:7): [True: 0, False: 2.52k]
  ------------------
  104|      0|    return frame->headers.cat == NGHTTP2_HCAT_HEADERS;
  105|      0|  }
  106|       |
  107|  2.52k|  return frame->headers.cat == NGHTTP2_HCAT_HEADERS &&
  ------------------
  |  Branch (107:10): [True: 76, False: 2.44k]
  ------------------
  108|     76|         (stream->http_flags & NGHTTP2_HTTP_FLAG_EXPECT_FINAL_RESPONSE) == 0;
  ------------------
  |  Branch (108:10): [True: 76, False: 0]
  ------------------
  109|  2.52k|}
nghttp2_session.c:session_call_on_invalid_header:
 3281|  9.01k|                                          const nghttp2_hd_nv *nv) {
 3282|  9.01k|  int rv;
 3283|  9.01k|  if (session->callbacks.on_invalid_header_callback2) {
  ------------------
  |  Branch (3283:7): [True: 0, False: 9.01k]
  ------------------
 3284|      0|    rv = session->callbacks.on_invalid_header_callback2(
 3285|      0|      session, frame, nv->name, nv->value, nv->flags, session->user_data);
 3286|  9.01k|  } else if (session->callbacks.on_invalid_header_callback) {
  ------------------
  |  Branch (3286:14): [True: 0, False: 9.01k]
  ------------------
 3287|      0|    rv = session->callbacks.on_invalid_header_callback(
 3288|      0|      session, frame, nv->name->base, nv->name->len, nv->value->base,
 3289|      0|      nv->value->len, nv->flags, session->user_data);
 3290|  9.01k|  } else {
 3291|       |    /* If both callbacks are not set, the invalid field nv is
 3292|       |       ignored. */
 3293|  9.01k|    return 0;
 3294|  9.01k|  }
 3295|       |
 3296|      0|  if (rv == NGHTTP2_ERR_PAUSE || rv == NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE) {
  ------------------
  |  Branch (3296:7): [True: 0, False: 0]
  |  Branch (3296:34): [True: 0, False: 0]
  ------------------
 3297|      0|    return rv;
 3298|      0|  }
 3299|      0|  if (rv != 0) {
  ------------------
  |  Branch (3299:7): [True: 0, False: 0]
  ------------------
 3300|      0|    return NGHTTP2_ERR_CALLBACK_FAILURE;
 3301|      0|  }
 3302|       |
 3303|      0|  return 0;
 3304|      0|}
nghttp2_session.c:session_call_on_header:
 3258|  34.4k|                                  const nghttp2_hd_nv *nv) {
 3259|  34.4k|  int rv = 0;
 3260|  34.4k|  if (session->callbacks.on_header_callback2) {
  ------------------
  |  Branch (3260:7): [True: 0, False: 34.4k]
  ------------------
 3261|      0|    rv = session->callbacks.on_header_callback2(
 3262|      0|      session, frame, nv->name, nv->value, nv->flags, session->user_data);
 3263|  34.4k|  } else if (session->callbacks.on_header_callback) {
  ------------------
  |  Branch (3263:14): [True: 34.4k, False: 0]
  ------------------
 3264|  34.4k|    rv = session->callbacks.on_header_callback(
 3265|  34.4k|      session, frame, nv->name->base, nv->name->len, nv->value->base,
 3266|  34.4k|      nv->value->len, nv->flags, session->user_data);
 3267|  34.4k|  }
 3268|       |
 3269|  34.4k|  if (rv == NGHTTP2_ERR_PAUSE || rv == NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE) {
  ------------------
  |  Branch (3269:7): [True: 0, False: 34.4k]
  |  Branch (3269:34): [True: 0, False: 34.4k]
  ------------------
 3270|      0|    return rv;
 3271|      0|  }
 3272|  34.4k|  if (rv != 0) {
  ------------------
  |  Branch (3272:7): [True: 0, False: 34.4k]
  ------------------
 3273|      0|    return NGHTTP2_ERR_CALLBACK_FAILURE;
 3274|      0|  }
 3275|       |
 3276|  34.4k|  return 0;
 3277|  34.4k|}
nghttp2_session.c:session_after_header_block_received:
 3733|    250|static int session_after_header_block_received(nghttp2_session *session) {
 3734|    250|  int rv = 0;
 3735|    250|  nghttp2_frame *frame = &session->iframe.frame;
 3736|    250|  nghttp2_inbound_frame *iframe = &session->iframe;
 3737|    250|  nghttp2_stream *stream;
 3738|       |
 3739|       |  /* We don't call on_frame_recv_callback if stream has been closed
 3740|       |     already or being closed. */
 3741|    250|  stream = nghttp2_session_get_stream(session, frame->hd.stream_id);
 3742|    250|  if (!stream || stream->state == NGHTTP2_STREAM_CLOSING) {
  ------------------
  |  Branch (3742:7): [True: 0, False: 250]
  |  Branch (3742:18): [True: 0, False: 250]
  ------------------
 3743|      0|    return 0;
 3744|      0|  }
 3745|       |
 3746|    250|  if (session_enforce_http_messaging(session)) {
  ------------------
  |  Branch (3746:7): [True: 250, False: 0]
  ------------------
 3747|    250|    if (frame->hd.type == NGHTTP2_PUSH_PROMISE) {
  ------------------
  |  Branch (3747:9): [True: 0, False: 250]
  ------------------
 3748|      0|      nghttp2_stream *subject_stream;
 3749|       |
 3750|      0|      subject_stream = nghttp2_session_get_stream(
 3751|      0|        session, frame->push_promise.promised_stream_id);
 3752|      0|      if (subject_stream) {
  ------------------
  |  Branch (3752:11): [True: 0, False: 0]
  ------------------
 3753|      0|        rv = nghttp2_http_on_request_headers(subject_stream, frame);
 3754|      0|      }
 3755|    250|    } else {
 3756|    250|      assert(frame->hd.type == NGHTTP2_HEADERS);
  ------------------
  |  Branch (3756:7): [True: 0, False: 250]
  |  Branch (3756:7): [True: 250, False: 0]
  ------------------
 3757|    250|      switch (frame->headers.cat) {
 3758|      0|      case NGHTTP2_HCAT_REQUEST:
  ------------------
  |  Branch (3758:7): [True: 0, False: 250]
  ------------------
 3759|      0|        rv = nghttp2_http_on_request_headers(stream, frame);
 3760|      0|        break;
 3761|    243|      case NGHTTP2_HCAT_RESPONSE:
  ------------------
  |  Branch (3761:7): [True: 243, False: 7]
  ------------------
 3762|    243|      case NGHTTP2_HCAT_PUSH_RESPONSE:
  ------------------
  |  Branch (3762:7): [True: 0, False: 250]
  ------------------
 3763|    243|        rv = nghttp2_http_on_response_headers(stream);
 3764|    243|        break;
 3765|      7|      case NGHTTP2_HCAT_HEADERS:
  ------------------
  |  Branch (3765:7): [True: 7, False: 243]
  ------------------
 3766|      7|        if (stream->http_flags & NGHTTP2_HTTP_FLAG_EXPECT_FINAL_RESPONSE) {
  ------------------
  |  Branch (3766:13): [True: 0, False: 7]
  ------------------
 3767|      0|          assert(!session->server);
  ------------------
  |  Branch (3767:11): [True: 0, False: 0]
  |  Branch (3767:11): [True: 0, False: 0]
  ------------------
 3768|      0|          rv = nghttp2_http_on_response_headers(stream);
 3769|      7|        } else {
 3770|      7|          rv = nghttp2_http_on_trailer_headers(stream, frame);
 3771|      7|        }
 3772|      7|        break;
 3773|      7|      default:
  ------------------
  |  Branch (3773:7): [True: 0, False: 250]
  ------------------
 3774|      0|        assert(0);
  ------------------
  |  Branch (3774:9): [Folded, False: 0]
  |  Branch (3774:9): [Folded, False: 0]
  ------------------
 3775|    250|      }
 3776|    250|      if (rv == 0 && (frame->hd.flags & NGHTTP2_FLAG_END_STREAM)) {
  ------------------
  |  Branch (3776:11): [True: 240, False: 10]
  |  Branch (3776:22): [True: 18, False: 222]
  ------------------
 3777|     18|        rv = nghttp2_http_on_remote_end_stream(stream);
 3778|     18|      }
 3779|    250|    }
 3780|    250|    if (rv != 0) {
  ------------------
  |  Branch (3780:9): [True: 10, False: 240]
  ------------------
 3781|     10|      int32_t stream_id;
 3782|       |
 3783|     10|      if (frame->hd.type == NGHTTP2_PUSH_PROMISE) {
  ------------------
  |  Branch (3783:11): [True: 0, False: 10]
  ------------------
 3784|      0|        stream_id = frame->push_promise.promised_stream_id;
 3785|     10|      } else {
 3786|     10|        stream_id = frame->hd.stream_id;
 3787|     10|      }
 3788|       |
 3789|     10|      rv = session_handle_invalid_stream2(session, stream_id, frame,
 3790|     10|                                          NGHTTP2_ERR_HTTP_MESSAGING);
 3791|     10|      if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (3791:11): [True: 0, False: 10]
  ------------------
 3792|      0|        return rv;
 3793|      0|      }
 3794|       |
 3795|     10|      rv = session_update_glitch_ratelim(session);
 3796|     10|      if (rv != 0) {
  ------------------
  |  Branch (3796:11): [True: 0, False: 10]
  ------------------
 3797|      0|        return rv;
 3798|      0|      }
 3799|       |
 3800|     10|      if (iframe->state == NGHTTP2_IB_IGN_ALL) {
  ------------------
  |  Branch (3800:11): [True: 0, False: 10]
  ------------------
 3801|      0|        return 0;
 3802|      0|      }
 3803|       |
 3804|     10|      if (frame->hd.type == NGHTTP2_HEADERS &&
  ------------------
  |  Branch (3804:11): [True: 10, False: 0]
  ------------------
 3805|     10|          (frame->hd.flags & NGHTTP2_FLAG_END_STREAM)) {
  ------------------
  |  Branch (3805:11): [True: 5, False: 5]
  ------------------
 3806|      5|        nghttp2_stream_shutdown(stream, NGHTTP2_SHUT_RD);
 3807|       |        /* Don't call nghttp2_session_close_stream_if_shut_rdwr
 3808|       |           because RST_STREAM has been submitted. */
 3809|      5|      }
 3810|       |
 3811|     10|      return 0;
 3812|     10|    }
 3813|    250|  }
 3814|       |
 3815|    240|  rv = session_call_on_frame_received(session, frame);
 3816|    240|  if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (3816:7): [True: 0, False: 240]
  ------------------
 3817|      0|    return rv;
 3818|      0|  }
 3819|       |
 3820|    240|  if (frame->hd.type != NGHTTP2_HEADERS) {
  ------------------
  |  Branch (3820:7): [True: 0, False: 240]
  ------------------
 3821|      0|    return 0;
 3822|      0|  }
 3823|       |
 3824|    240|  return session_end_stream_headers_received(session, frame, stream);
 3825|    240|}
nghttp2_session.c:session_end_stream_headers_received:
 3704|    240|                                               nghttp2_stream *stream) {
 3705|    240|  int rv;
 3706|       |
 3707|    240|  assert(frame->hd.type == NGHTTP2_HEADERS);
  ------------------
  |  Branch (3707:3): [True: 0, False: 240]
  |  Branch (3707:3): [True: 240, False: 0]
  ------------------
 3708|       |
 3709|    240|  if (session->server && session_enforce_http_messaging(session) &&
  ------------------
  |  Branch (3709:7): [True: 0, False: 240]
  |  Branch (3709:26): [True: 0, False: 0]
  ------------------
 3710|      0|      frame->headers.cat == NGHTTP2_HCAT_REQUEST &&
  ------------------
  |  Branch (3710:7): [True: 0, False: 0]
  ------------------
 3711|      0|      !(stream->flags & NGHTTP2_STREAM_FLAG_IGNORE_CLIENT_PRIORITIES) &&
  ------------------
  |  Branch (3711:7): [True: 0, False: 0]
  ------------------
 3712|      0|      (stream->http_flags & NGHTTP2_HTTP_FLAG_PRIORITY)) {
  ------------------
  |  Branch (3712:7): [True: 0, False: 0]
  ------------------
 3713|      0|    rv = session_update_stream_priority(session, stream, stream->http_extpri);
 3714|      0|    if (rv != 0) {
  ------------------
  |  Branch (3714:9): [True: 0, False: 0]
  ------------------
 3715|      0|      assert(nghttp2_is_fatal(rv));
  ------------------
  |  Branch (3715:7): [True: 0, False: 0]
  |  Branch (3715:7): [True: 0, False: 0]
  ------------------
 3716|      0|      return rv;
 3717|      0|    }
 3718|      0|  }
 3719|       |
 3720|    240|  if ((frame->hd.flags & NGHTTP2_FLAG_END_STREAM) == 0) {
  ------------------
  |  Branch (3720:7): [True: 222, False: 18]
  ------------------
 3721|    222|    return 0;
 3722|    222|  }
 3723|       |
 3724|     18|  nghttp2_stream_shutdown(stream, NGHTTP2_SHUT_RD);
 3725|     18|  rv = nghttp2_session_close_stream_if_shut_rdwr(session, stream);
 3726|     18|  if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (3726:7): [True: 0, False: 18]
  ------------------
 3727|      0|    return rv;
 3728|      0|  }
 3729|       |
 3730|     18|  return 0;
 3731|     18|}
nghttp2_session.c:session_handle_frame_size_error:
 3356|     72|static int session_handle_frame_size_error(nghttp2_session *session) {
 3357|       |  /* TODO Currently no callback is called for this error, because we
 3358|       |     call this callback before reading any payload */
 3359|     72|  return nghttp2_session_terminate_session(session, NGHTTP2_FRAME_SIZE_ERROR);
 3360|     72|}
nghttp2_session.c:inbound_frame_set_settings_entry:
 5308|  12.2k|static void inbound_frame_set_settings_entry(nghttp2_inbound_frame *iframe) {
 5309|  12.2k|  nghttp2_settings_entry iv;
 5310|  12.2k|  nghttp2_settings_entry *min_header_table_size_entry;
 5311|  12.2k|  size_t i;
 5312|       |
 5313|  12.2k|  nghttp2_frame_unpack_settings_entry(&iv, iframe->sbuf.pos);
 5314|       |
 5315|  12.2k|  switch (iv.settings_id) {
 5316|    588|  case NGHTTP2_SETTINGS_HEADER_TABLE_SIZE:
  ------------------
  |  Branch (5316:3): [True: 588, False: 11.6k]
  ------------------
 5317|    731|  case NGHTTP2_SETTINGS_ENABLE_PUSH:
  ------------------
  |  Branch (5317:3): [True: 143, False: 12.1k]
  ------------------
 5318|    897|  case NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS:
  ------------------
  |  Branch (5318:3): [True: 166, False: 12.0k]
  ------------------
 5319|  1.39k|  case NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE:
  ------------------
  |  Branch (5319:3): [True: 493, False: 11.7k]
  ------------------
 5320|  1.54k|  case NGHTTP2_SETTINGS_MAX_FRAME_SIZE:
  ------------------
  |  Branch (5320:3): [True: 152, False: 12.1k]
  ------------------
 5321|  1.63k|  case NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE:
  ------------------
  |  Branch (5321:3): [True: 94, False: 12.1k]
  ------------------
 5322|  1.70k|  case NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL:
  ------------------
  |  Branch (5322:3): [True: 73, False: 12.1k]
  ------------------
 5323|  1.76k|  case NGHTTP2_SETTINGS_NO_RFC7540_PRIORITIES:
  ------------------
  |  Branch (5323:3): [True: 60, False: 12.1k]
  ------------------
 5324|  1.76k|    break;
 5325|  10.4k|  default:
  ------------------
  |  Branch (5325:3): [True: 10.4k, False: 1.76k]
  ------------------
 5326|  10.4k|    DEBUGF("recv: unknown settings id=0x%02x\n", iv.settings_id);
  ------------------
  |  |   39|  10.4k|    do {                                                                       \
  |  |   40|  10.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 10.4k]
  |  |  ------------------
  ------------------
 5327|       |
 5328|  10.4k|    iframe->iv[iframe->niv++] = iv;
 5329|       |
 5330|  10.4k|    return;
 5331|  12.2k|  }
 5332|       |
 5333|  9.16k|  for (i = 0; i < iframe->niv; ++i) {
  ------------------
  |  Branch (5333:15): [True: 7.78k, False: 1.37k]
  ------------------
 5334|  7.78k|    if (iframe->iv[i].settings_id == iv.settings_id) {
  ------------------
  |  Branch (5334:9): [True: 394, False: 7.39k]
  ------------------
 5335|    394|      iframe->iv[i] = iv;
 5336|    394|      break;
 5337|    394|    }
 5338|  7.78k|  }
 5339|       |
 5340|  1.76k|  if (i == iframe->niv) {
  ------------------
  |  Branch (5340:7): [True: 1.37k, False: 394]
  ------------------
 5341|  1.37k|    iframe->iv[iframe->niv++] = iv;
 5342|  1.37k|  }
 5343|       |
 5344|  1.76k|  if (iv.settings_id == NGHTTP2_SETTINGS_HEADER_TABLE_SIZE) {
  ------------------
  |  Branch (5344:7): [True: 588, False: 1.18k]
  ------------------
 5345|       |    /* Keep track of minimum value of SETTINGS_HEADER_TABLE_SIZE */
 5346|    588|    min_header_table_size_entry = &iframe->iv[iframe->max_niv - 1];
 5347|       |
 5348|    588|    if (iv.value < min_header_table_size_entry->value) {
  ------------------
  |  Branch (5348:9): [True: 468, False: 120]
  ------------------
 5349|    468|      min_header_table_size_entry->value = iv.value;
 5350|    468|    }
 5351|    588|  }
 5352|  1.76k|}
nghttp2_session.c:session_process_settings_frame:
 4535|  4.34k|static int session_process_settings_frame(nghttp2_session *session) {
 4536|  4.34k|  nghttp2_inbound_frame *iframe = &session->iframe;
 4537|  4.34k|  nghttp2_frame *frame = &iframe->frame;
 4538|  4.34k|  size_t i;
 4539|  4.34k|  nghttp2_settings_entry min_header_size_entry;
 4540|       |
 4541|  4.34k|  if (iframe->max_niv) {
  ------------------
  |  Branch (4541:7): [True: 1.35k, False: 2.99k]
  ------------------
 4542|  1.35k|    min_header_size_entry = iframe->iv[iframe->max_niv - 1];
 4543|       |
 4544|  1.35k|    if (min_header_size_entry.value < UINT32_MAX) {
  ------------------
  |  Branch (4544:9): [True: 416, False: 938]
  ------------------
 4545|       |      /* If we have less value, then we must have
 4546|       |         SETTINGS_HEADER_TABLE_SIZE in i < iframe->niv */
 4547|  2.00k|      for (i = 0; i < iframe->niv; ++i) {
  ------------------
  |  Branch (4547:19): [True: 2.00k, False: 0]
  ------------------
 4548|  2.00k|        if (iframe->iv[i].settings_id == NGHTTP2_SETTINGS_HEADER_TABLE_SIZE) {
  ------------------
  |  Branch (4548:13): [True: 416, False: 1.58k]
  ------------------
 4549|    416|          break;
 4550|    416|        }
 4551|  2.00k|      }
 4552|       |
 4553|    416|      assert(i < iframe->niv);
  ------------------
  |  Branch (4553:7): [True: 0, False: 416]
  |  Branch (4553:7): [True: 416, False: 0]
  ------------------
 4554|       |
 4555|    416|      if (min_header_size_entry.value != iframe->iv[i].value) {
  ------------------
  |  Branch (4555:11): [True: 91, False: 325]
  ------------------
 4556|     91|        iframe->iv[iframe->niv++] = iframe->iv[i];
 4557|     91|        iframe->iv[i] = min_header_size_entry;
 4558|     91|      }
 4559|    416|    }
 4560|  1.35k|  }
 4561|       |
 4562|  4.34k|  nghttp2_frame_unpack_settings_payload(&frame->settings, iframe->iv,
 4563|  4.34k|                                        iframe->niv);
 4564|       |
 4565|  4.34k|  iframe->iv = NULL;
 4566|  4.34k|  iframe->niv = 0;
 4567|  4.34k|  iframe->max_niv = 0;
 4568|       |
 4569|  4.34k|  return nghttp2_session_on_settings_received(session, frame, 0 /* ACK */);
 4570|  4.34k|}
nghttp2_session.c:session_process_goaway_frame:
 4721|    493|static int session_process_goaway_frame(nghttp2_session *session) {
 4722|    493|  nghttp2_inbound_frame *iframe = &session->iframe;
 4723|    493|  nghttp2_frame *frame = &iframe->frame;
 4724|       |
 4725|    493|  nghttp2_frame_unpack_goaway_payload(&frame->goaway, iframe->sbuf.pos,
 4726|    493|                                      iframe->lbuf.pos,
 4727|    493|                                      nghttp2_buf_len(&iframe->lbuf));
  ------------------
  |  |   54|    493|#define nghttp2_buf_len(BUF) ((size_t)((BUF)->last - (BUF)->pos))
  ------------------
 4728|       |
 4729|    493|  nghttp2_buf_wrap_init(&iframe->lbuf, NULL, 0);
 4730|       |
 4731|    493|  return nghttp2_session_on_goaway_received(session, frame);
 4732|    493|}
nghttp2_session.c:session_update_connection_consumed_size:
 5187|  5.33k|                                                   size_t delta_size) {
 5188|  5.33k|  return session_update_consumed_size(
 5189|  5.33k|    session, &session->consumed_size, &session->recv_window_size,
 5190|  5.33k|    session->window_update_queued, 0, delta_size, session->local_window_size);
 5191|  5.33k|}
nghttp2_session.c:session_update_consumed_size:
 5144|  8.40k|                                        int32_t local_window_size) {
 5145|  8.40k|  int32_t recv_size;
 5146|  8.40k|  int rv;
 5147|       |
 5148|  8.40k|  if ((size_t)*consumed_size_ptr > NGHTTP2_MAX_WINDOW_SIZE - delta_size) {
  ------------------
  |  |  224|  8.40k|#define NGHTTP2_MAX_WINDOW_SIZE ((int32_t)((1U << 31) - 1))
  ------------------
  |  Branch (5148:7): [True: 0, False: 8.40k]
  ------------------
 5149|      0|    return nghttp2_session_terminate_session(session,
 5150|      0|                                             NGHTTP2_FLOW_CONTROL_ERROR);
 5151|      0|  }
 5152|       |
 5153|  8.40k|  *consumed_size_ptr += (int32_t)delta_size;
 5154|       |
 5155|  8.40k|  if (window_update_queued == 0) {
  ------------------
  |  Branch (5155:7): [True: 7.97k, False: 439]
  ------------------
 5156|       |    /* recv_window_size may be smaller than consumed_size, because it
 5157|       |       may be decreased by negative value with
 5158|       |       nghttp2_submit_window_update(). */
 5159|  7.97k|    recv_size = nghttp2_min_int32(*consumed_size_ptr, *recv_window_size_ptr);
 5160|       |
 5161|  7.97k|    if (nghttp2_should_send_window_update(local_window_size, recv_size)) {
  ------------------
  |  Branch (5161:9): [True: 0, False: 7.97k]
  ------------------
 5162|      0|      rv = nghttp2_session_add_window_update(session, NGHTTP2_FLAG_NONE,
 5163|      0|                                             stream_id, recv_size);
 5164|       |
 5165|      0|      if (rv != 0) {
  ------------------
  |  Branch (5165:11): [True: 0, False: 0]
  ------------------
 5166|      0|        return rv;
 5167|      0|      }
 5168|       |
 5169|      0|      *recv_window_size_ptr -= recv_size;
 5170|      0|      *consumed_size_ptr -= recv_size;
 5171|      0|    }
 5172|  7.97k|  }
 5173|       |
 5174|  8.40k|  return 0;
 5175|  8.40k|}
nghttp2_session.c:session_process_data_frame:
 5052|    310|static int session_process_data_frame(nghttp2_session *session) {
 5053|    310|  int rv;
 5054|    310|  nghttp2_frame *public_data_frame = &session->iframe.frame;
 5055|    310|  rv = nghttp2_session_on_data_received(session, public_data_frame);
 5056|    310|  if (nghttp2_is_fatal(rv)) {
  ------------------
  |  Branch (5056:7): [True: 0, False: 310]
  ------------------
 5057|      0|    return rv;
 5058|      0|  }
 5059|    310|  return 0;
 5060|    310|}
nghttp2_session.c:session_get_num_active_streams:
 7121|  3.57M|static size_t session_get_num_active_streams(nghttp2_session *session) {
 7122|  3.57M|  return nghttp2_map_size(&session->streams) - session->num_closed_streams -
 7123|  3.57M|         session->num_idle_streams;
 7124|  3.57M|}
nghttp2_session.c:session_sched_empty:
  955|  6.53M|static int session_sched_empty(nghttp2_session *session) {
  956|  6.53M|  size_t i;
  957|       |
  958|  53.0M|  for (i = 0; i < NGHTTP2_EXTPRI_URGENCY_LEVELS; ++i) {
  ------------------
  |  | 5028|  53.0M|#define NGHTTP2_EXTPRI_URGENCY_LEVELS (NGHTTP2_EXTPRI_URGENCY_LOW + 1)
  |  |  ------------------
  |  |  |  | 5020|  53.0M|#define NGHTTP2_EXTPRI_URGENCY_LOW 7
  |  |  ------------------
  ------------------
  |  Branch (958:15): [True: 47.6M, False: 5.38M]
  ------------------
  959|  47.6M|    if (!nghttp2_pq_empty(&session->sched[i].ob_data)) {
  ------------------
  |  Branch (959:9): [True: 1.14M, False: 46.5M]
  ------------------
  960|  1.14M|      return 0;
  961|  1.14M|    }
  962|  47.6M|  }
  963|       |
  964|  5.38M|  return 1;
  965|  6.53M|}
nghttp2_session.c:inflight_settings_new:
  758|  4.44k|                                 nghttp2_mem *mem) {
  759|  4.44k|  *settings_ptr = nghttp2_mem_malloc(mem, sizeof(nghttp2_inflight_settings));
  760|  4.44k|  if (!*settings_ptr) {
  ------------------
  |  Branch (760:7): [True: 0, False: 4.44k]
  ------------------
  761|      0|    return NGHTTP2_ERR_NOMEM;
  762|      0|  }
  763|       |
  764|  4.44k|  if (niv > 0) {
  ------------------
  |  Branch (764:7): [True: 4.44k, False: 0]
  ------------------
  765|  4.44k|    (*settings_ptr)->iv = nghttp2_frame_iv_copy(iv, niv, mem);
  766|  4.44k|    if (!(*settings_ptr)->iv) {
  ------------------
  |  Branch (766:9): [True: 0, False: 4.44k]
  ------------------
  767|      0|      nghttp2_mem_free(mem, *settings_ptr);
  768|      0|      return NGHTTP2_ERR_NOMEM;
  769|      0|    }
  770|  4.44k|  } else {
  771|      0|    (*settings_ptr)->iv = NULL;
  772|      0|  }
  773|       |
  774|  4.44k|  (*settings_ptr)->niv = niv;
  775|  4.44k|  (*settings_ptr)->next = NULL;
  776|       |
  777|  4.44k|  return 0;
  778|  4.44k|}
nghttp2_session.c:session_append_inflight_settings:
 7303|  4.44k|                                 nghttp2_inflight_settings *settings) {
 7304|  4.44k|  nghttp2_inflight_settings **i;
 7305|       |
 7306|  4.44k|  for (i = &session->inflight_settings_head; *i; i = &(*i)->next)
  ------------------
  |  Branch (7306:46): [True: 0, False: 4.44k]
  ------------------
 7307|      0|    ;
 7308|       |
 7309|  4.44k|  *i = settings;
 7310|  4.44k|}
nghttp2_session.c:nghttp2_session_enforce_flow_control_limits:
 1759|    911|  nghttp2_ssize requested_window_size) {
 1760|    911|  DEBUGF("send: remote windowsize connection=%d, remote maxframsize=%u, "
  ------------------
  |  |   39|    911|    do {                                                                       \
  |  |   40|    911|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 911]
  |  |  ------------------
  ------------------
 1761|    911|         "stream(id %d)=%d\n",
 1762|    911|         session->remote_window_size, session->remote_settings.max_frame_size,
 1763|    911|         stream->stream_id, stream->remote_window_size);
 1764|       |
 1765|    911|  return nghttp2_min_int32(
 1766|    911|    nghttp2_min_int32(nghttp2_min_int32((int32_t)requested_window_size,
 1767|    911|                                        stream->remote_window_size),
 1768|    911|                      session->remote_window_size),
 1769|    911|    (int32_t)session->remote_settings.max_frame_size);
 1770|    911|}
nghttp2_session.c:session_call_select_padding:
 1842|  5.20k|                                                 size_t max_payloadlen) {
 1843|  5.20k|  nghttp2_ssize rv;
 1844|  5.20k|  size_t max_paddedlen;
 1845|       |
 1846|  5.20k|  if (frame->hd.length >= max_payloadlen ||
  ------------------
  |  Branch (1846:7): [True: 385, False: 4.82k]
  ------------------
 1847|  4.82k|      (!session->callbacks.select_padding_callback2 &&
  ------------------
  |  Branch (1847:8): [True: 4.82k, False: 0]
  ------------------
 1848|  5.20k|       !session->callbacks.select_padding_callback)) {
  ------------------
  |  Branch (1848:8): [True: 4.82k, False: 0]
  ------------------
 1849|  5.20k|    return (nghttp2_ssize)frame->hd.length;
 1850|  5.20k|  }
 1851|       |
 1852|      0|  max_paddedlen =
 1853|      0|    nghttp2_min_size(frame->hd.length + NGHTTP2_MAX_PADLEN, max_payloadlen);
  ------------------
  |  |   67|      0|#define NGHTTP2_MAX_PADLEN 256
  ------------------
 1854|       |
 1855|      0|  if (session->callbacks.select_padding_callback2) {
  ------------------
  |  Branch (1855:7): [True: 0, False: 0]
  ------------------
 1856|      0|    rv = session->callbacks.select_padding_callback2(
 1857|      0|      session, frame, max_paddedlen, session->user_data);
 1858|      0|  } else {
 1859|      0|    rv = (nghttp2_ssize)session->callbacks.select_padding_callback(
 1860|      0|      session, frame, max_paddedlen, session->user_data);
 1861|      0|  }
 1862|      0|  if (rv < (nghttp2_ssize)frame->hd.length ||
  ------------------
  |  Branch (1862:7): [True: 0, False: 0]
  ------------------
 1863|      0|      rv > (nghttp2_ssize)max_paddedlen) {
  ------------------
  |  Branch (1863:7): [True: 0, False: 0]
  ------------------
 1864|      0|    return NGHTTP2_ERR_CALLBACK_FAILURE;
 1865|      0|  }
 1866|      0|  return rv;
 1867|      0|}
nghttp2_session.c:session_reschedule_stream:
 2464|    803|                                      nghttp2_stream *stream) {
 2465|    803|  stream->last_writelen = stream->item->frame.hd.length;
 2466|       |
 2467|    803|  if (!session->server) {
  ------------------
  |  Branch (2467:7): [True: 803, False: 0]
  ------------------
 2468|    803|    return;
 2469|    803|  }
 2470|       |
 2471|      0|  session_sched_reschedule_stream(session, stream);
 2472|      0|}
nghttp2_session.c:session_resume_deferred_stream_item:
  926|     85|                                               uint8_t flags) {
  927|     85|  nghttp2_stream_resume_deferred_item(stream, flags);
  928|       |
  929|     85|  if (stream->flags & NGHTTP2_STREAM_FLAG_DEFERRED_ALL) {
  ------------------
  |  Branch (929:7): [True: 17, False: 68]
  ------------------
  930|     17|    return 0;
  931|     17|  }
  932|       |
  933|     68|  return session_ob_data_push(session, stream);
  934|     85|}
nghttp2_session.c:session_update_stream_consumed_size:
 5179|  3.07k|                                               size_t delta_size) {
 5180|  3.07k|  return session_update_consumed_size(
 5181|  3.07k|    session, &stream->consumed_size, &stream->recv_window_size,
 5182|  3.07k|    stream->window_update_queued, stream->stream_id, delta_size,
 5183|  3.07k|    stream->local_window_size);
 5184|  3.07k|}

nghttp2_stream_init:
   38|  4.40k|                         void *stream_user_data) {
   39|  4.40k|  stream->stream_id = stream_id;
   40|  4.40k|  stream->flags = flags;
   41|  4.40k|  stream->state = initial_state;
   42|  4.40k|  stream->shut_flags = NGHTTP2_SHUT_NONE;
   43|  4.40k|  stream->stream_user_data = stream_user_data;
   44|  4.40k|  stream->item = NULL;
   45|  4.40k|  stream->remote_window_size = remote_initial_window_size;
   46|  4.40k|  stream->local_window_size = local_initial_window_size;
   47|  4.40k|  stream->recv_window_size = 0;
   48|  4.40k|  stream->consumed_size = 0;
   49|  4.40k|  stream->recv_reduction = 0;
   50|  4.40k|  stream->window_update_queued = 0;
   51|       |
   52|  4.40k|  stream->closed_next = NULL;
   53|       |
   54|  4.40k|  stream->http_flags = NGHTTP2_HTTP_FLAG_NONE;
   55|  4.40k|  stream->content_length = -1;
   56|  4.40k|  stream->recv_content_length = 0;
   57|  4.40k|  stream->status_code = -1;
   58|       |
   59|  4.40k|  stream->queued = 0;
   60|  4.40k|  stream->cycle = 0;
   61|  4.40k|  stream->pending_penalty = 0;
   62|  4.40k|  stream->seq = 0;
   63|  4.40k|  stream->last_writelen = 0;
   64|       |
   65|  4.40k|  stream->extpri = stream->http_extpri = NGHTTP2_EXTPRI_DEFAULT_URGENCY;
  ------------------
  |  | 5004|  4.40k|#define NGHTTP2_EXTPRI_DEFAULT_URGENCY 3
  ------------------
   66|  4.40k|}
nghttp2_stream_free:
   68|  4.40k|void nghttp2_stream_free(nghttp2_stream *stream) { (void)stream; }
nghttp2_stream_shutdown:
   70|  4.53k|void nghttp2_stream_shutdown(nghttp2_stream *stream, nghttp2_shut_flag flag) {
   71|  4.53k|  stream->shut_flags = (uint8_t)(stream->shut_flags | flag);
   72|  4.53k|}
nghttp2_stream_attach_item:
   75|    487|                                nghttp2_outbound_item *item) {
   76|    487|  assert((stream->flags & NGHTTP2_STREAM_FLAG_DEFERRED_ALL) == 0);
  ------------------
  |  Branch (76:3): [True: 0, False: 487]
  |  Branch (76:3): [True: 487, False: 0]
  ------------------
   77|    487|  assert(stream->item == NULL);
  ------------------
  |  Branch (77:3): [True: 0, False: 487]
  |  Branch (77:3): [True: 487, False: 0]
  ------------------
   78|       |
   79|    487|  DEBUGF("stream: stream=%d attach item=%p\n", stream->stream_id, item);
  ------------------
  |  |   39|    487|    do {                                                                       \
  |  |   40|    487|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 487]
  |  |  ------------------
  ------------------
   80|       |
   81|    487|  stream->item = item;
   82|    487|}
nghttp2_stream_detach_item:
   84|    477|void nghttp2_stream_detach_item(nghttp2_stream *stream) {
   85|    477|  DEBUGF("stream: stream=%d detach item=%p\n", stream->stream_id, stream->item);
  ------------------
  |  |   39|    477|    do {                                                                       \
  |  |   40|    477|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 477]
  |  |  ------------------
  ------------------
   86|       |
   87|       |  stream->item = NULL;
   88|    477|  stream->flags = (uint8_t)(stream->flags & ~NGHTTP2_STREAM_FLAG_DEFERRED_ALL);
   89|    477|}
nghttp2_stream_defer_item:
   91|    108|void nghttp2_stream_defer_item(nghttp2_stream *stream, uint8_t flags) {
   92|    108|  assert(stream->item);
  ------------------
  |  Branch (92:3): [True: 0, False: 108]
  |  Branch (92:3): [True: 108, False: 0]
  ------------------
   93|       |
   94|    108|  DEBUGF("stream: stream=%d defer item=%p cause=%02x\n", stream->stream_id,
  ------------------
  |  |   39|    108|    do {                                                                       \
  |  |   40|    108|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 108]
  |  |  ------------------
  ------------------
   95|    108|         stream->item, flags);
   96|       |
   97|    108|  stream->flags |= flags;
   98|    108|}
nghttp2_stream_resume_deferred_item:
  101|     85|                                         uint8_t flags) {
  102|     85|  assert(stream->item);
  ------------------
  |  Branch (102:3): [True: 0, False: 85]
  |  Branch (102:3): [True: 85, False: 0]
  ------------------
  103|       |
  104|     85|  DEBUGF("stream: stream=%d resume item=%p flags=%02x\n", stream->stream_id,
  ------------------
  |  |   39|     85|    do {                                                                       \
  |  |   40|     85|    } while (0)
  |  |  ------------------
  |  |  |  Branch (40:14): [Folded, False: 85]
  |  |  ------------------
  ------------------
  105|     85|         stream->item, flags);
  106|       |
  107|     85|  stream->flags = (uint8_t)(stream->flags & ~flags);
  108|     85|}
nghttp2_stream_check_deferred_item:
  110|  2.98M|int nghttp2_stream_check_deferred_item(nghttp2_stream *stream) {
  111|  2.98M|  return stream->item && (stream->flags & NGHTTP2_STREAM_FLAG_DEFERRED_ALL);
  ------------------
  |  Branch (111:10): [True: 300k, False: 2.68M]
  |  Branch (111:26): [True: 85, False: 300k]
  ------------------
  112|  2.98M|}
nghttp2_stream_check_deferred_by_flow_control:
  114|    389|int nghttp2_stream_check_deferred_by_flow_control(nghttp2_stream *stream) {
  115|    389|  return stream->item &&
  ------------------
  |  Branch (115:10): [True: 35, False: 354]
  ------------------
  116|     35|         (stream->flags & NGHTTP2_STREAM_FLAG_DEFERRED_FLOW_CONTROL);
  ------------------
  |  Branch (116:10): [True: 0, False: 35]
  ------------------
  117|    389|}
nghttp2_stream_update_remote_initial_window_size:
  134|    368|  int32_t old_initial_window_size) {
  135|    368|  return update_initial_window_size(&stream->remote_window_size,
  136|    368|                                    new_initial_window_size,
  137|    368|                                    old_initial_window_size);
  138|    368|}
nghttp2_stream_update_local_initial_window_size:
  142|     44|  int32_t old_initial_window_size) {
  143|     44|  return update_initial_window_size(&stream->local_window_size,
  144|     44|                                    new_initial_window_size,
  145|     44|                                    old_initial_window_size);
  146|     44|}
nghttp2_stream.c:update_initial_window_size:
  121|    412|                                      int32_t old_initial_window_size) {
  122|    412|  int64_t new_window_size = (int64_t)(*window_size_ptr) +
  123|    412|                            new_initial_window_size - old_initial_window_size;
  124|    412|  if (INT32_MIN > new_window_size ||
  ------------------
  |  Branch (124:7): [True: 0, False: 412]
  ------------------
  125|    412|      new_window_size > NGHTTP2_MAX_WINDOW_SIZE) {
  ------------------
  |  |  224|    412|#define NGHTTP2_MAX_WINDOW_SIZE ((int32_t)((1U << 31) - 1))
  ------------------
  |  Branch (125:7): [True: 0, False: 412]
  ------------------
  126|      0|    return -1;
  127|      0|  }
  128|    412|  *window_size_ptr = (int32_t)new_window_size;
  129|    412|  return 0;
  130|    412|}

nghttp2_submit_rst_stream:
  181|  3.89k|                              int32_t stream_id, uint32_t error_code) {
  182|  3.89k|  (void)flags;
  183|       |
  184|  3.89k|  if (stream_id == 0) {
  ------------------
  |  Branch (184:7): [True: 0, False: 3.89k]
  ------------------
  185|      0|    return NGHTTP2_ERR_INVALID_ARGUMENT;
  186|      0|  }
  187|       |
  188|  3.89k|  return nghttp2_session_add_rst_stream_continue(
  189|  3.89k|    session, stream_id, error_code, /* continue_without_stream = */ 0);
  190|  3.89k|}
nghttp2_submit_goaway:
  194|  1.39k|                          const uint8_t *opaque_data, size_t opaque_data_len) {
  195|  1.39k|  (void)flags;
  196|       |
  197|  1.39k|  if (session->goaway_flags & NGHTTP2_GOAWAY_TERM_ON_SEND) {
  ------------------
  |  Branch (197:7): [True: 263, False: 1.12k]
  ------------------
  198|    263|    return 0;
  199|    263|  }
  200|  1.12k|  return nghttp2_session_add_goaway(session, last_stream_id, error_code,
  201|  1.12k|                                    opaque_data, opaque_data_len,
  202|  1.12k|                                    NGHTTP2_GOAWAY_AUX_NONE);
  203|  1.39k|}
nghttp2_submit_settings:
  218|  4.44k|                            const nghttp2_settings_entry *iv, size_t niv) {
  219|  4.44k|  (void)flags;
  220|  4.44k|  return nghttp2_session_add_settings(session, NGHTTP2_FLAG_NONE, iv, niv);
  221|  4.44k|}
nghttp2_submit_window_update:
  290|  4.30k|                                 int32_t window_size_increment) {
  291|  4.30k|  int rv;
  292|  4.30k|  nghttp2_stream *stream = 0;
  293|  4.30k|  (void)flags;
  294|       |
  295|  4.30k|  if (window_size_increment == 0) {
  ------------------
  |  Branch (295:7): [True: 0, False: 4.30k]
  ------------------
  296|      0|    return 0;
  297|      0|  }
  298|  4.30k|  if (stream_id == 0) {
  ------------------
  |  Branch (298:7): [True: 0, False: 4.30k]
  ------------------
  299|      0|    rv = nghttp2_adjust_local_window_size(
  300|      0|      &session->local_window_size, &session->recv_window_size,
  301|      0|      &session->recv_reduction, &window_size_increment);
  302|      0|    if (rv != 0) {
  ------------------
  |  Branch (302:9): [True: 0, False: 0]
  ------------------
  303|      0|      return rv;
  304|      0|    }
  305|  4.30k|  } else {
  306|  4.30k|    stream = nghttp2_session_get_stream(session, stream_id);
  307|  4.30k|    if (!stream) {
  ------------------
  |  Branch (307:9): [True: 0, False: 4.30k]
  ------------------
  308|      0|      return 0;
  309|      0|    }
  310|       |
  311|  4.30k|    rv = nghttp2_adjust_local_window_size(
  312|  4.30k|      &stream->local_window_size, &stream->recv_window_size,
  313|  4.30k|      &stream->recv_reduction, &window_size_increment);
  314|  4.30k|    if (rv != 0) {
  ------------------
  |  Branch (314:9): [True: 20, False: 4.28k]
  ------------------
  315|     20|      return rv;
  316|     20|    }
  317|  4.30k|  }
  318|       |
  319|  4.28k|  if (window_size_increment > 0) {
  ------------------
  |  Branch (319:7): [True: 4.28k, False: 0]
  ------------------
  320|  4.28k|    if (stream_id == 0) {
  ------------------
  |  Branch (320:9): [True: 0, False: 4.28k]
  ------------------
  321|      0|      session->consumed_size =
  322|      0|        nghttp2_max_int32(0, session->consumed_size - window_size_increment);
  323|  4.28k|    } else {
  324|  4.28k|      stream->consumed_size =
  325|  4.28k|        nghttp2_max_int32(0, stream->consumed_size - window_size_increment);
  326|  4.28k|    }
  327|       |
  328|  4.28k|    return nghttp2_session_add_window_update(session, 0, stream_id,
  329|  4.28k|                                             window_size_increment);
  330|  4.28k|  }
  331|      0|  return 0;
  332|  4.28k|}
nghttp2_session_set_local_window_size:
  336|  9.01k|                                          int32_t window_size) {
  337|  9.01k|  int32_t window_size_increment;
  338|  9.01k|  nghttp2_stream *stream;
  339|  9.01k|  int rv;
  340|  9.01k|  (void)flags;
  341|       |
  342|  9.01k|  if (window_size < 0) {
  ------------------
  |  Branch (342:7): [True: 0, False: 9.01k]
  ------------------
  343|      0|    return NGHTTP2_ERR_INVALID_ARGUMENT;
  344|      0|  }
  345|       |
  346|  9.01k|  if (stream_id == 0) {
  ------------------
  |  Branch (346:7): [True: 4.44k, False: 4.56k]
  ------------------
  347|  4.44k|    window_size_increment = window_size - session->local_window_size;
  348|       |
  349|  4.44k|    if (window_size_increment == 0) {
  ------------------
  |  Branch (349:9): [True: 0, False: 4.44k]
  ------------------
  350|      0|      return 0;
  351|      0|    }
  352|       |
  353|  4.44k|    if (window_size_increment < 0) {
  ------------------
  |  Branch (353:9): [True: 0, False: 4.44k]
  ------------------
  354|      0|      return nghttp2_adjust_local_window_size(
  355|      0|        &session->local_window_size, &session->recv_window_size,
  356|      0|        &session->recv_reduction, &window_size_increment);
  357|      0|    }
  358|       |
  359|  4.44k|    rv = nghttp2_increase_local_window_size(
  360|  4.44k|      &session->local_window_size, &session->recv_window_size,
  361|  4.44k|      &session->recv_reduction, &window_size_increment);
  362|       |
  363|  4.44k|    if (rv != 0) {
  ------------------
  |  Branch (363:9): [True: 0, False: 4.44k]
  ------------------
  364|      0|      return rv;
  365|      0|    }
  366|       |
  367|  4.44k|    if (window_size_increment > 0) {
  ------------------
  |  Branch (367:9): [True: 4.44k, False: 0]
  ------------------
  368|  4.44k|      return nghttp2_session_add_window_update(session, 0, stream_id,
  369|  4.44k|                                               window_size_increment);
  370|  4.44k|    }
  371|       |
  372|      0|    return nghttp2_session_update_recv_connection_window_size(session, 0);
  373|  4.56k|  } else {
  374|  4.56k|    stream = nghttp2_session_get_stream(session, stream_id);
  375|       |
  376|  4.56k|    if (stream == NULL) {
  ------------------
  |  Branch (376:9): [True: 0, False: 4.56k]
  ------------------
  377|      0|      return 0;
  378|      0|    }
  379|       |
  380|  4.56k|    window_size_increment = window_size - stream->local_window_size;
  381|       |
  382|  4.56k|    if (window_size_increment == 0) {
  ------------------
  |  Branch (382:9): [True: 1, False: 4.56k]
  ------------------
  383|      1|      return 0;
  384|      1|    }
  385|       |
  386|  4.56k|    if (window_size_increment < 0) {
  ------------------
  |  Branch (386:9): [True: 257, False: 4.30k]
  ------------------
  387|    257|      return nghttp2_adjust_local_window_size(
  388|    257|        &stream->local_window_size, &stream->recv_window_size,
  389|    257|        &stream->recv_reduction, &window_size_increment);
  390|    257|    }
  391|       |
  392|  4.30k|    rv = nghttp2_increase_local_window_size(
  393|  4.30k|      &stream->local_window_size, &stream->recv_window_size,
  394|  4.30k|      &stream->recv_reduction, &window_size_increment);
  395|       |
  396|  4.30k|    if (rv != 0) {
  ------------------
  |  Branch (396:9): [True: 0, False: 4.30k]
  ------------------
  397|      0|      return rv;
  398|      0|    }
  399|       |
  400|  4.30k|    if (window_size_increment > 0) {
  ------------------
  |  Branch (400:9): [True: 4.29k, False: 13]
  ------------------
  401|  4.29k|      return nghttp2_session_add_window_update(session, 0, stream_id,
  402|  4.29k|                                               window_size_increment);
  403|  4.29k|    }
  404|       |
  405|     13|    return nghttp2_session_update_recv_stream_window_size(session, stream, 0,
  406|     13|                                                          1);
  407|  4.30k|  }
  408|  9.01k|}
nghttp2_submit_request:
  679|  4.40k|                               void *stream_user_data) {
  680|  4.40k|  nghttp2_data_provider_wrap dpw;
  681|  4.40k|  (void)pri_spec;
  682|       |
  683|  4.40k|  return submit_request_shared(session, nva, nvlen,
  684|  4.40k|                               nghttp2_data_provider_wrap_v1(&dpw, data_prd),
  685|  4.40k|                               stream_user_data);
  686|  4.40k|}
nghttp2_submit_data_shared:
  747|    487|                               const nghttp2_data_provider_wrap *dpw) {
  748|    487|  int rv;
  749|    487|  nghttp2_outbound_item *item;
  750|    487|  nghttp2_frame *frame;
  751|    487|  nghttp2_data_aux_data *aux_data;
  752|    487|  uint8_t nflags = flags & NGHTTP2_FLAG_END_STREAM;
  753|    487|  nghttp2_mem *mem;
  754|       |
  755|    487|  mem = &session->mem;
  756|       |
  757|    487|  if (stream_id == 0) {
  ------------------
  |  Branch (757:7): [True: 0, False: 487]
  ------------------
  758|      0|    return NGHTTP2_ERR_INVALID_ARGUMENT;
  759|      0|  }
  760|       |
  761|    487|  item = nghttp2_mem_malloc(mem, sizeof(nghttp2_outbound_item));
  762|    487|  if (item == NULL) {
  ------------------
  |  Branch (762:7): [True: 0, False: 487]
  ------------------
  763|      0|    return NGHTTP2_ERR_NOMEM;
  764|      0|  }
  765|       |
  766|    487|  nghttp2_outbound_item_init(item);
  767|       |
  768|    487|  frame = &item->frame;
  769|    487|  aux_data = &item->aux_data.data;
  770|    487|  aux_data->dpw = *dpw;
  771|    487|  aux_data->eof = 0;
  772|    487|  aux_data->flags = nflags;
  773|       |
  774|       |  /* flags are sent on transmission */
  775|    487|  nghttp2_frame_data_init(&frame->data, NGHTTP2_FLAG_NONE, stream_id);
  776|       |
  777|    487|  rv = nghttp2_session_add_item(session, item);
  778|    487|  if (rv != 0) {
  ------------------
  |  Branch (778:7): [True: 0, False: 487]
  ------------------
  779|      0|    nghttp2_frame_data_free(&frame->data);
  780|      0|    nghttp2_mem_free(mem, item);
  781|      0|    return rv;
  782|      0|  }
  783|    487|  return 0;
  784|    487|}
nghttp2_pack_settings_payload:
  810|     29|                                      size_t niv) {
  811|     29|  return (ssize_t)nghttp2_pack_settings_payload2(buf, buflen, iv, niv);
  812|     29|}
nghttp2_pack_settings_payload2:
  816|     29|                                             size_t niv) {
  817|     29|  if (!nghttp2_iv_check(iv, niv)) {
  ------------------
  |  Branch (817:7): [True: 0, False: 29]
  ------------------
  818|      0|    return NGHTTP2_ERR_INVALID_ARGUMENT;
  819|      0|  }
  820|       |
  821|     29|  if (buflen < (niv * NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH)) {
  ------------------
  |  |   61|     29|#define NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH 6
  ------------------
  |  Branch (821:7): [True: 0, False: 29]
  ------------------
  822|      0|    return NGHTTP2_ERR_INSUFF_BUFSIZE;
  823|      0|  }
  824|       |
  825|     29|  return (nghttp2_ssize)nghttp2_frame_pack_settings_payload(buf, iv, niv);
  826|     29|}
nghttp2_submit.c:submit_headers_shared_nva:
  116|  4.40k|                                         void *stream_user_data) {
  117|  4.40k|  int rv;
  118|  4.40k|  nghttp2_nv *nva_copy;
  119|  4.40k|  nghttp2_mem *mem;
  120|       |
  121|  4.40k|  mem = &session->mem;
  122|       |
  123|  4.40k|  rv = nghttp2_nv_array_copy(&nva_copy, nva, nvlen, mem);
  124|  4.40k|  if (rv < 0) {
  ------------------
  |  Branch (124:7): [True: 0, False: 4.40k]
  ------------------
  125|      0|    return rv;
  126|      0|  }
  127|       |
  128|  4.40k|  return submit_headers_shared(session, flags, stream_id, nva_copy, nvlen, dpw,
  129|  4.40k|                               stream_user_data);
  130|  4.40k|}
nghttp2_submit.c:submit_headers_shared:
   42|  4.40k|                                     void *stream_user_data) {
   43|  4.40k|  int rv;
   44|  4.40k|  uint8_t flags_copy;
   45|  4.40k|  nghttp2_outbound_item *item = NULL;
   46|  4.40k|  nghttp2_frame *frame = NULL;
   47|  4.40k|  nghttp2_headers_category hcat;
   48|  4.40k|  nghttp2_mem *mem;
   49|       |
   50|  4.40k|  mem = &session->mem;
   51|       |
   52|  4.40k|  item = nghttp2_mem_malloc(mem, sizeof(nghttp2_outbound_item));
   53|  4.40k|  if (item == NULL) {
  ------------------
  |  Branch (53:7): [True: 0, False: 4.40k]
  ------------------
   54|      0|    rv = NGHTTP2_ERR_NOMEM;
   55|      0|    goto fail;
   56|      0|  }
   57|       |
   58|  4.40k|  nghttp2_outbound_item_init(item);
   59|       |
   60|  4.40k|  if (dpw != NULL && nghttp2_data_provider_wrap_contains_read_callback(dpw)) {
  ------------------
  |  Branch (60:7): [True: 487, False: 3.91k]
  |  Branch (60:22): [True: 487, False: 0]
  ------------------
   61|    487|    item->aux_data.headers.dpw = *dpw;
   62|    487|  }
   63|       |
   64|  4.40k|  item->aux_data.headers.stream_user_data = stream_user_data;
   65|       |
   66|  4.40k|  flags_copy =
   67|  4.40k|    (uint8_t)((flags & (NGHTTP2_FLAG_END_STREAM | NGHTTP2_FLAG_PRIORITY)) |
   68|  4.40k|              NGHTTP2_FLAG_END_HEADERS);
   69|       |
   70|  4.40k|  if (stream_id == -1) {
  ------------------
  |  Branch (70:7): [True: 4.40k, False: 0]
  ------------------
   71|  4.40k|    if (session->next_stream_id > INT32_MAX) {
  ------------------
  |  Branch (71:9): [True: 0, False: 4.40k]
  ------------------
   72|      0|      rv = NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE;
   73|      0|      goto fail;
   74|      0|    }
   75|       |
   76|  4.40k|    stream_id = (int32_t)session->next_stream_id;
   77|  4.40k|    session->next_stream_id += 2;
   78|       |
   79|  4.40k|    hcat = NGHTTP2_HCAT_REQUEST;
   80|  4.40k|  } else {
   81|       |    /* More specific categorization will be done later. */
   82|      0|    hcat = NGHTTP2_HCAT_HEADERS;
   83|      0|  }
   84|       |
   85|  4.40k|  frame = &item->frame;
   86|       |
   87|  4.40k|  nghttp2_frame_headers_init(&frame->headers, flags_copy, stream_id, hcat, NULL,
   88|  4.40k|                             nva_copy, nvlen);
   89|       |
   90|  4.40k|  rv = nghttp2_session_add_item(session, item);
   91|       |
   92|  4.40k|  if (rv != 0) {
  ------------------
  |  Branch (92:7): [True: 0, False: 4.40k]
  ------------------
   93|      0|    nghttp2_frame_headers_free(&frame->headers, mem);
   94|      0|    goto fail2;
   95|      0|  }
   96|       |
   97|  4.40k|  if (hcat == NGHTTP2_HCAT_REQUEST) {
  ------------------
  |  Branch (97:7): [True: 4.40k, False: 0]
  ------------------
   98|  4.40k|    return stream_id;
   99|  4.40k|  }
  100|       |
  101|      0|  return 0;
  102|       |
  103|      0|fail:
  104|       |  /* nghttp2_frame_headers_init() takes ownership of nva_copy. */
  105|      0|  nghttp2_nv_array_del(nva_copy, mem);
  106|      0|fail2:
  107|      0|  nghttp2_mem_free(mem, item);
  108|       |
  109|      0|  return rv;
  110|      0|}
nghttp2_submit.c:submit_request_shared:
  662|  4.40k|                                     void *stream_user_data) {
  663|  4.40k|  uint8_t flags;
  664|       |
  665|  4.40k|  if (session->server) {
  ------------------
  |  Branch (665:7): [True: 0, False: 4.40k]
  ------------------
  666|      0|    return NGHTTP2_ERR_PROTO;
  667|      0|  }
  668|       |
  669|  4.40k|  flags = set_request_flags(dpw);
  670|       |
  671|  4.40k|  return submit_headers_shared_nva(session, flags, -1, nva, nvlen, dpw,
  672|  4.40k|                                   stream_user_data);
  673|  4.40k|}
nghttp2_submit.c:set_request_flags:
  650|  4.40k|static uint8_t set_request_flags(const nghttp2_data_provider_wrap *dpw) {
  651|  4.40k|  uint8_t flags = NGHTTP2_FLAG_NONE;
  652|  4.40k|  if (dpw == NULL || !nghttp2_data_provider_wrap_contains_read_callback(dpw)) {
  ------------------
  |  Branch (652:7): [True: 3.91k, False: 487]
  |  Branch (652:22): [True: 0, False: 487]
  ------------------
  653|  3.91k|    flags |= NGHTTP2_FLAG_END_STREAM;
  654|  3.91k|  }
  655|       |
  656|  4.40k|  return flags;
  657|  4.40k|}

nghttp2_time_now_sec:
   48|  2.35k|uint64_t nghttp2_time_now_sec(void) {
   49|  2.35k|  struct timespec tp;
   50|  2.35k|  int rv = clock_gettime(CLOCK_MONOTONIC, &tp);
   51|       |
   52|  2.35k|  if (rv == -1) {
  ------------------
  |  Branch (52:7): [True: 0, False: 2.35k]
  ------------------
   53|      0|    return time_now_sec();
   54|      0|  }
   55|       |
   56|  2.35k|  return (uint64_t)tp.tv_sec;
   57|  2.35k|}

CRYPTO_malloc_array:
   19|  1.09M|{
   20|  1.09M|    size_t bytes;
   21|       |
   22|  1.09M|    if (ossl_unlikely(!ossl_size_mul(num, size, &bytes, file, line)))
  ------------------
  |  |   23|  1.09M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.09M]
  |  |  ------------------
  ------------------
   23|      0|        return NULL;
   24|       |
   25|  1.09M|    return CRYPTO_malloc(bytes, file, line);
   26|  1.09M|}
CRYPTO_calloc:
   29|  19.4M|{
   30|  19.4M|    size_t bytes;
   31|       |
   32|  19.4M|    if (ossl_unlikely(!ossl_size_mul(num, size, &bytes, file, line)))
  ------------------
  |  |   23|  19.4M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 19.4M]
  |  |  ------------------
  ------------------
   33|      0|        return NULL;
   34|       |
   35|  19.4M|    return CRYPTO_zalloc(bytes, file, line);
   36|  19.4M|}
CRYPTO_aligned_alloc_array:
   40|  1.57k|{
   41|  1.57k|    size_t bytes;
   42|       |
   43|  1.57k|    if (ossl_unlikely(!ossl_size_mul(num, size, &bytes, file, line))) {
  ------------------
  |  |   23|  1.57k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.57k]
  |  |  ------------------
  ------------------
   44|      0|        *freeptr = NULL;
   45|       |
   46|      0|        return NULL;
   47|      0|    }
   48|       |
   49|  1.57k|    return CRYPTO_aligned_alloc(bytes, align, freeptr, file, line);
   50|  1.57k|}
CRYPTO_realloc_array:
   54|   617k|{
   55|   617k|    size_t bytes;
   56|       |
   57|   617k|    if (ossl_unlikely(!ossl_size_mul(num, size, &bytes, file, line)))
  ------------------
  |  |   23|   617k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 617k]
  |  |  ------------------
  ------------------
   58|      0|        return NULL;
   59|       |
   60|   617k|    return CRYPTO_realloc(addr, bytes, file, line);
   61|   617k|}
CRYPTO_secure_calloc:
   87|  5.71k|{
   88|  5.71k|    size_t bytes;
   89|       |
   90|  5.71k|    if (ossl_unlikely(!ossl_size_mul(num, size, &bytes, file, line)))
  ------------------
  |  |   23|  5.71k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 5.71k]
  |  |  ------------------
  ------------------
   91|      0|        return NULL;
   92|       |
   93|  5.71k|    return CRYPTO_secure_zalloc(bytes, file, line);
   94|  5.71k|}

ossl_i2c_ASN1_BIT_STRING:
   22|  1.35M|{
   23|  1.35M|    int ret, j, bits, len;
   24|  1.35M|    unsigned char *p, *d;
   25|       |
   26|  1.35M|    if (a == NULL)
  ------------------
  |  Branch (26:9): [True: 0, False: 1.35M]
  ------------------
   27|      0|        return 0;
   28|       |
   29|  1.35M|    len = a->length;
   30|       |
   31|  1.35M|    if (len > 0) {
  ------------------
  |  Branch (31:9): [True: 1.35M, False: 0]
  ------------------
   32|  1.35M|        if (a->flags & ASN1_STRING_FLAG_BITS_LEFT) {
  ------------------
  |  |  164|  1.35M|#define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
  ------------------
  |  Branch (32:13): [True: 1.35M, False: 0]
  ------------------
   33|  1.35M|            bits = (int)a->flags & 0x07;
   34|  1.35M|        } else {
   35|      0|            for (; len > 0; len--) {
  ------------------
  |  Branch (35:20): [True: 0, False: 0]
  ------------------
   36|      0|                if (a->data[len - 1])
  ------------------
  |  Branch (36:21): [True: 0, False: 0]
  ------------------
   37|      0|                    break;
   38|      0|            }
   39|       |
   40|      0|            if (len == 0) {
  ------------------
  |  Branch (40:17): [True: 0, False: 0]
  ------------------
   41|      0|                bits = 0;
   42|      0|            } else {
   43|      0|                j = a->data[len - 1];
   44|      0|                if (j & 0x01)
  ------------------
  |  Branch (44:21): [True: 0, False: 0]
  ------------------
   45|      0|                    bits = 0;
   46|      0|                else if (j & 0x02)
  ------------------
  |  Branch (46:26): [True: 0, False: 0]
  ------------------
   47|      0|                    bits = 1;
   48|      0|                else if (j & 0x04)
  ------------------
  |  Branch (48:26): [True: 0, False: 0]
  ------------------
   49|      0|                    bits = 2;
   50|      0|                else if (j & 0x08)
  ------------------
  |  Branch (50:26): [True: 0, False: 0]
  ------------------
   51|      0|                    bits = 3;
   52|      0|                else if (j & 0x10)
  ------------------
  |  Branch (52:26): [True: 0, False: 0]
  ------------------
   53|      0|                    bits = 4;
   54|      0|                else if (j & 0x20)
  ------------------
  |  Branch (54:26): [True: 0, False: 0]
  ------------------
   55|      0|                    bits = 5;
   56|      0|                else if (j & 0x40)
  ------------------
  |  Branch (56:26): [True: 0, False: 0]
  ------------------
   57|      0|                    bits = 6;
   58|      0|                else if (j & 0x80)
  ------------------
  |  Branch (58:26): [True: 0, False: 0]
  ------------------
   59|      0|                    bits = 7;
   60|      0|                else
   61|      0|                    bits = 0; /* should not happen */
   62|      0|            }
   63|      0|        }
   64|  1.35M|    } else
   65|      0|        bits = 0;
   66|       |
   67|  1.35M|    ret = 1 + len;
   68|  1.35M|    if (pp == NULL)
  ------------------
  |  Branch (68:9): [True: 1.01M, False: 338k]
  ------------------
   69|  1.01M|        return ret;
   70|       |
   71|   338k|    p = *pp;
   72|       |
   73|   338k|    *(p++) = (unsigned char)bits;
   74|   338k|    d = a->data;
   75|   338k|    if (len > 0) {
  ------------------
  |  Branch (75:9): [True: 338k, False: 0]
  ------------------
   76|   338k|        memcpy(p, d, len);
   77|   338k|        p += len;
   78|   338k|        p[-1] &= (0xff << bits);
   79|   338k|    }
   80|   338k|    *pp = p;
   81|   338k|    return ret;
   82|  1.35M|}
ossl_c2i_ASN1_BIT_STRING:
   86|  1.98M|{
   87|  1.98M|    ASN1_BIT_STRING *ret = NULL;
   88|  1.98M|    const unsigned char *p;
   89|  1.98M|    unsigned char *s;
   90|  1.98M|    int i = 0;
   91|       |
   92|  1.98M|    if (len < 1) {
  ------------------
  |  Branch (92:9): [True: 0, False: 1.98M]
  ------------------
   93|      0|        i = ASN1_R_STRING_TOO_SHORT;
  ------------------
  |  |  114|      0|#define ASN1_R_STRING_TOO_SHORT 152
  ------------------
   94|      0|        goto err;
   95|      0|    }
   96|       |
   97|  1.98M|    if (len > INT_MAX) {
  ------------------
  |  Branch (97:9): [True: 0, False: 1.98M]
  ------------------
   98|      0|        i = ASN1_R_STRING_TOO_LONG;
  ------------------
  |  |  113|      0|#define ASN1_R_STRING_TOO_LONG 151
  ------------------
   99|      0|        goto err;
  100|      0|    }
  101|       |
  102|  1.98M|    if ((a == NULL) || ((*a) == NULL)) {
  ------------------
  |  Branch (102:9): [True: 0, False: 1.98M]
  |  Branch (102:24): [True: 746k, False: 1.23M]
  ------------------
  103|   746k|        if ((ret = ASN1_BIT_STRING_new()) == NULL)
  ------------------
  |  Branch (103:13): [True: 0, False: 746k]
  ------------------
  104|      0|            return NULL;
  105|   746k|    } else
  106|  1.23M|        ret = (*a);
  107|       |
  108|  1.98M|    p = *pp;
  109|  1.98M|    i = *(p++);
  110|  1.98M|    if (i > 7) {
  ------------------
  |  Branch (110:9): [True: 0, False: 1.98M]
  ------------------
  111|      0|        i = ASN1_R_INVALID_BIT_STRING_BITS_LEFT;
  ------------------
  |  |   70|      0|#define ASN1_R_INVALID_BIT_STRING_BITS_LEFT 220
  ------------------
  112|      0|        goto err;
  113|      0|    }
  114|       |    /*
  115|       |     * We do this to preserve the settings.  If we modify the settings, via
  116|       |     * the _set_bit function, we will recalculate on output
  117|       |     */
  118|  1.98M|    ossl_asn1_string_set_bits_left(ret, i);
  119|       |
  120|  1.98M|    if (len-- > 1) { /* using one because of the bits left byte */
  ------------------
  |  Branch (120:9): [True: 1.98M, False: 0]
  ------------------
  121|  1.98M|        s = OPENSSL_malloc((int)len);
  ------------------
  |  |  106|  1.98M|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  122|  1.98M|        if (s == NULL) {
  ------------------
  |  Branch (122:13): [True: 0, False: 1.98M]
  ------------------
  123|      0|            goto err;
  124|      0|        }
  125|  1.98M|        memcpy(s, p, (int)len);
  126|  1.98M|        s[len - 1] &= (0xff << i);
  127|  1.98M|        p += len;
  128|  1.98M|    } else
  129|      0|        s = NULL;
  130|       |
  131|  1.98M|    ASN1_STRING_set0(ret, s, (int)len);
  132|  1.98M|    ret->type = V_ASN1_BIT_STRING;
  ------------------
  |  |   67|  1.98M|#define V_ASN1_BIT_STRING 3
  ------------------
  133|  1.98M|    if (a != NULL)
  ------------------
  |  Branch (133:9): [True: 1.98M, False: 0]
  ------------------
  134|  1.98M|        (*a) = ret;
  135|  1.98M|    *pp = p;
  136|  1.98M|    return ret;
  137|      0|err:
  138|      0|    if (i != 0)
  ------------------
  |  Branch (138:9): [True: 0, False: 0]
  ------------------
  139|      0|        ERR_raise(ERR_LIB_ASN1, i);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  140|      0|    if ((a == NULL) || (*a != ret))
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  |  Branch (140:24): [True: 0, False: 0]
  ------------------
  141|      0|        ASN1_BIT_STRING_free(ret);
  142|       |    return NULL;
  143|  1.98M|}

asn1_d2i_read_bio:
  110|   824k|{
  111|   824k|    BUF_MEM *b;
  112|   824k|    unsigned char *p;
  113|   824k|    size_t want = HEADER_SIZE;
  ------------------
  |  |  107|   824k|#define HEADER_SIZE 8
  ------------------
  114|   824k|    uint32_t eos = 0;
  115|   824k|    size_t off = 0;
  116|   824k|    size_t len = 0;
  117|   824k|    size_t diff;
  118|       |
  119|   824k|    const unsigned char *q;
  120|   824k|    long slen;
  121|   824k|    int inf, tag, xclass;
  122|       |
  123|   824k|    b = BUF_MEM_new();
  124|   824k|    if (b == NULL) {
  ------------------
  |  Branch (124:9): [True: 0, False: 824k]
  ------------------
  125|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  126|      0|        return -1;
  127|      0|    }
  128|       |
  129|   824k|    ERR_set_mark();
  130|   824k|    for (;;) {
  131|   824k|        diff = len - off;
  132|   824k|        if (want >= diff) {
  ------------------
  |  Branch (132:13): [True: 824k, False: 0]
  ------------------
  133|   824k|            int i;
  134|       |
  135|   824k|            want -= diff;
  136|       |
  137|   824k|            if (len + want < len || !BUF_MEM_grow_clean(b, len + want)) {
  ------------------
  |  Branch (137:17): [True: 0, False: 824k]
  |  Branch (137:37): [True: 0, False: 824k]
  ------------------
  138|      0|                ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  139|      0|                goto err;
  140|      0|            }
  141|   824k|            i = BIO_read(in, &(b->data[len]), (int)want);
  142|   824k|            if (i < 0 && diff == 0) {
  ------------------
  |  Branch (142:17): [True: 0, False: 824k]
  |  Branch (142:26): [True: 0, False: 0]
  ------------------
  143|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  144|      0|                goto err;
  145|      0|            }
  146|   824k|            if (i > 0) {
  ------------------
  |  Branch (146:17): [True: 824k, False: 0]
  ------------------
  147|   824k|                if (len + i < len) {
  ------------------
  |  Branch (147:21): [True: 0, False: 824k]
  ------------------
  148|      0|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  149|      0|                    goto err;
  150|      0|                }
  151|   824k|                len += i;
  152|   824k|                if ((size_t)i < want)
  ------------------
  |  Branch (152:21): [True: 0, False: 824k]
  ------------------
  153|      0|                    continue;
  154|   824k|            }
  155|   824k|        }
  156|       |        /* else data already loaded */
  157|       |
  158|   824k|        p = (unsigned char *)&(b->data[off]);
  159|   824k|        q = p;
  160|   824k|        diff = len - off;
  161|   824k|        if (diff == 0)
  ------------------
  |  Branch (161:13): [True: 0, False: 824k]
  ------------------
  162|      0|            goto err;
  163|   824k|        inf = ASN1_get_object(&q, &slen, &tag, &xclass, (int)diff);
  164|   824k|        if (inf & 0x80) {
  ------------------
  |  Branch (164:13): [True: 824k, False: 0]
  ------------------
  165|   824k|            unsigned long e;
  166|       |
  167|   824k|            e = ERR_GET_REASON(ERR_peek_last_error());
  168|   824k|            if (e != ASN1_R_TOO_LONG)
  ------------------
  |  |  118|   824k|#define ASN1_R_TOO_LONG 155
  ------------------
  |  Branch (168:17): [True: 0, False: 824k]
  ------------------
  169|      0|                goto err;
  170|   824k|            ERR_pop_to_mark();
  171|   824k|            ERR_set_mark();
  172|   824k|        }
  173|   824k|        off += q - p; /* end of data */
  174|       |
  175|   824k|        if (inf & 1) {
  ------------------
  |  Branch (175:13): [True: 0, False: 824k]
  ------------------
  176|       |            /* no data body so go round again */
  177|      0|            if (eos == UINT32_MAX) {
  ------------------
  |  Branch (177:17): [True: 0, False: 0]
  ------------------
  178|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  179|      0|                goto err;
  180|      0|            }
  181|      0|            eos++;
  182|      0|            want = HEADER_SIZE;
  ------------------
  |  |  107|      0|#define HEADER_SIZE 8
  ------------------
  183|   824k|        } else if (eos && (slen == 0) && (tag == V_ASN1_EOC)) {
  ------------------
  |  |   64|      0|#define V_ASN1_EOC 0
  ------------------
  |  Branch (183:20): [True: 0, False: 824k]
  |  Branch (183:27): [True: 0, False: 0]
  |  Branch (183:42): [True: 0, False: 0]
  ------------------
  184|       |            /* eos value, so go back and read another header */
  185|      0|            eos--;
  186|      0|            if (eos == 0)
  ------------------
  |  Branch (186:17): [True: 0, False: 0]
  ------------------
  187|      0|                break;
  188|      0|            else
  189|      0|                want = HEADER_SIZE;
  ------------------
  |  |  107|      0|#define HEADER_SIZE 8
  ------------------
  190|   824k|        } else {
  191|       |            /* suck in slen bytes of data */
  192|   824k|            want = slen;
  193|   824k|            if (want > (len - off)) {
  ------------------
  |  Branch (193:17): [True: 824k, False: 0]
  ------------------
  194|   824k|                size_t chunk_max = ASN1_CHUNK_INITIAL_SIZE;
  ------------------
  |  |  108|   824k|#define ASN1_CHUNK_INITIAL_SIZE (16 * 1024)
  ------------------
  195|       |
  196|   824k|                want -= (len - off);
  197|   824k|                if (want > INT_MAX /* BIO_read takes an int length */ || len + want < len) {
  ------------------
  |  Branch (197:21): [True: 0, False: 824k]
  |  Branch (197:74): [True: 0, False: 824k]
  ------------------
  198|      0|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  199|      0|                    goto err;
  200|      0|                }
  201|  1.64M|                while (want > 0) {
  ------------------
  |  Branch (201:24): [True: 824k, False: 824k]
  ------------------
  202|       |                    /*
  203|       |                     * Read content in chunks of increasing size
  204|       |                     * so we can return an error for EOF without
  205|       |                     * having to allocate the entire content length
  206|       |                     * in one go.
  207|       |                     */
  208|   824k|                    size_t chunk = want > chunk_max ? chunk_max : want;
  ------------------
  |  Branch (208:36): [True: 0, False: 824k]
  ------------------
  209|   824k|                    int i;
  210|       |
  211|   824k|                    if (!BUF_MEM_grow_clean(b, len + chunk)) {
  ------------------
  |  Branch (211:25): [True: 0, False: 824k]
  ------------------
  212|      0|                        ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  213|      0|                        goto err;
  214|      0|                    }
  215|   824k|                    want -= chunk;
  216|  1.64M|                    while (chunk > 0) {
  ------------------
  |  Branch (216:28): [True: 824k, False: 824k]
  ------------------
  217|   824k|                        i = BIO_read(in, &(b->data[len]), (int)chunk);
  218|   824k|                        if (i <= 0) {
  ------------------
  |  Branch (218:29): [True: 0, False: 824k]
  ------------------
  219|      0|                            ERR_raise(ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  220|      0|                            goto err;
  221|      0|                        }
  222|       |                        /*
  223|       |                         * This can't overflow because |len+want| didn't
  224|       |                         * overflow.
  225|       |                         */
  226|   824k|                        len += i;
  227|   824k|                        chunk -= i;
  228|   824k|                    }
  229|   824k|                    if (chunk_max < INT_MAX / 2)
  ------------------
  |  Branch (229:25): [True: 824k, False: 0]
  ------------------
  230|   824k|                        chunk_max *= 2;
  231|   824k|                }
  232|   824k|            }
  233|   824k|            if (off + slen < off) {
  ------------------
  |  Branch (233:17): [True: 0, False: 824k]
  ------------------
  234|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  235|      0|                goto err;
  236|      0|            }
  237|   824k|            off += slen;
  238|   824k|            if (eos == 0) {
  ------------------
  |  Branch (238:17): [True: 824k, False: 0]
  ------------------
  239|   824k|                break;
  240|   824k|            } else
  241|      0|                want = HEADER_SIZE;
  ------------------
  |  |  107|      0|#define HEADER_SIZE 8
  ------------------
  242|   824k|        }
  243|   824k|    }
  244|       |
  245|   824k|    if (off > INT_MAX) {
  ------------------
  |  Branch (245:9): [True: 0, False: 824k]
  ------------------
  246|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  247|      0|        goto err;
  248|      0|    }
  249|       |
  250|   824k|    *pb = b;
  251|   824k|    ERR_clear_last_mark();
  252|   824k|    return (int)off;
  253|      0|err:
  254|      0|    ERR_clear_last_mark();
  255|      0|    BUF_MEM_free(b);
  256|      0|    return -1;
  257|   824k|}

ossl_asn1_item_digest_ex:
   57|   338k|{
   58|   338k|    int i, ret = 0;
   59|   338k|    unsigned char *str = NULL;
   60|   338k|    EVP_MD *fetched_md = (EVP_MD *)md;
   61|       |
   62|   338k|    i = ASN1_item_i2d(asn, &str, it);
   63|   338k|    if (i < 0 || str == NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 338k]
  |  Branch (63:18): [True: 0, False: 338k]
  ------------------
   64|      0|        return 0;
   65|       |
   66|   338k|    if (EVP_MD_get0_provider(md) == NULL) {
  ------------------
  |  Branch (66:9): [True: 338k, False: 0]
  ------------------
   67|   338k|#if !defined(OPENSSL_NO_ENGINE)
   68|   338k|        ENGINE *tmpeng = ENGINE_get_digest_engine(EVP_MD_get_type(md));
   69|       |
   70|   338k|        if (tmpeng != NULL)
  ------------------
  |  Branch (70:13): [True: 0, False: 338k]
  ------------------
   71|      0|            ENGINE_finish(tmpeng);
   72|   338k|        else
   73|   338k|#endif
   74|   338k|            fetched_md = EVP_MD_fetch(libctx, EVP_MD_get0_name(md), propq);
   75|   338k|    }
   76|   338k|    if (fetched_md == NULL)
  ------------------
  |  Branch (76:9): [True: 0, False: 338k]
  ------------------
   77|      0|        goto err;
   78|       |
   79|   338k|    ret = EVP_Digest(str, i, data, len, fetched_md, NULL);
   80|   338k|err:
   81|   338k|    OPENSSL_free(str);
  ------------------
  |  |  131|   338k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   82|   338k|    if (fetched_md != md)
  ------------------
  |  Branch (82:9): [True: 338k, False: 0]
  ------------------
   83|   338k|        EVP_MD_free(fetched_md);
   84|   338k|    return ret;
   85|   338k|}

ASN1_INTEGER_cmp:
   24|  11.5k|{
   25|  11.5k|    int neg, ret;
   26|       |    /* Compare signs */
   27|  11.5k|    neg = x->type & V_ASN1_NEG;
  ------------------
  |  |   99|  11.5k|#define V_ASN1_NEG 0x100
  ------------------
   28|  11.5k|    if (neg != (y->type & V_ASN1_NEG)) {
  ------------------
  |  |   99|  11.5k|#define V_ASN1_NEG 0x100
  ------------------
  |  Branch (28:9): [True: 0, False: 11.5k]
  ------------------
   29|      0|        if (neg)
  ------------------
  |  Branch (29:13): [True: 0, False: 0]
  ------------------
   30|      0|            return -1;
   31|      0|        else
   32|      0|            return 1;
   33|      0|    }
   34|       |
   35|  11.5k|    ret = ASN1_STRING_cmp(x, y);
   36|       |
   37|  11.5k|    if (neg)
  ------------------
  |  Branch (37:9): [True: 0, False: 11.5k]
  ------------------
   38|      0|        return -ret;
   39|  11.5k|    else
   40|  11.5k|        return ret;
   41|  11.5k|}
ossl_c2i_ASN1_INTEGER:
  301|   843k|{
  302|   843k|    ASN1_INTEGER *ret = NULL;
  303|   843k|    size_t r;
  304|   843k|    int neg;
  305|       |
  306|   843k|    r = c2i_ibuf(NULL, NULL, *pp, len);
  307|       |
  308|   843k|    if (r == 0)
  ------------------
  |  Branch (308:9): [True: 0, False: 843k]
  ------------------
  309|      0|        return NULL;
  310|       |
  311|   843k|    if ((a == NULL) || ((*a) == NULL)) {
  ------------------
  |  Branch (311:9): [True: 0, False: 843k]
  |  Branch (311:24): [True: 430k, False: 412k]
  ------------------
  312|   430k|        ret = ASN1_INTEGER_new();
  313|   430k|        if (ret == NULL)
  ------------------
  |  Branch (313:13): [True: 0, False: 430k]
  ------------------
  314|      0|            return NULL;
  315|   430k|        ret->type = V_ASN1_INTEGER;
  ------------------
  |  |   66|   430k|#define V_ASN1_INTEGER 2
  ------------------
  316|   430k|    } else
  317|   412k|        ret = *a;
  318|       |
  319|   843k|    if (r > INT_MAX || ASN1_STRING_set(ret, NULL, (int)r) == 0) {
  ------------------
  |  Branch (319:9): [True: 0, False: 843k]
  |  Branch (319:24): [True: 0, False: 843k]
  ------------------
  320|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  321|      0|        goto err;
  322|      0|    }
  323|       |
  324|   843k|    c2i_ibuf(ret->data, &neg, *pp, len);
  325|       |
  326|   843k|    if (neg != 0)
  ------------------
  |  Branch (326:9): [True: 0, False: 843k]
  ------------------
  327|      0|        ret->type |= V_ASN1_NEG;
  ------------------
  |  |   99|      0|#define V_ASN1_NEG 0x100
  ------------------
  328|   843k|    else
  329|   843k|        ret->type &= ~V_ASN1_NEG;
  ------------------
  |  |   99|   843k|#define V_ASN1_NEG 0x100
  ------------------
  330|       |
  331|   843k|    *pp += len;
  332|   843k|    if (a != NULL)
  ------------------
  |  Branch (332:9): [True: 843k, False: 0]
  ------------------
  333|   843k|        (*a) = ret;
  334|   843k|    return ret;
  335|      0|err:
  336|      0|    if (a == NULL || *a != ret)
  ------------------
  |  Branch (336:9): [True: 0, False: 0]
  |  Branch (336:22): [True: 0, False: 0]
  ------------------
  337|      0|        ASN1_INTEGER_free(ret);
  338|       |    return NULL;
  339|   843k|}
ASN1_INTEGER_get_int64:
  539|   345k|{
  540|   345k|    return asn1_string_get_int64(pr, a, V_ASN1_INTEGER);
  ------------------
  |  |   66|   345k|#define V_ASN1_INTEGER 2
  ------------------
  541|   345k|}
ASN1_INTEGER_get:
  564|   345k|{
  565|   345k|    int i;
  566|   345k|    int64_t r;
  567|   345k|    if (a == NULL)
  ------------------
  |  Branch (567:9): [True: 0, False: 345k]
  ------------------
  568|      0|        return 0;
  569|   345k|    i = ASN1_INTEGER_get_int64(&r, a);
  570|   345k|    if (i == 0)
  ------------------
  |  Branch (570:9): [True: 0, False: 345k]
  ------------------
  571|      0|        return -1;
  572|   345k|    if (r > LONG_MAX || r < LONG_MIN)
  ------------------
  |  Branch (572:9): [True: 0, False: 345k]
  |  Branch (572:25): [True: 0, False: 345k]
  ------------------
  573|      0|        return -1;
  574|   345k|    return (long)r;
  575|   345k|}
a_int.c:twos_complement:
   78|   371k|{
   79|   371k|    unsigned int carry = pad & 1;
   80|       |
   81|       |    /* Begin at the end of the encoding */
   82|   371k|    if (len != 0) {
  ------------------
  |  Branch (82:9): [True: 371k, False: 0]
  ------------------
   83|       |        /*
   84|       |         * if len == 0 then src/dst could be NULL, and this would be undefined
   85|       |         * behaviour.
   86|       |         */
   87|   371k|        dst += len;
   88|   371k|        src += len;
   89|   371k|    }
   90|       |    /* two's complement value: ~value + 1 */
   91|  5.27M|    while (len-- != 0) {
  ------------------
  |  Branch (91:12): [True: 4.90M, False: 371k]
  ------------------
   92|  4.90M|        *(--dst) = (unsigned char)(carry += *(--src) ^ pad);
   93|  4.90M|        carry >>= 8;
   94|  4.90M|    }
   95|   371k|}
a_int.c:c2i_ibuf:
  156|  1.68M|{
  157|  1.68M|    int neg, pad;
  158|       |    /* Zero content length is illegal */
  159|  1.68M|    if (plen == 0) {
  ------------------
  |  Branch (159:9): [True: 0, False: 1.68M]
  ------------------
  160|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  161|      0|        return 0;
  162|      0|    }
  163|  1.68M|    neg = p[0] & 0x80;
  164|  1.68M|    if (pneg)
  ------------------
  |  Branch (164:9): [True: 843k, False: 843k]
  ------------------
  165|   843k|        *pneg = neg;
  166|       |    /* Handle common case where length is 1 octet separately */
  167|  1.68M|    if (plen == 1) {
  ------------------
  |  Branch (167:9): [True: 943k, False: 742k]
  ------------------
  168|   943k|        if (b != NULL) {
  ------------------
  |  Branch (168:13): [True: 471k, False: 471k]
  ------------------
  169|   471k|            if (neg)
  ------------------
  |  Branch (169:17): [True: 0, False: 471k]
  ------------------
  170|      0|                b[0] = (p[0] ^ 0xFF) + 1;
  171|   471k|            else
  172|   471k|                b[0] = p[0];
  173|   471k|        }
  174|   943k|        return 1;
  175|   943k|    }
  176|       |
  177|   742k|    pad = 0;
  178|   742k|    if (p[0] == 0) {
  ------------------
  |  Branch (178:9): [True: 83.7k, False: 658k]
  ------------------
  179|  83.7k|        pad = 1;
  180|   658k|    } else if (p[0] == 0xFF) {
  ------------------
  |  Branch (180:16): [True: 0, False: 658k]
  ------------------
  181|      0|        size_t i;
  182|       |
  183|       |        /*
  184|       |         * Special case [of "one less minimal negative" for given length]:
  185|       |         * if any other bytes non zero it was padded, otherwise not.
  186|       |         */
  187|      0|        for (pad = 0, i = 1; i < plen; i++)
  ------------------
  |  Branch (187:30): [True: 0, False: 0]
  ------------------
  188|      0|            pad |= p[i];
  189|      0|        pad = pad != 0 ? 1 : 0;
  ------------------
  |  Branch (189:15): [True: 0, False: 0]
  ------------------
  190|      0|    }
  191|       |    /* reject illegal padding: first two octets MSB can't match */
  192|   742k|    if (pad && (neg == (p[1] & 0x80))) {
  ------------------
  |  Branch (192:9): [True: 83.7k, False: 658k]
  |  Branch (192:16): [True: 0, False: 83.7k]
  ------------------
  193|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_PADDING);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  194|      0|        return 0;
  195|      0|    }
  196|       |
  197|       |    /* skip over pad */
  198|   742k|    p += pad;
  199|   742k|    plen -= pad;
  200|       |
  201|   742k|    if (b != NULL)
  ------------------
  |  Branch (201:9): [True: 371k, False: 371k]
  ------------------
  202|   371k|        twos_complement(b, p, plen, neg ? 0xffU : 0);
  ------------------
  |  Branch (202:37): [True: 0, False: 371k]
  ------------------
  203|       |
  204|   742k|    return plen;
  205|   742k|}
a_int.c:asn1_string_get_int64:
  342|   345k|{
  343|   345k|    if (a == NULL) {
  ------------------
  |  Branch (343:9): [True: 0, False: 345k]
  ------------------
  344|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  345|      0|        return 0;
  346|      0|    }
  347|   345k|    if ((a->type & ~V_ASN1_NEG) != itype) {
  ------------------
  |  |   99|   345k|#define V_ASN1_NEG 0x100
  ------------------
  |  Branch (347:9): [True: 0, False: 345k]
  ------------------
  348|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_WRONG_INTEGER_TYPE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  349|      0|        return 0;
  350|      0|    }
  351|   345k|    return asn1_get_int64(pr, a->data, a->length, a->type & V_ASN1_NEG);
  ------------------
  |  |   99|   345k|#define V_ASN1_NEG 0x100
  ------------------
  352|   345k|}
a_int.c:asn1_get_int64:
  266|   345k|{
  267|   345k|    uint64_t r;
  268|   345k|    if (asn1_get_uint64(&r, b, blen) == 0)
  ------------------
  |  Branch (268:9): [True: 0, False: 345k]
  ------------------
  269|      0|        return 0;
  270|   345k|    if (neg) {
  ------------------
  |  Branch (270:9): [True: 0, False: 345k]
  ------------------
  271|      0|        if (r <= INT64_MAX) {
  ------------------
  |  Branch (271:13): [True: 0, False: 0]
  ------------------
  272|       |            /*
  273|       |             * Most significant bit is guaranteed to be clear, negation
  274|       |             * is guaranteed to be meaningful in platform-neutral sense.
  275|       |             */
  276|      0|            *pr = -(int64_t)r;
  277|      0|        } else if (r == ABS_INT64_MIN) {
  ------------------
  |  |  261|      0|#define ABS_INT64_MIN ((uint64_t)INT64_MAX + (-(INT64_MIN + INT64_MAX)))
  ------------------
  |  Branch (277:20): [True: 0, False: 0]
  ------------------
  278|       |            /*
  279|       |             * This never happens if INT64_MAX == ABS_INT64_MIN, e.g.
  280|       |             * on ones'-complement system.
  281|       |             */
  282|      0|            *pr = (int64_t)(0 - r);
  283|      0|        } else {
  284|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  285|      0|            return 0;
  286|      0|        }
  287|   345k|    } else {
  288|   345k|        if (r <= INT64_MAX) {
  ------------------
  |  Branch (288:13): [True: 345k, False: 0]
  ------------------
  289|   345k|            *pr = (int64_t)r;
  290|   345k|        } else {
  291|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  292|      0|            return 0;
  293|      0|        }
  294|   345k|    }
  295|   345k|    return 1;
  296|   345k|}
a_int.c:asn1_get_uint64:
  223|   345k|{
  224|   345k|    size_t i;
  225|   345k|    uint64_t r;
  226|       |
  227|   345k|    if (blen > sizeof(*pr)) {
  ------------------
  |  Branch (227:9): [True: 0, False: 345k]
  ------------------
  228|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  229|      0|        return 0;
  230|      0|    }
  231|   345k|    if (b == NULL)
  ------------------
  |  Branch (231:9): [True: 0, False: 345k]
  ------------------
  232|      0|        return 0;
  233|   690k|    for (r = 0, i = 0; i < blen; i++) {
  ------------------
  |  Branch (233:24): [True: 345k, False: 345k]
  ------------------
  234|   345k|        r <<= 8;
  235|   345k|        r |= b[i];
  236|   345k|    }
  237|   345k|    *pr = r;
  238|   345k|    return 1;
  239|   345k|}

ASN1_mbstring_copy:
   38|  2.98M|{
   39|  2.98M|    return ASN1_mbstring_ncopy(out, in, len, inform, mask, 0, 0);
   40|  2.98M|}
ASN1_mbstring_ncopy:
   45|  2.98M|{
   46|  2.98M|    int str_type;
   47|  2.98M|    int ret;
   48|  2.98M|    char free_out;
   49|  2.98M|    int outform, outlen = 0;
   50|  2.98M|    ASN1_STRING *dest;
   51|  2.98M|    unsigned char *p;
   52|  2.98M|    int nchar;
   53|  2.98M|    int (*cpyfunc)(unsigned long, void *) = NULL;
   54|  2.98M|    if (len == -1) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.98M]
  ------------------
   55|      0|        size_t len_s = strlen((const char *)in);
   56|       |
   57|      0|        if (len_s >= INT_MAX) {
  ------------------
  |  Branch (57:13): [True: 0, False: 0]
  ------------------
   58|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_STRING_TOO_LONG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   59|      0|            return -1;
   60|      0|        }
   61|      0|        len = (int)len_s;
   62|      0|    }
   63|  2.98M|    if (!mask)
  ------------------
  |  Branch (63:9): [True: 0, False: 2.98M]
  ------------------
   64|      0|        mask = DIRSTRING_TYPE;
  ------------------
  |  |  226|      0|    (B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING)
  |  |  ------------------
  |  |  |  |  105|      0|#define B_ASN1_PRINTABLESTRING 0x0002
  |  |  ------------------
  |  |                   (B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING)
  |  |  ------------------
  |  |  |  |  106|      0|#define B_ASN1_T61STRING 0x0004
  |  |  ------------------
  |  |                   (B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING)
  |  |  ------------------
  |  |  |  |  117|      0|#define B_ASN1_BMPSTRING 0x0800
  |  |  ------------------
  |  |                   (B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING)
  |  |  ------------------
  |  |  |  |  119|      0|#define B_ASN1_UTF8STRING 0x2000
  |  |  ------------------
  ------------------
   65|  2.98M|    if (len < 0) {
  ------------------
  |  Branch (65:9): [True: 0, False: 2.98M]
  ------------------
   66|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   67|      0|        return -1;
   68|      0|    }
   69|       |
   70|       |    /* First do a string check and work out the number of characters */
   71|  2.98M|    switch (inform) {
   72|       |
   73|      0|    case MBSTRING_BMP:
  ------------------
  |  |  127|      0|#define MBSTRING_BMP (MBSTRING_FLAG | 2)
  |  |  ------------------
  |  |  |  |  124|      0|#define MBSTRING_FLAG 0x1000
  |  |  ------------------
  ------------------
  |  Branch (73:5): [True: 0, False: 2.98M]
  ------------------
   74|      0|        if (len & 1) {
  ------------------
  |  Branch (74:13): [True: 0, False: 0]
  ------------------
   75|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_BMPSTRING_LENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   76|      0|            return -1;
   77|      0|        }
   78|      0|        nchar = len >> 1;
   79|      0|        break;
   80|       |
   81|      0|    case MBSTRING_UNIV:
  ------------------
  |  |  128|      0|#define MBSTRING_UNIV (MBSTRING_FLAG | 4)
  |  |  ------------------
  |  |  |  |  124|      0|#define MBSTRING_FLAG 0x1000
  |  |  ------------------
  ------------------
  |  Branch (81:5): [True: 0, False: 2.98M]
  ------------------
   82|      0|        if (len & 3) {
  ------------------
  |  Branch (82:13): [True: 0, False: 0]
  ------------------
   83|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   84|      0|            return -1;
   85|      0|        }
   86|      0|        nchar = len >> 2;
   87|      0|        break;
   88|       |
   89|   754k|    case MBSTRING_UTF8:
  ------------------
  |  |  125|   754k|#define MBSTRING_UTF8 (MBSTRING_FLAG)
  |  |  ------------------
  |  |  |  |  124|   754k|#define MBSTRING_FLAG 0x1000
  |  |  ------------------
  ------------------
  |  Branch (89:5): [True: 754k, False: 2.23M]
  ------------------
   90|   754k|        nchar = 0;
   91|       |        /* This counts the characters and does utf8 syntax checking */
   92|   754k|        ret = traverse_string(in, len, MBSTRING_UTF8, in_utf8, &nchar);
  ------------------
  |  |  125|   754k|#define MBSTRING_UTF8 (MBSTRING_FLAG)
  |  |  ------------------
  |  |  |  |  124|   754k|#define MBSTRING_FLAG 0x1000
  |  |  ------------------
  ------------------
   93|   754k|        if (ret < 0) {
  ------------------
  |  Branch (93:13): [True: 0, False: 754k]
  ------------------
   94|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_UTF8STRING);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   95|      0|            return -1;
   96|      0|        }
   97|   754k|        break;
   98|       |
   99|  2.23M|    case MBSTRING_ASC:
  ------------------
  |  |  126|  2.23M|#define MBSTRING_ASC (MBSTRING_FLAG | 1)
  |  |  ------------------
  |  |  |  |  124|  2.23M|#define MBSTRING_FLAG 0x1000
  |  |  ------------------
  ------------------
  |  Branch (99:5): [True: 2.23M, False: 754k]
  ------------------
  100|  2.23M|        nchar = len;
  101|  2.23M|        break;
  102|       |
  103|      0|    default:
  ------------------
  |  Branch (103:5): [True: 0, False: 2.98M]
  ------------------
  104|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_UNKNOWN_FORMAT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  105|      0|        return -1;
  106|  2.98M|    }
  107|       |
  108|  2.98M|    if ((minsize > 0) && (nchar < minsize)) {
  ------------------
  |  Branch (108:9): [True: 0, False: 2.98M]
  |  Branch (108:26): [True: 0, False: 0]
  ------------------
  109|      0|        ERR_raise_data(ERR_LIB_ASN1, ASN1_R_STRING_TOO_SHORT,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_ASN1, ASN1_R_STRING_TOO_SHORT,
  ------------------
  |  |   85|      0|#define ERR_LIB_ASN1 13
  ------------------
                      ERR_raise_data(ERR_LIB_ASN1, ASN1_R_STRING_TOO_SHORT,
  ------------------
  |  |  114|      0|#define ASN1_R_STRING_TOO_SHORT 152
  ------------------
  110|      0|            "minsize=%ld", minsize);
  111|      0|        return -1;
  112|      0|    }
  113|       |
  114|  2.98M|    if ((maxsize > 0) && (nchar > maxsize)) {
  ------------------
  |  Branch (114:9): [True: 0, False: 2.98M]
  |  Branch (114:26): [True: 0, False: 0]
  ------------------
  115|      0|        ERR_raise_data(ERR_LIB_ASN1, ASN1_R_STRING_TOO_LONG,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_ASN1, ASN1_R_STRING_TOO_LONG,
  ------------------
  |  |   85|      0|#define ERR_LIB_ASN1 13
  ------------------
                      ERR_raise_data(ERR_LIB_ASN1, ASN1_R_STRING_TOO_LONG,
  ------------------
  |  |  113|      0|#define ASN1_R_STRING_TOO_LONG 151
  ------------------
  116|      0|            "maxsize=%ld", maxsize);
  117|      0|        return -1;
  118|      0|    }
  119|       |
  120|       |    /* Now work out minimal type (if any) */
  121|  2.98M|    if (traverse_string(in, len, inform, type_str, &mask) < 0) {
  ------------------
  |  Branch (121:9): [True: 0, False: 2.98M]
  ------------------
  122|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_CHARACTERS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  123|      0|        return -1;
  124|      0|    }
  125|       |
  126|       |    /*
  127|       |     * Now work out output format and string type.
  128|       |     * These checks should be in sync with the checks in type_str.
  129|       |     */
  130|  2.98M|    outform = MBSTRING_ASC;
  ------------------
  |  |  126|  2.98M|#define MBSTRING_ASC (MBSTRING_FLAG | 1)
  |  |  ------------------
  |  |  |  |  124|  2.98M|#define MBSTRING_FLAG 0x1000
  |  |  ------------------
  ------------------
  131|  2.98M|    if (mask & B_ASN1_NUMERICSTRING)
  ------------------
  |  |  104|  2.98M|#define B_ASN1_NUMERICSTRING 0x0001
  ------------------
  |  Branch (131:9): [True: 0, False: 2.98M]
  ------------------
  132|      0|        str_type = V_ASN1_NUMERICSTRING;
  ------------------
  |  |   78|      0|#define V_ASN1_NUMERICSTRING 18
  ------------------
  133|  2.98M|    else if (mask & B_ASN1_PRINTABLESTRING)
  ------------------
  |  |  105|  2.98M|#define B_ASN1_PRINTABLESTRING 0x0002
  ------------------
  |  Branch (133:14): [True: 0, False: 2.98M]
  ------------------
  134|      0|        str_type = V_ASN1_PRINTABLESTRING;
  ------------------
  |  |   79|      0|#define V_ASN1_PRINTABLESTRING 19
  ------------------
  135|  2.98M|    else if (mask & B_ASN1_IA5STRING)
  ------------------
  |  |  109|  2.98M|#define B_ASN1_IA5STRING 0x0010
  ------------------
  |  Branch (135:14): [True: 0, False: 2.98M]
  ------------------
  136|      0|        str_type = V_ASN1_IA5STRING;
  ------------------
  |  |   83|      0|#define V_ASN1_IA5STRING 22
  ------------------
  137|  2.98M|    else if (mask & B_ASN1_T61STRING)
  ------------------
  |  |  106|  2.98M|#define B_ASN1_T61STRING 0x0004
  ------------------
  |  Branch (137:14): [True: 0, False: 2.98M]
  ------------------
  138|      0|        str_type = V_ASN1_T61STRING;
  ------------------
  |  |   80|      0|#define V_ASN1_T61STRING 20
  ------------------
  139|  2.98M|    else if (mask & B_ASN1_BMPSTRING) {
  ------------------
  |  |  117|  2.98M|#define B_ASN1_BMPSTRING 0x0800
  ------------------
  |  Branch (139:14): [True: 0, False: 2.98M]
  ------------------
  140|      0|        str_type = V_ASN1_BMPSTRING;
  ------------------
  |  |   91|      0|#define V_ASN1_BMPSTRING 30
  ------------------
  141|      0|        outform = MBSTRING_BMP;
  ------------------
  |  |  127|      0|#define MBSTRING_BMP (MBSTRING_FLAG | 2)
  |  |  ------------------
  |  |  |  |  124|      0|#define MBSTRING_FLAG 0x1000
  |  |  ------------------
  ------------------
  142|  2.98M|    } else if (mask & B_ASN1_UNIVERSALSTRING) {
  ------------------
  |  |  114|  2.98M|#define B_ASN1_UNIVERSALSTRING 0x0100
  ------------------
  |  Branch (142:16): [True: 0, False: 2.98M]
  ------------------
  143|      0|        str_type = V_ASN1_UNIVERSALSTRING;
  ------------------
  |  |   90|      0|#define V_ASN1_UNIVERSALSTRING 28
  ------------------
  144|      0|        outform = MBSTRING_UNIV;
  ------------------
  |  |  128|      0|#define MBSTRING_UNIV (MBSTRING_FLAG | 4)
  |  |  ------------------
  |  |  |  |  124|      0|#define MBSTRING_FLAG 0x1000
  |  |  ------------------
  ------------------
  145|  2.98M|    } else {
  146|  2.98M|        str_type = V_ASN1_UTF8STRING;
  ------------------
  |  |   75|  2.98M|#define V_ASN1_UTF8STRING 12
  ------------------
  147|  2.98M|        outform = MBSTRING_UTF8;
  ------------------
  |  |  125|  2.98M|#define MBSTRING_UTF8 (MBSTRING_FLAG)
  |  |  ------------------
  |  |  |  |  124|  2.98M|#define MBSTRING_FLAG 0x1000
  |  |  ------------------
  ------------------
  148|  2.98M|    }
  149|  2.98M|    if (!out)
  ------------------
  |  Branch (149:9): [True: 0, False: 2.98M]
  ------------------
  150|      0|        return str_type;
  151|  2.98M|    if (*out) {
  ------------------
  |  Branch (151:9): [True: 2.98M, False: 0]
  ------------------
  152|  2.98M|        free_out = 0;
  153|  2.98M|        dest = *out;
  154|  2.98M|        ASN1_STRING_set0(dest, NULL, 0);
  155|  2.98M|        dest->type = str_type;
  156|  2.98M|    } else {
  157|      0|        free_out = 1;
  158|      0|        dest = ASN1_STRING_type_new(str_type);
  159|      0|        if (dest == NULL) {
  ------------------
  |  Branch (159:13): [True: 0, False: 0]
  ------------------
  160|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  161|      0|            return -1;
  162|      0|        }
  163|      0|        *out = dest;
  164|      0|    }
  165|       |    /* If both the same type just copy across */
  166|  2.98M|    if (inform == outform) {
  ------------------
  |  Branch (166:9): [True: 754k, False: 2.23M]
  ------------------
  167|   754k|        if (!ASN1_STRING_set(dest, in, len)) {
  ------------------
  |  Branch (167:13): [True: 0, False: 754k]
  ------------------
  168|      0|            if (free_out) {
  ------------------
  |  Branch (168:17): [True: 0, False: 0]
  ------------------
  169|      0|                ASN1_STRING_free(dest);
  170|      0|                *out = NULL;
  171|      0|            }
  172|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  173|      0|            return -1;
  174|      0|        }
  175|   754k|        return str_type;
  176|   754k|    }
  177|       |
  178|       |    /* Work out how much space the destination will need */
  179|  2.23M|    switch (outform) {
  ------------------
  |  Branch (179:13): [True: 2.23M, False: 0]
  ------------------
  180|      0|    case MBSTRING_ASC:
  ------------------
  |  |  126|      0|#define MBSTRING_ASC (MBSTRING_FLAG | 1)
  |  |  ------------------
  |  |  |  |  124|      0|#define MBSTRING_FLAG 0x1000
  |  |  ------------------
  ------------------
  |  Branch (180:5): [True: 0, False: 2.23M]
  ------------------
  181|      0|        outlen = nchar;
  182|      0|        cpyfunc = cpy_asc;
  183|      0|        break;
  184|       |
  185|      0|    case MBSTRING_BMP:
  ------------------
  |  |  127|      0|#define MBSTRING_BMP (MBSTRING_FLAG | 2)
  |  |  ------------------
  |  |  |  |  124|      0|#define MBSTRING_FLAG 0x1000
  |  |  ------------------
  ------------------
  |  Branch (185:5): [True: 0, False: 2.23M]
  ------------------
  186|      0|        outlen = nchar << 1;
  187|      0|        cpyfunc = cpy_bmp;
  188|      0|        break;
  189|       |
  190|      0|    case MBSTRING_UNIV:
  ------------------
  |  |  128|      0|#define MBSTRING_UNIV (MBSTRING_FLAG | 4)
  |  |  ------------------
  |  |  |  |  124|      0|#define MBSTRING_FLAG 0x1000
  |  |  ------------------
  ------------------
  |  Branch (190:5): [True: 0, False: 2.23M]
  ------------------
  191|      0|        outlen = nchar << 2;
  192|      0|        cpyfunc = cpy_univ;
  193|      0|        break;
  194|       |
  195|  2.23M|    case MBSTRING_UTF8:
  ------------------
  |  |  125|  2.23M|#define MBSTRING_UTF8 (MBSTRING_FLAG)
  |  |  ------------------
  |  |  |  |  124|  2.23M|#define MBSTRING_FLAG 0x1000
  |  |  ------------------
  ------------------
  |  Branch (195:5): [True: 2.23M, False: 0]
  ------------------
  196|  2.23M|        outlen = 0;
  197|  2.23M|        ret = traverse_string(in, len, inform, out_utf8, &outlen);
  198|  2.23M|        if (ret < 0) {
  ------------------
  |  Branch (198:13): [True: 0, False: 2.23M]
  ------------------
  199|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_UTF8STRING);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  200|      0|            return -1;
  201|      0|        }
  202|  2.23M|        cpyfunc = cpy_utf8;
  203|  2.23M|        break;
  204|  2.23M|    }
  205|  2.23M|    if ((p = OPENSSL_malloc(outlen + 1)) == NULL) {
  ------------------
  |  |  106|  2.23M|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (205:9): [True: 0, False: 2.23M]
  ------------------
  206|      0|        if (free_out) {
  ------------------
  |  Branch (206:13): [True: 0, False: 0]
  ------------------
  207|      0|            ASN1_STRING_free(dest);
  208|      0|            *out = NULL;
  209|      0|        }
  210|      0|        return -1;
  211|      0|    }
  212|  2.23M|    dest->length = outlen;
  213|  2.23M|    dest->data = p;
  214|  2.23M|    p[outlen] = 0;
  215|  2.23M|    traverse_string(in, len, inform, cpyfunc, &p);
  216|  2.23M|    return str_type;
  217|  2.23M|}
a_mbstr.c:traverse_string:
  227|  8.20M|{
  228|  8.20M|    unsigned long value;
  229|  8.20M|    int ret;
  230|   135M|    while (len) {
  ------------------
  |  Branch (230:12): [True: 127M, False: 8.20M]
  ------------------
  231|   127M|        if (inform == MBSTRING_ASC) {
  ------------------
  |  |  126|   127M|#define MBSTRING_ASC (MBSTRING_FLAG | 1)
  |  |  ------------------
  |  |  |  |  124|   127M|#define MBSTRING_FLAG 0x1000
  |  |  ------------------
  ------------------
  |  Branch (231:13): [True: 96.5M, False: 31.1M]
  ------------------
  232|  96.5M|            value = *p++;
  233|  96.5M|            len--;
  234|  96.5M|        } else if (inform == MBSTRING_BMP) {
  ------------------
  |  |  127|  31.1M|#define MBSTRING_BMP (MBSTRING_FLAG | 2)
  |  |  ------------------
  |  |  |  |  124|  31.1M|#define MBSTRING_FLAG 0x1000
  |  |  ------------------
  ------------------
  |  Branch (234:20): [True: 0, False: 31.1M]
  ------------------
  235|      0|            value = *p++ << 8;
  236|      0|            value |= *p++;
  237|      0|            len -= 2;
  238|  31.1M|        } else if (inform == MBSTRING_UNIV) {
  ------------------
  |  |  128|  31.1M|#define MBSTRING_UNIV (MBSTRING_FLAG | 4)
  |  |  ------------------
  |  |  |  |  124|  31.1M|#define MBSTRING_FLAG 0x1000
  |  |  ------------------
  ------------------
  |  Branch (238:20): [True: 0, False: 31.1M]
  ------------------
  239|      0|            value = ((unsigned long)*p++) << 24;
  240|      0|            value |= ((unsigned long)*p++) << 16;
  241|      0|            value |= *p++ << 8;
  242|      0|            value |= *p++;
  243|      0|            len -= 4;
  244|  31.1M|        } else {
  245|  31.1M|            ret = UTF8_getc(p, len, &value);
  246|  31.1M|            if (ret < 0)
  ------------------
  |  Branch (246:17): [True: 0, False: 31.1M]
  ------------------
  247|      0|                return -1;
  248|  31.1M|            len -= ret;
  249|  31.1M|            p += ret;
  250|  31.1M|        }
  251|   127M|        if (rfunc) {
  ------------------
  |  Branch (251:13): [True: 127M, False: 0]
  ------------------
  252|   127M|            ret = rfunc(value, arg);
  253|   127M|            if (ret <= 0)
  ------------------
  |  Branch (253:17): [True: 0, False: 127M]
  ------------------
  254|      0|                return ret;
  255|   127M|        }
  256|   127M|    }
  257|  8.20M|    return 1;
  258|  8.20M|}
a_mbstr.c:in_utf8:
  265|  15.5M|{
  266|  15.5M|    int *nchar;
  267|       |
  268|  15.5M|    if (!is_unicode_valid(value))
  ------------------
  |  Branch (268:9): [True: 0, False: 15.5M]
  ------------------
  269|      0|        return -2;
  270|  15.5M|    nchar = arg;
  271|  15.5M|    (*nchar)++;
  272|  15.5M|    return 1;
  273|  15.5M|}
a_mbstr.c:out_utf8:
  278|  32.1M|{
  279|  32.1M|    int *outlen, len;
  280|       |
  281|  32.1M|    len = UTF8_putc(NULL, -1, value);
  282|  32.1M|    if (len <= 0)
  ------------------
  |  Branch (282:9): [True: 0, False: 32.1M]
  ------------------
  283|      0|        return len;
  284|  32.1M|    outlen = arg;
  285|  32.1M|    *outlen += len;
  286|  32.1M|    return 1;
  287|  32.1M|}
a_mbstr.c:type_str:
  295|  47.7M|{
  296|  47.7M|    unsigned long usable_types = *((unsigned long *)arg);
  297|  47.7M|    unsigned long types = usable_types;
  298|  47.7M|    const int native = value > INT_MAX ? INT_MAX : ossl_fromascii(value);
  ------------------
  |  |   57|  95.4M|#define ossl_fromascii(c) (c)
  ------------------
  |  Branch (298:24): [True: 0, False: 47.7M]
  ------------------
  299|       |
  300|       |    /*
  301|       |     * Clear out all the types which are not checked later. If any of those
  302|       |     * is present in the mask, then the UTF8 type will be added and checked
  303|       |     * below.
  304|       |     */
  305|  47.7M|    types &= B_ASN1_NUMERICSTRING | B_ASN1_PRINTABLESTRING
  ------------------
  |  |  104|  47.7M|#define B_ASN1_NUMERICSTRING 0x0001
  ------------------
                  types &= B_ASN1_NUMERICSTRING | B_ASN1_PRINTABLESTRING
  ------------------
  |  |  105|  47.7M|#define B_ASN1_PRINTABLESTRING 0x0002
  ------------------
  306|  47.7M|        | B_ASN1_IA5STRING | B_ASN1_T61STRING | B_ASN1_BMPSTRING
  ------------------
  |  |  109|  47.7M|#define B_ASN1_IA5STRING 0x0010
  ------------------
                      | B_ASN1_IA5STRING | B_ASN1_T61STRING | B_ASN1_BMPSTRING
  ------------------
  |  |  106|  47.7M|#define B_ASN1_T61STRING 0x0004
  ------------------
                      | B_ASN1_IA5STRING | B_ASN1_T61STRING | B_ASN1_BMPSTRING
  ------------------
  |  |  117|  47.7M|#define B_ASN1_BMPSTRING 0x0800
  ------------------
  307|  47.7M|        | B_ASN1_UNIVERSALSTRING | B_ASN1_UTF8STRING;
  ------------------
  |  |  114|  47.7M|#define B_ASN1_UNIVERSALSTRING 0x0100
  ------------------
                      | B_ASN1_UNIVERSALSTRING | B_ASN1_UTF8STRING;
  ------------------
  |  |  119|  47.7M|#define B_ASN1_UTF8STRING 0x2000
  ------------------
  308|       |
  309|       |    /*
  310|       |     * If any other types were in the input mask, they're effectively treated
  311|       |     * as UTF8
  312|       |     */
  313|  47.7M|    if (types != usable_types)
  ------------------
  |  Branch (313:9): [True: 0, False: 47.7M]
  ------------------
  314|      0|        types |= B_ASN1_UTF8STRING;
  ------------------
  |  |  119|      0|#define B_ASN1_UTF8STRING 0x2000
  ------------------
  315|       |
  316|       |    /*
  317|       |     * These checks should be in sync with ASN1_mbstring_ncopy.
  318|       |     */
  319|  47.7M|    if ((types & B_ASN1_NUMERICSTRING) && !(ossl_isdigit(native) || native == ' '))
  ------------------
  |  |  104|  47.7M|#define B_ASN1_NUMERICSTRING 0x0001
  ------------------
  |  Branch (319:9): [True: 0, False: 47.7M]
  |  Branch (319:45): [True: 0, False: 0]
  |  Branch (319:69): [True: 0, False: 0]
  ------------------
  320|      0|        types &= ~B_ASN1_NUMERICSTRING;
  ------------------
  |  |  104|      0|#define B_ASN1_NUMERICSTRING 0x0001
  ------------------
  321|  47.7M|    if ((types & B_ASN1_PRINTABLESTRING) && !ossl_isasn1print(native))
  ------------------
  |  |  105|  47.7M|#define B_ASN1_PRINTABLESTRING 0x0002
  ------------------
                  if ((types & B_ASN1_PRINTABLESTRING) && !ossl_isasn1print(native))
  ------------------
  |  |   85|      0|#define ossl_isasn1print(c) (ossl_ctype_check((c), CTYPE_MASK_asn1print))
  |  |  ------------------
  |  |  |  |   38|      0|#define CTYPE_MASK_asn1print 0x800
  |  |  ------------------
  ------------------
  |  Branch (321:9): [True: 0, False: 47.7M]
  |  Branch (321:45): [True: 0, False: 0]
  ------------------
  322|      0|        types &= ~B_ASN1_PRINTABLESTRING;
  ------------------
  |  |  105|      0|#define B_ASN1_PRINTABLESTRING 0x0002
  ------------------
  323|  47.7M|    if ((types & B_ASN1_IA5STRING) && !ossl_isascii(native))
  ------------------
  |  |  109|  47.7M|#define B_ASN1_IA5STRING 0x0010
  ------------------
                  if ((types & B_ASN1_IA5STRING) && !ossl_isascii(native))
  ------------------
  |  |   75|      0|#define ossl_isascii(c) (((c) & ~127) == 0)
  ------------------
  |  Branch (323:9): [True: 0, False: 47.7M]
  |  Branch (323:39): [True: 0, False: 0]
  ------------------
  324|      0|        types &= ~B_ASN1_IA5STRING;
  ------------------
  |  |  109|      0|#define B_ASN1_IA5STRING 0x0010
  ------------------
  325|  47.7M|    if ((types & B_ASN1_T61STRING) && (value > 0xff))
  ------------------
  |  |  106|  47.7M|#define B_ASN1_T61STRING 0x0004
  ------------------
  |  Branch (325:9): [True: 0, False: 47.7M]
  |  Branch (325:39): [True: 0, False: 0]
  ------------------
  326|      0|        types &= ~B_ASN1_T61STRING;
  ------------------
  |  |  106|      0|#define B_ASN1_T61STRING 0x0004
  ------------------
  327|  47.7M|    if ((types & B_ASN1_BMPSTRING) && (value > 0xffff))
  ------------------
  |  |  117|  47.7M|#define B_ASN1_BMPSTRING 0x0800
  ------------------
  |  Branch (327:9): [True: 0, False: 47.7M]
  |  Branch (327:39): [True: 0, False: 0]
  ------------------
  328|      0|        types &= ~B_ASN1_BMPSTRING;
  ------------------
  |  |  117|      0|#define B_ASN1_BMPSTRING 0x0800
  ------------------
  329|  47.7M|    if ((types & B_ASN1_UTF8STRING) && !is_unicode_valid(value))
  ------------------
  |  |  119|  47.7M|#define B_ASN1_UTF8STRING 0x2000
  ------------------
  |  Branch (329:9): [True: 47.7M, False: 0]
  |  Branch (329:40): [True: 0, False: 47.7M]
  ------------------
  330|      0|        types &= ~B_ASN1_UTF8STRING;
  ------------------
  |  |  119|      0|#define B_ASN1_UTF8STRING 0x2000
  ------------------
  331|  47.7M|    if (!types)
  ------------------
  |  Branch (331:9): [True: 0, False: 47.7M]
  ------------------
  332|      0|        return -1;
  333|  47.7M|    *((unsigned long *)arg) = types;
  334|  47.7M|    return 1;
  335|  47.7M|}
a_mbstr.c:cpy_utf8:
  380|  32.1M|{
  381|  32.1M|    unsigned char **p;
  382|  32.1M|    int ret;
  383|  32.1M|    p = arg;
  384|       |    /* We already know there is enough room so pass 0xff as the length */
  385|  32.1M|    ret = UTF8_putc(*p, 0xff, value);
  386|  32.1M|    if (ret < 0)
  ------------------
  |  Branch (386:9): [True: 0, False: 32.1M]
  ------------------
  387|      0|        return ret;
  388|  32.1M|    *p += ret;
  389|  32.1M|    return 1;
  390|  32.1M|}

a2d_ASN1_OBJECT:
   52|  14.8k|{
   53|  14.8k|    int i, first, len = 0, c, use_bn;
   54|  14.8k|    char ftmp[24], *tmp = ftmp;
   55|  14.8k|    int tmpsize = sizeof(ftmp);
   56|  14.8k|    const char *p;
   57|  14.8k|    unsigned long l;
   58|  14.8k|    BIGNUM *bl = NULL;
   59|       |
   60|  14.8k|    if (num == 0) {
  ------------------
  |  Branch (60:9): [True: 0, False: 14.8k]
  ------------------
   61|      0|        return 0;
   62|  14.8k|    } else if (num == -1) {
  ------------------
  |  Branch (62:16): [True: 14.8k, False: 0]
  ------------------
   63|  14.8k|        size_t num_s = strlen(buf);
   64|       |
   65|  14.8k|        if (num_s >= INT_MAX) {
  ------------------
  |  Branch (65:13): [True: 0, False: 14.8k]
  ------------------
   66|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_LENGTH_TOO_LONG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   67|      0|            goto err;
   68|      0|        }
   69|  14.8k|        num = (int)num_s;
   70|  14.8k|    }
   71|       |
   72|  14.8k|    p = buf;
   73|  14.8k|    c = *(p++);
   74|  14.8k|    num--;
   75|  14.8k|    if ((c >= '0') && (c <= '2')) {
  ------------------
  |  Branch (75:9): [True: 14.8k, False: 0]
  |  Branch (75:23): [True: 14.8k, False: 0]
  ------------------
   76|  14.8k|        first = c - '0';
   77|  14.8k|    } else {
   78|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_FIRST_NUM_TOO_LARGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   79|      0|        goto err;
   80|      0|    }
   81|       |
   82|  14.8k|    if (num <= 0) {
  ------------------
  |  Branch (82:9): [True: 0, False: 14.8k]
  ------------------
   83|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_SECOND_NUMBER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   84|      0|        goto err;
   85|      0|    }
   86|  14.8k|    c = *(p++);
   87|  14.8k|    num--;
   88|   133k|    for (;;) {
   89|   133k|        if (num <= 0)
  ------------------
  |  Branch (89:13): [True: 14.8k, False: 118k]
  ------------------
   90|  14.8k|            break;
   91|   118k|        if ((c != '.') && (c != ' ')) {
  ------------------
  |  Branch (91:13): [True: 0, False: 118k]
  |  Branch (91:27): [True: 0, False: 0]
  ------------------
   92|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_SEPARATOR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   93|      0|            goto err;
   94|      0|        }
   95|   118k|        l = 0;
   96|   118k|        use_bn = 0;
   97|   327k|        for (;;) {
   98|   327k|            if (num <= 0)
  ------------------
  |  Branch (98:17): [True: 14.8k, False: 312k]
  ------------------
   99|  14.8k|                break;
  100|   312k|            num--;
  101|   312k|            c = *(p++);
  102|   312k|            if ((c == ' ') || (c == '.'))
  ------------------
  |  Branch (102:17): [True: 0, False: 312k]
  |  Branch (102:31): [True: 104k, False: 208k]
  ------------------
  103|   104k|                break;
  104|   208k|            if (!ossl_isdigit(c)) {
  ------------------
  |  Branch (104:17): [True: 0, False: 208k]
  ------------------
  105|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_DIGIT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  106|      0|                goto err;
  107|      0|            }
  108|   208k|            if (!use_bn && l >= ((ULONG_MAX - 80) / 10L)) {
  ------------------
  |  Branch (108:17): [True: 208k, False: 0]
  |  Branch (108:28): [True: 0, False: 208k]
  ------------------
  109|      0|                use_bn = 1;
  110|      0|                if (bl == NULL)
  ------------------
  |  Branch (110:21): [True: 0, False: 0]
  ------------------
  111|      0|                    bl = BN_new();
  112|      0|                if (bl == NULL || !BN_set_word(bl, l))
  ------------------
  |  Branch (112:21): [True: 0, False: 0]
  |  Branch (112:35): [True: 0, False: 0]
  ------------------
  113|      0|                    goto err;
  114|      0|            }
  115|   208k|            if (use_bn) {
  ------------------
  |  Branch (115:17): [True: 0, False: 208k]
  ------------------
  116|      0|                if (!BN_mul_word(bl, 10L)
  ------------------
  |  Branch (116:21): [True: 0, False: 0]
  ------------------
  117|      0|                    || !BN_add_word(bl, c - '0'))
  ------------------
  |  Branch (117:24): [True: 0, False: 0]
  ------------------
  118|      0|                    goto err;
  119|      0|            } else
  120|   208k|                l = l * 10L + (long)(c - '0');
  121|   208k|        }
  122|   118k|        if (len == 0) {
  ------------------
  |  Branch (122:13): [True: 14.8k, False: 104k]
  ------------------
  123|  14.8k|            if ((first < 2) && (l >= 40)) {
  ------------------
  |  Branch (123:17): [True: 0, False: 14.8k]
  |  Branch (123:32): [True: 0, False: 0]
  ------------------
  124|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_SECOND_NUMBER_TOO_LARGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  125|      0|                goto err;
  126|      0|            }
  127|  14.8k|            if (use_bn) {
  ------------------
  |  Branch (127:17): [True: 0, False: 14.8k]
  ------------------
  128|      0|                if (!BN_add_word(bl, first * 40))
  ------------------
  |  Branch (128:21): [True: 0, False: 0]
  ------------------
  129|      0|                    goto err;
  130|      0|            } else
  131|  14.8k|                l += (long)first * 40;
  132|  14.8k|        }
  133|   118k|        i = 0;
  134|   118k|        if (use_bn) {
  ------------------
  |  Branch (134:13): [True: 0, False: 118k]
  ------------------
  135|      0|            int blsize;
  136|      0|            blsize = BN_num_bits(bl);
  137|      0|            blsize = (blsize + 6) / 7;
  138|      0|            if (blsize > tmpsize) {
  ------------------
  |  Branch (138:17): [True: 0, False: 0]
  ------------------
  139|      0|                if (tmp != ftmp)
  ------------------
  |  Branch (139:21): [True: 0, False: 0]
  ------------------
  140|      0|                    OPENSSL_free(tmp);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  141|      0|                tmpsize = blsize + 32;
  142|      0|                tmp = OPENSSL_malloc(tmpsize);
  ------------------
  |  |  106|      0|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  143|      0|                if (tmp == NULL)
  ------------------
  |  Branch (143:21): [True: 0, False: 0]
  ------------------
  144|      0|                    goto err;
  145|      0|            }
  146|      0|            while (blsize--) {
  ------------------
  |  Branch (146:20): [True: 0, False: 0]
  ------------------
  147|      0|                BN_ULONG t = BN_div_word(bl, 0x80L);
  ------------------
  |  |   37|      0|#define BN_ULONG unsigned long
  ------------------
  148|      0|                if (t == (BN_ULONG)-1)
  ------------------
  |  Branch (148:21): [True: 0, False: 0]
  ------------------
  149|      0|                    goto err;
  150|      0|                tmp[i++] = (unsigned char)t;
  151|      0|            }
  152|   118k|        } else {
  153|       |
  154|   133k|            for (;;) {
  155|   133k|                tmp[i++] = (unsigned char)l & 0x7f;
  156|   133k|                l >>= 7L;
  157|   133k|                if (l == 0L)
  ------------------
  |  Branch (157:21): [True: 118k, False: 14.8k]
  ------------------
  158|   118k|                    break;
  159|   133k|            }
  160|   118k|        }
  161|   118k|        if (out != NULL) {
  ------------------
  |  Branch (161:13): [True: 59.4k, False: 59.4k]
  ------------------
  162|  59.4k|            if (len + i > olen) {
  ------------------
  |  Branch (162:17): [True: 0, False: 59.4k]
  ------------------
  163|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  164|      0|                goto err;
  165|      0|            }
  166|  66.9k|            while (--i > 0)
  ------------------
  |  Branch (166:20): [True: 7.43k, False: 59.4k]
  ------------------
  167|  7.43k|                out[len++] = tmp[i] | 0x80;
  168|  59.4k|            out[len++] = tmp[0];
  169|  59.4k|        } else
  170|  59.4k|            len += i;
  171|   118k|    }
  172|  14.8k|    if (tmp != ftmp)
  ------------------
  |  Branch (172:9): [True: 0, False: 14.8k]
  ------------------
  173|      0|        OPENSSL_free(tmp);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  174|  14.8k|    BN_free(bl);
  175|  14.8k|    return len;
  176|      0|err:
  177|      0|    if (tmp != ftmp)
  ------------------
  |  Branch (177:9): [True: 0, False: 0]
  ------------------
  178|      0|        OPENSSL_free(tmp);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  179|      0|    BN_free(bl);
  180|      0|    return 0;
  181|  14.8k|}
d2i_ASN1_OBJECT:
  219|  7.43k|{
  220|  7.43k|    const unsigned char *p;
  221|  7.43k|    long len;
  222|  7.43k|    int tag, xclass;
  223|  7.43k|    int inf, i;
  224|  7.43k|    ASN1_OBJECT *ret = NULL;
  225|  7.43k|    p = *pp;
  226|  7.43k|    inf = ASN1_get_object(&p, &len, &tag, &xclass, length);
  227|  7.43k|    if (inf & 0x80) {
  ------------------
  |  Branch (227:9): [True: 0, False: 7.43k]
  ------------------
  228|      0|        i = ASN1_R_BAD_OBJECT_HEADER;
  ------------------
  |  |   26|      0|#define ASN1_R_BAD_OBJECT_HEADER 102
  ------------------
  229|      0|        goto err;
  230|      0|    }
  231|       |
  232|  7.43k|    if (tag != V_ASN1_OBJECT) {
  ------------------
  |  |   70|  7.43k|#define V_ASN1_OBJECT 6
  ------------------
  |  Branch (232:9): [True: 0, False: 7.43k]
  ------------------
  233|      0|        i = ASN1_R_EXPECTING_AN_OBJECT;
  ------------------
  |  |   43|      0|#define ASN1_R_EXPECTING_AN_OBJECT 116
  ------------------
  234|      0|        goto err;
  235|      0|    }
  236|  7.43k|    ret = ossl_c2i_ASN1_OBJECT(a, &p, len);
  237|  7.43k|    if (ret)
  ------------------
  |  Branch (237:9): [True: 7.43k, False: 0]
  ------------------
  238|  7.43k|        *pp = p;
  239|  7.43k|    return ret;
  240|      0|err:
  241|      0|    ERR_raise(ERR_LIB_ASN1, i);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  242|       |    return NULL;
  243|  7.43k|}
ossl_c2i_ASN1_OBJECT:
  247|  6.81M|{
  248|  6.81M|    ASN1_OBJECT *ret = NULL, tobj;
  249|  6.81M|    const unsigned char *p;
  250|  6.81M|    unsigned char *data;
  251|  6.81M|    int i, length;
  252|       |
  253|       |    /*
  254|       |     * Sanity check OID encoding. Need at least one content octet. MSB must
  255|       |     * be clear in the last octet. can't have leading 0x80 in subidentifiers,
  256|       |     * see: X.690 8.19.2
  257|       |     */
  258|  6.81M|    if (len <= 0 || len > INT_MAX || pp == NULL || (p = *pp) == NULL || p[len - 1] & 0x80) {
  ------------------
  |  Branch (258:9): [True: 0, False: 6.81M]
  |  Branch (258:21): [True: 0, False: 6.81M]
  |  Branch (258:38): [True: 0, False: 6.81M]
  |  Branch (258:52): [True: 0, False: 6.81M]
  |  Branch (258:73): [True: 0, False: 6.81M]
  ------------------
  259|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  260|      0|        return NULL;
  261|      0|    }
  262|       |    /* Now 0 < len <= INT_MAX, so the cast is safe. */
  263|  6.81M|    length = (int)len;
  264|       |    /*
  265|       |     * Try to lookup OID in table: these are all valid encodings so if we get
  266|       |     * a match we know the OID is valid.
  267|       |     */
  268|  6.81M|    tobj.nid = NID_undef;
  ------------------
  |  |   18|  6.81M|#define NID_undef                       0
  ------------------
  269|  6.81M|    tobj.data = p;
  270|  6.81M|    tobj.length = length;
  271|  6.81M|    tobj.flags = 0;
  272|  6.81M|    i = OBJ_obj2nid(&tobj);
  273|  6.81M|    if (i != NID_undef) {
  ------------------
  |  |   18|  6.81M|#define NID_undef                       0
  ------------------
  |  Branch (273:9): [True: 6.78M, False: 31.0k]
  ------------------
  274|       |        /*
  275|       |         * Return shared registered OID object: this improves efficiency
  276|       |         * because we don't have to return a dynamically allocated OID
  277|       |         * and NID lookups can use the cached value.
  278|       |         */
  279|  6.78M|        ret = OBJ_nid2obj(i);
  280|  6.78M|        if (a) {
  ------------------
  |  Branch (280:13): [True: 6.77M, False: 7.43k]
  ------------------
  281|  6.77M|            ASN1_OBJECT_free(*a);
  282|  6.77M|            *a = ret;
  283|  6.77M|        }
  284|  6.78M|        *pp += len;
  285|  6.78M|        return ret;
  286|  6.78M|    }
  287|   310k|    for (i = 0; i < length; i++, p++) {
  ------------------
  |  Branch (287:17): [True: 279k, False: 31.0k]
  ------------------
  288|   279k|        if (*p == 0x80 && (!i || !(p[-1] & 0x80))) {
  ------------------
  |  Branch (288:13): [True: 0, False: 279k]
  |  Branch (288:28): [True: 0, False: 0]
  |  Branch (288:34): [True: 0, False: 0]
  ------------------
  289|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  290|      0|            return NULL;
  291|      0|        }
  292|   279k|    }
  293|       |
  294|  31.0k|    if ((a == NULL) || ((*a) == NULL) || !((*a)->flags & ASN1_OBJECT_FLAG_DYNAMIC)) {
  ------------------
  |  |  110|  31.0k|#define ASN1_OBJECT_FLAG_DYNAMIC 0x01 /* internal use */
  ------------------
  |  Branch (294:9): [True: 0, False: 31.0k]
  |  Branch (294:24): [True: 0, False: 31.0k]
  |  Branch (294:42): [True: 31.0k, False: 0]
  ------------------
  295|  31.0k|        if ((ret = ASN1_OBJECT_new()) == NULL)
  ------------------
  |  Branch (295:13): [True: 0, False: 31.0k]
  ------------------
  296|      0|            return NULL;
  297|  31.0k|    } else {
  298|      0|        ret = (*a);
  299|      0|    }
  300|       |
  301|  31.0k|    p = *pp;
  302|       |    /* detach data from object */
  303|  31.0k|    data = (unsigned char *)ret->data;
  304|  31.0k|    ret->data = NULL;
  305|       |    /* once detached we can change it */
  306|  31.0k|    if ((data == NULL) || (ret->length < length)) {
  ------------------
  |  Branch (306:9): [True: 31.0k, False: 0]
  |  Branch (306:27): [True: 0, False: 0]
  ------------------
  307|  31.0k|        ret->length = 0;
  308|  31.0k|        OPENSSL_free(data);
  ------------------
  |  |  131|  31.0k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  309|  31.0k|        data = OPENSSL_malloc(length);
  ------------------
  |  |  106|  31.0k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  310|  31.0k|        if (data == NULL)
  ------------------
  |  Branch (310:13): [True: 0, False: 31.0k]
  ------------------
  311|      0|            goto err;
  312|  31.0k|        ret->flags |= ASN1_OBJECT_FLAG_DYNAMIC_DATA;
  ------------------
  |  |  113|  31.0k|#define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */
  ------------------
  313|  31.0k|    }
  314|  31.0k|    memcpy(data, p, length);
  315|       |    /* If there are dynamic strings, free them here, and clear the flag */
  316|  31.0k|    if ((ret->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) != 0) {
  ------------------
  |  |  112|  31.0k|#define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04 /* internal use */
  ------------------
  |  Branch (316:9): [True: 0, False: 31.0k]
  ------------------
  317|      0|        OPENSSL_free((char *)ret->sn);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  318|      0|        OPENSSL_free((char *)ret->ln);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  319|      0|        ret->flags &= ~ASN1_OBJECT_FLAG_DYNAMIC_STRINGS;
  ------------------
  |  |  112|      0|#define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04 /* internal use */
  ------------------
  320|      0|    }
  321|       |    /* reattach data to object, after which it remains const */
  322|  31.0k|    ret->data = data;
  323|  31.0k|    ret->length = length;
  324|  31.0k|    ret->sn = NULL;
  325|  31.0k|    ret->ln = NULL;
  326|       |    /* ret->flags=ASN1_OBJECT_FLAG_DYNAMIC; we know it is dynamic */
  327|  31.0k|    p += length;
  328|       |
  329|  31.0k|    if (a != NULL)
  ------------------
  |  Branch (329:9): [True: 31.0k, False: 0]
  ------------------
  330|  31.0k|        (*a) = ret;
  331|  31.0k|    *pp = p;
  332|  31.0k|    return ret;
  333|      0|err:
  334|      0|    ERR_raise(ERR_LIB_ASN1, i);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  335|      0|    if ((a == NULL) || (*a != ret))
  ------------------
  |  Branch (335:9): [True: 0, False: 0]
  |  Branch (335:24): [True: 0, False: 0]
  ------------------
  336|      0|        ASN1_OBJECT_free(ret);
  337|       |    return NULL;
  338|  31.0k|}
ASN1_OBJECT_new:
  341|  31.0k|{
  342|  31.0k|    ASN1_OBJECT *ret;
  343|       |
  344|  31.0k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|  31.0k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  345|  31.0k|    if (ret == NULL)
  ------------------
  |  Branch (345:9): [True: 0, False: 31.0k]
  ------------------
  346|      0|        return NULL;
  347|  31.0k|    ret->flags = ASN1_OBJECT_FLAG_DYNAMIC;
  ------------------
  |  |  110|  31.0k|#define ASN1_OBJECT_FLAG_DYNAMIC 0x01 /* internal use */
  ------------------
  348|  31.0k|    return ret;
  349|  31.0k|}
ASN1_OBJECT_free:
  352|  16.8M|{
  353|  16.8M|    if (a == NULL)
  ------------------
  |  Branch (353:9): [True: 338k, False: 16.4M]
  ------------------
  354|   338k|        return;
  355|  16.4M|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) {
  ------------------
  |  |  112|  16.4M|#define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04 /* internal use */
  ------------------
  |  Branch (355:9): [True: 0, False: 16.4M]
  ------------------
  356|      0|#ifndef CONST_STRICT
  357|       |        /*
  358|       |         * Disable purely for compile-time strict const checking.  Doing this
  359|       |         * on a "real" compile will cause memory leaks
  360|       |         */
  361|      0|        OPENSSL_free((void *)a->sn);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  362|      0|        OPENSSL_free((void *)a->ln);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  363|      0|#endif
  364|      0|        a->sn = a->ln = NULL;
  365|      0|    }
  366|  16.4M|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA) {
  ------------------
  |  |  113|  16.4M|#define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */
  ------------------
  |  Branch (366:9): [True: 31.0k, False: 16.4M]
  ------------------
  367|  31.0k|        OPENSSL_free((void *)a->data);
  ------------------
  |  |  131|  31.0k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  368|  31.0k|        a->data = NULL;
  369|  31.0k|        a->length = 0;
  370|  31.0k|    }
  371|  16.4M|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC)
  ------------------
  |  |  110|  16.4M|#define ASN1_OBJECT_FLAG_DYNAMIC 0x01 /* internal use */
  ------------------
  |  Branch (371:9): [True: 31.0k, False: 16.4M]
  ------------------
  372|  31.0k|        OPENSSL_free(a);
  ------------------
  |  |  131|  31.0k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  373|  16.4M|}

ASN1_OCTET_STRING_cmp:
   21|  74.1k|{
   22|  74.1k|    return ASN1_STRING_cmp(a, b);
   23|  74.1k|}

ASN1_STRING_to_UTF8:
  602|  2.98M|{
  603|  2.98M|    ASN1_STRING stmp, *str = &stmp;
  604|  2.98M|    int mbflag, type, ret;
  605|  2.98M|    if (!in)
  ------------------
  |  Branch (605:9): [True: 0, False: 2.98M]
  ------------------
  606|      0|        return -1;
  607|  2.98M|    type = in->type;
  608|  2.98M|    if ((type < 0) || (type > 30))
  ------------------
  |  Branch (608:9): [True: 0, False: 2.98M]
  |  Branch (608:23): [True: 0, False: 2.98M]
  ------------------
  609|      0|        return -1;
  610|  2.98M|    mbflag = tag2nbyte[type];
  611|  2.98M|    if (mbflag == -1)
  ------------------
  |  Branch (611:9): [True: 0, False: 2.98M]
  ------------------
  612|      0|        return -1;
  613|  2.98M|    mbflag |= MBSTRING_FLAG;
  ------------------
  |  |  124|  2.98M|#define MBSTRING_FLAG 0x1000
  ------------------
  614|  2.98M|    stmp.data = NULL;
  615|  2.98M|    stmp.length = 0;
  616|  2.98M|    stmp.flags = 0;
  617|  2.98M|    ret = ASN1_mbstring_copy(&str, in->data, in->length, mbflag,
  618|  2.98M|        B_ASN1_UTF8STRING);
  ------------------
  |  |  119|  2.98M|#define B_ASN1_UTF8STRING 0x2000
  ------------------
  619|  2.98M|    if (ret < 0)
  ------------------
  |  Branch (619:9): [True: 0, False: 2.98M]
  ------------------
  620|      0|        return ret;
  621|  2.98M|    *out = stmp.data;
  622|  2.98M|    return stmp.length;
  623|  2.98M|}

ASN1_TYPE_set:
   27|  1.83M|{
   28|  1.83M|    if (a->type != V_ASN1_BOOLEAN
  ------------------
  |  |   65|  3.67M|#define V_ASN1_BOOLEAN 1
  ------------------
  |  Branch (28:9): [True: 1.83M, False: 0]
  ------------------
   29|  1.83M|        && a->type != V_ASN1_NULL
  ------------------
  |  |   69|  3.67M|#define V_ASN1_NULL 5
  ------------------
  |  Branch (29:12): [True: 1.83M, False: 0]
  ------------------
   30|  1.83M|        && a->value.ptr != NULL) {
  ------------------
  |  Branch (30:12): [True: 0, False: 1.83M]
  ------------------
   31|      0|        ASN1_TYPE **tmp_a = &a;
   32|      0|        ossl_asn1_primitive_free((ASN1_VALUE **)tmp_a, NULL, 0);
   33|      0|    }
   34|  1.83M|    a->type = type;
   35|  1.83M|    if (type == V_ASN1_BOOLEAN)
  ------------------
  |  |   65|  1.83M|#define V_ASN1_BOOLEAN 1
  ------------------
  |  Branch (35:9): [True: 0, False: 1.83M]
  ------------------
   36|      0|        a->value.boolean = value ? 0xff : 0;
  ------------------
  |  Branch (36:28): [True: 0, False: 0]
  ------------------
   37|  1.83M|    else
   38|  1.83M|        a->value.ptr = value;
   39|  1.83M|}

UTF8_getc:
   29|  31.1M|{
   30|  31.1M|    const unsigned char *p;
   31|  31.1M|    unsigned long value;
   32|  31.1M|    int ret;
   33|  31.1M|    if (len <= 0)
  ------------------
  |  Branch (33:9): [True: 0, False: 31.1M]
  ------------------
   34|      0|        return 0;
   35|  31.1M|    p = str;
   36|       |
   37|       |    /* Check syntax and work out the encoded value (if correct) */
   38|  31.1M|    if ((*p & 0x80) == 0) {
  ------------------
  |  Branch (38:9): [True: 31.0M, False: 90.3k]
  ------------------
   39|  31.0M|        value = *p++ & 0x7f;
   40|  31.0M|        ret = 1;
   41|  31.0M|    } else if ((*p & 0xe0) == 0xc0) {
  ------------------
  |  Branch (41:16): [True: 90.3k, False: 0]
  ------------------
   42|  90.3k|        if (len < 2)
  ------------------
  |  Branch (42:13): [True: 0, False: 90.3k]
  ------------------
   43|      0|            return -1;
   44|  90.3k|        if ((p[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (44:13): [True: 0, False: 90.3k]
  ------------------
   45|      0|            return -3;
   46|  90.3k|        value = (*p++ & 0x1f) << 6;
   47|  90.3k|        value |= *p++ & 0x3f;
   48|  90.3k|        if (value < 0x80)
  ------------------
  |  Branch (48:13): [True: 0, False: 90.3k]
  ------------------
   49|      0|            return -4;
   50|  90.3k|        ret = 2;
   51|  90.3k|    } else if ((*p & 0xf0) == 0xe0) {
  ------------------
  |  Branch (51:16): [True: 0, False: 0]
  ------------------
   52|      0|        if (len < 3)
  ------------------
  |  Branch (52:13): [True: 0, False: 0]
  ------------------
   53|      0|            return -1;
   54|      0|        if (((p[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (54:13): [True: 0, False: 0]
  ------------------
   55|      0|            || ((p[2] & 0xc0) != 0x80))
  ------------------
  |  Branch (55:16): [True: 0, False: 0]
  ------------------
   56|      0|            return -3;
   57|      0|        value = (*p++ & 0xf) << 12;
   58|      0|        value |= (*p++ & 0x3f) << 6;
   59|      0|        value |= *p++ & 0x3f;
   60|      0|        if (value < 0x800)
  ------------------
  |  Branch (60:13): [True: 0, False: 0]
  ------------------
   61|      0|            return -4;
   62|      0|        if (is_unicode_surrogate(value))
  ------------------
  |  Branch (62:13): [True: 0, False: 0]
  ------------------
   63|      0|            return -2;
   64|      0|        ret = 3;
   65|      0|    } else if ((*p & 0xf8) == 0xf0) {
  ------------------
  |  Branch (65:16): [True: 0, False: 0]
  ------------------
   66|      0|        if (len < 4)
  ------------------
  |  Branch (66:13): [True: 0, False: 0]
  ------------------
   67|      0|            return -1;
   68|      0|        if (((p[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (68:13): [True: 0, False: 0]
  ------------------
   69|      0|            || ((p[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (69:16): [True: 0, False: 0]
  ------------------
   70|      0|            || ((p[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (70:16): [True: 0, False: 0]
  ------------------
   71|      0|            return -3;
   72|      0|        value = ((unsigned long)(*p++ & 0x7)) << 18;
   73|      0|        value |= (*p++ & 0x3f) << 12;
   74|      0|        value |= (*p++ & 0x3f) << 6;
   75|      0|        value |= *p++ & 0x3f;
   76|      0|        if (value < 0x10000 || value >= UNICODE_LIMIT)
  ------------------
  |  Branch (76:13): [True: 0, False: 0]
  |  Branch (76:32): [True: 0, False: 0]
  ------------------
   77|      0|            return -4;
   78|      0|        ret = 4;
   79|      0|    } else
   80|      0|        return -2;
   81|  31.1M|    *val = value;
   82|  31.1M|    return ret;
   83|  31.1M|}
UTF8_putc:
   94|  64.3M|{
   95|  64.3M|    if (!str)
  ------------------
  |  Branch (95:9): [True: 32.1M, False: 32.1M]
  ------------------
   96|  32.1M|        len = 4; /* Maximum we will need */
   97|  32.1M|    else if (len <= 0)
  ------------------
  |  Branch (97:14): [True: 0, False: 32.1M]
  ------------------
   98|      0|        return -1;
   99|  64.3M|    if (value < 0x80) {
  ------------------
  |  Branch (99:9): [True: 64.3M, False: 0]
  ------------------
  100|  64.3M|        if (str)
  ------------------
  |  Branch (100:13): [True: 32.1M, False: 32.1M]
  ------------------
  101|  32.1M|            *str = (unsigned char)value;
  102|  64.3M|        return 1;
  103|  64.3M|    }
  104|      0|    if (value < 0x800) {
  ------------------
  |  Branch (104:9): [True: 0, False: 0]
  ------------------
  105|      0|        if (len < 2)
  ------------------
  |  Branch (105:13): [True: 0, False: 0]
  ------------------
  106|      0|            return -1;
  107|      0|        if (str) {
  ------------------
  |  Branch (107:13): [True: 0, False: 0]
  ------------------
  108|      0|            *str++ = (unsigned char)(((value >> 6) & 0x1f) | 0xc0);
  109|      0|            *str = (unsigned char)((value & 0x3f) | 0x80);
  110|      0|        }
  111|      0|        return 2;
  112|      0|    }
  113|      0|    if (value < 0x10000) {
  ------------------
  |  Branch (113:9): [True: 0, False: 0]
  ------------------
  114|      0|        if (is_unicode_surrogate(value))
  ------------------
  |  Branch (114:13): [True: 0, False: 0]
  ------------------
  115|      0|            return -2;
  116|      0|        if (len < 3)
  ------------------
  |  Branch (116:13): [True: 0, False: 0]
  ------------------
  117|      0|            return -1;
  118|      0|        if (str) {
  ------------------
  |  Branch (118:13): [True: 0, False: 0]
  ------------------
  119|      0|            *str++ = (unsigned char)(((value >> 12) & 0xf) | 0xe0);
  120|      0|            *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80);
  121|      0|            *str = (unsigned char)((value & 0x3f) | 0x80);
  122|      0|        }
  123|      0|        return 3;
  124|      0|    }
  125|      0|    if (value < UNICODE_LIMIT) {
  ------------------
  |  Branch (125:9): [True: 0, False: 0]
  ------------------
  126|      0|        if (len < 4)
  ------------------
  |  Branch (126:13): [True: 0, False: 0]
  ------------------
  127|      0|            return -1;
  128|      0|        if (str) {
  ------------------
  |  Branch (128:13): [True: 0, False: 0]
  ------------------
  129|      0|            *str++ = (unsigned char)(((value >> 18) & 0x7) | 0xf0);
  130|      0|            *str++ = (unsigned char)(((value >> 12) & 0x3f) | 0x80);
  131|      0|            *str++ = (unsigned char)(((value >> 6) & 0x3f) | 0x80);
  132|      0|            *str = (unsigned char)((value & 0x3f) | 0x80);
  133|      0|        }
  134|      0|        return 4;
  135|      0|    }
  136|      0|    return -2;
  137|      0|}

EVP_PKEY_asn1_get_count:
   41|  1.98M|{
   42|  1.98M|    int num = OSSL_NELEM(standard_methods);
  ------------------
  |  |   14|  1.98M|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
   43|  1.98M|    if (app_methods)
  ------------------
  |  Branch (43:9): [True: 0, False: 1.98M]
  ------------------
   44|      0|        num += sk_EVP_PKEY_ASN1_METHOD_num(app_methods);
   45|  1.98M|    return num;
   46|  1.98M|}
EVP_PKEY_asn1_get0:
   49|  28.1M|{
   50|  28.1M|    int num = OSSL_NELEM(standard_methods);
  ------------------
  |  |   14|  28.1M|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
   51|  28.1M|    if (idx < 0)
  ------------------
  |  Branch (51:9): [True: 0, False: 28.1M]
  ------------------
   52|      0|        return NULL;
   53|  28.1M|    if (idx < num)
  ------------------
  |  Branch (53:9): [True: 28.1M, False: 0]
  ------------------
   54|  28.1M|        return standard_methods[idx];
   55|      0|    idx -= num;
   56|      0|    return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
   57|  28.1M|}
EVP_PKEY_asn1_find:
   84|  1.05M|{
   85|  1.05M|    const EVP_PKEY_ASN1_METHOD *t;
   86|       |
   87|  1.05M|    for (;;) {
   88|  1.05M|        t = pkey_asn1_find(type);
   89|  1.05M|        if (!t || !(t->pkey_flags & ASN1_PKEY_ALIAS))
  ------------------
  |  | 1603|   957k|#define ASN1_PKEY_ALIAS 0x1
  ------------------
  |  Branch (89:13): [True: 97.5k, False: 957k]
  |  Branch (89:19): [True: 957k, False: 0]
  ------------------
   90|  1.05M|            break;
   91|      0|        type = t->pkey_base_id;
   92|      0|    }
   93|  1.05M|    if (pe) {
  ------------------
  |  Branch (93:9): [True: 1.05M, False: 0]
  ------------------
   94|  1.05M|#ifndef OPENSSL_NO_ENGINE
   95|  1.05M|        ENGINE *e;
   96|       |        /* type will contain the final unaliased type */
   97|  1.05M|        e = ENGINE_get_pkey_asn1_meth_engine(type);
   98|  1.05M|        if (e) {
  ------------------
  |  Branch (98:13): [True: 0, False: 1.05M]
  ------------------
   99|      0|            *pe = e;
  100|      0|            return ENGINE_get_pkey_asn1_meth(e, type);
  101|      0|        }
  102|  1.05M|#endif
  103|  1.05M|        *pe = NULL;
  104|  1.05M|    }
  105|  1.05M|    return t;
  106|  1.05M|}
EVP_PKEY_asn1_find_str:
  110|  1.98M|{
  111|  1.98M|    int i;
  112|  1.98M|    const EVP_PKEY_ASN1_METHOD *ameth = NULL;
  113|       |
  114|  1.98M|    if (len == -1)
  ------------------
  |  Branch (114:9): [True: 17.9k, False: 1.96M]
  ------------------
  115|  17.9k|        len = (int)strlen(str);
  116|  1.98M|    if (pe) {
  ------------------
  |  Branch (116:9): [True: 1.98M, False: 0]
  ------------------
  117|  1.98M|#ifndef OPENSSL_NO_ENGINE
  118|  1.98M|        ENGINE *e;
  119|  1.98M|        ameth = ENGINE_pkey_asn1_find_str(&e, str, len);
  120|  1.98M|        if (ameth) {
  ------------------
  |  Branch (120:13): [True: 0, False: 1.98M]
  ------------------
  121|       |            /*
  122|       |             * Convert structural into functional reference
  123|       |             */
  124|      0|            if (!ENGINE_init(e))
  ------------------
  |  Branch (124:17): [True: 0, False: 0]
  ------------------
  125|      0|                ameth = NULL;
  126|      0|            ENGINE_free(e);
  127|      0|            *pe = e;
  128|      0|            return ameth;
  129|      0|        }
  130|  1.98M|#endif
  131|  1.98M|        *pe = NULL;
  132|  1.98M|    }
  133|  29.2M|    for (i = EVP_PKEY_asn1_get_count(); i-- > 0;) {
  ------------------
  |  Branch (133:41): [True: 28.0M, False: 1.15M]
  ------------------
  134|  28.0M|        ameth = EVP_PKEY_asn1_get0(i);
  135|  28.0M|        if (ameth->pkey_flags & ASN1_PKEY_ALIAS)
  ------------------
  |  | 1603|  28.0M|#define ASN1_PKEY_ALIAS 0x1
  ------------------
  |  Branch (135:13): [True: 8.98M, False: 19.1M]
  ------------------
  136|  8.98M|            continue;
  137|  19.1M|        if ((int)strlen(ameth->pem_str) == len
  ------------------
  |  Branch (137:13): [True: 1.43M, False: 17.6M]
  ------------------
  138|  1.43M|            && OPENSSL_strncasecmp(ameth->pem_str, str, len) == 0)
  ------------------
  |  Branch (138:16): [True: 830k, False: 605k]
  ------------------
  139|   830k|            return ameth;
  140|  19.1M|    }
  141|  1.15M|    return NULL;
  142|  1.98M|}
EVP_PKEY_asn1_get0_info:
  203|  9.48k|{
  204|  9.48k|    if (!ameth)
  ------------------
  |  Branch (204:9): [True: 0, False: 9.48k]
  ------------------
  205|      0|        return 0;
  206|  9.48k|    if (ppkey_id)
  ------------------
  |  Branch (206:9): [True: 9.48k, False: 0]
  ------------------
  207|  9.48k|        *ppkey_id = ameth->pkey_id;
  208|  9.48k|    if (ppkey_base_id)
  ------------------
  |  Branch (208:9): [True: 9.48k, False: 0]
  ------------------
  209|  9.48k|        *ppkey_base_id = ameth->pkey_base_id;
  210|  9.48k|    if (ppkey_flags)
  ------------------
  |  Branch (210:9): [True: 9.48k, False: 0]
  ------------------
  211|  9.48k|        *ppkey_flags = ameth->pkey_flags;
  212|  9.48k|    if (pinfo)
  ------------------
  |  Branch (212:9): [True: 0, False: 9.48k]
  ------------------
  213|      0|        *pinfo = ameth->info;
  214|  9.48k|    if (ppem_str)
  ------------------
  |  Branch (214:9): [True: 9.48k, False: 0]
  ------------------
  215|  9.48k|        *ppem_str = ameth->pem_str;
  216|  9.48k|    return 1;
  217|  9.48k|}
ameth_lib.c:pkey_asn1_find:
   60|  1.05M|{
   61|  1.05M|    EVP_PKEY_ASN1_METHOD tmp;
   62|  1.05M|    const EVP_PKEY_ASN1_METHOD *t = &tmp, **ret;
   63|       |
   64|  1.05M|    tmp.pkey_id = type;
   65|  1.05M|    if (app_methods) {
  ------------------
  |  Branch (65:9): [True: 0, False: 1.05M]
  ------------------
   66|      0|        int idx;
   67|      0|        idx = sk_EVP_PKEY_ASN1_METHOD_find(app_methods, &tmp);
   68|      0|        if (idx >= 0)
  ------------------
  |  Branch (68:13): [True: 0, False: 0]
  ------------------
   69|      0|            return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
   70|      0|    }
   71|  1.05M|    ret = OBJ_bsearch_ameth(&t, standard_methods, OSSL_NELEM(standard_methods));
  ------------------
  |  |   14|  1.05M|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
   72|  1.05M|    if (ret == NULL || *ret == NULL)
  ------------------
  |  Branch (72:9): [True: 97.5k, False: 957k]
  |  Branch (72:24): [True: 0, False: 957k]
  ------------------
   73|  97.5k|        return NULL;
   74|   957k|    return *ret;
   75|  1.05M|}
ameth_lib.c:ameth_cmp:
   33|  3.18M|{
   34|  3.18M|    return ((*a)->pkey_id - (*b)->pkey_id);
   35|  3.18M|}

ossl_err_load_ASN1_strings:
  210|      1|{
  211|      1|#ifndef OPENSSL_NO_ERR
  212|      1|    if (ERR_reason_error_string(ASN1_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (212:9): [True: 1, False: 0]
  ------------------
  213|      1|        ERR_load_strings_const(ASN1_str_reasons);
  214|      1|#endif
  215|      1|    return 1;
  216|      1|}

ASN1_get_object:
   48|  34.2M|{
   49|  34.2M|    int i, ret;
   50|  34.2M|    long len;
   51|  34.2M|    const unsigned char *p = *pp;
   52|  34.2M|    int tag, xclass, inf;
   53|  34.2M|    long max = omax;
   54|       |
   55|  34.2M|    if (omax <= 0) {
  ------------------
  |  Branch (55:9): [True: 0, False: 34.2M]
  ------------------
   56|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   57|      0|        return 0x80;
   58|      0|    }
   59|  34.2M|    ret = (*p & V_ASN1_CONSTRUCTED);
  ------------------
  |  |   54|  34.2M|#define V_ASN1_CONSTRUCTED 0x20
  ------------------
   60|  34.2M|    xclass = (*p & V_ASN1_PRIVATE);
  ------------------
  |  |   52|  34.2M|#define V_ASN1_PRIVATE 0xc0
  ------------------
   61|  34.2M|    i = *p & V_ASN1_PRIMITIVE_TAG;
  ------------------
  |  |   55|  34.2M|#define V_ASN1_PRIMITIVE_TAG 0x1f
  ------------------
   62|  34.2M|    if (i == V_ASN1_PRIMITIVE_TAG) { /* high-tag */
  ------------------
  |  |   55|  34.2M|#define V_ASN1_PRIMITIVE_TAG 0x1f
  ------------------
  |  Branch (62:9): [True: 0, False: 34.2M]
  ------------------
   63|      0|        p++;
   64|      0|        if (--max == 0)
  ------------------
  |  Branch (64:13): [True: 0, False: 0]
  ------------------
   65|      0|            goto err;
   66|      0|        len = 0;
   67|      0|        while (*p & 0x80) {
  ------------------
  |  Branch (67:16): [True: 0, False: 0]
  ------------------
   68|      0|            len <<= 7L;
   69|      0|            len |= *(p++) & 0x7f;
   70|      0|            if (--max == 0)
  ------------------
  |  Branch (70:17): [True: 0, False: 0]
  ------------------
   71|      0|                goto err;
   72|      0|            if (len > (INT_MAX >> 7L))
  ------------------
  |  Branch (72:17): [True: 0, False: 0]
  ------------------
   73|      0|                goto err;
   74|      0|        }
   75|      0|        len <<= 7L;
   76|      0|        len |= *(p++) & 0x7f;
   77|      0|        tag = (int)len;
   78|      0|        if (--max == 0)
  ------------------
  |  Branch (78:13): [True: 0, False: 0]
  ------------------
   79|      0|            goto err;
   80|  34.2M|    } else {
   81|  34.2M|        tag = i;
   82|  34.2M|        p++;
   83|  34.2M|        if (--max == 0)
  ------------------
  |  Branch (83:13): [True: 0, False: 34.2M]
  ------------------
   84|      0|            goto err;
   85|  34.2M|    }
   86|  34.2M|    *ptag = tag;
   87|  34.2M|    *pclass = xclass;
   88|  34.2M|    if (!asn1_get_length(&p, &inf, plength, max))
  ------------------
  |  Branch (88:9): [True: 0, False: 34.2M]
  ------------------
   89|      0|        goto err;
   90|       |
   91|  34.2M|    if (inf && !(ret & V_ASN1_CONSTRUCTED))
  ------------------
  |  |   54|      0|#define V_ASN1_CONSTRUCTED 0x20
  ------------------
  |  Branch (91:9): [True: 0, False: 34.2M]
  |  Branch (91:16): [True: 0, False: 0]
  ------------------
   92|      0|        goto err;
   93|       |
   94|  34.2M|    if (*plength > (omax - (p - *pp))) {
  ------------------
  |  Branch (94:9): [True: 824k, False: 33.4M]
  ------------------
   95|   824k|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  404|   824k|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|   824k|    (ERR_new(),                                                  \
  |  |  |  |  407|   824k|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|   824k|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|   824k|        ERR_set_error)
  |  |  ------------------
  ------------------
   96|       |        /*
   97|       |         * Set this so that even if things are not long enough the values are
   98|       |         * set correctly
   99|       |         */
  100|   824k|        ret |= 0x80;
  101|   824k|    }
  102|  34.2M|    *pp = p;
  103|  34.2M|    return ret | inf;
  104|      0|err:
  105|       |    ERR_raise(ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  106|      0|    return 0x80;
  107|  34.2M|}
ASN1_put_object:
  162|  13.5M|{
  163|  13.5M|    unsigned char *p = *pp;
  164|  13.5M|    int i, ttag;
  165|       |
  166|  13.5M|    i = (constructed) ? V_ASN1_CONSTRUCTED : 0;
  ------------------
  |  |   54|  6.65M|#define V_ASN1_CONSTRUCTED 0x20
  ------------------
  |  Branch (166:9): [True: 6.65M, False: 6.90M]
  ------------------
  167|  13.5M|    i |= (xclass & V_ASN1_PRIVATE);
  ------------------
  |  |   52|  13.5M|#define V_ASN1_PRIVATE 0xc0
  ------------------
  168|  13.5M|    if (tag < 31) {
  ------------------
  |  Branch (168:9): [True: 13.5M, False: 0]
  ------------------
  169|  13.5M|        *(p++) = i | (tag & V_ASN1_PRIMITIVE_TAG);
  ------------------
  |  |   55|  13.5M|#define V_ASN1_PRIMITIVE_TAG 0x1f
  ------------------
  170|  13.5M|    } else {
  171|      0|        *(p++) = i | V_ASN1_PRIMITIVE_TAG;
  ------------------
  |  |   55|      0|#define V_ASN1_PRIMITIVE_TAG 0x1f
  ------------------
  172|      0|        for (i = 0, ttag = tag; ttag > 0; i++)
  ------------------
  |  Branch (172:33): [True: 0, False: 0]
  ------------------
  173|      0|            ttag >>= 7;
  174|      0|        ttag = i;
  175|      0|        while (i-- > 0) {
  ------------------
  |  Branch (175:16): [True: 0, False: 0]
  ------------------
  176|      0|            p[i] = tag & 0x7f;
  177|      0|            if (i != (ttag - 1))
  ------------------
  |  Branch (177:17): [True: 0, False: 0]
  ------------------
  178|      0|                p[i] |= 0x80;
  179|      0|            tag >>= 7;
  180|      0|        }
  181|      0|        p += ttag;
  182|      0|    }
  183|  13.5M|    if (constructed == 2)
  ------------------
  |  Branch (183:9): [True: 0, False: 13.5M]
  ------------------
  184|      0|        *(p++) = 0x80;
  185|  13.5M|    else
  186|  13.5M|        asn1_put_length(&p, length);
  187|  13.5M|    *pp = p;
  188|  13.5M|}
ASN1_object_size:
  223|  43.8M|{
  224|  43.8M|    int ret = 1;
  225|       |
  226|  43.8M|    if (length < 0)
  ------------------
  |  Branch (226:9): [True: 0, False: 43.8M]
  ------------------
  227|      0|        return -1;
  228|  43.8M|    if (tag >= 31) {
  ------------------
  |  Branch (228:9): [True: 0, False: 43.8M]
  ------------------
  229|      0|        while (tag > 0) {
  ------------------
  |  Branch (229:16): [True: 0, False: 0]
  ------------------
  230|      0|            tag >>= 7;
  231|      0|            ret++;
  232|      0|        }
  233|      0|    }
  234|  43.8M|    if (constructed == 2) {
  ------------------
  |  Branch (234:9): [True: 0, False: 43.8M]
  ------------------
  235|      0|        ret += 3;
  236|  43.8M|    } else {
  237|  43.8M|        ret++;
  238|  43.8M|        if (length > 127) {
  ------------------
  |  Branch (238:13): [True: 1.41M, False: 42.4M]
  ------------------
  239|  1.41M|            int tmplen = length;
  240|  4.24M|            while (tmplen > 0) {
  ------------------
  |  Branch (240:20): [True: 2.82M, False: 1.41M]
  ------------------
  241|  2.82M|                tmplen >>= 8;
  242|  2.82M|                ret++;
  243|  2.82M|            }
  244|  1.41M|        }
  245|  43.8M|    }
  246|  43.8M|    if (ret >= INT_MAX - length)
  ------------------
  |  Branch (246:9): [True: 0, False: 43.8M]
  ------------------
  247|      0|        return -1;
  248|  43.8M|    return ret + length;
  249|  43.8M|}
ossl_asn1_string_set_bits_left:
  252|  1.98M|{
  253|  1.98M|    str->flags &= ~0x07;
  254|  1.98M|    str->flags |= ASN1_STRING_FLAG_BITS_LEFT | (num & 0x07);
  ------------------
  |  |  164|  1.98M|#define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
  ------------------
  255|  1.98M|}
ASN1_STRING_set:
  287|  7.28M|{
  288|  7.28M|    unsigned char *c;
  289|  7.28M|    const char *data = _data;
  290|  7.28M|    size_t len;
  291|       |
  292|  7.28M|    if (len_in < 0) {
  ------------------
  |  Branch (292:9): [True: 0, False: 7.28M]
  ------------------
  293|      0|        if (data == NULL)
  ------------------
  |  Branch (293:13): [True: 0, False: 0]
  ------------------
  294|      0|            return 0;
  295|      0|        len = strlen(data);
  296|  7.28M|    } else {
  297|  7.28M|        len = (size_t)len_in;
  298|  7.28M|    }
  299|       |    /*
  300|       |     * Verify that the length fits within an integer for assignment to
  301|       |     * str->length below.  The additional 1 is subtracted to allow for the
  302|       |     * '\0' terminator even though this isn't strictly necessary.
  303|       |     */
  304|  7.28M|    if (len > INT_MAX - 1) {
  ------------------
  |  Branch (304:9): [True: 0, False: 7.28M]
  ------------------
  305|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LARGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  306|      0|        return 0;
  307|      0|    }
  308|  7.28M|    if ((size_t)str->length <= len || str->data == NULL) {
  ------------------
  |  Branch (308:9): [True: 7.28M, False: 0]
  |  Branch (308:39): [True: 0, False: 0]
  ------------------
  309|  7.28M|        c = str->data;
  310|  7.28M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  311|       |        /* No NUL terminator in fuzzing builds */
  312|  7.28M|        str->data = OPENSSL_realloc(c, len != 0 ? len : 1);
  ------------------
  |  |  120|  14.5M|    CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (120:26): [True: 7.28M, False: 0]
  |  |  ------------------
  ------------------
  313|       |#else
  314|       |        str->data = OPENSSL_realloc(c, len + 1);
  315|       |#endif
  316|  7.28M|        if (str->data == NULL) {
  ------------------
  |  Branch (316:13): [True: 0, False: 7.28M]
  ------------------
  317|      0|            str->data = c;
  318|      0|            return 0;
  319|      0|        }
  320|  7.28M|    }
  321|  7.28M|    str->length = (int)len;
  322|  7.28M|    if (data != NULL) {
  ------------------
  |  Branch (322:9): [True: 6.44M, False: 843k]
  ------------------
  323|  6.44M|        memcpy(str->data, data, len);
  324|  6.44M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  325|       |        /* Set the unused byte to something non NUL and printable. */
  326|  6.44M|        if (len == 0)
  ------------------
  |  Branch (326:13): [True: 0, False: 6.44M]
  ------------------
  327|      0|            str->data[len] = '~';
  328|       |#else
  329|       |        /*
  330|       |         * Add a NUL terminator. This should not be necessary - but we add it as
  331|       |         * a safety precaution
  332|       |         */
  333|       |        str->data[len] = '\0';
  334|       |#endif
  335|  6.44M|    }
  336|  7.28M|    return 1;
  337|  7.28M|}
ASN1_STRING_set0:
  340|  4.97M|{
  341|  4.97M|    OPENSSL_free(str->data);
  ------------------
  |  |  131|  4.97M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  342|  4.97M|    str->data = data;
  343|  4.97M|    str->length = len;
  344|  4.97M|}
ASN1_STRING_type_new:
  352|  9.25M|{
  353|  9.25M|    ASN1_STRING *ret;
  354|       |
  355|  9.25M|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|  9.25M|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  356|  9.25M|    if (ret == NULL)
  ------------------
  |  Branch (356:9): [True: 0, False: 9.25M]
  ------------------
  357|      0|        return NULL;
  358|  9.25M|    ret->type = type;
  359|  9.25M|    return ret;
  360|  9.25M|}
ossl_asn1_string_embed_free:
  363|  11.5M|{
  364|  11.5M|    if (a == NULL)
  ------------------
  |  Branch (364:9): [True: 0, False: 11.5M]
  ------------------
  365|      0|        return;
  366|  11.5M|    if (!(a->flags & ASN1_STRING_FLAG_NDEF))
  ------------------
  |  |  170|  11.5M|#define ASN1_STRING_FLAG_NDEF 0x010
  ------------------
  |  Branch (366:9): [True: 11.5M, False: 0]
  ------------------
  367|  11.5M|        OPENSSL_free(a->data);
  ------------------
  |  |  131|  11.5M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  368|  11.5M|    if (embed == 0)
  ------------------
  |  Branch (368:9): [True: 9.25M, False: 2.24M]
  ------------------
  369|  9.25M|        OPENSSL_free(a);
  ------------------
  |  |  131|  9.25M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  370|  11.5M|}
ASN1_STRING_free:
  373|  2.80M|{
  374|  2.80M|    if (a == NULL)
  ------------------
  |  Branch (374:9): [True: 1.31M, False: 1.49M]
  ------------------
  375|  1.31M|        return;
  376|  1.49M|    ossl_asn1_string_embed_free(a, a->flags & ASN1_STRING_FLAG_EMBED);
  ------------------
  |  |  185|  1.49M|#define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  377|  1.49M|}
ASN1_STRING_cmp:
  389|  85.7k|{
  390|  85.7k|    int i;
  391|       |
  392|  85.7k|    i = (a->length - b->length);
  393|  85.7k|    if (i == 0) {
  ------------------
  |  Branch (393:9): [True: 85.7k, False: 0]
  ------------------
  394|  85.7k|        if (a->length != 0)
  ------------------
  |  Branch (394:13): [True: 85.7k, False: 0]
  ------------------
  395|  85.7k|            i = memcmp(a->data, b->data, a->length);
  396|  85.7k|        if (i == 0)
  ------------------
  |  Branch (396:13): [True: 85.7k, False: 0]
  ------------------
  397|  85.7k|            return a->type - b->type;
  398|      0|        else
  399|      0|            return i;
  400|  85.7k|    } else {
  401|      0|        return i;
  402|      0|    }
  403|  85.7k|}
ASN1_STRING_length:
  406|  1.11M|{
  407|  1.11M|    return x->length;
  408|  1.11M|}
ASN1_STRING_get0_data:
  423|  1.11M|{
  424|  1.11M|    return x->data;
  425|  1.11M|}
asn1_lib.c:asn1_get_length:
  118|  34.2M|{
  119|  34.2M|    const unsigned char *p = *pp;
  120|  34.2M|    unsigned long ret = 0;
  121|  34.2M|    int i;
  122|       |
  123|  34.2M|    if (max-- < 1)
  ------------------
  |  Branch (123:9): [True: 0, False: 34.2M]
  ------------------
  124|      0|        return 0;
  125|  34.2M|    if (*p == 0x80) {
  ------------------
  |  Branch (125:9): [True: 0, False: 34.2M]
  ------------------
  126|      0|        *inf = 1;
  127|      0|        p++;
  128|  34.2M|    } else {
  129|  34.2M|        *inf = 0;
  130|  34.2M|        i = *p & 0x7f;
  131|  34.2M|        if (*p++ & 0x80) {
  ------------------
  |  Branch (131:13): [True: 4.48M, False: 29.7M]
  ------------------
  132|  4.48M|            if (max < i + 1)
  ------------------
  |  Branch (132:17): [True: 0, False: 4.48M]
  ------------------
  133|      0|                return 0;
  134|       |            /* Skip leading zeroes */
  135|  4.48M|            while (i > 0 && *p == 0) {
  ------------------
  |  Branch (135:20): [True: 4.48M, False: 0]
  |  Branch (135:29): [True: 0, False: 4.48M]
  ------------------
  136|      0|                p++;
  137|      0|                i--;
  138|      0|            }
  139|  4.48M|            if (i > (int)sizeof(long))
  ------------------
  |  Branch (139:17): [True: 0, False: 4.48M]
  ------------------
  140|      0|                return 0;
  141|  13.1M|            while (i > 0) {
  ------------------
  |  Branch (141:20): [True: 8.64M, False: 4.48M]
  ------------------
  142|  8.64M|                ret <<= 8;
  143|  8.64M|                ret |= *p++;
  144|  8.64M|                i--;
  145|  8.64M|            }
  146|  4.48M|            if (ret > LONG_MAX)
  ------------------
  |  Branch (146:17): [True: 0, False: 4.48M]
  ------------------
  147|      0|                return 0;
  148|  29.7M|        } else {
  149|  29.7M|            ret = i;
  150|  29.7M|        }
  151|  34.2M|    }
  152|  34.2M|    *pp = p;
  153|  34.2M|    *rl = (long)ret;
  154|  34.2M|    return 1;
  155|  34.2M|}
asn1_lib.c:asn1_put_length:
  201|  13.5M|{
  202|  13.5M|    unsigned char *p = *pp;
  203|  13.5M|    int i, len;
  204|       |
  205|  13.5M|    if (length <= 127) {
  ------------------
  |  Branch (205:9): [True: 12.9M, False: 584k]
  ------------------
  206|  12.9M|        *(p++) = (unsigned char)length;
  207|  12.9M|    } else {
  208|   584k|        len = length;
  209|  1.75M|        for (i = 0; len > 0; i++)
  ------------------
  |  Branch (209:21): [True: 1.16M, False: 584k]
  ------------------
  210|  1.16M|            len >>= 8;
  211|   584k|        *(p++) = i | 0x80;
  212|   584k|        len = i;
  213|  1.75M|        while (i-- > 0) {
  ------------------
  |  Branch (213:16): [True: 1.16M, False: 584k]
  ------------------
  214|  1.16M|            p[i] = length & 0xff;
  215|  1.16M|            length >>= 8;
  216|  1.16M|        }
  217|   584k|        p += len;
  218|   584k|    }
  219|  13.5M|    *pp = p;
  220|  13.5M|}

ASN1_tag2bit:
  106|  6.79M|{
  107|  6.79M|    if ((tag < 0) || (tag > 30))
  ------------------
  |  Branch (107:9): [True: 0, False: 6.79M]
  |  Branch (107:22): [True: 0, False: 6.79M]
  ------------------
  108|      0|        return 0;
  109|  6.79M|    return tag2bit[tag];
  110|  6.79M|}
ASN1_item_ex_d2i:
  153|   838k|{
  154|   838k|    return asn1_item_ex_d2i_intern(pval, in, len, it, tag, aclass, opt, ctx,
  155|   838k|        NULL, NULL);
  156|   838k|}
ASN1_item_d2i_ex:
  162|  2.65M|{
  163|  2.65M|    ASN1_TLC c;
  164|  2.65M|    ASN1_VALUE *ptmpval = NULL;
  165|       |
  166|  2.65M|    if (pval == NULL)
  ------------------
  |  Branch (166:9): [True: 1.41M, False: 1.23M]
  ------------------
  167|  1.41M|        pval = &ptmpval;
  168|  2.65M|    asn1_tlc_clear_nc(&c);
  ------------------
  |  |  121|  2.65M|    do {                     \
  |  |  122|  2.65M|        (c)->valid = 0;      \
  |  |  123|  2.65M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.65M]
  |  |  ------------------
  ------------------
  169|  2.65M|    if (asn1_item_ex_d2i_intern(pval, in, len, it, -1, 0, 0, &c, libctx,
  ------------------
  |  Branch (169:9): [True: 2.65M, False: 0]
  ------------------
  170|  2.65M|            propq)
  171|  2.65M|        > 0)
  172|  2.65M|        return *pval;
  173|      0|    return NULL;
  174|  2.65M|}
ASN1_item_d2i:
  179|  2.23M|{
  180|  2.23M|    return ASN1_item_d2i_ex(pval, in, len, it, NULL, NULL);
  181|  2.23M|}
asn1_item_embed_d2i:
  193|  35.5M|{
  194|  35.5M|    const ASN1_TEMPLATE *tt, *errtt = NULL;
  195|  35.5M|    const ASN1_EXTERN_FUNCS *ef;
  196|  35.5M|    const ASN1_AUX *aux;
  197|  35.5M|    ASN1_aux_cb *asn1_cb;
  198|  35.5M|    const unsigned char *p = NULL, *q;
  199|  35.5M|    unsigned char oclass;
  200|  35.5M|    char seq_eoc, seq_nolen, cst, isopt;
  201|  35.5M|    long tmplen;
  202|  35.5M|    int i;
  203|  35.5M|    int otag;
  204|  35.5M|    int ret = 0;
  205|  35.5M|    ASN1_VALUE **pchptr;
  206|       |
  207|  35.5M|    if (pval == NULL || it == NULL) {
  ------------------
  |  Branch (207:9): [True: 0, False: 35.5M]
  |  Branch (207:25): [True: 0, False: 35.5M]
  ------------------
  208|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  209|      0|        return 0;
  210|      0|    }
  211|  35.5M|    if (len <= 0) {
  ------------------
  |  Branch (211:9): [True: 0, False: 35.5M]
  ------------------
  212|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  213|      0|        return 0;
  214|      0|    }
  215|  35.5M|    aux = it->funcs;
  216|  35.5M|    if (aux && aux->asn1_cb)
  ------------------
  |  Branch (216:9): [True: 3.42M, False: 32.1M]
  |  Branch (216:16): [True: 1.34M, False: 2.07M]
  ------------------
  217|  1.34M|        asn1_cb = aux->asn1_cb;
  218|  34.2M|    else
  219|  34.2M|        asn1_cb = 0;
  220|       |
  221|  35.5M|    if (++depth > ASN1_MAX_CONSTRUCTED_NEST) {
  ------------------
  |  |   27|  35.5M|#define ASN1_MAX_CONSTRUCTED_NEST 30
  ------------------
  |  Branch (221:9): [True: 0, False: 35.5M]
  ------------------
  222|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_NESTED_TOO_DEEP);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  223|      0|        goto err;
  224|      0|    }
  225|       |
  226|  35.5M|    switch (it->itype) {
  227|  20.2M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   82|  20.2M|#define ASN1_ITYPE_PRIMITIVE 0x0
  ------------------
  |  Branch (227:5): [True: 20.2M, False: 15.3M]
  ------------------
  228|  20.2M|        if (it->templates) {
  ------------------
  |  Branch (228:13): [True: 3.85M, False: 16.3M]
  ------------------
  229|       |            /*
  230|       |             * tagging or OPTIONAL is currently illegal on an item template
  231|       |             * because the flags can't get passed down. In practice this
  232|       |             * isn't a problem: we include the relevant flags from the item
  233|       |             * template in the template itself.
  234|       |             */
  235|  3.85M|            if ((tag != -1) || opt) {
  ------------------
  |  Branch (235:17): [True: 0, False: 3.85M]
  |  Branch (235:32): [True: 0, False: 3.85M]
  ------------------
  236|      0|                ERR_raise(ERR_LIB_ASN1,
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  237|      0|                    ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE);
  238|      0|                goto err;
  239|      0|            }
  240|  3.85M|            return asn1_template_ex_d2i(pval, in, len, it->templates, opt, ctx,
  241|  3.85M|                depth, libctx, propq);
  242|  3.85M|        }
  243|  16.3M|        return asn1_d2i_ex_primitive(pval, in, len, it,
  244|  16.3M|            tag, aclass, opt, ctx);
  245|       |
  246|  3.81M|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   87|  3.81M|#define ASN1_ITYPE_MSTRING 0x5
  ------------------
  |  Branch (246:5): [True: 3.81M, False: 31.7M]
  ------------------
  247|       |        /*
  248|       |         * It never makes sense for multi-strings to have implicit tagging, so
  249|       |         * if tag != -1, then this looks like an error in the template.
  250|       |         */
  251|  3.81M|        if (tag != -1) {
  ------------------
  |  Branch (251:13): [True: 0, False: 3.81M]
  ------------------
  252|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_TEMPLATE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  253|      0|            goto err;
  254|      0|        }
  255|       |
  256|  3.81M|        p = *in;
  257|       |        /* Just read in tag and class */
  258|  3.81M|        ret = asn1_check_tlen(NULL, &otag, &oclass, NULL, NULL,
  259|  3.81M|            &p, len, -1, 0, 1, ctx);
  260|  3.81M|        if (!ret) {
  ------------------
  |  Branch (260:13): [True: 0, False: 3.81M]
  ------------------
  261|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  262|      0|            goto err;
  263|      0|        }
  264|       |
  265|       |        /* Must be UNIVERSAL class */
  266|  3.81M|        if (oclass != V_ASN1_UNIVERSAL) {
  ------------------
  |  |   49|  3.81M|#define V_ASN1_UNIVERSAL 0x00
  ------------------
  |  Branch (266:13): [True: 0, False: 3.81M]
  ------------------
  267|       |            /* If OPTIONAL, assume this is OK */
  268|      0|            if (opt)
  ------------------
  |  Branch (268:17): [True: 0, False: 0]
  ------------------
  269|      0|                return -1;
  270|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MSTRING_NOT_UNIVERSAL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  271|      0|            goto err;
  272|      0|        }
  273|       |
  274|       |        /* Check tag matches bit map */
  275|  3.81M|        if (!(ASN1_tag2bit(otag) & it->utype)) {
  ------------------
  |  Branch (275:13): [True: 0, False: 3.81M]
  ------------------
  276|       |            /* If OPTIONAL, assume this is OK */
  277|      0|            if (opt)
  ------------------
  |  Branch (277:17): [True: 0, False: 0]
  ------------------
  278|      0|                return -1;
  279|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MSTRING_WRONG_TAG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  280|      0|            goto err;
  281|      0|        }
  282|  3.81M|        return asn1_d2i_ex_primitive(pval, in, len, it, otag, 0, 0, ctx);
  283|       |
  284|  1.66M|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   86|  1.66M|#define ASN1_ITYPE_EXTERN 0x4
  ------------------
  |  Branch (284:5): [True: 1.66M, False: 33.9M]
  ------------------
  285|       |        /* Use new style d2i */
  286|  1.66M|        ef = it->funcs;
  287|  1.66M|        if (ef->asn1_ex_d2i_ex != NULL)
  ------------------
  |  Branch (287:13): [True: 824k, False: 838k]
  ------------------
  288|   824k|            return ef->asn1_ex_d2i_ex(pval, in, len, it, tag, aclass, opt, ctx,
  289|   824k|                libctx, propq);
  290|   838k|        return ef->asn1_ex_d2i(pval, in, len, it, tag, aclass, opt, ctx);
  291|       |
  292|  99.6k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   84|  99.6k|#define ASN1_ITYPE_CHOICE 0x2
  ------------------
  |  Branch (292:5): [True: 99.6k, False: 35.4M]
  ------------------
  293|       |        /*
  294|       |         * It never makes sense for CHOICE types to have implicit tagging, so
  295|       |         * if tag != -1, then this looks like an error in the template.
  296|       |         */
  297|  99.6k|        if (tag != -1) {
  ------------------
  |  Branch (297:13): [True: 0, False: 99.6k]
  ------------------
  298|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_TEMPLATE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  299|      0|            goto err;
  300|      0|        }
  301|       |
  302|  99.6k|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
  ------------------
  |  |  735|  39.4k|#define ASN1_OP_D2I_PRE 4
  ------------------
  |  Branch (302:13): [True: 39.4k, False: 60.2k]
  |  Branch (302:24): [True: 0, False: 39.4k]
  ------------------
  303|      0|            goto auxerr;
  304|  99.6k|        if (*pval) {
  ------------------
  |  Branch (304:13): [True: 0, False: 99.6k]
  ------------------
  305|       |            /* Free up and zero CHOICE value if initialised */
  306|      0|            i = ossl_asn1_get_choice_selector(pval, it);
  307|      0|            if ((i >= 0) && (i < it->tcount)) {
  ------------------
  |  Branch (307:17): [True: 0, False: 0]
  |  Branch (307:29): [True: 0, False: 0]
  ------------------
  308|      0|                tt = it->templates + i;
  309|      0|                pchptr = ossl_asn1_get_field_ptr(pval, tt);
  310|      0|                ossl_asn1_template_free(pchptr, tt);
  311|      0|                ossl_asn1_set_choice_selector(pval, -1, it);
  312|      0|            }
  313|  99.6k|        } else if (!ossl_asn1_item_ex_new_intern(pval, it, libctx, propq)) {
  ------------------
  |  Branch (313:20): [True: 0, False: 99.6k]
  ------------------
  314|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  315|      0|            goto err;
  316|      0|        }
  317|       |        /* CHOICE type, try each possibility in turn */
  318|  99.6k|        p = *in;
  319|   398k|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (319:41): [True: 398k, False: 0]
  ------------------
  320|   398k|            pchptr = ossl_asn1_get_field_ptr(pval, tt);
  321|       |            /*
  322|       |             * We mark field as OPTIONAL so its absence can be recognised.
  323|       |             */
  324|   398k|            ret = asn1_template_ex_d2i(pchptr, &p, len, tt, 1, ctx, depth,
  325|   398k|                libctx, propq);
  326|       |            /* If field not present, try the next one */
  327|   398k|            if (ret == -1)
  ------------------
  |  Branch (327:17): [True: 299k, False: 99.6k]
  ------------------
  328|   299k|                continue;
  329|       |            /* If positive return, read OK, break loop */
  330|  99.6k|            if (ret > 0)
  ------------------
  |  Branch (330:17): [True: 99.6k, False: 0]
  ------------------
  331|  99.6k|                break;
  332|       |            /*
  333|       |             * Must be an ASN1 parsing error.
  334|       |             * Free up any partial choice value
  335|       |             */
  336|      0|            ossl_asn1_template_free(pchptr, tt);
  337|      0|            errtt = tt;
  338|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  339|      0|            goto err;
  340|  99.6k|        }
  341|       |
  342|       |        /* Did we fall off the end without reading anything? */
  343|  99.6k|        if (i == it->tcount) {
  ------------------
  |  Branch (343:13): [True: 0, False: 99.6k]
  ------------------
  344|       |            /* If OPTIONAL, this is OK */
  345|      0|            if (opt) {
  ------------------
  |  Branch (345:17): [True: 0, False: 0]
  ------------------
  346|       |                /* Free and zero it */
  347|      0|                ASN1_item_ex_free(pval, it);
  348|      0|                return -1;
  349|      0|            }
  350|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_NO_MATCHING_CHOICE_TYPE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  351|      0|            goto err;
  352|      0|        }
  353|       |
  354|  99.6k|        ossl_asn1_set_choice_selector(pval, i, it);
  355|       |
  356|  99.6k|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
  ------------------
  |  |  736|  39.4k|#define ASN1_OP_D2I_POST 5
  ------------------
  |  Branch (356:13): [True: 39.4k, False: 60.2k]
  |  Branch (356:24): [True: 0, False: 39.4k]
  ------------------
  357|      0|            goto auxerr;
  358|  99.6k|        *in = p;
  359|  99.6k|        return 1;
  360|       |
  361|      0|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   88|      0|#define ASN1_ITYPE_NDEF_SEQUENCE 0x6
  ------------------
  |  Branch (361:5): [True: 0, False: 35.5M]
  ------------------
  362|  9.79M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   83|  9.79M|#define ASN1_ITYPE_SEQUENCE 0x1
  ------------------
  |  Branch (362:5): [True: 9.79M, False: 25.7M]
  ------------------
  363|  9.79M|        p = *in;
  364|  9.79M|        tmplen = len;
  365|       |
  366|       |        /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */
  367|  9.79M|        if (tag == -1) {
  ------------------
  |  Branch (367:13): [True: 9.69M, False: 99.6k]
  ------------------
  368|  9.69M|            tag = V_ASN1_SEQUENCE;
  ------------------
  |  |   76|  9.69M|#define V_ASN1_SEQUENCE 16
  ------------------
  369|  9.69M|            aclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   49|  9.69M|#define V_ASN1_UNIVERSAL 0x00
  ------------------
  370|  9.69M|        }
  371|       |        /* Get SEQUENCE length and update len, p */
  372|  9.79M|        ret = asn1_check_tlen(&len, NULL, NULL, &seq_eoc, &cst,
  373|  9.79M|            &p, len, tag, aclass, opt, ctx);
  374|  9.79M|        if (!ret) {
  ------------------
  |  Branch (374:13): [True: 0, False: 9.79M]
  ------------------
  375|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  376|      0|            goto err;
  377|  9.79M|        } else if (ret == -1)
  ------------------
  |  Branch (377:20): [True: 99.6k, False: 9.69M]
  ------------------
  378|  99.6k|            return -1;
  379|  9.69M|        if (aux && (aux->flags & ASN1_AFLG_BROKEN)) {
  ------------------
  |  |  725|  1.12M|#define ASN1_AFLG_BROKEN 4
  ------------------
  |  Branch (379:13): [True: 1.12M, False: 8.57M]
  |  Branch (379:20): [True: 0, False: 1.12M]
  ------------------
  380|      0|            len = tmplen - (long)(p - *in);
  381|      0|            seq_nolen = 1;
  382|      0|        }
  383|       |        /* If indefinite we don't do a length check */
  384|  9.69M|        else
  385|  9.69M|            seq_nolen = seq_eoc;
  386|  9.69M|        if (!cst) {
  ------------------
  |  Branch (386:13): [True: 0, False: 9.69M]
  ------------------
  387|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  388|      0|            goto err;
  389|      0|        }
  390|       |
  391|  9.69M|        if (*pval == NULL
  ------------------
  |  Branch (391:13): [True: 5.57M, False: 4.12M]
  ------------------
  392|  5.57M|            && !ossl_asn1_item_ex_new_intern(pval, it, libctx, propq)) {
  ------------------
  |  Branch (392:16): [True: 0, False: 5.57M]
  ------------------
  393|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  394|      0|            goto err;
  395|      0|        }
  396|       |
  397|  9.69M|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
  ------------------
  |  |  735|   711k|#define ASN1_OP_D2I_PRE 4
  ------------------
  |  Branch (397:13): [True: 711k, False: 8.98M]
  |  Branch (397:24): [True: 0, False: 711k]
  ------------------
  398|      0|            goto auxerr;
  399|       |
  400|       |        /* Free up and zero any ADB found */
  401|  34.3M|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (401:41): [True: 24.6M, False: 9.69M]
  ------------------
  402|  24.6M|            if (tt->flags & ASN1_TFLG_ADB_MASK) {
  ------------------
  |  |  572|  24.6M|#define ASN1_TFLG_ADB_MASK (0x3 << 8)
  ------------------
  |  Branch (402:17): [True: 0, False: 24.6M]
  ------------------
  403|      0|                const ASN1_TEMPLATE *seqtt;
  404|      0|                ASN1_VALUE **pseqval;
  405|      0|                seqtt = ossl_asn1_do_adb(*pval, tt, 0);
  406|      0|                if (seqtt == NULL)
  ------------------
  |  Branch (406:21): [True: 0, False: 0]
  ------------------
  407|      0|                    continue;
  408|      0|                pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  409|      0|                ossl_asn1_template_free(pseqval, seqtt);
  410|      0|            }
  411|  24.6M|        }
  412|       |
  413|       |        /* Get each field entry */
  414|  33.5M|        for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
  ------------------
  |  Branch (414:41): [True: 24.5M, False: 9.03M]
  ------------------
  415|  24.5M|            const ASN1_TEMPLATE *seqtt;
  416|  24.5M|            ASN1_VALUE **pseqval;
  417|  24.5M|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  418|  24.5M|            if (seqtt == NULL)
  ------------------
  |  Branch (418:17): [True: 0, False: 24.5M]
  ------------------
  419|      0|                goto err;
  420|  24.5M|            pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  421|       |            /* Have we ran out of data? */
  422|  24.5M|            if (!len)
  ------------------
  |  Branch (422:17): [True: 659k, False: 23.8M]
  ------------------
  423|   659k|                break;
  424|  23.8M|            q = p;
  425|  23.8M|            if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (425:17): [True: 0, False: 23.8M]
  ------------------
  426|      0|                if (!seq_eoc) {
  ------------------
  |  Branch (426:21): [True: 0, False: 0]
  ------------------
  427|      0|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  428|      0|                    goto err;
  429|      0|                }
  430|      0|                len -= (long)(p - q);
  431|      0|                seq_eoc = 0;
  432|      0|                break;
  433|      0|            }
  434|       |            /*
  435|       |             * This determines the OPTIONAL flag value. The field cannot be
  436|       |             * omitted if it is the last of a SEQUENCE and there is still
  437|       |             * data to be read. This isn't strictly necessary but it
  438|       |             * increases efficiency in some cases.
  439|       |             */
  440|  23.8M|            if (i == (it->tcount - 1))
  ------------------
  |  Branch (440:17): [True: 9.03M, False: 14.8M]
  ------------------
  441|  9.03M|                isopt = 0;
  442|  14.8M|            else
  443|  14.8M|                isopt = (char)(seqtt->flags & ASN1_TFLG_OPTIONAL);
  ------------------
  |  |  512|  14.8M|#define ASN1_TFLG_OPTIONAL (0x1)
  ------------------
  444|       |            /*
  445|       |             * attempt to read in field, allowing each to be OPTIONAL
  446|       |             */
  447|       |
  448|  23.8M|            ret = asn1_template_ex_d2i(pseqval, &p, len, seqtt, isopt, ctx,
  449|  23.8M|                depth, libctx, propq);
  450|  23.8M|            if (!ret) {
  ------------------
  |  Branch (450:17): [True: 0, False: 23.8M]
  ------------------
  451|      0|                errtt = seqtt;
  452|      0|                goto err;
  453|  23.8M|            } else if (ret == -1) {
  ------------------
  |  Branch (453:24): [True: 1.46M, False: 22.4M]
  ------------------
  454|       |                /*
  455|       |                 * OPTIONAL component absent. Free and zero the field.
  456|       |                 */
  457|  1.46M|                ossl_asn1_template_free(pseqval, seqtt);
  458|  1.46M|                continue;
  459|  1.46M|            }
  460|       |            /* Update length */
  461|  22.4M|            len -= (long)(p - q);
  462|  22.4M|        }
  463|       |
  464|       |        /* Check for EOC if expecting one */
  465|  9.69M|        if (seq_eoc && !asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (465:13): [True: 0, False: 9.69M]
  |  Branch (465:24): [True: 0, False: 0]
  ------------------
  466|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  467|      0|            goto err;
  468|      0|        }
  469|       |        /* Check all data read */
  470|  9.69M|        if (!seq_nolen && len) {
  ------------------
  |  Branch (470:13): [True: 9.69M, False: 0]
  |  Branch (470:27): [True: 0, False: 9.69M]
  ------------------
  471|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_SEQUENCE_LENGTH_MISMATCH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  472|      0|            goto err;
  473|      0|        }
  474|       |
  475|       |        /*
  476|       |         * If we get here we've got no more data in the SEQUENCE, however we
  477|       |         * may not have read all fields so check all remaining are OPTIONAL
  478|       |         * and clear any that are.
  479|       |         */
  480|  10.4M|        for (; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (480:16): [True: 761k, False: 9.69M]
  ------------------
  481|   761k|            const ASN1_TEMPLATE *seqtt;
  482|   761k|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  483|   761k|            if (seqtt == NULL)
  ------------------
  |  Branch (483:17): [True: 0, False: 761k]
  ------------------
  484|      0|                goto err;
  485|   761k|            if (seqtt->flags & ASN1_TFLG_OPTIONAL) {
  ------------------
  |  |  512|   761k|#define ASN1_TFLG_OPTIONAL (0x1)
  ------------------
  |  Branch (485:17): [True: 761k, False: 0]
  ------------------
  486|   761k|                ASN1_VALUE **pseqval;
  487|   761k|                pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  488|   761k|                ossl_asn1_template_free(pseqval, seqtt);
  489|   761k|            } else {
  490|      0|                errtt = seqtt;
  491|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_FIELD_MISSING);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  492|      0|                goto err;
  493|      0|            }
  494|   761k|        }
  495|       |        /* Save encoding */
  496|  9.69M|        if (!ossl_asn1_enc_save(pval, *in, (long)(p - *in), it))
  ------------------
  |  Branch (496:13): [True: 0, False: 9.69M]
  ------------------
  497|      0|            goto auxerr;
  498|  9.69M|        if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
  ------------------
  |  |  736|   711k|#define ASN1_OP_D2I_POST 5
  ------------------
  |  Branch (498:13): [True: 711k, False: 8.98M]
  |  Branch (498:24): [True: 0, False: 711k]
  ------------------
  499|      0|            goto auxerr;
  500|  9.69M|        *in = p;
  501|  9.69M|        return 1;
  502|       |
  503|      0|    default:
  ------------------
  |  Branch (503:5): [True: 0, False: 35.5M]
  ------------------
  504|      0|        return 0;
  505|  35.5M|    }
  506|      0|auxerr:
  507|      0|    ERR_raise(ERR_LIB_ASN1, ASN1_R_AUX_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  508|      0|err:
  509|      0|    if (errtt)
  ------------------
  |  Branch (509:9): [True: 0, False: 0]
  ------------------
  510|      0|        ERR_add_error_data(4, "Field=", errtt->field_name,
  511|      0|            ", Type=", it->sname);
  512|      0|    else
  513|      0|        ERR_add_error_data(2, "Type=", it->sname);
  514|      0|    return 0;
  515|      0|}
tasn_dec.c:asn1_item_ex_d2i_intern:
  136|  3.48M|{
  137|  3.48M|    int rv;
  138|       |
  139|  3.48M|    if (pval == NULL || it == NULL) {
  ------------------
  |  Branch (139:9): [True: 0, False: 3.48M]
  |  Branch (139:25): [True: 0, False: 3.48M]
  ------------------
  140|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  141|      0|        return 0;
  142|      0|    }
  143|  3.48M|    rv = asn1_item_embed_d2i(pval, in, len, it, tag, aclass, opt, ctx, 0,
  144|  3.48M|        libctx, propq);
  145|  3.48M|    if (rv <= 0)
  ------------------
  |  Branch (145:9): [True: 0, False: 3.48M]
  ------------------
  146|      0|        ASN1_item_ex_free(pval, it);
  147|  3.48M|    return rv;
  148|  3.48M|}
tasn_dec.c:asn1_template_ex_d2i:
  527|  28.1M|{
  528|  28.1M|    int flags, aclass;
  529|  28.1M|    int ret;
  530|  28.1M|    long len;
  531|  28.1M|    const unsigned char *p, *q;
  532|  28.1M|    char exp_eoc;
  533|  28.1M|    if (!val)
  ------------------
  |  Branch (533:9): [True: 0, False: 28.1M]
  ------------------
  534|      0|        return 0;
  535|  28.1M|    flags = tt->flags;
  536|  28.1M|    aclass = flags & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  564|  28.1M|#define ASN1_TFLG_TAG_CLASS (0x3 << 6)
  ------------------
  537|       |
  538|  28.1M|    p = *in;
  539|       |
  540|       |    /* Check if EXPLICIT tag expected */
  541|  28.1M|    if (flags & ASN1_TFLG_EXPTAG) {
  ------------------
  |  |  539|  28.1M|#define ASN1_TFLG_EXPTAG (0x2 << 3)
  ------------------
  |  Branch (541:9): [True: 917k, False: 27.2M]
  ------------------
  542|   917k|        char cst;
  543|       |        /*
  544|       |         * Need to work out amount of data available to the inner content and
  545|       |         * where it starts: so read in EXPLICIT header to get the info.
  546|       |         */
  547|   917k|        ret = asn1_check_tlen(&len, NULL, NULL, &exp_eoc, &cst,
  548|   917k|            &p, inlen, tt->tag, aclass, opt, ctx);
  549|   917k|        q = p;
  550|   917k|        if (!ret) {
  ------------------
  |  Branch (550:13): [True: 0, False: 917k]
  ------------------
  551|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  552|      0|            return 0;
  553|   917k|        } else if (ret == -1)
  ------------------
  |  Branch (553:20): [True: 39.4k, False: 877k]
  ------------------
  554|  39.4k|            return -1;
  555|   877k|        if (!cst) {
  ------------------
  |  Branch (555:13): [True: 0, False: 877k]
  ------------------
  556|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  557|      0|            return 0;
  558|      0|        }
  559|       |        /* We've found the field so it can't be OPTIONAL now */
  560|   877k|        ret = asn1_template_noexp_d2i(val, &p, len, tt, 0, ctx, depth, libctx,
  561|   877k|            propq);
  562|   877k|        if (!ret) {
  ------------------
  |  Branch (562:13): [True: 0, False: 877k]
  ------------------
  563|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  564|      0|            return 0;
  565|      0|        }
  566|       |        /* We read the field in OK so update length */
  567|   877k|        len -= (long)(p - q);
  568|   877k|        if (exp_eoc) {
  ------------------
  |  Branch (568:13): [True: 0, False: 877k]
  ------------------
  569|       |            /* If NDEF we must have an EOC here */
  570|      0|            if (!asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (570:17): [True: 0, False: 0]
  ------------------
  571|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  572|      0|                goto err;
  573|      0|            }
  574|   877k|        } else {
  575|       |            /*
  576|       |             * Otherwise we must hit the EXPLICIT tag end or its an error
  577|       |             */
  578|   877k|            if (len) {
  ------------------
  |  Branch (578:17): [True: 0, False: 877k]
  ------------------
  579|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_EXPLICIT_LENGTH_MISMATCH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  580|      0|                goto err;
  581|      0|            }
  582|   877k|        }
  583|   877k|    } else
  584|  27.2M|        return asn1_template_noexp_d2i(val, in, inlen, tt, opt, ctx, depth,
  585|  27.2M|            libctx, propq);
  586|       |
  587|   877k|    *in = p;
  588|   877k|    return 1;
  589|       |
  590|      0|err:
  591|      0|    return 0;
  592|  28.1M|}
tasn_dec.c:asn1_template_noexp_d2i:
  599|  28.0M|{
  600|  28.0M|    int flags, aclass;
  601|  28.0M|    int ret;
  602|  28.0M|    ASN1_VALUE *tval;
  603|  28.0M|    const unsigned char *p, *q;
  604|  28.0M|    if (!val)
  ------------------
  |  Branch (604:9): [True: 0, False: 28.0M]
  ------------------
  605|      0|        return 0;
  606|  28.0M|    flags = tt->flags;
  607|  28.0M|    aclass = flags & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  564|  28.0M|#define ASN1_TFLG_TAG_CLASS (0x3 << 6)
  ------------------
  608|       |
  609|  28.0M|    p = *in;
  610|       |
  611|       |    /*
  612|       |     * If field is embedded then val needs fixing so it is a pointer to
  613|       |     * a pointer to a field.
  614|       |     */
  615|  28.0M|    if (tt->flags & ASN1_TFLG_EMBED) {
  ------------------
  |  |  586|  28.0M|#define ASN1_TFLG_EMBED (0x1 << 12)
  ------------------
  |  Branch (615:9): [True: 3.89M, False: 24.1M]
  ------------------
  616|  3.89M|        tval = (ASN1_VALUE *)val;
  617|  3.89M|        val = &tval;
  618|  3.89M|    }
  619|       |
  620|  28.0M|    if (flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  528|  28.0M|#define ASN1_TFLG_SK_MASK (0x3 << 1)
  ------------------
  |  Branch (620:9): [True: 4.32M, False: 23.7M]
  ------------------
  621|       |        /* SET OF, SEQUENCE OF */
  622|  4.32M|        int sktag, skaclass;
  623|  4.32M|        char sk_eoc;
  624|       |        /* First work out expected inner tag value */
  625|  4.32M|        if (flags & ASN1_TFLG_IMPTAG) {
  ------------------
  |  |  536|  4.32M|#define ASN1_TFLG_IMPTAG (0x1 << 3)
  ------------------
  |  Branch (625:13): [True: 50.9k, False: 4.27M]
  ------------------
  626|  50.9k|            sktag = tt->tag;
  627|  50.9k|            skaclass = aclass;
  628|  4.27M|        } else {
  629|  4.27M|            skaclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   49|  4.27M|#define V_ASN1_UNIVERSAL 0x00
  ------------------
  630|  4.27M|            if (flags & ASN1_TFLG_SET_OF)
  ------------------
  |  |  515|  4.27M|#define ASN1_TFLG_SET_OF (0x1 << 1)
  ------------------
  |  Branch (630:17): [True: 2.98M, False: 1.28M]
  ------------------
  631|  2.98M|                sktag = V_ASN1_SET;
  ------------------
  |  |   77|  2.98M|#define V_ASN1_SET 17
  ------------------
  632|  1.28M|            else
  633|  1.28M|                sktag = V_ASN1_SEQUENCE;
  ------------------
  |  |   76|  1.28M|#define V_ASN1_SEQUENCE 16
  ------------------
  634|  4.27M|        }
  635|       |        /* Get the tag */
  636|  4.32M|        ret = asn1_check_tlen(&len, NULL, NULL, &sk_eoc, NULL,
  637|  4.32M|            &p, len, sktag, skaclass, opt, ctx);
  638|  4.32M|        if (!ret) {
  ------------------
  |  Branch (638:13): [True: 0, False: 4.32M]
  ------------------
  639|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  640|      0|            return 0;
  641|  4.32M|        } else if (ret == -1)
  ------------------
  |  Branch (641:20): [True: 0, False: 4.32M]
  ------------------
  642|      0|            return -1;
  643|  4.32M|        if (*val == NULL)
  ------------------
  |  Branch (643:13): [True: 4.32M, False: 0]
  ------------------
  644|  4.32M|            *val = (ASN1_VALUE *)sk_ASN1_VALUE_new_null();
  ------------------
  |  |  890|  4.32M|#define sk_ASN1_VALUE_new_null() ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_null())
  ------------------
  645|      0|        else {
  646|       |            /*
  647|       |             * We've got a valid STACK: free up any items present
  648|       |             */
  649|      0|            STACK_OF(ASN1_VALUE) *sktmp = (STACK_OF(ASN1_VALUE) *)*val;
  ------------------
  |  |   33|      0|#define STACK_OF(type) struct stack_st_##type
  ------------------
  650|      0|            ASN1_VALUE *vtmp;
  651|      0|            while (sk_ASN1_VALUE_num(sktmp) > 0) {
  ------------------
  |  |  887|      0|#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
  ------------------
  |  Branch (651:20): [True: 0, False: 0]
  ------------------
  652|      0|                vtmp = sk_ASN1_VALUE_pop(sktmp);
  ------------------
  |  |  899|      0|#define sk_ASN1_VALUE_pop(sk) ((ASN1_VALUE *)OPENSSL_sk_pop(ossl_check_ASN1_VALUE_sk_type(sk)))
  ------------------
  653|      0|                ASN1_item_ex_free(&vtmp, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  428|      0|#define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  654|      0|            }
  655|      0|        }
  656|       |
  657|  4.32M|        if (*val == NULL) {
  ------------------
  |  Branch (657:13): [True: 0, False: 4.32M]
  ------------------
  658|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  659|      0|            goto err;
  660|      0|        }
  661|       |
  662|       |        /* Read as many items as we can */
  663|  11.8M|        while (len > 0) {
  ------------------
  |  Branch (663:16): [True: 7.49M, False: 4.32M]
  ------------------
  664|  7.49M|            ASN1_VALUE *skfield;
  665|  7.49M|            q = p;
  666|       |            /* See if EOC found */
  667|  7.49M|            if (asn1_check_eoc(&p, len)) {
  ------------------
  |  Branch (667:17): [True: 0, False: 7.49M]
  ------------------
  668|      0|                if (!sk_eoc) {
  ------------------
  |  Branch (668:21): [True: 0, False: 0]
  ------------------
  669|      0|                    ERR_raise(ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  670|      0|                    goto err;
  671|      0|                }
  672|      0|                len -= (long)(p - q);
  673|      0|                sk_eoc = 0;
  674|      0|                break;
  675|      0|            }
  676|  7.49M|            skfield = NULL;
  677|  7.49M|            if (asn1_item_embed_d2i(&skfield, &p, len,
  ------------------
  |  Branch (677:17): [True: 0, False: 7.49M]
  ------------------
  678|  7.49M|                    ASN1_ITEM_ptr(tt->item), -1, 0, 0, ctx,
  ------------------
  |  |  428|  7.49M|#define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  679|  7.49M|                    depth, libctx, propq)
  680|  7.49M|                <= 0) {
  681|      0|                ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  682|       |                /* |skfield| may be partially allocated despite failure. */
  683|      0|                ASN1_item_free(skfield, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  428|      0|#define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  684|      0|                goto err;
  685|      0|            }
  686|  7.49M|            len -= (long)(p - q);
  687|  7.49M|            if (!sk_ASN1_VALUE_push((STACK_OF(ASN1_VALUE) *)*val, skfield)) {
  ------------------
  |  |  897|  7.49M|#define sk_ASN1_VALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr))
  ------------------
  |  Branch (687:17): [True: 0, False: 7.49M]
  ------------------
  688|      0|                ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  689|      0|                ASN1_item_free(skfield, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  428|      0|#define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  690|      0|                goto err;
  691|      0|            }
  692|  7.49M|        }
  693|  4.32M|        if (sk_eoc) {
  ------------------
  |  Branch (693:13): [True: 0, False: 4.32M]
  ------------------
  694|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_EOC);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  695|      0|            goto err;
  696|      0|        }
  697|  23.7M|    } else if (flags & ASN1_TFLG_IMPTAG) {
  ------------------
  |  |  536|  23.7M|#define ASN1_TFLG_IMPTAG (0x1 << 3)
  ------------------
  |  Branch (697:16): [True: 1.21M, False: 22.5M]
  ------------------
  698|       |        /* IMPLICIT tagging */
  699|  1.21M|        ret = asn1_item_embed_d2i(val, &p, len,
  700|  1.21M|            ASN1_ITEM_ptr(tt->item), tt->tag, aclass, opt,
  ------------------
  |  |  428|  1.21M|#define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  701|  1.21M|            ctx, depth, libctx, propq);
  702|  1.21M|        if (!ret) {
  ------------------
  |  Branch (702:13): [True: 0, False: 1.21M]
  ------------------
  703|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  704|      0|            goto err;
  705|  1.21M|        } else if (ret == -1)
  ------------------
  |  Branch (705:20): [True: 1.08M, False: 132k]
  ------------------
  706|  1.08M|            return -1;
  707|  22.5M|    } else {
  708|       |        /* Nothing special */
  709|  22.5M|        ret = asn1_item_embed_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  428|  22.5M|#define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  710|  22.5M|            -1, 0, opt, ctx, depth, libctx, propq);
  711|  22.5M|        if (!ret) {
  ------------------
  |  Branch (711:13): [True: 0, False: 22.5M]
  ------------------
  712|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  713|      0|            goto err;
  714|  22.5M|        } else if (ret == -1)
  ------------------
  |  Branch (714:20): [True: 635k, False: 21.9M]
  ------------------
  715|   635k|            return -1;
  716|  22.5M|    }
  717|       |
  718|  26.3M|    *in = p;
  719|  26.3M|    return 1;
  720|       |
  721|      0|err:
  722|      0|    return 0;
  723|  28.0M|}
tasn_dec.c:asn1_d2i_ex_primitive:
  729|  20.1M|{
  730|  20.1M|    int ret = 0, utype;
  731|  20.1M|    long plen;
  732|  20.1M|    char cst, inf, free_cont = 0;
  733|  20.1M|    const unsigned char *p;
  734|  20.1M|    BUF_MEM buf = { 0, NULL, 0, 0 };
  735|  20.1M|    const unsigned char *cont = NULL;
  736|  20.1M|    long len;
  737|       |
  738|  20.1M|    if (pval == NULL) {
  ------------------
  |  Branch (738:9): [True: 0, False: 20.1M]
  ------------------
  739|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  740|      0|        return 0; /* Should never happen */
  741|      0|    }
  742|       |
  743|  20.1M|    if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   87|  20.1M|#define ASN1_ITYPE_MSTRING 0x5
  ------------------
  |  Branch (743:9): [True: 3.81M, False: 16.3M]
  ------------------
  744|  3.81M|        utype = tag;
  745|  3.81M|        tag = -1;
  746|  3.81M|    } else
  747|  16.3M|        utype = it->utype;
  748|       |
  749|  20.1M|    if (utype == V_ASN1_ANY) {
  ------------------
  |  |   60|  20.1M|#define V_ASN1_ANY -4 /* used in ASN1 template code */
  ------------------
  |  Branch (749:9): [True: 1.83M, False: 18.3M]
  ------------------
  750|       |        /* If type is ANY need to figure out type from tag */
  751|  1.83M|        unsigned char oclass;
  752|  1.83M|        if (tag >= 0) {
  ------------------
  |  Branch (752:13): [True: 0, False: 1.83M]
  ------------------
  753|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_TAGGED_ANY);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  754|      0|            return 0;
  755|      0|        }
  756|  1.83M|        if (opt) {
  ------------------
  |  Branch (756:13): [True: 0, False: 1.83M]
  ------------------
  757|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONAL_ANY);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  758|      0|            return 0;
  759|      0|        }
  760|  1.83M|        p = *in;
  761|  1.83M|        ret = asn1_check_tlen(NULL, &utype, &oclass, NULL, NULL,
  762|  1.83M|            &p, inlen, -1, 0, 0, ctx);
  763|  1.83M|        if (!ret) {
  ------------------
  |  Branch (763:13): [True: 0, False: 1.83M]
  ------------------
  764|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  765|      0|            return 0;
  766|      0|        }
  767|  1.83M|        if (oclass != V_ASN1_UNIVERSAL)
  ------------------
  |  |   49|  1.83M|#define V_ASN1_UNIVERSAL 0x00
  ------------------
  |  Branch (767:13): [True: 0, False: 1.83M]
  ------------------
  768|      0|            utype = V_ASN1_OTHER;
  ------------------
  |  |   59|      0|#define V_ASN1_OTHER -3 /* used in ASN1_TYPE */
  ------------------
  769|  1.83M|    }
  770|  20.1M|    if (tag == -1) {
  ------------------
  |  Branch (770:9): [True: 19.0M, False: 1.11M]
  ------------------
  771|  19.0M|        tag = utype;
  772|  19.0M|        aclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   49|  19.0M|#define V_ASN1_UNIVERSAL 0x00
  ------------------
  773|  19.0M|    }
  774|  20.1M|    p = *in;
  775|       |    /* Check header */
  776|  20.1M|    ret = asn1_check_tlen(&plen, NULL, NULL, &inf, &cst,
  777|  20.1M|        &p, inlen, tag, aclass, opt, ctx);
  778|  20.1M|    if (!ret) {
  ------------------
  |  Branch (778:9): [True: 0, False: 20.1M]
  ------------------
  779|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  780|      0|        return 0;
  781|  20.1M|    } else if (ret == -1)
  ------------------
  |  Branch (781:16): [True: 1.61M, False: 18.5M]
  ------------------
  782|  1.61M|        return -1;
  783|  18.5M|    ret = 0;
  784|       |    /* SEQUENCE, SET and "OTHER" are left in encoded form */
  785|  18.5M|    if ((utype == V_ASN1_SEQUENCE)
  ------------------
  |  |   76|  18.5M|#define V_ASN1_SEQUENCE 16
  ------------------
  |  Branch (785:9): [True: 0, False: 18.5M]
  ------------------
  786|  18.5M|        || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER)) {
  ------------------
  |  |   77|  18.5M|#define V_ASN1_SET 17
  ------------------
                      || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER)) {
  ------------------
  |  |   59|  18.5M|#define V_ASN1_OTHER -3 /* used in ASN1_TYPE */
  ------------------
  |  Branch (786:12): [True: 0, False: 18.5M]
  |  Branch (786:37): [True: 0, False: 18.5M]
  ------------------
  787|       |        /*
  788|       |         * Clear context cache for type OTHER because the auto clear when we
  789|       |         * have a exact match won't work
  790|       |         */
  791|      0|        if (utype == V_ASN1_OTHER) {
  ------------------
  |  |   59|      0|#define V_ASN1_OTHER -3 /* used in ASN1_TYPE */
  ------------------
  |  Branch (791:13): [True: 0, False: 0]
  ------------------
  792|      0|            asn1_tlc_clear(ctx);
  ------------------
  |  |  115|      0|    do {                    \
  |  |  116|      0|        if ((c) != NULL)    \
  |  |  ------------------
  |  |  |  Branch (116:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  117|      0|            (c)->valid = 0; \
  |  |  118|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  793|      0|        }
  794|       |        /* SEQUENCE and SET must be constructed */
  795|      0|        else if (!cst) {
  ------------------
  |  Branch (795:18): [True: 0, False: 0]
  ------------------
  796|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TYPE_NOT_CONSTRUCTED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  797|      0|            return 0;
  798|      0|        }
  799|       |
  800|      0|        cont = *in;
  801|       |        /* If indefinite length constructed find the real end */
  802|      0|        if (inf) {
  ------------------
  |  Branch (802:13): [True: 0, False: 0]
  ------------------
  803|      0|            if (!asn1_find_end(&p, plen, inf))
  ------------------
  |  Branch (803:17): [True: 0, False: 0]
  ------------------
  804|      0|                goto err;
  805|      0|            len = (long)(p - cont);
  806|      0|        } else {
  807|      0|            len = (long)(p - cont) + plen;
  808|      0|            p += plen;
  809|      0|        }
  810|  18.5M|    } else if (cst) {
  ------------------
  |  Branch (810:16): [True: 0, False: 18.5M]
  ------------------
  811|      0|        if (utype == V_ASN1_NULL || utype == V_ASN1_BOOLEAN
  ------------------
  |  |   69|      0|#define V_ASN1_NULL 5
  ------------------
                      if (utype == V_ASN1_NULL || utype == V_ASN1_BOOLEAN
  ------------------
  |  |   65|      0|#define V_ASN1_BOOLEAN 1
  ------------------
  |  Branch (811:13): [True: 0, False: 0]
  |  Branch (811:37): [True: 0, False: 0]
  ------------------
  812|      0|            || utype == V_ASN1_OBJECT || utype == V_ASN1_INTEGER
  ------------------
  |  |   70|      0|#define V_ASN1_OBJECT 6
  ------------------
                          || utype == V_ASN1_OBJECT || utype == V_ASN1_INTEGER
  ------------------
  |  |   66|      0|#define V_ASN1_INTEGER 2
  ------------------
  |  Branch (812:16): [True: 0, False: 0]
  |  Branch (812:42): [True: 0, False: 0]
  ------------------
  813|      0|            || utype == V_ASN1_ENUMERATED) {
  ------------------
  |  |   74|      0|#define V_ASN1_ENUMERATED 10
  ------------------
  |  Branch (813:16): [True: 0, False: 0]
  ------------------
  814|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_TYPE_NOT_PRIMITIVE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  815|      0|            return 0;
  816|      0|        }
  817|       |
  818|       |        /* Free any returned 'buf' content */
  819|      0|        free_cont = 1;
  820|       |        /*
  821|       |         * Should really check the internal tags are correct but some things
  822|       |         * may get this wrong. The relevant specs say that constructed string
  823|       |         * types should be OCTET STRINGs internally irrespective of the type.
  824|       |         * So instead just check for UNIVERSAL class and ignore the tag.
  825|       |         */
  826|      0|        if (!asn1_collect(&buf, &p, plen, inf, -1, V_ASN1_UNIVERSAL, 0)) {
  ------------------
  |  |   49|      0|#define V_ASN1_UNIVERSAL 0x00
  ------------------
  |  Branch (826:13): [True: 0, False: 0]
  ------------------
  827|      0|            goto err;
  828|      0|        }
  829|      0|        len = (long)buf.length;
  830|       |        /* Append a final null to string */
  831|      0|        if (!BUF_MEM_grow_clean(&buf, len + 1)) {
  ------------------
  |  Branch (831:13): [True: 0, False: 0]
  ------------------
  832|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  833|      0|            goto err;
  834|      0|        }
  835|      0|        buf.data[len] = 0;
  836|      0|        cont = (const unsigned char *)buf.data;
  837|  18.5M|    } else {
  838|  18.5M|        cont = p;
  839|  18.5M|        len = plen;
  840|  18.5M|        p += plen;
  841|  18.5M|    }
  842|       |
  843|       |    /* We now have content length and type: translate into a structure */
  844|       |    /* asn1_ex_c2i may reuse allocated buffer, and so sets free_cont to 0 */
  845|  18.5M|    if (!asn1_ex_c2i(pval, cont, len, utype, &free_cont, it))
  ------------------
  |  Branch (845:9): [True: 0, False: 18.5M]
  ------------------
  846|      0|        goto err;
  847|       |
  848|  18.5M|    *in = p;
  849|  18.5M|    ret = 1;
  850|  18.5M|err:
  851|  18.5M|    if (free_cont)
  ------------------
  |  Branch (851:9): [True: 0, False: 18.5M]
  ------------------
  852|      0|        OPENSSL_free(buf.data);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  853|  18.5M|    return ret;
  854|  18.5M|}
tasn_dec.c:asn1_ex_c2i:
  860|  18.5M|{
  861|  18.5M|    ASN1_VALUE **opval = NULL;
  862|  18.5M|    ASN1_STRING *stmp;
  863|  18.5M|    ASN1_TYPE *typ = NULL;
  864|  18.5M|    int ret = 0;
  865|  18.5M|    const ASN1_PRIMITIVE_FUNCS *pf;
  866|  18.5M|    ASN1_INTEGER **tint;
  867|  18.5M|    pf = it->funcs;
  868|       |
  869|  18.5M|    if (pf && pf->prim_c2i)
  ------------------
  |  Branch (869:9): [True: 598k, False: 17.9M]
  |  Branch (869:15): [True: 598k, False: 0]
  ------------------
  870|   598k|        return pf->prim_c2i(pval, cont, len, utype, free_cont, it);
  871|       |    /* If ANY type clear type and set pointer to internal value */
  872|  17.9M|    if (it->utype == V_ASN1_ANY) {
  ------------------
  |  |   60|  17.9M|#define V_ASN1_ANY -4 /* used in ASN1 template code */
  ------------------
  |  Branch (872:9): [True: 1.83M, False: 16.1M]
  ------------------
  873|  1.83M|        if (*pval == NULL) {
  ------------------
  |  Branch (873:13): [True: 1.83M, False: 0]
  ------------------
  874|  1.83M|            typ = ASN1_TYPE_new();
  875|  1.83M|            if (typ == NULL)
  ------------------
  |  Branch (875:17): [True: 0, False: 1.83M]
  ------------------
  876|      0|                goto err;
  877|  1.83M|            *pval = (ASN1_VALUE *)typ;
  878|  1.83M|        } else
  879|      0|            typ = (ASN1_TYPE *)*pval;
  880|       |
  881|  1.83M|        if (utype != typ->type)
  ------------------
  |  Branch (881:13): [True: 1.83M, False: 0]
  ------------------
  882|  1.83M|            ASN1_TYPE_set(typ, utype, NULL);
  883|  1.83M|        opval = pval;
  884|  1.83M|        pval = &typ->value.asn1_value;
  885|  1.83M|    }
  886|  17.9M|    switch (utype) {
  887|  6.80M|    case V_ASN1_OBJECT:
  ------------------
  |  |   70|  6.80M|#define V_ASN1_OBJECT 6
  ------------------
  |  Branch (887:5): [True: 6.80M, False: 11.1M]
  ------------------
  888|  6.80M|        if (!ossl_c2i_ASN1_OBJECT((ASN1_OBJECT **)pval, &cont, len))
  ------------------
  |  Branch (888:13): [True: 0, False: 6.80M]
  ------------------
  889|      0|            goto err;
  890|  6.80M|        break;
  891|       |
  892|  6.80M|    case V_ASN1_NULL:
  ------------------
  |  |   69|  1.49M|#define V_ASN1_NULL 5
  ------------------
  |  Branch (892:5): [True: 1.49M, False: 16.4M]
  ------------------
  893|  1.49M|        if (len) {
  ------------------
  |  Branch (893:13): [True: 0, False: 1.49M]
  ------------------
  894|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_NULL_IS_WRONG_LENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  895|      0|            goto err;
  896|      0|        }
  897|  1.49M|        *pval = (ASN1_VALUE *)1;
  898|  1.49M|        break;
  899|       |
  900|  1.12M|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   65|  1.12M|#define V_ASN1_BOOLEAN 1
  ------------------
  |  Branch (900:5): [True: 1.12M, False: 16.8M]
  ------------------
  901|  1.12M|        if (len != 1) {
  ------------------
  |  Branch (901:13): [True: 0, False: 1.12M]
  ------------------
  902|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BOOLEAN_IS_WRONG_LENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  903|      0|            goto err;
  904|  1.12M|        } else {
  905|  1.12M|            ASN1_BOOLEAN *tbool;
  906|  1.12M|            tbool = (ASN1_BOOLEAN *)pval;
  907|  1.12M|            *tbool = *cont;
  908|  1.12M|        }
  909|  1.12M|        break;
  910|       |
  911|  1.98M|    case V_ASN1_BIT_STRING:
  ------------------
  |  |   67|  1.98M|#define V_ASN1_BIT_STRING 3
  ------------------
  |  Branch (911:5): [True: 1.98M, False: 15.9M]
  ------------------
  912|  1.98M|        if (!ossl_c2i_ASN1_BIT_STRING((ASN1_BIT_STRING **)pval, &cont, len))
  ------------------
  |  Branch (912:13): [True: 0, False: 1.98M]
  ------------------
  913|      0|            goto err;
  914|  1.98M|        break;
  915|       |
  916|  1.98M|    case V_ASN1_INTEGER:
  ------------------
  |  |   66|   843k|#define V_ASN1_INTEGER 2
  ------------------
  |  Branch (916:5): [True: 843k, False: 17.1M]
  ------------------
  917|   843k|    case V_ASN1_ENUMERATED:
  ------------------
  |  |   74|   843k|#define V_ASN1_ENUMERATED 10
  ------------------
  |  Branch (917:5): [True: 0, False: 17.9M]
  ------------------
  918|   843k|        tint = (ASN1_INTEGER **)pval;
  919|   843k|        if (!ossl_c2i_ASN1_INTEGER(tint, &cont, len))
  ------------------
  |  Branch (919:13): [True: 0, False: 843k]
  ------------------
  920|      0|            goto err;
  921|       |        /* Fixup type to match the expected form */
  922|   843k|        (*tint)->type = utype | ((*tint)->type & V_ASN1_NEG);
  ------------------
  |  |   99|   843k|#define V_ASN1_NEG 0x100
  ------------------
  923|   843k|        break;
  924|       |
  925|  1.83M|    case V_ASN1_OCTET_STRING:
  ------------------
  |  |   68|  1.83M|#define V_ASN1_OCTET_STRING 4
  ------------------
  |  Branch (925:5): [True: 1.83M, False: 16.1M]
  ------------------
  926|  1.83M|    case V_ASN1_NUMERICSTRING:
  ------------------
  |  |   78|  1.83M|#define V_ASN1_NUMERICSTRING 18
  ------------------
  |  Branch (926:5): [True: 0, False: 17.9M]
  ------------------
  927|  4.05M|    case V_ASN1_PRINTABLESTRING:
  ------------------
  |  |   79|  4.05M|#define V_ASN1_PRINTABLESTRING 19
  ------------------
  |  Branch (927:5): [True: 2.22M, False: 15.7M]
  ------------------
  928|  4.05M|    case V_ASN1_T61STRING:
  ------------------
  |  |   80|  4.05M|#define V_ASN1_T61STRING 20
  ------------------
  |  Branch (928:5): [True: 5.64k, False: 17.9M]
  ------------------
  929|  4.05M|    case V_ASN1_VIDEOTEXSTRING:
  ------------------
  |  |   82|  4.05M|#define V_ASN1_VIDEOTEXSTRING 21
  ------------------
  |  Branch (929:5): [True: 0, False: 17.9M]
  ------------------
  930|  4.10M|    case V_ASN1_IA5STRING:
  ------------------
  |  |   83|  4.10M|#define V_ASN1_IA5STRING 22
  ------------------
  |  Branch (930:5): [True: 52.0k, False: 17.8M]
  ------------------
  931|  4.92M|    case V_ASN1_UTCTIME:
  ------------------
  |  |   84|  4.92M|#define V_ASN1_UTCTIME 23
  ------------------
  |  Branch (931:5): [True: 818k, False: 17.1M]
  ------------------
  932|  4.93M|    case V_ASN1_GENERALIZEDTIME:
  ------------------
  |  |   85|  4.93M|#define V_ASN1_GENERALIZEDTIME 24
  ------------------
  |  Branch (932:5): [True: 5.64k, False: 17.9M]
  ------------------
  933|  4.93M|    case V_ASN1_GRAPHICSTRING:
  ------------------
  |  |   86|  4.93M|#define V_ASN1_GRAPHICSTRING 25
  ------------------
  |  Branch (933:5): [True: 0, False: 17.9M]
  ------------------
  934|  4.93M|    case V_ASN1_VISIBLESTRING:
  ------------------
  |  |   88|  4.93M|#define V_ASN1_VISIBLESTRING 26 /* alias */
  ------------------
  |  Branch (934:5): [True: 0, False: 17.9M]
  ------------------
  935|  4.93M|    case V_ASN1_GENERALSTRING:
  ------------------
  |  |   89|  4.93M|#define V_ASN1_GENERALSTRING 27
  ------------------
  |  Branch (935:5): [True: 0, False: 17.9M]
  ------------------
  936|  4.93M|    case V_ASN1_UNIVERSALSTRING:
  ------------------
  |  |   90|  4.93M|#define V_ASN1_UNIVERSALSTRING 28
  ------------------
  |  Branch (936:5): [True: 0, False: 17.9M]
  ------------------
  937|  4.93M|    case V_ASN1_BMPSTRING:
  ------------------
  |  |   91|  4.93M|#define V_ASN1_BMPSTRING 30
  ------------------
  |  Branch (937:5): [True: 0, False: 17.9M]
  ------------------
  938|  5.68M|    case V_ASN1_UTF8STRING:
  ------------------
  |  |   75|  5.68M|#define V_ASN1_UTF8STRING 12
  ------------------
  |  Branch (938:5): [True: 754k, False: 17.1M]
  ------------------
  939|  5.68M|    case V_ASN1_OTHER:
  ------------------
  |  |   59|  5.68M|#define V_ASN1_OTHER -3 /* used in ASN1_TYPE */
  ------------------
  |  Branch (939:5): [True: 0, False: 17.9M]
  ------------------
  940|  5.68M|    case V_ASN1_SET:
  ------------------
  |  |   77|  5.68M|#define V_ASN1_SET 17
  ------------------
  |  Branch (940:5): [True: 0, False: 17.9M]
  ------------------
  941|  5.68M|    case V_ASN1_SEQUENCE:
  ------------------
  |  |   76|  5.68M|#define V_ASN1_SEQUENCE 16
  ------------------
  |  Branch (941:5): [True: 0, False: 17.9M]
  ------------------
  942|  5.68M|    default:
  ------------------
  |  Branch (942:5): [True: 0, False: 17.9M]
  ------------------
  943|  5.68M|        if (utype == V_ASN1_BMPSTRING && (len & 1)) {
  ------------------
  |  |   91|  11.3M|#define V_ASN1_BMPSTRING 30
  ------------------
  |  Branch (943:13): [True: 0, False: 5.68M]
  |  Branch (943:42): [True: 0, False: 0]
  ------------------
  944|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BMPSTRING_IS_WRONG_LENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  945|      0|            goto err;
  946|      0|        }
  947|  5.68M|        if (utype == V_ASN1_UNIVERSALSTRING && (len & 3)) {
  ------------------
  |  |   90|  11.3M|#define V_ASN1_UNIVERSALSTRING 28
  ------------------
  |  Branch (947:13): [True: 0, False: 5.68M]
  |  Branch (947:48): [True: 0, False: 0]
  ------------------
  948|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  949|      0|            goto err;
  950|      0|        }
  951|  5.68M|        if (utype == V_ASN1_GENERALIZEDTIME && (len < 15)) {
  ------------------
  |  |   85|  11.3M|#define V_ASN1_GENERALIZEDTIME 24
  ------------------
  |  Branch (951:13): [True: 5.64k, False: 5.68M]
  |  Branch (951:48): [True: 0, False: 5.64k]
  ------------------
  952|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_GENERALIZEDTIME_IS_TOO_SHORT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  953|      0|            goto err;
  954|      0|        }
  955|  5.68M|        if (utype == V_ASN1_UTCTIME && (len < 13)) {
  ------------------
  |  |   84|  11.3M|#define V_ASN1_UTCTIME 23
  ------------------
  |  Branch (955:13): [True: 818k, False: 4.87M]
  |  Branch (955:40): [True: 0, False: 818k]
  ------------------
  956|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_UTCTIME_IS_TOO_SHORT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  957|      0|            goto err;
  958|      0|        }
  959|       |        /* All based on ASN1_STRING and handled the same */
  960|  5.68M|        if (*pval == NULL) {
  ------------------
  |  Branch (960:13): [True: 456k, False: 5.23M]
  ------------------
  961|   456k|            stmp = ASN1_STRING_type_new(utype);
  962|   456k|            if (stmp == NULL) {
  ------------------
  |  Branch (962:17): [True: 0, False: 456k]
  ------------------
  963|      0|                ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  964|      0|                goto err;
  965|      0|            }
  966|   456k|            *pval = (ASN1_VALUE *)stmp;
  967|  5.23M|        } else {
  968|  5.23M|            stmp = (ASN1_STRING *)*pval;
  969|  5.23M|            stmp->type = utype;
  970|  5.23M|        }
  971|       |        /* If we've already allocated a buffer use it */
  972|  5.68M|        if (*free_cont) {
  ------------------
  |  Branch (972:13): [True: 0, False: 5.68M]
  ------------------
  973|      0|            ASN1_STRING_set0(stmp, (unsigned char *)cont /* UGLY CAST! */, len);
  974|      0|            *free_cont = 0;
  975|  5.68M|        } else {
  976|  5.68M|            if (!ASN1_STRING_set(stmp, cont, len)) {
  ------------------
  |  Branch (976:17): [True: 0, False: 5.68M]
  ------------------
  977|      0|                ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  978|      0|                ASN1_STRING_free(stmp);
  979|      0|                *pval = NULL;
  980|      0|                goto err;
  981|      0|            }
  982|  5.68M|        }
  983|  5.68M|        break;
  984|  17.9M|    }
  985|       |    /* If ASN1_ANY and NULL type fix up value */
  986|  17.9M|    if (typ && (utype == V_ASN1_NULL))
  ------------------
  |  |   69|  1.83M|#define V_ASN1_NULL 5
  ------------------
  |  Branch (986:9): [True: 1.83M, False: 16.1M]
  |  Branch (986:16): [True: 1.49M, False: 338k]
  ------------------
  987|  1.49M|        typ->value.ptr = NULL;
  988|       |
  989|  17.9M|    ret = 1;
  990|  17.9M|err:
  991|  17.9M|    if (!ret) {
  ------------------
  |  Branch (991:9): [True: 0, False: 17.9M]
  ------------------
  992|      0|        ASN1_TYPE_free(typ);
  993|      0|        if (opval)
  ------------------
  |  Branch (993:13): [True: 0, False: 0]
  ------------------
  994|      0|            *opval = NULL;
  995|      0|    }
  996|  17.9M|    return ret;
  997|  17.9M|}
tasn_dec.c:asn1_check_eoc:
 1153|  31.3M|{
 1154|  31.3M|    const unsigned char *p;
 1155|       |
 1156|  31.3M|    if (len < 2)
  ------------------
  |  Branch (1156:9): [True: 0, False: 31.3M]
  ------------------
 1157|      0|        return 0;
 1158|  31.3M|    p = *in;
 1159|  31.3M|    if (p[0] == '\0' && p[1] == '\0') {
  ------------------
  |  Branch (1159:9): [True: 0, False: 31.3M]
  |  Branch (1159:25): [True: 0, False: 0]
  ------------------
 1160|      0|        *in += 2;
 1161|      0|        return 1;
 1162|      0|    }
 1163|  31.3M|    return 0;
 1164|  31.3M|}
tasn_dec.c:asn1_check_tlen:
 1177|  40.8M|{
 1178|  40.8M|    int i;
 1179|  40.8M|    int ptag, pclass;
 1180|  40.8M|    long plen;
 1181|  40.8M|    const unsigned char *p, *q;
 1182|  40.8M|    p = *in;
 1183|  40.8M|    q = p;
 1184|       |
 1185|  40.8M|    if (len <= 0) {
  ------------------
  |  Branch (1185:9): [True: 0, False: 40.8M]
  ------------------
 1186|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1187|      0|        goto err;
 1188|      0|    }
 1189|  40.8M|    if (ctx != NULL && ctx->valid) {
  ------------------
  |  Branch (1189:9): [True: 40.8M, False: 0]
  |  Branch (1189:24): [True: 7.40M, False: 33.4M]
  ------------------
 1190|  7.40M|        i = ctx->ret;
 1191|  7.40M|        plen = ctx->plen;
 1192|  7.40M|        pclass = ctx->pclass;
 1193|  7.40M|        ptag = ctx->ptag;
 1194|  7.40M|        p += ctx->hdrlen;
 1195|  33.4M|    } else {
 1196|  33.4M|        i = ASN1_get_object(&p, &plen, &ptag, &pclass, len);
 1197|  33.4M|        if (ctx != NULL) {
  ------------------
  |  Branch (1197:13): [True: 33.4M, False: 0]
  ------------------
 1198|  33.4M|            ctx->ret = i;
 1199|  33.4M|            ctx->plen = plen;
 1200|  33.4M|            ctx->pclass = pclass;
 1201|  33.4M|            ctx->ptag = ptag;
 1202|  33.4M|            ctx->hdrlen = (int)(p - q);
 1203|  33.4M|            ctx->valid = 1;
 1204|       |            /*
 1205|       |             * If definite length, and no error, length + header can't exceed
 1206|       |             * total amount of data available.
 1207|       |             */
 1208|  33.4M|            if ((i & 0x81) == 0 && (plen + ctx->hdrlen) > len) {
  ------------------
  |  Branch (1208:17): [True: 33.4M, False: 0]
  |  Branch (1208:36): [True: 0, False: 33.4M]
  ------------------
 1209|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1210|      0|                goto err;
 1211|      0|            }
 1212|  33.4M|        }
 1213|  33.4M|    }
 1214|       |
 1215|  40.8M|    if ((i & 0x80) != 0) {
  ------------------
  |  Branch (1215:9): [True: 0, False: 40.8M]
  ------------------
 1216|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_OBJECT_HEADER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1217|      0|        goto err;
 1218|      0|    }
 1219|  40.8M|    if (exptag >= 0) {
  ------------------
  |  Branch (1219:9): [True: 35.1M, False: 5.64M]
  ------------------
 1220|  35.1M|        if (exptag != ptag || expclass != pclass) {
  ------------------
  |  Branch (1220:13): [True: 1.75M, False: 33.4M]
  |  Branch (1220:31): [True: 0, False: 33.4M]
  ------------------
 1221|       |            /*
 1222|       |             * If type is OPTIONAL, not an error: indicate missing type.
 1223|       |             */
 1224|  1.75M|            if (opt != 0)
  ------------------
  |  Branch (1224:17): [True: 1.75M, False: 0]
  ------------------
 1225|  1.75M|                return -1;
 1226|  1.75M|            ERR_raise(ERR_LIB_ASN1, ASN1_R_WRONG_TAG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1227|      0|            goto err;
 1228|  1.75M|        }
 1229|       |        /*
 1230|       |         * We have a tag and class match: assume we are going to do something
 1231|       |         * with it
 1232|       |         */
 1233|  33.4M|        asn1_tlc_clear(ctx);
  ------------------
  |  |  115|  33.4M|    do {                    \
  |  |  116|  33.4M|        if ((c) != NULL)    \
  |  |  ------------------
  |  |  |  Branch (116:13): [True: 33.4M, False: 0]
  |  |  ------------------
  |  |  117|  33.4M|            (c)->valid = 0; \
  |  |  118|  33.4M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 33.4M]
  |  |  ------------------
  ------------------
 1234|  33.4M|    }
 1235|       |
 1236|  39.0M|    if ((i & 1) != 0)
  ------------------
  |  Branch (1236:9): [True: 0, False: 39.0M]
  ------------------
 1237|      0|        plen = len - (long)(p - q);
 1238|       |
 1239|  39.0M|    if (inf != NULL)
  ------------------
  |  Branch (1239:9): [True: 33.4M, False: 5.64M]
  ------------------
 1240|  33.4M|        *inf = i & 1;
 1241|       |
 1242|  39.0M|    if (cst != NULL)
  ------------------
  |  Branch (1242:9): [True: 29.1M, False: 9.96M]
  ------------------
 1243|  29.1M|        *cst = i & V_ASN1_CONSTRUCTED;
  ------------------
  |  |   54|  29.1M|#define V_ASN1_CONSTRUCTED 0x20
  ------------------
 1244|       |
 1245|  39.0M|    if (olen != NULL)
  ------------------
  |  Branch (1245:9): [True: 33.4M, False: 5.64M]
  ------------------
 1246|  33.4M|        *olen = plen;
 1247|       |
 1248|  39.0M|    if (oclass != NULL)
  ------------------
  |  Branch (1248:9): [True: 5.64M, False: 33.4M]
  ------------------
 1249|  5.64M|        *oclass = pclass;
 1250|       |
 1251|  39.0M|    if (otag != NULL)
  ------------------
  |  Branch (1251:9): [True: 5.64M, False: 33.4M]
  ------------------
 1252|  5.64M|        *otag = ptag;
 1253|       |
 1254|  39.0M|    *in = p;
 1255|  39.0M|    return 1;
 1256|       |
 1257|      0|err:
 1258|       |    asn1_tlc_clear(ctx);
  ------------------
  |  |  115|      0|    do {                    \
  |  |  116|      0|        if ((c) != NULL)    \
  |  |  ------------------
  |  |  |  Branch (116:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  117|      0|            (c)->valid = 0; \
  |  |  118|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1259|      0|    return 0;
 1260|  40.8M|}

ASN1_item_i2d:
   44|   338k|{
   45|   338k|    return asn1_item_flags_i2d(val, out, it, 0);
   46|   338k|}
ASN1_item_ex_i2d:
   83|  45.2M|{
   84|  45.2M|    const ASN1_TEMPLATE *tt = NULL;
   85|  45.2M|    int i, seqcontlen, seqlen, ndef = 1;
   86|  45.2M|    const ASN1_EXTERN_FUNCS *ef;
   87|  45.2M|    const ASN1_AUX *aux = it->funcs;
   88|  45.2M|    ASN1_aux_const_cb *asn1_cb = NULL;
   89|       |
   90|  45.2M|    if ((it->itype != ASN1_ITYPE_PRIMITIVE) && *pval == NULL)
  ------------------
  |  |   82|  45.2M|#define ASN1_ITYPE_PRIMITIVE 0x0
  ------------------
  |  Branch (90:9): [True: 23.6M, False: 21.6M]
  |  Branch (90:48): [True: 0, False: 23.6M]
  ------------------
   91|      0|        return 0;
   92|       |
   93|  45.2M|    if (aux != NULL) {
  ------------------
  |  Branch (93:9): [True: 1.69M, False: 43.5M]
  ------------------
   94|  1.69M|        asn1_cb = ((aux->flags & ASN1_AFLG_CONST_CB) != 0) ? aux->asn1_const_cb
  ------------------
  |  |  727|  1.69M|#define ASN1_AFLG_CONST_CB 8
  ------------------
  |  Branch (94:19): [True: 0, False: 1.69M]
  ------------------
   95|  1.69M|                                                           : (ASN1_aux_const_cb *)aux->asn1_cb; /* backward compatibility */
   96|  1.69M|    }
   97|       |
   98|  45.2M|    switch (it->itype) {
   99|       |
  100|  21.6M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   82|  21.6M|#define ASN1_ITYPE_PRIMITIVE 0x0
  ------------------
  |  Branch (100:5): [True: 21.6M, False: 23.6M]
  ------------------
  101|  21.6M|        if (it->templates)
  ------------------
  |  Branch (101:13): [True: 5.97M, False: 15.6M]
  ------------------
  102|  5.97M|            return asn1_template_ex_i2d(pval, out, it->templates,
  103|  5.97M|                tag, aclass);
  104|  15.6M|        return asn1_i2d_ex_primitive(pval, out, it, tag, aclass);
  105|       |
  106|  11.9M|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   87|  11.9M|#define ASN1_ITYPE_MSTRING 0x5
  ------------------
  |  Branch (106:5): [True: 11.9M, False: 33.3M]
  ------------------
  107|       |        /*
  108|       |         * It never makes sense for multi-strings to have implicit tagging, so
  109|       |         * if tag != -1, then this looks like an error in the template.
  110|       |         */
  111|  11.9M|        if (tag != -1) {
  ------------------
  |  Branch (111:13): [True: 0, False: 11.9M]
  ------------------
  112|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_TEMPLATE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  113|      0|            return -1;
  114|      0|        }
  115|  11.9M|        return asn1_i2d_ex_primitive(pval, out, it, -1, aclass);
  116|       |
  117|      0|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   84|      0|#define ASN1_ITYPE_CHOICE 0x2
  ------------------
  |  Branch (117:5): [True: 0, False: 45.2M]
  ------------------
  118|       |        /*
  119|       |         * It never makes sense for CHOICE types to have implicit tagging, so
  120|       |         * if tag != -1, then this looks like an error in the template.
  121|       |         */
  122|      0|        if (tag != -1) {
  ------------------
  |  Branch (122:13): [True: 0, False: 0]
  ------------------
  123|      0|            ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_TEMPLATE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  124|      0|            return -1;
  125|      0|        }
  126|      0|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL))
  ------------------
  |  |  737|      0|#define ASN1_OP_I2D_PRE 6
  ------------------
  |  Branch (126:13): [True: 0, False: 0]
  |  Branch (126:24): [True: 0, False: 0]
  ------------------
  127|      0|            return 0;
  128|      0|        i = ossl_asn1_get_choice_selector_const(pval, it);
  129|      0|        if ((i >= 0) && (i < it->tcount)) {
  ------------------
  |  Branch (129:13): [True: 0, False: 0]
  |  Branch (129:25): [True: 0, False: 0]
  ------------------
  130|      0|            const ASN1_VALUE **pchval;
  131|      0|            const ASN1_TEMPLATE *chtt;
  132|      0|            chtt = it->templates + i;
  133|      0|            pchval = ossl_asn1_get_const_field_ptr(pval, chtt);
  134|      0|            return asn1_template_ex_i2d(pchval, out, chtt, -1, aclass);
  135|      0|        }
  136|       |        /* Fixme: error condition if selector out of range */
  137|      0|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_POST, pval, it, NULL))
  ------------------
  |  |  738|      0|#define ASN1_OP_I2D_POST 7
  ------------------
  |  Branch (137:13): [True: 0, False: 0]
  |  Branch (137:24): [True: 0, False: 0]
  ------------------
  138|      0|            return 0;
  139|      0|        break;
  140|       |
  141|      0|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   86|      0|#define ASN1_ITYPE_EXTERN 0x4
  ------------------
  |  Branch (141:5): [True: 0, False: 45.2M]
  ------------------
  142|       |        /* If new style i2d it does all the work */
  143|      0|        ef = it->funcs;
  144|      0|        return ef->asn1_ex_i2d(pval, out, it, tag, aclass);
  145|       |
  146|      0|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   88|      0|#define ASN1_ITYPE_NDEF_SEQUENCE 0x6
  ------------------
  |  Branch (146:5): [True: 0, False: 45.2M]
  ------------------
  147|       |        /* Use indefinite length constructed if requested */
  148|      0|        if (aclass & ASN1_TFLG_NDEF)
  ------------------
  |  |  583|      0|#define ASN1_TFLG_NDEF (0x1 << 11)
  ------------------
  |  Branch (148:13): [True: 0, False: 0]
  ------------------
  149|      0|            ndef = 2;
  150|       |        /* fall through */
  151|       |
  152|  11.6M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   83|  11.6M|#define ASN1_ITYPE_SEQUENCE 0x1
  ------------------
  |  Branch (152:5): [True: 11.6M, False: 33.5M]
  ------------------
  153|  11.6M|        i = ossl_asn1_enc_restore(&seqcontlen, out, pval, it);
  154|       |        /* An error occurred */
  155|  11.6M|        if (i < 0)
  ------------------
  |  Branch (155:13): [True: 0, False: 11.6M]
  ------------------
  156|      0|            return 0;
  157|       |        /* We have a valid cached encoding... */
  158|  11.6M|        if (i > 0)
  ------------------
  |  Branch (158:13): [True: 1.01M, False: 10.6M]
  ------------------
  159|  1.01M|            return seqcontlen;
  160|       |        /* Otherwise carry on */
  161|  10.6M|        seqcontlen = 0;
  162|       |        /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */
  163|  10.6M|        if (tag == -1) {
  ------------------
  |  Branch (163:13): [True: 10.6M, False: 0]
  ------------------
  164|  10.6M|            tag = V_ASN1_SEQUENCE;
  ------------------
  |  |   76|  10.6M|#define V_ASN1_SEQUENCE 16
  ------------------
  165|       |            /* Retain any other flags in aclass */
  166|  10.6M|            aclass = (aclass & ~ASN1_TFLG_TAG_CLASS)
  ------------------
  |  |  564|  10.6M|#define ASN1_TFLG_TAG_CLASS (0x3 << 6)
  ------------------
  167|  10.6M|                | V_ASN1_UNIVERSAL;
  ------------------
  |  |   49|  10.6M|#define V_ASN1_UNIVERSAL 0x00
  ------------------
  168|  10.6M|        }
  169|  10.6M|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it, NULL))
  ------------------
  |  |  737|   676k|#define ASN1_OP_I2D_PRE 6
  ------------------
  |  Branch (169:13): [True: 676k, False: 9.97M]
  |  Branch (169:24): [True: 0, False: 676k]
  ------------------
  170|      0|            return 0;
  171|       |        /* First work out sequence content length */
  172|  32.6M|        for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (172:41): [True: 21.9M, False: 10.6M]
  ------------------
  173|  21.9M|            const ASN1_TEMPLATE *seqtt;
  174|  21.9M|            const ASN1_VALUE **pseqval;
  175|  21.9M|            int tmplen;
  176|  21.9M|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  177|  21.9M|            if (!seqtt)
  ------------------
  |  Branch (177:17): [True: 0, False: 21.9M]
  ------------------
  178|      0|                return 0;
  179|  21.9M|            pseqval = ossl_asn1_get_const_field_ptr(pval, seqtt);
  180|  21.9M|            tmplen = asn1_template_ex_i2d(pseqval, NULL, seqtt, -1, aclass);
  181|  21.9M|            if (tmplen == -1 || (tmplen > INT_MAX - seqcontlen))
  ------------------
  |  Branch (181:17): [True: 0, False: 21.9M]
  |  Branch (181:33): [True: 0, False: 21.9M]
  ------------------
  182|      0|                return -1;
  183|  21.9M|            seqcontlen += tmplen;
  184|  21.9M|        }
  185|       |
  186|  10.6M|        seqlen = ASN1_object_size(ndef, seqcontlen, tag);
  187|  10.6M|        if (!out || seqlen == -1)
  ------------------
  |  Branch (187:13): [True: 6.99M, False: 3.66M]
  |  Branch (187:21): [True: 0, False: 3.66M]
  ------------------
  188|  6.99M|            return seqlen;
  189|       |        /* Output SEQUENCE header */
  190|  3.66M|        ASN1_put_object(out, ndef, seqcontlen, tag, aclass);
  191|  11.3M|        for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (191:41): [True: 7.66M, False: 3.66M]
  ------------------
  192|  7.66M|            const ASN1_TEMPLATE *seqtt;
  193|  7.66M|            const ASN1_VALUE **pseqval;
  194|  7.66M|            seqtt = ossl_asn1_do_adb(*pval, tt, 1);
  195|  7.66M|            if (!seqtt)
  ------------------
  |  Branch (195:17): [True: 0, False: 7.66M]
  ------------------
  196|      0|                return 0;
  197|  7.66M|            pseqval = ossl_asn1_get_const_field_ptr(pval, seqtt);
  198|       |            /* FIXME: check for errors in enhanced version */
  199|  7.66M|            asn1_template_ex_i2d(pseqval, out, seqtt, -1, aclass);
  200|  7.66M|        }
  201|  3.66M|        if (ndef == 2)
  ------------------
  |  Branch (201:13): [True: 0, False: 3.66M]
  ------------------
  202|      0|            ASN1_put_eoc(out);
  203|  3.66M|        if (asn1_cb && !asn1_cb(ASN1_OP_I2D_POST, pval, it, NULL))
  ------------------
  |  |  738|   338k|#define ASN1_OP_I2D_POST 7
  ------------------
  |  Branch (203:13): [True: 338k, False: 3.32M]
  |  Branch (203:24): [True: 0, False: 338k]
  ------------------
  204|      0|            return 0;
  205|  3.66M|        return seqlen;
  206|       |
  207|      0|    default:
  ------------------
  |  Branch (207:5): [True: 0, False: 45.2M]
  ------------------
  208|      0|        return 0;
  209|  45.2M|    }
  210|      0|    return 0;
  211|  45.2M|}
tasn_enc.c:asn1_item_flags_i2d:
   57|   338k|{
   58|   338k|    if (out != NULL && *out == NULL) {
  ------------------
  |  Branch (58:9): [True: 338k, False: 0]
  |  Branch (58:24): [True: 338k, False: 0]
  ------------------
   59|   338k|        unsigned char *p, *buf;
   60|   338k|        int len;
   61|       |
   62|   338k|        len = ASN1_item_ex_i2d(&val, NULL, it, -1, flags);
   63|   338k|        if (len <= 0)
  ------------------
  |  Branch (63:13): [True: 0, False: 338k]
  ------------------
   64|      0|            return len;
   65|   338k|        if ((buf = OPENSSL_malloc(len)) == NULL)
  ------------------
  |  |  106|   338k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (65:13): [True: 0, False: 338k]
  ------------------
   66|      0|            return -1;
   67|   338k|        p = buf;
   68|   338k|        ASN1_item_ex_i2d(&val, &p, it, -1, flags);
   69|   338k|        *out = buf;
   70|   338k|        return len;
   71|   338k|    }
   72|       |
   73|      0|    return ASN1_item_ex_i2d(&val, out, it, -1, flags);
   74|   338k|}
tasn_enc.c:asn1_template_ex_i2d:
  215|  35.6M|{
  216|  35.6M|    const int flags = tt->flags;
  217|  35.6M|    int i, ret, ttag, tclass, ndef, len;
  218|  35.6M|    const ASN1_VALUE *tval;
  219|       |
  220|       |    /*
  221|       |     * If field is embedded then val needs fixing so it is a pointer to
  222|       |     * a pointer to a field.
  223|       |     */
  224|  35.6M|    if (flags & ASN1_TFLG_EMBED) {
  ------------------
  |  |  586|  35.6M|#define ASN1_TFLG_EMBED (0x1 << 12)
  ------------------
  |  Branch (224:9): [True: 3.04M, False: 32.5M]
  ------------------
  225|  3.04M|        tval = (ASN1_VALUE *)pval;
  226|  3.04M|        pval = &tval;
  227|  3.04M|    }
  228|       |    /*
  229|       |     * Work out tag and class to use: tagging may come either from the
  230|       |     * template or the arguments, not both because this would create
  231|       |     * ambiguity. Additionally the iclass argument may contain some
  232|       |     * additional flags which should be noted and passed down to other
  233|       |     * levels.
  234|       |     */
  235|  35.6M|    if (flags & ASN1_TFLG_TAG_MASK) {
  ------------------
  |  |  541|  35.6M|#define ASN1_TFLG_TAG_MASK (0x3 << 3)
  ------------------
  |  Branch (235:9): [True: 0, False: 35.6M]
  ------------------
  236|       |        /* Error if argument and template tagging */
  237|      0|        if (tag != -1)
  ------------------
  |  Branch (237:13): [True: 0, False: 0]
  ------------------
  238|       |            /* FIXME: error code here */
  239|      0|            return -1;
  240|       |        /* Get tagging from template */
  241|      0|        ttag = tt->tag;
  242|      0|        tclass = flags & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  564|      0|#define ASN1_TFLG_TAG_CLASS (0x3 << 6)
  ------------------
  243|  35.6M|    } else if (tag != -1) {
  ------------------
  |  Branch (243:16): [True: 0, False: 35.6M]
  ------------------
  244|       |        /* No template tagging, get from arguments */
  245|      0|        ttag = tag;
  246|      0|        tclass = iclass & ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  564|      0|#define ASN1_TFLG_TAG_CLASS (0x3 << 6)
  ------------------
  247|  35.6M|    } else {
  248|  35.6M|        ttag = -1;
  249|  35.6M|        tclass = 0;
  250|  35.6M|    }
  251|       |    /*
  252|       |     * Remove any class mask from iflag.
  253|       |     */
  254|  35.6M|    iclass &= ~ASN1_TFLG_TAG_CLASS;
  ------------------
  |  |  564|  35.6M|#define ASN1_TFLG_TAG_CLASS (0x3 << 6)
  ------------------
  255|       |
  256|       |    /*
  257|       |     * At this point 'ttag' contains the outer tag to use, 'tclass' is the
  258|       |     * class and iclass is any flags passed to this function.
  259|       |     */
  260|       |
  261|       |    /* if template and arguments require ndef, use it */
  262|  35.6M|    if ((flags & ASN1_TFLG_NDEF) && (iclass & ASN1_TFLG_NDEF))
  ------------------
  |  |  583|  35.6M|#define ASN1_TFLG_NDEF (0x1 << 11)
  ------------------
                  if ((flags & ASN1_TFLG_NDEF) && (iclass & ASN1_TFLG_NDEF))
  ------------------
  |  |  583|      0|#define ASN1_TFLG_NDEF (0x1 << 11)
  ------------------
  |  Branch (262:9): [True: 0, False: 35.6M]
  |  Branch (262:37): [True: 0, False: 0]
  ------------------
  263|      0|        ndef = 2;
  264|  35.6M|    else
  265|  35.6M|        ndef = 1;
  266|       |
  267|  35.6M|    if (flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  528|  35.6M|#define ASN1_TFLG_SK_MASK (0x3 << 1)
  ------------------
  |  Branch (267:9): [True: 5.97M, False: 29.6M]
  ------------------
  268|       |        /* SET OF, SEQUENCE OF */
  269|  5.97M|        STACK_OF(const_ASN1_VALUE) *sk = (STACK_OF(const_ASN1_VALUE) *)*pval;
  ------------------
  |  |   33|  5.97M|#define STACK_OF(type) struct stack_st_##type
  ------------------
  270|  5.97M|        int isset, sktag, skaclass;
  271|  5.97M|        int skcontlen, sklen;
  272|  5.97M|        const ASN1_VALUE *skitem;
  273|       |
  274|  5.97M|        if (*pval == NULL)
  ------------------
  |  Branch (274:13): [True: 0, False: 5.97M]
  ------------------
  275|      0|            return 0;
  276|       |
  277|  5.97M|        if (flags & ASN1_TFLG_SET_OF) {
  ------------------
  |  |  515|  5.97M|#define ASN1_TFLG_SET_OF (0x1 << 1)
  ------------------
  |  Branch (277:13): [True: 5.97M, False: 0]
  ------------------
  278|  5.97M|            isset = 1;
  279|       |            /* 2 means we reorder */
  280|  5.97M|            if (flags & ASN1_TFLG_SEQUENCE_OF)
  ------------------
  |  |  518|  5.97M|#define ASN1_TFLG_SEQUENCE_OF (0x2 << 1)
  ------------------
  |  Branch (280:17): [True: 0, False: 5.97M]
  ------------------
  281|      0|                isset = 2;
  282|  5.97M|        } else
  283|      0|            isset = 0;
  284|       |
  285|       |        /*
  286|       |         * Work out inner tag value: if EXPLICIT or no tagging use underlying
  287|       |         * type.
  288|       |         */
  289|  5.97M|        if ((ttag != -1) && !(flags & ASN1_TFLG_EXPTAG)) {
  ------------------
  |  |  539|      0|#define ASN1_TFLG_EXPTAG (0x2 << 3)
  ------------------
  |  Branch (289:13): [True: 0, False: 5.97M]
  |  Branch (289:29): [True: 0, False: 0]
  ------------------
  290|      0|            sktag = ttag;
  291|      0|            skaclass = tclass;
  292|  5.97M|        } else {
  293|  5.97M|            skaclass = V_ASN1_UNIVERSAL;
  ------------------
  |  |   49|  5.97M|#define V_ASN1_UNIVERSAL 0x00
  ------------------
  294|  5.97M|            if (isset)
  ------------------
  |  Branch (294:17): [True: 5.97M, False: 0]
  ------------------
  295|  5.97M|                sktag = V_ASN1_SET;
  ------------------
  |  |   77|  5.97M|#define V_ASN1_SET 17
  ------------------
  296|      0|            else
  297|      0|                sktag = V_ASN1_SEQUENCE;
  ------------------
  |  |   76|      0|#define V_ASN1_SEQUENCE 16
  ------------------
  298|  5.97M|        }
  299|       |
  300|       |        /* Determine total length of items */
  301|  5.97M|        skcontlen = 0;
  302|  11.9M|        for (i = 0; i < sk_const_ASN1_VALUE_num(sk); i++) {
  ------------------
  |  Branch (302:21): [True: 5.97M, False: 5.97M]
  ------------------
  303|  5.97M|            skitem = sk_const_ASN1_VALUE_value(sk, i);
  304|  5.97M|            len = ASN1_item_ex_i2d(&skitem, NULL, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  428|  5.97M|#define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  305|  5.97M|                -1, iclass);
  306|  5.97M|            if (len == -1 || (skcontlen > INT_MAX - len))
  ------------------
  |  Branch (306:17): [True: 0, False: 5.97M]
  |  Branch (306:30): [True: 0, False: 5.97M]
  ------------------
  307|      0|                return -1;
  308|  5.97M|            if (len == 0 && (tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
  ------------------
  |  |  512|      0|#define ASN1_TFLG_OPTIONAL (0x1)
  ------------------
  |  Branch (308:17): [True: 0, False: 5.97M]
  |  Branch (308:29): [True: 0, False: 0]
  ------------------
  309|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  310|      0|                return -1;
  311|      0|            }
  312|  5.97M|            skcontlen += len;
  313|  5.97M|        }
  314|  5.97M|        sklen = ASN1_object_size(ndef, skcontlen, sktag);
  315|  5.97M|        if (sklen == -1)
  ------------------
  |  Branch (315:13): [True: 0, False: 5.97M]
  ------------------
  316|      0|            return -1;
  317|       |        /* If EXPLICIT need length of surrounding tag */
  318|  5.97M|        if (flags & ASN1_TFLG_EXPTAG)
  ------------------
  |  |  539|  5.97M|#define ASN1_TFLG_EXPTAG (0x2 << 3)
  ------------------
  |  Branch (318:13): [True: 0, False: 5.97M]
  ------------------
  319|      0|            ret = ASN1_object_size(ndef, sklen, ttag);
  320|  5.97M|        else
  321|  5.97M|            ret = sklen;
  322|       |
  323|  5.97M|        if (!out || ret == -1)
  ------------------
  |  Branch (323:13): [True: 2.98M, False: 2.98M]
  |  Branch (323:21): [True: 0, False: 2.98M]
  ------------------
  324|  2.98M|            return ret;
  325|       |
  326|       |        /* Now encode this lot... */
  327|       |        /* EXPLICIT tag */
  328|  2.98M|        if (flags & ASN1_TFLG_EXPTAG)
  ------------------
  |  |  539|  2.98M|#define ASN1_TFLG_EXPTAG (0x2 << 3)
  ------------------
  |  Branch (328:13): [True: 0, False: 2.98M]
  ------------------
  329|      0|            ASN1_put_object(out, ndef, sklen, ttag, tclass);
  330|       |        /* SET or SEQUENCE and IMPLICIT tag */
  331|  2.98M|        ASN1_put_object(out, ndef, skcontlen, sktag, skaclass);
  332|       |        /* And the stuff itself */
  333|  2.98M|        asn1_set_seq_out(sk, out, skcontlen, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  428|  2.98M|#define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  334|  2.98M|            isset, iclass);
  335|  2.98M|        if (ndef == 2) {
  ------------------
  |  Branch (335:13): [True: 0, False: 2.98M]
  ------------------
  336|      0|            ASN1_put_eoc(out);
  337|      0|            if (flags & ASN1_TFLG_EXPTAG)
  ------------------
  |  |  539|      0|#define ASN1_TFLG_EXPTAG (0x2 << 3)
  ------------------
  |  Branch (337:17): [True: 0, False: 0]
  ------------------
  338|      0|                ASN1_put_eoc(out);
  339|      0|        }
  340|       |
  341|  2.98M|        return ret;
  342|  5.97M|    }
  343|       |
  344|  29.6M|    if (flags & ASN1_TFLG_EXPTAG) {
  ------------------
  |  |  539|  29.6M|#define ASN1_TFLG_EXPTAG (0x2 << 3)
  ------------------
  |  Branch (344:9): [True: 0, False: 29.6M]
  ------------------
  345|       |        /* EXPLICIT tagging */
  346|       |        /* Find length of tagged item */
  347|      0|        i = ASN1_item_ex_i2d(pval, NULL, ASN1_ITEM_ptr(tt->item), -1, iclass);
  ------------------
  |  |  428|      0|#define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  348|      0|        if (i == 0) {
  ------------------
  |  Branch (348:13): [True: 0, False: 0]
  ------------------
  349|      0|            if ((tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
  ------------------
  |  |  512|      0|#define ASN1_TFLG_OPTIONAL (0x1)
  ------------------
  |  Branch (349:17): [True: 0, False: 0]
  ------------------
  350|      0|                ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  351|      0|                return -1;
  352|      0|            }
  353|      0|            return 0;
  354|      0|        }
  355|       |        /* Find length of EXPLICIT tag */
  356|      0|        ret = ASN1_object_size(ndef, i, ttag);
  357|      0|        if (out && ret != -1) {
  ------------------
  |  Branch (357:13): [True: 0, False: 0]
  |  Branch (357:20): [True: 0, False: 0]
  ------------------
  358|       |            /* Output tag and item */
  359|      0|            ASN1_put_object(out, ndef, i, ttag, tclass);
  360|      0|            ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), -1, iclass);
  ------------------
  |  |  428|      0|#define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  361|      0|            if (ndef == 2)
  ------------------
  |  Branch (361:17): [True: 0, False: 0]
  ------------------
  362|      0|                ASN1_put_eoc(out);
  363|      0|        }
  364|      0|        return ret;
  365|      0|    }
  366|       |
  367|       |    /* Either normal or IMPLICIT tagging: combine class and flags */
  368|  29.6M|    len = ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item),
  ------------------
  |  |  428|  29.6M|#define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  369|  29.6M|        ttag, tclass | iclass);
  370|  29.6M|    if (len == 0 && (tt->flags & ASN1_TFLG_OPTIONAL) == 0) {
  ------------------
  |  |  512|   370k|#define ASN1_TFLG_OPTIONAL (0x1)
  ------------------
  |  Branch (370:9): [True: 370k, False: 29.2M]
  |  Branch (370:21): [True: 0, False: 370k]
  ------------------
  371|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  372|      0|        return -1;
  373|      0|    }
  374|  29.6M|    return len;
  375|  29.6M|}
tasn_enc.c:asn1_set_seq_out:
  402|  2.98M|{
  403|  2.98M|    int i, ret = 0;
  404|  2.98M|    const ASN1_VALUE *skitem;
  405|  2.98M|    unsigned char *tmpdat = NULL, *p = NULL;
  406|  2.98M|    DER_ENC *derlst = NULL, *tder;
  407|       |
  408|  2.98M|    if (do_sort) {
  ------------------
  |  Branch (408:9): [True: 2.98M, False: 0]
  ------------------
  409|       |        /* Don't need to sort less than 2 items */
  410|  2.98M|        if (sk_const_ASN1_VALUE_num(sk) < 2)
  ------------------
  |  Branch (410:13): [True: 2.98M, False: 0]
  ------------------
  411|  2.98M|            do_sort = 0;
  412|      0|        else {
  413|      0|            derlst = OPENSSL_malloc(sk_const_ASN1_VALUE_num(sk)
  ------------------
  |  |  106|      0|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  414|      0|                * sizeof(*derlst));
  415|      0|            if (derlst == NULL)
  ------------------
  |  Branch (415:17): [True: 0, False: 0]
  ------------------
  416|      0|                return 0;
  417|      0|            tmpdat = OPENSSL_malloc(skcontlen);
  ------------------
  |  |  106|      0|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  418|      0|            if (tmpdat == NULL)
  ------------------
  |  Branch (418:17): [True: 0, False: 0]
  ------------------
  419|      0|                goto err;
  420|      0|        }
  421|  2.98M|    }
  422|       |    /* If not sorting just output each item */
  423|  2.98M|    if (!do_sort) {
  ------------------
  |  Branch (423:9): [True: 2.98M, False: 0]
  ------------------
  424|  5.97M|        for (i = 0; i < sk_const_ASN1_VALUE_num(sk); i++) {
  ------------------
  |  Branch (424:21): [True: 2.98M, False: 2.98M]
  ------------------
  425|  2.98M|            skitem = sk_const_ASN1_VALUE_value(sk, i);
  426|  2.98M|            ASN1_item_ex_i2d(&skitem, out, item, -1, iclass);
  427|  2.98M|        }
  428|  2.98M|        return 1;
  429|  2.98M|    }
  430|      0|    p = tmpdat;
  431|       |
  432|       |    /* Doing sort: build up a list of each member's DER encoding */
  433|      0|    for (i = 0, tder = derlst; i < sk_const_ASN1_VALUE_num(sk); i++, tder++) {
  ------------------
  |  Branch (433:32): [True: 0, False: 0]
  ------------------
  434|      0|        skitem = sk_const_ASN1_VALUE_value(sk, i);
  435|      0|        tder->data = p;
  436|      0|        tder->length = ASN1_item_ex_i2d(&skitem, &p, item, -1, iclass);
  437|      0|        tder->field = skitem;
  438|      0|    }
  439|       |
  440|       |    /* Now sort them */
  441|      0|    qsort(derlst, sk_const_ASN1_VALUE_num(sk), sizeof(*derlst), der_cmp);
  442|       |    /* Output sorted DER encoding */
  443|      0|    p = *out;
  444|      0|    for (i = 0, tder = derlst; i < sk_const_ASN1_VALUE_num(sk); i++, tder++) {
  ------------------
  |  Branch (444:32): [True: 0, False: 0]
  ------------------
  445|      0|        memcpy(p, tder->data, tder->length);
  446|      0|        p += tder->length;
  447|      0|    }
  448|      0|    *out = p;
  449|       |    /* If do_sort is 2 then reorder the STACK */
  450|      0|    if (do_sort == 2) {
  ------------------
  |  Branch (450:9): [True: 0, False: 0]
  ------------------
  451|      0|        for (i = 0, tder = derlst; i < sk_const_ASN1_VALUE_num(sk); i++, tder++)
  ------------------
  |  Branch (451:36): [True: 0, False: 0]
  ------------------
  452|      0|            (void)sk_const_ASN1_VALUE_set(sk, i, tder->field);
  453|      0|    }
  454|      0|    ret = 1;
  455|      0|err:
  456|      0|    OPENSSL_free(derlst);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  457|      0|    OPENSSL_free(tmpdat);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  458|      0|    return ret;
  459|      0|}
tasn_enc.c:asn1_i2d_ex_primitive:
  463|  27.6M|{
  464|  27.6M|    int len;
  465|  27.6M|    int utype;
  466|  27.6M|    int usetag;
  467|  27.6M|    int ndef = 0;
  468|       |
  469|  27.6M|    utype = it->utype;
  470|       |
  471|       |    /*
  472|       |     * Get length of content octets and maybe find out the underlying type.
  473|       |     */
  474|       |
  475|  27.6M|    len = asn1_ex_i2c(pval, NULL, &utype, it);
  476|       |
  477|       |    /*
  478|       |     * If SEQUENCE, SET or OTHER then header is included in pseudo content
  479|       |     * octets so don't include tag+length. We need to check here because the
  480|       |     * call to asn1_ex_i2c() could change utype.
  481|       |     */
  482|  27.6M|    if ((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER))
  ------------------
  |  |   76|  27.6M|#define V_ASN1_SEQUENCE 16
  ------------------
                  if ((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER))
  ------------------
  |  |   77|  27.6M|#define V_ASN1_SET 17
  ------------------
                  if ((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER))
  ------------------
  |  |   59|  27.6M|#define V_ASN1_OTHER -3 /* used in ASN1_TYPE */
  ------------------
  |  Branch (482:9): [True: 0, False: 27.6M]
  |  Branch (482:39): [True: 0, False: 27.6M]
  |  Branch (482:64): [True: 0, False: 27.6M]
  ------------------
  483|      0|        usetag = 0;
  484|  27.6M|    else
  485|  27.6M|        usetag = 1;
  486|       |
  487|       |    /* -1 means omit type */
  488|       |
  489|  27.6M|    if (len == -1)
  ------------------
  |  Branch (489:9): [True: 370k, False: 27.2M]
  ------------------
  490|   370k|        return 0;
  491|       |
  492|       |    /* -2 return is special meaning use ndef */
  493|  27.2M|    if (len == -2) {
  ------------------
  |  Branch (493:9): [True: 0, False: 27.2M]
  ------------------
  494|      0|        ndef = 2;
  495|      0|        len = 0;
  496|      0|    }
  497|       |
  498|       |    /* If not implicitly tagged get tag from underlying type */
  499|  27.2M|    if (tag == -1)
  ------------------
  |  Branch (499:9): [True: 27.2M, False: 0]
  ------------------
  500|  27.2M|        tag = utype;
  501|       |
  502|       |    /* Output tag+length followed by content octets */
  503|  27.2M|    if (out) {
  ------------------
  |  Branch (503:9): [True: 6.89M, False: 20.3M]
  ------------------
  504|  6.89M|        if (usetag)
  ------------------
  |  Branch (504:13): [True: 6.89M, False: 0]
  ------------------
  505|  6.89M|            ASN1_put_object(out, ndef, len, tag, aclass);
  506|  6.89M|        asn1_ex_i2c(pval, *out, &utype, it);
  507|  6.89M|        if (ndef)
  ------------------
  |  Branch (507:13): [True: 0, False: 6.89M]
  ------------------
  508|      0|            ASN1_put_eoc(out);
  509|  6.89M|        else
  510|  6.89M|            *out += len;
  511|  6.89M|    }
  512|       |
  513|  27.2M|    if (usetag)
  ------------------
  |  Branch (513:9): [True: 27.2M, False: 0]
  ------------------
  514|  27.2M|        return ASN1_object_size(ndef, len, tag);
  515|      0|    return len;
  516|  27.2M|}
tasn_enc.c:asn1_ex_i2c:
  522|  34.5M|{
  523|  34.5M|    ASN1_BOOLEAN *tbool = NULL;
  524|  34.5M|    ASN1_STRING *strtmp;
  525|  34.5M|    ASN1_OBJECT *otmp;
  526|  34.5M|    int utype;
  527|  34.5M|    const unsigned char *cont;
  528|  34.5M|    unsigned char c;
  529|  34.5M|    int len;
  530|  34.5M|    const ASN1_PRIMITIVE_FUNCS *pf;
  531|  34.5M|    pf = it->funcs;
  532|  34.5M|    if (pf && pf->prim_i2c)
  ------------------
  |  Branch (532:9): [True: 0, False: 34.5M]
  |  Branch (532:15): [True: 0, False: 0]
  ------------------
  533|      0|        return pf->prim_i2c(pval, cout, putype, it);
  534|       |
  535|       |    /* Should type be omitted? */
  536|  34.5M|    if ((it->itype != ASN1_ITYPE_PRIMITIVE)
  ------------------
  |  |   82|  34.5M|#define ASN1_ITYPE_PRIMITIVE 0x0
  ------------------
  |  Branch (536:9): [True: 14.9M, False: 19.5M]
  ------------------
  537|  34.5M|        || (it->utype != V_ASN1_BOOLEAN)) {
  ------------------
  |  |   65|  19.5M|#define V_ASN1_BOOLEAN 1
  ------------------
  |  Branch (537:12): [True: 19.5M, False: 0]
  ------------------
  538|  34.5M|        if (*pval == NULL)
  ------------------
  |  Branch (538:13): [True: 370k, False: 34.1M]
  ------------------
  539|   370k|            return -1;
  540|  34.5M|    }
  541|       |
  542|  34.1M|    if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   87|  34.1M|#define ASN1_ITYPE_MSTRING 0x5
  ------------------
  |  Branch (542:9): [True: 14.9M, False: 19.2M]
  ------------------
  543|       |        /* If MSTRING type set the underlying type */
  544|  14.9M|        strtmp = (ASN1_STRING *)*pval;
  545|  14.9M|        utype = strtmp->type;
  546|  14.9M|        *putype = utype;
  547|  19.2M|    } else if (it->utype == V_ASN1_ANY) {
  ------------------
  |  |   60|  19.2M|#define V_ASN1_ANY -4 /* used in ASN1 template code */
  ------------------
  |  Branch (547:16): [True: 1.22M, False: 17.9M]
  ------------------
  548|       |        /* If ANY set type and pointer to value */
  549|  1.22M|        ASN1_TYPE *typ;
  550|  1.22M|        typ = (ASN1_TYPE *)*pval;
  551|  1.22M|        utype = typ->type;
  552|  1.22M|        *putype = utype;
  553|  1.22M|        pval = (const ASN1_VALUE **)&typ->value.asn1_value; /* actually is const */
  554|  1.22M|    } else
  555|  17.9M|        utype = *putype;
  556|       |
  557|  34.1M|    switch (utype) {
  558|  16.6M|    case V_ASN1_OBJECT:
  ------------------
  |  |   70|  16.6M|#define V_ASN1_OBJECT 6
  ------------------
  |  Branch (558:5): [True: 16.6M, False: 17.5M]
  ------------------
  559|  16.6M|        otmp = (ASN1_OBJECT *)*pval;
  560|  16.6M|        cont = otmp->data;
  561|  16.6M|        len = otmp->length;
  562|  16.6M|        if (cont == NULL || len == 0)
  ------------------
  |  Branch (562:13): [True: 0, False: 16.6M]
  |  Branch (562:29): [True: 0, False: 16.6M]
  ------------------
  563|      0|            return -1;
  564|  16.6M|        break;
  565|       |
  566|  16.6M|    case V_ASN1_UNDEF:
  ------------------
  |  |   62|      0|#define V_ASN1_UNDEF -1
  ------------------
  |  Branch (566:5): [True: 0, False: 34.1M]
  ------------------
  567|      0|        return -2;
  568|       |
  569|  1.22M|    case V_ASN1_NULL:
  ------------------
  |  |   69|  1.22M|#define V_ASN1_NULL 5
  ------------------
  |  Branch (569:5): [True: 1.22M, False: 32.9M]
  ------------------
  570|  1.22M|        cont = NULL;
  571|  1.22M|        len = 0;
  572|  1.22M|        break;
  573|       |
  574|      0|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   65|      0|#define V_ASN1_BOOLEAN 1
  ------------------
  |  Branch (574:5): [True: 0, False: 34.1M]
  ------------------
  575|      0|        tbool = (ASN1_BOOLEAN *)pval;
  576|      0|        if (*tbool == -1)
  ------------------
  |  Branch (576:13): [True: 0, False: 0]
  ------------------
  577|      0|            return -1;
  578|      0|        if (it->utype != V_ASN1_ANY) {
  ------------------
  |  |   60|      0|#define V_ASN1_ANY -4 /* used in ASN1 template code */
  ------------------
  |  Branch (578:13): [True: 0, False: 0]
  ------------------
  579|       |            /*
  580|       |             * Default handling if value == size field then omit
  581|       |             */
  582|      0|            if (*tbool && (it->size > 0))
  ------------------
  |  Branch (582:17): [True: 0, False: 0]
  |  Branch (582:27): [True: 0, False: 0]
  ------------------
  583|      0|                return -1;
  584|      0|            if (!*tbool && !it->size)
  ------------------
  |  Branch (584:17): [True: 0, False: 0]
  |  Branch (584:28): [True: 0, False: 0]
  ------------------
  585|      0|                return -1;
  586|      0|        }
  587|      0|        c = (unsigned char)*tbool;
  588|      0|        cont = &c;
  589|      0|        len = 1;
  590|      0|        break;
  591|       |
  592|  1.35M|    case V_ASN1_BIT_STRING:
  ------------------
  |  |   67|  1.35M|#define V_ASN1_BIT_STRING 3
  ------------------
  |  Branch (592:5): [True: 1.35M, False: 32.7M]
  ------------------
  593|  1.35M|        return ossl_i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval,
  594|  1.35M|            cout ? &cout : NULL);
  ------------------
  |  Branch (594:13): [True: 338k, False: 1.01M]
  ------------------
  595|       |
  596|      0|    case V_ASN1_INTEGER:
  ------------------
  |  |   66|      0|#define V_ASN1_INTEGER 2
  ------------------
  |  Branch (596:5): [True: 0, False: 34.1M]
  ------------------
  597|      0|    case V_ASN1_ENUMERATED:
  ------------------
  |  |   74|      0|#define V_ASN1_ENUMERATED 10
  ------------------
  |  Branch (597:5): [True: 0, False: 34.1M]
  ------------------
  598|       |        /*
  599|       |         * These are all have the same content format as ASN1_INTEGER
  600|       |         */
  601|      0|        return ossl_i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : NULL);
  ------------------
  |  Branch (601:61): [True: 0, False: 0]
  ------------------
  602|       |
  603|      0|    case V_ASN1_OCTET_STRING:
  ------------------
  |  |   68|      0|#define V_ASN1_OCTET_STRING 4
  ------------------
  |  Branch (603:5): [True: 0, False: 34.1M]
  ------------------
  604|      0|    case V_ASN1_NUMERICSTRING:
  ------------------
  |  |   78|      0|#define V_ASN1_NUMERICSTRING 18
  ------------------
  |  Branch (604:5): [True: 0, False: 34.1M]
  ------------------
  605|      0|    case V_ASN1_PRINTABLESTRING:
  ------------------
  |  |   79|      0|#define V_ASN1_PRINTABLESTRING 19
  ------------------
  |  Branch (605:5): [True: 0, False: 34.1M]
  ------------------
  606|      0|    case V_ASN1_T61STRING:
  ------------------
  |  |   80|      0|#define V_ASN1_T61STRING 20
  ------------------
  |  Branch (606:5): [True: 0, False: 34.1M]
  ------------------
  607|      0|    case V_ASN1_VIDEOTEXSTRING:
  ------------------
  |  |   82|      0|#define V_ASN1_VIDEOTEXSTRING 21
  ------------------
  |  Branch (607:5): [True: 0, False: 34.1M]
  ------------------
  608|      0|    case V_ASN1_IA5STRING:
  ------------------
  |  |   83|      0|#define V_ASN1_IA5STRING 22
  ------------------
  |  Branch (608:5): [True: 0, False: 34.1M]
  ------------------
  609|      0|    case V_ASN1_UTCTIME:
  ------------------
  |  |   84|      0|#define V_ASN1_UTCTIME 23
  ------------------
  |  Branch (609:5): [True: 0, False: 34.1M]
  ------------------
  610|      0|    case V_ASN1_GENERALIZEDTIME:
  ------------------
  |  |   85|      0|#define V_ASN1_GENERALIZEDTIME 24
  ------------------
  |  Branch (610:5): [True: 0, False: 34.1M]
  ------------------
  611|      0|    case V_ASN1_GRAPHICSTRING:
  ------------------
  |  |   86|      0|#define V_ASN1_GRAPHICSTRING 25
  ------------------
  |  Branch (611:5): [True: 0, False: 34.1M]
  ------------------
  612|      0|    case V_ASN1_VISIBLESTRING:
  ------------------
  |  |   88|      0|#define V_ASN1_VISIBLESTRING 26 /* alias */
  ------------------
  |  Branch (612:5): [True: 0, False: 34.1M]
  ------------------
  613|      0|    case V_ASN1_GENERALSTRING:
  ------------------
  |  |   89|      0|#define V_ASN1_GENERALSTRING 27
  ------------------
  |  Branch (613:5): [True: 0, False: 34.1M]
  ------------------
  614|      0|    case V_ASN1_UNIVERSALSTRING:
  ------------------
  |  |   90|      0|#define V_ASN1_UNIVERSALSTRING 28
  ------------------
  |  Branch (614:5): [True: 0, False: 34.1M]
  ------------------
  615|      0|    case V_ASN1_BMPSTRING:
  ------------------
  |  |   91|      0|#define V_ASN1_BMPSTRING 30
  ------------------
  |  Branch (615:5): [True: 0, False: 34.1M]
  ------------------
  616|  14.9M|    case V_ASN1_UTF8STRING:
  ------------------
  |  |   75|  14.9M|#define V_ASN1_UTF8STRING 12
  ------------------
  |  Branch (616:5): [True: 14.9M, False: 19.2M]
  ------------------
  617|  14.9M|    case V_ASN1_SEQUENCE:
  ------------------
  |  |   76|  14.9M|#define V_ASN1_SEQUENCE 16
  ------------------
  |  Branch (617:5): [True: 0, False: 34.1M]
  ------------------
  618|  14.9M|    case V_ASN1_SET:
  ------------------
  |  |   77|  14.9M|#define V_ASN1_SET 17
  ------------------
  |  Branch (618:5): [True: 0, False: 34.1M]
  ------------------
  619|  14.9M|    default:
  ------------------
  |  Branch (619:5): [True: 0, False: 34.1M]
  ------------------
  620|       |        /* All based on ASN1_STRING and handled the same */
  621|  14.9M|        strtmp = (ASN1_STRING *)*pval;
  622|       |        /* Special handling for NDEF */
  623|  14.9M|        if ((it->size == ASN1_TFLG_NDEF)
  ------------------
  |  |  583|  14.9M|#define ASN1_TFLG_NDEF (0x1 << 11)
  ------------------
  |  Branch (623:13): [True: 0, False: 14.9M]
  ------------------
  624|      0|            && (strtmp->flags & ASN1_STRING_FLAG_NDEF)) {
  ------------------
  |  |  170|      0|#define ASN1_STRING_FLAG_NDEF 0x010
  ------------------
  |  Branch (624:16): [True: 0, False: 0]
  ------------------
  625|      0|            if (cout) {
  ------------------
  |  Branch (625:17): [True: 0, False: 0]
  ------------------
  626|      0|                strtmp->data = cout;
  627|      0|                strtmp->length = 0;
  628|      0|            }
  629|       |            /* Special return code */
  630|      0|            return -2;
  631|      0|        }
  632|  14.9M|        cont = strtmp->data;
  633|  14.9M|        len = strtmp->length;
  634|       |
  635|  14.9M|        break;
  636|  34.1M|    }
  637|  32.7M|    if (cout && len)
  ------------------
  |  Branch (637:9): [True: 6.55M, False: 26.2M]
  |  Branch (637:17): [True: 6.31M, False: 245k]
  ------------------
  638|  6.31M|        memcpy(cout, cont, len);
  639|  32.7M|    return len;
  640|  34.1M|}

ASN1_item_free:
   19|  16.2M|{
   20|  16.2M|    ossl_asn1_item_embed_free(&val, it, 0);
   21|  16.2M|}
ossl_asn1_item_embed_free:
   29|  47.7M|{
   30|  47.7M|    const ASN1_TEMPLATE *tt = NULL, *seqtt;
   31|  47.7M|    const ASN1_EXTERN_FUNCS *ef;
   32|  47.7M|    const ASN1_AUX *aux = it->funcs;
   33|  47.7M|    ASN1_aux_cb *asn1_cb;
   34|  47.7M|    int i;
   35|       |
   36|  47.7M|    if (pval == NULL)
  ------------------
  |  Branch (36:9): [True: 0, False: 47.7M]
  ------------------
   37|      0|        return;
   38|  47.7M|    if ((it->itype != ASN1_ITYPE_PRIMITIVE) && *pval == NULL)
  ------------------
  |  |   82|  47.7M|#define ASN1_ITYPE_PRIMITIVE 0x0
  ------------------
  |  Branch (38:9): [True: 26.2M, False: 21.5M]
  |  Branch (38:48): [True: 5.69M, False: 20.5M]
  ------------------
   39|  5.69M|        return;
   40|  42.0M|    if (aux && aux->asn1_cb)
  ------------------
  |  Branch (40:9): [True: 2.93M, False: 39.1M]
  |  Branch (40:16): [True: 864k, False: 2.07M]
  ------------------
   41|   864k|        asn1_cb = aux->asn1_cb;
   42|  41.1M|    else
   43|  41.1M|        asn1_cb = 0;
   44|       |
   45|  42.0M|    switch (it->itype) {
  ------------------
  |  Branch (45:13): [True: 42.0M, False: 0]
  ------------------
   46|       |
   47|  21.5M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   82|  21.5M|#define ASN1_ITYPE_PRIMITIVE 0x0
  ------------------
  |  Branch (47:5): [True: 21.5M, False: 20.5M]
  ------------------
   48|  21.5M|        if (it->templates)
  ------------------
  |  Branch (48:13): [True: 1.64M, False: 19.8M]
  ------------------
   49|  1.64M|            ossl_asn1_template_free(pval, it->templates);
   50|  19.8M|        else
   51|  19.8M|            ossl_asn1_primitive_free(pval, it, embed);
   52|  21.5M|        break;
   53|       |
   54|  6.79M|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   87|  6.79M|#define ASN1_ITYPE_MSTRING 0x5
  ------------------
  |  Branch (54:5): [True: 6.79M, False: 35.2M]
  ------------------
   55|  6.79M|        ossl_asn1_primitive_free(pval, it, embed);
   56|  6.79M|        break;
   57|       |
   58|  99.6k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   84|  99.6k|#define ASN1_ITYPE_CHOICE 0x2
  ------------------
  |  Branch (58:5): [True: 99.6k, False: 41.9M]
  ------------------
   59|  99.6k|        if (asn1_cb) {
  ------------------
  |  Branch (59:13): [True: 39.4k, False: 60.2k]
  ------------------
   60|  39.4k|            i = asn1_cb(ASN1_OP_FREE_PRE, pval, it, NULL);
  ------------------
  |  |  733|  39.4k|#define ASN1_OP_FREE_PRE 2
  ------------------
   61|  39.4k|            if (i == 2)
  ------------------
  |  Branch (61:17): [True: 0, False: 39.4k]
  ------------------
   62|      0|                return;
   63|  39.4k|        }
   64|  99.6k|        i = ossl_asn1_get_choice_selector(pval, it);
   65|  99.6k|        if ((i >= 0) && (i < it->tcount)) {
  ------------------
  |  Branch (65:13): [True: 99.6k, False: 0]
  |  Branch (65:25): [True: 99.6k, False: 0]
  ------------------
   66|  99.6k|            ASN1_VALUE **pchval;
   67|       |
   68|  99.6k|            tt = it->templates + i;
   69|  99.6k|            pchval = ossl_asn1_get_field_ptr(pval, tt);
   70|  99.6k|            ossl_asn1_template_free(pchval, tt);
   71|  99.6k|        }
   72|  99.6k|        if (asn1_cb)
  ------------------
  |  Branch (72:13): [True: 39.4k, False: 60.2k]
  ------------------
   73|  39.4k|            asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL);
  ------------------
  |  |  734|  39.4k|#define ASN1_OP_FREE_POST 3
  ------------------
   74|  99.6k|        if (embed == 0) {
  ------------------
  |  Branch (74:13): [True: 99.6k, False: 0]
  ------------------
   75|  99.6k|            OPENSSL_free(*pval);
  ------------------
  |  |  131|  99.6k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   76|  99.6k|            *pval = NULL;
   77|  99.6k|        }
   78|  99.6k|        break;
   79|       |
   80|  1.66M|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   86|  1.66M|#define ASN1_ITYPE_EXTERN 0x4
  ------------------
  |  Branch (80:5): [True: 1.66M, False: 40.3M]
  ------------------
   81|  1.66M|        ef = it->funcs;
   82|  1.66M|        if (ef && ef->asn1_ex_free)
  ------------------
  |  Branch (82:13): [True: 1.66M, False: 0]
  |  Branch (82:19): [True: 1.66M, False: 0]
  ------------------
   83|  1.66M|            ef->asn1_ex_free(pval, it);
   84|  1.66M|        break;
   85|       |
   86|      0|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   88|      0|#define ASN1_ITYPE_NDEF_SEQUENCE 0x6
  ------------------
  |  Branch (86:5): [True: 0, False: 42.0M]
  ------------------
   87|  11.9M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   83|  11.9M|#define ASN1_ITYPE_SEQUENCE 0x1
  ------------------
  |  Branch (87:5): [True: 11.9M, False: 30.0M]
  ------------------
   88|  11.9M|        if (ossl_asn1_do_lock(pval, -1, it) != 0) {
  ------------------
  |  Branch (88:13): [True: 412k, False: 11.5M]
  ------------------
   89|       |            /* if error or ref-counter > 0 */
   90|   412k|            OPENSSL_assert(embed == 0);
  ------------------
  |  |  476|   412k|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (476:12): [True: 412k, False: 0]
  |  |  ------------------
  ------------------
   91|   412k|            *pval = NULL;
   92|   412k|            return;
   93|   412k|        }
   94|  11.5M|        if (asn1_cb) {
  ------------------
  |  Branch (94:13): [True: 412k, False: 11.1M]
  ------------------
   95|   412k|            i = asn1_cb(ASN1_OP_FREE_PRE, pval, it, NULL);
  ------------------
  |  |  733|   412k|#define ASN1_OP_FREE_PRE 2
  ------------------
   96|   412k|            if (i == 2)
  ------------------
  |  Branch (96:17): [True: 0, False: 412k]
  ------------------
   97|      0|                return;
   98|   412k|        }
   99|  11.5M|        ossl_asn1_enc_free(pval, it);
  100|       |        /*
  101|       |         * If we free up as normal we will invalidate any ANY DEFINED BY
  102|       |         * field and we won't be able to determine the type of the field it
  103|       |         * defines. So free up in reverse order.
  104|       |         */
  105|  11.5M|        tt = it->templates + it->tcount;
  106|  39.9M|        for (i = 0; i < it->tcount; i++) {
  ------------------
  |  Branch (106:21): [True: 28.3M, False: 11.5M]
  ------------------
  107|  28.3M|            ASN1_VALUE **pseqval;
  108|       |
  109|  28.3M|            tt--;
  110|  28.3M|            seqtt = ossl_asn1_do_adb(*pval, tt, 0);
  111|  28.3M|            if (!seqtt)
  ------------------
  |  Branch (111:17): [True: 0, False: 28.3M]
  ------------------
  112|      0|                continue;
  113|  28.3M|            pseqval = ossl_asn1_get_field_ptr(pval, seqtt);
  114|  28.3M|            ossl_asn1_template_free(pseqval, seqtt);
  115|  28.3M|        }
  116|  11.5M|        if (asn1_cb)
  ------------------
  |  Branch (116:13): [True: 412k, False: 11.1M]
  ------------------
  117|   412k|            asn1_cb(ASN1_OP_FREE_POST, pval, it, NULL);
  ------------------
  |  |  734|   412k|#define ASN1_OP_FREE_POST 3
  ------------------
  118|  11.5M|        if (embed == 0) {
  ------------------
  |  Branch (118:13): [True: 9.90M, False: 1.64M]
  ------------------
  119|  9.90M|            OPENSSL_free(*pval);
  ------------------
  |  |  131|  9.90M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  120|       |            *pval = NULL;
  121|  9.90M|        }
  122|  11.5M|        break;
  123|  42.0M|    }
  124|  42.0M|}
ossl_asn1_template_free:
  127|  32.3M|{
  128|  32.3M|    int embed = tt->flags & ASN1_TFLG_EMBED;
  ------------------
  |  |  586|  32.3M|#define ASN1_TFLG_EMBED (0x1 << 12)
  ------------------
  129|  32.3M|    ASN1_VALUE *tval;
  130|  32.3M|    if (embed) {
  ------------------
  |  Branch (130:9): [True: 3.89M, False: 28.4M]
  ------------------
  131|  3.89M|        tval = (ASN1_VALUE *)pval;
  132|  3.89M|        pval = &tval;
  133|  3.89M|    }
  134|  32.3M|    if (tt->flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  528|  32.3M|#define ASN1_TFLG_SK_MASK (0x3 << 1)
  ------------------
  |  Branch (134:9): [True: 2.31M, False: 30.0M]
  ------------------
  135|  2.31M|        STACK_OF(ASN1_VALUE) *sk = (STACK_OF(ASN1_VALUE) *)*pval;
  ------------------
  |  |   33|  2.31M|#define STACK_OF(type) struct stack_st_##type
  ------------------
  136|  2.31M|        int i;
  137|       |
  138|  3.83M|        for (i = 0; i < sk_ASN1_VALUE_num(sk); i++) {
  ------------------
  |  |  887|  3.83M|#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
  ------------------
  |  Branch (138:21): [True: 1.52M, False: 2.31M]
  ------------------
  139|  1.52M|            ASN1_VALUE *vtmp = sk_ASN1_VALUE_value(sk, i);
  ------------------
  |  |  888|  1.52M|#define sk_ASN1_VALUE_value(sk, idx) ((ASN1_VALUE *)OPENSSL_sk_value(ossl_check_const_ASN1_VALUE_sk_type(sk), (idx)))
  ------------------
  140|       |
  141|  1.52M|            ossl_asn1_item_embed_free(&vtmp, ASN1_ITEM_ptr(tt->item), embed);
  ------------------
  |  |  428|  1.52M|#define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  142|  1.52M|        }
  143|  2.31M|        sk_ASN1_VALUE_free(sk);
  ------------------
  |  |  893|  2.31M|#define sk_ASN1_VALUE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_VALUE_sk_type(sk))
  ------------------
  144|  2.31M|        *pval = NULL;
  145|  30.0M|    } else {
  146|  30.0M|        ossl_asn1_item_embed_free(pval, ASN1_ITEM_ptr(tt->item), embed);
  ------------------
  |  |  428|  30.0M|#define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  147|  30.0M|    }
  148|  32.3M|}
ossl_asn1_primitive_free:
  151|  28.4M|{
  152|  28.4M|    int utype;
  153|       |
  154|       |    /* Special case: if 'it' is a primitive with a free_func, use that. */
  155|  28.4M|    if (it) {
  ------------------
  |  Branch (155:9): [True: 26.6M, False: 1.83M]
  ------------------
  156|  26.6M|        const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
  157|       |
  158|  26.6M|        if (embed) {
  ------------------
  |  Branch (158:13): [True: 2.24M, False: 24.4M]
  ------------------
  159|  2.24M|            if (pf && pf->prim_clear) {
  ------------------
  |  Branch (159:17): [True: 0, False: 2.24M]
  |  Branch (159:23): [True: 0, False: 0]
  ------------------
  160|      0|                pf->prim_clear(pval, it);
  161|      0|                return;
  162|      0|            }
  163|  24.4M|        } else if (pf && pf->prim_free) {
  ------------------
  |  Branch (163:20): [True: 0, False: 24.4M]
  |  Branch (163:26): [True: 0, False: 0]
  ------------------
  164|      0|            pf->prim_free(pval, it);
  165|      0|            return;
  166|      0|        }
  167|  26.6M|    }
  168|       |
  169|       |    /* Special case: if 'it' is NULL, free contents of ASN1_TYPE */
  170|  28.4M|    if (!it) {
  ------------------
  |  Branch (170:9): [True: 1.83M, False: 26.6M]
  ------------------
  171|  1.83M|        ASN1_TYPE *typ = (ASN1_TYPE *)*pval;
  172|       |
  173|  1.83M|        utype = typ->type;
  174|  1.83M|        pval = &typ->value.asn1_value;
  175|  1.83M|        if (*pval == NULL)
  ------------------
  |  Branch (175:13): [True: 1.49M, False: 338k]
  ------------------
  176|  1.49M|            return;
  177|  26.6M|    } else if (it->itype == ASN1_ITYPE_MSTRING) {
  ------------------
  |  |   87|  26.6M|#define ASN1_ITYPE_MSTRING 0x5
  ------------------
  |  Branch (177:16): [True: 6.79M, False: 19.8M]
  ------------------
  178|  6.79M|        utype = -1;
  179|  6.79M|        if (*pval == NULL)
  ------------------
  |  Branch (179:13): [True: 0, False: 6.79M]
  ------------------
  180|      0|            return;
  181|  19.8M|    } else {
  182|  19.8M|        utype = it->utype;
  183|  19.8M|        if ((utype != V_ASN1_BOOLEAN) && *pval == NULL)
  ------------------
  |  |   65|  19.8M|#define V_ASN1_BOOLEAN 1
  ------------------
  |  Branch (183:13): [True: 17.4M, False: 2.39M]
  |  Branch (183:42): [True: 2.96M, False: 14.5M]
  ------------------
  184|  2.96M|            return;
  185|  19.8M|    }
  186|       |
  187|  24.0M|    switch (utype) {
  188|  9.79M|    case V_ASN1_OBJECT:
  ------------------
  |  |   70|  9.79M|#define V_ASN1_OBJECT 6
  ------------------
  |  Branch (188:5): [True: 9.79M, False: 14.2M]
  ------------------
  189|  9.79M|        ASN1_OBJECT_free((ASN1_OBJECT *)*pval);
  190|  9.79M|        break;
  191|       |
  192|  2.39M|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   65|  2.39M|#define V_ASN1_BOOLEAN 1
  ------------------
  |  Branch (192:5): [True: 2.39M, False: 21.6M]
  ------------------
  193|  2.39M|        if (it)
  ------------------
  |  Branch (193:13): [True: 2.39M, False: 0]
  ------------------
  194|  2.39M|            *(ASN1_BOOLEAN *)pval = it->size;
  195|      0|        else
  196|      0|            *(ASN1_BOOLEAN *)pval = -1;
  197|  2.39M|        return;
  198|       |
  199|      0|    case V_ASN1_NULL:
  ------------------
  |  |   69|      0|#define V_ASN1_NULL 5
  ------------------
  |  Branch (199:5): [True: 0, False: 24.0M]
  ------------------
  200|      0|        break;
  201|       |
  202|  1.83M|    case V_ASN1_ANY:
  ------------------
  |  |   60|  1.83M|#define V_ASN1_ANY -4 /* used in ASN1 template code */
  ------------------
  |  Branch (202:5): [True: 1.83M, False: 22.1M]
  ------------------
  203|  1.83M|        ossl_asn1_primitive_free(pval, NULL, 0);
  204|  1.83M|        OPENSSL_free(*pval);
  ------------------
  |  |  131|  1.83M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  205|  1.83M|        break;
  206|       |
  207|  10.0M|    default:
  ------------------
  |  Branch (207:5): [True: 10.0M, False: 14.0M]
  ------------------
  208|  10.0M|        ossl_asn1_string_embed_free((ASN1_STRING *)*pval, embed);
  209|  10.0M|        break;
  210|  24.0M|    }
  211|  21.6M|    *pval = NULL;
  212|  21.6M|}

ASN1_item_new:
   30|  5.64M|{
   31|  5.64M|    ASN1_VALUE *ret = NULL;
   32|  5.64M|    if (ASN1_item_ex_new(&ret, it) > 0)
  ------------------
  |  Branch (32:9): [True: 5.64M, False: 0]
  ------------------
   33|  5.64M|        return ret;
   34|      0|    return NULL;
   35|  5.64M|}
ASN1_item_new_ex:
   39|   412k|{
   40|   412k|    ASN1_VALUE *ret = NULL;
   41|   412k|    if (asn1_item_embed_new(&ret, it, 0, libctx, propq) > 0)
  ------------------
  |  Branch (41:9): [True: 412k, False: 0]
  ------------------
   42|   412k|        return ret;
   43|      0|    return NULL;
   44|   412k|}
ossl_asn1_item_ex_new_intern:
   50|  5.67M|{
   51|  5.67M|    return asn1_item_embed_new(pval, it, 0, libctx, propq);
   52|  5.67M|}
ASN1_item_ex_new:
   55|  5.64M|{
   56|  5.64M|    return asn1_item_embed_new(pval, it, 0, NULL, NULL);
   57|  5.64M|}
tasn_new.c:asn1_item_embed_new:
   61|  33.1M|{
   62|  33.1M|    const ASN1_TEMPLATE *tt = NULL;
   63|  33.1M|    const ASN1_EXTERN_FUNCS *ef;
   64|  33.1M|    const ASN1_AUX *aux = it->funcs;
   65|  33.1M|    ASN1_aux_cb *asn1_cb;
   66|  33.1M|    ASN1_VALUE **pseqval;
   67|  33.1M|    int i;
   68|  33.1M|    if (aux && aux->asn1_cb)
  ------------------
  |  Branch (68:9): [True: 2.40M, False: 30.7M]
  |  Branch (68:16): [True: 751k, False: 1.64M]
  ------------------
   69|   751k|        asn1_cb = aux->asn1_cb;
   70|  32.3M|    else
   71|  32.3M|        asn1_cb = 0;
   72|       |
   73|  33.1M|    switch (it->itype) {
  ------------------
  |  Branch (73:13): [True: 33.1M, False: 0]
  ------------------
   74|       |
   75|  1.23M|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   86|  1.23M|#define ASN1_ITYPE_EXTERN 0x4
  ------------------
  |  Branch (75:5): [True: 1.23M, False: 31.8M]
  ------------------
   76|  1.23M|        ef = it->funcs;
   77|  1.23M|        if (ef != NULL) {
  ------------------
  |  Branch (77:13): [True: 1.23M, False: 0]
  ------------------
   78|  1.23M|            if (ef->asn1_ex_new_ex != NULL) {
  ------------------
  |  Branch (78:17): [True: 412k, False: 824k]
  ------------------
   79|   412k|                if (!ef->asn1_ex_new_ex(pval, it, libctx, propq))
  ------------------
  |  Branch (79:21): [True: 0, False: 412k]
  ------------------
   80|      0|                    goto asn1err;
   81|   824k|            } else if (ef->asn1_ex_new != NULL) {
  ------------------
  |  Branch (81:24): [True: 824k, False: 0]
  ------------------
   82|   824k|                if (!ef->asn1_ex_new(pval, it))
  ------------------
  |  Branch (82:21): [True: 0, False: 824k]
  ------------------
   83|      0|                    goto asn1err;
   84|   824k|            }
   85|  1.23M|        }
   86|  1.23M|        break;
   87|       |
   88|  13.5M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   82|  13.5M|#define ASN1_ITYPE_PRIMITIVE 0x0
  ------------------
  |  Branch (88:5): [True: 13.5M, False: 19.5M]
  ------------------
   89|  13.5M|        if (it->templates) {
  ------------------
  |  Branch (89:13): [True: 0, False: 13.5M]
  ------------------
   90|      0|            if (!asn1_template_new(pval, it->templates, libctx, propq))
  ------------------
  |  Branch (90:17): [True: 0, False: 0]
  ------------------
   91|      0|                goto asn1err;
   92|  13.5M|        } else if (!asn1_primitive_new(pval, it, embed))
  ------------------
  |  Branch (92:20): [True: 0, False: 13.5M]
  ------------------
   93|      0|            goto asn1err;
   94|  13.5M|        break;
   95|       |
   96|  13.5M|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   87|  6.79M|#define ASN1_ITYPE_MSTRING 0x5
  ------------------
  |  Branch (96:5): [True: 6.79M, False: 26.3M]
  ------------------
   97|  6.79M|        if (!asn1_primitive_new(pval, it, embed))
  ------------------
  |  Branch (97:13): [True: 0, False: 6.79M]
  ------------------
   98|      0|            goto asn1err;
   99|  6.79M|        break;
  100|       |
  101|  6.79M|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   84|  99.6k|#define ASN1_ITYPE_CHOICE 0x2
  ------------------
  |  Branch (101:5): [True: 99.6k, False: 33.0M]
  ------------------
  102|  99.6k|        if (asn1_cb) {
  ------------------
  |  Branch (102:13): [True: 39.4k, False: 60.2k]
  ------------------
  103|  39.4k|            i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
  ------------------
  |  |  731|  39.4k|#define ASN1_OP_NEW_PRE 0
  ------------------
  104|  39.4k|            if (!i)
  ------------------
  |  Branch (104:17): [True: 0, False: 39.4k]
  ------------------
  105|      0|                goto auxerr;
  106|  39.4k|            if (i == 2) {
  ------------------
  |  Branch (106:17): [True: 0, False: 39.4k]
  ------------------
  107|      0|                return 1;
  108|      0|            }
  109|  39.4k|        }
  110|  99.6k|        if (embed) {
  ------------------
  |  Branch (110:13): [True: 0, False: 99.6k]
  ------------------
  111|      0|            memset(*pval, 0, it->size);
  112|  99.6k|        } else {
  113|  99.6k|            *pval = OPENSSL_zalloc(it->size);
  ------------------
  |  |  108|  99.6k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  114|  99.6k|            if (*pval == NULL)
  ------------------
  |  Branch (114:17): [True: 0, False: 99.6k]
  ------------------
  115|      0|                return 0;
  116|  99.6k|        }
  117|  99.6k|        ossl_asn1_set_choice_selector(pval, -1, it);
  118|  99.6k|        if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
  ------------------
  |  |  732|  39.4k|#define ASN1_OP_NEW_POST 1
  ------------------
  |  Branch (118:13): [True: 39.4k, False: 60.2k]
  |  Branch (118:24): [True: 0, False: 39.4k]
  ------------------
  119|      0|            goto auxerr2;
  120|  99.6k|        break;
  121|       |
  122|  99.6k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   88|      0|#define ASN1_ITYPE_NDEF_SEQUENCE 0x6
  ------------------
  |  Branch (122:5): [True: 0, False: 33.1M]
  ------------------
  123|  11.4M|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   83|  11.4M|#define ASN1_ITYPE_SEQUENCE 0x1
  ------------------
  |  Branch (123:5): [True: 11.4M, False: 21.6M]
  ------------------
  124|  11.4M|        if (asn1_cb) {
  ------------------
  |  Branch (124:13): [True: 711k, False: 10.7M]
  ------------------
  125|   711k|            i = asn1_cb(ASN1_OP_NEW_PRE, pval, it, NULL);
  ------------------
  |  |  731|   711k|#define ASN1_OP_NEW_PRE 0
  ------------------
  126|   711k|            if (!i)
  ------------------
  |  Branch (126:17): [True: 0, False: 711k]
  ------------------
  127|      0|                goto auxerr;
  128|   711k|            if (i == 2) {
  ------------------
  |  Branch (128:17): [True: 299k, False: 412k]
  ------------------
  129|   299k|                return 1;
  130|   299k|            }
  131|   711k|        }
  132|  11.1M|        if (embed) {
  ------------------
  |  Branch (132:13): [True: 1.64M, False: 9.49M]
  ------------------
  133|  1.64M|            memset(*pval, 0, it->size);
  134|  9.49M|        } else {
  135|  9.49M|            *pval = OPENSSL_zalloc(it->size);
  ------------------
  |  |  108|  9.49M|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  136|  9.49M|            if (*pval == NULL)
  ------------------
  |  Branch (136:17): [True: 0, False: 9.49M]
  ------------------
  137|      0|                return 0;
  138|  9.49M|        }
  139|       |        /* 0 : init. lock */
  140|  11.1M|        if (ossl_asn1_do_lock(pval, 0, it) < 0) {
  ------------------
  |  Branch (140:13): [True: 0, False: 11.1M]
  ------------------
  141|      0|            if (!embed) {
  ------------------
  |  Branch (141:17): [True: 0, False: 0]
  ------------------
  142|      0|                OPENSSL_free(*pval);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  143|      0|                *pval = NULL;
  144|      0|            }
  145|      0|            goto asn1err;
  146|      0|        }
  147|  11.1M|        ossl_asn1_enc_init(pval, it);
  148|  38.6M|        for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) {
  ------------------
  |  Branch (148:41): [True: 27.5M, False: 11.1M]
  ------------------
  149|  27.5M|            pseqval = ossl_asn1_get_field_ptr(pval, tt);
  150|  27.5M|            if (!asn1_template_new(pseqval, tt, libctx, propq))
  ------------------
  |  Branch (150:17): [True: 0, False: 27.5M]
  ------------------
  151|      0|                goto asn1err2;
  152|  27.5M|        }
  153|  11.1M|        if (asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it, NULL))
  ------------------
  |  |  732|   412k|#define ASN1_OP_NEW_POST 1
  ------------------
  |  Branch (153:13): [True: 412k, False: 10.7M]
  |  Branch (153:24): [True: 0, False: 412k]
  ------------------
  154|      0|            goto auxerr2;
  155|  11.1M|        break;
  156|  33.1M|    }
  157|  32.8M|    return 1;
  158|       |
  159|      0|asn1err2:
  160|      0|    ossl_asn1_item_embed_free(pval, it, embed);
  161|      0|asn1err:
  162|      0|    ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  163|      0|    return 0;
  164|       |
  165|      0|auxerr2:
  166|      0|    ossl_asn1_item_embed_free(pval, it, embed);
  167|      0|auxerr:
  168|       |    ERR_raise(ERR_LIB_ASN1, ASN1_R_AUX_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  169|      0|    return 0;
  170|      0|}
tasn_new.c:asn1_template_new:
  207|  27.5M|{
  208|  27.5M|    const ASN1_ITEM *it = ASN1_ITEM_ptr(tt->item);
  ------------------
  |  |  428|  27.5M|#define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  209|  27.5M|    int embed = tt->flags & ASN1_TFLG_EMBED;
  ------------------
  |  |  586|  27.5M|#define ASN1_TFLG_EMBED (0x1 << 12)
  ------------------
  210|  27.5M|    ASN1_VALUE *tval;
  211|  27.5M|    int ret;
  212|  27.5M|    if (embed) {
  ------------------
  |  Branch (212:9): [True: 3.89M, False: 23.6M]
  ------------------
  213|  3.89M|        tval = (ASN1_VALUE *)pval;
  214|  3.89M|        pval = &tval;
  215|  3.89M|    }
  216|  27.5M|    if (tt->flags & ASN1_TFLG_OPTIONAL) {
  ------------------
  |  |  512|  27.5M|#define ASN1_TFLG_OPTIONAL (0x1)
  ------------------
  |  Branch (216:9): [True: 6.14M, False: 21.3M]
  ------------------
  217|  6.14M|        asn1_template_clear(pval, tt);
  218|  6.14M|        return 1;
  219|  6.14M|    }
  220|       |    /* If ANY DEFINED BY nothing to do */
  221|       |
  222|  21.3M|    if (tt->flags & ASN1_TFLG_ADB_MASK) {
  ------------------
  |  |  572|  21.3M|#define ASN1_TFLG_ADB_MASK (0x3 << 8)
  ------------------
  |  Branch (222:9): [True: 0, False: 21.3M]
  ------------------
  223|      0|        *pval = NULL;
  224|      0|        return 1;
  225|      0|    }
  226|       |    /* If SET OF or SEQUENCE OF, its a STACK */
  227|  21.3M|    if (tt->flags & ASN1_TFLG_SK_MASK) {
  ------------------
  |  |  528|  21.3M|#define ASN1_TFLG_SK_MASK (0x3 << 1)
  ------------------
  |  Branch (227:9): [True: 0, False: 21.3M]
  ------------------
  228|      0|        STACK_OF(ASN1_VALUE) *skval;
  ------------------
  |  |   33|      0|#define STACK_OF(type) struct stack_st_##type
  ------------------
  229|      0|        skval = sk_ASN1_VALUE_new_null();
  ------------------
  |  |  890|      0|#define sk_ASN1_VALUE_new_null() ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_null())
  ------------------
  230|      0|        if (!skval) {
  ------------------
  |  Branch (230:13): [True: 0, False: 0]
  ------------------
  231|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  232|      0|            ret = 0;
  233|      0|            goto done;
  234|      0|        }
  235|      0|        *pval = (ASN1_VALUE *)skval;
  236|      0|        ret = 1;
  237|      0|        goto done;
  238|      0|    }
  239|       |    /* Otherwise pass it back to the item routine */
  240|  21.3M|    ret = asn1_item_embed_new(pval, it, embed, libctx, propq);
  241|  21.3M|done:
  242|  21.3M|    return ret;
  243|  21.3M|}
tasn_new.c:asn1_template_clear:
  246|  6.14M|{
  247|       |    /* If ADB or STACK just NULL the field */
  248|  6.14M|    if (tt->flags & (ASN1_TFLG_ADB_MASK | ASN1_TFLG_SK_MASK))
  ------------------
  |  |  572|  6.14M|#define ASN1_TFLG_ADB_MASK (0x3 << 8)
  ------------------
                  if (tt->flags & (ASN1_TFLG_ADB_MASK | ASN1_TFLG_SK_MASK))
  ------------------
  |  |  528|  6.14M|#define ASN1_TFLG_SK_MASK (0x3 << 1)
  ------------------
  |  Branch (248:9): [True: 525k, False: 5.62M]
  ------------------
  249|   525k|        *pval = NULL;
  250|  5.62M|    else
  251|  5.62M|        asn1_item_clear(pval, ASN1_ITEM_ptr(tt->item));
  ------------------
  |  |  428|  5.62M|#define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  252|  6.14M|}
tasn_new.c:asn1_item_clear:
  173|  5.62M|{
  174|  5.62M|    const ASN1_EXTERN_FUNCS *ef;
  175|       |
  176|  5.62M|    switch (it->itype) {
  ------------------
  |  Branch (176:13): [True: 5.62M, False: 0]
  ------------------
  177|       |
  178|      0|    case ASN1_ITYPE_EXTERN:
  ------------------
  |  |   86|      0|#define ASN1_ITYPE_EXTERN 0x4
  ------------------
  |  Branch (178:5): [True: 0, False: 5.62M]
  ------------------
  179|      0|        ef = it->funcs;
  180|      0|        if (ef && ef->asn1_ex_clear)
  ------------------
  |  Branch (180:13): [True: 0, False: 0]
  |  Branch (180:19): [True: 0, False: 0]
  ------------------
  181|      0|            ef->asn1_ex_clear(pval, it);
  182|      0|        else
  183|      0|            *pval = NULL;
  184|      0|        break;
  185|       |
  186|  5.58M|    case ASN1_ITYPE_PRIMITIVE:
  ------------------
  |  |   82|  5.58M|#define ASN1_ITYPE_PRIMITIVE 0x0
  ------------------
  |  Branch (186:5): [True: 5.58M, False: 39.4k]
  ------------------
  187|  5.58M|        if (it->templates)
  ------------------
  |  Branch (187:13): [True: 0, False: 5.58M]
  ------------------
  188|      0|            asn1_template_clear(pval, it->templates);
  189|  5.58M|        else
  190|  5.58M|            asn1_primitive_clear(pval, it);
  191|  5.58M|        break;
  192|       |
  193|      0|    case ASN1_ITYPE_MSTRING:
  ------------------
  |  |   87|      0|#define ASN1_ITYPE_MSTRING 0x5
  ------------------
  |  Branch (193:5): [True: 0, False: 5.62M]
  ------------------
  194|      0|        asn1_primitive_clear(pval, it);
  195|      0|        break;
  196|       |
  197|  39.4k|    case ASN1_ITYPE_CHOICE:
  ------------------
  |  |   84|  39.4k|#define ASN1_ITYPE_CHOICE 0x2
  ------------------
  |  Branch (197:5): [True: 39.4k, False: 5.58M]
  ------------------
  198|  39.4k|    case ASN1_ITYPE_SEQUENCE:
  ------------------
  |  |   83|  39.4k|#define ASN1_ITYPE_SEQUENCE 0x1
  ------------------
  |  Branch (198:5): [True: 0, False: 5.62M]
  ------------------
  199|  39.4k|    case ASN1_ITYPE_NDEF_SEQUENCE:
  ------------------
  |  |   88|  39.4k|#define ASN1_ITYPE_NDEF_SEQUENCE 0x6
  ------------------
  |  Branch (199:5): [True: 0, False: 5.62M]
  ------------------
  200|       |        *pval = NULL;
  201|  39.4k|        break;
  202|  5.62M|    }
  203|  5.62M|}
tasn_new.c:asn1_primitive_clear:
  326|  5.58M|{
  327|  5.58M|    int utype;
  328|  5.58M|    if (it && it->funcs) {
  ------------------
  |  Branch (328:9): [True: 5.58M, False: 0]
  |  Branch (328:15): [True: 0, False: 5.58M]
  ------------------
  329|      0|        const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
  330|      0|        if (pf->prim_clear)
  ------------------
  |  Branch (330:13): [True: 0, False: 0]
  ------------------
  331|      0|            pf->prim_clear(pval, it);
  332|      0|        else
  333|      0|            *pval = NULL;
  334|      0|        return;
  335|      0|    }
  336|  5.58M|    if (!it || (it->itype == ASN1_ITYPE_MSTRING))
  ------------------
  |  |   87|  5.58M|#define ASN1_ITYPE_MSTRING 0x5
  ------------------
  |  Branch (336:9): [True: 0, False: 5.58M]
  |  Branch (336:16): [True: 0, False: 5.58M]
  ------------------
  337|      0|        utype = -1;
  338|  5.58M|    else
  339|  5.58M|        utype = it->utype;
  340|  5.58M|    if (utype == V_ASN1_BOOLEAN)
  ------------------
  |  |   65|  5.58M|#define V_ASN1_BOOLEAN 1
  ------------------
  |  Branch (340:9): [True: 1.75M, False: 3.82M]
  ------------------
  341|  1.75M|        *(ASN1_BOOLEAN *)pval = it->size;
  342|  3.82M|    else
  343|  3.82M|        *pval = NULL;
  344|  5.58M|}
tasn_new.c:asn1_primitive_new:
  261|  20.3M|{
  262|  20.3M|    ASN1_TYPE *typ;
  263|  20.3M|    ASN1_STRING *str;
  264|  20.3M|    int utype;
  265|       |
  266|  20.3M|    if (!it)
  ------------------
  |  Branch (266:9): [True: 0, False: 20.3M]
  ------------------
  267|      0|        return 0;
  268|       |
  269|  20.3M|    if (it->funcs) {
  ------------------
  |  Branch (269:9): [True: 0, False: 20.3M]
  ------------------
  270|      0|        const ASN1_PRIMITIVE_FUNCS *pf = it->funcs;
  271|      0|        if (embed) {
  ------------------
  |  Branch (271:13): [True: 0, False: 0]
  ------------------
  272|      0|            if (pf->prim_clear) {
  ------------------
  |  Branch (272:17): [True: 0, False: 0]
  ------------------
  273|      0|                pf->prim_clear(pval, it);
  274|      0|                return 1;
  275|      0|            }
  276|      0|        } else if (pf->prim_new) {
  ------------------
  |  Branch (276:20): [True: 0, False: 0]
  ------------------
  277|      0|            return pf->prim_new(pval, it);
  278|      0|        }
  279|      0|    }
  280|       |
  281|  20.3M|    if (it->itype == ASN1_ITYPE_MSTRING)
  ------------------
  |  |   87|  20.3M|#define ASN1_ITYPE_MSTRING 0x5
  ------------------
  |  Branch (281:9): [True: 6.79M, False: 13.5M]
  ------------------
  282|  6.79M|        utype = -1;
  283|  13.5M|    else
  284|  13.5M|        utype = it->utype;
  285|  20.3M|    switch (utype) {
  286|  9.45M|    case V_ASN1_OBJECT:
  ------------------
  |  |   70|  9.45M|#define V_ASN1_OBJECT 6
  ------------------
  |  Branch (286:5): [True: 9.45M, False: 10.8M]
  ------------------
  287|  9.45M|        *pval = (ASN1_VALUE *)OBJ_nid2obj(NID_undef);
  ------------------
  |  |   18|  9.45M|#define NID_undef                       0
  ------------------
  288|  9.45M|        return 1;
  289|       |
  290|      0|    case V_ASN1_BOOLEAN:
  ------------------
  |  |   65|      0|#define V_ASN1_BOOLEAN 1
  ------------------
  |  Branch (290:5): [True: 0, False: 20.3M]
  ------------------
  291|      0|        *(ASN1_BOOLEAN *)pval = it->size;
  292|      0|        return 1;
  293|       |
  294|      0|    case V_ASN1_NULL:
  ------------------
  |  |   69|      0|#define V_ASN1_NULL 5
  ------------------
  |  Branch (294:5): [True: 0, False: 20.3M]
  ------------------
  295|      0|        *pval = (ASN1_VALUE *)1;
  296|      0|        return 1;
  297|       |
  298|  1.83M|    case V_ASN1_ANY:
  ------------------
  |  |   60|  1.83M|#define V_ASN1_ANY -4 /* used in ASN1 template code */
  ------------------
  |  Branch (298:5): [True: 1.83M, False: 18.5M]
  ------------------
  299|  1.83M|        if ((typ = OPENSSL_malloc(sizeof(*typ))) == NULL)
  ------------------
  |  |  106|  1.83M|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (299:13): [True: 0, False: 1.83M]
  ------------------
  300|      0|            return 0;
  301|  1.83M|        typ->value.ptr = NULL;
  302|  1.83M|        typ->type = -1;
  303|  1.83M|        *pval = (ASN1_VALUE *)typ;
  304|  1.83M|        break;
  305|       |
  306|  9.04M|    default:
  ------------------
  |  Branch (306:5): [True: 9.04M, False: 11.2M]
  ------------------
  307|  9.04M|        if (embed) {
  ------------------
  |  Branch (307:13): [True: 2.24M, False: 6.79M]
  ------------------
  308|  2.24M|            str = *(ASN1_STRING **)pval;
  309|  2.24M|            memset(str, 0, sizeof(*str));
  310|  2.24M|            str->type = utype;
  311|  2.24M|            str->flags = ASN1_STRING_FLAG_EMBED;
  ------------------
  |  |  185|  2.24M|#define ASN1_STRING_FLAG_EMBED 0x080
  ------------------
  312|  6.79M|        } else {
  313|  6.79M|            str = ASN1_STRING_type_new(utype);
  314|  6.79M|            *pval = (ASN1_VALUE *)str;
  315|  6.79M|        }
  316|  9.04M|        if (it->itype == ASN1_ITYPE_MSTRING && str)
  ------------------
  |  |   87|  18.0M|#define ASN1_ITYPE_MSTRING 0x5
  ------------------
  |  Branch (316:13): [True: 6.79M, False: 2.24M]
  |  Branch (316:48): [True: 6.79M, False: 0]
  ------------------
  317|  6.79M|            str->flags |= ASN1_STRING_FLAG_MSTRING;
  ------------------
  |  |  183|  6.79M|#define ASN1_STRING_FLAG_MSTRING 0x040
  ------------------
  318|  9.04M|        break;
  319|  20.3M|    }
  320|  10.8M|    if (*pval)
  ------------------
  |  Branch (320:9): [True: 10.8M, False: 0]
  ------------------
  321|  10.8M|        return 1;
  322|      0|    return 0;
  323|  10.8M|}

ASN1_OCTET_STRING_free:
   24|  1.64M|    {                                                          \
   25|  1.64M|        ASN1_STRING_free(x);                                   \
   26|  1.64M|    }
ASN1_INTEGER_new:
   20|   430k|    {                                                          \
   21|   430k|        return ASN1_STRING_type_new(V_##sname);                \
  ------------------
  |  |   66|   430k|#define V_ASN1_INTEGER 2
  ------------------
   22|   430k|    }                                                          \
ASN1_BIT_STRING_new:
   20|  1.57M|    {                                                          \
   21|  1.57M|        return ASN1_STRING_type_new(V_##sname);                \
  ------------------
  |  |   67|  1.57M|#define V_ASN1_BIT_STRING 3
  ------------------
   22|  1.57M|    }                                                          \
ASN1_BIT_STRING_free:
   24|  1.15M|    {                                                          \
   25|  1.15M|        ASN1_STRING_free(x);                                   \
   26|  1.15M|    }

ossl_asn1_get_choice_selector:
   30|  99.6k|{
   31|  99.6k|    int *sel = offset2ptr(*pval, it->utype);
  ------------------
  |  |   23|  99.6k|#define offset2ptr(addr, offset) (void *)(((char *)addr) + offset)
  ------------------
   32|       |
   33|  99.6k|    return *sel;
   34|  99.6k|}
ossl_asn1_set_choice_selector:
   50|   199k|{
   51|   199k|    int *sel, ret;
   52|       |
   53|   199k|    sel = offset2ptr(*pval, it->utype);
  ------------------
  |  |   23|   199k|#define offset2ptr(addr, offset) (void *)(((char *)addr) + offset)
  ------------------
   54|   199k|    ret = *sel;
   55|   199k|    *sel = value;
   56|   199k|    return ret;
   57|   199k|}
ossl_asn1_do_lock:
   69|  23.1M|{
   70|  23.1M|    const ASN1_AUX *aux;
   71|  23.1M|    CRYPTO_RWLOCK **lock;
   72|  23.1M|    CRYPTO_REF_COUNT *refcnt;
   73|  23.1M|    int ret = -1;
   74|       |
   75|  23.1M|    if ((it->itype != ASN1_ITYPE_SEQUENCE)
  ------------------
  |  |   83|  23.1M|#define ASN1_ITYPE_SEQUENCE 0x1
  ------------------
  |  Branch (75:9): [True: 0, False: 23.1M]
  ------------------
   76|      0|        && (it->itype != ASN1_ITYPE_NDEF_SEQUENCE))
  ------------------
  |  |   88|      0|#define ASN1_ITYPE_NDEF_SEQUENCE 0x6
  ------------------
  |  Branch (76:12): [True: 0, False: 0]
  ------------------
   77|      0|        return 0;
   78|  23.1M|    aux = it->funcs;
   79|  23.1M|    if (aux == NULL || (aux->flags & ASN1_AFLG_REFCOUNT) == 0)
  ------------------
  |  |  721|  2.06M|#define ASN1_AFLG_REFCOUNT 1
  ------------------
  |  Branch (79:9): [True: 21.0M, False: 2.06M]
  |  Branch (79:24): [True: 824k, False: 1.23M]
  ------------------
   80|  21.8M|        return 0;
   81|  1.23M|    lock = offset2ptr(*pval, aux->ref_lock);
  ------------------
  |  |   23|  1.23M|#define offset2ptr(addr, offset) (void *)(((char *)addr) + offset)
  ------------------
   82|  1.23M|    refcnt = offset2ptr(*pval, aux->ref_offset);
  ------------------
  |  |   23|  1.23M|#define offset2ptr(addr, offset) (void *)(((char *)addr) + offset)
  ------------------
   83|       |
   84|  1.23M|    switch (op) {
  ------------------
  |  Branch (84:13): [True: 1.23M, False: 0]
  ------------------
   85|   412k|    case 0:
  ------------------
  |  Branch (85:5): [True: 412k, False: 824k]
  ------------------
   86|   412k|        if (!CRYPTO_NEW_REF(refcnt, 1))
  ------------------
  |  Branch (86:13): [True: 0, False: 412k]
  ------------------
   87|      0|            return -1;
   88|   412k|        *lock = CRYPTO_THREAD_lock_new();
   89|   412k|        if (*lock == NULL) {
  ------------------
  |  Branch (89:13): [True: 0, False: 412k]
  ------------------
   90|      0|            CRYPTO_FREE_REF(refcnt);
   91|      0|            ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   92|      0|            return -1;
   93|      0|        }
   94|   412k|        ret = 1;
   95|   412k|        break;
   96|      0|    case 1:
  ------------------
  |  Branch (96:5): [True: 0, False: 1.23M]
  ------------------
   97|      0|        if (!CRYPTO_UP_REF(refcnt, &ret))
  ------------------
  |  Branch (97:13): [True: 0, False: 0]
  ------------------
   98|      0|            return -1;
   99|      0|        break;
  100|   824k|    case -1:
  ------------------
  |  Branch (100:5): [True: 824k, False: 412k]
  ------------------
  101|   824k|        if (!CRYPTO_DOWN_REF(refcnt, &ret))
  ------------------
  |  Branch (101:13): [True: 0, False: 824k]
  ------------------
  102|      0|            return -1; /* failed */
  103|   824k|        REF_PRINT_EX(it->sname, ret, (void *)it);
  ------------------
  |  |  299|   824k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  ------------------
  |  |  |  |  297|   824k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|   824k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  104|   824k|        REF_ASSERT_ISNT(ret < 0);
  ------------------
  |  |  293|   824k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 824k]
  |  |  ------------------
  ------------------
  105|   824k|        if (ret == 0) {
  ------------------
  |  Branch (105:13): [True: 412k, False: 412k]
  ------------------
  106|   412k|            CRYPTO_THREAD_lock_free(*lock);
  107|   412k|            *lock = NULL;
  108|   412k|            CRYPTO_FREE_REF(refcnt);
  109|   412k|        }
  110|   824k|        break;
  111|  1.23M|    }
  112|       |
  113|  1.23M|    return ret;
  114|  1.23M|}
ossl_asn1_enc_init:
  142|  11.1M|{
  143|  11.1M|    ASN1_ENCODING *enc = asn1_get_enc_ptr(pval, it);
  144|       |
  145|  11.1M|    if (enc != NULL) {
  ------------------
  |  Branch (145:9): [True: 412k, False: 10.7M]
  ------------------
  146|       |        enc->enc = NULL;
  147|   412k|        enc->len = 0;
  148|   412k|        enc->modified = 1;
  149|   412k|    }
  150|  11.1M|}
ossl_asn1_enc_free:
  153|  11.5M|{
  154|  11.5M|    ASN1_ENCODING *enc = asn1_get_enc_ptr(pval, it);
  155|       |
  156|  11.5M|    if (enc != NULL) {
  ------------------
  |  Branch (156:9): [True: 412k, False: 11.1M]
  ------------------
  157|   412k|        OPENSSL_free(enc->enc);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  158|       |        enc->enc = NULL;
  159|   412k|        enc->len = 0;
  160|   412k|        enc->modified = 1;
  161|   412k|    }
  162|  11.5M|}
ossl_asn1_enc_save:
  166|  9.69M|{
  167|  9.69M|    ASN1_ENCODING *enc = asn1_get_enc_ptr(pval, it);
  168|       |
  169|  9.69M|    if (enc == NULL)
  ------------------
  |  Branch (169:9): [True: 9.28M, False: 412k]
  ------------------
  170|  9.28M|        return 1;
  171|       |
  172|   412k|    OPENSSL_free(enc->enc);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  173|   412k|    if (inlen <= 0) {
  ------------------
  |  Branch (173:9): [True: 0, False: 412k]
  ------------------
  174|      0|        enc->enc = NULL;
  175|      0|        return 0;
  176|      0|    }
  177|   412k|    if ((enc->enc = OPENSSL_malloc(inlen)) == NULL)
  ------------------
  |  |  106|   412k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (177:9): [True: 0, False: 412k]
  ------------------
  178|      0|        return 0;
  179|   412k|    memcpy(enc->enc, in, inlen);
  180|   412k|    enc->len = inlen;
  181|   412k|    enc->modified = 0;
  182|       |
  183|   412k|    return 1;
  184|   412k|}
ossl_asn1_enc_restore:
  188|  11.6M|{
  189|  11.6M|    const ASN1_ENCODING *enc = asn1_get_const_enc_ptr(pval, it);
  190|       |
  191|  11.6M|    if (enc == NULL || enc->modified)
  ------------------
  |  Branch (191:9): [True: 10.6M, False: 1.01M]
  |  Branch (191:24): [True: 0, False: 1.01M]
  ------------------
  192|  10.6M|        return 0;
  193|  1.01M|    if (out) {
  ------------------
  |  Branch (193:9): [True: 338k, False: 676k]
  ------------------
  194|   338k|        memcpy(*out, enc->enc, enc->len);
  195|   338k|        *out += enc->len;
  196|   338k|    }
  197|  1.01M|    if (len != NULL)
  ------------------
  |  Branch (197:9): [True: 1.01M, False: 0]
  ------------------
  198|  1.01M|        *len = enc->len;
  199|  1.01M|    return 1;
  200|  11.6M|}
ossl_asn1_get_field_ptr:
  204|  81.6M|{
  205|  81.6M|    ASN1_VALUE **pvaltmp = offset2ptr(*pval, tt->offset);
  ------------------
  |  |   23|  81.6M|#define offset2ptr(addr, offset) (void *)(((char *)addr) + offset)
  ------------------
  206|       |
  207|       |    /*
  208|       |     * NOTE for BOOLEAN types the field is just a plain int so we can't
  209|       |     * return int **, so settle for (int *).
  210|       |     */
  211|  81.6M|    return pvaltmp;
  212|  81.6M|}
ossl_asn1_get_const_field_ptr:
  217|  29.6M|{
  218|  29.6M|    return offset2ptr(*pval, tt->offset);
  ------------------
  |  |   23|  29.6M|#define offset2ptr(addr, offset) (void *)(((char *)addr) + offset)
  ------------------
  219|  29.6M|}
ossl_asn1_do_adb:
  229|  83.3M|{
  230|  83.3M|    const ASN1_ADB *adb;
  231|  83.3M|    const ASN1_ADB_TABLE *atbl;
  232|  83.3M|    long selector;
  233|  83.3M|    const ASN1_VALUE **sfld;
  234|  83.3M|    int i;
  235|       |
  236|  83.3M|    if ((tt->flags & ASN1_TFLG_ADB_MASK) == 0)
  ------------------
  |  |  572|  83.3M|#define ASN1_TFLG_ADB_MASK (0x3 << 8)
  ------------------
  |  Branch (236:9): [True: 83.3M, False: 0]
  ------------------
  237|  83.3M|        return tt;
  238|       |
  239|       |    /* Else ANY DEFINED BY ... get the table */
  240|      0|    adb = ASN1_ADB_ptr(tt->item);
  ------------------
  |  |   91|      0|#define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)((iptr)()))
  ------------------
  241|       |
  242|       |    /* Get the selector field */
  243|      0|    sfld = offset2ptr(val, adb->offset);
  ------------------
  |  |   23|      0|#define offset2ptr(addr, offset) (void *)(((char *)addr) + offset)
  ------------------
  244|       |
  245|       |    /* Check if NULL */
  246|      0|    if (*sfld == NULL) {
  ------------------
  |  Branch (246:9): [True: 0, False: 0]
  ------------------
  247|      0|        if (adb->null_tt == NULL)
  ------------------
  |  Branch (247:13): [True: 0, False: 0]
  ------------------
  248|      0|            goto err;
  249|      0|        return adb->null_tt;
  250|      0|    }
  251|       |
  252|       |    /*
  253|       |     * Convert type to a long: NB: don't check for NID_undef here because it
  254|       |     * might be a legitimate value in the table
  255|       |     */
  256|      0|    if ((tt->flags & ASN1_TFLG_ADB_OID) != 0)
  ------------------
  |  |  574|      0|#define ASN1_TFLG_ADB_OID (0x1 << 8)
  ------------------
  |  Branch (256:9): [True: 0, False: 0]
  ------------------
  257|      0|        selector = OBJ_obj2nid((ASN1_OBJECT *)*sfld);
  258|      0|    else
  259|      0|        selector = ASN1_INTEGER_get((ASN1_INTEGER *)*sfld);
  260|       |
  261|       |    /* Let application callback translate value */
  262|      0|    if (adb->adb_cb != NULL && adb->adb_cb(&selector) == 0) {
  ------------------
  |  Branch (262:9): [True: 0, False: 0]
  |  Branch (262:32): [True: 0, False: 0]
  ------------------
  263|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  264|      0|        return NULL;
  265|      0|    }
  266|       |
  267|       |    /*
  268|       |     * Try to find matching entry in table Maybe should check application
  269|       |     * types first to allow application override? Might also be useful to
  270|       |     * have a flag which indicates table is sorted and we can do a binary
  271|       |     * search. For now stick to a linear search.
  272|       |     */
  273|       |
  274|      0|    for (atbl = adb->tbl, i = 0; i < adb->tblcount; i++, atbl++)
  ------------------
  |  Branch (274:34): [True: 0, False: 0]
  ------------------
  275|      0|        if (atbl->value == selector)
  ------------------
  |  Branch (275:13): [True: 0, False: 0]
  ------------------
  276|      0|            return &atbl->tt;
  277|       |
  278|       |    /* FIXME: need to search application table too */
  279|       |
  280|       |    /* No match, return default type */
  281|      0|    if (!adb->default_tt)
  ------------------
  |  Branch (281:9): [True: 0, False: 0]
  ------------------
  282|      0|        goto err;
  283|      0|    return adb->default_tt;
  284|       |
  285|      0|err:
  286|       |    /* FIXME: should log the value or OID of unsupported type */
  287|      0|    if (nullerr)
  ------------------
  |  Branch (287:9): [True: 0, False: 0]
  ------------------
  288|      0|        ERR_raise(ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  289|       |    return NULL;
  290|      0|}
tasn_utl.c:asn1_get_enc_ptr:
  117|  32.3M|{
  118|  32.3M|    const ASN1_AUX *aux;
  119|       |
  120|  32.3M|    if (pval == NULL || *pval == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 32.3M]
  |  Branch (120:25): [True: 0, False: 32.3M]
  ------------------
  121|      0|        return NULL;
  122|  32.3M|    aux = it->funcs;
  123|  32.3M|    if (aux == NULL || (aux->flags & ASN1_AFLG_ENCODING) == 0)
  ------------------
  |  |  723|  2.77M|#define ASN1_AFLG_ENCODING 2
  ------------------
  |  Branch (123:9): [True: 29.6M, False: 2.77M]
  |  Branch (123:24): [True: 1.53M, False: 1.23M]
  ------------------
  124|  31.1M|        return NULL;
  125|  1.23M|    return offset2ptr(*pval, aux->enc_offset);
  ------------------
  |  |   23|  1.23M|#define offset2ptr(addr, offset) (void *)(((char *)addr) + offset)
  ------------------
  126|  32.3M|}
tasn_utl.c:asn1_get_const_enc_ptr:
  130|  11.6M|{
  131|  11.6M|    const ASN1_AUX *aux;
  132|       |
  133|  11.6M|    if (pval == NULL || *pval == NULL)
  ------------------
  |  Branch (133:9): [True: 0, False: 11.6M]
  |  Branch (133:25): [True: 0, False: 11.6M]
  ------------------
  134|      0|        return NULL;
  135|  11.6M|    aux = it->funcs;
  136|  11.6M|    if (aux == NULL || (aux->flags & ASN1_AFLG_ENCODING) == 0)
  ------------------
  |  |  723|  1.69M|#define ASN1_AFLG_ENCODING 2
  ------------------
  |  Branch (136:9): [True: 9.97M, False: 1.69M]
  |  Branch (136:24): [True: 676k, False: 1.01M]
  ------------------
  137|  10.6M|        return NULL;
  138|  1.01M|    return offset2ptr(*pval, aux->enc_offset);
  ------------------
  |  |   23|  1.01M|#define offset2ptr(addr, offset) (void *)(((char *)addr) + offset)
  ------------------
  139|  11.6M|}

X509_ALGOR_get0:
   73|   937k|{
   74|   937k|    if (paobj)
  ------------------
  |  Branch (74:9): [True: 711k, False: 225k]
  ------------------
   75|   711k|        *paobj = algor->algorithm;
   76|   937k|    if (pptype) {
  ------------------
  |  Branch (76:9): [True: 525k, False: 412k]
  ------------------
   77|   525k|        if (algor->parameter == NULL) {
  ------------------
  |  Branch (77:13): [True: 0, False: 525k]
  ------------------
   78|      0|            *pptype = V_ASN1_UNDEF;
  ------------------
  |  |   62|      0|#define V_ASN1_UNDEF -1
  ------------------
   79|      0|            return;
   80|      0|        } else
   81|   525k|            *pptype = algor->parameter->type;
   82|   525k|        if (ppval)
  ------------------
  |  Branch (82:13): [True: 525k, False: 0]
  ------------------
   83|   525k|            *ppval = algor->parameter->value.ptr;
   84|   525k|    }
   85|   937k|}

BIGNUM_it:
   57|   598k|ASN1_ITEM_start(BIGNUM)
  ------------------
  |  |   97|   598k|    {                                  \
  |  |   98|   598k|        static const ASN1_ITEM local_it = {
  ------------------
   58|   598k|    ASN1_ITYPE_PRIMITIVE,
  ------------------
  |  |   82|   598k|#define ASN1_ITYPE_PRIMITIVE 0x0
  ------------------
   59|   598k|    V_ASN1_INTEGER, NULL, 0, &bignum_pf, 0, "BIGNUM" ASN1_ITEM_end(BIGNUM)
  ------------------
  |  |   66|   598k|#define V_ASN1_INTEGER 2
  ------------------
                  V_ASN1_INTEGER, NULL, 0, &bignum_pf, 0, "BIGNUM" ASN1_ITEM_end(BIGNUM)
  ------------------
  |  |  104|   598k|    }                         \
  |  |  105|   598k|    ;                         \
  |  |  106|   598k|    return &local_it;         \
  |  |  107|   598k|    }
  ------------------
x_bignum.c:bn_new:
   65|   598k|{
   66|   598k|    *pval = (ASN1_VALUE *)BN_new();
   67|   598k|    if (*pval != NULL)
  ------------------
  |  Branch (67:9): [True: 598k, False: 0]
  ------------------
   68|   598k|        return 1;
   69|      0|    else
   70|      0|        return 0;
   71|   598k|}
x_bignum.c:bn_c2i:
  116|   598k|{
  117|   598k|    BIGNUM *bn;
  118|       |
  119|   598k|    if (*pval == NULL && !bn_new(pval, it))
  ------------------
  |  Branch (119:9): [True: 598k, False: 0]
  |  Branch (119:26): [True: 0, False: 598k]
  ------------------
  120|      0|        return 0;
  121|   598k|    bn = (BIGNUM *)*pval;
  122|   598k|    if (!BN_bin2bn(cont, len, bn)) {
  ------------------
  |  Branch (122:9): [True: 0, False: 598k]
  ------------------
  123|      0|        bn_free(pval, it);
  124|      0|        return 0;
  125|      0|    }
  126|   598k|    return 1;
  127|   598k|}

X509_INFO_new:
   17|   412k|{
   18|   412k|    X509_INFO *ret;
   19|       |
   20|   412k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|   412k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   21|   412k|    if (ret == NULL)
  ------------------
  |  Branch (21:9): [True: 0, False: 412k]
  ------------------
   22|      0|        return NULL;
   23|       |
   24|   412k|    return ret;
   25|   412k|}
X509_INFO_free:
   28|   415k|{
   29|   415k|    if (x == NULL)
  ------------------
  |  Branch (29:9): [True: 2.82k, False: 412k]
  ------------------
   30|  2.82k|        return;
   31|       |
   32|   412k|    X509_free(x->x509);
   33|   412k|    X509_CRL_free(x->crl);
   34|   412k|    X509_PKEY_free(x->x_pkey);
   35|   412k|    OPENSSL_free(x->enc_data);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   36|   412k|    OPENSSL_free(x);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   37|   412k|}

X509_PKEY_free:
   36|   412k|{
   37|   412k|    if (x == NULL)
  ------------------
  |  Branch (37:9): [True: 412k, False: 0]
  ------------------
   38|   412k|        return;
   39|       |
   40|      0|    X509_ALGOR_free(x->enc_algor);
   41|      0|    ASN1_OCTET_STRING_free(x->enc_pkey);
   42|      0|    EVP_PKEY_free(x->dec_pkey);
   43|      0|    if (x->key_free)
  ------------------
  |  Branch (43:9): [True: 0, False: 0]
  ------------------
   44|      0|        OPENSSL_free(x->key_data);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   45|      0|    OPENSSL_free(x);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   46|      0|}

ossl_encode_der_length:
   40|   339k|{
   41|   339k|    if (cont_len > 0xffff)
  ------------------
  |  Branch (41:9): [True: 0, False: 339k]
  ------------------
   42|      0|        return 0; /* Too large for supported length encodings */
   43|       |
   44|   339k|    if (cont_len > 0xff) {
  ------------------
  |  Branch (44:9): [True: 0, False: 339k]
  ------------------
   45|      0|        if (!WPACKET_put_bytes_u8(pkt, 0x82)
  ------------------
  |  |  889|      0|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (45:13): [True: 0, False: 0]
  ------------------
   46|      0|            || !WPACKET_put_bytes_u16(pkt, cont_len))
  ------------------
  |  |  891|      0|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (46:16): [True: 0, False: 0]
  ------------------
   47|      0|            return 0;
   48|   339k|    } else {
   49|   339k|        if (cont_len > 0x7f
  ------------------
  |  Branch (49:13): [True: 116, False: 339k]
  ------------------
   50|    116|            && !WPACKET_put_bytes_u8(pkt, 0x81))
  ------------------
  |  |  889|    116|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (50:16): [True: 0, False: 116]
  ------------------
   51|      0|            return 0;
   52|   339k|        if (!WPACKET_put_bytes_u8(pkt, cont_len))
  ------------------
  |  |  889|   339k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (52:13): [True: 0, False: 339k]
  ------------------
   53|      0|            return 0;
   54|   339k|    }
   55|       |
   56|   339k|    return 1;
   57|   339k|}
ossl_encode_der_integer:
   67|   226k|{
   68|   226k|    unsigned char *bnbytes;
   69|   226k|    size_t cont_len;
   70|       |
   71|   226k|    if (BN_is_negative(n))
  ------------------
  |  Branch (71:9): [True: 0, False: 226k]
  ------------------
   72|      0|        return 0;
   73|       |
   74|       |    /*
   75|       |     * Calculate the ASN.1 INTEGER DER content length for n.
   76|       |     * This is the number of whole bytes required to represent n (i.e. rounded
   77|       |     * down), plus one.
   78|       |     * If n is zero then the content is a single zero byte (length = 1).
   79|       |     * If the number of bits of n is a multiple of 8 then an extra zero padding
   80|       |     * byte is included to ensure that the value is still treated as positive
   81|       |     * in the INTEGER two's complement representation.
   82|       |     */
   83|   226k|    cont_len = BN_num_bits(n) / 8 + 1;
   84|       |
   85|   226k|    if (!WPACKET_start_sub_packet(pkt)
  ------------------
  |  Branch (85:9): [True: 0, False: 226k]
  ------------------
   86|   226k|        || !WPACKET_put_bytes_u8(pkt, ID_INTEGER)
  ------------------
  |  |  889|   452k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (86:12): [True: 0, False: 226k]
  ------------------
   87|   226k|        || !ossl_encode_der_length(pkt, cont_len)
  ------------------
  |  Branch (87:12): [True: 0, False: 226k]
  ------------------
   88|   226k|        || !WPACKET_allocate_bytes(pkt, cont_len, &bnbytes)
  ------------------
  |  Branch (88:12): [True: 0, False: 226k]
  ------------------
   89|   226k|        || !WPACKET_close(pkt))
  ------------------
  |  Branch (89:12): [True: 0, False: 226k]
  ------------------
   90|      0|        return 0;
   91|       |
   92|   226k|    if (bnbytes != NULL
  ------------------
  |  Branch (92:9): [True: 0, False: 226k]
  ------------------
   93|      0|        && BN_bn2binpad(n, bnbytes, (int)cont_len) != (int)cont_len)
  ------------------
  |  Branch (93:12): [True: 0, False: 0]
  ------------------
   94|      0|        return 0;
   95|       |
   96|   226k|    return 1;
   97|   226k|}
ossl_encode_der_dsa_sig:
  107|   113k|{
  108|   113k|    WPACKET tmppkt, *dummypkt;
  109|   113k|    size_t cont_len;
  110|   113k|    int isnull = WPACKET_is_null_buf(pkt);
  111|       |
  112|   113k|    if (!WPACKET_start_sub_packet(pkt))
  ------------------
  |  Branch (112:9): [True: 0, False: 113k]
  ------------------
  113|      0|        return 0;
  114|       |
  115|   113k|    if (!isnull) {
  ------------------
  |  Branch (115:9): [True: 0, False: 113k]
  ------------------
  116|      0|        if (!WPACKET_init_null(&tmppkt, 0))
  ------------------
  |  Branch (116:13): [True: 0, False: 0]
  ------------------
  117|      0|            return 0;
  118|      0|        dummypkt = &tmppkt;
  119|   113k|    } else {
  120|       |        /* If the input packet has a NULL buffer, we don't need a dummy packet */
  121|   113k|        dummypkt = pkt;
  122|   113k|    }
  123|       |
  124|       |    /* Calculate the content length */
  125|   113k|    if (!ossl_encode_der_integer(dummypkt, r)
  ------------------
  |  Branch (125:9): [True: 0, False: 113k]
  ------------------
  126|   113k|        || !ossl_encode_der_integer(dummypkt, s)
  ------------------
  |  Branch (126:12): [True: 0, False: 113k]
  ------------------
  127|   113k|        || !WPACKET_get_length(dummypkt, &cont_len)
  ------------------
  |  Branch (127:12): [True: 0, False: 113k]
  ------------------
  128|   113k|        || (!isnull && !WPACKET_finish(dummypkt))) {
  ------------------
  |  Branch (128:13): [True: 0, False: 113k]
  |  Branch (128:24): [True: 0, False: 0]
  ------------------
  129|      0|        if (!isnull)
  ------------------
  |  Branch (129:13): [True: 0, False: 0]
  ------------------
  130|      0|            WPACKET_cleanup(dummypkt);
  131|      0|        return 0;
  132|      0|    }
  133|       |
  134|       |    /* Add the tag and length bytes */
  135|   113k|    if (!WPACKET_put_bytes_u8(pkt, ID_SEQUENCE)
  ------------------
  |  |  889|   226k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (135:9): [True: 0, False: 113k]
  ------------------
  136|   113k|        || !ossl_encode_der_length(pkt, cont_len)
  ------------------
  |  Branch (136:12): [True: 0, False: 113k]
  ------------------
  137|       |        /*
  138|       |         * Really encode the integers. We already wrote to the main pkt
  139|       |         * if it had a NULL buffer, so don't do it again
  140|       |         */
  141|   113k|        || (!isnull && !ossl_encode_der_integer(pkt, r))
  ------------------
  |  Branch (141:13): [True: 0, False: 113k]
  |  Branch (141:24): [True: 0, False: 0]
  ------------------
  142|   113k|        || (!isnull && !ossl_encode_der_integer(pkt, s))
  ------------------
  |  Branch (142:13): [True: 0, False: 113k]
  |  Branch (142:24): [True: 0, False: 0]
  ------------------
  143|   113k|        || !WPACKET_close(pkt))
  ------------------
  |  Branch (143:12): [True: 0, False: 113k]
  ------------------
  144|      0|        return 0;
  145|       |
  146|   113k|    return 1;
  147|   113k|}

ossl_err_load_ASYNC_strings:
   31|      1|{
   32|      1|#ifndef OPENSSL_NO_ERR
   33|      1|    if (ERR_reason_error_string(ASYNC_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (33:9): [True: 1, False: 0]
  ------------------
   34|      1|        ERR_load_strings_const(ASYNC_str_reasons);
   35|      1|#endif
   36|      1|    return 1;
   37|      1|}

ASYNC_WAIT_CTX_free:
   21|  1.77k|{
   22|  1.77k|    struct fd_lookup_st *curr;
   23|  1.77k|    struct fd_lookup_st *next;
   24|       |
   25|  1.77k|    if (ctx == NULL)
  ------------------
  |  Branch (25:9): [True: 1.77k, False: 0]
  ------------------
   26|  1.77k|        return;
   27|       |
   28|      0|    curr = ctx->fds;
   29|      0|    while (curr != NULL) {
  ------------------
  |  Branch (29:12): [True: 0, False: 0]
  ------------------
   30|      0|        if (!curr->del) {
  ------------------
  |  Branch (30:13): [True: 0, False: 0]
  ------------------
   31|       |            /* Only try and cleanup if it hasn't been marked deleted */
   32|      0|            if (curr->cleanup != NULL)
  ------------------
  |  Branch (32:17): [True: 0, False: 0]
  ------------------
   33|      0|                curr->cleanup(ctx, curr->key, curr->fd, curr->custom_data);
   34|      0|        }
   35|       |        /* Always free the fd_lookup_st */
   36|      0|        next = curr->next;
   37|      0|        OPENSSL_free(curr);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   38|      0|        curr = next;
   39|      0|    }
   40|       |
   41|      0|    OPENSSL_free(ctx);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   42|      0|}

BIO_f_buffer:
   41|  1.77k|{
   42|  1.77k|    return &methods_buffer;
   43|  1.77k|}
bf_buff.c:buffer_write:
  159|  3.25k|{
  160|  3.25k|    int i, num = 0;
  161|  3.25k|    BIO_F_BUFFER_CTX *ctx;
  162|       |
  163|  3.25k|    if ((in == NULL) || (inl <= 0))
  ------------------
  |  Branch (163:9): [True: 0, False: 3.25k]
  |  Branch (163:25): [True: 0, False: 3.25k]
  ------------------
  164|      0|        return 0;
  165|  3.25k|    ctx = (BIO_F_BUFFER_CTX *)b->ptr;
  166|  3.25k|    if ((ctx == NULL) || (b->next_bio == NULL))
  ------------------
  |  Branch (166:9): [True: 0, False: 3.25k]
  |  Branch (166:26): [True: 0, False: 3.25k]
  ------------------
  167|      0|        return 0;
  168|       |
  169|  3.25k|    BIO_clear_retry_flags(b);
  ------------------
  |  |  263|  3.25k|    BIO_clear_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  225|  3.25k|#define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|  3.25k|#define BIO_FLAGS_READ 0x01
  |  |  |  |  ------------------
  |  |  |  |               #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  223|  3.25k|#define BIO_FLAGS_WRITE 0x02
  |  |  |  |  ------------------
  |  |  |  |               #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  224|  3.25k|#define BIO_FLAGS_IO_SPECIAL 0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   BIO_clear_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  226|  3.25k|#define BIO_FLAGS_SHOULD_RETRY 0x08
  |  |  ------------------
  ------------------
  170|  3.25k|start:
  171|  3.25k|    i = ctx->obuf_size - (ctx->obuf_len + ctx->obuf_off);
  172|       |    /* add to buffer and return */
  173|  3.25k|    if (i >= inl) {
  ------------------
  |  Branch (173:9): [True: 3.25k, False: 0]
  ------------------
  174|  3.25k|        memcpy(&(ctx->obuf[ctx->obuf_off + ctx->obuf_len]), in, inl);
  175|  3.25k|        ctx->obuf_len += inl;
  176|  3.25k|        return (num + inl);
  177|  3.25k|    }
  178|       |    /* else */
  179|       |    /* stuff already in buffer, so add to it first, then flush */
  180|      0|    if (ctx->obuf_len != 0) {
  ------------------
  |  Branch (180:9): [True: 0, False: 0]
  ------------------
  181|      0|        if (i > 0) { /* lets fill it up if we can */
  ------------------
  |  Branch (181:13): [True: 0, False: 0]
  ------------------
  182|      0|            memcpy(&(ctx->obuf[ctx->obuf_off + ctx->obuf_len]), in, i);
  183|      0|            in += i;
  184|      0|            inl -= i;
  185|      0|            num += i;
  186|      0|            ctx->obuf_len += i;
  187|      0|        }
  188|       |        /* we now have a full buffer needing flushing */
  189|      0|        for (;;) {
  190|      0|            i = BIO_write(b->next_bio, &(ctx->obuf[ctx->obuf_off]),
  191|      0|                ctx->obuf_len);
  192|      0|            if (i <= 0) {
  ------------------
  |  Branch (192:17): [True: 0, False: 0]
  ------------------
  193|      0|                BIO_copy_next_retry(b);
  194|       |
  195|      0|                if (i < 0)
  ------------------
  |  Branch (195:21): [True: 0, False: 0]
  ------------------
  196|      0|                    return ((num > 0) ? num : i);
  ------------------
  |  Branch (196:29): [True: 0, False: 0]
  ------------------
  197|      0|                if (i == 0)
  ------------------
  |  Branch (197:21): [True: 0, False: 0]
  ------------------
  198|      0|                    return num;
  199|      0|            }
  200|      0|            ctx->obuf_off += i;
  201|      0|            ctx->obuf_len -= i;
  202|      0|            if (ctx->obuf_len == 0)
  ------------------
  |  Branch (202:17): [True: 0, False: 0]
  ------------------
  203|      0|                break;
  204|      0|        }
  205|      0|    }
  206|       |    /*
  207|       |     * we only get here if the buffer has been flushed and we still have
  208|       |     * stuff to write
  209|       |     */
  210|      0|    ctx->obuf_off = 0;
  211|       |
  212|       |    /* we now have inl bytes to write */
  213|      0|    while (inl >= ctx->obuf_size) {
  ------------------
  |  Branch (213:12): [True: 0, False: 0]
  ------------------
  214|      0|        i = BIO_write(b->next_bio, in, inl);
  215|      0|        if (i <= 0) {
  ------------------
  |  Branch (215:13): [True: 0, False: 0]
  ------------------
  216|      0|            BIO_copy_next_retry(b);
  217|      0|            if (i < 0)
  ------------------
  |  Branch (217:17): [True: 0, False: 0]
  ------------------
  218|      0|                return ((num > 0) ? num : i);
  ------------------
  |  Branch (218:25): [True: 0, False: 0]
  ------------------
  219|      0|            if (i == 0)
  ------------------
  |  Branch (219:17): [True: 0, False: 0]
  ------------------
  220|      0|                return num;
  221|      0|        }
  222|      0|        num += i;
  223|      0|        in += i;
  224|      0|        inl -= i;
  225|      0|        if (inl == 0)
  ------------------
  |  Branch (225:13): [True: 0, False: 0]
  ------------------
  226|      0|            return num;
  227|      0|    }
  228|       |
  229|       |    /*
  230|       |     * copy the rest into the buffer since we have only a small amount left
  231|       |     */
  232|      0|    goto start;
  233|      0|}
bf_buff.c:buffer_ctrl:
  236|  8.56k|{
  237|  8.56k|    BIO *dbio;
  238|  8.56k|    BIO_F_BUFFER_CTX *ctx;
  239|  8.56k|    long ret = 1;
  240|  8.56k|    char *p1, *p2;
  241|  8.56k|    int r, i, *ip;
  242|  8.56k|    int ibs, obs;
  243|       |
  244|  8.56k|    ctx = (BIO_F_BUFFER_CTX *)b->ptr;
  245|       |
  246|  8.56k|    switch (cmd) {
  247|      0|    case BIO_CTRL_RESET:
  ------------------
  |  |   90|      0|#define BIO_CTRL_RESET 1 /* opt - rewind/zero etc */
  ------------------
  |  Branch (247:5): [True: 0, False: 8.56k]
  ------------------
  248|      0|        ctx->ibuf_off = 0;
  249|      0|        ctx->ibuf_len = 0;
  250|      0|        ctx->obuf_off = 0;
  251|      0|        ctx->obuf_len = 0;
  252|      0|        if (b->next_bio == NULL)
  ------------------
  |  Branch (252:13): [True: 0, False: 0]
  ------------------
  253|      0|            return 0;
  254|      0|        ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
  255|      0|        break;
  256|      0|    case BIO_CTRL_EOF:
  ------------------
  |  |   91|      0|#define BIO_CTRL_EOF 2 /* opt - are we at the eof */
  ------------------
  |  Branch (256:5): [True: 0, False: 8.56k]
  ------------------
  257|      0|        if (ctx->ibuf_len > 0)
  ------------------
  |  Branch (257:13): [True: 0, False: 0]
  ------------------
  258|      0|            return 0;
  259|      0|        ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
  260|      0|        break;
  261|      0|    case BIO_CTRL_INFO:
  ------------------
  |  |   92|      0|#define BIO_CTRL_INFO 3 /* opt - extra tit-bits */
  ------------------
  |  Branch (261:5): [True: 0, False: 8.56k]
  ------------------
  262|      0|        ret = (long)ctx->obuf_len;
  263|      0|        break;
  264|      0|    case BIO_C_GET_BUFF_NUM_LINES:
  ------------------
  |  |  450|      0|#define BIO_C_GET_BUFF_NUM_LINES 116
  ------------------
  |  Branch (264:5): [True: 0, False: 8.56k]
  ------------------
  265|      0|        ret = 0;
  266|      0|        p1 = ctx->ibuf;
  267|      0|        for (i = 0; i < ctx->ibuf_len; i++) {
  ------------------
  |  Branch (267:21): [True: 0, False: 0]
  ------------------
  268|      0|            if (p1[ctx->ibuf_off + i] == '\n')
  ------------------
  |  Branch (268:17): [True: 0, False: 0]
  ------------------
  269|      0|                ret++;
  270|      0|        }
  271|      0|        break;
  272|      0|    case BIO_CTRL_WPENDING:
  ------------------
  |  |  102|      0|#define BIO_CTRL_WPENDING 13 /* opt - number of bytes still to write */
  ------------------
  |  Branch (272:5): [True: 0, False: 8.56k]
  ------------------
  273|      0|        ret = (long)ctx->obuf_len;
  274|      0|        if (ret == 0) {
  ------------------
  |  Branch (274:13): [True: 0, False: 0]
  ------------------
  275|      0|            if (b->next_bio == NULL)
  ------------------
  |  Branch (275:17): [True: 0, False: 0]
  ------------------
  276|      0|                return 0;
  277|      0|            ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
  278|      0|        }
  279|      0|        break;
  280|      0|    case BIO_CTRL_PENDING:
  ------------------
  |  |   99|      0|#define BIO_CTRL_PENDING 10 /* opt - is their more data buffered */
  ------------------
  |  Branch (280:5): [True: 0, False: 8.56k]
  ------------------
  281|      0|        ret = (long)ctx->ibuf_len;
  282|      0|        if (ret == 0) {
  ------------------
  |  Branch (282:13): [True: 0, False: 0]
  ------------------
  283|      0|            if (b->next_bio == NULL)
  ------------------
  |  Branch (283:17): [True: 0, False: 0]
  ------------------
  284|      0|                return 0;
  285|      0|            ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
  286|      0|        }
  287|      0|        break;
  288|      0|    case BIO_C_SET_BUFF_READ_DATA:
  ------------------
  |  |  456|      0|#define BIO_C_SET_BUFF_READ_DATA 122 /* data to read first */
  ------------------
  |  Branch (288:5): [True: 0, False: 8.56k]
  ------------------
  289|      0|        if (num > ctx->ibuf_size) {
  ------------------
  |  Branch (289:13): [True: 0, False: 0]
  ------------------
  290|      0|            if (num <= 0)
  ------------------
  |  Branch (290:17): [True: 0, False: 0]
  ------------------
  291|      0|                return 0;
  292|      0|            p1 = OPENSSL_malloc((size_t)num);
  ------------------
  |  |  106|      0|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  293|      0|            if (p1 == NULL)
  ------------------
  |  Branch (293:17): [True: 0, False: 0]
  ------------------
  294|      0|                return 0;
  295|      0|            OPENSSL_free(ctx->ibuf);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  296|      0|            ctx->ibuf = p1;
  297|      0|        }
  298|      0|        ctx->ibuf_off = 0;
  299|      0|        ctx->ibuf_len = (int)num;
  300|      0|        memcpy(ctx->ibuf, ptr, (int)num);
  301|      0|        ret = 1;
  302|      0|        break;
  303|  1.77k|    case BIO_C_SET_BUFF_SIZE:
  ------------------
  |  |  451|  1.77k|#define BIO_C_SET_BUFF_SIZE 117
  ------------------
  |  Branch (303:5): [True: 1.77k, False: 6.79k]
  ------------------
  304|  1.77k|        if (ptr != NULL) {
  ------------------
  |  Branch (304:13): [True: 1.77k, False: 0]
  ------------------
  305|  1.77k|            ip = (int *)ptr;
  306|  1.77k|            if (*ip == 0) {
  ------------------
  |  Branch (306:17): [True: 1.77k, False: 0]
  ------------------
  307|  1.77k|                ibs = (int)num;
  308|  1.77k|                obs = ctx->obuf_size;
  309|  1.77k|            } else { /* if (*ip == 1) */
  310|       |
  311|      0|                ibs = ctx->ibuf_size;
  312|      0|                obs = (int)num;
  313|      0|            }
  314|  1.77k|        } else {
  315|      0|            ibs = (int)num;
  316|      0|            obs = (int)num;
  317|      0|        }
  318|  1.77k|        p1 = ctx->ibuf;
  319|  1.77k|        p2 = ctx->obuf;
  320|  1.77k|        if ((ibs > DEFAULT_BUFFER_SIZE) && (ibs != ctx->ibuf_size)) {
  ------------------
  |  |   23|  1.77k|#define DEFAULT_BUFFER_SIZE 4096
  ------------------
  |  Branch (320:13): [True: 0, False: 1.77k]
  |  Branch (320:44): [True: 0, False: 0]
  ------------------
  321|      0|            if (num <= 0)
  ------------------
  |  Branch (321:17): [True: 0, False: 0]
  ------------------
  322|      0|                return 0;
  323|      0|            p1 = OPENSSL_malloc((size_t)num);
  ------------------
  |  |  106|      0|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  324|      0|            if (p1 == NULL)
  ------------------
  |  Branch (324:17): [True: 0, False: 0]
  ------------------
  325|      0|                return 0;
  326|      0|        }
  327|  1.77k|        if ((obs > DEFAULT_BUFFER_SIZE) && (obs != ctx->obuf_size)) {
  ------------------
  |  |   23|  1.77k|#define DEFAULT_BUFFER_SIZE 4096
  ------------------
  |  Branch (327:13): [True: 0, False: 1.77k]
  |  Branch (327:44): [True: 0, False: 0]
  ------------------
  328|      0|            p2 = OPENSSL_malloc((size_t)num);
  ------------------
  |  |  106|      0|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  329|      0|            if (p2 == NULL) {
  ------------------
  |  Branch (329:17): [True: 0, False: 0]
  ------------------
  330|      0|                if (p1 != ctx->ibuf)
  ------------------
  |  Branch (330:21): [True: 0, False: 0]
  ------------------
  331|      0|                    OPENSSL_free(p1);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  332|      0|                return 0;
  333|      0|            }
  334|      0|        }
  335|  1.77k|        if (ctx->ibuf != p1) {
  ------------------
  |  Branch (335:13): [True: 0, False: 1.77k]
  ------------------
  336|      0|            OPENSSL_free(ctx->ibuf);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  337|      0|            ctx->ibuf = p1;
  338|      0|            ctx->ibuf_off = 0;
  339|      0|            ctx->ibuf_len = 0;
  340|      0|            ctx->ibuf_size = ibs;
  341|      0|        }
  342|  1.77k|        if (ctx->obuf != p2) {
  ------------------
  |  Branch (342:13): [True: 0, False: 1.77k]
  ------------------
  343|      0|            OPENSSL_free(ctx->obuf);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  344|      0|            ctx->obuf = p2;
  345|      0|            ctx->obuf_off = 0;
  346|      0|            ctx->obuf_len = 0;
  347|      0|            ctx->obuf_size = obs;
  348|      0|        }
  349|  1.77k|        break;
  350|      0|    case BIO_C_DO_STATE_MACHINE:
  ------------------
  |  |  435|      0|#define BIO_C_DO_STATE_MACHINE 101
  ------------------
  |  Branch (350:5): [True: 0, False: 8.56k]
  ------------------
  351|      0|        if (b->next_bio == NULL)
  ------------------
  |  Branch (351:13): [True: 0, False: 0]
  ------------------
  352|      0|            return 0;
  353|      0|        BIO_clear_retry_flags(b);
  ------------------
  |  |  263|      0|    BIO_clear_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  225|      0|#define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|      0|#define BIO_FLAGS_READ 0x01
  |  |  |  |  ------------------
  |  |  |  |               #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  223|      0|#define BIO_FLAGS_WRITE 0x02
  |  |  |  |  ------------------
  |  |  |  |               #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  224|      0|#define BIO_FLAGS_IO_SPECIAL 0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   BIO_clear_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  226|      0|#define BIO_FLAGS_SHOULD_RETRY 0x08
  |  |  ------------------
  ------------------
  354|      0|        ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
  355|      0|        BIO_copy_next_retry(b);
  356|      0|        break;
  357|       |
  358|  3.25k|    case BIO_CTRL_FLUSH:
  ------------------
  |  |  100|  3.25k|#define BIO_CTRL_FLUSH 11 /* opt - 'flush' buffered output */
  ------------------
  |  Branch (358:5): [True: 3.25k, False: 5.31k]
  ------------------
  359|  3.25k|        if (b->next_bio == NULL)
  ------------------
  |  Branch (359:13): [True: 0, False: 3.25k]
  ------------------
  360|      0|            return 0;
  361|  3.25k|        if (ctx->obuf_len <= 0) {
  ------------------
  |  Branch (361:13): [True: 0, False: 3.25k]
  ------------------
  362|      0|            ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
  363|      0|            BIO_copy_next_retry(b);
  364|      0|            break;
  365|      0|        }
  366|       |
  367|  6.51k|        for (;;) {
  368|  6.51k|            BIO_clear_retry_flags(b);
  ------------------
  |  |  263|  6.51k|    BIO_clear_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  225|  6.51k|#define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|  6.51k|#define BIO_FLAGS_READ 0x01
  |  |  |  |  ------------------
  |  |  |  |               #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  223|  6.51k|#define BIO_FLAGS_WRITE 0x02
  |  |  |  |  ------------------
  |  |  |  |               #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  224|  6.51k|#define BIO_FLAGS_IO_SPECIAL 0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   BIO_clear_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  226|  6.51k|#define BIO_FLAGS_SHOULD_RETRY 0x08
  |  |  ------------------
  ------------------
  369|  6.51k|            if (ctx->obuf_len > 0) {
  ------------------
  |  Branch (369:17): [True: 3.25k, False: 3.25k]
  ------------------
  370|  3.25k|                r = BIO_write(b->next_bio,
  371|  3.25k|                    &(ctx->obuf[ctx->obuf_off]), ctx->obuf_len);
  372|  3.25k|                BIO_copy_next_retry(b);
  373|  3.25k|                if (r <= 0)
  ------------------
  |  Branch (373:21): [True: 0, False: 3.25k]
  ------------------
  374|      0|                    return (long)r;
  375|  3.25k|                ctx->obuf_off += r;
  376|  3.25k|                ctx->obuf_len -= r;
  377|  3.25k|            } else {
  378|  3.25k|                ctx->obuf_len = 0;
  379|  3.25k|                ctx->obuf_off = 0;
  380|  3.25k|                break;
  381|  3.25k|            }
  382|  6.51k|        }
  383|  3.25k|        ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
  384|  3.25k|        BIO_copy_next_retry(b);
  385|  3.25k|        break;
  386|      0|    case BIO_CTRL_DUP:
  ------------------
  |  |  101|      0|#define BIO_CTRL_DUP 12 /* man - extra stuff for 'duped' BIO */
  ------------------
  |  Branch (386:5): [True: 0, False: 8.56k]
  ------------------
  387|      0|        dbio = (BIO *)ptr;
  388|      0|        if (BIO_set_read_buffer_size(dbio, ctx->ibuf_size) <= 0 || BIO_set_write_buffer_size(dbio, ctx->obuf_size) <= 0)
  ------------------
  |  |  625|      0|#define BIO_set_read_buffer_size(b, size) BIO_int_ctrl(b, BIO_C_SET_BUFF_SIZE, size, 0)
  |  |  ------------------
  |  |  |  |  451|      0|#define BIO_C_SET_BUFF_SIZE 117
  |  |  ------------------
  ------------------
                      if (BIO_set_read_buffer_size(dbio, ctx->ibuf_size) <= 0 || BIO_set_write_buffer_size(dbio, ctx->obuf_size) <= 0)
  ------------------
  |  |  626|      0|#define BIO_set_write_buffer_size(b, size) BIO_int_ctrl(b, BIO_C_SET_BUFF_SIZE, size, 1)
  |  |  ------------------
  |  |  |  |  451|      0|#define BIO_C_SET_BUFF_SIZE 117
  |  |  ------------------
  ------------------
  |  Branch (388:13): [True: 0, False: 0]
  |  Branch (388:68): [True: 0, False: 0]
  ------------------
  389|      0|            ret = 0;
  390|      0|        break;
  391|      0|    case BIO_CTRL_PEEK:
  ------------------
  |  |  106|      0|#define BIO_CTRL_PEEK 29 /* BIO_f_buffer special */
  ------------------
  |  Branch (391:5): [True: 0, False: 8.56k]
  ------------------
  392|       |        /* Ensure there's stuff in the input buffer */
  393|      0|        {
  394|      0|            char fake_buf[1];
  395|      0|            (void)buffer_read(b, fake_buf, 0);
  396|      0|        }
  397|      0|        if (num > ctx->ibuf_len)
  ------------------
  |  Branch (397:13): [True: 0, False: 0]
  ------------------
  398|      0|            num = ctx->ibuf_len;
  399|      0|        memcpy(ptr, &(ctx->ibuf[ctx->ibuf_off]), num);
  400|      0|        ret = num;
  401|      0|        break;
  402|  3.54k|    default:
  ------------------
  |  Branch (402:5): [True: 3.54k, False: 5.02k]
  ------------------
  403|  3.54k|        if (b->next_bio == NULL)
  ------------------
  |  Branch (403:13): [True: 0, False: 3.54k]
  ------------------
  404|      0|            return 0;
  405|  3.54k|        ret = BIO_ctrl(b->next_bio, cmd, num, ptr);
  406|  3.54k|        break;
  407|  8.56k|    }
  408|  8.56k|    return ret;
  409|  8.56k|}
bf_buff.c:buffer_new:
   46|  1.77k|{
   47|  1.77k|    BIO_F_BUFFER_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  108|  1.77k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|       |
   49|  1.77k|    if (ctx == NULL)
  ------------------
  |  Branch (49:9): [True: 0, False: 1.77k]
  ------------------
   50|      0|        return 0;
   51|  1.77k|    ctx->ibuf_size = DEFAULT_BUFFER_SIZE;
  ------------------
  |  |   23|  1.77k|#define DEFAULT_BUFFER_SIZE 4096
  ------------------
   52|  1.77k|    ctx->ibuf = OPENSSL_malloc(DEFAULT_BUFFER_SIZE);
  ------------------
  |  |  106|  1.77k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   53|  1.77k|    if (ctx->ibuf == NULL) {
  ------------------
  |  Branch (53:9): [True: 0, False: 1.77k]
  ------------------
   54|      0|        OPENSSL_free(ctx);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   55|      0|        return 0;
   56|      0|    }
   57|  1.77k|    ctx->obuf_size = DEFAULT_BUFFER_SIZE;
  ------------------
  |  |   23|  1.77k|#define DEFAULT_BUFFER_SIZE 4096
  ------------------
   58|  1.77k|    ctx->obuf = OPENSSL_malloc(DEFAULT_BUFFER_SIZE);
  ------------------
  |  |  106|  1.77k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   59|  1.77k|    if (ctx->obuf == NULL) {
  ------------------
  |  Branch (59:9): [True: 0, False: 1.77k]
  ------------------
   60|      0|        OPENSSL_free(ctx->ibuf);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|      0|        OPENSSL_free(ctx);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   62|      0|        return 0;
   63|      0|    }
   64|       |
   65|  1.77k|    bi->init = 1;
   66|  1.77k|    bi->ptr = (char *)ctx;
   67|  1.77k|    bi->flags = 0;
   68|  1.77k|    return 1;
   69|  1.77k|}
bf_buff.c:buffer_free:
   72|  1.77k|{
   73|  1.77k|    BIO_F_BUFFER_CTX *b;
   74|       |
   75|  1.77k|    if (a == NULL)
  ------------------
  |  Branch (75:9): [True: 0, False: 1.77k]
  ------------------
   76|      0|        return 0;
   77|  1.77k|    b = (BIO_F_BUFFER_CTX *)a->ptr;
   78|  1.77k|    OPENSSL_free(b->ibuf);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|  1.77k|    OPENSSL_free(b->obuf);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   80|  1.77k|    OPENSSL_free(a->ptr);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   81|       |    a->ptr = NULL;
   82|  1.77k|    a->init = 0;
   83|  1.77k|    a->flags = 0;
   84|  1.77k|    return 1;
   85|  1.77k|}

ossl_err_load_BIO_strings:
   93|      1|{
   94|      1|#ifndef OPENSSL_NO_ERR
   95|      1|    if (ERR_reason_error_string(BIO_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (95:9): [True: 1, False: 0]
  ------------------
   96|      1|        ERR_load_strings_const(BIO_str_reasons);
   97|      1|#endif
   98|      1|    return 1;
   99|      1|}

BIO_new_ex:
   82|  2.50M|{
   83|  2.50M|    BIO *bio = OPENSSL_zalloc(sizeof(*bio));
  ------------------
  |  |  108|  2.50M|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   84|       |
   85|  2.50M|    if (bio == NULL)
  ------------------
  |  Branch (85:9): [True: 0, False: 2.50M]
  ------------------
   86|      0|        return NULL;
   87|       |
   88|  2.50M|    bio->libctx = libctx;
   89|  2.50M|    bio->method = method;
   90|  2.50M|    bio->shutdown = 1;
   91|       |
   92|  2.50M|    if (!CRYPTO_NEW_REF(&bio->references, 1))
  ------------------
  |  Branch (92:9): [True: 0, False: 2.50M]
  ------------------
   93|      0|        goto err;
   94|       |
   95|  2.50M|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data))
  ------------------
  |  |  262|  2.50M|#define CRYPTO_EX_INDEX_BIO 12
  ------------------
  |  Branch (95:9): [True: 0, False: 2.50M]
  ------------------
   96|      0|        goto err;
   97|       |
   98|  2.50M|    if (method->create != NULL && !method->create(bio)) {
  ------------------
  |  Branch (98:9): [True: 2.50M, False: 0]
  |  Branch (98:35): [True: 0, False: 2.50M]
  ------------------
   99|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_INIT_FAIL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  100|      0|        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data);
  ------------------
  |  |  262|      0|#define CRYPTO_EX_INDEX_BIO 12
  ------------------
  101|      0|        goto err;
  102|      0|    }
  103|  2.50M|    if (method->create == NULL)
  ------------------
  |  Branch (103:9): [True: 0, False: 2.50M]
  ------------------
  104|      0|        bio->init = 1;
  105|       |
  106|  2.50M|    return bio;
  107|       |
  108|      0|err:
  109|      0|    CRYPTO_FREE_REF(&bio->references);
  110|      0|    OPENSSL_free(bio);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  111|       |    return NULL;
  112|  2.50M|}
BIO_new:
  115|  2.50M|{
  116|       |    return BIO_new_ex(NULL, method);
  117|  2.50M|}
BIO_free:
  120|  4.22M|{
  121|  4.22M|    int ret;
  122|       |
  123|  4.22M|    if (a == NULL)
  ------------------
  |  Branch (123:9): [True: 886k, False: 3.34M]
  ------------------
  124|   886k|        return 0;
  125|       |
  126|  3.34M|    if (CRYPTO_DOWN_REF(&a->references, &ret) <= 0)
  ------------------
  |  Branch (126:9): [True: 0, False: 3.34M]
  ------------------
  127|      0|        return 0;
  128|       |
  129|  3.34M|    REF_PRINT_COUNT("BIO", ret, a);
  ------------------
  |  |  301|  3.34M|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  3.34M|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  297|  3.34M|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  285|  3.34M|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  130|  3.34M|    if (ret > 0)
  ------------------
  |  Branch (130:9): [True: 842k, False: 2.50M]
  ------------------
  131|   842k|        return 1;
  132|  2.50M|    REF_ASSERT_ISNT(ret < 0);
  ------------------
  |  |  293|  2.50M|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 2.50M]
  |  |  ------------------
  ------------------
  133|       |
  134|  2.50M|    if (HAS_CALLBACK(a)) {
  ------------------
  |  |   26|  2.50M|#define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:26): [True: 0, False: 2.50M]
  |  |  |  Branch (26:51): [True: 0, False: 2.50M]
  |  |  ------------------
  ------------------
  135|      0|        ret = (int)bio_call_callback(a, BIO_CB_FREE, NULL, 0, 0, 0L, 1L, NULL);
  ------------------
  |  |  291|      0|#define BIO_CB_FREE 0x01
  ------------------
  136|      0|        if (ret <= 0)
  ------------------
  |  Branch (136:13): [True: 0, False: 0]
  ------------------
  137|      0|            return 0;
  138|      0|    }
  139|       |
  140|  2.50M|    if ((a->method != NULL) && (a->method->destroy != NULL))
  ------------------
  |  Branch (140:9): [True: 2.50M, False: 0]
  |  Branch (140:32): [True: 2.50M, False: 0]
  ------------------
  141|  2.50M|        a->method->destroy(a);
  142|       |
  143|  2.50M|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);
  ------------------
  |  |  262|  2.50M|#define CRYPTO_EX_INDEX_BIO 12
  ------------------
  144|       |
  145|  2.50M|    CRYPTO_FREE_REF(&a->references);
  146|       |
  147|  2.50M|    OPENSSL_free(a);
  ------------------
  |  |  131|  2.50M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  148|       |
  149|  2.50M|    return 1;
  150|  2.50M|}
BIO_set_data:
  153|   828k|{
  154|   828k|    a->ptr = ptr;
  155|   828k|}
BIO_get_data:
  158|  2.48M|{
  159|  2.48M|    return a->ptr;
  160|  2.48M|}
BIO_set_init:
  163|  1.65M|{
  164|  1.65M|    a->init = init;
  165|  1.65M|}
BIO_set_shutdown:
  173|  1.77k|{
  174|  1.77k|    a->shutdown = shut;
  175|  1.77k|}
BIO_up_ref:
  188|   842k|{
  189|   842k|    int i;
  190|       |
  191|   842k|    if (CRYPTO_UP_REF(&a->references, &i) <= 0)
  ------------------
  |  Branch (191:9): [True: 0, False: 842k]
  ------------------
  192|      0|        return 0;
  193|       |
  194|   842k|    REF_PRINT_COUNT("BIO", i, a);
  ------------------
  |  |  301|   842k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|   842k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  297|   842k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  285|   842k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|   842k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|   842k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 842k]
  |  |  ------------------
  ------------------
  196|   842k|    return i > 1;
  197|   842k|}
BIO_clear_flags:
  200|  11.4M|{
  201|  11.4M|    b->flags &= ~flags;
  202|  11.4M|}
BIO_test_flags:
  205|  8.41k|{
  206|  8.41k|    return (b->flags & flags);
  207|  8.41k|}
BIO_set_flags:
  210|  6.83k|{
  211|  6.83k|    b->flags |= flags;
  212|  6.83k|}
BIO_read:
  302|  2.06M|{
  303|  2.06M|    size_t readbytes;
  304|  2.06M|    int ret;
  305|       |
  306|  2.06M|    if (dlen < 0)
  ------------------
  |  Branch (306:9): [True: 0, False: 2.06M]
  ------------------
  307|      0|        return 0;
  308|       |
  309|  2.06M|    ret = bio_read_intern(b, data, (size_t)dlen, &readbytes);
  310|       |
  311|  2.06M|    if (ret > 0) {
  ------------------
  |  Branch (311:9): [True: 2.06M, False: 1.58k]
  ------------------
  312|       |        /* *readbytes should always be <= dlen */
  313|  2.06M|        ret = (int)readbytes;
  314|  2.06M|    }
  315|       |
  316|  2.06M|    return ret;
  317|  2.06M|}
BIO_read_ex:
  320|  1.64M|{
  321|  1.64M|    return bio_read_intern(b, data, dlen, readbytes) > 0;
  322|  1.64M|}
BIO_write:
  367|  8.30k|{
  368|  8.30k|    size_t written;
  369|  8.30k|    int ret;
  370|       |
  371|  8.30k|    if (dlen <= 0)
  ------------------
  |  Branch (371:9): [True: 0, False: 8.30k]
  ------------------
  372|      0|        return 0;
  373|       |
  374|  8.30k|    ret = bio_write_intern(b, data, (size_t)dlen, &written);
  375|       |
  376|  8.30k|    if (ret > 0) {
  ------------------
  |  Branch (376:9): [True: 8.30k, False: 0]
  ------------------
  377|       |        /* written should always be <= dlen */
  378|  8.30k|        ret = (int)written;
  379|  8.30k|    }
  380|       |
  381|  8.30k|    return ret;
  382|  8.30k|}
BIO_write_ex:
  385|     25|{
  386|     25|    return bio_write_intern(b, data, dlen, written) > 0
  ------------------
  |  Branch (386:12): [True: 25, False: 0]
  ------------------
  387|      0|        || (b != NULL && dlen == 0); /* order is important for *written */
  ------------------
  |  Branch (387:13): [True: 0, False: 0]
  |  Branch (387:26): [True: 0, False: 0]
  ------------------
  388|     25|}
BIO_puts:
  495|  9.37M|{
  496|  9.37M|    int ret;
  497|  9.37M|    size_t written = 0;
  498|       |
  499|  9.37M|    if (b == NULL) {
  ------------------
  |  Branch (499:9): [True: 0, False: 9.37M]
  ------------------
  500|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  501|      0|        return -1;
  502|      0|    }
  503|  9.37M|    if (b->method == NULL || b->method->bputs == NULL) {
  ------------------
  |  Branch (503:9): [True: 0, False: 9.37M]
  |  Branch (503:30): [True: 0, False: 9.37M]
  ------------------
  504|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  505|      0|        return -2;
  506|      0|    }
  507|       |
  508|  9.37M|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|  9.37M|#define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:26): [True: 0, False: 9.37M]
  |  |  |  Branch (26:51): [True: 0, False: 9.37M]
  |  |  ------------------
  ------------------
  509|      0|        ret = (int)bio_call_callback(b, BIO_CB_PUTS, buf, 0, 0, 0L, 1L, NULL);
  ------------------
  |  |  294|      0|#define BIO_CB_PUTS 0x04
  ------------------
  510|      0|        if (ret <= 0)
  ------------------
  |  Branch (510:13): [True: 0, False: 0]
  ------------------
  511|      0|            return ret;
  512|      0|    }
  513|       |
  514|  9.37M|    if (!b->init) {
  ------------------
  |  Branch (514:9): [True: 0, False: 9.37M]
  ------------------
  515|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  516|      0|        return -1;
  517|      0|    }
  518|       |
  519|  9.37M|    ret = b->method->bputs(b, buf);
  520|       |
  521|  9.37M|    if (ret > 0) {
  ------------------
  |  Branch (521:9): [True: 9.37M, False: 0]
  ------------------
  522|  9.37M|        b->num_write += (uint64_t)ret;
  523|  9.37M|        written = ret;
  524|  9.37M|        ret = 1;
  525|  9.37M|    }
  526|       |
  527|  9.37M|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|  9.37M|#define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:26): [True: 0, False: 9.37M]
  |  |  |  Branch (26:51): [True: 0, False: 9.37M]
  |  |  ------------------
  ------------------
  528|      0|        ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, buf, 0, 0,
  ------------------
  |  |  294|      0|#define BIO_CB_PUTS 0x04
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, buf, 0, 0,
  ------------------
  |  |  304|      0|#define BIO_CB_RETURN 0x80
  ------------------
  529|      0|            0L, ret, &written);
  530|       |
  531|  9.37M|    if (ret > 0) {
  ------------------
  |  Branch (531:9): [True: 9.37M, False: 0]
  ------------------
  532|  9.37M|        if (written > INT_MAX) {
  ------------------
  |  Branch (532:13): [True: 0, False: 9.37M]
  ------------------
  533|      0|            ERR_raise(ERR_LIB_BIO, BIO_R_LENGTH_TOO_LONG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  534|      0|            ret = -1;
  535|  9.37M|        } else {
  536|  9.37M|            ret = (int)written;
  537|  9.37M|        }
  538|  9.37M|    }
  539|       |
  540|  9.37M|    return ret;
  541|  9.37M|}
BIO_gets:
  544|  10.1M|{
  545|  10.1M|    int ret;
  546|  10.1M|    size_t readbytes = 0;
  547|       |
  548|  10.1M|    if (b == NULL) {
  ------------------
  |  Branch (548:9): [True: 0, False: 10.1M]
  ------------------
  549|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  550|      0|        return -1;
  551|      0|    }
  552|  10.1M|    if (b->method == NULL || b->method->bgets == NULL) {
  ------------------
  |  Branch (552:9): [True: 0, False: 10.1M]
  |  Branch (552:30): [True: 0, False: 10.1M]
  ------------------
  553|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  554|      0|        return -2;
  555|      0|    }
  556|       |
  557|  10.1M|    if (size < 0) {
  ------------------
  |  Branch (557:9): [True: 0, False: 10.1M]
  ------------------
  558|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  559|      0|        return -1;
  560|      0|    }
  561|       |
  562|  10.1M|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|  10.1M|#define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:26): [True: 0, False: 10.1M]
  |  |  |  Branch (26:51): [True: 0, False: 10.1M]
  |  |  ------------------
  ------------------
  563|      0|        ret = (int)bio_call_callback(b, BIO_CB_GETS, buf, size, 0, 0L, 1, NULL);
  ------------------
  |  |  295|      0|#define BIO_CB_GETS 0x05
  ------------------
  564|      0|        if (ret <= 0)
  ------------------
  |  Branch (564:13): [True: 0, False: 0]
  ------------------
  565|      0|            return ret;
  566|      0|    }
  567|       |
  568|  10.1M|    if (!b->init) {
  ------------------
  |  Branch (568:9): [True: 0, False: 10.1M]
  ------------------
  569|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  570|      0|        return -1;
  571|      0|    }
  572|       |
  573|  10.1M|    ret = b->method->bgets(b, buf, size);
  574|       |
  575|  10.1M|    if (ret > 0) {
  ------------------
  |  Branch (575:9): [True: 10.1M, False: 5.26k]
  ------------------
  576|  10.1M|        readbytes = ret;
  577|  10.1M|        ret = 1;
  578|  10.1M|    }
  579|       |
  580|  10.1M|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|  10.1M|#define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:26): [True: 0, False: 10.1M]
  |  |  |  Branch (26:51): [True: 0, False: 10.1M]
  |  |  ------------------
  ------------------
  581|      0|        ret = (int)bio_call_callback(b, BIO_CB_GETS | BIO_CB_RETURN, buf, size,
  ------------------
  |  |  295|      0|#define BIO_CB_GETS 0x05
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_GETS | BIO_CB_RETURN, buf, size,
  ------------------
  |  |  304|      0|#define BIO_CB_RETURN 0x80
  ------------------
  582|      0|            0, 0L, ret, &readbytes);
  583|       |
  584|  10.1M|    if (ret > 0) {
  ------------------
  |  Branch (584:9): [True: 10.1M, False: 5.26k]
  ------------------
  585|       |        /* Shouldn't happen */
  586|  10.1M|        if (readbytes > (size_t)size)
  ------------------
  |  Branch (586:13): [True: 0, False: 10.1M]
  ------------------
  587|      0|            ret = -1;
  588|  10.1M|        else
  589|  10.1M|            ret = (int)readbytes;
  590|  10.1M|    }
  591|       |
  592|  10.1M|    return ret;
  593|  10.1M|}
BIO_int_ctrl:
  639|  1.77k|{
  640|  1.77k|    int i;
  641|       |
  642|  1.77k|    i = iarg;
  643|  1.77k|    return BIO_ctrl(b, cmd, larg, (char *)&i);
  644|  1.77k|}
BIO_ctrl:
  657|  4.14M|{
  658|  4.14M|    long ret;
  659|       |
  660|  4.14M|    if (b == NULL)
  ------------------
  |  Branch (660:9): [True: 0, False: 4.14M]
  ------------------
  661|      0|        return -1;
  662|  4.14M|    if (b->method == NULL || b->method->ctrl == NULL) {
  ------------------
  |  Branch (662:9): [True: 0, False: 4.14M]
  |  Branch (662:30): [True: 0, False: 4.14M]
  ------------------
  663|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  664|      0|        return -2;
  665|      0|    }
  666|       |
  667|  4.14M|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|  4.14M|#define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:26): [True: 0, False: 4.14M]
  |  |  |  Branch (26:51): [True: 0, False: 4.14M]
  |  |  ------------------
  ------------------
  668|      0|        ret = bio_call_callback(b, BIO_CB_CTRL, parg, 0, cmd, larg, 1L, NULL);
  ------------------
  |  |  296|      0|#define BIO_CB_CTRL 0x06
  ------------------
  669|      0|        if (ret <= 0)
  ------------------
  |  Branch (669:13): [True: 0, False: 0]
  ------------------
  670|      0|            return ret;
  671|      0|    }
  672|       |
  673|  4.14M|    ret = b->method->ctrl(b, cmd, larg, parg);
  674|       |
  675|  4.14M|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|  4.14M|#define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:26): [True: 0, False: 4.14M]
  |  |  |  Branch (26:51): [True: 0, False: 4.14M]
  |  |  ------------------
  ------------------
  676|      0|        ret = bio_call_callback(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, 0, cmd,
  ------------------
  |  |  296|      0|#define BIO_CB_CTRL 0x06
  ------------------
                      ret = bio_call_callback(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, 0, cmd,
  ------------------
  |  |  304|      0|#define BIO_CB_RETURN 0x80
  ------------------
  677|      0|            larg, ret, NULL);
  678|       |
  679|  4.14M|    return ret;
  680|  4.14M|}
BIO_push:
  743|  1.77k|{
  744|  1.77k|    BIO *lb;
  745|       |
  746|  1.77k|    if (b == NULL)
  ------------------
  |  Branch (746:9): [True: 0, False: 1.77k]
  ------------------
  747|      0|        return bio;
  748|  1.77k|    lb = b;
  749|  1.77k|    while (lb->next_bio != NULL)
  ------------------
  |  Branch (749:12): [True: 0, False: 1.77k]
  ------------------
  750|      0|        lb = lb->next_bio;
  751|  1.77k|    lb->next_bio = bio;
  752|  1.77k|    if (bio != NULL)
  ------------------
  |  Branch (752:9): [True: 1.77k, False: 0]
  ------------------
  753|  1.77k|        bio->prev_bio = lb;
  754|       |    /* called to do internal processing */
  755|  1.77k|    BIO_ctrl(b, BIO_CTRL_PUSH, 0, lb);
  ------------------
  |  |   95|  1.77k|#define BIO_CTRL_PUSH 6 /* opt - internal, used to signify change */
  ------------------
  756|  1.77k|    return b;
  757|  1.77k|}
BIO_pop:
  761|  1.77k|{
  762|  1.77k|    BIO *ret;
  763|       |
  764|  1.77k|    if (b == NULL)
  ------------------
  |  Branch (764:9): [True: 0, False: 1.77k]
  ------------------
  765|      0|        return NULL;
  766|  1.77k|    ret = b->next_bio;
  767|       |
  768|  1.77k|    BIO_ctrl(b, BIO_CTRL_POP, 0, b);
  ------------------
  |  |   96|  1.77k|#define BIO_CTRL_POP 7 /* opt - internal, used to signify change */
  ------------------
  769|       |
  770|  1.77k|    if (b->prev_bio != NULL)
  ------------------
  |  Branch (770:9): [True: 0, False: 1.77k]
  ------------------
  771|      0|        b->prev_bio->next_bio = b->next_bio;
  772|  1.77k|    if (b->next_bio != NULL)
  ------------------
  |  Branch (772:9): [True: 1.77k, False: 0]
  ------------------
  773|  1.77k|        b->next_bio->prev_bio = b->prev_bio;
  774|       |
  775|  1.77k|    b->next_bio = NULL;
  776|       |    b->prev_bio = NULL;
  777|  1.77k|    return ret;
  778|  1.77k|}
BIO_free_all:
  846|  7.08k|{
  847|  7.08k|    BIO *b;
  848|  7.08k|    int ref;
  849|       |
  850|  8.85k|    while (bio != NULL) {
  ------------------
  |  Branch (850:12): [True: 3.54k, False: 5.31k]
  ------------------
  851|  3.54k|        b = bio;
  852|  3.54k|        CRYPTO_GET_REF(&b->references, &ref);
  853|  3.54k|        bio = bio->next_bio;
  854|  3.54k|        BIO_free(b);
  855|       |        /* Since ref count > 1, don't free anyone else. */
  856|  3.54k|        if (ref > 1)
  ------------------
  |  Branch (856:13): [True: 1.77k, False: 1.77k]
  ------------------
  857|  1.77k|            break;
  858|  3.54k|    }
  859|  7.08k|}
BIO_copy_next_retry:
  908|  6.51k|{
  909|  6.51k|    BIO_set_flags(b, BIO_get_retry_flags(b->next_bio));
  ------------------
  |  |  265|  6.51k|    BIO_test_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  225|  6.51k|#define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|  6.51k|#define BIO_FLAGS_READ 0x01
  |  |  |  |  ------------------
  |  |  |  |               #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  223|  6.51k|#define BIO_FLAGS_WRITE 0x02
  |  |  |  |  ------------------
  |  |  |  |               #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  224|  6.51k|#define BIO_FLAGS_IO_SPECIAL 0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   BIO_test_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  226|  6.51k|#define BIO_FLAGS_SHOULD_RETRY 0x08
  |  |  ------------------
  ------------------
  910|  6.51k|    b->retry_reason = b->next_bio->retry_reason;
  911|  6.51k|}
bio_cleanup:
  943|      1|{
  944|      1|#ifndef OPENSSL_NO_SOCK
  945|      1|    bio_sock_cleanup_int();
  946|      1|    CRYPTO_THREAD_lock_free(bio_lookup_lock);
  947|       |    bio_lookup_lock = NULL;
  948|      1|#endif
  949|      1|    CRYPTO_FREE_REF(&bio_type_count);
  950|      1|}
bio_lib.c:bio_read_intern:
  263|  3.71M|{
  264|  3.71M|    int ret;
  265|       |
  266|  3.71M|    if (b == NULL) {
  ------------------
  |  Branch (266:9): [True: 0, False: 3.71M]
  ------------------
  267|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  268|      0|        return -1;
  269|      0|    }
  270|  3.71M|    if (b->method == NULL || b->method->bread == NULL) {
  ------------------
  |  Branch (270:9): [True: 0, False: 3.71M]
  |  Branch (270:30): [True: 0, False: 3.71M]
  ------------------
  271|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|        return -2;
  273|      0|    }
  274|       |
  275|  3.71M|    if (HAS_CALLBACK(b) && ((ret = (int)bio_call_callback(b, BIO_CB_READ, data, dlen, 0, 0L, 1L, NULL)) <= 0))
  ------------------
  |  |   26|  7.42M|#define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:26): [True: 0, False: 3.71M]
  |  |  |  Branch (26:51): [True: 0, False: 3.71M]
  |  |  ------------------
  ------------------
                  if (HAS_CALLBACK(b) && ((ret = (int)bio_call_callback(b, BIO_CB_READ, data, dlen, 0, 0L, 1L, NULL)) <= 0))
  ------------------
  |  |  292|      0|#define BIO_CB_READ 0x02
  ------------------
  |  Branch (275:28): [True: 0, False: 0]
  ------------------
  276|      0|        return ret;
  277|       |
  278|  3.71M|    if (!b->init) {
  ------------------
  |  Branch (278:9): [True: 0, False: 3.71M]
  ------------------
  279|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  280|      0|        return -1;
  281|      0|    }
  282|       |
  283|  3.71M|    ret = b->method->bread(b, data, dlen, readbytes);
  284|       |
  285|  3.71M|    if (ret > 0)
  ------------------
  |  Branch (285:9): [True: 3.71M, False: 1.58k]
  ------------------
  286|  3.71M|        b->num_read += (uint64_t)*readbytes;
  287|       |
  288|  3.71M|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|  3.71M|#define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:26): [True: 0, False: 3.71M]
  |  |  |  Branch (26:51): [True: 0, False: 3.71M]
  |  |  ------------------
  ------------------
  289|      0|        ret = (int)bio_call_callback(b, BIO_CB_READ | BIO_CB_RETURN, data,
  ------------------
  |  |  292|      0|#define BIO_CB_READ 0x02
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_READ | BIO_CB_RETURN, data,
  ------------------
  |  |  304|      0|#define BIO_CB_RETURN 0x80
  ------------------
  290|      0|            dlen, 0, 0L, ret, readbytes);
  291|       |
  292|       |    /* Shouldn't happen */
  293|  3.71M|    if (ret > 0 && *readbytes > dlen) {
  ------------------
  |  Branch (293:9): [True: 3.71M, False: 1.58k]
  |  Branch (293:20): [True: 0, False: 3.71M]
  ------------------
  294|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  295|      0|        return -1;
  296|      0|    }
  297|       |
  298|  3.71M|    return ret;
  299|  3.71M|}
bio_lib.c:bio_write_intern:
  326|  8.32k|{
  327|  8.32k|    size_t local_written;
  328|  8.32k|    int ret;
  329|       |
  330|  8.32k|    if (written != NULL)
  ------------------
  |  Branch (330:9): [True: 8.32k, False: 0]
  ------------------
  331|  8.32k|        *written = 0;
  332|       |    /*
  333|       |     * b == NULL is not an error but just means that zero bytes are written.
  334|       |     * Do not raise an error here.
  335|       |     */
  336|  8.32k|    if (b == NULL)
  ------------------
  |  Branch (336:9): [True: 0, False: 8.32k]
  ------------------
  337|      0|        return 0;
  338|       |
  339|  8.32k|    if (b->method == NULL || b->method->bwrite == NULL) {
  ------------------
  |  Branch (339:9): [True: 0, False: 8.32k]
  |  Branch (339:30): [True: 0, False: 8.32k]
  ------------------
  340|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  341|      0|        return -2;
  342|      0|    }
  343|       |
  344|  8.32k|    if (HAS_CALLBACK(b) && ((ret = (int)bio_call_callback(b, BIO_CB_WRITE, data, dlen, 0, 0L, 1L, NULL)) <= 0))
  ------------------
  |  |   26|  16.6k|#define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:26): [True: 0, False: 8.32k]
  |  |  |  Branch (26:51): [True: 0, False: 8.32k]
  |  |  ------------------
  ------------------
                  if (HAS_CALLBACK(b) && ((ret = (int)bio_call_callback(b, BIO_CB_WRITE, data, dlen, 0, 0L, 1L, NULL)) <= 0))
  ------------------
  |  |  293|      0|#define BIO_CB_WRITE 0x03
  ------------------
  |  Branch (344:28): [True: 0, False: 0]
  ------------------
  345|      0|        return ret;
  346|       |
  347|  8.32k|    if (!b->init) {
  ------------------
  |  Branch (347:9): [True: 0, False: 8.32k]
  ------------------
  348|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  349|      0|        return -1;
  350|      0|    }
  351|       |
  352|  8.32k|    ret = b->method->bwrite(b, data, dlen, &local_written);
  353|       |
  354|  8.32k|    if (ret > 0)
  ------------------
  |  Branch (354:9): [True: 8.32k, False: 0]
  ------------------
  355|  8.32k|        b->num_write += (uint64_t)local_written;
  356|       |
  357|  8.32k|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|  8.32k|#define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:26): [True: 0, False: 8.32k]
  |  |  |  Branch (26:51): [True: 0, False: 8.32k]
  |  |  ------------------
  ------------------
  358|      0|        ret = (int)bio_call_callback(b, BIO_CB_WRITE | BIO_CB_RETURN, data,
  ------------------
  |  |  293|      0|#define BIO_CB_WRITE 0x03
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_WRITE | BIO_CB_RETURN, data,
  ------------------
  |  |  304|      0|#define BIO_CB_RETURN 0x80
  ------------------
  359|      0|            dlen, 0, 0L, ret, &local_written);
  360|       |
  361|  8.32k|    if (written != NULL)
  ------------------
  |  Branch (361:9): [True: 8.32k, False: 0]
  ------------------
  362|  8.32k|        *written = local_written;
  363|  8.32k|    return ret;
  364|  8.32k|}

BIO_meth_new:
   38|  3.18k|{
   39|  3.18k|    BIO_METHOD *biom = OPENSSL_zalloc(sizeof(BIO_METHOD));
  ------------------
  |  |  108|  3.18k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|       |
   41|  3.18k|    if (biom == NULL
  ------------------
  |  Branch (41:9): [True: 0, False: 3.18k]
  ------------------
   42|  3.18k|        || (biom->name = OPENSSL_strdup(name)) == NULL) {
  ------------------
  |  |  135|  3.18k|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (42:12): [True: 0, False: 3.18k]
  ------------------
   43|      0|        OPENSSL_free(biom);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   44|      0|        return NULL;
   45|      0|    }
   46|  3.18k|    biom->type = type;
   47|  3.18k|    return biom;
   48|  3.18k|}
BIO_meth_free:
   51|  3.18k|{
   52|  3.18k|    if (biom != NULL) {
  ------------------
  |  Branch (52:9): [True: 3.18k, False: 0]
  ------------------
   53|  3.18k|        OPENSSL_free(biom->name);
  ------------------
  |  |  131|  3.18k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   54|  3.18k|        OPENSSL_free(biom);
  ------------------
  |  |  131|  3.18k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   55|  3.18k|    }
   56|  3.18k|}
bwrite_conv:
   73|  8.32k|{
   74|  8.32k|    int ret;
   75|       |
   76|  8.32k|    if (datal > INT_MAX)
  ------------------
  |  Branch (76:9): [True: 0, False: 8.32k]
  ------------------
   77|      0|        datal = INT_MAX;
   78|       |
   79|  8.32k|    ret = bio->method->bwrite_old(bio, data, (int)datal);
   80|       |
   81|  8.32k|    if (ret <= 0) {
  ------------------
  |  Branch (81:9): [True: 0, False: 8.32k]
  ------------------
   82|      0|        *written = 0;
   83|      0|        return ret;
   84|      0|    }
   85|       |
   86|  8.32k|    *written = (size_t)ret;
   87|       |
   88|  8.32k|    return 1;
   89|  8.32k|}
BIO_meth_set_write:
   93|  1.77k|{
   94|  1.77k|    biom->bwrite_old = bwrite;
   95|  1.77k|    biom->bwrite = bwrite_conv;
   96|  1.77k|    return 1;
   97|  1.77k|}
BIO_meth_set_write_ex:
  101|  1.41k|{
  102|       |    biom->bwrite_old = NULL;
  103|  1.41k|    biom->bwrite = bwrite;
  104|  1.41k|    return 1;
  105|  1.41k|}
bread_conv:
  121|  2.06M|{
  122|  2.06M|    int ret;
  123|       |
  124|  2.06M|    if (datal > INT_MAX)
  ------------------
  |  Branch (124:9): [True: 0, False: 2.06M]
  ------------------
  125|      0|        datal = INT_MAX;
  126|       |
  127|  2.06M|    ret = bio->method->bread_old(bio, data, (int)datal);
  128|       |
  129|  2.06M|    if (ret <= 0) {
  ------------------
  |  Branch (129:9): [True: 1.58k, False: 2.06M]
  ------------------
  130|  1.58k|        *readbytes = 0;
  131|  1.58k|        return ret;
  132|  1.58k|    }
  133|       |
  134|  2.06M|    *readbytes = (size_t)ret;
  135|       |
  136|  2.06M|    return 1;
  137|  2.06M|}
BIO_meth_set_read:
  141|  1.77k|{
  142|  1.77k|    biom->bread_old = bread;
  143|  1.77k|    biom->bread = bread_conv;
  144|  1.77k|    return 1;
  145|  1.77k|}
BIO_meth_set_read_ex:
  149|  1.41k|{
  150|       |    biom->bread_old = NULL;
  151|  1.41k|    biom->bread = bread;
  152|  1.41k|    return 1;
  153|  1.41k|}
BIO_meth_set_puts:
  164|  1.41k|{
  165|  1.41k|    biom->bputs = bputs;
  166|  1.41k|    return 1;
  167|  1.41k|}
BIO_meth_set_gets:
  178|  1.41k|{
  179|  1.41k|    biom->bgets = bgets;
  180|  1.41k|    return 1;
  181|  1.41k|}
BIO_meth_set_ctrl:
  192|  3.18k|{
  193|  3.18k|    biom->ctrl = ctrl;
  194|  3.18k|    return 1;
  195|  3.18k|}
BIO_meth_set_create:
  205|  3.18k|{
  206|  3.18k|    biom->create = create;
  207|  3.18k|    return 1;
  208|  3.18k|}
BIO_meth_set_destroy:
  218|  3.18k|{
  219|  3.18k|    biom->destroy = destroy;
  220|  3.18k|    return 1;
  221|  3.18k|}

BIO_snprintf:
 1094|   876k|{
 1095|   876k|    va_list args;
 1096|   876k|    int ret;
 1097|       |
 1098|   876k|    va_start(args, format);
 1099|       |
 1100|   876k|    ret = BIO_vsnprintf(buf, n, format, args);
 1101|       |
 1102|       |    va_end(args);
 1103|   876k|    return ret;
 1104|   876k|}
BIO_vsnprintf:
 1107|   957k|{
 1108|   957k|    size_t retlen;
 1109|   957k|    int truncated;
 1110|       |
 1111|   957k|    if (!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args))
  ------------------
  |  Branch (1111:9): [True: 0, False: 957k]
  ------------------
 1112|      0|        return -1;
 1113|       |
 1114|   957k|    if (truncated)
  ------------------
  |  Branch (1114:9): [True: 1.38k, False: 956k]
  ------------------
 1115|       |        /*
 1116|       |         * In case of truncation, return -1 like traditional snprintf.
 1117|       |         * (Current drafts for ISO/IEC 9899 say snprintf should return the
 1118|       |         * number of characters that would have been written, had the buffer
 1119|       |         * been large enough.)
 1120|       |         */
 1121|  1.38k|        return -1;
 1122|   956k|    return (retlen <= INT_MAX) ? (int)retlen : -1;
  ------------------
  |  Branch (1122:12): [True: 956k, False: 0]
  ------------------
 1123|   957k|}
bio_print.c:_dopr:
  104|   957k|{
  105|   957k|    char ch;
  106|   957k|    int64_t value;
  107|   957k|#ifndef OPENSSL_SYS_UEFI
  108|   957k|    LDOUBLE fvalue;
  ------------------
  |  |   28|   957k|#define LDOUBLE double
  ------------------
  109|   957k|#endif
  110|   957k|    char *strvalue;
  111|   957k|    int min;
  112|   957k|    int max;
  113|   957k|    int state;
  114|   957k|    int flags;
  115|   957k|    int cflags;
  116|   957k|    struct pr_desc desc = { *sbuffer, buffer, 0, *maxlen, 0 };
  117|   957k|    int ret = 0;
  118|       |
  119|   957k|    state = DP_S_DEFAULT;
  ------------------
  |  |   56|   957k|#define DP_S_DEFAULT 0
  ------------------
  120|   957k|    flags = cflags = min = 0;
  121|   957k|    max = -1;
  122|   957k|    ch = *format++;
  123|       |
  124|  11.3M|    while (state != DP_S_DONE) {
  ------------------
  |  |   63|  11.3M|#define DP_S_DONE 7
  ------------------
  |  Branch (124:12): [True: 10.3M, False: 957k]
  ------------------
  125|  10.3M|        if (ch == '\0')
  ------------------
  |  Branch (125:13): [True: 957k, False: 9.43M]
  ------------------
  126|   957k|            state = DP_S_DONE;
  ------------------
  |  |   63|   957k|#define DP_S_DONE 7
  ------------------
  127|       |
  128|  10.3M|        switch (state) {
  129|  3.89M|        case DP_S_DEFAULT:
  ------------------
  |  |   56|  3.89M|#define DP_S_DEFAULT 0
  ------------------
  |  Branch (129:9): [True: 3.89M, False: 6.50M]
  ------------------
  130|  3.89M|            if (ch == '%')
  ------------------
  |  Branch (130:17): [True: 1.10M, False: 2.78M]
  ------------------
  131|  1.10M|                state = DP_S_FLAGS;
  ------------------
  |  |   57|  1.10M|#define DP_S_FLAGS 1
  ------------------
  132|  2.78M|            else if (!doapr_outch(&desc, ch))
  ------------------
  |  Branch (132:22): [True: 0, False: 2.78M]
  ------------------
  133|      0|                goto out;
  134|  3.89M|            ch = *format++;
  135|  3.89M|            break;
  136|  1.10M|        case DP_S_FLAGS:
  ------------------
  |  |   57|  1.10M|#define DP_S_FLAGS 1
  ------------------
  |  Branch (136:9): [True: 1.10M, False: 9.28M]
  ------------------
  137|  1.10M|            switch (ch) {
  138|      0|            case '-':
  ------------------
  |  Branch (138:13): [True: 0, False: 1.10M]
  ------------------
  139|      0|                flags |= DP_F_MINUS;
  ------------------
  |  |   67|      0|#define DP_F_MINUS (1 << 0)
  ------------------
  140|      0|                ch = *format++;
  141|      0|                break;
  142|      0|            case '+':
  ------------------
  |  Branch (142:13): [True: 0, False: 1.10M]
  ------------------
  143|      0|                flags |= DP_F_PLUS;
  ------------------
  |  |   69|      0|#define DP_F_PLUS (1 << 1)
  ------------------
  144|      0|                ch = *format++;
  145|      0|                break;
  146|      0|            case ' ':
  ------------------
  |  Branch (146:13): [True: 0, False: 1.10M]
  ------------------
  147|      0|                flags |= DP_F_SPACE;
  ------------------
  |  |   71|      0|#define DP_F_SPACE (1 << 2)
  ------------------
  148|      0|                ch = *format++;
  149|      0|                break;
  150|      0|            case '#':
  ------------------
  |  Branch (150:13): [True: 0, False: 1.10M]
  ------------------
  151|      0|                flags |= DP_F_NUM;
  ------------------
  |  |   73|      0|#define DP_F_NUM (1 << 3)
  ------------------
  152|      0|                ch = *format++;
  153|      0|                break;
  154|    643|            case '0':
  ------------------
  |  Branch (154:13): [True: 643, False: 1.10M]
  ------------------
  155|    643|                flags |= DP_F_ZERO;
  ------------------
  |  |   75|    643|#define DP_F_ZERO (1 << 4)
  ------------------
  156|    643|                ch = *format++;
  157|    643|                break;
  158|  1.10M|            default:
  ------------------
  |  Branch (158:13): [True: 1.10M, False: 643]
  ------------------
  159|  1.10M|                state = DP_S_MIN;
  ------------------
  |  |   58|  1.10M|#define DP_S_MIN 2
  ------------------
  160|  1.10M|                break;
  161|  1.10M|            }
  162|  1.10M|            break;
  163|  1.10M|        case DP_S_MIN: /* width */
  ------------------
  |  |   58|  1.10M|#define DP_S_MIN 2
  ------------------
  |  Branch (163:9): [True: 1.10M, False: 9.28M]
  ------------------
  164|  1.10M|            if (ossl_isdigit(ch)) {
  ------------------
  |  Branch (164:17): [True: 643, False: 1.10M]
  ------------------
  165|       |                /*
  166|       |                 * Most implementations cap the possible explicitly specified
  167|       |                 * width by (INT_MAX / 10) * 10 - 1 or so (the standard gives
  168|       |                 * no clear limit on this), we can do the same.
  169|       |                 */
  170|    643|                if (min < INT_MAX / 10)
  ------------------
  |  Branch (170:21): [True: 643, False: 0]
  ------------------
  171|    643|                    min = 10 * min + char_to_int(ch);
  ------------------
  |  |   96|    643|#define char_to_int(p) (p - '0')
  ------------------
  172|      0|                else
  173|      0|                    goto out;
  174|    643|                ch = *format++;
  175|  1.10M|            } else if (ch == '*') {
  ------------------
  |  Branch (175:24): [True: 0, False: 1.10M]
  ------------------
  176|      0|                min = va_arg(args, int);
  177|      0|                if (min < 0) {
  ------------------
  |  Branch (177:21): [True: 0, False: 0]
  ------------------
  178|      0|                    flags |= DP_F_MINUS;
  ------------------
  |  |   67|      0|#define DP_F_MINUS (1 << 0)
  ------------------
  179|      0|                    min = -min;
  180|      0|                }
  181|      0|                ch = *format++;
  182|      0|                state = DP_S_DOT;
  ------------------
  |  |   59|      0|#define DP_S_DOT 3
  ------------------
  183|      0|            } else
  184|  1.10M|                state = DP_S_DOT;
  ------------------
  |  |   59|  1.10M|#define DP_S_DOT 3
  ------------------
  185|  1.10M|            break;
  186|  1.10M|        case DP_S_DOT:
  ------------------
  |  |   59|  1.10M|#define DP_S_DOT 3
  ------------------
  |  Branch (186:9): [True: 1.10M, False: 9.28M]
  ------------------
  187|  1.10M|            if (ch == '.') {
  ------------------
  |  Branch (187:17): [True: 0, False: 1.10M]
  ------------------
  188|      0|                state = DP_S_MAX;
  ------------------
  |  |   60|      0|#define DP_S_MAX 4
  ------------------
  189|      0|                ch = *format++;
  190|      0|            } else
  191|  1.10M|                state = DP_S_MOD;
  ------------------
  |  |   61|  1.10M|#define DP_S_MOD 5
  ------------------
  192|  1.10M|            break;
  193|      0|        case DP_S_MAX: /* precision */
  ------------------
  |  |   60|      0|#define DP_S_MAX 4
  ------------------
  |  Branch (193:9): [True: 0, False: 10.3M]
  ------------------
  194|      0|            if (ossl_isdigit(ch)) {
  ------------------
  |  Branch (194:17): [True: 0, False: 0]
  ------------------
  195|      0|                if (max < 0)
  ------------------
  |  Branch (195:21): [True: 0, False: 0]
  ------------------
  196|      0|                    max = 0;
  197|       |                /*
  198|       |                 * Most implementations cap the possible explicitly specified
  199|       |                 * width by (INT_MAX / 10) * 10 - 1 or so (the standard gives
  200|       |                 * no clear limit on this), we can do the same.
  201|       |                 */
  202|      0|                if (max < INT_MAX / 10)
  ------------------
  |  Branch (202:21): [True: 0, False: 0]
  ------------------
  203|      0|                    max = 10 * max + char_to_int(ch);
  ------------------
  |  |   96|      0|#define char_to_int(p) (p - '0')
  ------------------
  204|      0|                else
  205|      0|                    goto out;
  206|      0|                ch = *format++;
  207|      0|            } else if (ch == '*') {
  ------------------
  |  Branch (207:24): [True: 0, False: 0]
  ------------------
  208|      0|                max = va_arg(args, int);
  209|      0|                ch = *format++;
  210|      0|                state = DP_S_MOD;
  ------------------
  |  |   61|      0|#define DP_S_MOD 5
  ------------------
  211|      0|            } else {
  212|      0|                if (max < 0)
  ------------------
  |  Branch (212:21): [True: 0, False: 0]
  ------------------
  213|      0|                    max = 0;
  214|      0|                state = DP_S_MOD;
  ------------------
  |  |   61|      0|#define DP_S_MOD 5
  ------------------
  215|      0|            }
  216|      0|            break;
  217|  1.10M|        case DP_S_MOD:
  ------------------
  |  |   61|  1.10M|#define DP_S_MOD 5
  ------------------
  |  Branch (217:9): [True: 1.10M, False: 9.28M]
  ------------------
  218|  1.10M|            switch (ch) {
  219|      0|            case 'h':
  ------------------
  |  Branch (219:13): [True: 0, False: 1.10M]
  ------------------
  220|      0|                if (*format == 'h') {
  ------------------
  |  Branch (220:21): [True: 0, False: 0]
  ------------------
  221|      0|                    cflags = DP_C_CHAR;
  ------------------
  |  |   82|      0|#define DP_C_CHAR 1
  ------------------
  222|      0|                    format++;
  223|      0|                } else {
  224|      0|                    cflags = DP_C_SHORT;
  ------------------
  |  |   83|      0|#define DP_C_SHORT 2
  ------------------
  225|      0|                }
  226|      0|                ch = *format++;
  227|      0|                break;
  228|   873k|            case 'l':
  ------------------
  |  Branch (228:13): [True: 873k, False: 235k]
  ------------------
  229|   873k|                if (*format == 'l') {
  ------------------
  |  Branch (229:21): [True: 0, False: 873k]
  ------------------
  230|      0|                    cflags = DP_C_LLONG;
  ------------------
  |  |   86|      0|#define DP_C_LLONG 5
  ------------------
  231|      0|                    format++;
  232|      0|                } else
  233|   873k|                    cflags = DP_C_LONG;
  ------------------
  |  |   84|   873k|#define DP_C_LONG 3
  ------------------
  234|   873k|                ch = *format++;
  235|   873k|                break;
  236|      0|            case 'q':
  ------------------
  |  Branch (236:13): [True: 0, False: 1.10M]
  ------------------
  237|      0|            case 'j':
  ------------------
  |  Branch (237:13): [True: 0, False: 1.10M]
  ------------------
  238|      0|                cflags = DP_C_LLONG;
  ------------------
  |  |   86|      0|#define DP_C_LLONG 5
  ------------------
  239|      0|                ch = *format++;
  240|      0|                break;
  241|      0|            case 'L':
  ------------------
  |  Branch (241:13): [True: 0, False: 1.10M]
  ------------------
  242|      0|                cflags = DP_C_LDOUBLE;
  ------------------
  |  |   85|      0|#define DP_C_LDOUBLE 4
  ------------------
  243|      0|                ch = *format++;
  244|      0|                break;
  245|      0|            case 'z':
  ------------------
  |  Branch (245:13): [True: 0, False: 1.10M]
  ------------------
  246|      0|                cflags = DP_C_SIZE;
  ------------------
  |  |   87|      0|#define DP_C_SIZE 6
  ------------------
  247|      0|                ch = *format++;
  248|      0|                break;
  249|      0|            case 't':
  ------------------
  |  Branch (249:13): [True: 0, False: 1.10M]
  ------------------
  250|      0|                cflags = DP_C_PTRDIFF;
  ------------------
  |  |   88|      0|#define DP_C_PTRDIFF 7
  ------------------
  251|      0|                ch = *format++;
  252|      0|                break;
  253|   235k|            default:
  ------------------
  |  Branch (253:13): [True: 235k, False: 873k]
  ------------------
  254|   235k|                break;
  255|  1.10M|            }
  256|  1.10M|            state = DP_S_CONV;
  ------------------
  |  |   62|  1.10M|#define DP_S_CONV 6
  ------------------
  257|  1.10M|            break;
  258|  1.10M|        case DP_S_CONV:
  ------------------
  |  |   62|  1.10M|#define DP_S_CONV 6
  ------------------
  |  Branch (258:9): [True: 1.10M, False: 9.28M]
  ------------------
  259|  1.10M|            switch (ch) {
  260|  48.3k|            case 'd':
  ------------------
  |  Branch (260:13): [True: 48.3k, False: 1.06M]
  ------------------
  261|  48.3k|            case 'i':
  ------------------
  |  Branch (261:13): [True: 0, False: 1.10M]
  ------------------
  262|  48.3k|                switch (cflags) {
  263|      0|                case DP_C_CHAR:
  ------------------
  |  |   82|      0|#define DP_C_CHAR 1
  ------------------
  |  Branch (263:17): [True: 0, False: 48.3k]
  ------------------
  264|      0|                    value = (signed char)va_arg(args, int);
  265|      0|                    break;
  266|      0|                case DP_C_SHORT:
  ------------------
  |  |   83|      0|#define DP_C_SHORT 2
  ------------------
  |  Branch (266:17): [True: 0, False: 48.3k]
  ------------------
  267|      0|                    value = (short int)va_arg(args, int);
  268|      0|                    break;
  269|      0|                case DP_C_LONG:
  ------------------
  |  |   84|      0|#define DP_C_LONG 3
  ------------------
  |  Branch (269:17): [True: 0, False: 48.3k]
  ------------------
  270|      0|                    value = va_arg(args, long int);
  271|      0|                    break;
  272|      0|                case DP_C_LLONG:
  ------------------
  |  |   86|      0|#define DP_C_LLONG 5
  ------------------
  |  Branch (272:17): [True: 0, False: 48.3k]
  ------------------
  273|      0|                    value = va_arg(args, int64_t);
  274|      0|                    break;
  275|      0|                case DP_C_SIZE:
  ------------------
  |  |   87|      0|#define DP_C_SIZE 6
  ------------------
  |  Branch (275:17): [True: 0, False: 48.3k]
  ------------------
  276|      0|                    value = va_arg(args, ossl_ssize_t);
  277|      0|                    break;
  278|      0|                case DP_C_PTRDIFF:
  ------------------
  |  |   88|      0|#define DP_C_PTRDIFF 7
  ------------------
  |  Branch (278:17): [True: 0, False: 48.3k]
  ------------------
  279|      0|                    value = va_arg(args, ptrdiff_t);
  280|      0|                    break;
  281|  48.3k|                default:
  ------------------
  |  Branch (281:17): [True: 48.3k, False: 0]
  ------------------
  282|  48.3k|                    value = va_arg(args, int);
  283|  48.3k|                    break;
  284|  48.3k|                }
  285|  48.3k|                if (!fmtint(&desc, value, 10, min, max, flags))
  ------------------
  |  Branch (285:21): [True: 0, False: 48.3k]
  ------------------
  286|      0|                    goto out;
  287|  48.3k|                break;
  288|  48.3k|            case 'X':
  ------------------
  |  Branch (288:13): [True: 643, False: 1.10M]
  ------------------
  289|    643|                flags |= DP_F_UP;
  ------------------
  |  |   77|    643|#define DP_F_UP (1 << 5)
  ------------------
  290|       |                /* FALLTHROUGH */
  291|    643|            case 'x':
  ------------------
  |  Branch (291:13): [True: 0, False: 1.10M]
  ------------------
  292|    643|            case 'o':
  ------------------
  |  Branch (292:13): [True: 0, False: 1.10M]
  ------------------
  293|   873k|            case 'u':
  ------------------
  |  Branch (293:13): [True: 872k, False: 236k]
  ------------------
  294|   873k|                flags |= DP_F_UNSIGNED;
  ------------------
  |  |   79|   873k|#define DP_F_UNSIGNED (1 << 6)
  ------------------
  295|   873k|                switch (cflags) {
  296|      0|                case DP_C_CHAR:
  ------------------
  |  |   82|      0|#define DP_C_CHAR 1
  ------------------
  |  Branch (296:17): [True: 0, False: 873k]
  ------------------
  297|      0|                    value = (unsigned char)va_arg(args, unsigned int);
  298|      0|                    break;
  299|      0|                case DP_C_SHORT:
  ------------------
  |  |   83|      0|#define DP_C_SHORT 2
  ------------------
  |  Branch (299:17): [True: 0, False: 873k]
  ------------------
  300|      0|                    value = (unsigned short int)va_arg(args, unsigned int);
  301|      0|                    break;
  302|   873k|                case DP_C_LONG:
  ------------------
  |  |   84|   873k|#define DP_C_LONG 3
  ------------------
  |  Branch (302:17): [True: 873k, False: 0]
  ------------------
  303|   873k|                    value = va_arg(args, unsigned long int);
  304|   873k|                    break;
  305|      0|                case DP_C_LLONG:
  ------------------
  |  |   86|      0|#define DP_C_LLONG 5
  ------------------
  |  Branch (305:17): [True: 0, False: 873k]
  ------------------
  306|      0|                    value = va_arg(args, uint64_t);
  307|      0|                    break;
  308|      0|                case DP_C_SIZE:
  ------------------
  |  |   87|      0|#define DP_C_SIZE 6
  ------------------
  |  Branch (308:17): [True: 0, False: 873k]
  ------------------
  309|      0|                    value = va_arg(args, size_t);
  310|      0|                    break;
  311|      0|                case DP_C_PTRDIFF:
  ------------------
  |  |   88|      0|#define DP_C_PTRDIFF 7
  ------------------
  |  Branch (311:17): [True: 0, False: 873k]
  ------------------
  312|       |                    /*
  313|       |                     * There is no unsigned variant of ptrdiff_t, and POSIX
  314|       |                     * requires using a "corresponding unsigned type argument".
  315|       |                     * Assuming it is power of two in size, at least.
  316|       |                     */
  317|      0|                    if (sizeof(ptrdiff_t) == sizeof(uint64_t))
  ------------------
  |  Branch (317:25): [True: 0, Folded]
  ------------------
  318|      0|                        value = va_arg(args, uint64_t);
  319|      0|                    else
  320|      0|                        value = va_arg(args, unsigned int);
  321|      0|                    break;
  322|      0|                default:
  ------------------
  |  Branch (322:17): [True: 0, False: 873k]
  ------------------
  323|      0|                    value = va_arg(args, unsigned int);
  324|      0|                    break;
  325|   873k|                }
  326|   873k|                if (!fmtint(&desc, value,
  ------------------
  |  Branch (326:21): [True: 0, False: 873k]
  ------------------
  327|   873k|                        ch == 'o' ? 8 : (ch == 'u' ? 10 : 16),
  ------------------
  |  Branch (327:25): [True: 0, False: 873k]
  |  Branch (327:42): [True: 872k, False: 643]
  ------------------
  328|   873k|                        min, max, flags))
  329|      0|                    goto out;
  330|   873k|                break;
  331|   873k|#ifndef OPENSSL_SYS_UEFI
  332|   873k|            case 'f':
  ------------------
  |  Branch (332:13): [True: 0, False: 1.10M]
  ------------------
  333|      0|                if (cflags == DP_C_LDOUBLE)
  ------------------
  |  |   85|      0|#define DP_C_LDOUBLE 4
  ------------------
  |  Branch (333:21): [True: 0, False: 0]
  ------------------
  334|      0|                    fvalue = va_arg(args, LDOUBLE);
  335|      0|                else
  336|      0|                    fvalue = va_arg(args, double);
  337|      0|                if (!fmtfp(&desc, fvalue, min, max, flags, F_FORMAT))
  ------------------
  |  |   91|      0|#define F_FORMAT 0
  ------------------
  |  Branch (337:21): [True: 0, False: 0]
  ------------------
  338|      0|                    goto out;
  339|      0|                break;
  340|      0|            case 'E':
  ------------------
  |  Branch (340:13): [True: 0, False: 1.10M]
  ------------------
  341|      0|                flags |= DP_F_UP;
  ------------------
  |  |   77|      0|#define DP_F_UP (1 << 5)
  ------------------
  342|       |                /* fall through */
  343|      0|            case 'e':
  ------------------
  |  Branch (343:13): [True: 0, False: 1.10M]
  ------------------
  344|      0|                if (cflags == DP_C_LDOUBLE)
  ------------------
  |  |   85|      0|#define DP_C_LDOUBLE 4
  ------------------
  |  Branch (344:21): [True: 0, False: 0]
  ------------------
  345|      0|                    fvalue = va_arg(args, LDOUBLE);
  346|      0|                else
  347|      0|                    fvalue = va_arg(args, double);
  348|      0|                if (!fmtfp(&desc, fvalue, min, max, flags, E_FORMAT))
  ------------------
  |  |   92|      0|#define E_FORMAT 1
  ------------------
  |  Branch (348:21): [True: 0, False: 0]
  ------------------
  349|      0|                    goto out;
  350|      0|                break;
  351|      0|            case 'G':
  ------------------
  |  Branch (351:13): [True: 0, False: 1.10M]
  ------------------
  352|      0|                flags |= DP_F_UP;
  ------------------
  |  |   77|      0|#define DP_F_UP (1 << 5)
  ------------------
  353|       |                /* fall through */
  354|      0|            case 'g':
  ------------------
  |  Branch (354:13): [True: 0, False: 1.10M]
  ------------------
  355|      0|                if (cflags == DP_C_LDOUBLE)
  ------------------
  |  |   85|      0|#define DP_C_LDOUBLE 4
  ------------------
  |  Branch (355:21): [True: 0, False: 0]
  ------------------
  356|      0|                    fvalue = va_arg(args, LDOUBLE);
  357|      0|                else
  358|      0|                    fvalue = va_arg(args, double);
  359|      0|                if (!fmtfp(&desc, fvalue, min, max, flags, G_FORMAT))
  ------------------
  |  |   93|      0|#define G_FORMAT 2
  ------------------
  |  Branch (359:21): [True: 0, False: 0]
  ------------------
  360|      0|                    goto out;
  361|      0|                break;
  362|       |#else
  363|       |            case 'f':
  364|       |            case 'E':
  365|       |            case 'e':
  366|       |            case 'G':
  367|       |            case 'g':
  368|       |                /* not implemented for UEFI */
  369|       |                ERR_raise(ERR_LIB_BIO, ERR_R_UNSUPPORTED);
  370|       |                goto out;
  371|       |#endif
  372|    738|            case 'c':
  ------------------
  |  Branch (372:13): [True: 738, False: 1.10M]
  ------------------
  373|    738|                if (!doapr_outch(&desc, va_arg(args, int)))
  ------------------
  |  Branch (373:21): [True: 0, False: 738]
  ------------------
  374|      0|                    goto out;
  375|    738|                break;
  376|   186k|            case 's':
  ------------------
  |  Branch (376:13): [True: 186k, False: 922k]
  ------------------
  377|   186k|                strvalue = va_arg(args, char *);
  378|   186k|                if (max < 0)
  ------------------
  |  Branch (378:21): [True: 186k, False: 0]
  ------------------
  379|   186k|                    max = INT_MAX;
  380|   186k|                if (!fmtstr(&desc, strvalue, flags, min, max))
  ------------------
  |  Branch (380:21): [True: 0, False: 186k]
  ------------------
  381|      0|                    goto out;
  382|   186k|                break;
  383|   186k|            case 'p':
  ------------------
  |  Branch (383:13): [True: 0, False: 1.10M]
  ------------------
  384|      0|                value = (size_t)va_arg(args, void *);
  385|      0|                if (!fmtint(&desc, value, 16, min, max, flags | DP_F_NUM))
  ------------------
  |  |   73|      0|#define DP_F_NUM (1 << 3)
  ------------------
  |  Branch (385:21): [True: 0, False: 0]
  ------------------
  386|      0|                    goto out;
  387|      0|                break;
  388|      0|            case 'n':
  ------------------
  |  Branch (388:13): [True: 0, False: 1.10M]
  ------------------
  389|      0|                switch (cflags) {
  390|      0|#define HANDLE_N(type)              \
  391|      0|    do {                            \
  392|      0|        type *num;                  \
  393|      0|                                    \
  394|      0|        num = va_arg(args, type *); \
  395|      0|        *num = (type)desc.pos;      \
  396|      0|    } while (0)
  397|      0|                case DP_C_CHAR:
  ------------------
  |  |   82|      0|#define DP_C_CHAR 1
  ------------------
  |  Branch (397:17): [True: 0, False: 0]
  ------------------
  398|      0|                    HANDLE_N(signed char);
  ------------------
  |  |  391|      0|    do {                            \
  |  |  392|      0|        type *num;                  \
  |  |  393|      0|                                    \
  |  |  394|      0|        num = va_arg(args, type *); \
  |  |  395|      0|        *num = (type)desc.pos;      \
  |  |  396|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (396:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  399|      0|                    break;
  400|      0|                case DP_C_SHORT:
  ------------------
  |  |   83|      0|#define DP_C_SHORT 2
  ------------------
  |  Branch (400:17): [True: 0, False: 0]
  ------------------
  401|      0|                    HANDLE_N(short);
  ------------------
  |  |  391|      0|    do {                            \
  |  |  392|      0|        type *num;                  \
  |  |  393|      0|                                    \
  |  |  394|      0|        num = va_arg(args, type *); \
  |  |  395|      0|        *num = (type)desc.pos;      \
  |  |  396|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (396:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  402|      0|                    break;
  403|      0|                case DP_C_LONG:
  ------------------
  |  |   84|      0|#define DP_C_LONG 3
  ------------------
  |  Branch (403:17): [True: 0, False: 0]
  ------------------
  404|      0|                    HANDLE_N(long);
  ------------------
  |  |  391|      0|    do {                            \
  |  |  392|      0|        type *num;                  \
  |  |  393|      0|                                    \
  |  |  394|      0|        num = va_arg(args, type *); \
  |  |  395|      0|        *num = (type)desc.pos;      \
  |  |  396|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (396:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  405|      0|                    break;
  406|      0|                case DP_C_LLONG:
  ------------------
  |  |   86|      0|#define DP_C_LLONG 5
  ------------------
  |  Branch (406:17): [True: 0, False: 0]
  ------------------
  407|      0|                    HANDLE_N(long long);
  ------------------
  |  |  391|      0|    do {                            \
  |  |  392|      0|        type *num;                  \
  |  |  393|      0|                                    \
  |  |  394|      0|        num = va_arg(args, type *); \
  |  |  395|      0|        *num = (type)desc.pos;      \
  |  |  396|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (396:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  408|      0|                    break;
  409|      0|                case DP_C_SIZE:
  ------------------
  |  |   87|      0|#define DP_C_SIZE 6
  ------------------
  |  Branch (409:17): [True: 0, False: 0]
  ------------------
  410|      0|                    HANDLE_N(ossl_ssize_t);
  ------------------
  |  |  391|      0|    do {                            \
  |  |  392|      0|        type *num;                  \
  |  |  393|      0|                                    \
  |  |  394|      0|        num = va_arg(args, type *); \
  |  |  395|      0|        *num = (type)desc.pos;      \
  |  |  396|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (396:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  411|      0|                    break;
  412|      0|                case DP_C_PTRDIFF:
  ------------------
  |  |   88|      0|#define DP_C_PTRDIFF 7
  ------------------
  |  Branch (412:17): [True: 0, False: 0]
  ------------------
  413|      0|                    HANDLE_N(ptrdiff_t);
  ------------------
  |  |  391|      0|    do {                            \
  |  |  392|      0|        type *num;                  \
  |  |  393|      0|                                    \
  |  |  394|      0|        num = va_arg(args, type *); \
  |  |  395|      0|        *num = (type)desc.pos;      \
  |  |  396|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (396:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  414|      0|                    break;
  415|      0|                default:
  ------------------
  |  Branch (415:17): [True: 0, False: 0]
  ------------------
  416|      0|                    HANDLE_N(int);
  ------------------
  |  |  391|      0|    do {                            \
  |  |  392|      0|        type *num;                  \
  |  |  393|      0|                                    \
  |  |  394|      0|        num = va_arg(args, type *); \
  |  |  395|      0|        *num = (type)desc.pos;      \
  |  |  396|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (396:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  417|      0|                    break;
  418|      0|#undef HANDLE_N
  419|      0|                }
  420|      0|                break;
  421|      0|            case '%':
  ------------------
  |  Branch (421:13): [True: 0, False: 1.10M]
  ------------------
  422|      0|                if (!doapr_outch(&desc, ch))
  ------------------
  |  Branch (422:21): [True: 0, False: 0]
  ------------------
  423|      0|                    goto out;
  424|      0|                break;
  425|      0|            case 'w':
  ------------------
  |  Branch (425:13): [True: 0, False: 1.10M]
  ------------------
  426|       |                /* not supported yet, treat as next char */
  427|      0|                format++;
  428|      0|                break;
  429|      0|            default:
  ------------------
  |  Branch (429:13): [True: 0, False: 1.10M]
  ------------------
  430|       |                /* unknown, skip */
  431|      0|                break;
  432|  1.10M|            }
  433|  1.10M|            ch = *format++;
  434|  1.10M|            state = DP_S_DEFAULT;
  ------------------
  |  |   56|  1.10M|#define DP_S_DEFAULT 0
  ------------------
  435|  1.10M|            flags = cflags = min = 0;
  436|  1.10M|            max = -1;
  437|  1.10M|            break;
  438|   957k|        case DP_S_DONE:
  ------------------
  |  |   63|   957k|#define DP_S_DONE 7
  ------------------
  |  Branch (438:9): [True: 957k, False: 9.43M]
  ------------------
  439|   957k|            break;
  440|      0|        default:
  ------------------
  |  Branch (440:9): [True: 0, False: 10.3M]
  ------------------
  441|      0|            break;
  442|  10.3M|        }
  443|  10.3M|    }
  444|   957k|    ret = 1;
  445|       |
  446|   957k|out:
  447|       |    /*
  448|       |     * We have to truncate if there is no dynamic buffer and we have filled the
  449|       |     * static buffer.
  450|       |     */
  451|   957k|    if (buffer == NULL) {
  ------------------
  |  Branch (451:9): [True: 957k, False: 0]
  ------------------
  452|   957k|        *truncated = (desc.currlen > desc.maxlen - 1);
  453|   957k|        if (*truncated)
  ------------------
  |  Branch (453:13): [True: 1.38k, False: 956k]
  ------------------
  454|  1.38k|            desc.currlen = desc.maxlen - 1;
  455|   957k|    }
  456|       |
  457|   957k|    if (!doapr_outch(&desc, '\0'))
  ------------------
  |  Branch (457:9): [True: 0, False: 957k]
  ------------------
  458|      0|        ret = 0;
  459|       |
  460|   957k|    *retlen = desc.currlen - 1;
  461|   957k|    *sbuffer = desc.sbuffer;
  462|   957k|    *maxlen = desc.maxlen;
  463|       |
  464|   957k|    return ret;
  465|   957k|}
bio_print.c:doapr_outch:
  963|  16.1M|{
  964|       |    /* If we haven't at least one buffer, someone has done a big booboo */
  965|  16.1M|    if (!ossl_assert(desc->sbuffer != NULL || desc->buffer != NULL))
  ------------------
  |  |   52|  16.1M|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  ------------------
  |  |  |  Branch (52:41): [True: 16.1M, False: 0]
  |  |  |  Branch (52:41): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|  16.1M|    __FILE__, __LINE__)
  ------------------
  |  Branch (965:9): [True: 0, False: 16.1M]
  ------------------
  966|      0|        return 0;
  967|       |
  968|       |    /* |currlen| must always be <= |*maxlen| */
  969|  16.1M|    if (!ossl_assert(desc->currlen <= desc->maxlen))
  ------------------
  |  |   52|  16.1M|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  16.1M|    __FILE__, __LINE__)
  ------------------
  |  Branch (969:9): [True: 0, False: 16.1M]
  ------------------
  970|      0|        return 0;
  971|       |
  972|  16.1M|    if (desc->buffer != NULL && desc->currlen == desc->maxlen) {
  ------------------
  |  Branch (972:9): [True: 0, False: 16.1M]
  |  Branch (972:33): [True: 0, False: 0]
  ------------------
  973|      0|        if (desc->maxlen > INT_MAX - BUFFER_INC)
  ------------------
  |  |  959|      0|#define BUFFER_INC 1024
  ------------------
  |  Branch (973:13): [True: 0, False: 0]
  ------------------
  974|      0|            return 0;
  975|       |
  976|      0|        desc->maxlen += BUFFER_INC;
  ------------------
  |  |  959|      0|#define BUFFER_INC 1024
  ------------------
  977|      0|        if (*(desc->buffer) == NULL) {
  ------------------
  |  Branch (977:13): [True: 0, False: 0]
  ------------------
  978|      0|            if ((*(desc->buffer) = OPENSSL_malloc(desc->maxlen)) == NULL)
  ------------------
  |  |  106|      0|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (978:17): [True: 0, False: 0]
  ------------------
  979|      0|                return 0;
  980|      0|            if (desc->currlen > 0) {
  ------------------
  |  Branch (980:17): [True: 0, False: 0]
  ------------------
  981|      0|                if (!ossl_assert(desc->sbuffer != NULL))
  ------------------
  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|      0|    __FILE__, __LINE__)
  ------------------
  |  Branch (981:21): [True: 0, False: 0]
  ------------------
  982|      0|                    return 0;
  983|      0|                memcpy(*(desc->buffer), desc->sbuffer, desc->currlen);
  984|      0|            }
  985|      0|            desc->sbuffer = NULL;
  986|      0|        } else {
  987|      0|            char *tmpbuf;
  988|       |
  989|      0|            tmpbuf = OPENSSL_realloc(*(desc->buffer), desc->maxlen);
  ------------------
  |  |  120|      0|    CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  990|      0|            if (tmpbuf == NULL)
  ------------------
  |  Branch (990:17): [True: 0, False: 0]
  ------------------
  991|      0|                return 0;
  992|      0|            *(desc->buffer) = tmpbuf;
  993|      0|        }
  994|      0|    }
  995|       |
  996|  16.1M|    if (desc->currlen < desc->maxlen) {
  ------------------
  |  Branch (996:9): [True: 16.1M, False: 862]
  ------------------
  997|  16.1M|        if (desc->sbuffer)
  ------------------
  |  Branch (997:13): [True: 16.1M, False: 0]
  ------------------
  998|  16.1M|            (desc->sbuffer)[(desc->currlen)++] = (char)c;
  999|      0|        else
 1000|      0|            (*(desc->buffer))[(desc->currlen)++] = (char)c;
 1001|  16.1M|    }
 1002|       |
 1003|  16.1M|    if (desc->pos < LLONG_MAX)
  ------------------
  |  Branch (1003:9): [True: 16.1M, False: 0]
  ------------------
 1004|  16.1M|        desc->pos++;
 1005|       |
 1006|  16.1M|    return 1;
 1007|  16.1M|}
bio_print.c:fmtint:
  537|   921k|{
  538|   921k|    static const char oct_prefix[] = "0";
  539|       |
  540|   921k|    int signvalue = 0;
  541|   921k|    const char *prefix = "";
  542|   921k|    uint64_t uvalue;
  543|   921k|    char convert[DECIMAL_SIZE(value) + 3];
  544|   921k|    int place = 0;
  545|   921k|    int spadlen = 0;
  546|   921k|    int zpadlen = 0;
  547|   921k|    int caps = 0;
  548|       |
  549|   921k|    if (max < 0) {
  ------------------
  |  Branch (549:9): [True: 921k, False: 0]
  ------------------
  550|       |        /* A negative precision is taken as if the precision were omitted. */
  551|   921k|        max = 1;
  552|   921k|    } else {
  553|       |        /*
  554|       |         * If a precision is given with an integer conversion,
  555|       |         * the 0 flag is ignored.
  556|       |         */
  557|      0|        flags &= ~DP_F_ZERO;
  ------------------
  |  |   75|      0|#define DP_F_ZERO (1 << 4)
  ------------------
  558|      0|    }
  559|   921k|    uvalue = value;
  560|   921k|    if (!(flags & DP_F_UNSIGNED)) {
  ------------------
  |  |   79|   921k|#define DP_F_UNSIGNED (1 << 6)
  ------------------
  |  Branch (560:9): [True: 48.3k, False: 873k]
  ------------------
  561|  48.3k|        if (value < 0) {
  ------------------
  |  Branch (561:13): [True: 0, False: 48.3k]
  ------------------
  562|      0|            signvalue = '-';
  563|      0|            uvalue = 0 - (uint64_t)value;
  564|  48.3k|        } else if (flags & DP_F_PLUS)
  ------------------
  |  |   69|  48.3k|#define DP_F_PLUS (1 << 1)
  ------------------
  |  Branch (564:20): [True: 0, False: 48.3k]
  ------------------
  565|      0|            signvalue = '+';
  566|  48.3k|        else if (flags & DP_F_SPACE)
  ------------------
  |  |   71|  48.3k|#define DP_F_SPACE (1 << 2)
  ------------------
  |  Branch (566:18): [True: 0, False: 48.3k]
  ------------------
  567|      0|            signvalue = ' ';
  568|  48.3k|    }
  569|   921k|    if (flags & DP_F_NUM) {
  ------------------
  |  |   73|   921k|#define DP_F_NUM (1 << 3)
  ------------------
  |  Branch (569:9): [True: 0, False: 921k]
  ------------------
  570|      0|        if (base == 8)
  ------------------
  |  Branch (570:13): [True: 0, False: 0]
  ------------------
  571|      0|            prefix = oct_prefix;
  572|      0|        if (value != 0) {
  ------------------
  |  Branch (572:13): [True: 0, False: 0]
  ------------------
  573|      0|            if (base == 16)
  ------------------
  |  Branch (573:17): [True: 0, False: 0]
  ------------------
  574|      0|                prefix = flags & DP_F_UP ? "0X" : "0x";
  ------------------
  |  |   77|      0|#define DP_F_UP (1 << 5)
  ------------------
  |  Branch (574:26): [True: 0, False: 0]
  ------------------
  575|      0|        }
  576|      0|    }
  577|   921k|    if (flags & DP_F_UP)
  ------------------
  |  |   77|   921k|#define DP_F_UP (1 << 5)
  ------------------
  |  Branch (577:9): [True: 643, False: 921k]
  ------------------
  578|    643|        caps = 1;
  579|       |    /* When 0 is printed with an explicit precision 0, the output is empty. */
  580|  2.56M|    while (uvalue && (place < (int)sizeof(convert))) {
  ------------------
  |  Branch (580:12): [True: 1.63M, False: 921k]
  |  Branch (580:22): [True: 1.63M, False: 0]
  ------------------
  581|  1.63M|        convert[place++] = (caps ? "0123456789ABCDEF" : "0123456789abcdef")
  ------------------
  |  Branch (581:29): [True: 4.60k, False: 1.63M]
  ------------------
  582|  1.63M|            [uvalue % (unsigned)base];
  583|  1.63M|        uvalue = (uvalue / (unsigned)base);
  584|  1.63M|    }
  585|   921k|    if (place == sizeof(convert))
  ------------------
  |  Branch (585:9): [True: 0, False: 921k]
  ------------------
  586|      0|        place--;
  587|   921k|    convert[place] = 0;
  588|       |
  589|       |    /*
  590|       |     * "#" (alternative form):
  591|       |     *   - For o conversion, it shall increase the precision, if and only
  592|       |     *     if necessary, to force the first digit of the result to be a zero
  593|       |     */
  594|   921k|    zpadlen = max - place - (prefix == oct_prefix);
  595|   921k|    if (zpadlen < 0)
  ------------------
  |  Branch (595:9): [True: 361k, False: 559k]
  ------------------
  596|   361k|        zpadlen = 0;
  597|   921k|    spadlen = min - OSSL_MAX(max, place + zpadlen + (signvalue ? 1 : 0) + (int)strlen(prefix));
  ------------------
  |  |   97|  1.84M|#define OSSL_MAX(p, q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (97:25): [True: 559k, False: 361k]
  |  |  |  Branch (97:31): [True: 0, False: 921k]
  |  |  |  Branch (97:40): [True: 0, False: 361k]
  |  |  ------------------
  ------------------
  598|   921k|    if (spadlen < 0)
  ------------------
  |  Branch (598:9): [True: 921k, False: 643]
  ------------------
  599|   921k|        spadlen = 0;
  600|   921k|    if (flags & DP_F_MINUS) {
  ------------------
  |  |   67|   921k|#define DP_F_MINUS (1 << 0)
  ------------------
  |  Branch (600:9): [True: 0, False: 921k]
  ------------------
  601|      0|        spadlen = -spadlen;
  602|   921k|    } else if (flags & DP_F_ZERO) {
  ------------------
  |  |   75|   921k|#define DP_F_ZERO (1 << 4)
  ------------------
  |  Branch (602:16): [True: 643, False: 921k]
  ------------------
  603|    643|        zpadlen = zpadlen + spadlen;
  604|    643|        spadlen = 0;
  605|    643|    }
  606|       |
  607|       |    /* spaces */
  608|   921k|    while (spadlen > 0 && eob_ok(desc, spadlen)) {
  ------------------
  |  Branch (608:12): [True: 0, False: 921k]
  |  Branch (608:27): [True: 0, False: 0]
  ------------------
  609|      0|        if (!doapr_outch(desc, ' '))
  ------------------
  |  Branch (609:13): [True: 0, False: 0]
  ------------------
  610|      0|            return 0;
  611|      0|        --spadlen;
  612|      0|    }
  613|       |
  614|       |    /* sign */
  615|   921k|    if (signvalue)
  ------------------
  |  Branch (615:9): [True: 0, False: 921k]
  ------------------
  616|      0|        if (!doapr_outch(desc, signvalue))
  ------------------
  |  Branch (616:13): [True: 0, False: 0]
  ------------------
  617|      0|            return 0;
  618|       |
  619|       |    /* prefix */
  620|   921k|    while (*prefix) {
  ------------------
  |  Branch (620:12): [True: 0, False: 921k]
  ------------------
  621|      0|        if (!doapr_outch(desc, *prefix))
  ------------------
  |  Branch (621:13): [True: 0, False: 0]
  ------------------
  622|      0|            return 0;
  623|      0|        prefix++;
  624|      0|    }
  625|       |
  626|       |    /* zeros */
  627|   921k|    if (zpadlen > 0) {
  ------------------
  |  Branch (627:9): [True: 31.3k, False: 890k]
  ------------------
  628|  62.6k|        while (zpadlen > 0 && eob_ok(desc, zpadlen)) {
  ------------------
  |  Branch (628:16): [True: 31.3k, False: 31.3k]
  |  Branch (628:31): [True: 31.3k, False: 0]
  ------------------
  629|  31.3k|            if (!doapr_outch(desc, '0'))
  ------------------
  |  Branch (629:17): [True: 0, False: 31.3k]
  ------------------
  630|      0|                return 0;
  631|  31.3k|            --zpadlen;
  632|  31.3k|        }
  633|  31.3k|    }
  634|       |    /* digits */
  635|  2.56M|    while (place > 0) {
  ------------------
  |  Branch (635:12): [True: 1.63M, False: 921k]
  ------------------
  636|  1.63M|        if (!doapr_outch(desc, convert[--place]))
  ------------------
  |  Branch (636:13): [True: 0, False: 1.63M]
  ------------------
  637|      0|            return 0;
  638|  1.63M|    }
  639|       |
  640|       |    /* left justified spaces */
  641|   921k|    if (spadlen < 0) {
  ------------------
  |  Branch (641:9): [True: 0, False: 921k]
  ------------------
  642|      0|        spadlen = -spadlen;
  643|       |
  644|      0|        while (spadlen > 0 && eob_ok(desc, spadlen)) {
  ------------------
  |  Branch (644:16): [True: 0, False: 0]
  |  Branch (644:31): [True: 0, False: 0]
  ------------------
  645|      0|            if (!doapr_outch(desc, ' '))
  ------------------
  |  Branch (645:17): [True: 0, False: 0]
  ------------------
  646|      0|                return 0;
  647|      0|            --spadlen;
  648|      0|        }
  649|      0|    }
  650|   921k|    return 1;
  651|   921k|}
bio_print.c:eob_ok:
 1022|  10.7M|{
 1023|       |    /*
 1024|       |     * desc->buffer is auto-sizeable, so we are never supposed to reach the end
 1025|       |     * of it.
 1026|       |     */
 1027|  10.7M|    if (desc->buffer != NULL)
  ------------------
  |  Branch (1027:9): [True: 0, False: 10.7M]
  ------------------
 1028|      0|        return 1;
 1029|       |
 1030|  10.7M|    if (desc->currlen >= desc->maxlen) {
  ------------------
  |  Branch (1030:9): [True: 1.44k, False: 10.7M]
  ------------------
 1031|  1.44k|        if (left > 0) {
  ------------------
  |  Branch (1031:13): [True: 1.44k, False: 0]
  ------------------
 1032|  1.44k|            if (desc->pos < LLONG_MAX - left) {
  ------------------
  |  Branch (1032:17): [True: 1.44k, False: 0]
  ------------------
 1033|  1.44k|                desc->pos += left;
 1034|  1.44k|            } else {
 1035|      0|                desc->pos = LLONG_MAX;
 1036|      0|            }
 1037|  1.44k|        }
 1038|       |
 1039|  1.44k|        return 0;
 1040|  1.44k|    }
 1041|       |
 1042|  10.7M|    return 1;
 1043|  10.7M|}
bio_print.c:fmtstr:
  469|   186k|{
  470|   186k|    int padlen = 0;
  471|   186k|    size_t strln;
  472|   186k|    int cnt = 0;
  473|       |
  474|   186k|    if (value == 0)
  ------------------
  |  Branch (474:9): [True: 2.25k, False: 184k]
  ------------------
  475|  2.25k|        value = "<NULL>";
  476|       |
  477|   186k|    strln = OPENSSL_strnlen(value, max < 0 ? SIZE_MAX : (size_t)max);
  ------------------
  |  Branch (477:36): [True: 0, False: 186k]
  ------------------
  478|       |
  479|   186k|    if (min >= 0 && strln < INT_MAX) {
  ------------------
  |  Branch (479:9): [True: 186k, False: 0]
  |  Branch (479:21): [True: 186k, False: 0]
  ------------------
  480|   186k|        padlen = min - (int)strln;
  481|   186k|        if (padlen < 0)
  ------------------
  |  Branch (481:13): [True: 185k, False: 1.01k]
  ------------------
  482|   185k|            padlen = 0;
  483|   186k|    }
  484|   186k|    if (max >= 0) {
  ------------------
  |  Branch (484:9): [True: 186k, False: 0]
  ------------------
  485|       |        /*
  486|       |         * Calculate the maximum output including padding.
  487|       |         * Make sure max doesn't overflow into negativity
  488|       |         */
  489|   186k|        if (max < INT_MAX - padlen)
  ------------------
  |  Branch (489:13): [True: 0, False: 186k]
  ------------------
  490|      0|            max += padlen;
  491|   186k|        else
  492|   186k|            max = INT_MAX;
  493|   186k|    }
  494|       |
  495|   186k|    if (!(flags & DP_F_MINUS) && padlen > 0) {
  ------------------
  |  |   67|   186k|#define DP_F_MINUS (1 << 0)
  ------------------
  |  Branch (495:9): [True: 186k, False: 0]
  |  Branch (495:34): [True: 0, False: 186k]
  ------------------
  496|       |        /* cap padlen to max so we can pass it as-is to eob_ok() */
  497|      0|        if (max >= 0) {
  ------------------
  |  Branch (497:13): [True: 0, False: 0]
  ------------------
  498|      0|            if (padlen > max)
  ------------------
  |  Branch (498:17): [True: 0, False: 0]
  ------------------
  499|      0|                padlen = max;
  500|      0|            cnt = padlen;
  501|      0|        }
  502|      0|        while (padlen > 0 && eob_ok(desc, padlen)) {
  ------------------
  |  Branch (502:16): [True: 0, False: 0]
  |  Branch (502:30): [True: 0, False: 0]
  ------------------
  503|      0|            if (!doapr_outch(desc, ' '))
  ------------------
  |  Branch (503:17): [True: 0, False: 0]
  ------------------
  504|      0|                return 0;
  505|      0|            --padlen;
  506|      0|        }
  507|      0|    }
  508|   186k|    if (max >= 0) {
  ------------------
  |  Branch (508:9): [True: 186k, False: 0]
  ------------------
  509|       |        /* cap strln to (max - cnt) so we can pass it as-is to eob_ok() */
  510|   186k|        if (strln > INT_MAX || (int)strln > max - cnt)
  ------------------
  |  Branch (510:13): [True: 0, False: 186k]
  |  Branch (510:32): [True: 0, False: 186k]
  ------------------
  511|      0|            strln = max - cnt;
  512|   186k|        cnt += (int)strln;
  513|   186k|    }
  514|  10.9M|    while (strln > 0 && eob_ok(desc, strln)) {
  ------------------
  |  Branch (514:12): [True: 10.7M, False: 184k]
  |  Branch (514:25): [True: 10.7M, False: 1.44k]
  ------------------
  515|  10.7M|        if (!doapr_outch(desc, *value++))
  ------------------
  |  Branch (515:13): [True: 0, False: 10.7M]
  ------------------
  516|      0|            return 0;
  517|  10.7M|        --strln;
  518|  10.7M|    }
  519|   186k|    if ((flags & DP_F_MINUS) && padlen > 0) {
  ------------------
  |  |   67|   186k|#define DP_F_MINUS (1 << 0)
  ------------------
  |  Branch (519:9): [True: 0, False: 186k]
  |  Branch (519:33): [True: 0, False: 0]
  ------------------
  520|       |        /* cap padlen to (max - cnt) so we can pass it as-is to eob_ok() */
  521|      0|        if (max >= 0) {
  ------------------
  |  Branch (521:13): [True: 0, False: 0]
  ------------------
  522|      0|            if (padlen > max - cnt)
  ------------------
  |  Branch (522:17): [True: 0, False: 0]
  ------------------
  523|      0|                padlen = max - cnt;
  524|      0|        }
  525|      0|        while (padlen > 0 && eob_ok(desc, padlen)) {
  ------------------
  |  Branch (525:16): [True: 0, False: 0]
  |  Branch (525:30): [True: 0, False: 0]
  ------------------
  526|      0|            if (!doapr_outch(desc, ' '))
  ------------------
  |  Branch (526:17): [True: 0, False: 0]
  ------------------
  527|      0|                return 0;
  528|      0|            --padlen;
  529|      0|        }
  530|      0|    }
  531|   186k|    return 1;
  532|   186k|}

bio_sock_cleanup_int:
  205|      1|{
  206|       |#ifdef OPENSSL_SYS_WINDOWS
  207|       |    if (wsa_init_done) {
  208|       |        wsa_init_done = 0;
  209|       |        WSACleanup();
  210|       |    }
  211|       |#endif
  212|      1|}

ossl_bio_core_globals_free:
   26|    787|{
   27|    787|    OPENSSL_free(vbcg);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   28|    787|}
ossl_bio_core_globals_new:
   31|    787|{
   32|    787|    return OPENSSL_zalloc(sizeof(BIO_CORE_GLOBALS));
  ------------------
  |  |  108|    787|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|    787|}

BIO_new_file:
   58|  3.76k|{
   59|  3.76k|    BIO *ret;
   60|  3.76k|    FILE *file = openssl_fopen(filename, mode);
   61|  3.76k|    int fp_flags = BIO_CLOSE;
  ------------------
  |  |   85|  3.76k|#define BIO_CLOSE 0x01
  ------------------
   62|       |
   63|  3.76k|    if (strchr(mode, 'b') == NULL)
  ------------------
  |  Branch (63:9): [True: 2.97k, False: 787]
  ------------------
   64|  2.97k|        fp_flags |= BIO_FP_TEXT;
  ------------------
  |  |  220|  2.97k|#define BIO_FP_TEXT 0x10
  ------------------
   65|       |
   66|  3.76k|    if (file == NULL) {
  ------------------
  |  Branch (66:9): [True: 929, False: 2.83k]
  ------------------
   67|    929|        ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |  406|    929|    (ERR_new(),                                                  \
  |  |  407|    929|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|    929|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|    929|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   74|    929|#define ERR_LIB_SYS 2
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   30|    929|#define get_last_sys_error() errno
  ------------------
   68|    929|            "calling fopen(%s, %s)",
   69|    929|            filename, mode);
   70|    929|        if (errno == ENOENT
  ------------------
  |  Branch (70:13): [True: 926, False: 3]
  ------------------
   71|      3|#ifdef ENXIO
   72|    929|            || errno == ENXIO
  ------------------
  |  Branch (72:16): [True: 0, False: 3]
  ------------------
   73|    929|#endif
   74|    929|        )
   75|    929|            ERR_raise(ERR_LIB_BIO, BIO_R_NO_SUCH_FILE);
  ------------------
  |  |  404|    926|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|    926|    (ERR_new(),                                                  \
  |  |  |  |  407|    926|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|    926|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|    926|        ERR_set_error)
  |  |  ------------------
  ------------------
   76|      3|        else
   77|    929|            ERR_raise(ERR_LIB_BIO, ERR_R_SYS_LIB);
  ------------------
  |  |  404|      3|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      3|    (ERR_new(),                                                  \
  |  |  |  |  407|      3|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      3|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      3|        ERR_set_error)
  |  |  ------------------
  ------------------
   78|    929|        return NULL;
   79|    929|    }
   80|  2.83k|    if ((ret = BIO_new(BIO_s_file())) == NULL) {
  ------------------
  |  Branch (80:9): [True: 0, False: 2.83k]
  ------------------
   81|      0|        fclose(file);
   82|      0|        return NULL;
   83|      0|    }
   84|       |
   85|       |    /* we did fopen -> we disengage UPLINK */
   86|  2.83k|    BIO_clear_flags(ret, BIO_FLAGS_UPLINK_INTERNAL);
  ------------------
  |  |   18|  2.83k|#define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
   87|  2.83k|    BIO_set_fp(ret, file, fp_flags);
  ------------------
  |  |  568|  2.83k|#define BIO_set_fp(b, fp, c) BIO_ctrl(b, BIO_C_SET_FILE_PTR, c, (char *)(fp))
  |  |  ------------------
  |  |  |  |  440|  2.83k|#define BIO_C_SET_FILE_PTR 106
  |  |  ------------------
  ------------------
   88|  2.83k|    return ret;
   89|  2.83k|}
BIO_s_file:
  105|  5.27k|{
  106|  5.27k|    return &methods_filep;
  107|  5.27k|}
bss_file.c:file_gets:
  351|  10.1M|{
  352|  10.1M|    int ret = 0;
  353|       |
  354|  10.1M|    buf[0] = '\0';
  355|  10.1M|    if (bp->flags & BIO_FLAGS_UPLINK_INTERNAL) {
  ------------------
  |  |   18|  10.1M|#define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
  |  Branch (355:9): [True: 0, False: 10.1M]
  ------------------
  356|      0|        if (!UP_fgets(buf, size, bp->ptr))
  ------------------
  |  |  152|      0|#define UP_fgets fgets
  ------------------
  |  Branch (356:13): [True: 0, False: 0]
  ------------------
  357|      0|            goto err;
  358|  10.1M|    } else {
  359|  10.1M|        if (!fgets(buf, size, (FILE *)bp->ptr))
  ------------------
  |  Branch (359:13): [True: 5.26k, False: 10.1M]
  ------------------
  360|  5.26k|            goto err;
  361|  10.1M|    }
  362|  10.1M|    if (buf[0] != '\0')
  ------------------
  |  Branch (362:9): [True: 10.1M, False: 0]
  ------------------
  363|  10.1M|        ret = (int)strlen(buf);
  364|  10.1M|err:
  365|  10.1M|    return ret;
  366|  10.1M|}
bss_file.c:file_ctrl:
  180|  5.27k|{
  181|  5.27k|    long ret = 1;
  182|  5.27k|    FILE *fp = (FILE *)b->ptr;
  183|  5.27k|    FILE **fpp;
  184|  5.27k|    char p[4];
  185|  5.27k|    int st;
  186|       |
  187|  5.27k|    switch (cmd) {
  188|      0|    case BIO_C_FILE_SEEK:
  ------------------
  |  |  462|      0|#define BIO_C_FILE_SEEK 128
  ------------------
  |  Branch (188:5): [True: 0, False: 5.27k]
  ------------------
  189|      0|    case BIO_CTRL_RESET:
  ------------------
  |  |   90|      0|#define BIO_CTRL_RESET 1 /* opt - rewind/zero etc */
  ------------------
  |  Branch (189:5): [True: 0, False: 5.27k]
  ------------------
  190|      0|        if (b->flags & BIO_FLAGS_UPLINK_INTERNAL)
  ------------------
  |  |   18|      0|#define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
  |  Branch (190:13): [True: 0, False: 0]
  ------------------
  191|      0|            ret = (long)UP_fseek(b->ptr, num, 0);
  ------------------
  |  |  160|      0|#define UP_fseek fseek
  ------------------
  192|      0|        else
  193|      0|            ret = (long)fseek(fp, num, 0);
  194|      0|        break;
  195|      0|    case BIO_CTRL_EOF:
  ------------------
  |  |   91|      0|#define BIO_CTRL_EOF 2 /* opt - are we at the eof */
  ------------------
  |  Branch (195:5): [True: 0, False: 5.27k]
  ------------------
  196|      0|        if (b->flags & BIO_FLAGS_UPLINK_INTERNAL)
  ------------------
  |  |   18|      0|#define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
  |  Branch (196:13): [True: 0, False: 0]
  ------------------
  197|      0|            ret = (long)UP_feof(fp);
  ------------------
  |  |  156|      0|#define UP_feof feof
  ------------------
  198|      0|        else
  199|      0|            ret = (long)feof(fp);
  200|      0|        break;
  201|      0|    case BIO_C_FILE_TELL:
  ------------------
  |  |  468|      0|#define BIO_C_FILE_TELL 133
  ------------------
  |  Branch (201:5): [True: 0, False: 5.27k]
  ------------------
  202|      0|    case BIO_CTRL_INFO:
  ------------------
  |  |   92|      0|#define BIO_CTRL_INFO 3 /* opt - extra tit-bits */
  ------------------
  |  Branch (202:5): [True: 0, False: 5.27k]
  ------------------
  203|      0|        if (b->flags & BIO_FLAGS_UPLINK_INTERNAL)
  ------------------
  |  |   18|      0|#define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
  |  Branch (203:13): [True: 0, False: 0]
  ------------------
  204|      0|            ret = UP_ftell(b->ptr);
  ------------------
  |  |  161|      0|#define UP_ftell ftell
  ------------------
  205|      0|        else {
  206|       |#if defined(OPENSSL_SYS_WINDOWS)
  207|       |            /*
  208|       |             * On Windows, for non-seekable files (stdin), ftell() is undefined.
  209|       |             */
  210|       |            if (GetFileType((HANDLE)_get_osfhandle(_fileno(fp))) != FILE_TYPE_DISK)
  211|       |                ret = -1;
  212|       |            else
  213|       |                ret = ftell(fp);
  214|       |#else
  215|      0|            ret = ftell(fp);
  216|      0|#endif
  217|      0|        }
  218|      0|        break;
  219|  2.83k|    case BIO_C_SET_FILE_PTR:
  ------------------
  |  |  440|  2.83k|#define BIO_C_SET_FILE_PTR 106
  ------------------
  |  Branch (219:5): [True: 2.83k, False: 2.44k]
  ------------------
  220|  2.83k|        file_free(b);
  221|  2.83k|        b->shutdown = (int)num & BIO_CLOSE;
  ------------------
  |  |   85|  2.83k|#define BIO_CLOSE 0x01
  ------------------
  222|  2.83k|        b->ptr = ptr;
  223|  2.83k|        b->init = 1;
  224|       |#if BIO_FLAGS_UPLINK_INTERNAL != 0
  225|       |#if defined(__MINGW32__) && defined(__MSVCRT__) && !defined(_IOB_ENTRIES)
  226|       |#define _IOB_ENTRIES 20
  227|       |#endif
  228|       |        /* Safety net to catch purely internal BIO_set_fp calls */
  229|       |#if (defined(_MSC_VER) && _MSC_VER >= 1900) || defined(__BORLANDC__)
  230|       |        if (ptr == stdin || ptr == stdout || ptr == stderr)
  231|       |            BIO_clear_flags(b, BIO_FLAGS_UPLINK_INTERNAL);
  232|       |#elif defined(_IOB_ENTRIES)
  233|       |        if ((size_t)ptr >= (size_t)stdin && (size_t)ptr < (size_t)(stdin + _IOB_ENTRIES))
  234|       |            BIO_clear_flags(b, BIO_FLAGS_UPLINK_INTERNAL);
  235|       |#endif
  236|       |#endif
  237|       |#ifdef UP_fsetmod
  238|       |        if (b->flags & BIO_FLAGS_UPLINK_INTERNAL)
  239|       |            UP_fsetmod(b->ptr, (char)((num & BIO_FP_TEXT) ? 't' : 'b'));
  240|       |        else
  241|       |#endif
  242|  2.83k|        {
  243|       |#if defined(OPENSSL_SYS_WINDOWS)
  244|       |            int fd = _fileno((FILE *)ptr);
  245|       |            if (num & BIO_FP_TEXT)
  246|       |                _setmode(fd, _O_TEXT);
  247|       |            else
  248|       |                _setmode(fd, _O_BINARY);
  249|       |#elif defined(OPENSSL_SYS_MSDOS)
  250|       |            int fd = fileno((FILE *)ptr);
  251|       |            /* Set correct text/binary mode */
  252|       |            if (num & BIO_FP_TEXT)
  253|       |                _setmode(fd, _O_TEXT);
  254|       |            /* Dangerous to set stdin/stdout to raw (unless redirected) */
  255|       |            else {
  256|       |                if (fd == STDIN_FILENO || fd == STDOUT_FILENO) {
  257|       |                    if (isatty(fd) <= 0)
  258|       |                        _setmode(fd, _O_BINARY);
  259|       |                } else
  260|       |                    _setmode(fd, _O_BINARY);
  261|       |            }
  262|       |#elif defined(OPENSSL_SYS_WIN32_CYGWIN)
  263|       |            int fd = fileno((FILE *)ptr);
  264|       |            if (!(num & BIO_FP_TEXT))
  265|       |                setmode(fd, O_BINARY);
  266|       |#endif
  267|  2.83k|        }
  268|  2.83k|        break;
  269|  2.44k|    case BIO_C_SET_FILENAME:
  ------------------
  |  |  442|  2.44k|#define BIO_C_SET_FILENAME 108
  ------------------
  |  Branch (269:5): [True: 2.44k, False: 2.83k]
  ------------------
  270|  2.44k|        file_free(b);
  271|  2.44k|        b->shutdown = (int)num & BIO_CLOSE;
  ------------------
  |  |   85|  2.44k|#define BIO_CLOSE 0x01
  ------------------
  272|  2.44k|        if (num & BIO_FP_APPEND) {
  ------------------
  |  |  219|  2.44k|#define BIO_FP_APPEND 0x08
  ------------------
  |  Branch (272:13): [True: 0, False: 2.44k]
  ------------------
  273|      0|            if (num & BIO_FP_READ)
  ------------------
  |  |  217|      0|#define BIO_FP_READ 0x02
  ------------------
  |  Branch (273:17): [True: 0, False: 0]
  ------------------
  274|      0|                OPENSSL_strlcpy(p, "a+", sizeof(p));
  275|      0|            else
  276|      0|                OPENSSL_strlcpy(p, "a", sizeof(p));
  277|  2.44k|        } else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE))
  ------------------
  |  |  217|  2.44k|#define BIO_FP_READ 0x02
  ------------------
                      } else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE))
  ------------------
  |  |  218|  2.44k|#define BIO_FP_WRITE 0x04
  ------------------
  |  Branch (277:20): [True: 2.44k, False: 0]
  |  Branch (277:43): [True: 0, False: 2.44k]
  ------------------
  278|      0|            OPENSSL_strlcpy(p, "r+", sizeof(p));
  279|  2.44k|        else if (num & BIO_FP_WRITE)
  ------------------
  |  |  218|  2.44k|#define BIO_FP_WRITE 0x04
  ------------------
  |  Branch (279:18): [True: 0, False: 2.44k]
  ------------------
  280|      0|            OPENSSL_strlcpy(p, "w", sizeof(p));
  281|  2.44k|        else if (num & BIO_FP_READ)
  ------------------
  |  |  217|  2.44k|#define BIO_FP_READ 0x02
  ------------------
  |  Branch (281:18): [True: 2.44k, False: 0]
  ------------------
  282|  2.44k|            OPENSSL_strlcpy(p, "r", sizeof(p));
  283|      0|        else {
  284|      0|            ERR_raise(ERR_LIB_BIO, BIO_R_BAD_FOPEN_MODE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  285|      0|            ret = 0;
  286|      0|            break;
  287|      0|        }
  288|       |#if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS)
  289|       |        if (!(num & BIO_FP_TEXT))
  290|       |            OPENSSL_strlcat(p, "b", sizeof(p));
  291|       |        else
  292|       |            OPENSSL_strlcat(p, "t", sizeof(p));
  293|       |#elif defined(OPENSSL_SYS_WIN32_CYGWIN)
  294|       |        if (!(num & BIO_FP_TEXT))
  295|       |            OPENSSL_strlcat(p, "b", sizeof(p));
  296|       |#endif
  297|  2.44k|        fp = openssl_fopen(ptr, p);
  298|  2.44k|        if (fp == NULL) {
  ------------------
  |  Branch (298:13): [True: 9, False: 2.43k]
  ------------------
  299|      9|            ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |  406|      9|    (ERR_new(),                                                  \
  |  |  407|      9|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      9|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      9|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   74|      9|#define ERR_LIB_SYS 2
  ------------------
                          ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   30|      9|#define get_last_sys_error() errno
  ------------------
  300|      9|                "calling fopen(%s, %s)",
  301|      9|                (const char *)ptr, p);
  302|      9|            ERR_raise(ERR_LIB_BIO, ERR_R_SYS_LIB);
  ------------------
  |  |  404|      9|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      9|    (ERR_new(),                                                  \
  |  |  |  |  407|      9|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      9|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      9|        ERR_set_error)
  |  |  ------------------
  ------------------
  303|      9|            ret = 0;
  304|      9|            break;
  305|      9|        }
  306|  2.43k|        b->ptr = fp;
  307|  2.43k|        b->init = 1;
  308|       |        /* we did fopen -> we disengage UPLINK */
  309|  2.43k|        BIO_clear_flags(b, BIO_FLAGS_UPLINK_INTERNAL);
  ------------------
  |  |   18|  2.43k|#define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
  310|  2.43k|        break;
  311|      0|    case BIO_C_GET_FILE_PTR:
  ------------------
  |  |  441|      0|#define BIO_C_GET_FILE_PTR 107
  ------------------
  |  Branch (311:5): [True: 0, False: 5.27k]
  ------------------
  312|       |        /* the ptr parameter is actually a FILE ** in this case. */
  313|      0|        if (ptr != NULL) {
  ------------------
  |  Branch (313:13): [True: 0, False: 0]
  ------------------
  314|      0|            fpp = (FILE **)ptr;
  315|      0|            *fpp = (FILE *)b->ptr;
  316|      0|        }
  317|      0|        break;
  318|      0|    case BIO_CTRL_GET_CLOSE:
  ------------------
  |  |   97|      0|#define BIO_CTRL_GET_CLOSE 8 /* man - set the 'close' on free */
  ------------------
  |  Branch (318:5): [True: 0, False: 5.27k]
  ------------------
  319|      0|        ret = (long)b->shutdown;
  320|      0|        break;
  321|      0|    case BIO_CTRL_SET_CLOSE:
  ------------------
  |  |   98|      0|#define BIO_CTRL_SET_CLOSE 9 /* man - set the 'close' on free */
  ------------------
  |  Branch (321:5): [True: 0, False: 5.27k]
  ------------------
  322|      0|        b->shutdown = (int)num;
  323|      0|        break;
  324|      0|    case BIO_CTRL_FLUSH:
  ------------------
  |  |  100|      0|#define BIO_CTRL_FLUSH 11 /* opt - 'flush' buffered output */
  ------------------
  |  Branch (324:5): [True: 0, False: 5.27k]
  ------------------
  325|      0|        st = b->flags & BIO_FLAGS_UPLINK_INTERNAL
  ------------------
  |  |   18|      0|#define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
  |  Branch (325:14): [True: 0, False: 0]
  ------------------
  326|      0|            ? UP_fflush(b->ptr)
  ------------------
  |  |  162|      0|#define UP_fflush fflush
  ------------------
  327|      0|            : fflush((FILE *)b->ptr);
  328|      0|        if (st == EOF) {
  ------------------
  |  Branch (328:13): [True: 0, False: 0]
  ------------------
  329|      0|            ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   74|      0|#define ERR_LIB_SYS 2
  ------------------
                          ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   30|      0|#define get_last_sys_error() errno
  ------------------
  330|      0|                "calling fflush()");
  331|      0|            ERR_raise(ERR_LIB_BIO, ERR_R_SYS_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  332|      0|            ret = 0;
  333|      0|        }
  334|      0|        break;
  335|      0|    case BIO_CTRL_DUP:
  ------------------
  |  |  101|      0|#define BIO_CTRL_DUP 12 /* man - extra stuff for 'duped' BIO */
  ------------------
  |  Branch (335:5): [True: 0, False: 5.27k]
  ------------------
  336|      0|        ret = 1;
  337|      0|        break;
  338|       |
  339|      0|    case BIO_CTRL_WPENDING:
  ------------------
  |  |  102|      0|#define BIO_CTRL_WPENDING 13 /* opt - number of bytes still to write */
  ------------------
  |  Branch (339:5): [True: 0, False: 5.27k]
  ------------------
  340|      0|    case BIO_CTRL_PENDING:
  ------------------
  |  |   99|      0|#define BIO_CTRL_PENDING 10 /* opt - is their more data buffered */
  ------------------
  |  Branch (340:5): [True: 0, False: 5.27k]
  ------------------
  341|      0|    case BIO_CTRL_PUSH:
  ------------------
  |  |   95|      0|#define BIO_CTRL_PUSH 6 /* opt - internal, used to signify change */
  ------------------
  |  Branch (341:5): [True: 0, False: 5.27k]
  ------------------
  342|      0|    case BIO_CTRL_POP:
  ------------------
  |  |   96|      0|#define BIO_CTRL_POP 7 /* opt - internal, used to signify change */
  ------------------
  |  Branch (342:5): [True: 0, False: 5.27k]
  ------------------
  343|      0|    default:
  ------------------
  |  Branch (343:5): [True: 0, False: 5.27k]
  ------------------
  344|      0|        ret = 0;
  345|      0|        break;
  346|  5.27k|    }
  347|  5.27k|    return ret;
  348|  5.27k|}
bss_file.c:file_new:
  110|  5.27k|{
  111|  5.27k|    bi->init = 0;
  112|  5.27k|    bi->num = 0;
  113|  5.27k|    bi->ptr = NULL;
  114|  5.27k|    bi->flags = BIO_FLAGS_UPLINK_INTERNAL; /* default to UPLINK */
  ------------------
  |  |   18|  5.27k|#define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
  115|  5.27k|    return 1;
  116|  5.27k|}
bss_file.c:file_free:
  119|  10.5k|{
  120|  10.5k|    if (a == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 10.5k]
  ------------------
  121|      0|        return 0;
  122|  10.5k|    if (a->shutdown) {
  ------------------
  |  Branch (122:9): [True: 10.5k, False: 0]
  ------------------
  123|  10.5k|        if ((a->init) && (a->ptr != NULL)) {
  ------------------
  |  Branch (123:13): [True: 5.26k, False: 5.28k]
  |  Branch (123:26): [True: 5.26k, False: 0]
  ------------------
  124|  5.26k|            if (a->flags & BIO_FLAGS_UPLINK_INTERNAL)
  ------------------
  |  |   18|  5.26k|#define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
  |  Branch (124:17): [True: 0, False: 5.26k]
  ------------------
  125|      0|                UP_fclose(a->ptr);
  ------------------
  |  |  157|      0|#define UP_fclose fclose
  ------------------
  126|  5.26k|            else
  127|  5.26k|                fclose(a->ptr);
  128|  5.26k|            a->ptr = NULL;
  129|  5.26k|            a->flags = BIO_FLAGS_UPLINK_INTERNAL;
  ------------------
  |  |   18|  5.26k|#define BIO_FLAGS_UPLINK_INTERNAL 0
  ------------------
  130|  5.26k|        }
  131|  10.5k|        a->init = 0;
  132|  10.5k|    }
  133|  10.5k|    return 1;
  134|  10.5k|}

BIO_s_mem:
   73|  1.24M|{
   74|  1.24M|    return &mem_method;
   75|  1.24M|}
BIO_new_mem_buf:
   83|   824k|{
   84|   824k|    BIO *ret;
   85|   824k|    BUF_MEM *b;
   86|   824k|    BIO_BUF_MEM *bb;
   87|   824k|    size_t sz;
   88|       |
   89|   824k|    if (buf == NULL) {
  ------------------
  |  Branch (89:9): [True: 0, False: 824k]
  ------------------
   90|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   91|      0|        return NULL;
   92|      0|    }
   93|   824k|    sz = (len < 0) ? strlen(buf) : (size_t)len;
  ------------------
  |  Branch (93:10): [True: 0, False: 824k]
  ------------------
   94|   824k|    if ((ret = BIO_new(BIO_s_mem())) == NULL)
  ------------------
  |  Branch (94:9): [True: 0, False: 824k]
  ------------------
   95|      0|        return NULL;
   96|   824k|    bb = (BIO_BUF_MEM *)ret->ptr;
   97|   824k|    b = bb->buf;
   98|       |    /* Cast away const and trust in the MEM_RDONLY flag. */
   99|   824k|    b->data = (void *)buf;
  100|   824k|    b->length = sz;
  101|   824k|    b->max = sz;
  102|   824k|    *bb->readp = *bb->buf;
  103|   824k|    ret->flags |= BIO_FLAGS_MEM_RDONLY;
  ------------------
  |  |  239|   824k|#define BIO_FLAGS_MEM_RDONLY 0x200
  ------------------
  104|       |    /* Since this is static data retrying won't help */
  105|   824k|    ret->num = 0;
  106|   824k|    return ret;
  107|   824k|}
bss_mem.c:mem_write:
  215|  9.37M|{
  216|  9.37M|    int ret = -1;
  217|  9.37M|    size_t blen;
  218|  9.37M|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  219|       |
  220|  9.37M|    if (b->flags & BIO_FLAGS_MEM_RDONLY) {
  ------------------
  |  |  239|  9.37M|#define BIO_FLAGS_MEM_RDONLY 0x200
  ------------------
  |  Branch (220:9): [True: 0, False: 9.37M]
  ------------------
  221|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_WRITE_TO_READ_ONLY_BIO);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  222|      0|        goto end;
  223|      0|    }
  224|  9.37M|    BIO_clear_retry_flags(b);
  ------------------
  |  |  263|  9.37M|    BIO_clear_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  225|  9.37M|#define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|  9.37M|#define BIO_FLAGS_READ 0x01
  |  |  |  |  ------------------
  |  |  |  |               #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  223|  9.37M|#define BIO_FLAGS_WRITE 0x02
  |  |  |  |  ------------------
  |  |  |  |               #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  224|  9.37M|#define BIO_FLAGS_IO_SPECIAL 0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   BIO_clear_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  226|  9.37M|#define BIO_FLAGS_SHOULD_RETRY 0x08
  |  |  ------------------
  ------------------
  225|  9.37M|    if (inl == 0)
  ------------------
  |  Branch (225:9): [True: 0, False: 9.37M]
  ------------------
  226|      0|        return 0;
  227|  9.37M|    if (in == NULL) {
  ------------------
  |  Branch (227:9): [True: 0, False: 9.37M]
  ------------------
  228|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  229|      0|        goto end;
  230|      0|    }
  231|  9.37M|    blen = bbm->readp->length;
  232|  9.37M|    mem_buf_sync(b);
  233|  9.37M|    if (BUF_MEM_grow_clean(bbm->buf, blen + inl) == 0)
  ------------------
  |  Branch (233:9): [True: 0, False: 9.37M]
  ------------------
  234|      0|        goto end;
  235|  9.37M|    memcpy(bbm->buf->data + blen, in, inl);
  236|  9.37M|    *bbm->readp = *bbm->buf;
  237|  9.37M|    ret = inl;
  238|  9.37M|end:
  239|  9.37M|    return ret;
  240|  9.37M|}
bss_mem.c:mem_buf_sync:
  178|  9.78M|{
  179|  9.78M|    if (b != NULL && b->init != 0 && b->ptr != NULL) {
  ------------------
  |  Branch (179:9): [True: 9.78M, False: 0]
  |  Branch (179:22): [True: 9.78M, False: 0]
  |  Branch (179:38): [True: 9.78M, False: 0]
  ------------------
  180|  9.78M|        BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  181|       |
  182|  9.78M|        if (bbm->readp->data != bbm->buf->data) {
  ------------------
  |  Branch (182:13): [True: 0, False: 9.78M]
  ------------------
  183|      0|            memmove(bbm->buf->data, bbm->readp->data, bbm->readp->length);
  184|      0|            bbm->buf->length = bbm->readp->length;
  185|      0|            bbm->readp->data = bbm->buf->data;
  186|      0|        }
  187|  9.78M|    }
  188|  9.78M|    return 0;
  189|  9.78M|}
bss_mem.c:mem_read:
  192|  2.06M|{
  193|  2.06M|    int ret = -1;
  194|  2.06M|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  195|  2.06M|    BUF_MEM *bm = bbm->readp;
  196|       |
  197|  2.06M|    if (b->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  239|  2.06M|#define BIO_FLAGS_MEM_RDONLY 0x200
  ------------------
  |  Branch (197:9): [True: 1.64M, False: 412k]
  ------------------
  198|  1.64M|        bm = bbm->buf;
  199|  2.06M|    BIO_clear_retry_flags(b);
  ------------------
  |  |  263|  2.06M|    BIO_clear_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  225|  2.06M|#define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|  2.06M|#define BIO_FLAGS_READ 0x01
  |  |  |  |  ------------------
  |  |  |  |               #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  223|  2.06M|#define BIO_FLAGS_WRITE 0x02
  |  |  |  |  ------------------
  |  |  |  |               #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  224|  2.06M|#define BIO_FLAGS_IO_SPECIAL 0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   BIO_clear_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  226|  2.06M|#define BIO_FLAGS_SHOULD_RETRY 0x08
  |  |  ------------------
  ------------------
  200|  2.06M|    ret = (outl >= 0 && (size_t)outl > bm->length) ? (int)bm->length : outl;
  ------------------
  |  Branch (200:12): [True: 2.06M, False: 0]
  |  Branch (200:25): [True: 0, False: 2.06M]
  ------------------
  201|  2.06M|    if ((out != NULL) && (ret > 0)) {
  ------------------
  |  Branch (201:9): [True: 2.06M, False: 0]
  |  Branch (201:26): [True: 2.06M, False: 0]
  ------------------
  202|  2.06M|        memcpy(out, bm->data, ret);
  203|  2.06M|        bm->length -= ret;
  204|  2.06M|        bm->max -= ret;
  205|  2.06M|        bm->data += ret;
  206|  2.06M|    } else if (bm->length == 0) {
  ------------------
  |  Branch (206:16): [True: 0, False: 0]
  ------------------
  207|      0|        ret = b->num;
  208|      0|        if (ret != 0)
  ------------------
  |  Branch (208:13): [True: 0, False: 0]
  ------------------
  209|      0|            BIO_set_retry_read(b);
  ------------------
  |  |  257|      0|    BIO_set_flags(b, (BIO_FLAGS_READ | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  222|      0|#define BIO_FLAGS_READ 0x01
  |  |  ------------------
  |  |                   BIO_set_flags(b, (BIO_FLAGS_READ | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  226|      0|#define BIO_FLAGS_SHOULD_RETRY 0x08
  |  |  ------------------
  ------------------
  210|      0|    }
  211|  2.06M|    return ret;
  212|  2.06M|}
bss_mem.c:mem_puts:
  382|  9.37M|{
  383|  9.37M|    int ret;
  384|  9.37M|    size_t n = strlen(str);
  385|       |
  386|  9.37M|    if (n > INT_MAX)
  ------------------
  |  Branch (386:9): [True: 0, False: 9.37M]
  ------------------
  387|      0|        return -1;
  388|  9.37M|    ret = mem_write(bp, str, (int)n);
  389|       |    /* memory semantics is that it will always work */
  390|  9.37M|    return ret;
  391|  9.37M|}
bss_mem.c:mem_ctrl:
  243|  4.12M|{
  244|  4.12M|    long ret = 1;
  245|  4.12M|    char **pptr;
  246|  4.12M|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  247|  4.12M|    BUF_MEM *bm, *bo; /* bio_mem, bio_other */
  248|  4.12M|    ossl_ssize_t off, remain;
  ------------------
  |  |  204|  4.12M|#define ossl_ssize_t ssize_t
  ------------------
  249|       |
  250|  4.12M|    if (b->flags & BIO_FLAGS_MEM_RDONLY) {
  ------------------
  |  |  239|  4.12M|#define BIO_FLAGS_MEM_RDONLY 0x200
  ------------------
  |  Branch (250:9): [True: 3.29M, False: 826k]
  ------------------
  251|  3.29M|        bm = bbm->buf;
  252|  3.29M|        bo = bbm->readp;
  253|  3.29M|    } else {
  254|   826k|        bm = bbm->readp;
  255|   826k|        bo = bbm->buf;
  256|   826k|    }
  257|  4.12M|    off = (bm->data == bo->data) ? 0 : bm->data - bo->data;
  ------------------
  |  Branch (257:11): [True: 3.71M, False: 412k]
  ------------------
  258|  4.12M|    remain = bm->length;
  259|       |
  260|  4.12M|    switch (cmd) {
  261|      0|    case BIO_CTRL_RESET:
  ------------------
  |  |   90|      0|#define BIO_CTRL_RESET 1 /* opt - rewind/zero etc */
  ------------------
  |  Branch (261:5): [True: 0, False: 4.12M]
  ------------------
  262|      0|        bm = bbm->buf;
  263|      0|        if (bm->data != NULL) {
  ------------------
  |  Branch (263:13): [True: 0, False: 0]
  ------------------
  264|      0|            if (!(b->flags & BIO_FLAGS_MEM_RDONLY)) {
  ------------------
  |  |  239|      0|#define BIO_FLAGS_MEM_RDONLY 0x200
  ------------------
  |  Branch (264:17): [True: 0, False: 0]
  ------------------
  265|      0|                if (!(b->flags & BIO_FLAGS_NONCLEAR_RST)) {
  ------------------
  |  |  240|      0|#define BIO_FLAGS_NONCLEAR_RST 0x400
  ------------------
  |  Branch (265:21): [True: 0, False: 0]
  ------------------
  266|      0|                    memset(bm->data, 0, bm->max);
  267|      0|                    bm->length = 0;
  268|      0|                }
  269|      0|                *bbm->readp = *bbm->buf;
  270|      0|            } else {
  271|       |                /* For read only case just reset to the start again */
  272|      0|                *bbm->buf = *bbm->readp;
  273|      0|            }
  274|      0|        }
  275|      0|        break;
  276|   824k|    case BIO_C_FILE_SEEK:
  ------------------
  |  |  462|   824k|#define BIO_C_FILE_SEEK 128
  ------------------
  |  Branch (276:5): [True: 824k, False: 3.30M]
  ------------------
  277|   824k|        if (num < 0 || num > off + remain)
  ------------------
  |  Branch (277:13): [True: 0, False: 824k]
  |  Branch (277:24): [True: 0, False: 824k]
  ------------------
  278|      0|            return -1; /* Can't see outside of the current buffer */
  279|       |
  280|   824k|        bm->data = (num != 0) ? bo->data + num : bo->data;
  ------------------
  |  Branch (280:20): [True: 0, False: 824k]
  ------------------
  281|   824k|        bm->length = bo->length - num;
  282|   824k|        bm->max = bo->max - num;
  283|   824k|        off = (ossl_ssize_t)num;
  284|       |        /* FALLTHRU */
  285|  2.88M|    case BIO_C_FILE_TELL:
  ------------------
  |  |  468|  2.88M|#define BIO_C_FILE_TELL 133
  ------------------
  |  Branch (285:5): [True: 2.06M, False: 2.06M]
  ------------------
  286|  2.88M|        ret = (long)off;
  287|  2.88M|        if (off > LONG_MAX)
  ------------------
  |  Branch (287:13): [True: 0, False: 2.88M]
  ------------------
  288|      0|            ret = -1;
  289|  2.88M|        break;
  290|      0|    case BIO_CTRL_EOF:
  ------------------
  |  |   91|      0|#define BIO_CTRL_EOF 2 /* opt - are we at the eof */
  ------------------
  |  Branch (290:5): [True: 0, False: 4.12M]
  ------------------
  291|      0|        ret = (long)(bm->length == 0);
  292|      0|        break;
  293|      0|    case BIO_C_SET_BUF_MEM_EOF_RETURN:
  ------------------
  |  |  464|      0|#define BIO_C_SET_BUF_MEM_EOF_RETURN 130 /* return end of input \
  ------------------
  |  Branch (293:5): [True: 0, False: 4.12M]
  ------------------
  294|      0|        b->num = (int)num;
  295|      0|        break;
  296|   824k|    case BIO_CTRL_INFO:
  ------------------
  |  |   92|   824k|#define BIO_CTRL_INFO 3 /* opt - extra tit-bits */
  ------------------
  |  Branch (296:5): [True: 824k, False: 3.30M]
  ------------------
  297|   824k|        ret = (long)bm->length;
  298|   824k|        if (ptr != NULL) {
  ------------------
  |  Branch (298:13): [True: 412k, False: 412k]
  ------------------
  299|   412k|            pptr = (char **)ptr;
  300|   412k|            *pptr = (char *)(bm->data);
  301|   412k|        }
  302|   824k|        break;
  303|      0|    case BIO_C_SET_BUF_MEM:
  ------------------
  |  |  448|      0|#define BIO_C_SET_BUF_MEM 114
  ------------------
  |  Branch (303:5): [True: 0, False: 4.12M]
  ------------------
  304|      0|        mem_buf_free(b);
  305|      0|        b->shutdown = (int)num;
  306|      0|        bbm->buf = ptr;
  307|      0|        *bbm->readp = *bbm->buf;
  308|      0|        break;
  309|   412k|    case BIO_C_GET_BUF_MEM_PTR:
  ------------------
  |  |  449|   412k|#define BIO_C_GET_BUF_MEM_PTR 115
  ------------------
  |  Branch (309:5): [True: 412k, False: 3.71M]
  ------------------
  310|   412k|        if (ptr != NULL) {
  ------------------
  |  Branch (310:13): [True: 412k, False: 0]
  ------------------
  311|   412k|            if (!(b->flags & BIO_FLAGS_MEM_RDONLY))
  ------------------
  |  |  239|   412k|#define BIO_FLAGS_MEM_RDONLY 0x200
  ------------------
  |  Branch (311:17): [True: 412k, False: 0]
  ------------------
  312|   412k|                mem_buf_sync(b);
  313|   412k|            bm = bbm->buf;
  314|   412k|            pptr = (char **)ptr;
  315|   412k|            *pptr = (char *)bm;
  316|   412k|        }
  317|   412k|        break;
  318|      0|    case BIO_CTRL_GET_CLOSE:
  ------------------
  |  |   97|      0|#define BIO_CTRL_GET_CLOSE 8 /* man - set the 'close' on free */
  ------------------
  |  Branch (318:5): [True: 0, False: 4.12M]
  ------------------
  319|      0|        ret = (long)b->shutdown;
  320|      0|        break;
  321|  1.77k|    case BIO_CTRL_SET_CLOSE:
  ------------------
  |  |   98|  1.77k|#define BIO_CTRL_SET_CLOSE 9 /* man - set the 'close' on free */
  ------------------
  |  Branch (321:5): [True: 1.77k, False: 4.12M]
  ------------------
  322|  1.77k|        b->shutdown = (int)num;
  323|  1.77k|        break;
  324|      0|    case BIO_CTRL_WPENDING:
  ------------------
  |  |  102|      0|#define BIO_CTRL_WPENDING 13 /* opt - number of bytes still to write */
  ------------------
  |  Branch (324:5): [True: 0, False: 4.12M]
  ------------------
  325|      0|        ret = 0L;
  326|      0|        break;
  327|      0|    case BIO_CTRL_PENDING:
  ------------------
  |  |   99|      0|#define BIO_CTRL_PENDING 10 /* opt - is their more data buffered */
  ------------------
  |  Branch (327:5): [True: 0, False: 4.12M]
  ------------------
  328|      0|        ret = (long)bm->length;
  329|      0|        break;
  330|      0|    case BIO_CTRL_DUP:
  ------------------
  |  |  101|      0|#define BIO_CTRL_DUP 12 /* man - extra stuff for 'duped' BIO */
  ------------------
  |  Branch (330:5): [True: 0, False: 4.12M]
  ------------------
  331|      0|    case BIO_CTRL_FLUSH:
  ------------------
  |  |  100|      0|#define BIO_CTRL_FLUSH 11 /* opt - 'flush' buffered output */
  ------------------
  |  Branch (331:5): [True: 0, False: 4.12M]
  ------------------
  332|      0|        ret = 1;
  333|      0|        break;
  334|      0|    case BIO_CTRL_PUSH:
  ------------------
  |  |   95|      0|#define BIO_CTRL_PUSH 6 /* opt - internal, used to signify change */
  ------------------
  |  Branch (334:5): [True: 0, False: 4.12M]
  ------------------
  335|      0|    case BIO_CTRL_POP:
  ------------------
  |  |   96|      0|#define BIO_CTRL_POP 7 /* opt - internal, used to signify change */
  ------------------
  |  Branch (335:5): [True: 0, False: 4.12M]
  ------------------
  336|      0|    default:
  ------------------
  |  Branch (336:5): [True: 0, False: 4.12M]
  ------------------
  337|      0|        ret = 0;
  338|      0|        break;
  339|  4.12M|    }
  340|  4.12M|    return ret;
  341|  4.12M|}
bss_mem.c:mem_buf_free:
  158|  1.66M|{
  159|  1.66M|    if (a == NULL)
  ------------------
  |  Branch (159:9): [True: 0, False: 1.66M]
  ------------------
  160|      0|        return 0;
  161|       |
  162|  1.66M|    if (a->shutdown && a->init && a->ptr != NULL) {
  ------------------
  |  Branch (162:9): [True: 1.66M, False: 0]
  |  Branch (162:24): [True: 1.66M, False: 0]
  |  Branch (162:35): [True: 1.66M, False: 0]
  ------------------
  163|  1.66M|        BIO_BUF_MEM *bb = (BIO_BUF_MEM *)a->ptr;
  164|  1.66M|        BUF_MEM *b = bb->buf;
  165|       |
  166|  1.66M|        if (a->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  239|  1.66M|#define BIO_FLAGS_MEM_RDONLY 0x200
  ------------------
  |  Branch (166:13): [True: 824k, False: 842k]
  ------------------
  167|   824k|            b->data = NULL;
  168|  1.66M|        BUF_MEM_free(b);
  169|  1.66M|    }
  170|  1.66M|    return 1;
  171|  1.66M|}
bss_mem.c:mem_new:
  133|  1.66M|{
  134|  1.66M|    return mem_init(bi, 0L);
  135|  1.66M|}
bss_mem.c:mem_init:
  110|  1.66M|{
  111|  1.66M|    BIO_BUF_MEM *bb = OPENSSL_zalloc(sizeof(*bb));
  ------------------
  |  |  108|  1.66M|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  112|       |
  113|  1.66M|    if (bb == NULL)
  ------------------
  |  Branch (113:9): [True: 0, False: 1.66M]
  ------------------
  114|      0|        return 0;
  115|  1.66M|    if ((bb->buf = BUF_MEM_new_ex(flags)) == NULL) {
  ------------------
  |  Branch (115:9): [True: 0, False: 1.66M]
  ------------------
  116|      0|        OPENSSL_free(bb);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  117|      0|        return 0;
  118|      0|    }
  119|  1.66M|    if ((bb->readp = OPENSSL_zalloc(sizeof(*bb->readp))) == NULL) {
  ------------------
  |  |  108|  1.66M|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (119:9): [True: 0, False: 1.66M]
  ------------------
  120|      0|        BUF_MEM_free(bb->buf);
  121|      0|        OPENSSL_free(bb);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  122|      0|        return 0;
  123|      0|    }
  124|  1.66M|    *bb->readp = *bb->buf;
  125|  1.66M|    bi->shutdown = 1;
  126|  1.66M|    bi->init = 1;
  127|  1.66M|    bi->num = -1;
  128|  1.66M|    bi->ptr = (char *)bb;
  129|  1.66M|    return 1;
  130|  1.66M|}
bss_mem.c:mem_free:
  143|  1.66M|{
  144|  1.66M|    BIO_BUF_MEM *bb;
  145|       |
  146|  1.66M|    if (a == NULL)
  ------------------
  |  Branch (146:9): [True: 0, False: 1.66M]
  ------------------
  147|      0|        return 0;
  148|       |
  149|  1.66M|    bb = (BIO_BUF_MEM *)a->ptr;
  150|  1.66M|    if (!mem_buf_free(a))
  ------------------
  |  Branch (150:9): [True: 0, False: 1.66M]
  ------------------
  151|      0|        return 0;
  152|  1.66M|    OPENSSL_free(bb->readp);
  ------------------
  |  |  131|  1.66M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  153|  1.66M|    OPENSSL_free(bb);
  ------------------
  |  |  131|  1.66M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  154|  1.66M|    return 1;
  155|  1.66M|}

ossl_core_bio_up_ref:
   35|   824k|{
   36|   824k|    int ref = 0;
   37|       |
   38|   824k|    return CRYPTO_UP_REF(&cb->ref_cnt, &ref);
   39|   824k|}
ossl_core_bio_free:
   42|  2.06M|{
   43|  2.06M|    int ref = 0, res = 1;
   44|       |
   45|  2.06M|    if (cb != NULL) {
  ------------------
  |  Branch (45:9): [True: 1.64M, False: 412k]
  ------------------
   46|  1.64M|        CRYPTO_DOWN_REF(&cb->ref_cnt, &ref);
   47|  1.64M|        if (ref <= 0) {
  ------------------
  |  Branch (47:13): [True: 824k, False: 824k]
  ------------------
   48|   824k|            res = BIO_free(cb->bio);
   49|   824k|            CRYPTO_FREE_REF(&cb->ref_cnt);
   50|   824k|            OPENSSL_free(cb);
  ------------------
  |  |  131|   824k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   51|   824k|        }
   52|  1.64M|    }
   53|  2.06M|    return res;
   54|  2.06M|}
ossl_core_bio_new_from_bio:
   57|   824k|{
   58|   824k|    OSSL_CORE_BIO *cb = core_bio_new();
   59|       |
   60|   824k|    if (cb == NULL || !BIO_up_ref(bio)) {
  ------------------
  |  Branch (60:9): [True: 0, False: 824k]
  |  Branch (60:23): [True: 0, False: 824k]
  ------------------
   61|      0|        ossl_core_bio_free(cb);
   62|      0|        return NULL;
   63|      0|    }
   64|   824k|    cb->bio = bio;
   65|   824k|    return cb;
   66|   824k|}
ossl_core_bio_read_ex:
   94|  1.64M|{
   95|  1.64M|    return BIO_read_ex(cb->bio, data, dlen, readbytes);
   96|  1.64M|}
ossl_core_bio.c:core_bio_new:
   24|   824k|{
   25|   824k|    OSSL_CORE_BIO *cb = OPENSSL_malloc(sizeof(*cb));
  ------------------
  |  |  106|   824k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|       |
   27|   824k|    if (cb == NULL || !CRYPTO_NEW_REF(&cb->ref_cnt, 1)) {
  ------------------
  |  Branch (27:9): [True: 0, False: 824k]
  |  Branch (27:23): [True: 0, False: 824k]
  ------------------
   28|      0|        OPENSSL_free(cb);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   29|      0|        return NULL;
   30|      0|    }
   31|   824k|    return cb;
   32|   824k|}

bn_mul_add_words:
  116|  2.70M|{
  117|  2.70M|    BN_ULONG c1 = 0;
  ------------------
  |  |   37|  2.70M|#define BN_ULONG unsigned long
  ------------------
  118|       |
  119|  2.70M|    if (num <= 0)
  ------------------
  |  Branch (119:9): [True: 0, False: 2.70M]
  ------------------
  120|      0|        return c1;
  121|       |
  122|  4.49M|    while (num & ~3) {
  ------------------
  |  Branch (122:12): [True: 1.79M, False: 2.70M]
  ------------------
  123|  1.79M|        mul_add(rp[0], ap[0], w, c1);
  ------------------
  |  |   77|  1.79M|    do {                              \
  |  |   78|  1.79M|        register BN_ULONG high, low;  \
  |  |   79|  1.79M|        asm("mulq %3"                 \
  |  |   80|  1.79M|            : "=a"(low), "=d"(high)   \
  |  |   81|  1.79M|            : "a"(word), "m"(a)       \
  |  |   82|  1.79M|            : "cc");                  \
  |  |   83|  1.79M|        asm("addq %2,%0; adcq %3,%1"  \
  |  |   84|  1.79M|            : "+r"(carry), "+d"(high) \
  |  |   85|  1.79M|            : "a"(low), "g"(0)        \
  |  |   86|  1.79M|            : "cc");                  \
  |  |   87|  1.79M|        asm("addq %2,%0; adcq %3,%1"  \
  |  |   88|  1.79M|            : "+m"(r), "+d"(high)     \
  |  |   89|  1.79M|            : "r"(carry), "g"(0)      \
  |  |   90|  1.79M|            : "cc");                  \
  |  |   91|  1.79M|        carry = high;                 \
  |  |   92|  1.79M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (92:14): [Folded, False: 1.79M]
  |  |  ------------------
  ------------------
  124|  1.79M|        mul_add(rp[1], ap[1], w, c1);
  ------------------
  |  |   77|  1.79M|    do {                              \
  |  |   78|  1.79M|        register BN_ULONG high, low;  \
  |  |   79|  1.79M|        asm("mulq %3"                 \
  |  |   80|  1.79M|            : "=a"(low), "=d"(high)   \
  |  |   81|  1.79M|            : "a"(word), "m"(a)       \
  |  |   82|  1.79M|            : "cc");                  \
  |  |   83|  1.79M|        asm("addq %2,%0; adcq %3,%1"  \
  |  |   84|  1.79M|            : "+r"(carry), "+d"(high) \
  |  |   85|  1.79M|            : "a"(low), "g"(0)        \
  |  |   86|  1.79M|            : "cc");                  \
  |  |   87|  1.79M|        asm("addq %2,%0; adcq %3,%1"  \
  |  |   88|  1.79M|            : "+m"(r), "+d"(high)     \
  |  |   89|  1.79M|            : "r"(carry), "g"(0)      \
  |  |   90|  1.79M|            : "cc");                  \
  |  |   91|  1.79M|        carry = high;                 \
  |  |   92|  1.79M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (92:14): [Folded, False: 1.79M]
  |  |  ------------------
  ------------------
  125|  1.79M|        mul_add(rp[2], ap[2], w, c1);
  ------------------
  |  |   77|  1.79M|    do {                              \
  |  |   78|  1.79M|        register BN_ULONG high, low;  \
  |  |   79|  1.79M|        asm("mulq %3"                 \
  |  |   80|  1.79M|            : "=a"(low), "=d"(high)   \
  |  |   81|  1.79M|            : "a"(word), "m"(a)       \
  |  |   82|  1.79M|            : "cc");                  \
  |  |   83|  1.79M|        asm("addq %2,%0; adcq %3,%1"  \
  |  |   84|  1.79M|            : "+r"(carry), "+d"(high) \
  |  |   85|  1.79M|            : "a"(low), "g"(0)        \
  |  |   86|  1.79M|            : "cc");                  \
  |  |   87|  1.79M|        asm("addq %2,%0; adcq %3,%1"  \
  |  |   88|  1.79M|            : "+m"(r), "+d"(high)     \
  |  |   89|  1.79M|            : "r"(carry), "g"(0)      \
  |  |   90|  1.79M|            : "cc");                  \
  |  |   91|  1.79M|        carry = high;                 \
  |  |   92|  1.79M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (92:14): [Folded, False: 1.79M]
  |  |  ------------------
  ------------------
  126|  1.79M|        mul_add(rp[3], ap[3], w, c1);
  ------------------
  |  |   77|  1.79M|    do {                              \
  |  |   78|  1.79M|        register BN_ULONG high, low;  \
  |  |   79|  1.79M|        asm("mulq %3"                 \
  |  |   80|  1.79M|            : "=a"(low), "=d"(high)   \
  |  |   81|  1.79M|            : "a"(word), "m"(a)       \
  |  |   82|  1.79M|            : "cc");                  \
  |  |   83|  1.79M|        asm("addq %2,%0; adcq %3,%1"  \
  |  |   84|  1.79M|            : "+r"(carry), "+d"(high) \
  |  |   85|  1.79M|            : "a"(low), "g"(0)        \
  |  |   86|  1.79M|            : "cc");                  \
  |  |   87|  1.79M|        asm("addq %2,%0; adcq %3,%1"  \
  |  |   88|  1.79M|            : "+m"(r), "+d"(high)     \
  |  |   89|  1.79M|            : "r"(carry), "g"(0)      \
  |  |   90|  1.79M|            : "cc");                  \
  |  |   91|  1.79M|        carry = high;                 \
  |  |   92|  1.79M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (92:14): [Folded, False: 1.79M]
  |  |  ------------------
  ------------------
  127|  1.79M|        ap += 4;
  128|  1.79M|        rp += 4;
  129|  1.79M|        num -= 4;
  130|  1.79M|    }
  131|  2.70M|    if (num) {
  ------------------
  |  Branch (131:9): [True: 2.23M, False: 470k]
  ------------------
  132|  2.23M|        mul_add(rp[0], ap[0], w, c1);
  ------------------
  |  |   77|  2.23M|    do {                              \
  |  |   78|  2.23M|        register BN_ULONG high, low;  \
  |  |   79|  2.23M|        asm("mulq %3"                 \
  |  |   80|  2.23M|            : "=a"(low), "=d"(high)   \
  |  |   81|  2.23M|            : "a"(word), "m"(a)       \
  |  |   82|  2.23M|            : "cc");                  \
  |  |   83|  2.23M|        asm("addq %2,%0; adcq %3,%1"  \
  |  |   84|  2.23M|            : "+r"(carry), "+d"(high) \
  |  |   85|  2.23M|            : "a"(low), "g"(0)        \
  |  |   86|  2.23M|            : "cc");                  \
  |  |   87|  2.23M|        asm("addq %2,%0; adcq %3,%1"  \
  |  |   88|  2.23M|            : "+m"(r), "+d"(high)     \
  |  |   89|  2.23M|            : "r"(carry), "g"(0)      \
  |  |   90|  2.23M|            : "cc");                  \
  |  |   91|  2.23M|        carry = high;                 \
  |  |   92|  2.23M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (92:14): [Folded, False: 2.23M]
  |  |  ------------------
  ------------------
  133|  2.23M|        if (--num == 0)
  ------------------
  |  Branch (133:13): [True: 406k, False: 1.83M]
  ------------------
  134|   406k|            return c1;
  135|  1.83M|        mul_add(rp[1], ap[1], w, c1);
  ------------------
  |  |   77|  1.83M|    do {                              \
  |  |   78|  1.83M|        register BN_ULONG high, low;  \
  |  |   79|  1.83M|        asm("mulq %3"                 \
  |  |   80|  1.83M|            : "=a"(low), "=d"(high)   \
  |  |   81|  1.83M|            : "a"(word), "m"(a)       \
  |  |   82|  1.83M|            : "cc");                  \
  |  |   83|  1.83M|        asm("addq %2,%0; adcq %3,%1"  \
  |  |   84|  1.83M|            : "+r"(carry), "+d"(high) \
  |  |   85|  1.83M|            : "a"(low), "g"(0)        \
  |  |   86|  1.83M|            : "cc");                  \
  |  |   87|  1.83M|        asm("addq %2,%0; adcq %3,%1"  \
  |  |   88|  1.83M|            : "+m"(r), "+d"(high)     \
  |  |   89|  1.83M|            : "r"(carry), "g"(0)      \
  |  |   90|  1.83M|            : "cc");                  \
  |  |   91|  1.83M|        carry = high;                 \
  |  |   92|  1.83M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (92:14): [Folded, False: 1.83M]
  |  |  ------------------
  ------------------
  136|  1.83M|        if (--num == 0)
  ------------------
  |  Branch (136:13): [True: 1.42M, False: 406k]
  ------------------
  137|  1.42M|            return c1;
  138|   406k|        mul_add(rp[2], ap[2], w, c1);
  ------------------
  |  |   77|   406k|    do {                              \
  |  |   78|   406k|        register BN_ULONG high, low;  \
  |  |   79|   406k|        asm("mulq %3"                 \
  |  |   80|   406k|            : "=a"(low), "=d"(high)   \
  |  |   81|   406k|            : "a"(word), "m"(a)       \
  |  |   82|   406k|            : "cc");                  \
  |  |   83|   406k|        asm("addq %2,%0; adcq %3,%1"  \
  |  |   84|   406k|            : "+r"(carry), "+d"(high) \
  |  |   85|   406k|            : "a"(low), "g"(0)        \
  |  |   86|   406k|            : "cc");                  \
  |  |   87|   406k|        asm("addq %2,%0; adcq %3,%1"  \
  |  |   88|   406k|            : "+m"(r), "+d"(high)     \
  |  |   89|   406k|            : "r"(carry), "g"(0)      \
  |  |   90|   406k|            : "cc");                  \
  |  |   91|   406k|        carry = high;                 \
  |  |   92|   406k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (92:14): [Folded, False: 406k]
  |  |  ------------------
  ------------------
  139|   406k|        return c1;
  140|  1.83M|    }
  141|       |
  142|   470k|    return c1;
  143|  2.70M|}
bn_mul_words:
  146|  2.96M|{
  147|  2.96M|    BN_ULONG c1 = 0;
  ------------------
  |  |   37|  2.96M|#define BN_ULONG unsigned long
  ------------------
  148|       |
  149|  2.96M|    if (num <= 0)
  ------------------
  |  Branch (149:9): [True: 0, False: 2.96M]
  ------------------
  150|      0|        return c1;
  151|       |
  152|  5.46M|    while (num & ~3) {
  ------------------
  |  Branch (152:12): [True: 2.50M, False: 2.96M]
  ------------------
  153|  2.50M|        mul(rp[0], ap[0], w, c1);
  ------------------
  |  |   95|  2.50M|    do {                              \
  |  |   96|  2.50M|        register BN_ULONG high, low;  \
  |  |   97|  2.50M|        asm("mulq %3"                 \
  |  |   98|  2.50M|            : "=a"(low), "=d"(high)   \
  |  |   99|  2.50M|            : "a"(word), "g"(a)       \
  |  |  100|  2.50M|            : "cc");                  \
  |  |  101|  2.50M|        asm("addq %2,%0; adcq %3,%1"  \
  |  |  102|  2.50M|            : "+r"(carry), "+d"(high) \
  |  |  103|  2.50M|            : "a"(low), "g"(0)        \
  |  |  104|  2.50M|            : "cc");                  \
  |  |  105|  2.50M|        (r) = carry, carry = high;    \
  |  |  106|  2.50M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (106:14): [Folded, False: 2.50M]
  |  |  ------------------
  ------------------
  154|  2.50M|        mul(rp[1], ap[1], w, c1);
  ------------------
  |  |   95|  2.50M|    do {                              \
  |  |   96|  2.50M|        register BN_ULONG high, low;  \
  |  |   97|  2.50M|        asm("mulq %3"                 \
  |  |   98|  2.50M|            : "=a"(low), "=d"(high)   \
  |  |   99|  2.50M|            : "a"(word), "g"(a)       \
  |  |  100|  2.50M|            : "cc");                  \
  |  |  101|  2.50M|        asm("addq %2,%0; adcq %3,%1"  \
  |  |  102|  2.50M|            : "+r"(carry), "+d"(high) \
  |  |  103|  2.50M|            : "a"(low), "g"(0)        \
  |  |  104|  2.50M|            : "cc");                  \
  |  |  105|  2.50M|        (r) = carry, carry = high;    \
  |  |  106|  2.50M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (106:14): [Folded, False: 2.50M]
  |  |  ------------------
  ------------------
  155|  2.50M|        mul(rp[2], ap[2], w, c1);
  ------------------
  |  |   95|  2.50M|    do {                              \
  |  |   96|  2.50M|        register BN_ULONG high, low;  \
  |  |   97|  2.50M|        asm("mulq %3"                 \
  |  |   98|  2.50M|            : "=a"(low), "=d"(high)   \
  |  |   99|  2.50M|            : "a"(word), "g"(a)       \
  |  |  100|  2.50M|            : "cc");                  \
  |  |  101|  2.50M|        asm("addq %2,%0; adcq %3,%1"  \
  |  |  102|  2.50M|            : "+r"(carry), "+d"(high) \
  |  |  103|  2.50M|            : "a"(low), "g"(0)        \
  |  |  104|  2.50M|            : "cc");                  \
  |  |  105|  2.50M|        (r) = carry, carry = high;    \
  |  |  106|  2.50M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (106:14): [Folded, False: 2.50M]
  |  |  ------------------
  ------------------
  156|  2.50M|        mul(rp[3], ap[3], w, c1);
  ------------------
  |  |   95|  2.50M|    do {                              \
  |  |   96|  2.50M|        register BN_ULONG high, low;  \
  |  |   97|  2.50M|        asm("mulq %3"                 \
  |  |   98|  2.50M|            : "=a"(low), "=d"(high)   \
  |  |   99|  2.50M|            : "a"(word), "g"(a)       \
  |  |  100|  2.50M|            : "cc");                  \
  |  |  101|  2.50M|        asm("addq %2,%0; adcq %3,%1"  \
  |  |  102|  2.50M|            : "+r"(carry), "+d"(high) \
  |  |  103|  2.50M|            : "a"(low), "g"(0)        \
  |  |  104|  2.50M|            : "cc");                  \
  |  |  105|  2.50M|        (r) = carry, carry = high;    \
  |  |  106|  2.50M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (106:14): [Folded, False: 2.50M]
  |  |  ------------------
  ------------------
  157|  2.50M|        ap += 4;
  158|  2.50M|        rp += 4;
  159|  2.50M|        num -= 4;
  160|  2.50M|    }
  161|  2.96M|    if (num) {
  ------------------
  |  Branch (161:9): [True: 2.84M, False: 111k]
  ------------------
  162|  2.84M|        mul(rp[0], ap[0], w, c1);
  ------------------
  |  |   95|  2.84M|    do {                              \
  |  |   96|  2.84M|        register BN_ULONG high, low;  \
  |  |   97|  2.84M|        asm("mulq %3"                 \
  |  |   98|  2.84M|            : "=a"(low), "=d"(high)   \
  |  |   99|  2.84M|            : "a"(word), "g"(a)       \
  |  |  100|  2.84M|            : "cc");                  \
  |  |  101|  2.84M|        asm("addq %2,%0; adcq %3,%1"  \
  |  |  102|  2.84M|            : "+r"(carry), "+d"(high) \
  |  |  103|  2.84M|            : "a"(low), "g"(0)        \
  |  |  104|  2.84M|            : "cc");                  \
  |  |  105|  2.84M|        (r) = carry, carry = high;    \
  |  |  106|  2.84M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (106:14): [Folded, False: 2.84M]
  |  |  ------------------
  ------------------
  163|  2.84M|        if (--num == 0)
  ------------------
  |  Branch (163:13): [True: 1.01M, False: 1.83M]
  ------------------
  164|  1.01M|            return c1;
  165|  1.83M|        mul(rp[1], ap[1], w, c1);
  ------------------
  |  |   95|  1.83M|    do {                              \
  |  |   96|  1.83M|        register BN_ULONG high, low;  \
  |  |   97|  1.83M|        asm("mulq %3"                 \
  |  |   98|  1.83M|            : "=a"(low), "=d"(high)   \
  |  |   99|  1.83M|            : "a"(word), "g"(a)       \
  |  |  100|  1.83M|            : "cc");                  \
  |  |  101|  1.83M|        asm("addq %2,%0; adcq %3,%1"  \
  |  |  102|  1.83M|            : "+r"(carry), "+d"(high) \
  |  |  103|  1.83M|            : "a"(low), "g"(0)        \
  |  |  104|  1.83M|            : "cc");                  \
  |  |  105|  1.83M|        (r) = carry, carry = high;    \
  |  |  106|  1.83M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (106:14): [Folded, False: 1.83M]
  |  |  ------------------
  ------------------
  166|  1.83M|        if (--num == 0)
  ------------------
  |  Branch (166:13): [True: 1.83M, False: 0]
  ------------------
  167|  1.83M|            return c1;
  168|      0|        mul(rp[2], ap[2], w, c1);
  ------------------
  |  |   95|      0|    do {                              \
  |  |   96|      0|        register BN_ULONG high, low;  \
  |  |   97|      0|        asm("mulq %3"                 \
  |  |   98|      0|            : "=a"(low), "=d"(high)   \
  |  |   99|      0|            : "a"(word), "g"(a)       \
  |  |  100|      0|            : "cc");                  \
  |  |  101|      0|        asm("addq %2,%0; adcq %3,%1"  \
  |  |  102|      0|            : "+r"(carry), "+d"(high) \
  |  |  103|      0|            : "a"(low), "g"(0)        \
  |  |  104|      0|            : "cc");                  \
  |  |  105|      0|        (r) = carry, carry = high;    \
  |  |  106|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (106:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  169|      0|    }
  170|   111k|    return c1;
  171|  2.96M|}
bn_sqr_words:
  174|   406k|{
  175|   406k|    if (n <= 0)
  ------------------
  |  Branch (175:9): [True: 0, False: 406k]
  ------------------
  176|      0|        return;
  177|       |
  178|   813k|    while (n & ~3) {
  ------------------
  |  Branch (178:12): [True: 406k, False: 406k]
  ------------------
  179|   406k|        sqr(r[0], r[1], a[0]);
  ------------------
  |  |  109|   406k|    asm("mulq %2"            \
  |  |  110|   406k|        : "=a"(r0), "=d"(r1) \
  |  |  111|   406k|        : "a"(a)             \
  |  |  112|   406k|        : "cc");
  ------------------
  180|   406k|        sqr(r[2], r[3], a[1]);
  ------------------
  |  |  109|   406k|    asm("mulq %2"            \
  |  |  110|   406k|        : "=a"(r0), "=d"(r1) \
  |  |  111|   406k|        : "a"(a)             \
  |  |  112|   406k|        : "cc");
  ------------------
  181|   406k|        sqr(r[4], r[5], a[2]);
  ------------------
  |  |  109|   406k|    asm("mulq %2"            \
  |  |  110|   406k|        : "=a"(r0), "=d"(r1) \
  |  |  111|   406k|        : "a"(a)             \
  |  |  112|   406k|        : "cc");
  ------------------
  182|   406k|        sqr(r[6], r[7], a[3]);
  ------------------
  |  |  109|   406k|    asm("mulq %2"            \
  |  |  110|   406k|        : "=a"(r0), "=d"(r1) \
  |  |  111|   406k|        : "a"(a)             \
  |  |  112|   406k|        : "cc");
  ------------------
  183|   406k|        a += 4;
  184|   406k|        r += 8;
  185|   406k|        n -= 4;
  186|   406k|    }
  187|   406k|    if (n) {
  ------------------
  |  Branch (187:9): [True: 406k, False: 0]
  ------------------
  188|   406k|        sqr(r[0], r[1], a[0]);
  ------------------
  |  |  109|   406k|    asm("mulq %2"            \
  |  |  110|   406k|        : "=a"(r0), "=d"(r1) \
  |  |  111|   406k|        : "a"(a)             \
  |  |  112|   406k|        : "cc");
  ------------------
  189|   406k|        if (--n == 0)
  ------------------
  |  Branch (189:13): [True: 26, False: 406k]
  ------------------
  190|     26|            return;
  191|   406k|        sqr(r[2], r[3], a[1]);
  ------------------
  |  |  109|   406k|    asm("mulq %2"            \
  |  |  110|   406k|        : "=a"(r0), "=d"(r1) \
  |  |  111|   406k|        : "a"(a)             \
  |  |  112|   406k|        : "cc");
  ------------------
  192|   406k|        if (--n == 0)
  ------------------
  |  Branch (192:13): [True: 406k, False: 0]
  ------------------
  193|   406k|            return;
  194|      0|        sqr(r[4], r[5], a[2]);
  ------------------
  |  |  109|      0|    asm("mulq %2"            \
  |  |  110|      0|        : "=a"(r0), "=d"(r1) \
  |  |  111|      0|        : "a"(a)             \
  |  |  112|      0|        : "cc");
  ------------------
  195|      0|    }
  196|   406k|}
bn_div_words:
  199|  2.33M|{
  200|  2.33M|    BN_ULONG ret, waste;
  ------------------
  |  |   37|  2.33M|#define BN_ULONG unsigned long
  ------------------
  201|       |
  202|  2.33M|    asm("divq      %4" : "=a"(ret), "=d"(waste)
  203|  2.33M|        : "a"(l), "d"(h), "r"(d)
  204|  2.33M|        : "cc");
  205|       |
  206|  2.33M|    return ret;
  207|  2.33M|}
bn_add_words:
  211|  12.8M|{
  212|  12.8M|    BN_ULONG ret;
  ------------------
  |  |   37|  12.8M|#define BN_ULONG unsigned long
  ------------------
  213|  12.8M|    size_t i = 0;
  214|       |
  215|  12.8M|    if (n <= 0)
  ------------------
  |  Branch (215:9): [True: 102k, False: 12.7M]
  ------------------
  216|   102k|        return 0;
  217|       |
  218|  12.7M|    asm volatile("       subq    %0,%0           \n" /* clear carry */
  219|  12.7M|                 "       jmp     1f              \n"
  220|  12.7M|                 ".p2align 4                     \n"
  221|  12.7M|                 "1:     movq    (%4,%2,8),%0    \n"
  222|  12.7M|                 "       adcq    (%5,%2,8),%0    \n"
  223|  12.7M|                 "       movq    %0,(%3,%2,8)    \n"
  224|  12.7M|                 "       lea     1(%2),%2        \n"
  225|  12.7M|                 "       dec     %1              \n"
  226|  12.7M|                 "       jnz     1b              \n"
  227|  12.7M|                 "       sbbq    %0,%0           \n"
  228|  12.7M|        : "=&r"(ret), "+c"(n), "+r"(i)
  229|  12.7M|        : "r"(rp), "r"(ap), "r"(bp)
  230|  12.7M|        : "cc", "memory");
  231|       |
  232|  12.7M|    return ret & 1;
  233|  12.8M|}
bn_sub_words:
  238|  11.6M|{
  239|  11.6M|    BN_ULONG ret;
  ------------------
  |  |   37|  11.6M|#define BN_ULONG unsigned long
  ------------------
  240|  11.6M|    size_t i = 0;
  241|       |
  242|  11.6M|    if (n <= 0)
  ------------------
  |  Branch (242:9): [True: 0, False: 11.6M]
  ------------------
  243|      0|        return 0;
  244|       |
  245|  11.6M|    asm volatile("       subq    %0,%0           \n" /* clear borrow */
  246|  11.6M|                 "       jmp     1f              \n"
  247|  11.6M|                 ".p2align 4                     \n"
  248|  11.6M|                 "1:     movq    (%4,%2,8),%0    \n"
  249|  11.6M|                 "       sbbq    (%5,%2,8),%0    \n"
  250|  11.6M|                 "       movq    %0,(%3,%2,8)    \n"
  251|  11.6M|                 "       lea     1(%2),%2        \n"
  252|  11.6M|                 "       dec     %1              \n"
  253|  11.6M|                 "       jnz     1b              \n"
  254|  11.6M|                 "       sbbq    %0,%0           \n"
  255|  11.6M|        : "=&r"(ret), "+c"(n), "+r"(i)
  256|  11.6M|        : "r"(rp), "r"(ap), "r"(bp)
  257|  11.6M|        : "cc", "memory");
  258|       |
  259|  11.6M|    return ret & 1;
  260|  11.6M|}

BN_add:
   15|   299k|{
   16|   299k|    int ret, r_neg, cmp_res;
   17|       |
   18|   299k|    bn_check_top(a);
   19|   299k|    bn_check_top(b);
   20|       |
   21|   299k|    if (a->neg == b->neg) {
  ------------------
  |  Branch (21:9): [True: 288, False: 299k]
  ------------------
   22|    288|        r_neg = a->neg;
   23|    288|        ret = BN_uadd(r, a, b);
   24|   299k|    } else {
   25|   299k|        cmp_res = BN_ucmp(a, b);
   26|   299k|        if (cmp_res > 0) {
  ------------------
  |  Branch (26:13): [True: 0, False: 299k]
  ------------------
   27|      0|            r_neg = a->neg;
   28|      0|            ret = BN_usub(r, a, b);
   29|   299k|        } else if (cmp_res < 0) {
  ------------------
  |  Branch (29:20): [True: 299k, False: 0]
  ------------------
   30|   299k|            r_neg = b->neg;
   31|   299k|            ret = BN_usub(r, b, a);
   32|   299k|        } else {
   33|      0|            r_neg = 0;
   34|      0|            BN_zero(r);
  ------------------
  |  |  201|      0|#define BN_zero(a) BN_zero_ex(a)
  ------------------
   35|      0|            ret = 1;
   36|      0|        }
   37|   299k|    }
   38|       |
   39|   299k|    r->neg = r_neg;
   40|   299k|    bn_check_top(r);
   41|   299k|    return ret;
   42|   299k|}
BN_sub:
   46|   621k|{
   47|   621k|    int ret, r_neg, cmp_res;
   48|       |
   49|   621k|    bn_check_top(a);
   50|   621k|    bn_check_top(b);
   51|       |
   52|   621k|    if (a->neg != b->neg) {
  ------------------
  |  Branch (52:9): [True: 0, False: 621k]
  ------------------
   53|      0|        r_neg = a->neg;
   54|      0|        ret = BN_uadd(r, a, b);
   55|   621k|    } else {
   56|   621k|        cmp_res = BN_ucmp(a, b);
   57|   621k|        if (cmp_res > 0) {
  ------------------
  |  Branch (57:13): [True: 322k, False: 299k]
  ------------------
   58|   322k|            r_neg = a->neg;
   59|   322k|            ret = BN_usub(r, a, b);
   60|   322k|        } else if (cmp_res < 0) {
  ------------------
  |  Branch (60:20): [True: 299k, False: 0]
  ------------------
   61|   299k|            r_neg = !b->neg;
   62|   299k|            ret = BN_usub(r, b, a);
   63|   299k|        } else {
   64|      0|            r_neg = 0;
   65|      0|            BN_zero(r);
  ------------------
  |  |  201|      0|#define BN_zero(a) BN_zero_ex(a)
  ------------------
   66|      0|            ret = 1;
   67|      0|        }
   68|   621k|    }
   69|       |
   70|   621k|    r->neg = r_neg;
   71|   621k|    bn_check_top(r);
   72|   621k|    return ret;
   73|   621k|}
BN_uadd:
   77|  9.69M|{
   78|  9.69M|    int max, min, dif;
   79|  9.69M|    const BN_ULONG *ap, *bp;
   80|  9.69M|    BN_ULONG *rp, carry, t1, t2;
  ------------------
  |  |   37|  9.69M|#define BN_ULONG unsigned long
  ------------------
   81|       |
   82|  9.69M|    bn_check_top(a);
   83|  9.69M|    bn_check_top(b);
   84|       |
   85|  9.69M|    if (a->top < b->top) {
  ------------------
  |  Branch (85:9): [True: 204k, False: 9.49M]
  ------------------
   86|   204k|        const BIGNUM *tmp;
   87|       |
   88|   204k|        tmp = a;
   89|   204k|        a = b;
   90|   204k|        b = tmp;
   91|   204k|    }
   92|  9.69M|    max = a->top;
   93|  9.69M|    min = b->top;
   94|  9.69M|    dif = max - min;
   95|       |
   96|  9.69M|    if (bn_wexpand(r, max + 1) == NULL)
  ------------------
  |  Branch (96:9): [True: 0, False: 9.69M]
  ------------------
   97|      0|        return 0;
   98|       |
   99|  9.69M|    r->top = max;
  100|       |
  101|  9.69M|    ap = a->d;
  102|  9.69M|    bp = b->d;
  103|  9.69M|    rp = r->d;
  104|       |
  105|  9.69M|    carry = bn_add_words(rp, ap, bp, min);
  106|  9.69M|    rp += min;
  107|  9.69M|    ap += min;
  108|       |
  109|  12.8M|    while (dif) {
  ------------------
  |  Branch (109:12): [True: 3.15M, False: 9.69M]
  ------------------
  110|  3.15M|        dif--;
  111|  3.15M|        t1 = *(ap++);
  112|  3.15M|        t2 = (t1 + carry) & BN_MASK2;
  ------------------
  |  |   93|  3.15M|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  113|  3.15M|        *(rp++) = t2;
  114|  3.15M|        carry &= (t2 == 0);
  115|  3.15M|    }
  116|  9.69M|    *rp = carry;
  117|  9.69M|    r->top += (int)carry;
  118|       |
  119|  9.69M|    r->neg = 0;
  120|  9.69M|    bn_check_top(r);
  121|  9.69M|    return 1;
  122|  9.69M|}
BN_usub:
  126|  7.45M|{
  127|  7.45M|    int max, min, dif;
  128|  7.45M|    BN_ULONG t1, t2, borrow, *rp;
  ------------------
  |  |   37|  7.45M|#define BN_ULONG unsigned long
  ------------------
  129|  7.45M|    const BN_ULONG *ap, *bp;
  130|       |
  131|  7.45M|    bn_check_top(a);
  132|  7.45M|    bn_check_top(b);
  133|       |
  134|  7.45M|    max = a->top;
  135|  7.45M|    min = b->top;
  136|  7.45M|    dif = max - min;
  137|       |
  138|  7.45M|    if (dif < 0) { /* hmm... should not be happening */
  ------------------
  |  Branch (138:9): [True: 0, False: 7.45M]
  ------------------
  139|      0|        ERR_raise(ERR_LIB_BN, BN_R_ARG2_LT_ARG3);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  140|      0|        return 0;
  141|      0|    }
  142|       |
  143|  7.45M|    if (bn_wexpand(r, max) == NULL)
  ------------------
  |  Branch (143:9): [True: 0, False: 7.45M]
  ------------------
  144|      0|        return 0;
  145|       |
  146|  7.45M|    ap = a->d;
  147|  7.45M|    bp = b->d;
  148|  7.45M|    rp = r->d;
  149|       |
  150|  7.45M|    borrow = bn_sub_words(rp, ap, bp, min);
  151|  7.45M|    ap += min;
  152|  7.45M|    rp += min;
  153|       |
  154|  7.59M|    while (dif) {
  ------------------
  |  Branch (154:12): [True: 140k, False: 7.45M]
  ------------------
  155|   140k|        dif--;
  156|   140k|        t1 = *(ap++);
  157|   140k|        t2 = (t1 - borrow) & BN_MASK2;
  ------------------
  |  |   93|   140k|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  158|   140k|        *(rp++) = t2;
  159|   140k|        borrow &= (t1 == 0);
  160|   140k|    }
  161|       |
  162|  7.59M|    while (max && *--rp == 0)
  ------------------
  |  Branch (162:12): [True: 7.49M, False: 102k]
  |  Branch (162:19): [True: 139k, False: 7.35M]
  ------------------
  163|   139k|        max--;
  164|       |
  165|  7.45M|    r->top = max;
  166|  7.45M|    r->neg = 0;
  167|  7.45M|    bn_pollute(r);
  168|       |
  169|  7.45M|    return 1;
  170|  7.45M|}

BN_CTX_new_ex:
  123|   566k|{
  124|   566k|    BN_CTX *ret;
  125|       |
  126|   566k|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  108|   566k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (126:9): [True: 0, False: 566k]
  ------------------
  127|      0|        return NULL;
  128|       |    /* Initialise the structure */
  129|   566k|    BN_POOL_init(&ret->pool);
  130|   566k|    BN_STACK_init(&ret->stack);
  131|   566k|    ret->libctx = ctx;
  132|   566k|    return ret;
  133|   566k|}
BN_CTX_secure_new_ex:
  143|    226|{
  144|    226|    BN_CTX *ret = BN_CTX_new_ex(ctx);
  145|       |
  146|    226|    if (ret != NULL)
  ------------------
  |  Branch (146:9): [True: 226, False: 0]
  ------------------
  147|    226|        ret->flags = BN_FLG_SECURE;
  ------------------
  |  |   68|    226|#define BN_FLG_SECURE 0x08
  ------------------
  148|    226|    return ret;
  149|    226|}
BN_CTX_free:
  159|  1.94M|{
  160|  1.94M|    if (ctx == NULL)
  ------------------
  |  Branch (160:9): [True: 1.38M, False: 566k]
  ------------------
  161|  1.38M|        return;
  162|   566k|#ifndef FIPS_MODULE
  163|   566k|    OSSL_TRACE_BEGIN(BN_CTX)
  ------------------
  |  |  221|   566k|    do {                           \
  |  |  222|   566k|        BIO *trc_out = NULL;       \
  |  |  223|   566k|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 566k]
  |  |  ------------------
  ------------------
  164|      0|    {
  165|      0|        BN_POOL_ITEM *pool = ctx->pool.head;
  166|      0|        BIO_printf(trc_out,
  167|      0|            "BN_CTX_free(): stack-size=%d, pool-bignums=%d\n",
  168|      0|            ctx->stack.size, ctx->pool.size);
  169|      0|        BIO_printf(trc_out, "  dmaxs: ");
  170|      0|        while (pool) {
  ------------------
  |  Branch (170:16): [True: 0, False: 0]
  ------------------
  171|      0|            unsigned loop = 0;
  172|      0|            while (loop < BN_CTX_POOL_SIZE)
  ------------------
  |  |   15|      0|#define BN_CTX_POOL_SIZE 16
  ------------------
  |  Branch (172:20): [True: 0, False: 0]
  ------------------
  173|      0|                BIO_printf(trc_out, "%02x ", pool->vals[loop++].dmax);
  174|      0|            pool = pool->next;
  175|      0|        }
  176|      0|        BIO_printf(trc_out, "\n");
  177|      0|    }
  178|   566k|    OSSL_TRACE_END(BN_CTX);
  ------------------
  |  |  226|   566k|    }                            \
  |  |  227|   566k|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 566k]
  |  |  ------------------
  ------------------
  179|   566k|#endif
  180|   566k|    BN_STACK_finish(&ctx->stack);
  181|   566k|    BN_POOL_finish(&ctx->pool);
  182|   566k|    OPENSSL_free(ctx);
  ------------------
  |  |  131|   566k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  183|   566k|}
BN_CTX_start:
  186|  2.88M|{
  187|  2.88M|    CTXDBG("ENTER BN_CTX_start()", ctx);
  ------------------
  |  |  110|  2.88M|    OSSL_TRACE_BEGIN(BN_CTX)       \
  |  |  ------------------
  |  |  |  |  221|  2.88M|    do {                           \
  |  |  |  |  222|  2.88M|        BIO *trc_out = NULL;       \
  |  |  |  |  223|  2.88M|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (223:13): [Folded, False: 2.88M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|  2.88M|    {                              \
  |  |  112|      0|        ctxdbg(trc_out, str, ctx); \
  |  |  113|      0|    }                              \
  |  |  114|  2.88M|    OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  226|  2.88M|    }                            \
  |  |  |  |  227|  2.88M|    while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (227:12): [Folded, False: 2.88M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  188|       |    /* If we're already overflowing ... */
  189|  2.88M|    if (ctx->err_stack || ctx->too_many)
  ------------------
  |  Branch (189:9): [True: 0, False: 2.88M]
  |  Branch (189:27): [True: 0, False: 2.88M]
  ------------------
  190|      0|        ctx->err_stack++;
  191|       |    /* (Try to) get a new frame pointer */
  192|  2.88M|    else if (!BN_STACK_push(&ctx->stack, ctx->used)) {
  ------------------
  |  Branch (192:14): [True: 0, False: 2.88M]
  ------------------
  193|      0|        ERR_raise(ERR_LIB_BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  194|      0|        ctx->err_stack++;
  195|      0|    }
  196|       |    CTXDBG("LEAVE BN_CTX_start()", ctx);
  ------------------
  |  |  110|  2.88M|    OSSL_TRACE_BEGIN(BN_CTX)       \
  |  |  ------------------
  |  |  |  |  221|  2.88M|    do {                           \
  |  |  |  |  222|  2.88M|        BIO *trc_out = NULL;       \
  |  |  |  |  223|  2.88M|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (223:13): [Folded, False: 2.88M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|  2.88M|    {                              \
  |  |  112|      0|        ctxdbg(trc_out, str, ctx); \
  |  |  113|      0|    }                              \
  |  |  114|  2.88M|    OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  226|  2.88M|    }                            \
  |  |  |  |  227|  2.88M|    while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (227:12): [Folded, False: 2.88M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|  2.88M|}
BN_CTX_end:
  200|  2.88M|{
  201|  2.88M|    if (ctx == NULL)
  ------------------
  |  Branch (201:9): [True: 0, False: 2.88M]
  ------------------
  202|      0|        return;
  203|  2.88M|    CTXDBG("ENTER BN_CTX_end()", ctx);
  ------------------
  |  |  110|  2.88M|    OSSL_TRACE_BEGIN(BN_CTX)       \
  |  |  ------------------
  |  |  |  |  221|  2.88M|    do {                           \
  |  |  |  |  222|  2.88M|        BIO *trc_out = NULL;       \
  |  |  |  |  223|  2.88M|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (223:13): [Folded, False: 2.88M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|  2.88M|    {                              \
  |  |  112|      0|        ctxdbg(trc_out, str, ctx); \
  |  |  113|      0|    }                              \
  |  |  114|  2.88M|    OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  226|  2.88M|    }                            \
  |  |  |  |  227|  2.88M|    while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (227:12): [Folded, False: 2.88M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  204|  2.88M|    if (ctx->err_stack)
  ------------------
  |  Branch (204:9): [True: 0, False: 2.88M]
  ------------------
  205|      0|        ctx->err_stack--;
  206|  2.88M|    else {
  207|  2.88M|        unsigned int fp = BN_STACK_pop(&ctx->stack);
  208|       |        /* Does this stack frame have anything to release? */
  209|  2.88M|        if (fp < ctx->used)
  ------------------
  |  Branch (209:13): [True: 2.76M, False: 125k]
  ------------------
  210|  2.76M|            BN_POOL_release(&ctx->pool, ctx->used - fp);
  211|  2.88M|        ctx->used = fp;
  212|       |        /* Unjam "too_many" in case "get" had failed */
  213|  2.88M|        ctx->too_many = 0;
  214|  2.88M|    }
  215|       |    CTXDBG("LEAVE BN_CTX_end()", ctx);
  ------------------
  |  |  110|  2.88M|    OSSL_TRACE_BEGIN(BN_CTX)       \
  |  |  ------------------
  |  |  |  |  221|  2.88M|    do {                           \
  |  |  |  |  222|  2.88M|        BIO *trc_out = NULL;       \
  |  |  |  |  223|  2.88M|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (223:13): [Folded, False: 2.88M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|  2.88M|    {                              \
  |  |  112|      0|        ctxdbg(trc_out, str, ctx); \
  |  |  113|      0|    }                              \
  |  |  114|  2.88M|    OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  226|  2.88M|    }                            \
  |  |  |  |  227|  2.88M|    while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (227:12): [Folded, False: 2.88M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  216|  2.88M|}
BN_CTX_get:
  219|  8.60M|{
  220|  8.60M|    BIGNUM *ret;
  221|       |
  222|  8.60M|    CTXDBG("ENTER BN_CTX_get()", ctx);
  ------------------
  |  |  110|  8.60M|    OSSL_TRACE_BEGIN(BN_CTX)       \
  |  |  ------------------
  |  |  |  |  221|  8.60M|    do {                           \
  |  |  |  |  222|  8.60M|        BIO *trc_out = NULL;       \
  |  |  |  |  223|  8.60M|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (223:13): [Folded, False: 8.60M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|  8.60M|    {                              \
  |  |  112|      0|        ctxdbg(trc_out, str, ctx); \
  |  |  113|      0|    }                              \
  |  |  114|  8.60M|    OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  226|  8.60M|    }                            \
  |  |  |  |  227|  8.60M|    while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (227:12): [Folded, False: 8.60M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  223|  8.60M|    if (ctx->err_stack || ctx->too_many)
  ------------------
  |  Branch (223:9): [True: 0, False: 8.60M]
  |  Branch (223:27): [True: 0, False: 8.60M]
  ------------------
  224|      0|        return NULL;
  225|  8.60M|    if ((ret = BN_POOL_get(&ctx->pool, ctx->flags)) == NULL) {
  ------------------
  |  Branch (225:9): [True: 0, False: 8.60M]
  ------------------
  226|       |        /*
  227|       |         * Setting too_many prevents repeated "get" attempts from cluttering
  228|       |         * the error stack.
  229|       |         */
  230|      0|        ctx->too_many = 1;
  231|      0|        ERR_raise(ERR_LIB_BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  232|      0|        return NULL;
  233|      0|    }
  234|       |    /* OK, make sure the returned bignum is "zero" */
  235|  8.60M|    BN_zero(ret);
  ------------------
  |  |  201|  8.60M|#define BN_zero(a) BN_zero_ex(a)
  ------------------
  236|       |    /* clear BN_FLG_CONSTTIME if leaked from previous frames */
  237|  8.60M|    ret->flags &= (~BN_FLG_CONSTTIME);
  ------------------
  |  |   67|  8.60M|#define BN_FLG_CONSTTIME 0x04
  ------------------
  238|  8.60M|    ctx->used++;
  239|       |    CTXDBG("LEAVE BN_CTX_get()", ctx);
  ------------------
  |  |  110|  8.60M|    OSSL_TRACE_BEGIN(BN_CTX)       \
  |  |  ------------------
  |  |  |  |  221|  8.60M|    do {                           \
  |  |  |  |  222|  8.60M|        BIO *trc_out = NULL;       \
  |  |  |  |  223|  8.60M|        if (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (223:13): [Folded, False: 8.60M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  111|  8.60M|    {                              \
  |  |  112|      0|        ctxdbg(trc_out, str, ctx); \
  |  |  113|      0|    }                              \
  |  |  114|  8.60M|    OSSL_TRACE_END(BN_CTX)
  |  |  ------------------
  |  |  |  |  226|  8.60M|    }                            \
  |  |  |  |  227|  8.60M|    while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (227:12): [Folded, False: 8.60M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  240|  8.60M|    return ret;
  241|  8.60M|}
ossl_bn_get_libctx:
  244|    971|{
  245|    971|    if (ctx == NULL)
  ------------------
  |  Branch (245:9): [True: 0, False: 971]
  ------------------
  246|      0|        return NULL;
  247|    971|    return ctx->libctx;
  248|    971|}
bn_ctx.c:BN_STACK_init:
  255|   566k|{
  256|       |    st->indexes = NULL;
  257|   566k|    st->depth = st->size = 0;
  258|   566k|}
bn_ctx.c:BN_STACK_finish:
  261|   566k|{
  262|   566k|    OPENSSL_free(st->indexes);
  ------------------
  |  |  131|   566k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  263|       |    st->indexes = NULL;
  264|   566k|}
bn_ctx.c:BN_STACK_push:
  267|  2.88M|{
  268|  2.88M|    if (st->depth == st->size) {
  ------------------
  |  Branch (268:9): [True: 441k, False: 2.44M]
  ------------------
  269|       |        /* Need to expand */
  270|   441k|        unsigned int newsize = st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES;
  ------------------
  |  |   17|   441k|#define BN_CTX_START_FRAMES 32
  ------------------
  |  Branch (270:32): [True: 0, False: 441k]
  ------------------
  271|   441k|        unsigned int *newitems;
  272|       |
  273|   441k|        if ((newitems = OPENSSL_malloc_array(newsize, sizeof(*newitems))) == NULL)
  ------------------
  |  |  110|   441k|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (273:13): [True: 0, False: 441k]
  ------------------
  274|      0|            return 0;
  275|   441k|        if (st->depth)
  ------------------
  |  Branch (275:13): [True: 0, False: 441k]
  ------------------
  276|      0|            memcpy(newitems, st->indexes, sizeof(*newitems) * st->depth);
  277|   441k|        OPENSSL_free(st->indexes);
  ------------------
  |  |  131|   441k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  278|   441k|        st->indexes = newitems;
  279|   441k|        st->size = newsize;
  280|   441k|    }
  281|  2.88M|    st->indexes[(st->depth)++] = idx;
  282|  2.88M|    return 1;
  283|  2.88M|}
bn_ctx.c:BN_STACK_pop:
  286|  2.88M|{
  287|  2.88M|    return st->indexes[--(st->depth)];
  288|  2.88M|}
bn_ctx.c:BN_POOL_init:
  295|   566k|{
  296|       |    p->head = p->current = p->tail = NULL;
  297|   566k|    p->used = p->size = 0;
  298|   566k|}
bn_ctx.c:BN_POOL_finish:
  301|   566k|{
  302|   566k|    unsigned int loop;
  303|   566k|    BIGNUM *bn;
  304|       |
  305|   895k|    while (p->head) {
  ------------------
  |  Branch (305:12): [True: 328k, False: 566k]
  ------------------
  306|  5.58M|        for (loop = 0, bn = p->head->vals; loop++ < BN_CTX_POOL_SIZE; bn++)
  ------------------
  |  |   15|  5.58M|#define BN_CTX_POOL_SIZE 16
  ------------------
  |  Branch (306:44): [True: 5.25M, False: 328k]
  ------------------
  307|  5.25M|            if (bn->d)
  ------------------
  |  Branch (307:17): [True: 2.67M, False: 2.58M]
  ------------------
  308|  2.67M|                BN_clear_free(bn);
  309|   328k|        p->current = p->head->next;
  310|   328k|        OPENSSL_free(p->head);
  ------------------
  |  |  131|   328k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  311|   328k|        p->head = p->current;
  312|   328k|    }
  313|   566k|}
bn_ctx.c:BN_POOL_get:
  316|  8.60M|{
  317|  8.60M|    BIGNUM *bn;
  318|  8.60M|    unsigned int loop;
  319|       |
  320|       |    /* Full; allocate a new pool item and link it in. */
  321|  8.60M|    if (p->used == p->size) {
  ------------------
  |  Branch (321:9): [True: 328k, False: 8.27M]
  ------------------
  322|   328k|        BN_POOL_ITEM *item;
  323|       |
  324|   328k|        if ((item = OPENSSL_malloc(sizeof(*item))) == NULL)
  ------------------
  |  |  106|   328k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (324:13): [True: 0, False: 328k]
  ------------------
  325|      0|            return NULL;
  326|  5.58M|        for (loop = 0, bn = item->vals; loop++ < BN_CTX_POOL_SIZE; bn++) {
  ------------------
  |  |   15|  5.58M|#define BN_CTX_POOL_SIZE 16
  ------------------
  |  Branch (326:41): [True: 5.25M, False: 328k]
  ------------------
  327|  5.25M|            bn_init(bn);
  328|  5.25M|            if ((flag & BN_FLG_SECURE) != 0)
  ------------------
  |  |   68|  5.25M|#define BN_FLG_SECURE 0x08
  ------------------
  |  Branch (328:17): [True: 5.07k, False: 5.25M]
  ------------------
  329|  5.07k|                BN_set_flags(bn, BN_FLG_SECURE);
  ------------------
  |  |   68|  5.07k|#define BN_FLG_SECURE 0x08
  ------------------
  330|  5.25M|        }
  331|   328k|        item->prev = p->tail;
  332|   328k|        item->next = NULL;
  333|       |
  334|   328k|        if (p->head == NULL)
  ------------------
  |  Branch (334:13): [True: 328k, False: 144]
  ------------------
  335|   328k|            p->head = p->current = p->tail = item;
  336|    144|        else {
  337|    144|            p->tail->next = item;
  338|    144|            p->tail = item;
  339|    144|            p->current = item;
  340|    144|        }
  341|   328k|        p->size += BN_CTX_POOL_SIZE;
  ------------------
  |  |   15|   328k|#define BN_CTX_POOL_SIZE 16
  ------------------
  342|   328k|        p->used++;
  343|       |        /* Return the first bignum from the new pool */
  344|   328k|        return item->vals;
  345|   328k|    }
  346|       |
  347|  8.27M|    if (!p->used)
  ------------------
  |  Branch (347:9): [True: 464k, False: 7.80M]
  ------------------
  348|   464k|        p->current = p->head;
  349|  7.80M|    else if ((p->used % BN_CTX_POOL_SIZE) == 0)
  ------------------
  |  |   15|  7.80M|#define BN_CTX_POOL_SIZE 16
  ------------------
  |  Branch (349:14): [True: 0, False: 7.80M]
  ------------------
  350|      0|        p->current = p->current->next;
  351|  8.27M|    return p->current->vals + ((p->used++) % BN_CTX_POOL_SIZE);
  ------------------
  |  |   15|  8.27M|#define BN_CTX_POOL_SIZE 16
  ------------------
  352|  8.60M|}
bn_ctx.c:BN_POOL_release:
  355|  2.76M|{
  356|  2.76M|    unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;
  ------------------
  |  |   15|  2.76M|#define BN_CTX_POOL_SIZE 16
  ------------------
  357|       |
  358|  2.76M|    p->used -= num;
  359|  11.3M|    while (num--) {
  ------------------
  |  Branch (359:12): [True: 8.60M, False: 2.76M]
  ------------------
  360|  8.60M|        bn_check_top(p->current->vals + offset);
  361|  8.60M|        if (offset == 0) {
  ------------------
  |  Branch (361:13): [True: 793k, False: 7.80M]
  ------------------
  362|   793k|            offset = BN_CTX_POOL_SIZE - 1;
  ------------------
  |  |   15|   793k|#define BN_CTX_POOL_SIZE 16
  ------------------
  363|   793k|            p->current = p->current->prev;
  364|   793k|        } else
  365|  7.80M|            offset--;
  366|  8.60M|    }
  367|  2.76M|}

BN_div:
  213|  1.31M|{
  214|  1.31M|    int ret;
  215|       |
  216|  1.31M|    if (BN_is_zero(divisor)) {
  ------------------
  |  Branch (216:9): [True: 0, False: 1.31M]
  ------------------
  217|      0|        ERR_raise(ERR_LIB_BN, BN_R_DIV_BY_ZERO);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  218|      0|        return 0;
  219|      0|    }
  220|       |
  221|       |    /*
  222|       |     * Invalid zero-padding would have particularly bad consequences so don't
  223|       |     * just rely on bn_check_top() here (bn_check_top() works only for
  224|       |     * BN_DEBUG builds)
  225|       |     */
  226|  1.31M|    if (divisor->d[divisor->top - 1] == 0) {
  ------------------
  |  Branch (226:9): [True: 0, False: 1.31M]
  ------------------
  227|      0|        ERR_raise(ERR_LIB_BN, BN_R_NOT_INITIALIZED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  228|      0|        return 0;
  229|      0|    }
  230|       |
  231|  1.31M|    ret = bn_div_fixed_top(dv, rm, num, divisor, ctx);
  232|       |
  233|  1.31M|    if (ret) {
  ------------------
  |  Branch (233:9): [True: 1.31M, False: 0]
  ------------------
  234|  1.31M|        if (dv != NULL)
  ------------------
  |  Branch (234:13): [True: 102k, False: 1.21M]
  ------------------
  235|   102k|            bn_correct_top(dv);
  236|  1.31M|        if (rm != NULL)
  ------------------
  |  Branch (236:13): [True: 1.21M, False: 102k]
  ------------------
  237|  1.21M|            bn_correct_top(rm);
  238|  1.31M|    }
  239|       |
  240|  1.31M|    return ret;
  241|  1.31M|}
bn_div_fixed_top:
  268|  1.31M|{
  269|  1.31M|    int norm_shift, i, j, loop;
  270|  1.31M|    BIGNUM *tmp, *snum, *sdiv, *res;
  271|  1.31M|    BN_ULONG *resp, *wnum, *wnumtop;
  ------------------
  |  |   37|  1.31M|#define BN_ULONG unsigned long
  ------------------
  272|  1.31M|    BN_ULONG d0, d1;
  ------------------
  |  |   37|  1.31M|#define BN_ULONG unsigned long
  ------------------
  273|  1.31M|    int num_n, div_n, num_neg;
  274|       |
  275|  1.31M|    assert(divisor->top > 0 && divisor->d[divisor->top - 1] != 0);
  ------------------
  |  Branch (275:5): [True: 0, False: 1.31M]
  |  Branch (275:5): [True: 0, False: 0]
  |  Branch (275:5): [True: 1.31M, False: 0]
  |  Branch (275:5): [True: 1.31M, False: 0]
  ------------------
  276|       |
  277|  1.31M|    bn_check_top(num);
  278|  1.31M|    bn_check_top(divisor);
  279|  1.31M|    bn_check_top(dv);
  280|  1.31M|    bn_check_top(rm);
  281|       |
  282|  1.31M|    BN_CTX_start(ctx);
  283|  1.31M|    res = (dv == NULL) ? BN_CTX_get(ctx) : dv;
  ------------------
  |  Branch (283:11): [True: 1.21M, False: 102k]
  ------------------
  284|  1.31M|    tmp = BN_CTX_get(ctx);
  285|  1.31M|    snum = BN_CTX_get(ctx);
  286|  1.31M|    sdiv = BN_CTX_get(ctx);
  287|  1.31M|    if (sdiv == NULL)
  ------------------
  |  Branch (287:9): [True: 0, False: 1.31M]
  ------------------
  288|      0|        goto err;
  289|       |
  290|       |    /* First we normalise the numbers */
  291|  1.31M|    if (!BN_copy(sdiv, divisor))
  ------------------
  |  Branch (291:9): [True: 0, False: 1.31M]
  ------------------
  292|      0|        goto err;
  293|  1.31M|    norm_shift = bn_left_align(sdiv);
  294|  1.31M|    sdiv->neg = 0;
  295|       |    /*
  296|       |     * Note that bn_lshift_fixed_top's output is always one limb longer
  297|       |     * than input, even when norm_shift is zero. This means that amount of
  298|       |     * inner loop iterations is invariant of dividend value, and that one
  299|       |     * doesn't need to compare dividend and divisor if they were originally
  300|       |     * of the same bit length.
  301|       |     */
  302|  1.31M|    if (!(bn_lshift_fixed_top(snum, num, norm_shift)))
  ------------------
  |  Branch (302:9): [True: 0, False: 1.31M]
  ------------------
  303|      0|        goto err;
  304|       |
  305|  1.31M|    div_n = sdiv->top;
  306|  1.31M|    num_n = snum->top;
  307|       |
  308|  1.31M|    if (num_n <= div_n) {
  ------------------
  |  Branch (308:9): [True: 226k, False: 1.08M]
  ------------------
  309|       |        /* caller didn't pad dividend -> no constant-time guarantee... */
  310|   226k|        if (bn_wexpand(snum, div_n + 1) == NULL)
  ------------------
  |  Branch (310:13): [True: 0, False: 226k]
  ------------------
  311|      0|            goto err;
  312|   226k|        memset(&(snum->d[num_n]), 0, (div_n - num_n + 1) * sizeof(BN_ULONG));
  313|   226k|        snum->top = num_n = div_n + 1;
  314|   226k|    }
  315|       |
  316|  1.31M|    loop = num_n - div_n;
  317|       |    /*
  318|       |     * Lets setup a 'window' into snum This is the part that corresponds to
  319|       |     * the current 'area' being divided
  320|       |     */
  321|  1.31M|    wnum = &(snum->d[loop]);
  322|  1.31M|    wnumtop = &(snum->d[num_n - 1]);
  323|       |
  324|       |    /* Get the top 2 words of sdiv */
  325|  1.31M|    d0 = sdiv->d[div_n - 1];
  326|  1.31M|    d1 = (div_n == 1) ? 0 : sdiv->d[div_n - 2];
  ------------------
  |  Branch (326:10): [True: 306k, False: 1.00M]
  ------------------
  327|       |
  328|       |    /* Setup quotient */
  329|  1.31M|    if (!bn_wexpand(res, loop))
  ------------------
  |  Branch (329:9): [True: 0, False: 1.31M]
  ------------------
  330|      0|        goto err;
  331|  1.31M|    num_neg = num->neg;
  332|  1.31M|    res->neg = (num_neg ^ divisor->neg);
  333|  1.31M|    res->top = loop;
  334|  1.31M|    res->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  221|  1.31M|#define BN_FLG_FIXED_TOP 0
  ------------------
  335|  1.31M|    resp = &(res->d[loop]);
  336|       |
  337|       |    /* space for temp */
  338|  1.31M|    if (!bn_wexpand(tmp, (div_n + 1)))
  ------------------
  |  Branch (338:9): [True: 0, False: 1.31M]
  ------------------
  339|      0|        goto err;
  340|       |
  341|  3.65M|    for (i = 0; i < loop; i++, wnumtop--) {
  ------------------
  |  Branch (341:17): [True: 2.33M, False: 1.31M]
  ------------------
  342|  2.33M|        BN_ULONG q, l0;
  ------------------
  |  |   37|  2.33M|#define BN_ULONG unsigned long
  ------------------
  343|       |        /*
  344|       |         * the first part of the loop uses the top two words of snum and sdiv
  345|       |         * to calculate a BN_ULONG q such that | wnum - sdiv * q | < sdiv
  346|       |         */
  347|       |#if defined(BN_DIV3W)
  348|       |        q = bn_div_3_words(wnumtop, d1, d0);
  349|       |#else
  350|  2.33M|        BN_ULONG n0, n1, rem = 0;
  ------------------
  |  |   37|  2.33M|#define BN_ULONG unsigned long
  ------------------
  351|       |
  352|  2.33M|        n0 = wnumtop[0];
  353|  2.33M|        n1 = wnumtop[-1];
  354|  2.33M|        if (n0 == d0)
  ------------------
  |  Branch (354:13): [True: 0, False: 2.33M]
  ------------------
  355|      0|            q = BN_MASK2;
  ------------------
  |  |   93|      0|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  356|  2.33M|        else { /* n0 < d0 */
  357|  2.33M|            BN_ULONG n2 = (wnumtop == wnum) ? 0 : wnumtop[-2];
  ------------------
  |  |   37|  2.33M|#define BN_ULONG unsigned long
  ------------------
  |  Branch (357:27): [True: 612k, False: 1.72M]
  ------------------
  358|       |#ifdef BN_LLONG
  359|       |            BN_ULLONG t2;
  360|       |
  361|       |#if defined(BN_LLONG) && defined(BN_DIV2W) && !defined(bn_div_words)
  362|       |            q = (BN_ULONG)(((((BN_ULLONG)n0) << BN_BITS2) | n1) / d0);
  363|       |#else
  364|       |            q = bn_div_words(n0, n1, d0);
  365|       |#endif
  366|       |
  367|       |#ifndef REMAINDER_IS_ALREADY_CALCULATED
  368|       |            /*
  369|       |             * rem doesn't have to be BN_ULLONG. The least we
  370|       |             * know it's less that d0, isn't it?
  371|       |             */
  372|       |            rem = (n1 - q * d0) & BN_MASK2;
  373|       |#endif
  374|       |            t2 = (BN_ULLONG)d1 * q;
  375|       |
  376|       |            for (;;) {
  377|       |                if (t2 <= ((((BN_ULLONG)rem) << BN_BITS2) | n2))
  378|       |                    break;
  379|       |                q--;
  380|       |                rem += d0;
  381|       |                if (rem < d0)
  382|       |                    break; /* don't let rem overflow */
  383|       |                t2 -= d1;
  384|       |            }
  385|       |#else /* !BN_LLONG */
  386|  2.33M|            BN_ULONG t2l, t2h;
  ------------------
  |  |   37|  2.33M|#define BN_ULONG unsigned long
  ------------------
  387|       |
  388|  2.33M|            q = bn_div_words(n0, n1, d0);
  389|  2.33M|#ifndef REMAINDER_IS_ALREADY_CALCULATED
  390|  2.33M|            rem = (n1 - q * d0) & BN_MASK2;
  ------------------
  |  |   93|  2.33M|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  391|  2.33M|#endif
  392|       |
  393|       |#if defined(BN_UMULT_LOHI)
  394|       |            BN_UMULT_LOHI(t2l, t2h, d1, q);
  395|       |#elif defined(BN_UMULT_HIGH)
  396|       |            t2l = d1 * q;
  397|       |            t2h = BN_UMULT_HIGH(d1, q);
  398|       |#else
  399|  2.33M|            {
  400|  2.33M|                BN_ULONG ql, qh;
  ------------------
  |  |   37|  2.33M|#define BN_ULONG unsigned long
  ------------------
  401|  2.33M|                t2l = LBITS(d1);
  ------------------
  |  |  568|  2.33M|#define LBITS(a) ((a) & BN_MASK2l)
  |  |  ------------------
  |  |  |  |   94|  2.33M|#define BN_MASK2l (0xffffffffL)
  |  |  ------------------
  ------------------
  402|  2.33M|                t2h = HBITS(d1);
  ------------------
  |  |  569|  2.33M|#define HBITS(a) (((a) >> BN_BITS4) & BN_MASK2l)
  |  |  ------------------
  |  |  |  |   92|  2.33M|#define BN_BITS4 32
  |  |  ------------------
  |  |               #define HBITS(a) (((a) >> BN_BITS4) & BN_MASK2l)
  |  |  ------------------
  |  |  |  |   94|  2.33M|#define BN_MASK2l (0xffffffffL)
  |  |  ------------------
  ------------------
  403|  2.33M|                ql = LBITS(q);
  ------------------
  |  |  568|  2.33M|#define LBITS(a) ((a) & BN_MASK2l)
  |  |  ------------------
  |  |  |  |   94|  2.33M|#define BN_MASK2l (0xffffffffL)
  |  |  ------------------
  ------------------
  404|  2.33M|                qh = HBITS(q);
  ------------------
  |  |  569|  2.33M|#define HBITS(a) (((a) >> BN_BITS4) & BN_MASK2l)
  |  |  ------------------
  |  |  |  |   92|  2.33M|#define BN_BITS4 32
  |  |  ------------------
  |  |               #define HBITS(a) (((a) >> BN_BITS4) & BN_MASK2l)
  |  |  ------------------
  |  |  |  |   94|  2.33M|#define BN_MASK2l (0xffffffffL)
  |  |  ------------------
  ------------------
  405|  2.33M|                mul64(t2l, t2h, ql, qh); /* t2=(BN_ULLONG)d1*q; */
  ------------------
  |  |  577|  2.33M|    {                                      \
  |  |  578|  2.33M|        BN_ULONG m, m1, lt, ht;            \
  |  |  ------------------
  |  |  |  |   37|  2.33M|#define BN_ULONG unsigned long
  |  |  ------------------
  |  |  579|  2.33M|                                           \
  |  |  580|  2.33M|        lt = l;                            \
  |  |  581|  2.33M|        ht = h;                            \
  |  |  582|  2.33M|        m = (bh) * (lt);                   \
  |  |  583|  2.33M|        lt = (bl) * (lt);                  \
  |  |  584|  2.33M|        m1 = (bl) * (ht);                  \
  |  |  585|  2.33M|        ht = (bh) * (ht);                  \
  |  |  586|  2.33M|        m = (m + m1) & BN_MASK2;           \
  |  |  ------------------
  |  |  |  |   93|  2.33M|#define BN_MASK2 (0xffffffffffffffffL)
  |  |  ------------------
  |  |  587|  2.33M|        ht += L2HBITS((BN_ULONG)(m < m1)); \
  |  |  ------------------
  |  |  |  |  570|  2.33M|#define L2HBITS(a) (((a) << BN_BITS4) & BN_MASK2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|  2.33M|#define BN_BITS4 32
  |  |  |  |  ------------------
  |  |  |  |               #define L2HBITS(a) (((a) << BN_BITS4) & BN_MASK2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  2.33M|#define BN_MASK2 (0xffffffffffffffffL)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  588|  2.33M|        ht += HBITS(m);                    \
  |  |  ------------------
  |  |  |  |  569|  2.33M|#define HBITS(a) (((a) >> BN_BITS4) & BN_MASK2l)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|  2.33M|#define BN_BITS4 32
  |  |  |  |  ------------------
  |  |  |  |               #define HBITS(a) (((a) >> BN_BITS4) & BN_MASK2l)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|  2.33M|#define BN_MASK2l (0xffffffffL)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  589|  2.33M|        m1 = L2HBITS(m);                   \
  |  |  ------------------
  |  |  |  |  570|  2.33M|#define L2HBITS(a) (((a) << BN_BITS4) & BN_MASK2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|  2.33M|#define BN_BITS4 32
  |  |  |  |  ------------------
  |  |  |  |               #define L2HBITS(a) (((a) << BN_BITS4) & BN_MASK2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  2.33M|#define BN_MASK2 (0xffffffffffffffffL)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  590|  2.33M|        lt = (lt + m1) & BN_MASK2;         \
  |  |  ------------------
  |  |  |  |   93|  2.33M|#define BN_MASK2 (0xffffffffffffffffL)
  |  |  ------------------
  |  |  591|  2.33M|        ht += (lt < m1);                   \
  |  |  592|  2.33M|        (l) = lt;                          \
  |  |  593|  2.33M|        (h) = ht;                          \
  |  |  594|  2.33M|    }
  ------------------
  406|  2.33M|            }
  407|  2.33M|#endif
  408|       |
  409|  2.33M|            for (;;) {
  410|  2.33M|                if ((t2h < rem) || ((t2h == rem) && (t2l <= n2)))
  ------------------
  |  Branch (410:21): [True: 1.69M, False: 647k]
  |  Branch (410:37): [True: 644k, False: 2.37k]
  |  Branch (410:53): [True: 644k, False: 0]
  ------------------
  411|  2.33M|                    break;
  412|  2.37k|                q--;
  413|  2.37k|                rem += d0;
  414|  2.37k|                if (rem < d0)
  ------------------
  |  Branch (414:21): [True: 2.13k, False: 242]
  ------------------
  415|  2.13k|                    break; /* don't let rem overflow */
  416|    242|                if (t2l < d1)
  ------------------
  |  Branch (416:21): [True: 103, False: 139]
  ------------------
  417|    103|                    t2h--;
  418|    242|                t2l -= d1;
  419|    242|            }
  420|  2.33M|#endif /* !BN_LLONG */
  421|  2.33M|        }
  422|  2.33M|#endif /* !BN_DIV3W */
  423|       |
  424|  2.33M|        l0 = bn_mul_words(tmp->d, sdiv->d, div_n, q);
  425|  2.33M|        tmp->d[div_n] = l0;
  426|  2.33M|        wnum--;
  427|       |        /*
  428|       |         * ignore top values of the bignums just sub the two BN_ULONG arrays
  429|       |         * with bn_sub_words
  430|       |         */
  431|  2.33M|        l0 = bn_sub_words(wnum, wnum, tmp->d, div_n + 1);
  432|  2.33M|        q -= l0;
  433|       |        /*
  434|       |         * Note: As we have considered only the leading two BN_ULONGs in
  435|       |         * the calculation of q, sdiv * q might be greater than wnum (but
  436|       |         * then (q-1) * sdiv is less or equal than wnum)
  437|       |         */
  438|  13.7M|        for (l0 = 0 - l0, j = 0; j < div_n; j++)
  ------------------
  |  Branch (438:34): [True: 11.3M, False: 2.33M]
  ------------------
  439|  11.3M|            tmp->d[j] = sdiv->d[j] & l0;
  440|  2.33M|        l0 = bn_add_words(wnum, wnum, tmp->d, div_n);
  441|  2.33M|        (*wnumtop) += l0;
  442|  2.33M|        assert((*wnumtop) == 0);
  ------------------
  |  Branch (442:9): [True: 0, False: 2.33M]
  |  Branch (442:9): [True: 2.33M, False: 0]
  ------------------
  443|       |
  444|       |        /* store part of the result */
  445|  2.33M|        *--resp = q;
  446|  2.33M|    }
  447|       |    /* snum holds remainder, it's as wide as divisor */
  448|  1.31M|    snum->neg = num_neg;
  449|  1.31M|    snum->top = div_n;
  450|  1.31M|    snum->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  221|  1.31M|#define BN_FLG_FIXED_TOP 0
  ------------------
  451|       |
  452|  1.31M|    if (rm != NULL && bn_rshift_fixed_top(rm, snum, norm_shift) == 0)
  ------------------
  |  Branch (452:9): [True: 1.21M, False: 102k]
  |  Branch (452:23): [True: 0, False: 1.21M]
  ------------------
  453|      0|        goto err;
  454|       |
  455|  1.31M|    BN_CTX_end(ctx);
  456|  1.31M|    return 1;
  457|      0|err:
  458|      0|    bn_check_top(rm);
  459|      0|    BN_CTX_end(ctx);
  460|      0|    return 0;
  461|  1.31M|}
bn_div.c:bn_left_align:
  142|  1.31M|{
  143|  1.31M|    BN_ULONG *d = num->d, n, m, rmask;
  ------------------
  |  |   37|  1.31M|#define BN_ULONG unsigned long
  ------------------
  144|  1.31M|    int top = num->top;
  145|  1.31M|    int rshift = BN_num_bits_word(d[top - 1]), lshift, i;
  146|       |
  147|  1.31M|    lshift = BN_BITS2 - rshift;
  ------------------
  |  |   54|  1.31M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.31M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  148|  1.31M|    rshift %= BN_BITS2; /* say no to undefined behaviour */
  ------------------
  |  |   54|  1.31M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.31M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  149|  1.31M|    rmask = (BN_ULONG)0 - rshift; /* rmask = 0 - (rshift != 0) */
  150|  1.31M|    rmask |= rmask >> 8;
  151|       |
  152|  7.48M|    for (i = 0, m = 0; i < top; i++) {
  ------------------
  |  Branch (152:24): [True: 6.17M, False: 1.31M]
  ------------------
  153|  6.17M|        n = d[i];
  154|  6.17M|        d[i] = ((n << lshift) | m) & BN_MASK2;
  ------------------
  |  |   93|  6.17M|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  155|  6.17M|        m = (n >> rshift) & rmask;
  156|  6.17M|    }
  157|       |
  158|  1.31M|    return lshift;
  159|  1.31M|}

ossl_err_load_BN_strings:
   50|      1|{
   51|      1|#ifndef OPENSSL_NO_ERR
   52|      1|    if (ERR_reason_error_string(BN_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (52:9): [True: 1, False: 0]
  ------------------
   53|      1|        ERR_load_strings_const(BN_str_reasons);
   54|      1|#endif
   55|      1|    return 1;
   56|      1|}

BN_mod_exp_mont:
  313|    220|{
  314|    220|    int i, j, bits, ret = 0, wstart, wend, window;
  315|    220|    int start = 1;
  316|    220|    BIGNUM *d, *r;
  317|    220|    const BIGNUM *aa;
  318|       |    /* Table of variables obtained from 'ctx' */
  319|    220|    BIGNUM *val[TABLE_SIZE];
  320|    220|    BN_MONT_CTX *mont = NULL;
  321|       |
  322|    220|    bn_check_top(a);
  323|    220|    bn_check_top(p);
  324|    220|    bn_check_top(m);
  325|       |
  326|    220|    if (!BN_is_odd(m)) {
  ------------------
  |  Branch (326:9): [True: 0, False: 220]
  ------------------
  327|      0|        ERR_raise(ERR_LIB_BN, BN_R_CALLED_WITH_EVEN_MODULUS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  328|      0|        return 0;
  329|      0|    }
  330|       |
  331|    220|    if (m->top <= BN_CONSTTIME_SIZE_LIMIT
  ------------------
  |  |   46|    440|#define BN_CONSTTIME_SIZE_LIMIT (INT_MAX / BN_BYTES / 256)
  |  |  ------------------
  |  |  |  |   38|    220|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  |  Branch (331:9): [True: 220, False: 0]
  ------------------
  332|    220|        && (BN_get_flags(p, BN_FLG_CONSTTIME) != 0
  ------------------
  |  |   67|    220|#define BN_FLG_CONSTTIME 0x04
  ------------------
  |  Branch (332:13): [True: 76, False: 144]
  ------------------
  333|    144|            || BN_get_flags(a, BN_FLG_CONSTTIME) != 0
  ------------------
  |  |   67|    144|#define BN_FLG_CONSTTIME 0x04
  ------------------
  |  Branch (333:16): [True: 0, False: 144]
  ------------------
  334|    144|            || BN_get_flags(m, BN_FLG_CONSTTIME) != 0)) {
  ------------------
  |  |   67|    144|#define BN_FLG_CONSTTIME 0x04
  ------------------
  |  Branch (334:16): [True: 0, False: 144]
  ------------------
  335|     76|        return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
  336|     76|    }
  337|       |
  338|    144|    bits = BN_num_bits(p);
  339|    144|    if (bits == 0) {
  ------------------
  |  Branch (339:9): [True: 0, False: 144]
  ------------------
  340|       |        /* x**0 mod 1, or x**0 mod -1 is still zero. */
  341|      0|        if (BN_abs_is_word(m, 1)) {
  ------------------
  |  Branch (341:13): [True: 0, False: 0]
  ------------------
  342|      0|            ret = 1;
  343|      0|            BN_zero(rr);
  ------------------
  |  |  201|      0|#define BN_zero(a) BN_zero_ex(a)
  ------------------
  344|      0|        } else {
  345|      0|            ret = BN_one(rr);
  ------------------
  |  |  196|      0|#define BN_one(a) (BN_set_word((a), 1))
  ------------------
  346|      0|        }
  347|      0|        return ret;
  348|      0|    }
  349|       |
  350|    144|    BN_CTX_start(ctx);
  351|    144|    d = BN_CTX_get(ctx);
  352|    144|    r = BN_CTX_get(ctx);
  353|    144|    val[0] = BN_CTX_get(ctx);
  354|    144|    if (val[0] == NULL)
  ------------------
  |  Branch (354:9): [True: 0, False: 144]
  ------------------
  355|      0|        goto err;
  356|       |
  357|       |    /*
  358|       |     * If this is not done, things will break in the montgomery part
  359|       |     */
  360|       |
  361|    144|    if (in_mont != NULL)
  ------------------
  |  Branch (361:9): [True: 144, False: 0]
  ------------------
  362|    144|        mont = in_mont;
  363|      0|    else {
  364|      0|        if ((mont = BN_MONT_CTX_new()) == NULL)
  ------------------
  |  Branch (364:13): [True: 0, False: 0]
  ------------------
  365|      0|            goto err;
  366|      0|        if (!BN_MONT_CTX_set(mont, m, ctx))
  ------------------
  |  Branch (366:13): [True: 0, False: 0]
  ------------------
  367|      0|            goto err;
  368|      0|    }
  369|       |
  370|    144|    if (a->neg || BN_ucmp(a, m) >= 0) {
  ------------------
  |  Branch (370:9): [True: 0, False: 144]
  |  Branch (370:19): [True: 0, False: 144]
  ------------------
  371|      0|        if (!BN_nnmod(val[0], a, m, ctx))
  ------------------
  |  Branch (371:13): [True: 0, False: 0]
  ------------------
  372|      0|            goto err;
  373|      0|        aa = val[0];
  374|      0|    } else
  375|    144|        aa = a;
  376|    144|    if (!bn_to_mont_fixed_top(val[0], aa, mont, ctx))
  ------------------
  |  Branch (376:9): [True: 0, False: 144]
  ------------------
  377|      0|        goto err; /* 1 */
  378|       |
  379|    144|    window = BN_window_bits_for_exponent_size(bits);
  ------------------
  |  |  317|    144|    ((b) > 671 ? 6 : (b) > 239 ? 5          \
  |  |  ------------------
  |  |  |  Branch (317:6): [True: 0, False: 144]
  |  |  |  Branch (317:22): [True: 144, False: 0]
  |  |  ------------------
  |  |  318|    144|            : (b) > 79         ? 4          \
  |  |  ------------------
  |  |  |  Branch (318:15): [True: 0, False: 0]
  |  |  ------------------
  |  |  319|      0|            : (b) > 23         ? 3          \
  |  |  ------------------
  |  |  |  Branch (319:15): [True: 0, False: 0]
  |  |  ------------------
  |  |  320|      0|                               : 1)
  ------------------
  380|    144|    if (window > 1) {
  ------------------
  |  Branch (380:9): [True: 144, False: 0]
  ------------------
  381|    144|        if (!bn_mul_mont_fixed_top(d, val[0], val[0], mont, ctx))
  ------------------
  |  Branch (381:13): [True: 0, False: 144]
  ------------------
  382|      0|            goto err; /* 2 */
  383|    144|        j = 1 << (window - 1);
  384|  2.30k|        for (i = 1; i < j; i++) {
  ------------------
  |  Branch (384:21): [True: 2.16k, False: 144]
  ------------------
  385|  2.16k|            if (((val[i] = BN_CTX_get(ctx)) == NULL) || !bn_mul_mont_fixed_top(val[i], val[i - 1], d, mont, ctx))
  ------------------
  |  Branch (385:17): [True: 0, False: 2.16k]
  |  Branch (385:57): [True: 0, False: 2.16k]
  ------------------
  386|      0|                goto err;
  387|  2.16k|        }
  388|    144|    }
  389|       |
  390|    144|    start = 1; /* This is used to avoid multiplication etc
  391|       |                * when there is only the value '1' in the
  392|       |                * buffer. */
  393|    144|    wstart = bits - 1; /* The top bit of the window */
  394|    144|    wend = 0; /* The bottom bit of the window */
  395|       |
  396|    144|#if 1 /* by Shay Gueron's suggestion */
  397|    144|    j = m->top; /* borrow j */
  398|    144|    if (m->d[j - 1] & (((BN_ULONG)1) << (BN_BITS2 - 1))) {
  ------------------
  |  |   54|    144|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|    144|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  |  Branch (398:9): [True: 144, False: 0]
  ------------------
  399|    144|        if (bn_wexpand(r, j) == NULL)
  ------------------
  |  Branch (399:13): [True: 0, False: 144]
  ------------------
  400|      0|            goto err;
  401|       |        /* 2^(top*BN_BITS2) - m */
  402|    144|        r->d[0] = (0 - m->d[0]) & BN_MASK2;
  ------------------
  |  |   93|    144|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  403|  1.02k|        for (i = 1; i < j; i++)
  ------------------
  |  Branch (403:21): [True: 880, False: 144]
  ------------------
  404|    880|            r->d[i] = (~m->d[i]) & BN_MASK2;
  ------------------
  |  |   93|  1.02k|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  405|    144|        r->top = j;
  406|    144|        r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  221|    144|#define BN_FLG_FIXED_TOP 0
  ------------------
  407|    144|    } else
  408|      0|#endif
  409|      0|        if (!bn_to_mont_fixed_top(r, BN_value_one(), mont, ctx))
  ------------------
  |  Branch (409:13): [True: 0, False: 0]
  ------------------
  410|      0|        goto err;
  411|  32.3k|    for (;;) {
  412|  32.3k|        int wvalue; /* The 'value' of the window */
  413|       |
  414|  32.3k|        if (BN_is_bit_set(p, wstart) == 0) {
  ------------------
  |  Branch (414:13): [True: 21.3k, False: 10.9k]
  ------------------
  415|  21.3k|            if (!start) {
  ------------------
  |  Branch (415:17): [True: 21.3k, False: 0]
  ------------------
  416|  21.3k|                if (!bn_mul_mont_fixed_top(r, r, r, mont, ctx))
  ------------------
  |  Branch (416:21): [True: 0, False: 21.3k]
  ------------------
  417|      0|                    goto err;
  418|  21.3k|            }
  419|  21.3k|            if (wstart == 0)
  ------------------
  |  Branch (419:17): [True: 0, False: 21.3k]
  ------------------
  420|      0|                break;
  421|  21.3k|            wstart--;
  422|  21.3k|            continue;
  423|  21.3k|        }
  424|       |        /*
  425|       |         * We now have wstart on a 'set' bit, we now need to work out how bit
  426|       |         * a window to do.  To do this we need to scan forward until the last
  427|       |         * set bit before the end of the window
  428|       |         */
  429|  10.9k|        wvalue = 1;
  430|  10.9k|        wend = 0;
  431|  54.3k|        for (i = 1; i < window; i++) {
  ------------------
  |  Branch (431:21): [True: 43.4k, False: 10.8k]
  ------------------
  432|  43.4k|            if (wstart - i < 0)
  ------------------
  |  Branch (432:17): [True: 144, False: 43.3k]
  ------------------
  433|    144|                break;
  434|  43.3k|            if (BN_is_bit_set(p, wstart - i)) {
  ------------------
  |  Branch (434:17): [True: 21.1k, False: 22.2k]
  ------------------
  435|  21.1k|                wvalue <<= (i - wend);
  436|  21.1k|                wvalue |= 1;
  437|  21.1k|                wend = i;
  438|  21.1k|            }
  439|  43.3k|        }
  440|       |
  441|       |        /* wend is the size of the current window */
  442|  10.9k|        j = wend + 1;
  443|       |        /* add the 'bytes above' */
  444|  10.9k|        if (!start)
  ------------------
  |  Branch (444:13): [True: 10.8k, False: 144]
  ------------------
  445|  54.3k|            for (i = 0; i < j; i++) {
  ------------------
  |  Branch (445:25): [True: 43.4k, False: 10.8k]
  ------------------
  446|  43.4k|                if (!bn_mul_mont_fixed_top(r, r, r, mont, ctx))
  ------------------
  |  Branch (446:21): [True: 0, False: 43.4k]
  ------------------
  447|      0|                    goto err;
  448|  43.4k|            }
  449|       |
  450|       |        /* wvalue will be an odd number < 2^window */
  451|  10.9k|        if (!bn_mul_mont_fixed_top(r, r, val[wvalue >> 1], mont, ctx))
  ------------------
  |  Branch (451:13): [True: 0, False: 10.9k]
  ------------------
  452|      0|            goto err;
  453|       |
  454|       |        /* move the 'window' down further */
  455|  10.9k|        wstart -= wend + 1;
  456|  10.9k|        start = 0;
  457|  10.9k|        if (wstart < 0)
  ------------------
  |  Branch (457:13): [True: 144, False: 10.8k]
  ------------------
  458|    144|            break;
  459|  10.9k|    }
  460|       |    /*
  461|       |     * Done with zero-padded intermediate BIGNUMs. Final BN_from_montgomery
  462|       |     * removes padding [if any] and makes return value suitable for public
  463|       |     * API consumer.
  464|       |     */
  465|       |#if defined(SPARC_T4_MONT)
  466|       |    if (OPENSSL_sparcv9cap_P[0] & (SPARCV9_VIS3 | SPARCV9_PREFER_FPU)) {
  467|       |        j = mont->N.top; /* borrow j */
  468|       |        val[0]->d[0] = 1; /* borrow val[0] */
  469|       |        for (i = 1; i < j; i++)
  470|       |            val[0]->d[i] = 0;
  471|       |        val[0]->top = j;
  472|       |        if (!BN_mod_mul_montgomery(rr, r, val[0], mont, ctx))
  473|       |            goto err;
  474|       |    } else
  475|       |#endif
  476|    144|        if (!BN_from_montgomery(rr, r, mont, ctx))
  ------------------
  |  Branch (476:13): [True: 0, False: 144]
  ------------------
  477|      0|        goto err;
  478|    144|    ret = 1;
  479|    144|err:
  480|    144|    if (in_mont == NULL)
  ------------------
  |  Branch (480:9): [True: 0, False: 144]
  ------------------
  481|      0|        BN_MONT_CTX_free(mont);
  482|    144|    BN_CTX_end(ctx);
  483|    144|    bn_check_top(rr);
  484|    144|    return ret;
  485|    144|}
bn_mod_exp_mont_fixed_top:
  606|     76|{
  607|     76|    int i, bits, ret = 0, window, wvalue, wmask, window0;
  608|     76|    int top;
  609|     76|    BN_MONT_CTX *mont = NULL;
  610|       |
  611|     76|    int numPowers;
  612|     76|    unsigned char *powerbufFree = NULL;
  613|     76|    int powerbufLen = 0;
  614|     76|    unsigned char *powerbuf = NULL;
  615|     76|    BIGNUM tmp, am;
  616|       |#if defined(SPARC_T4_MONT)
  617|       |    unsigned int t4 = 0;
  618|       |#endif
  619|       |
  620|     76|    if (!BN_is_odd(m)) {
  ------------------
  |  Branch (620:9): [True: 0, False: 76]
  ------------------
  621|      0|        ERR_raise(ERR_LIB_BN, BN_R_CALLED_WITH_EVEN_MODULUS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  622|      0|        return 0;
  623|      0|    }
  624|       |
  625|     76|    top = m->top;
  626|       |
  627|     76|    if (top > BN_CONSTTIME_SIZE_LIMIT) {
  ------------------
  |  |   46|     76|#define BN_CONSTTIME_SIZE_LIMIT (INT_MAX / BN_BYTES / 256)
  |  |  ------------------
  |  |  |  |   38|     76|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  |  Branch (627:9): [True: 0, False: 76]
  ------------------
  628|       |        /* Prevent overflowing the powerbufLen computation below */
  629|      0|        return BN_mod_exp_mont(rr, a, p, m, ctx, in_mont);
  630|      0|    }
  631|       |
  632|       |    /*
  633|       |     * Use all bits stored in |p|, rather than |BN_num_bits|, so we do not leak
  634|       |     * whether the top bits are zero.
  635|       |     */
  636|     76|    bits = p->top * BN_BITS2;
  ------------------
  |  |   54|     76|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|     76|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  637|     76|    if (bits == 0) {
  ------------------
  |  Branch (637:9): [True: 0, False: 76]
  ------------------
  638|       |        /* x**0 mod 1, or x**0 mod -1 is still zero. */
  639|      0|        if (BN_abs_is_word(m, 1)) {
  ------------------
  |  Branch (639:13): [True: 0, False: 0]
  ------------------
  640|      0|            ret = 1;
  641|      0|            BN_zero(rr);
  ------------------
  |  |  201|      0|#define BN_zero(a) BN_zero_ex(a)
  ------------------
  642|      0|        } else {
  643|      0|            ret = BN_one(rr);
  ------------------
  |  |  196|      0|#define BN_one(a) (BN_set_word((a), 1))
  ------------------
  644|      0|        }
  645|      0|        return ret;
  646|      0|    }
  647|       |
  648|     76|    BN_CTX_start(ctx);
  649|       |
  650|       |    /*
  651|       |     * Allocate a montgomery context if it was not supplied by the caller. If
  652|       |     * this is not done, things will break in the montgomery part.
  653|       |     */
  654|     76|    if (in_mont != NULL)
  ------------------
  |  Branch (654:9): [True: 76, False: 0]
  ------------------
  655|     76|        mont = in_mont;
  656|      0|    else {
  657|      0|        if ((mont = BN_MONT_CTX_new()) == NULL)
  ------------------
  |  Branch (657:13): [True: 0, False: 0]
  ------------------
  658|      0|            goto err;
  659|      0|        if (!BN_MONT_CTX_set(mont, m, ctx))
  ------------------
  |  Branch (659:13): [True: 0, False: 0]
  ------------------
  660|      0|            goto err;
  661|      0|    }
  662|       |
  663|     76|    if (a->neg || BN_ucmp(a, m) >= 0) {
  ------------------
  |  Branch (663:9): [True: 0, False: 76]
  |  Branch (663:19): [True: 0, False: 76]
  ------------------
  664|      0|        BIGNUM *reduced = BN_CTX_get(ctx);
  665|      0|        if (reduced == NULL
  ------------------
  |  Branch (665:13): [True: 0, False: 0]
  ------------------
  666|      0|            || !BN_nnmod(reduced, a, m, ctx)) {
  ------------------
  |  Branch (666:16): [True: 0, False: 0]
  ------------------
  667|      0|            goto err;
  668|      0|        }
  669|      0|        a = reduced;
  670|      0|    }
  671|       |
  672|     76|#ifdef RSAZ_ENABLED
  673|       |    /*
  674|       |     * If the size of the operands allow it, perform the optimized
  675|       |     * RSAZ exponentiation. For further information see
  676|       |     * crypto/bn/rsaz_exp.c and accompanying assembly modules.
  677|       |     */
  678|     76|    if ((16 == a->top) && (16 == p->top) && (BN_num_bits(m) == 1024)
  ------------------
  |  Branch (678:9): [True: 0, False: 76]
  |  Branch (678:27): [True: 0, False: 0]
  |  Branch (678:45): [True: 0, False: 0]
  ------------------
  679|      0|        && rsaz_avx2_eligible()) {
  ------------------
  |  Branch (679:12): [True: 0, False: 0]
  ------------------
  680|      0|        if (NULL == bn_wexpand(rr, 16))
  ------------------
  |  Branch (680:13): [True: 0, False: 0]
  ------------------
  681|      0|            goto err;
  682|      0|        RSAZ_1024_mod_exp_avx2(rr->d, a->d, p->d, m->d, mont->RR.d,
  683|      0|            mont->n0[0]);
  684|      0|        rr->top = 16;
  685|      0|        rr->neg = 0;
  686|      0|        bn_correct_top(rr);
  687|      0|        ret = 1;
  688|      0|        goto err;
  689|     76|    } else if ((8 == a->top) && (8 == p->top) && (BN_num_bits(m) == 512)) {
  ------------------
  |  Branch (689:16): [True: 0, False: 76]
  |  Branch (689:33): [True: 0, False: 0]
  |  Branch (689:50): [True: 0, False: 0]
  ------------------
  690|      0|        if (NULL == bn_wexpand(rr, 8))
  ------------------
  |  Branch (690:13): [True: 0, False: 0]
  ------------------
  691|      0|            goto err;
  692|      0|        RSAZ_512_mod_exp(rr->d, a->d, p->d, m->d, mont->n0[0], mont->RR.d);
  693|      0|        rr->top = 8;
  694|      0|        rr->neg = 0;
  695|      0|        bn_correct_top(rr);
  696|      0|        ret = 1;
  697|      0|        goto err;
  698|      0|    }
  699|     76|#endif
  700|       |
  701|       |    /* Get the window size to use with size of p. */
  702|     76|    window = BN_window_bits_for_ctime_exponent_size(bits);
  ------------------
  |  |  341|     76|    ((b) > 937 ? 6 : (b) > 306 ? 5                \
  |  |  ------------------
  |  |  |  Branch (341:6): [True: 0, False: 76]
  |  |  |  Branch (341:22): [True: 60, False: 16]
  |  |  ------------------
  |  |  342|     76|            : (b) > 89         ? 4                \
  |  |  ------------------
  |  |  |  Branch (342:15): [True: 16, False: 0]
  |  |  ------------------
  |  |  343|     16|            : (b) > 22         ? 3                \
  |  |  ------------------
  |  |  |  Branch (343:15): [True: 0, False: 0]
  |  |  ------------------
  |  |  344|      0|                               : 1)
  ------------------
  703|       |#if defined(SPARC_T4_MONT)
  704|       |    if (window >= 5 && (top & 15) == 0 && top <= 64 && (OPENSSL_sparcv9cap_P[1] & (CFR_MONTMUL | CFR_MONTSQR)) == (CFR_MONTMUL | CFR_MONTSQR) && (t4 = OPENSSL_sparcv9cap_P[0]))
  705|       |        window = 5;
  706|       |    else
  707|       |#endif
  708|     76|#if defined(OPENSSL_BN_ASM_MONT5)
  709|     76|        if (window >= 5 && top <= BN_SOFT_LIMIT) {
  ------------------
  |  |   62|     60|#define BN_SOFT_LIMIT (4096 / BN_BYTES)
  |  |  ------------------
  |  |  |  |   38|     60|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  |  Branch (709:13): [True: 60, False: 16]
  |  Branch (709:28): [True: 60, False: 0]
  ------------------
  710|     60|        window = 5; /* ~5% improvement for RSA2048 sign, and even
  711|       |                     * for RSA4096 */
  712|       |        /* reserve space for mont->N.d[] copy */
  713|     60|        powerbufLen += top * sizeof(mont->N.d[0]);
  714|     60|    }
  715|     76|#endif
  716|     76|    (void)0;
  717|       |
  718|       |    /*
  719|       |     * Allocate a buffer large enough to hold all of the pre-computed powers
  720|       |     * of am, am itself and tmp.
  721|       |     */
  722|     76|    numPowers = 1 << window;
  723|     76|    powerbufLen += sizeof(m->d[0]) * (top * numPowers + ((2 * top) > numPowers ? (2 * top) : numPowers));
  ------------------
  |  Branch (723:58): [True: 76, False: 0]
  ------------------
  724|     76|#ifdef alloca
  725|     76|    if (powerbufLen < 3072)
  ------------------
  |  Branch (725:9): [True: 0, False: 76]
  ------------------
  726|      0|        powerbufFree = alloca(powerbufLen + MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH);
  727|     76|    else
  728|     76|#endif
  729|     76|        if ((powerbufFree = OPENSSL_malloc(powerbufLen + MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH))
  ------------------
  |  |  106|     76|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (729:13): [True: 0, False: 76]
  ------------------
  730|     76|            == NULL)
  731|      0|        goto err;
  732|       |
  733|     76|    powerbuf = MOD_EXP_CTIME_ALIGN(powerbufFree);
  ------------------
  |  |  594|     76|    ((unsigned char *)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((size_t)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK))))
  |  |  ------------------
  |  |  |  |  326|     76|#define MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH (64)
  |  |  ------------------
  |  |                   ((unsigned char *)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((size_t)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK))))
  |  |  ------------------
  |  |  |  |  327|     76|#define MOD_EXP_CTIME_MIN_CACHE_LINE_MASK (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  326|     76|#define MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH (64)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  734|     76|    memset(powerbuf, 0, powerbufLen);
  735|       |
  736|     76|#ifdef alloca
  737|     76|    if (powerbufLen < 3072)
  ------------------
  |  Branch (737:9): [True: 0, False: 76]
  ------------------
  738|      0|        powerbufFree = NULL;
  739|     76|#endif
  740|       |
  741|       |    /* lay down tmp and am right after powers table */
  742|     76|    tmp.d = (BN_ULONG *)(powerbuf + sizeof(m->d[0]) * top * numPowers);
  743|     76|    am.d = tmp.d + top;
  744|     76|    tmp.top = am.top = 0;
  745|     76|    tmp.dmax = am.dmax = top;
  746|     76|    tmp.neg = am.neg = 0;
  747|     76|    tmp.flags = am.flags = BN_FLG_STATIC_DATA;
  ------------------
  |  |   59|     76|#define BN_FLG_STATIC_DATA 0x02
  ------------------
  748|       |
  749|       |    /* prepare a^0 in Montgomery domain */
  750|     76|#if 1 /* by Shay Gueron's suggestion */
  751|     76|    if (m->d[top - 1] & (((BN_ULONG)1) << (BN_BITS2 - 1))) {
  ------------------
  |  |   54|     76|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|     76|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  |  Branch (751:9): [True: 76, False: 0]
  ------------------
  752|       |        /* 2^(top*BN_BITS2) - m */
  753|     76|        tmp.d[0] = (0 - m->d[0]) & BN_MASK2;
  ------------------
  |  |   93|     76|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  754|  6.22k|        for (i = 1; i < top; i++)
  ------------------
  |  Branch (754:21): [True: 6.14k, False: 76]
  ------------------
  755|  6.14k|            tmp.d[i] = (~m->d[i]) & BN_MASK2;
  ------------------
  |  |   93|  6.14k|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  756|     76|        tmp.top = top;
  757|     76|    } else
  758|      0|#endif
  759|      0|        if (!bn_to_mont_fixed_top(&tmp, BN_value_one(), mont, ctx))
  ------------------
  |  Branch (759:13): [True: 0, False: 0]
  ------------------
  760|      0|        goto err;
  761|       |
  762|       |    /* prepare a^1 in Montgomery domain */
  763|     76|    if (!bn_to_mont_fixed_top(&am, a, mont, ctx))
  ------------------
  |  Branch (763:9): [True: 0, False: 76]
  ------------------
  764|      0|        goto err;
  765|       |
  766|     76|    if (top > BN_SOFT_LIMIT)
  ------------------
  |  |   62|     76|#define BN_SOFT_LIMIT (4096 / BN_BYTES)
  |  |  ------------------
  |  |  |  |   38|     76|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  |  Branch (766:9): [True: 0, False: 76]
  ------------------
  767|      0|        goto fallback;
  768|       |
  769|       |#if defined(SPARC_T4_MONT)
  770|       |    if (t4) {
  771|       |        typedef int (*bn_pwr5_mont_f)(BN_ULONG *tp, const BN_ULONG *np,
  772|       |            const BN_ULONG *n0, const void *table,
  773|       |            int power, int bits);
  774|       |        int bn_pwr5_mont_t4_8(BN_ULONG *tp, const BN_ULONG *np,
  775|       |            const BN_ULONG *n0, const void *table,
  776|       |            int power, int bits);
  777|       |        int bn_pwr5_mont_t4_16(BN_ULONG *tp, const BN_ULONG *np,
  778|       |            const BN_ULONG *n0, const void *table,
  779|       |            int power, int bits);
  780|       |        int bn_pwr5_mont_t4_24(BN_ULONG *tp, const BN_ULONG *np,
  781|       |            const BN_ULONG *n0, const void *table,
  782|       |            int power, int bits);
  783|       |        int bn_pwr5_mont_t4_32(BN_ULONG *tp, const BN_ULONG *np,
  784|       |            const BN_ULONG *n0, const void *table,
  785|       |            int power, int bits);
  786|       |        static const bn_pwr5_mont_f pwr5_funcs[4] = {
  787|       |            bn_pwr5_mont_t4_8, bn_pwr5_mont_t4_16,
  788|       |            bn_pwr5_mont_t4_24, bn_pwr5_mont_t4_32
  789|       |        };
  790|       |        bn_pwr5_mont_f pwr5_worker = pwr5_funcs[top / 16 - 1];
  791|       |
  792|       |        typedef int (*bn_mul_mont_f)(BN_ULONG *rp, const BN_ULONG *ap,
  793|       |            const void *bp, const BN_ULONG *np,
  794|       |            const BN_ULONG *n0);
  795|       |        int bn_mul_mont_t4_8(BN_ULONG *rp, const BN_ULONG *ap, const void *bp,
  796|       |            const BN_ULONG *np, const BN_ULONG *n0);
  797|       |        int bn_mul_mont_t4_16(BN_ULONG *rp, const BN_ULONG *ap,
  798|       |            const void *bp, const BN_ULONG *np,
  799|       |            const BN_ULONG *n0);
  800|       |        int bn_mul_mont_t4_24(BN_ULONG *rp, const BN_ULONG *ap,
  801|       |            const void *bp, const BN_ULONG *np,
  802|       |            const BN_ULONG *n0);
  803|       |        int bn_mul_mont_t4_32(BN_ULONG *rp, const BN_ULONG *ap,
  804|       |            const void *bp, const BN_ULONG *np,
  805|       |            const BN_ULONG *n0);
  806|       |        static const bn_mul_mont_f mul_funcs[4] = {
  807|       |            bn_mul_mont_t4_8, bn_mul_mont_t4_16,
  808|       |            bn_mul_mont_t4_24, bn_mul_mont_t4_32
  809|       |        };
  810|       |        bn_mul_mont_f mul_worker = mul_funcs[top / 16 - 1];
  811|       |
  812|       |        void bn_mul_mont_vis3(BN_ULONG *rp, const BN_ULONG *ap,
  813|       |            const void *bp, const BN_ULONG *np,
  814|       |            const BN_ULONG *n0, int num);
  815|       |        void bn_mul_mont_t4(BN_ULONG *rp, const BN_ULONG *ap,
  816|       |            const void *bp, const BN_ULONG *np,
  817|       |            const BN_ULONG *n0, int num);
  818|       |        void bn_mul_mont_gather5_t4(BN_ULONG *rp, const BN_ULONG *ap,
  819|       |            const void *table, const BN_ULONG *np,
  820|       |            const BN_ULONG *n0, int num, int power);
  821|       |        void bn_flip_n_scatter5_t4(const BN_ULONG *inp, size_t num,
  822|       |            void *table, size_t power);
  823|       |        void bn_gather5_t4(BN_ULONG *out, size_t num,
  824|       |            void *table, size_t power);
  825|       |        void bn_flip_t4(BN_ULONG *dst, BN_ULONG *src, size_t num);
  826|       |
  827|       |        BN_ULONG *np = mont->N.d, *n0 = mont->n0;
  828|       |        int stride = 5 * (6 - (top / 16 - 1)); /* multiple of 5, but less
  829|       |                                                * than 32 */
  830|       |
  831|       |        /*
  832|       |         * BN_to_montgomery can contaminate words above .top [in
  833|       |         * BN_DEBUG build...
  834|       |         */
  835|       |        for (i = am.top; i < top; i++)
  836|       |            am.d[i] = 0;
  837|       |        for (i = tmp.top; i < top; i++)
  838|       |            tmp.d[i] = 0;
  839|       |
  840|       |        bn_flip_n_scatter5_t4(tmp.d, top, powerbuf, 0);
  841|       |        bn_flip_n_scatter5_t4(am.d, top, powerbuf, 1);
  842|       |        if (!(*mul_worker)(tmp.d, am.d, am.d, np, n0) && !(*mul_worker)(tmp.d, am.d, am.d, np, n0))
  843|       |            bn_mul_mont_vis3(tmp.d, am.d, am.d, np, n0, top);
  844|       |        bn_flip_n_scatter5_t4(tmp.d, top, powerbuf, 2);
  845|       |
  846|       |        for (i = 3; i < 32; i++) {
  847|       |            /* Calculate a^i = a^(i-1) * a */
  848|       |            if (!(*mul_worker)(tmp.d, tmp.d, am.d, np, n0) && !(*mul_worker)(tmp.d, tmp.d, am.d, np, n0))
  849|       |                bn_mul_mont_vis3(tmp.d, tmp.d, am.d, np, n0, top);
  850|       |            bn_flip_n_scatter5_t4(tmp.d, top, powerbuf, i);
  851|       |        }
  852|       |
  853|       |        /* switch to 64-bit domain */
  854|       |        np = alloca(top * sizeof(BN_ULONG));
  855|       |        top /= 2;
  856|       |        bn_flip_t4(np, mont->N.d, top);
  857|       |
  858|       |        /*
  859|       |         * The exponent may not have a whole number of fixed-size windows.
  860|       |         * To simplify the main loop, the initial window has between 1 and
  861|       |         * full-window-size bits such that what remains is always a whole
  862|       |         * number of windows
  863|       |         */
  864|       |        window0 = (bits - 1) % 5 + 1;
  865|       |        wmask = (1 << window0) - 1;
  866|       |        bits -= window0;
  867|       |        wvalue = bn_get_bits(p, bits) & wmask;
  868|       |        bn_gather5_t4(tmp.d, top, powerbuf, wvalue);
  869|       |
  870|       |        /*
  871|       |         * Scan the exponent one window at a time starting from the most
  872|       |         * significant bits.
  873|       |         */
  874|       |        while (bits > 0) {
  875|       |            if (bits < stride)
  876|       |                stride = bits;
  877|       |            bits -= stride;
  878|       |            wvalue = bn_get_bits(p, bits);
  879|       |
  880|       |            if ((*pwr5_worker)(tmp.d, np, n0, powerbuf, wvalue, stride))
  881|       |                continue;
  882|       |            /* retry once and fall back */
  883|       |            if ((*pwr5_worker)(tmp.d, np, n0, powerbuf, wvalue, stride))
  884|       |                continue;
  885|       |
  886|       |            bits += stride - 5;
  887|       |            wvalue >>= stride - 5;
  888|       |            wvalue &= 31;
  889|       |            bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
  890|       |            bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
  891|       |            bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
  892|       |            bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
  893|       |            bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
  894|       |            bn_mul_mont_gather5_t4(tmp.d, tmp.d, powerbuf, np, n0, top,
  895|       |                wvalue);
  896|       |        }
  897|       |
  898|       |        bn_flip_t4(tmp.d, tmp.d, top);
  899|       |        top *= 2;
  900|       |        /* back to 32-bit domain */
  901|       |        tmp.top = top;
  902|       |        bn_correct_top(&tmp);
  903|       |        OPENSSL_cleanse(np, top * sizeof(BN_ULONG));
  904|       |    } else
  905|       |#endif
  906|     76|#if defined(OPENSSL_BN_ASM_MONT5)
  907|     76|        if (window == 5 && top > 1) {
  ------------------
  |  Branch (907:13): [True: 60, False: 16]
  |  Branch (907:28): [True: 60, False: 0]
  ------------------
  908|       |        /*
  909|       |         * This optimization uses ideas from https://eprint.iacr.org/2011/239,
  910|       |         * specifically optimization of cache-timing attack countermeasures,
  911|       |         * pre-computation optimization, and Almost Montgomery Multiplication.
  912|       |         *
  913|       |         * The paper discusses a 4-bit window to optimize 512-bit modular
  914|       |         * exponentiation, used in RSA-1024 with CRT, but RSA-1024 is no longer
  915|       |         * important.
  916|       |         *
  917|       |         * |bn_mul_mont_gather5| and |bn_power5| implement the "almost"
  918|       |         * reduction variant, so the values here may not be fully reduced.
  919|       |         * They are bounded by R (i.e. they fit in |top| words), not |m|.
  920|       |         * Additionally, we pass these "almost" reduced inputs into
  921|       |         * |bn_mul_mont|, which implements the normal reduction variant.
  922|       |         * Given those inputs, |bn_mul_mont| may not give reduced
  923|       |         * output, but it will still produce "almost" reduced output.
  924|       |         */
  925|     60|        void bn_mul_mont_gather5(BN_ULONG *rp, const BN_ULONG *ap,
  926|     60|            const void *table, const BN_ULONG *np,
  927|     60|            const BN_ULONG *n0, int num, int power);
  928|     60|        void bn_scatter5(const BN_ULONG *inp, size_t num,
  929|     60|            void *table, size_t power);
  930|     60|        void bn_gather5(BN_ULONG *out, size_t num, void *table, size_t power);
  931|     60|        void bn_power5(BN_ULONG *rp, const BN_ULONG *ap,
  932|     60|            const void *table, const BN_ULONG *np,
  933|     60|            const BN_ULONG *n0, int num, int power);
  934|     60|        int bn_get_bits5(const BN_ULONG *ap, int off);
  935|       |
  936|     60|        BN_ULONG *n0 = mont->n0, *np;
  ------------------
  |  |   37|     60|#define BN_ULONG unsigned long
  ------------------
  937|       |
  938|       |        /*
  939|       |         * BN_to_montgomery can contaminate words above .top [in
  940|       |         * BN_DEBUG build...
  941|       |         */
  942|     60|        for (i = am.top; i < top; i++)
  ------------------
  |  Branch (942:26): [True: 0, False: 60]
  ------------------
  943|      0|            am.d[i] = 0;
  944|     60|        for (i = tmp.top; i < top; i++)
  ------------------
  |  Branch (944:27): [True: 0, False: 60]
  ------------------
  945|      0|            tmp.d[i] = 0;
  946|       |
  947|       |        /*
  948|       |         * copy mont->N.d[] to improve cache locality
  949|       |         */
  950|  5.77k|        for (np = am.d + top, i = 0; i < top; i++)
  ------------------
  |  Branch (950:38): [True: 5.71k, False: 60]
  ------------------
  951|  5.71k|            np[i] = mont->N.d[i];
  952|       |
  953|     60|        bn_scatter5(tmp.d, top, powerbuf, 0);
  954|     60|        bn_scatter5(am.d, am.top, powerbuf, 1);
  955|     60|        bn_mul_mont(tmp.d, am.d, am.d, np, n0, top);
  956|     60|        bn_scatter5(tmp.d, top, powerbuf, 2);
  957|       |
  958|       |#if 0
  959|       |        for (i = 3; i < 32; i++) {
  960|       |            /* Calculate a^i = a^(i-1) * a */
  961|       |            bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1);
  962|       |            bn_scatter5(tmp.d, top, powerbuf, i);
  963|       |        }
  964|       |#else
  965|       |        /* same as above, but uses squaring for 1/2 of operations */
  966|    240|        for (i = 4; i < 32; i *= 2) {
  ------------------
  |  Branch (966:21): [True: 180, False: 60]
  ------------------
  967|    180|            bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
  968|    180|            bn_scatter5(tmp.d, top, powerbuf, i);
  969|    180|        }
  970|    240|        for (i = 3; i < 8; i += 2) {
  ------------------
  |  Branch (970:21): [True: 180, False: 60]
  ------------------
  971|    180|            int j;
  972|    180|            bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1);
  973|    180|            bn_scatter5(tmp.d, top, powerbuf, i);
  974|    600|            for (j = 2 * i; j < 32; j *= 2) {
  ------------------
  |  Branch (974:29): [True: 420, False: 180]
  ------------------
  975|    420|                bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
  976|    420|                bn_scatter5(tmp.d, top, powerbuf, j);
  977|    420|            }
  978|    180|        }
  979|    300|        for (; i < 16; i += 2) {
  ------------------
  |  Branch (979:16): [True: 240, False: 60]
  ------------------
  980|    240|            bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1);
  981|    240|            bn_scatter5(tmp.d, top, powerbuf, i);
  982|    240|            bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
  983|    240|            bn_scatter5(tmp.d, top, powerbuf, 2 * i);
  984|    240|        }
  985|    540|        for (; i < 32; i += 2) {
  ------------------
  |  Branch (985:16): [True: 480, False: 60]
  ------------------
  986|    480|            bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1);
  987|    480|            bn_scatter5(tmp.d, top, powerbuf, i);
  988|    480|        }
  989|     60|#endif
  990|       |        /*
  991|       |         * The exponent may not have a whole number of fixed-size windows.
  992|       |         * To simplify the main loop, the initial window has between 1 and
  993|       |         * full-window-size bits such that what remains is always a whole
  994|       |         * number of windows
  995|       |         */
  996|     60|        window0 = (bits - 1) % 5 + 1;
  997|     60|        wmask = (1 << window0) - 1;
  998|     60|        bits -= window0;
  999|     60|        wvalue = bn_get_bits(p, bits) & wmask;
 1000|     60|        bn_gather5(tmp.d, top, powerbuf, wvalue);
 1001|       |
 1002|       |        /*
 1003|       |         * Scan the exponent one window at a time starting from the most
 1004|       |         * significant bits.
 1005|       |         */
 1006|     60|        if (top & 7) {
  ------------------
  |  Branch (1006:13): [True: 0, False: 60]
  ------------------
 1007|      0|            while (bits > 0) {
  ------------------
  |  Branch (1007:20): [True: 0, False: 0]
  ------------------
 1008|      0|                bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
 1009|      0|                bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
 1010|      0|                bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
 1011|      0|                bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
 1012|      0|                bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
 1013|      0|                bn_mul_mont_gather5(tmp.d, tmp.d, powerbuf, np, n0, top,
 1014|      0|                    bn_get_bits5(p->d, bits -= 5));
 1015|      0|            }
 1016|     60|        } else {
 1017|  4.82k|            while (bits > 0) {
  ------------------
  |  Branch (1017:20): [True: 4.76k, False: 60]
  ------------------
 1018|  4.76k|                bn_power5(tmp.d, tmp.d, powerbuf, np, n0, top,
 1019|  4.76k|                    bn_get_bits5(p->d, bits -= 5));
 1020|  4.76k|            }
 1021|     60|        }
 1022|       |
 1023|     60|        tmp.top = top;
 1024|       |        /*
 1025|       |         * The result is now in |tmp| in Montgomery form, but it may not be
 1026|       |         * fully reduced. This is within bounds for |BN_from_montgomery|
 1027|       |         * (tmp < R <= m*R) so it will, when converting from Montgomery form,
 1028|       |         * produce a fully reduced result.
 1029|       |         *
 1030|       |         * This differs from Figure 2 of the paper, which uses AMM(h, 1) to
 1031|       |         * convert from Montgomery form with unreduced output, followed by an
 1032|       |         * extra reduction step. In the paper's terminology, we replace
 1033|       |         * steps 9 and 10 with MM(h, 1).
 1034|       |         */
 1035|     60|    } else
 1036|     16|#endif
 1037|     16|    {
 1038|     16|    fallback:
 1039|     16|        if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 0, window))
  ------------------
  |  Branch (1039:13): [True: 0, False: 16]
  ------------------
 1040|      0|            goto err;
 1041|     16|        if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&am, top, powerbuf, 1, window))
  ------------------
  |  Branch (1041:13): [True: 0, False: 16]
  ------------------
 1042|      0|            goto err;
 1043|       |
 1044|       |        /*
 1045|       |         * If the window size is greater than 1, then calculate
 1046|       |         * val[i=2..2^winsize-1]. Powers are computed as a*a^(i-1) (even
 1047|       |         * powers could instead be computed as (a^(i/2))^2 to use the slight
 1048|       |         * performance advantage of sqr over mul).
 1049|       |         */
 1050|     16|        if (window > 1) {
  ------------------
  |  Branch (1050:13): [True: 16, False: 0]
  ------------------
 1051|     16|            if (!bn_mul_mont_fixed_top(&tmp, &am, &am, mont, ctx))
  ------------------
  |  Branch (1051:17): [True: 0, False: 16]
  ------------------
 1052|      0|                goto err;
 1053|     16|            if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 2,
  ------------------
  |  Branch (1053:17): [True: 0, False: 16]
  ------------------
 1054|     16|                    window))
 1055|      0|                goto err;
 1056|    224|            for (i = 3; i < numPowers; i++) {
  ------------------
  |  Branch (1056:25): [True: 208, False: 16]
  ------------------
 1057|       |                /* Calculate a^i = a^(i-1) * a */
 1058|    208|                if (!bn_mul_mont_fixed_top(&tmp, &am, &tmp, mont, ctx))
  ------------------
  |  Branch (1058:21): [True: 0, False: 208]
  ------------------
 1059|      0|                    goto err;
 1060|    208|                if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, i,
  ------------------
  |  Branch (1060:21): [True: 0, False: 208]
  ------------------
 1061|    208|                        window))
 1062|      0|                    goto err;
 1063|    208|            }
 1064|     16|        }
 1065|       |
 1066|       |        /*
 1067|       |         * The exponent may not have a whole number of fixed-size windows.
 1068|       |         * To simplify the main loop, the initial window has between 1 and
 1069|       |         * full-window-size bits such that what remains is always a whole
 1070|       |         * number of windows
 1071|       |         */
 1072|     16|        window0 = (bits - 1) % window + 1;
 1073|     16|        wmask = (1 << window0) - 1;
 1074|     16|        bits -= window0;
 1075|     16|        wvalue = bn_get_bits(p, bits) & wmask;
 1076|     16|        if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&tmp, top, powerbuf, wvalue,
  ------------------
  |  Branch (1076:13): [True: 0, False: 16]
  ------------------
 1077|     16|                window))
 1078|      0|            goto err;
 1079|       |
 1080|     16|        wmask = (1 << window) - 1;
 1081|       |        /*
 1082|       |         * Scan the exponent one window at a time starting from the most
 1083|       |         * significant bits.
 1084|       |         */
 1085|  1.02k|        while (bits > 0) {
  ------------------
  |  Branch (1085:16): [True: 1.00k, False: 16]
  ------------------
 1086|       |
 1087|       |            /* Square the result window-size times */
 1088|  5.04k|            for (i = 0; i < window; i++)
  ------------------
  |  Branch (1088:25): [True: 4.03k, False: 1.00k]
  ------------------
 1089|  4.03k|                if (!bn_mul_mont_fixed_top(&tmp, &tmp, &tmp, mont, ctx))
  ------------------
  |  Branch (1089:21): [True: 0, False: 4.03k]
  ------------------
 1090|      0|                    goto err;
 1091|       |
 1092|       |            /*
 1093|       |             * Get a window's worth of bits from the exponent
 1094|       |             * This avoids calling BN_is_bit_set for each bit, which
 1095|       |             * is not only slower but also makes each bit vulnerable to
 1096|       |             * EM (and likely other) side-channel attacks like One&Done
 1097|       |             * (for details see "One&Done: A Single-Decryption EM-Based
 1098|       |             *  Attack on OpenSSL's Constant-Time Blinded RSA" by M. Alam,
 1099|       |             *  H. Khan, M. Dey, N. Sinha, R. Callan, A. Zajic, and
 1100|       |             *  M. Prvulovic, in USENIX Security'18)
 1101|       |             */
 1102|  1.00k|            bits -= window;
 1103|  1.00k|            wvalue = bn_get_bits(p, bits) & wmask;
 1104|       |            /*
 1105|       |             * Fetch the appropriate pre-computed value from the pre-buf
 1106|       |             */
 1107|  1.00k|            if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&am, top, powerbuf, wvalue,
  ------------------
  |  Branch (1107:17): [True: 0, False: 1.00k]
  ------------------
 1108|  1.00k|                    window))
 1109|      0|                goto err;
 1110|       |
 1111|       |            /* Multiply the result into the intermediate result */
 1112|  1.00k|            if (!bn_mul_mont_fixed_top(&tmp, &tmp, &am, mont, ctx))
  ------------------
  |  Branch (1112:17): [True: 0, False: 1.00k]
  ------------------
 1113|      0|                goto err;
 1114|  1.00k|        }
 1115|     16|    }
 1116|       |
 1117|       |    /*
 1118|       |     * Done with zero-padded intermediate BIGNUMs. Final BN_from_montgomery
 1119|       |     * removes padding [if any] and makes return value suitable for public
 1120|       |     * API consumer.
 1121|       |     */
 1122|       |#if defined(SPARC_T4_MONT)
 1123|       |    if (OPENSSL_sparcv9cap_P[0] & (SPARCV9_VIS3 | SPARCV9_PREFER_FPU)) {
 1124|       |        am.d[0] = 1; /* borrow am */
 1125|       |        for (i = 1; i < top; i++)
 1126|       |            am.d[i] = 0;
 1127|       |        if (!BN_mod_mul_montgomery(rr, &tmp, &am, mont, ctx))
 1128|       |            goto err;
 1129|       |    } else
 1130|       |#endif
 1131|     76|        if (!bn_from_mont_fixed_top(rr, &tmp, mont, ctx))
  ------------------
  |  Branch (1131:13): [True: 0, False: 76]
  ------------------
 1132|      0|        goto err;
 1133|     76|    ret = 1;
 1134|     76|err:
 1135|     76|    if (in_mont == NULL)
  ------------------
  |  Branch (1135:9): [True: 0, False: 76]
  ------------------
 1136|      0|        BN_MONT_CTX_free(mont);
 1137|     76|    if (powerbuf != NULL) {
  ------------------
  |  Branch (1137:9): [True: 76, False: 0]
  ------------------
 1138|     76|        OPENSSL_cleanse(powerbuf, powerbufLen);
 1139|     76|        OPENSSL_free(powerbufFree);
  ------------------
  |  |  131|     76|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1140|     76|    }
 1141|     76|    BN_CTX_end(ctx);
 1142|     76|    return ret;
 1143|     76|}
BN_mod_exp_mont_consttime:
 1148|     76|{
 1149|     76|    bn_check_top(a);
 1150|     76|    bn_check_top(p);
 1151|     76|    bn_check_top(m);
 1152|     76|    if (!bn_mod_exp_mont_fixed_top(rr, a, p, m, ctx, in_mont))
  ------------------
  |  Branch (1152:9): [True: 0, False: 76]
  ------------------
 1153|      0|        return 0;
 1154|     76|    bn_correct_top(rr);
 1155|     76|    return 1;
 1156|     76|}
bn_exp.c:bn_get_bits:
  488|  1.08k|{
  489|  1.08k|    BN_ULONG ret = 0;
  ------------------
  |  |   37|  1.08k|#define BN_ULONG unsigned long
  ------------------
  490|  1.08k|    int wordpos;
  491|       |
  492|  1.08k|    wordpos = bitpos / BN_BITS2;
  ------------------
  |  |   54|  1.08k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.08k|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  493|  1.08k|    bitpos %= BN_BITS2;
  ------------------
  |  |   54|  1.08k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.08k|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  494|  1.08k|    if (wordpos >= 0 && wordpos < a->top) {
  ------------------
  |  Branch (494:9): [True: 1.08k, False: 0]
  |  Branch (494:25): [True: 1.08k, False: 0]
  ------------------
  495|  1.08k|        ret = a->d[wordpos] & BN_MASK2;
  ------------------
  |  |   93|  1.08k|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  496|  1.08k|        if (bitpos) {
  ------------------
  |  Branch (496:13): [True: 1.02k, False: 64]
  ------------------
  497|  1.02k|            ret >>= bitpos;
  498|  1.02k|            if (++wordpos < a->top)
  ------------------
  |  Branch (498:17): [True: 720, False: 300]
  ------------------
  499|    720|                ret |= a->d[wordpos] << (BN_BITS2 - bitpos);
  ------------------
  |  |   54|    720|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|    720|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  500|  1.02k|        }
  501|  1.08k|    }
  502|       |
  503|  1.08k|    return ret & BN_MASK2;
  ------------------
  |  |   93|  1.08k|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  504|  1.08k|}
bn_exp.c:MOD_EXP_CTIME_COPY_TO_PREBUF:
  516|    256|{
  517|    256|    int i, j;
  518|    256|    int width = 1 << window;
  519|    256|    BN_ULONG *table = (BN_ULONG *)buf;
  ------------------
  |  |   37|    256|#define BN_ULONG unsigned long
  ------------------
  520|       |
  521|    256|    if (top > b->top)
  ------------------
  |  Branch (521:9): [True: 0, False: 256]
  ------------------
  522|      0|        top = b->top; /* this works because 'buf' is explicitly
  523|       |                       * zeroed */
  524|  8.44k|    for (i = 0, j = idx; i < top; i++, j += width) {
  ------------------
  |  Branch (524:26): [True: 8.19k, False: 256]
  ------------------
  525|  8.19k|        table[j] = b->d[i];
  526|  8.19k|    }
  527|       |
  528|    256|    return 1;
  529|    256|}
bn_exp.c:MOD_EXP_CTIME_COPY_FROM_PREBUF:
  534|  1.02k|{
  535|  1.02k|    int i, j;
  536|  1.02k|    int width = 1 << window;
  537|       |    /*
  538|       |     * We declare table 'volatile' in order to discourage compiler
  539|       |     * from reordering loads from the table. Concern is that if
  540|       |     * reordered in specific manner loads might give away the
  541|       |     * information we are trying to conceal. Some would argue that
  542|       |     * compiler can reorder them anyway, but it can as well be
  543|       |     * argued that doing so would be violation of standard...
  544|       |     */
  545|  1.02k|    volatile BN_ULONG *table = (volatile BN_ULONG *)buf;
  546|       |
  547|  1.02k|    if (bn_wexpand(b, top) == NULL)
  ------------------
  |  Branch (547:9): [True: 0, False: 1.02k]
  ------------------
  548|      0|        return 0;
  549|       |
  550|  1.02k|    if (window <= 3) {
  ------------------
  |  Branch (550:9): [True: 0, False: 1.02k]
  ------------------
  551|      0|        for (i = 0; i < top; i++, table += width) {
  ------------------
  |  Branch (551:21): [True: 0, False: 0]
  ------------------
  552|      0|            BN_ULONG acc = 0;
  ------------------
  |  |   37|      0|#define BN_ULONG unsigned long
  ------------------
  553|       |
  554|      0|            for (j = 0; j < width; j++) {
  ------------------
  |  Branch (554:25): [True: 0, False: 0]
  ------------------
  555|      0|                acc |= table[j] & ((BN_ULONG)0 - (constant_time_eq_int(j, idx) & 1));
  556|      0|            }
  557|       |
  558|      0|            b->d[i] = acc;
  559|      0|        }
  560|  1.02k|    } else {
  561|  1.02k|        int xstride = 1 << (window - 2);
  562|  1.02k|        BN_ULONG y0, y1, y2, y3;
  ------------------
  |  |   37|  1.02k|#define BN_ULONG unsigned long
  ------------------
  563|       |
  564|  1.02k|        i = idx >> (window - 2); /* equivalent of idx / xstride */
  565|  1.02k|        idx &= xstride - 1; /* equivalent of idx % xstride */
  566|       |
  567|  1.02k|        y0 = (BN_ULONG)0 - (constant_time_eq_int(i, 0) & 1);
  568|  1.02k|        y1 = (BN_ULONG)0 - (constant_time_eq_int(i, 1) & 1);
  569|  1.02k|        y2 = (BN_ULONG)0 - (constant_time_eq_int(i, 2) & 1);
  570|  1.02k|        y3 = (BN_ULONG)0 - (constant_time_eq_int(i, 3) & 1);
  571|       |
  572|  33.7k|        for (i = 0; i < top; i++, table += width) {
  ------------------
  |  Branch (572:21): [True: 32.7k, False: 1.02k]
  ------------------
  573|  32.7k|            BN_ULONG acc = 0;
  ------------------
  |  |   37|  32.7k|#define BN_ULONG unsigned long
  ------------------
  574|       |
  575|   163k|            for (j = 0; j < xstride; j++) {
  ------------------
  |  Branch (575:25): [True: 131k, False: 32.7k]
  ------------------
  576|   131k|                acc |= ((table[j + 0 * xstride] & y0) | (table[j + 1 * xstride] & y1) | (table[j + 2 * xstride] & y2) | (table[j + 3 * xstride] & y3))
  577|   131k|                    & ((BN_ULONG)0 - (constant_time_eq_int(j, idx) & 1));
  578|   131k|            }
  579|       |
  580|  32.7k|            b->d[i] = acc;
  581|  32.7k|        }
  582|  1.02k|    }
  583|       |
  584|  1.02k|    b->top = top;
  585|  1.02k|    b->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  221|  1.02k|#define BN_FLG_FIXED_TOP 0
  ------------------
  586|  1.02k|    return 1;
  587|  1.02k|}

int_bn_mod_inverse:
  200|   102k|{
  201|   102k|    BIGNUM *A, *B, *X, *Y, *M, *D, *T, *R = NULL;
  202|   102k|    BIGNUM *ret = NULL;
  203|   102k|    int sign;
  204|       |
  205|       |    /* This is invalid input so we don't worry about constant time here */
  206|   102k|    if (BN_abs_is_word(n, 1) || BN_is_zero(n)) {
  ------------------
  |  Branch (206:9): [True: 0, False: 102k]
  |  Branch (206:33): [True: 0, False: 102k]
  ------------------
  207|      0|        *pnoinv = 1;
  208|      0|        return NULL;
  209|      0|    }
  210|       |
  211|   102k|    *pnoinv = 0;
  212|       |
  213|   102k|    if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0)
  ------------------
  |  |   67|   102k|#define BN_FLG_CONSTTIME 0x04
  ------------------
  |  Branch (213:9): [True: 0, False: 102k]
  ------------------
  214|   102k|        || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) {
  ------------------
  |  |   67|   102k|#define BN_FLG_CONSTTIME 0x04
  ------------------
  |  Branch (214:12): [True: 0, False: 102k]
  ------------------
  215|      0|        return bn_mod_inverse_no_branch(in, a, n, ctx, pnoinv);
  216|      0|    }
  217|       |
  218|   102k|    bn_check_top(a);
  219|   102k|    bn_check_top(n);
  220|       |
  221|   102k|    BN_CTX_start(ctx);
  222|   102k|    A = BN_CTX_get(ctx);
  223|   102k|    B = BN_CTX_get(ctx);
  224|   102k|    X = BN_CTX_get(ctx);
  225|   102k|    D = BN_CTX_get(ctx);
  226|   102k|    M = BN_CTX_get(ctx);
  227|   102k|    Y = BN_CTX_get(ctx);
  228|   102k|    T = BN_CTX_get(ctx);
  229|   102k|    if (T == NULL)
  ------------------
  |  Branch (229:9): [True: 0, False: 102k]
  ------------------
  230|      0|        goto err;
  231|       |
  232|   102k|    if (in == NULL)
  ------------------
  |  Branch (232:9): [True: 0, False: 102k]
  ------------------
  233|      0|        R = BN_new();
  234|   102k|    else
  235|   102k|        R = in;
  236|   102k|    if (R == NULL)
  ------------------
  |  Branch (236:9): [True: 0, False: 102k]
  ------------------
  237|      0|        goto err;
  238|       |
  239|   102k|    if (!BN_one(X))
  ------------------
  |  |  196|   102k|#define BN_one(a) (BN_set_word((a), 1))
  ------------------
  |  Branch (239:9): [True: 0, False: 102k]
  ------------------
  240|      0|        goto err;
  241|   102k|    BN_zero(Y);
  ------------------
  |  |  201|   102k|#define BN_zero(a) BN_zero_ex(a)
  ------------------
  242|   102k|    if (BN_copy(B, a) == NULL)
  ------------------
  |  Branch (242:9): [True: 0, False: 102k]
  ------------------
  243|      0|        goto err;
  244|   102k|    if (BN_copy(A, n) == NULL)
  ------------------
  |  Branch (244:9): [True: 0, False: 102k]
  ------------------
  245|      0|        goto err;
  246|   102k|    A->neg = 0;
  247|   102k|    if (B->neg || (BN_ucmp(B, A) >= 0)) {
  ------------------
  |  Branch (247:9): [True: 0, False: 102k]
  |  Branch (247:19): [True: 102k, False: 0]
  ------------------
  248|   102k|        if (!BN_nnmod(B, B, A, ctx))
  ------------------
  |  Branch (248:13): [True: 0, False: 102k]
  ------------------
  249|      0|            goto err;
  250|   102k|    }
  251|   102k|    sign = -1;
  252|       |    /*-
  253|       |     * From  B = a mod |n|,  A = |n|  it follows that
  254|       |     *
  255|       |     *      0 <= B < A,
  256|       |     *     -sign*X*a  ==  B   (mod |n|),
  257|       |     *      sign*Y*a  ==  A   (mod |n|).
  258|       |     */
  259|       |
  260|   102k|    if (BN_is_odd(n) && (BN_num_bits(n) <= 2048)) {
  ------------------
  |  Branch (260:9): [True: 102k, False: 0]
  |  Branch (260:25): [True: 102k, False: 0]
  ------------------
  261|       |        /*
  262|       |         * Binary inversion algorithm; requires odd modulus. This is faster
  263|       |         * than the general algorithm if the modulus is sufficiently small
  264|       |         * (about 400 .. 500 bits on 32-bit systems, but much more on 64-bit
  265|       |         * systems)
  266|       |         */
  267|   102k|        int shift;
  268|       |
  269|  6.63M|        while (!BN_is_zero(B)) {
  ------------------
  |  Branch (269:16): [True: 6.53M, False: 102k]
  ------------------
  270|       |            /*-
  271|       |             *      0 < B < |n|,
  272|       |             *      0 < A <= |n|,
  273|       |             * (1) -sign*X*a  ==  B   (mod |n|),
  274|       |             * (2)  sign*Y*a  ==  A   (mod |n|)
  275|       |             */
  276|       |
  277|       |            /*
  278|       |             * Now divide B by the maximum possible power of two in the
  279|       |             * integers, and divide X by the same value mod |n|. When we're
  280|       |             * done, (1) still holds.
  281|       |             */
  282|  6.53M|            shift = 0;
  283|  9.69M|            while (!BN_is_bit_set(B, shift)) { /* note that 0 < B */
  ------------------
  |  Branch (283:20): [True: 3.16M, False: 6.53M]
  ------------------
  284|  3.16M|                shift++;
  285|       |
  286|  3.16M|                if (BN_is_odd(X)) {
  ------------------
  |  Branch (286:21): [True: 1.63M, False: 1.53M]
  ------------------
  287|  1.63M|                    if (!BN_uadd(X, X, n))
  ------------------
  |  Branch (287:25): [True: 0, False: 1.63M]
  ------------------
  288|      0|                        goto err;
  289|  1.63M|                }
  290|       |                /*
  291|       |                 * now X is even, so we can easily divide it by two
  292|       |                 */
  293|  3.16M|                if (!BN_rshift1(X, X))
  ------------------
  |  Branch (293:21): [True: 0, False: 3.16M]
  ------------------
  294|      0|                    goto err;
  295|  3.16M|            }
  296|  6.53M|            if (shift > 0) {
  ------------------
  |  Branch (296:17): [True: 3.16M, False: 3.36M]
  ------------------
  297|  3.16M|                if (!BN_rshift(B, B, shift))
  ------------------
  |  Branch (297:21): [True: 0, False: 3.16M]
  ------------------
  298|      0|                    goto err;
  299|  3.16M|            }
  300|       |
  301|       |            /*
  302|       |             * Same for A and Y.  Afterwards, (2) still holds.
  303|       |             */
  304|  6.53M|            shift = 0;
  305|  9.79M|            while (!BN_is_bit_set(A, shift)) { /* note that 0 < A */
  ------------------
  |  Branch (305:20): [True: 3.26M, False: 6.53M]
  ------------------
  306|  3.26M|                shift++;
  307|       |
  308|  3.26M|                if (BN_is_odd(Y)) {
  ------------------
  |  Branch (308:21): [True: 1.53M, False: 1.73M]
  ------------------
  309|  1.53M|                    if (!BN_uadd(Y, Y, n))
  ------------------
  |  Branch (309:25): [True: 0, False: 1.53M]
  ------------------
  310|      0|                        goto err;
  311|  1.53M|                }
  312|       |                /* now Y is even */
  313|  3.26M|                if (!BN_rshift1(Y, Y))
  ------------------
  |  Branch (313:21): [True: 0, False: 3.26M]
  ------------------
  314|      0|                    goto err;
  315|  3.26M|            }
  316|  6.53M|            if (shift > 0) {
  ------------------
  |  Branch (316:17): [True: 3.26M, False: 3.26M]
  ------------------
  317|  3.26M|                if (!BN_rshift(A, A, shift))
  ------------------
  |  Branch (317:21): [True: 0, False: 3.26M]
  ------------------
  318|      0|                    goto err;
  319|  3.26M|            }
  320|       |
  321|       |            /*-
  322|       |             * We still have (1) and (2).
  323|       |             * Both  A  and  B  are odd.
  324|       |             * The following computations ensure that
  325|       |             *
  326|       |             *     0 <= B < |n|,
  327|       |             *      0 < A < |n|,
  328|       |             * (1) -sign*X*a  ==  B   (mod |n|),
  329|       |             * (2)  sign*Y*a  ==  A   (mod |n|),
  330|       |             *
  331|       |             * and that either  A  or  B  is even in the next iteration.
  332|       |             */
  333|  6.53M|            if (BN_ucmp(B, A) >= 0) {
  ------------------
  |  Branch (333:17): [True: 3.26M, False: 3.26M]
  ------------------
  334|       |                /* -sign*(X + Y)*a == B - A  (mod |n|) */
  335|  3.26M|                if (!BN_uadd(X, X, Y))
  ------------------
  |  Branch (335:21): [True: 0, False: 3.26M]
  ------------------
  336|      0|                    goto err;
  337|       |                /*
  338|       |                 * NB: we could use BN_mod_add_quick(X, X, Y, n), but that
  339|       |                 * actually makes the algorithm slower
  340|       |                 */
  341|  3.26M|                if (!BN_usub(B, B, A))
  ------------------
  |  Branch (341:21): [True: 0, False: 3.26M]
  ------------------
  342|      0|                    goto err;
  343|  3.26M|            } else {
  344|       |                /*  sign*(X + Y)*a == A - B  (mod |n|) */
  345|  3.26M|                if (!BN_uadd(Y, Y, X))
  ------------------
  |  Branch (345:21): [True: 0, False: 3.26M]
  ------------------
  346|      0|                    goto err;
  347|       |                /*
  348|       |                 * as above, BN_mod_add_quick(Y, Y, X, n) would slow things down
  349|       |                 */
  350|  3.26M|                if (!BN_usub(A, A, B))
  ------------------
  |  Branch (350:21): [True: 0, False: 3.26M]
  ------------------
  351|      0|                    goto err;
  352|  3.26M|            }
  353|  6.53M|        }
  354|   102k|    } else {
  355|       |        /* general inversion algorithm */
  356|       |
  357|      0|        while (!BN_is_zero(B)) {
  ------------------
  |  Branch (357:16): [True: 0, False: 0]
  ------------------
  358|      0|            BIGNUM *tmp;
  359|       |
  360|       |            /*-
  361|       |             *      0 < B < A,
  362|       |             * (*) -sign*X*a  ==  B   (mod |n|),
  363|       |             *      sign*Y*a  ==  A   (mod |n|)
  364|       |             */
  365|       |
  366|       |            /* (D, M) := (A/B, A%B) ... */
  367|      0|            if (BN_num_bits(A) == BN_num_bits(B)) {
  ------------------
  |  Branch (367:17): [True: 0, False: 0]
  ------------------
  368|      0|                if (!BN_one(D))
  ------------------
  |  |  196|      0|#define BN_one(a) (BN_set_word((a), 1))
  ------------------
  |  Branch (368:21): [True: 0, False: 0]
  ------------------
  369|      0|                    goto err;
  370|      0|                if (!BN_sub(M, A, B))
  ------------------
  |  Branch (370:21): [True: 0, False: 0]
  ------------------
  371|      0|                    goto err;
  372|      0|            } else if (BN_num_bits(A) == BN_num_bits(B) + 1) {
  ------------------
  |  Branch (372:24): [True: 0, False: 0]
  ------------------
  373|       |                /* A/B is 1, 2, or 3 */
  374|      0|                if (!BN_lshift1(T, B))
  ------------------
  |  Branch (374:21): [True: 0, False: 0]
  ------------------
  375|      0|                    goto err;
  376|      0|                if (BN_ucmp(A, T) < 0) {
  ------------------
  |  Branch (376:21): [True: 0, False: 0]
  ------------------
  377|       |                    /* A < 2*B, so D=1 */
  378|      0|                    if (!BN_one(D))
  ------------------
  |  |  196|      0|#define BN_one(a) (BN_set_word((a), 1))
  ------------------
  |  Branch (378:25): [True: 0, False: 0]
  ------------------
  379|      0|                        goto err;
  380|      0|                    if (!BN_sub(M, A, B))
  ------------------
  |  Branch (380:25): [True: 0, False: 0]
  ------------------
  381|      0|                        goto err;
  382|      0|                } else {
  383|       |                    /* A >= 2*B, so D=2 or D=3 */
  384|      0|                    if (!BN_sub(M, A, T))
  ------------------
  |  Branch (384:25): [True: 0, False: 0]
  ------------------
  385|      0|                        goto err;
  386|      0|                    if (!BN_add(D, T, B))
  ------------------
  |  Branch (386:25): [True: 0, False: 0]
  ------------------
  387|      0|                        goto err; /* use D (:= 3*B) as temp */
  388|      0|                    if (BN_ucmp(A, D) < 0) {
  ------------------
  |  Branch (388:25): [True: 0, False: 0]
  ------------------
  389|       |                        /* A < 3*B, so D=2 */
  390|      0|                        if (!BN_set_word(D, 2))
  ------------------
  |  Branch (390:29): [True: 0, False: 0]
  ------------------
  391|      0|                            goto err;
  392|       |                        /*
  393|       |                         * M (= A - 2*B) already has the correct value
  394|       |                         */
  395|      0|                    } else {
  396|       |                        /* only D=3 remains */
  397|      0|                        if (!BN_set_word(D, 3))
  ------------------
  |  Branch (397:29): [True: 0, False: 0]
  ------------------
  398|      0|                            goto err;
  399|       |                        /*
  400|       |                         * currently M = A - 2*B, but we need M = A - 3*B
  401|       |                         */
  402|      0|                        if (!BN_sub(M, M, B))
  ------------------
  |  Branch (402:29): [True: 0, False: 0]
  ------------------
  403|      0|                            goto err;
  404|      0|                    }
  405|      0|                }
  406|      0|            } else {
  407|      0|                if (!BN_div(D, M, A, B, ctx))
  ------------------
  |  Branch (407:21): [True: 0, False: 0]
  ------------------
  408|      0|                    goto err;
  409|      0|            }
  410|       |
  411|       |            /*-
  412|       |             * Now
  413|       |             *      A = D*B + M;
  414|       |             * thus we have
  415|       |             * (**)  sign*Y*a  ==  D*B + M   (mod |n|).
  416|       |             */
  417|       |
  418|      0|            tmp = A; /* keep the BIGNUM object, the value does not matter */
  419|       |
  420|       |            /* (A, B) := (B, A mod B) ... */
  421|      0|            A = B;
  422|      0|            B = M;
  423|       |            /* ... so we have  0 <= B < A  again */
  424|       |
  425|       |            /*-
  426|       |             * Since the former  M  is now  B  and the former  B  is now  A,
  427|       |             * (**) translates into
  428|       |             *       sign*Y*a  ==  D*A + B    (mod |n|),
  429|       |             * i.e.
  430|       |             *       sign*Y*a - D*A  ==  B    (mod |n|).
  431|       |             * Similarly, (*) translates into
  432|       |             *      -sign*X*a  ==  A          (mod |n|).
  433|       |             *
  434|       |             * Thus,
  435|       |             *   sign*Y*a + D*sign*X*a  ==  B  (mod |n|),
  436|       |             * i.e.
  437|       |             *        sign*(Y + D*X)*a  ==  B  (mod |n|).
  438|       |             *
  439|       |             * So if we set  (X, Y, sign) := (Y + D*X, X, -sign), we arrive back at
  440|       |             *      -sign*X*a  ==  B   (mod |n|),
  441|       |             *       sign*Y*a  ==  A   (mod |n|).
  442|       |             * Note that  X  and  Y  stay non-negative all the time.
  443|       |             */
  444|       |
  445|       |            /*
  446|       |             * most of the time D is very small, so we can optimize tmp := D*X+Y
  447|       |             */
  448|      0|            if (BN_is_one(D)) {
  ------------------
  |  Branch (448:17): [True: 0, False: 0]
  ------------------
  449|      0|                if (!BN_add(tmp, X, Y))
  ------------------
  |  Branch (449:21): [True: 0, False: 0]
  ------------------
  450|      0|                    goto err;
  451|      0|            } else {
  452|      0|                if (BN_is_word(D, 2)) {
  ------------------
  |  Branch (452:21): [True: 0, False: 0]
  ------------------
  453|      0|                    if (!BN_lshift1(tmp, X))
  ------------------
  |  Branch (453:25): [True: 0, False: 0]
  ------------------
  454|      0|                        goto err;
  455|      0|                } else if (BN_is_word(D, 4)) {
  ------------------
  |  Branch (455:28): [True: 0, False: 0]
  ------------------
  456|      0|                    if (!BN_lshift(tmp, X, 2))
  ------------------
  |  Branch (456:25): [True: 0, False: 0]
  ------------------
  457|      0|                        goto err;
  458|      0|                } else if (D->top == 1) {
  ------------------
  |  Branch (458:28): [True: 0, False: 0]
  ------------------
  459|      0|                    if (!BN_copy(tmp, X))
  ------------------
  |  Branch (459:25): [True: 0, False: 0]
  ------------------
  460|      0|                        goto err;
  461|      0|                    if (!BN_mul_word(tmp, D->d[0]))
  ------------------
  |  Branch (461:25): [True: 0, False: 0]
  ------------------
  462|      0|                        goto err;
  463|      0|                } else {
  464|      0|                    if (!BN_mul(tmp, D, X, ctx))
  ------------------
  |  Branch (464:25): [True: 0, False: 0]
  ------------------
  465|      0|                        goto err;
  466|      0|                }
  467|      0|                if (!BN_add(tmp, tmp, Y))
  ------------------
  |  Branch (467:21): [True: 0, False: 0]
  ------------------
  468|      0|                    goto err;
  469|      0|            }
  470|       |
  471|      0|            M = Y; /* keep the BIGNUM object, the value does not matter */
  472|      0|            Y = X;
  473|      0|            X = tmp;
  474|      0|            sign = -sign;
  475|      0|        }
  476|      0|    }
  477|       |
  478|       |    /*-
  479|       |     * The while loop (Euclid's algorithm) ends when
  480|       |     *      A == gcd(a,n);
  481|       |     * we have
  482|       |     *       sign*Y*a  ==  A  (mod |n|),
  483|       |     * where  Y  is non-negative.
  484|       |     */
  485|       |
  486|   102k|    if (sign < 0) {
  ------------------
  |  Branch (486:9): [True: 102k, False: 0]
  ------------------
  487|   102k|        if (!BN_sub(Y, n, Y))
  ------------------
  |  Branch (487:13): [True: 0, False: 102k]
  ------------------
  488|      0|            goto err;
  489|   102k|    }
  490|       |    /* Now  Y*a  ==  A  (mod |n|).  */
  491|       |
  492|   102k|    if (BN_is_one(A)) {
  ------------------
  |  Branch (492:9): [True: 102k, False: 0]
  ------------------
  493|       |        /* Y*a == 1  (mod |n|) */
  494|   102k|        if (!Y->neg && BN_ucmp(Y, n) < 0) {
  ------------------
  |  Branch (494:13): [True: 76, False: 101k]
  |  Branch (494:24): [True: 76, False: 0]
  ------------------
  495|     76|            if (!BN_copy(R, Y))
  ------------------
  |  Branch (495:17): [True: 0, False: 76]
  ------------------
  496|      0|                goto err;
  497|   101k|        } else {
  498|   101k|            if (!BN_nnmod(R, Y, n, ctx))
  ------------------
  |  Branch (498:17): [True: 0, False: 101k]
  ------------------
  499|      0|                goto err;
  500|   101k|        }
  501|   102k|    } else {
  502|      0|        *pnoinv = 1;
  503|      0|        goto err;
  504|      0|    }
  505|   102k|    ret = R;
  506|   102k|err:
  507|   102k|    if ((ret == NULL) && (in == NULL))
  ------------------
  |  Branch (507:9): [True: 0, False: 102k]
  |  Branch (507:26): [True: 0, False: 0]
  ------------------
  508|      0|        BN_free(R);
  509|   102k|    BN_CTX_end(ctx);
  510|   102k|    bn_check_top(ret);
  511|   102k|    return ret;
  512|   102k|}
BN_mod_inverse:
  517|   102k|{
  518|   102k|    BN_CTX *new_ctx = NULL;
  519|   102k|    BIGNUM *rv;
  520|   102k|    int noinv = 0;
  521|       |
  522|   102k|    if (ctx == NULL) {
  ------------------
  |  Branch (522:9): [True: 0, False: 102k]
  ------------------
  523|      0|        ctx = new_ctx = BN_CTX_new_ex(NULL);
  524|      0|        if (ctx == NULL) {
  ------------------
  |  Branch (524:13): [True: 0, False: 0]
  ------------------
  525|      0|            ERR_raise(ERR_LIB_BN, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  526|      0|            return NULL;
  527|      0|        }
  528|      0|    }
  529|       |
  530|   102k|    rv = int_bn_mod_inverse(in, a, n, ctx, &noinv);
  531|   102k|    if (noinv)
  ------------------
  |  Branch (531:9): [True: 0, False: 102k]
  ------------------
  532|       |        ERR_raise(ERR_LIB_BN, BN_R_NO_INVERSE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  533|   102k|    BN_CTX_free(new_ctx);
  534|   102k|    return rv;
  535|   102k|}

bn_get_top:
  138|    765|{
  139|    765|    return a->top;
  140|    765|}
bn_copy_words:
  156|    159|{
  157|    159|    if (in->top > size)
  ------------------
  |  Branch (157:9): [True: 0, False: 159]
  ------------------
  158|      0|        return 0;
  159|       |
  160|    159|    memset(out, 0, sizeof(*out) * size);
  161|    159|    if (in->d != NULL)
  ------------------
  |  Branch (161:9): [True: 159, False: 0]
  ------------------
  162|    159|        memcpy(out, in->d, sizeof(*out) * in->top);
  163|    159|    return 1;
  164|    159|}
bn_get_words:
  167|    424|{
  168|    424|    return a->d;
  169|    424|}
bn_set_words:
  185|    265|{
  186|    265|    if (bn_wexpand(a, num_words) == NULL) {
  ------------------
  |  Branch (186:9): [True: 0, False: 265]
  ------------------
  187|      0|        ERR_raise(ERR_LIB_BN, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  188|      0|        return 0;
  189|      0|    }
  190|       |
  191|    265|    memcpy(a->d, words, sizeof(BN_ULONG) * num_words);
  192|    265|    a->top = num_words;
  193|    265|    bn_correct_top(a);
  194|    265|    return 1;
  195|    265|}

BN_value_one:
   83|   237k|{
   84|   237k|    static const BN_ULONG data_one = 1L;
   85|   237k|    static const BIGNUM const_one = {
   86|   237k|        (BN_ULONG *)&data_one, 1, 1, 0, BN_FLG_STATIC_DATA
  ------------------
  |  |   59|   237k|#define BN_FLG_STATIC_DATA 0x02
  ------------------
   87|   237k|    };
   88|       |
   89|   237k|    return &const_one;
   90|   237k|}
BN_num_bits_word:
  102|  3.85M|{
  103|  3.85M|    BN_ULONG x, mask;
  ------------------
  |  |   37|  3.85M|#define BN_ULONG unsigned long
  ------------------
  104|  3.85M|    int bits = (l != 0);
  105|       |
  106|  3.85M|#if BN_BITS2 > 32
  107|  3.85M|    x = l >> 32;
  108|  3.85M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   93|  3.85M|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  109|  3.85M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  3.85M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  3.85M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  110|  3.85M|    bits += 32 & mask;
  111|  3.85M|    l ^= (x ^ l) & mask;
  112|  3.85M|#endif
  113|       |
  114|  3.85M|    x = l >> 16;
  115|  3.85M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   93|  3.85M|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  116|  3.85M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  3.85M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  3.85M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  117|  3.85M|    bits += 16 & mask;
  118|  3.85M|    l ^= (x ^ l) & mask;
  119|       |
  120|  3.85M|    x = l >> 8;
  121|  3.85M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   93|  3.85M|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  122|  3.85M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  3.85M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  3.85M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  123|  3.85M|    bits += 8 & mask;
  124|  3.85M|    l ^= (x ^ l) & mask;
  125|       |
  126|  3.85M|    x = l >> 4;
  127|  3.85M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   93|  3.85M|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  128|  3.85M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  3.85M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  3.85M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  129|  3.85M|    bits += 4 & mask;
  130|  3.85M|    l ^= (x ^ l) & mask;
  131|       |
  132|  3.85M|    x = l >> 2;
  133|  3.85M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   93|  3.85M|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  134|  3.85M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  3.85M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  3.85M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  135|  3.85M|    bits += 2 & mask;
  136|  3.85M|    l ^= (x ^ l) & mask;
  137|       |
  138|  3.85M|    x = l >> 1;
  139|  3.85M|    mask = (0 - x) & BN_MASK2;
  ------------------
  |  |   93|  3.85M|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  140|  3.85M|    mask = (0 - (mask >> (BN_BITS2 - 1)));
  ------------------
  |  |   54|  3.85M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  3.85M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  141|  3.85M|    bits += 1 & mask;
  142|       |
  143|  3.85M|    return bits;
  144|  3.85M|}
BN_num_bits:
  179|  2.53M|{
  180|  2.53M|    int i = a->top - 1;
  181|  2.53M|    bn_check_top(a);
  182|       |
  183|  2.53M|    if (a->flags & BN_FLG_CONSTTIME) {
  ------------------
  |  |   67|  2.53M|#define BN_FLG_CONSTTIME 0x04
  ------------------
  |  Branch (183:9): [True: 715, False: 2.53M]
  ------------------
  184|       |        /*
  185|       |         * We assume that BIGNUMs flagged as CONSTTIME have also been expanded
  186|       |         * so that a->dmax is not leaking secret information.
  187|       |         *
  188|       |         * In other words, it's the caller's responsibility to ensure `a` has
  189|       |         * been preallocated in advance to a public length if we hit this
  190|       |         * branch.
  191|       |         *
  192|       |         */
  193|    715|        return bn_num_bits_consttime(a);
  194|    715|    }
  195|       |
  196|  2.53M|    if (ossl_unlikely(BN_is_zero(a)))
  ------------------
  |  |   23|  2.53M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 2.53M]
  |  |  ------------------
  ------------------
  197|      0|        return 0;
  198|       |
  199|  2.53M|    return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
  ------------------
  |  |   54|  2.53M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  2.53M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  200|  2.53M|}
BN_clear_free:
  213|  5.34M|{
  214|  5.34M|    if (a == NULL)
  ------------------
  |  Branch (214:9): [True: 1.92M, False: 3.42M]
  ------------------
  215|  1.92M|        return;
  216|  3.42M|    if (a->d != NULL && !BN_get_flags(a, BN_FLG_STATIC_DATA))
  ------------------
  |  |   59|  3.17M|#define BN_FLG_STATIC_DATA 0x02
  ------------------
  |  Branch (216:9): [True: 3.17M, False: 249k]
  |  Branch (216:25): [True: 3.17M, False: 76]
  ------------------
  217|  3.17M|        bn_free_d(a, 1);
  218|  3.42M|    if (BN_get_flags(a, BN_FLG_MALLOCED)) {
  ------------------
  |  |   58|  3.42M|#define BN_FLG_MALLOCED 0x01
  ------------------
  |  Branch (218:9): [True: 886, False: 3.42M]
  ------------------
  219|    886|        OPENSSL_cleanse(a, sizeof(*a));
  220|    886|        OPENSSL_free(a);
  ------------------
  |  |  131|    886|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  221|    886|    }
  222|  3.42M|}
BN_free:
  225|  4.05M|{
  226|  4.05M|    if (a == NULL)
  ------------------
  |  Branch (226:9): [True: 264k, False: 3.79M]
  ------------------
  227|   264k|        return;
  228|  3.79M|    if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
  ------------------
  |  |   59|  3.79M|#define BN_FLG_STATIC_DATA 0x02
  ------------------
  |  Branch (228:9): [True: 3.79M, False: 228]
  ------------------
  229|  3.79M|        bn_free_d(a, 0);
  230|  3.79M|    if (a->flags & BN_FLG_MALLOCED)
  ------------------
  |  |   58|  3.79M|#define BN_FLG_MALLOCED 0x01
  ------------------
  |  Branch (230:9): [True: 3.79M, False: 228]
  ------------------
  231|  3.79M|        OPENSSL_free(a);
  ------------------
  |  |  131|  3.79M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  232|  3.79M|}
bn_init:
  235|  6.10M|{
  236|  6.10M|    static BIGNUM nilbn;
  237|       |
  238|  6.10M|    *a = nilbn;
  239|  6.10M|    bn_check_top(a);
  240|  6.10M|}
BN_new:
  243|  3.79M|{
  244|  3.79M|    BIGNUM *ret;
  245|       |
  246|  3.79M|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  108|  3.79M|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (246:9): [True: 0, False: 3.79M]
  ------------------
  247|      0|        return NULL;
  248|  3.79M|    ret->flags = BN_FLG_MALLOCED;
  ------------------
  |  |   58|  3.79M|#define BN_FLG_MALLOCED 0x01
  ------------------
  249|  3.79M|    bn_check_top(ret);
  250|  3.79M|    return ret;
  251|  3.79M|}
BN_secure_new:
  254|    302|{
  255|    302|    BIGNUM *ret = BN_new();
  256|       |
  257|    302|    if (ret != NULL)
  ------------------
  |  Branch (257:9): [True: 302, False: 0]
  ------------------
  258|    302|        ret->flags |= BN_FLG_SECURE;
  ------------------
  |  |   68|    302|#define BN_FLG_SECURE 0x08
  ------------------
  259|    302|    return ret;
  260|    302|}
bn_expand2:
  299|  8.73M|{
  300|  8.73M|    if (ossl_likely(words > b->dmax)) {
  ------------------
  |  |   22|  8.73M|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 8.73M, False: 0]
  |  |  ------------------
  ------------------
  301|  8.73M|        BN_ULONG *a = bn_expand_internal(b, words);
  ------------------
  |  |   37|  8.73M|#define BN_ULONG unsigned long
  ------------------
  302|       |
  303|  8.73M|        if (ossl_unlikely(!a))
  ------------------
  |  |   23|  8.73M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 8.73M]
  |  |  ------------------
  ------------------
  304|      0|            return NULL;
  305|  8.73M|        if (b->d != NULL)
  ------------------
  |  Branch (305:13): [True: 1.76M, False: 6.96M]
  ------------------
  306|  1.76M|            bn_free_d(b, 1);
  307|  8.73M|        b->d = a;
  308|  8.73M|        b->dmax = words;
  309|  8.73M|    }
  310|       |
  311|  8.73M|    return b;
  312|  8.73M|}
BN_dup:
  315|  11.7k|{
  316|  11.7k|    BIGNUM *t;
  317|       |
  318|  11.7k|    if (a == NULL)
  ------------------
  |  Branch (318:9): [True: 0, False: 11.7k]
  ------------------
  319|      0|        return NULL;
  320|  11.7k|    bn_check_top(a);
  321|       |
  322|  11.7k|    t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new();
  ------------------
  |  |   68|  11.7k|#define BN_FLG_SECURE 0x08
  ------------------
  |  Branch (322:9): [True: 0, False: 11.7k]
  ------------------
  323|  11.7k|    if (t == NULL)
  ------------------
  |  Branch (323:9): [True: 0, False: 11.7k]
  ------------------
  324|      0|        return NULL;
  325|  11.7k|    if (!BN_copy(t, a)) {
  ------------------
  |  Branch (325:9): [True: 0, False: 11.7k]
  ------------------
  326|      0|        BN_free(t);
  327|      0|        return NULL;
  328|      0|    }
  329|  11.7k|    bn_check_top(t);
  330|  11.7k|    return t;
  331|  11.7k|}
BN_copy:
  334|  3.99M|{
  335|  3.99M|    int bn_words;
  336|       |
  337|  3.99M|    bn_check_top(b);
  338|       |
  339|  3.99M|    bn_words = BN_get_flags(b, BN_FLG_CONSTTIME) ? b->dmax : b->top;
  ------------------
  |  |   67|  3.99M|#define BN_FLG_CONSTTIME 0x04
  ------------------
  |  Branch (339:16): [True: 432, False: 3.99M]
  ------------------
  340|       |
  341|  3.99M|    if (ossl_unlikely(a == b))
  ------------------
  |  |   23|  3.99M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 3.99M]
  |  |  ------------------
  ------------------
  342|      0|        return a;
  343|  3.99M|    if (ossl_unlikely(bn_wexpand(a, bn_words) == NULL))
  ------------------
  |  |   23|  3.99M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 3.99M]
  |  |  ------------------
  ------------------
  344|      0|        return NULL;
  345|       |
  346|  3.99M|    if (ossl_likely(b->top > 0))
  ------------------
  |  |   22|  3.99M|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 3.87M, False: 124k]
  |  |  ------------------
  ------------------
  347|  3.87M|        memcpy(a->d, b->d, sizeof(b->d[0]) * bn_words);
  348|       |
  349|  3.99M|    a->neg = b->neg;
  350|  3.99M|    a->top = b->top;
  351|  3.99M|    a->flags |= b->flags & BN_FLG_FIXED_TOP;
  ------------------
  |  |  221|  3.99M|#define BN_FLG_FIXED_TOP 0
  ------------------
  352|  3.99M|    bn_check_top(a);
  353|  3.99M|    return a;
  354|  3.99M|}
BN_set_word:
  415|   226k|{
  416|   226k|    bn_check_top(a);
  417|   226k|    if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
  ------------------
  |  Branch (417:9): [True: 0, False: 226k]
  ------------------
  418|      0|        return 0;
  419|   226k|    a->neg = 0;
  420|   226k|    a->d[0] = w;
  421|   226k|    a->top = (w ? 1 : 0);
  ------------------
  |  Branch (421:15): [True: 226k, False: 0]
  ------------------
  422|   226k|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  221|   226k|#define BN_FLG_FIXED_TOP 0
  ------------------
  423|   226k|    bn_check_top(a);
  424|   226k|    return 1;
  425|   226k|}
BN_bin2bn:
  535|  1.83M|{
  536|  1.83M|    return bin2bn(s, len, ret, BIG, UNSIGNED);
  537|  1.83M|}
BN_bn2binpad:
  628|     76|{
  629|     76|    if (tolen < 0)
  ------------------
  |  Branch (629:9): [True: 0, False: 76]
  ------------------
  630|      0|        return -1;
  631|     76|    return bn2binpad(a, to, tolen, BIG, UNSIGNED);
  632|     76|}
BN_bn2bin:
  642|    452|{
  643|    452|    return bn2binpad(a, to, -1, BIG, UNSIGNED);
  644|    452|}
BN_lebin2bn:
  647|    232|{
  648|    232|    return bin2bn(s, len, ret, LITTLE, UNSIGNED);
  649|    232|}
BN_bn2lebinpad:
  657|    116|{
  658|    116|    if (tolen < 0)
  ------------------
  |  Branch (658:9): [True: 0, False: 116]
  ------------------
  659|      0|        return -1;
  660|    116|    return bn2binpad(a, to, tolen, LITTLE, UNSIGNED);
  661|    116|}
BN_ucmp:
  707|  9.22M|{
  708|  9.22M|    int i;
  709|  9.22M|    BN_ULONG t1, t2, *ap, *bp;
  ------------------
  |  |   37|  9.22M|#define BN_ULONG unsigned long
  ------------------
  710|       |
  711|  9.22M|    ap = a->d;
  712|  9.22M|    bp = b->d;
  713|       |
  714|  9.22M|    if (BN_get_flags(a, BN_FLG_CONSTTIME)
  ------------------
  |  |   67|  9.22M|#define BN_FLG_CONSTTIME 0x04
  ------------------
  |  Branch (714:9): [True: 66.5k, False: 9.16M]
  ------------------
  715|  66.5k|        && a->top == b->top) {
  ------------------
  |  Branch (715:12): [True: 66.3k, False: 252]
  ------------------
  716|  66.3k|        int res = 0;
  717|       |
  718|   559k|        for (i = 0; i < b->top; i++) {
  ------------------
  |  Branch (718:21): [True: 492k, False: 66.3k]
  ------------------
  719|   492k|            res = constant_time_select_int((int)constant_time_lt_bn(ap[i], bp[i]),
  720|   492k|                -1, res);
  721|   492k|            res = constant_time_select_int((int)constant_time_lt_bn(bp[i], ap[i]),
  722|   492k|                1, res);
  723|   492k|        }
  724|  66.3k|        return res;
  725|  66.3k|    }
  726|       |
  727|  9.16M|    bn_check_top(a);
  728|  9.16M|    bn_check_top(b);
  729|       |
  730|  9.16M|    i = a->top - b->top;
  731|  9.16M|    if (i != 0)
  ------------------
  |  Branch (731:9): [True: 851k, False: 8.30M]
  ------------------
  732|   851k|        return i;
  733|       |
  734|  9.72M|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (734:26): [True: 9.39M, False: 328k]
  ------------------
  735|  9.39M|        t1 = ap[i];
  736|  9.39M|        t2 = bp[i];
  737|  9.39M|        if (t1 != t2)
  ------------------
  |  Branch (737:13): [True: 7.98M, False: 1.41M]
  ------------------
  738|  7.98M|            return ((t1 > t2) ? 1 : -1);
  ------------------
  |  Branch (738:21): [True: 3.44M, False: 4.53M]
  ------------------
  739|  9.39M|    }
  740|   328k|    return 0;
  741|  8.30M|}
BN_cmp:
  744|   676k|{
  745|   676k|    int i;
  746|   676k|    int gt, lt;
  747|   676k|    BN_ULONG t1, t2;
  ------------------
  |  |   37|   676k|#define BN_ULONG unsigned long
  ------------------
  748|       |
  749|   676k|    if ((a == NULL) || (b == NULL)) {
  ------------------
  |  Branch (749:9): [True: 0, False: 676k]
  |  Branch (749:24): [True: 0, False: 676k]
  ------------------
  750|      0|        if (a != NULL)
  ------------------
  |  Branch (750:13): [True: 0, False: 0]
  ------------------
  751|      0|            return -1;
  752|      0|        else if (b != NULL)
  ------------------
  |  Branch (752:18): [True: 0, False: 0]
  ------------------
  753|      0|            return 1;
  754|      0|        else
  755|      0|            return 0;
  756|      0|    }
  757|       |
  758|   676k|    bn_check_top(a);
  759|   676k|    bn_check_top(b);
  760|       |
  761|   676k|    if (a->neg != b->neg) {
  ------------------
  |  Branch (761:9): [True: 0, False: 676k]
  ------------------
  762|      0|        if (a->neg)
  ------------------
  |  Branch (762:13): [True: 0, False: 0]
  ------------------
  763|      0|            return -1;
  764|      0|        else
  765|      0|            return 1;
  766|      0|    }
  767|   676k|    if (a->neg == 0) {
  ------------------
  |  Branch (767:9): [True: 676k, False: 0]
  ------------------
  768|   676k|        gt = 1;
  769|   676k|        lt = -1;
  770|   676k|    } else {
  771|      0|        gt = -1;
  772|      0|        lt = 1;
  773|      0|    }
  774|       |
  775|   676k|    if (a->top > b->top)
  ------------------
  |  Branch (775:9): [True: 37.6k, False: 639k]
  ------------------
  776|  37.6k|        return gt;
  777|   639k|    if (a->top < b->top)
  ------------------
  |  Branch (777:9): [True: 78, False: 639k]
  ------------------
  778|     78|        return lt;
  779|  3.12M|    for (i = a->top - 1; i >= 0; i--) {
  ------------------
  |  Branch (779:26): [True: 2.70M, False: 418k]
  ------------------
  780|  2.70M|        t1 = a->d[i];
  781|  2.70M|        t2 = b->d[i];
  782|  2.70M|        if (t1 > t2)
  ------------------
  |  Branch (782:13): [True: 88.6k, False: 2.61M]
  ------------------
  783|  88.6k|            return gt;
  784|  2.61M|        if (t1 < t2)
  ------------------
  |  Branch (784:13): [True: 132k, False: 2.48M]
  ------------------
  785|   132k|            return lt;
  786|  2.61M|    }
  787|   418k|    return 0;
  788|   639k|}
BN_set_bit:
  791|   204k|{
  792|   204k|    int i, j, k;
  793|       |
  794|   204k|    if (n < 0)
  ------------------
  |  Branch (794:9): [True: 0, False: 204k]
  ------------------
  795|      0|        return 0;
  796|       |
  797|   204k|    i = n / BN_BITS2;
  ------------------
  |  |   54|   204k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   204k|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  798|   204k|    j = n % BN_BITS2;
  ------------------
  |  |   54|   204k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   204k|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  799|   204k|    if (a->top <= i) {
  ------------------
  |  Branch (799:9): [True: 204k, False: 0]
  ------------------
  800|   204k|        if (bn_wexpand(a, i + 1) == NULL)
  ------------------
  |  Branch (800:13): [True: 0, False: 204k]
  ------------------
  801|      0|            return 0;
  802|  1.74M|        for (k = a->top; k < i + 1; k++)
  ------------------
  |  Branch (802:26): [True: 1.54M, False: 204k]
  ------------------
  803|  1.54M|            a->d[k] = 0;
  804|   204k|        a->top = i + 1;
  805|   204k|        a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  221|   204k|#define BN_FLG_FIXED_TOP 0
  ------------------
  806|   204k|    }
  807|       |
  808|   204k|    a->d[i] |= (((BN_ULONG)1) << j);
  809|   204k|    bn_check_top(a);
  810|   204k|    return 1;
  811|   204k|}
BN_is_bit_set:
  832|  19.6M|{
  833|  19.6M|    int i, j;
  834|       |
  835|  19.6M|    bn_check_top(a);
  836|  19.6M|    if (ossl_unlikely(n < 0))
  ------------------
  |  |   23|  19.6M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 19.6M]
  |  |  ------------------
  ------------------
  837|      0|        return 0;
  838|  19.6M|    i = n / BN_BITS2;
  ------------------
  |  |   54|  19.6M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  19.6M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  839|  19.6M|    j = n % BN_BITS2;
  ------------------
  |  |   54|  19.6M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  19.6M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  840|  19.6M|    if (ossl_unlikely(a->top <= i))
  ------------------
  |  |   23|  19.6M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 80, False: 19.6M]
  |  |  ------------------
  ------------------
  841|     80|        return 0;
  842|  19.6M|    return (int)(((a->d[i]) >> j) & ((BN_ULONG)1));
  843|  19.6M|}
BN_set_negative:
  878|   113k|{
  879|   113k|    if (b && !BN_is_zero(a))
  ------------------
  |  Branch (879:9): [True: 0, False: 113k]
  |  Branch (879:14): [True: 0, False: 0]
  ------------------
  880|      0|        a->neg = 1;
  881|   113k|    else
  882|   113k|        a->neg = 0;
  883|   113k|}
BN_consttime_swap:
  943|   197k|{
  944|   197k|    BN_ULONG t;
  ------------------
  |  |   37|   197k|#define BN_ULONG unsigned long
  ------------------
  945|   197k|    int i;
  946|       |
  947|   197k|    bn_wcheck_size(a, nwords);
  948|   197k|    bn_wcheck_size(b, nwords);
  949|       |
  950|   197k|    condition = ((~condition & ((condition - 1))) >> (BN_BITS2 - 1)) - 1;
  ------------------
  |  |   54|   197k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   197k|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  951|       |
  952|   197k|    t = (a->top ^ b->top) & condition;
  953|   197k|    a->top ^= t;
  954|   197k|    b->top ^= t;
  955|       |
  956|   197k|    t = (a->neg ^ b->neg) & condition;
  957|   197k|    a->neg ^= t;
  958|   197k|    b->neg ^= t;
  959|       |
  960|       |    /*-
  961|       |     * BN_FLG_STATIC_DATA: indicates that data may not be written to. Intention
  962|       |     * is actually to treat it as it's read-only data, and some (if not most)
  963|       |     * of it does reside in read-only segment. In other words observation of
  964|       |     * BN_FLG_STATIC_DATA in BN_consttime_swap should be treated as fatal
  965|       |     * condition. It would either cause SEGV or effectively cause data
  966|       |     * corruption.
  967|       |     *
  968|       |     * BN_FLG_MALLOCED: refers to BN structure itself, and hence must be
  969|       |     * preserved.
  970|       |     *
  971|       |     * BN_FLG_SECURE: must be preserved, because it determines how x->d was
  972|       |     * allocated and hence how to free it.
  973|       |     *
  974|       |     * BN_FLG_CONSTTIME: sufficient to mask and swap
  975|       |     *
  976|       |     * BN_FLG_FIXED_TOP: indicates that we haven't called bn_correct_top() on
  977|       |     * the data, so the d array may be padded with additional 0 values (i.e.
  978|       |     * top could be greater than the minimal value that it could be). We should
  979|       |     * be swapping it
  980|       |     */
  981|       |
  982|   197k|#define BN_CONSTTIME_SWAP_FLAGS (BN_FLG_CONSTTIME | BN_FLG_FIXED_TOP)
  983|       |
  984|   197k|    t = ((a->flags ^ b->flags) & BN_CONSTTIME_SWAP_FLAGS) & condition;
  ------------------
  |  |  982|   197k|#define BN_CONSTTIME_SWAP_FLAGS (BN_FLG_CONSTTIME | BN_FLG_FIXED_TOP)
  |  |  ------------------
  |  |  |  |   67|   197k|#define BN_FLG_CONSTTIME 0x04
  |  |  ------------------
  |  |               #define BN_CONSTTIME_SWAP_FLAGS (BN_FLG_CONSTTIME | BN_FLG_FIXED_TOP)
  |  |  ------------------
  |  |  |  |  221|   197k|#define BN_FLG_FIXED_TOP 0
  |  |  ------------------
  ------------------
  985|   197k|    a->flags ^= t;
  986|   197k|    b->flags ^= t;
  987|       |
  988|       |    /* conditionally swap the data */
  989|  1.66M|    for (i = 0; i < nwords; i++) {
  ------------------
  |  Branch (989:17): [True: 1.46M, False: 197k]
  ------------------
  990|  1.46M|        t = (a->d[i] ^ b->d[i]) & condition;
  991|  1.46M|        a->d[i] ^= t;
  992|  1.46M|        b->d[i] ^= t;
  993|  1.46M|    }
  994|   197k|}
BN_security_bits:
 1001|     76|{
 1002|     76|    int secbits, bits;
 1003|     76|    if (L >= 15360)
  ------------------
  |  Branch (1003:9): [True: 0, False: 76]
  ------------------
 1004|      0|        secbits = 256;
 1005|     76|    else if (L >= 7680)
  ------------------
  |  Branch (1005:14): [True: 26, False: 50]
  ------------------
 1006|     26|        secbits = 192;
 1007|     50|    else if (L >= 3072)
  ------------------
  |  Branch (1007:14): [True: 34, False: 16]
  ------------------
 1008|     34|        secbits = 128;
 1009|     16|    else if (L >= 2048)
  ------------------
  |  Branch (1009:14): [True: 16, False: 0]
  ------------------
 1010|     16|        secbits = 112;
 1011|      0|    else if (L >= 1024)
  ------------------
  |  Branch (1011:14): [True: 0, False: 0]
  ------------------
 1012|      0|        secbits = 80;
 1013|      0|    else
 1014|      0|        return 0;
 1015|     76|    if (N == -1)
  ------------------
  |  Branch (1015:9): [True: 0, False: 76]
  ------------------
 1016|      0|        return secbits;
 1017|     76|    bits = N / 2;
 1018|     76|    if (bits < 80)
  ------------------
  |  Branch (1018:9): [True: 0, False: 76]
  ------------------
 1019|      0|        return 0;
 1020|     76|    return bits >= secbits ? secbits : bits;
  ------------------
  |  Branch (1020:12): [True: 76, False: 0]
  ------------------
 1021|     76|}
BN_zero_ex:
 1024|  8.90M|{
 1025|  8.90M|    a->neg = 0;
 1026|  8.90M|    a->top = 0;
 1027|  8.90M|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  221|  8.90M|#define BN_FLG_FIXED_TOP 0
  ------------------
 1028|  8.90M|}
BN_abs_is_word:
 1031|   532k|{
 1032|   532k|    return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));
  ------------------
  |  Branch (1032:13): [True: 532k, False: 29]
  |  Branch (1032:30): [True: 328k, False: 204k]
  |  Branch (1032:50): [True: 0, False: 204k]
  |  Branch (1032:62): [True: 0, False: 0]
  ------------------
 1033|   532k|}
BN_is_zero:
 1036|  17.9M|{
 1037|  17.9M|    return a->top == 0;
 1038|  17.9M|}
BN_is_one:
 1041|   430k|{
 1042|   430k|    return BN_abs_is_word(a, 1) && !a->neg;
  ------------------
  |  Branch (1042:12): [True: 328k, False: 102k]
  |  Branch (1042:36): [True: 328k, False: 0]
  ------------------
 1043|   430k|}
BN_is_odd:
 1067|  6.74M|{
 1068|  6.74M|    return (a->top > 0) && (a->d[0] & 1);
  ------------------
  |  Branch (1068:12): [True: 6.74M, False: 0]
  |  Branch (1068:28): [True: 3.48M, False: 3.26M]
  ------------------
 1069|  6.74M|}
BN_is_negative:
 1072|  1.14M|{
 1073|  1.14M|    return (a->neg != 0);
 1074|  1.14M|}
BN_to_montgomery:
 1078|  80.4k|{
 1079|  80.4k|    return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx);
 1080|  80.4k|}
BN_with_flags:
 1083|     76|{
 1084|     76|    dest->d = b->d;
 1085|     76|    dest->top = b->top;
 1086|     76|    dest->dmax = b->dmax;
 1087|     76|    dest->neg = b->neg;
 1088|     76|    dest->flags = ((dest->flags & BN_FLG_MALLOCED)
  ------------------
  |  |   58|     76|#define BN_FLG_MALLOCED 0x01
  ------------------
 1089|     76|        | (b->flags & ~BN_FLG_MALLOCED)
  ------------------
  |  |   58|     76|#define BN_FLG_MALLOCED 0x01
  ------------------
 1090|     76|        | BN_FLG_STATIC_DATA | flags);
  ------------------
  |  |   59|     76|#define BN_FLG_STATIC_DATA 0x02
  ------------------
 1091|     76|}
BN_GENCB_free:
 1104|     76|{
 1105|     76|    if (cb == NULL)
  ------------------
  |  Branch (1105:9): [True: 76, False: 0]
  ------------------
 1106|     76|        return;
 1107|      0|    OPENSSL_free(cb);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1108|      0|}
BN_set_flags:
 1111|  6.65k|{
 1112|  6.65k|    b->flags |= n;
 1113|  6.65k|}
BN_get_flags:
 1116|  50.2M|{
 1117|  50.2M|    return b->flags & n;
 1118|  50.2M|}
bn_wexpand:
 1146|  31.9M|{
 1147|  31.9M|    return (words <= a->dmax) ? a : bn_expand2(a, words);
  ------------------
  |  Branch (1147:12): [True: 23.3M, False: 8.62M]
  ------------------
 1148|  31.9M|}
bn_correct_top:
 1173|  13.3M|{
 1174|  13.3M|    BN_ULONG *ftl;
  ------------------
  |  |   37|  13.3M|#define BN_ULONG unsigned long
  ------------------
 1175|  13.3M|    int tmp_top = a->top;
 1176|       |
 1177|  13.3M|    if (ossl_likely(tmp_top > 0)) {
  ------------------
  |  |   22|  13.3M|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 13.3M, False: 0]
  |  |  ------------------
  ------------------
 1178|  14.7M|        for (ftl = &(a->d[tmp_top]); tmp_top > 0; tmp_top--) {
  ------------------
  |  Branch (1178:38): [True: 14.7M, False: 0]
  ------------------
 1179|  14.7M|            ftl--;
 1180|  14.7M|            if (*ftl != 0)
  ------------------
  |  Branch (1180:17): [True: 13.3M, False: 1.40M]
  ------------------
 1181|  13.3M|                break;
 1182|  14.7M|        }
 1183|  13.3M|        a->top = tmp_top;
 1184|  13.3M|    }
 1185|  13.3M|    if (a->top == 0)
  ------------------
  |  Branch (1185:9): [True: 0, False: 13.3M]
  ------------------
 1186|      0|        a->neg = 0;
 1187|  13.3M|    a->flags &= ~BN_FLG_FIXED_TOP;
  ------------------
  |  |  221|  13.3M|#define BN_FLG_FIXED_TOP 0
  ------------------
 1188|  13.3M|    bn_pollute(a);
 1189|  13.3M|}
bn_lib.c:bn_num_bits_consttime:
  154|    715|{
  155|    715|    int j, ret;
  156|    715|    unsigned int mask, past_i;
  157|    715|    int i = a->top - 1;
  158|    715|    bn_check_top(a);
  159|       |
  160|  6.42k|    for (j = 0, past_i = 0, ret = 0; j < a->dmax; j++) {
  ------------------
  |  Branch (160:38): [True: 5.70k, False: 715]
  ------------------
  161|  5.70k|        mask = constant_time_eq_int(i, j); /* 0xff..ff if i==j, 0x0 otherwise */
  162|       |
  163|  5.70k|        ret += BN_BITS2 & (~mask & ~past_i);
  ------------------
  |  |   54|  5.70k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  5.70k|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  164|  5.70k|        ret += BN_num_bits_word(a->d[j]) & mask;
  165|       |
  166|  5.70k|        past_i |= mask; /* past_i will become 0xff..ff after i==j */
  167|  5.70k|    }
  168|       |
  169|       |    /*
  170|       |     * if BN_is_zero(a) => i is -1 and ret contains garbage, so we mask the
  171|       |     * final result.
  172|       |     */
  173|    715|    mask = ~(constant_time_eq_int(i, ((int)-1)));
  174|       |
  175|    715|    return ret & mask;
  176|    715|}
bn_lib.c:bn_free_d:
  203|  8.73M|{
  204|  8.73M|    if (BN_get_flags(a, BN_FLG_SECURE))
  ------------------
  |  |   68|  8.73M|#define BN_FLG_SECURE 0x08
  ------------------
  |  Branch (204:9): [True: 5.71k, False: 8.72M]
  ------------------
  205|  5.71k|        OPENSSL_secure_clear_free(a->d, a->dmax * sizeof(a->d[0]));
  ------------------
  |  |  149|  5.71k|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  206|  8.72M|    else if (clear != 0)
  ------------------
  |  Branch (206:14): [True: 4.93M, False: 3.79M]
  ------------------
  207|  4.93M|        OPENSSL_clear_free(a->d, a->dmax * sizeof(a->d[0]));
  ------------------
  |  |  129|  4.93M|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  208|  3.79M|    else
  209|  3.79M|        OPENSSL_free(a->d);
  ------------------
  |  |  131|  3.79M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  210|  8.73M|}
bn_lib.c:bn_expand_internal:
  265|  8.73M|{
  266|  8.73M|    BN_ULONG *a = NULL;
  ------------------
  |  |   37|  8.73M|#define BN_ULONG unsigned long
  ------------------
  267|       |
  268|  8.73M|    if (ossl_unlikely(words > (INT_MAX / (4 * BN_BITS2)))) {
  ------------------
  |  |   23|  8.73M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 8.73M]
  |  |  ------------------
  ------------------
  269|      0|        ERR_raise(ERR_LIB_BN, BN_R_BIGNUM_TOO_LONG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  270|      0|        return NULL;
  271|      0|    }
  272|  8.73M|    if (ossl_unlikely(BN_get_flags(b, BN_FLG_STATIC_DATA))) {
  ------------------
  |  |   23|  8.73M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 8.73M]
  |  |  ------------------
  ------------------
  273|      0|        ERR_raise(ERR_LIB_BN, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  274|      0|        return NULL;
  275|      0|    }
  276|  8.73M|    if (BN_get_flags(b, BN_FLG_SECURE))
  ------------------
  |  |   68|  8.73M|#define BN_FLG_SECURE 0x08
  ------------------
  |  Branch (276:9): [True: 5.71k, False: 8.72M]
  ------------------
  277|  5.71k|        a = OPENSSL_secure_calloc(words, sizeof(*a));
  ------------------
  |  |  145|  5.71k|    CRYPTO_secure_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  278|  8.72M|    else
  279|  8.72M|        a = OPENSSL_calloc(words, sizeof(*a));
  ------------------
  |  |  112|  8.72M|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  280|  8.73M|    if (ossl_unlikely(a == NULL))
  ------------------
  |  |   23|  8.73M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 8.73M]
  |  |  ------------------
  ------------------
  281|      0|        return NULL;
  282|       |
  283|  8.73M|    assert(b->top <= words);
  ------------------
  |  Branch (283:5): [True: 0, False: 8.73M]
  |  Branch (283:5): [True: 8.73M, False: 0]
  ------------------
  284|  8.73M|    if (b->top > 0)
  ------------------
  |  Branch (284:9): [True: 420k, False: 8.31M]
  ------------------
  285|   420k|        memcpy(a, b->d, sizeof(*a) * b->top);
  286|       |
  287|  8.73M|    return a;
  288|  8.73M|}
bn_lib.c:bin2bn:
  434|  1.83M|{
  435|  1.83M|    int inc;
  436|  1.83M|    const unsigned char *s2;
  437|  1.83M|    int inc2;
  438|  1.83M|    int neg = 0, xor = 0, carry = 0;
  439|  1.83M|    unsigned int i;
  440|  1.83M|    unsigned int n;
  441|  1.83M|    BIGNUM *bn = NULL;
  442|       |
  443|       |    /* Negative length is not acceptable */
  444|  1.83M|    if (len < 0)
  ------------------
  |  Branch (444:9): [True: 0, False: 1.83M]
  ------------------
  445|      0|        return NULL;
  446|       |
  447|  1.83M|    if (ret == NULL)
  ------------------
  |  Branch (447:9): [True: 679k, False: 1.15M]
  ------------------
  448|   679k|        ret = bn = BN_new();
  449|  1.83M|    if (ret == NULL)
  ------------------
  |  Branch (449:9): [True: 0, False: 1.83M]
  ------------------
  450|      0|        return NULL;
  451|  1.83M|    bn_check_top(ret);
  452|       |
  453|       |    /*
  454|       |     * If the input has no bits, the number is considered zero.
  455|       |     * This makes calls with s==NULL and len==0 safe.
  456|       |     */
  457|  1.83M|    if (len == 0) {
  ------------------
  |  Branch (457:9): [True: 0, False: 1.83M]
  ------------------
  458|      0|        BN_clear(ret);
  459|      0|        return ret;
  460|      0|    }
  461|       |
  462|       |    /*
  463|       |     * The loop that does the work iterates from least to most
  464|       |     * significant BIGNUM chunk, so we adapt parameters to transfer
  465|       |     * input bytes accordingly.
  466|       |     */
  467|  1.83M|    if (endianness == LITTLE) {
  ------------------
  |  Branch (467:9): [True: 232, False: 1.83M]
  ------------------
  468|    232|        s2 = s + len - 1;
  469|    232|        inc2 = -1;
  470|    232|        inc = 1;
  471|  1.83M|    } else {
  472|  1.83M|        s2 = s;
  473|  1.83M|        inc2 = 1;
  474|  1.83M|        inc = -1;
  475|  1.83M|        s += len - 1;
  476|  1.83M|    }
  477|       |
  478|       |    /* Take note of the signedness of the input bytes*/
  479|  1.83M|    if (signedness == SIGNED) {
  ------------------
  |  Branch (479:9): [True: 0, False: 1.83M]
  ------------------
  480|      0|        neg = !!(*s2 & 0x80);
  481|      0|        xor = neg ? 0xff : 0x00;
  ------------------
  |  Branch (481:15): [True: 0, False: 0]
  ------------------
  482|      0|        carry = neg;
  483|      0|    }
  484|       |
  485|       |    /*
  486|       |     * Skip leading sign extensions (the value of |xor|).
  487|       |     * This is the only spot where |s2| and |inc2| are used.
  488|       |     */
  489|  2.17M|    for (; len > 0 && *s2 == xor; s2 += inc2, len--)
  ------------------
  |  Branch (489:12): [True: 2.17M, False: 0]
  |  Branch (489:23): [True: 337k, False: 1.83M]
  ------------------
  490|   337k|        continue;
  491|       |
  492|       |    /*
  493|       |     * If there was a set of 0xff, we backtrack one byte unless the next
  494|       |     * one has a sign bit, as the last 0xff is then part of the actual
  495|       |     * number, rather then a mere sign extension.
  496|       |     */
  497|  1.83M|    if (xor == 0xff) {
  ------------------
  |  Branch (497:9): [True: 0, False: 1.83M]
  ------------------
  498|      0|        if (len == 0 || !(*s2 & 0x80))
  ------------------
  |  Branch (498:13): [True: 0, False: 0]
  |  Branch (498:25): [True: 0, False: 0]
  ------------------
  499|      0|            len++;
  500|      0|    }
  501|       |    /* If it was all zeros, we're done */
  502|  1.83M|    if (len == 0) {
  ------------------
  |  Branch (502:9): [True: 0, False: 1.83M]
  ------------------
  503|      0|        ret->top = 0;
  504|      0|        return ret;
  505|      0|    }
  506|  1.83M|    n = ((len - 1) / BN_BYTES) + 1; /* Number of resulting bignum chunks */
  ------------------
  |  |   38|  1.83M|#define BN_BYTES 8
  ------------------
  507|  1.83M|    if (bn_wexpand(ret, (int)n) == NULL) {
  ------------------
  |  Branch (507:9): [True: 0, False: 1.83M]
  ------------------
  508|      0|        BN_free(bn);
  509|      0|        return NULL;
  510|      0|    }
  511|  1.83M|    ret->top = n;
  512|  1.83M|    ret->neg = neg;
  513|  24.5M|    for (i = 0; n-- > 0; i++) {
  ------------------
  |  Branch (513:17): [True: 22.7M, False: 1.83M]
  ------------------
  514|  22.7M|        BN_ULONG l = 0; /* Accumulator */
  ------------------
  |  |   37|  22.7M|#define BN_ULONG unsigned long
  ------------------
  515|  22.7M|        unsigned int m = 0; /* Offset in a bignum chunk, in bits */
  516|       |
  517|   203M|        for (; len > 0 && m < BN_BYTES * 8; len--, s += inc, m += 8) {
  ------------------
  |  |   38|   201M|#define BN_BYTES 8
  ------------------
  |  Branch (517:16): [True: 201M, False: 1.83M]
  |  Branch (517:27): [True: 180M, False: 20.9M]
  ------------------
  518|   180M|            BN_ULONG byte_xored = *s ^ xor;
  ------------------
  |  |   37|   180M|#define BN_ULONG unsigned long
  ------------------
  519|   180M|            BN_ULONG byte = (byte_xored + carry) & 0xff;
  ------------------
  |  |   37|   180M|#define BN_ULONG unsigned long
  ------------------
  520|       |
  521|   180M|            carry = byte_xored > byte; /* Implicit 1 or 0 */
  522|   180M|            l |= (byte << m);
  523|   180M|        }
  524|  22.7M|        ret->d[i] = l;
  525|  22.7M|    }
  526|       |    /*
  527|       |     * need to call this due to clear byte at top if avoiding having the top
  528|       |     * bit set (-ve number)
  529|       |     */
  530|  1.83M|    bn_correct_top(ret);
  531|  1.83M|    return ret;
  532|  1.83M|}
bn_lib.c:bn2binpad:
  546|    644|{
  547|    644|    int inc;
  548|    644|    int n, n8;
  549|    644|    int xor = 0, carry = 0, ext = 0;
  550|    644|    size_t i, lasti, j, atop, mask;
  551|    644|    BN_ULONG l;
  ------------------
  |  |   37|    644|#define BN_ULONG unsigned long
  ------------------
  552|       |
  553|       |    /*
  554|       |     * In case |a| is fixed-top, BN_num_bits can return bogus length,
  555|       |     * but it's assumed that fixed-top inputs ought to be "nominated"
  556|       |     * even for padded output, so it works out...
  557|       |     */
  558|    644|    n8 = BN_num_bits(a);
  559|    644|    n = (n8 + 7) / 8; /* This is what BN_num_bytes() does */
  560|       |
  561|       |    /* Take note of the signedness of the bignum */
  562|    644|    if (signedness == SIGNED) {
  ------------------
  |  Branch (562:9): [True: 0, False: 644]
  ------------------
  563|      0|        xor = a->neg ? 0xff : 0x00;
  ------------------
  |  Branch (563:15): [True: 0, False: 0]
  ------------------
  564|      0|        carry = a->neg;
  565|       |
  566|       |        /*
  567|       |         * if |n * 8 == n|, then the MSbit is set, otherwise unset.
  568|       |         * We must compensate with one extra byte if that doesn't
  569|       |         * correspond to the signedness of the bignum with regards
  570|       |         * to 2's complement.
  571|       |         */
  572|      0|        ext = (n * 8 == n8)
  ------------------
  |  Branch (572:15): [True: 0, False: 0]
  ------------------
  573|      0|            ? !a->neg /* MSbit set on nonnegative bignum */
  574|      0|            : a->neg; /* MSbit unset on negative bignum */
  575|      0|    }
  576|       |
  577|    644|    if (tolen == -1) {
  ------------------
  |  Branch (577:9): [True: 452, False: 192]
  ------------------
  578|    452|        tolen = n + ext;
  579|    452|    } else if (tolen < n + ext) { /* uncommon/unlike case */
  ------------------
  |  Branch (579:16): [True: 0, False: 192]
  ------------------
  580|      0|        BIGNUM temp = *a;
  581|       |
  582|      0|        bn_correct_top(&temp);
  583|      0|        n8 = BN_num_bits(&temp);
  584|      0|        n = (n8 + 7) / 8; /* This is what BN_num_bytes() does */
  585|      0|        if (tolen < n + ext)
  ------------------
  |  Branch (585:13): [True: 0, False: 0]
  ------------------
  586|      0|            return -1;
  587|      0|    }
  588|       |
  589|       |    /* Swipe through whole available data and don't give away padded zero. */
  590|    644|    atop = a->dmax * BN_BYTES;
  ------------------
  |  |   38|    644|#define BN_BYTES 8
  ------------------
  591|    644|    if (atop == 0) {
  ------------------
  |  Branch (591:9): [True: 0, False: 644]
  ------------------
  592|      0|        if (tolen != 0)
  ------------------
  |  Branch (592:13): [True: 0, False: 0]
  ------------------
  593|      0|            memset(to, '\0', tolen);
  594|      0|        return tolen;
  595|      0|    }
  596|       |
  597|       |    /*
  598|       |     * The loop that does the work iterates from least significant
  599|       |     * to most significant BIGNUM limb, so we adapt parameters to
  600|       |     * transfer output bytes accordingly.
  601|       |     */
  602|    644|    if (endianness == LITTLE) {
  ------------------
  |  Branch (602:9): [True: 116, False: 528]
  ------------------
  603|    116|        inc = 1;
  604|    528|    } else {
  605|    528|        inc = -1;
  606|    528|        to += tolen - 1; /* Move to the last byte, not beyond */
  607|    528|    }
  608|       |
  609|    644|    lasti = atop - 1;
  610|    644|    atop = a->top * BN_BYTES;
  ------------------
  |  |   38|    644|#define BN_BYTES 8
  ------------------
  611|  79.9k|    for (i = 0, j = 0; j < (size_t)tolen; j++) {
  ------------------
  |  Branch (611:24): [True: 79.3k, False: 644]
  ------------------
  612|  79.3k|        unsigned char byte, byte_xored;
  613|       |
  614|  79.3k|        l = a->d[i / BN_BYTES];
  ------------------
  |  |   38|  79.3k|#define BN_BYTES 8
  ------------------
  615|  79.3k|        mask = 0 - ((j - atop) >> (8 * sizeof(i) - 1));
  616|  79.3k|        byte = (unsigned char)(l >> (8 * (i % BN_BYTES)) & mask);
  ------------------
  |  |   38|  79.3k|#define BN_BYTES 8
  ------------------
  617|  79.3k|        byte_xored = byte ^ xor;
  618|  79.3k|        *to = (unsigned char)(byte_xored + carry);
  619|  79.3k|        carry = byte_xored > *to; /* Implicit 1 or 0 */
  620|  79.3k|        to += inc;
  621|  79.3k|        i += (i - lasti) >> (8 * sizeof(i) - 1); /* stay on last limb */
  622|  79.3k|    }
  623|       |
  624|    644|    return tolen;
  625|    644|}

bn_lib.c:bn_expand:
  680|   226k|{
  681|   226k|    if (bits > (INT_MAX - BN_BITS2 + 1))
  ------------------
  |  |   54|   226k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   226k|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  |  Branch (681:9): [True: 0, False: 226k]
  ------------------
  682|      0|        return NULL;
  683|       |
  684|   226k|    if (((bits + BN_BITS2 - 1) / BN_BITS2) <= (a)->dmax)
  ------------------
  |  |   54|   226k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   226k|#define BN_BYTES 8
  |  |  ------------------
  ------------------
                  if (((bits + BN_BITS2 - 1) / BN_BITS2) <= (a)->dmax)
  ------------------
  |  |   54|   226k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   226k|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  |  Branch (684:9): [True: 113k, False: 113k]
  ------------------
  685|   113k|        return a;
  686|       |
  687|   113k|    return bn_expand2((a), (bits + BN_BITS2 - 1) / BN_BITS2);
  ------------------
  |  |   54|   113k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   113k|#define BN_BYTES 8
  |  |  ------------------
  ------------------
                  return bn_expand2((a), (bits + BN_BITS2 - 1) / BN_BITS2);
  ------------------
  |  |   54|   113k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   113k|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  688|   226k|}

BN_nnmod:
   15|  1.10M|{
   16|       |    /*
   17|       |     * like BN_mod, but returns non-negative remainder (i.e., 0 <= r < |d|
   18|       |     * always holds)
   19|       |     */
   20|       |
   21|  1.10M|    if (r == d) {
  ------------------
  |  Branch (21:9): [True: 0, False: 1.10M]
  ------------------
   22|      0|        ERR_raise(ERR_LIB_BN, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   23|      0|        return 0;
   24|      0|    }
   25|       |
   26|  1.10M|    if (!(BN_mod(r, m, d, ctx)))
  ------------------
  |  |  276|  1.10M|#define BN_mod(rem, m, d, ctx) BN_div(NULL, (rem), (m), (d), (ctx))
  ------------------
  |  Branch (26:9): [True: 0, False: 1.10M]
  ------------------
   27|      0|        return 0;
   28|  1.10M|    if (!r->neg)
  ------------------
  |  Branch (28:9): [True: 1.00M, False: 101k]
  ------------------
   29|  1.00M|        return 1;
   30|       |    /* now   -|d| < r < 0,  so we have to set  r := r + |d| */
   31|   101k|    return (d->neg ? BN_sub : BN_add)(r, r, d);
  ------------------
  |  Branch (31:13): [True: 0, False: 101k]
  ------------------
   32|  1.10M|}
bn_mod_add_fixed_top:
   56|   846k|{
   57|   846k|    size_t i, ai, bi, mtop = m->top;
   58|   846k|    BN_ULONG storage[1024 / BN_BITS2];
  ------------------
  |  |   37|   846k|#define BN_ULONG unsigned long
  ------------------
   59|   846k|    BN_ULONG carry, temp, mask, *rp, *tp = storage;
  ------------------
  |  |   37|   846k|#define BN_ULONG unsigned long
  ------------------
   60|   846k|    const BN_ULONG *ap, *bp;
   61|       |
   62|   846k|    if (bn_wexpand(r, (int)mtop) == NULL)
  ------------------
  |  Branch (62:9): [True: 0, False: 846k]
  ------------------
   63|      0|        return 0;
   64|       |
   65|   846k|    if (mtop > OSSL_NELEM(storage)) {
  ------------------
  |  |   14|   846k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (65:9): [True: 0, False: 846k]
  ------------------
   66|      0|        tp = OPENSSL_malloc_array(mtop, sizeof(BN_ULONG));
  ------------------
  |  |  110|      0|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   67|      0|        if (tp == NULL)
  ------------------
  |  Branch (67:13): [True: 0, False: 0]
  ------------------
   68|      0|            return 0;
   69|      0|    }
   70|       |
   71|   846k|    ap = a->d != NULL ? a->d : tp;
  ------------------
  |  Branch (71:10): [True: 846k, False: 0]
  ------------------
   72|   846k|    bp = b->d != NULL ? b->d : tp;
  ------------------
  |  Branch (72:10): [True: 846k, False: 0]
  ------------------
   73|       |
   74|  6.39M|    for (i = 0, ai = 0, bi = 0, carry = 0; i < mtop;) {
  ------------------
  |  Branch (74:44): [True: 5.55M, False: 846k]
  ------------------
   75|  5.55M|        mask = (BN_ULONG)0 - ((i - a->top) >> (8 * sizeof(i) - 1));
   76|  5.55M|        temp = ((ap[ai] & mask) + carry) & BN_MASK2;
  ------------------
  |  |   93|  5.55M|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
   77|  5.55M|        carry = (temp < carry);
   78|       |
   79|  5.55M|        mask = (BN_ULONG)0 - ((i - b->top) >> (8 * sizeof(i) - 1));
   80|  5.55M|        tp[i] = ((bp[bi] & mask) + temp) & BN_MASK2;
  ------------------
  |  |   93|  5.55M|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
   81|  5.55M|        carry += (tp[i] < temp);
   82|       |
   83|  5.55M|        i++;
   84|  5.55M|        ai += (i - a->dmax) >> (8 * sizeof(i) - 1);
   85|  5.55M|        bi += (i - b->dmax) >> (8 * sizeof(i) - 1);
   86|  5.55M|    }
   87|   846k|    rp = r->d;
   88|   846k|    carry -= bn_sub_words(rp, tp, m->d, (int)mtop);
   89|  6.39M|    for (i = 0; i < mtop; i++) {
  ------------------
  |  Branch (89:17): [True: 5.55M, False: 846k]
  ------------------
   90|  5.55M|        rp[i] = (carry & tp[i]) | (~carry & rp[i]);
   91|  5.55M|        ((volatile BN_ULONG *)tp)[i] = 0;
   92|  5.55M|    }
   93|   846k|    r->top = (int)mtop;
   94|   846k|    r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  221|   846k|#define BN_FLG_FIXED_TOP 0
  ------------------
   95|   846k|    r->neg = 0;
   96|       |
   97|   846k|    if (tp != storage)
  ------------------
  |  Branch (97:9): [True: 0, False: 846k]
  ------------------
   98|      0|        OPENSSL_free(tp);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   99|       |
  100|   846k|    return 1;
  101|   846k|}
BN_mod_add_quick:
  105|   846k|{
  106|   846k|    int ret = bn_mod_add_fixed_top(r, a, b, m);
  107|       |
  108|   846k|    if (ret)
  ------------------
  |  Branch (108:9): [True: 846k, False: 0]
  ------------------
  109|   846k|        bn_correct_top(r);
  110|       |
  111|   846k|    return ret;
  112|   846k|}
BN_mod_sub_quick:
  192|   393k|{
  193|   393k|    if (r == m) {
  ------------------
  |  Branch (193:9): [True: 0, False: 393k]
  ------------------
  194|      0|        ERR_raise(ERR_LIB_BN, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  195|      0|        return 0;
  196|      0|    }
  197|       |
  198|   393k|    if (!BN_sub(r, a, b))
  ------------------
  |  Branch (198:9): [True: 0, False: 393k]
  ------------------
  199|      0|        return 0;
  200|   393k|    if (r->neg)
  ------------------
  |  Branch (200:9): [True: 197k, False: 196k]
  ------------------
  201|   197k|        return BN_add(r, r, m);
  202|   196k|    return 1;
  203|   393k|}
BN_mod_lshift1_quick:
  256|   131k|{
  257|   131k|    if (!BN_lshift1(r, a))
  ------------------
  |  Branch (257:9): [True: 0, False: 131k]
  ------------------
  258|      0|        return 0;
  259|   131k|    bn_check_top(r);
  260|   131k|    if (BN_cmp(r, m) >= 0)
  ------------------
  |  Branch (260:9): [True: 65.7k, False: 65.6k]
  ------------------
  261|  65.7k|        return BN_sub(r, r, m);
  262|  65.6k|    return 1;
  263|   131k|}
BN_mod_lshift_quick:
  293|  65.8k|{
  294|  65.8k|    if (r != a) {
  ------------------
  |  Branch (294:9): [True: 65.5k, False: 288]
  ------------------
  295|  65.5k|        if (BN_copy(r, a) == NULL)
  ------------------
  |  Branch (295:13): [True: 0, False: 65.5k]
  ------------------
  296|      0|            return 0;
  297|  65.5k|    }
  298|       |
  299|   191k|    while (n > 0) {
  ------------------
  |  Branch (299:12): [True: 125k, False: 65.8k]
  ------------------
  300|   125k|        int max_shift;
  301|       |
  302|       |        /* 0 < r < m */
  303|   125k|        max_shift = BN_num_bits(m) - BN_num_bits(r);
  304|       |        /* max_shift >= 0 */
  305|       |
  306|   125k|        if (max_shift < 0) {
  ------------------
  |  Branch (306:13): [True: 0, False: 125k]
  ------------------
  307|      0|            ERR_raise(ERR_LIB_BN, BN_R_INPUT_NOT_REDUCED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  308|      0|            return 0;
  309|      0|        }
  310|       |
  311|   125k|        if (max_shift > n)
  ------------------
  |  Branch (311:13): [True: 58.7k, False: 67.0k]
  ------------------
  312|  58.7k|            max_shift = n;
  313|       |
  314|   125k|        if (max_shift) {
  ------------------
  |  Branch (314:13): [True: 118k, False: 7.13k]
  ------------------
  315|   118k|            if (!BN_lshift(r, r, max_shift))
  ------------------
  |  Branch (315:17): [True: 0, False: 118k]
  ------------------
  316|      0|                return 0;
  317|   118k|            n -= max_shift;
  318|   118k|        } else {
  319|  7.13k|            if (!BN_lshift1(r, r))
  ------------------
  |  Branch (319:17): [True: 0, False: 7.13k]
  ------------------
  320|      0|                return 0;
  321|  7.13k|            --n;
  322|  7.13k|        }
  323|       |
  324|       |        /* BN_num_bits(r) <= BN_num_bits(m) */
  325|       |
  326|   125k|        if (BN_cmp(r, m) >= 0) {
  ------------------
  |  Branch (326:13): [True: 60.0k, False: 65.6k]
  ------------------
  327|  60.0k|            if (!BN_sub(r, r, m))
  ------------------
  |  Branch (327:17): [True: 0, False: 60.0k]
  ------------------
  328|      0|                return 0;
  329|  60.0k|        }
  330|   125k|    }
  331|  65.8k|    bn_check_top(r);
  332|       |
  333|  65.8k|    return 1;
  334|  65.8k|}

BN_mod_mul_montgomery:
   27|  1.46M|{
   28|  1.46M|    int ret = bn_mul_mont_fixed_top(r, a, b, mont, ctx);
   29|       |
   30|  1.46M|    bn_correct_top(r);
   31|  1.46M|    bn_check_top(r);
   32|       |
   33|  1.46M|    return ret;
   34|  1.46M|}
bn_mul_mont_fixed_top:
   38|  1.54M|{
   39|  1.54M|    BIGNUM *tmp;
   40|  1.54M|    int ret = 0;
   41|  1.54M|    int num = mont->N.top;
   42|       |
   43|  1.54M|#if defined(OPENSSL_BN_ASM_MONT) && defined(MONT_WORD)
   44|  1.54M|    if (num > 1 && num <= BN_SOFT_LIMIT && a->top == num && b->top == num) {
  ------------------
  |  |   62|  3.09M|#define BN_SOFT_LIMIT (4096 / BN_BYTES)
  |  |  ------------------
  |  |  |  |   38|  1.54M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  |  Branch (44:9): [True: 1.54M, False: 0]
  |  Branch (44:20): [True: 1.54M, False: 0]
  |  Branch (44:44): [True: 1.53M, False: 11.5k]
  |  Branch (44:61): [True: 1.53M, False: 0]
  ------------------
   45|  1.53M|        if (bn_wexpand(r, num) == NULL)
  ------------------
  |  Branch (45:13): [True: 0, False: 1.53M]
  ------------------
   46|      0|            return 0;
   47|  1.53M|        if (bn_mul_mont(r->d, a->d, b->d, mont->N.d, mont->n0, num)) {
  ------------------
  |  Branch (47:13): [True: 1.53M, False: 0]
  ------------------
   48|  1.53M|            r->neg = a->neg ^ b->neg;
   49|  1.53M|            r->top = num;
   50|  1.53M|            r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  221|  1.53M|#define BN_FLG_FIXED_TOP 0
  ------------------
   51|  1.53M|            return 1;
   52|  1.53M|        }
   53|  1.53M|    }
   54|  11.5k|#endif
   55|       |
   56|  11.5k|    if ((a->top + b->top) > 2 * num)
  ------------------
  |  Branch (56:9): [True: 0, False: 11.5k]
  ------------------
   57|      0|        return 0;
   58|       |
   59|  11.5k|    BN_CTX_start(ctx);
   60|  11.5k|    tmp = BN_CTX_get(ctx);
   61|  11.5k|    if (tmp == NULL)
  ------------------
  |  Branch (61:9): [True: 0, False: 11.5k]
  ------------------
   62|      0|        goto err;
   63|       |
   64|  11.5k|    bn_check_top(tmp);
   65|  11.5k|    if (a == b) {
  ------------------
  |  Branch (65:9): [True: 0, False: 11.5k]
  ------------------
   66|      0|        if (!bn_sqr_fixed_top(tmp, a, ctx))
  ------------------
  |  Branch (66:13): [True: 0, False: 0]
  ------------------
   67|      0|            goto err;
   68|  11.5k|    } else {
   69|  11.5k|        if (!bn_mul_fixed_top(tmp, a, b, ctx))
  ------------------
  |  Branch (69:13): [True: 0, False: 11.5k]
  ------------------
   70|      0|            goto err;
   71|  11.5k|    }
   72|       |    /* reduce from aRR to aR */
   73|  11.5k|#ifdef MONT_WORD
   74|  11.5k|    if (!bn_from_montgomery_word(r, tmp, mont))
  ------------------
  |  Branch (74:9): [True: 0, False: 11.5k]
  ------------------
   75|      0|        goto err;
   76|       |#else
   77|       |    if (!BN_from_montgomery(r, tmp, mont, ctx))
   78|       |        goto err;
   79|       |#endif
   80|  11.5k|    ret = 1;
   81|  11.5k|err:
   82|  11.5k|    BN_CTX_end(ctx);
   83|  11.5k|    return ret;
   84|  11.5k|}
BN_from_montgomery:
  163|    720|{
  164|    720|    int retn;
  165|       |
  166|    720|    retn = bn_from_mont_fixed_top(ret, a, mont, ctx);
  167|    720|    bn_correct_top(ret);
  168|    720|    bn_check_top(ret);
  169|       |
  170|    720|    return retn;
  171|    720|}
bn_from_mont_fixed_top:
  175|    796|{
  176|    796|    int retn = 0;
  177|    796|#ifdef MONT_WORD
  178|    796|    BIGNUM *t;
  179|       |
  180|    796|    BN_CTX_start(ctx);
  181|    796|    if ((t = BN_CTX_get(ctx)) && BN_copy(t, a)) {
  ------------------
  |  Branch (181:9): [True: 796, False: 0]
  |  Branch (181:34): [True: 796, False: 0]
  ------------------
  182|    796|        retn = bn_from_montgomery_word(ret, t, mont);
  183|    796|    }
  184|    796|    BN_CTX_end(ctx);
  185|       |#else /* !MONT_WORD */
  186|       |    BIGNUM *t1, *t2;
  187|       |
  188|       |    BN_CTX_start(ctx);
  189|       |    t1 = BN_CTX_get(ctx);
  190|       |    t2 = BN_CTX_get(ctx);
  191|       |    if (t2 == NULL)
  192|       |        goto err;
  193|       |
  194|       |    if (!BN_copy(t1, a))
  195|       |        goto err;
  196|       |    BN_mask_bits(t1, mont->ri);
  197|       |
  198|       |    if (!BN_mul(t2, t1, &mont->Ni, ctx))
  199|       |        goto err;
  200|       |    BN_mask_bits(t2, mont->ri);
  201|       |
  202|       |    if (!BN_mul(t1, t2, &mont->N, ctx))
  203|       |        goto err;
  204|       |    if (!BN_add(t2, a, t1))
  205|       |        goto err;
  206|       |    if (!BN_rshift(ret, t2, mont->ri))
  207|       |        goto err;
  208|       |
  209|       |    if (BN_ucmp(ret, &(mont->N)) >= 0) {
  210|       |        if (!BN_usub(ret, ret, &(mont->N)))
  211|       |            goto err;
  212|       |    }
  213|       |    retn = 1;
  214|       |    bn_check_top(ret);
  215|       |err:
  216|       |    BN_CTX_end(ctx);
  217|       |#endif /* MONT_WORD */
  218|    796|    return retn;
  219|    796|}
bn_to_mont_fixed_top:
  223|    220|{
  224|    220|    return bn_mul_mont_fixed_top(r, a, &(mont->RR), mont, ctx);
  225|    220|}
BN_MONT_CTX_new:
  228|   249k|{
  229|   249k|    BN_MONT_CTX *ret;
  230|       |
  231|   249k|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  106|   249k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (231:9): [True: 0, False: 249k]
  ------------------
  232|      0|        return NULL;
  233|       |
  234|   249k|    BN_MONT_CTX_init(ret);
  235|   249k|    ret->flags = BN_FLG_MALLOCED;
  ------------------
  |  |   58|   249k|#define BN_FLG_MALLOCED 0x01
  ------------------
  236|   249k|    return ret;
  237|   249k|}
BN_MONT_CTX_init:
  240|   249k|{
  241|   249k|    ctx->ri = 0;
  242|   249k|    bn_init(&ctx->RR);
  243|   249k|    bn_init(&ctx->N);
  244|   249k|    bn_init(&ctx->Ni);
  245|   249k|    ctx->n0[0] = ctx->n0[1] = 0;
  246|   249k|    ctx->flags = 0;
  247|   249k|}
BN_MONT_CTX_free:
  250|  1.28M|{
  251|  1.28M|    if (mont == NULL)
  ------------------
  |  Branch (251:9): [True: 1.03M, False: 249k]
  ------------------
  252|  1.03M|        return;
  253|   249k|    BN_clear_free(&mont->RR);
  254|   249k|    BN_clear_free(&mont->N);
  255|   249k|    BN_clear_free(&mont->Ni);
  256|   249k|    if (mont->flags & BN_FLG_MALLOCED)
  ------------------
  |  |   58|   249k|#define BN_FLG_MALLOCED 0x01
  ------------------
  |  Branch (256:9): [True: 249k, False: 0]
  ------------------
  257|   249k|        OPENSSL_free(mont);
  ------------------
  |  |  131|   249k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  258|   249k|}
BN_MONT_CTX_set:
  261|   102k|{
  262|   102k|    int i, ret = 0;
  263|   102k|    BIGNUM *Ri, *R;
  264|       |
  265|   102k|    if (BN_is_zero(mod))
  ------------------
  |  Branch (265:9): [True: 0, False: 102k]
  ------------------
  266|      0|        return 0;
  267|       |
  268|   102k|    BN_CTX_start(ctx);
  269|   102k|    if ((Ri = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (269:9): [True: 0, False: 102k]
  ------------------
  270|      0|        goto err;
  271|   102k|    R = &(mont->RR); /* grab RR as a temp */
  272|   102k|    if (!BN_copy(&(mont->N), mod))
  ------------------
  |  Branch (272:9): [True: 0, False: 102k]
  ------------------
  273|      0|        goto err; /* Set N */
  274|   102k|    if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0)
  ------------------
  |  |   67|   102k|#define BN_FLG_CONSTTIME 0x04
  ------------------
  |  Branch (274:9): [True: 0, False: 102k]
  ------------------
  275|      0|        BN_set_flags(&(mont->N), BN_FLG_CONSTTIME);
  ------------------
  |  |   67|      0|#define BN_FLG_CONSTTIME 0x04
  ------------------
  276|   102k|    mont->N.neg = 0;
  277|       |
  278|   102k|#ifdef MONT_WORD
  279|   102k|    {
  280|   102k|        BIGNUM tmod;
  281|   102k|        BN_ULONG buf[2];
  ------------------
  |  |   37|   102k|#define BN_ULONG unsigned long
  ------------------
  282|       |
  283|   102k|        bn_init(&tmod);
  284|   102k|        tmod.d = buf;
  285|   102k|        tmod.dmax = 2;
  286|   102k|        tmod.neg = 0;
  287|       |
  288|   102k|        if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0)
  ------------------
  |  |   67|   102k|#define BN_FLG_CONSTTIME 0x04
  ------------------
  |  Branch (288:13): [True: 0, False: 102k]
  ------------------
  289|      0|            BN_set_flags(&tmod, BN_FLG_CONSTTIME);
  ------------------
  |  |   67|      0|#define BN_FLG_CONSTTIME 0x04
  ------------------
  290|       |
  291|   102k|        mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2;
  ------------------
  |  |   54|   102k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   102k|#define BN_BYTES 8
  |  |  ------------------
  ------------------
                      mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2;
  ------------------
  |  |   54|   102k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   102k|#define BN_BYTES 8
  |  |  ------------------
  ------------------
                      mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2;
  ------------------
  |  |   54|   102k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   102k|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  292|       |
  293|       |#if defined(OPENSSL_BN_ASM_MONT) && (BN_BITS2 <= 32)
  294|       |        /*
  295|       |         * Only certain BN_BITS2<=32 platforms actually make use of n0[1],
  296|       |         * and we could use the #else case (with a shorter R value) for the
  297|       |         * others.  However, currently only the assembler files do know which
  298|       |         * is which.
  299|       |         */
  300|       |
  301|       |        BN_zero(R);
  302|       |        if (!(BN_set_bit(R, 2 * BN_BITS2)))
  303|       |            goto err;
  304|       |
  305|       |        tmod.top = 0;
  306|       |        if ((buf[0] = mod->d[0]))
  307|       |            tmod.top = 1;
  308|       |        if ((buf[1] = mod->top > 1 ? mod->d[1] : 0))
  309|       |            tmod.top = 2;
  310|       |
  311|       |        if (BN_is_one(&tmod))
  312|       |            BN_zero(Ri);
  313|       |        else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL)
  314|       |            goto err;
  315|       |        if (!BN_lshift(Ri, Ri, 2 * BN_BITS2))
  316|       |            goto err; /* R*Ri */
  317|       |        if (!BN_is_zero(Ri)) {
  318|       |            if (!BN_sub_word(Ri, 1))
  319|       |                goto err;
  320|       |        } else { /* if N mod word size == 1 */
  321|       |
  322|       |            if (bn_expand(Ri, (int)sizeof(BN_ULONG) * 2) == NULL)
  323|       |                goto err;
  324|       |            /* Ri-- (mod double word size) */
  325|       |            Ri->neg = 0;
  326|       |            Ri->d[0] = BN_MASK2;
  327|       |            Ri->d[1] = BN_MASK2;
  328|       |            Ri->top = 2;
  329|       |        }
  330|       |        if (!BN_div(Ri, NULL, Ri, &tmod, ctx))
  331|       |            goto err;
  332|       |        /*
  333|       |         * Ni = (R*Ri-1)/N, keep only couple of least significant words:
  334|       |         */
  335|       |        mont->n0[0] = (Ri->top > 0) ? Ri->d[0] : 0;
  336|       |        mont->n0[1] = (Ri->top > 1) ? Ri->d[1] : 0;
  337|       |#else
  338|   102k|        BN_zero(R);
  ------------------
  |  |  201|   102k|#define BN_zero(a) BN_zero_ex(a)
  ------------------
  339|   102k|        if (!(BN_set_bit(R, BN_BITS2)))
  ------------------
  |  |   54|   102k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   102k|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  |  Branch (339:13): [True: 0, False: 102k]
  ------------------
  340|      0|            goto err; /* R */
  341|       |
  342|   102k|        buf[0] = mod->d[0]; /* tmod = N mod word size */
  343|   102k|        buf[1] = 0;
  344|   102k|        tmod.top = buf[0] != 0 ? 1 : 0;
  ------------------
  |  Branch (344:20): [True: 102k, False: 0]
  ------------------
  345|       |        /* Ri = R^-1 mod N */
  346|   102k|        if (BN_is_one(&tmod))
  ------------------
  |  Branch (346:13): [True: 0, False: 102k]
  ------------------
  347|      0|            BN_zero(Ri);
  ------------------
  |  |  201|      0|#define BN_zero(a) BN_zero_ex(a)
  ------------------
  348|   102k|        else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL)
  ------------------
  |  Branch (348:18): [True: 0, False: 102k]
  ------------------
  349|      0|            goto err;
  350|   102k|        if (!BN_lshift(Ri, Ri, BN_BITS2))
  ------------------
  |  |   54|   102k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|   102k|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  |  Branch (350:13): [True: 0, False: 102k]
  ------------------
  351|      0|            goto err; /* R*Ri */
  352|   102k|        if (!BN_is_zero(Ri)) {
  ------------------
  |  Branch (352:13): [True: 102k, False: 0]
  ------------------
  353|   102k|            if (!BN_sub_word(Ri, 1))
  ------------------
  |  Branch (353:17): [True: 0, False: 102k]
  ------------------
  354|      0|                goto err;
  355|   102k|        } else { /* if N mod word size == 1 */
  356|       |
  357|      0|            if (!BN_set_word(Ri, BN_MASK2))
  ------------------
  |  |   93|      0|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  |  Branch (357:17): [True: 0, False: 0]
  ------------------
  358|      0|                goto err; /* Ri-- (mod word size) */
  359|      0|        }
  360|   102k|        if (!BN_div(Ri, NULL, Ri, &tmod, ctx))
  ------------------
  |  Branch (360:13): [True: 0, False: 102k]
  ------------------
  361|      0|            goto err;
  362|       |        /*
  363|       |         * Ni = (R*Ri-1)/N, keep only least significant word:
  364|       |         */
  365|   102k|        mont->n0[0] = (Ri->top > 0) ? Ri->d[0] : 0;
  ------------------
  |  Branch (365:23): [True: 102k, False: 0]
  ------------------
  366|   102k|        mont->n0[1] = 0;
  367|   102k|#endif
  368|   102k|    }
  369|       |#else /* !MONT_WORD */
  370|       |    { /* bignum version */
  371|       |        mont->ri = BN_num_bits(&mont->N);
  372|       |        BN_zero(R);
  373|       |        if (!BN_set_bit(R, mont->ri))
  374|       |            goto err; /* R = 2^ri */
  375|       |        /* Ri = R^-1 mod N */
  376|       |        if ((BN_mod_inverse(Ri, R, &mont->N, ctx)) == NULL)
  377|       |            goto err;
  378|       |        if (!BN_lshift(Ri, Ri, mont->ri))
  379|       |            goto err; /* R*Ri */
  380|       |        if (!BN_sub_word(Ri, 1))
  381|       |            goto err;
  382|       |        /*
  383|       |         * Ni = (R*Ri-1) / N
  384|       |         */
  385|       |        if (!BN_div(&(mont->Ni), NULL, Ri, &mont->N, ctx))
  386|       |            goto err;
  387|       |    }
  388|       |#endif
  389|       |
  390|       |    /* setup RR for conversions */
  391|   102k|    BN_zero(&(mont->RR));
  ------------------
  |  |  201|   102k|#define BN_zero(a) BN_zero_ex(a)
  ------------------
  392|   102k|    if (!BN_set_bit(&(mont->RR), mont->ri * 2))
  ------------------
  |  Branch (392:9): [True: 0, False: 102k]
  ------------------
  393|      0|        goto err;
  394|   102k|    if (!BN_mod(&(mont->RR), &(mont->RR), &(mont->N), ctx))
  ------------------
  |  |  276|   102k|#define BN_mod(rem, m, d, ctx) BN_div(NULL, (rem), (m), (d), (ctx))
  ------------------
  |  Branch (394:9): [True: 0, False: 102k]
  ------------------
  395|      0|        goto err;
  396|       |
  397|   102k|    for (i = mont->RR.top, ret = mont->N.top; i < ret; i++)
  ------------------
  |  Branch (397:47): [True: 0, False: 102k]
  ------------------
  398|      0|        mont->RR.d[i] = 0;
  399|   102k|    mont->RR.top = ret;
  400|   102k|    mont->RR.flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  221|   102k|#define BN_FLG_FIXED_TOP 0
  ------------------
  401|       |
  402|   102k|    ret = 1;
  403|   102k|err:
  404|   102k|    BN_CTX_end(ctx);
  405|   102k|    return ret;
  406|   102k|}
BN_MONT_CTX_copy:
  409|   124k|{
  410|   124k|    if (to == from)
  ------------------
  |  Branch (410:9): [True: 0, False: 124k]
  ------------------
  411|      0|        return to;
  412|       |
  413|   124k|    if (!BN_copy(&(to->RR), &(from->RR)))
  ------------------
  |  Branch (413:9): [True: 0, False: 124k]
  ------------------
  414|      0|        return NULL;
  415|   124k|    if (!BN_copy(&(to->N), &(from->N)))
  ------------------
  |  Branch (415:9): [True: 0, False: 124k]
  ------------------
  416|      0|        return NULL;
  417|   124k|    if (!BN_copy(&(to->Ni), &(from->Ni)))
  ------------------
  |  Branch (417:9): [True: 0, False: 124k]
  ------------------
  418|      0|        return NULL;
  419|   124k|    to->ri = from->ri;
  420|   124k|    to->n0[0] = from->n0[0];
  421|   124k|    to->n0[1] = from->n0[1];
  422|   124k|    return to;
  423|   124k|}
BN_MONT_CTX_set_locked:
  427|     76|{
  428|     76|    BN_MONT_CTX *ret;
  429|       |
  430|     76|    if (!CRYPTO_THREAD_read_lock(lock))
  ------------------
  |  Branch (430:9): [True: 0, False: 76]
  ------------------
  431|      0|        return NULL;
  432|     76|    ret = *pmont;
  433|     76|    CRYPTO_THREAD_unlock(lock);
  434|     76|    if (ret)
  ------------------
  |  Branch (434:9): [True: 0, False: 76]
  ------------------
  435|      0|        return ret;
  436|       |
  437|       |    /*
  438|       |     * We don't want to serialize globally while doing our lazy-init math in
  439|       |     * BN_MONT_CTX_set. That punishes threads that are doing independent
  440|       |     * things. Instead, punish the case where more than one thread tries to
  441|       |     * lazy-init the same 'pmont', by having each do the lazy-init math work
  442|       |     * independently and only use the one from the thread that wins the race
  443|       |     * (the losers throw away the work they've done).
  444|       |     */
  445|     76|    ret = BN_MONT_CTX_new();
  446|     76|    if (ret == NULL)
  ------------------
  |  Branch (446:9): [True: 0, False: 76]
  ------------------
  447|      0|        return NULL;
  448|     76|    if (!BN_MONT_CTX_set(ret, mod, ctx)) {
  ------------------
  |  Branch (448:9): [True: 0, False: 76]
  ------------------
  449|      0|        BN_MONT_CTX_free(ret);
  450|      0|        return NULL;
  451|      0|    }
  452|       |
  453|       |    /* The locked compare-and-set, after the local work is done. */
  454|     76|    if (!CRYPTO_THREAD_write_lock(lock)) {
  ------------------
  |  Branch (454:9): [True: 0, False: 76]
  ------------------
  455|      0|        BN_MONT_CTX_free(ret);
  456|      0|        return NULL;
  457|      0|    }
  458|       |
  459|     76|    if (*pmont) {
  ------------------
  |  Branch (459:9): [True: 0, False: 76]
  ------------------
  460|      0|        BN_MONT_CTX_free(ret);
  461|      0|        ret = *pmont;
  462|      0|    } else
  463|     76|        *pmont = ret;
  464|     76|    CRYPTO_THREAD_unlock(lock);
  465|     76|    return ret;
  466|     76|}
ossl_bn_mont_ctx_set:
  470|  22.6k|{
  471|  22.6k|    if (BN_copy(&ctx->N, modulus) == NULL)
  ------------------
  |  Branch (471:9): [True: 0, False: 22.6k]
  ------------------
  472|      0|        return 0;
  473|  22.6k|    if (BN_bin2bn(rr, rrlen, &ctx->RR) == NULL)
  ------------------
  |  Branch (473:9): [True: 0, False: 22.6k]
  ------------------
  474|      0|        return 0;
  475|  22.6k|    ctx->ri = ri;
  476|       |#if (BN_BITS2 <= 32) && defined(OPENSSL_BN_ASM_MONT)
  477|       |    ctx->n0[0] = nlo;
  478|       |    ctx->n0[1] = nhi;
  479|       |#elif BN_BITS2 <= 32
  480|       |    ctx->n0[0] = nlo;
  481|       |    ctx->n0[1] = 0;
  482|       |#else
  483|  22.6k|    ctx->n0[0] = ((BN_ULONG)nhi << 32) | nlo;
  484|  22.6k|    ctx->n0[1] = 0;
  485|  22.6k|#endif
  486|       |
  487|  22.6k|    return 1;
  488|  22.6k|}
bn_mont.c:bn_from_montgomery_word:
   88|  12.3k|{
   89|  12.3k|    BIGNUM *n;
   90|  12.3k|    BN_ULONG *ap, *np, *rp, n0, v, carry;
  ------------------
  |  |   37|  12.3k|#define BN_ULONG unsigned long
  ------------------
   91|  12.3k|    int nl, max, i;
   92|  12.3k|    unsigned int rtop;
   93|       |
   94|  12.3k|    n = &(mont->N);
   95|  12.3k|    nl = n->top;
   96|  12.3k|    if (nl == 0) {
  ------------------
  |  Branch (96:9): [True: 0, False: 12.3k]
  ------------------
   97|      0|        ret->top = 0;
   98|      0|        return 1;
   99|      0|    }
  100|       |
  101|  12.3k|    max = (2 * nl); /* carry is stored separately */
  102|  12.3k|    if (bn_wexpand(r, max) == NULL)
  ------------------
  |  Branch (102:9): [True: 0, False: 12.3k]
  ------------------
  103|      0|        return 0;
  104|       |
  105|  12.3k|    r->neg ^= n->neg;
  106|  12.3k|    np = n->d;
  107|  12.3k|    rp = r->d;
  108|       |
  109|       |    /* clear the top words of T */
  110|   140k|    for (rtop = r->top, i = 0; i < max; i++) {
  ------------------
  |  Branch (110:32): [True: 127k, False: 12.3k]
  ------------------
  111|   127k|        v = (BN_ULONG)0 - ((i - rtop) >> (8 * sizeof(rtop) - 1));
  112|   127k|        rp[i] &= v;
  113|   127k|    }
  114|       |
  115|  12.3k|    r->top = max;
  116|  12.3k|    r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  221|  12.3k|#define BN_FLG_FIXED_TOP 0
  ------------------
  117|  12.3k|    n0 = mont->n0[0];
  118|       |
  119|       |    /*
  120|       |     * Add multiples of |n| to |r| until R = 2^(nl * BN_BITS2) divides it. On
  121|       |     * input, we had |r| < |n| * R, so now |r| < 2 * |n| * R. Note that |r|
  122|       |     * includes |carry| which is stored separately.
  123|       |     */
  124|  76.3k|    for (carry = 0, i = 0; i < nl; i++, rp++) {
  ------------------
  |  Branch (124:28): [True: 63.9k, False: 12.3k]
  ------------------
  125|  63.9k|        v = bn_mul_add_words(rp, np, nl, (rp[0] * n0) & BN_MASK2);
  ------------------
  |  |   93|  63.9k|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  126|  63.9k|        v = (v + carry + rp[nl]) & BN_MASK2;
  ------------------
  |  |   93|  63.9k|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  127|  63.9k|        carry |= (v != rp[nl]);
  128|  63.9k|        carry &= (v <= rp[nl]);
  129|  63.9k|        rp[nl] = v;
  130|  63.9k|    }
  131|       |
  132|  12.3k|    if (bn_wexpand(ret, nl) == NULL)
  ------------------
  |  Branch (132:9): [True: 0, False: 12.3k]
  ------------------
  133|      0|        return 0;
  134|  12.3k|    ret->top = nl;
  135|  12.3k|    ret->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  221|  12.3k|#define BN_FLG_FIXED_TOP 0
  ------------------
  136|  12.3k|    ret->neg = r->neg;
  137|       |
  138|  12.3k|    rp = ret->d;
  139|       |
  140|       |    /*
  141|       |     * Shift |nl| words to divide by R. We have |ap| < 2 * |n|. Note that |ap|
  142|       |     * includes |carry| which is stored separately.
  143|       |     */
  144|  12.3k|    ap = &(r->d[nl]);
  145|       |
  146|  12.3k|    carry -= bn_sub_words(rp, ap, np, nl);
  147|       |    /*
  148|       |     * |carry| is -1 if |ap| - |np| underflowed or zero if it did not. Note
  149|       |     * |carry| cannot be 1. That would imply the subtraction did not fit in
  150|       |     * |nl| words, and we know at most one subtraction is needed.
  151|       |     */
  152|  76.3k|    for (i = 0; i < nl; i++) {
  ------------------
  |  Branch (152:17): [True: 63.9k, False: 12.3k]
  ------------------
  153|  63.9k|        rp[i] = (carry & ap[i]) | (~carry & rp[i]);
  154|  63.9k|        ap[i] = 0;
  155|  63.9k|    }
  156|       |
  157|  12.3k|    return 1;
  158|  12.3k|}

BN_mul:
  498|   203k|{
  499|   203k|    int ret = bn_mul_fixed_top(r, a, b, ctx);
  500|       |
  501|   203k|    bn_correct_top(r);
  502|   203k|    bn_check_top(r);
  503|       |
  504|   203k|    return ret;
  505|   203k|}
bn_mul_fixed_top:
  508|   215k|{
  509|   215k|    int ret = 0;
  510|   215k|    int top, al, bl;
  511|   215k|    BIGNUM *rr;
  512|   215k|#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
  513|   215k|    int i;
  514|   215k|#endif
  515|   215k|#ifdef BN_RECURSION
  516|   215k|    BIGNUM *t = NULL;
  517|   215k|    int j = 0, k;
  518|   215k|#endif
  519|       |
  520|   215k|    bn_check_top(a);
  521|   215k|    bn_check_top(b);
  522|   215k|    bn_check_top(r);
  523|       |
  524|   215k|    al = a->top;
  525|   215k|    bl = b->top;
  526|       |
  527|   215k|    if ((al == 0) || (bl == 0)) {
  ------------------
  |  Branch (527:9): [True: 0, False: 215k]
  |  Branch (527:22): [True: 0, False: 215k]
  ------------------
  528|      0|        BN_zero(r);
  ------------------
  |  |  201|      0|#define BN_zero(a) BN_zero_ex(a)
  ------------------
  529|      0|        return 1;
  530|      0|    }
  531|   215k|    top = al + bl;
  532|       |
  533|   215k|    BN_CTX_start(ctx);
  534|   215k|    if ((r == a) || (r == b)) {
  ------------------
  |  Branch (534:9): [True: 203k, False: 11.7k]
  |  Branch (534:21): [True: 0, False: 11.7k]
  ------------------
  535|   203k|        if ((rr = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (535:13): [True: 0, False: 203k]
  ------------------
  536|      0|            goto err;
  537|   203k|    } else
  538|  11.7k|        rr = r;
  539|       |
  540|   215k|#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
  541|   215k|    i = al - bl;
  542|   215k|#endif
  543|   215k|#ifdef BN_MUL_COMBA
  544|   215k|    if (i == 0) {
  ------------------
  |  Branch (544:9): [True: 203k, False: 11.7k]
  ------------------
  545|       |#if 0
  546|       |        if (al == 4) {
  547|       |            if (bn_wexpand(rr, 8) == NULL)
  548|       |                goto err;
  549|       |            rr->top = 8;
  550|       |            bn_mul_comba4(rr->d, a->d, b->d);
  551|       |            goto end;
  552|       |        }
  553|       |#endif
  554|   203k|        if (al == 8) {
  ------------------
  |  Branch (554:13): [True: 0, False: 203k]
  ------------------
  555|      0|            if (bn_wexpand(rr, 16) == NULL)
  ------------------
  |  Branch (555:17): [True: 0, False: 0]
  ------------------
  556|      0|                goto err;
  557|      0|            rr->top = 16;
  558|      0|            bn_mul_comba8(rr->d, a->d, b->d);
  559|      0|            goto end;
  560|      0|        }
  561|   203k|    }
  562|   215k|#endif /* BN_MUL_COMBA */
  563|   215k|#ifdef BN_RECURSION
  564|   215k|    if ((al >= BN_MULL_SIZE_NORMAL) && (bl >= BN_MULL_SIZE_NORMAL)) {
  ------------------
  |  |  359|   215k|#define BN_MULL_SIZE_NORMAL (16) /* 32 */
  ------------------
                  if ((al >= BN_MULL_SIZE_NORMAL) && (bl >= BN_MULL_SIZE_NORMAL)) {
  ------------------
  |  |  359|      0|#define BN_MULL_SIZE_NORMAL (16) /* 32 */
  ------------------
  |  Branch (564:9): [True: 0, False: 215k]
  |  Branch (564:40): [True: 0, False: 0]
  ------------------
  565|      0|        if (i >= -1 && i <= 1) {
  ------------------
  |  Branch (565:13): [True: 0, False: 0]
  |  Branch (565:24): [True: 0, False: 0]
  ------------------
  566|       |            /*
  567|       |             * Find out the power of two lower or equal to the longest of the
  568|       |             * two numbers
  569|       |             */
  570|      0|            if (i >= 0) {
  ------------------
  |  Branch (570:17): [True: 0, False: 0]
  ------------------
  571|      0|                j = BN_num_bits_word((BN_ULONG)al);
  572|      0|            }
  573|      0|            if (i == -1) {
  ------------------
  |  Branch (573:17): [True: 0, False: 0]
  ------------------
  574|      0|                j = BN_num_bits_word((BN_ULONG)bl);
  575|      0|            }
  576|      0|            j = 1 << (j - 1);
  577|      0|            assert(j <= al || j <= bl);
  ------------------
  |  Branch (577:13): [True: 0, False: 0]
  |  Branch (577:13): [True: 0, False: 0]
  |  Branch (577:13): [True: 0, False: 0]
  |  Branch (577:13): [True: 0, False: 0]
  ------------------
  578|      0|            k = j + j;
  579|      0|            t = BN_CTX_get(ctx);
  580|      0|            if (t == NULL)
  ------------------
  |  Branch (580:17): [True: 0, False: 0]
  ------------------
  581|      0|                goto err;
  582|      0|            if (al > j || bl > j) {
  ------------------
  |  Branch (582:17): [True: 0, False: 0]
  |  Branch (582:27): [True: 0, False: 0]
  ------------------
  583|      0|                if (bn_wexpand(t, k * 4) == NULL)
  ------------------
  |  Branch (583:21): [True: 0, False: 0]
  ------------------
  584|      0|                    goto err;
  585|      0|                if (bn_wexpand(rr, k * 4) == NULL)
  ------------------
  |  Branch (585:21): [True: 0, False: 0]
  ------------------
  586|      0|                    goto err;
  587|      0|                bn_mul_part_recursive(rr->d, a->d, b->d,
  588|      0|                    j, al - j, bl - j, t->d);
  589|      0|            } else { /* al <= j || bl <= j */
  590|       |
  591|      0|                if (bn_wexpand(t, k * 2) == NULL)
  ------------------
  |  Branch (591:21): [True: 0, False: 0]
  ------------------
  592|      0|                    goto err;
  593|      0|                if (bn_wexpand(rr, k * 2) == NULL)
  ------------------
  |  Branch (593:21): [True: 0, False: 0]
  ------------------
  594|      0|                    goto err;
  595|      0|                bn_mul_recursive(rr->d, a->d, b->d, j, al - j, bl - j, t->d);
  596|      0|            }
  597|      0|            rr->top = top;
  598|      0|            goto end;
  599|      0|        }
  600|      0|    }
  601|   215k|#endif /* BN_RECURSION */
  602|   215k|    if (bn_wexpand(rr, top) == NULL)
  ------------------
  |  Branch (602:9): [True: 0, False: 215k]
  ------------------
  603|      0|        goto err;
  604|   215k|    rr->top = top;
  605|   215k|    bn_mul_normal(rr->d, a->d, al, b->d, bl);
  606|       |
  607|   215k|#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
  608|   215k|end:
  609|   215k|#endif
  610|   215k|    rr->neg = a->neg ^ b->neg;
  611|   215k|    rr->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  221|   215k|#define BN_FLG_FIXED_TOP 0
  ------------------
  612|   215k|    if (r != rr && BN_copy(r, rr) == NULL)
  ------------------
  |  Branch (612:9): [True: 203k, False: 11.7k]
  |  Branch (612:20): [True: 0, False: 203k]
  ------------------
  613|      0|        goto err;
  614|       |
  615|   215k|    ret = 1;
  616|   215k|err:
  617|   215k|    bn_check_top(r);
  618|   215k|    BN_CTX_end(ctx);
  619|   215k|    return ret;
  620|   215k|}
bn_mul_normal:
  623|   215k|{
  624|   215k|    BN_ULONG *rr;
  ------------------
  |  |   37|   215k|#define BN_ULONG unsigned long
  ------------------
  625|       |
  626|   215k|    if (na < nb) {
  ------------------
  |  Branch (626:9): [True: 11.5k, False: 203k]
  ------------------
  627|  11.5k|        int itmp;
  628|  11.5k|        BN_ULONG *ltmp;
  ------------------
  |  |   37|  11.5k|#define BN_ULONG unsigned long
  ------------------
  629|       |
  630|  11.5k|        itmp = na;
  631|  11.5k|        na = nb;
  632|  11.5k|        nb = itmp;
  633|  11.5k|        ltmp = a;
  634|  11.5k|        a = b;
  635|  11.5k|        b = ltmp;
  636|  11.5k|    }
  637|   215k|    rr = &(r[na]);
  638|   215k|    if (nb <= 0) {
  ------------------
  |  Branch (638:9): [True: 0, False: 215k]
  ------------------
  639|      0|        (void)bn_mul_words(r, a, na, 0);
  640|      0|        return;
  641|      0|    } else
  642|   215k|        rr[0] = bn_mul_words(r, a, na, b[0]);
  643|       |
  644|   418k|    for (;;) {
  645|   418k|        if (--nb <= 0)
  ------------------
  |  Branch (645:13): [True: 11.7k, False: 406k]
  ------------------
  646|  11.7k|            return;
  647|   406k|        rr[1] = bn_mul_add_words(&(r[1]), a, na, b[1]);
  648|   406k|        if (--nb <= 0)
  ------------------
  |  Branch (648:13): [True: 203k, False: 203k]
  ------------------
  649|   203k|            return;
  650|   203k|        rr[2] = bn_mul_add_words(&(r[2]), a, na, b[2]);
  651|   203k|        if (--nb <= 0)
  ------------------
  |  Branch (651:13): [True: 0, False: 203k]
  ------------------
  652|      0|            return;
  653|   203k|        rr[3] = bn_mul_add_words(&(r[3]), a, na, b[3]);
  654|   203k|        if (--nb <= 0)
  ------------------
  |  Branch (654:13): [True: 0, False: 203k]
  ------------------
  655|      0|            return;
  656|   203k|        rr[4] = bn_mul_add_words(&(r[4]), a, na, b[4]);
  657|   203k|        rr += 4;
  658|   203k|        r += 4;
  659|   203k|        b += 4;
  660|   203k|    }
  661|   215k|}

BN_nist_mod_384:
  889|   610k|{
  890|   610k|    int i, top = a->top;
  891|   610k|    int carry = 0;
  892|   610k|    register BN_ULONG *r_d, *a_d = a->d;
  893|   610k|    union {
  894|   610k|        BN_ULONG bn[BN_NIST_384_TOP];
  895|   610k|        unsigned int ui[BN_NIST_384_TOP * sizeof(BN_ULONG) / sizeof(unsigned int)];
  896|   610k|    } buf;
  897|   610k|    BN_ULONG c_d[BN_NIST_384_TOP], *res;
  ------------------
  |  |   37|   610k|#define BN_ULONG unsigned long
  ------------------
  898|   610k|    bn_addsub_f adjust;
  899|   610k|    static const BIGNUM ossl_bignum_nist_p_384_sqr = {
  900|   610k|        (BN_ULONG *)_nist_p_384_sqr,
  901|   610k|        OSSL_NELEM(_nist_p_384_sqr),
  ------------------
  |  |   14|   610k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  902|   610k|        OSSL_NELEM(_nist_p_384_sqr),
  ------------------
  |  |   14|   610k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  903|   610k|        0, BN_FLG_STATIC_DATA
  ------------------
  |  |   59|   610k|#define BN_FLG_STATIC_DATA 0x02
  ------------------
  904|   610k|    };
  905|       |
  906|   610k|    field = &ossl_bignum_nist_p_384; /* just to make sure */
  907|       |
  908|   610k|    if (BN_is_negative(a) || BN_ucmp(a, &ossl_bignum_nist_p_384_sqr) >= 0)
  ------------------
  |  Branch (908:9): [True: 0, False: 610k]
  |  Branch (908:30): [True: 0, False: 610k]
  ------------------
  909|      0|        return BN_nnmod(r, a, field, ctx);
  910|       |
  911|   610k|    i = BN_ucmp(field, a);
  912|   610k|    if (i == 0) {
  ------------------
  |  Branch (912:9): [True: 0, False: 610k]
  ------------------
  913|      0|        BN_zero(r);
  ------------------
  |  |  201|      0|#define BN_zero(a) BN_zero_ex(a)
  ------------------
  914|      0|        return 1;
  915|   610k|    } else if (i > 0)
  ------------------
  |  Branch (915:16): [True: 0, False: 610k]
  ------------------
  916|      0|        return (r == a) ? 1 : (BN_copy(r, a) != NULL);
  ------------------
  |  Branch (916:16): [True: 0, False: 0]
  ------------------
  917|       |
  918|   610k|    if (r != a) {
  ------------------
  |  Branch (918:9): [True: 0, False: 610k]
  ------------------
  919|      0|        if (!bn_wexpand(r, BN_NIST_384_TOP))
  ------------------
  |  |   16|      0|#define BN_NIST_384_TOP (384 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (919:13): [True: 0, False: 0]
  ------------------
  920|      0|            return 0;
  921|      0|        r_d = r->d;
  922|      0|        nist_cp_bn(r_d, a_d, BN_NIST_384_TOP);
  ------------------
  |  |   16|      0|#define BN_NIST_384_TOP (384 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  923|      0|    } else
  924|   610k|        r_d = a_d;
  925|       |
  926|   610k|    nist_cp_bn_0(buf.bn, a_d + BN_NIST_384_TOP, top - BN_NIST_384_TOP,
  ------------------
  |  |  265|   610k|    {                                       \
  |  |  266|   610k|        int ii;                             \
  |  |  267|   610k|        const BN_ULONG *src = src_in;       \
  |  |  268|   610k|                                            \
  |  |  269|  4.27M|        for (ii = 0; ii < top; ii++)        \
  |  |  ------------------
  |  |  |  Branch (269:22): [True: 3.66M, False: 610k]
  |  |  ------------------
  |  |  270|  3.66M|            (dst)[ii] = src[ii];            \
  |  |  271|   610k|        for (; ii < max; ii++)              \
  |  |  ------------------
  |  |  |  Branch (271:16): [True: 0, False: 610k]
  |  |  ------------------
  |  |  272|   610k|            (dst)[ii] = 0;                  \
  |  |  273|   610k|    }
  ------------------
  927|   610k|        BN_NIST_384_TOP);
  928|       |
  929|   610k|#if defined(NIST_INT64)
  930|   610k|    {
  931|   610k|        NIST_INT64 acc; /* accumulator */
  ------------------
  |  |  298|   610k|#define NIST_INT64 long long
  ------------------
  932|   610k|        unsigned int *rp = (unsigned int *)r_d;
  933|   610k|        const unsigned int *bp = (const unsigned int *)buf.ui;
  934|       |
  935|   610k|        acc = load_u32(&rp[0]);
  936|   610k|        acc += bp[12 - 12];
  937|   610k|        acc += bp[21 - 12];
  938|   610k|        acc += bp[20 - 12];
  939|   610k|        acc -= bp[23 - 12];
  940|   610k|        store_lo32(&rp[0], acc);
  941|   610k|        acc >>= 32;
  942|       |
  943|   610k|        acc += load_u32(&rp[1]);
  944|   610k|        acc += bp[13 - 12];
  945|   610k|        acc += bp[22 - 12];
  946|   610k|        acc += bp[23 - 12];
  947|   610k|        acc -= bp[12 - 12];
  948|   610k|        acc -= bp[20 - 12];
  949|   610k|        store_lo32(&rp[1], acc);
  950|   610k|        acc >>= 32;
  951|       |
  952|   610k|        acc += load_u32(&rp[2]);
  953|   610k|        acc += bp[14 - 12];
  954|   610k|        acc += bp[23 - 12];
  955|   610k|        acc -= bp[13 - 12];
  956|   610k|        acc -= bp[21 - 12];
  957|   610k|        store_lo32(&rp[2], acc);
  958|   610k|        acc >>= 32;
  959|       |
  960|   610k|        acc += load_u32(&rp[3]);
  961|   610k|        acc += bp[15 - 12];
  962|   610k|        acc += bp[12 - 12];
  963|   610k|        acc += bp[20 - 12];
  964|   610k|        acc += bp[21 - 12];
  965|   610k|        acc -= bp[14 - 12];
  966|   610k|        acc -= bp[22 - 12];
  967|   610k|        acc -= bp[23 - 12];
  968|   610k|        store_lo32(&rp[3], acc);
  969|   610k|        acc >>= 32;
  970|       |
  971|   610k|        acc += load_u32(&rp[4]);
  972|   610k|        acc += bp[21 - 12];
  973|   610k|        acc += bp[21 - 12];
  974|   610k|        acc += bp[16 - 12];
  975|   610k|        acc += bp[13 - 12];
  976|   610k|        acc += bp[12 - 12];
  977|   610k|        acc += bp[20 - 12];
  978|   610k|        acc += bp[22 - 12];
  979|   610k|        acc -= bp[15 - 12];
  980|   610k|        acc -= bp[23 - 12];
  981|   610k|        acc -= bp[23 - 12];
  982|   610k|        store_lo32(&rp[4], acc);
  983|   610k|        acc >>= 32;
  984|       |
  985|   610k|        acc += load_u32(&rp[5]);
  986|   610k|        acc += bp[22 - 12];
  987|   610k|        acc += bp[22 - 12];
  988|   610k|        acc += bp[17 - 12];
  989|   610k|        acc += bp[14 - 12];
  990|   610k|        acc += bp[13 - 12];
  991|   610k|        acc += bp[21 - 12];
  992|   610k|        acc += bp[23 - 12];
  993|   610k|        acc -= bp[16 - 12];
  994|   610k|        store_lo32(&rp[5], acc);
  995|   610k|        acc >>= 32;
  996|       |
  997|   610k|        acc += load_u32(&rp[6]);
  998|   610k|        acc += bp[23 - 12];
  999|   610k|        acc += bp[23 - 12];
 1000|   610k|        acc += bp[18 - 12];
 1001|   610k|        acc += bp[15 - 12];
 1002|   610k|        acc += bp[14 - 12];
 1003|   610k|        acc += bp[22 - 12];
 1004|   610k|        acc -= bp[17 - 12];
 1005|   610k|        store_lo32(&rp[6], acc);
 1006|   610k|        acc >>= 32;
 1007|       |
 1008|   610k|        acc += load_u32(&rp[7]);
 1009|   610k|        acc += bp[19 - 12];
 1010|   610k|        acc += bp[16 - 12];
 1011|   610k|        acc += bp[15 - 12];
 1012|   610k|        acc += bp[23 - 12];
 1013|   610k|        acc -= bp[18 - 12];
 1014|   610k|        store_lo32(&rp[7], acc);
 1015|   610k|        acc >>= 32;
 1016|       |
 1017|   610k|        acc += load_u32(&rp[8]);
 1018|   610k|        acc += bp[20 - 12];
 1019|   610k|        acc += bp[17 - 12];
 1020|   610k|        acc += bp[16 - 12];
 1021|   610k|        acc -= bp[19 - 12];
 1022|   610k|        store_lo32(&rp[8], acc);
 1023|   610k|        acc >>= 32;
 1024|       |
 1025|   610k|        acc += load_u32(&rp[9]);
 1026|   610k|        acc += bp[21 - 12];
 1027|   610k|        acc += bp[18 - 12];
 1028|   610k|        acc += bp[17 - 12];
 1029|   610k|        acc -= bp[20 - 12];
 1030|   610k|        store_lo32(&rp[9], acc);
 1031|   610k|        acc >>= 32;
 1032|       |
 1033|   610k|        acc += load_u32(&rp[10]);
 1034|   610k|        acc += bp[22 - 12];
 1035|   610k|        acc += bp[19 - 12];
 1036|   610k|        acc += bp[18 - 12];
 1037|   610k|        acc -= bp[21 - 12];
 1038|   610k|        store_lo32(&rp[10], acc);
 1039|   610k|        acc >>= 32;
 1040|       |
 1041|   610k|        acc += load_u32(&rp[11]);
 1042|   610k|        acc += bp[23 - 12];
 1043|   610k|        acc += bp[20 - 12];
 1044|   610k|        acc += bp[19 - 12];
 1045|   610k|        acc -= bp[22 - 12];
 1046|   610k|        store_lo32(&rp[11], acc);
 1047|       |
 1048|   610k|        carry = (int)(acc >> 32);
 1049|   610k|    }
 1050|       |#else
 1051|       |    {
 1052|       |        BN_ULONG t_d[BN_NIST_384_TOP];
 1053|       |
 1054|       |        /*
 1055|       |         * S1
 1056|       |         */
 1057|       |        nist_set_256(t_d, buf.bn, 0, 0, 0, 0, 0, 23 - 4, 22 - 4, 21 - 4);
 1058|       |        /* left shift */
 1059|       |        {
 1060|       |            register BN_ULONG *ap, t, c;
 1061|       |            ap = t_d;
 1062|       |            c = 0;
 1063|       |            for (i = 3; i != 0; --i) {
 1064|       |                t = *ap;
 1065|       |                *(ap++) = ((t << 1) | c) & BN_MASK2;
 1066|       |                c = (t & BN_TBIT) ? 1 : 0;
 1067|       |            }
 1068|       |            *ap = c;
 1069|       |        }
 1070|       |        carry = (int)bn_add_words(r_d + (128 / BN_BITS2), r_d + (128 / BN_BITS2),
 1071|       |            t_d, BN_NIST_256_TOP);
 1072|       |        /*
 1073|       |         * S2
 1074|       |         */
 1075|       |        carry += (int)bn_add_words(r_d, r_d, buf.bn, BN_NIST_384_TOP);
 1076|       |        /*
 1077|       |         * S3
 1078|       |         */
 1079|       |        nist_set_384(t_d, buf.bn, 20, 19, 18, 17, 16, 15, 14, 13, 12, 23, 22,
 1080|       |            21);
 1081|       |        carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1082|       |        /*
 1083|       |         * S4
 1084|       |         */
 1085|       |        nist_set_384(t_d, buf.bn, 19, 18, 17, 16, 15, 14, 13, 12, 20, 0, 23,
 1086|       |            0);
 1087|       |        carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1088|       |        /*
 1089|       |         * S5
 1090|       |         */
 1091|       |        nist_set_384(t_d, buf.bn, 0, 0, 0, 0, 23, 22, 21, 20, 0, 0, 0, 0);
 1092|       |        carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1093|       |        /*
 1094|       |         * S6
 1095|       |         */
 1096|       |        nist_set_384(t_d, buf.bn, 0, 0, 0, 0, 0, 0, 23, 22, 21, 0, 0, 20);
 1097|       |        carry += (int)bn_add_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1098|       |        /*
 1099|       |         * D1
 1100|       |         */
 1101|       |        nist_set_384(t_d, buf.bn, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12,
 1102|       |            23);
 1103|       |        carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1104|       |        /*
 1105|       |         * D2
 1106|       |         */
 1107|       |        nist_set_384(t_d, buf.bn, 0, 0, 0, 0, 0, 0, 0, 23, 22, 21, 20, 0);
 1108|       |        carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1109|       |        /*
 1110|       |         * D3
 1111|       |         */
 1112|       |        nist_set_384(t_d, buf.bn, 0, 0, 0, 0, 0, 0, 0, 23, 23, 0, 0, 0);
 1113|       |        carry -= (int)bn_sub_words(r_d, r_d, t_d, BN_NIST_384_TOP);
 1114|       |    }
 1115|       |#endif
 1116|       |    /* see BN_nist_mod_224 for explanation */
 1117|   610k|    adjust = bn_sub_words;
 1118|   610k|    if (carry > 0)
  ------------------
  |  Branch (1118:9): [True: 395k, False: 214k]
  ------------------
 1119|   395k|        carry = (int)bn_sub_words(r_d, r_d, _nist_p_384[carry - 1],
 1120|   395k|            BN_NIST_384_TOP);
  ------------------
  |  |   16|   395k|#define BN_NIST_384_TOP (384 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|   395k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|   395k|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|   395k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|   395k|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1121|   214k|    else if (carry < 0) {
  ------------------
  |  Branch (1121:14): [True: 5.64k, False: 208k]
  ------------------
 1122|  5.64k|        carry = (int)bn_add_words(r_d, r_d, _nist_p_384[-carry - 1],
 1123|  5.64k|            BN_NIST_384_TOP);
  ------------------
  |  |   16|  5.64k|#define BN_NIST_384_TOP (384 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  5.64k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  5.64k|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|  5.64k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  5.64k|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1124|  5.64k|        adjust = carry ? bn_sub_words : bn_add_words;
  ------------------
  |  Branch (1124:18): [True: 5.64k, False: 0]
  ------------------
 1125|  5.64k|    } else
 1126|   208k|        carry = 1;
 1127|       |
 1128|   610k|    res = ((*adjust)(c_d, r_d, _nist_p_384[0], BN_NIST_384_TOP) && carry)
  ------------------
  |  |   16|   610k|#define BN_NIST_384_TOP (384 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|   610k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|   610k|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|   610k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|   610k|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1128:12): [True: 610k, False: 0]
  |  Branch (1128:68): [True: 610k, False: 0]
  ------------------
 1129|   610k|        ? r_d
 1130|   610k|        : c_d;
 1131|   610k|    nist_cp_bn(r_d, res, BN_NIST_384_TOP);
  ------------------
  |  |   16|   610k|#define BN_NIST_384_TOP (384 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|   610k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|   610k|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|   610k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|   610k|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1132|   610k|    r->top = BN_NIST_384_TOP;
  ------------------
  |  |   16|   610k|#define BN_NIST_384_TOP (384 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|   610k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|   610k|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_384_TOP (384 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|   610k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|   610k|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1133|   610k|    bn_correct_top(r);
 1134|       |
 1135|   610k|    return 1;
 1136|   610k|}
BN_nist_mod_521:
 1144|     39|{
 1145|     39|    int top = a->top, i;
 1146|     39|    BN_ULONG *r_d, *a_d = a->d, t_d[BN_NIST_521_TOP], val, tmp, *res;
  ------------------
  |  |   37|     39|#define BN_ULONG unsigned long
  ------------------
 1147|     39|    static const BIGNUM ossl_bignum_nist_p_521_sqr = {
 1148|     39|        (BN_ULONG *)_nist_p_521_sqr,
 1149|     39|        OSSL_NELEM(_nist_p_521_sqr),
  ------------------
  |  |   14|     39|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 1150|     39|        OSSL_NELEM(_nist_p_521_sqr),
  ------------------
  |  |   14|     39|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 1151|     39|        0, BN_FLG_STATIC_DATA
  ------------------
  |  |   59|     39|#define BN_FLG_STATIC_DATA 0x02
  ------------------
 1152|     39|    };
 1153|       |
 1154|     39|    field = &ossl_bignum_nist_p_521; /* just to make sure */
 1155|       |
 1156|     39|    if (BN_is_negative(a) || BN_ucmp(a, &ossl_bignum_nist_p_521_sqr) >= 0)
  ------------------
  |  Branch (1156:9): [True: 0, False: 39]
  |  Branch (1156:30): [True: 0, False: 39]
  ------------------
 1157|      0|        return BN_nnmod(r, a, field, ctx);
 1158|       |
 1159|     39|    i = BN_ucmp(field, a);
 1160|     39|    if (i == 0) {
  ------------------
  |  Branch (1160:9): [True: 0, False: 39]
  ------------------
 1161|      0|        BN_zero(r);
  ------------------
  |  |  201|      0|#define BN_zero(a) BN_zero_ex(a)
  ------------------
 1162|      0|        return 1;
 1163|     39|    } else if (i > 0)
  ------------------
  |  Branch (1163:16): [True: 0, False: 39]
  ------------------
 1164|      0|        return (r == a) ? 1 : (BN_copy(r, a) != NULL);
  ------------------
  |  Branch (1164:16): [True: 0, False: 0]
  ------------------
 1165|       |
 1166|     39|    if (r != a) {
  ------------------
  |  Branch (1166:9): [True: 0, False: 39]
  ------------------
 1167|      0|        if (!bn_wexpand(r, BN_NIST_521_TOP))
  ------------------
  |  |   17|      0|#define BN_NIST_521_TOP (521 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1167:13): [True: 0, False: 0]
  ------------------
 1168|      0|            return 0;
 1169|      0|        r_d = r->d;
 1170|      0|        nist_cp_bn(r_d, a_d, BN_NIST_521_TOP);
  ------------------
  |  |   17|      0|#define BN_NIST_521_TOP (521 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|      0|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1171|      0|    } else
 1172|     39|        r_d = a_d;
 1173|       |
 1174|       |    /* upper 521 bits, copy ... */
 1175|     39|    nist_cp_bn_0(t_d, a_d + (BN_NIST_521_TOP - 1),
  ------------------
  |  |  265|     39|    {                                       \
  |  |  266|     39|        int ii;                             \
  |  |  267|     39|        const BN_ULONG *src = src_in;       \
  |  |  268|     39|                                            \
  |  |  269|    390|        for (ii = 0; ii < top; ii++)        \
  |  |  ------------------
  |  |  |  Branch (269:22): [True: 351, False: 39]
  |  |  ------------------
  |  |  270|    351|            (dst)[ii] = src[ii];            \
  |  |  271|     39|        for (; ii < max; ii++)              \
  |  |  ------------------
  |  |  |  Branch (271:16): [True: 0, False: 39]
  |  |  ------------------
  |  |  272|     39|            (dst)[ii] = 0;                  \
  |  |  273|     39|    }
  ------------------
 1176|     39|        top - (BN_NIST_521_TOP - 1), BN_NIST_521_TOP);
 1177|       |    /* ... and right shift */
 1178|    351|    for (val = t_d[0], i = 0; i < BN_NIST_521_TOP - 1; i++) {
  ------------------
  |  |   17|    351|#define BN_NIST_521_TOP (521 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|    351|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    351|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|    351|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    351|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1178:31): [True: 312, False: 39]
  ------------------
 1179|       |#if 0
 1180|       |        /*
 1181|       |         * MSC ARM compiler [version 2013, presumably even earlier,
 1182|       |         * much earlier] miscompiles this code, but not one in
 1183|       |         * #else section. See RT#3541.
 1184|       |         */
 1185|       |        tmp = val >> BN_NIST_521_RSHIFT;
 1186|       |        val = t_d[i + 1];
 1187|       |        t_d[i] = (tmp | val << BN_NIST_521_LSHIFT) & BN_MASK2;
 1188|       |#else
 1189|    312|        t_d[i] = (val >> BN_NIST_521_RSHIFT | (tmp = t_d[i + 1]) << BN_NIST_521_LSHIFT) & BN_MASK2;
  ------------------
  |  | 1138|    312|#define BN_NIST_521_RSHIFT (521 % BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|    312|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    312|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      t_d[i] = (val >> BN_NIST_521_RSHIFT | (tmp = t_d[i + 1]) << BN_NIST_521_LSHIFT) & BN_MASK2;
  ------------------
  |  | 1139|    312|#define BN_NIST_521_LSHIFT (BN_BITS2 - BN_NIST_521_RSHIFT)
  |  |  ------------------
  |  |  |  |   54|    312|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    312|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_LSHIFT (BN_BITS2 - BN_NIST_521_RSHIFT)
  |  |  ------------------
  |  |  |  | 1138|    312|#define BN_NIST_521_RSHIFT (521 % BN_BITS2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|    312|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   38|    312|#define BN_BYTES 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      t_d[i] = (val >> BN_NIST_521_RSHIFT | (tmp = t_d[i + 1]) << BN_NIST_521_LSHIFT) & BN_MASK2;
  ------------------
  |  |   93|    312|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
 1190|    312|        val = tmp;
 1191|    312|#endif
 1192|    312|    }
 1193|     39|    t_d[i] = val >> BN_NIST_521_RSHIFT;
  ------------------
  |  | 1138|     39|#define BN_NIST_521_RSHIFT (521 % BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     39|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     39|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1194|       |    /* lower 521 bits */
 1195|     39|    r_d[i] &= BN_NIST_521_TOP_MASK;
  ------------------
  |  | 1140|     39|#define BN_NIST_521_TOP_MASK ((BN_ULONG)BN_MASK2 >> BN_NIST_521_LSHIFT)
  |  |  ------------------
  |  |  |  |   93|     39|#define BN_MASK2 (0xffffffffffffffffL)
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP_MASK ((BN_ULONG)BN_MASK2 >> BN_NIST_521_LSHIFT)
  |  |  ------------------
  |  |  |  | 1139|     39|#define BN_NIST_521_LSHIFT (BN_BITS2 - BN_NIST_521_RSHIFT)
  |  |  |  |  ------------------
  |  |  |  |  |  |   54|     39|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   38|     39|#define BN_BYTES 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define BN_NIST_521_LSHIFT (BN_BITS2 - BN_NIST_521_RSHIFT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1138|     39|#define BN_NIST_521_RSHIFT (521 % BN_BITS2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   54|     39|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   38|     39|#define BN_BYTES 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1196|       |
 1197|     39|    bn_add_words(r_d, r_d, t_d, BN_NIST_521_TOP);
  ------------------
  |  |   17|     39|#define BN_NIST_521_TOP (521 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|     39|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     39|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|     39|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     39|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1198|     39|    res = bn_sub_words(t_d, r_d, _nist_p_521,
  ------------------
  |  Branch (1198:11): [True: 39, False: 0]
  ------------------
 1199|     39|              BN_NIST_521_TOP)
  ------------------
  |  |   17|     39|#define BN_NIST_521_TOP (521 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|     39|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     39|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|     39|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     39|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1200|     39|        ? r_d
 1201|     39|        : t_d;
 1202|     39|    nist_cp_bn(r_d, res, BN_NIST_521_TOP);
  ------------------
  |  |   17|     39|#define BN_NIST_521_TOP (521 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|     39|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     39|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|     39|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     39|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1203|     39|    r->top = BN_NIST_521_TOP;
  ------------------
  |  |   17|     39|#define BN_NIST_521_TOP (521 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|     39|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     39|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define BN_NIST_521_TOP (521 + BN_BITS2 - 1) / BN_BITS2
  |  |  ------------------
  |  |  |  |   54|     39|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     39|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1204|     39|    bn_correct_top(r);
 1205|       |
 1206|     39|    return 1;
 1207|     39|}
bn_nist.c:nist_cp_bn:
  276|   610k|{
  277|   610k|    int i;
  278|       |
  279|  4.27M|    for (i = 0; i < top; i++)
  ------------------
  |  Branch (279:17): [True: 3.66M, False: 610k]
  ------------------
  280|  3.66M|        dst[i] = src[i];
  281|   610k|}
bn_nist.c:load_u32:
  325|  7.32M|{
  326|  7.32M|    uint32_t tmp;
  327|       |
  328|  7.32M|    memcpy(&tmp, ptr, sizeof(tmp));
  329|  7.32M|    return tmp;
  330|  7.32M|}
bn_nist.c:store_lo32:
  333|  7.32M|{
  334|       |    /* A cast is needed for big-endian system: on a 32-bit BE system
  335|       |     * NIST_INT64 may be defined as well if the compiler supports 64-bit
  336|       |     * long long.  */
  337|  7.32M|    uint32_t tmp = (uint32_t)val;
  338|       |
  339|  7.32M|    memcpy(ptr, &tmp, sizeof(tmp));
  340|  7.32M|}

BN_priv_rand_range_ex:
  218|    590|{
  219|    590|    return bnrand_range(PRIVATE, r, range, strength, ctx);
  220|    590|}
bn_rand.c:bnrand:
   27|    827|{
   28|    827|    unsigned char *buf = NULL;
   29|    827|    int b, ret = 0, bit, bytes, mask;
   30|    827|    OSSL_LIB_CTX *libctx = ossl_bn_get_libctx(ctx);
   31|       |
   32|    827|    if (bits == 0) {
  ------------------
  |  Branch (32:9): [True: 0, False: 827]
  ------------------
   33|      0|        if (top != BN_RAND_TOP_ANY || bottom != BN_RAND_BOTTOM_ANY)
  ------------------
  |  |   80|      0|#define BN_RAND_TOP_ANY -1
  ------------------
                      if (top != BN_RAND_TOP_ANY || bottom != BN_RAND_BOTTOM_ANY)
  ------------------
  |  |   85|      0|#define BN_RAND_BOTTOM_ANY 0
  ------------------
  |  Branch (33:13): [True: 0, False: 0]
  |  Branch (33:39): [True: 0, False: 0]
  ------------------
   34|      0|            goto toosmall;
   35|      0|        BN_zero(rnd);
  ------------------
  |  |  201|      0|#define BN_zero(a) BN_zero_ex(a)
  ------------------
   36|      0|        return 1;
   37|      0|    }
   38|    827|    if (bits < 0 || (bits == 1 && top > 0))
  ------------------
  |  Branch (38:9): [True: 0, False: 827]
  |  Branch (38:22): [True: 0, False: 827]
  |  Branch (38:35): [True: 0, False: 0]
  ------------------
   39|      0|        goto toosmall;
   40|       |
   41|    827|    bytes = (bits + 7) / 8;
   42|    827|    bit = (bits - 1) % 8;
   43|    827|    mask = 0xff << (bit + 1);
   44|       |
   45|    827|    buf = OPENSSL_malloc(bytes);
  ------------------
  |  |  106|    827|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   46|    827|    if (buf == NULL)
  ------------------
  |  Branch (46:9): [True: 0, False: 827]
  ------------------
   47|      0|        goto err;
   48|       |
   49|       |    /* make a random number and set the top and bottom bits */
   50|    827|    b = flag == NORMAL ? RAND_bytes_ex(libctx, buf, bytes, strength)
  ------------------
  |  Branch (50:9): [True: 0, False: 827]
  ------------------
   51|    827|                       : RAND_priv_bytes_ex(libctx, buf, bytes, strength);
   52|    827|    if (b <= 0)
  ------------------
  |  Branch (52:9): [True: 0, False: 827]
  ------------------
   53|      0|        goto err;
   54|       |
   55|    827|    if (flag == TESTING) {
  ------------------
  |  Branch (55:9): [True: 0, False: 827]
  ------------------
   56|       |        /*
   57|       |         * generate patterns that are more likely to trigger BN library bugs
   58|       |         */
   59|      0|        int i;
   60|      0|        unsigned char c;
   61|       |
   62|      0|        for (i = 0; i < bytes; i++) {
  ------------------
  |  Branch (62:21): [True: 0, False: 0]
  ------------------
   63|      0|            if (RAND_bytes_ex(libctx, &c, 1, strength) <= 0)
  ------------------
  |  Branch (63:17): [True: 0, False: 0]
  ------------------
   64|      0|                goto err;
   65|      0|            if (c >= 128 && i > 0)
  ------------------
  |  Branch (65:17): [True: 0, False: 0]
  |  Branch (65:29): [True: 0, False: 0]
  ------------------
   66|      0|                buf[i] = buf[i - 1];
   67|      0|            else if (c < 42)
  ------------------
  |  Branch (67:22): [True: 0, False: 0]
  ------------------
   68|      0|                buf[i] = 0;
   69|      0|            else if (c < 84)
  ------------------
  |  Branch (69:22): [True: 0, False: 0]
  ------------------
   70|      0|                buf[i] = 255;
   71|      0|        }
   72|      0|    }
   73|       |
   74|    827|    if (top >= 0) {
  ------------------
  |  Branch (74:9): [True: 0, False: 827]
  ------------------
   75|      0|        if (top) {
  ------------------
  |  Branch (75:13): [True: 0, False: 0]
  ------------------
   76|      0|            if (bit == 0) {
  ------------------
  |  Branch (76:17): [True: 0, False: 0]
  ------------------
   77|      0|                buf[0] = 1;
   78|      0|                buf[1] |= 0x80;
   79|      0|            } else {
   80|      0|                buf[0] |= (3 << (bit - 1));
   81|      0|            }
   82|      0|        } else {
   83|      0|            buf[0] |= (1 << bit);
   84|      0|        }
   85|      0|    }
   86|    827|    buf[0] &= ~mask;
   87|    827|    if (bottom) /* set bottom bit if requested */
  ------------------
  |  Branch (87:9): [True: 0, False: 827]
  ------------------
   88|      0|        buf[bytes - 1] |= 1;
   89|    827|    if (!BN_bin2bn(buf, bytes, rnd))
  ------------------
  |  Branch (89:9): [True: 0, False: 827]
  ------------------
   90|      0|        goto err;
   91|    827|    ret = 1;
   92|    827|err:
   93|    827|    OPENSSL_clear_free(buf, bytes);
  ------------------
  |  |  129|    827|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|    827|    bn_check_top(rnd);
   95|    827|    return ret;
   96|       |
   97|      0|toosmall:
   98|       |    ERR_raise(ERR_LIB_BN, BN_R_BITS_TOO_SMALL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   99|      0|    return 0;
  100|    827|}
bn_rand.c:bnrand_range:
  135|    590|{
  136|    590|    int n;
  137|    590|    int count = 100;
  138|       |
  139|    590|    if (r == NULL) {
  ------------------
  |  Branch (139:9): [True: 0, False: 590]
  ------------------
  140|      0|        ERR_raise(ERR_LIB_BN, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  141|      0|        return 0;
  142|      0|    }
  143|       |
  144|    590|    if (range->neg || BN_is_zero(range)) {
  ------------------
  |  Branch (144:9): [True: 0, False: 590]
  |  Branch (144:23): [True: 0, False: 590]
  ------------------
  145|      0|        ERR_raise(ERR_LIB_BN, BN_R_INVALID_RANGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  146|      0|        return 0;
  147|      0|    }
  148|       |
  149|    590|    n = BN_num_bits(range); /* n > 0 */
  150|       |
  151|       |    /* BN_is_bit_set(range, n - 1) always holds */
  152|       |
  153|    590|    if (n == 1)
  ------------------
  |  Branch (153:9): [True: 0, False: 590]
  ------------------
  154|      0|        BN_zero(r);
  ------------------
  |  |  201|      0|#define BN_zero(a) BN_zero_ex(a)
  ------------------
  155|    590|    else if (!BN_is_bit_set(range, n - 2) && !BN_is_bit_set(range, n - 3)) {
  ------------------
  |  Branch (155:14): [True: 508, False: 82]
  |  Branch (155:46): [True: 130, False: 378]
  ------------------
  156|       |        /*
  157|       |         * range = 100..._2, so 3*range (= 11..._2) is exactly one bit longer
  158|       |         * than range
  159|       |         */
  160|    156|        do {
  161|    156|            if (!bnrand(flag, r, n + 1, BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY,
  ------------------
  |  |   80|    156|#define BN_RAND_TOP_ANY -1
  ------------------
                          if (!bnrand(flag, r, n + 1, BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY,
  ------------------
  |  |   85|    156|#define BN_RAND_BOTTOM_ANY 0
  ------------------
  |  Branch (161:17): [True: 0, False: 156]
  ------------------
  162|    156|                    strength, ctx))
  163|      0|                return 0;
  164|       |
  165|       |            /*
  166|       |             * If r < 3*range, use r := r MOD range (which is either r, r -
  167|       |             * range, or r - 2*range). Otherwise, iterate once more. Since
  168|       |             * 3*range = 11..._2, each iteration succeeds with probability >=
  169|       |             * .75.
  170|       |             */
  171|    156|            if (BN_cmp(r, range) >= 0) {
  ------------------
  |  Branch (171:17): [True: 125, False: 31]
  ------------------
  172|    125|                if (!BN_sub(r, r, range))
  ------------------
  |  Branch (172:21): [True: 0, False: 125]
  ------------------
  173|      0|                    return 0;
  174|    125|                if (BN_cmp(r, range) >= 0)
  ------------------
  |  Branch (174:21): [True: 80, False: 45]
  ------------------
  175|     80|                    if (!BN_sub(r, r, range))
  ------------------
  |  Branch (175:25): [True: 0, False: 80]
  ------------------
  176|      0|                        return 0;
  177|    125|            }
  178|       |
  179|    156|            if (!--count) {
  ------------------
  |  Branch (179:17): [True: 0, False: 156]
  ------------------
  180|      0|                ERR_raise(ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  181|      0|                return 0;
  182|      0|            }
  183|       |
  184|    156|        } while (BN_cmp(r, range) >= 0);
  ------------------
  |  Branch (184:18): [True: 26, False: 130]
  ------------------
  185|    460|    } else {
  186|    671|        do {
  187|       |            /* range = 11..._2  or  range = 101..._2 */
  188|    671|            if (!bnrand(flag, r, n, BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY,
  ------------------
  |  |   80|    671|#define BN_RAND_TOP_ANY -1
  ------------------
                          if (!bnrand(flag, r, n, BN_RAND_TOP_ANY, BN_RAND_BOTTOM_ANY,
  ------------------
  |  |   85|    671|#define BN_RAND_BOTTOM_ANY 0
  ------------------
  |  Branch (188:17): [True: 0, False: 671]
  ------------------
  189|    671|                    strength, ctx))
  190|      0|                return 0;
  191|       |
  192|    671|            if (!--count) {
  ------------------
  |  Branch (192:17): [True: 0, False: 671]
  ------------------
  193|      0|                ERR_raise(ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  194|      0|                return 0;
  195|      0|            }
  196|    671|        } while (BN_cmp(r, range) >= 0);
  ------------------
  |  Branch (196:18): [True: 211, False: 460]
  ------------------
  197|    460|    }
  198|       |
  199|    590|    bn_check_top(r);
  200|    590|    return 1;
  201|    590|}

BN_lshift1:
   15|   138k|{
   16|   138k|    register BN_ULONG *ap, *rp, t, c;
   17|   138k|    int i;
   18|       |
   19|   138k|    bn_check_top(r);
   20|   138k|    bn_check_top(a);
   21|       |
   22|   138k|    if (r != a) {
  ------------------
  |  Branch (22:9): [True: 288, False: 138k]
  ------------------
   23|    288|        r->neg = a->neg;
   24|    288|        if (bn_wexpand(r, a->top + 1) == NULL)
  ------------------
  |  Branch (24:13): [True: 0, False: 288]
  ------------------
   25|      0|            return 0;
   26|    288|        r->top = a->top;
   27|   138k|    } else {
   28|   138k|        if (bn_wexpand(r, a->top + 1) == NULL)
  ------------------
  |  Branch (28:13): [True: 0, False: 138k]
  ------------------
   29|      0|            return 0;
   30|   138k|    }
   31|   138k|    ap = a->d;
   32|   138k|    rp = r->d;
   33|   138k|    c = 0;
   34|  1.15M|    for (i = 0; i < a->top; i++) {
  ------------------
  |  Branch (34:17): [True: 1.01M, False: 138k]
  ------------------
   35|  1.01M|        t = *(ap++);
   36|  1.01M|        *(rp++) = ((t << 1) | c) & BN_MASK2;
  ------------------
  |  |   93|  1.01M|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
   37|  1.01M|        c = t >> (BN_BITS2 - 1);
  ------------------
  |  |   54|  1.01M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.01M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
   38|  1.01M|    }
   39|   138k|    *rp = c;
   40|   138k|    r->top += (int)c;
   41|   138k|    bn_check_top(r);
   42|   138k|    return 1;
   43|   138k|}
BN_rshift1:
   46|  6.42M|{
   47|  6.42M|    BN_ULONG *ap, *rp, t, c;
  ------------------
  |  |   37|  6.42M|#define BN_ULONG unsigned long
  ------------------
   48|  6.42M|    int i;
   49|       |
   50|  6.42M|    bn_check_top(r);
   51|  6.42M|    bn_check_top(a);
   52|       |
   53|  6.42M|    if (BN_is_zero(a)) {
  ------------------
  |  Branch (53:9): [True: 0, False: 6.42M]
  ------------------
   54|      0|        BN_zero(r);
  ------------------
  |  |  201|      0|#define BN_zero(a) BN_zero_ex(a)
  ------------------
   55|      0|        return 1;
   56|      0|    }
   57|  6.42M|    i = a->top;
   58|  6.42M|    ap = a->d;
   59|  6.42M|    if (a != r) {
  ------------------
  |  Branch (59:9): [True: 0, False: 6.42M]
  ------------------
   60|      0|        if (bn_wexpand(r, i) == NULL)
  ------------------
  |  Branch (60:13): [True: 0, False: 0]
  ------------------
   61|      0|            return 0;
   62|      0|        r->neg = a->neg;
   63|      0|    }
   64|  6.42M|    rp = r->d;
   65|  6.42M|    r->top = i;
   66|  6.42M|    t = ap[--i];
   67|  6.42M|    rp[i] = t >> 1;
   68|  6.42M|    c = t << (BN_BITS2 - 1);
  ------------------
  |  |   54|  6.42M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  6.42M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
   69|  6.42M|    r->top -= (t == 1);
   70|  12.5M|    while (i > 0) {
  ------------------
  |  Branch (70:12): [True: 6.11M, False: 6.42M]
  ------------------
   71|  6.11M|        t = ap[--i];
   72|  6.11M|        rp[i] = ((t >> 1) & BN_MASK2) | c;
  ------------------
  |  |   93|  6.11M|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
   73|  6.11M|        c = t << (BN_BITS2 - 1);
  ------------------
  |  |   54|  6.11M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  6.11M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
   74|  6.11M|    }
   75|  6.42M|    if (!r->top)
  ------------------
  |  Branch (75:9): [True: 0, False: 6.42M]
  ------------------
   76|      0|        r->neg = 0; /* don't allow negative zero */
   77|  6.42M|    bn_check_top(r);
   78|  6.42M|    return 1;
   79|  6.42M|}
BN_lshift:
   82|   220k|{
   83|   220k|    int ret;
   84|       |
   85|   220k|    if (n < 0) {
  ------------------
  |  Branch (85:9): [True: 0, False: 220k]
  ------------------
   86|      0|        ERR_raise(ERR_LIB_BN, BN_R_INVALID_SHIFT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   87|      0|        return 0;
   88|      0|    }
   89|       |
   90|   220k|    ret = bn_lshift_fixed_top(r, a, n);
   91|       |
   92|   220k|    bn_correct_top(r);
   93|   220k|    bn_check_top(r);
   94|       |
   95|   220k|    return ret;
   96|   220k|}
bn_lshift_fixed_top:
  105|  1.53M|{
  106|  1.53M|    int i, nw;
  107|  1.53M|    unsigned int lb, rb;
  108|  1.53M|    BN_ULONG *t, *f;
  ------------------
  |  |   37|  1.53M|#define BN_ULONG unsigned long
  ------------------
  109|  1.53M|    BN_ULONG l, m, rmask = 0;
  ------------------
  |  |   37|  1.53M|#define BN_ULONG unsigned long
  ------------------
  110|       |
  111|  1.53M|    assert(n >= 0);
  ------------------
  |  Branch (111:5): [True: 0, False: 1.53M]
  |  Branch (111:5): [True: 1.53M, False: 0]
  ------------------
  112|       |
  113|  1.53M|    bn_check_top(r);
  114|  1.53M|    bn_check_top(a);
  115|       |
  116|  1.53M|    nw = n / BN_BITS2;
  ------------------
  |  |   54|  1.53M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.53M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  117|  1.53M|    if (bn_wexpand(r, a->top + nw + 1) == NULL)
  ------------------
  |  Branch (117:9): [True: 0, False: 1.53M]
  ------------------
  118|      0|        return 0;
  119|       |
  120|  1.53M|    if (a->top != 0) {
  ------------------
  |  Branch (120:9): [True: 1.53M, False: 0]
  ------------------
  121|  1.53M|        lb = (unsigned int)n % BN_BITS2;
  ------------------
  |  |   54|  1.53M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.53M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  122|  1.53M|        rb = BN_BITS2 - lb;
  ------------------
  |  |   54|  1.53M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.53M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  123|  1.53M|        rb %= BN_BITS2; /* say no to undefined behaviour */
  ------------------
  |  |   54|  1.53M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  1.53M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  124|  1.53M|        rmask = (BN_ULONG)0 - rb; /* rmask = 0 - (rb != 0) */
  125|  1.53M|        rmask |= rmask >> 8;
  126|  1.53M|        f = &(a->d[0]);
  127|  1.53M|        t = &(r->d[nw]);
  128|  1.53M|        l = f[a->top - 1];
  129|  1.53M|        t[a->top] = (l >> rb) & rmask;
  130|  7.12M|        for (i = a->top - 1; i > 0; i--) {
  ------------------
  |  Branch (130:30): [True: 5.59M, False: 1.53M]
  ------------------
  131|  5.59M|            m = l << lb;
  132|  5.59M|            l = f[i - 1];
  133|  5.59M|            t[i] = (m | ((l >> rb) & rmask)) & BN_MASK2;
  ------------------
  |  |   93|  5.59M|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  134|  5.59M|        }
  135|  1.53M|        t[0] = (l << lb) & BN_MASK2;
  ------------------
  |  |   93|  1.53M|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  136|  1.53M|    } else {
  137|       |        /* shouldn't happen, but formally required */
  138|      0|        r->d[nw] = 0;
  139|      0|    }
  140|  1.53M|    if (nw != 0)
  ------------------
  |  Branch (140:9): [True: 102k, False: 1.43M]
  ------------------
  141|   102k|        memset(r->d, 0, sizeof(*t) * nw);
  142|       |
  143|  1.53M|    r->neg = a->neg;
  144|  1.53M|    r->top = a->top + nw + 1;
  145|  1.53M|    r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  221|  1.53M|#define BN_FLG_FIXED_TOP 0
  ------------------
  146|       |
  147|  1.53M|    return 1;
  148|  1.53M|}
BN_rshift:
  151|  6.42M|{
  152|  6.42M|    int ret = 0;
  153|       |
  154|  6.42M|    if (n < 0) {
  ------------------
  |  Branch (154:9): [True: 0, False: 6.42M]
  ------------------
  155|      0|        ERR_raise(ERR_LIB_BN, BN_R_INVALID_SHIFT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  156|      0|        return 0;
  157|      0|    }
  158|       |
  159|  6.42M|    bn_check_top(r);
  160|  6.42M|    bn_check_top(a);
  161|       |
  162|  6.42M|    ret = bn_rshift_fixed_top(r, a, n);
  163|       |
  164|  6.42M|    bn_correct_top(r);
  165|  6.42M|    bn_check_top(r);
  166|       |
  167|  6.42M|    return ret;
  168|  6.42M|}
bn_rshift_fixed_top:
  177|  7.64M|{
  178|  7.64M|    int i, top, nw;
  179|  7.64M|    unsigned int lb, rb;
  180|  7.64M|    BN_ULONG *t, *f;
  ------------------
  |  |   37|  7.64M|#define BN_ULONG unsigned long
  ------------------
  181|  7.64M|    BN_ULONG l, m, mask;
  ------------------
  |  |   37|  7.64M|#define BN_ULONG unsigned long
  ------------------
  182|       |
  183|  7.64M|    assert(n >= 0);
  ------------------
  |  Branch (183:5): [True: 0, False: 7.64M]
  |  Branch (183:5): [True: 7.64M, False: 0]
  ------------------
  184|       |
  185|  7.64M|    nw = n / BN_BITS2;
  ------------------
  |  |   54|  7.64M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  7.64M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  186|  7.64M|    if (nw >= a->top) {
  ------------------
  |  Branch (186:9): [True: 0, False: 7.64M]
  ------------------
  187|       |        /* shouldn't happen, but formally required */
  188|      0|        BN_zero(r);
  ------------------
  |  |  201|      0|#define BN_zero(a) BN_zero_ex(a)
  ------------------
  189|      0|        return 1;
  190|      0|    }
  191|       |
  192|  7.64M|    rb = (unsigned int)n % BN_BITS2;
  ------------------
  |  |   54|  7.64M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  7.64M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  193|  7.64M|    lb = BN_BITS2 - rb;
  ------------------
  |  |   54|  7.64M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  7.64M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  194|  7.64M|    lb %= BN_BITS2; /* say no to undefined behaviour */
  ------------------
  |  |   54|  7.64M|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|  7.64M|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  195|  7.64M|    mask = (BN_ULONG)0 - lb; /* mask = 0 - (lb != 0) */
  196|  7.64M|    mask |= mask >> 8;
  197|  7.64M|    top = a->top - nw;
  198|  7.64M|    if (r != a && bn_wexpand(r, top) == NULL)
  ------------------
  |  Branch (198:9): [True: 1.21M, False: 6.42M]
  |  Branch (198:19): [True: 0, False: 1.21M]
  ------------------
  199|      0|        return 0;
  200|       |
  201|  7.64M|    t = &(r->d[0]);
  202|  7.64M|    f = &(a->d[nw]);
  203|  7.64M|    l = f[0];
  204|  12.5M|    for (i = 0; i < top - 1; i++) {
  ------------------
  |  Branch (204:17): [True: 4.86M, False: 7.64M]
  ------------------
  205|  4.86M|        m = f[i + 1];
  206|  4.86M|        t[i] = (l >> rb) | ((m << lb) & mask);
  207|  4.86M|        l = m;
  208|  4.86M|    }
  209|  7.64M|    t[i] = l >> rb;
  210|       |
  211|  7.64M|    r->neg = a->neg;
  212|  7.64M|    r->top = top;
  213|  7.64M|    r->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  221|  7.64M|#define BN_FLG_FIXED_TOP 0
  ------------------
  214|       |
  215|  7.64M|    return 1;
  216|  7.64M|}

BN_sqr:
   18|   406k|{
   19|   406k|    int ret = bn_sqr_fixed_top(r, a, ctx);
   20|       |
   21|   406k|    bn_correct_top(r);
   22|   406k|    bn_check_top(r);
   23|       |
   24|   406k|    return ret;
   25|   406k|}
bn_sqr_fixed_top:
   28|   406k|{
   29|   406k|    int max, al;
   30|   406k|    int ret = 0;
   31|   406k|    BIGNUM *tmp, *rr;
   32|       |
   33|   406k|    bn_check_top(a);
   34|       |
   35|   406k|    al = a->top;
   36|   406k|    if (al <= 0) {
  ------------------
  |  Branch (36:9): [True: 0, False: 406k]
  ------------------
   37|      0|        r->top = 0;
   38|      0|        r->neg = 0;
   39|      0|        return 1;
   40|      0|    }
   41|       |
   42|   406k|    BN_CTX_start(ctx);
   43|   406k|    rr = (a != r) ? r : BN_CTX_get(ctx);
  ------------------
  |  Branch (43:10): [True: 406k, False: 0]
  ------------------
   44|   406k|    tmp = BN_CTX_get(ctx);
   45|   406k|    if (rr == NULL || tmp == NULL)
  ------------------
  |  Branch (45:9): [True: 0, False: 406k]
  |  Branch (45:23): [True: 0, False: 406k]
  ------------------
   46|      0|        goto err;
   47|       |
   48|   406k|    max = 2 * al; /* Non-zero (from above) */
   49|   406k|    if (bn_wexpand(rr, max) == NULL)
  ------------------
  |  Branch (49:9): [True: 0, False: 406k]
  ------------------
   50|      0|        goto err;
   51|       |
   52|   406k|    if (al == 4) {
  ------------------
  |  Branch (52:9): [True: 0, False: 406k]
  ------------------
   53|       |#ifndef BN_SQR_COMBA
   54|       |        BN_ULONG t[8];
   55|       |        bn_sqr_normal(rr->d, a->d, 4, t);
   56|       |#else
   57|      0|        bn_sqr_comba4(rr->d, a->d);
   58|      0|#endif
   59|   406k|    } else if (al == 8) {
  ------------------
  |  Branch (59:16): [True: 0, False: 406k]
  ------------------
   60|       |#ifndef BN_SQR_COMBA
   61|       |        BN_ULONG t[16];
   62|       |        bn_sqr_normal(rr->d, a->d, 8, t);
   63|       |#else
   64|      0|        bn_sqr_comba8(rr->d, a->d);
   65|      0|#endif
   66|   406k|    } else {
   67|   406k|#if defined(BN_RECURSION)
   68|   406k|        if (al < BN_SQR_RECURSIVE_SIZE_NORMAL) {
  ------------------
  |  |  361|   406k|#define BN_SQR_RECURSIVE_SIZE_NORMAL (16) /* 32 */
  ------------------
  |  Branch (68:13): [True: 406k, False: 0]
  ------------------
   69|   406k|            BN_ULONG t[BN_SQR_RECURSIVE_SIZE_NORMAL * 2];
  ------------------
  |  |   37|   406k|#define BN_ULONG unsigned long
  ------------------
   70|   406k|            bn_sqr_normal(rr->d, a->d, al, t);
   71|   406k|        } else {
   72|      0|            int j, k;
   73|       |
   74|      0|            j = BN_num_bits_word((BN_ULONG)al);
   75|      0|            j = 1 << (j - 1);
   76|      0|            k = j + j;
   77|      0|            if (al == j) {
  ------------------
  |  Branch (77:17): [True: 0, False: 0]
  ------------------
   78|      0|                if (bn_wexpand(tmp, k * 2) == NULL)
  ------------------
  |  Branch (78:21): [True: 0, False: 0]
  ------------------
   79|      0|                    goto err;
   80|      0|                bn_sqr_recursive(rr->d, a->d, al, tmp->d);
   81|      0|            } else {
   82|      0|                if (bn_wexpand(tmp, max) == NULL)
  ------------------
  |  Branch (82:21): [True: 0, False: 0]
  ------------------
   83|      0|                    goto err;
   84|      0|                bn_sqr_normal(rr->d, a->d, al, tmp->d);
   85|      0|            }
   86|      0|        }
   87|       |#else
   88|       |        if (bn_wexpand(tmp, max) == NULL)
   89|       |            goto err;
   90|       |        bn_sqr_normal(rr->d, a->d, al, tmp->d);
   91|       |#endif
   92|   406k|    }
   93|       |
   94|   406k|    rr->neg = 0;
   95|   406k|    rr->top = max;
   96|   406k|    rr->flags |= BN_FLG_FIXED_TOP;
  ------------------
  |  |  221|   406k|#define BN_FLG_FIXED_TOP 0
  ------------------
   97|   406k|    if (r != rr && BN_copy(r, rr) == NULL)
  ------------------
  |  Branch (97:9): [True: 0, False: 406k]
  |  Branch (97:20): [True: 0, False: 0]
  ------------------
   98|      0|        goto err;
   99|       |
  100|   406k|    ret = 1;
  101|   406k|err:
  102|   406k|    bn_check_top(rr);
  103|   406k|    bn_check_top(tmp);
  104|   406k|    BN_CTX_end(ctx);
  105|   406k|    return ret;
  106|   406k|}
bn_sqr_normal:
  110|   406k|{
  111|   406k|    int i, j, max;
  112|   406k|    const BN_ULONG *ap;
  113|   406k|    BN_ULONG *rp;
  ------------------
  |  |   37|   406k|#define BN_ULONG unsigned long
  ------------------
  114|       |
  115|   406k|    max = n * 2;
  116|   406k|    ap = a;
  117|   406k|    rp = r;
  118|   406k|    rp[0] = rp[max - 1] = 0;
  119|   406k|    rp++;
  120|   406k|    j = n;
  121|       |
  122|   406k|    if (--j > 0) {
  ------------------
  |  Branch (122:9): [True: 406k, False: 0]
  ------------------
  123|   406k|        ap++;
  124|   406k|        rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
  125|   406k|        rp += 2;
  126|   406k|    }
  127|       |
  128|  2.03M|    for (i = n - 2; i > 0; i--) {
  ------------------
  |  Branch (128:21): [True: 1.62M, False: 406k]
  ------------------
  129|  1.62M|        j--;
  130|  1.62M|        ap++;
  131|  1.62M|        rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]);
  132|  1.62M|        rp += 2;
  133|  1.62M|    }
  134|       |
  135|   406k|    bn_add_words(r, r, r, max);
  136|       |
  137|       |    /* There will not be a carry */
  138|       |
  139|   406k|    bn_sqr_words(tmp, a, n);
  140|       |
  141|   406k|    bn_add_words(r, r, tmp, max);
  142|   406k|}

BN_add_word:
   98|   113k|{
   99|   113k|    BN_ULONG l;
  ------------------
  |  |   37|   113k|#define BN_ULONG unsigned long
  ------------------
  100|   113k|    int i;
  101|       |
  102|   113k|    bn_check_top(a);
  103|   113k|    w &= BN_MASK2;
  ------------------
  |  |   93|   113k|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  104|       |
  105|       |    /* degenerate case: w is zero */
  106|   113k|    if (!w)
  ------------------
  |  Branch (106:9): [True: 0, False: 113k]
  ------------------
  107|      0|        return 1;
  108|       |    /* degenerate case: a is zero */
  109|   113k|    if (BN_is_zero(a))
  ------------------
  |  Branch (109:9): [True: 0, False: 113k]
  ------------------
  110|      0|        return BN_set_word(a, w);
  111|       |    /* handle 'a' when negative */
  112|   113k|    if (a->neg) {
  ------------------
  |  Branch (112:9): [True: 0, False: 113k]
  ------------------
  113|      0|        a->neg = 0;
  114|      0|        i = BN_sub_word(a, w);
  115|      0|        if (!BN_is_zero(a))
  ------------------
  |  Branch (115:13): [True: 0, False: 0]
  ------------------
  116|      0|            a->neg = !(a->neg);
  117|      0|        return i;
  118|      0|    }
  119|   226k|    for (i = 0; w != 0 && i < a->top; i++) {
  ------------------
  |  Branch (119:17): [True: 113k, False: 113k]
  |  Branch (119:27): [True: 113k, False: 0]
  ------------------
  120|   113k|        a->d[i] = l = (a->d[i] + w) & BN_MASK2;
  ------------------
  |  |   93|   113k|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  121|   113k|        w = (w > l) ? 1 : 0;
  ------------------
  |  Branch (121:13): [True: 0, False: 113k]
  ------------------
  122|   113k|    }
  123|   113k|    if (w && i == a->top) {
  ------------------
  |  Branch (123:9): [True: 0, False: 113k]
  |  Branch (123:14): [True: 0, False: 0]
  ------------------
  124|      0|        if (bn_wexpand(a, a->top + 1) == NULL)
  ------------------
  |  Branch (124:13): [True: 0, False: 0]
  ------------------
  125|      0|            return 0;
  126|      0|        a->top++;
  127|      0|        a->d[i] = w;
  128|      0|    }
  129|   113k|    bn_check_top(a);
  130|   113k|    return 1;
  131|   113k|}
BN_sub_word:
  134|   102k|{
  135|   102k|    int i;
  136|       |
  137|   102k|    bn_check_top(a);
  138|   102k|    w &= BN_MASK2;
  ------------------
  |  |   93|   102k|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  139|       |
  140|       |    /* degenerate case: w is zero */
  141|   102k|    if (!w)
  ------------------
  |  Branch (141:9): [True: 0, False: 102k]
  ------------------
  142|      0|        return 1;
  143|       |    /* degenerate case: a is zero */
  144|   102k|    if (BN_is_zero(a)) {
  ------------------
  |  Branch (144:9): [True: 0, False: 102k]
  ------------------
  145|      0|        i = BN_set_word(a, w);
  146|      0|        if (i != 0)
  ------------------
  |  Branch (146:13): [True: 0, False: 0]
  ------------------
  147|      0|            BN_set_negative(a, 1);
  148|      0|        return i;
  149|      0|    }
  150|       |    /* handle 'a' when negative */
  151|   102k|    if (a->neg) {
  ------------------
  |  Branch (151:9): [True: 0, False: 102k]
  ------------------
  152|      0|        a->neg = 0;
  153|      0|        i = BN_add_word(a, w);
  154|      0|        a->neg = 1;
  155|      0|        return i;
  156|      0|    }
  157|       |
  158|   102k|    if ((a->top == 1) && (a->d[0] < w)) {
  ------------------
  |  Branch (158:9): [True: 0, False: 102k]
  |  Branch (158:26): [True: 0, False: 0]
  ------------------
  159|      0|        a->d[0] = w - a->d[0];
  160|      0|        a->neg = 1;
  161|      0|        return 1;
  162|      0|    }
  163|   102k|    i = 0;
  164|   204k|    for (;;) {
  165|   204k|        if (a->d[i] >= w) {
  ------------------
  |  Branch (165:13): [True: 102k, False: 102k]
  ------------------
  166|   102k|            a->d[i] -= w;
  167|   102k|            break;
  168|   102k|        } else {
  169|   102k|            a->d[i] = (a->d[i] - w) & BN_MASK2;
  ------------------
  |  |   93|   102k|#define BN_MASK2 (0xffffffffffffffffL)
  ------------------
  170|   102k|            i++;
  171|   102k|            w = 1;
  172|   102k|        }
  173|   204k|    }
  174|   102k|    if ((a->d[i] == 0) && (i == (a->top - 1)))
  ------------------
  |  Branch (174:9): [True: 76, False: 101k]
  |  Branch (174:27): [True: 76, False: 0]
  ------------------
  175|     76|        a->top--;
  176|   102k|    bn_check_top(a);
  177|   102k|    return 1;
  178|   102k|}

ossl_bsearch:
   16|  10.8M|{
   17|  10.8M|    const char *base_ = base;
   18|  10.8M|    int l, h, i = 0, c = 0;
   19|  10.8M|    const char *p = NULL;
   20|       |
   21|  10.8M|    if (num == 0)
  ------------------
  |  Branch (21:9): [True: 0, False: 10.8M]
  ------------------
   22|      0|        return NULL;
   23|  10.8M|    l = 0;
   24|  10.8M|    h = num;
   25|  87.5M|    while (l < h) {
  ------------------
  |  Branch (25:12): [True: 87.0M, False: 592k]
  ------------------
   26|  87.0M|        i = l + (h - l) / 2;
   27|  87.0M|        p = &(base_[i * size]);
   28|  87.0M|        c = (*cmp)(key, p);
   29|  87.0M|        if (c < 0)
  ------------------
  |  Branch (29:13): [True: 50.3M, False: 36.6M]
  ------------------
   30|  50.3M|            h = i;
   31|  36.6M|        else if (c > 0)
  ------------------
  |  Branch (31:18): [True: 26.3M, False: 10.2M]
  ------------------
   32|  26.3M|            l = i + 1;
   33|  10.2M|        else
   34|  10.2M|            break;
   35|  87.0M|    }
   36|  10.8M|    if (c != 0 && !(flags & OSSL_BSEARCH_VALUE_ON_NOMATCH))
  ------------------
  |  |  149|   592k|#define OSSL_BSEARCH_VALUE_ON_NOMATCH 0x01
  ------------------
  |  Branch (36:9): [True: 592k, False: 10.2M]
  |  Branch (36:19): [True: 592k, False: 0]
  ------------------
   37|   592k|        p = NULL;
   38|  10.2M|    else if (c == 0 && (flags & OSSL_BSEARCH_FIRST_VALUE_ON_MATCH)) {
  ------------------
  |  |  150|  10.2M|#define OSSL_BSEARCH_FIRST_VALUE_ON_MATCH 0x02
  ------------------
  |  Branch (38:14): [True: 10.2M, False: 0]
  |  Branch (38:24): [True: 2.29k, False: 10.2M]
  ------------------
   39|  2.29k|        while (i > 0 && (*cmp)(key, &(base_[(i - 1) * size])) == 0)
  ------------------
  |  Branch (39:16): [True: 1.59k, False: 694]
  |  Branch (39:25): [True: 0, False: 1.59k]
  ------------------
   40|      0|            i--;
   41|  2.29k|        p = &(base_[i * size]);
   42|  2.29k|    }
   43|  10.8M|    return p;
   44|  10.8M|}

ossl_err_load_BUF_strings:
   24|      1|{
   25|      1|#ifndef OPENSSL_NO_ERR
   26|      1|    if (ERR_reason_error_string(BUF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (26:9): [True: 1, False: 0]
  ------------------
   27|      1|        ERR_load_strings_const(BUF_str_reasons);
   28|      1|#endif
   29|      1|    return 1;
   30|      1|}

BUF_MEM_new_ex:
   22|  1.66M|{
   23|  1.66M|    BUF_MEM *ret;
   24|       |
   25|  1.66M|    ret = BUF_MEM_new();
   26|  1.66M|    if (ret != NULL)
  ------------------
  |  Branch (26:9): [True: 1.66M, False: 0]
  ------------------
   27|  1.66M|        ret->flags = flags;
   28|  1.66M|    return ret;
   29|  1.66M|}
BUF_MEM_new:
   32|  4.15M|{
   33|  4.15M|    BUF_MEM *ret;
   34|       |
   35|  4.15M|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|  4.15M|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   36|  4.15M|    if (ret == NULL)
  ------------------
  |  Branch (36:9): [True: 0, False: 4.15M]
  ------------------
   37|      0|        return NULL;
   38|  4.15M|    return ret;
   39|  4.15M|}
BUF_MEM_free:
   42|  3.33M|{
   43|  3.33M|    if (a == NULL)
  ------------------
  |  Branch (43:9): [True: 5.61k, False: 3.33M]
  ------------------
   44|  5.61k|        return;
   45|  3.33M|    if (a->data != NULL) {
  ------------------
  |  Branch (45:9): [True: 1.25M, False: 2.07M]
  ------------------
   46|  1.25M|        if (a->flags & BUF_MEM_FLAG_SECURE)
  ------------------
  |  |   48|  1.25M|#define BUF_MEM_FLAG_SECURE 0x01
  ------------------
  |  Branch (46:13): [True: 0, False: 1.25M]
  ------------------
   47|      0|            OPENSSL_secure_clear_free(a->data, a->max);
  ------------------
  |  |  149|      0|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|  1.25M|        else
   49|  1.25M|            OPENSSL_clear_free(a->data, a->max);
  ------------------
  |  |  129|  1.25M|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   50|  1.25M|    }
   51|  3.33M|    OPENSSL_free(a);
  ------------------
  |  |  131|  3.33M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   52|  3.33M|}
BUF_MEM_grow:
   72|   840k|{
   73|   840k|    char *ret;
   74|   840k|    size_t n;
   75|       |
   76|   840k|    if (str->length >= len) {
  ------------------
  |  Branch (76:9): [True: 0, False: 840k]
  ------------------
   77|      0|        str->length = len;
   78|      0|        return len;
   79|      0|    }
   80|   840k|    if (str->max >= len) {
  ------------------
  |  Branch (80:9): [True: 0, False: 840k]
  ------------------
   81|      0|        if (str->data != NULL)
  ------------------
  |  Branch (81:13): [True: 0, False: 0]
  ------------------
   82|      0|            memset(&str->data[str->length], 0, len - str->length);
   83|      0|        str->length = len;
   84|      0|        return len;
   85|      0|    }
   86|       |    /* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */
   87|   840k|    if (len > LIMIT_BEFORE_EXPANSION) {
  ------------------
  |  |   19|   840k|#define LIMIT_BEFORE_EXPANSION 0x5ffffffc
  ------------------
  |  Branch (87:9): [True: 0, False: 840k]
  ------------------
   88|      0|        ERR_raise(ERR_LIB_BUF, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   89|      0|        return 0;
   90|      0|    }
   91|   840k|    n = (len + 3) / 3 * 4;
   92|   840k|    if ((str->flags & BUF_MEM_FLAG_SECURE))
  ------------------
  |  |   48|   840k|#define BUF_MEM_FLAG_SECURE 0x01
  ------------------
  |  Branch (92:9): [True: 0, False: 840k]
  ------------------
   93|      0|        ret = sec_alloc_realloc(str, n);
   94|   840k|    else
   95|   840k|        ret = OPENSSL_realloc(str->data, n);
  ------------------
  |  |  120|   840k|    CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   96|   840k|    if (ret == NULL) {
  ------------------
  |  Branch (96:9): [True: 0, False: 840k]
  ------------------
   97|      0|        len = 0;
   98|   840k|    } else {
   99|   840k|        str->data = ret;
  100|   840k|        str->max = n;
  101|   840k|        memset(&str->data[str->length], 0, len - str->length);
  102|   840k|        str->length = len;
  103|   840k|    }
  104|   840k|    return len;
  105|   840k|}
BUF_MEM_grow_clean:
  108|  11.0M|{
  109|  11.0M|    char *ret;
  110|  11.0M|    size_t n;
  111|       |
  112|  11.0M|    if (str->length >= len) {
  ------------------
  |  Branch (112:9): [True: 166, False: 11.0M]
  ------------------
  113|    166|        if (str->data != NULL)
  ------------------
  |  Branch (113:13): [True: 166, False: 0]
  ------------------
  114|    166|            memset(&str->data[len], 0, str->length - len);
  115|    166|        str->length = len;
  116|    166|        return len;
  117|    166|    }
  118|  11.0M|    if (str->max >= len) {
  ------------------
  |  Branch (118:9): [True: 6.13M, False: 4.89M]
  ------------------
  119|  6.13M|        memset(&str->data[str->length], 0, len - str->length);
  120|  6.13M|        str->length = len;
  121|  6.13M|        return len;
  122|  6.13M|    }
  123|       |    /* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */
  124|  4.89M|    if (len > LIMIT_BEFORE_EXPANSION) {
  ------------------
  |  |   19|  4.89M|#define LIMIT_BEFORE_EXPANSION 0x5ffffffc
  ------------------
  |  Branch (124:9): [True: 0, False: 4.89M]
  ------------------
  125|      0|        ERR_raise(ERR_LIB_BUF, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  126|      0|        return 0;
  127|      0|    }
  128|  4.89M|    n = (len + 3) / 3 * 4;
  129|  4.89M|    if ((str->flags & BUF_MEM_FLAG_SECURE))
  ------------------
  |  |   48|  4.89M|#define BUF_MEM_FLAG_SECURE 0x01
  ------------------
  |  Branch (129:9): [True: 0, False: 4.89M]
  ------------------
  130|      0|        ret = sec_alloc_realloc(str, n);
  131|  4.89M|    else
  132|  4.89M|        ret = OPENSSL_clear_realloc(str->data, str->max, n);
  ------------------
  |  |  122|  4.89M|    CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  133|  4.89M|    if (ret == NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 4.89M]
  ------------------
  134|      0|        len = 0;
  135|  4.89M|    } else {
  136|  4.89M|        str->data = ret;
  137|  4.89M|        str->max = n;
  138|  4.89M|        memset(&str->data[str->length], 0, len - str->length);
  139|  4.89M|        str->length = len;
  140|  4.89M|    }
  141|  4.89M|    return len;
  142|  4.89M|}

ossl_err_load_CMP_strings:
  199|      1|{
  200|      1|#ifndef OPENSSL_NO_ERR
  201|      1|    if (ERR_reason_error_string(CMP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (201:9): [True: 1, False: 0]
  ------------------
  202|      1|        ERR_load_strings_const(CMP_str_reasons);
  203|      1|#endif
  204|      1|    return 1;
  205|      1|}

OSSL_CMP_log_close:
   41|      1|{
   42|      1|    (void)OSSL_trace_set_channel(OSSL_TRACE_CATEGORY_CMP, NULL);
  ------------------
  |  |   53|      1|#define OSSL_TRACE_CATEGORY_CMP 13
  ------------------
   43|      1|}

ossl_err_load_CMS_strings:
  182|      1|{
  183|      1|#ifndef OPENSSL_NO_ERR
  184|      1|    if (ERR_reason_error_string(CMS_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (184:9): [True: 1, False: 0]
  ------------------
  185|      1|        ERR_load_strings_const(CMS_str_reasons);
  186|      1|#endif
  187|      1|    return 1;
  188|      1|}

ossl_comp_brotli_cleanup:
  353|      1|{
  354|       |#ifdef BROTLI_SHARED
  355|       |    DSO_free(brotli_encode_dso);
  356|       |    brotli_encode_dso = NULL;
  357|       |    DSO_free(brotli_decode_dso);
  358|       |    brotli_decode_dso = NULL;
  359|       |    p_encode_init = NULL;
  360|       |    p_encode_stream = NULL;
  361|       |    p_encode_has_more = NULL;
  362|       |    p_encode_end = NULL;
  363|       |    p_encode_oneshot = NULL;
  364|       |    p_decode_init = NULL;
  365|       |    p_decode_stream = NULL;
  366|       |    p_decode_has_more = NULL;
  367|       |    p_decode_end = NULL;
  368|       |    p_decode_error = NULL;
  369|       |    p_decode_error_string = NULL;
  370|       |    p_decode_is_finished = NULL;
  371|       |    p_decode_oneshot = NULL;
  372|       |#endif
  373|      1|}

COMP_zlib:
  310|    787|{
  311|    787|    COMP_METHOD *meth = NULL;
  312|       |
  313|       |#ifndef OPENSSL_NO_ZLIB
  314|       |    if (RUN_ONCE(&zlib_once, ossl_comp_zlib_init))
  315|       |        meth = &zlib_stateful_method;
  316|       |#endif
  317|       |
  318|    787|    return meth;
  319|    787|}
ossl_comp_zlib_cleanup:
  335|      1|{
  336|       |#ifdef ZLIB_SHARED
  337|       |    DSO_free(zlib_dso);
  338|       |    zlib_dso = NULL;
  339|       |#endif
  340|      1|}

ossl_comp_zstd_cleanup:
  427|      1|{
  428|       |#ifdef ZSTD_SHARED
  429|       |    DSO_free(zstd_dso);
  430|       |    zstd_dso = NULL;
  431|       |    p_createCStream = NULL;
  432|       |    p_initCStream = NULL;
  433|       |    p_freeCStream = NULL;
  434|       |    p_compressStream2 = NULL;
  435|       |    p_flushStream = NULL;
  436|       |    p_endStream = NULL;
  437|       |    p_compress = NULL;
  438|       |    p_createDStream = NULL;
  439|       |    p_initDStream = NULL;
  440|       |    p_freeDStream = NULL;
  441|       |    p_decompressStream = NULL;
  442|       |    p_decompress = NULL;
  443|       |    p_isError = NULL;
  444|       |    p_getErrorName = NULL;
  445|       |    p_DStreamInSize = NULL;
  446|       |    p_CStreamInSize = NULL;
  447|       |#endif
  448|      1|}

ossl_err_load_COMP_strings:
   45|      1|{
   46|      1|#ifndef OPENSSL_NO_ERR
   47|      1|    if (ERR_reason_error_string(COMP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (47:9): [True: 1, False: 0]
  ------------------
   48|      1|        ERR_load_strings_const(COMP_str_reasons);
   49|      1|#endif
   50|      1|    return 1;
   51|      1|}

COMP_get_type:
   41|    787|{
   42|    787|    if (meth == NULL)
  ------------------
  |  Branch (42:9): [True: 787, False: 0]
  ------------------
   43|    787|        return NID_undef;
  ------------------
  |  |   18|    787|#define NID_undef                       0
  ------------------
   44|      0|    return meth->type;
   45|    787|}
COMP_CTX_free:
   55|  10.6k|{
   56|  10.6k|    if (ctx == NULL)
  ------------------
  |  Branch (56:9): [True: 10.6k, False: 0]
  ------------------
   57|  10.6k|        return;
   58|      0|    if (ctx->meth->finish != NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 0]
  ------------------
   59|      0|        ctx->meth->finish(ctx);
   60|       |
   61|      0|    OPENSSL_free(ctx);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   62|      0|}

ossl_load_builtin_compressions:
   29|    787|{
   30|    787|    STACK_OF(SSL_COMP) *comp_methods = NULL;
  ------------------
  |  |   33|    787|#define STACK_OF(type) struct stack_st_##type
  ------------------
   31|    787|#ifndef OPENSSL_NO_COMP
   32|    787|    SSL_COMP *comp = NULL;
   33|    787|    COMP_METHOD *method = COMP_zlib();
   34|       |
   35|    787|    comp_methods = sk_SSL_COMP_new(sk_comp_cmp);
  ------------------
  |  |   72|    787|#define sk_SSL_COMP_new(cmp) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_new(ossl_check_SSL_COMP_compfunc_type(cmp)))
  ------------------
   36|       |
   37|    787|    if (COMP_get_type(method) != NID_undef && comp_methods != NULL) {
  ------------------
  |  |   18|  1.57k|#define NID_undef                       0
  ------------------
  |  Branch (37:9): [True: 0, False: 787]
  |  Branch (37:47): [True: 0, False: 0]
  ------------------
   38|      0|        comp = OPENSSL_malloc(sizeof(*comp));
  ------------------
  |  |  106|      0|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   39|      0|        if (comp != NULL) {
  ------------------
  |  Branch (39:13): [True: 0, False: 0]
  ------------------
   40|      0|            comp->method = method;
   41|      0|            comp->id = SSL_COMP_ZLIB_IDX;
  ------------------
  |  |   18|      0|#define SSL_COMP_ZLIB_IDX 1
  ------------------
   42|      0|            comp->name = COMP_get_name(method);
   43|      0|            if (!sk_SSL_COMP_push(comp_methods, comp))
  ------------------
  |  |   80|      0|#define sk_SSL_COMP_push(sk, ptr) OPENSSL_sk_push(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr))
  ------------------
  |  Branch (43:17): [True: 0, False: 0]
  ------------------
   44|      0|                OPENSSL_free(comp);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   45|      0|        }
   46|      0|    }
   47|    787|#endif
   48|    787|    return comp_methods;
   49|    787|}
ossl_free_compression_methods_int:
   57|    787|{
   58|    787|    sk_SSL_COMP_pop_free(methods, cmeth_free);
  ------------------
  |  |   84|    787|#define sk_SSL_COMP_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_freefunc_type(freefunc))
  ------------------
   59|    787|}

_CONF_free_data:
  137|    787|{
  138|    787|    if (conf == NULL)
  ------------------
  |  Branch (138:9): [True: 0, False: 787]
  ------------------
  139|      0|        return;
  140|       |
  141|    787|    OPENSSL_free(conf->includedir);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  142|    787|    if (conf->data == NULL)
  ------------------
  |  Branch (142:9): [True: 787, False: 0]
  ------------------
  143|    787|        return;
  144|       |
  145|       |    /* evil thing to make sure the 'OPENSSL_free()' works as expected */
  146|      0|    lh_CONF_VALUE_set_down_load(conf->data, 0);
  ------------------
  |  |   86|      0|#define lh_CONF_VALUE_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_CONF_VALUE_lh_type(lh), dl)
  ------------------
  147|      0|    lh_CONF_VALUE_doall_LH_CONF_VALUE(conf->data, value_free_hash, conf->data);
  148|       |
  149|       |    /*
  150|       |     * We now have only 'section' entries in the hash table. Due to problems
  151|       |     * with
  152|       |     */
  153|       |
  154|      0|    lh_CONF_VALUE_doall(conf->data, value_free_stack_doall);
  ------------------
  |  |   87|      0|#define lh_CONF_VALUE_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_doallfunc_type(dfn))
  ------------------
  155|      0|    lh_CONF_VALUE_free(conf->data);
  ------------------
  |  |   75|      0|#define lh_CONF_VALUE_free(lh) OPENSSL_LH_free(ossl_check_CONF_VALUE_lh_type(lh))
  ------------------
  156|      0|}

NCONF_default:
   87|    787|{
   88|    787|    return &default_method;
   89|    787|}
conf_def.c:def_create:
  112|    787|{
  113|    787|    CONF *ret;
  114|       |
  115|    787|    ret = OPENSSL_malloc(sizeof(*ret));
  ------------------
  |  |  106|    787|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  116|    787|    if (ret != NULL)
  ------------------
  |  Branch (116:9): [True: 787, False: 0]
  ------------------
  117|    787|        if (meth->init(ret) == 0) {
  ------------------
  |  Branch (117:13): [True: 0, False: 787]
  ------------------
  118|      0|            OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  119|       |            ret = NULL;
  120|      0|        }
  121|    787|    return ret;
  122|    787|}
conf_def.c:def_init_default:
  125|    787|{
  126|    787|    if (conf == NULL)
  ------------------
  |  Branch (126:9): [True: 0, False: 787]
  ------------------
  127|      0|        return 0;
  128|       |
  129|    787|    memset(conf, 0, sizeof(*conf));
  130|    787|    conf->meth = &default_method;
  131|    787|    conf->meth_data = (void *)CONF_type_default;
  132|       |
  133|    787|    return 1;
  134|    787|}
conf_def.c:def_destroy:
  151|    787|{
  152|    787|    if (def_destroy_data(conf)) {
  ------------------
  |  Branch (152:9): [True: 787, False: 0]
  ------------------
  153|    787|        OPENSSL_free(conf);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  154|    787|        return 1;
  155|    787|    }
  156|      0|    return 0;
  157|    787|}
conf_def.c:def_destroy_data:
  160|    787|{
  161|    787|    if (conf == NULL)
  ------------------
  |  Branch (161:9): [True: 0, False: 787]
  ------------------
  162|      0|        return 0;
  163|    787|    _CONF_free_data(conf);
  164|    787|    return 1;
  165|    787|}
conf_def.c:def_load:
  168|    787|{
  169|    787|    int ret;
  170|    787|    BIO *in = NULL;
  171|       |
  172|       |#ifdef OPENSSL_SYS_VMS
  173|       |    in = BIO_new_file(name, "r");
  174|       |#else
  175|    787|    in = BIO_new_file(name, "rb");
  176|    787|#endif
  177|    787|    if (in == NULL) {
  ------------------
  |  Branch (177:9): [True: 787, False: 0]
  ------------------
  178|    787|        if (ERR_GET_REASON(ERR_peek_last_error()) == BIO_R_NO_SUCH_FILE)
  ------------------
  |  |   46|    787|#define BIO_R_NO_SUCH_FILE 128
  ------------------
  |  Branch (178:13): [True: 787, False: 0]
  ------------------
  179|    787|            ERR_raise(ERR_LIB_CONF, CONF_R_NO_SUCH_FILE);
  ------------------
  |  |  404|    787|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|    787|    (ERR_new(),                                                  \
  |  |  |  |  407|    787|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|    787|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|    787|        ERR_set_error)
  |  |  ------------------
  ------------------
  180|      0|        else
  181|    787|            ERR_raise(ERR_LIB_CONF, ERR_R_SYS_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  182|    787|        return 0;
  183|    787|    }
  184|       |
  185|      0|    ret = def_load_bio(conf, in, line);
  186|      0|    BIO_free(in);
  187|       |
  188|      0|    return ret;
  189|    787|}

ossl_err_load_CONF_strings:
   68|      1|{
   69|      1|#ifndef OPENSSL_NO_ERR
   70|      1|    if (ERR_reason_error_string(CONF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (70:9): [True: 1, False: 0]
  ------------------
   71|      1|        ERR_load_strings_const(CONF_str_reasons);
   72|      1|#endif
   73|      1|    return 1;
   74|      1|}

NCONF_new_ex:
  183|    787|{
  184|    787|    CONF *ret;
  185|       |
  186|    787|    if (meth == NULL)
  ------------------
  |  Branch (186:9): [True: 787, False: 0]
  ------------------
  187|    787|        meth = NCONF_default();
  188|       |
  189|    787|    ret = meth->create(meth);
  190|    787|    if (ret == NULL) {
  ------------------
  |  Branch (190:9): [True: 0, False: 787]
  ------------------
  191|      0|        ERR_raise(ERR_LIB_CONF, ERR_R_CONF_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  192|      0|        return NULL;
  193|      0|    }
  194|    787|    ret->libctx = libctx;
  195|       |
  196|    787|    return ret;
  197|    787|}
NCONF_free:
  205|    787|{
  206|    787|    if (conf == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 787]
  ------------------
  207|      0|        return;
  208|    787|    conf->meth->destroy(conf);
  209|    787|}
NCONF_load:
  252|    787|{
  253|    787|    if (conf == NULL) {
  ------------------
  |  Branch (253:9): [True: 0, False: 787]
  ------------------
  254|      0|        ERR_raise(ERR_LIB_CONF, CONF_R_NO_CONF);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  255|      0|        return 0;
  256|      0|    }
  257|       |
  258|    787|    return conf->meth->load(conf, file, eline);
  259|    787|}

CONF_modules_load_file_ex:
  192|    787|{
  193|    787|    char *file = NULL;
  194|    787|    CONF *conf = NULL;
  195|    787|    int ret = 0, diagnostics = OSSL_LIB_CTX_get_conf_diagnostics(libctx);
  196|       |
  197|    787|    ERR_set_mark();
  198|       |
  199|    787|    if (filename == NULL) {
  ------------------
  |  Branch (199:9): [True: 787, False: 0]
  ------------------
  200|    787|        file = CONF_get1_default_config_file();
  201|    787|        if (file == NULL)
  ------------------
  |  Branch (201:13): [True: 0, False: 787]
  ------------------
  202|      0|            goto err;
  203|    787|        if (*file == '\0') {
  ------------------
  |  Branch (203:13): [True: 0, False: 787]
  ------------------
  204|       |            /* Do not try to load an empty file name but do not error out */
  205|      0|            ret = 1;
  206|      0|            goto err;
  207|      0|        }
  208|    787|    } else {
  209|      0|        file = (char *)filename;
  210|      0|    }
  211|       |
  212|    787|    conf = NCONF_new_ex(libctx, NULL);
  213|    787|    if (conf == NULL)
  ------------------
  |  Branch (213:9): [True: 0, False: 787]
  ------------------
  214|      0|        goto err;
  215|       |
  216|    787|    if (NCONF_load(conf, file, NULL) <= 0) {
  ------------------
  |  Branch (216:9): [True: 787, False: 0]
  ------------------
  217|    787|        if ((flags & CONF_MFLAGS_IGNORE_MISSING_FILE) && (ERR_GET_REASON(ERR_peek_last_error()) == CONF_R_NO_SUCH_FILE)) {
  ------------------
  |  |  114|    787|#define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
  ------------------
                      if ((flags & CONF_MFLAGS_IGNORE_MISSING_FILE) && (ERR_GET_REASON(ERR_peek_last_error()) == CONF_R_NO_SUCH_FILE)) {
  ------------------
  |  |   34|      1|#define CONF_R_NO_SUCH_FILE 114
  ------------------
  |  Branch (217:13): [True: 1, False: 786]
  |  Branch (217:58): [True: 1, False: 0]
  ------------------
  218|      1|            ret = 1;
  219|      1|        }
  220|    787|        goto err;
  221|    787|    }
  222|       |
  223|      0|    ret = CONF_modules_load(conf, appname, flags);
  224|       |    /* CONF_modules_load() might change the diagnostics setting, reread it. */
  225|      0|    diagnostics = OSSL_LIB_CTX_get_conf_diagnostics(libctx);
  226|       |
  227|    787|err:
  228|    787|    if (filename == NULL)
  ------------------
  |  Branch (228:9): [True: 787, False: 0]
  ------------------
  229|    787|        OPENSSL_free(file);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  230|    787|    NCONF_free(conf);
  231|       |
  232|    787|    if ((flags & CONF_MFLAGS_IGNORE_RETURN_CODES) != 0 && !diagnostics)
  ------------------
  |  |  111|    787|#define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
  ------------------
  |  Branch (232:9): [True: 1, False: 786]
  |  Branch (232:59): [True: 1, False: 0]
  ------------------
  233|      1|        ret = 1;
  234|       |
  235|    787|    if (ret > 0)
  ------------------
  |  Branch (235:9): [True: 1, False: 786]
  ------------------
  236|      1|        ERR_pop_to_mark();
  237|    786|    else
  238|    786|        ERR_clear_last_mark();
  239|       |
  240|    787|    return ret;
  241|      0|}
CONF_modules_unload:
  517|      1|{
  518|      1|    int i;
  519|      1|    CONF_MODULE *md;
  520|      1|    STACK_OF(CONF_MODULE) *old_modules;
  ------------------
  |  |   33|      1|#define STACK_OF(type) struct stack_st_##type
  ------------------
  521|      1|    STACK_OF(CONF_MODULE) *new_modules;
  ------------------
  |  |   33|      1|#define STACK_OF(type) struct stack_st_##type
  ------------------
  522|      1|    STACK_OF(CONF_MODULE) *to_delete;
  ------------------
  |  |   33|      1|#define STACK_OF(type) struct stack_st_##type
  ------------------
  523|       |
  524|      1|    if (!conf_modules_finish_int()) /* also inits module list lock */
  ------------------
  |  Branch (524:9): [True: 0, False: 1]
  ------------------
  525|      0|        return;
  526|       |
  527|      1|    ossl_rcu_write_lock(module_list_lock);
  528|       |
  529|      1|    old_modules = ossl_rcu_deref(&supported_modules);
  ------------------
  |  |   30|      1|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  530|      1|    new_modules = sk_CONF_MODULE_dup(old_modules);
  531|       |
  532|      1|    if (new_modules == NULL) {
  ------------------
  |  Branch (532:9): [True: 0, False: 1]
  ------------------
  533|      0|        ossl_rcu_write_unlock(module_list_lock);
  534|      0|        return;
  535|      0|    }
  536|       |
  537|      1|    to_delete = sk_CONF_MODULE_new_null();
  538|       |
  539|       |    /* unload modules in reverse order */
  540|      1|    for (i = sk_CONF_MODULE_num(new_modules) - 1; i >= 0; i--) {
  ------------------
  |  Branch (540:51): [True: 0, False: 1]
  ------------------
  541|      0|        md = sk_CONF_MODULE_value(new_modules, i);
  542|       |        /* If static or in use and 'all' not set ignore it */
  543|      0|        if (((md->links > 0) || !md->dso) && !all)
  ------------------
  |  Branch (543:14): [True: 0, False: 0]
  |  Branch (543:33): [True: 0, False: 0]
  |  Branch (543:46): [True: 0, False: 0]
  ------------------
  544|      0|            continue;
  545|       |        /* Since we're working in reverse this is OK */
  546|      0|        (void)sk_CONF_MODULE_delete(new_modules, i);
  547|      0|        sk_CONF_MODULE_push(to_delete, md);
  548|      0|    }
  549|       |
  550|      1|    if (sk_CONF_MODULE_num(new_modules) == 0) {
  ------------------
  |  Branch (550:9): [True: 1, False: 0]
  ------------------
  551|      1|        sk_CONF_MODULE_free(new_modules);
  552|      1|        new_modules = NULL;
  553|      1|    }
  554|       |
  555|      1|    ossl_rcu_assign_ptr(&supported_modules, &new_modules);
  ------------------
  |  |   31|      1|#define ossl_rcu_assign_ptr(p, v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  556|      1|    ossl_rcu_write_unlock(module_list_lock);
  557|      1|    ossl_synchronize_rcu(module_list_lock);
  558|      1|    sk_CONF_MODULE_free(old_modules);
  559|      1|    sk_CONF_MODULE_pop_free(to_delete, module_free);
  560|      1|}
ossl_config_modules_free:
  631|      1|{
  632|      1|    CONF_modules_unload(1); /* calls CONF_modules_finish */
  633|      1|    module_lists_free();
  634|      1|}
CONF_get1_default_config_file:
  685|    787|{
  686|    787|    const char *t;
  687|    787|    char *file, *sep = "";
  688|    787|    size_t size;
  689|       |
  690|    787|    if ((file = ossl_safe_getenv("OPENSSL_CONF")) != NULL)
  ------------------
  |  Branch (690:9): [True: 0, False: 787]
  ------------------
  691|      0|        return OPENSSL_strdup(file);
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  692|       |
  693|    787|    t = X509_get_default_cert_area();
  694|       |    /*
  695|       |     * On windows systems with -DOSSL_WINCTX set, if the needed registry
  696|       |     * keys are not yet set, openssl applets will return, due to an inability
  697|       |     * to locate various directories, like the default cert area.  In that
  698|       |     * event, clone an empty string here, so that commands like openssl version
  699|       |     * continue to operate properly without needing to set OPENSSL_CONF.
  700|       |     * Applets like cms will fail gracefully later when they try to parse an
  701|       |     * empty config file
  702|       |     */
  703|    787|    if (t == NULL)
  ------------------
  |  Branch (703:9): [True: 0, False: 787]
  ------------------
  704|      0|        return OPENSSL_strdup("");
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  705|       |
  706|    787|#ifndef OPENSSL_SYS_VMS
  707|    787|    sep = "/";
  708|    787|#endif
  709|    787|    size = strlen(t) + strlen(sep) + strlen(OPENSSL_CONF) + 1;
  ------------------
  |  |   80|    787|#define OPENSSL_CONF "openssl.cnf"
  ------------------
  710|    787|    file = OPENSSL_malloc(size);
  ------------------
  |  |  106|    787|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  711|       |
  712|    787|    if (file == NULL)
  ------------------
  |  Branch (712:9): [True: 0, False: 787]
  ------------------
  713|      0|        return NULL;
  714|    787|    BIO_snprintf(file, size, "%s%s%s", t, sep, OPENSSL_CONF);
  ------------------
  |  |   80|    787|#define OPENSSL_CONF "openssl.cnf"
  ------------------
  715|       |
  716|    787|    return file;
  717|    787|}
CONF_parse_list:
  729|  16.3k|{
  730|  16.3k|    int ret;
  731|  16.3k|    const char *lstart, *tmpend, *p;
  732|       |
  733|  16.3k|    if (list_ == NULL) {
  ------------------
  |  Branch (733:9): [True: 0, False: 16.3k]
  ------------------
  734|      0|        ERR_raise(ERR_LIB_CONF, CONF_R_LIST_CANNOT_BE_NULL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  735|      0|        return 0;
  736|      0|    }
  737|       |
  738|  16.3k|    lstart = list_;
  739|  43.7k|    for (;;) {
  740|  43.7k|        if (nospc) {
  ------------------
  |  Branch (740:13): [True: 43.7k, False: 0]
  ------------------
  741|  52.4k|            while (*lstart && isspace((unsigned char)*lstart))
  ------------------
  |  Branch (741:20): [True: 52.4k, False: 16]
  |  Branch (741:31): [True: 8.71k, False: 43.7k]
  ------------------
  742|  8.71k|                lstart++;
  743|  43.7k|        }
  744|  43.7k|        p = strchr(lstart, sep);
  745|  43.7k|        if (p == lstart || *lstart == '\0')
  ------------------
  |  Branch (745:13): [True: 854, False: 42.9k]
  |  Branch (745:28): [True: 16, False: 42.8k]
  ------------------
  746|    870|            ret = list_cb(NULL, 0, arg);
  747|  42.8k|        else {
  748|  42.8k|            if (p)
  ------------------
  |  Branch (748:17): [True: 26.6k, False: 16.2k]
  ------------------
  749|  26.6k|                tmpend = p - 1;
  750|  16.2k|            else
  751|  16.2k|                tmpend = lstart + strlen(lstart) - 1;
  752|  42.8k|            if (nospc) {
  ------------------
  |  Branch (752:17): [True: 42.8k, False: 0]
  ------------------
  753|  42.8k|                while (isspace((unsigned char)*tmpend))
  ------------------
  |  Branch (753:24): [True: 7.76k, False: 42.8k]
  ------------------
  754|  7.76k|                    tmpend--;
  755|  42.8k|            }
  756|  42.8k|            ret = list_cb(lstart, (int)(tmpend - lstart + 1), arg);
  757|  42.8k|        }
  758|  43.7k|        if (ret <= 0)
  ------------------
  |  Branch (758:13): [True: 125, False: 43.6k]
  ------------------
  759|    125|            return ret;
  760|  43.6k|        if (p == NULL)
  ------------------
  |  Branch (760:13): [True: 16.1k, False: 27.4k]
  ------------------
  761|  16.1k|            return 1;
  762|  27.4k|        lstart = p + 1;
  763|  27.4k|    }
  764|  16.3k|}
conf_mod.c:do_init_module_list_lock:
  101|      1|{
  102|      1|    module_list_lock = ossl_rcu_lock_new(1, NULL);
  103|      1|    if (module_list_lock == NULL) {
  ------------------
  |  Branch (103:9): [True: 0, False: 1]
  ------------------
  104|      0|        ERR_raise(ERR_LIB_CONF, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  105|      0|        return 0;
  106|      0|    }
  107|       |
  108|      1|    return 1;
  109|      1|}
conf_mod.c:conf_modules_finish_int:
  573|      1|{
  574|      1|    CONF_IMODULE *imod;
  575|      1|    STACK_OF(CONF_IMODULE) *old_modules;
  ------------------
  |  |   33|      1|#define STACK_OF(type) struct stack_st_##type
  ------------------
  576|      1|    STACK_OF(CONF_IMODULE) *new_modules = NULL;
  ------------------
  |  |   33|      1|#define STACK_OF(type) struct stack_st_##type
  ------------------
  577|       |
  578|      1|    if (!RUN_ONCE(&init_module_list_lock, do_init_module_list_lock))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (578:9): [True: 0, False: 1]
  ------------------
  579|      0|        return 0;
  580|       |
  581|       |    /* If module_list_lock is NULL here it means we were already unloaded */
  582|      1|    if (module_list_lock == NULL)
  ------------------
  |  Branch (582:9): [True: 0, False: 1]
  ------------------
  583|      0|        return 0;
  584|       |
  585|      1|    ossl_rcu_write_lock(module_list_lock);
  586|      1|    old_modules = ossl_rcu_deref(&initialized_modules);
  ------------------
  |  |   30|      1|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  587|      1|    ossl_rcu_assign_ptr(&initialized_modules, &new_modules);
  ------------------
  |  |   31|      1|#define ossl_rcu_assign_ptr(p, v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  588|      1|    ossl_rcu_write_unlock(module_list_lock);
  589|      1|    ossl_synchronize_rcu(module_list_lock);
  590|       |
  591|      1|    while (sk_CONF_IMODULE_num(old_modules) > 0) {
  ------------------
  |  Branch (591:12): [True: 0, False: 1]
  ------------------
  592|      0|        imod = sk_CONF_IMODULE_pop(old_modules);
  593|      0|        module_finish(imod);
  594|      0|    }
  595|      1|    sk_CONF_IMODULE_free(old_modules);
  596|       |
  597|      1|    return 1;
  598|      1|}
conf_mod.c:module_lists_free:
   89|      1|{
   90|      1|    ossl_rcu_lock_free(module_list_lock);
   91|      1|    module_list_lock = NULL;
   92|       |
   93|      1|    sk_CONF_MODULE_free(supported_modules);
   94|      1|    supported_modules = NULL;
   95|       |
   96|      1|    sk_CONF_IMODULE_free(initialized_modules);
   97|       |    initialized_modules = NULL;
   98|      1|}

ossl_config_int:
   47|      1|{
   48|      1|    int ret = 0;
   49|      1|#if defined(OPENSSL_INIT_DEBUG) || !defined(OPENSSL_SYS_UEFI)
   50|      1|    const char *filename;
   51|      1|    const char *appname;
   52|      1|    unsigned long flags;
   53|      1|#endif
   54|       |
   55|      1|    if (openssl_configured)
  ------------------
  |  Branch (55:9): [True: 0, False: 1]
  ------------------
   56|      0|        return 1;
   57|       |
   58|      1|#if defined(OPENSSL_INIT_DEBUG) || !defined(OPENSSL_SYS_UEFI)
   59|      1|    filename = settings ? settings->filename : NULL;
  ------------------
  |  Branch (59:16): [True: 0, False: 1]
  ------------------
   60|      1|    appname = settings ? settings->appname : NULL;
  ------------------
  |  Branch (60:15): [True: 0, False: 1]
  ------------------
   61|      1|    flags = settings ? settings->flags : DEFAULT_CONF_MFLAGS;
  ------------------
  |  |   17|      2|    (CONF_MFLAGS_DEFAULT_SECTION | CONF_MFLAGS_IGNORE_MISSING_FILE | CONF_MFLAGS_IGNORE_RETURN_CODES)
  |  |  ------------------
  |  |  |  |  115|      1|#define CONF_MFLAGS_DEFAULT_SECTION 0x20
  |  |  ------------------
  |  |                   (CONF_MFLAGS_DEFAULT_SECTION | CONF_MFLAGS_IGNORE_MISSING_FILE | CONF_MFLAGS_IGNORE_RETURN_CODES)
  |  |  ------------------
  |  |  |  |  114|      1|#define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
  |  |  ------------------
  |  |                   (CONF_MFLAGS_DEFAULT_SECTION | CONF_MFLAGS_IGNORE_MISSING_FILE | CONF_MFLAGS_IGNORE_RETURN_CODES)
  |  |  ------------------
  |  |  |  |  111|      1|#define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
  |  |  ------------------
  ------------------
  |  Branch (61:13): [True: 0, False: 1]
  ------------------
   62|      1|#endif
   63|       |
   64|       |#ifdef OPENSSL_INIT_DEBUG
   65|       |    fprintf(stderr, "OPENSSL_INIT: ossl_config_int(%s, %s, %lu)\n",
   66|       |        filename, appname, flags);
   67|       |#endif
   68|       |
   69|      1|#ifndef OPENSSL_SYS_UEFI
   70|      1|    ret = CONF_modules_load_file_ex(OSSL_LIB_CTX_get0_global_default(),
   71|      1|        filename, appname, flags);
   72|       |#else
   73|       |    ret = 1;
   74|       |#endif
   75|      1|    openssl_configured = 1;
   76|      1|    return ret;
   77|      1|}

conf_ssl_name_find:
  148|  2.47k|{
  149|  2.47k|    size_t i;
  150|  2.47k|    const struct ssl_conf_name_st *nm;
  151|       |
  152|  2.47k|    if (name == NULL)
  ------------------
  |  Branch (152:9): [True: 0, False: 2.47k]
  ------------------
  153|      0|        return 0;
  154|  2.47k|    for (i = 0, nm = ssl_names; i < ssl_names_count; i++, nm++) {
  ------------------
  |  Branch (154:33): [True: 0, False: 2.47k]
  ------------------
  155|      0|        if (strcmp(nm->name, name) == 0) {
  ------------------
  |  Branch (155:13): [True: 0, False: 0]
  ------------------
  156|      0|            *idx = i;
  157|      0|            return 1;
  158|      0|        }
  159|      0|    }
  160|  2.47k|    return 0;
  161|  2.47k|}

ossl_lib_ctx_write_lock:
   59|  1.17k|{
   60|  1.17k|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (60:9): [True: 0, False: 1.17k]
  ------------------
   61|      0|        return 0;
   62|  1.17k|    return CRYPTO_THREAD_write_lock(ctx->lock);
   63|  1.17k|}
ossl_lib_ctx_read_lock:
   66|   169k|{
   67|   169k|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (67:9): [True: 0, False: 169k]
  ------------------
   68|      0|        return 0;
   69|   169k|    return CRYPTO_THREAD_read_lock(ctx->lock);
   70|   169k|}
ossl_lib_ctx_unlock:
   73|   170k|{
   74|   170k|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (74:9): [True: 0, False: 170k]
  ------------------
   75|      0|        return 0;
   76|   170k|    return CRYPTO_THREAD_unlock(ctx->lock);
   77|   170k|}
ossl_lib_ctx_default_deinit:
  400|      1|{
  401|      1|    if (!default_context_inited)
  ------------------
  |  Branch (401:9): [True: 0, False: 1]
  ------------------
  402|      0|        return;
  403|      1|    context_deinit(&default_context_int);
  404|      1|    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
  405|      1|    default_context_inited = 0;
  406|      1|}
OSSL_LIB_CTX_new:
  435|    786|{
  436|    786|    OSSL_LIB_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  108|    786|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  437|       |
  438|    786|    if (ctx != NULL && !context_init(ctx)) {
  ------------------
  |  Branch (438:9): [True: 786, False: 0]
  |  Branch (438:24): [True: 0, False: 786]
  ------------------
  439|      0|        OPENSSL_free(ctx);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  440|       |        ctx = NULL;
  441|      0|    }
  442|    786|    return ctx;
  443|    786|}
OSSL_LIB_CTX_load_config:
  480|    786|{
  481|       |    return CONF_modules_load_file_ex(ctx, config_file, NULL, 0) > 0;
  482|    786|}
OSSL_LIB_CTX_free:
  486|  36.7k|{
  487|  36.7k|    if (ctx == NULL || ossl_lib_ctx_is_default(ctx))
  ------------------
  |  Branch (487:9): [True: 35.9k, False: 786]
  |  Branch (487:24): [True: 0, False: 786]
  ------------------
  488|  35.9k|        return;
  489|       |
  490|    786|#ifndef FIPS_MODULE
  491|    786|    if (ctx->ischild)
  ------------------
  |  Branch (491:9): [True: 0, False: 786]
  ------------------
  492|      0|        ossl_provider_deinit_child(ctx);
  493|    786|#endif
  494|    786|    context_deinit(ctx);
  495|    786|    OPENSSL_free(ctx);
  ------------------
  |  |  131|    786|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  496|    786|}
OSSL_LIB_CTX_get0_global_default:
  500|      1|{
  501|      1|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (501:9): [True: 0, False: 1]
  ------------------
  502|      0|        return NULL;
  503|       |
  504|      1|    return &default_context_int;
  505|      1|}
OSSL_LIB_CTX_set0_default:
  508|  2.47k|{
  509|  2.47k|    OSSL_LIB_CTX *current_defctx;
  510|       |
  511|  2.47k|    if ((current_defctx = get_default_context()) != NULL) {
  ------------------
  |  Branch (511:9): [True: 2.47k, False: 0]
  ------------------
  512|  2.47k|        if (libctx != NULL)
  ------------------
  |  Branch (512:13): [True: 0, False: 2.47k]
  ------------------
  513|      0|            set_default_context(libctx);
  514|  2.47k|        return current_defctx;
  515|  2.47k|    }
  516|       |
  517|      0|    return NULL;
  518|  2.47k|}
ossl_release_default_drbg_ctx:
  521|      1|{
  522|       |    /* early release of the DRBG in global default libctx */
  523|      1|    if (default_context_int.drbg != NULL) {
  ------------------
  |  Branch (523:9): [True: 1, False: 0]
  ------------------
  524|      1|        ossl_rand_ctx_free(default_context_int.drbg);
  525|       |        default_context_int.drbg = NULL;
  526|      1|    }
  527|      1|}
ossl_lib_ctx_get_concrete:
  531|  16.8M|{
  532|  16.8M|#ifndef FIPS_MODULE
  533|  16.8M|    if (ctx == NULL)
  ------------------
  |  Branch (533:9): [True: 11.3M, False: 5.43M]
  ------------------
  534|  11.3M|        return get_default_context();
  535|  5.43M|#endif
  536|  5.43M|    return ctx;
  537|  16.8M|}
ossl_lib_ctx_is_default:
  540|   148k|{
  541|   148k|#ifndef FIPS_MODULE
  542|   148k|    if (ctx == NULL || ctx == get_default_context())
  ------------------
  |  Branch (542:9): [True: 34.8k, False: 113k]
  |  Branch (542:24): [True: 9.70k, False: 103k]
  ------------------
  543|  44.5k|        return 1;
  544|   103k|#endif
  545|   103k|    return 0;
  546|   148k|}
ossl_lib_ctx_is_global_default:
  549|  48.3k|{
  550|  48.3k|#ifndef FIPS_MODULE
  551|  48.3k|    if (ossl_lib_ctx_get_concrete(ctx) == &default_context_int)
  ------------------
  |  Branch (551:9): [True: 30.8k, False: 17.4k]
  ------------------
  552|  30.8k|        return 1;
  553|  17.4k|#endif
  554|  17.4k|    return 0;
  555|  48.3k|}
ossl_lib_ctx_get_data:
  558|  7.17M|{
  559|  7.17M|    ctx = ossl_lib_ctx_get_concrete(ctx);
  560|  7.17M|    if (ctx == NULL)
  ------------------
  |  Branch (560:9): [True: 0, False: 7.17M]
  ------------------
  561|      0|        return NULL;
  562|       |
  563|  7.17M|    switch (index) {
  564|   282k|    case OSSL_LIB_CTX_PROPERTY_STRING_INDEX:
  ------------------
  |  |   99|   282k|#define OSSL_LIB_CTX_PROPERTY_STRING_INDEX 3
  ------------------
  |  Branch (564:5): [True: 282k, False: 6.89M]
  ------------------
  565|   282k|        return ctx->property_string_data;
  566|  1.17M|    case OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX:
  ------------------
  |  |   96|  1.17M|#define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX 0
  ------------------
  |  Branch (566:5): [True: 1.17M, False: 6.00M]
  ------------------
  567|  1.17M|        return ctx->evp_method_store;
  568|  90.2k|    case OSSL_LIB_CTX_PROVIDER_STORE_INDEX:
  ------------------
  |  |   97|  90.2k|#define OSSL_LIB_CTX_PROVIDER_STORE_INDEX 1
  ------------------
  |  Branch (568:5): [True: 90.2k, False: 7.08M]
  ------------------
  569|  90.2k|        return ctx->provider_store;
  570|  4.96M|    case OSSL_LIB_CTX_NAMEMAP_INDEX:
  ------------------
  |  |  100|  4.96M|#define OSSL_LIB_CTX_NAMEMAP_INDEX 4
  ------------------
  |  Branch (570:5): [True: 4.96M, False: 2.21M]
  ------------------
  571|  4.96M|        return ctx->namemap;
  572|   170k|    case OSSL_LIB_CTX_PROPERTY_DEFN_INDEX:
  ------------------
  |  |   98|   170k|#define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX 2
  ------------------
  |  Branch (572:5): [True: 170k, False: 7.00M]
  ------------------
  573|   170k|        return ctx->property_defns;
  574|  34.9k|    case OSSL_LIB_CTX_GLOBAL_PROPERTIES:
  ------------------
  |  |  112|  34.9k|#define OSSL_LIB_CTX_GLOBAL_PROPERTIES 14
  ------------------
  |  Branch (574:5): [True: 34.9k, False: 7.14M]
  ------------------
  575|  34.9k|        return ctx->global_properties;
  576|  49.6k|    case OSSL_LIB_CTX_DRBG_INDEX:
  ------------------
  |  |  101|  49.6k|#define OSSL_LIB_CTX_DRBG_INDEX 5
  ------------------
  |  Branch (576:5): [True: 49.6k, False: 7.12M]
  ------------------
  577|  49.6k|        return ctx->drbg;
  578|      0|    case OSSL_LIB_CTX_DRBG_NONCE_INDEX:
  ------------------
  |  |  102|      0|#define OSSL_LIB_CTX_DRBG_NONCE_INDEX 6
  ------------------
  |  Branch (578:5): [True: 0, False: 7.17M]
  ------------------
  579|      0|        return ctx->drbg_nonce;
  580|      0|#ifndef FIPS_MODULE
  581|      0|    case OSSL_LIB_CTX_PROVIDER_CONF_INDEX:
  ------------------
  |  |  114|      0|#define OSSL_LIB_CTX_PROVIDER_CONF_INDEX 16
  ------------------
  |  Branch (581:5): [True: 0, False: 7.17M]
  ------------------
  582|      0|        return ctx->provider_conf;
  583|      0|    case OSSL_LIB_CTX_BIO_CORE_INDEX:
  ------------------
  |  |  115|      0|#define OSSL_LIB_CTX_BIO_CORE_INDEX 17
  ------------------
  |  Branch (583:5): [True: 0, False: 7.17M]
  ------------------
  584|      0|        return ctx->bio_core;
  585|      0|    case OSSL_LIB_CTX_CHILD_PROVIDER_INDEX:
  ------------------
  |  |  116|      0|#define OSSL_LIB_CTX_CHILD_PROVIDER_INDEX 18
  ------------------
  |  Branch (585:5): [True: 0, False: 7.17M]
  ------------------
  586|      0|        return ctx->child_provider;
  587|  1.39k|    case OSSL_LIB_CTX_DECODER_STORE_INDEX:
  ------------------
  |  |  109|  1.39k|#define OSSL_LIB_CTX_DECODER_STORE_INDEX 11
  ------------------
  |  Branch (587:5): [True: 1.39k, False: 7.17M]
  ------------------
  588|  1.39k|        return ctx->decoder_store;
  589|   414k|    case OSSL_LIB_CTX_DECODER_CACHE_INDEX:
  ------------------
  |  |  118|   414k|#define OSSL_LIB_CTX_DECODER_CACHE_INDEX 20
  ------------------
  |  Branch (589:5): [True: 414k, False: 6.76M]
  ------------------
  590|   414k|        return ctx->decoder_cache;
  591|  1.29k|    case OSSL_LIB_CTX_ENCODER_STORE_INDEX:
  ------------------
  |  |  108|  1.29k|#define OSSL_LIB_CTX_ENCODER_STORE_INDEX 10
  ------------------
  |  Branch (591:5): [True: 1.29k, False: 7.17M]
  ------------------
  592|  1.29k|        return ctx->encoder_store;
  593|  1.29k|    case OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX:
  ------------------
  |  |  113|  1.29k|#define OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX 15
  ------------------
  |  Branch (593:5): [True: 1.29k, False: 7.17M]
  ------------------
  594|  1.29k|        return ctx->store_loader_store;
  595|      0|    case OSSL_LIB_CTX_SELF_TEST_CB_INDEX:
  ------------------
  |  |  110|      0|#define OSSL_LIB_CTX_SELF_TEST_CB_INDEX 12
  ------------------
  |  Branch (595:5): [True: 0, False: 7.17M]
  ------------------
  596|      0|        return ctx->self_test_cb;
  597|      0|    case OSSL_LIB_CTX_INDICATOR_CB_INDEX:
  ------------------
  |  |  120|      0|#define OSSL_LIB_CTX_INDICATOR_CB_INDEX 22
  ------------------
  |  Branch (597:5): [True: 0, False: 7.17M]
  ------------------
  598|      0|        return ctx->indicator_cb;
  599|      0|#endif
  600|      0|#ifndef OPENSSL_NO_THREAD_POOL
  601|      0|    case OSSL_LIB_CTX_THREAD_INDEX:
  ------------------
  |  |  117|      0|#define OSSL_LIB_CTX_THREAD_INDEX 19
  ------------------
  |  Branch (601:5): [True: 0, False: 7.17M]
  ------------------
  602|      0|        return ctx->threads;
  603|      0|#endif
  604|       |
  605|       |#ifdef FIPS_MODULE
  606|       |    case OSSL_LIB_CTX_FIPS_PROV_INDEX:
  607|       |        return ctx->fips_prov;
  608|       |#endif
  609|       |
  610|  2.48k|    case OSSL_LIB_CTX_COMP_METHODS:
  ------------------
  |  |  119|  2.48k|#define OSSL_LIB_CTX_COMP_METHODS 21
  ------------------
  |  Branch (610:5): [True: 2.48k, False: 7.17M]
  ------------------
  611|  2.48k|        return (void *)&ctx->comp_methods;
  612|       |
  613|      0|    default:
  ------------------
  |  Branch (613:5): [True: 0, False: 7.17M]
  ------------------
  614|       |        return NULL;
  615|  7.17M|    }
  616|  7.17M|}
OSSL_LIB_CTX_get_data:
  619|  2.48k|{
  620|  2.48k|    return ossl_lib_ctx_get_data(ctx, index);
  621|  2.48k|}
ossl_lib_ctx_get_ex_data_global:
  624|  9.16M|{
  625|  9.16M|    ctx = ossl_lib_ctx_get_concrete(ctx);
  626|  9.16M|    if (ctx == NULL)
  ------------------
  |  Branch (626:9): [True: 0, False: 9.16M]
  ------------------
  627|      0|        return NULL;
  628|  9.16M|    return &ctx->global;
  629|  9.16M|}
ossl_lib_ctx_get_descriptor:
  632|  48.3k|{
  633|       |#ifdef FIPS_MODULE
  634|       |    return "FIPS internal library context";
  635|       |#else
  636|  48.3k|    if (ossl_lib_ctx_is_global_default(libctx))
  ------------------
  |  Branch (636:9): [True: 30.8k, False: 17.4k]
  ------------------
  637|  30.8k|        return "Global default library context";
  638|  17.4k|    if (ossl_lib_ctx_is_default(libctx))
  ------------------
  |  Branch (638:9): [True: 0, False: 17.4k]
  ------------------
  639|      0|        return "Thread-local default library context";
  640|  17.4k|    return "Non-default library context";
  641|  17.4k|#endif
  642|  17.4k|}
OSSL_LIB_CTX_get_conf_diagnostics:
  645|    787|{
  646|    787|    libctx = ossl_lib_ctx_get_concrete(libctx);
  647|    787|    if (libctx == NULL)
  ------------------
  |  Branch (647:9): [True: 0, False: 787]
  ------------------
  648|      0|        return 0;
  649|    787|    return libctx->conf_diagnostics;
  650|    787|}
context.c:context_deinit:
  359|    787|{
  360|    787|    if (ctx == NULL)
  ------------------
  |  Branch (360:9): [True: 0, False: 787]
  ------------------
  361|      0|        return 1;
  362|       |
  363|    787|    ossl_ctx_thread_stop(ctx);
  364|       |
  365|    787|    context_deinit_objs(ctx);
  366|       |
  367|    787|    ossl_crypto_cleanup_all_ex_data_int(ctx);
  368|       |
  369|    787|    CRYPTO_THREAD_lock_free(ctx->lock);
  370|       |    ctx->lock = NULL;
  371|    787|    return 1;
  372|    787|}
context.c:context_deinit_objs:
  229|    787|{
  230|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  231|    787|    if (ctx->evp_method_store != NULL) {
  ------------------
  |  Branch (231:9): [True: 787, False: 0]
  ------------------
  232|    787|        ossl_method_store_free(ctx->evp_method_store);
  233|    787|        ctx->evp_method_store = NULL;
  234|    787|    }
  235|       |
  236|       |    /* P2. */
  237|    787|    if (ctx->drbg != NULL) {
  ------------------
  |  Branch (237:9): [True: 786, False: 1]
  ------------------
  238|    786|        ossl_rand_ctx_free(ctx->drbg);
  239|    786|        ctx->drbg = NULL;
  240|    786|    }
  241|       |
  242|    787|#ifndef FIPS_MODULE
  243|       |    /* P2. */
  244|    787|    if (ctx->provider_conf != NULL) {
  ------------------
  |  Branch (244:9): [True: 787, False: 0]
  ------------------
  245|    787|        ossl_prov_conf_ctx_free(ctx->provider_conf);
  246|    787|        ctx->provider_conf = NULL;
  247|    787|    }
  248|       |
  249|       |    /*
  250|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  251|       |     * provider store
  252|       |     */
  253|    787|    if (ctx->decoder_store != NULL) {
  ------------------
  |  Branch (253:9): [True: 787, False: 0]
  ------------------
  254|    787|        ossl_method_store_free(ctx->decoder_store);
  255|    787|        ctx->decoder_store = NULL;
  256|    787|    }
  257|    787|    if (ctx->decoder_cache != NULL) {
  ------------------
  |  Branch (257:9): [True: 787, False: 0]
  ------------------
  258|    787|        ossl_decoder_cache_free(ctx->decoder_cache);
  259|    787|        ctx->decoder_cache = NULL;
  260|    787|    }
  261|       |
  262|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  263|    787|    if (ctx->encoder_store != NULL) {
  ------------------
  |  Branch (263:9): [True: 787, False: 0]
  ------------------
  264|    787|        ossl_method_store_free(ctx->encoder_store);
  265|    787|        ctx->encoder_store = NULL;
  266|    787|    }
  267|       |
  268|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  269|    787|    if (ctx->store_loader_store != NULL) {
  ------------------
  |  Branch (269:9): [True: 787, False: 0]
  ------------------
  270|    787|        ossl_method_store_free(ctx->store_loader_store);
  271|    787|        ctx->store_loader_store = NULL;
  272|    787|    }
  273|    787|#endif
  274|       |
  275|       |    /* P1. Needs to be freed before the child provider data is freed */
  276|    787|    if (ctx->provider_store != NULL) {
  ------------------
  |  Branch (276:9): [True: 787, False: 0]
  ------------------
  277|    787|        ossl_provider_store_free(ctx->provider_store);
  278|    787|        ctx->provider_store = NULL;
  279|    787|    }
  280|       |
  281|       |    /* Default priority. */
  282|    787|    if (ctx->property_string_data != NULL) {
  ------------------
  |  Branch (282:9): [True: 787, False: 0]
  ------------------
  283|    787|        ossl_property_string_data_free(ctx->property_string_data);
  284|    787|        ctx->property_string_data = NULL;
  285|    787|    }
  286|       |
  287|    787|    if (ctx->namemap != NULL) {
  ------------------
  |  Branch (287:9): [True: 787, False: 0]
  ------------------
  288|    787|        ossl_stored_namemap_free(ctx->namemap);
  289|    787|        ctx->namemap = NULL;
  290|    787|    }
  291|       |
  292|    787|    if (ctx->property_defns != NULL) {
  ------------------
  |  Branch (292:9): [True: 787, False: 0]
  ------------------
  293|    787|        ossl_property_defns_free(ctx->property_defns);
  294|    787|        ctx->property_defns = NULL;
  295|    787|    }
  296|       |
  297|    787|    if (ctx->global_properties != NULL) {
  ------------------
  |  Branch (297:9): [True: 787, False: 0]
  ------------------
  298|    787|        ossl_ctx_global_properties_free(ctx->global_properties);
  299|    787|        ctx->global_properties = NULL;
  300|    787|    }
  301|       |
  302|    787|#ifndef FIPS_MODULE
  303|    787|    if (ctx->bio_core != NULL) {
  ------------------
  |  Branch (303:9): [True: 787, False: 0]
  ------------------
  304|    787|        ossl_bio_core_globals_free(ctx->bio_core);
  305|    787|        ctx->bio_core = NULL;
  306|    787|    }
  307|    787|#endif
  308|       |
  309|    787|    if (ctx->drbg_nonce != NULL) {
  ------------------
  |  Branch (309:9): [True: 787, False: 0]
  ------------------
  310|    787|        ossl_prov_drbg_nonce_ctx_free(ctx->drbg_nonce);
  311|    787|        ctx->drbg_nonce = NULL;
  312|    787|    }
  313|       |
  314|    787|#ifndef FIPS_MODULE
  315|    787|    if (ctx->indicator_cb != NULL) {
  ------------------
  |  Branch (315:9): [True: 787, False: 0]
  ------------------
  316|    787|        ossl_indicator_set_callback_free(ctx->indicator_cb);
  317|    787|        ctx->indicator_cb = NULL;
  318|    787|    }
  319|       |
  320|    787|    if (ctx->self_test_cb != NULL) {
  ------------------
  |  Branch (320:9): [True: 787, False: 0]
  ------------------
  321|    787|        ossl_self_test_set_callback_free(ctx->self_test_cb);
  322|    787|        ctx->self_test_cb = NULL;
  323|    787|    }
  324|    787|#endif
  325|       |
  326|       |#ifdef FIPS_MODULE
  327|       |    ossl_thread_event_ctx_free(ctx);
  328|       |
  329|       |    if (ctx->fips_prov != NULL) {
  330|       |        ossl_fips_prov_ossl_ctx_free(ctx->fips_prov);
  331|       |        ctx->fips_prov = NULL;
  332|       |    }
  333|       |#endif
  334|       |
  335|    787|#ifndef OPENSSL_NO_THREAD_POOL
  336|    787|    if (ctx->threads != NULL) {
  ------------------
  |  Branch (336:9): [True: 787, False: 0]
  ------------------
  337|    787|        ossl_threads_ctx_free(ctx->threads);
  338|    787|        ctx->threads = NULL;
  339|    787|    }
  340|    787|#endif
  341|       |
  342|       |    /* Low priority. */
  343|    787|#ifndef FIPS_MODULE
  344|    787|    if (ctx->child_provider != NULL) {
  ------------------
  |  Branch (344:9): [True: 787, False: 0]
  ------------------
  345|    787|        ossl_child_prov_ctx_free(ctx->child_provider);
  346|    787|        ctx->child_provider = NULL;
  347|    787|    }
  348|    787|#endif
  349|       |
  350|    787|#ifndef FIPS_MODULE
  351|    787|    if (ctx->comp_methods != NULL) {
  ------------------
  |  Branch (351:9): [True: 787, False: 0]
  ------------------
  352|    787|        ossl_free_compression_methods_int(ctx->comp_methods);
  353|       |        ctx->comp_methods = NULL;
  354|    787|    }
  355|    787|#endif
  356|    787|}
context.c:context_init:
   91|    787|{
   92|    787|    int exdata_done = 0;
   93|       |
   94|    787|    ctx->lock = CRYPTO_THREAD_lock_new();
   95|    787|    if (ctx->lock == NULL)
  ------------------
  |  Branch (95:9): [True: 0, False: 787]
  ------------------
   96|      0|        goto err;
   97|       |
   98|       |    /* Initialize ex_data. */
   99|    787|    if (!ossl_do_ex_data_init(ctx))
  ------------------
  |  Branch (99:9): [True: 0, False: 787]
  ------------------
  100|      0|        goto err;
  101|    787|    exdata_done = 1;
  102|       |
  103|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  104|    787|    ctx->evp_method_store = ossl_method_store_new(ctx);
  105|    787|    if (ctx->evp_method_store == NULL)
  ------------------
  |  Branch (105:9): [True: 0, False: 787]
  ------------------
  106|      0|        goto err;
  107|    787|    OSSL_TRACE1(QUERY, "context_init: allocating store %p\n", ctx->evp_method_store);
  ------------------
  |  |  293|    787|    OSSL_TRACEV(category, (trc_out, format, arg1))
  |  |  ------------------
  |  |  |  |  285|    787|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  108|       |
  109|    787|#ifndef FIPS_MODULE
  110|       |    /* P2. Must be freed before the provider store is freed */
  111|    787|    ctx->provider_conf = ossl_prov_conf_ctx_new(ctx);
  112|    787|    if (ctx->provider_conf == NULL)
  ------------------
  |  Branch (112:9): [True: 0, False: 787]
  ------------------
  113|      0|        goto err;
  114|    787|#endif
  115|       |
  116|       |    /* P2. */
  117|    787|    ctx->drbg = ossl_rand_ctx_new(ctx);
  118|    787|    if (ctx->drbg == NULL)
  ------------------
  |  Branch (118:9): [True: 0, False: 787]
  ------------------
  119|      0|        goto err;
  120|       |
  121|    787|#ifndef FIPS_MODULE
  122|       |    /*
  123|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  124|       |     * provider store
  125|       |     */
  126|    787|    ctx->decoder_store = ossl_method_store_new(ctx);
  127|    787|    if (ctx->decoder_store == NULL)
  ------------------
  |  Branch (127:9): [True: 0, False: 787]
  ------------------
  128|      0|        goto err;
  129|    787|    ctx->decoder_cache = ossl_decoder_cache_new(ctx);
  130|    787|    if (ctx->decoder_cache == NULL)
  ------------------
  |  Branch (130:9): [True: 0, False: 787]
  ------------------
  131|      0|        goto err;
  132|       |
  133|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  134|    787|    ctx->encoder_store = ossl_method_store_new(ctx);
  135|    787|    if (ctx->encoder_store == NULL)
  ------------------
  |  Branch (135:9): [True: 0, False: 787]
  ------------------
  136|      0|        goto err;
  137|       |
  138|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  139|    787|    ctx->store_loader_store = ossl_method_store_new(ctx);
  140|    787|    if (ctx->store_loader_store == NULL)
  ------------------
  |  Branch (140:9): [True: 0, False: 787]
  ------------------
  141|      0|        goto err;
  142|    787|#endif
  143|       |
  144|       |    /* P1. Needs to be freed before the child provider data is freed */
  145|    787|    ctx->provider_store = ossl_provider_store_new(ctx);
  146|    787|    if (ctx->provider_store == NULL)
  ------------------
  |  Branch (146:9): [True: 0, False: 787]
  ------------------
  147|      0|        goto err;
  148|       |
  149|       |    /* Default priority. */
  150|    787|    ctx->property_string_data = ossl_property_string_data_new(ctx);
  151|    787|    if (ctx->property_string_data == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 787]
  ------------------
  152|      0|        goto err;
  153|       |
  154|    787|    ctx->namemap = ossl_stored_namemap_new(ctx);
  155|    787|    if (ctx->namemap == NULL)
  ------------------
  |  Branch (155:9): [True: 0, False: 787]
  ------------------
  156|      0|        goto err;
  157|       |
  158|    787|    ctx->property_defns = ossl_property_defns_new(ctx);
  159|    787|    if (ctx->property_defns == NULL)
  ------------------
  |  Branch (159:9): [True: 0, False: 787]
  ------------------
  160|      0|        goto err;
  161|       |
  162|    787|    ctx->global_properties = ossl_ctx_global_properties_new(ctx);
  163|    787|    if (ctx->global_properties == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 787]
  ------------------
  164|      0|        goto err;
  165|       |
  166|    787|#ifndef FIPS_MODULE
  167|    787|    ctx->bio_core = ossl_bio_core_globals_new(ctx);
  168|    787|    if (ctx->bio_core == NULL)
  ------------------
  |  Branch (168:9): [True: 0, False: 787]
  ------------------
  169|      0|        goto err;
  170|    787|#endif
  171|       |
  172|    787|    ctx->drbg_nonce = ossl_prov_drbg_nonce_ctx_new(ctx);
  173|    787|    if (ctx->drbg_nonce == NULL)
  ------------------
  |  Branch (173:9): [True: 0, False: 787]
  ------------------
  174|      0|        goto err;
  175|       |
  176|    787|#ifndef FIPS_MODULE
  177|    787|    ctx->self_test_cb = ossl_self_test_set_callback_new(ctx);
  178|    787|    if (ctx->self_test_cb == NULL)
  ------------------
  |  Branch (178:9): [True: 0, False: 787]
  ------------------
  179|      0|        goto err;
  180|    787|    ctx->indicator_cb = ossl_indicator_set_callback_new(ctx);
  181|    787|    if (ctx->indicator_cb == NULL)
  ------------------
  |  Branch (181:9): [True: 0, False: 787]
  ------------------
  182|      0|        goto err;
  183|    787|#endif
  184|       |
  185|       |#ifdef FIPS_MODULE
  186|       |    if (!ossl_thread_event_ctx_new(ctx))
  187|       |        goto err;
  188|       |
  189|       |    ctx->fips_prov = ossl_fips_prov_ossl_ctx_new(ctx);
  190|       |    if (ctx->fips_prov == NULL)
  191|       |        goto err;
  192|       |#endif
  193|       |
  194|    787|#ifndef OPENSSL_NO_THREAD_POOL
  195|    787|    ctx->threads = ossl_threads_ctx_new(ctx);
  196|    787|    if (ctx->threads == NULL)
  ------------------
  |  Branch (196:9): [True: 0, False: 787]
  ------------------
  197|      0|        goto err;
  198|    787|#endif
  199|       |
  200|       |    /* Low priority. */
  201|    787|#ifndef FIPS_MODULE
  202|    787|    ctx->child_provider = ossl_child_prov_ctx_new(ctx);
  203|    787|    if (ctx->child_provider == NULL)
  ------------------
  |  Branch (203:9): [True: 0, False: 787]
  ------------------
  204|      0|        goto err;
  205|    787|#endif
  206|       |
  207|       |    /* Everything depends on properties, so we also pre-initialise that */
  208|    787|    if (!ossl_property_parse_init(ctx))
  ------------------
  |  Branch (208:9): [True: 0, False: 787]
  ------------------
  209|      0|        goto err;
  210|       |
  211|    787|#ifndef FIPS_MODULE
  212|    787|    ctx->comp_methods = ossl_load_builtin_compressions();
  213|    787|#endif
  214|       |
  215|    787|    return 1;
  216|       |
  217|      0|err:
  218|      0|    context_deinit_objs(ctx);
  219|       |
  220|      0|    if (exdata_done)
  ------------------
  |  Branch (220:9): [True: 0, False: 0]
  ------------------
  221|      0|        ossl_crypto_cleanup_all_ex_data_int(ctx);
  222|       |
  223|      0|    CRYPTO_THREAD_lock_free(ctx->lock);
  224|      0|    memset(ctx, '\0', sizeof(*ctx));
  225|      0|    return 0;
  226|    787|}
context.c:default_context_do_init:
  383|      1|{
  384|      1|    if (!CRYPTO_THREAD_init_local(&default_context_thread_local, NULL))
  ------------------
  |  Branch (384:9): [True: 0, False: 1]
  ------------------
  385|      0|        goto err;
  386|       |
  387|      1|    if (!context_init(&default_context_int))
  ------------------
  |  Branch (387:9): [True: 0, False: 1]
  ------------------
  388|      0|        goto deinit_thread;
  389|       |
  390|      1|    default_context_inited = 1;
  391|      1|    return 1;
  392|       |
  393|      0|deinit_thread:
  394|      0|    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
  395|      0|err:
  396|      0|    return 0;
  397|      0|}
context.c:get_default_context:
  417|  11.4M|{
  418|  11.4M|    OSSL_LIB_CTX *current_defctx = get_thread_default_context();
  419|       |
  420|  11.4M|    if (current_defctx == NULL && default_context_inited)
  ------------------
  |  Branch (420:9): [True: 11.4M, False: 0]
  |  Branch (420:35): [True: 11.4M, False: 0]
  ------------------
  421|  11.4M|        current_defctx = &default_context_int;
  422|  11.4M|    return current_defctx;
  423|  11.4M|}
context.c:get_thread_default_context:
  409|  11.4M|{
  410|  11.4M|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|  11.4M|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 11.4M, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (410:9): [True: 0, False: 11.4M]
  ------------------
  411|      0|        return NULL;
  412|       |
  413|  11.4M|    return CRYPTO_THREAD_get_local(&default_context_thread_local);
  414|  11.4M|}

ossl_algorithm_do_all:
  149|  75.9k|{
  150|  75.9k|    struct algorithm_data_st cbdata = {
  151|  75.9k|        0,
  152|  75.9k|    };
  153|       |
  154|  75.9k|    cbdata.libctx = libctx;
  155|  75.9k|    cbdata.operation_id = operation_id;
  156|  75.9k|    cbdata.pre = pre;
  157|  75.9k|    cbdata.reserve_store = reserve_store;
  158|  75.9k|    cbdata.fn = fn;
  159|  75.9k|    cbdata.unreserve_store = unreserve_store;
  160|  75.9k|    cbdata.post = post;
  161|  75.9k|    cbdata.data = data;
  162|       |
  163|  75.9k|    if (provider == NULL) {
  ------------------
  |  Branch (163:9): [True: 74.8k, False: 1.09k]
  ------------------
  164|  74.8k|        ossl_provider_doall_activated(libctx, algorithm_do_this, &cbdata);
  165|  74.8k|    } else {
  166|  1.09k|        OSSL_LIB_CTX *libctx2 = ossl_provider_libctx(provider);
  167|       |
  168|       |        /*
  169|       |         * If a provider is given, its library context MUST match the library
  170|       |         * context we're passed.  If this turns out not to be true, there is
  171|       |         * a programming error in the functions up the call stack.
  172|       |         */
  173|  1.09k|        if (!ossl_assert(ossl_lib_ctx_get_concrete(libctx)
  ------------------
  |  |   52|  1.09k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  1.09k|    __FILE__, __LINE__)
  ------------------
  |  Branch (173:13): [True: 0, False: 1.09k]
  ------------------
  174|  1.09k|                == ossl_lib_ctx_get_concrete(libctx2)))
  175|      0|            return;
  176|       |
  177|  1.09k|        cbdata.libctx = libctx2;
  178|  1.09k|        algorithm_do_this(provider, &cbdata);
  179|  1.09k|    }
  180|  75.9k|}
ossl_algorithm_get1_first_name:
  183|   169k|{
  184|   169k|    const char *first_name_end = NULL;
  185|   169k|    size_t first_name_len = 0;
  186|   169k|    char *ret;
  187|       |
  188|   169k|    if (algo->algorithm_names == NULL)
  ------------------
  |  Branch (188:9): [True: 0, False: 169k]
  ------------------
  189|      0|        return NULL;
  190|       |
  191|   169k|    first_name_end = strchr(algo->algorithm_names, ':');
  192|   169k|    if (first_name_end == NULL)
  ------------------
  |  Branch (192:9): [True: 52.0k, False: 117k]
  ------------------
  193|  52.0k|        first_name_len = strlen(algo->algorithm_names);
  194|   117k|    else
  195|   117k|        first_name_len = first_name_end - algo->algorithm_names;
  196|       |
  197|   169k|    ret = OPENSSL_strndup(algo->algorithm_names, first_name_len);
  ------------------
  |  |  137|   169k|    CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  198|   169k|    return ret;
  199|   169k|}
core_algorithm.c:algorithm_do_this:
  103|   119k|{
  104|   119k|    struct algorithm_data_st *data = cbdata;
  105|   119k|    int first_operation = 1;
  106|   119k|    int last_operation = OSSL_OP__HIGHEST;
  ------------------
  |  |  299|   119k|#define OSSL_OP__HIGHEST 22
  ------------------
  107|   119k|    int cur_operation;
  108|   119k|    int ok = 1;
  109|       |
  110|   119k|    if (data->operation_id != 0)
  ------------------
  |  Branch (110:9): [True: 119k, False: 0]
  ------------------
  111|   119k|        first_operation = last_operation = data->operation_id;
  112|       |
  113|   119k|    for (cur_operation = first_operation;
  114|   238k|        cur_operation <= last_operation;
  ------------------
  |  Branch (114:9): [True: 119k, False: 119k]
  ------------------
  115|   119k|        cur_operation++) {
  116|   119k|        int no_store = 0; /* Assume caching is ok */
  117|   119k|        const OSSL_ALGORITHM *map = NULL;
  118|   119k|        int ret = 0;
  119|       |
  120|   119k|        map = ossl_provider_query_operation(provider, cur_operation,
  121|   119k|            &no_store);
  122|   119k|        ret = algorithm_do_map(provider, map, cur_operation, no_store, data);
  123|   119k|        ossl_provider_unquery_operation(provider, cur_operation, map);
  124|       |
  125|   119k|        if (ret < 0)
  ------------------
  |  Branch (125:13): [True: 0, False: 119k]
  ------------------
  126|       |            /* Hard error, bail out immediately! */
  127|      0|            return 0;
  128|       |
  129|       |        /* If post-condition not fulfilled, set general failure */
  130|   119k|        if (!ret)
  ------------------
  |  Branch (130:13): [True: 0, False: 119k]
  ------------------
  131|      0|            ok = 0;
  132|   119k|    }
  133|       |
  134|   119k|    return ok;
  135|   119k|}
core_algorithm.c:algorithm_do_map:
   44|   119k|{
   45|   119k|    struct algorithm_data_st *data = cbdata;
   46|   119k|    int ret = 0;
   47|       |
   48|   119k|    if (!data->reserve_store(no_store, data->data))
  ------------------
  |  Branch (48:9): [True: 0, False: 119k]
  ------------------
   49|       |        /* Error, bail out! */
   50|      0|        return -1;
   51|       |
   52|       |    /* Do we fulfill pre-conditions? */
   53|   119k|    if (data->pre == NULL) {
  ------------------
  |  Branch (53:9): [True: 0, False: 119k]
  ------------------
   54|       |        /* If there is no pre-condition function, assume "yes" */
   55|      0|        ret = 1;
   56|   119k|    } else if (!data->pre(provider, cur_operation, no_store, data->data,
  ------------------
  |  Branch (56:16): [True: 0, False: 119k]
  ------------------
   57|   119k|                   &ret)) {
   58|       |        /* Error, bail out! */
   59|      0|        ret = -1;
   60|      0|        goto end;
   61|      0|    }
   62|       |
   63|       |    /*
   64|       |     * If pre-condition not fulfilled don't add this set of implementations,
   65|       |     * but do continue with the next.  This simply means that another thread
   66|       |     * got to it first.
   67|       |     */
   68|   119k|    if (ret == 0) {
  ------------------
  |  Branch (68:9): [True: 112k, False: 7.38k]
  ------------------
   69|   112k|        ret = 1;
   70|   112k|        goto end;
   71|   112k|    }
   72|       |
   73|  7.38k|    if (map != NULL) {
  ------------------
  |  Branch (73:9): [True: 4.24k, False: 3.14k]
  ------------------
   74|  4.24k|        const OSSL_ALGORITHM *thismap;
   75|       |
   76|   173k|        for (thismap = map; thismap->algorithm_names != NULL; thismap++)
  ------------------
  |  Branch (76:29): [True: 169k, False: 4.24k]
  ------------------
   77|   169k|            data->fn(provider, thismap, no_store, data->data);
   78|  4.24k|    }
   79|       |
   80|       |    /* Do we fulfill post-conditions? */
   81|  7.38k|    if (data->post == NULL) {
  ------------------
  |  Branch (81:9): [True: 0, False: 7.38k]
  ------------------
   82|       |        /* If there is no post-condition function, assume "yes" */
   83|      0|        ret = 1;
   84|  7.38k|    } else if (!data->post(provider, cur_operation, no_store, data->data,
  ------------------
  |  Branch (84:16): [True: 0, False: 7.38k]
  ------------------
   85|  7.38k|                   &ret)) {
   86|       |        /* Error, bail out! */
   87|      0|        ret = -1;
   88|      0|    }
   89|       |
   90|   119k|end:
   91|   119k|    data->unreserve_store(data->data);
   92|       |
   93|   119k|    return ret;
   94|  7.38k|}

ossl_method_construct:
  137|  75.9k|{
  138|  75.9k|    void *method = NULL;
  139|  75.9k|    OSSL_PROVIDER *provider = provider_rw != NULL ? *provider_rw : NULL;
  ------------------
  |  Branch (139:31): [True: 75.9k, False: 0]
  ------------------
  140|  75.9k|    struct construct_data_st cbdata;
  141|       |
  142|       |    /*
  143|       |     * We might be tempted to try to look into the method store without
  144|       |     * constructing to see if we can find our method there already.
  145|       |     * Unfortunately that does not work well if the query contains
  146|       |     * optional properties as newly loaded providers can match them better.
  147|       |     * We trust that ossl_method_construct_precondition() and
  148|       |     * ossl_method_construct_postcondition() make sure that the
  149|       |     * ossl_algorithm_do_all() does very little when methods from
  150|       |     * a provider have already been constructed.
  151|       |     */
  152|       |
  153|  75.9k|    cbdata.store = NULL;
  154|  75.9k|    cbdata.force_store = force_store;
  155|  75.9k|    cbdata.mcm = mcm;
  156|  75.9k|    cbdata.mcm_data = mcm_data;
  157|  75.9k|    ossl_algorithm_do_all(libctx, operation_id, provider,
  158|  75.9k|        ossl_method_construct_precondition,
  159|  75.9k|        ossl_method_construct_reserve_store,
  160|  75.9k|        ossl_method_construct_this,
  161|  75.9k|        ossl_method_construct_unreserve_store,
  162|  75.9k|        ossl_method_construct_postcondition,
  163|  75.9k|        &cbdata);
  164|       |
  165|       |    /* If there is a temporary store, try there first */
  166|  75.9k|    if (cbdata.store != NULL)
  ------------------
  |  Branch (166:9): [True: 0, False: 75.9k]
  ------------------
  167|      0|        method = mcm->get(cbdata.store, (const OSSL_PROVIDER **)provider_rw,
  168|      0|            mcm_data);
  169|       |
  170|       |    /* If no method was found yet, try the global store */
  171|  75.9k|    if (method == NULL)
  ------------------
  |  Branch (171:9): [True: 75.9k, False: 0]
  ------------------
  172|  75.9k|        method = mcm->get(NULL, (const OSSL_PROVIDER **)provider_rw, mcm_data);
  173|       |
  174|  75.9k|    return method;
  175|  75.9k|}
core_fetch.c:ossl_method_construct_precondition:
   63|   119k|{
   64|   119k|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|   119k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|   119k|    __FILE__, __LINE__)
  ------------------
  |  Branch (64:9): [True: 0, False: 119k]
  ------------------
   65|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   66|      0|        return 0;
   67|      0|    }
   68|       |
   69|       |    /* Assume that no bits are set */
   70|   119k|    *result = 0;
   71|       |
   72|       |    /* No flag bits for temporary stores */
   73|   119k|    if (!is_temporary_method_store(no_store, cbdata)
  ------------------
  |  Branch (73:9): [True: 119k, False: 0]
  ------------------
   74|   119k|        && !ossl_provider_test_operation_bit(provider, operation_id, result))
  ------------------
  |  Branch (74:12): [True: 0, False: 119k]
  ------------------
   75|      0|        return 0;
   76|       |
   77|       |    /*
   78|       |     * The result we get tells if methods have already been constructed.
   79|       |     * However, we want to tell whether construction should happen (true)
   80|       |     * or not (false), which is the opposite of what we got.
   81|       |     */
   82|   119k|    *result = !*result;
   83|       |
   84|   119k|    return 1;
   85|   119k|}
core_fetch.c:is_temporary_method_store:
   29|   246k|{
   30|   246k|    struct construct_data_st *data = cbdata;
   31|       |
   32|   246k|    return no_store && !data->force_store;
  ------------------
  |  Branch (32:12): [True: 0, False: 246k]
  |  Branch (32:24): [True: 0, False: 0]
  ------------------
   33|   246k|}
core_fetch.c:ossl_method_construct_reserve_store:
   36|   119k|{
   37|   119k|    struct construct_data_st *data = cbdata;
   38|       |
   39|   119k|    if (is_temporary_method_store(no_store, data) && data->store == NULL) {
  ------------------
  |  Branch (39:9): [True: 0, False: 119k]
  |  Branch (39:54): [True: 0, False: 0]
  ------------------
   40|       |        /*
   41|       |         * If we have been told not to store the method "permanently", we
   42|       |         * ask for a temporary store, and store the method there.
   43|       |         * The owner of |data->mcm| is completely responsible for managing
   44|       |         * that temporary store.
   45|       |         */
   46|      0|        if ((data->store = data->mcm->get_tmp_store(data->mcm_data)) == NULL)
  ------------------
  |  Branch (46:13): [True: 0, False: 0]
  ------------------
   47|      0|            return 0;
   48|      0|    }
   49|       |
   50|   119k|    return data->mcm->lock_store(data->store, data->mcm_data);
   51|   119k|}
core_fetch.c:ossl_method_construct_this:
  106|   169k|{
  107|   169k|    struct construct_data_st *data = cbdata;
  108|   169k|    void *method = NULL;
  109|       |
  110|   169k|    if ((method = data->mcm->construct(algo, provider, data->mcm_data))
  ------------------
  |  Branch (110:9): [True: 0, False: 169k]
  ------------------
  111|   169k|        == NULL)
  112|      0|        return;
  113|       |
  114|   169k|    OSSL_TRACE2(QUERY,
  ------------------
  |  |  295|   169k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  285|   169k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  115|   169k|        "ossl_method_construct_this: putting an algo to the store %p with no_store %d\n",
  116|   169k|        (void *)data->store, no_store);
  117|       |    /*
  118|       |     * Note regarding putting the method in stores:
  119|       |     *
  120|       |     * we don't need to care if it actually got in or not here.
  121|       |     * If it didn't get in, it will simply not be available when
  122|       |     * ossl_method_construct() tries to get it from the store.
  123|       |     *
  124|       |     * It is *expected* that the put function increments the refcnt
  125|       |     * of the passed method.
  126|       |     */
  127|   169k|    data->mcm->put(no_store ? data->store : NULL, method, provider, algo->algorithm_names,
  ------------------
  |  Branch (127:20): [True: 0, False: 169k]
  ------------------
  128|   169k|        algo->property_definition, data->mcm_data);
  129|       |
  130|       |    /* refcnt-- because we're dropping the reference */
  131|   169k|    data->mcm->destruct(method, data->mcm_data);
  132|   169k|}
core_fetch.c:ossl_method_construct_unreserve_store:
   54|   119k|{
   55|   119k|    struct construct_data_st *data = cbdata;
   56|       |
   57|   119k|    return data->mcm->unlock_store(data->store, data->mcm_data);
   58|   119k|}
core_fetch.c:ossl_method_construct_postcondition:
   90|  7.38k|{
   91|  7.38k|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|  7.38k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  7.38k|    __FILE__, __LINE__)
  ------------------
  |  Branch (91:9): [True: 0, False: 7.38k]
  ------------------
   92|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   93|      0|        return 0;
   94|      0|    }
   95|       |
   96|  7.38k|    *result = 1;
   97|       |
   98|       |    /* No flag bits for temporary stores */
   99|  7.38k|    return is_temporary_method_store(no_store, cbdata)
  ------------------
  |  Branch (99:12): [True: 0, False: 7.38k]
  ------------------
  100|  7.38k|        || ossl_provider_set_operation_bit(provider, operation_id);
  ------------------
  |  Branch (100:12): [True: 7.38k, False: 0]
  ------------------
  101|  7.38k|}

ossl_stored_namemap_new:
   62|    787|{
   63|    787|    OSSL_NAMEMAP *namemap = ossl_namemap_new(libctx);
   64|       |
   65|    787|    if (namemap != NULL)
  ------------------
  |  Branch (65:9): [True: 787, False: 0]
  ------------------
   66|    787|        namemap->stored = 1;
   67|       |
   68|    787|    return namemap;
   69|    787|}
ossl_stored_namemap_free:
   72|    787|{
   73|    787|    OSSL_NAMEMAP *namemap = vnamemap;
   74|       |
   75|    787|    if (namemap != NULL) {
  ------------------
  |  Branch (75:9): [True: 787, False: 0]
  ------------------
   76|       |        /* Pretend it isn't stored, or ossl_namemap_free() will do nothing */
   77|    787|        namemap->stored = 0;
   78|    787|        ossl_namemap_free(namemap);
   79|    787|    }
   80|    787|}
ossl_namemap_empty:
   88|  4.96M|{
   89|       |#ifdef TSAN_REQUIRES_LOCKING
   90|       |    /* No TSAN support */
   91|       |    int rv;
   92|       |
   93|       |    if (namemap == NULL)
   94|       |        return 1;
   95|       |
   96|       |    if (!CRYPTO_THREAD_read_lock(namemap->lock))
   97|       |        return -1;
   98|       |    rv = namemap->max_number == 0;
   99|       |    CRYPTO_THREAD_unlock(namemap->lock);
  100|       |    return rv;
  101|       |#else
  102|       |    /* Have TSAN support */
  103|  4.96M|    return namemap == NULL || tsan_load(&namemap->max_number) == 0;
  ------------------
  |  |   61|  4.96M|#define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  |  Branch (103:12): [True: 0, False: 4.96M]
  |  Branch (103:31): [True: 632, False: 4.96M]
  ------------------
  104|  4.96M|#endif
  105|  4.96M|}
ossl_namemap_doall_names:
  115|   542k|{
  116|   542k|    int i;
  117|   542k|    NAMES *names;
  118|       |
  119|   542k|    if (namemap == NULL || number <= 0)
  ------------------
  |  Branch (119:9): [True: 0, False: 542k]
  |  Branch (119:28): [True: 0, False: 542k]
  ------------------
  120|      0|        return 0;
  121|       |
  122|       |    /*
  123|       |     * We duplicate the NAMES stack under a read lock. Subsequently we call
  124|       |     * the user function, so that we're not holding the read lock when in user
  125|       |     * code. This could lead to deadlocks.
  126|       |     */
  127|   542k|    if (!CRYPTO_THREAD_read_lock(namemap->lock))
  ------------------
  |  Branch (127:9): [True: 0, False: 542k]
  ------------------
  128|      0|        return 0;
  129|       |
  130|   542k|    names = sk_NAMES_value(namemap->numnames, number - 1);
  131|   542k|    if (names != NULL)
  ------------------
  |  Branch (131:9): [True: 542k, False: 0]
  ------------------
  132|   542k|        names = sk_OPENSSL_STRING_dup(names);
  ------------------
  |  |  254|   542k|#define sk_OPENSSL_STRING_dup(sk) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_STRING_sk_type(sk)))
  ------------------
  133|       |
  134|   542k|    CRYPTO_THREAD_unlock(namemap->lock);
  135|       |
  136|   542k|    if (names == NULL)
  ------------------
  |  Branch (136:9): [True: 0, False: 542k]
  ------------------
  137|      0|        return 0;
  138|       |
  139|  2.35M|    for (i = 0; i < sk_OPENSSL_STRING_num(names); i++)
  ------------------
  |  |  232|  2.35M|#define sk_OPENSSL_STRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_STRING_sk_type(sk))
  ------------------
  |  Branch (139:17): [True: 1.81M, False: 542k]
  ------------------
  140|  1.81M|        fn(sk_OPENSSL_STRING_value(names, i), data);
  ------------------
  |  |  233|  1.81M|#define sk_OPENSSL_STRING_value(sk, idx) ((char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_STRING_sk_type(sk), (idx)))
  ------------------
  141|       |
  142|   542k|    sk_OPENSSL_STRING_free(names);
  ------------------
  |  |  238|   542k|#define sk_OPENSSL_STRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_STRING_sk_type(sk))
  ------------------
  143|   542k|    return i > 0;
  144|   542k|}
ossl_namemap_name2num:
  147|  5.58M|{
  148|  5.58M|    int number = 0;
  149|  5.58M|    HT_VALUE *val;
  150|  5.58M|    NAMENUM_KEY key;
  151|       |
  152|  5.58M|#ifndef FIPS_MODULE
  153|  5.58M|    if (namemap == NULL)
  ------------------
  |  Branch (153:9): [True: 0, False: 5.58M]
  ------------------
  154|      0|        namemap = ossl_namemap_stored(NULL);
  155|  5.58M|#endif
  156|       |
  157|  5.58M|    if (namemap == NULL)
  ------------------
  |  Branch (157:9): [True: 0, False: 5.58M]
  ------------------
  158|      0|        return 0;
  159|       |
  160|  5.58M|    HT_INIT_KEY(&key);
  ------------------
  |  |  110|  5.58M|    do {                                                                \
  |  |  111|  5.58M|        memset((key), 0, sizeof(*(key)));                               \
  |  |  112|  5.58M|        (key)->key_header.keysize = (sizeof(*(key)) - sizeof(HT_KEY));  \
  |  |  113|  5.58M|        (key)->key_header.keybuf = (((uint8_t *)key) + sizeof(HT_KEY)); \
  |  |  114|  5.58M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (114:14): [Folded, False: 5.58M]
  |  |  ------------------
  ------------------
  161|  5.58M|    HT_SET_KEY_STRING_CASE(&key, name, name);
  ------------------
  |  |  143|  5.58M|    do {                                                                                      \
  |  |  144|  5.58M|        ossl_ht_strcase((key)->keyfields.member, value, sizeof((key)->keyfields.member) - 1); \
  |  |  145|  5.58M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (145:14): [Folded, False: 5.58M]
  |  |  ------------------
  ------------------
  162|       |
  163|  5.58M|    val = ossl_ht_get(namemap->namenum_ht, TO_HT_KEY(&key));
  ------------------
  |  |  181|  5.58M|#define TO_HT_KEY(key) &(key)->key_header
  ------------------
  164|       |
  165|  5.58M|    if (val != NULL)
  ------------------
  |  Branch (165:9): [True: 4.97M, False: 609k]
  ------------------
  166|       |        /* We store a (small) int directly instead of a pointer to it. */
  167|  4.97M|        number = (int)(intptr_t)val->value;
  168|       |
  169|  5.58M|    return number;
  170|  5.58M|}
ossl_namemap_name2num_n:
  174|   198k|{
  175|   198k|    int number = 0;
  176|   198k|    HT_VALUE *val;
  177|   198k|    NAMENUM_KEY key;
  178|       |
  179|   198k|#ifndef FIPS_MODULE
  180|   198k|    if (namemap == NULL)
  ------------------
  |  Branch (180:9): [True: 0, False: 198k]
  ------------------
  181|      0|        namemap = ossl_namemap_stored(NULL);
  182|   198k|#endif
  183|       |
  184|   198k|    if (namemap == NULL)
  ------------------
  |  Branch (184:9): [True: 0, False: 198k]
  ------------------
  185|      0|        return 0;
  186|       |
  187|   198k|    HT_INIT_KEY(&key);
  ------------------
  |  |  110|   198k|    do {                                                                \
  |  |  111|   198k|        memset((key), 0, sizeof(*(key)));                               \
  |  |  112|   198k|        (key)->key_header.keysize = (sizeof(*(key)) - sizeof(HT_KEY));  \
  |  |  113|   198k|        (key)->key_header.keybuf = (((uint8_t *)key) + sizeof(HT_KEY)); \
  |  |  114|   198k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (114:14): [Folded, False: 198k]
  |  |  ------------------
  ------------------
  188|   198k|    HT_SET_KEY_STRING_CASE_N(&key, name, name, (int)name_len);
  ------------------
  |  |  162|   198k|    do {                                                                                          \
  |  |  163|   198k|        if ((size_t)len < sizeof((key)->keyfields.member))                                        \
  |  |  ------------------
  |  |  |  Branch (163:13): [True: 198k, False: 0]
  |  |  ------------------
  |  |  164|   198k|            ossl_ht_strcase((key)->keyfields.member, value, len);                                 \
  |  |  165|   198k|        else                                                                                      \
  |  |  166|   198k|            ossl_ht_strcase((key)->keyfields.member, value, sizeof((key)->keyfields.member) - 1); \
  |  |  167|   198k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (167:14): [Folded, False: 198k]
  |  |  ------------------
  ------------------
  189|       |
  190|   198k|    val = ossl_ht_get(namemap->namenum_ht, TO_HT_KEY(&key));
  ------------------
  |  |  181|   198k|#define TO_HT_KEY(key) &(key)->key_header
  ------------------
  191|       |
  192|   198k|    if (val != NULL)
  ------------------
  |  Branch (192:9): [True: 170k, False: 28.1k]
  ------------------
  193|       |        /* We store a (small) int directly instead of a pointer to it. */
  194|   170k|        number = (int)(intptr_t)val->value;
  195|       |
  196|   198k|    return number;
  197|   198k|}
ossl_namemap_add_name:
  296|   412k|{
  297|   412k|    int tmp_number;
  298|       |
  299|   412k|#ifndef FIPS_MODULE
  300|   412k|    if (namemap == NULL)
  ------------------
  |  Branch (300:9): [True: 0, False: 412k]
  ------------------
  301|      0|        namemap = ossl_namemap_stored(NULL);
  302|   412k|#endif
  303|       |
  304|   412k|    if (name == NULL || *name == 0 || namemap == NULL)
  ------------------
  |  Branch (304:9): [True: 0, False: 412k]
  |  Branch (304:25): [True: 0, False: 412k]
  |  Branch (304:39): [True: 0, False: 412k]
  ------------------
  305|      0|        return 0;
  306|       |
  307|   412k|    if (!CRYPTO_THREAD_write_lock(namemap->lock))
  ------------------
  |  Branch (307:9): [True: 0, False: 412k]
  ------------------
  308|      0|        return 0;
  309|   412k|    tmp_number = namemap_add_name(namemap, number, name);
  310|   412k|    CRYPTO_THREAD_unlock(namemap->lock);
  311|   412k|    return tmp_number;
  312|   412k|}
ossl_namemap_add_names:
  316|   169k|{
  317|   169k|    char *tmp, *p, *q, *endp;
  318|       |
  319|       |    /* Check that we have a namemap */
  320|   169k|    if (!ossl_assert(namemap != NULL)) {
  ------------------
  |  |   52|   169k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|   169k|    __FILE__, __LINE__)
  ------------------
  |  Branch (320:9): [True: 0, False: 169k]
  ------------------
  321|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  322|      0|        return 0;
  323|      0|    }
  324|       |
  325|   169k|    if ((tmp = OPENSSL_strdup(names)) == NULL)
  ------------------
  |  |  135|   169k|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (325:9): [True: 0, False: 169k]
  ------------------
  326|      0|        return 0;
  327|       |
  328|   169k|    if (!CRYPTO_THREAD_write_lock(namemap->lock)) {
  ------------------
  |  Branch (328:9): [True: 0, False: 169k]
  ------------------
  329|      0|        OPENSSL_free(tmp);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  330|      0|        return 0;
  331|      0|    }
  332|       |    /*
  333|       |     * Check that no name is an empty string, and that all names have at
  334|       |     * most one numeric identity together.
  335|       |     */
  336|   563k|    for (p = tmp; *p != '\0'; p = q) {
  ------------------
  |  Branch (336:19): [True: 393k, False: 169k]
  ------------------
  337|   393k|        int this_number;
  338|   393k|        size_t l;
  339|       |
  340|   393k|        if ((q = strchr(p, separator)) == NULL) {
  ------------------
  |  Branch (340:13): [True: 169k, False: 224k]
  ------------------
  341|   169k|            l = strlen(p); /* offset to \0 */
  342|   169k|            q = p + l;
  343|   224k|        } else {
  344|   224k|            l = q - p; /* offset to the next separator */
  345|   224k|            *q++ = '\0';
  346|   224k|        }
  347|       |
  348|   393k|        if (*p == '\0') {
  ------------------
  |  Branch (348:13): [True: 0, False: 393k]
  ------------------
  349|      0|            ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_BAD_ALGORITHM_NAME);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  350|      0|            number = 0;
  351|      0|            goto end;
  352|      0|        }
  353|       |
  354|   393k|        this_number = ossl_namemap_name2num(namemap, p);
  355|       |
  356|   393k|        if (number == 0) {
  ------------------
  |  Branch (356:13): [True: 276k, False: 117k]
  ------------------
  357|   276k|            number = this_number;
  358|   276k|        } else if (this_number != 0 && this_number != number) {
  ------------------
  |  Branch (358:20): [True: 101k, False: 15.8k]
  |  Branch (358:40): [True: 0, False: 101k]
  ------------------
  359|      0|            ERR_raise_data(ERR_LIB_CRYPTO, CRYPTO_R_CONFLICTING_NAMES,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, CRYPTO_R_CONFLICTING_NAMES,
  ------------------
  |  |   87|      0|#define ERR_LIB_CRYPTO 15
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, CRYPTO_R_CONFLICTING_NAMES,
  ------------------
  |  |   23|      0|#define CRYPTO_R_CONFLICTING_NAMES 118
  ------------------
  360|      0|                "\"%s\" has an existing different identity %d (from \"%s\")",
  361|      0|                p, this_number, names);
  362|      0|            number = 0;
  363|      0|            goto end;
  364|      0|        }
  365|   393k|    }
  366|   169k|    endp = p;
  367|       |
  368|       |    /* Now that we have checked, register all names */
  369|   563k|    for (p = tmp; p < endp; p = q) {
  ------------------
  |  Branch (369:19): [True: 393k, False: 169k]
  ------------------
  370|   393k|        int this_number;
  371|       |
  372|   393k|        q = p + strlen(p) + 1;
  373|       |
  374|   393k|        this_number = namemap_add_name(namemap, number, p);
  375|   393k|        if (number == 0) {
  ------------------
  |  Branch (375:13): [True: 85.5k, False: 308k]
  ------------------
  376|  85.5k|            number = this_number;
  377|   308k|        } else if (this_number != number) {
  ------------------
  |  Branch (377:20): [True: 0, False: 308k]
  ------------------
  378|      0|            ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |   87|      0|#define ERR_LIB_CRYPTO 15
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  355|      0|#define ERR_R_INTERNAL_ERROR (259 | ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  351|      0|#define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  238|      0|#define ERR_RFLAG_FATAL (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  379|      0|                "Got number %d when expecting %d",
  380|      0|                this_number, number);
  381|      0|            number = 0;
  382|      0|            goto end;
  383|      0|        }
  384|   393k|    }
  385|       |
  386|   169k|end:
  387|   169k|    CRYPTO_THREAD_unlock(namemap->lock);
  388|   169k|    OPENSSL_free(tmp);
  ------------------
  |  |  131|   169k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  389|   169k|    return number;
  390|   169k|}
ossl_namemap_stored:
  490|  4.96M|{
  491|  4.96M|#ifndef FIPS_MODULE
  492|  4.96M|    int nms;
  493|  4.96M|#endif
  494|  4.96M|    OSSL_NAMEMAP *namemap = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_NAMEMAP_INDEX);
  ------------------
  |  |  100|  4.96M|#define OSSL_LIB_CTX_NAMEMAP_INDEX 4
  ------------------
  495|       |
  496|  4.96M|    if (namemap == NULL)
  ------------------
  |  Branch (496:9): [True: 0, False: 4.96M]
  ------------------
  497|      0|        return NULL;
  498|       |
  499|  4.96M|#ifndef FIPS_MODULE
  500|  4.96M|    nms = ossl_namemap_empty(namemap);
  501|  4.96M|    if (nms < 0) {
  ------------------
  |  Branch (501:9): [True: 0, False: 4.96M]
  ------------------
  502|       |        /*
  503|       |         * Could not get lock to make the count, so maybe internal objects
  504|       |         * weren't added. This seems safest.
  505|       |         */
  506|      0|        return NULL;
  507|      0|    }
  508|  4.96M|    if (nms == 1) {
  ------------------
  |  Branch (508:9): [True: 632, False: 4.96M]
  ------------------
  509|    632|        int num;
  510|       |
  511|       |        /* Before pilfering, we make sure the legacy database is populated */
  512|    632|        OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS
  ------------------
  |  |  506|    632|#define OPENSSL_INIT_ADD_ALL_CIPHERS 0x00000004L
  ------------------
  513|    632|                | OPENSSL_INIT_ADD_ALL_DIGESTS,
  ------------------
  |  |  507|    632|#define OPENSSL_INIT_ADD_ALL_DIGESTS 0x00000008L
  ------------------
  514|    632|            NULL);
  515|       |
  516|    632|        OBJ_NAME_do_all(OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|    632|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  ------------------
  517|    632|            get_legacy_cipher_names, namemap);
  518|    632|        OBJ_NAME_do_all(OBJ_NAME_TYPE_MD_METH,
  ------------------
  |  |   25|    632|#define OBJ_NAME_TYPE_MD_METH 0x01
  ------------------
  519|    632|            get_legacy_md_names, namemap);
  520|       |
  521|       |        /*
  522|       |         * Some old providers (<= 3.5) may not have the rsassaPSS alias which
  523|       |         * may cause problems in some cases. We add it manually here
  524|       |         */
  525|    632|        num = ossl_namemap_add_name(namemap, 0, "RSA-PSS");
  526|    632|        if (num != 0) {
  ------------------
  |  Branch (526:13): [True: 632, False: 0]
  ------------------
  527|    632|            ossl_namemap_add_name(namemap, num, "rsassaPss");
  528|       |            /* Add other RSA-PSS aliases as well */
  529|    632|            ossl_namemap_add_name(namemap, num, "RSASSA-PSS");
  530|    632|            ossl_namemap_add_name(namemap, num, "1.2.840.113549.1.1.10");
  531|    632|        }
  532|    632|#ifndef OPENSSL_NO_DEPRECATED_3_6
  533|    632|        {
  534|    632|            int i, end;
  535|       |
  536|       |            /* We also pilfer data from the legacy EVP_PKEY_ASN1_METHODs */
  537|  10.1k|            for (i = 0, end = EVP_PKEY_asn1_get_count(); i < end; i++)
  ------------------
  |  Branch (537:58): [True: 9.48k, False: 632]
  ------------------
  538|  9.48k|                get_legacy_pkey_meth_names(EVP_PKEY_asn1_get0(i), namemap);
  539|    632|        }
  540|    632|#endif
  541|    632|    }
  542|  4.96M|#endif
  543|       |
  544|  4.96M|    return namemap;
  545|  4.96M|}
ossl_namemap_new:
  548|    787|{
  549|    787|    OSSL_NAMEMAP *namemap;
  550|    787|    HT_CONFIG htconf = { NULL, NULL, NULL, NAMEMAP_HT_BUCKETS, 1, 1 };
  ------------------
  |  |   22|    787|#define NAMEMAP_HT_BUCKETS 512
  ------------------
  551|       |
  552|    787|    htconf.ctx = libctx;
  553|       |
  554|    787|    if ((namemap = OPENSSL_zalloc(sizeof(*namemap))) == NULL)
  ------------------
  |  |  108|    787|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (554:9): [True: 0, False: 787]
  ------------------
  555|      0|        goto err;
  556|       |
  557|    787|    if ((namemap->lock = CRYPTO_THREAD_lock_new()) == NULL)
  ------------------
  |  Branch (557:9): [True: 0, False: 787]
  ------------------
  558|      0|        goto err;
  559|       |
  560|    787|    if ((namemap->namenum_ht = ossl_ht_new(&htconf)) == NULL)
  ------------------
  |  Branch (560:9): [True: 0, False: 787]
  ------------------
  561|      0|        goto err;
  562|       |
  563|    787|    if ((namemap->numnames = sk_NAMES_new_null()) == NULL)
  ------------------
  |  Branch (563:9): [True: 0, False: 787]
  ------------------
  564|      0|        goto err;
  565|       |
  566|    787|    return namemap;
  567|       |
  568|      0|err:
  569|      0|    ossl_namemap_free(namemap);
  570|       |    return NULL;
  571|    787|}
ossl_namemap_free:
  574|    787|{
  575|    787|    if (namemap == NULL || namemap->stored)
  ------------------
  |  Branch (575:9): [True: 0, False: 787]
  |  Branch (575:28): [True: 0, False: 787]
  ------------------
  576|      0|        return;
  577|       |
  578|    787|    sk_NAMES_pop_free(namemap->numnames, names_free);
  579|       |
  580|    787|    ossl_ht_free(namemap->namenum_ht);
  581|       |
  582|    787|    CRYPTO_THREAD_lock_free(namemap->lock);
  583|    787|    OPENSSL_free(namemap);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  584|    787|}
core_namemap.c:namemap_add_name:
  264|   805k|{
  265|   805k|    int ret;
  266|   805k|    HT_VALUE val = { 0 };
  267|   805k|    NAMENUM_KEY key;
  268|       |
  269|       |    /* If it already exists, we don't add it */
  270|   805k|    if ((ret = ossl_namemap_name2num(namemap, name)) != 0)
  ------------------
  |  Branch (270:9): [True: 434k, False: 371k]
  ------------------
  271|   434k|        return ret;
  272|       |
  273|   371k|    if ((number = numname_insert(namemap, number, name)) == 0)
  ------------------
  |  Branch (273:9): [True: 0, False: 371k]
  ------------------
  274|      0|        return 0;
  275|       |
  276|       |    /* Using tsan_store alone here is safe since we're under lock */
  277|   371k|    tsan_store(&namemap->max_number, number);
  ------------------
  |  |   62|   371k|#define tsan_store(ptr, val) atomic_store_explicit((ptr), (val), memory_order_relaxed)
  ------------------
  278|       |
  279|   371k|    HT_INIT_KEY(&key);
  ------------------
  |  |  110|   371k|    do {                                                                \
  |  |  111|   371k|        memset((key), 0, sizeof(*(key)));                               \
  |  |  112|   371k|        (key)->key_header.keysize = (sizeof(*(key)) - sizeof(HT_KEY));  \
  |  |  113|   371k|        (key)->key_header.keybuf = (((uint8_t *)key) + sizeof(HT_KEY)); \
  |  |  114|   371k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (114:14): [Folded, False: 371k]
  |  |  ------------------
  ------------------
  280|   371k|    HT_SET_KEY_STRING_CASE(&key, name, name);
  ------------------
  |  |  143|   371k|    do {                                                                                      \
  |  |  144|   371k|        ossl_ht_strcase((key)->keyfields.member, value, sizeof((key)->keyfields.member) - 1); \
  |  |  145|   371k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (145:14): [Folded, False: 371k]
  |  |  ------------------
  ------------------
  281|   371k|    val.value = (void *)(intptr_t)number;
  282|   371k|    ret = ossl_ht_insert(namemap->namenum_ht, TO_HT_KEY(&key), &val, NULL);
  ------------------
  |  |  181|   371k|#define TO_HT_KEY(key) &(key)->key_header
  ------------------
  283|   371k|    if (ret <= 0) {
  ------------------
  |  Branch (283:9): [True: 0, False: 371k]
  ------------------
  284|       |        /*
  285|       |         * We either got an allocation failure (INTERNAL_ERROR), or
  286|       |         * hit too many conflicts in the table (TOO_MANY_NAMES)
  287|       |         */
  288|      0|        ERR_raise(ERR_LIB_CRYPTO, (ret < 0) ? CRYPTO_R_TOO_MANY_NAMES : ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  |  |  |  Branch (404:55): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  289|      0|        return 0;
  290|      0|    }
  291|   371k|    return number;
  292|   371k|}
core_namemap.c:numname_insert:
  223|   371k|{
  224|   371k|    NAMES *names;
  225|   371k|    char *tmpname;
  226|       |
  227|   371k|    if (number > 0) {
  ------------------
  |  Branch (227:9): [True: 211k, False: 160k]
  ------------------
  228|   211k|        names = sk_NAMES_value(namemap->numnames, number - 1);
  229|   211k|        if (!ossl_assert(names != NULL)) {
  ------------------
  |  |   52|   211k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|   211k|    __FILE__, __LINE__)
  ------------------
  |  Branch (229:13): [True: 0, False: 211k]
  ------------------
  230|       |            /* cannot happen */
  231|      0|            return 0;
  232|      0|        }
  233|   211k|    } else {
  234|       |        /* a completely new entry */
  235|   160k|        names = sk_OPENSSL_STRING_new_null();
  ------------------
  |  |  235|   160k|#define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new_null())
  ------------------
  236|   160k|        if (names == NULL)
  ------------------
  |  Branch (236:13): [True: 0, False: 160k]
  ------------------
  237|      0|            return 0;
  238|   160k|    }
  239|       |
  240|   371k|    if ((tmpname = OPENSSL_strdup(name)) == NULL)
  ------------------
  |  |  135|   371k|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (240:9): [True: 0, False: 371k]
  ------------------
  241|      0|        goto err;
  242|       |
  243|   371k|    if (!sk_OPENSSL_STRING_push(names, tmpname))
  ------------------
  |  |  242|   371k|#define sk_OPENSSL_STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))
  ------------------
  |  Branch (243:9): [True: 0, False: 371k]
  ------------------
  244|      0|        goto err;
  245|   371k|    tmpname = NULL;
  246|       |
  247|   371k|    if (number <= 0) {
  ------------------
  |  Branch (247:9): [True: 160k, False: 211k]
  ------------------
  248|   160k|        if (!sk_NAMES_push(namemap->numnames, names))
  ------------------
  |  Branch (248:13): [True: 0, False: 160k]
  ------------------
  249|      0|            goto err;
  250|   160k|        number = sk_NAMES_num(namemap->numnames);
  251|   160k|    }
  252|   371k|    return number;
  253|       |
  254|      0|err:
  255|      0|    if (number <= 0)
  ------------------
  |  Branch (255:9): [True: 0, False: 0]
  ------------------
  256|      0|        sk_OPENSSL_STRING_pop_free(names, name_string_free);
  ------------------
  |  |  246|      0|#define sk_OPENSSL_STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_freefunc_type(freefunc))
  ------------------
  257|      0|    OPENSSL_free(tmpname);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  258|      0|    return 0;
  259|   371k|}
core_namemap.c:name_string_free:
   50|   371k|{
   51|   371k|    OPENSSL_free(name);
  ------------------
  |  |  131|   371k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   52|   371k|}
core_namemap.c:get_legacy_cipher_names:
  427|   115k|{
  428|   115k|    const EVP_CIPHER *cipher = (void *)OBJ_NAME_get(on->name, on->type);
  429|       |
  430|   115k|    if (cipher != NULL)
  ------------------
  |  Branch (430:9): [True: 115k, False: 0]
  ------------------
  431|   115k|        get_legacy_evp_names(NID_undef, EVP_CIPHER_get_type(cipher), NULL, arg);
  ------------------
  |  |   18|   115k|#define NID_undef                       0
  ------------------
  432|   115k|}
core_namemap.c:get_legacy_evp_names:
  403|   163k|{
  404|   163k|    int num = 0;
  405|   163k|    ASN1_OBJECT *obj;
  406|       |
  407|   163k|    if (base_nid != NID_undef) {
  ------------------
  |  |   18|   163k|#define NID_undef                       0
  ------------------
  |  Branch (407:9): [True: 2.52k, False: 160k]
  ------------------
  408|  2.52k|        num = ossl_namemap_add_name(arg, num, OBJ_nid2sn(base_nid));
  409|  2.52k|        num = ossl_namemap_add_name(arg, num, OBJ_nid2ln(base_nid));
  410|  2.52k|    }
  411|       |
  412|   163k|    if (nid != NID_undef) {
  ------------------
  |  |   18|   163k|#define NID_undef                       0
  ------------------
  |  Branch (412:9): [True: 132k, False: 30.3k]
  ------------------
  413|   132k|        num = ossl_namemap_add_name(arg, num, OBJ_nid2sn(nid));
  414|   132k|        num = ossl_namemap_add_name(arg, num, OBJ_nid2ln(nid));
  415|   132k|        if ((obj = OBJ_nid2obj(nid)) != NULL) {
  ------------------
  |  Branch (415:13): [True: 132k, False: 0]
  ------------------
  416|   132k|            char txtoid[OSSL_MAX_NAME_SIZE];
  417|       |
  418|   132k|            if (OBJ_obj2txt(txtoid, sizeof(txtoid), obj, 1) > 0)
  ------------------
  |  Branch (418:17): [True: 132k, False: 632]
  ------------------
  419|   132k|                num = ossl_namemap_add_name(arg, num, txtoid);
  420|   132k|        }
  421|   132k|    }
  422|   163k|    if (pem_name != NULL)
  ------------------
  |  Branch (422:9): [True: 6.95k, False: 156k]
  ------------------
  423|  6.95k|        num = ossl_namemap_add_name(arg, num, pem_name);
  424|   163k|}
core_namemap.c:get_legacy_md_names:
  435|  37.2k|{
  436|  37.2k|    const EVP_MD *md = (void *)OBJ_NAME_get(on->name, on->type);
  437|       |
  438|  37.2k|    if (md != NULL)
  ------------------
  |  Branch (438:9): [True: 37.2k, False: 0]
  ------------------
  439|  37.2k|        get_legacy_evp_names(0, EVP_MD_get_type(md), NULL, arg);
  440|  37.2k|}
core_namemap.c:get_legacy_pkey_meth_names:
  445|  9.48k|{
  446|  9.48k|    int nid = 0, base_nid = 0, flags = 0;
  447|  9.48k|    const char *pem_name = NULL;
  448|       |
  449|  9.48k|    EVP_PKEY_asn1_get0_info(&nid, &base_nid, &flags, NULL, &pem_name, ameth);
  450|  9.48k|    if (nid != NID_undef) {
  ------------------
  |  |   18|  9.48k|#define NID_undef                       0
  ------------------
  |  Branch (450:9): [True: 9.48k, False: 0]
  ------------------
  451|  9.48k|        if ((flags & ASN1_PKEY_ALIAS) == 0) {
  ------------------
  |  | 1603|  9.48k|#define ASN1_PKEY_ALIAS 0x1
  ------------------
  |  Branch (451:13): [True: 6.32k, False: 3.16k]
  ------------------
  452|  6.32k|            switch (nid) {
  453|    632|            case EVP_PKEY_DHX:
  ------------------
  |  |   72|    632|#define EVP_PKEY_DHX NID_dhpublicnumber
  |  |  ------------------
  |  |  |  | 5522|    632|#define NID_dhpublicnumber              920
  |  |  ------------------
  ------------------
  |  Branch (453:13): [True: 632, False: 5.68k]
  ------------------
  454|       |                /* We know that the name "DHX" is used too */
  455|    632|                get_legacy_evp_names(0, nid, "DHX", arg);
  456|       |                /* FALLTHRU */
  457|  6.32k|            default:
  ------------------
  |  Branch (457:13): [True: 5.68k, False: 632]
  ------------------
  458|  6.32k|                get_legacy_evp_names(0, nid, pem_name, arg);
  459|  6.32k|            }
  460|  6.32k|        } else {
  461|       |            /*
  462|       |             * Treat aliases carefully, some of them are undesirable, or
  463|       |             * should not be treated as such for providers.
  464|       |             */
  465|       |
  466|  3.16k|            switch (nid) {
  467|    632|            case EVP_PKEY_SM2:
  ------------------
  |  |   74|    632|#define EVP_PKEY_SM2 NID_sm2
  |  |  ------------------
  |  |  |  | 1255|    632|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (467:13): [True: 632, False: 2.52k]
  ------------------
  468|       |                /*
  469|       |                 * SM2 is a separate keytype with providers, not an alias for
  470|       |                 * EC.
  471|       |                 */
  472|    632|                get_legacy_evp_names(0, nid, pem_name, arg);
  473|    632|                break;
  474|  2.52k|            default:
  ------------------
  |  Branch (474:13): [True: 2.52k, False: 632]
  ------------------
  475|       |                /* Use the short name of the base nid as the common reference */
  476|  2.52k|                get_legacy_evp_names(base_nid, nid, pem_name, arg);
  477|  3.16k|            }
  478|  3.16k|        }
  479|  9.48k|    }
  480|  9.48k|}
core_namemap.c:names_free:
   55|   160k|{
   56|   160k|    sk_OPENSSL_STRING_pop_free(n, name_string_free);
  ------------------
  |  |  246|   160k|#define sk_OPENSSL_STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_freefunc_type(freefunc))
  ------------------
   57|   160k|}

ossl_err_load_CRYPTO_strings:
   83|      1|{
   84|      1|#ifndef OPENSSL_NO_ERR
   85|      1|    if (ERR_reason_error_string(CRYPTO_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (85:9): [True: 1, False: 0]
  ------------------
   86|      1|        ERR_load_strings_const(CRYPTO_str_reasons);
   87|      1|#endif
   88|      1|    return 1;
   89|      1|}

OPENSSL_cpuid_setup:
   95|      3|{
   96|      3|    static int trigger = 0;
   97|      3|    IA32CAP OPENSSL_ia32_cpuid(unsigned int *);
   98|      3|    IA32CAP vec;
   99|      3|    const variant_char *env;
  100|      3|    int index = 2;
  101|       |
  102|      3|    if (trigger)
  ------------------
  |  Branch (102:9): [True: 1, False: 2]
  ------------------
  103|      1|        return;
  104|       |
  105|      2|    trigger = 1;
  106|      2|    if ((env = ossl_getenv("OPENSSL_ia32cap")) != NULL) {
  ------------------
  |  |   45|      2|#define ossl_getenv getenv
  ------------------
  |  Branch (106:9): [True: 0, False: 2]
  ------------------
  107|      0|        int off = (env[0] == '~') ? 1 : 0;
  ------------------
  |  Branch (107:19): [True: 0, False: 0]
  ------------------
  108|       |
  109|      0|        vec = ossl_strtouint64(env + off);
  110|       |
  111|      0|        if (off) {
  ------------------
  |  Branch (111:13): [True: 0, False: 0]
  ------------------
  112|      0|            IA32CAP mask = vec;
  113|      0|            vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P) & ~mask;
  114|      0|            if (mask & (1 << 24)) {
  ------------------
  |  Branch (114:17): [True: 0, False: 0]
  ------------------
  115|       |                /*
  116|       |                 * User disables FXSR bit, mask even other capabilities
  117|       |                 * that operate exclusively on XMM, so we don't have to
  118|       |                 * double-check all the time. We mask PCLMULQDQ, AMD XOP,
  119|       |                 * AES-NI and AVX. Formally speaking we don't have to
  120|       |                 * do it in x86_64 case, but we can safely assume that
  121|       |                 * x86_64 users won't actually flip this flag.
  122|       |                 */
  123|      0|                vec &= ~((IA32CAP)(1 << 1 | 1 << 11 | 1 << 25 | 1 << 28) << 32);
  124|      0|            }
  125|      0|        } else if (env[0] == ':') {
  ------------------
  |  Branch (125:20): [True: 0, False: 0]
  ------------------
  126|      0|            vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P);
  127|      0|        }
  128|       |
  129|       |        /* Processed indexes 0, 1 */
  130|      0|        if ((env = ossl_strchr(env, ':')) != NULL)
  ------------------
  |  Branch (130:13): [True: 0, False: 0]
  ------------------
  131|      0|            env++;
  132|      0|        for (; index < OPENSSL_IA32CAP_P_MAX_INDEXES; index += 2) {
  ------------------
  |  |   37|      0|#define OPENSSL_IA32CAP_P_MAX_INDEXES 10
  ------------------
  |  Branch (132:16): [True: 0, False: 0]
  ------------------
  133|      0|            if ((env != NULL) && (env[0] != '\0')) {
  ------------------
  |  Branch (133:17): [True: 0, False: 0]
  |  Branch (133:34): [True: 0, False: 0]
  ------------------
  134|       |                /* if env[0] == ':' current index is skipped */
  135|      0|                if (env[0] != ':') {
  ------------------
  |  Branch (135:21): [True: 0, False: 0]
  ------------------
  136|      0|                    IA32CAP vecx;
  137|       |
  138|      0|                    off = (env[0] == '~') ? 1 : 0;
  ------------------
  |  Branch (138:27): [True: 0, False: 0]
  ------------------
  139|      0|                    vecx = ossl_strtouint64(env + off);
  140|      0|                    if (off) {
  ------------------
  |  Branch (140:25): [True: 0, False: 0]
  ------------------
  141|      0|                        OPENSSL_ia32cap_P[index] &= ~(unsigned int)vecx;
  142|      0|                        OPENSSL_ia32cap_P[index + 1] &= ~(unsigned int)(vecx >> 32);
  143|      0|                    } else {
  144|      0|                        OPENSSL_ia32cap_P[index] = (unsigned int)vecx;
  145|      0|                        OPENSSL_ia32cap_P[index + 1] = (unsigned int)(vecx >> 32);
  146|      0|                    }
  147|      0|                }
  148|       |                /* skip delimiter */
  149|      0|                if ((env = ossl_strchr(env, ':')) != NULL)
  ------------------
  |  Branch (149:21): [True: 0, False: 0]
  ------------------
  150|      0|                    env++;
  151|      0|            } else { /* zeroize the next two indexes */
  152|      0|                OPENSSL_ia32cap_P[index] = 0;
  153|      0|                OPENSSL_ia32cap_P[index + 1] = 0;
  154|      0|            }
  155|      0|        }
  156|       |
  157|       |        /* If AVX10 is disabled, zero out its detailed cap bits */
  158|      0|        if (!(OPENSSL_ia32cap_P[6] & (1 << 19)))
  ------------------
  |  Branch (158:13): [True: 0, False: 0]
  ------------------
  159|      0|            OPENSSL_ia32cap_P[9] = 0;
  160|      2|    } else {
  161|      2|        vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P);
  162|      2|    }
  163|       |
  164|       |    /*
  165|       |     * |(1<<10) sets a reserved bit to signal that variable
  166|       |     * was initialized already... This is to avoid interference
  167|       |     * with cpuid snippets in ELF .init segment.
  168|       |     */
  169|      2|    OPENSSL_ia32cap_P[0] = (unsigned int)vec | (1 << 10);
  170|      2|    OPENSSL_ia32cap_P[1] = (unsigned int)(vec >> 32);
  171|      2|}

ossl_err_load_CRMF_strings:
   78|      1|{
   79|      1|#ifndef OPENSSL_NO_ERR
   80|      1|    if (ERR_reason_error_string(CRMF_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (80:9): [True: 1, False: 0]
  ------------------
   81|      1|        ERR_load_strings_const(CRMF_str_reasons);
   82|      1|#endif
   83|      1|    return 1;
   84|      1|}

ossl_err_load_CT_strings:
   52|      1|{
   53|      1|#ifndef OPENSSL_NO_ERR
   54|      1|    if (ERR_reason_error_string(CT_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (54:9): [True: 1, False: 0]
  ------------------
   55|      1|        ERR_load_strings_const(CT_str_reasons);
   56|      1|#endif
   57|      1|    return 1;
   58|      1|}

CTLOG_STORE_new_ex:
  101|  2.56k|{
  102|  2.56k|    CTLOG_STORE *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|  2.56k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  103|       |
  104|  2.56k|    if (ret == NULL)
  ------------------
  |  Branch (104:9): [True: 0, False: 2.56k]
  ------------------
  105|      0|        return NULL;
  106|       |
  107|  2.56k|    ret->libctx = libctx;
  108|  2.56k|    if (propq != NULL) {
  ------------------
  |  Branch (108:9): [True: 604, False: 1.95k]
  ------------------
  109|    604|        ret->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  135|    604|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  110|    604|        if (ret->propq == NULL)
  ------------------
  |  Branch (110:13): [True: 0, False: 604]
  ------------------
  111|      0|            goto err;
  112|    604|    }
  113|       |
  114|  2.56k|    ret->logs = sk_CTLOG_new_null();
  ------------------
  |  |   74|  2.56k|#define sk_CTLOG_new_null() ((STACK_OF(CTLOG) *)OPENSSL_sk_new_null())
  ------------------
  115|  2.56k|    if (ret->logs == NULL) {
  ------------------
  |  Branch (115:9): [True: 0, False: 2.56k]
  ------------------
  116|      0|        ERR_raise(ERR_LIB_CT, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  117|      0|        goto err;
  118|      0|    }
  119|       |
  120|  2.56k|    return ret;
  121|      0|err:
  122|      0|    CTLOG_STORE_free(ret);
  123|       |    return NULL;
  124|  2.56k|}
CTLOG_STORE_free:
  132|  2.56k|{
  133|  2.56k|    if (store != NULL) {
  ------------------
  |  Branch (133:9): [True: 2.56k, False: 0]
  ------------------
  134|  2.56k|        OPENSSL_free(store->propq);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  135|  2.56k|        sk_CTLOG_pop_free(store->logs, CTLOG_free);
  ------------------
  |  |   85|  2.56k|#define sk_CTLOG_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_freefunc_type(freefunc))
  ------------------
  136|  2.56k|        OPENSSL_free(store);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|  2.56k|    }
  138|  2.56k|}

SCT_LIST_free:
   47|  1.77k|{
   48|  1.77k|    sk_SCT_pop_free(a, SCT_free);
  ------------------
  |  |   59|  1.77k|#define sk_SCT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SCT_sk_type(sk), ossl_check_SCT_freefunc_type(freefunc))
  ------------------
   49|  1.77k|}

ossl_ctype_check:
  253|  62.1M|{
  254|  62.1M|    const int max = sizeof(ctype_char_map) / sizeof(*ctype_char_map);
  255|  62.1M|    const int a = ossl_toascii(c);
  ------------------
  |  |   56|  62.1M|#define ossl_toascii(c) (c)
  ------------------
  256|       |
  257|  62.1M|    return a >= 0 && a < max && (ctype_char_map[a] & mask) != 0;
  ------------------
  |  Branch (257:12): [True: 62.0M, False: 7.58k]
  |  Branch (257:22): [True: 62.0M, False: 0]
  |  Branch (257:33): [True: 6.83M, False: 55.2M]
  ------------------
  258|  62.1M|}
ossl_isdigit:
  270|  1.69M|{
  271|  1.69M|    int a = ossl_toascii(c);
  ------------------
  |  |   56|  1.69M|#define ossl_toascii(c) (c)
  ------------------
  272|       |
  273|  1.69M|    return ASCII_IS_DIGIT(a);
  ------------------
  |  |  265|  1.69M|#define ASCII_IS_DIGIT(c) (c >= 0x30 && c <= 0x39)
  |  |  ------------------
  |  |  |  Branch (265:28): [True: 1.67M, False: 16.5k]
  |  |  |  Branch (265:41): [True: 519k, False: 1.15M]
  |  |  ------------------
  ------------------
  274|  1.69M|}
ossl_tolower:
  297|   142M|{
  298|   142M|    int a = ossl_toascii(c);
  ------------------
  |  |   56|   142M|#define ossl_toascii(c) (c)
  ------------------
  299|       |
  300|   142M|    return ASCII_IS_UPPER(a) ? c ^ case_change : c;
  ------------------
  |  |  266|   142M|#define ASCII_IS_UPPER(c) (c >= 0x41 && c <= 0x5A)
  |  |  ------------------
  |  |  |  Branch (266:28): [True: 127M, False: 15.4M]
  |  |  |  Branch (266:41): [True: 38.6M, False: 88.4M]
  |  |  ------------------
  ------------------
  301|   142M|}

OpenSSL_version:
   80|  3.21k|{
   81|       |#if defined(_WIN32) && defined(OSSL_WINCTX)
   82|       |    /* Cannot really fail but we would return empty strings anyway */
   83|       |    (void)RUN_ONCE(&version_strings_once, version_strings_setup);
   84|       |#endif
   85|       |
   86|  3.21k|    switch (t) {
  ------------------
  |  Branch (86:13): [True: 3.21k, False: 0]
  ------------------
   87|      0|    case OPENSSL_VERSION:
  ------------------
  |  |  183|      0|#define OPENSSL_VERSION 0
  ------------------
  |  Branch (87:5): [True: 0, False: 3.21k]
  ------------------
   88|      0|        return OPENSSL_VERSION_TEXT;
  ------------------
  |  |  110|      0|# define OPENSSL_VERSION_TEXT "OpenSSL 3.6.2 7 Apr 2026"
  ------------------
   89|  3.21k|    case OPENSSL_VERSION_STRING:
  ------------------
  |  |  189|  3.21k|#define OPENSSL_VERSION_STRING 6
  ------------------
  |  Branch (89:5): [True: 3.21k, False: 0]
  ------------------
   90|  3.21k|        return OPENSSL_VERSION_STR;
  ------------------
  |  |   90|  3.21k|# define OPENSSL_VERSION_STR "3.6.2"
  ------------------
   91|      0|    case OPENSSL_FULL_VERSION_STRING:
  ------------------
  |  |  190|      0|#define OPENSSL_FULL_VERSION_STRING 7
  ------------------
  |  Branch (91:5): [True: 0, False: 3.21k]
  ------------------
   92|      0|        return OPENSSL_FULL_VERSION_STR;
  ------------------
  |  |   93|      0|# define OPENSSL_FULL_VERSION_STR "3.6.2"
  ------------------
   93|      0|    case OPENSSL_BUILT_ON:
  ------------------
  |  |  185|      0|#define OPENSSL_BUILT_ON 2
  ------------------
  |  Branch (93:5): [True: 0, False: 3.21k]
  ------------------
   94|      0|        return DATE;
  ------------------
  |  |   14|      0|#define DATE "built on: Sat May 30 06:02:09 2026 UTC"
  ------------------
   95|      0|    case OPENSSL_CFLAGS:
  ------------------
  |  |  184|      0|#define OPENSSL_CFLAGS 1
  ------------------
  |  Branch (95:5): [True: 0, False: 3.21k]
  ------------------
   96|      0|        return compiler_flags;
   97|      0|    case OPENSSL_PLATFORM:
  ------------------
  |  |  186|      0|#define OPENSSL_PLATFORM 3
  ------------------
  |  Branch (97:5): [True: 0, False: 3.21k]
  ------------------
   98|      0|        return PLATFORM;
  ------------------
  |  |   13|      0|#define PLATFORM "platform: linux-x86_64-clang"
  ------------------
   99|       |#if defined(_WIN32) && defined(OSSL_WINCTX)
  100|       |    case OPENSSL_DIR:
  101|       |        return openssldir;
  102|       |    case OPENSSL_ENGINES_DIR:
  103|       |        return enginesdir;
  104|       |    case OPENSSL_MODULES_DIR:
  105|       |        return modulesdir;
  106|       |#else
  107|      0|    case OPENSSL_DIR:
  ------------------
  |  |  187|      0|#define OPENSSL_DIR 4
  ------------------
  |  Branch (107:5): [True: 0, False: 3.21k]
  ------------------
  108|      0|#ifdef OPENSSLDIR
  109|      0|        return "OPENSSLDIR: \"" OPENSSLDIR "\"";
  110|       |#else
  111|       |        return "OPENSSLDIR: N/A";
  112|       |#endif
  113|      0|    case OPENSSL_ENGINES_DIR:
  ------------------
  |  |  188|      0|#define OPENSSL_ENGINES_DIR 5
  ------------------
  |  Branch (113:5): [True: 0, False: 3.21k]
  ------------------
  114|      0|#ifdef ENGINESDIR
  115|      0|        return "ENGINESDIR: \"" ENGINESDIR "\"";
  116|       |#else
  117|       |        return "ENGINESDIR: N/A";
  118|       |#endif
  119|      0|    case OPENSSL_MODULES_DIR:
  ------------------
  |  |  191|      0|#define OPENSSL_MODULES_DIR 8
  ------------------
  |  Branch (119:5): [True: 0, False: 3.21k]
  ------------------
  120|      0|#ifdef MODULESDIR
  121|      0|        return "MODULESDIR: \"" MODULESDIR "\"";
  122|       |#else
  123|       |        return "MODULESDIR: N/A";
  124|       |#endif
  125|      0|#endif
  126|      0|    case OPENSSL_CPU_INFO:
  ------------------
  |  |  192|      0|#define OPENSSL_CPU_INFO 9
  ------------------
  |  Branch (126:5): [True: 0, False: 3.21k]
  ------------------
  127|      0|        if (OPENSSL_info(OPENSSL_INFO_CPU_SETTINGS) != NULL)
  ------------------
  |  |  207|      0|#define OPENSSL_INFO_CPU_SETTINGS 1008
  ------------------
  |  Branch (127:13): [True: 0, False: 0]
  ------------------
  128|      0|            return ossl_cpu_info_str;
  129|      0|        else
  130|      0|            return "CPUINFO: N/A";
  131|      0|    case OPENSSL_WINCTX:
  ------------------
  |  |  193|      0|#define OPENSSL_WINCTX 10
  ------------------
  |  Branch (131:5): [True: 0, False: 3.21k]
  ------------------
  132|       |#if defined(_WIN32) && defined(OSSL_WINCTX)
  133|       |        return OSSL_WINCTX_STRING;
  134|       |#else
  135|      0|        return "OSSL_WINCTX: Undefined";
  136|  3.21k|#endif
  137|  3.21k|    }
  138|      0|    return "not available";
  139|  3.21k|}

ossl_get_enginesdir:
  168|    817|{
  169|       |#if defined(_WIN32) && defined(OSSL_WINCTX)
  170|       |    if (!RUN_ONCE(&defaults_setup_init, do_defaults_setup))
  171|       |        return NULL;
  172|       |    return (const char *)enginesdirptr;
  173|       |#else
  174|    817|    return ENGINESDIR;
  175|    817|#endif
  176|    817|}
ossl_get_modulesdir:
  184|    135|{
  185|       |#if defined(_WIN32) && defined(OSSL_WINCTX)
  186|       |    if (!RUN_ONCE(&defaults_setup_init, do_defaults_setup))
  187|       |        return NULL;
  188|       |    return (const char *)modulesdirptr;
  189|       |#else
  190|    135|    return MODULESDIR;
  191|    135|#endif
  192|    135|}

ossl_dh_params_todata:
   91|    228|{
   92|    228|    long l = DH_get_length(dh);
   93|       |
   94|    228|    if (!ossl_ffc_params_todata(ossl_dh_get0_params(dh), bld, params))
  ------------------
  |  Branch (94:9): [True: 0, False: 228]
  ------------------
   95|      0|        return 0;
   96|    228|    if (l > 0
  ------------------
  |  Branch (96:9): [True: 0, False: 228]
  ------------------
   97|      0|        && !ossl_param_build_set_long(bld, params, OSSL_PKEY_PARAM_DH_PRIV_LEN, l))
  ------------------
  |  |  373|      0|# define OSSL_PKEY_PARAM_DH_PRIV_LEN "priv_len"
  ------------------
  |  Branch (97:12): [True: 0, False: 0]
  ------------------
   98|      0|        return 0;
   99|    228|    return 1;
  100|    228|}
ossl_dh_key_todata:
  104|    228|{
  105|    228|    const BIGNUM *priv = NULL, *pub = NULL;
  106|       |
  107|    228|    if (dh == NULL)
  ------------------
  |  Branch (107:9): [True: 0, False: 228]
  ------------------
  108|      0|        return 0;
  109|       |
  110|    228|    DH_get0_key(dh, &pub, &priv);
  111|    228|    if (priv != NULL
  ------------------
  |  Branch (111:9): [True: 228, False: 0]
  ------------------
  112|    228|        && include_private
  ------------------
  |  Branch (112:12): [True: 228, False: 0]
  ------------------
  113|    228|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PRIV_KEY, priv))
  ------------------
  |  |  439|    228|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  |  Branch (113:12): [True: 0, False: 228]
  ------------------
  114|      0|        return 0;
  115|    228|    if (pub != NULL
  ------------------
  |  Branch (115:9): [True: 228, False: 0]
  ------------------
  116|    228|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_PUB_KEY, pub))
  ------------------
  |  |  441|    228|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  |  Branch (116:12): [True: 0, False: 228]
  ------------------
  117|      0|        return 0;
  118|       |
  119|    228|    return 1;
  120|    228|}

ossl_err_load_DH_strings:
   68|      1|{
   69|      1|#ifndef OPENSSL_NO_ERR
   70|      1|    if (ERR_reason_error_string(DH_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (70:9): [True: 1, False: 0]
  ------------------
   71|      1|        ERR_load_strings_const(DH_str_reasons);
   72|      1|#endif
   73|      1|    return 1;
   74|      1|}

ossl_dh_new_by_nid_ex:
   41|     76|{
   42|     76|    const DH_NAMED_GROUP *group;
   43|       |
   44|     76|    if ((group = ossl_ffc_uid_to_dh_named_group(nid)) != NULL)
  ------------------
  |  Branch (44:9): [True: 76, False: 0]
  ------------------
   45|     76|        return dh_param_init(libctx, group);
   46|       |
   47|     76|    ERR_raise(ERR_LIB_DH, DH_R_INVALID_PARAMETER_NID);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   48|       |    return NULL;
   49|     76|}
DH_get_nid:
   95|     76|{
   96|     76|    if (dh == NULL)
  ------------------
  |  Branch (96:9): [True: 0, False: 76]
  ------------------
   97|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
   98|       |
   99|     76|    return dh->params.nid;
  100|     76|}
dh_group_params.c:dh_param_init:
   28|     76|{
   29|     76|    DH *dh = ossl_dh_new_ex(libctx);
   30|       |
   31|     76|    if (dh == NULL)
  ------------------
  |  Branch (31:9): [True: 0, False: 76]
  ------------------
   32|      0|        return NULL;
   33|       |
   34|     76|    ossl_ffc_named_group_set(&dh->params, group);
   35|     76|    dh->params.nid = ossl_ffc_named_group_get_uid(group);
   36|     76|    dh->dirty_cnt++;
   37|     76|    return dh;
   38|     76|}

DH_get_default_method:
  185|     76|{
  186|     76|    return default_DH_method;
  187|     76|}
DH_generate_key:
  221|     76|{
  222|       |#ifdef FIPS_MODULE
  223|       |    return generate_key(dh);
  224|       |#else
  225|     76|    return dh->meth->generate_key(dh);
  226|     76|#endif
  227|     76|}
ossl_dh_generate_public_key:
  231|     76|{
  232|     76|    int ret = 0;
  233|     76|    BIGNUM *prk = BN_new();
  234|     76|    BN_MONT_CTX *mont = NULL;
  235|       |
  236|     76|    if (prk == NULL)
  ------------------
  |  Branch (236:9): [True: 0, False: 76]
  ------------------
  237|      0|        return 0;
  238|       |
  239|     76|    if (dh->flags & DH_FLAG_CACHE_MONT_P) {
  ------------------
  |  |  108|     76|#define DH_FLAG_CACHE_MONT_P 0x01
  ------------------
  |  Branch (239:9): [True: 76, False: 0]
  ------------------
  240|       |        /*
  241|       |         * We take the input DH as const, but we lie, because in some cases we
  242|       |         * want to get a hold of its Montgomery context.
  243|       |         *
  244|       |         * We cast to remove the const qualifier in this case, it should be
  245|       |         * fine...
  246|       |         */
  247|     76|        BN_MONT_CTX **pmont = (BN_MONT_CTX **)&dh->method_mont_p;
  248|       |
  249|     76|        mont = BN_MONT_CTX_set_locked(pmont, dh->lock, dh->params.p, ctx);
  250|     76|        if (mont == NULL)
  ------------------
  |  Branch (250:13): [True: 0, False: 76]
  ------------------
  251|      0|            goto err;
  252|     76|    }
  253|     76|    BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME);
  ------------------
  |  |   67|     76|#define BN_FLG_CONSTTIME 0x04
  ------------------
  254|       |
  255|       |    /* pub_key = g^priv_key mod p */
  256|     76|    if (!dh->meth->bn_mod_exp(dh, pub_key, dh->params.g, prk, dh->params.p,
  ------------------
  |  Branch (256:9): [True: 0, False: 76]
  ------------------
  257|     76|            ctx, mont))
  258|      0|        goto err;
  259|     76|    ret = 1;
  260|     76|err:
  261|     76|    BN_clear_free(prk);
  262|     76|    return ret;
  263|     76|}
ossl_dh_key2buf:
  419|    152|{
  420|    152|    const BIGNUM *pubkey;
  421|    152|    unsigned char *pbuf = NULL;
  422|    152|    const BIGNUM *p;
  423|    152|    int p_size;
  424|       |
  425|    152|    DH_get0_pqg(dh, &p, NULL, NULL);
  426|    152|    DH_get0_key(dh, &pubkey, NULL);
  427|    152|    if (p == NULL || pubkey == NULL
  ------------------
  |  Branch (427:9): [True: 0, False: 152]
  |  Branch (427:22): [True: 0, False: 152]
  ------------------
  428|    152|        || (p_size = BN_num_bytes(p)) == 0
  ------------------
  |  |  188|    152|#define BN_num_bytes(a) ((BN_num_bits(a) + 7) / 8)
  ------------------
  |  Branch (428:12): [True: 0, False: 152]
  ------------------
  429|    152|        || BN_num_bytes(pubkey) == 0) {
  ------------------
  |  |  188|    152|#define BN_num_bytes(a) ((BN_num_bits(a) + 7) / 8)
  ------------------
  |  Branch (429:12): [True: 0, False: 152]
  ------------------
  430|      0|        ERR_raise(ERR_LIB_DH, DH_R_INVALID_PUBKEY);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  431|      0|        return 0;
  432|      0|    }
  433|    152|    if (pbuf_out != NULL && (alloc || *pbuf_out != NULL)) {
  ------------------
  |  Branch (433:9): [True: 152, False: 0]
  |  Branch (433:30): [True: 0, False: 152]
  |  Branch (433:39): [True: 76, False: 76]
  ------------------
  434|     76|        if (!alloc) {
  ------------------
  |  Branch (434:13): [True: 76, False: 0]
  ------------------
  435|     76|            if (size >= (size_t)p_size)
  ------------------
  |  Branch (435:17): [True: 76, False: 0]
  ------------------
  436|     76|                pbuf = *pbuf_out;
  437|     76|            if (pbuf == NULL)
  ------------------
  |  Branch (437:17): [True: 0, False: 76]
  ------------------
  438|     76|                ERR_raise(ERR_LIB_DH, DH_R_INVALID_SIZE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  439|     76|        } else {
  440|      0|            pbuf = OPENSSL_malloc(p_size);
  ------------------
  |  |  106|      0|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  441|      0|        }
  442|       |
  443|       |        /* Errors raised above */
  444|     76|        if (pbuf == NULL)
  ------------------
  |  Branch (444:13): [True: 0, False: 76]
  ------------------
  445|      0|            return 0;
  446|       |        /*
  447|       |         * As per Section 4.2.8.1 of RFC 8446 left pad public
  448|       |         * key with zeros to the size of p
  449|       |         */
  450|     76|        if (BN_bn2binpad(pubkey, pbuf, p_size) < 0) {
  ------------------
  |  Branch (450:13): [True: 0, False: 76]
  ------------------
  451|      0|            if (alloc)
  ------------------
  |  Branch (451:17): [True: 0, False: 0]
  ------------------
  452|      0|                OPENSSL_free(pbuf);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  453|      0|            ERR_raise(ERR_LIB_DH, DH_R_BN_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  454|      0|            return 0;
  455|      0|        }
  456|     76|        *pbuf_out = pbuf;
  457|     76|    }
  458|    152|    return p_size;
  459|    152|}
dh_key.c:generate_key:
  266|     76|{
  267|     76|    int ok = 0;
  268|     76|    int generate_new_key = 0;
  269|     76|#ifndef FIPS_MODULE
  270|     76|    int l;
  271|     76|#endif
  272|     76|    BN_CTX *ctx = NULL;
  273|     76|    BIGNUM *pub_key = NULL, *priv_key = NULL;
  274|       |
  275|     76|    if (BN_num_bits(dh->params.p) > OPENSSL_DH_MAX_MODULUS_BITS) {
  ------------------
  |  |   99|     76|#define OPENSSL_DH_MAX_MODULUS_BITS 10000
  ------------------
  |  Branch (275:9): [True: 0, False: 76]
  ------------------
  276|      0|        ERR_raise(ERR_LIB_DH, DH_R_MODULUS_TOO_LARGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  277|      0|        return 0;
  278|      0|    }
  279|       |
  280|     76|    if (dh->params.q != NULL
  ------------------
  |  Branch (280:9): [True: 76, False: 0]
  ------------------
  281|     76|        && BN_num_bits(dh->params.q) > OPENSSL_DH_MAX_MODULUS_BITS) {
  ------------------
  |  |   99|     76|#define OPENSSL_DH_MAX_MODULUS_BITS 10000
  ------------------
  |  Branch (281:12): [True: 0, False: 76]
  ------------------
  282|      0|        ERR_raise(ERR_LIB_DH, DH_R_Q_TOO_LARGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  283|      0|        return 0;
  284|      0|    }
  285|       |
  286|     76|    if (BN_num_bits(dh->params.p) < DH_MIN_MODULUS_BITS) {
  ------------------
  |  |   14|     76|#define DH_MIN_MODULUS_BITS 512
  ------------------
  |  Branch (286:9): [True: 0, False: 76]
  ------------------
  287|      0|        ERR_raise(ERR_LIB_DH, DH_R_MODULUS_TOO_SMALL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  288|      0|        return 0;
  289|      0|    }
  290|       |
  291|     76|    ctx = BN_CTX_new_ex(dh->libctx);
  292|     76|    if (ctx == NULL)
  ------------------
  |  Branch (292:9): [True: 0, False: 76]
  ------------------
  293|      0|        goto err;
  294|       |
  295|     76|    if (dh->priv_key == NULL) {
  ------------------
  |  Branch (295:9): [True: 76, False: 0]
  ------------------
  296|     76|        priv_key = BN_secure_new();
  297|     76|        if (priv_key == NULL)
  ------------------
  |  Branch (297:13): [True: 0, False: 76]
  ------------------
  298|      0|            goto err;
  299|     76|        generate_new_key = 1;
  300|     76|    } else {
  301|      0|        priv_key = dh->priv_key;
  302|      0|    }
  303|       |
  304|     76|    if (dh->pub_key == NULL) {
  ------------------
  |  Branch (304:9): [True: 76, False: 0]
  ------------------
  305|     76|        pub_key = BN_new();
  306|     76|        if (pub_key == NULL)
  ------------------
  |  Branch (306:13): [True: 0, False: 76]
  ------------------
  307|      0|            goto err;
  308|     76|    } else {
  309|      0|        pub_key = dh->pub_key;
  310|      0|    }
  311|     76|    if (generate_new_key) {
  ------------------
  |  Branch (311:9): [True: 76, False: 0]
  ------------------
  312|       |        /* Is it an approved safe prime ?*/
  313|     76|        if (DH_get_nid(dh) != NID_undef) {
  ------------------
  |  |   18|     76|#define NID_undef                       0
  ------------------
  |  Branch (313:13): [True: 76, False: 0]
  ------------------
  314|     76|            int max_strength = ossl_ifc_ffc_compute_security_bits(BN_num_bits(dh->params.p));
  315|       |
  316|     76|            if (dh->params.q == NULL
  ------------------
  |  Branch (316:17): [True: 0, False: 76]
  ------------------
  317|     76|                || dh->length > BN_num_bits(dh->params.q))
  ------------------
  |  Branch (317:20): [True: 0, False: 76]
  ------------------
  318|      0|                goto err;
  319|       |            /* dh->length = maximum bit length of generated private key */
  320|     76|            if (!ossl_ffc_generate_private_key(ctx, &dh->params, dh->length,
  ------------------
  |  Branch (320:17): [True: 0, False: 76]
  ------------------
  321|     76|                    max_strength, priv_key))
  322|      0|                goto err;
  323|     76|        } else {
  324|       |#ifdef FIPS_MODULE
  325|       |            if (dh->params.q == NULL)
  326|       |                goto err;
  327|       |#else
  328|      0|            if (dh->params.q == NULL) {
  ------------------
  |  Branch (328:17): [True: 0, False: 0]
  ------------------
  329|       |                /* secret exponent length, must satisfy 2^l < (p-1)/2 */
  330|      0|                l = BN_num_bits(dh->params.p);
  331|      0|                if (dh->length >= l)
  ------------------
  |  Branch (331:21): [True: 0, False: 0]
  ------------------
  332|      0|                    goto err;
  333|      0|                l -= 2;
  334|      0|                if (dh->length != 0 && dh->length < l)
  ------------------
  |  Branch (334:21): [True: 0, False: 0]
  |  Branch (334:40): [True: 0, False: 0]
  ------------------
  335|      0|                    l = dh->length;
  336|      0|                if (!BN_priv_rand_ex(priv_key, l, BN_RAND_TOP_ONE,
  ------------------
  |  |   81|      0|#define BN_RAND_TOP_ONE 0
  ------------------
  |  Branch (336:21): [True: 0, False: 0]
  ------------------
  337|      0|                        BN_RAND_BOTTOM_ANY, 0, ctx))
  ------------------
  |  |   85|      0|#define BN_RAND_BOTTOM_ANY 0
  ------------------
  338|      0|                    goto err;
  339|       |                /*
  340|       |                 * We handle just one known case where g is a quadratic non-residue:
  341|       |                 * for g = 2: p % 8 == 3
  342|       |                 */
  343|      0|                if (BN_is_word(dh->params.g, DH_GENERATOR_2)
  ------------------
  |  |  147|      0|#define DH_GENERATOR_2 2
  ------------------
  |  Branch (343:21): [True: 0, False: 0]
  ------------------
  344|      0|                    && !BN_is_bit_set(dh->params.p, 2)) {
  ------------------
  |  Branch (344:24): [True: 0, False: 0]
  ------------------
  345|       |                    /* clear bit 0, since it won't be a secret anyway */
  346|      0|                    if (!BN_clear_bit(priv_key, 0))
  ------------------
  |  Branch (346:25): [True: 0, False: 0]
  ------------------
  347|      0|                        goto err;
  348|      0|                }
  349|      0|            } else
  350|      0|#endif
  351|      0|            {
  352|       |                /* Do a partial check for invalid p, q, g */
  353|      0|                if (!ossl_ffc_params_simple_validate(dh->libctx, &dh->params,
  ------------------
  |  Branch (353:21): [True: 0, False: 0]
  ------------------
  354|      0|                        FFC_PARAM_TYPE_DH, NULL))
  ------------------
  |  |   27|      0|#define FFC_PARAM_TYPE_DH 1
  ------------------
  355|      0|                    goto err;
  356|       |                /*
  357|       |                 * For FFC FIPS 186-4 keygen
  358|       |                 * security strength s = 112,
  359|       |                 * Max Private key size N = len(q)
  360|       |                 */
  361|      0|                if (!ossl_ffc_generate_private_key(ctx, &dh->params,
  ------------------
  |  Branch (361:21): [True: 0, False: 0]
  ------------------
  362|      0|                        BN_num_bits(dh->params.q),
  363|      0|                        MIN_STRENGTH,
  ------------------
  |  |   26|      0|#define MIN_STRENGTH 80
  ------------------
  364|      0|                        priv_key))
  365|      0|                    goto err;
  366|      0|            }
  367|      0|        }
  368|     76|    }
  369|       |
  370|     76|    if (!ossl_dh_generate_public_key(ctx, dh, priv_key, pub_key))
  ------------------
  |  Branch (370:9): [True: 0, False: 76]
  ------------------
  371|      0|        goto err;
  372|       |
  373|     76|    dh->pub_key = pub_key;
  374|     76|    dh->priv_key = priv_key;
  375|     76|    dh->dirty_cnt++;
  376|     76|    ok = 1;
  377|     76|err:
  378|     76|    if (ok != 1)
  ------------------
  |  Branch (378:9): [True: 0, False: 76]
  ------------------
  379|     76|        ERR_raise(ERR_LIB_DH, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  380|       |
  381|     76|    if (pub_key != dh->pub_key)
  ------------------
  |  Branch (381:9): [True: 0, False: 76]
  ------------------
  382|      0|        BN_free(pub_key);
  383|     76|    if (priv_key != dh->priv_key)
  ------------------
  |  Branch (383:9): [True: 0, False: 76]
  ------------------
  384|      0|        BN_free(priv_key);
  385|     76|    BN_CTX_free(ctx);
  386|     76|    return ok;
  387|     76|}
dh_key.c:dh_bn_mod_exp:
  192|     76|{
  193|       |#ifdef S390X_MOD_EXP
  194|       |    return s390x_mod_exp(r, a, p, m, ctx, m_ctx);
  195|       |#else
  196|     76|    return BN_mod_exp_mont(r, a, p, m, ctx, m_ctx);
  197|     76|#endif
  198|     76|}
dh_key.c:dh_init:
  201|     76|{
  202|     76|    dh->flags |= DH_FLAG_CACHE_MONT_P;
  ------------------
  |  |  108|     76|#define DH_FLAG_CACHE_MONT_P 0x01
  ------------------
  203|     76|    dh->dirty_cnt++;
  204|     76|    return 1;
  205|     76|}
dh_key.c:dh_finish:
  208|     76|{
  209|     76|    BN_MONT_CTX_free(dh->method_mont_p);
  210|     76|    return 1;
  211|     76|}

ossl_dh_new_ex:
   70|     76|{
   71|       |    return dh_new_intern(NULL, libctx);
   72|     76|}
DH_free:
  137|     76|{
  138|     76|    int i;
  139|       |
  140|     76|    if (r == NULL)
  ------------------
  |  Branch (140:9): [True: 0, False: 76]
  ------------------
  141|      0|        return;
  142|       |
  143|     76|    CRYPTO_DOWN_REF(&r->references, &i);
  144|     76|    REF_PRINT_COUNT("DH", i, r);
  ------------------
  |  |  301|     76|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|     76|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  297|     76|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  285|     76|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|     76|    if (i > 0)
  ------------------
  |  Branch (145:9): [True: 0, False: 76]
  ------------------
  146|      0|        return;
  147|     76|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|     76|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 76]
  |  |  ------------------
  ------------------
  148|       |
  149|     76|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (149:9): [True: 76, False: 0]
  |  Branch (149:28): [True: 76, False: 0]
  ------------------
  150|     76|        r->meth->finish(r);
  151|     76|#if !defined(FIPS_MODULE)
  152|     76|#if !defined(OPENSSL_NO_ENGINE)
  153|     76|    ENGINE_finish(r->engine);
  154|     76|#endif
  155|     76|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, r, &r->ex_data);
  ------------------
  |  |  256|     76|#define CRYPTO_EX_INDEX_DH 6
  ------------------
  156|     76|#endif
  157|       |
  158|     76|    CRYPTO_THREAD_lock_free(r->lock);
  159|     76|    CRYPTO_FREE_REF(&r->references);
  160|       |
  161|     76|    ossl_ffc_params_cleanup(&r->params);
  162|     76|    BN_clear_free(r->pub_key);
  163|     76|    BN_clear_free(r->priv_key);
  164|     76|    OPENSSL_free(r);
  ------------------
  |  |  131|     76|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  165|     76|}
DH_bits:
  197|     76|{
  198|     76|    if (dh->params.p != NULL)
  ------------------
  |  Branch (198:9): [True: 76, False: 0]
  ------------------
  199|     76|        return BN_num_bits(dh->params.p);
  200|      0|    return -1;
  201|     76|}
DH_size:
  204|     76|{
  205|     76|    if (dh->params.p != NULL)
  ------------------
  |  Branch (205:9): [True: 76, False: 0]
  ------------------
  206|     76|        return BN_num_bytes(dh->params.p);
  ------------------
  |  |  188|     76|#define BN_num_bytes(a) ((BN_num_bits(a) + 7) / 8)
  ------------------
  207|      0|    return -1;
  208|     76|}
DH_security_bits:
  211|     76|{
  212|     76|    int N;
  213|       |
  214|     76|    if (dh->params.q != NULL)
  ------------------
  |  Branch (214:9): [True: 76, False: 0]
  ------------------
  215|     76|        N = BN_num_bits(dh->params.q);
  216|      0|    else if (dh->length)
  ------------------
  |  Branch (216:14): [True: 0, False: 0]
  ------------------
  217|      0|        N = dh->length;
  218|      0|    else
  219|      0|        N = -1;
  220|     76|    if (dh->params.p != NULL)
  ------------------
  |  Branch (220:9): [True: 76, False: 0]
  ------------------
  221|     76|        return BN_security_bits(BN_num_bits(dh->params.p), N);
  222|      0|    return -1;
  223|     76|}
DH_get0_pqg:
  227|    152|{
  228|    152|    ossl_ffc_params_get0_pqg(&dh->params, p, q, g);
  229|    152|}
DH_get_length:
  248|    228|{
  249|    228|    return dh->length;
  250|    228|}
DH_get0_key:
  260|    380|{
  261|    380|    if (pub_key != NULL)
  ------------------
  |  Branch (261:9): [True: 380, False: 0]
  ------------------
  262|    380|        *pub_key = dh->pub_key;
  263|    380|    if (priv_key != NULL)
  ------------------
  |  Branch (263:9): [True: 228, False: 152]
  ------------------
  264|    228|        *priv_key = dh->priv_key;
  265|    380|}
DH_clear_flags:
  308|     76|{
  309|     76|    dh->flags &= ~flags;
  310|     76|}
DH_set_flags:
  318|     76|{
  319|     76|    dh->flags |= flags;
  320|     76|}
ossl_dh_get0_params:
  330|    304|{
  331|    304|    return &dh->params;
  332|    304|}
dh_lib.c:dh_new_intern:
   75|     76|{
   76|     76|    DH *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|     76|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|       |
   78|     76|    if (ret == NULL)
  ------------------
  |  Branch (78:9): [True: 0, False: 76]
  ------------------
   79|      0|        return NULL;
   80|       |
   81|     76|    ret->lock = CRYPTO_THREAD_lock_new();
   82|     76|    if (ret->lock == NULL) {
  ------------------
  |  Branch (82:9): [True: 0, False: 76]
  ------------------
   83|      0|        ERR_raise(ERR_LIB_DH, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   84|      0|        OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   85|      0|        return NULL;
   86|      0|    }
   87|       |
   88|     76|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (88:9): [True: 0, False: 76]
  ------------------
   89|      0|        CRYPTO_THREAD_lock_free(ret->lock);
   90|      0|        OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   91|      0|        return NULL;
   92|      0|    }
   93|       |
   94|     76|    ret->libctx = libctx;
   95|     76|    ret->meth = DH_get_default_method();
   96|     76|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
   97|     76|    ret->flags = ret->meth->flags; /* early default init */
   98|     76|    if (engine) {
  ------------------
  |  Branch (98:9): [True: 0, False: 76]
  ------------------
   99|      0|        if (!ENGINE_init(engine)) {
  ------------------
  |  Branch (99:13): [True: 0, False: 0]
  ------------------
  100|      0|            ERR_raise(ERR_LIB_DH, ERR_R_ENGINE_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  101|      0|            goto err;
  102|      0|        }
  103|      0|        ret->engine = engine;
  104|      0|    } else
  105|     76|        ret->engine = ENGINE_get_default_DH();
  106|     76|    if (ret->engine) {
  ------------------
  |  Branch (106:9): [True: 0, False: 76]
  ------------------
  107|      0|        ret->meth = ENGINE_get_DH(ret->engine);
  108|      0|        if (ret->meth == NULL) {
  ------------------
  |  Branch (108:13): [True: 0, False: 0]
  ------------------
  109|      0|            ERR_raise(ERR_LIB_DH, ERR_R_ENGINE_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  110|      0|            goto err;
  111|      0|        }
  112|      0|    }
  113|     76|#endif
  114|       |
  115|     76|    ret->flags = ret->meth->flags;
  116|       |
  117|     76|#ifndef FIPS_MODULE
  118|     76|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data))
  ------------------
  |  |  256|     76|#define CRYPTO_EX_INDEX_DH 6
  ------------------
  |  Branch (118:9): [True: 0, False: 76]
  ------------------
  119|      0|        goto err;
  120|     76|#endif /* FIPS_MODULE */
  121|       |
  122|     76|    ossl_ffc_params_init(&ret->params);
  123|       |
  124|     76|    if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
  ------------------
  |  Branch (124:9): [True: 76, False: 0]
  |  Branch (124:38): [True: 0, False: 76]
  ------------------
  125|      0|        ERR_raise(ERR_LIB_DH, ERR_R_INIT_FAIL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  126|      0|        goto err;
  127|      0|    }
  128|       |
  129|     76|    return ret;
  130|       |
  131|      0|err:
  132|      0|    DH_free(ret);
  133|       |    return NULL;
  134|     76|}

dsa_ameth.c:int_dsa_free:
  267|  2.47k|{
  268|  2.47k|    DSA_free(pkey->pkey.dsa);
  269|  2.47k|}

ossl_err_load_DSA_strings:
   46|      1|{
   47|      1|#ifndef OPENSSL_NO_ERR
   48|      1|    if (ERR_reason_error_string(DSA_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (48:9): [True: 1, False: 0]
  ------------------
   49|      1|        ERR_load_strings_const(DSA_str_reasons);
   50|      1|#endif
   51|      1|    return 1;
   52|      1|}

DSA_free:
  213|  2.47k|{
  214|  2.47k|    int i;
  215|       |
  216|  2.47k|    if (r == NULL)
  ------------------
  |  Branch (216:9): [True: 2.47k, False: 0]
  ------------------
  217|  2.47k|        return;
  218|       |
  219|      0|    CRYPTO_DOWN_REF(&r->references, &i);
  220|      0|    REF_PRINT_COUNT("DSA", i, r);
  ------------------
  |  |  301|      0|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|      0|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  297|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  285|      0|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  221|      0|    if (i > 0)
  ------------------
  |  Branch (221:9): [True: 0, False: 0]
  ------------------
  222|      0|        return;
  223|      0|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|      0|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  224|       |
  225|      0|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (225:9): [True: 0, False: 0]
  |  Branch (225:28): [True: 0, False: 0]
  ------------------
  226|      0|        r->meth->finish(r);
  227|      0|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
  228|      0|    ENGINE_finish(r->engine);
  229|      0|#endif
  230|       |
  231|      0|#ifndef FIPS_MODULE
  232|      0|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, r, &r->ex_data);
  ------------------
  |  |  257|      0|#define CRYPTO_EX_INDEX_DSA 7
  ------------------
  233|      0|#endif
  234|       |
  235|      0|    CRYPTO_THREAD_lock_free(r->lock);
  236|      0|    CRYPTO_FREE_REF(&r->references);
  237|       |
  238|      0|    ossl_ffc_params_cleanup(&r->params);
  239|      0|    BN_clear_free(r->pub_key);
  240|      0|    BN_clear_free(r->priv_key);
  241|      0|    OPENSSL_free(r);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  242|      0|}

DSO_METHOD_openssl:
   62|    952|{
   63|    952|    return &dso_meth_dlfcn;
   64|    952|}
dso_dlfcn.c:dlfcn_load:
   94|    952|{
   95|    952|    void *ptr = NULL;
   96|       |    /* See applicable comments in dso_dl.c */
   97|    952|    char *filename = DSO_convert_filename(dso, NULL);
   98|    952|    int flags = DLOPEN_FLAG;
  ------------------
  |  |   85|    952|#define DLOPEN_FLAG RTLD_NOW /* Hope this works everywhere else */
  ------------------
   99|    952|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|    952|#define get_last_sys_error() errno
  ------------------
  100|       |
  101|    952|    if (filename == NULL) {
  ------------------
  |  Branch (101:9): [True: 0, False: 952]
  ------------------
  102|      0|        ERR_raise(ERR_LIB_DSO, DSO_R_NO_FILENAME);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  103|      0|        goto err;
  104|      0|    }
  105|    952|#ifdef RTLD_GLOBAL
  106|    952|    if (dso->flags & DSO_FLAG_GLOBAL_SYMBOLS)
  ------------------
  |  |   53|    952|#define DSO_FLAG_GLOBAL_SYMBOLS 0x20
  ------------------
  |  Branch (106:9): [True: 0, False: 952]
  ------------------
  107|      0|        flags |= RTLD_GLOBAL;
  108|    952|#endif
  109|       |#ifdef _AIX
  110|       |    if (filename[strlen(filename) - 1] == ')')
  111|       |        flags |= RTLD_MEMBER;
  112|       |#endif
  113|    952|    ptr = dlopen(filename, flags);
  114|    952|    if (ptr == NULL) {
  ------------------
  |  Branch (114:9): [True: 952, False: 0]
  ------------------
  115|    952|        ERR_raise_data(ERR_LIB_DSO, DSO_R_LOAD_FAILED,
  ------------------
  |  |  406|    952|    (ERR_new(),                                                  \
  |  |  407|    952|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|    952|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|    952|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_DSO, DSO_R_LOAD_FAILED,
  ------------------
  |  |  100|    952|#define ERR_LIB_DSO 37
  ------------------
                      ERR_raise_data(ERR_LIB_DSO, DSO_R_LOAD_FAILED,
  ------------------
  |  |   34|    952|#define DSO_R_LOAD_FAILED 103
  ------------------
  116|    952|            "filename(%s): %s", filename, dlerror());
  117|    952|        goto err;
  118|    952|    }
  119|       |    /*
  120|       |     * Some dlopen() implementations (e.g. solaris) do no preserve errno, even
  121|       |     * on a successful call.
  122|       |     */
  123|    952|    set_sys_error(saveerrno);
  ------------------
  |  |   32|    952|#define set_sys_error(e) errno = (e)
  ------------------
  124|      0|    if (!sk_void_push(dso->meth_data, (char *)ptr)) {
  ------------------
  |  |  229|      0|#define sk_void_push(sk, ptr) OPENSSL_sk_push(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr))
  ------------------
  |  Branch (124:9): [True: 0, False: 0]
  ------------------
  125|      0|        ERR_raise(ERR_LIB_DSO, DSO_R_STACK_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  126|      0|        goto err;
  127|      0|    }
  128|       |    /* Success */
  129|      0|    dso->loaded_filename = filename;
  130|      0|    return 1;
  131|    952|err:
  132|       |    /* Cleanup! */
  133|    952|    OPENSSL_free(filename);
  ------------------
  |  |  131|    952|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  134|    952|    if (ptr != NULL)
  ------------------
  |  Branch (134:9): [True: 0, False: 952]
  ------------------
  135|      0|        dlclose(ptr);
  136|    952|    return 0;
  137|      0|}
dso_dlfcn.c:dlfcn_unload:
  140|    952|{
  141|    952|    void *ptr;
  142|    952|    if (dso == NULL) {
  ------------------
  |  Branch (142:9): [True: 0, False: 952]
  ------------------
  143|      0|        ERR_raise(ERR_LIB_DSO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  144|      0|        return 0;
  145|      0|    }
  146|    952|    if (sk_void_num(dso->meth_data) < 1)
  ------------------
  |  |  219|    952|#define sk_void_num(sk) OPENSSL_sk_num(ossl_check_const_void_sk_type(sk))
  ------------------
  |  Branch (146:9): [True: 952, False: 0]
  ------------------
  147|    952|        return 1;
  148|      0|    ptr = sk_void_pop(dso->meth_data);
  ------------------
  |  |  231|      0|#define sk_void_pop(sk) ((void *)OPENSSL_sk_pop(ossl_check_void_sk_type(sk)))
  ------------------
  149|      0|    if (ptr == NULL) {
  ------------------
  |  Branch (149:9): [True: 0, False: 0]
  ------------------
  150|      0|        ERR_raise(ERR_LIB_DSO, DSO_R_NULL_HANDLE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  151|       |        /*
  152|       |         * Should push the value back onto the stack in case of a retry.
  153|       |         */
  154|      0|        sk_void_push(dso->meth_data, ptr);
  ------------------
  |  |  229|      0|#define sk_void_push(sk, ptr) OPENSSL_sk_push(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr))
  ------------------
  155|      0|        return 0;
  156|      0|    }
  157|       |    /* For now I'm not aware of any errors associated with dlclose() */
  158|      0|    dlclose(ptr);
  159|      0|    return 1;
  160|      0|}
dso_dlfcn.c:dlfcn_name_converter:
  245|  1.90k|{
  246|  1.90k|    char *translated;
  247|  1.90k|    int len, rsize, transform;
  248|       |
  249|  1.90k|    len = strlen(filename);
  250|  1.90k|    rsize = len + 1;
  251|  1.90k|    transform = (strchr(filename, '/') == NULL);
  252|  1.90k|    if (transform) {
  ------------------
  |  Branch (252:9): [True: 889, False: 1.01k]
  ------------------
  253|       |        /* We will convert this to "%s.so" or "lib%s.so" etc */
  254|    889|        rsize += strlen(DSO_EXTENSION); /* The length of ".so" */
  ------------------
  |  |   23|    889|# define DSO_EXTENSION ".so"
  ------------------
  255|    889|        if ((DSO_flags(dso) & DSO_FLAG_NAME_TRANSLATION_EXT_ONLY) == 0)
  ------------------
  |  |   41|    889|#define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY 0x02
  ------------------
  |  Branch (255:13): [True: 0, False: 889]
  ------------------
  256|      0|            rsize += 3; /* The length of "lib" */
  257|    889|    }
  258|  1.90k|    translated = OPENSSL_malloc(rsize);
  ------------------
  |  |  106|  1.90k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  259|  1.90k|    if (translated == NULL) {
  ------------------
  |  Branch (259:9): [True: 0, False: 1.90k]
  ------------------
  260|      0|        ERR_raise(ERR_LIB_DSO, DSO_R_NAME_TRANSLATION_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  261|      0|        return NULL;
  262|      0|    }
  263|  1.90k|    if (transform) {
  ------------------
  |  Branch (263:9): [True: 889, False: 1.01k]
  ------------------
  264|    889|        if ((DSO_flags(dso) & DSO_FLAG_NAME_TRANSLATION_EXT_ONLY) == 0)
  ------------------
  |  |   41|    889|#define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY 0x02
  ------------------
  |  Branch (264:13): [True: 0, False: 889]
  ------------------
  265|      0|            BIO_snprintf(translated, rsize, "lib%s" DSO_EXTENSION, filename);
  ------------------
  |  |   23|      0|# define DSO_EXTENSION ".so"
  ------------------
  266|    889|        else
  267|    889|            BIO_snprintf(translated, rsize, "%s" DSO_EXTENSION, filename);
  ------------------
  |  |   23|    889|# define DSO_EXTENSION ".so"
  ------------------
  268|  1.01k|    } else {
  269|  1.01k|        BIO_snprintf(translated, rsize, "%s", filename);
  270|  1.01k|    }
  271|  1.90k|    return translated;
  272|  1.90k|}
dso_dlfcn.c:dlfcn_merger:
  194|    952|{
  195|    952|    char *merged;
  196|       |
  197|    952|    if (!filespec1 && !filespec2) {
  ------------------
  |  Branch (197:9): [True: 0, False: 952]
  |  Branch (197:23): [True: 0, False: 0]
  ------------------
  198|      0|        ERR_raise(ERR_LIB_DSO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  199|      0|        return NULL;
  200|      0|    }
  201|       |    /*
  202|       |     * If the first file specification is a rooted path, it rules. same goes
  203|       |     * if the second file specification is missing.
  204|       |     */
  205|    952|    if (!filespec2 || (filespec1 != NULL && filespec1[0] == '/')) {
  ------------------
  |  Branch (205:9): [True: 0, False: 952]
  |  Branch (205:24): [True: 952, False: 0]
  |  Branch (205:45): [True: 7, False: 945]
  ------------------
  206|      7|        merged = OPENSSL_strdup(filespec1);
  ------------------
  |  |  135|      7|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  207|      7|        if (merged == NULL)
  ------------------
  |  Branch (207:13): [True: 0, False: 7]
  ------------------
  208|      0|            return NULL;
  209|      7|    }
  210|       |    /*
  211|       |     * If the first file specification is missing, the second one rules.
  212|       |     */
  213|    945|    else if (!filespec1) {
  ------------------
  |  Branch (213:14): [True: 0, False: 945]
  ------------------
  214|      0|        merged = OPENSSL_strdup(filespec2);
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  215|      0|        if (merged == NULL)
  ------------------
  |  Branch (215:13): [True: 0, False: 0]
  ------------------
  216|      0|            return NULL;
  217|    945|    } else {
  218|       |        /*
  219|       |         * This part isn't as trivial as it looks.  It assumes that the
  220|       |         * second file specification really is a directory, and makes no
  221|       |         * checks whatsoever.  Therefore, the result becomes the
  222|       |         * concatenation of filespec2 followed by a slash followed by
  223|       |         * filespec1.
  224|       |         */
  225|    945|        int spec2len, len;
  226|       |
  227|    945|        spec2len = strlen(filespec2);
  228|    945|        len = spec2len + strlen(filespec1);
  229|       |
  230|    945|        if (spec2len && filespec2[spec2len - 1] == '/') {
  ------------------
  |  Branch (230:13): [True: 945, False: 0]
  |  Branch (230:25): [True: 0, False: 945]
  ------------------
  231|      0|            spec2len--;
  232|      0|            len--;
  233|      0|        }
  234|    945|        merged = OPENSSL_malloc(len + 2);
  ------------------
  |  |  106|    945|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  235|    945|        if (merged == NULL)
  ------------------
  |  Branch (235:13): [True: 0, False: 945]
  ------------------
  236|      0|            return NULL;
  237|    945|        strcpy(merged, filespec2);
  238|    945|        merged[spec2len] = '/';
  239|    945|        strcpy(&merged[spec2len + 1], filespec1);
  240|    945|    }
  241|    952|    return merged;
  242|    952|}

ossl_err_load_DSO_strings:
   50|      1|{
   51|      1|#ifndef OPENSSL_NO_ERR
   52|      1|    if (ERR_reason_error_string(DSO_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (52:9): [True: 1, False: 0]
  ------------------
   53|      1|        ERR_load_strings_const(DSO_str_reasons);
   54|      1|#endif
   55|      1|    return 1;
   56|      1|}

DSO_new:
   43|    952|{
   44|       |    return DSO_new_method(NULL);
   45|    952|}
DSO_free:
   48|  3.34k|{
   49|  3.34k|    int i;
   50|       |
   51|  3.34k|    if (dso == NULL)
  ------------------
  |  Branch (51:9): [True: 2.38k, False: 952]
  ------------------
   52|  2.38k|        return 1;
   53|       |
   54|    952|    if (CRYPTO_DOWN_REF(&dso->references, &i) <= 0)
  ------------------
  |  Branch (54:9): [True: 0, False: 952]
  ------------------
   55|      0|        return 0;
   56|       |
   57|    952|    REF_PRINT_COUNT("DSO", i, dso);
  ------------------
  |  |  301|    952|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|    952|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  297|    952|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  285|    952|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   58|    952|    if (i > 0)
  ------------------
  |  Branch (58:9): [True: 0, False: 952]
  ------------------
   59|      0|        return 1;
   60|    952|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|    952|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 952]
  |  |  ------------------
  ------------------
   61|       |
   62|    952|    if ((dso->flags & DSO_FLAG_NO_UNLOAD_ON_FREE) == 0) {
  ------------------
  |  |   46|    952|#define DSO_FLAG_NO_UNLOAD_ON_FREE 0x04
  ------------------
  |  Branch (62:9): [True: 952, False: 0]
  ------------------
   63|    952|        if ((dso->meth->dso_unload != NULL) && !dso->meth->dso_unload(dso)) {
  ------------------
  |  Branch (63:13): [True: 952, False: 0]
  |  Branch (63:48): [True: 0, False: 952]
  ------------------
   64|      0|            ERR_raise(ERR_LIB_DSO, DSO_R_UNLOAD_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   65|      0|            return 0;
   66|      0|        }
   67|    952|    }
   68|       |
   69|    952|    if ((dso->meth->finish != NULL) && !dso->meth->finish(dso)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 952]
  |  Branch (69:40): [True: 0, False: 0]
  ------------------
   70|      0|        ERR_raise(ERR_LIB_DSO, DSO_R_FINISH_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   71|      0|        return 0;
   72|      0|    }
   73|       |
   74|    952|    sk_void_free(dso->meth_data);
  ------------------
  |  |  225|    952|#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
  ------------------
   75|    952|    OPENSSL_free(dso->filename);
  ------------------
  |  |  131|    952|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   76|    952|    OPENSSL_free(dso->loaded_filename);
  ------------------
  |  |  131|    952|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|    952|    CRYPTO_FREE_REF(&dso->references);
   78|    952|    OPENSSL_free(dso);
  ------------------
  |  |  131|    952|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|    952|    return 1;
   80|    952|}
DSO_flags:
   83|  1.77k|{
   84|  1.77k|    return ((dso == NULL) ? 0 : dso->flags);
  ------------------
  |  Branch (84:13): [True: 0, False: 1.77k]
  ------------------
   85|  1.77k|}
DSO_load:
  105|    952|{
  106|    952|    DSO *ret;
  107|    952|    int allocated = 0;
  108|       |
  109|    952|    if (dso == NULL) {
  ------------------
  |  Branch (109:9): [True: 0, False: 952]
  ------------------
  110|      0|        ret = DSO_new_method(meth);
  111|      0|        if (ret == NULL) {
  ------------------
  |  Branch (111:13): [True: 0, False: 0]
  ------------------
  112|      0|            ERR_raise(ERR_LIB_DSO, ERR_R_DSO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  113|      0|            goto err;
  114|      0|        }
  115|      0|        allocated = 1;
  116|       |        /* Pass the provided flags to the new DSO object */
  117|      0|        if (DSO_ctrl(ret, DSO_CTRL_SET_FLAGS, flags, NULL) < 0) {
  ------------------
  |  |   19|      0|#define DSO_CTRL_SET_FLAGS 2
  ------------------
  |  Branch (117:13): [True: 0, False: 0]
  ------------------
  118|      0|            ERR_raise(ERR_LIB_DSO, DSO_R_CTRL_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  119|      0|            goto err;
  120|      0|        }
  121|      0|    } else
  122|    952|        ret = dso;
  123|       |    /* Don't load if we're currently already loaded */
  124|    952|    if (ret->filename != NULL) {
  ------------------
  |  Branch (124:9): [True: 0, False: 952]
  ------------------
  125|      0|        ERR_raise(ERR_LIB_DSO, DSO_R_DSO_ALREADY_LOADED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  126|      0|        goto err;
  127|      0|    }
  128|       |    /*
  129|       |     * filename can only be NULL if we were passed a dso that already has one
  130|       |     * set.
  131|       |     */
  132|    952|    if (filename != NULL)
  ------------------
  |  Branch (132:9): [True: 952, False: 0]
  ------------------
  133|    952|        if (!DSO_set_filename(ret, filename)) {
  ------------------
  |  Branch (133:13): [True: 0, False: 952]
  ------------------
  134|      0|            ERR_raise(ERR_LIB_DSO, DSO_R_SET_FILENAME_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  135|      0|            goto err;
  136|      0|        }
  137|    952|    filename = ret->filename;
  138|    952|    if (filename == NULL) {
  ------------------
  |  Branch (138:9): [True: 0, False: 952]
  ------------------
  139|      0|        ERR_raise(ERR_LIB_DSO, DSO_R_NO_FILENAME);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  140|      0|        goto err;
  141|      0|    }
  142|    952|    if (ret->meth->dso_load == NULL) {
  ------------------
  |  Branch (142:9): [True: 0, False: 952]
  ------------------
  143|      0|        ERR_raise(ERR_LIB_DSO, DSO_R_UNSUPPORTED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  144|      0|        goto err;
  145|      0|    }
  146|    952|    if (!ret->meth->dso_load(ret)) {
  ------------------
  |  Branch (146:9): [True: 952, False: 0]
  ------------------
  147|    952|        ERR_raise(ERR_LIB_DSO, DSO_R_LOAD_FAILED);
  ------------------
  |  |  404|    952|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|    952|    (ERR_new(),                                                  \
  |  |  |  |  407|    952|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|    952|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|    952|        ERR_set_error)
  |  |  ------------------
  ------------------
  148|    952|        goto err;
  149|    952|    }
  150|       |    /* Load succeeded */
  151|      0|    return ret;
  152|    952|err:
  153|    952|    if (allocated)
  ------------------
  |  Branch (153:9): [True: 0, False: 952]
  ------------------
  154|      0|        DSO_free(ret);
  155|       |    return NULL;
  156|    952|}
DSO_ctrl:
  188|    952|{
  189|    952|    if (dso == NULL) {
  ------------------
  |  Branch (189:9): [True: 0, False: 952]
  ------------------
  190|      0|        ERR_raise(ERR_LIB_DSO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  191|      0|        return -1;
  192|      0|    }
  193|       |    /*
  194|       |     * We should intercept certain generic commands and only pass control to
  195|       |     * the method-specific ctrl() function if it's something we don't handle.
  196|       |     */
  197|    952|    switch (cmd) {
  198|      0|    case DSO_CTRL_GET_FLAGS:
  ------------------
  |  |   18|      0|#define DSO_CTRL_GET_FLAGS 1
  ------------------
  |  Branch (198:5): [True: 0, False: 952]
  ------------------
  199|      0|        return dso->flags;
  200|    952|    case DSO_CTRL_SET_FLAGS:
  ------------------
  |  |   19|    952|#define DSO_CTRL_SET_FLAGS 2
  ------------------
  |  Branch (200:5): [True: 952, False: 0]
  ------------------
  201|    952|        dso->flags = (int)larg;
  202|    952|        return 0;
  203|      0|    case DSO_CTRL_OR_FLAGS:
  ------------------
  |  |   20|      0|#define DSO_CTRL_OR_FLAGS 3
  ------------------
  |  Branch (203:5): [True: 0, False: 952]
  ------------------
  204|      0|        dso->flags |= (int)larg;
  205|      0|        return 0;
  206|      0|    default:
  ------------------
  |  Branch (206:5): [True: 0, False: 952]
  ------------------
  207|      0|        break;
  208|    952|    }
  209|      0|    if ((dso->meth == NULL) || (dso->meth->dso_ctrl == NULL)) {
  ------------------
  |  Branch (209:9): [True: 0, False: 0]
  |  Branch (209:32): [True: 0, False: 0]
  ------------------
  210|      0|        ERR_raise(ERR_LIB_DSO, DSO_R_UNSUPPORTED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  211|      0|        return -1;
  212|      0|    }
  213|      0|    return dso->meth->dso_ctrl(dso, cmd, larg, parg);
  214|      0|}
DSO_set_filename:
  226|    952|{
  227|    952|    char *copied;
  228|       |
  229|    952|    if ((dso == NULL) || (filename == NULL)) {
  ------------------
  |  Branch (229:9): [True: 0, False: 952]
  |  Branch (229:26): [True: 0, False: 952]
  ------------------
  230|      0|        ERR_raise(ERR_LIB_DSO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  231|      0|        return 0;
  232|      0|    }
  233|    952|    if (dso->loaded_filename) {
  ------------------
  |  Branch (233:9): [True: 0, False: 952]
  ------------------
  234|      0|        ERR_raise(ERR_LIB_DSO, DSO_R_DSO_ALREADY_LOADED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  235|      0|        return 0;
  236|      0|    }
  237|       |    /* We'll duplicate filename */
  238|    952|    copied = OPENSSL_strdup(filename);
  ------------------
  |  |  135|    952|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  239|    952|    if (copied == NULL)
  ------------------
  |  Branch (239:9): [True: 0, False: 952]
  ------------------
  240|      0|        return 0;
  241|    952|    OPENSSL_free(dso->filename);
  ------------------
  |  |  131|    952|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  242|    952|    dso->filename = copied;
  243|    952|    return 1;
  244|    952|}
DSO_merge:
  247|    952|{
  248|    952|    char *result = NULL;
  249|       |
  250|    952|    if (dso == NULL || filespec1 == NULL) {
  ------------------
  |  Branch (250:9): [True: 0, False: 952]
  |  Branch (250:24): [True: 0, False: 952]
  ------------------
  251|      0|        ERR_raise(ERR_LIB_DSO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  252|      0|        return NULL;
  253|      0|    }
  254|    952|    if ((dso->flags & DSO_FLAG_NO_NAME_TRANSLATION) == 0) {
  ------------------
  |  |   33|    952|#define DSO_FLAG_NO_NAME_TRANSLATION 0x01
  ------------------
  |  Branch (254:9): [True: 952, False: 0]
  ------------------
  255|    952|        if (dso->merger != NULL)
  ------------------
  |  Branch (255:13): [True: 0, False: 952]
  ------------------
  256|      0|            result = dso->merger(dso, filespec1, filespec2);
  257|    952|        else if (dso->meth->dso_merger != NULL)
  ------------------
  |  Branch (257:18): [True: 952, False: 0]
  ------------------
  258|    952|            result = dso->meth->dso_merger(dso, filespec1, filespec2);
  259|    952|    }
  260|    952|    return result;
  261|    952|}
DSO_convert_filename:
  264|  1.90k|{
  265|  1.90k|    char *result = NULL;
  266|       |
  267|  1.90k|    if (dso == NULL) {
  ------------------
  |  Branch (267:9): [True: 0, False: 1.90k]
  ------------------
  268|      0|        ERR_raise(ERR_LIB_DSO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  269|      0|        return NULL;
  270|      0|    }
  271|  1.90k|    if (filename == NULL)
  ------------------
  |  Branch (271:9): [True: 952, False: 952]
  ------------------
  272|    952|        filename = dso->filename;
  273|  1.90k|    if (filename == NULL) {
  ------------------
  |  Branch (273:9): [True: 0, False: 1.90k]
  ------------------
  274|      0|        ERR_raise(ERR_LIB_DSO, DSO_R_NO_FILENAME);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  275|      0|        return NULL;
  276|      0|    }
  277|  1.90k|    if ((dso->flags & DSO_FLAG_NO_NAME_TRANSLATION) == 0) {
  ------------------
  |  |   33|  1.90k|#define DSO_FLAG_NO_NAME_TRANSLATION 0x01
  ------------------
  |  Branch (277:9): [True: 1.90k, False: 0]
  ------------------
  278|  1.90k|        if (dso->name_converter != NULL)
  ------------------
  |  Branch (278:13): [True: 0, False: 1.90k]
  ------------------
  279|      0|            result = dso->name_converter(dso, filename);
  280|  1.90k|        else if (dso->meth->dso_name_converter != NULL)
  ------------------
  |  Branch (280:18): [True: 1.90k, False: 0]
  ------------------
  281|  1.90k|            result = dso->meth->dso_name_converter(dso, filename);
  282|  1.90k|    }
  283|  1.90k|    if (result == NULL) {
  ------------------
  |  Branch (283:9): [True: 0, False: 1.90k]
  ------------------
  284|      0|        result = OPENSSL_strdup(filename);
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  285|      0|        if (result == NULL)
  ------------------
  |  Branch (285:13): [True: 0, False: 0]
  ------------------
  286|      0|            return NULL;
  287|      0|    }
  288|  1.90k|    return result;
  289|  1.90k|}
dso_lib.c:DSO_new_method:
   14|    952|{
   15|    952|    DSO *ret;
   16|       |
   17|    952|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|    952|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   18|    952|    if (ret == NULL)
  ------------------
  |  Branch (18:9): [True: 0, False: 952]
  ------------------
   19|      0|        return NULL;
   20|    952|    ret->meth_data = sk_void_new_null();
  ------------------
  |  |  222|    952|#define sk_void_new_null() ((STACK_OF(void) *)OPENSSL_sk_new_null())
  ------------------
   21|    952|    if (ret->meth_data == NULL) {
  ------------------
  |  Branch (21:9): [True: 0, False: 952]
  ------------------
   22|       |        /* sk_new doesn't generate any errors so we do */
   23|      0|        ERR_raise(ERR_LIB_DSO, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   24|      0|        OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   25|      0|        return NULL;
   26|      0|    }
   27|    952|    ret->meth = DSO_METHOD_openssl();
   28|    952|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (28:9): [True: 0, False: 952]
  ------------------
   29|      0|        sk_void_free(ret->meth_data);
  ------------------
  |  |  225|      0|#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
  ------------------
   30|      0|        OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   31|      0|        return NULL;
   32|      0|    }
   33|       |
   34|    952|    if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
  ------------------
  |  Branch (34:9): [True: 0, False: 952]
  |  Branch (34:38): [True: 0, False: 0]
  ------------------
   35|      0|        DSO_free(ret);
   36|      0|        ret = NULL;
   37|      0|    }
   38|       |
   39|    952|    return ret;
   40|    952|}

ossl_x25519_public_from_private:
 5855|  2.64k|{
 5856|  2.64k|    uint8_t e[32];
 5857|  2.64k|    ge_p3 A;
 5858|  2.64k|    fe zplusy, zminusy, zminusy_inv;
 5859|       |
 5860|  2.64k|    memcpy(e, private_key, 32);
 5861|  2.64k|    e[0] &= 248;
 5862|  2.64k|    e[31] &= 127;
 5863|  2.64k|    e[31] |= 64;
 5864|       |
 5865|  2.64k|    ge_scalarmult_base(&A, e);
 5866|       |
 5867|       |    /*
 5868|       |     * We only need the u-coordinate of the curve25519 point.
 5869|       |     * The map is u=(y+1)/(1-y). Since y=Y/Z, this gives
 5870|       |     * u=(Z+Y)/(Z-Y).
 5871|       |     */
 5872|  2.64k|    fe_add(zplusy, A.Z, A.Y);
 5873|  2.64k|    fe_sub(zminusy, A.Z, A.Y);
 5874|  2.64k|    fe_invert(zminusy_inv, zminusy);
 5875|  2.64k|    fe_mul(zplusy, zplusy, zminusy_inv);
 5876|  2.64k|    fe_tobytes(out_public_value, zplusy);
 5877|       |
 5878|  2.64k|    OPENSSL_cleanse(e, sizeof(e));
 5879|  2.64k|}
curve25519.c:ge_scalarmult_base:
 4366|  2.64k|{
 4367|  2.64k|    signed char e[64];
 4368|  2.64k|    signed char carry;
 4369|  2.64k|    ge_p1p1 r;
 4370|  2.64k|    ge_p2 s;
 4371|  2.64k|    ge_precomp t;
 4372|  2.64k|    int i;
 4373|       |
 4374|  87.3k|    for (i = 0; i < 32; ++i) {
  ------------------
  |  Branch (4374:17): [True: 84.6k, False: 2.64k]
  ------------------
 4375|  84.6k|        e[2 * i + 0] = (a[i] >> 0) & 15;
 4376|  84.6k|        e[2 * i + 1] = (a[i] >> 4) & 15;
 4377|  84.6k|    }
 4378|       |    /* each e[i] is between 0 and 15 */
 4379|       |    /* e[63] is between 0 and 7 */
 4380|       |
 4381|  2.64k|    carry = 0;
 4382|   169k|    for (i = 0; i < 63; ++i) {
  ------------------
  |  Branch (4382:17): [True: 166k, False: 2.64k]
  ------------------
 4383|   166k|        e[i] += carry;
 4384|   166k|        carry = e[i] + 8;
 4385|   166k|        carry >>= 4;
 4386|   166k|        e[i] -= carry << 4;
 4387|   166k|    }
 4388|  2.64k|    e[63] += carry;
 4389|       |    /* each e[i] is between -8 and 8 */
 4390|       |
 4391|  2.64k|    ge_p3_0(h);
 4392|  87.3k|    for (i = 1; i < 64; i += 2) {
  ------------------
  |  Branch (4392:17): [True: 84.6k, False: 2.64k]
  ------------------
 4393|  84.6k|        table_select(&t, i / 2, e[i]);
 4394|  84.6k|        ge_madd(&r, h, &t);
 4395|  84.6k|        ge_p1p1_to_p3(h, &r);
 4396|  84.6k|    }
 4397|       |
 4398|  2.64k|    ge_p3_dbl(&r, h);
 4399|  2.64k|    ge_p1p1_to_p2(&s, &r);
 4400|  2.64k|    ge_p2_dbl(&r, &s);
 4401|  2.64k|    ge_p1p1_to_p2(&s, &r);
 4402|  2.64k|    ge_p2_dbl(&r, &s);
 4403|  2.64k|    ge_p1p1_to_p2(&s, &r);
 4404|  2.64k|    ge_p2_dbl(&r, &s);
 4405|  2.64k|    ge_p1p1_to_p3(h, &r);
 4406|       |
 4407|  87.3k|    for (i = 0; i < 64; i += 2) {
  ------------------
  |  Branch (4407:17): [True: 84.6k, False: 2.64k]
  ------------------
 4408|  84.6k|        table_select(&t, i / 2, e[i]);
 4409|  84.6k|        ge_madd(&r, h, &t);
 4410|  84.6k|        ge_p1p1_to_p3(h, &r);
 4411|  84.6k|    }
 4412|       |
 4413|  2.64k|    OPENSSL_cleanse(e, sizeof(e));
 4414|  2.64k|}
curve25519.c:ge_p3_0:
 2046|  2.64k|{
 2047|  2.64k|    fe_0(h->X);
 2048|  2.64k|    fe_1(h->Y);
 2049|  2.64k|    fe_1(h->Z);
 2050|  2.64k|    fe_0(h->T);
 2051|  2.64k|}
curve25519.c:fe_0:
 1022|   174k|{
 1023|   174k|    memset(h, 0, sizeof(int32_t) * 10);
 1024|   174k|}
curve25519.c:fe_1:
 1028|   343k|{
 1029|   343k|    memset(h, 0, sizeof(int32_t) * 10);
 1030|   343k|    h[0] = 1;
 1031|   343k|}
curve25519.c:table_select:
 4336|   169k|{
 4337|   169k|    ge_precomp minust;
 4338|   169k|    uint8_t bnegative = negative(b);
 4339|   169k|    uint8_t babs = b - ((uint8_t)((-bnegative) & b) << 1);
 4340|       |
 4341|   169k|    ge_precomp_0(t);
 4342|   169k|    cmov(t, &k25519Precomp[pos][0], equal(babs, 1));
 4343|   169k|    cmov(t, &k25519Precomp[pos][1], equal(babs, 2));
 4344|   169k|    cmov(t, &k25519Precomp[pos][2], equal(babs, 3));
 4345|   169k|    cmov(t, &k25519Precomp[pos][3], equal(babs, 4));
 4346|   169k|    cmov(t, &k25519Precomp[pos][4], equal(babs, 5));
 4347|   169k|    cmov(t, &k25519Precomp[pos][5], equal(babs, 6));
 4348|   169k|    cmov(t, &k25519Precomp[pos][6], equal(babs, 7));
 4349|   169k|    cmov(t, &k25519Precomp[pos][7], equal(babs, 8));
 4350|   169k|    fe_copy(minust.yplusx, t->yminusx);
 4351|   169k|    fe_copy(minust.yminusx, t->yplusx);
 4352|   169k|    fe_neg(minust.xy2d, t->xy2d);
 4353|   169k|    cmov(t, &minust, bnegative);
 4354|   169k|}
curve25519.c:negative:
 4328|   169k|{
 4329|   169k|    uint32_t x = b;
 4330|       |
 4331|   169k|    x >>= 31; /* 1: yes; 0: no */
 4332|   169k|    return x;
 4333|   169k|}
curve25519.c:ge_precomp_0:
 2054|   169k|{
 2055|   169k|    fe_1(h->yplusx);
 2056|   169k|    fe_1(h->yminusx);
 2057|   169k|    fe_0(h->xy2d);
 2058|   169k|}
curve25519.c:cmov:
 2205|  1.52M|{
 2206|  1.52M|    fe_cmov(t->yplusx, u->yplusx, b);
 2207|  1.52M|    fe_cmov(t->yminusx, u->yminusx, b);
 2208|  1.52M|    fe_cmov(t->xy2d, u->xy2d, b);
 2209|  1.52M|}
curve25519.c:fe_cmov:
 1636|  4.57M|{
 1637|  4.57M|    size_t i;
 1638|       |
 1639|  4.57M|    b = 0 - b;
 1640|  50.2M|    for (i = 0; i < 10; i++) {
  ------------------
  |  Branch (1640:17): [True: 45.7M, False: 4.57M]
  ------------------
 1641|  45.7M|        int32_t x = f[i] ^ g[i];
 1642|  45.7M|        x &= b;
 1643|  45.7M|        f[i] ^= x;
 1644|  45.7M|    }
 1645|  4.57M|}
curve25519.c:equal:
 2194|  1.35M|{
 2195|  1.35M|    uint8_t ub = b;
 2196|  1.35M|    uint8_t uc = c;
 2197|  1.35M|    uint8_t x = ub ^ uc; /* 0: yes; 1..255: no */
 2198|  1.35M|    uint32_t y = x; /* 0: yes; 1..255: no */
 2199|  1.35M|    y -= 1; /* 4294967295: yes; 0..254: no */
 2200|  1.35M|    y >>= 31; /* 1: yes; 0: no */
 2201|  1.35M|    return y;
 2202|  1.35M|}
curve25519.c:fe_copy:
 1016|   346k|{
 1017|   346k|    memmove(h, f, sizeof(int32_t) * 10);
 1018|   346k|}
curve25519.c:ge_madd:
 2125|   169k|{
 2126|   169k|    fe t0;
 2127|       |
 2128|   169k|    fe_add(r->X, p->Y, p->X);
 2129|   169k|    fe_sub(r->Y, p->Y, p->X);
 2130|   169k|    fe_mul(r->Z, r->X, q->yplusx);
 2131|   169k|    fe_mul(r->Y, r->Y, q->yminusx);
 2132|   169k|    fe_mul(r->T, q->xy2d, p->T);
 2133|   169k|    fe_add(t0, p->Z, p->Z);
 2134|   169k|    fe_sub(r->X, r->Z, r->Y);
 2135|   169k|    fe_add(r->Y, r->Z, r->Y);
 2136|   169k|    fe_add(r->Z, t0, r->T);
 2137|   169k|    fe_sub(r->T, t0, r->T);
 2138|   169k|}
curve25519.c:ge_p1p1_to_p3:
 2092|   171k|{
 2093|   171k|    fe_mul(r->X, p->X, p->T);
 2094|   171k|    fe_mul(r->Y, p->Y, p->Z);
 2095|   171k|    fe_mul(r->Z, p->Z, p->T);
 2096|   171k|    fe_mul(r->T, p->X, p->Y);
 2097|   171k|}
curve25519.c:ge_p3_dbl:
 2117|  2.64k|{
 2118|  2.64k|    ge_p2 q;
 2119|  2.64k|    ge_p3_to_p2(&q, p);
 2120|  2.64k|    ge_p2_dbl(r, &q);
 2121|  2.64k|}
curve25519.c:ge_p3_to_p2:
 2062|  2.64k|{
 2063|  2.64k|    fe_copy(r->X, p->X);
 2064|  2.64k|    fe_copy(r->Y, p->Y);
 2065|  2.64k|    fe_copy(r->Z, p->Z);
 2066|  2.64k|}
curve25519.c:ge_p1p1_to_p2:
 2084|  7.93k|{
 2085|  7.93k|    fe_mul(r->X, p->X, p->T);
 2086|  7.93k|    fe_mul(r->Y, p->Y, p->Z);
 2087|  7.93k|    fe_mul(r->Z, p->Z, p->T);
 2088|  7.93k|}
curve25519.c:ge_p2_dbl:
 2101|  10.5k|{
 2102|  10.5k|    fe t0;
 2103|       |
 2104|  10.5k|    fe_sq(r->X, p->X);
 2105|  10.5k|    fe_sq(r->Z, p->Y);
 2106|  10.5k|    fe_sq2(r->T, p->Z);
 2107|  10.5k|    fe_add(r->Y, p->X, p->Y);
 2108|  10.5k|    fe_sq(t0, r->Y);
 2109|  10.5k|    fe_add(r->Y, r->Z, r->X);
 2110|  10.5k|    fe_sub(r->Z, r->Z, r->X);
 2111|  10.5k|    fe_sub(r->X, t0, r->Y);
 2112|  10.5k|    fe_sub(r->T, r->T, r->Z);
 2113|  10.5k|}
curve25519.c:fe_sq:
 1360|   703k|{
 1361|   703k|    int32_t f0 = f[0];
 1362|   703k|    int32_t f1 = f[1];
 1363|   703k|    int32_t f2 = f[2];
 1364|   703k|    int32_t f3 = f[3];
 1365|   703k|    int32_t f4 = f[4];
 1366|   703k|    int32_t f5 = f[5];
 1367|   703k|    int32_t f6 = f[6];
 1368|   703k|    int32_t f7 = f[7];
 1369|   703k|    int32_t f8 = f[8];
 1370|   703k|    int32_t f9 = f[9];
 1371|   703k|    int32_t f0_2 = 2 * f0;
 1372|   703k|    int32_t f1_2 = 2 * f1;
 1373|   703k|    int32_t f2_2 = 2 * f2;
 1374|   703k|    int32_t f3_2 = 2 * f3;
 1375|   703k|    int32_t f4_2 = 2 * f4;
 1376|   703k|    int32_t f5_2 = 2 * f5;
 1377|   703k|    int32_t f6_2 = 2 * f6;
 1378|   703k|    int32_t f7_2 = 2 * f7;
 1379|   703k|    int32_t f5_38 = 38 * f5; /* 1.959375*2^30 */
 1380|   703k|    int32_t f6_19 = 19 * f6; /* 1.959375*2^30 */
 1381|   703k|    int32_t f7_38 = 38 * f7; /* 1.959375*2^30 */
 1382|   703k|    int32_t f8_19 = 19 * f8; /* 1.959375*2^30 */
 1383|   703k|    int32_t f9_38 = 38 * f9; /* 1.959375*2^30 */
 1384|   703k|    int64_t f0f0 = f0 * (int64_t)f0;
 1385|   703k|    int64_t f0f1_2 = f0_2 * (int64_t)f1;
 1386|   703k|    int64_t f0f2_2 = f0_2 * (int64_t)f2;
 1387|   703k|    int64_t f0f3_2 = f0_2 * (int64_t)f3;
 1388|   703k|    int64_t f0f4_2 = f0_2 * (int64_t)f4;
 1389|   703k|    int64_t f0f5_2 = f0_2 * (int64_t)f5;
 1390|   703k|    int64_t f0f6_2 = f0_2 * (int64_t)f6;
 1391|   703k|    int64_t f0f7_2 = f0_2 * (int64_t)f7;
 1392|   703k|    int64_t f0f8_2 = f0_2 * (int64_t)f8;
 1393|   703k|    int64_t f0f9_2 = f0_2 * (int64_t)f9;
 1394|   703k|    int64_t f1f1_2 = f1_2 * (int64_t)f1;
 1395|   703k|    int64_t f1f2_2 = f1_2 * (int64_t)f2;
 1396|   703k|    int64_t f1f3_4 = f1_2 * (int64_t)f3_2;
 1397|   703k|    int64_t f1f4_2 = f1_2 * (int64_t)f4;
 1398|   703k|    int64_t f1f5_4 = f1_2 * (int64_t)f5_2;
 1399|   703k|    int64_t f1f6_2 = f1_2 * (int64_t)f6;
 1400|   703k|    int64_t f1f7_4 = f1_2 * (int64_t)f7_2;
 1401|   703k|    int64_t f1f8_2 = f1_2 * (int64_t)f8;
 1402|   703k|    int64_t f1f9_76 = f1_2 * (int64_t)f9_38;
 1403|   703k|    int64_t f2f2 = f2 * (int64_t)f2;
 1404|   703k|    int64_t f2f3_2 = f2_2 * (int64_t)f3;
 1405|   703k|    int64_t f2f4_2 = f2_2 * (int64_t)f4;
 1406|   703k|    int64_t f2f5_2 = f2_2 * (int64_t)f5;
 1407|   703k|    int64_t f2f6_2 = f2_2 * (int64_t)f6;
 1408|   703k|    int64_t f2f7_2 = f2_2 * (int64_t)f7;
 1409|   703k|    int64_t f2f8_38 = f2_2 * (int64_t)f8_19;
 1410|   703k|    int64_t f2f9_38 = f2 * (int64_t)f9_38;
 1411|   703k|    int64_t f3f3_2 = f3_2 * (int64_t)f3;
 1412|   703k|    int64_t f3f4_2 = f3_2 * (int64_t)f4;
 1413|   703k|    int64_t f3f5_4 = f3_2 * (int64_t)f5_2;
 1414|   703k|    int64_t f3f6_2 = f3_2 * (int64_t)f6;
 1415|   703k|    int64_t f3f7_76 = f3_2 * (int64_t)f7_38;
 1416|   703k|    int64_t f3f8_38 = f3_2 * (int64_t)f8_19;
 1417|   703k|    int64_t f3f9_76 = f3_2 * (int64_t)f9_38;
 1418|   703k|    int64_t f4f4 = f4 * (int64_t)f4;
 1419|   703k|    int64_t f4f5_2 = f4_2 * (int64_t)f5;
 1420|   703k|    int64_t f4f6_38 = f4_2 * (int64_t)f6_19;
 1421|   703k|    int64_t f4f7_38 = f4 * (int64_t)f7_38;
 1422|   703k|    int64_t f4f8_38 = f4_2 * (int64_t)f8_19;
 1423|   703k|    int64_t f4f9_38 = f4 * (int64_t)f9_38;
 1424|   703k|    int64_t f5f5_38 = f5 * (int64_t)f5_38;
 1425|   703k|    int64_t f5f6_38 = f5_2 * (int64_t)f6_19;
 1426|   703k|    int64_t f5f7_76 = f5_2 * (int64_t)f7_38;
 1427|   703k|    int64_t f5f8_38 = f5_2 * (int64_t)f8_19;
 1428|   703k|    int64_t f5f9_76 = f5_2 * (int64_t)f9_38;
 1429|   703k|    int64_t f6f6_19 = f6 * (int64_t)f6_19;
 1430|   703k|    int64_t f6f7_38 = f6 * (int64_t)f7_38;
 1431|   703k|    int64_t f6f8_38 = f6_2 * (int64_t)f8_19;
 1432|   703k|    int64_t f6f9_38 = f6 * (int64_t)f9_38;
 1433|   703k|    int64_t f7f7_38 = f7 * (int64_t)f7_38;
 1434|   703k|    int64_t f7f8_38 = f7_2 * (int64_t)f8_19;
 1435|   703k|    int64_t f7f9_76 = f7_2 * (int64_t)f9_38;
 1436|   703k|    int64_t f8f8_19 = f8 * (int64_t)f8_19;
 1437|   703k|    int64_t f8f9_38 = f8 * (int64_t)f9_38;
 1438|   703k|    int64_t f9f9_38 = f9 * (int64_t)f9_38;
 1439|   703k|    int64_t h0 = f0f0 + f1f9_76 + f2f8_38 + f3f7_76 + f4f6_38 + f5f5_38;
 1440|   703k|    int64_t h1 = f0f1_2 + f2f9_38 + f3f8_38 + f4f7_38 + f5f6_38;
 1441|   703k|    int64_t h2 = f0f2_2 + f1f1_2 + f3f9_76 + f4f8_38 + f5f7_76 + f6f6_19;
 1442|   703k|    int64_t h3 = f0f3_2 + f1f2_2 + f4f9_38 + f5f8_38 + f6f7_38;
 1443|   703k|    int64_t h4 = f0f4_2 + f1f3_4 + f2f2 + f5f9_76 + f6f8_38 + f7f7_38;
 1444|   703k|    int64_t h5 = f0f5_2 + f1f4_2 + f2f3_2 + f6f9_38 + f7f8_38;
 1445|   703k|    int64_t h6 = f0f6_2 + f1f5_4 + f2f4_2 + f3f3_2 + f7f9_76 + f8f8_19;
 1446|   703k|    int64_t h7 = f0f7_2 + f1f6_2 + f2f5_2 + f3f4_2 + f8f9_38;
 1447|   703k|    int64_t h8 = f0f8_2 + f1f7_4 + f2f6_2 + f3f5_4 + f4f4 + f9f9_38;
 1448|   703k|    int64_t h9 = f0f9_2 + f1f8_2 + f2f7_2 + f3f6_2 + f4f5_2;
 1449|   703k|    int64_t carry0;
 1450|   703k|    int64_t carry1;
 1451|   703k|    int64_t carry2;
 1452|   703k|    int64_t carry3;
 1453|   703k|    int64_t carry4;
 1454|   703k|    int64_t carry5;
 1455|   703k|    int64_t carry6;
 1456|   703k|    int64_t carry7;
 1457|   703k|    int64_t carry8;
 1458|   703k|    int64_t carry9;
 1459|       |
 1460|   703k|    carry0 = h0 + (1 << 25);
 1461|   703k|    h1 += carry0 >> 26;
 1462|   703k|    h0 -= carry0 & kTop38Bits;
 1463|   703k|    carry4 = h4 + (1 << 25);
 1464|   703k|    h5 += carry4 >> 26;
 1465|   703k|    h4 -= carry4 & kTop38Bits;
 1466|       |
 1467|   703k|    carry1 = h1 + (1 << 24);
 1468|   703k|    h2 += carry1 >> 25;
 1469|   703k|    h1 -= carry1 & kTop39Bits;
 1470|   703k|    carry5 = h5 + (1 << 24);
 1471|   703k|    h6 += carry5 >> 25;
 1472|   703k|    h5 -= carry5 & kTop39Bits;
 1473|       |
 1474|   703k|    carry2 = h2 + (1 << 25);
 1475|   703k|    h3 += carry2 >> 26;
 1476|   703k|    h2 -= carry2 & kTop38Bits;
 1477|   703k|    carry6 = h6 + (1 << 25);
 1478|   703k|    h7 += carry6 >> 26;
 1479|   703k|    h6 -= carry6 & kTop38Bits;
 1480|       |
 1481|   703k|    carry3 = h3 + (1 << 24);
 1482|   703k|    h4 += carry3 >> 25;
 1483|   703k|    h3 -= carry3 & kTop39Bits;
 1484|   703k|    carry7 = h7 + (1 << 24);
 1485|   703k|    h8 += carry7 >> 25;
 1486|   703k|    h7 -= carry7 & kTop39Bits;
 1487|       |
 1488|   703k|    carry4 = h4 + (1 << 25);
 1489|   703k|    h5 += carry4 >> 26;
 1490|   703k|    h4 -= carry4 & kTop38Bits;
 1491|   703k|    carry8 = h8 + (1 << 25);
 1492|   703k|    h9 += carry8 >> 26;
 1493|   703k|    h8 -= carry8 & kTop38Bits;
 1494|       |
 1495|   703k|    carry9 = h9 + (1 << 24);
 1496|   703k|    h0 += (carry9 >> 25) * 19;
 1497|   703k|    h9 -= carry9 & kTop39Bits;
 1498|       |
 1499|   703k|    carry0 = h0 + (1 << 25);
 1500|   703k|    h1 += carry0 >> 26;
 1501|   703k|    h0 -= carry0 & kTop38Bits;
 1502|       |
 1503|   703k|    h[0] = (int32_t)h0;
 1504|   703k|    h[1] = (int32_t)h1;
 1505|   703k|    h[2] = (int32_t)h2;
 1506|   703k|    h[3] = (int32_t)h3;
 1507|   703k|    h[4] = (int32_t)h4;
 1508|   703k|    h[5] = (int32_t)h5;
 1509|   703k|    h[6] = (int32_t)h6;
 1510|   703k|    h[7] = (int32_t)h7;
 1511|   703k|    h[8] = (int32_t)h8;
 1512|   703k|    h[9] = (int32_t)h9;
 1513|   703k|}
curve25519.c:fe_sq2:
 1693|  10.5k|{
 1694|  10.5k|    int32_t f0 = f[0];
 1695|  10.5k|    int32_t f1 = f[1];
 1696|  10.5k|    int32_t f2 = f[2];
 1697|  10.5k|    int32_t f3 = f[3];
 1698|  10.5k|    int32_t f4 = f[4];
 1699|  10.5k|    int32_t f5 = f[5];
 1700|  10.5k|    int32_t f6 = f[6];
 1701|  10.5k|    int32_t f7 = f[7];
 1702|  10.5k|    int32_t f8 = f[8];
 1703|  10.5k|    int32_t f9 = f[9];
 1704|  10.5k|    int32_t f0_2 = 2 * f0;
 1705|  10.5k|    int32_t f1_2 = 2 * f1;
 1706|  10.5k|    int32_t f2_2 = 2 * f2;
 1707|  10.5k|    int32_t f3_2 = 2 * f3;
 1708|  10.5k|    int32_t f4_2 = 2 * f4;
 1709|  10.5k|    int32_t f5_2 = 2 * f5;
 1710|  10.5k|    int32_t f6_2 = 2 * f6;
 1711|  10.5k|    int32_t f7_2 = 2 * f7;
 1712|  10.5k|    int32_t f5_38 = 38 * f5; /* 1.959375*2^30 */
 1713|  10.5k|    int32_t f6_19 = 19 * f6; /* 1.959375*2^30 */
 1714|  10.5k|    int32_t f7_38 = 38 * f7; /* 1.959375*2^30 */
 1715|  10.5k|    int32_t f8_19 = 19 * f8; /* 1.959375*2^30 */
 1716|  10.5k|    int32_t f9_38 = 38 * f9; /* 1.959375*2^30 */
 1717|  10.5k|    int64_t f0f0 = f0 * (int64_t)f0;
 1718|  10.5k|    int64_t f0f1_2 = f0_2 * (int64_t)f1;
 1719|  10.5k|    int64_t f0f2_2 = f0_2 * (int64_t)f2;
 1720|  10.5k|    int64_t f0f3_2 = f0_2 * (int64_t)f3;
 1721|  10.5k|    int64_t f0f4_2 = f0_2 * (int64_t)f4;
 1722|  10.5k|    int64_t f0f5_2 = f0_2 * (int64_t)f5;
 1723|  10.5k|    int64_t f0f6_2 = f0_2 * (int64_t)f6;
 1724|  10.5k|    int64_t f0f7_2 = f0_2 * (int64_t)f7;
 1725|  10.5k|    int64_t f0f8_2 = f0_2 * (int64_t)f8;
 1726|  10.5k|    int64_t f0f9_2 = f0_2 * (int64_t)f9;
 1727|  10.5k|    int64_t f1f1_2 = f1_2 * (int64_t)f1;
 1728|  10.5k|    int64_t f1f2_2 = f1_2 * (int64_t)f2;
 1729|  10.5k|    int64_t f1f3_4 = f1_2 * (int64_t)f3_2;
 1730|  10.5k|    int64_t f1f4_2 = f1_2 * (int64_t)f4;
 1731|  10.5k|    int64_t f1f5_4 = f1_2 * (int64_t)f5_2;
 1732|  10.5k|    int64_t f1f6_2 = f1_2 * (int64_t)f6;
 1733|  10.5k|    int64_t f1f7_4 = f1_2 * (int64_t)f7_2;
 1734|  10.5k|    int64_t f1f8_2 = f1_2 * (int64_t)f8;
 1735|  10.5k|    int64_t f1f9_76 = f1_2 * (int64_t)f9_38;
 1736|  10.5k|    int64_t f2f2 = f2 * (int64_t)f2;
 1737|  10.5k|    int64_t f2f3_2 = f2_2 * (int64_t)f3;
 1738|  10.5k|    int64_t f2f4_2 = f2_2 * (int64_t)f4;
 1739|  10.5k|    int64_t f2f5_2 = f2_2 * (int64_t)f5;
 1740|  10.5k|    int64_t f2f6_2 = f2_2 * (int64_t)f6;
 1741|  10.5k|    int64_t f2f7_2 = f2_2 * (int64_t)f7;
 1742|  10.5k|    int64_t f2f8_38 = f2_2 * (int64_t)f8_19;
 1743|  10.5k|    int64_t f2f9_38 = f2 * (int64_t)f9_38;
 1744|  10.5k|    int64_t f3f3_2 = f3_2 * (int64_t)f3;
 1745|  10.5k|    int64_t f3f4_2 = f3_2 * (int64_t)f4;
 1746|  10.5k|    int64_t f3f5_4 = f3_2 * (int64_t)f5_2;
 1747|  10.5k|    int64_t f3f6_2 = f3_2 * (int64_t)f6;
 1748|  10.5k|    int64_t f3f7_76 = f3_2 * (int64_t)f7_38;
 1749|  10.5k|    int64_t f3f8_38 = f3_2 * (int64_t)f8_19;
 1750|  10.5k|    int64_t f3f9_76 = f3_2 * (int64_t)f9_38;
 1751|  10.5k|    int64_t f4f4 = f4 * (int64_t)f4;
 1752|  10.5k|    int64_t f4f5_2 = f4_2 * (int64_t)f5;
 1753|  10.5k|    int64_t f4f6_38 = f4_2 * (int64_t)f6_19;
 1754|  10.5k|    int64_t f4f7_38 = f4 * (int64_t)f7_38;
 1755|  10.5k|    int64_t f4f8_38 = f4_2 * (int64_t)f8_19;
 1756|  10.5k|    int64_t f4f9_38 = f4 * (int64_t)f9_38;
 1757|  10.5k|    int64_t f5f5_38 = f5 * (int64_t)f5_38;
 1758|  10.5k|    int64_t f5f6_38 = f5_2 * (int64_t)f6_19;
 1759|  10.5k|    int64_t f5f7_76 = f5_2 * (int64_t)f7_38;
 1760|  10.5k|    int64_t f5f8_38 = f5_2 * (int64_t)f8_19;
 1761|  10.5k|    int64_t f5f9_76 = f5_2 * (int64_t)f9_38;
 1762|  10.5k|    int64_t f6f6_19 = f6 * (int64_t)f6_19;
 1763|  10.5k|    int64_t f6f7_38 = f6 * (int64_t)f7_38;
 1764|  10.5k|    int64_t f6f8_38 = f6_2 * (int64_t)f8_19;
 1765|  10.5k|    int64_t f6f9_38 = f6 * (int64_t)f9_38;
 1766|  10.5k|    int64_t f7f7_38 = f7 * (int64_t)f7_38;
 1767|  10.5k|    int64_t f7f8_38 = f7_2 * (int64_t)f8_19;
 1768|  10.5k|    int64_t f7f9_76 = f7_2 * (int64_t)f9_38;
 1769|  10.5k|    int64_t f8f8_19 = f8 * (int64_t)f8_19;
 1770|  10.5k|    int64_t f8f9_38 = f8 * (int64_t)f9_38;
 1771|  10.5k|    int64_t f9f9_38 = f9 * (int64_t)f9_38;
 1772|  10.5k|    int64_t h0 = f0f0 + f1f9_76 + f2f8_38 + f3f7_76 + f4f6_38 + f5f5_38;
 1773|  10.5k|    int64_t h1 = f0f1_2 + f2f9_38 + f3f8_38 + f4f7_38 + f5f6_38;
 1774|  10.5k|    int64_t h2 = f0f2_2 + f1f1_2 + f3f9_76 + f4f8_38 + f5f7_76 + f6f6_19;
 1775|  10.5k|    int64_t h3 = f0f3_2 + f1f2_2 + f4f9_38 + f5f8_38 + f6f7_38;
 1776|  10.5k|    int64_t h4 = f0f4_2 + f1f3_4 + f2f2 + f5f9_76 + f6f8_38 + f7f7_38;
 1777|  10.5k|    int64_t h5 = f0f5_2 + f1f4_2 + f2f3_2 + f6f9_38 + f7f8_38;
 1778|  10.5k|    int64_t h6 = f0f6_2 + f1f5_4 + f2f4_2 + f3f3_2 + f7f9_76 + f8f8_19;
 1779|  10.5k|    int64_t h7 = f0f7_2 + f1f6_2 + f2f5_2 + f3f4_2 + f8f9_38;
 1780|  10.5k|    int64_t h8 = f0f8_2 + f1f7_4 + f2f6_2 + f3f5_4 + f4f4 + f9f9_38;
 1781|  10.5k|    int64_t h9 = f0f9_2 + f1f8_2 + f2f7_2 + f3f6_2 + f4f5_2;
 1782|  10.5k|    int64_t carry0;
 1783|  10.5k|    int64_t carry1;
 1784|  10.5k|    int64_t carry2;
 1785|  10.5k|    int64_t carry3;
 1786|  10.5k|    int64_t carry4;
 1787|  10.5k|    int64_t carry5;
 1788|  10.5k|    int64_t carry6;
 1789|  10.5k|    int64_t carry7;
 1790|  10.5k|    int64_t carry8;
 1791|  10.5k|    int64_t carry9;
 1792|       |
 1793|  10.5k|    h0 += h0;
 1794|  10.5k|    h1 += h1;
 1795|  10.5k|    h2 += h2;
 1796|  10.5k|    h3 += h3;
 1797|  10.5k|    h4 += h4;
 1798|  10.5k|    h5 += h5;
 1799|  10.5k|    h6 += h6;
 1800|  10.5k|    h7 += h7;
 1801|  10.5k|    h8 += h8;
 1802|  10.5k|    h9 += h9;
 1803|       |
 1804|  10.5k|    carry0 = h0 + (1 << 25);
 1805|  10.5k|    h1 += carry0 >> 26;
 1806|  10.5k|    h0 -= carry0 & kTop38Bits;
 1807|  10.5k|    carry4 = h4 + (1 << 25);
 1808|  10.5k|    h5 += carry4 >> 26;
 1809|  10.5k|    h4 -= carry4 & kTop38Bits;
 1810|       |
 1811|  10.5k|    carry1 = h1 + (1 << 24);
 1812|  10.5k|    h2 += carry1 >> 25;
 1813|  10.5k|    h1 -= carry1 & kTop39Bits;
 1814|  10.5k|    carry5 = h5 + (1 << 24);
 1815|  10.5k|    h6 += carry5 >> 25;
 1816|  10.5k|    h5 -= carry5 & kTop39Bits;
 1817|       |
 1818|  10.5k|    carry2 = h2 + (1 << 25);
 1819|  10.5k|    h3 += carry2 >> 26;
 1820|  10.5k|    h2 -= carry2 & kTop38Bits;
 1821|  10.5k|    carry6 = h6 + (1 << 25);
 1822|  10.5k|    h7 += carry6 >> 26;
 1823|  10.5k|    h6 -= carry6 & kTop38Bits;
 1824|       |
 1825|  10.5k|    carry3 = h3 + (1 << 24);
 1826|  10.5k|    h4 += carry3 >> 25;
 1827|  10.5k|    h3 -= carry3 & kTop39Bits;
 1828|  10.5k|    carry7 = h7 + (1 << 24);
 1829|  10.5k|    h8 += carry7 >> 25;
 1830|  10.5k|    h7 -= carry7 & kTop39Bits;
 1831|       |
 1832|  10.5k|    carry4 = h4 + (1 << 25);
 1833|  10.5k|    h5 += carry4 >> 26;
 1834|  10.5k|    h4 -= carry4 & kTop38Bits;
 1835|  10.5k|    carry8 = h8 + (1 << 25);
 1836|  10.5k|    h9 += carry8 >> 26;
 1837|  10.5k|    h8 -= carry8 & kTop38Bits;
 1838|       |
 1839|  10.5k|    carry9 = h9 + (1 << 24);
 1840|  10.5k|    h0 += (carry9 >> 25) * 19;
 1841|  10.5k|    h9 -= carry9 & kTop39Bits;
 1842|       |
 1843|  10.5k|    carry0 = h0 + (1 << 25);
 1844|  10.5k|    h1 += carry0 >> 26;
 1845|  10.5k|    h0 -= carry0 & kTop38Bits;
 1846|       |
 1847|  10.5k|    h[0] = (int32_t)h0;
 1848|  10.5k|    h[1] = (int32_t)h1;
 1849|  10.5k|    h[2] = (int32_t)h2;
 1850|  10.5k|    h[3] = (int32_t)h3;
 1851|  10.5k|    h[4] = (int32_t)h4;
 1852|  10.5k|    h[5] = (int32_t)h5;
 1853|  10.5k|    h[6] = (int32_t)h6;
 1854|  10.5k|    h[7] = (int32_t)h7;
 1855|  10.5k|    h[8] = (int32_t)h8;
 1856|  10.5k|    h[9] = (int32_t)h9;
 1857|  10.5k|}
curve25519.c:fe_neg:
 1621|   169k|{
 1622|   169k|    unsigned i;
 1623|       |
 1624|  1.86M|    for (i = 0; i < 10; i++) {
  ------------------
  |  Branch (1624:17): [True: 1.69M, False: 169k]
  ------------------
 1625|  1.69M|        h[i] = -f[i];
 1626|  1.69M|    }
 1627|   169k|}
curve25519.c:fe_add:
 1046|   701k|{
 1047|   701k|    unsigned i;
 1048|       |
 1049|  7.71M|    for (i = 0; i < 10; i++) {
  ------------------
  |  Branch (1049:17): [True: 7.01M, False: 701k]
  ------------------
 1050|  7.01M|        h[i] = f[i] + g[i];
 1051|  7.01M|    }
 1052|   701k|}
curve25519.c:fe_sub:
 1067|   542k|{
 1068|   542k|    unsigned i;
 1069|       |
 1070|  5.96M|    for (i = 0; i < 10; i++) {
  ------------------
  |  Branch (1070:17): [True: 5.42M, False: 542k]
  ------------------
 1071|  5.42M|        h[i] = f[i] - g[i];
 1072|  5.42M|    }
 1073|   542k|}
curve25519.c:fe_invert:
 1516|  2.64k|{
 1517|  2.64k|    fe t0;
 1518|  2.64k|    fe t1;
 1519|  2.64k|    fe t2;
 1520|  2.64k|    fe t3;
 1521|  2.64k|    int i;
 1522|       |
 1523|       |    /*
 1524|       |     * Compute z ** -1 = z ** (2 ** 255 - 19 - 2) with the exponent as
 1525|       |     * 2 ** 255 - 21 = (2 ** 5) * (2 ** 250 - 1) + 11.
 1526|       |     */
 1527|       |
 1528|       |    /* t0 = z ** 2 */
 1529|  2.64k|    fe_sq(t0, z);
 1530|       |
 1531|       |    /* t1 = t0 ** (2 ** 2) = z ** 8 */
 1532|  2.64k|    fe_sq(t1, t0);
 1533|  2.64k|    fe_sq(t1, t1);
 1534|       |
 1535|       |    /* t1 = z * t1 = z ** 9 */
 1536|  2.64k|    fe_mul(t1, z, t1);
 1537|       |    /* t0 = t0 * t1 = z ** 11 -- stash t0 away for the end. */
 1538|  2.64k|    fe_mul(t0, t0, t1);
 1539|       |
 1540|       |    /* t2 = t0 ** 2 = z ** 22 */
 1541|  2.64k|    fe_sq(t2, t0);
 1542|       |
 1543|       |    /* t1 = t1 * t2 = z ** (2 ** 5 - 1) */
 1544|  2.64k|    fe_mul(t1, t1, t2);
 1545|       |
 1546|       |    /* t2 = t1 ** (2 ** 5) = z ** ((2 ** 5) * (2 ** 5 - 1)) */
 1547|  2.64k|    fe_sq(t2, t1);
 1548|  13.2k|    for (i = 1; i < 5; ++i) {
  ------------------
  |  Branch (1548:17): [True: 10.5k, False: 2.64k]
  ------------------
 1549|  10.5k|        fe_sq(t2, t2);
 1550|  10.5k|    }
 1551|       |
 1552|       |    /* t1 = t1 * t2 = z ** ((2 ** 5 + 1) * (2 ** 5 - 1)) = z ** (2 ** 10 - 1) */
 1553|  2.64k|    fe_mul(t1, t2, t1);
 1554|       |
 1555|       |    /* Continuing similarly... */
 1556|       |
 1557|       |    /* t2 = z ** (2 ** 20 - 1) */
 1558|  2.64k|    fe_sq(t2, t1);
 1559|  26.4k|    for (i = 1; i < 10; ++i) {
  ------------------
  |  Branch (1559:17): [True: 23.8k, False: 2.64k]
  ------------------
 1560|  23.8k|        fe_sq(t2, t2);
 1561|  23.8k|    }
 1562|  2.64k|    fe_mul(t2, t2, t1);
 1563|       |
 1564|       |    /* t2 = z ** (2 ** 40 - 1) */
 1565|  2.64k|    fe_sq(t3, t2);
 1566|  52.9k|    for (i = 1; i < 20; ++i) {
  ------------------
  |  Branch (1566:17): [True: 50.2k, False: 2.64k]
  ------------------
 1567|  50.2k|        fe_sq(t3, t3);
 1568|  50.2k|    }
 1569|  2.64k|    fe_mul(t2, t3, t2);
 1570|       |
 1571|       |    /* t2 = z ** (2 ** 10) * (2 ** 40 - 1) */
 1572|  29.1k|    for (i = 0; i < 10; ++i) {
  ------------------
  |  Branch (1572:17): [True: 26.4k, False: 2.64k]
  ------------------
 1573|  26.4k|        fe_sq(t2, t2);
 1574|  26.4k|    }
 1575|       |    /* t1 = z ** (2 ** 50 - 1) */
 1576|  2.64k|    fe_mul(t1, t2, t1);
 1577|       |
 1578|       |    /* t2 = z ** (2 ** 100 - 1) */
 1579|  2.64k|    fe_sq(t2, t1);
 1580|   132k|    for (i = 1; i < 50; ++i) {
  ------------------
  |  Branch (1580:17): [True: 129k, False: 2.64k]
  ------------------
 1581|   129k|        fe_sq(t2, t2);
 1582|   129k|    }
 1583|  2.64k|    fe_mul(t2, t2, t1);
 1584|       |
 1585|       |    /* t2 = z ** (2 ** 200 - 1) */
 1586|  2.64k|    fe_sq(t3, t2);
 1587|   264k|    for (i = 1; i < 100; ++i) {
  ------------------
  |  Branch (1587:17): [True: 261k, False: 2.64k]
  ------------------
 1588|   261k|        fe_sq(t3, t3);
 1589|   261k|    }
 1590|  2.64k|    fe_mul(t2, t3, t2);
 1591|       |
 1592|       |    /* t2 = z ** ((2 ** 50) * (2 ** 200 - 1) */
 1593|  2.64k|    fe_sq(t2, t2);
 1594|   132k|    for (i = 1; i < 50; ++i) {
  ------------------
  |  Branch (1594:17): [True: 129k, False: 2.64k]
  ------------------
 1595|   129k|        fe_sq(t2, t2);
 1596|   129k|    }
 1597|       |
 1598|       |    /* t1 = z ** (2 ** 250 - 1) */
 1599|  2.64k|    fe_mul(t1, t2, t1);
 1600|       |
 1601|       |    /* t1 = z ** ((2 ** 5) * (2 ** 250 - 1)) */
 1602|  2.64k|    fe_sq(t1, t1);
 1603|  13.2k|    for (i = 1; i < 5; ++i) {
  ------------------
  |  Branch (1603:17): [True: 10.5k, False: 2.64k]
  ------------------
 1604|  10.5k|        fe_sq(t1, t1);
 1605|  10.5k|    }
 1606|       |
 1607|       |    /* Recall t0 = z ** 11; out = z ** (2 ** 255 - 21) */
 1608|  2.64k|    fe_mul(out, t1, t0);
 1609|  2.64k|}
curve25519.c:fe_mul:
 1106|  1.25M|{
 1107|  1.25M|    int32_t f0 = f[0];
 1108|  1.25M|    int32_t f1 = f[1];
 1109|  1.25M|    int32_t f2 = f[2];
 1110|  1.25M|    int32_t f3 = f[3];
 1111|  1.25M|    int32_t f4 = f[4];
 1112|  1.25M|    int32_t f5 = f[5];
 1113|  1.25M|    int32_t f6 = f[6];
 1114|  1.25M|    int32_t f7 = f[7];
 1115|  1.25M|    int32_t f8 = f[8];
 1116|  1.25M|    int32_t f9 = f[9];
 1117|  1.25M|    int32_t g0 = g[0];
 1118|  1.25M|    int32_t g1 = g[1];
 1119|  1.25M|    int32_t g2 = g[2];
 1120|  1.25M|    int32_t g3 = g[3];
 1121|  1.25M|    int32_t g4 = g[4];
 1122|  1.25M|    int32_t g5 = g[5];
 1123|  1.25M|    int32_t g6 = g[6];
 1124|  1.25M|    int32_t g7 = g[7];
 1125|  1.25M|    int32_t g8 = g[8];
 1126|  1.25M|    int32_t g9 = g[9];
 1127|  1.25M|    int32_t g1_19 = 19 * g1; /* 1.959375*2^29 */
 1128|  1.25M|    int32_t g2_19 = 19 * g2; /* 1.959375*2^30; still ok */
 1129|  1.25M|    int32_t g3_19 = 19 * g3;
 1130|  1.25M|    int32_t g4_19 = 19 * g4;
 1131|  1.25M|    int32_t g5_19 = 19 * g5;
 1132|  1.25M|    int32_t g6_19 = 19 * g6;
 1133|  1.25M|    int32_t g7_19 = 19 * g7;
 1134|  1.25M|    int32_t g8_19 = 19 * g8;
 1135|  1.25M|    int32_t g9_19 = 19 * g9;
 1136|  1.25M|    int32_t f1_2 = 2 * f1;
 1137|  1.25M|    int32_t f3_2 = 2 * f3;
 1138|  1.25M|    int32_t f5_2 = 2 * f5;
 1139|  1.25M|    int32_t f7_2 = 2 * f7;
 1140|  1.25M|    int32_t f9_2 = 2 * f9;
 1141|  1.25M|    int64_t f0g0 = f0 * (int64_t)g0;
 1142|  1.25M|    int64_t f0g1 = f0 * (int64_t)g1;
 1143|  1.25M|    int64_t f0g2 = f0 * (int64_t)g2;
 1144|  1.25M|    int64_t f0g3 = f0 * (int64_t)g3;
 1145|  1.25M|    int64_t f0g4 = f0 * (int64_t)g4;
 1146|  1.25M|    int64_t f0g5 = f0 * (int64_t)g5;
 1147|  1.25M|    int64_t f0g6 = f0 * (int64_t)g6;
 1148|  1.25M|    int64_t f0g7 = f0 * (int64_t)g7;
 1149|  1.25M|    int64_t f0g8 = f0 * (int64_t)g8;
 1150|  1.25M|    int64_t f0g9 = f0 * (int64_t)g9;
 1151|  1.25M|    int64_t f1g0 = f1 * (int64_t)g0;
 1152|  1.25M|    int64_t f1g1_2 = f1_2 * (int64_t)g1;
 1153|  1.25M|    int64_t f1g2 = f1 * (int64_t)g2;
 1154|  1.25M|    int64_t f1g3_2 = f1_2 * (int64_t)g3;
 1155|  1.25M|    int64_t f1g4 = f1 * (int64_t)g4;
 1156|  1.25M|    int64_t f1g5_2 = f1_2 * (int64_t)g5;
 1157|  1.25M|    int64_t f1g6 = f1 * (int64_t)g6;
 1158|  1.25M|    int64_t f1g7_2 = f1_2 * (int64_t)g7;
 1159|  1.25M|    int64_t f1g8 = f1 * (int64_t)g8;
 1160|  1.25M|    int64_t f1g9_38 = f1_2 * (int64_t)g9_19;
 1161|  1.25M|    int64_t f2g0 = f2 * (int64_t)g0;
 1162|  1.25M|    int64_t f2g1 = f2 * (int64_t)g1;
 1163|  1.25M|    int64_t f2g2 = f2 * (int64_t)g2;
 1164|  1.25M|    int64_t f2g3 = f2 * (int64_t)g3;
 1165|  1.25M|    int64_t f2g4 = f2 * (int64_t)g4;
 1166|  1.25M|    int64_t f2g5 = f2 * (int64_t)g5;
 1167|  1.25M|    int64_t f2g6 = f2 * (int64_t)g6;
 1168|  1.25M|    int64_t f2g7 = f2 * (int64_t)g7;
 1169|  1.25M|    int64_t f2g8_19 = f2 * (int64_t)g8_19;
 1170|  1.25M|    int64_t f2g9_19 = f2 * (int64_t)g9_19;
 1171|  1.25M|    int64_t f3g0 = f3 * (int64_t)g0;
 1172|  1.25M|    int64_t f3g1_2 = f3_2 * (int64_t)g1;
 1173|  1.25M|    int64_t f3g2 = f3 * (int64_t)g2;
 1174|  1.25M|    int64_t f3g3_2 = f3_2 * (int64_t)g3;
 1175|  1.25M|    int64_t f3g4 = f3 * (int64_t)g4;
 1176|  1.25M|    int64_t f3g5_2 = f3_2 * (int64_t)g5;
 1177|  1.25M|    int64_t f3g6 = f3 * (int64_t)g6;
 1178|  1.25M|    int64_t f3g7_38 = f3_2 * (int64_t)g7_19;
 1179|  1.25M|    int64_t f3g8_19 = f3 * (int64_t)g8_19;
 1180|  1.25M|    int64_t f3g9_38 = f3_2 * (int64_t)g9_19;
 1181|  1.25M|    int64_t f4g0 = f4 * (int64_t)g0;
 1182|  1.25M|    int64_t f4g1 = f4 * (int64_t)g1;
 1183|  1.25M|    int64_t f4g2 = f4 * (int64_t)g2;
 1184|  1.25M|    int64_t f4g3 = f4 * (int64_t)g3;
 1185|  1.25M|    int64_t f4g4 = f4 * (int64_t)g4;
 1186|  1.25M|    int64_t f4g5 = f4 * (int64_t)g5;
 1187|  1.25M|    int64_t f4g6_19 = f4 * (int64_t)g6_19;
 1188|  1.25M|    int64_t f4g7_19 = f4 * (int64_t)g7_19;
 1189|  1.25M|    int64_t f4g8_19 = f4 * (int64_t)g8_19;
 1190|  1.25M|    int64_t f4g9_19 = f4 * (int64_t)g9_19;
 1191|  1.25M|    int64_t f5g0 = f5 * (int64_t)g0;
 1192|  1.25M|    int64_t f5g1_2 = f5_2 * (int64_t)g1;
 1193|  1.25M|    int64_t f5g2 = f5 * (int64_t)g2;
 1194|  1.25M|    int64_t f5g3_2 = f5_2 * (int64_t)g3;
 1195|  1.25M|    int64_t f5g4 = f5 * (int64_t)g4;
 1196|  1.25M|    int64_t f5g5_38 = f5_2 * (int64_t)g5_19;
 1197|  1.25M|    int64_t f5g6_19 = f5 * (int64_t)g6_19;
 1198|  1.25M|    int64_t f5g7_38 = f5_2 * (int64_t)g7_19;
 1199|  1.25M|    int64_t f5g8_19 = f5 * (int64_t)g8_19;
 1200|  1.25M|    int64_t f5g9_38 = f5_2 * (int64_t)g9_19;
 1201|  1.25M|    int64_t f6g0 = f6 * (int64_t)g0;
 1202|  1.25M|    int64_t f6g1 = f6 * (int64_t)g1;
 1203|  1.25M|    int64_t f6g2 = f6 * (int64_t)g2;
 1204|  1.25M|    int64_t f6g3 = f6 * (int64_t)g3;
 1205|  1.25M|    int64_t f6g4_19 = f6 * (int64_t)g4_19;
 1206|  1.25M|    int64_t f6g5_19 = f6 * (int64_t)g5_19;
 1207|  1.25M|    int64_t f6g6_19 = f6 * (int64_t)g6_19;
 1208|  1.25M|    int64_t f6g7_19 = f6 * (int64_t)g7_19;
 1209|  1.25M|    int64_t f6g8_19 = f6 * (int64_t)g8_19;
 1210|  1.25M|    int64_t f6g9_19 = f6 * (int64_t)g9_19;
 1211|  1.25M|    int64_t f7g0 = f7 * (int64_t)g0;
 1212|  1.25M|    int64_t f7g1_2 = f7_2 * (int64_t)g1;
 1213|  1.25M|    int64_t f7g2 = f7 * (int64_t)g2;
 1214|  1.25M|    int64_t f7g3_38 = f7_2 * (int64_t)g3_19;
 1215|  1.25M|    int64_t f7g4_19 = f7 * (int64_t)g4_19;
 1216|  1.25M|    int64_t f7g5_38 = f7_2 * (int64_t)g5_19;
 1217|  1.25M|    int64_t f7g6_19 = f7 * (int64_t)g6_19;
 1218|  1.25M|    int64_t f7g7_38 = f7_2 * (int64_t)g7_19;
 1219|  1.25M|    int64_t f7g8_19 = f7 * (int64_t)g8_19;
 1220|  1.25M|    int64_t f7g9_38 = f7_2 * (int64_t)g9_19;
 1221|  1.25M|    int64_t f8g0 = f8 * (int64_t)g0;
 1222|  1.25M|    int64_t f8g1 = f8 * (int64_t)g1;
 1223|  1.25M|    int64_t f8g2_19 = f8 * (int64_t)g2_19;
 1224|  1.25M|    int64_t f8g3_19 = f8 * (int64_t)g3_19;
 1225|  1.25M|    int64_t f8g4_19 = f8 * (int64_t)g4_19;
 1226|  1.25M|    int64_t f8g5_19 = f8 * (int64_t)g5_19;
 1227|  1.25M|    int64_t f8g6_19 = f8 * (int64_t)g6_19;
 1228|  1.25M|    int64_t f8g7_19 = f8 * (int64_t)g7_19;
 1229|  1.25M|    int64_t f8g8_19 = f8 * (int64_t)g8_19;
 1230|  1.25M|    int64_t f8g9_19 = f8 * (int64_t)g9_19;
 1231|  1.25M|    int64_t f9g0 = f9 * (int64_t)g0;
 1232|  1.25M|    int64_t f9g1_38 = f9_2 * (int64_t)g1_19;
 1233|  1.25M|    int64_t f9g2_19 = f9 * (int64_t)g2_19;
 1234|  1.25M|    int64_t f9g3_38 = f9_2 * (int64_t)g3_19;
 1235|  1.25M|    int64_t f9g4_19 = f9 * (int64_t)g4_19;
 1236|  1.25M|    int64_t f9g5_38 = f9_2 * (int64_t)g5_19;
 1237|  1.25M|    int64_t f9g6_19 = f9 * (int64_t)g6_19;
 1238|  1.25M|    int64_t f9g7_38 = f9_2 * (int64_t)g7_19;
 1239|  1.25M|    int64_t f9g8_19 = f9 * (int64_t)g8_19;
 1240|  1.25M|    int64_t f9g9_38 = f9_2 * (int64_t)g9_19;
 1241|  1.25M|    int64_t h0 = f0g0 + f1g9_38 + f2g8_19 + f3g7_38 + f4g6_19 + f5g5_38 + f6g4_19 + f7g3_38 + f8g2_19 + f9g1_38;
 1242|  1.25M|    int64_t h1 = f0g1 + f1g0 + f2g9_19 + f3g8_19 + f4g7_19 + f5g6_19 + f6g5_19 + f7g4_19 + f8g3_19 + f9g2_19;
 1243|  1.25M|    int64_t h2 = f0g2 + f1g1_2 + f2g0 + f3g9_38 + f4g8_19 + f5g7_38 + f6g6_19 + f7g5_38 + f8g4_19 + f9g3_38;
 1244|  1.25M|    int64_t h3 = f0g3 + f1g2 + f2g1 + f3g0 + f4g9_19 + f5g8_19 + f6g7_19 + f7g6_19 + f8g5_19 + f9g4_19;
 1245|  1.25M|    int64_t h4 = f0g4 + f1g3_2 + f2g2 + f3g1_2 + f4g0 + f5g9_38 + f6g8_19 + f7g7_38 + f8g6_19 + f9g5_38;
 1246|  1.25M|    int64_t h5 = f0g5 + f1g4 + f2g3 + f3g2 + f4g1 + f5g0 + f6g9_19 + f7g8_19 + f8g7_19 + f9g6_19;
 1247|  1.25M|    int64_t h6 = f0g6 + f1g5_2 + f2g4 + f3g3_2 + f4g2 + f5g1_2 + f6g0 + f7g9_38 + f8g8_19 + f9g7_38;
 1248|  1.25M|    int64_t h7 = f0g7 + f1g6 + f2g5 + f3g4 + f4g3 + f5g2 + f6g1 + f7g0 + f8g9_19 + f9g8_19;
 1249|  1.25M|    int64_t h8 = f0g8 + f1g7_2 + f2g6 + f3g5_2 + f4g4 + f5g3_2 + f6g2 + f7g1_2 + f8g0 + f9g9_38;
 1250|  1.25M|    int64_t h9 = f0g9 + f1g8 + f2g7 + f3g6 + f4g5 + f5g4 + f6g3 + f7g2 + f8g1 + f9g0;
 1251|  1.25M|    int64_t carry0;
 1252|  1.25M|    int64_t carry1;
 1253|  1.25M|    int64_t carry2;
 1254|  1.25M|    int64_t carry3;
 1255|  1.25M|    int64_t carry4;
 1256|  1.25M|    int64_t carry5;
 1257|  1.25M|    int64_t carry6;
 1258|  1.25M|    int64_t carry7;
 1259|  1.25M|    int64_t carry8;
 1260|  1.25M|    int64_t carry9;
 1261|       |
 1262|       |    /* |h0| <= (1.65*1.65*2^52*(1+19+19+19+19)+1.65*1.65*2^50*(38+38+38+38+38))
 1263|       |     *   i.e. |h0| <= 1.4*2^60; narrower ranges for h2, h4, h6, h8
 1264|       |     * |h1| <= (1.65*1.65*2^51*(1+1+19+19+19+19+19+19+19+19))
 1265|       |     *   i.e. |h1| <= 1.7*2^59; narrower ranges for h3, h5, h7, h9 */
 1266|       |
 1267|  1.25M|    carry0 = h0 + (1 << 25);
 1268|  1.25M|    h1 += carry0 >> 26;
 1269|  1.25M|    h0 -= carry0 & kTop38Bits;
 1270|  1.25M|    carry4 = h4 + (1 << 25);
 1271|  1.25M|    h5 += carry4 >> 26;
 1272|  1.25M|    h4 -= carry4 & kTop38Bits;
 1273|       |    /* |h0| <= 2^25 */
 1274|       |    /* |h4| <= 2^25 */
 1275|       |    /* |h1| <= 1.71*2^59 */
 1276|       |    /* |h5| <= 1.71*2^59 */
 1277|       |
 1278|  1.25M|    carry1 = h1 + (1 << 24);
 1279|  1.25M|    h2 += carry1 >> 25;
 1280|  1.25M|    h1 -= carry1 & kTop39Bits;
 1281|  1.25M|    carry5 = h5 + (1 << 24);
 1282|  1.25M|    h6 += carry5 >> 25;
 1283|  1.25M|    h5 -= carry5 & kTop39Bits;
 1284|       |    /* |h1| <= 2^24; from now on fits into int32 */
 1285|       |    /* |h5| <= 2^24; from now on fits into int32 */
 1286|       |    /* |h2| <= 1.41*2^60 */
 1287|       |    /* |h6| <= 1.41*2^60 */
 1288|       |
 1289|  1.25M|    carry2 = h2 + (1 << 25);
 1290|  1.25M|    h3 += carry2 >> 26;
 1291|  1.25M|    h2 -= carry2 & kTop38Bits;
 1292|  1.25M|    carry6 = h6 + (1 << 25);
 1293|  1.25M|    h7 += carry6 >> 26;
 1294|  1.25M|    h6 -= carry6 & kTop38Bits;
 1295|       |    /* |h2| <= 2^25; from now on fits into int32 unchanged */
 1296|       |    /* |h6| <= 2^25; from now on fits into int32 unchanged */
 1297|       |    /* |h3| <= 1.71*2^59 */
 1298|       |    /* |h7| <= 1.71*2^59 */
 1299|       |
 1300|  1.25M|    carry3 = h3 + (1 << 24);
 1301|  1.25M|    h4 += carry3 >> 25;
 1302|  1.25M|    h3 -= carry3 & kTop39Bits;
 1303|  1.25M|    carry7 = h7 + (1 << 24);
 1304|  1.25M|    h8 += carry7 >> 25;
 1305|  1.25M|    h7 -= carry7 & kTop39Bits;
 1306|       |    /* |h3| <= 2^24; from now on fits into int32 unchanged */
 1307|       |    /* |h7| <= 2^24; from now on fits into int32 unchanged */
 1308|       |    /* |h4| <= 1.72*2^34 */
 1309|       |    /* |h8| <= 1.41*2^60 */
 1310|       |
 1311|  1.25M|    carry4 = h4 + (1 << 25);
 1312|  1.25M|    h5 += carry4 >> 26;
 1313|  1.25M|    h4 -= carry4 & kTop38Bits;
 1314|  1.25M|    carry8 = h8 + (1 << 25);
 1315|  1.25M|    h9 += carry8 >> 26;
 1316|  1.25M|    h8 -= carry8 & kTop38Bits;
 1317|       |    /* |h4| <= 2^25; from now on fits into int32 unchanged */
 1318|       |    /* |h8| <= 2^25; from now on fits into int32 unchanged */
 1319|       |    /* |h5| <= 1.01*2^24 */
 1320|       |    /* |h9| <= 1.71*2^59 */
 1321|       |
 1322|  1.25M|    carry9 = h9 + (1 << 24);
 1323|  1.25M|    h0 += (carry9 >> 25) * 19;
 1324|  1.25M|    h9 -= carry9 & kTop39Bits;
 1325|       |    /* |h9| <= 2^24; from now on fits into int32 unchanged */
 1326|       |    /* |h0| <= 1.1*2^39 */
 1327|       |
 1328|  1.25M|    carry0 = h0 + (1 << 25);
 1329|  1.25M|    h1 += carry0 >> 26;
 1330|  1.25M|    h0 -= carry0 & kTop38Bits;
 1331|       |    /* |h0| <= 2^25; from now on fits into int32 unchanged */
 1332|       |    /* |h1| <= 1.01*2^24 */
 1333|       |
 1334|  1.25M|    h[0] = (int32_t)h0;
 1335|  1.25M|    h[1] = (int32_t)h1;
 1336|  1.25M|    h[2] = (int32_t)h2;
 1337|  1.25M|    h[3] = (int32_t)h3;
 1338|  1.25M|    h[4] = (int32_t)h4;
 1339|  1.25M|    h[5] = (int32_t)h5;
 1340|  1.25M|    h[6] = (int32_t)h6;
 1341|  1.25M|    h[7] = (int32_t)h7;
 1342|  1.25M|    h[8] = (int32_t)h8;
 1343|  1.25M|    h[9] = (int32_t)h9;
 1344|  1.25M|}
curve25519.c:fe_tobytes:
  924|  2.64k|{
  925|  2.64k|    int32_t h0 = h[0];
  926|  2.64k|    int32_t h1 = h[1];
  927|  2.64k|    int32_t h2 = h[2];
  928|  2.64k|    int32_t h3 = h[3];
  929|  2.64k|    int32_t h4 = h[4];
  930|  2.64k|    int32_t h5 = h[5];
  931|  2.64k|    int32_t h6 = h[6];
  932|  2.64k|    int32_t h7 = h[7];
  933|  2.64k|    int32_t h8 = h[8];
  934|  2.64k|    int32_t h9 = h[9];
  935|  2.64k|    int32_t q;
  936|       |
  937|  2.64k|    q = (19 * h9 + (((int32_t)1) << 24)) >> 25;
  938|  2.64k|    q = (h0 + q) >> 26;
  939|  2.64k|    q = (h1 + q) >> 25;
  940|  2.64k|    q = (h2 + q) >> 26;
  941|  2.64k|    q = (h3 + q) >> 25;
  942|  2.64k|    q = (h4 + q) >> 26;
  943|  2.64k|    q = (h5 + q) >> 25;
  944|  2.64k|    q = (h6 + q) >> 26;
  945|  2.64k|    q = (h7 + q) >> 25;
  946|  2.64k|    q = (h8 + q) >> 26;
  947|  2.64k|    q = (h9 + q) >> 25;
  948|       |
  949|       |    /* Goal: Output h-(2^255-19)q, which is between 0 and 2^255-20. */
  950|  2.64k|    h0 += 19 * q;
  951|       |    /* Goal: Output h-2^255 q, which is between 0 and 2^255-20. */
  952|       |
  953|  2.64k|    h1 += h0 >> 26;
  954|  2.64k|    h0 &= kBottom26Bits;
  955|  2.64k|    h2 += h1 >> 25;
  956|  2.64k|    h1 &= kBottom25Bits;
  957|  2.64k|    h3 += h2 >> 26;
  958|  2.64k|    h2 &= kBottom26Bits;
  959|  2.64k|    h4 += h3 >> 25;
  960|  2.64k|    h3 &= kBottom25Bits;
  961|  2.64k|    h5 += h4 >> 26;
  962|  2.64k|    h4 &= kBottom26Bits;
  963|  2.64k|    h6 += h5 >> 25;
  964|  2.64k|    h5 &= kBottom25Bits;
  965|  2.64k|    h7 += h6 >> 26;
  966|  2.64k|    h6 &= kBottom26Bits;
  967|  2.64k|    h8 += h7 >> 25;
  968|  2.64k|    h7 &= kBottom25Bits;
  969|  2.64k|    h9 += h8 >> 26;
  970|  2.64k|    h8 &= kBottom26Bits;
  971|  2.64k|    h9 &= kBottom25Bits;
  972|       |    /* h10 = carry9 */
  973|       |
  974|       |    /*
  975|       |     * Goal: Output h0+...+2^255 h10-2^255 q, which is between 0 and 2^255-20.
  976|       |     * Have h0+...+2^230 h9 between 0 and 2^255-1;
  977|       |     * evidently 2^255 h10-2^255 q = 0.
  978|       |     * Goal: Output h0+...+2^230 h9.
  979|       |     */
  980|  2.64k|    s[0] = (uint8_t)(h0 >> 0);
  981|  2.64k|    s[1] = (uint8_t)(h0 >> 8);
  982|  2.64k|    s[2] = (uint8_t)(h0 >> 16);
  983|  2.64k|    s[3] = (uint8_t)((h0 >> 24) | ((uint32_t)(h1) << 2));
  984|  2.64k|    s[4] = (uint8_t)(h1 >> 6);
  985|  2.64k|    s[5] = (uint8_t)(h1 >> 14);
  986|  2.64k|    s[6] = (uint8_t)((h1 >> 22) | ((uint32_t)(h2) << 3));
  987|  2.64k|    s[7] = (uint8_t)(h2 >> 5);
  988|  2.64k|    s[8] = (uint8_t)(h2 >> 13);
  989|  2.64k|    s[9] = (uint8_t)((h2 >> 21) | ((uint32_t)(h3) << 5));
  990|  2.64k|    s[10] = (uint8_t)(h3 >> 3);
  991|  2.64k|    s[11] = (uint8_t)(h3 >> 11);
  992|  2.64k|    s[12] = (uint8_t)((h3 >> 19) | ((uint32_t)(h4) << 6));
  993|  2.64k|    s[13] = (uint8_t)(h4 >> 2);
  994|  2.64k|    s[14] = (uint8_t)(h4 >> 10);
  995|  2.64k|    s[15] = (uint8_t)(h4 >> 18);
  996|  2.64k|    s[16] = (uint8_t)(h5 >> 0);
  997|  2.64k|    s[17] = (uint8_t)(h5 >> 8);
  998|  2.64k|    s[18] = (uint8_t)(h5 >> 16);
  999|  2.64k|    s[19] = (uint8_t)((h5 >> 24) | ((uint32_t)(h6) << 1));
 1000|  2.64k|    s[20] = (uint8_t)(h6 >> 7);
 1001|  2.64k|    s[21] = (uint8_t)(h6 >> 15);
 1002|  2.64k|    s[22] = (uint8_t)((h6 >> 23) | ((uint32_t)(h7) << 3));
 1003|  2.64k|    s[23] = (uint8_t)(h7 >> 5);
 1004|  2.64k|    s[24] = (uint8_t)(h7 >> 13);
 1005|  2.64k|    s[25] = (uint8_t)((h7 >> 21) | ((uint32_t)(h8) << 4));
 1006|  2.64k|    s[26] = (uint8_t)(h8 >> 4);
 1007|  2.64k|    s[27] = (uint8_t)(h8 >> 12);
 1008|  2.64k|    s[28] = (uint8_t)((h8 >> 20) | ((uint32_t)(h9) << 6));
 1009|  2.64k|    s[29] = (uint8_t)(h9 >> 2);
 1010|  2.64k|    s[30] = (uint8_t)(h9 >> 10);
 1011|  2.64k|    s[31] = (uint8_t)(h9 >> 18);
 1012|  2.64k|}

f_impl64.c:widemul:
   23|   145k|{
   24|   145k|    return ((uint128_t)a) * b;
   25|   145k|}

curve448.c:gf_sub_RAW:
   37|    954|{
   38|    954|    uint64_t co1 = ((1ULL << 56) - 1) * 2, co2 = co1 - 2;
   39|    954|    unsigned int i;
   40|       |
   41|  8.58k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |   21|  8.58k|#define NLIMBS (64 / sizeof(word_t))
  ------------------
  |  Branch (41:17): [True: 7.63k, False: 954]
  ------------------
   42|  7.63k|        out->limb[i] = a->limb[i] - b->limb[i] + ((i == NLIMBS / 2) ? co2 : co1);
  ------------------
  |  |   21|  7.63k|#define NLIMBS (64 / sizeof(word_t))
  ------------------
  |  Branch (42:51): [True: 954, False: 6.67k]
  ------------------
   43|       |
   44|    954|    gf_weak_reduce(out);
   45|    954|}
curve448.c:gf_bias:
   48|    954|{
   49|    954|}
curve448.c:gf_weak_reduce:
   52|  1.90k|{
   53|  1.90k|    uint64_t mask = (1ULL << 56) - 1;
   54|  1.90k|    uint64_t tmp = a->limb[NLIMBS - 1] >> 56;
  ------------------
  |  |   21|  1.90k|#define NLIMBS (64 / sizeof(word_t))
  ------------------
   55|  1.90k|    unsigned int i;
   56|       |
   57|  1.90k|    a->limb[NLIMBS / 2] += tmp;
  ------------------
  |  |   21|  1.90k|#define NLIMBS (64 / sizeof(word_t))
  ------------------
   58|  15.2k|    for (i = NLIMBS - 1; i > 0; i--)
  ------------------
  |  |   21|  1.90k|#define NLIMBS (64 / sizeof(word_t))
  ------------------
  |  Branch (58:26): [True: 13.3k, False: 1.90k]
  ------------------
   59|  13.3k|        a->limb[i] = (a->limb[i] & mask) + (a->limb[i - 1] >> 56);
   60|  1.90k|    a->limb[0] = (a->limb[0] & mask) + tmp;
   61|  1.90k|}
curve448.c:gf_add_RAW:
   27|    954|{
   28|    954|    unsigned int i;
   29|       |
   30|  8.58k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |   21|  8.58k|#define NLIMBS (64 / sizeof(word_t))
  ------------------
  |  Branch (30:17): [True: 7.63k, False: 954]
  ------------------
   31|  7.63k|        out->limb[i] = a->limb[i] + b->limb[i];
   32|       |
   33|    954|    gf_weak_reduce(out);
   34|    954|}
f_generic.c:gf_weak_reduce:
   52|    564|{
   53|    564|    uint64_t mask = (1ULL << 56) - 1;
   54|    564|    uint64_t tmp = a->limb[NLIMBS - 1] >> 56;
  ------------------
  |  |   21|    564|#define NLIMBS (64 / sizeof(word_t))
  ------------------
   55|    564|    unsigned int i;
   56|       |
   57|    564|    a->limb[NLIMBS / 2] += tmp;
  ------------------
  |  |   21|    564|#define NLIMBS (64 / sizeof(word_t))
  ------------------
   58|  4.51k|    for (i = NLIMBS - 1; i > 0; i--)
  ------------------
  |  |   21|    564|#define NLIMBS (64 / sizeof(word_t))
  ------------------
  |  Branch (58:26): [True: 3.94k, False: 564]
  ------------------
   59|  3.94k|        a->limb[i] = (a->limb[i] & mask) + (a->limb[i - 1] >> 56);
   60|    564|    a->limb[0] = (a->limb[0] & mask) + tmp;
   61|    564|}
f_generic.c:gf_sub_RAW:
   37|    276|{
   38|    276|    uint64_t co1 = ((1ULL << 56) - 1) * 2, co2 = co1 - 2;
   39|    276|    unsigned int i;
   40|       |
   41|  2.48k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |   21|  2.48k|#define NLIMBS (64 / sizeof(word_t))
  ------------------
  |  Branch (41:17): [True: 2.20k, False: 276]
  ------------------
   42|  2.20k|        out->limb[i] = a->limb[i] - b->limb[i] + ((i == NLIMBS / 2) ? co2 : co1);
  ------------------
  |  |   21|  2.20k|#define NLIMBS (64 / sizeof(word_t))
  ------------------
  |  Branch (42:51): [True: 276, False: 1.93k]
  ------------------
   43|       |
   44|    276|    gf_weak_reduce(out);
   45|    276|}
f_generic.c:gf_bias:
   48|    276|{
   49|    276|}
f_generic.c:gf_add_RAW:
   27|      3|{
   28|      3|    unsigned int i;
   29|       |
   30|     27|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |   21|     27|#define NLIMBS (64 / sizeof(word_t))
  ------------------
  |  Branch (30:17): [True: 24, False: 3]
  ------------------
   31|     24|        out->limb[i] = a->limb[i] + b->limb[i];
   32|       |
   33|      3|    gf_weak_reduce(out);
   34|      3|}

ossl_gf_mul:
   25|  2.07k|{
   26|  2.07k|    const uint64_t *a = as->limb, *b = bs->limb;
   27|  2.07k|    uint64_t *c = cs->limb;
   28|  2.07k|    uint128_t accum0 = 0, accum1 = 0, accum2;
   29|  2.07k|    uint64_t mask = (1ULL << 56) - 1;
   30|  2.07k|    uint64_t aa[4], bb[4], bbb[4];
   31|  2.07k|    unsigned int i, j;
   32|       |
   33|  10.3k|    for (i = 0; i < 4; i++) {
  ------------------
  |  Branch (33:17): [True: 8.28k, False: 2.07k]
  ------------------
   34|  8.28k|        aa[i] = a[i] + a[i + 4];
   35|  8.28k|        bb[i] = b[i] + b[i + 4];
   36|  8.28k|        bbb[i] = bb[i] + b[i + 4];
   37|  8.28k|    }
   38|       |
   39|  10.3k|    for (i = 0; i < 4; i++) {
  ------------------
  |  Branch (39:17): [True: 8.28k, False: 2.07k]
  ------------------
   40|  8.28k|        accum2 = 0;
   41|       |
   42|  28.9k|        for (j = 0; j <= i; j++) {
  ------------------
  |  Branch (42:21): [True: 20.7k, False: 8.28k]
  ------------------
   43|  20.7k|            accum2 += widemul(a[j], b[i - j]);
   44|  20.7k|            accum1 += widemul(aa[j], bb[i - j]);
   45|  20.7k|            accum0 += widemul(a[j + 4], b[i - j + 4]);
   46|  20.7k|        }
   47|  20.7k|        for (; j < 4; j++) {
  ------------------
  |  Branch (47:16): [True: 12.4k, False: 8.28k]
  ------------------
   48|  12.4k|            accum2 += widemul(a[j], b[i + 8 - j]);
   49|  12.4k|            accum1 += widemul(aa[j], bbb[i + 4 - j]);
   50|  12.4k|            accum0 += widemul(a[j + 4], bb[i + 4 - j]);
   51|  12.4k|        }
   52|       |
   53|  8.28k|        accum1 -= accum2;
   54|  8.28k|        accum0 += accum2;
   55|       |
   56|  8.28k|        c[i] = ((uint64_t)(accum0)) & mask;
   57|  8.28k|        c[i + 4] = ((uint64_t)(accum1)) & mask;
   58|       |
   59|  8.28k|        accum0 >>= 56;
   60|  8.28k|        accum1 >>= 56;
   61|  8.28k|    }
   62|       |
   63|  2.07k|    accum0 += accum1;
   64|  2.07k|    accum0 += c[4];
   65|  2.07k|    accum1 += c[0];
   66|  2.07k|    c[4] = ((uint64_t)(accum0)) & mask;
   67|  2.07k|    c[0] = ((uint64_t)(accum1)) & mask;
   68|       |
   69|  2.07k|    accum0 >>= 56;
   70|  2.07k|    accum1 >>= 56;
   71|       |
   72|  2.07k|    c[5] += ((uint64_t)(accum0));
   73|  2.07k|    c[1] += ((uint64_t)(accum1));
   74|  2.07k|}
ossl_gf_sqr:
  103|  1.55k|{
  104|  1.55k|    const uint64_t *a = as->limb;
  105|  1.55k|    uint64_t *c = cs->limb;
  106|  1.55k|    uint128_t accum0 = 0, accum1 = 0, accum2;
  107|  1.55k|    uint64_t mask = (1ULL << 56) - 1;
  108|  1.55k|    uint64_t aa[4];
  109|  1.55k|    unsigned int i;
  110|       |
  111|       |    /* For some reason clang doesn't vectorize this without prompting? */
  112|  7.75k|    for (i = 0; i < 4; i++)
  ------------------
  |  Branch (112:17): [True: 6.20k, False: 1.55k]
  ------------------
  113|  6.20k|        aa[i] = a[i] + a[i + 4];
  114|       |
  115|  1.55k|    accum2 = widemul(a[0], a[3]);
  116|  1.55k|    accum0 = widemul(aa[0], aa[3]);
  117|  1.55k|    accum1 = widemul(a[4], a[7]);
  118|       |
  119|  1.55k|    accum2 += widemul(a[1], a[2]);
  120|  1.55k|    accum0 += widemul(aa[1], aa[2]);
  121|  1.55k|    accum1 += widemul(a[5], a[6]);
  122|       |
  123|  1.55k|    accum0 -= accum2;
  124|  1.55k|    accum1 += accum2;
  125|       |
  126|  1.55k|    c[3] = ((uint64_t)(accum1)) << 1 & mask;
  127|  1.55k|    c[7] = ((uint64_t)(accum0)) << 1 & mask;
  128|       |
  129|  1.55k|    accum0 >>= 55;
  130|  1.55k|    accum1 >>= 55;
  131|       |
  132|  1.55k|    accum0 += widemul(2 * aa[1], aa[3]);
  133|  1.55k|    accum1 += widemul(2 * a[5], a[7]);
  134|  1.55k|    accum0 += widemul(aa[2], aa[2]);
  135|  1.55k|    accum1 += accum0;
  136|       |
  137|  1.55k|    accum0 -= widemul(2 * a[1], a[3]);
  138|  1.55k|    accum1 += widemul(a[6], a[6]);
  139|       |
  140|  1.55k|    accum2 = widemul(a[0], a[0]);
  141|  1.55k|    accum1 -= accum2;
  142|  1.55k|    accum0 += accum2;
  143|       |
  144|  1.55k|    accum0 -= widemul(a[2], a[2]);
  145|  1.55k|    accum1 += widemul(aa[0], aa[0]);
  146|  1.55k|    accum0 += widemul(a[4], a[4]);
  147|       |
  148|  1.55k|    c[0] = ((uint64_t)(accum0)) & mask;
  149|  1.55k|    c[4] = ((uint64_t)(accum1)) & mask;
  150|       |
  151|  1.55k|    accum0 >>= 56;
  152|  1.55k|    accum1 >>= 56;
  153|       |
  154|  1.55k|    accum2 = widemul(2 * aa[2], aa[3]);
  155|  1.55k|    accum0 -= widemul(2 * a[2], a[3]);
  156|  1.55k|    accum1 += widemul(2 * a[6], a[7]);
  157|       |
  158|  1.55k|    accum1 += accum2;
  159|  1.55k|    accum0 += accum2;
  160|       |
  161|  1.55k|    accum2 = widemul(2 * a[0], a[1]);
  162|  1.55k|    accum1 += widemul(2 * aa[0], aa[1]);
  163|  1.55k|    accum0 += widemul(2 * a[4], a[5]);
  164|       |
  165|  1.55k|    accum1 -= accum2;
  166|  1.55k|    accum0 += accum2;
  167|       |
  168|  1.55k|    c[1] = ((uint64_t)(accum0)) & mask;
  169|  1.55k|    c[5] = ((uint64_t)(accum1)) & mask;
  170|       |
  171|  1.55k|    accum0 >>= 56;
  172|  1.55k|    accum1 >>= 56;
  173|       |
  174|  1.55k|    accum2 = widemul(aa[3], aa[3]);
  175|  1.55k|    accum0 -= widemul(a[3], a[3]);
  176|  1.55k|    accum1 += widemul(a[7], a[7]);
  177|       |
  178|  1.55k|    accum1 += accum2;
  179|  1.55k|    accum0 += accum2;
  180|       |
  181|  1.55k|    accum2 = widemul(2 * a[0], a[2]);
  182|  1.55k|    accum1 += widemul(2 * aa[0], aa[2]);
  183|  1.55k|    accum0 += widemul(2 * a[4], a[6]);
  184|       |
  185|  1.55k|    accum2 += widemul(a[1], a[1]);
  186|  1.55k|    accum1 += widemul(aa[1], aa[1]);
  187|  1.55k|    accum0 += widemul(a[5], a[5]);
  188|       |
  189|  1.55k|    accum1 -= accum2;
  190|  1.55k|    accum0 += accum2;
  191|       |
  192|  1.55k|    c[2] = ((uint64_t)(accum0)) & mask;
  193|  1.55k|    c[6] = ((uint64_t)(accum1)) & mask;
  194|       |
  195|  1.55k|    accum0 >>= 56;
  196|  1.55k|    accum1 >>= 56;
  197|       |
  198|  1.55k|    accum0 += c[3];
  199|  1.55k|    accum1 += c[7];
  200|  1.55k|    c[3] = ((uint64_t)(accum0)) & mask;
  201|  1.55k|    c[7] = ((uint64_t)(accum1)) & mask;
  202|       |
  203|       |    /* we could almost stop here, but it wouldn't be stable, so... */
  204|       |
  205|  1.55k|    accum0 >>= 56;
  206|  1.55k|    accum1 >>= 56;
  207|  1.55k|    c[4] += ((uint64_t)(accum0)) + ((uint64_t)(accum1));
  208|  1.55k|    c[0] += ((uint64_t)(accum1));
  209|  1.55k|}

ossl_curve448_precomputed_scalarmul:
  230|      3|{
  231|      3|    unsigned int i, j, k;
  232|      3|    const unsigned int n = COMBS_N, t = COMBS_T, s = COMBS_S;
  ------------------
  |  |   20|      3|#define COMBS_N 5
  ------------------
                  const unsigned int n = COMBS_N, t = COMBS_T, s = COMBS_S;
  ------------------
  |  |   21|      3|#define COMBS_T 5
  ------------------
                  const unsigned int n = COMBS_N, t = COMBS_T, s = COMBS_S;
  ------------------
  |  |   22|      3|#define COMBS_S 18
  ------------------
  233|      3|    niels_t ni;
  234|      3|    curve448_scalar_t scalar1x;
  235|       |
  236|      3|    ossl_curve448_scalar_add(scalar1x, scalar, precomputed_scalarmul_adjustment);
  237|      3|    ossl_curve448_scalar_halve(scalar1x, scalar1x);
  238|       |
  239|     57|    for (i = s; i > 0; i--) {
  ------------------
  |  Branch (239:17): [True: 54, False: 3]
  ------------------
  240|     54|        if (i != s)
  ------------------
  |  Branch (240:13): [True: 51, False: 3]
  ------------------
  241|     51|            point_double_internal(out, out, 0);
  242|       |
  243|    324|        for (j = 0; j < n; j++) {
  ------------------
  |  Branch (243:21): [True: 270, False: 54]
  ------------------
  244|    270|            int tab = 0;
  245|    270|            mask_t invert;
  246|       |
  247|  1.62k|            for (k = 0; k < t; k++) {
  ------------------
  |  Branch (247:25): [True: 1.35k, False: 270]
  ------------------
  248|  1.35k|                unsigned int bit = (i - 1) + s * (k + j * t);
  249|       |
  250|  1.35k|                if (bit < C448_SCALAR_BITS)
  ------------------
  |  |   41|  1.35k|#define C448_SCALAR_BITS 446
  ------------------
  |  Branch (250:21): [True: 1.33k, False: 12]
  ------------------
  251|  1.33k|                    tab |= (scalar1x->limb[bit / WBITS] >> (bit % WBITS) & 1) << k;
  ------------------
  |  |   35|  1.33k|#define WBITS C448_WORD_BITS /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|  1.33k|#define C448_WORD_BITS 64 /* The number of bits in a word */
  |  |  ------------------
  ------------------
                                  tab |= (scalar1x->limb[bit / WBITS] >> (bit % WBITS) & 1) << k;
  ------------------
  |  |   35|  1.33k|#define WBITS C448_WORD_BITS /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|  1.33k|#define C448_WORD_BITS 64 /* The number of bits in a word */
  |  |  ------------------
  ------------------
  252|  1.35k|            }
  253|       |
  254|    270|            invert = (tab >> (t - 1)) - 1;
  255|    270|            tab ^= invert;
  256|    270|            tab &= (1 << (t - 1)) - 1;
  257|       |
  258|    270|            constant_time_lookup_niels(ni, &table->table[j << (t - 1)],
  259|    270|                1 << (t - 1), tab);
  260|       |
  261|    270|            cond_neg_niels(ni, invert);
  262|    270|            if ((i != s) || j != 0)
  ------------------
  |  Branch (262:17): [True: 255, False: 15]
  |  Branch (262:29): [True: 12, False: 3]
  ------------------
  263|    267|                add_niels_to_pt(out, ni, j == n - 1 && i != 1);
  ------------------
  |  Branch (263:42): [True: 54, False: 213]
  |  Branch (263:56): [True: 51, False: 3]
  ------------------
  264|      3|            else
  265|      3|                niels_to_pt(out, ni);
  266|    270|        }
  267|     54|    }
  268|       |
  269|      3|    OPENSSL_cleanse(ni, sizeof(ni));
  270|      3|    OPENSSL_cleanse(scalar1x, sizeof(scalar1x));
  271|      3|}
ossl_curve448_point_mul_by_ratio_and_encode_like_x448:
  462|      3|{
  463|      3|    curve448_point_t q;
  464|       |
  465|      3|    curve448_point_copy(q, p);
  466|      3|    gf_invert(q->t, q->x, 0); /* 1/x */
  467|      3|    ossl_gf_mul(q->z, q->t, q->y); /* y/x */
  468|      3|    ossl_gf_sqr(q->y, q->z); /* (y/x)^2 */
  469|      3|    gf_serialize(out, q->y, 1);
  470|      3|    ossl_curve448_point_destroy(q);
  471|      3|}
ossl_x448_derive_public_key:
  475|      3|{
  476|       |    /* Scalar conditioning */
  477|      3|    uint8_t scalar2[X_PRIVATE_BYTES];
  478|      3|    curve448_scalar_t the_scalar;
  479|      3|    curve448_point_t p;
  480|      3|    unsigned int i;
  481|       |
  482|      3|    memcpy(scalar2, scalar, sizeof(scalar2));
  483|      3|    scalar2[0] &= -(uint8_t)COFACTOR;
  ------------------
  |  |   21|      3|#define COFACTOR 4
  ------------------
  484|       |
  485|      3|    scalar2[X_PRIVATE_BYTES - 1] &= ~((0u - 1u) << ((X_PRIVATE_BITS + 7) % 8));
  ------------------
  |  |   41|      3|#define X_PRIVATE_BYTES X_PUBLIC_BYTES
  |  |  ------------------
  |  |  |  |   40|      3|#define X_PUBLIC_BYTES X_SER_BYTES
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      3|#define X_SER_BYTES 56
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  scalar2[X_PRIVATE_BYTES - 1] &= ~((0u - 1u) << ((X_PRIVATE_BITS + 7) % 8));
  ------------------
  |  |   42|      3|#define X_PRIVATE_BITS 448
  ------------------
  486|      3|    scalar2[X_PRIVATE_BYTES - 1] |= 1 << ((X_PRIVATE_BITS + 7) % 8);
  ------------------
  |  |   41|      3|#define X_PRIVATE_BYTES X_PUBLIC_BYTES
  |  |  ------------------
  |  |  |  |   40|      3|#define X_PUBLIC_BYTES X_SER_BYTES
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      3|#define X_SER_BYTES 56
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  scalar2[X_PRIVATE_BYTES - 1] |= 1 << ((X_PRIVATE_BITS + 7) % 8);
  ------------------
  |  |   42|      3|#define X_PRIVATE_BITS 448
  ------------------
  487|       |
  488|      3|    ossl_curve448_scalar_decode_long(the_scalar, scalar2, sizeof(scalar2));
  489|       |
  490|       |    /* Compensate for the encoding ratio */
  491|      6|    for (i = 1; i < X448_ENCODE_RATIO; i <<= 1)
  ------------------
  |  |   47|      6|#define X448_ENCODE_RATIO 2
  ------------------
  |  Branch (491:17): [True: 3, False: 3]
  ------------------
  492|      3|        ossl_curve448_scalar_halve(the_scalar, the_scalar);
  493|       |
  494|      3|    ossl_curve448_precomputed_scalarmul(p, ossl_curve448_precomputed_base,
  495|      3|        the_scalar);
  496|      3|    ossl_curve448_point_mul_by_ratio_and_encode_like_x448(out, p);
  497|      3|    ossl_curve448_point_destroy(p);
  498|      3|}
ossl_curve448_point_destroy:
  726|      6|{
  727|      6|    OPENSSL_cleanse(point, sizeof(curve448_point_t));
  728|      6|}
ossl_x448_public_from_private:
  739|      3|{
  740|      3|    ossl_x448_derive_public_key(out_public_value, private_key);
  741|      3|}
curve448.c:point_double_internal:
   60|     51|{
   61|     51|    gf a, b, c, d;
   62|       |
   63|     51|    ossl_gf_sqr(c, q->x);
   64|     51|    ossl_gf_sqr(a, q->y);
   65|     51|    gf_add_nr(d, c, a); /* 2+e */
  ------------------
  |  |  100|     51|#define gf_add_nr gf_add_RAW
  ------------------
   66|     51|    gf_add_nr(p->t, q->y, q->x); /* 2+e */
  ------------------
  |  |  100|     51|#define gf_add_nr gf_add_RAW
  ------------------
   67|     51|    ossl_gf_sqr(b, p->t);
   68|     51|    gf_subx_nr(b, b, d, 3); /* 4+e */
   69|     51|    gf_sub_nr(p->t, a, c); /* 3+e */
   70|     51|    ossl_gf_sqr(p->x, q->z);
   71|     51|    gf_add_nr(p->z, p->x, p->x); /* 2+e */
  ------------------
  |  |  100|     51|#define gf_add_nr gf_add_RAW
  ------------------
   72|     51|    gf_subx_nr(a, p->z, p->t, 4); /* 6+e */
   73|     51|    if (GF_HEADROOM == 5)
  ------------------
  |  |   16|     51|#define GF_HEADROOM 9999 /* Everything is reduced anyway */
  ------------------
  |  Branch (73:9): [Folded, False: 51]
  ------------------
   74|      0|        gf_weak_reduce(a); /* or 1+e */
   75|     51|    ossl_gf_mul(p->x, a, b);
   76|     51|    ossl_gf_mul(p->z, p->t, a);
   77|     51|    ossl_gf_mul(p->y, p->t, d);
   78|     51|    if (!before_double)
  ------------------
  |  Branch (78:9): [True: 51, False: 0]
  ------------------
   79|     51|        ossl_gf_mul(p->t, b, d);
   80|     51|}
curve448.c:constant_time_lookup_niels:
  223|    270|{
  224|    270|    constant_time_lookup(ni, table, sizeof(niels_s), nelts, idx);
  225|    270|}
curve448.c:cond_neg_niels:
   89|    270|{
   90|    270|    gf_cond_swap(n->a, n->b, neg);
   91|    270|    gf_cond_neg(n->c, neg);
   92|    270|}
curve448.c:add_niels_to_pt:
  124|    267|{
  125|    267|    gf a, b, c;
  126|       |
  127|    267|    gf_sub_nr(b, d->y, d->x); /* 3+e */
  128|    267|    ossl_gf_mul(a, e->a, b);
  129|    267|    gf_add_nr(b, d->x, d->y); /* 2+e */
  ------------------
  |  |  100|    267|#define gf_add_nr gf_add_RAW
  ------------------
  130|    267|    ossl_gf_mul(d->y, e->b, b);
  131|    267|    ossl_gf_mul(d->x, e->c, d->t);
  132|    267|    gf_add_nr(c, a, d->y); /* 2+e */
  ------------------
  |  |  100|    267|#define gf_add_nr gf_add_RAW
  ------------------
  133|    267|    gf_sub_nr(b, d->y, a); /* 3+e */
  134|    267|    gf_sub_nr(d->y, d->z, d->x); /* 3+e */
  135|    267|    gf_add_nr(a, d->x, d->z); /* 2+e */
  ------------------
  |  |  100|    267|#define gf_add_nr gf_add_RAW
  ------------------
  136|    267|    ossl_gf_mul(d->z, a, d->y);
  137|    267|    ossl_gf_mul(d->x, d->y, b);
  138|    267|    ossl_gf_mul(d->y, a, c);
  139|    267|    if (!before_double)
  ------------------
  |  Branch (139:9): [True: 216, False: 51]
  ------------------
  140|    216|        ossl_gf_mul(d->t, b, c);
  141|    267|}
curve448.c:niels_to_pt:
  115|      3|{
  116|      3|    gf_add(e->y, n->b, n->a);
  117|      3|    gf_sub(e->x, n->b, n->a);
  118|      3|    ossl_gf_mul(e->t, e->y, e->x);
  119|      3|    gf_copy(e->z, ONE);
  120|      3|}
curve448.c:gf_invert:
   39|      3|{
   40|      3|    mask_t ret;
   41|      3|    gf t1, t2;
   42|       |
   43|      3|    ossl_gf_sqr(t1, x); /* o^2 */
   44|      3|    ret = gf_isr(t2, t1); /* +-1/sqrt(o^2) = +-1/o */
   45|      3|    (void)ret;
   46|      3|    if (assert_nonzero)
  ------------------
  |  Branch (46:9): [True: 0, False: 3]
  ------------------
   47|      3|        assert(ret);
  ------------------
  |  Branch (47:9): [True: 0, False: 0]
  |  Branch (47:9): [True: 0, False: 0]
  ------------------
   48|      3|    ossl_gf_sqr(t1, t2);
   49|      3|    ossl_gf_mul(t2, t1, x); /* not direct to y in case of alias. */
   50|      3|    gf_copy(y, t2);
   51|      3|}

gf_serialize:
   22|      3|{
   23|      3|    unsigned int j = 0, fill = 0;
   24|      3|    dword_t buffer = 0;
   25|      3|    int i;
   26|      3|    gf red;
   27|       |
   28|      3|    gf_copy(red, x);
   29|      3|    gf_strong_reduce(red);
   30|      3|    if (!with_hibit)
  ------------------
  |  Branch (30:9): [True: 0, False: 3]
  ------------------
   31|      3|        assert(gf_hibit(red) == 0);
  ------------------
  |  Branch (31:9): [True: 0, False: 0]
  |  Branch (31:9): [True: 0, False: 0]
  ------------------
   32|       |
   33|    171|    for (i = 0; i < (with_hibit ? X_SER_BYTES : SER_BYTES); i++) {
  ------------------
  |  |   22|    171|#define X_SER_BYTES 56
  ------------------
                  for (i = 0; i < (with_hibit ? X_SER_BYTES : SER_BYTES); i++) {
  ------------------
  |  |   23|      0|#define SER_BYTES 56
  ------------------
  |  Branch (33:17): [True: 168, False: 3]
  |  Branch (33:22): [True: 171, False: 0]
  ------------------
   34|    168|        if (fill < 8 && j < NLIMBS) {
  ------------------
  |  |   21|     24|#define NLIMBS (64 / sizeof(word_t))
  ------------------
  |  Branch (34:13): [True: 24, False: 144]
  |  Branch (34:25): [True: 24, False: 0]
  ------------------
   35|     24|            buffer |= ((dword_t)red->limb[LIMBPERM(j)]) << fill;
  ------------------
  |  |   69|     24|#define LIMBPERM(i) (i)
  ------------------
   36|     24|            fill += LIMB_PLACE_VALUE(LIMBPERM(j));
  ------------------
  |  |   24|     24|#define LIMB_PLACE_VALUE(i) 56
  ------------------
   37|     24|            j++;
   38|     24|        }
   39|    168|        serial[i] = (uint8_t)buffer;
   40|    168|        fill -= 8;
   41|    168|        buffer >>= 8;
   42|    168|    }
   43|      3|}
gf_strong_reduce:
   98|      6|{
   99|      6|    dsword_t scarry;
  100|      6|    word_t scarry_0;
  101|      6|    dword_t carry = 0;
  102|      6|    unsigned int i;
  103|       |
  104|       |    /* first, clear high */
  105|      6|    gf_weak_reduce(a); /* Determined to have negligible perf impact. */
  106|       |
  107|       |    /* now the total is less than 2p */
  108|       |
  109|       |    /* compute total_value - p.  No need to reduce mod p. */
  110|      6|    scarry = 0;
  111|     54|    for (i = 0; i < NLIMBS; i++) {
  ------------------
  |  |   21|     54|#define NLIMBS (64 / sizeof(word_t))
  ------------------
  |  Branch (111:17): [True: 48, False: 6]
  ------------------
  112|     48|        scarry = scarry + a->limb[LIMBPERM(i)] - MODULUS->limb[LIMBPERM(i)];
  ------------------
  |  |   69|     48|#define LIMBPERM(i) (i)
  ------------------
                      scarry = scarry + a->limb[LIMBPERM(i)] - MODULUS->limb[LIMBPERM(i)];
  ------------------
  |  |   69|     48|#define LIMBPERM(i) (i)
  ------------------
  113|     48|        a->limb[LIMBPERM(i)] = scarry & LIMB_MASK(LIMBPERM(i));
  ------------------
  |  |   69|     48|#define LIMBPERM(i) (i)
  ------------------
                      a->limb[LIMBPERM(i)] = scarry & LIMB_MASK(LIMBPERM(i));
  ------------------
  |  |   75|     48|#define LIMB_MASK(i) (((1ULL) << LIMB_PLACE_VALUE(i)) - 1)
  |  |  ------------------
  |  |  |  |   24|     48|#define LIMB_PLACE_VALUE(i) 56
  |  |  ------------------
  ------------------
  114|     48|        scarry >>= LIMB_PLACE_VALUE(LIMBPERM(i));
  ------------------
  |  |   24|     48|#define LIMB_PLACE_VALUE(i) 56
  ------------------
  115|     48|    }
  116|       |
  117|       |    /*
  118|       |     * uncommon case: it was >= p, so now scarry = 0 and this = x common case:
  119|       |     * it was < p, so now scarry = -1 and this = x - p + 2^255 so let's add
  120|       |     * back in p.  will carry back off the top for 2^255.
  121|       |     */
  122|      6|    assert(scarry == 0 || scarry == -1);
  ------------------
  |  Branch (122:5): [True: 6, False: 0]
  |  Branch (122:5): [True: 0, False: 0]
  |  Branch (122:5): [True: 3, False: 3]
  |  Branch (122:5): [True: 3, False: 0]
  ------------------
  123|       |
  124|      6|    scarry_0 = (word_t)scarry;
  125|       |
  126|       |    /* add it back */
  127|     54|    for (i = 0; i < NLIMBS; i++) {
  ------------------
  |  |   21|     54|#define NLIMBS (64 / sizeof(word_t))
  ------------------
  |  Branch (127:17): [True: 48, False: 6]
  ------------------
  128|     48|        carry = carry + a->limb[LIMBPERM(i)] + (scarry_0 & MODULUS->limb[LIMBPERM(i)]);
  ------------------
  |  |   69|     48|#define LIMBPERM(i) (i)
  ------------------
                      carry = carry + a->limb[LIMBPERM(i)] + (scarry_0 & MODULUS->limb[LIMBPERM(i)]);
  ------------------
  |  |   69|     48|#define LIMBPERM(i) (i)
  ------------------
  129|     48|        a->limb[LIMBPERM(i)] = carry & LIMB_MASK(LIMBPERM(i));
  ------------------
  |  |   69|     48|#define LIMBPERM(i) (i)
  ------------------
                      a->limb[LIMBPERM(i)] = carry & LIMB_MASK(LIMBPERM(i));
  ------------------
  |  |   75|     48|#define LIMB_MASK(i) (((1ULL) << LIMB_PLACE_VALUE(i)) - 1)
  |  |  ------------------
  |  |  |  |   24|     48|#define LIMB_PLACE_VALUE(i) 56
  |  |  ------------------
  ------------------
  130|     48|        carry >>= LIMB_PLACE_VALUE(LIMBPERM(i));
  ------------------
  |  |   24|     48|#define LIMB_PLACE_VALUE(i) 56
  ------------------
  131|     48|    }
  132|       |
  133|       |    assert(carry < 2 && ((word_t)carry + scarry_0) == 0);
  ------------------
  |  Branch (133:5): [True: 0, False: 6]
  |  Branch (133:5): [True: 0, False: 0]
  |  Branch (133:5): [True: 6, False: 0]
  |  Branch (133:5): [True: 6, False: 0]
  ------------------
  134|      6|}
gf_sub:
  138|    276|{
  139|    276|    gf_sub_RAW(d, a, b);
  140|    276|    gf_bias(d, 2);
  141|    276|    gf_weak_reduce(d);
  142|    276|}
gf_add:
  146|      3|{
  147|      3|    gf_add_RAW(d, a, b);
  148|      3|    gf_weak_reduce(d);
  149|      3|}
gf_eq:
  153|      3|{
  154|      3|    gf c;
  155|      3|    mask_t ret = 0;
  156|      3|    unsigned int i;
  157|       |
  158|      3|    gf_sub(c, a, b);
  159|      3|    gf_strong_reduce(c);
  160|       |
  161|     27|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |   21|     27|#define NLIMBS (64 / sizeof(word_t))
  ------------------
  |  Branch (161:17): [True: 24, False: 3]
  ------------------
  162|     24|        ret |= c->limb[LIMBPERM(i)];
  ------------------
  |  |   69|     24|#define LIMBPERM(i) (i)
  ------------------
  163|       |
  164|      3|    return word_is_zero(ret);
  ------------------
  |  |   20|      3|#define word_is_zero(a) constant_time_is_zero_64(a)
  ------------------
  165|      3|}
gf_isr:
  168|      3|{
  169|      3|    gf L0, L1, L2;
  170|       |
  171|      3|    ossl_gf_sqr(L1, x);
  172|      3|    ossl_gf_mul(L2, x, L1);
  173|      3|    ossl_gf_sqr(L1, L2);
  174|      3|    ossl_gf_mul(L2, x, L1);
  175|      3|    gf_sqrn(L1, L2, 3);
  176|      3|    ossl_gf_mul(L0, L2, L1);
  177|      3|    gf_sqrn(L1, L0, 3);
  178|      3|    ossl_gf_mul(L0, L2, L1);
  179|      3|    gf_sqrn(L2, L0, 9);
  180|      3|    ossl_gf_mul(L1, L0, L2);
  181|      3|    ossl_gf_sqr(L0, L1);
  182|      3|    ossl_gf_mul(L2, x, L0);
  183|      3|    gf_sqrn(L0, L2, 18);
  184|      3|    ossl_gf_mul(L2, L1, L0);
  185|      3|    gf_sqrn(L0, L2, 37);
  186|      3|    ossl_gf_mul(L1, L2, L0);
  187|      3|    gf_sqrn(L0, L1, 37);
  188|      3|    ossl_gf_mul(L1, L2, L0);
  189|      3|    gf_sqrn(L0, L1, 111);
  190|      3|    ossl_gf_mul(L2, L1, L0);
  191|      3|    ossl_gf_sqr(L0, L2);
  192|      3|    ossl_gf_mul(L1, x, L0);
  193|      3|    gf_sqrn(L0, L1, 223);
  194|      3|    ossl_gf_mul(L1, L2, L0);
  195|      3|    ossl_gf_sqr(L2, L1);
  196|      3|    ossl_gf_mul(L0, L2, x);
  197|      3|    gf_copy(a, L1);
  198|      3|    return gf_eq(L0, ONE);
  199|      3|}

curve448.c:gf_subx_nr:
  113|    102|{
  114|    102|    gf_sub_RAW(c, a, b);
  115|    102|    gf_bias(c, amt);
  116|    102|    if (GF_HEADROOM < amt + 1)
  ------------------
  |  |   16|    102|#define GF_HEADROOM 9999 /* Everything is reduced anyway */
  ------------------
  |  Branch (116:9): [True: 0, False: 102]
  ------------------
  117|      0|        gf_weak_reduce(c);
  118|    102|}
curve448.c:gf_cond_neg:
  150|    270|{
  151|    270|    gf y;
  152|       |
  153|    270|    gf_sub(y, ZERO, x);
  154|    270|    gf_cond_sel(x, x, y, neg);
  155|    270|}
curve448.c:gf_cond_sel:
  133|    270|{
  134|    270|    size_t i;
  135|       |
  136|  2.43k|    for (i = 0; i < NLIMBS; i++) {
  ------------------
  |  |   21|  2.43k|#define NLIMBS (64 / sizeof(word_t))
  ------------------
  |  Branch (136:17): [True: 2.16k, False: 270]
  ------------------
  137|       |#if ARCH_WORD_BITS == 32
  138|       |        x[0].limb[i] = constant_time_select_32(is_z, z[0].limb[i],
  139|       |            y[0].limb[i]);
  140|       |#else
  141|       |        /* Must be 64 bit */
  142|  2.16k|        x[0].limb[i] = constant_time_select_64(is_z, z[0].limb[i],
  143|  2.16k|            y[0].limb[i]);
  144|  2.16k|#endif
  145|  2.16k|    }
  146|    270|}
curve448.c:gf_copy:
   45|      6|{
   46|      6|    *out = *a;
   47|      6|}
curve448.c:gf_cond_swap:
  159|    270|{
  160|    270|    size_t i;
  161|       |
  162|  2.43k|    for (i = 0; i < NLIMBS; i++) {
  ------------------
  |  |   21|  2.43k|#define NLIMBS (64 / sizeof(word_t))
  ------------------
  |  Branch (162:17): [True: 2.16k, False: 270]
  ------------------
  163|       |#if ARCH_WORD_BITS == 32
  164|       |        constant_time_cond_swap_32(swap, &(x[0].limb[i]), &(y->limb[i]));
  165|       |#else
  166|       |        /* Must be 64 bit */
  167|  2.16k|        constant_time_cond_swap_64(swap, &(x[0].limb[i]), &(y->limb[i]));
  168|  2.16k|#endif
  169|  2.16k|    }
  170|    270|}
curve448.c:gf_sub_nr:
  104|    852|{
  105|    852|    gf_sub_RAW(c, a, b);
  106|    852|    gf_bias(c, 2);
  107|    852|    if (GF_HEADROOM < 3)
  ------------------
  |  |   16|    852|#define GF_HEADROOM 9999 /* Everything is reduced anyway */
  ------------------
  |  Branch (107:9): [Folded, False: 852]
  ------------------
  108|      0|        gf_weak_reduce(c);
  109|    852|}
f_generic.c:gf_copy:
   45|      6|{
   46|      6|    *out = *a;
   47|      6|}
f_generic.c:gf_sqrn:
   82|     24|{
   83|     24|    gf tmp;
   84|       |
   85|     24|    assert(n > 0);
  ------------------
  |  Branch (85:5): [True: 0, False: 24]
  |  Branch (85:5): [True: 24, False: 0]
  ------------------
   86|     24|    if (n & 1) {
  ------------------
  |  Branch (86:9): [True: 21, False: 3]
  ------------------
   87|     21|        ossl_gf_sqr(y, x);
   88|     21|        n--;
   89|     21|    } else {
   90|      3|        ossl_gf_sqr(tmp, x);
   91|      3|        ossl_gf_sqr(y, tmp);
   92|      3|        n -= 2;
   93|      3|    }
   94|    672|    for (; n; n -= 2) {
  ------------------
  |  Branch (94:12): [True: 648, False: 24]
  ------------------
   95|    648|        ossl_gf_sqr(tmp, y);
   96|    648|        ossl_gf_sqr(y, tmp);
   97|    648|    }
   98|     24|}

curve448.c:curve448_point_copy:
  177|      3|{
  178|      3|    *a = *b;
  179|      3|}

ossl_curve448_scalar_mul:
  100|      3|{
  101|      3|    sc_montmul(out, a, b);
  102|      3|    sc_montmul(out, out, sc_r2);
  103|      3|}
ossl_curve448_scalar_add:
  113|      3|{
  114|      3|    c448_dword_t chain = 0;
  115|      3|    unsigned int i;
  116|       |
  117|     24|    for (i = 0; i < C448_SCALAR_LIMBS; i++) {
  ------------------
  |  |   38|     24|#define C448_SCALAR_LIMBS ((446 - 1) / C448_WORD_BITS + 1)
  |  |  ------------------
  |  |  |  |   32|     24|#define C448_WORD_BITS 64 /* The number of bits in a word */
  |  |  ------------------
  ------------------
  |  Branch (117:17): [True: 21, False: 3]
  ------------------
  118|     21|        chain = (chain + a->limb[i]) + b->limb[i];
  119|     21|        out->limb[i] = (c448_word_t)chain;
  120|     21|        chain >>= WBITS;
  ------------------
  |  |   28|     21|#define WBITS C448_WORD_BITS /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|     21|#define C448_WORD_BITS 64 /* The number of bits in a word */
  |  |  ------------------
  ------------------
  121|     21|    }
  122|      3|    sc_subx(out, out->limb, sc_p, sc_p, (c448_word_t)chain);
  123|      3|}
ossl_curve448_scalar_destroy:
  158|      3|{
  159|      3|    OPENSSL_cleanse(scalar, sizeof(curve448_scalar_t));
  160|      3|}
ossl_curve448_scalar_decode_long:
  164|      3|{
  165|      3|    size_t i;
  166|      3|    curve448_scalar_t t1, t2;
  167|       |
  168|      3|    if (ser_len == 0) {
  ------------------
  |  Branch (168:9): [True: 0, False: 3]
  ------------------
  169|      0|        curve448_scalar_copy(s, ossl_curve448_scalar_zero);
  170|      0|        return;
  171|      0|    }
  172|       |
  173|      3|    i = ser_len - (ser_len % C448_SCALAR_BYTES);
  ------------------
  |  |   44|      3|#define C448_SCALAR_BYTES 56
  ------------------
  174|      3|    if (i == ser_len)
  ------------------
  |  Branch (174:9): [True: 3, False: 0]
  ------------------
  175|      3|        i -= C448_SCALAR_BYTES;
  ------------------
  |  |   44|      3|#define C448_SCALAR_BYTES 56
  ------------------
  176|       |
  177|      3|    scalar_decode_short(t1, &ser[i], ser_len - i);
  178|       |
  179|      3|    if (ser_len == sizeof(curve448_scalar_t)) {
  ------------------
  |  Branch (179:9): [True: 3, False: 0]
  ------------------
  180|      3|        assert(i == 0);
  ------------------
  |  Branch (180:9): [True: 0, False: 3]
  |  Branch (180:9): [True: 3, False: 0]
  ------------------
  181|       |        /* ham-handed reduce */
  182|      3|        ossl_curve448_scalar_mul(s, t1, ossl_curve448_scalar_one);
  183|      3|        ossl_curve448_scalar_destroy(t1);
  184|      3|        return;
  185|      3|    }
  186|       |
  187|      0|    while (i) {
  ------------------
  |  Branch (187:12): [True: 0, False: 0]
  ------------------
  188|      0|        i -= C448_SCALAR_BYTES;
  ------------------
  |  |   44|      0|#define C448_SCALAR_BYTES 56
  ------------------
  189|      0|        sc_montmul(t1, t1, sc_r2);
  190|      0|        (void)ossl_curve448_scalar_decode(t2, ser + i);
  191|      0|        ossl_curve448_scalar_add(t1, t1, t2);
  192|      0|    }
  193|       |
  194|      0|    curve448_scalar_copy(s, t1);
  195|      0|    ossl_curve448_scalar_destroy(t1);
  196|      0|    ossl_curve448_scalar_destroy(t2);
  197|      0|}
ossl_curve448_scalar_halve:
  211|      6|{
  212|      6|    c448_word_t mask = 0 - (a->limb[0] & 1);
  213|      6|    c448_dword_t chain = 0;
  214|      6|    unsigned int i;
  215|       |
  216|     48|    for (i = 0; i < C448_SCALAR_LIMBS; i++) {
  ------------------
  |  |   38|     48|#define C448_SCALAR_LIMBS ((446 - 1) / C448_WORD_BITS + 1)
  |  |  ------------------
  |  |  |  |   32|     48|#define C448_WORD_BITS 64 /* The number of bits in a word */
  |  |  ------------------
  ------------------
  |  Branch (216:17): [True: 42, False: 6]
  ------------------
  217|     42|        chain = (chain + a->limb[i]) + (sc_p->limb[i] & mask);
  218|     42|        out->limb[i] = (c448_word_t)chain;
  219|     42|        chain >>= C448_WORD_BITS;
  ------------------
  |  |   32|     42|#define C448_WORD_BITS 64 /* The number of bits in a word */
  ------------------
  220|     42|    }
  221|     42|    for (i = 0; i < C448_SCALAR_LIMBS - 1; i++)
  ------------------
  |  |   38|     42|#define C448_SCALAR_LIMBS ((446 - 1) / C448_WORD_BITS + 1)
  |  |  ------------------
  |  |  |  |   32|     42|#define C448_WORD_BITS 64 /* The number of bits in a word */
  |  |  ------------------
  ------------------
  |  Branch (221:17): [True: 36, False: 6]
  ------------------
  222|     36|        out->limb[i] = out->limb[i] >> 1 | out->limb[i + 1] << (WBITS - 1);
  ------------------
  |  |   28|     36|#define WBITS C448_WORD_BITS /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|     36|#define C448_WORD_BITS 64 /* The number of bits in a word */
  |  |  ------------------
  ------------------
  223|      6|    out->limb[i] = out->limb[i] >> 1 | (c448_word_t)(chain << (WBITS - 1));
  ------------------
  |  |   28|      6|#define WBITS C448_WORD_BITS /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|      6|#define C448_WORD_BITS 64 /* The number of bits in a word */
  |  |  ------------------
  ------------------
  224|      6|}
scalar.c:sc_montmul:
   63|      6|{
   64|      6|    unsigned int i, j;
   65|      6|    c448_word_t accum[C448_SCALAR_LIMBS + 1] = { 0 };
   66|      6|    c448_word_t hi_carry = 0;
   67|       |
   68|     48|    for (i = 0; i < C448_SCALAR_LIMBS; i++) {
  ------------------
  |  |   38|     48|#define C448_SCALAR_LIMBS ((446 - 1) / C448_WORD_BITS + 1)
  |  |  ------------------
  |  |  |  |   32|     48|#define C448_WORD_BITS 64 /* The number of bits in a word */
  |  |  ------------------
  ------------------
  |  Branch (68:17): [True: 42, False: 6]
  ------------------
   69|     42|        c448_word_t mand = a->limb[i];
   70|     42|        const c448_word_t *mier = b->limb;
   71|       |
   72|     42|        c448_dword_t chain = 0;
   73|    336|        for (j = 0; j < C448_SCALAR_LIMBS; j++) {
  ------------------
  |  |   38|    336|#define C448_SCALAR_LIMBS ((446 - 1) / C448_WORD_BITS + 1)
  |  |  ------------------
  |  |  |  |   32|    336|#define C448_WORD_BITS 64 /* The number of bits in a word */
  |  |  ------------------
  ------------------
  |  Branch (73:21): [True: 294, False: 42]
  ------------------
   74|    294|            chain += ((c448_dword_t)mand) * mier[j] + accum[j];
   75|    294|            accum[j] = (c448_word_t)chain;
   76|    294|            chain >>= WBITS;
  ------------------
  |  |   28|    294|#define WBITS C448_WORD_BITS /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|    294|#define C448_WORD_BITS 64 /* The number of bits in a word */
  |  |  ------------------
  ------------------
   77|    294|        }
   78|     42|        accum[j] = (c448_word_t)chain;
   79|       |
   80|     42|        mand = accum[0] * MONTGOMERY_FACTOR;
   81|     42|        chain = 0;
   82|     42|        mier = sc_p->limb;
   83|    336|        for (j = 0; j < C448_SCALAR_LIMBS; j++) {
  ------------------
  |  |   38|    336|#define C448_SCALAR_LIMBS ((446 - 1) / C448_WORD_BITS + 1)
  |  |  ------------------
  |  |  |  |   32|    336|#define C448_WORD_BITS 64 /* The number of bits in a word */
  |  |  ------------------
  ------------------
  |  Branch (83:21): [True: 294, False: 42]
  ------------------
   84|    294|            chain += (c448_dword_t)mand * mier[j] + accum[j];
   85|    294|            if (j)
  ------------------
  |  Branch (85:17): [True: 252, False: 42]
  ------------------
   86|    252|                accum[j - 1] = (c448_word_t)chain;
   87|    294|            chain >>= WBITS;
  ------------------
  |  |   28|    294|#define WBITS C448_WORD_BITS /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|    294|#define C448_WORD_BITS 64 /* The number of bits in a word */
  |  |  ------------------
  ------------------
   88|    294|        }
   89|     42|        chain += accum[j];
   90|     42|        chain += hi_carry;
   91|     42|        accum[j - 1] = (c448_word_t)chain;
   92|     42|        hi_carry = chain >> WBITS;
  ------------------
  |  |   28|     42|#define WBITS C448_WORD_BITS /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|     42|#define C448_WORD_BITS 64 /* The number of bits in a word */
  |  |  ------------------
  ------------------
   93|     42|    }
   94|       |
   95|      6|    sc_subx(out, accum, sc_p, sc_p, hi_carry);
   96|      6|}
scalar.c:sc_subx:
   41|      9|{
   42|      9|    c448_dsword_t chain = 0;
   43|      9|    unsigned int i;
   44|      9|    c448_word_t borrow;
   45|       |
   46|     72|    for (i = 0; i < C448_SCALAR_LIMBS; i++) {
  ------------------
  |  |   38|     72|#define C448_SCALAR_LIMBS ((446 - 1) / C448_WORD_BITS + 1)
  |  |  ------------------
  |  |  |  |   32|     72|#define C448_WORD_BITS 64 /* The number of bits in a word */
  |  |  ------------------
  ------------------
  |  Branch (46:17): [True: 63, False: 9]
  ------------------
   47|     63|        chain = (chain + accum[i]) - sub->limb[i];
   48|     63|        out->limb[i] = (c448_word_t)chain;
   49|     63|        chain >>= WBITS;
  ------------------
  |  |   28|     63|#define WBITS C448_WORD_BITS /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|     63|#define C448_WORD_BITS 64 /* The number of bits in a word */
  |  |  ------------------
  ------------------
   50|     63|    }
   51|      9|    borrow = (c448_word_t)chain + extra; /* = 0 or -1 */
   52|       |
   53|      9|    chain = 0;
   54|     72|    for (i = 0; i < C448_SCALAR_LIMBS; i++) {
  ------------------
  |  |   38|     72|#define C448_SCALAR_LIMBS ((446 - 1) / C448_WORD_BITS + 1)
  |  |  ------------------
  |  |  |  |   32|     72|#define C448_WORD_BITS 64 /* The number of bits in a word */
  |  |  ------------------
  ------------------
  |  Branch (54:17): [True: 63, False: 9]
  ------------------
   55|     63|        chain = (chain + out->limb[i]) + (p->limb[i] & borrow);
   56|     63|        out->limb[i] = (c448_word_t)chain;
   57|     63|        chain >>= WBITS;
  ------------------
  |  |   28|     63|#define WBITS C448_WORD_BITS /* NB this may be different from ARCH_WORD_BITS */
  |  |  ------------------
  |  |  |  |   32|     63|#define C448_WORD_BITS 64 /* The number of bits in a word */
  |  |  ------------------
  ------------------
   58|     63|    }
   59|      9|}
scalar.c:scalar_decode_short:
  128|      3|{
  129|      3|    size_t i, j, k = 0;
  130|       |
  131|     24|    for (i = 0; i < C448_SCALAR_LIMBS; i++) {
  ------------------
  |  |   38|     24|#define C448_SCALAR_LIMBS ((446 - 1) / C448_WORD_BITS + 1)
  |  |  ------------------
  |  |  |  |   32|     24|#define C448_WORD_BITS 64 /* The number of bits in a word */
  |  |  ------------------
  ------------------
  |  Branch (131:17): [True: 21, False: 3]
  ------------------
  132|     21|        c448_word_t out = 0;
  133|       |
  134|    189|        for (j = 0; j < sizeof(c448_word_t) && k < nbytes; j++, k++)
  ------------------
  |  Branch (134:21): [True: 168, False: 21]
  |  Branch (134:48): [True: 168, False: 0]
  ------------------
  135|    168|            out |= ((c448_word_t)ser[k]) << (8 * j);
  136|     21|        s->limb[i] = out;
  137|     21|    }
  138|      3|}

ec_ameth.c:eckey_pub_decode:
  101|   112k|{
  102|   112k|    const unsigned char *p = NULL;
  103|   112k|    int pklen;
  104|   112k|    EC_KEY *eckey = NULL;
  105|   112k|    X509_ALGOR *palg;
  106|   112k|    OSSL_LIB_CTX *libctx = NULL;
  107|   112k|    const char *propq = NULL;
  108|       |
  109|   112k|    if (!ossl_x509_PUBKEY_get0_libctx(&libctx, &propq, pubkey)
  ------------------
  |  Branch (109:9): [True: 0, False: 112k]
  ------------------
  110|   112k|        || !X509_PUBKEY_get0_param(NULL, &p, &pklen, &palg, pubkey))
  ------------------
  |  Branch (110:12): [True: 0, False: 112k]
  ------------------
  111|      0|        return 0;
  112|   112k|    eckey = ossl_ec_key_param_from_x509_algor(palg, libctx, propq);
  113|       |
  114|   112k|    if (!eckey)
  ------------------
  |  Branch (114:9): [True: 0, False: 112k]
  ------------------
  115|      0|        return 0;
  116|       |
  117|       |    /* We have parameters now set public key */
  118|   112k|    if (!o2i_ECPublicKey(&eckey, &p, pklen)) {
  ------------------
  |  Branch (118:9): [True: 0, False: 112k]
  ------------------
  119|      0|        ERR_raise(ERR_LIB_EC, EC_R_DECODE_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  120|      0|        goto ecerr;
  121|      0|    }
  122|       |
  123|   112k|    EVP_PKEY_assign_EC_KEY(pkey, eckey);
  ------------------
  |  |  527|   112k|#define EVP_PKEY_assign_EC_KEY(pkey, eckey) EVP_PKEY_assign((pkey), \
  |  |  528|   112k|    EVP_PKEY_EC,                                                    \
  |  |  ------------------
  |  |  |  |   73|   112k|#define EVP_PKEY_EC NID_X9_62_id_ecPublicKey
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|   112k|#define NID_X9_62_id_ecPublicKey                408
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  529|   112k|    (eckey))
  ------------------
  124|   112k|    return 1;
  125|       |
  126|      0|ecerr:
  127|      0|    EC_KEY_free(eckey);
  128|      0|    return 0;
  129|   112k|}
ec_ameth.c:int_ec_free:
  273|   112k|{
  274|   112k|    EC_KEY_free(pkey->pkey.ec);
  275|   112k|}

o2i_ECPublicKey:
 1122|   112k|{
 1123|   112k|    EC_KEY *ret = NULL;
 1124|       |
 1125|   112k|    if (a == NULL || (*a) == NULL || (*a)->group == NULL) {
  ------------------
  |  Branch (1125:9): [True: 0, False: 112k]
  |  Branch (1125:22): [True: 0, False: 112k]
  |  Branch (1125:38): [True: 0, False: 112k]
  ------------------
 1126|       |        /*
 1127|       |         * sorry, but a EC_GROUP-structure is necessary to set the public key
 1128|       |         */
 1129|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1130|      0|        return 0;
 1131|      0|    }
 1132|   112k|    ret = *a;
 1133|       |    /* EC_KEY_opt2key updates dirty_cnt */
 1134|   112k|    if (!EC_KEY_oct2key(ret, *in, len, NULL)) {
  ------------------
  |  Branch (1134:9): [True: 0, False: 112k]
  ------------------
 1135|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1136|      0|        return 0;
 1137|      0|    }
 1138|   112k|    *in += len;
 1139|   112k|    return ret;
 1140|   112k|}
i2d_ECDSA_SIG:
 1232|   113k|{
 1233|   113k|    BUF_MEM *buf = NULL;
 1234|   113k|    size_t encoded_len;
 1235|   113k|    WPACKET pkt;
 1236|       |
 1237|   113k|    if (ppout == NULL) {
  ------------------
  |  Branch (1237:9): [True: 113k, False: 0]
  ------------------
 1238|   113k|        if (!WPACKET_init_null(&pkt, 0))
  ------------------
  |  Branch (1238:13): [True: 0, False: 113k]
  ------------------
 1239|      0|            return -1;
 1240|   113k|    } else if (*ppout == NULL) {
  ------------------
  |  Branch (1240:16): [True: 0, False: 0]
  ------------------
 1241|      0|        if ((buf = BUF_MEM_new()) == NULL
  ------------------
  |  Branch (1241:13): [True: 0, False: 0]
  ------------------
 1242|      0|            || !WPACKET_init_len(&pkt, buf, 0)) {
  ------------------
  |  Branch (1242:16): [True: 0, False: 0]
  ------------------
 1243|      0|            BUF_MEM_free(buf);
 1244|      0|            return -1;
 1245|      0|        }
 1246|      0|    } else {
 1247|      0|        if (!WPACKET_init_static_len(&pkt, *ppout, SIZE_MAX, 0))
  ------------------
  |  Branch (1247:13): [True: 0, False: 0]
  ------------------
 1248|      0|            return -1;
 1249|      0|    }
 1250|       |
 1251|   113k|    if (!ossl_encode_der_dsa_sig(&pkt, sig->r, sig->s)
  ------------------
  |  Branch (1251:9): [True: 0, False: 113k]
  ------------------
 1252|   113k|        || !WPACKET_get_total_written(&pkt, &encoded_len)
  ------------------
  |  Branch (1252:12): [True: 0, False: 113k]
  ------------------
 1253|   113k|        || !WPACKET_finish(&pkt)) {
  ------------------
  |  Branch (1253:12): [True: 0, False: 113k]
  ------------------
 1254|      0|        BUF_MEM_free(buf);
 1255|      0|        WPACKET_cleanup(&pkt);
 1256|      0|        return -1;
 1257|      0|    }
 1258|       |
 1259|   113k|    if (ppout != NULL) {
  ------------------
  |  Branch (1259:9): [True: 0, False: 113k]
  ------------------
 1260|      0|        if (*ppout == NULL) {
  ------------------
  |  Branch (1260:13): [True: 0, False: 0]
  ------------------
 1261|      0|            *ppout = (unsigned char *)buf->data;
 1262|      0|            buf->data = NULL;
 1263|      0|            BUF_MEM_free(buf);
 1264|      0|        } else {
 1265|      0|            *ppout += encoded_len;
 1266|      0|        }
 1267|      0|    }
 1268|       |
 1269|   113k|    return (int)encoded_len;
 1270|   113k|}
ECDSA_size:
 1302|   113k|{
 1303|   113k|    int ret;
 1304|   113k|    ECDSA_SIG sig;
 1305|   113k|    const EC_GROUP *group;
 1306|   113k|    const BIGNUM *bn;
 1307|       |
 1308|   113k|    if (ec == NULL)
  ------------------
  |  Branch (1308:9): [True: 0, False: 113k]
  ------------------
 1309|      0|        return 0;
 1310|   113k|    group = EC_KEY_get0_group(ec);
 1311|   113k|    if (group == NULL)
  ------------------
  |  Branch (1311:9): [True: 0, False: 113k]
  ------------------
 1312|      0|        return 0;
 1313|       |
 1314|   113k|    bn = EC_GROUP_get0_order(group);
 1315|   113k|    if (bn == NULL)
  ------------------
  |  Branch (1315:9): [True: 0, False: 113k]
  ------------------
 1316|      0|        return 0;
 1317|       |
 1318|   113k|    sig.r = sig.s = (BIGNUM *)bn;
 1319|   113k|    ret = i2d_ECDSA_SIG(&sig, NULL);
 1320|       |
 1321|   113k|    if (ret < 0)
  ------------------
  |  Branch (1321:9): [True: 0, False: 113k]
  ------------------
 1322|      0|        ret = 0;
 1323|   113k|    return ret;
 1324|   113k|}

ossl_ec_check_group_type_id2name:
   76|   113k|{
   77|   113k|    size_t i, sz;
   78|       |
   79|   113k|    for (i = 0, sz = OSSL_NELEM(check_group_type_nameid_map); i < sz; i++) {
  ------------------
  |  |   14|   113k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (79:63): [True: 113k, False: 0]
  ------------------
   80|   113k|        if (id == (int)check_group_type_nameid_map[i].id)
  ------------------
  |  Branch (80:13): [True: 113k, False: 0]
  ------------------
   81|   113k|            return check_group_type_nameid_map[i].ptr;
   82|   113k|    }
   83|      0|    return NULL;
   84|   113k|}
ossl_ec_pt_format_id2name:
  147|   227k|{
  148|   227k|    size_t i, sz;
  149|       |
  150|   227k|    for (i = 0, sz = OSSL_NELEM(format_nameid_map); i < sz; i++) {
  ------------------
  |  |   14|   227k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (150:53): [True: 227k, False: 0]
  ------------------
  151|   227k|        if (id == (int)format_nameid_map[i].id)
  ------------------
  |  Branch (151:13): [True: 227k, False: 0]
  ------------------
  152|   227k|            return format_nameid_map[i].ptr;
  153|   227k|    }
  154|      0|    return NULL;
  155|   227k|}
ossl_ec_group_todata:
  292|   113k|{
  293|   113k|    int ret = 0, curve_nid, encoding_flag;
  294|   113k|    const char *encoding_name, *pt_form_name;
  295|   113k|    point_conversion_form_t genform;
  296|       |
  297|   113k|    if (group == NULL) {
  ------------------
  |  Branch (297:9): [True: 0, False: 113k]
  ------------------
  298|      0|        ERR_raise(ERR_LIB_EC, EC_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  299|      0|        return 0;
  300|      0|    }
  301|       |
  302|   113k|    genform = EC_GROUP_get_point_conversion_form(group);
  303|   113k|    pt_form_name = ossl_ec_pt_format_id2name(genform);
  304|   113k|    if (pt_form_name == NULL
  ------------------
  |  Branch (304:9): [True: 0, False: 113k]
  ------------------
  305|   113k|        || !ossl_param_build_set_utf8_string(
  ------------------
  |  Branch (305:12): [True: 0, False: 113k]
  ------------------
  306|   113k|            tmpl, params,
  307|   113k|            OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT, pt_form_name)) {
  ------------------
  |  |  394|   113k|# define OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT "point-format"
  ------------------
  308|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_FORM);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  309|      0|        return 0;
  310|      0|    }
  311|   113k|    encoding_flag = EC_GROUP_get_asn1_flag(group) & OPENSSL_EC_NAMED_CURVE;
  ------------------
  |  |   31|   113k|#define OPENSSL_EC_NAMED_CURVE 0x001
  ------------------
  312|   113k|    encoding_name = ec_param_encoding_id2name(encoding_flag);
  313|   113k|    if (encoding_name == NULL
  ------------------
  |  Branch (313:9): [True: 0, False: 113k]
  ------------------
  314|   113k|        || !ossl_param_build_set_utf8_string(tmpl, params,
  ------------------
  |  Branch (314:12): [True: 0, False: 113k]
  ------------------
  315|   113k|            OSSL_PKEY_PARAM_EC_ENCODING,
  ------------------
  |  |  387|   113k|# define OSSL_PKEY_PARAM_EC_ENCODING "encoding"
  ------------------
  316|   113k|            encoding_name)) {
  317|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  318|      0|        return 0;
  319|      0|    }
  320|       |
  321|   113k|    if (!ossl_param_build_set_int(tmpl, params,
  ------------------
  |  Branch (321:9): [True: 0, False: 113k]
  ------------------
  322|   113k|            OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS,
  ------------------
  |  |  386|   113k|# define OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS "decoded-from-explicit"
  ------------------
  323|   113k|            group->decoded_from_explicit_params))
  324|      0|        return 0;
  325|       |
  326|   113k|    curve_nid = EC_GROUP_get_curve_name(group);
  327|       |
  328|       |    /*
  329|       |     * Get the explicit parameters in these two cases:
  330|       |     * - We do not have a template, i.e. specific parameters are requested
  331|       |     * - The curve is not a named curve
  332|       |     */
  333|   113k|    if (tmpl == NULL || curve_nid == NID_undef)
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (333:9): [True: 113k, False: 0]
  |  Branch (333:25): [True: 0, False: 0]
  ------------------
  334|   113k|        if (!ec_group_explicit_todata(group, tmpl, params, bnctx, genbuf))
  ------------------
  |  Branch (334:13): [True: 0, False: 113k]
  ------------------
  335|      0|            goto err;
  336|       |
  337|   113k|    if (curve_nid != NID_undef) {
  ------------------
  |  |   18|   113k|#define NID_undef                       0
  ------------------
  |  Branch (337:9): [True: 113k, False: 0]
  ------------------
  338|       |        /* Named curve */
  339|   113k|        const char *curve_name = OSSL_EC_curve_nid2name(curve_nid);
  340|       |
  341|   113k|        if (curve_name == NULL
  ------------------
  |  Branch (341:13): [True: 0, False: 113k]
  ------------------
  342|   113k|            || !ossl_param_build_set_utf8_string(tmpl, params,
  ------------------
  |  Branch (342:16): [True: 0, False: 113k]
  ------------------
  343|   113k|                OSSL_PKEY_PARAM_GROUP_NAME,
  ------------------
  |  |  420|   113k|# define OSSL_PKEY_PARAM_GROUP_NAME "group"
  ------------------
  344|   113k|                curve_name)) {
  345|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_CURVE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  346|      0|            goto err;
  347|      0|        }
  348|   113k|    }
  349|   113k|    ret = 1;
  350|   113k|err:
  351|   113k|    return ret;
  352|   113k|}
ossl_ec_set_ecdh_cofactor_mode:
  360|    226|{
  361|    226|    const EC_GROUP *ecg = EC_KEY_get0_group(ec);
  362|    226|    const BIGNUM *cofactor;
  363|       |    /*
  364|       |     * mode can be only 0 for disable, or 1 for enable here.
  365|       |     *
  366|       |     * This is in contrast with the same parameter on an ECDH EVP_PKEY_CTX that
  367|       |     * also supports mode == -1 with the meaning of "reset to the default for
  368|       |     * the associated key".
  369|       |     */
  370|    226|    if (mode < 0 || mode > 1)
  ------------------
  |  Branch (370:9): [True: 0, False: 226]
  |  Branch (370:21): [True: 0, False: 226]
  ------------------
  371|      0|        return 0;
  372|       |
  373|    226|    if ((cofactor = EC_GROUP_get0_cofactor(ecg)) == NULL)
  ------------------
  |  Branch (373:9): [True: 0, False: 226]
  ------------------
  374|      0|        return 0;
  375|       |
  376|       |    /* ECDH cofactor mode has no effect if cofactor is 1 */
  377|    226|    if (BN_is_one(cofactor))
  ------------------
  |  Branch (377:9): [True: 226, False: 0]
  ------------------
  378|    226|        return 1;
  379|       |
  380|      0|    if (mode == 1)
  ------------------
  |  Branch (380:9): [True: 0, False: 0]
  ------------------
  381|      0|        EC_KEY_set_flags(ec, EC_FLAG_COFACTOR_ECDH);
  ------------------
  |  |  955|      0|#define EC_FLAG_COFACTOR_ECDH 0x1000
  ------------------
  382|      0|    else if (mode == 0)
  ------------------
  |  Branch (382:14): [True: 0, False: 0]
  ------------------
  383|      0|        EC_KEY_clear_flags(ec, EC_FLAG_COFACTOR_ECDH);
  ------------------
  |  |  955|      0|#define EC_FLAG_COFACTOR_ECDH 0x1000
  ------------------
  384|       |
  385|      0|    return 1;
  386|    226|}
ossl_ec_key_is_foreign:
  586|   112k|{
  587|   112k|#ifndef FIPS_MODULE
  588|   112k|    if (ec->engine != NULL || EC_KEY_get_method(ec) != EC_KEY_OpenSSL())
  ------------------
  |  Branch (588:9): [True: 0, False: 112k]
  |  Branch (588:31): [True: 0, False: 112k]
  ------------------
  589|      0|        return 1;
  590|   112k|#endif
  591|   112k|    return 0;
  592|   112k|}
ossl_x509_algor_is_sm2:
  731|   112k|{
  732|   112k|    int ptype = 0;
  733|   112k|    const void *pval = NULL;
  734|       |
  735|   112k|    X509_ALGOR_get0(NULL, &ptype, &pval, palg);
  736|       |
  737|   112k|    if (ptype == V_ASN1_OBJECT)
  ------------------
  |  |   70|   112k|#define V_ASN1_OBJECT 6
  ------------------
  |  Branch (737:9): [True: 112k, False: 0]
  ------------------
  738|   112k|        return OBJ_obj2nid((ASN1_OBJECT *)pval) == NID_sm2;
  ------------------
  |  | 1255|   112k|#define NID_sm2         1172
  ------------------
  739|       |
  740|      0|    if (ptype == V_ASN1_SEQUENCE) {
  ------------------
  |  |   76|      0|#define V_ASN1_SEQUENCE 16
  ------------------
  |  Branch (740:9): [True: 0, False: 0]
  ------------------
  741|      0|        const ASN1_STRING *str = pval;
  742|      0|        const unsigned char *der = str->data;
  743|      0|        int derlen = str->length;
  744|      0|        EC_GROUP *group;
  745|      0|        int ret;
  746|       |
  747|      0|        if ((group = d2i_ECPKParameters(NULL, &der, derlen)) == NULL)
  ------------------
  |  Branch (747:13): [True: 0, False: 0]
  ------------------
  748|      0|            ret = 0;
  749|      0|        else
  750|      0|            ret = (EC_GROUP_get_curve_name(group) == NID_sm2);
  ------------------
  |  | 1255|      0|#define NID_sm2         1172
  ------------------
  751|       |
  752|      0|        EC_GROUP_free(group);
  753|      0|        return ret;
  754|      0|    }
  755|       |
  756|      0|    return 0;
  757|      0|}
ossl_ec_key_param_from_x509_algor:
  761|   112k|{
  762|   112k|    int ptype = 0;
  763|   112k|    const void *pval = NULL;
  764|   112k|    EC_KEY *eckey = NULL;
  765|   112k|    EC_GROUP *group = NULL;
  766|       |
  767|   112k|    X509_ALGOR_get0(NULL, &ptype, &pval, palg);
  768|   112k|    if ((eckey = EC_KEY_new_ex(libctx, propq)) == NULL) {
  ------------------
  |  Branch (768:9): [True: 0, False: 112k]
  ------------------
  769|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  770|      0|        goto ecerr;
  771|      0|    }
  772|       |
  773|   112k|    if (ptype == V_ASN1_SEQUENCE) {
  ------------------
  |  |   76|   112k|#define V_ASN1_SEQUENCE 16
  ------------------
  |  Branch (773:9): [True: 0, False: 112k]
  ------------------
  774|      0|        const ASN1_STRING *pstr = pval;
  775|      0|        const unsigned char *pm = pstr->data;
  776|      0|        int pmlen = pstr->length;
  777|       |
  778|      0|        if (d2i_ECParameters(&eckey, &pm, pmlen) == NULL) {
  ------------------
  |  Branch (778:13): [True: 0, False: 0]
  ------------------
  779|      0|            ERR_raise(ERR_LIB_EC, EC_R_DECODE_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  780|      0|            goto ecerr;
  781|      0|        }
  782|   112k|    } else if (ptype == V_ASN1_OBJECT) {
  ------------------
  |  |   70|   112k|#define V_ASN1_OBJECT 6
  ------------------
  |  Branch (782:16): [True: 112k, False: 0]
  ------------------
  783|   112k|        const ASN1_OBJECT *poid = pval;
  784|       |
  785|       |        /*
  786|       |         * type == V_ASN1_OBJECT => the parameters are given by an asn1 OID
  787|       |         */
  788|       |
  789|   112k|        group = EC_GROUP_new_by_curve_name_ex(libctx, propq, OBJ_obj2nid(poid));
  790|   112k|        if (group == NULL)
  ------------------
  |  Branch (790:13): [True: 0, False: 112k]
  ------------------
  791|      0|            goto ecerr;
  792|   112k|        EC_GROUP_set_asn1_flag(group, OPENSSL_EC_NAMED_CURVE);
  ------------------
  |  |   31|   112k|#define OPENSSL_EC_NAMED_CURVE 0x001
  ------------------
  793|   112k|        if (EC_KEY_set_group(eckey, group) == 0)
  ------------------
  |  Branch (793:13): [True: 0, False: 112k]
  ------------------
  794|      0|            goto ecerr;
  795|   112k|        EC_GROUP_free(group);
  796|   112k|    } else {
  797|      0|        ERR_raise(ERR_LIB_EC, EC_R_DECODE_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  798|      0|        goto ecerr;
  799|      0|    }
  800|       |
  801|   112k|    return eckey;
  802|       |
  803|      0|ecerr:
  804|      0|    EC_KEY_free(eckey);
  805|      0|    EC_GROUP_free(group);
  806|       |    return NULL;
  807|   112k|}
ec_backend.c:ec_param_encoding_id2name:
   65|   113k|{
   66|   113k|    size_t i, sz;
   67|       |
   68|   227k|    for (i = 0, sz = OSSL_NELEM(encoding_nameid_map); i < sz; i++) {
  ------------------
  |  |   14|   113k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (68:55): [True: 227k, False: 0]
  ------------------
   69|   227k|        if (id == (int)encoding_nameid_map[i].id)
  ------------------
  |  Branch (69:13): [True: 113k, False: 113k]
  ------------------
   70|   113k|            return encoding_nameid_map[i].ptr;
   71|   227k|    }
   72|      0|    return NULL;
   73|   113k|}
ec_backend.c:ec_group_explicit_todata:
  160|   113k|{
  161|   113k|    int ret = 0, fid;
  162|   113k|    const char *field_type;
  163|   113k|    const OSSL_PARAM *param = NULL;
  164|   113k|    const OSSL_PARAM *param_p = NULL;
  165|   113k|    const OSSL_PARAM *param_a = NULL;
  166|   113k|    const OSSL_PARAM *param_b = NULL;
  167|       |
  168|   113k|    fid = EC_GROUP_get_field_type(group);
  169|       |
  170|   113k|    if (fid == NID_X9_62_prime_field) {
  ------------------
  |  |  152|   113k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (170:9): [True: 113k, False: 0]
  ------------------
  171|   113k|        field_type = SN_X9_62_prime_field;
  ------------------
  |  |  151|   113k|#define SN_X9_62_prime_field            "prime-field"
  ------------------
  172|   113k|    } else if (fid == NID_X9_62_characteristic_two_field) {
  ------------------
  |  |  156|      0|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (172:16): [True: 0, False: 0]
  ------------------
  173|       |#ifdef OPENSSL_NO_EC2M
  174|       |        ERR_raise(ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED);
  175|       |        goto err;
  176|       |#else
  177|      0|        field_type = SN_X9_62_characteristic_two_field;
  ------------------
  |  |  155|      0|#define SN_X9_62_characteristic_two_field               "characteristic-two-field"
  ------------------
  178|      0|#endif
  179|      0|    } else {
  180|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_FIELD);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  181|      0|        return 0;
  182|      0|    }
  183|       |
  184|   113k|    param_p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_P);
  ------------------
  |  |  393|   113k|# define OSSL_PKEY_PARAM_EC_P "p"
  ------------------
  185|   113k|    param_a = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_A);
  ------------------
  |  |  377|   113k|# define OSSL_PKEY_PARAM_EC_A "a"
  ------------------
  186|   113k|    param_b = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_B);
  ------------------
  |  |  378|   113k|# define OSSL_PKEY_PARAM_EC_B "b"
  ------------------
  187|   113k|    if (tmpl != NULL || param_p != NULL || param_a != NULL || param_b != NULL) {
  ------------------
  |  Branch (187:9): [True: 0, False: 113k]
  |  Branch (187:25): [True: 0, False: 113k]
  |  Branch (187:44): [True: 0, False: 113k]
  |  Branch (187:63): [True: 0, False: 113k]
  ------------------
  188|      0|        BIGNUM *p = BN_CTX_get(bnctx);
  189|      0|        BIGNUM *a = BN_CTX_get(bnctx);
  190|      0|        BIGNUM *b = BN_CTX_get(bnctx);
  191|       |
  192|      0|        if (b == NULL) {
  ------------------
  |  Branch (192:13): [True: 0, False: 0]
  ------------------
  193|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  194|      0|            goto err;
  195|      0|        }
  196|       |
  197|      0|        if (!EC_GROUP_get_curve(group, p, a, b, bnctx)) {
  ------------------
  |  Branch (197:13): [True: 0, False: 0]
  ------------------
  198|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_CURVE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  199|      0|            goto err;
  200|      0|        }
  201|      0|        if (!ossl_param_build_set_bn(tmpl, params, OSSL_PKEY_PARAM_EC_P, p)
  ------------------
  |  |  393|      0|# define OSSL_PKEY_PARAM_EC_P "p"
  ------------------
  |  Branch (201:13): [True: 0, False: 0]
  ------------------
  202|      0|            || !ossl_param_build_set_bn(tmpl, params, OSSL_PKEY_PARAM_EC_A, a)
  ------------------
  |  |  377|      0|# define OSSL_PKEY_PARAM_EC_A "a"
  ------------------
  |  Branch (202:16): [True: 0, False: 0]
  ------------------
  203|      0|            || !ossl_param_build_set_bn(tmpl, params, OSSL_PKEY_PARAM_EC_B, b)) {
  ------------------
  |  |  378|      0|# define OSSL_PKEY_PARAM_EC_B "b"
  ------------------
  |  Branch (203:16): [True: 0, False: 0]
  ------------------
  204|      0|            ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  205|      0|            goto err;
  206|      0|        }
  207|      0|    }
  208|       |
  209|   113k|    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_ORDER);
  ------------------
  |  |  392|   113k|# define OSSL_PKEY_PARAM_EC_ORDER "order"
  ------------------
  210|   113k|    if (tmpl != NULL || param != NULL) {
  ------------------
  |  Branch (210:9): [True: 0, False: 113k]
  |  Branch (210:25): [True: 0, False: 113k]
  ------------------
  211|      0|        const BIGNUM *order = EC_GROUP_get0_order(group);
  212|       |
  213|      0|        if (order == NULL) {
  ------------------
  |  Branch (213:13): [True: 0, False: 0]
  ------------------
  214|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  215|      0|            goto err;
  216|      0|        }
  217|      0|        if (!ossl_param_build_set_bn(tmpl, params, OSSL_PKEY_PARAM_EC_ORDER,
  ------------------
  |  |  392|      0|# define OSSL_PKEY_PARAM_EC_ORDER "order"
  ------------------
  |  Branch (217:13): [True: 0, False: 0]
  ------------------
  218|      0|                order)) {
  219|      0|            ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  220|      0|            goto err;
  221|      0|        }
  222|      0|    }
  223|       |
  224|   113k|    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_FIELD_TYPE);
  ------------------
  |  |  388|   113k|# define OSSL_PKEY_PARAM_EC_FIELD_TYPE "field-type"
  ------------------
  225|   113k|    if (tmpl != NULL || param != NULL) {
  ------------------
  |  Branch (225:9): [True: 0, False: 113k]
  |  Branch (225:25): [True: 0, False: 113k]
  ------------------
  226|      0|        if (!ossl_param_build_set_utf8_string(tmpl, params,
  ------------------
  |  Branch (226:13): [True: 0, False: 0]
  ------------------
  227|      0|                OSSL_PKEY_PARAM_EC_FIELD_TYPE,
  ------------------
  |  |  388|      0|# define OSSL_PKEY_PARAM_EC_FIELD_TYPE "field-type"
  ------------------
  228|      0|                field_type)) {
  229|      0|            ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  230|      0|            goto err;
  231|      0|        }
  232|      0|    }
  233|       |
  234|   113k|    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_GENERATOR);
  ------------------
  |  |  389|   113k|# define OSSL_PKEY_PARAM_EC_GENERATOR "generator"
  ------------------
  235|   113k|    if (tmpl != NULL || param != NULL) {
  ------------------
  |  Branch (235:9): [True: 0, False: 113k]
  |  Branch (235:25): [True: 0, False: 113k]
  ------------------
  236|      0|        size_t genbuf_len;
  237|      0|        const EC_POINT *genpt = EC_GROUP_get0_generator(group);
  238|      0|        point_conversion_form_t genform = EC_GROUP_get_point_conversion_form(group);
  239|       |
  240|      0|        if (genpt == NULL) {
  ------------------
  |  Branch (240:13): [True: 0, False: 0]
  ------------------
  241|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_GENERATOR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  242|      0|            goto err;
  243|      0|        }
  244|      0|        genbuf_len = EC_POINT_point2buf(group, genpt, genform, genbuf, bnctx);
  245|      0|        if (genbuf_len == 0) {
  ------------------
  |  Branch (245:13): [True: 0, False: 0]
  ------------------
  246|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_GENERATOR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  247|      0|            goto err;
  248|      0|        }
  249|      0|        if (!ossl_param_build_set_octet_string(tmpl, params,
  ------------------
  |  Branch (249:13): [True: 0, False: 0]
  ------------------
  250|      0|                OSSL_PKEY_PARAM_EC_GENERATOR,
  ------------------
  |  |  389|      0|# define OSSL_PKEY_PARAM_EC_GENERATOR "generator"
  ------------------
  251|      0|                *genbuf, genbuf_len)) {
  252|      0|            ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  253|      0|            goto err;
  254|      0|        }
  255|      0|    }
  256|       |
  257|   113k|    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_COFACTOR);
  ------------------
  |  |  385|   113k|# define OSSL_PKEY_PARAM_EC_COFACTOR "cofactor"
  ------------------
  258|   113k|    if (tmpl != NULL || param != NULL) {
  ------------------
  |  Branch (258:9): [True: 0, False: 113k]
  |  Branch (258:25): [True: 0, False: 113k]
  ------------------
  259|      0|        const BIGNUM *cofactor = EC_GROUP_get0_cofactor(group);
  260|       |
  261|      0|        if (cofactor != NULL
  ------------------
  |  Branch (261:13): [True: 0, False: 0]
  ------------------
  262|      0|            && !ossl_param_build_set_bn(tmpl, params,
  ------------------
  |  Branch (262:16): [True: 0, False: 0]
  ------------------
  263|      0|                OSSL_PKEY_PARAM_EC_COFACTOR, cofactor)) {
  ------------------
  |  |  385|      0|# define OSSL_PKEY_PARAM_EC_COFACTOR "cofactor"
  ------------------
  264|      0|            ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  265|      0|            goto err;
  266|      0|        }
  267|      0|    }
  268|       |
  269|   113k|    param = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_SEED);
  ------------------
  |  |  397|   113k|# define OSSL_PKEY_PARAM_EC_SEED "seed"
  ------------------
  270|   113k|    if (tmpl != NULL || param != NULL) {
  ------------------
  |  Branch (270:9): [True: 0, False: 113k]
  |  Branch (270:25): [True: 0, False: 113k]
  ------------------
  271|      0|        unsigned char *seed = EC_GROUP_get0_seed(group);
  272|      0|        size_t seed_len = EC_GROUP_get_seed_len(group);
  273|       |
  274|      0|        if (seed != NULL
  ------------------
  |  Branch (274:13): [True: 0, False: 0]
  ------------------
  275|      0|            && seed_len > 0
  ------------------
  |  Branch (275:16): [True: 0, False: 0]
  ------------------
  276|      0|            && !ossl_param_build_set_octet_string(tmpl, params,
  ------------------
  |  Branch (276:16): [True: 0, False: 0]
  ------------------
  277|      0|                OSSL_PKEY_PARAM_EC_SEED,
  ------------------
  |  |  397|      0|# define OSSL_PKEY_PARAM_EC_SEED "seed"
  ------------------
  278|      0|                seed, seed_len)) {
  279|      0|            ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  280|      0|            goto err;
  281|      0|        }
  282|      0|    }
  283|   113k|    ret = 1;
  284|   113k|err:
  285|   113k|    return ret;
  286|   113k|}

EC_GROUP_new_by_curve_name_ex:
 3190|   113k|{
 3191|   113k|    EC_GROUP *ret = NULL;
 3192|   113k|    const ec_list_element *curve;
 3193|       |
 3194|   113k|    if ((curve = ec_curve_nid2curve(nid)) == NULL
  ------------------
  |  Branch (3194:9): [True: 0, False: 113k]
  ------------------
 3195|   113k|        || (ret = ec_group_new_from_data(libctx, propq, *curve)) == NULL) {
  ------------------
  |  Branch (3195:12): [True: 0, False: 113k]
  ------------------
 3196|      0|#ifndef FIPS_MODULE
 3197|      0|        ERR_raise_data(ERR_LIB_EC, EC_R_UNKNOWN_GROUP,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EC, EC_R_UNKNOWN_GROUP,
  ------------------
  |  |   88|      0|#define ERR_LIB_EC 16
  ------------------
                      ERR_raise_data(ERR_LIB_EC, EC_R_UNKNOWN_GROUP,
  ------------------
  |  |   95|      0|#define EC_R_UNKNOWN_GROUP 129
  ------------------
 3198|      0|            "name=%s", OBJ_nid2sn(nid));
 3199|       |#else
 3200|       |        ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_GROUP);
 3201|       |#endif
 3202|      0|        return NULL;
 3203|      0|    }
 3204|       |
 3205|   113k|    return ret;
 3206|   113k|}
ec_curve.c:ec_curve_nid2curve:
 3013|   113k|{
 3014|   113k|    size_t i;
 3015|       |
 3016|   113k|    if (nid <= 0)
  ------------------
  |  Branch (3016:9): [True: 0, False: 113k]
  ------------------
 3017|      0|        return NULL;
 3018|       |
 3019|  1.45M|    for (i = 0; i < curve_list_length; i++) {
  ------------------
  |  | 3010|  1.45M|#define curve_list_length OSSL_NELEM(curve_list)
  |  |  ------------------
  |  |  |  |   14|  1.45M|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  |  |  ------------------
  ------------------
  |  Branch (3019:17): [True: 1.45M, False: 0]
  ------------------
 3020|  1.45M|        if (curve_list[i].nid == nid)
  ------------------
  |  Branch (3020:13): [True: 113k, False: 1.34M]
  ------------------
 3021|   113k|            return &curve_list[i];
 3022|  1.45M|    }
 3023|      0|    return NULL;
 3024|   113k|}
ec_curve.c:ec_group_new_from_data:
 3029|   113k|{
 3030|   113k|    EC_GROUP *group = NULL;
 3031|   113k|    EC_POINT *P = NULL;
 3032|   113k|    BN_CTX *ctx = NULL;
 3033|   113k|    BIGNUM *p = NULL, *a = NULL, *b = NULL, *x = NULL, *y = NULL, *order = NULL;
 3034|   113k|    int ok = 0;
 3035|   113k|    int seed_len, param_len;
 3036|   113k|    const EC_METHOD *meth;
 3037|   113k|    const EC_CURVE_DATA *data;
 3038|   113k|    const unsigned char *params;
 3039|       |
 3040|       |    /* If no curve data curve method must handle everything */
 3041|   113k|    if (curve.data == NULL)
  ------------------
  |  Branch (3041:9): [True: 0, False: 113k]
  ------------------
 3042|      0|        return ossl_ec_group_new_ex(libctx, propq,
 3043|      0|            curve.meth != NULL ? curve.meth() : NULL);
  ------------------
  |  Branch (3043:13): [True: 0, False: 0]
  ------------------
 3044|       |
 3045|   113k|    if ((ctx = BN_CTX_new_ex(libctx)) == NULL) {
  ------------------
  |  Branch (3045:9): [True: 0, False: 113k]
  ------------------
 3046|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 3047|      0|        goto err;
 3048|      0|    }
 3049|       |
 3050|   113k|    data = curve.data;
 3051|   113k|    seed_len = data->seed_len;
 3052|   113k|    param_len = data->param_len;
 3053|   113k|    params = (const unsigned char *)(data + 1); /* skip header */
 3054|       |
 3055|   113k|    if (curve.meth != NULL) {
  ------------------
  |  Branch (3055:9): [True: 113k, False: 144]
  ------------------
 3056|   113k|        meth = curve.meth();
 3057|   113k|        if ((group = ossl_ec_group_new_ex(libctx, propq, meth)) == NULL) {
  ------------------
  |  Branch (3057:13): [True: 0, False: 113k]
  ------------------
 3058|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 3059|      0|            goto err;
 3060|      0|        }
 3061|   113k|        if (group->meth->group_full_init != NULL) {
  ------------------
  |  Branch (3061:13): [True: 11.3k, False: 101k]
  ------------------
 3062|  11.3k|            if (!group->meth->group_full_init(group, params)) {
  ------------------
  |  Branch (3062:17): [True: 0, False: 11.3k]
  ------------------
 3063|      0|                ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 3064|      0|                goto err;
 3065|      0|            }
 3066|  11.3k|            EC_GROUP_set_curve_name(group, curve.nid);
 3067|  11.3k|            BN_CTX_free(ctx);
 3068|  11.3k|            return group;
 3069|  11.3k|        }
 3070|   113k|    }
 3071|       |
 3072|   101k|    params += seed_len; /* skip seed */
 3073|       |
 3074|   101k|    if ((p = BN_bin2bn(params + 0 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (3074:9): [True: 0, False: 101k]
  ------------------
 3075|   101k|        || (a = BN_bin2bn(params + 1 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (3075:12): [True: 0, False: 101k]
  ------------------
 3076|   101k|        || (b = BN_bin2bn(params + 2 * param_len, param_len, NULL)) == NULL) {
  ------------------
  |  Branch (3076:12): [True: 0, False: 101k]
  ------------------
 3077|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 3078|      0|        goto err;
 3079|      0|    }
 3080|       |
 3081|   101k|    if (group != NULL) {
  ------------------
  |  Branch (3081:9): [True: 101k, False: 144]
  ------------------
 3082|   101k|        if (group->meth->group_set_curve(group, p, a, b, ctx) == 0) {
  ------------------
  |  Branch (3082:13): [True: 0, False: 101k]
  ------------------
 3083|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 3084|      0|            goto err;
 3085|      0|        }
 3086|   101k|    } else if (data->field_type == NID_X9_62_prime_field) {
  ------------------
  |  |  152|    144|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (3086:16): [True: 144, False: 0]
  ------------------
 3087|    144|        if ((group = EC_GROUP_new_curve_GFp(p, a, b, ctx)) == NULL) {
  ------------------
  |  Branch (3087:13): [True: 0, False: 144]
  ------------------
 3088|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 3089|      0|            goto err;
 3090|      0|        }
 3091|    144|    }
 3092|      0|#ifndef OPENSSL_NO_EC2M
 3093|      0|    else { /* field_type ==
 3094|       |            * NID_X9_62_characteristic_two_field */
 3095|       |
 3096|      0|        if ((group = EC_GROUP_new_curve_GF2m(p, a, b, ctx)) == NULL) {
  ------------------
  |  Branch (3096:13): [True: 0, False: 0]
  ------------------
 3097|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 3098|      0|            goto err;
 3099|      0|        }
 3100|      0|    }
 3101|   101k|#endif
 3102|       |
 3103|   101k|    EC_GROUP_set_curve_name(group, curve.nid);
 3104|       |
 3105|   101k|    if ((P = EC_POINT_new(group)) == NULL) {
  ------------------
  |  Branch (3105:9): [True: 0, False: 101k]
  ------------------
 3106|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 3107|      0|        goto err;
 3108|      0|    }
 3109|       |
 3110|   101k|    if ((x = BN_bin2bn(params + 3 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (3110:9): [True: 0, False: 101k]
  ------------------
 3111|   101k|        || (y = BN_bin2bn(params + 4 * param_len, param_len, NULL)) == NULL) {
  ------------------
  |  Branch (3111:12): [True: 0, False: 101k]
  ------------------
 3112|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 3113|      0|        goto err;
 3114|      0|    }
 3115|   101k|    if (!EC_POINT_set_affine_coordinates(group, P, x, y, ctx)) {
  ------------------
  |  Branch (3115:9): [True: 0, False: 101k]
  ------------------
 3116|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 3117|      0|        goto err;
 3118|      0|    }
 3119|   101k|    if ((order = BN_bin2bn(params + 5 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (3119:9): [True: 0, False: 101k]
  ------------------
 3120|   101k|        || !BN_set_word(x, (BN_ULONG)data->cofactor)) {
  ------------------
  |  Branch (3120:12): [True: 0, False: 101k]
  ------------------
 3121|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 3122|      0|        goto err;
 3123|      0|    }
 3124|   101k|    if (!EC_GROUP_set_generator(group, P, order, x)) {
  ------------------
  |  Branch (3124:9): [True: 0, False: 101k]
  ------------------
 3125|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 3126|      0|        goto err;
 3127|      0|    }
 3128|   101k|    if (seed_len) {
  ------------------
  |  Branch (3128:9): [True: 101k, False: 144]
  ------------------
 3129|   101k|        if (!EC_GROUP_set_seed(group, params - seed_len, seed_len)) {
  ------------------
  |  Branch (3129:13): [True: 0, False: 101k]
  ------------------
 3130|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 3131|      0|            goto err;
 3132|      0|        }
 3133|   101k|    }
 3134|       |
 3135|   101k|#ifndef FIPS_MODULE
 3136|   101k|    if (EC_GROUP_get_asn1_flag(group) == OPENSSL_EC_NAMED_CURVE) {
  ------------------
  |  |   31|   101k|#define OPENSSL_EC_NAMED_CURVE 0x001
  ------------------
  |  Branch (3136:9): [True: 101k, False: 0]
  ------------------
 3137|       |        /*
 3138|       |         * Some curves don't have an associated OID: for those we should not
 3139|       |         * default to `OPENSSL_EC_NAMED_CURVE` encoding of parameters and
 3140|       |         * instead set the ASN1 flag to `OPENSSL_EC_EXPLICIT_CURVE`.
 3141|       |         *
 3142|       |         * Note that `OPENSSL_EC_NAMED_CURVE` is set as the default ASN1 flag on
 3143|       |         * `EC_GROUP_new()`, when we don't have enough elements to determine if
 3144|       |         * an OID for the curve name actually exists.
 3145|       |         * We could implement this check on `EC_GROUP_set_curve_name()` but
 3146|       |         * overloading the simple setter with this lookup could have a negative
 3147|       |         * performance impact and unexpected consequences.
 3148|       |         */
 3149|   101k|        ASN1_OBJECT *asn1obj = OBJ_nid2obj(curve.nid);
 3150|       |
 3151|   101k|        if (asn1obj == NULL) {
  ------------------
  |  Branch (3151:13): [True: 0, False: 101k]
  ------------------
 3152|      0|            ERR_raise(ERR_LIB_EC, ERR_R_OBJ_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 3153|      0|            goto err;
 3154|      0|        }
 3155|   101k|        if (OBJ_length(asn1obj) == 0)
  ------------------
  |  Branch (3155:13): [True: 0, False: 101k]
  ------------------
 3156|      0|            EC_GROUP_set_asn1_flag(group, OPENSSL_EC_EXPLICIT_CURVE);
  ------------------
  |  |   30|      0|#define OPENSSL_EC_EXPLICIT_CURVE 0x000
  ------------------
 3157|       |
 3158|   101k|        ASN1_OBJECT_free(asn1obj);
 3159|   101k|    }
 3160|       |#else
 3161|       |    /*
 3162|       |     * Inside the FIPS module we do not support explicit curves anyway
 3163|       |     * so the above check is not necessary.
 3164|       |     *
 3165|       |     * Skipping it is also necessary because `OBJ_length()` and
 3166|       |     * `ASN1_OBJECT_free()` are not available within the FIPS module
 3167|       |     * boundaries.
 3168|       |     */
 3169|       |#endif
 3170|       |
 3171|   101k|    ok = 1;
 3172|   101k|err:
 3173|   101k|    if (!ok) {
  ------------------
  |  Branch (3173:9): [True: 0, False: 101k]
  ------------------
 3174|      0|        EC_GROUP_free(group);
 3175|       |        group = NULL;
 3176|      0|    }
 3177|   101k|    EC_POINT_free(P);
 3178|   101k|    BN_CTX_free(ctx);
 3179|   101k|    BN_free(p);
 3180|   101k|    BN_free(a);
 3181|   101k|    BN_free(b);
 3182|   101k|    BN_free(order);
 3183|   101k|    BN_free(x);
 3184|   101k|    BN_free(y);
 3185|   101k|    return group;
 3186|   101k|}

EC_GROUP_new_curve_GFp:
   23|    144|{
   24|    144|    const EC_METHOD *meth;
   25|    144|    EC_GROUP *ret;
   26|       |
   27|    144|#if defined(OPENSSL_BN_ASM_MONT)
   28|       |    /*
   29|       |     * This might appear controversial, but the fact is that generic
   30|       |     * prime method was observed to deliver better performance even
   31|       |     * for NIST primes on a range of platforms, e.g.: 60%-15%
   32|       |     * improvement on IA-64, ~25% on ARM, 30%-90% on P4, 20%-25%
   33|       |     * in 32-bit build and 35%--12% in 64-bit build on Core2...
   34|       |     * Coefficients are relative to optimized bn_nist.c for most
   35|       |     * intensive ECDSA verify and ECDH operations for 192- and 521-
   36|       |     * bit keys respectively. Choice of these boundary values is
   37|       |     * arguable, because the dependency of improvement coefficient
   38|       |     * from key length is not a "monotone" curve. For example while
   39|       |     * 571-bit result is 23% on ARM, 384-bit one is -1%. But it's
   40|       |     * generally faster, sometimes "respectfully" faster, sometimes
   41|       |     * "tolerably" slower... What effectively happens is that loop
   42|       |     * with bn_mul_add_words is put against bn_mul_mont, and the
   43|       |     * latter "wins" on short vectors. Correct solution should be
   44|       |     * implementing dedicated NxN multiplication subroutines for
   45|       |     * small N. But till it materializes, let's stick to generic
   46|       |     * prime method...
   47|       |     *                                              <@dot-asm>
   48|       |     */
   49|    144|    meth = EC_GFp_mont_method();
   50|       |#else
   51|       |    if (BN_nist_mod_func(p))
   52|       |        meth = EC_GFp_nist_method();
   53|       |    else
   54|       |        meth = EC_GFp_mont_method();
   55|       |#endif
   56|       |
   57|    144|    ret = ossl_ec_group_new_ex(ossl_bn_get_libctx(ctx), NULL, meth);
   58|    144|    if (ret == NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 144]
  ------------------
   59|      0|        return NULL;
   60|       |
   61|    144|    if (!EC_GROUP_set_curve(ret, p, a, b, ctx)) {
  ------------------
  |  Branch (61:9): [True: 0, False: 144]
  ------------------
   62|      0|        EC_GROUP_free(ret);
   63|      0|        return NULL;
   64|      0|    }
   65|       |
   66|    144|    return ret;
   67|    144|}

ossl_err_load_EC_strings:
  127|      1|{
  128|      1|#ifndef OPENSSL_NO_ERR
  129|      1|    if (ERR_reason_error_string(EC_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (129:9): [True: 1, False: 0]
  ------------------
  130|      1|        ERR_load_strings_const(EC_str_reasons);
  131|      1|#endif
  132|      1|    return 1;
  133|      1|}

EC_KEY_new_ex:
   41|   113k|{
   42|       |    return ossl_ec_key_new_method_int(ctx, propq, NULL);
   43|   113k|}
EC_KEY_free:
   72|   339k|{
   73|   339k|    int i;
   74|       |
   75|   339k|    if (r == NULL)
  ------------------
  |  Branch (75:9): [True: 112k, False: 226k]
  ------------------
   76|   112k|        return;
   77|       |
   78|   226k|    CRYPTO_DOWN_REF(&r->references, &i);
   79|   226k|    REF_PRINT_COUNT("EC_KEY", i, r);
  ------------------
  |  |  301|   226k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|   226k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  297|   226k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  285|   226k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   80|   226k|    if (i > 0)
  ------------------
  |  Branch (80:9): [True: 112k, False: 113k]
  ------------------
   81|   112k|        return;
   82|   113k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|   113k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 113k]
  |  |  ------------------
  ------------------
   83|       |
   84|   113k|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (84:9): [True: 113k, False: 0]
  |  Branch (84:28): [True: 0, False: 113k]
  ------------------
   85|      0|        r->meth->finish(r);
   86|       |
   87|   113k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
   88|   113k|    ENGINE_finish(r->engine);
   89|   113k|#endif
   90|       |
   91|   113k|    if (r->group && r->group->meth->keyfinish)
  ------------------
  |  Branch (91:9): [True: 113k, False: 0]
  |  Branch (91:21): [True: 0, False: 113k]
  ------------------
   92|      0|        r->group->meth->keyfinish(r);
   93|       |
   94|   113k|#ifndef FIPS_MODULE
   95|   113k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_EC_KEY, r, &r->ex_data);
  ------------------
  |  |  258|   113k|#define CRYPTO_EX_INDEX_EC_KEY 8
  ------------------
   96|   113k|#endif
   97|   113k|    CRYPTO_FREE_REF(&r->references);
   98|   113k|    EC_GROUP_free(r->group);
   99|   113k|    EC_POINT_free(r->pub_key);
  100|   113k|    BN_clear_free(r->priv_key);
  101|   113k|    OPENSSL_free(r->propq);
  ------------------
  |  |  131|   113k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  102|       |
  103|   113k|    OPENSSL_clear_free((void *)r, sizeof(EC_KEY));
  ------------------
  |  |  129|   113k|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  104|   113k|}
EC_KEY_up_ref:
  193|   112k|{
  194|   112k|    int i;
  195|       |
  196|   112k|    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
  ------------------
  |  Branch (196:9): [True: 0, False: 112k]
  ------------------
  197|      0|        return 0;
  198|       |
  199|   112k|    REF_PRINT_COUNT("EC_KEY", i, r);
  ------------------
  |  |  301|   112k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|   112k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  297|   112k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  285|   112k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  200|   112k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|   112k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 112k]
  |  |  ------------------
  ------------------
  201|   112k|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (201:13): [True: 112k, False: 0]
  ------------------
  202|   112k|}
EC_KEY_generate_key:
  210|    226|{
  211|    226|    if (eckey == NULL || eckey->group == NULL) {
  ------------------
  |  Branch (211:9): [True: 0, False: 226]
  |  Branch (211:26): [True: 0, False: 226]
  ------------------
  212|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  213|      0|        return 0;
  214|      0|    }
  215|    226|    if (eckey->meth->keygen != NULL) {
  ------------------
  |  Branch (215:9): [True: 226, False: 0]
  ------------------
  216|    226|        int ret;
  217|       |
  218|    226|        ret = eckey->meth->keygen(eckey);
  219|    226|        if (ret == 1)
  ------------------
  |  Branch (219:13): [True: 226, False: 0]
  ------------------
  220|    226|            eckey->dirty_cnt++;
  221|       |
  222|    226|        return ret;
  223|    226|    }
  224|    226|    ERR_raise(ERR_LIB_EC, EC_R_OPERATION_NOT_SUPPORTED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  225|      0|    return 0;
  226|    226|}
ossl_ec_key_gen:
  229|    226|{
  230|    226|    int ret;
  231|       |
  232|    226|    ret = eckey->group->meth->keygen(eckey);
  233|       |
  234|    226|    if (ret == 1)
  ------------------
  |  Branch (234:9): [True: 226, False: 0]
  ------------------
  235|    226|        eckey->dirty_cnt++;
  236|    226|    return ret;
  237|    226|}
ossl_ec_key_simple_generate_key:
  442|    226|{
  443|    226|    return ec_generate_key(eckey, 0);
  444|    226|}
ossl_ec_key_get_libctx:
  748|   227k|{
  749|   227k|    return key->libctx;
  750|   227k|}
ossl_ec_key_get0_propq:
  753|   113k|{
  754|   113k|    return key->propq;
  755|   113k|}
ossl_ec_key_set0_libctx:
  758|   112k|{
  759|   112k|    key->libctx = libctx;
  760|       |    /* Do we need to propagate this to the group? */
  761|   112k|}
EC_KEY_get0_group:
  764|   566k|{
  765|   566k|    return key->group;
  766|   566k|}
EC_KEY_set_group:
  769|   113k|{
  770|   113k|    if (key->meth->set_group != NULL && key->meth->set_group(key, group) == 0)
  ------------------
  |  Branch (770:9): [True: 0, False: 113k]
  |  Branch (770:41): [True: 0, False: 0]
  ------------------
  771|      0|        return 0;
  772|   113k|    EC_GROUP_free(key->group);
  773|   113k|    key->group = EC_GROUP_dup(group);
  774|   113k|    if (key->group != NULL && EC_GROUP_get_curve_name(key->group) == NID_sm2)
  ------------------
  |  | 1255|   113k|#define NID_sm2         1172
  ------------------
  |  Branch (774:9): [True: 113k, False: 0]
  |  Branch (774:31): [True: 0, False: 113k]
  ------------------
  775|      0|        EC_KEY_set_flags(key, EC_FLAG_SM2_RANGE);
  ------------------
  |  |  954|      0|#define EC_FLAG_SM2_RANGE 0x0004
  ------------------
  776|       |
  777|   113k|    key->dirty_cnt++;
  778|   113k|    return (key->group == NULL) ? 0 : 1;
  ------------------
  |  Branch (778:12): [True: 0, False: 113k]
  ------------------
  779|   113k|}
EC_KEY_get0_private_key:
  782|   113k|{
  783|   113k|    return key->priv_key;
  784|   113k|}
EC_KEY_get0_public_key:
  882|   114k|{
  883|   114k|    return key->pub_key;
  884|   114k|}
EC_KEY_get_enc_flags:
  898|   113k|{
  899|   113k|    return key->enc_flag;
  900|   113k|}
EC_KEY_get_conv_form:
  908|   113k|{
  909|   113k|    return key->conv_form;
  910|   113k|}
EC_KEY_get_flags:
  935|   453k|{
  936|   453k|    return key->flags;
  937|   453k|}
EC_KEY_oct2key:
  968|   112k|{
  969|   112k|    if (key == NULL || key->group == NULL)
  ------------------
  |  Branch (969:9): [True: 0, False: 112k]
  |  Branch (969:24): [True: 0, False: 112k]
  ------------------
  970|      0|        return 0;
  971|   112k|    if (key->pub_key == NULL)
  ------------------
  |  Branch (971:9): [True: 112k, False: 0]
  ------------------
  972|   112k|        key->pub_key = EC_POINT_new(key->group);
  973|   112k|    if (key->pub_key == NULL)
  ------------------
  |  Branch (973:9): [True: 0, False: 112k]
  ------------------
  974|      0|        return 0;
  975|   112k|    if (EC_POINT_oct2point(key->group, key->pub_key, buf, len, ctx) == 0)
  ------------------
  |  Branch (975:9): [True: 0, False: 112k]
  ------------------
  976|      0|        return 0;
  977|   112k|    key->dirty_cnt++;
  978|       |    /*
  979|       |     * Save the point conversion form.
  980|       |     * For non-custom curves the first octet of the buffer (excluding
  981|       |     * the last significant bit) contains the point conversion form.
  982|       |     * EC_POINT_oct2point() has already performed sanity checking of
  983|       |     * the buffer so we know it is valid.
  984|       |     */
  985|   112k|    if ((key->group->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0)
  ------------------
  |  |   29|   112k|#define EC_FLAGS_CUSTOM_CURVE 0x2
  ------------------
  |  Branch (985:9): [True: 112k, False: 0]
  ------------------
  986|   112k|        key->conv_form = (point_conversion_form_t)(buf[0] & ~0x01);
  987|   112k|    return 1;
  988|   112k|}
ec_key.c:ec_generate_key:
  302|    226|{
  303|    226|    int ok = 0;
  304|    226|    BIGNUM *priv_key = NULL;
  305|    226|    const BIGNUM *tmp = NULL;
  306|    226|    BIGNUM *order = NULL;
  307|    226|    EC_POINT *pub_key = NULL;
  308|    226|    const EC_GROUP *group = eckey->group;
  309|    226|    BN_CTX *ctx = BN_CTX_secure_new_ex(eckey->libctx);
  310|    226|    int sm2 = EC_KEY_get_flags(eckey) & EC_FLAG_SM2_RANGE ? 1 : 0;
  ------------------
  |  |  954|    226|#define EC_FLAG_SM2_RANGE 0x0004
  ------------------
  |  Branch (310:15): [True: 0, False: 226]
  ------------------
  311|       |
  312|    226|    if (ctx == NULL)
  ------------------
  |  Branch (312:9): [True: 0, False: 226]
  ------------------
  313|      0|        goto err;
  314|       |
  315|    226|    if (eckey->priv_key == NULL) {
  ------------------
  |  Branch (315:9): [True: 226, False: 0]
  ------------------
  316|    226|        priv_key = BN_secure_new();
  317|    226|        if (priv_key == NULL)
  ------------------
  |  Branch (317:13): [True: 0, False: 226]
  ------------------
  318|      0|            goto err;
  319|    226|    } else
  320|      0|        priv_key = eckey->priv_key;
  321|       |
  322|       |    /*
  323|       |     * Steps (1-2): Check domain parameters and security strength.
  324|       |     * These steps must be done by the user. This would need to be
  325|       |     * stated in the security policy.
  326|       |     */
  327|       |
  328|    226|    tmp = EC_GROUP_get0_order(group);
  329|    226|    if (tmp == NULL)
  ------------------
  |  Branch (329:9): [True: 0, False: 226]
  ------------------
  330|      0|        goto err;
  331|       |
  332|       |    /*
  333|       |     * Steps (3-7): priv_key = DRBG_RAND(order_n_bits) (range [1, n-1]).
  334|       |     * Although this is slightly different from the standard, it is effectively
  335|       |     * equivalent as it gives an unbiased result ranging from 1..n-1. It is also
  336|       |     * faster as the standard needs to retry more often. Also doing
  337|       |     * 1 + rand[0..n-2] would effect the way that tests feed dummy entropy into
  338|       |     * rand so the simpler backward compatible method has been used here.
  339|       |     */
  340|       |
  341|       |    /* range of SM2 private key is [1, n-1) */
  342|    226|    if (sm2) {
  ------------------
  |  Branch (342:9): [True: 0, False: 226]
  ------------------
  343|      0|        order = BN_new();
  344|      0|        if (order == NULL || !BN_sub(order, tmp, BN_value_one()))
  ------------------
  |  Branch (344:13): [True: 0, False: 0]
  |  Branch (344:30): [True: 0, False: 0]
  ------------------
  345|      0|            goto err;
  346|    226|    } else {
  347|    226|        order = BN_dup(tmp);
  348|    226|        if (order == NULL)
  ------------------
  |  Branch (348:13): [True: 0, False: 226]
  ------------------
  349|      0|            goto err;
  350|    226|    }
  351|       |
  352|    226|    do
  353|    226|        if (!BN_priv_rand_range_ex(priv_key, order, 0, ctx))
  ------------------
  |  Branch (353:13): [True: 0, False: 226]
  ------------------
  354|      0|            goto err;
  355|    226|    while (BN_is_zero(priv_key));
  ------------------
  |  Branch (355:12): [True: 0, False: 226]
  ------------------
  356|       |
  357|    226|    if (eckey->pub_key == NULL) {
  ------------------
  |  Branch (357:9): [True: 226, False: 0]
  ------------------
  358|    226|        pub_key = EC_POINT_new(group);
  359|    226|        if (pub_key == NULL)
  ------------------
  |  Branch (359:13): [True: 0, False: 226]
  ------------------
  360|      0|            goto err;
  361|    226|    } else
  362|      0|        pub_key = eckey->pub_key;
  363|       |
  364|       |    /* Step (8) : pub_key = priv_key * G (where G is a point on the curve) */
  365|    226|    if (!EC_POINT_mul(group, pub_key, priv_key, NULL, NULL, ctx))
  ------------------
  |  Branch (365:9): [True: 0, False: 226]
  ------------------
  366|      0|        goto err;
  367|       |
  368|    226|    eckey->priv_key = priv_key;
  369|    226|    eckey->pub_key = pub_key;
  370|    226|    priv_key = NULL;
  371|    226|    pub_key = NULL;
  372|       |
  373|    226|    eckey->dirty_cnt++;
  374|       |
  375|       |#ifdef FIPS_MODULE
  376|       |    pairwise_test = 1;
  377|       |#endif /* FIPS_MODULE */
  378|       |
  379|    226|    ok = 1;
  380|    226|    if (pairwise_test) {
  ------------------
  |  Branch (380:9): [True: 0, False: 226]
  ------------------
  381|      0|        OSSL_CALLBACK *cb = NULL;
  382|      0|        void *cbarg = NULL;
  383|       |
  384|      0|        OSSL_SELF_TEST_get_callback(eckey->libctx, &cb, &cbarg);
  385|      0|        ok = ecdsa_keygen_pairwise_test(eckey, cb, cbarg)
  ------------------
  |  Branch (385:14): [True: 0, False: 0]
  ------------------
  386|      0|            && ecdsa_keygen_knownanswer_test(eckey, ctx, cb, cbarg);
  ------------------
  |  Branch (386:16): [True: 0, False: 0]
  ------------------
  387|      0|    }
  388|    226|err:
  389|       |    /* Step (9): If there is an error return an invalid keypair. */
  390|    226|    if (!ok) {
  ------------------
  |  Branch (390:9): [True: 0, False: 226]
  ------------------
  391|      0|        ossl_set_error_state(OSSL_SELF_TEST_TYPE_PCT);
  ------------------
  |  |   32|      0|#define OSSL_SELF_TEST_TYPE_PCT "Conditional_PCT"
  ------------------
  392|      0|        BN_clear(eckey->priv_key);
  393|      0|        if (eckey->pub_key != NULL)
  ------------------
  |  Branch (393:13): [True: 0, False: 0]
  ------------------
  394|      0|            EC_POINT_set_to_infinity(group, eckey->pub_key);
  395|      0|    }
  396|       |
  397|    226|    EC_POINT_free(pub_key);
  398|    226|    BN_clear_free(priv_key);
  399|    226|    BN_CTX_free(ctx);
  400|    226|    BN_free(order);
  401|    226|    return ok;
  402|    226|}

EC_KEY_OpenSSL:
   40|   112k|{
   41|   112k|    return &openssl_ec_key_method;
   42|   112k|}
EC_KEY_get_default_method:
   45|   113k|{
   46|   113k|    return default_ec_key_meth;
   47|   113k|}
EC_KEY_get_method:
   58|   112k|{
   59|   112k|    return key->meth;
   60|   112k|}
ossl_ec_key_new_method_int:
   82|   113k|{
   83|   113k|    EC_KEY *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|   113k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   84|       |
   85|   113k|    if (ret == NULL)
  ------------------
  |  Branch (85:9): [True: 0, False: 113k]
  ------------------
   86|      0|        return NULL;
   87|       |
   88|   113k|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (88:9): [True: 0, False: 113k]
  ------------------
   89|      0|        OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   90|      0|        return NULL;
   91|      0|    }
   92|       |
   93|   113k|    ret->libctx = libctx;
   94|   113k|    if (propq != NULL) {
  ------------------
  |  Branch (94:9): [True: 0, False: 113k]
  ------------------
   95|      0|        ret->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   96|      0|        if (ret->propq == NULL)
  ------------------
  |  Branch (96:13): [True: 0, False: 0]
  ------------------
   97|      0|            goto err;
   98|      0|    }
   99|       |
  100|   113k|    ret->meth = EC_KEY_get_default_method();
  101|   113k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  102|   113k|    if (engine != NULL) {
  ------------------
  |  Branch (102:9): [True: 0, False: 113k]
  ------------------
  103|      0|        if (!ENGINE_init(engine)) {
  ------------------
  |  Branch (103:13): [True: 0, False: 0]
  ------------------
  104|      0|            ERR_raise(ERR_LIB_EC, ERR_R_ENGINE_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  105|      0|            goto err;
  106|      0|        }
  107|      0|        ret->engine = engine;
  108|      0|    } else
  109|   113k|        ret->engine = ENGINE_get_default_EC();
  110|   113k|    if (ret->engine != NULL) {
  ------------------
  |  Branch (110:9): [True: 0, False: 113k]
  ------------------
  111|      0|        ret->meth = ENGINE_get_EC(ret->engine);
  112|      0|        if (ret->meth == NULL) {
  ------------------
  |  Branch (112:13): [True: 0, False: 0]
  ------------------
  113|      0|            ERR_raise(ERR_LIB_EC, ERR_R_ENGINE_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  114|      0|            goto err;
  115|      0|        }
  116|      0|    }
  117|   113k|#endif
  118|       |
  119|   113k|    ret->version = 1;
  120|   113k|    ret->conv_form = POINT_CONVERSION_UNCOMPRESSED;
  121|       |
  122|       |/* No ex_data inside the FIPS provider */
  123|   113k|#ifndef FIPS_MODULE
  124|   113k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_EC_KEY, ret, &ret->ex_data)) {
  ------------------
  |  |  258|   113k|#define CRYPTO_EX_INDEX_EC_KEY 8
  ------------------
  |  Branch (124:9): [True: 0, False: 113k]
  ------------------
  125|      0|        ERR_raise(ERR_LIB_EC, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  126|      0|        goto err;
  127|      0|    }
  128|   113k|#endif
  129|       |
  130|   113k|    if (ret->meth->init != NULL && ret->meth->init(ret) == 0) {
  ------------------
  |  Branch (130:9): [True: 0, False: 113k]
  |  Branch (130:36): [True: 0, False: 0]
  ------------------
  131|      0|        ERR_raise(ERR_LIB_EC, ERR_R_INIT_FAIL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  132|      0|        goto err;
  133|      0|    }
  134|   113k|    return ret;
  135|       |
  136|      0|err:
  137|      0|    EC_KEY_free(ret);
  138|       |    return NULL;
  139|   113k|}

ossl_ec_group_new_ex:
   32|   226k|{
   33|   226k|    EC_GROUP *ret;
   34|       |
   35|   226k|    if (meth == NULL) {
  ------------------
  |  Branch (35:9): [True: 0, False: 226k]
  ------------------
   36|      0|        ERR_raise(ERR_LIB_EC, EC_R_SLOT_FULL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   37|      0|        return NULL;
   38|      0|    }
   39|   226k|    if (meth->group_init == 0) {
  ------------------
  |  Branch (39:9): [True: 0, False: 226k]
  ------------------
   40|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   41|      0|        return NULL;
   42|      0|    }
   43|       |
   44|   226k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|   226k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   45|   226k|    if (ret == NULL)
  ------------------
  |  Branch (45:9): [True: 0, False: 226k]
  ------------------
   46|      0|        return NULL;
   47|       |
   48|   226k|    ret->libctx = libctx;
   49|   226k|    if (propq != NULL) {
  ------------------
  |  Branch (49:9): [True: 0, False: 226k]
  ------------------
   50|      0|        ret->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   51|      0|        if (ret->propq == NULL)
  ------------------
  |  Branch (51:13): [True: 0, False: 0]
  ------------------
   52|      0|            goto err;
   53|      0|    }
   54|   226k|    ret->meth = meth;
   55|   226k|    if ((ret->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0) {
  ------------------
  |  |   29|   226k|#define EC_FLAGS_CUSTOM_CURVE 0x2
  ------------------
  |  Branch (55:9): [True: 226k, False: 0]
  ------------------
   56|   226k|        ret->order = BN_new();
   57|   226k|        if (ret->order == NULL)
  ------------------
  |  Branch (57:13): [True: 0, False: 226k]
  ------------------
   58|      0|            goto err;
   59|   226k|        ret->cofactor = BN_new();
   60|   226k|        if (ret->cofactor == NULL)
  ------------------
  |  Branch (60:13): [True: 0, False: 226k]
  ------------------
   61|      0|            goto err;
   62|   226k|    }
   63|   226k|    ret->asn1_flag = OPENSSL_EC_EXPLICIT_CURVE;
  ------------------
  |  |   30|   226k|#define OPENSSL_EC_EXPLICIT_CURVE 0x000
  ------------------
   64|   226k|    ret->asn1_form = POINT_CONVERSION_UNCOMPRESSED;
   65|   226k|    if (!meth->group_init(ret))
  ------------------
  |  Branch (65:9): [True: 0, False: 226k]
  ------------------
   66|      0|        goto err;
   67|   226k|    return ret;
   68|       |
   69|      0|err:
   70|      0|    BN_free(ret->order);
   71|      0|    BN_free(ret->cofactor);
   72|      0|    OPENSSL_free(ret->propq);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   73|      0|    OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   74|       |    return NULL;
   75|   226k|}
EC_pre_comp_free:
   87|   339k|{
   88|   339k|    switch (group->pre_comp_type) {
  ------------------
  |  Branch (88:13): [True: 339k, False: 0]
  ------------------
   89|   339k|    case PCT_none:
  ------------------
  |  Branch (89:5): [True: 339k, False: 0]
  ------------------
   90|   339k|        break;
   91|      0|    case PCT_nistz256:
  ------------------
  |  Branch (91:5): [True: 0, False: 339k]
  ------------------
   92|      0|#ifdef ECP_NISTZ256_ASM
   93|      0|        EC_nistz256_pre_comp_free(group->pre_comp.nistz256);
   94|      0|#endif
   95|      0|        break;
   96|      0|#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
   97|      0|    case PCT_nistp224:
  ------------------
  |  Branch (97:5): [True: 0, False: 339k]
  ------------------
   98|      0|        EC_nistp224_pre_comp_free(group->pre_comp.nistp224);
   99|      0|        break;
  100|      0|    case PCT_nistp256:
  ------------------
  |  Branch (100:5): [True: 0, False: 339k]
  ------------------
  101|      0|        EC_nistp256_pre_comp_free(group->pre_comp.nistp256);
  102|      0|        break;
  103|      0|    case PCT_nistp384:
  ------------------
  |  Branch (103:5): [True: 0, False: 339k]
  ------------------
  104|      0|        ossl_ec_nistp384_pre_comp_free(group->pre_comp.nistp384);
  105|      0|        break;
  106|      0|    case PCT_nistp521:
  ------------------
  |  Branch (106:5): [True: 0, False: 339k]
  ------------------
  107|      0|        EC_nistp521_pre_comp_free(group->pre_comp.nistp521);
  108|      0|        break;
  109|       |#else
  110|       |    case PCT_nistp224:
  111|       |    case PCT_nistp256:
  112|       |    case PCT_nistp384:
  113|       |    case PCT_nistp521:
  114|       |        break;
  115|       |#endif
  116|      0|    case PCT_ec:
  ------------------
  |  Branch (116:5): [True: 0, False: 339k]
  ------------------
  117|      0|        EC_ec_pre_comp_free(group->pre_comp.ec);
  118|      0|        break;
  119|   339k|    }
  120|   339k|    group->pre_comp.ec = NULL;
  121|   339k|}
EC_GROUP_free:
  124|   339k|{
  125|   339k|    if (!group)
  ------------------
  |  Branch (125:9): [True: 113k, False: 226k]
  ------------------
  126|   113k|        return;
  127|       |
  128|   226k|    if (group->meth->group_finish != 0)
  ------------------
  |  Branch (128:9): [True: 226k, False: 0]
  ------------------
  129|   226k|        group->meth->group_finish(group);
  130|       |
  131|   226k|    EC_pre_comp_free(group);
  132|   226k|    BN_MONT_CTX_free(group->mont_data);
  133|   226k|    EC_POINT_free(group->generator);
  134|   226k|    BN_free(group->order);
  135|   226k|    BN_free(group->cofactor);
  136|   226k|    OPENSSL_free(group->seed);
  ------------------
  |  |  131|   226k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|   226k|    OPENSSL_free(group->propq);
  ------------------
  |  |  131|   226k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  138|   226k|    OPENSSL_free(group);
  ------------------
  |  |  131|   226k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  139|   226k|}
EC_GROUP_copy:
  163|   113k|{
  164|   113k|    if (dest->meth->group_copy == 0) {
  ------------------
  |  Branch (164:9): [True: 0, False: 113k]
  ------------------
  165|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  166|      0|        return 0;
  167|      0|    }
  168|   113k|    if (dest->meth != src->meth) {
  ------------------
  |  Branch (168:9): [True: 0, False: 113k]
  ------------------
  169|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  170|      0|        return 0;
  171|      0|    }
  172|   113k|    if (dest == src)
  ------------------
  |  Branch (172:9): [True: 0, False: 113k]
  ------------------
  173|      0|        return 1;
  174|       |
  175|   113k|    dest->libctx = src->libctx;
  176|   113k|    dest->curve_name = src->curve_name;
  177|       |
  178|   113k|    EC_pre_comp_free(dest);
  179|       |
  180|       |    /* Copy precomputed */
  181|   113k|    dest->pre_comp_type = src->pre_comp_type;
  182|   113k|    switch (src->pre_comp_type) {
  ------------------
  |  Branch (182:13): [True: 113k, False: 0]
  ------------------
  183|   113k|    case PCT_none:
  ------------------
  |  Branch (183:5): [True: 113k, False: 0]
  ------------------
  184|   113k|        dest->pre_comp.ec = NULL;
  185|   113k|        break;
  186|      0|    case PCT_nistz256:
  ------------------
  |  Branch (186:5): [True: 0, False: 113k]
  ------------------
  187|      0|#ifdef ECP_NISTZ256_ASM
  188|      0|        dest->pre_comp.nistz256 = EC_nistz256_pre_comp_dup(src->pre_comp.nistz256);
  189|      0|#endif
  190|      0|        break;
  191|      0|#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
  192|      0|    case PCT_nistp224:
  ------------------
  |  Branch (192:5): [True: 0, False: 113k]
  ------------------
  193|      0|        dest->pre_comp.nistp224 = EC_nistp224_pre_comp_dup(src->pre_comp.nistp224);
  194|      0|        break;
  195|      0|    case PCT_nistp256:
  ------------------
  |  Branch (195:5): [True: 0, False: 113k]
  ------------------
  196|      0|        dest->pre_comp.nistp256 = EC_nistp256_pre_comp_dup(src->pre_comp.nistp256);
  197|      0|        break;
  198|      0|    case PCT_nistp384:
  ------------------
  |  Branch (198:5): [True: 0, False: 113k]
  ------------------
  199|      0|        dest->pre_comp.nistp384 = ossl_ec_nistp384_pre_comp_dup(src->pre_comp.nistp384);
  200|      0|        break;
  201|      0|    case PCT_nistp521:
  ------------------
  |  Branch (201:5): [True: 0, False: 113k]
  ------------------
  202|      0|        dest->pre_comp.nistp521 = EC_nistp521_pre_comp_dup(src->pre_comp.nistp521);
  203|      0|        break;
  204|       |#else
  205|       |    case PCT_nistp224:
  206|       |    case PCT_nistp256:
  207|       |    case PCT_nistp384:
  208|       |    case PCT_nistp521:
  209|       |        break;
  210|       |#endif
  211|      0|    case PCT_ec:
  ------------------
  |  Branch (211:5): [True: 0, False: 113k]
  ------------------
  212|      0|        dest->pre_comp.ec = EC_ec_pre_comp_dup(src->pre_comp.ec);
  213|      0|        break;
  214|   113k|    }
  215|       |
  216|   113k|    if (src->mont_data != NULL) {
  ------------------
  |  Branch (216:9): [True: 113k, False: 0]
  ------------------
  217|   113k|        if (dest->mont_data == NULL) {
  ------------------
  |  Branch (217:13): [True: 113k, False: 0]
  ------------------
  218|   113k|            dest->mont_data = BN_MONT_CTX_new();
  219|   113k|            if (dest->mont_data == NULL)
  ------------------
  |  Branch (219:17): [True: 0, False: 113k]
  ------------------
  220|      0|                return 0;
  221|   113k|        }
  222|   113k|        if (!BN_MONT_CTX_copy(dest->mont_data, src->mont_data))
  ------------------
  |  Branch (222:13): [True: 0, False: 113k]
  ------------------
  223|      0|            return 0;
  224|   113k|    } else {
  225|       |        /* src->generator == NULL */
  226|      0|        BN_MONT_CTX_free(dest->mont_data);
  227|      0|        dest->mont_data = NULL;
  228|      0|    }
  229|       |
  230|   113k|    if (src->generator != NULL) {
  ------------------
  |  Branch (230:9): [True: 113k, False: 0]
  ------------------
  231|   113k|        if (dest->generator == NULL) {
  ------------------
  |  Branch (231:13): [True: 113k, False: 0]
  ------------------
  232|   113k|            dest->generator = EC_POINT_new(dest);
  233|   113k|            if (dest->generator == NULL)
  ------------------
  |  Branch (233:17): [True: 0, False: 113k]
  ------------------
  234|      0|                return 0;
  235|   113k|        }
  236|   113k|        if (!EC_POINT_copy(dest->generator, src->generator))
  ------------------
  |  Branch (236:13): [True: 0, False: 113k]
  ------------------
  237|      0|            return 0;
  238|   113k|    } else {
  239|       |        /* src->generator == NULL */
  240|      0|        EC_POINT_clear_free(dest->generator);
  241|      0|        dest->generator = NULL;
  242|      0|    }
  243|       |
  244|   113k|    if ((src->meth->flags & EC_FLAGS_CUSTOM_CURVE) == 0) {
  ------------------
  |  |   29|   113k|#define EC_FLAGS_CUSTOM_CURVE 0x2
  ------------------
  |  Branch (244:9): [True: 113k, False: 0]
  ------------------
  245|   113k|        if (!BN_copy(dest->order, src->order))
  ------------------
  |  Branch (245:13): [True: 0, False: 113k]
  ------------------
  246|      0|            return 0;
  247|   113k|        if (!BN_copy(dest->cofactor, src->cofactor))
  ------------------
  |  Branch (247:13): [True: 0, False: 113k]
  ------------------
  248|      0|            return 0;
  249|   113k|    }
  250|       |
  251|   113k|    dest->asn1_flag = src->asn1_flag;
  252|   113k|    dest->asn1_form = src->asn1_form;
  253|   113k|    dest->decoded_from_explicit_params = src->decoded_from_explicit_params;
  254|       |
  255|   113k|    if (src->seed) {
  ------------------
  |  Branch (255:9): [True: 113k, False: 144]
  ------------------
  256|   113k|        OPENSSL_free(dest->seed);
  ------------------
  |  |  131|   113k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  257|   113k|        if ((dest->seed = OPENSSL_malloc(src->seed_len)) == NULL)
  ------------------
  |  |  106|   113k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (257:13): [True: 0, False: 113k]
  ------------------
  258|      0|            return 0;
  259|   113k|        if (!memcpy(dest->seed, src->seed, src->seed_len))
  ------------------
  |  Branch (259:13): [True: 0, False: 113k]
  ------------------
  260|      0|            return 0;
  261|   113k|        dest->seed_len = src->seed_len;
  262|   113k|    } else {
  263|    144|        OPENSSL_free(dest->seed);
  ------------------
  |  |  131|    144|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  264|    144|        dest->seed = NULL;
  265|    144|        dest->seed_len = 0;
  266|    144|    }
  267|       |
  268|   113k|    return dest->meth->group_copy(dest, src);
  269|   113k|}
EC_GROUP_dup:
  272|   113k|{
  273|   113k|    EC_GROUP *t = NULL;
  274|   113k|    int ok = 0;
  275|       |
  276|   113k|    if (a == NULL)
  ------------------
  |  Branch (276:9): [True: 0, False: 113k]
  ------------------
  277|      0|        return NULL;
  278|       |
  279|   113k|    if ((t = ossl_ec_group_new_ex(a->libctx, a->propq, a->meth)) == NULL)
  ------------------
  |  Branch (279:9): [True: 0, False: 113k]
  ------------------
  280|      0|        return NULL;
  281|   113k|    if (!EC_GROUP_copy(t, a))
  ------------------
  |  Branch (281:9): [True: 0, False: 113k]
  ------------------
  282|      0|        goto err;
  283|       |
  284|   113k|    ok = 1;
  285|       |
  286|   113k|err:
  287|   113k|    if (!ok) {
  ------------------
  |  Branch (287:9): [True: 0, False: 113k]
  ------------------
  288|      0|        EC_GROUP_free(t);
  289|      0|        return NULL;
  290|      0|    }
  291|   113k|    return t;
  292|   113k|}
EC_GROUP_set_generator:
  372|   101k|{
  373|   101k|    if (generator == NULL) {
  ------------------
  |  Branch (373:9): [True: 0, False: 101k]
  ------------------
  374|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  375|      0|        return 0;
  376|      0|    }
  377|       |
  378|       |    /* require group->field >= 1 */
  379|   101k|    if (group->field == NULL || BN_is_zero(group->field)
  ------------------
  |  Branch (379:9): [True: 0, False: 101k]
  |  Branch (379:33): [True: 0, False: 101k]
  ------------------
  380|   101k|        || BN_is_negative(group->field)) {
  ------------------
  |  Branch (380:12): [True: 0, False: 101k]
  ------------------
  381|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_FIELD);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  382|      0|        return 0;
  383|      0|    }
  384|       |
  385|       |    /*-
  386|       |     * - require order >= 1
  387|       |     * - enforce upper bound due to Hasse thm: order can be no more than one bit
  388|       |     *   longer than field cardinality
  389|       |     */
  390|   101k|    if (order == NULL || BN_is_zero(order) || BN_is_negative(order)
  ------------------
  |  Branch (390:9): [True: 0, False: 101k]
  |  Branch (390:26): [True: 0, False: 101k]
  |  Branch (390:47): [True: 0, False: 101k]
  ------------------
  391|   101k|        || BN_num_bits(order) > BN_num_bits(group->field) + 1) {
  ------------------
  |  Branch (391:12): [True: 0, False: 101k]
  ------------------
  392|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  393|      0|        return 0;
  394|      0|    }
  395|       |
  396|       |    /*-
  397|       |     * Unfortunately the cofactor is an optional field in many standards.
  398|       |     * Internally, the lib uses 0 cofactor as a marker for "unknown cofactor".
  399|       |     * So accept cofactor == NULL or cofactor >= 0.
  400|       |     */
  401|   101k|    if (cofactor != NULL && BN_is_negative(cofactor)) {
  ------------------
  |  Branch (401:9): [True: 101k, False: 0]
  |  Branch (401:29): [True: 0, False: 101k]
  ------------------
  402|      0|        ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_COFACTOR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  403|      0|        return 0;
  404|      0|    }
  405|       |
  406|   101k|    if (group->generator == NULL) {
  ------------------
  |  Branch (406:9): [True: 101k, False: 0]
  ------------------
  407|   101k|        group->generator = EC_POINT_new(group);
  408|   101k|        if (group->generator == NULL)
  ------------------
  |  Branch (408:13): [True: 0, False: 101k]
  ------------------
  409|      0|            return 0;
  410|   101k|    }
  411|   101k|    if (!EC_POINT_copy(group->generator, generator))
  ------------------
  |  Branch (411:9): [True: 0, False: 101k]
  ------------------
  412|      0|        return 0;
  413|       |
  414|   101k|    if (!BN_copy(group->order, order))
  ------------------
  |  Branch (414:9): [True: 0, False: 101k]
  ------------------
  415|      0|        return 0;
  416|       |
  417|       |    /* Either take the provided positive cofactor, or try to compute it */
  418|   101k|    if (cofactor != NULL && !BN_is_zero(cofactor)) {
  ------------------
  |  Branch (418:9): [True: 101k, False: 0]
  |  Branch (418:29): [True: 101k, False: 0]
  ------------------
  419|   101k|        if (!BN_copy(group->cofactor, cofactor))
  ------------------
  |  Branch (419:13): [True: 0, False: 101k]
  ------------------
  420|      0|            return 0;
  421|   101k|    } else if (!ec_guess_cofactor(group)) {
  ------------------
  |  Branch (421:16): [True: 0, False: 0]
  ------------------
  422|      0|        BN_zero(group->cofactor);
  ------------------
  |  |  201|      0|#define BN_zero(a) BN_zero_ex(a)
  ------------------
  423|      0|        return 0;
  424|      0|    }
  425|       |
  426|       |    /*
  427|       |     * Some groups have an order with
  428|       |     * factors of two, which makes the Montgomery setup fail.
  429|       |     * |group->mont_data| will be NULL in this case.
  430|       |     */
  431|   101k|    if (BN_is_odd(group->order)) {
  ------------------
  |  Branch (431:9): [True: 101k, False: 0]
  ------------------
  432|   101k|        return ec_precompute_mont_data(group);
  433|   101k|    }
  434|       |
  435|      0|    BN_MONT_CTX_free(group->mont_data);
  436|       |    group->mont_data = NULL;
  437|      0|    return 1;
  438|   101k|}
EC_GROUP_get0_generator:
  441|     53|{
  442|     53|    return group->generator;
  443|     53|}
EC_GROUP_get0_order:
  461|   113k|{
  462|   113k|    return group->order;
  463|   113k|}
EC_GROUP_order_bits:
  466|   227k|{
  467|   227k|    return group->meth->group_order_bits(group);
  468|   227k|}
EC_GROUP_get0_cofactor:
  483|    226|{
  484|    226|    return group->cofactor;
  485|    226|}
EC_GROUP_set_curve_name:
  488|   113k|{
  489|   113k|    group->curve_name = nid;
  490|   113k|    group->asn1_flag = (nid != NID_undef)
  ------------------
  |  |   18|   113k|#define NID_undef                       0
  ------------------
  |  Branch (490:24): [True: 113k, False: 0]
  ------------------
  491|   113k|        ? OPENSSL_EC_NAMED_CURVE
  ------------------
  |  |   31|   113k|#define OPENSSL_EC_NAMED_CURVE 0x001
  ------------------
  492|   113k|        : OPENSSL_EC_EXPLICIT_CURVE;
  ------------------
  |  |   30|   113k|#define OPENSSL_EC_EXPLICIT_CURVE 0x000
  ------------------
  493|   113k|}
EC_GROUP_get_curve_name:
  496|   452k|{
  497|   452k|    return group->curve_name;
  498|   452k|}
EC_GROUP_get_field_type:
  506|   227k|{
  507|   227k|    return group->meth->field_type;
  508|   227k|}
EC_GROUP_set_asn1_flag:
  511|   112k|{
  512|   112k|    group->asn1_flag = flag;
  513|   112k|}
EC_GROUP_get_asn1_flag:
  516|   215k|{
  517|   215k|    return group->asn1_flag;
  518|   215k|}
EC_GROUP_get_point_conversion_form:
  528|   113k|{
  529|   113k|    return group->asn1_form;
  530|   113k|}
EC_GROUP_set_seed:
  533|   113k|{
  534|   113k|    OPENSSL_free(group->seed);
  ------------------
  |  |  131|   113k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  535|   113k|    group->seed = NULL;
  536|   113k|    group->seed_len = 0;
  537|       |
  538|   113k|    if (!len || !p)
  ------------------
  |  Branch (538:9): [True: 0, False: 113k]
  |  Branch (538:17): [True: 0, False: 113k]
  ------------------
  539|      0|        return 1;
  540|       |
  541|   113k|    if ((group->seed = OPENSSL_malloc(len)) == NULL)
  ------------------
  |  |  106|   113k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (541:9): [True: 0, False: 113k]
  ------------------
  542|      0|        return 0;
  543|   113k|    memcpy(group->seed, p, len);
  544|   113k|    group->seed_len = len;
  545|       |
  546|   113k|    return len;
  547|   113k|}
EC_GROUP_set_curve:
  561|    144|{
  562|    144|    if (group->meth->group_set_curve == 0) {
  ------------------
  |  Branch (562:9): [True: 0, False: 144]
  ------------------
  563|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  564|      0|        return 0;
  565|      0|    }
  566|    144|    return group->meth->group_set_curve(group, p, a, b, ctx);
  567|    144|}
EC_POINT_new:
  717|   453k|{
  718|   453k|    EC_POINT *ret;
  719|       |
  720|   453k|    if (group == NULL) {
  ------------------
  |  Branch (720:9): [True: 0, False: 453k]
  ------------------
  721|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  722|      0|        return NULL;
  723|      0|    }
  724|   453k|    if (group->meth->point_init == NULL) {
  ------------------
  |  Branch (724:9): [True: 0, False: 453k]
  ------------------
  725|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  726|      0|        return NULL;
  727|      0|    }
  728|       |
  729|   453k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|   453k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  730|   453k|    if (ret == NULL)
  ------------------
  |  Branch (730:9): [True: 0, False: 453k]
  ------------------
  731|      0|        return NULL;
  732|       |
  733|   453k|    ret->meth = group->meth;
  734|   453k|    ret->curve_name = group->curve_name;
  735|       |
  736|   453k|    if (!ret->meth->point_init(ret)) {
  ------------------
  |  Branch (736:9): [True: 0, False: 453k]
  ------------------
  737|      0|        OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  738|      0|        return NULL;
  739|      0|    }
  740|       |
  741|   453k|    return ret;
  742|   453k|}
EC_POINT_free:
  745|   453k|{
  746|   453k|    if (point == NULL)
  ------------------
  |  Branch (746:9): [True: 226, False: 452k]
  ------------------
  747|    226|        return;
  748|       |
  749|       |#ifdef OPENSSL_PEDANTIC_ZEROIZATION
  750|       |    EC_POINT_clear_free(point);
  751|       |#else
  752|   452k|    if (point->meth->point_finish != 0)
  ------------------
  |  Branch (752:9): [True: 452k, False: 0]
  ------------------
  753|   452k|        point->meth->point_finish(point);
  754|   452k|    OPENSSL_free(point);
  ------------------
  |  |  131|   452k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  755|   452k|#endif
  756|   452k|}
EC_POINT_clear_free:
  759|    144|{
  760|    144|    if (point == NULL)
  ------------------
  |  Branch (760:9): [True: 0, False: 144]
  ------------------
  761|      0|        return;
  762|       |
  763|    144|    if (point->meth->point_clear_finish != 0)
  ------------------
  |  Branch (763:9): [True: 144, False: 0]
  ------------------
  764|    144|        point->meth->point_clear_finish(point);
  765|      0|    else if (point->meth->point_finish != 0)
  ------------------
  |  Branch (765:14): [True: 0, False: 0]
  ------------------
  766|      0|        point->meth->point_finish(point);
  767|    144|    OPENSSL_clear_free(point, sizeof(*point));
  ------------------
  |  |  129|    144|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  768|    144|}
EC_POINT_copy:
  771|   226k|{
  772|   226k|    if (dest->meth->point_copy == 0) {
  ------------------
  |  Branch (772:9): [True: 0, False: 226k]
  ------------------
  773|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  774|      0|        return 0;
  775|      0|    }
  776|   226k|    if (dest->meth != src->meth
  ------------------
  |  Branch (776:9): [True: 0, False: 226k]
  ------------------
  777|   226k|        || (dest->curve_name != src->curve_name
  ------------------
  |  Branch (777:13): [True: 11.3k, False: 215k]
  ------------------
  778|  11.3k|            && dest->curve_name != 0
  ------------------
  |  Branch (778:16): [True: 11.3k, False: 0]
  ------------------
  779|  11.3k|            && src->curve_name != 0)) {
  ------------------
  |  Branch (779:16): [True: 0, False: 11.3k]
  ------------------
  780|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  781|      0|        return 0;
  782|      0|    }
  783|   226k|    if (dest == src)
  ------------------
  |  Branch (783:9): [True: 0, False: 226k]
  ------------------
  784|      0|        return 1;
  785|   226k|    return dest->meth->point_copy(dest, src);
  786|   226k|}
EC_POINT_set_Jprojective_coordinates_GFp:
  832|   226k|{
  833|   226k|    if (group->meth->field_type != NID_X9_62_prime_field) {
  ------------------
  |  |  152|   226k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (833:9): [True: 0, False: 226k]
  ------------------
  834|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  835|      0|        return 0;
  836|      0|    }
  837|   226k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (837:9): [True: 0, False: 226k]
  ------------------
  838|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  839|      0|        return 0;
  840|      0|    }
  841|   226k|    return ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(group, point,
  842|   226k|        x, y, z, ctx);
  843|   226k|}
EC_POINT_set_affine_coordinates:
  866|   226k|{
  867|   226k|    if (group->meth->point_set_affine_coordinates == NULL) {
  ------------------
  |  Branch (867:9): [True: 0, False: 226k]
  ------------------
  868|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  869|      0|        return 0;
  870|      0|    }
  871|   226k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (871:9): [True: 0, False: 226k]
  ------------------
  872|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  873|      0|        return 0;
  874|      0|    }
  875|   226k|    if (!group->meth->point_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (875:9): [True: 0, False: 226k]
  ------------------
  876|      0|        return 0;
  877|       |
  878|   226k|    if (EC_POINT_is_on_curve(group, point, ctx) <= 0) {
  ------------------
  |  Branch (878:9): [True: 0, False: 226k]
  ------------------
  879|      0|        ERR_raise(ERR_LIB_EC, EC_R_POINT_IS_NOT_ON_CURVE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  880|      0|        return 0;
  881|      0|    }
  882|   226k|    return 1;
  883|   226k|}
EC_POINT_get_affine_coordinates:
  906|    226|{
  907|    226|    if (group->meth->point_get_affine_coordinates == NULL) {
  ------------------
  |  Branch (907:9): [True: 0, False: 226]
  ------------------
  908|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  909|      0|        return 0;
  910|      0|    }
  911|    226|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (911:9): [True: 0, False: 226]
  ------------------
  912|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  913|      0|        return 0;
  914|      0|    }
  915|    226|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (915:9): [True: 0, False: 226]
  ------------------
  916|      0|        ERR_raise(ERR_LIB_EC, EC_R_POINT_AT_INFINITY);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  917|      0|        return 0;
  918|      0|    }
  919|    226|    return group->meth->point_get_affine_coordinates(group, point, x, y, ctx);
  920|    226|}
EC_POINT_is_at_infinity:
  983|   227k|{
  984|   227k|    if (group->meth->is_at_infinity == 0) {
  ------------------
  |  Branch (984:9): [True: 0, False: 227k]
  ------------------
  985|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  986|      0|        return 0;
  987|      0|    }
  988|   227k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (988:9): [True: 0, False: 227k]
  ------------------
  989|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  990|      0|        return 0;
  991|      0|    }
  992|   227k|    return group->meth->is_at_infinity(group, point);
  993|   227k|}
EC_POINT_is_on_curve:
 1004|   226k|{
 1005|   226k|    if (group->meth->is_on_curve == 0) {
  ------------------
  |  Branch (1005:9): [True: 0, False: 226k]
  ------------------
 1006|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1007|      0|        return 0;
 1008|      0|    }
 1009|   226k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (1009:9): [True: 0, False: 226k]
  ------------------
 1010|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1011|      0|        return 0;
 1012|      0|    }
 1013|   226k|    return group->meth->is_on_curve(group, point, ctx);
 1014|   226k|}
EC_POINT_cmp:
 1018|     29|{
 1019|     29|    if (group->meth->point_cmp == 0) {
  ------------------
  |  Branch (1019:9): [True: 0, False: 29]
  ------------------
 1020|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1021|      0|        return -1;
 1022|      0|    }
 1023|     29|    if (!ec_point_is_compat(a, group) || !ec_point_is_compat(b, group)) {
  ------------------
  |  Branch (1023:9): [True: 0, False: 29]
  |  Branch (1023:42): [True: 0, False: 29]
  ------------------
 1024|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1025|      0|        return -1;
 1026|      0|    }
 1027|     29|    return group->meth->point_cmp(group, a, b, ctx);
 1028|     29|}
EC_POINT_mul:
 1119|    226|{
 1120|    226|    int ret = 0;
 1121|    226|    size_t num;
 1122|    226|#ifndef FIPS_MODULE
 1123|    226|    BN_CTX *new_ctx = NULL;
 1124|    226|#endif
 1125|       |
 1126|    226|    if (!ec_point_is_compat(r, group)
  ------------------
  |  Branch (1126:9): [True: 0, False: 226]
  ------------------
 1127|    226|        || (point != NULL && !ec_point_is_compat(point, group))) {
  ------------------
  |  Branch (1127:13): [True: 0, False: 226]
  |  Branch (1127:30): [True: 0, False: 0]
  ------------------
 1128|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1129|      0|        return 0;
 1130|      0|    }
 1131|       |
 1132|    226|    if (g_scalar == NULL && p_scalar == NULL)
  ------------------
  |  Branch (1132:9): [True: 0, False: 226]
  |  Branch (1132:29): [True: 0, False: 0]
  ------------------
 1133|      0|        return EC_POINT_set_to_infinity(group, r);
 1134|       |
 1135|    226|#ifndef FIPS_MODULE
 1136|    226|    if (ctx == NULL)
  ------------------
  |  Branch (1136:9): [True: 0, False: 226]
  ------------------
 1137|      0|        ctx = new_ctx = BN_CTX_secure_new();
 1138|    226|#endif
 1139|    226|    if (ctx == NULL) {
  ------------------
  |  Branch (1139:9): [True: 0, False: 226]
  ------------------
 1140|      0|        ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1141|      0|        return 0;
 1142|      0|    }
 1143|       |
 1144|    226|    num = (point != NULL && p_scalar != NULL) ? 1 : 0;
  ------------------
  |  Branch (1144:12): [True: 0, False: 226]
  |  Branch (1144:29): [True: 0, False: 0]
  ------------------
 1145|    226|    if (group->meth->mul != NULL)
  ------------------
  |  Branch (1145:9): [True: 82, False: 144]
  ------------------
 1146|     82|        ret = group->meth->mul(group, r, g_scalar, num, &point, &p_scalar, ctx);
 1147|    144|    else
 1148|       |        /* use default */
 1149|    144|        ret = ossl_ec_wNAF_mul(group, r, g_scalar, num, &point, &p_scalar, ctx);
 1150|       |
 1151|    226|#ifndef FIPS_MODULE
 1152|    226|    BN_CTX_free(new_ctx);
 1153|    226|#endif
 1154|    226|    return ret;
 1155|    226|}
ossl_ec_group_simple_order_bits:
 1230|   227k|{
 1231|   227k|    if (group->order == NULL)
  ------------------
  |  Branch (1231:9): [True: 0, False: 227k]
  ------------------
 1232|      0|        return 0;
 1233|   227k|    return BN_num_bits(group->order);
 1234|   227k|}
ossl_ec_group_set_params:
 1506|    226|{
 1507|    226|    int encoding_flag = -1, format = -1;
 1508|    226|    const OSSL_PARAM *p;
 1509|       |
 1510|    226|    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT);
  ------------------
  |  |  394|    226|# define OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT "point-format"
  ------------------
 1511|    226|    if (p != NULL) {
  ------------------
  |  Branch (1511:9): [True: 0, False: 226]
  ------------------
 1512|      0|        if (!ossl_ec_pt_format_param2id(p, &format)) {
  ------------------
  |  Branch (1512:13): [True: 0, False: 0]
  ------------------
 1513|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_FORM);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1514|      0|            return 0;
 1515|      0|        }
 1516|      0|        EC_GROUP_set_point_conversion_form(group, format);
 1517|      0|    }
 1518|       |
 1519|    226|    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_ENCODING);
  ------------------
  |  |  387|    226|# define OSSL_PKEY_PARAM_EC_ENCODING "encoding"
  ------------------
 1520|    226|    if (p != NULL) {
  ------------------
  |  Branch (1520:9): [True: 0, False: 226]
  ------------------
 1521|      0|        if (!ossl_ec_encoding_param2id(p, &encoding_flag)) {
  ------------------
  |  Branch (1521:13): [True: 0, False: 0]
  ------------------
 1522|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_FORM);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1523|      0|            return 0;
 1524|      0|        }
 1525|      0|        EC_GROUP_set_asn1_flag(group, encoding_flag);
 1526|      0|    }
 1527|       |    /* Optional seed */
 1528|    226|    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_SEED);
  ------------------
  |  |  397|    226|# define OSSL_PKEY_PARAM_EC_SEED "seed"
  ------------------
 1529|    226|    if (p != NULL) {
  ------------------
  |  Branch (1529:9): [True: 0, False: 226]
  ------------------
 1530|       |        /* The seed is allowed to be NULL */
 1531|      0|        if (p->data_type != OSSL_PARAM_OCTET_STRING
  ------------------
  |  |  123|      0|#define OSSL_PARAM_OCTET_STRING 5
  ------------------
  |  Branch (1531:13): [True: 0, False: 0]
  ------------------
 1532|      0|            || !EC_GROUP_set_seed(group, p->data, p->data_size)) {
  ------------------
  |  Branch (1532:16): [True: 0, False: 0]
  ------------------
 1533|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_SEED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1534|      0|            return 0;
 1535|      0|        }
 1536|      0|    }
 1537|    226|    return 1;
 1538|    226|}
EC_GROUP_new_from_params:
 1542|    226|{
 1543|    226|    const OSSL_PARAM *ptmp;
 1544|    226|    EC_GROUP *group = NULL;
 1545|       |
 1546|    226|#ifndef FIPS_MODULE
 1547|    226|    const OSSL_PARAM *pa, *pb;
 1548|    226|    int ok = 0;
 1549|    226|    EC_GROUP *named_group = NULL;
 1550|    226|    BIGNUM *p = NULL, *a = NULL, *b = NULL, *order = NULL, *cofactor = NULL;
 1551|    226|    EC_POINT *point = NULL;
 1552|    226|    int field_bits = 0;
 1553|    226|    int is_prime_field = 1;
 1554|    226|    BN_CTX *bnctx = NULL;
 1555|    226|    const unsigned char *buf = NULL;
 1556|    226|    int encoding_flag = -1;
 1557|    226|#endif
 1558|       |
 1559|       |    /* This is the simple named group case */
 1560|    226|    ptmp = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_GROUP_NAME);
  ------------------
  |  |  420|    226|# define OSSL_PKEY_PARAM_GROUP_NAME "group"
  ------------------
 1561|    226|    if (ptmp != NULL) {
  ------------------
  |  Branch (1561:9): [True: 226, False: 0]
  ------------------
 1562|    226|        int decoded = 0;
 1563|       |
 1564|    226|        if ((group = group_new_from_name(ptmp, libctx, propq)) == NULL)
  ------------------
  |  Branch (1564:13): [True: 0, False: 226]
  ------------------
 1565|      0|            return NULL;
 1566|    226|        if (!ossl_ec_group_set_params(group, params)) {
  ------------------
  |  Branch (1566:13): [True: 0, False: 226]
  ------------------
 1567|      0|            EC_GROUP_free(group);
 1568|      0|            return NULL;
 1569|      0|        }
 1570|       |
 1571|    226|        ptmp = OSSL_PARAM_locate_const(params,
 1572|    226|            OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS);
  ------------------
  |  |  386|    226|# define OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS "decoded-from-explicit"
  ------------------
 1573|    226|        if (ptmp != NULL && !OSSL_PARAM_get_int(ptmp, &decoded)) {
  ------------------
  |  Branch (1573:13): [True: 0, False: 226]
  |  Branch (1573:29): [True: 0, False: 0]
  ------------------
 1574|      0|            ERR_raise(ERR_LIB_EC, EC_R_WRONG_CURVE_PARAMETERS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1575|      0|            EC_GROUP_free(group);
 1576|      0|            return NULL;
 1577|      0|        }
 1578|    226|        group->decoded_from_explicit_params = decoded > 0;
 1579|    226|        return group;
 1580|    226|    }
 1581|       |#ifdef FIPS_MODULE
 1582|       |    ERR_raise(ERR_LIB_EC, EC_R_EXPLICIT_PARAMS_NOT_SUPPORTED);
 1583|       |    return NULL;
 1584|       |#else
 1585|       |    /* If it gets here then we are trying explicit parameters */
 1586|      0|    bnctx = BN_CTX_new_ex(libctx);
 1587|      0|    if (bnctx == NULL) {
  ------------------
  |  Branch (1587:9): [True: 0, False: 0]
  ------------------
 1588|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1589|      0|        return 0;
 1590|      0|    }
 1591|      0|    BN_CTX_start(bnctx);
 1592|       |
 1593|      0|    p = BN_CTX_get(bnctx);
 1594|      0|    a = BN_CTX_get(bnctx);
 1595|      0|    b = BN_CTX_get(bnctx);
 1596|      0|    order = BN_CTX_get(bnctx);
 1597|      0|    if (order == NULL) {
  ------------------
  |  Branch (1597:9): [True: 0, False: 0]
  ------------------
 1598|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1599|      0|        goto err;
 1600|      0|    }
 1601|       |
 1602|      0|    ptmp = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_FIELD_TYPE);
  ------------------
  |  |  388|      0|# define OSSL_PKEY_PARAM_EC_FIELD_TYPE "field-type"
  ------------------
 1603|      0|    if (ptmp == NULL || ptmp->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|      0|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (1603:9): [True: 0, False: 0]
  |  Branch (1603:25): [True: 0, False: 0]
  ------------------
 1604|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_FIELD);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1605|      0|        goto err;
 1606|      0|    }
 1607|      0|    if (OPENSSL_strcasecmp(ptmp->data, SN_X9_62_prime_field) == 0) {
  ------------------
  |  |  151|      0|#define SN_X9_62_prime_field            "prime-field"
  ------------------
  |  Branch (1607:9): [True: 0, False: 0]
  ------------------
 1608|      0|        is_prime_field = 1;
 1609|      0|    } else if (OPENSSL_strcasecmp(ptmp->data,
  ------------------
  |  Branch (1609:16): [True: 0, False: 0]
  ------------------
 1610|      0|                   SN_X9_62_characteristic_two_field)
  ------------------
  |  |  155|      0|#define SN_X9_62_characteristic_two_field               "characteristic-two-field"
  ------------------
 1611|      0|        == 0) {
 1612|      0|        is_prime_field = 0;
 1613|      0|    } else {
 1614|       |        /* Invalid field */
 1615|      0|        ERR_raise(ERR_LIB_EC, EC_R_UNSUPPORTED_FIELD);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1616|      0|        goto err;
 1617|      0|    }
 1618|       |
 1619|      0|    pa = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_A);
  ------------------
  |  |  377|      0|# define OSSL_PKEY_PARAM_EC_A "a"
  ------------------
 1620|      0|    if (!OSSL_PARAM_get_BN(pa, &a)) {
  ------------------
  |  Branch (1620:9): [True: 0, False: 0]
  ------------------
 1621|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_A);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1622|      0|        goto err;
 1623|      0|    }
 1624|      0|    pb = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_B);
  ------------------
  |  |  378|      0|# define OSSL_PKEY_PARAM_EC_B "b"
  ------------------
 1625|      0|    if (!OSSL_PARAM_get_BN(pb, &b)) {
  ------------------
  |  Branch (1625:9): [True: 0, False: 0]
  ------------------
 1626|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_B);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1627|      0|        goto err;
 1628|      0|    }
 1629|       |
 1630|       |    /* extract the prime number or irreducible polynomial */
 1631|      0|    ptmp = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_P);
  ------------------
  |  |  393|      0|# define OSSL_PKEY_PARAM_EC_P "p"
  ------------------
 1632|      0|    if (!OSSL_PARAM_get_BN(ptmp, &p)) {
  ------------------
  |  Branch (1632:9): [True: 0, False: 0]
  ------------------
 1633|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_P);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1634|      0|        goto err;
 1635|      0|    }
 1636|       |
 1637|      0|    if (is_prime_field) {
  ------------------
  |  Branch (1637:9): [True: 0, False: 0]
  ------------------
 1638|      0|        if (BN_is_negative(p) || BN_is_zero(p)) {
  ------------------
  |  Branch (1638:13): [True: 0, False: 0]
  |  Branch (1638:34): [True: 0, False: 0]
  ------------------
 1639|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_P);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1640|      0|            goto err;
 1641|      0|        }
 1642|      0|        field_bits = BN_num_bits(p);
 1643|      0|        if (field_bits > OPENSSL_ECC_MAX_FIELD_BITS) {
  ------------------
  |  |  103|      0|#define OPENSSL_ECC_MAX_FIELD_BITS 661
  ------------------
  |  Branch (1643:13): [True: 0, False: 0]
  ------------------
 1644|      0|            ERR_raise(ERR_LIB_EC, EC_R_FIELD_TOO_LARGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1645|      0|            goto err;
 1646|      0|        }
 1647|       |
 1648|       |        /* create the EC_GROUP structure */
 1649|      0|        group = EC_GROUP_new_curve_GFp(p, a, b, bnctx);
 1650|      0|    } else {
 1651|       |#ifdef OPENSSL_NO_EC2M
 1652|       |        ERR_raise(ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED);
 1653|       |        goto err;
 1654|       |#else
 1655|       |        /* create the EC_GROUP structure */
 1656|      0|        group = EC_GROUP_new_curve_GF2m(p, a, b, NULL);
 1657|      0|        if (group != NULL) {
  ------------------
  |  Branch (1657:13): [True: 0, False: 0]
  ------------------
 1658|      0|            field_bits = EC_GROUP_get_degree(group);
 1659|      0|            if (field_bits > OPENSSL_ECC_MAX_FIELD_BITS) {
  ------------------
  |  |  103|      0|#define OPENSSL_ECC_MAX_FIELD_BITS 661
  ------------------
  |  Branch (1659:17): [True: 0, False: 0]
  ------------------
 1660|      0|                ERR_raise(ERR_LIB_EC, EC_R_FIELD_TOO_LARGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1661|      0|                goto err;
 1662|      0|            }
 1663|      0|        }
 1664|      0|#endif /* OPENSSL_NO_EC2M */
 1665|      0|    }
 1666|       |
 1667|      0|    if (group == NULL) {
  ------------------
  |  Branch (1667:9): [True: 0, False: 0]
  ------------------
 1668|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1669|      0|        goto err;
 1670|      0|    }
 1671|       |
 1672|       |    /* Optional seed */
 1673|      0|    ptmp = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_SEED);
  ------------------
  |  |  397|      0|# define OSSL_PKEY_PARAM_EC_SEED "seed"
  ------------------
 1674|      0|    if (ptmp != NULL) {
  ------------------
  |  Branch (1674:9): [True: 0, False: 0]
  ------------------
 1675|      0|        if (ptmp->data_type != OSSL_PARAM_OCTET_STRING) {
  ------------------
  |  |  123|      0|#define OSSL_PARAM_OCTET_STRING 5
  ------------------
  |  Branch (1675:13): [True: 0, False: 0]
  ------------------
 1676|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_SEED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1677|      0|            goto err;
 1678|      0|        }
 1679|      0|        if (!EC_GROUP_set_seed(group, ptmp->data, ptmp->data_size))
  ------------------
  |  Branch (1679:13): [True: 0, False: 0]
  ------------------
 1680|      0|            goto err;
 1681|      0|    }
 1682|       |
 1683|       |    /* generator base point */
 1684|      0|    ptmp = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_GENERATOR);
  ------------------
  |  |  389|      0|# define OSSL_PKEY_PARAM_EC_GENERATOR "generator"
  ------------------
 1685|      0|    if (ptmp == NULL
  ------------------
  |  Branch (1685:9): [True: 0, False: 0]
  ------------------
 1686|      0|        || ptmp->data_type != OSSL_PARAM_OCTET_STRING) {
  ------------------
  |  |  123|      0|#define OSSL_PARAM_OCTET_STRING 5
  ------------------
  |  Branch (1686:12): [True: 0, False: 0]
  ------------------
 1687|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_GENERATOR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1688|      0|        goto err;
 1689|      0|    }
 1690|      0|    buf = (const unsigned char *)(ptmp->data);
 1691|      0|    if ((point = EC_POINT_new(group)) == NULL)
  ------------------
  |  Branch (1691:9): [True: 0, False: 0]
  ------------------
 1692|      0|        goto err;
 1693|      0|    EC_GROUP_set_point_conversion_form(group,
 1694|      0|        (point_conversion_form_t)buf[0] & ~0x01);
 1695|      0|    if (!EC_POINT_oct2point(group, point, buf, ptmp->data_size, bnctx)) {
  ------------------
  |  Branch (1695:9): [True: 0, False: 0]
  ------------------
 1696|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_GENERATOR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1697|      0|        goto err;
 1698|      0|    }
 1699|       |
 1700|       |    /* order */
 1701|      0|    ptmp = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_ORDER);
  ------------------
  |  |  392|      0|# define OSSL_PKEY_PARAM_EC_ORDER "order"
  ------------------
 1702|      0|    if (!OSSL_PARAM_get_BN(ptmp, &order)
  ------------------
  |  Branch (1702:9): [True: 0, False: 0]
  ------------------
 1703|      0|        || (BN_is_negative(order) || BN_is_zero(order))
  ------------------
  |  Branch (1703:13): [True: 0, False: 0]
  |  Branch (1703:38): [True: 0, False: 0]
  ------------------
 1704|      0|        || (BN_num_bits(order) > (int)field_bits + 1)) { /* Hasse bound */
  ------------------
  |  Branch (1704:12): [True: 0, False: 0]
  ------------------
 1705|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1706|      0|        goto err;
 1707|      0|    }
 1708|       |
 1709|       |    /* Optional cofactor */
 1710|      0|    ptmp = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_COFACTOR);
  ------------------
  |  |  385|      0|# define OSSL_PKEY_PARAM_EC_COFACTOR "cofactor"
  ------------------
 1711|      0|    if (ptmp != NULL) {
  ------------------
  |  Branch (1711:9): [True: 0, False: 0]
  ------------------
 1712|      0|        cofactor = BN_CTX_get(bnctx);
 1713|      0|        if (cofactor == NULL || !OSSL_PARAM_get_BN(ptmp, &cofactor)) {
  ------------------
  |  Branch (1713:13): [True: 0, False: 0]
  |  Branch (1713:33): [True: 0, False: 0]
  ------------------
 1714|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_COFACTOR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1715|      0|            goto err;
 1716|      0|        }
 1717|      0|    }
 1718|       |
 1719|       |    /* set the generator, order and cofactor (if present) */
 1720|      0|    if (!EC_GROUP_set_generator(group, point, order, cofactor)) {
  ------------------
  |  Branch (1720:9): [True: 0, False: 0]
  ------------------
 1721|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_GENERATOR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1722|      0|        goto err;
 1723|      0|    }
 1724|       |
 1725|      0|    named_group = ec_group_explicit_to_named(group, libctx, propq, bnctx);
 1726|      0|    if (named_group == NULL) {
  ------------------
  |  Branch (1726:9): [True: 0, False: 0]
  ------------------
 1727|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_NAMED_GROUP_CONVERSION);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1728|      0|        goto err;
 1729|      0|    }
 1730|      0|    if (named_group == group) {
  ------------------
  |  Branch (1730:9): [True: 0, False: 0]
  ------------------
 1731|       |        /*
 1732|       |         * If we did not find a named group then the encoding should be explicit
 1733|       |         * if it was specified
 1734|       |         */
 1735|      0|        ptmp = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_EC_ENCODING);
  ------------------
  |  |  387|      0|# define OSSL_PKEY_PARAM_EC_ENCODING "encoding"
  ------------------
 1736|      0|        if (ptmp != NULL
  ------------------
  |  Branch (1736:13): [True: 0, False: 0]
  ------------------
 1737|      0|            && !ossl_ec_encoding_param2id(ptmp, &encoding_flag)) {
  ------------------
  |  Branch (1737:16): [True: 0, False: 0]
  ------------------
 1738|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1739|      0|            goto err;
 1740|      0|        }
 1741|      0|        if (encoding_flag == OPENSSL_EC_NAMED_CURVE) {
  ------------------
  |  |   31|      0|#define OPENSSL_EC_NAMED_CURVE 0x001
  ------------------
  |  Branch (1741:13): [True: 0, False: 0]
  ------------------
 1742|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1743|      0|            goto err;
 1744|      0|        }
 1745|      0|        EC_GROUP_set_asn1_flag(group, OPENSSL_EC_EXPLICIT_CURVE);
  ------------------
  |  |   30|      0|#define OPENSSL_EC_EXPLICIT_CURVE 0x000
  ------------------
 1746|      0|    } else {
 1747|      0|        EC_GROUP_free(group);
 1748|      0|        group = named_group;
 1749|      0|    }
 1750|       |    /* We've imported the group from explicit parameters, set it so. */
 1751|      0|    group->decoded_from_explicit_params = 1;
 1752|      0|    ok = 1;
 1753|      0|err:
 1754|      0|    if (!ok) {
  ------------------
  |  Branch (1754:9): [True: 0, False: 0]
  ------------------
 1755|      0|        EC_GROUP_free(group);
 1756|      0|        group = NULL;
 1757|      0|    }
 1758|      0|    EC_POINT_free(point);
 1759|      0|    BN_CTX_end(bnctx);
 1760|      0|    BN_CTX_free(bnctx);
 1761|       |
 1762|      0|    return group;
 1763|      0|#endif /* FIPS_MODULE */
 1764|      0|}
ec_lib.c:ec_precompute_mont_data:
 1189|   101k|{
 1190|   101k|    BN_CTX *ctx = BN_CTX_new_ex(group->libctx);
 1191|   101k|    int ret = 0;
 1192|       |
 1193|   101k|    BN_MONT_CTX_free(group->mont_data);
 1194|   101k|    group->mont_data = NULL;
 1195|       |
 1196|   101k|    if (ctx == NULL)
  ------------------
  |  Branch (1196:9): [True: 0, False: 101k]
  ------------------
 1197|      0|        goto err;
 1198|       |
 1199|   101k|    group->mont_data = BN_MONT_CTX_new();
 1200|   101k|    if (group->mont_data == NULL)
  ------------------
  |  Branch (1200:9): [True: 0, False: 101k]
  ------------------
 1201|      0|        goto err;
 1202|       |
 1203|   101k|    if (!BN_MONT_CTX_set(group->mont_data, group->order, ctx)) {
  ------------------
  |  Branch (1203:9): [True: 0, False: 101k]
  ------------------
 1204|      0|        BN_MONT_CTX_free(group->mont_data);
 1205|      0|        group->mont_data = NULL;
 1206|      0|        goto err;
 1207|      0|    }
 1208|       |
 1209|   101k|    ret = 1;
 1210|       |
 1211|   101k|err:
 1212|       |
 1213|   101k|    BN_CTX_free(ctx);
 1214|   101k|    return ret;
 1215|   101k|}
ec_lib.c:group_new_from_name:
 1477|    226|{
 1478|    226|    int ok = 0, nid;
 1479|    226|    const char *curve_name = NULL;
 1480|       |
 1481|    226|    switch (p->data_type) {
  ------------------
  |  Branch (1481:13): [True: 226, False: 0]
  ------------------
 1482|    226|    case OSSL_PARAM_UTF8_STRING:
  ------------------
  |  |  117|    226|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (1482:5): [True: 226, False: 0]
  ------------------
 1483|       |        /* The OSSL_PARAM functions have no support for this */
 1484|    226|        curve_name = p->data;
 1485|    226|        ok = (curve_name != NULL);
 1486|    226|        break;
 1487|      0|    case OSSL_PARAM_UTF8_PTR:
  ------------------
  |  |  141|      0|#define OSSL_PARAM_UTF8_PTR 6
  ------------------
  |  Branch (1487:5): [True: 0, False: 226]
  ------------------
 1488|      0|        ok = OSSL_PARAM_get_utf8_ptr(p, &curve_name);
 1489|      0|        break;
 1490|    226|    }
 1491|       |
 1492|    226|    if (ok) {
  ------------------
  |  Branch (1492:9): [True: 226, False: 0]
  ------------------
 1493|    226|        nid = ossl_ec_curve_name2nid(curve_name);
 1494|    226|        if (nid == NID_undef) {
  ------------------
  |  |   18|    226|#define NID_undef                       0
  ------------------
  |  Branch (1494:13): [True: 0, False: 226]
  ------------------
 1495|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_CURVE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1496|      0|            return NULL;
 1497|    226|        } else {
 1498|    226|            return EC_GROUP_new_by_curve_name_ex(libctx, propq, nid);
 1499|    226|        }
 1500|    226|    }
 1501|      0|    return NULL;
 1502|    226|}

ec_lib.c:ec_point_is_compat:
  333|   906k|{
  334|   906k|    return group->meth == point->meth
  ------------------
  |  Branch (334:12): [True: 906k, False: 0]
  ------------------
  335|   906k|        && (group->curve_name == 0
  ------------------
  |  Branch (335:13): [True: 45.3k, False: 860k]
  ------------------
  336|   860k|            || point->curve_name == 0
  ------------------
  |  Branch (336:16): [True: 0, False: 860k]
  ------------------
  337|   860k|            || group->curve_name == point->curve_name);
  ------------------
  |  Branch (337:16): [True: 860k, False: 0]
  ------------------
  338|   906k|}
ec_mult.c:ec_point_ladder_pre:
  765|    144|{
  766|    144|    if (group->meth->ladder_pre != NULL)
  ------------------
  |  Branch (766:9): [True: 144, False: 0]
  ------------------
  767|    144|        return group->meth->ladder_pre(group, r, s, p, ctx);
  768|       |
  769|      0|    if (!EC_POINT_copy(s, p)
  ------------------
  |  Branch (769:9): [True: 0, False: 0]
  ------------------
  770|      0|        || !EC_POINT_dbl(group, r, s, ctx))
  ------------------
  |  Branch (770:12): [True: 0, False: 0]
  ------------------
  771|      0|        return 0;
  772|       |
  773|      0|    return 1;
  774|      0|}
ec_mult.c:ec_point_ladder_step:
  779|  65.5k|{
  780|  65.5k|    if (group->meth->ladder_step != NULL)
  ------------------
  |  Branch (780:9): [True: 65.5k, False: 0]
  ------------------
  781|  65.5k|        return group->meth->ladder_step(group, r, s, p, ctx);
  782|       |
  783|      0|    if (!EC_POINT_add(group, s, r, s, ctx)
  ------------------
  |  Branch (783:9): [True: 0, False: 0]
  ------------------
  784|      0|        || !EC_POINT_dbl(group, r, r, ctx))
  ------------------
  |  Branch (784:12): [True: 0, False: 0]
  ------------------
  785|      0|        return 0;
  786|       |
  787|      0|    return 1;
  788|      0|}
ec_mult.c:ec_point_ladder_post:
  793|    144|{
  794|    144|    if (group->meth->ladder_post != NULL)
  ------------------
  |  Branch (794:9): [True: 144, False: 0]
  ------------------
  795|    144|        return group->meth->ladder_post(group, r, s, p, ctx);
  796|       |
  797|      0|    return 1;
  798|    144|}
ec_oct.c:ec_point_is_compat:
  333|   113k|{
  334|   113k|    return group->meth == point->meth
  ------------------
  |  Branch (334:12): [True: 113k, False: 0]
  ------------------
  335|   113k|        && (group->curve_name == 0
  ------------------
  |  Branch (335:13): [True: 0, False: 113k]
  ------------------
  336|   113k|            || point->curve_name == 0
  ------------------
  |  Branch (336:16): [True: 0, False: 113k]
  ------------------
  337|   113k|            || group->curve_name == point->curve_name);
  ------------------
  |  Branch (337:16): [True: 113k, False: 0]
  ------------------
  338|   113k|}

ossl_ec_scalar_mul_ladder:
  143|    144|{
  144|    144|    int i, cardinality_bits, group_top, kbit, pbit, Z_is_one;
  145|    144|    EC_POINT *p = NULL;
  146|    144|    EC_POINT *s = NULL;
  147|    144|    BIGNUM *k = NULL;
  148|    144|    BIGNUM *lambda = NULL;
  149|    144|    BIGNUM *cardinality = NULL;
  150|    144|    int ret = 0;
  151|       |
  152|       |    /* early exit if the input point is the point at infinity */
  153|    144|    if (point != NULL && EC_POINT_is_at_infinity(group, point))
  ------------------
  |  Branch (153:9): [True: 0, False: 144]
  |  Branch (153:26): [True: 0, False: 0]
  ------------------
  154|      0|        return EC_POINT_set_to_infinity(group, r);
  155|       |
  156|    144|    if (BN_is_zero(group->order)) {
  ------------------
  |  Branch (156:9): [True: 0, False: 144]
  ------------------
  157|      0|        ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_ORDER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  158|      0|        return 0;
  159|      0|    }
  160|    144|    if (BN_is_zero(group->cofactor)) {
  ------------------
  |  Branch (160:9): [True: 0, False: 144]
  ------------------
  161|      0|        ERR_raise(ERR_LIB_EC, EC_R_UNKNOWN_COFACTOR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  162|      0|        return 0;
  163|      0|    }
  164|       |
  165|    144|    BN_CTX_start(ctx);
  166|       |
  167|    144|    if (((p = EC_POINT_new(group)) == NULL)
  ------------------
  |  Branch (167:9): [True: 0, False: 144]
  ------------------
  168|    144|        || ((s = EC_POINT_new(group)) == NULL)) {
  ------------------
  |  Branch (168:12): [True: 0, False: 144]
  ------------------
  169|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  170|      0|        goto err;
  171|      0|    }
  172|       |
  173|    144|    if (point == NULL) {
  ------------------
  |  Branch (173:9): [True: 144, False: 0]
  ------------------
  174|    144|        if (!EC_POINT_copy(p, group->generator)) {
  ------------------
  |  Branch (174:13): [True: 0, False: 144]
  ------------------
  175|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  176|      0|            goto err;
  177|      0|        }
  178|    144|    } else {
  179|      0|        if (!EC_POINT_copy(p, point)) {
  ------------------
  |  Branch (179:13): [True: 0, False: 0]
  ------------------
  180|      0|            ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  181|      0|            goto err;
  182|      0|        }
  183|      0|    }
  184|       |
  185|    144|    EC_POINT_BN_set_flags(p, BN_FLG_CONSTTIME);
  ------------------
  |  |  105|    144|    do {                                \
  |  |  106|    144|        BN_set_flags((P)->X, (flags));  \
  |  |  107|    144|        BN_set_flags((P)->Y, (flags));  \
  |  |  108|    144|        BN_set_flags((P)->Z, (flags));  \
  |  |  109|    144|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 144]
  |  |  ------------------
  ------------------
  186|    144|    EC_POINT_BN_set_flags(r, BN_FLG_CONSTTIME);
  ------------------
  |  |  105|    144|    do {                                \
  |  |  106|    144|        BN_set_flags((P)->X, (flags));  \
  |  |  107|    144|        BN_set_flags((P)->Y, (flags));  \
  |  |  108|    144|        BN_set_flags((P)->Z, (flags));  \
  |  |  109|    144|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 144]
  |  |  ------------------
  ------------------
  187|    144|    EC_POINT_BN_set_flags(s, BN_FLG_CONSTTIME);
  ------------------
  |  |  105|    144|    do {                                \
  |  |  106|    144|        BN_set_flags((P)->X, (flags));  \
  |  |  107|    144|        BN_set_flags((P)->Y, (flags));  \
  |  |  108|    144|        BN_set_flags((P)->Z, (flags));  \
  |  |  109|    144|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 144]
  |  |  ------------------
  ------------------
  188|       |
  189|    144|    cardinality = BN_CTX_get(ctx);
  190|    144|    lambda = BN_CTX_get(ctx);
  191|    144|    k = BN_CTX_get(ctx);
  192|    144|    if (k == NULL) {
  ------------------
  |  Branch (192:9): [True: 0, False: 144]
  ------------------
  193|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  194|      0|        goto err;
  195|      0|    }
  196|       |
  197|    144|    if (!BN_mul(cardinality, group->order, group->cofactor, ctx)) {
  ------------------
  |  Branch (197:9): [True: 0, False: 144]
  ------------------
  198|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  199|      0|        goto err;
  200|      0|    }
  201|       |
  202|       |    /*
  203|       |     * Group cardinalities are often on a word boundary.
  204|       |     * So when we pad the scalar, some timing diff might
  205|       |     * pop if it needs to be expanded due to carries.
  206|       |     * So expand ahead of time.
  207|       |     */
  208|    144|    cardinality_bits = BN_num_bits(cardinality);
  209|    144|    group_top = bn_get_top(cardinality);
  210|    144|    if ((bn_wexpand(k, group_top + 2) == NULL)
  ------------------
  |  Branch (210:9): [True: 0, False: 144]
  ------------------
  211|    144|        || (bn_wexpand(lambda, group_top + 2) == NULL)) {
  ------------------
  |  Branch (211:12): [True: 0, False: 144]
  ------------------
  212|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  213|      0|        goto err;
  214|      0|    }
  215|       |
  216|    144|    if (!BN_copy(k, scalar)) {
  ------------------
  |  Branch (216:9): [True: 0, False: 144]
  ------------------
  217|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  218|      0|        goto err;
  219|      0|    }
  220|       |
  221|    144|    BN_set_flags(k, BN_FLG_CONSTTIME);
  ------------------
  |  |   67|    144|#define BN_FLG_CONSTTIME 0x04
  ------------------
  222|       |
  223|    144|    if ((BN_num_bits(k) > cardinality_bits) || (BN_is_negative(k))) {
  ------------------
  |  Branch (223:9): [True: 0, False: 144]
  |  Branch (223:48): [True: 0, False: 144]
  ------------------
  224|       |        /*-
  225|       |         * this is an unusual input, and we don't guarantee
  226|       |         * constant-timeness
  227|       |         */
  228|      0|        if (!BN_nnmod(k, k, cardinality, ctx)) {
  ------------------
  |  Branch (228:13): [True: 0, False: 0]
  ------------------
  229|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  230|      0|            goto err;
  231|      0|        }
  232|      0|    }
  233|       |
  234|    144|    if (!BN_add(lambda, k, cardinality)) {
  ------------------
  |  Branch (234:9): [True: 0, False: 144]
  ------------------
  235|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  236|      0|        goto err;
  237|      0|    }
  238|    144|    BN_set_flags(lambda, BN_FLG_CONSTTIME);
  ------------------
  |  |   67|    144|#define BN_FLG_CONSTTIME 0x04
  ------------------
  239|    144|    if (!BN_add(k, lambda, cardinality)) {
  ------------------
  |  Branch (239:9): [True: 0, False: 144]
  ------------------
  240|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  241|      0|        goto err;
  242|      0|    }
  243|       |    /*
  244|       |     * lambda := scalar + cardinality
  245|       |     * k := scalar + 2*cardinality
  246|       |     */
  247|    144|    kbit = BN_is_bit_set(lambda, cardinality_bits);
  248|    144|    BN_consttime_swap(kbit, k, lambda, group_top + 2);
  249|       |
  250|    144|    group_top = bn_get_top(group->field);
  251|    144|    if ((bn_wexpand(s->X, group_top) == NULL)
  ------------------
  |  Branch (251:9): [True: 0, False: 144]
  ------------------
  252|    144|        || (bn_wexpand(s->Y, group_top) == NULL)
  ------------------
  |  Branch (252:12): [True: 0, False: 144]
  ------------------
  253|    144|        || (bn_wexpand(s->Z, group_top) == NULL)
  ------------------
  |  Branch (253:12): [True: 0, False: 144]
  ------------------
  254|    144|        || (bn_wexpand(r->X, group_top) == NULL)
  ------------------
  |  Branch (254:12): [True: 0, False: 144]
  ------------------
  255|    144|        || (bn_wexpand(r->Y, group_top) == NULL)
  ------------------
  |  Branch (255:12): [True: 0, False: 144]
  ------------------
  256|    144|        || (bn_wexpand(r->Z, group_top) == NULL)
  ------------------
  |  Branch (256:12): [True: 0, False: 144]
  ------------------
  257|    144|        || (bn_wexpand(p->X, group_top) == NULL)
  ------------------
  |  Branch (257:12): [True: 0, False: 144]
  ------------------
  258|    144|        || (bn_wexpand(p->Y, group_top) == NULL)
  ------------------
  |  Branch (258:12): [True: 0, False: 144]
  ------------------
  259|    144|        || (bn_wexpand(p->Z, group_top) == NULL)) {
  ------------------
  |  Branch (259:12): [True: 0, False: 144]
  ------------------
  260|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  261|      0|        goto err;
  262|      0|    }
  263|       |
  264|       |    /* ensure input point is in affine coords for ladder step efficiency */
  265|    144|    if (!p->Z_is_one && (group->meth->make_affine == NULL || !group->meth->make_affine(group, p, ctx))) {
  ------------------
  |  Branch (265:9): [True: 0, False: 144]
  |  Branch (265:26): [True: 0, False: 0]
  |  Branch (265:62): [True: 0, False: 0]
  ------------------
  266|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  267|      0|        goto err;
  268|      0|    }
  269|       |
  270|       |    /* Initialize the Montgomery ladder */
  271|    144|    if (!ec_point_ladder_pre(group, r, s, p, ctx)) {
  ------------------
  |  Branch (271:9): [True: 0, False: 144]
  ------------------
  272|      0|        ERR_raise(ERR_LIB_EC, EC_R_LADDER_PRE_FAILURE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  273|      0|        goto err;
  274|      0|    }
  275|       |
  276|       |    /* top bit is a 1, in a fixed pos */
  277|    144|    pbit = 1;
  278|       |
  279|    144|#define EC_POINT_CSWAP(c, a, b, w, t)              \
  280|    144|    do {                                           \
  281|    144|        BN_consttime_swap(c, (a)->X, (b)->X, w);   \
  282|    144|        BN_consttime_swap(c, (a)->Y, (b)->Y, w);   \
  283|    144|        BN_consttime_swap(c, (a)->Z, (b)->Z, w);   \
  284|    144|        t = ((a)->Z_is_one ^ (b)->Z_is_one) & (c); \
  285|    144|        (a)->Z_is_one ^= (t);                      \
  286|    144|        (b)->Z_is_one ^= (t);                      \
  287|    144|    } while (0)
  288|       |
  289|       |    /*-
  290|       |     * The ladder step, with branches, is
  291|       |     *
  292|       |     * k[i] == 0: S = add(R, S), R = dbl(R)
  293|       |     * k[i] == 1: R = add(S, R), S = dbl(S)
  294|       |     *
  295|       |     * Swapping R, S conditionally on k[i] leaves you with state
  296|       |     *
  297|       |     * k[i] == 0: T, U = R, S
  298|       |     * k[i] == 1: T, U = S, R
  299|       |     *
  300|       |     * Then perform the ECC ops.
  301|       |     *
  302|       |     * U = add(T, U)
  303|       |     * T = dbl(T)
  304|       |     *
  305|       |     * Which leaves you with state
  306|       |     *
  307|       |     * k[i] == 0: U = add(R, S), T = dbl(R)
  308|       |     * k[i] == 1: U = add(S, R), T = dbl(S)
  309|       |     *
  310|       |     * Swapping T, U conditionally on k[i] leaves you with state
  311|       |     *
  312|       |     * k[i] == 0: R, S = T, U
  313|       |     * k[i] == 1: R, S = U, T
  314|       |     *
  315|       |     * Which leaves you with state
  316|       |     *
  317|       |     * k[i] == 0: S = add(R, S), R = dbl(R)
  318|       |     * k[i] == 1: R = add(S, R), S = dbl(S)
  319|       |     *
  320|       |     * So we get the same logic, but instead of a branch it's a
  321|       |     * conditional swap, followed by ECC ops, then another conditional swap.
  322|       |     *
  323|       |     * Optimization: The end of iteration i and start of i-1 looks like
  324|       |     *
  325|       |     * ...
  326|       |     * CSWAP(k[i], R, S)
  327|       |     * ECC
  328|       |     * CSWAP(k[i], R, S)
  329|       |     * (next iteration)
  330|       |     * CSWAP(k[i-1], R, S)
  331|       |     * ECC
  332|       |     * CSWAP(k[i-1], R, S)
  333|       |     * ...
  334|       |     *
  335|       |     * So instead of two contiguous swaps, you can merge the condition
  336|       |     * bits and do a single swap.
  337|       |     *
  338|       |     * k[i]   k[i-1]    Outcome
  339|       |     * 0      0         No Swap
  340|       |     * 0      1         Swap
  341|       |     * 1      0         Swap
  342|       |     * 1      1         No Swap
  343|       |     *
  344|       |     * This is XOR. pbit tracks the previous bit of k.
  345|       |     */
  346|       |
  347|  65.6k|    for (i = cardinality_bits - 1; i >= 0; i--) {
  ------------------
  |  Branch (347:36): [True: 65.5k, False: 144]
  ------------------
  348|  65.5k|        kbit = BN_is_bit_set(k, i) ^ pbit;
  349|  65.5k|        EC_POINT_CSWAP(kbit, r, s, group_top, Z_is_one);
  ------------------
  |  |  280|  65.5k|    do {                                           \
  |  |  281|  65.5k|        BN_consttime_swap(c, (a)->X, (b)->X, w);   \
  |  |  282|  65.5k|        BN_consttime_swap(c, (a)->Y, (b)->Y, w);   \
  |  |  283|  65.5k|        BN_consttime_swap(c, (a)->Z, (b)->Z, w);   \
  |  |  284|  65.5k|        t = ((a)->Z_is_one ^ (b)->Z_is_one) & (c); \
  |  |  285|  65.5k|        (a)->Z_is_one ^= (t);                      \
  |  |  286|  65.5k|        (b)->Z_is_one ^= (t);                      \
  |  |  287|  65.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (287:14): [Folded, False: 65.5k]
  |  |  ------------------
  ------------------
  350|       |
  351|       |        /* Perform a single step of the Montgomery ladder */
  352|  65.5k|        if (!ec_point_ladder_step(group, r, s, p, ctx)) {
  ------------------
  |  Branch (352:13): [True: 0, False: 65.5k]
  ------------------
  353|      0|            ERR_raise(ERR_LIB_EC, EC_R_LADDER_STEP_FAILURE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  354|      0|            goto err;
  355|      0|        }
  356|       |        /*
  357|       |         * pbit logic merges this cswap with that of the
  358|       |         * next iteration
  359|       |         */
  360|  65.5k|        pbit ^= kbit;
  361|  65.5k|    }
  362|       |    /* one final cswap to move the right value into r */
  363|    144|    EC_POINT_CSWAP(pbit, r, s, group_top, Z_is_one);
  ------------------
  |  |  280|    144|    do {                                           \
  |  |  281|    144|        BN_consttime_swap(c, (a)->X, (b)->X, w);   \
  |  |  282|    144|        BN_consttime_swap(c, (a)->Y, (b)->Y, w);   \
  |  |  283|    144|        BN_consttime_swap(c, (a)->Z, (b)->Z, w);   \
  |  |  284|    144|        t = ((a)->Z_is_one ^ (b)->Z_is_one) & (c); \
  |  |  285|    144|        (a)->Z_is_one ^= (t);                      \
  |  |  286|    144|        (b)->Z_is_one ^= (t);                      \
  |  |  287|    144|    } while (0)
  |  |  ------------------
  |  |  |  Branch (287:14): [Folded, False: 144]
  |  |  ------------------
  ------------------
  364|    144|#undef EC_POINT_CSWAP
  365|       |
  366|       |    /* Finalize ladder (and recover full point coordinates) */
  367|    144|    if (!ec_point_ladder_post(group, r, s, p, ctx)) {
  ------------------
  |  Branch (367:9): [True: 0, False: 144]
  ------------------
  368|      0|        ERR_raise(ERR_LIB_EC, EC_R_LADDER_POST_FAILURE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  369|      0|        goto err;
  370|      0|    }
  371|       |
  372|    144|    ret = 1;
  373|       |
  374|    144|err:
  375|    144|    EC_POINT_free(p);
  376|    144|    EC_POINT_clear_free(s);
  377|    144|    BN_CTX_end(ctx);
  378|       |
  379|    144|    return ret;
  380|    144|}
ossl_ec_wNAF_mul:
  406|    144|{
  407|    144|    const EC_POINT *generator = NULL;
  408|    144|    EC_POINT *tmp = NULL;
  409|    144|    size_t totalnum;
  410|    144|    size_t blocksize = 0, numblocks = 0; /* for wNAF splitting */
  411|    144|    size_t pre_points_per_block = 0;
  412|    144|    size_t i, j;
  413|    144|    int k;
  414|    144|    int r_is_inverted = 0;
  415|    144|    int r_is_at_infinity = 1;
  416|    144|    size_t *wsize = NULL; /* individual window sizes */
  417|    144|    signed char **wNAF = NULL; /* individual wNAFs */
  418|    144|    size_t *wNAF_len = NULL;
  419|    144|    size_t max_len = 0;
  420|    144|    size_t num_val;
  421|    144|    EC_POINT **val = NULL; /* precomputation */
  422|    144|    EC_POINT **v;
  423|    144|    EC_POINT ***val_sub = NULL; /* pointers to sub-arrays of 'val' or
  424|       |                                 * 'pre_comp->points' */
  425|    144|    const EC_PRE_COMP *pre_comp = NULL;
  426|    144|    int num_scalar = 0; /* flag: will be set to 1 if 'scalar' must be
  427|       |                         * treated like other scalars, i.e.
  428|       |                         * precomputation is not available */
  429|    144|    int ret = 0;
  430|       |
  431|    144|    if (!BN_is_zero(group->order) && !BN_is_zero(group->cofactor)) {
  ------------------
  |  Branch (431:9): [True: 144, False: 0]
  |  Branch (431:38): [True: 144, False: 0]
  ------------------
  432|       |        /*-
  433|       |         * Handle the common cases where the scalar is secret, enforcing a
  434|       |         * scalar multiplication implementation based on a Montgomery ladder,
  435|       |         * with various timing attack defenses.
  436|       |         */
  437|    144|        if ((scalar != group->order) && (scalar != NULL) && (num == 0)) {
  ------------------
  |  Branch (437:13): [True: 144, False: 0]
  |  Branch (437:41): [True: 144, False: 0]
  |  Branch (437:61): [True: 144, False: 0]
  ------------------
  438|       |            /*-
  439|       |             * In this case we want to compute scalar * GeneratorPoint: this
  440|       |             * codepath is reached most prominently by (ephemeral) key
  441|       |             * generation of EC cryptosystems (i.e. ECDSA keygen and sign setup,
  442|       |             * ECDH keygen/first half), where the scalar is always secret. This
  443|       |             * is why we ignore if BN_FLG_CONSTTIME is actually set and we
  444|       |             * always call the ladder version.
  445|       |             */
  446|    144|            return ossl_ec_scalar_mul_ladder(group, r, scalar, NULL, ctx);
  447|    144|        }
  448|      0|        if ((scalar == NULL) && (num == 1) && (scalars[0] != group->order)) {
  ------------------
  |  Branch (448:13): [True: 0, False: 0]
  |  Branch (448:33): [True: 0, False: 0]
  |  Branch (448:47): [True: 0, False: 0]
  ------------------
  449|       |            /*-
  450|       |             * In this case we want to compute scalar * VariablePoint: this
  451|       |             * codepath is reached most prominently by the second half of ECDH,
  452|       |             * where the secret scalar is multiplied by the peer's public point.
  453|       |             * To protect the secret scalar, we ignore if BN_FLG_CONSTTIME is
  454|       |             * actually set and we always call the ladder version.
  455|       |             */
  456|      0|            return ossl_ec_scalar_mul_ladder(group, r, scalars[0], points[0],
  457|      0|                ctx);
  458|      0|        }
  459|      0|    }
  460|       |
  461|      0|    if (scalar != NULL) {
  ------------------
  |  Branch (461:9): [True: 0, False: 0]
  ------------------
  462|      0|        generator = EC_GROUP_get0_generator(group);
  463|      0|        if (generator == NULL) {
  ------------------
  |  Branch (463:13): [True: 0, False: 0]
  ------------------
  464|      0|            ERR_raise(ERR_LIB_EC, EC_R_UNDEFINED_GENERATOR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  465|      0|            goto err;
  466|      0|        }
  467|       |
  468|       |        /* look if we can use precomputed multiples of generator */
  469|       |
  470|      0|        pre_comp = group->pre_comp.ec;
  471|      0|        if (pre_comp && pre_comp->numblocks
  ------------------
  |  Branch (471:13): [True: 0, False: 0]
  |  Branch (471:25): [True: 0, False: 0]
  ------------------
  472|      0|            && (EC_POINT_cmp(group, generator, pre_comp->points[0], ctx) == 0)) {
  ------------------
  |  Branch (472:16): [True: 0, False: 0]
  ------------------
  473|      0|            blocksize = pre_comp->blocksize;
  474|       |
  475|       |            /*
  476|       |             * determine maximum number of blocks that wNAF splitting may
  477|       |             * yield (NB: maximum wNAF length is bit length plus one)
  478|       |             */
  479|      0|            numblocks = (BN_num_bits(scalar) / blocksize) + 1;
  480|       |
  481|       |            /*
  482|       |             * we cannot use more blocks than we have precomputation for
  483|       |             */
  484|      0|            if (numblocks > pre_comp->numblocks)
  ------------------
  |  Branch (484:17): [True: 0, False: 0]
  ------------------
  485|      0|                numblocks = pre_comp->numblocks;
  486|       |
  487|      0|            pre_points_per_block = (size_t)1 << (pre_comp->w - 1);
  488|       |
  489|       |            /* check that pre_comp looks sane */
  490|      0|            if (pre_comp->num != (pre_comp->numblocks * pre_points_per_block)) {
  ------------------
  |  Branch (490:17): [True: 0, False: 0]
  ------------------
  491|      0|                ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  492|      0|                goto err;
  493|      0|            }
  494|      0|        } else {
  495|       |            /* can't use precomputation */
  496|      0|            pre_comp = NULL;
  497|      0|            numblocks = 1;
  498|      0|            num_scalar = 1; /* treat 'scalar' like 'num'-th element of
  499|       |                             * 'scalars' */
  500|      0|        }
  501|      0|    }
  502|       |
  503|      0|    totalnum = num + numblocks;
  504|       |
  505|      0|    wsize = OPENSSL_malloc_array(totalnum, sizeof(wsize[0]));
  ------------------
  |  |  110|      0|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  506|      0|    wNAF_len = OPENSSL_malloc_array(totalnum, sizeof(wNAF_len[0]));
  ------------------
  |  |  110|      0|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  507|       |    /* include space for pivot */
  508|      0|    wNAF = OPENSSL_malloc_array(totalnum + 1, sizeof(wNAF[0]));
  ------------------
  |  |  110|      0|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  509|      0|    val_sub = OPENSSL_malloc_array(totalnum, sizeof(val_sub[0]));
  ------------------
  |  |  110|      0|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  510|       |
  511|       |    /* Ensure wNAF is initialised in case we end up going to err */
  512|      0|    if (wNAF != NULL)
  ------------------
  |  Branch (512:9): [True: 0, False: 0]
  ------------------
  513|      0|        wNAF[0] = NULL; /* preliminary pivot */
  514|       |
  515|      0|    if (wsize == NULL || wNAF_len == NULL || wNAF == NULL || val_sub == NULL)
  ------------------
  |  Branch (515:9): [True: 0, False: 0]
  |  Branch (515:26): [True: 0, False: 0]
  |  Branch (515:46): [True: 0, False: 0]
  |  Branch (515:62): [True: 0, False: 0]
  ------------------
  516|      0|        goto err;
  517|       |
  518|       |    /*
  519|       |     * num_val will be the total number of temporarily precomputed points
  520|       |     */
  521|      0|    num_val = 0;
  522|       |
  523|      0|    for (i = 0; i < num + num_scalar; i++) {
  ------------------
  |  Branch (523:17): [True: 0, False: 0]
  ------------------
  524|      0|        size_t bits;
  525|       |
  526|      0|        bits = i < num ? BN_num_bits(scalars[i]) : BN_num_bits(scalar);
  ------------------
  |  Branch (526:16): [True: 0, False: 0]
  ------------------
  527|      0|        wsize[i] = EC_window_bits_for_scalar_size(bits);
  ------------------
  |  |  390|      0|    ((size_t)((b) >= 2000 ? 6 : (b) >= 800 ? 5 \
  |  |  ------------------
  |  |  |  Branch (390:15): [True: 0, False: 0]
  |  |  |  Branch (390:33): [True: 0, False: 0]
  |  |  ------------------
  |  |  391|      0|            : (b) >= 300                   ? 4 \
  |  |  ------------------
  |  |  |  Branch (391:15): [True: 0, False: 0]
  |  |  ------------------
  |  |  392|      0|            : (b) >= 70                    ? 3 \
  |  |  ------------------
  |  |  |  Branch (392:15): [True: 0, False: 0]
  |  |  ------------------
  |  |  393|      0|            : (b) >= 20                    ? 2 \
  |  |  ------------------
  |  |  |  Branch (393:15): [True: 0, False: 0]
  |  |  ------------------
  |  |  394|      0|                                           : 1))
  ------------------
  528|      0|        num_val += (size_t)1 << (wsize[i] - 1);
  529|      0|        wNAF[i + 1] = NULL; /* make sure we always have a pivot */
  530|      0|        wNAF[i] = bn_compute_wNAF((i < num ? scalars[i] : scalar), (int)wsize[i],
  ------------------
  |  Branch (530:36): [True: 0, False: 0]
  ------------------
  531|      0|            &wNAF_len[i]);
  532|      0|        if (wNAF[i] == NULL)
  ------------------
  |  Branch (532:13): [True: 0, False: 0]
  ------------------
  533|      0|            goto err;
  534|      0|        if (wNAF_len[i] > max_len)
  ------------------
  |  Branch (534:13): [True: 0, False: 0]
  ------------------
  535|      0|            max_len = wNAF_len[i];
  536|      0|    }
  537|       |
  538|      0|    if (numblocks) {
  ------------------
  |  Branch (538:9): [True: 0, False: 0]
  ------------------
  539|       |        /* we go here iff scalar != NULL */
  540|       |
  541|      0|        if (pre_comp == NULL) {
  ------------------
  |  Branch (541:13): [True: 0, False: 0]
  ------------------
  542|      0|            if (num_scalar != 1) {
  ------------------
  |  Branch (542:17): [True: 0, False: 0]
  ------------------
  543|      0|                ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  544|      0|                goto err;
  545|      0|            }
  546|       |            /* we have already generated a wNAF for 'scalar' */
  547|      0|        } else {
  548|      0|            signed char *tmp_wNAF = NULL;
  549|      0|            size_t tmp_len = 0;
  550|       |
  551|      0|            if (num_scalar != 0) {
  ------------------
  |  Branch (551:17): [True: 0, False: 0]
  ------------------
  552|      0|                ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  553|      0|                goto err;
  554|      0|            }
  555|       |
  556|       |            /*
  557|       |             * use the window size for which we have precomputation
  558|       |             */
  559|      0|            wsize[num] = pre_comp->w;
  560|      0|            tmp_wNAF = bn_compute_wNAF(scalar, (int)wsize[num], &tmp_len);
  561|      0|            if (!tmp_wNAF)
  ------------------
  |  Branch (561:17): [True: 0, False: 0]
  ------------------
  562|      0|                goto err;
  563|       |
  564|      0|            if (tmp_len <= max_len) {
  ------------------
  |  Branch (564:17): [True: 0, False: 0]
  ------------------
  565|       |                /*
  566|       |                 * One of the other wNAFs is at least as long as the wNAF
  567|       |                 * belonging to the generator, so wNAF splitting will not buy
  568|       |                 * us anything.
  569|       |                 */
  570|       |
  571|      0|                numblocks = 1;
  572|      0|                totalnum = num + 1; /* don't use wNAF splitting */
  573|      0|                wNAF[num] = tmp_wNAF;
  574|      0|                wNAF[num + 1] = NULL;
  575|      0|                wNAF_len[num] = tmp_len;
  576|       |                /*
  577|       |                 * pre_comp->points starts with the points that we need here:
  578|       |                 */
  579|      0|                val_sub[num] = pre_comp->points;
  580|      0|            } else {
  581|       |                /*
  582|       |                 * don't include tmp_wNAF directly into wNAF array - use wNAF
  583|       |                 * splitting and include the blocks
  584|       |                 */
  585|       |
  586|      0|                signed char *pp;
  587|      0|                EC_POINT **tmp_points;
  588|       |
  589|      0|                if (tmp_len < numblocks * blocksize) {
  ------------------
  |  Branch (589:21): [True: 0, False: 0]
  ------------------
  590|       |                    /*
  591|       |                     * possibly we can do with fewer blocks than estimated
  592|       |                     */
  593|      0|                    numblocks = (tmp_len + blocksize - 1) / blocksize;
  594|      0|                    if (numblocks > pre_comp->numblocks) {
  ------------------
  |  Branch (594:25): [True: 0, False: 0]
  ------------------
  595|      0|                        ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  596|      0|                        OPENSSL_free(tmp_wNAF);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  597|      0|                        goto err;
  598|      0|                    }
  599|      0|                    totalnum = num + numblocks;
  600|      0|                }
  601|       |
  602|       |                /* split wNAF in 'numblocks' parts */
  603|      0|                pp = tmp_wNAF;
  604|      0|                tmp_points = pre_comp->points;
  605|       |
  606|      0|                for (i = num; i < totalnum; i++) {
  ------------------
  |  Branch (606:31): [True: 0, False: 0]
  ------------------
  607|      0|                    if (i < totalnum - 1) {
  ------------------
  |  Branch (607:25): [True: 0, False: 0]
  ------------------
  608|      0|                        wNAF_len[i] = blocksize;
  609|      0|                        if (tmp_len < blocksize) {
  ------------------
  |  Branch (609:29): [True: 0, False: 0]
  ------------------
  610|      0|                            ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  611|      0|                            OPENSSL_free(tmp_wNAF);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  612|      0|                            goto err;
  613|      0|                        }
  614|      0|                        tmp_len -= blocksize;
  615|      0|                    } else
  616|       |                        /*
  617|       |                         * last block gets whatever is left (this could be
  618|       |                         * more or less than 'blocksize'!)
  619|       |                         */
  620|      0|                        wNAF_len[i] = tmp_len;
  621|       |
  622|      0|                    wNAF[i + 1] = NULL;
  623|      0|                    wNAF[i] = OPENSSL_malloc(wNAF_len[i]);
  ------------------
  |  |  106|      0|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  624|      0|                    if (wNAF[i] == NULL) {
  ------------------
  |  Branch (624:25): [True: 0, False: 0]
  ------------------
  625|      0|                        OPENSSL_free(tmp_wNAF);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  626|      0|                        goto err;
  627|      0|                    }
  628|      0|                    memcpy(wNAF[i], pp, wNAF_len[i]);
  629|      0|                    if (wNAF_len[i] > max_len)
  ------------------
  |  Branch (629:25): [True: 0, False: 0]
  ------------------
  630|      0|                        max_len = wNAF_len[i];
  631|       |
  632|      0|                    if (*tmp_points == NULL) {
  ------------------
  |  Branch (632:25): [True: 0, False: 0]
  ------------------
  633|      0|                        ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  634|      0|                        OPENSSL_free(tmp_wNAF);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  635|      0|                        goto err;
  636|      0|                    }
  637|      0|                    val_sub[i] = tmp_points;
  638|      0|                    tmp_points += pre_points_per_block;
  639|      0|                    pp += blocksize;
  640|      0|                }
  641|      0|                OPENSSL_free(tmp_wNAF);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  642|      0|            }
  643|      0|        }
  644|      0|    }
  645|       |
  646|       |    /*
  647|       |     * All points we precompute now go into a single array 'val'.
  648|       |     * 'val_sub[i]' is a pointer to the subarray for the i-th point, or to a
  649|       |     * subarray of 'pre_comp->points' if we already have precomputation.
  650|       |     */
  651|      0|    val = OPENSSL_malloc_array(num_val + 1, sizeof(val[0]));
  ------------------
  |  |  110|      0|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  652|      0|    if (val == NULL)
  ------------------
  |  Branch (652:9): [True: 0, False: 0]
  ------------------
  653|      0|        goto err;
  654|      0|    val[num_val] = NULL; /* pivot element */
  655|       |
  656|       |    /* allocate points for precomputation */
  657|      0|    v = val;
  658|      0|    for (i = 0; i < num + num_scalar; i++) {
  ------------------
  |  Branch (658:17): [True: 0, False: 0]
  ------------------
  659|      0|        val_sub[i] = v;
  660|      0|        for (j = 0; j < ((size_t)1 << (wsize[i] - 1)); j++) {
  ------------------
  |  Branch (660:21): [True: 0, False: 0]
  ------------------
  661|      0|            *v = EC_POINT_new(group);
  662|      0|            if (*v == NULL)
  ------------------
  |  Branch (662:17): [True: 0, False: 0]
  ------------------
  663|      0|                goto err;
  664|      0|            v++;
  665|      0|        }
  666|      0|    }
  667|      0|    if (!(v == val + num_val)) {
  ------------------
  |  Branch (667:9): [True: 0, False: 0]
  ------------------
  668|      0|        ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  669|      0|        goto err;
  670|      0|    }
  671|       |
  672|      0|    if ((tmp = EC_POINT_new(group)) == NULL)
  ------------------
  |  Branch (672:9): [True: 0, False: 0]
  ------------------
  673|      0|        goto err;
  674|       |
  675|       |    /*-
  676|       |     * prepare precomputed values:
  677|       |     *    val_sub[i][0] :=     points[i]
  678|       |     *    val_sub[i][1] := 3 * points[i]
  679|       |     *    val_sub[i][2] := 5 * points[i]
  680|       |     *    ...
  681|       |     */
  682|      0|    for (i = 0; i < num + num_scalar; i++) {
  ------------------
  |  Branch (682:17): [True: 0, False: 0]
  ------------------
  683|      0|        if (i < num) {
  ------------------
  |  Branch (683:13): [True: 0, False: 0]
  ------------------
  684|      0|            if (!EC_POINT_copy(val_sub[i][0], points[i]))
  ------------------
  |  Branch (684:17): [True: 0, False: 0]
  ------------------
  685|      0|                goto err;
  686|      0|        } else {
  687|      0|            if (!EC_POINT_copy(val_sub[i][0], generator))
  ------------------
  |  Branch (687:17): [True: 0, False: 0]
  ------------------
  688|      0|                goto err;
  689|      0|        }
  690|       |
  691|      0|        if (wsize[i] > 1) {
  ------------------
  |  Branch (691:13): [True: 0, False: 0]
  ------------------
  692|      0|            if (!EC_POINT_dbl(group, tmp, val_sub[i][0], ctx))
  ------------------
  |  Branch (692:17): [True: 0, False: 0]
  ------------------
  693|      0|                goto err;
  694|      0|            for (j = 1; j < ((size_t)1 << (wsize[i] - 1)); j++) {
  ------------------
  |  Branch (694:25): [True: 0, False: 0]
  ------------------
  695|      0|                if (!EC_POINT_add(group, val_sub[i][j], val_sub[i][j - 1], tmp, ctx))
  ------------------
  |  Branch (695:21): [True: 0, False: 0]
  ------------------
  696|      0|                    goto err;
  697|      0|            }
  698|      0|        }
  699|      0|    }
  700|       |
  701|      0|    if (group->meth->points_make_affine == NULL
  ------------------
  |  Branch (701:9): [True: 0, False: 0]
  ------------------
  702|      0|        || !group->meth->points_make_affine(group, num_val, val, ctx))
  ------------------
  |  Branch (702:12): [True: 0, False: 0]
  ------------------
  703|      0|        goto err;
  704|       |
  705|      0|    r_is_at_infinity = 1;
  706|       |
  707|      0|    if (max_len > INT_MAX)
  ------------------
  |  Branch (707:9): [True: 0, False: 0]
  ------------------
  708|      0|        goto err;
  709|      0|    for (k = (int)(max_len - 1); k >= 0; k--) {
  ------------------
  |  Branch (709:34): [True: 0, False: 0]
  ------------------
  710|      0|        if (!r_is_at_infinity) {
  ------------------
  |  Branch (710:13): [True: 0, False: 0]
  ------------------
  711|      0|            if (!EC_POINT_dbl(group, r, r, ctx))
  ------------------
  |  Branch (711:17): [True: 0, False: 0]
  ------------------
  712|      0|                goto err;
  713|      0|        }
  714|       |
  715|      0|        for (i = 0; i < totalnum; i++) {
  ------------------
  |  Branch (715:21): [True: 0, False: 0]
  ------------------
  716|      0|            if (wNAF_len[i] > (size_t)k) {
  ------------------
  |  Branch (716:17): [True: 0, False: 0]
  ------------------
  717|      0|                int digit = wNAF[i][k];
  718|      0|                int is_neg;
  719|       |
  720|      0|                if (digit) {
  ------------------
  |  Branch (720:21): [True: 0, False: 0]
  ------------------
  721|      0|                    is_neg = digit < 0;
  722|       |
  723|      0|                    if (is_neg)
  ------------------
  |  Branch (723:25): [True: 0, False: 0]
  ------------------
  724|      0|                        digit = -digit;
  725|       |
  726|      0|                    if (is_neg != r_is_inverted) {
  ------------------
  |  Branch (726:25): [True: 0, False: 0]
  ------------------
  727|      0|                        if (!r_is_at_infinity) {
  ------------------
  |  Branch (727:29): [True: 0, False: 0]
  ------------------
  728|      0|                            if (!EC_POINT_invert(group, r, ctx))
  ------------------
  |  Branch (728:33): [True: 0, False: 0]
  ------------------
  729|      0|                                goto err;
  730|      0|                        }
  731|      0|                        r_is_inverted = !r_is_inverted;
  732|      0|                    }
  733|       |
  734|       |                    /* digit > 0 */
  735|       |
  736|      0|                    if (r_is_at_infinity) {
  ------------------
  |  Branch (736:25): [True: 0, False: 0]
  ------------------
  737|      0|                        if (!EC_POINT_copy(r, val_sub[i][digit >> 1]))
  ------------------
  |  Branch (737:29): [True: 0, False: 0]
  ------------------
  738|      0|                            goto err;
  739|       |
  740|       |                        /*-
  741|       |                         * Apply coordinate blinding for EC_POINT.
  742|       |                         *
  743|       |                         * The underlying EC_METHOD can optionally implement this function:
  744|       |                         * ossl_ec_point_blind_coordinates() returns 0 in case of errors or 1 on
  745|       |                         * success or if coordinate blinding is not implemented for this
  746|       |                         * group.
  747|       |                         */
  748|      0|                        if (!ossl_ec_point_blind_coordinates(group, r, ctx)) {
  ------------------
  |  Branch (748:29): [True: 0, False: 0]
  ------------------
  749|      0|                            ERR_raise(ERR_LIB_EC, EC_R_POINT_COORDINATES_BLIND_FAILURE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  750|      0|                            goto err;
  751|      0|                        }
  752|       |
  753|      0|                        r_is_at_infinity = 0;
  754|      0|                    } else {
  755|      0|                        if (!EC_POINT_add(group, r, r, val_sub[i][digit >> 1], ctx))
  ------------------
  |  Branch (755:29): [True: 0, False: 0]
  ------------------
  756|      0|                            goto err;
  757|      0|                    }
  758|      0|                }
  759|      0|            }
  760|      0|        }
  761|      0|    }
  762|       |
  763|      0|    if (r_is_at_infinity) {
  ------------------
  |  Branch (763:9): [True: 0, False: 0]
  ------------------
  764|      0|        if (!EC_POINT_set_to_infinity(group, r))
  ------------------
  |  Branch (764:13): [True: 0, False: 0]
  ------------------
  765|      0|            goto err;
  766|      0|    } else {
  767|      0|        if (r_is_inverted)
  ------------------
  |  Branch (767:13): [True: 0, False: 0]
  ------------------
  768|      0|            if (!EC_POINT_invert(group, r, ctx))
  ------------------
  |  Branch (768:17): [True: 0, False: 0]
  ------------------
  769|      0|                goto err;
  770|      0|    }
  771|       |
  772|      0|    ret = 1;
  773|       |
  774|      0|err:
  775|      0|    EC_POINT_free(tmp);
  776|      0|    OPENSSL_free(wsize);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  777|      0|    OPENSSL_free(wNAF_len);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  778|      0|    if (wNAF != NULL) {
  ------------------
  |  Branch (778:9): [True: 0, False: 0]
  ------------------
  779|      0|        signed char **w;
  780|       |
  781|      0|        for (w = wNAF; *w != NULL; w++)
  ------------------
  |  Branch (781:24): [True: 0, False: 0]
  ------------------
  782|      0|            OPENSSL_free(*w);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  783|       |
  784|      0|        OPENSSL_free(wNAF);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  785|      0|    }
  786|      0|    if (val != NULL) {
  ------------------
  |  Branch (786:9): [True: 0, False: 0]
  ------------------
  787|      0|        for (v = val; *v != NULL; v++)
  ------------------
  |  Branch (787:23): [True: 0, False: 0]
  ------------------
  788|      0|            EC_POINT_clear_free(*v);
  789|       |
  790|      0|        OPENSSL_free(val);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  791|      0|    }
  792|      0|    OPENSSL_free(val_sub);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  793|      0|    return ret;
  794|      0|}

EC_POINT_point2oct:
   76|    452|{
   77|    452|    if (point == NULL) {
  ------------------
  |  Branch (77:9): [True: 0, False: 452]
  ------------------
   78|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   79|      0|        return 0;
   80|      0|    }
   81|    452|    if (group->meth->point2oct == 0
  ------------------
  |  Branch (81:9): [True: 452, False: 0]
  ------------------
   82|    452|        && !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) {
  ------------------
  |  |   26|    452|#define EC_FLAGS_DEFAULT_OCT 0x1
  ------------------
  |  Branch (82:12): [True: 0, False: 452]
  ------------------
   83|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   84|      0|        return 0;
   85|      0|    }
   86|    452|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (86:9): [True: 0, False: 452]
  ------------------
   87|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   88|      0|        return 0;
   89|      0|    }
   90|    452|    if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) {
  ------------------
  |  |   26|    452|#define EC_FLAGS_DEFAULT_OCT 0x1
  ------------------
  |  Branch (90:9): [True: 452, False: 0]
  ------------------
   91|    452|        if (group->meth->field_type == NID_X9_62_prime_field)
  ------------------
  |  |  152|    452|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (91:13): [True: 452, False: 0]
  ------------------
   92|    452|            return ossl_ec_GFp_simple_point2oct(group, point, form, buf, len,
   93|    452|                ctx);
   94|      0|        else
   95|       |#ifdef OPENSSL_NO_EC2M
   96|       |        {
   97|       |            ERR_raise(ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED);
   98|       |            return 0;
   99|       |        }
  100|       |#else
  101|      0|            return ossl_ec_GF2m_simple_point2oct(group, point,
  102|      0|                form, buf, len, ctx);
  103|    452|#endif
  104|    452|    }
  105|       |
  106|      0|    return group->meth->point2oct(group, point, form, buf, len, ctx);
  107|    452|}
EC_POINT_oct2point:
  111|   112k|{
  112|   112k|    if (group->meth->oct2point == 0
  ------------------
  |  Branch (112:9): [True: 112k, False: 0]
  ------------------
  113|   112k|        && !(group->meth->flags & EC_FLAGS_DEFAULT_OCT)) {
  ------------------
  |  |   26|   112k|#define EC_FLAGS_DEFAULT_OCT 0x1
  ------------------
  |  Branch (113:12): [True: 0, False: 112k]
  ------------------
  114|      0|        ERR_raise(ERR_LIB_EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  115|      0|        return 0;
  116|      0|    }
  117|   112k|    if (!ec_point_is_compat(point, group)) {
  ------------------
  |  Branch (117:9): [True: 0, False: 112k]
  ------------------
  118|      0|        ERR_raise(ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  119|      0|        return 0;
  120|      0|    }
  121|   112k|    if (group->meth->flags & EC_FLAGS_DEFAULT_OCT) {
  ------------------
  |  |   26|   112k|#define EC_FLAGS_DEFAULT_OCT 0x1
  ------------------
  |  Branch (121:9): [True: 112k, False: 0]
  ------------------
  122|   112k|        if (group->meth->field_type == NID_X9_62_prime_field)
  ------------------
  |  |  152|   112k|#define NID_X9_62_prime_field           406
  ------------------
  |  Branch (122:13): [True: 112k, False: 0]
  ------------------
  123|   112k|            return ossl_ec_GFp_simple_oct2point(group, point, buf, len, ctx);
  124|      0|        else
  125|       |#ifdef OPENSSL_NO_EC2M
  126|       |        {
  127|       |            ERR_raise(ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED);
  128|       |            return 0;
  129|       |        }
  130|       |#else
  131|      0|            return ossl_ec_GF2m_simple_oct2point(group, point, buf, len, ctx);
  132|   112k|#endif
  133|   112k|    }
  134|      0|    return group->meth->oct2point(group, point, buf, len, ctx);
  135|   112k|}

EC_GFp_mont_method:
   22|    144|{
   23|    144|    static const EC_METHOD ret = {
   24|    144|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|    144|#define EC_FLAGS_DEFAULT_OCT 0x1
  ------------------
   25|    144|        NID_X9_62_prime_field,
  ------------------
  |  |  152|    144|#define NID_X9_62_prime_field           406
  ------------------
   26|    144|        ossl_ec_GFp_mont_group_init,
   27|    144|        ossl_ec_GFp_mont_group_finish,
   28|    144|        ossl_ec_GFp_mont_group_clear_finish,
   29|    144|        ossl_ec_GFp_mont_group_copy,
   30|    144|        ossl_ec_GFp_mont_group_set_curve,
   31|    144|        ossl_ec_GFp_simple_group_get_curve,
   32|    144|        ossl_ec_GFp_simple_group_get_degree,
   33|    144|        ossl_ec_group_simple_order_bits,
   34|    144|        ossl_ec_GFp_simple_group_check_discriminant,
   35|    144|        ossl_ec_GFp_simple_point_init,
   36|    144|        ossl_ec_GFp_simple_point_finish,
   37|    144|        ossl_ec_GFp_simple_point_clear_finish,
   38|    144|        ossl_ec_GFp_simple_point_copy,
   39|    144|        ossl_ec_GFp_simple_point_set_to_infinity,
   40|    144|        ossl_ec_GFp_simple_point_set_affine_coordinates,
   41|    144|        ossl_ec_GFp_simple_point_get_affine_coordinates,
   42|    144|        0, 0, 0,
   43|    144|        ossl_ec_GFp_simple_add,
   44|    144|        ossl_ec_GFp_simple_dbl,
   45|    144|        ossl_ec_GFp_simple_invert,
   46|    144|        ossl_ec_GFp_simple_is_at_infinity,
   47|    144|        ossl_ec_GFp_simple_is_on_curve,
   48|    144|        ossl_ec_GFp_simple_cmp,
   49|    144|        ossl_ec_GFp_simple_make_affine,
   50|    144|        ossl_ec_GFp_simple_points_make_affine,
   51|    144|        0 /* mul */,
   52|    144|        0 /* precompute_mult */,
   53|    144|        0 /* have_precompute_mult */,
   54|    144|        ossl_ec_GFp_mont_field_mul,
   55|    144|        ossl_ec_GFp_mont_field_sqr,
   56|    144|        0 /* field_div */,
   57|    144|        ossl_ec_GFp_mont_field_inv,
   58|    144|        ossl_ec_GFp_mont_field_encode,
   59|    144|        ossl_ec_GFp_mont_field_decode,
   60|    144|        ossl_ec_GFp_mont_field_set_to_one,
   61|    144|        ossl_ec_key_simple_priv2oct,
   62|    144|        ossl_ec_key_simple_oct2priv,
   63|    144|        0, /* set private */
   64|    144|        ossl_ec_key_simple_generate_key,
   65|    144|        ossl_ec_key_simple_check_key,
   66|    144|        ossl_ec_key_simple_generate_public_key,
   67|    144|        0, /* keycopy */
   68|    144|        0, /* keyfinish */
   69|    144|        ossl_ecdh_simple_compute_key,
   70|    144|        ossl_ecdsa_simple_sign_setup,
   71|    144|        ossl_ecdsa_simple_sign_sig,
   72|    144|        ossl_ecdsa_simple_verify_sig,
   73|    144|        0, /* field_inverse_mod_ord */
   74|    144|        ossl_ec_GFp_simple_blind_coordinates,
   75|    144|        ossl_ec_GFp_simple_ladder_pre,
   76|    144|        ossl_ec_GFp_simple_ladder_step,
   77|    144|        ossl_ec_GFp_simple_ladder_post
   78|    144|    };
   79|       |
   80|    144|    return &ret;
   81|    144|}
ossl_ec_GFp_mont_group_init:
   84|  22.9k|{
   85|  22.9k|    int ok;
   86|       |
   87|  22.9k|    ok = ossl_ec_GFp_simple_group_init(group);
   88|  22.9k|    group->field_data1 = NULL;
   89|       |    group->field_data2 = NULL;
   90|  22.9k|    return ok;
   91|  22.9k|}
ossl_ec_GFp_mont_group_finish:
   94|  22.9k|{
   95|  22.9k|    BN_MONT_CTX_free(group->field_data1);
   96|  22.9k|    group->field_data1 = NULL;
   97|  22.9k|    BN_free(group->field_data2);
   98|       |    group->field_data2 = NULL;
   99|  22.9k|    ossl_ec_GFp_simple_group_finish(group);
  100|  22.9k|}
ossl_ec_GFp_mont_group_copy:
  112|  11.4k|{
  113|  11.4k|    BN_MONT_CTX_free(dest->field_data1);
  114|  11.4k|    dest->field_data1 = NULL;
  115|  11.4k|    BN_clear_free(dest->field_data2);
  116|  11.4k|    dest->field_data2 = NULL;
  117|       |
  118|  11.4k|    if (!ossl_ec_GFp_simple_group_copy(dest, src))
  ------------------
  |  Branch (118:9): [True: 0, False: 11.4k]
  ------------------
  119|      0|        return 0;
  120|       |
  121|  11.4k|    if (src->field_data1 != NULL) {
  ------------------
  |  Branch (121:9): [True: 11.4k, False: 0]
  ------------------
  122|  11.4k|        dest->field_data1 = BN_MONT_CTX_new();
  123|  11.4k|        if (dest->field_data1 == NULL)
  ------------------
  |  Branch (123:13): [True: 0, False: 11.4k]
  ------------------
  124|      0|            return 0;
  125|  11.4k|        if (!BN_MONT_CTX_copy(dest->field_data1, src->field_data1))
  ------------------
  |  Branch (125:13): [True: 0, False: 11.4k]
  ------------------
  126|      0|            goto err;
  127|  11.4k|    }
  128|  11.4k|    if (src->field_data2 != NULL) {
  ------------------
  |  Branch (128:9): [True: 11.4k, False: 0]
  ------------------
  129|  11.4k|        dest->field_data2 = BN_dup(src->field_data2);
  130|  11.4k|        if (dest->field_data2 == NULL)
  ------------------
  |  Branch (130:13): [True: 0, False: 11.4k]
  ------------------
  131|      0|            goto err;
  132|  11.4k|    }
  133|       |
  134|  11.4k|    return 1;
  135|       |
  136|      0|err:
  137|      0|    BN_MONT_CTX_free(dest->field_data1);
  138|       |    dest->field_data1 = NULL;
  139|      0|    return 0;
  140|  11.4k|}
ossl_ec_GFp_mont_group_set_curve:
  145|    144|{
  146|    144|    BN_CTX *new_ctx = NULL;
  147|    144|    BN_MONT_CTX *mont = NULL;
  148|    144|    BIGNUM *one = NULL;
  149|    144|    int ret = 0;
  150|       |
  151|    144|    BN_MONT_CTX_free(group->field_data1);
  152|    144|    group->field_data1 = NULL;
  153|    144|    BN_free(group->field_data2);
  154|    144|    group->field_data2 = NULL;
  155|       |
  156|    144|    if (ctx == NULL) {
  ------------------
  |  Branch (156:9): [True: 0, False: 144]
  ------------------
  157|      0|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  158|      0|        if (ctx == NULL)
  ------------------
  |  Branch (158:13): [True: 0, False: 0]
  ------------------
  159|      0|            return 0;
  160|      0|    }
  161|       |
  162|    144|    mont = BN_MONT_CTX_new();
  163|    144|    if (mont == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 144]
  ------------------
  164|      0|        goto err;
  165|    144|    if (!BN_MONT_CTX_set(mont, p, ctx)) {
  ------------------
  |  Branch (165:9): [True: 0, False: 144]
  ------------------
  166|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  167|      0|        goto err;
  168|      0|    }
  169|    144|    one = BN_new();
  170|    144|    if (one == NULL)
  ------------------
  |  Branch (170:9): [True: 0, False: 144]
  ------------------
  171|      0|        goto err;
  172|    144|    if (!BN_to_montgomery(one, BN_value_one(), mont, ctx))
  ------------------
  |  Branch (172:9): [True: 0, False: 144]
  ------------------
  173|      0|        goto err;
  174|       |
  175|    144|    group->field_data1 = mont;
  176|    144|    mont = NULL;
  177|    144|    group->field_data2 = one;
  178|    144|    one = NULL;
  179|       |
  180|    144|    ret = ossl_ec_GFp_simple_group_set_curve(group, p, a, b, ctx);
  181|       |
  182|    144|    if (!ret) {
  ------------------
  |  Branch (182:9): [True: 0, False: 144]
  ------------------
  183|      0|        BN_MONT_CTX_free(group->field_data1);
  184|      0|        group->field_data1 = NULL;
  185|      0|        BN_free(group->field_data2);
  186|      0|        group->field_data2 = NULL;
  187|      0|    }
  188|       |
  189|    144|err:
  190|    144|    BN_free(one);
  191|    144|    BN_CTX_free(new_ctx);
  192|    144|    BN_MONT_CTX_free(mont);
  193|    144|    return ret;
  194|    144|}
ossl_ec_GFp_mont_field_mul:
  198|   877k|{
  199|   877k|    if (group->field_data1 == NULL) {
  ------------------
  |  Branch (199:9): [True: 0, False: 877k]
  ------------------
  200|      0|        ERR_raise(ERR_LIB_EC, EC_R_NOT_INITIALIZED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  201|      0|        return 0;
  202|      0|    }
  203|       |
  204|   877k|    return BN_mod_mul_montgomery(r, a, b, group->field_data1, ctx);
  205|   877k|}
ossl_ec_GFp_mont_field_sqr:
  209|   504k|{
  210|   504k|    if (group->field_data1 == NULL) {
  ------------------
  |  Branch (210:9): [True: 0, False: 504k]
  ------------------
  211|      0|        ERR_raise(ERR_LIB_EC, EC_R_NOT_INITIALIZED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  212|      0|        return 0;
  213|      0|    }
  214|       |
  215|   504k|    return BN_mod_mul_montgomery(r, a, a, group->field_data1, ctx);
  216|   504k|}
ossl_ec_GFp_mont_field_inv:
  225|    144|{
  226|    144|    BIGNUM *e = NULL;
  227|    144|    BN_CTX *new_ctx = NULL;
  228|    144|    int ret = 0;
  229|       |
  230|    144|    if (group->field_data1 == NULL)
  ------------------
  |  Branch (230:9): [True: 0, False: 144]
  ------------------
  231|      0|        return 0;
  232|       |
  233|    144|    if (ctx == NULL
  ------------------
  |  Branch (233:9): [True: 0, False: 144]
  ------------------
  234|      0|        && (ctx = new_ctx = BN_CTX_secure_new_ex(group->libctx)) == NULL)
  ------------------
  |  Branch (234:12): [True: 0, False: 0]
  ------------------
  235|      0|        return 0;
  236|       |
  237|    144|    BN_CTX_start(ctx);
  238|    144|    if ((e = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (238:9): [True: 0, False: 144]
  ------------------
  239|      0|        goto err;
  240|       |
  241|       |    /* Inverse in constant time with Fermats Little Theorem */
  242|    144|    if (!BN_set_word(e, 2))
  ------------------
  |  Branch (242:9): [True: 0, False: 144]
  ------------------
  243|      0|        goto err;
  244|    144|    if (!BN_sub(e, group->field, e))
  ------------------
  |  Branch (244:9): [True: 0, False: 144]
  ------------------
  245|      0|        goto err;
  246|       |    /*-
  247|       |     * Exponent e is public.
  248|       |     * No need for scatter-gather or BN_FLG_CONSTTIME.
  249|       |     */
  250|    144|    if (!BN_mod_exp_mont(r, a, e, group->field, ctx, group->field_data1))
  ------------------
  |  Branch (250:9): [True: 0, False: 144]
  ------------------
  251|      0|        goto err;
  252|       |
  253|       |    /* throw an error on zero */
  254|    144|    if (BN_is_zero(r)) {
  ------------------
  |  Branch (254:9): [True: 0, False: 144]
  ------------------
  255|      0|        ERR_raise(ERR_LIB_EC, EC_R_CANNOT_INVERT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  256|      0|        goto err;
  257|      0|    }
  258|       |
  259|    144|    ret = 1;
  260|       |
  261|    144|err:
  262|    144|    BN_CTX_end(ctx);
  263|    144|    BN_CTX_free(new_ctx);
  264|    144|    return ret;
  265|    144|}
ossl_ec_GFp_mont_field_encode:
  269|  68.9k|{
  270|  68.9k|    if (group->field_data1 == NULL) {
  ------------------
  |  Branch (270:9): [True: 0, False: 68.9k]
  ------------------
  271|      0|        ERR_raise(ERR_LIB_EC, EC_R_NOT_INITIALIZED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|        return 0;
  273|      0|    }
  274|       |
  275|  68.9k|    return BN_to_montgomery(r, a, (BN_MONT_CTX *)group->field_data1, ctx);
  276|  68.9k|}
ossl_ec_GFp_mont_field_decode:
  280|    576|{
  281|    576|    if (group->field_data1 == NULL) {
  ------------------
  |  Branch (281:9): [True: 0, False: 576]
  ------------------
  282|      0|        ERR_raise(ERR_LIB_EC, EC_R_NOT_INITIALIZED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  283|      0|        return 0;
  284|      0|    }
  285|       |
  286|    576|    return BN_from_montgomery(r, a, group->field_data1, ctx);
  287|    576|}
ossl_ec_GFp_mont_field_set_to_one:
  291|  22.9k|{
  292|  22.9k|    if (group->field_data2 == NULL) {
  ------------------
  |  Branch (292:9): [True: 0, False: 22.9k]
  ------------------
  293|      0|        ERR_raise(ERR_LIB_EC, EC_R_NOT_INITIALIZED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  294|      0|        return 0;
  295|      0|    }
  296|       |
  297|  22.9k|    if (!BN_copy(r, group->field_data2))
  ------------------
  |  Branch (297:9): [True: 0, False: 22.9k]
  ------------------
  298|      0|        return 0;
  299|  22.9k|    return 1;
  300|  22.9k|}

ossl_ec_GFp_nist_group_copy:
   86|   101k|{
   87|   101k|    dest->field_mod_func = src->field_mod_func;
   88|       |
   89|   101k|    return ossl_ec_GFp_simple_group_copy(dest, src);
   90|   101k|}
ossl_ec_GFp_nist_field_mul:
  130|   203k|{
  131|   203k|    int ret = 0;
  132|   203k|    BN_CTX *ctx_new = NULL;
  133|       |
  134|   203k|    if (!group || !r || !a || !b) {
  ------------------
  |  Branch (134:9): [True: 0, False: 203k]
  |  Branch (134:19): [True: 0, False: 203k]
  |  Branch (134:25): [True: 0, False: 203k]
  |  Branch (134:31): [True: 0, False: 203k]
  ------------------
  135|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  136|      0|        goto err;
  137|      0|    }
  138|   203k|    if (!ctx)
  ------------------
  |  Branch (138:9): [True: 0, False: 203k]
  ------------------
  139|      0|        if ((ctx_new = ctx = BN_CTX_new_ex(group->libctx)) == NULL)
  ------------------
  |  Branch (139:13): [True: 0, False: 0]
  ------------------
  140|      0|            goto err;
  141|       |
  142|   203k|    if (!BN_mul(r, a, b, ctx))
  ------------------
  |  Branch (142:9): [True: 0, False: 203k]
  ------------------
  143|      0|        goto err;
  144|   203k|    if (!group->field_mod_func(r, r, group->field, ctx))
  ------------------
  |  Branch (144:9): [True: 0, False: 203k]
  ------------------
  145|      0|        goto err;
  146|       |
  147|   203k|    ret = 1;
  148|   203k|err:
  149|   203k|    BN_CTX_free(ctx_new);
  150|   203k|    return ret;
  151|   203k|}
ossl_ec_GFp_nist_field_sqr:
  155|   406k|{
  156|   406k|    int ret = 0;
  157|   406k|    BN_CTX *ctx_new = NULL;
  158|       |
  159|   406k|    if (!group || !r || !a) {
  ------------------
  |  Branch (159:9): [True: 0, False: 406k]
  |  Branch (159:19): [True: 0, False: 406k]
  |  Branch (159:25): [True: 0, False: 406k]
  ------------------
  160|      0|        ERR_raise(ERR_LIB_EC, EC_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  161|      0|        goto err;
  162|      0|    }
  163|   406k|    if (!ctx)
  ------------------
  |  Branch (163:9): [True: 0, False: 406k]
  ------------------
  164|      0|        if ((ctx_new = ctx = BN_CTX_new_ex(group->libctx)) == NULL)
  ------------------
  |  Branch (164:13): [True: 0, False: 0]
  ------------------
  165|      0|            goto err;
  166|       |
  167|   406k|    if (!BN_sqr(r, a, ctx))
  ------------------
  |  Branch (167:9): [True: 0, False: 406k]
  ------------------
  168|      0|        goto err;
  169|   406k|    if (!group->field_mod_func(r, r, group->field, ctx))
  ------------------
  |  Branch (169:9): [True: 0, False: 406k]
  ------------------
  170|      0|        goto err;
  171|       |
  172|   406k|    ret = 1;
  173|   406k|err:
  174|   406k|    BN_CTX_free(ctx_new);
  175|   406k|    return ret;
  176|   406k|}

ossl_ec_GFp_nistp384_method:
 1496|   101k|{
 1497|   101k|    static const EC_METHOD ret = {
 1498|   101k|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|   101k|#define EC_FLAGS_DEFAULT_OCT 0x1
  ------------------
 1499|   101k|        NID_X9_62_prime_field,
  ------------------
  |  |  152|   101k|#define NID_X9_62_prime_field           406
  ------------------
 1500|   101k|        ossl_ec_GFp_nistp384_group_init,
 1501|   101k|        ossl_ec_GFp_simple_group_finish,
 1502|   101k|        ossl_ec_GFp_simple_group_clear_finish,
 1503|   101k|        ossl_ec_GFp_nist_group_copy,
 1504|   101k|        ossl_ec_GFp_nistp384_group_set_curve,
 1505|   101k|        ossl_ec_GFp_simple_group_get_curve,
 1506|   101k|        ossl_ec_GFp_simple_group_get_degree,
 1507|   101k|        ossl_ec_group_simple_order_bits,
 1508|   101k|        ossl_ec_GFp_simple_group_check_discriminant,
 1509|   101k|        ossl_ec_GFp_simple_point_init,
 1510|   101k|        ossl_ec_GFp_simple_point_finish,
 1511|   101k|        ossl_ec_GFp_simple_point_clear_finish,
 1512|   101k|        ossl_ec_GFp_simple_point_copy,
 1513|   101k|        ossl_ec_GFp_simple_point_set_to_infinity,
 1514|   101k|        ossl_ec_GFp_simple_point_set_affine_coordinates,
 1515|   101k|        ossl_ec_GFp_nistp384_point_get_affine_coordinates,
 1516|   101k|        0, /* point_set_compressed_coordinates */
 1517|   101k|        0, /* point2oct */
 1518|   101k|        0, /* oct2point */
 1519|   101k|        ossl_ec_GFp_simple_add,
 1520|   101k|        ossl_ec_GFp_simple_dbl,
 1521|   101k|        ossl_ec_GFp_simple_invert,
 1522|   101k|        ossl_ec_GFp_simple_is_at_infinity,
 1523|   101k|        ossl_ec_GFp_simple_is_on_curve,
 1524|   101k|        ossl_ec_GFp_simple_cmp,
 1525|   101k|        ossl_ec_GFp_simple_make_affine,
 1526|   101k|        ossl_ec_GFp_simple_points_make_affine,
 1527|   101k|        ossl_ec_GFp_nistp384_points_mul,
 1528|   101k|        ossl_ec_GFp_nistp384_precompute_mult,
 1529|   101k|        ossl_ec_GFp_nistp384_have_precompute_mult,
 1530|   101k|        ossl_ec_GFp_nist_field_mul,
 1531|   101k|        ossl_ec_GFp_nist_field_sqr,
 1532|   101k|        0, /* field_div */
 1533|   101k|        ossl_ec_GFp_simple_field_inv,
 1534|   101k|        0, /* field_encode */
 1535|   101k|        0, /* field_decode */
 1536|   101k|        0, /* field_set_to_one */
 1537|   101k|        ossl_ec_key_simple_priv2oct,
 1538|   101k|        ossl_ec_key_simple_oct2priv,
 1539|   101k|        0, /* set private */
 1540|   101k|        ossl_ec_key_simple_generate_key,
 1541|   101k|        ossl_ec_key_simple_check_key,
 1542|   101k|        ossl_ec_key_simple_generate_public_key,
 1543|   101k|        0, /* keycopy */
 1544|   101k|        0, /* keyfinish */
 1545|   101k|        ossl_ecdh_simple_compute_key,
 1546|   101k|        ossl_ecdsa_simple_sign_setup,
 1547|   101k|        ossl_ecdsa_simple_sign_sig,
 1548|   101k|        ossl_ecdsa_simple_verify_sig,
 1549|   101k|        0, /* field_inverse_mod_ord */
 1550|   101k|        0, /* blind_coordinates */
 1551|   101k|        0, /* ladder_pre */
 1552|   101k|        0, /* ladder_step */
 1553|   101k|        0 /* ladder_post */
 1554|   101k|    };
 1555|       |
 1556|   101k|    return &ret;
 1557|   101k|}
ossl_ec_GFp_nistp384_group_init:
 1610|   203k|{
 1611|   203k|    int ret;
 1612|       |
 1613|   203k|    ret = ossl_ec_GFp_simple_group_init(group);
 1614|   203k|    group->a_is_minus3 = 1;
 1615|   203k|    return ret;
 1616|   203k|}
ossl_ec_GFp_nistp384_group_set_curve:
 1621|   101k|{
 1622|   101k|    int ret = 0;
 1623|   101k|    BIGNUM *curve_p, *curve_a, *curve_b;
 1624|   101k|#ifndef FIPS_MODULE
 1625|   101k|    BN_CTX *new_ctx = NULL;
 1626|       |
 1627|   101k|    if (ctx == NULL)
  ------------------
  |  Branch (1627:9): [True: 0, False: 101k]
  ------------------
 1628|      0|        ctx = new_ctx = BN_CTX_new();
 1629|   101k|#endif
 1630|   101k|    if (ctx == NULL)
  ------------------
  |  Branch (1630:9): [True: 0, False: 101k]
  ------------------
 1631|      0|        return 0;
 1632|       |
 1633|   101k|    BN_CTX_start(ctx);
 1634|   101k|    curve_p = BN_CTX_get(ctx);
 1635|   101k|    curve_a = BN_CTX_get(ctx);
 1636|   101k|    curve_b = BN_CTX_get(ctx);
 1637|   101k|    if (curve_b == NULL)
  ------------------
  |  Branch (1637:9): [True: 0, False: 101k]
  ------------------
 1638|      0|        goto err;
 1639|   101k|    BN_bin2bn(nistp384_curve_params[0], sizeof(felem_bytearray), curve_p);
 1640|   101k|    BN_bin2bn(nistp384_curve_params[1], sizeof(felem_bytearray), curve_a);
 1641|   101k|    BN_bin2bn(nistp384_curve_params[2], sizeof(felem_bytearray), curve_b);
 1642|   101k|    if ((BN_cmp(curve_p, p)) || (BN_cmp(curve_a, a)) || (BN_cmp(curve_b, b))) {
  ------------------
  |  Branch (1642:9): [True: 0, False: 101k]
  |  Branch (1642:33): [True: 0, False: 101k]
  |  Branch (1642:57): [True: 0, False: 101k]
  ------------------
 1643|      0|        ERR_raise(ERR_LIB_EC, EC_R_WRONG_CURVE_PARAMETERS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1644|      0|        goto err;
 1645|      0|    }
 1646|   101k|    group->field_mod_func = BN_nist_mod_384;
 1647|   101k|    ret = ossl_ec_GFp_simple_group_set_curve(group, p, a, b, ctx);
 1648|   101k|err:
 1649|   101k|    BN_CTX_end(ctx);
 1650|   101k|#ifndef FIPS_MODULE
 1651|   101k|    BN_CTX_free(new_ctx);
 1652|   101k|#endif
 1653|   101k|    return ret;
 1654|   101k|}
ossl_ec_GFp_nistp384_point_get_affine_coordinates:
 1664|     16|{
 1665|     16|    felem z1, z2, x_in, y_in, x_out, y_out;
 1666|     16|    widefelem tmp;
 1667|       |
 1668|     16|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (1668:9): [True: 0, False: 16]
  ------------------
 1669|      0|        ERR_raise(ERR_LIB_EC, EC_R_POINT_AT_INFINITY);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1670|      0|        return 0;
 1671|      0|    }
 1672|     16|    if ((!BN_to_felem(x_in, point->X)) || (!BN_to_felem(y_in, point->Y)) || (!BN_to_felem(z1, point->Z)))
  ------------------
  |  Branch (1672:9): [True: 0, False: 16]
  |  Branch (1672:43): [True: 0, False: 16]
  |  Branch (1672:77): [True: 0, False: 16]
  ------------------
 1673|      0|        return 0;
 1674|     16|    felem_inv(z2, z1);
 1675|     16|    felem_square(tmp, z2);
  ------------------
  |  |  767|     16|#define felem_square felem_square_ref
  ------------------
 1676|     16|    felem_reduce(z1, tmp);
  ------------------
  |  |  769|     16|#define felem_reduce felem_reduce_ref
  ------------------
 1677|     16|    felem_mul(tmp, x_in, z1);
  ------------------
  |  |  768|     16|#define felem_mul felem_mul_ref
  ------------------
 1678|     16|    felem_reduce(x_in, tmp);
  ------------------
  |  |  769|     16|#define felem_reduce felem_reduce_ref
  ------------------
 1679|     16|    felem_contract(x_out, x_in);
 1680|     16|    if (x != NULL) {
  ------------------
  |  Branch (1680:9): [True: 16, False: 0]
  ------------------
 1681|     16|        if (!felem_to_BN(x, x_out)) {
  ------------------
  |  Branch (1681:13): [True: 0, False: 16]
  ------------------
 1682|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1683|      0|            return 0;
 1684|      0|        }
 1685|     16|    }
 1686|     16|    felem_mul(tmp, z1, z2);
  ------------------
  |  |  768|     16|#define felem_mul felem_mul_ref
  ------------------
 1687|     16|    felem_reduce(z1, tmp);
  ------------------
  |  |  769|     16|#define felem_reduce felem_reduce_ref
  ------------------
 1688|     16|    felem_mul(tmp, y_in, z1);
  ------------------
  |  |  768|     16|#define felem_mul felem_mul_ref
  ------------------
 1689|     16|    felem_reduce(y_in, tmp);
  ------------------
  |  |  769|     16|#define felem_reduce felem_reduce_ref
  ------------------
 1690|     16|    felem_contract(y_out, y_in);
 1691|     16|    if (y != NULL) {
  ------------------
  |  Branch (1691:9): [True: 16, False: 0]
  ------------------
 1692|     16|        if (!felem_to_BN(y, y_out)) {
  ------------------
  |  Branch (1692:13): [True: 0, False: 16]
  ------------------
 1693|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1694|      0|            return 0;
 1695|      0|        }
 1696|     16|    }
 1697|     16|    return 1;
 1698|     16|}
ossl_ec_GFp_nistp384_points_mul:
 1734|     16|{
 1735|     16|    int ret = 0;
 1736|     16|    int j;
 1737|     16|    int mixed = 0;
 1738|     16|    BIGNUM *x, *y, *z, *tmp_scalar;
 1739|     16|    felem_bytearray g_secret;
 1740|     16|    felem_bytearray *secrets = NULL;
 1741|     16|    felem(*pre_comp)[17][3] = NULL;
 1742|     16|    felem *tmp_felems = NULL;
 1743|     16|    unsigned int i;
 1744|     16|    int num_bytes;
 1745|     16|    int have_pre_comp = 0;
 1746|     16|    size_t num_points = num;
 1747|     16|    felem x_in, y_in, z_in, x_out, y_out, z_out;
 1748|     16|    NISTP384_PRE_COMP *pre = NULL;
 1749|     16|    felem(*g_pre_comp)[3] = NULL;
 1750|     16|    EC_POINT *generator = NULL;
 1751|     16|    const EC_POINT *p = NULL;
 1752|     16|    const BIGNUM *p_scalar = NULL;
 1753|       |
 1754|     16|    BN_CTX_start(ctx);
 1755|     16|    x = BN_CTX_get(ctx);
 1756|     16|    y = BN_CTX_get(ctx);
 1757|     16|    z = BN_CTX_get(ctx);
 1758|     16|    tmp_scalar = BN_CTX_get(ctx);
 1759|     16|    if (tmp_scalar == NULL)
  ------------------
  |  Branch (1759:9): [True: 0, False: 16]
  ------------------
 1760|      0|        goto err;
 1761|       |
 1762|     16|    if (scalar != NULL) {
  ------------------
  |  Branch (1762:9): [True: 16, False: 0]
  ------------------
 1763|     16|        pre = group->pre_comp.nistp384;
 1764|     16|        if (pre)
  ------------------
  |  Branch (1764:13): [True: 0, False: 16]
  ------------------
 1765|       |            /* we have precomputation, try to use it */
 1766|      0|            g_pre_comp = &pre->g_pre_comp[0];
 1767|     16|        else
 1768|       |            /* try to use the standard precomputation */
 1769|     16|            g_pre_comp = (felem(*)[3])gmul;
 1770|     16|        generator = EC_POINT_new(group);
 1771|     16|        if (generator == NULL)
  ------------------
  |  Branch (1771:13): [True: 0, False: 16]
  ------------------
 1772|      0|            goto err;
 1773|       |        /* get the generator from precomputation */
 1774|     16|        if (!felem_to_BN(x, g_pre_comp[1][0]) || !felem_to_BN(y, g_pre_comp[1][1]) || !felem_to_BN(z, g_pre_comp[1][2])) {
  ------------------
  |  Branch (1774:13): [True: 0, False: 16]
  |  Branch (1774:50): [True: 0, False: 16]
  |  Branch (1774:87): [True: 0, False: 16]
  ------------------
 1775|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1776|      0|            goto err;
 1777|      0|        }
 1778|     16|        if (!ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(group,
  ------------------
  |  Branch (1778:13): [True: 0, False: 16]
  ------------------
 1779|     16|                generator,
 1780|     16|                x, y, z, ctx))
 1781|      0|            goto err;
 1782|     16|        if (0 == EC_POINT_cmp(group, generator, group->generator, ctx))
  ------------------
  |  Branch (1782:13): [True: 16, False: 0]
  ------------------
 1783|       |            /* precomputation matches generator */
 1784|     16|            have_pre_comp = 1;
 1785|      0|        else
 1786|       |            /*
 1787|       |             * we don't have valid precomputation: treat the generator as a
 1788|       |             * random point
 1789|       |             */
 1790|      0|            num_points++;
 1791|     16|    }
 1792|       |
 1793|     16|    if (num_points > 0) {
  ------------------
  |  Branch (1793:9): [True: 0, False: 16]
  ------------------
 1794|      0|        if (num_points >= 2) {
  ------------------
  |  Branch (1794:13): [True: 0, False: 0]
  ------------------
 1795|       |            /*
 1796|       |             * unless we precompute multiples for just one point, converting
 1797|       |             * those into affine form is time well spent
 1798|       |             */
 1799|      0|            mixed = 1;
 1800|      0|        }
 1801|      0|        secrets = OPENSSL_calloc(num_points, sizeof(*secrets));
  ------------------
  |  |  112|      0|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1802|      0|        pre_comp = OPENSSL_calloc(num_points, sizeof(*pre_comp));
  ------------------
  |  |  112|      0|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1803|      0|        if (mixed)
  ------------------
  |  Branch (1803:13): [True: 0, False: 0]
  ------------------
 1804|      0|            tmp_felems = OPENSSL_malloc_array(num_points * 17 + 1, sizeof(*tmp_felems));
  ------------------
  |  |  110|      0|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1805|      0|        if ((secrets == NULL) || (pre_comp == NULL)
  ------------------
  |  Branch (1805:13): [True: 0, False: 0]
  |  Branch (1805:34): [True: 0, False: 0]
  ------------------
 1806|      0|            || (mixed && (tmp_felems == NULL)))
  ------------------
  |  Branch (1806:17): [True: 0, False: 0]
  |  Branch (1806:26): [True: 0, False: 0]
  ------------------
 1807|      0|            goto err;
 1808|       |
 1809|       |        /*
 1810|       |         * we treat NULL scalars as 0, and NULL points as points at infinity,
 1811|       |         * i.e., they contribute nothing to the linear combination
 1812|       |         */
 1813|      0|        for (i = 0; i < num_points; ++i) {
  ------------------
  |  Branch (1813:21): [True: 0, False: 0]
  ------------------
 1814|      0|            if (i == num) {
  ------------------
  |  Branch (1814:17): [True: 0, False: 0]
  ------------------
 1815|       |                /*
 1816|       |                 * we didn't have a valid precomputation, so we pick the
 1817|       |                 * generator
 1818|       |                 */
 1819|      0|                p = EC_GROUP_get0_generator(group);
 1820|      0|                p_scalar = scalar;
 1821|      0|            } else {
 1822|       |                /* the i^th point */
 1823|      0|                p = points[i];
 1824|      0|                p_scalar = scalars[i];
 1825|      0|            }
 1826|      0|            if (p_scalar != NULL && p != NULL) {
  ------------------
  |  Branch (1826:17): [True: 0, False: 0]
  |  Branch (1826:37): [True: 0, False: 0]
  ------------------
 1827|       |                /* reduce scalar to 0 <= scalar < 2^384 */
 1828|      0|                if ((BN_num_bits(p_scalar) > 384)
  ------------------
  |  Branch (1828:21): [True: 0, False: 0]
  ------------------
 1829|      0|                    || (BN_is_negative(p_scalar))) {
  ------------------
  |  Branch (1829:24): [True: 0, False: 0]
  ------------------
 1830|       |                    /*
 1831|       |                     * this is an unusual input, and we don't guarantee
 1832|       |                     * constant-timeness
 1833|       |                     */
 1834|      0|                    if (!BN_nnmod(tmp_scalar, p_scalar, group->order, ctx)) {
  ------------------
  |  Branch (1834:25): [True: 0, False: 0]
  ------------------
 1835|      0|                        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1836|      0|                        goto err;
 1837|      0|                    }
 1838|      0|                    num_bytes = BN_bn2lebinpad(tmp_scalar,
 1839|      0|                        secrets[i], sizeof(secrets[i]));
 1840|      0|                } else {
 1841|      0|                    num_bytes = BN_bn2lebinpad(p_scalar,
 1842|      0|                        secrets[i], sizeof(secrets[i]));
 1843|      0|                }
 1844|      0|                if (num_bytes < 0) {
  ------------------
  |  Branch (1844:21): [True: 0, False: 0]
  ------------------
 1845|      0|                    ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1846|      0|                    goto err;
 1847|      0|                }
 1848|       |                /* precompute multiples */
 1849|      0|                if ((!BN_to_felem(x_out, p->X)) || (!BN_to_felem(y_out, p->Y)) || (!BN_to_felem(z_out, p->Z)))
  ------------------
  |  Branch (1849:21): [True: 0, False: 0]
  |  Branch (1849:52): [True: 0, False: 0]
  |  Branch (1849:83): [True: 0, False: 0]
  ------------------
 1850|      0|                    goto err;
 1851|      0|                memcpy(pre_comp[i][1][0], x_out, sizeof(felem));
 1852|      0|                memcpy(pre_comp[i][1][1], y_out, sizeof(felem));
 1853|      0|                memcpy(pre_comp[i][1][2], z_out, sizeof(felem));
 1854|      0|                for (j = 2; j <= 16; ++j) {
  ------------------
  |  Branch (1854:29): [True: 0, False: 0]
  ------------------
 1855|      0|                    if (j & 1) {
  ------------------
  |  Branch (1855:25): [True: 0, False: 0]
  ------------------
 1856|      0|                        point_add(pre_comp[i][j][0], pre_comp[i][j][1], pre_comp[i][j][2],
 1857|      0|                            pre_comp[i][1][0], pre_comp[i][1][1], pre_comp[i][1][2], 0,
 1858|      0|                            pre_comp[i][j - 1][0], pre_comp[i][j - 1][1], pre_comp[i][j - 1][2]);
 1859|      0|                    } else {
 1860|      0|                        point_double(pre_comp[i][j][0], pre_comp[i][j][1], pre_comp[i][j][2],
 1861|      0|                            pre_comp[i][j / 2][0], pre_comp[i][j / 2][1], pre_comp[i][j / 2][2]);
 1862|      0|                    }
 1863|      0|                }
 1864|      0|            }
 1865|      0|        }
 1866|      0|        if (mixed)
  ------------------
  |  Branch (1866:13): [True: 0, False: 0]
  ------------------
 1867|      0|            make_points_affine(num_points * 17, pre_comp[0], tmp_felems);
 1868|      0|    }
 1869|       |
 1870|       |    /* the scalar for the generator */
 1871|     16|    if (scalar != NULL && have_pre_comp) {
  ------------------
  |  Branch (1871:9): [True: 16, False: 0]
  |  Branch (1871:27): [True: 16, False: 0]
  ------------------
 1872|     16|        memset(g_secret, 0, sizeof(g_secret));
 1873|       |        /* reduce scalar to 0 <= scalar < 2^384 */
 1874|     16|        if ((BN_num_bits(scalar) > 384) || (BN_is_negative(scalar))) {
  ------------------
  |  Branch (1874:13): [True: 0, False: 16]
  |  Branch (1874:44): [True: 0, False: 16]
  ------------------
 1875|       |            /*
 1876|       |             * this is an unusual input, and we don't guarantee
 1877|       |             * constant-timeness
 1878|       |             */
 1879|      0|            if (!BN_nnmod(tmp_scalar, scalar, group->order, ctx)) {
  ------------------
  |  Branch (1879:17): [True: 0, False: 0]
  ------------------
 1880|      0|                ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1881|      0|                goto err;
 1882|      0|            }
 1883|      0|            num_bytes = BN_bn2lebinpad(tmp_scalar, g_secret, sizeof(g_secret));
 1884|     16|        } else {
 1885|     16|            num_bytes = BN_bn2lebinpad(scalar, g_secret, sizeof(g_secret));
 1886|     16|        }
 1887|       |        /* do the multiplication with generator precomputation */
 1888|     16|        batch_mul(x_out, y_out, z_out,
 1889|     16|            (const felem_bytearray(*))secrets, num_points,
 1890|     16|            g_secret,
 1891|     16|            mixed, (const felem(*)[17][3])pre_comp,
 1892|     16|            (const felem(*)[3])g_pre_comp);
 1893|     16|    } else {
 1894|       |        /* do the multiplication without generator precomputation */
 1895|      0|        batch_mul(x_out, y_out, z_out,
 1896|      0|            (const felem_bytearray(*))secrets, num_points,
 1897|      0|            NULL, mixed, (const felem(*)[17][3])pre_comp, NULL);
 1898|      0|    }
 1899|       |    /* reduce the output to its unique minimal representation */
 1900|     16|    felem_contract(x_in, x_out);
 1901|     16|    felem_contract(y_in, y_out);
 1902|     16|    felem_contract(z_in, z_out);
 1903|     16|    if ((!felem_to_BN(x, x_in)) || (!felem_to_BN(y, y_in)) || (!felem_to_BN(z, z_in))) {
  ------------------
  |  Branch (1903:9): [True: 0, False: 16]
  |  Branch (1903:36): [True: 0, False: 16]
  |  Branch (1903:63): [True: 0, False: 16]
  ------------------
 1904|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1905|      0|        goto err;
 1906|      0|    }
 1907|     16|    ret = ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(group, r, x, y, z,
 1908|     16|        ctx);
 1909|       |
 1910|     16|err:
 1911|     16|    BN_CTX_end(ctx);
 1912|     16|    EC_POINT_free(generator);
 1913|     16|    OPENSSL_free(secrets);
  ------------------
  |  |  131|     16|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1914|     16|    OPENSSL_free(pre_comp);
  ------------------
  |  |  131|     16|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1915|     16|    OPENSSL_free(tmp_felems);
  ------------------
  |  |  131|     16|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1916|     16|    return ret;
 1917|     16|}
ecp_nistp384.c:BN_to_felem:
  142|     48|{
  143|     48|    felem_bytearray b_out;
  144|     48|    int num_bytes;
  145|       |
  146|     48|    if (BN_is_negative(bn)) {
  ------------------
  |  Branch (146:9): [True: 0, False: 48]
  ------------------
  147|      0|        ERR_raise(ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  148|      0|        return 0;
  149|      0|    }
  150|     48|    num_bytes = BN_bn2lebinpad(bn, b_out, sizeof(b_out));
  151|     48|    if (num_bytes < 0) {
  ------------------
  |  Branch (151:9): [True: 0, False: 48]
  ------------------
  152|      0|        ERR_raise(ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  153|      0|        return 0;
  154|      0|    }
  155|     48|    bin48_to_felem(out, b_out);
  156|     48|    return 1;
  157|     48|}
ecp_nistp384.c:bin48_to_felem:
  117|     48|{
  118|     48|    memset(out, 0, 56);
  119|     48|    out[0] = (*((limb *)&in[0])) & bottom56bits;
  120|     48|    out[1] = (*((limb_aX *)&in[7])) & bottom56bits;
  121|     48|    out[2] = (*((limb_aX *)&in[14])) & bottom56bits;
  122|     48|    out[3] = (*((limb_aX *)&in[21])) & bottom56bits;
  123|     48|    out[4] = (*((limb_aX *)&in[28])) & bottom56bits;
  124|     48|    out[5] = (*((limb_aX *)&in[35])) & bottom56bits;
  125|     48|    memmove(&out[6], &in[42], 6);
  126|     48|}
ecp_nistp384.c:felem_inv:
  784|     16|{
  785|     16|    felem ftmp, ftmp2, ftmp3, ftmp4, ftmp5, ftmp6;
  786|     16|    unsigned int i = 0;
  787|       |
  788|     16|    felem_square_reduce(ftmp, in); /* 2^1 */
  ------------------
  |  |  771|     16|#define felem_square_reduce felem_square_reduce_ref
  ------------------
  789|     16|    felem_mul_reduce(ftmp, ftmp, in); /* 2^1 + 2^0 */
  ------------------
  |  |  772|     16|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  790|     16|    felem_assign(ftmp2, ftmp);
  791|       |
  792|     16|    felem_square_reduce(ftmp, ftmp); /* 2^2 + 2^1 */
  ------------------
  |  |  771|     16|#define felem_square_reduce felem_square_reduce_ref
  ------------------
  793|     16|    felem_mul_reduce(ftmp, ftmp, in); /* 2^2 + 2^1 * 2^0 */
  ------------------
  |  |  772|     16|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  794|     16|    felem_assign(ftmp3, ftmp);
  795|       |
  796|     64|    for (i = 0; i < 3; i++)
  ------------------
  |  Branch (796:17): [True: 48, False: 16]
  ------------------
  797|     48|        felem_square_reduce(ftmp, ftmp); /* 2^5 + 2^4 + 2^3 */
  ------------------
  |  |  771|     48|#define felem_square_reduce felem_square_reduce_ref
  ------------------
  798|     16|    felem_mul_reduce(ftmp, ftmp3, ftmp); /* 2^5 + 2^4 + 2^3 + 2^2 + 2^1 + 2^0 */
  ------------------
  |  |  772|     16|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  799|     16|    felem_assign(ftmp4, ftmp);
  800|       |
  801|    112|    for (i = 0; i < 6; i++)
  ------------------
  |  Branch (801:17): [True: 96, False: 16]
  ------------------
  802|     96|        felem_square_reduce(ftmp, ftmp); /* 2^11 + ... + 2^6 */
  ------------------
  |  |  771|     96|#define felem_square_reduce felem_square_reduce_ref
  ------------------
  803|     16|    felem_mul_reduce(ftmp, ftmp4, ftmp); /* 2^11 + ... + 2^0 */
  ------------------
  |  |  772|     16|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  804|       |
  805|     64|    for (i = 0; i < 3; i++)
  ------------------
  |  Branch (805:17): [True: 48, False: 16]
  ------------------
  806|     48|        felem_square_reduce(ftmp, ftmp); /* 2^14 + ... + 2^3 */
  ------------------
  |  |  771|     48|#define felem_square_reduce felem_square_reduce_ref
  ------------------
  807|     16|    felem_mul_reduce(ftmp, ftmp3, ftmp); /* 2^14 + ... + 2^0 */
  ------------------
  |  |  772|     16|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  808|     16|    felem_assign(ftmp5, ftmp);
  809|       |
  810|    256|    for (i = 0; i < 15; i++)
  ------------------
  |  Branch (810:17): [True: 240, False: 16]
  ------------------
  811|    240|        felem_square_reduce(ftmp, ftmp); /* 2^29 + ... + 2^15 */
  ------------------
  |  |  771|    240|#define felem_square_reduce felem_square_reduce_ref
  ------------------
  812|     16|    felem_mul_reduce(ftmp, ftmp5, ftmp); /* 2^29 + ... + 2^0 */
  ------------------
  |  |  772|     16|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  813|     16|    felem_assign(ftmp6, ftmp);
  814|       |
  815|    496|    for (i = 0; i < 30; i++)
  ------------------
  |  Branch (815:17): [True: 480, False: 16]
  ------------------
  816|    480|        felem_square_reduce(ftmp, ftmp); /* 2^59 + ... + 2^30 */
  ------------------
  |  |  771|    480|#define felem_square_reduce felem_square_reduce_ref
  ------------------
  817|     16|    felem_mul_reduce(ftmp, ftmp6, ftmp); /* 2^59 + ... + 2^0 */
  ------------------
  |  |  772|     16|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  818|     16|    felem_assign(ftmp4, ftmp);
  819|       |
  820|    976|    for (i = 0; i < 60; i++)
  ------------------
  |  Branch (820:17): [True: 960, False: 16]
  ------------------
  821|    960|        felem_square_reduce(ftmp, ftmp); /* 2^119 + ... + 2^60 */
  ------------------
  |  |  771|    960|#define felem_square_reduce felem_square_reduce_ref
  ------------------
  822|     16|    felem_mul_reduce(ftmp, ftmp4, ftmp); /* 2^119 + ... + 2^0 */
  ------------------
  |  |  772|     16|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  823|     16|    felem_assign(ftmp4, ftmp);
  824|       |
  825|  1.93k|    for (i = 0; i < 120; i++)
  ------------------
  |  Branch (825:17): [True: 1.92k, False: 16]
  ------------------
  826|  1.92k|        felem_square_reduce(ftmp, ftmp); /* 2^239 + ... + 2^120 */
  ------------------
  |  |  771|  1.92k|#define felem_square_reduce felem_square_reduce_ref
  ------------------
  827|     16|    felem_mul_reduce(ftmp, ftmp4, ftmp); /* 2^239 + ... + 2^0 */
  ------------------
  |  |  772|     16|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  828|       |
  829|    256|    for (i = 0; i < 15; i++)
  ------------------
  |  Branch (829:17): [True: 240, False: 16]
  ------------------
  830|    240|        felem_square_reduce(ftmp, ftmp); /* 2^254 + ... + 2^15 */
  ------------------
  |  |  771|    240|#define felem_square_reduce felem_square_reduce_ref
  ------------------
  831|     16|    felem_mul_reduce(ftmp, ftmp5, ftmp); /* 2^254 + ... + 2^0 */
  ------------------
  |  |  772|     16|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  832|       |
  833|    512|    for (i = 0; i < 31; i++)
  ------------------
  |  Branch (833:17): [True: 496, False: 16]
  ------------------
  834|    496|        felem_square_reduce(ftmp, ftmp); /* 2^285 + ... + 2^31 */
  ------------------
  |  |  771|    496|#define felem_square_reduce felem_square_reduce_ref
  ------------------
  835|     16|    felem_mul_reduce(ftmp, ftmp6, ftmp); /* 2^285 + ... + 2^31 + 2^29 + ... + 2^0 */
  ------------------
  |  |  772|     16|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  836|       |
  837|     48|    for (i = 0; i < 2; i++)
  ------------------
  |  Branch (837:17): [True: 32, False: 16]
  ------------------
  838|     32|        felem_square_reduce(ftmp, ftmp); /* 2^287 + ... + 2^33 + 2^31 + ... + 2^2 */
  ------------------
  |  |  771|     32|#define felem_square_reduce felem_square_reduce_ref
  ------------------
  839|     16|    felem_mul_reduce(ftmp, ftmp2, ftmp); /* 2^287 + ... + 2^33 + 2^31 + ... + 2^0 */
  ------------------
  |  |  772|     16|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  840|       |
  841|  1.52k|    for (i = 0; i < 94; i++)
  ------------------
  |  Branch (841:17): [True: 1.50k, False: 16]
  ------------------
  842|  1.50k|        felem_square_reduce(ftmp, ftmp); /* 2^381 + ... + 2^127 + 2^125 + ... + 2^94 */
  ------------------
  |  |  771|  1.50k|#define felem_square_reduce felem_square_reduce_ref
  ------------------
  843|     16|    felem_mul_reduce(ftmp, ftmp6, ftmp); /* 2^381 + ... + 2^127 + 2^125 + ... + 2^94 + 2^29 + ... + 2^0 */
  ------------------
  |  |  772|     16|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  844|       |
  845|     48|    for (i = 0; i < 2; i++)
  ------------------
  |  Branch (845:17): [True: 32, False: 16]
  ------------------
  846|     32|        felem_square_reduce(ftmp, ftmp); /* 2^383 + ... + 2^129 + 2^127 + ... + 2^96 + 2^31 + ... + 2^2 */
  ------------------
  |  |  771|     32|#define felem_square_reduce felem_square_reduce_ref
  ------------------
  847|     16|    felem_mul_reduce(ftmp, in, ftmp); /* 2^383 + ... + 2^129 + 2^127 + ... + 2^96 + 2^31 + ... + 2^2 + 2^0 */
  ------------------
  |  |  772|     16|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
  848|       |
  849|     16|    memcpy(out, ftmp, sizeof(felem));
  850|     16|}
ecp_nistp384.c:felem_square_reduce_ref:
  688|  12.4k|{
  689|  12.4k|    widefelem tmp;
  690|       |
  691|  12.4k|    felem_square_ref(tmp, in);
  692|  12.4k|    felem_reduce_ref(out, tmp);
  693|  12.4k|}
ecp_nistp384.c:felem_mul_reduce_ref:
  696|  9.63k|{
  697|  9.63k|    widefelem tmp;
  698|       |
  699|  9.63k|    felem_mul_ref(tmp, in1, in2);
  700|  9.63k|    felem_reduce_ref(out, tmp);
  701|  9.63k|}
ecp_nistp384.c:felem_assign:
  180|  17.4k|{
  181|  17.4k|    memcpy(out, in, sizeof(felem));
  182|  17.4k|}
ecp_nistp384.c:felem_square_ref:
  385|  18.6k|{
  386|  18.6k|    felem inx2;
  387|  18.6k|    felem_scalar(inx2, in, 2);
  388|       |
  389|  18.6k|    out[0] = ((uint128_t)in[0]) * in[0];
  390|       |
  391|  18.6k|    out[1] = ((uint128_t)in[0]) * inx2[1];
  392|       |
  393|  18.6k|    out[2] = ((uint128_t)in[0]) * inx2[2]
  394|  18.6k|        + ((uint128_t)in[1]) * in[1];
  395|       |
  396|  18.6k|    out[3] = ((uint128_t)in[0]) * inx2[3]
  397|  18.6k|        + ((uint128_t)in[1]) * inx2[2];
  398|       |
  399|  18.6k|    out[4] = ((uint128_t)in[0]) * inx2[4]
  400|  18.6k|        + ((uint128_t)in[1]) * inx2[3]
  401|  18.6k|        + ((uint128_t)in[2]) * in[2];
  402|       |
  403|  18.6k|    out[5] = ((uint128_t)in[0]) * inx2[5]
  404|  18.6k|        + ((uint128_t)in[1]) * inx2[4]
  405|  18.6k|        + ((uint128_t)in[2]) * inx2[3];
  406|       |
  407|  18.6k|    out[6] = ((uint128_t)in[0]) * inx2[6]
  408|  18.6k|        + ((uint128_t)in[1]) * inx2[5]
  409|  18.6k|        + ((uint128_t)in[2]) * inx2[4]
  410|  18.6k|        + ((uint128_t)in[3]) * in[3];
  411|       |
  412|  18.6k|    out[7] = ((uint128_t)in[1]) * inx2[6]
  413|  18.6k|        + ((uint128_t)in[2]) * inx2[5]
  414|  18.6k|        + ((uint128_t)in[3]) * inx2[4];
  415|       |
  416|  18.6k|    out[8] = ((uint128_t)in[2]) * inx2[6]
  417|  18.6k|        + ((uint128_t)in[3]) * inx2[5]
  418|  18.6k|        + ((uint128_t)in[4]) * in[4];
  419|       |
  420|  18.6k|    out[9] = ((uint128_t)in[3]) * inx2[6]
  421|  18.6k|        + ((uint128_t)in[4]) * inx2[5];
  422|       |
  423|  18.6k|    out[10] = ((uint128_t)in[4]) * inx2[6]
  424|  18.6k|        + ((uint128_t)in[5]) * in[5];
  425|       |
  426|  18.6k|    out[11] = ((uint128_t)in[5]) * inx2[6];
  427|       |
  428|  18.6k|    out[12] = ((uint128_t)in[6]) * in[6];
  429|  18.6k|}
ecp_nistp384.c:felem_scalar:
  195|  20.2k|{
  196|  20.2k|    unsigned int i;
  197|       |
  198|   162k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |  105|   162k|#define NLIMBS 7
  ------------------
  |  Branch (198:17): [True: 141k, False: 20.2k]
  ------------------
  199|   141k|        out[i] = in[i] * scalar;
  200|  20.2k|}
ecp_nistp384.c:felem_reduce_ref:
  518|  33.0k|{
  519|       |    /*
  520|       |     * In order to prevent underflow, we add a multiple of p before subtracting.
  521|       |     * Use telescopic sums to represent 2^76 * p redundantly with each limb
  522|       |     * of the form 2^124 + ...
  523|       |     */
  524|  33.0k|    static const widelimb two124m68 = (((widelimb)1) << 124)
  525|  33.0k|        - (((widelimb)1) << 68);
  526|  33.0k|    static const widelimb two124m116m68 = (((widelimb)1) << 124)
  527|  33.0k|        - (((widelimb)1) << 116)
  528|  33.0k|        - (((widelimb)1) << 68);
  529|  33.0k|    static const widelimb two124p108m76 = (((widelimb)1) << 124)
  530|  33.0k|        + (((widelimb)1) << 108)
  531|  33.0k|        - (((widelimb)1) << 76);
  532|  33.0k|    static const widelimb two124m92m68 = (((widelimb)1) << 124)
  533|  33.0k|        - (((widelimb)1) << 92)
  534|  33.0k|        - (((widelimb)1) << 68);
  535|  33.0k|    widelimb temp, acc[9];
  536|  33.0k|    unsigned int i;
  537|       |
  538|  33.0k|    memcpy(acc, in, sizeof(widelimb) * 9);
  539|       |
  540|  33.0k|    acc[0] += two124p108m76;
  541|  33.0k|    acc[1] += two124m116m68;
  542|  33.0k|    acc[2] += two124m92m68;
  543|  33.0k|    acc[3] += two124m68;
  544|  33.0k|    acc[4] += two124m68;
  545|  33.0k|    acc[5] += two124m68;
  546|  33.0k|    acc[6] += two124m68;
  547|       |
  548|       |    /* [1]: Eliminate in[9], ..., in[12] */
  549|  33.0k|    acc[8] += in[12] >> 32;
  550|  33.0k|    acc[7] += (in[12] & 0xffffffff) << 24;
  551|  33.0k|    acc[7] += in[12] >> 8;
  552|  33.0k|    acc[6] += (in[12] & 0xff) << 48;
  553|  33.0k|    acc[6] -= in[12] >> 16;
  554|  33.0k|    acc[5] -= (in[12] & 0xffff) << 40;
  555|  33.0k|    acc[6] += in[12] >> 48;
  556|  33.0k|    acc[5] += (in[12] & 0xffffffffffff) << 8;
  557|       |
  558|  33.0k|    acc[7] += in[11] >> 32;
  559|  33.0k|    acc[6] += (in[11] & 0xffffffff) << 24;
  560|  33.0k|    acc[6] += in[11] >> 8;
  561|  33.0k|    acc[5] += (in[11] & 0xff) << 48;
  562|  33.0k|    acc[5] -= in[11] >> 16;
  563|  33.0k|    acc[4] -= (in[11] & 0xffff) << 40;
  564|  33.0k|    acc[5] += in[11] >> 48;
  565|  33.0k|    acc[4] += (in[11] & 0xffffffffffff) << 8;
  566|       |
  567|  33.0k|    acc[6] += in[10] >> 32;
  568|  33.0k|    acc[5] += (in[10] & 0xffffffff) << 24;
  569|  33.0k|    acc[5] += in[10] >> 8;
  570|  33.0k|    acc[4] += (in[10] & 0xff) << 48;
  571|  33.0k|    acc[4] -= in[10] >> 16;
  572|  33.0k|    acc[3] -= (in[10] & 0xffff) << 40;
  573|  33.0k|    acc[4] += in[10] >> 48;
  574|  33.0k|    acc[3] += (in[10] & 0xffffffffffff) << 8;
  575|       |
  576|  33.0k|    acc[5] += in[9] >> 32;
  577|  33.0k|    acc[4] += (in[9] & 0xffffffff) << 24;
  578|  33.0k|    acc[4] += in[9] >> 8;
  579|  33.0k|    acc[3] += (in[9] & 0xff) << 48;
  580|  33.0k|    acc[3] -= in[9] >> 16;
  581|  33.0k|    acc[2] -= (in[9] & 0xffff) << 40;
  582|  33.0k|    acc[3] += in[9] >> 48;
  583|  33.0k|    acc[2] += (in[9] & 0xffffffffffff) << 8;
  584|       |
  585|       |    /*
  586|       |     * [2]: Eliminate acc[7], acc[8], that is the 7 and eighth limbs, as
  587|       |     * well as the contributions made from eliminating higher limbs.
  588|       |     * acc[7] < in[7] + 2^120 + 2^56 < in[7] + 2^121
  589|       |     * acc[8] < in[8] + 2^96
  590|       |     */
  591|  33.0k|    acc[4] += acc[8] >> 32;
  592|  33.0k|    acc[3] += (acc[8] & 0xffffffff) << 24;
  593|  33.0k|    acc[3] += acc[8] >> 8;
  594|  33.0k|    acc[2] += (acc[8] & 0xff) << 48;
  595|  33.0k|    acc[2] -= acc[8] >> 16;
  596|  33.0k|    acc[1] -= (acc[8] & 0xffff) << 40;
  597|  33.0k|    acc[2] += acc[8] >> 48;
  598|  33.0k|    acc[1] += (acc[8] & 0xffffffffffff) << 8;
  599|       |
  600|  33.0k|    acc[3] += acc[7] >> 32;
  601|  33.0k|    acc[2] += (acc[7] & 0xffffffff) << 24;
  602|  33.0k|    acc[2] += acc[7] >> 8;
  603|  33.0k|    acc[1] += (acc[7] & 0xff) << 48;
  604|  33.0k|    acc[1] -= acc[7] >> 16;
  605|  33.0k|    acc[0] -= (acc[7] & 0xffff) << 40;
  606|  33.0k|    acc[1] += acc[7] >> 48;
  607|  33.0k|    acc[0] += (acc[7] & 0xffffffffffff) << 8;
  608|       |
  609|       |    /*-
  610|       |     * acc[k] < in[k] + 2^124 + 2^121
  611|       |     *        < in[k] + 2^125
  612|       |     *        < 2^128, for k <= 6
  613|       |     */
  614|       |
  615|       |    /*
  616|       |     * Carry 4 -> 5 -> 6
  617|       |     * This has the effect of ensuring that these more significant limbs
  618|       |     * will be small in value after eliminating high bits from acc[6].
  619|       |     */
  620|  33.0k|    acc[5] += acc[4] >> 56;
  621|  33.0k|    acc[4] &= 0x00ffffffffffffff;
  622|       |
  623|  33.0k|    acc[6] += acc[5] >> 56;
  624|  33.0k|    acc[5] &= 0x00ffffffffffffff;
  625|       |
  626|       |    /*-
  627|       |     * acc[6] < in[6] + 2^124 + 2^121 + 2^72 + 2^16
  628|       |     *        < in[6] + 2^125
  629|       |     *        < 2^128
  630|       |     */
  631|       |
  632|       |    /* [3]: Eliminate high bits of acc[6] */
  633|  33.0k|    temp = acc[6] >> 48;
  634|  33.0k|    acc[6] &= 0x0000ffffffffffff;
  635|       |
  636|       |    /* temp < 2^80 */
  637|       |
  638|  33.0k|    acc[3] += temp >> 40;
  639|  33.0k|    acc[2] += (temp & 0xffffffffff) << 16;
  640|  33.0k|    acc[2] += temp >> 16;
  641|  33.0k|    acc[1] += (temp & 0xffff) << 40;
  642|  33.0k|    acc[1] -= temp >> 24;
  643|  33.0k|    acc[0] -= (temp & 0xffffff) << 32;
  644|  33.0k|    acc[0] += temp;
  645|       |
  646|       |    /*-
  647|       |     * acc[k] < acc_old[k] + 2^64 + 2^56
  648|       |     *        < in[k] + 2^124 + 2^121 + 2^72 + 2^64 + 2^56 + 2^16 , k < 4
  649|       |     */
  650|       |
  651|       |    /* Carry 0 -> 1 -> 2 -> 3 -> 4 -> 5 -> 6 */
  652|  33.0k|    acc[1] += acc[0] >> 56; /* acc[1] < acc_old[1] + 2^72 */
  653|  33.0k|    acc[0] &= 0x00ffffffffffffff;
  654|       |
  655|  33.0k|    acc[2] += acc[1] >> 56; /* acc[2] < acc_old[2] + 2^72 + 2^16 */
  656|  33.0k|    acc[1] &= 0x00ffffffffffffff;
  657|       |
  658|  33.0k|    acc[3] += acc[2] >> 56; /* acc[3] < acc_old[3] + 2^72 + 2^16 */
  659|  33.0k|    acc[2] &= 0x00ffffffffffffff;
  660|       |
  661|       |    /*-
  662|       |     * acc[k] < acc_old[k] + 2^72 + 2^16
  663|       |     *        < in[k] + 2^124 + 2^121 + 2^73 + 2^64 + 2^56 + 2^17
  664|       |     *        < in[k] + 2^125
  665|       |     *        < 2^128 , k < 4
  666|       |     */
  667|       |
  668|  33.0k|    acc[4] += acc[3] >> 56; /*-
  669|       |                             * acc[4] < acc_old[4] + 2^72 + 2^16
  670|       |                             *        < 2^72 + 2^56 + 2^16
  671|       |                             */
  672|  33.0k|    acc[3] &= 0x00ffffffffffffff;
  673|       |
  674|  33.0k|    acc[5] += acc[4] >> 56; /*-
  675|       |                             * acc[5] < acc_old[5] + 2^16 + 1
  676|       |                             *        < 2^56 + 2^16 + 1
  677|       |                             */
  678|  33.0k|    acc[4] &= 0x00ffffffffffffff;
  679|       |
  680|  33.0k|    acc[6] += acc[5] >> 56; /* acc[6] < 2^48 + 1 <= 2^48 */
  681|  33.0k|    acc[5] &= 0x00ffffffffffffff;
  682|       |
  683|   264k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |  105|   264k|#define NLIMBS 7
  ------------------
  |  Branch (683:17): [True: 231k, False: 33.0k]
  ------------------
  684|   231k|        out[i] = acc[i];
  685|  33.0k|}
ecp_nistp384.c:felem_mul_ref:
  432|  17.5k|{
  433|  17.5k|    out[0] = ((uint128_t)in1[0]) * in2[0];
  434|       |
  435|  17.5k|    out[1] = ((uint128_t)in1[0]) * in2[1]
  436|  17.5k|        + ((uint128_t)in1[1]) * in2[0];
  437|       |
  438|  17.5k|    out[2] = ((uint128_t)in1[0]) * in2[2]
  439|  17.5k|        + ((uint128_t)in1[1]) * in2[1]
  440|  17.5k|        + ((uint128_t)in1[2]) * in2[0];
  441|       |
  442|  17.5k|    out[3] = ((uint128_t)in1[0]) * in2[3]
  443|  17.5k|        + ((uint128_t)in1[1]) * in2[2]
  444|  17.5k|        + ((uint128_t)in1[2]) * in2[1]
  445|  17.5k|        + ((uint128_t)in1[3]) * in2[0];
  446|       |
  447|  17.5k|    out[4] = ((uint128_t)in1[0]) * in2[4]
  448|  17.5k|        + ((uint128_t)in1[1]) * in2[3]
  449|  17.5k|        + ((uint128_t)in1[2]) * in2[2]
  450|  17.5k|        + ((uint128_t)in1[3]) * in2[1]
  451|  17.5k|        + ((uint128_t)in1[4]) * in2[0];
  452|       |
  453|  17.5k|    out[5] = ((uint128_t)in1[0]) * in2[5]
  454|  17.5k|        + ((uint128_t)in1[1]) * in2[4]
  455|  17.5k|        + ((uint128_t)in1[2]) * in2[3]
  456|  17.5k|        + ((uint128_t)in1[3]) * in2[2]
  457|  17.5k|        + ((uint128_t)in1[4]) * in2[1]
  458|  17.5k|        + ((uint128_t)in1[5]) * in2[0];
  459|       |
  460|  17.5k|    out[6] = ((uint128_t)in1[0]) * in2[6]
  461|  17.5k|        + ((uint128_t)in1[1]) * in2[5]
  462|  17.5k|        + ((uint128_t)in1[2]) * in2[4]
  463|  17.5k|        + ((uint128_t)in1[3]) * in2[3]
  464|  17.5k|        + ((uint128_t)in1[4]) * in2[2]
  465|  17.5k|        + ((uint128_t)in1[5]) * in2[1]
  466|  17.5k|        + ((uint128_t)in1[6]) * in2[0];
  467|       |
  468|  17.5k|    out[7] = ((uint128_t)in1[1]) * in2[6]
  469|  17.5k|        + ((uint128_t)in1[2]) * in2[5]
  470|  17.5k|        + ((uint128_t)in1[3]) * in2[4]
  471|  17.5k|        + ((uint128_t)in1[4]) * in2[3]
  472|  17.5k|        + ((uint128_t)in1[5]) * in2[2]
  473|  17.5k|        + ((uint128_t)in1[6]) * in2[1];
  474|       |
  475|  17.5k|    out[8] = ((uint128_t)in1[2]) * in2[6]
  476|  17.5k|        + ((uint128_t)in1[3]) * in2[5]
  477|  17.5k|        + ((uint128_t)in1[4]) * in2[4]
  478|  17.5k|        + ((uint128_t)in1[5]) * in2[3]
  479|  17.5k|        + ((uint128_t)in1[6]) * in2[2];
  480|       |
  481|  17.5k|    out[9] = ((uint128_t)in1[3]) * in2[6]
  482|  17.5k|        + ((uint128_t)in1[4]) * in2[5]
  483|  17.5k|        + ((uint128_t)in1[5]) * in2[4]
  484|  17.5k|        + ((uint128_t)in1[6]) * in2[3];
  485|       |
  486|  17.5k|    out[10] = ((uint128_t)in1[4]) * in2[6]
  487|  17.5k|        + ((uint128_t)in1[5]) * in2[5]
  488|  17.5k|        + ((uint128_t)in1[6]) * in2[4];
  489|       |
  490|  17.5k|    out[11] = ((uint128_t)in1[5]) * in2[6]
  491|  17.5k|        + ((uint128_t)in1[6]) * in2[5];
  492|       |
  493|  17.5k|    out[12] = ((uint128_t)in1[6]) * in2[6];
  494|  17.5k|}
ecp_nistp384.c:felem_contract:
  888|     80|{
  889|     80|    static const int64_t two56 = ((limb)1) << 56;
  890|       |
  891|       |    /*
  892|       |     * We know for a fact that 0 <= |in| < 2*p, for p = 2^384 - 2^128 - 2^96 + 2^32 - 1
  893|       |     * Perform two successive, idempotent subtractions to reduce if |in| >= p.
  894|       |     */
  895|       |
  896|     80|    int64_t tmp[NLIMBS], cond[5], a;
  897|     80|    unsigned int i;
  898|       |
  899|     80|    memcpy(tmp, in, sizeof(felem));
  900|       |
  901|       |    /* Case 1: a = 1 iff |in| >= 2^384 */
  902|     80|    a = (in[6] >> 48);
  903|     80|    tmp[0] += a;
  904|     80|    tmp[0] -= a << 32;
  905|     80|    tmp[1] += a << 40;
  906|     80|    tmp[2] += a << 16;
  907|     80|    tmp[6] &= 0x0000ffffffffffff;
  908|       |
  909|       |    /*
  910|       |     * eliminate negative coefficients: if tmp[0] is negative, tmp[1] must be
  911|       |     * non-zero, so we only need one step
  912|       |     */
  913|       |
  914|     80|    a = tmp[0] >> 63;
  915|     80|    tmp[0] += a & two56;
  916|     80|    tmp[1] -= a & 1;
  917|       |
  918|       |    /* Carry 1 -> 2 -> 3 -> 4 -> 5 -> 6 */
  919|     80|    tmp[2] += tmp[1] >> 56;
  920|     80|    tmp[1] &= 0x00ffffffffffffff;
  921|       |
  922|     80|    tmp[3] += tmp[2] >> 56;
  923|     80|    tmp[2] &= 0x00ffffffffffffff;
  924|       |
  925|     80|    tmp[4] += tmp[3] >> 56;
  926|     80|    tmp[3] &= 0x00ffffffffffffff;
  927|       |
  928|     80|    tmp[5] += tmp[4] >> 56;
  929|     80|    tmp[4] &= 0x00ffffffffffffff;
  930|       |
  931|     80|    tmp[6] += tmp[5] >> 56; /* tmp[6] < 2^48 */
  932|     80|    tmp[5] &= 0x00ffffffffffffff;
  933|       |
  934|       |    /*
  935|       |     * Case 2: a = all ones if p <= |in| < 2^384, 0 otherwise
  936|       |     */
  937|       |
  938|       |    /* 0 iff (2^129..2^383) are all one */
  939|     80|    cond[0] = ((tmp[6] | 0xff000000000000) & tmp[5] & tmp[4] & tmp[3] & (tmp[2] | 0x0000000001ffff)) + 1;
  940|       |    /* 0 iff 2^128 bit is one */
  941|     80|    cond[1] = (tmp[2] | ~0x00000000010000) + 1;
  942|       |    /* 0 iff (2^96..2^127) bits are all one */
  943|     80|    cond[2] = ((tmp[2] | 0xffffffffff0000) & (tmp[1] | 0x0000ffffffffff)) + 1;
  944|       |    /* 0 iff (2^32..2^95) bits are all zero */
  945|     80|    cond[3] = (tmp[1] & ~0xffff0000000000) | (tmp[0] & ~((int64_t)0x000000ffffffff));
  946|       |    /* 0 iff (2^0..2^31) bits are all one */
  947|     80|    cond[4] = (tmp[0] | 0xffffff00000000) + 1;
  948|       |
  949|       |    /*
  950|       |     * In effect, invert our conditions, so that 0 values become all 1's,
  951|       |     * any non-zero value in the low-order 56 bits becomes all 0's
  952|       |     */
  953|    480|    for (i = 0; i < 5; i++)
  ------------------
  |  Branch (953:17): [True: 400, False: 80]
  ------------------
  954|    400|        cond[i] = ((cond[i] & 0x00ffffffffffffff) - 1) >> 63;
  955|       |
  956|       |    /*
  957|       |     * The condition for determining whether in is greater than our
  958|       |     * prime is given by the following condition.
  959|       |     */
  960|       |
  961|       |    /* First subtract 2^384 - 2^129 cheaply */
  962|     80|    a = cond[0] & (cond[1] | (cond[2] & (~cond[3] | cond[4])));
  963|     80|    tmp[6] &= ~a;
  964|     80|    tmp[5] &= ~a;
  965|     80|    tmp[4] &= ~a;
  966|     80|    tmp[3] &= ~a;
  967|     80|    tmp[2] &= ~a | 0x0000000001ffff;
  968|       |
  969|       |    /*
  970|       |     * Subtract 2^128 - 2^96 by
  971|       |     * means of disjoint cases.
  972|       |     */
  973|       |
  974|       |    /* subtract 2^128 if that bit is present, and add 2^96 */
  975|     80|    a = cond[0] & cond[1];
  976|     80|    tmp[2] &= ~a | 0xfffffffffeffff;
  977|     80|    tmp[1] += a & ((int64_t)1 << 40);
  978|       |
  979|       |    /* otherwise, clear bits 2^127 .. 2^96  */
  980|     80|    a = cond[0] & ~cond[1] & (cond[2] & (~cond[3] | cond[4]));
  981|     80|    tmp[2] &= ~a | 0xffffffffff0000;
  982|     80|    tmp[1] &= ~a | 0x0000ffffffffff;
  983|       |
  984|       |    /* finally, subtract the last 2^32 - 1 */
  985|     80|    a = cond[0] & (cond[1] | (cond[2] & (~cond[3] | cond[4])));
  986|     80|    tmp[0] += a & (-((int64_t)1 << 32) + 1);
  987|       |
  988|       |    /*
  989|       |     * eliminate negative coefficients: if tmp[0] is negative, tmp[1] must be
  990|       |     * non-zero, so we only need one step
  991|       |     */
  992|     80|    a = tmp[0] >> 63;
  993|     80|    tmp[0] += a & two56;
  994|     80|    tmp[1] -= a & 1;
  995|       |
  996|       |    /* Carry 1 -> 2 -> 3 -> 4 -> 5 -> 6 */
  997|     80|    tmp[2] += tmp[1] >> 56;
  998|     80|    tmp[1] &= 0x00ffffffffffffff;
  999|       |
 1000|     80|    tmp[3] += tmp[2] >> 56;
 1001|     80|    tmp[2] &= 0x00ffffffffffffff;
 1002|       |
 1003|     80|    tmp[4] += tmp[3] >> 56;
 1004|     80|    tmp[3] &= 0x00ffffffffffffff;
 1005|       |
 1006|     80|    tmp[5] += tmp[4] >> 56;
 1007|     80|    tmp[4] &= 0x00ffffffffffffff;
 1008|       |
 1009|     80|    tmp[6] += tmp[5] >> 56;
 1010|     80|    tmp[5] &= 0x00ffffffffffffff;
 1011|       |
 1012|     80|    memcpy(out, tmp, sizeof(felem));
 1013|     80|}
ecp_nistp384.c:felem_to_BN:
  161|    128|{
  162|    128|    felem_bytearray b_out;
  163|       |
  164|    128|    felem_to_bin48(b_out, in);
  165|    128|    return BN_lebin2bn(b_out, sizeof(b_out), out);
  166|    128|}
ecp_nistp384.c:felem_to_bin48:
  129|    128|{
  130|    128|    memset(out, 0, 48);
  131|    128|    (*((limb *)&out[0])) |= (in[0] & bottom56bits);
  132|    128|    (*((limb_aX *)&out[7])) |= (in[1] & bottom56bits);
  133|    128|    (*((limb_aX *)&out[14])) |= (in[2] & bottom56bits);
  134|    128|    (*((limb_aX *)&out[21])) |= (in[3] & bottom56bits);
  135|    128|    (*((limb_aX *)&out[28])) |= (in[4] & bottom56bits);
  136|    128|    (*((limb_aX *)&out[35])) |= (in[5] & bottom56bits);
  137|    128|    memmove(&out[42], &in[6], 6);
  138|    128|}
ecp_nistp384.c:point_add:
 1107|  1.56k|{
 1108|  1.56k|    felem ftmp, ftmp2, ftmp3, ftmp4, ftmp5, ftmp6, x_out, y_out, z_out;
 1109|  1.56k|    widefelem tmp, tmp2;
 1110|  1.56k|    limb x_equal, y_equal, z1_is_zero, z2_is_zero;
 1111|  1.56k|    limb points_equal;
 1112|       |
 1113|  1.56k|    z1_is_zero = felem_is_zero(z1);
 1114|  1.56k|    z2_is_zero = felem_is_zero(z2);
 1115|       |
 1116|       |    /* ftmp = z1z1 = z1**2 */
 1117|  1.56k|    felem_square_reduce(ftmp, z1); /* ftmp[i] < 2^56 */
  ------------------
  |  |  771|  1.56k|#define felem_square_reduce felem_square_reduce_ref
  ------------------
 1118|       |
 1119|  1.56k|    if (!mixed) {
  ------------------
  |  Branch (1119:9): [True: 0, False: 1.56k]
  ------------------
 1120|       |        /* ftmp2 = z2z2 = z2**2 */
 1121|      0|        felem_square_reduce(ftmp2, z2); /* ftmp2[i] < 2^56 */
  ------------------
  |  |  771|      0|#define felem_square_reduce felem_square_reduce_ref
  ------------------
 1122|       |
 1123|       |        /* u1 = ftmp3 = x1*z2z2 */
 1124|      0|        felem_mul_reduce(ftmp3, x1, ftmp2); /* ftmp3[i] < 2^56 */
  ------------------
  |  |  772|      0|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
 1125|       |
 1126|       |        /* ftmp5 = z1 + z2 */
 1127|      0|        felem_assign(ftmp5, z1); /* ftmp5[i] < 2^56 */
 1128|      0|        felem_sum64(ftmp5, z2); /* ftmp5[i] < 2^57 */
 1129|       |
 1130|       |        /* ftmp5 = (z1 + z2)**2 - z1z1 - z2z2 = 2*z1z2 */
 1131|      0|        felem_square(tmp, ftmp5); /* tmp[i] < 2^117 */
  ------------------
  |  |  767|      0|#define felem_square felem_square_ref
  ------------------
 1132|      0|        felem_diff_128_64(tmp, ftmp); /* tmp[i] < 2^117 + 2^64 + 2^48 */
 1133|      0|        felem_diff_128_64(tmp, ftmp2); /* tmp[i] < 2^117 + 2^65 + 2^49 */
 1134|      0|        felem_reduce(ftmp5, tmp); /* ftmp5[i] < 2^56 */
  ------------------
  |  |  769|      0|#define felem_reduce felem_reduce_ref
  ------------------
 1135|       |
 1136|       |        /* ftmp2 = z2 * z2z2 */
 1137|      0|        felem_mul_reduce(ftmp2, ftmp2, z2); /* ftmp2[i] < 2^56 */
  ------------------
  |  |  772|      0|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
 1138|       |
 1139|       |        /* s1 = ftmp6 = y1 * z2**3 */
 1140|      0|        felem_mul_reduce(ftmp6, y1, ftmp2); /* ftmp6[i] < 2^56 */
  ------------------
  |  |  772|      0|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
 1141|  1.56k|    } else {
 1142|       |        /*
 1143|       |         * We'll assume z2 = 1 (special case z2 = 0 is handled later)
 1144|       |         */
 1145|       |
 1146|       |        /* u1 = ftmp3 = x1*z2z2 */
 1147|  1.56k|        felem_assign(ftmp3, x1); /* ftmp3[i] < 2^56 */
 1148|       |
 1149|       |        /* ftmp5 = 2*z1z2 */
 1150|  1.56k|        felem_scalar(ftmp5, z1, 2); /* ftmp5[i] < 2^57 */
 1151|       |
 1152|       |        /* s1 = ftmp6 = y1 * z2**3 */
 1153|  1.56k|        felem_assign(ftmp6, y1); /* ftmp6[i] < 2^56 */
 1154|  1.56k|    }
 1155|       |    /* ftmp3[i] < 2^56, ftmp5[i] < 2^57, ftmp6[i] < 2^56 */
 1156|       |
 1157|       |    /* u2 = x2*z1z1 */
 1158|  1.56k|    felem_mul(tmp, x2, ftmp); /* tmp[i] < 2^115 */
  ------------------
  |  |  768|  1.56k|#define felem_mul felem_mul_ref
  ------------------
 1159|       |
 1160|       |    /* h = ftmp4 = u2 - u1 */
 1161|  1.56k|    felem_diff_128_64(tmp, ftmp3); /* tmp[i] < 2^115 + 2^64 + 2^48 */
 1162|  1.56k|    felem_reduce(ftmp4, tmp); /* ftmp[4] < 2^56 */
  ------------------
  |  |  769|  1.56k|#define felem_reduce felem_reduce_ref
  ------------------
 1163|       |
 1164|  1.56k|    x_equal = felem_is_zero(ftmp4);
 1165|       |
 1166|       |    /* z_out = ftmp5 * h */
 1167|  1.56k|    felem_mul_reduce(z_out, ftmp5, ftmp4); /* z_out[i] < 2^56 */
  ------------------
  |  |  772|  1.56k|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
 1168|       |
 1169|       |    /* ftmp = z1 * z1z1 */
 1170|  1.56k|    felem_mul_reduce(ftmp, ftmp, z1); /* ftmp[i] < 2^56 */
  ------------------
  |  |  772|  1.56k|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
 1171|       |
 1172|       |    /* s2 = tmp = y2 * z1**3 */
 1173|  1.56k|    felem_mul(tmp, y2, ftmp); /* tmp[i] < 2^115 */
  ------------------
  |  |  768|  1.56k|#define felem_mul felem_mul_ref
  ------------------
 1174|       |
 1175|       |    /* r = ftmp5 = (s2 - s1)*2 */
 1176|  1.56k|    felem_diff_128_64(tmp, ftmp6); /* tmp[i] < 2^115 + 2^64 + 2^48 */
 1177|  1.56k|    felem_reduce(ftmp5, tmp); /* ftmp5[i] < 2^56 */
  ------------------
  |  |  769|  1.56k|#define felem_reduce felem_reduce_ref
  ------------------
 1178|  1.56k|    y_equal = felem_is_zero(ftmp5);
 1179|  1.56k|    felem_scalar64(ftmp5, 2); /* ftmp5[i] < 2^57 */
 1180|       |
 1181|       |    /*
 1182|       |     * The formulae are incorrect if the points are equal, in affine coordinates
 1183|       |     * (X_1, Y_1) == (X_2, Y_2), so we check for this and do doubling if this
 1184|       |     * happens.
 1185|       |     *
 1186|       |     * We use bitwise operations to avoid potential side-channels introduced by
 1187|       |     * the short-circuiting behaviour of boolean operators.
 1188|       |     *
 1189|       |     * The special case of either point being the point at infinity (z1 and/or
 1190|       |     * z2 are zero), is handled separately later on in this function, so we
 1191|       |     * avoid jumping to point_double here in those special cases.
 1192|       |     *
 1193|       |     * Notice the comment below on the implications of this branching for timing
 1194|       |     * leaks and why it is considered practically irrelevant.
 1195|       |     */
 1196|  1.56k|    points_equal = (x_equal & y_equal & (~z1_is_zero) & (~z2_is_zero));
 1197|       |
 1198|  1.56k|    if (points_equal) {
  ------------------
  |  Branch (1198:9): [True: 0, False: 1.56k]
  ------------------
 1199|       |        /*
 1200|       |         * This is obviously not constant-time but it will almost-never happen
 1201|       |         * for ECDH / ECDSA.
 1202|       |         */
 1203|      0|        point_double(x3, y3, z3, x1, y1, z1);
 1204|      0|        return;
 1205|      0|    }
 1206|       |
 1207|       |    /* I = ftmp = (2h)**2 */
 1208|  1.56k|    felem_assign(ftmp, ftmp4); /* ftmp[i] < 2^56 */
 1209|  1.56k|    felem_scalar64(ftmp, 2); /* ftmp[i] < 2^57 */
 1210|  1.56k|    felem_square_reduce(ftmp, ftmp); /* ftmp[i] < 2^56 */
  ------------------
  |  |  771|  1.56k|#define felem_square_reduce felem_square_reduce_ref
  ------------------
 1211|       |
 1212|       |    /* J = ftmp2 = h * I */
 1213|  1.56k|    felem_mul_reduce(ftmp2, ftmp4, ftmp); /* ftmp2[i] < 2^56 */
  ------------------
  |  |  772|  1.56k|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
 1214|       |
 1215|       |    /* V = ftmp4 = U1 * I */
 1216|  1.56k|    felem_mul_reduce(ftmp4, ftmp3, ftmp); /* ftmp4[i] < 2^56 */
  ------------------
  |  |  772|  1.56k|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
 1217|       |
 1218|       |    /* x_out = r**2 - J - 2V */
 1219|  1.56k|    felem_square(tmp, ftmp5); /* tmp[i] < 2^117 */
  ------------------
  |  |  767|  1.56k|#define felem_square felem_square_ref
  ------------------
 1220|  1.56k|    felem_diff_128_64(tmp, ftmp2); /* tmp[i] < 2^117 + 2^64 + 2^48 */
 1221|  1.56k|    felem_assign(ftmp3, ftmp4); /* ftmp3[i] < 2^56 */
 1222|  1.56k|    felem_scalar64(ftmp4, 2); /* ftmp4[i] < 2^57 */
 1223|  1.56k|    felem_diff_128_64(tmp, ftmp4); /* tmp[i] < 2^117 + 2^65 + 2^49 */
 1224|  1.56k|    felem_reduce(x_out, tmp); /* x_out[i] < 2^56 */
  ------------------
  |  |  769|  1.56k|#define felem_reduce felem_reduce_ref
  ------------------
 1225|       |
 1226|       |    /* y_out = r(V-x_out) - 2 * s1 * J */
 1227|  1.56k|    felem_diff64(ftmp3, x_out); /* ftmp3[i] < 2^60 + 2^56 + 2^44 */
 1228|  1.56k|    felem_mul(tmp, ftmp5, ftmp3); /* tmp[i] < 2^116 */
  ------------------
  |  |  768|  1.56k|#define felem_mul felem_mul_ref
  ------------------
 1229|  1.56k|    felem_mul(tmp2, ftmp6, ftmp2); /* tmp2[i] < 2^115 */
  ------------------
  |  |  768|  1.56k|#define felem_mul felem_mul_ref
  ------------------
 1230|  1.56k|    felem_scalar128(tmp2, 2); /* tmp2[i] < 2^116 */
 1231|  1.56k|    felem_diff128(tmp, tmp2); /* tmp[i] < 2^127 + 2^116 + 2^111 */
 1232|  1.56k|    felem_reduce(y_out, tmp); /* y_out[i] < 2^56 */
  ------------------
  |  |  769|  1.56k|#define felem_reduce felem_reduce_ref
  ------------------
 1233|       |
 1234|  1.56k|    copy_conditional(x_out, x2, z1_is_zero);
 1235|  1.56k|    copy_conditional(x_out, x1, z2_is_zero);
 1236|  1.56k|    copy_conditional(y_out, y2, z1_is_zero);
 1237|  1.56k|    copy_conditional(y_out, y1, z2_is_zero);
 1238|  1.56k|    copy_conditional(z_out, z2, z1_is_zero);
 1239|  1.56k|    copy_conditional(z_out, z1, z2_is_zero);
 1240|  1.56k|    felem_assign(x3, x_out);
 1241|  1.56k|    felem_assign(y3, y_out);
 1242|  1.56k|    felem_assign(z3, z_out);
 1243|  1.56k|}
ecp_nistp384.c:felem_is_zero:
  861|  6.27k|{
  862|  6.27k|    limb zero, p384;
  863|       |
  864|  6.27k|    zero = in[0] | in[1] | in[2] | in[3] | in[4] | in[5] | in[6];
  865|  6.27k|    zero = ((int64_t)(zero)-1) >> 63;
  866|  6.27k|    p384 = (in[0] ^ 0x000000ffffffff) | (in[1] ^ 0xffff0000000000)
  867|  6.27k|        | (in[2] ^ 0xfffffffffeffff) | (in[3] ^ 0xffffffffffffff)
  868|  6.27k|        | (in[4] ^ 0xffffffffffffff) | (in[5] ^ 0xffffffffffffff)
  869|  6.27k|        | (in[6] ^ 0xffffffffffff);
  870|  6.27k|    p384 = ((int64_t)(p384)-1) >> 63;
  871|       |
  872|  6.27k|    return (zero | p384);
  873|  6.27k|}
ecp_nistp384.c:felem_sum64:
  186|  4.70k|{
  187|  4.70k|    unsigned int i;
  188|       |
  189|  37.6k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |  105|  37.6k|#define NLIMBS 7
  ------------------
  |  Branch (189:17): [True: 32.9k, False: 4.70k]
  ------------------
  190|  32.9k|        out[i] += in[i];
  191|  4.70k|}
ecp_nistp384.c:felem_diff_128_64:
  306|  9.40k|{
  307|       |    /*
  308|       |     * In order to prevent underflow, we add a multiple of p before subtracting.
  309|       |     * Use telescopic sums to represent 2^16 * p redundantly with each limb
  310|       |     * of the form 2^64 + ...
  311|       |     */
  312|       |
  313|  9.40k|    static const widelimb two64m56m8 = (((widelimb)1) << 64)
  314|  9.40k|        - (((widelimb)1) << 56)
  315|  9.40k|        - (((widelimb)1) << 8);
  316|  9.40k|    static const widelimb two64m32m8 = (((widelimb)1) << 64)
  317|  9.40k|        - (((widelimb)1) << 32)
  318|  9.40k|        - (((widelimb)1) << 8);
  319|  9.40k|    static const widelimb two64m8 = (((widelimb)1) << 64)
  320|  9.40k|        - (((widelimb)1) << 8);
  321|  9.40k|    static const widelimb two64p48m16 = (((widelimb)1) << 64)
  322|  9.40k|        + (((widelimb)1) << 48)
  323|  9.40k|        - (((widelimb)1) << 16);
  324|  9.40k|    unsigned int i;
  325|       |
  326|  9.40k|    out[0] += two64p48m16;
  327|  9.40k|    out[1] += two64m56m8;
  328|  9.40k|    out[2] += two64m32m8;
  329|  9.40k|    out[3] += two64m8;
  330|  9.40k|    out[4] += two64m8;
  331|  9.40k|    out[5] += two64m8;
  332|  9.40k|    out[6] += two64m8;
  333|       |
  334|  75.2k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |  105|  75.2k|#define NLIMBS 7
  ------------------
  |  Branch (334:17): [True: 65.8k, False: 9.40k]
  ------------------
  335|  65.8k|        out[i] -= in[i];
  336|  9.40k|}
ecp_nistp384.c:felem_scalar64:
  204|  9.40k|{
  205|  9.40k|    unsigned int i;
  206|       |
  207|  75.2k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |  105|  75.2k|#define NLIMBS 7
  ------------------
  |  Branch (207:17): [True: 65.8k, False: 9.40k]
  ------------------
  208|  65.8k|        out[i] *= scalar;
  209|  9.40k|}
ecp_nistp384.c:felem_diff64:
  273|  4.70k|{
  274|       |    /*
  275|       |     * In order to prevent underflow, we add a multiple of p before subtracting.
  276|       |     * Use telescopic sums to represent 2^12 * p redundantly with each limb
  277|       |     * of the form 2^60 + ...
  278|       |     */
  279|       |
  280|  4.70k|    static const limb two60m52m4 = (((limb)1) << 60)
  281|  4.70k|        - (((limb)1) << 52)
  282|  4.70k|        - (((limb)1) << 4);
  283|  4.70k|    static const limb two60p44m12 = (((limb)1) << 60)
  284|  4.70k|        + (((limb)1) << 44)
  285|  4.70k|        - (((limb)1) << 12);
  286|  4.70k|    static const limb two60m28m4 = (((limb)1) << 60)
  287|  4.70k|        - (((limb)1) << 28)
  288|  4.70k|        - (((limb)1) << 4);
  289|  4.70k|    static const limb two60m4 = (((limb)1) << 60)
  290|  4.70k|        - (((limb)1) << 4);
  291|       |
  292|  4.70k|    out[0] += two60p44m12 - in[0];
  293|  4.70k|    out[1] += two60m52m4 - in[1];
  294|  4.70k|    out[2] += two60m28m4 - in[2];
  295|  4.70k|    out[3] += two60m4 - in[3];
  296|  4.70k|    out[4] += two60m4 - in[4];
  297|  4.70k|    out[5] += two60m4 - in[5];
  298|  4.70k|    out[6] += two60m4 - in[6];
  299|  4.70k|}
ecp_nistp384.c:felem_scalar128:
  213|  3.13k|{
  214|  3.13k|    unsigned int i;
  215|       |
  216|  43.9k|    for (i = 0; i < 2 * NLIMBS - 1; i++)
  ------------------
  |  |  105|  43.9k|#define NLIMBS 7
  ------------------
  |  Branch (216:17): [True: 40.7k, False: 3.13k]
  ------------------
  217|  40.7k|        out[i] *= scalar;
  218|  3.13k|}
ecp_nistp384.c:felem_diff128:
  343|  3.13k|{
  344|       |    /*
  345|       |     * In order to prevent underflow, we add a multiple of p before subtracting.
  346|       |     * Use telescopic sums to represent 2^415 * p redundantly with each limb
  347|       |     * of the form 2^127 + ...
  348|       |     */
  349|       |
  350|  3.13k|    static const widelimb two127 = ((widelimb)1) << 127;
  351|  3.13k|    static const widelimb two127m71 = (((widelimb)1) << 127)
  352|  3.13k|        - (((widelimb)1) << 71);
  353|  3.13k|    static const widelimb two127p111m79m71 = (((widelimb)1) << 127)
  354|  3.13k|        + (((widelimb)1) << 111)
  355|  3.13k|        - (((widelimb)1) << 79)
  356|  3.13k|        - (((widelimb)1) << 71);
  357|  3.13k|    static const widelimb two127m119m71 = (((widelimb)1) << 127)
  358|  3.13k|        - (((widelimb)1) << 119)
  359|  3.13k|        - (((widelimb)1) << 71);
  360|  3.13k|    static const widelimb two127m95m71 = (((widelimb)1) << 127)
  361|  3.13k|        - (((widelimb)1) << 95)
  362|  3.13k|        - (((widelimb)1) << 71);
  363|  3.13k|    unsigned int i;
  364|       |
  365|  3.13k|    out[0] += two127;
  366|  3.13k|    out[1] += two127m71;
  367|  3.13k|    out[2] += two127m71;
  368|  3.13k|    out[3] += two127m71;
  369|  3.13k|    out[4] += two127m71;
  370|  3.13k|    out[5] += two127m71;
  371|  3.13k|    out[6] += two127p111m79m71;
  372|  3.13k|    out[7] += two127m119m71;
  373|  3.13k|    out[8] += two127m95m71;
  374|  3.13k|    out[9] += two127m71;
  375|  3.13k|    out[10] += two127m71;
  376|  3.13k|    out[11] += two127m71;
  377|  3.13k|    out[12] += two127m71;
  378|       |
  379|  43.9k|    for (i = 0; i < 2 * NLIMBS - 1; i++)
  ------------------
  |  |  105|  43.9k|#define NLIMBS 7
  ------------------
  |  Branch (379:17): [True: 40.7k, False: 3.13k]
  ------------------
  380|  40.7k|        out[i] -= in[i];
  381|  3.13k|}
ecp_nistp384.c:copy_conditional:
 1085|  9.40k|{
 1086|  9.40k|    unsigned int i;
 1087|       |
 1088|  75.2k|    for (i = 0; i < NLIMBS; i++)
  ------------------
  |  |  105|  75.2k|#define NLIMBS 7
  ------------------
  |  Branch (1088:17): [True: 65.8k, False: 9.40k]
  ------------------
 1089|  65.8k|        out[i] ^= mask & (in[i] ^ out[i]);
 1090|  9.40k|}
ecp_nistp384.c:point_double:
 1036|  1.56k|{
 1037|  1.56k|    widefelem tmp, tmp2;
 1038|  1.56k|    felem delta, gamma, beta, alpha, ftmp, ftmp2;
 1039|       |
 1040|  1.56k|    felem_assign(ftmp, x_in);
 1041|  1.56k|    felem_assign(ftmp2, x_in);
 1042|       |
 1043|       |    /* delta = z^2 */
 1044|  1.56k|    felem_square_reduce(delta, z_in); /* delta[i] < 2^56 */
  ------------------
  |  |  771|  1.56k|#define felem_square_reduce felem_square_reduce_ref
  ------------------
 1045|       |
 1046|       |    /* gamma = y^2 */
 1047|  1.56k|    felem_square_reduce(gamma, y_in); /* gamma[i] < 2^56 */
  ------------------
  |  |  771|  1.56k|#define felem_square_reduce felem_square_reduce_ref
  ------------------
 1048|       |
 1049|       |    /* beta = x*gamma */
 1050|  1.56k|    felem_mul_reduce(beta, x_in, gamma); /* beta[i] < 2^56 */
  ------------------
  |  |  772|  1.56k|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
 1051|       |
 1052|       |    /* alpha = 3*(x-delta)*(x+delta) */
 1053|  1.56k|    felem_diff64(ftmp, delta); /* ftmp[i] < 2^60 + 2^58 + 2^44 */
 1054|  1.56k|    felem_sum64(ftmp2, delta); /* ftmp2[i] < 2^59 */
 1055|  1.56k|    felem_scalar64(ftmp2, 3); /* ftmp2[i] < 2^61 */
 1056|  1.56k|    felem_mul_reduce(alpha, ftmp, ftmp2); /* alpha[i] < 2^56 */
  ------------------
  |  |  772|  1.56k|#define felem_mul_reduce felem_mul_reduce_ref
  ------------------
 1057|       |
 1058|       |    /* x' = alpha^2 - 8*beta */
 1059|  1.56k|    felem_square(tmp, alpha); /* tmp[i] < 2^115 */
  ------------------
  |  |  767|  1.56k|#define felem_square felem_square_ref
  ------------------
 1060|  1.56k|    felem_assign(ftmp, beta); /* ftmp[i] < 2^56 */
 1061|  1.56k|    felem_scalar64(ftmp, 8); /* ftmp[i] < 2^59 */
 1062|  1.56k|    felem_diff_128_64(tmp, ftmp); /* tmp[i] < 2^115 + 2^64 + 2^48 */
 1063|  1.56k|    felem_reduce(x_out, tmp); /* x_out[i] < 2^56 */
  ------------------
  |  |  769|  1.56k|#define felem_reduce felem_reduce_ref
  ------------------
 1064|       |
 1065|       |    /* z' = (y + z)^2 - gamma - delta */
 1066|  1.56k|    felem_sum64(delta, gamma); /* delta[i] < 2^57 */
 1067|  1.56k|    felem_assign(ftmp, y_in); /* ftmp[i] < 2^56 */
 1068|  1.56k|    felem_sum64(ftmp, z_in); /* ftmp[i] < 2^56 */
 1069|  1.56k|    felem_square(tmp, ftmp); /* tmp[i] < 2^115 */
  ------------------
  |  |  767|  1.56k|#define felem_square felem_square_ref
  ------------------
 1070|  1.56k|    felem_diff_128_64(tmp, delta); /* tmp[i] < 2^115 + 2^64 + 2^48 */
 1071|  1.56k|    felem_reduce(z_out, tmp); /* z_out[i] < 2^56 */
  ------------------
  |  |  769|  1.56k|#define felem_reduce felem_reduce_ref
  ------------------
 1072|       |
 1073|       |    /* y' = alpha*(4*beta - x') - 8*gamma^2 */
 1074|  1.56k|    felem_scalar64(beta, 4); /* beta[i] < 2^58 */
 1075|  1.56k|    felem_diff64(beta, x_out); /* beta[i] < 2^60 + 2^58 + 2^44 */
 1076|  1.56k|    felem_mul(tmp, alpha, beta); /* tmp[i] < 2^119 */
  ------------------
  |  |  768|  1.56k|#define felem_mul felem_mul_ref
  ------------------
 1077|  1.56k|    felem_square(tmp2, gamma); /* tmp2[i] < 2^115 */
  ------------------
  |  |  767|  1.56k|#define felem_square felem_square_ref
  ------------------
 1078|  1.56k|    felem_scalar128(tmp2, 8); /* tmp2[i] < 2^118 */
 1079|  1.56k|    felem_diff128(tmp, tmp2); /* tmp[i] < 2^127 + 2^119 + 2^111 */
 1080|  1.56k|    felem_reduce(y_out, tmp); /* tmp[i] < 2^56 */
  ------------------
  |  |  769|  1.56k|#define felem_reduce felem_reduce_ref
  ------------------
 1081|  1.56k|}
ecp_nistp384.c:batch_mul:
 1410|     16|{
 1411|     16|    int i, skip;
 1412|     16|    unsigned int num, gen_mul = (g_scalar != NULL);
 1413|     16|    felem nq[3], tmp[4];
 1414|     16|    limb bits;
 1415|     16|    u8 sign, digit;
 1416|       |
 1417|       |    /* set nq to the point at infinity */
 1418|     16|    memset(nq, 0, sizeof(nq));
 1419|       |
 1420|       |    /*
 1421|       |     * Loop over all scalars msb-to-lsb, interleaving additions of multiples
 1422|       |     * of the generator (last quarter of rounds) and additions of other
 1423|       |     * points multiples (every 5th round).
 1424|       |     */
 1425|     16|    skip = 1; /* save two point operations in the first
 1426|       |               * round */
 1427|  1.60k|    for (i = (num_points ? 380 : 98); i >= 0; --i) {
  ------------------
  |  Branch (1427:15): [True: 0, False: 16]
  |  Branch (1427:39): [True: 1.58k, False: 16]
  ------------------
 1428|       |        /* double */
 1429|  1.58k|        if (!skip)
  ------------------
  |  Branch (1429:13): [True: 1.56k, False: 16]
  ------------------
 1430|  1.56k|            point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]);
 1431|       |
 1432|       |        /* add multiples of the generator */
 1433|  1.58k|        if (gen_mul && (i <= 98)) {
  ------------------
  |  Branch (1433:13): [True: 1.58k, False: 0]
  |  Branch (1433:24): [True: 1.58k, False: 0]
  ------------------
 1434|  1.58k|            bits = get_bit(g_scalar, i + 285) << 3;
 1435|  1.58k|            if (i < 95) {
  ------------------
  |  Branch (1435:17): [True: 1.52k, False: 64]
  ------------------
 1436|  1.52k|                bits |= get_bit(g_scalar, i + 190) << 2;
 1437|  1.52k|                bits |= get_bit(g_scalar, i + 95) << 1;
 1438|  1.52k|                bits |= get_bit(g_scalar, i);
 1439|  1.52k|            }
 1440|       |            /* select the point to add, in constant time */
 1441|  1.58k|            select_point(bits, 16, g_pre_comp, tmp);
 1442|  1.58k|            if (!skip) {
  ------------------
  |  Branch (1442:17): [True: 1.56k, False: 16]
  ------------------
 1443|       |                /* The 1 argument below is for "mixed" */
 1444|  1.56k|                point_add(nq[0], nq[1], nq[2],
 1445|  1.56k|                    nq[0], nq[1], nq[2], 1,
 1446|  1.56k|                    tmp[0], tmp[1], tmp[2]);
 1447|  1.56k|            } else {
 1448|     16|                memcpy(nq, tmp, 3 * sizeof(felem));
 1449|     16|                skip = 0;
 1450|     16|            }
 1451|  1.58k|        }
 1452|       |
 1453|       |        /* do other additions every 5 doublings */
 1454|  1.58k|        if (num_points && (i % 5 == 0)) {
  ------------------
  |  Branch (1454:13): [True: 0, False: 1.58k]
  |  Branch (1454:27): [True: 0, False: 0]
  ------------------
 1455|       |            /* loop over all scalars */
 1456|      0|            for (num = 0; num < num_points; ++num) {
  ------------------
  |  Branch (1456:27): [True: 0, False: 0]
  ------------------
 1457|      0|                bits = get_bit(scalars[num], i + 4) << 5;
 1458|      0|                bits |= get_bit(scalars[num], i + 3) << 4;
 1459|      0|                bits |= get_bit(scalars[num], i + 2) << 3;
 1460|      0|                bits |= get_bit(scalars[num], i + 1) << 2;
 1461|      0|                bits |= get_bit(scalars[num], i) << 1;
 1462|      0|                bits |= get_bit(scalars[num], i - 1);
 1463|      0|                ossl_ec_GFp_nistp_recode_scalar_bits(&sign, &digit, bits);
 1464|       |
 1465|       |                /*
 1466|       |                 * select the point to add or subtract, in constant time
 1467|       |                 */
 1468|      0|                select_point(digit, 17, pre_comp[num], tmp);
 1469|      0|                felem_neg(tmp[3], tmp[1]); /* (X, -Y, Z) is the negative
 1470|       |                                            * point */
 1471|      0|                copy_conditional(tmp[1], tmp[3], (-(limb)sign));
 1472|       |
 1473|      0|                if (!skip) {
  ------------------
  |  Branch (1473:21): [True: 0, False: 0]
  ------------------
 1474|      0|                    point_add(nq[0], nq[1], nq[2],
 1475|      0|                        nq[0], nq[1], nq[2], mixed,
 1476|      0|                        tmp[0], tmp[1], tmp[2]);
 1477|      0|                } else {
 1478|      0|                    memcpy(nq, tmp, 3 * sizeof(felem));
 1479|      0|                    skip = 0;
 1480|      0|                }
 1481|      0|            }
 1482|      0|        }
 1483|  1.58k|    }
 1484|     16|    felem_assign(x_out, nq[0]);
 1485|     16|    felem_assign(y_out, nq[1]);
 1486|     16|    felem_assign(z_out, nq[2]);
 1487|     16|}
ecp_nistp384.c:get_bit:
 1392|  6.14k|{
 1393|  6.14k|    if (i < 0 || i >= 384)
  ------------------
  |  Branch (1393:9): [True: 0, False: 6.14k]
  |  Branch (1393:18): [True: 0, False: 6.14k]
  ------------------
 1394|      0|        return 0;
 1395|  6.14k|    return (in[i >> 3] >> (i & 7)) & 1;
 1396|  6.14k|}
ecp_nistp384.c:select_point:
 1370|  1.58k|{
 1371|  1.58k|    unsigned int i, j;
 1372|  1.58k|    limb *outlimbs = &out[0][0];
 1373|       |
 1374|  1.58k|    memset(out, 0, sizeof(*out) * 3);
 1375|       |
 1376|  26.9k|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (1376:17): [True: 25.3k, False: 1.58k]
  ------------------
 1377|  25.3k|        const limb *inlimbs = &pre_comp[i][0][0];
 1378|  25.3k|        limb mask = i ^ idx;
 1379|       |
 1380|  25.3k|        mask |= mask >> 4;
 1381|  25.3k|        mask |= mask >> 2;
 1382|  25.3k|        mask |= mask >> 1;
 1383|  25.3k|        mask &= 1;
 1384|  25.3k|        mask--;
 1385|   557k|        for (j = 0; j < NLIMBS * 3; j++)
  ------------------
  |  |  105|   557k|#define NLIMBS 7
  ------------------
  |  Branch (1385:21): [True: 532k, False: 25.3k]
  ------------------
 1386|   532k|            outlimbs[j] |= inlimbs[j] & mask;
 1387|  25.3k|    }
 1388|  1.58k|}

EC_GFp_nistp521_method:
 1588|     13|{
 1589|     13|    static const EC_METHOD ret = {
 1590|     13|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|     13|#define EC_FLAGS_DEFAULT_OCT 0x1
  ------------------
 1591|     13|        NID_X9_62_prime_field,
  ------------------
  |  |  152|     13|#define NID_X9_62_prime_field           406
  ------------------
 1592|     13|        ossl_ec_GFp_nistp521_group_init,
 1593|     13|        ossl_ec_GFp_simple_group_finish,
 1594|     13|        ossl_ec_GFp_simple_group_clear_finish,
 1595|     13|        ossl_ec_GFp_nist_group_copy,
 1596|     13|        ossl_ec_GFp_nistp521_group_set_curve,
 1597|     13|        ossl_ec_GFp_simple_group_get_curve,
 1598|     13|        ossl_ec_GFp_simple_group_get_degree,
 1599|     13|        ossl_ec_group_simple_order_bits,
 1600|     13|        ossl_ec_GFp_simple_group_check_discriminant,
 1601|     13|        ossl_ec_GFp_simple_point_init,
 1602|     13|        ossl_ec_GFp_simple_point_finish,
 1603|     13|        ossl_ec_GFp_simple_point_clear_finish,
 1604|     13|        ossl_ec_GFp_simple_point_copy,
 1605|     13|        ossl_ec_GFp_simple_point_set_to_infinity,
 1606|     13|        ossl_ec_GFp_simple_point_set_affine_coordinates,
 1607|     13|        ossl_ec_GFp_nistp521_point_get_affine_coordinates,
 1608|     13|        0 /* point_set_compressed_coordinates */,
 1609|     13|        0 /* point2oct */,
 1610|     13|        0 /* oct2point */,
 1611|     13|        ossl_ec_GFp_simple_add,
 1612|     13|        ossl_ec_GFp_simple_dbl,
 1613|     13|        ossl_ec_GFp_simple_invert,
 1614|     13|        ossl_ec_GFp_simple_is_at_infinity,
 1615|     13|        ossl_ec_GFp_simple_is_on_curve,
 1616|     13|        ossl_ec_GFp_simple_cmp,
 1617|     13|        ossl_ec_GFp_simple_make_affine,
 1618|     13|        ossl_ec_GFp_simple_points_make_affine,
 1619|     13|        ossl_ec_GFp_nistp521_points_mul,
 1620|     13|        ossl_ec_GFp_nistp521_precompute_mult,
 1621|     13|        ossl_ec_GFp_nistp521_have_precompute_mult,
 1622|     13|        ossl_ec_GFp_nist_field_mul,
 1623|     13|        ossl_ec_GFp_nist_field_sqr,
 1624|     13|        0 /* field_div */,
 1625|     13|        ossl_ec_GFp_simple_field_inv,
 1626|     13|        0 /* field_encode */,
 1627|     13|        0 /* field_decode */,
 1628|     13|        0, /* field_set_to_one */
 1629|     13|        ossl_ec_key_simple_priv2oct,
 1630|     13|        ossl_ec_key_simple_oct2priv,
 1631|     13|        0, /* set private */
 1632|     13|        ossl_ec_key_simple_generate_key,
 1633|     13|        ossl_ec_key_simple_check_key,
 1634|     13|        ossl_ec_key_simple_generate_public_key,
 1635|     13|        0, /* keycopy */
 1636|     13|        0, /* keyfinish */
 1637|     13|        ossl_ecdh_simple_compute_key,
 1638|     13|        ossl_ecdsa_simple_sign_setup,
 1639|     13|        ossl_ecdsa_simple_sign_sig,
 1640|     13|        ossl_ecdsa_simple_verify_sig,
 1641|     13|        0, /* field_inverse_mod_ord */
 1642|     13|        0, /* blind_coordinates */
 1643|     13|        0, /* ladder_pre */
 1644|     13|        0, /* ladder_step */
 1645|     13|        0 /* ladder_post */
 1646|     13|    };
 1647|       |
 1648|     13|    return &ret;
 1649|     13|}
ossl_ec_GFp_nistp521_group_init:
 1701|     26|{
 1702|     26|    int ret;
 1703|     26|    ret = ossl_ec_GFp_simple_group_init(group);
 1704|     26|    group->a_is_minus3 = 1;
 1705|     26|    return ret;
 1706|     26|}
ossl_ec_GFp_nistp521_group_set_curve:
 1711|     13|{
 1712|     13|    int ret = 0;
 1713|     13|    BIGNUM *curve_p, *curve_a, *curve_b;
 1714|     13|#ifndef FIPS_MODULE
 1715|     13|    BN_CTX *new_ctx = NULL;
 1716|       |
 1717|     13|    if (ctx == NULL)
  ------------------
  |  Branch (1717:9): [True: 0, False: 13]
  ------------------
 1718|      0|        ctx = new_ctx = BN_CTX_new();
 1719|     13|#endif
 1720|     13|    if (ctx == NULL)
  ------------------
  |  Branch (1720:9): [True: 0, False: 13]
  ------------------
 1721|      0|        return 0;
 1722|       |
 1723|     13|    BN_CTX_start(ctx);
 1724|     13|    curve_p = BN_CTX_get(ctx);
 1725|     13|    curve_a = BN_CTX_get(ctx);
 1726|     13|    curve_b = BN_CTX_get(ctx);
 1727|     13|    if (curve_b == NULL)
  ------------------
  |  Branch (1727:9): [True: 0, False: 13]
  ------------------
 1728|      0|        goto err;
 1729|     13|    BN_bin2bn(nistp521_curve_params[0], sizeof(felem_bytearray), curve_p);
 1730|     13|    BN_bin2bn(nistp521_curve_params[1], sizeof(felem_bytearray), curve_a);
 1731|     13|    BN_bin2bn(nistp521_curve_params[2], sizeof(felem_bytearray), curve_b);
 1732|     13|    if ((BN_cmp(curve_p, p)) || (BN_cmp(curve_a, a)) || (BN_cmp(curve_b, b))) {
  ------------------
  |  Branch (1732:9): [True: 0, False: 13]
  |  Branch (1732:33): [True: 0, False: 13]
  |  Branch (1732:57): [True: 0, False: 13]
  ------------------
 1733|      0|        ERR_raise(ERR_LIB_EC, EC_R_WRONG_CURVE_PARAMETERS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1734|      0|        goto err;
 1735|      0|    }
 1736|     13|    group->field_mod_func = BN_nist_mod_521;
 1737|     13|    ret = ossl_ec_GFp_simple_group_set_curve(group, p, a, b, ctx);
 1738|     13|err:
 1739|     13|    BN_CTX_end(ctx);
 1740|     13|#ifndef FIPS_MODULE
 1741|     13|    BN_CTX_free(new_ctx);
 1742|     13|#endif
 1743|     13|    return ret;
 1744|     13|}
ossl_ec_GFp_nistp521_point_get_affine_coordinates:
 1754|     13|{
 1755|     13|    felem z1, z2, x_in, y_in, x_out, y_out;
 1756|     13|    largefelem tmp;
 1757|       |
 1758|     13|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (1758:9): [True: 0, False: 13]
  ------------------
 1759|      0|        ERR_raise(ERR_LIB_EC, EC_R_POINT_AT_INFINITY);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1760|      0|        return 0;
 1761|      0|    }
 1762|     13|    if ((!BN_to_felem(x_in, point->X)) || (!BN_to_felem(y_in, point->Y)) || (!BN_to_felem(z1, point->Z)))
  ------------------
  |  Branch (1762:9): [True: 0, False: 13]
  |  Branch (1762:43): [True: 0, False: 13]
  |  Branch (1762:77): [True: 0, False: 13]
  ------------------
 1763|      0|        return 0;
 1764|     13|    felem_inv(z2, z1);
 1765|     13|    felem_square(tmp, z2);
  ------------------
  |  |  642|     13|#define felem_square felem_square_ref
  ------------------
 1766|     13|    felem_reduce(z1, tmp);
 1767|     13|    felem_mul(tmp, x_in, z1);
  ------------------
  |  |  643|     13|#define felem_mul felem_mul_ref
  ------------------
 1768|     13|    felem_reduce(x_in, tmp);
 1769|     13|    felem_contract(x_out, x_in);
 1770|     13|    if (x != NULL) {
  ------------------
  |  Branch (1770:9): [True: 13, False: 0]
  ------------------
 1771|     13|        if (!felem_to_BN(x, x_out)) {
  ------------------
  |  Branch (1771:13): [True: 0, False: 13]
  ------------------
 1772|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1773|      0|            return 0;
 1774|      0|        }
 1775|     13|    }
 1776|     13|    felem_mul(tmp, z1, z2);
  ------------------
  |  |  643|     13|#define felem_mul felem_mul_ref
  ------------------
 1777|     13|    felem_reduce(z1, tmp);
 1778|     13|    felem_mul(tmp, y_in, z1);
  ------------------
  |  |  643|     13|#define felem_mul felem_mul_ref
  ------------------
 1779|     13|    felem_reduce(y_in, tmp);
 1780|     13|    felem_contract(y_out, y_in);
 1781|     13|    if (y != NULL) {
  ------------------
  |  Branch (1781:9): [True: 13, False: 0]
  ------------------
 1782|     13|        if (!felem_to_BN(y, y_out)) {
  ------------------
  |  Branch (1782:13): [True: 0, False: 13]
  ------------------
 1783|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1784|      0|            return 0;
 1785|      0|        }
 1786|     13|    }
 1787|     13|    return 1;
 1788|     13|}
ossl_ec_GFp_nistp521_points_mul:
 1828|     13|{
 1829|     13|    int ret = 0;
 1830|     13|    int j;
 1831|     13|    int mixed = 0;
 1832|     13|    BIGNUM *x, *y, *z, *tmp_scalar;
 1833|     13|    felem_bytearray g_secret;
 1834|     13|    felem_bytearray *secrets = NULL;
 1835|     13|    felem(*pre_comp)[17][3] = NULL;
 1836|     13|    felem *tmp_felems = NULL;
 1837|     13|    unsigned i;
 1838|     13|    int num_bytes;
 1839|     13|    int have_pre_comp = 0;
 1840|     13|    size_t num_points = num;
 1841|     13|    felem x_in, y_in, z_in, x_out, y_out, z_out;
 1842|     13|    NISTP521_PRE_COMP *pre = NULL;
 1843|     13|    felem(*g_pre_comp)[3] = NULL;
 1844|     13|    EC_POINT *generator = NULL;
 1845|     13|    const EC_POINT *p = NULL;
 1846|     13|    const BIGNUM *p_scalar = NULL;
 1847|       |
 1848|     13|    BN_CTX_start(ctx);
 1849|     13|    x = BN_CTX_get(ctx);
 1850|     13|    y = BN_CTX_get(ctx);
 1851|     13|    z = BN_CTX_get(ctx);
 1852|     13|    tmp_scalar = BN_CTX_get(ctx);
 1853|     13|    if (tmp_scalar == NULL)
  ------------------
  |  Branch (1853:9): [True: 0, False: 13]
  ------------------
 1854|      0|        goto err;
 1855|       |
 1856|     13|    if (scalar != NULL) {
  ------------------
  |  Branch (1856:9): [True: 13, False: 0]
  ------------------
 1857|     13|        pre = group->pre_comp.nistp521;
 1858|     13|        if (pre)
  ------------------
  |  Branch (1858:13): [True: 0, False: 13]
  ------------------
 1859|       |            /* we have precomputation, try to use it */
 1860|      0|            g_pre_comp = &pre->g_pre_comp[0];
 1861|     13|        else
 1862|       |            /* try to use the standard precomputation */
 1863|     13|            g_pre_comp = (felem(*)[3])gmul;
 1864|     13|        generator = EC_POINT_new(group);
 1865|     13|        if (generator == NULL)
  ------------------
  |  Branch (1865:13): [True: 0, False: 13]
  ------------------
 1866|      0|            goto err;
 1867|       |        /* get the generator from precomputation */
 1868|     13|        if (!felem_to_BN(x, g_pre_comp[1][0]) || !felem_to_BN(y, g_pre_comp[1][1]) || !felem_to_BN(z, g_pre_comp[1][2])) {
  ------------------
  |  Branch (1868:13): [True: 0, False: 13]
  |  Branch (1868:50): [True: 0, False: 13]
  |  Branch (1868:87): [True: 0, False: 13]
  ------------------
 1869|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1870|      0|            goto err;
 1871|      0|        }
 1872|     13|        if (!ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(group,
  ------------------
  |  Branch (1872:13): [True: 0, False: 13]
  ------------------
 1873|     13|                generator,
 1874|     13|                x, y, z, ctx))
 1875|      0|            goto err;
 1876|     13|        if (0 == EC_POINT_cmp(group, generator, group->generator, ctx))
  ------------------
  |  Branch (1876:13): [True: 13, False: 0]
  ------------------
 1877|       |            /* precomputation matches generator */
 1878|     13|            have_pre_comp = 1;
 1879|      0|        else
 1880|       |            /*
 1881|       |             * we don't have valid precomputation: treat the generator as a
 1882|       |             * random point
 1883|       |             */
 1884|      0|            num_points++;
 1885|     13|    }
 1886|       |
 1887|     13|    if (num_points > 0) {
  ------------------
  |  Branch (1887:9): [True: 0, False: 13]
  ------------------
 1888|      0|        if (num_points >= 2) {
  ------------------
  |  Branch (1888:13): [True: 0, False: 0]
  ------------------
 1889|       |            /*
 1890|       |             * unless we precompute multiples for just one point, converting
 1891|       |             * those into affine form is time well spent
 1892|       |             */
 1893|      0|            mixed = 1;
 1894|      0|        }
 1895|      0|        secrets = OPENSSL_calloc(num_points, sizeof(*secrets));
  ------------------
  |  |  112|      0|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1896|      0|        pre_comp = OPENSSL_calloc(num_points, sizeof(*pre_comp));
  ------------------
  |  |  112|      0|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1897|      0|        if (mixed)
  ------------------
  |  Branch (1897:13): [True: 0, False: 0]
  ------------------
 1898|      0|            tmp_felems = OPENSSL_malloc_array(num_points * 17 + 1, sizeof(*tmp_felems));
  ------------------
  |  |  110|      0|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1899|      0|        if ((secrets == NULL) || (pre_comp == NULL)
  ------------------
  |  Branch (1899:13): [True: 0, False: 0]
  |  Branch (1899:34): [True: 0, False: 0]
  ------------------
 1900|      0|            || (mixed && (tmp_felems == NULL)))
  ------------------
  |  Branch (1900:17): [True: 0, False: 0]
  |  Branch (1900:26): [True: 0, False: 0]
  ------------------
 1901|      0|            goto err;
 1902|       |
 1903|       |        /*
 1904|       |         * we treat NULL scalars as 0, and NULL points as points at infinity,
 1905|       |         * i.e., they contribute nothing to the linear combination
 1906|       |         */
 1907|      0|        for (i = 0; i < num_points; ++i) {
  ------------------
  |  Branch (1907:21): [True: 0, False: 0]
  ------------------
 1908|      0|            if (i == num) {
  ------------------
  |  Branch (1908:17): [True: 0, False: 0]
  ------------------
 1909|       |                /*
 1910|       |                 * we didn't have a valid precomputation, so we pick the
 1911|       |                 * generator
 1912|       |                 */
 1913|      0|                p = EC_GROUP_get0_generator(group);
 1914|      0|                p_scalar = scalar;
 1915|      0|            } else {
 1916|       |                /* the i^th point */
 1917|      0|                p = points[i];
 1918|      0|                p_scalar = scalars[i];
 1919|      0|            }
 1920|      0|            if ((p_scalar != NULL) && (p != NULL)) {
  ------------------
  |  Branch (1920:17): [True: 0, False: 0]
  |  Branch (1920:39): [True: 0, False: 0]
  ------------------
 1921|       |                /* reduce scalar to 0 <= scalar < 2^521 */
 1922|      0|                if ((BN_num_bits(p_scalar) > 521)
  ------------------
  |  Branch (1922:21): [True: 0, False: 0]
  ------------------
 1923|      0|                    || (BN_is_negative(p_scalar))) {
  ------------------
  |  Branch (1923:24): [True: 0, False: 0]
  ------------------
 1924|       |                    /*
 1925|       |                     * this is an unusual input, and we don't guarantee
 1926|       |                     * constant-timeness
 1927|       |                     */
 1928|      0|                    if (!BN_nnmod(tmp_scalar, p_scalar, group->order, ctx)) {
  ------------------
  |  Branch (1928:25): [True: 0, False: 0]
  ------------------
 1929|      0|                        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1930|      0|                        goto err;
 1931|      0|                    }
 1932|      0|                    num_bytes = BN_bn2lebinpad(tmp_scalar,
 1933|      0|                        secrets[i], sizeof(secrets[i]));
 1934|      0|                } else {
 1935|      0|                    num_bytes = BN_bn2lebinpad(p_scalar,
 1936|      0|                        secrets[i], sizeof(secrets[i]));
 1937|      0|                }
 1938|      0|                if (num_bytes < 0) {
  ------------------
  |  Branch (1938:21): [True: 0, False: 0]
  ------------------
 1939|      0|                    ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1940|      0|                    goto err;
 1941|      0|                }
 1942|       |                /* precompute multiples */
 1943|      0|                if ((!BN_to_felem(x_out, p->X)) || (!BN_to_felem(y_out, p->Y)) || (!BN_to_felem(z_out, p->Z)))
  ------------------
  |  Branch (1943:21): [True: 0, False: 0]
  |  Branch (1943:52): [True: 0, False: 0]
  |  Branch (1943:83): [True: 0, False: 0]
  ------------------
 1944|      0|                    goto err;
 1945|      0|                memcpy(pre_comp[i][1][0], x_out, sizeof(felem));
 1946|      0|                memcpy(pre_comp[i][1][1], y_out, sizeof(felem));
 1947|      0|                memcpy(pre_comp[i][1][2], z_out, sizeof(felem));
 1948|      0|                for (j = 2; j <= 16; ++j) {
  ------------------
  |  Branch (1948:29): [True: 0, False: 0]
  ------------------
 1949|      0|                    if (j & 1) {
  ------------------
  |  Branch (1949:25): [True: 0, False: 0]
  ------------------
 1950|      0|                        point_add(pre_comp[i][j][0], pre_comp[i][j][1],
 1951|      0|                            pre_comp[i][j][2], pre_comp[i][1][0],
 1952|      0|                            pre_comp[i][1][1], pre_comp[i][1][2], 0,
 1953|      0|                            pre_comp[i][j - 1][0],
 1954|      0|                            pre_comp[i][j - 1][1],
 1955|      0|                            pre_comp[i][j - 1][2]);
 1956|      0|                    } else {
 1957|      0|                        point_double(pre_comp[i][j][0], pre_comp[i][j][1],
 1958|      0|                            pre_comp[i][j][2], pre_comp[i][j / 2][0],
 1959|      0|                            pre_comp[i][j / 2][1],
 1960|      0|                            pre_comp[i][j / 2][2]);
 1961|      0|                    }
 1962|      0|                }
 1963|      0|            }
 1964|      0|        }
 1965|      0|        if (mixed)
  ------------------
  |  Branch (1965:13): [True: 0, False: 0]
  ------------------
 1966|      0|            make_points_affine(num_points * 17, pre_comp[0], tmp_felems);
 1967|      0|    }
 1968|       |
 1969|       |    /* the scalar for the generator */
 1970|     13|    if ((scalar != NULL) && (have_pre_comp)) {
  ------------------
  |  Branch (1970:9): [True: 13, False: 0]
  |  Branch (1970:29): [True: 13, False: 0]
  ------------------
 1971|     13|        memset(g_secret, 0, sizeof(g_secret));
 1972|       |        /* reduce scalar to 0 <= scalar < 2^521 */
 1973|     13|        if ((BN_num_bits(scalar) > 521) || (BN_is_negative(scalar))) {
  ------------------
  |  Branch (1973:13): [True: 0, False: 13]
  |  Branch (1973:44): [True: 0, False: 13]
  ------------------
 1974|       |            /*
 1975|       |             * this is an unusual input, and we don't guarantee
 1976|       |             * constant-timeness
 1977|       |             */
 1978|      0|            if (!BN_nnmod(tmp_scalar, scalar, group->order, ctx)) {
  ------------------
  |  Branch (1978:17): [True: 0, False: 0]
  ------------------
 1979|      0|                ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1980|      0|                goto err;
 1981|      0|            }
 1982|      0|            num_bytes = BN_bn2lebinpad(tmp_scalar, g_secret, sizeof(g_secret));
 1983|     13|        } else {
 1984|     13|            num_bytes = BN_bn2lebinpad(scalar, g_secret, sizeof(g_secret));
 1985|     13|        }
 1986|       |        /* do the multiplication with generator precomputation */
 1987|     13|        batch_mul(x_out, y_out, z_out,
 1988|     13|            (const felem_bytearray(*))secrets, num_points,
 1989|     13|            g_secret,
 1990|     13|            mixed, (const felem(*)[17][3])pre_comp,
 1991|     13|            (const felem(*)[3])g_pre_comp);
 1992|     13|    } else {
 1993|       |        /* do the multiplication without generator precomputation */
 1994|      0|        batch_mul(x_out, y_out, z_out,
 1995|      0|            (const felem_bytearray(*))secrets, num_points,
 1996|      0|            NULL, mixed, (const felem(*)[17][3])pre_comp, NULL);
 1997|      0|    }
 1998|       |    /* reduce the output to its unique minimal representation */
 1999|     13|    felem_contract(x_in, x_out);
 2000|     13|    felem_contract(y_in, y_out);
 2001|     13|    felem_contract(z_in, z_out);
 2002|     13|    if ((!felem_to_BN(x, x_in)) || (!felem_to_BN(y, y_in)) || (!felem_to_BN(z, z_in))) {
  ------------------
  |  Branch (2002:9): [True: 0, False: 13]
  |  Branch (2002:36): [True: 0, False: 13]
  |  Branch (2002:63): [True: 0, False: 13]
  ------------------
 2003|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 2004|      0|        goto err;
 2005|      0|    }
 2006|     13|    ret = ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp(group, r, x, y, z,
 2007|     13|        ctx);
 2008|       |
 2009|     13|err:
 2010|     13|    BN_CTX_end(ctx);
 2011|     13|    EC_POINT_free(generator);
 2012|     13|    OPENSSL_free(secrets);
  ------------------
  |  |  131|     13|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2013|     13|    OPENSSL_free(pre_comp);
  ------------------
  |  |  131|     13|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2014|     13|    OPENSSL_free(tmp_felems);
  ------------------
  |  |  131|     13|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2015|     13|    return ret;
 2016|     13|}
ecp_nistp521.c:BN_to_felem:
  176|     39|{
  177|     39|    felem_bytearray b_out;
  178|     39|    int num_bytes;
  179|       |
  180|     39|    if (BN_is_negative(bn)) {
  ------------------
  |  Branch (180:9): [True: 0, False: 39]
  ------------------
  181|      0|        ERR_raise(ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  182|      0|        return 0;
  183|      0|    }
  184|     39|    num_bytes = BN_bn2lebinpad(bn, b_out, sizeof(b_out));
  185|     39|    if (num_bytes < 0) {
  ------------------
  |  Branch (185:9): [True: 0, False: 39]
  ------------------
  186|      0|        ERR_raise(ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  187|      0|        return 0;
  188|      0|    }
  189|     39|    bin66_to_felem(out, b_out);
  190|     39|    return 1;
  191|     39|}
ecp_nistp521.c:bin66_to_felem:
  144|     39|{
  145|     39|    out[0] = (*((limb *)&in[0])) & bottom58bits;
  146|     39|    out[1] = (*((limb_aX *)&in[7]) >> 2) & bottom58bits;
  147|     39|    out[2] = (*((limb_aX *)&in[14]) >> 4) & bottom58bits;
  148|     39|    out[3] = (*((limb_aX *)&in[21]) >> 6) & bottom58bits;
  149|     39|    out[4] = (*((limb_aX *)&in[29])) & bottom58bits;
  150|     39|    out[5] = (*((limb_aX *)&in[36]) >> 2) & bottom58bits;
  151|     39|    out[6] = (*((limb_aX *)&in[43]) >> 4) & bottom58bits;
  152|     39|    out[7] = (*((limb_aX *)&in[50]) >> 6) & bottom58bits;
  153|     39|    out[8] = (*((limb_aX *)&in[58])) & bottom57bits;
  154|     39|}
ecp_nistp521.c:felem_inv:
  669|     13|{
  670|     13|    felem ftmp, ftmp2, ftmp3, ftmp4;
  671|     13|    largefelem tmp;
  672|     13|    unsigned i;
  673|       |
  674|     13|    felem_square(tmp, in);
  ------------------
  |  |  642|     13|#define felem_square felem_square_ref
  ------------------
  675|     13|    felem_reduce(ftmp, tmp); /* 2^1 */
  676|     13|    felem_mul(tmp, in, ftmp);
  ------------------
  |  |  643|     13|#define felem_mul felem_mul_ref
  ------------------
  677|     13|    felem_reduce(ftmp, tmp); /* 2^2 - 2^0 */
  678|     13|    felem_assign(ftmp2, ftmp);
  679|     13|    felem_square(tmp, ftmp);
  ------------------
  |  |  642|     13|#define felem_square felem_square_ref
  ------------------
  680|     13|    felem_reduce(ftmp, tmp); /* 2^3 - 2^1 */
  681|     13|    felem_mul(tmp, in, ftmp);
  ------------------
  |  |  643|     13|#define felem_mul felem_mul_ref
  ------------------
  682|     13|    felem_reduce(ftmp, tmp); /* 2^3 - 2^0 */
  683|     13|    felem_square(tmp, ftmp);
  ------------------
  |  |  642|     13|#define felem_square felem_square_ref
  ------------------
  684|     13|    felem_reduce(ftmp, tmp); /* 2^4 - 2^1 */
  685|       |
  686|     13|    felem_square(tmp, ftmp2);
  ------------------
  |  |  642|     13|#define felem_square felem_square_ref
  ------------------
  687|     13|    felem_reduce(ftmp3, tmp); /* 2^3 - 2^1 */
  688|     13|    felem_square(tmp, ftmp3);
  ------------------
  |  |  642|     13|#define felem_square felem_square_ref
  ------------------
  689|     13|    felem_reduce(ftmp3, tmp); /* 2^4 - 2^2 */
  690|     13|    felem_mul(tmp, ftmp3, ftmp2);
  ------------------
  |  |  643|     13|#define felem_mul felem_mul_ref
  ------------------
  691|     13|    felem_reduce(ftmp3, tmp); /* 2^4 - 2^0 */
  692|       |
  693|     13|    felem_assign(ftmp2, ftmp3);
  694|     13|    felem_square(tmp, ftmp3);
  ------------------
  |  |  642|     13|#define felem_square felem_square_ref
  ------------------
  695|     13|    felem_reduce(ftmp3, tmp); /* 2^5 - 2^1 */
  696|     13|    felem_square(tmp, ftmp3);
  ------------------
  |  |  642|     13|#define felem_square felem_square_ref
  ------------------
  697|     13|    felem_reduce(ftmp3, tmp); /* 2^6 - 2^2 */
  698|     13|    felem_square(tmp, ftmp3);
  ------------------
  |  |  642|     13|#define felem_square felem_square_ref
  ------------------
  699|     13|    felem_reduce(ftmp3, tmp); /* 2^7 - 2^3 */
  700|     13|    felem_square(tmp, ftmp3);
  ------------------
  |  |  642|     13|#define felem_square felem_square_ref
  ------------------
  701|     13|    felem_reduce(ftmp3, tmp); /* 2^8 - 2^4 */
  702|     13|    felem_mul(tmp, ftmp3, ftmp);
  ------------------
  |  |  643|     13|#define felem_mul felem_mul_ref
  ------------------
  703|     13|    felem_reduce(ftmp4, tmp); /* 2^8 - 2^1 */
  704|     13|    felem_square(tmp, ftmp4);
  ------------------
  |  |  642|     13|#define felem_square felem_square_ref
  ------------------
  705|     13|    felem_reduce(ftmp4, tmp); /* 2^9 - 2^2 */
  706|     13|    felem_mul(tmp, ftmp3, ftmp2);
  ------------------
  |  |  643|     13|#define felem_mul felem_mul_ref
  ------------------
  707|     13|    felem_reduce(ftmp3, tmp); /* 2^8 - 2^0 */
  708|     13|    felem_assign(ftmp2, ftmp3);
  709|       |
  710|    117|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (710:17): [True: 104, False: 13]
  ------------------
  711|    104|        felem_square(tmp, ftmp3);
  ------------------
  |  |  642|    104|#define felem_square felem_square_ref
  ------------------
  712|    104|        felem_reduce(ftmp3, tmp); /* 2^16 - 2^8 */
  713|    104|    }
  714|     13|    felem_mul(tmp, ftmp3, ftmp2);
  ------------------
  |  |  643|     13|#define felem_mul felem_mul_ref
  ------------------
  715|     13|    felem_reduce(ftmp3, tmp); /* 2^16 - 2^0 */
  716|     13|    felem_assign(ftmp2, ftmp3);
  717|       |
  718|    221|    for (i = 0; i < 16; i++) {
  ------------------
  |  Branch (718:17): [True: 208, False: 13]
  ------------------
  719|    208|        felem_square(tmp, ftmp3);
  ------------------
  |  |  642|    208|#define felem_square felem_square_ref
  ------------------
  720|    208|        felem_reduce(ftmp3, tmp); /* 2^32 - 2^16 */
  721|    208|    }
  722|     13|    felem_mul(tmp, ftmp3, ftmp2);
  ------------------
  |  |  643|     13|#define felem_mul felem_mul_ref
  ------------------
  723|     13|    felem_reduce(ftmp3, tmp); /* 2^32 - 2^0 */
  724|     13|    felem_assign(ftmp2, ftmp3);
  725|       |
  726|    429|    for (i = 0; i < 32; i++) {
  ------------------
  |  Branch (726:17): [True: 416, False: 13]
  ------------------
  727|    416|        felem_square(tmp, ftmp3);
  ------------------
  |  |  642|    416|#define felem_square felem_square_ref
  ------------------
  728|    416|        felem_reduce(ftmp3, tmp); /* 2^64 - 2^32 */
  729|    416|    }
  730|     13|    felem_mul(tmp, ftmp3, ftmp2);
  ------------------
  |  |  643|     13|#define felem_mul felem_mul_ref
  ------------------
  731|     13|    felem_reduce(ftmp3, tmp); /* 2^64 - 2^0 */
  732|     13|    felem_assign(ftmp2, ftmp3);
  733|       |
  734|    845|    for (i = 0; i < 64; i++) {
  ------------------
  |  Branch (734:17): [True: 832, False: 13]
  ------------------
  735|    832|        felem_square(tmp, ftmp3);
  ------------------
  |  |  642|    832|#define felem_square felem_square_ref
  ------------------
  736|    832|        felem_reduce(ftmp3, tmp); /* 2^128 - 2^64 */
  737|    832|    }
  738|     13|    felem_mul(tmp, ftmp3, ftmp2);
  ------------------
  |  |  643|     13|#define felem_mul felem_mul_ref
  ------------------
  739|     13|    felem_reduce(ftmp3, tmp); /* 2^128 - 2^0 */
  740|     13|    felem_assign(ftmp2, ftmp3);
  741|       |
  742|  1.67k|    for (i = 0; i < 128; i++) {
  ------------------
  |  Branch (742:17): [True: 1.66k, False: 13]
  ------------------
  743|  1.66k|        felem_square(tmp, ftmp3);
  ------------------
  |  |  642|  1.66k|#define felem_square felem_square_ref
  ------------------
  744|  1.66k|        felem_reduce(ftmp3, tmp); /* 2^256 - 2^128 */
  745|  1.66k|    }
  746|     13|    felem_mul(tmp, ftmp3, ftmp2);
  ------------------
  |  |  643|     13|#define felem_mul felem_mul_ref
  ------------------
  747|     13|    felem_reduce(ftmp3, tmp); /* 2^256 - 2^0 */
  748|     13|    felem_assign(ftmp2, ftmp3);
  749|       |
  750|  3.34k|    for (i = 0; i < 256; i++) {
  ------------------
  |  Branch (750:17): [True: 3.32k, False: 13]
  ------------------
  751|  3.32k|        felem_square(tmp, ftmp3);
  ------------------
  |  |  642|  3.32k|#define felem_square felem_square_ref
  ------------------
  752|  3.32k|        felem_reduce(ftmp3, tmp); /* 2^512 - 2^256 */
  753|  3.32k|    }
  754|     13|    felem_mul(tmp, ftmp3, ftmp2);
  ------------------
  |  |  643|     13|#define felem_mul felem_mul_ref
  ------------------
  755|     13|    felem_reduce(ftmp3, tmp); /* 2^512 - 2^0 */
  756|       |
  757|    130|    for (i = 0; i < 9; i++) {
  ------------------
  |  Branch (757:17): [True: 117, False: 13]
  ------------------
  758|    117|        felem_square(tmp, ftmp3);
  ------------------
  |  |  642|    117|#define felem_square felem_square_ref
  ------------------
  759|    117|        felem_reduce(ftmp3, tmp); /* 2^521 - 2^9 */
  760|    117|    }
  761|     13|    felem_mul(tmp, ftmp3, ftmp4);
  ------------------
  |  |  643|     13|#define felem_mul felem_mul_ref
  ------------------
  762|     13|    felem_reduce(ftmp3, tmp); /* 2^521 - 2^2 */
  763|     13|    felem_mul(tmp, ftmp3, in);
  ------------------
  |  |  643|     13|#define felem_mul felem_mul_ref
  ------------------
  764|     13|    felem_reduce(out, tmp); /* 2^521 - 3 */
  765|     13|}
ecp_nistp521.c:felem_assign:
  220|  25.5k|{
  221|  25.5k|    out[0] = in[0];
  222|  25.5k|    out[1] = in[1];
  223|  25.5k|    out[2] = in[2];
  224|  25.5k|    out[3] = in[3];
  225|  25.5k|    out[4] = in[4];
  226|  25.5k|    out[5] = in[5];
  227|  25.5k|    out[6] = in[6];
  228|  25.5k|    out[7] = in[7];
  229|  25.5k|    out[8] = in[8];
  230|  25.5k|}
ecp_nistp521.c:felem_square_ref:
  403|  20.3k|{
  404|  20.3k|    felem inx2, inx4;
  405|  20.3k|    felem_scalar(inx2, in, 2);
  406|  20.3k|    felem_scalar(inx4, in, 4);
  407|       |
  408|       |    /*-
  409|       |     * We have many cases were we want to do
  410|       |     *   in[x] * in[y] +
  411|       |     *   in[y] * in[x]
  412|       |     * This is obviously just
  413|       |     *   2 * in[x] * in[y]
  414|       |     * However, rather than do the doubling on the 128 bit result, we
  415|       |     * double one of the inputs to the multiplication by reading from
  416|       |     * |inx2|
  417|       |     */
  418|       |
  419|  20.3k|    out[0] = ((uint128_t)in[0]) * in[0];
  420|  20.3k|    out[1] = ((uint128_t)in[0]) * inx2[1];
  421|  20.3k|    out[2] = ((uint128_t)in[0]) * inx2[2] + ((uint128_t)in[1]) * in[1];
  422|  20.3k|    out[3] = ((uint128_t)in[0]) * inx2[3] + ((uint128_t)in[1]) * inx2[2];
  423|  20.3k|    out[4] = ((uint128_t)in[0]) * inx2[4] + ((uint128_t)in[1]) * inx2[3] + ((uint128_t)in[2]) * in[2];
  424|  20.3k|    out[5] = ((uint128_t)in[0]) * inx2[5] + ((uint128_t)in[1]) * inx2[4] + ((uint128_t)in[2]) * inx2[3];
  425|  20.3k|    out[6] = ((uint128_t)in[0]) * inx2[6] + ((uint128_t)in[1]) * inx2[5] + ((uint128_t)in[2]) * inx2[4] + ((uint128_t)in[3]) * in[3];
  426|  20.3k|    out[7] = ((uint128_t)in[0]) * inx2[7] + ((uint128_t)in[1]) * inx2[6] + ((uint128_t)in[2]) * inx2[5] + ((uint128_t)in[3]) * inx2[4];
  427|  20.3k|    out[8] = ((uint128_t)in[0]) * inx2[8] + ((uint128_t)in[1]) * inx2[7] + ((uint128_t)in[2]) * inx2[6] + ((uint128_t)in[3]) * inx2[5] + ((uint128_t)in[4]) * in[4];
  428|       |
  429|       |    /*
  430|       |     * The remaining limbs fall above 2^521, with the first falling at 2^522.
  431|       |     * They correspond to locations one bit up from the limbs produced above
  432|       |     * so we would have to multiply by two to align them. Again, rather than
  433|       |     * operate on the 128-bit result, we double one of the inputs to the
  434|       |     * multiplication. If we want to double for both this reason, and the
  435|       |     * reason above, then we end up multiplying by four.
  436|       |     */
  437|       |
  438|       |    /* 9 */
  439|  20.3k|    out[0] += ((uint128_t)in[1]) * inx4[8] + ((uint128_t)in[2]) * inx4[7] + ((uint128_t)in[3]) * inx4[6] + ((uint128_t)in[4]) * inx4[5];
  440|       |
  441|       |    /* 10 */
  442|  20.3k|    out[1] += ((uint128_t)in[2]) * inx4[8] + ((uint128_t)in[3]) * inx4[7] + ((uint128_t)in[4]) * inx4[6] + ((uint128_t)in[5]) * inx2[5];
  443|       |
  444|       |    /* 11 */
  445|  20.3k|    out[2] += ((uint128_t)in[3]) * inx4[8] + ((uint128_t)in[4]) * inx4[7] + ((uint128_t)in[5]) * inx4[6];
  446|       |
  447|       |    /* 12 */
  448|  20.3k|    out[3] += ((uint128_t)in[4]) * inx4[8] + ((uint128_t)in[5]) * inx4[7] + ((uint128_t)in[6]) * inx2[6];
  449|       |
  450|       |    /* 13 */
  451|  20.3k|    out[4] += ((uint128_t)in[5]) * inx4[8] + ((uint128_t)in[6]) * inx4[7];
  452|       |
  453|       |    /* 14 */
  454|  20.3k|    out[5] += ((uint128_t)in[6]) * inx4[8] + ((uint128_t)in[7]) * inx2[7];
  455|       |
  456|       |    /* 15 */
  457|  20.3k|    out[6] += ((uint128_t)in[7]) * inx4[8];
  458|       |
  459|       |    /* 16 */
  460|  20.3k|    out[7] += ((uint128_t)in[8]) * inx2[8];
  461|  20.3k|}
ecp_nistp521.c:felem_scalar:
  248|  61.1k|{
  249|  61.1k|    out[0] = in[0] * scalar;
  250|  61.1k|    out[1] = in[1] * scalar;
  251|  61.1k|    out[2] = in[2] * scalar;
  252|  61.1k|    out[3] = in[3] * scalar;
  253|  61.1k|    out[4] = in[4] * scalar;
  254|  61.1k|    out[5] = in[5] * scalar;
  255|  61.1k|    out[6] = in[6] * scalar;
  256|  61.1k|    out[7] = in[7] * scalar;
  257|  61.1k|    out[8] = in[8] * scalar;
  258|  61.1k|}
ecp_nistp521.c:felem_reduce:
  523|  35.7k|{
  524|  35.7k|    u64 overflow1, overflow2;
  525|       |
  526|  35.7k|    out[0] = ((limb)in[0]) & bottom58bits;
  527|  35.7k|    out[1] = ((limb)in[1]) & bottom58bits;
  528|  35.7k|    out[2] = ((limb)in[2]) & bottom58bits;
  529|  35.7k|    out[3] = ((limb)in[3]) & bottom58bits;
  530|  35.7k|    out[4] = ((limb)in[4]) & bottom58bits;
  531|  35.7k|    out[5] = ((limb)in[5]) & bottom58bits;
  532|  35.7k|    out[6] = ((limb)in[6]) & bottom58bits;
  533|  35.7k|    out[7] = ((limb)in[7]) & bottom58bits;
  534|  35.7k|    out[8] = ((limb)in[8]) & bottom58bits;
  535|       |
  536|       |    /* out[i] < 2^58 */
  537|       |
  538|  35.7k|    out[1] += ((limb)in[0]) >> 58;
  539|  35.7k|    out[1] += (((limb)(in[0] >> 64)) & bottom52bits) << 6;
  540|       |    /*-
  541|       |     * out[1] < 2^58 + 2^6 + 2^58
  542|       |     *        = 2^59 + 2^6
  543|       |     */
  544|  35.7k|    out[2] += ((limb)(in[0] >> 64)) >> 52;
  545|       |
  546|  35.7k|    out[2] += ((limb)in[1]) >> 58;
  547|  35.7k|    out[2] += (((limb)(in[1] >> 64)) & bottom52bits) << 6;
  548|  35.7k|    out[3] += ((limb)(in[1] >> 64)) >> 52;
  549|       |
  550|  35.7k|    out[3] += ((limb)in[2]) >> 58;
  551|  35.7k|    out[3] += (((limb)(in[2] >> 64)) & bottom52bits) << 6;
  552|  35.7k|    out[4] += ((limb)(in[2] >> 64)) >> 52;
  553|       |
  554|  35.7k|    out[4] += ((limb)in[3]) >> 58;
  555|  35.7k|    out[4] += (((limb)(in[3] >> 64)) & bottom52bits) << 6;
  556|  35.7k|    out[5] += ((limb)(in[3] >> 64)) >> 52;
  557|       |
  558|  35.7k|    out[5] += ((limb)in[4]) >> 58;
  559|  35.7k|    out[5] += (((limb)(in[4] >> 64)) & bottom52bits) << 6;
  560|  35.7k|    out[6] += ((limb)(in[4] >> 64)) >> 52;
  561|       |
  562|  35.7k|    out[6] += ((limb)in[5]) >> 58;
  563|  35.7k|    out[6] += (((limb)(in[5] >> 64)) & bottom52bits) << 6;
  564|  35.7k|    out[7] += ((limb)(in[5] >> 64)) >> 52;
  565|       |
  566|  35.7k|    out[7] += ((limb)in[6]) >> 58;
  567|  35.7k|    out[7] += (((limb)(in[6] >> 64)) & bottom52bits) << 6;
  568|  35.7k|    out[8] += ((limb)(in[6] >> 64)) >> 52;
  569|       |
  570|  35.7k|    out[8] += ((limb)in[7]) >> 58;
  571|  35.7k|    out[8] += (((limb)(in[7] >> 64)) & bottom52bits) << 6;
  572|       |    /*-
  573|       |     * out[x > 1] < 2^58 + 2^6 + 2^58 + 2^12
  574|       |     *            < 2^59 + 2^13
  575|       |     */
  576|  35.7k|    overflow1 = ((limb)(in[7] >> 64)) >> 52;
  577|       |
  578|  35.7k|    overflow1 += ((limb)in[8]) >> 58;
  579|  35.7k|    overflow1 += (((limb)(in[8] >> 64)) & bottom52bits) << 6;
  580|  35.7k|    overflow2 = ((limb)(in[8] >> 64)) >> 52;
  581|       |
  582|  35.7k|    overflow1 <<= 1; /* overflow1 < 2^13 + 2^7 + 2^59 */
  583|  35.7k|    overflow2 <<= 1; /* overflow2 < 2^13 */
  584|       |
  585|  35.7k|    out[0] += overflow1; /* out[0] < 2^60 */
  586|  35.7k|    out[1] += overflow2; /* out[1] < 2^59 + 2^6 + 2^13 */
  587|       |
  588|  35.7k|    out[1] += out[0] >> 58;
  589|  35.7k|    out[0] &= bottom58bits;
  590|       |    /*-
  591|       |     * out[0] < 2^58
  592|       |     * out[1] < 2^59 + 2^6 + 2^13 + 2^2
  593|       |     *        < 2^59 + 2^14
  594|       |     */
  595|  35.7k|}
ecp_nistp521.c:felem_mul_ref:
  472|  18.7k|{
  473|  18.7k|    felem in2x2;
  474|  18.7k|    felem_scalar(in2x2, in2, 2);
  475|       |
  476|  18.7k|    out[0] = ((uint128_t)in1[0]) * in2[0];
  477|       |
  478|  18.7k|    out[1] = ((uint128_t)in1[0]) * in2[1] + ((uint128_t)in1[1]) * in2[0];
  479|       |
  480|  18.7k|    out[2] = ((uint128_t)in1[0]) * in2[2] + ((uint128_t)in1[1]) * in2[1] + ((uint128_t)in1[2]) * in2[0];
  481|       |
  482|  18.7k|    out[3] = ((uint128_t)in1[0]) * in2[3] + ((uint128_t)in1[1]) * in2[2] + ((uint128_t)in1[2]) * in2[1] + ((uint128_t)in1[3]) * in2[0];
  483|       |
  484|  18.7k|    out[4] = ((uint128_t)in1[0]) * in2[4] + ((uint128_t)in1[1]) * in2[3] + ((uint128_t)in1[2]) * in2[2] + ((uint128_t)in1[3]) * in2[1] + ((uint128_t)in1[4]) * in2[0];
  485|       |
  486|  18.7k|    out[5] = ((uint128_t)in1[0]) * in2[5] + ((uint128_t)in1[1]) * in2[4] + ((uint128_t)in1[2]) * in2[3] + ((uint128_t)in1[3]) * in2[2] + ((uint128_t)in1[4]) * in2[1] + ((uint128_t)in1[5]) * in2[0];
  487|       |
  488|  18.7k|    out[6] = ((uint128_t)in1[0]) * in2[6] + ((uint128_t)in1[1]) * in2[5] + ((uint128_t)in1[2]) * in2[4] + ((uint128_t)in1[3]) * in2[3] + ((uint128_t)in1[4]) * in2[2] + ((uint128_t)in1[5]) * in2[1] + ((uint128_t)in1[6]) * in2[0];
  489|       |
  490|  18.7k|    out[7] = ((uint128_t)in1[0]) * in2[7] + ((uint128_t)in1[1]) * in2[6] + ((uint128_t)in1[2]) * in2[5] + ((uint128_t)in1[3]) * in2[4] + ((uint128_t)in1[4]) * in2[3] + ((uint128_t)in1[5]) * in2[2] + ((uint128_t)in1[6]) * in2[1] + ((uint128_t)in1[7]) * in2[0];
  491|       |
  492|  18.7k|    out[8] = ((uint128_t)in1[0]) * in2[8] + ((uint128_t)in1[1]) * in2[7] + ((uint128_t)in1[2]) * in2[6] + ((uint128_t)in1[3]) * in2[5] + ((uint128_t)in1[4]) * in2[4] + ((uint128_t)in1[5]) * in2[3] + ((uint128_t)in1[6]) * in2[2] + ((uint128_t)in1[7]) * in2[1] + ((uint128_t)in1[8]) * in2[0];
  493|       |
  494|       |    /* See comment in felem_square about the use of in2x2 here */
  495|       |
  496|  18.7k|    out[0] += ((uint128_t)in1[1]) * in2x2[8] + ((uint128_t)in1[2]) * in2x2[7] + ((uint128_t)in1[3]) * in2x2[6] + ((uint128_t)in1[4]) * in2x2[5] + ((uint128_t)in1[5]) * in2x2[4] + ((uint128_t)in1[6]) * in2x2[3] + ((uint128_t)in1[7]) * in2x2[2] + ((uint128_t)in1[8]) * in2x2[1];
  497|       |
  498|  18.7k|    out[1] += ((uint128_t)in1[2]) * in2x2[8] + ((uint128_t)in1[3]) * in2x2[7] + ((uint128_t)in1[4]) * in2x2[6] + ((uint128_t)in1[5]) * in2x2[5] + ((uint128_t)in1[6]) * in2x2[4] + ((uint128_t)in1[7]) * in2x2[3] + ((uint128_t)in1[8]) * in2x2[2];
  499|       |
  500|  18.7k|    out[2] += ((uint128_t)in1[3]) * in2x2[8] + ((uint128_t)in1[4]) * in2x2[7] + ((uint128_t)in1[5]) * in2x2[6] + ((uint128_t)in1[6]) * in2x2[5] + ((uint128_t)in1[7]) * in2x2[4] + ((uint128_t)in1[8]) * in2x2[3];
  501|       |
  502|  18.7k|    out[3] += ((uint128_t)in1[4]) * in2x2[8] + ((uint128_t)in1[5]) * in2x2[7] + ((uint128_t)in1[6]) * in2x2[6] + ((uint128_t)in1[7]) * in2x2[5] + ((uint128_t)in1[8]) * in2x2[4];
  503|       |
  504|  18.7k|    out[4] += ((uint128_t)in1[5]) * in2x2[8] + ((uint128_t)in1[6]) * in2x2[7] + ((uint128_t)in1[7]) * in2x2[6] + ((uint128_t)in1[8]) * in2x2[5];
  505|       |
  506|  18.7k|    out[5] += ((uint128_t)in1[6]) * in2x2[8] + ((uint128_t)in1[7]) * in2x2[7] + ((uint128_t)in1[8]) * in2x2[6];
  507|       |
  508|  18.7k|    out[6] += ((uint128_t)in1[7]) * in2x2[8] + ((uint128_t)in1[8]) * in2x2[7];
  509|       |
  510|  18.7k|    out[7] += ((uint128_t)in1[8]) * in2x2[8];
  511|  18.7k|}
ecp_nistp521.c:felem_contract:
  859|     65|{
  860|     65|    limb is_p, is_greater, sign;
  861|     65|    static const limb two58 = ((limb)1) << 58;
  862|       |
  863|     65|    felem_assign(out, in);
  864|       |
  865|     65|    out[0] += out[8] >> 57;
  866|     65|    out[8] &= bottom57bits;
  867|       |    /* out[8] < 2^57 */
  868|     65|    out[1] += out[0] >> 58;
  869|     65|    out[0] &= bottom58bits;
  870|     65|    out[2] += out[1] >> 58;
  871|     65|    out[1] &= bottom58bits;
  872|     65|    out[3] += out[2] >> 58;
  873|     65|    out[2] &= bottom58bits;
  874|     65|    out[4] += out[3] >> 58;
  875|     65|    out[3] &= bottom58bits;
  876|     65|    out[5] += out[4] >> 58;
  877|     65|    out[4] &= bottom58bits;
  878|     65|    out[6] += out[5] >> 58;
  879|     65|    out[5] &= bottom58bits;
  880|     65|    out[7] += out[6] >> 58;
  881|     65|    out[6] &= bottom58bits;
  882|     65|    out[8] += out[7] >> 58;
  883|     65|    out[7] &= bottom58bits;
  884|       |    /* out[8] < 2^57 + 4 */
  885|       |
  886|       |    /*
  887|       |     * If the value is greater than 2^521-1 then we have to subtract 2^521-1
  888|       |     * out. See the comments in felem_is_zero regarding why we don't test for
  889|       |     * other multiples of the prime.
  890|       |     */
  891|       |
  892|       |    /*
  893|       |     * First, if |out| is equal to 2^521-1, we subtract it out to get zero.
  894|       |     */
  895|       |
  896|     65|    is_p = out[0] ^ kPrime[0];
  897|     65|    is_p |= out[1] ^ kPrime[1];
  898|     65|    is_p |= out[2] ^ kPrime[2];
  899|     65|    is_p |= out[3] ^ kPrime[3];
  900|     65|    is_p |= out[4] ^ kPrime[4];
  901|     65|    is_p |= out[5] ^ kPrime[5];
  902|     65|    is_p |= out[6] ^ kPrime[6];
  903|     65|    is_p |= out[7] ^ kPrime[7];
  904|     65|    is_p |= out[8] ^ kPrime[8];
  905|       |
  906|     65|    is_p--;
  907|     65|    is_p &= is_p << 32;
  908|     65|    is_p &= is_p << 16;
  909|     65|    is_p &= is_p << 8;
  910|     65|    is_p &= is_p << 4;
  911|     65|    is_p &= is_p << 2;
  912|     65|    is_p &= is_p << 1;
  913|     65|    is_p = 0 - (is_p >> 63);
  914|     65|    is_p = ~is_p;
  915|       |
  916|       |    /* is_p is 0 iff |out| == 2^521-1 and all ones otherwise */
  917|       |
  918|     65|    out[0] &= is_p;
  919|     65|    out[1] &= is_p;
  920|     65|    out[2] &= is_p;
  921|     65|    out[3] &= is_p;
  922|     65|    out[4] &= is_p;
  923|     65|    out[5] &= is_p;
  924|     65|    out[6] &= is_p;
  925|     65|    out[7] &= is_p;
  926|     65|    out[8] &= is_p;
  927|       |
  928|       |    /*
  929|       |     * In order to test that |out| >= 2^521-1 we need only test if out[8] >>
  930|       |     * 57 is greater than zero as (2^521-1) + x >= 2^522
  931|       |     */
  932|     65|    is_greater = out[8] >> 57;
  933|     65|    is_greater |= is_greater << 32;
  934|     65|    is_greater |= is_greater << 16;
  935|     65|    is_greater |= is_greater << 8;
  936|     65|    is_greater |= is_greater << 4;
  937|     65|    is_greater |= is_greater << 2;
  938|     65|    is_greater |= is_greater << 1;
  939|     65|    is_greater = 0 - (is_greater >> 63);
  940|       |
  941|     65|    out[0] -= kPrime[0] & is_greater;
  942|     65|    out[1] -= kPrime[1] & is_greater;
  943|     65|    out[2] -= kPrime[2] & is_greater;
  944|     65|    out[3] -= kPrime[3] & is_greater;
  945|     65|    out[4] -= kPrime[4] & is_greater;
  946|     65|    out[5] -= kPrime[5] & is_greater;
  947|     65|    out[6] -= kPrime[6] & is_greater;
  948|     65|    out[7] -= kPrime[7] & is_greater;
  949|     65|    out[8] -= kPrime[8] & is_greater;
  950|       |
  951|       |    /* Eliminate negative coefficients */
  952|     65|    sign = -(out[0] >> 63);
  953|     65|    out[0] += (two58 & sign);
  954|     65|    out[1] -= (1 & sign);
  955|     65|    sign = -(out[1] >> 63);
  956|     65|    out[1] += (two58 & sign);
  957|     65|    out[2] -= (1 & sign);
  958|     65|    sign = -(out[2] >> 63);
  959|     65|    out[2] += (two58 & sign);
  960|     65|    out[3] -= (1 & sign);
  961|     65|    sign = -(out[3] >> 63);
  962|     65|    out[3] += (two58 & sign);
  963|     65|    out[4] -= (1 & sign);
  964|     65|    sign = -(out[4] >> 63);
  965|     65|    out[4] += (two58 & sign);
  966|     65|    out[5] -= (1 & sign);
  967|     65|    sign = -(out[0] >> 63);
  968|     65|    out[5] += (two58 & sign);
  969|     65|    out[6] -= (1 & sign);
  970|     65|    sign = -(out[6] >> 63);
  971|     65|    out[6] += (two58 & sign);
  972|     65|    out[7] -= (1 & sign);
  973|     65|    sign = -(out[7] >> 63);
  974|     65|    out[7] += (two58 & sign);
  975|     65|    out[8] -= (1 & sign);
  976|     65|    sign = -(out[5] >> 63);
  977|     65|    out[5] += (two58 & sign);
  978|     65|    out[6] -= (1 & sign);
  979|     65|    sign = -(out[6] >> 63);
  980|     65|    out[6] += (two58 & sign);
  981|     65|    out[7] -= (1 & sign);
  982|     65|    sign = -(out[7] >> 63);
  983|     65|    out[7] += (two58 & sign);
  984|     65|    out[8] -= (1 & sign);
  985|     65|}
ecp_nistp521.c:felem_to_BN:
  195|    104|{
  196|    104|    felem_bytearray b_out;
  197|    104|    felem_to_bin66(b_out, in);
  198|    104|    return BN_lebin2bn(b_out, sizeof(b_out), out);
  199|    104|}
ecp_nistp521.c:felem_to_bin66:
  161|    104|{
  162|    104|    memset(out, 0, 66);
  163|    104|    (*((limb *)&out[0])) = in[0];
  164|    104|    (*((limb_aX *)&out[7])) |= in[1] << 2;
  165|    104|    (*((limb_aX *)&out[14])) |= in[2] << 4;
  166|    104|    (*((limb_aX *)&out[21])) |= in[3] << 6;
  167|    104|    (*((limb_aX *)&out[29])) = in[4];
  168|    104|    (*((limb_aX *)&out[36])) |= in[5] << 2;
  169|    104|    (*((limb_aX *)&out[43])) |= in[6] << 4;
  170|    104|    (*((limb_aX *)&out[50])) |= in[7] << 6;
  171|    104|    (*((limb_aX *)&out[58])) = in[8];
  172|    104|}
ecp_nistp521.c:point_add:
 1126|  1.69k|{
 1127|  1.69k|    felem ftmp, ftmp2, ftmp3, ftmp4, ftmp5, ftmp6, x_out, y_out, z_out;
 1128|  1.69k|    largefelem tmp, tmp2;
 1129|  1.69k|    limb x_equal, y_equal, z1_is_zero, z2_is_zero;
 1130|  1.69k|    limb points_equal;
 1131|       |
 1132|  1.69k|    z1_is_zero = felem_is_zero(z1);
 1133|  1.69k|    z2_is_zero = felem_is_zero(z2);
 1134|       |
 1135|       |    /* ftmp = z1z1 = z1**2 */
 1136|  1.69k|    felem_square(tmp, z1);
  ------------------
  |  |  642|  1.69k|#define felem_square felem_square_ref
  ------------------
 1137|  1.69k|    felem_reduce(ftmp, tmp);
 1138|       |
 1139|  1.69k|    if (!mixed) {
  ------------------
  |  Branch (1139:9): [True: 0, False: 1.69k]
  ------------------
 1140|       |        /* ftmp2 = z2z2 = z2**2 */
 1141|      0|        felem_square(tmp, z2);
  ------------------
  |  |  642|      0|#define felem_square felem_square_ref
  ------------------
 1142|      0|        felem_reduce(ftmp2, tmp);
 1143|       |
 1144|       |        /* u1 = ftmp3 = x1*z2z2 */
 1145|      0|        felem_mul(tmp, x1, ftmp2);
  ------------------
  |  |  643|      0|#define felem_mul felem_mul_ref
  ------------------
 1146|      0|        felem_reduce(ftmp3, tmp);
 1147|       |
 1148|       |        /* ftmp5 = z1 + z2 */
 1149|      0|        felem_assign(ftmp5, z1);
 1150|      0|        felem_sum64(ftmp5, z2);
 1151|       |        /* ftmp5[i] < 2^61 */
 1152|       |
 1153|       |        /* ftmp5 = (z1 + z2)**2 - z1z1 - z2z2 = 2*z1z2 */
 1154|      0|        felem_square(tmp, ftmp5);
  ------------------
  |  |  642|      0|#define felem_square felem_square_ref
  ------------------
 1155|       |        /* tmp[i] < 17*2^122 */
 1156|      0|        felem_diff_128_64(tmp, ftmp);
 1157|       |        /* tmp[i] < 17*2^122 + 2^63 */
 1158|      0|        felem_diff_128_64(tmp, ftmp2);
 1159|       |        /* tmp[i] < 17*2^122 + 2^64 */
 1160|      0|        felem_reduce(ftmp5, tmp);
 1161|       |
 1162|       |        /* ftmp2 = z2 * z2z2 */
 1163|      0|        felem_mul(tmp, ftmp2, z2);
  ------------------
  |  |  643|      0|#define felem_mul felem_mul_ref
  ------------------
 1164|      0|        felem_reduce(ftmp2, tmp);
 1165|       |
 1166|       |        /* s1 = ftmp6 = y1 * z2**3 */
 1167|      0|        felem_mul(tmp, y1, ftmp2);
  ------------------
  |  |  643|      0|#define felem_mul felem_mul_ref
  ------------------
 1168|      0|        felem_reduce(ftmp6, tmp);
 1169|  1.69k|    } else {
 1170|       |        /*
 1171|       |         * We'll assume z2 = 1 (special case z2 = 0 is handled later)
 1172|       |         */
 1173|       |
 1174|       |        /* u1 = ftmp3 = x1*z2z2 */
 1175|  1.69k|        felem_assign(ftmp3, x1);
 1176|       |
 1177|       |        /* ftmp5 = 2*z1z2 */
 1178|  1.69k|        felem_scalar(ftmp5, z1, 2);
 1179|       |
 1180|       |        /* s1 = ftmp6 = y1 * z2**3 */
 1181|  1.69k|        felem_assign(ftmp6, y1);
 1182|  1.69k|    }
 1183|       |
 1184|       |    /* u2 = x2*z1z1 */
 1185|  1.69k|    felem_mul(tmp, x2, ftmp);
  ------------------
  |  |  643|  1.69k|#define felem_mul felem_mul_ref
  ------------------
 1186|       |    /* tmp[i] < 17*2^120 */
 1187|       |
 1188|       |    /* h = ftmp4 = u2 - u1 */
 1189|  1.69k|    felem_diff_128_64(tmp, ftmp3);
 1190|       |    /* tmp[i] < 17*2^120 + 2^63 */
 1191|  1.69k|    felem_reduce(ftmp4, tmp);
 1192|       |
 1193|  1.69k|    x_equal = felem_is_zero(ftmp4);
 1194|       |
 1195|       |    /* z_out = ftmp5 * h */
 1196|  1.69k|    felem_mul(tmp, ftmp5, ftmp4);
  ------------------
  |  |  643|  1.69k|#define felem_mul felem_mul_ref
  ------------------
 1197|  1.69k|    felem_reduce(z_out, tmp);
 1198|       |
 1199|       |    /* ftmp = z1 * z1z1 */
 1200|  1.69k|    felem_mul(tmp, ftmp, z1);
  ------------------
  |  |  643|  1.69k|#define felem_mul felem_mul_ref
  ------------------
 1201|  1.69k|    felem_reduce(ftmp, tmp);
 1202|       |
 1203|       |    /* s2 = tmp = y2 * z1**3 */
 1204|  1.69k|    felem_mul(tmp, y2, ftmp);
  ------------------
  |  |  643|  1.69k|#define felem_mul felem_mul_ref
  ------------------
 1205|       |    /* tmp[i] < 17*2^120 */
 1206|       |
 1207|       |    /* r = ftmp5 = (s2 - s1)*2 */
 1208|  1.69k|    felem_diff_128_64(tmp, ftmp6);
 1209|       |    /* tmp[i] < 17*2^120 + 2^63 */
 1210|  1.69k|    felem_reduce(ftmp5, tmp);
 1211|  1.69k|    y_equal = felem_is_zero(ftmp5);
 1212|  1.69k|    felem_scalar64(ftmp5, 2);
 1213|       |    /* ftmp5[i] < 2^61 */
 1214|       |
 1215|       |    /*
 1216|       |     * The formulae are incorrect if the points are equal, in affine coordinates
 1217|       |     * (X_1, Y_1) == (X_2, Y_2), so we check for this and do doubling if this
 1218|       |     * happens.
 1219|       |     *
 1220|       |     * We use bitwise operations to avoid potential side-channels introduced by
 1221|       |     * the short-circuiting behaviour of boolean operators.
 1222|       |     *
 1223|       |     * The special case of either point being the point at infinity (z1 and/or
 1224|       |     * z2 are zero), is handled separately later on in this function, so we
 1225|       |     * avoid jumping to point_double here in those special cases.
 1226|       |     *
 1227|       |     * Notice the comment below on the implications of this branching for timing
 1228|       |     * leaks and why it is considered practically irrelevant.
 1229|       |     */
 1230|  1.69k|    points_equal = (x_equal & y_equal & (~z1_is_zero) & (~z2_is_zero));
 1231|       |
 1232|  1.69k|    if (points_equal) {
  ------------------
  |  Branch (1232:9): [True: 0, False: 1.69k]
  ------------------
 1233|       |        /*
 1234|       |         * This is obviously not constant-time but it will almost-never happen
 1235|       |         * for ECDH / ECDSA. The case where it can happen is during scalar-mult
 1236|       |         * where the intermediate value gets very close to the group order.
 1237|       |         * Since |ossl_ec_GFp_nistp_recode_scalar_bits| produces signed digits
 1238|       |         * for the scalar, it's possible for the intermediate value to be a small
 1239|       |         * negative multiple of the base point, and for the final signed digit
 1240|       |         * to be the same value. We believe that this only occurs for the scalar
 1241|       |         * 1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
 1242|       |         * ffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb
 1243|       |         * 71e913863f7, in that case the penultimate intermediate is -9G and
 1244|       |         * the final digit is also -9G. Since this only happens for a single
 1245|       |         * scalar, the timing leak is irrelevant. (Any attacker who wanted to
 1246|       |         * check whether a secret scalar was that exact value, can already do
 1247|       |         * so.)
 1248|       |         */
 1249|      0|        point_double(x3, y3, z3, x1, y1, z1);
 1250|      0|        return;
 1251|      0|    }
 1252|       |
 1253|       |    /* I = ftmp = (2h)**2 */
 1254|  1.69k|    felem_assign(ftmp, ftmp4);
 1255|  1.69k|    felem_scalar64(ftmp, 2);
 1256|       |    /* ftmp[i] < 2^61 */
 1257|  1.69k|    felem_square(tmp, ftmp);
  ------------------
  |  |  642|  1.69k|#define felem_square felem_square_ref
  ------------------
 1258|       |    /* tmp[i] < 17*2^122 */
 1259|  1.69k|    felem_reduce(ftmp, tmp);
 1260|       |
 1261|       |    /* J = ftmp2 = h * I */
 1262|  1.69k|    felem_mul(tmp, ftmp4, ftmp);
  ------------------
  |  |  643|  1.69k|#define felem_mul felem_mul_ref
  ------------------
 1263|  1.69k|    felem_reduce(ftmp2, tmp);
 1264|       |
 1265|       |    /* V = ftmp4 = U1 * I */
 1266|  1.69k|    felem_mul(tmp, ftmp3, ftmp);
  ------------------
  |  |  643|  1.69k|#define felem_mul felem_mul_ref
  ------------------
 1267|  1.69k|    felem_reduce(ftmp4, tmp);
 1268|       |
 1269|       |    /* x_out = r**2 - J - 2V */
 1270|  1.69k|    felem_square(tmp, ftmp5);
  ------------------
  |  |  642|  1.69k|#define felem_square felem_square_ref
  ------------------
 1271|       |    /* tmp[i] < 17*2^122 */
 1272|  1.69k|    felem_diff_128_64(tmp, ftmp2);
 1273|       |    /* tmp[i] < 17*2^122 + 2^63 */
 1274|  1.69k|    felem_assign(ftmp3, ftmp4);
 1275|  1.69k|    felem_scalar64(ftmp4, 2);
 1276|       |    /* ftmp4[i] < 2^61 */
 1277|  1.69k|    felem_diff_128_64(tmp, ftmp4);
 1278|       |    /* tmp[i] < 17*2^122 + 2^64 */
 1279|  1.69k|    felem_reduce(x_out, tmp);
 1280|       |
 1281|       |    /* y_out = r(V-x_out) - 2 * s1 * J */
 1282|  1.69k|    felem_diff64(ftmp3, x_out);
 1283|       |    /*
 1284|       |     * ftmp3[i] < 2^60 + 2^60 = 2^61
 1285|       |     */
 1286|  1.69k|    felem_mul(tmp, ftmp5, ftmp3);
  ------------------
  |  |  643|  1.69k|#define felem_mul felem_mul_ref
  ------------------
 1287|       |    /* tmp[i] < 17*2^122 */
 1288|  1.69k|    felem_mul(tmp2, ftmp6, ftmp2);
  ------------------
  |  |  643|  1.69k|#define felem_mul felem_mul_ref
  ------------------
 1289|       |    /* tmp2[i] < 17*2^120 */
 1290|  1.69k|    felem_scalar128(tmp2, 2);
 1291|       |    /* tmp2[i] < 17*2^121 */
 1292|  1.69k|    felem_diff128(tmp, tmp2);
 1293|       |    /*-
 1294|       |     * tmp[i] < 2^127 - 2^69 + 17*2^122
 1295|       |     *        = 2^126 - 2^122 - 2^6 - 2^2 - 1
 1296|       |     *        < 2^127
 1297|       |     */
 1298|  1.69k|    felem_reduce(y_out, tmp);
 1299|       |
 1300|  1.69k|    copy_conditional(x_out, x2, z1_is_zero);
 1301|  1.69k|    copy_conditional(x_out, x1, z2_is_zero);
 1302|  1.69k|    copy_conditional(y_out, y2, z1_is_zero);
 1303|  1.69k|    copy_conditional(y_out, y1, z2_is_zero);
 1304|  1.69k|    copy_conditional(z_out, z2, z1_is_zero);
 1305|  1.69k|    copy_conditional(z_out, z1, z2_is_zero);
 1306|  1.69k|    felem_assign(x3, x_out);
 1307|  1.69k|    felem_assign(y3, y_out);
 1308|  1.69k|    felem_assign(z3, z_out);
 1309|  1.69k|}
ecp_nistp521.c:felem_is_zero:
  781|  6.76k|{
  782|  6.76k|    felem ftmp;
  783|  6.76k|    limb is_zero, is_p;
  784|  6.76k|    felem_assign(ftmp, in);
  785|       |
  786|  6.76k|    ftmp[0] += ftmp[8] >> 57;
  787|  6.76k|    ftmp[8] &= bottom57bits;
  788|       |    /* ftmp[8] < 2^57 */
  789|  6.76k|    ftmp[1] += ftmp[0] >> 58;
  790|  6.76k|    ftmp[0] &= bottom58bits;
  791|  6.76k|    ftmp[2] += ftmp[1] >> 58;
  792|  6.76k|    ftmp[1] &= bottom58bits;
  793|  6.76k|    ftmp[3] += ftmp[2] >> 58;
  794|  6.76k|    ftmp[2] &= bottom58bits;
  795|  6.76k|    ftmp[4] += ftmp[3] >> 58;
  796|  6.76k|    ftmp[3] &= bottom58bits;
  797|  6.76k|    ftmp[5] += ftmp[4] >> 58;
  798|  6.76k|    ftmp[4] &= bottom58bits;
  799|  6.76k|    ftmp[6] += ftmp[5] >> 58;
  800|  6.76k|    ftmp[5] &= bottom58bits;
  801|  6.76k|    ftmp[7] += ftmp[6] >> 58;
  802|  6.76k|    ftmp[6] &= bottom58bits;
  803|  6.76k|    ftmp[8] += ftmp[7] >> 58;
  804|  6.76k|    ftmp[7] &= bottom58bits;
  805|       |    /* ftmp[8] < 2^57 + 4 */
  806|       |
  807|       |    /*
  808|       |     * The ninth limb of 2*(2^521-1) is 0x03ffffffffffffff, which is greater
  809|       |     * than our bound for ftmp[8]. Therefore we only have to check if the
  810|       |     * zero is zero or 2^521-1.
  811|       |     */
  812|       |
  813|  6.76k|    is_zero = 0;
  814|  6.76k|    is_zero |= ftmp[0];
  815|  6.76k|    is_zero |= ftmp[1];
  816|  6.76k|    is_zero |= ftmp[2];
  817|  6.76k|    is_zero |= ftmp[3];
  818|  6.76k|    is_zero |= ftmp[4];
  819|  6.76k|    is_zero |= ftmp[5];
  820|  6.76k|    is_zero |= ftmp[6];
  821|  6.76k|    is_zero |= ftmp[7];
  822|  6.76k|    is_zero |= ftmp[8];
  823|       |
  824|  6.76k|    is_zero--;
  825|       |    /*
  826|       |     * We know that ftmp[i] < 2^63, therefore the only way that the top bit
  827|       |     * can be set is if is_zero was 0 before the decrement.
  828|       |     */
  829|  6.76k|    is_zero = 0 - (is_zero >> 63);
  830|       |
  831|  6.76k|    is_p = ftmp[0] ^ kPrime[0];
  832|  6.76k|    is_p |= ftmp[1] ^ kPrime[1];
  833|  6.76k|    is_p |= ftmp[2] ^ kPrime[2];
  834|  6.76k|    is_p |= ftmp[3] ^ kPrime[3];
  835|  6.76k|    is_p |= ftmp[4] ^ kPrime[4];
  836|  6.76k|    is_p |= ftmp[5] ^ kPrime[5];
  837|  6.76k|    is_p |= ftmp[6] ^ kPrime[6];
  838|  6.76k|    is_p |= ftmp[7] ^ kPrime[7];
  839|  6.76k|    is_p |= ftmp[8] ^ kPrime[8];
  840|       |
  841|  6.76k|    is_p--;
  842|  6.76k|    is_p = 0 - (is_p >> 63);
  843|       |
  844|  6.76k|    is_zero |= is_p;
  845|  6.76k|    return is_zero;
  846|  6.76k|}
ecp_nistp521.c:felem_sum64:
  234|  5.07k|{
  235|  5.07k|    out[0] += in[0];
  236|  5.07k|    out[1] += in[1];
  237|  5.07k|    out[2] += in[2];
  238|  5.07k|    out[3] += in[3];
  239|  5.07k|    out[4] += in[4];
  240|  5.07k|    out[5] += in[5];
  241|  5.07k|    out[6] += in[6];
  242|  5.07k|    out[7] += in[7];
  243|  5.07k|    out[8] += in[8];
  244|  5.07k|}
ecp_nistp521.c:felem_diff_128_64:
  346|  10.1k|{
  347|       |    /*
  348|       |     * In order to prevent underflow, we add 64p mod p (which is equivalent
  349|       |     * to 0 mod p) before subtracting. p is 2^521 - 1, i.e. in binary a 521
  350|       |     * digit number with all bits set to 1. See "The representation of field
  351|       |     * elements" comment above for a description of how limbs are used to
  352|       |     * represent a number. 64p is represented with 8 limbs containing a number
  353|       |     * with 58 bits set and one limb with a number with 57 bits set.
  354|       |     */
  355|  10.1k|    static const limb two63m6 = (((limb)1) << 63) - (((limb)1) << 6);
  356|  10.1k|    static const limb two63m5 = (((limb)1) << 63) - (((limb)1) << 5);
  357|       |
  358|  10.1k|    out[0] += two63m6 - in[0];
  359|  10.1k|    out[1] += two63m5 - in[1];
  360|  10.1k|    out[2] += two63m5 - in[2];
  361|  10.1k|    out[3] += two63m5 - in[3];
  362|  10.1k|    out[4] += two63m5 - in[4];
  363|  10.1k|    out[5] += two63m5 - in[5];
  364|  10.1k|    out[6] += two63m5 - in[6];
  365|  10.1k|    out[7] += two63m5 - in[7];
  366|  10.1k|    out[8] += two63m5 - in[8];
  367|  10.1k|}
ecp_nistp521.c:felem_scalar64:
  262|  10.1k|{
  263|  10.1k|    out[0] *= scalar;
  264|  10.1k|    out[1] *= scalar;
  265|  10.1k|    out[2] *= scalar;
  266|  10.1k|    out[3] *= scalar;
  267|  10.1k|    out[4] *= scalar;
  268|  10.1k|    out[5] *= scalar;
  269|  10.1k|    out[6] *= scalar;
  270|  10.1k|    out[7] *= scalar;
  271|  10.1k|    out[8] *= scalar;
  272|  10.1k|}
ecp_nistp521.c:felem_diff64:
  320|  5.07k|{
  321|       |    /*
  322|       |     * In order to prevent underflow, we add 0 mod p before subtracting.
  323|       |     */
  324|  5.07k|    static const limb two62m3 = (((limb)1) << 62) - (((limb)1) << 5);
  325|  5.07k|    static const limb two62m2 = (((limb)1) << 62) - (((limb)1) << 4);
  326|       |
  327|  5.07k|    out[0] += two62m3 - in[0];
  328|  5.07k|    out[1] += two62m2 - in[1];
  329|  5.07k|    out[2] += two62m2 - in[2];
  330|  5.07k|    out[3] += two62m2 - in[3];
  331|  5.07k|    out[4] += two62m2 - in[4];
  332|  5.07k|    out[5] += two62m2 - in[5];
  333|  5.07k|    out[6] += two62m2 - in[6];
  334|  5.07k|    out[7] += two62m2 - in[7];
  335|  5.07k|    out[8] += two62m2 - in[8];
  336|  5.07k|}
ecp_nistp521.c:felem_scalar128:
  276|  3.38k|{
  277|  3.38k|    out[0] *= scalar;
  278|  3.38k|    out[1] *= scalar;
  279|  3.38k|    out[2] *= scalar;
  280|  3.38k|    out[3] *= scalar;
  281|  3.38k|    out[4] *= scalar;
  282|  3.38k|    out[5] *= scalar;
  283|  3.38k|    out[6] *= scalar;
  284|  3.38k|    out[7] *= scalar;
  285|  3.38k|    out[8] *= scalar;
  286|  3.38k|}
ecp_nistp521.c:felem_diff128:
  377|  3.38k|{
  378|       |    /*
  379|       |     * In order to prevent underflow, we add 0 mod p before subtracting.
  380|       |     */
  381|  3.38k|    static const uint128_t two127m70 = (((uint128_t)1) << 127) - (((uint128_t)1) << 70);
  382|  3.38k|    static const uint128_t two127m69 = (((uint128_t)1) << 127) - (((uint128_t)1) << 69);
  383|       |
  384|  3.38k|    out[0] += (two127m70 - in[0]);
  385|  3.38k|    out[1] += (two127m69 - in[1]);
  386|  3.38k|    out[2] += (two127m69 - in[2]);
  387|  3.38k|    out[3] += (two127m69 - in[3]);
  388|  3.38k|    out[4] += (two127m69 - in[4]);
  389|  3.38k|    out[5] += (two127m69 - in[5]);
  390|  3.38k|    out[6] += (two127m69 - in[6]);
  391|  3.38k|    out[7] += (two127m69 - in[7]);
  392|  3.38k|    out[8] += (two127m69 - in[8]);
  393|  3.38k|}
ecp_nistp521.c:copy_conditional:
 1103|  10.1k|{
 1104|  10.1k|    unsigned i;
 1105|   101k|    for (i = 0; i < NLIMBS; ++i) {
  ------------------
  |  |  129|   101k|#define NLIMBS 9
  ------------------
  |  Branch (1105:17): [True: 91.2k, False: 10.1k]
  ------------------
 1106|  91.2k|        const limb tmp = mask & (in[i] ^ out[i]);
 1107|  91.2k|        out[i] ^= tmp;
 1108|  91.2k|    }
 1109|  10.1k|}
ecp_nistp521.c:point_double:
 1006|  1.69k|{
 1007|  1.69k|    largefelem tmp, tmp2;
 1008|  1.69k|    felem delta, gamma, beta, alpha, ftmp, ftmp2;
 1009|       |
 1010|  1.69k|    felem_assign(ftmp, x_in);
 1011|  1.69k|    felem_assign(ftmp2, x_in);
 1012|       |
 1013|       |    /* delta = z^2 */
 1014|  1.69k|    felem_square(tmp, z_in);
  ------------------
  |  |  642|  1.69k|#define felem_square felem_square_ref
  ------------------
 1015|  1.69k|    felem_reduce(delta, tmp); /* delta[i] < 2^59 + 2^14 */
 1016|       |
 1017|       |    /* gamma = y^2 */
 1018|  1.69k|    felem_square(tmp, y_in);
  ------------------
  |  |  642|  1.69k|#define felem_square felem_square_ref
  ------------------
 1019|  1.69k|    felem_reduce(gamma, tmp); /* gamma[i] < 2^59 + 2^14 */
 1020|       |
 1021|       |    /* beta = x*gamma */
 1022|  1.69k|    felem_mul(tmp, x_in, gamma);
  ------------------
  |  |  643|  1.69k|#define felem_mul felem_mul_ref
  ------------------
 1023|  1.69k|    felem_reduce(beta, tmp); /* beta[i] < 2^59 + 2^14 */
 1024|       |
 1025|       |    /* alpha = 3*(x-delta)*(x+delta) */
 1026|  1.69k|    felem_diff64(ftmp, delta);
 1027|       |    /* ftmp[i] < 2^61 */
 1028|  1.69k|    felem_sum64(ftmp2, delta);
 1029|       |    /* ftmp2[i] < 2^60 + 2^15 */
 1030|  1.69k|    felem_scalar64(ftmp2, 3);
 1031|       |    /* ftmp2[i] < 3*2^60 + 3*2^15 */
 1032|  1.69k|    felem_mul(tmp, ftmp, ftmp2);
  ------------------
  |  |  643|  1.69k|#define felem_mul felem_mul_ref
  ------------------
 1033|       |    /*-
 1034|       |     * tmp[i] < 17(3*2^121 + 3*2^76)
 1035|       |     *        = 61*2^121 + 61*2^76
 1036|       |     *        < 64*2^121 + 64*2^76
 1037|       |     *        = 2^127 + 2^82
 1038|       |     *        < 2^128
 1039|       |     */
 1040|  1.69k|    felem_reduce(alpha, tmp);
 1041|       |
 1042|       |    /* x' = alpha^2 - 8*beta */
 1043|  1.69k|    felem_square(tmp, alpha);
  ------------------
  |  |  642|  1.69k|#define felem_square felem_square_ref
  ------------------
 1044|       |    /*
 1045|       |     * tmp[i] < 17*2^120 < 2^125
 1046|       |     */
 1047|  1.69k|    felem_assign(ftmp, beta);
 1048|  1.69k|    felem_scalar64(ftmp, 8);
 1049|       |    /* ftmp[i] < 2^62 + 2^17 */
 1050|  1.69k|    felem_diff_128_64(tmp, ftmp);
 1051|       |    /* tmp[i] < 2^125 + 2^63 + 2^62 + 2^17 */
 1052|  1.69k|    felem_reduce(x_out, tmp);
 1053|       |
 1054|       |    /* z' = (y + z)^2 - gamma - delta */
 1055|  1.69k|    felem_sum64(delta, gamma);
 1056|       |    /* delta[i] < 2^60 + 2^15 */
 1057|  1.69k|    felem_assign(ftmp, y_in);
 1058|  1.69k|    felem_sum64(ftmp, z_in);
 1059|       |    /* ftmp[i] < 2^60 + 2^15 */
 1060|  1.69k|    felem_square(tmp, ftmp);
  ------------------
  |  |  642|  1.69k|#define felem_square felem_square_ref
  ------------------
 1061|       |    /*
 1062|       |     * tmp[i] < 17(2^122) < 2^127
 1063|       |     */
 1064|  1.69k|    felem_diff_128_64(tmp, delta);
 1065|       |    /* tmp[i] < 2^127 + 2^63 */
 1066|  1.69k|    felem_reduce(z_out, tmp);
 1067|       |
 1068|       |    /* y' = alpha*(4*beta - x') - 8*gamma^2 */
 1069|  1.69k|    felem_scalar64(beta, 4);
 1070|       |    /* beta[i] < 2^61 + 2^16 */
 1071|  1.69k|    felem_diff64(beta, x_out);
 1072|       |    /* beta[i] < 2^61 + 2^60 + 2^16 */
 1073|  1.69k|    felem_mul(tmp, alpha, beta);
  ------------------
  |  |  643|  1.69k|#define felem_mul felem_mul_ref
  ------------------
 1074|       |    /*-
 1075|       |     * tmp[i] < 17*((2^59 + 2^14)(2^61 + 2^60 + 2^16))
 1076|       |     *        = 17*(2^120 + 2^75 + 2^119 + 2^74 + 2^75 + 2^30)
 1077|       |     *        = 17*(2^120 + 2^119 + 2^76 + 2^74 + 2^30)
 1078|       |     *        < 2^128
 1079|       |     */
 1080|  1.69k|    felem_square(tmp2, gamma);
  ------------------
  |  |  642|  1.69k|#define felem_square felem_square_ref
  ------------------
 1081|       |    /*-
 1082|       |     * tmp2[i] < 17*(2^59 + 2^14)^2
 1083|       |     *         = 17*(2^118 + 2^74 + 2^28)
 1084|       |     */
 1085|  1.69k|    felem_scalar128(tmp2, 8);
 1086|       |    /*-
 1087|       |     * tmp2[i] < 8*17*(2^118 + 2^74 + 2^28)
 1088|       |     *         = 2^125 + 2^121 + 2^81 + 2^77 + 2^35 + 2^31
 1089|       |     *         < 2^126
 1090|       |     */
 1091|  1.69k|    felem_diff128(tmp, tmp2);
 1092|       |    /*-
 1093|       |     * tmp[i] < 2^127 - 2^69 + 17(2^120 + 2^119 + 2^76 + 2^74 + 2^30)
 1094|       |     *        = 2^127 + 2^124 + 2^122 + 2^120 + 2^118 + 2^80 + 2^78 + 2^76 +
 1095|       |     *          2^74 + 2^69 + 2^34 + 2^30
 1096|       |     *        < 2^128
 1097|       |     */
 1098|  1.69k|    felem_reduce(y_out, tmp);
 1099|  1.69k|}
ecp_nistp521.c:batch_mul:
 1503|     13|{
 1504|     13|    int i, skip;
 1505|     13|    unsigned num, gen_mul = (g_scalar != NULL);
 1506|     13|    felem nq[3], tmp[4];
 1507|     13|    limb bits;
 1508|     13|    u8 sign, digit;
 1509|       |
 1510|       |    /* set nq to the point at infinity */
 1511|     13|    memset(nq, 0, sizeof(nq));
 1512|       |
 1513|       |    /*
 1514|       |     * Loop over all scalars msb-to-lsb, interleaving additions of multiples
 1515|       |     * of the generator (last quarter of rounds) and additions of other
 1516|       |     * points multiples (every 5th round).
 1517|       |     */
 1518|     13|    skip = 1; /* save two point operations in the first
 1519|       |               * round */
 1520|  1.71k|    for (i = (num_points ? 520 : 130); i >= 0; --i) {
  ------------------
  |  Branch (1520:15): [True: 0, False: 13]
  |  Branch (1520:40): [True: 1.70k, False: 13]
  ------------------
 1521|       |        /* double */
 1522|  1.70k|        if (!skip)
  ------------------
  |  Branch (1522:13): [True: 1.69k, False: 13]
  ------------------
 1523|  1.69k|            point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]);
 1524|       |
 1525|       |        /* add multiples of the generator */
 1526|  1.70k|        if (gen_mul && (i <= 130)) {
  ------------------
  |  Branch (1526:13): [True: 1.70k, False: 0]
  |  Branch (1526:24): [True: 1.70k, False: 0]
  ------------------
 1527|  1.70k|            bits = get_bit(g_scalar, i + 390) << 3;
 1528|  1.70k|            if (i < 130) {
  ------------------
  |  Branch (1528:17): [True: 1.69k, False: 13]
  ------------------
 1529|  1.69k|                bits |= get_bit(g_scalar, i + 260) << 2;
 1530|  1.69k|                bits |= get_bit(g_scalar, i + 130) << 1;
 1531|  1.69k|                bits |= get_bit(g_scalar, i);
 1532|  1.69k|            }
 1533|       |            /* select the point to add, in constant time */
 1534|  1.70k|            select_point(bits, 16, g_pre_comp, tmp);
 1535|  1.70k|            if (!skip) {
  ------------------
  |  Branch (1535:17): [True: 1.69k, False: 13]
  ------------------
 1536|       |                /* The 1 argument below is for "mixed" */
 1537|  1.69k|                point_add(nq[0], nq[1], nq[2],
 1538|  1.69k|                    nq[0], nq[1], nq[2], 1, tmp[0], tmp[1], tmp[2]);
 1539|  1.69k|            } else {
 1540|     13|                memcpy(nq, tmp, 3 * sizeof(felem));
 1541|     13|                skip = 0;
 1542|     13|            }
 1543|  1.70k|        }
 1544|       |
 1545|       |        /* do other additions every 5 doublings */
 1546|  1.70k|        if (num_points && (i % 5 == 0)) {
  ------------------
  |  Branch (1546:13): [True: 0, False: 1.70k]
  |  Branch (1546:27): [True: 0, False: 0]
  ------------------
 1547|       |            /* loop over all scalars */
 1548|      0|            for (num = 0; num < num_points; ++num) {
  ------------------
  |  Branch (1548:27): [True: 0, False: 0]
  ------------------
 1549|      0|                bits = get_bit(scalars[num], i + 4) << 5;
 1550|      0|                bits |= get_bit(scalars[num], i + 3) << 4;
 1551|      0|                bits |= get_bit(scalars[num], i + 2) << 3;
 1552|      0|                bits |= get_bit(scalars[num], i + 1) << 2;
 1553|      0|                bits |= get_bit(scalars[num], i) << 1;
 1554|      0|                bits |= get_bit(scalars[num], i - 1);
 1555|      0|                ossl_ec_GFp_nistp_recode_scalar_bits(&sign, &digit, bits);
 1556|       |
 1557|       |                /*
 1558|       |                 * select the point to add or subtract, in constant time
 1559|       |                 */
 1560|      0|                select_point(digit, 17, pre_comp[num], tmp);
 1561|      0|                felem_neg(tmp[3], tmp[1]); /* (X, -Y, Z) is the negative
 1562|       |                                            * point */
 1563|      0|                copy_conditional(tmp[1], tmp[3], (-(limb)sign));
 1564|       |
 1565|      0|                if (!skip) {
  ------------------
  |  Branch (1565:21): [True: 0, False: 0]
  ------------------
 1566|      0|                    point_add(nq[0], nq[1], nq[2],
 1567|      0|                        nq[0], nq[1], nq[2],
 1568|      0|                        mixed, tmp[0], tmp[1], tmp[2]);
 1569|      0|                } else {
 1570|      0|                    memcpy(nq, tmp, 3 * sizeof(felem));
 1571|      0|                    skip = 0;
 1572|      0|                }
 1573|      0|            }
 1574|      0|        }
 1575|  1.70k|    }
 1576|     13|    felem_assign(x_out, nq[0]);
 1577|     13|    felem_assign(y_out, nq[1]);
 1578|     13|    felem_assign(z_out, nq[2]);
 1579|     13|}
ecp_nistp521.c:get_bit:
 1485|  6.77k|{
 1486|  6.77k|    if (i < 0)
  ------------------
  |  Branch (1486:9): [True: 0, False: 6.77k]
  ------------------
 1487|      0|        return 0;
 1488|  6.77k|    return (in[i >> 3] >> (i & 7)) & 1;
 1489|  6.77k|}
ecp_nistp521.c:select_point:
 1464|  1.70k|{
 1465|  1.70k|    unsigned i, j;
 1466|  1.70k|    limb *outlimbs = &out[0][0];
 1467|       |
 1468|  1.70k|    memset(out, 0, sizeof(*out) * 3);
 1469|       |
 1470|  28.9k|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (1470:17): [True: 27.2k, False: 1.70k]
  ------------------
 1471|  27.2k|        const limb *inlimbs = &pre_comp[i][0][0];
 1472|  27.2k|        limb mask = i ^ idx;
 1473|  27.2k|        mask |= mask >> 4;
 1474|  27.2k|        mask |= mask >> 2;
 1475|  27.2k|        mask |= mask >> 1;
 1476|  27.2k|        mask &= 1;
 1477|  27.2k|        mask--;
 1478|   762k|        for (j = 0; j < NLIMBS * 3; j++)
  ------------------
  |  |  129|   762k|#define NLIMBS 9
  ------------------
  |  Branch (1478:21): [True: 735k, False: 27.2k]
  ------------------
 1479|   735k|            outlimbs[j] |= inlimbs[j] & mask;
 1480|  27.2k|    }
 1481|  1.70k|}

EC_GFp_nistz256_method:
 1570|  11.3k|{
 1571|  11.3k|    static const EC_METHOD ret = {
 1572|  11.3k|        EC_FLAGS_DEFAULT_OCT,
  ------------------
  |  |   26|  11.3k|#define EC_FLAGS_DEFAULT_OCT 0x1
  ------------------
 1573|  11.3k|        NID_X9_62_prime_field,
  ------------------
  |  |  152|  11.3k|#define NID_X9_62_prime_field           406
  ------------------
 1574|  11.3k|        ossl_ec_GFp_mont_group_init,
 1575|  11.3k|        ossl_ec_GFp_mont_group_finish,
 1576|  11.3k|        ossl_ec_GFp_mont_group_clear_finish,
 1577|  11.3k|        ossl_ec_GFp_mont_group_copy,
 1578|  11.3k|        ossl_ec_GFp_mont_group_set_curve,
 1579|  11.3k|        ossl_ec_GFp_simple_group_get_curve,
 1580|  11.3k|        ossl_ec_GFp_simple_group_get_degree,
 1581|  11.3k|        ossl_ec_group_simple_order_bits,
 1582|  11.3k|        ossl_ec_GFp_simple_group_check_discriminant,
 1583|  11.3k|        ossl_ec_GFp_simple_point_init,
 1584|  11.3k|        ossl_ec_GFp_simple_point_finish,
 1585|  11.3k|        ossl_ec_GFp_simple_point_clear_finish,
 1586|  11.3k|        ossl_ec_GFp_simple_point_copy,
 1587|  11.3k|        ossl_ec_GFp_simple_point_set_to_infinity,
 1588|  11.3k|        ossl_ec_GFp_simple_point_set_affine_coordinates,
 1589|  11.3k|        ecp_nistz256_get_affine,
 1590|  11.3k|        0, 0, 0,
 1591|  11.3k|        ossl_ec_GFp_simple_add,
 1592|  11.3k|        ossl_ec_GFp_simple_dbl,
 1593|  11.3k|        ossl_ec_GFp_simple_invert,
 1594|  11.3k|        ossl_ec_GFp_simple_is_at_infinity,
 1595|  11.3k|        ossl_ec_GFp_simple_is_on_curve,
 1596|  11.3k|        ossl_ec_GFp_simple_cmp,
 1597|  11.3k|        ossl_ec_GFp_simple_make_affine,
 1598|  11.3k|        ossl_ec_GFp_simple_points_make_affine,
 1599|  11.3k|        ecp_nistz256_points_mul, /* mul */
 1600|  11.3k|        ecp_nistz256_mult_precompute, /* precompute_mult */
 1601|  11.3k|        ecp_nistz256_window_have_precompute_mult, /* have_precompute_mult */
 1602|  11.3k|        ossl_ec_GFp_mont_field_mul,
 1603|  11.3k|        ossl_ec_GFp_mont_field_sqr,
 1604|  11.3k|        0, /* field_div */
 1605|  11.3k|        ossl_ec_GFp_mont_field_inv,
 1606|  11.3k|        ossl_ec_GFp_mont_field_encode,
 1607|  11.3k|        ossl_ec_GFp_mont_field_decode,
 1608|  11.3k|        ossl_ec_GFp_mont_field_set_to_one,
 1609|  11.3k|        ossl_ec_key_simple_priv2oct,
 1610|  11.3k|        ossl_ec_key_simple_oct2priv,
 1611|  11.3k|        0, /* set private */
 1612|  11.3k|        ossl_ec_key_simple_generate_key,
 1613|  11.3k|        ossl_ec_key_simple_check_key,
 1614|  11.3k|        ossl_ec_key_simple_generate_public_key,
 1615|  11.3k|        0, /* keycopy */
 1616|  11.3k|        0, /* keyfinish */
 1617|  11.3k|        ossl_ecdh_simple_compute_key,
 1618|  11.3k|        ossl_ecdsa_simple_sign_setup,
 1619|  11.3k|        ossl_ecdsa_simple_sign_sig,
 1620|  11.3k|        ossl_ecdsa_simple_verify_sig,
 1621|  11.3k|        ecp_nistz256_inv_mod_ord, /* can be #define-d NULL */
 1622|  11.3k|        0, /* blind_coordinates */
 1623|  11.3k|        0, /* ladder_pre */
 1624|  11.3k|        0, /* ladder_step */
 1625|  11.3k|        0, /* ladder_post */
 1626|  11.3k|        ecp_nistz256group_full_init
 1627|  11.3k|    };
 1628|       |
 1629|  11.3k|    return &ret;
 1630|  11.3k|}
ecp_nistz256.c:ecp_nistz256_get_affine:
 1149|     53|{
 1150|     53|    BN_ULONG z_inv2[P256_LIMBS];
  ------------------
  |  |   37|     53|#define BN_ULONG unsigned long
  ------------------
 1151|     53|    BN_ULONG z_inv3[P256_LIMBS];
  ------------------
  |  |   37|     53|#define BN_ULONG unsigned long
  ------------------
 1152|     53|    BN_ULONG x_aff[P256_LIMBS];
  ------------------
  |  |   37|     53|#define BN_ULONG unsigned long
  ------------------
 1153|     53|    BN_ULONG y_aff[P256_LIMBS];
  ------------------
  |  |   37|     53|#define BN_ULONG unsigned long
  ------------------
 1154|     53|    BN_ULONG point_x[P256_LIMBS], point_y[P256_LIMBS], point_z[P256_LIMBS];
  ------------------
  |  |   37|     53|#define BN_ULONG unsigned long
  ------------------
 1155|     53|    BN_ULONG x_ret[P256_LIMBS], y_ret[P256_LIMBS];
  ------------------
  |  |   37|     53|#define BN_ULONG unsigned long
  ------------------
 1156|       |
 1157|     53|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (1157:9): [True: 0, False: 53]
  ------------------
 1158|      0|        ERR_raise(ERR_LIB_EC, EC_R_POINT_AT_INFINITY);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1159|      0|        return 0;
 1160|      0|    }
 1161|       |
 1162|     53|    if (!ecp_nistz256_bignum_to_field_elem(point_x, point->X) || !ecp_nistz256_bignum_to_field_elem(point_y, point->Y) || !ecp_nistz256_bignum_to_field_elem(point_z, point->Z)) {
  ------------------
  |  Branch (1162:9): [True: 0, False: 53]
  |  Branch (1162:66): [True: 0, False: 53]
  |  Branch (1162:123): [True: 0, False: 53]
  ------------------
 1163|      0|        ERR_raise(ERR_LIB_EC, EC_R_COORDINATES_OUT_OF_RANGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1164|      0|        return 0;
 1165|      0|    }
 1166|       |
 1167|     53|    ecp_nistz256_mod_inverse(z_inv3, point_z);
 1168|     53|    ecp_nistz256_sqr_mont(z_inv2, z_inv3);
 1169|     53|    ecp_nistz256_mul_mont(x_aff, z_inv2, point_x);
 1170|       |
 1171|     53|    if (x != NULL) {
  ------------------
  |  Branch (1171:9): [True: 53, False: 0]
  ------------------
 1172|     53|        ecp_nistz256_from_mont(x_ret, x_aff);
 1173|     53|        if (!bn_set_words(x, x_ret, P256_LIMBS))
  ------------------
  |  |   41|     53|#define P256_LIMBS (256 / BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     53|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     53|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1173:13): [True: 0, False: 53]
  ------------------
 1174|      0|            return 0;
 1175|     53|    }
 1176|       |
 1177|     53|    if (y != NULL) {
  ------------------
  |  Branch (1177:9): [True: 53, False: 0]
  ------------------
 1178|     53|        ecp_nistz256_mul_mont(z_inv3, z_inv3, z_inv2);
 1179|     53|        ecp_nistz256_mul_mont(y_aff, z_inv3, point_y);
 1180|     53|        ecp_nistz256_from_mont(y_ret, y_aff);
 1181|     53|        if (!bn_set_words(y, y_ret, P256_LIMBS))
  ------------------
  |  |   41|     53|#define P256_LIMBS (256 / BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     53|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     53|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1181:13): [True: 0, False: 53]
  ------------------
 1182|      0|            return 0;
 1183|     53|    }
 1184|       |
 1185|     53|    return 1;
 1186|     53|}
ecp_nistz256.c:ecp_nistz256_bignum_to_field_elem:
  600|    159|{
  601|    159|    return bn_copy_words(out, in, P256_LIMBS);
  ------------------
  |  |   41|    159|#define P256_LIMBS (256 / BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|    159|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    159|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  602|    159|}
ecp_nistz256.c:ecp_nistz256_mod_inverse:
  520|     53|{
  521|       |    /*
  522|       |     * The poly is ffffffff 00000001 00000000 00000000 00000000 ffffffff
  523|       |     * ffffffff ffffffff We use FLT and used poly-2 as exponent
  524|       |     */
  525|     53|    BN_ULONG p2[P256_LIMBS];
  ------------------
  |  |   37|     53|#define BN_ULONG unsigned long
  ------------------
  526|     53|    BN_ULONG p4[P256_LIMBS];
  ------------------
  |  |   37|     53|#define BN_ULONG unsigned long
  ------------------
  527|     53|    BN_ULONG p8[P256_LIMBS];
  ------------------
  |  |   37|     53|#define BN_ULONG unsigned long
  ------------------
  528|     53|    BN_ULONG p16[P256_LIMBS];
  ------------------
  |  |   37|     53|#define BN_ULONG unsigned long
  ------------------
  529|     53|    BN_ULONG p32[P256_LIMBS];
  ------------------
  |  |   37|     53|#define BN_ULONG unsigned long
  ------------------
  530|     53|    BN_ULONG res[P256_LIMBS];
  ------------------
  |  |   37|     53|#define BN_ULONG unsigned long
  ------------------
  531|     53|    int i;
  532|       |
  533|     53|    ecp_nistz256_sqr_mont(res, in);
  534|     53|    ecp_nistz256_mul_mont(p2, res, in); /* 3*p */
  535|       |
  536|     53|    ecp_nistz256_sqr_mont(res, p2);
  537|     53|    ecp_nistz256_sqr_mont(res, res);
  538|     53|    ecp_nistz256_mul_mont(p4, res, p2); /* f*p */
  539|       |
  540|     53|    ecp_nistz256_sqr_mont(res, p4);
  541|     53|    ecp_nistz256_sqr_mont(res, res);
  542|     53|    ecp_nistz256_sqr_mont(res, res);
  543|     53|    ecp_nistz256_sqr_mont(res, res);
  544|     53|    ecp_nistz256_mul_mont(p8, res, p4); /* ff*p */
  545|       |
  546|     53|    ecp_nistz256_sqr_mont(res, p8);
  547|    424|    for (i = 0; i < 7; i++)
  ------------------
  |  Branch (547:17): [True: 371, False: 53]
  ------------------
  548|    371|        ecp_nistz256_sqr_mont(res, res);
  549|     53|    ecp_nistz256_mul_mont(p16, res, p8); /* ffff*p */
  550|       |
  551|     53|    ecp_nistz256_sqr_mont(res, p16);
  552|    848|    for (i = 0; i < 15; i++)
  ------------------
  |  Branch (552:17): [True: 795, False: 53]
  ------------------
  553|    795|        ecp_nistz256_sqr_mont(res, res);
  554|     53|    ecp_nistz256_mul_mont(p32, res, p16); /* ffffffff*p */
  555|       |
  556|     53|    ecp_nistz256_sqr_mont(res, p32);
  557|  1.69k|    for (i = 0; i < 31; i++)
  ------------------
  |  Branch (557:17): [True: 1.64k, False: 53]
  ------------------
  558|  1.64k|        ecp_nistz256_sqr_mont(res, res);
  559|     53|    ecp_nistz256_mul_mont(res, res, in);
  560|       |
  561|  6.83k|    for (i = 0; i < 32 * 4; i++)
  ------------------
  |  Branch (561:17): [True: 6.78k, False: 53]
  ------------------
  562|  6.78k|        ecp_nistz256_sqr_mont(res, res);
  563|     53|    ecp_nistz256_mul_mont(res, res, p32);
  564|       |
  565|  1.74k|    for (i = 0; i < 32; i++)
  ------------------
  |  Branch (565:17): [True: 1.69k, False: 53]
  ------------------
  566|  1.69k|        ecp_nistz256_sqr_mont(res, res);
  567|     53|    ecp_nistz256_mul_mont(res, res, p32);
  568|       |
  569|    901|    for (i = 0; i < 16; i++)
  ------------------
  |  Branch (569:17): [True: 848, False: 53]
  ------------------
  570|    848|        ecp_nistz256_sqr_mont(res, res);
  571|     53|    ecp_nistz256_mul_mont(res, res, p16);
  572|       |
  573|    477|    for (i = 0; i < 8; i++)
  ------------------
  |  Branch (573:17): [True: 424, False: 53]
  ------------------
  574|    424|        ecp_nistz256_sqr_mont(res, res);
  575|     53|    ecp_nistz256_mul_mont(res, res, p8);
  576|       |
  577|     53|    ecp_nistz256_sqr_mont(res, res);
  578|     53|    ecp_nistz256_sqr_mont(res, res);
  579|     53|    ecp_nistz256_sqr_mont(res, res);
  580|     53|    ecp_nistz256_sqr_mont(res, res);
  581|     53|    ecp_nistz256_mul_mont(res, res, p4);
  582|       |
  583|     53|    ecp_nistz256_sqr_mont(res, res);
  584|     53|    ecp_nistz256_sqr_mont(res, res);
  585|     53|    ecp_nistz256_mul_mont(res, res, p2);
  586|       |
  587|     53|    ecp_nistz256_sqr_mont(res, res);
  588|     53|    ecp_nistz256_sqr_mont(res, res);
  589|     53|    ecp_nistz256_mul_mont(res, res, in);
  590|       |
  591|     53|    memcpy(r, res, sizeof(res));
  592|     53|}
ecp_nistz256.c:ecp_nistz256_points_mul:
  936|     53|{
  937|     53|    int i = 0, ret = 0, no_precomp_for_generator = 0, p_is_infinity = 0;
  938|     53|    unsigned char p_str[33] = { 0 };
  939|     53|    const PRECOMP256_ROW *preComputedTable = NULL;
  940|     53|    const NISTZ256_PRE_COMP *pre_comp = NULL;
  941|     53|    const EC_POINT *generator = NULL;
  942|     53|    const BIGNUM **new_scalars = NULL;
  943|     53|    const EC_POINT **new_points = NULL;
  944|     53|    unsigned int idx = 0;
  945|     53|    const unsigned int window_size = 7;
  946|     53|    const unsigned int mask = (1 << (window_size + 1)) - 1;
  947|     53|    unsigned int wvalue;
  948|     53|    ALIGN32 union {
  ------------------
  |  |   30|     53|#define ALIGN32 __attribute((aligned(32)))
  ------------------
  949|     53|        P256_POINT p;
  950|     53|        P256_POINT_AFFINE a;
  951|     53|    } t, p;
  952|     53|    BIGNUM *tmp_scalar;
  953|       |
  954|     53|    if ((num + 1) == 0 || (num + 1) > OPENSSL_MALLOC_MAX_NELEMS(void *)) {
  ------------------
  |  |  168|     53|#define OPENSSL_MALLOC_MAX_NELEMS(type) (((1U << (sizeof(int) * 8 - 1)) - 1) / sizeof(type))
  ------------------
  |  Branch (954:9): [True: 0, False: 53]
  |  Branch (954:27): [True: 0, False: 53]
  ------------------
  955|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  956|      0|        return 0;
  957|      0|    }
  958|       |
  959|     53|    memset(&p, 0, sizeof(p));
  960|     53|    BN_CTX_start(ctx);
  961|       |
  962|     53|    if (scalar) {
  ------------------
  |  Branch (962:9): [True: 53, False: 0]
  ------------------
  963|     53|        generator = EC_GROUP_get0_generator(group);
  964|     53|        if (generator == NULL) {
  ------------------
  |  Branch (964:13): [True: 0, False: 53]
  ------------------
  965|      0|            ERR_raise(ERR_LIB_EC, EC_R_UNDEFINED_GENERATOR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  966|      0|            goto err;
  967|      0|        }
  968|       |
  969|       |        /* look if we can use precomputed multiples of generator */
  970|     53|        pre_comp = group->pre_comp.nistz256;
  971|       |
  972|     53|        if (pre_comp) {
  ------------------
  |  Branch (972:13): [True: 0, False: 53]
  ------------------
  973|       |            /*
  974|       |             * If there is a precomputed table for the generator, check that
  975|       |             * it was generated with the same generator.
  976|       |             */
  977|      0|            EC_POINT *pre_comp_generator = EC_POINT_new(group);
  978|      0|            if (pre_comp_generator == NULL)
  ------------------
  |  Branch (978:17): [True: 0, False: 0]
  ------------------
  979|      0|                goto err;
  980|       |
  981|      0|            ecp_nistz256_gather_w7(&p.a, pre_comp->precomp[0], 1);
  982|      0|            if (!ecp_nistz256_set_from_affine(pre_comp_generator,
  ------------------
  |  Branch (982:17): [True: 0, False: 0]
  ------------------
  983|      0|                    group, &p.a, ctx)) {
  984|      0|                EC_POINT_free(pre_comp_generator);
  985|      0|                goto err;
  986|      0|            }
  987|       |
  988|      0|            if (0 == EC_POINT_cmp(group, generator, pre_comp_generator, ctx))
  ------------------
  |  Branch (988:17): [True: 0, False: 0]
  ------------------
  989|      0|                preComputedTable = (const PRECOMP256_ROW *)pre_comp->precomp;
  990|       |
  991|      0|            EC_POINT_free(pre_comp_generator);
  992|      0|        }
  993|       |
  994|     53|        if (preComputedTable == NULL && ecp_nistz256_is_affine_G(generator)) {
  ------------------
  |  Branch (994:13): [True: 53, False: 0]
  |  Branch (994:41): [True: 53, False: 0]
  ------------------
  995|       |            /*
  996|       |             * If there is no precomputed data, but the generator is the
  997|       |             * default, a hardcoded table of precomputed data is used. This
  998|       |             * is because applications, such as Apache, do not use
  999|       |             * EC_KEY_precompute_mult.
 1000|       |             */
 1001|     53|            preComputedTable = ecp_nistz256_precomputed;
 1002|     53|        }
 1003|       |
 1004|     53|        if (preComputedTable) {
  ------------------
  |  Branch (1004:13): [True: 53, False: 0]
  ------------------
 1005|     53|            BN_ULONG infty;
  ------------------
  |  |   37|     53|#define BN_ULONG unsigned long
  ------------------
 1006|       |
 1007|     53|            if ((BN_num_bits(scalar) > 256)
  ------------------
  |  Branch (1007:17): [True: 0, False: 53]
  ------------------
 1008|     53|                || BN_is_negative(scalar)) {
  ------------------
  |  Branch (1008:20): [True: 0, False: 53]
  ------------------
 1009|      0|                if ((tmp_scalar = BN_CTX_get(ctx)) == NULL)
  ------------------
  |  Branch (1009:21): [True: 0, False: 0]
  ------------------
 1010|      0|                    goto err;
 1011|       |
 1012|      0|                if (!BN_nnmod(tmp_scalar, scalar, group->order, ctx)) {
  ------------------
  |  Branch (1012:21): [True: 0, False: 0]
  ------------------
 1013|      0|                    ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1014|      0|                    goto err;
 1015|      0|                }
 1016|      0|                scalar = tmp_scalar;
 1017|      0|            }
 1018|       |
 1019|    265|            for (i = 0; i < bn_get_top(scalar) * BN_BYTES; i += BN_BYTES) {
  ------------------
  |  |   38|    265|#define BN_BYTES 8
  ------------------
                          for (i = 0; i < bn_get_top(scalar) * BN_BYTES; i += BN_BYTES) {
  ------------------
  |  |   38|    212|#define BN_BYTES 8
  ------------------
  |  Branch (1019:25): [True: 212, False: 53]
  ------------------
 1020|    212|                BN_ULONG d = bn_get_words(scalar)[i / BN_BYTES];
  ------------------
  |  |   37|    212|#define BN_ULONG unsigned long
  ------------------
                              BN_ULONG d = bn_get_words(scalar)[i / BN_BYTES];
  ------------------
  |  |   38|    212|#define BN_BYTES 8
  ------------------
 1021|       |
 1022|    212|                p_str[i + 0] = (unsigned char)d;
 1023|    212|                p_str[i + 1] = (unsigned char)(d >> 8);
 1024|    212|                p_str[i + 2] = (unsigned char)(d >> 16);
 1025|    212|                p_str[i + 3] = (unsigned char)(d >>= 24);
 1026|    212|                if (BN_BYTES == 8) {
  ------------------
  |  |   38|    212|#define BN_BYTES 8
  ------------------
  |  Branch (1026:21): [True: 212, Folded]
  ------------------
 1027|    212|                    d >>= 8;
 1028|    212|                    p_str[i + 4] = (unsigned char)d;
 1029|    212|                    p_str[i + 5] = (unsigned char)(d >> 8);
 1030|    212|                    p_str[i + 6] = (unsigned char)(d >> 16);
 1031|    212|                    p_str[i + 7] = (unsigned char)(d >> 24);
 1032|    212|                }
 1033|    212|            }
 1034|       |
 1035|    106|            for (; i < 33; i++)
  ------------------
  |  Branch (1035:20): [True: 53, False: 53]
  ------------------
 1036|     53|                p_str[i] = 0;
 1037|       |
 1038|       |            /* First window */
 1039|     53|            wvalue = (p_str[0] << 1) & mask;
 1040|     53|            idx += window_size;
 1041|       |
 1042|     53|            wvalue = _booth_recode_w7(wvalue);
 1043|       |
 1044|     53|            ecp_nistz256_gather_w7(&p.a, preComputedTable[0],
 1045|     53|                wvalue >> 1);
 1046|       |
 1047|     53|            ecp_nistz256_neg(p.p.Z, p.p.Y);
 1048|     53|            copy_conditional(p.p.Y, p.p.Z, wvalue & 1);
 1049|       |
 1050|       |            /*
 1051|       |             * Since affine infinity is encoded as (0,0) and
 1052|       |             * Jacobian is (,,0), we need to harmonize them
 1053|       |             * by assigning "one" or zero to Z.
 1054|       |             */
 1055|     53|            infty = (p.p.X[0] | p.p.X[1] | p.p.X[2] | p.p.X[3] | p.p.Y[0] | p.p.Y[1] | p.p.Y[2] | p.p.Y[3]);
 1056|     53|            if (P256_LIMBS == 8)
  ------------------
  |  |   41|     53|#define P256_LIMBS (256 / BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     53|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     53|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1056:17): [Folded, False: 53]
  ------------------
 1057|      0|                infty |= (p.p.X[4] | p.p.X[5] | p.p.X[6] | p.p.X[7] | p.p.Y[4] | p.p.Y[5] | p.p.Y[6] | p.p.Y[7]);
 1058|       |
 1059|     53|            infty = 0 - is_zero(infty);
 1060|     53|            infty = ~infty;
 1061|       |
 1062|     53|            p.p.Z[0] = ONE[0] & infty;
 1063|     53|            p.p.Z[1] = ONE[1] & infty;
 1064|     53|            p.p.Z[2] = ONE[2] & infty;
 1065|     53|            p.p.Z[3] = ONE[3] & infty;
 1066|     53|            if (P256_LIMBS == 8) {
  ------------------
  |  |   41|     53|#define P256_LIMBS (256 / BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     53|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     53|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1066:17): [Folded, False: 53]
  ------------------
 1067|      0|                p.p.Z[4] = ONE[4] & infty;
 1068|      0|                p.p.Z[5] = ONE[5] & infty;
 1069|      0|                p.p.Z[6] = ONE[6] & infty;
 1070|      0|                p.p.Z[7] = ONE[7] & infty;
 1071|      0|            }
 1072|       |
 1073|  1.96k|            for (i = 1; i < 37; i++) {
  ------------------
  |  Branch (1073:25): [True: 1.90k, False: 53]
  ------------------
 1074|  1.90k|                unsigned int off = (idx - 1) / 8;
 1075|  1.90k|                wvalue = p_str[off] | p_str[off + 1] << 8;
 1076|  1.90k|                wvalue = (wvalue >> ((idx - 1) % 8)) & mask;
 1077|  1.90k|                idx += window_size;
 1078|       |
 1079|  1.90k|                wvalue = _booth_recode_w7(wvalue);
 1080|       |
 1081|  1.90k|                ecp_nistz256_gather_w7(&t.a,
 1082|  1.90k|                    preComputedTable[i], wvalue >> 1);
 1083|       |
 1084|  1.90k|                ecp_nistz256_neg(t.p.Z, t.a.Y);
 1085|  1.90k|                copy_conditional(t.a.Y, t.p.Z, wvalue & 1);
 1086|       |
 1087|  1.90k|                ecp_nistz256_point_add_affine(&p.p, &p.p, &t.a);
 1088|  1.90k|            }
 1089|     53|        } else {
 1090|      0|            p_is_infinity = 1;
 1091|      0|            no_precomp_for_generator = 1;
 1092|      0|        }
 1093|     53|    } else
 1094|      0|        p_is_infinity = 1;
 1095|       |
 1096|     53|    if (no_precomp_for_generator) {
  ------------------
  |  Branch (1096:9): [True: 0, False: 53]
  ------------------
 1097|       |        /*
 1098|       |         * Without a precomputed table for the generator, it has to be
 1099|       |         * handled like a normal point.
 1100|       |         */
 1101|      0|        new_scalars = OPENSSL_malloc_array(num + 1, sizeof(BIGNUM *));
  ------------------
  |  |  110|      0|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1102|      0|        if (new_scalars == NULL)
  ------------------
  |  Branch (1102:13): [True: 0, False: 0]
  ------------------
 1103|      0|            goto err;
 1104|       |
 1105|      0|        new_points = OPENSSL_malloc_array(num + 1, sizeof(EC_POINT *));
  ------------------
  |  |  110|      0|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1106|      0|        if (new_points == NULL)
  ------------------
  |  Branch (1106:13): [True: 0, False: 0]
  ------------------
 1107|      0|            goto err;
 1108|       |
 1109|      0|        memcpy(new_scalars, scalars, num * sizeof(BIGNUM *));
 1110|      0|        new_scalars[num] = scalar;
 1111|      0|        memcpy(new_points, points, num * sizeof(EC_POINT *));
 1112|      0|        new_points[num] = generator;
 1113|       |
 1114|      0|        scalars = new_scalars;
 1115|      0|        points = new_points;
 1116|      0|        num++;
 1117|      0|    }
 1118|       |
 1119|     53|    if (num) {
  ------------------
  |  Branch (1119:9): [True: 0, False: 53]
  ------------------
 1120|      0|        P256_POINT *out = &t.p;
 1121|      0|        if (p_is_infinity)
  ------------------
  |  Branch (1121:13): [True: 0, False: 0]
  ------------------
 1122|      0|            out = &p.p;
 1123|       |
 1124|      0|        if (!ecp_nistz256_windowed_mul(group, out, scalars, points, num, ctx))
  ------------------
  |  Branch (1124:13): [True: 0, False: 0]
  ------------------
 1125|      0|            goto err;
 1126|       |
 1127|      0|        if (!p_is_infinity)
  ------------------
  |  Branch (1127:13): [True: 0, False: 0]
  ------------------
 1128|      0|            ecp_nistz256_point_add(&p.p, &p.p, out);
 1129|      0|    }
 1130|       |
 1131|       |    /* Not constant-time, but we're only operating on the public output. */
 1132|     53|    if (!bn_set_words(r->X, p.p.X, P256_LIMBS) || !bn_set_words(r->Y, p.p.Y, P256_LIMBS) || !bn_set_words(r->Z, p.p.Z, P256_LIMBS)) {
  ------------------
  |  |   41|     53|#define P256_LIMBS (256 / BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     53|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     53|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (!bn_set_words(r->X, p.p.X, P256_LIMBS) || !bn_set_words(r->Y, p.p.Y, P256_LIMBS) || !bn_set_words(r->Z, p.p.Z, P256_LIMBS)) {
  ------------------
  |  |   41|     53|#define P256_LIMBS (256 / BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     53|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     53|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (!bn_set_words(r->X, p.p.X, P256_LIMBS) || !bn_set_words(r->Y, p.p.Y, P256_LIMBS) || !bn_set_words(r->Z, p.p.Z, P256_LIMBS)) {
  ------------------
  |  |   41|     53|#define P256_LIMBS (256 / BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     53|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     53|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1132:9): [True: 0, False: 53]
  |  Branch (1132:51): [True: 0, False: 53]
  |  Branch (1132:93): [True: 0, False: 53]
  ------------------
 1133|      0|        goto err;
 1134|      0|    }
 1135|     53|    r->Z_is_one = is_one(r->Z) & 1;
 1136|       |
 1137|     53|    ret = 1;
 1138|       |
 1139|     53|err:
 1140|     53|    BN_CTX_end(ctx);
 1141|     53|    OPENSSL_free(new_points);
  ------------------
  |  |  131|     53|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1142|     53|    OPENSSL_free(new_scalars);
  ------------------
  |  |  131|     53|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1143|     53|    return ret;
 1144|     53|}
ecp_nistz256.c:ecp_nistz256_is_affine_G:
  791|     53|{
  792|     53|    return (bn_get_top(generator->X) == P256_LIMBS) && (bn_get_top(generator->Y) == P256_LIMBS) && is_equal(bn_get_words(generator->X), def_xG) && is_equal(bn_get_words(generator->Y), def_yG) && is_one(generator->Z);
  ------------------
  |  |   41|     53|#define P256_LIMBS (256 / BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     53|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     53|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  return (bn_get_top(generator->X) == P256_LIMBS) && (bn_get_top(generator->Y) == P256_LIMBS) && is_equal(bn_get_words(generator->X), def_xG) && is_equal(bn_get_words(generator->Y), def_yG) && is_one(generator->Z);
  ------------------
  |  |   41|     53|#define P256_LIMBS (256 / BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|     53|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|     53|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (792:12): [True: 53, False: 0]
  |  Branch (792:56): [True: 53, False: 0]
  |  Branch (792:100): [True: 53, False: 0]
  |  Branch (792:148): [True: 53, False: 0]
  |  Branch (792:196): [True: 53, False: 0]
  ------------------
  793|     53|}
ecp_nistz256.c:is_equal:
  196|    106|{
  197|    106|    BN_ULONG res;
  ------------------
  |  |   37|    106|#define BN_ULONG unsigned long
  ------------------
  198|       |
  199|    106|    res = a[0] ^ b[0];
  200|    106|    res |= a[1] ^ b[1];
  201|    106|    res |= a[2] ^ b[2];
  202|    106|    res |= a[3] ^ b[3];
  203|    106|    if (P256_LIMBS == 8) {
  ------------------
  |  |   41|    106|#define P256_LIMBS (256 / BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|    106|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    106|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (203:9): [Folded, False: 106]
  ------------------
  204|      0|        res |= a[4] ^ b[4];
  205|      0|        res |= a[5] ^ b[5];
  206|      0|        res |= a[6] ^ b[6];
  207|      0|        res |= a[7] ^ b[7];
  208|      0|    }
  209|       |
  210|    106|    return is_zero(res);
  211|    106|}
ecp_nistz256.c:_booth_recode_w7:
  157|  1.96k|{
  158|  1.96k|    unsigned int s, d;
  159|       |
  160|  1.96k|    s = ~((in >> 7) - 1);
  161|  1.96k|    d = (1 << 8) - in - 1;
  162|  1.96k|    d = (d & s) | (in & ~s);
  163|  1.96k|    d = (d >> 1) + (d & 1);
  164|       |
  165|  1.96k|    return (d << 1) + (s & 1);
  166|  1.96k|}
ecp_nistz256.c:copy_conditional:
  170|  1.96k|{
  171|  1.96k|    BN_ULONG mask1 = 0 - move;
  ------------------
  |  |   37|  1.96k|#define BN_ULONG unsigned long
  ------------------
  172|  1.96k|    BN_ULONG mask2 = ~mask1;
  ------------------
  |  |   37|  1.96k|#define BN_ULONG unsigned long
  ------------------
  173|       |
  174|  1.96k|    dst[0] = (src[0] & mask1) ^ (dst[0] & mask2);
  175|  1.96k|    dst[1] = (src[1] & mask1) ^ (dst[1] & mask2);
  176|  1.96k|    dst[2] = (src[2] & mask1) ^ (dst[2] & mask2);
  177|  1.96k|    dst[3] = (src[3] & mask1) ^ (dst[3] & mask2);
  178|  1.96k|    if (P256_LIMBS == 8) {
  ------------------
  |  |   41|  1.96k|#define P256_LIMBS (256 / BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|  1.96k|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  1.96k|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (178:9): [Folded, False: 1.96k]
  ------------------
  179|      0|        dst[4] = (src[4] & mask1) ^ (dst[4] & mask2);
  180|      0|        dst[5] = (src[5] & mask1) ^ (dst[5] & mask2);
  181|      0|        dst[6] = (src[6] & mask1) ^ (dst[6] & mask2);
  182|      0|        dst[7] = (src[7] & mask1) ^ (dst[7] & mask2);
  183|      0|    }
  184|  1.96k|}
ecp_nistz256.c:is_zero:
  187|    265|{
  188|    265|    in |= (0 - in);
  189|    265|    in = ~in;
  190|    265|    in >>= BN_BITS2 - 1;
  ------------------
  |  |   54|    265|#define BN_BITS2 (BN_BYTES * 8)
  |  |  ------------------
  |  |  |  |   38|    265|#define BN_BYTES 8
  |  |  ------------------
  ------------------
  191|    265|    return in;
  192|    265|}
ecp_nistz256.c:is_one:
  214|    106|{
  215|    106|    BN_ULONG res = 0;
  ------------------
  |  |   37|    106|#define BN_ULONG unsigned long
  ------------------
  216|    106|    BN_ULONG *a = bn_get_words(z);
  ------------------
  |  |   37|    106|#define BN_ULONG unsigned long
  ------------------
  217|       |
  218|    106|    if (bn_get_top(z) == (P256_LIMBS - P256_LIMBS / 8)) {
  ------------------
  |  |   41|    106|#define P256_LIMBS (256 / BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|    106|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    106|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (bn_get_top(z) == (P256_LIMBS - P256_LIMBS / 8)) {
  ------------------
  |  |   41|    106|#define P256_LIMBS (256 / BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|    106|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    106|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (218:9): [True: 106, False: 0]
  ------------------
  219|    106|        res = a[0] ^ ONE[0];
  220|    106|        res |= a[1] ^ ONE[1];
  221|    106|        res |= a[2] ^ ONE[2];
  222|    106|        res |= a[3] ^ ONE[3];
  223|    106|        if (P256_LIMBS == 8) {
  ------------------
  |  |   41|    106|#define P256_LIMBS (256 / BN_BITS2)
  |  |  ------------------
  |  |  |  |   54|    106|#define BN_BITS2 (BN_BYTES * 8)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|    106|#define BN_BYTES 8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (223:13): [Folded, False: 106]
  ------------------
  224|      0|            res |= a[4] ^ ONE[4];
  225|      0|            res |= a[5] ^ ONE[5];
  226|      0|            res |= a[6] ^ ONE[6];
  227|       |            /*
  228|       |             * no check for a[7] (being zero) on 32-bit platforms,
  229|       |             * because value of "one" takes only 7 limbs.
  230|       |             */
  231|      0|        }
  232|    106|        res = is_zero(res);
  233|    106|    }
  234|       |
  235|    106|    return res;
  236|    106|}
ecp_nistz256.c:ecp_nistz256group_full_init:
 1445|  11.3k|{
 1446|  11.3k|    BN_CTX *ctx = NULL;
 1447|  11.3k|    BN_MONT_CTX *mont = NULL, *ordmont = NULL;
 1448|  11.3k|    const int param_len = 32;
 1449|  11.3k|    const int seed_len = 20;
 1450|  11.3k|    int ok = 0;
 1451|  11.3k|    uint32_t hi_order_n = 0xccd1c8aa;
 1452|  11.3k|    uint32_t lo_order_n = 0xee00bc4f;
 1453|  11.3k|    BIGNUM *p = NULL, *a = NULL, *b = NULL, *x = NULL, *y = NULL, *one = NULL,
 1454|  11.3k|           *order = NULL;
 1455|  11.3k|    EC_POINT *P = NULL;
 1456|       |
 1457|  11.3k|    if ((ctx = BN_CTX_new_ex(group->libctx)) == NULL) {
  ------------------
  |  Branch (1457:9): [True: 0, False: 11.3k]
  ------------------
 1458|      0|        ERR_raise(ERR_LIB_EC, ERR_R_MALLOC_FAILURE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1459|      0|        return 0;
 1460|      0|    }
 1461|       |
 1462|  11.3k|    if (!EC_GROUP_set_seed(group, params, seed_len)) {
  ------------------
  |  Branch (1462:9): [True: 0, False: 11.3k]
  ------------------
 1463|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1464|      0|        goto err;
 1465|      0|    }
 1466|  11.3k|    params += seed_len;
 1467|       |
 1468|  11.3k|    if ((p = BN_bin2bn(params + 0 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (1468:9): [True: 0, False: 11.3k]
  ------------------
 1469|  11.3k|        || (a = BN_bin2bn(params + 1 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (1469:12): [True: 0, False: 11.3k]
  ------------------
 1470|  11.3k|        || (b = BN_bin2bn(params + 2 * param_len, param_len, NULL)) == NULL) {
  ------------------
  |  Branch (1470:12): [True: 0, False: 11.3k]
  ------------------
 1471|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1472|      0|        goto err;
 1473|      0|    }
 1474|       |
 1475|       |    /*
 1476|       |     * Set up curve params and montgomery for field
 1477|       |     * Start by setting up montgomery and one
 1478|       |     */
 1479|  11.3k|    mont = BN_MONT_CTX_new();
 1480|  11.3k|    if (mont == NULL)
  ------------------
  |  Branch (1480:9): [True: 0, False: 11.3k]
  ------------------
 1481|      0|        goto err;
 1482|       |
 1483|  11.3k|    if (!ossl_bn_mont_ctx_set(mont, p, 256, params + 6 * param_len, param_len,
  ------------------
  |  Branch (1483:9): [True: 0, False: 11.3k]
  ------------------
 1484|  11.3k|            1, 0))
 1485|      0|        goto err;
 1486|       |
 1487|  11.3k|    one = BN_new();
 1488|  11.3k|    if (one == NULL) {
  ------------------
  |  Branch (1488:9): [True: 0, False: 11.3k]
  ------------------
 1489|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1490|      0|        goto err;
 1491|      0|    }
 1492|  11.3k|    if (!BN_to_montgomery(one, BN_value_one(), mont, ctx)) {
  ------------------
  |  Branch (1492:9): [True: 0, False: 11.3k]
  ------------------
 1493|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1494|      0|        goto err;
 1495|      0|    }
 1496|  11.3k|    group->field_data1 = mont;
 1497|  11.3k|    mont = NULL;
 1498|  11.3k|    group->field_data2 = one;
 1499|  11.3k|    one = NULL;
 1500|       |
 1501|  11.3k|    if (!ossl_ec_GFp_simple_group_set_curve(group, p, a, b, ctx)) {
  ------------------
  |  Branch (1501:9): [True: 0, False: 11.3k]
  ------------------
 1502|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1503|      0|        goto err;
 1504|      0|    }
 1505|       |
 1506|  11.3k|    if ((P = EC_POINT_new(group)) == NULL) {
  ------------------
  |  Branch (1506:9): [True: 0, False: 11.3k]
  ------------------
 1507|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1508|      0|        goto err;
 1509|      0|    }
 1510|       |
 1511|  11.3k|    if ((x = BN_bin2bn(params + 3 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (1511:9): [True: 0, False: 11.3k]
  ------------------
 1512|  11.3k|        || (y = BN_bin2bn(params + 4 * param_len, param_len, NULL)) == NULL) {
  ------------------
  |  Branch (1512:12): [True: 0, False: 11.3k]
  ------------------
 1513|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1514|      0|        goto err;
 1515|      0|    }
 1516|  11.3k|    if (!EC_POINT_set_affine_coordinates(group, P, x, y, ctx)) {
  ------------------
  |  Branch (1516:9): [True: 0, False: 11.3k]
  ------------------
 1517|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1518|      0|        goto err;
 1519|      0|    }
 1520|  11.3k|    if ((order = BN_bin2bn(params + 5 * param_len, param_len, NULL)) == NULL
  ------------------
  |  Branch (1520:9): [True: 0, False: 11.3k]
  ------------------
 1521|  11.3k|        || !BN_set_word(x, (BN_ULONG)1)) { /* cofactor is 1 */
  ------------------
  |  Branch (1521:12): [True: 0, False: 11.3k]
  ------------------
 1522|      0|        ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1523|      0|        goto err;
 1524|      0|    }
 1525|       |
 1526|       |    /*
 1527|       |     * Set up generator and order and montgomery data
 1528|       |     */
 1529|  11.3k|    group->generator = EC_POINT_new(group);
 1530|  11.3k|    if (group->generator == NULL) {
  ------------------
  |  Branch (1530:9): [True: 0, False: 11.3k]
  ------------------
 1531|      0|        ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1532|      0|        goto err;
 1533|      0|    }
 1534|  11.3k|    if (!EC_POINT_copy(group->generator, P))
  ------------------
  |  Branch (1534:9): [True: 0, False: 11.3k]
  ------------------
 1535|      0|        goto err;
 1536|  11.3k|    if (!BN_copy(group->order, order))
  ------------------
  |  Branch (1536:9): [True: 0, False: 11.3k]
  ------------------
 1537|      0|        goto err;
 1538|  11.3k|    if (!BN_set_word(group->cofactor, 1))
  ------------------
  |  Branch (1538:9): [True: 0, False: 11.3k]
  ------------------
 1539|      0|        goto err;
 1540|       |
 1541|  11.3k|    ordmont = BN_MONT_CTX_new();
 1542|  11.3k|    if (ordmont == NULL)
  ------------------
  |  Branch (1542:9): [True: 0, False: 11.3k]
  ------------------
 1543|      0|        goto err;
 1544|  11.3k|    if (!ossl_bn_mont_ctx_set(ordmont, order, 256, params + 7 * param_len,
  ------------------
  |  Branch (1544:9): [True: 0, False: 11.3k]
  ------------------
 1545|  11.3k|            param_len, lo_order_n, hi_order_n))
 1546|      0|        goto err;
 1547|       |
 1548|  11.3k|    group->mont_data = ordmont;
 1549|  11.3k|    ordmont = NULL;
 1550|       |
 1551|  11.3k|    ok = 1;
 1552|       |
 1553|  11.3k|err:
 1554|  11.3k|    EC_POINT_free(P);
 1555|  11.3k|    BN_CTX_free(ctx);
 1556|  11.3k|    BN_MONT_CTX_free(mont);
 1557|  11.3k|    BN_MONT_CTX_free(ordmont);
 1558|  11.3k|    BN_free(p);
 1559|  11.3k|    BN_free(one);
 1560|  11.3k|    BN_free(a);
 1561|  11.3k|    BN_free(b);
 1562|  11.3k|    BN_free(order);
 1563|  11.3k|    BN_free(x);
 1564|  11.3k|    BN_free(y);
 1565|       |
 1566|  11.3k|    return ok;
 1567|  11.3k|}

ossl_ec_GFp_simple_point2oct:
  162|    452|{
  163|    452|    size_t ret;
  164|    452|    BN_CTX *new_ctx = NULL;
  165|    452|    int used_ctx = 0;
  166|    452|    BIGNUM *x, *y;
  167|    452|    size_t field_len, i, skip;
  168|       |
  169|    452|    if ((form != POINT_CONVERSION_COMPRESSED)
  ------------------
  |  Branch (169:9): [True: 452, False: 0]
  ------------------
  170|    452|        && (form != POINT_CONVERSION_UNCOMPRESSED)
  ------------------
  |  Branch (170:12): [True: 0, False: 452]
  ------------------
  171|      0|        && (form != POINT_CONVERSION_HYBRID)) {
  ------------------
  |  Branch (171:12): [True: 0, False: 0]
  ------------------
  172|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_FORM);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  173|      0|        goto err;
  174|      0|    }
  175|       |
  176|    452|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (176:9): [True: 0, False: 452]
  ------------------
  177|       |        /* encodes to a single 0 octet */
  178|      0|        if (buf != NULL) {
  ------------------
  |  Branch (178:13): [True: 0, False: 0]
  ------------------
  179|      0|            if (len < 1) {
  ------------------
  |  Branch (179:17): [True: 0, False: 0]
  ------------------
  180|      0|                ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  181|      0|                return 0;
  182|      0|            }
  183|      0|            buf[0] = 0;
  184|      0|        }
  185|      0|        return 1;
  186|      0|    }
  187|       |
  188|       |    /* ret := required output buffer length */
  189|    452|    field_len = BN_num_bytes(group->field);
  ------------------
  |  |  188|    452|#define BN_num_bytes(a) ((BN_num_bits(a) + 7) / 8)
  ------------------
  190|    452|    ret = (form == POINT_CONVERSION_COMPRESSED) ? 1 + field_len : 1 + 2 * field_len;
  ------------------
  |  Branch (190:11): [True: 0, False: 452]
  ------------------
  191|       |
  192|       |    /* if 'buf' is NULL, just return required length */
  193|    452|    if (buf != NULL) {
  ------------------
  |  Branch (193:9): [True: 226, False: 226]
  ------------------
  194|    226|        if (len < ret) {
  ------------------
  |  Branch (194:13): [True: 0, False: 226]
  ------------------
  195|      0|            ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  196|      0|            goto err;
  197|      0|        }
  198|       |
  199|    226|        if (ctx == NULL) {
  ------------------
  |  Branch (199:13): [True: 0, False: 226]
  ------------------
  200|      0|            ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  201|      0|            if (ctx == NULL)
  ------------------
  |  Branch (201:17): [True: 0, False: 0]
  ------------------
  202|      0|                return 0;
  203|      0|        }
  204|       |
  205|    226|        BN_CTX_start(ctx);
  206|    226|        used_ctx = 1;
  207|    226|        x = BN_CTX_get(ctx);
  208|    226|        y = BN_CTX_get(ctx);
  209|    226|        if (y == NULL)
  ------------------
  |  Branch (209:13): [True: 0, False: 226]
  ------------------
  210|      0|            goto err;
  211|       |
  212|    226|        if (!EC_POINT_get_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (212:13): [True: 0, False: 226]
  ------------------
  213|      0|            goto err;
  214|       |
  215|    226|        if ((form == POINT_CONVERSION_COMPRESSED
  ------------------
  |  Branch (215:14): [True: 0, False: 226]
  ------------------
  216|    226|                || form == POINT_CONVERSION_HYBRID)
  ------------------
  |  Branch (216:20): [True: 0, False: 226]
  ------------------
  217|      0|            && BN_is_odd(y))
  ------------------
  |  Branch (217:16): [True: 0, False: 0]
  ------------------
  218|      0|            buf[0] = form + 1;
  219|    226|        else
  220|    226|            buf[0] = form;
  221|       |
  222|    226|        i = 1;
  223|       |
  224|    226|        skip = field_len - BN_num_bytes(x);
  ------------------
  |  |  188|    226|#define BN_num_bytes(a) ((BN_num_bits(a) + 7) / 8)
  ------------------
  225|    226|        if (skip > field_len) {
  ------------------
  |  Branch (225:13): [True: 0, False: 226]
  ------------------
  226|      0|            ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  227|      0|            goto err;
  228|      0|        }
  229|    235|        while (skip > 0) {
  ------------------
  |  Branch (229:16): [True: 9, False: 226]
  ------------------
  230|      9|            buf[i++] = 0;
  231|      9|            skip--;
  232|      9|        }
  233|    226|        skip = BN_bn2bin(x, buf + i);
  234|    226|        i += skip;
  235|    226|        if (i != 1 + field_len) {
  ------------------
  |  Branch (235:13): [True: 0, False: 226]
  ------------------
  236|      0|            ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  237|      0|            goto err;
  238|      0|        }
  239|       |
  240|    226|        if (form == POINT_CONVERSION_UNCOMPRESSED
  ------------------
  |  Branch (240:13): [True: 226, False: 0]
  ------------------
  241|    226|            || form == POINT_CONVERSION_HYBRID) {
  ------------------
  |  Branch (241:16): [True: 0, False: 0]
  ------------------
  242|    226|            skip = field_len - BN_num_bytes(y);
  ------------------
  |  |  188|    226|#define BN_num_bytes(a) ((BN_num_bits(a) + 7) / 8)
  ------------------
  243|    226|            if (skip > field_len) {
  ------------------
  |  Branch (243:17): [True: 0, False: 226]
  ------------------
  244|      0|                ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  245|      0|                goto err;
  246|      0|            }
  247|    235|            while (skip > 0) {
  ------------------
  |  Branch (247:20): [True: 9, False: 226]
  ------------------
  248|      9|                buf[i++] = 0;
  249|      9|                skip--;
  250|      9|            }
  251|    226|            skip = BN_bn2bin(y, buf + i);
  252|    226|            i += skip;
  253|    226|        }
  254|       |
  255|    226|        if (i != ret) {
  ------------------
  |  Branch (255:13): [True: 0, False: 226]
  ------------------
  256|      0|            ERR_raise(ERR_LIB_EC, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  257|      0|            goto err;
  258|      0|        }
  259|    226|    }
  260|       |
  261|    452|    if (used_ctx)
  ------------------
  |  Branch (261:9): [True: 226, False: 226]
  ------------------
  262|    226|        BN_CTX_end(ctx);
  263|    452|    BN_CTX_free(new_ctx);
  264|    452|    return ret;
  265|       |
  266|      0|err:
  267|      0|    if (used_ctx)
  ------------------
  |  Branch (267:9): [True: 0, False: 0]
  ------------------
  268|      0|        BN_CTX_end(ctx);
  269|      0|    BN_CTX_free(new_ctx);
  270|      0|    return 0;
  271|    452|}
ossl_ec_GFp_simple_oct2point:
  276|   112k|{
  277|   112k|    point_conversion_form_t form;
  278|   112k|    int y_bit;
  279|   112k|    BN_CTX *new_ctx = NULL;
  280|   112k|    BIGNUM *x, *y;
  281|   112k|    int field_len, enc_len;
  282|   112k|    int ret = 0;
  283|       |
  284|   112k|    if (len == 0) {
  ------------------
  |  Branch (284:9): [True: 0, False: 112k]
  ------------------
  285|      0|        ERR_raise(ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  286|      0|        return 0;
  287|      0|    }
  288|   112k|    form = buf[0];
  289|   112k|    y_bit = form & 1;
  290|   112k|    form = form & ~1U;
  291|   112k|    if ((form != 0) && (form != POINT_CONVERSION_COMPRESSED)
  ------------------
  |  Branch (291:9): [True: 112k, False: 0]
  |  Branch (291:24): [True: 112k, False: 0]
  ------------------
  292|   112k|        && (form != POINT_CONVERSION_UNCOMPRESSED)
  ------------------
  |  Branch (292:12): [True: 0, False: 112k]
  ------------------
  293|      0|        && (form != POINT_CONVERSION_HYBRID)) {
  ------------------
  |  Branch (293:12): [True: 0, False: 0]
  ------------------
  294|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  295|      0|        return 0;
  296|      0|    }
  297|   112k|    if ((form == 0 || form == POINT_CONVERSION_UNCOMPRESSED) && y_bit) {
  ------------------
  |  Branch (297:10): [True: 0, False: 112k]
  |  Branch (297:23): [True: 112k, False: 0]
  |  Branch (297:65): [True: 0, False: 112k]
  ------------------
  298|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  299|      0|        return 0;
  300|      0|    }
  301|       |
  302|   112k|    if (form == 0) {
  ------------------
  |  Branch (302:9): [True: 0, False: 112k]
  ------------------
  303|      0|        if (len != 1) {
  ------------------
  |  Branch (303:13): [True: 0, False: 0]
  ------------------
  304|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  305|      0|            return 0;
  306|      0|        }
  307|       |
  308|      0|        return EC_POINT_set_to_infinity(group, point);
  309|      0|    }
  310|       |
  311|   112k|    field_len = BN_num_bytes(group->field);
  ------------------
  |  |  188|   112k|#define BN_num_bytes(a) ((BN_num_bits(a) + 7) / 8)
  ------------------
  312|   112k|    enc_len = (form == POINT_CONVERSION_COMPRESSED) ? 1 + field_len : 1 + 2 * field_len;
  ------------------
  |  Branch (312:15): [True: 0, False: 112k]
  ------------------
  313|       |
  314|   112k|    if (len != (size_t)enc_len) {
  ------------------
  |  Branch (314:9): [True: 0, False: 112k]
  ------------------
  315|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  316|      0|        return 0;
  317|      0|    }
  318|       |
  319|   112k|    if (ctx == NULL) {
  ------------------
  |  Branch (319:9): [True: 112k, False: 0]
  ------------------
  320|   112k|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  321|   112k|        if (ctx == NULL)
  ------------------
  |  Branch (321:13): [True: 0, False: 112k]
  ------------------
  322|      0|            return 0;
  323|   112k|    }
  324|       |
  325|   112k|    BN_CTX_start(ctx);
  326|   112k|    x = BN_CTX_get(ctx);
  327|   112k|    y = BN_CTX_get(ctx);
  328|   112k|    if (y == NULL)
  ------------------
  |  Branch (328:9): [True: 0, False: 112k]
  ------------------
  329|      0|        goto err;
  330|       |
  331|   112k|    if (!BN_bin2bn(buf + 1, field_len, x))
  ------------------
  |  Branch (331:9): [True: 0, False: 112k]
  ------------------
  332|      0|        goto err;
  333|   112k|    if (BN_ucmp(x, group->field) >= 0) {
  ------------------
  |  Branch (333:9): [True: 0, False: 112k]
  ------------------
  334|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  335|      0|        goto err;
  336|      0|    }
  337|       |
  338|   112k|    if (form == POINT_CONVERSION_COMPRESSED) {
  ------------------
  |  Branch (338:9): [True: 0, False: 112k]
  ------------------
  339|      0|        if (!EC_POINT_set_compressed_coordinates(group, point, x, y_bit, ctx))
  ------------------
  |  Branch (339:13): [True: 0, False: 0]
  ------------------
  340|      0|            goto err;
  341|   112k|    } else {
  342|   112k|        if (!BN_bin2bn(buf + 1 + field_len, field_len, y))
  ------------------
  |  Branch (342:13): [True: 0, False: 112k]
  ------------------
  343|      0|            goto err;
  344|   112k|        if (BN_ucmp(y, group->field) >= 0) {
  ------------------
  |  Branch (344:13): [True: 0, False: 112k]
  ------------------
  345|      0|            ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  346|      0|            goto err;
  347|      0|        }
  348|   112k|        if (form == POINT_CONVERSION_HYBRID) {
  ------------------
  |  Branch (348:13): [True: 0, False: 112k]
  ------------------
  349|      0|            if (y_bit != BN_is_odd(y)) {
  ------------------
  |  Branch (349:17): [True: 0, False: 0]
  ------------------
  350|      0|                ERR_raise(ERR_LIB_EC, EC_R_INVALID_ENCODING);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  351|      0|                goto err;
  352|      0|            }
  353|      0|        }
  354|       |
  355|       |        /*
  356|       |         * EC_POINT_set_affine_coordinates is responsible for checking that
  357|       |         * the point is on the curve.
  358|       |         */
  359|   112k|        if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx))
  ------------------
  |  Branch (359:13): [True: 0, False: 112k]
  ------------------
  360|      0|            goto err;
  361|   112k|    }
  362|       |
  363|   112k|    ret = 1;
  364|       |
  365|   112k|err:
  366|   112k|    BN_CTX_end(ctx);
  367|   112k|    BN_CTX_free(new_ctx);
  368|   112k|    return ret;
  369|   112k|}

ossl_ec_GFp_simple_group_init:
   99|   226k|{
  100|   226k|    group->field = BN_new();
  101|   226k|    group->a = BN_new();
  102|   226k|    group->b = BN_new();
  103|   226k|    if (group->field == NULL || group->a == NULL || group->b == NULL) {
  ------------------
  |  Branch (103:9): [True: 0, False: 226k]
  |  Branch (103:33): [True: 0, False: 226k]
  |  Branch (103:53): [True: 0, False: 226k]
  ------------------
  104|      0|        BN_free(group->field);
  105|      0|        BN_free(group->a);
  106|      0|        BN_free(group->b);
  107|      0|        return 0;
  108|      0|    }
  109|   226k|    group->a_is_minus3 = 0;
  110|   226k|    return 1;
  111|   226k|}
ossl_ec_GFp_simple_group_finish:
  114|   226k|{
  115|   226k|    BN_free(group->field);
  116|   226k|    BN_free(group->a);
  117|   226k|    BN_free(group->b);
  118|   226k|}
ossl_ec_GFp_simple_group_copy:
  128|   113k|{
  129|   113k|    if (!BN_copy(dest->field, src->field))
  ------------------
  |  Branch (129:9): [True: 0, False: 113k]
  ------------------
  130|      0|        return 0;
  131|   113k|    if (!BN_copy(dest->a, src->a))
  ------------------
  |  Branch (131:9): [True: 0, False: 113k]
  ------------------
  132|      0|        return 0;
  133|   113k|    if (!BN_copy(dest->b, src->b))
  ------------------
  |  Branch (133:9): [True: 0, False: 113k]
  ------------------
  134|      0|        return 0;
  135|       |
  136|   113k|    dest->a_is_minus3 = src->a_is_minus3;
  137|       |
  138|   113k|    return 1;
  139|   113k|}
ossl_ec_GFp_simple_group_set_curve:
  144|   113k|{
  145|   113k|    int ret = 0;
  146|   113k|    BN_CTX *new_ctx = NULL;
  147|   113k|    BIGNUM *tmp_a;
  148|       |
  149|       |    /* p must be a prime > 3 */
  150|   113k|    if (BN_num_bits(p) <= 2 || !BN_is_odd(p)) {
  ------------------
  |  Branch (150:9): [True: 0, False: 113k]
  |  Branch (150:32): [True: 0, False: 113k]
  ------------------
  151|      0|        ERR_raise(ERR_LIB_EC, EC_R_INVALID_FIELD);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  152|      0|        return 0;
  153|      0|    }
  154|       |
  155|   113k|    if (ctx == NULL) {
  ------------------
  |  Branch (155:9): [True: 0, False: 113k]
  ------------------
  156|      0|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  157|      0|        if (ctx == NULL)
  ------------------
  |  Branch (157:13): [True: 0, False: 0]
  ------------------
  158|      0|            return 0;
  159|      0|    }
  160|       |
  161|   113k|    BN_CTX_start(ctx);
  162|   113k|    tmp_a = BN_CTX_get(ctx);
  163|   113k|    if (tmp_a == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 113k]
  ------------------
  164|      0|        goto err;
  165|       |
  166|       |    /* group->field */
  167|   113k|    if (!BN_copy(group->field, p))
  ------------------
  |  Branch (167:9): [True: 0, False: 113k]
  ------------------
  168|      0|        goto err;
  169|   113k|    BN_set_negative(group->field, 0);
  170|       |
  171|       |    /* group->a */
  172|   113k|    if (!BN_nnmod(tmp_a, a, p, ctx))
  ------------------
  |  Branch (172:9): [True: 0, False: 113k]
  ------------------
  173|      0|        goto err;
  174|   113k|    if (group->meth->field_encode != NULL) {
  ------------------
  |  Branch (174:9): [True: 11.4k, False: 101k]
  ------------------
  175|  11.4k|        if (!group->meth->field_encode(group, group->a, tmp_a, ctx))
  ------------------
  |  Branch (175:13): [True: 0, False: 11.4k]
  ------------------
  176|      0|            goto err;
  177|   101k|    } else if (!BN_copy(group->a, tmp_a))
  ------------------
  |  Branch (177:16): [True: 0, False: 101k]
  ------------------
  178|      0|        goto err;
  179|       |
  180|       |    /* group->b */
  181|   113k|    if (!BN_nnmod(group->b, b, p, ctx))
  ------------------
  |  Branch (181:9): [True: 0, False: 113k]
  ------------------
  182|      0|        goto err;
  183|   113k|    if (group->meth->field_encode != NULL)
  ------------------
  |  Branch (183:9): [True: 11.4k, False: 101k]
  ------------------
  184|  11.4k|        if (!group->meth->field_encode(group, group->b, group->b, ctx))
  ------------------
  |  Branch (184:13): [True: 0, False: 11.4k]
  ------------------
  185|      0|            goto err;
  186|       |
  187|       |    /* group->a_is_minus3 */
  188|   113k|    if (!BN_add_word(tmp_a, 3))
  ------------------
  |  Branch (188:9): [True: 0, False: 113k]
  ------------------
  189|      0|        goto err;
  190|   113k|    group->a_is_minus3 = (0 == BN_cmp(tmp_a, group->field));
  191|       |
  192|   113k|    ret = 1;
  193|       |
  194|   113k|err:
  195|   113k|    BN_CTX_end(ctx);
  196|   113k|    BN_CTX_free(new_ctx);
  197|   113k|    return ret;
  198|   113k|}
ossl_ec_GFp_simple_point_init:
  323|   453k|{
  324|   453k|    point->X = BN_new();
  325|   453k|    point->Y = BN_new();
  326|   453k|    point->Z = BN_new();
  327|   453k|    point->Z_is_one = 0;
  328|       |
  329|   453k|    if (point->X == NULL || point->Y == NULL || point->Z == NULL) {
  ------------------
  |  Branch (329:9): [True: 0, False: 453k]
  |  Branch (329:29): [True: 0, False: 453k]
  |  Branch (329:49): [True: 0, False: 453k]
  ------------------
  330|      0|        BN_free(point->X);
  331|      0|        BN_free(point->Y);
  332|      0|        BN_free(point->Z);
  333|      0|        return 0;
  334|      0|    }
  335|   453k|    return 1;
  336|   453k|}
ossl_ec_GFp_simple_point_finish:
  339|   452k|{
  340|   452k|    BN_free(point->X);
  341|   452k|    BN_free(point->Y);
  342|   452k|    BN_free(point->Z);
  343|   452k|}
ossl_ec_GFp_simple_point_clear_finish:
  346|    144|{
  347|    144|    BN_clear_free(point->X);
  348|    144|    BN_clear_free(point->Y);
  349|    144|    BN_clear_free(point->Z);
  350|    144|    point->Z_is_one = 0;
  351|    144|}
ossl_ec_GFp_simple_point_copy:
  354|   226k|{
  355|   226k|    if (!BN_copy(dest->X, src->X))
  ------------------
  |  Branch (355:9): [True: 0, False: 226k]
  ------------------
  356|      0|        return 0;
  357|   226k|    if (!BN_copy(dest->Y, src->Y))
  ------------------
  |  Branch (357:9): [True: 0, False: 226k]
  ------------------
  358|      0|        return 0;
  359|   226k|    if (!BN_copy(dest->Z, src->Z))
  ------------------
  |  Branch (359:9): [True: 0, False: 226k]
  ------------------
  360|      0|        return 0;
  361|   226k|    dest->Z_is_one = src->Z_is_one;
  362|   226k|    dest->curve_name = src->curve_name;
  363|       |
  364|   226k|    return 1;
  365|   226k|}
ossl_ec_GFp_simple_set_Jprojective_coordinates_GFp:
  381|   226k|{
  382|   226k|    BN_CTX *new_ctx = NULL;
  383|   226k|    int ret = 0;
  384|       |
  385|   226k|    if (ctx == NULL) {
  ------------------
  |  Branch (385:9): [True: 0, False: 226k]
  ------------------
  386|      0|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  387|      0|        if (ctx == NULL)
  ------------------
  |  Branch (387:13): [True: 0, False: 0]
  ------------------
  388|      0|            return 0;
  389|      0|    }
  390|       |
  391|   226k|    if (x != NULL) {
  ------------------
  |  Branch (391:9): [True: 226k, False: 0]
  ------------------
  392|   226k|        if (!BN_nnmod(point->X, x, group->field, ctx))
  ------------------
  |  Branch (392:13): [True: 0, False: 226k]
  ------------------
  393|      0|            goto err;
  394|   226k|        if (group->meth->field_encode) {
  ------------------
  |  Branch (394:13): [True: 22.7k, False: 203k]
  ------------------
  395|  22.7k|            if (!group->meth->field_encode(group, point->X, point->X, ctx))
  ------------------
  |  Branch (395:17): [True: 0, False: 22.7k]
  ------------------
  396|      0|                goto err;
  397|  22.7k|        }
  398|   226k|    }
  399|       |
  400|   226k|    if (y != NULL) {
  ------------------
  |  Branch (400:9): [True: 226k, False: 0]
  ------------------
  401|   226k|        if (!BN_nnmod(point->Y, y, group->field, ctx))
  ------------------
  |  Branch (401:13): [True: 0, False: 226k]
  ------------------
  402|      0|            goto err;
  403|   226k|        if (group->meth->field_encode) {
  ------------------
  |  Branch (403:13): [True: 22.7k, False: 203k]
  ------------------
  404|  22.7k|            if (!group->meth->field_encode(group, point->Y, point->Y, ctx))
  ------------------
  |  Branch (404:17): [True: 0, False: 22.7k]
  ------------------
  405|      0|                goto err;
  406|  22.7k|        }
  407|   226k|    }
  408|       |
  409|   226k|    if (z != NULL) {
  ------------------
  |  Branch (409:9): [True: 226k, False: 0]
  ------------------
  410|   226k|        int Z_is_one;
  411|       |
  412|   226k|        if (!BN_nnmod(point->Z, z, group->field, ctx))
  ------------------
  |  Branch (412:13): [True: 0, False: 226k]
  ------------------
  413|      0|            goto err;
  414|   226k|        Z_is_one = BN_is_one(point->Z);
  415|   226k|        if (group->meth->field_encode) {
  ------------------
  |  Branch (415:13): [True: 22.7k, False: 203k]
  ------------------
  416|  22.7k|            if (Z_is_one && (group->meth->field_set_to_one != 0)) {
  ------------------
  |  Branch (416:17): [True: 22.7k, False: 0]
  |  Branch (416:29): [True: 22.7k, False: 0]
  ------------------
  417|  22.7k|                if (!group->meth->field_set_to_one(group, point->Z, ctx))
  ------------------
  |  Branch (417:21): [True: 0, False: 22.7k]
  ------------------
  418|      0|                    goto err;
  419|  22.7k|            } else {
  420|      0|                if (!group->meth->field_encode(group, point->Z, point->Z, ctx))
  ------------------
  |  Branch (420:21): [True: 0, False: 0]
  ------------------
  421|      0|                    goto err;
  422|      0|            }
  423|  22.7k|        }
  424|   226k|        point->Z_is_one = Z_is_one;
  425|   226k|    }
  426|       |
  427|   226k|    ret = 1;
  428|       |
  429|   226k|err:
  430|   226k|    BN_CTX_free(new_ctx);
  431|   226k|    return ret;
  432|   226k|}
ossl_ec_GFp_simple_point_set_affine_coordinates:
  487|   226k|{
  488|   226k|    if (x == NULL || y == NULL) {
  ------------------
  |  Branch (488:9): [True: 0, False: 226k]
  |  Branch (488:22): [True: 0, False: 226k]
  ------------------
  489|       |        /*
  490|       |         * unlike for projective coordinates, we do not tolerate this
  491|       |         */
  492|      0|        ERR_raise(ERR_LIB_EC, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  493|      0|        return 0;
  494|      0|    }
  495|       |
  496|   226k|    return EC_POINT_set_Jprojective_coordinates_GFp(group, point, x, y,
  497|   226k|        BN_value_one(), ctx);
  498|   226k|}
ossl_ec_GFp_simple_point_get_affine_coordinates:
  504|    144|{
  505|    144|    BN_CTX *new_ctx = NULL;
  506|    144|    BIGNUM *Z, *Z_1, *Z_2, *Z_3;
  507|    144|    const BIGNUM *Z_;
  508|    144|    int ret = 0;
  509|       |
  510|    144|    if (EC_POINT_is_at_infinity(group, point)) {
  ------------------
  |  Branch (510:9): [True: 0, False: 144]
  ------------------
  511|      0|        ERR_raise(ERR_LIB_EC, EC_R_POINT_AT_INFINITY);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  512|      0|        return 0;
  513|      0|    }
  514|       |
  515|    144|    if (ctx == NULL) {
  ------------------
  |  Branch (515:9): [True: 0, False: 144]
  ------------------
  516|      0|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  517|      0|        if (ctx == NULL)
  ------------------
  |  Branch (517:13): [True: 0, False: 0]
  ------------------
  518|      0|            return 0;
  519|      0|    }
  520|       |
  521|    144|    BN_CTX_start(ctx);
  522|    144|    Z = BN_CTX_get(ctx);
  523|    144|    Z_1 = BN_CTX_get(ctx);
  524|    144|    Z_2 = BN_CTX_get(ctx);
  525|    144|    Z_3 = BN_CTX_get(ctx);
  526|    144|    if (Z_3 == NULL)
  ------------------
  |  Branch (526:9): [True: 0, False: 144]
  ------------------
  527|      0|        goto err;
  528|       |
  529|       |    /* transform  (X, Y, Z)  into  (x, y) := (X/Z^2, Y/Z^3) */
  530|       |
  531|    144|    if (group->meth->field_decode != NULL) {
  ------------------
  |  Branch (531:9): [True: 144, False: 0]
  ------------------
  532|    144|        if (!group->meth->field_decode(group, Z, point->Z, ctx))
  ------------------
  |  Branch (532:13): [True: 0, False: 144]
  ------------------
  533|      0|            goto err;
  534|    144|        Z_ = Z;
  535|    144|    } else {
  536|      0|        Z_ = point->Z;
  537|      0|    }
  538|       |
  539|    144|    if (BN_is_one(Z_)) {
  ------------------
  |  Branch (539:9): [True: 144, False: 0]
  ------------------
  540|    144|        if (group->meth->field_decode != NULL) {
  ------------------
  |  Branch (540:13): [True: 144, False: 0]
  ------------------
  541|    144|            if (x != NULL) {
  ------------------
  |  Branch (541:17): [True: 144, False: 0]
  ------------------
  542|    144|                if (!group->meth->field_decode(group, x, point->X, ctx))
  ------------------
  |  Branch (542:21): [True: 0, False: 144]
  ------------------
  543|      0|                    goto err;
  544|    144|            }
  545|    144|            if (y != NULL) {
  ------------------
  |  Branch (545:17): [True: 144, False: 0]
  ------------------
  546|    144|                if (!group->meth->field_decode(group, y, point->Y, ctx))
  ------------------
  |  Branch (546:21): [True: 0, False: 144]
  ------------------
  547|      0|                    goto err;
  548|    144|            }
  549|    144|        } else {
  550|      0|            if (x != NULL) {
  ------------------
  |  Branch (550:17): [True: 0, False: 0]
  ------------------
  551|      0|                if (!BN_copy(x, point->X))
  ------------------
  |  Branch (551:21): [True: 0, False: 0]
  ------------------
  552|      0|                    goto err;
  553|      0|            }
  554|      0|            if (y != NULL) {
  ------------------
  |  Branch (554:17): [True: 0, False: 0]
  ------------------
  555|      0|                if (!BN_copy(y, point->Y))
  ------------------
  |  Branch (555:21): [True: 0, False: 0]
  ------------------
  556|      0|                    goto err;
  557|      0|            }
  558|      0|        }
  559|    144|    } else {
  560|      0|        if (!group->meth->field_inv(group, Z_1, Z_, ctx)) {
  ------------------
  |  Branch (560:13): [True: 0, False: 0]
  ------------------
  561|      0|            ERR_raise(ERR_LIB_EC, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  562|      0|            goto err;
  563|      0|        }
  564|       |
  565|      0|        if (group->meth->field_encode == NULL) {
  ------------------
  |  Branch (565:13): [True: 0, False: 0]
  ------------------
  566|       |            /* field_sqr works on standard representation */
  567|      0|            if (!group->meth->field_sqr(group, Z_2, Z_1, ctx))
  ------------------
  |  Branch (567:17): [True: 0, False: 0]
  ------------------
  568|      0|                goto err;
  569|      0|        } else {
  570|      0|            if (!BN_mod_sqr(Z_2, Z_1, group->field, ctx))
  ------------------
  |  Branch (570:17): [True: 0, False: 0]
  ------------------
  571|      0|                goto err;
  572|      0|        }
  573|       |
  574|      0|        if (x != NULL) {
  ------------------
  |  Branch (574:13): [True: 0, False: 0]
  ------------------
  575|       |            /*
  576|       |             * in the Montgomery case, field_mul will cancel out Montgomery
  577|       |             * factor in X:
  578|       |             */
  579|      0|            if (!group->meth->field_mul(group, x, point->X, Z_2, ctx))
  ------------------
  |  Branch (579:17): [True: 0, False: 0]
  ------------------
  580|      0|                goto err;
  581|      0|        }
  582|       |
  583|      0|        if (y != NULL) {
  ------------------
  |  Branch (583:13): [True: 0, False: 0]
  ------------------
  584|      0|            if (group->meth->field_encode == NULL) {
  ------------------
  |  Branch (584:17): [True: 0, False: 0]
  ------------------
  585|       |                /*
  586|       |                 * field_mul works on standard representation
  587|       |                 */
  588|      0|                if (!group->meth->field_mul(group, Z_3, Z_2, Z_1, ctx))
  ------------------
  |  Branch (588:21): [True: 0, False: 0]
  ------------------
  589|      0|                    goto err;
  590|      0|            } else {
  591|      0|                if (!BN_mod_mul(Z_3, Z_2, Z_1, group->field, ctx))
  ------------------
  |  Branch (591:21): [True: 0, False: 0]
  ------------------
  592|      0|                    goto err;
  593|      0|            }
  594|       |
  595|       |            /*
  596|       |             * in the Montgomery case, field_mul will cancel out Montgomery
  597|       |             * factor in Y:
  598|       |             */
  599|      0|            if (!group->meth->field_mul(group, y, point->Y, Z_3, ctx))
  ------------------
  |  Branch (599:17): [True: 0, False: 0]
  ------------------
  600|      0|                goto err;
  601|      0|        }
  602|      0|    }
  603|       |
  604|    144|    ret = 1;
  605|       |
  606|    144|err:
  607|    144|    BN_CTX_end(ctx);
  608|    144|    BN_CTX_free(new_ctx);
  609|    144|    return ret;
  610|    144|}
ossl_ec_GFp_simple_is_at_infinity:
  951|   227k|{
  952|   227k|    return BN_is_zero(point->Z);
  953|   227k|}
ossl_ec_GFp_simple_is_on_curve:
  957|   226k|{
  958|   226k|    int (*field_mul)(const EC_GROUP *, BIGNUM *, const BIGNUM *,
  959|   226k|        const BIGNUM *, BN_CTX *);
  960|   226k|    int (*field_sqr)(const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *);
  961|   226k|    const BIGNUM *p;
  962|   226k|    BN_CTX *new_ctx = NULL;
  963|   226k|    BIGNUM *rh, *tmp, *Z4, *Z6;
  964|   226k|    int ret = -1;
  965|       |
  966|   226k|    if (EC_POINT_is_at_infinity(group, point))
  ------------------
  |  Branch (966:9): [True: 0, False: 226k]
  ------------------
  967|      0|        return 1;
  968|       |
  969|   226k|    field_mul = group->meth->field_mul;
  970|   226k|    field_sqr = group->meth->field_sqr;
  971|   226k|    p = group->field;
  972|       |
  973|   226k|    if (ctx == NULL) {
  ------------------
  |  Branch (973:9): [True: 0, False: 226k]
  ------------------
  974|      0|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
  975|      0|        if (ctx == NULL)
  ------------------
  |  Branch (975:13): [True: 0, False: 0]
  ------------------
  976|      0|            return -1;
  977|      0|    }
  978|       |
  979|   226k|    BN_CTX_start(ctx);
  980|   226k|    rh = BN_CTX_get(ctx);
  981|   226k|    tmp = BN_CTX_get(ctx);
  982|   226k|    Z4 = BN_CTX_get(ctx);
  983|   226k|    Z6 = BN_CTX_get(ctx);
  984|   226k|    if (Z6 == NULL)
  ------------------
  |  Branch (984:9): [True: 0, False: 226k]
  ------------------
  985|      0|        goto err;
  986|       |
  987|       |    /*-
  988|       |     * We have a curve defined by a Weierstrass equation
  989|       |     *      y^2 = x^3 + a*x + b.
  990|       |     * The point to consider is given in Jacobian projective coordinates
  991|       |     * where  (X, Y, Z)  represents  (x, y) = (X/Z^2, Y/Z^3).
  992|       |     * Substituting this and multiplying by  Z^6  transforms the above equation into
  993|       |     *      Y^2 = X^3 + a*X*Z^4 + b*Z^6.
  994|       |     * To test this, we add up the right-hand side in 'rh'.
  995|       |     */
  996|       |
  997|       |    /* rh := X^2 */
  998|   226k|    if (!field_sqr(group, rh, point->X, ctx))
  ------------------
  |  Branch (998:9): [True: 0, False: 226k]
  ------------------
  999|      0|        goto err;
 1000|       |
 1001|   226k|    if (!point->Z_is_one) {
  ------------------
  |  Branch (1001:9): [True: 0, False: 226k]
  ------------------
 1002|      0|        if (!field_sqr(group, tmp, point->Z, ctx))
  ------------------
  |  Branch (1002:13): [True: 0, False: 0]
  ------------------
 1003|      0|            goto err;
 1004|      0|        if (!field_sqr(group, Z4, tmp, ctx))
  ------------------
  |  Branch (1004:13): [True: 0, False: 0]
  ------------------
 1005|      0|            goto err;
 1006|      0|        if (!field_mul(group, Z6, Z4, tmp, ctx))
  ------------------
  |  Branch (1006:13): [True: 0, False: 0]
  ------------------
 1007|      0|            goto err;
 1008|       |
 1009|       |        /* rh := (rh + a*Z^4)*X */
 1010|      0|        if (group->a_is_minus3) {
  ------------------
  |  Branch (1010:13): [True: 0, False: 0]
  ------------------
 1011|      0|            if (!BN_mod_lshift1_quick(tmp, Z4, p))
  ------------------
  |  Branch (1011:17): [True: 0, False: 0]
  ------------------
 1012|      0|                goto err;
 1013|      0|            if (!BN_mod_add_quick(tmp, tmp, Z4, p))
  ------------------
  |  Branch (1013:17): [True: 0, False: 0]
  ------------------
 1014|      0|                goto err;
 1015|      0|            if (!BN_mod_sub_quick(rh, rh, tmp, p))
  ------------------
  |  Branch (1015:17): [True: 0, False: 0]
  ------------------
 1016|      0|                goto err;
 1017|      0|            if (!field_mul(group, rh, rh, point->X, ctx))
  ------------------
  |  Branch (1017:17): [True: 0, False: 0]
  ------------------
 1018|      0|                goto err;
 1019|      0|        } else {
 1020|      0|            if (!field_mul(group, tmp, Z4, group->a, ctx))
  ------------------
  |  Branch (1020:17): [True: 0, False: 0]
  ------------------
 1021|      0|                goto err;
 1022|      0|            if (!BN_mod_add_quick(rh, rh, tmp, p))
  ------------------
  |  Branch (1022:17): [True: 0, False: 0]
  ------------------
 1023|      0|                goto err;
 1024|      0|            if (!field_mul(group, rh, rh, point->X, ctx))
  ------------------
  |  Branch (1024:17): [True: 0, False: 0]
  ------------------
 1025|      0|                goto err;
 1026|      0|        }
 1027|       |
 1028|       |        /* rh := rh + b*Z^6 */
 1029|      0|        if (!field_mul(group, tmp, group->b, Z6, ctx))
  ------------------
  |  Branch (1029:13): [True: 0, False: 0]
  ------------------
 1030|      0|            goto err;
 1031|      0|        if (!BN_mod_add_quick(rh, rh, tmp, p))
  ------------------
  |  Branch (1031:13): [True: 0, False: 0]
  ------------------
 1032|      0|            goto err;
 1033|   226k|    } else {
 1034|       |        /* point->Z_is_one */
 1035|       |
 1036|       |        /* rh := (rh + a)*X */
 1037|   226k|        if (!BN_mod_add_quick(rh, rh, group->a, p))
  ------------------
  |  Branch (1037:13): [True: 0, False: 226k]
  ------------------
 1038|      0|            goto err;
 1039|   226k|        if (!field_mul(group, rh, rh, point->X, ctx))
  ------------------
  |  Branch (1039:13): [True: 0, False: 226k]
  ------------------
 1040|      0|            goto err;
 1041|       |        /* rh := rh + b */
 1042|   226k|        if (!BN_mod_add_quick(rh, rh, group->b, p))
  ------------------
  |  Branch (1042:13): [True: 0, False: 226k]
  ------------------
 1043|      0|            goto err;
 1044|   226k|    }
 1045|       |
 1046|       |    /* 'lh' := Y^2 */
 1047|   226k|    if (!field_sqr(group, tmp, point->Y, ctx))
  ------------------
  |  Branch (1047:9): [True: 0, False: 226k]
  ------------------
 1048|      0|        goto err;
 1049|       |
 1050|   226k|    ret = (0 == BN_ucmp(tmp, rh));
 1051|       |
 1052|   226k|err:
 1053|   226k|    BN_CTX_end(ctx);
 1054|   226k|    BN_CTX_free(new_ctx);
 1055|   226k|    return ret;
 1056|   226k|}
ossl_ec_GFp_simple_cmp:
 1060|     29|{
 1061|       |    /*-
 1062|       |     * return values:
 1063|       |     *  -1   error
 1064|       |     *   0   equal (in affine coordinates)
 1065|       |     *   1   not equal
 1066|       |     */
 1067|       |
 1068|     29|    int (*field_mul)(const EC_GROUP *, BIGNUM *, const BIGNUM *,
 1069|     29|        const BIGNUM *, BN_CTX *);
 1070|     29|    int (*field_sqr)(const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *);
 1071|     29|    BN_CTX *new_ctx = NULL;
 1072|     29|    BIGNUM *tmp1, *tmp2, *Za23, *Zb23;
 1073|     29|    const BIGNUM *tmp1_, *tmp2_;
 1074|     29|    int ret = -1;
 1075|       |
 1076|     29|    if (EC_POINT_is_at_infinity(group, a)) {
  ------------------
  |  Branch (1076:9): [True: 0, False: 29]
  ------------------
 1077|      0|        return EC_POINT_is_at_infinity(group, b) ? 0 : 1;
  ------------------
  |  Branch (1077:16): [True: 0, False: 0]
  ------------------
 1078|      0|    }
 1079|       |
 1080|     29|    if (EC_POINT_is_at_infinity(group, b))
  ------------------
  |  Branch (1080:9): [True: 0, False: 29]
  ------------------
 1081|      0|        return 1;
 1082|       |
 1083|     29|    if (a->Z_is_one && b->Z_is_one) {
  ------------------
  |  Branch (1083:9): [True: 29, False: 0]
  |  Branch (1083:24): [True: 29, False: 0]
  ------------------
 1084|     29|        return ((BN_cmp(a->X, b->X) == 0) && BN_cmp(a->Y, b->Y) == 0) ? 0 : 1;
  ------------------
  |  Branch (1084:17): [True: 29, False: 0]
  |  Branch (1084:46): [True: 29, False: 0]
  ------------------
 1085|     29|    }
 1086|       |
 1087|      0|    field_mul = group->meth->field_mul;
 1088|      0|    field_sqr = group->meth->field_sqr;
 1089|       |
 1090|      0|    if (ctx == NULL) {
  ------------------
  |  Branch (1090:9): [True: 0, False: 0]
  ------------------
 1091|      0|        ctx = new_ctx = BN_CTX_new_ex(group->libctx);
 1092|      0|        if (ctx == NULL)
  ------------------
  |  Branch (1092:13): [True: 0, False: 0]
  ------------------
 1093|      0|            return -1;
 1094|      0|    }
 1095|       |
 1096|      0|    BN_CTX_start(ctx);
 1097|      0|    tmp1 = BN_CTX_get(ctx);
 1098|      0|    tmp2 = BN_CTX_get(ctx);
 1099|      0|    Za23 = BN_CTX_get(ctx);
 1100|      0|    Zb23 = BN_CTX_get(ctx);
 1101|      0|    if (Zb23 == NULL)
  ------------------
  |  Branch (1101:9): [True: 0, False: 0]
  ------------------
 1102|      0|        goto end;
 1103|       |
 1104|       |    /*-
 1105|       |     * We have to decide whether
 1106|       |     *     (X_a/Z_a^2, Y_a/Z_a^3) = (X_b/Z_b^2, Y_b/Z_b^3),
 1107|       |     * or equivalently, whether
 1108|       |     *     (X_a*Z_b^2, Y_a*Z_b^3) = (X_b*Z_a^2, Y_b*Z_a^3).
 1109|       |     */
 1110|       |
 1111|      0|    if (!b->Z_is_one) {
  ------------------
  |  Branch (1111:9): [True: 0, False: 0]
  ------------------
 1112|      0|        if (!field_sqr(group, Zb23, b->Z, ctx))
  ------------------
  |  Branch (1112:13): [True: 0, False: 0]
  ------------------
 1113|      0|            goto end;
 1114|      0|        if (!field_mul(group, tmp1, a->X, Zb23, ctx))
  ------------------
  |  Branch (1114:13): [True: 0, False: 0]
  ------------------
 1115|      0|            goto end;
 1116|      0|        tmp1_ = tmp1;
 1117|      0|    } else
 1118|      0|        tmp1_ = a->X;
 1119|      0|    if (!a->Z_is_one) {
  ------------------
  |  Branch (1119:9): [True: 0, False: 0]
  ------------------
 1120|      0|        if (!field_sqr(group, Za23, a->Z, ctx))
  ------------------
  |  Branch (1120:13): [True: 0, False: 0]
  ------------------
 1121|      0|            goto end;
 1122|      0|        if (!field_mul(group, tmp2, b->X, Za23, ctx))
  ------------------
  |  Branch (1122:13): [True: 0, False: 0]
  ------------------
 1123|      0|            goto end;
 1124|      0|        tmp2_ = tmp2;
 1125|      0|    } else
 1126|      0|        tmp2_ = b->X;
 1127|       |
 1128|       |    /* compare  X_a*Z_b^2  with  X_b*Z_a^2 */
 1129|      0|    if (BN_cmp(tmp1_, tmp2_) != 0) {
  ------------------
  |  Branch (1129:9): [True: 0, False: 0]
  ------------------
 1130|      0|        ret = 1; /* points differ */
 1131|      0|        goto end;
 1132|      0|    }
 1133|       |
 1134|      0|    if (!b->Z_is_one) {
  ------------------
  |  Branch (1134:9): [True: 0, False: 0]
  ------------------
 1135|      0|        if (!field_mul(group, Zb23, Zb23, b->Z, ctx))
  ------------------
  |  Branch (1135:13): [True: 0, False: 0]
  ------------------
 1136|      0|            goto end;
 1137|      0|        if (!field_mul(group, tmp1, a->Y, Zb23, ctx))
  ------------------
  |  Branch (1137:13): [True: 0, False: 0]
  ------------------
 1138|      0|            goto end;
 1139|       |        /* tmp1_ = tmp1 */
 1140|      0|    } else
 1141|      0|        tmp1_ = a->Y;
 1142|      0|    if (!a->Z_is_one) {
  ------------------
  |  Branch (1142:9): [True: 0, False: 0]
  ------------------
 1143|      0|        if (!field_mul(group, Za23, Za23, a->Z, ctx))
  ------------------
  |  Branch (1143:13): [True: 0, False: 0]
  ------------------
 1144|      0|            goto end;
 1145|      0|        if (!field_mul(group, tmp2, b->Y, Za23, ctx))
  ------------------
  |  Branch (1145:13): [True: 0, False: 0]
  ------------------
 1146|      0|            goto end;
 1147|       |        /* tmp2_ = tmp2 */
 1148|      0|    } else
 1149|      0|        tmp2_ = b->Y;
 1150|       |
 1151|       |    /* compare  Y_a*Z_b^3  with  Y_b*Z_a^3 */
 1152|      0|    if (BN_cmp(tmp1_, tmp2_) != 0) {
  ------------------
  |  Branch (1152:9): [True: 0, False: 0]
  ------------------
 1153|      0|        ret = 1; /* points differ */
 1154|      0|        goto end;
 1155|      0|    }
 1156|       |
 1157|       |    /* points are equal */
 1158|      0|    ret = 0;
 1159|       |
 1160|      0|end:
 1161|      0|    BN_CTX_end(ctx);
 1162|      0|    BN_CTX_free(new_ctx);
 1163|      0|    return ret;
 1164|      0|}
ossl_ec_GFp_simple_ladder_pre:
 1493|    144|{
 1494|    144|    BIGNUM *t1, *t2, *t3, *t4, *t5 = NULL;
 1495|       |
 1496|    144|    t1 = s->Z;
 1497|    144|    t2 = r->Z;
 1498|    144|    t3 = s->X;
 1499|    144|    t4 = r->X;
 1500|    144|    t5 = s->Y;
 1501|       |
 1502|    144|    if (!p->Z_is_one /* r := 2p */
  ------------------
  |  Branch (1502:9): [True: 0, False: 144]
  ------------------
 1503|    144|        || !group->meth->field_sqr(group, t3, p->X, ctx)
  ------------------
  |  Branch (1503:12): [True: 0, False: 144]
  ------------------
 1504|    144|        || !BN_mod_sub_quick(t4, t3, group->a, group->field)
  ------------------
  |  Branch (1504:12): [True: 0, False: 144]
  ------------------
 1505|    144|        || !group->meth->field_sqr(group, t4, t4, ctx)
  ------------------
  |  Branch (1505:12): [True: 0, False: 144]
  ------------------
 1506|    144|        || !group->meth->field_mul(group, t5, p->X, group->b, ctx)
  ------------------
  |  Branch (1506:12): [True: 0, False: 144]
  ------------------
 1507|    144|        || !BN_mod_lshift_quick(t5, t5, 3, group->field)
  ------------------
  |  Branch (1507:12): [True: 0, False: 144]
  ------------------
 1508|       |        /* r->X coord output */
 1509|    144|        || !BN_mod_sub_quick(r->X, t4, t5, group->field)
  ------------------
  |  Branch (1509:12): [True: 0, False: 144]
  ------------------
 1510|    144|        || !BN_mod_add_quick(t1, t3, group->a, group->field)
  ------------------
  |  Branch (1510:12): [True: 0, False: 144]
  ------------------
 1511|    144|        || !group->meth->field_mul(group, t2, p->X, t1, ctx)
  ------------------
  |  Branch (1511:12): [True: 0, False: 144]
  ------------------
 1512|    144|        || !BN_mod_add_quick(t2, group->b, t2, group->field)
  ------------------
  |  Branch (1512:12): [True: 0, False: 144]
  ------------------
 1513|       |        /* r->Z coord output */
 1514|    144|        || !BN_mod_lshift_quick(r->Z, t2, 2, group->field))
  ------------------
  |  Branch (1514:12): [True: 0, False: 144]
  ------------------
 1515|      0|        return 0;
 1516|       |
 1517|       |    /* make sure lambda (r->Y here for storage) is not zero */
 1518|    144|    do {
 1519|    144|        if (!BN_priv_rand_range_ex(r->Y, group->field, 0, ctx))
  ------------------
  |  Branch (1519:13): [True: 0, False: 144]
  ------------------
 1520|      0|            return 0;
 1521|    144|    } while (BN_is_zero(r->Y));
  ------------------
  |  Branch (1521:14): [True: 0, False: 144]
  ------------------
 1522|       |
 1523|       |    /* make sure lambda (s->Z here for storage) is not zero */
 1524|    144|    do {
 1525|    144|        if (!BN_priv_rand_range_ex(s->Z, group->field, 0, ctx))
  ------------------
  |  Branch (1525:13): [True: 0, False: 144]
  ------------------
 1526|      0|            return 0;
 1527|    144|    } while (BN_is_zero(s->Z));
  ------------------
  |  Branch (1527:14): [True: 0, False: 144]
  ------------------
 1528|       |
 1529|       |    /* if field_encode defined convert between representations */
 1530|    144|    if (group->meth->field_encode != NULL
  ------------------
  |  Branch (1530:9): [True: 144, False: 0]
  ------------------
 1531|    144|        && (!group->meth->field_encode(group, r->Y, r->Y, ctx)
  ------------------
  |  Branch (1531:13): [True: 0, False: 144]
  ------------------
 1532|    144|            || !group->meth->field_encode(group, s->Z, s->Z, ctx)))
  ------------------
  |  Branch (1532:16): [True: 0, False: 144]
  ------------------
 1533|      0|        return 0;
 1534|       |
 1535|       |    /* blind r and s independently */
 1536|    144|    if (!group->meth->field_mul(group, r->Z, r->Z, r->Y, ctx)
  ------------------
  |  Branch (1536:9): [True: 0, False: 144]
  ------------------
 1537|    144|        || !group->meth->field_mul(group, r->X, r->X, r->Y, ctx)
  ------------------
  |  Branch (1537:12): [True: 0, False: 144]
  ------------------
 1538|    144|        || !group->meth->field_mul(group, s->X, p->X, s->Z, ctx)) /* s := p */
  ------------------
  |  Branch (1538:12): [True: 0, False: 144]
  ------------------
 1539|      0|        return 0;
 1540|       |
 1541|    144|    r->Z_is_one = 0;
 1542|    144|    s->Z_is_one = 0;
 1543|       |
 1544|    144|    return 1;
 1545|    144|}
ossl_ec_GFp_simple_ladder_step:
 1563|  65.5k|{
 1564|  65.5k|    int ret = 0;
 1565|  65.5k|    BIGNUM *t0, *t1, *t2, *t3, *t4, *t5, *t6 = NULL;
 1566|       |
 1567|  65.5k|    BN_CTX_start(ctx);
 1568|  65.5k|    t0 = BN_CTX_get(ctx);
 1569|  65.5k|    t1 = BN_CTX_get(ctx);
 1570|  65.5k|    t2 = BN_CTX_get(ctx);
 1571|  65.5k|    t3 = BN_CTX_get(ctx);
 1572|  65.5k|    t4 = BN_CTX_get(ctx);
 1573|  65.5k|    t5 = BN_CTX_get(ctx);
 1574|  65.5k|    t6 = BN_CTX_get(ctx);
 1575|       |
 1576|  65.5k|    if (t6 == NULL
  ------------------
  |  Branch (1576:9): [True: 0, False: 65.5k]
  ------------------
 1577|  65.5k|        || !group->meth->field_mul(group, t6, r->X, s->X, ctx)
  ------------------
  |  Branch (1577:12): [True: 0, False: 65.5k]
  ------------------
 1578|  65.5k|        || !group->meth->field_mul(group, t0, r->Z, s->Z, ctx)
  ------------------
  |  Branch (1578:12): [True: 0, False: 65.5k]
  ------------------
 1579|  65.5k|        || !group->meth->field_mul(group, t4, r->X, s->Z, ctx)
  ------------------
  |  Branch (1579:12): [True: 0, False: 65.5k]
  ------------------
 1580|  65.5k|        || !group->meth->field_mul(group, t3, r->Z, s->X, ctx)
  ------------------
  |  Branch (1580:12): [True: 0, False: 65.5k]
  ------------------
 1581|  65.5k|        || !group->meth->field_mul(group, t5, group->a, t0, ctx)
  ------------------
  |  Branch (1581:12): [True: 0, False: 65.5k]
  ------------------
 1582|  65.5k|        || !BN_mod_add_quick(t5, t6, t5, group->field)
  ------------------
  |  Branch (1582:12): [True: 0, False: 65.5k]
  ------------------
 1583|  65.5k|        || !BN_mod_add_quick(t6, t3, t4, group->field)
  ------------------
  |  Branch (1583:12): [True: 0, False: 65.5k]
  ------------------
 1584|  65.5k|        || !group->meth->field_mul(group, t5, t6, t5, ctx)
  ------------------
  |  Branch (1584:12): [True: 0, False: 65.5k]
  ------------------
 1585|  65.5k|        || !group->meth->field_sqr(group, t0, t0, ctx)
  ------------------
  |  Branch (1585:12): [True: 0, False: 65.5k]
  ------------------
 1586|  65.5k|        || !BN_mod_lshift_quick(t2, group->b, 2, group->field)
  ------------------
  |  Branch (1586:12): [True: 0, False: 65.5k]
  ------------------
 1587|  65.5k|        || !group->meth->field_mul(group, t0, t2, t0, ctx)
  ------------------
  |  Branch (1587:12): [True: 0, False: 65.5k]
  ------------------
 1588|  65.5k|        || !BN_mod_lshift1_quick(t5, t5, group->field)
  ------------------
  |  Branch (1588:12): [True: 0, False: 65.5k]
  ------------------
 1589|  65.5k|        || !BN_mod_sub_quick(t3, t4, t3, group->field)
  ------------------
  |  Branch (1589:12): [True: 0, False: 65.5k]
  ------------------
 1590|       |        /* s->Z coord output */
 1591|  65.5k|        || !group->meth->field_sqr(group, s->Z, t3, ctx)
  ------------------
  |  Branch (1591:12): [True: 0, False: 65.5k]
  ------------------
 1592|  65.5k|        || !group->meth->field_mul(group, t4, s->Z, p->X, ctx)
  ------------------
  |  Branch (1592:12): [True: 0, False: 65.5k]
  ------------------
 1593|  65.5k|        || !BN_mod_add_quick(t0, t0, t5, group->field)
  ------------------
  |  Branch (1593:12): [True: 0, False: 65.5k]
  ------------------
 1594|       |        /* s->X coord output */
 1595|  65.5k|        || !BN_mod_sub_quick(s->X, t0, t4, group->field)
  ------------------
  |  Branch (1595:12): [True: 0, False: 65.5k]
  ------------------
 1596|  65.5k|        || !group->meth->field_sqr(group, t4, r->X, ctx)
  ------------------
  |  Branch (1596:12): [True: 0, False: 65.5k]
  ------------------
 1597|  65.5k|        || !group->meth->field_sqr(group, t5, r->Z, ctx)
  ------------------
  |  Branch (1597:12): [True: 0, False: 65.5k]
  ------------------
 1598|  65.5k|        || !group->meth->field_mul(group, t6, t5, group->a, ctx)
  ------------------
  |  Branch (1598:12): [True: 0, False: 65.5k]
  ------------------
 1599|  65.5k|        || !BN_mod_add_quick(t1, r->X, r->Z, group->field)
  ------------------
  |  Branch (1599:12): [True: 0, False: 65.5k]
  ------------------
 1600|  65.5k|        || !group->meth->field_sqr(group, t1, t1, ctx)
  ------------------
  |  Branch (1600:12): [True: 0, False: 65.5k]
  ------------------
 1601|  65.5k|        || !BN_mod_sub_quick(t1, t1, t4, group->field)
  ------------------
  |  Branch (1601:12): [True: 0, False: 65.5k]
  ------------------
 1602|  65.5k|        || !BN_mod_sub_quick(t1, t1, t5, group->field)
  ------------------
  |  Branch (1602:12): [True: 0, False: 65.5k]
  ------------------
 1603|  65.5k|        || !BN_mod_sub_quick(t3, t4, t6, group->field)
  ------------------
  |  Branch (1603:12): [True: 0, False: 65.5k]
  ------------------
 1604|  65.5k|        || !group->meth->field_sqr(group, t3, t3, ctx)
  ------------------
  |  Branch (1604:12): [True: 0, False: 65.5k]
  ------------------
 1605|  65.5k|        || !group->meth->field_mul(group, t0, t5, t1, ctx)
  ------------------
  |  Branch (1605:12): [True: 0, False: 65.5k]
  ------------------
 1606|  65.5k|        || !group->meth->field_mul(group, t0, t2, t0, ctx)
  ------------------
  |  Branch (1606:12): [True: 0, False: 65.5k]
  ------------------
 1607|       |        /* r->X coord output */
 1608|  65.5k|        || !BN_mod_sub_quick(r->X, t3, t0, group->field)
  ------------------
  |  Branch (1608:12): [True: 0, False: 65.5k]
  ------------------
 1609|  65.5k|        || !BN_mod_add_quick(t3, t4, t6, group->field)
  ------------------
  |  Branch (1609:12): [True: 0, False: 65.5k]
  ------------------
 1610|  65.5k|        || !group->meth->field_sqr(group, t4, t5, ctx)
  ------------------
  |  Branch (1610:12): [True: 0, False: 65.5k]
  ------------------
 1611|  65.5k|        || !group->meth->field_mul(group, t4, t4, t2, ctx)
  ------------------
  |  Branch (1611:12): [True: 0, False: 65.5k]
  ------------------
 1612|  65.5k|        || !group->meth->field_mul(group, t1, t1, t3, ctx)
  ------------------
  |  Branch (1612:12): [True: 0, False: 65.5k]
  ------------------
 1613|  65.5k|        || !BN_mod_lshift1_quick(t1, t1, group->field)
  ------------------
  |  Branch (1613:12): [True: 0, False: 65.5k]
  ------------------
 1614|       |        /* r->Z coord output */
 1615|  65.5k|        || !BN_mod_add_quick(r->Z, t4, t1, group->field))
  ------------------
  |  Branch (1615:12): [True: 0, False: 65.5k]
  ------------------
 1616|      0|        goto err;
 1617|       |
 1618|  65.5k|    ret = 1;
 1619|       |
 1620|  65.5k|err:
 1621|  65.5k|    BN_CTX_end(ctx);
 1622|  65.5k|    return ret;
 1623|  65.5k|}
ossl_ec_GFp_simple_ladder_post:
 1651|    144|{
 1652|    144|    int ret = 0;
 1653|    144|    BIGNUM *t0, *t1, *t2, *t3, *t4, *t5, *t6 = NULL;
 1654|       |
 1655|    144|    if (BN_is_zero(r->Z))
  ------------------
  |  Branch (1655:9): [True: 0, False: 144]
  ------------------
 1656|      0|        return EC_POINT_set_to_infinity(group, r);
 1657|       |
 1658|    144|    if (BN_is_zero(s->Z)) {
  ------------------
  |  Branch (1658:9): [True: 0, False: 144]
  ------------------
 1659|      0|        if (!EC_POINT_copy(r, p)
  ------------------
  |  Branch (1659:13): [True: 0, False: 0]
  ------------------
 1660|      0|            || !EC_POINT_invert(group, r, ctx))
  ------------------
  |  Branch (1660:16): [True: 0, False: 0]
  ------------------
 1661|      0|            return 0;
 1662|      0|        return 1;
 1663|      0|    }
 1664|       |
 1665|    144|    BN_CTX_start(ctx);
 1666|    144|    t0 = BN_CTX_get(ctx);
 1667|    144|    t1 = BN_CTX_get(ctx);
 1668|    144|    t2 = BN_CTX_get(ctx);
 1669|    144|    t3 = BN_CTX_get(ctx);
 1670|    144|    t4 = BN_CTX_get(ctx);
 1671|    144|    t5 = BN_CTX_get(ctx);
 1672|    144|    t6 = BN_CTX_get(ctx);
 1673|       |
 1674|    144|    if (t6 == NULL
  ------------------
  |  Branch (1674:9): [True: 0, False: 144]
  ------------------
 1675|    144|        || !BN_mod_lshift1_quick(t4, p->Y, group->field)
  ------------------
  |  Branch (1675:12): [True: 0, False: 144]
  ------------------
 1676|    144|        || !group->meth->field_mul(group, t6, r->X, t4, ctx)
  ------------------
  |  Branch (1676:12): [True: 0, False: 144]
  ------------------
 1677|    144|        || !group->meth->field_mul(group, t6, s->Z, t6, ctx)
  ------------------
  |  Branch (1677:12): [True: 0, False: 144]
  ------------------
 1678|    144|        || !group->meth->field_mul(group, t5, r->Z, t6, ctx)
  ------------------
  |  Branch (1678:12): [True: 0, False: 144]
  ------------------
 1679|    144|        || !BN_mod_lshift1_quick(t1, group->b, group->field)
  ------------------
  |  Branch (1679:12): [True: 0, False: 144]
  ------------------
 1680|    144|        || !group->meth->field_mul(group, t1, s->Z, t1, ctx)
  ------------------
  |  Branch (1680:12): [True: 0, False: 144]
  ------------------
 1681|    144|        || !group->meth->field_sqr(group, t3, r->Z, ctx)
  ------------------
  |  Branch (1681:12): [True: 0, False: 144]
  ------------------
 1682|    144|        || !group->meth->field_mul(group, t2, t3, t1, ctx)
  ------------------
  |  Branch (1682:12): [True: 0, False: 144]
  ------------------
 1683|    144|        || !group->meth->field_mul(group, t6, r->Z, group->a, ctx)
  ------------------
  |  Branch (1683:12): [True: 0, False: 144]
  ------------------
 1684|    144|        || !group->meth->field_mul(group, t1, p->X, r->X, ctx)
  ------------------
  |  Branch (1684:12): [True: 0, False: 144]
  ------------------
 1685|    144|        || !BN_mod_add_quick(t1, t1, t6, group->field)
  ------------------
  |  Branch (1685:12): [True: 0, False: 144]
  ------------------
 1686|    144|        || !group->meth->field_mul(group, t1, s->Z, t1, ctx)
  ------------------
  |  Branch (1686:12): [True: 0, False: 144]
  ------------------
 1687|    144|        || !group->meth->field_mul(group, t0, p->X, r->Z, ctx)
  ------------------
  |  Branch (1687:12): [True: 0, False: 144]
  ------------------
 1688|    144|        || !BN_mod_add_quick(t6, r->X, t0, group->field)
  ------------------
  |  Branch (1688:12): [True: 0, False: 144]
  ------------------
 1689|    144|        || !group->meth->field_mul(group, t6, t6, t1, ctx)
  ------------------
  |  Branch (1689:12): [True: 0, False: 144]
  ------------------
 1690|    144|        || !BN_mod_add_quick(t6, t6, t2, group->field)
  ------------------
  |  Branch (1690:12): [True: 0, False: 144]
  ------------------
 1691|    144|        || !BN_mod_sub_quick(t0, t0, r->X, group->field)
  ------------------
  |  Branch (1691:12): [True: 0, False: 144]
  ------------------
 1692|    144|        || !group->meth->field_sqr(group, t0, t0, ctx)
  ------------------
  |  Branch (1692:12): [True: 0, False: 144]
  ------------------
 1693|    144|        || !group->meth->field_mul(group, t0, t0, s->X, ctx)
  ------------------
  |  Branch (1693:12): [True: 0, False: 144]
  ------------------
 1694|    144|        || !BN_mod_sub_quick(t0, t6, t0, group->field)
  ------------------
  |  Branch (1694:12): [True: 0, False: 144]
  ------------------
 1695|    144|        || !group->meth->field_mul(group, t1, s->Z, t4, ctx)
  ------------------
  |  Branch (1695:12): [True: 0, False: 144]
  ------------------
 1696|    144|        || !group->meth->field_mul(group, t1, t3, t1, ctx)
  ------------------
  |  Branch (1696:12): [True: 0, False: 144]
  ------------------
 1697|    144|        || (group->meth->field_decode != NULL
  ------------------
  |  Branch (1697:13): [True: 144, False: 0]
  ------------------
 1698|    144|            && !group->meth->field_decode(group, t1, t1, ctx))
  ------------------
  |  Branch (1698:16): [True: 0, False: 144]
  ------------------
 1699|    144|        || !group->meth->field_inv(group, t1, t1, ctx)
  ------------------
  |  Branch (1699:12): [True: 0, False: 144]
  ------------------
 1700|    144|        || (group->meth->field_encode != NULL
  ------------------
  |  Branch (1700:13): [True: 144, False: 0]
  ------------------
 1701|    144|            && !group->meth->field_encode(group, t1, t1, ctx))
  ------------------
  |  Branch (1701:16): [True: 0, False: 144]
  ------------------
 1702|    144|        || !group->meth->field_mul(group, r->X, t5, t1, ctx)
  ------------------
  |  Branch (1702:12): [True: 0, False: 144]
  ------------------
 1703|    144|        || !group->meth->field_mul(group, r->Y, t0, t1, ctx))
  ------------------
  |  Branch (1703:12): [True: 0, False: 144]
  ------------------
 1704|      0|        goto err;
 1705|       |
 1706|    144|    if (group->meth->field_set_to_one != NULL) {
  ------------------
  |  Branch (1706:9): [True: 144, False: 0]
  ------------------
 1707|    144|        if (!group->meth->field_set_to_one(group, r->Z, ctx))
  ------------------
  |  Branch (1707:13): [True: 0, False: 144]
  ------------------
 1708|      0|            goto err;
 1709|    144|    } else {
 1710|      0|        if (!BN_one(r->Z))
  ------------------
  |  |  196|      0|#define BN_one(a) (BN_set_word((a), 1))
  ------------------
  |  Branch (1710:13): [True: 0, False: 0]
  ------------------
 1711|      0|            goto err;
 1712|      0|    }
 1713|       |
 1714|    144|    r->Z_is_one = 1;
 1715|    144|    ret = 1;
 1716|       |
 1717|    144|err:
 1718|    144|    BN_CTX_end(ctx);
 1719|    144|    return ret;
 1720|    144|}

ossl_ecx_key_new:
   22|  2.64k|{
   23|  2.64k|    ECX_KEY *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|  2.64k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   24|       |
   25|  2.64k|    if (ret == NULL)
  ------------------
  |  Branch (25:9): [True: 0, False: 2.64k]
  ------------------
   26|      0|        return NULL;
   27|       |
   28|  2.64k|    ret->libctx = libctx;
   29|  2.64k|    ret->haspubkey = haspubkey;
   30|  2.64k|    switch (type) {
  ------------------
  |  Branch (30:13): [True: 2.64k, False: 0]
  ------------------
   31|  2.64k|    case ECX_KEY_TYPE_X25519:
  ------------------
  |  Branch (31:5): [True: 2.64k, False: 3]
  ------------------
   32|  2.64k|        ret->keylen = X25519_KEYLEN;
  ------------------
  |  |   26|  2.64k|#define X25519_KEYLEN 32
  ------------------
   33|  2.64k|        break;
   34|      3|    case ECX_KEY_TYPE_X448:
  ------------------
  |  Branch (34:5): [True: 3, False: 2.64k]
  ------------------
   35|      3|        ret->keylen = X448_KEYLEN;
  ------------------
  |  |   27|      3|#define X448_KEYLEN 56
  ------------------
   36|      3|        break;
   37|      0|    case ECX_KEY_TYPE_ED25519:
  ------------------
  |  Branch (37:5): [True: 0, False: 2.64k]
  ------------------
   38|      0|        ret->keylen = ED25519_KEYLEN;
  ------------------
  |  |   28|      0|#define ED25519_KEYLEN 32
  ------------------
   39|      0|        break;
   40|      0|    case ECX_KEY_TYPE_ED448:
  ------------------
  |  Branch (40:5): [True: 0, False: 2.64k]
  ------------------
   41|      0|        ret->keylen = ED448_KEYLEN;
  ------------------
  |  |   29|      0|#define ED448_KEYLEN 57
  ------------------
   42|      0|        break;
   43|  2.64k|    }
   44|  2.64k|    ret->type = type;
   45|       |
   46|  2.64k|    if (!CRYPTO_NEW_REF(&ret->references, 1))
  ------------------
  |  Branch (46:9): [True: 0, False: 2.64k]
  ------------------
   47|      0|        goto err;
   48|       |
   49|  2.64k|    if (propq != NULL) {
  ------------------
  |  Branch (49:9): [True: 0, False: 2.64k]
  ------------------
   50|      0|        ret->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   51|      0|        if (ret->propq == NULL)
  ------------------
  |  Branch (51:13): [True: 0, False: 0]
  ------------------
   52|      0|            goto err;
   53|      0|    }
   54|  2.64k|    return ret;
   55|      0|err:
   56|      0|    if (ret != NULL) {
  ------------------
  |  Branch (56:9): [True: 0, False: 0]
  ------------------
   57|      0|        OPENSSL_free(ret->propq);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   58|      0|        CRYPTO_FREE_REF(&ret->references);
   59|      0|    }
   60|      0|    OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|       |    return NULL;
   62|  2.64k|}
ossl_ecx_key_free:
   65|  2.73k|{
   66|  2.73k|    int i;
   67|       |
   68|  2.73k|    if (key == NULL)
  ------------------
  |  Branch (68:9): [True: 83, False: 2.64k]
  ------------------
   69|     83|        return;
   70|       |
   71|  2.64k|    CRYPTO_DOWN_REF(&key->references, &i);
   72|  2.64k|    REF_PRINT_COUNT("ECX_KEY", i, key);
  ------------------
  |  |  301|  2.64k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  2.64k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  297|  2.64k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  285|  2.64k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   73|  2.64k|    if (i > 0)
  ------------------
  |  Branch (73:9): [True: 0, False: 2.64k]
  ------------------
   74|      0|        return;
   75|  2.64k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|  2.64k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 2.64k]
  |  |  ------------------
  ------------------
   76|       |
   77|  2.64k|    OPENSSL_free(key->propq);
  ------------------
  |  |  131|  2.64k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   78|       |#ifdef OPENSSL_PEDANTIC_ZEROIZATION
   79|       |    OPENSSL_cleanse(&key->pubkey, sizeof(key->pubkey));
   80|       |#endif
   81|  2.64k|    OPENSSL_secure_clear_free(key->privkey, key->keylen);
  ------------------
  |  |  149|  2.64k|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   82|  2.64k|    CRYPTO_FREE_REF(&key->references);
   83|  2.64k|    OPENSSL_free(key);
  ------------------
  |  |  131|  2.64k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   84|  2.64k|}
ossl_ecx_key_allocate_privkey:
  104|  2.64k|{
  105|  2.64k|    key->privkey = OPENSSL_secure_zalloc(key->keylen);
  ------------------
  |  |  141|  2.64k|    CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  106|       |
  107|  2.64k|    return key->privkey;
  108|  2.64k|}

ecx_meth.c:ecx_free:
  156|     83|{
  157|     83|    ossl_ecx_key_free(pkey->pkey.ecx);
  158|     83|}

OSSL_DECODER_from_bio:
   48|   412k|{
   49|   412k|    struct decoder_process_data_st data;
   50|   412k|    int ok = 0;
   51|   412k|    BIO *new_bio = NULL;
   52|   412k|    unsigned long lasterr;
   53|       |
   54|   412k|    if (in == NULL) {
  ------------------
  |  Branch (54:9): [True: 0, False: 412k]
  ------------------
   55|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   56|      0|        return 0;
   57|      0|    }
   58|       |
   59|   412k|    if (OSSL_DECODER_CTX_get_num_decoders(ctx) == 0) {
  ------------------
  |  Branch (59:9): [True: 0, False: 412k]
  ------------------
   60|      0|        ERR_raise_data(ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_DECODER_NOT_FOUND,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_DECODER_NOT_FOUND,
  ------------------
  |  |  123|      0|#define ERR_LIB_OSSL_DECODER 60
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_DECODER_NOT_FOUND,
  ------------------
  |  |   23|      0|#define OSSL_DECODER_R_DECODER_NOT_FOUND 102
  ------------------
   61|      0|            "No decoders were found. For standard decoders you need "
   62|      0|            "at least one of the default or base providers "
   63|      0|            "available. Did you forget to load them?");
   64|      0|        return 0;
   65|      0|    }
   66|       |
   67|   412k|    lasterr = ERR_peek_last_error();
   68|       |
   69|   412k|    if (BIO_tell(in) < 0) {
  ------------------
  |  |  573|   412k|#define BIO_tell(b) (int)BIO_ctrl(b, BIO_C_FILE_TELL, 0, NULL)
  |  |  ------------------
  |  |  |  |  468|   412k|#define BIO_C_FILE_TELL 133
  |  |  ------------------
  ------------------
  |  Branch (69:9): [True: 0, False: 412k]
  ------------------
   70|      0|        new_bio = BIO_new(BIO_f_readbuffer());
   71|      0|        if (new_bio == NULL)
  ------------------
  |  Branch (71:13): [True: 0, False: 0]
  ------------------
   72|      0|            return 0;
   73|      0|        in = BIO_push(new_bio, in);
   74|      0|    }
   75|   412k|    memset(&data, 0, sizeof(data));
   76|   412k|    data.ctx = ctx;
   77|   412k|    data.bio = in;
   78|       |
   79|       |    /* Enable passphrase caching */
   80|   412k|    (void)ossl_pw_enable_passphrase_caching(&ctx->pwdata);
   81|       |
   82|   412k|    ok = decoder_process(NULL, &data);
   83|       |
   84|   412k|    if (!data.flag_construct_called) {
  ------------------
  |  Branch (84:9): [True: 0, False: 412k]
  ------------------
   85|      0|        const char *spaces
   86|      0|            = ctx->start_input_type != NULL && ctx->input_structure != NULL
  ------------------
  |  Branch (86:15): [True: 0, False: 0]
  |  Branch (86:48): [True: 0, False: 0]
  ------------------
   87|      0|            ? " "
   88|      0|            : "";
   89|      0|        const char *input_type_label
   90|      0|            = ctx->start_input_type != NULL ? "Input type: " : "";
  ------------------
  |  Branch (90:15): [True: 0, False: 0]
  ------------------
   91|      0|        const char *input_structure_label
   92|      0|            = ctx->input_structure != NULL ? "Input structure: " : "";
  ------------------
  |  Branch (92:15): [True: 0, False: 0]
  ------------------
   93|      0|        const char *comma
   94|      0|            = ctx->start_input_type != NULL && ctx->input_structure != NULL
  ------------------
  |  Branch (94:15): [True: 0, False: 0]
  |  Branch (94:48): [True: 0, False: 0]
  ------------------
   95|      0|            ? ", "
   96|      0|            : "";
   97|      0|        const char *input_type
   98|      0|            = ctx->start_input_type != NULL ? ctx->start_input_type : "";
  ------------------
  |  Branch (98:15): [True: 0, False: 0]
  ------------------
   99|      0|        const char *input_structure
  100|      0|            = ctx->input_structure != NULL ? ctx->input_structure : "";
  ------------------
  |  Branch (100:15): [True: 0, False: 0]
  ------------------
  101|       |
  102|      0|        if (ERR_peek_last_error() == lasterr || ERR_peek_error() == 0)
  ------------------
  |  Branch (102:13): [True: 0, False: 0]
  |  Branch (102:49): [True: 0, False: 0]
  ------------------
  103|       |            /* Prevent spurious decoding error but add at least something */
  104|      0|            ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_UNSUPPORTED,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_UNSUPPORTED,
  ------------------
  |  |  123|      0|#define ERR_LIB_OSSL_DECODER 60
  ------------------
                          ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_UNSUPPORTED,
  ------------------
  |  |  364|      0|#define ERR_R_UNSUPPORTED (268 | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  105|      0|                "No supported data to decode. %s%s%s%s%s%s",
  106|      0|                spaces, input_type_label, input_type, comma,
  107|      0|                input_structure_label, input_structure);
  108|      0|        ok = 0;
  109|      0|    }
  110|       |
  111|       |    /* Clear any internally cached passphrase */
  112|   412k|    (void)ossl_pw_clear_passphrase_cache(&ctx->pwdata);
  113|       |
  114|   412k|    if (new_bio != NULL) {
  ------------------
  |  Branch (114:9): [True: 0, False: 412k]
  ------------------
  115|      0|        BIO_pop(new_bio);
  116|      0|        BIO_free(new_bio);
  117|      0|    }
  118|   412k|    return ok;
  119|   412k|}
OSSL_DECODER_from_data:
  149|   412k|{
  150|   412k|    BIO *membio;
  151|   412k|    int ret = 0;
  152|       |
  153|   412k|    if (pdata == NULL || *pdata == NULL || pdata_len == NULL) {
  ------------------
  |  Branch (153:9): [True: 0, False: 412k]
  |  Branch (153:26): [True: 0, False: 412k]
  |  Branch (153:44): [True: 0, False: 412k]
  ------------------
  154|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  155|      0|        return 0;
  156|      0|    }
  157|       |
  158|   412k|    membio = BIO_new_mem_buf(*pdata, (int)*pdata_len);
  159|   412k|    if (OSSL_DECODER_from_bio(ctx, membio)) {
  ------------------
  |  Branch (159:9): [True: 412k, False: 0]
  ------------------
  160|   412k|        *pdata_len = (size_t)BIO_get_mem_data(membio, pdata);
  ------------------
  |  |  615|   412k|#define BIO_get_mem_data(b, pp) BIO_ctrl(b, BIO_CTRL_INFO, 0, (char *)(pp))
  |  |  ------------------
  |  |  |  |   92|   412k|#define BIO_CTRL_INFO 3 /* opt - extra tit-bits */
  |  |  ------------------
  ------------------
  161|   412k|        ret = 1;
  162|   412k|    }
  163|   412k|    BIO_free(membio);
  164|       |
  165|   412k|    return ret;
  166|   412k|}
OSSL_DECODER_CTX_set_selection:
  169|      2|{
  170|      2|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|      2|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|      2|    __FILE__, __LINE__)
  ------------------
  |  Branch (170:9): [True: 0, False: 2]
  ------------------
  171|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  172|      0|        return 0;
  173|      0|    }
  174|       |
  175|       |    /*
  176|       |     * 0 is a valid selection, and means that the caller leaves
  177|       |     * it to code to discover what the selection is.
  178|       |     */
  179|      2|    ctx->selection = selection;
  180|      2|    return 1;
  181|      2|}
OSSL_DECODER_CTX_set_input_type:
  185|   412k|{
  186|   412k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|   412k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|   412k|    __FILE__, __LINE__)
  ------------------
  |  Branch (186:9): [True: 0, False: 412k]
  ------------------
  187|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  188|      0|        return 0;
  189|      0|    }
  190|       |
  191|       |    /*
  192|       |     * NULL is a valid starting input type, and means that the caller leaves
  193|       |     * it to code to discover what the starting input type is.
  194|       |     */
  195|   412k|    ctx->start_input_type = input_type;
  196|   412k|    return 1;
  197|   412k|}
OSSL_DECODER_CTX_set_input_structure:
  201|   412k|{
  202|   412k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|   412k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|   412k|    __FILE__, __LINE__)
  ------------------
  |  Branch (202:9): [True: 0, False: 412k]
  ------------------
  203|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  204|      0|        return 0;
  205|      0|    }
  206|       |
  207|       |    /*
  208|       |     * NULL is a valid starting input structure, and means that the caller
  209|       |     * leaves it to code to discover what the starting input structure is.
  210|       |     */
  211|   412k|    ctx->input_structure = input_structure;
  212|   412k|    return 1;
  213|   412k|}
ossl_decoder_instance_new:
  244|     17|{
  245|     17|    OSSL_DECODER_INSTANCE *decoder_inst = NULL;
  246|     17|    const OSSL_PROVIDER *prov;
  247|     17|    OSSL_LIB_CTX *libctx;
  248|     17|    const OSSL_PROPERTY_LIST *props;
  249|     17|    const OSSL_PROPERTY_DEFINITION *prop;
  250|       |
  251|     17|    if (!ossl_assert(decoder != NULL)) {
  ------------------
  |  |   52|     17|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|     17|    __FILE__, __LINE__)
  ------------------
  |  Branch (251:9): [True: 0, False: 17]
  ------------------
  252|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  253|      0|        return 0;
  254|      0|    }
  255|       |
  256|     17|    if ((decoder_inst = OPENSSL_zalloc(sizeof(*decoder_inst))) == NULL)
  ------------------
  |  |  108|     17|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (256:9): [True: 0, False: 17]
  ------------------
  257|      0|        return 0;
  258|       |
  259|     17|    prov = OSSL_DECODER_get0_provider(decoder);
  260|     17|    libctx = ossl_provider_libctx(prov);
  261|     17|    props = ossl_decoder_parsed_properties(decoder);
  262|     17|    if (props == NULL) {
  ------------------
  |  Branch (262:9): [True: 0, False: 17]
  ------------------
  263|      0|        ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROPERTY_DEFINITION,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROPERTY_DEFINITION,
  ------------------
  |  |  123|      0|#define ERR_LIB_OSSL_DECODER 60
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROPERTY_DEFINITION,
  ------------------
  |  |  366|      0|#define ERR_R_INVALID_PROPERTY_DEFINITION (270 | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  264|      0|            "there are no property definitions with decoder %s",
  265|      0|            OSSL_DECODER_get0_name(decoder));
  266|      0|        goto err;
  267|      0|    }
  268|       |
  269|       |    /* The "input" property is mandatory */
  270|     17|    prop = ossl_property_find_property(props, libctx, "input");
  271|     17|    decoder_inst->input_type = ossl_property_get_string_value(libctx, prop);
  272|     17|    decoder_inst->input_type_id = 0;
  273|     17|    if (decoder_inst->input_type == NULL) {
  ------------------
  |  Branch (273:9): [True: 0, False: 17]
  ------------------
  274|      0|        ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROPERTY_DEFINITION,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROPERTY_DEFINITION,
  ------------------
  |  |  123|      0|#define ERR_LIB_OSSL_DECODER 60
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROPERTY_DEFINITION,
  ------------------
  |  |  366|      0|#define ERR_R_INVALID_PROPERTY_DEFINITION (270 | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  275|      0|            "the mandatory 'input' property is missing "
  276|      0|            "for decoder %s (properties: %s)",
  277|      0|            OSSL_DECODER_get0_name(decoder),
  278|      0|            OSSL_DECODER_get0_properties(decoder));
  279|      0|        goto err;
  280|      0|    }
  281|       |
  282|       |    /* The "structure" property is optional */
  283|     17|    prop = ossl_property_find_property(props, libctx, "structure");
  284|     17|    if (prop != NULL) {
  ------------------
  |  Branch (284:9): [True: 9, False: 8]
  ------------------
  285|      9|        decoder_inst->input_structure
  286|      9|            = ossl_property_get_string_value(libctx, prop);
  287|      9|    }
  288|       |
  289|     17|    if (!OSSL_DECODER_up_ref(decoder)) {
  ------------------
  |  Branch (289:9): [True: 0, False: 17]
  ------------------
  290|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  291|      0|        goto err;
  292|      0|    }
  293|     17|    decoder_inst->decoder = decoder;
  294|     17|    decoder_inst->decoderctx = decoderctx;
  295|     17|    return decoder_inst;
  296|      0|err:
  297|      0|    ossl_decoder_instance_free(decoder_inst);
  298|       |    return NULL;
  299|     17|}
ossl_decoder_instance_free:
  302|  2.36M|{
  303|  2.36M|    if (decoder_inst != NULL) {
  ------------------
  |  Branch (303:9): [True: 2.36M, False: 0]
  ------------------
  304|  2.36M|        if (decoder_inst->decoder != NULL)
  ------------------
  |  Branch (304:13): [True: 2.36M, False: 0]
  ------------------
  305|  2.36M|            decoder_inst->decoder->freectx(decoder_inst->decoderctx);
  306|  2.36M|        decoder_inst->decoderctx = NULL;
  307|  2.36M|        OSSL_DECODER_free(decoder_inst->decoder);
  308|  2.36M|        decoder_inst->decoder = NULL;
  309|  2.36M|        OPENSSL_free(decoder_inst);
  ------------------
  |  |  131|  2.36M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  310|  2.36M|    }
  311|  2.36M|}
ossl_decoder_instance_dup:
  314|  2.36M|{
  315|  2.36M|    OSSL_DECODER_INSTANCE *dest;
  316|  2.36M|    const OSSL_PROVIDER *prov;
  317|  2.36M|    void *provctx;
  318|       |
  319|  2.36M|    if ((dest = OPENSSL_zalloc(sizeof(*dest))) == NULL)
  ------------------
  |  |  108|  2.36M|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (319:9): [True: 0, False: 2.36M]
  ------------------
  320|      0|        return NULL;
  321|       |
  322|  2.36M|    *dest = *src;
  323|  2.36M|    if (!OSSL_DECODER_up_ref(dest->decoder)) {
  ------------------
  |  Branch (323:9): [True: 0, False: 2.36M]
  ------------------
  324|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  325|      0|        goto err;
  326|      0|    }
  327|  2.36M|    prov = OSSL_DECODER_get0_provider(dest->decoder);
  328|  2.36M|    provctx = OSSL_PROVIDER_get0_provider_ctx(prov);
  329|       |
  330|  2.36M|    dest->decoderctx = dest->decoder->newctx(provctx);
  331|  2.36M|    if (dest->decoderctx == NULL) {
  ------------------
  |  Branch (331:9): [True: 0, False: 2.36M]
  ------------------
  332|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  333|      0|        OSSL_DECODER_free(dest->decoder);
  334|      0|        goto err;
  335|      0|    }
  336|       |
  337|  2.36M|    return dest;
  338|       |
  339|      0|err:
  340|      0|    OPENSSL_free(dest);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  341|       |    return NULL;
  342|  2.36M|}
ossl_decoder_ctx_add_decoder_inst:
  356|     11|{
  357|     11|    int ok;
  358|       |
  359|     11|    if (ctx->decoder_insts == NULL
  ------------------
  |  Branch (359:9): [True: 2, False: 9]
  ------------------
  360|      2|        && (ctx->decoder_insts = sk_OSSL_DECODER_INSTANCE_new_null()) == NULL) {
  ------------------
  |  Branch (360:12): [True: 0, False: 2]
  ------------------
  361|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  362|      0|        return 0;
  363|      0|    }
  364|       |
  365|     11|    ok = (sk_OSSL_DECODER_INSTANCE_push(ctx->decoder_insts, di) > 0);
  366|     11|    if (ok) {
  ------------------
  |  Branch (366:9): [True: 11, False: 0]
  ------------------
  367|     11|        OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|     11|    do {                           \
  |  |  222|     11|        BIO *trc_out = NULL;       \
  |  |  223|     11|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 11]
  |  |  ------------------
  ------------------
  368|      0|        {
  369|      0|            BIO_printf(trc_out,
  370|      0|                "(ctx %p) Added decoder instance %p for decoder %p\n"
  371|      0|                "    %s with %s\n",
  372|      0|                (void *)ctx, (void *)di, (void *)di->decoder,
  373|      0|                OSSL_DECODER_get0_name(di->decoder),
  374|      0|                OSSL_DECODER_get0_properties(di->decoder));
  375|      0|        }
  376|     11|        OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|     11|    }                            \
  |  |  227|     11|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 11]
  |  |  ------------------
  ------------------
  377|     11|    }
  378|     11|    return ok;
  379|     11|}
OSSL_DECODER_CTX_add_extra:
  558|      2|{
  559|       |    /*
  560|       |     * This function goes through existing decoder methods in
  561|       |     * |ctx->decoder_insts|, and tries to fetch new decoders that produce
  562|       |     * what the existing ones want as input, and push those newly fetched
  563|       |     * decoders on top of the same stack.
  564|       |     * Then it does the same again, but looping over the newly fetched
  565|       |     * decoders, until there are no more decoders to be fetched, or
  566|       |     * when we have done this 10 times.
  567|       |     *
  568|       |     * we do this with sliding windows on the stack by keeping track of indexes
  569|       |     * and of the end.
  570|       |     *
  571|       |     * +----------------+
  572|       |     * |   DER to RSA   | <--- w_prev_start
  573|       |     * +----------------+
  574|       |     * |   DER to DSA   |
  575|       |     * +----------------+
  576|       |     * |   DER to DH    |
  577|       |     * +----------------+
  578|       |     * |   PEM to DER   | <--- w_prev_end, w_new_start
  579|       |     * +----------------+
  580|       |     *                    <--- w_new_end
  581|       |     */
  582|      2|    struct collect_extra_decoder_data_st data;
  583|      2|    size_t depth = 0; /* Counts the number of iterations */
  584|      2|    size_t count; /* Calculates how many were added in each iteration */
  585|      2|    int numdecoders;
  586|      2|    STACK_OF(OSSL_DECODER) *skdecoders;
  ------------------
  |  |   33|      2|#define STACK_OF(type) struct stack_st_##type
  ------------------
  587|       |
  588|      2|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|      2|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|      2|    __FILE__, __LINE__)
  ------------------
  |  Branch (588:9): [True: 0, False: 2]
  ------------------
  589|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  590|      0|        return 0;
  591|      0|    }
  592|       |
  593|       |    /*
  594|       |     * If there is no stack of OSSL_DECODER_INSTANCE, we have nothing
  595|       |     * more to add.  That's fine.
  596|       |     */
  597|      2|    if (ctx->decoder_insts == NULL)
  ------------------
  |  Branch (597:9): [True: 0, False: 2]
  ------------------
  598|      0|        return 1;
  599|       |
  600|      2|    OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|      2|    do {                           \
  |  |  222|      2|        BIO *trc_out = NULL;       \
  |  |  223|      2|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 2]
  |  |  ------------------
  ------------------
  601|      0|    {
  602|      0|        BIO_printf(trc_out, "(ctx %p) Looking for extra decoders\n",
  603|      0|            (void *)ctx);
  604|      0|    }
  605|      2|    OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|      2|    }                            \
  |  |  227|      2|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
  606|       |
  607|      2|    skdecoders = sk_OSSL_DECODER_new_null();
  608|      2|    if (skdecoders == NULL) {
  ------------------
  |  Branch (608:9): [True: 0, False: 2]
  ------------------
  609|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  610|      0|        return 0;
  611|      0|    }
  612|      2|    OSSL_DECODER_do_all_provided(libctx, collect_all_decoders, skdecoders);
  613|      2|    numdecoders = sk_OSSL_DECODER_num(skdecoders);
  614|       |
  615|       |    /*
  616|       |     * If there are provided or default properties, sort the initial decoder list
  617|       |     * by property matching score so that the highest scored provider is selected
  618|       |     * first.
  619|       |     */
  620|      2|    if (propq != NULL || ossl_ctx_global_properties(libctx, 0) != NULL) {
  ------------------
  |  Branch (620:9): [True: 0, False: 2]
  |  Branch (620:26): [True: 2, False: 0]
  ------------------
  621|      2|        int num_decoder_insts = sk_OSSL_DECODER_INSTANCE_num(ctx->decoder_insts);
  622|      2|        int i;
  623|      2|        OSSL_DECODER_INSTANCE *di;
  624|      2|        sk_OSSL_DECODER_INSTANCE_compfunc old_cmp = sk_OSSL_DECODER_INSTANCE_set_cmp_func(ctx->decoder_insts, decoder_sk_cmp);
  625|       |
  626|      7|        for (i = 0; i < num_decoder_insts; i++) {
  ------------------
  |  Branch (626:21): [True: 5, False: 2]
  ------------------
  627|      5|            di = sk_OSSL_DECODER_INSTANCE_value(ctx->decoder_insts, i);
  628|      5|            di->order = i;
  629|      5|        }
  630|      2|        sk_OSSL_DECODER_INSTANCE_sort(ctx->decoder_insts);
  631|      2|        sk_OSSL_DECODER_INSTANCE_set_cmp_func(ctx->decoder_insts, old_cmp);
  632|      2|    }
  633|       |
  634|      2|    memset(&data, 0, sizeof(data));
  635|      2|    data.ctx = ctx;
  636|      2|    data.w_prev_start = 0;
  637|      2|    data.w_prev_end = sk_OSSL_DECODER_INSTANCE_num(ctx->decoder_insts);
  638|      4|    do {
  639|      4|        int i, j;
  640|       |
  641|      4|        data.w_new_start = data.w_new_end = data.w_prev_end;
  642|       |
  643|       |        /*
  644|       |         * Two iterations:
  645|       |         * 0.  All decoders that have the same name as their input type.
  646|       |         *     This allows for decoders that unwrap some data in a specific
  647|       |         *     encoding, and pass the result on with the same encoding.
  648|       |         * 1.  All decoders that a different name than their input type.
  649|       |         */
  650|      4|        for (data.type_check = IS_SAME;
  651|     12|            data.type_check <= IS_DIFFERENT;
  ------------------
  |  Branch (651:13): [True: 8, False: 4]
  ------------------
  652|      8|            data.type_check++) {
  653|     30|            for (i = data.w_prev_start; i < data.w_prev_end; i++) {
  ------------------
  |  Branch (653:41): [True: 22, False: 8]
  ------------------
  654|     22|                OSSL_DECODER_INSTANCE *decoder_inst = sk_OSSL_DECODER_INSTANCE_value(ctx->decoder_insts, i);
  655|       |
  656|     22|                data.output_type
  657|     22|                    = OSSL_DECODER_INSTANCE_get_input_type(decoder_inst);
  658|       |
  659|     22|                data.output_type_id = 0;
  660|       |
  661|  1.69k|                for (j = 0; j < numdecoders; j++)
  ------------------
  |  Branch (661:29): [True: 1.67k, False: 22]
  ------------------
  662|  1.67k|                    collect_extra_decoder(sk_OSSL_DECODER_value(skdecoders, j),
  663|  1.67k|                        &data);
  664|     22|            }
  665|      8|        }
  666|       |        /* How many were added in this iteration */
  667|      4|        count = data.w_new_end - data.w_new_start;
  668|       |
  669|       |        /* Slide the "previous decoder" windows */
  670|      4|        data.w_prev_start = data.w_new_start;
  671|      4|        data.w_prev_end = data.w_new_end;
  672|       |
  673|      4|        depth++;
  674|      4|    } while (count != 0 && depth <= 10);
  ------------------
  |  Branch (674:14): [True: 2, False: 2]
  |  Branch (674:28): [True: 2, False: 0]
  ------------------
  675|       |
  676|      2|    sk_OSSL_DECODER_pop_free(skdecoders, OSSL_DECODER_free);
  677|      2|    return 1;
  678|      2|}
OSSL_DECODER_CTX_get_num_decoders:
  681|   824k|{
  682|   824k|    if (ctx == NULL || ctx->decoder_insts == NULL)
  ------------------
  |  Branch (682:9): [True: 0, False: 824k]
  |  Branch (682:24): [True: 0, False: 824k]
  ------------------
  683|      0|        return 0;
  684|   824k|    return sk_OSSL_DECODER_INSTANCE_num(ctx->decoder_insts);
  685|   824k|}
OSSL_DECODER_CTX_set_construct:
  689|   412k|{
  690|   412k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|   412k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|   412k|    __FILE__, __LINE__)
  ------------------
  |  Branch (690:9): [True: 0, False: 412k]
  ------------------
  691|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  692|      0|        return 0;
  693|      0|    }
  694|   412k|    ctx->construct = construct;
  695|   412k|    return 1;
  696|   412k|}
OSSL_DECODER_CTX_set_construct_data:
  700|   412k|{
  701|   412k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|   412k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|   412k|    __FILE__, __LINE__)
  ------------------
  |  Branch (701:9): [True: 0, False: 412k]
  ------------------
  702|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  703|      0|        return 0;
  704|      0|    }
  705|   412k|    ctx->construct_data = construct_data;
  706|   412k|    return 1;
  707|   412k|}
OSSL_DECODER_CTX_set_cleanup:
  711|   412k|{
  712|   412k|    if (!ossl_assert(ctx != NULL)) {
  ------------------
  |  |   52|   412k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|   412k|    __FILE__, __LINE__)
  ------------------
  |  Branch (712:9): [True: 0, False: 412k]
  ------------------
  713|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  714|      0|        return 0;
  715|      0|    }
  716|   412k|    ctx->cleanup = cleanup;
  717|   412k|    return 1;
  718|   412k|}
OSSL_DECODER_CTX_get_construct:
  722|   412k|{
  723|   412k|    if (ctx == NULL)
  ------------------
  |  Branch (723:9): [True: 0, False: 412k]
  ------------------
  724|      0|        return NULL;
  725|   412k|    return ctx->construct;
  726|   412k|}
OSSL_DECODER_CTX_get_construct_data:
  729|   412k|{
  730|   412k|    if (ctx == NULL)
  ------------------
  |  Branch (730:9): [True: 0, False: 412k]
  ------------------
  731|      0|        return NULL;
  732|   412k|    return ctx->construct_data;
  733|   412k|}
OSSL_DECODER_CTX_get_cleanup:
  737|   412k|{
  738|   412k|    if (ctx == NULL)
  ------------------
  |  Branch (738:9): [True: 0, False: 412k]
  ------------------
  739|      0|        return NULL;
  740|   412k|    return ctx->cleanup;
  741|   412k|}
OSSL_DECODER_INSTANCE_get_decoder:
  766|  4.01M|{
  767|  4.01M|    if (decoder_inst == NULL)
  ------------------
  |  Branch (767:9): [True: 0, False: 4.01M]
  ------------------
  768|      0|        return NULL;
  769|  4.01M|    return decoder_inst->decoder;
  770|  4.01M|}
OSSL_DECODER_INSTANCE_get_decoder_ctx:
  774|  3.18M|{
  775|  3.18M|    if (decoder_inst == NULL)
  ------------------
  |  Branch (775:9): [True: 0, False: 3.18M]
  ------------------
  776|      0|        return NULL;
  777|  3.18M|    return decoder_inst->decoderctx;
  778|  3.18M|}
OSSL_DECODER_INSTANCE_get_input_type:
  782|  2.36M|{
  783|  2.36M|    if (decoder_inst == NULL)
  ------------------
  |  Branch (783:9): [True: 0, False: 2.36M]
  ------------------
  784|      0|        return NULL;
  785|  2.36M|    return decoder_inst->input_type;
  786|  2.36M|}
OSSL_DECODER_INSTANCE_get_input_structure:
  791|  2.36M|{
  792|  2.36M|    if (decoder_inst == NULL)
  ------------------
  |  Branch (792:9): [True: 0, False: 2.36M]
  ------------------
  793|      0|        return NULL;
  794|  2.36M|    *was_set = decoder_inst->flag_input_structure_was_set;
  795|  2.36M|    return decoder_inst->input_structure;
  796|  2.36M|}
decoder_lib.c:collect_all_decoders:
  431|    152|{
  432|    152|    STACK_OF(OSSL_DECODER) *skdecoders = arg;
  ------------------
  |  |   33|    152|#define STACK_OF(type) struct stack_st_##type
  ------------------
  433|       |
  434|    152|    if (OSSL_DECODER_up_ref(decoder)
  ------------------
  |  Branch (434:9): [True: 152, False: 0]
  ------------------
  435|    152|        && !sk_OSSL_DECODER_push(skdecoders, decoder))
  ------------------
  |  Branch (435:12): [True: 0, False: 152]
  ------------------
  436|      0|        OSSL_DECODER_free(decoder);
  437|    152|}
decoder_lib.c:decoder_sk_cmp:
  550|      3|{
  551|      3|    if ((*a)->score == (*b)->score)
  ------------------
  |  Branch (551:9): [True: 3, False: 0]
  ------------------
  552|      3|        return (*a)->order - (*b)->order;
  553|      0|    return (*a)->score - (*b)->score;
  554|      3|}
decoder_lib.c:collect_extra_decoder:
  440|  1.67k|{
  441|  1.67k|    struct collect_extra_decoder_data_st *data = arg;
  442|  1.67k|    int j;
  443|  1.67k|    const OSSL_PROVIDER *prov = OSSL_DECODER_get0_provider(decoder);
  444|  1.67k|    void *provctx = OSSL_PROVIDER_get0_provider_ctx(prov);
  445|       |
  446|  1.67k|    if (ossl_decoder_fast_is_a(decoder, data->output_type, &data->output_type_id)) {
  ------------------
  |  Branch (446:9): [True: 54, False: 1.61k]
  ------------------
  447|     54|        void *decoderctx = NULL;
  448|     54|        OSSL_DECODER_INSTANCE *di = NULL;
  449|       |
  450|     54|        OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|     54|    do {                           \
  |  |  222|     54|        BIO *trc_out = NULL;       \
  |  |  223|     54|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 54]
  |  |  ------------------
  ------------------
  451|      0|        {
  452|      0|            BIO_printf(trc_out,
  453|      0|                "(ctx %p) [%d] Checking out decoder %p:\n"
  454|      0|                "    %s with %s\n",
  455|      0|                (void *)data->ctx, data->type_check, (void *)decoder,
  456|      0|                OSSL_DECODER_get0_name(decoder),
  457|      0|                OSSL_DECODER_get0_properties(decoder));
  458|      0|        }
  459|     54|        OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|     54|    }                            \
  |  |  227|     54|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 54]
  |  |  ------------------
  ------------------
  460|       |
  461|       |        /*
  462|       |         * Check that we don't already have this decoder in our stack,
  463|       |         * starting with the previous windows but also looking at what
  464|       |         * we have added in the current window.
  465|       |         */
  466|    184|        for (j = data->w_prev_start; j < data->w_new_end; j++) {
  ------------------
  |  Branch (466:38): [True: 173, False: 11]
  ------------------
  467|    173|            OSSL_DECODER_INSTANCE *check_inst = sk_OSSL_DECODER_INSTANCE_value(data->ctx->decoder_insts, j);
  468|       |
  469|    173|            if (decoder->base.algodef == check_inst->decoder->base.algodef) {
  ------------------
  |  Branch (469:17): [True: 43, False: 130]
  ------------------
  470|       |                /* We found it, so don't do anything more */
  471|     43|                OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|     43|    do {                           \
  |  |  222|     43|        BIO *trc_out = NULL;       \
  |  |  223|     43|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 43]
  |  |  ------------------
  ------------------
  472|      0|                {
  473|      0|                    BIO_printf(trc_out,
  474|      0|                        "    REJECTED: already exists in the chain\n");
  475|      0|                }
  476|     43|                OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|     43|    }                            \
  |  |  227|     43|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 43]
  |  |  ------------------
  ------------------
  477|     43|                return;
  478|     43|            }
  479|    173|        }
  480|       |
  481|     11|        if ((decoderctx = decoder->newctx(provctx)) == NULL)
  ------------------
  |  Branch (481:13): [True: 0, False: 11]
  ------------------
  482|      0|            return;
  483|       |
  484|     11|        if (decoder->set_ctx_params != NULL
  ------------------
  |  Branch (484:13): [True: 11, False: 0]
  ------------------
  485|     11|            && data->ctx->input_structure != NULL) {
  ------------------
  |  Branch (485:16): [True: 11, False: 0]
  ------------------
  486|     11|            OSSL_PARAM params[] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|     11|    { NULL, 0, NULL, 0, 0 }
  ------------------
                          OSSL_PARAM params[] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|     11|    { NULL, 0, NULL, 0, 0 }
  ------------------
  487|     11|            const char *str = data->ctx->input_structure;
  488|       |
  489|     11|            params[0] = OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_STRUCTURE,
  ------------------
  |  |  357|     11|# define OSSL_OBJECT_PARAM_DATA_STRUCTURE "data-structure"
  ------------------
  490|     11|                (char *)str, 0);
  491|     11|            if (!decoder->set_ctx_params(decoderctx, params)) {
  ------------------
  |  Branch (491:17): [True: 0, False: 11]
  ------------------
  492|      0|                decoder->freectx(decoderctx);
  493|      0|                return;
  494|      0|            }
  495|     11|        }
  496|       |
  497|     11|        if ((di = ossl_decoder_instance_new(decoder, decoderctx)) == NULL) {
  ------------------
  |  Branch (497:13): [True: 0, False: 11]
  ------------------
  498|      0|            decoder->freectx(decoderctx);
  499|      0|            return;
  500|      0|        }
  501|       |
  502|     11|        switch (data->type_check) {
  ------------------
  |  Branch (502:17): [True: 11, False: 0]
  ------------------
  503|      9|        case IS_SAME:
  ------------------
  |  Branch (503:9): [True: 9, False: 2]
  ------------------
  504|       |            /* If it differs, this is not a decoder to add for now. */
  505|      9|            if (!ossl_decoder_fast_is_a(decoder,
  ------------------
  |  Branch (505:17): [True: 5, False: 4]
  ------------------
  506|      9|                    OSSL_DECODER_INSTANCE_get_input_type(di),
  507|      9|                    &di->input_type_id)) {
  508|      5|                ossl_decoder_instance_free(di);
  509|      5|                OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|      5|    do {                           \
  |  |  222|      5|        BIO *trc_out = NULL;       \
  |  |  223|      5|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 5]
  |  |  ------------------
  ------------------
  510|      0|                {
  511|      0|                    BIO_printf(trc_out,
  512|      0|                        "    REJECTED: input type doesn't match output type\n");
  513|      0|                }
  514|      5|                OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|      5|    }                            \
  |  |  227|      5|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 5]
  |  |  ------------------
  ------------------
  515|      5|                return;
  516|      5|            }
  517|      4|            break;
  518|      4|        case IS_DIFFERENT:
  ------------------
  |  Branch (518:9): [True: 2, False: 9]
  ------------------
  519|       |            /* If it's the same, this is not a decoder to add for now. */
  520|      2|            if (ossl_decoder_fast_is_a(decoder,
  ------------------
  |  Branch (520:17): [True: 0, False: 2]
  ------------------
  521|      2|                    OSSL_DECODER_INSTANCE_get_input_type(di),
  522|      2|                    &di->input_type_id)) {
  523|      0|                ossl_decoder_instance_free(di);
  524|      0|                OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|      0|    do {                           \
  |  |  222|      0|        BIO *trc_out = NULL;       \
  |  |  223|      0|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  525|      0|                {
  526|      0|                    BIO_printf(trc_out,
  527|      0|                        "    REJECTED: input type matches output type\n");
  528|      0|                }
  529|      0|                OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|      0|    }                            \
  |  |  227|      0|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  530|      0|                return;
  531|      0|            }
  532|      2|            break;
  533|     11|        }
  534|       |
  535|       |        /*
  536|       |         * Apart from keeping w_new_end up to date, We don't care about
  537|       |         * errors here.  If it doesn't collect, then it doesn't...
  538|       |         */
  539|      6|        if (!ossl_decoder_ctx_add_decoder_inst(data->ctx, di)) {
  ------------------
  |  Branch (539:13): [True: 0, False: 6]
  ------------------
  540|      0|            ossl_decoder_instance_free(di);
  541|      0|            return;
  542|      0|        }
  543|       |
  544|      6|        data->w_new_end++;
  545|      6|    }
  546|  1.67k|}
decoder_lib.c:decoder_process:
  799|  1.23M|{
  800|  1.23M|    struct decoder_process_data_st *data = arg;
  801|  1.23M|    OSSL_DECODER_CTX *ctx = data->ctx;
  802|  1.23M|    OSSL_DECODER_INSTANCE *decoder_inst = NULL;
  803|  1.23M|    OSSL_DECODER *decoder = NULL;
  804|  1.23M|    OSSL_CORE_BIO *cbio = NULL;
  805|  1.23M|    BIO *bio = data->bio;
  806|  1.23M|    long loc;
  807|  1.23M|    int i;
  808|  1.23M|    int ok = 0;
  809|       |    /* For recursions */
  810|  1.23M|    struct decoder_process_data_st new_data;
  811|  1.23M|    const char *data_type = NULL;
  812|  1.23M|    const char *data_structure = NULL;
  813|       |    /* Saved to restore on return, mutated in PEM->DER transition. */
  814|  1.23M|    const char *start_input_type = ctx->start_input_type;
  815|       |
  816|       |    /*
  817|       |     * This is an indicator up the call stack that something was indeed
  818|       |     * decoded, leading to a recursive call of this function.
  819|       |     */
  820|  1.23M|    data->flag_next_level_called = 1;
  821|       |
  822|  1.23M|    memset(&new_data, 0, sizeof(new_data));
  823|  1.23M|    new_data.ctx = data->ctx;
  824|  1.23M|    new_data.recursion = data->recursion + 1;
  825|       |
  826|  1.23M|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  827|  1.23M|#define LEVEL ((size_t)new_data.recursion < sizeof(LEVEL_STR)    \
  828|  1.23M|        ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  829|  1.23M|        : LEVEL_STR "...")
  830|       |
  831|  1.23M|    if (params == NULL) {
  ------------------
  |  Branch (831:9): [True: 412k, False: 824k]
  ------------------
  832|       |        /* First iteration, where we prepare for what is to come */
  833|       |
  834|   412k|        OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|   412k|    do {                           \
  |  |  222|   412k|        BIO *trc_out = NULL;       \
  |  |  223|   412k|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 412k]
  |  |  ------------------
  ------------------
  835|      0|        {
  836|      0|            BIO_printf(trc_out,
  837|      0|                "(ctx %p) starting to walk the decoder chain\n",
  838|      0|                (void *)new_data.ctx);
  839|      0|        }
  840|   412k|        OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|   412k|    }                            \
  |  |  227|   412k|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 412k]
  |  |  ------------------
  ------------------
  841|       |
  842|   412k|        data->current_decoder_inst_index = OSSL_DECODER_CTX_get_num_decoders(ctx);
  843|       |
  844|   412k|        bio = data->bio;
  845|   824k|    } else {
  846|   824k|        const OSSL_PARAM *p;
  847|   824k|        const char *trace_data_structure;
  848|       |
  849|   824k|        decoder_inst = sk_OSSL_DECODER_INSTANCE_value(ctx->decoder_insts,
  850|   824k|            data->current_decoder_inst_index);
  851|   824k|        decoder = OSSL_DECODER_INSTANCE_get_decoder(decoder_inst);
  852|       |
  853|   824k|        data->flag_construct_called = 0;
  854|   824k|        if (ctx->construct != NULL) {
  ------------------
  |  Branch (854:13): [True: 824k, False: 0]
  ------------------
  855|   824k|            int rv;
  856|       |
  857|   824k|            OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|   824k|    do {                           \
  |  |  222|   824k|        BIO *trc_out = NULL;       \
  |  |  223|   824k|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 824k]
  |  |  ------------------
  ------------------
  858|      0|            {
  859|      0|                BIO_printf(trc_out,
  860|      0|                    "(ctx %p) %s Running constructor\n",
  861|      0|                    (void *)new_data.ctx, LEVEL);
  ------------------
  |  |  827|      0|#define LEVEL ((size_t)new_data.recursion < sizeof(LEVEL_STR)    \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (827:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  828|      0|        ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                       ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  829|      0|        : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  862|      0|            }
  863|   824k|            OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|   824k|    }                            \
  |  |  227|   824k|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 824k]
  |  |  ------------------
  ------------------
  864|       |
  865|   824k|            rv = ctx->construct(decoder_inst, params, ctx->construct_data);
  866|       |
  867|   824k|            OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|   824k|    do {                           \
  |  |  222|   824k|        BIO *trc_out = NULL;       \
  |  |  223|   824k|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 824k]
  |  |  ------------------
  ------------------
  868|      0|            {
  869|      0|                BIO_printf(trc_out,
  870|      0|                    "(ctx %p) %s Running constructor => %d\n",
  871|      0|                    (void *)new_data.ctx, LEVEL, rv);
  ------------------
  |  |  827|      0|#define LEVEL ((size_t)new_data.recursion < sizeof(LEVEL_STR)    \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (827:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  828|      0|        ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                       ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  829|      0|        : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  872|      0|            }
  873|   824k|            OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|   824k|    }                            \
  |  |  227|   824k|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 824k]
  |  |  ------------------
  ------------------
  874|       |
  875|   824k|            ok = (rv > 0);
  876|   824k|            if (ok) {
  ------------------
  |  Branch (876:17): [True: 412k, False: 412k]
  ------------------
  877|   412k|                data->flag_construct_called = 1;
  878|   412k|                goto end;
  879|   412k|            }
  880|   824k|        }
  881|       |
  882|       |        /* The constructor didn't return success */
  883|       |
  884|       |        /*
  885|       |         * so we try to use the object we got and feed it to any next
  886|       |         * decoder that will take it.  Object references are not
  887|       |         * allowed for this.
  888|       |         * If this data isn't present, decoding has failed.
  889|       |         */
  890|       |
  891|   412k|        p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA);
  ------------------
  |  |  356|   412k|# define OSSL_OBJECT_PARAM_DATA "data"
  ------------------
  892|   412k|        if (p == NULL || p->data_type != OSSL_PARAM_OCTET_STRING)
  ------------------
  |  |  123|   412k|#define OSSL_PARAM_OCTET_STRING 5
  ------------------
  |  Branch (892:13): [True: 0, False: 412k]
  |  Branch (892:26): [True: 0, False: 412k]
  ------------------
  893|      0|            goto end;
  894|   412k|        new_data.bio = BIO_new_mem_buf(p->data, (int)p->data_size);
  895|   412k|        if (new_data.bio == NULL)
  ------------------
  |  Branch (895:13): [True: 0, False: 412k]
  ------------------
  896|      0|            goto end;
  897|   412k|        bio = new_data.bio;
  898|       |
  899|       |        /* Get the data type if there is one */
  900|   412k|        p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA_TYPE);
  ------------------
  |  |  358|   412k|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
  901|   412k|        if (p != NULL && !OSSL_PARAM_get_utf8_string_ptr(p, &data_type))
  ------------------
  |  Branch (901:13): [True: 412k, False: 0]
  |  Branch (901:26): [True: 0, False: 412k]
  ------------------
  902|      0|            goto end;
  903|       |
  904|       |        /* Get the data structure if there is one */
  905|   412k|        p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA_STRUCTURE);
  ------------------
  |  |  357|   412k|# define OSSL_OBJECT_PARAM_DATA_STRUCTURE "data-structure"
  ------------------
  906|   412k|        if (p != NULL && !OSSL_PARAM_get_utf8_string_ptr(p, &data_structure))
  ------------------
  |  Branch (906:13): [True: 412k, False: 0]
  |  Branch (906:26): [True: 0, False: 412k]
  ------------------
  907|      0|            goto end;
  908|       |
  909|       |        /* Get the new input type if there is one */
  910|   412k|        p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_INPUT_TYPE);
  ------------------
  |  |  360|   412k|# define OSSL_OBJECT_PARAM_INPUT_TYPE "input-type"
  ------------------
  911|   412k|        if (p != NULL) {
  ------------------
  |  Branch (911:13): [True: 412k, False: 0]
  ------------------
  912|   412k|            if (!OSSL_PARAM_get_utf8_string_ptr(p, &ctx->start_input_type))
  ------------------
  |  Branch (912:17): [True: 0, False: 412k]
  ------------------
  913|      0|                goto end;
  914|       |            /*
  915|       |             * When switching PKCS8 from PEM to DER we decrypt the data if needed
  916|       |             * and then determine the algorithm OID.  Likewise, with SPKI, only
  917|       |             * this time sans decryption.
  918|       |             */
  919|   412k|            if (ctx->input_structure != NULL
  ------------------
  |  Branch (919:17): [True: 412k, False: 0]
  ------------------
  920|   412k|                && (OPENSSL_strcasecmp(ctx->input_structure, "SubjectPublicKeyInfo") == 0
  ------------------
  |  Branch (920:21): [True: 412k, False: 0]
  ------------------
  921|      0|                    || OPENSSL_strcasecmp(data_structure, "PrivateKeyInfo") == 0
  ------------------
  |  Branch (921:24): [True: 0, False: 0]
  ------------------
  922|      0|                    || OPENSSL_strcasecmp(ctx->input_structure, "PrivateKeyInfo") == 0))
  ------------------
  |  Branch (922:24): [True: 0, False: 0]
  ------------------
  923|   412k|                data->flag_input_structure_checked = 1;
  924|   412k|        }
  925|       |
  926|       |        /*
  927|       |         * If the data structure is "type-specific" and the data type is
  928|       |         * given, we drop the data structure.  The reasoning is that the
  929|       |         * data type is already enough to find the applicable next decoder,
  930|       |         * so an additional "type-specific" data structure is extraneous.
  931|       |         *
  932|       |         * Furthermore, if the OSSL_DECODER caller asked for a type specific
  933|       |         * structure under another name, such as "DH", we get a mismatch
  934|       |         * if the data structure we just received is "type-specific".
  935|       |         * There's only so much you can do without infusing this code with
  936|       |         * too special knowledge.
  937|       |         */
  938|   412k|        trace_data_structure = data_structure;
  939|   412k|        if (data_type != NULL && data_structure != NULL
  ------------------
  |  Branch (939:13): [True: 412k, False: 0]
  |  Branch (939:34): [True: 412k, False: 0]
  ------------------
  940|   412k|            && OPENSSL_strcasecmp(data_structure, "type-specific") == 0)
  ------------------
  |  Branch (940:16): [True: 0, False: 412k]
  ------------------
  941|      0|            data_structure = NULL;
  942|       |
  943|   412k|        OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|   412k|    do {                           \
  |  |  222|   412k|        BIO *trc_out = NULL;       \
  |  |  223|   412k|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 412k]
  |  |  ------------------
  ------------------
  944|      0|        {
  945|      0|            BIO_printf(trc_out,
  946|      0|                "(ctx %p) %s incoming from previous decoder (%p):\n"
  947|      0|                "    data type: %s, data structure: %s%s\n",
  948|      0|                (void *)new_data.ctx, LEVEL, (void *)decoder,
  ------------------
  |  |  827|      0|#define LEVEL ((size_t)new_data.recursion < sizeof(LEVEL_STR)    \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (827:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  828|      0|        ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                       ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  829|      0|        : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  949|      0|                data_type, trace_data_structure,
  950|      0|                (trace_data_structure == data_structure
  ------------------
  |  Branch (950:18): [True: 0, False: 0]
  ------------------
  951|      0|                        ? ""
  952|      0|                        : " (dropped)"));
  953|      0|        }
  954|   412k|        OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|   412k|    }                            \
  |  |  227|   412k|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 412k]
  |  |  ------------------
  ------------------
  955|   412k|    }
  956|       |
  957|       |    /*
  958|       |     * If we have no more decoders to look through at this point,
  959|       |     * we failed
  960|       |     */
  961|   824k|    if (data->current_decoder_inst_index == 0)
  ------------------
  |  Branch (961:9): [True: 0, False: 824k]
  ------------------
  962|      0|        goto end;
  963|       |
  964|   824k|    if ((loc = BIO_tell(bio)) < 0) {
  ------------------
  |  |  573|   824k|#define BIO_tell(b) (int)BIO_ctrl(b, BIO_C_FILE_TELL, 0, NULL)
  |  |  ------------------
  |  |  |  |  468|   824k|#define BIO_C_FILE_TELL 133
  |  |  ------------------
  ------------------
  |  Branch (964:9): [True: 0, False: 824k]
  ------------------
  965|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_BIO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  966|      0|        goto end;
  967|      0|    }
  968|       |
  969|   824k|    if ((cbio = ossl_core_bio_new_from_bio(bio)) == NULL) {
  ------------------
  |  Branch (969:9): [True: 0, False: 824k]
  ------------------
  970|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_BIO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  971|      0|        goto end;
  972|      0|    }
  973|       |
  974|  2.36M|    for (i = data->current_decoder_inst_index; i-- > 0;) {
  ------------------
  |  Branch (974:48): [True: 2.36M, False: 0]
  ------------------
  975|  2.36M|        OSSL_DECODER_INSTANCE *new_decoder_inst = sk_OSSL_DECODER_INSTANCE_value(ctx->decoder_insts, i);
  976|  2.36M|        OSSL_DECODER *new_decoder = OSSL_DECODER_INSTANCE_get_decoder(new_decoder_inst);
  977|  2.36M|        const char *new_decoder_name = NULL;
  978|  2.36M|        void *new_decoderctx = OSSL_DECODER_INSTANCE_get_decoder_ctx(new_decoder_inst);
  979|  2.36M|        const char *new_input_type = OSSL_DECODER_INSTANCE_get_input_type(new_decoder_inst);
  980|  2.36M|        int n_i_s_was_set = 0; /* We don't care here */
  981|  2.36M|        const char *new_input_structure = OSSL_DECODER_INSTANCE_get_input_structure(new_decoder_inst,
  982|  2.36M|            &n_i_s_was_set);
  983|       |
  984|  2.36M|        OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|  2.36M|    do {                           \
  |  |  222|  2.36M|        BIO *trc_out = NULL;       \
  |  |  223|  2.36M|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 2.36M]
  |  |  ------------------
  ------------------
  985|      0|        {
  986|      0|            new_decoder_name = OSSL_DECODER_get0_name(new_decoder);
  987|      0|            BIO_printf(trc_out,
  988|      0|                "(ctx %p) %s [%u] Considering decoder instance %p (decoder %p):\n"
  989|      0|                "    %s with %s\n",
  990|      0|                (void *)new_data.ctx, LEVEL, (unsigned int)i,
  ------------------
  |  |  827|      0|#define LEVEL ((size_t)new_data.recursion < sizeof(LEVEL_STR)    \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (827:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  828|      0|        ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                       ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  829|      0|        : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
  991|      0|                (void *)new_decoder_inst, (void *)new_decoder,
  992|      0|                new_decoder_name,
  993|      0|                OSSL_DECODER_get0_properties(new_decoder));
  994|      0|        }
  995|  2.36M|        OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|  2.36M|    }                            \
  |  |  227|  2.36M|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 2.36M]
  |  |  ------------------
  ------------------
  996|       |
  997|       |        /*
  998|       |         * If |decoder| is NULL, it means we've just started, and the caller
  999|       |         * may have specified what it expects the initial input to be.  If
 1000|       |         * that's the case, we do this extra check.
 1001|       |         */
 1002|  2.36M|        if (decoder == NULL && ctx->start_input_type != NULL
  ------------------
  |  Branch (1002:13): [True: 1.23M, False: 1.12M]
  |  Branch (1002:32): [True: 1.23M, False: 0]
  ------------------
 1003|  1.23M|            && OPENSSL_strcasecmp(ctx->start_input_type, new_input_type) != 0) {
  ------------------
  |  Branch (1003:16): [True: 412k, False: 824k]
  ------------------
 1004|   412k|            OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|   412k|    do {                           \
  |  |  222|   412k|        BIO *trc_out = NULL;       \
  |  |  223|   412k|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 412k]
  |  |  ------------------
  ------------------
 1005|      0|            {
 1006|      0|                BIO_printf(trc_out,
 1007|      0|                    "(ctx %p) %s [%u] the start input type '%s' doesn't match the input type of the considered decoder, skipping...\n",
 1008|      0|                    (void *)new_data.ctx, LEVEL, (unsigned int)i,
  ------------------
  |  |  827|      0|#define LEVEL ((size_t)new_data.recursion < sizeof(LEVEL_STR)    \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (827:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  828|      0|        ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                       ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  829|      0|        : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
 1009|      0|                    ctx->start_input_type);
 1010|      0|            }
 1011|   412k|            OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|   412k|    }                            \
  |  |  227|   412k|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 412k]
  |  |  ------------------
  ------------------
 1012|   412k|            continue;
 1013|   412k|        }
 1014|       |
 1015|       |        /*
 1016|       |         * If we have a previous decoder, we check that the input type
 1017|       |         * of the next to be used matches the type of this previous one.
 1018|       |         * |new_input_type| holds the value of the "input-type" parameter
 1019|       |         * for the decoder we're currently considering.
 1020|       |         */
 1021|  1.94M|        if (decoder != NULL && !ossl_decoder_fast_is_a(decoder, new_input_type, &new_decoder_inst->input_type_id)) {
  ------------------
  |  Branch (1021:13): [True: 1.12M, False: 824k]
  |  Branch (1021:32): [True: 0, False: 1.12M]
  ------------------
 1022|      0|            OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|      0|    do {                           \
  |  |  222|      0|        BIO *trc_out = NULL;       \
  |  |  223|      0|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1023|      0|            {
 1024|      0|                BIO_printf(trc_out,
 1025|      0|                    "(ctx %p) %s [%u] the input type doesn't match the name of the previous decoder (%p), skipping...\n",
 1026|      0|                    (void *)new_data.ctx, LEVEL, (unsigned int)i,
  ------------------
  |  |  827|      0|#define LEVEL ((size_t)new_data.recursion < sizeof(LEVEL_STR)    \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (827:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  828|      0|        ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                       ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  829|      0|        : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
 1027|      0|                    (void *)decoder);
 1028|      0|            }
 1029|      0|            OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|      0|    }                            \
  |  |  227|      0|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1030|      0|            continue;
 1031|      0|        }
 1032|       |
 1033|       |        /*
 1034|       |         * If the previous decoder gave us a data type, we check to see
 1035|       |         * if that matches the decoder we're currently considering.
 1036|       |         */
 1037|  1.94M|        if (data_type != NULL && !OSSL_DECODER_is_a(new_decoder, data_type)) {
  ------------------
  |  Branch (1037:13): [True: 1.12M, False: 824k]
  |  Branch (1037:34): [True: 112k, False: 1.01M]
  ------------------
 1038|   112k|            OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|   112k|    do {                           \
  |  |  222|   112k|        BIO *trc_out = NULL;       \
  |  |  223|   112k|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 112k]
  |  |  ------------------
  ------------------
 1039|      0|            {
 1040|      0|                BIO_printf(trc_out,
 1041|      0|                    "(ctx %p) %s [%u] the previous decoder's data type doesn't match the name of the considered decoder, skipping...\n",
 1042|      0|                    (void *)new_data.ctx, LEVEL, (unsigned int)i);
  ------------------
  |  |  827|      0|#define LEVEL ((size_t)new_data.recursion < sizeof(LEVEL_STR)    \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (827:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  828|      0|        ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                       ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  829|      0|        : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
 1043|      0|            }
 1044|   112k|            OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|   112k|    }                            \
  |  |  227|   112k|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 112k]
  |  |  ------------------
  ------------------
 1045|   112k|            continue;
 1046|   112k|        }
 1047|       |
 1048|       |        /*
 1049|       |         * If the previous decoder gave us a data structure name, we check
 1050|       |         * to see that it matches the input data structure of the decoder
 1051|       |         * we're currently considering.
 1052|       |         */
 1053|  1.83M|        if (data_structure != NULL
  ------------------
  |  Branch (1053:13): [True: 1.01M, False: 824k]
  ------------------
 1054|  1.01M|            && (new_input_structure == NULL
  ------------------
  |  Branch (1054:17): [True: 0, False: 1.01M]
  ------------------
 1055|  1.01M|                || OPENSSL_strcasecmp(data_structure,
  ------------------
  |  Branch (1055:20): [True: 598k, False: 412k]
  ------------------
 1056|  1.01M|                       new_input_structure)
 1057|  1.01M|                    != 0)) {
 1058|   598k|            OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|   598k|    do {                           \
  |  |  222|   598k|        BIO *trc_out = NULL;       \
  |  |  223|   598k|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 598k]
  |  |  ------------------
  ------------------
 1059|      0|            {
 1060|      0|                BIO_printf(trc_out,
 1061|      0|                    "(ctx %p) %s [%u] the previous decoder's data structure doesn't match the input structure of the considered decoder, skipping...\n",
 1062|      0|                    (void *)new_data.ctx, LEVEL, (unsigned int)i);
  ------------------
  |  |  827|      0|#define LEVEL ((size_t)new_data.recursion < sizeof(LEVEL_STR)    \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (827:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  828|      0|        ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                       ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  829|      0|        : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
 1063|      0|            }
 1064|   598k|            OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|   598k|    }                            \
  |  |  227|   598k|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 598k]
  |  |  ------------------
  ------------------
 1065|   598k|            continue;
 1066|   598k|        }
 1067|       |
 1068|       |        /*
 1069|       |         * If the decoder we're currently considering specifies a structure,
 1070|       |         * and this check hasn't already been done earlier in this chain of
 1071|       |         * decoder_process() calls, check that it matches the user provided
 1072|       |         * input structure, if one is given.
 1073|       |         */
 1074|  1.23M|        if (!data->flag_input_structure_checked
  ------------------
  |  Branch (1074:13): [True: 412k, False: 824k]
  ------------------
 1075|   412k|            && ctx->input_structure != NULL
  ------------------
  |  Branch (1075:16): [True: 412k, False: 0]
  ------------------
 1076|   412k|            && new_input_structure != NULL) {
  ------------------
  |  Branch (1076:16): [True: 412k, False: 0]
  ------------------
 1077|   412k|            data->flag_input_structure_checked = 1;
 1078|   412k|            if (OPENSSL_strcasecmp(new_input_structure,
  ------------------
  |  Branch (1078:17): [True: 412k, False: 0]
  ------------------
 1079|   412k|                    ctx->input_structure)
 1080|   412k|                != 0) {
 1081|   412k|                OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|   412k|    do {                           \
  |  |  222|   412k|        BIO *trc_out = NULL;       \
  |  |  223|   412k|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 412k]
  |  |  ------------------
  ------------------
 1082|      0|                {
 1083|      0|                    BIO_printf(trc_out,
 1084|      0|                        "(ctx %p) %s [%u] the previous decoder's data structure doesn't match the input structure given by the user, skipping...\n",
 1085|      0|                        (void *)new_data.ctx, LEVEL, (unsigned int)i);
  ------------------
  |  |  827|      0|#define LEVEL ((size_t)new_data.recursion < sizeof(LEVEL_STR)    \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (827:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  828|      0|        ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                       ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  829|      0|        : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
 1086|      0|                }
 1087|   412k|                OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|   412k|    }                            \
  |  |  227|   412k|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 412k]
  |  |  ------------------
  ------------------
 1088|   412k|                continue;
 1089|   412k|            }
 1090|   412k|        }
 1091|       |
 1092|       |        /*
 1093|       |         * Checking the return value of BIO_reset() or BIO_seek() is unsafe.
 1094|       |         * Furthermore, BIO_reset() is unsafe to use if the source BIO happens
 1095|       |         * to be a BIO_s_mem(), because the earlier BIO_tell() gives us zero
 1096|       |         * no matter where we are in the underlying buffer we're reading from.
 1097|       |         *
 1098|       |         * So, we simply do a BIO_seek(), and use BIO_tell() that we're back
 1099|       |         * at the same position.  This is a best effort attempt, but BIO_seek()
 1100|       |         * and BIO_tell() should come as a pair...
 1101|       |         */
 1102|   824k|        (void)BIO_seek(bio, loc);
  ------------------
  |  |  572|   824k|#define BIO_seek(b, ofs) (int)BIO_ctrl(b, BIO_C_FILE_SEEK, ofs, NULL)
  |  |  ------------------
  |  |  |  |  462|   824k|#define BIO_C_FILE_SEEK 128
  |  |  ------------------
  ------------------
 1103|   824k|        if (BIO_tell(bio) != loc)
  ------------------
  |  |  573|   824k|#define BIO_tell(b) (int)BIO_ctrl(b, BIO_C_FILE_TELL, 0, NULL)
  |  |  ------------------
  |  |  |  |  468|   824k|#define BIO_C_FILE_TELL 133
  |  |  ------------------
  ------------------
  |  Branch (1103:13): [True: 0, False: 824k]
  ------------------
 1104|      0|            goto end;
 1105|       |
 1106|       |        /* Recurse */
 1107|   824k|        OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|   824k|    do {                           \
  |  |  222|   824k|        BIO *trc_out = NULL;       \
  |  |  223|   824k|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 824k]
  |  |  ------------------
  ------------------
 1108|      0|        {
 1109|      0|            BIO_printf(trc_out,
 1110|      0|                "(ctx %p) %s [%u] Running decoder instance %s (%p)\n",
 1111|      0|                (void *)new_data.ctx, LEVEL, (unsigned int)i,
  ------------------
  |  |  827|      0|#define LEVEL ((size_t)new_data.recursion < sizeof(LEVEL_STR)    \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (827:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  828|      0|        ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                       ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  829|      0|        : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
 1112|      0|                new_decoder_name, (void *)new_decoder_inst);
 1113|      0|        }
 1114|   824k|        OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|   824k|    }                            \
  |  |  227|   824k|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 824k]
  |  |  ------------------
  ------------------
 1115|       |
 1116|       |        /*
 1117|       |         * We only care about errors reported from decoder implementations
 1118|       |         * if it returns false (i.e. there was a fatal error).
 1119|       |         */
 1120|   824k|        ERR_set_mark();
 1121|       |
 1122|   824k|        new_data.current_decoder_inst_index = i;
 1123|   824k|        new_data.flag_input_structure_checked
 1124|   824k|            = data->flag_input_structure_checked;
 1125|   824k|        ok = new_decoder->decode(new_decoderctx, cbio,
 1126|   824k|            new_data.ctx->selection,
 1127|   824k|            decoder_process, &new_data,
 1128|   824k|            ossl_pw_passphrase_callback_dec,
 1129|   824k|            &new_data.ctx->pwdata);
 1130|       |
 1131|   824k|        OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|   824k|    do {                           \
  |  |  222|   824k|        BIO *trc_out = NULL;       \
  |  |  223|   824k|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 824k]
  |  |  ------------------
  ------------------
 1132|      0|        {
 1133|      0|            BIO_printf(trc_out,
 1134|      0|                "(ctx %p) %s [%u] Running decoder instance %s (%p) => %d"
 1135|      0|                " (recursed further: %s, construct called: %s)\n",
 1136|      0|                (void *)new_data.ctx, LEVEL, (unsigned int)i,
  ------------------
  |  |  827|      0|#define LEVEL ((size_t)new_data.recursion < sizeof(LEVEL_STR)    \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  |  Branch (827:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  828|      0|        ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |                       ? &LEVEL_STR[sizeof(LEVEL_STR) - new_data.recursion - 1] \
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  |  |  829|      0|        : LEVEL_STR "...")
  |  |  ------------------
  |  |  |  |  826|      0|#define LEVEL_STR ">>>>>>>>>>>>>>>>"
  |  |  ------------------
  ------------------
 1137|      0|                new_decoder_name, (void *)new_decoder_inst, ok,
 1138|      0|                new_data.flag_next_level_called ? "yes" : "no",
  ------------------
  |  Branch (1138:17): [True: 0, False: 0]
  ------------------
 1139|      0|                new_data.flag_construct_called ? "yes" : "no");
  ------------------
  |  Branch (1139:17): [True: 0, False: 0]
  ------------------
 1140|      0|        }
 1141|   824k|        OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|   824k|    }                            \
  |  |  227|   824k|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 824k]
  |  |  ------------------
  ------------------
 1142|       |
 1143|   824k|        data->flag_construct_called = new_data.flag_construct_called;
 1144|       |
 1145|       |        /* Break on error or if we tried to construct an object already */
 1146|   824k|        if (!ok || data->flag_construct_called) {
  ------------------
  |  Branch (1146:13): [True: 0, False: 824k]
  |  Branch (1146:20): [True: 824k, False: 0]
  ------------------
 1147|   824k|            ERR_clear_last_mark();
 1148|   824k|            break;
 1149|   824k|        }
 1150|      0|        ERR_pop_to_mark();
 1151|       |
 1152|       |        /*
 1153|       |         * Break if the decoder implementation that we called recursed, since
 1154|       |         * that indicates that it successfully decoded something.
 1155|       |         */
 1156|      0|        if (new_data.flag_next_level_called)
  ------------------
  |  Branch (1156:13): [True: 0, False: 0]
  ------------------
 1157|      0|            break;
 1158|      0|    }
 1159|       |
 1160|  1.23M|end:
 1161|  1.23M|    ossl_core_bio_free(cbio);
 1162|  1.23M|    BIO_free(new_data.bio);
 1163|  1.23M|    ctx->start_input_type = start_input_type;
 1164|  1.23M|    return ok;
 1165|   824k|}

OSSL_DECODER_up_ref:
   53|  2.36M|{
   54|  2.36M|    int ref = 0;
   55|       |
   56|  2.36M|    CRYPTO_UP_REF(&decoder->base.refcnt, &ref);
   57|  2.36M|    return 1;
   58|  2.36M|}
OSSL_DECODER_free:
   61|  2.36M|{
   62|  2.36M|    int ref = 0;
   63|       |
   64|  2.36M|    if (decoder == NULL)
  ------------------
  |  Branch (64:9): [True: 0, False: 2.36M]
  ------------------
   65|      0|        return;
   66|       |
   67|  2.36M|    CRYPTO_DOWN_REF(&decoder->base.refcnt, &ref);
   68|  2.36M|    if (ref > 0)
  ------------------
  |  Branch (68:9): [True: 2.36M, False: 76]
  ------------------
   69|  2.36M|        return;
   70|     76|    OPENSSL_free(decoder->base.name);
  ------------------
  |  |  131|     76|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   71|     76|    ossl_property_free(decoder->base.parsed_propdef);
   72|     76|    ossl_provider_free(decoder->base.prov);
   73|     76|    CRYPTO_FREE_REF(&decoder->base.refcnt);
   74|     76|    OPENSSL_free(decoder);
  ------------------
  |  |  131|     76|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   75|     76|}
ossl_decoder_from_algorithm:
  211|     76|{
  212|     76|    OSSL_DECODER *decoder = NULL;
  213|     76|    const OSSL_DISPATCH *fns = algodef->implementation;
  214|     76|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  215|       |
  216|     76|    if ((decoder = ossl_decoder_new()) == NULL)
  ------------------
  |  Branch (216:9): [True: 0, False: 76]
  ------------------
  217|      0|        return NULL;
  218|     76|    decoder->base.id = id;
  219|     76|    if ((decoder->base.name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (219:9): [True: 0, False: 76]
  ------------------
  220|      0|        OSSL_DECODER_free(decoder);
  221|      0|        return NULL;
  222|      0|    }
  223|     76|    decoder->base.algodef = algodef;
  224|     76|    if ((decoder->base.parsed_propdef
  ------------------
  |  Branch (224:9): [True: 0, False: 76]
  ------------------
  225|     76|            = ossl_parse_property(libctx, algodef->property_definition))
  226|     76|        == NULL) {
  227|      0|        OSSL_DECODER_free(decoder);
  228|      0|        return NULL;
  229|      0|    }
  230|       |
  231|    598|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (231:12): [True: 522, False: 76]
  ------------------
  232|    522|        switch (fns->function_id) {
  ------------------
  |  Branch (232:17): [True: 522, False: 0]
  ------------------
  233|     76|        case OSSL_FUNC_DECODER_NEWCTX:
  ------------------
  |  |  984|     76|#define OSSL_FUNC_DECODER_NEWCTX 1
  ------------------
  |  Branch (233:9): [True: 76, False: 446]
  ------------------
  234|     76|            if (decoder->newctx == NULL)
  ------------------
  |  Branch (234:17): [True: 76, False: 0]
  ------------------
  235|     76|                decoder->newctx = OSSL_FUNC_decoder_newctx(fns);
  236|     76|            break;
  237|     76|        case OSSL_FUNC_DECODER_FREECTX:
  ------------------
  |  |  985|     76|#define OSSL_FUNC_DECODER_FREECTX 2
  ------------------
  |  Branch (237:9): [True: 76, False: 446]
  ------------------
  238|     76|            if (decoder->freectx == NULL)
  ------------------
  |  Branch (238:17): [True: 76, False: 0]
  ------------------
  239|     76|                decoder->freectx = OSSL_FUNC_decoder_freectx(fns);
  240|     76|            break;
  241|      0|        case OSSL_FUNC_DECODER_GET_PARAMS:
  ------------------
  |  |  986|      0|#define OSSL_FUNC_DECODER_GET_PARAMS 3
  ------------------
  |  Branch (241:9): [True: 0, False: 522]
  ------------------
  242|      0|            if (decoder->get_params == NULL)
  ------------------
  |  Branch (242:17): [True: 0, False: 0]
  ------------------
  243|      0|                decoder->get_params = OSSL_FUNC_decoder_get_params(fns);
  244|      0|            break;
  245|      0|        case OSSL_FUNC_DECODER_GETTABLE_PARAMS:
  ------------------
  |  |  987|      0|#define OSSL_FUNC_DECODER_GETTABLE_PARAMS 4
  ------------------
  |  Branch (245:9): [True: 0, False: 522]
  ------------------
  246|      0|            if (decoder->gettable_params == NULL)
  ------------------
  |  Branch (246:17): [True: 0, False: 0]
  ------------------
  247|      0|                decoder->gettable_params = OSSL_FUNC_decoder_gettable_params(fns);
  248|      0|            break;
  249|     74|        case OSSL_FUNC_DECODER_SET_CTX_PARAMS:
  ------------------
  |  |  988|     74|#define OSSL_FUNC_DECODER_SET_CTX_PARAMS 5
  ------------------
  |  Branch (249:9): [True: 74, False: 448]
  ------------------
  250|     74|            if (decoder->set_ctx_params == NULL)
  ------------------
  |  Branch (250:17): [True: 74, False: 0]
  ------------------
  251|     74|                decoder->set_ctx_params = OSSL_FUNC_decoder_set_ctx_params(fns);
  252|     74|            break;
  253|     74|        case OSSL_FUNC_DECODER_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  989|     74|#define OSSL_FUNC_DECODER_SETTABLE_CTX_PARAMS 6
  ------------------
  |  Branch (253:9): [True: 74, False: 448]
  ------------------
  254|     74|            if (decoder->settable_ctx_params == NULL)
  ------------------
  |  Branch (254:17): [True: 74, False: 0]
  ------------------
  255|     74|                decoder->settable_ctx_params = OSSL_FUNC_decoder_settable_ctx_params(fns);
  256|     74|            break;
  257|     73|        case OSSL_FUNC_DECODER_DOES_SELECTION:
  ------------------
  |  |  990|     73|#define OSSL_FUNC_DECODER_DOES_SELECTION 10
  ------------------
  |  Branch (257:9): [True: 73, False: 449]
  ------------------
  258|     73|            if (decoder->does_selection == NULL)
  ------------------
  |  Branch (258:17): [True: 73, False: 0]
  ------------------
  259|     73|                decoder->does_selection = OSSL_FUNC_decoder_does_selection(fns);
  260|     73|            break;
  261|     76|        case OSSL_FUNC_DECODER_DECODE:
  ------------------
  |  |  991|     76|#define OSSL_FUNC_DECODER_DECODE 11
  ------------------
  |  Branch (261:9): [True: 76, False: 446]
  ------------------
  262|     76|            if (decoder->decode == NULL)
  ------------------
  |  Branch (262:17): [True: 76, False: 0]
  ------------------
  263|     76|                decoder->decode = OSSL_FUNC_decoder_decode(fns);
  264|     76|            break;
  265|     73|        case OSSL_FUNC_DECODER_EXPORT_OBJECT:
  ------------------
  |  |  992|     73|#define OSSL_FUNC_DECODER_EXPORT_OBJECT 20
  ------------------
  |  Branch (265:9): [True: 73, False: 449]
  ------------------
  266|     73|            if (decoder->export_object == NULL)
  ------------------
  |  Branch (266:17): [True: 73, False: 0]
  ------------------
  267|     73|                decoder->export_object = OSSL_FUNC_decoder_export_object(fns);
  268|     73|            break;
  269|    522|        }
  270|    522|    }
  271|       |    /*
  272|       |     * Try to check that the method is sensible.
  273|       |     * If you have a constructor, you must have a destructor and vice versa.
  274|       |     * You must have at least one of the encoding driver functions.
  275|       |     */
  276|     76|    if (!((decoder->newctx == NULL && decoder->freectx == NULL)
  ------------------
  |  Branch (276:12): [True: 0, False: 76]
  |  Branch (276:39): [True: 0, False: 0]
  ------------------
  277|     76|            || (decoder->newctx != NULL && decoder->freectx != NULL))
  ------------------
  |  Branch (277:17): [True: 76, False: 0]
  |  Branch (277:44): [True: 76, False: 0]
  ------------------
  278|     76|        || decoder->decode == NULL) {
  ------------------
  |  Branch (278:12): [True: 0, False: 76]
  ------------------
  279|      0|        OSSL_DECODER_free(decoder);
  280|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  281|      0|        return NULL;
  282|      0|    }
  283|       |
  284|     76|    if (prov != NULL && !ossl_provider_up_ref(prov)) {
  ------------------
  |  Branch (284:9): [True: 76, False: 0]
  |  Branch (284:25): [True: 0, False: 76]
  ------------------
  285|      0|        OSSL_DECODER_free(decoder);
  286|      0|        return NULL;
  287|      0|    }
  288|       |
  289|     76|    decoder->base.prov = prov;
  290|     76|    return decoder;
  291|     76|}
ossl_decoder_store_cache_flush:
  438|    649|{
  439|    649|    OSSL_METHOD_STORE *store = get_decoder_store(libctx);
  440|       |
  441|    649|    if (store != NULL)
  ------------------
  |  Branch (441:9): [True: 649, False: 0]
  ------------------
  442|    649|        return ossl_method_store_cache_flush_all(store);
  443|      0|    return 1;
  444|    649|}
ossl_decoder_store_remove_all_provided:
  447|    649|{
  448|    649|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  449|    649|    OSSL_METHOD_STORE *store = get_decoder_store(libctx);
  450|       |
  451|    649|    if (store != NULL)
  ------------------
  |  Branch (451:9): [True: 649, False: 0]
  ------------------
  452|    649|        return ossl_method_store_remove_all_provided(store, prov);
  453|      0|    return 1;
  454|    649|}
OSSL_DECODER_get0_provider:
  461|  3.18M|{
  462|  3.18M|    if (!ossl_assert(decoder != NULL)) {
  ------------------
  |  |   52|  3.18M|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  3.18M|    __FILE__, __LINE__)
  ------------------
  |  Branch (462:9): [True: 0, False: 3.18M]
  ------------------
  463|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  464|      0|        return 0;
  465|      0|    }
  466|       |
  467|  3.18M|    return decoder->base.prov;
  468|  3.18M|}
ossl_decoder_parsed_properties:
  482|     22|{
  483|     22|    if (!ossl_assert(decoder != NULL)) {
  ------------------
  |  |   52|     22|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|     22|    __FILE__, __LINE__)
  ------------------
  |  Branch (483:9): [True: 0, False: 22]
  ------------------
  484|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  485|      0|        return 0;
  486|      0|    }
  487|       |
  488|     22|    return decoder->base.parsed_propdef;
  489|     22|}
ossl_decoder_get_number:
  492|  1.12M|{
  493|  1.12M|    if (!ossl_assert(decoder != NULL)) {
  ------------------
  |  |   52|  1.12M|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  1.12M|    __FILE__, __LINE__)
  ------------------
  |  Branch (493:9): [True: 0, False: 1.12M]
  ------------------
  494|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  495|      0|        return 0;
  496|      0|    }
  497|       |
  498|  1.12M|    return decoder->base.id;
  499|  1.12M|}
OSSL_DECODER_is_a:
  512|  1.12M|{
  513|  1.12M|    if (decoder->base.prov != NULL) {
  ------------------
  |  Branch (513:9): [True: 1.12M, False: 0]
  ------------------
  514|  1.12M|        OSSL_LIB_CTX *libctx = ossl_provider_libctx(decoder->base.prov);
  515|  1.12M|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  516|       |
  517|  1.12M|        return ossl_namemap_name2num(namemap, name) == decoder->base.id;
  518|  1.12M|    }
  519|      0|    return 0;
  520|  1.12M|}
ossl_decoder_fast_is_a:
  531|  1.12M|{
  532|  1.12M|    int id = *id_cache;
  533|       |
  534|  1.12M|    if (id <= 0)
  ------------------
  |  Branch (534:9): [True: 1.12M, False: 1.35k]
  ------------------
  535|  1.12M|        *id_cache = id = resolve_name(decoder, name);
  536|       |
  537|  1.12M|    return id > 0 && ossl_decoder_get_number(decoder) == id;
  ------------------
  |  Branch (537:12): [True: 1.12M, False: 311]
  |  Branch (537:22): [True: 1.12M, False: 1.31k]
  ------------------
  538|  1.12M|}
OSSL_DECODER_do_all_provided:
  556|      4|{
  557|      4|    struct decoder_data_st methdata;
  558|      4|    struct do_one_data_st data;
  559|       |
  560|      4|    methdata.libctx = libctx;
  561|      4|    methdata.tmp_store = NULL;
  562|      4|    (void)inner_ossl_decoder_fetch(&methdata, NULL, NULL /* properties */);
  563|       |
  564|      4|    data.user_fn = user_fn;
  565|      4|    data.user_arg = user_arg;
  566|      4|    if (methdata.tmp_store != NULL)
  ------------------
  |  Branch (566:9): [True: 0, False: 4]
  ------------------
  567|      0|        ossl_method_store_do_all(methdata.tmp_store, &do_one, &data);
  568|      4|    ossl_method_store_do_all(get_decoder_store(libctx), &do_one, &data);
  569|      4|    dealloc_tmp_decoder_store(methdata.tmp_store);
  570|      4|}
OSSL_DECODER_CTX_new:
  629|   412k|{
  630|   412k|    OSSL_DECODER_CTX *ctx;
  631|       |
  632|   412k|    ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  108|   412k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  633|   412k|    return ctx;
  634|   412k|}
OSSL_DECODER_CTX_free:
  666|   824k|{
  667|   824k|    if (ctx != NULL) {
  ------------------
  |  Branch (667:9): [True: 412k, False: 412k]
  ------------------
  668|   412k|        if (ctx->cleanup != NULL)
  ------------------
  |  Branch (668:13): [True: 412k, False: 0]
  ------------------
  669|   412k|            ctx->cleanup(ctx->construct_data);
  670|   412k|        sk_OSSL_DECODER_INSTANCE_pop_free(ctx->decoder_insts,
  671|   412k|            ossl_decoder_instance_free);
  672|   412k|        ossl_pw_clear_passphrase_data(&ctx->pwdata);
  673|   412k|        OPENSSL_free(ctx);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  674|   412k|    }
  675|   824k|}
decoder_meth.c:ossl_decoder_new:
   39|     76|{
   40|     76|    OSSL_DECODER *decoder = NULL;
   41|       |
   42|     76|    if ((decoder = OPENSSL_zalloc(sizeof(*decoder))) == NULL)
  ------------------
  |  |  108|     76|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (42:9): [True: 0, False: 76]
  ------------------
   43|      0|        return NULL;
   44|     76|    if (!CRYPTO_NEW_REF(&decoder->base.refcnt, 1)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 76]
  ------------------
   45|      0|        OSSL_DECODER_free(decoder);
   46|      0|        return NULL;
   47|      0|    }
   48|       |
   49|     76|    return decoder;
   50|     76|}
decoder_meth.c:inner_ossl_decoder_fetch:
  348|      4|{
  349|      4|    OSSL_METHOD_STORE *store = get_decoder_store(methdata->libctx);
  350|      4|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  351|      4|    const char *const propq = properties != NULL ? properties : "";
  ------------------
  |  Branch (351:31): [True: 0, False: 4]
  ------------------
  352|      4|    void *method = NULL;
  353|      4|    int unsupported, id;
  354|       |
  355|      4|    if (store == NULL || namemap == NULL) {
  ------------------
  |  Branch (355:9): [True: 0, False: 4]
  |  Branch (355:26): [True: 0, False: 4]
  ------------------
  356|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  357|      0|        return NULL;
  358|      0|    }
  359|       |
  360|      4|    id = name != NULL ? ossl_namemap_name2num(namemap, name) : 0;
  ------------------
  |  Branch (360:10): [True: 0, False: 4]
  ------------------
  361|       |
  362|       |    /*
  363|       |     * If we haven't found the name yet, chances are that the algorithm to
  364|       |     * be fetched is unsupported.
  365|       |     */
  366|      4|    unsupported = id == 0;
  367|       |
  368|      4|    if (id == 0
  ------------------
  |  Branch (368:9): [True: 4, False: 0]
  ------------------
  369|      4|        || !ossl_method_store_cache_get(store, NULL, id, propq, &method)) {
  ------------------
  |  Branch (369:12): [True: 0, False: 0]
  ------------------
  370|      4|        OSSL_METHOD_CONSTRUCT_METHOD mcm = {
  371|      4|            get_tmp_decoder_store,
  372|      4|            reserve_decoder_store,
  373|      4|            unreserve_decoder_store,
  374|      4|            get_decoder_from_store,
  375|      4|            put_decoder_in_store,
  376|      4|            construct_decoder,
  377|      4|            destruct_decoder
  378|      4|        };
  379|      4|        OSSL_PROVIDER *prov = NULL;
  380|       |
  381|      4|        methdata->id = id;
  382|      4|        methdata->names = name;
  383|      4|        methdata->propquery = propq;
  384|      4|        methdata->flag_construct_error_occurred = 0;
  385|      4|        if ((method = ossl_method_construct(methdata->libctx, OSSL_OP_DECODER,
  ------------------
  |  |  296|      4|#define OSSL_OP_DECODER 21
  ------------------
  |  Branch (385:13): [True: 0, False: 4]
  ------------------
  386|      4|                 &prov, 0 /* !force_cache */,
  387|      4|                 &mcm, methdata))
  388|      4|            != NULL) {
  389|       |            /*
  390|       |             * If construction did create a method for us, we know that
  391|       |             * there is a correct name_id and meth_id, since those have
  392|       |             * already been calculated in get_decoder_from_store() and
  393|       |             * put_decoder_in_store() above.
  394|       |             */
  395|      0|            if (id == 0 && name != NULL)
  ------------------
  |  Branch (395:17): [True: 0, False: 0]
  |  Branch (395:28): [True: 0, False: 0]
  ------------------
  396|      0|                id = ossl_namemap_name2num(namemap, name);
  397|      0|            if (id != 0)
  ------------------
  |  Branch (397:17): [True: 0, False: 0]
  ------------------
  398|      0|                ossl_method_store_cache_set(store, prov, id, propq, method,
  399|      0|                    up_ref_decoder, free_decoder);
  400|      0|        }
  401|       |
  402|       |        /*
  403|       |         * If we never were in the constructor, the algorithm to be fetched
  404|       |         * is unsupported.
  405|       |         */
  406|      4|        unsupported = !methdata->flag_construct_error_occurred;
  407|      4|    }
  408|       |
  409|      4|    if ((id != 0 || name != NULL) && method == NULL) {
  ------------------
  |  Branch (409:10): [True: 0, False: 4]
  |  Branch (409:21): [True: 0, False: 4]
  |  Branch (409:38): [True: 0, False: 0]
  ------------------
  410|      0|        int code = unsupported ? ERR_R_UNSUPPORTED : ERR_R_FETCH_FAILED;
  ------------------
  |  |  364|      0|#define ERR_R_UNSUPPORTED (268 | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      int code = unsupported ? ERR_R_UNSUPPORTED : ERR_R_FETCH_FAILED;
  ------------------
  |  |  365|      0|#define ERR_R_FETCH_FAILED (269 | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (410:20): [True: 0, False: 0]
  ------------------
  411|       |
  412|      0|        if (name == NULL)
  ------------------
  |  Branch (412:13): [True: 0, False: 0]
  ------------------
  413|      0|            name = ossl_namemap_num2name(namemap, id, 0);
  414|      0|        ERR_raise_data(ERR_LIB_OSSL_DECODER, code,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_OSSL_DECODER, code,
  ------------------
  |  |  123|      0|#define ERR_LIB_OSSL_DECODER 60
  ------------------
  415|      0|            "%s, Name (%s : %d), Properties (%s)",
  416|      0|            ossl_lib_ctx_get_descriptor(methdata->libctx),
  417|      0|            name == NULL ? "<null>" : name, id,
  ------------------
  |  Branch (417:13): [True: 0, False: 0]
  ------------------
  418|      0|            properties == NULL ? "<null>" : properties);
  ------------------
  |  Branch (418:13): [True: 0, False: 0]
  ------------------
  419|      0|    }
  420|       |
  421|      4|    return method;
  422|      4|}
decoder_meth.c:reserve_decoder_store:
  117|      4|{
  118|      4|    struct decoder_data_st *methdata = data;
  119|       |
  120|      4|    if (store == NULL
  ------------------
  |  Branch (120:9): [True: 4, False: 0]
  ------------------
  121|      4|        && (store = get_decoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (121:12): [True: 0, False: 4]
  ------------------
  122|      0|        return 0;
  123|       |
  124|      4|    return ossl_method_lock_store(store);
  125|      4|}
decoder_meth.c:unreserve_decoder_store:
  128|      4|{
  129|      4|    struct decoder_data_st *methdata = data;
  130|       |
  131|      4|    if (store == NULL
  ------------------
  |  Branch (131:9): [True: 4, False: 0]
  ------------------
  132|      4|        && (store = get_decoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (132:12): [True: 0, False: 4]
  ------------------
  133|      0|        return 0;
  134|       |
  135|      4|    return ossl_method_unlock_store(store);
  136|      4|}
decoder_meth.c:get_decoder_from_store:
  141|      4|{
  142|      4|    struct decoder_data_st *methdata = data;
  143|      4|    void *method = NULL;
  144|      4|    int id;
  145|       |
  146|       |    /*
  147|       |     * get_decoder_from_store() is only called to try and get the method
  148|       |     * that OSSL_DECODER_fetch() is asking for, and the name or name id are
  149|       |     * passed via methdata.
  150|       |     */
  151|      4|    if ((id = methdata->id) == 0 && methdata->names != NULL) {
  ------------------
  |  Branch (151:9): [True: 4, False: 0]
  |  Branch (151:37): [True: 0, False: 4]
  ------------------
  152|      0|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  153|      0|        const char *names = methdata->names;
  154|      0|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   25|      0|#define NAME_SEPARATOR ':'
  ------------------
  155|      0|        size_t l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (155:21): [True: 0, False: 0]
  ------------------
  156|       |
  157|      0|        if (namemap == 0)
  ------------------
  |  Branch (157:13): [True: 0, False: 0]
  ------------------
  158|      0|            return NULL;
  159|      0|        id = ossl_namemap_name2num_n(namemap, names, l);
  160|      0|    }
  161|       |
  162|      4|    if (id == 0)
  ------------------
  |  Branch (162:9): [True: 4, False: 0]
  ------------------
  163|      4|        return NULL;
  164|       |
  165|      0|    if (store == NULL
  ------------------
  |  Branch (165:9): [True: 0, False: 0]
  ------------------
  166|      0|        && (store = get_decoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (166:12): [True: 0, False: 0]
  ------------------
  167|      0|        return NULL;
  168|       |
  169|      0|    if (!ossl_method_store_fetch(store, id, methdata->propquery, prov, &method))
  ------------------
  |  Branch (169:9): [True: 0, False: 0]
  ------------------
  170|      0|        return NULL;
  171|      0|    return method;
  172|      0|}
decoder_meth.c:put_decoder_in_store:
  178|     76|{
  179|     76|    struct decoder_data_st *methdata = data;
  180|     76|    OSSL_NAMEMAP *namemap;
  181|     76|    int id;
  182|     76|    size_t l = 0;
  183|       |
  184|       |    /*
  185|       |     * put_decoder_in_store() is only called with an OSSL_DECODER method that
  186|       |     * was successfully created by construct_decoder() below, which means that
  187|       |     * all the names should already be stored in the namemap with the same
  188|       |     * numeric identity, so just use the first to get that identity.
  189|       |     */
  190|     76|    if (names != NULL) {
  ------------------
  |  Branch (190:9): [True: 76, False: 0]
  ------------------
  191|     76|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   25|     76|#define NAME_SEPARATOR ':'
  ------------------
  192|       |
  193|     76|        l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (193:14): [True: 76, False: 0]
  ------------------
  194|     76|    }
  195|       |
  196|     76|    if ((namemap = ossl_namemap_stored(methdata->libctx)) == NULL
  ------------------
  |  Branch (196:9): [True: 0, False: 76]
  ------------------
  197|     76|        || (id = ossl_namemap_name2num_n(namemap, names, l)) == 0)
  ------------------
  |  Branch (197:12): [True: 0, False: 76]
  ------------------
  198|      0|        return 0;
  199|       |
  200|     76|    if (store == NULL && (store = get_decoder_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (200:9): [True: 76, False: 0]
  |  Branch (200:26): [True: 0, False: 76]
  ------------------
  201|      0|        return 0;
  202|       |
  203|     76|    return ossl_method_store_add(store, prov, id, propdef, method,
  204|     76|        ossl_decoder_up_ref,
  205|     76|        ossl_decoder_free);
  206|     76|}
decoder_meth.c:ossl_decoder_up_ref:
   33|     76|{
   34|     76|    return OSSL_DECODER_up_ref(data);
   35|     76|}
decoder_meth.c:ossl_decoder_free:
   28|     76|{
   29|     76|    OSSL_DECODER_free(data);
   30|     76|}
decoder_meth.c:construct_decoder:
  300|     76|{
  301|       |    /*
  302|       |     * This function is only called if get_decoder_from_store() returned
  303|       |     * NULL, so it's safe to say that of all the spots to create a new
  304|       |     * namemap entry, this is it.  Should the name already exist there, we
  305|       |     * know that ossl_namemap_add() will return its corresponding number.
  306|       |     */
  307|     76|    struct decoder_data_st *methdata = data;
  308|     76|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  309|     76|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  310|     76|    const char *names = algodef->algorithm_names;
  311|     76|    int id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR);
  ------------------
  |  |   25|     76|#define NAME_SEPARATOR ':'
  ------------------
  312|     76|    void *method = NULL;
  313|       |
  314|     76|    if (id != 0)
  ------------------
  |  Branch (314:9): [True: 76, False: 0]
  ------------------
  315|     76|        method = ossl_decoder_from_algorithm(id, algodef, prov);
  316|       |
  317|       |    /*
  318|       |     * Flag to indicate that there was actual construction errors.  This
  319|       |     * helps inner_evp_generic_fetch() determine what error it should
  320|       |     * record on inaccessible algorithms.
  321|       |     */
  322|     76|    if (method == NULL)
  ------------------
  |  Branch (322:9): [True: 0, False: 76]
  ------------------
  323|      0|        methdata->flag_construct_error_occurred = 1;
  324|       |
  325|     76|    return method;
  326|     76|}
decoder_meth.c:destruct_decoder:
  330|     76|{
  331|     76|    OSSL_DECODER_free(method);
  332|     76|}
decoder_meth.c:dealloc_tmp_decoder_store:
  105|      4|{
  106|      4|    if (store != NULL)
  ------------------
  |  Branch (106:9): [True: 0, False: 4]
  ------------------
  107|      0|        ossl_method_store_free(store);
  108|      4|}
decoder_meth.c:get_decoder_store:
  112|  1.39k|{
  113|  1.39k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DECODER_STORE_INDEX);
  ------------------
  |  |  109|  1.39k|#define OSSL_LIB_CTX_DECODER_STORE_INDEX 11
  ------------------
  114|  1.39k|}
decoder_meth.c:resolve_name:
  523|  1.12M|{
  524|  1.12M|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(decoder->base.prov);
  525|  1.12M|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  526|       |
  527|  1.12M|    return ossl_namemap_name2num(namemap, name);
  528|  1.12M|}
decoder_meth.c:do_one:
  546|    304|{
  547|    304|    struct do_one_data_st *data = arg;
  548|       |
  549|    304|    data->user_fn(method, data->user_arg);
  550|    304|}

ossl_decoder_cache_new:
  764|    787|{
  765|    787|    DECODER_CACHE *cache = OPENSSL_malloc(sizeof(*cache));
  ------------------
  |  |  106|    787|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  766|       |
  767|    787|    if (cache == NULL)
  ------------------
  |  Branch (767:9): [True: 0, False: 787]
  ------------------
  768|      0|        return NULL;
  769|       |
  770|    787|    cache->lock = CRYPTO_THREAD_lock_new();
  771|    787|    if (cache->lock == NULL) {
  ------------------
  |  Branch (771:9): [True: 0, False: 787]
  ------------------
  772|      0|        OPENSSL_free(cache);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  773|      0|        return NULL;
  774|      0|    }
  775|    787|    cache->hashtable = lh_DECODER_CACHE_ENTRY_new(decoder_cache_entry_hash,
  776|    787|        decoder_cache_entry_cmp);
  777|    787|    if (cache->hashtable == NULL) {
  ------------------
  |  Branch (777:9): [True: 0, False: 787]
  ------------------
  778|      0|        CRYPTO_THREAD_lock_free(cache->lock);
  779|      0|        OPENSSL_free(cache);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  780|      0|        return NULL;
  781|      0|    }
  782|       |
  783|    787|    return cache;
  784|    787|}
ossl_decoder_cache_free:
  787|    787|{
  788|    787|    DECODER_CACHE *cache = (DECODER_CACHE *)vcache;
  789|       |
  790|    787|    lh_DECODER_CACHE_ENTRY_doall(cache->hashtable, decoder_cache_entry_free);
  791|    787|    lh_DECODER_CACHE_ENTRY_free(cache->hashtable);
  792|    787|    CRYPTO_THREAD_lock_free(cache->lock);
  793|    787|    OPENSSL_free(cache);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  794|    787|}
ossl_decoder_cache_flush:
  801|  2.08k|{
  802|  2.08k|    DECODER_CACHE *cache
  803|  2.08k|        = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DECODER_CACHE_INDEX);
  ------------------
  |  |  118|  2.08k|#define OSSL_LIB_CTX_DECODER_CACHE_INDEX 20
  ------------------
  804|       |
  805|  2.08k|    if (cache == NULL)
  ------------------
  |  Branch (805:9): [True: 787, False: 1.29k]
  ------------------
  806|    787|        return 0;
  807|       |
  808|  1.29k|    if (!CRYPTO_THREAD_write_lock(cache->lock)) {
  ------------------
  |  Branch (808:9): [True: 0, False: 1.29k]
  ------------------
  809|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  810|      0|        return 0;
  811|      0|    }
  812|       |
  813|  1.29k|    lh_DECODER_CACHE_ENTRY_doall(cache->hashtable, decoder_cache_entry_free);
  814|  1.29k|    lh_DECODER_CACHE_ENTRY_flush(cache->hashtable);
  815|       |
  816|  1.29k|    CRYPTO_THREAD_unlock(cache->lock);
  817|  1.29k|    return 1;
  818|  1.29k|}
OSSL_DECODER_CTX_new_for_pkey:
  826|   412k|{
  827|   412k|    OSSL_DECODER_CTX *ctx = NULL;
  828|   412k|    OSSL_PARAM decoder_params[] = {
  829|   412k|        OSSL_PARAM_END,
  ------------------
  |  |   25|   412k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  830|   412k|        OSSL_PARAM_END,
  ------------------
  |  |   25|   412k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  831|   412k|        OSSL_PARAM_END
  ------------------
  |  |   25|   412k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  832|   412k|    };
  833|   412k|    DECODER_CACHE *cache
  834|   412k|        = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DECODER_CACHE_INDEX);
  ------------------
  |  |  118|   412k|#define OSSL_LIB_CTX_DECODER_CACHE_INDEX 20
  ------------------
  835|   412k|    DECODER_CACHE_ENTRY cacheent, *res, *newcache = NULL;
  836|   412k|    int i = 0;
  837|       |
  838|   412k|    if (cache == NULL) {
  ------------------
  |  Branch (838:9): [True: 0, False: 412k]
  ------------------
  839|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  840|      0|        return NULL;
  841|      0|    }
  842|   412k|    if (input_structure != NULL)
  ------------------
  |  Branch (842:9): [True: 412k, False: 0]
  ------------------
  843|   412k|        decoder_params[i++] = OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_STRUCTURE,
  ------------------
  |  |  357|   412k|# define OSSL_OBJECT_PARAM_DATA_STRUCTURE "data-structure"
  ------------------
  844|   412k|            (char *)input_structure, 0);
  845|   412k|    if (propquery != NULL)
  ------------------
  |  Branch (845:9): [True: 0, False: 412k]
  ------------------
  846|      0|        decoder_params[i++] = OSSL_PARAM_construct_utf8_string(OSSL_DECODER_PARAM_PROPERTIES,
  ------------------
  |  |  224|      0|# define OSSL_DECODER_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  132|      0|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
  847|      0|            (char *)propquery, 0);
  848|       |
  849|       |    /* It is safe to cast away the const here */
  850|   412k|    cacheent.input_type = (char *)input_type;
  851|   412k|    cacheent.input_structure = (char *)input_structure;
  852|   412k|    cacheent.keytype = (char *)keytype;
  853|   412k|    cacheent.selection = selection;
  854|   412k|    cacheent.propquery = (char *)propquery;
  855|       |
  856|   412k|    if (!CRYPTO_THREAD_read_lock(cache->lock)) {
  ------------------
  |  Branch (856:9): [True: 0, False: 412k]
  ------------------
  857|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  858|      0|        return NULL;
  859|      0|    }
  860|       |
  861|       |    /* First see if we have a template OSSL_DECODER_CTX */
  862|   412k|    res = lh_DECODER_CACHE_ENTRY_retrieve(cache->hashtable, &cacheent);
  863|       |
  864|   412k|    if (res == NULL) {
  ------------------
  |  Branch (864:9): [True: 2, False: 412k]
  ------------------
  865|       |        /*
  866|       |         * There is no template so we will have to construct one. This will be
  867|       |         * time consuming so release the lock and we will later upgrade it to a
  868|       |         * write lock.
  869|       |         */
  870|      2|        CRYPTO_THREAD_unlock(cache->lock);
  871|       |
  872|      2|        if ((ctx = OSSL_DECODER_CTX_new()) == NULL) {
  ------------------
  |  Branch (872:13): [True: 0, False: 2]
  ------------------
  873|      0|            ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  874|      0|            return NULL;
  875|      0|        }
  876|       |
  877|      2|        OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|      2|    do {                           \
  |  |  222|      2|        BIO *trc_out = NULL;       \
  |  |  223|      2|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 2]
  |  |  ------------------
  ------------------
  878|      0|        {
  879|      0|            BIO_printf(trc_out,
  880|      0|                "(ctx %p) Looking for %s decoders with selection %d\n",
  881|      0|                (void *)ctx, keytype, selection);
  882|      0|            BIO_printf(trc_out, "    input type: %s, input structure: %s\n",
  883|      0|                input_type, input_structure);
  884|      0|        }
  885|      2|        OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|      2|    }                            \
  |  |  227|      2|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
  886|       |
  887|      2|        if (OSSL_DECODER_CTX_set_input_type(ctx, input_type)
  ------------------
  |  Branch (887:13): [True: 2, False: 0]
  ------------------
  888|      2|            && OSSL_DECODER_CTX_set_input_structure(ctx, input_structure)
  ------------------
  |  Branch (888:16): [True: 2, False: 0]
  ------------------
  889|      2|            && OSSL_DECODER_CTX_set_selection(ctx, selection)
  ------------------
  |  Branch (889:16): [True: 2, False: 0]
  ------------------
  890|      2|            && ossl_decoder_ctx_setup_for_pkey(ctx, keytype, libctx, propquery)
  ------------------
  |  Branch (890:16): [True: 2, False: 0]
  ------------------
  891|      2|            && OSSL_DECODER_CTX_add_extra(ctx, libctx, propquery)
  ------------------
  |  Branch (891:16): [True: 2, False: 0]
  ------------------
  892|      2|            && (propquery == NULL
  ------------------
  |  Branch (892:17): [True: 2, False: 0]
  ------------------
  893|      2|                || OSSL_DECODER_CTX_set_params(ctx, decoder_params))) {
  ------------------
  |  Branch (893:20): [True: 0, False: 0]
  ------------------
  894|      2|            OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|      2|    do {                           \
  |  |  222|      2|        BIO *trc_out = NULL;       \
  |  |  223|      2|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 2]
  |  |  ------------------
  ------------------
  895|      0|            {
  896|      0|                BIO_printf(trc_out, "(ctx %p) Got %d decoders\n",
  897|      0|                    (void *)ctx, OSSL_DECODER_CTX_get_num_decoders(ctx));
  898|      0|            }
  899|      2|            OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|      2|    }                            \
  |  |  227|      2|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
  900|      2|        } else {
  901|      0|            ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  902|      0|            OSSL_DECODER_CTX_free(ctx);
  903|      0|            return NULL;
  904|      0|        }
  905|       |
  906|      2|        newcache = OPENSSL_zalloc(sizeof(*newcache));
  ------------------
  |  |  108|      2|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  907|      2|        if (newcache == NULL) {
  ------------------
  |  Branch (907:13): [True: 0, False: 2]
  ------------------
  908|      0|            OSSL_DECODER_CTX_free(ctx);
  909|      0|            return NULL;
  910|      0|        }
  911|       |
  912|      2|        if (input_type != NULL) {
  ------------------
  |  Branch (912:13): [True: 2, False: 0]
  ------------------
  913|      2|            newcache->input_type = OPENSSL_strdup(input_type);
  ------------------
  |  |  135|      2|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  914|      2|            if (newcache->input_type == NULL)
  ------------------
  |  Branch (914:17): [True: 0, False: 2]
  ------------------
  915|      0|                goto err;
  916|      2|        }
  917|      2|        if (input_structure != NULL) {
  ------------------
  |  Branch (917:13): [True: 2, False: 0]
  ------------------
  918|      2|            newcache->input_structure = OPENSSL_strdup(input_structure);
  ------------------
  |  |  135|      2|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  919|      2|            if (newcache->input_structure == NULL)
  ------------------
  |  Branch (919:17): [True: 0, False: 2]
  ------------------
  920|      0|                goto err;
  921|      2|        }
  922|      2|        if (keytype != NULL) {
  ------------------
  |  Branch (922:13): [True: 2, False: 0]
  ------------------
  923|      2|            newcache->keytype = OPENSSL_strdup(keytype);
  ------------------
  |  |  135|      2|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  924|      2|            if (newcache->keytype == NULL)
  ------------------
  |  Branch (924:17): [True: 0, False: 2]
  ------------------
  925|      0|                goto err;
  926|      2|        }
  927|      2|        if (propquery != NULL) {
  ------------------
  |  Branch (927:13): [True: 0, False: 2]
  ------------------
  928|      0|            newcache->propquery = OPENSSL_strdup(propquery);
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  929|      0|            if (newcache->propquery == NULL)
  ------------------
  |  Branch (929:17): [True: 0, False: 0]
  ------------------
  930|      0|                goto err;
  931|      0|        }
  932|      2|        newcache->selection = selection;
  933|      2|        newcache->template = ctx;
  934|       |
  935|      2|        if (!CRYPTO_THREAD_write_lock(cache->lock)) {
  ------------------
  |  Branch (935:13): [True: 0, False: 2]
  ------------------
  936|      0|            ctx = NULL;
  937|      0|            ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  938|      0|            goto err;
  939|      0|        }
  940|      2|        res = lh_DECODER_CACHE_ENTRY_retrieve(cache->hashtable, &cacheent);
  941|      2|        if (res == NULL) {
  ------------------
  |  Branch (941:13): [True: 2, False: 0]
  ------------------
  942|      2|            (void)lh_DECODER_CACHE_ENTRY_insert(cache->hashtable, newcache);
  943|      2|            if (lh_DECODER_CACHE_ENTRY_error(cache->hashtable)) {
  ------------------
  |  Branch (943:17): [True: 0, False: 2]
  ------------------
  944|      0|                ctx = NULL;
  945|      0|                CRYPTO_THREAD_unlock(cache->lock);
  946|      0|                ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  947|      0|                goto err;
  948|      0|            }
  949|      2|        } else {
  950|       |            /*
  951|       |             * We raced with another thread to construct this and lost. Free
  952|       |             * what we just created and use the entry from the hashtable instead
  953|       |             */
  954|      0|            decoder_cache_entry_free(newcache);
  955|      0|            ctx = res->template;
  956|      0|        }
  957|   412k|    } else {
  958|   412k|        ctx = res->template;
  959|   412k|    }
  960|       |
  961|   412k|    ctx = ossl_decoder_ctx_for_pkey_dup(ctx, pkey, input_type, input_structure);
  962|   412k|    CRYPTO_THREAD_unlock(cache->lock);
  963|       |
  964|   412k|    return ctx;
  965|      0|err:
  966|      0|    decoder_cache_entry_free(newcache);
  967|      0|    OSSL_DECODER_CTX_free(ctx);
  968|       |    return NULL;
  969|   412k|}
decoder_pkey.c:decoder_cache_entry_hash:
  694|   412k|{
  695|   412k|    unsigned long hash = 17;
  696|       |
  697|   412k|    hash = (hash * 23)
  698|   412k|        + (cache->propquery == NULL
  ------------------
  |  Branch (698:12): [True: 412k, False: 0]
  ------------------
  699|   412k|                ? 0
  700|   412k|                : ossl_lh_strcasehash(cache->propquery));
  701|   412k|    hash = (hash * 23)
  702|   412k|        + (cache->input_structure == NULL
  ------------------
  |  Branch (702:12): [True: 0, False: 412k]
  ------------------
  703|   412k|                ? 0
  704|   412k|                : ossl_lh_strcasehash(cache->input_structure));
  705|   412k|    hash = (hash * 23)
  706|   412k|        + (cache->input_type == NULL
  ------------------
  |  Branch (706:12): [True: 0, False: 412k]
  ------------------
  707|   412k|                ? 0
  708|   412k|                : ossl_lh_strcasehash(cache->input_type));
  709|   412k|    hash = (hash * 23)
  710|   412k|        + (cache->keytype == NULL
  ------------------
  |  Branch (710:12): [True: 0, False: 412k]
  ------------------
  711|   412k|                ? 0
  712|   412k|                : ossl_lh_strcasehash(cache->keytype));
  713|       |
  714|   412k|    hash ^= cache->selection;
  715|       |
  716|   412k|    return hash;
  717|   412k|}
decoder_pkey.c:decoder_cache_entry_cmp:
  740|   412k|{
  741|   412k|    int cmp;
  742|       |
  743|   412k|    if (a->selection != b->selection)
  ------------------
  |  Branch (743:9): [True: 0, False: 412k]
  ------------------
  744|      0|        return (a->selection < b->selection) ? -1 : 1;
  ------------------
  |  Branch (744:16): [True: 0, False: 0]
  ------------------
  745|       |
  746|   412k|    cmp = nullstrcmp(a->keytype, b->keytype, 1);
  747|   412k|    if (cmp != 0)
  ------------------
  |  Branch (747:9): [True: 0, False: 412k]
  ------------------
  748|      0|        return cmp;
  749|       |
  750|   412k|    cmp = nullstrcmp(a->input_type, b->input_type, 1);
  751|   412k|    if (cmp != 0)
  ------------------
  |  Branch (751:9): [True: 0, False: 412k]
  ------------------
  752|      0|        return cmp;
  753|       |
  754|   412k|    cmp = nullstrcmp(a->input_structure, b->input_structure, 1);
  755|   412k|    if (cmp != 0)
  ------------------
  |  Branch (755:9): [True: 0, False: 412k]
  ------------------
  756|      0|        return cmp;
  757|       |
  758|   412k|    cmp = nullstrcmp(a->propquery, b->propquery, 0);
  759|       |
  760|   412k|    return cmp;
  761|   412k|}
decoder_pkey.c:nullstrcmp:
  720|  1.64M|{
  721|  1.64M|    if (a == NULL || b == NULL) {
  ------------------
  |  Branch (721:9): [True: 412k, False: 1.23M]
  |  Branch (721:22): [True: 0, False: 1.23M]
  ------------------
  722|   412k|        if (a == NULL) {
  ------------------
  |  Branch (722:13): [True: 412k, False: 0]
  ------------------
  723|   412k|            if (b == NULL)
  ------------------
  |  Branch (723:17): [True: 412k, False: 0]
  ------------------
  724|   412k|                return 0;
  725|      0|            else
  726|      0|                return 1;
  727|   412k|        } else {
  728|      0|            return -1;
  729|      0|        }
  730|  1.23M|    } else {
  731|  1.23M|        if (casecmp)
  ------------------
  |  Branch (731:13): [True: 1.23M, False: 0]
  ------------------
  732|  1.23M|            return OPENSSL_strcasecmp(a, b);
  733|      0|        else
  734|      0|            return strcmp(a, b);
  735|  1.23M|    }
  736|  1.64M|}
decoder_pkey.c:decoder_cache_entry_free:
  682|      2|{
  683|      2|    if (entry == NULL)
  ------------------
  |  Branch (683:9): [True: 0, False: 2]
  ------------------
  684|      0|        return;
  685|      2|    OPENSSL_free(entry->input_type);
  ------------------
  |  |  131|      2|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  686|      2|    OPENSSL_free(entry->input_structure);
  ------------------
  |  |  131|      2|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  687|      2|    OPENSSL_free(entry->keytype);
  ------------------
  |  |  131|      2|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  688|      2|    OPENSSL_free(entry->propquery);
  ------------------
  |  |  131|      2|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  689|      2|    OSSL_DECODER_CTX_free(entry->template);
  690|      2|    OPENSSL_free(entry);
  ------------------
  |  |  131|      2|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  691|      2|}
decoder_pkey.c:ossl_decoder_ctx_setup_for_pkey:
  435|      2|{
  436|      2|    int ok = 0;
  437|      2|    struct decoder_pkey_data_st *process_data = NULL;
  438|      2|    struct collect_data_st collect_data = { NULL };
  439|      2|    STACK_OF(EVP_KEYMGMT) *keymgmts = NULL;
  ------------------
  |  |   33|      2|#define STACK_OF(type) struct stack_st_##type
  ------------------
  440|      2|    OSSL_PROPERTY_LIST **plp;
  441|      2|    OSSL_PROPERTY_LIST *pq = NULL, *p2 = NULL;
  442|       |
  443|      2|    OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|      2|    do {                           \
  |  |  222|      2|        BIO *trc_out = NULL;       \
  |  |  223|      2|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 2]
  |  |  ------------------
  ------------------
  444|      0|    {
  445|      0|        const char *input_type = ctx->start_input_type;
  446|      0|        const char *input_structure = ctx->input_structure;
  447|       |
  448|      0|        BIO_printf(trc_out,
  449|      0|            "(ctx %p) Looking for decoders producing %s%s%s%s%s%s\n",
  450|      0|            (void *)ctx,
  451|      0|            keytype != NULL ? keytype : "",
  ------------------
  |  Branch (451:13): [True: 0, False: 0]
  ------------------
  452|      0|            keytype != NULL ? " keys" : "keys of any type",
  ------------------
  |  Branch (452:13): [True: 0, False: 0]
  ------------------
  453|      0|            input_type != NULL ? " from " : "",
  ------------------
  |  Branch (453:13): [True: 0, False: 0]
  ------------------
  454|      0|            input_type != NULL ? input_type : "",
  ------------------
  |  Branch (454:13): [True: 0, False: 0]
  ------------------
  455|      0|            input_structure != NULL ? " with " : "",
  ------------------
  |  Branch (455:13): [True: 0, False: 0]
  ------------------
  456|      0|            input_structure != NULL ? input_structure : "");
  ------------------
  |  Branch (456:13): [True: 0, False: 0]
  ------------------
  457|      0|    }
  458|      2|    OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|      2|    }                            \
  |  |  227|      2|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
  459|       |
  460|       |    /* Allocate data. */
  461|      2|    if ((process_data = OPENSSL_zalloc(sizeof(*process_data))) == NULL)
  ------------------
  |  |  108|      2|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (461:9): [True: 0, False: 2]
  ------------------
  462|      0|        goto err;
  463|      2|    if ((propquery != NULL
  ------------------
  |  Branch (463:10): [True: 0, False: 2]
  ------------------
  464|      0|            && (process_data->propq = OPENSSL_strdup(propquery)) == NULL))
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (464:16): [True: 0, False: 0]
  ------------------
  465|      0|        goto err;
  466|       |
  467|       |    /* Allocate our list of EVP_KEYMGMTs. */
  468|      2|    keymgmts = sk_EVP_KEYMGMT_new_null();
  469|      2|    if (keymgmts == NULL) {
  ------------------
  |  Branch (469:9): [True: 0, False: 2]
  ------------------
  470|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  471|      0|        goto err;
  472|      0|    }
  473|       |
  474|      2|    process_data->object = NULL;
  475|      2|    process_data->libctx = libctx;
  476|      2|    process_data->selection = ctx->selection;
  477|      2|    process_data->keymgmts = keymgmts;
  478|       |
  479|       |    /*
  480|       |     * Collect passed and default properties to prioritize the decoders.
  481|       |     */
  482|      2|    if (propquery != NULL)
  ------------------
  |  Branch (482:9): [True: 0, False: 2]
  ------------------
  483|      0|        p2 = pq = ossl_parse_query(libctx, propquery, 1);
  484|       |
  485|      2|    plp = ossl_ctx_global_properties(libctx, 0);
  486|      2|    if (plp != NULL && *plp != NULL) {
  ------------------
  |  Branch (486:9): [True: 2, False: 0]
  |  Branch (486:24): [True: 0, False: 2]
  ------------------
  487|      0|        if (pq == NULL) {
  ------------------
  |  Branch (487:13): [True: 0, False: 0]
  ------------------
  488|      0|            pq = *plp;
  489|      0|        } else {
  490|      0|            p2 = ossl_property_merge(pq, *plp);
  491|      0|            ossl_property_free(pq);
  492|      0|            if (p2 == NULL)
  ------------------
  |  Branch (492:17): [True: 0, False: 0]
  ------------------
  493|      0|                goto err;
  494|      0|            pq = p2;
  495|      0|        }
  496|      0|    }
  497|       |
  498|       |    /*
  499|       |     * Enumerate all keymgmts into a stack.
  500|       |     *
  501|       |     * We could nest EVP_KEYMGMT_do_all_provided inside
  502|       |     * OSSL_DECODER_do_all_provided or vice versa but these functions become
  503|       |     * bottlenecks if called repeatedly, which is why we collect the
  504|       |     * EVP_KEYMGMTs into a stack here and call both functions only once.
  505|       |     *
  506|       |     * We resolve the keytype string to a name ID so we don't have to resolve it
  507|       |     * multiple times, avoiding repeated calls to EVP_KEYMGMT_is_a, which is a
  508|       |     * performance bottleneck. However, we do this lazily on the first call to
  509|       |     * collect_keymgmt made by EVP_KEYMGMT_do_all_provided, rather than do it
  510|       |     * upfront, as this ensures that the names for all loaded providers have
  511|       |     * been registered by the time we try to resolve the keytype string.
  512|       |     */
  513|      2|    collect_data.ctx = ctx;
  514|      2|    collect_data.libctx = libctx;
  515|      2|    collect_data.keymgmts = keymgmts;
  516|      2|    collect_data.keytype = keytype;
  517|      2|    collect_data.pq = pq;
  518|      2|    EVP_KEYMGMT_do_all_provided(libctx, collect_keymgmt, &collect_data);
  519|       |
  520|      2|    if (collect_data.error_occurred)
  ------------------
  |  Branch (520:9): [True: 0, False: 2]
  ------------------
  521|      0|        goto err;
  522|       |
  523|       |    /* Enumerate all matching decoders. */
  524|      2|    OSSL_DECODER_do_all_provided(libctx, collect_decoder, &collect_data);
  525|       |
  526|      2|    if (collect_data.error_occurred)
  ------------------
  |  Branch (526:9): [True: 0, False: 2]
  ------------------
  527|      0|        goto err;
  528|       |
  529|      2|    OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|      2|    do {                           \
  |  |  222|      2|        BIO *trc_out = NULL;       \
  |  |  223|      2|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 2]
  |  |  ------------------
  ------------------
  530|      0|    {
  531|      0|        BIO_printf(trc_out,
  532|      0|            "(ctx %p) Got %d decoders producing keys\n",
  533|      0|            (void *)ctx, collect_data.total);
  534|      0|    }
  535|      2|    OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|      2|    }                            \
  |  |  227|      2|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
  536|       |
  537|       |    /*
  538|       |     * Finish initializing the decoder context. If one or more decoders matched
  539|       |     * above then the number of decoders attached to the OSSL_DECODER_CTX will
  540|       |     * be nonzero. Else nothing was found and we do nothing.
  541|       |     */
  542|      2|    if (OSSL_DECODER_CTX_get_num_decoders(ctx) != 0) {
  ------------------
  |  Branch (542:9): [True: 2, False: 0]
  ------------------
  543|      2|        if (!OSSL_DECODER_CTX_set_construct(ctx, decoder_construct_pkey)
  ------------------
  |  Branch (543:13): [True: 0, False: 2]
  ------------------
  544|      2|            || !OSSL_DECODER_CTX_set_construct_data(ctx, process_data)
  ------------------
  |  Branch (544:16): [True: 0, False: 2]
  ------------------
  545|      2|            || !OSSL_DECODER_CTX_set_cleanup(ctx,
  ------------------
  |  Branch (545:16): [True: 0, False: 2]
  ------------------
  546|      2|                decoder_clean_pkey_construct_arg))
  547|      0|            goto err;
  548|       |
  549|      2|        process_data = NULL; /* Avoid it being freed */
  550|      2|    }
  551|       |
  552|      2|    ok = 1;
  553|      2|err:
  554|      2|    decoder_clean_pkey_construct_arg(process_data);
  555|      2|    ossl_property_free(p2);
  556|      2|    return ok;
  557|      2|}
decoder_pkey.c:collect_keymgmt:
  404|     80|{
  405|     80|    struct collect_data_st *data = arg;
  406|       |
  407|     80|    if (!check_keymgmt(keymgmt, data))
  ------------------
  |  Branch (407:9): [True: 77, False: 3]
  ------------------
  408|     77|        return;
  409|       |
  410|       |    /*
  411|       |     * We have to ref EVP_KEYMGMT here because in the success case,
  412|       |     * data->keymgmts is referenced by the constructor we register in the
  413|       |     * OSSL_DECODER_CTX. The registered cleanup function
  414|       |     * (decoder_clean_pkey_construct_arg) unrefs every element of the stack and
  415|       |     * frees it.
  416|       |     */
  417|      3|    if (!EVP_KEYMGMT_up_ref(keymgmt))
  ------------------
  |  Branch (417:9): [True: 0, False: 3]
  ------------------
  418|      0|        return;
  419|       |
  420|      3|    if (sk_EVP_KEYMGMT_push(data->keymgmts, keymgmt) <= 0) {
  ------------------
  |  Branch (420:9): [True: 0, False: 3]
  ------------------
  421|      0|        EVP_KEYMGMT_free(keymgmt);
  422|      0|        data->error_occurred = 1;
  423|      0|    }
  424|      3|}
decoder_pkey.c:check_keymgmt:
  365|     80|{
  366|       |    /* If no keytype was specified, everything matches. */
  367|     80|    if (data->keytype == NULL)
  ------------------
  |  Branch (367:9): [True: 0, False: 80]
  ------------------
  368|      0|        return 1;
  369|       |
  370|     80|    if (!data->keytype_resolved) {
  ------------------
  |  Branch (370:9): [True: 2, False: 78]
  ------------------
  371|       |        /* We haven't cached the IDs from the keytype string yet. */
  372|      2|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(data->libctx);
  373|      2|        data->keytype_id = ossl_namemap_name2num(namemap, data->keytype);
  374|       |
  375|       |        /*
  376|       |         * If keytype is a value ambiguously used for both EC and SM2,
  377|       |         * collect the ID for SM2 as well.
  378|       |         */
  379|      2|        if (data->keytype_id != 0
  ------------------
  |  Branch (379:13): [True: 2, False: 0]
  ------------------
  380|      2|            && (strcmp(data->keytype, "id-ecPublicKey") == 0
  ------------------
  |  Branch (380:17): [True: 1, False: 1]
  ------------------
  381|      1|                || strcmp(data->keytype, "1.2.840.10045.2.1") == 0))
  ------------------
  |  Branch (381:20): [True: 0, False: 1]
  ------------------
  382|      1|            data->sm2_id = ossl_namemap_name2num(namemap, "SM2");
  383|       |
  384|       |        /*
  385|       |         * If keytype_id is zero the name was not found, but we still
  386|       |         * set keytype_resolved to avoid trying all this again.
  387|       |         */
  388|      2|        data->keytype_resolved = 1;
  389|      2|    }
  390|       |
  391|       |    /* Specified keytype could not be resolved, so nothing matches. */
  392|     80|    if (data->keytype_id == 0)
  ------------------
  |  Branch (392:9): [True: 0, False: 80]
  ------------------
  393|      0|        return 0;
  394|       |
  395|       |    /* Does not match the keytype specified, so skip. */
  396|     80|    if (keymgmt->name_id != data->keytype_id
  ------------------
  |  Branch (396:9): [True: 78, False: 2]
  ------------------
  397|     78|        && keymgmt->name_id != data->sm2_id)
  ------------------
  |  Branch (397:12): [True: 77, False: 1]
  ------------------
  398|     77|        return 0;
  399|       |
  400|      3|    return 1;
  401|     80|}
decoder_pkey.c:collect_decoder:
  314|    152|{
  315|    152|    struct collect_data_st *data = arg;
  316|    152|    STACK_OF(EVP_KEYMGMT) *keymgmts = data->keymgmts;
  ------------------
  |  |   33|    152|#define STACK_OF(type) struct stack_st_##type
  ------------------
  317|    152|    int i, end_i;
  318|    152|    EVP_KEYMGMT *keymgmt;
  319|    152|    const OSSL_PROVIDER *prov;
  320|    152|    void *provctx;
  321|       |
  322|    152|    if (data->error_occurred)
  ------------------
  |  Branch (322:9): [True: 0, False: 152]
  ------------------
  323|      0|        return;
  324|       |
  325|    152|    prov = OSSL_DECODER_get0_provider(decoder);
  326|    152|    provctx = OSSL_PROVIDER_get0_provider_ctx(prov);
  327|       |
  328|       |    /*
  329|       |     * Either the caller didn't give us a selection, or if they did, the decoder
  330|       |     * must tell us if it supports that selection to be accepted. If the decoder
  331|       |     * doesn't have |does_selection|, it's seen as taking anything.
  332|       |     */
  333|    152|    if (decoder->does_selection != NULL
  ------------------
  |  Branch (333:9): [True: 146, False: 6]
  ------------------
  334|    146|        && !decoder->does_selection(provctx, data->ctx->selection))
  ------------------
  |  Branch (334:12): [True: 76, False: 70]
  ------------------
  335|     76|        return;
  336|       |
  337|     76|    OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|     76|    do {                           \
  |  |  222|     76|        BIO *trc_out = NULL;       \
  |  |  223|     76|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 76]
  |  |  ------------------
  ------------------
  338|      0|    {
  339|      0|        BIO_printf(trc_out,
  340|      0|            "(ctx %p) Checking out decoder %p:\n"
  341|      0|            "    %s with %s\n",
  342|      0|            (void *)data->ctx, (void *)decoder,
  343|      0|            OSSL_DECODER_get0_name(decoder),
  344|      0|            OSSL_DECODER_get0_properties(decoder));
  345|      0|    }
  346|     76|    OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|     76|    }                            \
  |  |  227|     76|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 76]
  |  |  ------------------
  ------------------
  347|       |
  348|     76|    end_i = sk_EVP_KEYMGMT_num(keymgmts);
  349|    184|    for (i = 0; i < end_i; ++i) {
  ------------------
  |  Branch (349:17): [True: 113, False: 71]
  ------------------
  350|    113|        keymgmt = sk_EVP_KEYMGMT_value(keymgmts, i);
  351|       |
  352|       |        /* Only add this decoder once */
  353|    113|        if (collect_decoder_keymgmt(keymgmt, decoder, provctx, data))
  ------------------
  |  Branch (353:13): [True: 5, False: 108]
  ------------------
  354|      5|            break;
  355|    108|        if (data->error_occurred)
  ------------------
  |  Branch (355:13): [True: 0, False: 108]
  ------------------
  356|      0|            return;
  357|    108|    }
  358|     76|}
decoder_pkey.c:collect_decoder_keymgmt:
  237|    113|{
  238|    113|    void *decoderctx = NULL;
  239|    113|    OSSL_DECODER_INSTANCE *di = NULL;
  240|    113|    const OSSL_PROPERTY_LIST *props;
  241|       |
  242|       |    /*
  243|       |     * We already checked the EVP_KEYMGMT is applicable in check_keymgmt so we
  244|       |     * don't check it again here.
  245|       |     */
  246|       |
  247|    113|    if (keymgmt->name_id != decoder->base.id)
  ------------------
  |  Branch (247:9): [True: 107, False: 6]
  ------------------
  248|       |        /* Mismatch is not an error, continue. */
  249|    107|        return 0;
  250|       |
  251|      6|    if ((decoderctx = decoder->newctx(provctx)) == NULL) {
  ------------------
  |  Branch (251:9): [True: 0, False: 6]
  ------------------
  252|      0|        data->error_occurred = 1;
  253|      0|        return 0;
  254|      0|    }
  255|       |
  256|      6|    if ((di = ossl_decoder_instance_new(decoder, decoderctx)) == NULL) {
  ------------------
  |  Branch (256:9): [True: 0, False: 6]
  ------------------
  257|      0|        decoder->freectx(decoderctx);
  258|      0|        data->error_occurred = 1;
  259|      0|        return 0;
  260|      0|    }
  261|       |
  262|       |    /*
  263|       |     * Input types must be compatible, but we must accept DER encoders when the
  264|       |     * start input type is "PEM".
  265|       |     */
  266|      6|    if (data->ctx->start_input_type != NULL
  ------------------
  |  Branch (266:9): [True: 6, False: 0]
  ------------------
  267|      6|        && di->input_type != NULL
  ------------------
  |  Branch (267:12): [True: 6, False: 0]
  ------------------
  268|      6|        && OPENSSL_strcasecmp(di->input_type, data->ctx->start_input_type) != 0
  ------------------
  |  Branch (268:12): [True: 1, False: 5]
  ------------------
  269|      1|        && (OPENSSL_strcasecmp(di->input_type, "DER") != 0
  ------------------
  |  Branch (269:13): [True: 1, False: 0]
  ------------------
  270|      1|            || OPENSSL_strcasecmp(data->ctx->start_input_type, "PEM") != 0)) {
  ------------------
  |  Branch (270:16): [True: 0, False: 0]
  ------------------
  271|       |        /* Mismatch is not an error, continue. */
  272|      1|        ossl_decoder_instance_free(di);
  273|      1|        return 0;
  274|      1|    }
  275|       |
  276|      5|    OSSL_TRACE_BEGIN(DECODER)
  ------------------
  |  |  221|      5|    do {                           \
  |  |  222|      5|        BIO *trc_out = NULL;       \
  |  |  223|      5|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 5]
  |  |  ------------------
  ------------------
  277|      0|    {
  278|      0|        BIO_printf(trc_out,
  279|      0|            "(ctx %p) Checking out decoder %p:\n"
  280|      0|            "    %s with %s\n",
  281|      0|            (void *)data->ctx, (void *)decoder,
  282|      0|            OSSL_DECODER_get0_name(decoder),
  283|      0|            OSSL_DECODER_get0_properties(decoder));
  284|      0|    }
  285|      5|    OSSL_TRACE_END(DECODER);
  ------------------
  |  |  226|      5|    }                            \
  |  |  227|      5|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 5]
  |  |  ------------------
  ------------------
  286|       |
  287|       |    /*
  288|       |     * Get the property match score so the decoders can be prioritized later.
  289|       |     */
  290|      5|    props = ossl_decoder_parsed_properties(decoder);
  291|      5|    if (data->pq != NULL && props != NULL) {
  ------------------
  |  Branch (291:9): [True: 0, False: 5]
  |  Branch (291:29): [True: 0, False: 0]
  ------------------
  292|      0|        di->score = ossl_property_match_count(data->pq, props);
  293|       |        /*
  294|       |         * Mismatch of mandatory properties is not an error, the decoder is just
  295|       |         * ignored, continue.
  296|       |         */
  297|      0|        if (di->score < 0) {
  ------------------
  |  Branch (297:13): [True: 0, False: 0]
  ------------------
  298|      0|            ossl_decoder_instance_free(di);
  299|      0|            return 0;
  300|      0|        }
  301|      0|    }
  302|       |
  303|      5|    if (!ossl_decoder_ctx_add_decoder_inst(data->ctx, di)) {
  ------------------
  |  Branch (303:9): [True: 0, False: 5]
  ------------------
  304|      0|        ossl_decoder_instance_free(di);
  305|      0|        data->error_occurred = 1;
  306|      0|        return 0;
  307|      0|    }
  308|       |
  309|      5|    ++data->total;
  310|      5|    return 1;
  311|      5|}
decoder_pkey.c:decoder_construct_pkey:
   74|   824k|{
   75|   824k|    struct decoder_pkey_data_st *data = construct_data;
   76|   824k|    OSSL_DECODER *decoder = OSSL_DECODER_INSTANCE_get_decoder(decoder_inst);
   77|   824k|    void *decoderctx = OSSL_DECODER_INSTANCE_get_decoder_ctx(decoder_inst);
   78|   824k|    const OSSL_PROVIDER *decoder_prov = OSSL_DECODER_get0_provider(decoder);
   79|   824k|    EVP_KEYMGMT *keymgmt = NULL;
   80|   824k|    const OSSL_PROVIDER *keymgmt_prov = NULL;
   81|   824k|    int i, end;
   82|       |    /*
   83|       |     * |object_ref| points to a provider reference to an object, its exact
   84|       |     * contents entirely opaque to us, but may be passed to any provider
   85|       |     * function that expects this (such as OSSL_FUNC_keymgmt_load().
   86|       |     *
   87|       |     * This pointer is considered volatile, i.e. whatever it points at
   88|       |     * is assumed to be freed as soon as this function returns.
   89|       |     */
   90|   824k|    void *object_ref = NULL;
   91|   824k|    size_t object_ref_sz = 0;
   92|   824k|    const OSSL_PARAM *p;
   93|       |
   94|   824k|    p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_DATA_TYPE);
  ------------------
  |  |  358|   824k|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
   95|   824k|    if (p != NULL) {
  ------------------
  |  Branch (95:9): [True: 824k, False: 0]
  ------------------
   96|   824k|        char *object_type = NULL;
   97|       |
   98|   824k|        if (!OSSL_PARAM_get_utf8_string(p, &object_type, 0))
  ------------------
  |  Branch (98:13): [True: 0, False: 824k]
  ------------------
   99|      0|            return 0;
  100|   824k|        OPENSSL_free(data->object_type);
  ------------------
  |  |  131|   824k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  101|   824k|        data->object_type = object_type;
  102|   824k|    }
  103|       |
  104|       |    /*
  105|       |     * For stuff that should end up in an EVP_PKEY, we only accept an object
  106|       |     * reference for the moment.  This enforces that the key data itself
  107|       |     * remains with the provider.
  108|       |     */
  109|   824k|    p = OSSL_PARAM_locate_const(params, OSSL_OBJECT_PARAM_REFERENCE);
  ------------------
  |  |  361|   824k|# define OSSL_OBJECT_PARAM_REFERENCE "reference"
  ------------------
  110|   824k|    if (p == NULL || p->data_type != OSSL_PARAM_OCTET_STRING)
  ------------------
  |  |  123|   412k|#define OSSL_PARAM_OCTET_STRING 5
  ------------------
  |  Branch (110:9): [True: 412k, False: 412k]
  |  Branch (110:22): [True: 0, False: 412k]
  ------------------
  111|   412k|        return 0;
  112|   412k|    object_ref = p->data;
  113|   412k|    object_ref_sz = p->data_size;
  114|       |
  115|       |    /*
  116|       |     * First, we try to find a keymgmt that comes from the same provider as
  117|       |     * the decoder that passed the params.
  118|       |     */
  119|   412k|    end = sk_EVP_KEYMGMT_num(data->keymgmts);
  120|   412k|    for (i = 0; i < end; i++) {
  ------------------
  |  Branch (120:17): [True: 412k, False: 0]
  ------------------
  121|   412k|        keymgmt = sk_EVP_KEYMGMT_value(data->keymgmts, i);
  122|   412k|        keymgmt_prov = EVP_KEYMGMT_get0_provider(keymgmt);
  123|       |
  124|   412k|        if (keymgmt_prov == decoder_prov
  ------------------
  |  Branch (124:13): [True: 412k, False: 0]
  ------------------
  125|   412k|            && evp_keymgmt_has_load(keymgmt)
  ------------------
  |  Branch (125:16): [True: 412k, False: 0]
  ------------------
  126|   412k|            && EVP_KEYMGMT_is_a(keymgmt, data->object_type))
  ------------------
  |  Branch (126:16): [True: 412k, False: 0]
  ------------------
  127|   412k|            break;
  128|   412k|    }
  129|   412k|    if (i < end) {
  ------------------
  |  Branch (129:9): [True: 412k, False: 0]
  ------------------
  130|       |        /* To allow it to be freed further down */
  131|   412k|        if (!EVP_KEYMGMT_up_ref(keymgmt))
  ------------------
  |  Branch (131:13): [True: 0, False: 412k]
  ------------------
  132|      0|            return 0;
  133|   412k|    } else if ((keymgmt = EVP_KEYMGMT_fetch(data->libctx,
  ------------------
  |  Branch (133:16): [True: 0, False: 0]
  ------------------
  134|      0|                    data->object_type,
  135|      0|                    data->propq))
  136|      0|        != NULL) {
  137|      0|        keymgmt_prov = EVP_KEYMGMT_get0_provider(keymgmt);
  138|      0|    }
  139|       |
  140|   412k|    if (keymgmt != NULL) {
  ------------------
  |  Branch (140:9): [True: 412k, False: 0]
  ------------------
  141|   412k|        EVP_PKEY *pkey = NULL;
  142|   412k|        void *keydata = NULL;
  143|       |
  144|       |        /*
  145|       |         * If the EVP_KEYMGMT and the OSSL_DECODER are from the
  146|       |         * same provider, we assume that the KEYMGMT has a key loading
  147|       |         * function that can handle the provider reference we hold.
  148|       |         *
  149|       |         * Otherwise, we export from the decoder and import the
  150|       |         * result in the keymgmt.
  151|       |         */
  152|   412k|        if (keymgmt_prov == decoder_prov) {
  ------------------
  |  Branch (152:13): [True: 412k, False: 0]
  ------------------
  153|   412k|            keydata = evp_keymgmt_load(keymgmt, object_ref, object_ref_sz);
  154|   412k|        } else {
  155|      0|            struct evp_keymgmt_util_try_import_data_st import_data;
  156|       |
  157|      0|            import_data.keymgmt = keymgmt;
  158|      0|            import_data.keydata = NULL;
  159|      0|            if (data->selection == 0)
  ------------------
  |  Branch (159:17): [True: 0, False: 0]
  ------------------
  160|       |                /* import/export functions do not tolerate 0 selection */
  161|      0|                import_data.selection = OSSL_KEYMGMT_SELECT_ALL;
  ------------------
  |  |  652|      0|    (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS)
  |  |  ------------------
  |  |  |  |  650|      0|    (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  |  |  ------------------
  |  |  |  |  |  |  640|      0|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  |  |  |  |  ------------------
  |  |  |  |                   (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  |  |  ------------------
  |  |  |  |  |  |  641|      0|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS)
  |  |  ------------------
  |  |  |  |  647|      0|    (OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS \
  |  |  |  |  ------------------
  |  |  |  |  |  |  642|      0|#define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS 0x04
  |  |  |  |  ------------------
  |  |  |  |  648|      0|        | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  643|      0|#define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS 0x80
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  162|      0|            else
  163|      0|                import_data.selection = data->selection;
  164|       |
  165|       |            /*
  166|       |             * No need to check for errors here, the value of
  167|       |             * |import_data.keydata| is as much an indicator.
  168|       |             */
  169|      0|            (void)decoder->export_object(decoderctx,
  170|      0|                object_ref, object_ref_sz,
  171|      0|                &evp_keymgmt_util_try_import,
  172|      0|                &import_data);
  173|      0|            keydata = import_data.keydata;
  174|      0|            import_data.keydata = NULL;
  175|      0|        }
  176|       |        /*
  177|       |         * When load or import fails, because this is not an acceptable key
  178|       |         * (despite the provided key material being syntactically valid), the
  179|       |         * reason why the key is rejected would be lost, unless we signal a
  180|       |         * hard error, and suppress resetting for another try.
  181|       |         */
  182|   412k|        if (keydata == NULL)
  ------------------
  |  Branch (182:13): [True: 0, False: 412k]
  ------------------
  183|      0|            ossl_decoder_ctx_set_harderr(data->ctx);
  184|       |
  185|   412k|        if (keydata != NULL
  ------------------
  |  Branch (185:13): [True: 412k, False: 0]
  ------------------
  186|   412k|            && (pkey = evp_keymgmt_util_make_pkey(keymgmt, keydata)) == NULL)
  ------------------
  |  Branch (186:16): [True: 0, False: 412k]
  ------------------
  187|      0|            evp_keymgmt_freedata(keymgmt, keydata);
  188|       |
  189|   412k|        *data->object = pkey;
  190|       |
  191|       |        /*
  192|       |         * evp_keymgmt_util_make_pkey() increments the reference count when
  193|       |         * assigning the EVP_PKEY, so we can free the keymgmt here.
  194|       |         */
  195|   412k|        EVP_KEYMGMT_free(keymgmt);
  196|   412k|    }
  197|       |    /*
  198|       |     * We successfully looked through, |*ctx->object| determines if we
  199|       |     * actually found something.
  200|       |     */
  201|       |    return (*data->object != NULL);
  202|   412k|}
decoder_pkey.c:decoder_clean_pkey_construct_arg:
  205|   412k|{
  206|   412k|    struct decoder_pkey_data_st *data = construct_data;
  207|       |
  208|   412k|    if (data != NULL) {
  ------------------
  |  Branch (208:9): [True: 412k, False: 2]
  ------------------
  209|   412k|        sk_EVP_KEYMGMT_pop_free(data->keymgmts, EVP_KEYMGMT_free);
  210|   412k|        OPENSSL_free(data->propq);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  211|   412k|        OPENSSL_free(data->object_type);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  212|   412k|        OPENSSL_free(data);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  213|   412k|    }
  214|   412k|}
decoder_pkey.c:ossl_decoder_ctx_for_pkey_dup:
  579|   412k|{
  580|   412k|    OSSL_DECODER_CTX *dest;
  581|   412k|    struct decoder_pkey_data_st *process_data_src, *process_data_dest = NULL;
  582|       |
  583|   412k|    if (src == NULL)
  ------------------
  |  Branch (583:9): [True: 0, False: 412k]
  ------------------
  584|      0|        return NULL;
  585|       |
  586|   412k|    if ((dest = OSSL_DECODER_CTX_new()) == NULL) {
  ------------------
  |  Branch (586:9): [True: 0, False: 412k]
  ------------------
  587|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  588|      0|        return NULL;
  589|      0|    }
  590|       |
  591|   412k|    if (!OSSL_DECODER_CTX_set_input_type(dest, input_type)
  ------------------
  |  Branch (591:9): [True: 0, False: 412k]
  ------------------
  592|   412k|        || !OSSL_DECODER_CTX_set_input_structure(dest, input_structure)) {
  ------------------
  |  Branch (592:12): [True: 0, False: 412k]
  ------------------
  593|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  594|      0|        goto err;
  595|      0|    }
  596|   412k|    dest->selection = src->selection;
  597|       |
  598|   412k|    if (src->decoder_insts != NULL) {
  ------------------
  |  Branch (598:9): [True: 412k, False: 0]
  ------------------
  599|   412k|        dest->decoder_insts
  600|   412k|            = sk_OSSL_DECODER_INSTANCE_deep_copy(src->decoder_insts,
  601|   412k|                ossl_decoder_instance_dup,
  602|   412k|                ossl_decoder_instance_free);
  603|   412k|        if (dest->decoder_insts == NULL) {
  ------------------
  |  Branch (603:13): [True: 0, False: 412k]
  ------------------
  604|      0|            ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  605|      0|            goto err;
  606|      0|        }
  607|   412k|    }
  608|       |
  609|   412k|    if (!OSSL_DECODER_CTX_set_construct(dest,
  ------------------
  |  Branch (609:9): [True: 0, False: 412k]
  ------------------
  610|   412k|            OSSL_DECODER_CTX_get_construct(src))) {
  611|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  612|      0|        goto err;
  613|      0|    }
  614|       |
  615|   412k|    process_data_src = OSSL_DECODER_CTX_get_construct_data(src);
  616|   412k|    if (process_data_src != NULL) {
  ------------------
  |  Branch (616:9): [True: 412k, False: 0]
  ------------------
  617|   412k|        process_data_dest = OPENSSL_zalloc(sizeof(*process_data_dest));
  ------------------
  |  |  108|   412k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  618|   412k|        if (process_data_dest == NULL) {
  ------------------
  |  Branch (618:13): [True: 0, False: 412k]
  ------------------
  619|      0|            ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  620|      0|            goto err;
  621|      0|        }
  622|   412k|        if (process_data_src->propq != NULL) {
  ------------------
  |  Branch (622:13): [True: 0, False: 412k]
  ------------------
  623|      0|            process_data_dest->propq = OPENSSL_strdup(process_data_src->propq);
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  624|      0|            if (process_data_dest->propq == NULL) {
  ------------------
  |  Branch (624:17): [True: 0, False: 0]
  ------------------
  625|      0|                ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  626|      0|                goto err;
  627|      0|            }
  628|      0|        }
  629|       |
  630|   412k|        if (process_data_src->keymgmts != NULL) {
  ------------------
  |  Branch (630:13): [True: 412k, False: 0]
  ------------------
  631|   412k|            process_data_dest->keymgmts
  632|   412k|                = sk_EVP_KEYMGMT_deep_copy(process_data_src->keymgmts,
  633|   412k|                    keymgmt_dup,
  634|   412k|                    EVP_KEYMGMT_free);
  635|   412k|            if (process_data_dest->keymgmts == NULL) {
  ------------------
  |  Branch (635:17): [True: 0, False: 412k]
  ------------------
  636|      0|                ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_EVP_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  637|      0|                goto err;
  638|      0|            }
  639|   412k|        }
  640|       |
  641|   412k|        process_data_dest->object = (void **)pkey;
  642|   412k|        process_data_dest->libctx = process_data_src->libctx;
  643|   412k|        process_data_dest->selection = process_data_src->selection;
  644|   412k|        process_data_dest->ctx = dest;
  645|   412k|        if (!OSSL_DECODER_CTX_set_construct_data(dest, process_data_dest)) {
  ------------------
  |  Branch (645:13): [True: 0, False: 412k]
  ------------------
  646|      0|            ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  647|      0|            goto err;
  648|      0|        }
  649|   412k|        process_data_dest = NULL;
  650|   412k|    }
  651|       |
  652|   412k|    if (!OSSL_DECODER_CTX_set_cleanup(dest,
  ------------------
  |  Branch (652:9): [True: 0, False: 412k]
  ------------------
  653|   412k|            OSSL_DECODER_CTX_get_cleanup(src))) {
  654|      0|        ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_OSSL_DECODER_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  655|      0|        goto err;
  656|      0|    }
  657|       |
  658|   412k|    return dest;
  659|      0|err:
  660|      0|    decoder_clean_pkey_construct_arg(process_data_dest);
  661|      0|    OSSL_DECODER_CTX_free(dest);
  662|       |    return NULL;
  663|   412k|}
decoder_pkey.c:keymgmt_dup:
  561|   525k|{
  562|   525k|    if (!EVP_KEYMGMT_up_ref((EVP_KEYMGMT *)keymgmt))
  ------------------
  |  Branch (562:9): [True: 0, False: 525k]
  ------------------
  563|      0|        return NULL;
  564|       |
  565|   525k|    return (EVP_KEYMGMT *)keymgmt;
  566|   525k|}

ossl_encoder_store_cache_flush:
  443|    649|{
  444|    649|    OSSL_METHOD_STORE *store = get_encoder_store(libctx);
  445|       |
  446|    649|    if (store != NULL)
  ------------------
  |  Branch (446:9): [True: 649, False: 0]
  ------------------
  447|    649|        return ossl_method_store_cache_flush_all(store);
  448|      0|    return 1;
  449|    649|}
ossl_encoder_store_remove_all_provided:
  452|    649|{
  453|    649|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  454|    649|    OSSL_METHOD_STORE *store = get_encoder_store(libctx);
  455|       |
  456|    649|    if (store != NULL)
  ------------------
  |  Branch (456:9): [True: 649, False: 0]
  ------------------
  457|    649|        return ossl_method_store_remove_all_provided(store, prov);
  458|      0|    return 1;
  459|    649|}
encoder_meth.c:get_encoder_store:
  112|  1.29k|{
  113|  1.29k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_ENCODER_STORE_INDEX);
  ------------------
  |  |  108|  1.29k|#define OSSL_LIB_CTX_ENCODER_STORE_INDEX 10
  ------------------
  114|  1.29k|}

ENGINE_load_builtin_engines:
   14|  1.64k|{
   15|  1.64k|    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL);
  ------------------
  |  |  535|  1.64k|    (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  513|  1.64k|#define OPENSSL_INIT_ENGINE_RDRAND 0x00000200L
  |  |  ------------------
  |  |                   (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  514|  1.64k|#define OPENSSL_INIT_ENGINE_DYNAMIC 0x00000400L
  |  |  ------------------
  |  |  536|  1.64k|        | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | OPENSSL_INIT_ENGINE_PADLOCK)
  |  |  ------------------
  |  |  |  |  516|  1.64k|#define OPENSSL_INIT_ENGINE_CRYPTODEV 0x00001000L
  |  |  ------------------
  |  |                       | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | OPENSSL_INIT_ENGINE_PADLOCK)
  |  |  ------------------
  |  |  |  |  517|  1.64k|#define OPENSSL_INIT_ENGINE_CAPI 0x00002000L
  |  |  ------------------
  |  |                       | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | OPENSSL_INIT_ENGINE_PADLOCK)
  |  |  ------------------
  |  |  |  |  518|  1.64k|#define OPENSSL_INIT_ENGINE_PADLOCK 0x00004000L
  |  |  ------------------
  ------------------
   16|  1.64k|}

ENGINE_ctrl:
  126|  16.3k|{
  127|  16.3k|    int ctrl_exists;
  128|       |
  129|  16.3k|    if (e == NULL) {
  ------------------
  |  Branch (129:9): [True: 0, False: 16.3k]
  ------------------
  130|      0|        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  131|      0|        return 0;
  132|      0|    }
  133|       |
  134|  16.3k|    ctrl_exists = ((e->ctrl == NULL) ? 0 : 1);
  ------------------
  |  Branch (134:20): [True: 0, False: 16.3k]
  ------------------
  135|       |
  136|       |    /*
  137|       |     * Intercept any "root-level" commands before trying to hand them on to
  138|       |     * ctrl() handlers.
  139|       |     */
  140|  16.3k|    switch (cmd) {
  141|      0|    case ENGINE_CTRL_HAS_CTRL_FUNCTION:
  ------------------
  |  |  184|      0|#define ENGINE_CTRL_HAS_CTRL_FUNCTION 10
  ------------------
  |  Branch (141:5): [True: 0, False: 16.3k]
  ------------------
  142|      0|        return ctrl_exists;
  143|      0|    case ENGINE_CTRL_GET_FIRST_CMD_TYPE:
  ------------------
  |  |  189|      0|#define ENGINE_CTRL_GET_FIRST_CMD_TYPE 11
  ------------------
  |  Branch (143:5): [True: 0, False: 16.3k]
  ------------------
  144|      0|    case ENGINE_CTRL_GET_NEXT_CMD_TYPE:
  ------------------
  |  |  194|      0|#define ENGINE_CTRL_GET_NEXT_CMD_TYPE 12
  ------------------
  |  Branch (144:5): [True: 0, False: 16.3k]
  ------------------
  145|  4.08k|    case ENGINE_CTRL_GET_CMD_FROM_NAME:
  ------------------
  |  |  199|  4.08k|#define ENGINE_CTRL_GET_CMD_FROM_NAME 13
  ------------------
  |  Branch (145:5): [True: 4.08k, False: 12.2k]
  ------------------
  146|  4.08k|    case ENGINE_CTRL_GET_NAME_LEN_FROM_CMD:
  ------------------
  |  |  208|  4.08k|#define ENGINE_CTRL_GET_NAME_LEN_FROM_CMD 14
  ------------------
  |  Branch (146:5): [True: 0, False: 16.3k]
  ------------------
  147|  4.08k|    case ENGINE_CTRL_GET_NAME_FROM_CMD:
  ------------------
  |  |  209|  4.08k|#define ENGINE_CTRL_GET_NAME_FROM_CMD 15
  ------------------
  |  Branch (147:5): [True: 0, False: 16.3k]
  ------------------
  148|  4.08k|    case ENGINE_CTRL_GET_DESC_LEN_FROM_CMD:
  ------------------
  |  |  211|  4.08k|#define ENGINE_CTRL_GET_DESC_LEN_FROM_CMD 16
  ------------------
  |  Branch (148:5): [True: 0, False: 16.3k]
  ------------------
  149|  4.08k|    case ENGINE_CTRL_GET_DESC_FROM_CMD:
  ------------------
  |  |  212|  4.08k|#define ENGINE_CTRL_GET_DESC_FROM_CMD 17
  ------------------
  |  Branch (149:5): [True: 0, False: 16.3k]
  ------------------
  150|  12.2k|    case ENGINE_CTRL_GET_CMD_FLAGS:
  ------------------
  |  |  218|  12.2k|#define ENGINE_CTRL_GET_CMD_FLAGS 18
  ------------------
  |  Branch (150:5): [True: 8.17k, False: 8.17k]
  ------------------
  151|  12.2k|        if (ctrl_exists && !(e->flags & ENGINE_FLAGS_MANUAL_CMD_CTRL))
  ------------------
  |  |   76|  12.2k|#define ENGINE_FLAGS_MANUAL_CMD_CTRL (int)0x0002
  ------------------
  |  Branch (151:13): [True: 12.2k, False: 0]
  |  Branch (151:28): [True: 12.2k, False: 0]
  ------------------
  152|  12.2k|            return int_ctrl_helper(e, cmd, i, p, f);
  153|      0|        if (!ctrl_exists) {
  ------------------
  |  Branch (153:13): [True: 0, False: 0]
  ------------------
  154|      0|            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NO_CONTROL_FUNCTION);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  155|       |            /*
  156|       |             * For these cmd-related functions, failure is indicated by a -1
  157|       |             * return value (because 0 is used as a valid return in some
  158|       |             * places).
  159|       |             */
  160|      0|            return -1;
  161|      0|        }
  162|  4.08k|    default:
  ------------------
  |  Branch (162:5): [True: 4.08k, False: 12.2k]
  ------------------
  163|  4.08k|        break;
  164|  16.3k|    }
  165|       |    /* Anything else requires a ctrl() handler to exist. */
  166|  4.08k|    if (!ctrl_exists) {
  ------------------
  |  Branch (166:9): [True: 0, False: 4.08k]
  ------------------
  167|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NO_CONTROL_FUNCTION);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  168|      0|        return 0;
  169|      0|    }
  170|  4.08k|    return e->ctrl(e, cmd, i, p, f);
  171|  4.08k|}
ENGINE_cmd_is_executable:
  174|  4.08k|{
  175|  4.08k|    int flags;
  176|  4.08k|    if ((flags = ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FLAGS, cmd, NULL, NULL)) < 0) {
  ------------------
  |  |  218|  4.08k|#define ENGINE_CTRL_GET_CMD_FLAGS 18
  ------------------
  |  Branch (176:9): [True: 0, False: 4.08k]
  ------------------
  177|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NUMBER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  178|      0|        return 0;
  179|      0|    }
  180|  4.08k|    if (!(flags & ENGINE_CMD_FLAG_NO_INPUT) && !(flags & ENGINE_CMD_FLAG_NUMERIC) && !(flags & ENGINE_CMD_FLAG_STRING))
  ------------------
  |  |  121|  4.08k|#define ENGINE_CMD_FLAG_NO_INPUT (unsigned int)0x0004
  ------------------
                  if (!(flags & ENGINE_CMD_FLAG_NO_INPUT) && !(flags & ENGINE_CMD_FLAG_NUMERIC) && !(flags & ENGINE_CMD_FLAG_STRING))
  ------------------
  |  |  111|  3.26k|#define ENGINE_CMD_FLAG_NUMERIC (unsigned int)0x0001
  ------------------
                  if (!(flags & ENGINE_CMD_FLAG_NO_INPUT) && !(flags & ENGINE_CMD_FLAG_NUMERIC) && !(flags & ENGINE_CMD_FLAG_STRING))
  ------------------
  |  |  116|  1.63k|#define ENGINE_CMD_FLAG_STRING (unsigned int)0x0002
  ------------------
  |  Branch (180:9): [True: 3.26k, False: 817]
  |  Branch (180:48): [True: 1.63k, False: 1.63k]
  |  Branch (180:86): [True: 0, False: 1.63k]
  ------------------
  181|      0|        return 0;
  182|  4.08k|    return 1;
  183|  4.08k|}
ENGINE_ctrl_cmd_string:
  224|  4.08k|{
  225|  4.08k|    int num, flags;
  226|  4.08k|    long l;
  227|  4.08k|    char *ptr;
  228|       |
  229|  4.08k|    if (e == NULL || cmd_name == NULL) {
  ------------------
  |  Branch (229:9): [True: 0, False: 4.08k]
  |  Branch (229:22): [True: 0, False: 4.08k]
  ------------------
  230|      0|        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  231|      0|        return 0;
  232|      0|    }
  233|  4.08k|    if (e->ctrl == NULL
  ------------------
  |  Branch (233:9): [True: 0, False: 4.08k]
  ------------------
  234|  4.08k|        || (num = ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FROM_NAME,
  ------------------
  |  |  199|  4.08k|#define ENGINE_CTRL_GET_CMD_FROM_NAME 13
  ------------------
  |  Branch (234:12): [True: 0, False: 4.08k]
  ------------------
  235|  4.08k|                0, (void *)cmd_name, NULL))
  236|  4.08k|            <= 0) {
  237|       |        /*
  238|       |         * If the command didn't *have* to be supported, we fake success.
  239|       |         * This allows certain settings to be specified for multiple ENGINEs
  240|       |         * and only require a change of ENGINE id (without having to
  241|       |         * selectively apply settings). Eg. changing from a hardware device
  242|       |         * back to the regular software ENGINE without editing the config
  243|       |         * file, etc.
  244|       |         */
  245|      0|        if (cmd_optional) {
  ------------------
  |  Branch (245:13): [True: 0, False: 0]
  ------------------
  246|      0|            ERR_clear_error();
  247|      0|            return 1;
  248|      0|        }
  249|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NAME);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  250|      0|        return 0;
  251|      0|    }
  252|  4.08k|    if (!ENGINE_cmd_is_executable(e, num)) {
  ------------------
  |  Branch (252:9): [True: 0, False: 4.08k]
  ------------------
  253|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_CMD_NOT_EXECUTABLE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  254|      0|        return 0;
  255|      0|    }
  256|       |
  257|  4.08k|    flags = ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FLAGS, num, NULL, NULL);
  ------------------
  |  |  218|  4.08k|#define ENGINE_CTRL_GET_CMD_FLAGS 18
  ------------------
  258|  4.08k|    if (flags < 0) {
  ------------------
  |  Branch (258:9): [True: 0, False: 4.08k]
  ------------------
  259|       |        /*
  260|       |         * Shouldn't happen, given that ENGINE_cmd_is_executable() returned
  261|       |         * success.
  262|       |         */
  263|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  264|      0|        return 0;
  265|      0|    }
  266|       |    /*
  267|       |     * If the command takes no input, there must be no input. And vice versa.
  268|       |     */
  269|  4.08k|    if (flags & ENGINE_CMD_FLAG_NO_INPUT) {
  ------------------
  |  |  121|  4.08k|#define ENGINE_CMD_FLAG_NO_INPUT (unsigned int)0x0004
  ------------------
  |  Branch (269:9): [True: 817, False: 3.26k]
  ------------------
  270|    817|        if (arg != NULL) {
  ------------------
  |  Branch (270:13): [True: 0, False: 817]
  ------------------
  271|      0|            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_NO_INPUT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|            return 0;
  273|      0|        }
  274|       |        /*
  275|       |         * We deliberately force the result of ENGINE_ctrl() to 0 or 1 rather
  276|       |         * than returning it as "return data". This is to ensure usage of
  277|       |         * these commands is consistent across applications and that certain
  278|       |         * applications don't understand it one way, and others another.
  279|       |         */
  280|    817|        if (ENGINE_ctrl(e, num, 0, (void *)arg, NULL) > 0)
  ------------------
  |  Branch (280:13): [True: 0, False: 817]
  ------------------
  281|      0|            return 1;
  282|    817|        return 0;
  283|    817|    }
  284|       |    /* So, we require input */
  285|  3.26k|    if (arg == NULL) {
  ------------------
  |  Branch (285:9): [True: 0, False: 3.26k]
  ------------------
  286|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_INPUT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  287|      0|        return 0;
  288|      0|    }
  289|       |    /* If it takes string input, that's easy */
  290|  3.26k|    if (flags & ENGINE_CMD_FLAG_STRING) {
  ------------------
  |  |  116|  3.26k|#define ENGINE_CMD_FLAG_STRING (unsigned int)0x0002
  ------------------
  |  Branch (290:9): [True: 1.63k, False: 1.63k]
  ------------------
  291|       |        /* Same explanation as above */
  292|  1.63k|        if (ENGINE_ctrl(e, num, 0, (void *)arg, NULL) > 0)
  ------------------
  |  Branch (292:13): [True: 1.63k, False: 0]
  ------------------
  293|  1.63k|            return 1;
  294|      0|        return 0;
  295|  1.63k|    }
  296|       |    /*
  297|       |     * If it doesn't take numeric either, then it is unsupported for use in a
  298|       |     * config-setting situation, which is what this function is for. This
  299|       |     * should never happen though, because ENGINE_cmd_is_executable() was
  300|       |     * used.
  301|       |     */
  302|  1.63k|    if (!(flags & ENGINE_CMD_FLAG_NUMERIC)) {
  ------------------
  |  |  111|  1.63k|#define ENGINE_CMD_FLAG_NUMERIC (unsigned int)0x0001
  ------------------
  |  Branch (302:9): [True: 0, False: 1.63k]
  ------------------
  303|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  304|      0|        return 0;
  305|      0|    }
  306|  1.63k|    l = strtol(arg, &ptr, 10);
  307|  1.63k|    if ((arg == ptr) || (*ptr != '\0')) {
  ------------------
  |  Branch (307:9): [True: 0, False: 1.63k]
  |  Branch (307:25): [True: 0, False: 1.63k]
  ------------------
  308|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  309|      0|        return 0;
  310|      0|    }
  311|       |    /*
  312|       |     * Force the result of the control command to 0 or 1, for the reasons
  313|       |     * mentioned before.
  314|       |     */
  315|  1.63k|    if (ENGINE_ctrl(e, num, l, NULL, NULL) > 0)
  ------------------
  |  Branch (315:9): [True: 1.63k, False: 0]
  ------------------
  316|  1.63k|        return 1;
  317|      0|    return 0;
  318|  1.63k|}
eng_ctrl.c:int_ctrl_helper:
   66|  12.2k|{
   67|  12.2k|    int idx;
   68|  12.2k|    char *s = (char *)p;
   69|  12.2k|    const ENGINE_CMD_DEFN *cdp;
   70|       |
   71|       |    /* Take care of the easy one first (eg. it requires no searches) */
   72|  12.2k|    if (cmd == ENGINE_CTRL_GET_FIRST_CMD_TYPE) {
  ------------------
  |  |  189|  12.2k|#define ENGINE_CTRL_GET_FIRST_CMD_TYPE 11
  ------------------
  |  Branch (72:9): [True: 0, False: 12.2k]
  ------------------
   73|      0|        if ((e->cmd_defns == NULL) || int_ctrl_cmd_is_null(e->cmd_defns))
  ------------------
  |  Branch (73:13): [True: 0, False: 0]
  |  Branch (73:39): [True: 0, False: 0]
  ------------------
   74|      0|            return 0;
   75|      0|        return e->cmd_defns->cmd_num;
   76|      0|    }
   77|       |    /* One or two commands require that "p" be a valid string buffer */
   78|  12.2k|    if ((cmd == ENGINE_CTRL_GET_CMD_FROM_NAME) || (cmd == ENGINE_CTRL_GET_NAME_FROM_CMD) || (cmd == ENGINE_CTRL_GET_DESC_FROM_CMD)) {
  ------------------
  |  |  199|  12.2k|#define ENGINE_CTRL_GET_CMD_FROM_NAME 13
  ------------------
                  if ((cmd == ENGINE_CTRL_GET_CMD_FROM_NAME) || (cmd == ENGINE_CTRL_GET_NAME_FROM_CMD) || (cmd == ENGINE_CTRL_GET_DESC_FROM_CMD)) {
  ------------------
  |  |  209|  8.17k|#define ENGINE_CTRL_GET_NAME_FROM_CMD 15
  ------------------
                  if ((cmd == ENGINE_CTRL_GET_CMD_FROM_NAME) || (cmd == ENGINE_CTRL_GET_NAME_FROM_CMD) || (cmd == ENGINE_CTRL_GET_DESC_FROM_CMD)) {
  ------------------
  |  |  212|  8.17k|#define ENGINE_CTRL_GET_DESC_FROM_CMD 17
  ------------------
  |  Branch (78:9): [True: 4.08k, False: 8.17k]
  |  Branch (78:51): [True: 0, False: 8.17k]
  |  Branch (78:93): [True: 0, False: 8.17k]
  ------------------
   79|  4.08k|        if (s == NULL) {
  ------------------
  |  Branch (79:13): [True: 0, False: 4.08k]
  ------------------
   80|      0|            ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   81|      0|            return -1;
   82|      0|        }
   83|  4.08k|    }
   84|       |    /* Now handle cmd_name -> cmd_num conversion */
   85|  12.2k|    if (cmd == ENGINE_CTRL_GET_CMD_FROM_NAME) {
  ------------------
  |  |  199|  12.2k|#define ENGINE_CTRL_GET_CMD_FROM_NAME 13
  ------------------
  |  Branch (85:9): [True: 4.08k, False: 8.17k]
  ------------------
   86|  4.08k|        if ((e->cmd_defns == NULL)
  ------------------
  |  Branch (86:13): [True: 0, False: 4.08k]
  ------------------
   87|  4.08k|            || ((idx = int_ctrl_cmd_by_name(e->cmd_defns, s)) < 0)) {
  ------------------
  |  Branch (87:16): [True: 0, False: 4.08k]
  ------------------
   88|      0|            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NAME);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   89|      0|            return -1;
   90|      0|        }
   91|  4.08k|        return e->cmd_defns[idx].cmd_num;
   92|  4.08k|    }
   93|       |    /*
   94|       |     * For the rest of the commands, the 'long' argument must specify a valid
   95|       |     * command number - so we need to conduct a search.
   96|       |     */
   97|  8.17k|    if ((e->cmd_defns == NULL)
  ------------------
  |  Branch (97:9): [True: 0, False: 8.17k]
  ------------------
   98|  8.17k|        || ((idx = int_ctrl_cmd_by_num(e->cmd_defns, (unsigned int)i)) < 0)) {
  ------------------
  |  Branch (98:12): [True: 0, False: 8.17k]
  ------------------
   99|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NUMBER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  100|      0|        return -1;
  101|      0|    }
  102|       |    /* Now the logic splits depending on command type */
  103|  8.17k|    cdp = &e->cmd_defns[idx];
  104|  8.17k|    switch (cmd) {
  ------------------
  |  Branch (104:13): [True: 8.17k, False: 0]
  ------------------
  105|      0|    case ENGINE_CTRL_GET_NEXT_CMD_TYPE:
  ------------------
  |  |  194|      0|#define ENGINE_CTRL_GET_NEXT_CMD_TYPE 12
  ------------------
  |  Branch (105:5): [True: 0, False: 8.17k]
  ------------------
  106|      0|        cdp++;
  107|      0|        return int_ctrl_cmd_is_null(cdp) ? 0 : cdp->cmd_num;
  ------------------
  |  Branch (107:16): [True: 0, False: 0]
  ------------------
  108|      0|    case ENGINE_CTRL_GET_NAME_LEN_FROM_CMD:
  ------------------
  |  |  208|      0|#define ENGINE_CTRL_GET_NAME_LEN_FROM_CMD 14
  ------------------
  |  Branch (108:5): [True: 0, False: 8.17k]
  ------------------
  109|      0|        return (int)strlen(cdp->cmd_name);
  110|      0|    case ENGINE_CTRL_GET_NAME_FROM_CMD:
  ------------------
  |  |  209|      0|#define ENGINE_CTRL_GET_NAME_FROM_CMD 15
  ------------------
  |  Branch (110:5): [True: 0, False: 8.17k]
  ------------------
  111|      0|        return (int)strlen(strcpy(s, cdp->cmd_name));
  112|      0|    case ENGINE_CTRL_GET_DESC_LEN_FROM_CMD:
  ------------------
  |  |  211|      0|#define ENGINE_CTRL_GET_DESC_LEN_FROM_CMD 16
  ------------------
  |  Branch (112:5): [True: 0, False: 8.17k]
  ------------------
  113|      0|        return (int)strlen(cdp->cmd_desc == NULL ? int_no_description
  ------------------
  |  Branch (113:28): [True: 0, False: 0]
  ------------------
  114|      0|                                                 : cdp->cmd_desc);
  115|      0|    case ENGINE_CTRL_GET_DESC_FROM_CMD:
  ------------------
  |  |  212|      0|#define ENGINE_CTRL_GET_DESC_FROM_CMD 17
  ------------------
  |  Branch (115:5): [True: 0, False: 8.17k]
  ------------------
  116|      0|        return (int)strlen(strcpy(s, cdp->cmd_desc == NULL ? int_no_description : cdp->cmd_desc));
  ------------------
  |  Branch (116:38): [True: 0, False: 0]
  ------------------
  117|  8.17k|    case ENGINE_CTRL_GET_CMD_FLAGS:
  ------------------
  |  |  218|  8.17k|#define ENGINE_CTRL_GET_CMD_FLAGS 18
  ------------------
  |  Branch (117:5): [True: 8.17k, False: 0]
  ------------------
  118|  8.17k|        return cdp->cmd_flags;
  119|  8.17k|    }
  120|       |    /* Shouldn't really be here ... */
  121|  8.17k|    ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  122|      0|    return -1;
  123|  8.17k|}
eng_ctrl.c:int_ctrl_cmd_is_null:
   28|  65.3k|{
   29|  65.3k|    if ((defn->cmd_num == 0) || (defn->cmd_name == NULL))
  ------------------
  |  Branch (29:9): [True: 0, False: 65.3k]
  |  Branch (29:33): [True: 0, False: 65.3k]
  ------------------
   30|      0|        return 1;
   31|  65.3k|    return 0;
   32|  65.3k|}
eng_ctrl.c:int_ctrl_cmd_by_name:
   35|  4.08k|{
   36|  4.08k|    int idx = 0;
   37|  20.4k|    while (!int_ctrl_cmd_is_null(defn) && (strcmp(defn->cmd_name, s) != 0)) {
  ------------------
  |  Branch (37:12): [True: 20.4k, False: 0]
  |  Branch (37:43): [True: 16.3k, False: 4.08k]
  ------------------
   38|  16.3k|        idx++;
   39|  16.3k|        defn++;
   40|  16.3k|    }
   41|  4.08k|    if (int_ctrl_cmd_is_null(defn))
  ------------------
  |  Branch (41:9): [True: 0, False: 4.08k]
  ------------------
   42|       |        /* The given name wasn't found */
   43|      0|        return -1;
   44|  4.08k|    return idx;
   45|  4.08k|}
eng_ctrl.c:int_ctrl_cmd_by_num:
   48|  8.17k|{
   49|  8.17k|    int idx = 0;
   50|       |    /*
   51|       |     * NB: It is stipulated that 'cmd_defn' lists are ordered by cmd_num. So
   52|       |     * our searches don't need to take any longer than necessary.
   53|       |     */
   54|  40.8k|    while (!int_ctrl_cmd_is_null(defn) && (defn->cmd_num < num)) {
  ------------------
  |  Branch (54:12): [True: 40.8k, False: 0]
  |  Branch (54:43): [True: 32.6k, False: 8.17k]
  ------------------
   55|  32.6k|        idx++;
   56|  32.6k|        defn++;
   57|  32.6k|    }
   58|  8.17k|    if (defn->cmd_num == num)
  ------------------
  |  Branch (58:9): [True: 8.17k, False: 0]
  ------------------
   59|  8.17k|        return idx;
   60|       |    /* The given cmd_num wasn't found */
   61|      0|    return -1;
   62|  8.17k|}

engine_load_dynamic_int:
  251|      1|{
  252|      1|    ENGINE *toadd = engine_dynamic();
  253|      1|    if (!toadd)
  ------------------
  |  Branch (253:9): [True: 0, False: 1]
  ------------------
  254|      0|        return;
  255|       |
  256|      1|    ERR_set_mark();
  257|      1|    ENGINE_add(toadd);
  258|       |    /*
  259|       |     * If the "add" worked, it gets a structural reference. So either way, we
  260|       |     * release our just-created reference.
  261|       |     */
  262|      1|    ENGINE_free(toadd);
  263|       |    /*
  264|       |     * If the "add" didn't work, it was probably a conflict because it was
  265|       |     * already added (eg. someone calling ENGINE_load_blah then calling
  266|       |     * ENGINE_load_builtin_engines() perhaps).
  267|       |     */
  268|      1|    ERR_pop_to_mark();
  269|      1|}
eng_dyn.c:engine_dynamic:
  239|      1|{
  240|      1|    ENGINE *ret = ENGINE_new();
  241|      1|    if (ret == NULL)
  ------------------
  |  Branch (241:9): [True: 0, False: 1]
  ------------------
  242|      0|        return NULL;
  243|      1|    if (!ENGINE_set_id(ret, engine_dynamic_id) || !ENGINE_set_name(ret, engine_dynamic_name) || !ENGINE_set_init_function(ret, dynamic_init) || !ENGINE_set_finish_function(ret, dynamic_finish) || !ENGINE_set_ctrl_function(ret, dynamic_ctrl) || !ENGINE_set_flags(ret, ENGINE_FLAGS_BY_ID_COPY) || !ENGINE_set_cmd_defns(ret, dynamic_cmd_defns)) {
  ------------------
  |  |   88|      1|#define ENGINE_FLAGS_BY_ID_COPY (int)0x0004
  ------------------
  |  Branch (243:9): [True: 0, False: 1]
  |  Branch (243:51): [True: 0, False: 1]
  |  Branch (243:97): [True: 0, False: 1]
  |  Branch (243:145): [True: 0, False: 1]
  |  Branch (243:197): [True: 0, False: 1]
  |  Branch (243:245): [True: 0, False: 1]
  |  Branch (243:296): [True: 0, False: 1]
  ------------------
  244|      0|        ENGINE_free(ret);
  245|      0|        return NULL;
  246|      0|    }
  247|      1|    return ret;
  248|      1|}
eng_dyn.c:dynamic_init:
  272|      3|{
  273|       |    /*
  274|       |     * We always return failure - the "dynamic" engine itself can't be used
  275|       |     * for anything.
  276|       |     */
  277|      3|    return 0;
  278|      3|}
eng_dyn.c:dynamic_ctrl:
  290|  4.08k|{
  291|  4.08k|    dynamic_data_ctx *ctx = dynamic_get_data_ctx(e);
  292|  4.08k|    int initialised;
  293|       |
  294|  4.08k|    if (!ctx) {
  ------------------
  |  Branch (294:9): [True: 0, False: 4.08k]
  ------------------
  295|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NOT_LOADED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  296|      0|        return 0;
  297|      0|    }
  298|  4.08k|    initialised = ((ctx->dynamic_dso == NULL) ? 0 : 1);
  ------------------
  |  Branch (298:20): [True: 4.08k, False: 0]
  ------------------
  299|       |    /* All our control commands require the ENGINE to be uninitialised */
  300|  4.08k|    if (initialised) {
  ------------------
  |  Branch (300:9): [True: 0, False: 4.08k]
  ------------------
  301|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_ALREADY_LOADED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  302|      0|        return 0;
  303|      0|    }
  304|  4.08k|    switch (cmd) {
  305|      0|    case DYNAMIC_CMD_SO_PATH:
  ------------------
  |  |   33|      0|#define DYNAMIC_CMD_SO_PATH ENGINE_CMD_BASE
  |  |  ------------------
  |  |  |  |  224|      0|#define ENGINE_CMD_BASE 200
  |  |  ------------------
  ------------------
  |  Branch (305:5): [True: 0, False: 4.08k]
  ------------------
  306|       |        /* a NULL 'p' or a string of zero-length is the same thing */
  307|      0|        if (p && (strlen((const char *)p) < 1))
  ------------------
  |  Branch (307:13): [True: 0, False: 0]
  |  Branch (307:18): [True: 0, False: 0]
  ------------------
  308|      0|            p = NULL;
  309|      0|        OPENSSL_free(ctx->DYNAMIC_LIBNAME);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  310|      0|        if (p)
  ------------------
  |  Branch (310:13): [True: 0, False: 0]
  ------------------
  311|      0|            ctx->DYNAMIC_LIBNAME = OPENSSL_strdup(p);
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  312|      0|        else
  313|      0|            ctx->DYNAMIC_LIBNAME = NULL;
  314|      0|        return (ctx->DYNAMIC_LIBNAME ? 1 : 0);
  ------------------
  |  Branch (314:17): [True: 0, False: 0]
  ------------------
  315|      0|    case DYNAMIC_CMD_NO_VCHECK:
  ------------------
  |  |   34|      0|#define DYNAMIC_CMD_NO_VCHECK (ENGINE_CMD_BASE + 1)
  |  |  ------------------
  |  |  |  |  224|      0|#define ENGINE_CMD_BASE 200
  |  |  ------------------
  ------------------
  |  Branch (315:5): [True: 0, False: 4.08k]
  ------------------
  316|      0|        ctx->no_vcheck = ((i == 0) ? 0 : 1);
  ------------------
  |  Branch (316:27): [True: 0, False: 0]
  ------------------
  317|      0|        return 1;
  318|    817|    case DYNAMIC_CMD_ID:
  ------------------
  |  |   35|    817|#define DYNAMIC_CMD_ID (ENGINE_CMD_BASE + 2)
  |  |  ------------------
  |  |  |  |  224|    817|#define ENGINE_CMD_BASE 200
  |  |  ------------------
  ------------------
  |  Branch (318:5): [True: 817, False: 3.26k]
  ------------------
  319|       |        /* a NULL 'p' or a string of zero-length is the same thing */
  320|    817|        if (p && (strlen((const char *)p) < 1))
  ------------------
  |  Branch (320:13): [True: 817, False: 0]
  |  Branch (320:18): [True: 0, False: 817]
  ------------------
  321|      0|            p = NULL;
  322|    817|        OPENSSL_free(ctx->engine_id);
  ------------------
  |  |  131|    817|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  323|    817|        if (p)
  ------------------
  |  Branch (323:13): [True: 817, False: 0]
  ------------------
  324|    817|            ctx->engine_id = OPENSSL_strdup(p);
  ------------------
  |  |  135|    817|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  325|      0|        else
  326|      0|            ctx->engine_id = NULL;
  327|    817|        return (ctx->engine_id ? 1 : 0);
  ------------------
  |  Branch (327:17): [True: 817, False: 0]
  ------------------
  328|    817|    case DYNAMIC_CMD_LIST_ADD:
  ------------------
  |  |   36|    817|#define DYNAMIC_CMD_LIST_ADD (ENGINE_CMD_BASE + 3)
  |  |  ------------------
  |  |  |  |  224|    817|#define ENGINE_CMD_BASE 200
  |  |  ------------------
  ------------------
  |  Branch (328:5): [True: 817, False: 3.26k]
  ------------------
  329|    817|        if ((i < 0) || (i > 2)) {
  ------------------
  |  Branch (329:13): [True: 0, False: 817]
  |  Branch (329:24): [True: 0, False: 817]
  ------------------
  330|      0|            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  331|      0|            return 0;
  332|      0|        }
  333|    817|        ctx->list_add_value = (int)i;
  334|    817|        return 1;
  335|    817|    case DYNAMIC_CMD_LOAD:
  ------------------
  |  |   39|    817|#define DYNAMIC_CMD_LOAD (ENGINE_CMD_BASE + 6)
  |  |  ------------------
  |  |  |  |  224|    817|#define ENGINE_CMD_BASE 200
  |  |  ------------------
  ------------------
  |  Branch (335:5): [True: 817, False: 3.26k]
  ------------------
  336|    817|        return dynamic_load(e, ctx);
  337|    817|    case DYNAMIC_CMD_DIR_LOAD:
  ------------------
  |  |   37|    817|#define DYNAMIC_CMD_DIR_LOAD (ENGINE_CMD_BASE + 4)
  |  |  ------------------
  |  |  |  |  224|    817|#define ENGINE_CMD_BASE 200
  |  |  ------------------
  ------------------
  |  Branch (337:5): [True: 817, False: 3.26k]
  ------------------
  338|    817|        if ((i < 0) || (i > 2)) {
  ------------------
  |  Branch (338:13): [True: 0, False: 817]
  |  Branch (338:24): [True: 0, False: 817]
  ------------------
  339|      0|            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  340|      0|            return 0;
  341|      0|        }
  342|    817|        ctx->dir_load = (int)i;
  343|    817|        return 1;
  344|    817|    case DYNAMIC_CMD_DIR_ADD:
  ------------------
  |  |   38|    817|#define DYNAMIC_CMD_DIR_ADD (ENGINE_CMD_BASE + 5)
  |  |  ------------------
  |  |  |  |  224|    817|#define ENGINE_CMD_BASE 200
  |  |  ------------------
  ------------------
  |  Branch (344:5): [True: 817, False: 3.26k]
  ------------------
  345|       |        /* a NULL 'p' or a string of zero-length is the same thing */
  346|    817|        if (p == NULL || (strlen((const char *)p) < 1)) {
  ------------------
  |  Branch (346:13): [True: 0, False: 817]
  |  Branch (346:26): [True: 0, False: 817]
  ------------------
  347|      0|            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  348|      0|            return 0;
  349|      0|        }
  350|    817|        {
  351|    817|            char *tmp_str = OPENSSL_strdup(p);
  ------------------
  |  |  135|    817|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  352|    817|            if (tmp_str == NULL)
  ------------------
  |  Branch (352:17): [True: 0, False: 817]
  ------------------
  353|      0|                return 0;
  354|    817|            if (!sk_OPENSSL_STRING_push(ctx->dirs, tmp_str)) {
  ------------------
  |  |  242|    817|#define sk_OPENSSL_STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_type(ptr))
  ------------------
  |  Branch (354:17): [True: 0, False: 817]
  ------------------
  355|      0|                OPENSSL_free(tmp_str);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  356|      0|                ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  357|      0|                return 0;
  358|      0|            }
  359|    817|        }
  360|    817|        return 1;
  361|      0|    default:
  ------------------
  |  Branch (361:5): [True: 0, False: 4.08k]
  ------------------
  362|      0|        break;
  363|  4.08k|    }
  364|  4.08k|    ERR_raise(ERR_LIB_ENGINE, ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  365|      0|    return 0;
  366|  4.08k|}
eng_dyn.c:dynamic_get_data_ctx:
  202|  4.08k|{
  203|  4.08k|    dynamic_data_ctx *ctx;
  204|  4.08k|    if (dynamic_ex_data_idx < 0) {
  ------------------
  |  Branch (204:9): [True: 1, False: 4.08k]
  ------------------
  205|       |        /*
  206|       |         * Create and register the ENGINE ex_data, and associate our "free"
  207|       |         * function with it to ensure any allocated contexts get freed when
  208|       |         * an ENGINE goes underground.
  209|       |         */
  210|      1|        int new_idx = ENGINE_get_ex_new_index(0, NULL, NULL, NULL,
  ------------------
  |  |  531|      1|    CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_ENGINE, l, p, newf, dupf, freef)
  |  |  ------------------
  |  |  |  |  260|      1|#define CRYPTO_EX_INDEX_ENGINE 10
  |  |  ------------------
  ------------------
  211|      1|            dynamic_data_ctx_free_func);
  212|      1|        if (new_idx == -1) {
  ------------------
  |  Branch (212:13): [True: 0, False: 1]
  ------------------
  213|      0|            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_NO_INDEX);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  214|      0|            return NULL;
  215|      0|        }
  216|      1|        if (!CRYPTO_THREAD_write_lock(global_engine_lock))
  ------------------
  |  Branch (216:13): [True: 0, False: 1]
  ------------------
  217|      0|            return NULL;
  218|       |        /* Avoid a race by checking again inside this lock */
  219|      1|        if (dynamic_ex_data_idx < 0) {
  ------------------
  |  Branch (219:13): [True: 1, False: 0]
  ------------------
  220|       |            /* Good, someone didn't beat us to it */
  221|      1|            dynamic_ex_data_idx = new_idx;
  222|      1|            new_idx = -1;
  223|      1|        }
  224|      1|        CRYPTO_THREAD_unlock(global_engine_lock);
  225|       |        /*
  226|       |         * In theory we could "give back" the index here if (new_idx>-1), but
  227|       |         * it's not possible and wouldn't gain us much if it were.
  228|       |         */
  229|      1|    }
  230|  4.08k|    ctx = (dynamic_data_ctx *)ENGINE_get_ex_data(e, dynamic_ex_data_idx);
  231|       |    /* Check if the context needs to be created */
  232|  4.08k|    if ((ctx == NULL) && !dynamic_set_data_ctx(e, &ctx))
  ------------------
  |  Branch (232:9): [True: 817, False: 3.26k]
  |  Branch (232:26): [True: 0, False: 817]
  ------------------
  233|       |        /* "set_data" will set errors if necessary */
  234|      0|        return NULL;
  235|  4.08k|    return ctx;
  236|  4.08k|}
eng_dyn.c:dynamic_data_ctx_free_func:
  140|    823|{
  141|    823|    if (ptr) {
  ------------------
  |  Branch (141:9): [True: 817, False: 6]
  ------------------
  142|    817|        dynamic_data_ctx *ctx = (dynamic_data_ctx *)ptr;
  143|    817|        DSO_free(ctx->dynamic_dso);
  144|    817|        OPENSSL_free(ctx->DYNAMIC_LIBNAME);
  ------------------
  |  |  131|    817|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  145|    817|        OPENSSL_free(ctx->engine_id);
  ------------------
  |  |  131|    817|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  146|    817|        sk_OPENSSL_STRING_pop_free(ctx->dirs, int_free_str);
  ------------------
  |  |  246|    817|#define sk_OPENSSL_STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_freefunc_type(freefunc))
  ------------------
  147|    817|        OPENSSL_free(ctx);
  ------------------
  |  |  131|    817|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  148|    817|    }
  149|    823|}
eng_dyn.c:int_free_str:
  124|    817|{
  125|    817|    OPENSSL_free(s);
  ------------------
  |  |  131|    817|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  126|    817|}
eng_dyn.c:dynamic_set_data_ctx:
  158|    817|{
  159|    817|    dynamic_data_ctx *c = OPENSSL_zalloc(sizeof(*c));
  ------------------
  |  |  108|    817|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  160|    817|    int ret = 0;
  161|       |
  162|    817|    if (c == NULL)
  ------------------
  |  Branch (162:9): [True: 0, False: 817]
  ------------------
  163|      0|        return 0;
  164|    817|    c->dirs = sk_OPENSSL_STRING_new_null();
  ------------------
  |  |  235|    817|#define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new_null())
  ------------------
  165|    817|    if (c->dirs == NULL) {
  ------------------
  |  Branch (165:9): [True: 0, False: 817]
  ------------------
  166|      0|        ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  167|      0|        goto end;
  168|      0|    }
  169|    817|    c->DYNAMIC_F1 = "v_check";
  170|    817|    c->DYNAMIC_F2 = "bind_engine";
  171|    817|    c->dir_load = 1;
  172|    817|    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
  ------------------
  |  Branch (172:9): [True: 0, False: 817]
  ------------------
  173|      0|        goto end;
  174|    817|    if ((*ctx = (dynamic_data_ctx *)ENGINE_get_ex_data(e,
  ------------------
  |  Branch (174:9): [True: 817, False: 0]
  ------------------
  175|    817|             dynamic_ex_data_idx))
  176|    817|        == NULL) {
  177|       |        /* Good, we're the first */
  178|    817|        ret = ENGINE_set_ex_data(e, dynamic_ex_data_idx, c);
  179|    817|        if (ret) {
  ------------------
  |  Branch (179:13): [True: 817, False: 0]
  ------------------
  180|    817|            *ctx = c;
  181|    817|            c = NULL;
  182|    817|        }
  183|    817|    }
  184|    817|    CRYPTO_THREAD_unlock(global_engine_lock);
  185|    817|    ret = 1;
  186|       |    /*
  187|       |     * If we lost the race to set the context, c is non-NULL and *ctx is the
  188|       |     * context of the thread that won.
  189|       |     */
  190|    817|end:
  191|    817|    if (c != NULL)
  ------------------
  |  Branch (191:9): [True: 0, False: 817]
  ------------------
  192|      0|        sk_OPENSSL_STRING_free(c->dirs);
  ------------------
  |  |  238|      0|#define sk_OPENSSL_STRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_STRING_sk_type(sk))
  ------------------
  193|    817|    OPENSSL_free(c);
  ------------------
  |  |  131|    817|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  194|    817|    return ret;
  195|    817|}
eng_dyn.c:dynamic_load:
  413|    817|{
  414|    817|    ENGINE cpy;
  415|    817|    dynamic_fns fns;
  416|       |
  417|    817|    if (ctx->dynamic_dso == NULL)
  ------------------
  |  Branch (417:9): [True: 817, False: 0]
  ------------------
  418|    817|        ctx->dynamic_dso = DSO_new();
  419|    817|    if (ctx->dynamic_dso == NULL)
  ------------------
  |  Branch (419:9): [True: 0, False: 817]
  ------------------
  420|      0|        return 0;
  421|    817|    if (!ctx->DYNAMIC_LIBNAME) {
  ------------------
  |  Branch (421:9): [True: 817, False: 0]
  ------------------
  422|    817|        if (!ctx->engine_id)
  ------------------
  |  Branch (422:13): [True: 0, False: 817]
  ------------------
  423|      0|            return 0;
  424|    817|        DSO_ctrl(ctx->dynamic_dso, DSO_CTRL_SET_FLAGS,
  ------------------
  |  |   19|    817|#define DSO_CTRL_SET_FLAGS 2
  ------------------
  425|    817|            DSO_FLAG_NAME_TRANSLATION_EXT_ONLY, NULL);
  ------------------
  |  |   41|    817|#define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY 0x02
  ------------------
  426|    817|        ctx->DYNAMIC_LIBNAME = DSO_convert_filename(ctx->dynamic_dso, ctx->engine_id);
  427|    817|    }
  428|    817|    if (!int_load(ctx)) {
  ------------------
  |  Branch (428:9): [True: 817, False: 0]
  ------------------
  429|    817|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_DSO_NOT_FOUND);
  ------------------
  |  |  404|    817|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|    817|    (ERR_new(),                                                  \
  |  |  |  |  407|    817|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|    817|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|    817|        ERR_set_error)
  |  |  ------------------
  ------------------
  430|    817|        DSO_free(ctx->dynamic_dso);
  431|    817|        ctx->dynamic_dso = NULL;
  432|    817|        return 0;
  433|    817|    }
  434|       |    /* We have to find a bind function otherwise it'll always end badly */
  435|      0|    if (!(ctx->bind_engine = (dynamic_bind_engine)DSO_bind_func(ctx->dynamic_dso,
  ------------------
  |  Branch (435:9): [True: 0, False: 0]
  ------------------
  436|      0|              ctx->DYNAMIC_F2))) {
  437|      0|        ctx->bind_engine = NULL;
  438|      0|        DSO_free(ctx->dynamic_dso);
  439|      0|        ctx->dynamic_dso = NULL;
  440|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_DSO_FAILURE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  441|      0|        return 0;
  442|      0|    }
  443|       |    /* Do we perform version checking? */
  444|      0|    if (!ctx->no_vcheck) {
  ------------------
  |  Branch (444:9): [True: 0, False: 0]
  ------------------
  445|      0|        unsigned long vcheck_res = 0;
  446|       |        /*
  447|       |         * Now we try to find a version checking function and decide how to
  448|       |         * cope with failure if/when it fails.
  449|       |         */
  450|      0|        ctx->v_check = (dynamic_v_check_fn)DSO_bind_func(ctx->dynamic_dso,
  451|      0|            ctx->DYNAMIC_F1);
  452|      0|        if (ctx->v_check)
  ------------------
  |  Branch (452:13): [True: 0, False: 0]
  ------------------
  453|      0|            vcheck_res = ctx->v_check(OSSL_DYNAMIC_VERSION);
  ------------------
  |  |  722|      0|#define OSSL_DYNAMIC_VERSION (unsigned long)0x00030000
  ------------------
  454|       |        /*
  455|       |         * We fail if the version checker veto'd the load *or* if it is
  456|       |         * deferring to us (by returning its version) and we think it is too
  457|       |         * old. Also fail if this is engine for openssl 1.1.x.
  458|       |         */
  459|      0|        if (vcheck_res < OSSL_DYNAMIC_OLDEST || using_libcrypto_11(ctx)) {
  ------------------
  |  |  727|      0|#define OSSL_DYNAMIC_OLDEST (unsigned long)0x00030000
  ------------------
  |  Branch (459:13): [True: 0, False: 0]
  |  Branch (459:49): [True: 0, False: 0]
  ------------------
  460|       |            /* Fail */
  461|      0|            ctx->bind_engine = NULL;
  462|      0|            ctx->v_check = NULL;
  463|      0|            DSO_free(ctx->dynamic_dso);
  464|      0|            ctx->dynamic_dso = NULL;
  465|      0|            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_VERSION_INCOMPATIBILITY);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  466|      0|            return 0;
  467|      0|        }
  468|      0|    }
  469|       |    /*
  470|       |     * First binary copy the ENGINE structure so that we can roll back if the
  471|       |     * hand-over fails
  472|       |     */
  473|      0|    memcpy(&cpy, e, sizeof(ENGINE));
  474|       |    /*
  475|       |     * Provide the ERR, "ex_data", memory, and locking callbacks so the
  476|       |     * loaded library uses our state rather than its own. FIXME: As noted in
  477|       |     * engine.h, much of this would be simplified if each area of code
  478|       |     * provided its own "summary" structure of all related callbacks. It
  479|       |     * would also increase opaqueness.
  480|       |     */
  481|      0|    fns.static_state = ENGINE_get_static_state();
  482|      0|    CRYPTO_get_mem_functions(&fns.mem_fns.malloc_fn, &fns.mem_fns.realloc_fn,
  483|      0|        &fns.mem_fns.free_fn);
  484|       |    /*
  485|       |     * Now that we've loaded the dynamic engine, make sure no "dynamic"
  486|       |     * ENGINE elements will show through.
  487|       |     */
  488|      0|    engine_set_all_null(e);
  489|       |
  490|       |    /* Try to bind the ENGINE onto our own ENGINE structure */
  491|      0|    if (!engine_add_dynamic_id(e, (ENGINE_DYNAMIC_ID)ctx->bind_engine, 1)
  ------------------
  |  Branch (491:9): [True: 0, False: 0]
  ------------------
  492|      0|        || !ctx->bind_engine(e, ctx->engine_id, &fns)) {
  ------------------
  |  Branch (492:12): [True: 0, False: 0]
  ------------------
  493|      0|        engine_remove_dynamic_id(e, 1);
  494|      0|        ctx->bind_engine = NULL;
  495|      0|        ctx->v_check = NULL;
  496|      0|        DSO_free(ctx->dynamic_dso);
  497|      0|        ctx->dynamic_dso = NULL;
  498|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INIT_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  499|       |        /* Copy the original ENGINE structure back */
  500|      0|        memcpy(e, &cpy, sizeof(ENGINE));
  501|      0|        return 0;
  502|      0|    }
  503|       |    /* Do we try to add this ENGINE to the internal list too? */
  504|      0|    if (ctx->list_add_value > 0) {
  ------------------
  |  Branch (504:9): [True: 0, False: 0]
  ------------------
  505|      0|        if (!ENGINE_add(e)) {
  ------------------
  |  Branch (505:13): [True: 0, False: 0]
  ------------------
  506|       |            /* Do we tolerate this or fail? */
  507|      0|            if (ctx->list_add_value > 1) {
  ------------------
  |  Branch (507:17): [True: 0, False: 0]
  ------------------
  508|       |                /*
  509|       |                 * Fail - NB: By this time, it's too late to rollback, and
  510|       |                 * trying to do so allows the bind_engine() code to have
  511|       |                 * created leaks. We just have to fail where we are, after
  512|       |                 * the ENGINE has changed.
  513|       |                 */
  514|      0|                ERR_raise(ERR_LIB_ENGINE, ENGINE_R_CONFLICTING_ENGINE_ID);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  515|      0|                return 0;
  516|      0|            }
  517|       |            /* Tolerate */
  518|      0|            ERR_clear_error();
  519|      0|        }
  520|      0|    }
  521|      0|    return 1;
  522|      0|}
eng_dyn.c:int_load:
  369|    817|{
  370|    817|    int num, loop;
  371|       |    /* Unless told not to, try a direct load */
  372|    817|    if ((ctx->dir_load != 2) && (DSO_load(ctx->dynamic_dso, ctx->DYNAMIC_LIBNAME, NULL, 0)) != NULL)
  ------------------
  |  Branch (372:9): [True: 0, False: 817]
  |  Branch (372:33): [True: 0, False: 0]
  ------------------
  373|      0|        return 1;
  374|       |    /* If we're not allowed to use 'dirs' or we have none, fail */
  375|    817|    if (!ctx->dir_load || (num = sk_OPENSSL_STRING_num(ctx->dirs)) < 1)
  ------------------
  |  |  232|    817|#define sk_OPENSSL_STRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_STRING_sk_type(sk))
  ------------------
  |  Branch (375:9): [True: 0, False: 817]
  |  Branch (375:27): [True: 0, False: 817]
  ------------------
  376|      0|        return 0;
  377|  1.63k|    for (loop = 0; loop < num; loop++) {
  ------------------
  |  Branch (377:20): [True: 817, False: 817]
  ------------------
  378|    817|        const char *s = sk_OPENSSL_STRING_value(ctx->dirs, loop);
  ------------------
  |  |  233|    817|#define sk_OPENSSL_STRING_value(sk, idx) ((char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_STRING_sk_type(sk), (idx)))
  ------------------
  379|    817|        char *merge = DSO_merge(ctx->dynamic_dso, ctx->DYNAMIC_LIBNAME, s);
  380|    817|        if (!merge)
  ------------------
  |  Branch (380:13): [True: 0, False: 817]
  ------------------
  381|      0|            return 0;
  382|    817|        if (DSO_load(ctx->dynamic_dso, merge, NULL, 0)) {
  ------------------
  |  Branch (382:13): [True: 0, False: 817]
  ------------------
  383|       |            /* Found what we're looking for */
  384|      0|            OPENSSL_free(merge);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  385|      0|            return 1;
  386|      0|        }
  387|    817|        OPENSSL_free(merge);
  ------------------
  |  |  131|    817|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  388|    817|    }
  389|    817|    return 0;
  390|    817|}

ossl_err_load_ENGINE_strings:
   85|      1|{
   86|      1|#ifndef OPENSSL_NO_ERR
   87|      1|    if (ERR_reason_error_string(ENGINE_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (87:9): [True: 1, False: 0]
  ------------------
   88|      1|        ERR_load_strings_const(ENGINE_str_reasons);
   89|      1|#endif
   90|      1|    return 1;
   91|      1|}

ENGINE_set_default:
   18|      2|{
   19|      2|    if ((flags & ENGINE_METHOD_CIPHERS) && !ENGINE_set_default_ciphers(e))
  ------------------
  |  |   49|      2|#define ENGINE_METHOD_CIPHERS (unsigned int)0x0040
  ------------------
  |  Branch (19:9): [True: 2, False: 0]
  |  Branch (19:44): [True: 0, False: 2]
  ------------------
   20|      0|        return 0;
   21|      2|    if ((flags & ENGINE_METHOD_DIGESTS) && !ENGINE_set_default_digests(e))
  ------------------
  |  |   50|      2|#define ENGINE_METHOD_DIGESTS (unsigned int)0x0080
  ------------------
  |  Branch (21:9): [True: 2, False: 0]
  |  Branch (21:44): [True: 0, False: 2]
  ------------------
   22|      0|        return 0;
   23|      2|    if ((flags & ENGINE_METHOD_RSA) && !ENGINE_set_default_RSA(e))
  ------------------
  |  |   45|      2|#define ENGINE_METHOD_RSA (unsigned int)0x0001
  ------------------
  |  Branch (23:9): [True: 2, False: 0]
  |  Branch (23:40): [True: 0, False: 2]
  ------------------
   24|      0|        return 0;
   25|      2|#ifndef OPENSSL_NO_DSA
   26|      2|    if ((flags & ENGINE_METHOD_DSA) && !ENGINE_set_default_DSA(e))
  ------------------
  |  |   46|      2|#define ENGINE_METHOD_DSA (unsigned int)0x0002
  ------------------
  |  Branch (26:9): [True: 2, False: 0]
  |  Branch (26:40): [True: 0, False: 2]
  ------------------
   27|      0|        return 0;
   28|      2|#endif
   29|      2|#ifndef OPENSSL_NO_DH
   30|      2|    if ((flags & ENGINE_METHOD_DH) && !ENGINE_set_default_DH(e))
  ------------------
  |  |   47|      2|#define ENGINE_METHOD_DH (unsigned int)0x0004
  ------------------
  |  Branch (30:9): [True: 2, False: 0]
  |  Branch (30:39): [True: 0, False: 2]
  ------------------
   31|      0|        return 0;
   32|      2|#endif
   33|      2|#ifndef OPENSSL_NO_EC
   34|      2|    if ((flags & ENGINE_METHOD_EC) && !ENGINE_set_default_EC(e))
  ------------------
  |  |   53|      2|#define ENGINE_METHOD_EC (unsigned int)0x0800
  ------------------
  |  Branch (34:9): [True: 2, False: 0]
  |  Branch (34:39): [True: 0, False: 2]
  ------------------
   35|      0|        return 0;
   36|      2|#endif
   37|      2|    if ((flags & ENGINE_METHOD_RAND) && !ENGINE_set_default_RAND(e))
  ------------------
  |  |   48|      2|#define ENGINE_METHOD_RAND (unsigned int)0x0008
  ------------------
  |  Branch (37:9): [True: 2, False: 0]
  |  Branch (37:41): [True: 0, False: 2]
  ------------------
   38|      0|        return 0;
   39|      2|    if ((flags & ENGINE_METHOD_PKEY_METHS)
  ------------------
  |  |   51|      2|#define ENGINE_METHOD_PKEY_METHS (unsigned int)0x0200
  ------------------
  |  Branch (39:9): [True: 2, False: 0]
  ------------------
   40|      2|        && !ENGINE_set_default_pkey_meths(e))
  ------------------
  |  Branch (40:12): [True: 0, False: 2]
  ------------------
   41|      0|        return 0;
   42|      2|    if ((flags & ENGINE_METHOD_PKEY_ASN1_METHS)
  ------------------
  |  |   52|      2|#define ENGINE_METHOD_PKEY_ASN1_METHS (unsigned int)0x0400
  ------------------
  |  Branch (42:9): [True: 2, False: 0]
  ------------------
   43|      2|        && !ENGINE_set_default_pkey_asn1_meths(e))
  ------------------
  |  Branch (43:12): [True: 0, False: 2]
  ------------------
   44|      0|        return 0;
   45|      2|    return 1;
   46|      2|}
ENGINE_register_complete:
   94|      2|{
   95|      2|    ENGINE_register_ciphers(e);
   96|      2|    ENGINE_register_digests(e);
   97|      2|    ENGINE_register_RSA(e);
   98|      2|#ifndef OPENSSL_NO_DSA
   99|      2|    ENGINE_register_DSA(e);
  100|      2|#endif
  101|      2|#ifndef OPENSSL_NO_DH
  102|      2|    ENGINE_register_DH(e);
  103|      2|#endif
  104|      2|#ifndef OPENSSL_NO_EC
  105|      2|    ENGINE_register_EC(e);
  106|      2|#endif
  107|      2|    ENGINE_register_RAND(e);
  108|      2|    ENGINE_register_pkey_meths(e);
  109|      2|    ENGINE_register_pkey_asn1_meths(e);
  110|      2|    return 1;
  111|      2|}
ENGINE_register_all_complete:
  114|      1|{
  115|      1|    ENGINE *e;
  116|       |
  117|      4|    for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e))
  ------------------
  |  Branch (117:34): [True: 3, False: 1]
  ------------------
  118|      3|        if (!(e->flags & ENGINE_FLAGS_NO_REGISTER_ALL))
  ------------------
  |  |   96|      3|#define ENGINE_FLAGS_NO_REGISTER_ALL (int)0x0008
  ------------------
  |  Branch (118:13): [True: 2, False: 1]
  ------------------
  119|      2|            ENGINE_register_complete(e);
  120|      1|    return 1;
  121|      1|}

engine_unlocked_init:
   21|      9|{
   22|      9|    int to_return = 1;
   23|       |
   24|      9|    if ((e->funct_ref == 0) && e->init)
  ------------------
  |  Branch (24:9): [True: 6, False: 3]
  |  Branch (24:32): [True: 6, False: 0]
  ------------------
   25|       |        /*
   26|       |         * This is the first functional reference and the engine requires
   27|       |         * initialisation so we do it now.
   28|       |         */
   29|      6|        to_return = e->init(e);
   30|      9|    if (to_return) {
  ------------------
  |  Branch (30:9): [True: 5, False: 4]
  ------------------
   31|      5|        int ref;
   32|       |
   33|       |        /*
   34|       |         * OK, we return a functional reference which is also a structural
   35|       |         * reference.
   36|       |         */
   37|      5|        if (!CRYPTO_UP_REF(&e->struct_ref, &ref)) {
  ------------------
  |  Branch (37:13): [True: 0, False: 5]
  ------------------
   38|      0|            e->finish(e);
   39|      0|            return 0;
   40|      0|        }
   41|      5|        e->funct_ref++;
   42|      5|        ENGINE_REF_PRINT(e, 0, 1);
  ------------------
  |  |   29|      5|    OSSL_TRACE6(ENGINE_REF_COUNT,                         \
  |  |  ------------------
  |  |  |  |  303|      5|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6))
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|      5|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      5|        "engine: %p %s from %d to %d (%s:%d)\n",          \
  |  |   31|      5|        (void *)(e), (isfunct ? "funct" : "struct"),      \
  |  |   32|      5|        ((isfunct)                                        \
  |  |   33|      5|                ? ((e)->funct_ref - (diff))               \
  |  |   34|      5|                : (eng_struct_ref(e) - (diff))),          \
  |  |   35|      5|        ((isfunct) ? (e)->funct_ref : eng_struct_ref(e)), \
  |  |   36|      5|        (OPENSSL_FILE), (OPENSSL_LINE))
  ------------------
   43|      5|        ENGINE_REF_PRINT(e, 1, 1);
  ------------------
  |  |   29|      5|    OSSL_TRACE6(ENGINE_REF_COUNT,                         \
  |  |  ------------------
  |  |  |  |  303|      5|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6))
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|      5|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      5|        "engine: %p %s from %d to %d (%s:%d)\n",          \
  |  |   31|      5|        (void *)(e), (isfunct ? "funct" : "struct"),      \
  |  |   32|      5|        ((isfunct)                                        \
  |  |   33|      5|                ? ((e)->funct_ref - (diff))               \
  |  |   34|      5|                : (eng_struct_ref(e) - (diff))),          \
  |  |   35|      5|        ((isfunct) ? (e)->funct_ref : eng_struct_ref(e)), \
  |  |   36|      5|        (OPENSSL_FILE), (OPENSSL_LINE))
  ------------------
   44|      5|    }
   45|      9|    return to_return;
   46|      9|}
engine_unlocked_finish:
   53|      5|{
   54|      5|    int to_return = 1;
   55|       |
   56|       |    /*
   57|       |     * Reduce the functional reference count here so if it's the terminating
   58|       |     * case, we can release the lock safely and call the finish() handler
   59|       |     * without risk of a race. We get a race if we leave the count until
   60|       |     * after and something else is calling "finish" at the same time -
   61|       |     * there's a chance that both threads will together take the count from 2
   62|       |     * to 0 without either calling finish().
   63|       |     */
   64|      5|    e->funct_ref--;
   65|      5|    ENGINE_REF_PRINT(e, 1, -1);
  ------------------
  |  |   29|      5|    OSSL_TRACE6(ENGINE_REF_COUNT,                         \
  |  |  ------------------
  |  |  |  |  303|      5|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6))
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|      5|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      5|        "engine: %p %s from %d to %d (%s:%d)\n",          \
  |  |   31|      5|        (void *)(e), (isfunct ? "funct" : "struct"),      \
  |  |   32|      5|        ((isfunct)                                        \
  |  |   33|      5|                ? ((e)->funct_ref - (diff))               \
  |  |   34|      5|                : (eng_struct_ref(e) - (diff))),          \
  |  |   35|      5|        ((isfunct) ? (e)->funct_ref : eng_struct_ref(e)), \
  |  |   36|      5|        (OPENSSL_FILE), (OPENSSL_LINE))
  ------------------
   66|      5|    if ((e->funct_ref == 0) && e->finish) {
  ------------------
  |  Branch (66:9): [True: 2, False: 3]
  |  Branch (66:32): [True: 0, False: 2]
  ------------------
   67|      0|        if (unlock_for_handlers)
  ------------------
  |  Branch (67:13): [True: 0, False: 0]
  ------------------
   68|      0|            CRYPTO_THREAD_unlock(global_engine_lock);
   69|      0|        to_return = e->finish(e);
   70|      0|        if (unlock_for_handlers)
  ------------------
  |  Branch (70:13): [True: 0, False: 0]
  ------------------
   71|      0|            if (!CRYPTO_THREAD_write_lock(global_engine_lock))
  ------------------
  |  Branch (71:17): [True: 0, False: 0]
  ------------------
   72|      0|                return 0;
   73|      0|        if (!to_return)
  ------------------
  |  Branch (73:13): [True: 0, False: 0]
  ------------------
   74|      0|            return 0;
   75|      0|    }
   76|      5|    REF_ASSERT_ISNT(e->funct_ref < 0);
  ------------------
  |  |  293|      5|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 5]
  |  |  ------------------
  ------------------
   77|       |    /* Release the structural reference too */
   78|      5|    if (!engine_free_util(e, 0)) {
  ------------------
  |  Branch (78:9): [True: 0, False: 5]
  ------------------
   79|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_FINISH_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   80|      0|        return 0;
   81|      0|    }
   82|      5|    return to_return;
   83|      5|}
ENGINE_init:
   87|      7|{
   88|      7|    int ret;
   89|      7|    if (e == NULL) {
  ------------------
  |  Branch (89:9): [True: 0, False: 7]
  ------------------
   90|      0|        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   91|      0|        return 0;
   92|      0|    }
   93|      7|    if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
  ------------------
  |  |  130|      7|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 7, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (93:9): [True: 0, False: 7]
  ------------------
   94|       |        /* Maybe this should be raised in do_engine_lock_init() */
   95|      0|        ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   96|      0|        return 0;
   97|      0|    }
   98|      7|    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
  ------------------
  |  Branch (98:9): [True: 0, False: 7]
  ------------------
   99|      0|        return 0;
  100|      7|    ret = engine_unlocked_init(e);
  101|      7|    CRYPTO_THREAD_unlock(global_engine_lock);
  102|      7|    return ret;
  103|      7|}
ENGINE_finish:
  107|  7.63M|{
  108|  7.63M|    int to_return = 1;
  109|       |
  110|  7.63M|    if (e == NULL)
  ------------------
  |  Branch (110:9): [True: 7.63M, False: 3]
  ------------------
  111|  7.63M|        return 1;
  112|      3|    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
  ------------------
  |  Branch (112:9): [True: 0, False: 3]
  ------------------
  113|      0|        return 0;
  114|      3|    to_return = engine_unlocked_finish(e, 1);
  115|      3|    CRYPTO_THREAD_unlock(global_engine_lock);
  116|      3|    if (!to_return) {
  ------------------
  |  Branch (116:9): [True: 0, False: 3]
  ------------------
  117|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_FINISH_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  118|      0|        return 0;
  119|      0|    }
  120|      3|    return to_return;
  121|      3|}

ENGINE_new:
   28|    823|{
   29|    823|    ENGINE *ret;
   30|       |
   31|    823|    if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
  ------------------
  |  |  130|    823|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 823, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (31:9): [True: 0, False: 823]
  ------------------
   32|       |        /* Maybe this should be raised in do_engine_lock_init() */
   33|      0|        ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   34|      0|        return 0;
   35|      0|    }
   36|    823|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  108|    823|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (36:9): [True: 0, False: 823]
  ------------------
   37|      0|        return NULL;
   38|    823|    if (!CRYPTO_NEW_REF(&ret->struct_ref, 1)) {
  ------------------
  |  Branch (38:9): [True: 0, False: 823]
  ------------------
   39|      0|        OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|      0|        return NULL;
   41|      0|    }
   42|    823|    ENGINE_REF_PRINT(ret, 0, 1);
  ------------------
  |  |   29|    823|    OSSL_TRACE6(ENGINE_REF_COUNT,                         \
  |  |  ------------------
  |  |  |  |  303|    823|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6))
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|    823|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|    823|        "engine: %p %s from %d to %d (%s:%d)\n",          \
  |  |   31|    823|        (void *)(e), (isfunct ? "funct" : "struct"),      \
  |  |   32|    823|        ((isfunct)                                        \
  |  |   33|    823|                ? ((e)->funct_ref - (diff))               \
  |  |   34|    823|                : (eng_struct_ref(e) - (diff))),          \
  |  |   35|    823|        ((isfunct) ? (e)->funct_ref : eng_struct_ref(e)), \
  |  |   36|    823|        (OPENSSL_FILE), (OPENSSL_LINE))
  ------------------
   43|    823|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_ENGINE, ret, &ret->ex_data)) {
  ------------------
  |  |  260|    823|#define CRYPTO_EX_INDEX_ENGINE 10
  ------------------
  |  Branch (43:9): [True: 0, False: 823]
  ------------------
   44|      0|        CRYPTO_FREE_REF(&ret->struct_ref);
   45|      0|        OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   46|      0|        return NULL;
   47|      0|    }
   48|    823|    return ret;
   49|    823|}
engine_free_util:
   78|    838|{
   79|    838|    int i;
   80|       |
   81|    838|    if (e == NULL)
  ------------------
  |  Branch (81:9): [True: 0, False: 838]
  ------------------
   82|      0|        return 1;
   83|    838|    CRYPTO_DOWN_REF(&e->struct_ref, &i);
   84|    838|    ENGINE_REF_PRINT(e, 0, -1);
  ------------------
  |  |   29|    838|    OSSL_TRACE6(ENGINE_REF_COUNT,                         \
  |  |  ------------------
  |  |  |  |  303|    838|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6))
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|    838|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|    838|        "engine: %p %s from %d to %d (%s:%d)\n",          \
  |  |   31|    838|        (void *)(e), (isfunct ? "funct" : "struct"),      \
  |  |   32|    838|        ((isfunct)                                        \
  |  |   33|    838|                ? ((e)->funct_ref - (diff))               \
  |  |   34|    838|                : (eng_struct_ref(e) - (diff))),          \
  |  |   35|    838|        ((isfunct) ? (e)->funct_ref : eng_struct_ref(e)), \
  |  |   36|    838|        (OPENSSL_FILE), (OPENSSL_LINE))
  ------------------
   85|    838|    if (i > 0)
  ------------------
  |  Branch (85:9): [True: 15, False: 823]
  ------------------
   86|     15|        return 1;
   87|    823|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|    823|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 823]
  |  |  ------------------
  ------------------
   88|       |    /* Free up any dynamically allocated public key methods */
   89|    823|    engine_pkey_meths_free(e);
   90|    823|    engine_pkey_asn1_meths_free(e);
   91|       |    /*
   92|       |     * Give the ENGINE a chance to do any structural cleanup corresponding to
   93|       |     * allocation it did in its constructor (eg. unload error strings)
   94|       |     */
   95|    823|    if (e->destroy)
  ------------------
  |  Branch (95:9): [True: 0, False: 823]
  ------------------
   96|      0|        e->destroy(e);
   97|    823|    engine_remove_dynamic_id(e, not_locked);
   98|    823|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ENGINE, e, &e->ex_data);
  ------------------
  |  |  260|    823|#define CRYPTO_EX_INDEX_ENGINE 10
  ------------------
   99|    823|    CRYPTO_FREE_REF(&e->struct_ref);
  100|    823|    OPENSSL_free(e);
  ------------------
  |  |  131|    823|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  101|    823|    return 1;
  102|    838|}
ENGINE_free:
  105|    830|{
  106|    830|    return engine_free_util(e, 1);
  107|    830|}
engine_cleanup_add_first:
  139|      1|{
  140|      1|    ENGINE_CLEANUP_ITEM *item;
  141|       |
  142|      1|    if (!int_cleanup_check(1))
  ------------------
  |  Branch (142:9): [True: 0, False: 1]
  ------------------
  143|      0|        return 0;
  144|      1|    item = int_cleanup_item(cb);
  145|      1|    if (item != NULL) {
  ------------------
  |  Branch (145:9): [True: 1, False: 0]
  ------------------
  146|      1|        if (sk_ENGINE_CLEANUP_ITEM_insert(cleanup_stack, item, 0))
  ------------------
  |  Branch (146:13): [True: 1, False: 0]
  ------------------
  147|      1|            return 1;
  148|      0|        OPENSSL_free(item);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  149|      0|    }
  150|      0|    return 0;
  151|      1|}
engine_cleanup_add_last:
  154|      1|{
  155|      1|    ENGINE_CLEANUP_ITEM *item;
  156|       |
  157|      1|    if (!int_cleanup_check(1))
  ------------------
  |  Branch (157:9): [True: 0, False: 1]
  ------------------
  158|      0|        return 0;
  159|      1|    item = int_cleanup_item(cb);
  160|      1|    if (item != NULL) {
  ------------------
  |  Branch (160:9): [True: 1, False: 0]
  ------------------
  161|      1|        if (sk_ENGINE_CLEANUP_ITEM_push(cleanup_stack, item) > 0)
  ------------------
  |  Branch (161:13): [True: 1, False: 0]
  ------------------
  162|      1|            return 1;
  163|      0|        OPENSSL_free(item);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  164|      0|    }
  165|      0|    return 0;
  166|      1|}
engine_cleanup_int:
  176|      1|{
  177|      1|    if (int_cleanup_check(0)) {
  ------------------
  |  Branch (177:9): [True: 1, False: 0]
  ------------------
  178|      1|        sk_ENGINE_CLEANUP_ITEM_pop_free(cleanup_stack,
  179|      1|            engine_cleanup_cb_free);
  180|      1|        cleanup_stack = NULL;
  181|      1|    }
  182|      1|    CRYPTO_THREAD_lock_free(global_engine_lock);
  183|       |    global_engine_lock = NULL;
  184|      1|}
ENGINE_set_ex_data:
  189|    817|{
  190|    817|    return CRYPTO_set_ex_data(&e->ex_data, idx, arg);
  191|    817|}
ENGINE_get_ex_data:
  194|  4.90k|{
  195|  4.90k|    return CRYPTO_get_ex_data(&e->ex_data, idx);
  196|  4.90k|}
ENGINE_set_id:
  204|      3|{
  205|      3|    if (id == NULL) {
  ------------------
  |  Branch (205:9): [True: 0, False: 3]
  ------------------
  206|      0|        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  207|      0|        return 0;
  208|      0|    }
  209|      3|    e->id = id;
  210|      3|    return 1;
  211|      3|}
ENGINE_set_name:
  214|      3|{
  215|      3|    if (name == NULL) {
  ------------------
  |  Branch (215:9): [True: 0, False: 3]
  ------------------
  216|      0|        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  217|      0|        return 0;
  218|      0|    }
  219|      3|    e->name = name;
  220|      3|    return 1;
  221|      3|}
ENGINE_set_init_function:
  230|      3|{
  231|      3|    e->init = init_f;
  232|      3|    return 1;
  233|      3|}
ENGINE_set_finish_function:
  236|      1|{
  237|      1|    e->finish = finish_f;
  238|      1|    return 1;
  239|      1|}
ENGINE_set_ctrl_function:
  242|      1|{
  243|      1|    e->ctrl = ctrl_f;
  244|      1|    return 1;
  245|      1|}
ENGINE_set_flags:
  248|      2|{
  249|      2|    e->flags = flags;
  250|      2|    return 1;
  251|      2|}
ENGINE_set_cmd_defns:
  254|      1|{
  255|      1|    e->cmd_defns = defns;
  256|      1|    return 1;
  257|      1|}
eng_lib.c:do_engine_lock_init:
   22|      1|{
   23|      1|    global_engine_lock = CRYPTO_THREAD_lock_new();
   24|       |    return global_engine_lock != NULL;
   25|      1|}
eng_lib.c:int_cleanup_check:
  119|      3|{
  120|      3|    if (cleanup_stack)
  ------------------
  |  Branch (120:9): [True: 2, False: 1]
  ------------------
  121|      2|        return 1;
  122|      1|    if (!create)
  ------------------
  |  Branch (122:9): [True: 0, False: 1]
  ------------------
  123|      0|        return 0;
  124|      1|    cleanup_stack = sk_ENGINE_CLEANUP_ITEM_new_null();
  125|      1|    return (cleanup_stack ? 1 : 0);
  ------------------
  |  Branch (125:13): [True: 1, False: 0]
  ------------------
  126|      1|}
eng_lib.c:int_cleanup_item:
  129|      2|{
  130|      2|    ENGINE_CLEANUP_ITEM *item;
  131|       |
  132|      2|    if ((item = OPENSSL_malloc(sizeof(*item))) == NULL)
  ------------------
  |  |  106|      2|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (132:9): [True: 0, False: 2]
  ------------------
  133|      0|        return NULL;
  134|      2|    item->cb = cb;
  135|      2|    return item;
  136|      2|}
eng_lib.c:engine_cleanup_cb_free:
  170|      2|{
  171|      2|    (*(item->cb))();
  172|      2|    OPENSSL_free(item);
  ------------------
  |  |  131|      2|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  173|      2|}

engine_add_dynamic_id:
  152|    820|{
  153|    820|    int result = 0;
  154|    820|    ENGINE *iterator = NULL;
  155|       |
  156|    820|    if (e == NULL)
  ------------------
  |  Branch (156:9): [True: 0, False: 820]
  ------------------
  157|      0|        return 0;
  158|       |
  159|    820|    if (e->dynamic_id == NULL && dynamic_id == NULL)
  ------------------
  |  Branch (159:9): [True: 820, False: 0]
  |  Branch (159:34): [True: 820, False: 0]
  ------------------
  160|    820|        return 0;
  161|       |
  162|      0|    if (not_locked && !CRYPTO_THREAD_write_lock(global_engine_lock))
  ------------------
  |  Branch (162:9): [True: 0, False: 0]
  |  Branch (162:23): [True: 0, False: 0]
  ------------------
  163|      0|        return 0;
  164|       |
  165|      0|    if (dynamic_id != NULL) {
  ------------------
  |  Branch (165:9): [True: 0, False: 0]
  ------------------
  166|      0|        iterator = engine_dyn_list_head;
  167|      0|        while (iterator != NULL) {
  ------------------
  |  Branch (167:16): [True: 0, False: 0]
  ------------------
  168|      0|            if (iterator->dynamic_id == dynamic_id)
  ------------------
  |  Branch (168:17): [True: 0, False: 0]
  ------------------
  169|      0|                goto err;
  170|      0|            iterator = iterator->next;
  171|      0|        }
  172|      0|        if (e->dynamic_id != NULL)
  ------------------
  |  Branch (172:13): [True: 0, False: 0]
  ------------------
  173|      0|            goto err;
  174|      0|        e->dynamic_id = dynamic_id;
  175|      0|    }
  176|       |
  177|      0|    if (engine_dyn_list_head == NULL) {
  ------------------
  |  Branch (177:9): [True: 0, False: 0]
  ------------------
  178|       |        /* We are adding to an empty list. */
  179|      0|        if (engine_dyn_list_tail != NULL)
  ------------------
  |  Branch (179:13): [True: 0, False: 0]
  ------------------
  180|      0|            goto err;
  181|      0|        engine_dyn_list_head = e;
  182|      0|        e->prev_dyn = NULL;
  183|      0|    } else {
  184|       |        /* We are adding to the tail of an existing list. */
  185|      0|        if (engine_dyn_list_tail == NULL
  ------------------
  |  Branch (185:13): [True: 0, False: 0]
  ------------------
  186|      0|            || engine_dyn_list_tail->next_dyn != NULL)
  ------------------
  |  Branch (186:16): [True: 0, False: 0]
  ------------------
  187|      0|            goto err;
  188|      0|        engine_dyn_list_tail->next_dyn = e;
  189|      0|        e->prev_dyn = engine_dyn_list_tail;
  190|      0|    }
  191|       |
  192|      0|    engine_dyn_list_tail = e;
  193|      0|    e->next_dyn = NULL;
  194|      0|    result = 1;
  195|       |
  196|      0|err:
  197|      0|    if (not_locked)
  ------------------
  |  Branch (197:9): [True: 0, False: 0]
  ------------------
  198|      0|        CRYPTO_THREAD_unlock(global_engine_lock);
  199|      0|    return result;
  200|      0|}
engine_remove_dynamic_id:
  204|    823|{
  205|    823|    if (e == NULL || e->dynamic_id == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 823]
  |  Branch (205:22): [True: 823, False: 0]
  ------------------
  206|    823|        return;
  207|       |
  208|      0|    if (not_locked && !CRYPTO_THREAD_write_lock(global_engine_lock))
  ------------------
  |  Branch (208:9): [True: 0, False: 0]
  |  Branch (208:23): [True: 0, False: 0]
  ------------------
  209|      0|        return;
  210|       |
  211|      0|    e->dynamic_id = NULL;
  212|       |
  213|       |    /* un-link e from the chain. */
  214|      0|    if (e->next_dyn != NULL)
  ------------------
  |  Branch (214:9): [True: 0, False: 0]
  ------------------
  215|      0|        e->next_dyn->prev_dyn = e->prev_dyn;
  216|      0|    if (e->prev_dyn != NULL)
  ------------------
  |  Branch (216:9): [True: 0, False: 0]
  ------------------
  217|      0|        e->prev_dyn->next_dyn = e->next_dyn;
  218|       |    /* Correct our head/tail if necessary. */
  219|      0|    if (engine_dyn_list_head == e)
  ------------------
  |  Branch (219:9): [True: 0, False: 0]
  ------------------
  220|      0|        engine_dyn_list_head = e->next_dyn;
  221|      0|    if (engine_dyn_list_tail == e)
  ------------------
  |  Branch (221:9): [True: 0, False: 0]
  ------------------
  222|      0|        engine_dyn_list_tail = e->prev_dyn;
  223|       |
  224|      0|    if (not_locked)
  ------------------
  |  Branch (224:9): [True: 0, False: 0]
  ------------------
  225|      0|        CRYPTO_THREAD_unlock(global_engine_lock);
  226|      0|}
ENGINE_get_first:
  230|      1|{
  231|      1|    ENGINE *ret;
  232|       |
  233|      1|    if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (233:9): [True: 0, False: 1]
  ------------------
  234|       |        /* Maybe this should be raised in do_engine_lock_init() */
  235|      0|        ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  236|      0|        return NULL;
  237|      0|    }
  238|       |
  239|      1|    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
  ------------------
  |  Branch (239:9): [True: 0, False: 1]
  ------------------
  240|      0|        return NULL;
  241|      1|    ret = engine_list_head;
  242|      1|    if (ret) {
  ------------------
  |  Branch (242:9): [True: 1, False: 0]
  ------------------
  243|      1|        int ref;
  244|       |
  245|      1|        if (!CRYPTO_UP_REF(&ret->struct_ref, &ref)) {
  ------------------
  |  Branch (245:13): [True: 0, False: 1]
  ------------------
  246|      0|            CRYPTO_THREAD_unlock(global_engine_lock);
  247|      0|            ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  248|      0|            return NULL;
  249|      0|        }
  250|      1|        ENGINE_REF_PRINT(ret, 0, 1);
  ------------------
  |  |   29|      1|    OSSL_TRACE6(ENGINE_REF_COUNT,                         \
  |  |  ------------------
  |  |  |  |  303|      1|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6))
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      1|        "engine: %p %s from %d to %d (%s:%d)\n",          \
  |  |   31|      1|        (void *)(e), (isfunct ? "funct" : "struct"),      \
  |  |   32|      1|        ((isfunct)                                        \
  |  |   33|      1|                ? ((e)->funct_ref - (diff))               \
  |  |   34|      1|                : (eng_struct_ref(e) - (diff))),          \
  |  |   35|      1|        ((isfunct) ? (e)->funct_ref : eng_struct_ref(e)), \
  |  |   36|      1|        (OPENSSL_FILE), (OPENSSL_LINE))
  ------------------
  251|      1|    }
  252|      1|    CRYPTO_THREAD_unlock(global_engine_lock);
  253|      1|    return ret;
  254|      1|}
ENGINE_get_next:
  285|      3|{
  286|      3|    ENGINE *ret = NULL;
  287|      3|    if (e == NULL) {
  ------------------
  |  Branch (287:9): [True: 0, False: 3]
  ------------------
  288|      0|        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  289|      0|        return NULL;
  290|      0|    }
  291|      3|    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
  ------------------
  |  Branch (291:9): [True: 0, False: 3]
  ------------------
  292|      0|        return NULL;
  293|      3|    ret = e->next;
  294|      3|    if (ret) {
  ------------------
  |  Branch (294:9): [True: 2, False: 1]
  ------------------
  295|      2|        int ref;
  296|       |
  297|       |        /* Return a valid structural reference to the next ENGINE */
  298|      2|        if (!CRYPTO_UP_REF(&ret->struct_ref, &ref)) {
  ------------------
  |  Branch (298:13): [True: 0, False: 2]
  ------------------
  299|      0|            CRYPTO_THREAD_unlock(global_engine_lock);
  300|      0|            ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  301|      0|            return NULL;
  302|      0|        }
  303|      2|        ENGINE_REF_PRINT(ret, 0, 1);
  ------------------
  |  |   29|      2|    OSSL_TRACE6(ENGINE_REF_COUNT,                         \
  |  |  ------------------
  |  |  |  |  303|      2|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6))
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|      2|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      2|        "engine: %p %s from %d to %d (%s:%d)\n",          \
  |  |   31|      2|        (void *)(e), (isfunct ? "funct" : "struct"),      \
  |  |   32|      2|        ((isfunct)                                        \
  |  |   33|      2|                ? ((e)->funct_ref - (diff))               \
  |  |   34|      2|                : (eng_struct_ref(e) - (diff))),          \
  |  |   35|      2|        ((isfunct) ? (e)->funct_ref : eng_struct_ref(e)), \
  |  |   36|      2|        (OPENSSL_FILE), (OPENSSL_LINE))
  ------------------
  304|      2|    }
  305|      3|    CRYPTO_THREAD_unlock(global_engine_lock);
  306|       |    /* Release the structural reference to the previous ENGINE */
  307|      3|    ENGINE_free(e);
  308|      3|    return ret;
  309|      3|}
ENGINE_add:
  340|      3|{
  341|      3|    int to_return = 1;
  342|      3|    if (e == NULL) {
  ------------------
  |  Branch (342:9): [True: 0, False: 3]
  ------------------
  343|      0|        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  344|      0|        return 0;
  345|      0|    }
  346|      3|    if ((e->id == NULL) || (e->name == NULL)) {
  ------------------
  |  Branch (346:9): [True: 0, False: 3]
  |  Branch (346:28): [True: 0, False: 3]
  ------------------
  347|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_ID_OR_NAME_MISSING);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  348|      0|        return 0;
  349|      0|    }
  350|      3|    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
  ------------------
  |  Branch (350:9): [True: 0, False: 3]
  ------------------
  351|      0|        return 0;
  352|      3|    if (!engine_list_add(e)) {
  ------------------
  |  Branch (352:9): [True: 0, False: 3]
  ------------------
  353|       |        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  354|      0|        to_return = 0;
  355|      0|    }
  356|      3|    CRYPTO_THREAD_unlock(global_engine_lock);
  357|      3|    return to_return;
  358|      3|}
ENGINE_remove:
  362|      3|{
  363|      3|    int to_return = 1;
  364|      3|    if (e == NULL) {
  ------------------
  |  Branch (364:9): [True: 0, False: 3]
  ------------------
  365|      0|        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  366|      0|        return 0;
  367|      0|    }
  368|      3|    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
  ------------------
  |  Branch (368:9): [True: 0, False: 3]
  ------------------
  369|      0|        return 0;
  370|      3|    if (!engine_list_remove(e)) {
  ------------------
  |  Branch (370:9): [True: 0, False: 3]
  ------------------
  371|       |        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  372|      0|        to_return = 0;
  373|      0|    }
  374|      3|    CRYPTO_THREAD_unlock(global_engine_lock);
  375|      3|    return to_return;
  376|      3|}
ENGINE_by_id:
  409|  1.64k|{
  410|  1.64k|    ENGINE *iterator;
  411|  1.64k|    const char *load_dir = NULL;
  412|  1.64k|    if (id == NULL) {
  ------------------
  |  Branch (412:9): [True: 0, False: 1.64k]
  ------------------
  413|      0|        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  414|      0|        return NULL;
  415|      0|    }
  416|  1.64k|    ENGINE_load_builtin_engines();
  417|       |
  418|  1.64k|    if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
  ------------------
  |  |  130|  1.64k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1.64k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (418:9): [True: 0, False: 1.64k]
  ------------------
  419|       |        /* Maybe this should be raised in do_engine_lock_init() */
  420|      0|        ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  421|      0|        return NULL;
  422|      0|    }
  423|       |
  424|  1.64k|    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
  ------------------
  |  Branch (424:9): [True: 0, False: 1.64k]
  ------------------
  425|      0|        return NULL;
  426|  1.64k|    iterator = engine_list_head;
  427|  4.91k|    while (iterator && (strcmp(id, iterator->id) != 0))
  ------------------
  |  Branch (427:12): [True: 4.09k, False: 817]
  |  Branch (427:24): [True: 3.27k, False: 824]
  ------------------
  428|  3.27k|        iterator = iterator->next;
  429|  1.64k|    if (iterator != NULL) {
  ------------------
  |  Branch (429:9): [True: 824, False: 817]
  ------------------
  430|       |        /*
  431|       |         * We need to return a structural reference. If this is an ENGINE
  432|       |         * type that returns copies, make a duplicate - otherwise increment
  433|       |         * the existing ENGINE's reference count.
  434|       |         */
  435|    824|        if (iterator->flags & ENGINE_FLAGS_BY_ID_COPY) {
  ------------------
  |  |   88|    824|#define ENGINE_FLAGS_BY_ID_COPY (int)0x0004
  ------------------
  |  Branch (435:13): [True: 820, False: 4]
  ------------------
  436|    820|            ENGINE *cp = ENGINE_new();
  437|    820|            if (cp == NULL)
  ------------------
  |  Branch (437:17): [True: 0, False: 820]
  ------------------
  438|      0|                iterator = NULL;
  439|    820|            else {
  440|    820|                engine_cpy(cp, iterator);
  441|    820|                iterator = cp;
  442|    820|            }
  443|    820|        } else {
  444|      4|            int ref;
  445|       |
  446|      4|            if (!CRYPTO_UP_REF(&iterator->struct_ref, &ref)) {
  ------------------
  |  Branch (446:17): [True: 0, False: 4]
  ------------------
  447|      0|                CRYPTO_THREAD_unlock(global_engine_lock);
  448|      0|                ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  449|      0|                return NULL;
  450|      0|            }
  451|      4|            ENGINE_REF_PRINT(iterator, 0, 1);
  ------------------
  |  |   29|      4|    OSSL_TRACE6(ENGINE_REF_COUNT,                         \
  |  |  ------------------
  |  |  |  |  303|      4|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6))
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|      4|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      4|        "engine: %p %s from %d to %d (%s:%d)\n",          \
  |  |   31|      4|        (void *)(e), (isfunct ? "funct" : "struct"),      \
  |  |   32|      4|        ((isfunct)                                        \
  |  |   33|      4|                ? ((e)->funct_ref - (diff))               \
  |  |   34|      4|                : (eng_struct_ref(e) - (diff))),          \
  |  |   35|      4|        ((isfunct) ? (e)->funct_ref : eng_struct_ref(e)), \
  |  |   36|      4|        (OPENSSL_FILE), (OPENSSL_LINE))
  ------------------
  452|      4|        }
  453|    824|    }
  454|  1.64k|    CRYPTO_THREAD_unlock(global_engine_lock);
  455|  1.64k|    if (iterator != NULL)
  ------------------
  |  Branch (455:9): [True: 824, False: 817]
  ------------------
  456|    824|        return iterator;
  457|       |    /*
  458|       |     * Prevent infinite recursion if we're looking for the dynamic engine.
  459|       |     */
  460|    817|    if (strcmp(id, "dynamic")) {
  ------------------
  |  Branch (460:9): [True: 817, False: 0]
  ------------------
  461|    817|        if ((load_dir = ossl_safe_getenv("OPENSSL_ENGINES")) == NULL)
  ------------------
  |  Branch (461:13): [True: 817, False: 0]
  ------------------
  462|    817|            load_dir = ossl_get_enginesdir();
  463|    817|        iterator = ENGINE_by_id("dynamic");
  464|    817|        if (!iterator || !ENGINE_ctrl_cmd_string(iterator, "ID", id, 0) || !ENGINE_ctrl_cmd_string(iterator, "DIR_LOAD", "2", 0) || !ENGINE_ctrl_cmd_string(iterator, "DIR_ADD", load_dir, 0) || !ENGINE_ctrl_cmd_string(iterator, "LIST_ADD", "1", 0) || !ENGINE_ctrl_cmd_string(iterator, "LOAD", NULL, 0))
  ------------------
  |  Branch (464:13): [True: 0, False: 817]
  |  Branch (464:26): [True: 0, False: 817]
  |  Branch (464:76): [True: 0, False: 817]
  |  Branch (464:133): [True: 0, False: 817]
  |  Branch (464:194): [True: 0, False: 817]
  |  Branch (464:251): [True: 817, False: 0]
  ------------------
  465|    817|            goto notfound;
  466|      0|        return iterator;
  467|    817|    }
  468|    817|notfound:
  469|    817|    ENGINE_free(iterator);
  470|    817|    ERR_raise_data(ERR_LIB_ENGINE, ENGINE_R_NO_SUCH_ENGINE, "id=%s", id);
  ------------------
  |  |  406|    817|    (ERR_new(),                                                  \
  |  |  407|    817|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|    817|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|    817|        ERR_set_error)
  ------------------
                  ERR_raise_data(ERR_LIB_ENGINE, ENGINE_R_NO_SUCH_ENGINE, "id=%s", id);
  ------------------
  |  |  101|    817|#define ERR_LIB_ENGINE 38
  ------------------
                  ERR_raise_data(ERR_LIB_ENGINE, ENGINE_R_NO_SUCH_ENGINE, "id=%s", id);
  ------------------
  |  |   54|    817|#define ENGINE_R_NO_SUCH_ENGINE 116
  ------------------
  471|    817|    return NULL;
  472|       |    /* EEK! Experimental code ends */
  473|    817|}
eng_list.c:engine_list_add:
   58|      3|{
   59|      3|    int conflict = 0;
   60|      3|    ENGINE *iterator = NULL;
   61|      3|    int ref;
   62|       |
   63|      3|    if (e == NULL) {
  ------------------
  |  Branch (63:9): [True: 0, False: 3]
  ------------------
   64|      0|        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   65|      0|        return 0;
   66|      0|    }
   67|      3|    iterator = engine_list_head;
   68|      6|    while (iterator && !conflict) {
  ------------------
  |  Branch (68:12): [True: 3, False: 3]
  |  Branch (68:24): [True: 3, False: 0]
  ------------------
   69|      3|        conflict = (strcmp(iterator->id, e->id) == 0);
   70|      3|        iterator = iterator->next;
   71|      3|    }
   72|      3|    if (conflict) {
  ------------------
  |  Branch (72:9): [True: 0, False: 3]
  ------------------
   73|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_CONFLICTING_ENGINE_ID);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   74|      0|        return 0;
   75|      0|    }
   76|       |
   77|       |    /*
   78|       |     * Having the engine in the list assumes a structural reference.
   79|       |     */
   80|      3|    if (!CRYPTO_UP_REF(&e->struct_ref, &ref)) {
  ------------------
  |  Branch (80:9): [True: 0, False: 3]
  ------------------
   81|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   82|      0|        return 0;
   83|      0|    }
   84|      3|    ENGINE_REF_PRINT(e, 0, 1);
  ------------------
  |  |   29|      3|    OSSL_TRACE6(ENGINE_REF_COUNT,                         \
  |  |  ------------------
  |  |  |  |  303|      3|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6))
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|      3|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      3|        "engine: %p %s from %d to %d (%s:%d)\n",          \
  |  |   31|      3|        (void *)(e), (isfunct ? "funct" : "struct"),      \
  |  |   32|      3|        ((isfunct)                                        \
  |  |   33|      3|                ? ((e)->funct_ref - (diff))               \
  |  |   34|      3|                : (eng_struct_ref(e) - (diff))),          \
  |  |   35|      3|        ((isfunct) ? (e)->funct_ref : eng_struct_ref(e)), \
  |  |   36|      3|        (OPENSSL_FILE), (OPENSSL_LINE))
  ------------------
   85|      3|    if (engine_list_head == NULL) {
  ------------------
  |  Branch (85:9): [True: 1, False: 2]
  ------------------
   86|       |        /* We are adding to an empty list. */
   87|      1|        if (engine_list_tail != NULL) {
  ------------------
  |  Branch (87:13): [True: 0, False: 1]
  ------------------
   88|      0|            CRYPTO_DOWN_REF(&e->struct_ref, &ref);
   89|      0|            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   90|      0|            return 0;
   91|      0|        }
   92|       |        /*
   93|       |         * The first time the list allocates, we should register the cleanup.
   94|       |         */
   95|      1|        if (!engine_cleanup_add_last(engine_list_cleanup)) {
  ------------------
  |  Branch (95:13): [True: 0, False: 1]
  ------------------
   96|      0|            CRYPTO_DOWN_REF(&e->struct_ref, &ref);
   97|      0|            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   98|      0|            return 0;
   99|      0|        }
  100|      1|        engine_list_head = e;
  101|      1|        e->prev = NULL;
  102|      2|    } else {
  103|       |        /* We are adding to the tail of an existing list. */
  104|      2|        if ((engine_list_tail == NULL) || (engine_list_tail->next != NULL)) {
  ------------------
  |  Branch (104:13): [True: 0, False: 2]
  |  Branch (104:43): [True: 0, False: 2]
  ------------------
  105|      0|            CRYPTO_DOWN_REF(&e->struct_ref, &ref);
  106|      0|            ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  107|      0|            return 0;
  108|      0|        }
  109|      2|        engine_list_tail->next = e;
  110|      2|        e->prev = engine_list_tail;
  111|      2|    }
  112|       |
  113|       |    /* However it came to be, e is the last item in the list. */
  114|      3|    engine_list_tail = e;
  115|       |    e->next = NULL;
  116|      3|    return 1;
  117|      3|}
eng_list.c:engine_list_cleanup:
   43|      1|{
   44|      1|    ENGINE *iterator = engine_list_head;
   45|       |
   46|      4|    while (iterator != NULL) {
  ------------------
  |  Branch (46:12): [True: 3, False: 1]
  ------------------
   47|      3|        ENGINE_remove(iterator);
   48|      3|        iterator = engine_list_head;
   49|      3|    }
   50|      1|    return;
   51|      1|}
eng_list.c:engine_list_remove:
  120|      3|{
  121|      3|    ENGINE *iterator;
  122|       |
  123|      3|    if (e == NULL) {
  ------------------
  |  Branch (123:9): [True: 0, False: 3]
  ------------------
  124|      0|        ERR_raise(ERR_LIB_ENGINE, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  125|      0|        return 0;
  126|      0|    }
  127|       |    /* We need to check that e is in our linked list! */
  128|      3|    iterator = engine_list_head;
  129|      3|    while (iterator && (iterator != e))
  ------------------
  |  Branch (129:12): [True: 3, False: 0]
  |  Branch (129:24): [True: 0, False: 3]
  ------------------
  130|      0|        iterator = iterator->next;
  131|      3|    if (iterator == NULL) {
  ------------------
  |  Branch (131:9): [True: 0, False: 3]
  ------------------
  132|      0|        ERR_raise(ERR_LIB_ENGINE, ENGINE_R_ENGINE_IS_NOT_IN_LIST);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  133|      0|        return 0;
  134|      0|    }
  135|       |    /* un-link e from the chain. */
  136|      3|    if (e->next)
  ------------------
  |  Branch (136:9): [True: 2, False: 1]
  ------------------
  137|      2|        e->next->prev = e->prev;
  138|      3|    if (e->prev)
  ------------------
  |  Branch (138:9): [True: 0, False: 3]
  ------------------
  139|      0|        e->prev->next = e->next;
  140|       |    /* Correct our head/tail if necessary. */
  141|      3|    if (engine_list_head == e)
  ------------------
  |  Branch (141:9): [True: 3, False: 0]
  ------------------
  142|      3|        engine_list_head = e->next;
  143|      3|    if (engine_list_tail == e)
  ------------------
  |  Branch (143:9): [True: 1, False: 2]
  ------------------
  144|      1|        engine_list_tail = e->prev;
  145|      3|    engine_free_util(e, 0);
  146|      3|    return 1;
  147|      3|}
eng_list.c:engine_cpy:
  379|    820|{
  380|    820|    dest->id = src->id;
  381|    820|    dest->name = src->name;
  382|    820|    dest->rsa_meth = src->rsa_meth;
  383|    820|#ifndef OPENSSL_NO_DSA
  384|    820|    dest->dsa_meth = src->dsa_meth;
  385|    820|#endif
  386|    820|#ifndef OPENSSL_NO_DH
  387|    820|    dest->dh_meth = src->dh_meth;
  388|    820|#endif
  389|    820|#ifndef OPENSSL_NO_EC
  390|    820|    dest->ec_meth = src->ec_meth;
  391|    820|#endif
  392|    820|    dest->rand_meth = src->rand_meth;
  393|    820|    dest->ciphers = src->ciphers;
  394|    820|    dest->digests = src->digests;
  395|    820|    dest->pkey_meths = src->pkey_meths;
  396|    820|    dest->destroy = src->destroy;
  397|    820|    dest->init = src->init;
  398|    820|    dest->finish = src->finish;
  399|    820|    dest->ctrl = src->ctrl;
  400|    820|    dest->load_privkey = src->load_privkey;
  401|    820|    dest->load_pubkey = src->load_pubkey;
  402|    820|    dest->cmd_defns = src->cmd_defns;
  403|    820|    dest->flags = src->flags;
  404|    820|    dest->dynamic_id = src->dynamic_id;
  405|       |    engine_add_dynamic_id(dest, NULL, 0);
  406|    820|}

engine_load_rdrand_int:
   95|      1|{
   96|      1|    if (OPENSSL_ia32cap_P[1] & (1 << (62 - 32))) {
  ------------------
  |  Branch (96:9): [True: 1, False: 0]
  ------------------
   97|      1|        ENGINE *toadd = ENGINE_rdrand();
   98|      1|        if (!toadd)
  ------------------
  |  Branch (98:13): [True: 0, False: 1]
  ------------------
   99|      0|            return;
  100|      1|        ERR_set_mark();
  101|      1|        ENGINE_add(toadd);
  102|       |        /*
  103|       |         * If the "add" worked, it gets a structural reference. So either way, we
  104|       |         * release our just-created reference.
  105|       |         */
  106|      1|        ENGINE_free(toadd);
  107|       |        /*
  108|       |         * If the "add" didn't work, it was probably a conflict because it was
  109|       |         * already added (eg. someone calling ENGINE_load_blah then calling
  110|       |         * ENGINE_load_builtin_engines() perhaps).
  111|       |         */
  112|      1|        ERR_pop_to_mark();
  113|      1|    }
  114|      1|}
eng_rdrand.c:ENGINE_rdrand:
   83|      1|{
   84|      1|    ENGINE *ret = ENGINE_new();
   85|      1|    if (ret == NULL)
  ------------------
  |  Branch (85:9): [True: 0, False: 1]
  ------------------
   86|      0|        return NULL;
   87|      1|    if (!bind_helper(ret)) {
  ------------------
  |  Branch (87:9): [True: 0, False: 1]
  ------------------
   88|      0|        ENGINE_free(ret);
   89|      0|        return NULL;
   90|      0|    }
   91|      1|    return ret;
   92|      1|}
eng_rdrand.c:bind_helper:
   75|      1|{
   76|      1|    if (!ENGINE_set_id(e, engine_e_rdrand_id) || !ENGINE_set_name(e, engine_e_rdrand_name) || !ENGINE_set_flags(e, ENGINE_FLAGS_NO_REGISTER_ALL) || !ENGINE_set_init_function(e, rdrand_init) || !ENGINE_set_RAND(e, &rdrand_meth))
  ------------------
  |  |   96|      1|#define ENGINE_FLAGS_NO_REGISTER_ALL (int)0x0008
  ------------------
  |  Branch (76:9): [True: 0, False: 1]
  |  Branch (76:50): [True: 0, False: 1]
  |  Branch (76:95): [True: 0, False: 1]
  |  Branch (76:149): [True: 0, False: 1]
  |  Branch (76:194): [True: 0, False: 1]
  ------------------
   77|      0|        return 0;
   78|       |
   79|      1|    return 1;
   80|      1|}
eng_rdrand.c:rdrand_init:
   67|      2|{
   68|      2|    return 1;
   69|      2|}

engine_table_register:
   86|      2|{
   87|      2|    int ret = 0, added = 0;
   88|      2|    ENGINE_PILE tmplate, *fnd;
   89|       |
   90|      2|    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
  ------------------
  |  Branch (90:9): [True: 0, False: 2]
  ------------------
   91|      0|        return 0;
   92|      2|    if (!(*table))
  ------------------
  |  Branch (92:9): [True: 1, False: 1]
  ------------------
   93|      1|        added = 1;
   94|      2|    if (!int_table_check(table, 1))
  ------------------
  |  Branch (94:9): [True: 0, False: 2]
  ------------------
   95|      0|        goto end;
   96|       |    /* The cleanup callback needs to be added */
   97|      2|    if (added && !engine_cleanup_add_first(cleanup)) {
  ------------------
  |  Branch (97:9): [True: 1, False: 1]
  |  Branch (97:18): [True: 0, False: 1]
  ------------------
   98|      0|        lh_ENGINE_PILE_free(&(*table)->piles);
   99|      0|        *table = NULL;
  100|      0|        goto end;
  101|      0|    }
  102|      4|    while (num_nids--) {
  ------------------
  |  Branch (102:12): [True: 2, False: 2]
  ------------------
  103|      2|        tmplate.nid = *nids;
  104|      2|        fnd = lh_ENGINE_PILE_retrieve(&(*table)->piles, &tmplate);
  105|      2|        if (!fnd) {
  ------------------
  |  Branch (105:13): [True: 1, False: 1]
  ------------------
  106|      1|            fnd = OPENSSL_malloc(sizeof(*fnd));
  ------------------
  |  |  106|      1|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  107|      1|            if (fnd == NULL)
  ------------------
  |  Branch (107:17): [True: 0, False: 1]
  ------------------
  108|      0|                goto end;
  109|      1|            fnd->uptodate = 1;
  110|      1|            fnd->nid = *nids;
  111|      1|            fnd->sk = sk_ENGINE_new_null();
  112|      1|            if (!fnd->sk) {
  ------------------
  |  Branch (112:17): [True: 0, False: 1]
  ------------------
  113|      0|                OPENSSL_free(fnd);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  114|      0|                goto end;
  115|      0|            }
  116|      1|            fnd->funct = NULL;
  117|      1|            (void)lh_ENGINE_PILE_insert(&(*table)->piles, fnd);
  118|      1|            if (lh_ENGINE_PILE_retrieve(&(*table)->piles, &tmplate) != fnd) {
  ------------------
  |  Branch (118:17): [True: 0, False: 1]
  ------------------
  119|      0|                sk_ENGINE_free(fnd->sk);
  120|      0|                OPENSSL_free(fnd);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  121|      0|                goto end;
  122|      0|            }
  123|      1|        }
  124|       |        /* A registration shouldn't add duplicate entries */
  125|      2|        (void)sk_ENGINE_delete_ptr(fnd->sk, e);
  126|       |        /*
  127|       |         * if 'setdefault', this ENGINE goes to the head of the list
  128|       |         */
  129|      2|        if (!sk_ENGINE_push(fnd->sk, e))
  ------------------
  |  Branch (129:13): [True: 0, False: 2]
  ------------------
  130|      0|            goto end;
  131|       |        /* "touch" this ENGINE_PILE */
  132|      2|        fnd->uptodate = 0;
  133|      2|        if (setdefault) {
  ------------------
  |  Branch (133:13): [True: 2, False: 0]
  ------------------
  134|      2|            if (!engine_unlocked_init(e)) {
  ------------------
  |  Branch (134:17): [True: 0, False: 2]
  ------------------
  135|      0|                ERR_raise(ERR_LIB_ENGINE, ENGINE_R_INIT_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  136|      0|                goto end;
  137|      0|            }
  138|      2|            if (fnd->funct)
  ------------------
  |  Branch (138:17): [True: 1, False: 1]
  ------------------
  139|      1|                engine_unlocked_finish(fnd->funct, 0);
  140|      2|            fnd->funct = e;
  141|      2|            fnd->uptodate = 1;
  142|      2|        }
  143|      2|        nids++;
  144|      2|    }
  145|      2|    ret = 1;
  146|      2|end:
  147|      2|    CRYPTO_THREAD_unlock(global_engine_lock);
  148|      2|    return ret;
  149|      2|}
engine_table_cleanup:
  188|      1|{
  189|      1|    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
  ------------------
  |  Branch (189:9): [True: 0, False: 1]
  ------------------
  190|      0|        return;
  191|      1|    if (*table) {
  ------------------
  |  Branch (191:9): [True: 1, False: 0]
  ------------------
  192|      1|        lh_ENGINE_PILE_doall(&(*table)->piles, int_cleanup_cb_doall);
  193|      1|        lh_ENGINE_PILE_free(&(*table)->piles);
  194|       |        *table = NULL;
  195|      1|    }
  196|      1|    CRYPTO_THREAD_unlock(global_engine_lock);
  197|      1|}
ossl_engine_table_select:
  202|  2.77M|{
  203|  2.77M|    ENGINE *ret = NULL;
  204|  2.77M|    ENGINE_PILE tmplate, *fnd = NULL;
  205|  2.77M|    int initres, loop = 0;
  206|       |
  207|  2.77M|#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
  208|       |    /* Load the config before trying to check if engines are available */
  209|  2.77M|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  510|  2.77M|#define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
  ------------------
  210|  2.77M|#endif
  211|       |
  212|  2.77M|    if (!(*table)) {
  ------------------
  |  Branch (212:9): [True: 2.77M, False: 0]
  ------------------
  213|  2.77M|        OSSL_TRACE3(ENGINE_TABLE,
  ------------------
  |  |  297|  2.77M|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  ------------------
  |  |  |  |  285|  2.77M|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  214|  2.77M|            "%s:%d, nid=%d, nothing registered!\n",
  215|  2.77M|            f, l, nid);
  216|  2.77M|        return NULL;
  217|  2.77M|    }
  218|       |
  219|      0|    if (!CRYPTO_THREAD_write_lock(global_engine_lock))
  ------------------
  |  Branch (219:9): [True: 0, False: 0]
  ------------------
  220|      0|        return NULL;
  221|       |
  222|      0|    ERR_set_mark();
  223|       |    /*
  224|       |     * Check again inside the lock otherwise we could race against cleanup
  225|       |     * operations. But don't worry about a debug printout
  226|       |     */
  227|      0|    if (!int_table_check(table, 0))
  ------------------
  |  Branch (227:9): [True: 0, False: 0]
  ------------------
  228|      0|        goto end;
  229|      0|    tmplate.nid = nid;
  230|      0|    fnd = lh_ENGINE_PILE_retrieve(&(*table)->piles, &tmplate);
  231|      0|    if (!fnd)
  ------------------
  |  Branch (231:9): [True: 0, False: 0]
  ------------------
  232|      0|        goto end;
  233|      0|    if (fnd->funct && engine_unlocked_init(fnd->funct)) {
  ------------------
  |  Branch (233:9): [True: 0, False: 0]
  |  Branch (233:23): [True: 0, False: 0]
  ------------------
  234|      0|        OSSL_TRACE4(ENGINE_TABLE,
  ------------------
  |  |  299|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4))
  |  |  ------------------
  |  |  |  |  285|      0|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  235|      0|            "%s:%d, nid=%d, using ENGINE '%s' cached\n",
  236|      0|            f, l, nid, fnd->funct->id);
  237|      0|        ret = fnd->funct;
  238|      0|        goto end;
  239|      0|    }
  240|      0|    if (fnd->uptodate) {
  ------------------
  |  Branch (240:9): [True: 0, False: 0]
  ------------------
  241|      0|        ret = fnd->funct;
  242|      0|        goto end;
  243|      0|    }
  244|      0|trynext:
  245|      0|    ret = sk_ENGINE_value(fnd->sk, loop++);
  246|      0|    if (!ret) {
  ------------------
  |  Branch (246:9): [True: 0, False: 0]
  ------------------
  247|      0|        OSSL_TRACE3(ENGINE_TABLE,
  ------------------
  |  |  297|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  ------------------
  |  |  |  |  285|      0|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  248|      0|            "%s:%d, nid=%d, "
  249|      0|            "no registered implementations would initialise\n",
  250|      0|            f, l, nid);
  251|      0|        goto end;
  252|      0|    }
  253|       |    /* Try to initialise the ENGINE? */
  254|      0|    if ((ret->funct_ref > 0) || !(table_flags & ENGINE_TABLE_FLAG_NOINIT))
  ------------------
  |  |   64|      0|#define ENGINE_TABLE_FLAG_NOINIT (unsigned int)0x0001
  ------------------
  |  Branch (254:9): [True: 0, False: 0]
  |  Branch (254:33): [True: 0, False: 0]
  ------------------
  255|      0|        initres = engine_unlocked_init(ret);
  256|      0|    else
  257|      0|        initres = 0;
  258|      0|    if (initres) {
  ------------------
  |  Branch (258:9): [True: 0, False: 0]
  ------------------
  259|       |        /* Update 'funct' */
  260|      0|        if ((fnd->funct != ret) && engine_unlocked_init(ret)) {
  ------------------
  |  Branch (260:13): [True: 0, False: 0]
  |  Branch (260:36): [True: 0, False: 0]
  ------------------
  261|       |            /* If there was a previous default we release it. */
  262|      0|            if (fnd->funct)
  ------------------
  |  Branch (262:17): [True: 0, False: 0]
  ------------------
  263|      0|                engine_unlocked_finish(fnd->funct, 0);
  264|      0|            fnd->funct = ret;
  265|      0|            OSSL_TRACE4(ENGINE_TABLE,
  ------------------
  |  |  299|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4))
  |  |  ------------------
  |  |  |  |  285|      0|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  266|      0|                "%s:%d, nid=%d, setting default to '%s'\n",
  267|      0|                f, l, nid, ret->id);
  268|      0|        }
  269|      0|        OSSL_TRACE4(ENGINE_TABLE,
  ------------------
  |  |  299|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4))
  |  |  ------------------
  |  |  |  |  285|      0|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  270|      0|            "%s:%d, nid=%d, using newly initialised '%s'\n",
  271|      0|            f, l, nid, ret->id);
  272|      0|        goto end;
  273|      0|    }
  274|      0|    goto trynext;
  275|      0|end:
  276|       |    /*
  277|       |     * If it failed, it is unlikely to succeed again until some future
  278|       |     * registrations have taken place. In all cases, we cache.
  279|       |     */
  280|      0|    if (fnd)
  ------------------
  |  Branch (280:9): [True: 0, False: 0]
  ------------------
  281|      0|        fnd->uptodate = 1;
  282|      0|    if (ret)
  ------------------
  |  Branch (282:9): [True: 0, False: 0]
  ------------------
  283|      0|        OSSL_TRACE4(ENGINE_TABLE,
  ------------------
  |  |  299|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4))
  |  |  ------------------
  |  |  |  |  285|      0|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  284|      0|            "%s:%d, nid=%d, caching ENGINE '%s'\n",
  285|      0|            f, l, nid, ret->id);
  286|      0|    else
  287|      0|        OSSL_TRACE3(ENGINE_TABLE,
  ------------------
  |  |  297|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  ------------------
  |  |  |  |  285|      0|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  288|      0|            "%s:%d, nid=%d, caching 'no matching ENGINE'\n",
  289|      0|            f, l, nid);
  290|      0|    CRYPTO_THREAD_unlock(global_engine_lock);
  291|       |    /*
  292|       |     * Whatever happened, any failed init()s are not failures in this
  293|       |     * context, so clear our error state.
  294|       |     */
  295|      0|    ERR_pop_to_mark();
  296|      0|    return ret;
  297|      0|}
engine_table_doall:
  310|  1.98M|{
  311|  1.98M|    ENGINE_PILE_DOALL dall;
  312|  1.98M|    dall.cb = cb;
  313|  1.98M|    dall.arg = arg;
  314|  1.98M|    if (table)
  ------------------
  |  Branch (314:9): [True: 0, False: 1.98M]
  ------------------
  315|      0|        lh_ENGINE_PILE_doall_ENGINE_PILE_DOALL(&table->piles, int_dall, &dall);
  316|  1.98M|}
eng_table.c:int_table_check:
   66|      2|{
   67|      2|    LHASH_OF(ENGINE_PILE) *lh;
  ------------------
  |  |  156|      2|#define LHASH_OF(type) struct lhash_st_##type
  ------------------
   68|       |
   69|      2|    if (*t)
  ------------------
  |  Branch (69:9): [True: 1, False: 1]
  ------------------
   70|      1|        return 1;
   71|      1|    if (!create)
  ------------------
  |  Branch (71:9): [True: 0, False: 1]
  ------------------
   72|      0|        return 0;
   73|      1|    if ((lh = lh_ENGINE_PILE_new(engine_pile_hash, engine_pile_cmp)) == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 1]
  ------------------
   74|      0|        return 0;
   75|      1|    *t = (ENGINE_TABLE *)lh;
   76|      1|    return 1;
   77|      1|}
eng_table.c:engine_pile_hash:
   56|      4|{
   57|      4|    return c->nid;
   58|      4|}
eng_table.c:engine_pile_cmp:
   61|      2|{
   62|      2|    return a->nid - b->nid;
   63|      2|}
eng_table.c:int_cleanup_cb_doall:
  178|      1|{
  179|      1|    if (p == NULL)
  ------------------
  |  Branch (179:9): [True: 0, False: 1]
  ------------------
  180|      0|        return;
  181|      1|    sk_ENGINE_free(p->sk);
  182|      1|    if (p->funct)
  ------------------
  |  Branch (182:9): [True: 1, False: 0]
  ------------------
  183|      1|        engine_unlocked_finish(p->funct, 0);
  184|      1|    OPENSSL_free(p);
  ------------------
  |  |  131|      1|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  185|      1|}

ENGINE_register_pkey_asn1_meths:
   39|      2|{
   40|      2|    if (e->pkey_asn1_meths) {
  ------------------
  |  Branch (40:9): [True: 0, False: 2]
  ------------------
   41|      0|        const int *nids;
   42|      0|        int num_nids = e->pkey_asn1_meths(e, NULL, &nids, 0);
   43|      0|        if (num_nids > 0)
  ------------------
  |  Branch (43:13): [True: 0, False: 0]
  ------------------
   44|      0|            return engine_table_register(&pkey_asn1_meth_table,
   45|      0|                engine_unregister_all_pkey_asn1_meths,
   46|      0|                e, nids, num_nids, 0);
   47|      0|    }
   48|      2|    return 1;
   49|      2|}
ENGINE_set_default_pkey_asn1_meths:
   60|      2|{
   61|      2|    if (e->pkey_asn1_meths) {
  ------------------
  |  Branch (61:9): [True: 0, False: 2]
  ------------------
   62|      0|        const int *nids;
   63|      0|        int num_nids = e->pkey_asn1_meths(e, NULL, &nids, 0);
   64|      0|        if (num_nids > 0)
  ------------------
  |  Branch (64:13): [True: 0, False: 0]
  ------------------
   65|      0|            return engine_table_register(&pkey_asn1_meth_table,
   66|      0|                engine_unregister_all_pkey_asn1_meths,
   67|      0|                e, nids, num_nids, 1);
   68|      0|    }
   69|      2|    return 1;
   70|      2|}
ENGINE_get_pkey_asn1_meth_engine:
   78|  1.05M|{
   79|  1.05M|    return ossl_engine_table_select(&pkey_asn1_meth_table, nid,
   80|  1.05M|        OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  314|       |#define OPENSSL_FILE __FILE__
  ------------------
                      OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  315|       |#define OPENSSL_LINE __LINE__
  ------------------
   81|  1.05M|}
engine_pkey_asn1_meths_free:
  117|    823|{
  118|    823|    int i;
  119|    823|    EVP_PKEY_ASN1_METHOD *pkm;
  120|    823|    if (e->pkey_asn1_meths) {
  ------------------
  |  Branch (120:9): [True: 0, False: 823]
  ------------------
  121|      0|        const int *pknids;
  122|      0|        int npknids;
  123|      0|        npknids = e->pkey_asn1_meths(e, NULL, &pknids, 0);
  124|      0|        for (i = 0; i < npknids; i++) {
  ------------------
  |  Branch (124:21): [True: 0, False: 0]
  ------------------
  125|      0|            if (e->pkey_asn1_meths(e, &pkm, NULL, pknids[i])) {
  ------------------
  |  Branch (125:17): [True: 0, False: 0]
  ------------------
  126|      0|                EVP_PKEY_asn1_free(pkm);
  127|      0|            }
  128|      0|        }
  129|      0|    }
  130|    823|}
ENGINE_pkey_asn1_find_str:
  191|  1.98M|{
  192|  1.98M|    ENGINE_FIND_STR fstr;
  193|  1.98M|    fstr.e = NULL;
  194|  1.98M|    fstr.ameth = NULL;
  195|  1.98M|    fstr.str = str;
  196|  1.98M|    fstr.len = len;
  197|       |
  198|  1.98M|    if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) {
  ------------------
  |  |  130|  1.98M|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1.98M, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (198:9): [True: 0, False: 1.98M]
  ------------------
  199|       |        /* Maybe this should be raised in do_engine_lock_init() */
  200|      0|        ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  201|      0|        return NULL;
  202|      0|    }
  203|       |
  204|  1.98M|    if (!CRYPTO_THREAD_read_lock(global_engine_lock))
  ------------------
  |  Branch (204:9): [True: 0, False: 1.98M]
  ------------------
  205|      0|        return NULL;
  206|  1.98M|    engine_table_doall(pkey_asn1_meth_table, look_str_cb, &fstr);
  207|       |    /* If found obtain a structural reference to engine */
  208|  1.98M|    if (fstr.e != NULL) {
  ------------------
  |  Branch (208:9): [True: 0, False: 1.98M]
  ------------------
  209|      0|        int ref;
  210|       |
  211|      0|        if (!CRYPTO_UP_REF(&fstr.e->struct_ref, &ref)) {
  ------------------
  |  Branch (211:13): [True: 0, False: 0]
  ------------------
  212|      0|            CRYPTO_THREAD_unlock(global_engine_lock);
  213|      0|            ERR_raise(ERR_LIB_ENGINE, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  214|      0|            return NULL;
  215|      0|        }
  216|      0|        ENGINE_REF_PRINT(fstr.e, 0, 1);
  ------------------
  |  |   29|      0|    OSSL_TRACE6(ENGINE_REF_COUNT,                         \
  |  |  ------------------
  |  |  |  |  303|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5, arg6))
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|      0|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      0|        "engine: %p %s from %d to %d (%s:%d)\n",          \
  |  |   31|      0|        (void *)(e), (isfunct ? "funct" : "struct"),      \
  |  |   32|      0|        ((isfunct)                                        \
  |  |   33|      0|                ? ((e)->funct_ref - (diff))               \
  |  |   34|      0|                : (eng_struct_ref(e) - (diff))),          \
  |  |   35|      0|        ((isfunct) ? (e)->funct_ref : eng_struct_ref(e)), \
  |  |   36|      0|        (OPENSSL_FILE), (OPENSSL_LINE))
  ------------------
  217|      0|    }
  218|  1.98M|    *pe = fstr.e;
  219|  1.98M|    CRYPTO_THREAD_unlock(global_engine_lock);
  220|  1.98M|    return fstr.ameth;
  221|  1.98M|}

ENGINE_register_ciphers:
   28|      2|{
   29|      2|    if (e->ciphers) {
  ------------------
  |  Branch (29:9): [True: 0, False: 2]
  ------------------
   30|      0|        const int *nids;
   31|      0|        int num_nids = e->ciphers(e, NULL, &nids, 0);
   32|      0|        if (num_nids > 0)
  ------------------
  |  Branch (32:13): [True: 0, False: 0]
  ------------------
   33|      0|            return engine_table_register(&cipher_table,
   34|      0|                engine_unregister_all_ciphers, e,
   35|      0|                nids, num_nids, 0);
   36|      0|    }
   37|      2|    return 1;
   38|      2|}
ENGINE_set_default_ciphers:
   49|      2|{
   50|      2|    if (e->ciphers) {
  ------------------
  |  Branch (50:9): [True: 0, False: 2]
  ------------------
   51|      0|        const int *nids;
   52|      0|        int num_nids = e->ciphers(e, NULL, &nids, 0);
   53|      0|        if (num_nids > 0)
  ------------------
  |  Branch (53:13): [True: 0, False: 0]
  ------------------
   54|      0|            return engine_table_register(&cipher_table,
   55|      0|                engine_unregister_all_ciphers, e,
   56|      0|                nids, num_nids, 1);
   57|      0|    }
   58|      2|    return 1;
   59|      2|}
ENGINE_get_cipher_engine:
   67|  63.8k|{
   68|  63.8k|    return ossl_engine_table_select(&cipher_table, nid,
   69|  63.8k|        OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  314|       |#define OPENSSL_FILE __FILE__
  ------------------
                      OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  315|       |#define OPENSSL_LINE __LINE__
  ------------------
   70|  63.8k|}

ENGINE_register_DH:
   29|      2|{
   30|      2|    if (e->dh_meth)
  ------------------
  |  Branch (30:9): [True: 0, False: 2]
  ------------------
   31|      0|        return engine_table_register(&dh_table,
   32|      0|            engine_unregister_all_DH, e, &dummy_nid,
   33|      0|            1, 0);
   34|      2|    return 1;
   35|      2|}
ENGINE_set_default_DH:
   46|      2|{
   47|      2|    if (e->dh_meth)
  ------------------
  |  Branch (47:9): [True: 0, False: 2]
  ------------------
   48|      0|        return engine_table_register(&dh_table,
   49|      0|            engine_unregister_all_DH, e, &dummy_nid,
   50|      0|            1, 1);
   51|      2|    return 1;
   52|      2|}
ENGINE_get_default_DH:
   60|     76|{
   61|     76|    return ossl_engine_table_select(&dh_table, dummy_nid,
   62|     76|        OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  314|       |#define OPENSSL_FILE __FILE__
  ------------------
                      OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  315|       |#define OPENSSL_LINE __LINE__
  ------------------
   63|     76|}

ENGINE_register_digests:
   28|      2|{
   29|      2|    if (e->digests) {
  ------------------
  |  Branch (29:9): [True: 0, False: 2]
  ------------------
   30|      0|        const int *nids;
   31|      0|        int num_nids = e->digests(e, NULL, &nids, 0);
   32|      0|        if (num_nids > 0)
  ------------------
  |  Branch (32:13): [True: 0, False: 0]
  ------------------
   33|      0|            return engine_table_register(&digest_table,
   34|      0|                engine_unregister_all_digests, e,
   35|      0|                nids, num_nids, 0);
   36|      0|    }
   37|      2|    return 1;
   38|      2|}
ENGINE_set_default_digests:
   49|      2|{
   50|      2|    if (e->digests) {
  ------------------
  |  Branch (50:9): [True: 0, False: 2]
  ------------------
   51|      0|        const int *nids;
   52|      0|        int num_nids = e->digests(e, NULL, &nids, 0);
   53|      0|        if (num_nids > 0)
  ------------------
  |  Branch (53:13): [True: 0, False: 0]
  ------------------
   54|      0|            return engine_table_register(&digest_table,
   55|      0|                engine_unregister_all_digests, e,
   56|      0|                nids, num_nids, 1);
   57|      0|    }
   58|      2|    return 1;
   59|      2|}
ENGINE_get_digest_engine:
   67|   764k|{
   68|   764k|    return ossl_engine_table_select(&digest_table, nid,
   69|   764k|        OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  314|       |#define OPENSSL_FILE __FILE__
  ------------------
                      OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  315|       |#define OPENSSL_LINE __LINE__
  ------------------
   70|   764k|}

ENGINE_register_DSA:
   29|      2|{
   30|      2|    if (e->dsa_meth)
  ------------------
  |  Branch (30:9): [True: 0, False: 2]
  ------------------
   31|      0|        return engine_table_register(&dsa_table,
   32|      0|            engine_unregister_all_DSA, e, &dummy_nid,
   33|      0|            1, 0);
   34|      2|    return 1;
   35|      2|}
ENGINE_set_default_DSA:
   46|      2|{
   47|      2|    if (e->dsa_meth)
  ------------------
  |  Branch (47:9): [True: 0, False: 2]
  ------------------
   48|      0|        return engine_table_register(&dsa_table,
   49|      0|            engine_unregister_all_DSA, e, &dummy_nid,
   50|      0|            1, 1);
   51|      2|    return 1;
   52|      2|}

ENGINE_register_EC:
   29|      2|{
   30|      2|    if (e->ec_meth != NULL)
  ------------------
  |  Branch (30:9): [True: 0, False: 2]
  ------------------
   31|      0|        return engine_table_register(&dh_table,
   32|      0|            engine_unregister_all_EC, e, &dummy_nid,
   33|      0|            1, 0);
   34|      2|    return 1;
   35|      2|}
ENGINE_set_default_EC:
   46|      2|{
   47|      2|    if (e->ec_meth != NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 2]
  ------------------
   48|      0|        return engine_table_register(&dh_table,
   49|      0|            engine_unregister_all_EC, e, &dummy_nid,
   50|      0|            1, 1);
   51|      2|    return 1;
   52|      2|}
ENGINE_get_default_EC:
   60|   113k|{
   61|   113k|    return ossl_engine_table_select(&dh_table, dummy_nid,
   62|   113k|        OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  314|       |#define OPENSSL_FILE __FILE__
  ------------------
                      OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  315|       |#define OPENSSL_LINE __LINE__
  ------------------
   63|   113k|}

ENGINE_register_pkey_meths:
   29|      2|{
   30|      2|    if (e->pkey_meths) {
  ------------------
  |  Branch (30:9): [True: 0, False: 2]
  ------------------
   31|      0|        const int *nids;
   32|      0|        int num_nids = e->pkey_meths(e, NULL, &nids, 0);
   33|      0|        if (num_nids > 0)
  ------------------
  |  Branch (33:13): [True: 0, False: 0]
  ------------------
   34|      0|            return engine_table_register(&pkey_meth_table,
   35|      0|                engine_unregister_all_pkey_meths, e,
   36|      0|                nids, num_nids, 0);
   37|      0|    }
   38|      2|    return 1;
   39|      2|}
ENGINE_set_default_pkey_meths:
   50|      2|{
   51|      2|    if (e->pkey_meths) {
  ------------------
  |  Branch (51:9): [True: 0, False: 2]
  ------------------
   52|      0|        const int *nids;
   53|      0|        int num_nids = e->pkey_meths(e, NULL, &nids, 0);
   54|      0|        if (num_nids > 0)
  ------------------
  |  Branch (54:13): [True: 0, False: 0]
  ------------------
   55|      0|            return engine_table_register(&pkey_meth_table,
   56|      0|                engine_unregister_all_pkey_meths, e,
   57|      0|                nids, num_nids, 1);
   58|      0|    }
   59|      2|    return 1;
   60|      2|}
ENGINE_get_pkey_meth_engine:
   68|   479k|{
   69|   479k|    return ossl_engine_table_select(&pkey_meth_table, nid,
   70|   479k|        OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  314|       |#define OPENSSL_FILE __FILE__
  ------------------
                      OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  315|       |#define OPENSSL_LINE __LINE__
  ------------------
   71|   479k|}
engine_pkey_meths_free:
  104|    823|{
  105|    823|    int i;
  106|    823|    EVP_PKEY_METHOD *pkm;
  107|    823|    if (e->pkey_meths) {
  ------------------
  |  Branch (107:9): [True: 0, False: 823]
  ------------------
  108|      0|        const int *pknids;
  109|      0|        int npknids;
  110|      0|        npknids = e->pkey_meths(e, NULL, &pknids, 0);
  111|      0|        for (i = 0; i < npknids; i++) {
  ------------------
  |  Branch (111:21): [True: 0, False: 0]
  ------------------
  112|      0|            if (e->pkey_meths(e, &pkm, NULL, pknids[i])) {
  ------------------
  |  Branch (112:17): [True: 0, False: 0]
  ------------------
  113|      0|                EVP_PKEY_meth_free(pkm);
  114|      0|            }
  115|      0|        }
  116|      0|    }
  117|    823|}

ENGINE_register_RAND:
   29|      2|{
   30|      2|    if (e->rand_meth)
  ------------------
  |  Branch (30:9): [True: 0, False: 2]
  ------------------
   31|      0|        return engine_table_register(&rand_table,
   32|      0|            engine_unregister_all_RAND, e,
   33|      0|            &dummy_nid, 1, 0);
   34|      2|    return 1;
   35|      2|}
ENGINE_set_default_RAND:
   46|      2|{
   47|      2|    if (e->rand_meth)
  ------------------
  |  Branch (47:9): [True: 2, False: 0]
  ------------------
   48|      2|        return engine_table_register(&rand_table,
   49|      2|            engine_unregister_all_RAND, e,
   50|      2|            &dummy_nid, 1, 1);
   51|      0|    return 1;
   52|      2|}
ENGINE_get_default_RAND:
   60|      1|{
   61|      1|    return ossl_engine_table_select(&rand_table, dummy_nid,
   62|      1|        OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  314|       |#define OPENSSL_FILE __FILE__
  ------------------
                      OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  315|       |#define OPENSSL_LINE __LINE__
  ------------------
   63|      1|}
ENGINE_set_RAND:
   73|      1|{
   74|      1|    e->rand_meth = rand_meth;
   75|      1|    return 1;
   76|      1|}
tb_rand.c:engine_unregister_all_RAND:
   24|      1|{
   25|      1|    engine_table_cleanup(&rand_table);
   26|      1|}

ENGINE_register_RSA:
   29|      2|{
   30|      2|    if (e->rsa_meth)
  ------------------
  |  Branch (30:9): [True: 0, False: 2]
  ------------------
   31|      0|        return engine_table_register(&rsa_table,
   32|      0|            engine_unregister_all_RSA, e, &dummy_nid,
   33|      0|            1, 0);
   34|      2|    return 1;
   35|      2|}
ENGINE_set_default_RSA:
   46|      2|{
   47|      2|    if (e->rsa_meth)
  ------------------
  |  Branch (47:9): [True: 0, False: 2]
  ------------------
   48|      0|        return engine_table_register(&rsa_table,
   49|      0|            engine_unregister_all_RSA, e, &dummy_nid,
   50|      0|            1, 1);
   51|      2|    return 1;
   52|      2|}
ENGINE_get_default_RSA:
   60|   299k|{
   61|   299k|    return ossl_engine_table_select(&rsa_table, dummy_nid,
   62|   299k|        OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  314|       |#define OPENSSL_FILE __FILE__
  ------------------
                      OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  315|       |#define OPENSSL_LINE __LINE__
  ------------------
   63|   299k|}

OSSL_ERR_STATE_free:
  201|      1|{
  202|      1|    int i;
  203|       |
  204|      1|    if (state == NULL)
  ------------------
  |  Branch (204:9): [True: 0, False: 1]
  ------------------
  205|      0|        return;
  206|     17|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   57|     17|#define ERR_NUM_ERRORS 16
  ------------------
  |  Branch (206:17): [True: 16, False: 1]
  ------------------
  207|     16|        err_clear(state, i, 1);
  208|     16|    }
  209|      1|    CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  314|       |#define OPENSSL_FILE __FILE__
  ------------------
                  CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  315|       |#define OPENSSL_LINE __LINE__
  ------------------
  210|      1|}
err_cleanup:
  232|      1|{
  233|      1|    CRYPTO_THREAD_lock_free(err_string_lock);
  234|      1|    err_string_lock = NULL;
  235|      1|#ifndef OPENSSL_NO_ERR
  236|      1|    lh_ERR_STRING_DATA_free(int_error_hash);
  ------------------
  |  |  378|      1|#define lh_ERR_STRING_DATA_free(lh) OPENSSL_LH_free(ossl_check_ERR_STRING_DATA_lh_type(lh))
  ------------------
  237|       |    int_error_hash = NULL;
  238|      1|#endif
  239|      1|}
ossl_err_load_ERR_strings:
  269|     37|{
  270|     37|#ifndef OPENSSL_NO_ERR
  271|     37|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  130|     37|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 37, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (271:9): [True: 0, False: 37]
  ------------------
  272|      0|        return 0;
  273|       |
  274|     37|    err_load_strings(ERR_str_libraries);
  275|     37|    err_load_strings(ERR_str_reasons);
  276|     37|#endif
  277|     37|    return 1;
  278|     37|}
ERR_load_strings_const:
  294|     36|{
  295|     36|#ifndef OPENSSL_NO_ERR
  296|     36|    if (ossl_err_load_ERR_strings() == 0)
  ------------------
  |  Branch (296:9): [True: 0, False: 36]
  ------------------
  297|      0|        return 0;
  298|     36|    err_load_strings(str);
  299|     36|#endif
  300|       |
  301|     36|    return 1;
  302|     36|}
ERR_clear_error:
  332|  4.16k|{
  333|  4.16k|    int i;
  334|  4.16k|    ERR_STATE *es;
  335|       |
  336|  4.16k|    es = ossl_err_get_state_int();
  337|  4.16k|    if (es == NULL)
  ------------------
  |  Branch (337:9): [True: 0, False: 4.16k]
  ------------------
  338|      0|        return;
  339|       |
  340|  70.7k|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   57|  70.7k|#define ERR_NUM_ERRORS 16
  ------------------
  |  Branch (340:17): [True: 66.5k, False: 4.16k]
  ------------------
  341|  66.5k|        err_clear(es, i, 0);
  342|  66.5k|    }
  343|  4.16k|    es->top = es->bottom = 0;
  344|  4.16k|}
ERR_get_error:
  347|    561|{
  348|    561|    return get_error_values(EV_POP, NULL, NULL, NULL, NULL, NULL);
  349|    561|}
ERR_peek_error:
  372|  3.23k|{
  373|  3.23k|    return get_error_values(EV_PEEK, NULL, NULL, NULL, NULL, NULL);
  374|  3.23k|}
ERR_peek_last_error:
  407|  1.24M|{
  408|  1.24M|    return get_error_values(EV_PEEK_LAST, NULL, NULL, NULL, NULL, NULL);
  409|  1.24M|}
ossl_err_string_int:
  520|    643|{
  521|    643|    char lsbuf[64], rsbuf[256];
  522|    643|    const char *ls, *rs = NULL;
  523|    643|    unsigned long l, r;
  524|       |
  525|    643|    if (len == 0)
  ------------------
  |  Branch (525:9): [True: 0, False: 643]
  ------------------
  526|      0|        return;
  527|       |
  528|    643|    l = ERR_GET_LIB(e);
  529|    643|    ls = ERR_lib_error_string(e);
  530|    643|    if (ls == NULL) {
  ------------------
  |  Branch (530:9): [True: 4, False: 639]
  ------------------
  531|      4|        BIO_snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l);
  532|      4|        ls = lsbuf;
  533|      4|    }
  534|       |
  535|       |    /*
  536|       |     * ERR_reason_error_string() can't safely return system error strings,
  537|       |     * since it would call openssl_strerror_r(), which needs a buffer for
  538|       |     * thread safety.  So for system errors, we call openssl_strerror_r()
  539|       |     * directly instead.
  540|       |     */
  541|    643|    r = ERR_GET_REASON(e);
  542|    643|#ifndef OPENSSL_NO_ERR
  543|    643|    if (ERR_SYSTEM_ERROR(e)) {
  ------------------
  |  |  241|    643|#define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  220|    643|#define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (241:35): [True: 23, False: 620]
  |  |  ------------------
  ------------------
  544|     23|        if (openssl_strerror_r(r, rsbuf, sizeof(rsbuf)))
  ------------------
  |  Branch (544:13): [True: 23, False: 0]
  ------------------
  545|     23|            rs = rsbuf;
  546|    620|    } else {
  547|    620|        rs = ERR_reason_error_string(e);
  548|    620|    }
  549|    643|#endif
  550|    643|    if (rs == NULL) {
  ------------------
  |  Branch (550:9): [True: 14, False: 629]
  ------------------
  551|     14|        BIO_snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)",
  552|     14|            r & ~(ERR_RFLAGS_MASK << ERR_RFLAGS_OFFSET));
  ------------------
  |  |  231|     14|#define ERR_RFLAGS_MASK 0x1F
  ------------------
                          r & ~(ERR_RFLAGS_MASK << ERR_RFLAGS_OFFSET));
  ------------------
  |  |  230|     14|#define ERR_RFLAGS_OFFSET 18L
  ------------------
  553|     14|        rs = rsbuf;
  554|     14|    }
  555|       |
  556|    643|    BIO_snprintf(buf, len, "error:%08lX:%s:%s:%s", e, ls, func, rs);
  557|    643|    if (strlen(buf) == len - 1) {
  ------------------
  |  Branch (557:9): [True: 0, False: 643]
  ------------------
  558|       |        /* Didn't fit; use a minimal format. */
  559|      0|        BIO_snprintf(buf, len, "err:%lx:%lx:%lx:%lx", e, l, 0L, r);
  560|      0|    }
  561|    643|}
ERR_error_string_n:
  564|    643|{
  565|    643|    ossl_err_string_int(e, "", buf, len);
  566|    643|}
ERR_lib_error_string:
  583|    643|{
  584|    643|#ifndef OPENSSL_NO_ERR
  585|    643|    ERR_STRING_DATA d, *p;
  586|    643|    unsigned long l;
  587|       |
  588|    643|    if (!RUN_ONCE(&err_string_init, do_err_strings_init)) {
  ------------------
  |  |  130|    643|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 643, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (588:9): [True: 0, False: 643]
  ------------------
  589|      0|        return NULL;
  590|      0|    }
  591|       |
  592|    643|    l = ERR_GET_LIB(e);
  593|    643|    d.error = ERR_PACK(l, 0, 0);
  ------------------
  |  |  281|    643|    ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  229|    643|#define ERR_LIB_MASK 0xFF
  |  |  ------------------
  |  |                   ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  228|    643|#define ERR_LIB_OFFSET 23L
  |  |  ------------------
  |  |                   ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  232|    643|#define ERR_REASON_MASK 0X7FFFFF
  |  |  ------------------
  ------------------
  594|    643|    p = int_err_get_item(&d);
  595|    643|    return ((p == NULL) ? NULL : p->string);
  ------------------
  |  Branch (595:13): [True: 4, False: 639]
  ------------------
  596|       |#else
  597|       |    return NULL;
  598|       |#endif
  599|    643|}
ERR_reason_error_string:
  609|    656|{
  610|    656|#ifndef OPENSSL_NO_ERR
  611|    656|    ERR_STRING_DATA d, *p = NULL;
  612|    656|    unsigned long l, r;
  613|       |
  614|    656|    if (!RUN_ONCE(&err_string_init, do_err_strings_init)) {
  ------------------
  |  |  130|    656|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 656, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (614:9): [True: 0, False: 656]
  ------------------
  615|      0|        return NULL;
  616|      0|    }
  617|       |
  618|       |    /*
  619|       |     * ERR_reason_error_string() can't safely return system error strings,
  620|       |     * since openssl_strerror_r() needs a buffer for thread safety, and we
  621|       |     * haven't got one that would serve any sensible purpose.
  622|       |     */
  623|    656|    if (ERR_SYSTEM_ERROR(e))
  ------------------
  |  |  241|    656|#define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  220|    656|#define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (241:35): [True: 0, False: 656]
  |  |  ------------------
  ------------------
  624|      0|        return NULL;
  625|       |
  626|    656|    l = ERR_GET_LIB(e);
  627|    656|    r = ERR_GET_REASON(e);
  628|    656|    d.error = ERR_PACK(l, 0, r);
  ------------------
  |  |  281|    656|    ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  229|    656|#define ERR_LIB_MASK 0xFF
  |  |  ------------------
  |  |                   ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  228|    656|#define ERR_LIB_OFFSET 23L
  |  |  ------------------
  |  |                   ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  232|    656|#define ERR_REASON_MASK 0X7FFFFF
  |  |  ------------------
  ------------------
  629|    656|    p = int_err_get_item(&d);
  630|    656|    if (p == NULL) {
  ------------------
  |  Branch (630:9): [True: 50, False: 606]
  ------------------
  631|     50|        d.error = ERR_PACK(0, 0, r);
  ------------------
  |  |  281|     50|    ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  229|     50|#define ERR_LIB_MASK 0xFF
  |  |  ------------------
  |  |                   ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  228|     50|#define ERR_LIB_OFFSET 23L
  |  |  ------------------
  |  |                   ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  232|     50|#define ERR_REASON_MASK 0X7FFFFF
  |  |  ------------------
  ------------------
  632|     50|        p = int_err_get_item(&d);
  633|     50|    }
  634|    656|    return ((p == NULL) ? NULL : p->string);
  ------------------
  |  Branch (634:13): [True: 50, False: 606]
  ------------------
  635|       |#else
  636|       |    return NULL;
  637|       |#endif
  638|    656|}
ossl_err_get_state_int:
  666|  20.0M|{
  667|  20.0M|    ERR_STATE *state;
  668|  20.0M|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|  20.0M|#define get_last_sys_error() errno
  ------------------
  669|       |
  670|  20.0M|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|  20.0M|#define OPENSSL_INIT_BASE_ONLY 0x00040000L
  ------------------
  |  Branch (670:9): [True: 0, False: 20.0M]
  ------------------
  671|      0|        return NULL;
  672|       |
  673|  20.0M|    state = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
  674|  20.0M|        CRYPTO_THREAD_NO_CONTEXT);
  ------------------
  |  |   25|  20.0M|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  675|  20.0M|    if (state == (ERR_STATE *)-1)
  ------------------
  |  Branch (675:9): [True: 0, False: 20.0M]
  ------------------
  676|      0|        return NULL;
  677|       |
  678|  20.0M|    if (state == NULL) {
  ------------------
  |  Branch (678:9): [True: 1, False: 20.0M]
  ------------------
  679|      1|        if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
  ------------------
  |  Branch (679:13): [True: 0, False: 1]
  ------------------
  680|      1|                CRYPTO_THREAD_NO_CONTEXT, (ERR_STATE *)-1))
  ------------------
  |  |   25|      1|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  681|      0|            return NULL;
  682|       |
  683|      1|        state = OSSL_ERR_STATE_new();
  684|      1|        if (state == NULL) {
  ------------------
  |  Branch (684:13): [True: 0, False: 1]
  ------------------
  685|      0|            CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
  686|      0|                CRYPTO_THREAD_NO_CONTEXT, NULL);
  ------------------
  |  |   25|      0|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  687|      0|            return NULL;
  688|      0|        }
  689|       |
  690|      1|        if (!ossl_init_thread_start(NULL, NULL, err_delete_thread_state)
  ------------------
  |  Branch (690:13): [True: 0, False: 1]
  ------------------
  691|      1|            || !CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
  ------------------
  |  Branch (691:16): [True: 0, False: 1]
  ------------------
  692|      1|                CRYPTO_THREAD_NO_CONTEXT, state)) {
  ------------------
  |  |   25|      1|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  693|      0|            OSSL_ERR_STATE_free(state);
  694|      0|            CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
  695|      0|                CRYPTO_THREAD_NO_CONTEXT, NULL);
  ------------------
  |  |   25|      0|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  696|      0|            return NULL;
  697|      0|        }
  698|       |
  699|       |        /* Ignore failures from these */
  700|      1|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  505|      1|#define OPENSSL_INIT_LOAD_CRYPTO_STRINGS 0x00000002L
  ------------------
  701|      1|    }
  702|       |
  703|  20.0M|    set_sys_error(saveerrno);
  ------------------
  |  |   32|  20.0M|#define set_sys_error(e) errno = (e)
  ------------------
  704|  20.0M|    return state;
  705|  20.0M|}
err_shelve_state:
  719|      1|{
  720|      1|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|      1|#define get_last_sys_error() errno
  ------------------
  721|       |
  722|       |    /*
  723|       |     * Note, at present our only caller is OPENSSL_init_crypto(), indirectly
  724|       |     * via ossl_init_load_crypto_nodelete(), by which point the requested
  725|       |     * "base" initialization has already been performed, so the below call is a
  726|       |     * NOOP, that re-enters OPENSSL_init_crypto() only to quickly return.
  727|       |     *
  728|       |     * If are no other valid callers of this function, the call below can be
  729|       |     * removed, avoiding the re-entry into OPENSSL_init_crypto().  If there are
  730|       |     * potential uses that are not from inside OPENSSL_init_crypto(), then this
  731|       |     * call is needed, but some care is required to make sure that the re-entry
  732|       |     * remains a NOOP.
  733|       |     */
  734|      1|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      1|#define OPENSSL_INIT_BASE_ONLY 0x00040000L
  ------------------
  |  Branch (734:9): [True: 0, False: 1]
  ------------------
  735|      0|        return 0;
  736|       |
  737|      1|    *state = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
  738|      1|        CRYPTO_THREAD_NO_CONTEXT);
  ------------------
  |  |   25|      1|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  739|      1|    if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
  ------------------
  |  Branch (739:9): [True: 0, False: 1]
  ------------------
  740|      1|            CRYPTO_THREAD_NO_CONTEXT, (ERR_STATE *)-1))
  ------------------
  |  |   25|      1|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  741|      0|        return 0;
  742|       |
  743|      1|    set_sys_error(saveerrno);
  ------------------
  |  |   32|      1|#define set_sys_error(e) errno = (e)
  ------------------
  744|      1|    return 1;
  745|      1|}
err_unshelve_state:
  752|      1|{
  753|      1|    if (state != (void *)-1)
  ------------------
  |  Branch (753:9): [True: 1, False: 0]
  ------------------
  754|      1|        CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
  755|      1|            CRYPTO_THREAD_NO_CONTEXT, (ERR_STATE *)state);
  ------------------
  |  |   25|      1|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  756|      1|}
ERR_get_next_error_library:
  759|  1.57k|{
  760|  1.57k|    int ret;
  761|       |
  762|  1.57k|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  130|  1.57k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1.57k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (762:9): [True: 0, False: 1.57k]
  ------------------
  763|      0|        return 0;
  764|       |
  765|  1.57k|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (765:9): [True: 0, False: 1.57k]
  ------------------
  766|      0|        return 0;
  767|  1.57k|    ret = int_err_library_number++;
  768|  1.57k|    CRYPTO_THREAD_unlock(err_string_lock);
  769|  1.57k|    return ret;
  770|  1.57k|}
ERR_add_error_data:
  807|  1.16k|{
  808|  1.16k|    va_list args;
  809|  1.16k|    va_start(args, num);
  810|  1.16k|    ERR_add_error_vdata(num, args);
  811|       |    va_end(args);
  812|  1.16k|}
ERR_add_error_vdata:
  815|  1.16k|{
  816|  1.16k|    int i;
  817|  1.16k|    size_t len, size;
  818|  1.16k|    int flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   50|  1.16k|#define ERR_TXT_MALLOCED 0x01
  ------------------
                  int flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   51|  1.16k|#define ERR_TXT_STRING 0x02
  ------------------
  819|  1.16k|    char *str, *arg;
  820|  1.16k|    ERR_STATE *es;
  821|       |
  822|       |    /* Get the current error data; if an allocated string get it. */
  823|  1.16k|    es = ossl_err_get_state_int();
  824|  1.16k|    if (es == NULL)
  ------------------
  |  Branch (824:9): [True: 0, False: 1.16k]
  ------------------
  825|      0|        return;
  826|  1.16k|    i = es->top;
  827|       |
  828|       |    /*
  829|       |     * If err_data is allocated already, reuse the space.
  830|       |     * Otherwise, allocate a small new buffer.
  831|       |     */
  832|  1.16k|    if ((es->err_data_flags[i] & flags) == flags
  ------------------
  |  Branch (832:9): [True: 0, False: 1.16k]
  ------------------
  833|      0|        && ossl_assert(es->err_data[i] != NULL)) {
  ------------------
  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  ------------------
  |  |  |  Branch (52:24): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|      0|    __FILE__, __LINE__)
  ------------------
  834|      0|        str = es->err_data[i];
  835|      0|        size = es->err_data_size[i];
  836|       |
  837|       |        /*
  838|       |         * To protect the string we just grabbed from tampering by other
  839|       |         * functions we may call, or to protect them from freeing a pointer
  840|       |         * that may no longer be valid at that point, we clear away the
  841|       |         * data pointer and the flags.  We will set them again at the end
  842|       |         * of this function.
  843|       |         */
  844|      0|        es->err_data[i] = NULL;
  845|      0|        es->err_data_flags[i] = 0;
  846|  1.16k|    } else if ((str = OPENSSL_malloc(size = 81)) == NULL) {
  ------------------
  |  |  106|  1.16k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (846:16): [True: 0, False: 1.16k]
  ------------------
  847|      0|        return;
  848|  1.16k|    } else {
  849|  1.16k|        str[0] = '\0';
  850|  1.16k|    }
  851|  1.16k|    len = strlen(str);
  852|       |
  853|  3.50k|    while (--num >= 0) {
  ------------------
  |  Branch (853:12): [True: 2.33k, False: 1.16k]
  ------------------
  854|  2.33k|        arg = va_arg(args, char *);
  855|  2.33k|        if (arg == NULL)
  ------------------
  |  Branch (855:13): [True: 0, False: 2.33k]
  ------------------
  856|      0|            arg = "<NULL>";
  857|  2.33k|        len += strlen(arg);
  858|  2.33k|        if (len >= size) {
  ------------------
  |  Branch (858:13): [True: 0, False: 2.33k]
  ------------------
  859|      0|            char *p;
  860|       |
  861|      0|            size = len + 20;
  862|      0|            p = OPENSSL_realloc(str, size);
  ------------------
  |  |  120|      0|    CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  863|      0|            if (p == NULL) {
  ------------------
  |  Branch (863:17): [True: 0, False: 0]
  ------------------
  864|      0|                OPENSSL_free(str);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  865|      0|                return;
  866|      0|            }
  867|      0|            str = p;
  868|      0|        }
  869|  2.33k|        OPENSSL_strlcat(str, arg, size);
  870|  2.33k|    }
  871|  1.16k|    if (!err_set_error_data_int(str, size, flags, 0))
  ------------------
  |  Branch (871:9): [True: 0, False: 1.16k]
  ------------------
  872|      0|        OPENSSL_free(str);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  873|  1.16k|}
err.c:do_err_strings_init:
  213|      1|{
  214|      1|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      1|#define OPENSSL_INIT_BASE_ONLY 0x00040000L
  ------------------
  |  Branch (214:9): [True: 0, False: 1]
  ------------------
  215|      0|        return 0;
  216|      1|    err_string_lock = CRYPTO_THREAD_lock_new();
  217|      1|    if (err_string_lock == NULL)
  ------------------
  |  Branch (217:9): [True: 0, False: 1]
  ------------------
  218|      0|        return 0;
  219|      1|#ifndef OPENSSL_NO_ERR
  220|      1|    int_error_hash = lh_ERR_STRING_DATA_new(err_string_data_hash,
  ------------------
  |  |  377|      1|#define lh_ERR_STRING_DATA_new(hfn, cmp) ((LHASH_OF(ERR_STRING_DATA) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new(ossl_check_ERR_STRING_DATA_lh_hashfunc_type(hfn), ossl_check_ERR_STRING_DATA_lh_compfunc_type(cmp)), lh_ERR_STRING_DATA_hash_thunk, lh_ERR_STRING_DATA_comp_thunk, lh_ERR_STRING_DATA_doall_thunk, lh_ERR_STRING_DATA_doall_arg_thunk))
  ------------------
  221|      1|        err_string_data_cmp);
  222|      1|    if (int_error_hash == NULL) {
  ------------------
  |  Branch (222:9): [True: 0, False: 1]
  ------------------
  223|      0|        CRYPTO_THREAD_lock_free(err_string_lock);
  224|      0|        err_string_lock = NULL;
  225|      0|        return 0;
  226|      0|    }
  227|      1|#endif
  228|      1|    return 1;
  229|      1|}
err.c:err_string_data_hash:
  171|  6.20k|{
  172|  6.20k|    unsigned long ret, l;
  173|       |
  174|  6.20k|    l = a->error;
  175|  6.20k|    ret = l ^ ERR_GET_LIB(l);
  176|  6.20k|    return (ret ^ ret % 19 * 13);
  177|  6.20k|}
err.c:err_string_data_cmp:
  181|  4.61k|{
  182|  4.61k|    if (a->error == b->error)
  ------------------
  |  Branch (182:9): [True: 4.19k, False: 418]
  ------------------
  183|  4.19k|        return 0;
  184|    418|    return a->error > b->error ? 1 : -1;
  ------------------
  |  Branch (184:12): [True: 317, False: 101]
  ------------------
  185|  4.61k|}
err.c:err_load_strings:
  257|    110|{
  258|    110|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (258:9): [True: 0, False: 110]
  ------------------
  259|      0|        return 0;
  260|  4.96k|    for (; str->error; str++)
  ------------------
  |  Branch (260:12): [True: 4.85k, False: 110]
  ------------------
  261|  4.85k|        (void)lh_ERR_STRING_DATA_insert(int_error_hash,
  ------------------
  |  |  380|  4.96k|#define lh_ERR_STRING_DATA_insert(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_insert(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_ERR_STRING_DATA_lh_plain_type(ptr)))
  ------------------
  262|    110|            (ERR_STRING_DATA *)str);
  263|    110|    CRYPTO_THREAD_unlock(err_string_lock);
  264|    110|    return 1;
  265|    110|}
err.c:get_error_values:
  445|  1.24M|{
  446|  1.24M|    int i = 0;
  447|  1.24M|    ERR_STATE *es;
  448|  1.24M|    unsigned long ret;
  449|       |
  450|  1.24M|    es = ossl_err_get_state_int();
  451|  1.24M|    if (es == NULL)
  ------------------
  |  Branch (451:9): [True: 0, False: 1.24M]
  ------------------
  452|      0|        return 0;
  453|       |
  454|       |    /*
  455|       |     * Clear anything that should have been cleared earlier. We do this
  456|       |     * here because this doesn't have constant-time issues.
  457|       |     */
  458|  1.24M|    while (es->bottom != es->top) {
  ------------------
  |  Branch (458:12): [True: 1.01M, False: 228k]
  ------------------
  459|  1.01M|        if (es->err_flags[es->top] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   55|  1.01M|#define ERR_FLAG_CLEAR 0x02
  ------------------
  |  Branch (459:13): [True: 0, False: 1.01M]
  ------------------
  460|      0|            err_clear(es, es->top, 0);
  461|      0|            es->top = es->top > 0 ? es->top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   57|      0|#define ERR_NUM_ERRORS 16
  ------------------
  |  Branch (461:23): [True: 0, False: 0]
  ------------------
  462|      0|            continue;
  463|      0|        }
  464|  1.01M|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   57|  1.01M|#define ERR_NUM_ERRORS 16
  ------------------
  465|  1.01M|        if (es->err_flags[i] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   55|  1.01M|#define ERR_FLAG_CLEAR 0x02
  ------------------
  |  Branch (465:13): [True: 0, False: 1.01M]
  ------------------
  466|      0|            es->bottom = i;
  467|      0|            err_clear(es, es->bottom, 0);
  468|      0|            continue;
  469|      0|        }
  470|  1.01M|        break;
  471|  1.01M|    }
  472|       |
  473|       |    /* If everything has been cleared, the stack is empty. */
  474|  1.24M|    if (es->bottom == es->top)
  ------------------
  |  Branch (474:9): [True: 228k, False: 1.01M]
  ------------------
  475|   228k|        return 0;
  476|       |
  477|       |    /* Which error, the top of stack (latest one) or the first one? */
  478|  1.01M|    if (g == EV_PEEK_LAST)
  ------------------
  |  Branch (478:9): [True: 1.01M, False: 3.48k]
  ------------------
  479|  1.01M|        i = es->top;
  480|  3.48k|    else
  481|  3.48k|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   57|  3.48k|#define ERR_NUM_ERRORS 16
  ------------------
  482|       |
  483|  1.01M|    ret = es->err_buffer[i];
  484|  1.01M|    if (g == EV_POP) {
  ------------------
  |  Branch (484:9): [True: 557, False: 1.01M]
  ------------------
  485|    557|        es->bottom = i;
  486|    557|        es->err_buffer[i] = 0;
  487|    557|    }
  488|       |
  489|  1.01M|    if (file != NULL) {
  ------------------
  |  Branch (489:9): [True: 0, False: 1.01M]
  ------------------
  490|      0|        *file = es->err_file[i];
  491|      0|        if (*file == NULL)
  ------------------
  |  Branch (491:13): [True: 0, False: 0]
  ------------------
  492|      0|            *file = "";
  493|      0|    }
  494|  1.01M|    if (line != NULL)
  ------------------
  |  Branch (494:9): [True: 0, False: 1.01M]
  ------------------
  495|      0|        *line = es->err_line[i];
  496|  1.01M|    if (func != NULL) {
  ------------------
  |  Branch (496:9): [True: 0, False: 1.01M]
  ------------------
  497|      0|        *func = es->err_func[i];
  498|      0|        if (*func == NULL)
  ------------------
  |  Branch (498:13): [True: 0, False: 0]
  ------------------
  499|      0|            *func = "";
  500|      0|    }
  501|  1.01M|    if (flags != NULL)
  ------------------
  |  Branch (501:9): [True: 0, False: 1.01M]
  ------------------
  502|      0|        *flags = es->err_data_flags[i];
  503|  1.01M|    if (data == NULL) {
  ------------------
  |  Branch (503:9): [True: 1.01M, False: 0]
  ------------------
  504|  1.01M|        if (g == EV_POP) {
  ------------------
  |  Branch (504:13): [True: 557, False: 1.01M]
  ------------------
  505|    557|            err_clear_data(es, i, 0);
  506|    557|        }
  507|  1.01M|    } else {
  508|      0|        *data = es->err_data[i];
  509|      0|        if (*data == NULL) {
  ------------------
  |  Branch (509:13): [True: 0, False: 0]
  ------------------
  510|      0|            *data = "";
  511|      0|            if (flags != NULL)
  ------------------
  |  Branch (511:17): [True: 0, False: 0]
  ------------------
  512|      0|                *flags = 0;
  513|      0|        }
  514|      0|    }
  515|  1.01M|    return ret;
  516|  1.24M|}
err.c:int_err_get_item:
  188|  1.34k|{
  189|  1.34k|    ERR_STRING_DATA *p = NULL;
  190|       |
  191|  1.34k|    if (!CRYPTO_THREAD_read_lock(err_string_lock))
  ------------------
  |  Branch (191:9): [True: 0, False: 1.34k]
  ------------------
  192|      0|        return NULL;
  193|  1.34k|    p = lh_ERR_STRING_DATA_retrieve(int_error_hash, d);
  ------------------
  |  |  382|  1.34k|#define lh_ERR_STRING_DATA_retrieve(lh, ptr) ((ERR_STRING_DATA *)OPENSSL_LH_retrieve(ossl_check_ERR_STRING_DATA_lh_type(lh), ossl_check_const_ERR_STRING_DATA_lh_plain_type(ptr)))
  ------------------
  194|  1.34k|    CRYPTO_THREAD_unlock(err_string_lock);
  195|       |
  196|  1.34k|    return p;
  197|  1.34k|}
err.c:err_delete_thread_state:
  641|      1|{
  642|      1|    ERR_STATE *state = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
  643|      1|        CRYPTO_THREAD_NO_CONTEXT);
  ------------------
  |  |   25|      1|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  644|       |
  645|      1|    if (state == NULL)
  ------------------
  |  Branch (645:9): [True: 0, False: 1]
  ------------------
  646|      0|        return;
  647|       |
  648|      1|    CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_ERR_KEY,
  649|      1|        CRYPTO_THREAD_NO_CONTEXT, NULL);
  ------------------
  |  |   25|      1|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  650|      1|    OSSL_ERR_STATE_free(state);
  651|      1|}
err.c:err_set_error_data_int:
  774|  1.16k|{
  775|  1.16k|    ERR_STATE *es;
  776|       |
  777|  1.16k|    es = ossl_err_get_state_int();
  778|  1.16k|    if (es == NULL)
  ------------------
  |  Branch (778:9): [True: 0, False: 1.16k]
  ------------------
  779|      0|        return 0;
  780|       |
  781|  1.16k|    err_clear_data(es, es->top, deallocate);
  782|  1.16k|    err_set_data(es, es->top, data, size, flags);
  783|       |
  784|  1.16k|    return 1;
  785|  1.16k|}

ossl_err_load_crypto_strings:
   50|      1|{
   51|      1|    if (0
  ------------------
  |  Branch (51:9): [Folded, False: 1]
  ------------------
   52|      1|#ifndef OPENSSL_NO_ERR
   53|      1|        || ossl_err_load_ERR_strings() == 0 /* include error strings for SYSerr */
  ------------------
  |  Branch (53:12): [True: 0, False: 1]
  ------------------
   54|      1|        || ossl_err_load_BN_strings() == 0
  ------------------
  |  Branch (54:12): [True: 0, False: 1]
  ------------------
   55|      1|        || ossl_err_load_RSA_strings() == 0
  ------------------
  |  Branch (55:12): [True: 0, False: 1]
  ------------------
   56|      1|#ifndef OPENSSL_NO_DH
   57|      1|        || ossl_err_load_DH_strings() == 0
  ------------------
  |  Branch (57:12): [True: 0, False: 1]
  ------------------
   58|      1|#endif
   59|      1|        || ossl_err_load_EVP_strings() == 0
  ------------------
  |  Branch (59:12): [True: 0, False: 1]
  ------------------
   60|      1|        || ossl_err_load_BUF_strings() == 0
  ------------------
  |  Branch (60:12): [True: 0, False: 1]
  ------------------
   61|      1|        || ossl_err_load_OBJ_strings() == 0
  ------------------
  |  Branch (61:12): [True: 0, False: 1]
  ------------------
   62|      1|        || ossl_err_load_PEM_strings() == 0
  ------------------
  |  Branch (62:12): [True: 0, False: 1]
  ------------------
   63|      1|#ifndef OPENSSL_NO_DSA
   64|      1|        || ossl_err_load_DSA_strings() == 0
  ------------------
  |  Branch (64:12): [True: 0, False: 1]
  ------------------
   65|      1|#endif
   66|      1|        || ossl_err_load_X509_strings() == 0
  ------------------
  |  Branch (66:12): [True: 0, False: 1]
  ------------------
   67|      1|        || ossl_err_load_ASN1_strings() == 0
  ------------------
  |  Branch (67:12): [True: 0, False: 1]
  ------------------
   68|      1|        || ossl_err_load_CONF_strings() == 0
  ------------------
  |  Branch (68:12): [True: 0, False: 1]
  ------------------
   69|      1|        || ossl_err_load_CRYPTO_strings() == 0
  ------------------
  |  Branch (69:12): [True: 0, False: 1]
  ------------------
   70|      1|#ifndef OPENSSL_NO_COMP
   71|      1|        || ossl_err_load_COMP_strings() == 0
  ------------------
  |  Branch (71:12): [True: 0, False: 1]
  ------------------
   72|      1|#endif
   73|      1|#ifndef OPENSSL_NO_EC
   74|      1|        || ossl_err_load_EC_strings() == 0
  ------------------
  |  Branch (74:12): [True: 0, False: 1]
  ------------------
   75|      1|#endif
   76|       |        /* skip ossl_err_load_SSL_strings() because it is not in this library */
   77|      1|        || ossl_err_load_BIO_strings() == 0
  ------------------
  |  Branch (77:12): [True: 0, False: 1]
  ------------------
   78|      1|        || ossl_err_load_PKCS7_strings() == 0
  ------------------
  |  Branch (78:12): [True: 0, False: 1]
  ------------------
   79|      1|        || ossl_err_load_X509V3_strings() == 0
  ------------------
  |  Branch (79:12): [True: 0, False: 1]
  ------------------
   80|      1|        || ossl_err_load_PKCS12_strings() == 0
  ------------------
  |  Branch (80:12): [True: 0, False: 1]
  ------------------
   81|      1|        || ossl_err_load_RAND_strings() == 0
  ------------------
  |  Branch (81:12): [True: 0, False: 1]
  ------------------
   82|      1|        || ossl_err_load_DSO_strings() == 0
  ------------------
  |  Branch (82:12): [True: 0, False: 1]
  ------------------
   83|      1|#ifndef OPENSSL_NO_TS
   84|      1|        || ossl_err_load_TS_strings() == 0
  ------------------
  |  Branch (84:12): [True: 0, False: 1]
  ------------------
   85|      1|#endif
   86|      1|#ifndef OPENSSL_NO_ENGINE
   87|      1|        || ossl_err_load_ENGINE_strings() == 0
  ------------------
  |  Branch (87:12): [True: 0, False: 1]
  ------------------
   88|      1|#endif
   89|      1|#ifndef OPENSSL_NO_HTTP
   90|      1|        || ossl_err_load_HTTP_strings() == 0
  ------------------
  |  Branch (90:12): [True: 0, False: 1]
  ------------------
   91|      1|#endif
   92|      1|#ifndef OPENSSL_NO_OCSP
   93|      1|        || ossl_err_load_OCSP_strings() == 0
  ------------------
  |  Branch (93:12): [True: 0, False: 1]
  ------------------
   94|      1|#endif
   95|      1|        || ossl_err_load_UI_strings() == 0
  ------------------
  |  Branch (95:12): [True: 0, False: 1]
  ------------------
   96|      1|#ifndef OPENSSL_NO_CMS
   97|      1|        || ossl_err_load_CMS_strings() == 0
  ------------------
  |  Branch (97:12): [True: 0, False: 1]
  ------------------
   98|      1|#endif
   99|      1|#ifndef OPENSSL_NO_CRMF
  100|      1|        || ossl_err_load_CRMF_strings() == 0
  ------------------
  |  Branch (100:12): [True: 0, False: 1]
  ------------------
  101|      1|        || ossl_err_load_CMP_strings() == 0
  ------------------
  |  Branch (101:12): [True: 0, False: 1]
  ------------------
  102|      1|#endif
  103|      1|#ifndef OPENSSL_NO_CT
  104|      1|        || ossl_err_load_CT_strings() == 0
  ------------------
  |  Branch (104:12): [True: 0, False: 1]
  ------------------
  105|      1|#endif
  106|      1|        || ossl_err_load_ESS_strings() == 0
  ------------------
  |  Branch (106:12): [True: 0, False: 1]
  ------------------
  107|      1|        || ossl_err_load_ASYNC_strings() == 0
  ------------------
  |  Branch (107:12): [True: 0, False: 1]
  ------------------
  108|      1|#ifndef OPENSSL_NO_SM2
  109|      1|        || ossl_err_load_SM2_strings() == 0
  ------------------
  |  Branch (109:12): [True: 0, False: 1]
  ------------------
  110|      1|#endif
  111|      1|        || ossl_err_load_OSSL_STORE_strings() == 0
  ------------------
  |  Branch (111:12): [True: 0, False: 1]
  ------------------
  112|      1|        || ossl_err_load_PROP_strings() == 0
  ------------------
  |  Branch (112:12): [True: 0, False: 1]
  ------------------
  113|      1|        || ossl_err_load_PROV_strings() == 0
  ------------------
  |  Branch (113:12): [True: 0, False: 1]
  ------------------
  114|      1|#endif
  115|      1|    )
  116|      0|        return 0;
  117|       |
  118|      1|    return 1;
  119|      1|}

ERR_new:
   17|  2.06M|{
   18|  2.06M|    ERR_STATE *es;
   19|       |
   20|  2.06M|    es = ossl_err_get_state_int();
   21|  2.06M|    if (es == NULL)
  ------------------
  |  Branch (21:9): [True: 0, False: 2.06M]
  ------------------
   22|      0|        return;
   23|       |
   24|       |    /* Allocate a slot */
   25|  2.06M|    err_get_slot(es);
   26|  2.06M|    err_clear(es, es->top, 0);
   27|  2.06M|}
ERR_set_debug:
   30|  2.06M|{
   31|  2.06M|    ERR_STATE *es;
   32|       |
   33|  2.06M|    es = ossl_err_get_state_int();
   34|  2.06M|    if (es == NULL)
  ------------------
  |  Branch (34:9): [True: 0, False: 2.06M]
  ------------------
   35|      0|        return;
   36|       |
   37|  2.06M|    err_set_debug(es, es->top, file, line, func);
   38|  2.06M|}
ERR_set_error:
   41|  2.05M|{
   42|  2.05M|    va_list args;
   43|       |
   44|  2.05M|    va_start(args, fmt);
   45|  2.05M|    ERR_vset_error(lib, reason, fmt, args);
   46|       |    va_end(args);
   47|  2.05M|}
ERR_vset_error:
   50|  2.06M|{
   51|  2.06M|    ERR_STATE *es;
   52|  2.06M|    char *buf = NULL;
   53|  2.06M|    size_t buf_size = 0;
   54|  2.06M|    unsigned long flags = 0;
   55|  2.06M|    size_t i;
   56|       |
   57|  2.06M|    es = ossl_err_get_state_int();
   58|  2.06M|    if (es == NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 2.06M]
  ------------------
   59|      0|        return;
   60|  2.06M|    i = es->top;
   61|       |
   62|  2.06M|    if (fmt != NULL) {
  ------------------
  |  Branch (62:9): [True: 81.7k, False: 1.97M]
  ------------------
   63|  81.7k|        int printed_len = 0;
   64|  81.7k|        char *rbuf = NULL;
   65|       |
   66|  81.7k|        buf = es->err_data[i];
   67|  81.7k|        buf_size = es->err_data_size[i];
   68|       |
   69|       |        /*
   70|       |         * To protect the string we just grabbed from tampering by other
   71|       |         * functions we may call, or to protect them from freeing a pointer
   72|       |         * that may no longer be valid at that point, we clear away the
   73|       |         * data pointer and the flags.  We will set them again at the end
   74|       |         * of this function.
   75|       |         */
   76|  81.7k|        es->err_data[i] = NULL;
   77|  81.7k|        es->err_data_flags[i] = 0;
   78|       |
   79|       |        /*
   80|       |         * Try to maximize the space available.  If that fails, we use what
   81|       |         * we have.
   82|       |         */
   83|  81.7k|        if (buf_size < ERR_MAX_DATA_SIZE
  ------------------
  |  |  395|   163k|#define ERR_MAX_DATA_SIZE 1024
  ------------------
  |  Branch (83:13): [True: 81.6k, False: 90]
  ------------------
   84|  81.6k|            && (rbuf = OPENSSL_realloc(buf, ERR_MAX_DATA_SIZE)) != NULL) {
  ------------------
  |  |  120|  81.6k|    CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (84:16): [True: 81.6k, False: 0]
  ------------------
   85|  81.6k|            buf = rbuf;
   86|  81.6k|            buf_size = ERR_MAX_DATA_SIZE;
  ------------------
  |  |  395|  81.6k|#define ERR_MAX_DATA_SIZE 1024
  ------------------
   87|  81.6k|        }
   88|       |
   89|  81.7k|        if (buf != NULL) {
  ------------------
  |  Branch (89:13): [True: 81.7k, False: 0]
  ------------------
   90|  81.7k|            printed_len = BIO_vsnprintf(buf, buf_size, fmt, args);
   91|  81.7k|        }
   92|  81.7k|        if (printed_len < 0)
  ------------------
  |  Branch (92:13): [True: 1.38k, False: 80.3k]
  ------------------
   93|  1.38k|            printed_len = 0;
   94|  81.7k|        if (buf != NULL)
  ------------------
  |  Branch (94:13): [True: 81.7k, False: 0]
  ------------------
   95|  81.7k|            buf[printed_len] = '\0';
   96|       |
   97|       |        /*
   98|       |         * Try to reduce the size, but only if we maximized above.  If that
   99|       |         * fails, we keep what we have.
  100|       |         * (According to documentation, realloc leaves the old buffer untouched
  101|       |         * if it fails)
  102|       |         */
  103|  81.7k|        if ((rbuf = OPENSSL_realloc(buf, printed_len + 1)) != NULL) {
  ------------------
  |  |  120|  81.7k|    CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (103:13): [True: 81.7k, False: 0]
  ------------------
  104|  81.7k|            buf = rbuf;
  105|  81.7k|            buf_size = printed_len + 1;
  106|  81.7k|            buf[printed_len] = '\0';
  107|  81.7k|        }
  108|       |
  109|  81.7k|        if (buf != NULL)
  ------------------
  |  Branch (109:13): [True: 81.7k, False: 0]
  ------------------
  110|  81.7k|            flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   50|  81.7k|#define ERR_TXT_MALLOCED 0x01
  ------------------
                          flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   51|  81.7k|#define ERR_TXT_STRING 0x02
  ------------------
  111|  81.7k|    }
  112|       |
  113|  2.06M|    err_clear_data(es, es->top, 0);
  114|  2.06M|    err_set_error(es, es->top, lib, reason);
  115|  2.06M|    if (fmt != NULL)
  ------------------
  |  Branch (115:9): [True: 81.7k, False: 1.97M]
  ------------------
  116|  81.7k|        err_set_data(es, es->top, buf, buf_size, flags);
  117|  2.06M|}

err.c:err_clear:
   86|  66.5k|{
   87|  66.5k|    err_clear_data(es, i, (deall));
   88|  66.5k|    es->err_marks[i] = 0;
   89|  66.5k|    es->err_flags[i] = 0;
   90|  66.5k|    es->err_buffer[i] = 0;
   91|  66.5k|    es->err_line[i] = -1;
   92|  66.5k|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  131|  66.5k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|  66.5k|    es->err_file[i] = NULL;
   94|  66.5k|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  131|  66.5k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   95|       |    es->err_func[i] = NULL;
   96|  66.5k|}
err.c:err_clear_data:
   22|  68.3k|{
   23|  68.3k|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   50|  68.3k|#define ERR_TXT_MALLOCED 0x01
  ------------------
  |  Branch (23:9): [True: 68.3k, False: 2]
  ------------------
   24|  68.3k|        if (deall) {
  ------------------
  |  Branch (24:13): [True: 16, False: 68.2k]
  ------------------
   25|     16|            OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  131|     16|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|     16|            es->err_data[i] = NULL;
   27|     16|            es->err_data_size[i] = 0;
   28|     16|            es->err_data_flags[i] = 0;
   29|  68.2k|        } else if (es->err_data[i] != NULL) {
  ------------------
  |  Branch (29:20): [True: 68.2k, False: 0]
  ------------------
   30|  68.2k|            es->err_data[i][0] = '\0';
   31|  68.2k|            es->err_data_flags[i] = ERR_TXT_MALLOCED;
  ------------------
  |  |   50|  68.2k|#define ERR_TXT_MALLOCED 0x01
  ------------------
   32|  68.2k|        }
   33|  68.3k|    } else {
   34|       |        es->err_data[i] = NULL;
   35|      2|        es->err_data_size[i] = 0;
   36|      2|        es->err_data_flags[i] = 0;
   37|      2|    }
   38|  68.3k|}
err.c:err_set_data:
   77|  1.16k|{
   78|  1.16k|    if ((es->err_data_flags[i] & ERR_TXT_MALLOCED) != 0)
  ------------------
  |  |   50|  1.16k|#define ERR_TXT_MALLOCED 0x01
  ------------------
  |  Branch (78:9): [True: 1.16k, False: 0]
  ------------------
   79|  1.16k|        OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  131|  1.16k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   80|  1.16k|    es->err_data[i] = data;
   81|  1.16k|    es->err_data_size[i] = datasz;
   82|  1.16k|    es->err_data_flags[i] = flags;
   83|  1.16k|}
err_blocks.c:err_get_slot:
   15|  2.06M|{
   16|  2.06M|    es->top = (es->top + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   57|  2.06M|#define ERR_NUM_ERRORS 16
  ------------------
   17|  2.06M|    if (es->top == es->bottom)
  ------------------
  |  Branch (17:9): [True: 2.43k, False: 2.05M]
  ------------------
   18|  2.43k|        es->bottom = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   57|  2.43k|#define ERR_NUM_ERRORS 16
  ------------------
   19|  2.06M|}
err_blocks.c:err_clear:
   86|  2.06M|{
   87|  2.06M|    err_clear_data(es, i, (deall));
   88|  2.06M|    es->err_marks[i] = 0;
   89|  2.06M|    es->err_flags[i] = 0;
   90|  2.06M|    es->err_buffer[i] = 0;
   91|  2.06M|    es->err_line[i] = -1;
   92|  2.06M|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  131|  2.06M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|  2.06M|    es->err_file[i] = NULL;
   94|  2.06M|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  131|  2.06M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   95|       |    es->err_func[i] = NULL;
   96|  2.06M|}
err_blocks.c:err_set_debug:
   51|  2.06M|{
   52|       |    /*
   53|       |     * We dup the file and fn strings because they may be provider owned. If the
   54|       |     * provider gets unloaded, they may not be valid anymore.
   55|       |     */
   56|  2.06M|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  131|  2.06M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   57|  2.06M|    if (file == NULL || file[0] == '\0')
  ------------------
  |  Branch (57:9): [True: 0, False: 2.06M]
  |  Branch (57:25): [True: 0, False: 2.06M]
  ------------------
   58|      0|        es->err_file[i] = NULL;
   59|  2.06M|    else if ((es->err_file[i] = CRYPTO_malloc(strlen(file) + 1,
  ------------------
  |  Branch (59:14): [True: 2.06M, False: 0]
  ------------------
   60|  2.06M|                  NULL, 0))
   61|  2.06M|        != NULL)
   62|       |        /* We cannot use OPENSSL_strdup due to possible recursion */
   63|  2.06M|        strcpy(es->err_file[i], file);
   64|       |
   65|  2.06M|    es->err_line[i] = line;
   66|  2.06M|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  131|  2.06M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   67|  2.06M|    if (fn == NULL || fn[0] == '\0')
  ------------------
  |  Branch (67:9): [True: 1.29k, False: 2.06M]
  |  Branch (67:23): [True: 0, False: 2.06M]
  ------------------
   68|  1.29k|        es->err_func[i] = NULL;
   69|  2.06M|    else if ((es->err_func[i] = CRYPTO_malloc(strlen(fn) + 1,
  ------------------
  |  Branch (69:14): [True: 2.06M, False: 0]
  ------------------
   70|  2.06M|                  NULL, 0))
   71|  2.06M|        != NULL)
   72|  2.06M|        strcpy(es->err_func[i], fn);
   73|  2.06M|}
err_blocks.c:err_clear_data:
   22|  4.12M|{
   23|  4.12M|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   50|  4.12M|#define ERR_TXT_MALLOCED 0x01
  ------------------
  |  Branch (23:9): [True: 4.04M, False: 81.7k]
  ------------------
   24|  4.04M|        if (deall) {
  ------------------
  |  Branch (24:13): [True: 0, False: 4.04M]
  ------------------
   25|      0|            OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|      0|            es->err_data[i] = NULL;
   27|      0|            es->err_data_size[i] = 0;
   28|      0|            es->err_data_flags[i] = 0;
   29|  4.04M|        } else if (es->err_data[i] != NULL) {
  ------------------
  |  Branch (29:20): [True: 4.04M, False: 0]
  ------------------
   30|  4.04M|            es->err_data[i][0] = '\0';
   31|  4.04M|            es->err_data_flags[i] = ERR_TXT_MALLOCED;
  ------------------
  |  |   50|  4.04M|#define ERR_TXT_MALLOCED 0x01
  ------------------
   32|  4.04M|        }
   33|  4.04M|    } else {
   34|       |        es->err_data[i] = NULL;
   35|  81.7k|        es->err_data_size[i] = 0;
   36|  81.7k|        es->err_data_flags[i] = 0;
   37|  81.7k|    }
   38|  4.12M|}
err_blocks.c:err_set_error:
   42|  2.06M|{
   43|  2.06M|    es->err_buffer[i] = lib == ERR_LIB_SYS
  ------------------
  |  |   74|  2.06M|#define ERR_LIB_SYS 2
  ------------------
  |  Branch (43:25): [True: 938, False: 2.06M]
  ------------------
   44|  2.06M|        ? (unsigned int)(ERR_SYSTEM_FLAG | reason)
  ------------------
  |  |  220|    938|#define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
  ------------------
   45|  2.06M|        : ERR_PACK(lib, 0, reason);
  ------------------
  |  |  281|  4.12M|    ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  229|  2.06M|#define ERR_LIB_MASK 0xFF
  |  |  ------------------
  |  |                   ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  228|  2.06M|#define ERR_LIB_OFFSET 23L
  |  |  ------------------
  |  |                   ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  232|  2.06M|#define ERR_REASON_MASK 0X7FFFFF
  |  |  ------------------
  ------------------
   46|  2.06M|}
err_blocks.c:err_set_data:
   77|  81.7k|{
   78|  81.7k|    if ((es->err_data_flags[i] & ERR_TXT_MALLOCED) != 0)
  ------------------
  |  |   50|  81.7k|#define ERR_TXT_MALLOCED 0x01
  ------------------
  |  Branch (78:9): [True: 0, False: 81.7k]
  ------------------
   79|      0|        OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   80|  81.7k|    es->err_data[i] = data;
   81|  81.7k|    es->err_data_size[i] = datasz;
   82|  81.7k|    es->err_data_flags[i] = flags;
   83|  81.7k|}
err_mark.c:err_clear:
   86|  2.05M|{
   87|  2.05M|    err_clear_data(es, i, (deall));
   88|  2.05M|    es->err_marks[i] = 0;
   89|  2.05M|    es->err_flags[i] = 0;
   90|  2.05M|    es->err_buffer[i] = 0;
   91|  2.05M|    es->err_line[i] = -1;
   92|  2.05M|    OPENSSL_free(es->err_file[i]);
  ------------------
  |  |  131|  2.05M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|  2.05M|    es->err_file[i] = NULL;
   94|  2.05M|    OPENSSL_free(es->err_func[i]);
  ------------------
  |  |  131|  2.05M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   95|       |    es->err_func[i] = NULL;
   96|  2.05M|}
err_mark.c:err_clear_data:
   22|  2.05M|{
   23|  2.05M|    if (es->err_data_flags[i] & ERR_TXT_MALLOCED) {
  ------------------
  |  |   50|  2.05M|#define ERR_TXT_MALLOCED 0x01
  ------------------
  |  Branch (23:9): [True: 2.05M, False: 2]
  ------------------
   24|  2.05M|        if (deall) {
  ------------------
  |  Branch (24:13): [True: 0, False: 2.05M]
  ------------------
   25|      0|            OPENSSL_free(es->err_data[i]);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|      0|            es->err_data[i] = NULL;
   27|      0|            es->err_data_size[i] = 0;
   28|      0|            es->err_data_flags[i] = 0;
   29|  2.05M|        } else if (es->err_data[i] != NULL) {
  ------------------
  |  Branch (29:20): [True: 2.05M, False: 0]
  ------------------
   30|  2.05M|            es->err_data[i][0] = '\0';
   31|  2.05M|            es->err_data_flags[i] = ERR_TXT_MALLOCED;
  ------------------
  |  |   50|  2.05M|#define ERR_TXT_MALLOCED 0x01
  ------------------
   32|  2.05M|        }
   33|  2.05M|    } else {
   34|       |        es->err_data[i] = NULL;
   35|      2|        es->err_data_size[i] = 0;
   36|      2|        es->err_data_flags[i] = 0;
   37|      2|    }
   38|  2.05M|}

ERR_set_mark:
   16|  6.29M|{
   17|  6.29M|    ERR_STATE *es;
   18|       |
   19|  6.29M|    es = ossl_err_get_state_int();
   20|  6.29M|    if (es == NULL)
  ------------------
  |  Branch (20:9): [True: 0, False: 6.29M]
  ------------------
   21|      0|        return 0;
   22|       |
   23|  6.29M|    if (es->bottom == es->top)
  ------------------
  |  Branch (23:9): [True: 3.18M, False: 3.10M]
  ------------------
   24|  3.18M|        return 0;
   25|  3.10M|    es->err_marks[es->top]++;
   26|  3.10M|    return 1;
   27|  6.29M|}
ERR_pop_to_mark:
   43|  4.21M|{
   44|  4.21M|    ERR_STATE *es;
   45|       |
   46|  4.21M|    es = ossl_err_get_state_int();
   47|  4.21M|    if (es == NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 4.21M]
  ------------------
   48|      0|        return 0;
   49|       |
   50|  6.27M|    while (es->bottom != es->top
  ------------------
  |  Branch (50:12): [True: 4.22M, False: 2.04M]
  ------------------
   51|  4.22M|        && es->err_marks[es->top] == 0) {
  ------------------
  |  Branch (51:12): [True: 2.05M, False: 2.17M]
  ------------------
   52|  2.05M|        err_clear(es, es->top, 0);
   53|  2.05M|        es->top = es->top > 0 ? es->top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   57|    802|#define ERR_NUM_ERRORS 16
  ------------------
  |  Branch (53:19): [True: 2.05M, False: 802]
  ------------------
   54|  2.05M|    }
   55|       |
   56|  4.21M|    if (es->bottom == es->top)
  ------------------
  |  Branch (56:9): [True: 2.04M, False: 2.17M]
  ------------------
   57|  2.04M|        return 0;
   58|  2.17M|    es->err_marks[es->top]--;
   59|  2.17M|    return 1;
   60|  4.21M|}
ERR_clear_last_mark:
   82|  2.07M|{
   83|  2.07M|    ERR_STATE *es;
   84|  2.07M|    int top;
   85|       |
   86|  2.07M|    es = ossl_err_get_state_int();
   87|  2.07M|    if (es == NULL)
  ------------------
  |  Branch (87:9): [True: 0, False: 2.07M]
  ------------------
   88|      0|        return 0;
   89|       |
   90|  2.07M|    top = es->top;
   91|  2.07M|    while (es->bottom != top
  ------------------
  |  Branch (91:12): [True: 929k, False: 1.14M]
  ------------------
   92|   929k|        && es->err_marks[top] == 0) {
  ------------------
  |  Branch (92:12): [True: 2.35k, False: 926k]
  ------------------
   93|  2.35k|        top = top > 0 ? top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   57|     68|#define ERR_NUM_ERRORS 16
  ------------------
  |  Branch (93:15): [True: 2.29k, False: 68]
  ------------------
   94|  2.35k|    }
   95|       |
   96|  2.07M|    if (es->bottom == top)
  ------------------
  |  Branch (96:9): [True: 1.14M, False: 926k]
  ------------------
   97|  1.14M|        return 0;
   98|   926k|    es->err_marks[top]--;
   99|   926k|    return 1;
  100|  2.07M|}

OSSL_ERR_STATE_new:
   22|      1|{
   23|       |    return CRYPTO_zalloc(sizeof(ERR_STATE), NULL, 0);
   24|      1|}

ossl_err_load_ESS_strings:
   42|      1|{
   43|      1|#ifndef OPENSSL_NO_ERR
   44|      1|    if (ERR_reason_error_string(ESS_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (44:9): [True: 1, False: 0]
  ------------------
   45|      1|        ERR_load_strings_const(ESS_str_reasons);
   46|      1|#endif
   47|      1|    return 1;
   48|      1|}

openssl_add_all_ciphers_int:
   18|      1|{
   19|       |
   20|      1|#ifndef OPENSSL_NO_DES
   21|      1|    EVP_add_cipher(EVP_des_cfb());
  ------------------
  |  |  997|      1|#define EVP_des_cfb EVP_des_cfb64
  ------------------
   22|      1|    EVP_add_cipher(EVP_des_cfb1());
   23|      1|    EVP_add_cipher(EVP_des_cfb8());
   24|      1|    EVP_add_cipher(EVP_des_ede_cfb());
  ------------------
  |  | 1001|      1|#define EVP_des_ede_cfb EVP_des_ede_cfb64
  ------------------
   25|      1|    EVP_add_cipher(EVP_des_ede3_cfb());
  ------------------
  |  | 1003|      1|#define EVP_des_ede3_cfb EVP_des_ede3_cfb64
  ------------------
   26|      1|    EVP_add_cipher(EVP_des_ede3_cfb1());
   27|      1|    EVP_add_cipher(EVP_des_ede3_cfb8());
   28|       |
   29|      1|    EVP_add_cipher(EVP_des_ofb());
   30|      1|    EVP_add_cipher(EVP_des_ede_ofb());
   31|      1|    EVP_add_cipher(EVP_des_ede3_ofb());
   32|       |
   33|      1|    EVP_add_cipher(EVP_desx_cbc());
   34|      1|    EVP_add_cipher_alias(SN_desx_cbc, "DESX");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   35|      1|    EVP_add_cipher_alias(SN_desx_cbc, "desx");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   36|       |
   37|      1|    EVP_add_cipher(EVP_des_cbc());
   38|      1|    EVP_add_cipher_alias(SN_des_cbc, "DES");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   39|      1|    EVP_add_cipher_alias(SN_des_cbc, "des");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   40|      1|    EVP_add_cipher(EVP_des_ede_cbc());
   41|      1|    EVP_add_cipher(EVP_des_ede3_cbc());
   42|      1|    EVP_add_cipher_alias(SN_des_ede3_cbc, "DES3");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   43|      1|    EVP_add_cipher_alias(SN_des_ede3_cbc, "des3");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   44|       |
   45|      1|    EVP_add_cipher(EVP_des_ecb());
   46|      1|    EVP_add_cipher(EVP_des_ede());
   47|      1|    EVP_add_cipher_alias(SN_des_ede_ecb, "DES-EDE-ECB");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   48|      1|    EVP_add_cipher_alias(SN_des_ede_ecb, "des-ede-ecb");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   49|      1|    EVP_add_cipher(EVP_des_ede3());
   50|      1|    EVP_add_cipher_alias(SN_des_ede3_ecb, "DES-EDE3-ECB");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   51|      1|    EVP_add_cipher_alias(SN_des_ede3_ecb, "des-ede3-ecb");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   52|      1|    EVP_add_cipher(EVP_des_ede3_wrap());
   53|      1|    EVP_add_cipher_alias(SN_id_smime_alg_CMS3DESwrap, "des3-wrap");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   54|      1|#endif
   55|       |
   56|      1|#ifndef OPENSSL_NO_RC4
   57|      1|    EVP_add_cipher(EVP_rc4());
   58|      1|    EVP_add_cipher(EVP_rc4_40());
   59|      1|#ifndef OPENSSL_NO_MD5
   60|      1|    EVP_add_cipher(EVP_rc4_hmac_md5());
   61|      1|#endif
   62|      1|#endif
   63|       |
   64|      1|#ifndef OPENSSL_NO_IDEA
   65|      1|    EVP_add_cipher(EVP_idea_ecb());
   66|      1|    EVP_add_cipher(EVP_idea_cfb());
  ------------------
  |  | 1030|      1|#define EVP_idea_cfb EVP_idea_cfb64
  ------------------
   67|      1|    EVP_add_cipher(EVP_idea_ofb());
   68|      1|    EVP_add_cipher(EVP_idea_cbc());
   69|      1|    EVP_add_cipher_alias(SN_idea_cbc, "IDEA");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   70|      1|    EVP_add_cipher_alias(SN_idea_cbc, "idea");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   71|      1|#endif
   72|       |
   73|      1|#ifndef OPENSSL_NO_SEED
   74|      1|    EVP_add_cipher(EVP_seed_ecb());
   75|      1|    EVP_add_cipher(EVP_seed_cfb());
  ------------------
  |  | 1184|      1|#define EVP_seed_cfb EVP_seed_cfb128
  ------------------
   76|      1|    EVP_add_cipher(EVP_seed_ofb());
   77|      1|    EVP_add_cipher(EVP_seed_cbc());
   78|      1|    EVP_add_cipher_alias(SN_seed_cbc, "SEED");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   79|      1|    EVP_add_cipher_alias(SN_seed_cbc, "seed");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   80|      1|#endif
   81|       |
   82|      1|#ifndef OPENSSL_NO_SM4
   83|      1|    EVP_add_cipher(EVP_sm4_ecb());
   84|      1|    EVP_add_cipher(EVP_sm4_cbc());
   85|      1|    EVP_add_cipher(EVP_sm4_cfb());
  ------------------
  |  | 1192|      1|#define EVP_sm4_cfb EVP_sm4_cfb128
  ------------------
   86|      1|    EVP_add_cipher(EVP_sm4_ofb());
   87|      1|    EVP_add_cipher(EVP_sm4_ctr());
   88|      1|    EVP_add_cipher_alias(SN_sm4_cbc, "SM4");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   89|      1|    EVP_add_cipher_alias(SN_sm4_cbc, "sm4");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   90|      1|#endif
   91|       |
   92|      1|#ifndef OPENSSL_NO_RC2
   93|      1|    EVP_add_cipher(EVP_rc2_ecb());
   94|      1|    EVP_add_cipher(EVP_rc2_cfb());
  ------------------
  |  | 1040|      1|#define EVP_rc2_cfb EVP_rc2_cfb64
  ------------------
   95|      1|    EVP_add_cipher(EVP_rc2_ofb());
   96|      1|    EVP_add_cipher(EVP_rc2_cbc());
   97|      1|    EVP_add_cipher(EVP_rc2_40_cbc());
   98|      1|    EVP_add_cipher(EVP_rc2_64_cbc());
   99|      1|    EVP_add_cipher_alias(SN_rc2_cbc, "RC2");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  100|      1|    EVP_add_cipher_alias(SN_rc2_cbc, "rc2");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  101|      1|    EVP_add_cipher_alias(SN_rc2_cbc, "rc2-128");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  102|      1|    EVP_add_cipher_alias(SN_rc2_64_cbc, "rc2-64");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  103|      1|    EVP_add_cipher_alias(SN_rc2_40_cbc, "rc2-40");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  104|      1|#endif
  105|       |
  106|      1|#ifndef OPENSSL_NO_BF
  107|      1|    EVP_add_cipher(EVP_bf_ecb());
  108|      1|    EVP_add_cipher(EVP_bf_cfb());
  ------------------
  |  | 1047|      1|#define EVP_bf_cfb EVP_bf_cfb64
  ------------------
  109|      1|    EVP_add_cipher(EVP_bf_ofb());
  110|      1|    EVP_add_cipher(EVP_bf_cbc());
  111|      1|    EVP_add_cipher_alias(SN_bf_cbc, "BF");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  112|      1|    EVP_add_cipher_alias(SN_bf_cbc, "bf");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  113|      1|    EVP_add_cipher_alias(SN_bf_cbc, "blowfish");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  114|      1|#endif
  115|       |
  116|      1|#ifndef OPENSSL_NO_CAST
  117|      1|    EVP_add_cipher(EVP_cast5_ecb());
  118|      1|    EVP_add_cipher(EVP_cast5_cfb());
  ------------------
  |  | 1054|      1|#define EVP_cast5_cfb EVP_cast5_cfb64
  ------------------
  119|      1|    EVP_add_cipher(EVP_cast5_ofb());
  120|      1|    EVP_add_cipher(EVP_cast5_cbc());
  121|      1|    EVP_add_cipher_alias(SN_cast5_cbc, "CAST");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  122|      1|    EVP_add_cipher_alias(SN_cast5_cbc, "cast");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  123|      1|    EVP_add_cipher_alias(SN_cast5_cbc, "CAST-cbc");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  124|      1|    EVP_add_cipher_alias(SN_cast5_cbc, "cast-cbc");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  125|      1|#endif
  126|       |
  127|      1|#ifndef OPENSSL_NO_RC5
  128|      1|    EVP_add_cipher(EVP_rc5_32_12_16_ecb());
  129|      1|    EVP_add_cipher(EVP_rc5_32_12_16_cfb());
  ------------------
  |  | 1061|      1|#define EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64
  ------------------
  130|      1|    EVP_add_cipher(EVP_rc5_32_12_16_ofb());
  131|      1|    EVP_add_cipher(EVP_rc5_32_12_16_cbc());
  132|      1|    EVP_add_cipher_alias(SN_rc5_cbc, "rc5");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  133|      1|    EVP_add_cipher_alias(SN_rc5_cbc, "RC5");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  134|      1|#endif
  135|       |
  136|      1|    EVP_add_cipher(EVP_aes_128_ecb());
  137|      1|    EVP_add_cipher(EVP_aes_128_cbc());
  138|      1|    EVP_add_cipher(EVP_aes_128_cfb());
  ------------------
  |  | 1069|      1|#define EVP_aes_128_cfb EVP_aes_128_cfb128
  ------------------
  139|      1|    EVP_add_cipher(EVP_aes_128_cfb1());
  140|      1|    EVP_add_cipher(EVP_aes_128_cfb8());
  141|      1|    EVP_add_cipher(EVP_aes_128_ofb());
  142|      1|    EVP_add_cipher(EVP_aes_128_ctr());
  143|      1|    EVP_add_cipher(EVP_aes_128_gcm());
  144|      1|#ifndef OPENSSL_NO_OCB
  145|      1|    EVP_add_cipher(EVP_aes_128_ocb());
  146|      1|#endif
  147|      1|    EVP_add_cipher(EVP_aes_128_xts());
  148|      1|    EVP_add_cipher(EVP_aes_128_ccm());
  149|      1|    EVP_add_cipher(EVP_aes_128_wrap());
  150|      1|    EVP_add_cipher_alias(SN_id_aes128_wrap, "aes128-wrap");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  151|      1|    EVP_add_cipher(EVP_aes_128_wrap_pad());
  152|      1|    EVP_add_cipher_alias(SN_id_aes128_wrap_pad, "aes128-wrap-pad");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  153|      1|    EVP_add_cipher_alias(SN_aes_128_cbc, "AES128");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  154|      1|    EVP_add_cipher_alias(SN_aes_128_cbc, "aes128");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  155|      1|    EVP_add_cipher(EVP_aes_192_ecb());
  156|      1|    EVP_add_cipher(EVP_aes_192_cbc());
  157|      1|    EVP_add_cipher(EVP_aes_192_cfb());
  ------------------
  |  | 1085|      1|#define EVP_aes_192_cfb EVP_aes_192_cfb128
  ------------------
  158|      1|    EVP_add_cipher(EVP_aes_192_cfb1());
  159|      1|    EVP_add_cipher(EVP_aes_192_cfb8());
  160|      1|    EVP_add_cipher(EVP_aes_192_ofb());
  161|      1|    EVP_add_cipher(EVP_aes_192_ctr());
  162|      1|    EVP_add_cipher(EVP_aes_192_gcm());
  163|      1|#ifndef OPENSSL_NO_OCB
  164|      1|    EVP_add_cipher(EVP_aes_192_ocb());
  165|      1|#endif
  166|      1|    EVP_add_cipher(EVP_aes_192_ccm());
  167|      1|    EVP_add_cipher(EVP_aes_192_wrap());
  168|      1|    EVP_add_cipher_alias(SN_id_aes192_wrap, "aes192-wrap");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  169|      1|    EVP_add_cipher(EVP_aes_192_wrap_pad());
  170|      1|    EVP_add_cipher_alias(SN_id_aes192_wrap_pad, "aes192-wrap-pad");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  171|      1|    EVP_add_cipher_alias(SN_aes_192_cbc, "AES192");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  172|      1|    EVP_add_cipher_alias(SN_aes_192_cbc, "aes192");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  173|      1|    EVP_add_cipher(EVP_aes_256_ecb());
  174|      1|    EVP_add_cipher(EVP_aes_256_cbc());
  175|      1|    EVP_add_cipher(EVP_aes_256_cfb());
  ------------------
  |  | 1100|      1|#define EVP_aes_256_cfb EVP_aes_256_cfb128
  ------------------
  176|      1|    EVP_add_cipher(EVP_aes_256_cfb1());
  177|      1|    EVP_add_cipher(EVP_aes_256_cfb8());
  178|      1|    EVP_add_cipher(EVP_aes_256_ofb());
  179|      1|    EVP_add_cipher(EVP_aes_256_ctr());
  180|      1|    EVP_add_cipher(EVP_aes_256_gcm());
  181|      1|#ifndef OPENSSL_NO_OCB
  182|      1|    EVP_add_cipher(EVP_aes_256_ocb());
  183|      1|#endif
  184|      1|    EVP_add_cipher(EVP_aes_256_xts());
  185|      1|    EVP_add_cipher(EVP_aes_256_ccm());
  186|      1|    EVP_add_cipher(EVP_aes_256_wrap());
  187|      1|    EVP_add_cipher_alias(SN_id_aes256_wrap, "aes256-wrap");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  188|      1|    EVP_add_cipher(EVP_aes_256_wrap_pad());
  189|      1|    EVP_add_cipher_alias(SN_id_aes256_wrap_pad, "aes256-wrap-pad");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  190|      1|    EVP_add_cipher_alias(SN_aes_256_cbc, "AES256");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  191|      1|    EVP_add_cipher_alias(SN_aes_256_cbc, "aes256");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  192|      1|    EVP_add_cipher(EVP_aes_128_cbc_hmac_sha1());
  193|      1|    EVP_add_cipher(EVP_aes_256_cbc_hmac_sha1());
  194|      1|    EVP_add_cipher(EVP_aes_128_cbc_hmac_sha256());
  195|      1|    EVP_add_cipher(EVP_aes_256_cbc_hmac_sha256());
  196|      1|#ifndef OPENSSL_NO_ARIA
  197|      1|    EVP_add_cipher(EVP_aria_128_ecb());
  198|      1|    EVP_add_cipher(EVP_aria_128_cbc());
  199|      1|    EVP_add_cipher(EVP_aria_128_cfb());
  ------------------
  |  | 1121|      1|#define EVP_aria_128_cfb EVP_aria_128_cfb128
  ------------------
  200|      1|    EVP_add_cipher(EVP_aria_128_cfb1());
  201|      1|    EVP_add_cipher(EVP_aria_128_cfb8());
  202|      1|    EVP_add_cipher(EVP_aria_128_ctr());
  203|      1|    EVP_add_cipher(EVP_aria_128_ofb());
  204|      1|    EVP_add_cipher(EVP_aria_128_gcm());
  205|      1|    EVP_add_cipher(EVP_aria_128_ccm());
  206|      1|    EVP_add_cipher_alias(SN_aria_128_cbc, "ARIA128");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  207|      1|    EVP_add_cipher_alias(SN_aria_128_cbc, "aria128");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  208|      1|    EVP_add_cipher(EVP_aria_192_ecb());
  209|      1|    EVP_add_cipher(EVP_aria_192_cbc());
  210|      1|    EVP_add_cipher(EVP_aria_192_cfb());
  ------------------
  |  | 1131|      1|#define EVP_aria_192_cfb EVP_aria_192_cfb128
  ------------------
  211|      1|    EVP_add_cipher(EVP_aria_192_cfb1());
  212|      1|    EVP_add_cipher(EVP_aria_192_cfb8());
  213|      1|    EVP_add_cipher(EVP_aria_192_ctr());
  214|      1|    EVP_add_cipher(EVP_aria_192_ofb());
  215|      1|    EVP_add_cipher(EVP_aria_192_gcm());
  216|      1|    EVP_add_cipher(EVP_aria_192_ccm());
  217|      1|    EVP_add_cipher_alias(SN_aria_192_cbc, "ARIA192");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  218|      1|    EVP_add_cipher_alias(SN_aria_192_cbc, "aria192");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  219|      1|    EVP_add_cipher(EVP_aria_256_ecb());
  220|      1|    EVP_add_cipher(EVP_aria_256_cbc());
  221|      1|    EVP_add_cipher(EVP_aria_256_cfb());
  ------------------
  |  | 1141|      1|#define EVP_aria_256_cfb EVP_aria_256_cfb128
  ------------------
  222|      1|    EVP_add_cipher(EVP_aria_256_cfb1());
  223|      1|    EVP_add_cipher(EVP_aria_256_cfb8());
  224|      1|    EVP_add_cipher(EVP_aria_256_ctr());
  225|      1|    EVP_add_cipher(EVP_aria_256_ofb());
  226|      1|    EVP_add_cipher(EVP_aria_256_gcm());
  227|      1|    EVP_add_cipher(EVP_aria_256_ccm());
  228|      1|    EVP_add_cipher_alias(SN_aria_256_cbc, "ARIA256");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  229|      1|    EVP_add_cipher_alias(SN_aria_256_cbc, "aria256");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  230|      1|#endif
  231|       |
  232|      1|#ifndef OPENSSL_NO_CAMELLIA
  233|      1|    EVP_add_cipher(EVP_camellia_128_ecb());
  234|      1|    EVP_add_cipher(EVP_camellia_128_cbc());
  235|      1|    EVP_add_cipher(EVP_camellia_128_cfb());
  ------------------
  |  | 1153|      1|#define EVP_camellia_128_cfb EVP_camellia_128_cfb128
  ------------------
  236|      1|    EVP_add_cipher(EVP_camellia_128_cfb1());
  237|      1|    EVP_add_cipher(EVP_camellia_128_cfb8());
  238|      1|    EVP_add_cipher(EVP_camellia_128_ofb());
  239|      1|    EVP_add_cipher_alias(SN_camellia_128_cbc, "CAMELLIA128");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  240|      1|    EVP_add_cipher_alias(SN_camellia_128_cbc, "camellia128");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  241|      1|    EVP_add_cipher(EVP_camellia_192_ecb());
  242|      1|    EVP_add_cipher(EVP_camellia_192_cbc());
  243|      1|    EVP_add_cipher(EVP_camellia_192_cfb());
  ------------------
  |  | 1161|      1|#define EVP_camellia_192_cfb EVP_camellia_192_cfb128
  ------------------
  244|      1|    EVP_add_cipher(EVP_camellia_192_cfb1());
  245|      1|    EVP_add_cipher(EVP_camellia_192_cfb8());
  246|      1|    EVP_add_cipher(EVP_camellia_192_ofb());
  247|      1|    EVP_add_cipher_alias(SN_camellia_192_cbc, "CAMELLIA192");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  248|      1|    EVP_add_cipher_alias(SN_camellia_192_cbc, "camellia192");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  249|      1|    EVP_add_cipher(EVP_camellia_256_ecb());
  250|      1|    EVP_add_cipher(EVP_camellia_256_cbc());
  251|      1|    EVP_add_cipher(EVP_camellia_256_cfb());
  ------------------
  |  | 1169|      1|#define EVP_camellia_256_cfb EVP_camellia_256_cfb128
  ------------------
  252|      1|    EVP_add_cipher(EVP_camellia_256_cfb1());
  253|      1|    EVP_add_cipher(EVP_camellia_256_cfb8());
  254|      1|    EVP_add_cipher(EVP_camellia_256_ofb());
  255|      1|    EVP_add_cipher_alias(SN_camellia_256_cbc, "CAMELLIA256");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  256|      1|    EVP_add_cipher_alias(SN_camellia_256_cbc, "camellia256");
  ------------------
  |  |  705|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_CIPHER_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
  257|      1|    EVP_add_cipher(EVP_camellia_128_ctr());
  258|      1|    EVP_add_cipher(EVP_camellia_192_ctr());
  259|      1|    EVP_add_cipher(EVP_camellia_256_ctr());
  260|      1|#endif
  261|       |
  262|      1|#ifndef OPENSSL_NO_CHACHA
  263|      1|    EVP_add_cipher(EVP_chacha20());
  264|      1|#ifndef OPENSSL_NO_POLY1305
  265|      1|    EVP_add_cipher(EVP_chacha20_poly1305());
  266|      1|#endif
  267|      1|#endif
  268|      1|}

openssl_add_all_digests_int:
   18|      1|{
   19|      1|#ifndef OPENSSL_NO_MD4
   20|      1|    EVP_add_digest(EVP_md4());
   21|      1|#endif
   22|      1|#ifndef OPENSSL_NO_MD5
   23|      1|    EVP_add_digest(EVP_md5());
   24|      1|    EVP_add_digest_alias(SN_md5, "ssl3-md5");
  ------------------
  |  |  707|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   25|      1|#define OBJ_NAME_TYPE_MD_METH 0x01
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   25|      1|    EVP_add_digest(EVP_md5_sha1());
   26|      1|#endif
   27|      1|    EVP_add_digest(EVP_sha1());
   28|      1|    EVP_add_digest_alias(SN_sha1, "ssl3-sha1");
  ------------------
  |  |  707|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   25|      1|#define OBJ_NAME_TYPE_MD_METH 0x01
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   29|      1|    EVP_add_digest_alias(SN_sha1WithRSAEncryption, SN_sha1WithRSA);
  ------------------
  |  |  707|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   25|      1|#define OBJ_NAME_TYPE_MD_METH 0x01
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   30|      1|#if !defined(OPENSSL_NO_MDC2) && !defined(OPENSSL_NO_DES)
   31|      1|    EVP_add_digest(EVP_mdc2());
   32|      1|#endif
   33|      1|#ifndef OPENSSL_NO_RMD160
   34|      1|    EVP_add_digest(EVP_ripemd160());
   35|      1|    EVP_add_digest_alias(SN_ripemd160, "ripemd");
  ------------------
  |  |  707|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   25|      1|#define OBJ_NAME_TYPE_MD_METH 0x01
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   36|      1|    EVP_add_digest_alias(SN_ripemd160, "rmd160");
  ------------------
  |  |  707|      1|    OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   25|      1|#define OBJ_NAME_TYPE_MD_METH 0x01
  |  |  ------------------
  |  |                   OBJ_NAME_add((alias), OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, (n))
  |  |  ------------------
  |  |  |  |   33|      1|#define OBJ_NAME_ALIAS 0x8000
  |  |  ------------------
  ------------------
   37|      1|#endif
   38|      1|    EVP_add_digest(EVP_sha224());
   39|      1|    EVP_add_digest(EVP_sha256());
   40|      1|    EVP_add_digest(EVP_sha384());
   41|      1|    EVP_add_digest(EVP_sha512());
   42|      1|    EVP_add_digest(EVP_sha512_224());
   43|      1|    EVP_add_digest(EVP_sha512_256());
   44|      1|#ifndef OPENSSL_NO_WHIRLPOOL
   45|      1|    EVP_add_digest(EVP_whirlpool());
   46|      1|#endif
   47|      1|#ifndef OPENSSL_NO_SM3
   48|      1|    EVP_add_digest(EVP_sm3());
   49|      1|#endif
   50|      1|#ifndef OPENSSL_NO_BLAKE2
   51|      1|    EVP_add_digest(EVP_blake2b512());
   52|      1|    EVP_add_digest(EVP_blake2s256());
   53|      1|#endif
   54|      1|    EVP_add_digest(EVP_sha3_224());
   55|      1|    EVP_add_digest(EVP_sha3_256());
   56|      1|    EVP_add_digest(EVP_sha3_384());
   57|      1|    EVP_add_digest(EVP_sha3_512());
   58|      1|    EVP_add_digest(EVP_shake128());
   59|      1|    EVP_add_digest(EVP_shake256());
   60|      1|}

evp_md_ctx_clear_digest:
   45|   363k|{
   46|   363k|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (46:9): [True: 363k, False: 0]
  ------------------
   47|   363k|        if (ctx->digest != NULL && ctx->digest->freectx != NULL)
  ------------------
  |  Branch (47:13): [True: 363k, False: 0]
  |  Branch (47:36): [True: 363k, False: 0]
  ------------------
   48|   363k|            ctx->digest->freectx(ctx->algctx);
   49|   363k|        ctx->algctx = NULL;
   50|   363k|        EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
  ------------------
  |  |  217|   363k|#define EVP_MD_CTX_FLAG_CLEANED 0x0002 /* context has already been \
  ------------------
   51|   363k|    }
   52|       |
   53|       |    /* Code below to be removed when legacy support is dropped. */
   54|       |
   55|       |    /*
   56|       |     * Don't assume ctx->md_data was cleaned in EVP_Digest_Final, because
   57|       |     * sometimes only copies of the context are ever finalised.
   58|       |     */
   59|   363k|    cleanup_old_md_data(ctx, force);
   60|   363k|    if (force)
  ------------------
  |  Branch (60:9): [True: 0, False: 363k]
  ------------------
   61|      0|        ctx->digest = NULL;
   62|       |
   63|   363k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
   64|   363k|    ENGINE_finish(ctx->engine);
   65|   363k|    ctx->engine = NULL;
   66|   363k|#endif
   67|       |
   68|       |    /* Non legacy code, this has to be later than the ctx->digest cleaning */
   69|   363k|    if (!keep_fetched) {
  ------------------
  |  Branch (69:9): [True: 363k, False: 0]
  ------------------
   70|   363k|        EVP_MD_free(ctx->fetched_digest);
   71|   363k|        ctx->fetched_digest = NULL;
   72|       |        ctx->reqdigest = NULL;
   73|   363k|    }
   74|   363k|}
EVP_MD_CTX_reset:
   99|   363k|{
  100|   363k|    return evp_md_ctx_reset_ex(ctx, 0);
  101|   363k|}
EVP_MD_CTX_new:
  130|   363k|{
  131|   363k|    return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  ------------------
  |  |  108|   363k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  132|   363k|}
EVP_MD_CTX_free:
  135|   390k|{
  136|   390k|    if (ctx == NULL)
  ------------------
  |  Branch (136:9): [True: 26.5k, False: 363k]
  ------------------
  137|  26.5k|        return;
  138|       |
  139|   363k|    EVP_MD_CTX_reset(ctx);
  140|   363k|    OPENSSL_free(ctx);
  ------------------
  |  |  131|   363k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  141|   363k|}
evp_md_ctx_free_algctx:
  144|   367k|{
  145|   367k|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (145:9): [True: 3.98k, False: 363k]
  ------------------
  146|  3.98k|        if (!ossl_assert(ctx->digest != NULL)) {
  ------------------
  |  |   52|  3.98k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  3.98k|    __FILE__, __LINE__)
  ------------------
  |  Branch (146:13): [True: 0, False: 3.98k]
  ------------------
  147|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  148|      0|            return 0;
  149|      0|        }
  150|  3.98k|        if (ctx->digest->freectx != NULL)
  ------------------
  |  Branch (150:13): [True: 3.98k, False: 0]
  ------------------
  151|  3.98k|            ctx->digest->freectx(ctx->algctx);
  152|  3.98k|        ctx->algctx = NULL;
  153|  3.98k|    }
  154|   367k|    return 1;
  155|   367k|}
EVP_DigestInit_ex:
  381|   385k|{
  382|       |    return evp_md_init_internal(ctx, type, NULL, impl);
  383|   385k|}
EVP_DigestUpdate:
  386|  1.68M|{
  387|  1.68M|    if (ossl_unlikely(count == 0))
  ------------------
  |  |   23|  1.68M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 2.02k, False: 1.67M]
  |  |  ------------------
  ------------------
  388|  2.02k|        return 1;
  389|       |
  390|  1.67M|    if (ossl_unlikely((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0)) {
  ------------------
  |  |   23|  1.67M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.67M]
  |  |  ------------------
  ------------------
  391|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  392|      0|        return 0;
  393|      0|    }
  394|       |
  395|  1.67M|    if (ossl_unlikely(ctx->pctx != NULL)
  ------------------
  |  |   23|  3.35M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.67M]
  |  |  ------------------
  ------------------
  396|      0|        && EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  744|  1.67M|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1781|      0|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1765|      0|#define EVP_PKEY_OP_SIGN (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1775|      0|#define EVP_PKEY_OP_SIGNMSG (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1782|      0|        | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1766|      0|#define EVP_PKEY_OP_VERIFY (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                       | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1776|      0|#define EVP_PKEY_OP_VERIFYMSG (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1783|      0|        | EVP_PKEY_OP_VERIFYRECOVER                  \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1767|      0|#define EVP_PKEY_OP_VERIFYRECOVER (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1784|      0|        | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1768|      0|#define EVP_PKEY_OP_SIGNCTX (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                       | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1769|      0|#define EVP_PKEY_OP_VERIFYCTX (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (744:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  397|      0|        && ctx->pctx->op.sig.algctx != NULL) {
  ------------------
  |  Branch (397:12): [True: 0, False: 0]
  ------------------
  398|      0|#ifndef FIPS_MODULE
  399|       |        /*
  400|       |         * Prior to OpenSSL 3.0 EVP_DigestSignUpdate() and
  401|       |         * EVP_DigestVerifyUpdate() were just macros for EVP_DigestUpdate().
  402|       |         * Some code calls EVP_DigestUpdate() directly even when initialised
  403|       |         * with EVP_DigestSignInit_ex() or
  404|       |         * EVP_DigestVerifyInit_ex(), so we detect that and redirect to
  405|       |         * the correct EVP_Digest*Update() function
  406|       |         */
  407|      0|        if (ctx->pctx->operation == EVP_PKEY_OP_SIGNCTX)
  ------------------
  |  | 1768|      0|#define EVP_PKEY_OP_SIGNCTX (1 << 7)
  ------------------
  |  Branch (407:13): [True: 0, False: 0]
  ------------------
  408|      0|            return EVP_DigestSignUpdate(ctx, data, count);
  409|      0|        if (ctx->pctx->operation == EVP_PKEY_OP_VERIFYCTX)
  ------------------
  |  | 1769|      0|#define EVP_PKEY_OP_VERIFYCTX (1 << 8)
  ------------------
  |  Branch (409:13): [True: 0, False: 0]
  ------------------
  410|      0|            return EVP_DigestVerifyUpdate(ctx, data, count);
  411|      0|#endif
  412|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  413|      0|        return 0;
  414|      0|    }
  415|       |
  416|  1.67M|    if (ctx->digest == NULL
  ------------------
  |  Branch (416:9): [True: 0, False: 1.67M]
  ------------------
  417|  1.67M|        || ctx->digest->prov == NULL
  ------------------
  |  Branch (417:12): [True: 0, False: 1.67M]
  ------------------
  418|  1.67M|        || ossl_unlikely((ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) != 0))
  ------------------
  |  |   23|  1.67M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.67M]
  |  |  ------------------
  ------------------
  419|      0|        goto legacy;
  420|       |
  421|  1.67M|    if (ossl_unlikely(ctx->digest->dupdate == NULL)) {
  ------------------
  |  |   23|  1.67M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.67M]
  |  |  ------------------
  ------------------
  422|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  423|      0|        return 0;
  424|      0|    }
  425|  1.67M|    return ctx->digest->dupdate(ctx->algctx, data, count);
  426|       |
  427|       |    /* Code below to be removed when legacy support is dropped. */
  428|      0|legacy:
  429|      0|    return ctx->update != NULL ? ctx->update(ctx, data, count) : 0;
  ------------------
  |  Branch (429:12): [True: 0, False: 0]
  ------------------
  430|  1.67M|}
EVP_DigestFinal_ex:
  443|   365k|{
  444|   365k|    int ret, sz;
  445|   365k|    size_t size = 0;
  446|   365k|    size_t mdsize = 0;
  447|       |
  448|   365k|    if (ossl_unlikely(ctx->digest == NULL))
  ------------------
  |  |   23|   365k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 365k]
  |  |  ------------------
  ------------------
  449|      0|        return 0;
  450|       |
  451|   365k|    sz = EVP_MD_CTX_get_size(ctx);
  ------------------
  |  |  589|   365k|#define EVP_MD_CTX_get_size(e) EVP_MD_CTX_get_size_ex(e)
  ------------------
  452|   365k|    if (ossl_unlikely(sz < 0))
  ------------------
  |  |   23|   365k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 365k]
  |  |  ------------------
  ------------------
  453|      0|        return 0;
  454|   365k|    mdsize = sz;
  455|   365k|    if (ossl_unlikely(ctx->digest->prov == NULL))
  ------------------
  |  |   23|   365k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 365k]
  |  |  ------------------
  ------------------
  456|      0|        goto legacy;
  457|       |
  458|   365k|    if (ossl_unlikely(ctx->digest->dfinal == NULL)) {
  ------------------
  |  |   23|   365k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 365k]
  |  |  ------------------
  ------------------
  459|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  460|      0|        return 0;
  461|      0|    }
  462|       |
  463|   365k|    if (ossl_unlikely((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0)) {
  ------------------
  |  |   23|   365k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 365k]
  |  |  ------------------
  ------------------
  464|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  465|      0|        return 0;
  466|      0|    }
  467|       |
  468|   365k|    ret = ctx->digest->dfinal(ctx->algctx, md, &size, mdsize);
  469|       |
  470|   365k|    ctx->flags |= EVP_MD_CTX_FLAG_FINALISED;
  ------------------
  |  |   33|   365k|#define EVP_MD_CTX_FLAG_FINALISED 0x0800
  ------------------
  471|       |
  472|   365k|    if (isize != NULL) {
  ------------------
  |  Branch (472:9): [True: 2.65k, False: 362k]
  ------------------
  473|  2.65k|        if (ossl_likely(size <= UINT_MAX)) {
  ------------------
  |  |   22|  2.65k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 2.65k, False: 0]
  |  |  ------------------
  ------------------
  474|  2.65k|            *isize = (unsigned int)size;
  475|  2.65k|        } else {
  476|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  477|      0|            ret = 0;
  478|      0|        }
  479|  2.65k|    }
  480|       |
  481|   365k|    return ret;
  482|       |
  483|       |    /* Code below to be removed when legacy support is dropped. */
  484|      0|legacy:
  485|      0|    OPENSSL_assert(mdsize <= EVP_MAX_MD_SIZE);
  ------------------
  |  |  476|      0|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (476:12): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  486|      0|    ret = ctx->digest->final(ctx, md);
  487|      0|    if (isize != NULL)
  ------------------
  |  Branch (487:9): [True: 0, False: 0]
  ------------------
  488|      0|        *isize = (unsigned int)mdsize;
  489|      0|    if (ctx->digest->cleanup) {
  ------------------
  |  Branch (489:9): [True: 0, False: 0]
  ------------------
  490|      0|        ctx->digest->cleanup(ctx);
  491|      0|        EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
  ------------------
  |  |  217|      0|#define EVP_MD_CTX_FLAG_CLEANED 0x0002 /* context has already been \
  ------------------
  492|      0|    }
  493|      0|    OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size);
  494|      0|    return ret;
  495|   365k|}
EVP_DigestFinalXOF:
  499|  7.96k|{
  500|  7.96k|    int ret = 0;
  501|  7.96k|    OSSL_PARAM params[2];
  502|  7.96k|    size_t i = 0;
  503|       |
  504|  7.96k|    if (ossl_unlikely(ctx->digest == NULL)) {
  ------------------
  |  |   23|  7.96k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 7.96k]
  |  |  ------------------
  ------------------
  505|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_NULL_ALGORITHM);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  506|      0|        return 0;
  507|      0|    }
  508|       |
  509|  7.96k|    if (ossl_unlikely(ctx->digest->prov == NULL))
  ------------------
  |  |   23|  7.96k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 7.96k]
  |  |  ------------------
  ------------------
  510|      0|        goto legacy;
  511|       |
  512|  7.96k|    if (ossl_unlikely(ctx->digest->dfinal == NULL)) {
  ------------------
  |  |   23|  7.96k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 7.96k]
  |  |  ------------------
  ------------------
  513|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  514|      0|        return 0;
  515|      0|    }
  516|       |
  517|  7.96k|    if (ossl_unlikely((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0)) {
  ------------------
  |  |   23|  7.96k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 7.96k]
  |  |  ------------------
  ------------------
  518|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  519|      0|        return 0;
  520|      0|    }
  521|       |
  522|       |    /*
  523|       |     * For backward compatibility we pass the XOFLEN via a param here so that
  524|       |     * older providers can use the supplied value. Ideally we should have just
  525|       |     * used the size passed into ctx->digest->dfinal().
  526|       |     */
  527|  7.96k|    params[i++] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_XOFLEN, &size);
  ------------------
  |  |  232|  7.96k|# define OSSL_DIGEST_PARAM_XOFLEN "xoflen"
  ------------------
  528|  7.96k|    params[i++] = OSSL_PARAM_construct_end();
  529|       |
  530|  7.96k|    if (ossl_likely(EVP_MD_CTX_set_params(ctx, params) >= 0))
  ------------------
  |  |   22|  7.96k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 7.96k, False: 0]
  |  |  ------------------
  ------------------
  531|  7.96k|        ret = ctx->digest->dfinal(ctx->algctx, md, &size, size);
  532|       |
  533|  7.96k|    ctx->flags |= EVP_MD_CTX_FLAG_FINALISED;
  ------------------
  |  |   33|  7.96k|#define EVP_MD_CTX_FLAG_FINALISED 0x0800
  ------------------
  534|       |
  535|  7.96k|    return ret;
  536|       |
  537|      0|legacy:
  538|      0|    if (EVP_MD_xof(ctx->digest)
  ------------------
  |  Branch (538:9): [True: 0, False: 0]
  ------------------
  539|      0|        && size <= INT_MAX
  ------------------
  |  Branch (539:12): [True: 0, False: 0]
  ------------------
  540|      0|        && ctx->digest->md_ctrl(ctx, EVP_MD_CTRL_XOF_LEN, (int)size, NULL)) {
  ------------------
  |  |  204|      0|#define EVP_MD_CTRL_XOF_LEN 0x3
  ------------------
  |  Branch (540:12): [True: 0, False: 0]
  ------------------
  541|      0|        ret = ctx->digest->final(ctx, md);
  542|      0|        if (ctx->digest->cleanup != NULL) {
  ------------------
  |  Branch (542:13): [True: 0, False: 0]
  ------------------
  543|      0|            ctx->digest->cleanup(ctx);
  544|      0|            EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
  ------------------
  |  |  217|      0|#define EVP_MD_CTX_FLAG_CLEANED 0x0002 /* context has already been \
  ------------------
  545|      0|        }
  546|      0|        OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size);
  547|      0|    } else {
  548|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_NOT_XOF_OR_INVALID_LENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  549|      0|    }
  550|       |
  551|      0|    return ret;
  552|  7.96k|}
EVP_DigestSqueeze:
  556|  35.9k|{
  557|  35.9k|    if (ctx->digest == NULL) {
  ------------------
  |  Branch (557:9): [True: 0, False: 35.9k]
  ------------------
  558|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_NULL_ALGORITHM);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  559|      0|        return 0;
  560|      0|    }
  561|       |
  562|  35.9k|    if (ctx->digest->prov == NULL) {
  ------------------
  |  Branch (562:9): [True: 0, False: 35.9k]
  ------------------
  563|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_OPERATION);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  564|      0|        return 0;
  565|      0|    }
  566|       |
  567|  35.9k|    if (ctx->digest->dsqueeze == NULL) {
  ------------------
  |  Branch (567:9): [True: 0, False: 35.9k]
  ------------------
  568|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_METHOD_NOT_SUPPORTED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  569|      0|        return 0;
  570|      0|    }
  571|       |
  572|  35.9k|    return ctx->digest->dsqueeze(ctx->algctx, md, &size, size);
  573|  35.9k|}
EVP_Digest:
  729|   338k|{
  730|   338k|    EVP_MD_CTX *ctx = EVP_MD_CTX_new();
  731|   338k|    int ret;
  732|       |
  733|   338k|    if (ctx == NULL)
  ------------------
  |  Branch (733:9): [True: 0, False: 338k]
  ------------------
  734|      0|        return 0;
  735|   338k|    EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT);
  ------------------
  |  |  215|   338k|#define EVP_MD_CTX_FLAG_ONESHOT 0x0001 /* digest update will be \
  ------------------
  736|   338k|    ret = EVP_DigestInit_ex(ctx, type, impl)
  ------------------
  |  Branch (736:11): [True: 338k, False: 0]
  ------------------
  737|   338k|        && EVP_DigestUpdate(ctx, data, count)
  ------------------
  |  Branch (737:12): [True: 338k, False: 0]
  ------------------
  738|   338k|        && EVP_DigestFinal_ex(ctx, md, size);
  ------------------
  |  Branch (738:12): [True: 338k, False: 0]
  ------------------
  739|   338k|    EVP_MD_CTX_free(ctx);
  740|       |
  741|   338k|    return ret;
  742|   338k|}
EVP_MD_CTX_set_params:
  777|  7.96k|{
  778|  7.96k|    EVP_PKEY_CTX *pctx = ctx->pctx;
  779|       |
  780|       |    /* If we have a pctx then we should try that first */
  781|  7.96k|    if (ossl_unlikely(pctx != NULL)
  ------------------
  |  |   23|  15.9k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 7.96k]
  |  |  ------------------
  ------------------
  782|      0|        && (pctx->operation == EVP_PKEY_OP_VERIFYCTX
  ------------------
  |  | 1769|      0|#define EVP_PKEY_OP_VERIFYCTX (1 << 8)
  ------------------
  |  Branch (782:13): [True: 0, False: 0]
  ------------------
  783|      0|            || pctx->operation == EVP_PKEY_OP_SIGNCTX)
  ------------------
  |  | 1768|      0|#define EVP_PKEY_OP_SIGNCTX (1 << 7)
  ------------------
  |  Branch (783:16): [True: 0, False: 0]
  ------------------
  784|      0|        && pctx->op.sig.algctx != NULL
  ------------------
  |  Branch (784:12): [True: 0, False: 0]
  ------------------
  785|      0|        && pctx->op.sig.signature->set_ctx_md_params != NULL)
  ------------------
  |  Branch (785:12): [True: 0, False: 0]
  ------------------
  786|      0|        return pctx->op.sig.signature->set_ctx_md_params(pctx->op.sig.algctx,
  787|      0|            params);
  788|       |
  789|  7.96k|    if (ossl_likely(ctx->digest != NULL && ctx->digest->set_ctx_params != NULL))
  ------------------
  |  |   22|  15.9k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 7.96k, False: 0]
  |  |  |  Branch (22:44): [True: 7.96k, False: 0]
  |  |  |  Branch (22:44): [True: 7.96k, False: 0]
  |  |  ------------------
  ------------------
  790|  7.96k|        return ctx->digest->set_ctx_params(ctx->algctx, params);
  791|       |
  792|      0|    return 0;
  793|  7.96k|}
EVP_MD_CTX_gettable_params:
  863|   365k|{
  864|   365k|    EVP_PKEY_CTX *pctx;
  865|   365k|    void *provctx;
  866|       |
  867|   365k|    if (ossl_unlikely(ctx == NULL))
  ------------------
  |  |   23|   365k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 365k]
  |  |  ------------------
  ------------------
  868|      0|        return NULL;
  869|       |
  870|       |    /* If we have a pctx then we should try that first */
  871|   365k|    pctx = ctx->pctx;
  872|   365k|    if (ossl_unlikely(pctx != NULL)
  ------------------
  |  |   23|   730k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 365k]
  |  |  ------------------
  ------------------
  873|      0|        && (pctx->operation == EVP_PKEY_OP_VERIFYCTX
  ------------------
  |  | 1769|      0|#define EVP_PKEY_OP_VERIFYCTX (1 << 8)
  ------------------
  |  Branch (873:13): [True: 0, False: 0]
  ------------------
  874|      0|            || pctx->operation == EVP_PKEY_OP_SIGNCTX)
  ------------------
  |  | 1768|      0|#define EVP_PKEY_OP_SIGNCTX (1 << 7)
  ------------------
  |  Branch (874:16): [True: 0, False: 0]
  ------------------
  875|      0|        && pctx->op.sig.signature != NULL
  ------------------
  |  Branch (875:12): [True: 0, False: 0]
  ------------------
  876|      0|        && pctx->op.sig.signature->gettable_ctx_md_params != NULL
  ------------------
  |  Branch (876:12): [True: 0, False: 0]
  ------------------
  877|      0|        && pctx->op.sig.algctx != NULL)
  ------------------
  |  Branch (877:12): [True: 0, False: 0]
  ------------------
  878|      0|        return pctx->op.sig.signature->gettable_ctx_md_params(
  879|      0|            pctx->op.sig.algctx);
  880|       |
  881|   365k|    if (ossl_unlikely(ctx->digest != NULL
  ------------------
  |  |   23|   730k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 365k]
  |  |  |  Branch (23:46): [True: 365k, False: 0]
  |  |  |  Branch (23:46): [True: 0, False: 365k]
  |  |  ------------------
  ------------------
  882|   365k|            && ctx->digest->gettable_ctx_params != NULL)) {
  883|      0|        provctx = ossl_provider_ctx(EVP_MD_get0_provider(ctx->digest));
  884|      0|        return ctx->digest->gettable_ctx_params(ctx->algctx, provctx);
  885|      0|    }
  886|   365k|    return NULL;
  887|   365k|}
evp_md_new:
  943|  17.0k|{
  944|  17.0k|    EVP_MD *md = OPENSSL_zalloc(sizeof(*md));
  ------------------
  |  |  108|  17.0k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  945|       |
  946|  17.0k|    if (md != NULL && !CRYPTO_NEW_REF(&md->refcnt, 1)) {
  ------------------
  |  Branch (946:9): [True: 17.0k, False: 0]
  |  Branch (946:23): [True: 0, False: 17.0k]
  ------------------
  947|      0|        OPENSSL_free(md);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  948|      0|        return NULL;
  949|      0|    }
  950|  17.0k|    return md;
  951|  17.0k|}
EVP_MD_fetch:
 1162|   408k|{
 1163|   408k|    EVP_MD *md = evp_generic_fetch(ctx, OSSL_OP_DIGEST, algorithm, properties,
  ------------------
  |  |  283|   408k|#define OSSL_OP_DIGEST 1
  ------------------
 1164|   408k|        evp_md_from_algorithm, evp_md_up_ref, evp_md_free);
 1165|       |
 1166|   408k|    return md;
 1167|   408k|}
EVP_MD_up_ref:
 1170|   756k|{
 1171|   756k|    int ref = 0;
 1172|       |
 1173|   756k|    if (md->origin == EVP_ORIG_DYNAMIC)
  ------------------
  |  |  254|   756k|#define EVP_ORIG_DYNAMIC 0
  ------------------
  |  Branch (1173:9): [True: 756k, False: 0]
  ------------------
 1174|   756k|        CRYPTO_UP_REF(&md->refcnt, &ref);
 1175|   756k|    return 1;
 1176|   756k|}
EVP_MD_free:
 1179|  1.13M|{
 1180|  1.13M|    int i;
 1181|       |
 1182|  1.13M|    if (md == NULL || md->origin != EVP_ORIG_DYNAMIC)
  ------------------
  |  |  254|   773k|#define EVP_ORIG_DYNAMIC 0
  ------------------
  |  Branch (1182:9): [True: 363k, False: 773k]
  |  Branch (1182:23): [True: 0, False: 773k]
  ------------------
 1183|   363k|        return;
 1184|       |
 1185|   773k|    CRYPTO_DOWN_REF(&md->refcnt, &i);
 1186|   773k|    if (i > 0)
  ------------------
  |  Branch (1186:9): [True: 756k, False: 17.0k]
  ------------------
 1187|   756k|        return;
 1188|  17.0k|    evp_md_free_int(md);
 1189|  17.0k|}
digest.c:cleanup_old_md_data:
   30|   749k|{
   31|   749k|    if (ctx->digest != NULL) {
  ------------------
  |  Branch (31:9): [True: 385k, False: 363k]
  ------------------
   32|   385k|        if (ctx->digest->cleanup != NULL
  ------------------
  |  Branch (32:13): [True: 0, False: 385k]
  ------------------
   33|      0|            && !EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_CLEANED))
  ------------------
  |  |  217|      0|#define EVP_MD_CTX_FLAG_CLEANED 0x0002 /* context has already been \
  ------------------
  |  Branch (33:16): [True: 0, False: 0]
  ------------------
   34|      0|            ctx->digest->cleanup(ctx);
   35|   385k|        if (ctx->md_data != NULL && ctx->digest->ctx_size > 0
  ------------------
  |  Branch (35:13): [True: 0, False: 385k]
  |  Branch (35:37): [True: 0, False: 0]
  ------------------
   36|      0|            && (!EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_REUSE)
  ------------------
  |  |  219|      0|#define EVP_MD_CTX_FLAG_REUSE 0x0004 /* Don't free up ctx->md_data \
  ------------------
  |  Branch (36:17): [True: 0, False: 0]
  ------------------
   37|      0|                || force)) {
  ------------------
  |  Branch (37:20): [True: 0, False: 0]
  ------------------
   38|      0|            OPENSSL_clear_free(ctx->md_data, ctx->digest->ctx_size);
  ------------------
  |  |  129|      0|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   39|       |            ctx->md_data = NULL;
   40|      0|        }
   41|   385k|    }
   42|   749k|}
digest.c:evp_md_ctx_reset_ex:
   77|   363k|{
   78|   363k|    if (ctx == NULL)
  ------------------
  |  Branch (78:9): [True: 0, False: 363k]
  ------------------
   79|      0|        return 1;
   80|       |
   81|       |    /*
   82|       |     * pctx should be freed by the user of EVP_MD_CTX
   83|       |     * if EVP_MD_CTX_FLAG_KEEP_PKEY_CTX is set
   84|       |     */
   85|   363k|    if (!EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_KEEP_PKEY_CTX)) {
  ------------------
  |  |   32|   363k|#define EVP_MD_CTX_FLAG_KEEP_PKEY_CTX 0x0400
  ------------------
  |  Branch (85:9): [True: 363k, False: 0]
  ------------------
   86|   363k|        EVP_PKEY_CTX_free(ctx->pctx);
   87|   363k|        ctx->pctx = NULL;
   88|   363k|    }
   89|       |
   90|   363k|    evp_md_ctx_clear_digest(ctx, 0, keep_fetched);
   91|   363k|    if (!keep_fetched)
  ------------------
  |  Branch (91:9): [True: 363k, False: 0]
  ------------------
   92|   363k|        OPENSSL_cleanse(ctx, sizeof(*ctx));
   93|       |
   94|   363k|    return 1;
   95|   363k|}
digest.c:evp_md_init_internal:
  159|   385k|{
  160|   385k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  161|   385k|    ENGINE *tmpimpl = NULL;
  162|   385k|#endif
  163|       |
  164|   385k|#if !defined(FIPS_MODULE)
  165|   385k|    if (ctx->pctx != NULL
  ------------------
  |  Branch (165:9): [True: 0, False: 385k]
  ------------------
  166|      0|        && EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  744|   385k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1781|      0|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1765|      0|#define EVP_PKEY_OP_SIGN (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1775|      0|#define EVP_PKEY_OP_SIGNMSG (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1782|      0|        | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1766|      0|#define EVP_PKEY_OP_VERIFY (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                       | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1776|      0|#define EVP_PKEY_OP_VERIFYMSG (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1783|      0|        | EVP_PKEY_OP_VERIFYRECOVER                  \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1767|      0|#define EVP_PKEY_OP_VERIFYRECOVER (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1784|      0|        | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1768|      0|#define EVP_PKEY_OP_SIGNCTX (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                       | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1769|      0|#define EVP_PKEY_OP_VERIFYCTX (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (744:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  167|      0|        && ctx->pctx->op.sig.algctx != NULL) {
  ------------------
  |  Branch (167:12): [True: 0, False: 0]
  ------------------
  168|       |        /*
  169|       |         * Prior to OpenSSL 3.0 calling EVP_DigestInit_ex() on an mdctx
  170|       |         * previously initialised with EVP_DigestSignInit() would retain
  171|       |         * information about the key, and re-initialise for another sign
  172|       |         * operation. So in that case we redirect to EVP_DigestSignInit()
  173|       |         */
  174|      0|        if (ctx->pctx->operation == EVP_PKEY_OP_SIGNCTX)
  ------------------
  |  | 1768|      0|#define EVP_PKEY_OP_SIGNCTX (1 << 7)
  ------------------
  |  Branch (174:13): [True: 0, False: 0]
  ------------------
  175|      0|            return EVP_DigestSignInit(ctx, NULL, type, impl, NULL);
  176|      0|        if (ctx->pctx->operation == EVP_PKEY_OP_VERIFYCTX)
  ------------------
  |  | 1769|      0|#define EVP_PKEY_OP_VERIFYCTX (1 << 8)
  ------------------
  |  Branch (176:13): [True: 0, False: 0]
  ------------------
  177|      0|            return EVP_DigestVerifyInit(ctx, NULL, type, impl, NULL);
  178|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  179|      0|        return 0;
  180|      0|    }
  181|   385k|#endif
  182|       |
  183|   385k|    EVP_MD_CTX_clear_flags(ctx, EVP_MD_CTX_FLAG_CLEANED | EVP_MD_CTX_FLAG_FINALISED);
  ------------------
  |  |  217|   385k|#define EVP_MD_CTX_FLAG_CLEANED 0x0002 /* context has already been \
  ------------------
                  EVP_MD_CTX_clear_flags(ctx, EVP_MD_CTX_FLAG_CLEANED | EVP_MD_CTX_FLAG_FINALISED);
  ------------------
  |  |   33|   385k|#define EVP_MD_CTX_FLAG_FINALISED 0x0800
  ------------------
  184|       |
  185|   385k|    if (type != NULL) {
  ------------------
  |  Branch (185:9): [True: 385k, False: 0]
  ------------------
  186|   385k|        ctx->reqdigest = type;
  187|   385k|    } else {
  188|      0|        if (ossl_unlikely(ctx->digest == NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  189|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_NO_DIGEST_SET);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  190|      0|            return 0;
  191|      0|        }
  192|      0|        type = ctx->digest;
  193|      0|    }
  194|       |
  195|       |    /* Code below to be removed when legacy support is dropped. */
  196|   385k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  197|       |    /*
  198|       |     * Whether it's nice or not, "Inits" can be used on "Final"'d contexts so
  199|       |     * this context may already have an ENGINE! Try to avoid releasing the
  200|       |     * previous handle, re-querying for an ENGINE, and having a
  201|       |     * reinitialisation, when it may all be unnecessary.
  202|       |     */
  203|   385k|    if (ossl_unlikely(ctx->engine != NULL)
  ------------------
  |  |   23|   770k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 385k]
  |  |  ------------------
  ------------------
  204|      0|        && ctx->digest != NULL
  ------------------
  |  Branch (204:12): [True: 0, False: 0]
  ------------------
  205|      0|        && type->type == ctx->digest->type)
  ------------------
  |  Branch (205:12): [True: 0, False: 0]
  ------------------
  206|      0|        goto skip_to_init;
  207|       |
  208|       |    /*
  209|       |     * Ensure an ENGINE left lying around from last time is cleared (the
  210|       |     * previous check attempted to avoid this if the same ENGINE and
  211|       |     * EVP_MD could be used).
  212|       |     */
  213|   385k|    ENGINE_finish(ctx->engine);
  214|   385k|    ctx->engine = NULL;
  215|       |
  216|   385k|    if (impl == NULL)
  ------------------
  |  Branch (216:9): [True: 385k, False: 0]
  ------------------
  217|   385k|        tmpimpl = ENGINE_get_digest_engine(type->type);
  218|   385k|#endif
  219|       |
  220|       |    /*
  221|       |     * If there are engines involved or EVP_MD_CTX_FLAG_NO_INIT is set then we
  222|       |     * should use legacy handling for now.
  223|       |     */
  224|   385k|    if (impl != NULL
  ------------------
  |  Branch (224:9): [True: 0, False: 385k]
  ------------------
  225|   385k|#if !defined(OPENSSL_NO_ENGINE)
  226|   385k|        || ctx->engine != NULL
  ------------------
  |  Branch (226:12): [True: 0, False: 385k]
  ------------------
  227|   385k|#if !defined(FIPS_MODULE)
  228|   385k|        || tmpimpl != NULL
  ------------------
  |  Branch (228:12): [True: 0, False: 385k]
  ------------------
  229|   385k|#endif
  230|   385k|#endif
  231|   385k|        || (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) != 0
  ------------------
  |  |  239|   385k|#define EVP_MD_CTX_FLAG_NO_INIT 0x0100 /* Don't initialize md_data */
  ------------------
  |  Branch (231:12): [True: 0, False: 385k]
  ------------------
  232|   385k|        || (type != NULL && type->origin == EVP_ORIG_METH)
  ------------------
  |  |  256|   385k|#define EVP_ORIG_METH 2
  ------------------
  |  Branch (232:13): [True: 385k, False: 0]
  |  Branch (232:29): [True: 0, False: 385k]
  ------------------
  233|   385k|        || (type == NULL && ctx->digest != NULL
  ------------------
  |  Branch (233:13): [True: 0, False: 385k]
  |  Branch (233:29): [True: 0, False: 0]
  ------------------
  234|      0|            && ctx->digest->origin == EVP_ORIG_METH)) {
  ------------------
  |  |  256|      0|#define EVP_ORIG_METH 2
  ------------------
  |  Branch (234:16): [True: 0, False: 0]
  ------------------
  235|       |        /* If we were using provided hash before, cleanup algctx */
  236|      0|        if (!evp_md_ctx_free_algctx(ctx))
  ------------------
  |  Branch (236:13): [True: 0, False: 0]
  ------------------
  237|      0|            return 0;
  238|      0|        if (ctx->digest == ctx->fetched_digest)
  ------------------
  |  Branch (238:13): [True: 0, False: 0]
  ------------------
  239|      0|            ctx->digest = NULL;
  240|      0|        EVP_MD_free(ctx->fetched_digest);
  241|      0|        ctx->fetched_digest = NULL;
  242|      0|        goto legacy;
  243|      0|    }
  244|       |
  245|   385k|    cleanup_old_md_data(ctx, 1);
  246|       |
  247|       |    /* Start of non-legacy code below */
  248|   385k|    if (ossl_likely(ctx->digest == type)) {
  ------------------
  |  |   22|   385k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 17.2k, False: 367k]
  |  |  ------------------
  ------------------
  249|  17.2k|        if (ossl_unlikely(!ossl_assert(type->prov != NULL))) {
  ------------------
  |  |   23|  17.2k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 17.2k]
  |  |  ------------------
  ------------------
  250|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  251|      0|            return 0;
  252|      0|        }
  253|   367k|    } else {
  254|   367k|        if (!evp_md_ctx_free_algctx(ctx))
  ------------------
  |  Branch (254:13): [True: 0, False: 367k]
  ------------------
  255|      0|            return 0;
  256|   367k|    }
  257|       |
  258|   385k|    if (ossl_unlikely(type->prov == NULL)) {
  ------------------
  |  |   23|   385k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 24.2k, False: 360k]
  |  |  ------------------
  ------------------
  259|       |#ifdef FIPS_MODULE
  260|       |        /* We only do explicit fetches inside the FIPS module */
  261|       |        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  262|       |        return 0;
  263|       |#else
  264|       |        /* The NULL digest is a special case */
  265|  24.2k|        EVP_MD *provmd = EVP_MD_fetch(NULL,
  266|  24.2k|            type->type != NID_undef ? OBJ_nid2sn(type->type)
  ------------------
  |  |   18|  24.2k|#define NID_undef                       0
  ------------------
  |  Branch (266:13): [True: 24.2k, False: 0]
  ------------------
  267|  24.2k|                                    : "NULL",
  268|  24.2k|            "");
  269|       |
  270|  24.2k|        if (provmd == NULL) {
  ------------------
  |  Branch (270:13): [True: 0, False: 24.2k]
  ------------------
  271|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|            return 0;
  273|      0|        }
  274|  24.2k|        type = provmd;
  275|  24.2k|        EVP_MD_free(ctx->fetched_digest);
  276|  24.2k|        ctx->fetched_digest = provmd;
  277|  24.2k|#endif
  278|  24.2k|    }
  279|       |
  280|   385k|    if (ossl_unlikely(type->prov != NULL && ctx->fetched_digest != type)) {
  ------------------
  |  |   23|   770k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 343k, False: 41.4k]
  |  |  |  Branch (23:46): [True: 385k, False: 0]
  |  |  |  Branch (23:46): [True: 343k, False: 41.4k]
  |  |  ------------------
  ------------------
  281|   343k|        if (ossl_unlikely(!EVP_MD_up_ref((EVP_MD *)type))) {
  ------------------
  |  |   23|   343k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 343k]
  |  |  ------------------
  ------------------
  282|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  283|      0|            return 0;
  284|      0|        }
  285|   343k|        EVP_MD_free(ctx->fetched_digest);
  286|   343k|        ctx->fetched_digest = (EVP_MD *)type;
  287|   343k|    }
  288|   385k|    ctx->digest = type;
  289|   385k|    if (ctx->algctx == NULL) {
  ------------------
  |  Branch (289:9): [True: 367k, False: 17.2k]
  ------------------
  290|   367k|        ctx->algctx = ctx->digest->newctx(ossl_provider_ctx(type->prov));
  291|   367k|        if (ctx->algctx == NULL) {
  ------------------
  |  Branch (291:13): [True: 0, False: 367k]
  ------------------
  292|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  293|      0|            return 0;
  294|      0|        }
  295|   367k|    }
  296|       |
  297|   385k|    if (ctx->digest->dinit == NULL) {
  ------------------
  |  Branch (297:9): [True: 0, False: 385k]
  ------------------
  298|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  299|      0|        return 0;
  300|      0|    }
  301|       |
  302|   385k|    return ctx->digest->dinit(ctx->algctx, params);
  303|       |
  304|       |    /* Code below to be removed when legacy support is dropped. */
  305|      0|legacy:
  306|       |
  307|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  308|      0|    if (type) {
  ------------------
  |  Branch (308:9): [True: 0, False: 0]
  ------------------
  309|      0|        if (impl != NULL) {
  ------------------
  |  Branch (309:13): [True: 0, False: 0]
  ------------------
  310|      0|            if (!ENGINE_init(impl)) {
  ------------------
  |  Branch (310:17): [True: 0, False: 0]
  ------------------
  311|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  312|      0|                return 0;
  313|      0|            }
  314|      0|        } else {
  315|       |            /* Ask if an ENGINE is reserved for this job */
  316|      0|            impl = tmpimpl;
  317|      0|        }
  318|      0|        if (impl != NULL) {
  ------------------
  |  Branch (318:13): [True: 0, False: 0]
  ------------------
  319|       |            /* There's an ENGINE for this job ... (apparently) */
  320|      0|            const EVP_MD *d = ENGINE_get_digest(impl, type->type);
  321|       |
  322|      0|            if (d == NULL) {
  ------------------
  |  Branch (322:17): [True: 0, False: 0]
  ------------------
  323|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  324|      0|                ENGINE_finish(impl);
  325|      0|                return 0;
  326|      0|            }
  327|       |            /* We'll use the ENGINE's private digest definition */
  328|      0|            type = d;
  329|       |            /*
  330|       |             * Store the ENGINE functional reference so we know 'type' came
  331|       |             * from an ENGINE and we need to release it when done.
  332|       |             */
  333|      0|            ctx->engine = impl;
  334|      0|        } else
  335|      0|            ctx->engine = NULL;
  336|      0|    }
  337|      0|#endif
  338|      0|    if (ctx->digest != type) {
  ------------------
  |  Branch (338:9): [True: 0, False: 0]
  ------------------
  339|      0|        cleanup_old_md_data(ctx, 1);
  340|       |
  341|      0|        ctx->digest = type;
  342|      0|        if (!(ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) && type->ctx_size) {
  ------------------
  |  |  239|      0|#define EVP_MD_CTX_FLAG_NO_INIT 0x0100 /* Don't initialize md_data */
  ------------------
  |  Branch (342:13): [True: 0, False: 0]
  |  Branch (342:56): [True: 0, False: 0]
  ------------------
  343|      0|            ctx->update = type->update;
  344|      0|            ctx->md_data = OPENSSL_zalloc(type->ctx_size);
  ------------------
  |  |  108|      0|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  345|      0|            if (ctx->md_data == NULL)
  ------------------
  |  Branch (345:17): [True: 0, False: 0]
  ------------------
  346|      0|                return 0;
  347|      0|        }
  348|      0|    }
  349|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  350|      0|skip_to_init:
  351|      0|#endif
  352|      0|#ifndef FIPS_MODULE
  353|      0|    if (ctx->pctx != NULL
  ------------------
  |  Branch (353:9): [True: 0, False: 0]
  ------------------
  354|      0|        && (!EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  744|      0|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1781|      0|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1765|      0|#define EVP_PKEY_OP_SIGN (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1775|      0|#define EVP_PKEY_OP_SIGNMSG (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1782|      0|        | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1766|      0|#define EVP_PKEY_OP_VERIFY (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                       | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1776|      0|#define EVP_PKEY_OP_VERIFYMSG (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1783|      0|        | EVP_PKEY_OP_VERIFYRECOVER                  \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1767|      0|#define EVP_PKEY_OP_VERIFYRECOVER (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1784|      0|        | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1768|      0|#define EVP_PKEY_OP_SIGNCTX (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                       | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1769|      0|#define EVP_PKEY_OP_VERIFYCTX (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (354:13): [True: 0, False: 0]
  ------------------
  355|      0|            || ctx->pctx->op.sig.signature == NULL)) {
  ------------------
  |  Branch (355:16): [True: 0, False: 0]
  ------------------
  356|      0|        int r;
  357|      0|        r = EVP_PKEY_CTX_ctrl(ctx->pctx, -1, EVP_PKEY_OP_TYPE_SIG,
  ------------------
  |  | 1781|      0|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG          \
  |  |  ------------------
  |  |  |  | 1765|      0|#define EVP_PKEY_OP_SIGN (1 << 4)
  |  |  ------------------
  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG          \
  |  |  ------------------
  |  |  |  | 1775|      0|#define EVP_PKEY_OP_SIGNMSG (1 << 14)
  |  |  ------------------
  |  | 1782|      0|        | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG \
  |  |  ------------------
  |  |  |  | 1766|      0|#define EVP_PKEY_OP_VERIFY (1 << 5)
  |  |  ------------------
  |  |                       | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG \
  |  |  ------------------
  |  |  |  | 1776|      0|#define EVP_PKEY_OP_VERIFYMSG (1 << 15)
  |  |  ------------------
  |  | 1783|      0|        | EVP_PKEY_OP_VERIFYRECOVER                  \
  |  |  ------------------
  |  |  |  | 1767|      0|#define EVP_PKEY_OP_VERIFYRECOVER (1 << 6)
  |  |  ------------------
  |  | 1784|      0|        | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  ------------------
  |  |  |  | 1768|      0|#define EVP_PKEY_OP_SIGNCTX (1 << 7)
  |  |  ------------------
  |  |                       | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  ------------------
  |  |  |  | 1769|      0|#define EVP_PKEY_OP_VERIFYCTX (1 << 8)
  |  |  ------------------
  ------------------
  358|      0|            EVP_PKEY_CTRL_DIGESTINIT, 0, ctx);
  ------------------
  |  | 1810|      0|#define EVP_PKEY_CTRL_DIGESTINIT 7
  ------------------
  359|      0|        if (r <= 0 && (r != -2))
  ------------------
  |  Branch (359:13): [True: 0, False: 0]
  |  Branch (359:23): [True: 0, False: 0]
  ------------------
  360|      0|            return 0;
  361|      0|    }
  362|      0|#endif
  363|      0|    if (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT)
  ------------------
  |  |  239|      0|#define EVP_MD_CTX_FLAG_NO_INIT 0x0100 /* Don't initialize md_data */
  ------------------
  |  Branch (363:9): [True: 0, False: 0]
  ------------------
  364|      0|        return 1;
  365|      0|    return ctx->digest->init(ctx);
  366|      0|}
digest.c:evp_md_from_algorithm:
 1019|  17.0k|{
 1020|  17.0k|    const OSSL_DISPATCH *fns = algodef->implementation;
 1021|  17.0k|    EVP_MD *md = NULL;
 1022|  17.0k|    int fncnt = 0;
 1023|       |
 1024|       |    /* EVP_MD_fetch() will set the legacy NID if available */
 1025|  17.0k|    if ((md = evp_md_new()) == NULL) {
  ------------------
  |  Branch (1025:9): [True: 0, False: 17.0k]
  ------------------
 1026|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1027|      0|        return NULL;
 1028|      0|    }
 1029|       |
 1030|  17.0k|#ifndef FIPS_MODULE
 1031|  17.0k|    md->type = NID_undef;
  ------------------
  |  |   18|  17.0k|#define NID_undef                       0
  ------------------
 1032|  17.0k|    if (!evp_names_do_all(prov, name_id, set_legacy_nid, &md->type)
  ------------------
  |  Branch (1032:9): [True: 0, False: 17.0k]
  ------------------
 1033|  17.0k|        || md->type == -1) {
  ------------------
  |  Branch (1033:12): [True: 0, False: 17.0k]
  ------------------
 1034|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1035|      0|        goto err;
 1036|      0|    }
 1037|  17.0k|#endif
 1038|       |
 1039|  17.0k|    md->name_id = name_id;
 1040|  17.0k|    if ((md->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
  ------------------
  |  Branch (1040:9): [True: 0, False: 17.0k]
  ------------------
 1041|      0|        goto err;
 1042|       |
 1043|  17.0k|    md->description = algodef->algorithm_description;
 1044|       |
 1045|   190k|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (1045:12): [True: 173k, False: 17.0k]
  ------------------
 1046|   173k|        switch (fns->function_id) {
  ------------------
  |  Branch (1046:17): [True: 173k, False: 0]
  ------------------
 1047|  17.0k|        case OSSL_FUNC_DIGEST_NEWCTX:
  ------------------
  |  |  303|  17.0k|#define OSSL_FUNC_DIGEST_NEWCTX 1
  ------------------
  |  Branch (1047:9): [True: 17.0k, False: 156k]
  ------------------
 1048|  17.0k|            if (md->newctx == NULL) {
  ------------------
  |  Branch (1048:17): [True: 17.0k, False: 0]
  ------------------
 1049|  17.0k|                md->newctx = OSSL_FUNC_digest_newctx(fns);
 1050|  17.0k|                fncnt++;
 1051|  17.0k|            }
 1052|  17.0k|            break;
 1053|  17.0k|        case OSSL_FUNC_DIGEST_INIT:
  ------------------
  |  |  304|  17.0k|#define OSSL_FUNC_DIGEST_INIT 2
  ------------------
  |  Branch (1053:9): [True: 17.0k, False: 156k]
  ------------------
 1054|  17.0k|            if (md->dinit == NULL) {
  ------------------
  |  Branch (1054:17): [True: 17.0k, False: 0]
  ------------------
 1055|  17.0k|                md->dinit = OSSL_FUNC_digest_init(fns);
 1056|  17.0k|                fncnt++;
 1057|  17.0k|            }
 1058|  17.0k|            break;
 1059|  17.0k|        case OSSL_FUNC_DIGEST_UPDATE:
  ------------------
  |  |  305|  17.0k|#define OSSL_FUNC_DIGEST_UPDATE 3
  ------------------
  |  Branch (1059:9): [True: 17.0k, False: 156k]
  ------------------
 1060|  17.0k|            if (md->dupdate == NULL) {
  ------------------
  |  Branch (1060:17): [True: 17.0k, False: 0]
  ------------------
 1061|  17.0k|                md->dupdate = OSSL_FUNC_digest_update(fns);
 1062|  17.0k|                fncnt++;
 1063|  17.0k|            }
 1064|  17.0k|            break;
 1065|  17.0k|        case OSSL_FUNC_DIGEST_FINAL:
  ------------------
  |  |  306|  17.0k|#define OSSL_FUNC_DIGEST_FINAL 4
  ------------------
  |  Branch (1065:9): [True: 17.0k, False: 156k]
  ------------------
 1066|  17.0k|            if (md->dfinal == NULL) {
  ------------------
  |  Branch (1066:17): [True: 17.0k, False: 0]
  ------------------
 1067|  17.0k|                md->dfinal = OSSL_FUNC_digest_final(fns);
 1068|  17.0k|                fncnt++;
 1069|  17.0k|            }
 1070|  17.0k|            break;
 1071|  2.52k|        case OSSL_FUNC_DIGEST_SQUEEZE:
  ------------------
  |  |  316|  2.52k|#define OSSL_FUNC_DIGEST_SQUEEZE 14
  ------------------
  |  Branch (1071:9): [True: 2.52k, False: 171k]
  ------------------
 1072|  2.52k|            if (md->dsqueeze == NULL) {
  ------------------
  |  Branch (1072:17): [True: 2.52k, False: 0]
  ------------------
 1073|  2.52k|                md->dsqueeze = OSSL_FUNC_digest_squeeze(fns);
 1074|  2.52k|                fncnt++;
 1075|  2.52k|            }
 1076|  2.52k|            break;
 1077|      0|        case OSSL_FUNC_DIGEST_DIGEST:
  ------------------
  |  |  307|      0|#define OSSL_FUNC_DIGEST_DIGEST 5
  ------------------
  |  Branch (1077:9): [True: 0, False: 173k]
  ------------------
 1078|      0|            if (md->digest == NULL)
  ------------------
  |  Branch (1078:17): [True: 0, False: 0]
  ------------------
 1079|      0|                md->digest = OSSL_FUNC_digest_digest(fns);
 1080|       |            /* We don't increment fnct for this as it is stand alone */
 1081|      0|            break;
 1082|  17.0k|        case OSSL_FUNC_DIGEST_FREECTX:
  ------------------
  |  |  308|  17.0k|#define OSSL_FUNC_DIGEST_FREECTX 6
  ------------------
  |  Branch (1082:9): [True: 17.0k, False: 156k]
  ------------------
 1083|  17.0k|            if (md->freectx == NULL) {
  ------------------
  |  Branch (1083:17): [True: 17.0k, False: 0]
  ------------------
 1084|  17.0k|                md->freectx = OSSL_FUNC_digest_freectx(fns);
 1085|  17.0k|                fncnt++;
 1086|  17.0k|            }
 1087|  17.0k|            break;
 1088|  17.0k|        case OSSL_FUNC_DIGEST_DUPCTX:
  ------------------
  |  |  309|  17.0k|#define OSSL_FUNC_DIGEST_DUPCTX 7
  ------------------
  |  Branch (1088:9): [True: 17.0k, False: 156k]
  ------------------
 1089|  17.0k|            if (md->dupctx == NULL)
  ------------------
  |  Branch (1089:17): [True: 17.0k, False: 0]
  ------------------
 1090|  17.0k|                md->dupctx = OSSL_FUNC_digest_dupctx(fns);
 1091|  17.0k|            break;
 1092|  17.0k|        case OSSL_FUNC_DIGEST_GET_PARAMS:
  ------------------
  |  |  310|  17.0k|#define OSSL_FUNC_DIGEST_GET_PARAMS 8
  ------------------
  |  Branch (1092:9): [True: 17.0k, False: 156k]
  ------------------
 1093|  17.0k|            if (md->get_params == NULL)
  ------------------
  |  Branch (1093:17): [True: 17.0k, False: 0]
  ------------------
 1094|  17.0k|                md->get_params = OSSL_FUNC_digest_get_params(fns);
 1095|  17.0k|            break;
 1096|  5.05k|        case OSSL_FUNC_DIGEST_SET_CTX_PARAMS:
  ------------------
  |  |  311|  5.05k|#define OSSL_FUNC_DIGEST_SET_CTX_PARAMS 9
  ------------------
  |  Branch (1096:9): [True: 5.05k, False: 168k]
  ------------------
 1097|  5.05k|            if (md->set_ctx_params == NULL)
  ------------------
  |  Branch (1097:17): [True: 5.05k, False: 0]
  ------------------
 1098|  5.05k|                md->set_ctx_params = OSSL_FUNC_digest_set_ctx_params(fns);
 1099|  5.05k|            break;
 1100|  3.79k|        case OSSL_FUNC_DIGEST_GET_CTX_PARAMS:
  ------------------
  |  |  312|  3.79k|#define OSSL_FUNC_DIGEST_GET_CTX_PARAMS 10
  ------------------
  |  Branch (1100:9): [True: 3.79k, False: 170k]
  ------------------
 1101|  3.79k|            if (md->get_ctx_params == NULL)
  ------------------
  |  Branch (1101:17): [True: 3.79k, False: 0]
  ------------------
 1102|  3.79k|                md->get_ctx_params = OSSL_FUNC_digest_get_ctx_params(fns);
 1103|  3.79k|            break;
 1104|  17.0k|        case OSSL_FUNC_DIGEST_GETTABLE_PARAMS:
  ------------------
  |  |  313|  17.0k|#define OSSL_FUNC_DIGEST_GETTABLE_PARAMS 11
  ------------------
  |  Branch (1104:9): [True: 17.0k, False: 156k]
  ------------------
 1105|  17.0k|            if (md->gettable_params == NULL)
  ------------------
  |  Branch (1105:17): [True: 17.0k, False: 0]
  ------------------
 1106|  17.0k|                md->gettable_params = OSSL_FUNC_digest_gettable_params(fns);
 1107|  17.0k|            break;
 1108|  5.05k|        case OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  314|  5.05k|#define OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS 12
  ------------------
  |  Branch (1108:9): [True: 5.05k, False: 168k]
  ------------------
 1109|  5.05k|            if (md->settable_ctx_params == NULL)
  ------------------
  |  Branch (1109:17): [True: 5.05k, False: 0]
  ------------------
 1110|  5.05k|                md->settable_ctx_params = OSSL_FUNC_digest_settable_ctx_params(fns);
 1111|  5.05k|            break;
 1112|  3.79k|        case OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  315|  3.79k|#define OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS 13
  ------------------
  |  Branch (1112:9): [True: 3.79k, False: 170k]
  ------------------
 1113|  3.79k|            if (md->gettable_ctx_params == NULL)
  ------------------
  |  Branch (1113:17): [True: 3.79k, False: 0]
  ------------------
 1114|  3.79k|                md->gettable_ctx_params = OSSL_FUNC_digest_gettable_ctx_params(fns);
 1115|  3.79k|            break;
 1116|  17.0k|        case OSSL_FUNC_DIGEST_COPYCTX:
  ------------------
  |  |  317|  17.0k|#define OSSL_FUNC_DIGEST_COPYCTX 15
  ------------------
  |  Branch (1116:9): [True: 17.0k, False: 156k]
  ------------------
 1117|  17.0k|            if (md->copyctx == NULL)
  ------------------
  |  Branch (1117:17): [True: 17.0k, False: 0]
  ------------------
 1118|  17.0k|                md->copyctx = OSSL_FUNC_digest_copyctx(fns);
 1119|  17.0k|            break;
 1120|   173k|        }
 1121|   173k|    }
 1122|  17.0k|    if ((fncnt != 0 && fncnt != 5 && fncnt != 6)
  ------------------
  |  Branch (1122:10): [True: 17.0k, False: 0]
  |  Branch (1122:24): [True: 2.52k, False: 14.5k]
  |  Branch (1122:38): [True: 0, False: 2.52k]
  ------------------
 1123|  17.0k|        || (fncnt == 0 && md->digest == NULL)) {
  ------------------
  |  Branch (1123:13): [True: 0, False: 17.0k]
  |  Branch (1123:27): [True: 0, False: 0]
  ------------------
 1124|       |        /*
 1125|       |         * In order to be a consistent set of functions we either need the
 1126|       |         * whole set of init/update/final etc functions or none of them.
 1127|       |         * The "digest" function can standalone. We at least need one way to
 1128|       |         * generate digests.
 1129|       |         */
 1130|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1131|      0|        goto err;
 1132|      0|    }
 1133|  17.0k|    if (prov != NULL && !ossl_provider_up_ref(prov))
  ------------------
  |  Branch (1133:9): [True: 17.0k, False: 0]
  |  Branch (1133:25): [True: 0, False: 17.0k]
  ------------------
 1134|      0|        goto err;
 1135|       |
 1136|  17.0k|    md->prov = prov;
 1137|       |
 1138|  17.0k|    if (!evp_md_cache_constants(md)) {
  ------------------
  |  Branch (1138:9): [True: 0, False: 17.0k]
  ------------------
 1139|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_CACHE_CONSTANTS_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1140|      0|        goto err;
 1141|      0|    }
 1142|       |
 1143|  17.0k|    return md;
 1144|       |
 1145|      0|err:
 1146|      0|    EVP_MD_free(md);
 1147|       |    return NULL;
 1148|  17.0k|}
digest.c:set_legacy_nid:
  960|  44.8k|{
  961|  44.8k|    int nid;
  962|  44.8k|    int *legacy_nid = vlegacy_nid;
  963|       |    /*
  964|       |     * We use lowest level function to get the associated method, because
  965|       |     * higher level functions such as EVP_get_digestbyname() have changed
  966|       |     * to look at providers too.
  967|       |     */
  968|  44.8k|    const void *legacy_method = OBJ_NAME_get(name, OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|  44.8k|#define OBJ_NAME_TYPE_MD_METH 0x01
  ------------------
  969|       |
  970|  44.8k|    if (*legacy_nid == -1) /* We found a clash already */
  ------------------
  |  Branch (970:9): [True: 0, False: 44.8k]
  ------------------
  971|      0|        return;
  972|       |
  973|  44.8k|    if (legacy_method == NULL)
  ------------------
  |  Branch (973:9): [True: 30.3k, False: 14.5k]
  ------------------
  974|  30.3k|        return;
  975|  14.5k|    nid = EVP_MD_nid(legacy_method);
  ------------------
  |  |  554|  14.5k|#define EVP_MD_nid EVP_MD_get_type
  ------------------
  976|  14.5k|    if (*legacy_nid != NID_undef && *legacy_nid != nid) {
  ------------------
  |  |   18|  29.0k|#define NID_undef                       0
  ------------------
  |  Branch (976:9): [True: 2.52k, False: 12.0k]
  |  Branch (976:37): [True: 0, False: 2.52k]
  ------------------
  977|      0|        *legacy_nid = -1;
  978|      0|        return;
  979|      0|    }
  980|  14.5k|    *legacy_nid = nid;
  981|  14.5k|}
digest.c:evp_md_cache_constants:
  985|  17.0k|{
  986|  17.0k|    int ok, xof = 0, algid_absent = 0;
  987|  17.0k|    size_t blksz = 0;
  988|  17.0k|    size_t mdsize = 0;
  989|  17.0k|    OSSL_PARAM params[5];
  990|       |
  991|       |    /*
  992|       |     * Note that these parameters are 'constants' that are only set up
  993|       |     * during the EVP_MD_fetch(). For this reason the XOF functions set the
  994|       |     * md_size to 0, since the output size is unknown.
  995|       |     */
  996|  17.0k|    params[0] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_BLOCK_SIZE, &blksz);
  ------------------
  |  |  226|  17.0k|# define OSSL_DIGEST_PARAM_BLOCK_SIZE "blocksize"
  ------------------
  997|  17.0k|    params[1] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_SIZE, &mdsize);
  ------------------
  |  |  229|  17.0k|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
  998|  17.0k|    params[2] = OSSL_PARAM_construct_int(OSSL_DIGEST_PARAM_XOF, &xof);
  ------------------
  |  |  231|  17.0k|# define OSSL_DIGEST_PARAM_XOF "xof"
  ------------------
  999|  17.0k|    params[3] = OSSL_PARAM_construct_int(OSSL_DIGEST_PARAM_ALGID_ABSENT,
  ------------------
  |  |  225|  17.0k|# define OSSL_DIGEST_PARAM_ALGID_ABSENT "algid-absent"
  ------------------
 1000|  17.0k|        &algid_absent);
 1001|  17.0k|    params[4] = OSSL_PARAM_construct_end();
 1002|  17.0k|    ok = evp_do_md_getparams(md, params) > 0;
 1003|  17.0k|    if (mdsize > INT_MAX || blksz > INT_MAX)
  ------------------
  |  Branch (1003:9): [True: 0, False: 17.0k]
  |  Branch (1003:29): [True: 0, False: 17.0k]
  ------------------
 1004|      0|        ok = 0;
 1005|  17.0k|    if (ok) {
  ------------------
  |  Branch (1005:9): [True: 17.0k, False: 0]
  ------------------
 1006|  17.0k|        md->block_size = (int)blksz;
 1007|  17.0k|        md->md_size = (int)mdsize;
 1008|  17.0k|        if (xof)
  ------------------
  |  Branch (1008:13): [True: 2.52k, False: 14.5k]
  ------------------
 1009|  2.52k|            md->flags |= EVP_MD_FLAG_XOF;
  ------------------
  |  |  179|  2.52k|#define EVP_MD_FLAG_XOF 0x0002
  ------------------
 1010|  17.0k|        if (algid_absent)
  ------------------
  |  Branch (1010:13): [True: 11.3k, False: 5.68k]
  ------------------
 1011|  11.3k|            md->flags |= EVP_MD_FLAG_DIGALGID_ABSENT;
  ------------------
  |  |  191|  11.3k|#define EVP_MD_FLAG_DIGALGID_ABSENT 0x0008
  ------------------
 1012|  17.0k|    }
 1013|  17.0k|    return ok;
 1014|  17.0k|}
digest.c:evp_md_up_ref:
 1151|   413k|{
 1152|   413k|    return EVP_MD_up_ref(md);
 1153|   413k|}
digest.c:evp_md_free:
 1156|  39.8k|{
 1157|  39.8k|    EVP_MD_free(md);
 1158|  39.8k|}

EVP_aes_128_cbc:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_128_ecb:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_128_ofb:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_128_cfb128:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_128_cfb1:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_128_cfb8:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_128_ctr:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_192_cbc:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_192_ecb:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_192_ofb:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_192_cfb128:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_192_cfb1:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_192_cfb8:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_192_ctr:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_256_cbc:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_256_ecb:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_256_ofb:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_256_cfb128:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_256_cfb1:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_256_cfb8:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_256_ctr:
  441|      1|    {                                                                                 \
  442|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;     \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  443|      1|    }
EVP_aes_128_gcm:
  471|      1|    {                                                                                                                      \
  472|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;                                          \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  473|      1|    }
EVP_aes_192_gcm:
  471|      1|    {                                                                                                                      \
  472|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;                                          \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  473|      1|    }
EVP_aes_256_gcm:
  471|      1|    {                                                                                                                      \
  472|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;                                          \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  473|      1|    }
EVP_aes_128_xts:
  471|      1|    {                                                                                                                      \
  472|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;                                          \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  473|      1|    }
EVP_aes_256_xts:
  471|      1|    {                                                                                                                      \
  472|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;                                          \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  473|      1|    }
EVP_aes_128_ccm:
  471|      1|    {                                                                                                                      \
  472|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;                                          \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  473|      1|    }
EVP_aes_192_ccm:
  471|      1|    {                                                                                                                      \
  472|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;                                          \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  473|      1|    }
EVP_aes_256_ccm:
  471|      1|    {                                                                                                                      \
  472|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;                                          \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  473|      1|    }
EVP_aes_128_wrap:
 3775|      1|{
 3776|      1|    return &aes_128_wrap;
 3777|      1|}
EVP_aes_192_wrap:
 3789|      1|{
 3790|      1|    return &aes_192_wrap;
 3791|      1|}
EVP_aes_256_wrap:
 3803|      1|{
 3804|      1|    return &aes_256_wrap;
 3805|      1|}
EVP_aes_128_wrap_pad:
 3817|      1|{
 3818|      1|    return &aes_128_wrap_pad;
 3819|      1|}
EVP_aes_192_wrap_pad:
 3831|      1|{
 3832|      1|    return &aes_192_wrap_pad;
 3833|      1|}
EVP_aes_256_wrap_pad:
 3845|      1|{
 3846|      1|    return &aes_256_wrap_pad;
 3847|      1|}
EVP_aes_128_ocb:
  471|      1|    {                                                                                                                      \
  472|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;                                          \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  473|      1|    }
EVP_aes_192_ocb:
  471|      1|    {                                                                                                                      \
  472|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;                                          \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  473|      1|    }
EVP_aes_256_ocb:
  471|      1|    {                                                                                                                      \
  472|      1|        return AESNI_CAPABLE ? &aesni_##keylen##_##mode : &aes_##keylen##_##mode;                                          \
  ------------------
  |  |  185|      1|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (185:23): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  473|      1|    }

EVP_aes_128_cbc_hmac_sha1:
  937|      1|{
  938|      1|    return (OPENSSL_ia32cap_P[1] & AESNI_CAPABLE ? &aesni_128_cbc_hmac_sha1_cipher : NULL);
  ------------------
  |  |   45|      1|#define AESNI_CAPABLE (1 << (57 - 32))
  ------------------
  |  Branch (938:13): [True: 1, False: 0]
  ------------------
  939|      1|}
EVP_aes_256_cbc_hmac_sha1:
  942|      1|{
  943|      1|    return (OPENSSL_ia32cap_P[1] & AESNI_CAPABLE ? &aesni_256_cbc_hmac_sha1_cipher : NULL);
  ------------------
  |  |   45|      1|#define AESNI_CAPABLE (1 << (57 - 32))
  ------------------
  |  Branch (943:13): [True: 1, False: 0]
  ------------------
  944|      1|}

EVP_aes_128_cbc_hmac_sha256:
  913|      1|{
  914|      1|    return ((OPENSSL_ia32cap_P[1] & AESNI_CAPABLE) && aesni_cbc_sha256_enc(NULL, NULL, 0, NULL, NULL, NULL, NULL) ? &aesni_128_cbc_hmac_sha256_cipher : NULL);
  ------------------
  |  |   45|      1|#define AESNI_CAPABLE (1 << (57 - 32))
  ------------------
  |  Branch (914:13): [True: 1, False: 0]
  |  Branch (914:55): [True: 1, False: 0]
  ------------------
  915|      1|}
EVP_aes_256_cbc_hmac_sha256:
  918|      1|{
  919|      1|    return ((OPENSSL_ia32cap_P[1] & AESNI_CAPABLE) && aesni_cbc_sha256_enc(NULL, NULL, 0, NULL, NULL, NULL, NULL) ? &aesni_256_cbc_hmac_sha256_cipher : NULL);
  ------------------
  |  |   45|      1|#define AESNI_CAPABLE (1 << (57 - 32))
  ------------------
  |  Branch (919:13): [True: 1, False: 0]
  |  Branch (919:55): [True: 1, False: 0]
  ------------------
  920|      1|}

EVP_aria_128_ctr:
  174|      1|    {                                                                                 \
  175|      1|        return &aria_##keylen##_##mode;                                               \
  176|      1|    }
EVP_aria_192_ctr:
  174|      1|    {                                                                                 \
  175|      1|        return &aria_##keylen##_##mode;                                               \
  176|      1|    }
EVP_aria_256_ctr:
  174|      1|    {                                                                                 \
  175|      1|        return &aria_##keylen##_##mode;                                               \
  176|      1|    }
EVP_aria_128_gcm:
  776|      1|    {                                                  \
  777|      1|        return (EVP_CIPHER *)&aria_##keylen##_##mode;  \
  778|      1|    }
EVP_aria_192_gcm:
  776|      1|    {                                                  \
  777|      1|        return (EVP_CIPHER *)&aria_##keylen##_##mode;  \
  778|      1|    }
EVP_aria_256_gcm:
  776|      1|    {                                                  \
  777|      1|        return (EVP_CIPHER *)&aria_##keylen##_##mode;  \
  778|      1|    }
EVP_aria_128_ccm:
  776|      1|    {                                                  \
  777|      1|        return (EVP_CIPHER *)&aria_##keylen##_##mode;  \
  778|      1|    }
EVP_aria_192_ccm:
  776|      1|    {                                                  \
  777|      1|        return (EVP_CIPHER *)&aria_##keylen##_##mode;  \
  778|      1|    }
EVP_aria_256_ccm:
  776|      1|    {                                                  \
  777|      1|        return (EVP_CIPHER *)&aria_##keylen##_##mode;  \
  778|      1|    }

EVP_camellia_128_cbc:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_128_ecb:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_128_ofb:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_128_cfb128:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_128_cfb1:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_128_cfb8:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_128_ctr:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_192_cbc:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_192_ecb:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_192_ofb:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_192_cfb128:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_192_cfb1:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_192_cfb8:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_192_ctr:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_256_cbc:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_256_ecb:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_256_ofb:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_256_cfb128:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_256_cfb1:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_256_cfb8:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }
EVP_camellia_256_ctr:
  180|      1|    {                                                                                 \
  181|      1|        return &camellia_##keylen##_##mode;                                           \
  182|      1|    }

EVP_chacha20:
  147|      1|{
  148|      1|    return &chacha20;
  149|      1|}
EVP_chacha20_poly1305:
  626|      1|{
  627|      1|    return (&chacha20_poly1305);
  628|      1|}

EVP_des_ede:
  301|      1|{
  302|      1|    return &des_ede_ecb;
  303|      1|}
EVP_des_ede3:
  306|      1|{
  307|      1|    return &des_ede3_ecb;
  308|      1|}
EVP_des_ede3_wrap:
  421|      1|{
  422|      1|    return &des3_wrap;
  423|      1|}

EVP_rc2_64_cbc:
   83|      1|{
   84|      1|    return &r2_64_cbc_cipher;
   85|      1|}
EVP_rc2_40_cbc:
   88|      1|{
   89|      1|    return &r2_40_cbc_cipher;
   90|      1|}

EVP_rc4:
   68|      1|{
   69|      1|    return &r4_cipher;
   70|      1|}
EVP_rc4_40:
   73|      1|{
   74|      1|    return &r4_40_cipher;
   75|      1|}

EVP_rc4_hmac_md5:
  263|      1|{
  264|      1|    return &r4_hmac_md5_cipher;
  265|      1|}

EVP_sm4_cbc:
   48|      1|    {                                                                         \
   49|      1|        return &sm4_##mode;                                                   \
   50|      1|    }
EVP_sm4_ecb:
   48|      1|    {                                                                         \
   49|      1|        return &sm4_##mode;                                                   \
   50|      1|    }
EVP_sm4_ofb:
   48|      1|    {                                                                         \
   49|      1|        return &sm4_##mode;                                                   \
   50|      1|    }
EVP_sm4_cfb128:
   48|      1|    {                                                                         \
   49|      1|        return &sm4_##mode;                                                   \
   50|      1|    }
EVP_sm4_ctr:
   48|      1|    {                                                                         \
   49|      1|        return &sm4_##mode;                                                   \
   50|      1|    }

EVP_desx_cbc:
   56|      1|{
   57|      1|    return &d_xcbc_cipher;
   58|      1|}

OSSL_EC_curve_nid2name:
  119|   113k|{
  120|   113k|    size_t i;
  121|       |
  122|   113k|    if (nid <= 0)
  ------------------
  |  Branch (122:9): [True: 0, False: 113k]
  ------------------
  123|      0|        return NULL;
  124|       |
  125|  1.48M|    for (i = 0; i < OSSL_NELEM(curve_list); i++) {
  ------------------
  |  |   14|  1.48M|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (125:17): [True: 1.48M, False: 0]
  ------------------
  126|  1.48M|        if (curve_list[i].nid == nid)
  ------------------
  |  Branch (126:13): [True: 113k, False: 1.37M]
  ------------------
  127|   113k|            return curve_list[i].name;
  128|  1.48M|    }
  129|      0|    return NULL;
  130|   113k|}
ossl_ec_curve_name2nid:
  133|    226|{
  134|    226|    size_t i;
  135|    226|    int nid;
  136|       |
  137|    226|    if (name != NULL) {
  ------------------
  |  Branch (137:9): [True: 226, False: 0]
  ------------------
  138|    226|        if ((nid = ossl_ec_curve_nist2nid_int(name)) != NID_undef)
  ------------------
  |  |   18|    226|#define NID_undef                       0
  ------------------
  |  Branch (138:13): [True: 0, False: 226]
  ------------------
  139|      0|            return nid;
  140|       |
  141|  12.7k|        for (i = 0; i < OSSL_NELEM(curve_list); i++) {
  ------------------
  |  |   14|  12.7k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (141:21): [True: 12.7k, False: 0]
  ------------------
  142|  12.7k|            if (OPENSSL_strcasecmp(curve_list[i].name, name) == 0)
  ------------------
  |  Branch (142:17): [True: 226, False: 12.5k]
  ------------------
  143|    226|                return curve_list[i].nid;
  144|  12.7k|        }
  145|    226|    }
  146|       |
  147|      0|    return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  148|    226|}
ossl_ec_curve_nist2nid_int:
  181|    226|{
  182|    226|    size_t i;
  183|  3.61k|    for (i = 0; i < OSSL_NELEM(nist_curves); i++) {
  ------------------
  |  |   14|  3.61k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (183:17): [True: 3.39k, False: 226]
  ------------------
  184|  3.39k|        if (strcmp(nist_curves[i].name, name) == 0)
  ------------------
  |  Branch (184:13): [True: 0, False: 3.39k]
  ------------------
  185|      0|            return nist_curves[i].nid;
  186|  3.39k|    }
  187|    226|    return NID_undef;
  ------------------
  |  |   18|    226|#define NID_undef                       0
  ------------------
  188|    226|}

EVP_ENCODE_CTX_new:
  349|   412k|{
  350|   412k|    return OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
  ------------------
  |  |  108|   412k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  351|   412k|}
EVP_ENCODE_CTX_free:
  354|   417k|{
  355|   417k|    OPENSSL_free(ctx);
  ------------------
  |  |  131|   417k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  356|   417k|}
EVP_DecodeInit:
  495|   412k|{
  496|       |    /* Only ctx->num and ctx->flags are used during decoding. */
  497|   412k|    ctx->num = 0;
  498|   412k|    ctx->length = 0;
  499|   412k|    ctx->line_num = 0;
  500|   412k|    ctx->flags = 0;
  501|   412k|}
EVP_DecodeUpdate:
  525|   412k|{
  526|   412k|    int seof = 0, eof = 0, rv = -1, ret = 0, i, v, tmp, n, decoded_len;
  527|   412k|    unsigned char *d;
  528|   412k|    const unsigned char *table;
  529|       |
  530|   412k|    n = ctx->num;
  531|   412k|    d = ctx->enc_data;
  532|       |
  533|   412k|    if (n > 0 && d[n - 1] == '=') {
  ------------------
  |  Branch (533:9): [True: 0, False: 412k]
  |  Branch (533:18): [True: 0, False: 0]
  ------------------
  534|      0|        eof++;
  535|      0|        if (n > 1 && d[n - 2] == '=')
  ------------------
  |  Branch (535:13): [True: 0, False: 0]
  |  Branch (535:22): [True: 0, False: 0]
  ------------------
  536|      0|            eof++;
  537|      0|    }
  538|       |
  539|       |    /* Legacy behaviour: an empty input chunk signals end of input. */
  540|   412k|    if (inl == 0) {
  ------------------
  |  Branch (540:9): [True: 0, False: 412k]
  ------------------
  541|      0|        rv = 0;
  542|      0|        goto end;
  543|      0|    }
  544|       |
  545|   412k|    if ((ctx->flags & EVP_ENCODE_CTX_USE_SRP_ALPHABET) != 0)
  ------------------
  |  |  899|   412k|#define EVP_ENCODE_CTX_USE_SRP_ALPHABET 2
  ------------------
  |  Branch (545:9): [True: 0, False: 412k]
  ------------------
  546|      0|        table = srpdata_ascii2bin;
  547|   412k|    else
  548|   412k|        table = data_ascii2bin;
  549|       |
  550|   597M|    for (i = 0; i < inl; i++) {
  ------------------
  |  Branch (550:17): [True: 597M, False: 412k]
  ------------------
  551|   597M|        tmp = *(in++);
  552|   597M|        v = conv_ascii2bin(tmp, table);
  553|   597M|        if (v == B64_ERROR) {
  ------------------
  |  |   65|   597M|#define B64_ERROR 0xFF
  ------------------
  |  Branch (553:13): [True: 0, False: 597M]
  ------------------
  554|      0|            rv = -1;
  555|      0|            goto end;
  556|      0|        }
  557|       |
  558|   597M|        if (tmp == '=') {
  ------------------
  |  Branch (558:13): [True: 341k, False: 596M]
  ------------------
  559|   341k|            eof++;
  560|   596M|        } else if (eof > 0 && B64_BASE64(v)) {
  ------------------
  |  |   67|   237k|#define B64_BASE64(a) (!B64_NOT_BASE64(a))
  |  |  ------------------
  |  |  |  |   66|   237k|#define B64_NOT_BASE64(a) (((a) | 0x13) == 0xF3)
  |  |  ------------------
  |  |  |  Branch (67:23): [True: 0, False: 237k]
  |  |  ------------------
  ------------------
  |  Branch (560:20): [True: 237k, False: 596M]
  ------------------
  561|       |            /* More data after padding. */
  562|      0|            rv = -1;
  563|      0|            goto end;
  564|      0|        }
  565|       |
  566|   597M|        if (eof > 2) {
  ------------------
  |  Branch (566:13): [True: 0, False: 597M]
  ------------------
  567|      0|            rv = -1;
  568|      0|            goto end;
  569|      0|        }
  570|       |
  571|   597M|        if (v == B64_EOF) {
  ------------------
  |  |   63|   597M|#define B64_EOF 0xF2
  ------------------
  |  Branch (571:13): [True: 0, False: 597M]
  ------------------
  572|      0|            seof = 1;
  573|      0|            goto tail;
  574|      0|        }
  575|       |
  576|       |        /* Only save valid base64 characters. */
  577|   597M|        if (B64_BASE64(v)) {
  ------------------
  |  |   67|   597M|#define B64_BASE64(a) (!B64_NOT_BASE64(a))
  |  |  ------------------
  |  |  |  |   66|   597M|#define B64_NOT_BASE64(a) (((a) | 0x13) == 0xF3)
  |  |  ------------------
  |  |  |  Branch (67:23): [True: 587M, False: 9.37M]
  |  |  ------------------
  ------------------
  578|   587M|            if (n >= 64) {
  ------------------
  |  Branch (578:17): [True: 0, False: 587M]
  ------------------
  579|       |                /*
  580|       |                 * We increment n once per loop, and empty the buffer as soon as
  581|       |                 * we reach 64 characters, so this can only happen if someone's
  582|       |                 * manually messed with the ctx. Refuse to write any more data.
  583|       |                 */
  584|      0|                rv = -1;
  585|      0|                goto end;
  586|      0|            }
  587|   587M|            OPENSSL_assert(n < (int)sizeof(ctx->enc_data));
  ------------------
  |  |  476|   587M|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (476:12): [True: 587M, False: 0]
  |  |  ------------------
  ------------------
  588|   587M|            d[n++] = tmp;
  589|   587M|        }
  590|       |
  591|   597M|        if (n == 64) {
  ------------------
  |  Branch (591:13): [True: 8.99M, False: 588M]
  ------------------
  592|  8.99M|            decoded_len = evp_decodeblock_int(ctx, out, d, n, eof);
  593|  8.99M|            n = 0;
  594|  8.99M|            if (decoded_len < 0 || (decoded_len == 0 && eof > 0)) {
  ------------------
  |  Branch (594:17): [True: 0, False: 8.99M]
  |  Branch (594:37): [True: 0, False: 8.99M]
  |  Branch (594:57): [True: 0, False: 0]
  ------------------
  595|      0|                rv = -1;
  596|      0|                goto end;
  597|      0|            }
  598|  8.99M|            ret += decoded_len;
  599|  8.99M|            out += decoded_len;
  600|  8.99M|        }
  601|   597M|    }
  602|       |
  603|       |    /*
  604|       |     * Legacy behaviour: if the current line is a full base64-block (i.e., has
  605|       |     * 0 mod 4 base64 characters), it is processed immediately. We keep this
  606|       |     * behaviour as applications may not be calling EVP_DecodeFinal properly.
  607|       |     */
  608|   412k|tail:
  609|   412k|    if (n > 0) {
  ------------------
  |  Branch (609:9): [True: 378k, False: 33.8k]
  ------------------
  610|   378k|        if ((n & 3) == 0) {
  ------------------
  |  Branch (610:13): [True: 378k, False: 0]
  ------------------
  611|   378k|            decoded_len = evp_decodeblock_int(ctx, out, d, n, eof);
  612|   378k|            n = 0;
  613|   378k|            if (decoded_len < 0 || (decoded_len == 0 && eof > 0)) {
  ------------------
  |  Branch (613:17): [True: 0, False: 378k]
  |  Branch (613:37): [True: 0, False: 378k]
  |  Branch (613:57): [True: 0, False: 0]
  ------------------
  614|      0|                rv = -1;
  615|      0|                goto end;
  616|      0|            }
  617|   378k|            ret += decoded_len;
  618|   378k|        } else if (seof) {
  ------------------
  |  Branch (618:20): [True: 0, False: 0]
  ------------------
  619|       |            /* EOF in the middle of a base64 block. */
  620|      0|            rv = -1;
  621|      0|            goto end;
  622|      0|        }
  623|   378k|    }
  624|       |
  625|   412k|    rv = seof || (n == 0 && eof) ? 0 : 1;
  ------------------
  |  Branch (625:10): [True: 0, False: 412k]
  |  Branch (625:19): [True: 412k, False: 0]
  |  Branch (625:29): [True: 237k, False: 175k]
  ------------------
  626|   412k|end:
  627|       |    /* Legacy behaviour. This should probably rather be zeroed on error. */
  628|   412k|    *outl = ret;
  629|   412k|    ctx->num = n;
  630|   412k|    return rv;
  631|   412k|}
EVP_DecodeFinal:
  719|   412k|{
  720|   412k|    int i;
  721|       |
  722|   412k|    *outl = 0;
  723|   412k|    if (ctx->num != 0) {
  ------------------
  |  Branch (723:9): [True: 0, False: 412k]
  ------------------
  724|      0|        i = evp_decodeblock_int(ctx, out, ctx->enc_data, ctx->num, -1);
  725|      0|        if (i < 0)
  ------------------
  |  Branch (725:13): [True: 0, False: 0]
  ------------------
  726|      0|            return -1;
  727|      0|        ctx->num = 0;
  728|      0|        *outl = i;
  729|      0|        return 1;
  730|      0|    } else
  731|   412k|        return 1;
  732|   412k|}
encode.c:conv_ascii2bin:
  333|  1.20G|{
  334|  1.20G|    if (a & 0x80)
  ------------------
  |  Branch (334:9): [True: 0, False: 1.20G]
  ------------------
  335|      0|        return B64_ERROR;
  ------------------
  |  |   65|      0|#define B64_ERROR 0xFF
  ------------------
  336|  1.20G|    return table[a];
  337|  1.20G|}
encode.c:evp_decodeblock_int:
  636|  9.37M|{
  637|  9.37M|    int i, ret = 0, a, b, c, d;
  638|  9.37M|    unsigned long l;
  639|  9.37M|    const unsigned char *table;
  640|       |
  641|  9.37M|    if (eof < -1 || eof > 2)
  ------------------
  |  Branch (641:9): [True: 0, False: 9.37M]
  |  Branch (641:21): [True: 0, False: 9.37M]
  ------------------
  642|      0|        return -1;
  643|       |
  644|  9.37M|    if (ctx != NULL && (ctx->flags & EVP_ENCODE_CTX_USE_SRP_ALPHABET) != 0)
  ------------------
  |  |  899|  9.37M|#define EVP_ENCODE_CTX_USE_SRP_ALPHABET 2
  ------------------
  |  Branch (644:9): [True: 9.37M, False: 0]
  |  Branch (644:24): [True: 0, False: 9.37M]
  ------------------
  645|      0|        table = srpdata_ascii2bin;
  646|  9.37M|    else
  647|  9.37M|        table = data_ascii2bin;
  648|       |
  649|       |    /* trim whitespace from the start of the line. */
  650|  9.37M|    while ((n > 0) && (conv_ascii2bin(*f, table) == B64_WS)) {
  ------------------
  |  |   64|  9.37M|#define B64_WS 0xE0
  ------------------
  |  Branch (650:12): [True: 9.37M, False: 0]
  |  Branch (650:23): [True: 0, False: 9.37M]
  ------------------
  651|      0|        f++;
  652|      0|        n--;
  653|      0|    }
  654|       |
  655|       |    /*
  656|       |     * strip off stuff at the end of the line ascii2bin values B64_WS,
  657|       |     * B64_EOLN, B64_EOLN and B64_EOF
  658|       |     */
  659|  9.37M|    while ((n > 3) && (B64_NOT_BASE64(conv_ascii2bin(f[n - 1], table))))
  ------------------
  |  |   66|  9.37M|#define B64_NOT_BASE64(a) (((a) | 0x13) == 0xF3)
  ------------------
  |  Branch (659:12): [True: 9.37M, False: 0]
  |  Branch (659:23): [True: 0, False: 9.37M]
  ------------------
  660|      0|        n--;
  661|       |
  662|  9.37M|    if (n % 4 != 0)
  ------------------
  |  Branch (662:9): [True: 0, False: 9.37M]
  ------------------
  663|      0|        return -1;
  664|  9.37M|    if (n == 0)
  ------------------
  |  Branch (664:9): [True: 0, False: 9.37M]
  ------------------
  665|      0|        return 0;
  666|       |
  667|       |    /* all 4-byte blocks except the last one do not have padding. */
  668|   146M|    for (i = 0; i < n - 4; i += 4) {
  ------------------
  |  Branch (668:17): [True: 137M, False: 9.37M]
  ------------------
  669|   137M|        a = conv_ascii2bin(*(f++), table);
  670|   137M|        b = conv_ascii2bin(*(f++), table);
  671|   137M|        c = conv_ascii2bin(*(f++), table);
  672|   137M|        d = conv_ascii2bin(*(f++), table);
  673|   137M|        if ((a | b | c | d) & 0x80)
  ------------------
  |  Branch (673:13): [True: 0, False: 137M]
  ------------------
  674|      0|            return -1;
  675|   137M|        l = ((((unsigned long)a) << 18L) | (((unsigned long)b) << 12L) | (((unsigned long)c) << 6L) | (((unsigned long)d)));
  676|   137M|        *(t++) = (unsigned char)(l >> 16L) & 0xff;
  677|   137M|        *(t++) = (unsigned char)(l >> 8L) & 0xff;
  678|   137M|        *(t++) = (unsigned char)(l) & 0xff;
  679|   137M|        ret += 3;
  680|   137M|    }
  681|       |
  682|       |    /* process the last block that may have padding. */
  683|  9.37M|    a = conv_ascii2bin(*(f++), table);
  684|  9.37M|    b = conv_ascii2bin(*(f++), table);
  685|  9.37M|    c = conv_ascii2bin(*(f++), table);
  686|  9.37M|    d = conv_ascii2bin(*(f++), table);
  687|  9.37M|    if ((a | b | c | d) & 0x80)
  ------------------
  |  Branch (687:9): [True: 0, False: 9.37M]
  ------------------
  688|      0|        return -1;
  689|  9.37M|    l = ((((unsigned long)a) << 18L) | (((unsigned long)b) << 12L) | (((unsigned long)c) << 6L) | (((unsigned long)d)));
  690|       |
  691|  9.37M|    if (eof == -1)
  ------------------
  |  Branch (691:9): [True: 0, False: 9.37M]
  ------------------
  692|      0|        eof = (c == '=') + (d == '=');
  693|       |
  694|  9.37M|    switch (eof) {
  ------------------
  |  Branch (694:13): [True: 9.37M, False: 0]
  ------------------
  695|   104k|    case 2:
  ------------------
  |  Branch (695:5): [True: 104k, False: 9.26M]
  ------------------
  696|   104k|        *(t++) = (unsigned char)(l >> 16L) & 0xff;
  697|   104k|        break;
  698|   132k|    case 1:
  ------------------
  |  Branch (698:5): [True: 132k, False: 9.23M]
  ------------------
  699|   132k|        *(t++) = (unsigned char)(l >> 16L) & 0xff;
  700|   132k|        *(t++) = (unsigned char)(l >> 8L) & 0xff;
  701|   132k|        break;
  702|  9.13M|    case 0:
  ------------------
  |  Branch (702:5): [True: 9.13M, False: 237k]
  ------------------
  703|  9.13M|        *(t++) = (unsigned char)(l >> 16L) & 0xff;
  704|  9.13M|        *(t++) = (unsigned char)(l >> 8L) & 0xff;
  705|  9.13M|        *(t++) = (unsigned char)(l) & 0xff;
  706|  9.13M|        break;
  707|  9.37M|    }
  708|  9.37M|    ret += 3 - eof;
  709|       |
  710|  9.37M|    return ret;
  711|  9.37M|}

EVP_CIPHER_CTX_reset:
   34|  4.94k|{
   35|  4.94k|    if (ctx == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 4.94k]
  ------------------
   36|      0|        return 1;
   37|       |
   38|  4.94k|    if (ctx->cipher == NULL || ctx->cipher->prov == NULL)
  ------------------
  |  Branch (38:9): [True: 0, False: 4.94k]
  |  Branch (38:32): [True: 0, False: 4.94k]
  ------------------
   39|      0|        goto legacy;
   40|       |
   41|  4.94k|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (41:9): [True: 4.94k, False: 0]
  ------------------
   42|  4.94k|        if (ctx->cipher->freectx != NULL)
  ------------------
  |  Branch (42:13): [True: 4.94k, False: 0]
  ------------------
   43|  4.94k|            ctx->cipher->freectx(ctx->algctx);
   44|  4.94k|        ctx->algctx = NULL;
   45|  4.94k|    }
   46|  4.94k|    if (ctx->fetched_cipher != NULL)
  ------------------
  |  Branch (46:9): [True: 4.94k, False: 0]
  ------------------
   47|  4.94k|        EVP_CIPHER_free(ctx->fetched_cipher);
   48|  4.94k|    memset(ctx, 0, sizeof(*ctx));
   49|  4.94k|    ctx->iv_len = -1;
   50|       |
   51|  4.94k|    return 1;
   52|       |
   53|       |    /* Remove legacy code below when legacy support is removed. */
   54|      0|legacy:
   55|       |
   56|      0|    if (ctx->cipher != NULL) {
  ------------------
  |  Branch (56:9): [True: 0, False: 0]
  ------------------
   57|      0|        if (ctx->cipher->cleanup && !ctx->cipher->cleanup(ctx))
  ------------------
  |  Branch (57:13): [True: 0, False: 0]
  |  Branch (57:37): [True: 0, False: 0]
  ------------------
   58|      0|            return 0;
   59|       |        /* Cleanse cipher context data */
   60|      0|        if (ctx->cipher_data && ctx->cipher->ctx_size)
  ------------------
  |  Branch (60:13): [True: 0, False: 0]
  |  Branch (60:33): [True: 0, False: 0]
  ------------------
   61|      0|            OPENSSL_cleanse(ctx->cipher_data, ctx->cipher->ctx_size);
   62|      0|    }
   63|      0|    OPENSSL_free(ctx->cipher_data);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
   65|      0|    ENGINE_finish(ctx->engine);
   66|      0|#endif
   67|      0|    memset(ctx, 0, sizeof(*ctx));
   68|      0|    ctx->iv_len = -1;
   69|      0|    return 1;
   70|      0|}
EVP_CIPHER_CTX_new:
   73|  4.94k|{
   74|  4.94k|    EVP_CIPHER_CTX *ctx;
   75|       |
   76|  4.94k|    ctx = OPENSSL_zalloc(sizeof(EVP_CIPHER_CTX));
  ------------------
  |  |  108|  4.94k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|  4.94k|    if (ctx == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 4.94k]
  ------------------
   78|      0|        return NULL;
   79|       |
   80|  4.94k|    ctx->iv_len = -1;
   81|  4.94k|    return ctx;
   82|  4.94k|}
EVP_CIPHER_CTX_free:
   85|  15.5k|{
   86|  15.5k|    if (ctx == NULL)
  ------------------
  |  Branch (86:9): [True: 10.6k, False: 4.94k]
  ------------------
   87|  10.6k|        return;
   88|  4.94k|    EVP_CIPHER_CTX_reset(ctx);
   89|  4.94k|    OPENSSL_free(ctx);
  ------------------
  |  |  131|  4.94k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   90|  4.94k|}
EVP_CipherInit_ex:
  652|   125k|{
  653|       |    return evp_cipher_init_internal(ctx, cipher, impl, key, iv, enc, 0, NULL);
  654|   125k|}
EVP_CipherUpdate:
  718|   111k|{
  719|   111k|    if (ctx->encrypt)
  ------------------
  |  Branch (719:9): [True: 111k, False: 0]
  ------------------
  720|   111k|        return EVP_EncryptUpdate(ctx, out, outl, in, inl);
  721|      0|    else
  722|      0|        return EVP_DecryptUpdate(ctx, out, outl, in, inl);
  723|   111k|}
EVP_EncryptUpdate:
  977|   111k|{
  978|   111k|    int ret;
  979|   111k|    size_t soutl, inl_ = (size_t)inl;
  980|   111k|    int blocksize;
  981|       |
  982|   111k|    if (inl < 0) {
  ------------------
  |  Branch (982:9): [True: 0, False: 111k]
  ------------------
  983|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_LENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  984|      0|        return 0;
  985|      0|    }
  986|       |
  987|   111k|    if (ossl_likely(outl != NULL)) {
  ------------------
  |  |   22|   111k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 111k, False: 0]
  |  |  ------------------
  ------------------
  988|   111k|        *outl = 0;
  989|   111k|    } else {
  990|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  991|      0|        return 0;
  992|      0|    }
  993|       |
  994|       |    /* Prevent accidental use of decryption context when encrypting */
  995|   111k|    if (ossl_unlikely(!ctx->encrypt)) {
  ------------------
  |  |   23|   111k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 111k]
  |  |  ------------------
  ------------------
  996|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_OPERATION);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  997|      0|        return 0;
  998|      0|    }
  999|       |
 1000|   111k|    if (ossl_unlikely(ctx->cipher == NULL)) {
  ------------------
  |  |   23|   111k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 111k]
  |  |  ------------------
  ------------------
 1001|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_NO_CIPHER_SET);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1002|      0|        return 0;
 1003|      0|    }
 1004|       |
 1005|   111k|    if (ossl_unlikely(ctx->cipher->prov == NULL))
  ------------------
  |  |   23|   111k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 111k]
  |  |  ------------------
  ------------------
 1006|      0|        goto legacy;
 1007|       |
 1008|   111k|    blocksize = ctx->cipher->block_size;
 1009|       |
 1010|   111k|    if (ossl_unlikely(ctx->cipher->cupdate == NULL || blocksize < 1)) {
  ------------------
  |  |   23|   222k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 111k]
  |  |  |  Branch (23:46): [True: 0, False: 111k]
  |  |  |  Branch (23:46): [True: 0, False: 111k]
  |  |  ------------------
  ------------------
 1011|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1012|      0|        return 0;
 1013|      0|    }
 1014|       |
 1015|   111k|    ret = ctx->cipher->cupdate(ctx->algctx, out, &soutl,
 1016|   111k|        inl_ + (size_t)(blocksize == 1 ? 0 : blocksize),
  ------------------
  |  Branch (1016:25): [True: 34.5k, False: 76.8k]
  ------------------
 1017|   111k|        in, inl_);
 1018|       |
 1019|   111k|    if (ossl_likely(ret)) {
  ------------------
  |  |   22|   111k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 111k, False: 0]
  |  |  ------------------
  ------------------
 1020|   111k|        if (ossl_unlikely(soutl > INT_MAX)) {
  ------------------
  |  |   23|   111k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 111k]
  |  |  ------------------
  ------------------
 1021|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1022|      0|            return 0;
 1023|      0|        }
 1024|   111k|        *outl = (int)soutl;
 1025|   111k|    }
 1026|       |
 1027|   111k|    return ret;
 1028|       |
 1029|       |    /* Code below to be removed when legacy support is dropped. */
 1030|      0|legacy:
 1031|       |
 1032|      0|    return evp_EncryptDecryptUpdate(ctx, out, outl, in, inl);
 1033|   111k|}
EVP_CIPHER_get_params:
 1647|  34.7k|{
 1648|  34.7k|    if (cipher != NULL && cipher->get_params != NULL)
  ------------------
  |  Branch (1648:9): [True: 34.7k, False: 0]
  |  Branch (1648:27): [True: 34.7k, False: 0]
  ------------------
 1649|  34.7k|        return cipher->get_params(params);
 1650|      0|    return 0;
 1651|  34.7k|}
EVP_CIPHER_gettable_ctx_params:
 1705|  82.1k|{
 1706|  82.1k|    void *provctx;
 1707|       |
 1708|  82.1k|    if (cipher != NULL && cipher->gettable_ctx_params != NULL) {
  ------------------
  |  Branch (1708:9): [True: 82.1k, False: 0]
  |  Branch (1708:27): [True: 82.1k, False: 0]
  ------------------
 1709|  82.1k|        provctx = ossl_provider_ctx(EVP_CIPHER_get0_provider(cipher));
 1710|  82.1k|        return cipher->gettable_ctx_params(NULL, provctx);
 1711|  82.1k|    }
 1712|      0|    return NULL;
 1713|  82.1k|}
evp_cipher_new:
 1848|  82.1k|{
 1849|  82.1k|    EVP_CIPHER *cipher = OPENSSL_zalloc(sizeof(EVP_CIPHER));
  ------------------
  |  |  108|  82.1k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1850|       |
 1851|  82.1k|    if (cipher != NULL && !CRYPTO_NEW_REF(&cipher->refcnt, 1)) {
  ------------------
  |  Branch (1851:9): [True: 82.1k, False: 0]
  |  Branch (1851:27): [True: 0, False: 82.1k]
  ------------------
 1852|      0|        OPENSSL_free(cipher);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1853|      0|        return NULL;
 1854|      0|    }
 1855|  82.1k|    return cipher;
 1856|  82.1k|}
EVP_CIPHER_fetch:
 2076|  58.9k|{
 2077|  58.9k|    EVP_CIPHER *cipher = evp_generic_fetch(ctx, OSSL_OP_CIPHER, algorithm, properties,
  ------------------
  |  |  284|  58.9k|#define OSSL_OP_CIPHER 2 /* Symmetric Ciphers */
  ------------------
 2078|  58.9k|        evp_cipher_from_algorithm, evp_cipher_up_ref,
 2079|  58.9k|        evp_cipher_free);
 2080|       |
 2081|  58.9k|    return cipher;
 2082|  58.9k|}
evp_cipher_fetch_from_prov:
 2087|  3.29k|{
 2088|  3.29k|    return evp_generic_fetch_from_prov(prov, OSSL_OP_CIPHER,
  ------------------
  |  |  284|  3.29k|#define OSSL_OP_CIPHER 2 /* Symmetric Ciphers */
  ------------------
 2089|  3.29k|        algorithm, properties,
 2090|  3.29k|        evp_cipher_from_algorithm,
 2091|  3.29k|        evp_cipher_up_ref,
 2092|  3.29k|        evp_cipher_free);
 2093|  3.29k|}
EVP_CIPHER_up_ref:
 2105|   132k|{
 2106|   132k|    int ref = 0;
 2107|       |
 2108|   132k|    if (cipher->origin == EVP_ORIG_DYNAMIC)
  ------------------
  |  |  254|   132k|#define EVP_ORIG_DYNAMIC 0
  ------------------
  |  Branch (2108:9): [True: 132k, False: 0]
  ------------------
 2109|   132k|        CRYPTO_UP_REF(&cipher->refcnt, &ref);
 2110|   132k|    return 1;
 2111|   132k|}
evp_cipher_free_int:
 2114|  82.1k|{
 2115|  82.1k|    OPENSSL_free(cipher->type_name);
  ------------------
  |  |  131|  82.1k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2116|  82.1k|    ossl_provider_free(cipher->prov);
 2117|  82.1k|    CRYPTO_FREE_REF(&cipher->refcnt);
 2118|  82.1k|    OPENSSL_free(cipher);
  ------------------
  |  |  131|  82.1k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2119|  82.1k|}
EVP_CIPHER_free:
 2122|   223k|{
 2123|   223k|    int i;
 2124|       |
 2125|   223k|    if (cipher == NULL || cipher->origin != EVP_ORIG_DYNAMIC)
  ------------------
  |  |  254|   214k|#define EVP_ORIG_DYNAMIC 0
  ------------------
  |  Branch (2125:9): [True: 8.23k, False: 214k]
  |  Branch (2125:27): [True: 0, False: 214k]
  ------------------
 2126|  8.23k|        return;
 2127|       |
 2128|   214k|    CRYPTO_DOWN_REF(&cipher->refcnt, &i);
 2129|   214k|    if (i > 0)
  ------------------
  |  Branch (2129:9): [True: 132k, False: 82.1k]
  ------------------
 2130|   132k|        return;
 2131|  82.1k|    evp_cipher_free_int(cipher);
 2132|  82.1k|}
evp_enc.c:evp_cipher_init_internal:
   98|   125k|{
   99|   125k|    int n;
  100|   125k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  101|   125k|    ENGINE *tmpimpl = NULL;
  102|   125k|#endif
  103|       |
  104|       |    /*
  105|       |     * enc == 1 means we are encrypting.
  106|       |     * enc == 0 means we are decrypting.
  107|       |     * enc == -1 means, use the previously initialised value for encrypt/decrypt
  108|       |     */
  109|   125k|    if (enc == -1) {
  ------------------
  |  Branch (109:9): [True: 120k, False: 4.94k]
  ------------------
  110|   120k|        enc = ctx->encrypt;
  111|   120k|    } else {
  112|  4.94k|        if (enc)
  ------------------
  |  Branch (112:13): [True: 4.94k, False: 0]
  ------------------
  113|  4.94k|            enc = 1;
  114|  4.94k|        ctx->encrypt = enc;
  115|  4.94k|    }
  116|       |
  117|   125k|    if (cipher == NULL && ctx->cipher == NULL) {
  ------------------
  |  Branch (117:9): [True: 120k, False: 4.94k]
  |  Branch (117:27): [True: 0, False: 120k]
  ------------------
  118|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_NO_CIPHER_SET);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  119|      0|        return 0;
  120|      0|    }
  121|       |
  122|       |    /* Code below to be removed when legacy support is dropped. */
  123|   125k|    if (is_pipeline)
  ------------------
  |  Branch (123:9): [True: 0, False: 125k]
  ------------------
  124|      0|        goto nonlegacy;
  125|       |
  126|   125k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  127|       |    /*
  128|       |     * Whether it's nice or not, "Inits" can be used on "Final"'d contexts so
  129|       |     * this context may already have an ENGINE! Try to avoid releasing the
  130|       |     * previous handle, re-querying for an ENGINE, and having a
  131|       |     * reinitialisation, when it may all be unnecessary.
  132|       |     */
  133|   125k|    if (ctx->engine && ctx->cipher
  ------------------
  |  Branch (133:9): [True: 0, False: 125k]
  |  Branch (133:24): [True: 0, False: 0]
  ------------------
  134|      0|        && (cipher == NULL || cipher->nid == ctx->cipher->nid))
  ------------------
  |  Branch (134:13): [True: 0, False: 0]
  |  Branch (134:31): [True: 0, False: 0]
  ------------------
  135|      0|        goto skip_to_init;
  136|       |
  137|   125k|    if (cipher != NULL && impl == NULL) {
  ------------------
  |  Branch (137:9): [True: 4.94k, False: 120k]
  |  Branch (137:27): [True: 4.94k, False: 0]
  ------------------
  138|       |        /* Ask if an ENGINE is reserved for this job */
  139|  4.94k|        tmpimpl = ENGINE_get_cipher_engine(cipher->nid);
  140|  4.94k|    }
  141|   125k|#endif
  142|       |
  143|       |    /*
  144|       |     * If there are engines involved then we should use legacy handling for now.
  145|       |     */
  146|   125k|    if (ctx->engine != NULL
  ------------------
  |  Branch (146:9): [True: 0, False: 125k]
  ------------------
  147|   125k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  148|   125k|        || tmpimpl != NULL
  ------------------
  |  Branch (148:12): [True: 0, False: 125k]
  ------------------
  149|   125k|#endif
  150|   125k|        || impl != NULL
  ------------------
  |  Branch (150:12): [True: 0, False: 125k]
  ------------------
  151|   125k|        || (cipher != NULL && cipher->origin == EVP_ORIG_METH)
  ------------------
  |  |  256|  4.94k|#define EVP_ORIG_METH 2
  ------------------
  |  Branch (151:13): [True: 4.94k, False: 120k]
  |  Branch (151:31): [True: 0, False: 4.94k]
  ------------------
  152|   125k|        || (cipher == NULL && ctx->cipher != NULL
  ------------------
  |  Branch (152:13): [True: 120k, False: 4.94k]
  |  Branch (152:31): [True: 120k, False: 0]
  ------------------
  153|   120k|            && ctx->cipher->origin == EVP_ORIG_METH)) {
  ------------------
  |  |  256|   120k|#define EVP_ORIG_METH 2
  ------------------
  |  Branch (153:16): [True: 0, False: 120k]
  ------------------
  154|      0|        if (ctx->cipher == ctx->fetched_cipher)
  ------------------
  |  Branch (154:13): [True: 0, False: 0]
  ------------------
  155|      0|            ctx->cipher = NULL;
  156|      0|        EVP_CIPHER_free(ctx->fetched_cipher);
  157|      0|        ctx->fetched_cipher = NULL;
  158|      0|        goto legacy;
  159|      0|    }
  160|       |    /*
  161|       |     * Ensure a context left lying around from last time is cleared
  162|       |     * (legacy code)
  163|       |     */
  164|   125k|    if (cipher != NULL && ctx->cipher != NULL) {
  ------------------
  |  Branch (164:9): [True: 4.94k, False: 120k]
  |  Branch (164:27): [True: 0, False: 4.94k]
  ------------------
  165|      0|        if (ctx->cipher->cleanup != NULL && !ctx->cipher->cleanup(ctx))
  ------------------
  |  Branch (165:13): [True: 0, False: 0]
  |  Branch (165:45): [True: 0, False: 0]
  ------------------
  166|      0|            return 0;
  167|      0|        OPENSSL_clear_free(ctx->cipher_data, ctx->cipher->ctx_size);
  ------------------
  |  |  129|      0|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  168|      0|        ctx->cipher_data = NULL;
  169|      0|    }
  170|       |
  171|       |    /* Start of non-legacy code below */
  172|   125k|nonlegacy:
  173|       |    /* Ensure a context left lying around from last time is cleared */
  174|   125k|    if (cipher != NULL && ctx->cipher != NULL) {
  ------------------
  |  Branch (174:9): [True: 4.94k, False: 120k]
  |  Branch (174:27): [True: 0, False: 4.94k]
  ------------------
  175|      0|        unsigned long flags = ctx->flags;
  176|       |
  177|      0|        EVP_CIPHER_CTX_reset(ctx);
  178|       |        /* Restore encrypt and flags */
  179|      0|        ctx->encrypt = enc;
  180|      0|        ctx->flags = flags;
  181|      0|    }
  182|       |
  183|   125k|    if (cipher == NULL)
  ------------------
  |  Branch (183:9): [True: 120k, False: 4.94k]
  ------------------
  184|   120k|        cipher = ctx->cipher;
  185|       |
  186|   125k|    if (cipher->prov == NULL) {
  ------------------
  |  Branch (186:9): [True: 0, False: 125k]
  ------------------
  187|       |#ifdef FIPS_MODULE
  188|       |        /* We only do explicit fetches inside the FIPS module */
  189|       |        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  190|       |        return 0;
  191|       |#else
  192|      0|        EVP_CIPHER *provciph = EVP_CIPHER_fetch(NULL,
  193|      0|            cipher->nid == NID_undef ? "NULL"
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (193:13): [True: 0, False: 0]
  ------------------
  194|      0|                                     : OBJ_nid2sn(cipher->nid),
  195|      0|            "");
  196|       |
  197|      0|        if (provciph == NULL)
  ------------------
  |  Branch (197:13): [True: 0, False: 0]
  ------------------
  198|      0|            return 0;
  199|      0|        cipher = provciph;
  200|      0|        EVP_CIPHER_free(ctx->fetched_cipher);
  201|      0|        ctx->fetched_cipher = provciph;
  202|      0|#endif
  203|      0|    }
  204|       |
  205|   125k|    if (!ossl_assert(cipher->prov != NULL)) {
  ------------------
  |  |   52|   125k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|   125k|    __FILE__, __LINE__)
  ------------------
  |  Branch (205:9): [True: 0, False: 125k]
  ------------------
  206|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  207|      0|        return 0;
  208|      0|    }
  209|       |
  210|   125k|    if (cipher != ctx->fetched_cipher) {
  ------------------
  |  Branch (210:9): [True: 4.94k, False: 120k]
  ------------------
  211|  4.94k|        if (!EVP_CIPHER_up_ref((EVP_CIPHER *)cipher)) {
  ------------------
  |  Branch (211:13): [True: 0, False: 4.94k]
  ------------------
  212|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  213|      0|            return 0;
  214|      0|        }
  215|  4.94k|        EVP_CIPHER_free(ctx->fetched_cipher);
  216|       |        /* Coverity false positive, the reference counting is confusing it */
  217|       |        /* coverity[use_after_free] */
  218|  4.94k|        ctx->fetched_cipher = (EVP_CIPHER *)cipher;
  219|  4.94k|    }
  220|   125k|    ctx->cipher = cipher;
  221|       |
  222|   125k|    if (is_pipeline && !EVP_CIPHER_can_pipeline(cipher, enc)) {
  ------------------
  |  Branch (222:9): [True: 0, False: 125k]
  |  Branch (222:24): [True: 0, False: 0]
  ------------------
  223|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_PIPELINE_NOT_SUPPORTED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  224|      0|        return 0;
  225|      0|    }
  226|       |
  227|   125k|    if (ctx->algctx == NULL) {
  ------------------
  |  Branch (227:9): [True: 4.94k, False: 120k]
  ------------------
  228|  4.94k|        ctx->algctx = ctx->cipher->newctx(ossl_provider_ctx(cipher->prov));
  229|  4.94k|        if (ctx->algctx == NULL) {
  ------------------
  |  Branch (229:13): [True: 0, False: 4.94k]
  ------------------
  230|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  231|      0|            return 0;
  232|      0|        }
  233|  4.94k|    }
  234|       |
  235|   125k|    if ((ctx->flags & EVP_CIPH_NO_PADDING) != 0) {
  ------------------
  |  |  335|   125k|#define EVP_CIPH_NO_PADDING 0x100
  ------------------
  |  Branch (235:9): [True: 0, False: 125k]
  ------------------
  236|       |        /*
  237|       |         * If this ctx was already set up for no padding then we need to tell
  238|       |         * the new cipher about it.
  239|       |         */
  240|      0|        if (!EVP_CIPHER_CTX_set_padding(ctx, 0))
  ------------------
  |  Branch (240:13): [True: 0, False: 0]
  ------------------
  241|      0|            return 0;
  242|      0|    }
  243|       |
  244|   125k|#ifndef FIPS_MODULE
  245|       |    /*
  246|       |     * Fix for CVE-2023-5363
  247|       |     * Passing in a size as part of the init call takes effect late
  248|       |     * so, force such to occur before the initialisation.
  249|       |     *
  250|       |     * The FIPS provider's internal library context is used in a manner
  251|       |     * such that this is not an issue.
  252|       |     */
  253|   125k|    if (params != NULL) {
  ------------------
  |  Branch (253:9): [True: 0, False: 125k]
  ------------------
  254|      0|        OSSL_PARAM param_lens[3] = { OSSL_PARAM_END, OSSL_PARAM_END,
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM param_lens[3] = { OSSL_PARAM_END, OSSL_PARAM_END,
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
  255|      0|            OSSL_PARAM_END };
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
  256|      0|        OSSL_PARAM *q = param_lens;
  257|      0|        const OSSL_PARAM *p;
  258|       |
  259|      0|        p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_KEYLEN);
  ------------------
  |  |  200|      0|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  260|      0|        if (p != NULL)
  ------------------
  |  Branch (260:13): [True: 0, False: 0]
  ------------------
  261|      0|            memcpy(q++, p, sizeof(*q));
  262|       |
  263|       |        /*
  264|       |         * Note that OSSL_CIPHER_PARAM_AEAD_IVLEN is a synonym for
  265|       |         * OSSL_CIPHER_PARAM_IVLEN so both are covered here.
  266|       |         */
  267|      0|        p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_IVLEN);
  ------------------
  |  |  199|      0|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  268|      0|        if (p != NULL)
  ------------------
  |  Branch (268:13): [True: 0, False: 0]
  ------------------
  269|      0|            memcpy(q++, p, sizeof(*q));
  270|       |
  271|      0|        if (q != param_lens) {
  ------------------
  |  Branch (271:13): [True: 0, False: 0]
  ------------------
  272|      0|            if (!EVP_CIPHER_CTX_set_params(ctx, param_lens)) {
  ------------------
  |  Branch (272:17): [True: 0, False: 0]
  ------------------
  273|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_LENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  274|      0|                return 0;
  275|      0|            }
  276|      0|        }
  277|      0|    }
  278|   125k|#endif
  279|       |
  280|   125k|    if (is_pipeline)
  ------------------
  |  Branch (280:9): [True: 0, False: 125k]
  ------------------
  281|      0|        return 1;
  282|       |
  283|   125k|    if (enc) {
  ------------------
  |  Branch (283:9): [True: 125k, False: 0]
  ------------------
  284|   125k|        if (ctx->cipher->einit == NULL) {
  ------------------
  |  Branch (284:13): [True: 0, False: 125k]
  ------------------
  285|       |            /*
  286|       |             * We still should be able to set the IV using the new API
  287|       |             * if the key is not specified and old API is not available
  288|       |             */
  289|      0|            if (key == NULL && ctx->cipher->einit_skey != NULL) {
  ------------------
  |  Branch (289:17): [True: 0, False: 0]
  |  Branch (289:32): [True: 0, False: 0]
  ------------------
  290|      0|                return ctx->cipher->einit_skey(ctx->algctx, NULL,
  291|      0|                    iv,
  292|      0|                    iv == NULL ? 0
  ------------------
  |  Branch (292:21): [True: 0, False: 0]
  ------------------
  293|      0|                               : EVP_CIPHER_CTX_get_iv_length(ctx),
  294|      0|                    params);
  295|      0|            }
  296|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  297|      0|            return 0;
  298|      0|        }
  299|       |
  300|   125k|        return ctx->cipher->einit(ctx->algctx,
  301|   125k|            key,
  302|   125k|            key == NULL ? 0
  ------------------
  |  Branch (302:13): [True: 37.8k, False: 87.2k]
  ------------------
  303|   125k|                        : EVP_CIPHER_CTX_get_key_length(ctx),
  304|   125k|            iv,
  305|   125k|            iv == NULL ? 0
  ------------------
  |  Branch (305:13): [True: 90.5k, False: 34.5k]
  ------------------
  306|   125k|                       : EVP_CIPHER_CTX_get_iv_length(ctx),
  307|   125k|            params);
  308|   125k|    }
  309|       |
  310|      0|    if (ctx->cipher->dinit == NULL) {
  ------------------
  |  Branch (310:9): [True: 0, False: 0]
  ------------------
  311|       |        /*
  312|       |         * We still should be able to set the IV using the new API
  313|       |         * if the key is not specified and old API is not available
  314|       |         */
  315|      0|        if (key == NULL && ctx->cipher->dinit_skey != NULL) {
  ------------------
  |  Branch (315:13): [True: 0, False: 0]
  |  Branch (315:28): [True: 0, False: 0]
  ------------------
  316|      0|            return ctx->cipher->dinit_skey(ctx->algctx, NULL,
  317|      0|                iv,
  318|      0|                iv == NULL ? 0
  ------------------
  |  Branch (318:17): [True: 0, False: 0]
  ------------------
  319|      0|                           : EVP_CIPHER_CTX_get_iv_length(ctx),
  320|      0|                params);
  321|      0|        }
  322|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  323|      0|        return 0;
  324|      0|    }
  325|       |
  326|      0|    return ctx->cipher->dinit(ctx->algctx,
  327|      0|        key,
  328|      0|        key == NULL ? 0
  ------------------
  |  Branch (328:9): [True: 0, False: 0]
  ------------------
  329|      0|                    : EVP_CIPHER_CTX_get_key_length(ctx),
  330|      0|        iv,
  331|      0|        iv == NULL ? 0
  ------------------
  |  Branch (331:9): [True: 0, False: 0]
  ------------------
  332|      0|                   : EVP_CIPHER_CTX_get_iv_length(ctx),
  333|      0|        params);
  334|       |
  335|       |    /* Code below to be removed when legacy support is dropped. */
  336|      0|legacy:
  337|       |
  338|      0|    if (cipher != NULL) {
  ------------------
  |  Branch (338:9): [True: 0, False: 0]
  ------------------
  339|       |        /*
  340|       |         * Ensure a context left lying around from last time is cleared (we
  341|       |         * previously attempted to avoid this if the same ENGINE and
  342|       |         * EVP_CIPHER could be used).
  343|       |         */
  344|      0|        if (ctx->cipher) {
  ------------------
  |  Branch (344:13): [True: 0, False: 0]
  ------------------
  345|      0|            unsigned long flags = ctx->flags;
  346|      0|            EVP_CIPHER_CTX_reset(ctx);
  347|       |            /* Restore encrypt and flags */
  348|      0|            ctx->encrypt = enc;
  349|      0|            ctx->flags = flags;
  350|      0|        }
  351|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  352|      0|        if (impl != NULL) {
  ------------------
  |  Branch (352:13): [True: 0, False: 0]
  ------------------
  353|      0|            if (!ENGINE_init(impl)) {
  ------------------
  |  Branch (353:17): [True: 0, False: 0]
  ------------------
  354|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  355|      0|                return 0;
  356|      0|            }
  357|      0|        } else {
  358|      0|            impl = tmpimpl;
  359|      0|        }
  360|      0|        if (impl != NULL) {
  ------------------
  |  Branch (360:13): [True: 0, False: 0]
  ------------------
  361|       |            /* There's an ENGINE for this job ... (apparently) */
  362|      0|            const EVP_CIPHER *c = ENGINE_get_cipher(impl, cipher->nid);
  363|       |
  364|      0|            if (c == NULL) {
  ------------------
  |  Branch (364:17): [True: 0, False: 0]
  ------------------
  365|       |                /*
  366|       |                 * One positive side-effect of US's export control history,
  367|       |                 * is that we should at least be able to avoid using US
  368|       |                 * misspellings of "initialisation"?
  369|       |                 */
  370|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  371|      0|                return 0;
  372|      0|            }
  373|       |            /* We'll use the ENGINE's private cipher definition */
  374|      0|            cipher = c;
  375|       |            /*
  376|       |             * Store the ENGINE functional reference so we know 'cipher' came
  377|       |             * from an ENGINE and we need to release it when done.
  378|       |             */
  379|      0|            ctx->engine = impl;
  380|      0|        } else {
  381|      0|            ctx->engine = NULL;
  382|      0|        }
  383|      0|#endif
  384|       |
  385|      0|        ctx->cipher = cipher;
  386|      0|        if (ctx->cipher->ctx_size) {
  ------------------
  |  Branch (386:13): [True: 0, False: 0]
  ------------------
  387|      0|            ctx->cipher_data = OPENSSL_zalloc(ctx->cipher->ctx_size);
  ------------------
  |  |  108|      0|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  388|      0|            if (ctx->cipher_data == NULL) {
  ------------------
  |  Branch (388:17): [True: 0, False: 0]
  ------------------
  389|      0|                ctx->cipher = NULL;
  390|      0|                return 0;
  391|      0|            }
  392|      0|        } else {
  393|      0|            ctx->cipher_data = NULL;
  394|      0|        }
  395|      0|        ctx->key_len = cipher->key_len;
  396|       |        /* Preserve wrap enable flag, zero everything else */
  397|      0|        ctx->flags &= EVP_CIPHER_CTX_FLAG_WRAP_ALLOW;
  ------------------
  |  |  375|      0|#define EVP_CIPHER_CTX_FLAG_WRAP_ALLOW 0x1
  ------------------
  398|      0|        if (ctx->cipher->flags & EVP_CIPH_CTRL_INIT) {
  ------------------
  |  |  331|      0|#define EVP_CIPH_CTRL_INIT 0x40
  ------------------
  |  Branch (398:13): [True: 0, False: 0]
  ------------------
  399|      0|            if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL) <= 0) {
  ------------------
  |  |  379|      0|#define EVP_CTRL_INIT 0x0
  ------------------
  |  Branch (399:17): [True: 0, False: 0]
  ------------------
  400|      0|                ctx->cipher = NULL;
  401|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  402|      0|                return 0;
  403|      0|            }
  404|      0|        }
  405|      0|    }
  406|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  407|      0|skip_to_init:
  408|      0|#endif
  409|      0|    if (ctx->cipher == NULL)
  ------------------
  |  Branch (409:9): [True: 0, False: 0]
  ------------------
  410|      0|        return 0;
  411|       |
  412|       |    /* we assume block size is a power of 2 in *cryptUpdate */
  413|      0|    OPENSSL_assert(ctx->cipher->block_size == 1
  ------------------
  |  |  476|      0|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (476:13): [True: 0, False: 0]
  |  |  |  Branch (476:13): [True: 0, False: 0]
  |  |  |  Branch (476:13): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  414|      0|        || ctx->cipher->block_size == 8
  415|      0|        || ctx->cipher->block_size == 16);
  416|       |
  417|      0|    if (!(ctx->flags & EVP_CIPHER_CTX_FLAG_WRAP_ALLOW)
  ------------------
  |  |  375|      0|#define EVP_CIPHER_CTX_FLAG_WRAP_ALLOW 0x1
  ------------------
  |  Branch (417:9): [True: 0, False: 0]
  ------------------
  418|      0|        && EVP_CIPHER_CTX_get_mode(ctx) == EVP_CIPH_WRAP_MODE) {
  ------------------
  |  |  674|      0|#define EVP_CIPHER_CTX_get_mode(c) EVP_CIPHER_get_mode(EVP_CIPHER_CTX_get0_cipher(c))
  ------------------
                      && EVP_CIPHER_CTX_get_mode(ctx) == EVP_CIPH_WRAP_MODE) {
  ------------------
  |  |  319|      0|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  |  Branch (418:12): [True: 0, False: 0]
  ------------------
  419|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_WRAP_MODE_NOT_ALLOWED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  420|      0|        return 0;
  421|      0|    }
  422|       |
  423|      0|    if ((EVP_CIPHER_get_flags(EVP_CIPHER_CTX_get0_cipher(ctx))
  ------------------
  |  Branch (423:9): [True: 0, False: 0]
  ------------------
  424|      0|            & EVP_CIPH_CUSTOM_IV)
  ------------------
  |  |  327|      0|#define EVP_CIPH_CUSTOM_IV 0x10
  ------------------
  425|      0|        == 0) {
  426|      0|        switch (EVP_CIPHER_CTX_get_mode(ctx)) {
  ------------------
  |  |  674|      0|#define EVP_CIPHER_CTX_get_mode(c) EVP_CIPHER_get_mode(EVP_CIPHER_CTX_get0_cipher(c))
  ------------------
  427|       |
  428|      0|        case EVP_CIPH_STREAM_CIPHER:
  ------------------
  |  |  310|      0|#define EVP_CIPH_STREAM_CIPHER 0x0
  ------------------
  |  Branch (428:9): [True: 0, False: 0]
  ------------------
  429|      0|        case EVP_CIPH_ECB_MODE:
  ------------------
  |  |  311|      0|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  |  Branch (429:9): [True: 0, False: 0]
  ------------------
  430|      0|            break;
  431|       |
  432|      0|        case EVP_CIPH_CFB_MODE:
  ------------------
  |  |  313|      0|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  |  Branch (432:9): [True: 0, False: 0]
  ------------------
  433|      0|        case EVP_CIPH_OFB_MODE:
  ------------------
  |  |  314|      0|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  |  Branch (433:9): [True: 0, False: 0]
  ------------------
  434|       |
  435|      0|            ctx->num = 0;
  436|       |            /* fall-through */
  437|       |
  438|      0|        case EVP_CIPH_CBC_MODE:
  ------------------
  |  |  312|      0|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  |  Branch (438:9): [True: 0, False: 0]
  ------------------
  439|      0|            n = EVP_CIPHER_CTX_get_iv_length(ctx);
  440|      0|            if (n < 0 || n > (int)sizeof(ctx->iv)) {
  ------------------
  |  Branch (440:17): [True: 0, False: 0]
  |  Branch (440:26): [True: 0, False: 0]
  ------------------
  441|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  442|      0|                return 0;
  443|      0|            }
  444|      0|            if (iv != NULL)
  ------------------
  |  Branch (444:17): [True: 0, False: 0]
  ------------------
  445|      0|                memcpy(ctx->oiv, iv, n);
  446|      0|            memcpy(ctx->iv, ctx->oiv, n);
  447|      0|            break;
  448|       |
  449|      0|        case EVP_CIPH_CTR_MODE:
  ------------------
  |  |  315|      0|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  |  Branch (449:9): [True: 0, False: 0]
  ------------------
  450|      0|            ctx->num = 0;
  451|       |            /* Don't reuse IV for CTR mode */
  452|      0|            if (iv != NULL) {
  ------------------
  |  Branch (452:17): [True: 0, False: 0]
  ------------------
  453|      0|                n = EVP_CIPHER_CTX_get_iv_length(ctx);
  454|      0|                if (n <= 0 || n > (int)sizeof(ctx->iv)) {
  ------------------
  |  Branch (454:21): [True: 0, False: 0]
  |  Branch (454:31): [True: 0, False: 0]
  ------------------
  455|      0|                    ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  456|      0|                    return 0;
  457|      0|                }
  458|      0|                memcpy(ctx->iv, iv, n);
  459|      0|            }
  460|      0|            break;
  461|       |
  462|      0|        default:
  ------------------
  |  Branch (462:9): [True: 0, False: 0]
  ------------------
  463|      0|            return 0;
  464|      0|        }
  465|      0|    }
  466|       |
  467|      0|    if (key != NULL || (ctx->cipher->flags & EVP_CIPH_ALWAYS_CALL_INIT)) {
  ------------------
  |  |  329|      0|#define EVP_CIPH_ALWAYS_CALL_INIT 0x20
  ------------------
  |  Branch (467:9): [True: 0, False: 0]
  |  Branch (467:24): [True: 0, False: 0]
  ------------------
  468|      0|        if (!ctx->cipher->init(ctx, key, iv, enc))
  ------------------
  |  Branch (468:13): [True: 0, False: 0]
  ------------------
  469|      0|            return 0;
  470|      0|    }
  471|      0|    ctx->buf_len = 0;
  472|      0|    ctx->final_used = 0;
  473|      0|    ctx->block_mask = ctx->cipher->block_size - 1;
  474|      0|    return 1;
  475|      0|}
evp_enc.c:evp_cipher_from_algorithm:
 1892|  82.1k|{
 1893|  82.1k|    const OSSL_DISPATCH *fns = algodef->implementation;
 1894|  82.1k|    EVP_CIPHER *cipher = NULL;
 1895|  82.1k|    int fnciphcnt = 0, encinit = 0, decinit = 0, fnpipecnt = 0, fnctxcnt = 0;
 1896|       |
 1897|  82.1k|    if ((cipher = evp_cipher_new()) == NULL) {
  ------------------
  |  Branch (1897:9): [True: 0, False: 82.1k]
  ------------------
 1898|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1899|      0|        return NULL;
 1900|      0|    }
 1901|       |
 1902|  82.1k|#ifndef FIPS_MODULE
 1903|  82.1k|    cipher->nid = NID_undef;
  ------------------
  |  |   18|  82.1k|#define NID_undef                       0
  ------------------
 1904|  82.1k|    if (!evp_names_do_all(prov, name_id, set_legacy_nid, &cipher->nid)
  ------------------
  |  Branch (1904:9): [True: 0, False: 82.1k]
  ------------------
 1905|  82.1k|        || cipher->nid == -1) {
  ------------------
  |  Branch (1905:12): [True: 0, False: 82.1k]
  ------------------
 1906|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1907|      0|        goto err;
 1908|      0|    }
 1909|  82.1k|#endif
 1910|       |
 1911|  82.1k|    cipher->name_id = name_id;
 1912|  82.1k|    if ((cipher->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
  ------------------
  |  Branch (1912:9): [True: 0, False: 82.1k]
  ------------------
 1913|      0|        goto err;
 1914|       |
 1915|  82.1k|    cipher->description = algodef->algorithm_description;
 1916|       |
 1917|  1.31M|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (1917:12): [True: 1.22M, False: 82.1k]
  ------------------
 1918|  1.22M|        switch (fns->function_id) {
  ------------------
  |  Branch (1918:17): [True: 1.22M, False: 0]
  ------------------
 1919|  82.1k|        case OSSL_FUNC_CIPHER_NEWCTX:
  ------------------
  |  |  351|  82.1k|#define OSSL_FUNC_CIPHER_NEWCTX 1
  ------------------
  |  Branch (1919:9): [True: 82.1k, False: 1.14M]
  ------------------
 1920|  82.1k|            if (cipher->newctx != NULL)
  ------------------
  |  Branch (1920:17): [True: 0, False: 82.1k]
  ------------------
 1921|      0|                break;
 1922|  82.1k|            cipher->newctx = OSSL_FUNC_cipher_newctx(fns);
 1923|  82.1k|            fnctxcnt++;
 1924|  82.1k|            break;
 1925|  82.1k|        case OSSL_FUNC_CIPHER_ENCRYPT_INIT:
  ------------------
  |  |  352|  82.1k|#define OSSL_FUNC_CIPHER_ENCRYPT_INIT 2
  ------------------
  |  Branch (1925:9): [True: 82.1k, False: 1.14M]
  ------------------
 1926|  82.1k|            if (cipher->einit != NULL)
  ------------------
  |  Branch (1926:17): [True: 0, False: 82.1k]
  ------------------
 1927|      0|                break;
 1928|  82.1k|            cipher->einit = OSSL_FUNC_cipher_encrypt_init(fns);
 1929|  82.1k|            encinit = 1;
 1930|  82.1k|            break;
 1931|  82.1k|        case OSSL_FUNC_CIPHER_DECRYPT_INIT:
  ------------------
  |  |  353|  82.1k|#define OSSL_FUNC_CIPHER_DECRYPT_INIT 3
  ------------------
  |  Branch (1931:9): [True: 82.1k, False: 1.14M]
  ------------------
 1932|  82.1k|            if (cipher->dinit != NULL)
  ------------------
  |  Branch (1932:17): [True: 0, False: 82.1k]
  ------------------
 1933|      0|                break;
 1934|  82.1k|            cipher->dinit = OSSL_FUNC_cipher_decrypt_init(fns);
 1935|  82.1k|            decinit = 1;
 1936|  82.1k|            break;
 1937|  42.9k|        case OSSL_FUNC_CIPHER_ENCRYPT_SKEY_INIT:
  ------------------
  |  |  369|  42.9k|#define OSSL_FUNC_CIPHER_ENCRYPT_SKEY_INIT 19
  ------------------
  |  Branch (1937:9): [True: 42.9k, False: 1.18M]
  ------------------
 1938|  42.9k|            if (cipher->einit_skey != NULL)
  ------------------
  |  Branch (1938:17): [True: 0, False: 42.9k]
  ------------------
 1939|      0|                break;
 1940|  42.9k|            cipher->einit_skey = OSSL_FUNC_cipher_encrypt_skey_init(fns);
 1941|  42.9k|            encinit = 1;
 1942|  42.9k|            break;
 1943|  42.9k|        case OSSL_FUNC_CIPHER_DECRYPT_SKEY_INIT:
  ------------------
  |  |  370|  42.9k|#define OSSL_FUNC_CIPHER_DECRYPT_SKEY_INIT 20
  ------------------
  |  Branch (1943:9): [True: 42.9k, False: 1.18M]
  ------------------
 1944|  42.9k|            if (cipher->dinit_skey != NULL)
  ------------------
  |  Branch (1944:17): [True: 0, False: 42.9k]
  ------------------
 1945|      0|                break;
 1946|  42.9k|            cipher->dinit_skey = OSSL_FUNC_cipher_decrypt_skey_init(fns);
 1947|  42.9k|            decinit = 1;
 1948|  42.9k|            break;
 1949|  82.1k|        case OSSL_FUNC_CIPHER_UPDATE:
  ------------------
  |  |  354|  82.1k|#define OSSL_FUNC_CIPHER_UPDATE 4
  ------------------
  |  Branch (1949:9): [True: 82.1k, False: 1.14M]
  ------------------
 1950|  82.1k|            if (cipher->cupdate != NULL)
  ------------------
  |  Branch (1950:17): [True: 0, False: 82.1k]
  ------------------
 1951|      0|                break;
 1952|  82.1k|            cipher->cupdate = OSSL_FUNC_cipher_update(fns);
 1953|  82.1k|            fnciphcnt++;
 1954|  82.1k|            break;
 1955|  82.1k|        case OSSL_FUNC_CIPHER_FINAL:
  ------------------
  |  |  355|  82.1k|#define OSSL_FUNC_CIPHER_FINAL 5
  ------------------
  |  Branch (1955:9): [True: 82.1k, False: 1.14M]
  ------------------
 1956|  82.1k|            if (cipher->cfinal != NULL)
  ------------------
  |  Branch (1956:17): [True: 0, False: 82.1k]
  ------------------
 1957|      0|                break;
 1958|  82.1k|            cipher->cfinal = OSSL_FUNC_cipher_final(fns);
 1959|  82.1k|            fnciphcnt++;
 1960|  82.1k|            break;
 1961|  74.5k|        case OSSL_FUNC_CIPHER_CIPHER:
  ------------------
  |  |  356|  74.5k|#define OSSL_FUNC_CIPHER_CIPHER 6
  ------------------
  |  Branch (1961:9): [True: 74.5k, False: 1.15M]
  ------------------
 1962|  74.5k|            if (cipher->ccipher != NULL)
  ------------------
  |  Branch (1962:17): [True: 0, False: 74.5k]
  ------------------
 1963|      0|                break;
 1964|  74.5k|            cipher->ccipher = OSSL_FUNC_cipher_cipher(fns);
 1965|  74.5k|            break;
 1966|      0|        case OSSL_FUNC_CIPHER_PIPELINE_ENCRYPT_INIT:
  ------------------
  |  |  365|      0|#define OSSL_FUNC_CIPHER_PIPELINE_ENCRYPT_INIT 15
  ------------------
  |  Branch (1966:9): [True: 0, False: 1.22M]
  ------------------
 1967|      0|            if (cipher->p_einit != NULL)
  ------------------
  |  Branch (1967:17): [True: 0, False: 0]
  ------------------
 1968|      0|                break;
 1969|      0|            cipher->p_einit = OSSL_FUNC_cipher_pipeline_encrypt_init(fns);
 1970|      0|            fnpipecnt++;
 1971|      0|            break;
 1972|      0|        case OSSL_FUNC_CIPHER_PIPELINE_DECRYPT_INIT:
  ------------------
  |  |  366|      0|#define OSSL_FUNC_CIPHER_PIPELINE_DECRYPT_INIT 16
  ------------------
  |  Branch (1972:9): [True: 0, False: 1.22M]
  ------------------
 1973|      0|            if (cipher->p_dinit != NULL)
  ------------------
  |  Branch (1973:17): [True: 0, False: 0]
  ------------------
 1974|      0|                break;
 1975|      0|            cipher->p_dinit = OSSL_FUNC_cipher_pipeline_decrypt_init(fns);
 1976|      0|            fnpipecnt++;
 1977|      0|            break;
 1978|      0|        case OSSL_FUNC_CIPHER_PIPELINE_UPDATE:
  ------------------
  |  |  367|      0|#define OSSL_FUNC_CIPHER_PIPELINE_UPDATE 17
  ------------------
  |  Branch (1978:9): [True: 0, False: 1.22M]
  ------------------
 1979|      0|            if (cipher->p_cupdate != NULL)
  ------------------
  |  Branch (1979:17): [True: 0, False: 0]
  ------------------
 1980|      0|                break;
 1981|      0|            cipher->p_cupdate = OSSL_FUNC_cipher_pipeline_update(fns);
 1982|      0|            fnpipecnt++;
 1983|      0|            break;
 1984|      0|        case OSSL_FUNC_CIPHER_PIPELINE_FINAL:
  ------------------
  |  |  368|      0|#define OSSL_FUNC_CIPHER_PIPELINE_FINAL 18
  ------------------
  |  Branch (1984:9): [True: 0, False: 1.22M]
  ------------------
 1985|      0|            if (cipher->p_cfinal != NULL)
  ------------------
  |  Branch (1985:17): [True: 0, False: 0]
  ------------------
 1986|      0|                break;
 1987|      0|            cipher->p_cfinal = OSSL_FUNC_cipher_pipeline_final(fns);
 1988|      0|            fnpipecnt++;
 1989|      0|            break;
 1990|  82.1k|        case OSSL_FUNC_CIPHER_FREECTX:
  ------------------
  |  |  357|  82.1k|#define OSSL_FUNC_CIPHER_FREECTX 7
  ------------------
  |  Branch (1990:9): [True: 82.1k, False: 1.14M]
  ------------------
 1991|  82.1k|            if (cipher->freectx != NULL)
  ------------------
  |  Branch (1991:17): [True: 0, False: 82.1k]
  ------------------
 1992|      0|                break;
 1993|  82.1k|            cipher->freectx = OSSL_FUNC_cipher_freectx(fns);
 1994|  82.1k|            fnctxcnt++;
 1995|  82.1k|            break;
 1996|  81.5k|        case OSSL_FUNC_CIPHER_DUPCTX:
  ------------------
  |  |  358|  81.5k|#define OSSL_FUNC_CIPHER_DUPCTX 8
  ------------------
  |  Branch (1996:9): [True: 81.5k, False: 1.14M]
  ------------------
 1997|  81.5k|            if (cipher->dupctx != NULL)
  ------------------
  |  Branch (1997:17): [True: 0, False: 81.5k]
  ------------------
 1998|      0|                break;
 1999|  81.5k|            cipher->dupctx = OSSL_FUNC_cipher_dupctx(fns);
 2000|  81.5k|            break;
 2001|  82.1k|        case OSSL_FUNC_CIPHER_GET_PARAMS:
  ------------------
  |  |  359|  82.1k|#define OSSL_FUNC_CIPHER_GET_PARAMS 9
  ------------------
  |  Branch (2001:9): [True: 82.1k, False: 1.14M]
  ------------------
 2002|  82.1k|            if (cipher->get_params != NULL)
  ------------------
  |  Branch (2002:17): [True: 0, False: 82.1k]
  ------------------
 2003|      0|                break;
 2004|  82.1k|            cipher->get_params = OSSL_FUNC_cipher_get_params(fns);
 2005|  82.1k|            break;
 2006|  82.1k|        case OSSL_FUNC_CIPHER_GET_CTX_PARAMS:
  ------------------
  |  |  360|  82.1k|#define OSSL_FUNC_CIPHER_GET_CTX_PARAMS 10
  ------------------
  |  Branch (2006:9): [True: 82.1k, False: 1.14M]
  ------------------
 2007|  82.1k|            if (cipher->get_ctx_params != NULL)
  ------------------
  |  Branch (2007:17): [True: 0, False: 82.1k]
  ------------------
 2008|      0|                break;
 2009|  82.1k|            cipher->get_ctx_params = OSSL_FUNC_cipher_get_ctx_params(fns);
 2010|  82.1k|            break;
 2011|  82.1k|        case OSSL_FUNC_CIPHER_SET_CTX_PARAMS:
  ------------------
  |  |  361|  82.1k|#define OSSL_FUNC_CIPHER_SET_CTX_PARAMS 11
  ------------------
  |  Branch (2011:9): [True: 82.1k, False: 1.14M]
  ------------------
 2012|  82.1k|            if (cipher->set_ctx_params != NULL)
  ------------------
  |  Branch (2012:17): [True: 0, False: 82.1k]
  ------------------
 2013|      0|                break;
 2014|  82.1k|            cipher->set_ctx_params = OSSL_FUNC_cipher_set_ctx_params(fns);
 2015|  82.1k|            break;
 2016|  82.1k|        case OSSL_FUNC_CIPHER_GETTABLE_PARAMS:
  ------------------
  |  |  362|  82.1k|#define OSSL_FUNC_CIPHER_GETTABLE_PARAMS 12
  ------------------
  |  Branch (2016:9): [True: 82.1k, False: 1.14M]
  ------------------
 2017|  82.1k|            if (cipher->gettable_params != NULL)
  ------------------
  |  Branch (2017:17): [True: 0, False: 82.1k]
  ------------------
 2018|      0|                break;
 2019|  82.1k|            cipher->gettable_params = OSSL_FUNC_cipher_gettable_params(fns);
 2020|  82.1k|            break;
 2021|  82.1k|        case OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  363|  82.1k|#define OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS 13
  ------------------
  |  Branch (2021:9): [True: 82.1k, False: 1.14M]
  ------------------
 2022|  82.1k|            if (cipher->gettable_ctx_params != NULL)
  ------------------
  |  Branch (2022:17): [True: 0, False: 82.1k]
  ------------------
 2023|      0|                break;
 2024|  82.1k|            cipher->gettable_ctx_params = OSSL_FUNC_cipher_gettable_ctx_params(fns);
 2025|  82.1k|            break;
 2026|  82.1k|        case OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  364|  82.1k|#define OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS 14
  ------------------
  |  Branch (2026:9): [True: 82.1k, False: 1.14M]
  ------------------
 2027|  82.1k|            if (cipher->settable_ctx_params != NULL)
  ------------------
  |  Branch (2027:17): [True: 0, False: 82.1k]
  ------------------
 2028|      0|                break;
 2029|  82.1k|            cipher->settable_ctx_params = OSSL_FUNC_cipher_settable_ctx_params(fns);
 2030|  82.1k|            break;
 2031|  1.22M|        }
 2032|  1.22M|    }
 2033|  82.1k|    fnciphcnt += encinit + decinit;
 2034|  82.1k|    if ((fnciphcnt != 0 && fnciphcnt != 3 && fnciphcnt != 4)
  ------------------
  |  Branch (2034:10): [True: 82.1k, False: 0]
  |  Branch (2034:28): [True: 82.1k, False: 0]
  |  Branch (2034:46): [True: 0, False: 82.1k]
  ------------------
 2035|  82.1k|        || (fnciphcnt == 0 && cipher->ccipher == NULL && fnpipecnt == 0)
  ------------------
  |  Branch (2035:13): [True: 0, False: 82.1k]
  |  Branch (2035:31): [True: 0, False: 0]
  |  Branch (2035:58): [True: 0, False: 0]
  ------------------
 2036|  82.1k|        || (fnpipecnt != 0 && (fnpipecnt < 3 || cipher->p_cupdate == NULL || cipher->p_cfinal == NULL))
  ------------------
  |  Branch (2036:13): [True: 0, False: 82.1k]
  |  Branch (2036:32): [True: 0, False: 0]
  |  Branch (2036:49): [True: 0, False: 0]
  |  Branch (2036:78): [True: 0, False: 0]
  ------------------
 2037|  82.1k|        || fnctxcnt != 2) {
  ------------------
  |  Branch (2037:12): [True: 0, False: 82.1k]
  ------------------
 2038|       |        /*
 2039|       |         * In order to be a consistent set of functions we must have at least
 2040|       |         * a complete set of "encrypt" functions, or a complete set of "decrypt"
 2041|       |         * functions, or a single "cipher" function. In all cases we need both
 2042|       |         * the "newctx" and "freectx" functions.
 2043|       |         */
 2044|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 2045|      0|        goto err;
 2046|      0|    }
 2047|  82.1k|    if (prov != NULL && !ossl_provider_up_ref(prov))
  ------------------
  |  Branch (2047:9): [True: 82.1k, False: 0]
  |  Branch (2047:25): [True: 0, False: 82.1k]
  ------------------
 2048|      0|        goto err;
 2049|       |
 2050|  82.1k|    cipher->prov = prov;
 2051|       |
 2052|  82.1k|    if (!evp_cipher_cache_constants(cipher)) {
  ------------------
  |  Branch (2052:9): [True: 0, False: 82.1k]
  ------------------
 2053|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_CACHE_CONSTANTS_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 2054|      0|        goto err;
 2055|      0|    }
 2056|       |
 2057|  82.1k|    return cipher;
 2058|       |
 2059|      0|err:
 2060|      0|    EVP_CIPHER_free(cipher);
 2061|       |    return NULL;
 2062|  82.1k|}
evp_enc.c:set_legacy_nid:
 1866|   153k|{
 1867|   153k|    int nid;
 1868|   153k|    int *legacy_nid = vlegacy_nid;
 1869|       |    /*
 1870|       |     * We use lowest level function to get the associated method, because
 1871|       |     * higher level functions such as EVP_get_cipherbyname() have changed
 1872|       |     * to look at providers too.
 1873|       |     */
 1874|   153k|    const void *legacy_method = OBJ_NAME_get(name, OBJ_NAME_TYPE_CIPHER_METH);
  ------------------
  |  |   26|   153k|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  ------------------
 1875|       |
 1876|   153k|    if (*legacy_nid == -1) /* We found a clash already */
  ------------------
  |  Branch (1876:9): [True: 0, False: 153k]
  ------------------
 1877|      0|        return;
 1878|   153k|    if (legacy_method == NULL)
  ------------------
  |  Branch (1878:9): [True: 68.8k, False: 84.6k]
  ------------------
 1879|  68.8k|        return;
 1880|  84.6k|    nid = EVP_CIPHER_get_nid(legacy_method);
 1881|  84.6k|    if (*legacy_nid != NID_undef && *legacy_nid != nid) {
  ------------------
  |  |   18|   169k|#define NID_undef                       0
  ------------------
  |  Branch (1881:9): [True: 16.4k, False: 68.2k]
  |  Branch (1881:37): [True: 0, False: 16.4k]
  ------------------
 1882|      0|        *legacy_nid = -1;
 1883|      0|        return;
 1884|      0|    }
 1885|  84.6k|    *legacy_nid = nid;
 1886|  84.6k|}
evp_enc.c:evp_cipher_up_ref:
 2065|   127k|{
 2066|   127k|    return EVP_CIPHER_up_ref(cipher);
 2067|   127k|}
evp_enc.c:evp_cipher_free:
 2070|   172k|{
 2071|   172k|    EVP_CIPHER_free(cipher);
 2072|   172k|}

ossl_err_load_EVP_strings:
  227|      1|{
  228|      1|#ifndef OPENSSL_NO_ERR
  229|      1|    if (ERR_reason_error_string(EVP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (229:9): [True: 1, False: 0]
  ------------------
  230|      1|        ERR_load_strings_const(EVP_str_reasons);
  231|      1|#endif
  232|      1|    return 1;
  233|      1|}

evp_generic_fetch:
  398|   709k|{
  399|   709k|    struct evp_method_data_st methdata;
  400|   709k|    void *method;
  401|       |
  402|   709k|    methdata.libctx = libctx;
  403|   709k|    methdata.tmp_store = NULL;
  404|       |    method = inner_evp_generic_fetch(&methdata, NULL, operation_id,
  405|   709k|        name, properties,
  406|   709k|        new_method, up_ref_method, free_method);
  407|   709k|    dealloc_tmp_evp_method_store(methdata.tmp_store);
  408|   709k|    return method;
  409|   709k|}
evp_generic_fetch_from_prov:
  424|  3.29k|{
  425|  3.29k|    struct evp_method_data_st methdata;
  426|  3.29k|    void *method;
  427|       |
  428|  3.29k|    methdata.libctx = ossl_provider_libctx(prov);
  429|       |    methdata.tmp_store = NULL;
  430|  3.29k|    method = inner_evp_generic_fetch(&methdata, prov, operation_id,
  431|  3.29k|        name, properties,
  432|  3.29k|        new_method, up_ref_method, free_method);
  433|  3.29k|    dealloc_tmp_evp_method_store(methdata.tmp_store);
  434|  3.29k|    return method;
  435|  3.29k|}
evp_method_store_cache_flush:
  438|    649|{
  439|    649|    OSSL_METHOD_STORE *store = get_evp_method_store(libctx);
  440|       |
  441|    649|    if (store != NULL)
  ------------------
  |  Branch (441:9): [True: 649, False: 0]
  ------------------
  442|    649|        return ossl_method_store_cache_flush_all(store);
  443|      0|    return 1;
  444|    649|}
evp_method_store_remove_all_provided:
  447|    649|{
  448|    649|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  449|    649|    OSSL_METHOD_STORE *store = get_evp_method_store(libctx);
  450|       |
  451|    649|    if (store != NULL)
  ------------------
  |  Branch (451:9): [True: 649, False: 0]
  ------------------
  452|    649|        return ossl_method_store_remove_all_provided(store, prov);
  453|      0|    return 1;
  454|    649|}
evp_generic_do_all:
  638|      2|{
  639|      2|    struct evp_method_data_st methdata;
  640|      2|    struct filter_data_st data;
  641|       |
  642|      2|    methdata.libctx = libctx;
  643|      2|    methdata.tmp_store = NULL;
  644|      2|    (void)inner_evp_generic_fetch(&methdata, NULL, operation_id, NULL, NULL,
  645|      2|        new_method, up_ref_method, free_method);
  646|       |
  647|      2|    data.operation_id = operation_id;
  648|      2|    data.user_fn = user_fn;
  649|      2|    data.user_arg = user_arg;
  650|      2|    if (methdata.tmp_store != NULL)
  ------------------
  |  Branch (650:9): [True: 0, False: 2]
  ------------------
  651|      0|        ossl_method_store_do_all(methdata.tmp_store, &filter_on_operation_id,
  652|      0|            &data);
  653|      2|    ossl_method_store_do_all(get_evp_method_store(libctx),
  654|      2|        &filter_on_operation_id, &data);
  655|      2|    dealloc_tmp_evp_method_store(methdata.tmp_store);
  656|      2|}
evp_is_a:
  660|  1.08M|{
  661|       |    /*
  662|       |     * For a |prov| that is NULL, the library context will be NULL
  663|       |     */
  664|  1.08M|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  665|  1.08M|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  666|       |
  667|  1.08M|    if (prov == NULL)
  ------------------
  |  Branch (667:9): [True: 338k, False: 750k]
  ------------------
  668|   338k|        number = ossl_namemap_name2num(namemap, legacy_name);
  669|  1.08M|    return ossl_namemap_name2num(namemap, name) == number;
  670|  1.08M|}
evp_names_do_all:
  675|   542k|{
  676|   542k|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  677|   542k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  678|       |
  679|   542k|    return ossl_namemap_doall_names(namemap, number, fn, data);
  680|   542k|}
evp_fetch.c:inner_evp_generic_fetch:
  259|   712k|{
  260|   712k|    OSSL_METHOD_STORE *store = get_evp_method_store(methdata->libctx);
  261|   712k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  262|       |#ifdef FIPS_MODULE
  263|       |    /*
  264|       |     * The FIPS provider has its own internal library context where only it
  265|       |     * is loaded.  Consequently, property queries aren't relevant because
  266|       |     * there is only one fetchable algorithm and it is assumed that the
  267|       |     * FIPS-ness is handled by the using algorithm.
  268|       |     */
  269|       |    const char *const propq = "";
  270|       |#else
  271|   712k|    const char *const propq = properties != NULL ? properties : "";
  ------------------
  |  Branch (271:31): [True: 102k, False: 610k]
  ------------------
  272|   712k|#endif /* FIPS_MODULE */
  273|   712k|    uint32_t meth_id = 0;
  274|   712k|    void *method = NULL;
  275|   712k|    int unsupported, name_id;
  276|       |
  277|   712k|    if (store == NULL || namemap == NULL) {
  ------------------
  |  Branch (277:9): [True: 0, False: 712k]
  |  Branch (277:26): [True: 0, False: 712k]
  ------------------
  278|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  279|      0|        return NULL;
  280|      0|    }
  281|       |
  282|       |    /*
  283|       |     * If there's ever an operation_id == 0 passed, we have an internal
  284|       |     * programming error.
  285|       |     */
  286|   712k|    if (!ossl_assert(operation_id > 0)) {
  ------------------
  |  |   52|   712k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|   712k|    __FILE__, __LINE__)
  ------------------
  |  Branch (286:9): [True: 0, False: 712k]
  ------------------
  287|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  288|      0|        return NULL;
  289|      0|    }
  290|       |
  291|       |    /* If we haven't received a name id yet, try to get one for the name */
  292|   712k|    name_id = name != NULL ? ossl_namemap_name2num(namemap, name) : 0;
  ------------------
  |  Branch (292:15): [True: 712k, False: 2]
  ------------------
  293|       |
  294|       |    /*
  295|       |     * If we have a name id, calculate a method id with evp_method_id().
  296|       |     *
  297|       |     * evp_method_id returns 0 if we have too many operations (more than
  298|       |     * about 2^8) or too many names (more than about 2^24).  In that case,
  299|       |     * we can't create any new method.
  300|       |     * For all intents and purposes, this is an internal error.
  301|       |     */
  302|   712k|    if (name_id != 0 && (meth_id = evp_method_id(name_id, operation_id)) == 0) {
  ------------------
  |  Branch (302:9): [True: 683k, False: 29.3k]
  |  Branch (302:25): [True: 0, False: 683k]
  ------------------
  303|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  304|      0|        return NULL;
  305|      0|    }
  306|       |
  307|       |    /*
  308|       |     * If we haven't found the name yet, chances are that the algorithm to
  309|       |     * be fetched is unsupported.
  310|       |     */
  311|   712k|    unsupported = name_id == 0;
  312|       |
  313|   712k|    if (meth_id == 0
  ------------------
  |  Branch (313:9): [True: 29.3k, False: 683k]
  ------------------
  314|   683k|        || !ossl_method_store_cache_get(store, prov, meth_id, propq, &method)) {
  ------------------
  |  Branch (314:12): [True: 46.5k, False: 636k]
  ------------------
  315|  75.8k|        OSSL_METHOD_CONSTRUCT_METHOD mcm = {
  316|  75.8k|            get_tmp_evp_method_store,
  317|  75.8k|            reserve_evp_method_store,
  318|  75.8k|            unreserve_evp_method_store,
  319|  75.8k|            get_evp_method_from_store,
  320|  75.8k|            put_evp_method_in_store,
  321|  75.8k|            construct_evp_method,
  322|  75.8k|            destruct_evp_method
  323|  75.8k|        };
  324|       |
  325|  75.8k|        methdata->operation_id = operation_id;
  326|  75.8k|        methdata->name_id = name_id;
  327|  75.8k|        methdata->names = name;
  328|  75.8k|        methdata->propquery = propq;
  329|  75.8k|        methdata->method_from_algorithm = new_method;
  330|  75.8k|        methdata->refcnt_up_method = up_ref_method;
  331|  75.8k|        methdata->destruct_method = free_method;
  332|  75.8k|        methdata->flag_construct_error_occurred = 0;
  333|  75.8k|        if ((method = ossl_method_construct(methdata->libctx, operation_id,
  ------------------
  |  Branch (333:13): [True: 27.5k, False: 48.3k]
  ------------------
  334|  75.8k|                 &prov, 0 /* !force_cache */,
  335|  75.8k|                 &mcm, methdata))
  336|  75.8k|            != NULL) {
  337|       |            /*
  338|       |             * If construction did create a method for us, we know that
  339|       |             * there is a correct name_id and meth_id, since those have
  340|       |             * already been calculated in get_evp_method_from_store() and
  341|       |             * put_evp_method_in_store() above.
  342|       |             * Note that there is a corner case here, in which, if a user
  343|       |             * passes a name of the form name1:name2:..., then the construction
  344|       |             * will create a method against all names, but the lookup will fail
  345|       |             * as ossl_namemap_name2num treats the name string as a single name
  346|       |             * rather than introducing new features where in the EVP_<obj>_fetch
  347|       |             * parses the string and queries for each, return an error.
  348|       |             */
  349|  27.5k|            if (name_id == 0)
  ------------------
  |  Branch (349:17): [True: 1.09k, False: 26.4k]
  ------------------
  350|  1.09k|                name_id = ossl_namemap_name2num(namemap, name);
  351|  27.5k|            if (name_id == 0) {
  ------------------
  |  Branch (351:17): [True: 0, False: 27.5k]
  ------------------
  352|      0|                ERR_raise_data(ERR_LIB_EVP, ERR_R_FETCH_FAILED,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_EVP, ERR_R_FETCH_FAILED,
  ------------------
  |  |   78|      0|#define ERR_LIB_EVP 6
  ------------------
                              ERR_raise_data(ERR_LIB_EVP, ERR_R_FETCH_FAILED,
  ------------------
  |  |  365|      0|#define ERR_R_FETCH_FAILED (269 | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  353|      0|                    "Algorithm %s cannot be found", name);
  354|      0|                free_method(method);
  355|      0|                method = NULL;
  356|  27.5k|            } else {
  357|  27.5k|                meth_id = evp_method_id(name_id, operation_id);
  358|  27.5k|                if (meth_id != 0)
  ------------------
  |  Branch (358:21): [True: 27.5k, False: 0]
  ------------------
  359|  27.5k|                    ossl_method_store_cache_set(store, prov, meth_id, propq,
  360|  27.5k|                        method, up_ref_method, free_method);
  361|  27.5k|            }
  362|  27.5k|        }
  363|       |
  364|       |        /*
  365|       |         * If we never were in the constructor, the algorithm to be fetched
  366|       |         * is unsupported.
  367|       |         */
  368|  75.8k|        unsupported = !methdata->flag_construct_error_occurred;
  369|  75.8k|    }
  370|       |
  371|   712k|    if ((name_id != 0 || name != NULL) && method == NULL) {
  ------------------
  |  Branch (371:10): [True: 684k, False: 28.2k]
  |  Branch (371:26): [True: 28.2k, False: 2]
  |  Branch (371:43): [True: 48.3k, False: 664k]
  ------------------
  372|  48.3k|        int code = unsupported ? ERR_R_UNSUPPORTED : ERR_R_FETCH_FAILED;
  ------------------
  |  |  364|  48.3k|#define ERR_R_UNSUPPORTED (268 | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  239|  48.3k|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  230|  48.3k|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      int code = unsupported ? ERR_R_UNSUPPORTED : ERR_R_FETCH_FAILED;
  ------------------
  |  |  365|      0|#define ERR_R_FETCH_FAILED (269 | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (372:20): [True: 48.3k, False: 0]
  ------------------
  373|       |
  374|  48.3k|        if (name == NULL)
  ------------------
  |  Branch (374:13): [True: 0, False: 48.3k]
  ------------------
  375|      0|            name = ossl_namemap_num2name(namemap, name_id, 0);
  376|  48.3k|        ERR_raise_data(ERR_LIB_EVP, code,
  ------------------
  |  |  406|  48.3k|    (ERR_new(),                                                  \
  |  |  407|  48.3k|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|  48.3k|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|  48.3k|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, code,
  ------------------
  |  |   78|  48.3k|#define ERR_LIB_EVP 6
  ------------------
  377|  48.3k|            "%s, Algorithm (%s : %d), Properties (%s)",
  378|  48.3k|            ossl_lib_ctx_get_descriptor(methdata->libctx),
  379|  48.3k|            name == NULL ? "<null>" : name, name_id,
  ------------------
  |  Branch (379:13): [True: 0, False: 48.3k]
  ------------------
  380|  48.3k|            properties == NULL ? "<null>" : properties);
  ------------------
  |  Branch (380:13): [True: 31.3k, False: 17.0k]
  ------------------
  381|   664k|    } else {
  382|   664k|        OSSL_TRACE4(QUERY, "%s, Algorithm (%s : %d), Properties (%s)\n",
  ------------------
  |  |  299|   664k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4))
  |  |  ------------------
  |  |  |  |  285|   664k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  383|   664k|            ossl_lib_ctx_get_descriptor(methdata->libctx),
  384|   664k|            name == NULL ? "<null>" : name, name_id,
  385|   664k|            properties == NULL ? "<null>" : properties);
  386|   664k|    }
  387|       |
  388|   712k|    return method;
  389|   712k|}
evp_fetch.c:evp_method_id:
  117|   927k|{
  118|   927k|    if (!ossl_assert(name_id > 0 && name_id <= METHOD_ID_NAME_MAX)
  ------------------
  |  |   52|  1.85M|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  ------------------
  |  |  |  Branch (52:41): [True: 927k, False: 0]
  |  |  |  Branch (52:41): [True: 927k, False: 0]
  |  |  ------------------
  |  |   53|  1.85M|    __FILE__, __LINE__)
  ------------------
  |  Branch (118:9): [True: 0, False: 927k]
  ------------------
  119|   927k|        || !ossl_assert(operation_id > 0
  ------------------
  |  |   52|  1.85M|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  ------------------
  |  |  |  Branch (52:41): [True: 927k, False: 0]
  |  |  |  Branch (52:41): [True: 927k, False: 0]
  |  |  ------------------
  |  |   53|   927k|    __FILE__, __LINE__)
  ------------------
  |  Branch (119:12): [True: 0, False: 927k]
  ------------------
  120|   927k|            && operation_id <= METHOD_ID_OPERATION_MAX))
  121|      0|        return 0;
  122|   927k|    return (((name_id << METHOD_ID_NAME_OFFSET) & METHOD_ID_NAME_MASK)
  ------------------
  |  |  114|   927k|#define METHOD_ID_NAME_OFFSET 8
  ------------------
                  return (((name_id << METHOD_ID_NAME_OFFSET) & METHOD_ID_NAME_MASK)
  ------------------
  |  |  113|   927k|#define METHOD_ID_NAME_MASK 0x7FFFFF00
  ------------------
  123|   927k|        | (operation_id & METHOD_ID_OPERATION_MASK));
  ------------------
  |  |  111|   927k|#define METHOD_ID_OPERATION_MASK 0x000000FF
  ------------------
  124|   927k|}
evp_fetch.c:reserve_evp_method_store:
   73|   119k|{
   74|   119k|    struct evp_method_data_st *methdata = data;
   75|       |
   76|   119k|    if (store == NULL
  ------------------
  |  Branch (76:9): [True: 119k, False: 0]
  ------------------
   77|   119k|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (77:12): [True: 0, False: 119k]
  ------------------
   78|      0|        return 0;
   79|       |
   80|   119k|    return ossl_method_lock_store(store);
   81|   119k|}
evp_fetch.c:unreserve_evp_method_store:
   84|   119k|{
   85|   119k|    struct evp_method_data_st *methdata = data;
   86|       |
   87|   119k|    if (store == NULL
  ------------------
  |  Branch (87:9): [True: 119k, False: 0]
  ------------------
   88|   119k|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (88:12): [True: 0, False: 119k]
  ------------------
   89|      0|        return 0;
   90|       |
   91|   119k|    return ossl_method_unlock_store(store);
   92|   119k|}
evp_fetch.c:get_evp_method_from_store:
  128|  75.8k|{
  129|  75.8k|    struct evp_method_data_st *methdata = data;
  130|  75.8k|    void *method = NULL;
  131|  75.8k|    int name_id;
  132|  75.8k|    uint32_t meth_id;
  133|       |
  134|       |    /*
  135|       |     * get_evp_method_from_store() is only called to try and get the method
  136|       |     * that evp_generic_fetch() is asking for, and the operation id as well
  137|       |     * as the name or name id are passed via methdata.
  138|       |     */
  139|  75.8k|    if ((name_id = methdata->name_id) == 0 && methdata->names != NULL) {
  ------------------
  |  Branch (139:9): [True: 29.3k, False: 46.5k]
  |  Branch (139:47): [True: 29.3k, False: 2]
  ------------------
  140|  29.3k|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  141|  29.3k|        const char *names = methdata->names;
  142|  29.3k|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   24|  29.3k|#define NAME_SEPARATOR ':'
  ------------------
  143|  29.3k|        size_t l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (143:21): [True: 29.3k, False: 0]
  ------------------
  144|       |
  145|  29.3k|        if (namemap == 0)
  ------------------
  |  Branch (145:13): [True: 0, False: 29.3k]
  ------------------
  146|      0|            return NULL;
  147|  29.3k|        name_id = ossl_namemap_name2num_n(namemap, names, l);
  148|  29.3k|    }
  149|       |
  150|  75.8k|    if (name_id == 0
  ------------------
  |  Branch (150:9): [True: 28.1k, False: 47.7k]
  ------------------
  151|  47.7k|        || (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0)
  ------------------
  |  Branch (151:12): [True: 0, False: 47.7k]
  ------------------
  152|  28.1k|        return NULL;
  153|       |
  154|  47.7k|    if (store == NULL
  ------------------
  |  Branch (154:9): [True: 47.7k, False: 0]
  ------------------
  155|  47.7k|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (155:12): [True: 0, False: 47.7k]
  ------------------
  156|      0|        return NULL;
  157|       |
  158|  47.7k|    if (!ossl_method_store_fetch(store, meth_id, methdata->propquery, prov,
  ------------------
  |  Branch (158:9): [True: 20.1k, False: 27.5k]
  ------------------
  159|  47.7k|            &method))
  160|  20.1k|        return NULL;
  161|  27.5k|    return method;
  162|  47.7k|}
evp_fetch.c:put_evp_method_in_store:
  168|   169k|{
  169|   169k|    struct evp_method_data_st *methdata = data;
  170|   169k|    OSSL_NAMEMAP *namemap;
  171|   169k|    int name_id;
  172|   169k|    uint32_t meth_id;
  173|   169k|    size_t l = 0;
  174|       |
  175|       |    /*
  176|       |     * put_evp_method_in_store() is only called with an EVP method that was
  177|       |     * successfully created by construct_method() below, which means that
  178|       |     * all the names should already be stored in the namemap with the same
  179|       |     * numeric identity, so just use the first to get that identity.
  180|       |     */
  181|   169k|    if (names != NULL) {
  ------------------
  |  Branch (181:9): [True: 169k, False: 0]
  ------------------
  182|   169k|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   24|   169k|#define NAME_SEPARATOR ':'
  ------------------
  183|       |
  184|   169k|        l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (184:14): [True: 51.9k, False: 117k]
  ------------------
  185|   169k|    }
  186|       |
  187|   169k|    if ((namemap = ossl_namemap_stored(methdata->libctx)) == NULL
  ------------------
  |  Branch (187:9): [True: 0, False: 169k]
  ------------------
  188|   169k|        || (name_id = ossl_namemap_name2num_n(namemap, names, l)) == 0
  ------------------
  |  Branch (188:12): [True: 0, False: 169k]
  ------------------
  189|   169k|        || (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0)
  ------------------
  |  Branch (189:12): [True: 0, False: 169k]
  ------------------
  190|      0|        return 0;
  191|       |
  192|   169k|    OSSL_TRACE1(QUERY, "put_evp_method_in_store: original store: %p\n", store);
  ------------------
  |  |  293|   169k|    OSSL_TRACEV(category, (trc_out, format, arg1))
  |  |  ------------------
  |  |  |  |  285|   169k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  193|   169k|    if (store == NULL
  ------------------
  |  Branch (193:9): [True: 169k, False: 0]
  ------------------
  194|   169k|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (194:12): [True: 0, False: 169k]
  ------------------
  195|      0|        return 0;
  196|       |
  197|   169k|    OSSL_TRACE5(QUERY,
  ------------------
  |  |  301|   169k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5))
  |  |  ------------------
  |  |  |  |  285|   169k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  198|   169k|        "put_evp_method_in_store: "
  199|   169k|        "store: %p, names: %s, operation_id %d, method_id: %d, properties: %s\n",
  200|   169k|        store, names, methdata->operation_id, meth_id, propdef ? propdef : "<null>");
  201|   169k|    return ossl_method_store_add(store, prov, meth_id, propdef, method,
  202|   169k|        methdata->refcnt_up_method,
  203|   169k|        methdata->destruct_method);
  204|   169k|}
evp_fetch.c:construct_evp_method:
  212|   169k|{
  213|       |    /*
  214|       |     * This function is only called if get_evp_method_from_store() returned
  215|       |     * NULL, so it's safe to say that of all the spots to create a new
  216|       |     * namemap entry, this is it.  Should the name already exist there, we
  217|       |     * know that ossl_namemap_add_name() will return its corresponding
  218|       |     * number.
  219|       |     */
  220|   169k|    struct evp_method_data_st *methdata = data;
  221|   169k|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  222|   169k|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  223|   169k|    const char *names = algodef->algorithm_names;
  224|   169k|    int name_id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR);
  ------------------
  |  |   24|   169k|#define NAME_SEPARATOR ':'
  ------------------
  225|   169k|    void *method;
  226|       |
  227|   169k|    if (name_id == 0)
  ------------------
  |  Branch (227:9): [True: 0, False: 169k]
  ------------------
  228|      0|        return NULL;
  229|       |
  230|   169k|    method = methdata->method_from_algorithm(name_id, algodef, prov);
  231|       |
  232|       |    /*
  233|       |     * Flag to indicate that there was actual construction errors.  This
  234|       |     * helps inner_evp_generic_fetch() determine what error it should
  235|       |     * record on inaccessible algorithms.
  236|       |     */
  237|   169k|    if (method == NULL)
  ------------------
  |  Branch (237:9): [True: 0, False: 169k]
  ------------------
  238|      0|        methdata->flag_construct_error_occurred = 1;
  239|       |
  240|   169k|    return method;
  241|   169k|}
evp_fetch.c:destruct_evp_method:
  244|   169k|{
  245|   169k|    struct evp_method_data_st *methdata = data;
  246|       |
  247|   169k|    methdata->destruct_method(method);
  248|   169k|}
evp_fetch.c:dealloc_tmp_evp_method_store:
   61|   712k|{
   62|   712k|    OSSL_TRACE1(QUERY, "Deallocating the tmp_store %p\n", store);
  ------------------
  |  |  293|   712k|    OSSL_TRACEV(category, (trc_out, format, arg1))
  |  |  ------------------
  |  |  |  |  285|   712k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   63|   712k|    if (store != NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 712k]
  ------------------
   64|      0|        ossl_method_store_free(store);
   65|   712k|}
evp_fetch.c:get_evp_method_store:
   68|  1.17M|{
   69|  1.17M|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX);
  ------------------
  |  |   96|  1.17M|#define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX 0
  ------------------
   70|  1.17M|}
evp_fetch.c:filter_on_operation_id:
  623|    536|{
  624|    536|    struct filter_data_st *data = arg;
  625|       |
  626|    536|    if ((id & METHOD_ID_OPERATION_MASK) == data->operation_id)
  ------------------
  |  |  111|    536|#define METHOD_ID_OPERATION_MASK 0x000000FF
  ------------------
  |  Branch (626:9): [True: 80, False: 456]
  ------------------
  627|     80|        data->user_fn(method, data->user_arg);
  628|    536|}

EVP_CIPHER_get_type:
  255|   115k|{
  256|   115k|    int nid;
  257|   115k|    nid = EVP_CIPHER_get_nid(cipher);
  258|       |
  259|   115k|    switch (nid) {
  260|       |
  261|  1.89k|    case NID_rc2_cbc:
  ------------------
  |  | 1303|  1.89k|#define NID_rc2_cbc             37
  ------------------
  |  Branch (261:5): [True: 1.89k, False: 113k]
  ------------------
  262|  3.16k|    case NID_rc2_64_cbc:
  ------------------
  |  | 1324|  3.16k|#define NID_rc2_64_cbc          166
  ------------------
  |  Branch (262:5): [True: 1.26k, False: 114k]
  ------------------
  263|  4.42k|    case NID_rc2_40_cbc:
  ------------------
  |  | 1320|  4.42k|#define NID_rc2_40_cbc          98
  ------------------
  |  Branch (263:5): [True: 1.26k, False: 114k]
  ------------------
  264|       |
  265|  4.42k|        return NID_rc2_cbc;
  ------------------
  |  | 1303|  4.42k|#define NID_rc2_cbc             37
  ------------------
  266|       |
  267|    632|    case NID_rc4:
  ------------------
  |  | 1328|    632|#define NID_rc4         5
  ------------------
  |  Branch (267:5): [True: 632, False: 115k]
  ------------------
  268|  1.26k|    case NID_rc4_40:
  ------------------
  |  | 1333|  1.26k|#define NID_rc4_40              97
  ------------------
  |  Branch (268:5): [True: 632, False: 115k]
  ------------------
  269|       |
  270|  1.26k|        return NID_rc4;
  ------------------
  |  | 1328|  1.26k|#define NID_rc4         5
  ------------------
  271|       |
  272|    632|    case NID_aes_128_cfb128:
  ------------------
  |  | 3112|    632|#define NID_aes_128_cfb128              421
  ------------------
  |  Branch (272:5): [True: 632, False: 115k]
  ------------------
  273|  1.26k|    case NID_aes_128_cfb8:
  ------------------
  |  | 3233|  1.26k|#define NID_aes_128_cfb8                653
  ------------------
  |  Branch (273:5): [True: 632, False: 115k]
  ------------------
  274|  1.89k|    case NID_aes_128_cfb1:
  ------------------
  |  | 3221|  1.89k|#define NID_aes_128_cfb1                650
  ------------------
  |  Branch (274:5): [True: 632, False: 115k]
  ------------------
  275|       |
  276|  1.89k|        return NID_aes_128_cfb128;
  ------------------
  |  | 3112|  1.89k|#define NID_aes_128_cfb128              421
  ------------------
  277|       |
  278|    632|    case NID_aes_192_cfb128:
  ------------------
  |  | 3150|    632|#define NID_aes_192_cfb128              425
  ------------------
  |  Branch (278:5): [True: 632, False: 115k]
  ------------------
  279|  1.26k|    case NID_aes_192_cfb8:
  ------------------
  |  | 3237|  1.26k|#define NID_aes_192_cfb8                654
  ------------------
  |  Branch (279:5): [True: 632, False: 115k]
  ------------------
  280|  1.89k|    case NID_aes_192_cfb1:
  ------------------
  |  | 3225|  1.89k|#define NID_aes_192_cfb1                651
  ------------------
  |  Branch (280:5): [True: 632, False: 115k]
  ------------------
  281|       |
  282|  1.89k|        return NID_aes_192_cfb128;
  ------------------
  |  | 3150|  1.89k|#define NID_aes_192_cfb128              425
  ------------------
  283|       |
  284|    632|    case NID_aes_256_cfb128:
  ------------------
  |  | 3188|    632|#define NID_aes_256_cfb128              429
  ------------------
  |  Branch (284:5): [True: 632, False: 115k]
  ------------------
  285|  1.26k|    case NID_aes_256_cfb8:
  ------------------
  |  | 3241|  1.26k|#define NID_aes_256_cfb8                655
  ------------------
  |  Branch (285:5): [True: 632, False: 115k]
  ------------------
  286|  1.89k|    case NID_aes_256_cfb1:
  ------------------
  |  | 3229|  1.89k|#define NID_aes_256_cfb1                652
  ------------------
  |  Branch (286:5): [True: 632, False: 115k]
  ------------------
  287|       |
  288|  1.89k|        return NID_aes_256_cfb128;
  ------------------
  |  | 3188|  1.89k|#define NID_aes_256_cfb128              429
  ------------------
  289|       |
  290|    632|    case NID_des_cfb64:
  ------------------
  |  | 2282|    632|#define NID_des_cfb64           30
  ------------------
  |  Branch (290:5): [True: 632, False: 115k]
  ------------------
  291|  1.26k|    case NID_des_cfb8:
  ------------------
  |  | 3273|  1.26k|#define NID_des_cfb8            657
  ------------------
  |  Branch (291:5): [True: 632, False: 115k]
  ------------------
  292|  1.89k|    case NID_des_cfb1:
  ------------------
  |  | 3269|  1.89k|#define NID_des_cfb1            656
  ------------------
  |  Branch (292:5): [True: 632, False: 115k]
  ------------------
  293|       |
  294|  1.89k|        return NID_des_cfb64;
  ------------------
  |  | 2282|  1.89k|#define NID_des_cfb64           30
  ------------------
  295|       |
  296|    632|    case NID_des_ede3_cfb64:
  ------------------
  |  | 2323|    632|#define NID_des_ede3_cfb64              61
  ------------------
  |  Branch (296:5): [True: 632, False: 115k]
  ------------------
  297|  1.26k|    case NID_des_ede3_cfb8:
  ------------------
  |  | 3281|  1.26k|#define NID_des_ede3_cfb8               659
  ------------------
  |  Branch (297:5): [True: 632, False: 115k]
  ------------------
  298|  1.89k|    case NID_des_ede3_cfb1:
  ------------------
  |  | 3277|  1.89k|#define NID_des_ede3_cfb1               658
  ------------------
  |  Branch (298:5): [True: 632, False: 115k]
  ------------------
  299|       |
  300|  1.89k|        return NID_des_cfb64;
  ------------------
  |  | 2282|  1.89k|#define NID_des_cfb64           30
  ------------------
  301|       |
  302|   100k|    default:
  ------------------
  |  Branch (302:5): [True: 100k, False: 15.1k]
  ------------------
  303|       |#ifdef FIPS_MODULE
  304|       |        return NID_undef;
  305|       |#else
  306|   100k|    {
  307|       |        /* Check it has an OID and it is valid */
  308|   100k|        ASN1_OBJECT *otmp = OBJ_nid2obj(nid);
  309|       |
  310|   100k|        if (OBJ_get0_data(otmp) == NULL)
  ------------------
  |  Branch (310:13): [True: 30.3k, False: 70.1k]
  ------------------
  311|  30.3k|            nid = NID_undef;
  ------------------
  |  |   18|  30.3k|#define NID_undef                       0
  ------------------
  312|   100k|        ASN1_OBJECT_free(otmp);
  313|   100k|        return nid;
  314|  1.26k|    }
  315|   115k|#endif
  316|   115k|    }
  317|   115k|}
evp_cipher_cache_constants:
  320|  82.1k|{
  321|  82.1k|    int ok, aead = 0, custom_iv = 0, cts = 0, multiblock = 0, randkey = 0;
  322|  82.1k|    int encrypt_then_mac = 0;
  323|  82.1k|    size_t ivlen = 0;
  324|  82.1k|    size_t blksz = 0;
  325|  82.1k|    size_t keylen = 0;
  326|  82.1k|    unsigned int mode = 0;
  327|  82.1k|    OSSL_PARAM params[11];
  328|       |
  329|  82.1k|    params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_BLOCK_SIZE, &blksz);
  ------------------
  |  |  189|  82.1k|# define OSSL_CIPHER_PARAM_BLOCK_SIZE "blocksize"
  ------------------
  330|  82.1k|    params[1] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_IVLEN, &ivlen);
  ------------------
  |  |  199|  82.1k|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  331|  82.1k|    params[2] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_KEYLEN, &keylen);
  ------------------
  |  |  200|  82.1k|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  332|  82.1k|    params[3] = OSSL_PARAM_construct_uint(OSSL_CIPHER_PARAM_MODE, &mode);
  ------------------
  |  |  201|  82.1k|# define OSSL_CIPHER_PARAM_MODE "mode"
  ------------------
  333|  82.1k|    params[4] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_AEAD, &aead);
  ------------------
  |  |  175|  82.1k|# define OSSL_CIPHER_PARAM_AEAD "aead"
  ------------------
  334|  82.1k|    params[5] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_CUSTOM_IV,
  ------------------
  |  |  192|  82.1k|# define OSSL_CIPHER_PARAM_CUSTOM_IV "custom-iv"
  ------------------
  335|  82.1k|        &custom_iv);
  336|  82.1k|    params[6] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_CTS, &cts);
  ------------------
  |  |  190|  82.1k|# define OSSL_CIPHER_PARAM_CTS "cts"
  ------------------
  337|  82.1k|    params[7] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK,
  ------------------
  |  |  209|  82.1k|# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK "tls-multi"
  ------------------
  338|  82.1k|        &multiblock);
  339|  82.1k|    params[8] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_HAS_RAND_KEY,
  ------------------
  |  |  197|  82.1k|# define OSSL_CIPHER_PARAM_HAS_RAND_KEY "has-randkey"
  ------------------
  340|  82.1k|        &randkey);
  341|  82.1k|    params[9] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC,
  ------------------
  |  |  194|  82.1k|# define OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC "encrypt-then-mac"
  ------------------
  342|  82.1k|        &encrypt_then_mac);
  343|  82.1k|    params[10] = OSSL_PARAM_construct_end();
  344|  82.1k|    ok = evp_do_ciph_getparams(cipher, params) > 0;
  345|  82.1k|    if (ok) {
  ------------------
  |  Branch (345:9): [True: 82.1k, False: 0]
  ------------------
  346|  82.1k|        cipher->block_size = (int)blksz;
  347|  82.1k|        cipher->iv_len = (int)ivlen;
  348|  82.1k|        cipher->key_len = (int)keylen;
  349|  82.1k|        cipher->flags = mode;
  350|  82.1k|        if (aead)
  ------------------
  |  Branch (350:13): [True: 17.6k, False: 64.4k]
  ------------------
  351|  17.6k|            cipher->flags |= EVP_CIPH_FLAG_AEAD_CIPHER;
  ------------------
  |  |  357|  17.6k|#define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000
  ------------------
  352|  82.1k|        if (custom_iv)
  ------------------
  |  Branch (352:13): [True: 25.9k, False: 56.2k]
  ------------------
  353|  25.9k|            cipher->flags |= EVP_CIPH_CUSTOM_IV;
  ------------------
  |  |  327|  25.9k|#define EVP_CIPH_CUSTOM_IV 0x10
  ------------------
  354|  82.1k|        if (cts)
  ------------------
  |  Branch (354:13): [True: 3.79k, False: 78.3k]
  ------------------
  355|  3.79k|            cipher->flags |= EVP_CIPH_FLAG_CTS;
  ------------------
  |  |  355|  3.79k|#define EVP_CIPH_FLAG_CTS 0x4000
  ------------------
  356|  82.1k|        if (multiblock)
  ------------------
  |  Branch (356:13): [True: 2.52k, False: 79.6k]
  ------------------
  357|  2.52k|            cipher->flags |= EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK;
  ------------------
  |  |  358|  2.52k|#define EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0x400000
  ------------------
  358|  82.1k|        if (cipher->ccipher != NULL)
  ------------------
  |  Branch (358:13): [True: 74.5k, False: 7.58k]
  ------------------
  359|  74.5k|            cipher->flags |= EVP_CIPH_FLAG_CUSTOM_CIPHER;
  ------------------
  |  |  356|  74.5k|#define EVP_CIPH_FLAG_CUSTOM_CIPHER 0x100000
  ------------------
  360|  82.1k|        if (randkey)
  ------------------
  |  Branch (360:13): [True: 6.95k, False: 75.2k]
  ------------------
  361|  6.95k|            cipher->flags |= EVP_CIPH_RAND_KEY;
  ------------------
  |  |  337|  6.95k|#define EVP_CIPH_RAND_KEY 0x200
  ------------------
  362|  82.1k|        if (encrypt_then_mac)
  ------------------
  |  Branch (362:13): [True: 0, False: 82.1k]
  ------------------
  363|      0|            cipher->flags |= EVP_CIPH_FLAG_ENC_THEN_MAC;
  ------------------
  |  |  368|      0|#define EVP_CIPH_FLAG_ENC_THEN_MAC 0x10000000
  ------------------
  364|  82.1k|        if (OSSL_PARAM_locate_const(EVP_CIPHER_gettable_ctx_params(cipher),
  ------------------
  |  Branch (364:13): [True: 0, False: 82.1k]
  ------------------
  365|  82.1k|                OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS))
  ------------------
  |  |  187|  82.1k|# define OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS
  |  |  ------------------
  |  |  |  |  126|  82.1k|# define OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS "algorithm-id-params"
  |  |  ------------------
  ------------------
  366|      0|            cipher->flags |= EVP_CIPH_FLAG_CUSTOM_ASN1;
  ------------------
  |  |  362|      0|#define EVP_CIPH_FLAG_CUSTOM_ASN1 0x1000000
  ------------------
  367|  82.1k|    }
  368|  82.1k|    return ok;
  369|  82.1k|}
EVP_CIPHER_get_iv_length:
  491|  1.64k|{
  492|  1.64k|    return (cipher == NULL) ? 0 : cipher->iv_len;
  ------------------
  |  Branch (492:12): [True: 0, False: 1.64k]
  ------------------
  493|  1.64k|}
EVP_CIPHER_CTX_get_iv_length:
  496|  34.5k|{
  497|  34.5k|    if (ctx->cipher == NULL)
  ------------------
  |  Branch (497:9): [True: 0, False: 34.5k]
  ------------------
  498|      0|        return 0;
  499|       |
  500|  34.5k|    if (ctx->iv_len < 0) {
  ------------------
  |  Branch (500:9): [True: 1.64k, False: 32.9k]
  ------------------
  501|  1.64k|        int rv, len = EVP_CIPHER_get_iv_length(ctx->cipher);
  502|  1.64k|        size_t v = len;
  503|  1.64k|        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  1.64k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  1.64k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  504|       |
  505|  1.64k|        if (ctx->cipher->get_ctx_params != NULL) {
  ------------------
  |  Branch (505:13): [True: 1.64k, False: 0]
  ------------------
  506|  1.64k|            params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_IVLEN,
  ------------------
  |  |  199|  1.64k|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  507|  1.64k|                &v);
  508|  1.64k|            rv = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
  509|  1.64k|            if (rv > 0) {
  ------------------
  |  Branch (509:17): [True: 1.64k, False: 0]
  ------------------
  510|  1.64k|                if (OSSL_PARAM_modified(params)
  ------------------
  |  Branch (510:21): [True: 1.64k, False: 0]
  ------------------
  511|  1.64k|                    && !OSSL_PARAM_get_int(params, &len))
  ------------------
  |  Branch (511:24): [True: 0, False: 1.64k]
  ------------------
  512|      0|                    return -1;
  513|  1.64k|            } else if (rv != EVP_CTRL_RET_UNSUPPORTED) {
  ------------------
  |  |   13|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  ------------------
  |  Branch (513:24): [True: 0, False: 0]
  ------------------
  514|      0|                return -1;
  515|      0|            }
  516|  1.64k|        }
  517|       |        /* Code below to be removed when legacy support is dropped. */
  518|      0|        else if ((EVP_CIPHER_get_flags(ctx->cipher)
  ------------------
  |  Branch (518:18): [True: 0, False: 0]
  ------------------
  519|      0|                     & EVP_CIPH_CUSTOM_IV_LENGTH)
  ------------------
  |  |  341|      0|#define EVP_CIPH_CUSTOM_IV_LENGTH 0x800
  ------------------
  520|      0|            != 0) {
  521|      0|            rv = EVP_CIPHER_CTX_ctrl((EVP_CIPHER_CTX *)ctx, EVP_CTRL_GET_IVLEN,
  ------------------
  |  |  442|      0|#define EVP_CTRL_GET_IVLEN 0x25
  ------------------
  522|      0|                0, &len);
  523|      0|            if (rv <= 0)
  ------------------
  |  Branch (523:17): [True: 0, False: 0]
  ------------------
  524|      0|                return -1;
  525|      0|        }
  526|       |        /*-
  527|       |         * Casting away the const is annoying but required here.  We need to
  528|       |         * cache the result for performance reasons.
  529|       |         */
  530|  1.64k|        ((EVP_CIPHER_CTX *)ctx)->iv_len = len;
  531|  1.64k|    }
  532|  34.5k|    return ctx->iv_len;
  533|  34.5k|}
EVP_CIPHER_get_key_length:
  638|  1.64k|{
  639|  1.64k|    return cipher->key_len;
  640|  1.64k|}
EVP_CIPHER_CTX_get_key_length:
  643|  87.2k|{
  644|  87.2k|    if (ctx->cipher == NULL)
  ------------------
  |  Branch (644:9): [True: 0, False: 87.2k]
  ------------------
  645|      0|        return 0;
  646|       |
  647|  87.2k|    if (ctx->key_len <= 0 && ctx->cipher->prov != NULL) {
  ------------------
  |  Branch (647:9): [True: 4.94k, False: 82.3k]
  |  Branch (647:30): [True: 4.94k, False: 0]
  ------------------
  648|  4.94k|        int ok;
  649|  4.94k|        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  4.94k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  4.94k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  650|  4.94k|        size_t len;
  651|       |
  652|  4.94k|        params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_KEYLEN, &len);
  ------------------
  |  |  200|  4.94k|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  653|  4.94k|        ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
  654|  4.94k|        if (ok <= 0)
  ------------------
  |  Branch (654:13): [True: 0, False: 4.94k]
  ------------------
  655|      0|            return EVP_CTRL_RET_UNSUPPORTED;
  ------------------
  |  |   13|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  ------------------
  656|       |
  657|       |        /*-
  658|       |         * The if branch should never be taken since EVP_MAX_KEY_LENGTH is
  659|       |         * less than INT_MAX but best to be safe.
  660|       |         *
  661|       |         * Casting away the const is annoying but required here.  We need to
  662|       |         * cache the result for performance reasons.
  663|       |         */
  664|  4.94k|        if (!OSSL_PARAM_get_int(params, &((EVP_CIPHER_CTX *)ctx)->key_len))
  ------------------
  |  Branch (664:13): [True: 0, False: 4.94k]
  ------------------
  665|      0|            return -1;
  666|  4.94k|        ((EVP_CIPHER_CTX *)ctx)->key_len = (int)len;
  667|  4.94k|    }
  668|  87.2k|    return ctx->key_len;
  669|  87.2k|}
EVP_CIPHER_get_nid:
  672|   200k|{
  673|   200k|    return (cipher == NULL) ? NID_undef : cipher->nid;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (673:12): [True: 0, False: 200k]
  ------------------
  674|   200k|}
EVP_CIPHER_get0_provider:
  728|   116k|{
  729|   116k|    return cipher->prov;
  730|   116k|}
EVP_MD_is_a:
  738|   338k|{
  739|   338k|    if (md == NULL)
  ------------------
  |  Branch (739:9): [True: 0, False: 338k]
  ------------------
  740|      0|        return 0;
  741|   338k|    if (md->prov != NULL)
  ------------------
  |  Branch (741:9): [True: 0, False: 338k]
  ------------------
  742|      0|        return evp_is_a(md->prov, md->name_id, NULL, name);
  743|   338k|    return evp_is_a(NULL, 0, EVP_MD_get0_name(md), name);
  744|   338k|}
EVP_MD_get0_name:
  763|   676k|{
  764|   676k|    if (md == NULL)
  ------------------
  |  Branch (764:9): [True: 0, False: 676k]
  ------------------
  765|      0|        return NULL;
  766|   676k|    if (md->type_name != NULL)
  ------------------
  |  Branch (766:9): [True: 0, False: 676k]
  ------------------
  767|      0|        return md->type_name;
  768|   676k|#ifndef FIPS_MODULE
  769|   676k|    return OBJ_nid2sn(EVP_MD_nid(md));
  ------------------
  |  |  554|   676k|#define EVP_MD_nid EVP_MD_get_type
  ------------------
  770|       |#else
  771|       |    return NULL;
  772|       |#endif
  773|   676k|}
EVP_MD_get0_provider:
  786|   360k|{
  787|   360k|    return md->prov;
  788|   360k|}
EVP_MD_get_type:
  791|  1.12M|{
  792|  1.12M|    return md->type;
  793|  1.12M|}
EVP_MD_get_size:
  810|   710k|{
  811|   710k|    if (md == NULL) {
  ------------------
  |  Branch (811:9): [True: 0, False: 710k]
  ------------------
  812|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_MESSAGE_DIGEST_IS_NULL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  813|      0|        return -1;
  814|      0|    }
  815|   710k|    return md->md_size;
  816|   710k|}
EVP_MD_xof:
  819|  9.28k|{
  820|  9.28k|    return md != NULL && ((EVP_MD_get_flags(md) & EVP_MD_FLAG_XOF) != 0);
  ------------------
  |  |  179|  9.28k|#define EVP_MD_FLAG_XOF 0x0002
  ------------------
  |  Branch (820:12): [True: 9.28k, False: 0]
  |  Branch (820:26): [True: 7.96k, False: 1.32k]
  ------------------
  821|  9.28k|}
EVP_MD_get_flags:
  824|  9.28k|{
  825|  9.28k|    return md->flags;
  826|  9.28k|}
evp_md_free_int:
  862|  17.0k|{
  863|  17.0k|    OPENSSL_free(md->type_name);
  ------------------
  |  |  131|  17.0k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  864|  17.0k|    ossl_provider_free(md->prov);
  865|  17.0k|    CRYPTO_FREE_REF(&md->refcnt);
  866|  17.0k|    OPENSSL_free(md);
  ------------------
  |  |  131|  17.0k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  867|  17.0k|}
EVP_MD_CTX_get0_md:
 1014|   374k|{
 1015|   374k|    if (ctx == NULL)
  ------------------
  |  Branch (1015:9): [True: 0, False: 374k]
  ------------------
 1016|      0|        return NULL;
 1017|   374k|    return ctx->reqdigest;
 1018|   374k|}
EVP_MD_CTX_get_size_ex:
 1033|   365k|{
 1034|   365k|    EVP_MD_CTX *c = (EVP_MD_CTX *)ctx;
 1035|   365k|    const OSSL_PARAM *gettables;
 1036|       |
 1037|   365k|    gettables = EVP_MD_CTX_gettable_params(c);
 1038|   365k|    if (gettables != NULL
  ------------------
  |  Branch (1038:9): [True: 0, False: 365k]
  ------------------
 1039|      0|        && OSSL_PARAM_locate_const(gettables,
  ------------------
  |  Branch (1039:12): [True: 0, False: 0]
  ------------------
 1040|      0|               OSSL_DIGEST_PARAM_SIZE)
  ------------------
  |  |  229|      0|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
 1041|      0|            != NULL) {
 1042|      0|        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
 1043|      0|        size_t sz = 0;
 1044|       |
 1045|       |        /*
 1046|       |         * For XOF's EVP_MD_get_size() returns 0
 1047|       |         * So try to get the xoflen instead. This will return -1 if the
 1048|       |         * xof length has not been set.
 1049|       |         */
 1050|      0|        params[0] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_SIZE, &sz);
  ------------------
  |  |  229|      0|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
 1051|      0|        if (EVP_MD_CTX_get_params(c, params) != 1
  ------------------
  |  Branch (1051:13): [True: 0, False: 0]
  ------------------
 1052|      0|            || sz > INT_MAX
  ------------------
  |  Branch (1052:16): [True: 0, False: 0]
  ------------------
 1053|      0|            || sz == 0)
  ------------------
  |  Branch (1053:16): [True: 0, False: 0]
  ------------------
 1054|      0|            return -1;
 1055|      0|        return (int)sz;
 1056|      0|    }
 1057|       |    /* Normal digests have a constant fixed size output */
 1058|   365k|    return EVP_MD_get_size(EVP_MD_CTX_get0_md(ctx));
 1059|   365k|}
EVP_MD_CTX_set_flags:
 1106|   702k|{
 1107|   702k|    ctx->flags |= flags;
 1108|   702k|}
EVP_MD_CTX_clear_flags:
 1111|   385k|{
 1112|   385k|    ctx->flags &= ~flags;
 1113|   385k|}
EVP_MD_CTX_test_flags:
 1116|   363k|{
 1117|   363k|    return (ctx->flags & flags);
 1118|   363k|}
EVP_PKEY_CTX_set_group_name:
 1155|  2.95k|{
 1156|  2.95k|    OSSL_PARAM params[] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  2.95k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  2.95k|    { NULL, 0, NULL, 0, 0 }
  ------------------
 1157|       |
 1158|  2.95k|    if (ctx == NULL || !EVP_PKEY_CTX_IS_GEN_OP(ctx)) {
  ------------------
  |  |  753|  2.95k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_GEN) != 0)
  |  |  ------------------
  |  |  |  | 1799|  2.95k|    (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1762|  2.95k|#define EVP_PKEY_OP_PARAMGEN (1 << 1)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1763|  2.95k|#define EVP_PKEY_OP_KEYGEN (1 << 2)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1158:9): [True: 0, False: 2.95k]
  |  Branch (1158:24): [True: 0, False: 2.95k]
  ------------------
 1159|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1160|       |        /* Uses the same return values as EVP_PKEY_CTX_ctrl */
 1161|      0|        return -2;
 1162|      0|    }
 1163|       |
 1164|  2.95k|    if (name == NULL)
  ------------------
  |  Branch (1164:9): [True: 0, False: 2.95k]
  ------------------
 1165|      0|        return -1;
 1166|       |
 1167|  2.95k|    params[0] = OSSL_PARAM_construct_utf8_string(OSSL_PKEY_PARAM_GROUP_NAME,
  ------------------
  |  |  420|  2.95k|# define OSSL_PKEY_PARAM_GROUP_NAME "group"
  ------------------
 1168|  2.95k|        (char *)name, 0);
 1169|  2.95k|    return EVP_PKEY_CTX_set_params(ctx, params);
 1170|  2.95k|}
EVP_PKEY_Q_keygen:
 1221|  2.65k|{
 1222|  2.65k|    va_list args;
 1223|  2.65k|    size_t bits;
 1224|  2.65k|    char *name;
 1225|  2.65k|    OSSL_PARAM params[] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  2.65k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  2.65k|    { NULL, 0, NULL, 0, 0 }
  ------------------
 1226|  2.65k|    EVP_PKEY *ret = NULL;
 1227|       |
 1228|  2.65k|    va_start(args, type);
 1229|       |
 1230|  2.65k|    if (OPENSSL_strcasecmp(type, "RSA") == 0) {
  ------------------
  |  Branch (1230:9): [True: 0, False: 2.65k]
  ------------------
 1231|      0|        bits = va_arg(args, size_t);
 1232|      0|        params[0] = OSSL_PARAM_construct_size_t(OSSL_PKEY_PARAM_RSA_BITS, &bits);
  ------------------
  |  |  442|      0|# define OSSL_PKEY_PARAM_RSA_BITS OSSL_PKEY_PARAM_BITS
  |  |  ------------------
  |  |  |  |  366|      0|# define OSSL_PKEY_PARAM_BITS "bits"
  |  |  ------------------
  ------------------
 1233|  2.65k|    } else if (OPENSSL_strcasecmp(type, "EC") == 0) {
  ------------------
  |  Branch (1233:16): [True: 0, False: 2.65k]
  ------------------
 1234|      0|        name = va_arg(args, char *);
 1235|      0|        params[0] = OSSL_PARAM_construct_utf8_string(OSSL_PKEY_PARAM_GROUP_NAME,
  ------------------
  |  |  420|      0|# define OSSL_PKEY_PARAM_GROUP_NAME "group"
  ------------------
 1236|      0|            name, 0);
 1237|      0|    }
 1238|       |
 1239|  2.65k|    ret = evp_pkey_keygen(libctx, type, propq, params);
 1240|       |
 1241|       |    va_end(args);
 1242|  2.65k|    return ret;
 1243|  2.65k|}
evp_lib.c:evp_pkey_keygen:
 1206|  2.65k|{
 1207|  2.65k|    EVP_PKEY *pkey = NULL;
 1208|  2.65k|    EVP_PKEY_CTX *ctx = EVP_PKEY_CTX_new_from_name(libctx, name, propq);
 1209|       |
 1210|  2.65k|    if (ctx != NULL
  ------------------
  |  Branch (1210:9): [True: 2.65k, False: 0]
  ------------------
 1211|  2.65k|        && EVP_PKEY_keygen_init(ctx) > 0
  ------------------
  |  Branch (1211:12): [True: 2.65k, False: 0]
  ------------------
 1212|  2.65k|        && EVP_PKEY_CTX_set_params(ctx, params))
  ------------------
  |  Branch (1212:12): [True: 2.65k, False: 0]
  ------------------
 1213|  2.65k|        (void)EVP_PKEY_generate(ctx, &pkey);
 1214|       |
 1215|  2.65k|    EVP_PKEY_CTX_free(ctx);
 1216|  2.65k|    return pkey;
 1217|  2.65k|}

EVP_PBE_cleanup:
  295|      1|{
  296|      1|    sk_EVP_PBE_CTL_pop_free(pbe_algs, free_evp_pbe_ctl);
  297|       |    pbe_algs = NULL;
  298|      1|}

EVP_PKEY_type:
   64|   625k|{
   65|   625k|#ifndef OPENSSL_NO_DEPRECATED_3_6
   66|   625k|    int ret;
   67|   625k|    const EVP_PKEY_ASN1_METHOD *ameth;
   68|   625k|    ENGINE *e;
   69|       |
   70|   625k|    ameth = EVP_PKEY_asn1_find(&e, type);
   71|   625k|    if (ameth)
  ------------------
  |  Branch (71:9): [True: 527k, False: 97.5k]
  ------------------
   72|   527k|        ret = ameth->pkey_id;
   73|  97.5k|    else
   74|  97.5k|        ret = NID_undef;
  ------------------
  |  |   18|  97.5k|#define NID_undef                       0
  ------------------
   75|   625k|#ifndef OPENSSL_NO_ENGINE
   76|   625k|    ENGINE_finish(e);
   77|   625k|#endif
   78|   625k|    return ret;
   79|       |#else
   80|       |    size_t i;
   81|       |
   82|       |    for (i = 0; i < OSSL_NELEM(base_id_conversion); i++) {
   83|       |        if (type == base_id_conversion[i].pkey_id)
   84|       |            return base_id_conversion[i].pkey_base_id;
   85|       |    }
   86|       |    return NID_undef;
   87|       |#endif
   88|   625k|}

EVP_RAND_enable_locking:
   95|    549|{
   96|    549|    if (rand->meth->enable_locking != NULL)
  ------------------
  |  Branch (96:9): [True: 549, False: 0]
  ------------------
   97|    549|        return rand->meth->enable_locking(rand->algctx);
   98|    549|    ERR_raise(ERR_LIB_EVP, EVP_R_LOCKING_NOT_SUPPORTED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   99|      0|    return 0;
  100|    549|}
EVP_RAND_fetch:
  284|  2.19k|{
  285|  2.19k|    return evp_generic_fetch(libctx, OSSL_OP_RAND, algorithm, properties,
  ------------------
  |  |  287|  2.19k|#define OSSL_OP_RAND 5
  ------------------
  286|  2.19k|        evp_rand_from_algorithm, evp_rand_up_ref,
  287|  2.19k|        evp_rand_free);
  288|  2.19k|}
EVP_RAND_up_ref:
  291|  2.19k|{
  292|  2.19k|    return evp_rand_up_ref(rand);
  293|  2.19k|}
EVP_RAND_free:
  296|  4.39k|{
  297|  4.39k|    evp_rand_free(rand);
  298|  4.39k|}
EVP_RAND_get0_provider:
  321|  3.29k|{
  322|  3.29k|    return rand->prov;
  323|  3.29k|}
EVP_RAND_CTX_up_ref:
  333|  1.64k|{
  334|  1.64k|    int ref = 0;
  335|       |
  336|  1.64k|    return CRYPTO_UP_REF(&ctx->refcnt, &ref);
  337|  1.64k|}
EVP_RAND_CTX_new:
  340|  2.19k|{
  341|  2.19k|    EVP_RAND_CTX *ctx;
  342|  2.19k|    void *parent_ctx = NULL;
  343|  2.19k|    const OSSL_DISPATCH *parent_dispatch = NULL;
  344|       |
  345|  2.19k|    if (rand == NULL) {
  ------------------
  |  Branch (345:9): [True: 0, False: 2.19k]
  ------------------
  346|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_NULL_ALGORITHM);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  347|      0|        return NULL;
  348|      0|    }
  349|       |
  350|  2.19k|    ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  108|  2.19k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  351|  2.19k|    if (ctx == NULL)
  ------------------
  |  Branch (351:9): [True: 0, False: 2.19k]
  ------------------
  352|      0|        return NULL;
  353|  2.19k|    if (!CRYPTO_NEW_REF(&ctx->refcnt, 1)) {
  ------------------
  |  Branch (353:9): [True: 0, False: 2.19k]
  ------------------
  354|      0|        OPENSSL_free(ctx);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  355|      0|        return NULL;
  356|      0|    }
  357|  2.19k|    if (parent != NULL) {
  ------------------
  |  Branch (357:9): [True: 1.64k, False: 549]
  ------------------
  358|  1.64k|        if (!EVP_RAND_CTX_up_ref(parent)) {
  ------------------
  |  Branch (358:13): [True: 0, False: 1.64k]
  ------------------
  359|      0|            ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  360|      0|            CRYPTO_FREE_REF(&ctx->refcnt);
  361|      0|            OPENSSL_free(ctx);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  362|      0|            return NULL;
  363|      0|        }
  364|  1.64k|        parent_ctx = parent->algctx;
  365|  1.64k|        parent_dispatch = parent->meth->dispatch;
  366|  1.64k|    }
  367|  2.19k|    if ((ctx->algctx = rand->newctx(ossl_provider_ctx(rand->prov), parent_ctx,
  ------------------
  |  Branch (367:9): [True: 0, False: 2.19k]
  ------------------
  368|  2.19k|             parent_dispatch))
  369|  2.19k|            == NULL
  370|  2.19k|        || !EVP_RAND_up_ref(rand)) {
  ------------------
  |  Branch (370:12): [True: 0, False: 2.19k]
  ------------------
  371|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  372|      0|        rand->freectx(ctx->algctx);
  373|      0|        CRYPTO_FREE_REF(&ctx->refcnt);
  374|      0|        OPENSSL_free(ctx);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  375|      0|        EVP_RAND_CTX_free(parent);
  376|      0|        return NULL;
  377|      0|    }
  378|  2.19k|    ctx->meth = rand;
  379|  2.19k|    ctx->parent = parent;
  380|  2.19k|    return ctx;
  381|  2.19k|}
EVP_RAND_CTX_free:
  384|  4.86k|{
  385|  4.86k|    int ref = 0;
  386|  4.86k|    EVP_RAND_CTX *parent;
  387|       |
  388|  4.86k|    if (ctx == NULL)
  ------------------
  |  Branch (388:9): [True: 1.02k, False: 3.84k]
  ------------------
  389|  1.02k|        return;
  390|       |
  391|  3.84k|    CRYPTO_DOWN_REF(&ctx->refcnt, &ref);
  392|  3.84k|    if (ref > 0)
  ------------------
  |  Branch (392:9): [True: 1.64k, False: 2.19k]
  ------------------
  393|  1.64k|        return;
  394|  2.19k|    parent = ctx->parent;
  395|  2.19k|    ctx->meth->freectx(ctx->algctx);
  396|  2.19k|    ctx->algctx = NULL;
  397|  2.19k|    EVP_RAND_free(ctx->meth);
  398|  2.19k|    CRYPTO_FREE_REF(&ctx->refcnt);
  399|  2.19k|    OPENSSL_free(ctx);
  ------------------
  |  |  131|  2.19k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  400|  2.19k|    EVP_RAND_CTX_free(parent);
  401|  2.19k|}
EVP_RAND_CTX_get_params:
  415|  14.4k|{
  416|  14.4k|    int res;
  417|       |
  418|  14.4k|    if (!evp_rand_lock(ctx))
  ------------------
  |  Branch (418:9): [True: 0, False: 14.4k]
  ------------------
  419|      0|        return 0;
  420|  14.4k|    res = evp_rand_get_ctx_params_locked(ctx, params);
  421|  14.4k|    evp_rand_unlock(ctx);
  422|  14.4k|    return res;
  423|  14.4k|}
EVP_RAND_CTX_settable_params:
  482|  1.64k|{
  483|  1.64k|    void *provctx;
  484|       |
  485|  1.64k|    if (ctx->meth->settable_ctx_params == NULL)
  ------------------
  |  Branch (485:9): [True: 0, False: 1.64k]
  ------------------
  486|      0|        return NULL;
  487|  1.64k|    provctx = ossl_provider_ctx(EVP_RAND_get0_provider(ctx->meth));
  488|  1.64k|    return ctx->meth->settable_ctx_params(ctx->algctx, provctx);
  489|  1.64k|}
EVP_RAND_instantiate:
  522|  2.19k|{
  523|  2.19k|    int res;
  524|       |
  525|  2.19k|    if (!evp_rand_lock(ctx))
  ------------------
  |  Branch (525:9): [True: 0, False: 2.19k]
  ------------------
  526|      0|        return 0;
  527|  2.19k|    res = evp_rand_instantiate_locked(ctx, strength, prediction_resistance,
  528|  2.19k|        pstr, pstr_len, params);
  529|  2.19k|    evp_rand_unlock(ctx);
  530|  2.19k|    return res;
  531|  2.19k|}
EVP_RAND_generate:
  584|  32.3k|{
  585|  32.3k|    int res;
  586|       |
  587|  32.3k|    if (!evp_rand_lock(ctx))
  ------------------
  |  Branch (587:9): [True: 0, False: 32.3k]
  ------------------
  588|      0|        return 0;
  589|  32.3k|    res = evp_rand_generate_locked(ctx, out, outlen, strength,
  590|  32.3k|        prediction_resistance, addin, addin_len);
  591|  32.3k|    evp_rand_unlock(ctx);
  592|  32.3k|    return res;
  593|  32.3k|}
EVP_RAND_get_state:
  668|  14.4k|{
  669|  14.4k|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  14.4k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  14.4k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  670|  14.4k|    int state;
  671|       |
  672|  14.4k|    params[0] = OSSL_PARAM_construct_int(OSSL_RAND_PARAM_STATE, &state);
  ------------------
  |  |  541|  14.4k|# define OSSL_RAND_PARAM_STATE "state"
  ------------------
  673|  14.4k|    if (!EVP_RAND_CTX_get_params(ctx, params))
  ------------------
  |  Branch (673:9): [True: 0, False: 14.4k]
  ------------------
  674|      0|        state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1347|      0|#define EVP_RAND_STATE_ERROR 2
  ------------------
  675|  14.4k|    return state;
  676|  14.4k|}
evp_rand.c:evp_rand_from_algorithm:
  120|  3.27k|{
  121|  3.27k|    const OSSL_DISPATCH *fns = algodef->implementation;
  122|  3.27k|    EVP_RAND *rand = NULL;
  123|  3.27k|    int fnrandcnt = 0, fnctxcnt = 0, fnlockcnt = 0, fnenablelockcnt = 0;
  124|       |#ifdef FIPS_MODULE
  125|       |    int fnzeroizecnt = 0;
  126|       |#endif
  127|       |
  128|  3.27k|    if ((rand = evp_rand_new()) == NULL) {
  ------------------
  |  Branch (128:9): [True: 0, False: 3.27k]
  ------------------
  129|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  130|      0|        return NULL;
  131|      0|    }
  132|  3.27k|    rand->name_id = name_id;
  133|  3.27k|    if ((rand->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 3.27k]
  ------------------
  134|      0|        evp_rand_free(rand);
  135|      0|        return NULL;
  136|      0|    }
  137|  3.27k|    rand->description = algodef->algorithm_description;
  138|  3.27k|    rand->dispatch = fns;
  139|  53.5k|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (139:12): [True: 50.2k, False: 3.27k]
  ------------------
  140|  50.2k|        switch (fns->function_id) {
  ------------------
  |  Branch (140:17): [True: 50.2k, False: 0]
  ------------------
  141|  3.27k|        case OSSL_FUNC_RAND_NEWCTX:
  ------------------
  |  |  535|  3.27k|#define OSSL_FUNC_RAND_NEWCTX 1
  ------------------
  |  Branch (141:9): [True: 3.27k, False: 46.9k]
  ------------------
  142|  3.27k|            if (rand->newctx != NULL)
  ------------------
  |  Branch (142:17): [True: 0, False: 3.27k]
  ------------------
  143|      0|                break;
  144|  3.27k|            rand->newctx = OSSL_FUNC_rand_newctx(fns);
  145|  3.27k|            fnctxcnt++;
  146|  3.27k|            break;
  147|  3.27k|        case OSSL_FUNC_RAND_FREECTX:
  ------------------
  |  |  536|  3.27k|#define OSSL_FUNC_RAND_FREECTX 2
  ------------------
  |  Branch (147:9): [True: 3.27k, False: 46.9k]
  ------------------
  148|  3.27k|            if (rand->freectx != NULL)
  ------------------
  |  Branch (148:17): [True: 0, False: 3.27k]
  ------------------
  149|      0|                break;
  150|  3.27k|            rand->freectx = OSSL_FUNC_rand_freectx(fns);
  151|  3.27k|            fnctxcnt++;
  152|  3.27k|            break;
  153|  3.27k|        case OSSL_FUNC_RAND_INSTANTIATE:
  ------------------
  |  |  537|  3.27k|#define OSSL_FUNC_RAND_INSTANTIATE 3
  ------------------
  |  Branch (153:9): [True: 3.27k, False: 46.9k]
  ------------------
  154|  3.27k|            if (rand->instantiate != NULL)
  ------------------
  |  Branch (154:17): [True: 0, False: 3.27k]
  ------------------
  155|      0|                break;
  156|  3.27k|            rand->instantiate = OSSL_FUNC_rand_instantiate(fns);
  157|  3.27k|            fnrandcnt++;
  158|  3.27k|            break;
  159|  3.27k|        case OSSL_FUNC_RAND_UNINSTANTIATE:
  ------------------
  |  |  538|  3.27k|#define OSSL_FUNC_RAND_UNINSTANTIATE 4
  ------------------
  |  Branch (159:9): [True: 3.27k, False: 46.9k]
  ------------------
  160|  3.27k|            if (rand->uninstantiate != NULL)
  ------------------
  |  Branch (160:17): [True: 0, False: 3.27k]
  ------------------
  161|      0|                break;
  162|  3.27k|            rand->uninstantiate = OSSL_FUNC_rand_uninstantiate(fns);
  163|  3.27k|            fnrandcnt++;
  164|  3.27k|            break;
  165|  3.27k|        case OSSL_FUNC_RAND_GENERATE:
  ------------------
  |  |  539|  3.27k|#define OSSL_FUNC_RAND_GENERATE 5
  ------------------
  |  Branch (165:9): [True: 3.27k, False: 46.9k]
  ------------------
  166|  3.27k|            if (rand->generate != NULL)
  ------------------
  |  Branch (166:17): [True: 0, False: 3.27k]
  ------------------
  167|      0|                break;
  168|  3.27k|            rand->generate = OSSL_FUNC_rand_generate(fns);
  169|  3.27k|            fnrandcnt++;
  170|  3.27k|            break;
  171|  3.27k|        case OSSL_FUNC_RAND_RESEED:
  ------------------
  |  |  540|  3.27k|#define OSSL_FUNC_RAND_RESEED 6
  ------------------
  |  Branch (171:9): [True: 3.27k, False: 46.9k]
  ------------------
  172|  3.27k|            if (rand->reseed != NULL)
  ------------------
  |  Branch (172:17): [True: 0, False: 3.27k]
  ------------------
  173|      0|                break;
  174|  3.27k|            rand->reseed = OSSL_FUNC_rand_reseed(fns);
  175|  3.27k|            break;
  176|    549|        case OSSL_FUNC_RAND_NONCE:
  ------------------
  |  |  541|    549|#define OSSL_FUNC_RAND_NONCE 7
  ------------------
  |  Branch (176:9): [True: 549, False: 49.6k]
  ------------------
  177|    549|            if (rand->nonce != NULL)
  ------------------
  |  Branch (177:17): [True: 0, False: 549]
  ------------------
  178|      0|                break;
  179|    549|            rand->nonce = OSSL_FUNC_rand_nonce(fns);
  180|    549|            break;
  181|  3.27k|        case OSSL_FUNC_RAND_ENABLE_LOCKING:
  ------------------
  |  |  542|  3.27k|#define OSSL_FUNC_RAND_ENABLE_LOCKING 8
  ------------------
  |  Branch (181:9): [True: 3.27k, False: 46.9k]
  ------------------
  182|  3.27k|            if (rand->enable_locking != NULL)
  ------------------
  |  Branch (182:17): [True: 0, False: 3.27k]
  ------------------
  183|      0|                break;
  184|  3.27k|            rand->enable_locking = OSSL_FUNC_rand_enable_locking(fns);
  185|  3.27k|            fnenablelockcnt++;
  186|  3.27k|            break;
  187|  3.27k|        case OSSL_FUNC_RAND_LOCK:
  ------------------
  |  |  543|  3.27k|#define OSSL_FUNC_RAND_LOCK 9
  ------------------
  |  Branch (187:9): [True: 3.27k, False: 46.9k]
  ------------------
  188|  3.27k|            if (rand->lock != NULL)
  ------------------
  |  Branch (188:17): [True: 0, False: 3.27k]
  ------------------
  189|      0|                break;
  190|  3.27k|            rand->lock = OSSL_FUNC_rand_lock(fns);
  191|  3.27k|            fnlockcnt++;
  192|  3.27k|            break;
  193|  3.27k|        case OSSL_FUNC_RAND_UNLOCK:
  ------------------
  |  |  544|  3.27k|#define OSSL_FUNC_RAND_UNLOCK 10
  ------------------
  |  Branch (193:9): [True: 3.27k, False: 46.9k]
  ------------------
  194|  3.27k|            if (rand->unlock != NULL)
  ------------------
  |  Branch (194:17): [True: 0, False: 3.27k]
  ------------------
  195|      0|                break;
  196|  3.27k|            rand->unlock = OSSL_FUNC_rand_unlock(fns);
  197|  3.27k|            fnlockcnt++;
  198|  3.27k|            break;
  199|      0|        case OSSL_FUNC_RAND_GETTABLE_PARAMS:
  ------------------
  |  |  545|      0|#define OSSL_FUNC_RAND_GETTABLE_PARAMS 11
  ------------------
  |  Branch (199:9): [True: 0, False: 50.2k]
  ------------------
  200|      0|            if (rand->gettable_params != NULL)
  ------------------
  |  Branch (200:17): [True: 0, False: 0]
  ------------------
  201|      0|                break;
  202|      0|            rand->gettable_params = OSSL_FUNC_rand_gettable_params(fns);
  203|      0|            break;
  204|  3.27k|        case OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  546|  3.27k|#define OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS 12
  ------------------
  |  Branch (204:9): [True: 3.27k, False: 46.9k]
  ------------------
  205|  3.27k|            if (rand->gettable_ctx_params != NULL)
  ------------------
  |  Branch (205:17): [True: 0, False: 3.27k]
  ------------------
  206|      0|                break;
  207|  3.27k|            rand->gettable_ctx_params = OSSL_FUNC_rand_gettable_ctx_params(fns);
  208|  3.27k|            break;
  209|  2.19k|        case OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  547|  2.19k|#define OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS 13
  ------------------
  |  Branch (209:9): [True: 2.19k, False: 48.0k]
  ------------------
  210|  2.19k|            if (rand->settable_ctx_params != NULL)
  ------------------
  |  Branch (210:17): [True: 0, False: 2.19k]
  ------------------
  211|      0|                break;
  212|  2.19k|            rand->settable_ctx_params = OSSL_FUNC_rand_settable_ctx_params(fns);
  213|  2.19k|            break;
  214|      0|        case OSSL_FUNC_RAND_GET_PARAMS:
  ------------------
  |  |  548|      0|#define OSSL_FUNC_RAND_GET_PARAMS 14
  ------------------
  |  Branch (214:9): [True: 0, False: 50.2k]
  ------------------
  215|      0|            if (rand->get_params != NULL)
  ------------------
  |  Branch (215:17): [True: 0, False: 0]
  ------------------
  216|      0|                break;
  217|      0|            rand->get_params = OSSL_FUNC_rand_get_params(fns);
  218|      0|            break;
  219|  3.27k|        case OSSL_FUNC_RAND_GET_CTX_PARAMS:
  ------------------
  |  |  549|  3.27k|#define OSSL_FUNC_RAND_GET_CTX_PARAMS 15
  ------------------
  |  Branch (219:9): [True: 3.27k, False: 46.9k]
  ------------------
  220|  3.27k|            if (rand->get_ctx_params != NULL)
  ------------------
  |  Branch (220:17): [True: 0, False: 3.27k]
  ------------------
  221|      0|                break;
  222|  3.27k|            rand->get_ctx_params = OSSL_FUNC_rand_get_ctx_params(fns);
  223|  3.27k|            fnctxcnt++;
  224|  3.27k|            break;
  225|  2.19k|        case OSSL_FUNC_RAND_SET_CTX_PARAMS:
  ------------------
  |  |  550|  2.19k|#define OSSL_FUNC_RAND_SET_CTX_PARAMS 16
  ------------------
  |  Branch (225:9): [True: 2.19k, False: 48.0k]
  ------------------
  226|  2.19k|            if (rand->set_ctx_params != NULL)
  ------------------
  |  Branch (226:17): [True: 0, False: 2.19k]
  ------------------
  227|      0|                break;
  228|  2.19k|            rand->set_ctx_params = OSSL_FUNC_rand_set_ctx_params(fns);
  229|  2.19k|            break;
  230|  3.27k|        case OSSL_FUNC_RAND_VERIFY_ZEROIZATION:
  ------------------
  |  |  551|  3.27k|#define OSSL_FUNC_RAND_VERIFY_ZEROIZATION 17
  ------------------
  |  Branch (230:9): [True: 3.27k, False: 46.9k]
  ------------------
  231|  3.27k|            if (rand->verify_zeroization != NULL)
  ------------------
  |  Branch (231:17): [True: 0, False: 3.27k]
  ------------------
  232|      0|                break;
  233|  3.27k|            rand->verify_zeroization = OSSL_FUNC_rand_verify_zeroization(fns);
  234|       |#ifdef FIPS_MODULE
  235|       |            fnzeroizecnt++;
  236|       |#endif
  237|  3.27k|            break;
  238|  3.27k|        case OSSL_FUNC_RAND_GET_SEED:
  ------------------
  |  |  552|  3.27k|#define OSSL_FUNC_RAND_GET_SEED 18
  ------------------
  |  Branch (238:9): [True: 3.27k, False: 46.9k]
  ------------------
  239|  3.27k|            if (rand->get_seed != NULL)
  ------------------
  |  Branch (239:17): [True: 0, False: 3.27k]
  ------------------
  240|      0|                break;
  241|  3.27k|            rand->get_seed = OSSL_FUNC_rand_get_seed(fns);
  242|  3.27k|            break;
  243|  2.72k|        case OSSL_FUNC_RAND_CLEAR_SEED:
  ------------------
  |  |  553|  2.72k|#define OSSL_FUNC_RAND_CLEAR_SEED 19
  ------------------
  |  Branch (243:9): [True: 2.72k, False: 47.5k]
  ------------------
  244|  2.72k|            if (rand->clear_seed != NULL)
  ------------------
  |  Branch (244:17): [True: 0, False: 2.72k]
  ------------------
  245|      0|                break;
  246|  2.72k|            rand->clear_seed = OSSL_FUNC_rand_clear_seed(fns);
  247|  2.72k|            break;
  248|  50.2k|        }
  249|  50.2k|    }
  250|       |    /*
  251|       |     * In order to be a consistent set of functions we must have at least
  252|       |     * a complete set of "rand" functions and a complete set of context
  253|       |     * management functions.  In FIPS mode, we also require the zeroization
  254|       |     * verification function.
  255|       |     *
  256|       |     * In addition, if locking can be enabled, we need a complete set of
  257|       |     * locking functions.
  258|       |     */
  259|  3.27k|    if (fnrandcnt != 3
  ------------------
  |  Branch (259:9): [True: 0, False: 3.27k]
  ------------------
  260|  3.27k|        || fnctxcnt != 3
  ------------------
  |  Branch (260:12): [True: 0, False: 3.27k]
  ------------------
  261|  3.27k|        || (fnenablelockcnt != 0 && fnenablelockcnt != 1)
  ------------------
  |  Branch (261:13): [True: 3.27k, False: 0]
  |  Branch (261:37): [True: 0, False: 3.27k]
  ------------------
  262|  3.27k|        || (fnlockcnt != 0 && fnlockcnt != 2)
  ------------------
  |  Branch (262:13): [True: 3.27k, False: 0]
  |  Branch (262:31): [True: 0, False: 3.27k]
  ------------------
  263|       |#ifdef FIPS_MODULE
  264|       |        || fnzeroizecnt != 1
  265|       |#endif
  266|  3.27k|    ) {
  267|      0|        evp_rand_free(rand);
  268|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  269|      0|        return NULL;
  270|      0|    }
  271|       |
  272|  3.27k|    if (prov != NULL && !ossl_provider_up_ref(prov)) {
  ------------------
  |  Branch (272:9): [True: 3.27k, False: 0]
  |  Branch (272:25): [True: 0, False: 3.27k]
  ------------------
  273|      0|        evp_rand_free(rand);
  274|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  275|      0|        return NULL;
  276|      0|    }
  277|  3.27k|    rand->prov = prov;
  278|       |
  279|  3.27k|    return rand;
  280|  3.27k|}
evp_rand.c:evp_rand_new:
   80|  3.27k|{
   81|  3.27k|    EVP_RAND *rand = OPENSSL_zalloc(sizeof(*rand));
  ------------------
  |  |  108|  3.27k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   82|       |
   83|  3.27k|    if (rand == NULL)
  ------------------
  |  Branch (83:9): [True: 0, False: 3.27k]
  ------------------
   84|      0|        return NULL;
   85|       |
   86|  3.27k|    if (!CRYPTO_NEW_REF(&rand->refcnt, 1)) {
  ------------------
  |  Branch (86:9): [True: 0, False: 3.27k]
  ------------------
   87|      0|        OPENSSL_free(rand);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   88|      0|        return NULL;
   89|      0|    }
   90|  3.27k|    return rand;
   91|  3.27k|}
evp_rand.c:evp_rand_up_ref:
   54|  8.76k|{
   55|  8.76k|    EVP_RAND *rand = (EVP_RAND *)vrand;
   56|  8.76k|    int ref = 0;
   57|       |
   58|  8.76k|    if (rand != NULL)
  ------------------
  |  Branch (58:9): [True: 8.76k, False: 0]
  ------------------
   59|  8.76k|        return CRYPTO_UP_REF(&rand->refcnt, &ref);
   60|      0|    return 1;
   61|  8.76k|}
evp_rand.c:evp_rand_free:
   64|  12.0k|{
   65|  12.0k|    EVP_RAND *rand = (EVP_RAND *)vrand;
   66|  12.0k|    int ref = 0;
   67|       |
   68|  12.0k|    if (rand == NULL)
  ------------------
  |  Branch (68:9): [True: 0, False: 12.0k]
  ------------------
   69|      0|        return;
   70|  12.0k|    CRYPTO_DOWN_REF(&rand->refcnt, &ref);
   71|  12.0k|    if (ref > 0)
  ------------------
  |  Branch (71:9): [True: 8.76k, False: 3.27k]
  ------------------
   72|  8.76k|        return;
   73|  3.27k|    OPENSSL_free(rand->type_name);
  ------------------
  |  |  131|  3.27k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   74|  3.27k|    ossl_provider_free(rand->prov);
   75|  3.27k|    CRYPTO_FREE_REF(&rand->refcnt);
   76|  3.27k|    OPENSSL_free(rand);
  ------------------
  |  |  131|  3.27k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|  3.27k|}
evp_rand.c:evp_rand_lock:
  104|  49.0k|{
  105|  49.0k|    if (rand->meth->lock != NULL)
  ------------------
  |  Branch (105:9): [True: 49.0k, False: 0]
  ------------------
  106|  49.0k|        return rand->meth->lock(rand->algctx);
  107|      0|    return 1;
  108|  49.0k|}
evp_rand.c:evp_rand_get_ctx_params_locked:
  410|  46.8k|{
  411|  46.8k|    return ctx->meth->get_ctx_params(ctx->algctx, params);
  412|  46.8k|}
evp_rand.c:evp_rand_unlock:
  112|  49.0k|{
  113|  49.0k|    if (rand->meth->unlock != NULL)
  ------------------
  |  Branch (113:9): [True: 49.0k, False: 0]
  ------------------
  114|  49.0k|        rand->meth->unlock(rand->algctx);
  115|  49.0k|}
evp_rand.c:evp_rand_instantiate_locked:
  513|  2.19k|{
  514|  2.19k|    return ctx->meth->instantiate(ctx->algctx, strength, prediction_resistance,
  515|  2.19k|        pstr, pstr_len, params);
  516|  2.19k|}
evp_rand.c:evp_rand_generate_locked:
  554|  32.3k|{
  555|  32.3k|    size_t chunk, max_request = 0;
  556|  32.3k|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  32.3k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  32.3k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  557|       |
  558|  32.3k|    params[0] = OSSL_PARAM_construct_size_t(OSSL_RAND_PARAM_MAX_REQUEST,
  ------------------
  |  |  540|  32.3k|# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
  ------------------
  559|  32.3k|        &max_request);
  560|  32.3k|    if (!evp_rand_get_ctx_params_locked(ctx, params)
  ------------------
  |  Branch (560:9): [True: 0, False: 32.3k]
  ------------------
  561|  32.3k|        || max_request == 0) {
  ------------------
  |  Branch (561:12): [True: 0, False: 32.3k]
  ------------------
  562|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  563|      0|        return 0;
  564|      0|    }
  565|  64.7k|    for (; outlen > 0; outlen -= chunk, out += chunk) {
  ------------------
  |  Branch (565:12): [True: 32.3k, False: 32.3k]
  ------------------
  566|  32.3k|        chunk = outlen > max_request ? max_request : outlen;
  ------------------
  |  Branch (566:17): [True: 0, False: 32.3k]
  ------------------
  567|  32.3k|        if (!ctx->meth->generate(ctx->algctx, out, chunk, strength,
  ------------------
  |  Branch (567:13): [True: 0, False: 32.3k]
  ------------------
  568|  32.3k|                prediction_resistance, addin, addin_len)) {
  569|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_GENERATE_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  570|      0|            return 0;
  571|      0|        }
  572|       |        /*
  573|       |         * Prediction resistance is only relevant the first time around,
  574|       |         * subsequently, the DRBG has already been properly reseeded.
  575|       |         */
  576|  32.3k|        prediction_resistance = 0;
  577|  32.3k|    }
  578|  32.3k|    return 1;
  579|  32.3k|}

EVP_KEYEXCH_free:
  162|  14.9k|{
  163|  14.9k|    int i;
  164|       |
  165|  14.9k|    if (exchange == NULL)
  ------------------
  |  Branch (165:9): [True: 0, False: 14.9k]
  ------------------
  166|      0|        return;
  167|  14.9k|    CRYPTO_DOWN_REF(&exchange->refcnt, &i);
  168|  14.9k|    if (i > 0)
  ------------------
  |  Branch (168:9): [True: 10.4k, False: 4.42k]
  ------------------
  169|  10.4k|        return;
  170|  4.42k|    OPENSSL_free(exchange->type_name);
  ------------------
  |  |  131|  4.42k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  171|  4.42k|    ossl_provider_free(exchange->prov);
  172|  4.42k|    CRYPTO_FREE_REF(&exchange->refcnt);
  173|  4.42k|    OPENSSL_free(exchange);
  ------------------
  |  |  131|  4.42k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  174|  4.42k|}
EVP_KEYEXCH_up_ref:
  177|  10.4k|{
  178|  10.4k|    int ref = 0;
  179|       |
  180|  10.4k|    CRYPTO_UP_REF(&exchange->refcnt, &ref);
  181|  10.4k|    return 1;
  182|  10.4k|}
EVP_KEYEXCH_fetch:
  191|  5.12k|{
  192|  5.12k|    return evp_generic_fetch(ctx, OSSL_OP_KEYEXCH, algorithm, properties,
  ------------------
  |  |  289|  5.12k|#define OSSL_OP_KEYEXCH 11
  ------------------
  193|  5.12k|        evp_keyexch_from_algorithm,
  194|  5.12k|        evp_keyexch_up_ref,
  195|  5.12k|        evp_keyexch_free);
  196|  5.12k|}
exchange.c:evp_keyexch_from_algorithm:
   53|  4.42k|{
   54|  4.42k|    const OSSL_DISPATCH *fns = algodef->implementation;
   55|  4.42k|    EVP_KEYEXCH *exchange = NULL;
   56|  4.42k|    int fncnt = 0, sparamfncnt = 0, gparamfncnt = 0, derive_found = 0;
   57|       |
   58|  4.42k|    if ((exchange = evp_keyexch_new(prov)) == NULL) {
  ------------------
  |  Branch (58:9): [True: 0, False: 4.42k]
  ------------------
   59|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   60|      0|        goto err;
   61|      0|    }
   62|       |
   63|  4.42k|    exchange->name_id = name_id;
   64|  4.42k|    if ((exchange->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
  ------------------
  |  Branch (64:9): [True: 0, False: 4.42k]
  ------------------
   65|      0|        goto err;
   66|  4.42k|    exchange->description = algodef->algorithm_description;
   67|       |
   68|  44.8k|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (68:12): [True: 40.4k, False: 4.42k]
  ------------------
   69|  40.4k|        switch (fns->function_id) {
  ------------------
  |  Branch (69:17): [True: 40.4k, False: 0]
  ------------------
   70|  4.42k|        case OSSL_FUNC_KEYEXCH_NEWCTX:
  ------------------
  |  |  761|  4.42k|#define OSSL_FUNC_KEYEXCH_NEWCTX 1
  ------------------
  |  Branch (70:9): [True: 4.42k, False: 36.0k]
  ------------------
   71|  4.42k|            if (exchange->newctx != NULL)
  ------------------
  |  Branch (71:17): [True: 0, False: 4.42k]
  ------------------
   72|      0|                break;
   73|  4.42k|            exchange->newctx = OSSL_FUNC_keyexch_newctx(fns);
   74|  4.42k|            fncnt++;
   75|  4.42k|            break;
   76|  4.42k|        case OSSL_FUNC_KEYEXCH_INIT:
  ------------------
  |  |  762|  4.42k|#define OSSL_FUNC_KEYEXCH_INIT 2
  ------------------
  |  Branch (76:9): [True: 4.42k, False: 36.0k]
  ------------------
   77|  4.42k|            if (exchange->init != NULL)
  ------------------
  |  Branch (77:17): [True: 0, False: 4.42k]
  ------------------
   78|      0|                break;
   79|  4.42k|            exchange->init = OSSL_FUNC_keyexch_init(fns);
   80|  4.42k|            fncnt++;
   81|  4.42k|            break;
   82|  2.52k|        case OSSL_FUNC_KEYEXCH_SET_PEER:
  ------------------
  |  |  764|  2.52k|#define OSSL_FUNC_KEYEXCH_SET_PEER 4
  ------------------
  |  Branch (82:9): [True: 2.52k, False: 37.9k]
  ------------------
   83|  2.52k|            if (exchange->set_peer != NULL)
  ------------------
  |  Branch (83:17): [True: 0, False: 2.52k]
  ------------------
   84|      0|                break;
   85|  2.52k|            exchange->set_peer = OSSL_FUNC_keyexch_set_peer(fns);
   86|  2.52k|            break;
   87|  4.42k|        case OSSL_FUNC_KEYEXCH_DERIVE:
  ------------------
  |  |  763|  4.42k|#define OSSL_FUNC_KEYEXCH_DERIVE 3
  ------------------
  |  Branch (87:9): [True: 4.42k, False: 36.0k]
  ------------------
   88|  4.42k|            if (exchange->derive != NULL)
  ------------------
  |  Branch (88:17): [True: 0, False: 4.42k]
  ------------------
   89|      0|                break;
   90|  4.42k|            exchange->derive = OSSL_FUNC_keyexch_derive(fns);
   91|  4.42k|            derive_found = 1;
   92|  4.42k|            break;
   93|  4.42k|        case OSSL_FUNC_KEYEXCH_FREECTX:
  ------------------
  |  |  765|  4.42k|#define OSSL_FUNC_KEYEXCH_FREECTX 5
  ------------------
  |  Branch (93:9): [True: 4.42k, False: 36.0k]
  ------------------
   94|  4.42k|            if (exchange->freectx != NULL)
  ------------------
  |  Branch (94:17): [True: 0, False: 4.42k]
  ------------------
   95|      0|                break;
   96|  4.42k|            exchange->freectx = OSSL_FUNC_keyexch_freectx(fns);
   97|  4.42k|            fncnt++;
   98|  4.42k|            break;
   99|  4.42k|        case OSSL_FUNC_KEYEXCH_DUPCTX:
  ------------------
  |  |  766|  4.42k|#define OSSL_FUNC_KEYEXCH_DUPCTX 6
  ------------------
  |  Branch (99:9): [True: 4.42k, False: 36.0k]
  ------------------
  100|  4.42k|            if (exchange->dupctx != NULL)
  ------------------
  |  Branch (100:17): [True: 0, False: 4.42k]
  ------------------
  101|      0|                break;
  102|  4.42k|            exchange->dupctx = OSSL_FUNC_keyexch_dupctx(fns);
  103|  4.42k|            break;
  104|  4.42k|        case OSSL_FUNC_KEYEXCH_GET_CTX_PARAMS:
  ------------------
  |  |  769|  4.42k|#define OSSL_FUNC_KEYEXCH_GET_CTX_PARAMS 9
  ------------------
  |  Branch (104:9): [True: 4.42k, False: 36.0k]
  ------------------
  105|  4.42k|            if (exchange->get_ctx_params != NULL)
  ------------------
  |  Branch (105:17): [True: 0, False: 4.42k]
  ------------------
  106|      0|                break;
  107|  4.42k|            exchange->get_ctx_params = OSSL_FUNC_keyexch_get_ctx_params(fns);
  108|  4.42k|            gparamfncnt++;
  109|  4.42k|            break;
  110|  4.42k|        case OSSL_FUNC_KEYEXCH_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  770|  4.42k|#define OSSL_FUNC_KEYEXCH_GETTABLE_CTX_PARAMS 10
  ------------------
  |  Branch (110:9): [True: 4.42k, False: 36.0k]
  ------------------
  111|  4.42k|            if (exchange->gettable_ctx_params != NULL)
  ------------------
  |  Branch (111:17): [True: 0, False: 4.42k]
  ------------------
  112|      0|                break;
  113|  4.42k|            exchange->gettable_ctx_params
  114|  4.42k|                = OSSL_FUNC_keyexch_gettable_ctx_params(fns);
  115|  4.42k|            gparamfncnt++;
  116|  4.42k|            break;
  117|  3.16k|        case OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS:
  ------------------
  |  |  767|  3.16k|#define OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS 7
  ------------------
  |  Branch (117:9): [True: 3.16k, False: 37.2k]
  ------------------
  118|  3.16k|            if (exchange->set_ctx_params != NULL)
  ------------------
  |  Branch (118:17): [True: 0, False: 3.16k]
  ------------------
  119|      0|                break;
  120|  3.16k|            exchange->set_ctx_params = OSSL_FUNC_keyexch_set_ctx_params(fns);
  121|  3.16k|            sparamfncnt++;
  122|  3.16k|            break;
  123|  3.16k|        case OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  768|  3.16k|#define OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS 8
  ------------------
  |  Branch (123:9): [True: 3.16k, False: 37.2k]
  ------------------
  124|  3.16k|            if (exchange->settable_ctx_params != NULL)
  ------------------
  |  Branch (124:17): [True: 0, False: 3.16k]
  ------------------
  125|      0|                break;
  126|  3.16k|            exchange->settable_ctx_params
  127|  3.16k|                = OSSL_FUNC_keyexch_settable_ctx_params(fns);
  128|  3.16k|            sparamfncnt++;
  129|  3.16k|            break;
  130|    632|        case OSSL_FUNC_KEYEXCH_DERIVE_SKEY:
  ------------------
  |  |  771|    632|#define OSSL_FUNC_KEYEXCH_DERIVE_SKEY 11
  ------------------
  |  Branch (130:9): [True: 632, False: 39.8k]
  ------------------
  131|    632|            if (exchange->derive_skey != NULL)
  ------------------
  |  Branch (131:17): [True: 0, False: 632]
  ------------------
  132|      0|                break;
  133|    632|            exchange->derive_skey = OSSL_FUNC_keyexch_derive_skey(fns);
  134|    632|            derive_found = 1;
  135|    632|            break;
  136|  40.4k|        }
  137|  40.4k|    }
  138|  4.42k|    fncnt += derive_found;
  139|  4.42k|    if (fncnt != 4
  ------------------
  |  Branch (139:9): [True: 0, False: 4.42k]
  ------------------
  140|  4.42k|        || (gparamfncnt != 0 && gparamfncnt != 2)
  ------------------
  |  Branch (140:13): [True: 4.42k, False: 0]
  |  Branch (140:33): [True: 0, False: 4.42k]
  ------------------
  141|  4.42k|        || (sparamfncnt != 0 && sparamfncnt != 2)) {
  ------------------
  |  Branch (141:13): [True: 3.16k, False: 1.26k]
  |  Branch (141:33): [True: 0, False: 3.16k]
  ------------------
  142|       |        /*
  143|       |         * In order to be a consistent set of functions we must have at least
  144|       |         * a complete set of "exchange" functions: init, derive, newctx,
  145|       |         * and freectx. The set_ctx_params and settable_ctx_params functions are
  146|       |         * optional, but if one of them is present then the other one must also
  147|       |         * be present. Same goes for get_ctx_params and gettable_ctx_params.
  148|       |         * The dupctx and set_peer functions are optional.
  149|       |         */
  150|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  151|      0|        goto err;
  152|      0|    }
  153|       |
  154|  4.42k|    return exchange;
  155|       |
  156|      0|err:
  157|      0|    EVP_KEYEXCH_free(exchange);
  158|       |    return NULL;
  159|  4.42k|}
exchange.c:evp_keyexch_new:
   33|  4.42k|{
   34|  4.42k|    EVP_KEYEXCH *exchange = OPENSSL_zalloc(sizeof(EVP_KEYEXCH));
  ------------------
  |  |  108|  4.42k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   35|       |
   36|  4.42k|    if (exchange == NULL)
  ------------------
  |  Branch (36:9): [True: 0, False: 4.42k]
  ------------------
   37|      0|        return NULL;
   38|       |
   39|  4.42k|    if (!CRYPTO_NEW_REF(&exchange->refcnt, 1)
  ------------------
  |  Branch (39:9): [True: 0, False: 4.42k]
  ------------------
   40|  4.42k|        || !ossl_provider_up_ref(prov)) {
  ------------------
  |  Branch (40:12): [True: 0, False: 4.42k]
  ------------------
   41|      0|        CRYPTO_FREE_REF(&exchange->refcnt);
   42|      0|        OPENSSL_free(exchange);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   43|      0|        return NULL;
   44|      0|    }
   45|  4.42k|    exchange->prov = prov;
   46|       |
   47|  4.42k|    return exchange;
   48|  4.42k|}
exchange.c:evp_keyexch_up_ref:
   28|  10.4k|{
   29|  10.4k|    return EVP_KEYEXCH_up_ref(data);
   30|  10.4k|}
exchange.c:evp_keyexch_free:
   23|  9.94k|{
   24|  9.94k|    EVP_KEYEXCH_free(data);
   25|  9.94k|}

evp_keymgmt_util_assign_pkey:
   62|   417k|{
   63|   417k|    if (pkey == NULL || keymgmt == NULL || keydata == NULL
  ------------------
  |  Branch (63:9): [True: 0, False: 417k]
  |  Branch (63:25): [True: 0, False: 417k]
  |  Branch (63:44): [True: 0, False: 417k]
  ------------------
   64|   417k|        || !EVP_PKEY_set_type_by_keymgmt(pkey, keymgmt)) {
  ------------------
  |  Branch (64:12): [True: 0, False: 417k]
  ------------------
   65|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   66|      0|        return 0;
   67|      0|    }
   68|   417k|    pkey->keydata = keydata;
   69|   417k|    evp_keymgmt_util_cache_keyinfo(pkey);
   70|   417k|    return 1;
   71|   417k|}
evp_keymgmt_util_make_pkey:
   74|   412k|{
   75|   412k|    EVP_PKEY *pkey = NULL;
   76|       |
   77|   412k|    if (keymgmt == NULL
  ------------------
  |  Branch (77:9): [True: 0, False: 412k]
  ------------------
   78|   412k|        || keydata == NULL
  ------------------
  |  Branch (78:12): [True: 0, False: 412k]
  ------------------
   79|   412k|        || (pkey = EVP_PKEY_new()) == NULL
  ------------------
  |  Branch (79:12): [True: 0, False: 412k]
  ------------------
   80|   412k|        || !evp_keymgmt_util_assign_pkey(pkey, keymgmt, keydata)) {
  ------------------
  |  Branch (80:12): [True: 0, False: 412k]
  ------------------
   81|      0|        EVP_PKEY_free(pkey);
   82|      0|        return NULL;
   83|      0|    }
   84|   412k|    return pkey;
   85|   412k|}
evp_keymgmt_util_export:
   89|  2.65k|{
   90|  2.65k|    if (pk == NULL || export_cb == NULL)
  ------------------
  |  Branch (90:9): [True: 0, False: 2.65k]
  |  Branch (90:23): [True: 0, False: 2.65k]
  ------------------
   91|      0|        return 0;
   92|  2.65k|    return evp_keymgmt_export(pk->keymgmt, pk->keydata, selection,
   93|  2.65k|        export_cb, export_cbarg);
   94|  2.65k|}
evp_keymgmt_util_clear_operation_cache:
  223|   832k|{
  224|   832k|    if (pk != NULL) {
  ------------------
  |  Branch (224:9): [True: 832k, False: 0]
  ------------------
  225|   832k|        sk_OP_CACHE_ELEM_pop_free(pk->operation_cache, op_cache_free);
  226|   832k|        pk->operation_cache = NULL;
  227|   832k|    }
  228|       |
  229|   832k|    return 1;
  230|   832k|}
evp_keymgmt_util_cache_keyinfo:
  290|   417k|{
  291|       |    /*
  292|       |     * Cache information about the provider "origin" key.
  293|       |     *
  294|       |     * This services functions like EVP_PKEY_get_size, EVP_PKEY_get_bits, etc
  295|       |     */
  296|   417k|    if (pk->keydata != NULL) {
  ------------------
  |  Branch (296:9): [True: 417k, False: 0]
  ------------------
  297|   417k|        int bits = 0;
  298|   417k|        int security_bits = 0;
  299|   417k|        int security_category = -1;
  300|   417k|        int size = 0;
  301|   417k|        OSSL_PARAM params[5];
  302|       |
  303|   417k|        params[0] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_BITS, &bits);
  ------------------
  |  |  366|   417k|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  304|   417k|        params[1] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_SECURITY_BITS,
  ------------------
  |  |  495|   417k|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  305|   417k|            &security_bits);
  306|   417k|        params[2] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_SECURITY_CATEGORY,
  ------------------
  |  |  496|   417k|# define OSSL_PKEY_PARAM_SECURITY_CATEGORY OSSL_ALG_PARAM_SECURITY_CATEGORY
  |  |  ------------------
  |  |  |  |  133|   417k|# define OSSL_ALG_PARAM_SECURITY_CATEGORY "security-category"
  |  |  ------------------
  ------------------
  307|   417k|            &security_category);
  308|   417k|        params[3] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_MAX_SIZE, &size);
  ------------------
  |  |  424|   417k|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  309|   417k|        params[4] = OSSL_PARAM_construct_end();
  310|   417k|        if (evp_keymgmt_get_params(pk->keymgmt, pk->keydata, params)) {
  ------------------
  |  Branch (310:13): [True: 417k, False: 0]
  ------------------
  311|   417k|            pk->cache.size = size;
  312|   417k|            pk->cache.bits = bits;
  313|   417k|            pk->cache.security_bits = security_bits;
  314|   417k|            pk->cache.security_category = security_category;
  315|   417k|        }
  316|   417k|    }
  317|   417k|}
evp_keymgmt_util_gen:
  517|  5.60k|{
  518|  5.60k|    void *keydata = NULL;
  519|       |
  520|  5.60k|    if ((keydata = evp_keymgmt_gen(keymgmt, genctx, cb, cbarg)) == NULL
  ------------------
  |  Branch (520:9): [True: 0, False: 5.60k]
  ------------------
  521|  5.60k|        || !evp_keymgmt_util_assign_pkey(target, keymgmt, keydata)) {
  ------------------
  |  Branch (521:12): [True: 0, False: 5.60k]
  ------------------
  522|      0|        evp_keymgmt_freedata(keymgmt, keydata);
  523|      0|        keydata = NULL;
  524|      0|    }
  525|       |
  526|  5.60k|    return keydata;
  527|  5.60k|}

EVP_KEYMGMT_fetch:
  279|   229k|{
  280|   229k|    return evp_generic_fetch(ctx, OSSL_OP_KEYMGMT, algorithm, properties,
  ------------------
  |  |  288|   229k|#define OSSL_OP_KEYMGMT 10
  ------------------
  281|   229k|        keymgmt_from_algorithm,
  282|   229k|        evp_keymgmt_up_ref,
  283|   229k|        evp_keymgmt_free);
  284|   229k|}
EVP_KEYMGMT_up_ref:
  287|  1.61M|{
  288|  1.61M|    int ref = 0;
  289|       |
  290|  1.61M|    CRYPTO_UP_REF(&keymgmt->refcnt, &ref);
  291|  1.61M|    return 1;
  292|  1.61M|}
EVP_KEYMGMT_free:
  295|  1.64M|{
  296|  1.64M|    int ref = 0;
  297|       |
  298|  1.64M|    if (keymgmt == NULL)
  ------------------
  |  Branch (298:9): [True: 0, False: 1.64M]
  ------------------
  299|      0|        return;
  300|       |
  301|  1.64M|    CRYPTO_DOWN_REF(&keymgmt->refcnt, &ref);
  302|  1.64M|    if (ref > 0)
  ------------------
  |  Branch (302:9): [True: 1.61M, False: 25.2k]
  ------------------
  303|  1.61M|        return;
  304|  25.2k|    OPENSSL_free(keymgmt->type_name);
  ------------------
  |  |  131|  25.2k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  305|  25.2k|    ossl_provider_free(keymgmt->prov);
  306|  25.2k|    CRYPTO_FREE_REF(&keymgmt->refcnt);
  307|  25.2k|    OPENSSL_free(keymgmt);
  ------------------
  |  |  131|  25.2k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  308|  25.2k|}
EVP_KEYMGMT_get0_provider:
  311|   425k|{
  312|   425k|    return keymgmt->prov;
  313|   425k|}
evp_keymgmt_get_legacy_alg:
  321|  70.0k|{
  322|  70.0k|    return keymgmt->legacy_alg;
  323|  70.0k|}
EVP_KEYMGMT_is_a:
  336|   750k|{
  337|   750k|    return keymgmt != NULL
  ------------------
  |  Branch (337:12): [True: 750k, False: 0]
  ------------------
  338|   750k|        && evp_is_a(keymgmt->prov, keymgmt->name_id, NULL, name);
  ------------------
  |  Branch (338:12): [True: 750k, False: 0]
  ------------------
  339|   750k|}
EVP_KEYMGMT_do_all_provided:
  344|      2|{
  345|      2|    evp_generic_do_all(libctx, OSSL_OP_KEYMGMT,
  ------------------
  |  |  288|      2|#define OSSL_OP_KEYMGMT 10
  ------------------
  346|      2|        (void (*)(void *, void *))fn, arg,
  347|      2|        keymgmt_from_algorithm,
  348|      2|        evp_keymgmt_up_ref,
  349|      2|        evp_keymgmt_free);
  350|      2|}
EVP_KEYMGMT_names_do_all:
  355|   443k|{
  356|   443k|    if (keymgmt->prov != NULL)
  ------------------
  |  Branch (356:9): [True: 443k, False: 0]
  ------------------
  357|   443k|        return evp_names_do_all(keymgmt->prov, keymgmt->name_id, fn, data);
  358|       |
  359|      0|    return 1;
  360|   443k|}
evp_keymgmt_freedata:
  380|   417k|{
  381|       |    /* This is mandatory, no need to check for its presence */
  382|   417k|    keymgmt->free(keydata);
  383|   417k|}
evp_keymgmt_gen_init:
  387|  5.60k|{
  388|  5.60k|    void *provctx = ossl_provider_ctx(EVP_KEYMGMT_get0_provider(keymgmt));
  389|       |
  390|  5.60k|    if (keymgmt->gen_init == NULL)
  ------------------
  |  Branch (390:9): [True: 0, False: 5.60k]
  ------------------
  391|      0|        return NULL;
  392|  5.60k|    return keymgmt->gen_init(provctx, selection, params);
  393|  5.60k|}
evp_keymgmt_gen_set_params:
  411|  5.60k|{
  412|  5.60k|    if (keymgmt->gen_set_params == NULL)
  ------------------
  |  Branch (412:9): [True: 0, False: 5.60k]
  ------------------
  413|      0|        return 0;
  414|  5.60k|    return keymgmt->gen_set_params(genctx, params);
  415|  5.60k|}
evp_keymgmt_gen:
  445|  5.60k|{
  446|  5.60k|    void *ret;
  447|  5.60k|    const char *desc = keymgmt->description != NULL ? keymgmt->description : "";
  ------------------
  |  Branch (447:24): [True: 5.60k, False: 0]
  ------------------
  448|       |
  449|  5.60k|    if (keymgmt->gen == NULL) {
  ------------------
  |  Branch (449:9): [True: 0, False: 5.60k]
  ------------------
  450|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_KEYMGMT_NOT_SUPPORTED,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_KEYMGMT_NOT_SUPPORTED,
  ------------------
  |  |   78|      0|#define ERR_LIB_EVP 6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_KEYMGMT_NOT_SUPPORTED,
  ------------------
  |  |  108|      0|#define EVP_R_PROVIDER_KEYMGMT_NOT_SUPPORTED 236
  ------------------
  451|      0|            "%s key generation:%s", keymgmt->type_name, desc);
  452|      0|        return NULL;
  453|      0|    }
  454|       |
  455|  5.60k|    ERR_set_mark();
  456|  5.60k|    ret = keymgmt->gen(genctx, cb, cbarg);
  457|  5.60k|    if (ret == NULL && ERR_count_to_mark() == 0)
  ------------------
  |  Branch (457:9): [True: 0, False: 5.60k]
  |  Branch (457:24): [True: 0, False: 0]
  ------------------
  458|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_KEYMGMT_FAILURE,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_KEYMGMT_FAILURE,
  ------------------
  |  |   78|      0|#define ERR_LIB_EVP 6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_KEYMGMT_FAILURE,
  ------------------
  |  |  107|      0|#define EVP_R_PROVIDER_KEYMGMT_FAILURE 233
  ------------------
  459|      0|            "%s key generation:%s", keymgmt->type_name, desc);
  460|  5.60k|    ERR_clear_last_mark();
  461|  5.60k|    return ret;
  462|  5.60k|}
evp_keymgmt_gen_cleanup:
  465|  5.60k|{
  466|  5.60k|    if (keymgmt->gen_cleanup != NULL)
  ------------------
  |  Branch (466:9): [True: 5.60k, False: 0]
  ------------------
  467|  5.60k|        keymgmt->gen_cleanup(genctx);
  468|  5.60k|}
evp_keymgmt_has_load:
  471|   824k|{
  472|   824k|    return keymgmt != NULL && keymgmt->load != NULL;
  ------------------
  |  Branch (472:12): [True: 824k, False: 0]
  |  Branch (472:31): [True: 824k, False: 0]
  ------------------
  473|   824k|}
evp_keymgmt_load:
  477|   412k|{
  478|   412k|    if (evp_keymgmt_has_load(keymgmt))
  ------------------
  |  Branch (478:9): [True: 412k, False: 0]
  ------------------
  479|   412k|        return keymgmt->load(objref, objref_sz);
  480|      0|    return NULL;
  481|   412k|}
evp_keymgmt_get_params:
  485|   423k|{
  486|   423k|    if (keymgmt->get_params == NULL)
  ------------------
  |  Branch (486:9): [True: 0, False: 423k]
  ------------------
  487|      0|        return 1;
  488|   423k|    return keymgmt->get_params(keydata, params);
  489|   423k|}
evp_keymgmt_export:
  564|  2.65k|{
  565|  2.65k|    if (keymgmt->export == NULL)
  ------------------
  |  Branch (565:9): [True: 0, False: 2.65k]
  ------------------
  566|      0|        return 0;
  567|  2.65k|    return keymgmt->export(keydata, selection, param_cb, cbarg);
  568|  2.65k|}
keymgmt_meth.c:keymgmt_from_algorithm:
   66|  25.2k|{
   67|  25.2k|    const OSSL_DISPATCH *fns = algodef->implementation;
   68|  25.2k|    EVP_KEYMGMT *keymgmt = NULL;
   69|  25.2k|    int setparamfncnt = 0, getparamfncnt = 0;
   70|  25.2k|    int setgenparamfncnt = 0;
   71|  25.2k|    int importfncnt = 0, exportfncnt = 0;
   72|  25.2k|    int importtypesfncnt = 0, exporttypesfncnt = 0;
   73|  25.2k|    int getgenparamfncnt = 0;
   74|       |
   75|  25.2k|    if ((keymgmt = keymgmt_new()) == NULL)
  ------------------
  |  Branch (75:9): [True: 0, False: 25.2k]
  ------------------
   76|      0|        return NULL;
   77|       |
   78|  25.2k|    keymgmt->name_id = name_id;
   79|  25.2k|    if ((keymgmt->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (79:9): [True: 0, False: 25.2k]
  ------------------
   80|      0|        EVP_KEYMGMT_free(keymgmt);
   81|      0|        return NULL;
   82|      0|    }
   83|  25.2k|    keymgmt->description = algodef->algorithm_description;
   84|       |
   85|   471k|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (85:12): [True: 446k, False: 25.2k]
  ------------------
   86|   446k|        switch (fns->function_id) {
  ------------------
  |  Branch (86:17): [True: 446k, False: 0]
  ------------------
   87|  25.2k|        case OSSL_FUNC_KEYMGMT_NEW:
  ------------------
  |  |  658|  25.2k|#define OSSL_FUNC_KEYMGMT_NEW 1
  ------------------
  |  Branch (87:9): [True: 25.2k, False: 420k]
  ------------------
   88|  25.2k|            if (keymgmt->new == NULL)
  ------------------
  |  Branch (88:17): [True: 25.2k, False: 0]
  ------------------
   89|  25.2k|                keymgmt->new = OSSL_FUNC_keymgmt_new(fns);
   90|  25.2k|            break;
   91|  23.3k|        case OSSL_FUNC_KEYMGMT_GEN_INIT:
  ------------------
  |  |  662|  23.3k|#define OSSL_FUNC_KEYMGMT_GEN_INIT 2
  ------------------
  |  Branch (91:9): [True: 23.3k, False: 422k]
  ------------------
   92|  23.3k|            if (keymgmt->gen_init == NULL)
  ------------------
  |  Branch (92:17): [True: 23.3k, False: 0]
  ------------------
   93|  23.3k|                keymgmt->gen_init = OSSL_FUNC_keymgmt_gen_init(fns);
   94|  23.3k|            break;
   95|  3.16k|        case OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE:
  ------------------
  |  |  663|  3.16k|#define OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE 3
  ------------------
  |  Branch (95:9): [True: 3.16k, False: 443k]
  ------------------
   96|  3.16k|            if (keymgmt->gen_set_template == NULL)
  ------------------
  |  Branch (96:17): [True: 3.16k, False: 0]
  ------------------
   97|  3.16k|                keymgmt->gen_set_template = OSSL_FUNC_keymgmt_gen_set_template(fns);
   98|  3.16k|            break;
   99|  23.3k|        case OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS:
  ------------------
  |  |  664|  23.3k|#define OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS 4
  ------------------
  |  Branch (99:9): [True: 23.3k, False: 422k]
  ------------------
  100|  23.3k|            if (keymgmt->gen_set_params == NULL) {
  ------------------
  |  Branch (100:17): [True: 23.3k, False: 0]
  ------------------
  101|  23.3k|                setgenparamfncnt++;
  102|  23.3k|                keymgmt->gen_set_params = OSSL_FUNC_keymgmt_gen_set_params(fns);
  103|  23.3k|            }
  104|  23.3k|            break;
  105|  23.3k|        case OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS:
  ------------------
  |  |  665|  23.3k|#define OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS 5
  ------------------
  |  Branch (105:9): [True: 23.3k, False: 422k]
  ------------------
  106|  23.3k|            if (keymgmt->gen_settable_params == NULL) {
  ------------------
  |  Branch (106:17): [True: 23.3k, False: 0]
  ------------------
  107|  23.3k|                setgenparamfncnt++;
  108|  23.3k|                keymgmt->gen_settable_params = OSSL_FUNC_keymgmt_gen_settable_params(fns);
  109|  23.3k|            }
  110|  23.3k|            break;
  111|  1.26k|        case OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS:
  ------------------
  |  |  668|  1.26k|#define OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS 15
  ------------------
  |  Branch (111:9): [True: 1.26k, False: 444k]
  ------------------
  112|  1.26k|            if (keymgmt->gen_get_params == NULL) {
  ------------------
  |  Branch (112:17): [True: 1.26k, False: 0]
  ------------------
  113|  1.26k|                getgenparamfncnt++;
  114|  1.26k|                keymgmt->gen_get_params = OSSL_FUNC_keymgmt_gen_get_params(fns);
  115|  1.26k|            }
  116|  1.26k|            break;
  117|  1.26k|        case OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS:
  ------------------
  |  |  669|  1.26k|#define OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS 16
  ------------------
  |  Branch (117:9): [True: 1.26k, False: 444k]
  ------------------
  118|  1.26k|            if (keymgmt->gen_gettable_params == NULL) {
  ------------------
  |  Branch (118:17): [True: 1.26k, False: 0]
  ------------------
  119|  1.26k|                getgenparamfncnt++;
  120|  1.26k|                keymgmt->gen_gettable_params = OSSL_FUNC_keymgmt_gen_gettable_params(fns);
  121|  1.26k|            }
  122|  1.26k|            break;
  123|  23.3k|        case OSSL_FUNC_KEYMGMT_GEN:
  ------------------
  |  |  666|  23.3k|#define OSSL_FUNC_KEYMGMT_GEN 6
  ------------------
  |  Branch (123:9): [True: 23.3k, False: 422k]
  ------------------
  124|  23.3k|            if (keymgmt->gen == NULL)
  ------------------
  |  Branch (124:17): [True: 23.3k, False: 0]
  ------------------
  125|  23.3k|                keymgmt->gen = OSSL_FUNC_keymgmt_gen(fns);
  126|  23.3k|            break;
  127|  23.3k|        case OSSL_FUNC_KEYMGMT_GEN_CLEANUP:
  ------------------
  |  |  667|  23.3k|#define OSSL_FUNC_KEYMGMT_GEN_CLEANUP 7
  ------------------
  |  Branch (127:9): [True: 23.3k, False: 422k]
  ------------------
  128|  23.3k|            if (keymgmt->gen_cleanup == NULL)
  ------------------
  |  Branch (128:17): [True: 23.3k, False: 0]
  ------------------
  129|  23.3k|                keymgmt->gen_cleanup = OSSL_FUNC_keymgmt_gen_cleanup(fns);
  130|  23.3k|            break;
  131|  25.2k|        case OSSL_FUNC_KEYMGMT_FREE:
  ------------------
  |  |  694|  25.2k|#define OSSL_FUNC_KEYMGMT_FREE 10
  ------------------
  |  Branch (131:9): [True: 25.2k, False: 420k]
  ------------------
  132|  25.2k|            if (keymgmt->free == NULL)
  ------------------
  |  Branch (132:17): [True: 25.2k, False: 0]
  ------------------
  133|  25.2k|                keymgmt->free = OSSL_FUNC_keymgmt_free(fns);
  134|  25.2k|            break;
  135|  18.3k|        case OSSL_FUNC_KEYMGMT_LOAD:
  ------------------
  |  |  689|  18.3k|#define OSSL_FUNC_KEYMGMT_LOAD 8
  ------------------
  |  Branch (135:9): [True: 18.3k, False: 427k]
  ------------------
  136|  18.3k|            if (keymgmt->load == NULL)
  ------------------
  |  Branch (136:17): [True: 18.3k, False: 0]
  ------------------
  137|  18.3k|                keymgmt->load = OSSL_FUNC_keymgmt_load(fns);
  138|  18.3k|            break;
  139|  23.3k|        case OSSL_FUNC_KEYMGMT_GET_PARAMS:
  ------------------
  |  |  698|  23.3k|#define OSSL_FUNC_KEYMGMT_GET_PARAMS 11
  ------------------
  |  Branch (139:9): [True: 23.3k, False: 422k]
  ------------------
  140|  23.3k|            if (keymgmt->get_params == NULL) {
  ------------------
  |  Branch (140:17): [True: 23.3k, False: 0]
  ------------------
  141|  23.3k|                getparamfncnt++;
  142|  23.3k|                keymgmt->get_params = OSSL_FUNC_keymgmt_get_params(fns);
  143|  23.3k|            }
  144|  23.3k|            break;
  145|  23.3k|        case OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS:
  ------------------
  |  |  699|  23.3k|#define OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS 12
  ------------------
  |  Branch (145:9): [True: 23.3k, False: 422k]
  ------------------
  146|  23.3k|            if (keymgmt->gettable_params == NULL) {
  ------------------
  |  Branch (146:17): [True: 23.3k, False: 0]
  ------------------
  147|  23.3k|                getparamfncnt++;
  148|  23.3k|                keymgmt->gettable_params = OSSL_FUNC_keymgmt_gettable_params(fns);
  149|  23.3k|            }
  150|  23.3k|            break;
  151|  12.0k|        case OSSL_FUNC_KEYMGMT_SET_PARAMS:
  ------------------
  |  |  705|  12.0k|#define OSSL_FUNC_KEYMGMT_SET_PARAMS 13
  ------------------
  |  Branch (151:9): [True: 12.0k, False: 434k]
  ------------------
  152|  12.0k|            if (keymgmt->set_params == NULL) {
  ------------------
  |  Branch (152:17): [True: 12.0k, False: 0]
  ------------------
  153|  12.0k|                setparamfncnt++;
  154|  12.0k|                keymgmt->set_params = OSSL_FUNC_keymgmt_set_params(fns);
  155|  12.0k|            }
  156|  12.0k|            break;
  157|  12.0k|        case OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS:
  ------------------
  |  |  706|  12.0k|#define OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS 14
  ------------------
  |  Branch (157:9): [True: 12.0k, False: 434k]
  ------------------
  158|  12.0k|            if (keymgmt->settable_params == NULL) {
  ------------------
  |  Branch (158:17): [True: 12.0k, False: 0]
  ------------------
  159|  12.0k|                setparamfncnt++;
  160|  12.0k|                keymgmt->settable_params = OSSL_FUNC_keymgmt_settable_params(fns);
  161|  12.0k|            }
  162|  12.0k|            break;
  163|  2.52k|        case OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME:
  ------------------
  |  |  713|  2.52k|#define OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME 20
  ------------------
  |  Branch (163:9): [True: 2.52k, False: 443k]
  ------------------
  164|  2.52k|            if (keymgmt->query_operation_name == NULL)
  ------------------
  |  Branch (164:17): [True: 2.52k, False: 0]
  ------------------
  165|  2.52k|                keymgmt->query_operation_name = OSSL_FUNC_keymgmt_query_operation_name(fns);
  166|  2.52k|            break;
  167|  25.2k|        case OSSL_FUNC_KEYMGMT_HAS:
  ------------------
  |  |  718|  25.2k|#define OSSL_FUNC_KEYMGMT_HAS 21
  ------------------
  |  Branch (167:9): [True: 25.2k, False: 420k]
  ------------------
  168|  25.2k|            if (keymgmt->has == NULL)
  ------------------
  |  Branch (168:17): [True: 25.2k, False: 0]
  ------------------
  169|  25.2k|                keymgmt->has = OSSL_FUNC_keymgmt_has(fns);
  170|  25.2k|            break;
  171|  20.8k|        case OSSL_FUNC_KEYMGMT_DUP:
  ------------------
  |  |  747|  20.8k|#define OSSL_FUNC_KEYMGMT_DUP 44
  ------------------
  |  Branch (171:9): [True: 20.8k, False: 425k]
  ------------------
  172|  20.8k|            if (keymgmt->dup == NULL)
  ------------------
  |  Branch (172:17): [True: 20.8k, False: 0]
  ------------------
  173|  20.8k|                keymgmt->dup = OSSL_FUNC_keymgmt_dup(fns);
  174|  20.8k|            break;
  175|  18.3k|        case OSSL_FUNC_KEYMGMT_VALIDATE:
  ------------------
  |  |  722|  18.3k|#define OSSL_FUNC_KEYMGMT_VALIDATE 22
  ------------------
  |  Branch (175:9): [True: 18.3k, False: 427k]
  ------------------
  176|  18.3k|            if (keymgmt->validate == NULL)
  ------------------
  |  Branch (176:17): [True: 18.3k, False: 0]
  ------------------
  177|  18.3k|                keymgmt->validate = OSSL_FUNC_keymgmt_validate(fns);
  178|  18.3k|            break;
  179|  23.3k|        case OSSL_FUNC_KEYMGMT_MATCH:
  ------------------
  |  |  726|  23.3k|#define OSSL_FUNC_KEYMGMT_MATCH 23
  ------------------
  |  Branch (179:9): [True: 23.3k, False: 422k]
  ------------------
  180|  23.3k|            if (keymgmt->match == NULL)
  ------------------
  |  Branch (180:17): [True: 23.3k, False: 0]
  ------------------
  181|  23.3k|                keymgmt->match = OSSL_FUNC_keymgmt_match(fns);
  182|  23.3k|            break;
  183|  23.3k|        case OSSL_FUNC_KEYMGMT_IMPORT:
  ------------------
  |  |  732|  23.3k|#define OSSL_FUNC_KEYMGMT_IMPORT 40
  ------------------
  |  Branch (183:9): [True: 23.3k, False: 422k]
  ------------------
  184|  23.3k|            if (keymgmt->import == NULL) {
  ------------------
  |  Branch (184:17): [True: 23.3k, False: 0]
  ------------------
  185|  23.3k|                importfncnt++;
  186|  23.3k|                keymgmt->import = OSSL_FUNC_keymgmt_import(fns);
  187|  23.3k|            }
  188|  23.3k|            break;
  189|  23.3k|        case OSSL_FUNC_KEYMGMT_IMPORT_TYPES:
  ------------------
  |  |  733|  23.3k|#define OSSL_FUNC_KEYMGMT_IMPORT_TYPES 41
  ------------------
  |  Branch (189:9): [True: 23.3k, False: 422k]
  ------------------
  190|  23.3k|            if (keymgmt->import_types == NULL) {
  ------------------
  |  Branch (190:17): [True: 23.3k, False: 0]
  ------------------
  191|  23.3k|                if (importtypesfncnt == 0)
  ------------------
  |  Branch (191:21): [True: 23.3k, False: 0]
  ------------------
  192|  23.3k|                    importfncnt++;
  193|  23.3k|                importtypesfncnt++;
  194|  23.3k|                keymgmt->import_types = OSSL_FUNC_keymgmt_import_types(fns);
  195|  23.3k|            }
  196|  23.3k|            break;
  197|      0|        case OSSL_FUNC_KEYMGMT_IMPORT_TYPES_EX:
  ------------------
  |  |  752|      0|#define OSSL_FUNC_KEYMGMT_IMPORT_TYPES_EX 45
  ------------------
  |  Branch (197:9): [True: 0, False: 446k]
  ------------------
  198|      0|            if (keymgmt->import_types_ex == NULL) {
  ------------------
  |  Branch (198:17): [True: 0, False: 0]
  ------------------
  199|      0|                if (importtypesfncnt == 0)
  ------------------
  |  Branch (199:21): [True: 0, False: 0]
  ------------------
  200|      0|                    importfncnt++;
  201|      0|                importtypesfncnt++;
  202|      0|                keymgmt->import_types_ex = OSSL_FUNC_keymgmt_import_types_ex(fns);
  203|      0|            }
  204|      0|            break;
  205|  23.3k|        case OSSL_FUNC_KEYMGMT_EXPORT:
  ------------------
  |  |  734|  23.3k|#define OSSL_FUNC_KEYMGMT_EXPORT 42
  ------------------
  |  Branch (205:9): [True: 23.3k, False: 422k]
  ------------------
  206|  23.3k|            if (keymgmt->export == NULL) {
  ------------------
  |  Branch (206:17): [True: 23.3k, False: 0]
  ------------------
  207|  23.3k|                exportfncnt++;
  208|  23.3k|                keymgmt->export = OSSL_FUNC_keymgmt_export(fns);
  209|  23.3k|            }
  210|  23.3k|            break;
  211|  23.3k|        case OSSL_FUNC_KEYMGMT_EXPORT_TYPES:
  ------------------
  |  |  735|  23.3k|#define OSSL_FUNC_KEYMGMT_EXPORT_TYPES 43
  ------------------
  |  Branch (211:9): [True: 23.3k, False: 422k]
  ------------------
  212|  23.3k|            if (keymgmt->export_types == NULL) {
  ------------------
  |  Branch (212:17): [True: 23.3k, False: 0]
  ------------------
  213|  23.3k|                if (exporttypesfncnt == 0)
  ------------------
  |  Branch (213:21): [True: 23.3k, False: 0]
  ------------------
  214|  23.3k|                    exportfncnt++;
  215|  23.3k|                exporttypesfncnt++;
  216|  23.3k|                keymgmt->export_types = OSSL_FUNC_keymgmt_export_types(fns);
  217|  23.3k|            }
  218|  23.3k|            break;
  219|      0|        case OSSL_FUNC_KEYMGMT_EXPORT_TYPES_EX:
  ------------------
  |  |  753|      0|#define OSSL_FUNC_KEYMGMT_EXPORT_TYPES_EX 46
  ------------------
  |  Branch (219:9): [True: 0, False: 446k]
  ------------------
  220|      0|            if (keymgmt->export_types_ex == NULL) {
  ------------------
  |  Branch (220:17): [True: 0, False: 0]
  ------------------
  221|      0|                if (exporttypesfncnt == 0)
  ------------------
  |  Branch (221:21): [True: 0, False: 0]
  ------------------
  222|      0|                    exportfncnt++;
  223|      0|                exporttypesfncnt++;
  224|      0|                keymgmt->export_types_ex = OSSL_FUNC_keymgmt_export_types_ex(fns);
  225|      0|            }
  226|      0|            break;
  227|   446k|        }
  228|   446k|    }
  229|       |    /*
  230|       |     * Try to check that the method is sensible.
  231|       |     * At least one constructor and the destructor are MANDATORY
  232|       |     * The functions 'has' is MANDATORY
  233|       |     * It makes no sense being able to free stuff if you can't create it.
  234|       |     * It makes no sense providing OSSL_PARAM descriptors for import and
  235|       |     * export if you can't import or export.
  236|       |     */
  237|  25.2k|    if (keymgmt->free == NULL
  ------------------
  |  Branch (237:9): [True: 0, False: 25.2k]
  ------------------
  238|  25.2k|        || (keymgmt->new == NULL
  ------------------
  |  Branch (238:13): [True: 0, False: 25.2k]
  ------------------
  239|      0|            && keymgmt->gen == NULL
  ------------------
  |  Branch (239:16): [True: 0, False: 0]
  ------------------
  240|      0|            && keymgmt->load == NULL)
  ------------------
  |  Branch (240:16): [True: 0, False: 0]
  ------------------
  241|  25.2k|        || keymgmt->has == NULL
  ------------------
  |  Branch (241:12): [True: 0, False: 25.2k]
  ------------------
  242|  25.2k|        || (getparamfncnt != 0 && getparamfncnt != 2)
  ------------------
  |  Branch (242:13): [True: 23.3k, False: 1.89k]
  |  Branch (242:35): [True: 0, False: 23.3k]
  ------------------
  243|  25.2k|        || (setparamfncnt != 0 && setparamfncnt != 2)
  ------------------
  |  Branch (243:13): [True: 12.0k, False: 13.2k]
  |  Branch (243:35): [True: 0, False: 12.0k]
  ------------------
  244|  25.2k|        || (setgenparamfncnt != 0 && setgenparamfncnt != 2)
  ------------------
  |  Branch (244:13): [True: 23.3k, False: 1.89k]
  |  Branch (244:38): [True: 0, False: 23.3k]
  ------------------
  245|  25.2k|        || (getgenparamfncnt != 0 && getgenparamfncnt != 2)
  ------------------
  |  Branch (245:13): [True: 1.26k, False: 24.0k]
  |  Branch (245:38): [True: 0, False: 1.26k]
  ------------------
  246|  25.2k|        || (importfncnt != 0 && importfncnt != 2)
  ------------------
  |  Branch (246:13): [True: 23.3k, False: 1.89k]
  |  Branch (246:33): [True: 0, False: 23.3k]
  ------------------
  247|  25.2k|        || (exportfncnt != 0 && exportfncnt != 2)
  ------------------
  |  Branch (247:13): [True: 23.3k, False: 1.89k]
  |  Branch (247:33): [True: 0, False: 23.3k]
  ------------------
  248|  25.2k|        || (keymgmt->gen != NULL
  ------------------
  |  Branch (248:13): [True: 23.3k, False: 1.89k]
  ------------------
  249|  23.3k|            && (keymgmt->gen_init == NULL
  ------------------
  |  Branch (249:17): [True: 0, False: 23.3k]
  ------------------
  250|  23.3k|                || keymgmt->gen_cleanup == NULL))) {
  ------------------
  |  Branch (250:20): [True: 0, False: 23.3k]
  ------------------
  251|      0|        EVP_KEYMGMT_free(keymgmt);
  252|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  253|      0|        return NULL;
  254|      0|    }
  255|  25.2k|    keymgmt->prov = prov;
  256|  25.2k|    if (prov != NULL)
  ------------------
  |  Branch (256:9): [True: 25.2k, False: 0]
  ------------------
  257|  25.2k|        ossl_provider_up_ref(prov);
  258|       |
  259|  25.2k|#ifndef FIPS_MODULE
  260|  25.2k|    keymgmt->legacy_alg = get_legacy_alg_type_from_keymgmt(keymgmt);
  261|  25.2k|#endif
  262|       |
  263|  25.2k|    return keymgmt;
  264|  25.2k|}
keymgmt_meth.c:keymgmt_new:
   31|  25.2k|{
   32|  25.2k|    EVP_KEYMGMT *keymgmt = NULL;
   33|       |
   34|  25.2k|    if ((keymgmt = OPENSSL_zalloc(sizeof(*keymgmt))) == NULL)
  ------------------
  |  |  108|  25.2k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (34:9): [True: 0, False: 25.2k]
  ------------------
   35|      0|        return NULL;
   36|  25.2k|    if (!CRYPTO_NEW_REF(&keymgmt->refcnt, 1)) {
  ------------------
  |  Branch (36:9): [True: 0, False: 25.2k]
  ------------------
   37|      0|        EVP_KEYMGMT_free(keymgmt);
   38|      0|        return NULL;
   39|      0|    }
   40|  25.2k|    return keymgmt;
   41|  25.2k|}
keymgmt_meth.c:get_legacy_alg_type_from_keymgmt:
   54|  25.2k|{
   55|  25.2k|    int type = NID_undef;
  ------------------
  |  |   18|  25.2k|#define NID_undef                       0
  ------------------
   56|       |
   57|  25.2k|    EVP_KEYMGMT_names_do_all(keymgmt, help_get_legacy_alg_type_from_keymgmt,
   58|  25.2k|        &type);
   59|  25.2k|    return type;
   60|  25.2k|}
keymgmt_meth.c:help_get_legacy_alg_type_from_keymgmt:
   46|  67.6k|{
   47|  67.6k|    int *type = arg;
   48|       |
   49|  67.6k|    if (*type == NID_undef)
  ------------------
  |  |   18|  67.6k|#define NID_undef                       0
  ------------------
  |  Branch (49:9): [True: 53.0k, False: 14.5k]
  ------------------
   50|  53.0k|        *type = evp_pkey_name2type(keytype);
   51|  67.6k|}
keymgmt_meth.c:evp_keymgmt_up_ref:
   26|   259k|{
   27|   259k|    return EVP_KEYMGMT_up_ref(data);
   28|   259k|}
keymgmt_meth.c:evp_keymgmt_free:
   21|  61.3k|{
   22|  61.3k|    EVP_KEYMGMT_free(data);
   23|  61.3k|}

EVP_blake2b512:
   51|      1|{
   52|      1|    return &blake2b_md;
   53|      1|}
EVP_blake2s256:
   66|      1|{
   67|      1|    return &blake2s_md;
   68|      1|}

EVP_md4:
   32|      1|{
   33|      1|    return &md4_md;
   34|      1|}

EVP_md5:
   32|      1|{
   33|      1|    return &md5_md;
   34|      1|}

EVP_md5_sha1:
   39|      1|{
   40|      1|    return &md5_sha1_md;
   41|      1|}

EVP_mdc2:
   33|      1|{
   34|      1|    return &mdc2_md;
   35|      1|}

EVP_ripemd160:
   33|      1|{
   34|      1|    return &ripemd160_md;
   35|      1|}

EVP_sha1:
  101|   338k|{
  102|   338k|    return &sha1_md;
  103|   338k|}
EVP_sha224:
  116|      1|{
  117|      1|    return &sha224_md;
  118|      1|}
EVP_sha256:
  131|  24.2k|{
  132|  24.2k|    return &sha256_md;
  133|  24.2k|}
EVP_sha512_224:
  146|      1|{
  147|      1|    return &sha512_224_md;
  148|      1|}
EVP_sha512_256:
  161|      1|{
  162|      1|    return &sha512_256_md;
  163|      1|}
EVP_sha384:
  176|      1|{
  177|      1|    return &sha384_md;
  178|      1|}
EVP_sha512:
  191|      1|{
  192|      1|    return &sha512_md;
  193|      1|}

EVP_whirlpool:
   33|      1|{
   34|      1|    return &whirlpool_md;
   35|      1|}

EVP_MAC_CTX_free:
   40|  10.6k|{
   41|  10.6k|    if (ctx == NULL)
  ------------------
  |  Branch (41:9): [True: 10.6k, False: 0]
  ------------------
   42|  10.6k|        return;
   43|      0|    ctx->meth->freectx(ctx->algctx);
   44|      0|    ctx->algctx = NULL;
   45|       |    /* refcnt-- */
   46|      0|    EVP_MAC_free(ctx->meth);
   47|      0|    OPENSSL_free(ctx);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|      0|}

EVP_add_cipher:
   20|    144|{
   21|    144|    int r;
   22|       |
   23|    144|    if (c == NULL)
  ------------------
  |  Branch (23:9): [True: 0, False: 144]
  ------------------
   24|      0|        return 0;
   25|       |
   26|    144|    r = OBJ_NAME_add(OBJ_nid2sn(c->nid), OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|    144|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  ------------------
   27|    144|        (const char *)c);
   28|    144|    if (r == 0)
  ------------------
  |  Branch (28:9): [True: 0, False: 144]
  ------------------
   29|      0|        return 0;
   30|    144|    r = OBJ_NAME_add(OBJ_nid2ln(c->nid), OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|    144|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  ------------------
   31|    144|        (const char *)c);
   32|    144|    return r;
   33|    144|}
EVP_add_digest:
   36|     22|{
   37|     22|    int r;
   38|     22|    const char *name;
   39|       |
   40|     22|    name = OBJ_nid2sn(md->type);
   41|     22|    r = OBJ_NAME_add(name, OBJ_NAME_TYPE_MD_METH, (const char *)md);
  ------------------
  |  |   25|     22|#define OBJ_NAME_TYPE_MD_METH 0x01
  ------------------
   42|     22|    if (r == 0)
  ------------------
  |  Branch (42:9): [True: 0, False: 22]
  ------------------
   43|      0|        return 0;
   44|     22|    r = OBJ_NAME_add(OBJ_nid2ln(md->type), OBJ_NAME_TYPE_MD_METH,
  ------------------
  |  |   25|     22|#define OBJ_NAME_TYPE_MD_METH 0x01
  ------------------
   45|     22|        (const char *)md);
   46|     22|    if (r == 0)
  ------------------
  |  Branch (46:9): [True: 0, False: 22]
  ------------------
   47|      0|        return 0;
   48|       |
   49|     22|    if (md->pkey_type && md->type != md->pkey_type) {
  ------------------
  |  Branch (49:9): [True: 17, False: 5]
  |  Branch (49:26): [True: 16, False: 1]
  ------------------
   50|     16|        r = OBJ_NAME_add(OBJ_nid2sn(md->pkey_type),
   51|     16|            OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   25|     16|#define OBJ_NAME_TYPE_MD_METH 0x01
  ------------------
                          OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   33|     16|#define OBJ_NAME_ALIAS 0x8000
  ------------------
   52|     16|        if (r == 0)
  ------------------
  |  Branch (52:13): [True: 0, False: 16]
  ------------------
   53|      0|            return 0;
   54|     16|        r = OBJ_NAME_add(OBJ_nid2ln(md->pkey_type),
   55|     16|            OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   25|     16|#define OBJ_NAME_TYPE_MD_METH 0x01
  ------------------
                          OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   33|     16|#define OBJ_NAME_ALIAS 0x8000
  ------------------
   56|     16|    }
   57|     22|    return r;
   58|     22|}
EVP_get_digestbyname:
  131|   273k|{
  132|       |    return evp_get_digestbyname_ex(NULL, name);
  133|   273k|}
evp_get_digestbyname_ex:
  136|   273k|{
  137|   273k|    const EVP_MD *dp;
  138|   273k|    OSSL_NAMEMAP *namemap;
  139|   273k|    int id;
  140|   273k|    int do_retry = 1;
  141|       |
  142|   273k|    if (!OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_DIGESTS, NULL))
  ------------------
  |  |  507|   273k|#define OPENSSL_INIT_ADD_ALL_DIGESTS 0x00000008L
  ------------------
  |  Branch (142:9): [True: 0, False: 273k]
  ------------------
  143|      0|        return NULL;
  144|       |
  145|   273k|    dp = (const EVP_MD *)OBJ_NAME_get(name, OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|   273k|#define OBJ_NAME_TYPE_MD_METH 0x01
  ------------------
  146|       |
  147|   273k|    if (dp != NULL)
  ------------------
  |  Branch (147:9): [True: 273k, False: 0]
  ------------------
  148|   273k|        return dp;
  149|       |
  150|       |    /*
  151|       |     * It's not in the method database, but it might be there under a different
  152|       |     * name. So we check for aliases in the EVP namemap and try all of those
  153|       |     * in turn.
  154|       |     */
  155|       |
  156|      0|    namemap = ossl_namemap_stored(libctx);
  157|      0|retry:
  158|      0|    id = ossl_namemap_name2num(namemap, name);
  159|      0|    if (id == 0) {
  ------------------
  |  Branch (159:9): [True: 0, False: 0]
  ------------------
  160|      0|        EVP_MD *fetched_md;
  161|       |
  162|       |        /* Try to fetch it because the name might not be known yet. */
  163|      0|        if (!do_retry)
  ------------------
  |  Branch (163:13): [True: 0, False: 0]
  ------------------
  164|      0|            return NULL;
  165|      0|        do_retry = 0;
  166|      0|        ERR_set_mark();
  167|      0|        fetched_md = EVP_MD_fetch(libctx, name, NULL);
  168|      0|        EVP_MD_free(fetched_md);
  169|      0|        ERR_pop_to_mark();
  170|      0|        goto retry;
  171|      0|    }
  172|       |
  173|      0|    if (!ossl_namemap_doall_names(namemap, id, digest_from_name, &dp))
  ------------------
  |  Branch (173:9): [True: 0, False: 0]
  ------------------
  174|      0|        return NULL;
  175|       |
  176|      0|    return dp;
  177|      0|}
evp_cleanup_int:
  180|      1|{
  181|      1|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_KDF_METH);
  ------------------
  |  |   30|      1|#define OBJ_NAME_TYPE_KDF_METH 0x06
  ------------------
  182|      1|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_CIPHER_METH);
  ------------------
  |  |   26|      1|#define OBJ_NAME_TYPE_CIPHER_METH 0x02
  ------------------
  183|      1|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|      1|#define OBJ_NAME_TYPE_MD_METH 0x01
  ------------------
  184|       |    /*
  185|       |     * The above calls will only clean out the contents of the name hash
  186|       |     * table, but not the hash table itself.  The following line does that
  187|       |     * part.  -- Richard Levitte
  188|       |     */
  189|      1|    OBJ_NAME_cleanup(-1);
  190|       |
  191|      1|    EVP_PBE_cleanup();
  192|      1|    OBJ_sigid_free();
  193|       |
  194|      1|    evp_app_cleanup_int();
  195|      1|}

evp_pkey_get0_RSA_int:
   41|   299k|{
   42|   299k|    if (pkey->type != EVP_PKEY_RSA && pkey->type != EVP_PKEY_RSA_PSS) {
  ------------------
  |  |   63|   299k|#define EVP_PKEY_RSA NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|   598k|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
                  if (pkey->type != EVP_PKEY_RSA && pkey->type != EVP_PKEY_RSA_PSS) {
  ------------------
  |  |   65|      0|#define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|      0|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (42:9): [True: 0, False: 299k]
  |  Branch (42:39): [True: 0, False: 0]
  ------------------
   43|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_EXPECTING_AN_RSA_KEY);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   44|      0|        return NULL;
   45|      0|    }
   46|   299k|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
   47|   299k|}
EVP_PKEY_get1_RSA:
   55|   299k|{
   56|   299k|    RSA *ret = evp_pkey_get0_RSA_int(pkey);
   57|       |
   58|   299k|    if (ret != NULL && !RSA_up_ref(ret))
  ------------------
  |  Branch (58:9): [True: 299k, False: 0]
  |  Branch (58:24): [True: 0, False: 299k]
  ------------------
   59|      0|        ret = NULL;
   60|       |
   61|   299k|    return ret;
   62|   299k|}
evp_pkey_get0_EC_KEY_int:
   77|   112k|{
   78|   112k|    if (EVP_PKEY_get_base_id(pkey) != EVP_PKEY_EC) {
  ------------------
  |  |   73|   112k|#define EVP_PKEY_EC NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|   112k|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  |  Branch (78:9): [True: 0, False: 112k]
  ------------------
   79|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_EXPECTING_A_EC_KEY);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   80|      0|        return NULL;
   81|      0|    }
   82|   112k|    return evp_pkey_get_legacy((EVP_PKEY *)pkey);
   83|   112k|}
EVP_PKEY_get1_EC_KEY:
   91|   112k|{
   92|   112k|    EC_KEY *ret = evp_pkey_get0_EC_KEY_int(pkey);
   93|       |
   94|   112k|    if (ret != NULL && !EC_KEY_up_ref(ret))
  ------------------
  |  Branch (94:9): [True: 112k, False: 0]
  |  Branch (94:24): [True: 0, False: 112k]
  ------------------
   95|      0|        ret = NULL;
   96|   112k|    return ret;
   97|   112k|}

EVP_PKEY_set_type:
  722|   889k|{
  723|   889k|    return pkey_set_type(pkey, NULL, type, NULL, -1, NULL);
  724|   889k|}
EVP_PKEY_assign:
  792|   412k|{
  793|   412k|#ifndef OPENSSL_NO_EC
  794|   412k|    int pktype;
  795|       |
  796|   412k|    pktype = EVP_PKEY_type(type);
  797|   412k|    if ((key != NULL) && (pktype == EVP_PKEY_EC || pktype == EVP_PKEY_SM2)) {
  ------------------
  |  |   73|   412k|#define EVP_PKEY_EC NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|   824k|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
                  if ((key != NULL) && (pktype == EVP_PKEY_EC || pktype == EVP_PKEY_SM2)) {
  ------------------
  |  |   74|   299k|#define EVP_PKEY_SM2 NID_sm2
  |  |  ------------------
  |  |  |  | 1255|   299k|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (797:9): [True: 412k, False: 0]
  |  Branch (797:27): [True: 112k, False: 299k]
  |  Branch (797:52): [True: 0, False: 299k]
  ------------------
  798|   112k|        const EC_GROUP *group = EC_KEY_get0_group(key);
  799|       |
  800|   112k|        if (group != NULL) {
  ------------------
  |  Branch (800:13): [True: 112k, False: 0]
  ------------------
  801|   112k|            int curve = EC_GROUP_get_curve_name(group);
  802|       |
  803|       |            /*
  804|       |             * Regardless of what is requested the SM2 curve must be SM2 type,
  805|       |             * and non SM2 curves are EC type.
  806|       |             */
  807|   112k|            if (curve == NID_sm2 && pktype == EVP_PKEY_EC)
  ------------------
  |  | 1255|   225k|#define NID_sm2         1172
  ------------------
                          if (curve == NID_sm2 && pktype == EVP_PKEY_EC)
  ------------------
  |  |   73|      0|#define EVP_PKEY_EC NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|      0|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  |  Branch (807:17): [True: 0, False: 112k]
  |  Branch (807:37): [True: 0, False: 0]
  ------------------
  808|      0|                type = EVP_PKEY_SM2;
  ------------------
  |  |   74|      0|#define EVP_PKEY_SM2 NID_sm2
  |  |  ------------------
  |  |  |  | 1255|      0|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  809|   112k|            else if (curve != NID_sm2 && pktype == EVP_PKEY_SM2)
  ------------------
  |  | 1255|   225k|#define NID_sm2         1172
  ------------------
                          else if (curve != NID_sm2 && pktype == EVP_PKEY_SM2)
  ------------------
  |  |   74|   112k|#define EVP_PKEY_SM2 NID_sm2
  |  |  ------------------
  |  |  |  | 1255|   112k|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (809:22): [True: 112k, False: 0]
  |  Branch (809:42): [True: 0, False: 112k]
  ------------------
  810|      0|                type = EVP_PKEY_EC;
  ------------------
  |  |   73|      0|#define EVP_PKEY_EC NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|      0|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  811|   112k|        }
  812|   112k|    }
  813|   412k|#endif
  814|       |
  815|   412k|    if (pkey == NULL || !EVP_PKEY_set_type(pkey, type))
  ------------------
  |  Branch (815:9): [True: 0, False: 412k]
  |  Branch (815:25): [True: 0, False: 412k]
  ------------------
  816|      0|        return 0;
  817|       |
  818|   412k|    pkey->pkey.ptr = key;
  819|   412k|    detect_foreign_key(pkey);
  820|       |
  821|       |    return (key != NULL);
  822|   412k|}
EVP_PKEY_get_id:
 1024|   112k|{
 1025|   112k|    return pkey->type;
 1026|   112k|}
EVP_PKEY_get_base_id:
 1029|   112k|{
 1030|   112k|    return EVP_PKEY_type(pkey->type);
 1031|   112k|}
evp_pkey_name2type:
 1061|  58.6k|{
 1062|  58.6k|    int type;
 1063|  58.6k|    size_t i;
 1064|       |
 1065|   712k|    for (i = 0; i < OSSL_NELEM(standard_name2type); i++) {
  ------------------
  |  |   14|   712k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (1065:17): [True: 660k, False: 51.3k]
  ------------------
 1066|   660k|        if (OPENSSL_strcasecmp(name, standard_name2type[i].ptr) == 0)
  ------------------
  |  Branch (1066:13): [True: 7.37k, False: 653k]
  ------------------
 1067|  7.37k|            return (int)standard_name2type[i].id;
 1068|   660k|    }
 1069|       |
 1070|  51.3k|    if ((type = EVP_PKEY_type(OBJ_sn2nid(name))) != NID_undef)
  ------------------
  |  |   18|  51.3k|#define NID_undef                       0
  ------------------
  |  Branch (1070:9): [True: 2.52k, False: 48.7k]
  ------------------
 1071|  2.52k|        return type;
 1072|  48.7k|    return EVP_PKEY_type(OBJ_ln2nid(name));
 1073|  51.3k|}
EVP_PKEY_is_a:
 1088|   338k|{
 1089|   338k|    if (pkey == NULL)
  ------------------
  |  Branch (1089:9): [True: 0, False: 338k]
  ------------------
 1090|      0|        return 0;
 1091|   338k|    if (pkey->keymgmt == NULL)
  ------------------
  |  Branch (1091:9): [True: 0, False: 338k]
  ------------------
 1092|      0|        return pkey->type == evp_pkey_name2type(name);
 1093|   338k|    return EVP_KEYMGMT_is_a(pkey->keymgmt, name);
 1094|   338k|}
EVP_PKEY_get1_encoded_public_key:
 1442|  2.95k|{
 1443|  2.95k|    if (pkey == NULL)
  ------------------
  |  Branch (1443:9): [True: 0, False: 2.95k]
  ------------------
 1444|      0|        return 0;
 1445|  2.95k|#ifndef FIPS_MODULE
 1446|  2.95k|    if (evp_pkey_is_provided(pkey))
  ------------------
  |  |  652|  2.95k|    ((pk)->keymgmt != NULL)
  |  |  ------------------
  |  |  |  Branch (652:5): [True: 2.95k, False: 0]
  |  |  ------------------
  ------------------
 1447|  2.95k|#endif
 1448|  2.95k|    {
 1449|  2.95k|        size_t return_size = OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|  2.95k|#define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
 1450|  2.95k|        unsigned char *buf;
 1451|       |
 1452|       |        /*
 1453|       |         * We know that this is going to fail, but it will give us a size
 1454|       |         * to allocate.
 1455|       |         */
 1456|  2.95k|        EVP_PKEY_get_octet_string_param(pkey,
 1457|  2.95k|            OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY,
  ------------------
  |  |  398|  2.95k|# define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY "encoded-pub-key"
  ------------------
 1458|  2.95k|            NULL, 0, &return_size);
 1459|  2.95k|        if (return_size == OSSL_PARAM_UNMODIFIED)
  ------------------
  |  |   22|  2.95k|#define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
  |  Branch (1459:13): [True: 0, False: 2.95k]
  ------------------
 1460|      0|            return 0;
 1461|       |
 1462|  2.95k|        *ppub = NULL;
 1463|  2.95k|        buf = OPENSSL_malloc(return_size);
  ------------------
  |  |  106|  2.95k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1464|  2.95k|        if (buf == NULL)
  ------------------
  |  Branch (1464:13): [True: 0, False: 2.95k]
  ------------------
 1465|      0|            return 0;
 1466|       |
 1467|  2.95k|        if (!EVP_PKEY_get_octet_string_param(pkey,
  ------------------
  |  Branch (1467:13): [True: 0, False: 2.95k]
  ------------------
 1468|  2.95k|                OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY,
  ------------------
  |  |  398|  2.95k|# define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY "encoded-pub-key"
  ------------------
 1469|  2.95k|                buf, return_size, NULL)) {
 1470|      0|            OPENSSL_free(buf);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1471|      0|            return 0;
 1472|      0|        }
 1473|  2.95k|        *ppub = buf;
 1474|  2.95k|        return return_size;
 1475|  2.95k|    }
 1476|       |
 1477|      0|#ifndef FIPS_MODULE
 1478|      0|    {
 1479|      0|        int rv = evp_pkey_asn1_ctrl(pkey, ASN1_PKEY_CTRL_GET1_TLS_ENCPT, 0, ppub);
  ------------------
  |  | 1615|      0|#define ASN1_PKEY_CTRL_GET1_TLS_ENCPT 0xa
  ------------------
 1480|      0|        if (rv <= 0)
  ------------------
  |  Branch (1480:13): [True: 0, False: 0]
  ------------------
 1481|      0|            return 0;
 1482|      0|        return rv;
 1483|      0|    }
 1484|      0|#endif /* !FIPS_MODULE */
 1485|      0|}
EVP_PKEY_new:
 1490|   832k|{
 1491|   832k|    EVP_PKEY *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|   832k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1492|       |
 1493|   832k|    if (ret == NULL)
  ------------------
  |  Branch (1493:9): [True: 0, False: 832k]
  ------------------
 1494|      0|        return NULL;
 1495|       |
 1496|   832k|    ret->type = EVP_PKEY_NONE;
  ------------------
  |  |   62|   832k|#define EVP_PKEY_NONE NID_undef
  |  |  ------------------
  |  |  |  |   18|   832k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1497|   832k|    ret->save_type = EVP_PKEY_NONE;
  ------------------
  |  |   62|   832k|#define EVP_PKEY_NONE NID_undef
  |  |  ------------------
  |  |  |  |   18|   832k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1498|       |
 1499|   832k|    if (!CRYPTO_NEW_REF(&ret->references, 1))
  ------------------
  |  Branch (1499:9): [True: 0, False: 832k]
  ------------------
 1500|      0|        goto err;
 1501|       |
 1502|   832k|    ret->lock = CRYPTO_THREAD_lock_new();
 1503|   832k|    if (ret->lock == NULL) {
  ------------------
  |  Branch (1503:9): [True: 0, False: 832k]
  ------------------
 1504|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1505|      0|        goto err;
 1506|      0|    }
 1507|       |
 1508|   832k|#ifndef FIPS_MODULE
 1509|   832k|    ret->save_parameters = 1;
 1510|   832k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_EVP_PKEY, ret, &ret->ex_data)) {
  ------------------
  |  |  268|   832k|#define CRYPTO_EX_INDEX_EVP_PKEY 17
  ------------------
  |  Branch (1510:9): [True: 0, False: 832k]
  ------------------
 1511|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1512|      0|        goto err;
 1513|      0|    }
 1514|   832k|#endif
 1515|   832k|    return ret;
 1516|       |
 1517|      0|err:
 1518|      0|    CRYPTO_FREE_REF(&ret->references);
 1519|      0|    CRYPTO_THREAD_lock_free(ret->lock);
 1520|      0|    OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1521|       |    return NULL;
 1522|   832k|}
EVP_PKEY_set_type_by_keymgmt:
 1675|   417k|{
 1676|   417k|#ifndef FIPS_MODULE
 1677|   417k|#define EVP_PKEY_TYPE_STR str[0]
 1678|   417k|#define EVP_PKEY_TYPE_STRLEN (str[0] == NULL ? -1 : (int)strlen(str[0]))
 1679|       |    /*
 1680|       |     * Find at most two strings that have an associated EVP_PKEY_ASN1_METHOD
 1681|       |     * Ideally, only one should be found.  If two (or more) are found, the
 1682|       |     * match is ambiguous.  This should never happen, but...
 1683|       |     */
 1684|   417k|    const char *str[2] = { NULL, NULL };
 1685|       |
 1686|   417k|    if (!EVP_KEYMGMT_names_do_all(keymgmt, find_ameth, &str)
  ------------------
  |  Branch (1686:9): [True: 0, False: 417k]
  ------------------
 1687|   417k|        || str[1] != NULL) {
  ------------------
  |  Branch (1687:12): [True: 0, False: 417k]
  ------------------
 1688|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1689|      0|        return 0;
 1690|      0|    }
 1691|       |#else
 1692|       |#define EVP_PKEY_TYPE_STR NULL
 1693|       |#define EVP_PKEY_TYPE_STRLEN -1
 1694|       |#endif
 1695|   417k|    return pkey_set_type(pkey, NULL, EVP_PKEY_NONE,
  ------------------
  |  |   62|   417k|#define EVP_PKEY_NONE NID_undef
  |  |  ------------------
  |  |  |  |   18|   417k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1696|   417k|        EVP_PKEY_TYPE_STR, EVP_PKEY_TYPE_STRLEN,
  ------------------
  |  | 1677|   417k|#define EVP_PKEY_TYPE_STR str[0]
  ------------------
                      EVP_PKEY_TYPE_STR, EVP_PKEY_TYPE_STRLEN,
  ------------------
  |  | 1678|   417k|#define EVP_PKEY_TYPE_STRLEN (str[0] == NULL ? -1 : (int)strlen(str[0]))
  |  |  ------------------
  |  |  |  Branch (1678:31): [True: 2.65k, False: 415k]
  |  |  ------------------
  ------------------
 1697|   417k|        keymgmt);
 1698|       |
 1699|   417k|#undef EVP_PKEY_TYPE_STR
 1700|   417k|#undef EVP_PKEY_TYPE_STRLEN
 1701|   417k|}
EVP_PKEY_up_ref:
 1704|   476k|{
 1705|   476k|    int i;
 1706|       |
 1707|   476k|    if (CRYPTO_UP_REF(&pkey->references, &i) <= 0)
  ------------------
  |  Branch (1707:9): [True: 0, False: 476k]
  ------------------
 1708|      0|        return 0;
 1709|       |
 1710|   476k|    REF_PRINT_COUNT("EVP_PKEY", i, pkey);
  ------------------
  |  |  301|   476k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|   476k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  297|   476k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  285|   476k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1711|   476k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|   476k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 476k]
  |  |  ------------------
  ------------------
 1712|   476k|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (1712:13): [True: 476k, False: 0]
  ------------------
 1713|   476k|}
evp_pkey_free_legacy:
 1778|   838k|{
 1779|   838k|    const EVP_PKEY_ASN1_METHOD *ameth = x->ameth;
 1780|   838k|    ENGINE *tmpe = NULL;
 1781|       |
 1782|   838k|    if (ameth == NULL && x->legacy_cache_pkey.ptr != NULL)
  ------------------
  |  Branch (1782:9): [True: 423k, False: 414k]
  |  Branch (1782:26): [True: 0, False: 423k]
  ------------------
 1783|      0|        ameth = EVP_PKEY_asn1_find(&tmpe, x->type);
 1784|       |
 1785|   838k|    if (ameth != NULL) {
  ------------------
  |  Branch (1785:9): [True: 414k, False: 423k]
  ------------------
 1786|   414k|        if (x->legacy_cache_pkey.ptr != NULL) {
  ------------------
  |  Branch (1786:13): [True: 0, False: 414k]
  ------------------
 1787|       |            /*
 1788|       |             * We should never have both a legacy origin key, and a key in the
 1789|       |             * legacy cache.
 1790|       |             */
 1791|      0|            assert(x->pkey.ptr == NULL);
  ------------------
  |  Branch (1791:13): [True: 0, False: 0]
  |  Branch (1791:13): [True: 0, False: 0]
  ------------------
 1792|       |            /*
 1793|       |             * For the purposes of freeing we make the legacy cache look like
 1794|       |             * a legacy origin key.
 1795|       |             */
 1796|      0|            x->pkey = x->legacy_cache_pkey;
 1797|      0|            x->legacy_cache_pkey.ptr = NULL;
 1798|      0|        }
 1799|   414k|        if (ameth->pkey_free != NULL)
  ------------------
  |  Branch (1799:13): [True: 414k, False: 0]
  ------------------
 1800|   414k|            ameth->pkey_free(x);
 1801|   414k|        x->pkey.ptr = NULL;
 1802|   414k|    }
 1803|   838k|#ifndef OPENSSL_NO_ENGINE
 1804|   838k|    ENGINE_finish(tmpe);
 1805|   838k|    ENGINE_finish(x->engine);
 1806|   838k|    x->engine = NULL;
 1807|   838k|    ENGINE_finish(x->pmeth_engine);
 1808|       |    x->pmeth_engine = NULL;
 1809|   838k|#endif
 1810|   838k|}
EVP_PKEY_free:
 1831|  2.27M|{
 1832|  2.27M|    int i;
 1833|       |
 1834|  2.27M|    if (x == NULL)
  ------------------
  |  Branch (1834:9): [True: 966k, False: 1.30M]
  ------------------
 1835|   966k|        return;
 1836|       |
 1837|  1.30M|    CRYPTO_DOWN_REF(&x->references, &i);
 1838|  1.30M|    REF_PRINT_COUNT("EVP_PKEY", i, x);
  ------------------
  |  |  301|  1.30M|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  1.30M|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  297|  1.30M|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  285|  1.30M|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1839|  1.30M|    if (i > 0)
  ------------------
  |  Branch (1839:9): [True: 476k, False: 832k]
  ------------------
 1840|   476k|        return;
 1841|   832k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|   832k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 832k]
  |  |  ------------------
  ------------------
 1842|   832k|    evp_pkey_free_it(x);
 1843|   832k|#ifndef FIPS_MODULE
 1844|   832k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_EVP_PKEY, x, &x->ex_data);
  ------------------
  |  |  268|   832k|#define CRYPTO_EX_INDEX_EVP_PKEY 17
  ------------------
 1845|   832k|#endif
 1846|   832k|    CRYPTO_THREAD_lock_free(x->lock);
 1847|   832k|    CRYPTO_FREE_REF(&x->references);
 1848|   832k|#ifndef FIPS_MODULE
 1849|   832k|    sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free);
  ------------------
  |  |  287|   832k|#define sk_X509_ATTRIBUTE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_freefunc_type(freefunc))
  ------------------
 1850|   832k|#endif
 1851|   832k|    OPENSSL_free(x);
  ------------------
  |  |  131|   832k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1852|   832k|}
evp_pkey_get_legacy:
 2155|   412k|{
 2156|   412k|    EVP_PKEY *tmp_copy = NULL;
 2157|   412k|    void *ret = NULL;
 2158|       |
 2159|   412k|    if (!ossl_assert(pk != NULL))
  ------------------
  |  |   52|   412k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|   412k|    __FILE__, __LINE__)
  ------------------
  |  Branch (2159:9): [True: 0, False: 412k]
  ------------------
 2160|      0|        return NULL;
 2161|       |
 2162|       |    /*
 2163|       |     * If this isn't an assigned provider side key, we just use any existing
 2164|       |     * origin legacy key.
 2165|       |     */
 2166|   412k|    if (!evp_pkey_is_assigned(pk))
  ------------------
  |  |  644|   412k|    ((pk)->pkey.ptr != NULL || (pk)->keydata != NULL)
  |  |  ------------------
  |  |  |  Branch (644:6): [True: 412k, False: 0]
  |  |  |  Branch (644:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2167|      0|        return NULL;
 2168|   412k|    if (!evp_pkey_is_provided(pk))
  ------------------
  |  |  652|   412k|    ((pk)->keymgmt != NULL)
  ------------------
  |  Branch (2168:9): [True: 412k, False: 0]
  ------------------
 2169|   412k|        return pk->pkey.ptr;
 2170|       |
 2171|      0|    if (!CRYPTO_THREAD_read_lock(pk->lock))
  ------------------
  |  Branch (2171:9): [True: 0, False: 0]
  ------------------
 2172|      0|        return NULL;
 2173|       |
 2174|      0|    ret = pk->legacy_cache_pkey.ptr;
 2175|       |
 2176|      0|    if (!CRYPTO_THREAD_unlock(pk->lock))
  ------------------
  |  Branch (2176:9): [True: 0, False: 0]
  ------------------
 2177|      0|        return NULL;
 2178|       |
 2179|      0|    if (ret != NULL)
  ------------------
  |  Branch (2179:9): [True: 0, False: 0]
  ------------------
 2180|      0|        return ret;
 2181|       |
 2182|      0|    if (!evp_pkey_copy_downgraded(&tmp_copy, pk))
  ------------------
  |  Branch (2182:9): [True: 0, False: 0]
  ------------------
 2183|      0|        goto err;
 2184|       |
 2185|      0|    if (!CRYPTO_THREAD_write_lock(pk->lock))
  ------------------
  |  Branch (2185:9): [True: 0, False: 0]
  ------------------
 2186|      0|        goto err;
 2187|       |
 2188|       |    /* Check again in case some other thread has updated it in the meantime */
 2189|      0|    ret = pk->legacy_cache_pkey.ptr;
 2190|      0|    if (ret == NULL) {
  ------------------
  |  Branch (2190:9): [True: 0, False: 0]
  ------------------
 2191|       |        /* Steal the legacy key reference from the temporary copy */
 2192|      0|        ret = pk->legacy_cache_pkey.ptr = tmp_copy->pkey.ptr;
 2193|      0|        tmp_copy->pkey.ptr = NULL;
 2194|      0|    }
 2195|       |
 2196|      0|    if (!CRYPTO_THREAD_unlock(pk->lock)) {
  ------------------
  |  Branch (2196:9): [True: 0, False: 0]
  ------------------
 2197|      0|        ret = NULL;
 2198|      0|        goto err;
 2199|      0|    }
 2200|       |
 2201|      0|err:
 2202|      0|    EVP_PKEY_free(tmp_copy);
 2203|       |
 2204|      0|    return ret;
 2205|      0|}
EVP_PKEY_get_octet_string_param:
 2260|  5.90k|{
 2261|  5.90k|    OSSL_PARAM params[2];
 2262|  5.90k|    int ret1 = 0, ret2 = 0;
 2263|       |
 2264|  5.90k|    if (key_name == NULL)
  ------------------
  |  Branch (2264:9): [True: 0, False: 5.90k]
  ------------------
 2265|      0|        return 0;
 2266|       |
 2267|  5.90k|    params[0] = OSSL_PARAM_construct_octet_string(key_name, buf, max_buf_sz);
 2268|  5.90k|    params[1] = OSSL_PARAM_construct_end();
 2269|  5.90k|    if ((ret1 = EVP_PKEY_get_params(pkey, params)))
  ------------------
  |  Branch (2269:9): [True: 5.90k, False: 0]
  ------------------
 2270|  5.90k|        ret2 = OSSL_PARAM_modified(params);
 2271|  5.90k|    if (ret2 && out_len != NULL)
  ------------------
  |  Branch (2271:9): [True: 5.90k, False: 0]
  |  Branch (2271:17): [True: 2.95k, False: 2.95k]
  ------------------
 2272|  2.95k|        *out_len = params[0].return_size;
 2273|  5.90k|    return ret1 && ret2;
  ------------------
  |  Branch (2273:12): [True: 5.90k, False: 0]
  |  Branch (2273:20): [True: 5.90k, False: 0]
  ------------------
 2274|  5.90k|}
EVP_PKEY_get_params:
 2446|  5.90k|{
 2447|  5.90k|    if (pkey != NULL) {
  ------------------
  |  Branch (2447:9): [True: 5.90k, False: 0]
  ------------------
 2448|  5.90k|        if (evp_pkey_is_provided(pkey))
  ------------------
  |  |  652|  5.90k|    ((pk)->keymgmt != NULL)
  |  |  ------------------
  |  |  |  Branch (652:5): [True: 5.90k, False: 0]
  |  |  ------------------
  ------------------
 2449|  5.90k|            return evp_keymgmt_get_params(pkey->keymgmt, pkey->keydata, params) > 0;
 2450|      0|#ifndef FIPS_MODULE
 2451|      0|        else if (evp_pkey_is_legacy(pkey))
  ------------------
  |  |  650|      0|    ((pk)->type != EVP_PKEY_NONE && (pk)->keymgmt == NULL)
  |  |  ------------------
  |  |  |  |   62|      0|#define EVP_PKEY_NONE NID_undef
  |  |  |  |  ------------------
  |  |  |  |  |  |   18|      0|#define NID_undef                       0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (650:6): [True: 0, False: 0]
  |  |  |  Branch (650:37): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2452|      0|            return evp_pkey_get_params_to_ctrl(pkey, params) > 0;
 2453|  5.90k|#endif
 2454|  5.90k|    }
 2455|  5.90k|    ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 2456|      0|    return 0;
 2457|  5.90k|}
p_lib.c:detect_foreign_key:
  758|   412k|{
  759|   412k|    switch (pkey->type) {
  760|   299k|    case EVP_PKEY_RSA:
  ------------------
  |  |   63|   299k|#define EVP_PKEY_RSA NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|   299k|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  |  Branch (760:5): [True: 299k, False: 112k]
  ------------------
  761|   299k|    case EVP_PKEY_RSA_PSS:
  ------------------
  |  |   65|   299k|#define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|   299k|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (761:5): [True: 0, False: 412k]
  ------------------
  762|   299k|        pkey->foreign = pkey->pkey.rsa != NULL
  ------------------
  |  Branch (762:25): [True: 299k, False: 0]
  ------------------
  763|   299k|            && ossl_rsa_is_foreign(pkey->pkey.rsa);
  ------------------
  |  Branch (763:16): [True: 0, False: 299k]
  ------------------
  764|   299k|        break;
  765|      0|#ifndef OPENSSL_NO_EC
  766|      0|    case EVP_PKEY_SM2:
  ------------------
  |  |   74|      0|#define EVP_PKEY_SM2 NID_sm2
  |  |  ------------------
  |  |  |  | 1255|      0|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (766:5): [True: 0, False: 412k]
  ------------------
  767|      0|        break;
  768|   112k|    case EVP_PKEY_EC:
  ------------------
  |  |   73|   112k|#define EVP_PKEY_EC NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|   112k|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
  |  Branch (768:5): [True: 112k, False: 299k]
  ------------------
  769|   112k|        pkey->foreign = pkey->pkey.ec != NULL
  ------------------
  |  Branch (769:25): [True: 112k, False: 0]
  ------------------
  770|   112k|            && ossl_ec_key_is_foreign(pkey->pkey.ec);
  ------------------
  |  Branch (770:16): [True: 0, False: 112k]
  ------------------
  771|   112k|        break;
  772|      0|#endif
  773|      0|#ifndef OPENSSL_NO_DSA
  774|      0|    case EVP_PKEY_DSA:
  ------------------
  |  |   66|      0|#define EVP_PKEY_DSA NID_dsa
  |  |  ------------------
  |  |  |  |  136|      0|#define NID_dsa         116
  |  |  ------------------
  ------------------
  |  Branch (774:5): [True: 0, False: 412k]
  ------------------
  775|      0|        pkey->foreign = pkey->pkey.dsa != NULL
  ------------------
  |  Branch (775:25): [True: 0, False: 0]
  ------------------
  776|      0|            && ossl_dsa_is_foreign(pkey->pkey.dsa);
  ------------------
  |  Branch (776:16): [True: 0, False: 0]
  ------------------
  777|      0|        break;
  778|      0|#endif
  779|      0|#ifndef OPENSSL_NO_DH
  780|      0|    case EVP_PKEY_DH:
  ------------------
  |  |   71|      0|#define EVP_PKEY_DH NID_dhKeyAgreement
  |  |  ------------------
  |  |  |  |  621|      0|#define NID_dhKeyAgreement              28
  |  |  ------------------
  ------------------
  |  Branch (780:5): [True: 0, False: 412k]
  ------------------
  781|      0|        pkey->foreign = pkey->pkey.dh != NULL
  ------------------
  |  Branch (781:25): [True: 0, False: 0]
  ------------------
  782|      0|            && ossl_dh_is_foreign(pkey->pkey.dh);
  ------------------
  |  Branch (782:16): [True: 0, False: 0]
  ------------------
  783|      0|        break;
  784|      0|#endif
  785|      0|    default:
  ------------------
  |  Branch (785:5): [True: 0, False: 412k]
  ------------------
  786|      0|        pkey->foreign = 0;
  787|      0|        break;
  788|   412k|    }
  789|   412k|}
p_lib.c:pkey_set_type:
 1539|  2.85M|{
 1540|  2.85M|#ifndef FIPS_MODULE
 1541|  2.85M|    const EVP_PKEY_ASN1_METHOD *ameth = NULL;
 1542|  2.85M|    ENGINE **eptr = (e == NULL) ? &e : NULL;
  ------------------
  |  Branch (1542:21): [True: 2.85M, False: 0]
  ------------------
 1543|  2.85M|#endif
 1544|       |
 1545|       |    /*
 1546|       |     * The setups can't set both legacy and provider side methods.
 1547|       |     * It is forbidden
 1548|       |     */
 1549|  2.85M|    if (!ossl_assert(type == EVP_PKEY_NONE || keymgmt == NULL)
  ------------------
  |  |   52|  5.71M|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  ------------------
  |  |  |  Branch (52:41): [True: 1.96M, False: 889k]
  |  |  |  Branch (52:41): [True: 889k, False: 0]
  |  |  ------------------
  |  |   53|  5.71M|    __FILE__, __LINE__)
  ------------------
  |  Branch (1549:9): [True: 0, False: 2.85M]
  ------------------
 1550|  2.85M|        || !ossl_assert(e == NULL || keymgmt == NULL)) {
  ------------------
  |  |   52|  2.85M|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  ------------------
  |  |  |  Branch (52:41): [True: 2.85M, False: 0]
  |  |  |  Branch (52:41): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|  2.85M|    __FILE__, __LINE__)
  ------------------
  |  Branch (1550:12): [True: 0, False: 2.85M]
  ------------------
 1551|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1552|      0|        return 0;
 1553|      0|    }
 1554|       |
 1555|  2.85M|    if (pkey != NULL) {
  ------------------
  |  Branch (1555:9): [True: 1.30M, False: 1.54M]
  ------------------
 1556|  1.30M|        int free_it = 0;
 1557|       |
 1558|  1.30M|#ifndef FIPS_MODULE
 1559|  1.30M|        free_it = free_it || pkey->pkey.ptr != NULL;
  ------------------
  |  Branch (1559:19): [True: 0, False: 1.30M]
  |  Branch (1559:30): [True: 0, False: 1.30M]
  ------------------
 1560|  1.30M|#endif
 1561|  1.30M|        free_it = free_it || pkey->keydata != NULL;
  ------------------
  |  Branch (1561:19): [True: 0, False: 1.30M]
  |  Branch (1561:30): [True: 0, False: 1.30M]
  ------------------
 1562|  1.30M|        if (free_it)
  ------------------
  |  Branch (1562:13): [True: 0, False: 1.30M]
  ------------------
 1563|      0|            evp_pkey_free_it(pkey);
 1564|  1.30M|#ifndef FIPS_MODULE
 1565|       |        /*
 1566|       |         * If key type matches and a method exists then this lookup has
 1567|       |         * succeeded once so just indicate success.
 1568|       |         */
 1569|  1.30M|        if (pkey->type != EVP_PKEY_NONE
  ------------------
  |  |   62|  1.30M|#define EVP_PKEY_NONE NID_undef
  |  |  ------------------
  |  |  |  |   18|  2.61M|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1569:13): [True: 474k, False: 832k]
  ------------------
 1570|   474k|            && type == pkey->save_type
  ------------------
  |  Branch (1570:16): [True: 459k, False: 14.9k]
  ------------------
 1571|   459k|            && pkey->ameth != NULL)
  ------------------
  |  Branch (1571:16): [True: 459k, False: 0]
  ------------------
 1572|   459k|            return 1;
 1573|   847k|#ifndef OPENSSL_NO_ENGINE
 1574|       |        /* If we have ENGINEs release them */
 1575|   847k|        ENGINE_finish(pkey->engine);
 1576|   847k|        pkey->engine = NULL;
 1577|   847k|        ENGINE_finish(pkey->pmeth_engine);
 1578|   847k|        pkey->pmeth_engine = NULL;
 1579|   847k|#endif
 1580|   847k|#endif
 1581|   847k|    }
 1582|  2.39M|#ifndef FIPS_MODULE
 1583|  2.39M|    if (str != NULL)
  ------------------
  |  Branch (1583:9): [True: 1.96M, False: 432k]
  ------------------
 1584|  1.96M|        ameth = EVP_PKEY_asn1_find_str(eptr, str, len);
 1585|   432k|    else if (type != EVP_PKEY_NONE)
  ------------------
  |  |   62|   432k|#define EVP_PKEY_NONE NID_undef
  |  |  ------------------
  |  |  |  |   18|   432k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1585:14): [True: 429k, False: 2.65k]
  ------------------
 1586|   429k|        ameth = EVP_PKEY_asn1_find(eptr, type);
 1587|  2.39M|#ifndef OPENSSL_NO_ENGINE
 1588|  2.39M|    if (pkey == NULL && eptr != NULL)
  ------------------
  |  Branch (1588:9): [True: 1.54M, False: 847k]
  |  Branch (1588:25): [True: 1.54M, False: 0]
  ------------------
 1589|  1.54M|        ENGINE_finish(e);
 1590|  2.39M|#endif
 1591|  2.39M|#endif
 1592|       |
 1593|  2.39M|    {
 1594|  2.39M|        int check = 1;
 1595|       |
 1596|  2.39M|#ifndef FIPS_MODULE
 1597|  2.39M|        check = check && ameth == NULL;
  ------------------
  |  Branch (1597:17): [True: 2.39M, False: 0]
  |  Branch (1597:26): [True: 1.13M, False: 1.26M]
  ------------------
 1598|  2.39M|#endif
 1599|  2.39M|        check = check && keymgmt == NULL;
  ------------------
  |  Branch (1599:17): [True: 1.13M, False: 1.26M]
  |  Branch (1599:26): [True: 1.13M, False: 2.65k]
  ------------------
 1600|  2.39M|        if (check) {
  ------------------
  |  Branch (1600:13): [True: 1.13M, False: 1.26M]
  ------------------
 1601|  1.13M|            ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  404|  1.13M|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|  1.13M|    (ERR_new(),                                                  \
  |  |  |  |  407|  1.13M|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|  1.13M|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|  1.13M|        ERR_set_error)
  |  |  ------------------
  ------------------
 1602|  1.13M|            return 0;
 1603|  1.13M|        }
 1604|  2.39M|    }
 1605|  1.26M|    if (pkey != NULL) {
  ------------------
  |  Branch (1605:9): [True: 847k, False: 415k]
  ------------------
 1606|   847k|        if (keymgmt != NULL && !EVP_KEYMGMT_up_ref(keymgmt)) {
  ------------------
  |  Branch (1606:13): [True: 417k, False: 429k]
  |  Branch (1606:32): [True: 0, False: 417k]
  ------------------
 1607|      0|            ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1608|      0|            return 0;
 1609|      0|        }
 1610|       |
 1611|   847k|        pkey->keymgmt = keymgmt;
 1612|       |
 1613|   847k|        pkey->save_type = type;
 1614|   847k|        pkey->type = type;
 1615|       |
 1616|   847k|#ifndef FIPS_MODULE
 1617|       |        /*
 1618|       |         * If the internal "origin" key is provider side, don't save |ameth|.
 1619|       |         * The main reason is that |ameth| is one factor to detect that the
 1620|       |         * internal "origin" key is a legacy one.
 1621|       |         */
 1622|   847k|        if (keymgmt == NULL)
  ------------------
  |  Branch (1622:13): [True: 429k, False: 417k]
  ------------------
 1623|   429k|            pkey->ameth = ameth;
 1624|       |
 1625|       |        /*
 1626|       |         * The EVP_PKEY_ASN1_METHOD |pkey_id| retains its legacy key purpose
 1627|       |         * for any key type that has a legacy implementation, regardless of
 1628|       |         * if the internal key is a legacy or a provider side one.  When
 1629|       |         * there is no legacy implementation for the key, the type becomes
 1630|       |         * EVP_PKEY_KEYMGMT, which indicates that one should be cautious
 1631|       |         * with functions that expect legacy internal keys.
 1632|       |         */
 1633|   847k|        if (ameth != NULL) {
  ------------------
  |  Branch (1633:13): [True: 845k, False: 2.65k]
  ------------------
 1634|   845k|            if (type == EVP_PKEY_NONE)
  ------------------
  |  |   62|   845k|#define EVP_PKEY_NONE NID_undef
  |  |  ------------------
  |  |  |  |   18|   845k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1634:17): [True: 415k, False: 429k]
  ------------------
 1635|   415k|                pkey->type = ameth->pkey_id;
 1636|   845k|        } else {
 1637|  2.65k|            pkey->type = EVP_PKEY_KEYMGMT;
  ------------------
  |  |  103|  2.65k|#define EVP_PKEY_KEYMGMT -1
  ------------------
 1638|  2.65k|        }
 1639|   847k|#ifndef OPENSSL_NO_ENGINE
 1640|   847k|        if (eptr == NULL && e != NULL && !ENGINE_init(e)) {
  ------------------
  |  Branch (1640:13): [True: 0, False: 847k]
  |  Branch (1640:29): [True: 0, False: 0]
  |  Branch (1640:42): [True: 0, False: 0]
  ------------------
 1641|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1642|      0|            return 0;
 1643|      0|        }
 1644|   847k|#endif
 1645|   847k|        pkey->engine = e;
 1646|   847k|#endif
 1647|   847k|    }
 1648|  1.26M|    return 1;
 1649|  1.26M|}
p_lib.c:find_ameth:
 1653|  1.54M|{
 1654|  1.54M|    const char **str = data;
 1655|       |
 1656|       |    /*
 1657|       |     * The error messages from pkey_set_type() are uninteresting here,
 1658|       |     * and misleading.
 1659|       |     */
 1660|  1.54M|    ERR_set_mark();
 1661|       |
 1662|  1.54M|    if (pkey_set_type(NULL, NULL, EVP_PKEY_NONE, name, (int)strlen(name),
  ------------------
  |  |   62|  1.54M|#define EVP_PKEY_NONE NID_undef
  |  |  ------------------
  |  |  |  |   18|  1.54M|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1662:9): [True: 415k, False: 1.13M]
  ------------------
 1663|  1.54M|            NULL)) {
 1664|   415k|        if (str[0] == NULL)
  ------------------
  |  Branch (1664:13): [True: 415k, False: 0]
  ------------------
 1665|   415k|            str[0] = name;
 1666|      0|        else if (str[1] == NULL)
  ------------------
  |  Branch (1666:18): [True: 0, False: 0]
  ------------------
 1667|      0|            str[1] = name;
 1668|   415k|    }
 1669|       |
 1670|  1.54M|    ERR_pop_to_mark();
 1671|  1.54M|}
p_lib.c:evp_pkey_free_it:
 1814|   832k|{
 1815|       |    /* internal function; x is never NULL */
 1816|   832k|    evp_keymgmt_util_clear_operation_cache(x);
 1817|   832k|#ifndef FIPS_MODULE
 1818|   832k|    evp_pkey_free_legacy(x);
 1819|   832k|#endif
 1820|       |
 1821|   832k|    if (x->keymgmt != NULL) {
  ------------------
  |  Branch (1821:9): [True: 417k, False: 414k]
  ------------------
 1822|   417k|        evp_keymgmt_freedata(x->keymgmt, x->keydata);
 1823|   417k|        EVP_KEYMGMT_free(x->keymgmt);
 1824|   417k|        x->keymgmt = NULL;
 1825|   417k|        x->keydata = NULL;
 1826|   417k|    }
 1827|   832k|    x->type = EVP_PKEY_NONE;
  ------------------
  |  |   62|   832k|#define EVP_PKEY_NONE NID_undef
  |  |  ------------------
  |  |  |  |   18|   832k|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1828|   832k|}

EVP_PKEY_keygen_init:
   98|  5.60k|{
   99|  5.60k|    return gen_init(ctx, EVP_PKEY_OP_KEYGEN);
  ------------------
  |  | 1763|  5.60k|#define EVP_PKEY_OP_KEYGEN (1 << 2)
  ------------------
  100|  5.60k|}
EVP_PKEY_generate:
  127|  5.60k|{
  128|  5.60k|    int ret = 0;
  129|  5.60k|    EVP_PKEY *allocated_pkey = NULL;
  130|       |    /* Legacy compatible keygen callback info, only used with provider impls */
  131|  5.60k|    int gentmp[2];
  132|       |
  133|  5.60k|    if (ppkey == NULL)
  ------------------
  |  Branch (133:9): [True: 0, False: 5.60k]
  ------------------
  134|      0|        return -1;
  135|       |
  136|  5.60k|    if (ctx == NULL)
  ------------------
  |  Branch (136:9): [True: 0, False: 5.60k]
  ------------------
  137|      0|        goto not_supported;
  138|       |
  139|  5.60k|    if ((ctx->operation & EVP_PKEY_OP_TYPE_GEN) == 0)
  ------------------
  |  | 1799|  5.60k|    (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  ------------------
  |  |  |  | 1762|  5.60k|#define EVP_PKEY_OP_PARAMGEN (1 << 1)
  |  |  ------------------
  |  |                   (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  ------------------
  |  |  |  | 1763|  5.60k|#define EVP_PKEY_OP_KEYGEN (1 << 2)
  |  |  ------------------
  ------------------
  |  Branch (139:9): [True: 0, False: 5.60k]
  ------------------
  140|      0|        goto not_initialized;
  141|       |
  142|  5.60k|    if (*ppkey == NULL)
  ------------------
  |  Branch (142:9): [True: 5.60k, False: 0]
  ------------------
  143|  5.60k|        *ppkey = allocated_pkey = EVP_PKEY_new();
  144|       |
  145|  5.60k|    if (*ppkey == NULL) {
  ------------------
  |  Branch (145:9): [True: 0, False: 5.60k]
  ------------------
  146|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  147|      0|        return -1;
  148|      0|    }
  149|       |
  150|  5.60k|    if (ctx->op.keymgmt.genctx == NULL)
  ------------------
  |  Branch (150:9): [True: 0, False: 5.60k]
  ------------------
  151|      0|        goto legacy;
  152|       |
  153|       |    /*
  154|       |     * Assigning gentmp to ctx->keygen_info is something our legacy
  155|       |     * implementations do.  Because the provider implementations aren't
  156|       |     * allowed to reach into our EVP_PKEY_CTX, we need to provide similar
  157|       |     * space for backward compatibility.  It's ok that we attach a local
  158|       |     * variable, as it should only be useful in the calls down from here.
  159|       |     * This is cleared as soon as it isn't useful any more, i.e. directly
  160|       |     * after the evp_keymgmt_util_gen() call.
  161|       |     */
  162|  5.60k|    ctx->keygen_info = gentmp;
  163|  5.60k|    ctx->keygen_info_count = 2;
  164|       |
  165|  5.60k|    ret = 1;
  166|  5.60k|    if (ctx->pkey != NULL) {
  ------------------
  |  Branch (166:9): [True: 0, False: 5.60k]
  ------------------
  167|      0|        EVP_KEYMGMT *tmp_keymgmt = ctx->keymgmt;
  168|      0|        void *keydata = evp_pkey_export_to_provider(ctx->pkey, ctx->libctx,
  169|      0|            &tmp_keymgmt, ctx->propquery);
  170|       |
  171|      0|        if (tmp_keymgmt == NULL)
  ------------------
  |  Branch (171:13): [True: 0, False: 0]
  ------------------
  172|      0|            goto not_supported;
  173|       |        /*
  174|       |         * It's ok if keydata is NULL here.  The backend is expected to deal
  175|       |         * with that as it sees fit.
  176|       |         */
  177|      0|        ret = evp_keymgmt_gen_set_template(ctx->keymgmt,
  178|      0|            ctx->op.keymgmt.genctx, keydata);
  179|      0|    }
  180|       |
  181|       |    /*
  182|       |     * the returned value from evp_keymgmt_util_gen() is cached in *ppkey,
  183|       |     * so we do not need to save it, just check it.
  184|       |     */
  185|  5.60k|    ret = ret
  ------------------
  |  Branch (185:11): [True: 5.60k, False: 0]
  ------------------
  186|  5.60k|        && (evp_keymgmt_util_gen(*ppkey, ctx->keymgmt, ctx->op.keymgmt.genctx,
  ------------------
  |  Branch (186:12): [True: 5.60k, False: 0]
  ------------------
  187|  5.60k|                ossl_callback_to_pkey_gencb, ctx)
  188|  5.60k|            != NULL);
  189|       |
  190|  5.60k|    ctx->keygen_info = NULL;
  191|       |
  192|  5.60k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_DEPRECATED_3_6)
  193|       |    /* In case |*ppkey| was originally a legacy key */
  194|  5.60k|    if (ret)
  ------------------
  |  Branch (194:9): [True: 5.60k, False: 0]
  ------------------
  195|  5.60k|        evp_pkey_free_legacy(*ppkey);
  196|  5.60k|#endif
  197|       |
  198|       |    /*
  199|       |     * Because we still have legacy keys
  200|       |     */
  201|  5.60k|    (*ppkey)->type = ctx->legacy_keytype;
  202|       |
  203|  5.60k|    goto end;
  204|       |
  205|      0|legacy:
  206|       |#ifdef FIPS_MODULE
  207|       |    goto not_supported;
  208|       |#else
  209|       |    /*
  210|       |     * If we get here then we're using legacy paramgen/keygen. In that case
  211|       |     * the pkey in ctx (if there is one) had better not be provided (because the
  212|       |     * legacy methods may not know how to handle it). However we can only get
  213|       |     * here if ctx->op.keymgmt.genctx == NULL, but that should never be the case
  214|       |     * if ctx->pkey is provided because we don't allow this when we initialise
  215|       |     * the ctx.
  216|       |     */
  217|      0|    if (ctx->pkey != NULL && !ossl_assert(!evp_pkey_is_provided(ctx->pkey)))
  ------------------
  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|      0|    __FILE__, __LINE__)
  ------------------
  |  Branch (217:9): [True: 0, False: 0]
  |  Branch (217:30): [True: 0, False: 0]
  ------------------
  218|      0|        goto not_accessible;
  219|       |
  220|      0|    switch (ctx->operation) {
  221|      0|    case EVP_PKEY_OP_PARAMGEN:
  ------------------
  |  | 1762|      0|#define EVP_PKEY_OP_PARAMGEN (1 << 1)
  ------------------
  |  Branch (221:5): [True: 0, False: 0]
  ------------------
  222|      0|        ret = ctx->pmeth->paramgen(ctx, *ppkey);
  223|      0|        break;
  224|      0|    case EVP_PKEY_OP_KEYGEN:
  ------------------
  |  | 1763|      0|#define EVP_PKEY_OP_KEYGEN (1 << 2)
  ------------------
  |  Branch (224:5): [True: 0, False: 0]
  ------------------
  225|      0|        ret = ctx->pmeth->keygen(ctx, *ppkey);
  226|      0|        break;
  227|      0|    default:
  ------------------
  |  Branch (227:5): [True: 0, False: 0]
  ------------------
  228|      0|        goto not_supported;
  229|      0|    }
  230|      0|#endif
  231|       |
  232|  5.60k|end:
  233|  5.60k|    if (ret <= 0) {
  ------------------
  |  Branch (233:9): [True: 0, False: 5.60k]
  ------------------
  234|      0|        if (allocated_pkey != NULL)
  ------------------
  |  Branch (234:13): [True: 0, False: 0]
  ------------------
  235|      0|            *ppkey = NULL;
  236|      0|        EVP_PKEY_free(allocated_pkey);
  237|      0|    }
  238|  5.60k|    return ret;
  239|       |
  240|      0|not_supported:
  241|      0|    ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  242|      0|    ret = -2;
  243|      0|    goto end;
  244|      0|not_initialized:
  245|      0|    ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_INITIALIZED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  246|      0|    ret = -1;
  247|      0|    goto end;
  248|      0|#ifndef FIPS_MODULE
  249|      0|not_accessible:
  250|       |    ERR_raise(ERR_LIB_EVP, EVP_R_INACCESSIBLE_DOMAIN_PARAMETERS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  251|      0|    ret = -1;
  252|      0|    goto end;
  253|      0|#endif
  254|      0|}
EVP_PKEY_keygen:
  266|  2.95k|{
  267|  2.95k|    if (ctx->operation != EVP_PKEY_OP_KEYGEN) {
  ------------------
  |  | 1763|  2.95k|#define EVP_PKEY_OP_KEYGEN (1 << 2)
  ------------------
  |  Branch (267:9): [True: 0, False: 2.95k]
  ------------------
  268|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_INITIALIZED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  269|      0|        return -1;
  270|      0|    }
  271|  2.95k|    return EVP_PKEY_generate(ctx, ppkey);
  272|  2.95k|}
EVP_PKEY_export:
  437|  2.65k|{
  438|  2.65k|    if (pkey == NULL) {
  ------------------
  |  Branch (438:9): [True: 0, False: 2.65k]
  ------------------
  439|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  440|      0|        return 0;
  441|      0|    }
  442|  2.65k|#ifndef FIPS_MODULE
  443|  2.65k|    if (evp_pkey_is_legacy(pkey)) {
  ------------------
  |  |  650|  2.65k|    ((pk)->type != EVP_PKEY_NONE && (pk)->keymgmt == NULL)
  |  |  ------------------
  |  |  |  |   62|  2.65k|#define EVP_PKEY_NONE NID_undef
  |  |  |  |  ------------------
  |  |  |  |  |  |   18|  5.30k|#define NID_undef                       0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (650:6): [True: 2.65k, False: 0]
  |  |  |  Branch (650:37): [True: 0, False: 2.65k]
  |  |  ------------------
  ------------------
  444|      0|        struct fake_import_data_st data;
  445|       |
  446|      0|        data.export_cb = export_cb;
  447|      0|        data.export_cbarg = export_cbarg;
  448|       |
  449|       |        /*
  450|       |         * We don't need to care about libctx or propq here, as we're only
  451|       |         * interested in the resulting OSSL_PARAM array.
  452|       |         */
  453|      0|        return pkey->ameth->export_to(pkey, &data, pkey_fake_import,
  454|      0|            NULL, NULL);
  455|      0|    }
  456|  2.65k|#endif
  457|  2.65k|    return evp_keymgmt_util_export(pkey, selection, export_cb, export_cbarg);
  458|  2.65k|}
pmeth_gn.c:gen_init:
   26|  5.60k|{
   27|  5.60k|    int ret = 0;
   28|       |
   29|  5.60k|    if (ctx == NULL)
  ------------------
  |  Branch (29:9): [True: 0, False: 5.60k]
  ------------------
   30|      0|        goto not_supported;
   31|       |
   32|  5.60k|    evp_pkey_ctx_free_old_ops(ctx);
   33|  5.60k|    ctx->operation = operation;
   34|       |
   35|  5.60k|    if (ctx->keymgmt == NULL || ctx->keymgmt->gen_init == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 5.60k]
  |  Branch (35:33): [True: 0, False: 5.60k]
  ------------------
   36|      0|        goto legacy;
   37|       |
   38|  5.60k|    switch (operation) {
  ------------------
  |  Branch (38:13): [True: 5.60k, False: 0]
  ------------------
   39|      0|    case EVP_PKEY_OP_PARAMGEN:
  ------------------
  |  | 1762|      0|#define EVP_PKEY_OP_PARAMGEN (1 << 1)
  ------------------
  |  Branch (39:5): [True: 0, False: 5.60k]
  ------------------
   40|      0|        ctx->op.keymgmt.genctx = evp_keymgmt_gen_init(ctx->keymgmt,
   41|      0|            OSSL_KEYMGMT_SELECT_ALL_PARAMETERS, NULL);
  ------------------
  |  |  647|      0|    (OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS \
  |  |  ------------------
  |  |  |  |  642|      0|#define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS 0x04
  |  |  ------------------
  |  |  648|      0|        | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  643|      0|#define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS 0x80
  |  |  ------------------
  ------------------
   42|      0|        break;
   43|  5.60k|    case EVP_PKEY_OP_KEYGEN:
  ------------------
  |  | 1763|  5.60k|#define EVP_PKEY_OP_KEYGEN (1 << 2)
  ------------------
  |  Branch (43:5): [True: 5.60k, False: 0]
  ------------------
   44|  5.60k|        ctx->op.keymgmt.genctx = evp_keymgmt_gen_init(ctx->keymgmt, OSSL_KEYMGMT_SELECT_KEYPAIR,
  ------------------
  |  |  650|  5.60k|    (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  640|  5.60k|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  641|  5.60k|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  |  |  ------------------
  ------------------
   45|  5.60k|            NULL);
   46|  5.60k|        break;
   47|  5.60k|    }
   48|       |
   49|  5.60k|    if (ctx->op.keymgmt.genctx == NULL)
  ------------------
  |  Branch (49:9): [True: 0, False: 5.60k]
  ------------------
   50|  5.60k|        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   51|  5.60k|    else
   52|  5.60k|        ret = 1;
   53|  5.60k|    goto end;
   54|       |
   55|      0|legacy:
   56|       |#ifdef FIPS_MODULE
   57|       |    goto not_supported;
   58|       |#else
   59|      0|    if (ctx->pmeth == NULL
  ------------------
  |  Branch (59:9): [True: 0, False: 0]
  ------------------
   60|      0|        || (operation == EVP_PKEY_OP_PARAMGEN
  ------------------
  |  | 1762|      0|#define EVP_PKEY_OP_PARAMGEN (1 << 1)
  ------------------
  |  Branch (60:13): [True: 0, False: 0]
  ------------------
   61|      0|            && ctx->pmeth->paramgen == NULL)
  ------------------
  |  Branch (61:16): [True: 0, False: 0]
  ------------------
   62|      0|        || (operation == EVP_PKEY_OP_KEYGEN
  ------------------
  |  | 1763|      0|#define EVP_PKEY_OP_KEYGEN (1 << 2)
  ------------------
  |  Branch (62:13): [True: 0, False: 0]
  ------------------
   63|      0|            && ctx->pmeth->keygen == NULL))
  ------------------
  |  Branch (63:16): [True: 0, False: 0]
  ------------------
   64|      0|        goto not_supported;
   65|       |
   66|      0|    ret = 1;
   67|      0|    switch (operation) {
  ------------------
  |  Branch (67:13): [True: 0, False: 0]
  ------------------
   68|      0|    case EVP_PKEY_OP_PARAMGEN:
  ------------------
  |  | 1762|      0|#define EVP_PKEY_OP_PARAMGEN (1 << 1)
  ------------------
  |  Branch (68:5): [True: 0, False: 0]
  ------------------
   69|      0|        if (ctx->pmeth->paramgen_init != NULL)
  ------------------
  |  Branch (69:13): [True: 0, False: 0]
  ------------------
   70|      0|            ret = ctx->pmeth->paramgen_init(ctx);
   71|      0|        break;
   72|      0|    case EVP_PKEY_OP_KEYGEN:
  ------------------
  |  | 1763|      0|#define EVP_PKEY_OP_KEYGEN (1 << 2)
  ------------------
  |  Branch (72:5): [True: 0, False: 0]
  ------------------
   73|      0|        if (ctx->pmeth->keygen_init != NULL)
  ------------------
  |  Branch (73:13): [True: 0, False: 0]
  ------------------
   74|      0|            ret = ctx->pmeth->keygen_init(ctx);
   75|      0|        break;
   76|      0|    }
   77|      0|#endif
   78|       |
   79|  5.60k|end:
   80|  5.60k|    if (ret <= 0 && ctx != NULL) {
  ------------------
  |  Branch (80:9): [True: 0, False: 5.60k]
  |  Branch (80:21): [True: 0, False: 0]
  ------------------
   81|      0|        evp_pkey_ctx_free_old_ops(ctx);
   82|      0|        ctx->operation = EVP_PKEY_OP_UNDEFINED;
  ------------------
  |  | 1761|      0|#define EVP_PKEY_OP_UNDEFINED 0
  ------------------
   83|      0|    }
   84|  5.60k|    return ret;
   85|       |
   86|      0|not_supported:
   87|       |    ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   88|      0|    ret = -2;
   89|      0|    goto end;
   90|      0|}

evp_pkey_ctx_state:
  139|  5.60k|{
  140|  5.60k|    if (ctx->operation == EVP_PKEY_OP_UNDEFINED)
  ------------------
  |  | 1761|  5.60k|#define EVP_PKEY_OP_UNDEFINED 0
  ------------------
  |  Branch (140:9): [True: 0, False: 5.60k]
  ------------------
  141|      0|        return EVP_PKEY_STATE_UNKNOWN;
  ------------------
  |  |  950|      0|#define EVP_PKEY_STATE_UNKNOWN 0
  ------------------
  142|       |
  143|  5.60k|    if ((EVP_PKEY_CTX_IS_DERIVE_OP(ctx)
  ------------------
  |  |  747|  11.2k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_DERIVE) != 0)
  |  |  ------------------
  |  |  |  | 1790|  5.60k|    (EVP_PKEY_OP_DERIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1772|  5.60k|#define EVP_PKEY_OP_DERIVE (1 << 11)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (747:5): [True: 0, False: 5.60k]
  |  |  ------------------
  ------------------
  144|      0|            && ctx->op.kex.algctx != NULL)
  ------------------
  |  Branch (144:16): [True: 0, False: 0]
  ------------------
  145|  5.60k|        || (EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx)
  ------------------
  |  |  744|  11.2k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1781|  5.60k|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1765|  5.60k|#define EVP_PKEY_OP_SIGN (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1775|  5.60k|#define EVP_PKEY_OP_SIGNMSG (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1782|  5.60k|        | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1766|  5.60k|#define EVP_PKEY_OP_VERIFY (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                       | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1776|  5.60k|#define EVP_PKEY_OP_VERIFYMSG (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1783|  5.60k|        | EVP_PKEY_OP_VERIFYRECOVER                  \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1767|  5.60k|#define EVP_PKEY_OP_VERIFYRECOVER (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1784|  5.60k|        | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1768|  5.60k|#define EVP_PKEY_OP_SIGNCTX (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                       | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1769|  5.60k|#define EVP_PKEY_OP_VERIFYCTX (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (744:5): [True: 0, False: 5.60k]
  |  |  ------------------
  ------------------
  146|      0|            && ctx->op.sig.algctx != NULL)
  ------------------
  |  Branch (146:16): [True: 0, False: 0]
  ------------------
  147|  5.60k|        || (EVP_PKEY_CTX_IS_ASYM_CIPHER_OP(ctx)
  ------------------
  |  |  750|  11.2k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_CRYPT) != 0)
  |  |  ------------------
  |  |  |  | 1787|  5.60k|    (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1770|  5.60k|#define EVP_PKEY_OP_ENCRYPT (1 << 9)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1771|  5.60k|#define EVP_PKEY_OP_DECRYPT (1 << 10)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (750:5): [True: 0, False: 5.60k]
  |  |  ------------------
  ------------------
  148|      0|            && ctx->op.ciph.algctx != NULL)
  ------------------
  |  Branch (148:16): [True: 0, False: 0]
  ------------------
  149|  5.60k|        || (EVP_PKEY_CTX_IS_GEN_OP(ctx)
  ------------------
  |  |  753|  11.2k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_GEN) != 0)
  |  |  ------------------
  |  |  |  | 1799|  5.60k|    (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1762|  5.60k|#define EVP_PKEY_OP_PARAMGEN (1 << 1)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1763|  5.60k|#define EVP_PKEY_OP_KEYGEN (1 << 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (753:5): [True: 5.60k, False: 0]
  |  |  ------------------
  ------------------
  150|  5.60k|            && ctx->op.keymgmt.genctx != NULL)
  ------------------
  |  Branch (150:16): [True: 5.60k, False: 0]
  ------------------
  151|      0|        || (EVP_PKEY_CTX_IS_KEM_OP(ctx)
  ------------------
  |  |  759|      0|    (((ctx)->operation & EVP_PKEY_OP_TYPE_KEM) != 0)
  |  |  ------------------
  |  |  |  | 1796|      0|    (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1773|      0|#define EVP_PKEY_OP_ENCAPSULATE (1 << 12)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1774|      0|#define EVP_PKEY_OP_DECAPSULATE (1 << 13)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (759:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  152|      0|            && ctx->op.encap.algctx != NULL))
  ------------------
  |  Branch (152:16): [True: 0, False: 0]
  ------------------
  153|  5.60k|        return EVP_PKEY_STATE_PROVIDER;
  ------------------
  |  |  952|  5.60k|#define EVP_PKEY_STATE_PROVIDER 2
  ------------------
  154|       |
  155|      0|    return EVP_PKEY_STATE_LEGACY;
  ------------------
  |  |  951|      0|#define EVP_PKEY_STATE_LEGACY 1
  ------------------
  156|  5.60k|}
EVP_PKEY_CTX_new_from_name:
  348|  5.60k|{
  349|  5.60k|    return int_ctx_new(libctx, NULL, NULL, name, propquery, -1);
  350|  5.60k|}
EVP_PKEY_CTX_new_from_pkey:
  354|  64.6k|{
  355|  64.6k|    return int_ctx_new(libctx, pkey, NULL, NULL, propquery, -1);
  356|  64.6k|}
evp_pkey_ctx_free_old_ops:
  359|  75.6k|{
  360|  75.6k|    if (EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx)) {
  ------------------
  |  |  744|  75.6k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1781|  75.6k|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1765|  75.6k|#define EVP_PKEY_OP_SIGN (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1775|  75.6k|#define EVP_PKEY_OP_SIGNMSG (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1782|  75.6k|        | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1766|  75.6k|#define EVP_PKEY_OP_VERIFY (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                       | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1776|  75.6k|#define EVP_PKEY_OP_VERIFYMSG (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1783|  75.6k|        | EVP_PKEY_OP_VERIFYRECOVER                  \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1767|  75.6k|#define EVP_PKEY_OP_VERIFYRECOVER (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1784|  75.6k|        | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1768|  75.6k|#define EVP_PKEY_OP_SIGNCTX (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                       | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1769|  75.6k|#define EVP_PKEY_OP_VERIFYCTX (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (744:5): [True: 0, False: 75.6k]
  |  |  ------------------
  ------------------
  361|      0|        if (ctx->op.sig.algctx != NULL && ctx->op.sig.signature != NULL)
  ------------------
  |  Branch (361:13): [True: 0, False: 0]
  |  Branch (361:43): [True: 0, False: 0]
  ------------------
  362|      0|            ctx->op.sig.signature->freectx(ctx->op.sig.algctx);
  363|      0|        EVP_SIGNATURE_free(ctx->op.sig.signature);
  364|      0|        ctx->op.sig.algctx = NULL;
  365|      0|        ctx->op.sig.signature = NULL;
  366|  75.6k|    } else if (EVP_PKEY_CTX_IS_DERIVE_OP(ctx)) {
  ------------------
  |  |  747|  75.6k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_DERIVE) != 0)
  |  |  ------------------
  |  |  |  | 1790|  75.6k|    (EVP_PKEY_OP_DERIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1772|  75.6k|#define EVP_PKEY_OP_DERIVE (1 << 11)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (747:5): [True: 0, False: 75.6k]
  |  |  ------------------
  ------------------
  367|      0|        if (ctx->op.kex.algctx != NULL && ctx->op.kex.exchange != NULL)
  ------------------
  |  Branch (367:13): [True: 0, False: 0]
  |  Branch (367:43): [True: 0, False: 0]
  ------------------
  368|      0|            ctx->op.kex.exchange->freectx(ctx->op.kex.algctx);
  369|      0|        EVP_KEYEXCH_free(ctx->op.kex.exchange);
  370|      0|        ctx->op.kex.algctx = NULL;
  371|      0|        ctx->op.kex.exchange = NULL;
  372|  75.6k|    } else if (EVP_PKEY_CTX_IS_KEM_OP(ctx)) {
  ------------------
  |  |  759|  75.6k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_KEM) != 0)
  |  |  ------------------
  |  |  |  | 1796|  75.6k|    (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1773|  75.6k|#define EVP_PKEY_OP_ENCAPSULATE (1 << 12)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1774|  75.6k|#define EVP_PKEY_OP_DECAPSULATE (1 << 13)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (759:5): [True: 0, False: 75.6k]
  |  |  ------------------
  ------------------
  373|      0|        if (ctx->op.encap.algctx != NULL && ctx->op.encap.kem != NULL)
  ------------------
  |  Branch (373:13): [True: 0, False: 0]
  |  Branch (373:45): [True: 0, False: 0]
  ------------------
  374|      0|            ctx->op.encap.kem->freectx(ctx->op.encap.algctx);
  375|      0|        EVP_KEM_free(ctx->op.encap.kem);
  376|      0|        ctx->op.encap.algctx = NULL;
  377|      0|        ctx->op.encap.kem = NULL;
  378|  75.6k|    } else if (EVP_PKEY_CTX_IS_ASYM_CIPHER_OP(ctx)) {
  ------------------
  |  |  750|  75.6k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_CRYPT) != 0)
  |  |  ------------------
  |  |  |  | 1787|  75.6k|    (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1770|  75.6k|#define EVP_PKEY_OP_ENCRYPT (1 << 9)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1771|  75.6k|#define EVP_PKEY_OP_DECRYPT (1 << 10)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (750:5): [True: 0, False: 75.6k]
  |  |  ------------------
  ------------------
  379|      0|        if (ctx->op.ciph.algctx != NULL && ctx->op.ciph.cipher != NULL)
  ------------------
  |  Branch (379:13): [True: 0, False: 0]
  |  Branch (379:44): [True: 0, False: 0]
  ------------------
  380|      0|            ctx->op.ciph.cipher->freectx(ctx->op.ciph.algctx);
  381|      0|        EVP_ASYM_CIPHER_free(ctx->op.ciph.cipher);
  382|      0|        ctx->op.ciph.algctx = NULL;
  383|      0|        ctx->op.ciph.cipher = NULL;
  384|  75.6k|    } else if (EVP_PKEY_CTX_IS_GEN_OP(ctx)) {
  ------------------
  |  |  753|  75.6k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_GEN) != 0)
  |  |  ------------------
  |  |  |  | 1799|  75.6k|    (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1762|  75.6k|#define EVP_PKEY_OP_PARAMGEN (1 << 1)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1763|  75.6k|#define EVP_PKEY_OP_KEYGEN (1 << 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (753:5): [True: 5.60k, False: 70.0k]
  |  |  ------------------
  ------------------
  385|  5.60k|        if (ctx->op.keymgmt.genctx != NULL && ctx->keymgmt != NULL)
  ------------------
  |  Branch (385:13): [True: 5.60k, False: 0]
  |  Branch (385:47): [True: 5.60k, False: 0]
  ------------------
  386|  5.60k|            evp_keymgmt_gen_cleanup(ctx->keymgmt, ctx->op.keymgmt.genctx);
  387|  5.60k|    }
  388|  75.6k|}
EVP_PKEY_CTX_free:
  391|   434k|{
  392|   434k|    if (ctx == NULL)
  ------------------
  |  Branch (392:9): [True: 364k, False: 70.0k]
  ------------------
  393|   364k|        return;
  394|  70.0k|    if (ctx->pmeth && ctx->pmeth->cleanup)
  ------------------
  |  Branch (394:9): [True: 0, False: 70.0k]
  |  Branch (394:23): [True: 0, False: 0]
  ------------------
  395|      0|        ctx->pmeth->cleanup(ctx);
  396|       |
  397|  70.0k|    evp_pkey_ctx_free_old_ops(ctx);
  398|  70.0k|#ifndef FIPS_MODULE
  399|  70.0k|    evp_pkey_ctx_free_all_cached_data(ctx);
  400|  70.0k|#endif
  401|  70.0k|    EVP_KEYMGMT_free(ctx->keymgmt);
  402|       |
  403|  70.0k|    OPENSSL_free(ctx->propquery);
  ------------------
  |  |  131|  70.0k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  404|  70.0k|    EVP_PKEY_free(ctx->pkey);
  405|  70.0k|    EVP_PKEY_free(ctx->peerkey);
  406|  70.0k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  407|  70.0k|    ENGINE_finish(ctx->engine);
  408|  70.0k|#endif
  409|  70.0k|    BN_free(ctx->rsa_pubexp);
  410|  70.0k|    OPENSSL_free(ctx);
  ------------------
  |  |  131|  70.0k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  411|  70.0k|}
evp_app_cleanup_int:
  632|      1|{
  633|      1|    if (app_pkey_methods != NULL)
  ------------------
  |  Branch (633:9): [True: 0, False: 1]
  ------------------
  634|      0|        sk_EVP_PKEY_METHOD_pop_free(app_pkey_methods, EVP_PKEY_meth_free);
  635|      1|}
EVP_PKEY_CTX_set_params:
  678|  5.60k|{
  679|  5.60k|    switch (evp_pkey_ctx_state(ctx)) {
  ------------------
  |  Branch (679:13): [True: 5.60k, False: 0]
  ------------------
  680|  5.60k|    case EVP_PKEY_STATE_PROVIDER:
  ------------------
  |  |  952|  5.60k|#define EVP_PKEY_STATE_PROVIDER 2
  ------------------
  |  Branch (680:5): [True: 5.60k, False: 0]
  ------------------
  681|  5.60k|        if (EVP_PKEY_CTX_IS_DERIVE_OP(ctx)
  ------------------
  |  |  747|  11.2k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_DERIVE) != 0)
  |  |  ------------------
  |  |  |  | 1790|  5.60k|    (EVP_PKEY_OP_DERIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1772|  5.60k|#define EVP_PKEY_OP_DERIVE (1 << 11)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (747:5): [True: 0, False: 5.60k]
  |  |  ------------------
  ------------------
  682|      0|            && ctx->op.kex.exchange != NULL
  ------------------
  |  Branch (682:16): [True: 0, False: 0]
  ------------------
  683|      0|            && ctx->op.kex.exchange->set_ctx_params != NULL)
  ------------------
  |  Branch (683:16): [True: 0, False: 0]
  ------------------
  684|      0|            return ctx->op.kex.exchange->set_ctx_params(ctx->op.kex.algctx,
  685|      0|                params);
  686|  5.60k|        if (EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx)
  ------------------
  |  |  744|  11.2k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1781|  5.60k|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1765|  5.60k|#define EVP_PKEY_OP_SIGN (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG          \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1775|  5.60k|#define EVP_PKEY_OP_SIGNMSG (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1782|  5.60k|        | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1766|  5.60k|#define EVP_PKEY_OP_VERIFY (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                       | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1776|  5.60k|#define EVP_PKEY_OP_VERIFYMSG (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1783|  5.60k|        | EVP_PKEY_OP_VERIFYRECOVER                  \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1767|  5.60k|#define EVP_PKEY_OP_VERIFYRECOVER (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1784|  5.60k|        | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1768|  5.60k|#define EVP_PKEY_OP_SIGNCTX (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                       | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1769|  5.60k|#define EVP_PKEY_OP_VERIFYCTX (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (744:5): [True: 0, False: 5.60k]
  |  |  ------------------
  ------------------
  687|      0|            && ctx->op.sig.signature != NULL
  ------------------
  |  Branch (687:16): [True: 0, False: 0]
  ------------------
  688|      0|            && ctx->op.sig.signature->set_ctx_params != NULL)
  ------------------
  |  Branch (688:16): [True: 0, False: 0]
  ------------------
  689|      0|            return ctx->op.sig.signature->set_ctx_params(ctx->op.sig.algctx,
  690|      0|                params);
  691|  5.60k|        if (EVP_PKEY_CTX_IS_ASYM_CIPHER_OP(ctx)
  ------------------
  |  |  750|  11.2k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_CRYPT) != 0)
  |  |  ------------------
  |  |  |  | 1787|  5.60k|    (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1770|  5.60k|#define EVP_PKEY_OP_ENCRYPT (1 << 9)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1771|  5.60k|#define EVP_PKEY_OP_DECRYPT (1 << 10)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (750:5): [True: 0, False: 5.60k]
  |  |  ------------------
  ------------------
  692|      0|            && ctx->op.ciph.cipher != NULL
  ------------------
  |  Branch (692:16): [True: 0, False: 0]
  ------------------
  693|      0|            && ctx->op.ciph.cipher->set_ctx_params != NULL)
  ------------------
  |  Branch (693:16): [True: 0, False: 0]
  ------------------
  694|      0|            return ctx->op.ciph.cipher->set_ctx_params(ctx->op.ciph.algctx,
  695|      0|                params);
  696|  5.60k|        if (EVP_PKEY_CTX_IS_GEN_OP(ctx)
  ------------------
  |  |  753|  11.2k|    (((ctx)->operation & EVP_PKEY_OP_TYPE_GEN) != 0)
  |  |  ------------------
  |  |  |  | 1799|  5.60k|    (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1762|  5.60k|#define EVP_PKEY_OP_PARAMGEN (1 << 1)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1763|  5.60k|#define EVP_PKEY_OP_KEYGEN (1 << 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (753:5): [True: 5.60k, False: 0]
  |  |  ------------------
  ------------------
  697|  5.60k|            && ctx->keymgmt != NULL
  ------------------
  |  Branch (697:16): [True: 5.60k, False: 0]
  ------------------
  698|  5.60k|            && ctx->keymgmt->gen_set_params != NULL)
  ------------------
  |  Branch (698:16): [True: 5.60k, False: 0]
  ------------------
  699|  5.60k|            return evp_keymgmt_gen_set_params(ctx->keymgmt, ctx->op.keymgmt.genctx,
  700|  5.60k|                params);
  701|      0|        if (EVP_PKEY_CTX_IS_KEM_OP(ctx)
  ------------------
  |  |  759|      0|    (((ctx)->operation & EVP_PKEY_OP_TYPE_KEM) != 0)
  |  |  ------------------
  |  |  |  | 1796|      0|    (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1773|      0|#define EVP_PKEY_OP_ENCAPSULATE (1 << 12)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_ENCAPSULATE | EVP_PKEY_OP_DECAPSULATE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1774|      0|#define EVP_PKEY_OP_DECAPSULATE (1 << 13)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (759:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  702|      0|            && ctx->op.encap.kem != NULL
  ------------------
  |  Branch (702:16): [True: 0, False: 0]
  ------------------
  703|      0|            && ctx->op.encap.kem->set_ctx_params != NULL)
  ------------------
  |  Branch (703:16): [True: 0, False: 0]
  ------------------
  704|      0|            return ctx->op.encap.kem->set_ctx_params(ctx->op.encap.algctx,
  705|      0|                params);
  706|      0|        break;
  707|      0|    case EVP_PKEY_STATE_UNKNOWN:
  ------------------
  |  |  950|      0|#define EVP_PKEY_STATE_UNKNOWN 0
  ------------------
  |  Branch (707:5): [True: 0, False: 5.60k]
  ------------------
  708|      0|        break;
  709|      0|#ifndef FIPS_MODULE
  710|      0|    case EVP_PKEY_STATE_LEGACY:
  ------------------
  |  |  951|      0|#define EVP_PKEY_STATE_LEGACY 1
  ------------------
  |  Branch (710:5): [True: 0, False: 5.60k]
  ------------------
  711|      0|        return evp_pkey_ctx_set_params_to_ctrl(ctx, params);
  712|  5.60k|#endif
  713|  5.60k|    }
  714|      0|    return 0;
  715|  5.60k|}
pmeth_lib.c:evp_pkey_meth_find_added_by_application:
   93|  67.5k|{
   94|  67.5k|    if (app_pkey_methods != NULL) {
  ------------------
  |  Branch (94:9): [True: 0, False: 67.5k]
  ------------------
   95|      0|        int idx;
   96|      0|        EVP_PKEY_METHOD tmp;
   97|       |
   98|      0|        tmp.pkey_id = type;
   99|      0|        idx = sk_EVP_PKEY_METHOD_find(app_pkey_methods, &tmp);
  100|      0|        if (idx >= 0)
  ------------------
  |  Branch (100:13): [True: 0, False: 0]
  ------------------
  101|      0|            return sk_EVP_PKEY_METHOD_value(app_pkey_methods, idx);
  102|      0|    }
  103|  67.5k|    return NULL;
  104|  67.5k|}
pmeth_lib.c:int_ctx_new:
  163|  70.2k|{
  164|  70.2k|    EVP_PKEY_CTX *ret = NULL;
  165|  70.2k|    const EVP_PKEY_METHOD *pmeth = NULL, *app_pmeth = NULL;
  166|  70.2k|    EVP_KEYMGMT *keymgmt = NULL;
  167|       |
  168|       |    /* Code below to be removed when legacy support is dropped. */
  169|       |    /* BEGIN legacy */
  170|  70.2k|    if (id == -1) {
  ------------------
  |  Branch (170:9): [True: 70.2k, False: 0]
  ------------------
  171|  70.2k|        if (pkey != NULL && !evp_pkey_is_provided(pkey)) {
  ------------------
  |  |  652|  64.6k|    ((pk)->keymgmt != NULL)
  ------------------
  |  Branch (171:13): [True: 64.6k, False: 5.60k]
  |  Branch (171:29): [True: 64.6k, False: 0]
  ------------------
  172|  64.6k|            id = pkey->type;
  173|  64.6k|        } else {
  174|  5.60k|            if (pkey != NULL) {
  ------------------
  |  Branch (174:17): [True: 0, False: 5.60k]
  ------------------
  175|       |                /* Must be provided if we get here */
  176|      0|                keytype = EVP_KEYMGMT_get0_name(pkey->keymgmt);
  177|      0|            }
  178|  5.60k|#ifndef FIPS_MODULE
  179|  5.60k|            if (keytype != NULL) {
  ------------------
  |  Branch (179:17): [True: 5.60k, False: 0]
  ------------------
  180|  5.60k|                id = evp_pkey_name2type(keytype);
  181|  5.60k|                if (id == NID_undef)
  ------------------
  |  |   18|  5.60k|#define NID_undef                       0
  ------------------
  |  Branch (181:21): [True: 2.65k, False: 2.95k]
  ------------------
  182|  2.65k|                    id = -1;
  183|  5.60k|            }
  184|  5.60k|#endif
  185|  5.60k|        }
  186|  70.2k|    }
  187|       |    /* If no ID was found here, we can only resort to find a keymgmt */
  188|  70.2k|    if (id == -1) {
  ------------------
  |  Branch (188:9): [True: 2.65k, False: 67.5k]
  ------------------
  189|  2.65k|#ifndef FIPS_MODULE
  190|       |        /* Using engine with a key without id will not work */
  191|  2.65k|        if (e != NULL) {
  ------------------
  |  Branch (191:13): [True: 0, False: 2.65k]
  ------------------
  192|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  193|      0|            return NULL;
  194|      0|        }
  195|  2.65k|#endif
  196|  2.65k|        goto common;
  197|  2.65k|    }
  198|       |
  199|  67.5k|#ifndef FIPS_MODULE
  200|       |    /*
  201|       |     * Here, we extract what information we can for the purpose of
  202|       |     * supporting usage with implementations from providers, to make
  203|       |     * for a smooth transition from legacy stuff to provider based stuff.
  204|       |     *
  205|       |     * If an engine is given, this is entirely legacy, and we should not
  206|       |     * pretend anything else, so we clear the name.
  207|       |     */
  208|  67.5k|    if (e != NULL)
  ------------------
  |  Branch (208:9): [True: 0, False: 67.5k]
  ------------------
  209|      0|        keytype = NULL;
  210|  67.5k|    if (e == NULL && (pkey == NULL || pkey->foreign == 0))
  ------------------
  |  Branch (210:9): [True: 67.5k, False: 0]
  |  Branch (210:23): [True: 2.95k, False: 64.6k]
  |  Branch (210:39): [True: 64.6k, False: 0]
  ------------------
  211|  67.5k|        keytype = OBJ_nid2sn(id);
  212|       |
  213|  67.5k|#ifndef OPENSSL_NO_ENGINE
  214|  67.5k|    if (e == NULL && pkey != NULL)
  ------------------
  |  Branch (214:9): [True: 67.5k, False: 0]
  |  Branch (214:22): [True: 64.6k, False: 2.95k]
  ------------------
  215|  64.6k|        e = pkey->pmeth_engine != NULL ? pkey->pmeth_engine : pkey->engine;
  ------------------
  |  Branch (215:13): [True: 0, False: 64.6k]
  ------------------
  216|       |    /* Try to find an ENGINE which implements this method */
  217|  67.5k|    if (e != NULL) {
  ------------------
  |  Branch (217:9): [True: 0, False: 67.5k]
  ------------------
  218|      0|        if (!ENGINE_init(e)) {
  ------------------
  |  Branch (218:13): [True: 0, False: 0]
  ------------------
  219|      0|            ERR_raise(ERR_LIB_EVP, ERR_R_ENGINE_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  220|      0|            return NULL;
  221|      0|        }
  222|  67.5k|    } else {
  223|  67.5k|        e = ENGINE_get_pkey_meth_engine(id);
  224|  67.5k|    }
  225|       |
  226|       |    /*
  227|       |     * If an ENGINE handled this method look it up. Otherwise use internal
  228|       |     * tables.
  229|       |     */
  230|  67.5k|    if (e != NULL)
  ------------------
  |  Branch (230:9): [True: 0, False: 67.5k]
  ------------------
  231|      0|        pmeth = ENGINE_get_pkey_meth(e, id);
  232|  67.5k|    else
  233|  67.5k|#endif /* OPENSSL_NO_ENGINE */
  234|  67.5k|        if (pkey != NULL && pkey->foreign)
  ------------------
  |  Branch (234:13): [True: 64.6k, False: 2.95k]
  |  Branch (234:29): [True: 0, False: 64.6k]
  ------------------
  235|      0|            pmeth = EVP_PKEY_meth_find(id);
  236|  67.5k|        else
  237|  67.5k|            app_pmeth = pmeth = evp_pkey_meth_find_added_by_application(id);
  238|       |
  239|       |        /* END legacy */
  240|  67.5k|#endif /* FIPS_MODULE */
  241|  70.2k|common:
  242|       |    /*
  243|       |     * If there's no engine and no app supplied pmeth and there's a name, we try
  244|       |     * fetching a provider implementation.
  245|       |     */
  246|  70.2k|    if (e == NULL && app_pmeth == NULL && keytype != NULL) {
  ------------------
  |  Branch (246:9): [True: 70.2k, False: 0]
  |  Branch (246:22): [True: 70.2k, False: 0]
  |  Branch (246:43): [True: 70.2k, False: 0]
  ------------------
  247|       |        /*
  248|       |         * If |pkey| is given and is provided, we take a reference to its
  249|       |         * keymgmt.  Otherwise, we fetch one for the keytype we got. This
  250|       |         * is to ensure that operation init functions can access what they
  251|       |         * need through this single pointer.
  252|       |         */
  253|  70.2k|        if (pkey != NULL && pkey->keymgmt != NULL) {
  ------------------
  |  Branch (253:13): [True: 64.6k, False: 5.60k]
  |  Branch (253:29): [True: 0, False: 64.6k]
  ------------------
  254|      0|            if (!EVP_KEYMGMT_up_ref(pkey->keymgmt))
  ------------------
  |  Branch (254:17): [True: 0, False: 0]
  ------------------
  255|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  256|      0|            else
  257|      0|                keymgmt = pkey->keymgmt;
  258|  70.2k|        } else {
  259|  70.2k|            keymgmt = EVP_KEYMGMT_fetch(libctx, keytype, propquery);
  260|  70.2k|        }
  261|  70.2k|        if (keymgmt == NULL)
  ------------------
  |  Branch (261:13): [True: 166, False: 70.0k]
  ------------------
  262|    166|            return NULL; /* EVP_KEYMGMT_fetch() recorded an error */
  263|       |
  264|  70.0k|#ifndef FIPS_MODULE
  265|       |        /*
  266|       |         * Chase down the legacy NID, as that might be needed for diverse
  267|       |         * purposes, such as ensure that EVP_PKEY_type() can return sensible
  268|       |         * values. We go through all keymgmt names, because the keytype
  269|       |         * that's passed to this function doesn't necessarily translate
  270|       |         * directly.
  271|       |         */
  272|  70.0k|        if (keymgmt != NULL) {
  ------------------
  |  Branch (272:13): [True: 70.0k, False: 0]
  ------------------
  273|  70.0k|            int tmp_id = evp_keymgmt_get_legacy_alg(keymgmt);
  274|       |
  275|  70.0k|            if (tmp_id != NID_undef) {
  ------------------
  |  |   18|  70.0k|#define NID_undef                       0
  ------------------
  |  Branch (275:17): [True: 67.4k, False: 2.65k]
  ------------------
  276|  67.4k|                if (id == -1) {
  ------------------
  |  Branch (276:21): [True: 0, False: 67.4k]
  ------------------
  277|      0|                    id = tmp_id;
  278|  67.4k|                } else {
  279|       |                    /*
  280|       |                     * It really really shouldn't differ.  If it still does,
  281|       |                     * something is very wrong.
  282|       |                     */
  283|  67.4k|                    if (!ossl_assert(id == tmp_id)) {
  ------------------
  |  |   52|  67.4k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  67.4k|    __FILE__, __LINE__)
  ------------------
  |  Branch (283:25): [True: 0, False: 67.4k]
  ------------------
  284|      0|                        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  285|      0|                        EVP_KEYMGMT_free(keymgmt);
  286|      0|                        return NULL;
  287|      0|                    }
  288|  67.4k|                }
  289|  67.4k|            }
  290|  70.0k|        }
  291|  70.0k|#endif
  292|  70.0k|    }
  293|       |
  294|  70.0k|    if (pmeth == NULL && keymgmt == NULL) {
  ------------------
  |  Branch (294:9): [True: 70.0k, False: 0]
  |  Branch (294:26): [True: 0, False: 70.0k]
  ------------------
  295|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  296|  70.0k|    } else {
  297|  70.0k|        ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|  70.0k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  298|  70.0k|    }
  299|       |
  300|  70.0k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  301|  70.0k|    if ((ret == NULL || pmeth == NULL) && e != NULL)
  ------------------
  |  Branch (301:10): [True: 0, False: 70.0k]
  |  Branch (301:25): [True: 70.0k, False: 0]
  |  Branch (301:43): [True: 0, False: 70.0k]
  ------------------
  302|      0|        ENGINE_finish(e);
  303|  70.0k|#endif
  304|       |
  305|  70.0k|    if (ret == NULL) {
  ------------------
  |  Branch (305:9): [True: 0, False: 70.0k]
  ------------------
  306|      0|        EVP_KEYMGMT_free(keymgmt);
  307|      0|        return NULL;
  308|      0|    }
  309|  70.0k|    if (propquery != NULL) {
  ------------------
  |  Branch (309:9): [True: 14.5k, False: 55.5k]
  ------------------
  310|  14.5k|        ret->propquery = OPENSSL_strdup(propquery);
  ------------------
  |  |  135|  14.5k|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  311|  14.5k|        if (ret->propquery == NULL) {
  ------------------
  |  Branch (311:13): [True: 0, False: 14.5k]
  ------------------
  312|      0|            OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  313|      0|            EVP_KEYMGMT_free(keymgmt);
  314|      0|            return NULL;
  315|      0|        }
  316|  14.5k|    }
  317|  70.0k|    ret->libctx = libctx;
  318|  70.0k|    ret->keytype = keytype;
  319|  70.0k|    ret->keymgmt = keymgmt;
  320|  70.0k|    ret->legacy_keytype = id;
  321|  70.0k|    ret->engine = e;
  322|  70.0k|    ret->pmeth = pmeth;
  323|  70.0k|    ret->operation = EVP_PKEY_OP_UNDEFINED;
  ------------------
  |  | 1761|  70.0k|#define EVP_PKEY_OP_UNDEFINED 0
  ------------------
  324|       |
  325|  70.0k|    if (pkey != NULL && !EVP_PKEY_up_ref(pkey)) {
  ------------------
  |  Branch (325:9): [True: 64.4k, False: 5.60k]
  |  Branch (325:25): [True: 0, False: 64.4k]
  ------------------
  326|      0|        EVP_PKEY_CTX_free(ret);
  327|      0|        return NULL;
  328|      0|    }
  329|       |
  330|  70.0k|    ret->pkey = pkey;
  331|       |
  332|  70.0k|    if (pmeth != NULL && pmeth->init != NULL) {
  ------------------
  |  Branch (332:9): [True: 0, False: 70.0k]
  |  Branch (332:26): [True: 0, False: 0]
  ------------------
  333|      0|        if (pmeth->init(ret) <= 0) {
  ------------------
  |  Branch (333:13): [True: 0, False: 0]
  ------------------
  334|      0|            ret->pmeth = NULL;
  335|      0|            EVP_PKEY_CTX_free(ret);
  336|      0|            return NULL;
  337|      0|        }
  338|      0|    }
  339|       |
  340|  70.0k|    return ret;
  341|  70.0k|}
pmeth_lib.c:decode_cmd:
 1431|  70.0k|{
 1432|  70.0k|    if (cmd == -1) {
  ------------------
  |  Branch (1432:9): [True: 0, False: 70.0k]
  ------------------
 1433|       |        /*
 1434|       |         * The consequence of the assertion not being true is that this
 1435|       |         * function will return -1, which will cause the calling functions
 1436|       |         * to signal that the command is unsupported...  in non-debug mode.
 1437|       |         */
 1438|      0|        if (ossl_assert(name != NULL))
  ------------------
  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  ------------------
  |  |  |  Branch (52:24): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|      0|    __FILE__, __LINE__)
  ------------------
 1439|      0|            if (strcmp(name, "distid") == 0 || strcmp(name, "hexdistid") == 0)
  ------------------
  |  Branch (1439:17): [True: 0, False: 0]
  |  Branch (1439:48): [True: 0, False: 0]
  ------------------
 1440|      0|                cmd = EVP_PKEY_CTRL_SET1_ID;
  ------------------
  |  | 1824|      0|#define EVP_PKEY_CTRL_SET1_ID 15
  ------------------
 1441|      0|    }
 1442|       |
 1443|  70.0k|    return cmd;
 1444|  70.0k|}
pmeth_lib.c:evp_pkey_ctx_free_cached_data:
 1517|  70.0k|{
 1518|  70.0k|    cmd = decode_cmd(cmd, name);
 1519|  70.0k|    switch (cmd) {
  ------------------
  |  Branch (1519:13): [True: 70.0k, False: 0]
  ------------------
 1520|  70.0k|    case EVP_PKEY_CTRL_SET1_ID:
  ------------------
  |  | 1824|  70.0k|#define EVP_PKEY_CTRL_SET1_ID 15
  ------------------
  |  Branch (1520:5): [True: 70.0k, False: 0]
  ------------------
 1521|  70.0k|        OPENSSL_free(ctx->cached_parameters.dist_id);
  ------------------
  |  |  131|  70.0k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1522|  70.0k|        OPENSSL_free(ctx->cached_parameters.dist_id_name);
  ------------------
  |  |  131|  70.0k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1523|  70.0k|        ctx->cached_parameters.dist_id = NULL;
 1524|       |        ctx->cached_parameters.dist_id_name = NULL;
 1525|  70.0k|        break;
 1526|  70.0k|    }
 1527|  70.0k|}
pmeth_lib.c:evp_pkey_ctx_free_all_cached_data:
 1530|  70.0k|{
 1531|  70.0k|    evp_pkey_ctx_free_cached_data(ctx, EVP_PKEY_CTRL_SET1_ID, NULL);
  ------------------
  |  | 1824|  70.0k|#define EVP_PKEY_CTRL_SET1_ID 15
  ------------------
 1532|  70.0k|}

EVP_SIGNATURE_free:
  456|  80.6k|{
  457|  80.6k|    int i;
  458|       |
  459|  80.6k|    if (signature == NULL)
  ------------------
  |  Branch (459:9): [True: 0, False: 80.6k]
  ------------------
  460|      0|        return;
  461|  80.6k|    CRYPTO_DOWN_REF(&signature->refcnt, &i);
  462|  80.6k|    if (i > 0)
  ------------------
  |  Branch (462:9): [True: 43.3k, False: 37.2k]
  ------------------
  463|  43.3k|        return;
  464|  37.2k|    OPENSSL_free(signature->type_name);
  ------------------
  |  |  131|  37.2k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  465|  37.2k|    ossl_provider_free(signature->prov);
  466|  37.2k|    CRYPTO_FREE_REF(&signature->refcnt);
  467|  37.2k|    OPENSSL_free(signature);
  ------------------
  |  |  131|  37.2k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  468|  37.2k|}
EVP_SIGNATURE_up_ref:
  471|  43.3k|{
  472|  43.3k|    int ref = 0;
  473|       |
  474|  43.3k|    CRYPTO_UP_REF(&signature->refcnt, &ref);
  475|  43.3k|    return 1;
  476|  43.3k|}
EVP_SIGNATURE_fetch:
  485|  5.12k|{
  486|  5.12k|    return evp_generic_fetch(ctx, OSSL_OP_SIGNATURE, algorithm, properties,
  ------------------
  |  |  290|  5.12k|#define OSSL_OP_SIGNATURE 12
  ------------------
  487|  5.12k|        evp_signature_from_algorithm,
  488|  5.12k|        evp_signature_up_ref,
  489|  5.12k|        evp_signature_free);
  490|  5.12k|}
signature.c:evp_signature_from_algorithm:
   55|  37.2k|{
   56|  37.2k|    const OSSL_DISPATCH *fns = algodef->implementation;
   57|  37.2k|    EVP_SIGNATURE *signature = NULL;
   58|  37.2k|    const char *desc;
   59|       |    /* Counts newctx / freectx */
   60|  37.2k|    int ctxfncnt = 0;
   61|       |    /* Counts all init functions  */
   62|  37.2k|    int initfncnt = 0;
   63|       |    /* Counts all parameter functions */
   64|  37.2k|    int gparamfncnt = 0, sparamfncnt = 0, gmdparamfncnt = 0, smdparamfncnt = 0;
   65|  37.2k|    int valid = 0;
   66|       |
   67|  37.2k|    if ((signature = evp_signature_new(prov)) == NULL) {
  ------------------
  |  Branch (67:9): [True: 0, False: 37.2k]
  ------------------
   68|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   69|      0|        goto err;
   70|      0|    }
   71|       |
   72|  37.2k|    signature->name_id = name_id;
   73|  37.2k|    if ((signature->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 37.2k]
  ------------------
   74|      0|        goto err;
   75|  37.2k|    signature->description = algodef->algorithm_description;
   76|  37.2k|    desc = signature->description != NULL ? signature->description : "";
  ------------------
  |  Branch (76:12): [True: 7.58k, False: 29.7k]
  ------------------
   77|       |
   78|   682k|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (78:12): [True: 645k, False: 37.2k]
  ------------------
   79|   645k|        switch (fns->function_id) {
  ------------------
  |  Branch (79:17): [True: 645k, False: 0]
  ------------------
   80|  37.2k|        case OSSL_FUNC_SIGNATURE_NEWCTX:
  ------------------
  |  |  789|  37.2k|#define OSSL_FUNC_SIGNATURE_NEWCTX 1
  ------------------
  |  Branch (80:9): [True: 37.2k, False: 607k]
  ------------------
   81|  37.2k|            if (signature->newctx != NULL)
  ------------------
  |  Branch (81:17): [True: 0, False: 37.2k]
  ------------------
   82|      0|                break;
   83|  37.2k|            signature->newctx = OSSL_FUNC_signature_newctx(fns);
   84|  37.2k|            ctxfncnt++;
   85|  37.2k|            break;
   86|  26.5k|        case OSSL_FUNC_SIGNATURE_SIGN_INIT:
  ------------------
  |  |  790|  26.5k|#define OSSL_FUNC_SIGNATURE_SIGN_INIT 2
  ------------------
  |  Branch (86:9): [True: 26.5k, False: 618k]
  ------------------
   87|  26.5k|            if (signature->sign_init != NULL)
  ------------------
  |  Branch (87:17): [True: 1.26k, False: 25.2k]
  ------------------
   88|  1.26k|                break;
   89|  25.2k|            signature->sign_init = OSSL_FUNC_signature_sign_init(fns);
   90|  25.2k|            initfncnt++;
   91|  25.2k|            break;
   92|  34.7k|        case OSSL_FUNC_SIGNATURE_SIGN:
  ------------------
  |  |  791|  34.7k|#define OSSL_FUNC_SIGNATURE_SIGN 3
  ------------------
  |  Branch (92:9): [True: 34.7k, False: 610k]
  ------------------
   93|  34.7k|            if (signature->sign != NULL)
  ------------------
  |  Branch (93:17): [True: 0, False: 34.7k]
  ------------------
   94|      0|                break;
   95|  34.7k|            signature->sign = OSSL_FUNC_signature_sign(fns);
   96|  34.7k|            break;
   97|  32.2k|        case OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_INIT:
  ------------------
  |  |  815|  32.2k|#define OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_INIT 27
  ------------------
  |  Branch (97:9): [True: 32.2k, False: 613k]
  ------------------
   98|  32.2k|            if (signature->sign_message_init != NULL)
  ------------------
  |  Branch (98:17): [True: 0, False: 32.2k]
  ------------------
   99|      0|                break;
  100|  32.2k|            signature->sign_message_init
  101|  32.2k|                = OSSL_FUNC_signature_sign_message_init(fns);
  102|  32.2k|            initfncnt++;
  103|  32.2k|            break;
  104|  21.4k|        case OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_UPDATE:
  ------------------
  |  |  816|  21.4k|#define OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_UPDATE 28
  ------------------
  |  Branch (104:9): [True: 21.4k, False: 623k]
  ------------------
  105|  21.4k|            if (signature->sign_message_update != NULL)
  ------------------
  |  Branch (105:17): [True: 0, False: 21.4k]
  ------------------
  106|      0|                break;
  107|  21.4k|            signature->sign_message_update
  108|  21.4k|                = OSSL_FUNC_signature_sign_message_update(fns);
  109|  21.4k|            break;
  110|  21.4k|        case OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_FINAL:
  ------------------
  |  |  817|  21.4k|#define OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_FINAL 29
  ------------------
  |  Branch (110:9): [True: 21.4k, False: 623k]
  ------------------
  111|  21.4k|            if (signature->sign_message_final != NULL)
  ------------------
  |  Branch (111:17): [True: 0, False: 21.4k]
  ------------------
  112|      0|                break;
  113|  21.4k|            signature->sign_message_final
  114|  21.4k|                = OSSL_FUNC_signature_sign_message_final(fns);
  115|  21.4k|            break;
  116|  26.5k|        case OSSL_FUNC_SIGNATURE_VERIFY_INIT:
  ------------------
  |  |  792|  26.5k|#define OSSL_FUNC_SIGNATURE_VERIFY_INIT 4
  ------------------
  |  Branch (116:9): [True: 26.5k, False: 618k]
  ------------------
  117|  26.5k|            if (signature->verify_init != NULL)
  ------------------
  |  Branch (117:17): [True: 1.26k, False: 25.2k]
  ------------------
  118|  1.26k|                break;
  119|  25.2k|            signature->verify_init = OSSL_FUNC_signature_verify_init(fns);
  120|  25.2k|            initfncnt++;
  121|  25.2k|            break;
  122|  34.7k|        case OSSL_FUNC_SIGNATURE_VERIFY:
  ------------------
  |  |  793|  34.7k|#define OSSL_FUNC_SIGNATURE_VERIFY 5
  ------------------
  |  Branch (122:9): [True: 34.7k, False: 610k]
  ------------------
  123|  34.7k|            if (signature->verify != NULL)
  ------------------
  |  Branch (123:17): [True: 0, False: 34.7k]
  ------------------
  124|      0|                break;
  125|  34.7k|            signature->verify = OSSL_FUNC_signature_verify(fns);
  126|  34.7k|            break;
  127|  32.2k|        case OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_INIT:
  ------------------
  |  |  818|  32.2k|#define OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_INIT 30
  ------------------
  |  Branch (127:9): [True: 32.2k, False: 613k]
  ------------------
  128|  32.2k|            if (signature->verify_message_init != NULL)
  ------------------
  |  Branch (128:17): [True: 0, False: 32.2k]
  ------------------
  129|      0|                break;
  130|  32.2k|            signature->verify_message_init
  131|  32.2k|                = OSSL_FUNC_signature_verify_message_init(fns);
  132|  32.2k|            initfncnt++;
  133|  32.2k|            break;
  134|  21.4k|        case OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_UPDATE:
  ------------------
  |  |  819|  21.4k|#define OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_UPDATE 31
  ------------------
  |  Branch (134:9): [True: 21.4k, False: 623k]
  ------------------
  135|  21.4k|            if (signature->verify_message_update != NULL)
  ------------------
  |  Branch (135:17): [True: 0, False: 21.4k]
  ------------------
  136|      0|                break;
  137|  21.4k|            signature->verify_message_update
  138|  21.4k|                = OSSL_FUNC_signature_verify_message_update(fns);
  139|  21.4k|            break;
  140|  21.4k|        case OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_FINAL:
  ------------------
  |  |  820|  21.4k|#define OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_FINAL 32
  ------------------
  |  Branch (140:9): [True: 21.4k, False: 623k]
  ------------------
  141|  21.4k|            if (signature->verify_message_final != NULL)
  ------------------
  |  Branch (141:17): [True: 0, False: 21.4k]
  ------------------
  142|      0|                break;
  143|  21.4k|            signature->verify_message_final
  144|  21.4k|                = OSSL_FUNC_signature_verify_message_final(fns);
  145|  21.4k|            break;
  146|  8.84k|        case OSSL_FUNC_SIGNATURE_VERIFY_RECOVER_INIT:
  ------------------
  |  |  794|  8.84k|#define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER_INIT 6
  ------------------
  |  Branch (146:9): [True: 8.84k, False: 636k]
  ------------------
  147|  8.84k|            if (signature->verify_recover_init != NULL)
  ------------------
  |  Branch (147:17): [True: 0, False: 8.84k]
  ------------------
  148|      0|                break;
  149|  8.84k|            signature->verify_recover_init
  150|  8.84k|                = OSSL_FUNC_signature_verify_recover_init(fns);
  151|  8.84k|            initfncnt++;
  152|  8.84k|            break;
  153|  8.84k|        case OSSL_FUNC_SIGNATURE_VERIFY_RECOVER:
  ------------------
  |  |  795|  8.84k|#define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER 7
  ------------------
  |  Branch (153:9): [True: 8.84k, False: 636k]
  ------------------
  154|  8.84k|            if (signature->verify_recover != NULL)
  ------------------
  |  Branch (154:17): [True: 0, False: 8.84k]
  ------------------
  155|      0|                break;
  156|  8.84k|            signature->verify_recover
  157|  8.84k|                = OSSL_FUNC_signature_verify_recover(fns);
  158|  8.84k|            break;
  159|  15.8k|        case OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT:
  ------------------
  |  |  796|  15.8k|#define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT 8
  ------------------
  |  Branch (159:9): [True: 15.8k, False: 629k]
  ------------------
  160|  15.8k|            if (signature->digest_sign_init != NULL)
  ------------------
  |  Branch (160:17): [True: 0, False: 15.8k]
  ------------------
  161|      0|                break;
  162|  15.8k|            signature->digest_sign_init
  163|  15.8k|                = OSSL_FUNC_signature_digest_sign_init(fns);
  164|  15.8k|            initfncnt++;
  165|  15.8k|            break;
  166|  5.05k|        case OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE:
  ------------------
  |  |  797|  5.05k|#define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE 9
  ------------------
  |  Branch (166:9): [True: 5.05k, False: 640k]
  ------------------
  167|  5.05k|            if (signature->digest_sign_update != NULL)
  ------------------
  |  Branch (167:17): [True: 0, False: 5.05k]
  ------------------
  168|      0|                break;
  169|  5.05k|            signature->digest_sign_update
  170|  5.05k|                = OSSL_FUNC_signature_digest_sign_update(fns);
  171|  5.05k|            break;
  172|  5.05k|        case OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL:
  ------------------
  |  |  798|  5.05k|#define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL 10
  ------------------
  |  Branch (172:9): [True: 5.05k, False: 640k]
  ------------------
  173|  5.05k|            if (signature->digest_sign_final != NULL)
  ------------------
  |  Branch (173:17): [True: 0, False: 5.05k]
  ------------------
  174|      0|                break;
  175|  5.05k|            signature->digest_sign_final
  176|  5.05k|                = OSSL_FUNC_signature_digest_sign_final(fns);
  177|  5.05k|            break;
  178|  10.7k|        case OSSL_FUNC_SIGNATURE_DIGEST_SIGN:
  ------------------
  |  |  799|  10.7k|#define OSSL_FUNC_SIGNATURE_DIGEST_SIGN 11
  ------------------
  |  Branch (178:9): [True: 10.7k, False: 634k]
  ------------------
  179|  10.7k|            if (signature->digest_sign != NULL)
  ------------------
  |  Branch (179:17): [True: 0, False: 10.7k]
  ------------------
  180|      0|                break;
  181|  10.7k|            signature->digest_sign
  182|  10.7k|                = OSSL_FUNC_signature_digest_sign(fns);
  183|  10.7k|            break;
  184|  13.2k|        case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT:
  ------------------
  |  |  800|  13.2k|#define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT 12
  ------------------
  |  Branch (184:9): [True: 13.2k, False: 632k]
  ------------------
  185|  13.2k|            if (signature->digest_verify_init != NULL)
  ------------------
  |  Branch (185:17): [True: 0, False: 13.2k]
  ------------------
  186|      0|                break;
  187|  13.2k|            signature->digest_verify_init
  188|  13.2k|                = OSSL_FUNC_signature_digest_verify_init(fns);
  189|  13.2k|            initfncnt++;
  190|  13.2k|            break;
  191|  2.52k|        case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE:
  ------------------
  |  |  801|  2.52k|#define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE 13
  ------------------
  |  Branch (191:9): [True: 2.52k, False: 642k]
  ------------------
  192|  2.52k|            if (signature->digest_verify_update != NULL)
  ------------------
  |  Branch (192:17): [True: 0, False: 2.52k]
  ------------------
  193|      0|                break;
  194|  2.52k|            signature->digest_verify_update
  195|  2.52k|                = OSSL_FUNC_signature_digest_verify_update(fns);
  196|  2.52k|            break;
  197|  2.52k|        case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL:
  ------------------
  |  |  802|  2.52k|#define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL 14
  ------------------
  |  Branch (197:9): [True: 2.52k, False: 642k]
  ------------------
  198|  2.52k|            if (signature->digest_verify_final != NULL)
  ------------------
  |  Branch (198:17): [True: 0, False: 2.52k]
  ------------------
  199|      0|                break;
  200|  2.52k|            signature->digest_verify_final
  201|  2.52k|                = OSSL_FUNC_signature_digest_verify_final(fns);
  202|  2.52k|            break;
  203|  10.7k|        case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY:
  ------------------
  |  |  803|  10.7k|#define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY 15
  ------------------
  |  Branch (203:9): [True: 10.7k, False: 634k]
  ------------------
  204|  10.7k|            if (signature->digest_verify != NULL)
  ------------------
  |  Branch (204:17): [True: 0, False: 10.7k]
  ------------------
  205|      0|                break;
  206|  10.7k|            signature->digest_verify
  207|  10.7k|                = OSSL_FUNC_signature_digest_verify(fns);
  208|  10.7k|            break;
  209|  37.2k|        case OSSL_FUNC_SIGNATURE_FREECTX:
  ------------------
  |  |  804|  37.2k|#define OSSL_FUNC_SIGNATURE_FREECTX 16
  ------------------
  |  Branch (209:9): [True: 37.2k, False: 607k]
  ------------------
  210|  37.2k|            if (signature->freectx != NULL)
  ------------------
  |  Branch (210:17): [True: 0, False: 37.2k]
  ------------------
  211|      0|                break;
  212|  37.2k|            signature->freectx = OSSL_FUNC_signature_freectx(fns);
  213|  37.2k|            ctxfncnt++;
  214|  37.2k|            break;
  215|  37.2k|        case OSSL_FUNC_SIGNATURE_DUPCTX:
  ------------------
  |  |  805|  37.2k|#define OSSL_FUNC_SIGNATURE_DUPCTX 17
  ------------------
  |  Branch (215:9): [True: 37.2k, False: 607k]
  ------------------
  216|  37.2k|            if (signature->dupctx != NULL)
  ------------------
  |  Branch (216:17): [True: 0, False: 37.2k]
  ------------------
  217|      0|                break;
  218|  37.2k|            signature->dupctx = OSSL_FUNC_signature_dupctx(fns);
  219|  37.2k|            break;
  220|  34.7k|        case OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS:
  ------------------
  |  |  806|  34.7k|#define OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS 18
  ------------------
  |  Branch (220:9): [True: 34.7k, False: 610k]
  ------------------
  221|  34.7k|            if (signature->get_ctx_params != NULL)
  ------------------
  |  Branch (221:17): [True: 0, False: 34.7k]
  ------------------
  222|      0|                break;
  223|  34.7k|            signature->get_ctx_params
  224|  34.7k|                = OSSL_FUNC_signature_get_ctx_params(fns);
  225|  34.7k|            gparamfncnt++;
  226|  34.7k|            break;
  227|  34.7k|        case OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  807|  34.7k|#define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS 19
  ------------------
  |  Branch (227:9): [True: 34.7k, False: 610k]
  ------------------
  228|  34.7k|            if (signature->gettable_ctx_params != NULL)
  ------------------
  |  Branch (228:17): [True: 0, False: 34.7k]
  ------------------
  229|      0|                break;
  230|  34.7k|            signature->gettable_ctx_params
  231|  34.7k|                = OSSL_FUNC_signature_gettable_ctx_params(fns);
  232|  34.7k|            gparamfncnt++;
  233|  34.7k|            break;
  234|  37.2k|        case OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS:
  ------------------
  |  |  808|  37.2k|#define OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS 20
  ------------------
  |  Branch (234:9): [True: 37.2k, False: 607k]
  ------------------
  235|  37.2k|            if (signature->set_ctx_params != NULL)
  ------------------
  |  Branch (235:17): [True: 0, False: 37.2k]
  ------------------
  236|      0|                break;
  237|  37.2k|            signature->set_ctx_params
  238|  37.2k|                = OSSL_FUNC_signature_set_ctx_params(fns);
  239|  37.2k|            sparamfncnt++;
  240|  37.2k|            break;
  241|  37.2k|        case OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  809|  37.2k|#define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS 21
  ------------------
  |  Branch (241:9): [True: 37.2k, False: 607k]
  ------------------
  242|  37.2k|            if (signature->settable_ctx_params != NULL)
  ------------------
  |  Branch (242:17): [True: 0, False: 37.2k]
  ------------------
  243|      0|                break;
  244|  37.2k|            signature->settable_ctx_params
  245|  37.2k|                = OSSL_FUNC_signature_settable_ctx_params(fns);
  246|  37.2k|            sparamfncnt++;
  247|  37.2k|            break;
  248|  2.52k|        case OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS:
  ------------------
  |  |  810|  2.52k|#define OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS 22
  ------------------
  |  Branch (248:9): [True: 2.52k, False: 642k]
  ------------------
  249|  2.52k|            if (signature->get_ctx_md_params != NULL)
  ------------------
  |  Branch (249:17): [True: 0, False: 2.52k]
  ------------------
  250|      0|                break;
  251|  2.52k|            signature->get_ctx_md_params
  252|  2.52k|                = OSSL_FUNC_signature_get_ctx_md_params(fns);
  253|  2.52k|            gmdparamfncnt++;
  254|  2.52k|            break;
  255|  2.52k|        case OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS:
  ------------------
  |  |  811|  2.52k|#define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS 23
  ------------------
  |  Branch (255:9): [True: 2.52k, False: 642k]
  ------------------
  256|  2.52k|            if (signature->gettable_ctx_md_params != NULL)
  ------------------
  |  Branch (256:17): [True: 0, False: 2.52k]
  ------------------
  257|      0|                break;
  258|  2.52k|            signature->gettable_ctx_md_params
  259|  2.52k|                = OSSL_FUNC_signature_gettable_ctx_md_params(fns);
  260|  2.52k|            gmdparamfncnt++;
  261|  2.52k|            break;
  262|  2.52k|        case OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS:
  ------------------
  |  |  812|  2.52k|#define OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS 24
  ------------------
  |  Branch (262:9): [True: 2.52k, False: 642k]
  ------------------
  263|  2.52k|            if (signature->set_ctx_md_params != NULL)
  ------------------
  |  Branch (263:17): [True: 0, False: 2.52k]
  ------------------
  264|      0|                break;
  265|  2.52k|            signature->set_ctx_md_params
  266|  2.52k|                = OSSL_FUNC_signature_set_ctx_md_params(fns);
  267|  2.52k|            smdparamfncnt++;
  268|  2.52k|            break;
  269|  2.52k|        case OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS:
  ------------------
  |  |  813|  2.52k|#define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS 25
  ------------------
  |  Branch (269:9): [True: 2.52k, False: 642k]
  ------------------
  270|  2.52k|            if (signature->settable_ctx_md_params != NULL)
  ------------------
  |  Branch (270:17): [True: 0, False: 2.52k]
  ------------------
  271|      0|                break;
  272|  2.52k|            signature->settable_ctx_md_params
  273|  2.52k|                = OSSL_FUNC_signature_settable_ctx_md_params(fns);
  274|  2.52k|            smdparamfncnt++;
  275|  2.52k|            break;
  276|  22.7k|        case OSSL_FUNC_SIGNATURE_QUERY_KEY_TYPES:
  ------------------
  |  |  814|  22.7k|#define OSSL_FUNC_SIGNATURE_QUERY_KEY_TYPES 26
  ------------------
  |  Branch (276:9): [True: 22.7k, False: 622k]
  ------------------
  277|  22.7k|            if (signature->query_key_types != NULL)
  ------------------
  |  Branch (277:17): [True: 0, False: 22.7k]
  ------------------
  278|      0|                break;
  279|  22.7k|            signature->query_key_types
  280|  22.7k|                = OSSL_FUNC_signature_query_key_types(fns);
  281|  22.7k|            break;
  282|   645k|        }
  283|   645k|    }
  284|       |    /*
  285|       |     * In order to be a consistent set of functions we must have at least
  286|       |     * a set of context functions (newctx and freectx) as well as a set of
  287|       |     * "signature" functions.  Because there's an overlap between some sets
  288|       |     * of functions, counters don't always cut it, we must test known
  289|       |     * combinations.
  290|       |     * We start by assuming the implementation is valid, and then look for
  291|       |     * reasons it's not.
  292|       |     */
  293|  37.2k|    valid = 1;
  294|       |    /* Start with the ones where counters say enough */
  295|  37.2k|    if (ctxfncnt != 2) {
  ------------------
  |  Branch (295:9): [True: 0, False: 37.2k]
  ------------------
  296|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   78|      0|#define ERR_LIB_EVP 6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   70|      0|#define EVP_R_INVALID_PROVIDER_FUNCTIONS 193
  ------------------
  297|      0|            "missing %s newctx or freectx:%s", signature->type_name, desc);
  298|      0|        valid = 0;
  299|      0|    }
  300|  37.2k|    if (valid
  ------------------
  |  Branch (300:9): [True: 37.2k, False: 0]
  ------------------
  301|  37.2k|        && ((gparamfncnt != 0 && gparamfncnt != 2)
  ------------------
  |  Branch (301:14): [True: 34.7k, False: 2.52k]
  |  Branch (301:34): [True: 0, False: 34.7k]
  ------------------
  302|  37.2k|            || (sparamfncnt != 0 && sparamfncnt != 2)
  ------------------
  |  Branch (302:17): [True: 37.2k, False: 0]
  |  Branch (302:37): [True: 0, False: 37.2k]
  ------------------
  303|  37.2k|            || (gmdparamfncnt != 0 && gmdparamfncnt != 2)
  ------------------
  |  Branch (303:17): [True: 2.52k, False: 34.7k]
  |  Branch (303:39): [True: 0, False: 2.52k]
  ------------------
  304|  37.2k|            || (smdparamfncnt != 0 && smdparamfncnt != 2))) {
  ------------------
  |  Branch (304:17): [True: 2.52k, False: 34.7k]
  |  Branch (304:39): [True: 0, False: 2.52k]
  ------------------
  305|       |        /*
  306|       |         * Params functions are optional, but if defined, they must
  307|       |         * be pairwise complete sets, i.e. a getter must have an
  308|       |         * associated gettable, etc
  309|       |         */
  310|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   78|      0|#define ERR_LIB_EVP 6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   70|      0|#define EVP_R_INVALID_PROVIDER_FUNCTIONS 193
  ------------------
  311|      0|            "missing %s params getter or setter:%s", signature->type_name, desc);
  312|      0|        valid = 0;
  313|      0|    }
  314|  37.2k|    if (valid && initfncnt == 0) {
  ------------------
  |  Branch (314:9): [True: 37.2k, False: 0]
  |  Branch (314:18): [True: 0, False: 37.2k]
  ------------------
  315|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   78|      0|#define ERR_LIB_EVP 6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   70|      0|#define EVP_R_INVALID_PROVIDER_FUNCTIONS 193
  ------------------
  316|      0|            "missing %s init:%s", signature->type_name, desc);
  317|      0|        valid = 0;
  318|      0|    }
  319|       |
  320|       |    /* Now we check for function combinations */
  321|  37.2k|    if (valid
  ------------------
  |  Branch (321:9): [True: 37.2k, False: 0]
  ------------------
  322|  37.2k|        && ((signature->sign_init != NULL
  ------------------
  |  Branch (322:14): [True: 25.2k, False: 12.0k]
  ------------------
  323|  25.2k|                && signature->sign == NULL)
  ------------------
  |  Branch (323:20): [True: 0, False: 25.2k]
  ------------------
  324|  37.2k|            || (signature->sign_message_init != NULL
  ------------------
  |  Branch (324:17): [True: 32.2k, False: 5.05k]
  ------------------
  325|  32.2k|                && signature->sign == NULL
  ------------------
  |  Branch (325:20): [True: 0, False: 32.2k]
  ------------------
  326|      0|                && (signature->sign_message_update == NULL
  ------------------
  |  Branch (326:21): [True: 0, False: 0]
  ------------------
  327|      0|                    || signature->sign_message_final == NULL)))) {
  ------------------
  |  Branch (327:24): [True: 0, False: 0]
  ------------------
  328|       |        /* sign_init function(s) with no signing function?  That's weird */
  329|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   78|      0|#define ERR_LIB_EVP 6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   70|      0|#define EVP_R_INVALID_PROVIDER_FUNCTIONS 193
  ------------------
  330|      0|            "missing %s signing function:%s", signature->type_name, desc);
  331|      0|        valid = 0;
  332|      0|    }
  333|  37.2k|    if (valid
  ------------------
  |  Branch (333:9): [True: 37.2k, False: 0]
  ------------------
  334|  37.2k|        && (signature->sign != NULL
  ------------------
  |  Branch (334:13): [True: 34.7k, False: 2.52k]
  ------------------
  335|  2.52k|            || signature->sign_message_update != NULL
  ------------------
  |  Branch (335:16): [True: 0, False: 2.52k]
  ------------------
  336|  2.52k|            || signature->sign_message_final != NULL)
  ------------------
  |  Branch (336:16): [True: 0, False: 2.52k]
  ------------------
  337|  34.7k|        && signature->sign_init == NULL
  ------------------
  |  Branch (337:12): [True: 9.48k, False: 25.2k]
  ------------------
  338|  9.48k|        && signature->sign_message_init == NULL) {
  ------------------
  |  Branch (338:12): [True: 0, False: 9.48k]
  ------------------
  339|       |        /* signing function(s) with no sign_init? That's odd */
  340|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   78|      0|#define ERR_LIB_EVP 6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   70|      0|#define EVP_R_INVALID_PROVIDER_FUNCTIONS 193
  ------------------
  341|      0|            "missing %s sign_init or sign_message_init:%s", signature->type_name, desc);
  342|      0|        valid = 0;
  343|      0|    }
  344|       |
  345|  37.2k|    if (valid
  ------------------
  |  Branch (345:9): [True: 37.2k, False: 0]
  ------------------
  346|  37.2k|        && ((signature->verify_init != NULL
  ------------------
  |  Branch (346:14): [True: 25.2k, False: 12.0k]
  ------------------
  347|  25.2k|                && signature->verify == NULL)
  ------------------
  |  Branch (347:20): [True: 0, False: 25.2k]
  ------------------
  348|  37.2k|            || (signature->verify_message_init != NULL
  ------------------
  |  Branch (348:17): [True: 32.2k, False: 5.05k]
  ------------------
  349|  32.2k|                && signature->verify == NULL
  ------------------
  |  Branch (349:20): [True: 0, False: 32.2k]
  ------------------
  350|      0|                && (signature->verify_message_update == NULL
  ------------------
  |  Branch (350:21): [True: 0, False: 0]
  ------------------
  351|      0|                    || signature->verify_message_final == NULL)))) {
  ------------------
  |  Branch (351:24): [True: 0, False: 0]
  ------------------
  352|       |        /* verify_init function(s) with no verification function?  That's weird */
  353|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   78|      0|#define ERR_LIB_EVP 6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   70|      0|#define EVP_R_INVALID_PROVIDER_FUNCTIONS 193
  ------------------
  354|      0|            "missing %s verification function:%s", signature->type_name, desc);
  355|      0|        valid = 0;
  356|      0|    }
  357|  37.2k|    if (valid
  ------------------
  |  Branch (357:9): [True: 37.2k, False: 0]
  ------------------
  358|  37.2k|        && (signature->verify != NULL
  ------------------
  |  Branch (358:13): [True: 34.7k, False: 2.52k]
  ------------------
  359|  2.52k|            || signature->verify_message_update != NULL
  ------------------
  |  Branch (359:16): [True: 0, False: 2.52k]
  ------------------
  360|  2.52k|            || signature->verify_message_final != NULL)
  ------------------
  |  Branch (360:16): [True: 0, False: 2.52k]
  ------------------
  361|  34.7k|        && signature->verify_init == NULL
  ------------------
  |  Branch (361:12): [True: 9.48k, False: 25.2k]
  ------------------
  362|  9.48k|        && signature->verify_message_init == NULL) {
  ------------------
  |  Branch (362:12): [True: 0, False: 9.48k]
  ------------------
  363|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   78|      0|#define ERR_LIB_EVP 6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   70|      0|#define EVP_R_INVALID_PROVIDER_FUNCTIONS 193
  ------------------
  364|      0|            "missing %s verify_init or verify_message_init:%s",
  365|      0|            signature->type_name, desc);
  366|       |        /* verification function(s) with no verify_init? That's odd */
  367|      0|        valid = 0;
  368|      0|    }
  369|       |
  370|  37.2k|    if (valid
  ------------------
  |  Branch (370:9): [True: 37.2k, False: 0]
  ------------------
  371|  37.2k|        && (signature->verify_recover_init != NULL)
  ------------------
  |  Branch (371:12): [True: 8.84k, False: 28.4k]
  ------------------
  372|  8.84k|        && (signature->verify_recover == NULL)) {
  ------------------
  |  Branch (372:12): [True: 0, False: 8.84k]
  ------------------
  373|       |        /* verify_recover_init function with no verify_recover?  How quaint */
  374|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   78|      0|#define ERR_LIB_EVP 6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   70|      0|#define EVP_R_INVALID_PROVIDER_FUNCTIONS 193
  ------------------
  375|      0|            "missing %s verify_recover:%s", signature->type_name, desc);
  376|      0|        valid = 0;
  377|      0|    }
  378|       |
  379|  37.2k|    if (valid
  ------------------
  |  Branch (379:9): [True: 37.2k, False: 0]
  ------------------
  380|  37.2k|        && (signature->digest_sign_init != NULL
  ------------------
  |  Branch (380:13): [True: 15.8k, False: 21.4k]
  ------------------
  381|  15.8k|            && signature->digest_sign == NULL
  ------------------
  |  Branch (381:16): [True: 5.05k, False: 10.7k]
  ------------------
  382|  5.05k|            && (signature->digest_sign_update == NULL
  ------------------
  |  Branch (382:17): [True: 0, False: 5.05k]
  ------------------
  383|  5.05k|                || signature->digest_sign_final == NULL))) {
  ------------------
  |  Branch (383:20): [True: 0, False: 5.05k]
  ------------------
  384|       |        /* You can't have a digest_sign_init without *some* performing functions */
  385|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   78|      0|#define ERR_LIB_EVP 6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   70|      0|#define EVP_R_INVALID_PROVIDER_FUNCTIONS 193
  ------------------
  386|      0|            "missing %s digest_sign function:%s", signature->type_name, desc);
  387|      0|        valid = 0;
  388|      0|    }
  389|       |
  390|  37.2k|    if (valid
  ------------------
  |  Branch (390:9): [True: 37.2k, False: 0]
  ------------------
  391|  37.2k|        && ((signature->digest_verify_init != NULL
  ------------------
  |  Branch (391:14): [True: 13.2k, False: 24.0k]
  ------------------
  392|  13.2k|            && signature->digest_verify == NULL
  ------------------
  |  Branch (392:16): [True: 2.52k, False: 10.7k]
  ------------------
  393|  2.52k|            && (signature->digest_verify_update == NULL
  ------------------
  |  Branch (393:17): [True: 0, False: 2.52k]
  ------------------
  394|  2.52k|                || signature->digest_verify_final == NULL)))) {
  ------------------
  |  Branch (394:20): [True: 0, False: 2.52k]
  ------------------
  395|       |        /* You can't have a digest_verify_init without *some* performing functions */
  396|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   78|      0|#define ERR_LIB_EVP 6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   70|      0|#define EVP_R_INVALID_PROVIDER_FUNCTIONS 193
  ------------------
  397|      0|            "missing %s digest_verify function:%s", signature->type_name, desc);
  398|      0|        valid = 0;
  399|      0|    }
  400|       |
  401|  37.2k|    if (!valid)
  ------------------
  |  Branch (401:9): [True: 0, False: 37.2k]
  ------------------
  402|      0|        goto err;
  403|       |
  404|  37.2k|    if ((signature->digest_sign != NULL
  ------------------
  |  Branch (404:10): [True: 10.7k, False: 26.5k]
  ------------------
  405|  26.5k|            || signature->digest_sign_update != NULL
  ------------------
  |  Branch (405:16): [True: 5.05k, False: 21.4k]
  ------------------
  406|  21.4k|            || signature->digest_sign_final != NULL)
  ------------------
  |  Branch (406:16): [True: 0, False: 21.4k]
  ------------------
  407|  15.8k|        && signature->digest_sign_init == NULL) {
  ------------------
  |  Branch (407:12): [True: 0, False: 15.8k]
  ------------------
  408|       |        /* digest signing function(s) with no digest_sign_init? That's odd */
  409|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   78|      0|#define ERR_LIB_EVP 6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   70|      0|#define EVP_R_INVALID_PROVIDER_FUNCTIONS 193
  ------------------
  410|      0|            "missing %s digest_sign_init:%s", signature->type_name, desc);
  411|      0|        goto err;
  412|      0|    }
  413|       |
  414|  37.2k|    if ((signature->digest_verify != NULL
  ------------------
  |  Branch (414:10): [True: 10.7k, False: 26.5k]
  ------------------
  415|  26.5k|            || signature->digest_verify_update != NULL
  ------------------
  |  Branch (415:16): [True: 2.52k, False: 24.0k]
  ------------------
  416|  24.0k|            || signature->digest_verify_final != NULL)
  ------------------
  |  Branch (416:16): [True: 0, False: 24.0k]
  ------------------
  417|  13.2k|        && signature->digest_verify_init == NULL) {
  ------------------
  |  Branch (417:12): [True: 0, False: 13.2k]
  ------------------
  418|       |        /* digest verification function(s) with no digest_verify_init? That's odd */
  419|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   78|      0|#define ERR_LIB_EVP 6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   70|      0|#define EVP_R_INVALID_PROVIDER_FUNCTIONS 193
  ------------------
  420|      0|            "missing %s digest_verify_init:%s", signature->type_name, desc);
  421|      0|        goto err;
  422|      0|    }
  423|       |
  424|  37.2k|    if ((signature->sign_message_update == NULL) != (signature->sign_message_final == NULL)) {
  ------------------
  |  Branch (424:9): [True: 0, False: 37.2k]
  ------------------
  425|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   78|      0|#define ERR_LIB_EVP 6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   70|      0|#define EVP_R_INVALID_PROVIDER_FUNCTIONS 193
  ------------------
  426|      0|            "only one of %s message signing update and final available:%s",
  427|      0|            signature->type_name, desc);
  428|      0|        goto err;
  429|      0|    }
  430|  37.2k|    if ((signature->verify_message_update == NULL) != (signature->verify_message_final == NULL)) {
  ------------------
  |  Branch (430:9): [True: 0, False: 37.2k]
  ------------------
  431|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   78|      0|#define ERR_LIB_EVP 6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   70|      0|#define EVP_R_INVALID_PROVIDER_FUNCTIONS 193
  ------------------
  432|      0|            "only one of %s message verification update and final available:%s",
  433|      0|            signature->type_name, desc);
  434|      0|        goto err;
  435|      0|    }
  436|  37.2k|    if ((signature->digest_sign_update == NULL) != (signature->digest_sign_final == NULL)) {
  ------------------
  |  Branch (436:9): [True: 0, False: 37.2k]
  ------------------
  437|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   78|      0|#define ERR_LIB_EVP 6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   70|      0|#define EVP_R_INVALID_PROVIDER_FUNCTIONS 193
  ------------------
  438|      0|            "only one of %s digest signing update and final available:%s",
  439|      0|            signature->type_name, desc);
  440|      0|        goto err;
  441|      0|    }
  442|  37.2k|    if ((signature->digest_verify_update == NULL) != (signature->digest_verify_final == NULL)) {
  ------------------
  |  Branch (442:9): [True: 0, False: 37.2k]
  ------------------
  443|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   78|      0|#define ERR_LIB_EVP 6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   70|      0|#define EVP_R_INVALID_PROVIDER_FUNCTIONS 193
  ------------------
  444|      0|            "only one of %s digest verification update and final available:%s",
  445|      0|            signature->type_name, desc);
  446|      0|        goto err;
  447|      0|    }
  448|       |
  449|  37.2k|    return signature;
  450|      0|err:
  451|      0|    EVP_SIGNATURE_free(signature);
  452|       |    return NULL;
  453|  37.2k|}
signature.c:evp_signature_new:
   34|  37.2k|{
   35|  37.2k|    EVP_SIGNATURE *signature = OPENSSL_zalloc(sizeof(EVP_SIGNATURE));
  ------------------
  |  |  108|  37.2k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   36|       |
   37|  37.2k|    if (signature == NULL)
  ------------------
  |  Branch (37:9): [True: 0, False: 37.2k]
  ------------------
   38|      0|        return NULL;
   39|       |
   40|  37.2k|    if (!CRYPTO_NEW_REF(&signature->refcnt, 1)
  ------------------
  |  Branch (40:9): [True: 0, False: 37.2k]
  ------------------
   41|  37.2k|        || !ossl_provider_up_ref(prov)) {
  ------------------
  |  Branch (41:12): [True: 0, False: 37.2k]
  ------------------
   42|      0|        CRYPTO_FREE_REF(&signature->refcnt);
   43|      0|        OPENSSL_free(signature);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   44|      0|        return NULL;
   45|      0|    }
   46|       |
   47|  37.2k|    signature->prov = prov;
   48|       |
   49|  37.2k|    return signature;
   50|  37.2k|}
signature.c:evp_signature_up_ref:
   29|  43.3k|{
   30|  43.3k|    return EVP_SIGNATURE_up_ref(data);
   31|  43.3k|}
signature.c:evp_signature_free:
   24|  75.6k|{
   25|  75.6k|    EVP_SIGNATURE_free(data);
   26|  75.6k|}

ossl_do_ex_data_init:
   15|    787|{
   16|    787|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   17|       |
   18|    787|    if (global == NULL)
  ------------------
  |  Branch (18:9): [True: 0, False: 787]
  ------------------
   19|      0|        return 0;
   20|       |
   21|    787|    global->ex_data_lock = CRYPTO_THREAD_lock_new();
   22|       |    return global->ex_data_lock != NULL;
   23|    787|}
ossl_crypto_cleanup_all_ex_data_int:
   73|    787|{
   74|    787|    int i;
   75|    787|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   76|       |
   77|    787|    if (global == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 787]
  ------------------
   78|      0|        return;
   79|       |
   80|  14.9k|    for (i = 0; i < CRYPTO_EX_INDEX__COUNT; ++i) {
  ------------------
  |  |  269|  14.9k|#define CRYPTO_EX_INDEX__COUNT 18
  ------------------
  |  Branch (80:17): [True: 14.1k, False: 787]
  ------------------
   81|  14.1k|        EX_CALLBACKS *ip = &global->ex_data[i];
   82|       |
   83|  14.1k|        sk_EX_CALLBACK_pop_free(ip->meth, cleanup_cb);
   84|  14.1k|        ip->meth = NULL;
   85|  14.1k|    }
   86|       |
   87|    787|    CRYPTO_THREAD_lock_free(global->ex_data_lock);
   88|       |    global->ex_data_lock = NULL;
   89|    787|}
ossl_crypto_get_ex_new_index_ex:
  154|      2|{
  155|      2|    int toret = -1;
  156|      2|    EX_CALLBACK *a;
  157|      2|    EX_CALLBACKS *ip;
  158|      2|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
  159|       |
  160|      2|    if (global == NULL)
  ------------------
  |  Branch (160:9): [True: 0, False: 2]
  ------------------
  161|      0|        return -1;
  162|       |
  163|      2|    ip = get_and_lock(global, class_index, 0);
  164|      2|    if (ip == NULL)
  ------------------
  |  Branch (164:9): [True: 0, False: 2]
  ------------------
  165|      0|        return -1;
  166|       |
  167|      2|    if (ip->meth == NULL) {
  ------------------
  |  Branch (167:9): [True: 2, False: 0]
  ------------------
  168|      2|        ip->meth = sk_EX_CALLBACK_new_null();
  169|       |        /* We push an initial value on the stack because the SSL
  170|       |         * "app_data" routines use ex_data index zero.  See RT 3710. */
  171|      2|        if (ip->meth == NULL
  ------------------
  |  Branch (171:13): [True: 0, False: 2]
  ------------------
  172|      2|            || !sk_EX_CALLBACK_push(ip->meth, NULL)) {
  ------------------
  |  Branch (172:16): [True: 0, False: 2]
  ------------------
  173|      0|            sk_EX_CALLBACK_free(ip->meth);
  174|      0|            ip->meth = NULL;
  175|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  176|      0|            goto err;
  177|      0|        }
  178|      2|    }
  179|       |
  180|      2|    a = (EX_CALLBACK *)OPENSSL_malloc(sizeof(*a));
  ------------------
  |  |  106|      2|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  181|      2|    if (a == NULL)
  ------------------
  |  Branch (181:9): [True: 0, False: 2]
  ------------------
  182|      0|        goto err;
  183|      2|    a->argl = argl;
  184|      2|    a->argp = argp;
  185|      2|    a->new_func = new_func;
  186|      2|    a->dup_func = dup_func;
  187|      2|    a->free_func = free_func;
  188|      2|    a->priority = priority;
  189|       |
  190|      2|    if (!sk_EX_CALLBACK_push(ip->meth, NULL)) {
  ------------------
  |  Branch (190:9): [True: 0, False: 2]
  ------------------
  191|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  192|      0|        OPENSSL_free(a);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  193|      0|        goto err;
  194|      0|    }
  195|      2|    toret = sk_EX_CALLBACK_num(ip->meth) - 1;
  196|      2|    (void)sk_EX_CALLBACK_set(ip->meth, toret, a);
  197|       |
  198|      2|err:
  199|      2|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  200|      2|    return toret;
  201|      2|}
CRYPTO_get_ex_new_index:
  206|      2|{
  207|       |    return ossl_crypto_get_ex_new_index_ex(NULL, class_index, argl, argp,
  208|      2|        new_func, dup_func, free_func, 0);
  209|      2|}
ossl_crypto_new_ex_data_ex:
  220|  4.57M|{
  221|  4.57M|    int mx, i;
  222|  4.57M|    void *ptr;
  223|  4.57M|    EX_CALLBACK **storage = NULL;
  224|  4.57M|    EX_CALLBACK *stack[10];
  225|  4.57M|    EX_CALLBACKS *ip;
  226|  4.57M|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
  227|       |
  228|  4.57M|    if (global == NULL)
  ------------------
  |  Branch (228:9): [True: 0, False: 4.57M]
  ------------------
  229|      0|        return 0;
  230|       |
  231|  4.57M|    ip = get_and_lock(global, class_index, 1);
  232|  4.57M|    if (ip == NULL)
  ------------------
  |  Branch (232:9): [True: 0, False: 4.57M]
  ------------------
  233|      0|        return 0;
  234|       |
  235|  4.57M|    ad->ctx = ctx;
  236|  4.57M|    ad->sk = NULL;
  237|  4.57M|    mx = sk_EX_CALLBACK_num(ip->meth);
  238|  4.57M|    if (mx > 0) {
  ------------------
  |  Branch (238:9): [True: 819, False: 4.57M]
  ------------------
  239|    819|        if (mx < (int)OSSL_NELEM(stack))
  ------------------
  |  |   14|    819|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (239:13): [True: 819, False: 0]
  ------------------
  240|    819|            storage = stack;
  241|      0|        else
  242|      0|            storage = OPENSSL_malloc_array(mx, sizeof(*storage));
  ------------------
  |  |  110|      0|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  243|    819|        if (storage != NULL)
  ------------------
  |  Branch (243:13): [True: 819, False: 0]
  ------------------
  244|  2.45k|            for (i = 0; i < mx; i++)
  ------------------
  |  Branch (244:25): [True: 1.63k, False: 819]
  ------------------
  245|  1.63k|                storage[i] = sk_EX_CALLBACK_value(ip->meth, i);
  246|    819|    }
  247|  4.57M|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  248|       |
  249|  4.57M|    if (mx > 0 && storage == NULL)
  ------------------
  |  Branch (249:9): [True: 819, False: 4.57M]
  |  Branch (249:19): [True: 0, False: 819]
  ------------------
  250|      0|        return 0;
  251|  4.58M|    for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (251:17): [True: 1.63k, False: 4.57M]
  ------------------
  252|  1.63k|        if (storage[i] != NULL && storage[i]->new_func != NULL) {
  ------------------
  |  Branch (252:13): [True: 819, False: 819]
  |  Branch (252:35): [True: 0, False: 819]
  ------------------
  253|      0|            ptr = CRYPTO_get_ex_data(ad, i);
  254|      0|            storage[i]->new_func(obj, ptr, ad, i,
  255|      0|                storage[i]->argl, storage[i]->argp);
  256|      0|        }
  257|  1.63k|    }
  258|  4.57M|    if (storage != stack)
  ------------------
  |  Branch (258:9): [True: 4.57M, False: 819]
  ------------------
  259|  4.57M|        OPENSSL_free(storage);
  ------------------
  |  |  131|  4.57M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  260|  4.57M|    return 1;
  261|  4.57M|}
CRYPTO_new_ex_data:
  264|  4.57M|{
  265|       |    return ossl_crypto_new_ex_data_ex(NULL, class_index, obj, ad);
  266|  4.57M|}
CRYPTO_free_ex_data:
  367|  4.57M|{
  368|  4.57M|    int mx, i;
  369|  4.57M|    EX_CALLBACKS *ip;
  370|  4.57M|    void *ptr;
  371|  4.57M|    const EX_CALLBACK *f;
  372|  4.57M|    struct ex_callback_entry stack[10];
  373|  4.57M|    struct ex_callback_entry *storage = NULL;
  374|  4.57M|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ad->ctx);
  375|       |
  376|  4.57M|    if (global == NULL)
  ------------------
  |  Branch (376:9): [True: 0, False: 4.57M]
  ------------------
  377|      0|        goto err;
  378|       |
  379|  4.57M|    ip = get_and_lock(global, class_index, 1);
  380|  4.57M|    if (ip == NULL)
  ------------------
  |  Branch (380:9): [True: 0, False: 4.57M]
  ------------------
  381|      0|        goto err;
  382|       |
  383|  4.57M|    mx = sk_EX_CALLBACK_num(ip->meth);
  384|  4.57M|    if (mx > 0) {
  ------------------
  |  Branch (384:9): [True: 823, False: 4.57M]
  ------------------
  385|    823|        if (mx < (int)OSSL_NELEM(stack))
  ------------------
  |  |   14|    823|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (385:13): [True: 823, False: 0]
  ------------------
  386|    823|            storage = stack;
  387|      0|        else
  388|      0|            storage = OPENSSL_malloc_array(mx, sizeof(*storage));
  ------------------
  |  |  110|      0|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  389|    823|        if (storage != NULL)
  ------------------
  |  Branch (389:13): [True: 823, False: 0]
  ------------------
  390|  2.46k|            for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (390:25): [True: 1.64k, False: 823]
  ------------------
  391|  1.64k|                storage[i].excb = sk_EX_CALLBACK_value(ip->meth, i);
  392|  1.64k|                storage[i].index = i;
  393|  1.64k|            }
  394|    823|    }
  395|  4.57M|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  396|       |
  397|  4.57M|    if (storage != NULL) {
  ------------------
  |  Branch (397:9): [True: 823, False: 4.57M]
  ------------------
  398|       |        /* Sort according to priority. High priority first */
  399|    823|        qsort(storage, mx, sizeof(*storage), ex_callback_compare);
  400|  2.46k|        for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (400:21): [True: 1.64k, False: 823]
  ------------------
  401|  1.64k|            f = storage[i].excb;
  402|       |
  403|  1.64k|            if (f != NULL && f->free_func != NULL) {
  ------------------
  |  Branch (403:17): [True: 823, False: 823]
  |  Branch (403:30): [True: 823, False: 0]
  ------------------
  404|    823|                ptr = CRYPTO_get_ex_data(ad, storage[i].index);
  405|    823|                f->free_func(obj, ptr, ad, storage[i].index, f->argl, f->argp);
  406|    823|            }
  407|  1.64k|        }
  408|    823|    }
  409|       |
  410|  4.57M|    if (storage != stack)
  ------------------
  |  Branch (410:9): [True: 4.57M, False: 823]
  ------------------
  411|  4.57M|        OPENSSL_free(storage);
  ------------------
  |  |  131|  4.57M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  412|  4.57M|err:
  413|  4.57M|    sk_void_free(ad->sk);
  ------------------
  |  |  225|  4.57M|#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
  ------------------
  414|  4.57M|    ad->sk = NULL;
  415|       |    ad->ctx = NULL;
  416|  4.57M|}
CRYPTO_set_ex_data:
  469|  2.58k|{
  470|  2.58k|    int i;
  471|       |
  472|  2.58k|    if (ad->sk == NULL) {
  ------------------
  |  Branch (472:9): [True: 2.58k, False: 0]
  ------------------
  473|  2.58k|        if ((ad->sk = sk_void_new_null()) == NULL) {
  ------------------
  |  |  222|  2.58k|#define sk_void_new_null() ((STACK_OF(void) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (473:13): [True: 0, False: 2.58k]
  ------------------
  474|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  475|      0|            return 0;
  476|      0|        }
  477|  2.58k|    }
  478|       |
  479|  5.99k|    for (i = sk_void_num(ad->sk); i <= idx; ++i) {
  ------------------
  |  |  219|  2.58k|#define sk_void_num(sk) OPENSSL_sk_num(ossl_check_const_void_sk_type(sk))
  ------------------
  |  Branch (479:35): [True: 3.40k, False: 2.58k]
  ------------------
  480|  3.40k|        if (!sk_void_push(ad->sk, NULL)) {
  ------------------
  |  |  229|  3.40k|#define sk_void_push(sk, ptr) OPENSSL_sk_push(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr))
  ------------------
  |  Branch (480:13): [True: 0, False: 3.40k]
  ------------------
  481|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  482|      0|            return 0;
  483|      0|        }
  484|  3.40k|    }
  485|  2.58k|    if (sk_void_set(ad->sk, idx, val) != val) {
  ------------------
  |  |  235|  2.58k|#define sk_void_set(sk, idx, ptr) ((void *)OPENSSL_sk_set(ossl_check_void_sk_type(sk), (idx), ossl_check_void_type(ptr)))
  ------------------
  |  Branch (485:9): [True: 0, False: 2.58k]
  ------------------
  486|       |        /* Probably the index is out of bounds */
  487|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  488|      0|        return 0;
  489|      0|    }
  490|  2.58k|    return 1;
  491|  2.58k|}
CRYPTO_get_ex_data:
  498|  5.72k|{
  499|  5.72k|    if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
  ------------------
  |  |  219|  4.08k|#define sk_void_num(sk) OPENSSL_sk_num(ossl_check_const_void_sk_type(sk))
  ------------------
  |  Branch (499:9): [True: 1.64k, False: 4.08k]
  |  Branch (499:27): [True: 0, False: 4.08k]
  ------------------
  500|  1.64k|        return NULL;
  501|  4.08k|    return sk_void_value(ad->sk, idx);
  ------------------
  |  |  220|  4.08k|#define sk_void_value(sk, idx) ((void *)OPENSSL_sk_value(ossl_check_const_void_sk_type(sk), (idx)))
  ------------------
  502|  5.72k|}
ex_data.c:cleanup_cb:
   62|      2|{
   63|      2|    OPENSSL_free(funcs);
  ------------------
  |  |  131|      2|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|      2|}
ex_data.c:get_and_lock:
   33|  9.15M|{
   34|  9.15M|    EX_CALLBACKS *ip;
   35|       |
   36|  9.15M|    if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) {
  ------------------
  |  |  269|  9.15M|#define CRYPTO_EX_INDEX__COUNT 18
  ------------------
  |  Branch (36:9): [True: 0, False: 9.15M]
  |  Branch (36:28): [True: 0, False: 9.15M]
  ------------------
   37|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   38|      0|        return NULL;
   39|      0|    }
   40|       |
   41|  9.15M|    if (global->ex_data_lock == NULL) {
  ------------------
  |  Branch (41:9): [True: 0, False: 9.15M]
  ------------------
   42|       |        /*
   43|       |         * If we get here, someone (who?) cleaned up the lock, so just
   44|       |         * treat it as an error.
   45|       |         */
   46|      0|        return NULL;
   47|      0|    }
   48|       |
   49|  9.15M|    if (read) {
  ------------------
  |  Branch (49:9): [True: 9.15M, False: 2]
  ------------------
   50|  9.15M|        if (!CRYPTO_THREAD_read_lock(global->ex_data_lock))
  ------------------
  |  Branch (50:13): [True: 0, False: 9.15M]
  ------------------
   51|      0|            return NULL;
   52|  9.15M|    } else {
   53|      2|        if (!CRYPTO_THREAD_write_lock(global->ex_data_lock))
  ------------------
  |  Branch (53:13): [True: 0, False: 2]
  ------------------
   54|      0|            return NULL;
   55|      2|    }
   56|       |
   57|  9.15M|    ip = &global->ex_data[class_index];
   58|  9.15M|    return ip;
   59|  9.15M|}
ex_data.c:ex_callback_compare:
  346|    823|{
  347|    823|    const struct ex_callback_entry *ap = (const struct ex_callback_entry *)a;
  348|    823|    const struct ex_callback_entry *bp = (const struct ex_callback_entry *)b;
  349|       |
  350|    823|    if (ap->excb == bp->excb)
  ------------------
  |  Branch (350:9): [True: 0, False: 823]
  ------------------
  351|      0|        return 0;
  352|       |
  353|    823|    if (ap->excb == NULL)
  ------------------
  |  Branch (353:9): [True: 823, False: 0]
  ------------------
  354|    823|        return 1;
  355|      0|    if (bp->excb == NULL)
  ------------------
  |  Branch (355:9): [True: 0, False: 0]
  ------------------
  356|      0|        return -1;
  357|      0|    if (ap->excb->priority == bp->excb->priority)
  ------------------
  |  Branch (357:9): [True: 0, False: 0]
  ------------------
  358|      0|        return 0;
  359|      0|    return ap->excb->priority > bp->excb->priority ? -1 : 1;
  ------------------
  |  Branch (359:12): [True: 0, False: 0]
  ------------------
  360|      0|}

ossl_ffc_name_to_dh_named_group:
   93|     76|{
   94|     76|    size_t i;
   95|       |
   96|    250|    for (i = 0; i < OSSL_NELEM(dh_named_groups); ++i) {
  ------------------
  |  |   14|    250|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (96:17): [True: 250, False: 0]
  ------------------
   97|    250|        if (OPENSSL_strcasecmp(dh_named_groups[i].name, name) == 0)
  ------------------
  |  Branch (97:13): [True: 76, False: 174]
  ------------------
   98|     76|            return &dh_named_groups[i];
   99|    250|    }
  100|      0|    return NULL;
  101|     76|}
ossl_ffc_uid_to_dh_named_group:
  104|    304|{
  105|    304|    size_t i;
  106|       |
  107|  1.00k|    for (i = 0; i < OSSL_NELEM(dh_named_groups); ++i) {
  ------------------
  |  |   14|  1.00k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (107:17): [True: 1.00k, False: 0]
  ------------------
  108|  1.00k|        if (dh_named_groups[i].uid == uid)
  ------------------
  |  Branch (108:13): [True: 304, False: 696]
  ------------------
  109|    304|            return &dh_named_groups[i];
  110|  1.00k|    }
  111|      0|    return NULL;
  112|    304|}
ossl_ffc_named_group_get_uid:
  134|    152|{
  135|    152|    if (group == NULL)
  ------------------
  |  Branch (135:9): [True: 0, False: 152]
  ------------------
  136|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  137|    152|    return group->uid;
  138|    152|}
ossl_ffc_named_group_get_name:
  141|    228|{
  142|    228|    if (group == NULL)
  ------------------
  |  Branch (142:9): [True: 0, False: 228]
  ------------------
  143|      0|        return NULL;
  144|    228|    return group->name;
  145|    228|}
ossl_ffc_named_group_set:
  163|     76|{
  164|     76|    if (ffc == NULL || group == NULL)
  ------------------
  |  Branch (164:9): [True: 0, False: 76]
  |  Branch (164:24): [True: 0, False: 76]
  ------------------
  165|      0|        return 0;
  166|       |
  167|     76|    ossl_ffc_params_set0_pqg(ffc, (BIGNUM *)group->p, (BIGNUM *)group->q,
  168|     76|        (BIGNUM *)group->g);
  169|     76|    ffc->keylength = group->keylength;
  170|       |
  171|       |    /* flush the cached nid, The DH layer is responsible for caching */
  172|     76|    ffc->nid = NID_undef;
  ------------------
  |  |   18|     76|#define NID_undef                       0
  ------------------
  173|     76|    return 1;
  174|     76|}

ossl_ffc_generate_private_key:
   24|     76|{
   25|     76|    int ret = 0, qbits = BN_num_bits(params->q);
   26|     76|    BIGNUM *m, *two_powN = NULL;
   27|       |
   28|       |    /* Deal with the edge cases where the value of N and/or s is not set */
   29|     76|    if (s == 0)
  ------------------
  |  Branch (29:9): [True: 0, False: 76]
  ------------------
   30|      0|        goto err;
   31|     76|    if (N == 0)
  ------------------
  |  Branch (31:9): [True: 76, False: 0]
  ------------------
   32|     76|        N = params->keylength ? params->keylength : 2 * s;
  ------------------
  |  Branch (32:13): [True: 76, False: 0]
  ------------------
   33|       |
   34|       |    /* Step (2) : check range of N */
   35|     76|    if (N < 2 * s || N > qbits)
  ------------------
  |  Branch (35:9): [True: 0, False: 76]
  |  Branch (35:22): [True: 0, False: 76]
  ------------------
   36|      0|        return 0;
   37|       |
   38|     76|    two_powN = BN_new();
   39|       |    /* 2^N */
   40|     76|    if (two_powN == NULL || !BN_lshift(two_powN, BN_value_one(), N))
  ------------------
  |  Branch (40:9): [True: 0, False: 76]
  |  Branch (40:29): [True: 0, False: 76]
  ------------------
   41|      0|        goto err;
   42|       |
   43|       |    /* Step (5) : M = min(2 ^ N, q) */
   44|     76|    m = (BN_cmp(two_powN, params->q) > 0) ? params->q : two_powN;
  ------------------
  |  Branch (44:9): [True: 0, False: 76]
  ------------------
   45|       |
   46|     76|    do {
   47|       |        /* Steps (3, 4 & 7) :  c + 1 = 1 + random[0..2^N - 1] */
   48|     76|        if (!BN_priv_rand_range_ex(priv, two_powN, 0, ctx)
  ------------------
  |  Branch (48:13): [True: 0, False: 76]
  ------------------
   49|     76|            || !BN_add_word(priv, 1))
  ------------------
  |  Branch (49:16): [True: 0, False: 76]
  ------------------
   50|      0|            goto err;
   51|       |        /* Step (6) : loop if c > M - 2 (i.e. c + 1 >= M) */
   52|     76|        if (BN_cmp(priv, m) < 0)
  ------------------
  |  Branch (52:13): [True: 76, False: 0]
  ------------------
   53|     76|            break;
   54|     76|    } while (1);
  ------------------
  |  Branch (54:14): [True: 0, Folded]
  ------------------
   55|       |
   56|     76|    ret = 1;
   57|     76|err:
   58|     76|    BN_free(two_powN);
   59|     76|    return ret;
   60|     76|}

ossl_ffc_params_init:
   21|    152|{
   22|    152|    memset(params, 0, sizeof(*params));
   23|    152|    params->pcounter = -1;
   24|    152|    params->gindex = FFC_UNVERIFIABLE_GINDEX;
  ------------------
  |  |   23|    152|#define FFC_UNVERIFIABLE_GINDEX -1
  ------------------
   25|    152|    params->flags = FFC_PARAM_FLAG_VALIDATE_PQG;
  ------------------
  |  |   46|    152|    (FFC_PARAM_FLAG_VALIDATE_PQ | FFC_PARAM_FLAG_VALIDATE_G)
  |  |  ------------------
  |  |  |  |   43|    152|#define FFC_PARAM_FLAG_VALIDATE_PQ 0x01
  |  |  ------------------
  |  |                   (FFC_PARAM_FLAG_VALIDATE_PQ | FFC_PARAM_FLAG_VALIDATE_G)
  |  |  ------------------
  |  |  |  |   44|    152|#define FFC_PARAM_FLAG_VALIDATE_G 0x02
  |  |  ------------------
  ------------------
   26|    152|}
ossl_ffc_params_cleanup:
   29|     76|{
   30|       |#ifdef OPENSSL_PEDANTIC_ZEROIZATION
   31|       |    BN_clear_free(params->p);
   32|       |    BN_clear_free(params->q);
   33|       |    BN_clear_free(params->g);
   34|       |    BN_clear_free(params->j);
   35|       |    OPENSSL_clear_free(params->seed, params->seedlen);
   36|       |#else
   37|     76|    BN_free(params->p);
   38|     76|    BN_free(params->q);
   39|     76|    BN_free(params->g);
   40|     76|    BN_free(params->j);
   41|     76|    OPENSSL_free(params->seed);
  ------------------
  |  |  131|     76|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   42|     76|#endif
   43|     76|    ossl_ffc_params_init(params);
   44|     76|}
ossl_ffc_params_set0_pqg:
   47|     76|{
   48|     76|    if (p != NULL && p != d->p) {
  ------------------
  |  Branch (48:9): [True: 76, False: 0]
  |  Branch (48:22): [True: 76, False: 0]
  ------------------
   49|     76|        BN_free(d->p);
   50|     76|        d->p = p;
   51|     76|    }
   52|     76|    if (q != NULL && q != d->q) {
  ------------------
  |  Branch (52:9): [True: 76, False: 0]
  |  Branch (52:22): [True: 76, False: 0]
  ------------------
   53|     76|        BN_free(d->q);
   54|     76|        d->q = q;
   55|     76|    }
   56|     76|    if (g != NULL && g != d->g) {
  ------------------
  |  Branch (56:9): [True: 76, False: 0]
  |  Branch (56:22): [True: 76, False: 0]
  ------------------
   57|     76|        BN_free(d->g);
   58|     76|        d->g = g;
   59|     76|    }
   60|     76|}
ossl_ffc_params_get0_pqg:
   64|    152|{
   65|    152|    if (p != NULL)
  ------------------
  |  Branch (65:9): [True: 152, False: 0]
  ------------------
   66|    152|        *p = d->p;
   67|    152|    if (q != NULL)
  ------------------
  |  Branch (67:9): [True: 0, False: 152]
  ------------------
   68|      0|        *q = d->q;
   69|    152|    if (g != NULL)
  ------------------
  |  Branch (69:9): [True: 0, False: 152]
  ------------------
   70|      0|        *g = d->g;
   71|    152|}
ossl_ffc_params_enable_flags:
  125|     76|{
  126|     76|    if (enable)
  ------------------
  |  Branch (126:9): [True: 0, False: 76]
  ------------------
  127|      0|        params->flags |= flags;
  128|     76|    else
  129|     76|        params->flags &= ~flags;
  130|     76|}
ossl_ffc_params_todata:
  217|    228|{
  218|    228|    int test_flags;
  219|       |
  220|    228|    if (ffc->p != NULL
  ------------------
  |  Branch (220:9): [True: 228, False: 0]
  ------------------
  221|    228|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_P, ffc->p))
  ------------------
  |  |  406|    228|# define OSSL_PKEY_PARAM_FFC_P "p"
  ------------------
  |  Branch (221:12): [True: 0, False: 228]
  ------------------
  222|      0|        return 0;
  223|    228|    if (ffc->q != NULL
  ------------------
  |  Branch (223:9): [True: 228, False: 0]
  ------------------
  224|    228|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_Q, ffc->q))
  ------------------
  |  |  409|    228|# define OSSL_PKEY_PARAM_FFC_Q "q"
  ------------------
  |  Branch (224:12): [True: 0, False: 228]
  ------------------
  225|      0|        return 0;
  226|    228|    if (ffc->g != NULL
  ------------------
  |  Branch (226:9): [True: 228, False: 0]
  ------------------
  227|    228|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_G, ffc->g))
  ------------------
  |  |  403|    228|# define OSSL_PKEY_PARAM_FFC_G "g"
  ------------------
  |  Branch (227:12): [True: 0, False: 228]
  ------------------
  228|      0|        return 0;
  229|    228|    if (ffc->j != NULL
  ------------------
  |  Branch (229:9): [True: 0, False: 228]
  ------------------
  230|      0|        && !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_FFC_COFACTOR,
  ------------------
  |  |  400|      0|# define OSSL_PKEY_PARAM_FFC_COFACTOR "j"
  ------------------
  |  Branch (230:12): [True: 0, False: 0]
  ------------------
  231|      0|            ffc->j))
  232|      0|        return 0;
  233|    228|    if (!ossl_param_build_set_int(bld, params, OSSL_PKEY_PARAM_FFC_GINDEX,
  ------------------
  |  |  404|    228|# define OSSL_PKEY_PARAM_FFC_GINDEX "gindex"
  ------------------
  |  Branch (233:9): [True: 0, False: 228]
  ------------------
  234|    228|            ffc->gindex))
  235|      0|        return 0;
  236|    228|    if (!ossl_param_build_set_int(bld, params, OSSL_PKEY_PARAM_FFC_PCOUNTER,
  ------------------
  |  |  408|    228|# define OSSL_PKEY_PARAM_FFC_PCOUNTER "pcounter"
  ------------------
  |  Branch (236:9): [True: 0, False: 228]
  ------------------
  237|    228|            ffc->pcounter))
  238|      0|        return 0;
  239|    228|    if (!ossl_param_build_set_int(bld, params, OSSL_PKEY_PARAM_FFC_H, ffc->h))
  ------------------
  |  |  405|    228|# define OSSL_PKEY_PARAM_FFC_H "hindex"
  ------------------
  |  Branch (239:9): [True: 0, False: 228]
  ------------------
  240|      0|        return 0;
  241|    228|    if (ffc->seed != NULL
  ------------------
  |  Branch (241:9): [True: 0, False: 228]
  ------------------
  242|      0|        && !ossl_param_build_set_octet_string(bld, params,
  ------------------
  |  Branch (242:12): [True: 0, False: 0]
  ------------------
  243|      0|            OSSL_PKEY_PARAM_FFC_SEED,
  ------------------
  |  |  411|      0|# define OSSL_PKEY_PARAM_FFC_SEED "seed"
  ------------------
  244|      0|            ffc->seed, ffc->seedlen))
  245|      0|        return 0;
  246|    228|    if (ffc->nid != NID_undef) {
  ------------------
  |  |   18|    228|#define NID_undef                       0
  ------------------
  |  Branch (246:9): [True: 228, False: 0]
  ------------------
  247|    228|        const DH_NAMED_GROUP *group = ossl_ffc_uid_to_dh_named_group(ffc->nid);
  248|    228|        const char *name = ossl_ffc_named_group_get_name(group);
  249|       |
  250|    228|        if (name == NULL
  ------------------
  |  Branch (250:13): [True: 0, False: 228]
  ------------------
  251|    228|            || !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (251:16): [True: 0, False: 228]
  ------------------
  252|    228|                OSSL_PKEY_PARAM_GROUP_NAME,
  ------------------
  |  |  420|    228|# define OSSL_PKEY_PARAM_GROUP_NAME "group"
  ------------------
  253|    228|                name))
  254|      0|            return 0;
  255|    228|    }
  256|    228|    test_flags = ((ffc->flags & FFC_PARAM_FLAG_VALIDATE_PQ) != 0);
  ------------------
  |  |   43|    228|#define FFC_PARAM_FLAG_VALIDATE_PQ 0x01
  ------------------
  257|    228|    if (!ossl_param_build_set_int(bld, params,
  ------------------
  |  Branch (257:9): [True: 0, False: 228]
  ------------------
  258|    228|            OSSL_PKEY_PARAM_FFC_VALIDATE_PQ, test_flags))
  ------------------
  |  |  415|    228|# define OSSL_PKEY_PARAM_FFC_VALIDATE_PQ "validate-pq"
  ------------------
  259|      0|        return 0;
  260|    228|    test_flags = ((ffc->flags & FFC_PARAM_FLAG_VALIDATE_G) != 0);
  ------------------
  |  |   44|    228|#define FFC_PARAM_FLAG_VALIDATE_G 0x02
  ------------------
  261|    228|    if (!ossl_param_build_set_int(bld, params,
  ------------------
  |  Branch (261:9): [True: 0, False: 228]
  ------------------
  262|    228|            OSSL_PKEY_PARAM_FFC_VALIDATE_G, test_flags))
  ------------------
  |  |  413|    228|# define OSSL_PKEY_PARAM_FFC_VALIDATE_G "validate-g"
  ------------------
  263|      0|        return 0;
  264|    228|    test_flags = ((ffc->flags & FFC_PARAM_FLAG_VALIDATE_LEGACY) != 0);
  ------------------
  |  |   47|    228|#define FFC_PARAM_FLAG_VALIDATE_LEGACY 0x04
  ------------------
  265|    228|    if (!ossl_param_build_set_int(bld, params,
  ------------------
  |  Branch (265:9): [True: 0, False: 228]
  ------------------
  266|    228|            OSSL_PKEY_PARAM_FFC_VALIDATE_LEGACY,
  ------------------
  |  |  414|    228|# define OSSL_PKEY_PARAM_FFC_VALIDATE_LEGACY "validate-legacy"
  ------------------
  267|    228|            test_flags))
  268|      0|        return 0;
  269|       |
  270|    228|    if (ffc->mdname != NULL
  ------------------
  |  Branch (270:9): [True: 0, False: 228]
  ------------------
  271|      0|        && !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (271:12): [True: 0, False: 0]
  ------------------
  272|      0|            OSSL_PKEY_PARAM_FFC_DIGEST,
  ------------------
  |  |  401|      0|# define OSSL_PKEY_PARAM_FFC_DIGEST OSSL_PKEY_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  374|      0|# define OSSL_PKEY_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  |  |  ------------------
  |  |  |  |  |  |  128|      0|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  273|      0|            ffc->mdname))
  274|      0|        return 0;
  275|    228|    if (ffc->mdprops != NULL
  ------------------
  |  Branch (275:9): [True: 0, False: 228]
  ------------------
  276|      0|        && !ossl_param_build_set_utf8_string(bld, params,
  ------------------
  |  Branch (276:12): [True: 0, False: 0]
  ------------------
  277|      0|            OSSL_PKEY_PARAM_FFC_DIGEST_PROPS,
  ------------------
  |  |  402|      0|# define OSSL_PKEY_PARAM_FFC_DIGEST_PROPS OSSL_PKEY_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  440|      0|# define OSSL_PKEY_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|      0|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  278|      0|            ffc->mdprops))
  279|      0|        return 0;
  280|    228|    return 1;
  281|    228|}

ossl_safe_getenv:
   19|  1.73k|{
   20|       |#if defined(_WIN32) && defined(CP_UTF8) && !defined(_WIN32_WCE)
   21|       |    if (GetEnvironmentVariableW(L"OPENSSL_WIN32_UTF8", NULL, 0) != 0) {
   22|       |        char *val = NULL;
   23|       |        int vallen = 0;
   24|       |        WCHAR *namew = NULL;
   25|       |        WCHAR *valw = NULL;
   26|       |        DWORD envlen = 0;
   27|       |        DWORD dwFlags = MB_ERR_INVALID_CHARS;
   28|       |        int rsize, fsize;
   29|       |        UINT curacp;
   30|       |
   31|       |        curacp = GetACP();
   32|       |
   33|       |        /*
   34|       |         * For the code pages listed below, dwFlags must be set to 0.
   35|       |         * Otherwise, the function fails with ERROR_INVALID_FLAGS.
   36|       |         */
   37|       |        if (curacp == 50220 || curacp == 50221 || curacp == 50222 || curacp == 50225 || curacp == 50227 || curacp == 50229 || (57002 <= curacp && curacp <= 57011) || curacp == 65000 || curacp == 42)
   38|       |            dwFlags = 0;
   39|       |
   40|       |        /* query for buffer len */
   41|       |        rsize = MultiByteToWideChar(curacp, dwFlags, name, -1, NULL, 0);
   42|       |        /* if name is valid string and can be converted to wide string */
   43|       |        if (rsize > 0)
   44|       |            namew = _malloca(rsize * sizeof(WCHAR));
   45|       |
   46|       |        if (NULL != namew) {
   47|       |            /* convert name to wide string */
   48|       |            fsize = MultiByteToWideChar(curacp, dwFlags, name, -1, namew, rsize);
   49|       |            /* if conversion is ok, then determine value string size in wchars */
   50|       |            if (fsize > 0)
   51|       |                envlen = GetEnvironmentVariableW(namew, NULL, 0);
   52|       |        }
   53|       |
   54|       |        if (envlen > 0)
   55|       |            valw = _malloca(envlen * sizeof(WCHAR));
   56|       |
   57|       |        if (NULL != valw) {
   58|       |            /* if can get env value as wide string */
   59|       |            if (GetEnvironmentVariableW(namew, valw, envlen) < envlen) {
   60|       |                /* determine value string size in utf-8 */
   61|       |                vallen = WideCharToMultiByte(CP_UTF8, 0, valw, -1, NULL, 0,
   62|       |                    NULL, NULL);
   63|       |            }
   64|       |        }
   65|       |
   66|       |        if (vallen > 0)
   67|       |            val = OPENSSL_malloc(vallen);
   68|       |
   69|       |        if (NULL != val) {
   70|       |            /* convert value string from wide to utf-8 */
   71|       |            if (WideCharToMultiByte(CP_UTF8, 0, valw, -1, val, vallen,
   72|       |                    NULL, NULL)
   73|       |                == 0) {
   74|       |                OPENSSL_free(val);
   75|       |                val = NULL;
   76|       |            }
   77|       |        }
   78|       |
   79|       |        if (NULL != namew)
   80|       |            _freea(namew);
   81|       |
   82|       |        if (NULL != valw)
   83|       |            _freea(valw);
   84|       |
   85|       |        return val;
   86|       |    }
   87|       |#endif
   88|       |
   89|  1.73k|#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
   90|  1.73k|#if __GLIBC_PREREQ(2, 17)
   91|  1.73k|#define SECURE_GETENV
   92|  1.73k|    return secure_getenv(name);
   93|  1.73k|#endif
   94|  1.73k|#endif
   95|       |
   96|       |#ifndef SECURE_GETENV
   97|       |    if (OPENSSL_issetugid())
   98|       |        return NULL;
   99|       |    return getenv(name);
  100|       |#endif
  101|  1.73k|}

ossl_fnv1a_hash:
   14|  6.16M|{
   15|  6.16M|    uint64_t hash = 0xcbf29ce484222325ULL;
   16|  6.16M|    size_t i;
   17|       |
   18|   400M|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (18:17): [True: 394M, False: 6.16M]
  ------------------
   19|   394M|        hash ^= key[i];
   20|   394M|        hash *= 0x00000100000001B3ULL;
   21|   394M|    }
   22|  6.16M|    return hash;
   23|  6.16M|}

ossl_ht_new:
  178|    787|{
  179|    787|    HT *new = OPENSSL_zalloc(sizeof(*new));
  ------------------
  |  |  108|    787|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  180|       |
  181|    787|    if (new == NULL)
  ------------------
  |  Branch (181:9): [True: 0, False: 787]
  ------------------
  182|      0|        return NULL;
  183|       |
  184|    787|    new->atomic_lock = CRYPTO_THREAD_lock_new();
  185|    787|    if (new->atomic_lock == NULL)
  ------------------
  |  Branch (185:9): [True: 0, False: 787]
  ------------------
  186|      0|        goto err;
  187|       |
  188|    787|    memcpy(&new->config, conf, sizeof(*conf));
  189|       |
  190|    787|    if (new->config.init_neighborhoods != 0) {
  ------------------
  |  Branch (190:9): [True: 787, False: 0]
  ------------------
  191|    787|        new->wpd.neighborhood_len = new->config.init_neighborhoods;
  192|       |        /* round up to the next power of 2 */
  193|    787|        new->wpd.neighborhood_len--;
  194|    787|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 1;
  195|    787|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 2;
  196|    787|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 4;
  197|    787|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 8;
  198|    787|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 16;
  199|    787|        new->wpd.neighborhood_len++;
  200|    787|    } else {
  201|      0|        new->wpd.neighborhood_len = DEFAULT_NEIGH_LEN;
  ------------------
  |  |   97|      0|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   96|      0|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  202|      0|    }
  203|       |
  204|    787|    if (new->config.ht_free_fn == NULL)
  ------------------
  |  Branch (204:9): [True: 787, False: 0]
  ------------------
  205|    787|        new->config.ht_free_fn = internal_free_nop;
  206|       |
  207|    787|    new->md = OPENSSL_zalloc(sizeof(*new->md));
  ------------------
  |  |  108|    787|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  208|    787|    if (new->md == NULL)
  ------------------
  |  Branch (208:9): [True: 0, False: 787]
  ------------------
  209|      0|        goto err;
  210|       |
  211|    787|    new->md->neighborhoods = alloc_new_neighborhood_list(new->wpd.neighborhood_len,
  212|    787|        &new->md->neighborhood_ptr_to_free);
  213|    787|    if (new->md->neighborhoods == NULL)
  ------------------
  |  Branch (213:9): [True: 0, False: 787]
  ------------------
  214|      0|        goto err;
  215|    787|    new->md->neighborhood_mask = new->wpd.neighborhood_len - 1;
  216|       |
  217|    787|    new->lock = ossl_rcu_lock_new(1, conf->ctx);
  218|    787|    if (new->lock == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 787]
  ------------------
  219|      0|        goto err;
  220|       |
  221|    787|    if (new->config.ht_hash_fn == NULL)
  ------------------
  |  Branch (221:9): [True: 787, False: 0]
  ------------------
  222|    787|        new->config.ht_hash_fn = ossl_fnv1a_hash;
  223|       |
  224|    787|    return new;
  225|       |
  226|      0|err:
  227|      0|    CRYPTO_THREAD_lock_free(new->atomic_lock);
  228|      0|    ossl_rcu_lock_free(new->lock);
  229|      0|    if (new->md != NULL)
  ------------------
  |  Branch (229:9): [True: 0, False: 0]
  ------------------
  230|      0|        OPENSSL_free(new->md->neighborhood_ptr_to_free);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  231|      0|    OPENSSL_free(new->md);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  232|      0|    OPENSSL_free(new);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  233|       |    return NULL;
  234|    787|}
ossl_ht_write_lock:
  247|    787|{
  248|    787|    ossl_rcu_write_lock(htable->lock);
  249|    787|    htable->wpd.need_sync = 0;
  250|    787|}
ossl_ht_write_unlock:
  253|    787|{
  254|    787|    int need_sync = htable->wpd.need_sync;
  255|       |
  256|    787|    htable->wpd.need_sync = 0;
  257|    787|    ossl_rcu_write_unlock(htable->lock);
  258|    787|    if (need_sync)
  ------------------
  |  Branch (258:9): [True: 787, False: 0]
  ------------------
  259|    787|        ossl_synchronize_rcu(htable->lock);
  260|    787|}
ossl_ht_free:
  321|    787|{
  322|    787|    if (h == NULL)
  ------------------
  |  Branch (322:9): [True: 0, False: 787]
  ------------------
  323|      0|        return;
  324|       |
  325|    787|    ossl_ht_write_lock(h);
  326|    787|    ossl_ht_flush_internal(h);
  327|    787|    ossl_ht_write_unlock(h);
  328|       |    /* Freeing the lock does a final sync for us */
  329|    787|    CRYPTO_THREAD_lock_free(h->atomic_lock);
  330|    787|    ossl_rcu_lock_free(h->lock);
  331|    787|    OPENSSL_free(h->md->neighborhood_ptr_to_free);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  332|    787|    OPENSSL_free(h->md);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  333|    787|    OPENSSL_free(h);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  334|    787|    return;
  335|    787|}
ossl_ht_insert:
  628|   371k|{
  629|   371k|    struct ht_internal_value_st *newval = NULL;
  630|   371k|    uint64_t hash;
  631|   371k|    int rc = 0;
  632|   371k|    int i;
  633|       |
  634|   371k|    if (data->value == NULL)
  ------------------
  |  Branch (634:9): [True: 0, False: 371k]
  ------------------
  635|      0|        goto out;
  636|       |
  637|   371k|    rc = -1;
  638|   371k|    newval = alloc_new_value(h, key, data->value, data->type_id);
  639|   371k|    if (newval == NULL)
  ------------------
  |  Branch (639:9): [True: 0, False: 371k]
  ------------------
  640|      0|        goto out;
  641|       |
  642|       |    /*
  643|       |     * we have to take our lock here to prevent other changes
  644|       |     * to the bucket list
  645|       |     */
  646|   371k|    hash = h->config.ht_hash_fn(key->keybuf, key->keysize);
  647|       |
  648|   371k|    for (i = 0;
  649|   371k|        (rc = ossl_ht_insert_locked(h, hash, newval, olddata)) == -1
  ------------------
  |  Branch (649:9): [True: 0, False: 371k]
  ------------------
  650|      0|        && i < 4;
  ------------------
  |  Branch (650:12): [True: 0, False: 0]
  ------------------
  651|   371k|        ++i)
  652|      0|        if (!grow_hashtable(h, h->wpd.neighborhood_len)) {
  ------------------
  |  Branch (652:13): [True: 0, False: 0]
  ------------------
  653|      0|            rc = -1;
  654|      0|            break;
  655|      0|        }
  656|       |
  657|   371k|    if (rc <= 0)
  ------------------
  |  Branch (657:9): [True: 0, False: 371k]
  ------------------
  658|      0|        free_value(newval);
  659|       |
  660|   371k|out:
  661|   371k|    return rc;
  662|   371k|}
ossl_ht_get:
  665|  5.78M|{
  666|  5.78M|    struct ht_mutable_data_st *md;
  667|  5.78M|    uint64_t hash;
  668|  5.78M|    uint64_t neigh_idx_start;
  669|  5.78M|    uint64_t neigh_idx;
  670|  5.78M|    struct ht_internal_value_st *ival = NULL;
  671|  5.78M|    size_t j;
  672|  5.78M|    uint64_t ehash;
  673|  5.78M|    int lockless_reads = h->config.lockless_reads;
  674|       |
  675|  5.78M|    hash = h->config.ht_hash_fn(key->keybuf, key->keysize);
  676|       |
  677|  5.78M|    md = ossl_rcu_deref(&h->md);
  ------------------
  |  |   30|  5.78M|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  678|  5.78M|    neigh_idx = neigh_idx_start = hash & md->neighborhood_mask;
  679|  5.80M|    do {
  680|  5.80M|        PREFETCH_NEIGHBORHOOD(md->neighborhoods[neigh_idx]);
  ------------------
  |  |   83|  5.80M|#define PREFETCH_NEIGHBORHOOD(x) __builtin_prefetch(x.entries)
  ------------------
  681|  6.91M|        for (j = 0; j < NEIGHBORHOOD_LEN; j++) {
  ------------------
  |  |  105|  6.91M|#define NEIGHBORHOOD_LEN (CACHE_LINE_BYTES / sizeof(struct ht_neighborhood_entry_st))
  |  |  ------------------
  |  |  |  |  102|  6.91M|#define CACHE_LINE_BYTES 64
  |  |  ------------------
  ------------------
  |  Branch (681:21): [True: 6.89M, False: 15.8k]
  ------------------
  682|  6.89M|            ival = ossl_rcu_deref(&md->neighborhoods[neigh_idx].entries[j].value);
  ------------------
  |  |   30|  6.89M|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  683|  6.89M|            if (ival == NULL) {
  ------------------
  |  Branch (683:17): [True: 637k, False: 6.25M]
  ------------------
  684|   637k|                if (lockless_reads)
  ------------------
  |  Branch (684:21): [True: 637k, False: 0]
  ------------------
  685|       |                    /* lockless_reads implies no deletion, we can break out */
  686|   637k|                    return NULL;
  687|      0|                continue;
  688|   637k|            }
  689|  6.25M|            if (!CRYPTO_atomic_load(&md->neighborhoods[neigh_idx].entries[j].hash,
  ------------------
  |  Branch (689:17): [True: 0, False: 6.25M]
  ------------------
  690|  6.25M|                    &ehash, h->atomic_lock))
  691|      0|                return NULL;
  692|  6.25M|            if (compare_hash(hash, ehash) && match_key(&ival->value.key, key))
  ------------------
  |  Branch (692:17): [True: 5.15M, False: 1.10M]
  |  Branch (692:46): [True: 5.15M, False: 0]
  ------------------
  693|  5.15M|                return (HT_VALUE *)ival;
  694|  6.25M|        }
  695|  15.8k|        if (!lockless_reads)
  ------------------
  |  Branch (695:13): [True: 0, False: 15.8k]
  ------------------
  696|      0|            break;
  697|       |        /* Continue search in subsequent neighborhoods */
  698|  15.8k|        neigh_idx = (neigh_idx + 1) & md->neighborhood_mask;
  699|  15.8k|    } while (neigh_idx != neigh_idx_start);
  ------------------
  |  Branch (699:14): [True: 15.8k, False: 0]
  ------------------
  700|       |
  701|      0|    return NULL;
  702|  5.78M|}
hashtable.c:internal_free_nop:
  173|   371k|{
  174|   371k|    return;
  175|   371k|}
hashtable.c:alloc_new_neighborhood_list:
  156|  1.57k|{
  157|  1.57k|    struct ht_neighborhood_st *ret;
  158|       |
  159|  1.57k|    ret = OPENSSL_aligned_alloc_array(len, sizeof(struct ht_neighborhood_st),
  ------------------
  |  |  117|  1.57k|    CRYPTO_aligned_alloc_array(num, size, alignment, freeptr,      \
  |  |  118|  1.57k|        OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  160|  1.57k|        CACHE_LINE_BYTES, freeptr);
  161|       |
  162|       |    /* fall back to regular malloc */
  163|  1.57k|    if (ret == NULL) {
  ------------------
  |  Branch (163:9): [True: 0, False: 1.57k]
  ------------------
  164|      0|        ret = *freeptr = OPENSSL_malloc_array(len, sizeof(struct ht_neighborhood_st));
  ------------------
  |  |  110|      0|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  165|      0|        if (ret == NULL)
  ------------------
  |  Branch (165:13): [True: 0, False: 0]
  ------------------
  166|      0|            return NULL;
  167|      0|    }
  168|  1.57k|    memset(ret, 0, sizeof(struct ht_neighborhood_st) * len);
  169|  1.57k|    return ret;
  170|  1.57k|}
hashtable.c:ossl_ht_flush_internal:
  285|    787|{
  286|    787|    struct ht_mutable_data_st *newmd = NULL;
  287|    787|    struct ht_mutable_data_st *oldmd = NULL;
  288|       |
  289|    787|    newmd = OPENSSL_zalloc(sizeof(*newmd));
  ------------------
  |  |  108|    787|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  290|    787|    if (newmd == NULL)
  ------------------
  |  Branch (290:9): [True: 0, False: 787]
  ------------------
  291|      0|        return 0;
  292|       |
  293|    787|    newmd->neighborhoods = alloc_new_neighborhood_list(DEFAULT_NEIGH_LEN,
  ------------------
  |  |   97|    787|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   96|    787|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  294|    787|        &newmd->neighborhood_ptr_to_free);
  295|    787|    if (newmd->neighborhoods == NULL) {
  ------------------
  |  Branch (295:9): [True: 0, False: 787]
  ------------------
  296|      0|        OPENSSL_free(newmd);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  297|      0|        return 0;
  298|      0|    }
  299|       |
  300|    787|    newmd->neighborhood_mask = DEFAULT_NEIGH_LEN - 1;
  ------------------
  |  |   97|    787|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   96|    787|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  301|       |
  302|       |    /* Swap the old and new mutable data sets */
  303|    787|    oldmd = ossl_rcu_deref(&h->md);
  ------------------
  |  |   30|    787|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  304|    787|    ossl_rcu_assign_ptr(&h->md, &newmd);
  ------------------
  |  |   31|    787|#define ossl_rcu_assign_ptr(p, v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  305|       |
  306|       |    /* Set the number of entries to 0 */
  307|    787|    h->wpd.value_count = 0;
  308|    787|    h->wpd.neighborhood_len = DEFAULT_NEIGH_LEN;
  ------------------
  |  |   97|    787|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   96|    787|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  309|       |
  310|    787|    ossl_rcu_call(h->lock, free_oldmd, oldmd);
  311|    787|    h->wpd.need_sync = 1;
  312|    787|    return 1;
  313|    787|}
hashtable.c:free_oldmd:
  263|    787|{
  264|    787|    struct ht_mutable_data_st *oldmd = arg;
  265|    787|    size_t i, j;
  266|    787|    size_t neighborhood_len = (size_t)oldmd->neighborhood_mask + 1;
  267|    787|    struct ht_internal_value_st *v;
  268|       |
  269|   403k|    for (i = 0; i < neighborhood_len; i++) {
  ------------------
  |  Branch (269:17): [True: 402k, False: 787]
  ------------------
  270|   402k|        PREFETCH_NEIGHBORHOOD(oldmd->neighborhoods[i + 1]);
  ------------------
  |  |   83|   402k|#define PREFETCH_NEIGHBORHOOD(x) __builtin_prefetch(x.entries)
  ------------------
  271|  2.01M|        for (j = 0; j < NEIGHBORHOOD_LEN; j++) {
  ------------------
  |  |  105|  2.01M|#define NEIGHBORHOOD_LEN (CACHE_LINE_BYTES / sizeof(struct ht_neighborhood_entry_st))
  |  |  ------------------
  |  |  |  |  102|  2.01M|#define CACHE_LINE_BYTES 64
  |  |  ------------------
  ------------------
  |  Branch (271:21): [True: 1.61M, False: 402k]
  ------------------
  272|  1.61M|            if (oldmd->neighborhoods[i].entries[j].value != NULL) {
  ------------------
  |  Branch (272:17): [True: 371k, False: 1.23M]
  ------------------
  273|   371k|                v = oldmd->neighborhoods[i].entries[j].value;
  274|   371k|                v->ht->config.ht_free_fn((HT_VALUE *)v);
  275|   371k|                free_value(v);
  276|   371k|            }
  277|  1.61M|        }
  278|   402k|    }
  279|       |
  280|    787|    OPENSSL_free(oldmd->neighborhood_ptr_to_free);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  281|    787|    OPENSSL_free(oldmd);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  282|    787|}
hashtable.c:alloc_new_value:
  597|   371k|{
  598|   371k|    struct ht_internal_value_st *tmp;
  599|   371k|    size_t nvsize = sizeof(*tmp);
  600|       |
  601|   371k|    if (h->config.collision_check == 1)
  ------------------
  |  Branch (601:9): [True: 371k, False: 0]
  ------------------
  602|   371k|        nvsize += key->keysize;
  603|       |
  604|   371k|    tmp = OPENSSL_malloc(nvsize);
  ------------------
  |  |  106|   371k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  605|       |
  606|   371k|    if (tmp == NULL)
  ------------------
  |  Branch (606:9): [True: 0, False: 371k]
  ------------------
  607|      0|        return NULL;
  608|       |
  609|   371k|    tmp->ht = h;
  610|   371k|    tmp->value.value = data;
  611|   371k|    tmp->value.type_id = type;
  612|   371k|    tmp->value.key.keybuf = NULL;
  613|   371k|    if (h->config.collision_check) {
  ------------------
  |  Branch (613:9): [True: 371k, False: 0]
  ------------------
  614|   371k|        tmp->value.key.keybuf = (uint8_t *)(tmp + 1);
  615|   371k|        tmp->value.key.keysize = key->keysize;
  616|   371k|        memcpy(tmp->value.key.keybuf, key->keybuf, key->keysize);
  617|   371k|    }
  618|       |
  619|   371k|    return tmp;
  620|   371k|}
hashtable.c:ossl_ht_insert_locked:
  533|   371k|{
  534|   371k|    struct ht_mutable_data_st *md = h->md;
  535|   371k|    uint64_t neigh_idx_start = hash & md->neighborhood_mask;
  536|   371k|    uint64_t neigh_idx = neigh_idx_start;
  537|   371k|    size_t j;
  538|   371k|    uint64_t ihash;
  539|   371k|    HT_VALUE *ival;
  540|   371k|    size_t empty_idx = SIZE_MAX;
  541|   371k|    int lockless_reads = h->config.lockless_reads;
  542|       |
  543|   376k|    do {
  544|   376k|        PREFETCH_NEIGHBORHOOD(md->neighborhoods[neigh_idx]);
  ------------------
  |  |   83|   376k|#define PREFETCH_NEIGHBORHOOD(x) __builtin_prefetch(x.entries)
  ------------------
  545|       |
  546|   589k|        for (j = 0; j < NEIGHBORHOOD_LEN; j++) {
  ------------------
  |  |  105|   589k|#define NEIGHBORHOOD_LEN (CACHE_LINE_BYTES / sizeof(struct ht_neighborhood_entry_st))
  |  |  ------------------
  |  |  |  |  102|   589k|#define CACHE_LINE_BYTES 64
  |  |  ------------------
  ------------------
  |  Branch (546:21): [True: 584k, False: 4.42k]
  ------------------
  547|   584k|            ival = ossl_rcu_deref(&md->neighborhoods[neigh_idx].entries[j].value);
  ------------------
  |  |   30|   584k|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  548|   584k|            if (ival == NULL) {
  ------------------
  |  Branch (548:17): [True: 371k, False: 213k]
  ------------------
  549|   371k|                empty_idx = j;
  550|       |                /* lockless_reads implies no deletion, we can break out */
  551|   371k|                if (lockless_reads)
  ------------------
  |  Branch (551:21): [True: 371k, False: 0]
  ------------------
  552|   371k|                    goto not_found;
  553|      0|                continue;
  554|   371k|            }
  555|   213k|            if (!CRYPTO_atomic_load(&md->neighborhoods[neigh_idx].entries[j].hash,
  ------------------
  |  Branch (555:17): [True: 0, False: 213k]
  ------------------
  556|   213k|                    &ihash, h->atomic_lock))
  557|      0|                return 0;
  558|   213k|            if (compare_hash(hash, ihash) && match_key(&newval->value.key, &ival->key)) {
  ------------------
  |  Branch (558:17): [True: 0, False: 213k]
  |  Branch (558:46): [True: 0, False: 0]
  ------------------
  559|      0|                if (olddata == NULL) {
  ------------------
  |  Branch (559:21): [True: 0, False: 0]
  ------------------
  560|       |                    /* This would insert a duplicate -> fail */
  561|      0|                    return 0;
  562|      0|                }
  563|       |                /* Do a replacement */
  564|      0|                if (!CRYPTO_atomic_store(&md->neighborhoods[neigh_idx].entries[j].hash,
  ------------------
  |  Branch (564:21): [True: 0, False: 0]
  ------------------
  565|      0|                        hash, h->atomic_lock))
  566|      0|                    return 0;
  567|      0|                *olddata = (HT_VALUE *)md->neighborhoods[neigh_idx].entries[j].value;
  568|      0|                ossl_rcu_assign_ptr(&md->neighborhoods[neigh_idx].entries[j].value,
  ------------------
  |  |   31|      0|#define ossl_rcu_assign_ptr(p, v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  569|      0|                    &newval);
  570|      0|                ossl_rcu_call(h->lock, free_old_ht_value, *olddata);
  571|      0|                h->wpd.need_sync = 1;
  572|      0|                return 1;
  573|      0|            }
  574|   213k|        }
  575|  4.42k|        if (!lockless_reads)
  ------------------
  |  Branch (575:13): [True: 0, False: 4.42k]
  ------------------
  576|      0|            break;
  577|       |        /* Continue search in subsequent neighborhoods */
  578|  4.42k|        neigh_idx = (neigh_idx + 1) & md->neighborhood_mask;
  579|  4.42k|    } while (neigh_idx != neigh_idx_start);
  ------------------
  |  Branch (579:14): [True: 4.42k, False: 0]
  ------------------
  580|       |
  581|   371k|not_found:
  582|       |    /* If we get to here, its just an insert */
  583|   371k|    if (empty_idx == SIZE_MAX)
  ------------------
  |  Branch (583:9): [True: 0, False: 371k]
  ------------------
  584|      0|        return -1; /* out of space */
  585|   371k|    if (!CRYPTO_atomic_store(&md->neighborhoods[neigh_idx].entries[empty_idx].hash,
  ------------------
  |  Branch (585:9): [True: 0, False: 371k]
  ------------------
  586|   371k|            hash, h->atomic_lock))
  587|      0|        return 0;
  588|   371k|    h->wpd.value_count++;
  589|   371k|    ossl_rcu_assign_ptr(&md->neighborhoods[neigh_idx].entries[empty_idx].value,
  ------------------
  |  |   31|   371k|#define ossl_rcu_assign_ptr(p, v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  590|   371k|        &newval);
  591|   371k|    return 1;
  592|   371k|}
hashtable.c:free_value:
  623|   371k|{
  624|   371k|    OPENSSL_free(v);
  ------------------
  |  |  131|   371k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  625|   371k|}
hashtable.c:compare_hash:
  406|  6.47M|{
  407|  6.47M|    return (hash1 == hash2);
  408|  6.47M|}
hashtable.c:match_key:
  517|  5.15M|{
  518|       |    /*
  519|       |     * keys match if they are both present, the same size
  520|       |     * and compare equal in memory
  521|       |     */
  522|  5.15M|    PREFETCH(a->keybuf);
  ------------------
  |  |   84|  5.15M|#define PREFETCH(x) __builtin_prefetch(x)
  ------------------
  523|  5.15M|    PREFETCH(b->keybuf);
  ------------------
  |  |   84|  5.15M|#define PREFETCH(x) __builtin_prefetch(x)
  ------------------
  524|  5.15M|    if (a->keybuf != NULL && b->keybuf != NULL && a->keysize == b->keysize)
  ------------------
  |  Branch (524:9): [True: 5.15M, False: 0]
  |  Branch (524:30): [True: 5.15M, False: 0]
  |  Branch (524:51): [True: 5.15M, False: 0]
  ------------------
  525|  5.15M|        return !memcmp(a->keybuf, b->keybuf, a->keysize);
  526|       |
  527|      0|    return 1;
  528|  5.15M|}

ossl_err_load_HTTP_strings:
   82|      1|{
   83|      1|#ifndef OPENSSL_NO_ERR
   84|      1|    if (ERR_reason_error_string(HTTP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (84:9): [True: 1, False: 0]
  ------------------
   85|      1|        ERR_load_strings_const(HTTP_str_reasons);
   86|      1|#endif
   87|      1|    return 1;
   88|      1|}

ossl_indicator_set_callback_new:
   21|    787|{
   22|    787|    INDICATOR_CB *cb;
   23|       |
   24|    787|    cb = OPENSSL_zalloc(sizeof(*cb));
  ------------------
  |  |  108|    787|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   25|    787|    return cb;
   26|    787|}
ossl_indicator_set_callback_free:
   29|    787|{
   30|    787|    OPENSSL_free(cb);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   31|    787|}

OPENSSL_cleanup:
  375|      1|{
  376|      1|    OPENSSL_INIT_STOP *currhandler, *lasthandler;
  377|       |
  378|       |    /*
  379|       |     * At some point we should consider looking at this function with a view to
  380|       |     * moving most/all of this into onfree handlers in OSSL_LIB_CTX.
  381|       |     */
  382|       |
  383|       |    /* If we've not been inited then no need to deinit */
  384|      1|    if (!base_inited)
  ------------------
  |  Branch (384:9): [True: 0, False: 1]
  ------------------
  385|      0|        return;
  386|       |
  387|       |    /* Might be explicitly called and also by atexit */
  388|      1|    if (stopped)
  ------------------
  |  Branch (388:9): [True: 0, False: 1]
  ------------------
  389|      0|        return;
  390|      1|    stopped = 1;
  391|       |
  392|       |    /*
  393|       |     * Thread stop may not get automatically called by the thread library for
  394|       |     * the very last thread in some situations, so call it directly.
  395|       |     */
  396|      1|    OPENSSL_thread_stop();
  397|       |
  398|      1|    currhandler = stop_handlers;
  399|      1|    while (currhandler != NULL) {
  ------------------
  |  Branch (399:12): [True: 0, False: 1]
  ------------------
  400|      0|        currhandler->handler();
  401|      0|        lasthandler = currhandler;
  402|      0|        currhandler = currhandler->next;
  403|      0|        OPENSSL_free(lasthandler);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  404|      0|    }
  405|      1|    stop_handlers = NULL;
  406|       |
  407|      1|    CRYPTO_THREAD_lock_free(optsdone_lock);
  408|      1|    optsdone_lock = NULL;
  409|      1|    CRYPTO_THREAD_lock_free(init_lock);
  410|      1|    init_lock = NULL;
  411|       |
  412|      1|    CRYPTO_THREAD_cleanup_local(&in_init_config_local);
  413|       |
  414|       |    /*
  415|       |     * We assume we are single-threaded for this function, i.e. no race
  416|       |     * conditions for the various "*_inited" vars below.
  417|       |     */
  418|       |
  419|      1|#ifndef OPENSSL_NO_COMP
  420|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_zlib_cleanup()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  421|      1|    ossl_comp_zlib_cleanup();
  422|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_brotli_cleanup()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  423|      1|    ossl_comp_brotli_cleanup();
  424|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_zstd_cleanup()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  425|      1|    ossl_comp_zstd_cleanup();
  426|      1|#endif
  427|       |
  428|      1|    if (async_inited) {
  ------------------
  |  Branch (428:9): [True: 0, False: 1]
  ------------------
  429|      0|        OSSL_TRACE(INIT, "OPENSSL_cleanup: async_deinit()\n");
  ------------------
  |  |  290|      0|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      0|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  430|      0|        async_deinit();
  431|      0|    }
  432|       |
  433|       |    /*
  434|       |     * Note that cleanup order is important:
  435|       |     * - ossl_rand_cleanup_int could call an ENGINE's RAND cleanup function so
  436|       |     * must be called before engine_cleanup_int()
  437|       |     * - ENGINEs use CRYPTO_EX_DATA and therefore, must be cleaned up
  438|       |     * before the ex data handlers are wiped during default ossl_lib_ctx deinit.
  439|       |     * - ossl_config_modules_free() can end up in ENGINE code so must be called
  440|       |     * before engine_cleanup_int()
  441|       |     * - ENGINEs and additional EVP algorithms might use added OIDs names so
  442|       |     * ossl_obj_cleanup_int() must be called last
  443|       |     */
  444|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_rand_cleanup_int()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  445|      1|    ossl_rand_cleanup_int();
  446|       |
  447|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_config_modules_free()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  448|      1|    ossl_config_modules_free();
  449|       |
  450|      1|#ifndef OPENSSL_NO_ENGINE
  451|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: engine_cleanup_int()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  452|      1|    engine_cleanup_int();
  453|      1|#endif
  454|       |
  455|      1|#ifndef OPENSSL_NO_DEPRECATED_3_0
  456|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_store_cleanup_int()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  457|      1|    ossl_store_cleanup_int();
  458|      1|#endif
  459|       |
  460|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_lib_ctx_default_deinit()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  461|      1|    ossl_lib_ctx_default_deinit();
  462|       |
  463|      1|    ossl_cleanup_thread();
  464|       |
  465|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: bio_cleanup()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  466|      1|    bio_cleanup();
  467|       |
  468|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: evp_cleanup_int()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  469|      1|    evp_cleanup_int();
  470|       |
  471|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_obj_cleanup_int()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  472|      1|    ossl_obj_cleanup_int();
  473|       |
  474|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: err_int()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  475|      1|    err_cleanup();
  476|       |
  477|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: CRYPTO_secure_malloc_done()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  478|      1|    CRYPTO_secure_malloc_done();
  479|       |
  480|      1|#ifndef OPENSSL_NO_CMP
  481|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: OSSL_CMP_log_close()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  482|      1|    OSSL_CMP_log_close();
  483|      1|#endif
  484|       |
  485|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_trace_cleanup()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  486|      1|    ossl_trace_cleanup();
  487|       |
  488|      1|    base_inited = 0;
  489|      1|}
OPENSSL_init_crypto:
  497|  23.6M|{
  498|  23.6M|    uint64_t tmp;
  499|  23.6M|    int aloaddone = 0;
  500|       |
  501|       |    /* Applications depend on 0 being returned when cleanup was already done */
  502|  23.6M|    if (ossl_unlikely(stopped)) {
  ------------------
  |  |   23|  23.6M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 23.6M]
  |  |  ------------------
  ------------------
  503|      0|        if (!(opts & OPENSSL_INIT_BASE_ONLY))
  ------------------
  |  |   31|      0|#define OPENSSL_INIT_BASE_ONLY 0x00040000L
  ------------------
  |  Branch (503:13): [True: 0, False: 0]
  ------------------
  504|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  505|      0|        return 0;
  506|      0|    }
  507|       |
  508|       |    /*
  509|       |     * We ignore failures from this function. It is probably because we are
  510|       |     * on a platform that doesn't support lockless atomic loads (we may not
  511|       |     * have created optsdone_lock yet so we can't use it). This is just an
  512|       |     * optimisation to skip the full checks in this function if we don't need
  513|       |     * to, so we carry on regardless in the event of failure.
  514|       |     *
  515|       |     * There could be a race here with other threads, so that optsdone has not
  516|       |     * been updated yet, even though the options have in fact been initialised.
  517|       |     * This doesn't matter - it just means we will run the full function
  518|       |     * unnecessarily - but all the critical code is contained in RUN_ONCE
  519|       |     * functions anyway so we are safe.
  520|       |     */
  521|  23.6M|    if (ossl_likely(CRYPTO_atomic_load(&optsdone, &tmp, NULL))) {
  ------------------
  |  |   22|  23.6M|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 23.6M, False: 0]
  |  |  ------------------
  ------------------
  522|  23.6M|        if ((tmp & opts) == opts)
  ------------------
  |  Branch (522:13): [True: 3.59M, False: 20.0M]
  ------------------
  523|  3.59M|            return 1;
  524|  20.0M|        aloaddone = 1;
  525|  20.0M|    }
  526|       |
  527|       |    /*
  528|       |     * At some point we should look at this function with a view to moving
  529|       |     * most/all of this into OSSL_LIB_CTX.
  530|       |     *
  531|       |     * When the caller specifies OPENSSL_INIT_BASE_ONLY, that should be the
  532|       |     * *only* option specified.  With that option we return immediately after
  533|       |     * doing the requested limited initialization.  Note that
  534|       |     * err_shelve_state() called by us via ossl_init_load_crypto_nodelete()
  535|       |     * re-enters OPENSSL_init_crypto() with OPENSSL_INIT_BASE_ONLY, but with
  536|       |     * base already initialized this is a harmless NOOP.
  537|       |     *
  538|       |     * If we remain the only caller of err_shelve_state() the recursion should
  539|       |     * perhaps be removed, but if in doubt, it can be left in place.
  540|       |     */
  541|  20.0M|    if (ossl_unlikely(!RUN_ONCE(&base, ossl_init_base)))
  ------------------
  |  |   23|  40.0M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 20.0M]
  |  |  |  Branch (23:46): [True: 20.0M, False: 0]
  |  |  ------------------
  ------------------
  542|      0|        return 0;
  543|       |
  544|  20.0M|    if (opts & OPENSSL_INIT_BASE_ONLY)
  ------------------
  |  |   31|  20.0M|#define OPENSSL_INIT_BASE_ONLY 0x00040000L
  ------------------
  |  Branch (544:9): [True: 20.0M, False: 3]
  ------------------
  545|  20.0M|        return 1;
  546|       |
  547|       |    /*
  548|       |     * optsdone_lock should definitely be set up now, so we can now repeat the
  549|       |     * same check from above but be sure that it will work even on platforms
  550|       |     * without lockless CRYPTO_atomic_load
  551|       |     */
  552|      3|    if (!aloaddone) {
  ------------------
  |  Branch (552:9): [True: 0, False: 3]
  ------------------
  553|      0|        if (!CRYPTO_atomic_load(&optsdone, &tmp, optsdone_lock))
  ------------------
  |  Branch (553:13): [True: 0, False: 0]
  ------------------
  554|      0|            return 0;
  555|      0|        if ((tmp & opts) == opts)
  ------------------
  |  Branch (555:13): [True: 0, False: 0]
  ------------------
  556|      0|            return 1;
  557|      0|    }
  558|       |
  559|       |    /*
  560|       |     * Now we don't always set up exit handlers, the INIT_BASE_ONLY calls
  561|       |     * should not have the side-effect of setting up exit handlers, and
  562|       |     * therefore, this code block is below the INIT_BASE_ONLY-conditioned early
  563|       |     * return above.
  564|       |     */
  565|      3|    if ((opts & OPENSSL_INIT_NO_ATEXIT) != 0) {
  ------------------
  |  |  523|      3|#define OPENSSL_INIT_NO_ATEXIT 0x00080000L
  ------------------
  |  Branch (565:9): [True: 0, False: 3]
  ------------------
  566|      0|        if (!RUN_ONCE_ALT(&register_atexit, ossl_init_no_register_atexit,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (566:13): [True: 0, False: 0]
  ------------------
  567|      0|                ossl_init_register_atexit))
  568|      0|            return 0;
  569|      3|    } else if (!RUN_ONCE(&register_atexit, ossl_init_register_atexit)) {
  ------------------
  |  |  130|      3|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 3, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (569:16): [True: 0, False: 3]
  ------------------
  570|      0|        return 0;
  571|      0|    }
  572|       |
  573|      3|    if (!RUN_ONCE(&load_crypto_nodelete, ossl_init_load_crypto_nodelete))
  ------------------
  |  |  130|      3|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 3, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (573:9): [True: 0, False: 3]
  ------------------
  574|      0|        return 0;
  575|       |
  576|      3|    if ((opts & OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  504|      3|#define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS 0x00000001L
  ------------------
  |  Branch (576:9): [True: 0, False: 3]
  ------------------
  577|      0|        && !RUN_ONCE_ALT(&load_crypto_strings,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (577:12): [True: 0, False: 0]
  ------------------
  578|      3|            ossl_init_no_load_crypto_strings,
  579|      3|            ossl_init_load_crypto_strings))
  580|      0|        return 0;
  581|       |
  582|      3|    if ((opts & OPENSSL_INIT_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  505|      3|#define OPENSSL_INIT_LOAD_CRYPTO_STRINGS 0x00000002L
  ------------------
  |  Branch (582:9): [True: 1, False: 2]
  ------------------
  583|      1|        && !RUN_ONCE(&load_crypto_strings, ossl_init_load_crypto_strings))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (583:12): [True: 0, False: 1]
  ------------------
  584|      0|        return 0;
  585|       |
  586|      3|    if ((opts & OPENSSL_INIT_NO_LOAD_SSL_STRINGS)
  ------------------
  |  | 2821|      3|#define OPENSSL_INIT_NO_LOAD_SSL_STRINGS 0x00100000L
  ------------------
  |  Branch (586:9): [True: 0, False: 3]
  ------------------
  587|      0|        && !RUN_ONCE_ALT(&ssl_strings, ossl_init_no_load_ssl_strings,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (587:12): [True: 0, False: 0]
  ------------------
  588|      3|            ossl_init_load_ssl_strings))
  589|      0|        return 0;
  590|       |
  591|      3|    if ((opts & OPENSSL_INIT_LOAD_SSL_STRINGS)
  ------------------
  |  | 2822|      3|#define OPENSSL_INIT_LOAD_SSL_STRINGS 0x00200000L
  ------------------
  |  Branch (591:9): [True: 1, False: 2]
  ------------------
  592|      1|        && !RUN_ONCE(&ssl_strings, ossl_init_load_ssl_strings))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (592:12): [True: 0, False: 1]
  ------------------
  593|      0|        return 0;
  594|       |
  595|      3|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_CIPHERS)
  ------------------
  |  |  508|      3|#define OPENSSL_INIT_NO_ADD_ALL_CIPHERS 0x00000010L
  ------------------
  |  Branch (595:9): [True: 0, False: 3]
  ------------------
  596|      0|        && !RUN_ONCE_ALT(&add_all_ciphers, ossl_init_no_add_all_ciphers,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (596:12): [True: 0, False: 0]
  ------------------
  597|      3|            ossl_init_add_all_ciphers))
  598|      0|        return 0;
  599|       |
  600|      3|    if ((opts & OPENSSL_INIT_ADD_ALL_CIPHERS)
  ------------------
  |  |  506|      3|#define OPENSSL_INIT_ADD_ALL_CIPHERS 0x00000004L
  ------------------
  |  Branch (600:9): [True: 2, False: 1]
  ------------------
  601|      2|        && !RUN_ONCE(&add_all_ciphers, ossl_init_add_all_ciphers))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (601:12): [True: 0, False: 2]
  ------------------
  602|      0|        return 0;
  603|       |
  604|      3|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_DIGESTS)
  ------------------
  |  |  509|      3|#define OPENSSL_INIT_NO_ADD_ALL_DIGESTS 0x00000020L
  ------------------
  |  Branch (604:9): [True: 0, False: 3]
  ------------------
  605|      0|        && !RUN_ONCE_ALT(&add_all_digests, ossl_init_no_add_all_digests,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (605:12): [True: 0, False: 0]
  ------------------
  606|      3|            ossl_init_add_all_digests))
  607|      0|        return 0;
  608|       |
  609|      3|    if ((opts & OPENSSL_INIT_ADD_ALL_DIGESTS)
  ------------------
  |  |  507|      3|#define OPENSSL_INIT_ADD_ALL_DIGESTS 0x00000008L
  ------------------
  |  Branch (609:9): [True: 2, False: 1]
  ------------------
  610|      2|        && !RUN_ONCE(&add_all_digests, ossl_init_add_all_digests))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (610:12): [True: 0, False: 2]
  ------------------
  611|      0|        return 0;
  612|       |
  613|      3|    if ((opts & OPENSSL_INIT_ATFORK)
  ------------------
  |  |  521|      3|#define OPENSSL_INIT_ATFORK 0x00020000L
  ------------------
  |  Branch (613:9): [True: 0, False: 3]
  ------------------
  614|      0|        && !openssl_init_fork_handlers())
  ------------------
  |  Branch (614:12): [True: 0, False: 0]
  ------------------
  615|      0|        return 0;
  616|       |
  617|      3|    if ((opts & OPENSSL_INIT_NO_LOAD_CONFIG)
  ------------------
  |  |  511|      3|#define OPENSSL_INIT_NO_LOAD_CONFIG 0x00000080L
  ------------------
  |  Branch (617:9): [True: 0, False: 3]
  ------------------
  618|      0|        && !RUN_ONCE_ALT(&config, ossl_init_no_config, ossl_init_config))
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (618:12): [True: 0, False: 0]
  ------------------
  619|      0|        return 0;
  620|       |
  621|      3|    if (opts & OPENSSL_INIT_LOAD_CONFIG) {
  ------------------
  |  |  510|      3|#define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
  ------------------
  |  Branch (621:9): [True: 2, False: 1]
  ------------------
  622|      2|        int loading = CRYPTO_THREAD_get_local(&in_init_config_local) != NULL;
  623|       |
  624|       |        /* If called recursively from OBJ_ calls, just skip it. */
  625|      2|        if (!loading) {
  ------------------
  |  Branch (625:13): [True: 1, False: 1]
  ------------------
  626|      1|            int ret;
  627|       |
  628|      1|            if (!CRYPTO_THREAD_set_local(&in_init_config_local, (void *)-1))
  ------------------
  |  Branch (628:17): [True: 0, False: 1]
  ------------------
  629|      0|                return 0;
  630|      1|            if (settings == NULL) {
  ------------------
  |  Branch (630:17): [True: 1, False: 0]
  ------------------
  631|      1|                ret = RUN_ONCE(&config, ossl_init_config);
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  632|      1|            } else {
  633|      0|                if (!CRYPTO_THREAD_write_lock(init_lock))
  ------------------
  |  Branch (633:21): [True: 0, False: 0]
  ------------------
  634|      0|                    return 0;
  635|      0|                conf_settings = settings;
  636|      0|                ret = RUN_ONCE_ALT(&config, ossl_init_config_settings,
  ------------------
  |  |  148|      0|    (CRYPTO_THREAD_run_once(once, initalt##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (148:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  637|      0|                    ossl_init_config);
  638|      0|                conf_settings = NULL;
  639|      0|                CRYPTO_THREAD_unlock(init_lock);
  640|      0|            }
  641|       |
  642|      1|            if (ret <= 0)
  ------------------
  |  Branch (642:17): [True: 0, False: 1]
  ------------------
  643|      0|                return 0;
  644|      1|        }
  645|      2|    }
  646|       |
  647|      3|    if ((opts & OPENSSL_INIT_ASYNC)
  ------------------
  |  |  512|      3|#define OPENSSL_INIT_ASYNC 0x00000100L
  ------------------
  |  Branch (647:9): [True: 0, False: 3]
  ------------------
  648|      0|        && !RUN_ONCE(&async, ossl_init_async))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (648:12): [True: 0, False: 0]
  ------------------
  649|      0|        return 0;
  650|       |
  651|      3|#ifndef OPENSSL_NO_ENGINE
  652|      3|    if ((opts & OPENSSL_INIT_ENGINE_OPENSSL)
  ------------------
  |  |  515|      3|#define OPENSSL_INIT_ENGINE_OPENSSL 0x00000800L
  ------------------
  |  Branch (652:9): [True: 0, False: 3]
  ------------------
  653|      0|        && !RUN_ONCE(&engine_openssl, ossl_init_engine_openssl))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (653:12): [True: 0, False: 0]
  ------------------
  654|      0|        return 0;
  655|      3|#ifndef OPENSSL_NO_RDRAND
  656|      3|    if ((opts & OPENSSL_INIT_ENGINE_RDRAND)
  ------------------
  |  |  513|      3|#define OPENSSL_INIT_ENGINE_RDRAND 0x00000200L
  ------------------
  |  Branch (656:9): [True: 1, False: 2]
  ------------------
  657|      1|        && !RUN_ONCE(&engine_rdrand, ossl_init_engine_rdrand))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (657:12): [True: 0, False: 1]
  ------------------
  658|      0|        return 0;
  659|      3|#endif
  660|      3|    if ((opts & OPENSSL_INIT_ENGINE_DYNAMIC)
  ------------------
  |  |  514|      3|#define OPENSSL_INIT_ENGINE_DYNAMIC 0x00000400L
  ------------------
  |  Branch (660:9): [True: 1, False: 2]
  ------------------
  661|      1|        && !RUN_ONCE(&engine_dynamic, ossl_init_engine_dynamic))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (661:12): [True: 0, False: 1]
  ------------------
  662|      0|        return 0;
  663|      3|#ifndef OPENSSL_NO_STATIC_ENGINE
  664|       |#ifndef OPENSSL_NO_DEVCRYPTOENG
  665|       |    if ((opts & OPENSSL_INIT_ENGINE_CRYPTODEV)
  666|       |        && !RUN_ONCE(&engine_devcrypto, ossl_init_engine_devcrypto))
  667|       |        return 0;
  668|       |#endif
  669|      3|#if !defined(OPENSSL_NO_PADLOCKENG)
  670|      3|    if ((opts & OPENSSL_INIT_ENGINE_PADLOCK)
  ------------------
  |  |  518|      3|#define OPENSSL_INIT_ENGINE_PADLOCK 0x00004000L
  ------------------
  |  Branch (670:9): [True: 1, False: 2]
  ------------------
  671|      1|        && !RUN_ONCE(&engine_padlock, ossl_init_engine_padlock))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (671:12): [True: 0, False: 1]
  ------------------
  672|      0|        return 0;
  673|      3|#endif
  674|       |#if defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_NO_CAPIENG)
  675|       |    if ((opts & OPENSSL_INIT_ENGINE_CAPI)
  676|       |        && !RUN_ONCE(&engine_capi, ossl_init_engine_capi))
  677|       |        return 0;
  678|       |#endif
  679|      3|#if !defined(OPENSSL_NO_AFALGENG)
  680|      3|    if ((opts & OPENSSL_INIT_ENGINE_AFALG)
  ------------------
  |  |  519|      3|#define OPENSSL_INIT_ENGINE_AFALG 0x00008000L
  ------------------
  |  Branch (680:9): [True: 0, False: 3]
  ------------------
  681|      0|        && !RUN_ONCE(&engine_afalg, ossl_init_engine_afalg))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (681:12): [True: 0, False: 0]
  ------------------
  682|      0|        return 0;
  683|      3|#endif
  684|      3|#endif
  685|      3|    if (opts & (OPENSSL_INIT_ENGINE_ALL_BUILTIN | OPENSSL_INIT_ENGINE_OPENSSL | OPENSSL_INIT_ENGINE_AFALG)) {
  ------------------
  |  |  535|      3|    (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  513|      3|#define OPENSSL_INIT_ENGINE_RDRAND 0x00000200L
  |  |  ------------------
  |  |                   (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  514|      3|#define OPENSSL_INIT_ENGINE_DYNAMIC 0x00000400L
  |  |  ------------------
  |  |  536|      3|        | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | OPENSSL_INIT_ENGINE_PADLOCK)
  |  |  ------------------
  |  |  |  |  516|      3|#define OPENSSL_INIT_ENGINE_CRYPTODEV 0x00001000L
  |  |  ------------------
  |  |                       | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | OPENSSL_INIT_ENGINE_PADLOCK)
  |  |  ------------------
  |  |  |  |  517|      3|#define OPENSSL_INIT_ENGINE_CAPI 0x00002000L
  |  |  ------------------
  |  |                       | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | OPENSSL_INIT_ENGINE_PADLOCK)
  |  |  ------------------
  |  |  |  |  518|      3|#define OPENSSL_INIT_ENGINE_PADLOCK 0x00004000L
  |  |  ------------------
  ------------------
                  if (opts & (OPENSSL_INIT_ENGINE_ALL_BUILTIN | OPENSSL_INIT_ENGINE_OPENSSL | OPENSSL_INIT_ENGINE_AFALG)) {
  ------------------
  |  |  515|      3|#define OPENSSL_INIT_ENGINE_OPENSSL 0x00000800L
  ------------------
                  if (opts & (OPENSSL_INIT_ENGINE_ALL_BUILTIN | OPENSSL_INIT_ENGINE_OPENSSL | OPENSSL_INIT_ENGINE_AFALG)) {
  ------------------
  |  |  519|      3|#define OPENSSL_INIT_ENGINE_AFALG 0x00008000L
  ------------------
  |  Branch (685:9): [True: 1, False: 2]
  ------------------
  686|      1|        ENGINE_register_all_complete();
  687|      1|    }
  688|      3|#endif
  689|       |
  690|      3|    if (!CRYPTO_atomic_or(&optsdone, opts, &tmp, optsdone_lock))
  ------------------
  |  Branch (690:9): [True: 0, False: 3]
  ------------------
  691|      0|        return 0;
  692|       |
  693|      3|    return 1;
  694|      3|}
init.c:ossl_init_base:
   58|      1|{
   59|       |    /* no need to init trace */
   60|       |
   61|      1|    OSSL_TRACE(INIT, "ossl_init_base: setting up stop handlers\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   62|       |#ifndef OPENSSL_NO_CRYPTO_MDEBUG
   63|       |    ossl_malloc_setup_failures();
   64|       |#endif
   65|       |
   66|      1|    if ((optsdone_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (66:9): [True: 0, False: 1]
  ------------------
   67|      1|        || (init_lock = CRYPTO_THREAD_lock_new()) == NULL)
  ------------------
  |  Branch (67:12): [True: 0, False: 1]
  ------------------
   68|      0|        goto err;
   69|       |
   70|      1|    OPENSSL_cpuid_setup();
   71|       |
   72|      1|    if (!ossl_init_thread())
  ------------------
  |  Branch (72:9): [True: 0, False: 1]
  ------------------
   73|      0|        goto err;
   74|       |
   75|      1|    if (!CRYPTO_THREAD_init_local(&in_init_config_local, NULL))
  ------------------
  |  Branch (75:9): [True: 0, False: 1]
  ------------------
   76|      0|        goto err;
   77|       |
   78|      1|    base_inited = 1;
   79|      1|    return 1;
   80|       |
   81|      0|err:
   82|      0|    OSSL_TRACE(INIT, "ossl_init_base failed!\n");
  ------------------
  |  |  290|      0|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      0|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   83|      0|    CRYPTO_THREAD_lock_free(optsdone_lock);
   84|      0|    optsdone_lock = NULL;
   85|      0|    CRYPTO_THREAD_lock_free(init_lock);
   86|      0|    init_lock = NULL;
   87|       |
   88|      0|    return 0;
   89|      1|}
init.c:ossl_init_register_atexit:
  101|      1|{
  102|      1|#ifndef OPENSSL_NO_ATEXIT
  103|       |#ifdef OPENSSL_INIT_DEBUG
  104|       |    fprintf(stderr, "OPENSSL_INIT: ossl_init_register_atexit()\n");
  105|       |#endif
  106|      1|#ifndef OPENSSL_SYS_UEFI
  107|       |#if defined(_WIN32) && !defined(__BORLANDC__)
  108|       |    /* We use _onexit() in preference because it gets called on DLL unload */
  109|       |    if (_onexit(win32atexit) == NULL)
  110|       |        return 0;
  111|       |#else
  112|      1|    if (atexit(OPENSSL_cleanup) != 0)
  ------------------
  |  Branch (112:9): [True: 0, False: 1]
  ------------------
  113|      0|        return 0;
  114|      1|#endif
  115|      1|#endif
  116|      1|#endif
  117|       |
  118|      1|    return 1;
  119|      1|}
init.c:ossl_init_load_crypto_nodelete:
  133|      1|{
  134|      1|    OSSL_TRACE(INIT, "ossl_init_load_crypto_nodelete()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  135|       |
  136|       |#if !defined(OPENSSL_USE_NODELETE) \
  137|       |    && !defined(OPENSSL_NO_PINSHARED)
  138|       |#if defined(DSO_WIN32) && !defined(_WIN32_WCE)
  139|       |    {
  140|       |        HMODULE handle = NULL;
  141|       |        BOOL ret;
  142|       |
  143|       |        /* We don't use the DSO route for WIN32 because there is a better way */
  144|       |        ret = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
  145|       |                | GET_MODULE_HANDLE_EX_FLAG_PIN,
  146|       |            (void *)&base_inited, &handle);
  147|       |
  148|       |        OSSL_TRACE1(INIT,
  149|       |            "ossl_init_load_crypto_nodelete: "
  150|       |            "obtained DSO reference? %s\n",
  151|       |            (ret == TRUE ? "No!" : "Yes."));
  152|       |        return (ret == TRUE) ? 1 : 0;
  153|       |    }
  154|       |#elif !defined(DSO_NONE)
  155|       |    /*
  156|       |     * Deliberately leak a reference to ourselves. This will force the library
  157|       |     * to remain loaded until the atexit() handler is run at process exit.
  158|       |     */
  159|       |    {
  160|       |        DSO *dso;
  161|       |        void *err;
  162|       |
  163|       |        if (!err_shelve_state(&err))
  164|       |            return 0;
  165|       |
  166|       |        dso = DSO_dsobyaddr(&base_inited, DSO_FLAG_NO_UNLOAD_ON_FREE);
  167|       |        /*
  168|       |         * In case of No!, it is uncertain our exit()-handlers can still be
  169|       |         * called. After dlclose() the whole library might have been unloaded
  170|       |         * already.
  171|       |         */
  172|       |        OSSL_TRACE1(INIT, "obtained DSO reference? %s\n",
  173|       |            (dso == NULL ? "No!" : "Yes."));
  174|       |        DSO_free(dso);
  175|       |        err_unshelve_state(err);
  176|       |    }
  177|       |#endif
  178|       |#endif
  179|       |
  180|      1|    return 1;
  181|      1|}
init.c:ossl_init_load_crypto_strings:
  186|      1|{
  187|      1|    int ret = 1;
  188|       |    /*
  189|       |     * OPENSSL_NO_AUTOERRINIT is provided here to prevent at compile time
  190|       |     * pulling in all the error strings during static linking
  191|       |     */
  192|      1|#if !defined(OPENSSL_NO_ERR) && !defined(OPENSSL_NO_AUTOERRINIT)
  193|      1|    void *err;
  194|       |
  195|      1|    if (!err_shelve_state(&err))
  ------------------
  |  Branch (195:9): [True: 0, False: 1]
  ------------------
  196|      0|        return 0;
  197|       |
  198|      1|    OSSL_TRACE(INIT, "ossl_err_load_crypto_strings()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  199|      1|    ret = ossl_err_load_crypto_strings();
  200|       |
  201|      1|    err_unshelve_state(err);
  202|      1|#endif
  203|      1|    return ret;
  204|      1|}
init.c:ossl_init_load_ssl_strings:
  216|      1|{
  217|       |    /*
  218|       |     * OPENSSL_NO_AUTOERRINIT is provided here to prevent at compile time
  219|       |     * pulling in all the error strings during static linking
  220|       |     */
  221|      1|#if !defined(OPENSSL_NO_ERR) && !defined(OPENSSL_NO_AUTOERRINIT)
  222|      1|    OSSL_TRACE(INIT, "ossl_init_load_ssl_strings: ossl_err_load_SSL_strings()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  223|      1|    ossl_err_load_SSL_strings();
  224|      1|#endif
  225|      1|    return 1;
  226|      1|}
init.c:ossl_init_add_all_ciphers:
  237|      1|{
  238|       |    /*
  239|       |     * OPENSSL_NO_AUTOALGINIT is provided here to prevent at compile time
  240|       |     * pulling in all the ciphers during static linking
  241|       |     */
  242|      1|#ifndef OPENSSL_NO_AUTOALGINIT
  243|      1|    OSSL_TRACE(INIT, "openssl_add_all_ciphers_int()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  244|      1|    openssl_add_all_ciphers_int();
  245|      1|#endif
  246|      1|    return 1;
  247|      1|}
init.c:ossl_init_add_all_digests:
  258|      1|{
  259|       |    /*
  260|       |     * OPENSSL_NO_AUTOALGINIT is provided here to prevent at compile time
  261|       |     * pulling in all the ciphers during static linking
  262|       |     */
  263|      1|#ifndef OPENSSL_NO_AUTOALGINIT
  264|      1|    OSSL_TRACE(INIT, "openssl_add_all_digests()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  265|      1|    openssl_add_all_digests_int();
  266|      1|#endif
  267|      1|    return 1;
  268|      1|}
init.c:ossl_init_config:
  280|      1|{
  281|      1|    int ret = ossl_config_int(NULL);
  282|       |
  283|      1|    return ret;
  284|      1|}
init.c:ossl_init_engine_rdrand:
  321|      1|{
  322|      1|    OSSL_TRACE(INIT, "engine_load_rdrand_int()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  323|      1|    engine_load_rdrand_int();
  324|      1|    return 1;
  325|      1|}
init.c:ossl_init_engine_dynamic:
  329|      1|{
  330|      1|    OSSL_TRACE(INIT, "engine_load_dynamic_int()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  331|      1|    engine_load_dynamic_int();
  332|      1|    return 1;
  333|      1|}
init.c:ossl_init_engine_padlock:
  347|      1|{
  348|      1|    OSSL_TRACE(INIT, "engine_load_padlock_int()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  349|      1|    engine_load_padlock_int();
  350|      1|    return 1;
  351|      1|}

ossl_init_thread:
  266|      5|{
  267|      5|    if (CRYPTO_THREAD_compare_id(recursion_guard,
  ------------------
  |  Branch (267:9): [True: 1, False: 4]
  ------------------
  268|      5|            CRYPTO_THREAD_get_current_id()))
  269|      1|        return 1;
  270|      4|    if (!RUN_ONCE(&ossl_init_thread_runonce, ossl_init_thread_once))
  ------------------
  |  |  130|      4|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 4, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (270:9): [True: 0, False: 4]
  ------------------
  271|      0|        return 0;
  272|      4|    return 1;
  273|      4|}
ossl_cleanup_thread:
  276|      1|{
  277|       |    init_thread_deregister(NULL, 1);
  278|      1|    CRYPTO_THREAD_cleanup_local(&destructor_key.value);
  279|      1|    destructor_key.sane = -1;
  280|      1|}
OPENSSL_thread_stop:
  294|      1|{
  295|      1|    if (destructor_key.sane != -1) {
  ------------------
  |  Branch (295:9): [True: 1, False: 0]
  ------------------
  296|      1|        THREAD_EVENT_HANDLER **hands = clear_thread_local(NULL);
  297|       |
  298|      1|        init_thread_stop(NULL, hands);
  299|       |
  300|      1|        init_thread_remove_handlers(hands);
  301|      1|        OPENSSL_free(hands);
  ------------------
  |  |  131|      1|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  302|       |
  303|      1|        CRYPTO_THREAD_clean_local();
  304|      1|    }
  305|      1|}
ossl_ctx_thread_stop:
  308|    787|{
  309|    787|    if (destructor_key.sane != -1) {
  ------------------
  |  Branch (309:9): [True: 787, False: 0]
  ------------------
  310|    787|        THREAD_EVENT_HANDLER **hands = fetch_thread_local(ctx);
  311|       |
  312|    787|        init_thread_stop(ctx, hands);
  313|    787|    }
  314|    787|}
ossl_init_thread_start:
  419|    550|{
  420|    550|    THREAD_EVENT_HANDLER **hands;
  421|    550|    THREAD_EVENT_HANDLER *hand;
  422|    550|    OSSL_LIB_CTX *ctx = NULL;
  423|       |#ifdef FIPS_MODULE
  424|       |    /*
  425|       |     * In FIPS mode the list of THREAD_EVENT_HANDLERs is unique per combination
  426|       |     * of OSSL_LIB_CTX and thread. This is because in FIPS mode each
  427|       |     * OSSL_LIB_CTX gets informed about thread stop events individually.
  428|       |     */
  429|       |
  430|       |    ctx = arg;
  431|       |#endif
  432|       |
  433|    550|    hands = alloc_thread_local(ctx);
  434|       |
  435|    550|    if (hands == NULL)
  ------------------
  |  Branch (435:9): [True: 0, False: 550]
  ------------------
  436|      0|        return 0;
  437|       |
  438|       |#ifdef FIPS_MODULE
  439|       |    if (*hands == NULL) {
  440|       |        /*
  441|       |         * We've not yet registered any handlers for this thread. We need to get
  442|       |         * libcrypto to tell us about later thread stop events. c_thread_start
  443|       |         * is a callback to libcrypto defined in fipsprov.c
  444|       |         */
  445|       |        if (!ossl_thread_register_fips(ctx))
  446|       |            return 0;
  447|       |    }
  448|       |#endif
  449|       |
  450|    550|    hand = OPENSSL_malloc(sizeof(*hand));
  ------------------
  |  |  106|    550|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  451|    550|    if (hand == NULL)
  ------------------
  |  Branch (451:9): [True: 0, False: 550]
  ------------------
  452|      0|        return 0;
  453|       |
  454|    550|    hand->handfn = handfn;
  455|    550|    hand->arg = arg;
  456|    550|#ifndef FIPS_MODULE
  457|    550|    hand->index = index;
  458|    550|#endif
  459|    550|    hand->next = *hands;
  460|    550|    *hands = hand;
  461|       |
  462|    550|    return 1;
  463|    550|}
ossl_init_thread_deregister:
  519|  1.57k|{
  520|  1.57k|    return init_thread_deregister(index, 0);
  521|  1.57k|}
initthread.c:ossl_init_thread_once:
  250|      1|{
  251|       |    /* CRYPTO_THREAD_init_local() can call ossl_init_threads() again */
  252|      1|    recursion_guard = CRYPTO_THREAD_get_current_id();
  253|      1|    if (!CRYPTO_THREAD_init_local(&destructor_key.value,
  ------------------
  |  Branch (253:9): [True: 0, False: 1]
  ------------------
  254|      1|            init_thread_destructor))
  255|      0|        return 0;
  256|       |
  257|       |#if defined(OPENSSL_SYS_TANDEM)
  258|       |    memset(&recursion_guard, 0, sizeof(recursion_guard));
  259|       |#else
  260|      1|    recursion_guard = (CRYPTO_THREAD_ID)0;
  261|      1|#endif
  262|      1|    return 1;
  263|      1|}
initthread.c:clear_thread_local:
  166|      1|{
  167|      1|    return manage_thread_local(ctx, 0, 0);
  168|      1|}
initthread.c:manage_thread_local:
  137|  1.33k|{
  138|  1.33k|    THREAD_EVENT_HANDLER **hands = get_thread_event_handler(ctx);
  139|       |
  140|  1.33k|    if (alloc) {
  ------------------
  |  Branch (140:9): [True: 550, False: 788]
  ------------------
  141|    550|        if (hands == NULL) {
  ------------------
  |  Branch (141:13): [True: 1, False: 549]
  ------------------
  142|       |
  143|      1|            if ((hands = OPENSSL_zalloc(sizeof(*hands))) == NULL)
  ------------------
  |  |  108|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (143:17): [True: 0, False: 1]
  ------------------
  144|      0|                return NULL;
  145|       |
  146|      1|            if (!set_thread_event_handler(ctx, hands)) {
  ------------------
  |  Branch (146:17): [True: 0, False: 1]
  ------------------
  147|      0|                OPENSSL_free(hands);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  148|      0|                return NULL;
  149|      0|            }
  150|      1|#ifndef FIPS_MODULE
  151|      1|            if (!init_thread_push_handlers(hands)) {
  ------------------
  |  Branch (151:17): [True: 0, False: 1]
  ------------------
  152|      0|                set_thread_event_handler(ctx, NULL);
  153|      0|                OPENSSL_free(hands);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  154|      0|                return NULL;
  155|      0|            }
  156|      1|#endif
  157|      1|        }
  158|    788|    } else if (!keep) {
  ------------------
  |  Branch (158:16): [True: 1, False: 787]
  ------------------
  159|      1|        set_thread_event_handler(ctx, NULL);
  160|      1|    }
  161|       |
  162|  1.33k|    return hands;
  163|  1.33k|}
initthread.c:get_thread_event_handler:
  114|  1.33k|{
  115|       |#ifdef FIPS_MODULE
  116|       |    return CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_TEVENT_KEY, ctx);
  117|       |#else
  118|  1.33k|    if (destructor_key.sane != -1)
  ------------------
  |  Branch (118:9): [True: 1.33k, False: 0]
  ------------------
  119|  1.33k|        return CRYPTO_THREAD_get_local(&destructor_key.value);
  120|      0|    return NULL;
  121|  1.33k|#endif
  122|  1.33k|}
initthread.c:set_thread_event_handler:
  125|      2|{
  126|       |#ifdef FIPS_MODULE
  127|       |    return CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_TEVENT_KEY, ctx, hands);
  128|       |#else
  129|      2|    if (destructor_key.sane != -1)
  ------------------
  |  Branch (129:9): [True: 2, False: 0]
  ------------------
  130|      2|        return CRYPTO_THREAD_set_local(&destructor_key.value, hands);
  131|      0|    return 0;
  132|      2|#endif
  133|      2|}
initthread.c:init_thread_push_handlers:
  192|      1|{
  193|      1|    int ret;
  194|      1|    GLOBAL_TEVENT_REGISTER *gtr;
  195|       |
  196|      1|    gtr = get_global_tevent_register();
  197|      1|    if (gtr == NULL)
  ------------------
  |  Branch (197:9): [True: 0, False: 1]
  ------------------
  198|      0|        return 0;
  199|       |
  200|      1|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (200:9): [True: 0, False: 1]
  ------------------
  201|      0|        return 0;
  202|      1|    ret = (sk_THREAD_EVENT_HANDLER_PTR_push(gtr->skhands, hands) != 0);
  203|      1|    CRYPTO_THREAD_unlock(gtr->lock);
  204|       |
  205|      1|    return ret;
  206|      1|}
initthread.c:get_global_tevent_register:
   79|  2.36k|{
   80|  2.36k|    if (!RUN_ONCE(&tevent_register_runonce, create_global_tevent_register))
  ------------------
  |  |  130|  2.36k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2.36k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (80:9): [True: 0, False: 2.36k]
  ------------------
   81|      0|        return NULL;
   82|  2.36k|    return glob_tevent_reg;
   83|  2.36k|}
initthread.c:create_global_tevent_register:
   60|      1|{
   61|      1|    glob_tevent_reg = OPENSSL_zalloc(sizeof(*glob_tevent_reg));
  ------------------
  |  |  108|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   62|      1|    if (glob_tevent_reg == NULL)
  ------------------
  |  Branch (62:9): [True: 0, False: 1]
  ------------------
   63|      0|        return 0;
   64|       |
   65|      1|    glob_tevent_reg->skhands = sk_THREAD_EVENT_HANDLER_PTR_new_null();
   66|      1|    glob_tevent_reg->lock = CRYPTO_THREAD_lock_new();
   67|      1|    if (glob_tevent_reg->skhands == NULL || glob_tevent_reg->lock == NULL) {
  ------------------
  |  Branch (67:9): [True: 0, False: 1]
  |  Branch (67:45): [True: 0, False: 1]
  ------------------
   68|      0|        sk_THREAD_EVENT_HANDLER_PTR_free(glob_tevent_reg->skhands);
   69|      0|        CRYPTO_THREAD_lock_free(glob_tevent_reg->lock);
   70|      0|        OPENSSL_free(glob_tevent_reg);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   71|      0|        glob_tevent_reg = NULL;
   72|      0|        return 0;
   73|      0|    }
   74|       |
   75|      1|    return 1;
   76|      1|}
initthread.c:init_thread_remove_handlers:
  209|      1|{
  210|      1|    GLOBAL_TEVENT_REGISTER *gtr;
  211|      1|    int i;
  212|       |
  213|      1|    gtr = get_global_tevent_register();
  214|      1|    if (gtr == NULL)
  ------------------
  |  Branch (214:9): [True: 0, False: 1]
  ------------------
  215|      0|        return;
  216|      1|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (216:9): [True: 0, False: 1]
  ------------------
  217|      0|        return;
  218|      1|    for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) {
  ------------------
  |  Branch (218:17): [True: 1, False: 0]
  ------------------
  219|      1|        THREAD_EVENT_HANDLER **hands
  220|      1|            = sk_THREAD_EVENT_HANDLER_PTR_value(gtr->skhands, i);
  221|       |
  222|      1|        if (hands == handsin) {
  ------------------
  |  Branch (222:13): [True: 1, False: 0]
  ------------------
  223|      1|            sk_THREAD_EVENT_HANDLER_PTR_delete(gtr->skhands, i);
  224|      1|            CRYPTO_THREAD_unlock(gtr->lock);
  225|      1|            return;
  226|      1|        }
  227|      1|    }
  228|      0|    CRYPTO_THREAD_unlock(gtr->lock);
  229|      0|    return;
  230|      1|}
initthread.c:fetch_thread_local:
  171|    787|{
  172|    787|    return manage_thread_local(ctx, 0, 1);
  173|    787|}
initthread.c:init_thread_stop:
  375|    788|{
  376|    788|    THREAD_EVENT_HANDLER *curr, *prev = NULL, *tmp;
  377|    788|#ifndef FIPS_MODULE
  378|    788|    GLOBAL_TEVENT_REGISTER *gtr;
  379|    788|#endif
  380|       |
  381|       |    /* Can't do much about this */
  382|    788|    if (hands == NULL)
  ------------------
  |  Branch (382:9): [True: 1, False: 787]
  ------------------
  383|      1|        return;
  384|       |
  385|    787|#ifndef FIPS_MODULE
  386|    787|    gtr = get_global_tevent_register();
  387|    787|    if (gtr == NULL)
  ------------------
  |  Branch (387:9): [True: 0, False: 787]
  ------------------
  388|      0|        return;
  389|       |
  390|    787|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (390:9): [True: 0, False: 787]
  ------------------
  391|      0|        return;
  392|    787|#endif
  393|       |
  394|    787|    curr = *hands;
  395|  2.90k|    while (curr != NULL) {
  ------------------
  |  Branch (395:12): [True: 2.12k, False: 787]
  ------------------
  396|  2.12k|        if (arg != NULL && curr->arg != arg) {
  ------------------
  |  Branch (396:13): [True: 2.12k, False: 2]
  |  Branch (396:28): [True: 1.57k, False: 548]
  ------------------
  397|  1.57k|            prev = curr;
  398|  1.57k|            curr = curr->next;
  399|  1.57k|            continue;
  400|  1.57k|        }
  401|    550|        curr->handfn(curr->arg);
  402|    550|        if (prev == NULL)
  ------------------
  |  Branch (402:13): [True: 550, False: 0]
  ------------------
  403|    550|            *hands = curr->next;
  404|      0|        else
  405|      0|            prev->next = curr->next;
  406|       |
  407|    550|        tmp = curr;
  408|    550|        curr = curr->next;
  409|       |
  410|    550|        OPENSSL_free(tmp);
  ------------------
  |  |  131|    550|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  411|    550|    }
  412|    787|#ifndef FIPS_MODULE
  413|    787|    CRYPTO_THREAD_unlock(gtr->lock);
  414|    787|#endif
  415|    787|}
initthread.c:alloc_thread_local:
  176|    550|{
  177|    550|    return manage_thread_local(ctx, 1, 0);
  178|    550|}
initthread.c:init_thread_deregister:
  467|  1.57k|{
  468|  1.57k|    GLOBAL_TEVENT_REGISTER *gtr;
  469|  1.57k|    int i;
  470|       |
  471|  1.57k|    gtr = get_global_tevent_register();
  472|  1.57k|    if (gtr == NULL)
  ------------------
  |  Branch (472:9): [True: 0, False: 1.57k]
  ------------------
  473|      0|        return 0;
  474|  1.57k|    if (!all) {
  ------------------
  |  Branch (474:9): [True: 1.57k, False: 1]
  ------------------
  475|  1.57k|        if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (475:13): [True: 0, False: 1.57k]
  ------------------
  476|      0|            return 0;
  477|  1.57k|    } else {
  478|      1|        glob_tevent_reg = NULL;
  479|      1|    }
  480|  3.14k|    for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) {
  ------------------
  |  Branch (480:17): [True: 1.57k, False: 1.57k]
  ------------------
  481|  1.57k|        THREAD_EVENT_HANDLER **hands
  482|  1.57k|            = sk_THREAD_EVENT_HANDLER_PTR_value(gtr->skhands, i);
  483|  1.57k|        THREAD_EVENT_HANDLER *curr = NULL, *prev = NULL, *tmp;
  484|       |
  485|  1.57k|        if (hands == NULL) {
  ------------------
  |  Branch (485:13): [True: 0, False: 1.57k]
  ------------------
  486|      0|            if (!all)
  ------------------
  |  Branch (486:17): [True: 0, False: 0]
  ------------------
  487|      0|                CRYPTO_THREAD_unlock(gtr->lock);
  488|      0|            return 0;
  489|      0|        }
  490|  1.57k|        curr = *hands;
  491|  4.71k|        while (curr != NULL) {
  ------------------
  |  Branch (491:16): [True: 3.14k, False: 1.57k]
  ------------------
  492|  3.14k|            if (all || curr->index == index) {
  ------------------
  |  Branch (492:17): [True: 0, False: 3.14k]
  |  Branch (492:24): [True: 0, False: 3.14k]
  ------------------
  493|      0|                if (prev != NULL)
  ------------------
  |  Branch (493:21): [True: 0, False: 0]
  ------------------
  494|      0|                    prev->next = curr->next;
  495|      0|                else
  496|      0|                    *hands = curr->next;
  497|      0|                tmp = curr;
  498|      0|                curr = curr->next;
  499|      0|                OPENSSL_free(tmp);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  500|      0|                continue;
  501|      0|            }
  502|  3.14k|            prev = curr;
  503|  3.14k|            curr = curr->next;
  504|  3.14k|        }
  505|  1.57k|        if (all)
  ------------------
  |  Branch (505:13): [True: 0, False: 1.57k]
  ------------------
  506|      0|            OPENSSL_free(hands);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  507|  1.57k|    }
  508|  1.57k|    if (all) {
  ------------------
  |  Branch (508:9): [True: 1, False: 1.57k]
  ------------------
  509|      1|        CRYPTO_THREAD_lock_free(gtr->lock);
  510|      1|        sk_THREAD_EVENT_HANDLER_PTR_free(gtr->skhands);
  511|      1|        OPENSSL_free(gtr);
  ------------------
  |  |  131|      1|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  512|  1.57k|    } else {
  513|  1.57k|        CRYPTO_THREAD_unlock(gtr->lock);
  514|  1.57k|    }
  515|  1.57k|    return 1;
  516|  1.57k|}

OPENSSL_LH_set_thunks:
   52|   174k|{
   53|       |
   54|   174k|    if (lh == NULL)
  ------------------
  |  Branch (54:9): [True: 0, False: 174k]
  ------------------
   55|      0|        return NULL;
   56|   174k|    lh->compw = cw;
   57|   174k|    lh->hashw = hw;
   58|   174k|    lh->daw = daw;
   59|   174k|    lh->daaw = daaw;
   60|   174k|    return lh;
   61|   174k|}
OPENSSL_LH_new:
   64|   174k|{
   65|   174k|    OPENSSL_LHASH *ret;
   66|       |
   67|   174k|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  108|   174k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (67:9): [True: 0, False: 174k]
  ------------------
   68|      0|        return NULL;
   69|   174k|    if ((ret->b = OPENSSL_calloc(MIN_NODES, sizeof(*ret->b))) == NULL)
  ------------------
  |  |  112|   174k|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (69:9): [True: 0, False: 174k]
  ------------------
   70|      0|        goto err;
   71|   174k|    ret->comp = ((c == NULL) ? (OPENSSL_LH_COMPFUNC)strcmp : c);
  ------------------
  |  Branch (71:18): [True: 0, False: 174k]
  ------------------
   72|   174k|    ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h);
  ------------------
  |  Branch (72:18): [True: 0, False: 174k]
  ------------------
   73|   174k|    ret->num_nodes = MIN_NODES / 2;
  ------------------
  |  |   39|   174k|#define MIN_NODES 16
  ------------------
   74|   174k|    ret->num_alloc_nodes = MIN_NODES;
  ------------------
  |  |   39|   174k|#define MIN_NODES 16
  ------------------
   75|   174k|    ret->pmax = MIN_NODES / 2;
  ------------------
  |  |   39|   174k|#define MIN_NODES 16
  ------------------
   76|   174k|    ret->up_load = UP_LOAD;
  ------------------
  |  |   40|   174k|#define UP_LOAD (2 * LH_LOAD_MULT) /* load times 256 (default 2) */
  |  |  ------------------
  |  |  |  |   92|   174k|#define LH_LOAD_MULT 256
  |  |  ------------------
  ------------------
   77|   174k|    ret->down_load = DOWN_LOAD;
  ------------------
  |  |   41|   174k|#define DOWN_LOAD (LH_LOAD_MULT) /* load times 256 (default 1) */
  |  |  ------------------
  |  |  |  |   92|   174k|#define LH_LOAD_MULT 256
  |  |  ------------------
  ------------------
   78|   174k|    return ret;
   79|       |
   80|      0|err:
   81|      0|    OPENSSL_free(ret->b);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   82|      0|    OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   83|       |    return NULL;
   84|   174k|}
OPENSSL_LH_free:
   87|   174k|{
   88|   174k|    if (lh == NULL)
  ------------------
  |  Branch (88:9): [True: 1, False: 174k]
  ------------------
   89|      1|        return;
   90|       |
   91|   174k|    OPENSSL_LH_flush(lh);
   92|   174k|    OPENSSL_free(lh->b);
  ------------------
  |  |  131|   174k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|   174k|    OPENSSL_free(lh);
  ------------------
  |  |  131|   174k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|   174k|}
OPENSSL_LH_flush:
   97|   177k|{
   98|   177k|    unsigned int i;
   99|   177k|    OPENSSL_LH_NODE *n, *nn;
  100|       |
  101|   177k|    if (lh == NULL)
  ------------------
  |  Branch (101:9): [True: 0, False: 177k]
  ------------------
  102|      0|        return;
  103|       |
  104|  1.59M|    for (i = 0; i < lh->num_nodes; i++) {
  ------------------
  |  Branch (104:17): [True: 1.41M, False: 177k]
  ------------------
  105|  1.41M|        n = lh->b[i];
  106|  1.45M|        while (n != NULL) {
  ------------------
  |  Branch (106:16): [True: 39.4k, False: 1.41M]
  ------------------
  107|  39.4k|            nn = n->next;
  108|  39.4k|            OPENSSL_free(n);
  ------------------
  |  |  131|  39.4k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  109|  39.4k|            n = nn;
  110|  39.4k|        }
  111|  1.41M|        lh->b[i] = NULL;
  112|  1.41M|    }
  113|       |
  114|   177k|    lh->num_items = 0;
  115|   177k|}
OPENSSL_LH_insert:
  118|  42.8k|{
  119|  42.8k|    unsigned long hash;
  120|  42.8k|    OPENSSL_LH_NODE *nn, **rn;
  121|  42.8k|    void *ret;
  122|       |
  123|  42.8k|    lh->error = 0;
  124|  42.8k|    if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))
  ------------------
  |  |   92|  42.8k|#define LH_LOAD_MULT 256
  ------------------
  |  Branch (124:9): [True: 1.34k, False: 41.5k]
  |  Branch (124:76): [True: 0, False: 1.34k]
  ------------------
  125|      0|        return NULL; /* 'lh->error++' already done in 'expand' */
  126|       |
  127|  42.8k|    rn = getrn(lh, data, &hash);
  128|       |
  129|  42.8k|    if (*rn == NULL) {
  ------------------
  |  Branch (129:9): [True: 39.7k, False: 3.13k]
  ------------------
  130|  39.7k|        if ((nn = OPENSSL_malloc(sizeof(*nn))) == NULL) {
  ------------------
  |  |  106|  39.7k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (130:13): [True: 0, False: 39.7k]
  ------------------
  131|      0|            lh->error++;
  132|      0|            return NULL;
  133|      0|        }
  134|  39.7k|        nn->data = data;
  135|  39.7k|        nn->next = NULL;
  136|  39.7k|        nn->hash = hash;
  137|  39.7k|        *rn = nn;
  138|  39.7k|        ret = NULL;
  139|  39.7k|        lh->num_items++;
  140|  39.7k|    } else { /* replace same key */
  141|  3.13k|        ret = (*rn)->data;
  142|  3.13k|        (*rn)->data = data;
  143|  3.13k|    }
  144|  42.8k|    return ret;
  145|  42.8k|}
OPENSSL_LH_delete:
  148|    242|{
  149|    242|    unsigned long hash;
  150|    242|    OPENSSL_LH_NODE *nn, **rn;
  151|    242|    void *ret;
  152|       |
  153|    242|    lh->error = 0;
  154|    242|    rn = getrn(lh, data, &hash);
  155|       |
  156|    242|    if (*rn == NULL) {
  ------------------
  |  Branch (156:9): [True: 0, False: 242]
  ------------------
  157|      0|        return NULL;
  158|    242|    } else {
  159|    242|        nn = *rn;
  160|    242|        *rn = nn->next;
  161|    242|        ret = nn->data;
  162|    242|        OPENSSL_free(nn);
  ------------------
  |  |  131|    242|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|    242|    }
  164|       |
  165|    242|    lh->num_items--;
  166|    242|    if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
  ------------------
  |  |   39|    242|#define MIN_NODES 16
  ------------------
                  if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
  ------------------
  |  |   92|    242|#define LH_LOAD_MULT 256
  ------------------
  |  Branch (166:9): [True: 242, False: 0]
  |  Branch (166:40): [True: 1, False: 241]
  ------------------
  167|      1|        contract(lh);
  168|       |
  169|    242|    return ret;
  170|    242|}
OPENSSL_LH_retrieve:
  173|  2.71M|{
  174|  2.71M|    unsigned long hash;
  175|  2.71M|    OPENSSL_LH_NODE **rn;
  176|       |
  177|  2.71M|    if (lh->error != 0)
  ------------------
  |  Branch (177:9): [True: 0, False: 2.71M]
  ------------------
  178|      0|        lh->error = 0;
  179|       |
  180|  2.71M|    rn = getrn(lh, data, &hash);
  181|       |
  182|  2.71M|    return *rn == NULL ? NULL : (*rn)->data;
  ------------------
  |  Branch (182:12): [True: 819k, False: 1.89M]
  ------------------
  183|  2.71M|}
OPENSSL_LH_doall:
  216|   174k|{
  217|   174k|    if (lh == NULL)
  ------------------
  |  Branch (217:9): [True: 0, False: 174k]
  ------------------
  218|      0|        return;
  219|       |
  220|   174k|    doall_util_fn(lh, 0, lh->daw, func, (OPENSSL_LH_DOALL_FUNCARG)NULL,
  221|   174k|        (OPENSSL_LH_DOALL_FUNCARG_THUNK)NULL, NULL);
  222|   174k|}
OPENSSL_LH_doall_arg_thunk:
  237|  1.26k|{
  238|  1.26k|    doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC_THUNK)NULL,
  239|       |        (OPENSSL_LH_DOALL_FUNC)NULL, fn, daaw, arg);
  240|  1.26k|}
OPENSSL_LH_strhash:
  360|  1.29M|{
  361|  1.29M|    unsigned long ret = 0;
  362|  1.29M|    long n;
  363|  1.29M|    unsigned long v;
  364|  1.29M|    int r;
  365|       |
  366|  1.29M|    if ((c == NULL) || (*c == '\0'))
  ------------------
  |  Branch (366:9): [True: 0, False: 1.29M]
  |  Branch (366:24): [True: 609k, False: 686k]
  ------------------
  367|   609k|        return ret;
  368|       |
  369|   686k|    n = 0x100;
  370|  19.9M|    while (*c) {
  ------------------
  |  Branch (370:12): [True: 19.2M, False: 686k]
  ------------------
  371|  19.2M|        v = n | (*c);
  372|  19.2M|        n += 0x100;
  373|  19.2M|        r = (int)((v >> 2) ^ v) & 0x0f;
  374|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  375|  19.2M|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  376|  19.2M|        ret &= 0xFFFFFFFFL;
  377|  19.2M|        ret ^= v * v;
  378|  19.2M|        c++;
  379|  19.2M|    }
  380|   686k|    return (ret >> 16) ^ ret;
  381|  1.29M|}
ossl_lh_strcasehash:
  398|  1.92M|{
  399|  1.92M|    unsigned long ret = 0;
  400|  1.92M|    long n;
  401|  1.92M|    unsigned long v;
  402|  1.92M|    int r;
  403|       |#if defined(CHARSET_EBCDIC) && !defined(CHARSET_EBCDIC_TEST)
  404|       |    const long int case_adjust = ~0x40;
  405|       |#else
  406|  1.92M|    const long int case_adjust = ~0x20;
  407|  1.92M|#endif
  408|       |
  409|  1.92M|    if (c == NULL || *c == '\0')
  ------------------
  |  Branch (409:9): [True: 0, False: 1.92M]
  |  Branch (409:22): [True: 0, False: 1.92M]
  ------------------
  410|      0|        return ret;
  411|       |
  412|  23.7M|    for (n = 0x100; *c != '\0'; n += 0x100) {
  ------------------
  |  Branch (412:21): [True: 21.8M, False: 1.92M]
  ------------------
  413|  21.8M|        v = n | (case_adjust & *c);
  414|  21.8M|        r = (int)((v >> 2) ^ v) & 0x0f;
  415|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  416|  21.8M|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  417|  21.8M|        ret &= 0xFFFFFFFFL;
  418|  21.8M|        ret ^= v * v;
  419|  21.8M|        c++;
  420|  21.8M|    }
  421|  1.92M|    return (ret >> 16) ^ ret;
  422|  1.92M|}
OPENSSL_LH_num_items:
  425|  1.10k|{
  426|  1.10k|    return lh ? lh->num_items : 0;
  ------------------
  |  Branch (426:12): [True: 1.10k, False: 0]
  ------------------
  427|  1.10k|}
OPENSSL_LH_get_down_load:
  430|  2.56k|{
  431|  2.56k|    return lh->down_load;
  432|  2.56k|}
OPENSSL_LH_set_down_load:
  435|  5.13k|{
  436|  5.13k|    lh->down_load = down_load;
  437|  5.13k|}
OPENSSL_LH_error:
  440|  37.8k|{
  441|  37.8k|    return lh->error;
  442|  37.8k|}
lhash.c:doall_util_fn:
  191|   175k|{
  192|   175k|    int i;
  193|   175k|    OPENSSL_LH_NODE *a, *n;
  194|       |
  195|   175k|    if (lh == NULL)
  ------------------
  |  Branch (195:9): [True: 0, False: 175k]
  ------------------
  196|      0|        return;
  197|       |
  198|       |    /*
  199|       |     * reverse the order so we search from 'top to bottom' We were having
  200|       |     * memory leaks otherwise
  201|       |     */
  202|  1.72M|    for (i = lh->num_nodes - 1; i >= 0; i--) {
  ------------------
  |  Branch (202:33): [True: 1.55M, False: 175k]
  ------------------
  203|  1.55M|        a = lh->b[i];
  204|  1.89M|        while (a != NULL) {
  ------------------
  |  Branch (204:16): [True: 344k, False: 1.55M]
  ------------------
  205|   344k|            n = a->next;
  206|   344k|            if (use_arg)
  ------------------
  |  Branch (206:17): [True: 305k, False: 38.1k]
  ------------------
  207|   305k|                wfunc_arg(a->data, arg, func_arg);
  208|  38.1k|            else
  209|  38.1k|                wfunc(a->data, func);
  210|   344k|            a = n;
  211|   344k|        }
  212|  1.55M|    }
  213|   175k|}
lhash.c:expand:
  243|  1.34k|{
  244|  1.34k|    OPENSSL_LH_NODE **n, **n1, **n2, *np;
  245|  1.34k|    unsigned int p, pmax, nni, j;
  246|  1.34k|    unsigned long hash;
  247|       |
  248|  1.34k|    nni = lh->num_alloc_nodes;
  249|  1.34k|    p = lh->p;
  250|  1.34k|    pmax = lh->pmax;
  251|  1.34k|    if (p + 1 >= pmax) {
  ------------------
  |  Branch (251:9): [True: 22, False: 1.32k]
  ------------------
  252|     22|        j = nni * 2;
  253|     22|        n = OPENSSL_realloc_array(lh->b, j, sizeof(OPENSSL_LH_NODE *));
  ------------------
  |  |  124|     22|    CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  254|     22|        if (n == NULL) {
  ------------------
  |  Branch (254:13): [True: 0, False: 22]
  ------------------
  255|      0|            lh->error++;
  256|      0|            return 0;
  257|      0|        }
  258|     22|        lh->b = n;
  259|     22|        memset(n + nni, 0, sizeof(*n) * (j - nni));
  260|     22|        lh->pmax = nni;
  261|     22|        lh->num_alloc_nodes = j;
  262|     22|        lh->p = 0;
  263|  1.32k|    } else {
  264|  1.32k|        lh->p++;
  265|  1.32k|    }
  266|       |
  267|  1.34k|    lh->num_nodes++;
  268|  1.34k|    n1 = &(lh->b[p]);
  269|  1.34k|    n2 = &(lh->b[p + pmax]);
  270|  1.34k|    *n2 = NULL;
  271|       |
  272|  5.23k|    for (np = *n1; np != NULL;) {
  ------------------
  |  Branch (272:20): [True: 3.89k, False: 1.34k]
  ------------------
  273|  3.89k|        hash = np->hash;
  274|  3.89k|        if ((hash % nni) != p) { /* move it */
  ------------------
  |  Branch (274:13): [True: 1.05k, False: 2.83k]
  ------------------
  275|  1.05k|            *n1 = (*n1)->next;
  276|  1.05k|            np->next = *n2;
  277|  1.05k|            *n2 = np;
  278|  1.05k|        } else
  279|  2.83k|            n1 = &((*n1)->next);
  280|  3.89k|        np = *n1;
  281|  3.89k|    }
  282|       |
  283|  1.34k|    return 1;
  284|  1.34k|}
lhash.c:contract:
  287|      1|{
  288|      1|    OPENSSL_LH_NODE **n, *n1, *np;
  289|       |
  290|      1|    np = lh->b[lh->p + lh->pmax - 1];
  291|      1|    lh->b[lh->p + lh->pmax - 1] = NULL; /* 24/07-92 - eay - weird but :-( */
  292|      1|    if (lh->p == 0) {
  ------------------
  |  Branch (292:9): [True: 0, False: 1]
  ------------------
  293|      0|        n = OPENSSL_realloc_array(lh->b, lh->pmax, sizeof(OPENSSL_LH_NODE *));
  ------------------
  |  |  124|      0|    CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  294|      0|        if (n == NULL) {
  ------------------
  |  Branch (294:13): [True: 0, False: 0]
  ------------------
  295|       |            /* fputs("realloc error in lhash", stderr); */
  296|      0|            lh->error++;
  297|      0|        } else {
  298|      0|            lh->b = n;
  299|      0|        }
  300|      0|        lh->num_alloc_nodes /= 2;
  301|      0|        lh->pmax /= 2;
  302|      0|        lh->p = lh->pmax - 1;
  303|      0|    } else
  304|      1|        lh->p--;
  305|       |
  306|      1|    lh->num_nodes--;
  307|       |
  308|      1|    n1 = lh->b[(int)lh->p];
  309|      1|    if (n1 == NULL)
  ------------------
  |  Branch (309:9): [True: 1, False: 0]
  ------------------
  310|      1|        lh->b[(int)lh->p] = np;
  311|      0|    else {
  312|      0|        while (n1->next != NULL)
  ------------------
  |  Branch (312:16): [True: 0, False: 0]
  ------------------
  313|      0|            n1 = n1->next;
  314|      0|        n1->next = np;
  315|      0|    }
  316|      1|}
lhash.c:getrn:
  320|  2.76M|{
  321|  2.76M|    OPENSSL_LH_NODE **ret, *n1;
  322|  2.76M|    unsigned long hash, nn;
  323|       |
  324|  2.76M|    if (lh->hashw != NULL)
  ------------------
  |  Branch (324:9): [True: 2.76M, False: 0]
  ------------------
  325|  2.76M|        hash = lh->hashw(data, lh->hash);
  326|      0|    else
  327|      0|        hash = lh->hash(data);
  328|       |
  329|  2.76M|    *rhash = hash;
  330|       |
  331|  2.76M|    nn = hash % lh->pmax;
  332|  2.76M|    if (nn < lh->p)
  ------------------
  |  Branch (332:9): [True: 707k, False: 2.05M]
  ------------------
  333|   707k|        nn = hash % lh->num_alloc_nodes;
  334|       |
  335|  2.76M|    ret = &(lh->b[(int)nn]);
  336|  4.05M|    for (n1 = *ret; n1 != NULL; n1 = n1->next) {
  ------------------
  |  Branch (336:21): [True: 3.19M, False: 858k]
  ------------------
  337|  3.19M|        if (n1->hash != hash) {
  ------------------
  |  Branch (337:13): [True: 1.29M, False: 1.90M]
  ------------------
  338|  1.29M|            ret = &(n1->next);
  339|  1.29M|            continue;
  340|  1.29M|        }
  341|       |
  342|  1.90M|        if (lh->compw != NULL) {
  ------------------
  |  Branch (342:13): [True: 1.90M, False: 0]
  ------------------
  343|  1.90M|            if (lh->compw(n1->data, data, lh->comp) == 0)
  ------------------
  |  Branch (343:17): [True: 1.90M, False: 422]
  ------------------
  344|  1.90M|                break;
  345|  1.90M|        } else {
  346|      0|            if (lh->comp(n1->data, data) == 0)
  ------------------
  |  Branch (346:17): [True: 0, False: 0]
  ------------------
  347|      0|                break;
  348|      0|        }
  349|    422|        ret = &(n1->next);
  350|    422|    }
  351|  2.76M|    return ret;
  352|  2.76M|}

CRYPTO_malloc:
  190|   114M|{
  191|   114M|    void *ptr;
  192|       |
  193|   114M|    INCREMENT(malloc_count);
  194|   114M|    if (malloc_impl != CRYPTO_malloc) {
  ------------------
  |  Branch (194:9): [True: 0, False: 114M]
  ------------------
  195|      0|        ptr = malloc_impl(num, file, line);
  196|      0|        if (ptr != NULL || num == 0)
  ------------------
  |  Branch (196:13): [True: 0, False: 0]
  |  Branch (196:28): [True: 0, False: 0]
  ------------------
  197|      0|            return ptr;
  198|      0|        goto err;
  199|      0|    }
  200|       |
  201|   114M|    if (ossl_unlikely(num == 0))
  ------------------
  |  |   23|   114M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 114M]
  |  |  ------------------
  ------------------
  202|      0|        return NULL;
  203|       |
  204|   114M|    FAILTEST();
  205|   114M|    if (allow_customize) {
  ------------------
  |  Branch (205:9): [True: 1, False: 114M]
  ------------------
  206|       |        /*
  207|       |         * Disallow customization after the first allocation. We only set this
  208|       |         * if necessary to avoid a store to the same cache line on every
  209|       |         * allocation.
  210|       |         */
  211|      1|        allow_customize = 0;
  212|      1|    }
  213|       |
  214|   114M|    ptr = malloc(num);
  215|   114M|    if (ossl_likely(ptr != NULL))
  ------------------
  |  |   22|   114M|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 114M, False: 0]
  |  |  ------------------
  ------------------
  216|   114M|        return ptr;
  217|      0|err:
  218|      0|    ossl_report_alloc_err(file, line);
  219|       |    return NULL;
  220|   114M|}
CRYPTO_zalloc:
  223|  80.0M|{
  224|  80.0M|    void *ret;
  225|       |
  226|  80.0M|    ret = CRYPTO_malloc(num, file, line);
  227|  80.0M|    if (ret != NULL)
  ------------------
  |  Branch (227:9): [True: 80.0M, False: 0]
  ------------------
  228|  80.0M|        memset(ret, 0, num);
  229|       |
  230|  80.0M|    return ret;
  231|  80.0M|}
CRYPTO_aligned_alloc:
  235|  1.57k|{
  236|  1.57k|    size_t alloc_bytes;
  237|  1.57k|    void *ret;
  238|       |
  239|  1.57k|    *freeptr = NULL;
  240|       |
  241|       |#if defined(OPENSSL_SMALL_FOOTPRINT)
  242|       |    return NULL;
  243|       |#endif
  244|       |
  245|       |    /* Ensure that alignment is a power of two */
  246|  1.57k|    if (alignment == 0 || (alignment & (alignment - 1)) != 0) {
  ------------------
  |  Branch (246:9): [True: 0, False: 1.57k]
  |  Branch (246:27): [True: 0, False: 1.57k]
  ------------------
  247|      0|        ossl_report_alloc_err_inv(file, line);
  248|      0|        return NULL;
  249|      0|    }
  250|       |
  251|       |    /* Allow non-malloc() allocations as long as no malloc_impl is provided. */
  252|  1.57k|    if (malloc_impl == CRYPTO_malloc) {
  ------------------
  |  Branch (252:9): [True: 1.57k, False: 0]
  ------------------
  253|  1.57k|#if defined(_BSD_SOURCE) || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L)
  254|  1.57k|        int memalign_ret;
  255|       |
  256|       |        /* posix_memalign() requires alignment to be at least sizeof(void *) */
  257|  1.57k|        if (alignment < sizeof(void *))
  ------------------
  |  Branch (257:13): [True: 0, False: 1.57k]
  ------------------
  258|      0|            alignment = sizeof(void *);
  259|       |
  260|  1.57k|        if ((memalign_ret = posix_memalign(&ret, alignment, num))) {
  ------------------
  |  Branch (260:13): [True: 0, False: 1.57k]
  ------------------
  261|      0|            ret = NULL;
  262|      0|            switch (memalign_ret) {
  ------------------
  |  Branch (262:21): [True: 0, False: 0]
  ------------------
  263|      0|            case EINVAL:
  ------------------
  |  Branch (263:13): [True: 0, False: 0]
  ------------------
  264|      0|                ossl_report_alloc_err_inv(file, line);
  265|      0|                break;
  266|      0|            case ENOMEM:
  ------------------
  |  Branch (266:13): [True: 0, False: 0]
  ------------------
  267|      0|                ossl_report_alloc_err(file, line);
  268|      0|                break;
  269|      0|            }
  270|      0|        }
  271|  1.57k|        *freeptr = ret;
  272|  1.57k|        return ret;
  273|  1.57k|#endif
  274|  1.57k|    }
  275|       |
  276|       |    /* we have to do this the hard way */
  277|       |
  278|       |    /*
  279|       |     * Note: Windows supports an _aligned_malloc call, but we choose
  280|       |     * not to use it here, because allocations from that function
  281|       |     * require that they be freed via _aligned_free.  Given that
  282|       |     * we can't differentiate plain malloc blocks from blocks obtained
  283|       |     * via _aligned_malloc, just avoid its use entirely
  284|       |     */
  285|       |
  286|      0|    if (ossl_unlikely(!ossl_size_add(num, alignment, &alloc_bytes, file, line)))
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  287|      0|        return NULL;
  288|       |
  289|       |    /*
  290|       |     * Step 1: Allocate an amount of memory that is <alignment>
  291|       |     * bytes bigger than requested
  292|       |     */
  293|      0|    *freeptr = CRYPTO_malloc(alloc_bytes, file, line);
  294|      0|    if (*freeptr == NULL)
  ------------------
  |  Branch (294:9): [True: 0, False: 0]
  ------------------
  295|      0|        return NULL;
  296|       |
  297|       |    /*
  298|       |     * Step 2: Add <alignment - 1> bytes to the pointer
  299|       |     * This will cross the alignment boundary that is
  300|       |     * requested
  301|       |     */
  302|      0|    ret = (void *)((char *)*freeptr + (alignment - 1));
  303|       |
  304|       |    /*
  305|       |     * Step 3: Use the alignment as a mask to translate the
  306|       |     * least significant bits of the allocation at the alignment
  307|       |     * boundary to 0.  ret now holds a pointer to the memory
  308|       |     * buffer at the requested alignment
  309|       |     * NOTE: It is a documented requirement that alignment be a
  310|       |     * power of 2, which is what allows this to work
  311|       |     */
  312|      0|    ret = (void *)((uintptr_t)ret & (uintptr_t)(~(alignment - 1)));
  313|      0|    return ret;
  314|      0|}
CRYPTO_realloc:
  317|  8.91M|{
  318|  8.91M|    void *ret;
  319|       |
  320|  8.91M|    INCREMENT(realloc_count);
  321|  8.91M|    if (realloc_impl != CRYPTO_realloc) {
  ------------------
  |  Branch (321:9): [True: 0, False: 8.91M]
  ------------------
  322|      0|        ret = realloc_impl(str, num, file, line);
  323|       |
  324|      0|        if (num == 0 || ret != NULL)
  ------------------
  |  Branch (324:13): [True: 0, False: 0]
  |  Branch (324:25): [True: 0, False: 0]
  ------------------
  325|      0|            return ret;
  326|       |
  327|      0|        goto err;
  328|      0|    }
  329|       |
  330|  8.91M|    if (str == NULL)
  ------------------
  |  Branch (330:9): [True: 8.12M, False: 781k]
  ------------------
  331|  8.12M|        return CRYPTO_malloc(num, file, line);
  332|       |
  333|   781k|    if (num == 0) {
  ------------------
  |  Branch (333:9): [True: 0, False: 781k]
  ------------------
  334|      0|        CRYPTO_free(str, file, line);
  335|      0|        return NULL;
  336|      0|    }
  337|       |
  338|   781k|    FAILTEST();
  339|   781k|    ret = realloc(str, num);
  340|       |
  341|   781k|err:
  342|   781k|    if (num != 0 && ret == NULL)
  ------------------
  |  Branch (342:9): [True: 781k, False: 0]
  |  Branch (342:21): [True: 0, False: 781k]
  ------------------
  343|      0|        ossl_report_alloc_err(file, line);
  344|       |
  345|   781k|    return ret;
  346|   781k|}
CRYPTO_clear_realloc:
  350|  4.89M|{
  351|  4.89M|    void *ret = NULL;
  352|       |
  353|  4.89M|    if (str == NULL)
  ------------------
  |  Branch (353:9): [True: 1.23M, False: 3.65M]
  ------------------
  354|  1.23M|        return CRYPTO_malloc(num, file, line);
  355|       |
  356|  3.65M|    if (num == 0) {
  ------------------
  |  Branch (356:9): [True: 0, False: 3.65M]
  ------------------
  357|      0|        CRYPTO_clear_free(str, old_len, file, line);
  358|      0|        return NULL;
  359|      0|    }
  360|       |
  361|       |    /* Can't shrink the buffer since memcpy below copies |old_len| bytes. */
  362|  3.65M|    if (num < old_len) {
  ------------------
  |  Branch (362:9): [True: 0, False: 3.65M]
  ------------------
  363|      0|        OPENSSL_cleanse((char *)str + num, old_len - num);
  364|      0|        return str;
  365|      0|    }
  366|       |
  367|  3.65M|    ret = CRYPTO_malloc(num, file, line);
  368|  3.65M|    if (ret != NULL) {
  ------------------
  |  Branch (368:9): [True: 3.65M, False: 0]
  ------------------
  369|  3.65M|        memcpy(ret, str, old_len);
  370|  3.65M|        CRYPTO_clear_free(str, old_len, file, line);
  371|  3.65M|    }
  372|  3.65M|    return ret;
  373|  3.65M|}
CRYPTO_free:
  376|   149M|{
  377|   149M|    INCREMENT(free_count);
  378|   149M|    if (free_impl != CRYPTO_free) {
  ------------------
  |  Branch (378:9): [True: 0, False: 149M]
  ------------------
  379|      0|        free_impl(str, file, line);
  380|      0|        return;
  381|      0|    }
  382|       |
  383|   149M|    free(str);
  384|   149M|}
CRYPTO_clear_free:
  387|  11.1M|{
  388|  11.1M|    if (str == NULL)
  ------------------
  |  Branch (388:9): [True: 845k, False: 10.3M]
  ------------------
  389|   845k|        return;
  390|  10.3M|    if (num)
  ------------------
  |  Branch (390:9): [True: 10.3M, False: 0]
  ------------------
  391|  10.3M|        OPENSSL_cleanse(str, num);
  392|  10.3M|    CRYPTO_free(str, file, line);
  393|  10.3M|}

CRYPTO_secure_malloc_done:
  131|      1|{
  132|      1|#ifndef OPENSSL_NO_SECURE_MEMORY
  133|      1|    if (secure_mem_used == 0) {
  ------------------
  |  Branch (133:9): [True: 1, False: 0]
  ------------------
  134|      1|        sh_done();
  135|      1|        secure_mem_initialized = 0;
  136|      1|        CRYPTO_THREAD_lock_free(sec_malloc_lock);
  137|      1|        sec_malloc_lock = NULL;
  138|      1|        return 1;
  139|      1|    }
  140|      0|#endif /* OPENSSL_NO_SECURE_MEMORY */
  141|      0|    return 0;
  142|      1|}
CRYPTO_secure_malloc:
  154|  3.52k|{
  155|  3.52k|#ifndef OPENSSL_NO_SECURE_MEMORY
  156|  3.52k|    void *ret = NULL;
  157|  3.52k|    size_t actual_size;
  158|  3.52k|    int reason = CRYPTO_R_SECURE_MALLOC_FAILURE;
  ------------------
  |  |   45|  3.52k|#define CRYPTO_R_SECURE_MALLOC_FAILURE 111
  ------------------
  159|       |
  160|  3.52k|    if (!secure_mem_initialized) {
  ------------------
  |  Branch (160:9): [True: 3.52k, False: 0]
  ------------------
  161|  3.52k|        return CRYPTO_malloc(num, file, line);
  162|  3.52k|    }
  163|      0|    if (!CRYPTO_THREAD_write_lock(sec_malloc_lock)) {
  ------------------
  |  Branch (163:9): [True: 0, False: 0]
  ------------------
  164|      0|        reason = ERR_R_CRYPTO_LIB;
  ------------------
  |  |  328|      0|#define ERR_R_CRYPTO_LIB (ERR_LIB_CRYPTO /* 15 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |   87|      0|#define ERR_LIB_CRYPTO 15
  |  |  ------------------
  |  |               #define ERR_R_CRYPTO_LIB (ERR_LIB_CRYPTO /* 15 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  165|      0|        goto err;
  166|      0|    }
  167|      0|    ret = sh_malloc(num);
  168|      0|    actual_size = ret ? sh_actual_size(ret) : 0;
  ------------------
  |  Branch (168:19): [True: 0, False: 0]
  ------------------
  169|      0|    secure_mem_used += actual_size;
  170|      0|    CRYPTO_THREAD_unlock(sec_malloc_lock);
  171|      0|err:
  172|      0|    if (ret == NULL && (file != NULL || line != 0)) {
  ------------------
  |  Branch (172:9): [True: 0, False: 0]
  |  Branch (172:25): [True: 0, False: 0]
  |  Branch (172:41): [True: 0, False: 0]
  ------------------
  173|      0|        ERR_new();
  174|      0|        ERR_set_debug(file, line, NULL);
  175|      0|        ERR_set_error(ERR_LIB_CRYPTO, reason, NULL);
  ------------------
  |  |   87|      0|#define ERR_LIB_CRYPTO 15
  ------------------
  176|      0|    }
  177|      0|    return ret;
  178|       |#else
  179|       |    return CRYPTO_malloc(num, file, line);
  180|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  181|      0|}
CRYPTO_secure_zalloc:
  184|  13.0k|{
  185|  13.0k|#ifndef OPENSSL_NO_SECURE_MEMORY
  186|  13.0k|    if (secure_mem_initialized)
  ------------------
  |  Branch (186:9): [True: 0, False: 13.0k]
  ------------------
  187|       |        /* CRYPTO_secure_malloc() zeroes allocations when it is implemented */
  188|      0|        return CRYPTO_secure_malloc(num, file, line);
  189|  13.0k|#endif
  190|  13.0k|    return CRYPTO_zalloc(num, file, line);
  191|  13.0k|}
CRYPTO_secure_free:
  194|  2.56k|{
  195|  2.56k|#ifndef OPENSSL_NO_SECURE_MEMORY
  196|  2.56k|    size_t actual_size;
  197|       |
  198|  2.56k|    if (ptr == NULL)
  ------------------
  |  Branch (198:9): [True: 83, False: 2.47k]
  ------------------
  199|     83|        return;
  200|  2.47k|    if (!CRYPTO_secure_allocated(ptr)) {
  ------------------
  |  Branch (200:9): [True: 2.47k, False: 0]
  ------------------
  201|  2.47k|        CRYPTO_free(ptr, file, line);
  202|  2.47k|        return;
  203|  2.47k|    }
  204|      0|    if (!CRYPTO_THREAD_write_lock(sec_malloc_lock))
  ------------------
  |  Branch (204:9): [True: 0, False: 0]
  ------------------
  205|      0|        return;
  206|      0|    actual_size = sh_actual_size(ptr);
  207|      0|    CLEAR(ptr, actual_size);
  ------------------
  |  |   81|      0|#define CLEAR(p, s) OPENSSL_cleanse(p, s)
  ------------------
  208|      0|    secure_mem_used -= actual_size;
  209|      0|    sh_free(ptr);
  210|      0|    CRYPTO_THREAD_unlock(sec_malloc_lock);
  211|       |#else
  212|       |    CRYPTO_free(ptr, file, line);
  213|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  214|      0|}
CRYPTO_secure_clear_free:
  218|  20.1k|{
  219|  20.1k|#ifndef OPENSSL_NO_SECURE_MEMORY
  220|  20.1k|    size_t actual_size;
  221|       |
  222|  20.1k|    if (ptr == NULL)
  ------------------
  |  Branch (222:9): [True: 6.08k, False: 14.0k]
  ------------------
  223|  6.08k|        return;
  224|  14.0k|    if (!CRYPTO_secure_allocated(ptr)) {
  ------------------
  |  Branch (224:9): [True: 14.0k, False: 0]
  ------------------
  225|  14.0k|        OPENSSL_cleanse(ptr, num);
  226|  14.0k|        CRYPTO_free(ptr, file, line);
  227|  14.0k|        return;
  228|  14.0k|    }
  229|      0|    if (!CRYPTO_THREAD_write_lock(sec_malloc_lock))
  ------------------
  |  Branch (229:9): [True: 0, False: 0]
  ------------------
  230|      0|        return;
  231|      0|    actual_size = sh_actual_size(ptr);
  232|      0|    CLEAR(ptr, actual_size);
  ------------------
  |  |   81|      0|#define CLEAR(p, s) OPENSSL_cleanse(p, s)
  ------------------
  233|      0|    secure_mem_used -= actual_size;
  234|      0|    sh_free(ptr);
  235|      0|    CRYPTO_THREAD_unlock(sec_malloc_lock);
  236|       |#else
  237|       |    if (ptr == NULL)
  238|       |        return;
  239|       |    OPENSSL_cleanse(ptr, num);
  240|       |    CRYPTO_free(ptr, file, line);
  241|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  242|      0|}
CRYPTO_secure_allocated:
  245|  19.4k|{
  246|  19.4k|#ifndef OPENSSL_NO_SECURE_MEMORY
  247|  19.4k|    if (!secure_mem_initialized)
  ------------------
  |  Branch (247:9): [True: 19.4k, False: 0]
  ------------------
  248|  19.4k|        return 0;
  249|       |    /*
  250|       |     * Only read accesses to the arena take place in sh_allocated() and this
  251|       |     * is only changed by the sh_init() and sh_done() calls which are not
  252|       |     * locked.  Hence, it is safe to make this check without a lock too.
  253|       |     */
  254|      0|    return sh_allocated(ptr);
  255|       |#else
  256|       |    return 0;
  257|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  258|  19.4k|}
mem_sec.c:sh_done:
  594|      1|{
  595|      1|    OPENSSL_free(sh.freelist);
  ------------------
  |  |  131|      1|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  596|      1|    OPENSSL_free(sh.bittable);
  ------------------
  |  |  131|      1|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  597|      1|    OPENSSL_free(sh.bitmalloc);
  ------------------
  |  |  131|      1|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  598|      1|#if !defined(_WIN32)
  599|      1|    if (sh.map_result != MAP_FAILED && sh.map_size)
  ------------------
  |  Branch (599:9): [True: 1, False: 0]
  |  Branch (599:40): [True: 0, False: 1]
  ------------------
  600|      0|        munmap(sh.map_result, sh.map_size);
  601|       |#else
  602|       |    if (sh.map_result != NULL && sh.map_size)
  603|       |        VirtualFree(sh.map_result, 0, MEM_RELEASE);
  604|       |#endif
  605|      1|    memset(&sh, 0, sizeof(sh));
  606|      1|}

ossl_ml_kem_key_reset:
 1903|  1.32k|{
 1904|       |    /*
 1905|       |     * seedbuf can be allocated and contain |z| and |d| if the key is
 1906|       |     * being created from a private key encoding.  Similarly a pending
 1907|       |     * serialised (encoded) private key may be queued up to load.
 1908|       |     * Clear and free that data now.
 1909|       |     */
 1910|  1.32k|    if (key->seedbuf != NULL)
  ------------------
  |  Branch (1910:9): [True: 0, False: 1.32k]
  ------------------
 1911|      0|        OPENSSL_secure_clear_free(key->seedbuf, ML_KEM_SEED_BYTES);
  ------------------
  |  |  149|      0|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1912|  1.32k|    if (ossl_ml_kem_have_dkenc(key))
  ------------------
  |  |  210|  1.32k|#define ossl_ml_kem_have_dkenc(key) ((key)->encoded_dk != NULL)
  |  |  ------------------
  |  |  |  Branch (210:37): [True: 0, False: 1.32k]
  |  |  ------------------
  ------------------
 1913|      0|        OPENSSL_secure_clear_free(key->encoded_dk, key->vinfo->prvkey_bytes);
  ------------------
  |  |  149|      0|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1914|       |
 1915|       |    /*-
 1916|       |     * Cleanse any sensitive data:
 1917|       |     * - The private vector |s| is immediately followed by the FO failure
 1918|       |     *   secret |z|, and seed |d|, we can cleanse all three in one call.
 1919|       |     */
 1920|  1.32k|    if (key->t != NULL) {
  ------------------
  |  Branch (1920:9): [True: 1.32k, False: 0]
  ------------------
 1921|  1.32k|        if (ossl_ml_kem_have_prvkey(key))
  ------------------
  |  |  208|  1.32k|#define ossl_ml_kem_have_prvkey(key) ((key)->s != NULL)
  |  |  ------------------
  |  |  |  Branch (208:38): [True: 1.32k, False: 0]
  |  |  ------------------
  ------------------
 1922|  1.32k|            OPENSSL_secure_clear_free(key->s, key->vinfo->prvalloc);
  ------------------
  |  |  149|  1.32k|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1923|  1.32k|        OPENSSL_free(key->t);
  ------------------
  |  |  131|  1.32k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1924|  1.32k|    }
 1925|       |    key->d = key->z = key->seedbuf = key->encoded_dk = (uint8_t *)(key->s = key->m = key->t = NULL);
 1926|  1.32k|}
ossl_ml_kem_get_vinfo:
 1937|  2.65k|{
 1938|  2.65k|    switch (evp_type) {
  ------------------
  |  Branch (1938:13): [True: 2.65k, False: 0]
  ------------------
 1939|      0|    case EVP_PKEY_ML_KEM_512:
  ------------------
  |  |   93|      0|#define EVP_PKEY_ML_KEM_512 NID_ML_KEM_512
  |  |  ------------------
  |  |  |  | 6636|      0|#define NID_ML_KEM_512          1454
  |  |  ------------------
  ------------------
  |  Branch (1939:5): [True: 0, False: 2.65k]
  ------------------
 1940|      0|        return &vinfo_map[ML_KEM_512_VINFO];
  ------------------
  |  |  177|      0|#define ML_KEM_512_VINFO 0
  ------------------
 1941|  2.65k|    case EVP_PKEY_ML_KEM_768:
  ------------------
  |  |  103|  2.65k|#define EVP_PKEY_ML_KEM_768 NID_ML_KEM_768
  |  |  ------------------
  |  |  |  | 6641|  2.65k|#define NID_ML_KEM_768          1455
  |  |  ------------------
  ------------------
  |  Branch (1941:5): [True: 2.65k, False: 0]
  ------------------
 1942|  2.65k|        return &vinfo_map[ML_KEM_768_VINFO];
  ------------------
  |  |  178|  2.65k|#define ML_KEM_768_VINFO 1
  ------------------
 1943|      0|    case EVP_PKEY_ML_KEM_1024:
  ------------------
  |  |  113|      0|#define EVP_PKEY_ML_KEM_1024 NID_ML_KEM_1024
  |  |  ------------------
  |  |  |  | 6646|      0|#define NID_ML_KEM_1024         1456
  |  |  ------------------
  ------------------
  |  Branch (1943:5): [True: 0, False: 2.65k]
  ------------------
 1944|      0|        return &vinfo_map[ML_KEM_1024_VINFO];
  ------------------
  |  |  179|      0|#define ML_KEM_1024_VINFO 2
  ------------------
 1945|  2.65k|    }
 1946|      0|    return NULL;
 1947|  2.65k|}
ossl_ml_kem_key_new:
 1951|  1.32k|{
 1952|  1.32k|    const ML_KEM_VINFO *vinfo = ossl_ml_kem_get_vinfo(evp_type);
 1953|  1.32k|    ML_KEM_KEY *key;
 1954|       |
 1955|  1.32k|    if (vinfo == NULL) {
  ------------------
  |  Branch (1955:9): [True: 0, False: 1.32k]
  ------------------
 1956|      0|        ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |   87|      0|#define ERR_LIB_CRYPTO 15
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  358|      0|#define ERR_R_PASSED_INVALID_ARGUMENT (262 | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1957|      0|            "unsupported ML-KEM key type: %d", evp_type);
 1958|      0|        return NULL;
 1959|      0|    }
 1960|       |
 1961|  1.32k|    if ((key = OPENSSL_malloc(sizeof(*key))) == NULL)
  ------------------
  |  |  106|  1.32k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (1961:9): [True: 0, False: 1.32k]
  ------------------
 1962|      0|        return NULL;
 1963|       |
 1964|  1.32k|    key->vinfo = vinfo;
 1965|  1.32k|    key->libctx = libctx;
 1966|  1.32k|    key->prov_flags = ML_KEM_KEY_PROV_FLAGS_DEFAULT;
  ------------------
  |  |  132|  1.32k|    (ML_KEM_KEY_RANDOM_PCT | ML_KEM_KEY_PREFER_SEED | ML_KEM_KEY_RETAIN_SEED)
  |  |  ------------------
  |  |  |  |  123|  1.32k|#define ML_KEM_KEY_RANDOM_PCT (1 << 0)
  |  |  ------------------
  |  |                   (ML_KEM_KEY_RANDOM_PCT | ML_KEM_KEY_PREFER_SEED | ML_KEM_KEY_RETAIN_SEED)
  |  |  ------------------
  |  |  |  |  125|  1.32k|#define ML_KEM_KEY_PREFER_SEED (1 << 2)
  |  |  ------------------
  |  |                   (ML_KEM_KEY_RANDOM_PCT | ML_KEM_KEY_PREFER_SEED | ML_KEM_KEY_RETAIN_SEED)
  |  |  ------------------
  |  |  |  |  126|  1.32k|#define ML_KEM_KEY_RETAIN_SEED (1 << 3)
  |  |  ------------------
  ------------------
 1967|  1.32k|    key->shake128_md = EVP_MD_fetch(libctx, "SHAKE128", properties);
 1968|  1.32k|    key->shake256_md = EVP_MD_fetch(libctx, "SHAKE256", properties);
 1969|  1.32k|    key->sha3_256_md = EVP_MD_fetch(libctx, "SHA3-256", properties);
 1970|  1.32k|    key->sha3_512_md = EVP_MD_fetch(libctx, "SHA3-512", properties);
 1971|  1.32k|    key->d = key->z = key->rho = key->pkhash = key->encoded_dk = key->seedbuf = NULL;
 1972|  1.32k|    key->s = key->m = key->t = NULL;
 1973|       |
 1974|  1.32k|    if (key->shake128_md != NULL
  ------------------
  |  Branch (1974:9): [True: 1.32k, False: 0]
  ------------------
 1975|  1.32k|        && key->shake256_md != NULL
  ------------------
  |  Branch (1975:12): [True: 1.32k, False: 0]
  ------------------
 1976|  1.32k|        && key->sha3_256_md != NULL
  ------------------
  |  Branch (1976:12): [True: 1.32k, False: 0]
  ------------------
 1977|  1.32k|        && key->sha3_512_md != NULL)
  ------------------
  |  Branch (1977:12): [True: 1.32k, False: 0]
  ------------------
 1978|  1.32k|        return key;
 1979|       |
 1980|      0|    ossl_ml_kem_key_free(key);
 1981|      0|    ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                  ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |   87|      0|#define ERR_LIB_CRYPTO 15
  ------------------
                  ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  355|      0|#define ERR_R_INTERNAL_ERROR (259 | ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  351|      0|#define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  238|      0|#define ERR_RFLAG_FATAL (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1982|      0|        "missing SHA3 digest algorithms while creating %s key",
 1983|      0|        vinfo->algorithm_name);
 1984|       |    return NULL;
 1985|  1.32k|}
ossl_ml_kem_key_free:
 2053|  1.32k|{
 2054|  1.32k|    if (key == NULL)
  ------------------
  |  Branch (2054:9): [True: 0, False: 1.32k]
  ------------------
 2055|      0|        return;
 2056|       |
 2057|  1.32k|    EVP_MD_free(key->shake128_md);
 2058|  1.32k|    EVP_MD_free(key->shake256_md);
 2059|  1.32k|    EVP_MD_free(key->sha3_256_md);
 2060|  1.32k|    EVP_MD_free(key->sha3_512_md);
 2061|       |
 2062|  1.32k|    ossl_ml_kem_key_reset(key);
 2063|  1.32k|    OPENSSL_free(key);
  ------------------
  |  |  131|  1.32k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2064|  1.32k|}
ossl_ml_kem_encode_public_key:
 2069|  1.32k|{
 2070|  1.32k|    if (!ossl_ml_kem_have_pubkey(key)
  ------------------
  |  |  207|  2.65k|#define ossl_ml_kem_have_pubkey(key) ((key)->t != NULL)
  ------------------
  |  Branch (2070:9): [True: 0, False: 1.32k]
  ------------------
 2071|  1.32k|        || len != key->vinfo->pubkey_bytes)
  ------------------
  |  Branch (2071:12): [True: 0, False: 1.32k]
  ------------------
 2072|      0|        return 0;
 2073|  1.32k|    encode_pubkey(out, key);
 2074|  1.32k|    return 1;
 2075|  1.32k|}
ossl_ml_kem_genkey:
 2191|  1.32k|{
 2192|  1.32k|    uint8_t seed[ML_KEM_SEED_BYTES];
 2193|  1.32k|    EVP_MD_CTX *mdctx = NULL;
 2194|  1.32k|    const ML_KEM_VINFO *vinfo;
 2195|  1.32k|    int ret = 0;
 2196|       |
 2197|  1.32k|    if (key == NULL
  ------------------
  |  Branch (2197:9): [True: 0, False: 1.32k]
  ------------------
 2198|  1.32k|        || ossl_ml_kem_have_pubkey(key)
  ------------------
  |  |  207|  2.65k|#define ossl_ml_kem_have_pubkey(key) ((key)->t != NULL)
  |  |  ------------------
  |  |  |  Branch (207:38): [True: 0, False: 1.32k]
  |  |  ------------------
  ------------------
 2199|  1.32k|        || ossl_ml_kem_have_dkenc(key))
  ------------------
  |  |  210|  1.32k|#define ossl_ml_kem_have_dkenc(key) ((key)->encoded_dk != NULL)
  |  |  ------------------
  |  |  |  Branch (210:37): [True: 0, False: 1.32k]
  |  |  ------------------
  ------------------
 2200|      0|        return 0;
 2201|  1.32k|    vinfo = key->vinfo;
 2202|       |
 2203|  1.32k|    if (pubenc != NULL && publen != vinfo->pubkey_bytes)
  ------------------
  |  Branch (2203:9): [True: 0, False: 1.32k]
  |  Branch (2203:27): [True: 0, False: 0]
  ------------------
 2204|      0|        return 0;
 2205|       |
 2206|  1.32k|    if (key->seedbuf != NULL) {
  ------------------
  |  Branch (2206:9): [True: 0, False: 1.32k]
  ------------------
 2207|      0|        if (!ossl_ml_kem_encode_seed(seed, sizeof(seed), key))
  ------------------
  |  Branch (2207:13): [True: 0, False: 0]
  ------------------
 2208|      0|            return 0;
 2209|      0|        ossl_ml_kem_key_reset(key);
 2210|  1.32k|    } else if (RAND_priv_bytes_ex(key->libctx, seed, sizeof(seed),
  ------------------
  |  Branch (2210:16): [True: 0, False: 1.32k]
  ------------------
 2211|  1.32k|                   key->vinfo->secbits)
 2212|  1.32k|        <= 0) {
 2213|      0|        return 0;
 2214|      0|    }
 2215|       |
 2216|  1.32k|    if ((mdctx = EVP_MD_CTX_new()) == NULL)
  ------------------
  |  Branch (2216:9): [True: 0, False: 1.32k]
  ------------------
 2217|      0|        return 0;
 2218|       |
 2219|       |    /*
 2220|       |     * Data derived from (d, z) defaults secret, and to avoid side-channel
 2221|       |     * leaks should not influence control flow.
 2222|       |     */
 2223|  1.32k|    CONSTTIME_SECRET(seed, ML_KEM_SEED_BYTES);
 2224|       |
 2225|  1.32k|    if (add_storage(OPENSSL_malloc(vinfo->puballoc),
  ------------------
  |  |  106|  1.32k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (2225:9): [True: 1.32k, False: 0]
  ------------------
 2226|  1.32k|            OPENSSL_secure_malloc(vinfo->prvalloc), 1, key))
  ------------------
  |  |  139|  1.32k|    CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2227|  1.32k|        ret = genkey(seed, mdctx, pubenc, key);
 2228|  1.32k|    OPENSSL_cleanse(seed, sizeof(seed));
 2229|       |
 2230|       |    /* Declassify secret inputs and derived outputs before returning control */
 2231|  1.32k|    CONSTTIME_DECLASSIFY(seed, ML_KEM_SEED_BYTES);
 2232|       |
 2233|  1.32k|    EVP_MD_CTX_free(mdctx);
 2234|  1.32k|    if (!ret) {
  ------------------
  |  Branch (2234:9): [True: 0, False: 1.32k]
  ------------------
 2235|      0|        ossl_ml_kem_key_reset(key);
 2236|      0|        return 0;
 2237|      0|    }
 2238|       |
 2239|       |    /* The public components are already declassified */
 2240|  1.32k|    CONSTTIME_DECLASSIFY(key->s, vinfo->rank * sizeof(scalar));
 2241|  1.32k|    CONSTTIME_DECLASSIFY(key->z, 2 * ML_KEM_RANDOM_BYTES);
 2242|  1.32k|    return 1;
 2243|  1.32k|}
ml_kem.c:add_storage:
 1862|  1.32k|{
 1863|  1.32k|    int rank = key->vinfo->rank;
 1864|       |
 1865|  1.32k|    if (pub == NULL || (private && priv == NULL)) {
  ------------------
  |  Branch (1865:9): [True: 0, False: 1.32k]
  |  Branch (1865:25): [True: 1.32k, False: 0]
  |  Branch (1865:36): [True: 0, False: 1.32k]
  ------------------
 1866|       |        /*
 1867|       |         * One of these could be allocated correctly. It is legal to call free with a NULL
 1868|       |         * pointer, so always attempt to free both allocations here
 1869|       |         */
 1870|      0|        OPENSSL_free(pub);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1871|      0|        OPENSSL_secure_free(priv);
  ------------------
  |  |  147|      0|    CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1872|      0|        return 0;
 1873|      0|    }
 1874|       |
 1875|       |    /*
 1876|       |     * We're adding key material, set up rho and pkhash to point to the rho_pkhash buffer
 1877|       |     */
 1878|  1.32k|    memset(key->rho_pkhash, 0, sizeof(key->rho_pkhash));
 1879|  1.32k|    key->rho = key->rho_pkhash;
 1880|  1.32k|    key->pkhash = key->rho_pkhash + ML_KEM_RANDOM_BYTES;
  ------------------
  |  |   47|  1.32k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
 1881|  1.32k|    key->d = key->z = NULL;
 1882|       |
 1883|       |    /* A public key needs space for |t| and |m| */
 1884|  1.32k|    key->m = (key->t = pub) + rank;
 1885|       |
 1886|       |    /*
 1887|       |     * A private key also needs space for |s| and |z|.
 1888|       |     * The |z| buffer always includes additional space for |d|, but a key's |d|
 1889|       |     * pointer is left NULL when parsed from the NIST format, which omits that
 1890|       |     * information.  Only keys generated from a (d, z) seed pair will have a
 1891|       |     * non-NULL |d| pointer.
 1892|       |     */
 1893|  1.32k|    if (private)
  ------------------
  |  Branch (1893:9): [True: 1.32k, False: 0]
  ------------------
 1894|  1.32k|        key->z = (uint8_t *)(rank + (key->s = priv));
 1895|  1.32k|    return 1;
 1896|  1.32k|}
ml_kem.c:encode_pubkey:
 1568|  1.32k|{
 1569|  1.32k|    const uint8_t *rho = key->rho;
 1570|  1.32k|    const ML_KEM_VINFO *vinfo = key->vinfo;
 1571|       |
 1572|  1.32k|    vector_encode(out, key->t, 12, vinfo->rank);
 1573|  1.32k|    memcpy(out + vinfo->vector_bytes, rho, ML_KEM_RANDOM_BYTES);
  ------------------
  |  |   47|  1.32k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
 1574|  1.32k|}
ml_kem.c:vector_encode:
 1221|  1.32k|{
 1222|  1.32k|    int stride = bits * DEGREE / 8;
  ------------------
  |  |   41|  1.32k|#define DEGREE ML_KEM_DEGREE
  |  |  ------------------
  |  |  |  |   19|  1.32k|#define ML_KEM_DEGREE 256
  |  |  ------------------
  ------------------
 1223|       |
 1224|  5.30k|    for (; rank-- > 0; out += stride)
  ------------------
  |  Branch (1224:12): [True: 3.98k, False: 1.32k]
  ------------------
 1225|  3.98k|        scalar_encode(out, a++, bits);
 1226|  1.32k|}
ml_kem.c:scalar_encode:
  973|  7.96k|{
  974|  7.96k|    const uint16_t *curr = s->c, *end = curr + DEGREE;
  ------------------
  |  |   41|  7.96k|#define DEGREE ML_KEM_DEGREE
  |  |  ------------------
  |  |  |  |   19|  7.96k|#define ML_KEM_DEGREE 256
  |  |  ------------------
  ------------------
  975|  7.96k|    uint64_t accum = 0, element;
  976|  7.96k|    int used = 0;
  977|       |
  978|  2.03M|    do {
  979|  2.03M|        element = *curr++;
  980|  2.03M|        if (used + bits < 64) {
  ------------------
  |  Branch (980:13): [True: 1.65M, False: 382k]
  ------------------
  981|  1.65M|            accum |= element << used;
  982|  1.65M|            used += bits;
  983|  1.65M|        } else if (used + bits > 64) {
  ------------------
  |  Branch (983:20): [True: 254k, False: 127k]
  ------------------
  984|   254k|            out = OPENSSL_store_u64_le(out, accum | (element << used));
  985|   254k|            accum = element >> (64 - used);
  986|   254k|            used = (used + bits) - 64;
  987|   254k|        } else {
  988|   127k|            out = OPENSSL_store_u64_le(out, accum | (element << used));
  989|   127k|            accum = 0;
  990|   127k|            used = 0;
  991|   127k|        }
  992|  2.03M|    } while (curr < end);
  ------------------
  |  Branch (992:14): [True: 2.03M, False: 7.96k]
  ------------------
  993|  7.96k|}
ml_kem.c:single_keccak:
  672|  9.28k|{
  673|  9.28k|    unsigned int sz = (unsigned int)outlen;
  674|       |
  675|  9.28k|    if (!EVP_DigestUpdate(mdctx, in, inlen))
  ------------------
  |  Branch (675:9): [True: 0, False: 9.28k]
  ------------------
  676|      0|        return 0;
  677|  9.28k|    if (EVP_MD_xof(EVP_MD_CTX_get0_md(mdctx)))
  ------------------
  |  Branch (677:9): [True: 7.96k, False: 1.32k]
  ------------------
  678|  7.96k|        return EVP_DigestFinalXOF(mdctx, out, outlen);
  679|  1.32k|    return EVP_DigestFinal_ex(mdctx, out, &sz)
  ------------------
  |  Branch (679:12): [True: 1.32k, False: 0]
  ------------------
  680|  1.32k|        && ossl_assert((size_t)sz == outlen);
  ------------------
  |  |   52|  1.32k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  ------------------
  |  |  |  Branch (52:24): [True: 1.32k, False: 0]
  |  |  ------------------
  |  |   53|  1.32k|    __FILE__, __LINE__)
  ------------------
  681|  9.28k|}
ml_kem.c:matrix_expand:
 1317|  1.32k|{
 1318|  1.32k|    scalar *out = key->m;
 1319|  1.32k|    uint8_t input[ML_KEM_RANDOM_BYTES + 2];
 1320|  1.32k|    int rank = key->vinfo->rank;
 1321|  1.32k|    int i, j;
 1322|       |
 1323|  1.32k|    memcpy(input, key->rho, ML_KEM_RANDOM_BYTES);
  ------------------
  |  |   47|  1.32k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
 1324|  5.30k|    for (i = 0; i < rank; i++) {
  ------------------
  |  Branch (1324:17): [True: 3.98k, False: 1.32k]
  ------------------
 1325|  15.9k|        for (j = 0; j < rank; j++) {
  ------------------
  |  Branch (1325:21): [True: 11.9k, False: 3.98k]
  ------------------
 1326|  11.9k|            input[ML_KEM_RANDOM_BYTES] = i;
  ------------------
  |  |   47|  11.9k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
 1327|  11.9k|            input[ML_KEM_RANDOM_BYTES + 1] = j;
  ------------------
  |  |   47|  11.9k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
 1328|  11.9k|            if (!EVP_DigestInit_ex(mdctx, key->shake128_md, NULL)
  ------------------
  |  Branch (1328:17): [True: 0, False: 11.9k]
  ------------------
 1329|  11.9k|                || !EVP_DigestUpdate(mdctx, input, sizeof(input))
  ------------------
  |  Branch (1329:20): [True: 0, False: 11.9k]
  ------------------
 1330|  11.9k|                || !sample_scalar(out++, mdctx))
  ------------------
  |  Branch (1330:20): [True: 0, False: 11.9k]
  ------------------
 1331|      0|                return 0;
 1332|  11.9k|        }
 1333|  3.98k|    }
 1334|  1.32k|    return 1;
 1335|  1.32k|}
ml_kem.c:sample_scalar:
  767|  11.9k|{
  768|  11.9k|    uint16_t *curr = out->c, *endout = curr + DEGREE;
  ------------------
  |  |   41|  11.9k|#define DEGREE ML_KEM_DEGREE
  |  |  ------------------
  |  |  |  |   19|  11.9k|#define ML_KEM_DEGREE 256
  |  |  ------------------
  ------------------
  769|  11.9k|    uint8_t buf[SCALAR_SAMPLING_BUFSIZE], *in;
  770|  11.9k|    uint8_t *endin = buf + sizeof(buf);
  771|  11.9k|    uint16_t d;
  772|  11.9k|    uint8_t b1, b2, b3;
  773|       |
  774|  35.9k|    do {
  775|  35.9k|        if (!EVP_DigestSqueeze(mdctx, in = buf, sizeof(buf)))
  ------------------
  |  Branch (775:13): [True: 0, False: 35.9k]
  ------------------
  776|      0|            return 0;
  777|  1.89M|        do {
  778|  1.89M|            b1 = *in++;
  779|  1.89M|            b2 = *in++;
  780|  1.89M|            b3 = *in++;
  781|       |
  782|  1.89M|            if (curr >= endout)
  ------------------
  |  Branch (782:17): [True: 5.99k, False: 1.88M]
  ------------------
  783|  5.99k|                break;
  784|  1.88M|            if ((d = ((b2 & 0x0f) << 8) + b1) < kPrime)
  ------------------
  |  Branch (784:17): [True: 1.53M, False: 353k]
  ------------------
  785|  1.53M|                *curr++ = d;
  786|  1.88M|            if (curr >= endout)
  ------------------
  |  Branch (786:17): [True: 5.91k, False: 1.87M]
  ------------------
  787|  5.91k|                break;
  788|  1.87M|            if ((d = (b3 << 4) + (b2 >> 4)) < kPrime)
  ------------------
  |  Branch (788:17): [True: 1.52M, False: 353k]
  ------------------
  789|  1.52M|                *curr++ = d;
  790|  1.87M|        } while (in < endin);
  ------------------
  |  Branch (790:18): [True: 1.85M, False: 24.0k]
  ------------------
  791|  35.9k|    } while (curr < endout);
  ------------------
  |  Branch (791:14): [True: 23.9k, False: 11.9k]
  ------------------
  792|  11.9k|    return 1;
  793|  11.9k|}
ml_kem.c:genkey:
 1693|  1.32k|{
 1694|  1.32k|    uint8_t hashed[2 * ML_KEM_RANDOM_BYTES];
 1695|  1.32k|    const uint8_t *const sigma = hashed + ML_KEM_RANDOM_BYTES;
  ------------------
  |  |   47|  1.32k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
 1696|  1.32k|    uint8_t augmented_seed[ML_KEM_RANDOM_BYTES + 1];
 1697|  1.32k|    const ML_KEM_VINFO *vinfo = key->vinfo;
 1698|  1.32k|    CBD_FUNC cbd_1 = CBD1(vinfo->evp_type);
  ------------------
  |  | 1470|  1.32k|#define CBD1(evp_type) ((evp_type) == EVP_PKEY_ML_KEM_512 ? cbd_3 : cbd_2)
  |  |  ------------------
  |  |  |  |   93|  1.32k|#define EVP_PKEY_ML_KEM_512 NID_ML_KEM_512
  |  |  |  |  ------------------
  |  |  |  |  |  | 6636|  1.32k|#define NID_ML_KEM_512          1454
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1470:25): [True: 0, False: 1.32k]
  |  |  ------------------
  ------------------
 1699|  1.32k|    int rank = vinfo->rank;
 1700|  1.32k|    uint8_t counter = 0;
 1701|  1.32k|    int ret = 0;
 1702|       |
 1703|       |    /*
 1704|       |     * Use the "d" seed salted with the rank to derive the public and private
 1705|       |     * seeds rho and sigma.
 1706|       |     */
 1707|  1.32k|    memcpy(augmented_seed, seed, ML_KEM_RANDOM_BYTES);
  ------------------
  |  |   47|  1.32k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
 1708|  1.32k|    augmented_seed[ML_KEM_RANDOM_BYTES] = (uint8_t)rank;
  ------------------
  |  |   47|  1.32k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
 1709|  1.32k|    if (!hash_g(hashed, augmented_seed, sizeof(augmented_seed), mdctx, key))
  ------------------
  |  Branch (1709:9): [True: 0, False: 1.32k]
  ------------------
 1710|      0|        goto end;
 1711|  1.32k|    memcpy(key->rho, hashed, ML_KEM_RANDOM_BYTES);
  ------------------
  |  |   47|  1.32k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
 1712|       |    /* The |rho| matrix seed is public */
 1713|  1.32k|    CONSTTIME_DECLASSIFY(key->rho, ML_KEM_RANDOM_BYTES);
 1714|       |
 1715|       |    /* FIPS 203 |e| vector is initial value of key->t */
 1716|  1.32k|    if (!matrix_expand(mdctx, key)
  ------------------
  |  Branch (1716:9): [True: 0, False: 1.32k]
  ------------------
 1717|  1.32k|        || !gencbd_vector_ntt(key->s, cbd_1, &counter, sigma, rank, mdctx, key)
  ------------------
  |  Branch (1717:12): [True: 0, False: 1.32k]
  ------------------
 1718|  1.32k|        || !gencbd_vector_ntt(key->t, cbd_1, &counter, sigma, rank, mdctx, key))
  ------------------
  |  Branch (1718:12): [True: 0, False: 1.32k]
  ------------------
 1719|      0|        goto end;
 1720|       |
 1721|       |    /* To |e| we now add the product of transpose |m| and |s|, giving |t|. */
 1722|  1.32k|    matrix_mult_transpose_add(key->t, key->m, key->s, rank);
 1723|       |    /* The |t| vector is public */
 1724|  1.32k|    CONSTTIME_DECLASSIFY(key->t, vinfo->rank * sizeof(scalar));
 1725|       |
 1726|  1.32k|    if (pubenc == NULL) {
  ------------------
  |  Branch (1726:9): [True: 1.32k, False: 0]
  ------------------
 1727|       |        /* Incremental digest of public key without in-full serialisation. */
 1728|  1.32k|        if (!hash_h_pubkey(key->pkhash, mdctx, key))
  ------------------
  |  Branch (1728:13): [True: 0, False: 1.32k]
  ------------------
 1729|      0|            goto end;
 1730|  1.32k|    } else {
 1731|      0|        encode_pubkey(pubenc, key);
 1732|      0|        if (!hash_h(key->pkhash, pubenc, vinfo->pubkey_bytes, mdctx, key))
  ------------------
  |  Branch (1732:13): [True: 0, False: 0]
  ------------------
 1733|      0|            goto end;
 1734|      0|    }
 1735|       |
 1736|       |    /* Save |z| portion of seed for "implicit rejection" on failure. */
 1737|  1.32k|    memcpy(key->z, seed + ML_KEM_RANDOM_BYTES, ML_KEM_RANDOM_BYTES);
  ------------------
  |  |   47|  1.32k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
                  memcpy(key->z, seed + ML_KEM_RANDOM_BYTES, ML_KEM_RANDOM_BYTES);
  ------------------
  |  |   47|  1.32k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
 1738|       |
 1739|       |    /* Optionally save the |d| portion of the seed */
 1740|  1.32k|    key->d = key->z + ML_KEM_RANDOM_BYTES;
  ------------------
  |  |   47|  1.32k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
 1741|  1.32k|    if (key->prov_flags & ML_KEM_KEY_RETAIN_SEED) {
  ------------------
  |  |  126|  1.32k|#define ML_KEM_KEY_RETAIN_SEED (1 << 3)
  ------------------
  |  Branch (1741:9): [True: 1.32k, False: 0]
  ------------------
 1742|  1.32k|        memcpy(key->d, seed, ML_KEM_RANDOM_BYTES);
  ------------------
  |  |   47|  1.32k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
 1743|  1.32k|    } else {
 1744|      0|        OPENSSL_cleanse(key->d, ML_KEM_RANDOM_BYTES);
  ------------------
  |  |   47|      0|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
 1745|      0|        key->d = NULL;
 1746|      0|    }
 1747|       |
 1748|  1.32k|    ret = 1;
 1749|  1.32k|end:
 1750|  1.32k|    OPENSSL_cleanse((void *)augmented_seed, ML_KEM_RANDOM_BYTES);
  ------------------
  |  |   47|  1.32k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
 1751|  1.32k|    OPENSSL_cleanse((void *)sigma, ML_KEM_RANDOM_BYTES);
  ------------------
  |  |   47|  1.32k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
 1752|  1.32k|    if (ret == 0) {
  ------------------
  |  Branch (1752:9): [True: 0, False: 1.32k]
  ------------------
 1753|      0|        ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |   87|      0|#define ERR_LIB_CRYPTO 15
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  355|      0|#define ERR_R_INTERNAL_ERROR (259 | ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  351|      0|#define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  238|      0|#define ERR_RFLAG_FATAL (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1754|      0|            "internal error while generating %s private key",
 1755|      0|            vinfo->algorithm_name);
 1756|      0|    }
 1757|  1.32k|    return ret;
 1758|  1.32k|}
ml_kem.c:prf:
  689|  7.96k|{
  690|  7.96k|    return EVP_DigestInit_ex(mdctx, key->shake256_md, NULL)
  ------------------
  |  Branch (690:12): [True: 7.96k, False: 0]
  ------------------
  691|  7.96k|        && single_keccak(out, len, in, ML_KEM_RANDOM_BYTES + 1, mdctx);
  ------------------
  |  |   47|  7.96k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
  |  Branch (691:12): [True: 7.96k, False: 0]
  ------------------
  692|  7.96k|}
ml_kem.c:cbd_2:
 1347|  7.96k|{
 1348|  7.96k|    uint16_t *curr = out->c, *end = curr + DEGREE;
  ------------------
  |  |   41|  7.96k|#define DEGREE ML_KEM_DEGREE
  |  |  ------------------
  |  |  |  |   19|  7.96k|#define ML_KEM_DEGREE 256
  |  |  ------------------
  ------------------
 1349|  7.96k|    uint8_t randbuf[4 * DEGREE / 8], *r = randbuf; /* 64 * eta slots */
 1350|  7.96k|    uint16_t value, mask;
 1351|  7.96k|    uint8_t b;
 1352|       |
 1353|  7.96k|    if (!prf(randbuf, sizeof(randbuf), in, mdctx, key))
  ------------------
  |  Branch (1353:9): [True: 0, False: 7.96k]
  ------------------
 1354|      0|        return 0;
 1355|       |
 1356|  1.01M|    do {
 1357|  1.01M|        b = *r++;
 1358|       |
 1359|       |        /*
 1360|       |         * Add |kPrime| if |value| underflowed.  See |constish_time_non_zero|
 1361|       |         * for a discussion on why the value barrier is by default omitted.
 1362|       |         * While this could have been written reduce_once(value + kPrime), this
 1363|       |         * is one extra addition and small range of |value| tempts some
 1364|       |         * versions of Clang to emit a branch.
 1365|       |         */
 1366|  1.01M|        value = bit0(b) + bitn(1, b);
  ------------------
  |  |   34|  1.01M|#define bit0(b) ((b) & 1)
  ------------------
                      value = bit0(b) + bitn(1, b);
  ------------------
  |  |   35|  1.01M|#define bitn(n, b) (((b) >> n) & 1)
  ------------------
 1367|  1.01M|        value -= bitn(2, b) + bitn(3, b);
  ------------------
  |  |   35|  1.01M|#define bitn(n, b) (((b) >> n) & 1)
  ------------------
                      value -= bitn(2, b) + bitn(3, b);
  ------------------
  |  |   35|  1.01M|#define bitn(n, b) (((b) >> n) & 1)
  ------------------
 1368|  1.01M|        mask = constish_time_non_zero(value >> 15);
  ------------------
  |  |   70|  1.01M|#define constish_time_non_zero(b) (0u - (b))
  ------------------
 1369|  1.01M|        *curr++ = value + (kPrime & mask);
 1370|       |
 1371|  1.01M|        value = bitn(4, b) + bitn(5, b);
  ------------------
  |  |   35|  1.01M|#define bitn(n, b) (((b) >> n) & 1)
  ------------------
                      value = bitn(4, b) + bitn(5, b);
  ------------------
  |  |   35|  1.01M|#define bitn(n, b) (((b) >> n) & 1)
  ------------------
 1372|  1.01M|        value -= bitn(6, b) + bitn(7, b);
  ------------------
  |  |   35|  1.01M|#define bitn(n, b) (((b) >> n) & 1)
  ------------------
                      value -= bitn(6, b) + bitn(7, b);
  ------------------
  |  |   35|  1.01M|#define bitn(n, b) (((b) >> n) & 1)
  ------------------
 1373|  1.01M|        mask = constish_time_non_zero(value >> 15);
  ------------------
  |  |   70|  1.01M|#define constish_time_non_zero(b) (0u - (b))
  ------------------
 1374|  1.01M|        *curr++ = value + (kPrime & mask);
 1375|  1.01M|    } while (curr < end);
  ------------------
  |  Branch (1375:14): [True: 1.01M, False: 7.96k]
  ------------------
 1376|  7.96k|    return 1;
 1377|  7.96k|}
ml_kem.c:hash_g:
  738|  1.32k|{
  739|  1.32k|    return EVP_DigestInit_ex(mdctx, key->sha3_512_md, NULL)
  ------------------
  |  Branch (739:12): [True: 1.32k, False: 0]
  ------------------
  740|  1.32k|        && single_keccak(out, ML_KEM_SEED_BYTES, in, len, mdctx);
  ------------------
  |  |   48|  1.32k|#define ML_KEM_SEED_BYTES (ML_KEM_RANDOM_BYTES * 2) /* Keygen (d, z) */
  |  |  ------------------
  |  |  |  |   47|  1.32k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  |  |  ------------------
  ------------------
  |  Branch (740:12): [True: 1.32k, False: 0]
  ------------------
  741|  1.32k|}
ml_kem.c:gencbd_vector_ntt:
 1456|  2.65k|{
 1457|  2.65k|    uint8_t input[ML_KEM_RANDOM_BYTES + 1];
 1458|       |
 1459|  2.65k|    memcpy(input, seed, ML_KEM_RANDOM_BYTES);
  ------------------
  |  |   47|  2.65k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
 1460|  7.96k|    do {
 1461|  7.96k|        input[ML_KEM_RANDOM_BYTES] = (*counter)++;
  ------------------
  |  |   47|  7.96k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
 1462|  7.96k|        if (!cbd(out, input, mdctx, key))
  ------------------
  |  Branch (1462:13): [True: 0, False: 7.96k]
  ------------------
 1463|      0|            return 0;
 1464|  7.96k|        scalar_ntt(out++);
 1465|  7.96k|    } while (--rank > 0);
  ------------------
  |  Branch (1465:14): [True: 5.30k, False: 2.65k]
  ------------------
 1466|  2.65k|    return 1;
 1467|  2.65k|}
ml_kem.c:scalar_ntt:
  846|  7.96k|{
  847|  7.96k|    const uint16_t *roots = kNTTRoots;
  848|  7.96k|    uint16_t *end = s->c + DEGREE;
  ------------------
  |  |   41|  7.96k|#define DEGREE ML_KEM_DEGREE
  |  |  ------------------
  |  |  |  |   19|  7.96k|#define ML_KEM_DEGREE 256
  |  |  ------------------
  ------------------
  849|  7.96k|    int offset = DEGREE / 2;
  ------------------
  |  |   41|  7.96k|#define DEGREE ML_KEM_DEGREE
  |  |  ------------------
  |  |  |  |   19|  7.96k|#define ML_KEM_DEGREE 256
  |  |  ------------------
  ------------------
  850|       |
  851|  55.7k|    do {
  852|  55.7k|        uint16_t *curr = s->c, *peer;
  853|       |
  854|  1.01M|        do {
  855|  1.01M|            uint16_t *pause = curr + offset, even, odd;
  856|  1.01M|            uint32_t zeta = *++roots;
  857|       |
  858|  1.01M|            peer = pause;
  859|  7.13M|            do {
  860|  7.13M|                even = *curr;
  861|  7.13M|                odd = reduce(*peer * zeta);
  862|  7.13M|                *peer++ = reduce_once(even - odd + kPrime);
  863|  7.13M|                *curr++ = reduce_once(odd + even);
  864|  7.13M|            } while (curr < pause);
  ------------------
  |  Branch (864:22): [True: 6.12M, False: 1.01M]
  ------------------
  865|  1.01M|        } while ((curr = peer) < end);
  ------------------
  |  Branch (865:18): [True: 955k, False: 55.7k]
  ------------------
  866|  55.7k|    } while ((offset >>= 1) >= 2);
  ------------------
  |  Branch (866:14): [True: 47.7k, False: 7.96k]
  ------------------
  867|  7.96k|}
ml_kem.c:reduce:
  817|  11.7M|{
  818|  11.7M|    uint64_t product = (uint64_t)x * kBarrettMultiplier;
  819|  11.7M|    uint32_t quotient = (uint32_t)(product >> kBarrettShift);
  820|  11.7M|    uint32_t remainder = x - quotient * kPrime;
  821|       |
  822|  11.7M|    return reduce_once(remainder);
  823|  11.7M|}
ml_kem.c:reduce_once:
  803|  25.9M|{
  804|  25.9M|    const uint16_t subtracted = x - kPrime;
  805|  25.9M|    uint16_t mask = constish_time_non_zero(subtracted >> 15);
  ------------------
  |  |   70|  25.9M|#define constish_time_non_zero(b) (0u - (b))
  ------------------
  806|       |
  807|  25.9M|    return (mask & x) | (~mask & subtracted);
  808|  25.9M|}
ml_kem.c:matrix_mult_transpose_add:
 1298|  1.32k|{
 1299|  1.32k|    const scalar *mc = m, *mr, *ar;
 1300|  1.32k|    int i, j;
 1301|       |
 1302|  5.30k|    for (i = rank; i-- > 0; ++out) {
  ------------------
  |  Branch (1302:20): [True: 3.98k, False: 1.32k]
  ------------------
 1303|  3.98k|        scalar_mult_add(out, mr = mc++, ar = a);
 1304|  11.9k|        for (j = rank; --j > 0;)
  ------------------
  |  Branch (1304:24): [True: 7.96k, False: 3.98k]
  ------------------
 1305|  7.96k|            scalar_mult_add(out, (mr += rank), ++ar);
 1306|  3.98k|    }
 1307|  1.32k|}
ml_kem.c:scalar_mult_add:
  951|  11.9k|{
  952|  11.9k|    uint16_t *curr = out->c, *end = curr + DEGREE;
  ------------------
  |  |   41|  11.9k|#define DEGREE ML_KEM_DEGREE
  |  |  ------------------
  |  |  |  |   19|  11.9k|#define ML_KEM_DEGREE 256
  |  |  ------------------
  ------------------
  953|  11.9k|    const uint16_t *lc = lhs->c, *rc = rhs->c;
  954|  11.9k|    const uint16_t *roots = kModRoots;
  955|       |
  956|  1.52M|    do {
  957|  1.52M|        uint32_t l0 = *lc++, r0 = *rc++;
  958|  1.52M|        uint32_t l1 = *lc++, r1 = *rc++;
  959|  1.52M|        uint16_t *c0 = curr++;
  960|  1.52M|        uint16_t *c1 = curr++;
  961|  1.52M|        uint32_t zetapow = *roots++;
  962|       |
  963|  1.52M|        *c0 = reduce(*c0 + l0 * r0 + reduce(l1 * r1) * zetapow);
  964|  1.52M|        *c1 = reduce(*c1 + l0 * r1 + l1 * r0);
  965|  1.52M|    } while (curr < end);
  ------------------
  |  Branch (965:14): [True: 1.51M, False: 11.9k]
  ------------------
  966|  11.9k|}
ml_kem.c:hash_h_pubkey:
  709|  1.32k|{
  710|  1.32k|    const ML_KEM_VINFO *vinfo = key->vinfo;
  711|  1.32k|    const scalar *t = key->t, *end = t + vinfo->rank;
  712|  1.32k|    unsigned int sz;
  713|       |
  714|  1.32k|    if (!EVP_DigestInit_ex(mdctx, key->sha3_256_md, NULL))
  ------------------
  |  Branch (714:9): [True: 0, False: 1.32k]
  ------------------
  715|      0|        return 0;
  716|       |
  717|  3.98k|    do {
  718|  3.98k|        uint8_t buf[3 * DEGREE / 2];
  719|       |
  720|  3.98k|        scalar_encode(buf, t++, 12);
  721|  3.98k|        if (!EVP_DigestUpdate(mdctx, buf, sizeof(buf)))
  ------------------
  |  Branch (721:13): [True: 0, False: 3.98k]
  ------------------
  722|      0|            return 0;
  723|  3.98k|    } while (t < end);
  ------------------
  |  Branch (723:14): [True: 2.65k, False: 1.32k]
  ------------------
  724|       |
  725|  1.32k|    if (!EVP_DigestUpdate(mdctx, key->rho, ML_KEM_RANDOM_BYTES))
  ------------------
  |  |   47|  1.32k|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  ------------------
  |  Branch (725:9): [True: 0, False: 1.32k]
  ------------------
  726|      0|        return 0;
  727|  1.32k|    return EVP_DigestFinal_ex(mdctx, pkhash, &sz)
  ------------------
  |  Branch (727:12): [True: 1.32k, False: 0]
  ------------------
  728|  1.32k|        && ossl_assert(sz == ML_KEM_PKHASH_BYTES);
  ------------------
  |  |   52|  1.32k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  ------------------
  |  |  |  Branch (52:24): [True: 1.32k, False: 0]
  |  |  ------------------
  |  |   53|  1.32k|    __FILE__, __LINE__)
  ------------------
  729|  1.32k|}

CRYPTO_ctr128_encrypt_ctr32:
  155|  34.5k|{
  156|  34.5k|    unsigned int n, ctr32;
  157|       |
  158|  34.5k|    n = *num;
  159|       |
  160|  34.5k|    while (n && len) {
  ------------------
  |  Branch (160:12): [True: 0, False: 34.5k]
  |  Branch (160:17): [True: 0, False: 0]
  ------------------
  161|      0|        *(out++) = *(in++) ^ ecount_buf[n];
  162|      0|        --len;
  163|      0|        n = (n + 1) % 16;
  164|      0|    }
  165|       |
  166|  34.5k|    ctr32 = GETU32(ivec + 12);
  ------------------
  |  |   98|  34.5k|#define GETU32(p) ((u32)(p)[0] << 24 | (u32)(p)[1] << 16 | (u32)(p)[2] << 8 | (u32)(p)[3])
  ------------------
  167|  55.0k|    while (len >= 16) {
  ------------------
  |  Branch (167:12): [True: 20.4k, False: 34.5k]
  ------------------
  168|  20.4k|        size_t blocks = len / 16;
  169|       |        /*
  170|       |         * 1<<28 is just a not-so-small yet not-so-large number...
  171|       |         * Below condition is practically never met, but it has to
  172|       |         * be checked for code correctness.
  173|       |         */
  174|  20.4k|        if (sizeof(size_t) > sizeof(unsigned int) && blocks > (1U << 28))
  ------------------
  |  Branch (174:13): [True: 20.4k, Folded]
  |  Branch (174:54): [True: 0, False: 20.4k]
  ------------------
  175|      0|            blocks = (1U << 28);
  176|       |        /*
  177|       |         * As (*func) operates on 32-bit counter, caller
  178|       |         * has to handle overflow. 'if' below detects the
  179|       |         * overflow, which is then handled by limiting the
  180|       |         * amount of blocks to the exact overflow point...
  181|       |         */
  182|  20.4k|        ctr32 += (u32)blocks;
  183|  20.4k|        if (ctr32 < blocks) {
  ------------------
  |  Branch (183:13): [True: 0, False: 20.4k]
  ------------------
  184|      0|            blocks -= ctr32;
  185|      0|            ctr32 = 0;
  186|      0|        }
  187|  20.4k|        (*func)(in, out, blocks, key, ivec);
  188|       |        /* (*ctr) does not update ivec, caller does: */
  189|  20.4k|        PUTU32(ivec + 12, ctr32);
  ------------------
  |  |   99|  20.4k|#define PUTU32(p, v) ((p)[0] = (u8)((v) >> 24), (p)[1] = (u8)((v) >> 16), (p)[2] = (u8)((v) >> 8), (p)[3] = (u8)(v))
  ------------------
  190|       |        /* ... overflow was detected, propagate carry. */
  191|  20.4k|        if (ctr32 == 0)
  ------------------
  |  Branch (191:13): [True: 0, False: 20.4k]
  ------------------
  192|      0|            ctr96_inc(ivec);
  193|  20.4k|        blocks *= 16;
  194|  20.4k|        len -= blocks;
  195|  20.4k|        out += blocks;
  196|  20.4k|        in += blocks;
  197|  20.4k|    }
  198|  34.5k|    if (len) {
  ------------------
  |  Branch (198:9): [True: 14.3k, False: 20.2k]
  ------------------
  199|  14.3k|        memset(ecount_buf, 0, 16);
  200|  14.3k|        (*func)(ecount_buf, ecount_buf, 1, key, ivec);
  201|  14.3k|        ++ctr32;
  202|  14.3k|        PUTU32(ivec + 12, ctr32);
  ------------------
  |  |   99|  14.3k|#define PUTU32(p, v) ((p)[0] = (u8)((v) >> 24), (p)[1] = (u8)((v) >> 16), (p)[2] = (u8)((v) >> 8), (p)[3] = (u8)(v))
  ------------------
  203|  14.3k|        if (ctr32 == 0)
  ------------------
  |  Branch (203:13): [True: 0, False: 14.3k]
  ------------------
  204|      0|            ctr96_inc(ivec);
  205|  71.5k|        while (len--) {
  ------------------
  |  Branch (205:16): [True: 57.2k, False: 14.3k]
  ------------------
  206|  57.2k|            out[n] = in[n] ^ ecount_buf[n];
  207|  57.2k|            ++n;
  208|  57.2k|        }
  209|  14.3k|    }
  210|       |
  211|  34.5k|    *num = n;
  212|  34.5k|}

openssl_fopen:
   39|  6.20k|{
   40|  6.20k|    FILE *file = NULL;
   41|       |#if defined(_WIN32) && defined(CP_UTF8)
   42|       |    int sz, len_0;
   43|       |    DWORD flags;
   44|       |#endif
   45|       |
   46|  6.20k|    if (filename == NULL)
  ------------------
  |  Branch (46:9): [True: 0, False: 6.20k]
  ------------------
   47|      0|        return NULL;
   48|       |#if defined(_WIN32) && defined(CP_UTF8)
   49|       |    len_0 = (int)strlen(filename) + 1;
   50|       |
   51|       |    /*
   52|       |     * Basically there are three cases to cover: a) filename is
   53|       |     * pure ASCII string; b) actual UTF-8 encoded string and
   54|       |     * c) locale-ized string, i.e. one containing 8-bit
   55|       |     * characters that are meaningful in current system locale.
   56|       |     * If filename is pure ASCII or real UTF-8 encoded string,
   57|       |     * MultiByteToWideChar succeeds and _wfopen works. If
   58|       |     * filename is locale-ized string, chances are that
   59|       |     * MultiByteToWideChar fails reporting
   60|       |     * ERROR_NO_UNICODE_TRANSLATION, in which case we fall
   61|       |     * back to fopen...
   62|       |     */
   63|       |    if ((sz = MultiByteToWideChar(CP_UTF8, (flags = MB_ERR_INVALID_CHARS),
   64|       |             filename, len_0, NULL, 0))
   65|       |            > 0
   66|       |        || (GetLastError() == ERROR_INVALID_FLAGS && (sz = MultiByteToWideChar(CP_UTF8, (flags = 0), filename, len_0, NULL, 0)) > 0)) {
   67|       |        WCHAR wmode[8];
   68|       |        WCHAR *wfilename = _alloca(sz * sizeof(WCHAR));
   69|       |
   70|       |        if (MultiByteToWideChar(CP_UTF8, flags,
   71|       |                filename, len_0, wfilename, sz)
   72|       |            && MultiByteToWideChar(CP_UTF8, 0, mode, (int)(strlen(mode) + 1),
   73|       |                wmode, OSSL_NELEM(wmode))
   74|       |            && (file = _wfopen(wfilename, wmode)) == NULL && (errno == ENOENT || errno == EBADF)) {
   75|       |            /*
   76|       |             * UTF-8 decode succeeded, but no file, filename
   77|       |             * could still have been locale-ized...
   78|       |             */
   79|       |            file = fopen(filename, mode);
   80|       |        }
   81|       |    } else if (GetLastError() == ERROR_NO_UNICODE_TRANSLATION) {
   82|       |        file = fopen(filename, mode);
   83|       |    }
   84|       |#elif defined(__DJGPP__)
   85|       |    {
   86|       |        char *newname = NULL;
   87|       |
   88|       |        if (pathconf(filename, _PC_NAME_MAX) <= 12) { /* 8.3 file system? */
   89|       |            char *iterator;
   90|       |            char lastchar;
   91|       |
   92|       |            if ((newname = OPENSSL_malloc(strlen(filename) + 1)) == NULL)
   93|       |                return NULL;
   94|       |
   95|       |            for (iterator = newname, lastchar = '\0';
   96|       |                *filename; filename++, iterator++) {
   97|       |                if (lastchar == '/' && filename[0] == '.'
   98|       |                    && filename[1] != '.' && filename[1] != '/') {
   99|       |                    /* Leading dots are not permitted in plain DOS. */
  100|       |                    *iterator = '_';
  101|       |                } else {
  102|       |                    *iterator = *filename;
  103|       |                }
  104|       |                lastchar = *filename;
  105|       |            }
  106|       |            *iterator = '\0';
  107|       |            filename = newname;
  108|       |        }
  109|       |        file = fopen(filename, mode);
  110|       |
  111|       |        OPENSSL_free(newname);
  112|       |    }
  113|       |#else
  114|  6.20k|    file = fopen(filename, mode);
  115|  6.20k|#endif
  116|  6.20k|    return file;
  117|  6.20k|}

CRYPTO_strdup:
   23|  1.04M|{
   24|  1.04M|    char *ret;
   25|  1.04M|    size_t len;
   26|       |
   27|  1.04M|    if (str == NULL)
  ------------------
  |  Branch (27:9): [True: 2, False: 1.04M]
  ------------------
   28|      2|        return NULL;
   29|       |
   30|  1.04M|    len = strlen(str) + 1;
   31|  1.04M|    ret = CRYPTO_malloc(len, file, line);
   32|  1.04M|    if (ret != NULL)
  ------------------
  |  Branch (32:9): [True: 1.04M, False: 0]
  ------------------
   33|  1.04M|        memcpy(ret, str, len);
   34|  1.04M|    return ret;
   35|  1.04M|}
CRYPTO_strndup:
   38|   174k|{
   39|   174k|    size_t maxlen;
   40|   174k|    char *ret;
   41|       |
   42|   174k|    if (str == NULL)
  ------------------
  |  Branch (42:9): [True: 0, False: 174k]
  ------------------
   43|      0|        return NULL;
   44|       |
   45|   174k|    maxlen = OPENSSL_strnlen(str, s);
   46|       |
   47|   174k|    ret = CRYPTO_malloc(maxlen + 1, file, line);
   48|   174k|    if (ret) {
  ------------------
  |  Branch (48:9): [True: 174k, False: 0]
  ------------------
   49|   174k|        memcpy(ret, str, maxlen);
   50|   174k|        ret[maxlen] = CH_ZERO;
  ------------------
  |  |   20|   174k|#define CH_ZERO '\0'
  ------------------
   51|   174k|    }
   52|   174k|    return ret;
   53|   174k|}
CRYPTO_memdup:
   56|  6.38k|{
   57|  6.38k|    void *ret;
   58|       |
   59|  6.38k|    if (data == NULL || siz >= INT_MAX)
  ------------------
  |  Branch (59:9): [True: 0, False: 6.38k]
  |  Branch (59:25): [True: 0, False: 6.38k]
  ------------------
   60|      0|        return NULL;
   61|       |
   62|  6.38k|    ret = CRYPTO_malloc(siz, file, line);
   63|  6.38k|    if (ret == NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 6.38k]
  ------------------
   64|      0|        return NULL;
   65|  6.38k|    return memcpy(ret, data, siz);
   66|  6.38k|}
OPENSSL_strnlen:
   69|   360k|{
   70|   360k|    const char *p;
   71|       |
   72|  19.6M|    for (p = str; maxlen-- != 0 && *p != CH_ZERO; ++p)
  ------------------
  |  |   20|  19.5M|#define CH_ZERO '\0'
  ------------------
  |  Branch (72:19): [True: 19.5M, False: 174k]
  |  Branch (72:36): [True: 19.3M, False: 186k]
  ------------------
   73|  19.3M|        ;
   74|       |
   75|   360k|    return p - str;
   76|   360k|}
OPENSSL_strlcpy:
   79|  1.70M|{
   80|  1.70M|    size_t l = 0;
   81|  15.1M|    for (; size > 1 && *src; size--) {
  ------------------
  |  Branch (81:12): [True: 15.1M, False: 0]
  |  Branch (81:24): [True: 13.4M, False: 1.70M]
  ------------------
   82|  13.4M|        *dst++ = *src++;
   83|  13.4M|        l++;
   84|  13.4M|    }
   85|  1.70M|    if (size)
  ------------------
  |  Branch (85:9): [True: 1.70M, False: 0]
  ------------------
   86|  1.70M|        *dst = CH_ZERO;
  ------------------
  |  |   20|  1.70M|#define CH_ZERO '\0'
  ------------------
   87|  1.70M|    return l + strlen(src);
   88|  1.70M|}
OPENSSL_strlcat:
   91|  2.33k|{
   92|  2.33k|    size_t l = 0;
   93|  15.1k|    for (; size > 0 && *dst; size--, dst++)
  ------------------
  |  Branch (93:12): [True: 15.1k, False: 0]
  |  Branch (93:24): [True: 12.8k, False: 2.33k]
  ------------------
   94|  12.8k|        l++;
   95|  2.33k|    return l + OPENSSL_strlcpy(dst, src, size);
   96|  2.33k|}
openssl_strerror_r:
  377|     23|{
  378|       |#if defined(_MSC_VER) && _MSC_VER >= 1400 && !defined(_WIN32_WCE)
  379|       |    return !strerror_s(buf, buflen, errnum);
  380|       |#elif defined(_GNU_SOURCE)
  381|       |    char *err;
  382|       |
  383|       |    /*
  384|       |     * GNU strerror_r may not actually set buf.
  385|       |     * It can return a pointer to some (immutable) static string in which case
  386|       |     * buf is left unused.
  387|       |     */
  388|       |    err = strerror_r(errnum, buf, buflen);
  389|       |    if (err == NULL || buflen == 0)
  390|       |        return 0;
  391|       |    /*
  392|       |     * If err is statically allocated, err != buf and we need to copy the data.
  393|       |     * If err points somewhere inside buf, OPENSSL_strlcpy can handle this,
  394|       |     * since src and dest are not annotated with __restrict and the function
  395|       |     * reads src byte for byte and writes to dest.
  396|       |     * If err == buf we do not have to copy anything.
  397|       |     */
  398|       |    if (err != buf)
  399|       |        OPENSSL_strlcpy(buf, err, buflen);
  400|       |    return 1;
  401|       |#elif (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600)
  402|       |    /*
  403|       |     * We can use "real" strerror_r. The OpenSSL version differs in that it
  404|       |     * gives 1 on success and 0 on failure for consistency with other OpenSSL
  405|       |     * functions. Real strerror_r does it the other way around
  406|       |     */
  407|     23|    return !strerror_r(errnum, buf, buflen);
  408|       |#else
  409|       |    char *err;
  410|       |
  411|       |    /* Fall back to non-thread safe strerror()...its all we can do */
  412|       |    if (buflen < 2)
  413|       |        return 0;
  414|       |    err = strerror(errnum);
  415|       |    /* Can this ever happen? */
  416|       |    if (err == NULL)
  417|       |        return 0;
  418|       |    OPENSSL_strlcpy(buf, err, buflen);
  419|       |    return 1;
  420|       |#endif
  421|     23|}
OPENSSL_strcasecmp:
  424|  6.23M|{
  425|  6.23M|    int t;
  426|       |
  427|  45.7M|    while ((t = ossl_tolower(*s1) - ossl_tolower(*s2++)) == 0)
  ------------------
  |  Branch (427:12): [True: 43.0M, False: 2.72M]
  ------------------
  428|  43.0M|        if (*s1++ == '\0')
  ------------------
  |  Branch (428:13): [True: 3.50M, False: 39.5M]
  ------------------
  429|  3.50M|            return 0;
  430|  2.72M|    return t;
  431|  6.23M|}
OPENSSL_strncasecmp:
  434|  1.64M|{
  435|  1.64M|    int t;
  436|  1.64M|    size_t i;
  437|       |
  438|  3.93M|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (438:17): [True: 3.09M, False: 834k]
  ------------------
  439|  3.09M|        if ((t = ossl_tolower(*s1) - ossl_tolower(*s2++)) != 0)
  ------------------
  |  Branch (439:13): [True: 808k, False: 2.28M]
  ------------------
  440|   808k|            return t;
  441|  2.28M|        else if (*s1++ == '\0')
  ------------------
  |  Branch (441:18): [True: 0, False: 2.28M]
  ------------------
  442|      0|            return 0;
  443|   834k|    return 0;
  444|  1.64M|}

OBJ_NAME_init:
   64|   625k|{
   65|   625k|    return RUN_ONCE(&init, o_names_init);
  ------------------
  |  |  130|   625k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 625k, False: 0]
  |  |  ------------------
  ------------------
   66|   625k|}
OBJ_NAME_get:
  153|   624k|{
  154|   624k|    OBJ_NAME on, *ret;
  155|   624k|    int num = 0, alias;
  156|   624k|    const char *value = NULL;
  157|       |
  158|   624k|    if (name == NULL)
  ------------------
  |  Branch (158:9): [True: 0, False: 624k]
  ------------------
  159|      0|        return NULL;
  160|   624k|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (160:9): [True: 0, False: 624k]
  ------------------
  161|      0|        return NULL;
  162|   624k|    if (!CRYPTO_THREAD_read_lock(obj_lock))
  ------------------
  |  Branch (162:9): [True: 0, False: 624k]
  ------------------
  163|      0|        return NULL;
  164|       |
  165|   624k|    alias = type & OBJ_NAME_ALIAS;
  ------------------
  |  |   33|   624k|#define OBJ_NAME_ALIAS 0x8000
  ------------------
  166|   624k|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|   624k|#define OBJ_NAME_ALIAS 0x8000
  ------------------
  167|       |
  168|   624k|    on.name = name;
  169|   624k|    on.type = type;
  170|       |
  171|   684k|    for (;;) {
  172|   684k|        ret = lh_OBJ_NAME_retrieve(names_lh, &on);
  173|   684k|        if (ret == NULL)
  ------------------
  |  Branch (173:13): [True: 99.2k, False: 585k]
  ------------------
  174|  99.2k|            break;
  175|   585k|        if ((ret->alias) && !alias) {
  ------------------
  |  Branch (175:13): [True: 60.0k, False: 525k]
  |  Branch (175:29): [True: 60.0k, False: 0]
  ------------------
  176|  60.0k|            if (++num > 10)
  ------------------
  |  Branch (176:17): [True: 0, False: 60.0k]
  ------------------
  177|      0|                break;
  178|  60.0k|            on.name = ret->data;
  179|   525k|        } else {
  180|   525k|            value = ret->data;
  181|   525k|            break;
  182|   525k|        }
  183|   585k|    }
  184|       |
  185|   624k|    CRYPTO_THREAD_unlock(obj_lock);
  186|   624k|    return value;
  187|   624k|}
OBJ_NAME_add:
  190|    424|{
  191|    424|    OBJ_NAME *onp, *ret;
  192|    424|    int alias, ok = 0;
  193|       |
  194|    424|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (194:9): [True: 0, False: 424]
  ------------------
  195|      0|        return 0;
  196|       |
  197|    424|    alias = type & OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    424|#define OBJ_NAME_ALIAS 0x8000
  ------------------
  198|    424|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    424|#define OBJ_NAME_ALIAS 0x8000
  ------------------
  199|       |
  200|    424|    onp = OPENSSL_malloc(sizeof(*onp));
  ------------------
  |  |  106|    424|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  201|    424|    if (onp == NULL)
  ------------------
  |  Branch (201:9): [True: 0, False: 424]
  ------------------
  202|      0|        return 0;
  203|       |
  204|    424|    onp->name = name;
  205|    424|    onp->alias = alias;
  206|    424|    onp->type = type;
  207|    424|    onp->data = data;
  208|       |
  209|    424|    if (!CRYPTO_THREAD_write_lock(obj_lock)) {
  ------------------
  |  Branch (209:9): [True: 0, False: 424]
  ------------------
  210|      0|        OPENSSL_free(onp);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  211|      0|        return 0;
  212|      0|    }
  213|       |
  214|    424|    ret = lh_OBJ_NAME_insert(names_lh, onp);
  215|    424|    if (ret != NULL) {
  ------------------
  |  Branch (215:9): [True: 182, False: 242]
  ------------------
  216|       |        /* free things */
  217|    182|        if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (217:13): [True: 0, False: 182]
  ------------------
  218|      0|            && (sk_NAME_FUNCS_num(name_funcs_stack) > ret->type)) {
  ------------------
  |  Branch (218:16): [True: 0, False: 0]
  ------------------
  219|       |            /*
  220|       |             * XXX: I'm not sure I understand why the free function should
  221|       |             * get three arguments... -- Richard Levitte
  222|       |             */
  223|      0|            sk_NAME_FUNCS_value(name_funcs_stack,
  224|      0|                ret->type)
  225|      0|                ->free_func(ret->name, ret->type,
  226|      0|                    ret->data);
  227|      0|        }
  228|    182|        OPENSSL_free(ret);
  ------------------
  |  |  131|    182|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  229|    242|    } else {
  230|    242|        if (lh_OBJ_NAME_error(names_lh)) {
  ------------------
  |  Branch (230:13): [True: 0, False: 242]
  ------------------
  231|       |            /* ERROR */
  232|      0|            OPENSSL_free(onp);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  233|      0|            goto unlock;
  234|      0|        }
  235|    242|    }
  236|       |
  237|    424|    ok = 1;
  238|       |
  239|    424|unlock:
  240|    424|    CRYPTO_THREAD_unlock(obj_lock);
  241|    424|    return ok;
  242|    424|}
OBJ_NAME_remove:
  245|    242|{
  246|    242|    OBJ_NAME on, *ret;
  247|    242|    int ok = 0;
  248|       |
  249|    242|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (249:9): [True: 0, False: 242]
  ------------------
  250|      0|        return 0;
  251|       |
  252|    242|    if (!CRYPTO_THREAD_write_lock(obj_lock))
  ------------------
  |  Branch (252:9): [True: 0, False: 242]
  ------------------
  253|      0|        return 0;
  254|       |
  255|    242|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    242|#define OBJ_NAME_ALIAS 0x8000
  ------------------
  256|    242|    on.name = name;
  257|    242|    on.type = type;
  258|    242|    ret = lh_OBJ_NAME_delete(names_lh, &on);
  259|    242|    if (ret != NULL) {
  ------------------
  |  Branch (259:9): [True: 242, False: 0]
  ------------------
  260|       |        /* free things */
  261|    242|        if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (261:13): [True: 0, False: 242]
  ------------------
  262|      0|            && (sk_NAME_FUNCS_num(name_funcs_stack) > ret->type)) {
  ------------------
  |  Branch (262:16): [True: 0, False: 0]
  ------------------
  263|       |            /*
  264|       |             * XXX: I'm not sure I understand why the free function should
  265|       |             * get three arguments... -- Richard Levitte
  266|       |             */
  267|      0|            sk_NAME_FUNCS_value(name_funcs_stack,
  268|      0|                ret->type)
  269|      0|                ->free_func(ret->name, ret->type,
  270|      0|                    ret->data);
  271|      0|        }
  272|    242|        OPENSSL_free(ret);
  ------------------
  |  |  131|    242|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  273|    242|        ok = 1;
  274|    242|    }
  275|       |
  276|    242|    CRYPTO_THREAD_unlock(obj_lock);
  277|    242|    return ok;
  278|    242|}
OBJ_NAME_do_all:
  296|  1.26k|{
  297|  1.26k|    OBJ_DOALL d;
  298|       |
  299|  1.26k|    d.type = type;
  300|  1.26k|    d.fn = fn;
  301|  1.26k|    d.arg = arg;
  302|       |
  303|  1.26k|    lh_OBJ_NAME_doall_OBJ_DOALL(names_lh, do_all_fn, &d);
  304|  1.26k|}
OBJ_NAME_cleanup:
  370|      4|{
  371|      4|    unsigned long down_load;
  372|       |
  373|      4|    if (names_lh == NULL)
  ------------------
  |  Branch (373:9): [True: 0, False: 4]
  ------------------
  374|      0|        return;
  375|       |
  376|      4|    free_type = type;
  377|      4|    down_load = lh_OBJ_NAME_get_down_load(names_lh);
  378|      4|    lh_OBJ_NAME_set_down_load(names_lh, 0);
  379|       |
  380|      4|    lh_OBJ_NAME_doall(names_lh, names_lh_free_doall);
  381|      4|    if (type < 0) {
  ------------------
  |  Branch (381:9): [True: 1, False: 3]
  ------------------
  382|      1|        lh_OBJ_NAME_free(names_lh);
  383|      1|        sk_NAME_FUNCS_pop_free(name_funcs_stack, name_funcs_free);
  384|      1|        CRYPTO_THREAD_lock_free(obj_lock);
  385|      1|        names_lh = NULL;
  386|      1|        name_funcs_stack = NULL;
  387|      1|        obj_lock = NULL;
  388|      1|    } else
  389|      3|        lh_OBJ_NAME_set_down_load(names_lh, down_load);
  390|      4|}
o_names.c:o_names_init:
   51|      1|{
   52|      1|    names_lh = NULL;
   53|      1|    obj_lock = CRYPTO_THREAD_lock_new();
   54|      1|    if (obj_lock != NULL)
  ------------------
  |  Branch (54:9): [True: 1, False: 0]
  ------------------
   55|      1|        names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
   56|      1|    if (names_lh == NULL) {
  ------------------
  |  Branch (56:9): [True: 0, False: 1]
  ------------------
   57|      0|        CRYPTO_THREAD_lock_free(obj_lock);
   58|      0|        obj_lock = NULL;
   59|      0|    }
   60|      1|    return names_lh != NULL && obj_lock != NULL;
  ------------------
  |  Branch (60:12): [True: 1, False: 0]
  |  Branch (60:32): [True: 1, False: 0]
  ------------------
   61|      1|}
o_names.c:obj_name_hash:
  137|   685k|{
  138|   685k|    unsigned long ret;
  139|       |
  140|   685k|    if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (140:9): [True: 0, False: 685k]
  ------------------
  141|      0|        && (sk_NAME_FUNCS_num(name_funcs_stack) > a->type)) {
  ------------------
  |  Branch (141:12): [True: 0, False: 0]
  ------------------
  142|      0|        ret = sk_NAME_FUNCS_value(name_funcs_stack,
  143|      0|            a->type)
  144|      0|                  ->hash_func(a->name);
  145|   685k|    } else {
  146|   685k|        ret = ossl_lh_strcasehash(a->name);
  147|   685k|    }
  148|   685k|    ret ^= a->type;
  149|   685k|    return ret;
  150|   685k|}
o_names.c:obj_name_cmp:
  120|   586k|{
  121|   586k|    int ret;
  122|       |
  123|   586k|    ret = a->type - b->type;
  124|   586k|    if (ret == 0) {
  ------------------
  |  Branch (124:9): [True: 586k, False: 0]
  ------------------
  125|   586k|        if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (125:13): [True: 0, False: 586k]
  ------------------
  126|      0|            && (sk_NAME_FUNCS_num(name_funcs_stack) > a->type)) {
  ------------------
  |  Branch (126:16): [True: 0, False: 0]
  ------------------
  127|      0|            ret = sk_NAME_FUNCS_value(name_funcs_stack,
  128|      0|                a->type)
  129|      0|                      ->cmp_func(a->name, b->name);
  130|      0|        } else
  131|   586k|            ret = OPENSSL_strcasecmp(a->name, b->name);
  132|   586k|    }
  133|   586k|    return ret;
  134|   586k|}
o_names.c:do_all_fn:
  287|   305k|{
  288|   305k|    if (name->type == d->type)
  ------------------
  |  Branch (288:9): [True: 152k, False: 152k]
  ------------------
  289|   152k|        d->fn(name, d->arg);
  290|   305k|}
o_names.c:names_lh_free_doall:
  356|    543|{
  357|    543|    if (onp == NULL)
  ------------------
  |  Branch (357:9): [True: 0, False: 543]
  ------------------
  358|      0|        return;
  359|       |
  360|    543|    if (free_type < 0 || free_type == onp->type)
  ------------------
  |  Branch (360:9): [True: 0, False: 543]
  |  Branch (360:26): [True: 242, False: 301]
  ------------------
  361|    242|        OBJ_NAME_remove(onp->name, onp->type);
  362|    543|}

ossl_obj_cleanup_int:
  229|      1|{
  230|      1|    if (added != NULL) {
  ------------------
  |  Branch (230:9): [True: 1, False: 0]
  ------------------
  231|      1|        lh_ADDED_OBJ_set_down_load(added, 0);
  232|      1|        lh_ADDED_OBJ_doall(added, cleanup1_doall); /* zero counters */
  233|      1|        lh_ADDED_OBJ_doall(added, cleanup2_doall); /* set counters */
  234|      1|        lh_ADDED_OBJ_doall(added, cleanup3_doall); /* free objects */
  235|      1|        lh_ADDED_OBJ_free(added);
  236|       |        added = NULL;
  237|      1|    }
  238|      1|    objs_free_locks();
  239|      1|}
OBJ_nid2obj:
  258|  19.2M|{
  259|  19.2M|    ADDED_OBJ ad, *adp = NULL;
  260|  19.2M|    ASN1_OBJECT ob;
  261|       |
  262|  19.2M|    if (n == NID_undef
  ------------------
  |  |   18|  38.4M|#define NID_undef                       0
  ------------------
  |  Branch (262:9): [True: 9.45M, False: 9.75M]
  ------------------
  263|  9.75M|        || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  | 1358|  19.5M|#define NUM_NID 1501
  ------------------
                      || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  |   18|  9.75M|#define NID_undef                       0
  ------------------
  |  Branch (263:13): [True: 9.75M, False: 0]
  |  Branch (263:22): [True: 9.75M, False: 0]
  |  Branch (263:37): [True: 9.75M, False: 0]
  ------------------
  264|  19.2M|        return (ASN1_OBJECT *)&(nid_objs[n]);
  265|       |
  266|      0|    ad.type = ADDED_NID;
  ------------------
  |  |   33|      0|#define ADDED_NID 3
  ------------------
  267|      0|    ad.obj = &ob;
  268|      0|    ob.nid = n;
  269|      0|    if (!ossl_obj_read_lock()) {
  ------------------
  |  Branch (269:9): [True: 0, False: 0]
  ------------------
  270|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  271|      0|        return NULL;
  272|      0|    }
  273|      0|    adp = lh_ADDED_OBJ_retrieve(added, &ad);
  274|      0|    ossl_obj_unlock();
  275|      0|    if (adp != NULL)
  ------------------
  |  Branch (275:9): [True: 0, False: 0]
  ------------------
  276|      0|        return adp->obj;
  277|       |
  278|      0|    ERR_raise(ERR_LIB_OBJ, OBJ_R_UNKNOWN_NID);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  279|       |    return NULL;
  280|      0|}
OBJ_nid2sn:
  283|  1.61M|{
  284|  1.61M|    ASN1_OBJECT *ob = OBJ_nid2obj(n);
  285|       |
  286|  1.61M|    return ob == NULL ? NULL : ob->sn;
  ------------------
  |  Branch (286:12): [True: 0, False: 1.61M]
  ------------------
  287|  1.61M|}
OBJ_nid2ln:
  290|   960k|{
  291|   960k|    ASN1_OBJECT *ob = OBJ_nid2obj(n);
  292|       |
  293|   960k|    return ob == NULL ? NULL : ob->ln;
  ------------------
  |  Branch (293:12): [True: 0, False: 960k]
  ------------------
  294|   960k|}
OBJ_txt2obj:
  348|  59.4k|{
  349|  59.4k|    int nid = NID_undef;
  ------------------
  |  |   18|  59.4k|#define NID_undef                       0
  ------------------
  350|  59.4k|    ASN1_OBJECT *op = NULL;
  351|  59.4k|    unsigned char *buf;
  352|  59.4k|    unsigned char *p;
  353|  59.4k|    const unsigned char *cp;
  354|  59.4k|    int i, j;
  355|       |
  356|  59.4k|    if (!no_name) {
  ------------------
  |  Branch (356:9): [True: 52.0k, False: 7.43k]
  ------------------
  357|  52.0k|        if ((nid = OBJ_sn2nid(s)) != NID_undef
  ------------------
  |  |   18|   104k|#define NID_undef                       0
  ------------------
  |  Branch (357:13): [True: 0, False: 52.0k]
  ------------------
  358|  52.0k|            || (nid = OBJ_ln2nid(s)) != NID_undef) {
  ------------------
  |  |   18|  52.0k|#define NID_undef                       0
  ------------------
  |  Branch (358:16): [True: 52.0k, False: 0]
  ------------------
  359|  52.0k|            return OBJ_nid2obj(nid);
  360|  52.0k|        }
  361|      0|        if (!ossl_isdigit(*s)) {
  ------------------
  |  Branch (361:13): [True: 0, False: 0]
  ------------------
  362|      0|            ERR_raise(ERR_LIB_OBJ, OBJ_R_UNKNOWN_OBJECT_NAME);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  363|      0|            return NULL;
  364|      0|        }
  365|      0|    }
  366|       |
  367|       |    /* Work out size of content octets */
  368|  7.43k|    i = a2d_ASN1_OBJECT(NULL, 0, s, -1);
  369|  7.43k|    if (i <= 0)
  ------------------
  |  Branch (369:9): [True: 0, False: 7.43k]
  ------------------
  370|      0|        return NULL;
  371|       |
  372|       |    /* Work out total size */
  373|  7.43k|    j = ASN1_object_size(0, i, V_ASN1_OBJECT);
  ------------------
  |  |   70|  7.43k|#define V_ASN1_OBJECT 6
  ------------------
  374|  7.43k|    if (j < 0)
  ------------------
  |  Branch (374:9): [True: 0, False: 7.43k]
  ------------------
  375|      0|        return NULL;
  376|       |
  377|  7.43k|    if ((buf = OPENSSL_malloc(j)) == NULL)
  ------------------
  |  |  106|  7.43k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (377:9): [True: 0, False: 7.43k]
  ------------------
  378|      0|        return NULL;
  379|       |
  380|  7.43k|    p = buf;
  381|       |    /* Write out tag+length */
  382|  7.43k|    ASN1_put_object(&p, 0, i, V_ASN1_OBJECT, V_ASN1_UNIVERSAL);
  ------------------
  |  |   70|  7.43k|#define V_ASN1_OBJECT 6
  ------------------
                  ASN1_put_object(&p, 0, i, V_ASN1_OBJECT, V_ASN1_UNIVERSAL);
  ------------------
  |  |   49|  7.43k|#define V_ASN1_UNIVERSAL 0x00
  ------------------
  383|       |    /* Write out contents */
  384|  7.43k|    a2d_ASN1_OBJECT(p, i, s, -1);
  385|       |
  386|  7.43k|    cp = buf;
  387|  7.43k|    op = d2i_ASN1_OBJECT(NULL, &cp, j);
  388|  7.43k|    OPENSSL_free(buf);
  ------------------
  |  |  131|  7.43k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  389|  7.43k|    return op;
  390|  7.43k|}
OBJ_obj2txt:
  393|   957k|{
  394|   957k|    int i, n = 0, len, nid, first, use_bn;
  395|   957k|    BIGNUM *bl;
  396|   957k|    unsigned long l;
  397|   957k|    const unsigned char *p;
  398|   957k|    char tbuf[DECIMAL_SIZE(i) + DECIMAL_SIZE(l) + 2];
  399|   957k|    const char *s;
  400|       |
  401|       |    /* Ensure that, at every state, |buf| is NUL-terminated. */
  402|   957k|    if (buf != NULL && buf_len > 0)
  ------------------
  |  Branch (402:9): [True: 957k, False: 0]
  |  Branch (402:24): [True: 957k, False: 0]
  ------------------
  403|   957k|        buf[0] = '\0';
  404|       |
  405|   957k|    if (a == NULL || a->data == NULL)
  ------------------
  |  Branch (405:9): [True: 0, False: 957k]
  |  Branch (405:22): [True: 632, False: 956k]
  ------------------
  406|    632|        return 0;
  407|       |
  408|   956k|    if (!no_name && (nid = OBJ_obj2nid(a)) != NID_undef) {
  ------------------
  |  |   18|   824k|#define NID_undef                       0
  ------------------
  |  Branch (408:9): [True: 824k, False: 132k]
  |  Branch (408:21): [True: 824k, False: 0]
  ------------------
  409|   824k|        s = OBJ_nid2ln(nid);
  410|   824k|        if (s == NULL)
  ------------------
  |  Branch (410:13): [True: 0, False: 824k]
  ------------------
  411|      0|            s = OBJ_nid2sn(nid);
  412|   824k|        if (s != NULL) {
  ------------------
  |  Branch (412:13): [True: 824k, False: 0]
  ------------------
  413|   824k|            if (buf != NULL)
  ------------------
  |  Branch (413:17): [True: 824k, False: 0]
  ------------------
  414|   824k|                OPENSSL_strlcpy(buf, s, buf_len);
  415|   824k|            return (int)strlen(s);
  416|   824k|        }
  417|   824k|    }
  418|       |
  419|   132k|    len = a->length;
  420|   132k|    p = a->data;
  421|       |
  422|   132k|    first = 1;
  423|   132k|    bl = NULL;
  424|       |
  425|       |    /*
  426|       |     * RFC 2578 (STD 58) says this about OBJECT IDENTIFIERs:
  427|       |     *
  428|       |     * > 3.5. OBJECT IDENTIFIER values
  429|       |     * >
  430|       |     * > An OBJECT IDENTIFIER value is an ordered list of non-negative
  431|       |     * > numbers. For the SMIv2, each number in the list is referred to as a
  432|       |     * > sub-identifier, there are at most 128 sub-identifiers in a value,
  433|       |     * > and each sub-identifier has a maximum value of 2^32-1 (4294967295
  434|       |     * > decimal).
  435|       |     *
  436|       |     * So a legitimate OID according to this RFC is at most (32 * 128 / 7),
  437|       |     * i.e. 586 bytes long.
  438|       |     *
  439|       |     * Ref: https://datatracker.ietf.org/doc/html/rfc2578#section-3.5
  440|       |     */
  441|   132k|    if (len > 586)
  ------------------
  |  Branch (441:9): [True: 0, False: 132k]
  ------------------
  442|      0|        goto err;
  443|       |
  444|  1.00M|    while (len > 0) {
  ------------------
  |  Branch (444:12): [True: 872k, False: 132k]
  ------------------
  445|   872k|        l = 0;
  446|   872k|        use_bn = 0;
  447|  1.07M|        for (;;) {
  448|  1.07M|            unsigned char c = *p++;
  449|       |
  450|  1.07M|            len--;
  451|  1.07M|            if (len == 0 && (c & 0x80) != 0)
  ------------------
  |  Branch (451:17): [True: 132k, False: 944k]
  |  Branch (451:29): [True: 0, False: 132k]
  ------------------
  452|      0|                goto err;
  453|  1.07M|            if (use_bn) {
  ------------------
  |  Branch (453:17): [True: 0, False: 1.07M]
  ------------------
  454|      0|                if (!BN_add_word(bl, c & 0x7f))
  ------------------
  |  Branch (454:21): [True: 0, False: 0]
  ------------------
  455|      0|                    goto err;
  456|  1.07M|            } else {
  457|  1.07M|                l |= c & 0x7f;
  458|  1.07M|            }
  459|  1.07M|            if ((c & 0x80) == 0)
  ------------------
  |  Branch (459:17): [True: 872k, False: 203k]
  ------------------
  460|   872k|                break;
  461|   203k|            if (!use_bn && l > (ULONG_MAX >> 7L)) {
  ------------------
  |  Branch (461:17): [True: 203k, False: 0]
  |  Branch (461:28): [True: 0, False: 203k]
  ------------------
  462|      0|                if (bl == NULL && (bl = BN_new()) == NULL)
  ------------------
  |  Branch (462:21): [True: 0, False: 0]
  |  Branch (462:35): [True: 0, False: 0]
  ------------------
  463|      0|                    goto err;
  464|      0|                if (!BN_set_word(bl, l))
  ------------------
  |  Branch (464:21): [True: 0, False: 0]
  ------------------
  465|      0|                    goto err;
  466|      0|                use_bn = 1;
  467|      0|            }
  468|   203k|            if (use_bn) {
  ------------------
  |  Branch (468:17): [True: 0, False: 203k]
  ------------------
  469|      0|                if (!BN_lshift(bl, bl, 7))
  ------------------
  |  Branch (469:21): [True: 0, False: 0]
  ------------------
  470|      0|                    goto err;
  471|   203k|            } else {
  472|   203k|                l <<= 7L;
  473|   203k|            }
  474|   203k|        }
  475|       |
  476|   872k|        if (first) {
  ------------------
  |  Branch (476:13): [True: 132k, False: 740k]
  ------------------
  477|   132k|            first = 0;
  478|   132k|            if (l >= 80) {
  ------------------
  |  Branch (478:17): [True: 51.1k, False: 80.8k]
  ------------------
  479|  51.1k|                i = 2;
  480|  51.1k|                if (use_bn) {
  ------------------
  |  Branch (480:21): [True: 0, False: 51.1k]
  ------------------
  481|      0|                    if (!BN_sub_word(bl, 80))
  ------------------
  |  Branch (481:25): [True: 0, False: 0]
  ------------------
  482|      0|                        goto err;
  483|  51.1k|                } else {
  484|  51.1k|                    l -= 80;
  485|  51.1k|                }
  486|  80.8k|            } else {
  487|  80.8k|                i = (int)(l / 40);
  488|  80.8k|                l -= (long)(i * 40);
  489|  80.8k|            }
  490|   132k|            if (buf != NULL && buf_len > 1) {
  ------------------
  |  Branch (490:17): [True: 132k, False: 0]
  |  Branch (490:32): [True: 132k, False: 0]
  ------------------
  491|   132k|                *buf++ = i + '0';
  492|   132k|                *buf = '\0';
  493|   132k|                buf_len--;
  494|   132k|            }
  495|   132k|            n++;
  496|   132k|        }
  497|       |
  498|   872k|        if (use_bn) {
  ------------------
  |  Branch (498:13): [True: 0, False: 872k]
  ------------------
  499|      0|            char *bndec;
  500|      0|            bndec = BN_bn2dec(bl);
  501|      0|            if (!bndec)
  ------------------
  |  Branch (501:17): [True: 0, False: 0]
  ------------------
  502|      0|                goto err;
  503|      0|            i = (int)strlen(bndec);
  504|      0|            if (buf != NULL) {
  ------------------
  |  Branch (504:17): [True: 0, False: 0]
  ------------------
  505|      0|                if (buf_len > 1) {
  ------------------
  |  Branch (505:21): [True: 0, False: 0]
  ------------------
  506|      0|                    *buf++ = '.';
  507|      0|                    *buf = '\0';
  508|      0|                    buf_len--;
  509|      0|                }
  510|      0|                OPENSSL_strlcpy(buf, bndec, buf_len);
  511|      0|                if (i > buf_len) {
  ------------------
  |  Branch (511:21): [True: 0, False: 0]
  ------------------
  512|      0|                    buf += buf_len;
  513|      0|                    buf_len = 0;
  514|      0|                } else {
  515|      0|                    buf += i;
  516|      0|                    buf_len -= i;
  517|      0|                }
  518|      0|            }
  519|      0|            n++;
  520|      0|            n += i;
  521|      0|            OPENSSL_free(bndec);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  522|   872k|        } else {
  523|   872k|            BIO_snprintf(tbuf, sizeof(tbuf), ".%lu", l);
  524|   872k|            i = (int)strlen(tbuf);
  525|   872k|            if (buf && buf_len > 0) {
  ------------------
  |  Branch (525:17): [True: 872k, False: 0]
  |  Branch (525:24): [True: 872k, False: 0]
  ------------------
  526|   872k|                OPENSSL_strlcpy(buf, tbuf, buf_len);
  527|   872k|                if (i > buf_len) {
  ------------------
  |  Branch (527:21): [True: 0, False: 872k]
  ------------------
  528|      0|                    buf += buf_len;
  529|      0|                    buf_len = 0;
  530|   872k|                } else {
  531|   872k|                    buf += i;
  532|   872k|                    buf_len -= i;
  533|   872k|                }
  534|   872k|            }
  535|   872k|            n += i;
  536|   872k|            l = 0;
  537|   872k|        }
  538|   872k|    }
  539|       |
  540|   132k|    BN_free(bl);
  541|   132k|    return n;
  542|       |
  543|      0|err:
  544|      0|    BN_free(bl);
  545|      0|    return -1;
  546|   132k|}
OBJ_txt2nid:
  549|  52.0k|{
  550|  52.0k|    ASN1_OBJECT *obj = OBJ_txt2obj(s, 0);
  551|  52.0k|    int nid = NID_undef;
  ------------------
  |  |   18|  52.0k|#define NID_undef                       0
  ------------------
  552|       |
  553|  52.0k|    if (obj != NULL) {
  ------------------
  |  Branch (553:9): [True: 52.0k, False: 0]
  ------------------
  554|  52.0k|        nid = OBJ_obj2nid(obj);
  555|  52.0k|        ASN1_OBJECT_free(obj);
  556|  52.0k|    }
  557|  52.0k|    return nid;
  558|  52.0k|}
OBJ_ln2nid:
  561|   100k|{
  562|   100k|    ASN1_OBJECT o;
  563|   100k|    const ASN1_OBJECT *oo = &o;
  564|   100k|    ADDED_OBJ ad, *adp;
  565|   100k|    const unsigned int *op;
  566|   100k|    int nid = NID_undef;
  ------------------
  |  |   18|   100k|#define NID_undef                       0
  ------------------
  567|       |
  568|   100k|    o.ln = s;
  569|   100k|    op = OBJ_bsearch_ln(&oo, ln_objs, NUM_LN);
  ------------------
  |  | 4359|   100k|#define NUM_LN 1492
  ------------------
  570|   100k|    if (op != NULL)
  ------------------
  |  Branch (570:9): [True: 64.7k, False: 36.0k]
  ------------------
  571|  64.7k|        return nid_objs[*op].nid;
  572|  36.0k|    if (!ossl_obj_read_lock()) {
  ------------------
  |  Branch (572:9): [True: 0, False: 36.0k]
  ------------------
  573|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  574|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  575|      0|    }
  576|  36.0k|    ad.type = ADDED_LNAME;
  ------------------
  |  |   32|  36.0k|#define ADDED_LNAME 2
  ------------------
  577|  36.0k|    ad.obj = &o;
  578|  36.0k|    adp = lh_ADDED_OBJ_retrieve(added, &ad);
  579|  36.0k|    if (adp != NULL)
  ------------------
  |  Branch (579:9): [True: 0, False: 36.0k]
  ------------------
  580|      0|        nid = adp->obj->nid;
  581|  36.0k|    ossl_obj_unlock();
  582|  36.0k|    return nid;
  583|  36.0k|}
OBJ_sn2nid:
  586|   110k|{
  587|   110k|    ASN1_OBJECT o;
  588|   110k|    const ASN1_OBJECT *oo = &o;
  589|   110k|    ADDED_OBJ ad, *adp;
  590|   110k|    const unsigned int *op;
  591|   110k|    int nid = NID_undef;
  ------------------
  |  |   18|   110k|#define NID_undef                       0
  ------------------
  592|       |
  593|   110k|    o.sn = s;
  594|   110k|    op = OBJ_bsearch_sn(&oo, sn_objs, NUM_SN);
  ------------------
  |  | 2863|   110k|#define NUM_SN 1492
  ------------------
  595|   110k|    if (op != NULL)
  ------------------
  |  Branch (595:9): [True: 17.0k, False: 93.7k]
  ------------------
  596|  17.0k|        return nid_objs[*op].nid;
  597|  93.7k|    if (!ossl_obj_read_lock()) {
  ------------------
  |  Branch (597:9): [True: 0, False: 93.7k]
  ------------------
  598|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  599|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  600|      0|    }
  601|  93.7k|    ad.type = ADDED_SNAME;
  ------------------
  |  |   31|  93.7k|#define ADDED_SNAME 1
  ------------------
  602|  93.7k|    ad.obj = &o;
  603|  93.7k|    adp = lh_ADDED_OBJ_retrieve(added, &ad);
  604|  93.7k|    if (adp != NULL)
  ------------------
  |  Branch (604:9): [True: 0, False: 93.7k]
  ------------------
  605|      0|        nid = adp->obj->nid;
  606|  93.7k|    ossl_obj_unlock();
  607|  93.7k|    return nid;
  608|  93.7k|}
OBJ_bsearch_:
  612|  10.8M|{
  613|  10.8M|    return OBJ_bsearch_ex_(key, base, num, size, cmp, 0);
  614|  10.8M|}
OBJ_bsearch_ex_:
  620|  10.8M|{
  621|  10.8M|    const char *p = ossl_bsearch(key, base, num, size, cmp, flags);
  622|       |
  623|       |#ifdef CHARSET_EBCDIC
  624|       |    /*
  625|       |     * THIS IS A KLUDGE - Because the *_obj is sorted in ASCII order, and I
  626|       |     * don't have perl (yet), we revert to a *LINEAR* search when the object
  627|       |     * wasn't found in the binary search.
  628|       |     */
  629|       |    if (p == NULL) {
  630|       |        const char *base_ = base;
  631|       |        int l, h, i = 0, c = 0;
  632|       |        char *p1;
  633|       |
  634|       |        for (i = 0; i < num; ++i) {
  635|       |            p1 = &(base_[i * size]);
  636|       |            c = (*cmp)(key, p1);
  637|       |            if (c == 0
  638|       |                || (c < 0 && (flags & OBJ_BSEARCH_VALUE_ON_NOMATCH)))
  639|       |                return p1;
  640|       |        }
  641|       |    }
  642|       |#endif
  643|  10.8M|    return p;
  644|  10.8M|}
OBJ_create:
  700|  7.43k|{
  701|  7.43k|    ASN1_OBJECT *tmpoid = NULL;
  702|  7.43k|    int ok = NID_undef;
  ------------------
  |  |   18|  7.43k|#define NID_undef                       0
  ------------------
  703|       |
  704|       |    /* With no arguments at all, nothing can be done */
  705|  7.43k|    if (oid == NULL && sn == NULL && ln == NULL) {
  ------------------
  |  Branch (705:9): [True: 0, False: 7.43k]
  |  Branch (705:24): [True: 0, False: 0]
  |  Branch (705:38): [True: 0, False: 0]
  ------------------
  706|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  707|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  708|      0|    }
  709|       |
  710|       |    /* Check to see if short or long name already present */
  711|  7.43k|    if ((sn != NULL && OBJ_sn2nid(sn) != NID_undef)
  ------------------
  |  |   18|  7.43k|#define NID_undef                       0
  ------------------
  |  Branch (711:10): [True: 7.43k, False: 0]
  |  Branch (711:24): [True: 0, False: 7.43k]
  ------------------
  712|  7.43k|        || (ln != NULL && OBJ_ln2nid(ln) != NID_undef)) {
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (712:13): [True: 0, False: 7.43k]
  |  Branch (712:27): [True: 0, False: 0]
  ------------------
  713|      0|        ERR_raise(ERR_LIB_OBJ, OBJ_R_OID_EXISTS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  714|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  715|      0|    }
  716|       |
  717|  7.43k|    if (oid != NULL) {
  ------------------
  |  Branch (717:9): [True: 7.43k, False: 0]
  ------------------
  718|       |        /* Convert numerical OID string to an ASN1_OBJECT structure */
  719|  7.43k|        tmpoid = OBJ_txt2obj(oid, 1);
  720|  7.43k|        if (tmpoid == NULL)
  ------------------
  |  Branch (720:13): [True: 0, False: 7.43k]
  ------------------
  721|      0|            return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  722|  7.43k|    } else {
  723|       |        /* Create a no-OID ASN1_OBJECT */
  724|      0|        tmpoid = ASN1_OBJECT_new();
  725|      0|        if (tmpoid == NULL) {
  ------------------
  |  Branch (725:13): [True: 0, False: 0]
  ------------------
  726|      0|            ERR_raise(ERR_LIB_OBJ, ERR_R_ASN1_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  727|      0|            return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  728|      0|        }
  729|      0|    }
  730|       |
  731|       |    /* If NID is not NID_undef then object already exists */
  732|  7.43k|    if (oid != NULL
  ------------------
  |  Branch (732:9): [True: 7.43k, False: 0]
  ------------------
  733|  7.43k|        && ossl_obj_obj2nid(tmpoid) != NID_undef) {
  ------------------
  |  |   18|  7.43k|#define NID_undef                       0
  ------------------
  |  Branch (733:12): [True: 7.43k, False: 0]
  ------------------
  734|  7.43k|        ERR_raise(ERR_LIB_OBJ, OBJ_R_OID_EXISTS);
  ------------------
  |  |  404|  7.43k|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|  7.43k|    (ERR_new(),                                                  \
  |  |  |  |  407|  7.43k|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|  7.43k|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|  7.43k|        ERR_set_error)
  |  |  ------------------
  ------------------
  735|  7.43k|        goto err;
  736|  7.43k|    }
  737|       |
  738|      0|    tmpoid->nid = NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  739|      0|    tmpoid->sn = (char *)sn;
  740|      0|    tmpoid->ln = (char *)ln;
  741|       |
  742|      0|    ok = add_object(tmpoid, 1);
  743|       |
  744|      0|    tmpoid->sn = NULL;
  745|      0|    tmpoid->ln = NULL;
  746|       |
  747|  7.43k|err:
  748|  7.43k|    ASN1_OBJECT_free(tmpoid);
  749|  7.43k|    return ok;
  750|      0|}
OBJ_length:
  753|   101k|{
  754|   101k|    if (obj == NULL)
  ------------------
  |  Branch (754:9): [True: 0, False: 101k]
  ------------------
  755|      0|        return 0;
  756|   101k|    return obj->length;
  757|   101k|}
OBJ_get0_data:
  760|   100k|{
  761|   100k|    if (obj == NULL)
  ------------------
  |  Branch (761:9): [True: 0, False: 100k]
  ------------------
  762|      0|        return NULL;
  763|   100k|    return obj->data;
  764|   100k|}
OBJ_obj2nid:
  868|  27.0M|{
  869|  27.0M|    return ossl_obj_obj2nid(a);
  870|  27.0M|}
obj_dat.c:objs_free_locks:
   53|      1|{
   54|      1|    CRYPTO_THREAD_lock_free(ossl_obj_lock);
   55|      1|    ossl_obj_lock = NULL;
   56|       |#ifdef TSAN_REQUIRES_LOCKING
   57|       |    CRYPTO_THREAD_lock_free(ossl_obj_nid_lock);
   58|       |    ossl_obj_nid_lock = NULL;
   59|       |#endif
   60|      1|}
obj_dat.c:ossl_obj_read_lock:
  101|   492k|{
  102|   492k|    if (!ossl_init_added_api())
  ------------------
  |  Branch (102:9): [True: 0, False: 492k]
  ------------------
  103|      0|        return 0;
  104|   492k|    return CRYPTO_THREAD_read_lock(ossl_obj_lock);
  105|   492k|}
obj_dat.c:ossl_init_added_api:
   85|   492k|{
   86|   492k|#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
   87|       |    /* Make sure we've loaded config before checking for any "added" objects */
   88|   492k|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  510|   492k|#define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
  ------------------
   89|   492k|#endif
   90|   492k|    return RUN_ONCE(&ossl_obj_api_init, obj_api_initialise);
  ------------------
  |  |  130|   492k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 492k, False: 0]
  |  |  ------------------
  ------------------
   91|   492k|}
obj_dat.c:obj_api_initialise:
   63|      1|{
   64|      1|    ossl_obj_lock = CRYPTO_THREAD_lock_new();
   65|      1|    if (ossl_obj_lock == NULL)
  ------------------
  |  Branch (65:9): [True: 0, False: 1]
  ------------------
   66|      0|        return 0;
   67|       |
   68|       |#ifdef TSAN_REQUIRES_LOCKING
   69|       |    ossl_obj_nid_lock = CRYPTO_THREAD_lock_new();
   70|       |    if (ossl_obj_nid_lock == NULL) {
   71|       |        objs_free_locks();
   72|       |        return 0;
   73|       |    }
   74|       |#endif
   75|      1|    added = lh_ADDED_OBJ_new(added_obj_hash, added_obj_cmp);
   76|      1|    if (added == NULL) {
  ------------------
  |  Branch (76:9): [True: 0, False: 1]
  ------------------
   77|      0|        objs_free_locks();
   78|      0|        return 0;
   79|      0|    }
   80|       |
   81|      1|    return 1;
   82|      1|}
obj_dat.c:added_obj_hash:
  127|   492k|{
  128|   492k|    const ASN1_OBJECT *a;
  129|   492k|    int i;
  130|   492k|    unsigned long ret = 0;
  131|   492k|    unsigned char *p;
  132|       |
  133|   492k|    a = ca->obj;
  134|   492k|    switch (ca->type) {
  135|   362k|    case ADDED_DATA:
  ------------------
  |  |   30|   362k|#define ADDED_DATA 0
  ------------------
  |  Branch (135:5): [True: 362k, False: 129k]
  ------------------
  136|   362k|        ret = (unsigned long)a->length << 20UL;
  137|   362k|        p = (unsigned char *)a->data;
  138|  3.62M|        for (i = 0; i < a->length; i++)
  ------------------
  |  Branch (138:21): [True: 3.26M, False: 362k]
  ------------------
  139|  3.26M|            ret ^= p[i] << ((i * 3) % 24);
  140|   362k|        break;
  141|  93.7k|    case ADDED_SNAME:
  ------------------
  |  |   31|  93.7k|#define ADDED_SNAME 1
  ------------------
  |  Branch (141:5): [True: 93.7k, False: 398k]
  ------------------
  142|  93.7k|        ret = OPENSSL_LH_strhash(a->sn);
  143|  93.7k|        break;
  144|  36.0k|    case ADDED_LNAME:
  ------------------
  |  |   32|  36.0k|#define ADDED_LNAME 2
  ------------------
  |  Branch (144:5): [True: 36.0k, False: 456k]
  ------------------
  145|  36.0k|        ret = OPENSSL_LH_strhash(a->ln);
  146|  36.0k|        break;
  147|      0|    case ADDED_NID:
  ------------------
  |  |   33|      0|#define ADDED_NID 3
  ------------------
  |  Branch (147:5): [True: 0, False: 492k]
  ------------------
  148|      0|        ret = a->nid;
  149|      0|        break;
  150|      0|    default:
  ------------------
  |  Branch (150:5): [True: 0, False: 492k]
  ------------------
  151|       |        /* abort(); */
  152|      0|        return 0;
  153|   492k|    }
  154|   492k|    ret &= 0x3fffffffL;
  155|   492k|    ret |= ((unsigned long)ca->type) << 30L;
  156|   492k|    return ret;
  157|   492k|}
obj_dat.c:ossl_obj_unlock:
  108|   492k|{
  109|   492k|    CRYPTO_THREAD_unlock(ossl_obj_lock);
  110|   492k|}
obj_dat.c:ln_cmp:
  120|  1.01M|{
  121|  1.01M|    return strcmp((*a)->ln, nid_objs[*b].ln);
  122|  1.01M|}
obj_dat.c:sn_cmp:
  113|  1.18M|{
  114|  1.18M|    return strcmp((*a)->sn, nid_objs[*b].sn);
  115|  1.18M|}
obj_dat.c:ossl_obj_obj2nid:
  313|  27.0M|{
  314|  27.0M|    int nid = NID_undef;
  ------------------
  |  |   18|  27.0M|#define NID_undef                       0
  ------------------
  315|  27.0M|    const unsigned int *op;
  316|  27.0M|    ADDED_OBJ ad, *adp;
  317|       |
  318|  27.0M|    if (a == NULL)
  ------------------
  |  Branch (318:9): [True: 0, False: 27.0M]
  ------------------
  319|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  320|  27.0M|    if (a->nid != NID_undef)
  ------------------
  |  |   18|  27.0M|#define NID_undef                       0
  ------------------
  |  Branch (320:9): [True: 19.9M, False: 7.14M]
  ------------------
  321|  19.9M|        return a->nid;
  322|  7.14M|    if (a->length == 0)
  ------------------
  |  Branch (322:9): [True: 0, False: 7.14M]
  ------------------
  323|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  324|       |
  325|  7.14M|    op = OBJ_bsearch_obj(&a, obj_objs, NUM_OBJ);
  ------------------
  |  | 5855|  7.14M|#define NUM_OBJ 1349
  ------------------
  326|  7.14M|    if (op != NULL)
  ------------------
  |  Branch (326:9): [True: 6.78M, False: 362k]
  ------------------
  327|  6.78M|        return nid_objs[*op].nid;
  328|   362k|    if (!ossl_obj_read_lock()) {
  ------------------
  |  Branch (328:9): [True: 0, False: 362k]
  ------------------
  329|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  330|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  331|      0|    }
  332|   362k|    ad.type = ADDED_DATA;
  ------------------
  |  |   30|   362k|#define ADDED_DATA 0
  ------------------
  333|   362k|    ad.obj = (ASN1_OBJECT *)a; /* casting away const is harmless here */
  334|   362k|    adp = lh_ADDED_OBJ_retrieve(added, &ad);
  335|   362k|    if (adp != NULL)
  ------------------
  |  Branch (335:9): [True: 0, False: 362k]
  ------------------
  336|      0|        nid = adp->obj->nid;
  337|   362k|    ossl_obj_unlock();
  338|   362k|    return nid;
  339|   362k|}
obj_dat.c:obj_cmp:
  297|  70.8M|{
  298|  70.8M|    int j;
  299|  70.8M|    const ASN1_OBJECT *a = *ap;
  300|  70.8M|    const ASN1_OBJECT *b = &nid_objs[*bp];
  301|       |
  302|  70.8M|    j = (a->length - b->length);
  303|  70.8M|    if (j)
  ------------------
  |  Branch (303:9): [True: 22.0M, False: 48.8M]
  ------------------
  304|  22.0M|        return j;
  305|  48.8M|    if (a->length == 0)
  ------------------
  |  Branch (305:9): [True: 0, False: 48.8M]
  ------------------
  306|      0|        return 0;
  307|  48.8M|    return memcmp(a->data, b->data, a->length);
  308|  48.8M|}

ossl_err_load_OBJ_strings:
   28|      1|{
   29|      1|#ifndef OPENSSL_NO_ERR
   30|      1|    if (ERR_reason_error_string(OBJ_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (30:9): [True: 1, False: 0]
  ------------------
   31|      1|        ERR_load_strings_const(OBJ_str_reasons);
   32|      1|#endif
   33|      1|    return 1;
   34|      1|}

OBJ_dup:
   17|  2.98M|{
   18|  2.98M|    ASN1_OBJECT *r;
   19|       |
   20|  2.98M|    if (o == NULL)
  ------------------
  |  Branch (20:9): [True: 0, False: 2.98M]
  ------------------
   21|      0|        return NULL;
   22|       |    /* If object isn't dynamic it's an internal OID which is never freed */
   23|  2.98M|    if (!(o->flags & ASN1_OBJECT_FLAG_DYNAMIC))
  ------------------
  |  |  110|  2.98M|#define ASN1_OBJECT_FLAG_DYNAMIC 0x01 /* internal use */
  ------------------
  |  Branch (23:9): [True: 2.98M, False: 0]
  ------------------
   24|  2.98M|        return (ASN1_OBJECT *)o;
   25|       |
   26|      0|    r = ASN1_OBJECT_new();
   27|      0|    if (r == NULL) {
  ------------------
  |  Branch (27:9): [True: 0, False: 0]
  ------------------
   28|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_ASN1_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   29|      0|        return NULL;
   30|      0|    }
   31|       |
   32|       |    /* Set dynamic flags so everything gets freed up on error */
   33|       |
   34|      0|    r->flags = o->flags | (ASN1_OBJECT_FLAG_DYNAMIC | ASN1_OBJECT_FLAG_DYNAMIC_STRINGS | ASN1_OBJECT_FLAG_DYNAMIC_DATA);
  ------------------
  |  |  110|      0|#define ASN1_OBJECT_FLAG_DYNAMIC 0x01 /* internal use */
  ------------------
                  r->flags = o->flags | (ASN1_OBJECT_FLAG_DYNAMIC | ASN1_OBJECT_FLAG_DYNAMIC_STRINGS | ASN1_OBJECT_FLAG_DYNAMIC_DATA);
  ------------------
  |  |  112|      0|#define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04 /* internal use */
  ------------------
                  r->flags = o->flags | (ASN1_OBJECT_FLAG_DYNAMIC | ASN1_OBJECT_FLAG_DYNAMIC_STRINGS | ASN1_OBJECT_FLAG_DYNAMIC_DATA);
  ------------------
  |  |  113|      0|#define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */
  ------------------
   35|       |
   36|      0|    if (o->length > 0 && (r->data = OPENSSL_memdup(o->data, o->length)) == NULL)
  ------------------
  |  |  133|      0|    CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (36:9): [True: 0, False: 0]
  |  Branch (36:26): [True: 0, False: 0]
  ------------------
   37|      0|        goto err;
   38|       |
   39|      0|    r->length = o->length;
   40|      0|    r->nid = o->nid;
   41|       |
   42|      0|    if (o->ln != NULL && (r->ln = OPENSSL_strdup(o->ln)) == NULL)
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (42:9): [True: 0, False: 0]
  |  Branch (42:26): [True: 0, False: 0]
  ------------------
   43|      0|        goto err;
   44|       |
   45|      0|    if (o->sn != NULL && (r->sn = OPENSSL_strdup(o->sn)) == NULL)
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (45:9): [True: 0, False: 0]
  |  Branch (45:26): [True: 0, False: 0]
  ------------------
   46|      0|        goto err;
   47|       |
   48|      0|    return r;
   49|      0|err:
   50|      0|    ASN1_OBJECT_free(r);
   51|       |    return NULL;
   52|      0|}

OBJ_find_sigid_algs:
  104|   676k|{
  105|   676k|    return ossl_obj_find_sigid_algs(signid, pdig_nid, ppkey_nid, 1);
  106|   676k|}
OBJ_add_sigid:
  148|  7.43k|{
  149|  7.43k|    nid_triple *ntr;
  150|  7.43k|    int dnid = NID_undef, pnid = NID_undef, ret = 0;
  ------------------
  |  |   18|  7.43k|#define NID_undef                       0
  ------------------
                  int dnid = NID_undef, pnid = NID_undef, ret = 0;
  ------------------
  |  |   18|  7.43k|#define NID_undef                       0
  ------------------
  151|       |
  152|  7.43k|    if (signid == NID_undef || pkey_id == NID_undef)
  ------------------
  |  |   18|  14.8k|#define NID_undef                       0
  ------------------
                  if (signid == NID_undef || pkey_id == NID_undef)
  ------------------
  |  |   18|  7.43k|#define NID_undef                       0
  ------------------
  |  Branch (152:9): [True: 0, False: 7.43k]
  |  Branch (152:32): [True: 0, False: 7.43k]
  ------------------
  153|      0|        return 0;
  154|       |
  155|  7.43k|    if (!obj_sig_init())
  ------------------
  |  Branch (155:9): [True: 0, False: 7.43k]
  ------------------
  156|      0|        return 0;
  157|       |
  158|  7.43k|    if ((ntr = OPENSSL_malloc(sizeof(*ntr))) == NULL)
  ------------------
  |  |  106|  7.43k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (158:9): [True: 0, False: 7.43k]
  ------------------
  159|      0|        return 0;
  160|  7.43k|    ntr->sign_id = signid;
  161|  7.43k|    ntr->hash_id = dig_id;
  162|  7.43k|    ntr->pkey_id = pkey_id;
  163|       |
  164|  7.43k|    if (!CRYPTO_THREAD_write_lock(sig_lock)) {
  ------------------
  |  Branch (164:9): [True: 0, False: 7.43k]
  ------------------
  165|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_WRITE_LOCK);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  166|      0|        OPENSSL_free(ntr);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  167|      0|        return 0;
  168|      0|    }
  169|       |
  170|       |    /* Check that the entry doesn't exist or exists as desired */
  171|  7.43k|    if (ossl_obj_find_sigid_algs(signid, &dnid, &pnid, 0)) {
  ------------------
  |  Branch (171:9): [True: 7.43k, False: 0]
  ------------------
  172|  7.43k|        ret = dnid == dig_id && pnid == pkey_id;
  ------------------
  |  Branch (172:15): [True: 7.43k, False: 0]
  |  Branch (172:33): [True: 7.43k, False: 0]
  ------------------
  173|  7.43k|        goto err;
  174|  7.43k|    }
  175|       |
  176|      0|    if (sig_app == NULL) {
  ------------------
  |  Branch (176:9): [True: 0, False: 0]
  ------------------
  177|      0|        sig_app = sk_nid_triple_new(sig_sk_cmp);
  178|      0|        if (sig_app == NULL)
  ------------------
  |  Branch (178:13): [True: 0, False: 0]
  ------------------
  179|      0|            goto err;
  180|      0|    }
  181|      0|    if (sigx_app == NULL) {
  ------------------
  |  Branch (181:9): [True: 0, False: 0]
  ------------------
  182|      0|        sigx_app = sk_nid_triple_new(sigx_cmp);
  183|      0|        if (sigx_app == NULL)
  ------------------
  |  Branch (183:13): [True: 0, False: 0]
  ------------------
  184|      0|            goto err;
  185|      0|    }
  186|       |
  187|       |    /*
  188|       |     * Better might be to find where to insert the element and insert it there.
  189|       |     * This would avoid the sorting steps below.
  190|       |     */
  191|      0|    if (!sk_nid_triple_push(sig_app, ntr))
  ------------------
  |  Branch (191:9): [True: 0, False: 0]
  ------------------
  192|      0|        goto err;
  193|      0|    if (!sk_nid_triple_push(sigx_app, ntr)) {
  ------------------
  |  Branch (193:9): [True: 0, False: 0]
  ------------------
  194|      0|        ntr = NULL; /* This is referenced by sig_app still */
  195|      0|        goto err;
  196|      0|    }
  197|       |
  198|      0|    sk_nid_triple_sort(sig_app);
  199|      0|    sk_nid_triple_sort(sigx_app);
  200|       |
  201|      0|    ntr = NULL;
  202|      0|    ret = 1;
  203|  7.43k|err:
  204|  7.43k|    OPENSSL_free(ntr);
  ------------------
  |  |  131|  7.43k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  205|  7.43k|    CRYPTO_THREAD_unlock(sig_lock);
  206|  7.43k|    return ret;
  207|      0|}
OBJ_sigid_free:
  215|      1|{
  216|      1|    sk_nid_triple_pop_free(sig_app, sid_free);
  217|      1|    sk_nid_triple_free(sigx_app);
  218|      1|    CRYPTO_THREAD_lock_free(sig_lock);
  219|      1|    sig_app = NULL;
  220|      1|    sigx_app = NULL;
  221|       |    sig_lock = NULL;
  222|      1|}
obj_xref.c:ossl_obj_find_sigid_algs:
   68|   684k|{
   69|   684k|    nid_triple tmp;
   70|   684k|    const nid_triple *rv;
   71|   684k|    int idx;
   72|       |
   73|   684k|    if (signid == NID_undef)
  ------------------
  |  |   18|   684k|#define NID_undef                       0
  ------------------
  |  Branch (73:9): [True: 0, False: 684k]
  ------------------
   74|      0|        return 0;
   75|       |
   76|   684k|    tmp.sign_id = signid;
   77|   684k|    rv = OBJ_bsearch_sig(&tmp, sigoid_srt, OSSL_NELEM(sigoid_srt));
  ------------------
  |  |   14|   684k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
   78|   684k|    if (rv == NULL) {
  ------------------
  |  Branch (78:9): [True: 0, False: 684k]
  ------------------
   79|      0|        if (!obj_sig_init())
  ------------------
  |  Branch (79:13): [True: 0, False: 0]
  ------------------
   80|      0|            return 0;
   81|      0|        if (lock && !CRYPTO_THREAD_read_lock(sig_lock)) {
  ------------------
  |  Branch (81:13): [True: 0, False: 0]
  |  Branch (81:21): [True: 0, False: 0]
  ------------------
   82|      0|            ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   83|      0|            return 0;
   84|      0|        }
   85|      0|        if (sig_app != NULL) {
  ------------------
  |  Branch (85:13): [True: 0, False: 0]
  ------------------
   86|      0|            idx = sk_nid_triple_find(sig_app, &tmp);
   87|      0|            if (idx >= 0)
  ------------------
  |  Branch (87:17): [True: 0, False: 0]
  ------------------
   88|      0|                rv = sk_nid_triple_value(sig_app, idx);
   89|      0|        }
   90|      0|        if (lock)
  ------------------
  |  Branch (90:13): [True: 0, False: 0]
  ------------------
   91|      0|            CRYPTO_THREAD_unlock(sig_lock);
   92|      0|        if (rv == NULL)
  ------------------
  |  Branch (92:13): [True: 0, False: 0]
  ------------------
   93|      0|            return 0;
   94|      0|    }
   95|       |
   96|   684k|    if (pdig_nid != NULL)
  ------------------
  |  Branch (96:9): [True: 345k, False: 338k]
  ------------------
   97|   345k|        *pdig_nid = rv->hash_id;
   98|   684k|    if (ppkey_nid != NULL)
  ------------------
  |  Branch (98:9): [True: 684k, False: 0]
  ------------------
   99|   684k|        *ppkey_nid = rv->pkey_id;
  100|   684k|    return 1;
  101|   684k|}
obj_xref.c:sig_cmp:
   20|  3.50M|{
   21|  3.50M|    return a->sign_id - b->sign_id;
   22|  3.50M|}
obj_xref.c:obj_sig_init:
   62|  7.43k|{
   63|  7.43k|    return RUN_ONCE(&sig_init, o_sig_init);
  ------------------
  |  |  130|  7.43k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 7.43k, False: 0]
  |  |  ------------------
  ------------------
   64|  7.43k|}
obj_xref.c:o_sig_init:
   56|      1|{
   57|      1|    sig_lock = CRYPTO_THREAD_lock_new();
   58|       |    return sig_lock != NULL;
   59|      1|}

ossl_err_load_OCSP_strings:
   66|      1|{
   67|      1|#ifndef OPENSSL_NO_ERR
   68|      1|    if (ERR_reason_error_string(OCSP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (68:9): [True: 1, False: 0]
  ------------------
   69|      1|        ERR_load_strings_const(OCSP_str_reasons);
   70|      1|#endif
   71|      1|    return 1;
   72|      1|}

WPACKET_allocate_bytes:
   20|  1.10M|{
   21|  1.10M|    if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
  ------------------
  |  Branch (21:9): [True: 0, False: 1.10M]
  ------------------
   22|      0|        return 0;
   23|       |
   24|  1.10M|    pkt->written += len;
   25|  1.10M|    pkt->curr += len;
   26|  1.10M|    return 1;
   27|  1.10M|}
WPACKET_sub_allocate_bytes__:
   31|    235|{
   32|    235|    if (!WPACKET_start_sub_packet_len__(pkt, lenbytes)
  ------------------
  |  Branch (32:9): [True: 0, False: 235]
  ------------------
   33|    235|        || !WPACKET_allocate_bytes(pkt, len, allocbytes)
  ------------------
  |  Branch (33:12): [True: 0, False: 235]
  ------------------
   34|    235|        || !WPACKET_close(pkt))
  ------------------
  |  Branch (34:12): [True: 0, False: 235]
  ------------------
   35|      0|        return 0;
   36|       |
   37|    235|    return 1;
   38|    235|}
WPACKET_reserve_bytes:
   47|  1.11M|{
   48|       |    /* Internal API, so should not fail */
   49|  1.11M|    if (!ossl_assert(pkt->subs != NULL && len != 0))
  ------------------
  |  |   52|  2.22M|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  ------------------
  |  |  |  Branch (52:41): [True: 1.11M, False: 0]
  |  |  |  Branch (52:41): [True: 1.11M, False: 0]
  |  |  ------------------
  |  |   53|  1.11M|    __FILE__, __LINE__)
  ------------------
  |  Branch (49:9): [True: 0, False: 1.11M]
  ------------------
   50|      0|        return 0;
   51|       |
   52|  1.11M|    if (pkt->maxsize - pkt->written < len)
  ------------------
  |  Branch (52:9): [True: 0, False: 1.11M]
  ------------------
   53|      0|        return 0;
   54|       |
   55|  1.11M|    if (pkt->buf != NULL && (pkt->buf->length - pkt->written < len)) {
  ------------------
  |  Branch (55:9): [True: 187k, False: 925k]
  |  Branch (55:29): [True: 0, False: 187k]
  ------------------
   56|      0|        size_t newlen;
   57|      0|        size_t reflen;
   58|       |
   59|      0|        reflen = (len > pkt->buf->length) ? len : pkt->buf->length;
  ------------------
  |  Branch (59:18): [True: 0, False: 0]
  ------------------
   60|       |
   61|      0|        if (reflen > SIZE_MAX / 2) {
  ------------------
  |  Branch (61:13): [True: 0, False: 0]
  ------------------
   62|      0|            newlen = SIZE_MAX;
   63|      0|        } else {
   64|      0|            newlen = reflen * 2;
   65|      0|            if (newlen < DEFAULT_BUF_SIZE)
  ------------------
  |  |   17|      0|#define DEFAULT_BUF_SIZE 256
  ------------------
  |  Branch (65:17): [True: 0, False: 0]
  ------------------
   66|      0|                newlen = DEFAULT_BUF_SIZE;
  ------------------
  |  |   17|      0|#define DEFAULT_BUF_SIZE 256
  ------------------
   67|      0|        }
   68|      0|        if (BUF_MEM_grow(pkt->buf, newlen) == 0)
  ------------------
  |  Branch (68:13): [True: 0, False: 0]
  ------------------
   69|      0|            return 0;
   70|      0|    }
   71|  1.11M|    if (allocbytes != NULL) {
  ------------------
  |  Branch (71:9): [True: 1.10M, False: 3.25k]
  ------------------
   72|  1.10M|        *allocbytes = WPACKET_get_curr(pkt);
   73|  1.10M|        if (pkt->endfirst && *allocbytes != NULL)
  ------------------
  |  Branch (73:13): [True: 0, False: 1.10M]
  |  Branch (73:30): [True: 0, False: 0]
  ------------------
   74|      0|            *allocbytes -= len;
   75|  1.10M|    }
   76|       |
   77|  1.11M|    return 1;
   78|  1.11M|}
WPACKET_init_static_len:
  131|  3.25k|{
  132|  3.25k|    size_t max = maxmaxsize(lenbytes);
  133|       |
  134|       |    /* Internal API, so should not fail */
  135|  3.25k|    if (!ossl_assert(buf != NULL && len > 0))
  ------------------
  |  |   52|  6.51k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  ------------------
  |  |  |  Branch (52:41): [True: 3.25k, False: 0]
  |  |  |  Branch (52:41): [True: 3.25k, False: 0]
  |  |  ------------------
  |  |   53|  3.25k|    __FILE__, __LINE__)
  ------------------
  |  Branch (135:9): [True: 0, False: 3.25k]
  ------------------
  136|      0|        return 0;
  137|       |
  138|  3.25k|    pkt->staticbuf = buf;
  139|  3.25k|    pkt->buf = NULL;
  140|  3.25k|    pkt->maxsize = (max < len) ? max : len;
  ------------------
  |  Branch (140:20): [True: 0, False: 3.25k]
  ------------------
  141|  3.25k|    pkt->endfirst = 0;
  142|       |
  143|  3.25k|    return wpacket_intern_init_len(pkt, lenbytes);
  144|  3.25k|}
WPACKET_init_len:
  161|  1.76k|{
  162|       |    /* Internal API, so should not fail */
  163|  1.76k|    if (!ossl_assert(buf != NULL))
  ------------------
  |  |   52|  1.76k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  1.76k|    __FILE__, __LINE__)
  ------------------
  |  Branch (163:9): [True: 0, False: 1.76k]
  ------------------
  164|      0|        return 0;
  165|       |
  166|  1.76k|    pkt->staticbuf = NULL;
  167|  1.76k|    pkt->buf = buf;
  168|  1.76k|    pkt->maxsize = maxmaxsize(lenbytes);
  169|  1.76k|    pkt->endfirst = 0;
  170|       |
  171|  1.76k|    return wpacket_intern_init_len(pkt, lenbytes);
  172|  1.76k|}
WPACKET_init:
  175|  1.76k|{
  176|  1.76k|    return WPACKET_init_len(pkt, buf, 0);
  177|  1.76k|}
WPACKET_init_null:
  180|   113k|{
  181|   113k|    pkt->staticbuf = NULL;
  182|   113k|    pkt->buf = NULL;
  183|   113k|    pkt->maxsize = maxmaxsize(lenbytes);
  184|   113k|    pkt->endfirst = 0;
  185|       |
  186|   113k|    return wpacket_intern_init_len(pkt, 0);
  187|   113k|}
WPACKET_set_flags:
  200|  3.39k|{
  201|       |    /* Internal API, so should not fail */
  202|  3.39k|    if (!ossl_assert(pkt->subs != NULL))
  ------------------
  |  |   52|  3.39k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  3.39k|    __FILE__, __LINE__)
  ------------------
  |  Branch (202:9): [True: 0, False: 3.39k]
  ------------------
  203|      0|        return 0;
  204|       |
  205|  3.39k|    pkt->subs->flags = flags;
  206|       |
  207|  3.39k|    return 1;
  208|  3.39k|}
WPACKET_close:
  336|   379k|{
  337|       |    /*
  338|       |     * Internal API, so should not fail - but we do negative testing of this
  339|       |     * so no assert (otherwise the tests fail)
  340|       |     */
  341|   379k|    if (pkt->subs == NULL || pkt->subs->parent == NULL)
  ------------------
  |  Branch (341:9): [True: 0, False: 379k]
  |  Branch (341:30): [True: 0, False: 379k]
  ------------------
  342|      0|        return 0;
  343|       |
  344|   379k|    return wpacket_intern_close(pkt, pkt->subs, 1);
  345|   379k|}
WPACKET_finish:
  348|   118k|{
  349|   118k|    int ret;
  350|       |
  351|       |    /*
  352|       |     * Internal API, so should not fail - but we do negative testing of this
  353|       |     * so no assert (otherwise the tests fail)
  354|       |     */
  355|   118k|    if (pkt->subs == NULL || pkt->subs->parent != NULL)
  ------------------
  |  Branch (355:9): [True: 0, False: 118k]
  |  Branch (355:30): [True: 0, False: 118k]
  ------------------
  356|      0|        return 0;
  357|       |
  358|   118k|    ret = wpacket_intern_close(pkt, pkt->subs, 1);
  359|   118k|    if (ret) {
  ------------------
  |  Branch (359:9): [True: 118k, False: 0]
  ------------------
  360|   118k|        OPENSSL_free(pkt->subs);
  ------------------
  |  |  131|   118k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  361|   118k|        pkt->subs = NULL;
  362|   118k|    }
  363|       |
  364|   118k|    return ret;
  365|   118k|}
WPACKET_start_sub_packet_len__:
  368|   380k|{
  369|   380k|    WPACKET_SUB *sub;
  370|   380k|    unsigned char *lenchars;
  371|       |
  372|       |    /* Internal API, so should not fail */
  373|   380k|    if (!ossl_assert(pkt->subs != NULL))
  ------------------
  |  |   52|   380k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|   380k|    __FILE__, __LINE__)
  ------------------
  |  Branch (373:9): [True: 0, False: 380k]
  ------------------
  374|      0|        return 0;
  375|       |
  376|       |    /* We don't support lenbytes greater than 0 when doing endfirst writing */
  377|   380k|    if (lenbytes > 0 && pkt->endfirst)
  ------------------
  |  Branch (377:9): [True: 40.5k, False: 339k]
  |  Branch (377:25): [True: 0, False: 40.5k]
  ------------------
  378|      0|        return 0;
  379|       |
  380|   380k|    if ((sub = OPENSSL_zalloc(sizeof(*sub))) == NULL)
  ------------------
  |  |  108|   380k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (380:9): [True: 0, False: 380k]
  ------------------
  381|      0|        return 0;
  382|       |
  383|   380k|    sub->parent = pkt->subs;
  384|   380k|    pkt->subs = sub;
  385|   380k|    sub->pwritten = pkt->written + lenbytes;
  386|   380k|    sub->lenbytes = lenbytes;
  387|       |
  388|   380k|    if (lenbytes == 0) {
  ------------------
  |  Branch (388:9): [True: 339k, False: 40.5k]
  ------------------
  389|   339k|        sub->packet_len = 0;
  390|   339k|        return 1;
  391|   339k|    }
  392|       |
  393|  40.5k|    sub->packet_len = pkt->written;
  394|       |
  395|  40.5k|    if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars))
  ------------------
  |  Branch (395:9): [True: 0, False: 40.5k]
  ------------------
  396|      0|        return 0;
  397|       |
  398|  40.5k|    return 1;
  399|  40.5k|}
WPACKET_start_sub_packet:
  402|   339k|{
  403|   339k|    return WPACKET_start_sub_packet_len__(pkt, 0);
  404|   339k|}
WPACKET_put_bytes__:
  407|   826k|{
  408|   826k|    unsigned char *data;
  409|       |
  410|       |    /* Internal API, so should not fail */
  411|   826k|    if (!ossl_assert(size <= sizeof(uint64_t))
  ------------------
  |  |   52|  1.65M|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  1.65M|    __FILE__, __LINE__)
  ------------------
  |  Branch (411:9): [True: 0, False: 826k]
  ------------------
  412|   826k|        || !WPACKET_allocate_bytes(pkt, size, &data)
  ------------------
  |  Branch (412:12): [True: 0, False: 826k]
  ------------------
  413|   826k|        || !put_value(data, val, size))
  ------------------
  |  Branch (413:12): [True: 0, False: 826k]
  ------------------
  414|      0|        return 0;
  415|       |
  416|   826k|    return 1;
  417|   826k|}
WPACKET_memcpy:
  461|  12.2k|{
  462|  12.2k|    unsigned char *dest;
  463|       |
  464|  12.2k|    if (len == 0)
  ------------------
  |  Branch (464:9): [True: 0, False: 12.2k]
  ------------------
  465|      0|        return 1;
  466|       |
  467|  12.2k|    if (!WPACKET_allocate_bytes(pkt, len, &dest))
  ------------------
  |  Branch (467:9): [True: 0, False: 12.2k]
  ------------------
  468|      0|        return 0;
  469|       |
  470|  12.2k|    if (dest != NULL)
  ------------------
  |  Branch (470:9): [True: 12.2k, False: 0]
  ------------------
  471|  12.2k|        memcpy(dest, src, len);
  472|       |
  473|  12.2k|    return 1;
  474|  12.2k|}
WPACKET_sub_memcpy__:
  478|  5.45k|{
  479|  5.45k|    if (!WPACKET_start_sub_packet_len__(pkt, lenbytes)
  ------------------
  |  Branch (479:9): [True: 0, False: 5.45k]
  ------------------
  480|  5.45k|        || !WPACKET_memcpy(pkt, src, len)
  ------------------
  |  Branch (480:12): [True: 0, False: 5.45k]
  ------------------
  481|  5.45k|        || !WPACKET_close(pkt))
  ------------------
  |  Branch (481:12): [True: 0, False: 5.45k]
  ------------------
  482|      0|        return 0;
  483|       |
  484|  5.45k|    return 1;
  485|  5.45k|}
WPACKET_get_total_written:
  488|   114k|{
  489|       |    /* Internal API, so should not fail */
  490|   114k|    if (!ossl_assert(written != NULL))
  ------------------
  |  |   52|   114k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|   114k|    __FILE__, __LINE__)
  ------------------
  |  Branch (490:9): [True: 0, False: 114k]
  ------------------
  491|      0|        return 0;
  492|       |
  493|   114k|    *written = pkt->written;
  494|       |
  495|   114k|    return 1;
  496|   114k|}
WPACKET_get_length:
  499|   121k|{
  500|       |    /* Internal API, so should not fail */
  501|   121k|    if (!ossl_assert(pkt->subs != NULL && len != NULL))
  ------------------
  |  |   52|   242k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  ------------------
  |  |  |  Branch (52:41): [True: 121k, False: 0]
  |  |  |  Branch (52:41): [True: 121k, False: 0]
  |  |  ------------------
  |  |   53|   121k|    __FILE__, __LINE__)
  ------------------
  |  Branch (501:9): [True: 0, False: 121k]
  ------------------
  502|      0|        return 0;
  503|       |
  504|   121k|    *len = pkt->written - pkt->subs->pwritten;
  505|       |
  506|   121k|    return 1;
  507|   121k|}
WPACKET_get_curr:
  510|  1.10M|{
  511|  1.10M|    unsigned char *buf = GETBUF(pkt);
  ------------------
  |  |   40|  1.10M|#define GETBUF(p) (((p)->staticbuf != NULL)         \
  |  |  ------------------
  |  |  |  Branch (40:20): [True: 16.2k, False: 1.09M]
  |  |  ------------------
  |  |   41|  1.10M|        ? (p)->staticbuf                            \
  |  |   42|  1.10M|        : ((p)->buf != NULL                         \
  |  |  ------------------
  |  |  |  Branch (42:12): [True: 187k, False: 905k]
  |  |  ------------------
  |  |   43|  1.09M|                  ? (unsigned char *)(p)->buf->data \
  |  |   44|  1.09M|                  : NULL))
  ------------------
  512|       |
  513|  1.10M|    if (buf == NULL)
  ------------------
  |  Branch (513:9): [True: 905k, False: 203k]
  ------------------
  514|   905k|        return NULL;
  515|       |
  516|   203k|    if (pkt->endfirst)
  ------------------
  |  Branch (516:9): [True: 0, False: 203k]
  ------------------
  517|      0|        return buf + pkt->maxsize - pkt->curr;
  518|       |
  519|   203k|    return buf + pkt->curr;
  520|   203k|}
WPACKET_is_null_buf:
  523|   113k|{
  524|   113k|    return pkt->buf == NULL && pkt->staticbuf == NULL;
  ------------------
  |  Branch (524:12): [True: 113k, False: 0]
  |  Branch (524:32): [True: 113k, False: 0]
  ------------------
  525|   113k|}
WPACKET_cleanup:
  528|  3.38k|{
  529|  3.38k|    WPACKET_SUB *sub, *parent;
  530|       |
  531|  3.85k|    for (sub = pkt->subs; sub != NULL; sub = parent) {
  ------------------
  |  Branch (531:27): [True: 475, False: 3.38k]
  ------------------
  532|    475|        parent = sub->parent;
  533|    475|        OPENSSL_free(sub);
  ------------------
  |  |  131|    475|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  534|    475|    }
  535|       |    pkt->subs = NULL;
  536|  3.38k|}
packet.c:maxmaxsize:
   96|   118k|{
   97|   118k|    if (lenbytes >= sizeof(size_t) || lenbytes == 0)
  ------------------
  |  Branch (97:9): [True: 0, False: 118k]
  |  Branch (97:39): [True: 118k, False: 0]
  ------------------
   98|   118k|        return SIZE_MAX;
   99|       |
  100|      0|    return ((size_t)1 << (lenbytes * 8)) - 1 + lenbytes;
  101|   118k|}
packet.c:wpacket_intern_init_len:
  104|   118k|{
  105|   118k|    unsigned char *lenchars;
  106|       |
  107|   118k|    pkt->curr = 0;
  108|   118k|    pkt->written = 0;
  109|       |
  110|   118k|    if ((pkt->subs = OPENSSL_zalloc(sizeof(*pkt->subs))) == NULL)
  ------------------
  |  |  108|   118k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (110:9): [True: 0, False: 118k]
  ------------------
  111|      0|        return 0;
  112|       |
  113|   118k|    if (lenbytes == 0)
  ------------------
  |  Branch (113:9): [True: 118k, False: 0]
  ------------------
  114|   118k|        return 1;
  115|       |
  116|      0|    pkt->subs->pwritten = lenbytes;
  117|      0|    pkt->subs->lenbytes = lenbytes;
  118|       |
  119|      0|    if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars)) {
  ------------------
  |  Branch (119:9): [True: 0, False: 0]
  ------------------
  120|      0|        OPENSSL_free(pkt->subs);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  121|      0|        pkt->subs = NULL;
  122|      0|        return 0;
  123|      0|    }
  124|      0|    pkt->subs->packet_len = 0;
  125|       |
  126|      0|    return 1;
  127|      0|}
packet.c:wpacket_intern_close:
  251|   497k|{
  252|   497k|    size_t packlen = pkt->written - sub->pwritten;
  253|       |
  254|   497k|    if (packlen == 0
  ------------------
  |  Branch (254:9): [True: 1.70k, False: 496k]
  ------------------
  255|  1.70k|        && (sub->flags & WPACKET_FLAGS_NON_ZERO_LENGTH) != 0)
  ------------------
  |  |  697|  1.70k|#define WPACKET_FLAGS_NON_ZERO_LENGTH 1
  ------------------
  |  Branch (255:12): [True: 49, False: 1.65k]
  ------------------
  256|     49|        return 0;
  257|       |
  258|   497k|    if (packlen == 0
  ------------------
  |  Branch (258:9): [True: 1.65k, False: 496k]
  ------------------
  259|  1.65k|        && sub->flags & WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH) {
  ------------------
  |  |  703|  1.65k|#define WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH 2
  ------------------
  |  Branch (259:12): [True: 0, False: 1.65k]
  ------------------
  260|       |        /* We can't handle this case. Return an error */
  261|      0|        if (!doclose)
  ------------------
  |  Branch (261:13): [True: 0, False: 0]
  ------------------
  262|      0|            return 0;
  263|       |
  264|       |        /* Deallocate any bytes allocated for the length of the WPACKET */
  265|      0|        if ((pkt->curr - sub->lenbytes) == sub->packet_len) {
  ------------------
  |  Branch (265:13): [True: 0, False: 0]
  ------------------
  266|      0|            pkt->written -= sub->lenbytes;
  267|      0|            pkt->curr -= sub->lenbytes;
  268|      0|        }
  269|       |
  270|       |        /* Don't write out the packet length */
  271|      0|        sub->packet_len = 0;
  272|      0|        sub->lenbytes = 0;
  273|      0|    }
  274|       |
  275|       |    /* Write out the WPACKET length if needed */
  276|   497k|    if (sub->lenbytes > 0) {
  ------------------
  |  Branch (276:9): [True: 40.1k, False: 457k]
  ------------------
  277|  40.1k|        unsigned char *buf = GETBUF(pkt);
  ------------------
  |  |   40|  40.1k|#define GETBUF(p) (((p)->staticbuf != NULL)         \
  |  |  ------------------
  |  |  |  Branch (40:20): [True: 3.25k, False: 36.8k]
  |  |  ------------------
  |  |   41|  40.1k|        ? (p)->staticbuf                            \
  |  |   42|  40.1k|        : ((p)->buf != NULL                         \
  |  |  ------------------
  |  |  |  Branch (42:12): [True: 36.8k, False: 0]
  |  |  ------------------
  |  |   43|  36.8k|                  ? (unsigned char *)(p)->buf->data \
  |  |   44|  36.8k|                  : NULL))
  ------------------
  278|       |
  279|  40.1k|        if (buf != NULL) {
  ------------------
  |  Branch (279:13): [True: 40.1k, False: 0]
  ------------------
  280|  40.1k|#if !defined OPENSSL_NO_QUIC && !defined FIPS_MODULE
  281|  40.1k|            if ((sub->flags & WPACKET_FLAGS_QUIC_VLINT) == 0) {
  ------------------
  |  |  706|  40.1k|#define WPACKET_FLAGS_QUIC_VLINT 4
  ------------------
  |  Branch (281:17): [True: 40.1k, False: 0]
  ------------------
  282|  40.1k|                if (!put_value(&buf[sub->packet_len], packlen, sub->lenbytes))
  ------------------
  |  Branch (282:21): [True: 0, False: 40.1k]
  ------------------
  283|      0|                    return 0;
  284|  40.1k|            } else {
  285|      0|                if (!put_quic_value(&buf[sub->packet_len], packlen, sub->lenbytes))
  ------------------
  |  Branch (285:21): [True: 0, False: 0]
  ------------------
  286|      0|                    return 0;
  287|      0|            }
  288|       |#else
  289|       |            if (!put_value(&buf[sub->packet_len], packlen, sub->lenbytes))
  290|       |                return 0;
  291|       |#endif
  292|  40.1k|        }
  293|   457k|    } else if (pkt->endfirst && sub->parent != NULL
  ------------------
  |  Branch (293:16): [True: 0, False: 457k]
  |  Branch (293:33): [True: 0, False: 0]
  ------------------
  294|      0|        && (packlen != 0
  ------------------
  |  Branch (294:13): [True: 0, False: 0]
  ------------------
  295|      0|            || (sub->flags
  ------------------
  |  Branch (295:16): [True: 0, False: 0]
  ------------------
  296|      0|                   & WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH)
  ------------------
  |  |  703|      0|#define WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH 2
  ------------------
  297|      0|                == 0)) {
  298|      0|        size_t tmplen = packlen;
  299|      0|        size_t numlenbytes = 1;
  300|       |
  301|      0|        while ((tmplen = tmplen >> 8) > 0)
  ------------------
  |  Branch (301:16): [True: 0, False: 0]
  ------------------
  302|      0|            numlenbytes++;
  303|      0|        if (!WPACKET_put_bytes__(pkt, packlen, numlenbytes))
  ------------------
  |  Branch (303:13): [True: 0, False: 0]
  ------------------
  304|      0|            return 0;
  305|      0|        if (packlen > 0x7f) {
  ------------------
  |  Branch (305:13): [True: 0, False: 0]
  ------------------
  306|      0|            numlenbytes |= 0x80;
  307|      0|            if (!WPACKET_put_bytes_u8(pkt, numlenbytes))
  ------------------
  |  |  889|      0|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (307:17): [True: 0, False: 0]
  ------------------
  308|      0|                return 0;
  309|      0|        }
  310|      0|    }
  311|       |
  312|   497k|    if (doclose) {
  ------------------
  |  Branch (312:9): [True: 497k, False: 0]
  ------------------
  313|   497k|        pkt->subs = sub->parent;
  314|   497k|        OPENSSL_free(sub);
  ------------------
  |  |  131|   497k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  315|   497k|    }
  316|       |
  317|   497k|    return 1;
  318|   497k|}
packet.c:put_value:
  212|   866k|{
  213|   866k|    if (data == NULL)
  ------------------
  |  Branch (213:9): [True: 679k, False: 187k]
  ------------------
  214|   679k|        return 1;
  215|       |
  216|   544k|    for (data += len - 1; len > 0; len--) {
  ------------------
  |  Branch (216:27): [True: 357k, False: 187k]
  ------------------
  217|   357k|        *data = (unsigned char)(value & 0xff);
  218|   357k|        data--;
  219|   357k|        value >>= 8;
  220|   357k|    }
  221|       |
  222|       |    /* Check whether we could fit the value in the assigned number of bytes */
  223|   187k|    if (value > 0)
  ------------------
  |  Branch (223:9): [True: 0, False: 187k]
  ------------------
  224|      0|        return 0;
  225|       |
  226|   187k|    return 1;
  227|   187k|}

OSSL_PARAM_BLD_new:
   92|  2.88k|{
   93|  2.88k|    OSSL_PARAM_BLD *r = OPENSSL_zalloc(sizeof(OSSL_PARAM_BLD));
  ------------------
  |  |  108|  2.88k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|       |
   95|  2.88k|    if (r != NULL) {
  ------------------
  |  Branch (95:9): [True: 2.88k, False: 0]
  ------------------
   96|  2.88k|        r->params = sk_OSSL_PARAM_BLD_DEF_new_null();
   97|  2.88k|        if (r->params == NULL) {
  ------------------
  |  Branch (97:13): [True: 0, False: 2.88k]
  ------------------
   98|      0|            OPENSSL_free(r);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   99|       |            r = NULL;
  100|      0|        }
  101|  2.88k|    }
  102|  2.88k|    return r;
  103|  2.88k|}
OSSL_PARAM_BLD_free:
  114|  2.88k|{
  115|  2.88k|    if (bld == NULL)
  ------------------
  |  Branch (115:9): [True: 0, False: 2.88k]
  ------------------
  116|      0|        return;
  117|  2.88k|    free_all_params(bld);
  118|  2.88k|    sk_OSSL_PARAM_BLD_DEF_free(bld->params);
  119|  2.88k|    OPENSSL_free(bld);
  ------------------
  |  |  131|  2.88k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  120|  2.88k|}
OSSL_PARAM_BLD_push_utf8_string:
  324|    226|{
  325|    226|    OSSL_PARAM_BLD_DEF *pd;
  326|    226|    int secure;
  327|       |
  328|    226|    if (bld == NULL || key == NULL || buf == NULL) {
  ------------------
  |  Branch (328:9): [True: 0, False: 226]
  |  Branch (328:24): [True: 0, False: 226]
  |  Branch (328:39): [True: 0, False: 226]
  ------------------
  329|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  330|      0|        return 0;
  331|      0|    }
  332|       |
  333|    226|    if (bsize == 0)
  ------------------
  |  Branch (333:9): [True: 226, False: 0]
  ------------------
  334|    226|        bsize = strlen(buf);
  335|    226|    secure = CRYPTO_secure_allocated(buf);
  336|    226|    pd = param_push(bld, key, bsize, bsize + 1, OSSL_PARAM_UTF8_STRING, secure);
  ------------------
  |  |  117|    226|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  337|    226|    if (pd == NULL)
  ------------------
  |  Branch (337:9): [True: 0, False: 226]
  ------------------
  338|      0|        return 0;
  339|    226|    pd->string = buf;
  340|    226|    return 1;
  341|    226|}
OSSL_PARAM_BLD_push_octet_string:
  364|  2.65k|{
  365|  2.65k|    OSSL_PARAM_BLD_DEF *pd;
  366|  2.65k|    int secure;
  367|       |
  368|  2.65k|    if (bld == NULL || key == NULL || buf == NULL) {
  ------------------
  |  Branch (368:9): [True: 0, False: 2.65k]
  |  Branch (368:24): [True: 0, False: 2.65k]
  |  Branch (368:39): [True: 0, False: 2.65k]
  ------------------
  369|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  370|      0|        return 0;
  371|      0|    }
  372|       |
  373|  2.65k|    secure = CRYPTO_secure_allocated(buf);
  374|  2.65k|    pd = param_push(bld, key, bsize, bsize, OSSL_PARAM_OCTET_STRING, secure);
  ------------------
  |  |  123|  2.65k|#define OSSL_PARAM_OCTET_STRING 5
  ------------------
  375|  2.65k|    if (pd == NULL)
  ------------------
  |  Branch (375:9): [True: 0, False: 2.65k]
  ------------------
  376|      0|        return 0;
  377|  2.65k|    pd->string = buf;
  378|  2.65k|    return 1;
  379|  2.65k|}
OSSL_PARAM_BLD_to_param:
  452|  2.88k|{
  453|  2.88k|    OSSL_PARAM_ALIGNED_BLOCK *blk, *s = NULL;
  454|  2.88k|    OSSL_PARAM *params, *last;
  455|  2.88k|    int num;
  456|  2.88k|    size_t p_blks, total, ss;
  457|       |
  458|  2.88k|    if (bld == NULL) {
  ------------------
  |  Branch (458:9): [True: 0, False: 2.88k]
  ------------------
  459|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  460|      0|        return 0;
  461|      0|    }
  462|       |
  463|  2.88k|    num = sk_OSSL_PARAM_BLD_DEF_num(bld->params);
  464|  2.88k|    p_blks = ossl_param_bytes_to_blocks((1 + num) * sizeof(*params));
  465|  2.88k|    total = OSSL_PARAM_ALIGN_SIZE * (p_blks + bld->total_blocks);
  ------------------
  |  |   22|  2.88k|#define OSSL_PARAM_ALIGN_SIZE sizeof(OSSL_PARAM_ALIGNED_BLOCK)
  ------------------
  466|  2.88k|    ss = OSSL_PARAM_ALIGN_SIZE * bld->secure_blocks;
  ------------------
  |  |   22|  2.88k|#define OSSL_PARAM_ALIGN_SIZE sizeof(OSSL_PARAM_ALIGNED_BLOCK)
  ------------------
  467|       |
  468|  2.88k|    if (ss > 0) {
  ------------------
  |  Branch (468:9): [True: 0, False: 2.88k]
  ------------------
  469|      0|        s = OPENSSL_secure_malloc(ss);
  ------------------
  |  |  139|      0|    CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  470|      0|        if (s == NULL) {
  ------------------
  |  Branch (470:13): [True: 0, False: 0]
  ------------------
  471|      0|            ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_SECURE_MALLOC_FAILURE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  472|      0|            return NULL;
  473|      0|        }
  474|      0|    }
  475|  2.88k|    params = OPENSSL_malloc(total);
  ------------------
  |  |  106|  2.88k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  476|  2.88k|    if (params == NULL) {
  ------------------
  |  Branch (476:9): [True: 0, False: 2.88k]
  ------------------
  477|      0|        OPENSSL_secure_free(s);
  ------------------
  |  |  147|      0|    CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  478|      0|        return NULL;
  479|      0|    }
  480|  2.88k|    blk = p_blks + (OSSL_PARAM_ALIGNED_BLOCK *)(params);
  481|  2.88k|    last = param_bld_convert(bld, params, blk, s);
  482|  2.88k|    ossl_param_set_secure_block(last, s, ss);
  483|       |
  484|       |    /* Reset builder for reuse */
  485|  2.88k|    bld->total_blocks = 0;
  486|  2.88k|    bld->secure_blocks = 0;
  487|  2.88k|    free_all_params(bld);
  488|  2.88k|    return params;
  489|  2.88k|}
param_build.c:free_all_params:
  106|  5.76k|{
  107|  5.76k|    int i, n = sk_OSSL_PARAM_BLD_DEF_num(bld->params);
  108|       |
  109|  8.64k|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (109:17): [True: 2.88k, False: 5.76k]
  ------------------
  110|  2.88k|        OPENSSL_free(sk_OSSL_PARAM_BLD_DEF_pop(bld->params));
  ------------------
  |  |  131|  2.88k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  111|  5.76k|}
param_build.c:param_push:
   54|  2.88k|{
   55|  2.88k|    OSSL_PARAM_BLD_DEF *pd = OPENSSL_zalloc(sizeof(*pd));
  ------------------
  |  |  108|  2.88k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   56|       |
   57|  2.88k|    if (pd == NULL)
  ------------------
  |  Branch (57:9): [True: 0, False: 2.88k]
  ------------------
   58|      0|        return NULL;
   59|  2.88k|    pd->key = key;
   60|  2.88k|    pd->type = type;
   61|  2.88k|    pd->size = size;
   62|  2.88k|    pd->alloc_blocks = ossl_param_bytes_to_blocks(alloc);
   63|  2.88k|    if ((pd->secure = secure) != 0)
  ------------------
  |  Branch (63:9): [True: 0, False: 2.88k]
  ------------------
   64|      0|        bld->secure_blocks += pd->alloc_blocks;
   65|  2.88k|    else
   66|  2.88k|        bld->total_blocks += pd->alloc_blocks;
   67|  2.88k|    if (sk_OSSL_PARAM_BLD_DEF_push(bld->params, pd) <= 0) {
  ------------------
  |  Branch (67:9): [True: 0, False: 2.88k]
  ------------------
   68|      0|        OPENSSL_free(pd);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   69|       |        pd = NULL;
   70|      0|    }
   71|  2.88k|    return pd;
   72|  2.88k|}
param_build.c:param_bld_convert:
  401|  2.88k|{
  402|  2.88k|    int i, num = sk_OSSL_PARAM_BLD_DEF_num(bld->params);
  403|  2.88k|    OSSL_PARAM_BLD_DEF *pd;
  404|  2.88k|    void *p;
  405|       |
  406|  5.76k|    for (i = 0; i < num; i++) {
  ------------------
  |  Branch (406:17): [True: 2.88k, False: 2.88k]
  ------------------
  407|  2.88k|        pd = sk_OSSL_PARAM_BLD_DEF_value(bld->params, i);
  408|  2.88k|        param[i].key = pd->key;
  409|  2.88k|        param[i].data_type = pd->type;
  410|  2.88k|        param[i].data_size = pd->size;
  411|  2.88k|        param[i].return_size = OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|  2.88k|#define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
  412|       |
  413|  2.88k|        if (pd->secure) {
  ------------------
  |  Branch (413:13): [True: 0, False: 2.88k]
  ------------------
  414|      0|            p = secure;
  415|      0|            secure += pd->alloc_blocks;
  416|  2.88k|        } else {
  417|  2.88k|            p = blk;
  418|  2.88k|            blk += pd->alloc_blocks;
  419|  2.88k|        }
  420|  2.88k|        param[i].data = p;
  421|  2.88k|        if (pd->bn != NULL) {
  ------------------
  |  Branch (421:13): [True: 0, False: 2.88k]
  ------------------
  422|       |            /* BIGNUM */
  423|      0|            if (pd->type == OSSL_PARAM_UNSIGNED_INTEGER)
  ------------------
  |  |  107|      0|#define OSSL_PARAM_UNSIGNED_INTEGER 2
  ------------------
  |  Branch (423:17): [True: 0, False: 0]
  ------------------
  424|      0|                BN_bn2nativepad(pd->bn, (unsigned char *)p, (int)pd->size);
  425|      0|            else
  426|      0|                BN_signed_bn2native(pd->bn, (unsigned char *)p, (int)pd->size);
  427|  2.88k|        } else if (pd->type == OSSL_PARAM_OCTET_PTR
  ------------------
  |  |  160|  5.76k|#define OSSL_PARAM_OCTET_PTR 7
  ------------------
  |  Branch (427:20): [True: 0, False: 2.88k]
  ------------------
  428|  2.88k|            || pd->type == OSSL_PARAM_UTF8_PTR) {
  ------------------
  |  |  141|  2.88k|#define OSSL_PARAM_UTF8_PTR 6
  ------------------
  |  Branch (428:16): [True: 0, False: 2.88k]
  ------------------
  429|       |            /* PTR */
  430|      0|            *(const void **)p = pd->string;
  431|  2.88k|        } else if (pd->type == OSSL_PARAM_OCTET_STRING
  ------------------
  |  |  123|  5.76k|#define OSSL_PARAM_OCTET_STRING 5
  ------------------
  |  Branch (431:20): [True: 2.65k, False: 226]
  ------------------
  432|  2.88k|            || pd->type == OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|    226|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (432:16): [True: 226, False: 0]
  ------------------
  433|  2.88k|            if (pd->string != NULL)
  ------------------
  |  Branch (433:17): [True: 2.88k, False: 0]
  ------------------
  434|  2.88k|                memcpy(p, pd->string, pd->size);
  435|      0|            else
  436|      0|                memset(p, 0, pd->size);
  437|  2.88k|            if (pd->type == OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|  2.88k|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (437:17): [True: 226, False: 2.65k]
  ------------------
  438|    226|                ((char *)p)[pd->size] = '\0';
  439|  2.88k|        } else {
  440|       |            /* Number, but could also be a NULL BIGNUM */
  441|      0|            if (pd->size > sizeof(pd->num))
  ------------------
  |  Branch (441:17): [True: 0, False: 0]
  ------------------
  442|      0|                memset(p, 0, pd->size);
  443|      0|            else if (pd->size > 0)
  ------------------
  |  Branch (443:22): [True: 0, False: 0]
  ------------------
  444|      0|                memcpy(p, &pd->num, pd->size);
  445|      0|        }
  446|  2.88k|    }
  447|  2.88k|    param[i] = OSSL_PARAM_construct_end();
  448|  2.88k|    return param + i;
  449|  2.88k|}

ossl_param_build_set_int:
   24|   228k|{
   25|   228k|    if (bld != NULL)
  ------------------
  |  Branch (25:9): [True: 0, False: 228k]
  ------------------
   26|      0|        return OSSL_PARAM_BLD_push_int(bld, key, num);
   27|   228k|    p = OSSL_PARAM_locate(p, key);
   28|   228k|    if (p != NULL)
  ------------------
  |  Branch (28:9): [True: 0, False: 228k]
  ------------------
   29|      0|        return OSSL_PARAM_set_int(p, num);
   30|   228k|    return 1;
   31|   228k|}
ossl_param_build_set_utf8_string:
   46|   568k|{
   47|   568k|    if (bld != NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 568k]
  ------------------
   48|      0|        return OSSL_PARAM_BLD_push_utf8_string(bld, key, buf, 0);
   49|   568k|    p = OSSL_PARAM_locate(p, key);
   50|   568k|    if (p != NULL)
  ------------------
  |  Branch (50:9): [True: 0, False: 568k]
  ------------------
   51|      0|        return OSSL_PARAM_set_utf8_string(p, buf);
   52|   568k|    return 1;
   53|   568k|}
ossl_param_build_set_octet_string:
   59|  13.2k|{
   60|  13.2k|    if (bld != NULL)
  ------------------
  |  Branch (60:9): [True: 2.65k, False: 10.5k]
  ------------------
   61|  2.65k|        return OSSL_PARAM_BLD_push_octet_string(bld, key, data, data_len);
   62|       |
   63|  10.5k|    p = OSSL_PARAM_locate(p, key);
   64|  10.5k|    if (p != NULL)
  ------------------
  |  Branch (64:9): [True: 0, False: 10.5k]
  ------------------
   65|      0|        return OSSL_PARAM_set_octet_string(p, data, data_len);
   66|  10.5k|    return 1;
   67|  10.5k|}
ossl_param_build_set_bn_pad:
   71|    678|{
   72|    678|    if (bld != NULL)
  ------------------
  |  Branch (72:9): [True: 0, False: 678]
  ------------------
   73|      0|        return OSSL_PARAM_BLD_push_BN_pad(bld, key, bn, sz);
   74|    678|    p = OSSL_PARAM_locate(p, key);
   75|    678|    if (p != NULL) {
  ------------------
  |  Branch (75:9): [True: 0, False: 678]
  ------------------
   76|      0|        if (sz > p->data_size) {
  ------------------
  |  Branch (76:13): [True: 0, False: 0]
  ------------------
   77|      0|            ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_SMALL_BUFFER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   78|      0|            return 0;
   79|      0|        }
   80|      0|        p->data_size = sz;
   81|      0|        return OSSL_PARAM_set_BN(p, bn);
   82|      0|    }
   83|    678|    return 1;
   84|    678|}
ossl_param_build_set_bn:
   88|   599k|{
   89|   599k|    if (bld != NULL)
  ------------------
  |  Branch (89:9): [True: 0, False: 599k]
  ------------------
   90|      0|        return OSSL_PARAM_BLD_push_BN(bld, key, bn);
   91|       |
   92|   599k|    p = OSSL_PARAM_locate(p, key);
   93|   599k|    if (p != NULL)
  ------------------
  |  Branch (93:9): [True: 0, False: 599k]
  ------------------
   94|      0|        return OSSL_PARAM_set_BN(p, bn) > 0;
   95|   599k|    return 1;
   96|   599k|}

OSSL_PARAM_locate:
   55|  10.4M|{
   56|  10.4M|    if (ossl_likely(p != NULL && key != NULL))
  ------------------
  |  |   22|  20.8M|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 10.4M, False: 14.3k]
  |  |  |  Branch (22:44): [True: 10.4M, False: 14.3k]
  |  |  |  Branch (22:44): [True: 10.4M, False: 0]
  |  |  ------------------
  ------------------
   57|  41.6M|        for (; p->key != NULL; p++)
  ------------------
  |  Branch (57:16): [True: 37.3M, False: 4.26M]
  ------------------
   58|  37.3M|            if (strcmp(key, p->key) == 0)
  ------------------
  |  Branch (58:17): [True: 6.16M, False: 31.2M]
  ------------------
   59|  6.16M|                return p;
   60|  4.28M|    return NULL;
   61|  10.4M|}
OSSL_PARAM_locate_const:
   64|  5.96M|{
   65|  5.96M|    return OSSL_PARAM_locate((OSSL_PARAM *)p, key);
   66|  5.96M|}
OSSL_PARAM_modified:
   82|  11.5k|{
   83|  11.5k|    return p != NULL && p->return_size != OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|  11.5k|#define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
  |  Branch (83:12): [True: 11.5k, False: 0]
  |  Branch (83:25): [True: 7.54k, False: 3.98k]
  ------------------
   84|  11.5k|}
OSSL_PARAM_get_int:
  268|   643k|{
  269|   643k|#ifndef OPENSSL_SMALL_FOOTPRINT
  270|   643k|    switch (sizeof(int)) {
  ------------------
  |  Branch (270:13): [True: 643k, Folded]
  ------------------
  271|   643k|    case sizeof(int32_t):
  ------------------
  |  Branch (271:5): [True: 643k, False: 0]
  ------------------
  272|   643k|        return OSSL_PARAM_get_int32(p, (int32_t *)val);
  273|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (273:5): [True: 0, False: 643k]
  ------------------
  274|      0|        return OSSL_PARAM_get_int64(p, (int64_t *)val);
  275|   643k|    }
  276|      0|#endif
  277|      0|    return general_get_int(p, val, sizeof(*val));
  278|   643k|}
OSSL_PARAM_set_int:
  281|  2.21M|{
  282|  2.21M|#ifndef OPENSSL_SMALL_FOOTPRINT
  283|  2.21M|    switch (sizeof(int)) {
  ------------------
  |  Branch (283:13): [True: 2.21M, Folded]
  ------------------
  284|  2.21M|    case sizeof(int32_t):
  ------------------
  |  Branch (284:5): [True: 2.21M, False: 0]
  ------------------
  285|  2.21M|        return OSSL_PARAM_set_int32(p, (int32_t)val);
  286|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (286:5): [True: 0, False: 2.21M]
  ------------------
  287|      0|        return OSSL_PARAM_set_int64(p, (int64_t)val);
  288|  2.21M|    }
  289|      0|#endif
  290|      0|    return general_set_int(p, &val, sizeof(val));
  291|  2.21M|}
OSSL_PARAM_construct_int:
  294|  3.07M|{
  295|  3.07M|    return ossl_param_construct(key, OSSL_PARAM_INTEGER, buf, sizeof(int));
  ------------------
  |  |  106|  3.07M|#define OSSL_PARAM_INTEGER 1
  ------------------
  296|  3.07M|}
OSSL_PARAM_get_uint:
  299|   470k|{
  300|   470k|#ifndef OPENSSL_SMALL_FOOTPRINT
  301|   470k|    switch (sizeof(unsigned int)) {
  ------------------
  |  Branch (301:13): [True: 470k, Folded]
  ------------------
  302|   470k|    case sizeof(uint32_t):
  ------------------
  |  Branch (302:5): [True: 470k, False: 0]
  ------------------
  303|   470k|        return OSSL_PARAM_get_uint32(p, (uint32_t *)val);
  304|      0|    case sizeof(uint64_t):
  ------------------
  |  Branch (304:5): [True: 0, False: 470k]
  ------------------
  305|      0|        return OSSL_PARAM_get_uint64(p, (uint64_t *)val);
  306|   470k|    }
  307|      0|#endif
  308|      0|    return general_get_uint(p, val, sizeof(*val));
  309|   470k|}
OSSL_PARAM_set_uint:
  312|   116k|{
  313|   116k|#ifndef OPENSSL_SMALL_FOOTPRINT
  314|   116k|    switch (sizeof(unsigned int)) {
  ------------------
  |  Branch (314:13): [True: 116k, Folded]
  ------------------
  315|   116k|    case sizeof(uint32_t):
  ------------------
  |  Branch (315:5): [True: 116k, False: 0]
  ------------------
  316|   116k|        return OSSL_PARAM_set_uint32(p, (uint32_t)val);
  317|      0|    case sizeof(uint64_t):
  ------------------
  |  Branch (317:5): [True: 0, False: 116k]
  ------------------
  318|      0|        return OSSL_PARAM_set_uint64(p, (uint64_t)val);
  319|   116k|    }
  320|      0|#endif
  321|      0|    return general_set_uint(p, &val, sizeof(val));
  322|   116k|}
OSSL_PARAM_construct_uint:
  325|   123k|{
  326|   123k|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|   123k|#define OSSL_PARAM_UNSIGNED_INTEGER 2
  ------------------
  327|   123k|        sizeof(unsigned int));
  328|   123k|}
OSSL_PARAM_get_int32:
  394|   643k|{
  395|   643k|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (395:9): [True: 0, False: 643k]
  |  Branch (395:24): [True: 0, False: 643k]
  ------------------
  396|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  397|      0|        return 0;
  398|      0|    }
  399|       |
  400|   643k|    if (p->data == NULL) {
  ------------------
  |  Branch (400:9): [True: 0, False: 643k]
  ------------------
  401|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  402|      0|        return 0;
  403|      0|    }
  404|       |
  405|   643k|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|   643k|#define OSSL_PARAM_INTEGER 1
  ------------------
  |  Branch (405:9): [True: 637k, False: 6.58k]
  ------------------
  406|   637k|#ifndef OPENSSL_SMALL_FOOTPRINT
  407|   637k|        int64_t i64;
  408|       |
  409|   637k|        switch (p->data_size) {
  ------------------
  |  Branch (409:17): [True: 637k, False: 0]
  ------------------
  410|   637k|        case sizeof(int32_t):
  ------------------
  |  Branch (410:9): [True: 637k, False: 0]
  ------------------
  411|   637k|            *val = *(const int32_t *)p->data;
  412|   637k|            return 1;
  413|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (413:9): [True: 0, False: 637k]
  ------------------
  414|      0|            i64 = *(const int64_t *)p->data;
  415|      0|            if (i64 >= INT32_MIN && i64 <= INT32_MAX) {
  ------------------
  |  Branch (415:17): [True: 0, False: 0]
  |  Branch (415:37): [True: 0, False: 0]
  ------------------
  416|      0|                *val = (int32_t)i64;
  417|      0|                return 1;
  418|      0|            }
  419|      0|            err_out_of_range;
  ------------------
  |  |   26|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  420|      0|            return 0;
  421|   637k|        }
  422|      0|#endif
  423|      0|        return general_get_int(p, val, sizeof(*val));
  424|       |
  425|   637k|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|  6.58k|#define OSSL_PARAM_UNSIGNED_INTEGER 2
  ------------------
  |  Branch (425:16): [True: 6.58k, False: 0]
  ------------------
  426|  6.58k|#ifndef OPENSSL_SMALL_FOOTPRINT
  427|  6.58k|        uint32_t u32;
  428|  6.58k|        uint64_t u64;
  429|       |
  430|  6.58k|        switch (p->data_size) {
  ------------------
  |  Branch (430:17): [True: 6.58k, False: 0]
  ------------------
  431|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (431:9): [True: 0, False: 6.58k]
  ------------------
  432|      0|            u32 = *(const uint32_t *)p->data;
  433|      0|            if (u32 <= INT32_MAX) {
  ------------------
  |  Branch (433:17): [True: 0, False: 0]
  ------------------
  434|      0|                *val = (int32_t)u32;
  435|      0|                return 1;
  436|      0|            }
  437|      0|            err_out_of_range;
  ------------------
  |  |   26|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  438|      0|            return 0;
  439|  6.58k|        case sizeof(uint64_t):
  ------------------
  |  Branch (439:9): [True: 6.58k, False: 0]
  ------------------
  440|  6.58k|            u64 = *(const uint64_t *)p->data;
  441|  6.58k|            if (u64 <= INT32_MAX) {
  ------------------
  |  Branch (441:17): [True: 6.58k, False: 0]
  ------------------
  442|  6.58k|                *val = (int32_t)u64;
  443|  6.58k|                return 1;
  444|  6.58k|            }
  445|      0|            err_out_of_range;
  ------------------
  |  |   26|  6.58k|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  446|      0|            return 0;
  447|  6.58k|        }
  448|      0|#endif
  449|      0|        return general_get_int(p, val, sizeof(*val));
  450|       |
  451|  6.58k|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|#define OSSL_PARAM_REAL 3
  ------------------
  |  Branch (451:16): [True: 0, False: 0]
  ------------------
  452|      0|#ifndef OPENSSL_SYS_UEFI
  453|      0|        double d;
  454|       |
  455|      0|        switch (p->data_size) {
  ------------------
  |  Branch (455:17): [True: 0, False: 0]
  ------------------
  456|      0|        case sizeof(double):
  ------------------
  |  Branch (456:9): [True: 0, False: 0]
  ------------------
  457|      0|            d = *(const double *)p->data;
  458|      0|            if (d >= INT32_MIN && d <= INT32_MAX && d == (int32_t)d) {
  ------------------
  |  Branch (458:17): [True: 0, False: 0]
  |  Branch (458:35): [True: 0, False: 0]
  |  Branch (458:53): [True: 0, False: 0]
  ------------------
  459|      0|                *val = (int32_t)d;
  460|      0|                return 1;
  461|      0|            }
  462|      0|            err_out_of_range;
  ------------------
  |  |   26|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  463|      0|            return 0;
  464|      0|        }
  465|      0|        err_unsupported_real;
  ------------------
  |  |   40|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  466|      0|        return 0;
  467|      0|#endif
  468|      0|    }
  469|      0|    err_bad_type;
  ------------------
  |  |   36|   643k|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  470|      0|    return 0;
  471|   643k|}
OSSL_PARAM_set_int32:
  474|  2.21M|{
  475|  2.21M|    if (p == NULL) {
  ------------------
  |  Branch (475:9): [True: 0, False: 2.21M]
  ------------------
  476|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  477|      0|        return 0;
  478|      0|    }
  479|  2.21M|    p->return_size = 0;
  480|  2.21M|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|  2.21M|#define OSSL_PARAM_INTEGER 1
  ------------------
  |  Branch (480:9): [True: 2.21M, False: 3.29k]
  ------------------
  481|  2.21M|#ifndef OPENSSL_SMALL_FOOTPRINT
  482|  2.21M|        p->return_size = sizeof(int32_t); /* Minimum expected size */
  483|  2.21M|        if (p->data == NULL)
  ------------------
  |  Branch (483:13): [True: 0, False: 2.21M]
  ------------------
  484|      0|            return 1;
  485|  2.21M|        switch (p->data_size) {
  ------------------
  |  Branch (485:17): [True: 2.21M, False: 0]
  ------------------
  486|  2.21M|        case sizeof(int32_t):
  ------------------
  |  Branch (486:9): [True: 2.21M, False: 0]
  ------------------
  487|  2.21M|            *(int32_t *)p->data = val;
  488|  2.21M|            return 1;
  489|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (489:9): [True: 0, False: 2.21M]
  ------------------
  490|      0|            p->return_size = sizeof(int64_t);
  491|      0|            *(int64_t *)p->data = (int64_t)val;
  492|      0|            return 1;
  493|  2.21M|        }
  494|      0|#endif
  495|      0|        return general_set_int(p, &val, sizeof(val));
  496|  2.21M|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER && val >= 0) {
  ------------------
  |  |  107|  6.58k|#define OSSL_PARAM_UNSIGNED_INTEGER 2
  ------------------
  |  Branch (496:16): [True: 3.29k, False: 0]
  |  Branch (496:63): [True: 3.29k, False: 0]
  ------------------
  497|  3.29k|#ifndef OPENSSL_SMALL_FOOTPRINT
  498|  3.29k|        p->return_size = sizeof(uint32_t); /* Minimum expected size */
  499|  3.29k|        if (p->data == NULL)
  ------------------
  |  Branch (499:13): [True: 0, False: 3.29k]
  ------------------
  500|      0|            return 1;
  501|  3.29k|        switch (p->data_size) {
  ------------------
  |  Branch (501:17): [True: 3.29k, False: 0]
  ------------------
  502|  3.29k|        case sizeof(uint32_t):
  ------------------
  |  Branch (502:9): [True: 3.29k, False: 0]
  ------------------
  503|  3.29k|            *(uint32_t *)p->data = (uint32_t)val;
  504|  3.29k|            return 1;
  505|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (505:9): [True: 0, False: 3.29k]
  ------------------
  506|      0|            p->return_size = sizeof(uint64_t);
  507|      0|            *(uint64_t *)p->data = (uint64_t)val;
  508|      0|            return 1;
  509|  3.29k|        }
  510|      0|#endif
  511|      0|        return general_set_int(p, &val, sizeof(val));
  512|  3.29k|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|#define OSSL_PARAM_REAL 3
  ------------------
  |  Branch (512:16): [True: 0, False: 0]
  ------------------
  513|      0|#ifndef OPENSSL_SYS_UEFI
  514|      0|        uint32_t u32;
  515|      0|        unsigned int shift;
  516|       |
  517|      0|        p->return_size = sizeof(double);
  518|      0|        if (p->data == NULL)
  ------------------
  |  Branch (518:13): [True: 0, False: 0]
  ------------------
  519|      0|            return 1;
  520|      0|        switch (p->data_size) {
  ------------------
  |  Branch (520:17): [True: 0, False: 0]
  ------------------
  521|      0|        case sizeof(double):
  ------------------
  |  Branch (521:9): [True: 0, False: 0]
  ------------------
  522|      0|            shift = real_shift();
  523|      0|            if (shift < 8 * sizeof(val) - 1) {
  ------------------
  |  Branch (523:17): [True: 0, False: 0]
  ------------------
  524|      0|                u32 = val < 0 ? -val : val;
  ------------------
  |  Branch (524:23): [True: 0, False: 0]
  ------------------
  525|      0|                if ((u32 >> shift) != 0) {
  ------------------
  |  Branch (525:21): [True: 0, False: 0]
  ------------------
  526|      0|                    err_inexact;
  ------------------
  |  |   29|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      0|        CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  527|      0|                    return 0;
  528|      0|                }
  529|      0|            }
  530|      0|            *(double *)p->data = (double)val;
  531|      0|            return 1;
  532|      0|        }
  533|      0|        err_unsupported_real;
  ------------------
  |  |   40|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  534|      0|        return 0;
  535|      0|#endif
  536|      0|    }
  537|      0|    err_bad_type;
  ------------------
  |  |   36|  2.21M|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  538|      0|    return 0;
  539|  2.21M|}
OSSL_PARAM_get_uint32:
  548|   481k|{
  549|   481k|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (549:9): [True: 0, False: 481k]
  |  Branch (549:24): [True: 0, False: 481k]
  ------------------
  550|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  551|      0|        return 0;
  552|      0|    }
  553|       |
  554|   481k|    if (p->data == NULL) {
  ------------------
  |  Branch (554:9): [True: 0, False: 481k]
  ------------------
  555|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  556|      0|        return 0;
  557|      0|    }
  558|       |
  559|   481k|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|   481k|#define OSSL_PARAM_UNSIGNED_INTEGER 2
  ------------------
  |  Branch (559:9): [True: 329k, False: 151k]
  ------------------
  560|   329k|#ifndef OPENSSL_SMALL_FOOTPRINT
  561|   329k|        uint64_t u64;
  562|       |
  563|   329k|        switch (p->data_size) {
  ------------------
  |  Branch (563:17): [True: 329k, False: 0]
  ------------------
  564|   329k|        case sizeof(uint32_t):
  ------------------
  |  Branch (564:9): [True: 329k, False: 0]
  ------------------
  565|   329k|            *val = *(const uint32_t *)p->data;
  566|   329k|            return 1;
  567|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (567:9): [True: 0, False: 329k]
  ------------------
  568|      0|            u64 = *(const uint64_t *)p->data;
  569|      0|            if (u64 <= UINT32_MAX) {
  ------------------
  |  Branch (569:17): [True: 0, False: 0]
  ------------------
  570|      0|                *val = (uint32_t)u64;
  571|      0|                return 1;
  572|      0|            }
  573|      0|            err_out_of_range;
  ------------------
  |  |   26|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  574|      0|            return 0;
  575|   329k|        }
  576|      0|#endif
  577|      0|        return general_get_uint(p, val, sizeof(*val));
  578|   329k|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|   151k|#define OSSL_PARAM_INTEGER 1
  ------------------
  |  Branch (578:16): [True: 151k, False: 0]
  ------------------
  579|   151k|#ifndef OPENSSL_SMALL_FOOTPRINT
  580|   151k|        int32_t i32;
  581|   151k|        int64_t i64;
  582|       |
  583|   151k|        switch (p->data_size) {
  ------------------
  |  Branch (583:17): [True: 151k, False: 0]
  ------------------
  584|   151k|        case sizeof(int32_t):
  ------------------
  |  Branch (584:9): [True: 151k, False: 0]
  ------------------
  585|   151k|            i32 = *(const int32_t *)p->data;
  586|   151k|            if (i32 >= 0) {
  ------------------
  |  Branch (586:17): [True: 151k, False: 0]
  ------------------
  587|   151k|                *val = i32;
  588|   151k|                return 1;
  589|   151k|            }
  590|      0|            err_unsigned_negative;
  ------------------
  |  |   23|   151k|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED)
  ------------------
  591|      0|            return 0;
  592|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (592:9): [True: 0, False: 151k]
  ------------------
  593|      0|            i64 = *(const int64_t *)p->data;
  594|      0|            if (i64 >= 0 && i64 <= UINT32_MAX) {
  ------------------
  |  Branch (594:17): [True: 0, False: 0]
  |  Branch (594:29): [True: 0, False: 0]
  ------------------
  595|      0|                *val = (uint32_t)i64;
  596|      0|                return 1;
  597|      0|            }
  598|      0|            if (i64 < 0)
  ------------------
  |  Branch (598:17): [True: 0, False: 0]
  ------------------
  599|      0|                err_unsigned_negative;
  ------------------
  |  |   23|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED)
  ------------------
  600|      0|            else
  601|      0|                err_out_of_range;
  ------------------
  |  |   26|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  602|      0|            return 0;
  603|   151k|        }
  604|      0|#endif
  605|      0|        return general_get_uint(p, val, sizeof(*val));
  606|   151k|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|#define OSSL_PARAM_REAL 3
  ------------------
  |  Branch (606:16): [True: 0, False: 0]
  ------------------
  607|      0|#ifndef OPENSSL_SYS_UEFI
  608|      0|        double d;
  609|       |
  610|      0|        switch (p->data_size) {
  ------------------
  |  Branch (610:17): [True: 0, False: 0]
  ------------------
  611|      0|        case sizeof(double):
  ------------------
  |  Branch (611:9): [True: 0, False: 0]
  ------------------
  612|      0|            d = *(const double *)p->data;
  613|      0|            if (d >= 0 && d <= UINT32_MAX && d == (uint32_t)d) {
  ------------------
  |  Branch (613:17): [True: 0, False: 0]
  |  Branch (613:27): [True: 0, False: 0]
  |  Branch (613:46): [True: 0, False: 0]
  ------------------
  614|      0|                *val = (uint32_t)d;
  615|      0|                return 1;
  616|      0|            }
  617|      0|            err_inexact;
  ------------------
  |  |   29|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      0|        CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  618|      0|            return 0;
  619|      0|        }
  620|      0|        err_unsupported_real;
  ------------------
  |  |   40|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  621|      0|        return 0;
  622|      0|#endif
  623|      0|    }
  624|      0|    err_bad_type;
  ------------------
  |  |   36|   481k|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  625|      0|    return 0;
  626|   481k|}
OSSL_PARAM_set_uint32:
  629|   116k|{
  630|   116k|    if (p == NULL) {
  ------------------
  |  Branch (630:9): [True: 0, False: 116k]
  ------------------
  631|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  632|      0|        return 0;
  633|      0|    }
  634|   116k|    p->return_size = 0;
  635|       |
  636|   116k|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|   116k|#define OSSL_PARAM_UNSIGNED_INTEGER 2
  ------------------
  |  Branch (636:9): [True: 116k, False: 0]
  ------------------
  637|   116k|#ifndef OPENSSL_SMALL_FOOTPRINT
  638|   116k|        p->return_size = sizeof(uint32_t); /* Minimum expected size */
  639|   116k|        if (p->data == NULL)
  ------------------
  |  Branch (639:13): [True: 0, False: 116k]
  ------------------
  640|      0|            return 1;
  641|   116k|        switch (p->data_size) {
  ------------------
  |  Branch (641:17): [True: 116k, False: 0]
  ------------------
  642|   116k|        case sizeof(uint32_t):
  ------------------
  |  Branch (642:9): [True: 116k, False: 0]
  ------------------
  643|   116k|            *(uint32_t *)p->data = val;
  644|   116k|            return 1;
  645|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (645:9): [True: 0, False: 116k]
  ------------------
  646|      0|            p->return_size = sizeof(uint64_t);
  647|      0|            *(uint64_t *)p->data = val;
  648|      0|            return 1;
  649|   116k|        }
  650|      0|#endif
  651|      0|        return general_set_uint(p, &val, sizeof(val));
  652|   116k|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|#define OSSL_PARAM_INTEGER 1
  ------------------
  |  Branch (652:16): [True: 0, False: 0]
  ------------------
  653|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  654|      0|        p->return_size = sizeof(int32_t); /* Minimum expected size */
  655|      0|        if (p->data == NULL)
  ------------------
  |  Branch (655:13): [True: 0, False: 0]
  ------------------
  656|      0|            return 1;
  657|      0|        switch (p->data_size) {
  ------------------
  |  Branch (657:17): [True: 0, False: 0]
  ------------------
  658|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (658:9): [True: 0, False: 0]
  ------------------
  659|      0|            if (val <= INT32_MAX) {
  ------------------
  |  Branch (659:17): [True: 0, False: 0]
  ------------------
  660|      0|                *(int32_t *)p->data = (int32_t)val;
  661|      0|                return 1;
  662|      0|            }
  663|      0|            err_out_of_range;
  ------------------
  |  |   26|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  664|      0|            return 0;
  665|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (665:9): [True: 0, False: 0]
  ------------------
  666|      0|            p->return_size = sizeof(int64_t);
  667|      0|            *(int64_t *)p->data = (int64_t)val;
  668|      0|            return 1;
  669|      0|        }
  670|      0|#endif
  671|      0|        return general_set_uint(p, &val, sizeof(val));
  672|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|#define OSSL_PARAM_REAL 3
  ------------------
  |  Branch (672:16): [True: 0, False: 0]
  ------------------
  673|      0|#ifndef OPENSSL_SYS_UEFI
  674|      0|        unsigned int shift;
  675|       |
  676|      0|        if (p->data == NULL) {
  ------------------
  |  Branch (676:13): [True: 0, False: 0]
  ------------------
  677|      0|            p->return_size = sizeof(double);
  678|      0|            return 1;
  679|      0|        }
  680|      0|        switch (p->data_size) {
  ------------------
  |  Branch (680:17): [True: 0, False: 0]
  ------------------
  681|      0|        case sizeof(double):
  ------------------
  |  Branch (681:9): [True: 0, False: 0]
  ------------------
  682|      0|            shift = real_shift();
  683|      0|            if (shift < 8 * sizeof(val) && (val >> shift) != 0) {
  ------------------
  |  Branch (683:17): [True: 0, False: 0]
  |  Branch (683:44): [True: 0, False: 0]
  ------------------
  684|      0|                err_inexact;
  ------------------
  |  |   29|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      0|        CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  685|      0|                return 0;
  686|      0|            }
  687|      0|            *(double *)p->data = (double)val;
  688|      0|            p->return_size = sizeof(double);
  689|      0|            return 1;
  690|      0|        }
  691|      0|        err_unsupported_real;
  ------------------
  |  |   40|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  692|      0|        return 0;
  693|      0|#endif
  694|      0|    }
  695|      0|    err_bad_type;
  ------------------
  |  |   36|   116k|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  696|      0|    return 0;
  697|   116k|}
OSSL_PARAM_construct_uint32:
  700|  10.6k|{
  701|  10.6k|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|  10.6k|#define OSSL_PARAM_UNSIGNED_INTEGER 2
  ------------------
  702|  10.6k|        sizeof(uint32_t));
  703|  10.6k|}
OSSL_PARAM_get_int64:
  706|  1.64k|{
  707|  1.64k|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (707:9): [True: 0, False: 1.64k]
  |  Branch (707:24): [True: 0, False: 1.64k]
  ------------------
  708|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  709|      0|        return 0;
  710|      0|    }
  711|       |
  712|  1.64k|    if (p->data == NULL) {
  ------------------
  |  Branch (712:9): [True: 0, False: 1.64k]
  ------------------
  713|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  714|      0|        return 0;
  715|      0|    }
  716|       |
  717|  1.64k|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|  1.64k|#define OSSL_PARAM_INTEGER 1
  ------------------
  |  Branch (717:9): [True: 1.64k, False: 0]
  ------------------
  718|  1.64k|#ifndef OPENSSL_SMALL_FOOTPRINT
  719|  1.64k|        switch (p->data_size) {
  ------------------
  |  Branch (719:17): [True: 1.64k, False: 0]
  ------------------
  720|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (720:9): [True: 0, False: 1.64k]
  ------------------
  721|      0|            *val = *(const int32_t *)p->data;
  722|      0|            return 1;
  723|  1.64k|        case sizeof(int64_t):
  ------------------
  |  Branch (723:9): [True: 1.64k, False: 0]
  ------------------
  724|  1.64k|            *val = *(const int64_t *)p->data;
  725|  1.64k|            return 1;
  726|  1.64k|        }
  727|      0|#endif
  728|      0|        return general_get_int(p, val, sizeof(*val));
  729|  1.64k|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|      0|#define OSSL_PARAM_UNSIGNED_INTEGER 2
  ------------------
  |  Branch (729:16): [True: 0, False: 0]
  ------------------
  730|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  731|      0|        uint64_t u64;
  732|       |
  733|      0|        switch (p->data_size) {
  ------------------
  |  Branch (733:17): [True: 0, False: 0]
  ------------------
  734|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (734:9): [True: 0, False: 0]
  ------------------
  735|      0|            *val = *(const uint32_t *)p->data;
  736|      0|            return 1;
  737|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (737:9): [True: 0, False: 0]
  ------------------
  738|      0|            u64 = *(const uint64_t *)p->data;
  739|      0|            if (u64 <= INT64_MAX) {
  ------------------
  |  Branch (739:17): [True: 0, False: 0]
  ------------------
  740|      0|                *val = (int64_t)u64;
  741|      0|                return 1;
  742|      0|            }
  743|      0|            err_out_of_range;
  ------------------
  |  |   26|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  744|      0|            return 0;
  745|      0|        }
  746|      0|#endif
  747|      0|        return general_get_int(p, val, sizeof(*val));
  748|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|#define OSSL_PARAM_REAL 3
  ------------------
  |  Branch (748:16): [True: 0, False: 0]
  ------------------
  749|      0|#ifndef OPENSSL_SYS_UEFI
  750|      0|        double d;
  751|       |
  752|      0|        switch (p->data_size) {
  ------------------
  |  Branch (752:17): [True: 0, False: 0]
  ------------------
  753|      0|        case sizeof(double):
  ------------------
  |  Branch (753:9): [True: 0, False: 0]
  ------------------
  754|      0|            d = *(const double *)p->data;
  755|      0|            if (d >= INT64_MIN
  ------------------
  |  Branch (755:17): [True: 0, False: 0]
  ------------------
  756|       |                /*
  757|       |                 * By subtracting 65535 (2^16-1) we cancel the low order
  758|       |                 * 15 bits of INT64_MAX to avoid using imprecise floating
  759|       |                 * point values.
  760|       |                 */
  761|      0|                && d < (double)(INT64_MAX - 65535) + 65536.0
  ------------------
  |  Branch (761:20): [True: 0, False: 0]
  ------------------
  762|      0|                && d == (int64_t)d) {
  ------------------
  |  Branch (762:20): [True: 0, False: 0]
  ------------------
  763|      0|                *val = (int64_t)d;
  764|      0|                return 1;
  765|      0|            }
  766|      0|            err_inexact;
  ------------------
  |  |   29|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      0|        CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  767|      0|            return 0;
  768|      0|        }
  769|      0|        err_unsupported_real;
  ------------------
  |  |   40|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  770|      0|        return 0;
  771|      0|#endif
  772|      0|    }
  773|      0|    err_bad_type;
  ------------------
  |  |   36|  1.64k|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  774|      0|    return 0;
  775|  1.64k|}
OSSL_PARAM_get_uint64:
  861|  34.5k|{
  862|  34.5k|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (862:9): [True: 0, False: 34.5k]
  |  Branch (862:24): [True: 0, False: 34.5k]
  ------------------
  863|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  864|      0|        return 0;
  865|      0|    }
  866|       |
  867|  34.5k|    if (p->data == NULL) {
  ------------------
  |  Branch (867:9): [True: 0, False: 34.5k]
  ------------------
  868|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  869|      0|        return 0;
  870|      0|    }
  871|       |
  872|  34.5k|    if (ossl_likely(p->data_type == OSSL_PARAM_UNSIGNED_INTEGER)) {
  ------------------
  |  |   22|  34.5k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 34.5k, False: 0]
  |  |  ------------------
  ------------------
  873|  34.5k|#ifndef OPENSSL_SMALL_FOOTPRINT
  874|  34.5k|        switch (p->data_size) {
  ------------------
  |  Branch (874:17): [True: 34.5k, False: 0]
  ------------------
  875|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (875:9): [True: 0, False: 34.5k]
  ------------------
  876|      0|            *val = *(const uint32_t *)p->data;
  877|      0|            return 1;
  878|  34.5k|        case sizeof(uint64_t):
  ------------------
  |  Branch (878:9): [True: 34.5k, False: 0]
  ------------------
  879|  34.5k|            *val = *(const uint64_t *)p->data;
  880|  34.5k|            return 1;
  881|  34.5k|        }
  882|      0|#endif
  883|      0|        return general_get_uint(p, val, sizeof(*val));
  884|  34.5k|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|#define OSSL_PARAM_INTEGER 1
  ------------------
  |  Branch (884:16): [True: 0, False: 0]
  ------------------
  885|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  886|      0|        int32_t i32;
  887|      0|        int64_t i64;
  888|       |
  889|      0|        switch (p->data_size) {
  ------------------
  |  Branch (889:17): [True: 0, False: 0]
  ------------------
  890|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (890:9): [True: 0, False: 0]
  ------------------
  891|      0|            i32 = *(const int32_t *)p->data;
  892|      0|            if (i32 >= 0) {
  ------------------
  |  Branch (892:17): [True: 0, False: 0]
  ------------------
  893|      0|                *val = (uint64_t)i32;
  894|      0|                return 1;
  895|      0|            }
  896|      0|            err_unsigned_negative;
  ------------------
  |  |   23|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED)
  ------------------
  897|      0|            return 0;
  898|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (898:9): [True: 0, False: 0]
  ------------------
  899|      0|            i64 = *(const int64_t *)p->data;
  900|      0|            if (i64 >= 0) {
  ------------------
  |  Branch (900:17): [True: 0, False: 0]
  ------------------
  901|      0|                *val = (uint64_t)i64;
  902|      0|                return 1;
  903|      0|            }
  904|      0|            err_unsigned_negative;
  ------------------
  |  |   23|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED)
  ------------------
  905|      0|            return 0;
  906|      0|        }
  907|      0|#endif
  908|      0|        return general_get_uint(p, val, sizeof(*val));
  909|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|#define OSSL_PARAM_REAL 3
  ------------------
  |  Branch (909:16): [True: 0, False: 0]
  ------------------
  910|      0|#ifndef OPENSSL_SYS_UEFI
  911|      0|        double d;
  912|       |
  913|      0|        switch (p->data_size) {
  ------------------
  |  Branch (913:17): [True: 0, False: 0]
  ------------------
  914|      0|        case sizeof(double):
  ------------------
  |  Branch (914:9): [True: 0, False: 0]
  ------------------
  915|      0|            d = *(const double *)p->data;
  916|      0|            if (d >= 0
  ------------------
  |  Branch (916:17): [True: 0, False: 0]
  ------------------
  917|       |                /*
  918|       |                 * By subtracting 65535 (2^16-1) we cancel the low order
  919|       |                 * 15 bits of UINT64_MAX to avoid using imprecise floating
  920|       |                 * point values.
  921|       |                 */
  922|      0|                && d < (double)(UINT64_MAX - 65535) + 65536.0
  ------------------
  |  Branch (922:20): [True: 0, False: 0]
  ------------------
  923|      0|                && d == (uint64_t)d) {
  ------------------
  |  Branch (923:20): [True: 0, False: 0]
  ------------------
  924|      0|                *val = (uint64_t)d;
  925|      0|                return 1;
  926|      0|            }
  927|      0|            err_inexact;
  ------------------
  |  |   29|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      0|        CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  928|      0|            return 0;
  929|      0|        }
  930|      0|        err_unsupported_real;
  ------------------
  |  |   40|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  931|      0|        return 0;
  932|      0|#endif
  933|      0|    }
  934|      0|    err_bad_type;
  ------------------
  |  |   36|  34.5k|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  935|      0|    return 0;
  936|  34.5k|}
OSSL_PARAM_set_uint64:
  939|   324k|{
  940|   324k|    if (p == NULL) {
  ------------------
  |  Branch (940:9): [True: 0, False: 324k]
  ------------------
  941|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  942|      0|        return 0;
  943|      0|    }
  944|   324k|    p->return_size = 0;
  945|       |
  946|   324k|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|   324k|#define OSSL_PARAM_UNSIGNED_INTEGER 2
  ------------------
  |  Branch (946:9): [True: 319k, False: 5.30k]
  ------------------
  947|   319k|#ifndef OPENSSL_SMALL_FOOTPRINT
  948|   319k|        if (p->data == NULL) {
  ------------------
  |  Branch (948:13): [True: 0, False: 319k]
  ------------------
  949|      0|            p->return_size = sizeof(uint64_t); /* Expected size */
  950|      0|            return 1;
  951|      0|        }
  952|   319k|        switch (p->data_size) {
  ------------------
  |  Branch (952:17): [True: 319k, False: 0]
  ------------------
  953|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (953:9): [True: 0, False: 319k]
  ------------------
  954|      0|            if (val <= UINT32_MAX) {
  ------------------
  |  Branch (954:17): [True: 0, False: 0]
  ------------------
  955|      0|                p->return_size = sizeof(uint32_t);
  956|      0|                *(uint32_t *)p->data = (uint32_t)val;
  957|      0|                return 1;
  958|      0|            }
  959|      0|            err_out_of_range;
  ------------------
  |  |   26|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  960|      0|            return 0;
  961|   319k|        case sizeof(uint64_t):
  ------------------
  |  Branch (961:9): [True: 319k, False: 0]
  ------------------
  962|   319k|            p->return_size = sizeof(uint64_t);
  963|   319k|            *(uint64_t *)p->data = val;
  964|   319k|            return 1;
  965|   319k|        }
  966|      0|#endif
  967|      0|        return general_set_uint(p, &val, sizeof(val));
  968|   319k|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|  5.30k|#define OSSL_PARAM_INTEGER 1
  ------------------
  |  Branch (968:16): [True: 5.30k, False: 0]
  ------------------
  969|  5.30k|#ifndef OPENSSL_SMALL_FOOTPRINT
  970|  5.30k|        if (p->data == NULL) {
  ------------------
  |  Branch (970:13): [True: 0, False: 5.30k]
  ------------------
  971|      0|            p->return_size = sizeof(int64_t); /* Expected size */
  972|      0|            return 1;
  973|      0|        }
  974|  5.30k|        switch (p->data_size) {
  ------------------
  |  Branch (974:17): [True: 5.30k, False: 0]
  ------------------
  975|  5.30k|        case sizeof(int32_t):
  ------------------
  |  Branch (975:9): [True: 5.30k, False: 0]
  ------------------
  976|  5.30k|            if (val <= INT32_MAX) {
  ------------------
  |  Branch (976:17): [True: 5.30k, False: 0]
  ------------------
  977|  5.30k|                p->return_size = sizeof(int32_t);
  978|  5.30k|                *(int32_t *)p->data = (int32_t)val;
  979|  5.30k|                return 1;
  980|  5.30k|            }
  981|      0|            err_out_of_range;
  ------------------
  |  |   26|  5.30k|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  982|      0|            return 0;
  983|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (983:9): [True: 0, False: 5.30k]
  ------------------
  984|      0|            if (val <= INT64_MAX) {
  ------------------
  |  Branch (984:17): [True: 0, False: 0]
  ------------------
  985|      0|                p->return_size = sizeof(int64_t);
  986|      0|                *(int64_t *)p->data = (int64_t)val;
  987|      0|                return 1;
  988|      0|            }
  989|      0|            err_out_of_range;
  ------------------
  |  |   26|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   27|      0|        CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  990|      0|            return 0;
  991|  5.30k|        }
  992|      0|#endif
  993|      0|        return general_set_uint(p, &val, sizeof(val));
  994|  5.30k|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|#define OSSL_PARAM_REAL 3
  ------------------
  |  Branch (994:16): [True: 0, False: 0]
  ------------------
  995|      0|#ifndef OPENSSL_SYS_UEFI
  996|      0|        switch (p->data_size) {
  ------------------
  |  Branch (996:17): [True: 0, False: 0]
  ------------------
  997|      0|        case sizeof(double):
  ------------------
  |  Branch (997:9): [True: 0, False: 0]
  ------------------
  998|      0|            if ((val >> real_shift()) == 0) {
  ------------------
  |  Branch (998:17): [True: 0, False: 0]
  ------------------
  999|      0|                p->return_size = sizeof(double);
 1000|      0|                *(double *)p->data = (double)val;
 1001|      0|                return 1;
 1002|      0|            }
 1003|      0|            err_inexact;
  ------------------
  |  |   29|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   30|      0|        CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
 1004|      0|            return 0;
 1005|      0|        }
 1006|      0|        err_unsupported_real;
  ------------------
  |  |   40|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1007|      0|        return 0;
 1008|      0|#endif
 1009|      0|    }
 1010|      0|    err_bad_type;
  ------------------
  |  |   36|   324k|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1011|      0|    return 0;
 1012|   324k|}
OSSL_PARAM_construct_uint64:
 1015|  10.6k|{
 1016|  10.6k|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|  10.6k|#define OSSL_PARAM_UNSIGNED_INTEGER 2
  ------------------
 1017|  10.6k|        sizeof(uint64_t));
 1018|  10.6k|}
OSSL_PARAM_get_size_t:
 1021|  23.8k|{
 1022|  23.8k|#ifndef OPENSSL_SMALL_FOOTPRINT
 1023|  23.8k|    switch (sizeof(size_t)) {
  ------------------
  |  Branch (1023:13): [True: 23.8k, Folded]
  ------------------
 1024|      0|    case sizeof(uint32_t):
  ------------------
  |  Branch (1024:5): [True: 0, False: 23.8k]
  ------------------
 1025|      0|        return OSSL_PARAM_get_uint32(p, (uint32_t *)val);
 1026|  23.8k|    case sizeof(uint64_t):
  ------------------
  |  Branch (1026:5): [True: 23.8k, False: 0]
  ------------------
 1027|  23.8k|        return OSSL_PARAM_get_uint64(p, (uint64_t *)val);
 1028|  23.8k|    }
 1029|      0|#endif
 1030|      0|    return general_get_uint(p, val, sizeof(*val));
 1031|  23.8k|}
OSSL_PARAM_set_size_t:
 1034|   324k|{
 1035|   324k|#ifndef OPENSSL_SMALL_FOOTPRINT
 1036|   324k|    switch (sizeof(size_t)) {
  ------------------
  |  Branch (1036:13): [True: 324k, Folded]
  ------------------
 1037|      0|    case sizeof(uint32_t):
  ------------------
  |  Branch (1037:5): [True: 0, False: 324k]
  ------------------
 1038|      0|        return OSSL_PARAM_set_uint32(p, (uint32_t)val);
 1039|   324k|    case sizeof(uint64_t):
  ------------------
  |  Branch (1039:5): [True: 324k, False: 0]
  ------------------
 1040|   324k|        return OSSL_PARAM_set_uint64(p, (uint64_t)val);
 1041|   324k|    }
 1042|      0|#endif
 1043|      0|    return general_set_uint(p, &val, sizeof(val));
 1044|   324k|}
OSSL_PARAM_construct_size_t:
 1047|   343k|{
 1048|   343k|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|   343k|#define OSSL_PARAM_UNSIGNED_INTEGER 2
  ------------------
 1049|   343k|        sizeof(size_t));
 1050|   343k|}
OSSL_PARAM_get_time_t:
 1053|  1.64k|{
 1054|  1.64k|#ifndef OPENSSL_SMALL_FOOTPRINT
 1055|  1.64k|    switch (sizeof(time_t)) {
  ------------------
  |  Branch (1055:13): [True: 1.64k, Folded]
  ------------------
 1056|      0|    case sizeof(int32_t):
  ------------------
  |  Branch (1056:5): [True: 0, False: 1.64k]
  ------------------
 1057|      0|        return OSSL_PARAM_get_int32(p, (int32_t *)val);
 1058|  1.64k|    case sizeof(int64_t):
  ------------------
  |  Branch (1058:5): [True: 1.64k, False: 0]
  ------------------
 1059|  1.64k|        return OSSL_PARAM_get_int64(p, (int64_t *)val);
 1060|  1.64k|    }
 1061|      0|#endif
 1062|      0|    return general_get_int(p, val, sizeof(*val));
 1063|  1.64k|}
OSSL_PARAM_construct_time_t:
 1079|  1.64k|{
 1080|  1.64k|    return ossl_param_construct(key, OSSL_PARAM_INTEGER, buf, sizeof(time_t));
  ------------------
  |  |  106|  1.64k|#define OSSL_PARAM_INTEGER 1
  ------------------
 1081|  1.64k|}
OSSL_PARAM_get_utf8_string:
 1381|   824k|{
 1382|   824k|    int ret = get_string_internal(p, (void **)val, &max_len, NULL,
 1383|   824k|        OSSL_PARAM_UTF8_STRING);
  ------------------
  |  |  117|   824k|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
 1384|       |
 1385|       |    /*
 1386|       |     * We try to ensure that the copied string is terminated with a
 1387|       |     * NUL byte.  That should be easy, just place a NUL byte at
 1388|       |     * |((char*)*val)[p->data_size]|.
 1389|       |     * Unfortunately, we have seen cases where |p->data_size| doesn't
 1390|       |     * correctly reflect the length of the string, and just happens
 1391|       |     * to be out of bounds according to |max_len|, so in that case, we
 1392|       |     * make the extra step of trying to find the true length of the
 1393|       |     * string that |p->data| points at, and use that as an index to
 1394|       |     * place the NUL byte in |*val|.
 1395|       |     */
 1396|   824k|    size_t data_length = p->data_size;
 1397|       |
 1398|   824k|    if (ret == 0)
  ------------------
  |  Branch (1398:9): [True: 0, False: 824k]
  ------------------
 1399|      0|        return 0;
 1400|   824k|    if (data_length >= max_len)
  ------------------
  |  Branch (1400:9): [True: 0, False: 824k]
  ------------------
 1401|      0|        data_length = OPENSSL_strnlen(p->data, data_length);
 1402|   824k|    if (data_length >= max_len) {
  ------------------
  |  Branch (1402:9): [True: 0, False: 824k]
  ------------------
 1403|      0|        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_NO_SPACE_FOR_TERMINATING_NULL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1404|      0|        return 0; /* No space for a terminating NUL byte */
 1405|      0|    }
 1406|   824k|    (*val)[data_length] = '\0';
 1407|       |
 1408|   824k|    return ret;
 1409|   824k|}
OSSL_PARAM_get_octet_string:
 1413|  2.65k|{
 1414|  2.65k|    return get_string_internal(p, val, &max_len, used_len,
 1415|  2.65k|        OSSL_PARAM_OCTET_STRING);
  ------------------
  |  |  123|  2.65k|#define OSSL_PARAM_OCTET_STRING 5
  ------------------
 1416|  2.65k|}
OSSL_PARAM_set_octet_string:
 1452|  2.64k|{
 1453|  2.64k|    if (p == NULL || val == NULL) {
  ------------------
  |  Branch (1453:9): [True: 0, False: 2.64k]
  |  Branch (1453:22): [True: 0, False: 2.64k]
  ------------------
 1454|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1455|      0|        return 0;
 1456|      0|    }
 1457|  2.64k|    p->return_size = 0;
 1458|  2.64k|    return set_string_internal(p, val, len, OSSL_PARAM_OCTET_STRING);
  ------------------
  |  |  123|  2.64k|#define OSSL_PARAM_OCTET_STRING 5
  ------------------
 1459|  2.64k|}
OSSL_PARAM_construct_utf8_string:
 1463|  2.06M|{
 1464|  2.06M|    if (buf != NULL && bsize == 0)
  ------------------
  |  Branch (1464:9): [True: 2.06M, False: 0]
  |  Branch (1464:24): [True: 2.06M, False: 0]
  ------------------
 1465|  2.06M|        bsize = strlen(buf);
 1466|  2.06M|    return ossl_param_construct(key, OSSL_PARAM_UTF8_STRING, buf, bsize);
  ------------------
  |  |  117|  2.06M|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
 1467|  2.06M|}
OSSL_PARAM_construct_octet_string:
 1471|   830k|{
 1472|   830k|    return ossl_param_construct(key, OSSL_PARAM_OCTET_STRING, buf, bsize);
  ------------------
  |  |  123|   830k|#define OSSL_PARAM_OCTET_STRING 5
  ------------------
 1473|   830k|}
OSSL_PARAM_construct_end:
 1665|  1.41M|{
 1666|  1.41M|    OSSL_PARAM end = OSSL_PARAM_END;
  ------------------
  |  |   25|  1.41M|    { NULL, 0, NULL, 0, 0 }
  ------------------
 1667|       |
 1668|  1.41M|    return end;
 1669|  1.41M|}
OSSL_PARAM_get_utf8_string_ptr:
 1694|  1.23M|{
 1695|  1.23M|    return get_string_ptr_internal(p, (const void **)val, NULL,
 1696|  1.23M|        OSSL_PARAM_UTF8_PTR,
  ------------------
  |  |  141|  1.23M|#define OSSL_PARAM_UTF8_PTR 6
  ------------------
 1697|  1.23M|        OSSL_PARAM_UTF8_STRING);
  ------------------
  |  |  117|  1.23M|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
 1698|  1.23M|}
params.c:ossl_param_construct:
   70|  6.46M|{
   71|  6.46M|    OSSL_PARAM res;
   72|       |
   73|  6.46M|    res.key = key;
   74|  6.46M|    res.data_type = data_type;
   75|  6.46M|    res.data = data;
   76|  6.46M|    res.data_size = data_size;
   77|  6.46M|    res.return_size = OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|  6.46M|#define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
   78|  6.46M|    return res;
   79|  6.46M|}
params.c:get_string_internal:
 1333|   827k|{
 1334|   827k|    size_t sz, alloc_sz;
 1335|       |
 1336|   827k|    if ((val == NULL && used_len == NULL) || p == NULL) {
  ------------------
  |  Branch (1336:10): [True: 0, False: 827k]
  |  Branch (1336:25): [True: 0, False: 0]
  |  Branch (1336:46): [True: 0, False: 827k]
  ------------------
 1337|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1338|      0|        return 0;
 1339|      0|    }
 1340|   827k|    if (p->data_type != type) {
  ------------------
  |  Branch (1340:9): [True: 0, False: 827k]
  ------------------
 1341|      0|        err_bad_type;
  ------------------
  |  |   36|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1342|      0|        return 0;
 1343|      0|    }
 1344|       |
 1345|   827k|    sz = p->data_size;
 1346|       |    /*
 1347|       |     * If the input size is 0, or the input string needs NUL byte
 1348|       |     * termination, allocate an extra byte.
 1349|       |     */
 1350|   827k|    alloc_sz = sz + (type == OSSL_PARAM_UTF8_STRING || sz == 0);
  ------------------
  |  |  117|  1.65M|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (1350:22): [True: 824k, False: 2.65k]
  |  Branch (1350:56): [True: 0, False: 2.65k]
  ------------------
 1351|       |
 1352|   827k|    if (used_len != NULL)
  ------------------
  |  Branch (1352:9): [True: 2.65k, False: 824k]
  ------------------
 1353|  2.65k|        *used_len = sz;
 1354|       |
 1355|   827k|    if (p->data == NULL) {
  ------------------
  |  Branch (1355:9): [True: 0, False: 827k]
  ------------------
 1356|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1357|      0|        return 0;
 1358|      0|    }
 1359|       |
 1360|   827k|    if (val == NULL)
  ------------------
  |  Branch (1360:9): [True: 0, False: 827k]
  ------------------
 1361|      0|        return 1;
 1362|       |
 1363|   827k|    if (*val == NULL) {
  ------------------
  |  Branch (1363:9): [True: 824k, False: 2.66k]
  ------------------
 1364|   824k|        char *const q = OPENSSL_malloc(alloc_sz);
  ------------------
  |  |  106|   824k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1365|       |
 1366|   824k|        if (q == NULL)
  ------------------
  |  Branch (1366:13): [True: 0, False: 824k]
  ------------------
 1367|      0|            return 0;
 1368|   824k|        *val = q;
 1369|   824k|        *max_len = alloc_sz;
 1370|   824k|    }
 1371|       |
 1372|   827k|    if (*max_len < sz) {
  ------------------
  |  Branch (1372:9): [True: 0, False: 827k]
  ------------------
 1373|      0|        err_too_small;
  ------------------
  |  |   34|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_SMALL_BUFFER)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1374|      0|        return 0;
 1375|      0|    }
 1376|   827k|    memcpy(*val, p->data, sz);
 1377|   827k|    return 1;
 1378|   827k|}
params.c:set_string_internal:
 1420|  2.64k|{
 1421|  2.64k|    if (p->data_type != type) {
  ------------------
  |  Branch (1421:9): [True: 0, False: 2.64k]
  ------------------
 1422|      0|        err_bad_type;
  ------------------
  |  |   36|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1423|      0|        return 0;
 1424|      0|    }
 1425|  2.64k|    p->return_size = len;
 1426|  2.64k|    if (p->data == NULL)
  ------------------
  |  Branch (1426:9): [True: 1.32k, False: 1.32k]
  ------------------
 1427|  1.32k|        return 1;
 1428|  1.32k|    if (p->data_size < len) {
  ------------------
  |  Branch (1428:9): [True: 0, False: 1.32k]
  ------------------
 1429|      0|        err_too_small;
  ------------------
  |  |   34|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_SMALL_BUFFER)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1430|      0|        return 0;
 1431|      0|    }
 1432|       |
 1433|  1.32k|    memcpy(p->data, val, len);
 1434|       |    /* If possible within the size of p->data, add a NUL terminator byte */
 1435|  1.32k|    if (type == OSSL_PARAM_UTF8_STRING && p->data_size > len)
  ------------------
  |  |  117|  2.64k|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (1435:9): [True: 0, False: 1.32k]
  |  Branch (1435:43): [True: 0, False: 0]
  ------------------
 1436|      0|        ((char *)p->data)[len] = '\0';
 1437|  1.32k|    return 1;
 1438|  1.32k|}
params.c:get_string_ptr_internal:
 1674|  1.23M|{
 1675|  1.23M|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (1675:9): [True: 0, False: 1.23M]
  |  Branch (1675:24): [True: 0, False: 1.23M]
  ------------------
 1676|      0|        err_null_argument;
  ------------------
  |  |   38|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1677|      0|        return 0;
 1678|      0|    }
 1679|       |
 1680|  1.23M|    if (p->data_type == ref_type)
  ------------------
  |  Branch (1680:9): [True: 0, False: 1.23M]
  ------------------
 1681|      0|        return get_ptr_internal_skip_checks(p, (const void **)val, used_len);
 1682|       |
 1683|  1.23M|    if (p->data_type != type) {
  ------------------
  |  Branch (1683:9): [True: 0, False: 1.23M]
  ------------------
 1684|      0|        err_bad_type;
  ------------------
  |  |   36|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  408|      0|        ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1685|      0|        return 0;
 1686|      0|    }
 1687|  1.23M|    if (used_len != NULL)
  ------------------
  |  Branch (1687:9): [True: 0, False: 1.23M]
  ------------------
 1688|      0|        *used_len = p->data_size;
 1689|  1.23M|    *val = p->data;
 1690|  1.23M|    return 1;
 1691|  1.23M|}

ossl_param_bytes_to_blocks:
   31|  5.76k|{
   32|  5.76k|    return (bytes + OSSL_PARAM_ALIGN_SIZE - 1) / OSSL_PARAM_ALIGN_SIZE;
  ------------------
  |  |   22|  5.76k|#define OSSL_PARAM_ALIGN_SIZE sizeof(OSSL_PARAM_ALIGNED_BLOCK)
  ------------------
                  return (bytes + OSSL_PARAM_ALIGN_SIZE - 1) / OSSL_PARAM_ALIGN_SIZE;
  ------------------
  |  |   22|  5.76k|#define OSSL_PARAM_ALIGN_SIZE sizeof(OSSL_PARAM_ALIGNED_BLOCK)
  ------------------
   33|  5.76k|}
ossl_param_set_secure_block:
   56|  2.88k|{
   57|  2.88k|    last->key = NULL;
   58|  2.88k|    last->data_size = secure_buffer_sz;
   59|  2.88k|    last->data = secure_buffer;
   60|  2.88k|    last->data_type = OSSL_PARAM_ALLOCATED_END;
  ------------------
  |  |   16|  2.88k|#define OSSL_PARAM_ALLOCATED_END 127
  ------------------
   61|  2.88k|}
OSSL_PARAM_free:
  233|  2.88k|{
  234|  2.88k|    if (params != NULL) {
  ------------------
  |  Branch (234:9): [True: 2.88k, False: 0]
  ------------------
  235|  2.88k|        OSSL_PARAM *p;
  236|       |
  237|  5.76k|        for (p = params; p->key != NULL; p++)
  ------------------
  |  Branch (237:26): [True: 2.88k, False: 2.88k]
  ------------------
  238|  2.88k|            ;
  239|  2.88k|        if (p->data_type == OSSL_PARAM_ALLOCATED_END)
  ------------------
  |  |   16|  2.88k|#define OSSL_PARAM_ALLOCATED_END 127
  ------------------
  |  Branch (239:13): [True: 2.88k, False: 0]
  ------------------
  240|  2.88k|            OPENSSL_secure_clear_free(p->data, p->data_size);
  ------------------
  |  |  149|  2.88k|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  241|  2.88k|        OPENSSL_free(params);
  ------------------
  |  |  131|  2.88k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  242|  2.88k|    }
  243|  2.88k|}

ossl_pw_clear_passphrase_data:
   17|   412k|{
   18|   412k|    if (data != NULL) {
  ------------------
  |  Branch (18:9): [True: 412k, False: 0]
  ------------------
   19|   412k|        if (data->type == is_expl_passphrase)
  ------------------
  |  Branch (19:13): [True: 0, False: 412k]
  ------------------
   20|      0|            OPENSSL_clear_free(data->_.expl_passphrase.passphrase_copy,
  ------------------
  |  |  129|      0|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   21|   412k|                data->_.expl_passphrase.passphrase_len);
   22|   412k|        ossl_pw_clear_passphrase_cache(data);
   23|   412k|        memset(data, 0, sizeof(*data));
   24|   412k|    }
   25|   412k|}
ossl_pw_clear_passphrase_cache:
   28|   824k|{
   29|   824k|    OPENSSL_clear_free(data->cached_passphrase, data->cached_passphrase_len);
  ------------------
  |  |  129|   824k|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   30|       |    data->cached_passphrase = NULL;
   31|   824k|}
ossl_pw_enable_passphrase_caching:
   94|   412k|{
   95|   412k|    data->flag_cache_passphrase = 1;
   96|   412k|    return 1;
   97|   412k|}

ossl_err_load_PEM_strings:
   70|      1|{
   71|      1|#ifndef OPENSSL_NO_ERR
   72|      1|    if (ERR_reason_error_string(PEM_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (72:9): [True: 1, False: 0]
  ------------------
   73|      1|        ERR_load_strings_const(PEM_str_reasons);
   74|      1|#endif
   75|      1|    return 1;
   76|      1|}

PEM_X509_INFO_read_bio_ex:
   56|  2.83k|{
   57|  2.83k|    X509_INFO *xi = NULL;
   58|  2.83k|    char *name = NULL, *header = NULL, *str;
   59|  2.83k|    void *pp;
   60|  2.83k|    unsigned char *data = NULL;
   61|  2.83k|    const unsigned char *p;
   62|  2.83k|    long len, error = 0;
   63|  2.83k|    int ok = 0;
   64|  2.83k|    STACK_OF(X509_INFO) *ret = NULL;
  ------------------
  |  |   33|  2.83k|#define STACK_OF(type) struct stack_st_##type
  ------------------
   65|  2.83k|    unsigned int i, raw, ptype;
   66|  2.83k|    d2i_of_void *d2i = 0;
   67|       |
   68|  2.83k|    if (sk == NULL) {
  ------------------
  |  Branch (68:9): [True: 2.83k, False: 0]
  ------------------
   69|  2.83k|        if ((ret = sk_X509_INFO_new_null()) == NULL) {
  ------------------
  |  |  400|  2.83k|#define sk_X509_INFO_new_null() ((STACK_OF(X509_INFO) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (69:13): [True: 0, False: 2.83k]
  ------------------
   70|      0|            ERR_raise(ERR_LIB_PEM, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   71|      0|            goto err;
   72|      0|        }
   73|  2.83k|    } else
   74|      0|        ret = sk;
   75|       |
   76|  2.83k|    if ((xi = X509_INFO_new()) == NULL)
  ------------------
  |  Branch (76:9): [True: 0, False: 2.83k]
  ------------------
   77|      0|        goto err;
   78|   415k|    for (;;) {
   79|   415k|        raw = 0;
   80|   415k|        ptype = 0;
   81|   415k|        ERR_set_mark();
   82|   415k|        i = PEM_read_bio(bp, &name, &header, &data, &len);
   83|   415k|        if (i == 0) {
  ------------------
  |  Branch (83:13): [True: 2.83k, False: 412k]
  ------------------
   84|  2.83k|            error = ERR_GET_REASON(ERR_peek_last_error());
   85|  2.83k|            if (error == PEM_R_NO_START_LINE) {
  ------------------
  |  |   44|  2.83k|#define PEM_R_NO_START_LINE 108
  ------------------
  |  Branch (85:17): [True: 2.83k, False: 0]
  ------------------
   86|  2.83k|                ERR_pop_to_mark();
   87|  2.83k|                break;
   88|  2.83k|            }
   89|      0|            ERR_clear_last_mark();
   90|      0|            goto err;
   91|  2.83k|        }
   92|   412k|        ERR_clear_last_mark();
   93|   821k|    start:
   94|   821k|        if (strcmp(name, PEM_STRING_X509) == 0
  ------------------
  |  |   36|   821k|#define PEM_STRING_X509 "CERTIFICATE"
  ------------------
  |  Branch (94:13): [True: 821k, False: 0]
  ------------------
   95|      0|            || strcmp(name, PEM_STRING_X509_OLD) == 0
  ------------------
  |  |   35|      0|#define PEM_STRING_X509_OLD "X509 CERTIFICATE"
  ------------------
  |  Branch (95:16): [True: 0, False: 0]
  ------------------
   96|   821k|            || strcmp(name, PEM_STRING_X509_TRUSTED) == 0) {
  ------------------
  |  |   37|      0|#define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE"
  ------------------
  |  Branch (96:16): [True: 0, False: 0]
  ------------------
   97|   821k|            if (xi->x509 != NULL) {
  ------------------
  |  Branch (97:17): [True: 409k, False: 412k]
  ------------------
   98|   409k|                if (!sk_X509_INFO_push(ret, xi))
  ------------------
  |  |  407|   409k|#define sk_X509_INFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr))
  ------------------
  |  Branch (98:21): [True: 0, False: 409k]
  ------------------
   99|      0|                    goto err;
  100|   409k|                if ((xi = X509_INFO_new()) == NULL)
  ------------------
  |  Branch (100:21): [True: 0, False: 409k]
  ------------------
  101|      0|                    goto err;
  102|   409k|                goto start;
  103|   409k|            }
  104|   412k|            if ((strcmp(name, PEM_STRING_X509_TRUSTED) == 0))
  ------------------
  |  |   37|   412k|#define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE"
  ------------------
  |  Branch (104:17): [True: 0, False: 412k]
  ------------------
  105|      0|                d2i = (D2I_OF(void))d2i_X509_AUX;
  106|   412k|            else
  107|   412k|                d2i = (D2I_OF(void))d2i_X509;
  108|   412k|            xi->x509 = X509_new_ex(libctx, propq);
  109|   412k|            if (xi->x509 == NULL)
  ------------------
  |  Branch (109:17): [True: 0, False: 412k]
  ------------------
  110|      0|                goto err;
  111|   412k|            pp = &(xi->x509);
  112|   412k|        } else if (strcmp(name, PEM_STRING_X509_CRL) == 0) {
  ------------------
  |  |   40|      0|#define PEM_STRING_X509_CRL "X509 CRL"
  ------------------
  |  Branch (112:20): [True: 0, False: 0]
  ------------------
  113|      0|            d2i = (D2I_OF(void))d2i_X509_CRL;
  114|      0|            if (xi->crl != NULL) {
  ------------------
  |  Branch (114:17): [True: 0, False: 0]
  ------------------
  115|      0|                if (!sk_X509_INFO_push(ret, xi))
  ------------------
  |  |  407|      0|#define sk_X509_INFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr))
  ------------------
  |  Branch (115:21): [True: 0, False: 0]
  ------------------
  116|      0|                    goto err;
  117|      0|                if ((xi = X509_INFO_new()) == NULL)
  ------------------
  |  Branch (117:21): [True: 0, False: 0]
  ------------------
  118|      0|                    goto err;
  119|      0|                goto start;
  120|      0|            }
  121|      0|            pp = &(xi->crl);
  122|      0|        } else if ((str = strstr(name, PEM_STRING_PKCS8INF)) != NULL) {
  ------------------
  |  |   50|      0|#define PEM_STRING_PKCS8INF "PRIVATE KEY"
  ------------------
  |  Branch (122:20): [True: 0, False: 0]
  ------------------
  123|      0|            if (xi->x_pkey != NULL) {
  ------------------
  |  Branch (123:17): [True: 0, False: 0]
  ------------------
  124|      0|                if (!sk_X509_INFO_push(ret, xi))
  ------------------
  |  |  407|      0|#define sk_X509_INFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr))
  ------------------
  |  Branch (124:21): [True: 0, False: 0]
  ------------------
  125|      0|                    goto err;
  126|      0|                if ((xi = X509_INFO_new()) == NULL)
  ------------------
  |  Branch (126:21): [True: 0, False: 0]
  ------------------
  127|      0|                    goto err;
  128|      0|                goto start;
  129|      0|            }
  130|      0|            if (str == name || strcmp(name, PEM_STRING_PKCS8) == 0) {
  ------------------
  |  |   49|      0|#define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY"
  ------------------
  |  Branch (130:17): [True: 0, False: 0]
  |  Branch (130:32): [True: 0, False: 0]
  ------------------
  131|      0|                ptype = EVP_PKEY_NONE;
  ------------------
  |  |   62|      0|#define EVP_PKEY_NONE NID_undef
  |  |  ------------------
  |  |  |  |   18|      0|#define NID_undef                       0
  |  |  ------------------
  ------------------
  132|      0|            } else {
  133|       |                /* chop " PRIVATE KEY" */
  134|      0|                *--str = '\0';
  135|      0|                ptype = evp_pkey_name2type(name);
  136|      0|            }
  137|      0|            xi->enc_data = NULL;
  138|      0|            xi->enc_len = 0;
  139|       |
  140|      0|            d2i = (D2I_OF(void))d2i_AutoPrivateKey;
  141|      0|            xi->x_pkey = X509_PKEY_new();
  142|      0|            if (xi->x_pkey == NULL)
  ------------------
  |  Branch (142:17): [True: 0, False: 0]
  ------------------
  143|      0|                goto err;
  144|      0|            pp = &xi->x_pkey->dec_pkey;
  145|      0|            if ((int)strlen(header) > 10 /* assume encrypted */
  ------------------
  |  Branch (145:17): [True: 0, False: 0]
  ------------------
  146|      0|                || strcmp(name, PEM_STRING_PKCS8) == 0)
  ------------------
  |  |   49|      0|#define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY"
  ------------------
  |  Branch (146:20): [True: 0, False: 0]
  ------------------
  147|      0|                raw = 1;
  148|      0|        } else { /* unknown */
  149|      0|            d2i = NULL;
  150|      0|            pp = NULL;
  151|      0|        }
  152|       |
  153|   412k|        if (d2i != NULL) {
  ------------------
  |  Branch (153:13): [True: 412k, False: 0]
  ------------------
  154|   412k|            if (!raw) {
  ------------------
  |  Branch (154:17): [True: 412k, False: 0]
  ------------------
  155|   412k|                EVP_CIPHER_INFO cipher;
  156|       |
  157|   412k|                if (!PEM_get_EVP_CIPHER_INFO(header, &cipher))
  ------------------
  |  Branch (157:21): [True: 0, False: 412k]
  ------------------
  158|      0|                    goto err;
  159|   412k|                if (!PEM_do_header(&cipher, data, &len, cb, u))
  ------------------
  |  Branch (159:21): [True: 0, False: 412k]
  ------------------
  160|      0|                    goto err;
  161|   412k|                p = data;
  162|   412k|                if (ptype) {
  ------------------
  |  Branch (162:21): [True: 0, False: 412k]
  ------------------
  163|      0|                    if (d2i_PrivateKey_ex(ptype, pp, &p, len,
  ------------------
  |  Branch (163:25): [True: 0, False: 0]
  ------------------
  164|      0|                            libctx, propq)
  165|      0|                        == NULL) {
  166|      0|                        ERR_raise(ERR_LIB_PEM, ERR_R_ASN1_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  167|      0|                        goto err;
  168|      0|                    }
  169|   412k|                } else if (d2i(pp, &p, len) == NULL) {
  ------------------
  |  Branch (169:28): [True: 0, False: 412k]
  ------------------
  170|      0|                    ERR_raise(ERR_LIB_PEM, ERR_R_ASN1_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  171|      0|                    goto err;
  172|      0|                }
  173|   412k|            } else { /* encrypted key data */
  174|      0|                if (!PEM_get_EVP_CIPHER_INFO(header, &xi->enc_cipher))
  ------------------
  |  Branch (174:21): [True: 0, False: 0]
  ------------------
  175|      0|                    goto err;
  176|      0|                xi->enc_data = (char *)data;
  177|      0|                xi->enc_len = (int)len;
  178|      0|                data = NULL;
  179|      0|            }
  180|   412k|        }
  181|   412k|        OPENSSL_free(name);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  182|   412k|        name = NULL;
  183|   412k|        OPENSSL_free(header);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  184|   412k|        header = NULL;
  185|   412k|        OPENSSL_free(data);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  186|   412k|        data = NULL;
  187|   412k|    }
  188|       |
  189|       |    /*
  190|       |     * if the last one hasn't been pushed yet and there is anything in it
  191|       |     * then add it to the stack ...
  192|       |     */
  193|  2.83k|    if ((xi->x509 != NULL) || (xi->crl != NULL) || (xi->x_pkey != NULL) || (xi->enc_data != NULL)) {
  ------------------
  |  Branch (193:9): [True: 2.82k, False: 9]
  |  Branch (193:31): [True: 0, False: 9]
  |  Branch (193:52): [True: 0, False: 9]
  |  Branch (193:76): [True: 0, False: 9]
  ------------------
  194|  2.82k|        if (!sk_X509_INFO_push(ret, xi))
  ------------------
  |  |  407|  2.82k|#define sk_X509_INFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr))
  ------------------
  |  Branch (194:13): [True: 0, False: 2.82k]
  ------------------
  195|      0|            goto err;
  196|  2.82k|        xi = NULL;
  197|  2.82k|    }
  198|  2.83k|    ok = 1;
  199|  2.83k|err:
  200|  2.83k|    X509_INFO_free(xi);
  201|  2.83k|    if (!ok) {
  ------------------
  |  Branch (201:9): [True: 0, False: 2.83k]
  ------------------
  202|      0|        for (i = 0; ((int)i) < sk_X509_INFO_num(ret); i++) {
  ------------------
  |  |  397|      0|#define sk_X509_INFO_num(sk) OPENSSL_sk_num(ossl_check_const_X509_INFO_sk_type(sk))
  ------------------
  |  Branch (202:21): [True: 0, False: 0]
  ------------------
  203|      0|            xi = sk_X509_INFO_value(ret, i);
  ------------------
  |  |  398|      0|#define sk_X509_INFO_value(sk, idx) ((X509_INFO *)OPENSSL_sk_value(ossl_check_const_X509_INFO_sk_type(sk), (idx)))
  ------------------
  204|      0|            X509_INFO_free(xi);
  205|      0|        }
  206|      0|        if (ret != sk)
  ------------------
  |  Branch (206:13): [True: 0, False: 0]
  ------------------
  207|      0|            sk_X509_INFO_free(ret);
  ------------------
  |  |  403|      0|#define sk_X509_INFO_free(sk) OPENSSL_sk_free(ossl_check_X509_INFO_sk_type(sk))
  ------------------
  208|      0|        ret = NULL;
  209|      0|    }
  210|       |
  211|  2.83k|    OPENSSL_free(name);
  ------------------
  |  |  131|  2.83k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  212|  2.83k|    OPENSSL_free(header);
  ------------------
  |  |  131|  2.83k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  213|  2.83k|    OPENSSL_free(data);
  ------------------
  |  |  131|  2.83k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  214|  2.83k|    return ret;
  215|  2.83k|}

PEM_bytes_read_bio:
  289|  2.43k|{
  290|  2.43k|    return pem_bytes_read_bio_flags(pdata, plen, pnm, name, bp, cb, u,
  291|  2.43k|        PEM_FLAG_EAY_COMPATIBLE);
  ------------------
  |  |  382|  2.43k|#define PEM_FLAG_EAY_COMPATIBLE 0x2
  ------------------
  292|  2.43k|}
PEM_do_header:
  447|   412k|{
  448|   412k|    int ok;
  449|   412k|    int keylen;
  450|   412k|    long len = *plen;
  451|   412k|    int ilen = (int)len; /* EVP_DecryptUpdate etc. take int lengths */
  452|   412k|    EVP_CIPHER_CTX *ctx;
  453|   412k|    unsigned char key[EVP_MAX_KEY_LENGTH];
  454|   412k|    char buf[PEM_BUFSIZE];
  455|       |
  456|   412k|#if LONG_MAX > INT_MAX
  457|       |    /* Check that we did not truncate the length */
  458|   412k|    if (len > INT_MAX) {
  ------------------
  |  Branch (458:9): [True: 0, False: 412k]
  ------------------
  459|      0|        ERR_raise(ERR_LIB_PEM, PEM_R_HEADER_TOO_LONG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  460|      0|        return 0;
  461|      0|    }
  462|   412k|#endif
  463|       |
  464|   412k|    if (cipher->cipher == NULL)
  ------------------
  |  Branch (464:9): [True: 412k, False: 0]
  ------------------
  465|   412k|        return 1;
  466|      0|    if (callback == NULL)
  ------------------
  |  Branch (466:9): [True: 0, False: 0]
  ------------------
  467|      0|        keylen = PEM_def_callback(buf, PEM_BUFSIZE, 0, u);
  ------------------
  |  |   33|      0|#define PEM_BUFSIZE 1024
  ------------------
  468|      0|    else
  469|      0|        keylen = callback(buf, PEM_BUFSIZE, 0, u);
  ------------------
  |  |   33|      0|#define PEM_BUFSIZE 1024
  ------------------
  470|      0|    if (keylen < 0) {
  ------------------
  |  Branch (470:9): [True: 0, False: 0]
  ------------------
  471|      0|        ERR_raise(ERR_LIB_PEM, PEM_R_BAD_PASSWORD_READ);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  472|      0|        return 0;
  473|      0|    }
  474|       |#ifdef CHARSET_EBCDIC
  475|       |    /* Convert the pass phrase from EBCDIC */
  476|       |    ebcdic2ascii(buf, buf, keylen);
  477|       |#endif
  478|       |
  479|      0|    if (!EVP_BytesToKey(cipher->cipher, EVP_md5(), &(cipher->iv[0]),
  ------------------
  |  Branch (479:9): [True: 0, False: 0]
  ------------------
  480|      0|            (unsigned char *)buf, keylen, 1, key, NULL))
  481|      0|        return 0;
  482|       |
  483|      0|    ctx = EVP_CIPHER_CTX_new();
  484|      0|    if (ctx == NULL)
  ------------------
  |  Branch (484:9): [True: 0, False: 0]
  ------------------
  485|      0|        return 0;
  486|       |
  487|      0|    ok = EVP_DecryptInit_ex(ctx, cipher->cipher, NULL, key, &(cipher->iv[0]));
  488|      0|    if (ok)
  ------------------
  |  Branch (488:9): [True: 0, False: 0]
  ------------------
  489|      0|        ok = EVP_DecryptUpdate(ctx, data, &ilen, data, ilen);
  490|      0|    if (ok) {
  ------------------
  |  Branch (490:9): [True: 0, False: 0]
  ------------------
  491|       |        /* Squirrel away the length of data decrypted so far. */
  492|      0|        *plen = ilen;
  493|      0|        ok = EVP_DecryptFinal_ex(ctx, &(data[ilen]), &ilen);
  494|      0|    }
  495|      0|    if (ok)
  ------------------
  |  Branch (495:9): [True: 0, False: 0]
  ------------------
  496|      0|        *plen += ilen;
  497|      0|    else
  498|      0|        ERR_raise(ERR_LIB_PEM, PEM_R_BAD_DECRYPT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  499|       |
  500|      0|    EVP_CIPHER_CTX_free(ctx);
  501|      0|    OPENSSL_cleanse((char *)buf, sizeof(buf));
  502|      0|    OPENSSL_cleanse((char *)key, sizeof(key));
  503|      0|    return ok;
  504|      0|}
PEM_get_EVP_CIPHER_INFO:
  522|   412k|{
  523|   412k|    const EVP_CIPHER *enc = NULL;
  524|   412k|    int ivlen;
  525|   412k|    char *dekinfostart, c;
  526|       |
  527|   412k|    cipher->cipher = NULL;
  528|   412k|    memset(cipher->iv, 0, sizeof(cipher->iv));
  529|   412k|    if ((header == NULL) || (*header == '\0') || (*header == '\n'))
  ------------------
  |  Branch (529:9): [True: 0, False: 412k]
  |  Branch (529:29): [True: 412k, False: 0]
  |  Branch (529:50): [True: 0, False: 0]
  ------------------
  530|   412k|        return 1;
  531|       |
  532|      0|    if (!CHECK_AND_SKIP_PREFIX(header, PROC_TYPE)) {
  ------------------
  |  |   61|      0|    (HAS_PREFIX(str, pre) ? ((str) += sizeof(pre) - 1, 1) : 0)
  |  |  ------------------
  |  |  |  |   58|      0|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (58:30): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (532:9): [True: 0, False: 0]
  ------------------
  533|      0|        ERR_raise(ERR_LIB_PEM, PEM_R_NOT_PROC_TYPE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  534|      0|        return 0;
  535|      0|    }
  536|      0|    header += strspn(header, " \t");
  537|       |
  538|      0|    if (*header++ != '4' || *header++ != ',')
  ------------------
  |  Branch (538:9): [True: 0, False: 0]
  |  Branch (538:29): [True: 0, False: 0]
  ------------------
  539|      0|        return 0;
  540|      0|    header += strspn(header, " \t");
  541|       |
  542|       |    /* We expect "ENCRYPTED" followed by optional white-space + line break */
  543|      0|    if (!CHECK_AND_SKIP_PREFIX(header, ENCRYPTED) || strspn(header, " \t\r\n") == 0) {
  ------------------
  |  |   61|      0|    (HAS_PREFIX(str, pre) ? ((str) += sizeof(pre) - 1, 1) : 0)
  |  |  ------------------
  |  |  |  |   58|      0|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (58:30): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (543:9): [True: 0, False: 0]
  |  Branch (543:54): [True: 0, False: 0]
  ------------------
  544|      0|        ERR_raise(ERR_LIB_PEM, PEM_R_NOT_ENCRYPTED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  545|      0|        return 0;
  546|      0|    }
  547|      0|    header += strspn(header, " \t\r");
  548|      0|    if (*header++ != '\n') {
  ------------------
  |  Branch (548:9): [True: 0, False: 0]
  ------------------
  549|      0|        ERR_raise(ERR_LIB_PEM, PEM_R_SHORT_HEADER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  550|      0|        return 0;
  551|      0|    }
  552|       |
  553|       |    /*-
  554|       |     * https://tools.ietf.org/html/rfc1421#section-4.6.1.3
  555|       |     * We expect "DEK-Info: algo[,hex-parameters]"
  556|       |     */
  557|      0|    if (!CHECK_AND_SKIP_PREFIX(header, DEK_INFO)) {
  ------------------
  |  |   61|      0|    (HAS_PREFIX(str, pre) ? ((str) += sizeof(pre) - 1, 1) : 0)
  |  |  ------------------
  |  |  |  |   58|      0|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (58:30): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (557:9): [True: 0, False: 0]
  ------------------
  558|      0|        ERR_raise(ERR_LIB_PEM, PEM_R_NOT_DEK_INFO);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  559|      0|        return 0;
  560|      0|    }
  561|      0|    header += strspn(header, " \t");
  562|       |
  563|       |    /*
  564|       |     * DEK-INFO is a comma-separated combination of algorithm name and optional
  565|       |     * parameters.
  566|       |     */
  567|      0|    dekinfostart = header;
  568|      0|    header += strcspn(header, " \t,");
  569|      0|    c = *header;
  570|      0|    *header = '\0';
  571|      0|    cipher->cipher = enc = EVP_get_cipherbyname(dekinfostart);
  572|      0|    *header = c;
  573|      0|    header += strspn(header, " \t");
  574|       |
  575|      0|    if (enc == NULL) {
  ------------------
  |  Branch (575:9): [True: 0, False: 0]
  ------------------
  576|      0|        ERR_raise(ERR_LIB_PEM, PEM_R_UNSUPPORTED_ENCRYPTION);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  577|      0|        return 0;
  578|      0|    }
  579|      0|    ivlen = EVP_CIPHER_get_iv_length(enc);
  580|      0|    if (ivlen > 0 && *header++ != ',') {
  ------------------
  |  Branch (580:9): [True: 0, False: 0]
  |  Branch (580:22): [True: 0, False: 0]
  ------------------
  581|      0|        ERR_raise(ERR_LIB_PEM, PEM_R_MISSING_DEK_IV);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  582|      0|        return 0;
  583|      0|    } else if (ivlen == 0 && *header == ',') {
  ------------------
  |  Branch (583:16): [True: 0, False: 0]
  |  Branch (583:30): [True: 0, False: 0]
  ------------------
  584|      0|        ERR_raise(ERR_LIB_PEM, PEM_R_UNEXPECTED_DEK_IV);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  585|      0|        return 0;
  586|      0|    }
  587|       |
  588|      0|    if (!load_iv(&header, cipher->iv, EVP_CIPHER_get_iv_length(enc)))
  ------------------
  |  Branch (588:9): [True: 0, False: 0]
  ------------------
  589|      0|        return 0;
  590|       |
  591|      0|    return 1;
  592|      0|}
PEM_read_bio_ex:
  946|   417k|{
  947|   417k|    EVP_ENCODE_CTX *ctx = NULL;
  948|   417k|    const BIO_METHOD *bmeth;
  949|   417k|    BIO *headerB = NULL, *dataB = NULL;
  950|   417k|    char *name = NULL;
  951|   417k|    int len, taillen, headerlen, ret = 0;
  952|   417k|    BUF_MEM *buf_mem;
  953|       |
  954|   417k|    *len_out = 0;
  955|   417k|    *name_out = *header = NULL;
  956|   417k|    *data = NULL;
  957|   417k|    if ((flags & PEM_FLAG_EAY_COMPATIBLE) && (flags & PEM_FLAG_ONLY_B64)) {
  ------------------
  |  |  382|   417k|#define PEM_FLAG_EAY_COMPATIBLE 0x2
  ------------------
                  if ((flags & PEM_FLAG_EAY_COMPATIBLE) && (flags & PEM_FLAG_ONLY_B64)) {
  ------------------
  |  |  383|   417k|#define PEM_FLAG_ONLY_B64 0x4
  ------------------
  |  Branch (957:9): [True: 417k, False: 0]
  |  Branch (957:46): [True: 0, False: 417k]
  ------------------
  958|       |        /* These two are mutually incompatible; bail out. */
  959|      0|        ERR_raise(ERR_LIB_PEM, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  960|      0|        goto end;
  961|      0|    }
  962|   417k|    bmeth = (flags & PEM_FLAG_SECURE) ? BIO_s_secmem() : BIO_s_mem();
  ------------------
  |  |  381|   417k|#define PEM_FLAG_SECURE 0x1
  ------------------
  |  Branch (962:13): [True: 0, False: 417k]
  ------------------
  963|       |
  964|   417k|    headerB = BIO_new(bmeth);
  965|   417k|    dataB = BIO_new(bmeth);
  966|   417k|    if (headerB == NULL || dataB == NULL) {
  ------------------
  |  Branch (966:9): [True: 0, False: 417k]
  |  Branch (966:28): [True: 0, False: 417k]
  ------------------
  967|      0|        ERR_raise(ERR_LIB_PEM, ERR_R_BIO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  968|      0|        goto end;
  969|      0|    }
  970|       |
  971|   417k|    if (!get_name(bp, &name, flags))
  ------------------
  |  Branch (971:9): [True: 5.26k, False: 412k]
  ------------------
  972|  5.26k|        goto end;
  973|   412k|    if (!get_header_and_data(bp, &headerB, &dataB, name, flags))
  ------------------
  |  Branch (973:9): [True: 0, False: 412k]
  ------------------
  974|      0|        goto end;
  975|       |
  976|   412k|    BIO_get_mem_ptr(dataB, &buf_mem);
  ------------------
  |  |  617|   412k|#define BIO_get_mem_ptr(b, pp) BIO_ctrl(b, BIO_C_GET_BUF_MEM_PTR, 0, \
  |  |  ------------------
  |  |  |  |  449|   412k|#define BIO_C_GET_BUF_MEM_PTR 115
  |  |  ------------------
  |  |  618|   412k|    (char *)(pp))
  ------------------
  977|   412k|    if (buf_mem->length > INT_MAX) {
  ------------------
  |  Branch (977:9): [True: 0, False: 412k]
  ------------------
  978|      0|        ERR_raise(ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  979|      0|        goto end;
  980|      0|    }
  981|   412k|    len = (int)buf_mem->length;
  982|       |
  983|       |    /* There was no data in the PEM file */
  984|   412k|    if (len == 0)
  ------------------
  |  Branch (984:9): [True: 0, False: 412k]
  ------------------
  985|      0|        goto end;
  986|       |
  987|   412k|    ctx = EVP_ENCODE_CTX_new();
  988|   412k|    if (ctx == NULL) {
  ------------------
  |  Branch (988:9): [True: 0, False: 412k]
  ------------------
  989|      0|        ERR_raise(ERR_LIB_PEM, ERR_R_EVP_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  990|      0|        goto end;
  991|      0|    }
  992|       |
  993|   412k|    EVP_DecodeInit(ctx);
  994|   412k|    if (EVP_DecodeUpdate(ctx, (unsigned char *)buf_mem->data, &len,
  ------------------
  |  Branch (994:9): [True: 0, False: 412k]
  ------------------
  995|   412k|            (unsigned char *)buf_mem->data, len)
  996|   412k|            < 0
  997|   412k|        || EVP_DecodeFinal(ctx, (unsigned char *)&(buf_mem->data[len]),
  ------------------
  |  Branch (997:12): [True: 0, False: 412k]
  ------------------
  998|   412k|               &taillen)
  999|   412k|            < 0) {
 1000|      0|        ERR_raise(ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1001|      0|        goto end;
 1002|      0|    }
 1003|   412k|    len += taillen;
 1004|   412k|    buf_mem->length = len;
 1005|       |
 1006|   412k|    headerlen = BIO_get_mem_data(headerB, NULL);
  ------------------
  |  |  615|   412k|#define BIO_get_mem_data(b, pp) BIO_ctrl(b, BIO_CTRL_INFO, 0, (char *)(pp))
  |  |  ------------------
  |  |  |  |   92|   412k|#define BIO_CTRL_INFO 3 /* opt - extra tit-bits */
  |  |  ------------------
  ------------------
 1007|   412k|    *header = PEM_MALLOC(headerlen + 1, flags);
  ------------------
  |  |  235|   412k|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1008|   412k|    *data = PEM_MALLOC(len, flags);
  ------------------
  |  |  235|   412k|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1009|   412k|    if (*header == NULL || *data == NULL)
  ------------------
  |  Branch (1009:9): [True: 0, False: 412k]
  |  Branch (1009:28): [True: 0, False: 412k]
  ------------------
 1010|      0|        goto out_free;
 1011|   412k|    if (headerlen != 0 && BIO_read(headerB, *header, headerlen) != headerlen)
  ------------------
  |  Branch (1011:9): [True: 0, False: 412k]
  |  Branch (1011:27): [True: 0, False: 0]
  ------------------
 1012|      0|        goto out_free;
 1013|   412k|    (*header)[headerlen] = '\0';
 1014|   412k|    if (BIO_read(dataB, *data, len) != len)
  ------------------
  |  Branch (1014:9): [True: 0, False: 412k]
  ------------------
 1015|      0|        goto out_free;
 1016|   412k|    *len_out = len;
 1017|   412k|    *name_out = name;
 1018|   412k|    name = NULL;
 1019|   412k|    ret = 1;
 1020|   412k|    goto end;
 1021|       |
 1022|      0|out_free:
 1023|      0|    PEM_FREE(*header, flags, 0);
  ------------------
  |  |  224|      0|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1024|      0|    *header = NULL;
 1025|      0|    PEM_FREE(*data, flags, 0);
  ------------------
  |  |  224|      0|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1026|      0|    *data = NULL;
 1027|   417k|end:
 1028|   417k|    EVP_ENCODE_CTX_free(ctx);
 1029|   417k|    PEM_FREE(name, flags, 0);
  ------------------
  |  |  224|   417k|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1030|   417k|    BIO_free(headerB);
 1031|   417k|    BIO_free(dataB);
 1032|   417k|    return ret;
 1033|      0|}
PEM_read_bio:
 1037|   415k|{
 1038|   415k|    return PEM_read_bio_ex(bp, name, header, data, len, PEM_FLAG_EAY_COMPATIBLE);
  ------------------
  |  |  382|   415k|#define PEM_FLAG_EAY_COMPATIBLE 0x2
  ------------------
 1039|   415k|}
pem_lib.c:pem_bytes_read_bio_flags:
  247|  2.43k|{
  248|  2.43k|    EVP_CIPHER_INFO cipher;
  249|  2.43k|    char *nm = NULL, *header = NULL;
  250|  2.43k|    unsigned char *data = NULL;
  251|  2.43k|    long len = 0;
  252|  2.43k|    int ret = 0;
  253|       |
  254|  2.43k|    do {
  255|  2.43k|        PEM_FREE(nm, flags, 0);
  ------------------
  |  |  224|  2.43k|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  256|  2.43k|        PEM_FREE(header, flags, 0);
  ------------------
  |  |  224|  2.43k|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  257|  2.43k|        PEM_FREE(data, flags, len);
  ------------------
  |  |  224|  2.43k|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  258|  2.43k|        if (!PEM_read_bio_ex(bp, &nm, &header, &data, &len, flags)) {
  ------------------
  |  Branch (258:13): [True: 2.43k, False: 0]
  ------------------
  259|  2.43k|            if (ERR_GET_REASON(ERR_peek_error()) == PEM_R_NO_START_LINE)
  ------------------
  |  |   44|  2.43k|#define PEM_R_NO_START_LINE 108
  ------------------
  |  Branch (259:17): [True: 1.16k, False: 1.26k]
  ------------------
  260|  1.16k|                ERR_add_error_data(2, "Expecting: ", name);
  261|  2.43k|            return 0;
  262|  2.43k|        }
  263|  2.43k|    } while (!check_pem(nm, name));
  ------------------
  |  Branch (263:14): [True: 0, False: 0]
  ------------------
  264|      0|    if (!PEM_get_EVP_CIPHER_INFO(header, &cipher))
  ------------------
  |  Branch (264:9): [True: 0, False: 0]
  ------------------
  265|      0|        goto err;
  266|      0|    if (!PEM_do_header(&cipher, data, &len, cb, u))
  ------------------
  |  Branch (266:9): [True: 0, False: 0]
  ------------------
  267|      0|        goto err;
  268|       |
  269|      0|    *pdata = data;
  270|      0|    *plen = len;
  271|       |
  272|      0|    if (pnm != NULL)
  ------------------
  |  Branch (272:9): [True: 0, False: 0]
  ------------------
  273|      0|        *pnm = nm;
  274|       |
  275|      0|    ret = 1;
  276|       |
  277|      0|err:
  278|      0|    if (!ret || pnm == NULL)
  ------------------
  |  Branch (278:9): [True: 0, False: 0]
  |  Branch (278:17): [True: 0, False: 0]
  ------------------
  279|      0|        PEM_FREE(nm, flags, 0);
  ------------------
  |  |  224|      0|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  280|      0|    PEM_FREE(header, flags, 0);
  ------------------
  |  |  224|      0|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  281|      0|    if (!ret)
  ------------------
  |  Branch (281:9): [True: 0, False: 0]
  ------------------
  282|      0|        PEM_FREE(data, flags, len);
  ------------------
  |  |  224|      0|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  283|      0|    return ret;
  284|      0|}
pem_lib.c:get_name:
  776|   417k|{
  777|   417k|    char *linebuf;
  778|   417k|    int ret = 0;
  779|   417k|    int len;
  780|   417k|    int first_call = 1;
  781|       |
  782|       |    /*
  783|       |     * Need to hold trailing NUL (accounted for by BIO_gets() and the newline
  784|       |     * that will be added by sanitize_line() (the extra '1').
  785|       |     */
  786|   417k|    linebuf = PEM_MALLOC(LINESIZE + 1, flags);
  ------------------
  |  |  235|   417k|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  787|   417k|    if (linebuf == NULL)
  ------------------
  |  Branch (787:9): [True: 0, False: 417k]
  ------------------
  788|      0|        return 0;
  789|       |
  790|   417k|    do {
  791|   417k|        len = BIO_gets(bp, linebuf, LINESIZE);
  ------------------
  |  |  767|   417k|#define LINESIZE 255
  ------------------
  792|       |
  793|   417k|        if (len <= 0) {
  ------------------
  |  Branch (793:13): [True: 5.26k, False: 412k]
  ------------------
  794|  5.26k|            ERR_raise(ERR_LIB_PEM, PEM_R_NO_START_LINE);
  ------------------
  |  |  404|  5.26k|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|  5.26k|    (ERR_new(),                                                  \
  |  |  |  |  407|  5.26k|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|  5.26k|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|  5.26k|        ERR_set_error)
  |  |  ------------------
  ------------------
  795|  5.26k|            goto err;
  796|  5.26k|        }
  797|       |
  798|       |        /* Strip trailing garbage and standardize ending. */
  799|   412k|        len = sanitize_line(linebuf, len, flags & ~PEM_FLAG_ONLY_B64, first_call);
  ------------------
  |  |  383|   412k|#define PEM_FLAG_ONLY_B64 0x4
  ------------------
  800|   412k|        first_call = 0;
  801|       |
  802|       |        /* Allow leading empty or non-matching lines. */
  803|   412k|    } while (!HAS_PREFIX(linebuf, BEGINSTR)
  ------------------
  |  |   58|   824k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  ------------------
  |  Branch (803:14): [True: 0, False: 412k]
  ------------------
  804|   412k|        || len < TAILLEN
  ------------------
  |  |  774|   824k|#define TAILLEN ((int)(sizeof(TAILSTR) - 1))
  |  |  ------------------
  |  |  |  |  771|   412k|#define TAILSTR "-----\n"
  |  |  ------------------
  ------------------
  |  Branch (804:12): [True: 0, False: 412k]
  ------------------
  805|   412k|        || !HAS_PREFIX(linebuf + len - TAILLEN, TAILSTR));
  ------------------
  |  |   58|   412k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  ------------------
  |  Branch (805:12): [True: 0, False: 412k]
  ------------------
  806|   412k|    linebuf[len - TAILLEN] = '\0';
  ------------------
  |  |  774|   412k|#define TAILLEN ((int)(sizeof(TAILSTR) - 1))
  |  |  ------------------
  |  |  |  |  771|   412k|#define TAILSTR "-----\n"
  |  |  ------------------
  ------------------
  807|   412k|    len = len - BEGINLEN - TAILLEN + 1;
  ------------------
  |  |  772|   412k|#define BEGINLEN ((int)(sizeof(BEGINSTR) - 1))
  |  |  ------------------
  |  |  |  |  769|   412k|#define BEGINSTR "-----BEGIN "
  |  |  ------------------
  ------------------
                  len = len - BEGINLEN - TAILLEN + 1;
  ------------------
  |  |  774|   412k|#define TAILLEN ((int)(sizeof(TAILSTR) - 1))
  |  |  ------------------
  |  |  |  |  771|   412k|#define TAILSTR "-----\n"
  |  |  ------------------
  ------------------
  808|   412k|    *name = PEM_MALLOC(len, flags);
  ------------------
  |  |  235|   412k|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  809|   412k|    if (*name == NULL)
  ------------------
  |  Branch (809:9): [True: 0, False: 412k]
  ------------------
  810|      0|        goto err;
  811|   412k|    memcpy(*name, linebuf + BEGINLEN, len);
  ------------------
  |  |  772|   412k|#define BEGINLEN ((int)(sizeof(BEGINSTR) - 1))
  |  |  ------------------
  |  |  |  |  769|   412k|#define BEGINSTR "-----BEGIN "
  |  |  ------------------
  ------------------
  812|   412k|    ret = 1;
  813|       |
  814|   417k|err:
  815|   417k|    PEM_FREE(linebuf, flags, LINESIZE + 1);
  ------------------
  |  |  224|   417k|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  816|   417k|    return ret;
  817|   412k|}
pem_lib.c:sanitize_line:
  723|  10.1M|{
  724|  10.1M|    int i;
  725|  10.1M|    if (first_call) {
  ------------------
  |  Branch (725:9): [True: 412k, False: 9.78M]
  ------------------
  726|       |        /* Other BOMs imply unsupported multibyte encoding,
  727|       |         * so don't strip them and let the error raise */
  728|   412k|        const unsigned char utf8_bom[3] = { 0xEF, 0xBB, 0xBF };
  729|       |
  730|   412k|        if (len > 3 && memcmp(linebuf, utf8_bom, 3) == 0) {
  ------------------
  |  Branch (730:13): [True: 412k, False: 0]
  |  Branch (730:24): [True: 0, False: 412k]
  ------------------
  731|      0|            memmove(linebuf, linebuf + 3, len - 3);
  732|      0|            linebuf[len - 3] = 0;
  733|      0|            len -= 3;
  734|      0|        }
  735|   412k|    }
  736|       |
  737|  10.1M|    if (flags & PEM_FLAG_EAY_COMPATIBLE) {
  ------------------
  |  |  382|  10.1M|#define PEM_FLAG_EAY_COMPATIBLE 0x2
  ------------------
  |  Branch (737:9): [True: 10.1M, False: 0]
  ------------------
  738|       |        /* Strip trailing whitespace */
  739|  30.5M|        while ((len >= 0) && (linebuf[len] <= ' '))
  ------------------
  |  Branch (739:16): [True: 30.5M, False: 0]
  |  Branch (739:30): [True: 20.3M, False: 10.1M]
  ------------------
  740|  20.3M|            len--;
  741|       |        /* Go back to whitespace before applying uniform line ending. */
  742|  10.1M|        len++;
  743|  10.1M|    } else if (flags & PEM_FLAG_ONLY_B64) {
  ------------------
  |  |  383|      0|#define PEM_FLAG_ONLY_B64 0x4
  ------------------
  |  Branch (743:16): [True: 0, False: 0]
  ------------------
  744|      0|        for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (744:21): [True: 0, False: 0]
  ------------------
  745|      0|            if (!ossl_isbase64(linebuf[i]) || linebuf[i] == '\n'
  ------------------
  |  |   84|      0|#define ossl_isbase64(c) (ossl_ctype_check((c), CTYPE_MASK_base64))
  |  |  ------------------
  |  |  |  |   37|      0|#define CTYPE_MASK_base64 0x400
  |  |  ------------------
  ------------------
  |  Branch (745:17): [True: 0, False: 0]
  |  Branch (745:47): [True: 0, False: 0]
  ------------------
  746|      0|                || linebuf[i] == '\r')
  ------------------
  |  Branch (746:20): [True: 0, False: 0]
  ------------------
  747|      0|                break;
  748|      0|        }
  749|      0|        len = i;
  750|      0|    } else {
  751|       |        /* EVP_DecodeBlock strips leading and trailing whitespace, so just strip
  752|       |         * control characters in-place and let everything through. */
  753|      0|        for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (753:21): [True: 0, False: 0]
  ------------------
  754|      0|            if (linebuf[i] == '\n' || linebuf[i] == '\r')
  ------------------
  |  Branch (754:17): [True: 0, False: 0]
  |  Branch (754:39): [True: 0, False: 0]
  ------------------
  755|      0|                break;
  756|      0|            if (ossl_iscntrl(linebuf[i]))
  ------------------
  |  |   78|      0|#define ossl_iscntrl(c) (ossl_ctype_check((c), CTYPE_MASK_cntrl))
  |  |  ------------------
  |  |  |  |   33|      0|#define CTYPE_MASK_cntrl 0x40
  |  |  ------------------
  |  |  |  Branch (78:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  757|      0|                linebuf[i] = ' ';
  758|      0|        }
  759|      0|        len = i;
  760|      0|    }
  761|       |    /* The caller allocated LINESIZE+1, so this is safe. */
  762|  10.1M|    linebuf[len++] = '\n';
  763|  10.1M|    linebuf[len] = '\0';
  764|  10.1M|    return len;
  765|  10.1M|}
pem_lib.c:get_header_and_data:
  839|   412k|{
  840|   412k|    BIO *tmp = *header;
  841|   412k|    char *linebuf, *p;
  842|   412k|    int len, ret = 0, end = 0, prev_partial_line_read = 0, partial_line_read = 0;
  843|       |    /* 0 if not seen (yet), 1 if reading header, 2 if finished header */
  844|   412k|    enum header_status got_header = MAYBE_HEADER;
  845|   412k|    unsigned int flags_mask;
  846|   412k|    size_t namelen;
  847|       |
  848|       |    /* Need to hold trailing NUL (accounted for by BIO_gets() and the newline
  849|       |     * that will be added by sanitize_line() (the extra '1'). */
  850|   412k|    linebuf = PEM_MALLOC(LINESIZE + 1, flags);
  ------------------
  |  |  235|   412k|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  851|   412k|    if (linebuf == NULL)
  ------------------
  |  Branch (851:9): [True: 0, False: 412k]
  ------------------
  852|      0|        return 0;
  853|       |
  854|  9.78M|    while (1) {
  ------------------
  |  Branch (854:12): [True: 9.78M, Folded]
  ------------------
  855|  9.78M|        flags_mask = ~0u;
  856|  9.78M|        len = BIO_gets(bp, linebuf, LINESIZE);
  ------------------
  |  |  767|  9.78M|#define LINESIZE 255
  ------------------
  857|  9.78M|        if (len <= 0) {
  ------------------
  |  Branch (857:13): [True: 0, False: 9.78M]
  ------------------
  858|      0|            ERR_raise(ERR_LIB_PEM, PEM_R_BAD_END_LINE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  859|      0|            goto err;
  860|      0|        }
  861|       |
  862|       |        /*
  863|       |         * Check if line has been read completely or if only part of the line
  864|       |         * has been read. Keep the previous value to ignore newlines that
  865|       |         * appear due to reading a line up until the char before the newline.
  866|       |         */
  867|  9.78M|        prev_partial_line_read = partial_line_read;
  868|  9.78M|        partial_line_read = len == LINESIZE - 1 && linebuf[LINESIZE - 2] != '\n';
  ------------------
  |  |  767|  9.78M|#define LINESIZE 255
  ------------------
                      partial_line_read = len == LINESIZE - 1 && linebuf[LINESIZE - 2] != '\n';
  ------------------
  |  |  767|      0|#define LINESIZE 255
  ------------------
  |  Branch (868:29): [True: 0, False: 9.78M]
  |  Branch (868:52): [True: 0, False: 0]
  ------------------
  869|       |
  870|  9.78M|        if (got_header == MAYBE_HEADER) {
  ------------------
  |  Branch (870:13): [True: 9.78M, False: 0]
  ------------------
  871|  9.78M|            if (memchr(linebuf, ':', len) != NULL)
  ------------------
  |  Branch (871:17): [True: 0, False: 9.78M]
  ------------------
  872|      0|                got_header = IN_HEADER;
  873|  9.78M|        }
  874|  9.78M|        if (HAS_PREFIX(linebuf, ENDSTR) || got_header == IN_HEADER)
  ------------------
  |  |   58|  19.5M|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 412k, False: 9.37M]
  |  |  ------------------
  ------------------
  |  Branch (874:44): [True: 0, False: 9.37M]
  ------------------
  875|   412k|            flags_mask &= ~PEM_FLAG_ONLY_B64;
  ------------------
  |  |  383|   412k|#define PEM_FLAG_ONLY_B64 0x4
  ------------------
  876|  9.78M|        len = sanitize_line(linebuf, len, flags & flags_mask, 0);
  877|       |
  878|       |        /* Check for end of header. */
  879|  9.78M|        if (linebuf[0] == '\n') {
  ------------------
  |  Branch (879:13): [True: 0, False: 9.78M]
  ------------------
  880|       |            /*
  881|       |             * If previous line has been read only partially this newline is a
  882|       |             * regular newline at the end of a line and not an empty line.
  883|       |             */
  884|      0|            if (!prev_partial_line_read) {
  ------------------
  |  Branch (884:17): [True: 0, False: 0]
  ------------------
  885|      0|                if (got_header == POST_HEADER) {
  ------------------
  |  Branch (885:21): [True: 0, False: 0]
  ------------------
  886|       |                    /* Another blank line is an error. */
  887|      0|                    ERR_raise(ERR_LIB_PEM, PEM_R_BAD_END_LINE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  888|      0|                    goto err;
  889|      0|                }
  890|      0|                got_header = POST_HEADER;
  891|      0|                tmp = *data;
  892|      0|            }
  893|      0|            continue;
  894|      0|        }
  895|       |
  896|       |        /* Check for end of stream (which means there is no header). */
  897|  9.78M|        p = linebuf;
  898|  9.78M|        if (CHECK_AND_SKIP_PREFIX(p, ENDSTR)) {
  ------------------
  |  |   61|  9.78M|    (HAS_PREFIX(str, pre) ? ((str) += sizeof(pre) - 1, 1) : 0)
  |  |  ------------------
  |  |  |  |   58|  9.78M|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (58:30): [True: 412k, False: 9.37M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:5): [True: 412k, False: 9.37M]
  |  |  ------------------
  ------------------
  899|   412k|            namelen = strlen(name);
  900|   412k|            if (strncmp(p, name, namelen) != 0 || !HAS_PREFIX(p + namelen, TAILSTR)) {
  ------------------
  |  |   58|   412k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  ------------------
  |  Branch (900:17): [True: 0, False: 412k]
  |  Branch (900:51): [True: 0, False: 412k]
  ------------------
  901|      0|                ERR_raise(ERR_LIB_PEM, PEM_R_BAD_END_LINE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  902|      0|                goto err;
  903|      0|            }
  904|   412k|            if (got_header == MAYBE_HEADER) {
  ------------------
  |  Branch (904:17): [True: 412k, False: 0]
  ------------------
  905|   412k|                *header = *data;
  906|   412k|                *data = tmp;
  907|   412k|            }
  908|   412k|            break;
  909|  9.37M|        } else if (end) {
  ------------------
  |  Branch (909:20): [True: 0, False: 9.37M]
  ------------------
  910|       |            /* Malformed input; short line not at end of data. */
  911|      0|            ERR_raise(ERR_LIB_PEM, PEM_R_BAD_END_LINE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  912|      0|            goto err;
  913|      0|        }
  914|       |        /*
  915|       |         * Else, a line of text -- could be header or data; we don't
  916|       |         * know yet.  Just pass it through.
  917|       |         */
  918|  9.37M|        if (BIO_puts(tmp, linebuf) < 0)
  ------------------
  |  Branch (918:13): [True: 0, False: 9.37M]
  ------------------
  919|      0|            goto err;
  920|       |        /*
  921|       |         * Only encrypted files need the line length check applied.
  922|       |         */
  923|  9.37M|        if (got_header == POST_HEADER) {
  ------------------
  |  Branch (923:13): [True: 0, False: 9.37M]
  ------------------
  924|       |            /* 65 includes the trailing newline */
  925|      0|            if (len > 65)
  ------------------
  |  Branch (925:17): [True: 0, False: 0]
  ------------------
  926|      0|                goto err;
  927|      0|            if (len < 65)
  ------------------
  |  Branch (927:17): [True: 0, False: 0]
  ------------------
  928|      0|                end = 1;
  929|      0|        }
  930|  9.37M|    }
  931|       |
  932|   412k|    ret = 1;
  933|   412k|err:
  934|   412k|    PEM_FREE(linebuf, flags, LINESIZE + 1);
  ------------------
  |  |  224|   412k|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  935|   412k|    return ret;
  936|   412k|}
pem_lib.c:pem_malloc:
  238|  2.06M|{
  239|  2.06M|    return (flags & PEM_FLAG_SECURE) ? CRYPTO_secure_malloc(num, file, line)
  ------------------
  |  |  381|  2.06M|#define PEM_FLAG_SECURE 0x1
  ------------------
  |  Branch (239:12): [True: 0, False: 2.06M]
  ------------------
  240|  2.06M|                                     : CRYPTO_malloc(num, file, line);
  241|  2.06M|}
pem_lib.c:pem_free:
  227|  1.25M|{
  228|  1.25M|    if (flags & PEM_FLAG_SECURE)
  ------------------
  |  |  381|  1.25M|#define PEM_FLAG_SECURE 0x1
  ------------------
  |  Branch (228:9): [True: 0, False: 1.25M]
  ------------------
  229|      0|        CRYPTO_secure_clear_free(p, num, file, line);
  230|  1.25M|    else
  231|  1.25M|        CRYPTO_free(p, file, line);
  232|  1.25M|}

PEM_ASN1_read_bio:
   22|  2.43k|{
   23|  2.43k|    const unsigned char *p = NULL;
   24|  2.43k|    unsigned char *data = NULL;
   25|  2.43k|    long len;
   26|  2.43k|    char *ret = NULL;
   27|       |
   28|  2.43k|    if (!PEM_bytes_read_bio(&data, &len, NULL, name, bp, cb, u))
  ------------------
  |  Branch (28:9): [True: 2.43k, False: 0]
  ------------------
   29|  2.43k|        return NULL;
   30|      0|    p = data;
   31|      0|    ret = d2i(x, &p, len);
   32|      0|    if (ret == NULL)
  ------------------
  |  Branch (32:9): [True: 0, False: 0]
  ------------------
   33|      0|        ERR_raise(ERR_LIB_PEM, ERR_R_ASN1_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   34|      0|    OPENSSL_free(data);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   35|      0|    return ret;
   36|  2.43k|}

ossl_err_load_PKCS12_strings:
   56|      1|{
   57|      1|#ifndef OPENSSL_NO_ERR
   58|      1|    if (ERR_reason_error_string(PKCS12_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (58:9): [True: 1, False: 0]
  ------------------
   59|      1|        ERR_load_strings_const(PKCS12_str_reasons);
   60|      1|#endif
   61|      1|    return 1;
   62|      1|}

ossl_err_load_PKCS7_strings:
   92|      1|{
   93|      1|#ifndef OPENSSL_NO_ERR
   94|      1|    if (ERR_reason_error_string(PKCS7_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (94:9): [True: 1, False: 0]
  ------------------
   95|      1|        ERR_load_strings_const(PKCS7_str_reasons);
   96|      1|#endif
   97|      1|    return 1;
   98|      1|}

ossl_property_defns_free:
   52|    787|{
   53|    787|    LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns = vproperty_defns;
  ------------------
  |  |  156|    787|#define LHASH_OF(type) struct lhash_st_##type
  ------------------
   54|       |
   55|    787|    if (property_defns != NULL) {
  ------------------
  |  Branch (55:9): [True: 787, False: 0]
  ------------------
   56|    787|        lh_PROPERTY_DEFN_ELEM_doall(property_defns,
   57|    787|            &property_defn_free);
   58|    787|        lh_PROPERTY_DEFN_ELEM_free(property_defns);
   59|    787|    }
   60|    787|}
ossl_property_defns_new:
   63|    787|{
   64|    787|    return lh_PROPERTY_DEFN_ELEM_new(&property_defn_hash, &property_defn_cmp);
   65|    787|}
ossl_prop_defn_get:
   68|   169k|{
   69|   169k|    PROPERTY_DEFN_ELEM elem, *r;
   70|   169k|    LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns;
  ------------------
  |  |  156|   169k|#define LHASH_OF(type) struct lhash_st_##type
  ------------------
   71|       |
   72|   169k|    property_defns = ossl_lib_ctx_get_data(ctx,
   73|   169k|        OSSL_LIB_CTX_PROPERTY_DEFN_INDEX);
  ------------------
  |  |   98|   169k|#define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX 2
  ------------------
   74|   169k|    if (!ossl_assert(property_defns != NULL) || !ossl_lib_ctx_read_lock(ctx))
  ------------------
  |  |   52|   339k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|   339k|    __FILE__, __LINE__)
  ------------------
  |  Branch (74:9): [True: 0, False: 169k]
  |  Branch (74:49): [True: 0, False: 169k]
  ------------------
   75|      0|        return NULL;
   76|       |
   77|   169k|    elem.prop = prop;
   78|   169k|    r = lh_PROPERTY_DEFN_ELEM_retrieve(property_defns, &elem);
   79|   169k|    ossl_lib_ctx_unlock(ctx);
   80|   169k|    if (r == NULL || !ossl_assert(r->defn != NULL))
  ------------------
  |  |   52|   168k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|   168k|    __FILE__, __LINE__)
  ------------------
  |  Branch (80:9): [True: 1.17k, False: 168k]
  |  Branch (80:22): [True: 0, False: 168k]
  ------------------
   81|  1.17k|        return NULL;
   82|   168k|    return r->defn;
   83|   169k|}
ossl_prop_defn_set:
   92|  1.17k|{
   93|  1.17k|    PROPERTY_DEFN_ELEM elem, *old, *p = NULL;
   94|  1.17k|    size_t len;
   95|  1.17k|    LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns;
  ------------------
  |  |  156|  1.17k|#define LHASH_OF(type) struct lhash_st_##type
  ------------------
   96|  1.17k|    int res = 1;
   97|       |
   98|  1.17k|    property_defns = ossl_lib_ctx_get_data(ctx,
   99|  1.17k|        OSSL_LIB_CTX_PROPERTY_DEFN_INDEX);
  ------------------
  |  |   98|  1.17k|#define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX 2
  ------------------
  100|  1.17k|    if (property_defns == NULL)
  ------------------
  |  Branch (100:9): [True: 0, False: 1.17k]
  ------------------
  101|      0|        return 0;
  102|       |
  103|  1.17k|    if (prop == NULL)
  ------------------
  |  Branch (103:9): [True: 0, False: 1.17k]
  ------------------
  104|      0|        return 1;
  105|       |
  106|  1.17k|    if (!ossl_lib_ctx_write_lock(ctx))
  ------------------
  |  Branch (106:9): [True: 0, False: 1.17k]
  ------------------
  107|      0|        return 0;
  108|  1.17k|    elem.prop = prop;
  109|  1.17k|    if (pl == NULL) {
  ------------------
  |  Branch (109:9): [True: 0, False: 1.17k]
  ------------------
  110|      0|        lh_PROPERTY_DEFN_ELEM_delete(property_defns, &elem);
  111|      0|        goto end;
  112|      0|    }
  113|       |    /* check if property definition is in the cache already */
  114|  1.17k|    if ((p = lh_PROPERTY_DEFN_ELEM_retrieve(property_defns, &elem)) != NULL) {
  ------------------
  |  Branch (114:9): [True: 0, False: 1.17k]
  ------------------
  115|      0|        ossl_property_free(*pl);
  116|      0|        *pl = p->defn;
  117|      0|        goto end;
  118|      0|    }
  119|  1.17k|    len = strlen(prop);
  120|  1.17k|    p = OPENSSL_malloc(sizeof(*p) + len);
  ------------------
  |  |  106|  1.17k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  121|  1.17k|    if (p != NULL) {
  ------------------
  |  Branch (121:9): [True: 1.17k, False: 0]
  ------------------
  122|  1.17k|        p->prop = p->body;
  123|  1.17k|        p->defn = *pl;
  124|  1.17k|        memcpy(p->body, prop, len + 1);
  125|  1.17k|        old = lh_PROPERTY_DEFN_ELEM_insert(property_defns, p);
  126|  1.17k|        if (!ossl_assert(old == NULL))
  ------------------
  |  |   52|  1.17k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  1.17k|    __FILE__, __LINE__)
  ------------------
  |  Branch (126:13): [True: 0, False: 1.17k]
  ------------------
  127|       |            /* This should not happen. An existing entry is handled above. */
  128|      0|            goto end;
  129|  1.17k|        if (!lh_PROPERTY_DEFN_ELEM_error(property_defns))
  ------------------
  |  Branch (129:13): [True: 1.17k, False: 0]
  ------------------
  130|  1.17k|            goto end;
  131|  1.17k|    }
  132|      0|    OPENSSL_free(p);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  133|      0|    res = 0;
  134|  1.17k|end:
  135|  1.17k|    ossl_lib_ctx_unlock(ctx);
  136|  1.17k|    return res;
  137|      0|}
defn_cache.c:property_defn_free:
   46|  1.17k|{
   47|  1.17k|    ossl_property_free(elem->defn);
   48|  1.17k|    OPENSSL_free(elem);
  ------------------
  |  |  131|  1.17k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   49|  1.17k|}
defn_cache.c:property_defn_hash:
   35|   171k|{
   36|   171k|    return OPENSSL_LH_strhash(a->prop);
   37|   171k|}
defn_cache.c:property_defn_cmp:
   41|   168k|{
   42|   168k|    return strcmp(a->prop, b->prop);
   43|   168k|}

ossl_ctx_global_properties_free:
  115|    787|{
  116|    787|    OSSL_GLOBAL_PROPERTIES *globp = vglobp;
  117|       |
  118|    787|    if (globp != NULL) {
  ------------------
  |  Branch (118:9): [True: 787, False: 0]
  ------------------
  119|    787|        ossl_property_free(globp->list);
  120|    787|        OPENSSL_free(globp);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  121|    787|    }
  122|    787|}
ossl_ctx_global_properties_new:
  125|    787|{
  126|    787|    return OPENSSL_zalloc(sizeof(OSSL_GLOBAL_PROPERTIES));
  ------------------
  |  |  108|    787|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  127|    787|}
ossl_ctx_global_properties:
  131|  34.9k|{
  132|  34.9k|    OSSL_GLOBAL_PROPERTIES *globp;
  133|       |
  134|  34.9k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  135|  34.9k|    if (loadconfig && !OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL))
  ------------------
  |  |  510|      0|#define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
  ------------------
  |  Branch (135:9): [True: 0, False: 34.9k]
  |  Branch (135:23): [True: 0, False: 0]
  ------------------
  136|      0|        return NULL;
  137|  34.9k|#endif
  138|  34.9k|    globp = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_GLOBAL_PROPERTIES);
  ------------------
  |  |  112|  34.9k|#define OSSL_LIB_CTX_GLOBAL_PROPERTIES 14
  ------------------
  139|       |
  140|  34.9k|    return globp != NULL ? &globp->list : NULL;
  ------------------
  |  Branch (140:12): [True: 34.9k, False: 0]
  ------------------
  141|  34.9k|}
ossl_method_store_new:
  244|  3.14k|{
  245|  3.14k|    OSSL_METHOD_STORE *res;
  246|       |
  247|  3.14k|    res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |  108|  3.14k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  248|  3.14k|    if (res != NULL) {
  ------------------
  |  Branch (248:9): [True: 3.14k, False: 0]
  ------------------
  249|  3.14k|        res->ctx = ctx;
  250|  3.14k|        if ((res->algs = ossl_sa_ALGORITHM_new()) == NULL
  ------------------
  |  Branch (250:13): [True: 0, False: 3.14k]
  ------------------
  251|  3.14k|            || (res->lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (251:16): [True: 0, False: 3.14k]
  ------------------
  252|  3.14k|            || (res->biglock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (252:16): [True: 0, False: 3.14k]
  ------------------
  253|      0|            ossl_method_store_free(res);
  254|      0|            return NULL;
  255|      0|        }
  256|  3.14k|    }
  257|  3.14k|    return res;
  258|  3.14k|}
ossl_method_store_free:
  261|  3.14k|{
  262|  3.14k|    if (store != NULL) {
  ------------------
  |  Branch (262:9): [True: 3.14k, False: 0]
  ------------------
  263|  3.14k|        if (store->algs != NULL)
  ------------------
  |  Branch (263:13): [True: 3.14k, False: 0]
  ------------------
  264|  3.14k|            ossl_sa_ALGORITHM_doall_arg(store->algs, &alg_cleanup, store);
  265|  3.14k|        ossl_sa_ALGORITHM_free(store->algs);
  266|  3.14k|        CRYPTO_THREAD_lock_free(store->lock);
  267|  3.14k|        CRYPTO_THREAD_lock_free(store->biglock);
  268|  3.14k|        OPENSSL_free(store);
  ------------------
  |  |  131|  3.14k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  269|  3.14k|    }
  270|  3.14k|}
ossl_method_lock_store:
  273|   119k|{
  274|   119k|    return store != NULL ? CRYPTO_THREAD_write_lock(store->biglock) : 0;
  ------------------
  |  Branch (274:12): [True: 119k, False: 0]
  ------------------
  275|   119k|}
ossl_method_unlock_store:
  278|   119k|{
  279|   119k|    return store != NULL ? CRYPTO_THREAD_unlock(store->biglock) : 0;
  ------------------
  |  Branch (279:12): [True: 119k, False: 0]
  ------------------
  280|   119k|}
ossl_method_store_add:
  321|   169k|{
  322|   169k|    ALGORITHM *alg = NULL;
  323|   169k|    IMPLEMENTATION *impl;
  324|   169k|    int ret = 0;
  325|   169k|    int i;
  326|       |
  327|   169k|    if (nid <= 0 || method == NULL || store == NULL)
  ------------------
  |  Branch (327:9): [True: 0, False: 169k]
  |  Branch (327:21): [True: 0, False: 169k]
  |  Branch (327:39): [True: 0, False: 169k]
  ------------------
  328|      0|        return 0;
  329|       |
  330|   169k|    if (properties == NULL)
  ------------------
  |  Branch (330:9): [True: 0, False: 169k]
  ------------------
  331|      0|        properties = "";
  332|       |
  333|   169k|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   52|   169k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|   169k|    __FILE__, __LINE__)
  ------------------
  |  Branch (333:9): [True: 0, False: 169k]
  ------------------
  334|      0|        return 0;
  335|       |
  336|       |    /* Create new entry */
  337|   169k|    impl = OPENSSL_malloc(sizeof(*impl));
  ------------------
  |  |  106|   169k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  338|   169k|    if (impl == NULL)
  ------------------
  |  Branch (338:9): [True: 0, False: 169k]
  ------------------
  339|      0|        return 0;
  340|   169k|    impl->method.method = method;
  341|   169k|    impl->method.up_ref = method_up_ref;
  342|   169k|    impl->method.free = method_destruct;
  343|   169k|    if (!ossl_method_up_ref(&impl->method)) {
  ------------------
  |  Branch (343:9): [True: 0, False: 169k]
  ------------------
  344|      0|        OPENSSL_free(impl);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  345|      0|        return 0;
  346|      0|    }
  347|   169k|    impl->provider = prov;
  348|       |
  349|       |    /* Insert into the hash table if required */
  350|   169k|    if (!ossl_property_write_lock(store)) {
  ------------------
  |  Branch (350:9): [True: 0, False: 169k]
  ------------------
  351|      0|        impl_free(impl);
  352|      0|        return 0;
  353|      0|    }
  354|       |
  355|       |    /*
  356|       |     * Flush the alg cache of any implementation that already exists
  357|       |     * for this id.
  358|       |     * This is done to ensure that on the next lookup we go through the
  359|       |     * provider comparison in ossl_method_store_fetch.  If we don't do this
  360|       |     * then this new method won't be given a chance to get selected.
  361|       |     * NOTE: This doesn't actually remove the method from the backing store
  362|       |     * It just ensures that we query the backing store when (re)-adding a
  363|       |     * method to the algorithm cache, in case the one selected by the next
  364|       |     * query selects a different implementation
  365|       |     */
  366|   169k|    ossl_method_cache_flush(store, nid);
  367|       |
  368|       |    /*
  369|       |     * Parse the properties associated with this method, and convert it to a
  370|       |     * property list stored against the implementation for later comparison
  371|       |     * during fetch operations
  372|       |     */
  373|   169k|    if ((impl->properties = ossl_prop_defn_get(store->ctx, properties)) == NULL) {
  ------------------
  |  Branch (373:9): [True: 1.17k, False: 168k]
  ------------------
  374|  1.17k|        impl->properties = ossl_parse_property(store->ctx, properties);
  375|  1.17k|        if (impl->properties == NULL)
  ------------------
  |  Branch (375:13): [True: 0, False: 1.17k]
  ------------------
  376|      0|            goto err;
  377|  1.17k|        if (!ossl_prop_defn_set(store->ctx, properties, &impl->properties)) {
  ------------------
  |  Branch (377:13): [True: 0, False: 1.17k]
  ------------------
  378|      0|            ossl_property_free(impl->properties);
  379|      0|            impl->properties = NULL;
  380|      0|            goto err;
  381|      0|        }
  382|  1.17k|    }
  383|       |
  384|       |    /*
  385|       |     * Check if we have an algorithm cache already for this nid.  If so use
  386|       |     * it, otherwise, create it, and insert it into the store
  387|       |     */
  388|   169k|    alg = ossl_method_store_retrieve(store, nid);
  389|   169k|    if (alg == NULL) {
  ------------------
  |  Branch (389:9): [True: 168k, False: 576]
  ------------------
  390|   168k|        if ((alg = OPENSSL_zalloc(sizeof(*alg))) == NULL
  ------------------
  |  |  108|   168k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (390:13): [True: 0, False: 168k]
  ------------------
  391|   168k|            || (alg->impls = sk_IMPLEMENTATION_new_null()) == NULL
  ------------------
  |  Branch (391:16): [True: 0, False: 168k]
  ------------------
  392|   168k|            || (alg->cache = lh_QUERY_new(&query_hash, &query_cmp)) == NULL)
  ------------------
  |  Branch (392:16): [True: 0, False: 168k]
  ------------------
  393|      0|            goto err;
  394|   168k|        alg->nid = nid;
  395|   168k|        if (!ossl_method_store_insert(store, alg))
  ------------------
  |  Branch (395:13): [True: 0, False: 168k]
  ------------------
  396|      0|            goto err;
  397|   168k|        OSSL_TRACE2(QUERY, "Inserted an alg with nid %d into the store %p\n", nid, (void *)store);
  ------------------
  |  |  295|   168k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  285|   168k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  398|   168k|    }
  399|       |
  400|       |    /* Push onto stack if there isn't one there already */
  401|   170k|    for (i = 0; i < sk_IMPLEMENTATION_num(alg->impls); i++) {
  ------------------
  |  Branch (401:17): [True: 607, False: 169k]
  ------------------
  402|    607|        const IMPLEMENTATION *tmpimpl = sk_IMPLEMENTATION_value(alg->impls, i);
  403|       |
  404|    607|        if (tmpimpl->provider == impl->provider
  ------------------
  |  Branch (404:13): [True: 77, False: 530]
  ------------------
  405|     77|            && tmpimpl->properties == impl->properties)
  ------------------
  |  Branch (405:16): [True: 0, False: 77]
  ------------------
  406|      0|            break;
  407|    607|    }
  408|       |
  409|   169k|    if (i == sk_IMPLEMENTATION_num(alg->impls)
  ------------------
  |  Branch (409:9): [True: 169k, False: 0]
  ------------------
  410|   169k|        && sk_IMPLEMENTATION_push(alg->impls, impl)) {
  ------------------
  |  Branch (410:12): [True: 169k, False: 0]
  ------------------
  411|   169k|        ret = 1;
  412|   169k|#ifndef FIPS_MODULE
  413|   169k|        OSSL_TRACE_BEGIN(QUERY)
  ------------------
  |  |  221|   169k|    do {                           \
  |  |  222|   169k|        BIO *trc_out = NULL;       \
  |  |  223|   169k|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 169k]
  |  |  ------------------
  ------------------
  414|      0|        {
  415|      0|            BIO_printf(trc_out, "Adding to method store "
  416|      0|                                "nid: %d\nproperties: %s\nprovider: %s\n",
  417|      0|                nid, properties,
  418|      0|                ossl_provider_name(prov) == NULL ? "none" : ossl_provider_name(prov));
  ------------------
  |  Branch (418:17): [True: 0, False: 0]
  ------------------
  419|      0|        }
  420|   169k|        OSSL_TRACE_END(QUERY);
  ------------------
  |  |  226|   169k|    }                            \
  |  |  227|   169k|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 169k]
  |  |  ------------------
  ------------------
  421|   169k|#endif
  422|   169k|    }
  423|   169k|    ossl_property_unlock(store);
  424|   169k|    if (ret == 0)
  ------------------
  |  Branch (424:9): [True: 0, False: 169k]
  ------------------
  425|      0|        impl_free(impl);
  426|   169k|    return ret;
  427|       |
  428|      0|err:
  429|      0|    ossl_property_unlock(store);
  430|       |    alg_cleanup(0, alg, NULL);
  431|      0|    impl_free(impl);
  432|      0|    return 0;
  433|   169k|}
ossl_method_store_remove_all_provided:
  540|  2.59k|{
  541|  2.59k|    struct alg_cleanup_by_provider_data_st data;
  542|       |
  543|  2.59k|    if (!ossl_property_write_lock(store))
  ------------------
  |  Branch (543:9): [True: 0, False: 2.59k]
  ------------------
  544|      0|        return 0;
  545|  2.59k|    data.prov = prov;
  546|  2.59k|    data.store = store;
  547|  2.59k|    ossl_sa_ALGORITHM_doall_arg(store->algs, &alg_cleanup_by_provider, &data);
  548|  2.59k|    ossl_property_unlock(store);
  549|  2.59k|    return 1;
  550|  2.59k|}
ossl_method_store_do_all:
  581|      6|{
  582|      6|    int i, j;
  583|      6|    int numalgs, numimps;
  584|      6|    STACK_OF(ALGORITHM) *tmpalgs;
  ------------------
  |  |   33|      6|#define STACK_OF(type) struct stack_st_##type
  ------------------
  585|      6|    ALGORITHM *alg;
  586|       |
  587|      6|    if (store != NULL) {
  ------------------
  |  Branch (587:9): [True: 6, False: 0]
  ------------------
  588|       |
  589|      6|        if (!ossl_property_read_lock(store))
  ------------------
  |  Branch (589:13): [True: 0, False: 6]
  ------------------
  590|      0|            return;
  591|       |
  592|      6|        tmpalgs = sk_ALGORITHM_new_reserve(NULL,
  593|      6|            (int)ossl_sa_ALGORITHM_num(store->algs));
  594|      6|        if (tmpalgs == NULL) {
  ------------------
  |  Branch (594:13): [True: 0, False: 6]
  ------------------
  595|      0|            ossl_property_unlock(store);
  596|      0|            return;
  597|      0|        }
  598|       |
  599|      6|        ossl_sa_ALGORITHM_doall_arg(store->algs, alg_copy, tmpalgs);
  600|      6|        ossl_property_unlock(store);
  601|      6|        numalgs = sk_ALGORITHM_num(tmpalgs);
  602|    662|        for (i = 0; i < numalgs; i++) {
  ------------------
  |  Branch (602:21): [True: 656, False: 6]
  ------------------
  603|    656|            alg = sk_ALGORITHM_value(tmpalgs, i);
  604|    656|            numimps = sk_IMPLEMENTATION_num(alg->impls);
  605|  1.49k|            for (j = 0; j < numimps; j++)
  ------------------
  |  Branch (605:25): [True: 840, False: 656]
  ------------------
  606|    840|                alg_do_one(alg, sk_IMPLEMENTATION_value(alg->impls, j), fn, fnarg);
  607|    656|        }
  608|      6|        sk_ALGORITHM_pop_free(tmpalgs, del_tmpalg);
  609|      6|    }
  610|      6|}
ossl_method_store_fetch:
  638|  47.7k|{
  639|  47.7k|    OSSL_PROPERTY_LIST **plp;
  640|  47.7k|    ALGORITHM *alg;
  641|  47.7k|    IMPLEMENTATION *impl, *best_impl = NULL;
  642|  47.7k|    OSSL_PROPERTY_LIST *pq = NULL, *p2 = NULL;
  643|  47.7k|    const OSSL_PROVIDER *prov = prov_rw != NULL ? *prov_rw : NULL;
  ------------------
  |  Branch (643:33): [True: 47.7k, False: 0]
  ------------------
  644|  47.7k|    int ret = 0;
  645|  47.7k|    int j, best = -1, score, optional;
  646|       |
  647|  47.7k|    if (nid <= 0 || method == NULL || store == NULL)
  ------------------
  |  Branch (647:9): [True: 0, False: 47.7k]
  |  Branch (647:21): [True: 0, False: 47.7k]
  |  Branch (647:39): [True: 0, False: 47.7k]
  ------------------
  648|      0|        return 0;
  649|       |
  650|  47.7k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  651|  47.7k|    if (ossl_lib_ctx_is_default(store->ctx)
  ------------------
  |  Branch (651:9): [True: 9.70k, False: 38.0k]
  ------------------
  652|  9.70k|        && !OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL))
  ------------------
  |  |  510|  9.70k|#define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
  ------------------
  |  Branch (652:12): [True: 0, False: 9.70k]
  ------------------
  653|      0|        return 0;
  654|  47.7k|#endif
  655|       |
  656|       |    /* This only needs to be a read lock, because the query won't create anything */
  657|  47.7k|    if (!ossl_property_read_lock(store))
  ------------------
  |  Branch (657:9): [True: 0, False: 47.7k]
  ------------------
  658|      0|        return 0;
  659|       |
  660|  47.7k|    OSSL_TRACE2(QUERY, "Retrieving by nid %d from store %p\n", nid, (void *)store);
  ------------------
  |  |  295|  47.7k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  285|  47.7k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  661|  47.7k|    alg = ossl_method_store_retrieve(store, nid);
  662|  47.7k|    if (alg == NULL) {
  ------------------
  |  Branch (662:9): [True: 12.8k, False: 34.9k]
  ------------------
  663|  12.8k|        ossl_property_unlock(store);
  664|  12.8k|        OSSL_TRACE2(QUERY, "Failed to retrieve by nid %d from store %p\n", nid, (void *)store);
  ------------------
  |  |  295|  12.8k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  285|  12.8k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  665|  12.8k|        return 0;
  666|  12.8k|    }
  667|  34.9k|    OSSL_TRACE2(QUERY, "Retrieved by nid %d from store %p\n", nid, (void *)store);
  ------------------
  |  |  295|  34.9k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  285|  34.9k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  668|       |
  669|       |    /*
  670|       |     * If a property query string is provided, convert it to an
  671|       |     * OSSL_PROPERTY_LIST structure
  672|       |     */
  673|  34.9k|    if (prop_query != NULL)
  ------------------
  |  Branch (673:9): [True: 34.9k, False: 0]
  ------------------
  674|  34.9k|        p2 = pq = ossl_parse_query(store->ctx, prop_query, 0);
  675|       |
  676|       |    /*
  677|       |     * If the library context has default properties specified
  678|       |     * then merge those with the properties passed to this function
  679|       |     */
  680|  34.9k|    plp = ossl_ctx_global_properties(store->ctx, 0);
  681|  34.9k|    if (plp != NULL && *plp != NULL) {
  ------------------
  |  Branch (681:9): [True: 34.9k, False: 0]
  |  Branch (681:24): [True: 0, False: 34.9k]
  ------------------
  682|      0|        if (pq == NULL) {
  ------------------
  |  Branch (682:13): [True: 0, False: 0]
  ------------------
  683|      0|            pq = *plp;
  684|      0|        } else {
  685|      0|            p2 = ossl_property_merge(pq, *plp);
  686|      0|            ossl_property_free(pq);
  687|      0|            if (p2 == NULL)
  ------------------
  |  Branch (687:17): [True: 0, False: 0]
  ------------------
  688|      0|                goto fin;
  689|      0|            pq = p2;
  690|      0|        }
  691|      0|    }
  692|       |
  693|       |    /*
  694|       |     * Search for a provider that provides this implementation.
  695|       |     * If the requested provider is NULL, then any provider will do,
  696|       |     * otherwise we should try to find the one that matches the requested
  697|       |     * provider.  Note that providers are given implicit preference via the
  698|       |     * ordering of the implementation stack
  699|       |     */
  700|  34.9k|    if (pq == NULL) {
  ------------------
  |  Branch (700:9): [True: 20.6k, False: 14.2k]
  ------------------
  701|  20.6k|        for (j = 0; j < sk_IMPLEMENTATION_num(alg->impls); j++) {
  ------------------
  |  Branch (701:21): [True: 20.6k, False: 0]
  ------------------
  702|  20.6k|            if ((impl = sk_IMPLEMENTATION_value(alg->impls, j)) != NULL
  ------------------
  |  Branch (702:17): [True: 20.6k, False: 0]
  ------------------
  703|  20.6k|                && (prov == NULL || impl->provider == prov)) {
  ------------------
  |  Branch (703:21): [True: 20.6k, False: 0]
  |  Branch (703:37): [True: 0, False: 0]
  ------------------
  704|  20.6k|                best_impl = impl;
  705|  20.6k|                ret = 1;
  706|  20.6k|                break;
  707|  20.6k|            }
  708|  20.6k|        }
  709|  20.6k|        goto fin;
  710|  20.6k|    }
  711|       |
  712|       |    /*
  713|       |     * If there are optional properties specified
  714|       |     * then run the search again, and select the provider that matches the
  715|       |     * most options
  716|       |     */
  717|  14.2k|    optional = ossl_property_has_optional(pq);
  718|  21.8k|    for (j = 0; j < sk_IMPLEMENTATION_num(alg->impls); j++) {
  ------------------
  |  Branch (718:17): [True: 14.2k, False: 7.59k]
  ------------------
  719|  14.2k|        if ((impl = sk_IMPLEMENTATION_value(alg->impls, j)) != NULL
  ------------------
  |  Branch (719:13): [True: 14.2k, False: 0]
  ------------------
  720|  14.2k|            && (prov == NULL || impl->provider == prov)) {
  ------------------
  |  Branch (720:17): [True: 13.1k, False: 1.09k]
  |  Branch (720:33): [True: 1.09k, False: 0]
  ------------------
  721|  14.2k|            score = ossl_property_match_count(pq, impl->properties);
  722|  14.2k|            if (score > best) {
  ------------------
  |  Branch (722:17): [True: 6.85k, False: 7.38k]
  ------------------
  723|  6.85k|                best_impl = impl;
  724|  6.85k|                best = score;
  725|  6.85k|                ret = 1;
  726|  6.85k|                if (!optional)
  ------------------
  |  Branch (726:21): [True: 6.64k, False: 205]
  ------------------
  727|  6.64k|                    goto fin;
  728|  6.85k|            }
  729|  14.2k|        }
  730|  14.2k|    }
  731|  34.9k|fin:
  732|  34.9k|    if (ret && ossl_method_up_ref(&best_impl->method)) {
  ------------------
  |  Branch (732:9): [True: 27.5k, False: 7.38k]
  |  Branch (732:16): [True: 27.5k, False: 0]
  ------------------
  733|  27.5k|        *method = best_impl->method.method;
  734|  27.5k|        if (prov_rw != NULL)
  ------------------
  |  Branch (734:13): [True: 27.5k, False: 0]
  ------------------
  735|  27.5k|            *prov_rw = best_impl->provider;
  736|  27.5k|    } else {
  737|  7.38k|        ret = 0;
  738|  7.38k|    }
  739|       |
  740|  34.9k|#ifndef FIPS_MODULE
  741|  34.9k|    OSSL_TRACE_BEGIN(QUERY)
  ------------------
  |  |  221|  34.9k|    do {                           \
  |  |  222|  34.9k|        BIO *trc_out = NULL;       \
  |  |  223|  34.9k|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 34.9k]
  |  |  ------------------
  ------------------
  742|      0|    {
  743|      0|        char buf[512];
  744|      0|        size_t size;
  745|       |
  746|      0|        size = ossl_property_list_to_string(NULL, pq, buf, 512);
  747|      0|        BIO_printf(trc_out, "method store query with properties %s "
  748|      0|                            "resolves to provider %s\n",
  749|      0|            size == 0 ? "none" : buf,
  ------------------
  |  Branch (749:13): [True: 0, False: 0]
  ------------------
  750|      0|            best_impl == NULL ? "none" : ossl_provider_name(best_impl->provider));
  ------------------
  |  Branch (750:13): [True: 0, False: 0]
  ------------------
  751|      0|    }
  752|  34.9k|    OSSL_TRACE_END(QUERY);
  ------------------
  |  |  226|  34.9k|    }                            \
  |  |  227|  34.9k|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 34.9k]
  |  |  ------------------
  ------------------
  753|  34.9k|#endif
  754|       |
  755|  34.9k|    ossl_property_unlock(store);
  756|  34.9k|    ossl_property_free(p2);
  757|  34.9k|    return ret;
  758|  14.2k|}
ossl_method_store_cache_flush_all:
  776|  2.59k|{
  777|  2.59k|    if (!ossl_property_write_lock(store))
  ------------------
  |  Branch (777:9): [True: 0, False: 2.59k]
  ------------------
  778|      0|        return 0;
  779|  2.59k|    ossl_sa_ALGORITHM_doall(store->algs, &impl_cache_flush_alg);
  780|  2.59k|    store->cache_nelem = 0;
  781|  2.59k|    ossl_property_unlock(store);
  782|  2.59k|    return 1;
  783|  2.59k|}
ossl_method_store_cache_get:
  861|   683k|{
  862|   683k|    ALGORITHM *alg;
  863|   683k|    QUERY elem, *r;
  864|   683k|    int res = 0;
  865|       |
  866|   683k|    if (nid <= 0 || store == NULL || prop_query == NULL)
  ------------------
  |  Branch (866:9): [True: 0, False: 683k]
  |  Branch (866:21): [True: 0, False: 683k]
  |  Branch (866:38): [True: 0, False: 683k]
  ------------------
  867|      0|        return 0;
  868|       |
  869|   683k|    if (!ossl_property_read_lock(store))
  ------------------
  |  Branch (869:9): [True: 0, False: 683k]
  ------------------
  870|      0|        return 0;
  871|   683k|    alg = ossl_method_store_retrieve(store, nid);
  872|   683k|    if (alg == NULL)
  ------------------
  |  Branch (872:9): [True: 14.7k, False: 668k]
  ------------------
  873|  14.7k|        goto err;
  874|       |
  875|   668k|    elem.query = prop_query;
  876|   668k|    elem.provider = prov;
  877|   668k|    r = lh_QUERY_retrieve(alg->cache, &elem);
  878|   668k|    if (r == NULL)
  ------------------
  |  Branch (878:9): [True: 31.8k, False: 636k]
  ------------------
  879|  31.8k|        goto err;
  880|   636k|    if (ossl_method_up_ref(&r->method)) {
  ------------------
  |  Branch (880:9): [True: 636k, False: 0]
  ------------------
  881|   636k|        *method = r->method.method;
  882|   636k|        res = 1;
  883|   636k|    }
  884|   683k|err:
  885|   683k|    ossl_property_unlock(store);
  886|   683k|    return res;
  887|   636k|}
ossl_method_store_cache_set:
  893|  27.5k|{
  894|  27.5k|    QUERY elem, *old, *p = NULL;
  895|  27.5k|    ALGORITHM *alg;
  896|  27.5k|    size_t len;
  897|  27.5k|    int res = 1;
  898|       |
  899|  27.5k|    if (nid <= 0 || store == NULL || prop_query == NULL)
  ------------------
  |  Branch (899:9): [True: 0, False: 27.5k]
  |  Branch (899:21): [True: 0, False: 27.5k]
  |  Branch (899:38): [True: 0, False: 27.5k]
  ------------------
  900|      0|        return 0;
  901|       |
  902|  27.5k|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   52|  27.5k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  27.5k|    __FILE__, __LINE__)
  ------------------
  |  Branch (902:9): [True: 0, False: 27.5k]
  ------------------
  903|      0|        return 0;
  904|       |
  905|  27.5k|    if (!ossl_property_write_lock(store))
  ------------------
  |  Branch (905:9): [True: 0, False: 27.5k]
  ------------------
  906|      0|        return 0;
  907|  27.5k|    if (store->cache_need_flush)
  ------------------
  |  Branch (907:9): [True: 0, False: 27.5k]
  ------------------
  908|      0|        ossl_method_cache_flush_some(store);
  909|  27.5k|    alg = ossl_method_store_retrieve(store, nid);
  910|  27.5k|    if (alg == NULL)
  ------------------
  |  Branch (910:9): [True: 0, False: 27.5k]
  ------------------
  911|      0|        goto err;
  912|       |
  913|  27.5k|    if (method == NULL) {
  ------------------
  |  Branch (913:9): [True: 0, False: 27.5k]
  ------------------
  914|      0|        elem.query = prop_query;
  915|      0|        elem.provider = prov;
  916|      0|        if ((old = lh_QUERY_delete(alg->cache, &elem)) != NULL) {
  ------------------
  |  Branch (916:13): [True: 0, False: 0]
  ------------------
  917|      0|            impl_cache_free(old);
  918|      0|            store->cache_nelem--;
  919|      0|        }
  920|      0|        goto end;
  921|      0|    }
  922|  27.5k|    p = OPENSSL_malloc(sizeof(*p) + (len = strlen(prop_query)));
  ------------------
  |  |  106|  27.5k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  923|  27.5k|    if (p != NULL) {
  ------------------
  |  Branch (923:9): [True: 27.5k, False: 0]
  ------------------
  924|  27.5k|        p->query = p->body;
  925|  27.5k|        p->provider = prov;
  926|  27.5k|        p->method.method = method;
  927|  27.5k|        p->method.up_ref = method_up_ref;
  928|  27.5k|        p->method.free = method_destruct;
  929|  27.5k|        if (!ossl_method_up_ref(&p->method))
  ------------------
  |  Branch (929:13): [True: 0, False: 27.5k]
  ------------------
  930|      0|            goto err;
  931|  27.5k|        memcpy((char *)p->query, prop_query, len + 1);
  932|  27.5k|        if ((old = lh_QUERY_insert(alg->cache, p)) != NULL) {
  ------------------
  |  Branch (932:13): [True: 0, False: 27.5k]
  ------------------
  933|      0|            impl_cache_free(old);
  934|      0|            goto end;
  935|      0|        }
  936|  27.5k|        if (!lh_QUERY_error(alg->cache)) {
  ------------------
  |  Branch (936:13): [True: 27.5k, False: 0]
  ------------------
  937|  27.5k|            if (++store->cache_nelem >= IMPL_CACHE_FLUSH_THRESHOLD)
  ------------------
  |  |   34|  27.5k|#define IMPL_CACHE_FLUSH_THRESHOLD 500
  ------------------
  |  Branch (937:17): [True: 0, False: 27.5k]
  ------------------
  938|      0|                store->cache_need_flush = 1;
  939|  27.5k|            goto end;
  940|  27.5k|        }
  941|      0|        ossl_method_free(&p->method);
  942|      0|    }
  943|      0|err:
  944|      0|    res = 0;
  945|      0|    OPENSSL_free(p);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  946|  27.5k|end:
  947|  27.5k|    ossl_property_unlock(store);
  948|  27.5k|    return res;
  949|      0|}
property.c:alg_cleanup:
  226|   168k|{
  227|   168k|    OSSL_METHOD_STORE *store = arg;
  228|       |
  229|   168k|    if (a != NULL) {
  ------------------
  |  Branch (229:9): [True: 168k, False: 0]
  ------------------
  230|   168k|        sk_IMPLEMENTATION_pop_free(a->impls, &impl_free);
  231|   168k|        lh_QUERY_doall(a->cache, &impl_cache_free);
  232|   168k|        lh_QUERY_free(a->cache);
  233|   168k|        OPENSSL_free(a);
  ------------------
  |  |  131|   168k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  234|   168k|    }
  235|   168k|    if (store != NULL)
  ------------------
  |  Branch (235:9): [True: 168k, False: 0]
  ------------------
  236|   168k|        ossl_sa_ALGORITHM_set(store->algs, idx, NULL);
  237|   168k|}
property.c:ossl_method_up_ref:
  163|   861k|{
  164|   861k|    return (*method->up_ref)(method->method);
  165|   861k|}
property.c:ossl_property_write_lock:
  178|   202k|{
  179|   202k|    return p != NULL ? CRYPTO_THREAD_write_lock(p->lock) : 0;
  ------------------
  |  Branch (179:12): [True: 202k, False: 0]
  ------------------
  180|   202k|}
property.c:impl_free:
  204|   169k|{
  205|   169k|    if (impl != NULL) {
  ------------------
  |  Branch (205:9): [True: 169k, False: 0]
  ------------------
  206|   169k|        ossl_method_free(&impl->method);
  207|   169k|        OPENSSL_free(impl);
  ------------------
  |  |  131|   169k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  208|   169k|    }
  209|   169k|}
property.c:ossl_method_store_retrieve:
  283|  1.09M|{
  284|  1.09M|    return ossl_sa_ALGORITHM_get(store->algs, nid);
  285|  1.09M|}
property.c:query_hash:
  188|   695k|{
  189|   695k|    return OPENSSL_LH_strhash(a->query);
  190|   695k|}
property.c:query_cmp:
  193|   636k|{
  194|   636k|    int res = strcmp(a->query, b->query);
  195|       |
  196|   636k|    if (res == 0 && a->provider != NULL && b->provider != NULL)
  ------------------
  |  Branch (196:9): [True: 636k, False: 4]
  |  Branch (196:21): [True: 636k, False: 0]
  |  Branch (196:44): [True: 2.19k, False: 634k]
  ------------------
  197|  2.19k|        res = b->provider > a->provider ? 1
  ------------------
  |  Branch (197:15): [True: 0, False: 2.19k]
  ------------------
  198|  2.19k|            : b->provider < a->provider ? -1
  ------------------
  |  Branch (198:15): [True: 0, False: 2.19k]
  ------------------
  199|  2.19k|                                        : 0;
  200|   636k|    return res;
  201|   636k|}
property.c:ossl_method_store_insert:
  288|   168k|{
  289|   168k|    return ossl_sa_ALGORITHM_set(store->algs, alg->nid, alg);
  290|   168k|}
property.c:ossl_property_unlock:
  183|   933k|{
  184|   933k|    return p != 0 ? CRYPTO_THREAD_unlock(p->lock) : 0;
  ------------------
  |  Branch (184:12): [True: 933k, False: 0]
  ------------------
  185|   933k|}
property.c:alg_cleanup_by_provider:
  494|   167k|{
  495|   167k|    struct alg_cleanup_by_provider_data_st *data = arg;
  496|   167k|    int i, count;
  497|       |
  498|       |    /*
  499|       |     * We walk the stack backwards, to avoid having to deal with stack shifts
  500|       |     * caused by deletion
  501|       |     */
  502|   335k|    for (count = 0, i = sk_IMPLEMENTATION_num(alg->impls); i-- > 0;) {
  ------------------
  |  Branch (502:60): [True: 168k, False: 167k]
  ------------------
  503|   168k|        IMPLEMENTATION *impl = sk_IMPLEMENTATION_value(alg->impls, i);
  504|       |
  505|   168k|        if (impl->provider == data->prov) {
  ------------------
  |  Branch (505:13): [True: 530, False: 167k]
  ------------------
  506|    530|#ifndef FIPS_MODULE
  507|    530|            OSSL_TRACE_BEGIN(QUERY)
  ------------------
  |  |  221|    530|    do {                           \
  |  |  222|    530|        BIO *trc_out = NULL;       \
  |  |  223|    530|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 530]
  |  |  ------------------
  ------------------
  508|      0|            {
  509|      0|                char buf[512];
  510|      0|                size_t size;
  511|       |
  512|      0|                size = ossl_property_list_to_string(NULL, impl->properties, buf,
  513|      0|                    sizeof(buf));
  514|      0|                BIO_printf(trc_out, "Removing implementation from "
  515|      0|                                    "query cache\nproperties %s\nprovider %s\n",
  516|      0|                    size == 0 ? "none" : buf,
  ------------------
  |  Branch (516:21): [True: 0, False: 0]
  ------------------
  517|      0|                    ossl_provider_name(impl->provider) == NULL ? "none" : ossl_provider_name(impl->provider));
  ------------------
  |  Branch (517:21): [True: 0, False: 0]
  ------------------
  518|      0|            }
  519|    530|            OSSL_TRACE_END(QUERY);
  ------------------
  |  |  226|    530|    }                            \
  |  |  227|    530|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 530]
  |  |  ------------------
  ------------------
  520|    530|#endif
  521|       |
  522|    530|            (void)sk_IMPLEMENTATION_delete(alg->impls, i);
  523|    530|            count++;
  524|    530|            impl_free(impl);
  525|    530|        }
  526|   168k|    }
  527|       |
  528|       |    /*
  529|       |     * If we removed any implementation, we also clear the whole associated
  530|       |     * cache, 'cause that's the sensible thing to do.
  531|       |     * There's no point flushing the cache entries where we didn't remove
  532|       |     * any implementation, though.
  533|       |     */
  534|   167k|    if (count > 0)
  ------------------
  |  Branch (534:9): [True: 530, False: 167k]
  ------------------
  535|    530|        ossl_method_cache_flush_alg(data->store, alg);
  536|   167k|}
property.c:ossl_method_cache_flush_alg:
  762|  1.10k|{
  763|  1.10k|    store->cache_nelem -= lh_QUERY_num_items(alg->cache);
  764|  1.10k|    impl_cache_flush_alg(0, alg);
  765|  1.10k|}
property.c:ossl_property_read_lock:
  173|   730k|{
  174|   730k|    return p != NULL ? CRYPTO_THREAD_read_lock(p->lock) : 0;
  ------------------
  |  Branch (174:12): [True: 730k, False: 0]
  ------------------
  175|   730k|}
property.c:alg_copy:
  560|    656|{
  561|    656|    STACK_OF(ALGORITHM) *newalg = arg;
  ------------------
  |  |   33|    656|#define STACK_OF(type) struct stack_st_##type
  ------------------
  562|       |
  563|    656|    alg = OPENSSL_memdup(alg, sizeof(ALGORITHM));
  ------------------
  |  |  133|    656|    CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  564|    656|    if (alg == NULL)
  ------------------
  |  Branch (564:9): [True: 0, False: 656]
  ------------------
  565|      0|        return;
  566|       |
  567|    656|    alg->impls = sk_IMPLEMENTATION_dup(alg->impls);
  568|       |
  569|    656|    (void)sk_ALGORITHM_push(newalg, alg);
  570|    656|}
property.c:alg_do_one:
  555|    840|{
  556|    840|    fn(alg->nid, impl->method.method, fnarg);
  557|    840|}
property.c:del_tmpalg:
  573|    656|{
  574|    656|    sk_IMPLEMENTATION_free(alg->impls);
  575|    656|    OPENSSL_free(alg);
  ------------------
  |  |  131|    656|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  576|    656|}
property.c:ossl_method_cache_flush:
  768|   169k|{
  769|   169k|    ALGORITHM *alg = ossl_method_store_retrieve(store, nid);
  770|       |
  771|   169k|    if (alg != NULL)
  ------------------
  |  Branch (771:9): [True: 576, False: 168k]
  ------------------
  772|    576|        ossl_method_cache_flush_alg(store, alg);
  773|   169k|}
property.c:impl_cache_flush_alg:
  220|  1.10k|{
  221|  1.10k|    lh_QUERY_doall(alg->cache, &impl_cache_free);
  222|  1.10k|    lh_QUERY_flush(alg->cache);
  223|  1.10k|}
property.c:impl_cache_free:
  212|  27.5k|{
  213|  27.5k|    if (elem != NULL) {
  ------------------
  |  Branch (213:9): [True: 27.5k, False: 0]
  ------------------
  214|  27.5k|        ossl_method_free(&elem->method);
  215|  27.5k|        OPENSSL_free(elem);
  ------------------
  |  |  131|  27.5k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  216|  27.5k|    }
  217|  27.5k|}
property.c:ossl_method_free:
  168|   197k|{
  169|   197k|    (*method->free)(method->method);
  170|   197k|}

ossl_err_load_PROP_strings:
   40|      1|{
   41|      1|#ifndef OPENSSL_NO_ERR
   42|      1|    if (ERR_reason_error_string(PROP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (42:9): [True: 1, False: 0]
  ------------------
   43|      1|        ERR_load_strings_const(PROP_str_reasons);
   44|      1|#endif
   45|      1|    return 1;
   46|      1|}

ossl_parse_property:
  346|  1.25k|{
  347|  1.25k|    OSSL_PROPERTY_DEFINITION *prop = NULL;
  348|  1.25k|    OSSL_PROPERTY_LIST *res = NULL;
  349|  1.25k|    STACK_OF(OSSL_PROPERTY_DEFINITION) *sk;
  ------------------
  |  |   33|  1.25k|#define STACK_OF(type) struct stack_st_##type
  ------------------
  350|  1.25k|    const char *s = defn;
  351|  1.25k|    int done;
  352|       |
  353|  1.25k|    if (s == NULL || (sk = sk_OSSL_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
  ------------------
  |  Branch (353:9): [True: 0, False: 1.25k]
  |  Branch (353:22): [True: 0, False: 1.25k]
  ------------------
  354|      0|        return NULL;
  355|       |
  356|  1.25k|    s = skip_space(s);
  357|  1.25k|    done = *s == '\0';
  358|  2.77k|    while (!done) {
  ------------------
  |  Branch (358:12): [True: 1.51k, False: 1.25k]
  ------------------
  359|  1.51k|        const char *start = s;
  360|       |
  361|  1.51k|        prop = OPENSSL_malloc(sizeof(*prop));
  ------------------
  |  |  106|  1.51k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  362|  1.51k|        if (prop == NULL)
  ------------------
  |  Branch (362:13): [True: 0, False: 1.51k]
  ------------------
  363|      0|            goto err;
  364|  1.51k|        memset(&prop->v, 0, sizeof(prop->v));
  365|  1.51k|        prop->optional = 0;
  366|  1.51k|        if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (366:13): [True: 0, False: 1.51k]
  ------------------
  367|      0|            goto err;
  368|  1.51k|        prop->oper = OSSL_PROPERTY_OPER_EQ;
  369|  1.51k|        if (prop->name_idx == 0) {
  ------------------
  |  Branch (369:13): [True: 0, False: 1.51k]
  ------------------
  370|      0|            ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  118|      0|#define ERR_LIB_PROP 55
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |   35|      0|#define PROP_R_PARSE_FAILED 108
  ------------------
  371|      0|                "Unknown name HERE-->%s", start);
  372|      0|            goto err;
  373|      0|        }
  374|  1.51k|        if (match_ch(&s, '=')) {
  ------------------
  |  Branch (374:13): [True: 1.51k, False: 0]
  ------------------
  375|  1.51k|            if (!parse_value(ctx, &s, prop, 1)) {
  ------------------
  |  Branch (375:17): [True: 0, False: 1.51k]
  ------------------
  376|      0|                ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE,
  ------------------
  |  |  118|      0|#define ERR_LIB_PROP 55
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE,
  ------------------
  |  |   34|      0|#define PROP_R_NO_VALUE 107
  ------------------
  377|      0|                    "HERE-->%s", start);
  378|      0|                goto err;
  379|      0|            }
  380|  1.51k|        } else {
  381|       |            /* A name alone means a true Boolean */
  382|      0|            prop->type = OSSL_PROPERTY_TYPE_STRING;
  383|      0|            prop->v.str_val = OSSL_PROPERTY_TRUE;
  ------------------
  |  |   39|      0|#define OSSL_PROPERTY_TRUE 1
  ------------------
  384|      0|        }
  385|       |
  386|  1.51k|        if (!sk_OSSL_PROPERTY_DEFINITION_push(sk, prop))
  ------------------
  |  Branch (386:13): [True: 0, False: 1.51k]
  ------------------
  387|      0|            goto err;
  388|  1.51k|        prop = NULL;
  389|  1.51k|        done = !match_ch(&s, ',');
  390|  1.51k|    }
  391|  1.25k|    if (*s != '\0') {
  ------------------
  |  Branch (391:9): [True: 0, False: 1.25k]
  ------------------
  392|      0|        ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |  118|      0|#define ERR_LIB_PROP 55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |   37|      0|#define PROP_R_TRAILING_CHARACTERS 110
  ------------------
  393|      0|            "HERE-->%s", s);
  394|      0|        goto err;
  395|      0|    }
  396|  1.25k|    res = stack_to_property_list(ctx, sk);
  397|       |
  398|  1.25k|err:
  399|  1.25k|    OPENSSL_free(prop);
  ------------------
  |  |  131|  1.25k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  400|  1.25k|    sk_OSSL_PROPERTY_DEFINITION_pop_free(sk, &pd_free);
  401|  1.25k|    return res;
  402|  1.25k|}
ossl_parse_query:
  406|  34.9k|{
  407|  34.9k|    STACK_OF(OSSL_PROPERTY_DEFINITION) *sk;
  ------------------
  |  |   33|  34.9k|#define STACK_OF(type) struct stack_st_##type
  ------------------
  408|  34.9k|    OSSL_PROPERTY_LIST *res = NULL;
  409|  34.9k|    OSSL_PROPERTY_DEFINITION *prop = NULL;
  410|  34.9k|    int done;
  411|       |
  412|  34.9k|    if (s == NULL || (sk = sk_OSSL_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
  ------------------
  |  Branch (412:9): [True: 0, False: 34.9k]
  |  Branch (412:22): [True: 0, False: 34.9k]
  ------------------
  413|      0|        return NULL;
  414|       |
  415|  34.9k|    s = skip_space(s);
  416|  34.9k|    done = *s == '\0';
  417|   275k|    while (!done) {
  ------------------
  |  Branch (417:12): [True: 243k, False: 31.0k]
  ------------------
  418|   243k|        prop = OPENSSL_malloc(sizeof(*prop));
  ------------------
  |  |  106|   243k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  419|   243k|        if (prop == NULL)
  ------------------
  |  Branch (419:13): [True: 0, False: 243k]
  ------------------
  420|      0|            goto err;
  421|   243k|        memset(&prop->v, 0, sizeof(prop->v));
  422|       |
  423|   243k|        if (match_ch(&s, '-')) {
  ------------------
  |  Branch (423:13): [True: 950, False: 243k]
  ------------------
  424|    950|            prop->oper = OSSL_PROPERTY_OVERRIDE;
  425|    950|            prop->optional = 0;
  426|    950|            if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (426:17): [True: 205, False: 745]
  ------------------
  427|    205|                goto err;
  428|    745|            goto skip_value;
  429|    950|        }
  430|   243k|        prop->optional = match_ch(&s, '?');
  431|   243k|        if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (431:13): [True: 3.64k, False: 239k]
  ------------------
  432|  3.64k|            goto err;
  433|       |
  434|   239k|        if (match_ch(&s, '=')) {
  ------------------
  |  Branch (434:13): [True: 53.1k, False: 186k]
  ------------------
  435|  53.1k|            prop->oper = OSSL_PROPERTY_OPER_EQ;
  436|   186k|        } else if (MATCH(&s, "!=")) {
  ------------------
  |  |   43|   186k|#define MATCH(s, m) match(s, m, sizeof(m) - 1)
  |  |  ------------------
  |  |  |  Branch (43:21): [True: 4.02k, False: 182k]
  |  |  ------------------
  ------------------
  437|  4.02k|            prop->oper = OSSL_PROPERTY_OPER_NE;
  438|   182k|        } else {
  439|       |            /* A name alone is a Boolean comparison for true */
  440|   182k|            prop->oper = OSSL_PROPERTY_OPER_EQ;
  441|   182k|            prop->type = OSSL_PROPERTY_TYPE_STRING;
  442|   182k|            prop->v.str_val = OSSL_PROPERTY_TRUE;
  ------------------
  |  |   39|   182k|#define OSSL_PROPERTY_TRUE 1
  ------------------
  443|   182k|            goto skip_value;
  444|   182k|        }
  445|  57.1k|        if (!parse_value(ctx, &s, prop, create_values))
  ------------------
  |  Branch (445:13): [True: 51.4k, False: 5.70k]
  ------------------
  446|  51.4k|            prop->type = OSSL_PROPERTY_TYPE_VALUE_UNDEFINED;
  447|       |
  448|   240k|    skip_value:
  449|   240k|        if (!sk_OSSL_PROPERTY_DEFINITION_push(sk, prop))
  ------------------
  |  Branch (449:13): [True: 0, False: 240k]
  ------------------
  450|      0|            goto err;
  451|   240k|        prop = NULL;
  452|   240k|        done = !match_ch(&s, ',');
  453|   240k|    }
  454|  31.0k|    if (*s != '\0') {
  ------------------
  |  Branch (454:9): [True: 14.5k, False: 16.4k]
  ------------------
  455|  14.5k|        ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |  406|  14.5k|    (ERR_new(),                                                  \
  |  |  407|  14.5k|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|  14.5k|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|  14.5k|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |  118|  14.5k|#define ERR_LIB_PROP 55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS,
  ------------------
  |  |   37|  14.5k|#define PROP_R_TRAILING_CHARACTERS 110
  ------------------
  456|  14.5k|            "HERE-->%s", s);
  457|  14.5k|        goto err;
  458|  14.5k|    }
  459|  16.4k|    res = stack_to_property_list(ctx, sk);
  460|       |
  461|  34.9k|err:
  462|  34.9k|    OPENSSL_free(prop);
  ------------------
  |  |  131|  34.9k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  463|  34.9k|    sk_OSSL_PROPERTY_DEFINITION_pop_free(sk, &pd_free);
  464|  34.9k|    return res;
  465|  16.4k|}
ossl_property_match_count:
  473|  14.2k|{
  474|  14.2k|    const OSSL_PROPERTY_DEFINITION *const q = query->properties;
  475|  14.2k|    const OSSL_PROPERTY_DEFINITION *const d = defn->properties;
  476|  14.2k|    int i = 0, j = 0, matches = 0;
  477|  14.2k|    OSSL_PROPERTY_OPER oper;
  478|       |
  479|  16.5k|    while (i < query->num_properties) {
  ------------------
  |  Branch (479:12): [True: 9.73k, False: 6.85k]
  ------------------
  480|  9.73k|        if ((oper = q[i].oper) == OSSL_PROPERTY_OVERRIDE) {
  ------------------
  |  Branch (480:13): [True: 130, False: 9.60k]
  ------------------
  481|    130|            i++;
  482|    130|            continue;
  483|    130|        }
  484|  9.60k|        if (j < defn->num_properties) {
  ------------------
  |  Branch (484:13): [True: 8.31k, False: 1.28k]
  ------------------
  485|  8.31k|            if (q[i].name_idx > d[j].name_idx) { /* skip defn, not in query */
  ------------------
  |  Branch (485:17): [True: 1.19k, False: 7.11k]
  ------------------
  486|  1.19k|                j++;
  487|  1.19k|                continue;
  488|  1.19k|            }
  489|  7.11k|            if (q[i].name_idx == d[j].name_idx) { /* both in defn and query */
  ------------------
  |  Branch (489:17): [True: 130, False: 6.98k]
  ------------------
  490|    130|                const int eq = q[i].type == d[j].type
  ------------------
  |  Branch (490:32): [True: 89, False: 41]
  ------------------
  491|     89|                    && memcmp(&q[i].v, &d[j].v, sizeof(q[i].v)) == 0;
  ------------------
  |  Branch (491:24): [True: 0, False: 89]
  ------------------
  492|       |
  493|    130|                if ((eq && oper == OSSL_PROPERTY_OPER_EQ)
  ------------------
  |  Branch (493:22): [True: 0, False: 130]
  |  Branch (493:28): [True: 0, False: 0]
  ------------------
  494|    130|                    || (!eq && oper == OSSL_PROPERTY_OPER_NE))
  ------------------
  |  Branch (494:25): [True: 130, False: 0]
  |  Branch (494:32): [True: 41, False: 89]
  ------------------
  495|     41|                    matches++;
  496|     89|                else if (!q[i].optional)
  ------------------
  |  Branch (496:26): [True: 89, False: 0]
  ------------------
  497|     89|                    return -1;
  498|     41|                i++;
  499|     41|                j++;
  500|     41|                continue;
  501|    130|            }
  502|  7.11k|        }
  503|       |
  504|       |        /*
  505|       |         * Handle the cases of a missing value and a query with no corresponding
  506|       |         * definition.  The former fails for any comparison except inequality,
  507|       |         * the latter is treated as a comparison against the Boolean false.
  508|       |         */
  509|  8.27k|        if (q[i].type == OSSL_PROPERTY_TYPE_VALUE_UNDEFINED) {
  ------------------
  |  Branch (509:13): [True: 2.29k, False: 5.98k]
  ------------------
  510|  2.29k|            if (oper == OSSL_PROPERTY_OPER_NE)
  ------------------
  |  Branch (510:17): [True: 294, False: 1.99k]
  ------------------
  511|    294|                matches++;
  512|  1.99k|            else if (!q[i].optional)
  ------------------
  |  Branch (512:22): [True: 1.86k, False: 130]
  ------------------
  513|  1.86k|                return -1;
  514|  5.98k|        } else if (q[i].type != OSSL_PROPERTY_TYPE_STRING
  ------------------
  |  Branch (514:20): [True: 3.11k, False: 2.86k]
  ------------------
  515|  2.86k|            || (oper == OSSL_PROPERTY_OPER_EQ
  ------------------
  |  Branch (515:17): [True: 2.69k, False: 171]
  ------------------
  516|  2.69k|                && q[i].v.str_val != OSSL_PROPERTY_FALSE)
  ------------------
  |  |   40|  2.69k|#define OSSL_PROPERTY_FALSE 2
  ------------------
  |  Branch (516:20): [True: 2.65k, False: 41]
  ------------------
  517|    212|            || (oper == OSSL_PROPERTY_OPER_NE
  ------------------
  |  Branch (517:17): [True: 171, False: 41]
  ------------------
  518|  5.86k|                && q[i].v.str_val == OSSL_PROPERTY_FALSE)) {
  ------------------
  |  |   40|    171|#define OSSL_PROPERTY_FALSE 2
  ------------------
  |  Branch (518:20): [True: 89, False: 82]
  ------------------
  519|  5.86k|            if (!q[i].optional)
  ------------------
  |  Branch (519:17): [True: 5.42k, False: 431]
  ------------------
  520|  5.42k|                return -1;
  521|  5.86k|        } else {
  522|    123|            matches++;
  523|    123|        }
  524|    978|        i++;
  525|    978|    }
  526|  6.85k|    return matches;
  527|  14.2k|}
ossl_property_free:
  530|  36.9k|{
  531|  36.9k|    OPENSSL_free(p);
  ------------------
  |  |  131|  36.9k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  532|  36.9k|}
ossl_property_parse_init:
  575|    787|{
  576|    787|    static const char *const predefined_names[] = {
  577|    787|        "provider", /* Name of provider (default, legacy, fips) */
  578|    787|        "version", /* Version number of this provider */
  579|    787|        "fips", /* FIPS validated or FIPS supporting algorithm */
  580|    787|        "output", /* Output type for encoders */
  581|    787|        "input", /* Input type for decoders */
  582|    787|        "structure", /* Structure name for encoders and decoders */
  583|    787|    };
  584|    787|    size_t i;
  585|       |
  586|  5.50k|    for (i = 0; i < OSSL_NELEM(predefined_names); i++)
  ------------------
  |  |   14|  5.50k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (586:17): [True: 4.72k, False: 787]
  ------------------
  587|  4.72k|        if (ossl_property_name(ctx, predefined_names[i], 1) == 0)
  ------------------
  |  Branch (587:13): [True: 0, False: 4.72k]
  ------------------
  588|      0|            goto err;
  589|       |
  590|       |    /*
  591|       |     * Pre-populate the two Boolean values. We must do them before any other
  592|       |     * values and in this order so that we get the same index as the global
  593|       |     * OSSL_PROPERTY_TRUE and OSSL_PROPERTY_FALSE values
  594|       |     */
  595|    787|    if ((ossl_property_value(ctx, "yes", 1) != OSSL_PROPERTY_TRUE)
  ------------------
  |  |   39|    787|#define OSSL_PROPERTY_TRUE 1
  ------------------
  |  Branch (595:9): [True: 0, False: 787]
  ------------------
  596|    787|        || (ossl_property_value(ctx, "no", 1) != OSSL_PROPERTY_FALSE))
  ------------------
  |  |   40|    787|#define OSSL_PROPERTY_FALSE 2
  ------------------
  |  Branch (596:12): [True: 0, False: 787]
  ------------------
  597|      0|        goto err;
  598|       |
  599|    787|    return 1;
  600|      0|err:
  601|      0|    return 0;
  602|    787|}
property_parse.c:pd_compare:
  289|   367k|{
  290|   367k|    const OSSL_PROPERTY_DEFINITION *pd1 = *p1;
  291|   367k|    const OSSL_PROPERTY_DEFINITION *pd2 = *p2;
  292|       |
  293|   367k|    if (pd1->name_idx < pd2->name_idx)
  ------------------
  |  Branch (293:9): [True: 83.5k, False: 284k]
  ------------------
  294|  83.5k|        return -1;
  295|   284k|    if (pd1->name_idx > pd2->name_idx)
  ------------------
  |  Branch (295:9): [True: 139k, False: 144k]
  ------------------
  296|   139k|        return 1;
  297|   144k|    return 0;
  298|   284k|}
property_parse.c:skip_space:
   26|   592k|{
   27|   756k|    while (ossl_isspace(*s))
  ------------------
  |  |   82|   756k|#define ossl_isspace(c) (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|   756k|#define CTYPE_MASK_space 0x8
  |  |  ------------------
  |  |  |  Branch (82:25): [True: 163k, False: 592k]
  |  |  ------------------
  ------------------
   28|   163k|        s++;
   29|   592k|    return s;
   30|   592k|}
property_parse.c:parse_name:
   58|   245k|{
   59|   245k|    char name[100];
   60|   245k|    int err = 0;
   61|   245k|    size_t i = 0;
   62|   245k|    const char *s = *t;
   63|   245k|    int user_name = 0;
   64|       |
   65|   366k|    for (;;) {
   66|   366k|        if (!ossl_isalpha(*s)) {
  ------------------
  |  |   71|   366k|#define ossl_isalpha(c) (ossl_ctype_check((c), CTYPE_MASK_alpha))
  |  |  ------------------
  |  |  |  |   40|   366k|#define CTYPE_MASK_alpha (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|   366k|#define CTYPE_MASK_lower 0x1
  |  |  |  |  ------------------
  |  |  |  |               #define CTYPE_MASK_alpha (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|   366k|#define CTYPE_MASK_upper 0x2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (66:13): [True: 3.19k, False: 363k]
  ------------------
   67|  3.19k|            ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_IDENTIFIER,
  ------------------
  |  |  406|  3.19k|    (ERR_new(),                                                  \
  |  |  407|  3.19k|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|  3.19k|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|  3.19k|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_IDENTIFIER,
  ------------------
  |  |  118|  3.19k|#define ERR_LIB_PROP 55
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_IDENTIFIER,
  ------------------
  |  |   30|  3.19k|#define PROP_R_NOT_AN_IDENTIFIER 103
  ------------------
   68|  3.19k|                "HERE-->%s", *t);
   69|  3.19k|            return 0;
   70|  3.19k|        }
   71|  1.38M|        do {
   72|  1.38M|            if (i < sizeof(name) - 1)
  ------------------
  |  Branch (72:17): [True: 1.22M, False: 160k]
  ------------------
   73|  1.22M|                name[i++] = ossl_tolower(*s);
   74|   160k|            else
   75|   160k|                err = 1;
   76|  1.38M|        } while (*++s == '_' || ossl_isalnum(*s));
  ------------------
  |  |   70|  1.35M|#define ossl_isalnum(c) (ossl_ctype_check((c), CTYPE_MASK_alnum))
  |  |  ------------------
  |  |  |  |   41|  1.35M|#define CTYPE_MASK_alnum (CTYPE_MASK_alpha | CTYPE_MASK_digit)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  1.35M|#define CTYPE_MASK_alpha (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   27|  1.35M|#define CTYPE_MASK_lower 0x1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define CTYPE_MASK_alpha (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   28|  1.35M|#define CTYPE_MASK_upper 0x2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define CTYPE_MASK_alnum (CTYPE_MASK_alpha | CTYPE_MASK_digit)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|  1.35M|#define CTYPE_MASK_digit 0x4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (70:25): [True: 991k, False: 363k]
  |  |  ------------------
  ------------------
  |  Branch (76:18): [True: 27.8k, False: 1.35M]
  ------------------
   77|   363k|        if (*s != '.')
  ------------------
  |  Branch (77:13): [True: 242k, False: 120k]
  ------------------
   78|   242k|            break;
   79|   120k|        user_name = 1;
   80|   120k|        if (i < sizeof(name) - 1)
  ------------------
  |  Branch (80:13): [True: 111k, False: 8.89k]
  ------------------
   81|   111k|            name[i++] = *s;
   82|  8.89k|        else
   83|  8.89k|            err = 1;
   84|   120k|        s++;
   85|   120k|    }
   86|   242k|    name[i] = '\0';
   87|   242k|    if (err) {
  ------------------
  |  Branch (87:9): [True: 656, False: 241k]
  ------------------
   88|    656|        ERR_raise_data(ERR_LIB_PROP, PROP_R_NAME_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  406|    656|    (ERR_new(),                                                  \
  |  |  407|    656|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|    656|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|    656|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NAME_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  118|    656|#define ERR_LIB_PROP 55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NAME_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |   27|    656|#define PROP_R_NAME_TOO_LONG 100
  ------------------
   89|    656|        return 0;
   90|    656|    }
   91|   241k|    *t = skip_space(s);
   92|   241k|    *idx = ossl_property_name(ctx, name, user_name && create);
  ------------------
  |  Branch (92:42): [True: 94.7k, False: 146k]
  |  Branch (92:55): [True: 94.7k, False: 0]
  ------------------
   93|   241k|    return 1;
   94|   242k|}
property_parse.c:match_ch:
   33|   969k|{
   34|   969k|    const char *s = *t;
   35|       |
   36|   969k|    if (*s == m) {
  ------------------
  |  Branch (36:9): [True: 273k, False: 696k]
  ------------------
   37|   273k|        *t = skip_space(s + 1);
   38|   273k|        return 1;
   39|   273k|    }
   40|   696k|    return 0;
   41|   969k|}
property_parse.c:parse_value:
  258|  58.6k|{
  259|  58.6k|    const char *s = *t;
  260|  58.6k|    int r = 0;
  261|       |
  262|  58.6k|    if (*s == '"' || *s == '\'') {
  ------------------
  |  Branch (262:9): [True: 533, False: 58.1k]
  |  Branch (262:22): [True: 752, False: 57.4k]
  ------------------
  263|  1.28k|        s++;
  264|  1.28k|        r = parse_string(ctx, &s, s[-1], res, create);
  265|  57.4k|    } else if (*s == '+') {
  ------------------
  |  Branch (265:16): [True: 171, False: 57.2k]
  ------------------
  266|    171|        s++;
  267|    171|        r = parse_number(&s, res);
  268|  57.2k|    } else if (*s == '-') {
  ------------------
  |  Branch (268:16): [True: 506, False: 56.7k]
  ------------------
  269|    506|        s++;
  270|    506|        r = parse_number(&s, res);
  271|    506|        res->v.int_val = -res->v.int_val;
  272|  56.7k|    } else if (*s == '0' && s[1] == 'x') {
  ------------------
  |  Branch (272:16): [True: 9.57k, False: 47.1k]
  |  Branch (272:29): [True: 4.86k, False: 4.71k]
  ------------------
  273|  4.86k|        s += 2;
  274|  4.86k|        r = parse_hex(&s, res);
  275|  51.8k|    } else if (*s == '0' && ossl_isdigit(s[1])) {
  ------------------
  |  Branch (275:16): [True: 4.71k, False: 47.1k]
  |  Branch (275:29): [True: 3.94k, False: 773]
  ------------------
  276|  3.94k|        s++;
  277|  3.94k|        r = parse_oct(&s, res);
  278|  47.9k|    } else if (ossl_isdigit(*s)) {
  ------------------
  |  Branch (278:16): [True: 3.62k, False: 44.2k]
  ------------------
  279|  3.62k|        return parse_number(t, res);
  280|  44.2k|    } else if (ossl_isalpha(*s))
  ------------------
  |  |   71|  44.2k|#define ossl_isalpha(c) (ossl_ctype_check((c), CTYPE_MASK_alpha))
  |  |  ------------------
  |  |  |  |   40|  44.2k|#define CTYPE_MASK_alpha (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  44.2k|#define CTYPE_MASK_lower 0x1
  |  |  |  |  ------------------
  |  |  |  |               #define CTYPE_MASK_alpha (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|  44.2k|#define CTYPE_MASK_upper 0x2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:25): [True: 32.2k, False: 12.0k]
  |  |  ------------------
  ------------------
  281|  32.2k|        return parse_unquoted(ctx, t, res, create);
  282|  22.8k|    if (r)
  ------------------
  |  Branch (282:9): [True: 3.83k, False: 18.9k]
  ------------------
  283|  3.83k|        *t = s;
  284|  22.8k|    return r;
  285|  58.6k|}
property_parse.c:parse_string:
  195|  1.28k|{
  196|  1.28k|    char v[1000];
  197|  1.28k|    const char *s = *t;
  198|  1.28k|    size_t i = 0;
  199|  1.28k|    int err = 0;
  200|       |
  201|   241k|    while (*s != '\0' && *s != delim) {
  ------------------
  |  Branch (201:12): [True: 240k, False: 738]
  |  Branch (201:26): [True: 239k, False: 547]
  ------------------
  202|   239k|        if (i < sizeof(v) - 1)
  ------------------
  |  Branch (202:13): [True: 237k, False: 2.33k]
  ------------------
  203|   237k|            v[i++] = *s;
  204|  2.33k|        else
  205|  2.33k|            err = 1;
  206|   239k|        s++;
  207|   239k|    }
  208|  1.28k|    if (*s == '\0') {
  ------------------
  |  Branch (208:9): [True: 738, False: 547]
  ------------------
  209|    738|        ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_MATCHING_STRING_DELIMITER,
  ------------------
  |  |  406|    738|    (ERR_new(),                                                  \
  |  |  407|    738|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|    738|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|    738|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_MATCHING_STRING_DELIMITER,
  ------------------
  |  |  118|    738|#define ERR_LIB_PROP 55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_MATCHING_STRING_DELIMITER,
  ------------------
  |  |   33|    738|#define PROP_R_NO_MATCHING_STRING_DELIMITER 106
  ------------------
  210|    738|            "HERE-->%c%s", delim, *t);
  211|    738|        return 0;
  212|    738|    }
  213|    547|    v[i] = '\0';
  214|    547|    if (err) {
  ------------------
  |  Branch (214:9): [True: 41, False: 506]
  ------------------
  215|     41|        ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  406|     41|    (ERR_new(),                                                  \
  |  |  407|     41|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|     41|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|     41|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  118|     41|#define ERR_LIB_PROP 55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |   36|     41|#define PROP_R_STRING_TOO_LONG 109
  ------------------
  216|    506|    } else {
  217|    506|        res->v.str_val = ossl_property_value(ctx, v, create);
  218|    506|    }
  219|    547|    *t = skip_space(s + 1);
  220|    547|    res->type = OSSL_PROPERTY_TYPE_STRING;
  221|    547|    return !err;
  222|  1.28k|}
property_parse.c:parse_number:
   97|  4.30k|{
   98|  4.30k|    const char *s = *t;
   99|  4.30k|    int64_t v = 0;
  100|       |
  101|  57.2k|    do {
  102|  57.2k|        if (!ossl_isdigit(*s)) {
  ------------------
  |  Branch (102:13): [True: 41, False: 57.2k]
  ------------------
  103|     41|            ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_A_DECIMAL_DIGIT,
  ------------------
  |  |  406|     41|    (ERR_new(),                                                  \
  |  |  407|     41|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|     41|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|     41|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_A_DECIMAL_DIGIT,
  ------------------
  |  |  118|     41|#define ERR_LIB_PROP 55
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_A_DECIMAL_DIGIT,
  ------------------
  |  |   32|     41|#define PROP_R_NOT_A_DECIMAL_DIGIT 105
  ------------------
  104|     41|                "HERE-->%s", *t);
  105|     41|            return 0;
  106|     41|        }
  107|       |        /* overflow check */
  108|  57.2k|        if (v > ((INT64_MAX - (*s - '0')) / 10)) {
  ------------------
  |  Branch (108:13): [True: 1.47k, False: 55.7k]
  ------------------
  109|  1.47k|            ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  406|  1.47k|    (ERR_new(),                                                  \
  |  |  407|  1.47k|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|  1.47k|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|  1.47k|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  118|  1.47k|#define ERR_LIB_PROP 55
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |   35|  1.47k|#define PROP_R_PARSE_FAILED 108
  ------------------
  110|  1.47k|                "Property %s overflows", *t);
  111|  1.47k|            return 0;
  112|  1.47k|        }
  113|  55.7k|        v = v * 10 + (*s++ - '0');
  114|  55.7k|    } while (ossl_isdigit(*s));
  ------------------
  |  Branch (114:14): [True: 52.9k, False: 2.78k]
  ------------------
  115|  2.78k|    if (!ossl_isspace(*s) && *s != '\0' && *s != ',') {
  ------------------
  |  |   82|  5.56k|#define ossl_isspace(c) (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  2.78k|#define CTYPE_MASK_space 0x8
  |  |  ------------------
  ------------------
  |  Branch (115:9): [True: 2.27k, False: 513]
  |  Branch (115:30): [True: 1.11k, False: 1.15k]
  |  Branch (115:44): [True: 779, False: 335]
  ------------------
  116|    779|        ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_A_DECIMAL_DIGIT,
  ------------------
  |  |  406|    779|    (ERR_new(),                                                  \
  |  |  407|    779|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|    779|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|    779|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_A_DECIMAL_DIGIT,
  ------------------
  |  |  118|    779|#define ERR_LIB_PROP 55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_A_DECIMAL_DIGIT,
  ------------------
  |  |   32|    779|#define PROP_R_NOT_A_DECIMAL_DIGIT 105
  ------------------
  117|    779|            "HERE-->%s", *t);
  118|    779|        return 0;
  119|    779|    }
  120|  2.00k|    *t = skip_space(s);
  121|  2.00k|    res->type = OSSL_PROPERTY_TYPE_NUMBER;
  122|  2.00k|    res->v.int_val = v;
  123|  2.00k|    return 1;
  124|  2.78k|}
property_parse.c:parse_hex:
  127|  4.86k|{
  128|  4.86k|    const char *s = *t;
  129|  4.86k|    int64_t v = 0;
  130|  4.86k|    int sval;
  131|       |
  132|  54.6k|    do {
  133|  54.6k|        if (ossl_isdigit(*s)) {
  ------------------
  |  Branch (133:13): [True: 40.5k, False: 14.1k]
  ------------------
  134|  40.5k|            sval = *s - '0';
  135|  40.5k|        } else if (ossl_isxdigit(*s)) {
  ------------------
  |  |   83|  14.1k|#define ossl_isxdigit(c) (ossl_ctype_check((c), CTYPE_MASK_xdigit))
  |  |  ------------------
  |  |  |  |   31|  14.1k|#define CTYPE_MASK_xdigit 0x10
  |  |  ------------------
  |  |  |  Branch (83:26): [True: 14.1k, False: 41]
  |  |  ------------------
  ------------------
  136|  14.1k|            sval = ossl_tolower(*s) - 'a' + 10;
  137|  14.1k|        } else {
  138|     41|            ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_HEXADECIMAL_DIGIT,
  ------------------
  |  |  406|     41|    (ERR_new(),                                                  \
  |  |  407|     41|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|     41|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|     41|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_HEXADECIMAL_DIGIT,
  ------------------
  |  |  118|     41|#define ERR_LIB_PROP 55
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_HEXADECIMAL_DIGIT,
  ------------------
  |  |   29|     41|#define PROP_R_NOT_AN_HEXADECIMAL_DIGIT 102
  ------------------
  139|     41|                "%s", *t);
  140|     41|            return 0;
  141|     41|        }
  142|       |
  143|  54.6k|        if (v > ((INT64_MAX - sval) / 16)) {
  ------------------
  |  Branch (143:13): [True: 2.58k, False: 52.0k]
  ------------------
  144|  2.58k|            ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  406|  2.58k|    (ERR_new(),                                                  \
  |  |  407|  2.58k|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|  2.58k|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|  2.58k|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  118|  2.58k|#define ERR_LIB_PROP 55
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |   35|  2.58k|#define PROP_R_PARSE_FAILED 108
  ------------------
  145|  2.58k|                "Property %s overflows", *t);
  146|  2.58k|            return 0;
  147|  2.58k|        }
  148|       |
  149|  52.0k|        v <<= 4;
  150|  52.0k|        v += sval;
  151|  52.0k|    } while (ossl_isxdigit(*++s));
  ------------------
  |  |   83|  52.0k|#define ossl_isxdigit(c) (ossl_ctype_check((c), CTYPE_MASK_xdigit))
  |  |  ------------------
  |  |  |  |   31|  52.0k|#define CTYPE_MASK_xdigit 0x10
  |  |  ------------------
  |  |  |  Branch (83:26): [True: 49.8k, False: 2.23k]
  |  |  ------------------
  ------------------
  152|  2.23k|    if (!ossl_isspace(*s) && *s != '\0' && *s != ',') {
  ------------------
  |  |   82|  4.47k|#define ossl_isspace(c) (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  2.23k|#define CTYPE_MASK_space 0x8
  |  |  ------------------
  ------------------
  |  Branch (152:9): [True: 1.80k, False: 438]
  |  Branch (152:30): [True: 910, False: 890]
  |  Branch (152:44): [True: 164, False: 746]
  ------------------
  153|    164|        ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_HEXADECIMAL_DIGIT,
  ------------------
  |  |  406|    164|    (ERR_new(),                                                  \
  |  |  407|    164|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|    164|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|    164|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_HEXADECIMAL_DIGIT,
  ------------------
  |  |  118|    164|#define ERR_LIB_PROP 55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_HEXADECIMAL_DIGIT,
  ------------------
  |  |   29|    164|#define PROP_R_NOT_AN_HEXADECIMAL_DIGIT 102
  ------------------
  154|    164|            "HERE-->%s", *t);
  155|    164|        return 0;
  156|    164|    }
  157|  2.07k|    *t = skip_space(s);
  158|  2.07k|    res->type = OSSL_PROPERTY_TYPE_NUMBER;
  159|  2.07k|    res->v.int_val = v;
  160|  2.07k|    return 1;
  161|  2.23k|}
property_parse.c:parse_oct:
  164|  3.94k|{
  165|  3.94k|    const char *s = *t;
  166|  3.94k|    int64_t v = 0;
  167|       |
  168|  77.9k|    do {
  169|  77.9k|        if (*s == '9' || *s == '8' || !ossl_isdigit(*s)) {
  ------------------
  |  Branch (169:13): [True: 41, False: 77.9k]
  |  Branch (169:26): [True: 41, False: 77.9k]
  |  Branch (169:39): [True: 0, False: 77.9k]
  ------------------
  170|     82|            ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_OCTAL_DIGIT,
  ------------------
  |  |  406|     82|    (ERR_new(),                                                  \
  |  |  407|     82|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|     82|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|     82|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_OCTAL_DIGIT,
  ------------------
  |  |  118|     82|#define ERR_LIB_PROP 55
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_OCTAL_DIGIT,
  ------------------
  |  |   31|     82|#define PROP_R_NOT_AN_OCTAL_DIGIT 104
  ------------------
  171|     82|                "HERE-->%s", *t);
  172|     82|            return 0;
  173|     82|        }
  174|  77.9k|        if (v > ((INT64_MAX - (*s - '0')) / 8)) {
  ------------------
  |  Branch (174:13): [True: 2.41k, False: 75.4k]
  ------------------
  175|  2.41k|            ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  406|  2.41k|    (ERR_new(),                                                  \
  |  |  407|  2.41k|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|  2.41k|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|  2.41k|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  118|  2.41k|#define ERR_LIB_PROP 55
  ------------------
                          ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |   35|  2.41k|#define PROP_R_PARSE_FAILED 108
  ------------------
  176|  2.41k|                "Property %s overflows", *t);
  177|  2.41k|            return 0;
  178|  2.41k|        }
  179|       |
  180|  75.4k|        v = (v << 3) + (*s - '0');
  181|  75.4k|    } while (ossl_isdigit(*++s) && *s != '9' && *s != '8');
  ------------------
  |  Branch (181:14): [True: 74.2k, False: 1.27k]
  |  Branch (181:36): [True: 74.0k, False: 123]
  |  Branch (181:49): [True: 74.0k, False: 41]
  ------------------
  182|  1.44k|    if (!ossl_isspace(*s) && *s != '\0' && *s != ',') {
  ------------------
  |  |   82|  2.88k|#define ossl_isspace(c) (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  1.44k|#define CTYPE_MASK_space 0x8
  |  |  ------------------
  ------------------
  |  Branch (182:9): [True: 978, False: 465]
  |  Branch (182:30): [True: 622, False: 356]
  |  Branch (182:44): [True: 492, False: 130]
  ------------------
  183|    492|        ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_OCTAL_DIGIT,
  ------------------
  |  |  406|    492|    (ERR_new(),                                                  \
  |  |  407|    492|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|    492|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|    492|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_OCTAL_DIGIT,
  ------------------
  |  |  118|    492|#define ERR_LIB_PROP 55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_OCTAL_DIGIT,
  ------------------
  |  |   31|    492|#define PROP_R_NOT_AN_OCTAL_DIGIT 104
  ------------------
  184|    492|            "HERE-->%s", *t);
  185|    492|        return 0;
  186|    492|    }
  187|    951|    *t = skip_space(s);
  188|    951|    res->type = OSSL_PROPERTY_TYPE_NUMBER;
  189|    951|    res->v.int_val = v;
  190|    951|    return 1;
  191|  1.44k|}
property_parse.c:parse_unquoted:
  226|  32.2k|{
  227|  32.2k|    char v[1000];
  228|  32.2k|    const char *s = *t;
  229|  32.2k|    size_t i = 0;
  230|  32.2k|    int err = 0;
  231|       |
  232|  32.2k|    if (*s == '\0' || *s == ',')
  ------------------
  |  Branch (232:9): [True: 0, False: 32.2k]
  |  Branch (232:23): [True: 0, False: 32.2k]
  ------------------
  233|      0|        return 0;
  234|   596k|    while (ossl_isprint(*s) && !ossl_isspace(*s) && *s != ',') {
  ------------------
  |  |   80|  1.19M|#define ossl_isprint(c) (ossl_ctype_check((c), CTYPE_MASK_print))
  |  |  ------------------
  |  |  |  |   35|   596k|#define CTYPE_MASK_print 0x100
  |  |  ------------------
  |  |  |  Branch (80:25): [True: 591k, False: 4.45k]
  |  |  ------------------
  ------------------
                  while (ossl_isprint(*s) && !ossl_isspace(*s) && *s != ',') {
  ------------------
  |  |   82|  1.18M|#define ossl_isspace(c) (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|   591k|#define CTYPE_MASK_space 0x8
  |  |  ------------------
  ------------------
  |  Branch (234:32): [True: 591k, False: 342]
  |  Branch (234:53): [True: 563k, False: 27.4k]
  ------------------
  235|   563k|        if (i < sizeof(v) - 1)
  ------------------
  |  Branch (235:13): [True: 559k, False: 3.97k]
  ------------------
  236|   559k|            v[i++] = ossl_tolower(*s);
  237|  3.97k|        else
  238|  3.97k|            err = 1;
  239|   563k|        s++;
  240|   563k|    }
  241|  32.2k|    if (!ossl_isspace(*s) && *s != '\0' && *s != ',') {
  ------------------
  |  |   82|  64.5k|#define ossl_isspace(c) (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  32.2k|#define CTYPE_MASK_space 0x8
  |  |  ------------------
  ------------------
  |  Branch (241:9): [True: 30.8k, False: 1.45k]
  |  Branch (241:30): [True: 28.1k, False: 2.69k]
  |  Branch (241:44): [True: 656, False: 27.4k]
  ------------------
  242|    656|        ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_ASCII_CHARACTER,
  ------------------
  |  |  406|    656|    (ERR_new(),                                                  \
  |  |  407|    656|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|    656|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|    656|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_ASCII_CHARACTER,
  ------------------
  |  |  118|    656|#define ERR_LIB_PROP 55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_NOT_AN_ASCII_CHARACTER,
  ------------------
  |  |   28|    656|#define PROP_R_NOT_AN_ASCII_CHARACTER 101
  ------------------
  243|    656|            "HERE-->%s", s);
  244|    656|        return 0;
  245|    656|    }
  246|  31.5k|    v[i] = 0;
  247|  31.5k|    if (err)
  ------------------
  |  Branch (247:9): [True: 178, False: 31.4k]
  ------------------
  248|    178|        ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  406|    178|    (ERR_new(),                                                  \
  |  |  407|    178|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|    178|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|    178|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |  118|    178|#define ERR_LIB_PROP 55
  ------------------
                      ERR_raise_data(ERR_LIB_PROP, PROP_R_STRING_TOO_LONG, "HERE-->%s", *t);
  ------------------
  |  |   36|    178|#define PROP_R_STRING_TOO_LONG 109
  ------------------
  249|  31.4k|    else if ((res->v.str_val = ossl_property_value(ctx, v, create)) == 0)
  ------------------
  |  Branch (249:14): [True: 29.7k, False: 1.68k]
  ------------------
  250|  29.7k|        err = 1;
  251|  31.5k|    *t = skip_space(s);
  252|  31.5k|    res->type = OSSL_PROPERTY_TYPE_STRING;
  253|  31.5k|    return !err;
  254|  32.2k|}
property_parse.c:stack_to_property_list:
  314|  17.7k|{
  315|  17.7k|    const int n = sk_OSSL_PROPERTY_DEFINITION_num(sk);
  316|  17.7k|    OSSL_PROPERTY_LIST *r;
  317|  17.7k|    OSSL_PROPERTY_IDX prev_name_idx = 0;
  318|  17.7k|    int i;
  319|       |
  320|  17.7k|    r = OPENSSL_malloc(sizeof(*r)
  ------------------
  |  |  106|  35.4k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (106:19): [True: 6.23k, False: 11.5k]
  |  |  ------------------
  ------------------
  321|  17.7k|        + (n <= 0 ? 0 : n - 1) * sizeof(r->properties[0]));
  322|  17.7k|    if (r != NULL) {
  ------------------
  |  Branch (322:9): [True: 17.7k, False: 0]
  ------------------
  323|  17.7k|        sk_OSSL_PROPERTY_DEFINITION_sort(sk);
  324|       |
  325|  17.7k|        r->has_optional = 0;
  326|  39.1k|        for (i = 0; i < n; i++) {
  ------------------
  |  Branch (326:21): [True: 23.6k, False: 15.4k]
  ------------------
  327|  23.6k|            r->properties[i] = *sk_OSSL_PROPERTY_DEFINITION_value(sk, i);
  328|  23.6k|            r->has_optional |= r->properties[i].optional;
  329|       |
  330|       |            /* Check for duplicated names */
  331|  23.6k|            if (i > 0 && r->properties[i].name_idx == prev_name_idx) {
  ------------------
  |  Branch (331:17): [True: 12.1k, False: 11.5k]
  |  Branch (331:26): [True: 2.25k, False: 9.87k]
  ------------------
  332|  2.25k|                OPENSSL_free(r);
  ------------------
  |  |  131|  2.25k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  333|  2.25k|                ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  406|  2.25k|    (ERR_new(),                                                  \
  |  |  407|  2.25k|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|  2.25k|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|  2.25k|        ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |  118|  2.25k|#define ERR_LIB_PROP 55
  ------------------
                              ERR_raise_data(ERR_LIB_PROP, PROP_R_PARSE_FAILED,
  ------------------
  |  |   35|  2.25k|#define PROP_R_PARSE_FAILED 108
  ------------------
  334|  2.25k|                    "Duplicated name `%s'",
  335|  2.25k|                    ossl_property_name_str(ctx, prev_name_idx));
  336|  2.25k|                return NULL;
  337|  2.25k|            }
  338|  21.3k|            prev_name_idx = r->properties[i].name_idx;
  339|  21.3k|        }
  340|  15.4k|        r->num_properties = n;
  341|  15.4k|    }
  342|  15.4k|    return r;
  343|  17.7k|}
property_parse.c:pd_free:
  301|   241k|{
  302|   241k|    OPENSSL_free(pd);
  ------------------
  |  |  131|   241k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  303|   241k|}
property_parse.c:match:
   46|   186k|{
   47|   186k|    const char *s = *t;
   48|       |
   49|   186k|    if (OPENSSL_strncasecmp(s, m, m_len) == 0) {
  ------------------
  |  Branch (49:9): [True: 4.02k, False: 182k]
  ------------------
   50|  4.02k|        *t = skip_space(s + m_len);
   51|  4.02k|        return 1;
   52|  4.02k|    }
   53|   182k|    return 0;
   54|   186k|}

ossl_property_find_property:
   25|     34|{
   26|     34|    OSSL_PROPERTY_IDX name_idx;
   27|       |
   28|     34|    if (list == NULL || name == NULL
  ------------------
  |  Branch (28:9): [True: 0, False: 34]
  |  Branch (28:25): [True: 0, False: 34]
  ------------------
   29|     34|        || (name_idx = ossl_property_name(libctx, name, 0)) == 0)
  ------------------
  |  Branch (29:12): [True: 0, False: 34]
  ------------------
   30|      0|        return NULL;
   31|       |
   32|     34|    return ossl_bsearch(&name_idx, list->properties, list->num_properties,
   33|     34|        sizeof(*list->properties), &property_idx_cmp, 0);
   34|     34|}
ossl_property_get_string_value:
   43|     26|{
   44|     26|    const char *value = NULL;
   45|       |
   46|     26|    if (prop != NULL && prop->type == OSSL_PROPERTY_TYPE_STRING)
  ------------------
  |  Branch (46:9): [True: 26, False: 0]
  |  Branch (46:25): [True: 26, False: 0]
  ------------------
   47|     26|        value = ossl_property_value_str(libctx, prop->v.str_val);
   48|     26|    return value;
   49|     26|}
ossl_property_has_optional:
   62|  14.2k|{
   63|  14.2k|    return query->has_optional ? 1 : 0;
  ------------------
  |  Branch (63:12): [True: 650, False: 13.5k]
  ------------------
   64|  14.2k|}
property_query.c:property_idx_cmp:
   15|     59|{
   16|     59|    OSSL_PROPERTY_IDX key = *(const OSSL_PROPERTY_IDX *)keyp;
   17|     59|    const OSSL_PROPERTY_DEFINITION *defn = (const OSSL_PROPERTY_DEFINITION *)compare;
   18|       |
   19|     59|    return key - defn->name_idx;
   20|     59|}

ossl_property_string_data_free:
   77|    787|{
   78|    787|    PROPERTY_STRING_DATA *propdata = vpropdata;
   79|       |
   80|    787|    if (propdata == NULL)
  ------------------
  |  Branch (80:9): [True: 0, False: 787]
  ------------------
   81|      0|        return;
   82|       |
   83|    787|    CRYPTO_THREAD_lock_free(propdata->lock);
   84|    787|    property_table_free(&propdata->prop_names);
   85|    787|    property_table_free(&propdata->prop_values);
   86|    787|#ifndef OPENSSL_SMALL_FOOTPRINT
   87|    787|    sk_OPENSSL_CSTRING_free(propdata->prop_namelist);
  ------------------
  |  |  264|    787|#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))
  ------------------
   88|    787|    sk_OPENSSL_CSTRING_free(propdata->prop_valuelist);
  ------------------
  |  |  264|    787|#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))
  ------------------
   89|    787|    propdata->prop_namelist = propdata->prop_valuelist = NULL;
   90|    787|#endif
   91|    787|    propdata->prop_name_idx = propdata->prop_value_idx = 0;
   92|       |
   93|    787|    OPENSSL_free(propdata);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|    787|}
ossl_property_string_data_new:
   97|    787|{
   98|    787|    PROPERTY_STRING_DATA *propdata = OPENSSL_zalloc(sizeof(*propdata));
  ------------------
  |  |  108|    787|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   99|       |
  100|    787|    if (propdata == NULL)
  ------------------
  |  Branch (100:9): [True: 0, False: 787]
  ------------------
  101|      0|        return NULL;
  102|       |
  103|    787|    propdata->lock = CRYPTO_THREAD_lock_new();
  104|    787|    propdata->prop_names = lh_PROPERTY_STRING_new(&property_hash,
  105|    787|        &property_cmp);
  106|    787|    propdata->prop_values = lh_PROPERTY_STRING_new(&property_hash,
  107|    787|        &property_cmp);
  108|    787|#ifndef OPENSSL_SMALL_FOOTPRINT
  109|    787|    propdata->prop_namelist = sk_OPENSSL_CSTRING_new_null();
  ------------------
  |  |  261|    787|#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
  ------------------
  110|    787|    propdata->prop_valuelist = sk_OPENSSL_CSTRING_new_null();
  ------------------
  |  |  261|    787|#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
  ------------------
  111|    787|#endif
  112|    787|    if (propdata->lock == NULL
  ------------------
  |  Branch (112:9): [True: 0, False: 787]
  ------------------
  113|    787|#ifndef OPENSSL_SMALL_FOOTPRINT
  114|    787|        || propdata->prop_namelist == NULL
  ------------------
  |  Branch (114:12): [True: 0, False: 787]
  ------------------
  115|    787|        || propdata->prop_valuelist == NULL
  ------------------
  |  Branch (115:12): [True: 0, False: 787]
  ------------------
  116|    787|#endif
  117|    787|        || propdata->prop_names == NULL
  ------------------
  |  Branch (117:12): [True: 0, False: 787]
  ------------------
  118|    787|        || propdata->prop_values == NULL) {
  ------------------
  |  Branch (118:12): [True: 0, False: 787]
  ------------------
  119|      0|        ossl_property_string_data_free(propdata);
  120|      0|        return NULL;
  121|      0|    }
  122|    787|    return propdata;
  123|    787|}
ossl_property_name:
  255|   246k|{
  256|   246k|    return ossl_property_string(ctx, 1, create, s);
  257|   246k|}
ossl_property_name_str:
  260|  2.25k|{
  261|  2.25k|    return ossl_property_str(1, ctx, idx);
  262|  2.25k|}
ossl_property_value:
  266|  33.4k|{
  267|  33.4k|    return ossl_property_string(ctx, 0, create, s);
  268|  33.4k|}
ossl_property_value_str:
  271|     26|{
  272|     26|    return ossl_property_str(0, ctx, idx);
  273|     26|}
property_string.c:property_table_free:
   66|  1.57k|{
   67|  1.57k|    PROP_TABLE *t = *pt;
   68|       |
   69|  1.57k|    if (t != NULL) {
  ------------------
  |  Branch (69:9): [True: 1.57k, False: 0]
  ------------------
   70|  1.57k|        lh_PROPERTY_STRING_doall(t, &property_free);
   71|  1.57k|        lh_PROPERTY_STRING_free(t);
   72|       |        *pt = NULL;
   73|  1.57k|    }
   74|  1.57k|}
property_string.c:property_free:
   61|  8.87k|{
   62|  8.87k|    OPENSSL_free(ps);
  ------------------
  |  |  131|  8.87k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   63|  8.87k|}
property_string.c:property_hash:
   51|   297k|{
   52|   297k|    return OPENSSL_LH_strhash(a->s);
   53|   297k|}
property_string.c:property_cmp:
   56|  95.4k|{
   57|  95.4k|    return strcmp(a->s, b->s);
   58|  95.4k|}
property_string.c:ossl_property_string:
  145|   279k|{
  146|   279k|    PROPERTY_STRING p, *ps, *ps_new;
  147|   279k|    PROP_TABLE *t;
  148|   279k|    OSSL_PROPERTY_IDX *pidx;
  149|   279k|    PROPERTY_STRING_DATA *propdata
  150|   279k|        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX);
  ------------------
  |  |   99|   279k|#define OSSL_LIB_CTX_PROPERTY_STRING_INDEX 3
  ------------------
  151|       |
  152|   279k|    if (propdata == NULL)
  ------------------
  |  Branch (152:9): [True: 0, False: 279k]
  ------------------
  153|      0|        return 0;
  154|       |
  155|   279k|    t = name ? propdata->prop_names : propdata->prop_values;
  ------------------
  |  Branch (155:9): [True: 246k, False: 33.4k]
  ------------------
  156|   279k|    p.s = s;
  157|   279k|    if (!CRYPTO_THREAD_read_lock(propdata->lock)) {
  ------------------
  |  Branch (157:9): [True: 0, False: 279k]
  ------------------
  158|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  159|      0|        return 0;
  160|      0|    }
  161|   279k|    ps = lh_PROPERTY_STRING_retrieve(t, &p);
  162|   279k|    if (ps == NULL && create) {
  ------------------
  |  Branch (162:9): [True: 184k, False: 95.4k]
  |  Branch (162:23): [True: 8.87k, False: 175k]
  ------------------
  163|  8.87k|        CRYPTO_THREAD_unlock(propdata->lock);
  164|  8.87k|        if (!CRYPTO_THREAD_write_lock(propdata->lock)) {
  ------------------
  |  Branch (164:13): [True: 0, False: 8.87k]
  ------------------
  165|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_UNABLE_TO_GET_WRITE_LOCK);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  166|      0|            return 0;
  167|      0|        }
  168|  8.87k|        pidx = name ? &propdata->prop_name_idx : &propdata->prop_value_idx;
  ------------------
  |  Branch (168:16): [True: 6.12k, False: 2.74k]
  ------------------
  169|  8.87k|        ps = lh_PROPERTY_STRING_retrieve(t, &p);
  170|  8.87k|        if (ps == NULL && (ps_new = new_property_string(s, pidx)) != NULL) {
  ------------------
  |  Branch (170:13): [True: 8.87k, False: 0]
  |  Branch (170:27): [True: 8.87k, False: 0]
  ------------------
  171|  8.87k|#ifndef OPENSSL_SMALL_FOOTPRINT
  172|  8.87k|            STACK_OF(OPENSSL_CSTRING) *slist;
  ------------------
  |  |   33|  8.87k|#define STACK_OF(type) struct stack_st_##type
  ------------------
  173|       |
  174|  8.87k|            slist = name ? propdata->prop_namelist : propdata->prop_valuelist;
  ------------------
  |  Branch (174:21): [True: 6.12k, False: 2.74k]
  ------------------
  175|  8.87k|            if (sk_OPENSSL_CSTRING_push(slist, ps_new->s) <= 0) {
  ------------------
  |  |  268|  8.87k|#define sk_OPENSSL_CSTRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_OPENSSL_CSTRING_sk_type(sk), ossl_check_OPENSSL_CSTRING_type(ptr))
  ------------------
  |  Branch (175:17): [True: 0, False: 8.87k]
  ------------------
  176|      0|                property_free(ps_new);
  177|      0|                CRYPTO_THREAD_unlock(propdata->lock);
  178|      0|                return 0;
  179|      0|            }
  180|  8.87k|#endif
  181|  8.87k|            lh_PROPERTY_STRING_insert(t, ps_new);
  182|  8.87k|            if (lh_PROPERTY_STRING_error(t)) {
  ------------------
  |  Branch (182:17): [True: 0, False: 8.87k]
  ------------------
  183|       |                /*-
  184|       |                 * Undo the previous push which means also decrementing the
  185|       |                 * index and freeing the allocated storage.
  186|       |                 */
  187|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  188|      0|                sk_OPENSSL_CSTRING_pop(slist);
  ------------------
  |  |  270|      0|#define sk_OPENSSL_CSTRING_pop(sk) ((const char *)OPENSSL_sk_pop(ossl_check_OPENSSL_CSTRING_sk_type(sk)))
  ------------------
  189|      0|#endif
  190|      0|                property_free(ps_new);
  191|      0|                --*pidx;
  192|      0|                CRYPTO_THREAD_unlock(propdata->lock);
  193|      0|                return 0;
  194|      0|            }
  195|  8.87k|            ps = ps_new;
  196|  8.87k|        }
  197|  8.87k|    }
  198|   279k|    CRYPTO_THREAD_unlock(propdata->lock);
  199|   279k|    return ps != NULL ? ps->idx : 0;
  ------------------
  |  Branch (199:12): [True: 104k, False: 175k]
  ------------------
  200|   279k|}
property_string.c:new_property_string:
  127|  8.87k|{
  128|  8.87k|    const size_t l = strlen(s);
  129|  8.87k|    PROPERTY_STRING *ps = OPENSSL_malloc(sizeof(*ps) + l);
  ------------------
  |  |  106|  8.87k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  130|       |
  131|  8.87k|    if (ps != NULL) {
  ------------------
  |  Branch (131:9): [True: 8.87k, False: 0]
  ------------------
  132|  8.87k|        memcpy(ps->body, s, l + 1);
  133|  8.87k|        ps->s = ps->body;
  134|  8.87k|        ps->idx = ++*pidx;
  135|  8.87k|        if (ps->idx == 0) {
  ------------------
  |  Branch (135:13): [True: 0, False: 8.87k]
  ------------------
  136|      0|            OPENSSL_free(ps);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|      0|            return NULL;
  138|      0|        }
  139|  8.87k|    }
  140|  8.87k|    return ps;
  141|  8.87k|}
property_string.c:ossl_property_str:
  219|  2.28k|{
  220|  2.28k|    const char *r;
  221|  2.28k|    PROPERTY_STRING_DATA *propdata
  222|  2.28k|        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX);
  ------------------
  |  |   99|  2.28k|#define OSSL_LIB_CTX_PROPERTY_STRING_INDEX 3
  ------------------
  223|       |
  224|  2.28k|    if (propdata == NULL)
  ------------------
  |  Branch (224:9): [True: 0, False: 2.28k]
  ------------------
  225|      0|        return NULL;
  226|       |
  227|  2.28k|    if (!CRYPTO_THREAD_read_lock(propdata->lock)) {
  ------------------
  |  Branch (227:9): [True: 0, False: 2.28k]
  ------------------
  228|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  229|      0|        return NULL;
  230|      0|    }
  231|       |#ifdef OPENSSL_SMALL_FOOTPRINT
  232|       |    {
  233|       |        struct find_str_st findstr;
  234|       |
  235|       |        findstr.str = NULL;
  236|       |        findstr.idx = idx;
  237|       |
  238|       |        lh_PROPERTY_STRING_doall_arg(name ? propdata->prop_names
  239|       |                                          : propdata->prop_values,
  240|       |            find_str_fn, &findstr);
  241|       |        r = findstr.str;
  242|       |    }
  243|       |#else
  244|  2.28k|    r = sk_OPENSSL_CSTRING_value(name ? propdata->prop_namelist
  ------------------
  |  |  259|  4.56k|#define sk_OPENSSL_CSTRING_value(sk, idx) ((const char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_CSTRING_sk_type(sk), (idx)))
  |  |  ------------------
  |  |  |  Branch (259:116): [True: 2.25k, False: 26]
  |  |  ------------------
  ------------------
  245|  2.28k|                                      : propdata->prop_valuelist,
  246|  2.28k|        idx - 1);
  247|  2.28k|#endif
  248|  2.28k|    CRYPTO_THREAD_unlock(propdata->lock);
  249|       |
  250|  2.28k|    return r;
  251|  2.28k|}

OSSL_PROVIDER_try_load_ex:
   20|  1.38k|{
   21|  1.38k|    OSSL_PROVIDER *prov = NULL, *actual;
   22|  1.38k|    int isnew = 0;
   23|       |
   24|       |    /* Find it or create it */
   25|  1.38k|    if ((prov = ossl_provider_find(libctx, name, 0)) == NULL) {
  ------------------
  |  Branch (25:9): [True: 784, False: 605]
  ------------------
   26|    784|        if ((prov = ossl_provider_new(libctx, name, NULL, params, 0)) == NULL)
  ------------------
  |  Branch (26:13): [True: 0, False: 784]
  ------------------
   27|      0|            return NULL;
   28|    784|        isnew = 1;
   29|    784|    }
   30|       |
   31|  1.38k|    if (!ossl_provider_activate(prov, 1, 0)) {
  ------------------
  |  Branch (31:9): [True: 135, False: 1.25k]
  ------------------
   32|    135|        ossl_provider_free(prov);
   33|    135|        return NULL;
   34|    135|    }
   35|       |
   36|  1.25k|    actual = prov;
   37|  1.25k|    if (isnew && !ossl_provider_add_to_store(prov, &actual, retain_fallbacks)) {
  ------------------
  |  Branch (37:9): [True: 649, False: 605]
  |  Branch (37:18): [True: 0, False: 649]
  ------------------
   38|      0|        ossl_provider_deactivate(prov, 1);
   39|      0|        ossl_provider_free(prov);
   40|      0|        return NULL;
   41|      0|    }
   42|  1.25k|    if (actual != prov) {
  ------------------
  |  Branch (42:9): [True: 0, False: 1.25k]
  ------------------
   43|      0|        if (!ossl_provider_activate(actual, 1, 0)) {
  ------------------
  |  Branch (43:13): [True: 0, False: 0]
  ------------------
   44|      0|            ossl_provider_free(actual);
   45|      0|            return NULL;
   46|      0|        }
   47|      0|    }
   48|       |
   49|  1.25k|    return actual;
   50|  1.25k|}
OSSL_PROVIDER_try_load:
   54|  1.38k|{
   55|       |    return OSSL_PROVIDER_try_load_ex(libctx, name, NULL, retain_fallbacks);
   56|  1.38k|}
OSSL_PROVIDER_unload:
   72|  1.25k|{
   73|  1.25k|    if (!ossl_provider_deactivate(prov, 1))
  ------------------
  |  Branch (73:9): [True: 0, False: 1.25k]
  ------------------
   74|      0|        return 0;
   75|  1.25k|    ossl_provider_free(prov);
   76|  1.25k|    return 1;
   77|  1.25k|}
OSSL_PROVIDER_get0_provider_ctx:
  104|  2.36M|{
  105|  2.36M|    return ossl_provider_ctx(prov);
  106|  2.36M|}
OSSL_PROVIDER_get_capabilities:
  122|  6.37k|{
  123|  6.37k|    return ossl_provider_get_capabilities(prov, capability, cb, arg);
  124|  6.37k|}
OSSL_PROVIDER_do_all:
  156|  5.12k|{
  157|  5.12k|    return ossl_provider_doall_activated(ctx, cb, cbdata);
  158|  5.12k|}

ossl_child_prov_ctx_new:
   38|    787|{
   39|    787|    return OPENSSL_zalloc(sizeof(struct child_prov_globals));
  ------------------
  |  |  108|    787|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|    787|}
ossl_child_prov_ctx_free:
   43|    787|{
   44|    787|    struct child_prov_globals *gbl = vgbl;
   45|       |
   46|    787|    CRYPTO_THREAD_lock_free(gbl->lock);
   47|    787|    OPENSSL_free(gbl);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|    787|}

ossl_prov_conf_ctx_new:
   31|    787|{
   32|    787|    PROVIDER_CONF_GLOBAL *pcgbl = OPENSSL_zalloc(sizeof(*pcgbl));
  ------------------
  |  |  108|    787|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|       |
   34|    787|    if (pcgbl == NULL)
  ------------------
  |  Branch (34:9): [True: 0, False: 787]
  ------------------
   35|      0|        return NULL;
   36|       |
   37|    787|    pcgbl->lock = CRYPTO_THREAD_lock_new();
   38|    787|    if (pcgbl->lock == NULL) {
  ------------------
  |  Branch (38:9): [True: 0, False: 787]
  ------------------
   39|      0|        OPENSSL_free(pcgbl);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|      0|        return NULL;
   41|      0|    }
   42|       |
   43|    787|    return pcgbl;
   44|    787|}
ossl_prov_conf_ctx_free:
   47|    787|{
   48|    787|    PROVIDER_CONF_GLOBAL *pcgbl = vpcgbl;
   49|       |
   50|    787|    sk_OSSL_PROVIDER_pop_free(pcgbl->activated_providers,
   51|    787|        ossl_provider_free);
   52|       |
   53|    787|    OSSL_TRACE(CONF, "Cleaned up providers\n");
  ------------------
  |  |  290|    787|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|    787|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   54|    787|    CRYPTO_THREAD_lock_free(pcgbl->lock);
   55|    787|    OPENSSL_free(pcgbl);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   56|    787|}

ossl_provider_store_free:
  288|    787|{
  289|    787|    struct provider_store_st *store = vstore;
  290|    787|    size_t i;
  291|       |
  292|    787|    if (store == NULL)
  ------------------
  |  Branch (292:9): [True: 0, False: 787]
  ------------------
  293|      0|        return;
  294|    787|    store->freeing = 1;
  295|    787|    OPENSSL_free(store->default_path);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  296|    787|    sk_OSSL_PROVIDER_pop_free(store->providers, provider_deactivate_free);
  297|    787|#ifndef FIPS_MODULE
  298|    787|    sk_OSSL_PROVIDER_CHILD_CB_pop_free(store->child_cbs,
  299|    787|        ossl_provider_child_cb_free);
  300|    787|#endif
  301|    787|    CRYPTO_THREAD_lock_free(store->default_path_lock);
  302|    787|    CRYPTO_THREAD_lock_free(store->lock);
  303|    787|    for (i = 0; i < store->numprovinfo; i++)
  ------------------
  |  Branch (303:17): [True: 0, False: 787]
  ------------------
  304|      0|        ossl_provider_info_clear(&store->provinfo[i]);
  305|    787|    OPENSSL_free(store->provinfo);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  306|    787|    OPENSSL_free(store);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  307|    787|}
ossl_provider_store_new:
  310|    787|{
  311|    787|    struct provider_store_st *store = OPENSSL_zalloc(sizeof(*store));
  ------------------
  |  |  108|    787|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  312|       |
  313|    787|    if (store == NULL
  ------------------
  |  Branch (313:9): [True: 0, False: 787]
  ------------------
  314|    787|        || (store->providers = sk_OSSL_PROVIDER_new(ossl_provider_cmp)) == NULL
  ------------------
  |  Branch (314:12): [True: 0, False: 787]
  ------------------
  315|    787|        || (store->default_path_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (315:12): [True: 0, False: 787]
  ------------------
  316|    787|#ifndef FIPS_MODULE
  317|    787|        || (store->child_cbs = sk_OSSL_PROVIDER_CHILD_CB_new_null()) == NULL
  ------------------
  |  Branch (317:12): [True: 0, False: 787]
  ------------------
  318|    787|#endif
  319|    787|        || (store->lock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (319:12): [True: 0, False: 787]
  ------------------
  320|      0|        ossl_provider_store_free(store);
  321|      0|        return NULL;
  322|      0|    }
  323|    787|    store->libctx = ctx;
  324|    787|    store->use_fallbacks = 1;
  325|       |
  326|    787|    return store;
  327|    787|}
ossl_provider_find:
  401|  3.82k|{
  402|  3.82k|    struct provider_store_st *store = NULL;
  403|  3.82k|    OSSL_PROVIDER *prov = NULL;
  404|       |
  405|  3.82k|    if ((store = get_provider_store(libctx)) != NULL) {
  ------------------
  |  Branch (405:9): [True: 3.82k, False: 0]
  ------------------
  406|  3.82k|        OSSL_PROVIDER tmpl = {
  407|  3.82k|            0,
  408|  3.82k|        };
  409|  3.82k|        int i;
  410|       |
  411|  3.82k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  412|       |        /*
  413|       |         * Make sure any providers are loaded from config before we try to find
  414|       |         * them.
  415|       |         */
  416|  3.82k|        if (!noconfig) {
  ------------------
  |  Branch (416:13): [True: 2.17k, False: 1.64k]
  ------------------
  417|  2.17k|            if (ossl_lib_ctx_is_default(libctx))
  ------------------
  |  Branch (417:17): [True: 0, False: 2.17k]
  ------------------
  418|      0|                OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  510|      0|#define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
  ------------------
  419|  2.17k|        }
  420|  3.82k|#endif
  421|       |
  422|  3.82k|        tmpl.name = (char *)name;
  423|  3.82k|        if (!CRYPTO_THREAD_write_lock(store->lock))
  ------------------
  |  Branch (423:13): [True: 0, False: 3.82k]
  ------------------
  424|      0|            return NULL;
  425|  3.82k|        sk_OSSL_PROVIDER_sort(store->providers);
  426|  3.82k|        if ((i = sk_OSSL_PROVIDER_find(store->providers, &tmpl)) != -1)
  ------------------
  |  Branch (426:13): [True: 2.27k, False: 1.54k]
  ------------------
  427|  2.27k|            prov = sk_OSSL_PROVIDER_value(store->providers, i);
  428|  3.82k|        CRYPTO_THREAD_unlock(store->lock);
  429|  3.82k|        if (prov != NULL && !ossl_provider_up_ref(prov))
  ------------------
  |  Branch (429:13): [True: 2.27k, False: 1.54k]
  |  Branch (429:29): [True: 0, False: 2.27k]
  ------------------
  430|      0|            prov = NULL;
  431|  3.82k|    }
  432|       |
  433|  3.82k|    return prov;
  434|  3.82k|}
ossl_provider_up_ref:
  480|   172k|{
  481|   172k|    int ref = 0;
  482|       |
  483|   172k|    if (CRYPTO_UP_REF(&prov->refcnt, &ref) <= 0)
  ------------------
  |  Branch (483:9): [True: 0, False: 172k]
  ------------------
  484|      0|        return 0;
  485|       |
  486|   172k|#ifndef FIPS_MODULE
  487|   172k|    if (prov->ischild) {
  ------------------
  |  Branch (487:9): [True: 0, False: 172k]
  ------------------
  488|      0|        if (!ossl_provider_up_ref_parent(prov, 0)) {
  ------------------
  |  Branch (488:13): [True: 0, False: 0]
  ------------------
  489|      0|            ossl_provider_free(prov);
  490|      0|            return 0;
  491|      0|        }
  492|      0|    }
  493|   172k|#endif
  494|       |
  495|   172k|    return ref;
  496|   172k|}
ossl_provider_new:
  525|    784|{
  526|    784|    struct provider_store_st *store = NULL;
  527|    784|    OSSL_PROVIDER_INFO template;
  528|    784|    OSSL_PROVIDER *prov = NULL;
  529|       |
  530|    784|    if ((store = get_provider_store(libctx)) == NULL)
  ------------------
  |  Branch (530:9): [True: 0, False: 784]
  ------------------
  531|      0|        return NULL;
  532|       |
  533|    784|    memset(&template, 0, sizeof(template));
  534|    784|    if (init_function == NULL) {
  ------------------
  |  Branch (534:9): [True: 784, False: 0]
  ------------------
  535|    784|        const OSSL_PROVIDER_INFO *p;
  536|    784|        size_t i;
  537|    784|        int chosen = 0;
  538|       |
  539|       |        /* Check if this is a predefined builtin provider */
  540|  1.86k|        for (p = ossl_predefined_providers; p->name != NULL; p++) {
  ------------------
  |  Branch (540:45): [True: 1.72k, False: 135]
  ------------------
  541|  1.72k|            if (strcmp(p->name, name) != 0)
  ------------------
  |  Branch (541:17): [True: 1.07k, False: 649]
  ------------------
  542|  1.07k|                continue;
  543|       |            /* These compile-time templates always have NULL parameters */
  544|    649|            template = *p;
  545|    649|            chosen = 1;
  546|    649|            break;
  547|  1.72k|        }
  548|    784|        if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (548:13): [True: 0, False: 784]
  ------------------
  549|      0|            return NULL;
  550|    784|        for (i = 0, p = store->provinfo; i < store->numprovinfo; p++, i++) {
  ------------------
  |  Branch (550:42): [True: 0, False: 784]
  ------------------
  551|      0|            if (strcmp(p->name, name) != 0)
  ------------------
  |  Branch (551:17): [True: 0, False: 0]
  ------------------
  552|      0|                continue;
  553|       |            /* For built-in providers, copy just implicit parameters. */
  554|      0|            if (!chosen)
  ------------------
  |  Branch (554:17): [True: 0, False: 0]
  ------------------
  555|      0|                template = *p;
  556|       |            /*
  557|       |             * Explicit parameters override config-file defaults.  If an empty
  558|       |             * parameter set is desired, a non-NULL empty set must be provided.
  559|       |             */
  560|      0|            if (params != NULL || p->parameters == NULL) {
  ------------------
  |  Branch (560:17): [True: 0, False: 0]
  |  Branch (560:35): [True: 0, False: 0]
  ------------------
  561|      0|                template.parameters = NULL;
  562|      0|                break;
  563|      0|            }
  564|       |            /* Always copy to avoid sharing/mutation. */
  565|      0|            template.parameters = sk_INFOPAIR_deep_copy(p->parameters,
  566|      0|                infopair_copy,
  567|      0|                infopair_free);
  568|      0|            if (template.parameters == NULL) {
  ------------------
  |  Branch (568:17): [True: 0, False: 0]
  ------------------
  569|      0|                CRYPTO_THREAD_unlock(store->lock);
  570|      0|                return NULL;
  571|      0|            }
  572|      0|            break;
  573|      0|        }
  574|    784|        CRYPTO_THREAD_unlock(store->lock);
  575|    784|    } else {
  576|      0|        template.init = init_function;
  577|      0|    }
  578|       |
  579|    784|    if (params != NULL) {
  ------------------
  |  Branch (579:9): [True: 0, False: 784]
  ------------------
  580|      0|        int i;
  581|       |
  582|       |        /* Don't leak if already non-NULL */
  583|      0|        if (template.parameters == NULL)
  ------------------
  |  Branch (583:13): [True: 0, False: 0]
  ------------------
  584|      0|            template.parameters = sk_INFOPAIR_new_null();
  585|      0|        if (template.parameters == NULL)
  ------------------
  |  Branch (585:13): [True: 0, False: 0]
  ------------------
  586|      0|            return NULL;
  587|       |
  588|      0|        for (i = 0; params[i].key != NULL; i++) {
  ------------------
  |  Branch (588:21): [True: 0, False: 0]
  ------------------
  589|      0|            if (params[i].data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      0|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (589:17): [True: 0, False: 0]
  ------------------
  590|      0|                continue;
  591|      0|            if (ossl_provider_info_add_parameter(&template, params[i].key,
  ------------------
  |  Branch (591:17): [True: 0, False: 0]
  ------------------
  592|      0|                    (char *)params[i].data)
  593|      0|                <= 0) {
  594|      0|                sk_INFOPAIR_pop_free(template.parameters, infopair_free);
  595|      0|                return NULL;
  596|      0|            }
  597|      0|        }
  598|      0|    }
  599|       |
  600|       |    /* provider_new() generates an error, so no need here */
  601|    784|    prov = provider_new(name, template.init, template.parameters);
  602|       |
  603|       |    /* If we copied the parameters, free them */
  604|    784|    if (template.parameters != NULL)
  ------------------
  |  Branch (604:9): [True: 0, False: 784]
  ------------------
  605|      0|        sk_INFOPAIR_pop_free(template.parameters, infopair_free);
  606|       |
  607|    784|    if (prov == NULL)
  ------------------
  |  Branch (607:9): [True: 0, False: 784]
  ------------------
  608|      0|        return NULL;
  609|       |
  610|    784|    if (!ossl_provider_set_module_path(prov, template.path)) {
  ------------------
  |  Branch (610:9): [True: 0, False: 784]
  ------------------
  611|      0|        ossl_provider_free(prov);
  612|      0|        return NULL;
  613|      0|    }
  614|       |
  615|    784|    prov->libctx = libctx;
  616|    784|#ifndef FIPS_MODULE
  617|    784|    prov->error_lib = ERR_get_next_error_library();
  618|    784|#endif
  619|       |
  620|       |    /*
  621|       |     * At this point, the provider is only partially "loaded".  To be
  622|       |     * fully "loaded", ossl_provider_activate() must also be called and it must
  623|       |     * then be added to the provider store.
  624|       |     */
  625|       |
  626|    784|    return prov;
  627|    784|}
ossl_provider_add_to_store:
  654|    649|{
  655|    649|    struct provider_store_st *store;
  656|    649|    int idx;
  657|    649|    OSSL_PROVIDER tmpl = {
  658|    649|        0,
  659|    649|    };
  660|    649|    OSSL_PROVIDER *actualtmp = NULL;
  661|       |
  662|    649|    if (actualprov != NULL)
  ------------------
  |  Branch (662:9): [True: 649, False: 0]
  ------------------
  663|    649|        *actualprov = NULL;
  664|       |
  665|    649|    if ((store = get_provider_store(prov->libctx)) == NULL)
  ------------------
  |  Branch (665:9): [True: 0, False: 649]
  ------------------
  666|      0|        return 0;
  667|       |
  668|    649|    if (!CRYPTO_THREAD_write_lock(store->lock))
  ------------------
  |  Branch (668:9): [True: 0, False: 649]
  ------------------
  669|      0|        return 0;
  670|       |
  671|    649|    tmpl.name = (char *)prov->name;
  672|    649|    idx = sk_OSSL_PROVIDER_find(store->providers, &tmpl);
  673|    649|    if (idx == -1)
  ------------------
  |  Branch (673:9): [True: 649, False: 0]
  ------------------
  674|    649|        actualtmp = prov;
  675|      0|    else
  676|      0|        actualtmp = sk_OSSL_PROVIDER_value(store->providers, idx);
  677|       |
  678|    649|    if (idx == -1) {
  ------------------
  |  Branch (678:9): [True: 649, False: 0]
  ------------------
  679|    649|        if (sk_OSSL_PROVIDER_push(store->providers, prov) == 0)
  ------------------
  |  Branch (679:13): [True: 0, False: 649]
  ------------------
  680|      0|            goto err;
  681|    649|        prov->store = store;
  682|    649|        if (!create_provider_children(prov)) {
  ------------------
  |  Branch (682:13): [True: 0, False: 649]
  ------------------
  683|      0|            sk_OSSL_PROVIDER_delete_ptr(store->providers, prov);
  684|      0|            goto err;
  685|      0|        }
  686|    649|        if (!retain_fallbacks)
  ------------------
  |  Branch (686:13): [True: 0, False: 649]
  ------------------
  687|      0|            store->use_fallbacks = 0;
  688|    649|    }
  689|       |
  690|    649|    CRYPTO_THREAD_unlock(store->lock);
  691|       |
  692|    649|    if (actualprov != NULL) {
  ------------------
  |  Branch (692:9): [True: 649, False: 0]
  ------------------
  693|    649|        if (!ossl_provider_up_ref(actualtmp)) {
  ------------------
  |  Branch (693:13): [True: 0, False: 649]
  ------------------
  694|      0|            ERR_raise(ERR_LIB_CRYPTO, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  695|      0|            actualtmp = NULL;
  696|      0|            return 0;
  697|      0|        }
  698|    649|        *actualprov = actualtmp;
  699|    649|    }
  700|       |
  701|    649|    if (idx >= 0) {
  ------------------
  |  Branch (701:9): [True: 0, False: 649]
  ------------------
  702|       |        /*
  703|       |         * The provider is already in the store. Probably two threads
  704|       |         * independently initialised their own provider objects with the same
  705|       |         * name and raced to put them in the store. This thread lost. We
  706|       |         * deactivate the one we just created and use the one that already
  707|       |         * exists instead.
  708|       |         * If we get here then we know we did not create provider children
  709|       |         * above, so we inform ossl_provider_deactivate not to attempt to remove
  710|       |         * any.
  711|       |         */
  712|      0|        ossl_provider_deactivate(prov, 0);
  713|      0|        ossl_provider_free(prov);
  714|      0|    }
  715|    649|#ifndef FIPS_MODULE
  716|    649|    else {
  717|       |        /*
  718|       |         * This can be done outside the lock. We tolerate other threads getting
  719|       |         * the wrong result briefly when creating OSSL_DECODER_CTXs.
  720|       |         */
  721|    649|        ossl_decoder_cache_flush(prov->libctx);
  722|    649|    }
  723|    649|#endif
  724|       |
  725|    649|    return 1;
  726|       |
  727|      0|err:
  728|      0|    CRYPTO_THREAD_unlock(store->lock);
  729|      0|    return 0;
  730|    649|}
ossl_provider_free:
  733|   174k|{
  734|   174k|    if (prov != NULL) {
  ------------------
  |  Branch (734:9): [True: 174k, False: 0]
  ------------------
  735|   174k|        int ref = 0;
  736|       |
  737|   174k|        CRYPTO_DOWN_REF(&prov->refcnt, &ref);
  738|       |
  739|       |        /*
  740|       |         * When the refcount drops to zero, we clean up the provider.
  741|       |         * Note that this also does teardown, which may seem late,
  742|       |         * considering that init happens on first activation.  However,
  743|       |         * there may be other structures hanging on to the provider after
  744|       |         * the last deactivation and may therefore need full access to the
  745|       |         * provider's services.  Therefore, we deinit late.
  746|       |         */
  747|   174k|        if (ref == 0) {
  ------------------
  |  Branch (747:13): [True: 1.57k, False: 172k]
  ------------------
  748|  1.57k|            if (prov->flag_initialized) {
  ------------------
  |  Branch (748:17): [True: 1.43k, False: 135]
  ------------------
  749|  1.43k|                ossl_provider_teardown(prov);
  750|  1.43k|#ifndef OPENSSL_NO_ERR
  751|  1.43k|#ifndef FIPS_MODULE
  752|  1.43k|                if (prov->error_strings != NULL) {
  ------------------
  |  Branch (752:21): [True: 0, False: 1.43k]
  ------------------
  753|      0|                    ERR_unload_strings(prov->error_lib, prov->error_strings);
  754|      0|                    OPENSSL_free(prov->error_strings);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  755|      0|                    prov->error_strings = NULL;
  756|      0|                }
  757|  1.43k|#endif
  758|  1.43k|#endif
  759|  1.43k|                OPENSSL_free(prov->operation_bits);
  ------------------
  |  |  131|  1.43k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  760|  1.43k|                prov->operation_bits = NULL;
  761|  1.43k|                prov->operation_bits_sz = 0;
  762|  1.43k|                prov->flag_initialized = 0;
  763|  1.43k|            }
  764|       |
  765|  1.57k|#ifndef FIPS_MODULE
  766|       |            /*
  767|       |             * We deregister thread handling whether or not the provider was
  768|       |             * initialized. If init was attempted but was not successful then
  769|       |             * the provider may still have registered a thread handler.
  770|       |             */
  771|  1.57k|            ossl_init_thread_deregister(prov);
  772|  1.57k|            DSO_free(prov->module);
  773|  1.57k|#endif
  774|  1.57k|            OPENSSL_free(prov->name);
  ------------------
  |  |  131|  1.57k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  775|  1.57k|            OPENSSL_free(prov->path);
  ------------------
  |  |  131|  1.57k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  776|  1.57k|            sk_INFOPAIR_pop_free(prov->parameters, infopair_free);
  777|  1.57k|            CRYPTO_THREAD_lock_free(prov->opbits_lock);
  778|  1.57k|            CRYPTO_THREAD_lock_free(prov->flag_lock);
  779|  1.57k|            CRYPTO_THREAD_lock_free(prov->activatecnt_lock);
  780|  1.57k|            CRYPTO_FREE_REF(&prov->refcnt);
  781|  1.57k|            OPENSSL_free(prov);
  ------------------
  |  |  131|  1.57k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  782|  1.57k|        }
  783|   172k|#ifndef FIPS_MODULE
  784|   172k|        else if (prov->ischild) {
  ------------------
  |  Branch (784:18): [True: 0, False: 172k]
  ------------------
  785|      0|            ossl_provider_free_parent(prov, 0);
  786|      0|        }
  787|   174k|#endif
  788|   174k|    }
  789|   174k|}
ossl_provider_set_module_path:
  793|    784|{
  794|    784|    OPENSSL_free(prov->path);
  ------------------
  |  |  131|    784|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  795|    784|    prov->path = NULL;
  796|    784|    if (module_path == NULL)
  ------------------
  |  Branch (796:9): [True: 784, False: 0]
  ------------------
  797|    784|        return 1;
  798|      0|    if ((prov->path = OPENSSL_strdup(module_path)) != NULL)
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (798:9): [True: 0, False: 0]
  ------------------
  799|      0|        return 1;
  800|      0|    return 0;
  801|      0|}
OSSL_PROVIDER_get_conf_parameters:
  839|  3.98k|{
  840|  3.98k|    int i;
  841|       |
  842|  3.98k|    if (prov->parameters == NULL)
  ------------------
  |  Branch (842:9): [True: 0, False: 3.98k]
  ------------------
  843|      0|        return 1;
  844|       |
  845|  3.98k|    for (i = 0; i < sk_INFOPAIR_num(prov->parameters); i++) {
  ------------------
  |  Branch (845:17): [True: 0, False: 3.98k]
  ------------------
  846|      0|        INFOPAIR *pair = sk_INFOPAIR_value(prov->parameters, i);
  847|      0|        OSSL_PARAM *p = OSSL_PARAM_locate(params, pair->name);
  848|       |
  849|      0|        if (p != NULL
  ------------------
  |  Branch (849:13): [True: 0, False: 0]
  ------------------
  850|      0|            && !OSSL_PARAM_set_utf8_ptr(p, pair->value))
  ------------------
  |  Branch (850:16): [True: 0, False: 0]
  ------------------
  851|      0|            return 0;
  852|      0|    }
  853|  3.98k|    return 1;
  854|  3.98k|}
ossl_provider_activate:
 1396|  1.38k|{
 1397|  1.38k|    int count;
 1398|       |
 1399|  1.38k|    if (prov == NULL)
  ------------------
  |  Branch (1399:9): [True: 0, False: 1.38k]
  ------------------
 1400|      0|        return 0;
 1401|  1.38k|#ifndef FIPS_MODULE
 1402|       |    /*
 1403|       |     * If aschild is true, then we only actually do the activation if the
 1404|       |     * provider is a child. If its not, this is still success.
 1405|       |     */
 1406|  1.38k|    if (aschild && !prov->ischild)
  ------------------
  |  Branch (1406:9): [True: 0, False: 1.38k]
  |  Branch (1406:20): [True: 0, False: 0]
  ------------------
 1407|      0|        return 1;
 1408|  1.38k|#endif
 1409|  1.38k|    if ((count = provider_activate(prov, 1, upcalls)) > 0)
  ------------------
  |  Branch (1409:9): [True: 1.25k, False: 135]
  ------------------
 1410|  1.25k|        return count == 1 ? provider_flush_store_cache(prov) : 1;
  ------------------
  |  Branch (1410:16): [True: 649, False: 605]
  ------------------
 1411|       |
 1412|    135|    return 0;
 1413|  1.38k|}
ossl_provider_deactivate:
 1416|  2.04k|{
 1417|  2.04k|    int count;
 1418|       |
 1419|  2.04k|    if (prov == NULL
  ------------------
  |  Branch (1419:9): [True: 0, False: 2.04k]
  ------------------
 1420|  2.04k|        || (count = provider_deactivate(prov, 1, removechildren)) < 0)
  ------------------
  |  Branch (1420:12): [True: 0, False: 2.04k]
  ------------------
 1421|      0|        return 0;
 1422|  2.04k|    return count == 0 ? provider_remove_store_methods(prov) : 1;
  ------------------
  |  Branch (1422:12): [True: 1.43k, False: 605]
  ------------------
 1423|  2.04k|}
ossl_provider_ctx:
 1426|  2.82M|{
 1427|  2.82M|    return prov != NULL ? prov->provctx : NULL;
  ------------------
  |  Branch (1427:12): [True: 2.82M, False: 0]
  ------------------
 1428|  2.82M|}
ossl_provider_doall_activated:
 1527|  79.9k|{
 1528|  79.9k|    int ret = 0, curr, max, ref = 0;
 1529|  79.9k|    struct provider_store_st *store = get_provider_store(ctx);
 1530|  79.9k|    STACK_OF(OSSL_PROVIDER) *provs = NULL;
  ------------------
  |  |   33|  79.9k|#define STACK_OF(type) struct stack_st_##type
  ------------------
 1531|       |
 1532|  79.9k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
 1533|       |    /*
 1534|       |     * Make sure any providers are loaded from config before we try to use
 1535|       |     * them.
 1536|       |     */
 1537|  79.9k|    if (ossl_lib_ctx_is_default(ctx))
  ------------------
  |  Branch (1537:9): [True: 34.8k, False: 45.1k]
  ------------------
 1538|  34.8k|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  510|  34.8k|#define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
  ------------------
 1539|  79.9k|#endif
 1540|       |
 1541|  79.9k|    if (store == NULL)
  ------------------
  |  Branch (1541:9): [True: 0, False: 79.9k]
  ------------------
 1542|      0|        return 1;
 1543|  79.9k|    if (!provider_activate_fallbacks(store))
  ------------------
  |  Branch (1543:9): [True: 0, False: 79.9k]
  ------------------
 1544|      0|        return 0;
 1545|       |
 1546|       |    /*
 1547|       |     * Under lock, grab a copy of the provider list and up_ref each
 1548|       |     * provider so that they don't disappear underneath us.
 1549|       |     */
 1550|  79.9k|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1550:9): [True: 0, False: 79.9k]
  ------------------
 1551|      0|        return 0;
 1552|  79.9k|    provs = sk_OSSL_PROVIDER_dup(store->providers);
 1553|  79.9k|    if (provs == NULL) {
  ------------------
  |  Branch (1553:9): [True: 0, False: 79.9k]
  ------------------
 1554|      0|        CRYPTO_THREAD_unlock(store->lock);
 1555|      0|        return 0;
 1556|      0|    }
 1557|  79.9k|    max = sk_OSSL_PROVIDER_num(provs);
 1558|       |    /*
 1559|       |     * We work backwards through the stack so that we can safely delete items
 1560|       |     * as we go.
 1561|       |     */
 1562|   204k|    for (curr = max - 1; curr >= 0; curr--) {
  ------------------
  |  Branch (1562:26): [True: 124k, False: 79.9k]
  ------------------
 1563|   124k|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1564|       |
 1565|   124k|        if (!CRYPTO_THREAD_read_lock(prov->flag_lock))
  ------------------
  |  Branch (1565:13): [True: 0, False: 124k]
  ------------------
 1566|      0|            goto err_unlock;
 1567|   124k|        if (prov->flag_activated) {
  ------------------
  |  Branch (1567:13): [True: 124k, False: 0]
  ------------------
 1568|       |            /*
 1569|       |             * We call CRYPTO_UP_REF directly rather than ossl_provider_up_ref
 1570|       |             * to avoid upping the ref count on the parent provider, which we
 1571|       |             * must not do while holding locks.
 1572|       |             */
 1573|   124k|            if (CRYPTO_UP_REF(&prov->refcnt, &ref) <= 0) {
  ------------------
  |  Branch (1573:17): [True: 0, False: 124k]
  ------------------
 1574|      0|                CRYPTO_THREAD_unlock(prov->flag_lock);
 1575|      0|                goto err_unlock;
 1576|      0|            }
 1577|       |            /*
 1578|       |             * It's already activated, but we up the activated count to ensure
 1579|       |             * it remains activated until after we've called the user callback.
 1580|       |             * In theory this could mean the parent provider goes inactive,
 1581|       |             * whilst still activated in the child for a short period. That's ok.
 1582|       |             */
 1583|   124k|            if (!CRYPTO_atomic_add(&prov->activatecnt, 1, &ref,
  ------------------
  |  Branch (1583:17): [True: 0, False: 124k]
  ------------------
 1584|   124k|                    prov->activatecnt_lock)) {
 1585|      0|                CRYPTO_DOWN_REF(&prov->refcnt, &ref);
 1586|      0|                CRYPTO_THREAD_unlock(prov->flag_lock);
 1587|      0|                goto err_unlock;
 1588|      0|            }
 1589|   124k|        } else {
 1590|      0|            sk_OSSL_PROVIDER_delete(provs, curr);
 1591|      0|            max--;
 1592|      0|        }
 1593|   124k|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1594|   124k|    }
 1595|  79.9k|    CRYPTO_THREAD_unlock(store->lock);
 1596|       |
 1597|       |    /*
 1598|       |     * Now, we sweep through all providers not under lock
 1599|       |     */
 1600|   204k|    for (curr = 0; curr < max; curr++) {
  ------------------
  |  Branch (1600:20): [True: 124k, False: 79.9k]
  ------------------
 1601|   124k|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1602|       |
 1603|   124k|        if (!cb(prov, cbdata)) {
  ------------------
  |  Branch (1603:13): [True: 0, False: 124k]
  ------------------
 1604|      0|            curr = -1;
 1605|      0|            goto finish;
 1606|      0|        }
 1607|   124k|    }
 1608|  79.9k|    curr = -1;
 1609|       |
 1610|  79.9k|    ret = 1;
 1611|  79.9k|    goto finish;
 1612|       |
 1613|      0|err_unlock:
 1614|      0|    CRYPTO_THREAD_unlock(store->lock);
 1615|  79.9k|finish:
 1616|       |    /*
 1617|       |     * The pop_free call doesn't do what we want on an error condition. We
 1618|       |     * either start from the first item in the stack, or part way through if
 1619|       |     * we only processed some of the items.
 1620|       |     */
 1621|   204k|    for (curr++; curr < max; curr++) {
  ------------------
  |  Branch (1621:18): [True: 124k, False: 79.9k]
  ------------------
 1622|   124k|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1623|       |
 1624|   124k|        if (!CRYPTO_atomic_add(&prov->activatecnt, -1, &ref,
  ------------------
  |  Branch (1624:13): [True: 0, False: 124k]
  ------------------
 1625|   124k|                prov->activatecnt_lock)) {
 1626|      0|            ret = 0;
 1627|      0|            continue;
 1628|      0|        }
 1629|   124k|        if (ref < 1) {
  ------------------
  |  Branch (1629:13): [True: 0, False: 124k]
  ------------------
 1630|       |            /*
 1631|       |             * Looks like we need to deactivate properly. We could just have
 1632|       |             * done this originally, but it involves taking a write lock so
 1633|       |             * we avoid it. We up the count again and do a full deactivation
 1634|       |             */
 1635|      0|            if (CRYPTO_atomic_add(&prov->activatecnt, 1, &ref,
  ------------------
  |  Branch (1635:17): [True: 0, False: 0]
  ------------------
 1636|      0|                    prov->activatecnt_lock))
 1637|      0|                provider_deactivate(prov, 0, 1);
 1638|      0|            else
 1639|      0|                ret = 0;
 1640|      0|        }
 1641|       |        /*
 1642|       |         * As above where we did the up-ref, we don't call ossl_provider_free
 1643|       |         * to avoid making upcalls. There should always be at least one ref
 1644|       |         * to the provider in the store, so this should never drop to 0.
 1645|       |         */
 1646|   124k|        if (!CRYPTO_DOWN_REF(&prov->refcnt, &ref)) {
  ------------------
  |  Branch (1646:13): [True: 0, False: 124k]
  ------------------
 1647|      0|            ret = 0;
 1648|      0|            continue;
 1649|      0|        }
 1650|       |        /*
 1651|       |         * Not much we can do if this assert ever fails. So we don't use
 1652|       |         * ossl_assert here.
 1653|       |         */
 1654|   124k|        assert(ref > 0);
  ------------------
  |  Branch (1654:9): [True: 0, False: 124k]
  |  Branch (1654:9): [True: 124k, False: 0]
  ------------------
 1655|   124k|    }
 1656|  79.9k|    sk_OSSL_PROVIDER_free(provs);
 1657|  79.9k|    return ret;
 1658|  79.9k|}
OSSL_PROVIDER_available:
 1661|    786|{
 1662|    786|    OSSL_PROVIDER *prov = NULL;
 1663|    786|    int available = 0;
 1664|    786|    struct provider_store_st *store = get_provider_store(libctx);
 1665|       |
 1666|    786|    if (store == NULL || !provider_activate_fallbacks(store))
  ------------------
  |  Branch (1666:9): [True: 0, False: 786]
  |  Branch (1666:26): [True: 0, False: 786]
  ------------------
 1667|      0|        return 0;
 1668|       |
 1669|    786|    prov = ossl_provider_find(libctx, name, 0);
 1670|    786|    if (prov != NULL) {
  ------------------
  |  Branch (1670:9): [True: 24, False: 762]
  ------------------
 1671|     24|        if (!CRYPTO_THREAD_read_lock(prov->flag_lock))
  ------------------
  |  Branch (1671:13): [True: 0, False: 24]
  ------------------
 1672|      0|            return 0;
 1673|     24|        available = prov->flag_activated;
 1674|     24|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1675|     24|        ossl_provider_free(prov);
 1676|     24|    }
 1677|    786|    return available;
 1678|    786|}
ossl_provider_name:
 1682|  1.64k|{
 1683|  1.64k|    return prov->name;
 1684|  1.64k|}
ossl_provider_libctx:
 1719|  4.05M|{
 1720|  4.05M|    return prov != NULL ? prov->libctx : NULL;
  ------------------
  |  Branch (1720:12): [True: 3.71M, False: 338k]
  ------------------
 1721|  4.05M|}
ossl_provider_teardown:
 1736|  1.43k|{
 1737|  1.43k|    if (prov->teardown != NULL
  ------------------
  |  Branch (1737:9): [True: 1.41k, False: 22]
  ------------------
 1738|  1.41k|#ifndef FIPS_MODULE
 1739|  1.41k|        && !prov->ischild
  ------------------
  |  Branch (1739:12): [True: 1.41k, False: 0]
  ------------------
 1740|  1.43k|#endif
 1741|  1.43k|    ) {
 1742|  1.41k|#ifndef FIPS_MODULE
 1743|  1.41k|        OSSL_TRACE_BEGIN(PROVIDER)
  ------------------
  |  |  221|  1.41k|    do {                           \
  |  |  222|  1.41k|        BIO *trc_out = NULL;       \
  |  |  223|  1.41k|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 1.41k]
  |  |  ------------------
  ------------------
 1744|      0|        {
 1745|      0|            BIO_printf(trc_out, "(provider %s) calling teardown\n",
 1746|      0|                ossl_provider_name(prov));
 1747|      0|        }
 1748|  1.41k|        OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  226|  1.41k|    }                            \
  |  |  227|  1.41k|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 1.41k]
  |  |  ------------------
  ------------------
 1749|  1.41k|#endif
 1750|  1.41k|        prov->teardown(prov->provctx);
 1751|  1.41k|    }
 1752|  1.43k|}
ossl_provider_get_capabilities:
 1907|  6.37k|{
 1908|  6.37k|    if (prov->get_capabilities != NULL) {
  ------------------
  |  Branch (1908:9): [True: 5.12k, False: 1.25k]
  ------------------
 1909|  5.12k|#ifndef FIPS_MODULE
 1910|  5.12k|        OSSL_TRACE_BEGIN(PROVIDER)
  ------------------
  |  |  221|  5.12k|    do {                           \
  |  |  222|  5.12k|        BIO *trc_out = NULL;       \
  |  |  223|  5.12k|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 5.12k]
  |  |  ------------------
  ------------------
 1911|      0|        {
 1912|      0|            BIO_printf(trc_out,
 1913|      0|                "(provider %s) Calling get_capabilities "
 1914|      0|                "with capabilities %s\n",
 1915|      0|                prov->name,
 1916|      0|                capability == NULL ? "none" : capability);
  ------------------
  |  Branch (1916:17): [True: 0, False: 0]
  ------------------
 1917|      0|        }
 1918|  5.12k|        OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  226|  5.12k|    }                            \
  |  |  227|  5.12k|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 5.12k]
  |  |  ------------------
  ------------------
 1919|  5.12k|#endif
 1920|  5.12k|        return prov->get_capabilities(prov->provctx, capability, cb, arg);
 1921|  5.12k|    }
 1922|  1.25k|    return 1;
 1923|  6.37k|}
ossl_provider_query_operation:
 1946|   119k|{
 1947|   119k|    const OSSL_ALGORITHM *res;
 1948|       |
 1949|   119k|    if (prov->query_operation == NULL) {
  ------------------
  |  Branch (1949:9): [True: 0, False: 119k]
  ------------------
 1950|      0|#ifndef FIPS_MODULE
 1951|      0|        OSSL_TRACE_BEGIN(PROVIDER)
  ------------------
  |  |  221|      0|    do {                           \
  |  |  222|      0|        BIO *trc_out = NULL;       \
  |  |  223|      0|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1952|      0|        {
 1953|      0|            BIO_printf(trc_out, "provider %s lacks query operation!\n",
 1954|      0|                prov->name);
 1955|      0|        }
 1956|      0|        OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  226|      0|    }                            \
  |  |  227|      0|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1957|      0|#endif
 1958|      0|        return NULL;
 1959|      0|    }
 1960|       |
 1961|   119k|    res = prov->query_operation(prov->provctx, operation_id, no_cache);
 1962|   119k|#ifndef FIPS_MODULE
 1963|   119k|    OSSL_TRACE_BEGIN(PROVIDER)
  ------------------
  |  |  221|   119k|    do {                           \
  |  |  222|   119k|        BIO *trc_out = NULL;       \
  |  |  223|   119k|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 119k]
  |  |  ------------------
  ------------------
 1964|      0|    {
 1965|      0|        const OSSL_ALGORITHM *idx;
 1966|      0|        if (res != NULL) {
  ------------------
  |  Branch (1966:13): [True: 0, False: 0]
  ------------------
 1967|      0|            BIO_printf(trc_out,
 1968|      0|                "(provider %s) Calling query, available algs are:\n", prov->name);
 1969|       |
 1970|      0|            for (idx = res; idx->algorithm_names != NULL; idx++) {
  ------------------
  |  Branch (1970:29): [True: 0, False: 0]
  ------------------
 1971|      0|                BIO_printf(trc_out,
 1972|      0|                    "(provider %s) names %s, prop_def %s, desc %s\n",
 1973|      0|                    prov->name,
 1974|      0|                    idx->algorithm_names == NULL ? "none" : idx->algorithm_names,
  ------------------
  |  Branch (1974:21): [True: 0, False: 0]
  ------------------
 1975|      0|                    idx->property_definition == NULL ? "none" : idx->property_definition,
  ------------------
  |  Branch (1975:21): [True: 0, False: 0]
  ------------------
 1976|      0|                    idx->algorithm_description == NULL ? "none" : idx->algorithm_description);
  ------------------
  |  Branch (1976:21): [True: 0, False: 0]
  ------------------
 1977|      0|            }
 1978|      0|        } else {
 1979|      0|            BIO_printf(trc_out, "(provider %s) query_operation failed\n", prov->name);
 1980|      0|        }
 1981|      0|    }
 1982|   119k|    OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  226|   119k|    }                            \
  |  |  227|   119k|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 119k]
  |  |  ------------------
  ------------------
 1983|   119k|#endif
 1984|       |
 1985|       |#if defined(OPENSSL_NO_CACHED_FETCH)
 1986|       |    /* Forcing the non-caching of queries */
 1987|       |    if (no_cache != NULL)
 1988|       |        *no_cache = 1;
 1989|       |#endif
 1990|   119k|    return res;
 1991|   119k|}
ossl_provider_unquery_operation:
 2010|   119k|{
 2011|   119k|    if (prov->unquery_operation != NULL) {
  ------------------
  |  Branch (2011:9): [True: 0, False: 119k]
  ------------------
 2012|      0|#ifndef FIPS_MODULE
 2013|      0|        OSSL_TRACE_BEGIN(PROVIDER)
  ------------------
  |  |  221|      0|    do {                           \
  |  |  222|      0|        BIO *trc_out = NULL;       \
  |  |  223|      0|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2014|      0|        {
 2015|      0|            BIO_printf(trc_out,
 2016|      0|                "(provider %s) Calling unquery"
 2017|      0|                " with operation %d\n",
 2018|      0|                prov->name,
 2019|      0|                operation_id);
 2020|      0|        }
 2021|      0|        OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  226|      0|    }                            \
  |  |  227|      0|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2022|      0|#endif
 2023|      0|        prov->unquery_operation(prov->provctx, operation_id, algs);
 2024|      0|    }
 2025|   119k|}
ossl_provider_set_operation_bit:
 2028|  7.38k|{
 2029|  7.38k|    size_t byte = bitnum / 8;
 2030|  7.38k|    unsigned char bit = (1 << (bitnum % 8)) & 0xFF;
 2031|       |
 2032|  7.38k|    if (!CRYPTO_THREAD_write_lock(provider->opbits_lock))
  ------------------
  |  Branch (2032:9): [True: 0, False: 7.38k]
  ------------------
 2033|      0|        return 0;
 2034|  7.38k|    if (provider->operation_bits_sz <= byte) {
  ------------------
  |  Branch (2034:9): [True: 2.51k, False: 4.87k]
  ------------------
 2035|  2.51k|        unsigned char *tmp = OPENSSL_realloc(provider->operation_bits,
  ------------------
  |  |  120|  2.51k|    CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2036|  2.51k|            byte + 1);
 2037|       |
 2038|  2.51k|        if (tmp == NULL) {
  ------------------
  |  Branch (2038:13): [True: 0, False: 2.51k]
  ------------------
 2039|      0|            CRYPTO_THREAD_unlock(provider->opbits_lock);
 2040|      0|            return 0;
 2041|      0|        }
 2042|  2.51k|        provider->operation_bits = tmp;
 2043|  2.51k|        memset(provider->operation_bits + provider->operation_bits_sz,
 2044|  2.51k|            '\0', byte + 1 - provider->operation_bits_sz);
 2045|  2.51k|        provider->operation_bits_sz = byte + 1;
 2046|  2.51k|    }
 2047|  7.38k|    provider->operation_bits[byte] |= bit;
 2048|  7.38k|    CRYPTO_THREAD_unlock(provider->opbits_lock);
 2049|  7.38k|    return 1;
 2050|  7.38k|}
ossl_provider_test_operation_bit:
 2054|   119k|{
 2055|   119k|    size_t byte = bitnum / 8;
 2056|   119k|    unsigned char bit = (1 << (bitnum % 8)) & 0xFF;
 2057|       |
 2058|   119k|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|   119k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|   119k|    __FILE__, __LINE__)
  ------------------
  |  Branch (2058:9): [True: 0, False: 119k]
  ------------------
 2059|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 2060|      0|        return 0;
 2061|      0|    }
 2062|       |
 2063|   119k|    *result = 0;
 2064|   119k|    if (!CRYPTO_THREAD_read_lock(provider->opbits_lock))
  ------------------
  |  Branch (2064:9): [True: 0, False: 119k]
  ------------------
 2065|      0|        return 0;
 2066|   119k|    if (provider->operation_bits_sz > byte)
  ------------------
  |  Branch (2066:9): [True: 116k, False: 2.51k]
  ------------------
 2067|   116k|        *result = ((provider->operation_bits[byte] & bit) != 0);
 2068|   119k|    CRYPTO_THREAD_unlock(provider->opbits_lock);
 2069|   119k|    return 1;
 2070|   119k|}
provider_core.c:provider_deactivate_free:
  237|  1.43k|{
  238|  1.43k|    if (prov->flag_activated)
  ------------------
  |  Branch (238:9): [True: 787, False: 649]
  ------------------
  239|    787|        ossl_provider_deactivate(prov, 1);
  240|  1.43k|    ossl_provider_free(prov);
  241|  1.43k|}
provider_core.c:ossl_provider_cmp:
  204|  7.37k|{
  205|  7.37k|    return strcmp((*a)->name, (*b)->name);
  206|  7.37k|}
provider_core.c:get_provider_store:
  330|  90.2k|{
  331|  90.2k|    struct provider_store_st *store = NULL;
  332|       |
  333|  90.2k|    store = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_PROVIDER_STORE_INDEX);
  ------------------
  |  |   97|  90.2k|#define OSSL_LIB_CTX_PROVIDER_STORE_INDEX 1
  ------------------
  334|  90.2k|    if (store == NULL)
  ------------------
  |  Branch (334:9): [True: 0, False: 90.2k]
  ------------------
  335|       |        ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  336|  90.2k|    return store;
  337|  90.2k|}
provider_core.c:provider_new:
  444|  1.57k|{
  445|  1.57k|    OSSL_PROVIDER *prov = NULL;
  446|       |
  447|  1.57k|    if ((prov = OPENSSL_zalloc(sizeof(*prov))) == NULL)
  ------------------
  |  |  108|  1.57k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (447:9): [True: 0, False: 1.57k]
  ------------------
  448|      0|        return NULL;
  449|  1.57k|    if (!CRYPTO_NEW_REF(&prov->refcnt, 1)) {
  ------------------
  |  Branch (449:9): [True: 0, False: 1.57k]
  ------------------
  450|      0|        OPENSSL_free(prov);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  451|      0|        return NULL;
  452|      0|    }
  453|  1.57k|    if ((prov->activatecnt_lock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (453:9): [True: 0, False: 1.57k]
  ------------------
  454|      0|        ossl_provider_free(prov);
  455|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  456|      0|        return NULL;
  457|      0|    }
  458|       |
  459|  1.57k|    if ((prov->opbits_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (459:9): [True: 0, False: 1.57k]
  ------------------
  460|  1.57k|        || (prov->flag_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (460:12): [True: 0, False: 1.57k]
  ------------------
  461|  1.57k|        || (prov->parameters = sk_INFOPAIR_deep_copy(parameters,
  ------------------
  |  Branch (461:12): [True: 0, False: 1.57k]
  ------------------
  462|  1.57k|                infopair_copy,
  463|  1.57k|                infopair_free))
  464|  1.57k|            == NULL) {
  465|      0|        ossl_provider_free(prov);
  466|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  467|      0|        return NULL;
  468|      0|    }
  469|  1.57k|    if ((prov->name = OPENSSL_strdup(name)) == NULL) {
  ------------------
  |  |  135|  1.57k|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (469:9): [True: 0, False: 1.57k]
  ------------------
  470|      0|        ossl_provider_free(prov);
  471|      0|        return NULL;
  472|      0|    }
  473|       |
  474|  1.57k|    prov->init_function = init_function;
  475|       |
  476|  1.57k|    return prov;
  477|  1.57k|}
provider_core.c:create_provider_children:
  631|    649|{
  632|    649|    int ret = 1;
  633|    649|#ifndef FIPS_MODULE
  634|    649|    struct provider_store_st *store = prov->store;
  635|    649|    OSSL_PROVIDER_CHILD_CB *child_cb;
  636|    649|    int i, max;
  637|       |
  638|    649|    max = sk_OSSL_PROVIDER_CHILD_CB_num(store->child_cbs);
  639|    649|    for (i = 0; i < max; i++) {
  ------------------
  |  Branch (639:17): [True: 0, False: 649]
  ------------------
  640|       |        /*
  641|       |         * This is newly activated (activatecnt == 1), so we need to
  642|       |         * create child providers as necessary.
  643|       |         */
  644|      0|        child_cb = sk_OSSL_PROVIDER_CHILD_CB_value(store->child_cbs, i);
  645|      0|        ret &= child_cb->create_cb((OSSL_CORE_HANDLE *)prov, child_cb->cbdata);
  646|      0|    }
  647|    649|#endif
  648|       |
  649|    649|    return ret;
  650|    649|}
provider_core.c:provider_activate:
 1256|  2.17k|{
 1257|  2.17k|    int count = -1;
 1258|  2.17k|    struct provider_store_st *store;
 1259|  2.17k|    int ret = 1;
 1260|       |
 1261|  2.17k|    store = prov->store;
 1262|       |    /*
 1263|       |     * If the provider hasn't been added to the store, then we don't need
 1264|       |     * any locks because we've not shared it with other threads.
 1265|       |     */
 1266|  2.17k|    if (store == NULL) {
  ------------------
  |  Branch (1266:9): [True: 1.57k, False: 605]
  ------------------
 1267|  1.57k|        lock = 0;
 1268|  1.57k|        if (!provider_init(prov))
  ------------------
  |  Branch (1268:13): [True: 135, False: 1.43k]
  ------------------
 1269|    135|            return -1;
 1270|  1.57k|    }
 1271|       |
 1272|  2.04k|#ifndef FIPS_MODULE
 1273|  2.04k|    if (prov->random_bytes != NULL
  ------------------
  |  Branch (1273:9): [True: 0, False: 2.04k]
  ------------------
 1274|      0|        && !ossl_rand_check_random_provider_on_load(prov->libctx, prov))
  ------------------
  |  Branch (1274:12): [True: 0, False: 0]
  ------------------
 1275|      0|        return -1;
 1276|       |
 1277|  2.04k|    if (prov->ischild && upcalls && !ossl_provider_up_ref_parent(prov, 1))
  ------------------
  |  Branch (1277:9): [True: 0, False: 2.04k]
  |  Branch (1277:26): [True: 0, False: 0]
  |  Branch (1277:37): [True: 0, False: 0]
  ------------------
 1278|      0|        return -1;
 1279|  2.04k|#endif
 1280|       |
 1281|  2.04k|    if (lock && !CRYPTO_THREAD_read_lock(store->lock)) {
  ------------------
  |  Branch (1281:9): [True: 605, False: 1.43k]
  |  Branch (1281:17): [True: 0, False: 605]
  ------------------
 1282|      0|#ifndef FIPS_MODULE
 1283|      0|        if (prov->ischild && upcalls)
  ------------------
  |  Branch (1283:13): [True: 0, False: 0]
  |  Branch (1283:30): [True: 0, False: 0]
  ------------------
 1284|      0|            ossl_provider_free_parent(prov, 1);
 1285|      0|#endif
 1286|      0|        return -1;
 1287|      0|    }
 1288|       |
 1289|  2.04k|    if (lock && !CRYPTO_THREAD_write_lock(prov->flag_lock)) {
  ------------------
  |  Branch (1289:9): [True: 605, False: 1.43k]
  |  Branch (1289:17): [True: 0, False: 605]
  ------------------
 1290|      0|        CRYPTO_THREAD_unlock(store->lock);
 1291|      0|#ifndef FIPS_MODULE
 1292|      0|        if (prov->ischild && upcalls)
  ------------------
  |  Branch (1292:13): [True: 0, False: 0]
  |  Branch (1292:30): [True: 0, False: 0]
  ------------------
 1293|      0|            ossl_provider_free_parent(prov, 1);
 1294|      0|#endif
 1295|      0|        return -1;
 1296|      0|    }
 1297|  2.04k|    if (CRYPTO_atomic_add(&prov->activatecnt, 1, &count, prov->activatecnt_lock)) {
  ------------------
  |  Branch (1297:9): [True: 2.04k, False: 0]
  ------------------
 1298|  2.04k|        prov->flag_activated = 1;
 1299|       |
 1300|  2.04k|        if (count == 1 && store != NULL) {
  ------------------
  |  Branch (1300:13): [True: 1.43k, False: 605]
  |  Branch (1300:27): [True: 0, False: 1.43k]
  ------------------
 1301|      0|            ret = create_provider_children(prov);
 1302|      0|        }
 1303|  2.04k|    }
 1304|  2.04k|    if (lock) {
  ------------------
  |  Branch (1304:9): [True: 605, False: 1.43k]
  ------------------
 1305|    605|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1306|    605|        CRYPTO_THREAD_unlock(store->lock);
 1307|       |        /*
 1308|       |         * This can be done outside the lock. We tolerate other threads getting
 1309|       |         * the wrong result briefly when creating OSSL_DECODER_CTXs.
 1310|       |         */
 1311|    605|#ifndef FIPS_MODULE
 1312|    605|        if (count == 1)
  ------------------
  |  Branch (1312:13): [True: 0, False: 605]
  ------------------
 1313|      0|            ossl_decoder_cache_flush(prov->libctx);
 1314|    605|#endif
 1315|    605|    }
 1316|       |
 1317|  2.04k|    if (!ret)
  ------------------
  |  Branch (1317:9): [True: 0, False: 2.04k]
  ------------------
 1318|      0|        return -1;
 1319|       |
 1320|  2.04k|    return count;
 1321|  2.04k|}
provider_core.c:provider_init:
  948|  1.57k|{
  949|  1.57k|    const OSSL_DISPATCH *provider_dispatch = NULL;
  950|  1.57k|    void *tmp_provctx = NULL; /* safety measure */
  951|  1.57k|#ifndef OPENSSL_NO_ERR
  952|  1.57k|#ifndef FIPS_MODULE
  953|  1.57k|    OSSL_FUNC_provider_get_reason_strings_fn *p_get_reason_strings = NULL;
  954|  1.57k|#endif
  955|  1.57k|#endif
  956|  1.57k|    int ok = 0;
  957|       |
  958|  1.57k|    if (!ossl_assert(!prov->flag_initialized)) {
  ------------------
  |  |   52|  1.57k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  1.57k|    __FILE__, __LINE__)
  ------------------
  |  Branch (958:9): [True: 0, False: 1.57k]
  ------------------
  959|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  960|      0|        goto end;
  961|      0|    }
  962|       |
  963|       |    /*
  964|       |     * If the init function isn't set, it indicates that this provider is
  965|       |     * a loadable module.
  966|       |     */
  967|  1.57k|    if (prov->init_function == NULL) {
  ------------------
  |  Branch (967:9): [True: 135, False: 1.43k]
  ------------------
  968|       |#ifdef FIPS_MODULE
  969|       |        goto end;
  970|       |#else
  971|    135|        if (prov->module == NULL) {
  ------------------
  |  Branch (971:13): [True: 135, False: 0]
  ------------------
  972|    135|            char *allocated_path = NULL;
  973|    135|            const char *module_path = NULL;
  974|    135|            char *merged_path = NULL;
  975|    135|            const char *load_dir = NULL;
  976|    135|            char *allocated_load_dir = NULL;
  977|    135|            struct provider_store_st *store;
  978|       |
  979|    135|            if ((prov->module = DSO_new()) == NULL) {
  ------------------
  |  Branch (979:17): [True: 0, False: 135]
  ------------------
  980|       |                /* DSO_new() generates an error already */
  981|      0|                goto end;
  982|      0|            }
  983|       |
  984|    135|            if ((store = get_provider_store(prov->libctx)) == NULL
  ------------------
  |  Branch (984:17): [True: 0, False: 135]
  ------------------
  985|    135|                || !CRYPTO_THREAD_read_lock(store->default_path_lock))
  ------------------
  |  Branch (985:20): [True: 0, False: 135]
  ------------------
  986|      0|                goto end;
  987|       |
  988|    135|            if (store->default_path != NULL) {
  ------------------
  |  Branch (988:17): [True: 0, False: 135]
  ------------------
  989|      0|                allocated_load_dir = OPENSSL_strdup(store->default_path);
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  990|      0|                CRYPTO_THREAD_unlock(store->default_path_lock);
  991|      0|                if (allocated_load_dir == NULL)
  ------------------
  |  Branch (991:21): [True: 0, False: 0]
  ------------------
  992|      0|                    goto end;
  993|      0|                load_dir = allocated_load_dir;
  994|    135|            } else {
  995|    135|                CRYPTO_THREAD_unlock(store->default_path_lock);
  996|    135|            }
  997|       |
  998|    135|            if (load_dir == NULL) {
  ------------------
  |  Branch (998:17): [True: 135, False: 0]
  ------------------
  999|    135|                load_dir = ossl_safe_getenv("OPENSSL_MODULES");
 1000|    135|                if (load_dir == NULL)
  ------------------
  |  Branch (1000:21): [True: 135, False: 0]
  ------------------
 1001|    135|                    load_dir = ossl_get_modulesdir();
 1002|    135|            }
 1003|       |
 1004|    135|            DSO_ctrl(prov->module, DSO_CTRL_SET_FLAGS,
  ------------------
  |  |   19|    135|#define DSO_CTRL_SET_FLAGS 2
  ------------------
 1005|    135|                DSO_FLAG_NAME_TRANSLATION_EXT_ONLY, NULL);
  ------------------
  |  |   41|    135|#define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY 0x02
  ------------------
 1006|       |
 1007|    135|            module_path = prov->path;
 1008|    135|            if (module_path == NULL)
  ------------------
  |  Branch (1008:17): [True: 135, False: 0]
  ------------------
 1009|    135|                module_path = allocated_path = DSO_convert_filename(prov->module, prov->name);
 1010|    135|            if (module_path != NULL)
  ------------------
  |  Branch (1010:17): [True: 135, False: 0]
  ------------------
 1011|    135|                merged_path = DSO_merge(prov->module, module_path, load_dir);
 1012|       |
 1013|    135|            if (merged_path == NULL
  ------------------
  |  Branch (1013:17): [True: 0, False: 135]
  ------------------
 1014|    135|                || (DSO_load(prov->module, merged_path, NULL, 0)) == NULL) {
  ------------------
  |  Branch (1014:20): [True: 135, False: 0]
  ------------------
 1015|    135|                DSO_free(prov->module);
 1016|    135|                prov->module = NULL;
 1017|    135|            }
 1018|       |
 1019|    135|            OPENSSL_free(merged_path);
  ------------------
  |  |  131|    135|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1020|    135|            OPENSSL_free(allocated_path);
  ------------------
  |  |  131|    135|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1021|    135|            OPENSSL_free(allocated_load_dir);
  ------------------
  |  |  131|    135|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1022|    135|        }
 1023|       |
 1024|    135|        if (prov->module == NULL) {
  ------------------
  |  Branch (1024:13): [True: 135, False: 0]
  ------------------
 1025|       |            /* DSO has already recorded errors, this is just a tracepoint */
 1026|    135|            ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_DSO_LIB,
  ------------------
  |  |  406|    135|    (ERR_new(),                                                  \
  |  |  407|    135|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|    135|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|    135|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_DSO_LIB,
  ------------------
  |  |   87|    135|#define ERR_LIB_CRYPTO 15
  ------------------
                          ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_DSO_LIB,
  ------------------
  |  |  336|    135|#define ERR_R_DSO_LIB (ERR_LIB_DSO /* 37 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  100|    135|#define ERR_LIB_DSO 37
  |  |  ------------------
  |  |               #define ERR_R_DSO_LIB (ERR_LIB_DSO /* 37 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  239|    135|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  230|    135|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1027|    135|                "name=%s", prov->name);
 1028|    135|            goto end;
 1029|    135|        }
 1030|       |
 1031|      0|        prov->init_function = (OSSL_provider_init_fn *)
 1032|      0|            DSO_bind_func(prov->module, "OSSL_provider_init");
 1033|      0|#endif
 1034|      0|    }
 1035|       |
 1036|       |    /* Check for and call the initialise function for the provider. */
 1037|  1.43k|    if (prov->init_function == NULL) {
  ------------------
  |  Branch (1037:9): [True: 0, False: 1.43k]
  ------------------
 1038|      0|        ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_UNSUPPORTED,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_UNSUPPORTED,
  ------------------
  |  |   87|      0|#define ERR_LIB_CRYPTO 15
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_UNSUPPORTED,
  ------------------
  |  |  364|      0|#define ERR_R_UNSUPPORTED (268 | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1039|      0|            "name=%s, provider has no provider init function",
 1040|      0|            prov->name);
 1041|      0|        goto end;
 1042|      0|    }
 1043|  1.43k|#ifndef FIPS_MODULE
 1044|  1.43k|    OSSL_TRACE_BEGIN(PROVIDER)
  ------------------
  |  |  221|  1.43k|    do {                           \
  |  |  222|  1.43k|        BIO *trc_out = NULL;       \
  |  |  223|  1.43k|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 1.43k]
  |  |  ------------------
  ------------------
 1045|      0|    {
 1046|      0|        BIO_printf(trc_out,
 1047|      0|            "(provider %s) initializing\n", prov->name);
 1048|      0|    }
 1049|  1.43k|    OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  226|  1.43k|    }                            \
  |  |  227|  1.43k|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 1.43k]
  |  |  ------------------
  ------------------
 1050|  1.43k|#endif
 1051|       |
 1052|  1.43k|    if (!prov->init_function((OSSL_CORE_HANDLE *)prov, core_dispatch,
  ------------------
  |  Branch (1052:9): [True: 0, False: 1.43k]
  ------------------
 1053|  1.43k|            &provider_dispatch, &tmp_provctx)) {
 1054|      0|        ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL,
  ------------------
  |  |   87|      0|#define ERR_LIB_CRYPTO 15
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_INIT_FAIL,
  ------------------
  |  |  357|      0|#define ERR_R_INIT_FAIL (261 | ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  351|      0|#define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  238|      0|#define ERR_RFLAG_FATAL (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1055|      0|            "name=%s", prov->name);
 1056|      0|        goto end;
 1057|      0|    }
 1058|  1.43k|    prov->provctx = tmp_provctx;
 1059|  1.43k|    prov->dispatch = provider_dispatch;
 1060|       |
 1061|  1.43k|    if (provider_dispatch != NULL) {
  ------------------
  |  Branch (1061:9): [True: 1.43k, False: 0]
  ------------------
 1062|  7.94k|        for (; provider_dispatch->function_id != 0; provider_dispatch++) {
  ------------------
  |  Branch (1062:16): [True: 6.50k, False: 1.43k]
  ------------------
 1063|  6.50k|            switch (provider_dispatch->function_id) {
  ------------------
  |  Branch (1063:21): [True: 6.50k, False: 0]
  ------------------
 1064|  1.41k|            case OSSL_FUNC_PROVIDER_TEARDOWN:
  ------------------
  |  |  234|  1.41k|#define OSSL_FUNC_PROVIDER_TEARDOWN 1024
  ------------------
  |  Branch (1064:13): [True: 1.41k, False: 5.09k]
  ------------------
 1065|  1.41k|                prov->teardown = OSSL_FUNC_provider_teardown(provider_dispatch);
 1066|  1.41k|                break;
 1067|  1.43k|            case OSSL_FUNC_PROVIDER_GETTABLE_PARAMS:
  ------------------
  |  |  236|  1.43k|#define OSSL_FUNC_PROVIDER_GETTABLE_PARAMS 1025
  ------------------
  |  Branch (1067:13): [True: 1.43k, False: 5.07k]
  ------------------
 1068|  1.43k|                prov->gettable_params = OSSL_FUNC_provider_gettable_params(provider_dispatch);
 1069|  1.43k|                break;
 1070|  1.43k|            case OSSL_FUNC_PROVIDER_GET_PARAMS:
  ------------------
  |  |  239|  1.43k|#define OSSL_FUNC_PROVIDER_GET_PARAMS 1026
  ------------------
  |  Branch (1070:13): [True: 1.43k, False: 5.07k]
  ------------------
 1071|  1.43k|                prov->get_params = OSSL_FUNC_provider_get_params(provider_dispatch);
 1072|  1.43k|                break;
 1073|      0|            case OSSL_FUNC_PROVIDER_SELF_TEST:
  ------------------
  |  |  252|      0|#define OSSL_FUNC_PROVIDER_SELF_TEST 1031
  ------------------
  |  Branch (1073:13): [True: 0, False: 6.50k]
  ------------------
 1074|      0|                prov->self_test = OSSL_FUNC_provider_self_test(provider_dispatch);
 1075|      0|                break;
 1076|      0|            case OSSL_FUNC_PROVIDER_RANDOM_BYTES:
  ------------------
  |  |  254|      0|#define OSSL_FUNC_PROVIDER_RANDOM_BYTES 1032
  ------------------
  |  Branch (1076:13): [True: 0, False: 6.50k]
  ------------------
 1077|      0|                prov->random_bytes = OSSL_FUNC_provider_random_bytes(provider_dispatch);
 1078|      0|                break;
 1079|    787|            case OSSL_FUNC_PROVIDER_GET_CAPABILITIES:
  ------------------
  |  |  250|    787|#define OSSL_FUNC_PROVIDER_GET_CAPABILITIES 1030
  ------------------
  |  Branch (1079:13): [True: 787, False: 5.72k]
  ------------------
 1080|    787|                prov->get_capabilities = OSSL_FUNC_provider_get_capabilities(provider_dispatch);
 1081|    787|                break;
 1082|  1.43k|            case OSSL_FUNC_PROVIDER_QUERY_OPERATION:
  ------------------
  |  |  241|  1.43k|#define OSSL_FUNC_PROVIDER_QUERY_OPERATION 1027
  ------------------
  |  Branch (1082:13): [True: 1.43k, False: 5.07k]
  ------------------
 1083|  1.43k|                prov->query_operation = OSSL_FUNC_provider_query_operation(provider_dispatch);
 1084|  1.43k|                break;
 1085|      0|            case OSSL_FUNC_PROVIDER_UNQUERY_OPERATION:
  ------------------
  |  |  244|      0|#define OSSL_FUNC_PROVIDER_UNQUERY_OPERATION 1028
  ------------------
  |  Branch (1085:13): [True: 0, False: 6.50k]
  ------------------
 1086|      0|                prov->unquery_operation = OSSL_FUNC_provider_unquery_operation(provider_dispatch);
 1087|      0|                break;
 1088|      0|#ifndef OPENSSL_NO_ERR
 1089|      0|#ifndef FIPS_MODULE
 1090|      0|            case OSSL_FUNC_PROVIDER_GET_REASON_STRINGS:
  ------------------
  |  |  247|      0|#define OSSL_FUNC_PROVIDER_GET_REASON_STRINGS 1029
  ------------------
  |  Branch (1090:13): [True: 0, False: 6.50k]
  ------------------
 1091|      0|                p_get_reason_strings = OSSL_FUNC_provider_get_reason_strings(provider_dispatch);
 1092|      0|                break;
 1093|  6.50k|#endif
 1094|  6.50k|#endif
 1095|  6.50k|            }
 1096|  6.50k|        }
 1097|  1.43k|    }
 1098|       |
 1099|  1.43k|#ifndef OPENSSL_NO_ERR
 1100|  1.43k|#ifndef FIPS_MODULE
 1101|  1.43k|    if (p_get_reason_strings != NULL) {
  ------------------
  |  Branch (1101:9): [True: 0, False: 1.43k]
  ------------------
 1102|      0|        const OSSL_ITEM *reasonstrings = p_get_reason_strings(prov->provctx);
 1103|      0|        size_t cnt, cnt2;
 1104|       |
 1105|       |        /*
 1106|       |         * ERR_load_strings() handles ERR_STRING_DATA rather than OSSL_ITEM,
 1107|       |         * although they are essentially the same type.
 1108|       |         * Furthermore, ERR_load_strings() patches the array's error number
 1109|       |         * with the error library number, so we need to make a copy of that
 1110|       |         * array either way.
 1111|       |         */
 1112|      0|        cnt = 0;
 1113|      0|        while (reasonstrings[cnt].id != 0) {
  ------------------
  |  Branch (1113:16): [True: 0, False: 0]
  ------------------
 1114|      0|            if (ERR_GET_LIB(reasonstrings[cnt].id) != 0)
  ------------------
  |  Branch (1114:17): [True: 0, False: 0]
  ------------------
 1115|      0|                goto end;
 1116|      0|            cnt++;
 1117|      0|        }
 1118|      0|        cnt++; /* One for the terminating item */
 1119|       |
 1120|       |        /* Allocate one extra item for the "library" name */
 1121|      0|        prov->error_strings = OPENSSL_calloc(cnt + 1, sizeof(ERR_STRING_DATA));
  ------------------
  |  |  112|      0|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1122|      0|        if (prov->error_strings == NULL)
  ------------------
  |  Branch (1122:13): [True: 0, False: 0]
  ------------------
 1123|      0|            goto end;
 1124|       |
 1125|       |        /*
 1126|       |         * Set the "library" name.
 1127|       |         */
 1128|      0|        prov->error_strings[0].error = ERR_PACK(prov->error_lib, 0, 0);
  ------------------
  |  |  281|      0|    ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  229|      0|#define ERR_LIB_MASK 0xFF
  |  |  ------------------
  |  |                   ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  228|      0|#define ERR_LIB_OFFSET 23L
  |  |  ------------------
  |  |                   ((((unsigned long)(lib) & ERR_LIB_MASK) << ERR_LIB_OFFSET) | (((unsigned long)(reason) & ERR_REASON_MASK)))
  |  |  ------------------
  |  |  |  |  232|      0|#define ERR_REASON_MASK 0X7FFFFF
  |  |  ------------------
  ------------------
 1129|      0|        prov->error_strings[0].string = prov->name;
 1130|       |        /*
 1131|       |         * Copy reasonstrings item 0..cnt-1 to prov->error_trings positions
 1132|       |         * 1..cnt.
 1133|       |         */
 1134|      0|        for (cnt2 = 1; cnt2 <= cnt; cnt2++) {
  ------------------
  |  Branch (1134:24): [True: 0, False: 0]
  ------------------
 1135|      0|            prov->error_strings[cnt2].error = (int)reasonstrings[cnt2 - 1].id;
 1136|      0|            prov->error_strings[cnt2].string = reasonstrings[cnt2 - 1].ptr;
 1137|      0|        }
 1138|       |
 1139|      0|        ERR_load_strings(prov->error_lib, prov->error_strings);
 1140|      0|    }
 1141|  1.43k|#endif
 1142|  1.43k|#endif
 1143|       |
 1144|       |    /* With this flag set, this provider has become fully "loaded". */
 1145|  1.43k|    prov->flag_initialized = 1;
 1146|  1.43k|    ok = 1;
 1147|       |
 1148|  1.57k|end:
 1149|  1.57k|    return ok;
 1150|  1.43k|}
provider_core.c:core_get_params:
 2322|  3.98k|{
 2323|  3.98k|    OSSL_PARAM *p;
 2324|       |    /*
 2325|       |     * We created this object originally and we know it is actually an
 2326|       |     * OSSL_PROVIDER *, so the cast is safe
 2327|       |     */
 2328|  3.98k|    OSSL_PROVIDER *prov = (OSSL_PROVIDER *)handle;
 2329|       |
 2330|  3.98k|    if ((p = OSSL_PARAM_locate(params, OSSL_PROV_PARAM_CORE_VERSION)) != NULL)
  ------------------
  |  |  503|  3.98k|# define OSSL_PROV_PARAM_CORE_VERSION "openssl-version"
  ------------------
  |  Branch (2330:9): [True: 0, False: 3.98k]
  ------------------
 2331|      0|        OSSL_PARAM_set_utf8_ptr(p, OPENSSL_VERSION_STR);
  ------------------
  |  |   90|      0|# define OPENSSL_VERSION_STR "3.6.2"
  ------------------
 2332|  3.98k|    if ((p = OSSL_PARAM_locate(params, OSSL_PROV_PARAM_CORE_PROV_NAME)) != NULL)
  ------------------
  |  |  502|  3.98k|# define OSSL_PROV_PARAM_CORE_PROV_NAME "provider-name"
  ------------------
  |  Branch (2332:9): [True: 0, False: 3.98k]
  ------------------
 2333|      0|        OSSL_PARAM_set_utf8_ptr(p, prov->name);
 2334|       |
 2335|  3.98k|#ifndef FIPS_MODULE
 2336|  3.98k|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (2336:9): [True: 0, False: 3.98k]
  ------------------
 2337|  3.98k|             OSSL_PROV_PARAM_CORE_MODULE_FILENAME))
  ------------------
  |  |  501|  3.98k|# define OSSL_PROV_PARAM_CORE_MODULE_FILENAME "module-filename"
  ------------------
 2338|  3.98k|        != NULL)
 2339|      0|        OSSL_PARAM_set_utf8_ptr(p, ossl_provider_module_path(prov));
 2340|  3.98k|#endif
 2341|       |
 2342|  3.98k|    return OSSL_PROVIDER_get_conf_parameters(prov, params);
 2343|  3.98k|}
provider_core.c:core_get_libctx:
 2346|  1.41k|{
 2347|       |    /*
 2348|       |     * We created this object originally and we know it is actually an
 2349|       |     * OSSL_PROVIDER *, so the cast is safe
 2350|       |     */
 2351|  1.41k|    OSSL_PROVIDER *prov = (OSSL_PROVIDER *)handle;
 2352|       |
 2353|       |    /*
 2354|       |     * Using ossl_provider_libctx would be wrong as that returns
 2355|       |     * NULL for |prov| == NULL and NULL libctx has a special meaning
 2356|       |     * that does not apply here. Here |prov| == NULL can happen only in
 2357|       |     * case of a coding error.
 2358|       |     */
 2359|  1.41k|    assert(prov != NULL);
  ------------------
  |  Branch (2359:5): [True: 0, False: 1.41k]
  |  Branch (2359:5): [True: 1.41k, False: 0]
  ------------------
 2360|  1.41k|    return (OPENSSL_CORE_CTX *)prov->libctx;
 2361|  1.41k|}
provider_core.c:provider_flush_store_cache:
 1324|    649|{
 1325|    649|    struct provider_store_st *store;
 1326|    649|    int freeing;
 1327|       |
 1328|    649|    if ((store = get_provider_store(prov->libctx)) == NULL)
  ------------------
  |  Branch (1328:9): [True: 0, False: 649]
  ------------------
 1329|      0|        return 0;
 1330|       |
 1331|    649|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1331:9): [True: 0, False: 649]
  ------------------
 1332|      0|        return 0;
 1333|    649|    freeing = store->freeing;
 1334|    649|    CRYPTO_THREAD_unlock(store->lock);
 1335|       |
 1336|    649|    if (!freeing) {
  ------------------
  |  Branch (1336:9): [True: 649, False: 0]
  ------------------
 1337|    649|        int acc
 1338|    649|            = evp_method_store_cache_flush(prov->libctx)
 1339|    649|#ifndef FIPS_MODULE
 1340|    649|            + ossl_encoder_store_cache_flush(prov->libctx)
 1341|    649|            + ossl_decoder_store_cache_flush(prov->libctx)
 1342|    649|            + ossl_store_loader_store_cache_flush(prov->libctx)
 1343|    649|#endif
 1344|    649|            ;
 1345|       |
 1346|    649|#ifndef FIPS_MODULE
 1347|    649|        return acc == 4;
 1348|       |#else
 1349|       |        return acc == 1;
 1350|       |#endif
 1351|    649|    }
 1352|      0|    return 1;
 1353|    649|}
provider_core.c:provider_deactivate:
 1160|  2.04k|{
 1161|  2.04k|    int count;
 1162|  2.04k|    struct provider_store_st *store;
 1163|  2.04k|#ifndef FIPS_MODULE
 1164|  2.04k|    int freeparent = 0;
 1165|  2.04k|#endif
 1166|  2.04k|    int lock = 1;
 1167|       |
 1168|  2.04k|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   52|  2.04k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  2.04k|    __FILE__, __LINE__)
  ------------------
  |  Branch (1168:9): [True: 0, False: 2.04k]
  ------------------
 1169|      0|        return -1;
 1170|       |
 1171|  2.04k|#ifndef FIPS_MODULE
 1172|  2.04k|    if (prov->random_bytes != NULL
  ------------------
  |  Branch (1172:9): [True: 0, False: 2.04k]
  ------------------
 1173|      0|        && !ossl_rand_check_random_provider_on_unload(prov->libctx, prov))
  ------------------
  |  Branch (1173:12): [True: 0, False: 0]
  ------------------
 1174|      0|        return -1;
 1175|  2.04k|#endif
 1176|       |
 1177|       |    /*
 1178|       |     * No need to lock if we've got no store because we've not been shared with
 1179|       |     * other threads.
 1180|       |     */
 1181|  2.04k|    store = get_provider_store(prov->libctx);
 1182|  2.04k|    if (store == NULL)
  ------------------
  |  Branch (1182:9): [True: 0, False: 2.04k]
  ------------------
 1183|      0|        lock = 0;
 1184|       |
 1185|  2.04k|    if (lock && !CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1185:9): [True: 2.04k, False: 0]
  |  Branch (1185:17): [True: 0, False: 2.04k]
  ------------------
 1186|      0|        return -1;
 1187|  2.04k|    if (lock && !CRYPTO_THREAD_write_lock(prov->flag_lock)) {
  ------------------
  |  Branch (1187:9): [True: 2.04k, False: 0]
  |  Branch (1187:17): [True: 0, False: 2.04k]
  ------------------
 1188|      0|        CRYPTO_THREAD_unlock(store->lock);
 1189|      0|        return -1;
 1190|      0|    }
 1191|       |
 1192|  2.04k|    if (!CRYPTO_atomic_add(&prov->activatecnt, -1, &count, prov->activatecnt_lock)) {
  ------------------
  |  Branch (1192:9): [True: 0, False: 2.04k]
  ------------------
 1193|      0|        if (lock) {
  ------------------
  |  Branch (1193:13): [True: 0, False: 0]
  ------------------
 1194|      0|            CRYPTO_THREAD_unlock(prov->flag_lock);
 1195|      0|            CRYPTO_THREAD_unlock(store->lock);
 1196|      0|        }
 1197|      0|        return -1;
 1198|      0|    }
 1199|       |
 1200|  2.04k|#ifndef FIPS_MODULE
 1201|  2.04k|    if (count >= 1 && prov->ischild && upcalls) {
  ------------------
  |  Branch (1201:9): [True: 605, False: 1.43k]
  |  Branch (1201:23): [True: 0, False: 605]
  |  Branch (1201:40): [True: 0, False: 0]
  ------------------
 1202|       |        /*
 1203|       |         * We have had a direct activation in this child libctx so we need to
 1204|       |         * now down the ref count in the parent provider. We do the actual down
 1205|       |         * ref outside of the flag_lock, since it could involve getting other
 1206|       |         * locks.
 1207|       |         */
 1208|      0|        freeparent = 1;
 1209|      0|    }
 1210|  2.04k|#endif
 1211|       |
 1212|  2.04k|    if (count < 1)
  ------------------
  |  Branch (1212:9): [True: 1.43k, False: 605]
  ------------------
 1213|  1.43k|        prov->flag_activated = 0;
 1214|    605|#ifndef FIPS_MODULE
 1215|    605|    else
 1216|    605|        removechildren = 0;
 1217|  2.04k|#endif
 1218|       |
 1219|  2.04k|#ifndef FIPS_MODULE
 1220|  2.04k|    if (removechildren && store != NULL) {
  ------------------
  |  Branch (1220:9): [True: 1.43k, False: 605]
  |  Branch (1220:27): [True: 1.43k, False: 0]
  ------------------
 1221|  1.43k|        int i, max = sk_OSSL_PROVIDER_CHILD_CB_num(store->child_cbs);
 1222|  1.43k|        OSSL_PROVIDER_CHILD_CB *child_cb;
 1223|       |
 1224|  1.43k|        for (i = 0; i < max; i++) {
  ------------------
  |  Branch (1224:21): [True: 0, False: 1.43k]
  ------------------
 1225|      0|            child_cb = sk_OSSL_PROVIDER_CHILD_CB_value(store->child_cbs, i);
 1226|      0|            child_cb->remove_cb((OSSL_CORE_HANDLE *)prov, child_cb->cbdata);
 1227|      0|        }
 1228|  1.43k|    }
 1229|  2.04k|#endif
 1230|  2.04k|    if (lock) {
  ------------------
  |  Branch (1230:9): [True: 2.04k, False: 0]
  ------------------
 1231|  2.04k|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1232|  2.04k|        CRYPTO_THREAD_unlock(store->lock);
 1233|       |        /*
 1234|       |         * This can be done outside the lock. We tolerate other threads getting
 1235|       |         * the wrong result briefly when creating OSSL_DECODER_CTXs.
 1236|       |         */
 1237|  2.04k|#ifndef FIPS_MODULE
 1238|  2.04k|        if (count < 1)
  ------------------
  |  Branch (1238:13): [True: 1.43k, False: 605]
  ------------------
 1239|  1.43k|            ossl_decoder_cache_flush(prov->libctx);
 1240|  2.04k|#endif
 1241|  2.04k|    }
 1242|  2.04k|#ifndef FIPS_MODULE
 1243|  2.04k|    if (freeparent)
  ------------------
  |  Branch (1243:9): [True: 0, False: 2.04k]
  ------------------
 1244|      0|        ossl_provider_free_parent(prov, 1);
 1245|  2.04k|#endif
 1246|       |
 1247|       |    /* We don't deinit here, that's done in ossl_provider_free() */
 1248|  2.04k|    return count;
 1249|  2.04k|}
provider_core.c:provider_remove_store_methods:
 1356|  1.43k|{
 1357|  1.43k|    struct provider_store_st *store;
 1358|  1.43k|    int freeing;
 1359|       |
 1360|  1.43k|    if ((store = get_provider_store(prov->libctx)) == NULL)
  ------------------
  |  Branch (1360:9): [True: 0, False: 1.43k]
  ------------------
 1361|      0|        return 0;
 1362|       |
 1363|  1.43k|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1363:9): [True: 0, False: 1.43k]
  ------------------
 1364|      0|        return 0;
 1365|  1.43k|    freeing = store->freeing;
 1366|  1.43k|    CRYPTO_THREAD_unlock(store->lock);
 1367|       |
 1368|  1.43k|    if (!freeing) {
  ------------------
  |  Branch (1368:9): [True: 649, False: 787]
  ------------------
 1369|    649|        int acc;
 1370|       |
 1371|    649|        if (!CRYPTO_THREAD_write_lock(prov->opbits_lock))
  ------------------
  |  Branch (1371:13): [True: 0, False: 649]
  ------------------
 1372|      0|            return 0;
 1373|    649|        OPENSSL_free(prov->operation_bits);
  ------------------
  |  |  131|    649|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1374|    649|        prov->operation_bits = NULL;
 1375|    649|        prov->operation_bits_sz = 0;
 1376|    649|        CRYPTO_THREAD_unlock(prov->opbits_lock);
 1377|       |
 1378|    649|        acc = evp_method_store_remove_all_provided(prov)
 1379|    649|#ifndef FIPS_MODULE
 1380|    649|            + ossl_encoder_store_remove_all_provided(prov)
 1381|    649|            + ossl_decoder_store_remove_all_provided(prov)
 1382|    649|            + ossl_store_loader_store_remove_all_provided(prov)
 1383|    649|#endif
 1384|    649|            ;
 1385|       |
 1386|    649|#ifndef FIPS_MODULE
 1387|    649|        return acc == 4;
 1388|       |#else
 1389|       |        return acc == 1;
 1390|       |#endif
 1391|    649|    }
 1392|    787|    return 1;
 1393|  1.43k|}
provider_core.c:provider_activate_fallbacks:
 1436|  80.7k|{
 1437|  80.7k|    int use_fallbacks;
 1438|  80.7k|    int activated_fallback_count = 0;
 1439|  80.7k|    int ret = 0;
 1440|  80.7k|    const OSSL_PROVIDER_INFO *p;
 1441|       |
 1442|  80.7k|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1442:9): [True: 0, False: 80.7k]
  ------------------
 1443|      0|        return 0;
 1444|  80.7k|    use_fallbacks = store->use_fallbacks;
 1445|  80.7k|    CRYPTO_THREAD_unlock(store->lock);
 1446|  80.7k|    if (!use_fallbacks)
  ------------------
  |  Branch (1446:9): [True: 79.9k, False: 787]
  ------------------
 1447|  79.9k|        return 1;
 1448|       |
 1449|    787|    if (!CRYPTO_THREAD_write_lock(store->lock))
  ------------------
  |  Branch (1449:9): [True: 0, False: 787]
  ------------------
 1450|      0|        return 0;
 1451|       |    /* Check again, just in case another thread changed it */
 1452|    787|    use_fallbacks = store->use_fallbacks;
 1453|    787|    if (!use_fallbacks) {
  ------------------
  |  Branch (1453:9): [True: 0, False: 787]
  ------------------
 1454|      0|        CRYPTO_THREAD_unlock(store->lock);
 1455|      0|        return 1;
 1456|      0|    }
 1457|       |
 1458|  3.14k|    for (p = ossl_predefined_providers; p->name != NULL; p++) {
  ------------------
  |  Branch (1458:41): [True: 2.36k, False: 787]
  ------------------
 1459|  2.36k|        OSSL_PROVIDER *prov = NULL;
 1460|  2.36k|        OSSL_PROVIDER_INFO *info = store->provinfo;
 1461|  2.36k|        STACK_OF(INFOPAIR) *params = NULL;
  ------------------
  |  |   33|  2.36k|#define STACK_OF(type) struct stack_st_##type
  ------------------
 1462|  2.36k|        size_t i;
 1463|       |
 1464|  2.36k|        if (!p->is_fallback)
  ------------------
  |  Branch (1464:13): [True: 1.57k, False: 787]
  ------------------
 1465|  1.57k|            continue;
 1466|       |
 1467|    787|        for (i = 0; i < store->numprovinfo; info++, i++) {
  ------------------
  |  Branch (1467:21): [True: 0, False: 787]
  ------------------
 1468|      0|            if (strcmp(info->name, p->name) != 0)
  ------------------
  |  Branch (1468:17): [True: 0, False: 0]
  ------------------
 1469|      0|                continue;
 1470|      0|            params = info->parameters;
 1471|      0|            break;
 1472|      0|        }
 1473|       |
 1474|       |        /*
 1475|       |         * We use the internal constructor directly here,
 1476|       |         * otherwise we get a call loop
 1477|       |         */
 1478|    787|        prov = provider_new(p->name, p->init, params);
 1479|    787|        if (prov == NULL)
  ------------------
  |  Branch (1479:13): [True: 0, False: 787]
  ------------------
 1480|      0|            goto err;
 1481|    787|        prov->libctx = store->libctx;
 1482|    787|#ifndef FIPS_MODULE
 1483|    787|        prov->error_lib = ERR_get_next_error_library();
 1484|    787|#endif
 1485|       |
 1486|       |        /*
 1487|       |         * We are calling provider_activate while holding the store lock. This
 1488|       |         * means the init function will be called while holding a lock. Normally
 1489|       |         * we try to avoid calling a user callback while holding a lock.
 1490|       |         * However, fallbacks are never third party providers so we accept this.
 1491|       |         */
 1492|    787|        if (provider_activate(prov, 0, 0) < 0) {
  ------------------
  |  Branch (1492:13): [True: 0, False: 787]
  ------------------
 1493|      0|            ossl_provider_free(prov);
 1494|      0|            goto err;
 1495|      0|        }
 1496|    787|        prov->store = store;
 1497|    787|        if (sk_OSSL_PROVIDER_push(store->providers, prov) == 0) {
  ------------------
  |  Branch (1497:13): [True: 0, False: 787]
  ------------------
 1498|      0|            ossl_provider_free(prov);
 1499|      0|            goto err;
 1500|      0|        }
 1501|    787|        activated_fallback_count++;
 1502|    787|    }
 1503|       |
 1504|    787|    if (activated_fallback_count > 0) {
  ------------------
  |  Branch (1504:9): [True: 787, False: 0]
  ------------------
 1505|    787|        store->use_fallbacks = 0;
 1506|    787|        ret = 1;
 1507|    787|    }
 1508|    787|err:
 1509|    787|    CRYPTO_THREAD_unlock(store->lock);
 1510|    787|    return ret;
 1511|    787|}

ossl_err_load_RAND_strings:
  105|      1|{
  106|      1|#ifndef OPENSSL_NO_ERR
  107|      1|    if (ERR_reason_error_string(RAND_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (107:9): [True: 1, False: 0]
  ------------------
  108|      1|        ERR_load_strings_const(RAND_str_reasons);
  109|      1|#endif
  110|      1|    return 1;
  111|      1|}

ossl_rand_cleanup_int:
  163|      1|{
  164|      1|#ifndef OPENSSL_NO_DEPRECATED_3_0
  165|      1|    const RAND_METHOD *meth = default_RAND_meth;
  166|       |
  167|      1|    if (!rand_inited)
  ------------------
  |  Branch (167:9): [True: 0, False: 1]
  ------------------
  168|      0|        return;
  169|       |
  170|      1|    if (meth != NULL && meth->cleanup != NULL)
  ------------------
  |  Branch (170:9): [True: 1, False: 0]
  |  Branch (170:25): [True: 0, False: 1]
  ------------------
  171|      0|        meth->cleanup();
  172|      1|    RAND_set_rand_method(NULL);
  173|      1|#endif /* !OPENSSL_NO_DEPRECATED_3_0 */
  174|      1|    ossl_rand_pool_cleanup();
  175|      1|#ifndef OPENSSL_NO_ENGINE
  176|      1|    CRYPTO_THREAD_lock_free(rand_engine_lock);
  177|      1|    rand_engine_lock = NULL;
  178|      1|#endif /* !OPENSSL_NO_ENGINE */
  179|      1|#ifndef OPENSSL_NO_DEPRECATED_3_0
  180|      1|    CRYPTO_THREAD_lock_free(rand_meth_lock);
  181|       |    rand_meth_lock = NULL;
  182|      1|#endif /* !OPENSSL_NO_DEPRECATED_3_0 */
  183|      1|    ossl_release_default_drbg_ctx();
  184|      1|    rand_inited = 0;
  185|      1|}
RAND_set_rand_method:
  265|      1|{
  266|       |    return rand_set_rand_method_internal(meth, NULL);
  267|      1|}
RAND_get_rand_method:
  270|  46.8k|{
  271|  46.8k|    const RAND_METHOD *tmp_meth = NULL;
  272|       |
  273|  46.8k|    if (!RUN_ONCE(&rand_init, do_rand_init))
  ------------------
  |  |  130|  46.8k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 46.8k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (273:9): [True: 0, False: 46.8k]
  ------------------
  274|      0|        return NULL;
  275|       |
  276|  46.8k|    if (rand_meth_lock == NULL)
  ------------------
  |  Branch (276:9): [True: 0, False: 46.8k]
  ------------------
  277|      0|        return NULL;
  278|       |
  279|  46.8k|    if (!CRYPTO_THREAD_read_lock(rand_meth_lock))
  ------------------
  |  Branch (279:9): [True: 0, False: 46.8k]
  ------------------
  280|      0|        return NULL;
  281|  46.8k|    tmp_meth = default_RAND_meth;
  282|  46.8k|    CRYPTO_THREAD_unlock(rand_meth_lock);
  283|  46.8k|    if (tmp_meth != NULL)
  ------------------
  |  Branch (283:9): [True: 46.8k, False: 1]
  ------------------
  284|  46.8k|        return tmp_meth;
  285|       |
  286|      1|    if (!CRYPTO_THREAD_write_lock(rand_meth_lock))
  ------------------
  |  Branch (286:9): [True: 0, False: 1]
  ------------------
  287|      0|        return NULL;
  288|      1|    if (default_RAND_meth == NULL) {
  ------------------
  |  Branch (288:9): [True: 1, False: 0]
  ------------------
  289|      1|#ifndef OPENSSL_NO_ENGINE
  290|      1|        ENGINE *e;
  291|       |
  292|       |        /* If we have an engine that can do RAND, use it. */
  293|      1|        if ((e = ENGINE_get_default_RAND()) != NULL
  ------------------
  |  Branch (293:13): [True: 0, False: 1]
  ------------------
  294|      0|            && (tmp_meth = ENGINE_get_RAND(e)) != NULL) {
  ------------------
  |  Branch (294:16): [True: 0, False: 0]
  ------------------
  295|      0|            funct_ref = e;
  296|      0|            default_RAND_meth = tmp_meth;
  297|      1|        } else {
  298|      1|            ENGINE_finish(e);
  299|      1|            default_RAND_meth = &ossl_rand_meth;
  300|      1|        }
  301|       |#else
  302|       |        default_RAND_meth = &ossl_rand_meth;
  303|       |#endif
  304|      1|    }
  305|      1|    tmp_meth = default_RAND_meth;
  306|      1|    CRYPTO_THREAD_unlock(rand_meth_lock);
  307|      1|    return tmp_meth;
  308|      1|}
RAND_status:
  392|  14.4k|{
  393|  14.4k|    EVP_RAND_CTX *rand;
  394|  14.4k|#ifndef OPENSSL_NO_DEPRECATED_3_0
  395|  14.4k|    const RAND_METHOD *meth = RAND_get_rand_method();
  396|       |
  397|  14.4k|    if (meth != NULL && meth != RAND_OpenSSL())
  ------------------
  |  Branch (397:9): [True: 14.4k, False: 0]
  |  Branch (397:25): [True: 0, False: 14.4k]
  ------------------
  398|      0|        return meth->status != NULL ? meth->status() : 0;
  ------------------
  |  Branch (398:16): [True: 0, False: 0]
  ------------------
  399|  14.4k|#endif
  400|       |
  401|  14.4k|    if ((rand = RAND_get0_primary(NULL)) == NULL)
  ------------------
  |  Branch (401:9): [True: 0, False: 14.4k]
  ------------------
  402|      0|        return 0;
  403|  14.4k|    return EVP_RAND_get_state(rand) == EVP_RAND_STATE_READY;
  ------------------
  |  | 1346|  14.4k|#define EVP_RAND_STATE_READY 1
  ------------------
  404|  14.4k|}
RAND_priv_bytes_ex:
  422|  12.2k|{
  423|  12.2k|    RAND_GLOBAL *dgbl;
  424|  12.2k|    EVP_RAND_CTX *rand;
  425|  12.2k|#if !defined(OPENSSL_NO_DEPRECATED_3_0) && !defined(FIPS_MODULE)
  426|  12.2k|    const RAND_METHOD *meth = RAND_get_rand_method();
  427|       |
  428|  12.2k|    if (meth != NULL && meth != RAND_OpenSSL()) {
  ------------------
  |  Branch (428:9): [True: 12.2k, False: 0]
  |  Branch (428:25): [True: 0, False: 12.2k]
  ------------------
  429|      0|        if (num > INT_MAX) {
  ------------------
  |  Branch (429:13): [True: 0, False: 0]
  ------------------
  430|      0|            ERR_raise(ERR_LIB_RAND, RAND_R_ARGUMENT_OUT_OF_RANGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  431|      0|            return -1;
  432|      0|        }
  433|      0|        if (meth->bytes != NULL)
  ------------------
  |  Branch (433:13): [True: 0, False: 0]
  ------------------
  434|      0|            return meth->bytes(buf, (int)num);
  435|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  436|      0|        return -1;
  437|      0|    }
  438|  12.2k|#endif
  439|       |
  440|  12.2k|    dgbl = rand_get_global(ctx);
  441|  12.2k|    if (dgbl == NULL)
  ------------------
  |  Branch (441:9): [True: 0, False: 12.2k]
  ------------------
  442|      0|        return 0;
  443|  12.2k|#ifndef FIPS_MODULE
  444|  12.2k|    if (dgbl->random_provider != NULL)
  ------------------
  |  Branch (444:9): [True: 0, False: 12.2k]
  ------------------
  445|      0|        return ossl_provider_random_bytes(dgbl->random_provider,
  446|      0|            OSSL_PROV_RANDOM_PRIVATE,
  ------------------
  |  |  127|      0|#define OSSL_PROV_RANDOM_PRIVATE 1
  ------------------
  447|      0|            buf, num, strength);
  448|  12.2k|#endif /* !FIPS_MODULE */
  449|  12.2k|    rand = rand_get0_private(ctx, dgbl);
  450|  12.2k|    if (rand != NULL)
  ------------------
  |  Branch (450:9): [True: 12.2k, False: 0]
  ------------------
  451|  12.2k|        return EVP_RAND_generate(rand, buf, num, strength, 0, NULL, 0);
  452|       |
  453|      0|    return 0;
  454|  12.2k|}
RAND_bytes_ex:
  465|  20.1k|{
  466|  20.1k|    RAND_GLOBAL *dgbl;
  467|  20.1k|    EVP_RAND_CTX *rand;
  468|  20.1k|#if !defined(OPENSSL_NO_DEPRECATED_3_0) && !defined(FIPS_MODULE)
  469|  20.1k|    const RAND_METHOD *meth = RAND_get_rand_method();
  470|       |
  471|  20.1k|    if (meth != NULL && meth != RAND_OpenSSL()) {
  ------------------
  |  Branch (471:9): [True: 20.1k, False: 0]
  |  Branch (471:25): [True: 0, False: 20.1k]
  ------------------
  472|      0|        if (num > INT_MAX) {
  ------------------
  |  Branch (472:13): [True: 0, False: 0]
  ------------------
  473|      0|            ERR_raise(ERR_LIB_RAND, RAND_R_ARGUMENT_OUT_OF_RANGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  474|      0|            return -1;
  475|      0|        }
  476|      0|        if (meth->bytes != NULL)
  ------------------
  |  Branch (476:13): [True: 0, False: 0]
  ------------------
  477|      0|            return meth->bytes(buf, (int)num);
  478|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  479|      0|        return -1;
  480|      0|    }
  481|  20.1k|#endif
  482|       |
  483|  20.1k|    dgbl = rand_get_global(ctx);
  484|  20.1k|    if (dgbl == NULL)
  ------------------
  |  Branch (484:9): [True: 0, False: 20.1k]
  ------------------
  485|      0|        return 0;
  486|  20.1k|#ifndef FIPS_MODULE
  487|  20.1k|    if (dgbl->random_provider != NULL)
  ------------------
  |  Branch (487:9): [True: 0, False: 20.1k]
  ------------------
  488|      0|        return ossl_provider_random_bytes(dgbl->random_provider,
  489|      0|            OSSL_PROV_RANDOM_PUBLIC,
  ------------------
  |  |  126|      0|#define OSSL_PROV_RANDOM_PUBLIC 0
  ------------------
  490|      0|            buf, num, strength);
  491|  20.1k|#endif /* !FIPS_MODULE */
  492|       |
  493|  20.1k|    rand = rand_get0_public(ctx, dgbl);
  494|  20.1k|    if (rand != NULL)
  ------------------
  |  Branch (494:9): [True: 20.1k, False: 0]
  ------------------
  495|  20.1k|        return EVP_RAND_generate(rand, buf, num, strength, 0, NULL, 0);
  496|       |
  497|      0|    return 0;
  498|  20.1k|}
RAND_bytes:
  501|  14.1k|{
  502|  14.1k|    if (num < 0)
  ------------------
  |  Branch (502:9): [True: 0, False: 14.1k]
  ------------------
  503|      0|        return 0;
  504|  14.1k|    return RAND_bytes_ex(NULL, buf, (size_t)num, 0);
  505|  14.1k|}
ossl_rand_ctx_new:
  512|    787|{
  513|    787|    RAND_GLOBAL *dgbl = OPENSSL_zalloc(sizeof(*dgbl));
  ------------------
  |  |  108|    787|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  514|       |
  515|    787|    if (dgbl == NULL)
  ------------------
  |  Branch (515:9): [True: 0, False: 787]
  ------------------
  516|      0|        return NULL;
  517|       |
  518|    787|#ifndef FIPS_MODULE
  519|       |    /*
  520|       |     * We need to ensure that base libcrypto thread handling has been
  521|       |     * initialised.
  522|       |     */
  523|    787|    OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL);
  ------------------
  |  |   31|    787|#define OPENSSL_INIT_BASE_ONLY 0x00040000L
  ------------------
  524|       |
  525|       |    /* Prepopulate the random provider name */
  526|    787|    dgbl->random_provider_name = OPENSSL_strdup(random_provider_fips_name);
  ------------------
  |  |  135|    787|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  527|    787|    if (dgbl->random_provider_name == NULL)
  ------------------
  |  Branch (527:9): [True: 0, False: 787]
  ------------------
  528|      0|        goto err0;
  529|    787|#endif
  530|       |
  531|    787|    dgbl->lock = CRYPTO_THREAD_lock_new();
  532|    787|    if (dgbl->lock == NULL)
  ------------------
  |  Branch (532:9): [True: 0, False: 787]
  ------------------
  533|      0|        goto err1;
  534|       |
  535|    787|    return dgbl;
  536|       |
  537|      0|err1:
  538|      0|    CRYPTO_THREAD_lock_free(dgbl->lock);
  539|      0|#ifndef FIPS_MODULE
  540|      0|err0:
  541|      0|    OPENSSL_free(dgbl->random_provider_name);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  542|      0|#endif
  543|      0|    OPENSSL_free(dgbl);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  544|       |    return NULL;
  545|      0|}
ossl_rand_ctx_free:
  548|    787|{
  549|    787|    RAND_GLOBAL *dgbl = vdgbl;
  550|       |
  551|    787|    if (dgbl == NULL)
  ------------------
  |  Branch (551:9): [True: 0, False: 787]
  ------------------
  552|      0|        return;
  553|       |
  554|    787|    CRYPTO_THREAD_lock_free(dgbl->lock);
  555|    787|    EVP_RAND_CTX_free(dgbl->primary);
  556|    787|    EVP_RAND_CTX_free(dgbl->seed);
  557|    787|#ifndef FIPS_MODULE
  558|    787|    OPENSSL_free(dgbl->random_provider_name);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  559|    787|#endif /* !FIPS_MODULE */
  560|    787|    OPENSSL_free(dgbl->rng_name);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  561|    787|    OPENSSL_free(dgbl->rng_cipher);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  562|    787|    OPENSSL_free(dgbl->rng_digest);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  563|    787|    OPENSSL_free(dgbl->rng_propq);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  564|    787|    OPENSSL_free(dgbl->seed_name);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  565|    787|    OPENSSL_free(dgbl->seed_propq);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  566|       |
  567|    787|    OPENSSL_free(dgbl);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  568|    787|}
RAND_get0_primary:
  814|  14.4k|{
  815|  14.4k|    RAND_GLOBAL *dgbl = rand_get_global(ctx);
  816|       |
  817|  14.4k|    return dgbl == NULL ? NULL : rand_get0_primary(ctx, dgbl);
  ------------------
  |  Branch (817:12): [True: 0, False: 14.4k]
  ------------------
  818|  14.4k|}
rand_lib.c:do_rand_init:
  131|      1|{
  132|      1|#ifndef OPENSSL_NO_ENGINE
  133|      1|    rand_engine_lock = CRYPTO_THREAD_lock_new();
  134|      1|    if (rand_engine_lock == NULL)
  ------------------
  |  Branch (134:9): [True: 0, False: 1]
  ------------------
  135|      0|        return 0;
  136|      1|#endif /* !OPENSSL_NO_ENGINE */
  137|       |
  138|      1|#ifndef OPENSSL_NO_DEPRECATED_3_0
  139|      1|    rand_meth_lock = CRYPTO_THREAD_lock_new();
  140|      1|    if (rand_meth_lock == NULL)
  ------------------
  |  Branch (140:9): [True: 0, False: 1]
  ------------------
  141|      0|        goto err;
  142|      1|#endif /* !OPENSSL_NO_DEPRECATED_3_0 */
  143|       |
  144|      1|    if (!ossl_rand_pool_init())
  ------------------
  |  Branch (144:9): [True: 0, False: 1]
  ------------------
  145|      0|        goto err;
  146|       |
  147|      1|    rand_inited = 1;
  148|      1|    return 1;
  149|       |
  150|      0|err:
  151|      0|#ifndef OPENSSL_NO_DEPRECATED_3_0
  152|      0|    CRYPTO_THREAD_lock_free(rand_meth_lock);
  153|      0|    rand_meth_lock = NULL;
  154|      0|#endif /* !OPENSSL_NO_DEPRECATED_3_0 */
  155|      0|#ifndef OPENSSL_NO_ENGINE
  156|      0|    CRYPTO_THREAD_lock_free(rand_engine_lock);
  157|       |    rand_engine_lock = NULL;
  158|      0|#endif /* !OPENSSL_NO_ENGINE */
  159|      0|    return 0;
  160|      1|}
rand_lib.c:rand_set_rand_method_internal:
  249|      1|{
  250|      1|    if (!RUN_ONCE(&rand_init, do_rand_init))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (250:9): [True: 0, False: 1]
  ------------------
  251|      0|        return 0;
  252|       |
  253|      1|    if (!CRYPTO_THREAD_write_lock(rand_meth_lock))
  ------------------
  |  Branch (253:9): [True: 0, False: 1]
  ------------------
  254|      0|        return 0;
  255|      1|#ifndef OPENSSL_NO_ENGINE
  256|      1|    ENGINE_finish(funct_ref);
  257|      1|    funct_ref = e;
  258|      1|#endif
  259|      1|    default_RAND_meth = meth;
  260|      1|    CRYPTO_THREAD_unlock(rand_meth_lock);
  261|      1|    return 1;
  262|      1|}
rand_lib.c:rand_get_global:
   83|  49.6k|{
   84|  49.6k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DRBG_INDEX);
  ------------------
  |  |  101|  49.6k|#define OSSL_LIB_CTX_DRBG_INDEX 5
  ------------------
   85|  49.6k|}
rand_lib.c:rand_get0_primary:
  742|  15.5k|{
  743|  15.5k|    EVP_RAND_CTX *ret, *seed, *newseed = NULL, *primary;
  744|       |
  745|  15.5k|    if (dgbl == NULL)
  ------------------
  |  Branch (745:9): [True: 0, False: 15.5k]
  ------------------
  746|      0|        return NULL;
  747|       |
  748|  15.5k|    if (!CRYPTO_THREAD_read_lock(dgbl->lock))
  ------------------
  |  Branch (748:9): [True: 0, False: 15.5k]
  ------------------
  749|      0|        return NULL;
  750|       |
  751|  15.5k|    ret = dgbl->primary;
  752|  15.5k|    seed = dgbl->seed;
  753|  15.5k|    CRYPTO_THREAD_unlock(dgbl->lock);
  754|       |
  755|  15.5k|    if (ret != NULL)
  ------------------
  |  Branch (755:9): [True: 15.0k, False: 549]
  ------------------
  756|  15.0k|        return ret;
  757|       |
  758|    549|#if !defined(FIPS_MODULE) || !defined(OPENSSL_NO_FIPS_JITTER)
  759|       |    /* Create a seed source for libcrypto or jitter enabled FIPS provider */
  760|    549|    if (seed == NULL) {
  ------------------
  |  Branch (760:9): [True: 549, False: 0]
  ------------------
  761|    549|        ERR_set_mark();
  762|    549|        seed = newseed = rand_new_seed(ctx);
  763|    549|        ERR_pop_to_mark();
  764|    549|    }
  765|    549|#endif /* !FIPS_MODULE || !OPENSSL_NO_FIPS_JITTER */
  766|       |
  767|       |#if defined(FIPS_MODULE)
  768|       |    /* The FIPS provider has entropy health tests instead of the primary */
  769|       |    ret = rand_new_crngt(ctx, seed);
  770|       |#else /* FIPS_MODULE */
  771|    549|    ret = rand_new_drbg(ctx, seed, PRIMARY_RESEED_INTERVAL,
  ------------------
  |  |   23|    549|#define PRIMARY_RESEED_INTERVAL (1 << 8)
  ------------------
  772|    549|        PRIMARY_RESEED_TIME_INTERVAL);
  ------------------
  |  |   25|    549|#define PRIMARY_RESEED_TIME_INTERVAL (60 * 60) /* 1 hour */
  ------------------
  773|    549|#endif /* FIPS_MODULE */
  774|       |
  775|       |    /*
  776|       |     * The primary DRBG may be shared between multiple threads so we must
  777|       |     * enable locking.
  778|       |     */
  779|    549|    if (ret == NULL || !EVP_RAND_enable_locking(ret)) {
  ------------------
  |  Branch (779:9): [True: 0, False: 549]
  |  Branch (779:24): [True: 0, False: 549]
  ------------------
  780|      0|        if (ret != NULL) {
  ------------------
  |  Branch (780:13): [True: 0, False: 0]
  ------------------
  781|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_UNABLE_TO_ENABLE_LOCKING);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  782|      0|            EVP_RAND_CTX_free(ret);
  783|      0|        }
  784|      0|        if (newseed == NULL)
  ------------------
  |  Branch (784:13): [True: 0, False: 0]
  ------------------
  785|      0|            return NULL;
  786|       |        /* else carry on and store seed */
  787|      0|        ret = NULL;
  788|      0|    }
  789|       |
  790|    549|    if (!CRYPTO_THREAD_write_lock(dgbl->lock))
  ------------------
  |  Branch (790:9): [True: 0, False: 549]
  ------------------
  791|      0|        return NULL;
  792|       |
  793|    549|    primary = dgbl->primary;
  794|    549|    if (primary != NULL) {
  ------------------
  |  Branch (794:9): [True: 0, False: 549]
  ------------------
  795|      0|        CRYPTO_THREAD_unlock(dgbl->lock);
  796|      0|        EVP_RAND_CTX_free(ret);
  797|      0|        EVP_RAND_CTX_free(newseed);
  798|      0|        return primary;
  799|      0|    }
  800|    549|    if (newseed != NULL)
  ------------------
  |  Branch (800:9): [True: 549, False: 0]
  ------------------
  801|    549|        dgbl->seed = newseed;
  802|    549|    dgbl->primary = ret;
  803|    549|    CRYPTO_THREAD_unlock(dgbl->lock);
  804|       |
  805|    549|    return ret;
  806|    549|}
rand_lib.c:rand_new_seed:
  590|    549|{
  591|    549|    EVP_RAND *rand;
  592|    549|    const char *propq;
  593|    549|    char *name;
  594|    549|    EVP_RAND_CTX *ctx = NULL;
  595|    549|#ifdef OPENSSL_NO_FIPS_JITTER
  596|    549|    RAND_GLOBAL *dgbl = rand_get_global(libctx);
  597|       |
  598|    549|    if (dgbl == NULL)
  ------------------
  |  Branch (598:9): [True: 0, False: 549]
  ------------------
  599|      0|        return NULL;
  600|    549|    propq = dgbl->seed_propq;
  601|    549|    name = dgbl->seed_name != NULL ? dgbl->seed_name
  ------------------
  |  Branch (601:12): [True: 0, False: 549]
  ------------------
  602|    549|                                   : OPENSSL_MSTR(OPENSSL_DEFAULT_SEED_SRC);
  ------------------
  |  |   19|    549|#define OPENSSL_MSTR(x) OPENSSL_MSTR_HELPER(x)
  |  |  ------------------
  |  |  |  |   18|  1.09k|#define OPENSSL_MSTR_HELPER(x) #x
  |  |  ------------------
  ------------------
  603|       |#else /* !OPENSSL_NO_FIPS_JITTER */
  604|       |    name = "JITTER";
  605|       |    propq = "";
  606|       |#endif /* OPENSSL_NO_FIPS_JITTER */
  607|       |
  608|    549|    rand = EVP_RAND_fetch(libctx, name, propq);
  609|    549|    if (rand == NULL) {
  ------------------
  |  Branch (609:9): [True: 0, False: 549]
  ------------------
  610|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_FETCH_DRBG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  611|      0|        goto err;
  612|      0|    }
  613|    549|    ctx = EVP_RAND_CTX_new(rand, NULL);
  614|    549|    EVP_RAND_free(rand);
  615|    549|    if (ctx == NULL) {
  ------------------
  |  Branch (615:9): [True: 0, False: 549]
  ------------------
  616|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_CREATE_DRBG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  617|      0|        goto err;
  618|      0|    }
  619|    549|    if (!EVP_RAND_instantiate(ctx, 0, 0, NULL, 0, NULL)) {
  ------------------
  |  Branch (619:9): [True: 0, False: 549]
  ------------------
  620|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  621|      0|        goto err;
  622|      0|    }
  623|    549|    return ctx;
  624|      0|err:
  625|      0|    EVP_RAND_CTX_free(ctx);
  626|       |    return NULL;
  627|    549|}
rand_lib.c:rand_new_drbg:
  650|  1.64k|{
  651|  1.64k|    EVP_RAND *rand;
  652|  1.64k|    RAND_GLOBAL *dgbl = rand_get_global(libctx);
  653|  1.64k|    EVP_RAND_CTX *ctx;
  654|  1.64k|    OSSL_PARAM params[9], *p = params;
  655|  1.64k|    const OSSL_PARAM *settables;
  656|  1.64k|    const char *prov_name;
  657|  1.64k|    char *name, *cipher;
  658|  1.64k|    int use_df = 1;
  659|       |
  660|  1.64k|    if (dgbl == NULL)
  ------------------
  |  Branch (660:9): [True: 0, False: 1.64k]
  ------------------
  661|      0|        return NULL;
  662|  1.64k|    name = dgbl->rng_name != NULL ? dgbl->rng_name : "CTR-DRBG";
  ------------------
  |  Branch (662:12): [True: 0, False: 1.64k]
  ------------------
  663|  1.64k|    rand = EVP_RAND_fetch(libctx, name, dgbl->rng_propq);
  664|  1.64k|    if (rand == NULL) {
  ------------------
  |  Branch (664:9): [True: 0, False: 1.64k]
  ------------------
  665|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_FETCH_DRBG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  666|      0|        return NULL;
  667|      0|    }
  668|  1.64k|    prov_name = ossl_provider_name(EVP_RAND_get0_provider(rand));
  669|  1.64k|    ctx = EVP_RAND_CTX_new(rand, parent);
  670|  1.64k|    EVP_RAND_free(rand);
  671|  1.64k|    if (ctx == NULL) {
  ------------------
  |  Branch (671:9): [True: 0, False: 1.64k]
  ------------------
  672|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_CREATE_DRBG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  673|      0|        return NULL;
  674|      0|    }
  675|       |
  676|  1.64k|    settables = EVP_RAND_CTX_settable_params(ctx);
  677|  1.64k|    if (OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_CIPHER)) {
  ------------------
  |  |  233|  1.64k|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  127|  1.64k|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  |  Branch (677:9): [True: 1.64k, False: 0]
  ------------------
  678|  1.64k|        cipher = dgbl->rng_cipher != NULL ? dgbl->rng_cipher : "AES-256-CTR";
  ------------------
  |  Branch (678:18): [True: 0, False: 1.64k]
  ------------------
  679|  1.64k|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_CIPHER,
  ------------------
  |  |  233|  1.64k|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  127|  1.64k|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  680|  1.64k|            cipher, 0);
  681|  1.64k|    }
  682|  1.64k|    if (dgbl->rng_digest != NULL
  ------------------
  |  Branch (682:9): [True: 0, False: 1.64k]
  ------------------
  683|      0|        && OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_DIGEST))
  ------------------
  |  |  234|      0|# define OSSL_DRBG_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  128|      0|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  ------------------
  ------------------
  |  Branch (683:12): [True: 0, False: 0]
  ------------------
  684|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_DIGEST,
  ------------------
  |  |  234|      0|# define OSSL_DRBG_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  128|      0|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  ------------------
  ------------------
  685|      0|            dgbl->rng_digest, 0);
  686|  1.64k|    if (prov_name != NULL)
  ------------------
  |  Branch (686:9): [True: 1.64k, False: 0]
  ------------------
  687|  1.64k|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_PROV_PARAM_CORE_PROV_NAME,
  ------------------
  |  |  502|  1.64k|# define OSSL_PROV_PARAM_CORE_PROV_NAME "provider-name"
  ------------------
  688|  1.64k|            (char *)prov_name, 0);
  689|  1.64k|    if (dgbl->rng_propq != NULL)
  ------------------
  |  Branch (689:9): [True: 0, False: 1.64k]
  ------------------
  690|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_PROPERTIES,
  ------------------
  |  |  248|      0|# define OSSL_DRBG_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  132|      0|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
  691|      0|            dgbl->rng_propq, 0);
  692|  1.64k|    if (OSSL_PARAM_locate_const(settables, OSSL_ALG_PARAM_MAC))
  ------------------
  |  |  131|  1.64k|# define OSSL_ALG_PARAM_MAC "mac"
  ------------------
  |  Branch (692:9): [True: 0, False: 1.64k]
  ------------------
  693|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_ALG_PARAM_MAC, "HMAC", 0);
  ------------------
  |  |  131|      0|# define OSSL_ALG_PARAM_MAC "mac"
  ------------------
  694|  1.64k|    if (OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_USE_DF))
  ------------------
  |  |  255|  1.64k|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  |  Branch (694:9): [True: 1.64k, False: 0]
  ------------------
  695|  1.64k|        *p++ = OSSL_PARAM_construct_int(OSSL_DRBG_PARAM_USE_DF, &use_df);
  ------------------
  |  |  255|  1.64k|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  696|  1.64k|    *p++ = OSSL_PARAM_construct_uint(OSSL_DRBG_PARAM_RESEED_REQUESTS,
  ------------------
  |  |  251|  1.64k|# define OSSL_DRBG_PARAM_RESEED_REQUESTS "reseed_requests"
  ------------------
  697|  1.64k|        &reseed_interval);
  698|  1.64k|    *p++ = OSSL_PARAM_construct_time_t(OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL,
  ------------------
  |  |  253|  1.64k|# define OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL "reseed_time_interval"
  ------------------
  699|  1.64k|        &reseed_time_interval);
  700|  1.64k|    *p = OSSL_PARAM_construct_end();
  701|  1.64k|    if (!EVP_RAND_instantiate(ctx, 0, 0, NULL, 0, params)) {
  ------------------
  |  Branch (701:9): [True: 0, False: 1.64k]
  ------------------
  702|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  703|      0|        EVP_RAND_CTX_free(ctx);
  704|      0|        return NULL;
  705|      0|    }
  706|  1.64k|    return ctx;
  707|  1.64k|}
rand_lib.c:rand_get0_public:
  821|  20.1k|{
  822|  20.1k|    EVP_RAND_CTX *rand, *primary;
  823|  20.1k|    OSSL_LIB_CTX *origctx = ctx;
  824|       |
  825|  20.1k|    ctx = ossl_lib_ctx_get_concrete(ctx);
  826|       |
  827|  20.1k|    if (ctx == NULL)
  ------------------
  |  Branch (827:9): [True: 0, False: 20.1k]
  ------------------
  828|      0|        return NULL;
  829|       |
  830|  20.1k|    if (dgbl == NULL)
  ------------------
  |  Branch (830:9): [True: 0, False: 20.1k]
  ------------------
  831|      0|        return NULL;
  832|       |
  833|  20.1k|    rand = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PUB_KEY, ctx);
  834|  20.1k|    if (rand == NULL) {
  ------------------
  |  Branch (834:9): [True: 549, False: 19.6k]
  ------------------
  835|    549|        primary = rand_get0_primary(origctx, dgbl);
  836|    549|        if (primary == NULL)
  ------------------
  |  Branch (836:13): [True: 0, False: 549]
  ------------------
  837|      0|            return NULL;
  838|       |
  839|       |        /*
  840|       |         * If the private is also NULL then this is the first time we've
  841|       |         * used this thread.
  842|       |         */
  843|    549|        if (CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PRIV_KEY, ctx) == NULL
  ------------------
  |  Branch (843:13): [True: 549, False: 0]
  ------------------
  844|    549|            && !ossl_init_thread_start(NULL, ctx, rand_delete_thread_state))
  ------------------
  |  Branch (844:16): [True: 0, False: 549]
  ------------------
  845|      0|            return NULL;
  846|    549|        rand = rand_new_drbg(ctx, primary, SECONDARY_RESEED_INTERVAL,
  ------------------
  |  |   24|    549|#define SECONDARY_RESEED_INTERVAL (1 << 16)
  ------------------
  847|    549|            SECONDARY_RESEED_TIME_INTERVAL);
  ------------------
  |  |   26|    549|#define SECONDARY_RESEED_TIME_INTERVAL (7 * 60) /* 7 minutes */
  ------------------
  848|    549|        if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PUB_KEY, ctx, rand)) {
  ------------------
  |  Branch (848:13): [True: 0, False: 549]
  ------------------
  849|      0|            EVP_RAND_CTX_free(rand);
  850|      0|            rand = NULL;
  851|      0|        }
  852|    549|    }
  853|  20.1k|    return rand;
  854|  20.1k|}
rand_lib.c:rand_delete_thread_state:
  571|    549|{
  572|    549|    OSSL_LIB_CTX *ctx = arg;
  573|    549|    RAND_GLOBAL *dgbl = rand_get_global(ctx);
  574|    549|    EVP_RAND_CTX *rand;
  575|       |
  576|    549|    if (dgbl == NULL)
  ------------------
  |  Branch (576:9): [True: 0, False: 549]
  ------------------
  577|      0|        return;
  578|       |
  579|    549|    rand = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PUB_KEY, ctx);
  580|    549|    CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PUB_KEY, ctx, NULL);
  581|    549|    EVP_RAND_CTX_free(rand);
  582|       |
  583|    549|    rand = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PRIV_KEY, ctx);
  584|       |    CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PRIV_KEY, ctx, NULL);
  585|    549|    EVP_RAND_CTX_free(rand);
  586|    549|}
rand_lib.c:rand_get0_private:
  868|  12.2k|{
  869|  12.2k|    EVP_RAND_CTX *rand, *primary;
  870|  12.2k|    OSSL_LIB_CTX *origctx = ctx;
  871|       |
  872|  12.2k|    ctx = ossl_lib_ctx_get_concrete(ctx);
  873|  12.2k|    if (ctx == NULL)
  ------------------
  |  Branch (873:9): [True: 0, False: 12.2k]
  ------------------
  874|      0|        return NULL;
  875|       |
  876|  12.2k|    rand = CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PRIV_KEY, ctx);
  877|  12.2k|    if (rand == NULL) {
  ------------------
  |  Branch (877:9): [True: 549, False: 11.6k]
  ------------------
  878|    549|        primary = rand_get0_primary(origctx, dgbl);
  879|    549|        if (primary == NULL)
  ------------------
  |  Branch (879:13): [True: 0, False: 549]
  ------------------
  880|      0|            return NULL;
  881|       |
  882|       |        /*
  883|       |         * If the public is also NULL then this is the first time we've
  884|       |         * used this thread.
  885|       |         */
  886|    549|        if (CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PUB_KEY, ctx) == NULL
  ------------------
  |  Branch (886:13): [True: 0, False: 549]
  ------------------
  887|      0|            && !ossl_init_thread_start(NULL, ctx, rand_delete_thread_state))
  ------------------
  |  Branch (887:16): [True: 0, False: 0]
  ------------------
  888|      0|            return NULL;
  889|    549|        rand = rand_new_drbg(ctx, primary, SECONDARY_RESEED_INTERVAL,
  ------------------
  |  |   24|    549|#define SECONDARY_RESEED_INTERVAL (1 << 16)
  ------------------
  890|    549|            SECONDARY_RESEED_TIME_INTERVAL);
  ------------------
  |  |   26|    549|#define SECONDARY_RESEED_TIME_INTERVAL (7 * 60) /* 7 minutes */
  ------------------
  891|    549|        if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_DRBG_PRIV_KEY, ctx, rand)) {
  ------------------
  |  Branch (891:13): [True: 0, False: 549]
  ------------------
  892|      0|            EVP_RAND_CTX_free(rand);
  893|      0|            rand = NULL;
  894|      0|        }
  895|    549|    }
  896|  12.2k|    return rand;
  897|  12.2k|}

RAND_OpenSSL:
   63|  46.8k|{
   64|  46.8k|    return &ossl_rand_meth;
   65|  46.8k|}

ossl_rand_pool_new:
   24|    549|{
   25|    549|    RAND_POOL *pool = OPENSSL_zalloc(sizeof(*pool));
  ------------------
  |  |  108|    549|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|    549|    size_t min_alloc_size = RAND_POOL_MIN_ALLOCATION(secure);
  ------------------
  |  |   59|    549|#define RAND_POOL_MIN_ALLOCATION(secure) ((secure) ? 16 : 48)
  |  |  ------------------
  |  |  |  Branch (59:43): [True: 549, False: 0]
  |  |  ------------------
  ------------------
   27|       |
   28|    549|    if (pool == NULL)
  ------------------
  |  Branch (28:9): [True: 0, False: 549]
  ------------------
   29|      0|        return NULL;
   30|       |
   31|    549|    pool->min_len = min_len;
   32|    549|    pool->max_len = (max_len > RAND_POOL_MAX_LENGTH) ? RAND_POOL_MAX_LENGTH : max_len;
  ------------------
  |  |   36|    549|#define RAND_POOL_MAX_LENGTH (RAND_POOL_FACTOR * 3 * (RAND_DRBG_STRENGTH / 16))
  |  |  ------------------
  |  |  |  |   35|    549|#define RAND_POOL_FACTOR 256
  |  |  ------------------
  |  |               #define RAND_POOL_MAX_LENGTH (RAND_POOL_FACTOR * 3 * (RAND_DRBG_STRENGTH / 16))
  |  |  ------------------
  |  |  |  |   37|    549|#define RAND_DRBG_STRENGTH 256
  |  |  ------------------
  ------------------
                  pool->max_len = (max_len > RAND_POOL_MAX_LENGTH) ? RAND_POOL_MAX_LENGTH : max_len;
  ------------------
  |  |   36|    549|#define RAND_POOL_MAX_LENGTH (RAND_POOL_FACTOR * 3 * (RAND_DRBG_STRENGTH / 16))
  |  |  ------------------
  |  |  |  |   35|    549|#define RAND_POOL_FACTOR 256
  |  |  ------------------
  |  |               #define RAND_POOL_MAX_LENGTH (RAND_POOL_FACTOR * 3 * (RAND_DRBG_STRENGTH / 16))
  |  |  ------------------
  |  |  |  |   37|    549|#define RAND_DRBG_STRENGTH 256
  |  |  ------------------
  ------------------
  |  Branch (32:21): [True: 549, False: 0]
  ------------------
   33|    549|    pool->alloc_len = min_len < min_alloc_size ? min_alloc_size : min_len;
  ------------------
  |  Branch (33:23): [True: 0, False: 549]
  ------------------
   34|    549|    if (pool->alloc_len > pool->max_len)
  ------------------
  |  Branch (34:9): [True: 0, False: 549]
  ------------------
   35|      0|        pool->alloc_len = pool->max_len;
   36|       |
   37|    549|    if (secure)
  ------------------
  |  Branch (37:9): [True: 549, False: 0]
  ------------------
   38|    549|        pool->buffer = OPENSSL_secure_zalloc(pool->alloc_len);
  ------------------
  |  |  141|    549|    CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   39|      0|    else
   40|      0|        pool->buffer = OPENSSL_zalloc(pool->alloc_len);
  ------------------
  |  |  108|      0|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   41|       |
   42|    549|    if (pool->buffer == NULL)
  ------------------
  |  Branch (42:9): [True: 0, False: 549]
  ------------------
   43|      0|        goto err;
   44|       |
   45|    549|    pool->entropy_requested = entropy_requested;
   46|    549|    pool->secure = secure;
   47|    549|    return pool;
   48|       |
   49|      0|err:
   50|      0|    OPENSSL_free(pool);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   51|       |    return NULL;
   52|    549|}
ossl_rand_pool_free:
   88|    549|{
   89|    549|    if (pool == NULL)
  ------------------
  |  Branch (89:9): [True: 0, False: 549]
  ------------------
   90|      0|        return;
   91|       |
   92|       |    /*
   93|       |     * Although it would be advisable from a cryptographical viewpoint,
   94|       |     * we are not allowed to clear attached buffers, since they are passed
   95|       |     * to ossl_rand_pool_attach() as `const unsigned char*`.
   96|       |     * (see corresponding comment in ossl_rand_pool_attach()).
   97|       |     */
   98|    549|    if (!pool->attached) {
  ------------------
  |  Branch (98:9): [True: 549, False: 0]
  ------------------
   99|    549|        if (pool->secure)
  ------------------
  |  Branch (99:13): [True: 549, False: 0]
  ------------------
  100|    549|            OPENSSL_secure_clear_free(pool->buffer, pool->alloc_len);
  ------------------
  |  |  149|    549|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  101|      0|        else
  102|      0|            OPENSSL_clear_free(pool->buffer, pool->alloc_len);
  ------------------
  |  |  129|      0|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  103|    549|    }
  104|       |
  105|    549|    OPENSSL_free(pool);
  ------------------
  |  |  131|    549|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  106|    549|}
ossl_rand_pool_length:
  128|    549|{
  129|    549|    return pool->len;
  130|    549|}
ossl_rand_pool_detach:
  139|    549|{
  140|    549|    unsigned char *ret = pool->buffer;
  141|       |    pool->buffer = NULL;
  142|    549|    pool->entropy = 0;
  143|    549|    return ret;
  144|    549|}
ossl_rand_pool_entropy_available:
  173|    549|{
  174|    549|    if (pool->entropy < pool->entropy_requested)
  ------------------
  |  Branch (174:9): [True: 0, False: 549]
  ------------------
  175|      0|        return 0;
  176|       |
  177|    549|    if (pool->len < pool->min_len)
  ------------------
  |  Branch (177:9): [True: 0, False: 549]
  ------------------
  178|      0|        return 0;
  179|       |
  180|    549|    return pool->entropy;
  181|    549|}
ossl_rand_pool_entropy_needed:
  189|    549|{
  190|    549|    if (pool->entropy < pool->entropy_requested)
  ------------------
  |  Branch (190:9): [True: 549, False: 0]
  ------------------
  191|    549|        return pool->entropy_requested - pool->entropy;
  192|       |
  193|      0|    return 0;
  194|    549|}
ossl_rand_pool_bytes_needed:
  237|    549|{
  238|    549|    size_t bytes_needed;
  239|    549|    size_t entropy_needed = ossl_rand_pool_entropy_needed(pool);
  240|       |
  241|    549|    if (entropy_factor < 1) {
  ------------------
  |  Branch (241:9): [True: 0, False: 549]
  ------------------
  242|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_ARGUMENT_OUT_OF_RANGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  243|      0|        return 0;
  244|      0|    }
  245|       |
  246|    549|    bytes_needed = ENTROPY_TO_BYTES(entropy_needed, entropy_factor);
  ------------------
  |  |  162|    549|    (((bits) * (entropy_factor) + 7) / 8)
  ------------------
  247|       |
  248|    549|    if (bytes_needed > pool->max_len - pool->len) {
  ------------------
  |  Branch (248:9): [True: 0, False: 549]
  ------------------
  249|       |        /* not enough space left */
  250|      0|        ERR_raise_data(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW,
  ------------------
  |  |   99|      0|#define ERR_LIB_RAND 36
  ------------------
                      ERR_raise_data(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW,
  ------------------
  |  |   53|      0|#define RAND_R_RANDOM_POOL_OVERFLOW 125
  ------------------
  251|      0|            "entropy_factor=%u, entropy_needed=%zu, bytes_needed=%zu,"
  252|      0|            "pool->max_len=%zu, pool->len=%zu",
  253|      0|            entropy_factor, entropy_needed, bytes_needed,
  254|      0|            pool->max_len, pool->len);
  255|      0|        return 0;
  256|      0|    }
  257|       |
  258|    549|    if (pool->len < pool->min_len && bytes_needed < pool->min_len - pool->len)
  ------------------
  |  Branch (258:9): [True: 549, False: 0]
  |  Branch (258:38): [True: 0, False: 549]
  ------------------
  259|       |        /* to meet the min_len requirement */
  260|      0|        bytes_needed = pool->min_len - pool->len;
  261|       |
  262|       |    /*
  263|       |     * Make sure the buffer is large enough for the requested amount
  264|       |     * of data. This guarantees that existing code patterns where
  265|       |     * ossl_rand_pool_add_begin, ossl_rand_pool_add_end or ossl_rand_pool_add
  266|       |     * are used to collect entropy data without any error handling
  267|       |     * whatsoever, continue to be valid.
  268|       |     * Furthermore if the allocation here fails once, make sure that
  269|       |     * we don't fall back to a less secure or even blocking random source,
  270|       |     * as that could happen by the existing code patterns.
  271|       |     * This is not a concern for additional data, therefore that
  272|       |     * is not needed if rand_pool_grow fails in other places.
  273|       |     */
  274|    549|    if (!rand_pool_grow(pool, bytes_needed)) {
  ------------------
  |  Branch (274:9): [True: 0, False: 549]
  ------------------
  275|       |        /* persistent error for this pool */
  276|      0|        pool->max_len = pool->len = 0;
  277|      0|        return 0;
  278|      0|    }
  279|       |
  280|    549|    return bytes_needed;
  281|    549|}
ossl_rand_pool_add_begin:
  354|    549|{
  355|    549|    if (len == 0)
  ------------------
  |  Branch (355:9): [True: 0, False: 549]
  ------------------
  356|      0|        return NULL;
  357|       |
  358|    549|    if (len > pool->max_len - pool->len) {
  ------------------
  |  Branch (358:9): [True: 0, False: 549]
  ------------------
  359|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  360|      0|        return NULL;
  361|      0|    }
  362|       |
  363|    549|    if (pool->buffer == NULL) {
  ------------------
  |  Branch (363:9): [True: 0, False: 549]
  ------------------
  364|      0|        ERR_raise(ERR_LIB_RAND, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  365|      0|        return NULL;
  366|      0|    }
  367|       |
  368|       |    /*
  369|       |     * As long as the allocation request stays within the limits given
  370|       |     * by ossl_rand_pool_bytes_needed this rand_pool_grow below is guaranteed
  371|       |     * to succeed, thus no allocation happens.
  372|       |     * We have that only for cases when a pool is used to collect
  373|       |     * additional data. Then the buffer might need to grow here,
  374|       |     * and of course the caller is responsible to check the return
  375|       |     * value of this function.
  376|       |     */
  377|    549|    if (!rand_pool_grow(pool, len))
  ------------------
  |  Branch (377:9): [True: 0, False: 549]
  ------------------
  378|      0|        return NULL;
  379|       |
  380|    549|    return pool->buffer + pool->len;
  381|    549|}
ossl_rand_pool_add_end:
  393|    549|{
  394|    549|    if (len > pool->alloc_len - pool->len) {
  ------------------
  |  Branch (394:9): [True: 0, False: 549]
  ------------------
  395|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  396|      0|        return 0;
  397|      0|    }
  398|       |
  399|    549|    if (len > 0) {
  ------------------
  |  Branch (399:9): [True: 549, False: 0]
  ------------------
  400|    549|        pool->len += len;
  401|    549|        pool->entropy += entropy;
  402|    549|    }
  403|       |
  404|    549|    return 1;
  405|    549|}
ossl_rand_pool_adin_mix_in:
  420|    549|{
  421|    549|    if (adin == NULL || adin_len == 0)
  ------------------
  |  Branch (421:9): [True: 0, False: 549]
  |  Branch (421:25): [True: 0, False: 549]
  ------------------
  422|       |        /* Nothing to mix in -> success */
  423|      0|        return 1;
  424|       |
  425|    549|    if (pool->buffer == NULL) {
  ------------------
  |  Branch (425:9): [True: 0, False: 549]
  ------------------
  426|      0|        ERR_raise(ERR_LIB_RAND, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  427|      0|        return 0;
  428|      0|    }
  429|       |
  430|    549|    if (pool->len == 0) {
  ------------------
  |  Branch (430:9): [True: 0, False: 549]
  ------------------
  431|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_RANDOM_POOL_IS_EMPTY);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  432|      0|        return 0;
  433|      0|    }
  434|       |
  435|    549|    if (adin != NULL && adin_len > 0) {
  ------------------
  |  Branch (435:9): [True: 549, False: 0]
  |  Branch (435:25): [True: 549, False: 0]
  ------------------
  436|    549|        size_t i;
  437|       |
  438|       |        /* xor the additional data into the pool */
  439|  4.94k|        for (i = 0; i < adin_len; ++i)
  ------------------
  |  Branch (439:21): [True: 4.39k, False: 549]
  ------------------
  440|  4.39k|            pool->buffer[i % pool->len] ^= adin[i];
  441|    549|    }
  442|       |
  443|    549|    return 1;
  444|    549|}
rand_pool.c:rand_pool_grow:
  198|  1.09k|{
  199|  1.09k|    if (len > pool->alloc_len - pool->len) {
  ------------------
  |  Branch (199:9): [True: 0, False: 1.09k]
  ------------------
  200|      0|        unsigned char *p;
  201|      0|        const size_t limit = pool->max_len / 2;
  202|      0|        size_t newlen = pool->alloc_len;
  203|       |
  204|      0|        if (pool->attached || len > pool->max_len - pool->len) {
  ------------------
  |  Branch (204:13): [True: 0, False: 0]
  |  Branch (204:31): [True: 0, False: 0]
  ------------------
  205|      0|            ERR_raise(ERR_LIB_RAND, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  206|      0|            return 0;
  207|      0|        }
  208|       |
  209|      0|        do
  210|      0|            newlen = newlen < limit ? newlen * 2 : pool->max_len;
  ------------------
  |  Branch (210:22): [True: 0, False: 0]
  ------------------
  211|      0|        while (len > newlen - pool->len);
  ------------------
  |  Branch (211:16): [True: 0, False: 0]
  ------------------
  212|       |
  213|      0|        if (pool->secure)
  ------------------
  |  Branch (213:13): [True: 0, False: 0]
  ------------------
  214|      0|            p = OPENSSL_secure_zalloc(newlen);
  ------------------
  |  |  141|      0|    CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  215|      0|        else
  216|      0|            p = OPENSSL_zalloc(newlen);
  ------------------
  |  |  108|      0|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  217|      0|        if (p == NULL)
  ------------------
  |  Branch (217:13): [True: 0, False: 0]
  ------------------
  218|      0|            return 0;
  219|      0|        memcpy(p, pool->buffer, pool->len);
  220|      0|        if (pool->secure)
  ------------------
  |  Branch (220:13): [True: 0, False: 0]
  ------------------
  221|      0|            OPENSSL_secure_clear_free(pool->buffer, pool->alloc_len);
  ------------------
  |  |  149|      0|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  222|      0|        else
  223|      0|            OPENSSL_clear_free(pool->buffer, pool->alloc_len);
  ------------------
  |  |  129|      0|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  224|      0|        pool->buffer = p;
  225|      0|        pool->alloc_len = newlen;
  226|      0|    }
  227|  1.09k|    return 1;
  228|  1.09k|}

rsa_ameth.c:rsa_pub_decode:
   77|   299k|{
   78|   299k|    const unsigned char *p;
   79|   299k|    int pklen;
   80|   299k|    X509_ALGOR *alg;
   81|   299k|    RSA *rsa = NULL;
   82|       |
   83|   299k|    if (!X509_PUBKEY_get0_param(NULL, &p, &pklen, &alg, pubkey))
  ------------------
  |  Branch (83:9): [True: 0, False: 299k]
  ------------------
   84|      0|        return 0;
   85|   299k|    if ((rsa = d2i_RSAPublicKey(NULL, &p, pklen)) == NULL)
  ------------------
  |  Branch (85:9): [True: 0, False: 299k]
  ------------------
   86|      0|        return 0;
   87|   299k|    if (!ossl_rsa_param_decode(rsa, alg)) {
  ------------------
  |  Branch (87:9): [True: 0, False: 299k]
  ------------------
   88|      0|        RSA_free(rsa);
   89|      0|        return 0;
   90|      0|    }
   91|       |
   92|   299k|    RSA_clear_flags(rsa, RSA_FLAG_TYPE_MASK);
  ------------------
  |  |  117|   299k|#define RSA_FLAG_TYPE_MASK 0xF000
  ------------------
   93|   299k|    switch (pkey->ameth->pkey_id) {
   94|   299k|    case EVP_PKEY_RSA:
  ------------------
  |  |   63|   299k|#define EVP_PKEY_RSA NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|   299k|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  |  Branch (94:5): [True: 299k, False: 0]
  ------------------
   95|   299k|        RSA_set_flags(rsa, RSA_FLAG_TYPE_RSA);
  ------------------
  |  |  118|   299k|#define RSA_FLAG_TYPE_RSA 0x0000
  ------------------
   96|   299k|        break;
   97|      0|    case EVP_PKEY_RSA_PSS:
  ------------------
  |  |   65|      0|#define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|      0|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (97:5): [True: 0, False: 299k]
  ------------------
   98|      0|        RSA_set_flags(rsa, RSA_FLAG_TYPE_RSASSAPSS);
  ------------------
  |  |  119|      0|#define RSA_FLAG_TYPE_RSASSAPSS 0x1000
  ------------------
   99|      0|        break;
  100|      0|    default:
  ------------------
  |  Branch (100:5): [True: 0, False: 299k]
  ------------------
  101|       |        /* Leave the type bits zero */
  102|      0|        break;
  103|   299k|    }
  104|       |
  105|   299k|    if (!EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, rsa)) {
  ------------------
  |  Branch (105:9): [True: 0, False: 299k]
  ------------------
  106|      0|        RSA_free(rsa);
  107|      0|        return 0;
  108|      0|    }
  109|   299k|    return 1;
  110|   299k|}
rsa_ameth.c:int_rsa_free:
  201|   299k|{
  202|   299k|    RSA_free(pkey->pkey.rsa);
  203|   299k|}

rsa_asn1.c:rsa_cb:
   30|   898k|{
   31|   898k|    if (operation == ASN1_OP_NEW_PRE) {
  ------------------
  |  |  731|   898k|#define ASN1_OP_NEW_PRE 0
  ------------------
  |  Branch (31:9): [True: 299k, False: 598k]
  ------------------
   32|   299k|        *pval = (ASN1_VALUE *)RSA_new();
   33|   299k|        if (*pval != NULL)
  ------------------
  |  Branch (33:13): [True: 299k, False: 0]
  ------------------
   34|   299k|            return 2;
   35|      0|        return 0;
   36|   598k|    } else if (operation == ASN1_OP_FREE_PRE) {
  ------------------
  |  |  733|   598k|#define ASN1_OP_FREE_PRE 2
  ------------------
  |  Branch (36:16): [True: 0, False: 598k]
  ------------------
   37|      0|        RSA_free((RSA *)*pval);
   38|      0|        *pval = NULL;
   39|      0|        return 2;
   40|   598k|    } else if (operation == ASN1_OP_D2I_POST) {
  ------------------
  |  |  736|   598k|#define ASN1_OP_D2I_POST 5
  ------------------
  |  Branch (40:16): [True: 299k, False: 299k]
  ------------------
   41|   299k|        if (((RSA *)*pval)->version != RSA_ASN1_VERSION_MULTI) {
  ------------------
  |  |   60|   299k|#define RSA_ASN1_VERSION_MULTI 1
  ------------------
  |  Branch (41:13): [True: 299k, False: 0]
  ------------------
   42|       |            /* not a multi-prime key, skip */
   43|   299k|            return 1;
   44|   299k|        }
   45|      0|        return (ossl_rsa_multip_calc_product((RSA *)*pval) == 1) ? 2 : 0;
  ------------------
  |  Branch (45:16): [True: 0, False: 0]
  ------------------
   46|   299k|    }
   47|   299k|    return 1;
   48|   898k|}

ossl_rsa_todata:
  262|   299k|{
  263|   299k|    int ret = 0;
  264|   299k|    const BIGNUM *rsa_d = NULL, *rsa_n = NULL, *rsa_e = NULL;
  265|   299k|    STACK_OF(BIGNUM_const) *factors = sk_BIGNUM_const_new_null();
  ------------------
  |  |   33|   299k|#define STACK_OF(type) struct stack_st_##type
  ------------------
  266|   299k|    STACK_OF(BIGNUM_const) *exps = sk_BIGNUM_const_new_null();
  ------------------
  |  |   33|   299k|#define STACK_OF(type) struct stack_st_##type
  ------------------
  267|   299k|    STACK_OF(BIGNUM_const) *coeffs = sk_BIGNUM_const_new_null();
  ------------------
  |  |   33|   299k|#define STACK_OF(type) struct stack_st_##type
  ------------------
  268|       |
  269|   299k|    if (rsa == NULL || factors == NULL || exps == NULL || coeffs == NULL)
  ------------------
  |  Branch (269:9): [True: 0, False: 299k]
  |  Branch (269:24): [True: 0, False: 299k]
  |  Branch (269:43): [True: 0, False: 299k]
  |  Branch (269:59): [True: 0, False: 299k]
  ------------------
  270|      0|        goto err;
  271|       |
  272|   299k|    RSA_get0_key(rsa, &rsa_n, &rsa_e, &rsa_d);
  273|   299k|    ossl_rsa_get0_all_params(rsa, factors, exps, coeffs);
  274|       |
  275|   299k|    if (!ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_N, rsa_n)
  ------------------
  |  |  482|   299k|# define OSSL_PKEY_PARAM_RSA_N "n"
  ------------------
  |  Branch (275:9): [True: 0, False: 299k]
  ------------------
  276|   299k|        || !ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_E, rsa_e))
  ------------------
  |  |  457|   299k|# define OSSL_PKEY_PARAM_RSA_E "e"
  ------------------
  |  Branch (276:12): [True: 0, False: 299k]
  ------------------
  277|      0|        goto err;
  278|       |
  279|       |    /* Check private key data integrity */
  280|   299k|    if (include_private && rsa_d != NULL) {
  ------------------
  |  Branch (280:9): [True: 299k, False: 0]
  |  Branch (280:28): [True: 0, False: 299k]
  ------------------
  281|       |
  282|      0|        if (!ossl_param_build_set_bn(bld, params, OSSL_PKEY_PARAM_RSA_D,
  ------------------
  |  |  453|      0|# define OSSL_PKEY_PARAM_RSA_D "d"
  ------------------
  |  Branch (282:13): [True: 0, False: 0]
  ------------------
  283|      0|                rsa_d)
  284|      0|            || !ossl_param_build_set_multi_key_bn(bld, params,
  ------------------
  |  Branch (284:16): [True: 0, False: 0]
  ------------------
  285|      0|                ossl_rsa_mp_factor_names,
  286|      0|                factors)
  287|      0|            || !ossl_param_build_set_multi_key_bn(bld, params,
  ------------------
  |  Branch (287:16): [True: 0, False: 0]
  ------------------
  288|      0|                ossl_rsa_mp_exp_names, exps)
  289|      0|            || !ossl_param_build_set_multi_key_bn(bld, params,
  ------------------
  |  Branch (289:16): [True: 0, False: 0]
  ------------------
  290|      0|                ossl_rsa_mp_coeff_names,
  291|      0|                coeffs))
  292|      0|            goto err;
  293|      0|    }
  294|       |
  295|       |#if defined(FIPS_MODULE) && !defined(OPENSSL_NO_ACVP_TESTS)
  296|       |    /* The acvp test results are not meant for export so check for bld == NULL */
  297|       |    if (bld == NULL)
  298|       |        ossl_rsa_acvp_test_get_params(rsa, params);
  299|       |#endif
  300|   299k|    ret = 1;
  301|   299k|err:
  302|   299k|    sk_BIGNUM_const_free(factors);
  303|   299k|    sk_BIGNUM_const_free(exps);
  304|   299k|    sk_BIGNUM_const_free(coeffs);
  305|   299k|    return ret;
  306|   299k|}
ossl_rsa_is_foreign:
  452|   299k|{
  453|   299k|#ifndef FIPS_MODULE
  454|   299k|    if (rsa->engine != NULL || RSA_get_method(rsa) != RSA_PKCS1_OpenSSL())
  ------------------
  |  Branch (454:9): [True: 0, False: 299k]
  |  Branch (454:32): [True: 0, False: 299k]
  ------------------
  455|      0|        return 1;
  456|   299k|#endif
  457|   299k|    return 0;
  458|   299k|}
ossl_rsa_param_decode:
  653|   299k|{
  654|   299k|    RSA_PSS_PARAMS *pss;
  655|   299k|    const ASN1_OBJECT *algoid;
  656|   299k|    const void *algp;
  657|   299k|    int algptype;
  658|       |
  659|   299k|    X509_ALGOR_get0(&algoid, &algptype, &algp, alg);
  660|   299k|    if (OBJ_obj2nid(algoid) != EVP_PKEY_RSA_PSS)
  ------------------
  |  |   65|   299k|#define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|   299k|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  |  Branch (660:9): [True: 299k, False: 0]
  ------------------
  661|   299k|        return 1;
  662|      0|    if (algptype == V_ASN1_UNDEF)
  ------------------
  |  |   62|      0|#define V_ASN1_UNDEF -1
  ------------------
  |  Branch (662:9): [True: 0, False: 0]
  ------------------
  663|      0|        return 1;
  664|      0|    if (algptype != V_ASN1_SEQUENCE) {
  ------------------
  |  |   76|      0|#define V_ASN1_SEQUENCE 16
  ------------------
  |  Branch (664:9): [True: 0, False: 0]
  ------------------
  665|      0|        ERR_raise(ERR_LIB_RSA, RSA_R_INVALID_PSS_PARAMETERS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  666|      0|        return 0;
  667|      0|    }
  668|      0|    if ((pss = ossl_rsa_pss_decode(alg)) == NULL
  ------------------
  |  Branch (668:9): [True: 0, False: 0]
  ------------------
  669|      0|        || !ossl_rsa_set0_pss_params(rsa, pss)) {
  ------------------
  |  Branch (669:12): [True: 0, False: 0]
  ------------------
  670|      0|        RSA_PSS_PARAMS_free(pss);
  671|      0|        return 0;
  672|      0|    }
  673|      0|    if (!ossl_rsa_sync_to_pss_params_30(rsa))
  ------------------
  |  Branch (673:9): [True: 0, False: 0]
  ------------------
  674|      0|        return 0;
  675|      0|    return 1;
  676|      0|}

RSA_bits:
   24|   299k|{
   25|   299k|    return BN_num_bits(r->n);
   26|   299k|}
RSA_size:
   29|   299k|{
   30|   299k|    return BN_num_bytes(r->n);
  ------------------
  |  |  188|   299k|#define BN_num_bytes(a) ((BN_num_bits(a) + 7) / 8)
  ------------------
   31|   299k|}

ossl_err_load_RSA_strings:
  160|      1|{
  161|      1|#ifndef OPENSSL_NO_ERR
  162|      1|    if (ERR_reason_error_string(RSA_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (162:9): [True: 1, False: 0]
  ------------------
  163|      1|        ERR_load_strings_const(RSA_str_reasons);
  164|      1|#endif
  165|      1|    return 1;
  166|      1|}

RSA_new:
   36|   299k|{
   37|   299k|    return rsa_new_intern(NULL, NULL);
   38|   299k|}
RSA_get_method:
   41|   299k|{
   42|   299k|    return rsa->meth;
   43|   299k|}
RSA_free:
  142|   898k|{
  143|   898k|    int i;
  144|       |
  145|   898k|    if (r == NULL)
  ------------------
  |  Branch (145:9): [True: 299k, False: 598k]
  ------------------
  146|   299k|        return;
  147|       |
  148|   598k|    CRYPTO_DOWN_REF(&r->references, &i);
  149|   598k|    REF_PRINT_COUNT("RSA", i, r);
  ------------------
  |  |  301|   598k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|   598k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  297|   598k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  285|   598k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  150|   598k|    if (i > 0)
  ------------------
  |  Branch (150:9): [True: 299k, False: 299k]
  ------------------
  151|   299k|        return;
  152|   299k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|   299k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 299k]
  |  |  ------------------
  ------------------
  153|       |
  154|   299k|    if (r->meth != NULL && r->meth->finish != NULL)
  ------------------
  |  Branch (154:9): [True: 299k, False: 0]
  |  Branch (154:28): [True: 299k, False: 0]
  ------------------
  155|   299k|        r->meth->finish(r);
  156|   299k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  157|   299k|    ENGINE_finish(r->engine);
  158|   299k|#endif
  159|       |
  160|   299k|#ifndef FIPS_MODULE
  161|   299k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_RSA, r, &r->ex_data);
  ------------------
  |  |  259|   299k|#define CRYPTO_EX_INDEX_RSA 9
  ------------------
  162|   299k|#endif
  163|       |
  164|   299k|    CRYPTO_THREAD_lock_free(r->lock);
  165|   299k|    CRYPTO_FREE_REF(&r->references);
  166|       |
  167|       |#ifdef OPENSSL_PEDANTIC_ZEROIZATION
  168|       |    BN_clear_free(r->n);
  169|       |    BN_clear_free(r->e);
  170|       |#else
  171|   299k|    BN_free(r->n);
  172|   299k|    BN_free(r->e);
  173|   299k|#endif
  174|   299k|    BN_clear_free(r->d);
  175|   299k|    BN_clear_free(r->p);
  176|   299k|    BN_clear_free(r->q);
  177|   299k|    BN_clear_free(r->dmp1);
  178|   299k|    BN_clear_free(r->dmq1);
  179|   299k|    BN_clear_free(r->iqmp);
  180|       |
  181|       |#if defined(FIPS_MODULE) && !defined(OPENSSL_NO_ACVP_TESTS)
  182|       |    ossl_rsa_acvp_test_free(r->acvp_test);
  183|       |#endif
  184|       |
  185|   299k|#ifndef FIPS_MODULE
  186|   299k|    RSA_PSS_PARAMS_free(r->pss);
  187|   299k|    sk_RSA_PRIME_INFO_pop_free(r->prime_infos, ossl_rsa_multip_info_free);
  188|   299k|#endif
  189|   299k|    ossl_rsa_free_blinding(r);
  190|   299k|    OPENSSL_free(r);
  ------------------
  |  |  131|   299k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  191|   299k|}
RSA_up_ref:
  194|   299k|{
  195|   299k|    int i;
  196|       |
  197|   299k|    if (CRYPTO_UP_REF(&r->references, &i) <= 0)
  ------------------
  |  Branch (197:9): [True: 0, False: 299k]
  ------------------
  198|      0|        return 0;
  199|       |
  200|   299k|    REF_PRINT_COUNT("RSA", i, r);
  ------------------
  |  |  301|   299k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|   299k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  297|   299k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  285|   299k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  201|   299k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|   299k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 299k]
  |  |  ------------------
  ------------------
  202|   299k|    return i > 1 ? 1 : 0;
  ------------------
  |  Branch (202:12): [True: 299k, False: 0]
  ------------------
  203|   299k|}
ossl_rsa_set0_libctx:
  211|   299k|{
  212|   299k|    r->libctx = libctx;
  213|   299k|}
ossl_ifc_ffc_compute_security_bits:
  327|   299k|{
  328|   299k|    uint64_t x;
  329|   299k|    uint32_t lx;
  330|   299k|    uint16_t y, cap;
  331|       |
  332|       |    /*
  333|       |     * Look for common values as listed in standards.
  334|       |     * These values are not exactly equal to the results from the formulae in
  335|       |     * the standards but are defined to be canonical.
  336|       |     */
  337|   299k|    switch (n) {
  ------------------
  |  Branch (337:13): [True: 299k, False: 0]
  ------------------
  338|   121k|    case 2048: /* SP 800-56B rev 2 Appendix D and FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (338:5): [True: 121k, False: 177k]
  ------------------
  339|   121k|        return 112;
  340|      9|    case 3072: /* SP 800-56B rev 2 Appendix D and FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (340:5): [True: 9, False: 299k]
  ------------------
  341|      9|        return 128;
  342|   177k|    case 4096: /* SP 800-56B rev 2 Appendix D */
  ------------------
  |  Branch (342:5): [True: 177k, False: 121k]
  ------------------
  343|   177k|        return 152;
  344|     11|    case 6144: /* SP 800-56B rev 2 Appendix D */
  ------------------
  |  Branch (344:5): [True: 11, False: 299k]
  ------------------
  345|     11|        return 176;
  346|      0|    case 7680: /* FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (346:5): [True: 0, False: 299k]
  ------------------
  347|      0|        return 192;
  348|     26|    case 8192: /* SP 800-56B rev 2 Appendix D */
  ------------------
  |  Branch (348:5): [True: 26, False: 299k]
  ------------------
  349|     26|        return 200;
  350|      0|    case 15360: /* FIPS 140-2 IG 7.5 */
  ------------------
  |  Branch (350:5): [True: 0, False: 299k]
  ------------------
  351|      0|        return 256;
  352|   299k|    }
  353|       |
  354|       |    /*
  355|       |     * The first incorrect result (i.e. not accurate or off by one low) occurs
  356|       |     * for n = 699668.  The true value here is 1200.  Instead of using this n
  357|       |     * as the check threshold, the smallest n such that the correct result is
  358|       |     * 1200 is used instead.
  359|       |     */
  360|      0|    if (n >= 687737)
  ------------------
  |  Branch (360:9): [True: 0, False: 0]
  ------------------
  361|      0|        return 1200;
  362|      0|    if (n < 8)
  ------------------
  |  Branch (362:9): [True: 0, False: 0]
  ------------------
  363|      0|        return 0;
  364|       |
  365|       |    /*
  366|       |     * To ensure that the output is non-decreasing with respect to n,
  367|       |     * a cap needs to be applied to the two values where the function over
  368|       |     * estimates the strength (according to the above fast path).
  369|       |     */
  370|      0|    if (n <= 7680)
  ------------------
  |  Branch (370:9): [True: 0, False: 0]
  ------------------
  371|      0|        cap = 192;
  372|      0|    else if (n <= 15360)
  ------------------
  |  Branch (372:14): [True: 0, False: 0]
  ------------------
  373|      0|        cap = 256;
  374|      0|    else
  375|      0|        cap = 1200;
  376|       |
  377|      0|    x = n * (uint64_t)log_2;
  378|      0|    lx = ilog_e(x);
  379|      0|    y = (uint16_t)((mul2(c1_923, icbrt64(mul2(mul2(x, lx), lx))) - c4_690)
  380|      0|        / log_2);
  381|      0|    y = (y + 4) & ~7;
  382|      0|    if (y > cap)
  ------------------
  |  Branch (382:9): [True: 0, False: 0]
  ------------------
  383|      0|        y = cap;
  384|      0|    return y;
  385|      0|}
RSA_security_bits:
  388|   299k|{
  389|   299k|    int bits = BN_num_bits(rsa->n);
  390|       |
  391|   299k|#ifndef FIPS_MODULE
  392|   299k|    if (rsa->version == RSA_ASN1_VERSION_MULTI) {
  ------------------
  |  |   60|   299k|#define RSA_ASN1_VERSION_MULTI 1
  ------------------
  |  Branch (392:9): [True: 0, False: 299k]
  ------------------
  393|       |        /* This ought to mean that we have private key at hand. */
  394|      0|        int ex_primes = sk_RSA_PRIME_INFO_num(rsa->prime_infos);
  395|       |
  396|      0|        if (ex_primes <= 0 || (ex_primes + 2) > ossl_rsa_multip_cap(bits))
  ------------------
  |  Branch (396:13): [True: 0, False: 0]
  |  Branch (396:31): [True: 0, False: 0]
  ------------------
  397|      0|            return 0;
  398|      0|    }
  399|   299k|#endif
  400|   299k|    return ossl_ifc_ffc_compute_security_bits(bits);
  401|   299k|}
RSA_get0_key:
  558|   299k|{
  559|   299k|    if (n != NULL)
  ------------------
  |  Branch (559:9): [True: 299k, False: 0]
  ------------------
  560|   299k|        *n = r->n;
  561|   299k|    if (e != NULL)
  ------------------
  |  Branch (561:9): [True: 299k, False: 0]
  ------------------
  562|   299k|        *e = r->e;
  563|   299k|    if (d != NULL)
  ------------------
  |  Branch (563:9): [True: 299k, False: 0]
  ------------------
  564|   299k|        *d = r->d;
  565|   299k|}
RSA_get0_n:
  648|   898k|{
  649|   898k|    return r->n;
  650|   898k|}
RSA_get0_d:
  658|   299k|{
  659|   299k|    return r->d;
  660|   299k|}
RSA_get0_p:
  663|   598k|{
  664|   598k|    return r->p;
  665|   598k|}
ossl_rsa_get0_pss_params_30:
  710|   299k|{
  711|   299k|    return &r->pss_params;
  712|   299k|}
RSA_clear_flags:
  715|   299k|{
  716|   299k|    r->flags &= ~flags;
  717|   299k|}
RSA_test_flags:
  720|   898k|{
  721|   898k|    return r->flags & flags;
  722|   898k|}
RSA_set_flags:
  725|   299k|{
  726|   299k|    r->flags |= flags;
  727|   299k|}
ossl_rsa_get0_all_params:
  879|   598k|{
  880|   598k|#ifndef FIPS_MODULE
  881|   598k|    RSA_PRIME_INFO *pinfo;
  882|   598k|    int i, pnum;
  883|   598k|#endif
  884|       |
  885|   598k|    if (r == NULL)
  ------------------
  |  Branch (885:9): [True: 0, False: 598k]
  ------------------
  886|      0|        return 0;
  887|       |
  888|       |    /* If |p| is NULL, there are no CRT parameters */
  889|   598k|    if (RSA_get0_p(r) == NULL)
  ------------------
  |  Branch (889:9): [True: 598k, False: 0]
  ------------------
  890|   598k|        return 1;
  891|       |
  892|      0|    sk_BIGNUM_const_push(primes, RSA_get0_p(r));
  893|      0|    sk_BIGNUM_const_push(primes, RSA_get0_q(r));
  894|      0|    sk_BIGNUM_const_push(exps, RSA_get0_dmp1(r));
  895|      0|    sk_BIGNUM_const_push(exps, RSA_get0_dmq1(r));
  896|      0|    sk_BIGNUM_const_push(coeffs, RSA_get0_iqmp(r));
  897|       |
  898|      0|#ifndef FIPS_MODULE
  899|      0|    pnum = RSA_get_multi_prime_extra_count(r);
  900|      0|    for (i = 0; i < pnum; i++) {
  ------------------
  |  Branch (900:17): [True: 0, False: 0]
  ------------------
  901|      0|        pinfo = sk_RSA_PRIME_INFO_value(r->prime_infos, i);
  902|      0|        sk_BIGNUM_const_push(primes, pinfo->r);
  903|      0|        sk_BIGNUM_const_push(exps, pinfo->d);
  904|      0|        sk_BIGNUM_const_push(coeffs, pinfo->t);
  905|      0|    }
  906|      0|#endif
  907|       |
  908|      0|    return 1;
  909|   598k|}
ossl_rsa_check_factors:
  913|   299k|{
  914|   299k|    int valid = 0;
  915|   299k|    int n, i, bits;
  916|   299k|    STACK_OF(BIGNUM_const) *factors = sk_BIGNUM_const_new_null();
  ------------------
  |  |   33|   299k|#define STACK_OF(type) struct stack_st_##type
  ------------------
  917|   299k|    STACK_OF(BIGNUM_const) *exps = sk_BIGNUM_const_new_null();
  ------------------
  |  |   33|   299k|#define STACK_OF(type) struct stack_st_##type
  ------------------
  918|   299k|    STACK_OF(BIGNUM_const) *coeffs = sk_BIGNUM_const_new_null();
  ------------------
  |  |   33|   299k|#define STACK_OF(type) struct stack_st_##type
  ------------------
  919|       |
  920|   299k|    if (factors == NULL || exps == NULL || coeffs == NULL)
  ------------------
  |  Branch (920:9): [True: 0, False: 299k]
  |  Branch (920:28): [True: 0, False: 299k]
  |  Branch (920:44): [True: 0, False: 299k]
  ------------------
  921|      0|        goto done;
  922|       |
  923|       |    /*
  924|       |     * Simple sanity check for RSA key. All RSA key parameters
  925|       |     * must be less-than/equal-to RSA parameter n.
  926|       |     */
  927|   299k|    ossl_rsa_get0_all_params(r, factors, exps, coeffs);
  928|   299k|    n = safe_BN_num_bits(RSA_get0_n(r));
  ------------------
  |  |  911|   299k|#define safe_BN_num_bits(_k_) (((_k_) == NULL) ? 0 : BN_num_bits((_k_)))
  |  |  ------------------
  |  |  |  Branch (911:32): [True: 0, False: 299k]
  |  |  ------------------
  ------------------
  929|       |
  930|   299k|    if (safe_BN_num_bits(RSA_get0_d(r)) > n)
  ------------------
  |  |  911|   299k|#define safe_BN_num_bits(_k_) (((_k_) == NULL) ? 0 : BN_num_bits((_k_)))
  |  |  ------------------
  |  |  |  Branch (911:32): [True: 299k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (930:9): [True: 0, False: 299k]
  ------------------
  931|      0|        goto done;
  932|       |
  933|   299k|    for (i = 0; i < sk_BIGNUM_const_num(exps); i++) {
  ------------------
  |  Branch (933:17): [True: 0, False: 299k]
  ------------------
  934|      0|        bits = safe_BN_num_bits(sk_BIGNUM_const_value(exps, i));
  ------------------
  |  |  911|      0|#define safe_BN_num_bits(_k_) (((_k_) == NULL) ? 0 : BN_num_bits((_k_)))
  |  |  ------------------
  |  |  |  Branch (911:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  935|      0|        if (bits > n)
  ------------------
  |  Branch (935:13): [True: 0, False: 0]
  ------------------
  936|      0|            goto done;
  937|      0|    }
  938|       |
  939|   299k|    for (i = 0; i < sk_BIGNUM_const_num(factors); i++) {
  ------------------
  |  Branch (939:17): [True: 0, False: 299k]
  ------------------
  940|      0|        bits = safe_BN_num_bits(sk_BIGNUM_const_value(factors, i));
  ------------------
  |  |  911|      0|#define safe_BN_num_bits(_k_) (((_k_) == NULL) ? 0 : BN_num_bits((_k_)))
  |  |  ------------------
  |  |  |  Branch (911:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  941|      0|        if (bits > n)
  ------------------
  |  Branch (941:13): [True: 0, False: 0]
  ------------------
  942|      0|            goto done;
  943|      0|    }
  944|       |
  945|   299k|    for (i = 0; i < sk_BIGNUM_const_num(coeffs); i++) {
  ------------------
  |  Branch (945:17): [True: 0, False: 299k]
  ------------------
  946|      0|        bits = safe_BN_num_bits(sk_BIGNUM_const_value(coeffs, i));
  ------------------
  |  |  911|      0|#define safe_BN_num_bits(_k_) (((_k_) == NULL) ? 0 : BN_num_bits((_k_)))
  |  |  ------------------
  |  |  |  Branch (911:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  947|      0|        if (bits > n)
  ------------------
  |  Branch (947:13): [True: 0, False: 0]
  ------------------
  948|      0|            goto done;
  949|      0|    }
  950|       |
  951|   299k|    valid = 1;
  952|       |
  953|   299k|done:
  954|   299k|    sk_BIGNUM_const_free(factors);
  955|   299k|    sk_BIGNUM_const_free(exps);
  956|   299k|    sk_BIGNUM_const_free(coeffs);
  957|       |
  958|   299k|    return valid;
  959|   299k|}
rsa_lib.c:rsa_new_intern:
   77|   299k|{
   78|   299k|    RSA *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|   299k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|       |
   80|   299k|    if (ret == NULL)
  ------------------
  |  Branch (80:9): [True: 0, False: 299k]
  ------------------
   81|      0|        return NULL;
   82|       |
   83|   299k|    ret->lock = CRYPTO_THREAD_lock_new();
   84|   299k|    if (ret->lock == NULL) {
  ------------------
  |  Branch (84:9): [True: 0, False: 299k]
  ------------------
   85|      0|        ERR_raise(ERR_LIB_RSA, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   86|      0|        OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   87|      0|        return NULL;
   88|      0|    }
   89|       |
   90|   299k|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (90:9): [True: 0, False: 299k]
  ------------------
   91|      0|        CRYPTO_THREAD_lock_free(ret->lock);
   92|      0|        OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|      0|        return NULL;
   94|      0|    }
   95|       |
   96|   299k|    ret->blindings_sa = ossl_rsa_alloc_blinding();
   97|   299k|    if (ret->blindings_sa == NULL)
  ------------------
  |  Branch (97:9): [True: 0, False: 299k]
  ------------------
   98|      0|        goto err;
   99|       |
  100|   299k|    ret->libctx = libctx;
  101|   299k|    ret->meth = RSA_get_default_method();
  102|   299k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  103|   299k|    ret->flags = ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW;
  ------------------
  |  |  476|   299k|#define RSA_FLAG_NON_FIPS_ALLOW 0x0400
  ------------------
  104|   299k|    if (engine) {
  ------------------
  |  Branch (104:9): [True: 0, False: 299k]
  ------------------
  105|      0|        if (!ENGINE_init(engine)) {
  ------------------
  |  Branch (105:13): [True: 0, False: 0]
  ------------------
  106|      0|            ERR_raise(ERR_LIB_RSA, ERR_R_ENGINE_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  107|      0|            goto err;
  108|      0|        }
  109|      0|        ret->engine = engine;
  110|   299k|    } else {
  111|   299k|        ret->engine = ENGINE_get_default_RSA();
  112|   299k|    }
  113|   299k|    if (ret->engine) {
  ------------------
  |  Branch (113:9): [True: 0, False: 299k]
  ------------------
  114|      0|        ret->meth = ENGINE_get_RSA(ret->engine);
  115|      0|        if (ret->meth == NULL) {
  ------------------
  |  Branch (115:13): [True: 0, False: 0]
  ------------------
  116|      0|            ERR_raise(ERR_LIB_RSA, ERR_R_ENGINE_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  117|      0|            goto err;
  118|      0|        }
  119|      0|    }
  120|   299k|#endif
  121|       |
  122|   299k|    ret->flags = ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW;
  ------------------
  |  |  476|   299k|#define RSA_FLAG_NON_FIPS_ALLOW 0x0400
  ------------------
  123|   299k|#ifndef FIPS_MODULE
  124|   299k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_RSA, ret, &ret->ex_data)) {
  ------------------
  |  |  259|   299k|#define CRYPTO_EX_INDEX_RSA 9
  ------------------
  |  Branch (124:9): [True: 0, False: 299k]
  ------------------
  125|      0|        goto err;
  126|      0|    }
  127|   299k|#endif
  128|       |
  129|   299k|    if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
  ------------------
  |  Branch (129:9): [True: 299k, False: 0]
  |  Branch (129:38): [True: 0, False: 299k]
  ------------------
  130|      0|        ERR_raise(ERR_LIB_RSA, ERR_R_INIT_FAIL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  131|      0|        goto err;
  132|      0|    }
  133|       |
  134|   299k|    return ret;
  135|       |
  136|      0|err:
  137|      0|    RSA_free(ret);
  138|       |    return NULL;
  139|   299k|}

RSA_get_default_method:
   92|   299k|{
   93|   299k|    return default_RSA_meth;
   94|   299k|}
RSA_PKCS1_OpenSSL:
   97|   299k|{
   98|   299k|    return &rsa_pkcs1_ossl_meth;
   99|   299k|}
ossl_rsa_free_blinding:
  243|   299k|{
  244|   299k|    SPARSE_ARRAY_OF(BN_BLINDING) *blindings = rsa->blindings_sa;
  ------------------
  |  |   21|   299k|#define SPARSE_ARRAY_OF(type) struct sparse_array_st_##type
  ------------------
  245|       |
  246|       |    ossl_sa_BN_BLINDING_doall_arg(blindings, free_bn_blinding, NULL);
  247|   299k|    ossl_sa_BN_BLINDING_free(blindings);
  248|   299k|}
ossl_rsa_alloc_blinding:
  251|   299k|{
  252|   299k|    return ossl_sa_BN_BLINDING_new();
  253|   299k|}
rsa_ossl.c:rsa_ossl_init:
 1160|   299k|{
 1161|   299k|    rsa->flags |= RSA_FLAG_CACHE_PUBLIC | RSA_FLAG_CACHE_PRIVATE;
  ------------------
  |  |   65|   299k|#define RSA_FLAG_CACHE_PUBLIC 0x0002
  ------------------
                  rsa->flags |= RSA_FLAG_CACHE_PUBLIC | RSA_FLAG_CACHE_PRIVATE;
  ------------------
  |  |   66|   299k|#define RSA_FLAG_CACHE_PRIVATE 0x0004
  ------------------
 1162|   299k|    return 1;
 1163|   299k|}
rsa_ossl.c:rsa_ossl_finish:
 1166|   299k|{
 1167|   299k|#ifndef FIPS_MODULE
 1168|   299k|    int i;
 1169|   299k|    RSA_PRIME_INFO *pinfo;
 1170|       |
 1171|   299k|    for (i = 0; i < sk_RSA_PRIME_INFO_num(rsa->prime_infos); i++) {
  ------------------
  |  Branch (1171:17): [True: 0, False: 299k]
  ------------------
 1172|      0|        pinfo = sk_RSA_PRIME_INFO_value(rsa->prime_infos, i);
 1173|      0|        BN_MONT_CTX_free(pinfo->m);
 1174|      0|    }
 1175|   299k|#endif
 1176|       |
 1177|   299k|    BN_MONT_CTX_free(rsa->_method_mod_n);
 1178|   299k|    BN_MONT_CTX_free(rsa->_method_mod_p);
 1179|   299k|    BN_MONT_CTX_free(rsa->_method_mod_q);
 1180|   299k|    return 1;
 1181|   299k|}

ossl_self_test_set_callback_new:
   35|    787|{
   36|    787|    SELF_TEST_CB *stcb;
   37|       |
   38|    787|    stcb = OPENSSL_zalloc(sizeof(*stcb));
  ------------------
  |  |  108|    787|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   39|    787|    return stcb;
   40|    787|}
ossl_self_test_set_callback_free:
   43|    787|{
   44|    787|    OPENSSL_free(stcb);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   45|    787|}

SHA256_Init:
   43|  24.2k|{
   44|  24.2k|    memset(c, 0, sizeof(*c));
   45|  24.2k|    c->h[0] = 0x6a09e667UL;
   46|  24.2k|    c->h[1] = 0xbb67ae85UL;
   47|  24.2k|    c->h[2] = 0x3c6ef372UL;
   48|  24.2k|    c->h[3] = 0xa54ff53aUL;
   49|  24.2k|    c->h[4] = 0x510e527fUL;
   50|  24.2k|    c->h[5] = 0x9b05688cUL;
   51|  24.2k|    c->h[6] = 0x1f83d9abUL;
   52|  24.2k|    c->h[7] = 0x5be0cd19UL;
   53|  24.2k|    c->md_len = SHA256_DIGEST_LENGTH;
  ------------------
  |  |   86|  24.2k|#define SHA256_DIGEST_LENGTH 32
  ------------------
   54|  24.2k|    return 1;
   55|  24.2k|}

ossl_sha3_reset:
   19|  27.8k|{
   20|       |#if defined(__s390x__) && defined(OPENSSL_CPUID_OBJ)
   21|       |    if (!(OPENSSL_s390xcap_P.stfle[1] & S390X_CAPBIT(S390X_MSA12)))
   22|       |#endif
   23|  27.8k|        memset(ctx->A, 0, sizeof(ctx->A));
   24|  27.8k|    ctx->bufsz = 0;
   25|  27.8k|    ctx->xof_state = XOF_STATE_INIT;
  ------------------
  |  |   35|  27.8k|#define XOF_STATE_INIT 0
  ------------------
   26|  27.8k|}
ossl_sha3_init:
   29|  5.30k|{
   30|  5.30k|    size_t bsz = SHA3_BLOCKSIZE(bitlen);
  ------------------
  |  |   21|  5.30k|#define SHA3_BLOCKSIZE(bitlen) (KECCAK1600_WIDTH - bitlen * 2) / 8
  |  |  ------------------
  |  |  |  |   18|  5.30k|#define KECCAK1600_WIDTH 1600
  |  |  ------------------
  ------------------
   31|       |
   32|  5.30k|    if (bsz <= sizeof(ctx->buf)) {
  ------------------
  |  Branch (32:9): [True: 5.30k, False: 0]
  ------------------
   33|  5.30k|        ossl_sha3_reset(ctx);
   34|  5.30k|        ctx->block_size = bsz;
   35|  5.30k|        ctx->md_size = bitlen / 8;
   36|  5.30k|        ctx->pad = pad;
   37|  5.30k|        return 1;
   38|  5.30k|    }
   39|       |
   40|      0|    return 0;
   41|  5.30k|}
ossl_keccak_init:
   44|  2.65k|{
   45|  2.65k|    int ret = ossl_sha3_init(ctx, pad, bitlen);
   46|       |
   47|  2.65k|    if (ret)
  ------------------
  |  Branch (47:9): [True: 2.65k, False: 0]
  ------------------
   48|  2.65k|        ctx->md_size = mdlen / 8;
   49|  2.65k|    return ret;
   50|  2.65k|}
ossl_sha3_final:
  104|  10.6k|{
  105|  10.6k|    size_t bsz = ctx->block_size;
  106|  10.6k|    size_t num = ctx->bufsz;
  107|       |
  108|  10.6k|    if (outlen == 0)
  ------------------
  |  Branch (108:9): [True: 0, False: 10.6k]
  ------------------
  109|      0|        return 1;
  110|  10.6k|    if (ctx->xof_state == XOF_STATE_SQUEEZE
  ------------------
  |  |   38|  21.2k|#define XOF_STATE_SQUEEZE 3
  ------------------
  |  Branch (110:9): [True: 0, False: 10.6k]
  ------------------
  111|  10.6k|        || ctx->xof_state == XOF_STATE_FINAL)
  ------------------
  |  |   37|  10.6k|#define XOF_STATE_FINAL 2
  ------------------
  |  Branch (111:12): [True: 0, False: 10.6k]
  ------------------
  112|      0|        return 0;
  113|       |
  114|       |    /*
  115|       |     * Pad the data with 10*1. Note that |num| can be |bsz - 1|
  116|       |     * in which case both byte operations below are performed on
  117|       |     * same byte...
  118|       |     */
  119|  10.6k|    memset(ctx->buf + num, 0, bsz - num);
  120|  10.6k|    ctx->buf[num] = ctx->pad;
  121|  10.6k|    ctx->buf[bsz - 1] |= 0x80;
  122|       |
  123|  10.6k|    (void)SHA3_absorb(ctx->A, ctx->buf, bsz, bsz);
  124|       |
  125|  10.6k|    ctx->xof_state = XOF_STATE_FINAL;
  ------------------
  |  |   37|  10.6k|#define XOF_STATE_FINAL 2
  ------------------
  126|  10.6k|    SHA3_squeeze(ctx->A, out, outlen, bsz, 0);
  127|  10.6k|    return 1;
  128|  10.6k|}
ossl_sha3_squeeze:
  141|  35.9k|{
  142|  35.9k|    size_t bsz = ctx->block_size;
  143|  35.9k|    size_t num = ctx->bufsz;
  144|  35.9k|    size_t len;
  145|  35.9k|    int next = 1;
  146|       |
  147|  35.9k|    if (outlen == 0)
  ------------------
  |  Branch (147:9): [True: 0, False: 35.9k]
  ------------------
  148|      0|        return 1;
  149|       |
  150|  35.9k|    if (ctx->xof_state == XOF_STATE_FINAL)
  ------------------
  |  |   37|  35.9k|#define XOF_STATE_FINAL 2
  ------------------
  |  Branch (150:9): [True: 0, False: 35.9k]
  ------------------
  151|      0|        return 0;
  152|       |
  153|       |    /*
  154|       |     * On the first squeeze call, finish the absorb process,
  155|       |     * by adding the trailing padding and then doing
  156|       |     * a final absorb.
  157|       |     */
  158|  35.9k|    if (ctx->xof_state != XOF_STATE_SQUEEZE) {
  ------------------
  |  |   38|  35.9k|#define XOF_STATE_SQUEEZE 3
  ------------------
  |  Branch (158:9): [True: 11.9k, False: 23.9k]
  ------------------
  159|       |        /*
  160|       |         * Pad the data with 10*1. Note that |num| can be |bsz - 1|
  161|       |         * in which case both byte operations below are performed on
  162|       |         * same byte...
  163|       |         */
  164|  11.9k|        memset(ctx->buf + num, 0, bsz - num);
  165|  11.9k|        ctx->buf[num] = ctx->pad;
  166|  11.9k|        ctx->buf[bsz - 1] |= 0x80;
  167|  11.9k|        (void)SHA3_absorb(ctx->A, ctx->buf, bsz, bsz);
  168|  11.9k|        ctx->xof_state = XOF_STATE_SQUEEZE;
  ------------------
  |  |   38|  11.9k|#define XOF_STATE_SQUEEZE 3
  ------------------
  169|  11.9k|        num = ctx->bufsz = 0;
  170|  11.9k|        next = 0;
  171|  11.9k|    }
  172|       |
  173|       |    /*
  174|       |     * Step 1. Consume any bytes left over from a previous squeeze
  175|       |     * (See Step 4 below).
  176|       |     */
  177|  35.9k|    if (num != 0) {
  ------------------
  |  Branch (177:9): [True: 0, False: 35.9k]
  ------------------
  178|      0|        if (outlen > ctx->bufsz)
  ------------------
  |  Branch (178:13): [True: 0, False: 0]
  ------------------
  179|      0|            len = ctx->bufsz;
  180|      0|        else
  181|      0|            len = outlen;
  182|      0|        memcpy(out, ctx->buf + bsz - ctx->bufsz, len);
  183|      0|        out += len;
  184|      0|        outlen -= len;
  185|      0|        ctx->bufsz -= len;
  186|      0|    }
  187|  35.9k|    if (outlen == 0)
  ------------------
  |  Branch (187:9): [True: 0, False: 35.9k]
  ------------------
  188|      0|        return 1;
  189|       |
  190|       |    /* Step 2. Copy full sized squeezed blocks to the output buffer directly */
  191|  35.9k|    if (outlen >= bsz) {
  ------------------
  |  Branch (191:9): [True: 35.9k, False: 0]
  ------------------
  192|  35.9k|        len = bsz * (outlen / bsz);
  193|  35.9k|        SHA3_squeeze(ctx->A, out, len, bsz, next);
  194|  35.9k|        next = 1;
  195|  35.9k|        out += len;
  196|  35.9k|        outlen -= len;
  197|  35.9k|    }
  198|  35.9k|    if (outlen > 0) {
  ------------------
  |  Branch (198:9): [True: 0, False: 35.9k]
  ------------------
  199|       |        /* Step 3. Squeeze one more block into a buffer */
  200|      0|        SHA3_squeeze(ctx->A, ctx->buf, bsz, bsz, next);
  201|      0|        memcpy(out, ctx->buf, outlen);
  202|       |        /* Step 4. Remember the leftover part of the squeezed block */
  203|      0|        ctx->bufsz = bsz - outlen;
  204|      0|    }
  205|       |
  206|  35.9k|    return 1;
  207|  35.9k|}

SHA1_Init:
   60|   338k|{
   61|   338k|    memset(c, 0, sizeof(*c));
   62|   338k|    c->h0 = INIT_DATA_h0;
  ------------------
  |  |   53|   338k|#define INIT_DATA_h0 0x67452301UL
  ------------------
   63|   338k|    c->h1 = INIT_DATA_h1;
  ------------------
  |  |   54|   338k|#define INIT_DATA_h1 0xefcdab89UL
  ------------------
   64|   338k|    c->h2 = INIT_DATA_h2;
  ------------------
  |  |   55|   338k|#define INIT_DATA_h2 0x98badcfeUL
  ------------------
   65|   338k|    c->h3 = INIT_DATA_h3;
  ------------------
  |  |   56|   338k|#define INIT_DATA_h3 0x10325476UL
  ------------------
   66|   338k|    c->h4 = INIT_DATA_h4;
  ------------------
  |  |   57|   338k|#define INIT_DATA_h4 0xc3d2e1f0UL
  ------------------
   67|   338k|    return 1;
   68|   338k|}

ossl_err_load_SM2_strings:
   41|      1|{
   42|      1|#ifndef OPENSSL_NO_ERR
   43|      1|    if (ERR_reason_error_string(SM2_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (43:9): [True: 1, False: 0]
  ------------------
   44|      1|        ERR_load_strings_const(SM2_str_reasons);
   45|      1|#endif
   46|      1|    return 1;
   47|      1|}

EVP_sm3:
   28|      1|{
   29|      1|    return &sm3_md;
   30|      1|}

ossl_sa_new:
   59|   302k|{
   60|   302k|    OPENSSL_SA *res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |  108|   302k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|       |
   62|   302k|    return res;
   63|   302k|}
ossl_sa_free:
  111|   302k|{
  112|   302k|    if (sa != NULL) {
  ------------------
  |  Branch (112:9): [True: 302k, False: 0]
  ------------------
  113|   302k|        sa_doall(sa, &sa_free_node, NULL, NULL);
  114|   302k|        OPENSSL_free(sa);
  ------------------
  |  |  131|   302k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  115|   302k|    }
  116|   302k|}
ossl_sa_doall:
  135|  2.59k|{
  136|  2.59k|    struct trampoline_st tramp;
  137|       |
  138|  2.59k|    tramp.func = leaf;
  139|  2.59k|    if (sa != NULL)
  ------------------
  |  Branch (139:9): [True: 2.59k, False: 0]
  ------------------
  140|  2.59k|        sa_doall(sa, NULL, &trampoline, &tramp);
  141|  2.59k|}
ossl_sa_doall_arg:
  146|   305k|{
  147|   305k|    if (sa != NULL)
  ------------------
  |  Branch (147:9): [True: 305k, False: 0]
  ------------------
  148|   305k|        sa_doall(sa, NULL, leaf, arg);
  149|   305k|}
ossl_sa_num:
  152|      6|{
  153|      6|    return sa == NULL ? 0 : sa->nelem;
  ------------------
  |  Branch (153:12): [True: 0, False: 6]
  ------------------
  154|      6|}
ossl_sa_get:
  157|  21.1M|{
  158|  21.1M|    int level;
  159|  21.1M|    void **p, *r = NULL;
  160|       |
  161|  21.1M|    if (sa == NULL || sa->nelem == 0)
  ------------------
  |  Branch (161:9): [True: 0, False: 21.1M]
  |  Branch (161:23): [True: 1.89k, False: 21.1M]
  ------------------
  162|  1.89k|        return NULL;
  163|       |
  164|  21.1M|    if (n <= sa->top) {
  ------------------
  |  Branch (164:9): [True: 20.9M, False: 169k]
  ------------------
  165|  20.9M|        p = sa->nodes;
  166|  23.9M|        for (level = sa->levels - 1; p != NULL && level > 0; level--)
  ------------------
  |  Branch (166:38): [True: 23.8M, False: 154k]
  |  Branch (166:51): [True: 2.99M, False: 20.8M]
  ------------------
  167|  2.99M|            p = (void **)p[(n >> (OPENSSL_SA_BLOCK_BITS * level))
  ------------------
  |  |   34|  2.99M|#define OPENSSL_SA_BLOCK_BITS 4
  ------------------
  168|  2.99M|                & SA_BLOCK_MASK];
  ------------------
  |  |   46|  2.99M|#define SA_BLOCK_MASK (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  2.99M|#define SA_BLOCK_MAX (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  2.99M|#define OPENSSL_SA_BLOCK_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|  20.9M|        r = p == NULL ? NULL : p[n & SA_BLOCK_MASK];
  ------------------
  |  |   46|  20.8M|#define SA_BLOCK_MASK (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  20.8M|#define SA_BLOCK_MAX (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  20.8M|#define OPENSSL_SA_BLOCK_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (169:13): [True: 154k, False: 20.8M]
  ------------------
  170|  20.9M|    }
  171|  21.1M|    return r;
  172|  21.1M|}
ossl_sa_set:
  180|   340k|{
  181|   340k|    int i, level = 1;
  182|   340k|    ossl_uintmax_t n = posn;
  183|   340k|    void **p;
  184|       |
  185|   340k|    if (sa == NULL)
  ------------------
  |  Branch (185:9): [True: 0, False: 340k]
  ------------------
  186|      0|        return 0;
  187|       |
  188|  1.36M|    for (level = 1; level < SA_BLOCK_MAX_LEVELS; level++)
  ------------------
  |  |   47|  1.36M|#define SA_BLOCK_MAX_LEVELS (((int)sizeof(ossl_uintmax_t) * 8 \
  |  |   48|  1.36M|                                 + OPENSSL_SA_BLOCK_BITS - 1) \
  |  |  ------------------
  |  |  |  |   34|  1.36M|#define OPENSSL_SA_BLOCK_BITS 4
  |  |  ------------------
  |  |   49|  1.36M|    / OPENSSL_SA_BLOCK_BITS)
  |  |  ------------------
  |  |  |  |   34|  1.36M|#define OPENSSL_SA_BLOCK_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (188:21): [True: 1.36M, False: 0]
  ------------------
  189|  1.36M|        if ((n >>= OPENSSL_SA_BLOCK_BITS) == 0)
  ------------------
  |  |   34|  1.36M|#define OPENSSL_SA_BLOCK_BITS 4
  ------------------
  |  Branch (189:13): [True: 340k, False: 1.02M]
  ------------------
  190|   340k|            break;
  191|       |
  192|   342k|    for (; sa->levels < level; sa->levels++) {
  ------------------
  |  Branch (192:12): [True: 2.55k, False: 340k]
  ------------------
  193|  2.55k|        p = alloc_node();
  194|  2.55k|        if (p == NULL)
  ------------------
  |  Branch (194:13): [True: 0, False: 2.55k]
  ------------------
  195|      0|            return 0;
  196|  2.55k|        p[0] = sa->nodes;
  197|  2.55k|        sa->nodes = p;
  198|  2.55k|    }
  199|   340k|    if (sa->top < posn)
  ------------------
  |  Branch (199:9): [True: 85.5k, False: 254k]
  ------------------
  200|  85.5k|        sa->top = posn;
  201|       |
  202|   340k|    p = sa->nodes;
  203|  1.37M|    for (level = sa->levels - 1; level > 0; level--) {
  ------------------
  |  Branch (203:34): [True: 1.03M, False: 340k]
  ------------------
  204|  1.03M|        i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK;
  ------------------
  |  |   34|  1.03M|#define OPENSSL_SA_BLOCK_BITS 4
  ------------------
                      i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK;
  ------------------
  |  |   46|  1.03M|#define SA_BLOCK_MASK (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  1.03M|#define SA_BLOCK_MAX (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.03M|#define OPENSSL_SA_BLOCK_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|  1.03M|        if (p[i] == NULL && (p[i] = alloc_node()) == NULL)
  ------------------
  |  Branch (205:13): [True: 308k, False: 729k]
  |  Branch (205:29): [True: 0, False: 308k]
  ------------------
  206|      0|            return 0;
  207|  1.03M|        p = p[i];
  208|  1.03M|    }
  209|   340k|    p += posn & SA_BLOCK_MASK;
  ------------------
  |  |   46|   340k|#define SA_BLOCK_MASK (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|   340k|#define SA_BLOCK_MAX (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|   340k|#define OPENSSL_SA_BLOCK_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|   340k|    if (val == NULL && *p != NULL)
  ------------------
  |  Branch (210:9): [True: 170k, False: 170k]
  |  Branch (210:24): [True: 170k, False: 0]
  ------------------
  211|   170k|        sa->nelem--;
  212|   170k|    else if (val != NULL && *p == NULL)
  ------------------
  |  Branch (212:14): [True: 170k, False: 0]
  |  Branch (212:29): [True: 170k, False: 3]
  ------------------
  213|   170k|        sa->nelem++;
  214|   340k|    *p = val;
  215|   340k|    return 1;
  216|   340k|}
sparse_array.c:sa_doall:
   67|   610k|{
   68|   610k|    int i[SA_BLOCK_MAX_LEVELS];
   69|   610k|    void *nodes[SA_BLOCK_MAX_LEVELS];
   70|   610k|    ossl_uintmax_t idx = 0;
   71|   610k|    int l = 0;
   72|       |
   73|   610k|    i[0] = 0;
   74|   610k|    nodes[0] = sa->nodes;
   75|  26.7M|    while (l >= 0) {
  ------------------
  |  Branch (75:12): [True: 26.1M, False: 610k]
  ------------------
   76|  26.1M|        const int n = i[l];
   77|  26.1M|        void **const p = nodes[l];
   78|       |
   79|  26.1M|        if (n >= SA_BLOCK_MAX) {
  ------------------
  |  |   45|  26.1M|#define SA_BLOCK_MAX (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  ------------------
  |  |  |  |   34|  26.1M|#define OPENSSL_SA_BLOCK_BITS 4
  |  |  ------------------
  ------------------
  |  Branch (79:13): [True: 1.53M, False: 24.6M]
  ------------------
   80|  1.53M|            if (p != NULL && node != NULL)
  ------------------
  |  Branch (80:17): [True: 931k, False: 608k]
  |  Branch (80:30): [True: 311k, False: 620k]
  ------------------
   81|   311k|                (*node)(p);
   82|  1.53M|            l--;
   83|  1.53M|            idx >>= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|  1.53M|#define OPENSSL_SA_BLOCK_BITS 4
  ------------------
   84|  24.6M|        } else {
   85|  24.6M|            i[l] = n + 1;
   86|  24.6M|            if (p != NULL && p[n] != NULL) {
  ------------------
  |  Branch (86:17): [True: 14.9M, False: 9.73M]
  |  Branch (86:30): [True: 1.26M, False: 13.6M]
  ------------------
   87|  1.26M|                idx = (idx & ~SA_BLOCK_MASK) | n;
  ------------------
  |  |   46|  1.26M|#define SA_BLOCK_MASK (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  1.26M|#define SA_BLOCK_MAX (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.26M|#define OPENSSL_SA_BLOCK_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   88|  1.26M|                if (l < sa->levels - 1) {
  ------------------
  |  Branch (88:21): [True: 929k, False: 337k]
  ------------------
   89|   929k|                    i[++l] = 0;
   90|   929k|                    nodes[l] = p[n];
   91|   929k|                    idx <<= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|   929k|#define OPENSSL_SA_BLOCK_BITS 4
  ------------------
   92|   929k|                } else if (leaf != NULL) {
  ------------------
  |  Branch (92:28): [True: 337k, False: 0]
  ------------------
   93|   337k|                    (*leaf)(idx, p[n], arg);
   94|   337k|                }
   95|  1.26M|            }
   96|  24.6M|        }
   97|  26.1M|    }
   98|   610k|}
sparse_array.c:sa_free_node:
  101|   311k|{
  102|   311k|    OPENSSL_free(p);
  ------------------
  |  |  131|   311k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  103|   311k|}
sparse_array.c:alloc_node:
  175|   311k|{
  176|   311k|    return OPENSSL_calloc(SA_BLOCK_MAX, sizeof(void *));
  ------------------
  |  |  112|   311k|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  177|   311k|}

ossl_err_load_SSL_strings:
  629|      1|{
  630|      1|#ifndef OPENSSL_NO_ERR
  631|      1|    if (ERR_reason_error_string(SSL_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (631:9): [True: 1, False: 0]
  ------------------
  632|      1|        ERR_load_strings_const(SSL_str_reasons);
  633|      1|#endif
  634|      1|    return 1;
  635|      1|}

OPENSSL_sk_set_cmp_func:
   39|  3.16k|{
   40|  3.16k|    OPENSSL_sk_compfunc old = sk->comp;
   41|       |
   42|  3.16k|    if (sk->comp != c)
  ------------------
  |  Branch (42:9): [True: 3.16k, False: 0]
  ------------------
   43|  3.16k|        sk->sorted = 0;
   44|  3.16k|    sk->comp = c;
   45|       |
   46|  3.16k|    return old;
   47|  3.16k|}
OPENSSL_sk_dup:
   50|   627k|{
   51|   627k|    OPENSSL_STACK *ret;
   52|       |
   53|   627k|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  106|   627k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (53:9): [True: 0, False: 627k]
  ------------------
   54|      0|        goto err;
   55|       |
   56|   627k|    if (sk == NULL) {
  ------------------
  |  Branch (56:9): [True: 1, False: 627k]
  ------------------
   57|      1|        ret->num = 0;
   58|      1|        ret->sorted = 0;
   59|      1|        ret->comp = NULL;
   60|   627k|    } else {
   61|       |        /* direct structure assignment */
   62|   627k|        *ret = *sk;
   63|   627k|    }
   64|       |
   65|   627k|    if (sk == NULL || sk->num == 0) {
  ------------------
  |  Branch (65:9): [True: 1, False: 627k]
  |  Branch (65:23): [True: 127, False: 627k]
  ------------------
   66|       |        /* postpone |ret->data| allocation */
   67|    128|        ret->data = NULL;
   68|    128|        ret->num_alloc = 0;
   69|    128|        return ret;
   70|    128|    }
   71|       |
   72|       |    /* duplicate |sk->data| content */
   73|   627k|    ret->data = OPENSSL_malloc_array(sk->num_alloc, sizeof(*ret->data));
  ------------------
  |  |  110|   627k|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   74|   627k|    if (ret->data == NULL)
  ------------------
  |  Branch (74:9): [True: 0, False: 627k]
  ------------------
   75|      0|        goto err;
   76|   627k|    memcpy(ret->data, sk->data, sizeof(void *) * sk->num);
   77|   627k|    return ret;
   78|       |
   79|      0|err:
   80|      0|    OPENSSL_sk_free(ret);
   81|       |    return NULL;
   82|   627k|}
OPENSSL_sk_deep_copy:
   87|   826k|{
   88|   826k|    OPENSSL_STACK *ret;
   89|   826k|    int i;
   90|       |
   91|   826k|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  106|   826k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (91:9): [True: 0, False: 826k]
  ------------------
   92|      0|        goto err;
   93|       |
   94|   826k|    if (sk == NULL) {
  ------------------
  |  Branch (94:9): [True: 1.57k, False: 824k]
  ------------------
   95|  1.57k|        ret->num = 0;
   96|  1.57k|        ret->sorted = 0;
   97|  1.57k|        ret->comp = NULL;
   98|   824k|    } else {
   99|       |        /* direct structure assignment */
  100|   824k|        *ret = *sk;
  101|   824k|    }
  102|       |
  103|   826k|    if (sk == NULL || sk->num == 0) {
  ------------------
  |  Branch (103:9): [True: 1.57k, False: 824k]
  |  Branch (103:23): [True: 0, False: 824k]
  ------------------
  104|       |        /* postpone |ret| data allocation */
  105|  1.57k|        ret->data = NULL;
  106|  1.57k|        ret->num_alloc = 0;
  107|  1.57k|        return ret;
  108|  1.57k|    }
  109|       |
  110|   824k|    ret->num_alloc = sk->num > min_nodes ? sk->num : min_nodes;
  ------------------
  |  Branch (110:22): [True: 412k, False: 412k]
  ------------------
  111|   824k|    ret->data = OPENSSL_calloc(ret->num_alloc, sizeof(*ret->data));
  ------------------
  |  |  112|   824k|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  112|   824k|    if (ret->data == NULL)
  ------------------
  |  Branch (112:9): [True: 0, False: 824k]
  ------------------
  113|      0|        goto err;
  114|       |
  115|  3.71M|    for (i = 0; i < ret->num; ++i) {
  ------------------
  |  Branch (115:17): [True: 2.88M, False: 824k]
  ------------------
  116|  2.88M|        if (sk->data[i] == NULL)
  ------------------
  |  Branch (116:13): [True: 0, False: 2.88M]
  ------------------
  117|      0|            continue;
  118|  2.88M|        if ((ret->data[i] = copy_func(sk->data[i])) == NULL) {
  ------------------
  |  Branch (118:13): [True: 0, False: 2.88M]
  ------------------
  119|      0|            while (--i >= 0)
  ------------------
  |  Branch (119:20): [True: 0, False: 0]
  ------------------
  120|      0|                if (ret->data[i] != NULL)
  ------------------
  |  Branch (120:21): [True: 0, False: 0]
  ------------------
  121|      0|                    free_func((void *)ret->data[i]);
  122|      0|            goto err;
  123|      0|        }
  124|  2.88M|    }
  125|   824k|    return ret;
  126|       |
  127|      0|err:
  128|      0|    OPENSSL_sk_free(ret);
  129|       |    return NULL;
  130|   824k|}
OPENSSL_sk_new_null:
  133|  11.9M|{
  134|       |    return OPENSSL_sk_new_reserve(NULL, 0);
  135|  11.9M|}
OPENSSL_sk_new:
  138|  43.4k|{
  139|  43.4k|    return OPENSSL_sk_new_reserve(c, 0);
  140|  43.4k|}
OPENSSL_sk_new_reserve:
  229|  12.0M|{
  230|  12.0M|    OPENSSL_STACK *st = OPENSSL_zalloc(sizeof(OPENSSL_STACK));
  ------------------
  |  |  108|  12.0M|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  231|       |
  232|  12.0M|    if (st == NULL)
  ------------------
  |  Branch (232:9): [True: 0, False: 12.0M]
  ------------------
  233|      0|        return NULL;
  234|       |
  235|  12.0M|    st->comp = c;
  236|       |
  237|  12.0M|    if (n <= 0)
  ------------------
  |  Branch (237:9): [True: 12.0M, False: 6]
  ------------------
  238|  12.0M|        return st;
  239|       |
  240|      6|    if (!sk_reserve(st, n, 1)) {
  ------------------
  |  Branch (240:9): [True: 0, False: 6]
  ------------------
  241|      0|        OPENSSL_sk_free(st);
  242|      0|        return NULL;
  243|      0|    }
  244|       |
  245|      6|    return st;
  246|      6|}
OPENSSL_sk_set_thunks:
  261|  3.90M|{
  262|  3.90M|    if (st != NULL)
  ------------------
  |  Branch (262:9): [True: 2.75M, False: 1.15M]
  ------------------
  263|  2.75M|        st->free_thunk = f_thunk;
  264|       |
  265|  3.90M|    return st;
  266|  3.90M|}
OPENSSL_sk_insert:
  269|  18.3M|{
  270|  18.3M|    if (st == NULL) {
  ------------------
  |  Branch (270:9): [True: 0, False: 18.3M]
  ------------------
  271|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|        return 0;
  273|      0|    }
  274|  18.3M|    if (st->num == max_nodes) {
  ------------------
  |  Branch (274:9): [True: 0, False: 18.3M]
  ------------------
  275|      0|        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  276|      0|        return 0;
  277|      0|    }
  278|       |
  279|  18.3M|    if (!sk_reserve(st, 1, 0))
  ------------------
  |  Branch (279:9): [True: 0, False: 18.3M]
  ------------------
  280|      0|        return 0;
  281|       |
  282|  18.3M|    if ((loc >= st->num) || (loc < 0)) {
  ------------------
  |  Branch (282:9): [True: 18.3M, False: 74]
  |  Branch (282:29): [True: 0, False: 74]
  ------------------
  283|  18.3M|        st->data[st->num] = data;
  284|  18.3M|    } else {
  285|     74|        memmove(&st->data[loc + 1], &st->data[loc],
  286|     74|            sizeof(st->data[0]) * (st->num - loc));
  287|     74|        st->data[loc] = data;
  288|     74|    }
  289|  18.3M|    st->num++;
  290|  18.3M|    st->sorted = 0;
  291|  18.3M|    return st->num;
  292|  18.3M|}
OPENSSL_sk_delete_ptr:
  307|      2|{
  308|      2|    int i;
  309|       |
  310|      2|    if (st == NULL)
  ------------------
  |  Branch (310:9): [True: 0, False: 2]
  ------------------
  311|      0|        return NULL;
  312|       |
  313|      2|    for (i = 0; i < st->num; i++)
  ------------------
  |  Branch (313:17): [True: 1, False: 1]
  ------------------
  314|      1|        if (st->data[i] == p)
  ------------------
  |  Branch (314:13): [True: 1, False: 0]
  ------------------
  315|      1|            return internal_delete(st, i);
  316|      1|    return NULL;
  317|      2|}
OPENSSL_sk_delete:
  320|    975|{
  321|    975|    if (st == NULL || loc < 0 || loc >= st->num)
  ------------------
  |  Branch (321:9): [True: 0, False: 975]
  |  Branch (321:23): [True: 0, False: 975]
  |  Branch (321:34): [True: 0, False: 975]
  ------------------
  322|      0|        return NULL;
  323|       |
  324|    975|    return internal_delete(st, loc);
  325|    975|}
OPENSSL_sk_find:
  393|   416k|{
  394|   416k|    return internal_find(st, data, OSSL_BSEARCH_FIRST_VALUE_ON_MATCH, NULL);
  ------------------
  |  |  150|   416k|#define OSSL_BSEARCH_FIRST_VALUE_ON_MATCH 0x02
  ------------------
  395|   416k|}
OPENSSL_sk_push:
  408|  18.3M|{
  409|  18.3M|    if (st == NULL)
  ------------------
  |  Branch (409:9): [True: 0, False: 18.3M]
  ------------------
  410|      0|        return 0;
  411|  18.3M|    return OPENSSL_sk_insert(st, data, st->num);
  412|  18.3M|}
OPENSSL_sk_unshift:
  415|     73|{
  416|     73|    return OPENSSL_sk_insert(st, data, 0);
  417|     73|}
OPENSSL_sk_pop:
  427|  2.88k|{
  428|  2.88k|    if (st == NULL || st->num == 0)
  ------------------
  |  Branch (428:9): [True: 0, False: 2.88k]
  |  Branch (428:23): [True: 0, False: 2.88k]
  ------------------
  429|      0|        return NULL;
  430|  2.88k|    return internal_delete(st, st->num - 1);
  431|  2.88k|}
OPENSSL_sk_pop_free:
  442|  10.4M|{
  443|  10.4M|    int i;
  444|       |
  445|  10.4M|    if (st == NULL)
  ------------------
  |  Branch (445:9): [True: 2.89M, False: 7.54M]
  ------------------
  446|  2.89M|        return;
  447|       |
  448|  23.9M|    for (i = 0; i < st->num; i++) {
  ------------------
  |  Branch (448:17): [True: 16.4M, False: 7.54M]
  ------------------
  449|  16.4M|        if (st->data[i] != NULL) {
  ------------------
  |  Branch (449:13): [True: 16.4M, False: 2]
  ------------------
  450|  16.4M|            if (st->free_thunk != NULL)
  ------------------
  |  Branch (450:17): [True: 9.43M, False: 7.00M]
  ------------------
  451|  9.43M|                st->free_thunk(func, (void *)st->data[i]);
  452|  7.00M|            else
  453|  7.00M|                func((void *)st->data[i]);
  454|  16.4M|        }
  455|  16.4M|    }
  456|  7.54M|    OPENSSL_sk_free(st);
  457|  7.54M|}
OPENSSL_sk_free:
  460|  19.8M|{
  461|  19.8M|    if (st == NULL)
  ------------------
  |  Branch (461:9): [True: 6.41M, False: 13.4M]
  ------------------
  462|  6.41M|        return;
  463|  13.4M|    OPENSSL_free(st->data);
  ------------------
  |  |  131|  13.4M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  464|  13.4M|    OPENSSL_free(st);
  ------------------
  |  |  131|  13.4M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  465|  13.4M|}
OPENSSL_sk_num:
  468|  84.0M|{
  469|  84.0M|    return st == NULL ? -1 : st->num;
  ------------------
  |  Branch (469:12): [True: 11.5M, False: 72.4M]
  ------------------
  470|  84.0M|}
OPENSSL_sk_value:
  473|  48.7M|{
  474|  48.7M|    if (st == NULL || i < 0 || i >= st->num)
  ------------------
  |  Branch (474:9): [True: 0, False: 48.7M]
  |  Branch (474:23): [True: 2.25k, False: 48.7M]
  |  Branch (474:32): [True: 0, False: 48.7M]
  ------------------
  475|  2.25k|        return NULL;
  476|  48.7M|    return (void *)st->data[i];
  477|  48.7M|}
OPENSSL_sk_set:
  480|  2.99M|{
  481|  2.99M|    if (st == NULL) {
  ------------------
  |  Branch (481:9): [True: 0, False: 2.99M]
  ------------------
  482|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  483|      0|        return NULL;
  484|      0|    }
  485|  2.99M|    if (i < 0 || i >= st->num) {
  ------------------
  |  Branch (485:9): [True: 0, False: 2.99M]
  |  Branch (485:18): [True: 0, False: 2.99M]
  ------------------
  486|      0|        ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |   87|      0|#define ERR_LIB_CRYPTO 15
  ------------------
                      ERR_raise_data(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  358|      0|#define ERR_R_PASSED_INVALID_ARGUMENT (262 | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  487|      0|            "i=%d", i);
  488|      0|        return NULL;
  489|      0|    }
  490|  2.99M|    st->data[i] = data;
  491|  2.99M|    st->sorted = 0;
  492|  2.99M|    return (void *)st->data[i];
  493|  2.99M|}
OPENSSL_sk_sort:
  496|  24.7k|{
  497|  24.7k|    if (st != NULL && !st->sorted && st->comp != NULL) {
  ------------------
  |  Branch (497:9): [True: 24.7k, False: 0]
  |  Branch (497:23): [True: 22.3k, False: 2.39k]
  |  Branch (497:38): [True: 22.3k, False: 0]
  ------------------
  498|  22.3k|        if (st->num > 1)
  ------------------
  |  Branch (498:13): [True: 8.55k, False: 13.7k]
  ------------------
  499|  8.55k|            qsort(st->data, st->num, sizeof(void *), st->comp);
  500|  22.3k|        st->sorted = 1; /* empty or single-element stack is considered sorted */
  501|  22.3k|    }
  502|  24.7k|}
stack.c:sk_reserve:
  180|  18.3M|{
  181|  18.3M|    const void **tmpdata;
  182|  18.3M|    int num_alloc;
  183|       |
  184|       |    /* Check to see the reservation isn't exceeding the hard limit */
  185|  18.3M|    if (n > max_nodes - st->num) {
  ------------------
  |  Branch (185:9): [True: 0, False: 18.3M]
  ------------------
  186|      0|        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  187|      0|        return 0;
  188|      0|    }
  189|       |
  190|       |    /* Figure out the new size */
  191|  18.3M|    num_alloc = st->num + n;
  192|  18.3M|    if (num_alloc < min_nodes)
  ------------------
  |  Branch (192:9): [True: 15.4M, False: 2.93M]
  ------------------
  193|  15.4M|        num_alloc = min_nodes;
  194|       |
  195|       |    /* If |st->data| allocation was postponed */
  196|  18.3M|    if (st->data == NULL) {
  ------------------
  |  Branch (196:9): [True: 9.36M, False: 8.98M]
  ------------------
  197|       |        /*
  198|       |         * At this point, |st->num_alloc| and |st->num| are 0;
  199|       |         * so |num_alloc| value is |n| or |min_nodes| if greater than |n|.
  200|       |         */
  201|  9.36M|        if ((st->data = OPENSSL_calloc(num_alloc, sizeof(void *))) == NULL)
  ------------------
  |  |  112|  9.36M|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (201:13): [True: 0, False: 9.36M]
  ------------------
  202|      0|            return 0;
  203|  9.36M|        st->num_alloc = num_alloc;
  204|  9.36M|        return 1;
  205|  9.36M|    }
  206|       |
  207|  8.98M|    if (!exact) {
  ------------------
  |  Branch (207:9): [True: 8.98M, False: 0]
  ------------------
  208|  8.98M|        if (num_alloc <= st->num_alloc)
  ------------------
  |  Branch (208:13): [True: 8.37M, False: 604k]
  ------------------
  209|  8.37M|            return 1;
  210|   604k|        num_alloc = compute_growth(num_alloc, st->num_alloc);
  211|   604k|        if (num_alloc == 0) {
  ------------------
  |  Branch (211:13): [True: 0, False: 604k]
  ------------------
  212|      0|            ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  213|      0|            return 0;
  214|      0|        }
  215|   604k|    } else if (num_alloc == st->num_alloc) {
  ------------------
  |  Branch (215:16): [True: 0, False: 0]
  ------------------
  216|      0|        return 1;
  217|      0|    }
  218|       |
  219|   604k|    tmpdata = OPENSSL_realloc_array((void *)st->data, num_alloc, sizeof(void *));
  ------------------
  |  |  124|   604k|    CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  220|   604k|    if (tmpdata == NULL)
  ------------------
  |  Branch (220:9): [True: 0, False: 604k]
  ------------------
  221|      0|        return 0;
  222|       |
  223|   604k|    st->data = tmpdata;
  224|   604k|    st->num_alloc = num_alloc;
  225|   604k|    return 1;
  226|   604k|}
stack.c:compute_growth:
  162|   604k|{
  163|   604k|    int err = 0;
  164|       |
  165|  1.20M|    while (current < target) {
  ------------------
  |  Branch (165:12): [True: 604k, False: 604k]
  ------------------
  166|   604k|        if (current >= max_nodes)
  ------------------
  |  Branch (166:13): [True: 0, False: 604k]
  ------------------
  167|      0|            return 0;
  168|       |
  169|   604k|        current = safe_muldiv_int(current, 8, 5, &err);
  170|   604k|        if (err != 0)
  ------------------
  |  Branch (170:13): [True: 0, False: 604k]
  ------------------
  171|      0|            return 0;
  172|   604k|        if (current >= max_nodes)
  ------------------
  |  Branch (172:13): [True: 0, False: 604k]
  ------------------
  173|      0|            current = max_nodes;
  174|   604k|    }
  175|   604k|    return current;
  176|   604k|}
stack.c:internal_delete:
  295|  3.85k|{
  296|  3.85k|    const void *ret = st->data[loc];
  297|       |
  298|  3.85k|    if (loc != st->num - 1)
  ------------------
  |  Branch (298:9): [True: 877, False: 2.97k]
  ------------------
  299|    877|        memmove(&st->data[loc], &st->data[loc + 1],
  300|    877|            sizeof(st->data[0]) * (st->num - loc - 1));
  301|  3.85k|    st->num--;
  302|       |
  303|  3.85k|    return (void *)ret;
  304|  3.85k|}
stack.c:internal_find:
  329|   416k|{
  330|   416k|    const void *r;
  331|   416k|    int i, count = 0;
  332|   416k|    int *pnum = pnum_matched;
  333|       |
  334|   416k|    if (st == NULL || st->num == 0)
  ------------------
  |  Branch (334:9): [True: 0, False: 416k]
  |  Branch (334:23): [True: 1.66k, False: 415k]
  ------------------
  335|  1.66k|        return -1;
  336|       |
  337|   415k|    if (pnum == NULL)
  ------------------
  |  Branch (337:9): [True: 415k, False: 0]
  ------------------
  338|   415k|        pnum = &count;
  339|       |
  340|   415k|    if (st->comp == NULL) {
  ------------------
  |  Branch (340:9): [True: 0, False: 415k]
  ------------------
  341|      0|        for (i = 0; i < st->num; i++)
  ------------------
  |  Branch (341:21): [True: 0, False: 0]
  ------------------
  342|      0|            if (st->data[i] == data) {
  ------------------
  |  Branch (342:17): [True: 0, False: 0]
  ------------------
  343|      0|                *pnum = 1;
  344|      0|                return i;
  345|      0|            }
  346|      0|        *pnum = 0;
  347|      0|        return -1;
  348|      0|    }
  349|       |
  350|   415k|    if (data == NULL)
  ------------------
  |  Branch (350:9): [True: 0, False: 415k]
  ------------------
  351|      0|        return -1;
  352|       |
  353|   415k|    if (!st->sorted) {
  ------------------
  |  Branch (353:9): [True: 410k, False: 4.49k]
  ------------------
  354|   410k|        int res = -1;
  355|       |
  356|  30.3M|        for (i = 0; i < st->num; i++)
  ------------------
  |  Branch (356:21): [True: 30.0M, False: 241k]
  ------------------
  357|  30.0M|            if (st->comp(&data, st->data + i) == 0) {
  ------------------
  |  Branch (357:17): [True: 169k, False: 29.8M]
  ------------------
  358|   169k|                if (res == -1)
  ------------------
  |  Branch (358:21): [True: 169k, False: 0]
  ------------------
  359|   169k|                    res = i;
  360|   169k|                ++*pnum;
  361|       |                /* Check if only one result is wanted and exit if so */
  362|   169k|                if (pnum_matched == NULL)
  ------------------
  |  Branch (362:21): [True: 169k, False: 0]
  ------------------
  363|   169k|                    return i;
  364|   169k|            }
  365|   241k|        if (res == -1)
  ------------------
  |  Branch (365:13): [True: 241k, False: 0]
  ------------------
  366|   241k|            *pnum = 0;
  367|   241k|        return res;
  368|   410k|    }
  369|       |
  370|  4.49k|    if (pnum_matched != NULL)
  ------------------
  |  Branch (370:9): [True: 0, False: 4.49k]
  ------------------
  371|      0|        ret_val_options |= OSSL_BSEARCH_FIRST_VALUE_ON_MATCH;
  ------------------
  |  |  150|      0|#define OSSL_BSEARCH_FIRST_VALUE_ON_MATCH 0x02
  ------------------
  372|  4.49k|    r = ossl_bsearch(&data, st->data, st->num, sizeof(void *), st->comp,
  373|  4.49k|        ret_val_options);
  374|       |
  375|  4.49k|    if (pnum_matched != NULL) {
  ------------------
  |  Branch (375:9): [True: 0, False: 4.49k]
  ------------------
  376|      0|        *pnum = 0;
  377|      0|        if (r != NULL) {
  ------------------
  |  Branch (377:13): [True: 0, False: 0]
  ------------------
  378|      0|            const void **p = (const void **)r;
  379|       |
  380|      0|            while (p < st->data + st->num) {
  ------------------
  |  Branch (380:20): [True: 0, False: 0]
  ------------------
  381|      0|                if (st->comp(&data, p) != 0)
  ------------------
  |  Branch (381:21): [True: 0, False: 0]
  ------------------
  382|      0|                    break;
  383|      0|                ++*pnum;
  384|      0|                ++p;
  385|      0|            }
  386|      0|        }
  387|      0|    }
  388|       |
  389|  4.49k|    return r == NULL ? -1 : (int)((const void **)r - st->data);
  ------------------
  |  Branch (389:12): [True: 2.19k, False: 2.29k]
  ------------------
  390|   415k|}

ossl_err_load_OSSL_STORE_strings:
   69|      1|{
   70|      1|#ifndef OPENSSL_NO_ERR
   71|      1|    if (ERR_reason_error_string(OSSL_STORE_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (71:9): [True: 1, False: 0]
  ------------------
   72|      1|        ERR_load_strings_const(OSSL_STORE_str_reasons);
   73|      1|#endif
   74|      1|    return 1;
   75|      1|}

ossl_store_cleanup_int:
   14|      1|{
   15|      1|    ossl_store_destroy_loaders_int();
   16|      1|}

ossl_store_loader_store_cache_flush:
  388|    649|{
  389|    649|    OSSL_METHOD_STORE *store = get_loader_store(libctx);
  390|       |
  391|    649|    if (store != NULL)
  ------------------
  |  Branch (391:9): [True: 649, False: 0]
  ------------------
  392|    649|        return ossl_method_store_cache_flush_all(store);
  393|      0|    return 1;
  394|    649|}
ossl_store_loader_store_remove_all_provided:
  397|    649|{
  398|    649|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  399|    649|    OSSL_METHOD_STORE *store = get_loader_store(libctx);
  400|       |
  401|    649|    if (store != NULL)
  ------------------
  |  Branch (401:9): [True: 649, False: 0]
  ------------------
  402|    649|        return ossl_method_store_remove_all_provided(store, prov);
  403|      0|    return 1;
  404|    649|}
store_meth.c:get_loader_store:
  109|  1.29k|{
  110|  1.29k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX);
  ------------------
  |  |  113|  1.29k|#define OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX 15
  ------------------
  111|  1.29k|}

ossl_store_destroy_loaders_int:
  282|      1|{
  283|      1|    lh_OSSL_STORE_LOADER_free(loader_register);
  284|      1|    loader_register = NULL;
  285|      1|    CRYPTO_THREAD_lock_free(registry_lock);
  286|       |    registry_lock = NULL;
  287|      1|}

ossl_crypto_mutex_new:
   97|    787|{
   98|    787|    pthread_mutex_t *mutex;
   99|       |
  100|    787|    if ((mutex = OPENSSL_zalloc(sizeof(*mutex))) == NULL)
  ------------------
  |  |  108|    787|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (100:9): [True: 0, False: 787]
  ------------------
  101|      0|        return NULL;
  102|    787|    if (pthread_mutex_init(mutex, NULL) != 0) {
  ------------------
  |  Branch (102:9): [True: 0, False: 787]
  ------------------
  103|      0|        OPENSSL_free(mutex);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  104|      0|        return NULL;
  105|      0|    }
  106|    787|    return (CRYPTO_MUTEX *)mutex;
  107|    787|}
ossl_crypto_mutex_free:
  142|    787|{
  143|    787|    pthread_mutex_t **mutex_p;
  144|       |
  145|    787|    if (mutex == NULL)
  ------------------
  |  Branch (145:9): [True: 0, False: 787]
  ------------------
  146|      0|        return;
  147|       |
  148|    787|    mutex_p = (pthread_mutex_t **)mutex;
  149|    787|    if (*mutex_p != NULL)
  ------------------
  |  Branch (149:9): [True: 787, False: 0]
  ------------------
  150|    787|        pthread_mutex_destroy(*mutex_p);
  151|    787|    OPENSSL_free(*mutex_p);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  152|       |    *mutex = NULL;
  153|    787|}
ossl_crypto_condvar_new:
  156|    787|{
  157|    787|    pthread_cond_t *cv_p;
  158|       |
  159|    787|    if ((cv_p = OPENSSL_zalloc(sizeof(*cv_p))) == NULL)
  ------------------
  |  |  108|    787|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (159:9): [True: 0, False: 787]
  ------------------
  160|      0|        return NULL;
  161|    787|    if (pthread_cond_init(cv_p, NULL) != 0) {
  ------------------
  |  Branch (161:9): [True: 0, False: 787]
  ------------------
  162|      0|        OPENSSL_free(cv_p);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|      0|        return NULL;
  164|      0|    }
  165|    787|    return (CRYPTO_CONDVAR *)cv_p;
  166|    787|}
ossl_crypto_condvar_free:
  220|    787|{
  221|    787|    pthread_cond_t **cv_p;
  222|       |
  223|    787|    if (cv == NULL)
  ------------------
  |  Branch (223:9): [True: 0, False: 787]
  ------------------
  224|      0|        return;
  225|       |
  226|    787|    cv_p = (pthread_cond_t **)cv;
  227|    787|    if (*cv_p != NULL)
  ------------------
  |  Branch (227:9): [True: 787, False: 0]
  ------------------
  228|    787|        pthread_cond_destroy(*cv_p);
  229|    787|    OPENSSL_free(*cv_p);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  230|       |    *cv_p = NULL;
  231|    787|}

ossl_threads_ctx_new:
  128|    787|{
  129|    787|    struct openssl_threads_st *t = OPENSSL_zalloc(sizeof(*t));
  ------------------
  |  |  108|    787|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  130|       |
  131|    787|    if (t == NULL)
  ------------------
  |  Branch (131:9): [True: 0, False: 787]
  ------------------
  132|      0|        return NULL;
  133|       |
  134|    787|    t->lock = ossl_crypto_mutex_new();
  135|    787|    t->cond_finished = ossl_crypto_condvar_new();
  136|       |
  137|    787|    if (t->lock == NULL || t->cond_finished == NULL)
  ------------------
  |  Branch (137:9): [True: 0, False: 787]
  |  Branch (137:28): [True: 0, False: 787]
  ------------------
  138|      0|        goto fail;
  139|       |
  140|    787|    return t;
  141|       |
  142|      0|fail:
  143|      0|    ossl_threads_ctx_free((void *)t);
  144|       |    return NULL;
  145|    787|}
ossl_threads_ctx_free:
  148|    787|{
  149|    787|    OSSL_LIB_CTX_THREADS *t = (OSSL_LIB_CTX_THREADS *)vdata;
  150|       |
  151|    787|    if (t == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 787]
  ------------------
  152|      0|        return;
  153|       |
  154|    787|    ossl_crypto_mutex_free(&t->lock);
  155|    787|    ossl_crypto_condvar_free(&t->cond_finished);
  156|    787|    OPENSSL_free(t);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  157|    787|}

CRYPTO_THREAD_get_local_ex:
  259|  20.0M|{
  260|  20.0M|    MASTER_KEY_ENTRY *mkey;
  261|  20.0M|    CTX_TABLE_ENTRY ctxd;
  262|       |
  263|  20.0M|    ctx = (ctx == CRYPTO_THREAD_NO_CONTEXT) ? NULL : ossl_lib_ctx_get_concrete(ctx);
  ------------------
  |  |   25|  20.0M|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  |  Branch (263:11): [True: 20.0M, False: 34.5k]
  ------------------
  264|       |    /*
  265|       |     * Make sure the master key has been initialized
  266|       |     * NOTE: We use CRYPTO_THREAD_run_once here, rather than the
  267|       |     * RUN_ONCE macros.  We do this because this code is included both in
  268|       |     * libcrypto, and in fips.[dll|dylib|so].  FIPS attempts to avoid doing
  269|       |     * one time initialization of global data, and so suppresses the definition
  270|       |     * of RUN_ONCE, etc, meaning the build breaks if we were to use that with
  271|       |     * fips-enabled.  However, this is a special case in which we want/need
  272|       |     * this one bit of global data to be initialized in both the fips provider
  273|       |     * and in libcrypto, so we use CRYPTO_THREAD_run_one directly, which is
  274|       |     * always defined.
  275|       |     */
  276|  20.0M|    if (!CRYPTO_THREAD_run_once(&master_once, init_master_key))
  ------------------
  |  Branch (276:9): [True: 0, False: 20.0M]
  ------------------
  277|      0|        return NULL;
  278|       |
  279|  20.0M|    if (!ossl_assert(id < CRYPTO_THREAD_LOCAL_KEY_MAX))
  ------------------
  |  |   52|  20.0M|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  20.0M|    __FILE__, __LINE__)
  ------------------
  |  Branch (279:9): [True: 0, False: 20.0M]
  ------------------
  280|      0|        return NULL;
  281|       |
  282|       |    /*
  283|       |     * Get our master table sparse array, indexed by key id
  284|       |     */
  285|  20.0M|    mkey = CRYPTO_THREAD_get_local(&master_key);
  286|  20.0M|    if (mkey == NULL)
  ------------------
  |  Branch (286:9): [True: 1, False: 20.0M]
  ------------------
  287|      1|        return NULL;
  288|       |
  289|       |    /*
  290|       |     * Get the specific data entry in the master key
  291|       |     * table for the key id we are searching for
  292|       |     */
  293|  20.0M|    if (mkey[id].ctx_table == NULL)
  ------------------
  |  Branch (293:9): [True: 3, False: 20.0M]
  ------------------
  294|      3|        return NULL;
  295|       |
  296|       |    /*
  297|       |     * If we find an entry above, that will be a sparse array,
  298|       |     * indexed by OSSL_LIB_CTX.
  299|       |     * Note: Because we're using sparse arrays here, we can do an easy
  300|       |     * trick, since we know all OSSL_LIB_CTX pointers are unique.  By casting
  301|       |     * the pointer to a unitptr_t, we can use that as an ordinal index into
  302|       |     * the sparse array.
  303|       |     */
  304|  20.0M|    ctxd = ossl_sa_CTX_TABLE_ENTRY_get(mkey[id].ctx_table, (uintptr_t)ctx);
  305|       |
  306|       |    /*
  307|       |     * If we find an entry for the passed in context, return its data pointer
  308|       |     */
  309|  20.0M|    return ctxd;
  310|  20.0M|}
CRYPTO_THREAD_set_local_ex:
  338|  2.20k|{
  339|  2.20k|    MASTER_KEY_ENTRY *mkey;
  340|       |
  341|  2.20k|    ctx = (ctx == CRYPTO_THREAD_NO_CONTEXT) ? NULL : ossl_lib_ctx_get_concrete(ctx);
  ------------------
  |  |   25|  2.20k|#define CRYPTO_THREAD_NO_CONTEXT (void *)1
  ------------------
  |  Branch (341:11): [True: 5, False: 2.19k]
  ------------------
  342|       |    /*
  343|       |     * Make sure our master key is initialized
  344|       |     * See notes above on the use of CRYPTO_THREAD_run_once here
  345|       |     */
  346|  2.20k|    if (!CRYPTO_THREAD_run_once(&master_once, init_master_key))
  ------------------
  |  Branch (346:9): [True: 0, False: 2.20k]
  ------------------
  347|      0|        return 0;
  348|       |
  349|  2.20k|    if (!ossl_assert(id < CRYPTO_THREAD_LOCAL_KEY_MAX))
  ------------------
  |  |   52|  2.20k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  2.20k|    __FILE__, __LINE__)
  ------------------
  |  Branch (349:9): [True: 0, False: 2.20k]
  ------------------
  350|      0|        return 0;
  351|       |
  352|       |    /*
  353|       |     * Get our local master key data, which will be
  354|       |     * a sparse array indexed by the id parameter
  355|       |     */
  356|  2.20k|    mkey = CRYPTO_THREAD_get_local(&master_key);
  357|  2.20k|    if (mkey == NULL) {
  ------------------
  |  Branch (357:9): [True: 1, False: 2.20k]
  ------------------
  358|       |        /*
  359|       |         * we didn't find one, but that's ok, just initialize it now
  360|       |         */
  361|      1|        mkey = OPENSSL_calloc(CRYPTO_THREAD_LOCAL_KEY_MAX,
  ------------------
  |  |  112|      1|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  362|      1|            sizeof(MASTER_KEY_ENTRY));
  363|      1|        if (mkey == NULL)
  ------------------
  |  Branch (363:13): [True: 0, False: 1]
  ------------------
  364|      0|            return 0;
  365|       |        /*
  366|       |         * make sure to assign it to our master key thread-local storage
  367|       |         */
  368|      1|        if (!CRYPTO_THREAD_set_local(&master_key, mkey)) {
  ------------------
  |  Branch (368:13): [True: 0, False: 1]
  ------------------
  369|      0|            OPENSSL_free(mkey);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  370|      0|            return 0;
  371|      0|        }
  372|      1|    }
  373|       |
  374|       |    /*
  375|       |     * Find the entry that we are looking for using our id index
  376|       |     */
  377|  2.20k|    if (mkey[id].ctx_table == NULL) {
  ------------------
  |  Branch (377:9): [True: 3, False: 2.19k]
  ------------------
  378|       |
  379|       |        /*
  380|       |         * Didn't find it, that's ok, just add it now
  381|       |         */
  382|      3|        mkey[id].ctx_table = ossl_sa_CTX_TABLE_ENTRY_new();
  383|      3|        if (mkey[id].ctx_table == NULL)
  ------------------
  |  Branch (383:13): [True: 0, False: 3]
  ------------------
  384|      0|            return 0;
  385|      3|    }
  386|       |
  387|       |    /*
  388|       |     * Now go look up our per context entry, using the OSSL_LIB_CTX pointer
  389|       |     * that we've been provided.  Note we cast the pointer to a uintptr_t so
  390|       |     * as to use it as an index in the sparse array
  391|       |     *
  392|       |     * Assign to the entry in the table so that we can find it later
  393|       |     */
  394|  2.20k|    return ossl_sa_CTX_TABLE_ENTRY_set(mkey[id].ctx_table,
  395|  2.20k|        (uintptr_t)ctx, data);
  396|  2.20k|}
CRYPTO_THREAD_clean_local:
  399|      1|{
  400|      1|    MASTER_KEY_ENTRY *mkey;
  401|       |
  402|       |    /*
  403|       |     * If we never initialized the master key, there
  404|       |     * is no data to clean, so we are done here
  405|       |     */
  406|      1|    if (master_key_init == 0)
  ------------------
  |  Branch (406:9): [True: 0, False: 1]
  ------------------
  407|      0|        return;
  408|       |
  409|      1|    mkey = CRYPTO_THREAD_get_local(&master_key);
  410|      1|    if (mkey != NULL) {
  ------------------
  |  Branch (410:9): [True: 1, False: 0]
  ------------------
  411|      1|        clean_master_key(mkey);
  412|       |        CRYPTO_THREAD_set_local(&master_key, NULL);
  413|      1|    }
  414|      1|}
threads_common.c:init_master_key:
  216|      1|{
  217|       |    /*
  218|       |     * Note: We assign a cleanup function here, which is atypical for
  219|       |     * uses of CRYPTO_THREAD_init_local.  This is because, nominally
  220|       |     * we expect that the use of ossl_init_thread_start will be used
  221|       |     * to notify openssl of exiting threads.  However, in this case
  222|       |     * we want the metadata for this interface (the sparse arrays) to
  223|       |     * stay valid until the thread actually exits, which is what the
  224|       |     * clean_master_key function does.  Data held in the sparse arrays
  225|       |     * (that is assigned via CRYPTO_THREAD_set_local_ex), are still expected
  226|       |     * to be cleaned via the ossl_init_thread_start/stop api.
  227|       |     */
  228|      1|    if (!CRYPTO_THREAD_init_local(&master_key, clean_master_key))
  ------------------
  |  Branch (228:9): [True: 0, False: 1]
  ------------------
  229|      0|        return;
  230|       |
  231|       |    /*
  232|       |     * Indicate that the key has been set up.
  233|       |     */
  234|      1|    master_key_init = 1;
  235|      1|}
threads_common.c:clean_master_key:
  191|      1|{
  192|      1|    MASTER_KEY_ENTRY *mkey = data;
  193|      1|    int i;
  194|       |
  195|      1|    if (data == NULL)
  ------------------
  |  Branch (195:9): [True: 0, False: 1]
  ------------------
  196|      0|        return;
  197|       |
  198|      9|    for (i = 0; i < CRYPTO_THREAD_LOCAL_KEY_MAX; i++) {
  ------------------
  |  Branch (198:17): [True: 8, False: 1]
  ------------------
  199|      8|        if (mkey[i].ctx_table != NULL)
  ------------------
  |  Branch (199:13): [True: 3, False: 5]
  ------------------
  200|      3|            clean_master_key_id(&mkey[i]);
  201|      8|    }
  202|      1|    OPENSSL_free(mkey);
  ------------------
  |  |  131|      1|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  203|      1|}
threads_common.c:clean_master_key_id:
  173|      3|{
  174|      3|    ossl_sa_CTX_TABLE_ENTRY_free(entry->ctx_table);
  175|      3|}

ossl_rcu_write_lock:
  482|    789|{
  483|    789|    pthread_mutex_lock(&lock->write_lock);
  484|    789|    TSAN_FAKE_UNLOCK(&lock->write_lock);
  485|    789|}
ossl_rcu_write_unlock:
  488|    789|{
  489|    789|    TSAN_FAKE_LOCK(&lock->write_lock);
  490|    789|    pthread_mutex_unlock(&lock->write_lock);
  491|    789|}
ossl_synchronize_rcu:
  494|  1.57k|{
  495|  1.57k|    struct rcu_qp *qp;
  496|  1.57k|    uint64_t count;
  497|  1.57k|    uint32_t curr_id;
  498|  1.57k|    struct rcu_cb_item *cb_items, *tmpcb;
  499|       |
  500|  1.57k|    pthread_mutex_lock(&lock->write_lock);
  501|  1.57k|    cb_items = lock->cb_items;
  502|  1.57k|    lock->cb_items = NULL;
  503|  1.57k|    pthread_mutex_unlock(&lock->write_lock);
  504|       |
  505|  1.57k|    qp = update_qp(lock, &curr_id);
  506|       |
  507|       |    /* retire in order */
  508|  1.57k|    pthread_mutex_lock(&lock->prior_lock);
  509|  1.57k|    while (lock->next_to_retire != curr_id)
  ------------------
  |  Branch (509:12): [True: 0, False: 1.57k]
  ------------------
  510|      0|        pthread_cond_wait(&lock->prior_signal, &lock->prior_lock);
  511|       |
  512|       |    /*
  513|       |     * wait for the reader count to reach zero
  514|       |     * Note the use of __ATOMIC_ACQUIRE here to ensure that any
  515|       |     * prior __ATOMIC_RELEASE write operation in ossl_rcu_read_unlock
  516|       |     * is visible prior to our read
  517|       |     * however this is likely just necessary to silence a tsan warning
  518|       |     * because the read side should not do any write operation
  519|       |     * outside the atomic itself
  520|       |     */
  521|  1.57k|    do {
  522|  1.57k|        count = ATOMIC_LOAD_N(uint64_t, &qp->users, __ATOMIC_ACQUIRE);
  ------------------
  |  |  129|  1.57k|#define ATOMIC_LOAD_N(t, p, o) __atomic_load_n(p, o)
  ------------------
  523|  1.57k|    } while (count != (uint64_t)0);
  ------------------
  |  Branch (523:14): [True: 0, False: 1.57k]
  ------------------
  524|       |
  525|  1.57k|    lock->next_to_retire++;
  526|  1.57k|    pthread_cond_broadcast(&lock->prior_signal);
  527|  1.57k|    pthread_mutex_unlock(&lock->prior_lock);
  528|       |
  529|  1.57k|    retire_qp(lock, qp);
  530|       |
  531|       |    /* handle any callbacks that we have */
  532|  2.36k|    while (cb_items != NULL) {
  ------------------
  |  Branch (532:12): [True: 787, False: 1.57k]
  ------------------
  533|    787|        tmpcb = cb_items;
  534|    787|        cb_items = cb_items->next;
  535|    787|        tmpcb->fn(tmpcb->data);
  536|    787|        OPENSSL_free(tmpcb);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  537|    787|    }
  538|  1.57k|}
ossl_rcu_call:
  545|    787|{
  546|    787|    struct rcu_cb_item *new = OPENSSL_zalloc(sizeof(*new));
  ------------------
  |  |  108|    787|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  547|       |
  548|    787|    if (new == NULL)
  ------------------
  |  Branch (548:9): [True: 0, False: 787]
  ------------------
  549|      0|        return 0;
  550|       |
  551|    787|    new->data = data;
  552|    787|    new->fn = cb;
  553|       |
  554|    787|    new->next = lock->cb_items;
  555|    787|    lock->cb_items = new;
  556|       |
  557|    787|    return 1;
  558|    787|}
ossl_rcu_uptr_deref:
  561|  13.2M|{
  562|  13.2M|    return ATOMIC_LOAD_N(pvoid, p, __ATOMIC_ACQUIRE);
  ------------------
  |  |  129|  13.2M|#define ATOMIC_LOAD_N(t, p, o) __atomic_load_n(p, o)
  ------------------
  563|  13.2M|}
ossl_rcu_assign_uptr:
  566|   372k|{
  567|   372k|    ATOMIC_STORE(pvoid, p, v, __ATOMIC_RELEASE);
  ------------------
  |  |  131|   372k|#define ATOMIC_STORE(t, p, v, o) __atomic_store(p, v, o)
  ------------------
  568|   372k|}
ossl_rcu_lock_new:
  571|    788|{
  572|    788|    struct rcu_lock_st *new;
  573|    788|    pthread_mutex_t *mutexes[3] = { NULL };
  574|    788|    pthread_cond_t *conds[2] = { NULL };
  575|    788|    int i;
  576|       |
  577|       |    /*
  578|       |     * We need a minimum of 2 qp's
  579|       |     */
  580|    788|    if (num_writers < 2)
  ------------------
  |  Branch (580:9): [True: 788, False: 0]
  ------------------
  581|    788|        num_writers = 2;
  582|       |
  583|    788|    ctx = ossl_lib_ctx_get_concrete(ctx);
  584|    788|    if (ctx == NULL)
  ------------------
  |  Branch (584:9): [True: 0, False: 788]
  ------------------
  585|      0|        return 0;
  586|       |
  587|    788|    new = OPENSSL_zalloc(sizeof(*new));
  ------------------
  |  |  108|    788|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  588|    788|    if (new == NULL)
  ------------------
  |  Branch (588:9): [True: 0, False: 788]
  ------------------
  589|      0|        return NULL;
  590|       |
  591|    788|    new->ctx = ctx;
  592|    788|    i = 0;
  593|    788|    mutexes[i] = pthread_mutex_init(&new->write_lock, NULL) == 0 ? &new->write_lock : NULL;
  ------------------
  |  Branch (593:18): [True: 788, False: 0]
  ------------------
  594|    788|    if (mutexes[i++] == NULL)
  ------------------
  |  Branch (594:9): [True: 0, False: 788]
  ------------------
  595|      0|        goto err;
  596|    788|    mutexes[i] = pthread_mutex_init(&new->prior_lock, NULL) == 0 ? &new->prior_lock : NULL;
  ------------------
  |  Branch (596:18): [True: 788, False: 0]
  ------------------
  597|    788|    if (mutexes[i++] == NULL)
  ------------------
  |  Branch (597:9): [True: 0, False: 788]
  ------------------
  598|      0|        goto err;
  599|    788|    mutexes[i] = pthread_mutex_init(&new->alloc_lock, NULL) == 0 ? &new->alloc_lock : NULL;
  ------------------
  |  Branch (599:18): [True: 788, False: 0]
  ------------------
  600|    788|    if (mutexes[i++] == NULL)
  ------------------
  |  Branch (600:9): [True: 0, False: 788]
  ------------------
  601|      0|        goto err;
  602|    788|    conds[i - 3] = pthread_cond_init(&new->prior_signal, NULL) == 0 ? &new->prior_signal : NULL;
  ------------------
  |  Branch (602:20): [True: 788, False: 0]
  ------------------
  603|    788|    if (conds[i - 3] == NULL)
  ------------------
  |  Branch (603:9): [True: 0, False: 788]
  ------------------
  604|      0|        goto err;
  605|    788|    i++;
  606|    788|    conds[i - 3] = pthread_cond_init(&new->alloc_signal, NULL) == 0 ? &new->alloc_signal : NULL;
  ------------------
  |  Branch (606:20): [True: 788, False: 0]
  ------------------
  607|    788|    if (conds[i - 3] == NULL)
  ------------------
  |  Branch (607:9): [True: 0, False: 788]
  ------------------
  608|      0|        goto err;
  609|    788|    i++;
  610|    788|    new->qp_group = allocate_new_qp_group(new, num_writers);
  611|    788|    if (new->qp_group == NULL)
  ------------------
  |  Branch (611:9): [True: 0, False: 788]
  ------------------
  612|      0|        goto err;
  613|       |
  614|    788|    return new;
  615|       |
  616|      0|err:
  617|      0|    for (i = 0; i < 3; i++)
  ------------------
  |  Branch (617:17): [True: 0, False: 0]
  ------------------
  618|      0|        if (mutexes[i] != NULL)
  ------------------
  |  Branch (618:13): [True: 0, False: 0]
  ------------------
  619|      0|            pthread_mutex_destroy(mutexes[i]);
  620|      0|    for (i = 0; i < 2; i++)
  ------------------
  |  Branch (620:17): [True: 0, False: 0]
  ------------------
  621|      0|        if (conds[i] != NULL)
  ------------------
  |  Branch (621:13): [True: 0, False: 0]
  ------------------
  622|      0|            pthread_cond_destroy(conds[i]);
  623|      0|    OPENSSL_free(new->qp_group);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  624|      0|    OPENSSL_free(new);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  625|       |    return NULL;
  626|    788|}
ossl_rcu_lock_free:
  629|    788|{
  630|    788|    struct rcu_lock_st *rlock = (struct rcu_lock_st *)lock;
  631|       |
  632|    788|    if (lock == NULL)
  ------------------
  |  Branch (632:9): [True: 0, False: 788]
  ------------------
  633|      0|        return;
  634|       |
  635|       |    /* make sure we're synchronized */
  636|    788|    ossl_synchronize_rcu(rlock);
  637|       |
  638|    788|    OPENSSL_free(rlock->qp_group);
  ------------------
  |  |  131|    788|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  639|       |    /*
  640|       |     * Some targets (BSD) allocate heap when initializing
  641|       |     * a mutex or condition, to prevent leaks, those need
  642|       |     * to be destroyed here
  643|       |     */
  644|    788|    pthread_mutex_destroy(&rlock->write_lock);
  645|    788|    pthread_mutex_destroy(&rlock->prior_lock);
  646|    788|    pthread_mutex_destroy(&rlock->alloc_lock);
  647|    788|    pthread_cond_destroy(&rlock->prior_signal);
  648|    788|    pthread_cond_destroy(&rlock->alloc_signal);
  649|       |
  650|       |    /* There should only be a single qp left now */
  651|    788|    OPENSSL_free(rlock);
  ------------------
  |  |  131|    788|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  652|    788|}
CRYPTO_THREAD_lock_new:
  901|  1.57M|{
  902|  1.57M|#ifdef USE_RWLOCK
  903|  1.57M|    CRYPTO_RWLOCK *lock;
  904|       |
  905|  1.57M|    ossl_init_rwlock_contention_data();
  906|       |
  907|  1.57M|    if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL)
  ------------------
  |  |  108|  1.57M|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (907:9): [True: 0, False: 1.57M]
  ------------------
  908|       |        /* Don't set error, to avoid recursion blowup. */
  909|      0|        return NULL;
  910|       |
  911|  1.57M|    if (pthread_rwlock_init(lock, NULL) != 0) {
  ------------------
  |  Branch (911:9): [True: 0, False: 1.57M]
  ------------------
  912|      0|        OPENSSL_free(lock);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  913|      0|        return NULL;
  914|      0|    }
  915|       |#else
  916|       |    pthread_mutexattr_t attr;
  917|       |    CRYPTO_RWLOCK *lock;
  918|       |
  919|       |    if ((lock = OPENSSL_zalloc(sizeof(pthread_mutex_t))) == NULL)
  920|       |        /* Don't set error, to avoid recursion blowup. */
  921|       |        return NULL;
  922|       |
  923|       |    /*
  924|       |     * We don't use recursive mutexes, but try to catch errors if we do.
  925|       |     */
  926|       |    pthread_mutexattr_init(&attr);
  927|       |#if !defined(__TANDEM) && !defined(_SPT_MODEL_)
  928|       |#if !defined(NDEBUG) && !defined(OPENSSL_NO_MUTEX_ERRORCHECK)
  929|       |    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
  930|       |#endif
  931|       |#else
  932|       |    /* The SPT Thread Library does not define MUTEX attributes. */
  933|       |#endif
  934|       |
  935|       |    if (pthread_mutex_init(lock, &attr) != 0) {
  936|       |        pthread_mutexattr_destroy(&attr);
  937|       |        OPENSSL_free(lock);
  938|       |        return NULL;
  939|       |    }
  940|       |
  941|       |    pthread_mutexattr_destroy(&attr);
  942|       |#endif
  943|       |
  944|  1.57M|    return lock;
  945|  1.57M|}
CRYPTO_THREAD_read_lock:
  948|  14.8M|{
  949|  14.8M|#ifdef USE_RWLOCK
  950|  14.8M|    if (!ossl_assert(ossl_rwlock_rdlock(lock) == 0))
  ------------------
  |  |   52|  14.8M|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  14.8M|    __FILE__, __LINE__)
  ------------------
  |  Branch (950:9): [True: 0, False: 14.8M]
  ------------------
  951|      0|        return 0;
  952|       |#else
  953|       |    if (pthread_mutex_lock(lock) != 0) {
  954|       |        assert(errno != EDEADLK && errno != EBUSY);
  955|       |        return 0;
  956|       |    }
  957|       |#endif
  958|       |
  959|  14.8M|    return 1;
  960|  14.8M|}
CRYPTO_THREAD_write_lock:
  963|  1.70M|{
  964|  1.70M|#ifdef USE_RWLOCK
  965|  1.70M|    if (!ossl_assert(ossl_rwlock_wrlock(lock) == 0))
  ------------------
  |  |   52|  1.70M|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  1.70M|    __FILE__, __LINE__)
  ------------------
  |  Branch (965:9): [True: 0, False: 1.70M]
  ------------------
  966|      0|        return 0;
  967|       |#else
  968|       |    if (pthread_mutex_lock(lock) != 0) {
  969|       |        assert(errno != EDEADLK && errno != EBUSY);
  970|       |        return 0;
  971|       |    }
  972|       |#endif
  973|       |
  974|  1.70M|    return 1;
  975|  1.70M|}
CRYPTO_THREAD_unlock:
  978|  16.5M|{
  979|  16.5M|#ifdef USE_RWLOCK
  980|  16.5M|    if (ossl_rwlock_unlock(lock) != 0)
  ------------------
  |  Branch (980:9): [True: 0, False: 16.5M]
  ------------------
  981|      0|        return 0;
  982|       |#else
  983|       |    if (pthread_mutex_unlock(lock) != 0) {
  984|       |        assert(errno != EPERM);
  985|       |        return 0;
  986|       |    }
  987|       |#endif
  988|       |
  989|  16.5M|    return 1;
  990|  16.5M|}
CRYPTO_THREAD_lock_free:
  993|  1.57M|{
  994|  1.57M|    if (lock == NULL)
  ------------------
  |  Branch (994:9): [True: 1.88k, False: 1.57M]
  ------------------
  995|  1.88k|        return;
  996|       |
  997|  1.57M|#ifdef USE_RWLOCK
  998|  1.57M|    pthread_rwlock_destroy(lock);
  999|       |#else
 1000|       |    pthread_mutex_destroy(lock);
 1001|       |#endif
 1002|  1.57M|    OPENSSL_free(lock);
  ------------------
  |  |  131|  1.57M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1003|       |
 1004|  1.57M|    return;
 1005|  1.57M|}
CRYPTO_THREAD_run_once:
 1008|  54.7M|{
 1009|  54.7M|    if (ossl_unlikely(pthread_once(once, init) != 0))
  ------------------
  |  |   23|  54.7M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 54.7M]
  |  |  ------------------
  ------------------
 1010|      0|        return 0;
 1011|       |
 1012|  54.7M|    return 1;
 1013|  54.7M|}
CRYPTO_THREAD_init_local:
 1016|      4|{
 1017|       |
 1018|      4|#ifndef FIPS_MODULE
 1019|      4|    if (!ossl_init_thread())
  ------------------
  |  Branch (1019:9): [True: 0, False: 4]
  ------------------
 1020|      0|        return 0;
 1021|      4|#endif
 1022|       |
 1023|      4|    if (pthread_key_create(key, cleanup) != 0)
  ------------------
  |  Branch (1023:9): [True: 0, False: 4]
  ------------------
 1024|      0|        return 0;
 1025|       |
 1026|      4|    return 1;
 1027|      4|}
CRYPTO_THREAD_get_local:
 1030|  31.5M|{
 1031|  31.5M|    return pthread_getspecific(*key);
 1032|  31.5M|}
CRYPTO_THREAD_set_local:
 1035|      5|{
 1036|      5|    if (pthread_setspecific(*key, val) != 0)
  ------------------
  |  Branch (1036:9): [True: 0, False: 5]
  ------------------
 1037|      0|        return 0;
 1038|       |
 1039|      5|    return 1;
 1040|      5|}
CRYPTO_THREAD_cleanup_local:
 1043|      3|{
 1044|      3|    if (pthread_key_delete(*key) != 0)
  ------------------
  |  Branch (1044:9): [True: 0, False: 3]
  ------------------
 1045|      0|        return 0;
 1046|       |
 1047|      3|    return 1;
 1048|      3|}
CRYPTO_THREAD_get_current_id:
 1051|      6|{
 1052|      6|    return pthread_self();
 1053|      6|}
CRYPTO_THREAD_compare_id:
 1056|      5|{
 1057|      5|    return pthread_equal(a, b);
 1058|      5|}
CRYPTO_atomic_add:
 1061|   253k|{
 1062|   253k|#if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
 1063|   253k|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (1063:9): [True: 253k, Folded]
  ------------------
 1064|   253k|        *ret = __atomic_add_fetch(val, amount, __ATOMIC_ACQ_REL);
 1065|   253k|        return 1;
 1066|   253k|    }
 1067|       |#elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
 1068|       |    /* This will work for all future Solaris versions. */
 1069|       |    if (ret != NULL) {
 1070|       |        *ret = atomic_add_int_nv((volatile unsigned int *)val, amount);
 1071|       |        return 1;
 1072|       |    }
 1073|       |#endif
 1074|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (1074:9): [True: 0, False: 0]
  |  Branch (1074:25): [True: 0, False: 0]
  ------------------
 1075|      0|        return 0;
 1076|       |
 1077|      0|    *val += amount;
 1078|      0|    *ret = *val;
 1079|       |
 1080|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (1080:9): [True: 0, False: 0]
  ------------------
 1081|      0|        return 0;
 1082|       |
 1083|      0|    return 1;
 1084|      0|}
CRYPTO_atomic_or:
 1140|      3|{
 1141|      3|#if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
 1142|      3|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (1142:9): [True: 3, Folded]
  ------------------
 1143|      3|        *ret = __atomic_or_fetch(val, op, __ATOMIC_ACQ_REL);
 1144|      3|        return 1;
 1145|      3|    }
 1146|       |#elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
 1147|       |    /* This will work for all future Solaris versions. */
 1148|       |    if (ret != NULL) {
 1149|       |        *ret = atomic_or_64_nv(val, op);
 1150|       |        return 1;
 1151|       |    }
 1152|       |#endif
 1153|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (1153:9): [True: 0, False: 0]
  |  Branch (1153:25): [True: 0, False: 0]
  ------------------
 1154|      0|        return 0;
 1155|      0|    *val |= op;
 1156|      0|    *ret = *val;
 1157|       |
 1158|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (1158:9): [True: 0, False: 0]
  ------------------
 1159|      0|        return 0;
 1160|       |
 1161|      0|    return 1;
 1162|      0|}
CRYPTO_atomic_load:
 1165|  30.0M|{
 1166|  30.0M|#if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
 1167|  30.0M|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (1167:9): [True: 30.0M, Folded]
  ------------------
 1168|  30.0M|        __atomic_load(val, ret, __ATOMIC_ACQUIRE);
 1169|  30.0M|        return 1;
 1170|  30.0M|    }
 1171|       |#elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
 1172|       |    /* This will work for all future Solaris versions. */
 1173|       |    if (ret != NULL) {
 1174|       |        *ret = atomic_or_64_nv(val, 0);
 1175|       |        return 1;
 1176|       |    }
 1177|       |#endif
 1178|      0|    if (lock == NULL || !CRYPTO_THREAD_read_lock(lock))
  ------------------
  |  Branch (1178:9): [True: 0, False: 0]
  |  Branch (1178:25): [True: 0, False: 0]
  ------------------
 1179|      0|        return 0;
 1180|      0|    *ret = *val;
 1181|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (1181:9): [True: 0, False: 0]
  ------------------
 1182|      0|        return 0;
 1183|       |
 1184|      0|    return 1;
 1185|      0|}
CRYPTO_atomic_store:
 1188|   371k|{
 1189|   371k|#if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
 1190|   371k|    if (__atomic_is_lock_free(sizeof(*dst), dst)) {
  ------------------
  |  Branch (1190:9): [True: 371k, Folded]
  ------------------
 1191|   371k|        __atomic_store(dst, &val, __ATOMIC_RELEASE);
 1192|   371k|        return 1;
 1193|   371k|    }
 1194|       |#elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
 1195|       |    /* This will work for all future Solaris versions. */
 1196|       |    if (dst != NULL) {
 1197|       |        atomic_swap_64(dst, val);
 1198|       |        return 1;
 1199|       |    }
 1200|       |#endif
 1201|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (1201:9): [True: 0, False: 0]
  |  Branch (1201:25): [True: 0, False: 0]
  ------------------
 1202|      0|        return 0;
 1203|      0|    *dst = val;
 1204|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (1204:9): [True: 0, False: 0]
  ------------------
 1205|      0|        return 0;
 1206|       |
 1207|      0|    return 1;
 1208|      0|}
openssl_get_fork_id:
 1241|  36.2k|{
 1242|  36.2k|    return getpid();
 1243|  36.2k|}
threads_pthread.c:update_qp:
  419|  1.57k|{
  420|  1.57k|    uint32_t current_idx;
  421|       |
  422|  1.57k|    pthread_mutex_lock(&lock->alloc_lock);
  423|       |
  424|       |    /*
  425|       |     * we need at least one qp to be available with one
  426|       |     * left over, so that readers can start working on
  427|       |     * one that isn't yet being waited on
  428|       |     */
  429|  1.57k|    while (lock->group_count - lock->writers_alloced < 2)
  ------------------
  |  Branch (429:12): [True: 0, False: 1.57k]
  ------------------
  430|       |        /* we have to wait for one to be free */
  431|      0|        pthread_cond_wait(&lock->alloc_signal, &lock->alloc_lock);
  432|       |
  433|  1.57k|    current_idx = lock->current_alloc_idx;
  434|       |
  435|       |    /* Allocate the qp */
  436|  1.57k|    lock->writers_alloced++;
  437|       |
  438|       |    /* increment the allocation index */
  439|  1.57k|    lock->current_alloc_idx = (lock->current_alloc_idx + 1) % lock->group_count;
  440|       |
  441|  1.57k|    *curr_id = lock->id_ctr;
  442|  1.57k|    lock->id_ctr++;
  443|       |
  444|       |    /*
  445|       |     * make the current state of everything visible by this release
  446|       |     * when get_hold_current_qp acquires the next qp
  447|       |     */
  448|  1.57k|    ATOMIC_STORE_N(uint32_t, &lock->reader_idx, lock->current_alloc_idx,
  ------------------
  |  |  130|  1.57k|#define ATOMIC_STORE_N(t, p, v, o) __atomic_store_n(p, v, o)
  ------------------
  449|  1.57k|        __ATOMIC_RELEASE);
  450|       |
  451|       |    /*
  452|       |     * this should make sure that the new value of reader_idx is visible in
  453|       |     * get_hold_current_qp, directly after incrementing the users count
  454|       |     */
  455|  1.57k|    ATOMIC_ADD_FETCH(&lock->qp_group[current_idx].users, (uint64_t)0,
  ------------------
  |  |  132|  1.57k|#define ATOMIC_ADD_FETCH(p, v, o) __atomic_add_fetch(p, v, o)
  ------------------
  456|  1.57k|        __ATOMIC_RELEASE);
  457|       |
  458|       |    /* wake up any waiters */
  459|  1.57k|    pthread_cond_signal(&lock->alloc_signal);
  460|  1.57k|    pthread_mutex_unlock(&lock->alloc_lock);
  461|  1.57k|    return &lock->qp_group[current_idx];
  462|  1.57k|}
threads_pthread.c:retire_qp:
  465|  1.57k|{
  466|  1.57k|    pthread_mutex_lock(&lock->alloc_lock);
  467|  1.57k|    lock->writers_alloced--;
  468|  1.57k|    pthread_cond_signal(&lock->alloc_signal);
  469|  1.57k|    pthread_mutex_unlock(&lock->alloc_lock);
  470|  1.57k|}
threads_pthread.c:allocate_new_qp_group:
  474|    788|{
  475|    788|    struct rcu_qp *new = OPENSSL_calloc(count, sizeof(*new));
  ------------------
  |  |  112|    788|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  476|       |
  477|    788|    lock->group_count = count;
  478|    788|    return new;
  479|    788|}
threads_pthread.c:ossl_init_rwlock_contention_data:
  880|  1.57M|{
  881|  1.57M|}
threads_pthread.c:ossl_rwlock_rdlock:
  884|  14.8M|{
  885|  14.8M|    return pthread_rwlock_rdlock(rwlock);
  886|  14.8M|}
threads_pthread.c:ossl_rwlock_wrlock:
  889|  1.70M|{
  890|  1.70M|    return pthread_rwlock_wrlock(rwlock);
  891|  1.70M|}
threads_pthread.c:ossl_rwlock_unlock:
  894|  16.5M|{
  895|  16.5M|    return pthread_rwlock_unlock(rwlock);
  896|  16.5M|}

ossl_time_now:
   16|  3.40k|{
   17|  3.40k|    OSSL_TIME r;
   18|       |
   19|       |#if defined(_WIN32) && !defined(OPENSSL_SYS_UEFI)
   20|       |    SYSTEMTIME st;
   21|       |    union {
   22|       |        unsigned __int64 ul;
   23|       |        FILETIME ft;
   24|       |    } now;
   25|       |
   26|       |    GetSystemTime(&st);
   27|       |    SystemTimeToFileTime(&st, &now.ft);
   28|       |    /* re-bias to 1/1/1970 */
   29|       |#ifdef __MINGW32__
   30|       |    now.ul -= 116444736000000000ULL;
   31|       |#else
   32|       |    now.ul -= 116444736000000000UI64;
   33|       |#endif
   34|       |    r.t = ((uint64_t)now.ul) * (OSSL_TIME_SECOND / 10000000);
   35|       |#else /* defined(_WIN32) */
   36|  3.40k|    struct timeval t;
   37|       |
   38|  3.40k|    if (gettimeofday(&t, NULL) < 0) {
  ------------------
  |  Branch (38:9): [True: 0, False: 3.40k]
  ------------------
   39|      0|        ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   74|      0|#define ERR_LIB_SYS 2
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   30|      0|#define get_last_sys_error() errno
  ------------------
   40|      0|            "calling gettimeofday()");
   41|      0|        return ossl_time_zero();
   42|      0|    }
   43|  3.40k|    if (t.tv_sec <= 0)
  ------------------
  |  Branch (43:9): [True: 0, False: 3.40k]
  ------------------
   44|      0|        r.t = t.tv_usec <= 0 ? 0 : t.tv_usec * OSSL_TIME_US;
  ------------------
  |  |   37|      0|#define OSSL_TIME_US (OSSL_TIME_MS / 1000)
  |  |  ------------------
  |  |  |  |   34|      0|#define OSSL_TIME_MS (OSSL_TIME_SECOND / 1000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|      0|#define OSSL_TIME_SECOND ((uint64_t)1000000000)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (44:15): [True: 0, False: 0]
  ------------------
   45|  3.40k|    else
   46|  3.40k|        r.t = ((uint64_t)t.tv_sec * 1000000 + t.tv_usec) * OSSL_TIME_US;
  ------------------
  |  |   37|  3.40k|#define OSSL_TIME_US (OSSL_TIME_MS / 1000)
  |  |  ------------------
  |  |  |  |   34|  3.40k|#define OSSL_TIME_MS (OSSL_TIME_SECOND / 1000)
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  3.40k|#define OSSL_TIME_SECOND ((uint64_t)1000000000)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   47|  3.40k|#endif /* defined(_WIN32) */
   48|  3.40k|    return r;
   49|  3.40k|}

ossl_trace_cleanup:
  342|      1|{
  343|       |#ifndef OPENSSL_NO_TRACE
  344|       |    int category;
  345|       |    BIO *channel = NULL;
  346|       |    const char *prefix = NULL;
  347|       |    const char *suffix = NULL;
  348|       |
  349|       |    for (category = 0; category < OSSL_TRACE_CATEGORY_NUM; category++) {
  350|       |        /* We force the TRACE category to be treated last */
  351|       |        if (category == OSSL_TRACE_CATEGORY_TRACE)
  352|       |            continue;
  353|       |        set_trace_data(category, 0, &channel, &prefix, &suffix,
  354|       |            trace_attach_cb, trace_detach_cb);
  355|       |    }
  356|       |    set_trace_data(OSSL_TRACE_CATEGORY_TRACE, 0, &channel,
  357|       |        &prefix, &suffix,
  358|       |        trace_attach_cb, trace_detach_cb);
  359|       |    CRYPTO_THREAD_lock_free(trace_lock);
  360|       |#endif
  361|      1|}
OSSL_trace_set_channel:
  364|      1|{
  365|       |#ifndef OPENSSL_NO_TRACE
  366|       |    if (category >= 0 && category < OSSL_TRACE_CATEGORY_NUM)
  367|       |        return set_trace_data(category, SIMPLE_CHANNEL, &channel, NULL, NULL,
  368|       |            trace_attach_cb, trace_detach_cb);
  369|       |#endif
  370|      1|    return 0;
  371|      1|}

ossl_err_load_TS_strings:
   82|      1|{
   83|      1|#ifndef OPENSSL_NO_ERR
   84|      1|    if (ERR_reason_error_string(TS_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (84:9): [True: 1, False: 0]
  ------------------
   85|      1|        ERR_load_strings_const(TS_str_reasons);
   86|      1|#endif
   87|      1|    return 1;
   88|      1|}

ossl_err_load_UI_strings:
   41|      1|{
   42|      1|#ifndef OPENSSL_NO_ERR
   43|      1|    if (ERR_reason_error_string(UI_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (43:9): [True: 1, False: 0]
  ------------------
   44|      1|        ERR_load_strings_const(UI_str_reasons);
   45|      1|#endif
   46|      1|    return 1;
   47|      1|}

X509_LOOKUP_hash_dir:
   78|  2.82k|{
   79|  2.82k|    return &x509_dir_lookup;
   80|  2.82k|}
by_dir.c:new_dir:
  109|  1.66k|{
  110|  1.66k|    BY_DIR *a = OPENSSL_malloc(sizeof(*a));
  ------------------
  |  |  106|  1.66k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  111|       |
  112|  1.66k|    if (a == NULL)
  ------------------
  |  Branch (112:9): [True: 0, False: 1.66k]
  ------------------
  113|      0|        return 0;
  114|       |
  115|  1.66k|    if ((a->buffer = BUF_MEM_new()) == NULL) {
  ------------------
  |  Branch (115:9): [True: 0, False: 1.66k]
  ------------------
  116|      0|        ERR_raise(ERR_LIB_X509, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  117|      0|        goto err;
  118|      0|    }
  119|  1.66k|    a->dirs = NULL;
  120|  1.66k|    a->lock = CRYPTO_THREAD_lock_new();
  121|  1.66k|    if (a->lock == NULL) {
  ------------------
  |  Branch (121:9): [True: 0, False: 1.66k]
  ------------------
  122|      0|        BUF_MEM_free(a->buffer);
  123|      0|        ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  124|      0|        goto err;
  125|      0|    }
  126|  1.66k|    lu->method_data = a;
  127|  1.66k|    return 1;
  128|       |
  129|      0|err:
  130|      0|    OPENSSL_free(a);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  131|      0|    return 0;
  132|  1.66k|}
by_dir.c:free_dir:
  157|  1.66k|{
  158|  1.66k|    BY_DIR *a = (BY_DIR *)lu->method_data;
  159|       |
  160|  1.66k|    sk_BY_DIR_ENTRY_pop_free(a->dirs, by_dir_entry_free);
  161|  1.66k|    BUF_MEM_free(a->buffer);
  162|  1.66k|    CRYPTO_THREAD_lock_free(a->lock);
  163|  1.66k|    OPENSSL_free(a);
  ------------------
  |  |  131|  1.66k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  164|  1.66k|}
by_dir.c:by_dir_entry_free:
  150|  3.16k|{
  151|  3.16k|    OPENSSL_free(ent->dir);
  ------------------
  |  |  131|  3.16k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  152|  3.16k|    sk_BY_DIR_HASH_pop_free(ent->hashes, by_dir_hash_free);
  153|  3.16k|    OPENSSL_free(ent);
  ------------------
  |  |  131|  3.16k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  154|  3.16k|}
by_dir.c:dir_ctrl:
   84|  2.82k|{
   85|  2.82k|    int ret = 0;
   86|  2.82k|    BY_DIR *ld = (BY_DIR *)ctx->method_data;
   87|       |
   88|  2.82k|    switch (cmd) {
  ------------------
  |  Branch (88:13): [True: 2.82k, False: 0]
  ------------------
   89|  2.82k|    case X509_L_ADD_DIR:
  ------------------
  |  |  284|  2.82k|#define X509_L_ADD_DIR 2
  ------------------
  |  Branch (89:5): [True: 2.82k, False: 0]
  ------------------
   90|  2.82k|        if (argl == X509_FILETYPE_DEFAULT) {
  ------------------
  |  |  170|  2.82k|#define X509_FILETYPE_DEFAULT 3
  ------------------
  |  Branch (90:13): [True: 0, False: 2.82k]
  ------------------
   91|      0|            const char *dir = ossl_safe_getenv(X509_get_default_cert_dir_env());
   92|       |
   93|      0|            if (dir)
  ------------------
  |  Branch (93:17): [True: 0, False: 0]
  ------------------
   94|      0|                ret = add_cert_dir(ld, dir, X509_FILETYPE_PEM);
  ------------------
  |  |  168|      0|#define X509_FILETYPE_PEM 1
  ------------------
   95|      0|            else
   96|      0|                ret = add_cert_dir(ld, X509_get_default_cert_dir(),
   97|      0|                    X509_FILETYPE_PEM);
  ------------------
  |  |  168|      0|#define X509_FILETYPE_PEM 1
  ------------------
   98|      0|            if (!ret) {
  ------------------
  |  Branch (98:17): [True: 0, False: 0]
  ------------------
   99|      0|                ERR_raise(ERR_LIB_X509, X509_R_LOADING_CERT_DIR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  100|      0|            }
  101|      0|        } else
  102|  2.82k|            ret = add_cert_dir(ld, argp, (int)argl);
  103|  2.82k|        break;
  104|  2.82k|    }
  105|  2.82k|    return ret;
  106|  2.82k|}
by_dir.c:add_cert_dir:
  167|  2.82k|{
  168|  2.82k|    int j;
  169|  2.82k|    size_t len;
  170|  2.82k|    const char *s, *ss, *p;
  171|       |
  172|  2.82k|    if (dir == NULL || *dir == '\0') {
  ------------------
  |  Branch (172:9): [True: 0, False: 2.82k]
  |  Branch (172:24): [True: 3, False: 2.82k]
  ------------------
  173|      3|        ERR_raise(ERR_LIB_X509, X509_R_INVALID_DIRECTORY);
  ------------------
  |  |  404|      3|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      3|    (ERR_new(),                                                  \
  |  |  |  |  407|      3|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      3|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      3|        ERR_set_error)
  |  |  ------------------
  ------------------
  174|      3|        return 0;
  175|      3|    }
  176|       |
  177|  2.82k|    s = dir;
  178|  2.82k|    p = s;
  179|   128k|    do {
  180|   128k|        if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) {
  ------------------
  |  |  213|   128k|#define LIST_SEPARATOR_CHAR ':'
  ------------------
  |  Branch (180:13): [True: 6.01k, False: 122k]
  |  Branch (180:44): [True: 2.82k, False: 120k]
  ------------------
  181|  8.83k|            BY_DIR_ENTRY *ent;
  182|       |
  183|  8.83k|            ss = s;
  184|  8.83k|            s = p + 1;
  185|  8.83k|            len = p - ss;
  186|  8.83k|            if (len == 0)
  ------------------
  |  Branch (186:17): [True: 575, False: 8.25k]
  ------------------
  187|    575|                continue;
  188|   361k|            for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) {
  ------------------
  |  Branch (188:25): [True: 357k, False: 3.16k]
  ------------------
  189|   357k|                ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j);
  190|   357k|                if (strlen(ent->dir) == len && strncmp(ent->dir, ss, len) == 0)
  ------------------
  |  Branch (190:21): [True: 20.1k, False: 337k]
  |  Branch (190:48): [True: 5.09k, False: 15.0k]
  ------------------
  191|  5.09k|                    break;
  192|   357k|            }
  193|  8.25k|            if (j < sk_BY_DIR_ENTRY_num(ctx->dirs))
  ------------------
  |  Branch (193:17): [True: 5.09k, False: 3.16k]
  ------------------
  194|  5.09k|                continue;
  195|  3.16k|            if (ctx->dirs == NULL) {
  ------------------
  |  Branch (195:17): [True: 1.66k, False: 1.50k]
  ------------------
  196|  1.66k|                ctx->dirs = sk_BY_DIR_ENTRY_new_null();
  197|  1.66k|                if (!ctx->dirs) {
  ------------------
  |  Branch (197:21): [True: 0, False: 1.66k]
  ------------------
  198|      0|                    ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  199|      0|                    return 0;
  200|      0|                }
  201|  1.66k|            }
  202|  3.16k|            ent = OPENSSL_malloc(sizeof(*ent));
  ------------------
  |  |  106|  3.16k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  203|  3.16k|            if (ent == NULL)
  ------------------
  |  Branch (203:17): [True: 0, False: 3.16k]
  ------------------
  204|      0|                return 0;
  205|  3.16k|            ent->dir_type = type;
  206|  3.16k|            ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp);
  207|  3.16k|            ent->dir = OPENSSL_strndup(ss, len);
  ------------------
  |  |  137|  3.16k|    CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  208|  3.16k|            if (ent->dir == NULL || ent->hashes == NULL) {
  ------------------
  |  Branch (208:17): [True: 0, False: 3.16k]
  |  Branch (208:37): [True: 0, False: 3.16k]
  ------------------
  209|      0|                by_dir_entry_free(ent);
  210|      0|                return 0;
  211|      0|            }
  212|  3.16k|            if (!sk_BY_DIR_ENTRY_push(ctx->dirs, ent)) {
  ------------------
  |  Branch (212:17): [True: 0, False: 3.16k]
  ------------------
  213|      0|                by_dir_entry_free(ent);
  214|      0|                ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  215|      0|                return 0;
  216|      0|            }
  217|  3.16k|        }
  218|   128k|    } while (*p++ != '\0');
  ------------------
  |  Branch (218:14): [True: 126k, False: 2.82k]
  ------------------
  219|  2.82k|    return 1;
  220|  2.82k|}

X509_LOOKUP_file:
   42|  5.40k|{
   43|  5.40k|    return &x509_file_lookup;
   44|  5.40k|}
X509_load_crl_file:
  173|  2.43k|{
  174|  2.43k|    BIO *in = NULL;
  175|  2.43k|    int count = 0;
  176|  2.43k|    X509_CRL *x = NULL;
  177|       |
  178|  2.43k|    if (file == NULL) {
  ------------------
  |  Branch (178:9): [True: 0, False: 2.43k]
  ------------------
  179|      0|        ERR_raise(ERR_LIB_X509, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  180|      0|        goto err;
  181|      0|    }
  182|       |
  183|  2.43k|    in = BIO_new(BIO_s_file());
  184|       |
  185|  2.43k|    if ((in == NULL) || (BIO_read_filename(in, file) <= 0)) {
  ------------------
  |  |  586|  2.43k|#define BIO_read_filename(b, name) (int)BIO_ctrl(b, BIO_C_SET_FILENAME, \
  |  |  ------------------
  |  |  |  |  442|  2.43k|#define BIO_C_SET_FILENAME 108
  |  |  ------------------
  |  |  587|  2.43k|    BIO_CLOSE | BIO_FP_READ, (char *)(name))
  |  |  ------------------
  |  |  |  |   85|  2.43k|#define BIO_CLOSE 0x01
  |  |  ------------------
  |  |                   BIO_CLOSE | BIO_FP_READ, (char *)(name))
  |  |  ------------------
  |  |  |  |  217|  2.43k|#define BIO_FP_READ 0x02
  |  |  ------------------
  ------------------
  |  Branch (185:9): [True: 0, False: 2.43k]
  |  Branch (185:25): [True: 2, False: 2.42k]
  ------------------
  186|      2|        ERR_raise(ERR_LIB_X509, ERR_R_BIO_LIB);
  ------------------
  |  |  404|      2|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      2|    (ERR_new(),                                                  \
  |  |  |  |  407|      2|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      2|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      2|        ERR_set_error)
  |  |  ------------------
  ------------------
  187|      2|        goto err;
  188|      2|    }
  189|       |
  190|  2.42k|    if (type == X509_FILETYPE_PEM) {
  ------------------
  |  |  168|  2.42k|#define X509_FILETYPE_PEM 1
  ------------------
  |  Branch (190:9): [True: 2.42k, False: 0]
  ------------------
  191|  2.42k|        for (;;) {
  192|  2.42k|            x = PEM_read_bio_X509_CRL(in, NULL, NULL, "");
  193|  2.42k|            if (x == NULL) {
  ------------------
  |  Branch (193:17): [True: 2.42k, False: 0]
  ------------------
  194|  2.42k|                if ((ERR_GET_REASON(ERR_peek_last_error()) == PEM_R_NO_START_LINE) && (count > 0)) {
  ------------------
  |  |   44|  2.42k|#define PEM_R_NO_START_LINE 108
  ------------------
  |  Branch (194:21): [True: 2.42k, False: 0]
  |  Branch (194:87): [True: 0, False: 2.42k]
  ------------------
  195|      0|                    ERR_clear_error();
  196|      0|                    break;
  197|  2.42k|                } else {
  198|  2.42k|                    if (count == 0) {
  ------------------
  |  Branch (198:25): [True: 2.42k, False: 0]
  ------------------
  199|  2.42k|                        ERR_raise(ERR_LIB_X509, X509_R_NO_CRL_FOUND);
  ------------------
  |  |  404|  2.42k|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|  2.42k|    (ERR_new(),                                                  \
  |  |  |  |  407|  2.42k|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|  2.42k|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|  2.42k|        ERR_set_error)
  |  |  ------------------
  ------------------
  200|  2.42k|                    } else {
  201|      0|                        ERR_raise(ERR_LIB_X509, ERR_R_PEM_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  202|      0|                        count = 0;
  203|      0|                    }
  204|  2.42k|                    goto err;
  205|  2.42k|                }
  206|  2.42k|            }
  207|      0|            if (!X509_STORE_add_crl(ctx->store_ctx, x)) {
  ------------------
  |  Branch (207:17): [True: 0, False: 0]
  ------------------
  208|      0|                count = 0;
  209|      0|                goto err;
  210|      0|            }
  211|      0|            count++;
  212|      0|            X509_CRL_free(x);
  213|      0|            x = NULL;
  214|      0|        }
  215|  2.42k|    } else if (type == X509_FILETYPE_ASN1) {
  ------------------
  |  |  169|      0|#define X509_FILETYPE_ASN1 2
  ------------------
  |  Branch (215:16): [True: 0, False: 0]
  ------------------
  216|      0|        x = d2i_X509_CRL_bio(in, NULL);
  217|      0|        if (x == NULL) {
  ------------------
  |  Branch (217:13): [True: 0, False: 0]
  ------------------
  218|      0|            ERR_raise(ERR_LIB_X509, X509_R_NO_CRL_FOUND);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  219|      0|            goto err;
  220|      0|        }
  221|      0|        count = X509_STORE_add_crl(ctx->store_ctx, x);
  222|      0|    } else {
  223|      0|        ERR_raise(ERR_LIB_X509, X509_R_BAD_X509_FILETYPE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  224|      0|        goto err;
  225|      0|    }
  226|  2.43k|err:
  227|  2.43k|    X509_CRL_free(x);
  228|  2.43k|    BIO_free(in);
  229|  2.43k|    return count;
  230|  2.42k|}
X509_load_cert_crl_file_ex:
  234|  2.97k|{
  235|  2.97k|    STACK_OF(X509_INFO) *inf = NULL;
  ------------------
  |  |   33|  2.97k|#define STACK_OF(type) struct stack_st_##type
  ------------------
  236|  2.97k|    X509_INFO *itmp = NULL;
  237|  2.97k|    BIO *in = NULL;
  238|  2.97k|    int i, count = 0;
  239|       |
  240|  2.97k|    if (type != X509_FILETYPE_PEM)
  ------------------
  |  |  168|  2.97k|#define X509_FILETYPE_PEM 1
  ------------------
  |  Branch (240:9): [True: 0, False: 2.97k]
  ------------------
  241|      0|        return X509_load_cert_file_ex(ctx, file, type, libctx, propq);
  242|       |#if defined(OPENSSL_SYS_WINDOWS)
  243|       |    in = BIO_new_file(file, "rb");
  244|       |#else
  245|  2.97k|    in = BIO_new_file(file, "r");
  246|  2.97k|#endif
  247|  2.97k|    if (in == NULL) {
  ------------------
  |  Branch (247:9): [True: 142, False: 2.83k]
  ------------------
  248|    142|        ERR_raise(ERR_LIB_X509, ERR_R_BIO_LIB);
  ------------------
  |  |  404|    142|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|    142|    (ERR_new(),                                                  \
  |  |  |  |  407|    142|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|    142|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|    142|        ERR_set_error)
  |  |  ------------------
  ------------------
  249|    142|        return 0;
  250|    142|    }
  251|  2.83k|    inf = PEM_X509_INFO_read_bio_ex(in, NULL, NULL, "", libctx, propq);
  252|  2.83k|    BIO_free(in);
  253|  2.83k|    if (inf == NULL) {
  ------------------
  |  Branch (253:9): [True: 0, False: 2.83k]
  ------------------
  254|      0|        ERR_raise(ERR_LIB_X509, ERR_R_PEM_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  255|      0|        return 0;
  256|      0|    }
  257|   415k|    for (i = 0; i < sk_X509_INFO_num(inf); i++) {
  ------------------
  |  |  397|   415k|#define sk_X509_INFO_num(sk) OPENSSL_sk_num(ossl_check_const_X509_INFO_sk_type(sk))
  ------------------
  |  Branch (257:17): [True: 412k, False: 2.83k]
  ------------------
  258|   412k|        itmp = sk_X509_INFO_value(inf, i);
  ------------------
  |  |  398|   412k|#define sk_X509_INFO_value(sk, idx) ((X509_INFO *)OPENSSL_sk_value(ossl_check_const_X509_INFO_sk_type(sk), (idx)))
  ------------------
  259|   412k|        if (itmp->x509) {
  ------------------
  |  Branch (259:13): [True: 412k, False: 0]
  ------------------
  260|   412k|            if (!X509_STORE_add_cert(ctx->store_ctx, itmp->x509)) {
  ------------------
  |  Branch (260:17): [True: 0, False: 412k]
  ------------------
  261|      0|                count = 0;
  262|      0|                goto err;
  263|      0|            }
  264|   412k|            count++;
  265|   412k|        }
  266|   412k|        if (itmp->crl) {
  ------------------
  |  Branch (266:13): [True: 0, False: 412k]
  ------------------
  267|      0|            if (!X509_STORE_add_crl(ctx->store_ctx, itmp->crl)) {
  ------------------
  |  Branch (267:17): [True: 0, False: 0]
  ------------------
  268|      0|                count = 0;
  269|      0|                goto err;
  270|      0|            }
  271|      0|            count++;
  272|      0|        }
  273|   412k|    }
  274|  2.83k|    if (count == 0)
  ------------------
  |  Branch (274:9): [True: 9, False: 2.82k]
  ------------------
  275|  2.83k|        ERR_raise(ERR_LIB_X509, X509_R_NO_CERTIFICATE_OR_CRL_FOUND);
  ------------------
  |  |  404|      9|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      9|    (ERR_new(),                                                  \
  |  |  |  |  407|      9|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      9|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      9|        ERR_set_error)
  |  |  ------------------
  ------------------
  276|  2.83k|err:
  277|  2.83k|    sk_X509_INFO_pop_free(inf, X509_INFO_free);
  ------------------
  |  |  411|  2.83k|#define sk_X509_INFO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_freefunc_type(freefunc))
  ------------------
  278|  2.83k|    return count;
  279|  2.83k|}
by_file.c:by_file_ctrl_ex:
   49|  2.97k|{
   50|  2.97k|    int ok = 0;
   51|  2.97k|    const char *file;
   52|       |
   53|  2.97k|    switch (cmd) {
  ------------------
  |  Branch (53:13): [True: 2.97k, False: 0]
  ------------------
   54|  2.97k|    case X509_L_FILE_LOAD:
  ------------------
  |  |  283|  2.97k|#define X509_L_FILE_LOAD 1
  ------------------
  |  Branch (54:5): [True: 2.97k, False: 0]
  ------------------
   55|  2.97k|        if (argl == X509_FILETYPE_DEFAULT) {
  ------------------
  |  |  170|  2.97k|#define X509_FILETYPE_DEFAULT 3
  ------------------
  |  Branch (55:13): [True: 0, False: 2.97k]
  ------------------
   56|      0|            file = ossl_safe_getenv(X509_get_default_cert_file_env());
   57|      0|            if (file)
  ------------------
  |  Branch (57:17): [True: 0, False: 0]
  ------------------
   58|      0|                ok = (X509_load_cert_crl_file_ex(ctx, file, X509_FILETYPE_PEM,
  ------------------
  |  |  168|      0|#define X509_FILETYPE_PEM 1
  ------------------
   59|      0|                          libctx, propq)
   60|      0|                    != 0);
   61|      0|            else
   62|      0|                ok = (X509_load_cert_crl_file_ex(
   63|      0|                          ctx, X509_get_default_cert_file(),
   64|      0|                          X509_FILETYPE_PEM, libctx, propq)
  ------------------
  |  |  168|      0|#define X509_FILETYPE_PEM 1
  ------------------
   65|      0|                    != 0);
   66|       |
   67|      0|            if (!ok)
  ------------------
  |  Branch (67:17): [True: 0, False: 0]
  ------------------
   68|      0|                ERR_raise(ERR_LIB_X509, X509_R_LOADING_DEFAULTS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   69|  2.97k|        } else {
   70|  2.97k|            if (argl == X509_FILETYPE_PEM)
  ------------------
  |  |  168|  2.97k|#define X509_FILETYPE_PEM 1
  ------------------
  |  Branch (70:17): [True: 2.97k, False: 0]
  ------------------
   71|  2.97k|                ok = (X509_load_cert_crl_file_ex(ctx, argp, X509_FILETYPE_PEM,
  ------------------
  |  |  168|  2.97k|#define X509_FILETYPE_PEM 1
  ------------------
   72|  2.97k|                          libctx, propq)
   73|  2.97k|                    != 0);
   74|      0|            else
   75|      0|                ok = (X509_load_cert_file_ex(ctx, argp, (int)argl, libctx,
   76|      0|                          propq)
   77|      0|                    != 0);
   78|  2.97k|        }
   79|  2.97k|        break;
   80|  2.97k|    }
   81|  2.97k|    return ok;
   82|  2.97k|}

ossl_policy_cache_free:
  178|   824k|{
  179|   824k|    if (!cache)
  ------------------
  |  Branch (179:9): [True: 824k, False: 0]
  ------------------
  180|   824k|        return;
  181|      0|    ossl_policy_data_free(cache->anyPolicy);
  182|      0|    sk_X509_POLICY_DATA_pop_free(cache->data, ossl_policy_data_free);
  183|      0|    OPENSSL_free(cache);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  184|      0|}

OSSL_STACK_OF_X509_free:
   26|  59.6k|{
   27|  59.6k|    sk_X509_pop_free(certs, X509_free);
  ------------------
  |  |   96|  59.6k|#define sk_X509_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_sk_type(sk), ossl_check_X509_freefunc_type(freefunc))
  ------------------
   28|  59.6k|}

v3_crld.c:dpn_cb:
  308|   236k|{
  309|   236k|    DIST_POINT_NAME *dpn = (DIST_POINT_NAME *)*pval;
  310|       |
  311|   236k|    switch (operation) {
  ------------------
  |  Branch (311:13): [True: 78.8k, False: 157k]
  ------------------
  312|  39.4k|    case ASN1_OP_NEW_POST:
  ------------------
  |  |  732|  39.4k|#define ASN1_OP_NEW_POST 1
  ------------------
  |  Branch (312:5): [True: 39.4k, False: 197k]
  ------------------
  313|  39.4k|        dpn->dpname = NULL;
  314|  39.4k|        break;
  315|       |
  316|  39.4k|    case ASN1_OP_FREE_POST:
  ------------------
  |  |  734|  39.4k|#define ASN1_OP_FREE_POST 3
  ------------------
  |  Branch (316:5): [True: 39.4k, False: 197k]
  ------------------
  317|  39.4k|        X509_NAME_free(dpn->dpname);
  318|  39.4k|        break;
  319|   236k|    }
  320|   236k|    return 1;
  321|   236k|}

X509V3_EXT_get_nid:
   53|  1.11M|{
   54|  1.11M|    X509V3_EXT_METHOD tmp;
   55|  1.11M|    const X509V3_EXT_METHOD *t = &tmp, *const * ret;
   56|  1.11M|    int idx;
   57|       |
   58|  1.11M|    if (nid < 0)
  ------------------
  |  Branch (58:9): [True: 0, False: 1.11M]
  ------------------
   59|      0|        return NULL;
   60|  1.11M|    tmp.ext_nid = nid;
   61|  1.11M|    ret = OBJ_bsearch_ext(&t, standard_exts, STANDARD_EXTENSION_COUNT);
  ------------------
  |  |   99|  1.11M|#define STANDARD_EXTENSION_COUNT OSSL_NELEM(standard_exts)
  |  |  ------------------
  |  |  |  |   14|  1.11M|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  |  |  ------------------
  ------------------
   62|  1.11M|    if (ret)
  ------------------
  |  Branch (62:9): [True: 1.11M, False: 0]
  ------------------
   63|  1.11M|        return *ret;
   64|      0|    if (!ext_list)
  ------------------
  |  Branch (64:9): [True: 0, False: 0]
  ------------------
   65|      0|        return NULL;
   66|       |    /* Ideally, this would be done under a lock */
   67|      0|    sk_X509V3_EXT_METHOD_sort(ext_list);
  ------------------
  |  |  135|      0|#define sk_X509V3_EXT_METHOD_sort(sk) OPENSSL_sk_sort(ossl_check_X509V3_EXT_METHOD_sk_type(sk))
  ------------------
   68|      0|    idx = sk_X509V3_EXT_METHOD_find(ext_list, &tmp);
  ------------------
  |  |  132|      0|#define sk_X509V3_EXT_METHOD_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509V3_EXT_METHOD_sk_type(sk), ossl_check_X509V3_EXT_METHOD_type(ptr))
  ------------------
   69|       |    /* A failure to locate the item is handled by the value method */
   70|      0|    return sk_X509V3_EXT_METHOD_value(ext_list, idx);
  ------------------
  |  |  116|      0|#define sk_X509V3_EXT_METHOD_value(sk, idx) ((X509V3_EXT_METHOD *)OPENSSL_sk_value(ossl_check_const_X509V3_EXT_METHOD_sk_type(sk), (idx)))
  ------------------
   71|      0|}
X509V3_EXT_get:
   74|  1.11M|{
   75|  1.11M|    int nid;
   76|  1.11M|    if ((nid = OBJ_obj2nid(X509_EXTENSION_get_object(ext))) == NID_undef)
  ------------------
  |  |   18|  1.11M|#define NID_undef                       0
  ------------------
  |  Branch (76:9): [True: 0, False: 1.11M]
  ------------------
   77|      0|        return NULL;
   78|  1.11M|    return X509V3_EXT_get_nid(nid);
   79|  1.11M|}
X509V3_EXT_d2i:
  135|  1.11M|{
  136|  1.11M|    const X509V3_EXT_METHOD *method;
  137|  1.11M|    const unsigned char *p;
  138|  1.11M|    ASN1_STRING *extvalue;
  139|  1.11M|    int extlen;
  140|       |
  141|  1.11M|    if ((method = X509V3_EXT_get(ext)) == NULL)
  ------------------
  |  Branch (141:9): [True: 0, False: 1.11M]
  ------------------
  142|      0|        return NULL;
  143|  1.11M|    extvalue = X509_EXTENSION_get_data(ext);
  144|  1.11M|    p = ASN1_STRING_get0_data(extvalue);
  145|  1.11M|    extlen = ASN1_STRING_length(extvalue);
  146|  1.11M|    if (method->it)
  ------------------
  |  Branch (146:9): [True: 1.11M, False: 0]
  ------------------
  147|  1.11M|        return ASN1_item_d2i(NULL, &p, extlen, ASN1_ITEM_ptr(method->it));
  ------------------
  |  |  428|  1.11M|#define ASN1_ITEM_ptr(iptr) (iptr())
  ------------------
  148|      0|    return method->d2i(NULL, &p, extlen);
  149|  1.11M|}
X509V3_get_d2i:
  169|  4.06M|{
  170|  4.06M|    int lastpos, i;
  171|  4.06M|    X509_EXTENSION *ex, *found_ex = NULL;
  172|       |
  173|  4.06M|    if (!x) {
  ------------------
  |  Branch (173:9): [True: 0, False: 4.06M]
  ------------------
  174|      0|        if (idx)
  ------------------
  |  Branch (174:13): [True: 0, False: 0]
  ------------------
  175|      0|            *idx = -1;
  176|      0|        if (crit)
  ------------------
  |  Branch (176:13): [True: 0, False: 0]
  ------------------
  177|      0|            *crit = -1;
  178|      0|        return NULL;
  179|      0|    }
  180|  4.06M|    if (idx)
  ------------------
  |  Branch (180:9): [True: 0, False: 4.06M]
  ------------------
  181|      0|        lastpos = *idx + 1;
  182|  4.06M|    else
  183|  4.06M|        lastpos = 0;
  184|  4.06M|    if (lastpos < 0)
  ------------------
  |  Branch (184:9): [True: 0, False: 4.06M]
  ------------------
  185|      0|        lastpos = 0;
  186|  18.0M|    for (i = lastpos; i < sk_X509_EXTENSION_num(x); i++) {
  ------------------
  |  |  242|  18.0M|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (186:23): [True: 13.9M, False: 4.06M]
  ------------------
  187|  13.9M|        ex = sk_X509_EXTENSION_value(x, i);
  ------------------
  |  |  243|  13.9M|#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
  ------------------
  188|  13.9M|        if (OBJ_obj2nid(X509_EXTENSION_get_object(ex)) == nid) {
  ------------------
  |  Branch (188:13): [True: 1.11M, False: 12.8M]
  ------------------
  189|  1.11M|            if (idx) {
  ------------------
  |  Branch (189:17): [True: 0, False: 1.11M]
  ------------------
  190|      0|                *idx = i;
  191|      0|                found_ex = ex;
  192|      0|                break;
  193|  1.11M|            } else if (found_ex) {
  ------------------
  |  Branch (193:24): [True: 0, False: 1.11M]
  ------------------
  194|       |                /* Found more than one */
  195|      0|                if (crit)
  ------------------
  |  Branch (195:21): [True: 0, False: 0]
  ------------------
  196|      0|                    *crit = -2;
  197|      0|                return NULL;
  198|      0|            }
  199|  1.11M|            found_ex = ex;
  200|  1.11M|        }
  201|  13.9M|    }
  202|  4.06M|    if (found_ex) {
  ------------------
  |  Branch (202:9): [True: 1.11M, False: 2.94M]
  ------------------
  203|       |        /* Found it */
  204|  1.11M|        if (crit)
  ------------------
  |  Branch (204:13): [True: 1.11M, False: 0]
  ------------------
  205|  1.11M|            *crit = X509_EXTENSION_get_critical(found_ex);
  206|  1.11M|        return X509V3_EXT_d2i(found_ex);
  207|  1.11M|    }
  208|       |
  209|       |    /* Extension not found */
  210|  2.94M|    if (idx)
  ------------------
  |  Branch (210:9): [True: 0, False: 2.94M]
  ------------------
  211|      0|        *idx = -1;
  212|  2.94M|    if (crit)
  ------------------
  |  Branch (212:9): [True: 2.94M, False: 0]
  ------------------
  213|  2.94M|        *crit = -1;
  214|       |    return NULL;
  215|  4.06M|}
v3_lib.c:ext_cmp:
   41|  5.62M|{
   42|  5.62M|    return ((*a)->ext_nid - (*b)->ext_nid);
   43|  5.62M|}

X509_check_purpose:
   89|   338k|{
   90|   338k|    int idx;
   91|   338k|    const X509_PURPOSE *pt;
   92|       |
   93|   338k|    if (!ossl_x509v3_cache_extensions(x))
  ------------------
  |  Branch (93:9): [True: 0, False: 338k]
  ------------------
   94|      0|        return -1;
   95|   338k|    if (id == -1)
  ------------------
  |  Branch (95:9): [True: 338k, False: 0]
  ------------------
   96|   338k|        return 1;
   97|       |
   98|      0|    idx = X509_PURPOSE_get_by_id(id);
   99|      0|    if (idx == -1)
  ------------------
  |  Branch (99:9): [True: 0, False: 0]
  ------------------
  100|      0|        return -1;
  101|      0|    pt = X509_PURPOSE_get0(idx);
  102|      0|    return pt->check_purpose(pt, x, non_leaf);
  103|      0|}
X509_supported_extension:
  310|   644k|{
  311|       |    /*
  312|       |     * This table is a list of the NIDs of supported extensions: that is
  313|       |     * those which are used by the verify process. If an extension is
  314|       |     * critical and doesn't appear in this list then the verify process will
  315|       |     * normally reject the certificate. The list must be kept in numerical
  316|       |     * order because it will be searched using bsearch.
  317|       |     */
  318|   644k|    static const int supported_nids[] = {
  319|   644k|        NID_netscape_cert_type, /* 71 */
  ------------------
  |  | 2945|   644k|#define NID_netscape_cert_type          71
  ------------------
  320|   644k|        NID_key_usage, /* 83 */
  ------------------
  |  | 2685|   644k|#define NID_key_usage           83
  ------------------
  321|   644k|        NID_subject_alt_name, /* 85 */
  ------------------
  |  | 2695|   644k|#define NID_subject_alt_name            85
  ------------------
  322|   644k|        NID_basic_constraints, /* 87 */
  ------------------
  |  | 2705|   644k|#define NID_basic_constraints           87
  ------------------
  323|   644k|        NID_certificate_policies, /* 89 */
  ------------------
  |  | 2750|   644k|#define NID_certificate_policies                89
  ------------------
  324|   644k|        NID_crl_distribution_points, /* 103 */
  ------------------
  |  | 2745|   644k|#define NID_crl_distribution_points             103
  ------------------
  325|   644k|        NID_ext_key_usage, /* 126 */
  ------------------
  |  | 2775|   644k|#define NID_ext_key_usage               126
  ------------------
  326|   644k|#ifndef OPENSSL_NO_RFC3779
  327|   644k|        NID_sbgp_ipAddrBlock, /* 290 */
  ------------------
  |  | 1626|   644k|#define NID_sbgp_ipAddrBlock            290
  ------------------
  328|   644k|        NID_sbgp_autonomousSysNum, /* 291 */
  ------------------
  |  | 1630|   644k|#define NID_sbgp_autonomousSysNum               291
  ------------------
  329|   644k|#endif
  330|   644k|        NID_id_pkix_OCSP_noCheck, /* 369 */
  ------------------
  |  | 2224|   644k|#define NID_id_pkix_OCSP_noCheck                369
  ------------------
  331|   644k|        NID_policy_constraints, /* 401 */
  ------------------
  |  | 2770|   644k|#define NID_policy_constraints          401
  ------------------
  332|   644k|        NID_proxyCertInfo, /* 663 */
  ------------------
  |  | 1648|   644k|#define NID_proxyCertInfo               663
  ------------------
  333|   644k|        NID_name_constraints, /* 666 */
  ------------------
  |  | 2740|   644k|#define NID_name_constraints            666
  ------------------
  334|   644k|        NID_policy_mappings, /* 747 */
  ------------------
  |  | 2760|   644k|#define NID_policy_mappings             747
  ------------------
  335|   644k|        NID_inhibit_any_policy /* 748 */
  ------------------
  |  | 2830|   644k|#define NID_inhibit_any_policy          748
  ------------------
  336|   644k|    };
  337|       |
  338|   644k|    int ex_nid = OBJ_obj2nid(X509_EXTENSION_get_object(ex));
  339|       |
  340|   644k|    if (ex_nid == NID_undef)
  ------------------
  |  |   18|   644k|#define NID_undef                       0
  ------------------
  |  Branch (340:9): [True: 0, False: 644k]
  ------------------
  341|      0|        return 0;
  342|       |
  343|   644k|    if (OBJ_bsearch_nid(&ex_nid, supported_nids, OSSL_NELEM(supported_nids)))
  ------------------
  |  |   14|   644k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (343:9): [True: 644k, False: 0]
  ------------------
  344|   644k|        return 1;
  345|      0|    return 0;
  346|   644k|}
ossl_x509v3_cache_extensions:
  441|   338k|{
  442|   338k|    BASIC_CONSTRAINTS *bs;
  443|   338k|    PROXY_CERT_INFO_EXTENSION *pci;
  444|   338k|    ASN1_BIT_STRING *usage;
  445|   338k|    ASN1_BIT_STRING *ns;
  446|   338k|    EXTENDED_KEY_USAGE *extusage;
  447|   338k|    int i;
  448|   338k|    int res;
  449|       |
  450|   338k|#ifdef tsan_ld_acq
  451|       |    /* Fast lock-free check, see end of the function for details. */
  452|   338k|    if (tsan_ld_acq((TSAN_QUALIFIER int *)&x->ex_cached))
  ------------------
  |  |   64|   338k|#define tsan_ld_acq(ptr) atomic_load_explicit((ptr), memory_order_acquire)
  |  |  ------------------
  |  |  |  Branch (64:26): [True: 0, False: 338k]
  |  |  ------------------
  ------------------
  453|      0|        return (x->ex_flags & EXFLAG_INVALID) == 0;
  ------------------
  |  |  676|      0|#define EXFLAG_INVALID 0x80
  ------------------
  454|   338k|#endif
  455|       |
  456|   338k|    if (!CRYPTO_THREAD_write_lock(x->lock))
  ------------------
  |  Branch (456:9): [True: 0, False: 338k]
  ------------------
  457|      0|        return 0;
  458|   338k|    if ((x->ex_flags & EXFLAG_SET) != 0) { /* Cert has already been processed */
  ------------------
  |  |  678|   338k|#define EXFLAG_SET 0x100
  ------------------
  |  Branch (458:9): [True: 0, False: 338k]
  ------------------
  459|      0|        CRYPTO_THREAD_unlock(x->lock);
  460|      0|        return (x->ex_flags & EXFLAG_INVALID) == 0;
  ------------------
  |  |  676|      0|#define EXFLAG_INVALID 0x80
  ------------------
  461|      0|    }
  462|       |
  463|   338k|    ERR_set_mark();
  464|       |
  465|       |    /* Cache the SHA1 digest of the cert */
  466|   338k|    if (!X509_digest(x, EVP_sha1(), x->sha1_hash, NULL))
  ------------------
  |  Branch (466:9): [True: 0, False: 338k]
  ------------------
  467|      0|        x->ex_flags |= EXFLAG_NO_FINGERPRINT;
  ------------------
  |  |  690|      0|#define EXFLAG_NO_FINGERPRINT 0x100000
  ------------------
  468|       |
  469|       |    /* V1 should mean no extensions ... */
  470|   338k|    if (X509_get_version(x) == X509_VERSION_1)
  ------------------
  |  |  845|   338k|#define X509_VERSION_1 0
  ------------------
  |  Branch (470:9): [True: 0, False: 338k]
  ------------------
  471|      0|        x->ex_flags |= EXFLAG_V1;
  ------------------
  |  |  675|      0|#define EXFLAG_V1 0x40
  ------------------
  472|       |
  473|       |    /* Handle basic constraints */
  474|   338k|    x->ex_pathlen = -1;
  475|   338k|    if ((bs = X509_get_ext_d2i(x, NID_basic_constraints, &i, NULL)) != NULL) {
  ------------------
  |  | 2705|   338k|#define NID_basic_constraints           87
  ------------------
  |  Branch (475:9): [True: 338k, False: 0]
  ------------------
  476|   338k|        if (bs->ca)
  ------------------
  |  Branch (476:13): [True: 338k, False: 0]
  ------------------
  477|   338k|            x->ex_flags |= EXFLAG_CA;
  ------------------
  |  |  673|   338k|#define EXFLAG_CA 0x10
  ------------------
  478|   338k|        if (bs->pathlen != NULL) {
  ------------------
  |  Branch (478:13): [True: 6.95k, False: 331k]
  ------------------
  479|       |            /*
  480|       |             * The error case !bs->ca is checked by check_chain()
  481|       |             * in case ctx->param->flags & X509_V_FLAG_X509_STRICT
  482|       |             */
  483|  6.95k|            if (bs->pathlen->type == V_ASN1_NEG_INTEGER) {
  ------------------
  |  |  100|  6.95k|#define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG)
  |  |  ------------------
  |  |  |  |   99|  6.95k|#define V_ASN1_NEG 0x100
  |  |  ------------------
  ------------------
  |  Branch (483:17): [True: 0, False: 6.95k]
  ------------------
  484|      0|                ERR_raise(ERR_LIB_X509V3, X509V3_R_NEGATIVE_PATHLEN);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  485|      0|                x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  676|      0|#define EXFLAG_INVALID 0x80
  ------------------
  486|  6.95k|            } else {
  487|  6.95k|                x->ex_pathlen = ASN1_INTEGER_get(bs->pathlen);
  488|  6.95k|            }
  489|  6.95k|        }
  490|   338k|        BASIC_CONSTRAINTS_free(bs);
  491|   338k|        x->ex_flags |= EXFLAG_BCONS;
  ------------------
  |  |  668|   338k|#define EXFLAG_BCONS 0x1
  ------------------
  492|   338k|    } else if (i != -1) {
  ------------------
  |  Branch (492:16): [True: 0, False: 0]
  ------------------
  493|      0|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  676|      0|#define EXFLAG_INVALID 0x80
  ------------------
  494|      0|    }
  495|       |
  496|       |    /* Handle proxy certificates */
  497|   338k|    if ((pci = X509_get_ext_d2i(x, NID_proxyCertInfo, &i, NULL)) != NULL) {
  ------------------
  |  | 1648|   338k|#define NID_proxyCertInfo               663
  ------------------
  |  Branch (497:9): [True: 0, False: 338k]
  ------------------
  498|      0|        if ((x->ex_flags & EXFLAG_CA) != 0
  ------------------
  |  |  673|      0|#define EXFLAG_CA 0x10
  ------------------
  |  Branch (498:13): [True: 0, False: 0]
  ------------------
  499|      0|            || X509_get_ext_by_NID(x, NID_subject_alt_name, -1) >= 0
  ------------------
  |  | 2695|      0|#define NID_subject_alt_name            85
  ------------------
  |  Branch (499:16): [True: 0, False: 0]
  ------------------
  500|      0|            || X509_get_ext_by_NID(x, NID_issuer_alt_name, -1) >= 0) {
  ------------------
  |  | 2700|      0|#define NID_issuer_alt_name             86
  ------------------
  |  Branch (500:16): [True: 0, False: 0]
  ------------------
  501|      0|            x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  676|      0|#define EXFLAG_INVALID 0x80
  ------------------
  502|      0|        }
  503|      0|        if (pci->pcPathLengthConstraint != NULL)
  ------------------
  |  Branch (503:13): [True: 0, False: 0]
  ------------------
  504|      0|            x->ex_pcpathlen = ASN1_INTEGER_get(pci->pcPathLengthConstraint);
  505|      0|        else
  506|      0|            x->ex_pcpathlen = -1;
  507|      0|        PROXY_CERT_INFO_EXTENSION_free(pci);
  508|      0|        x->ex_flags |= EXFLAG_PROXY;
  ------------------
  |  |  680|      0|#define EXFLAG_PROXY 0x400
  ------------------
  509|   338k|    } else if (i != -1) {
  ------------------
  |  Branch (509:16): [True: 0, False: 338k]
  ------------------
  510|      0|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  676|      0|#define EXFLAG_INVALID 0x80
  ------------------
  511|      0|    }
  512|       |
  513|       |    /* Handle (basic) key usage */
  514|   338k|    if ((usage = X509_get_ext_d2i(x, NID_key_usage, &i, NULL)) != NULL) {
  ------------------
  |  | 2685|   338k|#define NID_key_usage           83
  ------------------
  |  Branch (514:9): [True: 331k, False: 6.95k]
  ------------------
  515|   331k|        x->ex_kusage = 0;
  516|   331k|        if (usage->length > 0) {
  ------------------
  |  Branch (516:13): [True: 331k, False: 0]
  ------------------
  517|   331k|            x->ex_kusage = usage->data[0];
  518|   331k|            if (usage->length > 1)
  ------------------
  |  Branch (518:17): [True: 4.63k, False: 326k]
  ------------------
  519|  4.63k|                x->ex_kusage |= usage->data[1] << 8;
  520|   331k|        }
  521|   331k|        x->ex_flags |= EXFLAG_KUSAGE;
  ------------------
  |  |  669|   331k|#define EXFLAG_KUSAGE 0x2
  ------------------
  522|   331k|        ASN1_BIT_STRING_free(usage);
  523|       |        /* Check for empty key usage according to RFC 5280 section 4.2.1.3 */
  524|   331k|        if (x->ex_kusage == 0) {
  ------------------
  |  Branch (524:13): [True: 0, False: 331k]
  ------------------
  525|      0|            ERR_raise(ERR_LIB_X509V3, X509V3_R_EMPTY_KEY_USAGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  526|      0|            x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  676|      0|#define EXFLAG_INVALID 0x80
  ------------------
  527|      0|        }
  528|   331k|    } else if (i != -1) {
  ------------------
  |  Branch (528:16): [True: 0, False: 6.95k]
  ------------------
  529|      0|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  676|      0|#define EXFLAG_INVALID 0x80
  ------------------
  530|      0|    }
  531|       |
  532|       |    /* Handle extended key usage */
  533|   338k|    x->ex_xkusage = 0;
  534|   338k|    if ((extusage = X509_get_ext_d2i(x, NID_ext_key_usage, &i, NULL)) != NULL) {
  ------------------
  |  | 2775|   338k|#define NID_ext_key_usage               126
  ------------------
  |  Branch (534:9): [True: 0, False: 338k]
  ------------------
  535|      0|        x->ex_flags |= EXFLAG_XKUSAGE;
  ------------------
  |  |  670|      0|#define EXFLAG_XKUSAGE 0x4
  ------------------
  536|      0|        for (i = 0; i < sk_ASN1_OBJECT_num(extusage); i++) {
  ------------------
  |  |  622|      0|#define sk_ASN1_OBJECT_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_OBJECT_sk_type(sk))
  ------------------
  |  Branch (536:21): [True: 0, False: 0]
  ------------------
  537|      0|            switch (OBJ_obj2nid(sk_ASN1_OBJECT_value(extusage, i))) {
  ------------------
  |  |  623|      0|#define sk_ASN1_OBJECT_value(sk, idx) ((ASN1_OBJECT *)OPENSSL_sk_value(ossl_check_const_ASN1_OBJECT_sk_type(sk), (idx)))
  ------------------
  538|      0|            case NID_server_auth:
  ------------------
  |  | 1680|      0|#define NID_server_auth         129
  ------------------
  |  Branch (538:13): [True: 0, False: 0]
  ------------------
  539|      0|                x->ex_xkusage |= XKU_SSL_SERVER;
  ------------------
  |  |  712|      0|#define XKU_SSL_SERVER 0x1
  ------------------
  540|      0|                break;
  541|      0|            case NID_client_auth:
  ------------------
  |  | 1685|      0|#define NID_client_auth         130
  ------------------
  |  Branch (541:13): [True: 0, False: 0]
  ------------------
  542|      0|                x->ex_xkusage |= XKU_SSL_CLIENT;
  ------------------
  |  |  713|      0|#define XKU_SSL_CLIENT 0x2
  ------------------
  543|      0|                break;
  544|      0|            case NID_email_protect:
  ------------------
  |  | 1695|      0|#define NID_email_protect               132
  ------------------
  |  Branch (544:13): [True: 0, False: 0]
  ------------------
  545|      0|                x->ex_xkusage |= XKU_SMIME;
  ------------------
  |  |  714|      0|#define XKU_SMIME 0x4
  ------------------
  546|      0|                break;
  547|      0|            case NID_code_sign:
  ------------------
  |  | 1690|      0|#define NID_code_sign           131
  ------------------
  |  Branch (547:13): [True: 0, False: 0]
  ------------------
  548|      0|                x->ex_xkusage |= XKU_CODE_SIGN;
  ------------------
  |  |  715|      0|#define XKU_CODE_SIGN 0x8
  ------------------
  549|      0|                break;
  550|      0|            case NID_ms_sgc:
  ------------------
  |  | 1379|      0|#define NID_ms_sgc              137
  ------------------
  |  Branch (550:13): [True: 0, False: 0]
  ------------------
  551|      0|            case NID_ns_sgc:
  ------------------
  |  | 2990|      0|#define NID_ns_sgc              139
  ------------------
  |  Branch (551:13): [True: 0, False: 0]
  ------------------
  552|      0|                x->ex_xkusage |= XKU_SGC;
  ------------------
  |  |  716|      0|#define XKU_SGC 0x10 /* Netscape or MS Server-Gated Crypto */
  ------------------
  553|      0|                break;
  554|      0|            case NID_OCSP_sign:
  ------------------
  |  | 1720|      0|#define NID_OCSP_sign           180
  ------------------
  |  Branch (554:13): [True: 0, False: 0]
  ------------------
  555|      0|                x->ex_xkusage |= XKU_OCSP_SIGN;
  ------------------
  |  |  717|      0|#define XKU_OCSP_SIGN 0x20
  ------------------
  556|      0|                break;
  557|      0|            case NID_time_stamp:
  ------------------
  |  | 1715|      0|#define NID_time_stamp          133
  ------------------
  |  Branch (557:13): [True: 0, False: 0]
  ------------------
  558|      0|                x->ex_xkusage |= XKU_TIMESTAMP;
  ------------------
  |  |  718|      0|#define XKU_TIMESTAMP 0x40
  ------------------
  559|      0|                break;
  560|      0|            case NID_dvcs:
  ------------------
  |  | 1725|      0|#define NID_dvcs                297
  ------------------
  |  Branch (560:13): [True: 0, False: 0]
  ------------------
  561|      0|                x->ex_xkusage |= XKU_DVCS;
  ------------------
  |  |  719|      0|#define XKU_DVCS 0x80
  ------------------
  562|      0|                break;
  563|      0|            case NID_anyExtendedKeyUsage:
  ------------------
  |  | 2925|      0|#define NID_anyExtendedKeyUsage         910
  ------------------
  |  Branch (563:13): [True: 0, False: 0]
  ------------------
  564|      0|                x->ex_xkusage |= XKU_ANYEKU;
  ------------------
  |  |  720|      0|#define XKU_ANYEKU 0x100
  ------------------
  565|      0|                break;
  566|      0|            default:
  ------------------
  |  Branch (566:13): [True: 0, False: 0]
  ------------------
  567|       |                /* Ignore unknown extended key usage */
  568|      0|                break;
  569|      0|            }
  570|      0|        }
  571|      0|        sk_ASN1_OBJECT_pop_free(extusage, ASN1_OBJECT_free);
  ------------------
  |  |  636|      0|#define sk_ASN1_OBJECT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_freefunc_type(freefunc))
  ------------------
  572|   338k|    } else if (i != -1) {
  ------------------
  |  Branch (572:16): [True: 0, False: 338k]
  ------------------
  573|      0|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  676|      0|#define EXFLAG_INVALID 0x80
  ------------------
  574|      0|    }
  575|       |
  576|       |    /* Handle legacy Netscape extension */
  577|   338k|    if ((ns = X509_get_ext_d2i(x, NID_netscape_cert_type, &i, NULL)) != NULL) {
  ------------------
  |  | 2945|   338k|#define NID_netscape_cert_type          71
  ------------------
  |  Branch (577:9): [True: 2.31k, False: 336k]
  ------------------
  578|  2.31k|        if (ns->length > 0)
  ------------------
  |  Branch (578:13): [True: 2.31k, False: 0]
  ------------------
  579|  2.31k|            x->ex_nscert = ns->data[0];
  580|      0|        else
  581|      0|            x->ex_nscert = 0;
  582|  2.31k|        x->ex_flags |= EXFLAG_NSCERT;
  ------------------
  |  |  671|  2.31k|#define EXFLAG_NSCERT 0x8
  ------------------
  583|  2.31k|        ASN1_BIT_STRING_free(ns);
  584|   336k|    } else if (i != -1) {
  ------------------
  |  Branch (584:16): [True: 0, False: 336k]
  ------------------
  585|      0|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  676|      0|#define EXFLAG_INVALID 0x80
  ------------------
  586|      0|    }
  587|       |
  588|       |    /* Handle subject key identifier and issuer/authority key identifier */
  589|   338k|    x->skid = X509_get_ext_d2i(x, NID_subject_key_identifier, &i, NULL);
  ------------------
  |  | 2680|   338k|#define NID_subject_key_identifier              82
  ------------------
  590|   338k|    if (x->skid == NULL && i != -1)
  ------------------
  |  Branch (590:9): [True: 2.31k, False: 336k]
  |  Branch (590:28): [True: 0, False: 2.31k]
  ------------------
  591|      0|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  676|      0|#define EXFLAG_INVALID 0x80
  ------------------
  592|       |
  593|   338k|    x->akid = X509_get_ext_d2i(x, NID_authority_key_identifier, &i, NULL);
  ------------------
  |  | 2765|   338k|#define NID_authority_key_identifier            90
  ------------------
  594|   338k|    if (x->akid == NULL && i != -1)
  ------------------
  |  Branch (594:9): [True: 264k, False: 74.1k]
  |  Branch (594:28): [True: 0, False: 264k]
  ------------------
  595|      0|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  676|      0|#define EXFLAG_INVALID 0x80
  ------------------
  596|       |
  597|       |    /* Check if subject name matches issuer */
  598|   338k|    if (X509_NAME_cmp(X509_get_subject_name(x), X509_get_issuer_name(x)) == 0) {
  ------------------
  |  Branch (598:9): [True: 338k, False: 0]
  ------------------
  599|   338k|        x->ex_flags |= EXFLAG_SI; /* Cert is self-issued */
  ------------------
  |  |  674|   338k|#define EXFLAG_SI 0x20 /* self-issued, maybe not self-signed */
  ------------------
  600|   338k|        if (X509_check_akid(x, x->akid) == X509_V_OK /* SKID matches AKID */
  ------------------
  |  |  312|   676k|#define X509_V_OK 0
  ------------------
  |  Branch (600:13): [True: 338k, False: 0]
  ------------------
  601|   338k|            /* .. and the signature alg matches the PUBKEY alg: */
  602|   338k|            && check_sig_alg_match(X509_get0_pubkey(x), x) == X509_V_OK)
  ------------------
  |  |  312|   338k|#define X509_V_OK 0
  ------------------
  |  Branch (602:16): [True: 338k, False: 0]
  ------------------
  603|   338k|            x->ex_flags |= EXFLAG_SS; /* indicate self-signed */
  ------------------
  |  |  684|   338k|#define EXFLAG_SS 0x2000 /* cert is apparently self-signed */
  ------------------
  604|       |        /* This is very related to ossl_x509_likely_issued(x, x) == X509_V_OK */
  605|   338k|    }
  606|       |
  607|       |    /* Handle subject alternative names and various other extensions */
  608|   338k|    x->altname = X509_get_ext_d2i(x, NID_subject_alt_name, &i, NULL);
  ------------------
  |  | 2695|   338k|#define NID_subject_alt_name            85
  ------------------
  609|   338k|    if (x->altname == NULL && i != -1)
  ------------------
  |  Branch (609:9): [True: 331k, False: 6.95k]
  |  Branch (609:31): [True: 0, False: 331k]
  ------------------
  610|      0|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  676|      0|#define EXFLAG_INVALID 0x80
  ------------------
  611|   338k|    x->nc = X509_get_ext_d2i(x, NID_name_constraints, &i, NULL);
  ------------------
  |  | 2740|   338k|#define NID_name_constraints            666
  ------------------
  612|   338k|    if (x->nc == NULL && i != -1)
  ------------------
  |  Branch (612:9): [True: 338k, False: 0]
  |  Branch (612:26): [True: 0, False: 338k]
  ------------------
  613|      0|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  676|      0|#define EXFLAG_INVALID 0x80
  ------------------
  614|       |
  615|       |    /* Handle CRL distribution point entries */
  616|   338k|    res = setup_crldp(x);
  617|   338k|    if (res == 0)
  ------------------
  |  Branch (617:9): [True: 0, False: 338k]
  ------------------
  618|      0|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  676|      0|#define EXFLAG_INVALID 0x80
  ------------------
  619|       |
  620|   338k|#ifndef OPENSSL_NO_RFC3779
  621|   338k|    x->rfc3779_addr = X509_get_ext_d2i(x, NID_sbgp_ipAddrBlock, &i, NULL);
  ------------------
  |  | 1626|   338k|#define NID_sbgp_ipAddrBlock            290
  ------------------
  622|   338k|    if (x->rfc3779_addr == NULL && i != -1)
  ------------------
  |  Branch (622:9): [True: 338k, False: 0]
  |  Branch (622:36): [True: 0, False: 338k]
  ------------------
  623|      0|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  676|      0|#define EXFLAG_INVALID 0x80
  ------------------
  624|   338k|    x->rfc3779_asid = X509_get_ext_d2i(x, NID_sbgp_autonomousSysNum, &i, NULL);
  ------------------
  |  | 1630|   338k|#define NID_sbgp_autonomousSysNum               291
  ------------------
  625|   338k|    if (x->rfc3779_asid == NULL && i != -1)
  ------------------
  |  Branch (625:9): [True: 338k, False: 0]
  |  Branch (625:36): [True: 0, False: 338k]
  ------------------
  626|      0|        x->ex_flags |= EXFLAG_INVALID;
  ------------------
  |  |  676|      0|#define EXFLAG_INVALID 0x80
  ------------------
  627|   338k|#endif
  628|  1.50M|    for (i = 0; i < X509_get_ext_count(x); i++) {
  ------------------
  |  Branch (628:17): [True: 1.16M, False: 338k]
  ------------------
  629|  1.16M|        X509_EXTENSION *ex = X509_get_ext(x, i);
  630|  1.16M|        int nid = OBJ_obj2nid(X509_EXTENSION_get_object(ex));
  631|       |
  632|  1.16M|        if (nid == NID_freshest_crl)
  ------------------
  |  | 2805|  1.16M|#define NID_freshest_crl                857
  ------------------
  |  Branch (632:13): [True: 0, False: 1.16M]
  ------------------
  633|      0|            x->ex_flags |= EXFLAG_FRESHEST;
  ------------------
  |  |  683|      0|#define EXFLAG_FRESHEST 0x1000
  ------------------
  634|  1.16M|        if (!X509_EXTENSION_get_critical(ex))
  ------------------
  |  Branch (634:13): [True: 521k, False: 644k]
  ------------------
  635|   521k|            continue;
  636|   644k|        if (!X509_supported_extension(ex)) {
  ------------------
  |  Branch (636:13): [True: 0, False: 644k]
  ------------------
  637|      0|            x->ex_flags |= EXFLAG_CRITICAL;
  ------------------
  |  |  679|      0|#define EXFLAG_CRITICAL 0x200
  ------------------
  638|      0|            break;
  639|      0|        }
  640|   644k|        switch (nid) {
  641|   331k|        case NID_basic_constraints:
  ------------------
  |  | 2705|   331k|#define NID_basic_constraints           87
  ------------------
  |  Branch (641:9): [True: 331k, False: 312k]
  ------------------
  642|   331k|            x->ex_flags |= EXFLAG_BCONS_CRITICAL;
  ------------------
  |  |  686|   331k|#define EXFLAG_BCONS_CRITICAL 0x10000
  ------------------
  643|   331k|            break;
  644|      0|        case NID_authority_key_identifier:
  ------------------
  |  | 2765|      0|#define NID_authority_key_identifier            90
  ------------------
  |  Branch (644:9): [True: 0, False: 644k]
  ------------------
  645|      0|            x->ex_flags |= EXFLAG_AKID_CRITICAL;
  ------------------
  |  |  687|      0|#define EXFLAG_AKID_CRITICAL 0x20000
  ------------------
  646|      0|            break;
  647|      0|        case NID_subject_key_identifier:
  ------------------
  |  | 2680|      0|#define NID_subject_key_identifier              82
  ------------------
  |  Branch (647:9): [True: 0, False: 644k]
  ------------------
  648|      0|            x->ex_flags |= EXFLAG_SKID_CRITICAL;
  ------------------
  |  |  688|      0|#define EXFLAG_SKID_CRITICAL 0x40000
  ------------------
  649|      0|            break;
  650|      0|        case NID_subject_alt_name:
  ------------------
  |  | 2695|      0|#define NID_subject_alt_name            85
  ------------------
  |  Branch (650:9): [True: 0, False: 644k]
  ------------------
  651|      0|            x->ex_flags |= EXFLAG_SAN_CRITICAL;
  ------------------
  |  |  689|      0|#define EXFLAG_SAN_CRITICAL 0x80000
  ------------------
  652|      0|            break;
  653|   312k|        default:
  ------------------
  |  Branch (653:9): [True: 312k, False: 331k]
  ------------------
  654|   312k|            break;
  655|   644k|        }
  656|   644k|    }
  657|       |
  658|       |    /* Set x->siginf, ignoring errors due to unsupported algos */
  659|   338k|    (void)ossl_x509_init_sig_info(x);
  660|       |
  661|   338k|    x->ex_flags |= EXFLAG_SET; /* Indicate that cert has been processed */
  ------------------
  |  |  678|   338k|#define EXFLAG_SET 0x100
  ------------------
  662|   338k|#ifdef tsan_st_rel
  663|   338k|    tsan_st_rel((TSAN_QUALIFIER int *)&x->ex_cached, 1);
  ------------------
  |  |   65|   338k|#define tsan_st_rel(ptr, val) atomic_store_explicit((ptr), (val), memory_order_release)
  ------------------
  664|       |    /*
  665|       |     * Above store triggers fast lock-free check in the beginning of the
  666|       |     * function. But one has to ensure that the structure is "stable", i.e.
  667|       |     * all stores are visible on all processors. Hence the release fence.
  668|       |     */
  669|   338k|#endif
  670|   338k|    ERR_pop_to_mark();
  671|       |
  672|   338k|    if ((x->ex_flags & EXFLAG_INVALID) == 0) {
  ------------------
  |  |  676|   338k|#define EXFLAG_INVALID 0x80
  ------------------
  |  Branch (672:9): [True: 338k, False: 0]
  ------------------
  673|   338k|        CRYPTO_THREAD_unlock(x->lock);
  674|   338k|        return 1;
  675|   338k|    }
  676|      0|    CRYPTO_THREAD_unlock(x->lock);
  677|       |    ERR_raise(ERR_LIB_X509V3, X509V3_R_INVALID_CERTIFICATE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  678|      0|    return 0;
  679|   338k|}
X509_check_akid:
 1041|   338k|{
 1042|   338k|    if (akid == NULL)
  ------------------
  |  Branch (1042:9): [True: 264k, False: 74.1k]
  ------------------
 1043|   264k|        return X509_V_OK;
  ------------------
  |  |  312|   264k|#define X509_V_OK 0
  ------------------
 1044|       |
 1045|       |    /* Check key ids (if present) */
 1046|  74.1k|    if (akid->keyid && issuer->skid && ASN1_OCTET_STRING_cmp(akid->keyid, issuer->skid))
  ------------------
  |  Branch (1046:9): [True: 74.1k, False: 0]
  |  Branch (1046:24): [True: 74.1k, False: 0]
  |  Branch (1046:40): [True: 0, False: 74.1k]
  ------------------
 1047|      0|        return X509_V_ERR_AKID_SKID_MISMATCH;
  ------------------
  |  |  344|      0|#define X509_V_ERR_AKID_SKID_MISMATCH 30
  ------------------
 1048|       |    /* Check serial number */
 1049|  74.1k|    if (akid->serial && ASN1_INTEGER_cmp(X509_get0_serialNumber(issuer), akid->serial))
  ------------------
  |  Branch (1049:9): [True: 11.5k, False: 62.5k]
  |  Branch (1049:25): [True: 0, False: 11.5k]
  ------------------
 1050|      0|        return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH;
  ------------------
  |  |  345|      0|#define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31
  ------------------
 1051|       |    /* Check issuer name */
 1052|  74.1k|    if (akid->issuer) {
  ------------------
  |  Branch (1052:9): [True: 11.5k, False: 62.5k]
  ------------------
 1053|       |        /*
 1054|       |         * Ugh, for some peculiar reason AKID includes SEQUENCE OF
 1055|       |         * GeneralName. So look for a DirName. There may be more than one but
 1056|       |         * we only take any notice of the first.
 1057|       |         */
 1058|  11.5k|        GENERAL_NAMES *gens = akid->issuer;
 1059|  11.5k|        GENERAL_NAME *gen;
 1060|  11.5k|        X509_NAME *nm = NULL;
 1061|  11.5k|        int i;
 1062|       |
 1063|  11.5k|        for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) {
  ------------------
  |  |  242|  11.5k|#define sk_GENERAL_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_NAME_sk_type(sk))
  ------------------
  |  Branch (1063:21): [True: 11.5k, False: 0]
  ------------------
 1064|  11.5k|            gen = sk_GENERAL_NAME_value(gens, i);
  ------------------
  |  |  243|  11.5k|#define sk_GENERAL_NAME_value(sk, idx) ((GENERAL_NAME *)OPENSSL_sk_value(ossl_check_const_GENERAL_NAME_sk_type(sk), (idx)))
  ------------------
 1065|  11.5k|            if (gen->type == GEN_DIRNAME) {
  ------------------
  |  |  180|  11.5k|#define GEN_DIRNAME 4
  ------------------
  |  Branch (1065:17): [True: 11.5k, False: 0]
  ------------------
 1066|  11.5k|                nm = gen->d.dirn;
 1067|  11.5k|                break;
 1068|  11.5k|            }
 1069|  11.5k|        }
 1070|  11.5k|        if (nm != NULL && X509_NAME_cmp(nm, X509_get_issuer_name(issuer)) != 0)
  ------------------
  |  Branch (1070:13): [True: 11.5k, False: 0]
  |  Branch (1070:27): [True: 0, False: 11.5k]
  ------------------
 1071|      0|            return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH;
  ------------------
  |  |  345|      0|#define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31
  ------------------
 1072|  11.5k|    }
 1073|  74.1k|    return X509_V_OK;
  ------------------
  |  |  312|  74.1k|#define X509_V_OK 0
  ------------------
 1074|  74.1k|}
v3_purp.c:nid_cmp:
  302|  1.60M|{
  303|  1.60M|    return *a - *b;
  304|  1.60M|}
v3_purp.c:check_sig_alg_match:
  410|   338k|{
  411|   338k|    int subj_sig_nid;
  412|       |
  413|   338k|    if (issuer_key == NULL)
  ------------------
  |  Branch (413:9): [True: 0, False: 338k]
  ------------------
  414|      0|        return X509_V_ERR_NO_ISSUER_PUBLIC_KEY;
  ------------------
  |  |  336|      0|#define X509_V_ERR_NO_ISSUER_PUBLIC_KEY 24
  ------------------
  415|   338k|    if (OBJ_find_sigid_algs(OBJ_obj2nid(subject->cert_info.signature.algorithm),
  ------------------
  |  Branch (415:9): [True: 0, False: 338k]
  ------------------
  416|   338k|            NULL, &subj_sig_nid)
  417|   338k|        == 0)
  418|      0|        return X509_V_ERR_UNSUPPORTED_SIGNATURE_ALGORITHM;
  ------------------
  |  |  402|      0|#define X509_V_ERR_UNSUPPORTED_SIGNATURE_ALGORITHM 76
  ------------------
  419|   338k|    if (EVP_PKEY_is_a(issuer_key, OBJ_nid2sn(subj_sig_nid))
  ------------------
  |  Branch (419:9): [True: 338k, False: 0]
  ------------------
  420|      0|        || (EVP_PKEY_is_a(issuer_key, "RSA") && subj_sig_nid == NID_rsassaPss))
  ------------------
  |  |  583|      0|#define NID_rsassaPss           912
  ------------------
  |  Branch (420:13): [True: 0, False: 0]
  |  Branch (420:49): [True: 0, False: 0]
  ------------------
  421|   338k|        return X509_V_OK;
  ------------------
  |  |  312|   338k|#define X509_V_OK 0
  ------------------
  422|      0|    return X509_V_ERR_SIGNATURE_ALGORITHM_MISMATCH;
  ------------------
  |  |  403|      0|#define X509_V_ERR_SIGNATURE_ALGORITHM_MISMATCH 77
  ------------------
  423|   338k|}
v3_purp.c:setup_crldp:
  392|   338k|{
  393|   338k|    int i;
  394|       |
  395|   338k|    x->crldp = X509_get_ext_d2i(x, NID_crl_distribution_points, &i, NULL);
  ------------------
  |  | 2745|   338k|#define NID_crl_distribution_points             103
  ------------------
  396|   338k|    if (x->crldp == NULL && i != -1)
  ------------------
  |  Branch (396:9): [True: 312k, False: 25.4k]
  |  Branch (396:29): [True: 0, False: 312k]
  ------------------
  397|      0|        return 0;
  398|       |
  399|   377k|    for (i = 0; i < sk_DIST_POINT_num(x->crldp); i++) {
  ------------------
  |  |  339|   377k|#define sk_DIST_POINT_num(sk) OPENSSL_sk_num(ossl_check_const_DIST_POINT_sk_type(sk))
  ------------------
  |  Branch (399:17): [True: 39.4k, False: 338k]
  ------------------
  400|  39.4k|        int res = setup_dp(x, sk_DIST_POINT_value(x->crldp, i));
  ------------------
  |  |  340|  39.4k|#define sk_DIST_POINT_value(sk, idx) ((DIST_POINT *)OPENSSL_sk_value(ossl_check_const_DIST_POINT_sk_type(sk), (idx)))
  ------------------
  401|       |
  402|  39.4k|        if (res < 1)
  ------------------
  |  Branch (402:13): [True: 0, False: 39.4k]
  ------------------
  403|      0|            return res;
  404|  39.4k|    }
  405|   338k|    return 1;
  406|   338k|}
v3_purp.c:setup_dp:
  350|  39.4k|{
  351|  39.4k|    const X509_NAME *iname = NULL;
  352|  39.4k|    int i;
  353|       |
  354|  39.4k|    if (dp->distpoint == NULL && sk_GENERAL_NAME_num(dp->CRLissuer) <= 0) {
  ------------------
  |  |  242|      0|#define sk_GENERAL_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_NAME_sk_type(sk))
  ------------------
  |  Branch (354:9): [True: 0, False: 39.4k]
  |  Branch (354:34): [True: 0, False: 0]
  ------------------
  355|      0|        ERR_raise(ERR_LIB_X509, X509_R_INVALID_DISTPOINT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  356|      0|        return 0;
  357|      0|    }
  358|  39.4k|    if (dp->reasons != NULL) {
  ------------------
  |  Branch (358:9): [True: 0, False: 39.4k]
  ------------------
  359|      0|        if (dp->reasons->length > 0)
  ------------------
  |  Branch (359:13): [True: 0, False: 0]
  ------------------
  360|      0|            dp->dp_reasons = dp->reasons->data[0];
  361|      0|        if (dp->reasons->length > 1)
  ------------------
  |  Branch (361:13): [True: 0, False: 0]
  ------------------
  362|      0|            dp->dp_reasons |= (dp->reasons->data[1] << 8);
  363|      0|        dp->dp_reasons &= CRLDP_ALL_REASONS;
  ------------------
  |  |  316|      0|#define CRLDP_ALL_REASONS 0x807f
  ------------------
  364|  39.4k|    } else {
  365|  39.4k|        dp->dp_reasons = CRLDP_ALL_REASONS;
  ------------------
  |  |  316|  39.4k|#define CRLDP_ALL_REASONS 0x807f
  ------------------
  366|  39.4k|    }
  367|  39.4k|    if (dp->distpoint == NULL || dp->distpoint->type != 1)
  ------------------
  |  Branch (367:9): [True: 0, False: 39.4k]
  |  Branch (367:34): [True: 39.4k, False: 0]
  ------------------
  368|  39.4k|        return 1;
  369|       |
  370|       |    /* Handle name fragment given by nameRelativeToCRLIssuer */
  371|       |    /*
  372|       |     * Note that the below way of determining iname is not really compliant
  373|       |     * with https://tools.ietf.org/html/rfc5280#section-4.2.1.13
  374|       |     * According to it, sk_GENERAL_NAME_num(dp->CRLissuer) MUST be <= 1
  375|       |     * and any CRLissuer could be of type different to GEN_DIRNAME.
  376|       |     */
  377|      0|    for (i = 0; i < sk_GENERAL_NAME_num(dp->CRLissuer); i++) {
  ------------------
  |  |  242|      0|#define sk_GENERAL_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_GENERAL_NAME_sk_type(sk))
  ------------------
  |  Branch (377:17): [True: 0, False: 0]
  ------------------
  378|      0|        GENERAL_NAME *gen = sk_GENERAL_NAME_value(dp->CRLissuer, i);
  ------------------
  |  |  243|      0|#define sk_GENERAL_NAME_value(sk, idx) ((GENERAL_NAME *)OPENSSL_sk_value(ossl_check_const_GENERAL_NAME_sk_type(sk), (idx)))
  ------------------
  379|       |
  380|      0|        if (gen->type == GEN_DIRNAME) {
  ------------------
  |  |  180|      0|#define GEN_DIRNAME 4
  ------------------
  |  Branch (380:13): [True: 0, False: 0]
  ------------------
  381|      0|            iname = gen->d.directoryName;
  382|      0|            break;
  383|      0|        }
  384|      0|    }
  385|      0|    if (iname == NULL)
  ------------------
  |  Branch (385:9): [True: 0, False: 0]
  ------------------
  386|      0|        iname = X509_get_issuer_name(x);
  387|      0|    return DIST_POINT_set_dpname(dp->distpoint, iname) ? 1 : -1;
  ------------------
  |  Branch (387:12): [True: 0, False: 0]
  ------------------
  388|  39.4k|}

ossl_err_load_X509V3_strings:
  146|      1|{
  147|      1|#ifndef OPENSSL_NO_ERR
  148|      1|    if (ERR_reason_error_string(X509V3_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (148:9): [True: 1, False: 0]
  ------------------
  149|      1|        ERR_load_strings_const(X509V3_str_reasons);
  150|      1|#endif
  151|      1|    return 1;
  152|      1|}

X509_subject_name_cmp:
   78|  30.2M|{
   79|  30.2M|    return X509_NAME_cmp(a->cert_info.subject, b->cert_info.subject);
   80|  30.2M|}
X509_get_issuer_name:
  101|   350k|{
  102|   350k|    return a->cert_info.issuer;
  103|   350k|}
X509_get_subject_name:
  118|   338k|{
  119|   338k|    return a->cert_info.subject;
  120|   338k|}
X509_get0_serialNumber:
  128|  11.5k|{
  129|  11.5k|    return &a->cert_info.serialNumber;
  130|  11.5k|}
X509_cmp:
  153|   169k|{
  154|   169k|    int rv = 0;
  155|       |
  156|   169k|    if (a == b) /* for efficiency */
  ------------------
  |  Branch (156:9): [True: 0, False: 169k]
  ------------------
  157|      0|        return 0;
  158|       |
  159|       |    /* attempt to compute cert hash */
  160|   169k|    (void)X509_check_purpose((X509 *)a, -1, 0);
  161|   169k|    (void)X509_check_purpose((X509 *)b, -1, 0);
  162|       |
  163|   169k|    if ((a->ex_flags & EXFLAG_NO_FINGERPRINT) == 0
  ------------------
  |  |  690|   169k|#define EXFLAG_NO_FINGERPRINT 0x100000
  ------------------
  |  Branch (163:9): [True: 169k, False: 0]
  ------------------
  164|   169k|        && (b->ex_flags & EXFLAG_NO_FINGERPRINT) == 0)
  ------------------
  |  |  690|   169k|#define EXFLAG_NO_FINGERPRINT 0x100000
  ------------------
  |  Branch (164:12): [True: 169k, False: 0]
  ------------------
  165|   169k|        rv = memcmp(a->sha1_hash, b->sha1_hash, SHA_DIGEST_LENGTH);
  ------------------
  |  |   26|   169k|#define SHA_DIGEST_LENGTH 20
  ------------------
  166|   169k|    if (rv != 0)
  ------------------
  |  Branch (166:9): [True: 0, False: 169k]
  ------------------
  167|      0|        return rv < 0 ? -1 : 1;
  ------------------
  |  Branch (167:16): [True: 0, False: 0]
  ------------------
  168|       |
  169|       |    /* Check for match against stored encoding too */
  170|   169k|    if (!a->cert_info.enc.modified && !b->cert_info.enc.modified) {
  ------------------
  |  Branch (170:9): [True: 169k, False: 0]
  |  Branch (170:39): [True: 169k, False: 0]
  ------------------
  171|   169k|        if (a->cert_info.enc.len < b->cert_info.enc.len)
  ------------------
  |  Branch (171:13): [True: 0, False: 169k]
  ------------------
  172|      0|            return -1;
  173|   169k|        if (a->cert_info.enc.len > b->cert_info.enc.len)
  ------------------
  |  Branch (173:13): [True: 0, False: 169k]
  ------------------
  174|      0|            return 1;
  175|   169k|        rv = memcmp(a->cert_info.enc.enc,
  176|   169k|            b->cert_info.enc.enc, a->cert_info.enc.len);
  177|   169k|    }
  178|   169k|    return rv < 0 ? -1 : rv > 0;
  ------------------
  |  Branch (178:12): [True: 0, False: 169k]
  ------------------
  179|   169k|}
X509_NAME_cmp:
  256|  30.5M|{
  257|  30.5M|    int ret;
  258|       |
  259|  30.5M|    if (b == NULL)
  ------------------
  |  Branch (259:9): [True: 0, False: 30.5M]
  ------------------
  260|      0|        return a != NULL;
  261|  30.5M|    if (a == NULL)
  ------------------
  |  Branch (261:9): [True: 0, False: 30.5M]
  ------------------
  262|      0|        return -1;
  263|       |
  264|       |    /* Ensure canonical encoding is present and up to date */
  265|  30.5M|    if (a->canon_enc == NULL || a->modified) {
  ------------------
  |  Branch (265:9): [True: 0, False: 30.5M]
  |  Branch (265:33): [True: 0, False: 30.5M]
  ------------------
  266|      0|        ret = i2d_X509_NAME((X509_NAME *)a, NULL);
  267|      0|        if (ret < 0)
  ------------------
  |  Branch (267:13): [True: 0, False: 0]
  ------------------
  268|      0|            return -2;
  269|      0|    }
  270|       |
  271|  30.5M|    if (b->canon_enc == NULL || b->modified) {
  ------------------
  |  Branch (271:9): [True: 0, False: 30.5M]
  |  Branch (271:33): [True: 0, False: 30.5M]
  ------------------
  272|      0|        ret = i2d_X509_NAME((X509_NAME *)b, NULL);
  273|      0|        if (ret < 0)
  ------------------
  |  Branch (273:13): [True: 0, False: 0]
  ------------------
  274|      0|            return -2;
  275|      0|    }
  276|       |
  277|  30.5M|    ret = a->canon_enclen - b->canon_enclen;
  278|  30.5M|    if (ret == 0 && a->canon_enclen == 0)
  ------------------
  |  Branch (278:9): [True: 1.18M, False: 29.3M]
  |  Branch (278:21): [True: 0, False: 1.18M]
  ------------------
  279|      0|        return 0;
  280|       |
  281|  30.5M|    if (ret == 0) {
  ------------------
  |  Branch (281:9): [True: 1.18M, False: 29.3M]
  ------------------
  282|  1.18M|        if (a->canon_enc == NULL || b->canon_enc == NULL)
  ------------------
  |  Branch (282:13): [True: 0, False: 1.18M]
  |  Branch (282:37): [True: 0, False: 1.18M]
  ------------------
  283|      0|            return -2;
  284|  1.18M|        ret = memcmp(a->canon_enc, b->canon_enc, a->canon_enclen);
  285|  1.18M|    }
  286|       |
  287|  30.5M|    return ret < 0 ? -1 : ret > 0;
  ------------------
  |  Branch (287:12): [True: 13.0M, False: 17.5M]
  ------------------
  288|  30.5M|}
X509_get0_pubkey:
  379|   338k|{
  380|   338k|    if (x == NULL)
  ------------------
  |  Branch (380:9): [True: 0, False: 338k]
  ------------------
  381|      0|        return NULL;
  382|   338k|    return X509_PUBKEY_get0(x->cert_info.key);
  383|   338k|}

X509_STORE_load_file_ex:
   52|  2.97k|{
   53|  2.97k|    X509_LOOKUP *lookup;
   54|       |
   55|  2.97k|    if (file == NULL
  ------------------
  |  Branch (55:9): [True: 0, False: 2.97k]
  ------------------
   56|  2.97k|        || (lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_file())) == NULL
  ------------------
  |  Branch (56:12): [True: 0, False: 2.97k]
  ------------------
   57|  2.97k|        || X509_LOOKUP_load_file_ex(lookup, file, X509_FILETYPE_PEM, libctx,
  ------------------
  |  |  301|  2.97k|    X509_LOOKUP_ctrl_ex((x), X509_L_FILE_LOAD, (name), (long)(type), NULL, \
  |  |  ------------------
  |  |  |  |  283|  2.97k|#define X509_L_FILE_LOAD 1
  |  |  ------------------
  |  |  302|  2.97k|        (libctx), (propq))
  ------------------
  |  Branch (57:12): [True: 151, False: 2.82k]
  ------------------
   58|  2.97k|               propq)
   59|  2.97k|            <= 0)
   60|    151|        return 0;
   61|       |
   62|  2.82k|    return 1;
   63|  2.97k|}
X509_STORE_load_file:
   66|  2.97k|{
   67|  2.97k|    return X509_STORE_load_file_ex(ctx, file, NULL, NULL);
   68|  2.97k|}
X509_STORE_load_path:
   71|  2.82k|{
   72|  2.82k|    X509_LOOKUP *lookup;
   73|       |
   74|  2.82k|    if (path == NULL
  ------------------
  |  Branch (74:9): [True: 0, False: 2.82k]
  ------------------
   75|  2.82k|        || (lookup = X509_STORE_add_lookup(ctx, X509_LOOKUP_hash_dir())) == NULL
  ------------------
  |  Branch (75:12): [True: 0, False: 2.82k]
  ------------------
   76|  2.82k|        || X509_LOOKUP_add_dir(lookup, path, X509_FILETYPE_PEM) <= 0)
  ------------------
  |  |  292|  2.82k|    X509_LOOKUP_ctrl((x), X509_L_ADD_DIR, (name), (long)(type), NULL)
  |  |  ------------------
  |  |  |  |  284|  2.82k|#define X509_L_ADD_DIR 2
  |  |  ------------------
  ------------------
  |  Branch (76:12): [True: 3, False: 2.82k]
  ------------------
   77|      3|        return 0;
   78|       |
   79|  2.82k|    return 1;
   80|  2.82k|}

X509_get_default_cert_area:
   79|    787|{
   80|       |#if defined(_WIN32)
   81|       |    RUN_ONCE(&openssldir_setup_init, do_openssldir_setup);
   82|       |    return x509_cert_areaptr;
   83|       |#else
   84|    787|    return X509_CERT_AREA;
  ------------------
  |  |   83|    787|#define X509_CERT_AREA OPENSSLDIR
  ------------------
   85|    787|#endif
   86|    787|}

ossl_err_load_X509_strings:
   92|      1|{
   93|      1|#ifndef OPENSSL_NO_ERR
   94|      1|    if (ERR_reason_error_string(X509_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (94:9): [True: 1, False: 0]
  ------------------
   95|      1|        ERR_load_strings_const(X509_str_reasons);
   96|      1|#endif
   97|      1|    return 1;
   98|      1|}

X509_get_ext_count:
   79|  1.50M|{
   80|  1.50M|    return X509v3_get_ext_count(x->cert_info.extensions);
   81|  1.50M|}
X509_get_ext:
   99|  1.16M|{
  100|  1.16M|    return X509v3_get_ext(x->cert_info.extensions, loc);
  101|  1.16M|}
X509_get_ext_d2i:
  114|  4.06M|{
  115|  4.06M|    return X509V3_get_d2i(x->cert_info.extensions, nid, crit, idx);
  116|  4.06M|}

X509_LOOKUP_new:
   19|  3.41k|{
   20|  3.41k|    X509_LOOKUP *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|  3.41k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   21|       |
   22|  3.41k|    if (ret == NULL)
  ------------------
  |  Branch (22:9): [True: 0, False: 3.41k]
  ------------------
   23|      0|        return NULL;
   24|       |
   25|  3.41k|    ret->method = method;
   26|  3.41k|    if (method->new_item != NULL && method->new_item(ret) == 0) {
  ------------------
  |  Branch (26:9): [True: 1.66k, False: 1.74k]
  |  Branch (26:37): [True: 0, False: 1.66k]
  ------------------
   27|      0|        OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   28|      0|        return NULL;
   29|      0|    }
   30|  3.41k|    return ret;
   31|  3.41k|}
X509_LOOKUP_free:
   34|  3.41k|{
   35|  3.41k|    if (ctx == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 3.41k]
  ------------------
   36|      0|        return;
   37|  3.41k|    if ((ctx->method != NULL) && (ctx->method->free != NULL))
  ------------------
  |  Branch (37:9): [True: 3.41k, False: 0]
  |  Branch (37:34): [True: 1.66k, False: 1.74k]
  ------------------
   38|  1.66k|        (*ctx->method->free)(ctx);
   39|  3.41k|    OPENSSL_free(ctx);
  ------------------
  |  |  131|  3.41k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|  3.41k|}
X509_STORE_lock:
   43|   412k|{
   44|   412k|    return CRYPTO_THREAD_write_lock(xs->lock);
   45|   412k|}
X509_STORE_unlock:
   53|   412k|{
   54|   412k|    return CRYPTO_THREAD_unlock(xs->lock);
   55|   412k|}
X509_LOOKUP_shutdown:
   68|  3.41k|{
   69|  3.41k|    if (ctx->method == NULL)
  ------------------
  |  Branch (69:9): [True: 0, False: 3.41k]
  ------------------
   70|      0|        return 0;
   71|  3.41k|    if (ctx->method->shutdown != NULL)
  ------------------
  |  Branch (71:9): [True: 0, False: 3.41k]
  ------------------
   72|      0|        return ctx->method->shutdown(ctx);
   73|  3.41k|    else
   74|  3.41k|        return 1;
   75|  3.41k|}
X509_LOOKUP_ctrl_ex:
   79|  5.79k|{
   80|  5.79k|    if (ctx->method == NULL)
  ------------------
  |  Branch (80:9): [True: 0, False: 5.79k]
  ------------------
   81|      0|        return -1;
   82|  5.79k|    if (ctx->method->ctrl_ex != NULL)
  ------------------
  |  Branch (82:9): [True: 2.97k, False: 2.82k]
  ------------------
   83|  2.97k|        return ctx->method->ctrl_ex(ctx, cmd, argc, argl, ret, libctx, propq);
   84|  2.82k|    if (ctx->method->ctrl != NULL)
  ------------------
  |  Branch (84:9): [True: 2.82k, False: 0]
  ------------------
   85|  2.82k|        return ctx->method->ctrl(ctx, cmd, argc, argl, ret);
   86|      0|    return 1;
   87|  2.82k|}
X509_LOOKUP_ctrl:
   91|  2.82k|{
   92|  2.82k|    return X509_LOOKUP_ctrl_ex(ctx, cmd, argc, argl, ret, NULL, NULL);
   93|  2.82k|}
X509_STORE_new:
  183|  2.56k|{
  184|  2.56k|    X509_STORE *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|  2.56k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  185|       |
  186|  2.56k|    if (ret == NULL)
  ------------------
  |  Branch (186:9): [True: 0, False: 2.56k]
  ------------------
  187|      0|        return NULL;
  188|  2.56k|    if ((ret->objs = sk_X509_OBJECT_new(x509_object_cmp)) == NULL) {
  ------------------
  |  |  103|  2.56k|#define sk_X509_OBJECT_new(cmp) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new(ossl_check_X509_OBJECT_compfunc_type(cmp)))
  ------------------
  |  Branch (188:9): [True: 0, False: 2.56k]
  ------------------
  189|      0|        ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  190|      0|        goto err;
  191|      0|    }
  192|  2.56k|    ret->cache = 1;
  193|  2.56k|    if ((ret->get_cert_methods = sk_X509_LOOKUP_new_null()) == NULL) {
  ------------------
  |  |   78|  2.56k|#define sk_X509_LOOKUP_new_null() ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (193:9): [True: 0, False: 2.56k]
  ------------------
  194|      0|        ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  195|      0|        goto err;
  196|      0|    }
  197|       |
  198|  2.56k|    if ((ret->param = X509_VERIFY_PARAM_new()) == NULL) {
  ------------------
  |  Branch (198:9): [True: 0, False: 2.56k]
  ------------------
  199|      0|        ERR_raise(ERR_LIB_X509, ERR_R_X509_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  200|      0|        goto err;
  201|      0|    }
  202|  2.56k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509_STORE, ret, &ret->ex_data)) {
  ------------------
  |  |  254|  2.56k|#define CRYPTO_EX_INDEX_X509_STORE 4
  ------------------
  |  Branch (202:9): [True: 0, False: 2.56k]
  ------------------
  203|      0|        ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  204|      0|        goto err;
  205|      0|    }
  206|       |
  207|  2.56k|    ret->lock = CRYPTO_THREAD_lock_new();
  208|  2.56k|    if (ret->lock == NULL) {
  ------------------
  |  Branch (208:9): [True: 0, False: 2.56k]
  ------------------
  209|      0|        ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  210|      0|        goto err;
  211|      0|    }
  212|       |
  213|  2.56k|    if (!CRYPTO_NEW_REF(&ret->references, 1))
  ------------------
  |  Branch (213:9): [True: 0, False: 2.56k]
  ------------------
  214|      0|        goto err;
  215|  2.56k|    return ret;
  216|       |
  217|      0|err:
  218|      0|    X509_VERIFY_PARAM_free(ret->param);
  219|      0|    sk_X509_OBJECT_free(ret->objs);
  ------------------
  |  |  107|      0|#define sk_X509_OBJECT_free(sk) OPENSSL_sk_free(ossl_check_X509_OBJECT_sk_type(sk))
  ------------------
  220|      0|    sk_X509_LOOKUP_free(ret->get_cert_methods);
  ------------------
  |  |   81|      0|#define sk_X509_LOOKUP_free(sk) OPENSSL_sk_free(ossl_check_X509_LOOKUP_sk_type(sk))
  ------------------
  221|      0|    CRYPTO_THREAD_lock_free(ret->lock);
  222|      0|    OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  223|       |    return NULL;
  224|  2.56k|}
X509_STORE_free:
  227|  11.2k|{
  228|  11.2k|    int i;
  229|  11.2k|    STACK_OF(X509_LOOKUP) *sk;
  ------------------
  |  |   33|  11.2k|#define STACK_OF(type) struct stack_st_##type
  ------------------
  230|  11.2k|    X509_LOOKUP *lu;
  231|       |
  232|  11.2k|    if (xs == NULL)
  ------------------
  |  Branch (232:9): [True: 8.66k, False: 2.56k]
  ------------------
  233|  8.66k|        return;
  234|  2.56k|    CRYPTO_DOWN_REF(&xs->references, &i);
  235|  2.56k|    REF_PRINT_COUNT("X509_STORE", i, xs);
  ------------------
  |  |  301|  2.56k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  2.56k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  297|  2.56k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  285|  2.56k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  236|  2.56k|    if (i > 0)
  ------------------
  |  Branch (236:9): [True: 0, False: 2.56k]
  ------------------
  237|      0|        return;
  238|  2.56k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|  2.56k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 2.56k]
  |  |  ------------------
  ------------------
  239|       |
  240|  2.56k|    sk = xs->get_cert_methods;
  241|  5.97k|    for (i = 0; i < sk_X509_LOOKUP_num(sk); i++) {
  ------------------
  |  |   75|  5.97k|#define sk_X509_LOOKUP_num(sk) OPENSSL_sk_num(ossl_check_const_X509_LOOKUP_sk_type(sk))
  ------------------
  |  Branch (241:17): [True: 3.41k, False: 2.56k]
  ------------------
  242|  3.41k|        lu = sk_X509_LOOKUP_value(sk, i);
  ------------------
  |  |   76|  3.41k|#define sk_X509_LOOKUP_value(sk, idx) ((X509_LOOKUP *)OPENSSL_sk_value(ossl_check_const_X509_LOOKUP_sk_type(sk), (idx)))
  ------------------
  243|  3.41k|        X509_LOOKUP_shutdown(lu);
  244|  3.41k|        X509_LOOKUP_free(lu);
  245|  3.41k|    }
  246|  2.56k|    sk_X509_LOOKUP_free(sk);
  ------------------
  |  |   81|  2.56k|#define sk_X509_LOOKUP_free(sk) OPENSSL_sk_free(ossl_check_X509_LOOKUP_sk_type(sk))
  ------------------
  247|  2.56k|    sk_X509_OBJECT_pop_free(xs->objs, X509_OBJECT_free);
  ------------------
  |  |  115|  2.56k|#define sk_X509_OBJECT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_freefunc_type(freefunc))
  ------------------
  248|       |
  249|  2.56k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509_STORE, xs, &xs->ex_data);
  ------------------
  |  |  254|  2.56k|#define CRYPTO_EX_INDEX_X509_STORE 4
  ------------------
  250|  2.56k|    X509_VERIFY_PARAM_free(xs->param);
  251|  2.56k|    CRYPTO_THREAD_lock_free(xs->lock);
  252|  2.56k|    CRYPTO_FREE_REF(&xs->references);
  253|  2.56k|    OPENSSL_free(xs);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  254|  2.56k|}
X509_STORE_add_lookup:
  269|  8.22k|{
  270|  8.22k|    int i;
  271|  8.22k|    STACK_OF(X509_LOOKUP) *sk;
  ------------------
  |  |   33|  8.22k|#define STACK_OF(type) struct stack_st_##type
  ------------------
  272|  8.22k|    X509_LOOKUP *lu;
  273|       |
  274|  8.22k|    sk = xs->get_cert_methods;
  275|  11.0k|    for (i = 0; i < sk_X509_LOOKUP_num(sk); i++) {
  ------------------
  |  |   75|  11.0k|#define sk_X509_LOOKUP_num(sk) OPENSSL_sk_num(ossl_check_const_X509_LOOKUP_sk_type(sk))
  ------------------
  |  Branch (275:17): [True: 7.64k, False: 3.41k]
  ------------------
  276|  7.64k|        lu = sk_X509_LOOKUP_value(sk, i);
  ------------------
  |  |   76|  7.64k|#define sk_X509_LOOKUP_value(sk, idx) ((X509_LOOKUP *)OPENSSL_sk_value(ossl_check_const_X509_LOOKUP_sk_type(sk), (idx)))
  ------------------
  277|  7.64k|        if (m == lu->method) {
  ------------------
  |  Branch (277:13): [True: 4.81k, False: 2.82k]
  ------------------
  278|  4.81k|            return lu;
  279|  4.81k|        }
  280|  7.64k|    }
  281|       |    /* a new one */
  282|  3.41k|    lu = X509_LOOKUP_new(m);
  283|  3.41k|    if (lu == NULL) {
  ------------------
  |  Branch (283:9): [True: 0, False: 3.41k]
  ------------------
  284|      0|        ERR_raise(ERR_LIB_X509, ERR_R_X509_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  285|      0|        return NULL;
  286|      0|    }
  287|       |
  288|  3.41k|    lu->store_ctx = xs;
  289|  3.41k|    if (sk_X509_LOOKUP_push(xs->get_cert_methods, lu))
  ------------------
  |  |   85|  3.41k|#define sk_X509_LOOKUP_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
  |  |  ------------------
  |  |  |  Branch (85:38): [True: 3.41k, False: 0]
  |  |  ------------------
  ------------------
  290|  3.41k|        return lu;
  291|       |    /* sk_X509_LOOKUP_push() failed */
  292|  3.41k|    ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  293|      0|    X509_LOOKUP_free(lu);
  294|       |    return NULL;
  295|  3.41k|}
X509_STORE_add_cert:
  430|   412k|{
  431|   412k|    if (!x509_store_add(xs, x, 0)) {
  ------------------
  |  Branch (431:9): [True: 0, False: 412k]
  ------------------
  432|      0|        ERR_raise(ERR_LIB_X509, ERR_R_X509_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  433|      0|        return 0;
  434|      0|    }
  435|   412k|    return 1;
  436|   412k|}
X509_OBJECT_up_ref_count:
  448|   412k|{
  449|   412k|    switch (a->type) {
  ------------------
  |  Branch (449:13): [True: 412k, False: 0]
  ------------------
  450|      0|    case X509_LU_NONE:
  ------------------
  |  Branch (450:5): [True: 0, False: 412k]
  ------------------
  451|      0|        break;
  452|   412k|    case X509_LU_X509:
  ------------------
  |  Branch (452:5): [True: 412k, False: 0]
  ------------------
  453|   412k|        return X509_up_ref(a->data.x509);
  454|      0|    case X509_LU_CRL:
  ------------------
  |  Branch (454:5): [True: 0, False: 412k]
  ------------------
  455|      0|        return X509_CRL_up_ref(a->data.crl);
  456|   412k|    }
  457|      0|    return 1;
  458|   412k|}
X509_OBJECT_new:
  480|   412k|{
  481|   412k|    X509_OBJECT *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|   412k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  482|       |
  483|   412k|    if (ret == NULL)
  ------------------
  |  Branch (483:9): [True: 0, False: 412k]
  ------------------
  484|      0|        return NULL;
  485|   412k|    ret->type = X509_LU_NONE;
  486|   412k|    return ret;
  487|   412k|}
X509_OBJECT_free:
  528|   412k|{
  529|   412k|    x509_object_free_internal(a);
  530|   412k|    OPENSSL_free(a);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  531|   412k|}
X509_OBJECT_retrieve_match:
  751|   412k|{
  752|   412k|    int idx, i, num;
  753|   412k|    X509_OBJECT *obj;
  754|       |
  755|   412k|    idx = sk_X509_OBJECT_find(h, x);
  ------------------
  |  |  118|   412k|#define sk_X509_OBJECT_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
  ------------------
  756|   412k|    if (idx < 0)
  ------------------
  |  Branch (756:9): [True: 243k, False: 169k]
  ------------------
  757|   243k|        return NULL;
  758|   169k|    if ((x->type != X509_LU_X509) && (x->type != X509_LU_CRL))
  ------------------
  |  Branch (758:9): [True: 0, False: 169k]
  |  Branch (758:38): [True: 0, False: 0]
  ------------------
  759|      0|        return sk_X509_OBJECT_value(h, idx);
  ------------------
  |  |  102|      0|#define sk_X509_OBJECT_value(sk, idx) ((X509_OBJECT *)OPENSSL_sk_value(ossl_check_const_X509_OBJECT_sk_type(sk), (idx)))
  ------------------
  760|   169k|    for (i = idx, num = sk_X509_OBJECT_num(h); i < num; i++) {
  ------------------
  |  |  101|   169k|#define sk_X509_OBJECT_num(sk) OPENSSL_sk_num(ossl_check_const_X509_OBJECT_sk_type(sk))
  ------------------
  |  Branch (760:48): [True: 169k, False: 0]
  ------------------
  761|   169k|        obj = sk_X509_OBJECT_value(h, i);
  ------------------
  |  |  102|   169k|#define sk_X509_OBJECT_value(sk, idx) ((X509_OBJECT *)OPENSSL_sk_value(ossl_check_const_X509_OBJECT_sk_type(sk), (idx)))
  ------------------
  762|   169k|        if (x509_object_cmp((const X509_OBJECT **)&obj,
  ------------------
  |  Branch (762:13): [True: 0, False: 169k]
  ------------------
  763|   169k|                (const X509_OBJECT **)&x))
  764|      0|            return NULL;
  765|   169k|        if (x->type == X509_LU_X509) {
  ------------------
  |  Branch (765:13): [True: 169k, False: 0]
  ------------------
  766|   169k|            if (!X509_cmp(obj->data.x509, x->data.x509))
  ------------------
  |  Branch (766:17): [True: 169k, False: 0]
  ------------------
  767|   169k|                return obj;
  768|   169k|        } else if (x->type == X509_LU_CRL) {
  ------------------
  |  Branch (768:20): [True: 0, False: 0]
  ------------------
  769|      0|            if (X509_CRL_match(obj->data.crl, x->data.crl) == 0)
  ------------------
  |  Branch (769:17): [True: 0, False: 0]
  ------------------
  770|      0|                return obj;
  771|      0|        } else {
  772|      0|            return obj;
  773|      0|        }
  774|   169k|    }
  775|      0|    return NULL;
  776|   169k|}
X509_STORE_set_flags:
  779|    394|{
  780|    394|    return X509_VERIFY_PARAM_set_flags(xs->param, flags);
  781|    394|}
x509_lu.c:x509_object_cmp:
  162|  30.2M|{
  163|  30.2M|    int ret;
  164|       |
  165|  30.2M|    ret = ((*a)->type - (*b)->type);
  166|  30.2M|    if (ret)
  ------------------
  |  Branch (166:9): [True: 0, False: 30.2M]
  ------------------
  167|      0|        return ret;
  168|  30.2M|    switch ((*a)->type) {
  ------------------
  |  Branch (168:13): [True: 30.2M, False: 0]
  ------------------
  169|  30.2M|    case X509_LU_X509:
  ------------------
  |  Branch (169:5): [True: 30.2M, False: 0]
  ------------------
  170|  30.2M|        ret = X509_subject_name_cmp((*a)->data.x509, (*b)->data.x509);
  171|  30.2M|        break;
  172|      0|    case X509_LU_CRL:
  ------------------
  |  Branch (172:5): [True: 0, False: 30.2M]
  ------------------
  173|      0|        ret = X509_CRL_cmp((*a)->data.crl, (*b)->data.crl);
  174|      0|        break;
  175|      0|    case X509_LU_NONE:
  ------------------
  |  Branch (175:5): [True: 0, False: 30.2M]
  ------------------
  176|       |        /* abort(); */
  177|      0|        return 0;
  178|  30.2M|    }
  179|  30.2M|    return ret;
  180|  30.2M|}
x509_lu.c:x509_store_add:
  387|   412k|{
  388|   412k|    X509_OBJECT *obj;
  389|   412k|    int ret = 0, added = 0;
  390|       |
  391|   412k|    if (x == NULL)
  ------------------
  |  Branch (391:9): [True: 0, False: 412k]
  ------------------
  392|      0|        return 0;
  393|   412k|    obj = X509_OBJECT_new();
  394|   412k|    if (obj == NULL)
  ------------------
  |  Branch (394:9): [True: 0, False: 412k]
  ------------------
  395|      0|        return 0;
  396|       |
  397|   412k|    if (crl) {
  ------------------
  |  Branch (397:9): [True: 0, False: 412k]
  ------------------
  398|      0|        obj->type = X509_LU_CRL;
  399|      0|        obj->data.crl = (X509_CRL *)x;
  400|   412k|    } else {
  401|   412k|        obj->type = X509_LU_X509;
  402|   412k|        obj->data.x509 = (X509 *)x;
  403|   412k|    }
  404|   412k|    if (!X509_OBJECT_up_ref_count(obj)) {
  ------------------
  |  Branch (404:9): [True: 0, False: 412k]
  ------------------
  405|      0|        obj->type = X509_LU_NONE;
  406|      0|        X509_OBJECT_free(obj);
  407|      0|        return 0;
  408|      0|    }
  409|       |
  410|   412k|    if (!X509_STORE_lock(store)) {
  ------------------
  |  Branch (410:9): [True: 0, False: 412k]
  ------------------
  411|      0|        X509_OBJECT_free(obj);
  412|      0|        return 0;
  413|      0|    }
  414|       |
  415|   412k|    if (X509_OBJECT_retrieve_match(store->objs, obj)) {
  ------------------
  |  Branch (415:9): [True: 169k, False: 243k]
  ------------------
  416|   169k|        ret = 1;
  417|   243k|    } else {
  418|   243k|        added = sk_X509_OBJECT_push(store->objs, obj);
  ------------------
  |  |  111|   243k|#define sk_X509_OBJECT_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
  ------------------
  419|   243k|        ret = added != 0;
  420|   243k|    }
  421|   412k|    X509_STORE_unlock(store);
  422|       |
  423|   412k|    if (added == 0) /* obj not pushed */
  ------------------
  |  Branch (423:9): [True: 169k, False: 243k]
  ------------------
  424|   169k|        X509_OBJECT_free(obj);
  425|       |
  426|   412k|    return ret;
  427|   412k|}
x509_lu.c:x509_object_free_internal:
  490|   412k|{
  491|   412k|    if (a == NULL)
  ------------------
  |  Branch (491:9): [True: 0, False: 412k]
  ------------------
  492|      0|        return;
  493|   412k|    switch (a->type) {
  ------------------
  |  Branch (493:13): [True: 412k, False: 0]
  ------------------
  494|      0|    case X509_LU_NONE:
  ------------------
  |  Branch (494:5): [True: 0, False: 412k]
  ------------------
  495|      0|        break;
  496|   412k|    case X509_LU_X509:
  ------------------
  |  Branch (496:5): [True: 412k, False: 0]
  ------------------
  497|   412k|        X509_free(a->data.x509);
  498|   412k|        break;
  499|      0|    case X509_LU_CRL:
  ------------------
  |  Branch (499:5): [True: 0, False: 412k]
  ------------------
  500|      0|        X509_CRL_free(a->data.crl);
  501|      0|        break;
  502|   412k|    }
  503|   412k|}

X509_up_ref:
  121|   412k|{
  122|   412k|    int i;
  123|       |
  124|   412k|    if (CRYPTO_UP_REF(&x->references, &i) <= 0)
  ------------------
  |  Branch (124:9): [True: 0, False: 412k]
  ------------------
  125|      0|        return 0;
  126|       |
  127|   412k|    REF_PRINT_COUNT("X509", i, x);
  ------------------
  |  |  301|   412k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|   412k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  297|   412k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  285|   412k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  128|   412k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|   412k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 412k]
  |  |  ------------------
  ------------------
  129|   412k|    return i > 1;
  130|   412k|}
X509_get_version:
  133|   338k|{
  134|   338k|    return ASN1_INTEGER_get(x->cert_info.version);
  135|   338k|}
ossl_x509_init_sig_info:
  306|   338k|{
  307|   338k|    return x509_sig_info_init(&x->siginf, &x->sig_alg, &x->signature,
  308|   338k|        X509_PUBKEY_get0(x->cert_info.key));
  309|   338k|}
x509_set.c:x509_sig_info_init:
  219|   338k|{
  220|   338k|    int pknid, mdnid, md_size;
  221|   338k|    const EVP_MD *md;
  222|   338k|    const EVP_PKEY_ASN1_METHOD *ameth;
  223|       |
  224|   338k|    siginf->mdnid = NID_undef;
  ------------------
  |  |   18|   338k|#define NID_undef                       0
  ------------------
  225|   338k|    siginf->pknid = NID_undef;
  ------------------
  |  |   18|   338k|#define NID_undef                       0
  ------------------
  226|   338k|    siginf->secbits = -1;
  227|   338k|    siginf->flags = 0;
  228|   338k|    if (!OBJ_find_sigid_algs(OBJ_obj2nid(alg->algorithm), &mdnid, &pknid)
  ------------------
  |  Branch (228:9): [True: 0, False: 338k]
  ------------------
  229|   338k|        || pknid == NID_undef) {
  ------------------
  |  |   18|   338k|#define NID_undef                       0
  ------------------
  |  Branch (229:12): [True: 0, False: 338k]
  ------------------
  230|      0|        ERR_raise(ERR_LIB_X509, X509_R_UNKNOWN_SIGID_ALGS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  231|      0|        return 0;
  232|      0|    }
  233|   338k|    siginf->mdnid = mdnid;
  234|   338k|    siginf->pknid = pknid;
  235|       |
  236|   338k|    switch (mdnid) {
  237|      0|    case NID_undef:
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (237:5): [True: 0, False: 338k]
  ------------------
  238|       |        /* If we have one, use a custom handler for this algorithm */
  239|      0|        ameth = EVP_PKEY_asn1_find(NULL, pknid);
  240|      0|        if (ameth != NULL && ameth->siginf_set != NULL
  ------------------
  |  Branch (240:13): [True: 0, False: 0]
  |  Branch (240:30): [True: 0, False: 0]
  ------------------
  241|      0|            && ameth->siginf_set(siginf, alg, sig))
  ------------------
  |  Branch (241:16): [True: 0, False: 0]
  ------------------
  242|      0|            break;
  243|      0|        if (pubkey != NULL) {
  ------------------
  |  Branch (243:13): [True: 0, False: 0]
  ------------------
  244|      0|            int secbits;
  245|       |
  246|      0|            secbits = EVP_PKEY_get_security_bits(pubkey);
  247|      0|            if (secbits != 0) {
  ------------------
  |  Branch (247:17): [True: 0, False: 0]
  ------------------
  248|      0|                siginf->secbits = secbits;
  249|      0|                break;
  250|      0|            }
  251|      0|        }
  252|      0|        ERR_raise(ERR_LIB_X509, X509_R_ERROR_USING_SIGINF_SET);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  253|      0|        return 0;
  254|       |        /*
  255|       |         * SHA1 and MD5 are known to be broken. Reduce security bits so that
  256|       |         * they're no longer accepted at security level 1.
  257|       |         * The real values don't really matter as long as they're lower than 80,
  258|       |         * which is our security level 1.
  259|       |         */
  260|  64.9k|    case NID_sha1:
  ------------------
  |  | 2344|  64.9k|#define NID_sha1                64
  ------------------
  |  Branch (260:5): [True: 64.9k, False: 273k]
  ------------------
  261|       |        /*
  262|       |         * https://eprint.iacr.org/2020/014 puts a chosen-prefix attack
  263|       |         * for SHA1 at2^63.4
  264|       |         */
  265|  64.9k|        siginf->secbits = 63;
  266|  64.9k|        break;
  267|      0|    case NID_md5:
  ------------------
  |  | 1238|      0|#define NID_md5         4
  ------------------
  |  Branch (267:5): [True: 0, False: 338k]
  ------------------
  268|       |        /*
  269|       |         * https://documents.epfl.ch/users/l/le/lenstra/public/papers/lat.pdf
  270|       |         * puts a chosen-prefix attack for MD5 at 2^39.
  271|       |         */
  272|      0|        siginf->secbits = 39;
  273|      0|        break;
  274|      0|    case NID_id_GostR3411_94:
  ------------------
  |  | 4569|      0|#define NID_id_GostR3411_94             809
  ------------------
  |  Branch (274:5): [True: 0, False: 338k]
  ------------------
  275|       |        /*
  276|       |         * There is a collision attack on GOST R 34.11-94 at 2^105, see
  277|       |         * https://link.springer.com/chapter/10.1007%2F978-3-540-85174-5_10
  278|       |         */
  279|      0|        siginf->secbits = 105;
  280|      0|        break;
  281|   273k|    default:
  ------------------
  |  Branch (281:5): [True: 273k, False: 64.9k]
  ------------------
  282|       |        /* Security bits: half number of bits in digest */
  283|   273k|        if ((md = EVP_get_digestbynid(mdnid)) == NULL) {
  ------------------
  |  |  547|   273k|#define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a))
  ------------------
  |  Branch (283:13): [True: 0, False: 273k]
  ------------------
  284|      0|            ERR_raise(ERR_LIB_X509, X509_R_ERROR_GETTING_MD_BY_NID);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  285|      0|            return 0;
  286|      0|        }
  287|   273k|        md_size = EVP_MD_get_size(md);
  288|   273k|        if (md_size <= 0)
  ------------------
  |  Branch (288:13): [True: 0, False: 273k]
  ------------------
  289|      0|            return 0;
  290|   273k|        siginf->secbits = md_size * 4;
  291|   273k|        break;
  292|   338k|    }
  293|   338k|    switch (mdnid) {
  ------------------
  |  Branch (293:13): [True: 338k, False: 0]
  ------------------
  294|  64.9k|    case NID_sha1:
  ------------------
  |  | 2344|  64.9k|#define NID_sha1                64
  ------------------
  |  Branch (294:5): [True: 64.9k, False: 273k]
  ------------------
  295|   220k|    case NID_sha256:
  ------------------
  |  | 3287|   220k|#define NID_sha256              672
  ------------------
  |  Branch (295:5): [True: 155k, False: 183k]
  ------------------
  296|   333k|    case NID_sha384:
  ------------------
  |  | 3292|   333k|#define NID_sha384              673
  ------------------
  |  Branch (296:5): [True: 113k, False: 224k]
  ------------------
  297|   338k|    case NID_sha512:
  ------------------
  |  | 3297|   338k|#define NID_sha512              674
  ------------------
  |  Branch (297:5): [True: 4.63k, False: 333k]
  ------------------
  298|   338k|        siginf->flags |= X509_SIG_INFO_TLS;
  ------------------
  |  |  166|   338k|#define X509_SIG_INFO_TLS 0x2
  ------------------
  299|   338k|    }
  300|   338k|    siginf->flags |= X509_SIG_INFO_VALID;
  ------------------
  |  |  164|   338k|#define X509_SIG_INFO_VALID 0x1
  ------------------
  301|   338k|    return 1;
  302|   338k|}

X509v3_get_ext_count:
   21|  1.50M|{
   22|  1.50M|    int ret;
   23|       |
   24|  1.50M|    if (x == NULL)
  ------------------
  |  Branch (24:9): [True: 0, False: 1.50M]
  ------------------
   25|      0|        return 0;
   26|  1.50M|    ret = sk_X509_EXTENSION_num(x);
  ------------------
  |  |  242|  1.50M|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
   27|  1.50M|    return ret > 0 ? ret : 0;
  ------------------
  |  Branch (27:12): [True: 1.50M, False: 0]
  ------------------
   28|  1.50M|}
X509v3_get_ext:
   84|  1.16M|{
   85|  1.16M|    if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
  ------------------
  |  |  242|  1.16M|#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
  ------------------
  |  Branch (85:9): [True: 0, False: 1.16M]
  |  Branch (85:22): [True: 0, False: 1.16M]
  |  Branch (85:57): [True: 0, False: 1.16M]
  ------------------
   86|      0|        return NULL;
   87|  1.16M|    else
   88|  1.16M|        return sk_X509_EXTENSION_value(x, loc);
  ------------------
  |  |  243|  1.16M|#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
  ------------------
   89|  1.16M|}
X509_EXTENSION_get_object:
  253|  16.9M|{
  254|  16.9M|    if (ex == NULL)
  ------------------
  |  Branch (254:9): [True: 0, False: 16.9M]
  ------------------
  255|      0|        return NULL;
  256|  16.9M|    return ex->object;
  257|  16.9M|}
X509_EXTENSION_get_data:
  260|  1.11M|{
  261|  1.11M|    if (ex == NULL)
  ------------------
  |  Branch (261:9): [True: 0, False: 1.11M]
  ------------------
  262|      0|        return NULL;
  263|  1.11M|    return &ex->value;
  264|  1.11M|}
X509_EXTENSION_get_critical:
  267|  2.28M|{
  268|  2.28M|    if (ex == NULL)
  ------------------
  |  Branch (268:9): [True: 0, False: 2.28M]
  ------------------
  269|      0|        return 0;
  270|  2.28M|    if (ex->critical > 0)
  ------------------
  |  Branch (270:9): [True: 1.28M, False: 992k]
  ------------------
  271|  1.28M|        return 1;
  272|   992k|    return 0;
  273|  2.28M|}

X509_VERIFY_PARAM_new:
   82|  6.81k|{
   83|  6.81k|    X509_VERIFY_PARAM *param;
   84|       |
   85|  6.81k|    param = OPENSSL_zalloc(sizeof(*param));
  ------------------
  |  |  108|  6.81k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   86|  6.81k|    if (param == NULL)
  ------------------
  |  Branch (86:9): [True: 0, False: 6.81k]
  ------------------
   87|      0|        return NULL;
   88|  6.81k|    param->trust = X509_TRUST_DEFAULT;
  ------------------
  |  |  195|  6.81k|#define X509_TRUST_DEFAULT 0 /* Only valid in purpose settings */
  ------------------
   89|       |    /* param->inh_flags = X509_VP_FLAG_DEFAULT; */
   90|  6.81k|    param->depth = -1;
   91|  6.81k|    param->auth_level = -1; /* -1 means unset, 0 is explicit */
   92|  6.81k|    return param;
   93|  6.81k|}
X509_VERIFY_PARAM_free:
   96|  6.89k|{
   97|  6.89k|    if (param == NULL)
  ------------------
  |  Branch (97:9): [True: 83, False: 6.81k]
  ------------------
   98|     83|        return;
   99|  6.81k|    sk_ASN1_OBJECT_pop_free(param->policies, ASN1_OBJECT_free);
  ------------------
  |  |  636|  6.81k|#define sk_ASN1_OBJECT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_freefunc_type(freefunc))
  ------------------
  100|  6.81k|    sk_OPENSSL_STRING_pop_free(param->hosts, str_free);
  ------------------
  |  |  246|  6.81k|#define sk_OPENSSL_STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_freefunc_type(freefunc))
  ------------------
  101|  6.81k|    OPENSSL_free(param->peername);
  ------------------
  |  |  131|  6.81k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  102|  6.81k|    OPENSSL_free(param->email);
  ------------------
  |  |  131|  6.81k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  103|  6.81k|    OPENSSL_free(param->ip);
  ------------------
  |  |  131|  6.81k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  104|  6.81k|    OPENSSL_free(param);
  ------------------
  |  |  131|  6.81k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  105|  6.81k|}
X509_VERIFY_PARAM_inherit:
  152|  1.77k|{
  153|  1.77k|    unsigned long inh_flags;
  154|  1.77k|    int to_default, to_overwrite;
  155|       |
  156|  1.77k|    if (src == NULL)
  ------------------
  |  Branch (156:9): [True: 0, False: 1.77k]
  ------------------
  157|      0|        return 1;
  158|  1.77k|    inh_flags = dest->inh_flags | src->inh_flags;
  159|       |
  160|  1.77k|    if ((inh_flags & X509_VP_FLAG_ONCE) != 0)
  ------------------
  |  |  493|  1.77k|#define X509_VP_FLAG_ONCE 0x10
  ------------------
  |  Branch (160:9): [True: 0, False: 1.77k]
  ------------------
  161|      0|        dest->inh_flags = 0;
  162|       |
  163|  1.77k|    if ((inh_flags & X509_VP_FLAG_LOCKED) != 0)
  ------------------
  |  |  492|  1.77k|#define X509_VP_FLAG_LOCKED 0x8
  ------------------
  |  Branch (163:9): [True: 0, False: 1.77k]
  ------------------
  164|      0|        return 1;
  165|       |
  166|  1.77k|    to_default = (inh_flags & X509_VP_FLAG_DEFAULT) != 0;
  ------------------
  |  |  489|  1.77k|#define X509_VP_FLAG_DEFAULT 0x1
  ------------------
  167|  1.77k|    to_overwrite = (inh_flags & X509_VP_FLAG_OVERWRITE) != 0;
  ------------------
  |  |  490|  1.77k|#define X509_VP_FLAG_OVERWRITE 0x2
  ------------------
  168|       |
  169|  1.77k|    x509_verify_param_copy(purpose, 0);
  ------------------
  |  |  147|  1.77k|    if (test_x509_verify_param_copy(field, def)) \
  |  |  ------------------
  |  |  |  |  142|  1.77k|    (to_overwrite || (src->field != def && (to_default || dest->field == def)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:6): [True: 0, False: 1.77k]
  |  |  |  |  |  Branch (142:23): [True: 0, False: 1.77k]
  |  |  |  |  |  Branch (142:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (142:59): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  148|  1.77k|        dest->field = src->field;
  ------------------
  170|  1.77k|    x509_verify_param_copy(trust, X509_TRUST_DEFAULT);
  ------------------
  |  |  147|  1.77k|    if (test_x509_verify_param_copy(field, def)) \
  |  |  ------------------
  |  |  |  |  142|  1.77k|    (to_overwrite || (src->field != def && (to_default || dest->field == def)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:6): [True: 0, False: 1.77k]
  |  |  |  |  |  Branch (142:23): [True: 0, False: 1.77k]
  |  |  |  |  |  Branch (142:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (142:59): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  148|  1.77k|        dest->field = src->field;
  ------------------
  171|  1.77k|    x509_verify_param_copy(depth, -1);
  ------------------
  |  |  147|  1.77k|    if (test_x509_verify_param_copy(field, def)) \
  |  |  ------------------
  |  |  |  |  142|  1.77k|    (to_overwrite || (src->field != def && (to_default || dest->field == def)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:6): [True: 0, False: 1.77k]
  |  |  |  |  |  Branch (142:23): [True: 0, False: 1.77k]
  |  |  |  |  |  Branch (142:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (142:59): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  148|  1.77k|        dest->field = src->field;
  ------------------
  172|  1.77k|    x509_verify_param_copy(auth_level, -1);
  ------------------
  |  |  147|  1.77k|    if (test_x509_verify_param_copy(field, def)) \
  |  |  ------------------
  |  |  |  |  142|  1.77k|    (to_overwrite || (src->field != def && (to_default || dest->field == def)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:6): [True: 0, False: 1.77k]
  |  |  |  |  |  Branch (142:23): [True: 0, False: 1.77k]
  |  |  |  |  |  Branch (142:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (142:59): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  148|  1.77k|        dest->field = src->field;
  ------------------
  173|       |
  174|       |    /* If overwrite or check time not set, copy across */
  175|       |
  176|  1.77k|    if (to_overwrite || (dest->flags & X509_V_FLAG_USE_CHECK_TIME) == 0) {
  ------------------
  |  |  438|  1.77k|#define X509_V_FLAG_USE_CHECK_TIME 0x2
  ------------------
  |  Branch (176:9): [True: 0, False: 1.77k]
  |  Branch (176:25): [True: 1.77k, False: 0]
  ------------------
  177|  1.77k|        dest->check_time = src->check_time;
  178|  1.77k|        dest->flags &= ~X509_V_FLAG_USE_CHECK_TIME;
  ------------------
  |  |  438|  1.77k|#define X509_V_FLAG_USE_CHECK_TIME 0x2
  ------------------
  179|       |        /* Don't need to copy flag: that is done below */
  180|  1.77k|    }
  181|       |
  182|  1.77k|    if ((inh_flags & X509_VP_FLAG_RESET_FLAGS) != 0)
  ------------------
  |  |  491|  1.77k|#define X509_VP_FLAG_RESET_FLAGS 0x4
  ------------------
  |  Branch (182:9): [True: 0, False: 1.77k]
  ------------------
  183|      0|        dest->flags = 0;
  184|       |
  185|  1.77k|    dest->flags |= src->flags;
  186|       |
  187|  1.77k|    if (test_x509_verify_param_copy(policies, NULL)) {
  ------------------
  |  |  142|  1.77k|    (to_overwrite || (src->field != def && (to_default || dest->field == def)))
  |  |  ------------------
  |  |  |  Branch (142:6): [True: 0, False: 1.77k]
  |  |  |  Branch (142:23): [True: 0, False: 1.77k]
  |  |  |  Branch (142:45): [True: 0, False: 0]
  |  |  |  Branch (142:59): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  188|      0|        if (!X509_VERIFY_PARAM_set1_policies(dest, src->policies))
  ------------------
  |  Branch (188:13): [True: 0, False: 0]
  ------------------
  189|      0|            return 0;
  190|      0|    }
  191|       |
  192|  1.77k|    x509_verify_param_copy(hostflags, 0);
  ------------------
  |  |  147|  1.77k|    if (test_x509_verify_param_copy(field, def)) \
  |  |  ------------------
  |  |  |  |  142|  1.77k|    (to_overwrite || (src->field != def && (to_default || dest->field == def)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:6): [True: 0, False: 1.77k]
  |  |  |  |  |  Branch (142:23): [True: 0, False: 1.77k]
  |  |  |  |  |  Branch (142:45): [True: 0, False: 0]
  |  |  |  |  |  Branch (142:59): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  148|  1.77k|        dest->field = src->field;
  ------------------
  193|       |
  194|  1.77k|    if (test_x509_verify_param_copy(hosts, NULL)) {
  ------------------
  |  |  142|  1.77k|    (to_overwrite || (src->field != def && (to_default || dest->field == def)))
  |  |  ------------------
  |  |  |  Branch (142:6): [True: 0, False: 1.77k]
  |  |  |  Branch (142:23): [True: 0, False: 1.77k]
  |  |  |  Branch (142:45): [True: 0, False: 0]
  |  |  |  Branch (142:59): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  195|      0|        sk_OPENSSL_STRING_pop_free(dest->hosts, str_free);
  ------------------
  |  |  246|      0|#define sk_OPENSSL_STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_freefunc_type(freefunc))
  ------------------
  196|      0|        dest->hosts = NULL;
  197|      0|        if (src->hosts != NULL) {
  ------------------
  |  Branch (197:13): [True: 0, False: 0]
  ------------------
  198|      0|            dest->hosts = sk_OPENSSL_STRING_deep_copy(src->hosts, str_copy, str_free);
  ------------------
  |  |  255|      0|#define sk_OPENSSL_STRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_deep_copy(ossl_check_const_OPENSSL_STRING_sk_type(sk), ossl_check_OPENSSL_STRING_copyfunc_type(copyfunc), ossl_check_OPENSSL_STRING_freefunc_type(freefunc)))
  ------------------
  199|      0|            if (dest->hosts == NULL)
  ------------------
  |  Branch (199:17): [True: 0, False: 0]
  ------------------
  200|      0|                return 0;
  201|      0|        }
  202|      0|    }
  203|       |
  204|  1.77k|    if (test_x509_verify_param_copy(email, NULL)) {
  ------------------
  |  |  142|  1.77k|    (to_overwrite || (src->field != def && (to_default || dest->field == def)))
  |  |  ------------------
  |  |  |  Branch (142:6): [True: 0, False: 1.77k]
  |  |  |  Branch (142:23): [True: 0, False: 1.77k]
  |  |  |  Branch (142:45): [True: 0, False: 0]
  |  |  |  Branch (142:59): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  205|      0|        if (!X509_VERIFY_PARAM_set1_email(dest, src->email, src->emaillen))
  ------------------
  |  Branch (205:13): [True: 0, False: 0]
  ------------------
  206|      0|            return 0;
  207|      0|    }
  208|       |
  209|  1.77k|    if (test_x509_verify_param_copy(ip, NULL)) {
  ------------------
  |  |  142|  1.77k|    (to_overwrite || (src->field != def && (to_default || dest->field == def)))
  |  |  ------------------
  |  |  |  Branch (142:6): [True: 0, False: 1.77k]
  |  |  |  Branch (142:23): [True: 0, False: 1.77k]
  |  |  |  Branch (142:45): [True: 0, False: 0]
  |  |  |  Branch (142:59): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  210|      0|        if (!X509_VERIFY_PARAM_set1_ip(dest, src->ip, src->iplen))
  ------------------
  |  Branch (210:13): [True: 0, False: 0]
  ------------------
  211|      0|            return 0;
  212|      0|    }
  213|       |
  214|  1.77k|    return 1;
  215|  1.77k|}
X509_VERIFY_PARAM_set_flags:
  267|    394|{
  268|    394|    param->flags |= flags;
  269|    394|    if ((flags & X509_V_FLAG_POLICY_MASK) != 0)
  ------------------
  |  |  496|    394|#define X509_V_FLAG_POLICY_MASK (X509_V_FLAG_POLICY_CHECK \
  |  |  ------------------
  |  |  |  |  450|    394|#define X509_V_FLAG_POLICY_CHECK 0x80
  |  |  ------------------
  |  |  497|    394|    | X509_V_FLAG_EXPLICIT_POLICY                         \
  |  |  ------------------
  |  |  |  |  452|    394|#define X509_V_FLAG_EXPLICIT_POLICY 0x100
  |  |  ------------------
  |  |  498|    394|    | X509_V_FLAG_INHIBIT_ANY                             \
  |  |  ------------------
  |  |  |  |  454|    394|#define X509_V_FLAG_INHIBIT_ANY 0x200
  |  |  ------------------
  |  |  499|    394|    | X509_V_FLAG_INHIBIT_MAP)
  |  |  ------------------
  |  |  |  |  456|    394|#define X509_V_FLAG_INHIBIT_MAP 0x400
  |  |  ------------------
  ------------------
  |  Branch (269:9): [True: 0, False: 394]
  ------------------
  270|      0|        param->flags |= X509_V_FLAG_POLICY_CHECK;
  ------------------
  |  |  450|      0|#define X509_V_FLAG_POLICY_CHECK 0x80
  ------------------
  271|    394|    return 1;
  272|    394|}
X509_VERIFY_PARAM_move_peername:
  423|  3.54k|{
  424|  3.54k|    char *peername = (from != NULL) ? from->peername : NULL;
  ------------------
  |  Branch (424:22): [True: 0, False: 3.54k]
  ------------------
  425|       |
  426|  3.54k|    if (to->peername != peername) {
  ------------------
  |  Branch (426:9): [True: 0, False: 3.54k]
  ------------------
  427|      0|        OPENSSL_free(to->peername);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  428|      0|        to->peername = peername;
  429|      0|    }
  430|  3.54k|    if (from != NULL)
  ------------------
  |  Branch (430:9): [True: 0, False: 3.54k]
  ------------------
  431|      0|        from->peername = NULL;
  432|  3.54k|}

X509_digest:
  500|   338k|{
  501|   338k|    if (EVP_MD_is_a(md, SN_sha1) && (cert->ex_flags & EXFLAG_SET) != 0
  ------------------
  |  | 2342|   338k|#define SN_sha1         "SHA1"
  ------------------
                  if (EVP_MD_is_a(md, SN_sha1) && (cert->ex_flags & EXFLAG_SET) != 0
  ------------------
  |  |  678|   338k|#define EXFLAG_SET 0x100
  ------------------
  |  Branch (501:9): [True: 338k, False: 0]
  |  Branch (501:37): [True: 0, False: 338k]
  ------------------
  502|      0|        && (cert->ex_flags & EXFLAG_NO_FINGERPRINT) == 0) {
  ------------------
  |  |  690|      0|#define EXFLAG_NO_FINGERPRINT 0x100000
  ------------------
  |  Branch (502:12): [True: 0, False: 0]
  ------------------
  503|       |        /* Asking for SHA1 and we already computed it. */
  504|      0|        if (len != NULL)
  ------------------
  |  Branch (504:13): [True: 0, False: 0]
  ------------------
  505|      0|            *len = sizeof(cert->sha1_hash);
  506|      0|        memcpy(data, cert->sha1_hash, sizeof(cert->sha1_hash));
  507|      0|        return 1;
  508|      0|    }
  509|   338k|    return ossl_asn1_item_digest_ex(ASN1_ITEM_rptr(X509), md, (char *)cert,
  ------------------
  |  |  433|   338k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  510|   338k|        data, len, cert->libctx, cert->propq);
  511|   338k|}

x_name.c:x509_name_ex_new:
   91|  1.66M|{
   92|  1.66M|    X509_NAME *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|  1.66M|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|       |
   94|  1.66M|    if (ret == NULL)
  ------------------
  |  Branch (94:9): [True: 0, False: 1.66M]
  ------------------
   95|      0|        return 0;
   96|  1.66M|    if ((ret->entries = sk_X509_NAME_ENTRY_new_null()) == NULL) {
  ------------------
  |  |  212|  1.66M|#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (96:9): [True: 0, False: 1.66M]
  ------------------
   97|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   98|      0|        goto err;
   99|      0|    }
  100|  1.66M|    if ((ret->bytes = BUF_MEM_new()) == NULL) {
  ------------------
  |  Branch (100:9): [True: 0, False: 1.66M]
  ------------------
  101|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_BUF_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  102|      0|        goto err;
  103|      0|    }
  104|  1.66M|    ret->modified = 1;
  105|  1.66M|    *val = (ASN1_VALUE *)ret;
  106|  1.66M|    return 1;
  107|       |
  108|      0|err:
  109|      0|    if (ret) {
  ------------------
  |  Branch (109:9): [True: 0, False: 0]
  ------------------
  110|      0|        sk_X509_NAME_ENTRY_free(ret->entries);
  ------------------
  |  |  215|      0|#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  111|      0|        OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  112|      0|    }
  113|      0|    return 0;
  114|  1.66M|}
x_name.c:x509_name_ex_free:
  117|  1.66M|{
  118|  1.66M|    X509_NAME *a;
  119|       |
  120|  1.66M|    if (pval == NULL || *pval == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 1.66M]
  |  Branch (120:25): [True: 0, False: 1.66M]
  ------------------
  121|      0|        return;
  122|  1.66M|    a = (X509_NAME *)*pval;
  123|       |
  124|  1.66M|    BUF_MEM_free(a->bytes);
  125|  1.66M|    sk_X509_NAME_ENTRY_pop_free(a->entries, X509_NAME_ENTRY_free);
  ------------------
  |  |  223|  1.66M|#define sk_X509_NAME_ENTRY_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_freefunc_type(freefunc))
  ------------------
  126|  1.66M|    OPENSSL_free(a->canon_enc);
  ------------------
  |  |  131|  1.66M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  127|  1.66M|    OPENSSL_free(a);
  ------------------
  |  |  131|  1.66M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  128|       |    *pval = NULL;
  129|  1.66M|}
x_name.c:x509_name_ex_d2i:
  145|   838k|{
  146|   838k|    const unsigned char *p = *in, *q;
  147|   838k|    union {
  148|   838k|        STACK_OF(STACK_OF_X509_NAME_ENTRY) *s;
  149|   838k|        ASN1_VALUE *a;
  150|   838k|    } intname = {
  151|   838k|        NULL
  152|   838k|    };
  153|   838k|    union {
  154|   838k|        X509_NAME *x;
  155|   838k|        ASN1_VALUE *a;
  156|   838k|    } nm = {
  157|   838k|        NULL
  158|   838k|    };
  159|   838k|    int i, j, ret;
  160|   838k|    STACK_OF(X509_NAME_ENTRY) *entries;
  ------------------
  |  |   33|   838k|#define STACK_OF(type) struct stack_st_##type
  ------------------
  161|   838k|    X509_NAME_ENTRY *entry;
  162|       |
  163|   838k|    if (len > X509_NAME_MAX)
  ------------------
  |  |   24|   838k|#define X509_NAME_MAX (1024 * 1024)
  ------------------
  |  Branch (163:9): [True: 0, False: 838k]
  ------------------
  164|      0|        len = X509_NAME_MAX;
  ------------------
  |  |   24|      0|#define X509_NAME_MAX (1024 * 1024)
  ------------------
  165|   838k|    q = p;
  166|       |
  167|       |    /* Get internal representation of Name */
  168|   838k|    ret = ASN1_item_ex_d2i(&intname.a,
  169|   838k|        &p, len, ASN1_ITEM_rptr(X509_NAME_INTERNAL),
  ------------------
  |  |  433|   838k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  170|   838k|        tag, aclass, opt, ctx);
  171|       |
  172|   838k|    if (ret <= 0)
  ------------------
  |  Branch (172:9): [True: 0, False: 838k]
  ------------------
  173|      0|        return ret;
  174|       |
  175|   838k|    if (*val)
  ------------------
  |  Branch (175:9): [True: 824k, False: 13.9k]
  ------------------
  176|   824k|        x509_name_ex_free(val, NULL);
  177|   838k|    if (!x509_name_ex_new(&nm.a, NULL))
  ------------------
  |  Branch (177:9): [True: 0, False: 838k]
  ------------------
  178|      0|        goto err;
  179|       |    /* We've decoded it: now cache encoding */
  180|   838k|    if (!BUF_MEM_grow(nm.x->bytes, p - q))
  ------------------
  |  Branch (180:9): [True: 0, False: 838k]
  ------------------
  181|      0|        goto err;
  182|   838k|    memcpy(nm.x->bytes->data, q, p - q);
  183|       |
  184|       |    /* Convert internal representation to X509_NAME structure */
  185|  3.82M|    for (i = 0; i < sk_STACK_OF_X509_NAME_ENTRY_num(intname.s); i++) {
  ------------------
  |  Branch (185:17): [True: 2.98M, False: 838k]
  ------------------
  186|  2.98M|        entries = sk_STACK_OF_X509_NAME_ENTRY_value(intname.s, i);
  187|  5.97M|        for (j = 0; j < sk_X509_NAME_ENTRY_num(entries); j++) {
  ------------------
  |  |  209|  5.97M|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (187:21): [True: 2.98M, False: 2.98M]
  ------------------
  188|  2.98M|            entry = sk_X509_NAME_ENTRY_value(entries, j);
  ------------------
  |  |  210|  2.98M|#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
  ------------------
  189|  2.98M|            entry->set = i;
  190|  2.98M|            if (!sk_X509_NAME_ENTRY_push(nm.x->entries, entry))
  ------------------
  |  |  219|  2.98M|#define sk_X509_NAME_ENTRY_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr))
  ------------------
  |  Branch (190:17): [True: 0, False: 2.98M]
  ------------------
  191|      0|                goto err;
  192|  2.98M|            (void)sk_X509_NAME_ENTRY_set(entries, j, NULL);
  ------------------
  |  |  225|  2.98M|#define sk_X509_NAME_ENTRY_set(sk, idx, ptr) ((X509_NAME_ENTRY *)OPENSSL_sk_set(ossl_check_X509_NAME_ENTRY_sk_type(sk), (idx), ossl_check_X509_NAME_ENTRY_type(ptr)))
  ------------------
  193|  2.98M|        }
  194|  2.98M|    }
  195|   838k|    ret = x509_name_canon(nm.x);
  196|   838k|    if (!ret)
  ------------------
  |  Branch (196:9): [True: 0, False: 838k]
  ------------------
  197|      0|        goto err;
  198|   838k|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
  199|   838k|        local_sk_X509_NAME_ENTRY_free);
  200|   838k|    nm.x->modified = 0;
  201|   838k|    *val = nm.a;
  202|   838k|    *in = p;
  203|   838k|    return ret;
  204|       |
  205|      0|err:
  206|      0|    if (nm.x != NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 0]
  ------------------
  207|      0|        X509_NAME_free(nm.x);
  208|      0|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s,
  209|      0|        local_sk_X509_NAME_ENTRY_pop_free);
  210|       |    ERR_raise(ERR_LIB_ASN1, ERR_R_NESTED_ASN1_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  211|      0|    return 0;
  212|   838k|}
x_name.c:x509_name_canon:
  312|   838k|{
  313|   838k|    unsigned char *p;
  314|   838k|    STACK_OF(STACK_OF_X509_NAME_ENTRY) *intname;
  ------------------
  |  |   33|   838k|#define STACK_OF(type) struct stack_st_##type
  ------------------
  315|   838k|    STACK_OF(X509_NAME_ENTRY) *entries = NULL;
  ------------------
  |  |   33|   838k|#define STACK_OF(type) struct stack_st_##type
  ------------------
  316|   838k|    X509_NAME_ENTRY *entry, *tmpentry = NULL;
  317|   838k|    int i, set = -1, ret = 0, len;
  318|       |
  319|   838k|    OPENSSL_free(a->canon_enc);
  ------------------
  |  |  131|   838k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  320|   838k|    a->canon_enc = NULL;
  321|       |    /* Special case: empty X509_NAME => null encoding */
  322|   838k|    if (sk_X509_NAME_ENTRY_num(a->entries) == 0) {
  ------------------
  |  |  209|   838k|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (322:9): [True: 0, False: 838k]
  ------------------
  323|      0|        a->canon_enclen = 0;
  324|      0|        return 1;
  325|      0|    }
  326|   838k|    intname = sk_STACK_OF_X509_NAME_ENTRY_new_null();
  327|   838k|    if (intname == NULL) {
  ------------------
  |  Branch (327:9): [True: 0, False: 838k]
  ------------------
  328|      0|        ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  329|      0|        goto err;
  330|      0|    }
  331|  3.82M|    for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
  ------------------
  |  |  209|  3.82M|#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  |  Branch (331:17): [True: 2.98M, False: 838k]
  ------------------
  332|  2.98M|        entry = sk_X509_NAME_ENTRY_value(a->entries, i);
  ------------------
  |  |  210|  2.98M|#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
  ------------------
  333|  2.98M|        if (entry->set != set) {
  ------------------
  |  Branch (333:13): [True: 2.98M, False: 0]
  ------------------
  334|  2.98M|            entries = sk_X509_NAME_ENTRY_new_null();
  ------------------
  |  |  212|  2.98M|#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
  ------------------
  335|  2.98M|            if (entries == NULL)
  ------------------
  |  Branch (335:17): [True: 0, False: 2.98M]
  ------------------
  336|      0|                goto err;
  337|  2.98M|            if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname, entries)) {
  ------------------
  |  Branch (337:17): [True: 0, False: 2.98M]
  ------------------
  338|      0|                sk_X509_NAME_ENTRY_free(entries);
  ------------------
  |  |  215|      0|#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  339|      0|                ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  340|      0|                goto err;
  341|      0|            }
  342|  2.98M|            set = entry->set;
  343|  2.98M|        }
  344|  2.98M|        tmpentry = X509_NAME_ENTRY_new();
  345|  2.98M|        if (tmpentry == NULL) {
  ------------------
  |  Branch (345:13): [True: 0, False: 2.98M]
  ------------------
  346|      0|            ERR_raise(ERR_LIB_X509, ERR_R_ASN1_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  347|      0|            goto err;
  348|      0|        }
  349|  2.98M|        tmpentry->object = OBJ_dup(entry->object);
  350|  2.98M|        if (tmpentry->object == NULL) {
  ------------------
  |  Branch (350:13): [True: 0, False: 2.98M]
  ------------------
  351|      0|            ERR_raise(ERR_LIB_X509, ERR_R_OBJ_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  352|      0|            goto err;
  353|      0|        }
  354|  2.98M|        if (!asn1_string_canon(tmpentry->value, entry->value))
  ------------------
  |  Branch (354:13): [True: 0, False: 2.98M]
  ------------------
  355|      0|            goto err;
  356|  2.98M|        if (!sk_X509_NAME_ENTRY_push(entries, tmpentry)) {
  ------------------
  |  |  219|  2.98M|#define sk_X509_NAME_ENTRY_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr))
  ------------------
  |  Branch (356:13): [True: 0, False: 2.98M]
  ------------------
  357|      0|            ERR_raise(ERR_LIB_X509, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  358|      0|            goto err;
  359|      0|        }
  360|  2.98M|        tmpentry = NULL;
  361|  2.98M|    }
  362|       |
  363|       |    /* Finally generate encoding */
  364|   838k|    len = i2d_name_canon(intname, NULL);
  365|   838k|    if (len < 0)
  ------------------
  |  Branch (365:9): [True: 0, False: 838k]
  ------------------
  366|      0|        goto err;
  367|   838k|    a->canon_enclen = len;
  368|       |
  369|   838k|    p = OPENSSL_malloc(a->canon_enclen);
  ------------------
  |  |  106|   838k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  370|   838k|    if (p == NULL)
  ------------------
  |  Branch (370:9): [True: 0, False: 838k]
  ------------------
  371|      0|        goto err;
  372|       |
  373|   838k|    a->canon_enc = p;
  374|       |
  375|   838k|    i2d_name_canon(intname, &p);
  376|       |
  377|   838k|    ret = 1;
  378|       |
  379|   838k|err:
  380|   838k|    X509_NAME_ENTRY_free(tmpentry);
  381|   838k|    sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname,
  382|   838k|        local_sk_X509_NAME_ENTRY_pop_free);
  383|   838k|    return ret;
  384|   838k|}
x_name.c:asn1_string_canon:
  394|  2.98M|{
  395|  2.98M|    unsigned char *to, *from;
  396|  2.98M|    int len, i;
  397|       |
  398|       |    /* If type not in bitmask just copy string across */
  399|  2.98M|    if (!(ASN1_tag2bit(in->type) & ASN1_MASK_CANON)) {
  ------------------
  |  |  389|  2.98M|    (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING     \
  |  |  ------------------
  |  |  |  |  119|  2.98M|#define B_ASN1_UTF8STRING 0x2000
  |  |  ------------------
  |  |                   (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING     \
  |  |  ------------------
  |  |  |  |  117|  2.98M|#define B_ASN1_BMPSTRING 0x0800
  |  |  ------------------
  |  |                   (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING     \
  |  |  ------------------
  |  |  |  |  114|  2.98M|#define B_ASN1_UNIVERSALSTRING 0x0100
  |  |  ------------------
  |  |  390|  2.98M|        | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \
  |  |  ------------------
  |  |  |  |  105|  2.98M|#define B_ASN1_PRINTABLESTRING 0x0002
  |  |  ------------------
  |  |                       | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \
  |  |  ------------------
  |  |  |  |  106|  2.98M|#define B_ASN1_T61STRING 0x0004
  |  |  ------------------
  |  |                       | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \
  |  |  ------------------
  |  |  |  |  109|  2.98M|#define B_ASN1_IA5STRING 0x0010
  |  |  ------------------
  |  |  391|  2.98M|        | B_ASN1_VISIBLESTRING)
  |  |  ------------------
  |  |  |  |  112|  2.98M|#define B_ASN1_VISIBLESTRING 0x0040
  |  |  ------------------
  ------------------
  |  Branch (399:9): [True: 0, False: 2.98M]
  ------------------
  400|      0|        if (!ASN1_STRING_copy(out, in))
  ------------------
  |  Branch (400:13): [True: 0, False: 0]
  ------------------
  401|      0|            return 0;
  402|      0|        return 1;
  403|      0|    }
  404|       |
  405|  2.98M|    out->type = V_ASN1_UTF8STRING;
  ------------------
  |  |   75|  2.98M|#define V_ASN1_UTF8STRING 12
  ------------------
  406|  2.98M|    out->length = ASN1_STRING_to_UTF8(&out->data, in);
  407|  2.98M|    if (out->length == -1)
  ------------------
  |  Branch (407:9): [True: 0, False: 2.98M]
  ------------------
  408|      0|        return 0;
  409|       |
  410|  2.98M|    to = out->data;
  411|  2.98M|    from = to;
  412|       |
  413|  2.98M|    len = out->length;
  414|       |
  415|       |    /*
  416|       |     * Convert string in place to canonical form. Ultimately we may need to
  417|       |     * handle a wider range of characters but for now ignore anything with
  418|       |     * MSB set and rely on the ossl_isspace() to fail on bad characters without
  419|       |     * needing isascii or range checks as well.
  420|       |     */
  421|       |
  422|       |    /* Ignore leading spaces */
  423|  2.98M|    while (len > 0 && ossl_isspace(*from)) {
  ------------------
  |  |   82|  2.98M|#define ossl_isspace(c) (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  2.98M|#define CTYPE_MASK_space 0x8
  |  |  ------------------
  |  |  |  Branch (82:25): [True: 0, False: 2.98M]
  |  |  ------------------
  ------------------
  |  Branch (423:12): [True: 2.98M, False: 0]
  ------------------
  424|      0|        from++;
  425|      0|        len--;
  426|      0|    }
  427|       |
  428|  2.98M|    to = from + len;
  429|       |
  430|       |    /* Ignore trailing spaces */
  431|  2.98M|    while (len > 0 && ossl_isspace(to[-1])) {
  ------------------
  |  |   82|  2.98M|#define ossl_isspace(c) (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  2.98M|#define CTYPE_MASK_space 0x8
  |  |  ------------------
  |  |  |  Branch (82:25): [True: 0, False: 2.98M]
  |  |  ------------------
  ------------------
  |  Branch (431:12): [True: 2.98M, False: 0]
  ------------------
  432|      0|        to--;
  433|      0|        len--;
  434|      0|    }
  435|       |
  436|  2.98M|    to = out->data;
  437|       |
  438|  2.98M|    i = 0;
  439|  50.7M|    while (i < len) {
  ------------------
  |  Branch (439:12): [True: 47.7M, False: 2.98M]
  ------------------
  440|       |        /* If not ASCII set just copy across */
  441|  47.7M|        if (!ossl_isascii(*from)) {
  ------------------
  |  |   75|  47.7M|#define ossl_isascii(c) (((c) & ~127) == 0)
  ------------------
  |  Branch (441:13): [True: 90.3k, False: 47.6M]
  ------------------
  442|  90.3k|            *to++ = *from++;
  443|  90.3k|            i++;
  444|  90.3k|        }
  445|       |        /* Collapse multiple spaces */
  446|  47.6M|        else if (ossl_isspace(*from)) {
  ------------------
  |  |   82|  47.6M|#define ossl_isspace(c) (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  47.6M|#define CTYPE_MASK_space 0x8
  |  |  ------------------
  |  |  |  Branch (82:25): [True: 4.62M, False: 43.0M]
  |  |  ------------------
  ------------------
  447|       |            /* Copy one space across */
  448|  4.62M|            *to++ = ' ';
  449|       |            /*
  450|       |             * Ignore subsequent spaces. Note: don't need to check len here
  451|       |             * because we know the last character is a non-space so we can't
  452|       |             * overflow.
  453|       |             */
  454|  4.62M|            do {
  455|  4.62M|                from++;
  456|  4.62M|                i++;
  457|  4.62M|            } while (ossl_isspace(*from));
  ------------------
  |  |   82|  4.62M|#define ossl_isspace(c) (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|  4.62M|#define CTYPE_MASK_space 0x8
  |  |  ------------------
  |  |  |  Branch (82:25): [True: 0, False: 4.62M]
  |  |  ------------------
  ------------------
  458|  43.0M|        } else {
  459|  43.0M|            *to++ = ossl_tolower(*from);
  460|  43.0M|            from++;
  461|  43.0M|            i++;
  462|  43.0M|        }
  463|  47.7M|    }
  464|       |
  465|  2.98M|    out->length = (int)(to - out->data);
  466|       |
  467|  2.98M|    return 1;
  468|  2.98M|}
x_name.c:i2d_name_canon:
  472|  1.67M|{
  473|  1.67M|    int i, len, ltmp;
  474|  1.67M|    const ASN1_VALUE *v;
  475|  1.67M|    STACK_OF(ASN1_VALUE) *intname = (STACK_OF(ASN1_VALUE) *)_intname;
  ------------------
  |  |   33|  1.67M|#define STACK_OF(type) struct stack_st_##type
  ------------------
  476|       |
  477|  1.67M|    len = 0;
  478|  7.65M|    for (i = 0; i < sk_ASN1_VALUE_num(intname); i++) {
  ------------------
  |  |  887|  7.65M|#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
  ------------------
  |  Branch (478:17): [True: 5.97M, False: 1.67M]
  ------------------
  479|  5.97M|        v = sk_ASN1_VALUE_value(intname, i);
  ------------------
  |  |  888|  5.97M|#define sk_ASN1_VALUE_value(sk, idx) ((ASN1_VALUE *)OPENSSL_sk_value(ossl_check_const_ASN1_VALUE_sk_type(sk), (idx)))
  ------------------
  480|  5.97M|        ltmp = ASN1_item_ex_i2d(&v, in,
  481|  5.97M|            ASN1_ITEM_rptr(X509_NAME_ENTRIES), -1, -1);
  ------------------
  |  |  433|  5.97M|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  482|  5.97M|        if (ltmp < 0 || len > INT_MAX - ltmp)
  ------------------
  |  Branch (482:13): [True: 0, False: 5.97M]
  |  Branch (482:25): [True: 0, False: 5.97M]
  ------------------
  483|      0|            return -1;
  484|  5.97M|        len += ltmp;
  485|  5.97M|    }
  486|  1.67M|    return len;
  487|  1.67M|}
x_name.c:local_sk_X509_NAME_ENTRY_free:
  132|  2.98M|{
  133|  2.98M|    sk_X509_NAME_ENTRY_free(ne);
  ------------------
  |  |  215|  2.98M|#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
  ------------------
  134|  2.98M|}
x_name.c:local_sk_X509_NAME_ENTRY_pop_free:
  137|  2.98M|{
  138|  2.98M|    sk_X509_NAME_ENTRY_pop_free(ne, X509_NAME_ENTRY_free);
  ------------------
  |  |  223|  2.98M|#define sk_X509_NAME_ENTRY_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_freefunc_type(freefunc))
  ------------------
  139|  2.98M|}

ossl_d2i_X509_PUBKEY_INTERNAL:
   70|   412k|{
   71|   412k|    X509_PUBKEY *xpub = OPENSSL_zalloc(sizeof(*xpub));
  ------------------
  |  |  108|   412k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   72|       |
   73|   412k|    if (xpub == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 412k]
  ------------------
   74|      0|        return NULL;
   75|   412k|    return (X509_PUBKEY *)ASN1_item_d2i_ex((ASN1_VALUE **)&xpub, pp, len,
   76|   412k|        ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL),
  ------------------
  |  |  433|   412k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
   77|   412k|        libctx, propq);
   78|   412k|}
ossl_X509_PUBKEY_INTERNAL_free:
   81|   824k|{
   82|   824k|    ASN1_item_free((ASN1_VALUE *)xpub, ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL));
  ------------------
  |  |  433|   824k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
   83|   824k|}
X509_PUBKEY_get0:
  458|  1.08M|{
  459|  1.08M|    if (key == NULL) {
  ------------------
  |  Branch (459:9): [True: 0, False: 1.08M]
  ------------------
  460|      0|        ERR_raise(ERR_LIB_X509, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  461|      0|        return NULL;
  462|      0|    }
  463|       |
  464|  1.08M|    if (key->pkey == NULL) {
  ------------------
  |  Branch (464:9): [True: 0, False: 1.08M]
  ------------------
  465|       |        /* We failed to decode the key when we loaded it, or it was never set */
  466|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_DECODE_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  467|      0|        return NULL;
  468|      0|    }
  469|       |
  470|  1.08M|    return key->pkey;
  471|  1.08M|}
X509_PUBKEY_get:
  474|   412k|{
  475|   412k|    EVP_PKEY *ret = X509_PUBKEY_get0(key);
  476|       |
  477|   412k|    if (ret != NULL && !EVP_PKEY_up_ref(ret)) {
  ------------------
  |  Branch (477:9): [True: 412k, False: 0]
  |  Branch (477:24): [True: 0, False: 412k]
  ------------------
  478|      0|        ERR_raise(ERR_LIB_X509, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  479|       |        ret = NULL;
  480|      0|    }
  481|   412k|    return ret;
  482|   412k|}
ossl_d2i_PUBKEY_legacy:
  537|   412k|{
  538|   412k|    return d2i_PUBKEY_int(a, pp, length, NULL, NULL, 1, d2i_X509_PUBKEY);
  539|   412k|}
d2i_RSA_PUBKEY:
  606|   299k|{
  607|   299k|    EVP_PKEY *pkey;
  608|   299k|    RSA *key = NULL;
  609|   299k|    const unsigned char *q;
  610|       |
  611|   299k|    q = *pp;
  612|   299k|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  613|   299k|    if (pkey == NULL)
  ------------------
  |  Branch (613:9): [True: 0, False: 299k]
  ------------------
  614|      0|        return NULL;
  615|   299k|    key = EVP_PKEY_get1_RSA(pkey);
  616|   299k|    EVP_PKEY_free(pkey);
  617|   299k|    if (key == NULL)
  ------------------
  |  Branch (617:9): [True: 0, False: 299k]
  ------------------
  618|      0|        return NULL;
  619|   299k|    *pp = q;
  620|   299k|    if (a != NULL) {
  ------------------
  |  Branch (620:9): [True: 0, False: 299k]
  ------------------
  621|      0|        RSA_free(*a);
  622|      0|        *a = key;
  623|      0|    }
  624|   299k|    return key;
  625|   299k|}
d2i_EC_PUBKEY:
  797|   112k|{
  798|   112k|    EVP_PKEY *pkey;
  799|   112k|    EC_KEY *key = NULL;
  800|   112k|    const unsigned char *q;
  801|   112k|    int type;
  802|       |
  803|   112k|    q = *pp;
  804|   112k|    pkey = ossl_d2i_PUBKEY_legacy(NULL, &q, length);
  805|   112k|    if (pkey == NULL)
  ------------------
  |  Branch (805:9): [True: 0, False: 112k]
  ------------------
  806|      0|        return NULL;
  807|   112k|    type = EVP_PKEY_get_id(pkey);
  808|   112k|    if (type == EVP_PKEY_EC || type == EVP_PKEY_SM2)
  ------------------
  |  |   73|   112k|#define EVP_PKEY_EC NID_X9_62_id_ecPublicKey
  |  |  ------------------
  |  |  |  |  178|   225k|#define NID_X9_62_id_ecPublicKey                408
  |  |  ------------------
  ------------------
                  if (type == EVP_PKEY_EC || type == EVP_PKEY_SM2)
  ------------------
  |  |   74|      0|#define EVP_PKEY_SM2 NID_sm2
  |  |  ------------------
  |  |  |  | 1255|      0|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (808:9): [True: 112k, False: 0]
  |  Branch (808:32): [True: 0, False: 0]
  ------------------
  809|   112k|        key = EVP_PKEY_get1_EC_KEY(pkey);
  810|   112k|    EVP_PKEY_free(pkey);
  811|   112k|    if (key == NULL)
  ------------------
  |  Branch (811:9): [True: 0, False: 112k]
  ------------------
  812|      0|        return NULL;
  813|   112k|    *pp = q;
  814|   112k|    if (a != NULL) {
  ------------------
  |  Branch (814:9): [True: 0, False: 112k]
  ------------------
  815|      0|        EC_KEY_free(*a);
  816|      0|        *a = key;
  817|      0|    }
  818|   112k|    return key;
  819|   112k|}
X509_PUBKEY_get0_param:
 1031|   824k|{
 1032|   824k|    if (ppkalg)
  ------------------
  |  Branch (1032:9): [True: 0, False: 824k]
  ------------------
 1033|      0|        *ppkalg = pub->algor->algorithm;
 1034|   824k|    if (pk) {
  ------------------
  |  Branch (1034:9): [True: 412k, False: 412k]
  ------------------
 1035|   412k|        *pk = pub->public_key->data;
 1036|   412k|        *ppklen = pub->public_key->length;
 1037|   412k|    }
 1038|   824k|    if (pa)
  ------------------
  |  Branch (1038:9): [True: 824k, False: 0]
  ------------------
 1039|   824k|        *pa = pub->algor;
 1040|   824k|    return 1;
 1041|   824k|}
ossl_x509_PUBKEY_get0_libctx:
 1073|   112k|{
 1074|   112k|    if (plibctx)
  ------------------
  |  Branch (1074:9): [True: 112k, False: 0]
  ------------------
 1075|   112k|        *plibctx = key->libctx;
 1076|   112k|    if (ppropq)
  ------------------
  |  Branch (1076:9): [True: 112k, False: 0]
  ------------------
 1077|   112k|        *ppropq = key->propq;
 1078|   112k|    return 1;
 1079|   112k|}
x_pubkey.c:x509_pubkey_ex_new_ex:
  111|   412k|{
  112|   412k|    X509_PUBKEY *ret;
  113|       |
  114|   412k|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  108|   412k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (114:9): [True: 0, False: 412k]
  ------------------
  115|      0|        return 0;
  116|   412k|    if (!x509_pubkey_ex_populate((ASN1_VALUE **)&ret, NULL)
  ------------------
  |  Branch (116:9): [True: 0, False: 412k]
  ------------------
  117|   412k|        || !x509_pubkey_set0_libctx(ret, libctx, propq)) {
  ------------------
  |  Branch (117:12): [True: 0, False: 412k]
  ------------------
  118|      0|        x509_pubkey_ex_free((ASN1_VALUE **)&ret, NULL);
  119|      0|        ret = NULL;
  120|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_X509_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  121|   412k|    } else {
  122|   412k|        *pval = (ASN1_VALUE *)ret;
  123|   412k|    }
  124|       |
  125|       |    return ret != NULL;
  126|   412k|}
x_pubkey.c:x509_pubkey_ex_populate:
  100|  1.23M|{
  101|  1.23M|    X509_PUBKEY *pubkey = (X509_PUBKEY *)*pval;
  102|       |
  103|  1.23M|    return (pubkey->algor != NULL
  ------------------
  |  Branch (103:13): [True: 412k, False: 824k]
  ------------------
  104|   824k|               || (pubkey->algor = X509_ALGOR_new()) != NULL)
  ------------------
  |  Branch (104:19): [True: 824k, False: 0]
  ------------------
  105|  1.23M|        && (pubkey->public_key != NULL
  ------------------
  |  Branch (105:13): [True: 412k, False: 824k]
  ------------------
  106|   824k|            || (pubkey->public_key = ASN1_BIT_STRING_new()) != NULL);
  ------------------
  |  Branch (106:16): [True: 824k, False: 0]
  ------------------
  107|  1.23M|}
x_pubkey.c:x509_pubkey_ex_d2i_ex:
  133|   824k|{
  134|   824k|    const unsigned char *in_saved = *in;
  135|   824k|    size_t publen;
  136|   824k|    X509_PUBKEY *pubkey;
  137|   824k|    int ret;
  138|   824k|    OSSL_DECODER_CTX *dctx = NULL;
  139|   824k|    unsigned char *tmpbuf = NULL;
  140|       |
  141|   824k|    if (*pval == NULL && !x509_pubkey_ex_new_ex(pval, it, libctx, propq))
  ------------------
  |  Branch (141:9): [True: 0, False: 824k]
  |  Branch (141:26): [True: 0, False: 0]
  ------------------
  142|      0|        return 0;
  143|   824k|    if (!x509_pubkey_ex_populate(pval, NULL)) {
  ------------------
  |  Branch (143:9): [True: 0, False: 824k]
  ------------------
  144|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_X509_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  145|      0|        return 0;
  146|      0|    }
  147|       |
  148|       |    /* This ensures that |*in| advances properly no matter what */
  149|   824k|    if ((ret = asn1_item_embed_d2i(pval, in, len,
  ------------------
  |  Branch (149:9): [True: 0, False: 824k]
  ------------------
  150|   824k|             ASN1_ITEM_rptr(X509_PUBKEY_INTERNAL),
  ------------------
  |  |  433|   824k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  151|   824k|             tag, aclass, opt, ctx, 0,
  152|   824k|             NULL, NULL))
  153|   824k|        <= 0) {
  154|      0|        x509_pubkey_ex_free(pval, it);
  155|      0|        return ret;
  156|      0|    }
  157|       |
  158|   824k|    publen = *in - in_saved;
  159|   824k|    if (!ossl_assert(publen > 0)) {
  ------------------
  |  |   52|   824k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|   824k|    __FILE__, __LINE__)
  ------------------
  |  Branch (159:9): [True: 0, False: 824k]
  ------------------
  160|      0|        ERR_raise(ERR_LIB_ASN1, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  161|      0|        return 0;
  162|      0|    }
  163|       |
  164|   824k|    pubkey = (X509_PUBKEY *)*pval;
  165|   824k|    EVP_PKEY_free(pubkey->pkey);
  166|   824k|    pubkey->pkey = NULL;
  167|       |
  168|       |    /*
  169|       |     * Opportunistically decode the key but remove any non fatal errors
  170|       |     * from the queue. Subsequent explicit attempts to decode/use the key
  171|       |     * will return an appropriate error.
  172|       |     */
  173|   824k|    ERR_set_mark();
  174|       |
  175|       |    /*
  176|       |     * Try to decode with legacy method first.  This ensures that engines
  177|       |     * aren't overridden by providers.
  178|       |     */
  179|   824k|    if ((ret = x509_pubkey_decode(&pubkey->pkey, pubkey)) == -1) {
  ------------------
  |  Branch (179:9): [True: 0, False: 824k]
  ------------------
  180|       |        /* -1 indicates a fatal error, like malloc failure */
  181|      0|        ERR_clear_last_mark();
  182|      0|        goto end;
  183|      0|    }
  184|       |
  185|       |    /* Try to decode it into an EVP_PKEY with OSSL_DECODER */
  186|   824k|    if (ret <= 0 && !pubkey->flag_force_legacy) {
  ------------------
  |  Branch (186:9): [True: 412k, False: 412k]
  |  Branch (186:21): [True: 412k, False: 0]
  ------------------
  187|   412k|        const unsigned char *p;
  188|   412k|        char txtoidname[OSSL_MAX_NAME_SIZE];
  189|   412k|        size_t slen = publen;
  190|       |
  191|       |        /*
  192|       |         * The decoders don't know how to handle anything other than Universal
  193|       |         * class so we modify the data accordingly.
  194|       |         */
  195|   412k|        if (aclass != V_ASN1_UNIVERSAL) {
  ------------------
  |  |   49|   412k|#define V_ASN1_UNIVERSAL 0x00
  ------------------
  |  Branch (195:13): [True: 0, False: 412k]
  ------------------
  196|      0|            tmpbuf = OPENSSL_memdup(in_saved, publen);
  ------------------
  |  |  133|      0|    CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  197|      0|            if (tmpbuf == NULL)
  ------------------
  |  Branch (197:17): [True: 0, False: 0]
  ------------------
  198|      0|                return 0;
  199|      0|            in_saved = tmpbuf;
  200|      0|            *tmpbuf = V_ASN1_CONSTRUCTED | V_ASN1_SEQUENCE;
  ------------------
  |  |   54|      0|#define V_ASN1_CONSTRUCTED 0x20
  ------------------
                          *tmpbuf = V_ASN1_CONSTRUCTED | V_ASN1_SEQUENCE;
  ------------------
  |  |   76|      0|#define V_ASN1_SEQUENCE 16
  ------------------
  201|      0|        }
  202|   412k|        p = in_saved;
  203|       |
  204|   412k|        if (OBJ_obj2txt(txtoidname, sizeof(txtoidname),
  ------------------
  |  Branch (204:13): [True: 0, False: 412k]
  ------------------
  205|   412k|                pubkey->algor->algorithm, 0)
  206|   412k|            <= 0) {
  207|      0|            ERR_clear_last_mark();
  208|      0|            goto end;
  209|      0|        }
  210|   412k|        if ((dctx = OSSL_DECODER_CTX_new_for_pkey(&pubkey->pkey,
  ------------------
  |  Branch (210:13): [True: 412k, False: 0]
  ------------------
  211|   412k|                 "DER", "SubjectPublicKeyInfo",
  212|   412k|                 txtoidname, EVP_PKEY_PUBLIC_KEY,
  ------------------
  |  |  111|   412k|    (EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  107|   412k|    (OSSL_KEYMGMT_SELECT_ALL_PARAMETERS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  647|   412k|    (OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  642|   412k|#define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS 0x04
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  648|   412k|        | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  643|   412k|#define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS 0x80
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  641|   412k|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  |  |  ------------------
  ------------------
  213|   412k|                 pubkey->libctx,
  214|   412k|                 pubkey->propq))
  215|   412k|            != NULL)
  216|       |            /*
  217|       |             * As said higher up, we're being opportunistic.  In other words,
  218|       |             * we don't care if we fail.
  219|       |             */
  220|   412k|            if (OSSL_DECODER_from_data(dctx, &p, &slen)) {
  ------------------
  |  Branch (220:17): [True: 412k, False: 0]
  ------------------
  221|   412k|                if (slen != 0) {
  ------------------
  |  Branch (221:21): [True: 0, False: 412k]
  ------------------
  222|       |                    /*
  223|       |                     * If we successfully decoded then we *must* consume all the
  224|       |                     * bytes.
  225|       |                     */
  226|      0|                    ERR_clear_last_mark();
  227|      0|                    ERR_raise(ERR_LIB_ASN1, EVP_R_DECODE_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  228|      0|                    goto end;
  229|      0|                }
  230|   412k|            }
  231|   412k|    }
  232|       |
  233|   824k|    ERR_pop_to_mark();
  234|   824k|    ret = 1;
  235|   824k|end:
  236|   824k|    OSSL_DECODER_CTX_free(dctx);
  237|   824k|    OPENSSL_free(tmpbuf);
  ------------------
  |  |  131|   824k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  238|   824k|    return ret;
  239|   824k|}
x_pubkey.c:x509_pubkey_set0_libctx:
   49|   824k|{
   50|   824k|    if (x != NULL) {
  ------------------
  |  Branch (50:9): [True: 824k, False: 0]
  ------------------
   51|   824k|        x->libctx = libctx;
   52|   824k|        OPENSSL_free(x->propq);
  ------------------
  |  |  131|   824k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   53|   824k|        x->propq = NULL;
   54|   824k|        if (propq != NULL) {
  ------------------
  |  Branch (54:13): [True: 2, False: 824k]
  ------------------
   55|      2|            x->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  135|      2|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   56|      2|            if (x->propq == NULL)
  ------------------
  |  Branch (56:17): [True: 0, False: 2]
  ------------------
   57|      0|                return 0;
   58|      2|        }
   59|   824k|    }
   60|   824k|    return 1;
   61|   824k|}
x_pubkey.c:x509_pubkey_ex_free:
   86|   824k|{
   87|   824k|    X509_PUBKEY *pubkey;
   88|       |
   89|   824k|    if (pval != NULL && (pubkey = (X509_PUBKEY *)*pval) != NULL) {
  ------------------
  |  Branch (89:9): [True: 824k, False: 0]
  |  Branch (89:25): [True: 824k, False: 0]
  ------------------
   90|   824k|        X509_ALGOR_free(pubkey->algor);
   91|   824k|        ASN1_BIT_STRING_free(pubkey->public_key);
   92|   824k|        EVP_PKEY_free(pubkey->pkey);
   93|   824k|        OPENSSL_free(pubkey->propq);
  ------------------
  |  |  131|   824k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|   824k|        OPENSSL_free(pubkey);
  ------------------
  |  |  131|   824k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   95|       |        *pval = NULL;
   96|   824k|    }
   97|   824k|}
x_pubkey.c:x509_pubkey_decode:
  407|   824k|{
  408|   824k|    EVP_PKEY *pkey;
  409|   824k|    int nid;
  410|       |
  411|   824k|    nid = OBJ_obj2nid(key->algor->algorithm);
  412|   824k|    if (!key->flag_force_legacy) {
  ------------------
  |  Branch (412:9): [True: 412k, False: 412k]
  ------------------
  413|   412k|#ifndef OPENSSL_NO_ENGINE
  414|   412k|        ENGINE *e = NULL;
  415|       |
  416|   412k|        e = ENGINE_get_pkey_meth_engine(nid);
  417|   412k|        if (e == NULL)
  ------------------
  |  Branch (417:13): [True: 412k, False: 0]
  ------------------
  418|   412k|            return 0;
  419|      0|        ENGINE_finish(e);
  420|       |#else
  421|       |        return 0;
  422|       |#endif
  423|      0|    }
  424|       |
  425|   412k|    pkey = EVP_PKEY_new();
  426|   412k|    if (pkey == NULL) {
  ------------------
  |  Branch (426:9): [True: 0, False: 412k]
  ------------------
  427|      0|        ERR_raise(ERR_LIB_X509, ERR_R_EVP_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  428|      0|        return -1;
  429|      0|    }
  430|       |
  431|   412k|    if (!EVP_PKEY_set_type(pkey, nid)) {
  ------------------
  |  Branch (431:9): [True: 0, False: 412k]
  ------------------
  432|      0|        ERR_raise(ERR_LIB_X509, X509_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  433|      0|        goto error;
  434|      0|    }
  435|       |
  436|   412k|    if (pkey->ameth->pub_decode) {
  ------------------
  |  Branch (436:9): [True: 412k, False: 0]
  ------------------
  437|       |        /*
  438|       |         * Treat any failure of pub_decode as a decode error. In
  439|       |         * future we could have different return codes for decode
  440|       |         * errors and fatal errors such as malloc failure.
  441|       |         */
  442|   412k|        if (!pkey->ameth->pub_decode(pkey, key))
  ------------------
  |  Branch (442:13): [True: 0, False: 412k]
  ------------------
  443|      0|            goto error;
  444|   412k|    } else {
  445|      0|        ERR_raise(ERR_LIB_X509, X509_R_METHOD_NOT_SUPPORTED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  446|      0|        goto error;
  447|      0|    }
  448|       |
  449|   412k|    *ppkey = pkey;
  450|   412k|    return 1;
  451|       |
  452|      0|error:
  453|      0|    EVP_PKEY_free(pkey);
  454|      0|    return 0;
  455|   412k|}
x_pubkey.c:d2i_PUBKEY_int:
  495|   412k|{
  496|   412k|    X509_PUBKEY *xpk, *xpk2 = NULL, **pxpk = NULL;
  497|   412k|    EVP_PKEY *pktmp = NULL;
  498|   412k|    const unsigned char *q;
  499|       |
  500|   412k|    q = *pp;
  501|       |
  502|       |    /*
  503|       |     * If libctx or propq are non-NULL, we take advantage of the reuse
  504|       |     * feature.  It's not generally recommended, but is safe enough for
  505|       |     * newly created structures.
  506|       |     */
  507|   412k|    if (libctx != NULL || propq != NULL || force_legacy) {
  ------------------
  |  Branch (507:9): [True: 0, False: 412k]
  |  Branch (507:27): [True: 0, False: 412k]
  |  Branch (507:44): [True: 412k, False: 0]
  ------------------
  508|   412k|        xpk2 = OPENSSL_zalloc(sizeof(*xpk2));
  ------------------
  |  |  108|   412k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  509|   412k|        if (xpk2 == NULL)
  ------------------
  |  Branch (509:13): [True: 0, False: 412k]
  ------------------
  510|      0|            return NULL;
  511|   412k|        if (!x509_pubkey_set0_libctx(xpk2, libctx, propq))
  ------------------
  |  Branch (511:13): [True: 0, False: 412k]
  ------------------
  512|      0|            goto end;
  513|   412k|        xpk2->flag_force_legacy = !!force_legacy;
  514|   412k|        pxpk = &xpk2;
  515|   412k|    }
  516|   412k|    xpk = d2i_x509_pubkey(pxpk, &q, length);
  517|   412k|    if (xpk == NULL)
  ------------------
  |  Branch (517:9): [True: 0, False: 412k]
  ------------------
  518|      0|        goto end;
  519|   412k|    pktmp = X509_PUBKEY_get(xpk);
  520|   412k|    X509_PUBKEY_free(xpk);
  521|   412k|    xpk2 = NULL; /* We know that xpk == xpk2 */
  522|   412k|    if (pktmp == NULL)
  ------------------
  |  Branch (522:9): [True: 0, False: 412k]
  ------------------
  523|      0|        goto end;
  524|   412k|    *pp = q;
  525|   412k|    if (a != NULL) {
  ------------------
  |  Branch (525:9): [True: 0, False: 412k]
  ------------------
  526|      0|        EVP_PKEY_free(*a);
  527|      0|        *a = pktmp;
  528|      0|    }
  529|   412k|end:
  530|   412k|    X509_PUBKEY_free(xpk2);
  531|   412k|    return pktmp;
  532|   412k|}

ossl_x509_set0_libctx:
  141|   412k|{
  142|   412k|    if (x != NULL) {
  ------------------
  |  Branch (142:9): [True: 412k, False: 0]
  ------------------
  143|   412k|        x->libctx = libctx;
  144|   412k|        OPENSSL_free(x->propq);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  145|   412k|        x->propq = NULL;
  146|   412k|        if (propq != NULL) {
  ------------------
  |  Branch (146:13): [True: 2, False: 412k]
  ------------------
  147|      2|            x->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  135|      2|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  148|      2|            if (x->propq == NULL)
  ------------------
  |  Branch (148:17): [True: 0, False: 2]
  ------------------
  149|      0|                return 0;
  150|      2|        }
  151|   412k|    }
  152|   412k|    return 1;
  153|   412k|}
X509_new_ex:
  156|   412k|{
  157|   412k|    X509 *cert = NULL;
  158|       |
  159|   412k|    cert = (X509 *)ASN1_item_new_ex(X509_it(), libctx, propq);
  160|   412k|    if (!ossl_x509_set0_libctx(cert, libctx, propq)) {
  ------------------
  |  Branch (160:9): [True: 0, False: 412k]
  ------------------
  161|      0|        X509_free(cert);
  162|       |        cert = NULL;
  163|      0|    }
  164|   412k|    return cert;
  165|   412k|}
x_x509.c:x509_cb:
   38|  3.48M|{
   39|  3.48M|    X509 *ret = (X509 *)*pval;
   40|       |
   41|  3.48M|    switch (operation) {
   42|       |
   43|   412k|    case ASN1_OP_D2I_PRE:
  ------------------
  |  |  735|   412k|#define ASN1_OP_D2I_PRE 4
  ------------------
  |  Branch (43:5): [True: 412k, False: 3.07M]
  ------------------
   44|   412k|        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509, ret, &ret->ex_data);
  ------------------
  |  |  253|   412k|#define CRYPTO_EX_INDEX_X509 3
  ------------------
   45|   412k|        X509_CERT_AUX_free(ret->aux);
   46|   412k|        ASN1_OCTET_STRING_free(ret->skid);
   47|   412k|        AUTHORITY_KEYID_free(ret->akid);
   48|   412k|        CRL_DIST_POINTS_free(ret->crldp);
   49|   412k|        ossl_policy_cache_free(ret->policy_cache);
   50|   412k|        GENERAL_NAMES_free(ret->altname);
   51|   412k|        NAME_CONSTRAINTS_free(ret->nc);
   52|   412k|#ifndef OPENSSL_NO_RFC3779
   53|   412k|        sk_IPAddressFamily_pop_free(ret->rfc3779_addr, IPAddressFamily_free);
  ------------------
  |  | 1263|   412k|#define sk_IPAddressFamily_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_IPAddressFamily_sk_type(sk), ossl_check_IPAddressFamily_freefunc_type(freefunc))
  ------------------
   54|   412k|        ASIdentifiers_free(ret->rfc3779_asid);
   55|   412k|#endif
   56|   412k|        ASN1_OCTET_STRING_free(ret->distinguishing_id);
   57|       |
   58|       |        /* fall through */
   59|       |
   60|   824k|    case ASN1_OP_NEW_POST:
  ------------------
  |  |  732|   824k|#define ASN1_OP_NEW_POST 1
  ------------------
  |  Branch (60:5): [True: 412k, False: 3.07M]
  ------------------
   61|   824k|        ret->ex_cached = 0;
   62|   824k|        ret->ex_kusage = 0;
   63|   824k|        ret->ex_xkusage = 0;
   64|   824k|        ret->ex_nscert = 0;
   65|   824k|        ret->ex_flags = 0;
   66|   824k|        ret->ex_pathlen = -1;
   67|   824k|        ret->ex_pcpathlen = -1;
   68|   824k|        ret->skid = NULL;
   69|   824k|        ret->akid = NULL;
   70|   824k|        ret->policy_cache = NULL;
   71|   824k|        ret->altname = NULL;
   72|   824k|        ret->nc = NULL;
   73|   824k|#ifndef OPENSSL_NO_RFC3779
   74|   824k|        ret->rfc3779_addr = NULL;
   75|   824k|        ret->rfc3779_asid = NULL;
   76|   824k|#endif
   77|   824k|        ret->distinguishing_id = NULL;
   78|   824k|        ret->aux = NULL;
   79|   824k|        ret->crldp = NULL;
   80|   824k|        if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509, ret, &ret->ex_data))
  ------------------
  |  |  253|   824k|#define CRYPTO_EX_INDEX_X509 3
  ------------------
  |  Branch (80:13): [True: 0, False: 824k]
  ------------------
   81|      0|            return 0;
   82|   824k|        break;
   83|       |
   84|   824k|    case ASN1_OP_FREE_POST:
  ------------------
  |  |  734|   412k|#define ASN1_OP_FREE_POST 3
  ------------------
  |  Branch (84:5): [True: 412k, False: 3.07M]
  ------------------
   85|   412k|        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509, ret, &ret->ex_data);
  ------------------
  |  |  253|   412k|#define CRYPTO_EX_INDEX_X509 3
  ------------------
   86|   412k|        X509_CERT_AUX_free(ret->aux);
   87|   412k|        ASN1_OCTET_STRING_free(ret->skid);
   88|   412k|        AUTHORITY_KEYID_free(ret->akid);
   89|   412k|        CRL_DIST_POINTS_free(ret->crldp);
   90|   412k|        ossl_policy_cache_free(ret->policy_cache);
   91|   412k|        GENERAL_NAMES_free(ret->altname);
   92|   412k|        NAME_CONSTRAINTS_free(ret->nc);
   93|   412k|#ifndef OPENSSL_NO_RFC3779
   94|   412k|        sk_IPAddressFamily_pop_free(ret->rfc3779_addr, IPAddressFamily_free);
  ------------------
  |  | 1263|   412k|#define sk_IPAddressFamily_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_IPAddressFamily_sk_type(sk), ossl_check_IPAddressFamily_freefunc_type(freefunc))
  ------------------
   95|   412k|        ASIdentifiers_free(ret->rfc3779_asid);
   96|   412k|#endif
   97|   412k|        ASN1_OCTET_STRING_free(ret->distinguishing_id);
   98|   412k|        OPENSSL_free(ret->propq);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   99|   412k|        break;
  100|       |
  101|      0|    case ASN1_OP_DUP_POST: {
  ------------------
  |  |  746|      0|#define ASN1_OP_DUP_POST 15
  ------------------
  |  Branch (101:5): [True: 0, False: 3.48M]
  ------------------
  102|      0|        X509 *old = exarg;
  103|       |
  104|      0|        if (!ossl_x509_set0_libctx(ret, old->libctx, old->propq))
  ------------------
  |  Branch (104:13): [True: 0, False: 0]
  ------------------
  105|      0|            return 0;
  106|      0|    } break;
  107|      0|    case ASN1_OP_GET0_LIBCTX: {
  ------------------
  |  |  747|      0|#define ASN1_OP_GET0_LIBCTX 16
  ------------------
  |  Branch (107:5): [True: 0, False: 3.48M]
  ------------------
  108|      0|        OSSL_LIB_CTX **libctx = exarg;
  109|       |
  110|      0|        *libctx = ret->libctx;
  111|      0|    } break;
  112|       |
  113|      0|    case ASN1_OP_GET0_PROPQ: {
  ------------------
  |  |  748|      0|#define ASN1_OP_GET0_PROPQ 17
  ------------------
  |  Branch (113:5): [True: 0, False: 3.48M]
  ------------------
  114|      0|        const char **propq = exarg;
  115|       |
  116|      0|        *propq = ret->propq;
  117|      0|    } break;
  118|       |
  119|  2.25M|    default:
  ------------------
  |  Branch (119:5): [True: 2.25M, False: 1.23M]
  ------------------
  120|  2.25M|        break;
  121|  3.48M|    }
  122|       |
  123|  3.48M|    return 1;
  124|  3.48M|}

engine_load_padlock_int:
   46|      1|{
   47|       |/* On non-x86 CPUs it just returns. */
   48|      1|#ifdef COMPILE_PADLOCKENG
   49|      1|    ENGINE *toadd = ENGINE_padlock();
   50|      1|    if (!toadd)
  ------------------
  |  Branch (50:9): [True: 0, False: 1]
  ------------------
   51|      0|        return;
   52|      1|    ERR_set_mark();
   53|      1|    ENGINE_add(toadd);
   54|       |    /*
   55|       |     * If the "add" worked, it gets a structural reference. So either way, we
   56|       |     * release our just-created reference.
   57|       |     */
   58|      1|    ENGINE_free(toadd);
   59|       |    /*
   60|       |     * If the "add" didn't work, it was probably a conflict because it was
   61|       |     * already added (eg. someone calling ENGINE_load_blah then calling
   62|       |     * ENGINE_load_builtin_engines() perhaps).
   63|       |     */
   64|      1|    ERR_pop_to_mark();
   65|      1|#endif
   66|      1|}
e_padlock.c:ENGINE_padlock:
  123|      1|{
  124|      1|    ENGINE *eng = ENGINE_new();
  125|       |
  126|      1|    if (eng == NULL) {
  ------------------
  |  Branch (126:9): [True: 0, False: 1]
  ------------------
  127|      0|        return NULL;
  128|      0|    }
  129|       |
  130|      1|    if (!padlock_bind_helper(eng)) {
  ------------------
  |  Branch (130:9): [True: 0, False: 1]
  ------------------
  131|      0|        ENGINE_free(eng);
  132|      0|        return NULL;
  133|      0|    }
  134|       |
  135|      1|    return eng;
  136|      1|}
e_padlock.c:padlock_bind_helper:
   95|      1|{
   96|       |    /* Check available features */
   97|      1|    padlock_available();
   98|       |
   99|       |    /*
  100|       |     * RNG is currently disabled for reasons discussed in commentary just
  101|       |     * before padlock_rand_bytes function.
  102|       |     */
  103|      1|    padlock_use_rng = 0;
  104|       |
  105|       |    /* Generate a nice engine name with available features */
  106|      1|    BIO_snprintf(padlock_name, sizeof(padlock_name),
  107|      1|        "VIA PadLock (%s, %s)",
  108|      1|        padlock_use_rng ? "RNG" : "no-RNG",
  ------------------
  |  Branch (108:9): [True: 0, False: 1]
  ------------------
  109|      1|        padlock_use_ace ? "ACE" : "no-ACE");
  ------------------
  |  Branch (109:9): [True: 0, False: 1]
  ------------------
  110|       |
  111|       |    /* Register everything or return with an error */
  112|      1|    if (!ENGINE_set_id(e, padlock_id) || !ENGINE_set_name(e, padlock_name) || !ENGINE_set_init_function(e, padlock_init) || (padlock_use_ace && !ENGINE_set_ciphers(e, padlock_ciphers)) || (padlock_use_rng && !ENGINE_set_RAND(e, &padlock_rand))) {
  ------------------
  |  Branch (112:9): [True: 0, False: 1]
  |  Branch (112:42): [True: 0, False: 1]
  |  Branch (112:79): [True: 0, False: 1]
  |  Branch (112:126): [True: 0, False: 1]
  |  Branch (112:145): [True: 0, False: 0]
  |  Branch (112:190): [True: 0, False: 1]
  |  Branch (112:209): [True: 0, False: 0]
  ------------------
  113|      0|        return 0;
  114|      0|    }
  115|       |
  116|       |    /* Everything looks good */
  117|      1|    return 1;
  118|      1|}
e_padlock.c:padlock_available:
  241|      1|{
  242|      1|    unsigned int edx = padlock_capability();
  243|       |
  244|       |    /* Fill up some flags */
  245|      1|    padlock_use_ace = ((edx & (0x3 << 6)) == (0x3 << 6));
  246|      1|    padlock_use_rng = ((edx & (0x3 << 2)) == (0x3 << 2));
  247|       |
  248|      1|    return padlock_use_ace + padlock_use_rng;
  249|      1|}
e_padlock.c:padlock_init:
  141|      1|{
  142|      1|    return (padlock_use_rng || padlock_use_ace);
  ------------------
  |  Branch (142:13): [True: 0, False: 1]
  |  Branch (142:32): [True: 0, False: 1]
  ------------------
  143|      1|}

EVP_aria_128_cbc:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_cfb128:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_ofb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_ecb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_cbc:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_cfb128:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_ofb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_ecb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_cbc:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_cfb128:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_ofb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_ecb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_cfb1:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_cfb1:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_cfb1:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_128_cfb8:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_192_cfb8:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_aria_256_cfb8:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_bf_cbc:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_bf_cfb64:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_bf_ofb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_bf_ecb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_cast5_cbc:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_cast5_cfb64:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_cast5_ofb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_cast5_ecb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_cbc:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_cfb64:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ofb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ecb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_cfb1:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_cfb8:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede_cbc:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede_cfb64:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede_ofb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_cbc:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_cfb64:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_ofb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_cfb1:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_des_ede3_cfb8:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_idea_cbc:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_idea_cfb64:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_idea_ofb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_idea_ecb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc2_cbc:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc2_cfb64:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc2_ofb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc2_ecb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc5_32_12_16_cbc:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc5_32_12_16_cfb64:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc5_32_12_16_ofb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_rc5_32_12_16_ecb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_seed_cbc:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_seed_cfb128:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_seed_ofb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }
EVP_seed_ecb:
  465|      1|    const EVP_CIPHER *EVP_##cname##_##mode(void) { return &cname##_##mode; }

SHA1_Update:
  158|   338k|{
  159|   338k|    const unsigned char *data = data_;
  160|   338k|    unsigned char *p;
  161|   338k|    HASH_LONG l;
  ------------------
  |  |   19|   338k|#define HASH_LONG SHA_LONG
  |  |  ------------------
  |  |  |  |   34|   338k|#define SHA_LONG unsigned int
  |  |  ------------------
  ------------------
  162|   338k|    size_t n;
  163|       |
  164|   338k|    if (ossl_unlikely(len == 0))
  ------------------
  |  |   23|   338k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 338k]
  |  |  ------------------
  ------------------
  165|      0|        return 1;
  166|       |
  167|   338k|    l = (c->Nl + (((HASH_LONG)len) << 3)) & 0xffffffffUL;
  168|   338k|    if (ossl_unlikely(l < c->Nl)) /* overflow */
  ------------------
  |  |   23|   338k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 338k]
  |  |  ------------------
  ------------------
  169|      0|        c->Nh++;
  170|   338k|    c->Nh += (HASH_LONG)(len >> 29); /* might cause compiler warning on
  171|       |                                      * 16-bit */
  172|   338k|    c->Nl = l;
  173|       |
  174|   338k|    n = c->num;
  175|   338k|    if (ossl_likely(n != 0)) {
  ------------------
  |  |   22|   338k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 338k]
  |  |  ------------------
  ------------------
  176|      0|        p = (unsigned char *)c->data;
  177|       |
  178|      0|        if (len >= HASH_CBLOCK || len + n >= HASH_CBLOCK) {
  ------------------
  |  |   21|      0|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|      0|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (len >= HASH_CBLOCK || len + n >= HASH_CBLOCK) {
  ------------------
  |  |   21|      0|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|      0|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (178:13): [True: 0, False: 0]
  |  Branch (178:35): [True: 0, False: 0]
  ------------------
  179|      0|            memcpy(p + n, data, HASH_CBLOCK - n);
  ------------------
  |  |   21|      0|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|      0|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  180|      0|            HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |   41|      0|#define HASH_BLOCK_DATA_ORDER sha1_block_data_order
  ------------------
  181|      0|            n = HASH_CBLOCK - n;
  ------------------
  |  |   21|      0|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|      0|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|      0|            data += n;
  183|      0|            len -= n;
  184|      0|            c->num = 0;
  185|       |            /*
  186|       |             * We use memset rather than OPENSSL_cleanse() here deliberately.
  187|       |             * Using OPENSSL_cleanse() here could be a performance issue. It
  188|       |             * will get properly cleansed on finalisation so this isn't a
  189|       |             * security problem.
  190|       |             */
  191|      0|            memset(p, 0, HASH_CBLOCK); /* keep it zeroed */
  ------------------
  |  |   21|      0|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|      0|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|      0|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  192|      0|        } else {
  193|      0|            memcpy(p + n, data, len);
  194|      0|            c->num += (unsigned int)len;
  195|      0|            return 1;
  196|      0|        }
  197|      0|    }
  198|       |
  199|   338k|    n = len / HASH_CBLOCK;
  ------------------
  |  |   21|   338k|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   338k|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   338k|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  200|   338k|    if (n > 0) {
  ------------------
  |  Branch (200:9): [True: 338k, False: 0]
  ------------------
  201|   338k|        HASH_BLOCK_DATA_ORDER(c, data, n);
  ------------------
  |  |   41|   338k|#define HASH_BLOCK_DATA_ORDER sha1_block_data_order
  ------------------
  202|   338k|        n *= HASH_CBLOCK;
  ------------------
  |  |   21|   338k|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   338k|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   338k|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  203|   338k|        data += n;
  204|   338k|        len -= n;
  205|   338k|    }
  206|       |
  207|   338k|    if (len != 0) {
  ------------------
  |  Branch (207:9): [True: 336k, False: 2.31k]
  ------------------
  208|   336k|        p = (unsigned char *)c->data;
  209|   336k|        c->num = (unsigned int)len;
  210|   336k|        memcpy(p, data, len);
  211|   336k|    }
  212|   338k|    return 1;
  213|   338k|}
SHA1_Final:
  221|   338k|{
  222|   338k|    unsigned char *p = (unsigned char *)c->data;
  223|   338k|    size_t n = c->num;
  224|       |
  225|   338k|    p[n] = 0x80; /* there is always room for one */
  226|   338k|    n++;
  227|       |
  228|   338k|    if (n > (HASH_CBLOCK - 8)) {
  ------------------
  |  |   21|   338k|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   338k|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   338k|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (228:9): [True: 50.9k, False: 287k]
  ------------------
  229|  50.9k|        memset(p + n, 0, HASH_CBLOCK - n);
  ------------------
  |  |   21|  50.9k|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  50.9k|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  50.9k|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  230|  50.9k|        n = 0;
  231|  50.9k|        HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |   41|  50.9k|#define HASH_BLOCK_DATA_ORDER sha1_block_data_order
  ------------------
  232|  50.9k|    }
  233|   338k|    memset(p + n, 0, HASH_CBLOCK - 8 - n);
  ------------------
  |  |   21|   338k|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   338k|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   338k|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|       |
  235|   338k|    p += HASH_CBLOCK - 8;
  ------------------
  |  |   21|   338k|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   338k|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   338k|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  236|   338k|#if defined(DATA_ORDER_IS_BIG_ENDIAN)
  237|   338k|    (void)HOST_l2c(c->Nh, p);
  ------------------
  |  |  133|   338k|#define HOST_l2c(l, c) (*((c)++) = (unsigned char)(((l) >> 24) & 0xff), \
  |  |  134|   338k|    *((c)++) = (unsigned char)(((l) >> 16) & 0xff),                     \
  |  |  135|   338k|    *((c)++) = (unsigned char)(((l) >> 8) & 0xff),                      \
  |  |  136|   338k|    *((c)++) = (unsigned char)(((l)) & 0xff),                           \
  |  |  137|   338k|    l)
  ------------------
  238|   338k|    (void)HOST_l2c(c->Nl, p);
  ------------------
  |  |  133|   338k|#define HOST_l2c(l, c) (*((c)++) = (unsigned char)(((l) >> 24) & 0xff), \
  |  |  134|   338k|    *((c)++) = (unsigned char)(((l) >> 16) & 0xff),                     \
  |  |  135|   338k|    *((c)++) = (unsigned char)(((l) >> 8) & 0xff),                      \
  |  |  136|   338k|    *((c)++) = (unsigned char)(((l)) & 0xff),                           \
  |  |  137|   338k|    l)
  ------------------
  239|       |#elif defined(DATA_ORDER_IS_LITTLE_ENDIAN)
  240|       |    (void)HOST_l2c(c->Nl, p);
  241|       |    (void)HOST_l2c(c->Nh, p);
  242|       |#endif
  243|   338k|    p -= HASH_CBLOCK;
  ------------------
  |  |   21|   338k|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   338k|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   338k|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  244|   338k|    HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |   41|   338k|#define HASH_BLOCK_DATA_ORDER sha1_block_data_order
  ------------------
  245|   338k|    c->num = 0;
  246|   338k|    OPENSSL_cleanse(p, HASH_CBLOCK);
  ------------------
  |  |   21|   338k|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   338k|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   338k|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  247|       |
  248|       |#ifndef HASH_MAKE_STRING
  249|       |#error "HASH_MAKE_STRING must be defined!"
  250|       |#else
  251|   338k|    HASH_MAKE_STRING(c, md);
  ------------------
  |  |   23|   338k|    do {                         \
  |  |   24|   338k|        unsigned long ll;        \
  |  |   25|   338k|        ll = (c)->h0;            \
  |  |   26|   338k|        (void)HOST_l2c(ll, (s)); \
  |  |  ------------------
  |  |  |  |  133|   338k|#define HOST_l2c(l, c) (*((c)++) = (unsigned char)(((l) >> 24) & 0xff), \
  |  |  |  |  134|   338k|    *((c)++) = (unsigned char)(((l) >> 16) & 0xff),                     \
  |  |  |  |  135|   338k|    *((c)++) = (unsigned char)(((l) >> 8) & 0xff),                      \
  |  |  |  |  136|   338k|    *((c)++) = (unsigned char)(((l)) & 0xff),                           \
  |  |  |  |  137|   338k|    l)
  |  |  ------------------
  |  |   27|   338k|        ll = (c)->h1;            \
  |  |   28|   338k|        (void)HOST_l2c(ll, (s)); \
  |  |  ------------------
  |  |  |  |  133|   338k|#define HOST_l2c(l, c) (*((c)++) = (unsigned char)(((l) >> 24) & 0xff), \
  |  |  |  |  134|   338k|    *((c)++) = (unsigned char)(((l) >> 16) & 0xff),                     \
  |  |  |  |  135|   338k|    *((c)++) = (unsigned char)(((l) >> 8) & 0xff),                      \
  |  |  |  |  136|   338k|    *((c)++) = (unsigned char)(((l)) & 0xff),                           \
  |  |  |  |  137|   338k|    l)
  |  |  ------------------
  |  |   29|   338k|        ll = (c)->h2;            \
  |  |   30|   338k|        (void)HOST_l2c(ll, (s)); \
  |  |  ------------------
  |  |  |  |  133|   338k|#define HOST_l2c(l, c) (*((c)++) = (unsigned char)(((l) >> 24) & 0xff), \
  |  |  |  |  134|   338k|    *((c)++) = (unsigned char)(((l) >> 16) & 0xff),                     \
  |  |  |  |  135|   338k|    *((c)++) = (unsigned char)(((l) >> 8) & 0xff),                      \
  |  |  |  |  136|   338k|    *((c)++) = (unsigned char)(((l)) & 0xff),                           \
  |  |  |  |  137|   338k|    l)
  |  |  ------------------
  |  |   31|   338k|        ll = (c)->h3;            \
  |  |   32|   338k|        (void)HOST_l2c(ll, (s)); \
  |  |  ------------------
  |  |  |  |  133|   338k|#define HOST_l2c(l, c) (*((c)++) = (unsigned char)(((l) >> 24) & 0xff), \
  |  |  |  |  134|   338k|    *((c)++) = (unsigned char)(((l) >> 16) & 0xff),                     \
  |  |  |  |  135|   338k|    *((c)++) = (unsigned char)(((l) >> 8) & 0xff),                      \
  |  |  |  |  136|   338k|    *((c)++) = (unsigned char)(((l)) & 0xff),                           \
  |  |  |  |  137|   338k|    l)
  |  |  ------------------
  |  |   33|   338k|        ll = (c)->h4;            \
  |  |   34|   338k|        (void)HOST_l2c(ll, (s)); \
  |  |  ------------------
  |  |  |  |  133|   338k|#define HOST_l2c(l, c) (*((c)++) = (unsigned char)(((l) >> 24) & 0xff), \
  |  |  |  |  134|   338k|    *((c)++) = (unsigned char)(((l) >> 16) & 0xff),                     \
  |  |  |  |  135|   338k|    *((c)++) = (unsigned char)(((l) >> 8) & 0xff),                      \
  |  |  |  |  136|   338k|    *((c)++) = (unsigned char)(((l)) & 0xff),                           \
  |  |  |  |  137|   338k|    l)
  |  |  ------------------
  |  |   35|   338k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 338k]
  |  |  ------------------
  ------------------
  252|   338k|#endif
  253|       |
  254|   338k|    return 1;
  255|   338k|}
SHA256_Update:
  158|  1.31M|{
  159|  1.31M|    const unsigned char *data = data_;
  160|  1.31M|    unsigned char *p;
  161|  1.31M|    HASH_LONG l;
  ------------------
  |  |   76|  1.31M|#define HASH_LONG SHA_LONG
  |  |  ------------------
  |  |  |  |   34|  1.31M|#define SHA_LONG unsigned int
  |  |  ------------------
  ------------------
  162|  1.31M|    size_t n;
  163|       |
  164|  1.31M|    if (ossl_unlikely(len == 0))
  ------------------
  |  |   23|  1.31M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.31M]
  |  |  ------------------
  ------------------
  165|      0|        return 1;
  166|       |
  167|  1.31M|    l = (c->Nl + (((HASH_LONG)len) << 3)) & 0xffffffffUL;
  168|  1.31M|    if (ossl_unlikely(l < c->Nl)) /* overflow */
  ------------------
  |  |   23|  1.31M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.31M]
  |  |  ------------------
  ------------------
  169|      0|        c->Nh++;
  170|  1.31M|    c->Nh += (HASH_LONG)(len >> 29); /* might cause compiler warning on
  171|       |                                      * 16-bit */
  172|  1.31M|    c->Nl = l;
  173|       |
  174|  1.31M|    n = c->num;
  175|  1.31M|    if (ossl_likely(n != 0)) {
  ------------------
  |  |   22|  1.31M|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 1.27M, False: 42.4k]
  |  |  ------------------
  ------------------
  176|  1.27M|        p = (unsigned char *)c->data;
  177|       |
  178|  1.27M|        if (len >= HASH_CBLOCK || len + n >= HASH_CBLOCK) {
  ------------------
  |  |   78|  1.27M|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  2.54M|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  1.27M|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (len >= HASH_CBLOCK || len + n >= HASH_CBLOCK) {
  ------------------
  |  |   78|  1.27M|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  1.27M|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  1.27M|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (178:13): [True: 0, False: 1.27M]
  |  Branch (178:35): [True: 20.1k, False: 1.25M]
  ------------------
  179|  20.1k|            memcpy(p + n, data, HASH_CBLOCK - n);
  ------------------
  |  |   78|  20.1k|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  20.1k|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  20.1k|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  180|  20.1k|            HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |  125|  20.1k|#define HASH_BLOCK_DATA_ORDER sha256_block_data_order
  ------------------
  181|  20.1k|            n = HASH_CBLOCK - n;
  ------------------
  |  |   78|  20.1k|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  20.1k|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  20.1k|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|  20.1k|            data += n;
  183|  20.1k|            len -= n;
  184|  20.1k|            c->num = 0;
  185|       |            /*
  186|       |             * We use memset rather than OPENSSL_cleanse() here deliberately.
  187|       |             * Using OPENSSL_cleanse() here could be a performance issue. It
  188|       |             * will get properly cleansed on finalisation so this isn't a
  189|       |             * security problem.
  190|       |             */
  191|  20.1k|            memset(p, 0, HASH_CBLOCK); /* keep it zeroed */
  ------------------
  |  |   78|  20.1k|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  20.1k|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  20.1k|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  192|  1.25M|        } else {
  193|  1.25M|            memcpy(p + n, data, len);
  194|  1.25M|            c->num += (unsigned int)len;
  195|  1.25M|            return 1;
  196|  1.25M|        }
  197|  1.27M|    }
  198|       |
  199|  62.5k|    n = len / HASH_CBLOCK;
  ------------------
  |  |   78|  62.5k|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  62.5k|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  62.5k|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  200|  62.5k|    if (n > 0) {
  ------------------
  |  Branch (200:9): [True: 4.08k, False: 58.5k]
  ------------------
  201|  4.08k|        HASH_BLOCK_DATA_ORDER(c, data, n);
  ------------------
  |  |  125|  4.08k|#define HASH_BLOCK_DATA_ORDER sha256_block_data_order
  ------------------
  202|  4.08k|        n *= HASH_CBLOCK;
  ------------------
  |  |   78|  4.08k|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  4.08k|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  4.08k|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  203|  4.08k|        data += n;
  204|  4.08k|        len -= n;
  205|  4.08k|    }
  206|       |
  207|  62.5k|    if (len != 0) {
  ------------------
  |  Branch (207:9): [True: 42.2k, False: 20.3k]
  ------------------
  208|  42.2k|        p = (unsigned char *)c->data;
  209|  42.2k|        c->num = (unsigned int)len;
  210|  42.2k|        memcpy(p, data, len);
  211|  42.2k|    }
  212|  62.5k|    return 1;
  213|  1.31M|}
SHA256_Final:
  221|  24.2k|{
  222|  24.2k|    unsigned char *p = (unsigned char *)c->data;
  223|  24.2k|    size_t n = c->num;
  224|       |
  225|  24.2k|    p[n] = 0x80; /* there is always room for one */
  226|  24.2k|    n++;
  227|       |
  228|  24.2k|    if (n > (HASH_CBLOCK - 8)) {
  ------------------
  |  |   78|  24.2k|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  24.2k|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  24.2k|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (228:9): [True: 1.21k, False: 23.0k]
  ------------------
  229|  1.21k|        memset(p + n, 0, HASH_CBLOCK - n);
  ------------------
  |  |   78|  1.21k|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  1.21k|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  1.21k|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  230|  1.21k|        n = 0;
  231|  1.21k|        HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |  125|  1.21k|#define HASH_BLOCK_DATA_ORDER sha256_block_data_order
  ------------------
  232|  1.21k|    }
  233|  24.2k|    memset(p + n, 0, HASH_CBLOCK - 8 - n);
  ------------------
  |  |   78|  24.2k|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  24.2k|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  24.2k|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|       |
  235|  24.2k|    p += HASH_CBLOCK - 8;
  ------------------
  |  |   78|  24.2k|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  24.2k|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  24.2k|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  236|  24.2k|#if defined(DATA_ORDER_IS_BIG_ENDIAN)
  237|  24.2k|    (void)HOST_l2c(c->Nh, p);
  ------------------
  |  |  133|  24.2k|#define HOST_l2c(l, c) (*((c)++) = (unsigned char)(((l) >> 24) & 0xff), \
  |  |  134|  24.2k|    *((c)++) = (unsigned char)(((l) >> 16) & 0xff),                     \
  |  |  135|  24.2k|    *((c)++) = (unsigned char)(((l) >> 8) & 0xff),                      \
  |  |  136|  24.2k|    *((c)++) = (unsigned char)(((l)) & 0xff),                           \
  |  |  137|  24.2k|    l)
  ------------------
  238|  24.2k|    (void)HOST_l2c(c->Nl, p);
  ------------------
  |  |  133|  24.2k|#define HOST_l2c(l, c) (*((c)++) = (unsigned char)(((l) >> 24) & 0xff), \
  |  |  134|  24.2k|    *((c)++) = (unsigned char)(((l) >> 16) & 0xff),                     \
  |  |  135|  24.2k|    *((c)++) = (unsigned char)(((l) >> 8) & 0xff),                      \
  |  |  136|  24.2k|    *((c)++) = (unsigned char)(((l)) & 0xff),                           \
  |  |  137|  24.2k|    l)
  ------------------
  239|       |#elif defined(DATA_ORDER_IS_LITTLE_ENDIAN)
  240|       |    (void)HOST_l2c(c->Nl, p);
  241|       |    (void)HOST_l2c(c->Nh, p);
  242|       |#endif
  243|  24.2k|    p -= HASH_CBLOCK;
  ------------------
  |  |   78|  24.2k|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  24.2k|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  24.2k|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  244|  24.2k|    HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |  125|  24.2k|#define HASH_BLOCK_DATA_ORDER sha256_block_data_order
  ------------------
  245|  24.2k|    c->num = 0;
  246|  24.2k|    OPENSSL_cleanse(p, HASH_CBLOCK);
  ------------------
  |  |   78|  24.2k|#define HASH_CBLOCK SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  24.2k|#define SHA_CBLOCK (SHA_LBLOCK * 4) /* SHA treats input data as a      \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  24.2k|#define SHA_LBLOCK 16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  247|       |
  248|       |#ifndef HASH_MAKE_STRING
  249|       |#error "HASH_MAKE_STRING must be defined!"
  250|       |#else
  251|  24.2k|    HASH_MAKE_STRING(c, md);
  ------------------
  |  |   89|  24.2k|    do {                                                            \
  |  |   90|  24.2k|        unsigned long ll;                                           \
  |  |   91|  24.2k|        unsigned int nn;                                            \
  |  |   92|  24.2k|        switch ((c)->md_len) {                                      \
  |  |   93|      0|        case SHA256_192_DIGEST_LENGTH:                              \
  |  |  ------------------
  |  |  |  |   84|      0|#define SHA256_192_DIGEST_LENGTH 24
  |  |  ------------------
  |  |  |  Branch (93:9): [True: 0, False: 24.2k]
  |  |  ------------------
  |  |   94|      0|            for (nn = 0; nn < SHA256_192_DIGEST_LENGTH / 4; nn++) { \
  |  |  ------------------
  |  |  |  |   84|      0|#define SHA256_192_DIGEST_LENGTH 24
  |  |  ------------------
  |  |  |  Branch (94:26): [True: 0, False: 0]
  |  |  ------------------
  |  |   95|      0|                ll = (c)->h[nn];                                    \
  |  |   96|      0|                (void)HOST_l2c(ll, (s));                            \
  |  |  ------------------
  |  |  |  |  133|      0|#define HOST_l2c(l, c) (*((c)++) = (unsigned char)(((l) >> 24) & 0xff), \
  |  |  |  |  134|      0|    *((c)++) = (unsigned char)(((l) >> 16) & 0xff),                     \
  |  |  |  |  135|      0|    *((c)++) = (unsigned char)(((l) >> 8) & 0xff),                      \
  |  |  |  |  136|      0|    *((c)++) = (unsigned char)(((l)) & 0xff),                           \
  |  |  |  |  137|      0|    l)
  |  |  ------------------
  |  |   97|      0|            }                                                       \
  |  |   98|      0|            break;                                                  \
  |  |   99|      0|        case SHA224_DIGEST_LENGTH:                                  \
  |  |  ------------------
  |  |  |  |   85|      0|#define SHA224_DIGEST_LENGTH 28
  |  |  ------------------
  |  |  |  Branch (99:9): [True: 0, False: 24.2k]
  |  |  ------------------
  |  |  100|      0|            for (nn = 0; nn < SHA224_DIGEST_LENGTH / 4; nn++) {     \
  |  |  ------------------
  |  |  |  |   85|      0|#define SHA224_DIGEST_LENGTH 28
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  101|      0|                ll = (c)->h[nn];                                    \
  |  |  102|      0|                (void)HOST_l2c(ll, (s));                            \
  |  |  ------------------
  |  |  |  |  133|      0|#define HOST_l2c(l, c) (*((c)++) = (unsigned char)(((l) >> 24) & 0xff), \
  |  |  |  |  134|      0|    *((c)++) = (unsigned char)(((l) >> 16) & 0xff),                     \
  |  |  |  |  135|      0|    *((c)++) = (unsigned char)(((l) >> 8) & 0xff),                      \
  |  |  |  |  136|      0|    *((c)++) = (unsigned char)(((l)) & 0xff),                           \
  |  |  |  |  137|      0|    l)
  |  |  ------------------
  |  |  103|      0|            }                                                       \
  |  |  104|      0|            break;                                                  \
  |  |  105|  24.2k|        case SHA256_DIGEST_LENGTH:                                  \
  |  |  ------------------
  |  |  |  |   86|  24.2k|#define SHA256_DIGEST_LENGTH 32
  |  |  ------------------
  |  |  |  Branch (105:9): [True: 24.2k, False: 0]
  |  |  ------------------
  |  |  106|   218k|            for (nn = 0; nn < SHA256_DIGEST_LENGTH / 4; nn++) {     \
  |  |  ------------------
  |  |  |  |   86|   218k|#define SHA256_DIGEST_LENGTH 32
  |  |  ------------------
  |  |  |  Branch (106:26): [True: 193k, False: 24.2k]
  |  |  ------------------
  |  |  107|   193k|                ll = (c)->h[nn];                                    \
  |  |  108|   193k|                (void)HOST_l2c(ll, (s));                            \
  |  |  ------------------
  |  |  |  |  133|   193k|#define HOST_l2c(l, c) (*((c)++) = (unsigned char)(((l) >> 24) & 0xff), \
  |  |  |  |  134|   193k|    *((c)++) = (unsigned char)(((l) >> 16) & 0xff),                     \
  |  |  |  |  135|   193k|    *((c)++) = (unsigned char)(((l) >> 8) & 0xff),                      \
  |  |  |  |  136|   193k|    *((c)++) = (unsigned char)(((l)) & 0xff),                           \
  |  |  |  |  137|   193k|    l)
  |  |  ------------------
  |  |  109|   193k|            }                                                       \
  |  |  110|  24.2k|            break;                                                  \
  |  |  111|      0|        default:                                                    \
  |  |  ------------------
  |  |  |  Branch (111:9): [True: 0, False: 24.2k]
  |  |  ------------------
  |  |  112|      0|            if ((c)->md_len > SHA256_DIGEST_LENGTH)                 \
  |  |  ------------------
  |  |  |  |   86|      0|#define SHA256_DIGEST_LENGTH 32
  |  |  ------------------
  |  |  |  Branch (112:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  113|      0|                return 0;                                           \
  |  |  114|      0|            for (nn = 0; nn < (c)->md_len / 4; nn++) {              \
  |  |  ------------------
  |  |  |  Branch (114:26): [True: 0, False: 0]
  |  |  ------------------
  |  |  115|      0|                ll = (c)->h[nn];                                    \
  |  |  116|      0|                (void)HOST_l2c(ll, (s));                            \
  |  |  ------------------
  |  |  |  |  133|      0|#define HOST_l2c(l, c) (*((c)++) = (unsigned char)(((l) >> 24) & 0xff), \
  |  |  |  |  134|      0|    *((c)++) = (unsigned char)(((l) >> 16) & 0xff),                     \
  |  |  |  |  135|      0|    *((c)++) = (unsigned char)(((l) >> 8) & 0xff),                      \
  |  |  |  |  136|      0|    *((c)++) = (unsigned char)(((l)) & 0xff),                           \
  |  |  |  |  137|      0|    l)
  |  |  ------------------
  |  |  117|      0|            }                                                       \
  |  |  118|      0|            break;                                                  \
  |  |  119|  24.2k|        }                                                           \
  |  |  120|  24.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (120:14): [Folded, False: 24.2k]
  |  |  ------------------
  ------------------
  252|  24.2k|#endif
  253|       |
  254|  24.2k|    return 1;
  255|  24.2k|}

threads_common.c:ossl_sa_CTX_TABLE_ENTRY_get:
   60|  20.0M|    {                                                                                                              \
   61|  20.0M|        return (type *)ossl_sa_get((OPENSSL_SA *)sa, n);                                                           \
   62|  20.0M|    }                                                                                                              \
threads_common.c:ossl_sa_CTX_TABLE_ENTRY_new:
   26|      3|    {                                                                                                              \
   27|      3|        return (SPARSE_ARRAY_OF(type) *)ossl_sa_new();                                                             \
   28|      3|    }                                                                                                              \
threads_common.c:ossl_sa_CTX_TABLE_ENTRY_set:
   66|  2.20k|    {                                                                                                              \
   67|  2.20k|        return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val);                                                      \
   68|  2.20k|    }                                                                                                              \
threads_common.c:ossl_sa_CTX_TABLE_ENTRY_free:
   31|      3|    {                                                                                                              \
   32|      3|        ossl_sa_free((OPENSSL_SA *)sa);                                                                            \
   33|      3|    }                                                                                                              \
property.c:ossl_sa_ALGORITHM_new:
   26|  3.14k|    {                                                                                                              \
   27|  3.14k|        return (SPARSE_ARRAY_OF(type) *)ossl_sa_new();                                                             \
   28|  3.14k|    }                                                                                                              \
property.c:ossl_sa_ALGORITHM_doall_arg:
   55|  5.75k|    {                                                                                                              \
   56|  5.75k|        ossl_sa_doall_arg((OPENSSL_SA *)sa,                                                                        \
   57|  5.75k|            (void (*)(ossl_uintmax_t, void *, void *))leaf, arg);                                                  \
   58|  5.75k|    }                                                                                                              \
property.c:ossl_sa_ALGORITHM_set:
   66|   337k|    {                                                                                                              \
   67|   337k|        return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val);                                                      \
   68|   337k|    }                                                                                                              \
property.c:ossl_sa_ALGORITHM_free:
   31|  3.14k|    {                                                                                                              \
   32|  3.14k|        ossl_sa_free((OPENSSL_SA *)sa);                                                                            \
   33|  3.14k|    }                                                                                                              \
property.c:ossl_sa_ALGORITHM_get:
   60|  1.09M|    {                                                                                                              \
   61|  1.09M|        return (type *)ossl_sa_get((OPENSSL_SA *)sa, n);                                                           \
   62|  1.09M|    }                                                                                                              \
property.c:ossl_sa_ALGORITHM_num:
   41|      6|    {                                                                                                              \
   42|      6|        return ossl_sa_num((OPENSSL_SA *)sa);                                                                      \
   43|      6|    }                                                                                                              \
property.c:ossl_sa_ALGORITHM_doall:
   47|  2.59k|    {                                                                                                              \
   48|  2.59k|        ossl_sa_doall((OPENSSL_SA *)sa,                                                                            \
   49|  2.59k|            (void (*)(ossl_uintmax_t, void *))leaf);                                                               \
   50|  2.59k|    }                                                                                                              \
rsa_ossl.c:ossl_sa_BN_BLINDING_doall_arg:
   55|   299k|    {                                                                                                              \
   56|   299k|        ossl_sa_doall_arg((OPENSSL_SA *)sa,                                                                        \
   57|   299k|            (void (*)(ossl_uintmax_t, void *, void *))leaf, arg);                                                  \
   58|   299k|    }                                                                                                              \
rsa_ossl.c:ossl_sa_BN_BLINDING_free:
   31|   299k|    {                                                                                                              \
   32|   299k|        ossl_sa_free((OPENSSL_SA *)sa);                                                                            \
   33|   299k|    }                                                                                                              \
rsa_ossl.c:ossl_sa_BN_BLINDING_new:
   26|   299k|    {                                                                                                              \
   27|   299k|        return (SPARSE_ARRAY_OF(type) *)ossl_sa_new();                                                             \
   28|   299k|    }                                                                                                              \

s3_lib.c:ossl_assert_int:
   45|  3.53k|{
   46|  3.53k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 3.53k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  3.53k|    return expr;
   50|  3.53k|}
ssl_cert.c:ossl_assert_int:
   45|  2.56k|{
   46|  2.56k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 2.56k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  2.56k|    return expr;
   50|  2.56k|}
ssl_ciph.c:ossl_assert_int:
   45|  17.3k|{
   46|  17.3k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 17.3k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  17.3k|    return expr;
   50|  17.3k|}
ssl_lib.c:ossl_assert_int:
   45|  1.77k|{
   46|  1.77k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 1.77k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  1.77k|    return expr;
   50|  1.77k|}
rec_layer_s3.c:ossl_assert_int:
   45|  10.7k|{
   46|  10.7k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 10.7k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  10.7k|    return expr;
   50|  10.7k|}
tls_common.c:ossl_assert_int:
   45|  10.3k|{
   46|  10.3k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 10.3k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  10.3k|    return expr;
   50|  10.3k|}
extensions_clnt.c:ossl_assert_int:
   45|      4|{
   46|      4|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 4]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|      4|    return expr;
   50|      4|}
statem.c:ossl_assert_int:
   45|    273|{
   46|    273|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 273]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    273|    return expr;
   50|    273|}
bio_print.c:ossl_assert_int:
   45|  32.3M|{
   46|  32.3M|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 32.3M]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  32.3M|    return expr;
   50|  32.3M|}
decoder_lib.c:ossl_assert_int:
   45|  2.06M|{
   46|  2.06M|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 2.06M]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  2.06M|    return expr;
   50|  2.06M|}
decoder_meth.c:ossl_assert_int:
   45|  4.31M|{
   46|  4.31M|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 4.31M]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  4.31M|    return expr;
   50|  4.31M|}
digest.c:ossl_assert_int:
   45|  21.2k|{
   46|  21.2k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 21.2k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  21.2k|    return expr;
   50|  21.2k|}
evp_enc.c:ossl_assert_int:
   45|   125k|{
   46|   125k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 125k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   125k|    return expr;
   50|   125k|}
evp_fetch.c:ossl_assert_int:
   45|  2.56M|{
   46|  2.56M|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 2.56M]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  2.56M|    return expr;
   50|  2.56M|}
p_lib.c:ossl_assert_int:
   45|  6.12M|{
   46|  6.12M|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 6.12M]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  6.12M|    return expr;
   50|  6.12M|}
pmeth_lib.c:ossl_assert_int:
   45|  67.4k|{
   46|  67.4k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 67.4k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  67.4k|    return expr;
   50|  67.4k|}
core_algorithm.c:ossl_assert_int:
   45|  1.09k|{
   46|  1.09k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 1.09k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  1.09k|    return expr;
   50|  1.09k|}
core_fetch.c:ossl_assert_int:
   45|   126k|{
   46|   126k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 126k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   126k|    return expr;
   50|   126k|}
core_namemap.c:ossl_assert_int:
   45|   381k|{
   46|   381k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 381k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   381k|    return expr;
   50|   381k|}
packet.c:ossl_assert_int:
   45|  2.56M|{
   46|  2.56M|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 2.56M]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  2.56M|    return expr;
   50|  2.56M|}
provider_core.c:ossl_assert_int:
   45|   123k|{
   46|   123k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 123k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   123k|    return expr;
   50|   123k|}
threads_common.c:ossl_assert_int:
   45|  20.0M|{
   46|  20.0M|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 20.0M]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  20.0M|    return expr;
   50|  20.0M|}
threads_pthread.c:ossl_assert_int:
   45|  16.5M|{
   46|  16.5M|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 16.5M]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  16.5M|    return expr;
   50|  16.5M|}
defn_cache.c:ossl_assert_int:
   45|   339k|{
   46|   339k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 339k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   339k|    return expr;
   50|   339k|}
property.c:ossl_assert_int:
   45|   197k|{
   46|   197k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 197k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   197k|    return expr;
   50|   197k|}
x_pubkey.c:ossl_assert_int:
   45|   824k|{
   46|   824k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 824k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   824k|    return expr;
   50|   824k|}
dh_kmgmt.c:ossl_assert_int:
   45|     76|{
   46|     76|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 76]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|     76|    return expr;
   50|     76|}
drbg_ctr.c:ossl_assert_int:
   45|  7.13k|{
   46|  7.13k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 7.13k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  7.13k|    return expr;
   50|  7.13k|}
ml_kem.c:ossl_assert_int:
   45|  2.65k|{
   46|  2.65k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 2.65k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  2.65k|    return expr;
   50|  2.65k|}

bn_lib.c:constant_time_select_int:
  358|   985k|{
  359|   985k|    return (int)constant_time_select(mask, (unsigned)(a), (unsigned)(b));
  360|   985k|}
bn_lib.c:constant_time_select:
  338|   985k|{
  339|   985k|    return (value_barrier(mask) & a) | (value_barrier(~mask) & b);
  340|   985k|}
bn_lib.c:value_barrier:
  277|  1.97M|{
  278|  1.97M|#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
  279|  1.97M|    unsigned int r;
  280|  1.97M|    __asm__("" : "=r"(r) : "0"(a));
  281|       |#else
  282|       |    volatile unsigned int r = a;
  283|       |#endif
  284|  1.97M|    return r;
  285|  1.97M|}
bn_lib.c:constant_time_lt_bn:
  167|   985k|{
  168|   985k|    return constant_time_msb_bn(a ^ ((a ^ b) | ((a - b) ^ b)));
  169|   985k|}
bn_lib.c:constant_time_msb_bn:
  162|   985k|{
  163|   985k|    return 0 - (a >> (sizeof(a) * 8 - 1));
  164|   985k|}
bn_lib.c:constant_time_msb:
  103|  6.42k|{
  104|  6.42k|    return 0 - (a >> (sizeof(a) * 8 - 1));
  105|  6.42k|}
bn_lib.c:constant_time_eq_int:
  260|  6.42k|{
  261|  6.42k|    return constant_time_eq((unsigned)(a), (unsigned)(b));
  262|  6.42k|}
bn_lib.c:constant_time_eq:
  239|  6.42k|{
  240|  6.42k|    return constant_time_is_zero(a ^ b);
  241|  6.42k|}
bn_lib.c:constant_time_is_zero:
  213|  6.42k|{
  214|  6.42k|    return constant_time_msb(~a & (a - 1));
  215|  6.42k|}
bn_exp.c:constant_time_eq_int:
  260|   135k|{
  261|   135k|    return constant_time_eq((unsigned)(a), (unsigned)(b));
  262|   135k|}
bn_exp.c:constant_time_eq:
  239|   135k|{
  240|   135k|    return constant_time_is_zero(a ^ b);
  241|   135k|}
bn_exp.c:constant_time_is_zero:
  213|   135k|{
  214|   135k|    return constant_time_msb(~a & (a - 1));
  215|   135k|}
bn_exp.c:constant_time_msb:
  103|   135k|{
  104|   135k|    return 0 - (a >> (sizeof(a) * 8 - 1));
  105|   135k|}
curve448.c:constant_time_lookup:
  458|    270|{
  459|    270|    size_t i, j;
  460|    270|    const unsigned char *tablec = (const unsigned char *)table;
  461|    270|    unsigned char *outc = (unsigned char *)out;
  462|    270|    unsigned char mask;
  463|       |
  464|    270|    memset(out, 0, rowsize);
  465|       |
  466|       |    /* Note idx may underflow - but that is well defined */
  467|  4.59k|    for (i = 0; i < numrows; i++, idx--) {
  ------------------
  |  Branch (467:17): [True: 4.32k, False: 270]
  ------------------
  468|  4.32k|        mask = (unsigned char)constant_time_is_zero_s(idx);
  469|   833k|        for (j = 0; j < rowsize; j++)
  ------------------
  |  Branch (469:21): [True: 829k, False: 4.32k]
  ------------------
  470|   829k|            *(outc + j) |= constant_time_select_8(mask, *(tablec++), 0);
  471|  4.32k|    }
  472|    270|}
curve448.c:constant_time_is_zero_s:
  218|  4.32k|{
  219|  4.32k|    return constant_time_msb_s(~a & (a - 1));
  220|  4.32k|}
curve448.c:constant_time_msb_s:
  118|  4.32k|{
  119|  4.32k|    return 0 - (a >> (sizeof(a) * 8 - 1));
  120|  4.32k|}
curve448.c:constant_time_select_8:
  352|   829k|{
  353|   829k|    return (unsigned char)constant_time_select(mask, a, b);
  354|   829k|}
curve448.c:constant_time_select:
  338|   829k|{
  339|   829k|    return (value_barrier(mask) & a) | (value_barrier(~mask) & b);
  340|   829k|}
curve448.c:value_barrier:
  277|  1.65M|{
  278|  1.65M|#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
  279|  1.65M|    unsigned int r;
  280|  1.65M|    __asm__("" : "=r"(r) : "0"(a));
  281|       |#else
  282|       |    volatile unsigned int r = a;
  283|       |#endif
  284|  1.65M|    return r;
  285|  1.65M|}
curve448.c:constant_time_select_64:
  376|  2.16k|{
  377|  2.16k|    return (value_barrier_64(mask) & a) | (value_barrier_64(~mask) & b);
  378|  2.16k|}
curve448.c:value_barrier_64:
  301|  6.48k|{
  302|  6.48k|#if !defined(OPENSSL_NO_ASM) && defined(__GNUC__)
  303|  6.48k|    uint64_t r;
  304|  6.48k|    __asm__("" : "=r"(r) : "0"(a));
  305|       |#else
  306|       |    volatile uint64_t r = a;
  307|       |#endif
  308|  6.48k|    return r;
  309|  6.48k|}
curve448.c:constant_time_cond_swap_64:
  412|  2.16k|{
  413|  2.16k|    uint64_t xor = *a ^ *b;
  414|       |
  415|  2.16k|    xor&= value_barrier_64(mask);
  416|  2.16k|    *a ^= xor;
  417|  2.16k|    *b ^= xor;
  418|  2.16k|}
f_generic.c:constant_time_is_zero_64:
  233|      3|{
  234|      3|    return constant_time_msb_64(~a & (a - 1));
  235|      3|}
f_generic.c:constant_time_msb_64:
  113|      3|{
  114|      3|    return 0 - (a >> 63);
  115|      3|}

core_namemap.c:ossl_ht_strcase:
  264|  6.16M|{
  265|  6.16M|    int i;
  266|       |#if defined(CHARSET_EBCDIC) && !defined(CHARSET_EBCDIC_TEST)
  267|       |    const long int case_adjust = ~0x40;
  268|       |#else
  269|  6.16M|    const long int case_adjust = ~0x20;
  270|  6.16M|#endif
  271|       |
  272|  6.16M|    if (src == NULL)
  ------------------
  |  Branch (272:9): [True: 0, False: 6.16M]
  ------------------
  273|      0|        return;
  274|       |
  275|  61.6M|    for (i = 0; src[i] != '\0' && i < len; i++)
  ------------------
  |  Branch (275:17): [True: 55.5M, False: 6.04M]
  |  Branch (275:35): [True: 55.4M, False: 117k]
  ------------------
  276|  55.4M|        tgt[i] = case_adjust & src[i];
  277|  6.16M|}

array_alloc.c:ossl_size_mul:
   79|  21.1M|{
   80|  21.1M|    int err = 0;
   81|  21.1M|    *bytes = safe_mul_size_t(num, size, &err);
   82|       |
   83|  21.1M|    if (ossl_unlikely(err != 0)) {
  ------------------
  |  |   23|  21.1M|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 21.1M]
  |  |  ------------------
  ------------------
   84|      0|        ossl_report_alloc_err_of(file, line);
   85|       |
   86|      0|        return false;
   87|      0|    }
   88|       |
   89|  21.1M|    return true;
   90|  21.1M|}

rec_layer_s3.c:PACKET_buf_init:
   72|     59|{
   73|       |    /* Sanity check for negative values. */
   74|     59|    if (len > (size_t)(SIZE_MAX / 2))
  ------------------
  |  Branch (74:9): [True: 0, False: 59]
  ------------------
   75|      0|        return 0;
   76|       |
   77|     59|    pkt->curr = buf;
   78|     59|    pkt->remaining = len;
   79|     59|    return 1;
   80|     59|}
rec_layer_s3.c:PACKET_get_1:
  320|    117|{
  321|    117|    if (!PACKET_peek_1(pkt, data))
  ------------------
  |  Branch (321:9): [True: 3, False: 114]
  ------------------
  322|      3|        return 0;
  323|       |
  324|    114|    packet_forward(pkt, 1);
  325|       |
  326|    114|    return 1;
  327|    117|}
rec_layer_s3.c:PACKET_peek_1:
  309|    117|{
  310|    117|    if (!PACKET_remaining(pkt))
  ------------------
  |  Branch (310:9): [True: 3, False: 114]
  ------------------
  311|      3|        return 0;
  312|       |
  313|    114|    *data = *pkt->curr;
  314|       |
  315|    114|    return 1;
  316|    117|}
rec_layer_s3.c:packet_forward:
   31|    114|{
   32|    114|    pkt->curr += len;
   33|    114|    pkt->remaining -= len;
   34|    114|}
rec_layer_s3.c:PACKET_remaining:
   40|    173|{
   41|    173|    return pkt->remaining;
   42|    173|}
tls_common.c:PACKET_buf_init:
   72|    478|{
   73|       |    /* Sanity check for negative values. */
   74|    478|    if (len > (size_t)(SIZE_MAX / 2))
  ------------------
  |  Branch (74:9): [True: 0, False: 478]
  ------------------
   75|      0|        return 0;
   76|       |
   77|    478|    pkt->curr = buf;
   78|    478|    pkt->remaining = len;
   79|    478|    return 1;
   80|    478|}
tls_common.c:PACKET_get_net_2_len:
  162|    956|{
  163|    956|    unsigned int i;
  164|    956|    int ret = PACKET_get_net_2(pkt, &i);
  165|       |
  166|    956|    if (ret)
  ------------------
  |  Branch (166:9): [True: 956, False: 0]
  ------------------
  167|    956|        *data = (size_t)i;
  168|       |
  169|    956|    return ret;
  170|    956|}
tls_common.c:PACKET_get_1:
  320|    956|{
  321|    956|    if (!PACKET_peek_1(pkt, data))
  ------------------
  |  Branch (321:9): [True: 0, False: 956]
  ------------------
  322|      0|        return 0;
  323|       |
  324|    956|    packet_forward(pkt, 1);
  325|       |
  326|    956|    return 1;
  327|    956|}
tls_common.c:PACKET_peek_1:
  309|    956|{
  310|    956|    if (!PACKET_remaining(pkt))
  ------------------
  |  Branch (310:9): [True: 0, False: 956]
  ------------------
  311|      0|        return 0;
  312|       |
  313|    956|    *data = *pkt->curr;
  314|       |
  315|    956|    return 1;
  316|    956|}
tls_common.c:PACKET_remaining:
   40|  2.39k|{
   41|  2.39k|    return pkt->remaining;
   42|  2.39k|}
tls_common.c:packet_forward:
   31|  2.39k|{
   32|  2.39k|    pkt->curr += len;
   33|  2.39k|    pkt->remaining -= len;
   34|  2.39k|}
tls_common.c:PACKET_get_net_2:
  151|  1.43k|{
  152|  1.43k|    if (!PACKET_peek_net_2(pkt, data))
  ------------------
  |  Branch (152:9): [True: 0, False: 1.43k]
  ------------------
  153|      0|        return 0;
  154|       |
  155|  1.43k|    packet_forward(pkt, 2);
  156|       |
  157|  1.43k|    return 1;
  158|  1.43k|}
tls_common.c:PACKET_peek_net_2:
  138|  1.43k|{
  139|  1.43k|    if (PACKET_remaining(pkt) < 2)
  ------------------
  |  Branch (139:9): [True: 0, False: 1.43k]
  ------------------
  140|      0|        return 0;
  141|       |
  142|  1.43k|    *data = ((unsigned int)(*pkt->curr)) << 8;
  143|  1.43k|    *data |= *(pkt->curr + 1);
  144|       |
  145|  1.43k|    return 1;
  146|  1.43k|}
extensions.c:PACKET_remaining:
   40|  1.56k|{
   41|  1.56k|    return pkt->remaining;
   42|  1.56k|}
extensions.c:PACKET_get_net_2:
  151|    741|{
  152|    741|    if (!PACKET_peek_net_2(pkt, data))
  ------------------
  |  Branch (152:9): [True: 2, False: 739]
  ------------------
  153|      2|        return 0;
  154|       |
  155|    739|    packet_forward(pkt, 2);
  156|       |
  157|    739|    return 1;
  158|    741|}
extensions.c:PACKET_peek_net_2:
  138|    741|{
  139|    741|    if (PACKET_remaining(pkt) < 2)
  ------------------
  |  Branch (139:9): [True: 2, False: 739]
  ------------------
  140|      2|        return 0;
  141|       |
  142|    739|    *data = ((unsigned int)(*pkt->curr)) << 8;
  143|    739|    *data |= *(pkt->curr + 1);
  144|       |
  145|    739|    return 1;
  146|    741|}
extensions.c:packet_forward:
   31|  1.09k|{
   32|  1.09k|    pkt->curr += len;
   33|  1.09k|    pkt->remaining -= len;
   34|  1.09k|}
extensions.c:PACKET_get_length_prefixed_2:
  579|    370|{
  580|    370|    unsigned int length;
  581|    370|    const unsigned char *data;
  582|    370|    PACKET tmp = *pkt;
  583|       |
  584|    370|    if (!PACKET_get_net_2(&tmp, &length) || !PACKET_get_bytes(&tmp, &data, (size_t)length)) {
  ------------------
  |  Branch (584:9): [True: 1, False: 369]
  |  Branch (584:45): [True: 16, False: 353]
  ------------------
  585|     17|        return 0;
  586|     17|    }
  587|       |
  588|    353|    *pkt = tmp;
  589|    353|    subpkt->curr = data;
  590|    353|    subpkt->remaining = length;
  591|       |
  592|    353|    return 1;
  593|    370|}
extensions.c:PACKET_get_bytes:
  401|    369|{
  402|    369|    if (!PACKET_peek_bytes(pkt, data, len))
  ------------------
  |  Branch (402:9): [True: 16, False: 353]
  ------------------
  403|     16|        return 0;
  404|       |
  405|    353|    packet_forward(pkt, len);
  406|       |
  407|    353|    return 1;
  408|    369|}
extensions.c:PACKET_peek_bytes:
  383|    369|{
  384|    369|    if (PACKET_remaining(pkt) < len)
  ------------------
  |  Branch (384:9): [True: 16, False: 353]
  ------------------
  385|     16|        return 0;
  386|       |
  387|    353|    *data = pkt->curr;
  388|       |
  389|    353|    return 1;
  390|    369|}
extensions.c:PACKET_data:
   60|      5|{
   61|      5|    return pkt->curr;
   62|      5|}
extensions_clnt.c:PACKET_buf_init:
   72|      2|{
   73|       |    /* Sanity check for negative values. */
   74|      2|    if (len > (size_t)(SIZE_MAX / 2))
  ------------------
  |  Branch (74:9): [True: 0, False: 2]
  ------------------
   75|      0|        return 0;
   76|       |
   77|      2|    pkt->curr = buf;
   78|      2|    pkt->remaining = len;
   79|      2|    return 1;
   80|      2|}
extensions_clnt.c:PACKET_get_length_prefixed_1:
  534|      5|{
  535|      5|    unsigned int length;
  536|      5|    const unsigned char *data;
  537|      5|    PACKET tmp = *pkt;
  538|      5|    if (!PACKET_get_1(&tmp, &length) || !PACKET_get_bytes(&tmp, &data, (size_t)length)) {
  ------------------
  |  Branch (538:9): [True: 2, False: 3]
  |  Branch (538:41): [True: 0, False: 3]
  ------------------
  539|      2|        return 0;
  540|      2|    }
  541|       |
  542|      3|    *pkt = tmp;
  543|      3|    subpkt->curr = data;
  544|      3|    subpkt->remaining = length;
  545|       |
  546|      3|    return 1;
  547|      5|}
extensions_clnt.c:PACKET_get_1_len:
  331|      5|{
  332|      5|    unsigned int i;
  333|      5|    int ret = PACKET_get_1(pkt, &i);
  334|       |
  335|      5|    if (ret)
  ------------------
  |  Branch (335:9): [True: 4, False: 1]
  ------------------
  336|      4|        *data = (size_t)i;
  337|       |
  338|      5|    return ret;
  339|      5|}
extensions_clnt.c:PACKET_remaining:
   40|     47|{
   41|     47|    return pkt->remaining;
   42|     47|}
extensions_clnt.c:PACKET_get_bytes:
  401|      6|{
  402|      6|    if (!PACKET_peek_bytes(pkt, data, len))
  ------------------
  |  Branch (402:9): [True: 1, False: 5]
  ------------------
  403|      1|        return 0;
  404|       |
  405|      5|    packet_forward(pkt, len);
  406|       |
  407|      5|    return 1;
  408|      6|}
extensions_clnt.c:PACKET_peek_bytes:
  383|      6|{
  384|      6|    if (PACKET_remaining(pkt) < len)
  ------------------
  |  Branch (384:9): [True: 1, False: 5]
  ------------------
  385|      1|        return 0;
  386|       |
  387|      5|    *data = pkt->curr;
  388|       |
  389|      5|    return 1;
  390|      6|}
extensions_clnt.c:packet_forward:
   31|     23|{
   32|     23|    pkt->curr += len;
   33|     23|    pkt->remaining -= len;
   34|     23|}
extensions_clnt.c:PACKET_get_1:
  320|     14|{
  321|     14|    if (!PACKET_peek_1(pkt, data))
  ------------------
  |  Branch (321:9): [True: 4, False: 10]
  ------------------
  322|      4|        return 0;
  323|       |
  324|     10|    packet_forward(pkt, 1);
  325|       |
  326|     10|    return 1;
  327|     14|}
extensions_clnt.c:PACKET_peek_1:
  309|     14|{
  310|     14|    if (!PACKET_remaining(pkt))
  ------------------
  |  Branch (310:9): [True: 4, False: 10]
  ------------------
  311|      4|        return 0;
  312|       |
  313|     10|    *data = *pkt->curr;
  314|       |
  315|     10|    return 1;
  316|     14|}
extensions_clnt.c:PACKET_as_length_prefixed_1:
  555|      4|{
  556|      4|    unsigned int length;
  557|      4|    const unsigned char *data;
  558|      4|    PACKET tmp = *pkt;
  559|      4|    if (!PACKET_get_1(&tmp, &length) || !PACKET_get_bytes(&tmp, &data, (size_t)length) || PACKET_remaining(&tmp) != 0) {
  ------------------
  |  Branch (559:9): [True: 1, False: 3]
  |  Branch (559:41): [True: 1, False: 2]
  |  Branch (559:91): [True: 1, False: 1]
  ------------------
  560|      3|        return 0;
  561|      3|    }
  562|       |
  563|      1|    *pkt = tmp;
  564|      1|    subpkt->curr = data;
  565|      1|    subpkt->remaining = length;
  566|       |
  567|      1|    return 1;
  568|      4|}
extensions_clnt.c:PACKET_copy_bytes:
  429|      1|{
  430|      1|    if (!PACKET_peek_copy_bytes(pkt, data, len))
  ------------------
  |  Branch (430:9): [True: 0, False: 1]
  ------------------
  431|      0|        return 0;
  432|       |
  433|      1|    packet_forward(pkt, len);
  434|       |
  435|      1|    return 1;
  436|      1|}
extensions_clnt.c:PACKET_peek_copy_bytes:
  414|      1|{
  415|      1|    if (PACKET_remaining(pkt) < len)
  ------------------
  |  Branch (415:9): [True: 0, False: 1]
  ------------------
  416|      0|        return 0;
  417|       |
  418|      1|    memcpy(data, pkt->curr, len);
  419|       |
  420|      1|    return 1;
  421|      1|}
extensions_clnt.c:PACKET_get_net_2_len:
  162|      5|{
  163|      5|    unsigned int i;
  164|      5|    int ret = PACKET_get_net_2(pkt, &i);
  165|       |
  166|      5|    if (ret)
  ------------------
  |  Branch (166:9): [True: 4, False: 1]
  ------------------
  167|      4|        *data = (size_t)i;
  168|       |
  169|      5|    return ret;
  170|      5|}
extensions_clnt.c:PACKET_get_net_2:
  151|      9|{
  152|      9|    if (!PACKET_peek_net_2(pkt, data))
  ------------------
  |  Branch (152:9): [True: 2, False: 7]
  ------------------
  153|      2|        return 0;
  154|       |
  155|      7|    packet_forward(pkt, 2);
  156|       |
  157|      7|    return 1;
  158|      9|}
extensions_clnt.c:PACKET_peek_net_2:
  138|      9|{
  139|      9|    if (PACKET_remaining(pkt) < 2)
  ------------------
  |  Branch (139:9): [True: 2, False: 7]
  ------------------
  140|      2|        return 0;
  141|       |
  142|      7|    *data = ((unsigned int)(*pkt->curr)) << 8;
  143|      7|    *data |= *(pkt->curr + 1);
  144|       |
  145|      7|    return 1;
  146|      9|}
statem.c:PACKET_buf_init:
   72|    150|{
   73|       |    /* Sanity check for negative values. */
   74|    150|    if (len > (size_t)(SIZE_MAX / 2))
  ------------------
  |  Branch (74:9): [True: 0, False: 150]
  ------------------
   75|      0|        return 0;
   76|       |
   77|    150|    pkt->curr = buf;
   78|    150|    pkt->remaining = len;
   79|    150|    return 1;
   80|    150|}
statem_clnt.c:PACKET_forward:
  516|      3|{
  517|      3|    if (PACKET_remaining(pkt) < len)
  ------------------
  |  Branch (517:9): [True: 0, False: 3]
  ------------------
  518|      0|        return 0;
  519|       |
  520|      3|    packet_forward(pkt, len);
  521|       |
  522|      3|    return 1;
  523|      3|}
statem_clnt.c:packet_forward:
   31|  1.04k|{
   32|  1.04k|    pkt->curr += len;
   33|  1.04k|    pkt->remaining -= len;
   34|  1.04k|}
statem_clnt.c:PACKET_get_length_prefixed_1:
  534|    147|{
  535|    147|    unsigned int length;
  536|    147|    const unsigned char *data;
  537|    147|    PACKET tmp = *pkt;
  538|    147|    if (!PACKET_get_1(&tmp, &length) || !PACKET_get_bytes(&tmp, &data, (size_t)length)) {
  ------------------
  |  Branch (538:9): [True: 1, False: 146]
  |  Branch (538:41): [True: 8, False: 138]
  ------------------
  539|      9|        return 0;
  540|      9|    }
  541|       |
  542|    138|    *pkt = tmp;
  543|    138|    subpkt->curr = data;
  544|    138|    subpkt->remaining = length;
  545|       |
  546|    138|    return 1;
  547|    147|}
statem_clnt.c:PACKET_remaining:
   40|  1.61k|{
   41|  1.61k|    return pkt->remaining;
   42|  1.61k|}
statem_clnt.c:PACKET_copy_bytes:
  429|    146|{
  430|    146|    if (!PACKET_peek_copy_bytes(pkt, data, len))
  ------------------
  |  Branch (430:9): [True: 2, False: 144]
  ------------------
  431|      2|        return 0;
  432|       |
  433|    144|    packet_forward(pkt, len);
  434|       |
  435|    144|    return 1;
  436|    146|}
statem_clnt.c:PACKET_peek_copy_bytes:
  414|    146|{
  415|    146|    if (PACKET_remaining(pkt) < len)
  ------------------
  |  Branch (415:9): [True: 2, False: 144]
  ------------------
  416|      2|        return 0;
  417|       |
  418|    144|    memcpy(data, pkt->curr, len);
  419|       |
  420|    144|    return 1;
  421|    146|}
statem_clnt.c:PACKET_get_net_2:
  151|    257|{
  152|    257|    if (!PACKET_peek_net_2(pkt, data))
  ------------------
  |  Branch (152:9): [True: 3, False: 254]
  ------------------
  153|      3|        return 0;
  154|       |
  155|    254|    packet_forward(pkt, 2);
  156|       |
  157|    254|    return 1;
  158|    257|}
statem_clnt.c:PACKET_peek_net_2:
  138|    257|{
  139|    257|    if (PACKET_remaining(pkt) < 2)
  ------------------
  |  Branch (139:9): [True: 3, False: 254]
  ------------------
  140|      3|        return 0;
  141|       |
  142|    254|    *data = ((unsigned int)(*pkt->curr)) << 8;
  143|    254|    *data |= *(pkt->curr + 1);
  144|       |
  145|    254|    return 1;
  146|    257|}
statem_clnt.c:PACKET_data:
   60|    125|{
   61|    125|    return pkt->curr;
   62|    125|}
statem_clnt.c:PACKET_get_bytes:
  401|    387|{
  402|    387|    if (!PACKET_peek_bytes(pkt, data, len))
  ------------------
  |  Branch (402:9): [True: 22, False: 365]
  ------------------
  403|     22|        return 0;
  404|       |
  405|    365|    packet_forward(pkt, len);
  406|       |
  407|    365|    return 1;
  408|    387|}
statem_clnt.c:PACKET_peek_bytes:
  383|    387|{
  384|    387|    if (PACKET_remaining(pkt) < len)
  ------------------
  |  Branch (384:9): [True: 22, False: 365]
  ------------------
  385|     22|        return 0;
  386|       |
  387|    365|    *data = pkt->curr;
  388|       |
  389|    365|    return 1;
  390|    387|}
statem_clnt.c:PACKET_get_1:
  320|    282|{
  321|    282|    if (!PACKET_peek_1(pkt, data))
  ------------------
  |  Branch (321:9): [True: 2, False: 280]
  ------------------
  322|      2|        return 0;
  323|       |
  324|    280|    packet_forward(pkt, 1);
  325|       |
  326|    280|    return 1;
  327|    282|}
statem_clnt.c:PACKET_peek_1:
  309|    282|{
  310|    282|    if (!PACKET_remaining(pkt))
  ------------------
  |  Branch (310:9): [True: 2, False: 280]
  ------------------
  311|      2|        return 0;
  312|       |
  313|    280|    *data = *pkt->curr;
  314|       |
  315|    280|    return 1;
  316|    282|}
statem_clnt.c:PACKET_null_init:
   84|     27|{
   85|       |    pkt->curr = NULL;
   86|     27|    pkt->remaining = 0;
   87|     27|}
statem_clnt.c:PACKET_as_length_prefixed_2:
  601|    107|{
  602|    107|    unsigned int length;
  603|    107|    const unsigned char *data;
  604|    107|    PACKET tmp = *pkt;
  605|       |
  606|    107|    if (!PACKET_get_net_2(&tmp, &length) || !PACKET_get_bytes(&tmp, &data, (size_t)length) || PACKET_remaining(&tmp) != 0) {
  ------------------
  |  Branch (606:9): [True: 2, False: 105]
  |  Branch (606:45): [True: 13, False: 92]
  |  Branch (606:95): [True: 2, False: 90]
  ------------------
  607|     17|        return 0;
  608|     17|    }
  609|       |
  610|     90|    *pkt = tmp;
  611|     90|    subpkt->curr = data;
  612|     90|    subpkt->remaining = length;
  613|       |
  614|     90|    return 1;
  615|    107|}

ssl_cert.c:CRYPTO_NEW_REF:
  280|  4.33k|{
  281|  4.33k|    refcnt->val = n;
  282|  4.33k|    return 1;
  283|  4.33k|}
ssl_cert.c:CRYPTO_DOWN_REF:
   56|  4.33k|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|  4.33k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  4.33k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 4.33k, False: 0]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|  4.33k|#endif
   68|  4.33k|    return 1;
   69|  4.33k|}
ssl_cert.c:CRYPTO_FREE_REF:
  286|  4.33k|{
  287|  4.33k|}
ssl_lib.c:CRYPTO_NEW_REF:
  280|  4.33k|{
  281|  4.33k|    refcnt->val = n;
  282|  4.33k|    return 1;
  283|  4.33k|}
ssl_lib.c:CRYPTO_FREE_REF:
  286|  4.33k|{
  287|  4.33k|}
ssl_lib.c:CRYPTO_UP_REF:
   40|  3.54k|{
   41|       |    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  3.54k|    return 1;
   43|  3.54k|}
ssl_lib.c:CRYPTO_DOWN_REF:
   56|  7.87k|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|  7.87k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  7.87k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 4.33k, False: 3.54k]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|  7.87k|#endif
   68|  7.87k|    return 1;
   69|  7.87k|}
ssl_sess.c:CRYPTO_NEW_REF:
  280|  1.76k|{
  281|  1.76k|    refcnt->val = n;
  282|  1.76k|    return 1;
  283|  1.76k|}
ssl_sess.c:CRYPTO_FREE_REF:
  286|  1.76k|{
  287|  1.76k|}
ssl_sess.c:CRYPTO_DOWN_REF:
   56|  1.76k|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|  1.76k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  1.76k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 1.76k, False: 0]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|  1.76k|#endif
   68|  1.76k|    return 1;
   69|  1.76k|}
tasn_utl.c:CRYPTO_NEW_REF:
  280|   412k|{
  281|   412k|    refcnt->val = n;
  282|   412k|    return 1;
  283|   412k|}
tasn_utl.c:CRYPTO_FREE_REF:
  286|   412k|{
  287|   412k|}
tasn_utl.c:CRYPTO_DOWN_REF:
   56|   824k|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|   824k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|   824k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 412k, False: 412k]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|   824k|#endif
   68|   824k|    return 1;
   69|   824k|}
bio_lib.c:CRYPTO_NEW_REF:
  280|  2.50M|{
  281|  2.50M|    refcnt->val = n;
  282|  2.50M|    return 1;
  283|  2.50M|}
bio_lib.c:CRYPTO_FREE_REF:
  286|  2.50M|{
  287|  2.50M|}
bio_lib.c:CRYPTO_DOWN_REF:
   56|  3.34M|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|  3.34M|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  3.34M|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 2.50M, False: 842k]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|  3.34M|#endif
   68|  3.34M|    return 1;
   69|  3.34M|}
bio_lib.c:CRYPTO_UP_REF:
   40|   842k|{
   41|       |    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|   842k|    return 1;
   43|   842k|}
bio_lib.c:CRYPTO_GET_REF:
   72|  3.54k|{
   73|       |    *ret = atomic_load_explicit(&refcnt->val, memory_order_acquire);
   74|  3.54k|    return 1;
   75|  3.54k|}
dh_lib.c:CRYPTO_NEW_REF:
  280|     76|{
  281|     76|    refcnt->val = n;
  282|     76|    return 1;
  283|     76|}
dh_lib.c:CRYPTO_DOWN_REF:
   56|     76|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|     76|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|     76|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 76, False: 0]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|     76|#endif
   68|     76|    return 1;
   69|     76|}
dh_lib.c:CRYPTO_FREE_REF:
  286|     76|{
  287|     76|}
dso_lib.c:CRYPTO_NEW_REF:
  280|    952|{
  281|    952|    refcnt->val = n;
  282|    952|    return 1;
  283|    952|}
dso_lib.c:CRYPTO_DOWN_REF:
   56|    952|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|    952|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|    952|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 952, False: 0]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|    952|#endif
   68|    952|    return 1;
   69|    952|}
dso_lib.c:CRYPTO_FREE_REF:
  286|    952|{
  287|    952|}
ec_key.c:CRYPTO_DOWN_REF:
   56|   226k|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|   226k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|   226k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 113k, False: 112k]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|   226k|#endif
   68|   226k|    return 1;
   69|   226k|}
ec_key.c:CRYPTO_FREE_REF:
  286|   113k|{
  287|   113k|}
ec_key.c:CRYPTO_UP_REF:
   40|   112k|{
   41|       |    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|   112k|    return 1;
   43|   112k|}
ec_kmeth.c:CRYPTO_NEW_REF:
  280|   113k|{
  281|   113k|    refcnt->val = n;
  282|   113k|    return 1;
  283|   113k|}
decoder_meth.c:CRYPTO_UP_REF:
   40|  2.36M|{
   41|       |    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  2.36M|    return 1;
   43|  2.36M|}
decoder_meth.c:CRYPTO_DOWN_REF:
   56|  2.36M|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|  2.36M|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  2.36M|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 76, False: 2.36M]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|  2.36M|#endif
   68|  2.36M|    return 1;
   69|  2.36M|}
decoder_meth.c:CRYPTO_FREE_REF:
  286|     76|{
  287|     76|}
decoder_meth.c:CRYPTO_NEW_REF:
  280|     76|{
  281|     76|    refcnt->val = n;
  282|     76|    return 1;
  283|     76|}
eng_init.c:CRYPTO_UP_REF:
   40|      5|{
   41|       |    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|      5|    return 1;
   43|      5|}
eng_lib.c:CRYPTO_NEW_REF:
  280|    823|{
  281|    823|    refcnt->val = n;
  282|    823|    return 1;
  283|    823|}
eng_lib.c:CRYPTO_FREE_REF:
  286|    823|{
  287|    823|}
eng_lib.c:CRYPTO_DOWN_REF:
   56|    838|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|    838|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|    838|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 823, False: 15]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|    838|#endif
   68|    838|    return 1;
   69|    838|}
eng_list.c:CRYPTO_UP_REF:
   40|     10|{
   41|       |    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|     10|    return 1;
   43|     10|}
digest.c:CRYPTO_NEW_REF:
  280|  17.0k|{
  281|  17.0k|    refcnt->val = n;
  282|  17.0k|    return 1;
  283|  17.0k|}
digest.c:CRYPTO_UP_REF:
   40|   756k|{
   41|       |    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|   756k|    return 1;
   43|   756k|}
digest.c:CRYPTO_DOWN_REF:
   56|   773k|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|   773k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|   773k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 17.0k, False: 756k]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|   773k|#endif
   68|   773k|    return 1;
   69|   773k|}
evp_enc.c:CRYPTO_NEW_REF:
  280|  82.1k|{
  281|  82.1k|    refcnt->val = n;
  282|  82.1k|    return 1;
  283|  82.1k|}
evp_enc.c:CRYPTO_UP_REF:
   40|   132k|{
   41|       |    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|   132k|    return 1;
   43|   132k|}
evp_enc.c:CRYPTO_FREE_REF:
  286|  82.1k|{
  287|  82.1k|}
evp_enc.c:CRYPTO_DOWN_REF:
   56|   214k|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|   214k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|   214k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 82.1k, False: 132k]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|   214k|#endif
   68|   214k|    return 1;
   69|   214k|}
evp_lib.c:CRYPTO_FREE_REF:
  286|  17.0k|{
  287|  17.0k|}
exchange.c:CRYPTO_DOWN_REF:
   56|  14.9k|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|  14.9k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  14.9k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 4.42k, False: 10.4k]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|  14.9k|#endif
   68|  14.9k|    return 1;
   69|  14.9k|}
exchange.c:CRYPTO_FREE_REF:
  286|  4.42k|{
  287|  4.42k|}
exchange.c:CRYPTO_UP_REF:
   40|  10.4k|{
   41|       |    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  10.4k|    return 1;
   43|  10.4k|}
exchange.c:CRYPTO_NEW_REF:
  280|  4.42k|{
  281|  4.42k|    refcnt->val = n;
  282|  4.42k|    return 1;
  283|  4.42k|}
keymgmt_meth.c:CRYPTO_NEW_REF:
  280|  25.2k|{
  281|  25.2k|    refcnt->val = n;
  282|  25.2k|    return 1;
  283|  25.2k|}
keymgmt_meth.c:CRYPTO_UP_REF:
   40|  1.61M|{
   41|       |    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  1.61M|    return 1;
   43|  1.61M|}
keymgmt_meth.c:CRYPTO_DOWN_REF:
   56|  1.64M|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|  1.64M|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  1.64M|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 25.2k, False: 1.61M]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|  1.64M|#endif
   68|  1.64M|    return 1;
   69|  1.64M|}
keymgmt_meth.c:CRYPTO_FREE_REF:
  286|  25.2k|{
  287|  25.2k|}
p_lib.c:CRYPTO_NEW_REF:
  280|   832k|{
  281|   832k|    refcnt->val = n;
  282|   832k|    return 1;
  283|   832k|}
p_lib.c:CRYPTO_FREE_REF:
  286|   832k|{
  287|   832k|}
p_lib.c:CRYPTO_UP_REF:
   40|   476k|{
   41|       |    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|   476k|    return 1;
   43|   476k|}
p_lib.c:CRYPTO_DOWN_REF:
   56|  1.30M|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|  1.30M|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  1.30M|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 832k, False: 476k]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|  1.30M|#endif
   68|  1.30M|    return 1;
   69|  1.30M|}
signature.c:CRYPTO_DOWN_REF:
   56|  80.6k|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|  80.6k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  80.6k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 37.2k, False: 43.3k]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|  80.6k|#endif
   68|  80.6k|    return 1;
   69|  80.6k|}
signature.c:CRYPTO_FREE_REF:
  286|  37.2k|{
  287|  37.2k|}
signature.c:CRYPTO_UP_REF:
   40|  43.3k|{
   41|       |    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  43.3k|    return 1;
   43|  43.3k|}
signature.c:CRYPTO_NEW_REF:
  280|  37.2k|{
  281|  37.2k|    refcnt->val = n;
  282|  37.2k|    return 1;
  283|  37.2k|}
provider_core.c:CRYPTO_UP_REF:
   40|   297k|{
   41|       |    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|   297k|    return 1;
   43|   297k|}
provider_core.c:CRYPTO_NEW_REF:
  280|  1.57k|{
  281|  1.57k|    refcnt->val = n;
  282|  1.57k|    return 1;
  283|  1.57k|}
provider_core.c:CRYPTO_DOWN_REF:
   56|   298k|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|   298k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|   298k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 1.57k, False: 297k]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|   298k|#endif
   68|   298k|    return 1;
   69|   298k|}
provider_core.c:CRYPTO_FREE_REF:
  286|  1.57k|{
  287|  1.57k|}
rsa_lib.c:CRYPTO_NEW_REF:
  280|   299k|{
  281|   299k|    refcnt->val = n;
  282|   299k|    return 1;
  283|   299k|}
rsa_lib.c:CRYPTO_DOWN_REF:
   56|   598k|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|   598k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|   598k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 299k, False: 299k]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|   598k|#endif
   68|   598k|    return 1;
   69|   598k|}
rsa_lib.c:CRYPTO_FREE_REF:
  286|   299k|{
  287|   299k|}
rsa_lib.c:CRYPTO_UP_REF:
   40|   299k|{
   41|       |    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|   299k|    return 1;
   43|   299k|}
x509_lu.c:CRYPTO_NEW_REF:
  280|  2.56k|{
  281|  2.56k|    refcnt->val = n;
  282|  2.56k|    return 1;
  283|  2.56k|}
x509_lu.c:CRYPTO_DOWN_REF:
   56|  2.56k|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|  2.56k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  2.56k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 2.56k, False: 0]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|  2.56k|#endif
   68|  2.56k|    return 1;
   69|  2.56k|}
x509_lu.c:CRYPTO_FREE_REF:
  286|  2.56k|{
  287|  2.56k|}
x509_set.c:CRYPTO_UP_REF:
   40|   412k|{
   41|       |    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|   412k|    return 1;
   43|   412k|}
ossl_core_bio.c:CRYPTO_UP_REF:
   40|   824k|{
   41|       |    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|   824k|    return 1;
   43|   824k|}
ossl_core_bio.c:CRYPTO_DOWN_REF:
   56|  1.64M|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|  1.64M|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  1.64M|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 824k, False: 824k]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|  1.64M|#endif
   68|  1.64M|    return 1;
   69|  1.64M|}
ossl_core_bio.c:CRYPTO_FREE_REF:
  286|   824k|{
  287|   824k|}
ossl_core_bio.c:CRYPTO_NEW_REF:
  280|   824k|{
  281|   824k|    refcnt->val = n;
  282|   824k|    return 1;
  283|   824k|}
ecx_key.c:CRYPTO_NEW_REF:
  280|  2.64k|{
  281|  2.64k|    refcnt->val = n;
  282|  2.64k|    return 1;
  283|  2.64k|}
ecx_key.c:CRYPTO_FREE_REF:
  286|  2.64k|{
  287|  2.64k|}
ecx_key.c:CRYPTO_DOWN_REF:
   56|  2.64k|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|  2.64k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  2.64k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 2.64k, False: 0]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|  2.64k|#endif
   68|  2.64k|    return 1;
   69|  2.64k|}
evp_rand.c:CRYPTO_UP_REF:
   40|  10.4k|{
   41|       |    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  10.4k|    return 1;
   43|  10.4k|}
evp_rand.c:CRYPTO_NEW_REF:
  280|  5.47k|{
  281|  5.47k|    refcnt->val = n;
  282|  5.47k|    return 1;
  283|  5.47k|}
evp_rand.c:CRYPTO_FREE_REF:
  286|  5.47k|{
  287|  5.47k|}
evp_rand.c:CRYPTO_DOWN_REF:
   56|  15.8k|{
   57|       |#ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#else
   64|  15.8k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  15.8k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 5.47k, False: 10.4k]
  ------------------
   66|       |        atomic_thread_fence(memory_order_acquire);
   67|  15.8k|#endif
   68|  15.8k|    return 1;
   69|  15.8k|}

ssl_sess.c:safe_add_time:
   51|  3.53k|    {                                                                \
   52|  3.53k|        type r;                                                      \
   53|  3.53k|                                                                     \
   54|  3.53k|        if (!__builtin_add_overflow(a, b, &r))                       \
  ------------------
  |  Branch (54:13): [True: 3.53k, False: 0]
  ------------------
   55|  3.53k|            return r;                                                \
   56|  3.53k|        *err |= 1;                                                   \
   57|      0|        return a + b;                                                \
   58|  3.53k|    }
array_alloc.c:safe_mul_size_t:
  151|  21.1M|    {                                                                \
  152|  21.1M|        type r;                                                      \
  153|  21.1M|                                                                     \
  154|  21.1M|        if (!__builtin_mul_overflow(a, b, &r))                       \
  ------------------
  |  Branch (154:13): [True: 21.1M, False: 0]
  ------------------
  155|  21.1M|            return r;                                                \
  156|  21.1M|        *err |= 1;                                                   \
  157|      0|        return a * b;                                                \
  158|  21.1M|    }
stack.c:safe_muldiv_int:
  324|   604k|    {                                                                   \
  325|   604k|        int e2 = 0;                                                     \
  326|   604k|        type q, r, x, y;                                                \
  327|   604k|                                                                        \
  328|   604k|        if (c == 0) {                                                   \
  ------------------
  |  Branch (328:13): [True: 0, False: 604k]
  ------------------
  329|      0|            *err |= 1;                                                  \
  330|      0|            return a == 0 || b == 0 ? 0 : max;                          \
  ------------------
  |  Branch (330:20): [True: 0, False: 0]
  |  Branch (330:30): [True: 0, False: 0]
  ------------------
  331|      0|        }                                                               \
  332|   604k|        x = safe_mul_##type_name(a, b, &e2);                            \
  333|   604k|        if (!e2)                                                        \
  ------------------
  |  Branch (333:13): [True: 604k, False: 0]
  ------------------
  334|   604k|            return safe_div_##type_name(x, c, err);                     \
  335|   604k|        if (b > a) {                                                    \
  ------------------
  |  Branch (335:13): [True: 0, False: 0]
  ------------------
  336|      0|            x = b;                                                      \
  337|      0|            b = a;                                                      \
  338|      0|            a = x;                                                      \
  339|      0|        }                                                               \
  340|      0|        q = safe_div_##type_name(a, c, err);                            \
  341|      0|        r = safe_mod_##type_name(a, c, err);                            \
  342|      0|        x = safe_mul_##type_name(r, b, err);                            \
  343|      0|        y = safe_mul_##type_name(q, b, err);                            \
  344|      0|        q = safe_div_##type_name(x, c, err);                            \
  345|      0|        return safe_add_##type_name(y, q, err);                         \
  346|   604k|    }
stack.c:safe_mul_int:
  138|   604k|    {                                                                \
  139|   604k|        type r;                                                      \
  140|   604k|                                                                     \
  141|   604k|        if (!__builtin_mul_overflow(a, b, &r))                       \
  ------------------
  |  Branch (141:13): [True: 604k, False: 0]
  ------------------
  142|   604k|            return r;                                                \
  143|   604k|        *err |= 1;                                                   \
  144|      0|        return (a < 0) ^ (b < 0) ? min : max;                        \
  ------------------
  |  Branch (144:16): [True: 0, False: 0]
  ------------------
  145|   604k|    }
stack.c:safe_div_int:
  201|   604k|    {                                                                \
  202|   604k|        if (b == 0) {                                                \
  ------------------
  |  Branch (202:13): [True: 0, False: 604k]
  ------------------
  203|      0|            *err |= 1;                                               \
  204|      0|            return a < 0 ? min : max;                                \
  ------------------
  |  Branch (204:20): [True: 0, False: 0]
  ------------------
  205|      0|        }                                                            \
  206|   604k|        if (b == -1 && a == min) {                                   \
  ------------------
  |  Branch (206:13): [True: 0, False: 604k]
  |  Branch (206:24): [True: 0, False: 0]
  ------------------
  207|      0|            *err |= 1;                                               \
  208|      0|            return max;                                              \
  209|      0|        }                                                            \
  210|   604k|        return a / b;                                                \
  211|   604k|    }

ssl_cert.c:ssl_x509_store_ctx_init_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
ssl_init.c:ossl_init_ssl_base_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
conf_mod.c:do_init_module_list_lock_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
do_engine_lock_init_ossl_:
   41|      1|    {                              \
   42|      1|        init##_ossl_ret_ = init(); \
   43|      1|    }                              \
err.c:do_err_strings_init_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
context.c:default_context_do_init_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
init.c:ossl_init_base_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
init.c:ossl_init_register_atexit_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
init.c:ossl_init_load_crypto_nodelete_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
init.c:ossl_init_load_crypto_strings_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
init.c:ossl_init_load_ssl_strings_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
init.c:ossl_init_add_all_ciphers_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
init.c:ossl_init_add_all_digests_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
init.c:ossl_init_config_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
init.c:ossl_init_engine_rdrand_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
init.c:ossl_init_engine_dynamic_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
init.c:ossl_init_engine_padlock_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
initthread.c:ossl_init_thread_once_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
initthread.c:create_global_tevent_register_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
o_names.c:o_names_init_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
obj_dat.c:obj_api_initialise_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
obj_xref.c:o_sig_init_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \
rand_lib.c:do_rand_init_ossl_:
   73|      1|    {                                \
   74|      1|        init##_ossl_ret_ = init();   \
   75|      1|    }                                \

ssl_sess.c:ossl_time_add:
  169|  3.53k|{
  170|  3.53k|    OSSL_TIME r;
  171|  3.53k|    int err = 0;
  172|       |
  173|  3.53k|    r.t = safe_add_time(a.t, b.t, &err);
  174|  3.53k|    return err ? ossl_time_infinite() : r;
  ------------------
  |  Branch (174:12): [True: 0, False: 3.53k]
  ------------------
  175|  3.53k|}
ssl_sess.c:ossl_ticks2time:
   59|  3.53k|{
   60|  3.53k|    OSSL_TIME r;
   61|       |
   62|  3.53k|    r.t = ticks;
   63|  3.53k|    return r;
   64|  3.53k|}
ssl_sess.c:ossl_time_is_zero:
  157|  1.76k|{
  158|  1.76k|    return ossl_time_compare(t, ossl_time_zero()) == 0;
  159|  1.76k|}
ssl_sess.c:ossl_time_compare:
  147|  1.76k|{
  148|  1.76k|    if (a.t > b.t)
  ------------------
  |  Branch (148:9): [True: 1.76k, False: 0]
  ------------------
  149|  1.76k|        return 1;
  150|      0|    if (a.t < b.t)
  ------------------
  |  Branch (150:9): [True: 0, False: 0]
  ------------------
  151|      0|        return -1;
  152|      0|    return 0;
  153|      0|}
ssl_sess.c:ossl_time_zero:
   79|  1.76k|{
   80|  1.76k|    return ossl_ticks2time(0);
   81|  1.76k|}
ssl_sess.c:ossl_time_from_time_t:
  137|  2.56k|{
  138|  2.56k|    OSSL_TIME ot;
  139|       |
  140|  2.56k|    ot.t = t;
  141|  2.56k|    ot.t *= OSSL_TIME_SECOND;
  ------------------
  |  |   31|  2.56k|#define OSSL_TIME_SECOND ((uint64_t)1000000000)
  ------------------
  142|  2.56k|    return ot;
  143|  2.56k|}
t1_lib.c:ossl_ticks2time:
   59|  2.56k|{
   60|  2.56k|    OSSL_TIME r;
   61|       |
   62|  2.56k|    r.t = ticks;
   63|  2.56k|    return r;
   64|  2.56k|}

a_mbstr.c:is_unicode_valid:
   27|  63.3M|{
   28|  63.3M|    return value <= UNICODE_MAX && !is_unicode_surrogate(value);
  ------------------
  |  Branch (28:12): [True: 63.3M, False: 0]
  |  Branch (28:36): [True: 63.3M, False: 0]
  ------------------
   29|  63.3M|}
a_mbstr.c:is_unicode_surrogate:
   22|  63.3M|{
   23|  63.3M|    return value >= SURROGATE_MIN && value <= SURROGATE_MAX;
  ------------------
  |  Branch (23:12): [True: 0, False: 63.3M]
  |  Branch (23:38): [True: 0, False: 0]
  ------------------
   24|  63.3M|}

ASN1_TYPE_new:
  800|  1.83M|    {                                                               \
  801|  1.83M|        return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname));     \
  ------------------
  |  |  433|  1.83M|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  802|  1.83M|    }                                                               \
X509_ALGOR_new:
  800|   824k|    {                                                               \
  801|   824k|        return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname));     \
  ------------------
  |  |  433|   824k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  802|   824k|    }                                                               \
X509_ALGOR_free:
  804|   824k|    {                                                               \
  805|   824k|        ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname));    \
  ------------------
  |  |  433|   824k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  806|   824k|    }
RSAPublicKey_it:
  241|   299k|    ASN1_ITEM_start(tname)                              \
  ------------------
  |  |   97|   299k|    {                                  \
  |  |   98|   299k|        static const ASN1_ITEM local_it = {
  ------------------
  242|   299k|        ASN1_ITYPE_SEQUENCE,                            \
  ------------------
  |  |   83|   299k|#define ASN1_ITYPE_SEQUENCE 0x1
  ------------------
  243|   299k|        V_ASN1_SEQUENCE,                                \
  ------------------
  |  |   76|   299k|#define V_ASN1_SEQUENCE 16
  ------------------
  244|   299k|        tname##_seq_tt,                                 \
  245|   299k|        sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \
  246|   299k|        &tname##_aux,                                   \
  247|   299k|        sizeof(stname),                                 \
  248|   299k|        #tname ASN1_ITEM_end(tname)
  ------------------
  |  |  104|   299k|    }                         \
  |  |  105|   299k|    ;                         \
  |  |  106|   299k|    return &local_it;         \
  |  |  107|   299k|    }
  ------------------
RSA_PSS_PARAMS_it:
  241|   299k|    ASN1_ITEM_start(tname)                              \
  ------------------
  |  |   97|   299k|    {                                  \
  |  |   98|   299k|        static const ASN1_ITEM local_it = {
  ------------------
  242|   299k|        ASN1_ITYPE_SEQUENCE,                            \
  ------------------
  |  |   83|   299k|#define ASN1_ITYPE_SEQUENCE 0x1
  ------------------
  243|   299k|        V_ASN1_SEQUENCE,                                \
  ------------------
  |  |   76|   299k|#define V_ASN1_SEQUENCE 16
  ------------------
  244|   299k|        tname##_seq_tt,                                 \
  245|   299k|        sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \
  246|   299k|        &tname##_aux,                                   \
  247|   299k|        sizeof(stname),                                 \
  248|   299k|        #tname ASN1_ITEM_end(tname)
  ------------------
  |  |  104|   299k|    }                         \
  |  |  105|   299k|    ;                         \
  |  |  106|   299k|    return &local_it;         \
  |  |  107|   299k|    }
  ------------------
RSA_PSS_PARAMS_free:
  804|   299k|    {                                                               \
  805|   299k|        ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname));    \
  ------------------
  |  |  433|   299k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  806|   299k|    }
d2i_RSAPublicKey:
  814|   299k|    {                                                                                      \
  815|   299k|        return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  433|   299k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  816|   299k|    }                                                                                      \
GENERAL_NAMES_free:
  804|   824k|    {                                                               \
  805|   824k|        ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname));    \
  ------------------
  |  |  433|   824k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  806|   824k|    }
NAME_CONSTRAINTS_free:
  804|   824k|    {                                                               \
  805|   824k|        ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname));    \
  ------------------
  |  |  433|   824k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  806|   824k|    }
X509_CRL_it:
  241|   414k|    ASN1_ITEM_start(tname)                              \
  ------------------
  |  |   97|   414k|    {                                  \
  |  |   98|   414k|        static const ASN1_ITEM local_it = {
  ------------------
  242|   414k|        ASN1_ITYPE_SEQUENCE,                            \
  ------------------
  |  |   83|   414k|#define ASN1_ITYPE_SEQUENCE 0x1
  ------------------
  243|   414k|        V_ASN1_SEQUENCE,                                \
  ------------------
  |  |   76|   414k|#define V_ASN1_SEQUENCE 16
  ------------------
  244|   414k|        tname##_seq_tt,                                 \
  245|   414k|        sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \
  246|   414k|        &tname##_aux,                                   \
  247|   414k|        sizeof(stname),                                 \
  248|   414k|        #tname ASN1_ITEM_end(tname)
  ------------------
  |  |  104|   414k|    }                         \
  |  |  105|   414k|    ;                         \
  |  |  106|   414k|    return &local_it;         \
  |  |  107|   414k|    }
  ------------------
X509_CRL_free:
  804|   414k|    {                                                               \
  805|   414k|        ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname));    \
  ------------------
  |  |  433|   414k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  806|   414k|    }
X509_NAME_ENTRY_new:
  800|  2.98M|    {                                                               \
  801|  2.98M|        return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname));     \
  ------------------
  |  |  433|  2.98M|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  802|  2.98M|    }                                                               \
X509_NAME_ENTRY_free:
  804|  6.81M|    {                                                               \
  805|  6.81M|        ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname));    \
  ------------------
  |  |  433|  6.81M|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  806|  6.81M|    }
X509_NAME_free:
  804|  39.4k|    {                                                               \
  805|  39.4k|        ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname));    \
  ------------------
  |  |  433|  39.4k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  806|  39.4k|    }
d2i_X509_PUBKEY:
  814|   412k|    {                                                                                      \
  815|   412k|        return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  433|   412k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  816|   412k|    }                                                                                      \
X509_PUBKEY_free:
  804|   824k|    {                                                               \
  805|   824k|        ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname));    \
  ------------------
  |  |  433|   824k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  806|   824k|    }
X509_CINF_it:
  241|  2.25M|    ASN1_ITEM_start(tname)                              \
  ------------------
  |  |   97|  2.25M|    {                                  \
  |  |   98|  2.25M|        static const ASN1_ITEM local_it = {
  ------------------
  242|  2.25M|        ASN1_ITYPE_SEQUENCE,                            \
  ------------------
  |  |   83|  2.25M|#define ASN1_ITYPE_SEQUENCE 0x1
  ------------------
  243|  2.25M|        V_ASN1_SEQUENCE,                                \
  ------------------
  |  |   76|  2.25M|#define V_ASN1_SEQUENCE 16
  ------------------
  244|  2.25M|        tname##_seq_tt,                                 \
  245|  2.25M|        sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \
  246|  2.25M|        &tname##_aux,                                   \
  247|  2.25M|        sizeof(stname),                                 \
  248|  2.25M|        #tname ASN1_ITEM_end(tname)
  ------------------
  |  |  104|  2.25M|    }                         \
  |  |  105|  2.25M|    ;                         \
  |  |  106|  2.25M|    return &local_it;         \
  |  |  107|  2.25M|    }
  ------------------
X509_it:
  241|  2.04M|    ASN1_ITEM_start(tname)                              \
  ------------------
  |  |   97|  2.04M|    {                                  \
  |  |   98|  2.04M|        static const ASN1_ITEM local_it = {
  ------------------
  242|  2.04M|        ASN1_ITYPE_SEQUENCE,                            \
  ------------------
  |  |   83|  2.04M|#define ASN1_ITYPE_SEQUENCE 0x1
  ------------------
  243|  2.04M|        V_ASN1_SEQUENCE,                                \
  ------------------
  |  |   76|  2.04M|#define V_ASN1_SEQUENCE 16
  ------------------
  244|  2.04M|        tname##_seq_tt,                                 \
  245|  2.04M|        sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \
  246|  2.04M|        &tname##_aux,                                   \
  247|  2.04M|        sizeof(stname),                                 \
  248|  2.04M|        #tname ASN1_ITEM_end(tname)
  ------------------
  |  |  104|  2.04M|    }                         \
  |  |  105|  2.04M|    ;                         \
  |  |  106|  2.04M|    return &local_it;         \
  |  |  107|  2.04M|    }
  ------------------
d2i_X509:
  814|   412k|    {                                                                                      \
  815|   412k|        return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname)); \
  ------------------
  |  |  433|   412k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  816|   412k|    }                                                                                      \
X509_free:
  804|   883k|    {                                                               \
  805|   883k|        ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname));    \
  ------------------
  |  |  433|   883k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  806|   883k|    }
X509_CERT_AUX_free:
  804|   824k|    {                                                               \
  805|   824k|        ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname));    \
  ------------------
  |  |  433|   824k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  806|   824k|    }
AUTHORITY_KEYID_free:
  804|   824k|    {                                                               \
  805|   824k|        ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname));    \
  ------------------
  |  |  433|   824k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  806|   824k|    }
ASIdentifiers_free:
  804|   824k|    {                                                               \
  805|   824k|        ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname));    \
  ------------------
  |  |  433|   824k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  806|   824k|    }
BASIC_CONSTRAINTS_free:
  804|   338k|    {                                                               \
  805|   338k|        ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname));    \
  ------------------
  |  |  433|   338k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  806|   338k|    }
CRL_DIST_POINTS_free:
  804|   824k|    {                                                               \
  805|   824k|        ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname));    \
  ------------------
  |  |  433|   824k|#define ASN1_ITEM_rptr(ref) (ref##_it())
  ------------------
  806|   824k|    }

ml_kem.c:OPENSSL_store_u64_le:
  160|   382k|{
  161|   382k|#ifdef OSSL_HTOLE64
  162|   382k|    uint64_t t = OSSL_HTOLE64(val);
  ------------------
  |  |   52|   382k|#define OSSL_HTOLE64(x) htole64(x)
  ------------------
  163|       |
  164|   382k|    memcpy(out, (unsigned char *)&t, 8);
  165|   382k|    return out + 8;
  166|       |#else
  167|       |    *out++ = (val & 0xff);
  168|       |    *out++ = (val >> 8) & 0xff;
  169|       |    *out++ = (val >> 16) & 0xff;
  170|       |    *out++ = (val >> 24) & 0xff;
  171|       |    *out++ = (val >> 32) & 0xff;
  172|       |    *out++ = (val >> 40) & 0xff;
  173|       |    *out++ = (val >> 48) & 0xff;
  174|       |    *out++ = (val >> 56) & 0xff;
  175|       |    return out;
  176|       |#endif
  177|   382k|}

tls_common.c:OSSL_FUNC_rlayer_skip_early_data:
   60|  10.6k|    {                                                  \
   61|  10.6k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  10.6k|    }
tls_common.c:OSSL_FUNC_rlayer_security:
   60|  10.6k|    {                                                  \
   61|  10.6k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  10.6k|    }
decoder_meth.c:OSSL_FUNC_decoder_newctx:
   60|     76|    {                                                  \
   61|     76|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     76|    }
decoder_meth.c:OSSL_FUNC_decoder_freectx:
   60|     76|    {                                                  \
   61|     76|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     76|    }
decoder_meth.c:OSSL_FUNC_decoder_set_ctx_params:
   60|     74|    {                                                  \
   61|     74|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     74|    }
decoder_meth.c:OSSL_FUNC_decoder_settable_ctx_params:
   60|     74|    {                                                  \
   61|     74|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     74|    }
decoder_meth.c:OSSL_FUNC_decoder_does_selection:
   60|     73|    {                                                  \
   61|     73|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     73|    }
decoder_meth.c:OSSL_FUNC_decoder_decode:
   60|     76|    {                                                  \
   61|     76|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     76|    }
decoder_meth.c:OSSL_FUNC_decoder_export_object:
   60|     73|    {                                                  \
   61|     73|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|     73|    }
digest.c:OSSL_FUNC_digest_newctx:
   60|  17.0k|    {                                                  \
   61|  17.0k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  17.0k|    }
digest.c:OSSL_FUNC_digest_init:
   60|  17.0k|    {                                                  \
   61|  17.0k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  17.0k|    }
digest.c:OSSL_FUNC_digest_update:
   60|  17.0k|    {                                                  \
   61|  17.0k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  17.0k|    }
digest.c:OSSL_FUNC_digest_final:
   60|  17.0k|    {                                                  \
   61|  17.0k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  17.0k|    }
digest.c:OSSL_FUNC_digest_squeeze:
   60|  2.52k|    {                                                  \
   61|  2.52k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  2.52k|    }
digest.c:OSSL_FUNC_digest_freectx:
   60|  17.0k|    {                                                  \
   61|  17.0k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  17.0k|    }
digest.c:OSSL_FUNC_digest_dupctx:
   60|  17.0k|    {                                                  \
   61|  17.0k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  17.0k|    }
digest.c:OSSL_FUNC_digest_get_params:
   60|  17.0k|    {                                                  \
   61|  17.0k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  17.0k|    }
digest.c:OSSL_FUNC_digest_set_ctx_params:
   60|  5.05k|    {                                                  \
   61|  5.05k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  5.05k|    }
digest.c:OSSL_FUNC_digest_get_ctx_params:
   60|  3.79k|    {                                                  \
   61|  3.79k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  3.79k|    }
digest.c:OSSL_FUNC_digest_gettable_params:
   60|  17.0k|    {                                                  \
   61|  17.0k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  17.0k|    }
digest.c:OSSL_FUNC_digest_settable_ctx_params:
   60|  5.05k|    {                                                  \
   61|  5.05k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  5.05k|    }
digest.c:OSSL_FUNC_digest_gettable_ctx_params:
   60|  3.79k|    {                                                  \
   61|  3.79k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  3.79k|    }
digest.c:OSSL_FUNC_digest_copyctx:
   60|  17.0k|    {                                                  \
   61|  17.0k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  17.0k|    }
evp_enc.c:OSSL_FUNC_cipher_newctx:
   60|  82.1k|    {                                                  \
   61|  82.1k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  82.1k|    }
evp_enc.c:OSSL_FUNC_cipher_encrypt_init:
   60|  82.1k|    {                                                  \
   61|  82.1k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  82.1k|    }
evp_enc.c:OSSL_FUNC_cipher_decrypt_init:
   60|  82.1k|    {                                                  \
   61|  82.1k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  82.1k|    }
evp_enc.c:OSSL_FUNC_cipher_encrypt_skey_init:
   60|  42.9k|    {                                                  \
   61|  42.9k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  42.9k|    }
evp_enc.c:OSSL_FUNC_cipher_decrypt_skey_init:
   60|  42.9k|    {                                                  \
   61|  42.9k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  42.9k|    }
evp_enc.c:OSSL_FUNC_cipher_update:
   60|  82.1k|    {                                                  \
   61|  82.1k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  82.1k|    }
evp_enc.c:OSSL_FUNC_cipher_final:
   60|  82.1k|    {                                                  \
   61|  82.1k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  82.1k|    }
evp_enc.c:OSSL_FUNC_cipher_cipher:
   60|  74.5k|    {                                                  \
   61|  74.5k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  74.5k|    }
evp_enc.c:OSSL_FUNC_cipher_freectx:
   60|  82.1k|    {                                                  \
   61|  82.1k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  82.1k|    }
evp_enc.c:OSSL_FUNC_cipher_dupctx:
   60|  81.5k|    {                                                  \
   61|  81.5k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  81.5k|    }
evp_enc.c:OSSL_FUNC_cipher_get_params:
   60|  82.1k|    {                                                  \
   61|  82.1k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  82.1k|    }
evp_enc.c:OSSL_FUNC_cipher_get_ctx_params:
   60|  82.1k|    {                                                  \
   61|  82.1k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  82.1k|    }
evp_enc.c:OSSL_FUNC_cipher_set_ctx_params:
   60|  82.1k|    {                                                  \
   61|  82.1k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  82.1k|    }
evp_enc.c:OSSL_FUNC_cipher_gettable_params:
   60|  82.1k|    {                                                  \
   61|  82.1k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  82.1k|    }
evp_enc.c:OSSL_FUNC_cipher_gettable_ctx_params:
   60|  82.1k|    {                                                  \
   61|  82.1k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  82.1k|    }
evp_enc.c:OSSL_FUNC_cipher_settable_ctx_params:
   60|  82.1k|    {                                                  \
   61|  82.1k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  82.1k|    }
exchange.c:OSSL_FUNC_keyexch_newctx:
   60|  4.42k|    {                                                  \
   61|  4.42k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  4.42k|    }
exchange.c:OSSL_FUNC_keyexch_init:
   60|  4.42k|    {                                                  \
   61|  4.42k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  4.42k|    }
exchange.c:OSSL_FUNC_keyexch_set_peer:
   60|  2.52k|    {                                                  \
   61|  2.52k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  2.52k|    }
exchange.c:OSSL_FUNC_keyexch_derive:
   60|  4.42k|    {                                                  \
   61|  4.42k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  4.42k|    }
exchange.c:OSSL_FUNC_keyexch_freectx:
   60|  4.42k|    {                                                  \
   61|  4.42k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  4.42k|    }
exchange.c:OSSL_FUNC_keyexch_dupctx:
   60|  4.42k|    {                                                  \
   61|  4.42k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  4.42k|    }
exchange.c:OSSL_FUNC_keyexch_get_ctx_params:
   60|  4.42k|    {                                                  \
   61|  4.42k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  4.42k|    }
exchange.c:OSSL_FUNC_keyexch_gettable_ctx_params:
   60|  4.42k|    {                                                  \
   61|  4.42k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  4.42k|    }
exchange.c:OSSL_FUNC_keyexch_set_ctx_params:
   60|  3.16k|    {                                                  \
   61|  3.16k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  3.16k|    }
exchange.c:OSSL_FUNC_keyexch_settable_ctx_params:
   60|  3.16k|    {                                                  \
   61|  3.16k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  3.16k|    }
exchange.c:OSSL_FUNC_keyexch_derive_skey:
   60|    632|    {                                                  \
   61|    632|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    632|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_new:
   60|  25.2k|    {                                                  \
   61|  25.2k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  25.2k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_init:
   60|  23.3k|    {                                                  \
   61|  23.3k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  23.3k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_set_template:
   60|  3.16k|    {                                                  \
   61|  3.16k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  3.16k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_set_params:
   60|  23.3k|    {                                                  \
   61|  23.3k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  23.3k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_settable_params:
   60|  23.3k|    {                                                  \
   61|  23.3k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  23.3k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_get_params:
   60|  1.26k|    {                                                  \
   61|  1.26k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  1.26k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_gettable_params:
   60|  1.26k|    {                                                  \
   61|  1.26k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  1.26k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen:
   60|  23.3k|    {                                                  \
   61|  23.3k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  23.3k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_cleanup:
   60|  23.3k|    {                                                  \
   61|  23.3k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  23.3k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_free:
   60|  25.2k|    {                                                  \
   61|  25.2k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  25.2k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_load:
   60|  18.3k|    {                                                  \
   61|  18.3k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  18.3k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_get_params:
   60|  23.3k|    {                                                  \
   61|  23.3k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  23.3k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gettable_params:
   60|  23.3k|    {                                                  \
   61|  23.3k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  23.3k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_set_params:
   60|  12.0k|    {                                                  \
   61|  12.0k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  12.0k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_settable_params:
   60|  12.0k|    {                                                  \
   61|  12.0k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  12.0k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_query_operation_name:
   60|  2.52k|    {                                                  \
   61|  2.52k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  2.52k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_has:
   60|  25.2k|    {                                                  \
   61|  25.2k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  25.2k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_dup:
   60|  20.8k|    {                                                  \
   61|  20.8k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  20.8k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_validate:
   60|  18.3k|    {                                                  \
   61|  18.3k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  18.3k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_match:
   60|  23.3k|    {                                                  \
   61|  23.3k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  23.3k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_import:
   60|  23.3k|    {                                                  \
   61|  23.3k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  23.3k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_import_types:
   60|  23.3k|    {                                                  \
   61|  23.3k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  23.3k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_export:
   60|  23.3k|    {                                                  \
   61|  23.3k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  23.3k|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_export_types:
   60|  23.3k|    {                                                  \
   61|  23.3k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  23.3k|    }
signature.c:OSSL_FUNC_signature_newctx:
   60|  37.2k|    {                                                  \
   61|  37.2k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  37.2k|    }
signature.c:OSSL_FUNC_signature_sign_init:
   60|  25.2k|    {                                                  \
   61|  25.2k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  25.2k|    }
signature.c:OSSL_FUNC_signature_sign:
   60|  34.7k|    {                                                  \
   61|  34.7k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  34.7k|    }
signature.c:OSSL_FUNC_signature_sign_message_init:
   60|  32.2k|    {                                                  \
   61|  32.2k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  32.2k|    }
signature.c:OSSL_FUNC_signature_sign_message_update:
   60|  21.4k|    {                                                  \
   61|  21.4k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  21.4k|    }
signature.c:OSSL_FUNC_signature_sign_message_final:
   60|  21.4k|    {                                                  \
   61|  21.4k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  21.4k|    }
signature.c:OSSL_FUNC_signature_verify_init:
   60|  25.2k|    {                                                  \
   61|  25.2k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  25.2k|    }
signature.c:OSSL_FUNC_signature_verify:
   60|  34.7k|    {                                                  \
   61|  34.7k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  34.7k|    }
signature.c:OSSL_FUNC_signature_verify_message_init:
   60|  32.2k|    {                                                  \
   61|  32.2k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  32.2k|    }
signature.c:OSSL_FUNC_signature_verify_message_update:
   60|  21.4k|    {                                                  \
   61|  21.4k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  21.4k|    }
signature.c:OSSL_FUNC_signature_verify_message_final:
   60|  21.4k|    {                                                  \
   61|  21.4k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  21.4k|    }
signature.c:OSSL_FUNC_signature_verify_recover_init:
   60|  8.84k|    {                                                  \
   61|  8.84k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  8.84k|    }
signature.c:OSSL_FUNC_signature_verify_recover:
   60|  8.84k|    {                                                  \
   61|  8.84k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  8.84k|    }
signature.c:OSSL_FUNC_signature_digest_sign_init:
   60|  15.8k|    {                                                  \
   61|  15.8k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  15.8k|    }
signature.c:OSSL_FUNC_signature_digest_sign_update:
   60|  5.05k|    {                                                  \
   61|  5.05k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  5.05k|    }
signature.c:OSSL_FUNC_signature_digest_sign_final:
   60|  5.05k|    {                                                  \
   61|  5.05k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  5.05k|    }
signature.c:OSSL_FUNC_signature_digest_sign:
   60|  10.7k|    {                                                  \
   61|  10.7k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  10.7k|    }
signature.c:OSSL_FUNC_signature_digest_verify_init:
   60|  13.2k|    {                                                  \
   61|  13.2k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  13.2k|    }
signature.c:OSSL_FUNC_signature_digest_verify_update:
   60|  2.52k|    {                                                  \
   61|  2.52k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  2.52k|    }
signature.c:OSSL_FUNC_signature_digest_verify_final:
   60|  2.52k|    {                                                  \
   61|  2.52k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  2.52k|    }
signature.c:OSSL_FUNC_signature_digest_verify:
   60|  10.7k|    {                                                  \
   61|  10.7k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  10.7k|    }
signature.c:OSSL_FUNC_signature_freectx:
   60|  37.2k|    {                                                  \
   61|  37.2k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  37.2k|    }
signature.c:OSSL_FUNC_signature_dupctx:
   60|  37.2k|    {                                                  \
   61|  37.2k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  37.2k|    }
signature.c:OSSL_FUNC_signature_get_ctx_params:
   60|  34.7k|    {                                                  \
   61|  34.7k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  34.7k|    }
signature.c:OSSL_FUNC_signature_gettable_ctx_params:
   60|  34.7k|    {                                                  \
   61|  34.7k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  34.7k|    }
signature.c:OSSL_FUNC_signature_set_ctx_params:
   60|  37.2k|    {                                                  \
   61|  37.2k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  37.2k|    }
signature.c:OSSL_FUNC_signature_settable_ctx_params:
   60|  37.2k|    {                                                  \
   61|  37.2k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  37.2k|    }
signature.c:OSSL_FUNC_signature_get_ctx_md_params:
   60|  2.52k|    {                                                  \
   61|  2.52k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  2.52k|    }
signature.c:OSSL_FUNC_signature_gettable_ctx_md_params:
   60|  2.52k|    {                                                  \
   61|  2.52k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  2.52k|    }
signature.c:OSSL_FUNC_signature_set_ctx_md_params:
   60|  2.52k|    {                                                  \
   61|  2.52k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  2.52k|    }
signature.c:OSSL_FUNC_signature_settable_ctx_md_params:
   60|  2.52k|    {                                                  \
   61|  2.52k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  2.52k|    }
signature.c:OSSL_FUNC_signature_query_key_types:
   60|  22.7k|    {                                                  \
   61|  22.7k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  22.7k|    }
provider_core.c:OSSL_FUNC_provider_teardown:
   60|  1.41k|    {                                                  \
   61|  1.41k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  1.41k|    }
provider_core.c:OSSL_FUNC_provider_gettable_params:
   60|  1.43k|    {                                                  \
   61|  1.43k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  1.43k|    }
provider_core.c:OSSL_FUNC_provider_get_params:
   60|  1.43k|    {                                                  \
   61|  1.43k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  1.43k|    }
provider_core.c:OSSL_FUNC_provider_get_capabilities:
   60|    787|    {                                                  \
   61|    787|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    787|    }
provider_core.c:OSSL_FUNC_provider_query_operation:
   60|  1.43k|    {                                                  \
   61|  1.43k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  1.43k|    }
baseprov.c:OSSL_FUNC_core_gettable_params:
   60|    627|    {                                                  \
   61|    627|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    627|    }
baseprov.c:OSSL_FUNC_core_get_params:
   60|    627|    {                                                  \
   61|    627|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    627|    }
baseprov.c:OSSL_FUNC_core_get_libctx:
   60|    627|    {                                                  \
   61|    627|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    627|    }
defltprov.c:OSSL_FUNC_core_gettable_params:
   60|    787|    {                                                  \
   61|    787|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    787|    }
defltprov.c:OSSL_FUNC_core_get_params:
   60|    787|    {                                                  \
   61|    787|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    787|    }
defltprov.c:OSSL_FUNC_core_get_libctx:
   60|    787|    {                                                  \
   61|    787|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    787|    }
bio_prov.c:OSSL_FUNC_BIO_new_file:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
bio_prov.c:OSSL_FUNC_BIO_new_membuf:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
bio_prov.c:OSSL_FUNC_BIO_read_ex:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
bio_prov.c:OSSL_FUNC_BIO_write_ex:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
bio_prov.c:OSSL_FUNC_BIO_gets:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
bio_prov.c:OSSL_FUNC_BIO_puts:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
bio_prov.c:OSSL_FUNC_BIO_ctrl:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
bio_prov.c:OSSL_FUNC_BIO_up_ref:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
bio_prov.c:OSSL_FUNC_BIO_free:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
bio_prov.c:OSSL_FUNC_BIO_vprintf:
   60|      1|    {                                                  \
   61|      1|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|      1|    }
provider_seeding.c:OSSL_FUNC_get_entropy:
   60|    787|    {                                                  \
   61|    787|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    787|    }
provider_seeding.c:OSSL_FUNC_get_user_entropy:
   60|    787|    {                                                  \
   61|    787|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    787|    }
provider_seeding.c:OSSL_FUNC_cleanup_entropy:
   60|    787|    {                                                  \
   61|    787|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    787|    }
provider_seeding.c:OSSL_FUNC_cleanup_user_entropy:
   60|    787|    {                                                  \
   61|    787|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    787|    }
provider_seeding.c:OSSL_FUNC_get_nonce:
   60|    787|    {                                                  \
   61|    787|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    787|    }
provider_seeding.c:OSSL_FUNC_get_user_nonce:
   60|    787|    {                                                  \
   61|    787|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    787|    }
provider_seeding.c:OSSL_FUNC_cleanup_nonce:
   60|    787|    {                                                  \
   61|    787|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    787|    }
provider_seeding.c:OSSL_FUNC_cleanup_user_nonce:
   60|    787|    {                                                  \
   61|    787|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    787|    }
drbg.c:OSSL_FUNC_rand_enable_locking:
   60|  1.64k|    {                                                  \
   61|  1.64k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  1.64k|    }
drbg.c:OSSL_FUNC_rand_lock:
   60|  1.64k|    {                                                  \
   61|  1.64k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  1.64k|    }
drbg.c:OSSL_FUNC_rand_unlock:
   60|  1.64k|    {                                                  \
   61|  1.64k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  1.64k|    }
drbg.c:OSSL_FUNC_rand_get_ctx_params:
   60|  1.64k|    {                                                  \
   61|  1.64k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  1.64k|    }
drbg.c:OSSL_FUNC_rand_get_seed:
   60|  1.64k|    {                                                  \
   61|  1.64k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  1.64k|    }
drbg.c:OSSL_FUNC_rand_clear_seed:
   60|  1.64k|    {                                                  \
   61|  1.64k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  1.64k|    }
evp_rand.c:OSSL_FUNC_rand_newctx:
   60|  3.27k|    {                                                  \
   61|  3.27k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  3.27k|    }
evp_rand.c:OSSL_FUNC_rand_freectx:
   60|  3.27k|    {                                                  \
   61|  3.27k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  3.27k|    }
evp_rand.c:OSSL_FUNC_rand_instantiate:
   60|  3.27k|    {                                                  \
   61|  3.27k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  3.27k|    }
evp_rand.c:OSSL_FUNC_rand_uninstantiate:
   60|  3.27k|    {                                                  \
   61|  3.27k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  3.27k|    }
evp_rand.c:OSSL_FUNC_rand_generate:
   60|  3.27k|    {                                                  \
   61|  3.27k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  3.27k|    }
evp_rand.c:OSSL_FUNC_rand_reseed:
   60|  3.27k|    {                                                  \
   61|  3.27k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  3.27k|    }
evp_rand.c:OSSL_FUNC_rand_nonce:
   60|    549|    {                                                  \
   61|    549|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|    549|    }
evp_rand.c:OSSL_FUNC_rand_enable_locking:
   60|  3.27k|    {                                                  \
   61|  3.27k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  3.27k|    }
evp_rand.c:OSSL_FUNC_rand_lock:
   60|  3.27k|    {                                                  \
   61|  3.27k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  3.27k|    }
evp_rand.c:OSSL_FUNC_rand_unlock:
   60|  3.27k|    {                                                  \
   61|  3.27k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  3.27k|    }
evp_rand.c:OSSL_FUNC_rand_gettable_ctx_params:
   60|  3.27k|    {                                                  \
   61|  3.27k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  3.27k|    }
evp_rand.c:OSSL_FUNC_rand_settable_ctx_params:
   60|  2.19k|    {                                                  \
   61|  2.19k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  2.19k|    }
evp_rand.c:OSSL_FUNC_rand_get_ctx_params:
   60|  3.27k|    {                                                  \
   61|  3.27k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  3.27k|    }
evp_rand.c:OSSL_FUNC_rand_set_ctx_params:
   60|  2.19k|    {                                                  \
   61|  2.19k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  2.19k|    }
evp_rand.c:OSSL_FUNC_rand_verify_zeroization:
   60|  3.27k|    {                                                  \
   61|  3.27k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  3.27k|    }
evp_rand.c:OSSL_FUNC_rand_get_seed:
   60|  3.27k|    {                                                  \
   61|  3.27k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  3.27k|    }
evp_rand.c:OSSL_FUNC_rand_clear_seed:
   60|  2.72k|    {                                                  \
   61|  2.72k|        return (OSSL_FUNC_##name##_fn *)opf->function; \
   62|  2.72k|    }

ssl_lib.c:ERR_GET_LIB:
  244|    409|{
  245|    409|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  241|    409|#define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  220|    409|#define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (241:35): [True: 0, False: 409]
  |  |  ------------------
  ------------------
  246|      0|        return ERR_LIB_SYS;
  ------------------
  |  |   74|      0|#define ERR_LIB_SYS 2
  ------------------
  247|    409|    return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  228|    409|#define ERR_LIB_OFFSET 23L
  ------------------
                  return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  229|    409|#define ERR_LIB_MASK 0xFF
  ------------------
  248|    409|}
conf_mod.c:ERR_GET_REASON:
  258|      1|{
  259|      1|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  241|      1|#define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  220|      1|#define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (241:35): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  260|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  221|      0|#define ERR_SYSTEM_MASK ((unsigned int)INT_MAX)
  ------------------
  261|      1|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  232|      1|#define ERR_REASON_MASK 0X7FFFFF
  ------------------
  262|      1|}
err.c:ERR_GET_LIB:
  244|  8.14k|{
  245|  8.14k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  241|  8.14k|#define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  220|  8.14k|#define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (241:35): [True: 46, False: 8.09k]
  |  |  ------------------
  ------------------
  246|     46|        return ERR_LIB_SYS;
  ------------------
  |  |   74|     46|#define ERR_LIB_SYS 2
  ------------------
  247|  8.09k|    return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  228|  8.09k|#define ERR_LIB_OFFSET 23L
  ------------------
                  return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
  ------------------
  |  |  229|  8.09k|#define ERR_LIB_MASK 0xFF
  ------------------
  248|  8.14k|}
err.c:ERR_GET_REASON:
  258|  1.29k|{
  259|  1.29k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  241|  1.29k|#define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  220|  1.29k|#define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (241:35): [True: 23, False: 1.27k]
  |  |  ------------------
  ------------------
  260|     23|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  221|     23|#define ERR_SYSTEM_MASK ((unsigned int)INT_MAX)
  ------------------
  261|  1.27k|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  232|  1.27k|#define ERR_REASON_MASK 0X7FFFFF
  ------------------
  262|  1.29k|}
pem_info.c:ERR_GET_REASON:
  258|  2.83k|{
  259|  2.83k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  241|  2.83k|#define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  220|  2.83k|#define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (241:35): [True: 0, False: 2.83k]
  |  |  ------------------
  ------------------
  260|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  221|      0|#define ERR_SYSTEM_MASK ((unsigned int)INT_MAX)
  ------------------
  261|  2.83k|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  232|  2.83k|#define ERR_REASON_MASK 0X7FFFFF
  ------------------
  262|  2.83k|}
pem_lib.c:ERR_GET_REASON:
  258|  2.43k|{
  259|  2.43k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  241|  2.43k|#define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  220|  2.43k|#define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (241:35): [True: 0, False: 2.43k]
  |  |  ------------------
  ------------------
  260|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  221|      0|#define ERR_SYSTEM_MASK ((unsigned int)INT_MAX)
  ------------------
  261|  2.43k|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  232|  2.43k|#define ERR_REASON_MASK 0X7FFFFF
  ------------------
  262|  2.43k|}
by_file.c:ERR_GET_REASON:
  258|  2.42k|{
  259|  2.42k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  241|  2.42k|#define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  220|  2.42k|#define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (241:35): [True: 0, False: 2.42k]
  |  |  ------------------
  ------------------
  260|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  221|      0|#define ERR_SYSTEM_MASK ((unsigned int)INT_MAX)
  ------------------
  261|  2.42k|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  232|  2.42k|#define ERR_REASON_MASK 0X7FFFFF
  ------------------
  262|  2.42k|}
a_d2i_fp.c:ERR_GET_REASON:
  258|   824k|{
  259|   824k|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  241|   824k|#define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  220|   824k|#define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (241:35): [True: 0, False: 824k]
  |  |  ------------------
  ------------------
  260|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  221|      0|#define ERR_SYSTEM_MASK ((unsigned int)INT_MAX)
  ------------------
  261|   824k|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  232|   824k|#define ERR_REASON_MASK 0X7FFFFF
  ------------------
  262|   824k|}
conf_def.c:ERR_GET_REASON:
  258|    787|{
  259|    787|    if (ERR_SYSTEM_ERROR(errcode))
  ------------------
  |  |  241|    787|#define ERR_SYSTEM_ERROR(errcode) (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  220|    787|#define ERR_SYSTEM_FLAG ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (241:35): [True: 0, False: 787]
  |  |  ------------------
  ------------------
  260|      0|        return errcode & ERR_SYSTEM_MASK;
  ------------------
  |  |  221|      0|#define ERR_SYSTEM_MASK ((unsigned int)INT_MAX)
  ------------------
  261|    787|    return errcode & ERR_REASON_MASK;
  ------------------
  |  |  232|    787|#define ERR_REASON_MASK 0X7FFFFF
  ------------------
  262|    787|}

ssl_lib.c:lh_SSL_SESSION_new:
  334|  2.56k|    {                                                                                                                      \
  335|  2.56k|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  336|  2.56k|            lh_##type##_hfn_thunk, lh_##type##_cfn_thunk,                                                                  \
  337|  2.56k|            lh_##type##_doall_thunk,                                                                                       \
  338|  2.56k|            lh_##type##_doall_arg_thunk);                                                                                  \
  339|  2.56k|    }                                                                                                                      \
ssl_lib.c:lh_SSL_SESSION_hfn_thunk:
  260|     38|    {                                                                                                                      \
  261|     38|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn;                                    \
  262|     38|        return hfn_conv((const type *)data);                                                                               \
  263|     38|    }                                                                                                                      \
ssl_lib.c:lh_SSL_SESSION_free:
  271|  2.56k|    {                                                                                                                      \
  272|  2.56k|        OPENSSL_LH_free((OPENSSL_LHASH *)lh);                                                                              \
  273|  2.56k|    }                                                                                                                      \
ssl_sess.c:lh_SSL_SESSION_retrieve:
  291|     38|    {                                                                                                                      \
  292|     38|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d);                                                        \
  293|     38|    }                                                                                                                      \
ssl_sess.c:lh_SSL_SESSION_get_down_load:
  306|  2.56k|    {                                                                                                                      \
  307|  2.56k|        return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh);                                                              \
  308|  2.56k|    }                                                                                                                      \
ssl_sess.c:lh_SSL_SESSION_set_down_load:
  311|  5.12k|    {                                                                                                                      \
  312|  5.12k|        OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl);                                                                 \
  313|  5.12k|    }                                                                                                                      \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_new:
  334|    787|    {                                                                                                                      \
  335|    787|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  336|    787|            lh_##type##_hfn_thunk, lh_##type##_cfn_thunk,                                                                  \
  337|    787|            lh_##type##_doall_thunk,                                                                                       \
  338|    787|            lh_##type##_doall_arg_thunk);                                                                                  \
  339|    787|    }                                                                                                                      \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_hfn_thunk:
  260|   412k|    {                                                                                                                      \
  261|   412k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn;                                    \
  262|   412k|        return hfn_conv((const type *)data);                                                                               \
  263|   412k|    }                                                                                                                      \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_cfn_thunk:
  265|   412k|    {                                                                                                                      \
  266|   412k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn;                            \
  267|   412k|        return cfn_conv((const type *)da, (const type *)db);                                                               \
  268|   412k|    }                                                                                                                      \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_doall_thunk:
  316|      2|    {                                                                                                                      \
  317|      2|        void (*doall_conv)(type *) = (void (*)(type *))doall;                                                              \
  318|      2|        doall_conv((type *)node);                                                                                          \
  319|      2|    }                                                                                                                      \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_doall:
  328|  2.08k|    {                                                                                                                      \
  329|  2.08k|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall);                                               \
  330|  2.08k|    }                                                                                                                      \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_free:
  271|    787|    {                                                                                                                      \
  272|    787|        OPENSSL_LH_free((OPENSSL_LHASH *)lh);                                                                              \
  273|    787|    }                                                                                                                      \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_flush:
  276|  1.29k|    {                                                                                                                      \
  277|  1.29k|        OPENSSL_LH_flush((OPENSSL_LHASH *)lh);                                                                             \
  278|  1.29k|    }                                                                                                                      \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_retrieve:
  291|   412k|    {                                                                                                                      \
  292|   412k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d);                                                        \
  293|   412k|    }                                                                                                                      \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_insert:
  281|      2|    {                                                                                                                      \
  282|      2|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d);                                                          \
  283|      2|    }                                                                                                                      \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_error:
  296|      2|    {                                                                                                                      \
  297|      2|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh);                                                                      \
  298|      2|    }                                                                                                                      \
err.c:ossl_check_ERR_STRING_DATA_lh_type:
  208|  6.20k|    {                                                                                                          \
  209|  6.20k|        return (OPENSSL_LHASH *)lh;                                                                            \
  210|  6.20k|    }                                                                                                          \
err.c:ossl_check_ERR_STRING_DATA_lh_hashfunc_type:
  218|      1|    {                                                                                                          \
  219|      1|        return (OPENSSL_LH_HASHFUNC)hfn;                                                                       \
  220|      1|    }                                                                                                          \
err.c:ossl_check_ERR_STRING_DATA_lh_compfunc_type:
  213|      1|    {                                                                                                          \
  214|      1|        return (OPENSSL_LH_COMPFUNC)cmp;                                                                       \
  215|      1|    }                                                                                                          \
err.c:lh_ERR_STRING_DATA_hash_thunk:
  172|  6.20k|    {                                                                                                          \
  173|  6.20k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn;                        \
  174|  6.20k|        return hfn_conv((const type *)data);                                                                   \
  175|  6.20k|    }                                                                                                          \
err.c:lh_ERR_STRING_DATA_comp_thunk:
  177|  4.61k|    {                                                                                                          \
  178|  4.61k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn;                \
  179|  4.61k|        return cfn_conv((const type *)da, (const type *)db);                                                   \
  180|  4.61k|    }                                                                                                          \
err.c:ossl_check_ERR_STRING_DATA_lh_plain_type:
  193|  4.85k|    {                                                                                                          \
  194|  4.85k|        return ptr;                                                                                            \
  195|  4.85k|    }                                                                                                          \
err.c:ossl_check_const_ERR_STRING_DATA_lh_plain_type:
  198|  1.34k|    {                                                                                                          \
  199|  1.34k|        return ptr;                                                                                            \
  200|  1.34k|    }                                                                                                          \
o_names.c:lh_OBJ_NAME_new:
  334|      1|    {                                                                                                                      \
  335|      1|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  336|      1|            lh_##type##_hfn_thunk, lh_##type##_cfn_thunk,                                                                  \
  337|      1|            lh_##type##_doall_thunk,                                                                                       \
  338|      1|            lh_##type##_doall_arg_thunk);                                                                                  \
  339|      1|    }                                                                                                                      \
o_names.c:lh_OBJ_NAME_hfn_thunk:
  260|   685k|    {                                                                                                                      \
  261|   685k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn;                                    \
  262|   685k|        return hfn_conv((const type *)data);                                                                               \
  263|   685k|    }                                                                                                                      \
o_names.c:lh_OBJ_NAME_cfn_thunk:
  265|   586k|    {                                                                                                                      \
  266|   586k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn;                            \
  267|   586k|        return cfn_conv((const type *)da, (const type *)db);                                                               \
  268|   586k|    }                                                                                                                      \
o_names.c:lh_OBJ_NAME_doall_thunk:
  316|    543|    {                                                                                                                      \
  317|    543|        void (*doall_conv)(type *) = (void (*)(type *))doall;                                                              \
  318|    543|        doall_conv((type *)node);                                                                                          \
  319|    543|    }                                                                                                                      \
o_names.c:lh_OBJ_NAME_retrieve:
  291|   684k|    {                                                                                                                      \
  292|   684k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d);                                                        \
  293|   684k|    }                                                                                                                      \
o_names.c:lh_OBJ_NAME_insert:
  281|    424|    {                                                                                                                      \
  282|    424|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d);                                                          \
  283|    424|    }                                                                                                                      \
o_names.c:lh_OBJ_NAME_error:
  296|    242|    {                                                                                                                      \
  297|    242|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh);                                                                      \
  298|    242|    }                                                                                                                      \
o_names.c:lh_OBJ_NAME_delete:
  286|    242|    {                                                                                                                      \
  287|    242|        return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d);                                                          \
  288|    242|    }                                                                                                                      \
o_names.c:lh_OBJ_NAME_doall_OBJ_DOALL:
  371|  1.26k|    {                                                                                       \
  372|  1.26k|        OPENSSL_LH_doall_arg_thunk((OPENSSL_LHASH *)lh,                                     \
  373|  1.26k|            lh_##type##_doall_##argtype##_thunk,                                            \
  374|  1.26k|            (OPENSSL_LH_DOALL_FUNCARG)fn,                                                   \
  375|  1.26k|            (void *)arg);                                                                   \
  376|  1.26k|    }                                                                                       \
o_names.c:lh_OBJ_NAME_doall_OBJ_DOALL_thunk:
  363|   305k|    {                                                                                       \
  364|   305k|        void (*fn_conv)(cbargtype *, argtype *) = (void (*)(cbargtype *, argtype *))fn;     \
  365|   305k|        fn_conv((cbargtype *)node, (argtype *)arg);                                         \
  366|   305k|    }                                                                                       \
o_names.c:lh_OBJ_NAME_get_down_load:
  306|      4|    {                                                                                                                      \
  307|      4|        return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh);                                                              \
  308|      4|    }                                                                                                                      \
o_names.c:lh_OBJ_NAME_set_down_load:
  311|      7|    {                                                                                                                      \
  312|      7|        OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl);                                                                 \
  313|      7|    }                                                                                                                      \
o_names.c:lh_OBJ_NAME_doall:
  328|      4|    {                                                                                                                      \
  329|      4|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall);                                               \
  330|      4|    }                                                                                                                      \
o_names.c:lh_OBJ_NAME_free:
  271|      1|    {                                                                                                                      \
  272|      1|        OPENSSL_LH_free((OPENSSL_LHASH *)lh);                                                                              \
  273|      1|    }                                                                                                                      \
obj_dat.c:lh_ADDED_OBJ_set_down_load:
  311|      1|    {                                                                                                                      \
  312|      1|        OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl);                                                                 \
  313|      1|    }                                                                                                                      \
obj_dat.c:lh_ADDED_OBJ_doall:
  328|      3|    {                                                                                                                      \
  329|      3|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall);                                               \
  330|      3|    }                                                                                                                      \
obj_dat.c:lh_ADDED_OBJ_free:
  271|      1|    {                                                                                                                      \
  272|      1|        OPENSSL_LH_free((OPENSSL_LHASH *)lh);                                                                              \
  273|      1|    }                                                                                                                      \
obj_dat.c:lh_ADDED_OBJ_new:
  334|      1|    {                                                                                                                      \
  335|      1|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  336|      1|            lh_##type##_hfn_thunk, lh_##type##_cfn_thunk,                                                                  \
  337|      1|            lh_##type##_doall_thunk,                                                                                       \
  338|      1|            lh_##type##_doall_arg_thunk);                                                                                  \
  339|      1|    }                                                                                                                      \
obj_dat.c:lh_ADDED_OBJ_hfn_thunk:
  260|   492k|    {                                                                                                                      \
  261|   492k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn;                                    \
  262|   492k|        return hfn_conv((const type *)data);                                                                               \
  263|   492k|    }                                                                                                                      \
obj_dat.c:lh_ADDED_OBJ_retrieve:
  291|   492k|    {                                                                                                                      \
  292|   492k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d);                                                        \
  293|   492k|    }                                                                                                                      \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_doall:
  328|    787|    {                                                                                                                      \
  329|    787|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall);                                               \
  330|    787|    }                                                                                                                      \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_free:
  271|    787|    {                                                                                                                      \
  272|    787|        OPENSSL_LH_free((OPENSSL_LHASH *)lh);                                                                              \
  273|    787|    }                                                                                                                      \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_new:
  334|    787|    {                                                                                                                      \
  335|    787|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  336|    787|            lh_##type##_hfn_thunk, lh_##type##_cfn_thunk,                                                                  \
  337|    787|            lh_##type##_doall_thunk,                                                                                       \
  338|    787|            lh_##type##_doall_arg_thunk);                                                                                  \
  339|    787|    }                                                                                                                      \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_hfn_thunk:
  260|   171k|    {                                                                                                                      \
  261|   171k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn;                                    \
  262|   171k|        return hfn_conv((const type *)data);                                                                               \
  263|   171k|    }                                                                                                                      \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_cfn_thunk:
  265|   168k|    {                                                                                                                      \
  266|   168k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn;                            \
  267|   168k|        return cfn_conv((const type *)da, (const type *)db);                                                               \
  268|   168k|    }                                                                                                                      \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_doall_thunk:
  316|  1.17k|    {                                                                                                                      \
  317|  1.17k|        void (*doall_conv)(type *) = (void (*)(type *))doall;                                                              \
  318|  1.17k|        doall_conv((type *)node);                                                                                          \
  319|  1.17k|    }                                                                                                                      \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_retrieve:
  291|   170k|    {                                                                                                                      \
  292|   170k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d);                                                        \
  293|   170k|    }                                                                                                                      \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_insert:
  281|  1.17k|    {                                                                                                                      \
  282|  1.17k|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d);                                                          \
  283|  1.17k|    }                                                                                                                      \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_error:
  296|  1.17k|    {                                                                                                                      \
  297|  1.17k|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh);                                                                      \
  298|  1.17k|    }                                                                                                                      \
property.c:lh_QUERY_doall:
  328|   170k|    {                                                                                                                      \
  329|   170k|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall);                                               \
  330|   170k|    }                                                                                                                      \
property.c:lh_QUERY_free:
  271|   168k|    {                                                                                                                      \
  272|   168k|        OPENSSL_LH_free((OPENSSL_LHASH *)lh);                                                                              \
  273|   168k|    }                                                                                                                      \
property.c:lh_QUERY_new:
  334|   168k|    {                                                                                                                      \
  335|   168k|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  336|   168k|            lh_##type##_hfn_thunk, lh_##type##_cfn_thunk,                                                                  \
  337|   168k|            lh_##type##_doall_thunk,                                                                                       \
  338|   168k|            lh_##type##_doall_arg_thunk);                                                                                  \
  339|   168k|    }                                                                                                                      \
property.c:lh_QUERY_hfn_thunk:
  260|   695k|    {                                                                                                                      \
  261|   695k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn;                                    \
  262|   695k|        return hfn_conv((const type *)data);                                                                               \
  263|   695k|    }                                                                                                                      \
property.c:lh_QUERY_cfn_thunk:
  265|   636k|    {                                                                                                                      \
  266|   636k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn;                            \
  267|   636k|        return cfn_conv((const type *)da, (const type *)db);                                                               \
  268|   636k|    }                                                                                                                      \
property.c:lh_QUERY_doall_thunk:
  316|  27.5k|    {                                                                                                                      \
  317|  27.5k|        void (*doall_conv)(type *) = (void (*)(type *))doall;                                                              \
  318|  27.5k|        doall_conv((type *)node);                                                                                          \
  319|  27.5k|    }                                                                                                                      \
property.c:lh_QUERY_num_items:
  301|  1.10k|    {                                                                                                                      \
  302|  1.10k|        return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh);                                                                  \
  303|  1.10k|    }                                                                                                                      \
property.c:lh_QUERY_flush:
  276|  1.10k|    {                                                                                                                      \
  277|  1.10k|        OPENSSL_LH_flush((OPENSSL_LHASH *)lh);                                                                             \
  278|  1.10k|    }                                                                                                                      \
property.c:lh_QUERY_retrieve:
  291|   668k|    {                                                                                                                      \
  292|   668k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d);                                                        \
  293|   668k|    }                                                                                                                      \
property.c:lh_QUERY_insert:
  281|  27.5k|    {                                                                                                                      \
  282|  27.5k|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d);                                                          \
  283|  27.5k|    }                                                                                                                      \
property.c:lh_QUERY_error:
  296|  27.5k|    {                                                                                                                      \
  297|  27.5k|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh);                                                                      \
  298|  27.5k|    }                                                                                                                      \
property_string.c:lh_PROPERTY_STRING_doall:
  328|  1.57k|    {                                                                                                                      \
  329|  1.57k|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall);                                               \
  330|  1.57k|    }                                                                                                                      \
property_string.c:lh_PROPERTY_STRING_free:
  271|  1.57k|    {                                                                                                                      \
  272|  1.57k|        OPENSSL_LH_free((OPENSSL_LHASH *)lh);                                                                              \
  273|  1.57k|    }                                                                                                                      \
property_string.c:lh_PROPERTY_STRING_new:
  334|  1.57k|    {                                                                                                                      \
  335|  1.57k|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  336|  1.57k|            lh_##type##_hfn_thunk, lh_##type##_cfn_thunk,                                                                  \
  337|  1.57k|            lh_##type##_doall_thunk,                                                                                       \
  338|  1.57k|            lh_##type##_doall_arg_thunk);                                                                                  \
  339|  1.57k|    }                                                                                                                      \
property_string.c:lh_PROPERTY_STRING_hfn_thunk:
  260|   297k|    {                                                                                                                      \
  261|   297k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn;                                    \
  262|   297k|        return hfn_conv((const type *)data);                                                                               \
  263|   297k|    }                                                                                                                      \
property_string.c:lh_PROPERTY_STRING_cfn_thunk:
  265|  95.4k|    {                                                                                                                      \
  266|  95.4k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn;                            \
  267|  95.4k|        return cfn_conv((const type *)da, (const type *)db);                                                               \
  268|  95.4k|    }                                                                                                                      \
property_string.c:lh_PROPERTY_STRING_doall_thunk:
  316|  8.87k|    {                                                                                                                      \
  317|  8.87k|        void (*doall_conv)(type *) = (void (*)(type *))doall;                                                              \
  318|  8.87k|        doall_conv((type *)node);                                                                                          \
  319|  8.87k|    }                                                                                                                      \
property_string.c:lh_PROPERTY_STRING_retrieve:
  291|   288k|    {                                                                                                                      \
  292|   288k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d);                                                        \
  293|   288k|    }                                                                                                                      \
property_string.c:lh_PROPERTY_STRING_insert:
  281|  8.87k|    {                                                                                                                      \
  282|  8.87k|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d);                                                          \
  283|  8.87k|    }                                                                                                                      \
property_string.c:lh_PROPERTY_STRING_error:
  296|  8.87k|    {                                                                                                                      \
  297|  8.87k|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh);                                                                      \
  298|  8.87k|    }                                                                                                                      \
store_register.c:lh_OSSL_STORE_LOADER_free:
  271|      1|    {                                                                                                                      \
  272|      1|        OPENSSL_LH_free((OPENSSL_LHASH *)lh);                                                                              \
  273|      1|    }                                                                                                                      \
eng_table.c:lh_ENGINE_PILE_new:
  334|      1|    {                                                                                                                      \
  335|      1|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  336|      1|            lh_##type##_hfn_thunk, lh_##type##_cfn_thunk,                                                                  \
  337|      1|            lh_##type##_doall_thunk,                                                                                       \
  338|      1|            lh_##type##_doall_arg_thunk);                                                                                  \
  339|      1|    }                                                                                                                      \
eng_table.c:lh_ENGINE_PILE_hfn_thunk:
  260|      4|    {                                                                                                                      \
  261|      4|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn;                                    \
  262|      4|        return hfn_conv((const type *)data);                                                                               \
  263|      4|    }                                                                                                                      \
eng_table.c:lh_ENGINE_PILE_cfn_thunk:
  265|      2|    {                                                                                                                      \
  266|      2|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn;                            \
  267|      2|        return cfn_conv((const type *)da, (const type *)db);                                                               \
  268|      2|    }                                                                                                                      \
eng_table.c:lh_ENGINE_PILE_doall_thunk:
  316|      1|    {                                                                                                                      \
  317|      1|        void (*doall_conv)(type *) = (void (*)(type *))doall;                                                              \
  318|      1|        doall_conv((type *)node);                                                                                          \
  319|      1|    }                                                                                                                      \
eng_table.c:lh_ENGINE_PILE_free:
  271|      1|    {                                                                                                                      \
  272|      1|        OPENSSL_LH_free((OPENSSL_LHASH *)lh);                                                                              \
  273|      1|    }                                                                                                                      \
eng_table.c:lh_ENGINE_PILE_retrieve:
  291|      3|    {                                                                                                                      \
  292|      3|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d);                                                        \
  293|      3|    }                                                                                                                      \
eng_table.c:lh_ENGINE_PILE_insert:
  281|      1|    {                                                                                                                      \
  282|      1|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d);                                                          \
  283|      1|    }                                                                                                                      \
eng_table.c:lh_ENGINE_PILE_doall:
  328|      1|    {                                                                                                                      \
  329|      1|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall);                                               \
  330|      1|    }                                                                                                                      \

OBJ_bsearch_ssl_cipher_id:
  142|     91|    {                                                                  \
  143|     91|        return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2),    \
  144|     91|            nm##_cmp_BSEARCH_CMP_FN);                                  \
  145|     91|    }                                                                  \
ssl_lib.c:ssl_cipher_id_cmp_BSEARCH_CMP_FN:
  136|    411|    {                                                                  \
  137|    411|        type1 const *a = a_;                                           \
  138|    411|        type2 const *b = b_;                                           \
  139|    411|        return nm##_cmp(a, b);                                         \
  140|    411|    }                                                                  \
ameth_lib.c:OBJ_bsearch_ameth:
  128|  1.05M|    {                                                                      \
  129|  1.05M|        return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2),        \
  130|  1.05M|            nm##_cmp_BSEARCH_CMP_FN);                                      \
  131|  1.05M|    }                                                                      \
ameth_lib.c:ameth_cmp_BSEARCH_CMP_FN:
  122|  3.18M|    {                                                                      \
  123|  3.18M|        type1 const *a = a_;                                               \
  124|  3.18M|        type2 const *b = b_;                                               \
  125|  3.18M|        return nm##_cmp(a, b);                                             \
  126|  3.18M|    }                                                                      \
obj_dat.c:OBJ_bsearch_ln:
  128|   100k|    {                                                                      \
  129|   100k|        return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2),        \
  130|   100k|            nm##_cmp_BSEARCH_CMP_FN);                                      \
  131|   100k|    }                                                                      \
obj_dat.c:ln_cmp_BSEARCH_CMP_FN:
  122|  1.01M|    {                                                                      \
  123|  1.01M|        type1 const *a = a_;                                               \
  124|  1.01M|        type2 const *b = b_;                                               \
  125|  1.01M|        return nm##_cmp(a, b);                                             \
  126|  1.01M|    }                                                                      \
obj_dat.c:OBJ_bsearch_sn:
  128|   110k|    {                                                                      \
  129|   110k|        return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2),        \
  130|   110k|            nm##_cmp_BSEARCH_CMP_FN);                                      \
  131|   110k|    }                                                                      \
obj_dat.c:sn_cmp_BSEARCH_CMP_FN:
  122|  1.18M|    {                                                                      \
  123|  1.18M|        type1 const *a = a_;                                               \
  124|  1.18M|        type2 const *b = b_;                                               \
  125|  1.18M|        return nm##_cmp(a, b);                                             \
  126|  1.18M|    }                                                                      \
obj_dat.c:OBJ_bsearch_obj:
  128|  7.14M|    {                                                                      \
  129|  7.14M|        return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2),        \
  130|  7.14M|            nm##_cmp_BSEARCH_CMP_FN);                                      \
  131|  7.14M|    }                                                                      \
obj_dat.c:obj_cmp_BSEARCH_CMP_FN:
  122|  70.8M|    {                                                                      \
  123|  70.8M|        type1 const *a = a_;                                               \
  124|  70.8M|        type2 const *b = b_;                                               \
  125|  70.8M|        return nm##_cmp(a, b);                                             \
  126|  70.8M|    }                                                                      \
obj_xref.c:OBJ_bsearch_sig:
  128|   684k|    {                                                                      \
  129|   684k|        return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2),        \
  130|   684k|            nm##_cmp_BSEARCH_CMP_FN);                                      \
  131|   684k|    }                                                                      \
obj_xref.c:sig_cmp_BSEARCH_CMP_FN:
  122|  3.50M|    {                                                                      \
  123|  3.50M|        type1 const *a = a_;                                               \
  124|  3.50M|        type2 const *b = b_;                                               \
  125|  3.50M|        return nm##_cmp(a, b);                                             \
  126|  3.50M|    }                                                                      \
v3_lib.c:OBJ_bsearch_ext:
  128|  1.11M|    {                                                                      \
  129|  1.11M|        return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2),        \
  130|  1.11M|            nm##_cmp_BSEARCH_CMP_FN);                                      \
  131|  1.11M|    }                                                                      \
v3_lib.c:ext_cmp_BSEARCH_CMP_FN:
  122|  5.62M|    {                                                                      \
  123|  5.62M|        type1 const *a = a_;                                               \
  124|  5.62M|        type2 const *b = b_;                                               \
  125|  5.62M|        return nm##_cmp(a, b);                                             \
  126|  5.62M|    }                                                                      \
v3_purp.c:OBJ_bsearch_nid:
  128|   644k|    {                                                                      \
  129|   644k|        return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2),        \
  130|   644k|            nm##_cmp_BSEARCH_CMP_FN);                                      \
  131|   644k|    }                                                                      \
v3_purp.c:nid_cmp_BSEARCH_CMP_FN:
  122|  1.60M|    {                                                                      \
  123|  1.60M|        type1 const *a = a_;                                               \
  124|  1.60M|        type2 const *b = b_;                                               \
  125|  1.60M|        return nm##_cmp(a, b);                                             \
  126|  1.60M|    }                                                                      \

PEM_read_bio_X509_AUX:
  151|      3|    {                                                                \
  152|      3|        return PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str, bp, \
  153|      3|            (void **)x, cb, u);                                      \
  154|      3|    }
PEM_read_bio_X509_CRL:
  151|  2.42k|    {                                                                \
  152|  2.42k|        return PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str, bp, \
  153|  2.42k|            (void **)x, cb, u);                                      \
  154|  2.42k|    }

s3_lib.c:ossl_check_X509_NAME_sk_type:
   55|  8.85k|    {                                                                                                           \
   56|  8.85k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  8.85k|    }                                                                                                           \
s3_lib.c:ossl_check_X509_NAME_freefunc_type:
   67|  8.85k|    {                                                                                                           \
   68|  8.85k|        return (OPENSSL_sk_freefunc)fr;                                                                         \
   69|  8.85k|    }
ssl_ciph.c:ossl_check_const_SSL_CIPHER_sk_type:
   51|  28.2k|    {                                                                                                           \
   52|  28.2k|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|  28.2k|    }                                                                                                           \
ssl_ciph.c:ossl_check_SSL_CIPHER_sk_type:
   55|   186k|    {                                                                                                           \
   56|   186k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|   186k|    }                                                                                                           \
ssl_ciph.c:ossl_check_SSL_CIPHER_type:
   47|   171k|    {                                                                                                           \
   48|   171k|        return ptr;                                                                                             \
   49|   171k|    }                                                                                                           \
ssl_ciph.c:ossl_check_SSL_CIPHER_compfunc_type:
   59|  3.15k|    {                                                                                                           \
   60|  3.15k|        return (OPENSSL_sk_compfunc)cmp;                                                                        \
   61|  3.15k|    }                                                                                                           \
ssl_lib.c:ossl_check_const_SSL_CIPHER_sk_type:
   51|   446k|    {                                                                                                           \
   52|   446k|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|   446k|    }                                                                                                           \
ssl_lib.c:sk_danetls_record_pop_free:
  147|  1.77k|    {                                                                                                                      \
  148|  1.77k|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|  1.77k|                                                                                                                           \
  150|  1.77k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|  1.77k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|  1.77k|                                                                                                                           \
  153|  1.77k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|  1.77k|    }                                                                                                                      \
ssl_lib.c:ossl_check_SSL_CIPHER_sk_type:
   55|   116k|    {                                                                                                           \
   56|   116k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|   116k|    }                                                                                                           \
ssl_lib.c:ossl_check_X509_EXTENSION_sk_type:
   55|  1.77k|    {                                                                                                           \
   56|  1.77k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  1.77k|    }                                                                                                           \
ssl_lib.c:ossl_check_X509_EXTENSION_freefunc_type:
   67|  1.77k|    {                                                                                                           \
   68|  1.77k|        return (OPENSSL_sk_freefunc)fr;                                                                         \
   69|  1.77k|    }
ssl_lib.c:ossl_check_OCSP_RESPID_sk_type:
   55|  1.77k|    {                                                                                                           \
   56|  1.77k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  1.77k|    }                                                                                                           \
ssl_lib.c:ossl_check_OCSP_RESPID_freefunc_type:
   67|  1.77k|    {                                                                                                           \
   68|  1.77k|        return (OPENSSL_sk_freefunc)fr;                                                                         \
   69|  1.77k|    }
ssl_lib.c:sk_OCSP_RESPONSE_pop_free:
  147|  1.77k|    {                                                                                                                      \
  148|  1.77k|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|  1.77k|                                                                                                                           \
  150|  1.77k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|  1.77k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|  1.77k|                                                                                                                           \
  153|  1.77k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|  1.77k|    }                                                                                                                      \
ssl_lib.c:ossl_check_X509_NAME_sk_type:
   55|  8.66k|    {                                                                                                           \
   56|  8.66k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  8.66k|    }                                                                                                           \
ssl_lib.c:ossl_check_X509_NAME_freefunc_type:
   67|  8.66k|    {                                                                                                           \
   68|  8.66k|        return (OPENSSL_sk_freefunc)fr;                                                                         \
   69|  8.66k|    }
ssl_lib.c:ossl_check_SRTP_PROTECTION_PROFILE_sk_type:
   55|  4.33k|    {                                                                                                           \
   56|  4.33k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  4.33k|    }                                                                                                           \
ssl_lib.c:ossl_check_SSL_CIPHER_type:
   47|   101k|    {                                                                                                           \
   48|   101k|        return ptr;                                                                                             \
   49|   101k|    }                                                                                                           \
ssl_sess.c:sk_SSL_SESSION_new_null:
   98|  2.56k|    {                                                                                                                      \
   99|  2.56k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null();                                                                      \
  100|  2.56k|    }                                                                                                                      \
ssl_sess.c:sk_SSL_SESSION_pop_free:
  147|  2.56k|    {                                                                                                                      \
  148|  2.56k|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|  2.56k|                                                                                                                           \
  150|  2.56k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|  2.56k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|  2.56k|                                                                                                                           \
  153|  2.56k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|  2.56k|    }                                                                                                                      \
extensions.c:sk_OCSP_RESPONSE_pop_free:
  147|     74|    {                                                                                                                      \
  148|     74|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|     74|                                                                                                                           \
  150|     74|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|     74|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|     74|                                                                                                                           \
  153|     74|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|     74|    }                                                                                                                      \
extensions.c:ossl_check_const_X509_NAME_sk_type:
   51|  1.63k|    {                                                                                                           \
   52|  1.63k|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|  1.63k|    }                                                                                                           \
extensions_clnt.c:ossl_check_const_SSL_CIPHER_sk_type:
   51|  6.87k|    {                                                                                                           \
   52|  6.87k|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|  6.87k|    }                                                                                                           \
extensions_clnt.c:ossl_check_SSL_CIPHER_sk_type:
   55|  3.39k|    {                                                                                                           \
   56|  3.39k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  3.39k|    }                                                                                                           \
extensions_clnt.c:ossl_check_const_OCSP_RESPID_sk_type:
   51|      2|    {                                                                                                           \
   52|      2|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|      2|    }                                                                                                           \
statem_clnt.c:ossl_check_SSL_CIPHER_sk_type:
   55|     20|    {                                                                                                           \
   56|     20|        return (OPENSSL_STACK *)sk;                                                                             \
   57|     20|    }                                                                                                           \
statem_clnt.c:ossl_check_SSL_CIPHER_type:
   47|     20|    {                                                                                                           \
   48|     20|        return ptr;                                                                                             \
   49|     20|    }                                                                                                           \
statem_clnt.c:ossl_check_const_SSL_CIPHER_sk_type:
   51|   212k|    {                                                                                                           \
   52|   212k|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|   212k|    }                                                                                                           \
tasn_dec.c:ossl_check_ASN1_VALUE_sk_type:
   55|  7.49M|    {                                                                                                           \
   56|  7.49M|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  7.49M|    }                                                                                                           \
tasn_dec.c:ossl_check_ASN1_VALUE_type:
   47|  7.49M|    {                                                                                                           \
   48|  7.49M|        return ptr;                                                                                             \
   49|  7.49M|    }                                                                                                           \
tasn_enc.c:sk_const_ASN1_VALUE_num:
   82|  20.9M|    {                                                                                                                      \
   83|  20.9M|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|  20.9M|    }                                                                                                                      \
tasn_enc.c:sk_const_ASN1_VALUE_value:
   86|  8.96M|    {                                                                                                                      \
   87|  8.96M|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);                                                     \
   88|  8.96M|    }                                                                                                                      \
tasn_fre.c:ossl_check_const_ASN1_VALUE_sk_type:
   51|  5.35M|    {                                                                                                           \
   52|  5.35M|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|  5.35M|    }                                                                                                           \
tasn_fre.c:ossl_check_ASN1_VALUE_sk_type:
   55|  2.31M|    {                                                                                                           \
   56|  2.31M|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  2.31M|    }                                                                                                           \
conf_mod.c:sk_CONF_IMODULE_free:
  114|      2|    {                                                                                                                      \
  115|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk);                                                                              \
  116|      2|    }                                                                                                                      \
conf_mod.c:sk_CONF_MODULE_dup:
  184|      1|    {                                                                                                                      \
  185|      1|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk);                                                  \
  186|      1|    }                                                                                                                      \
conf_mod.c:sk_CONF_MODULE_new_null:
   98|      1|    {                                                                                                                      \
   99|      1|        return (STACK_OF(t1) *)OPENSSL_sk_new_null();                                                                      \
  100|      1|    }                                                                                                                      \
conf_mod.c:sk_CONF_MODULE_num:
   82|      2|    {                                                                                                                      \
   83|      2|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|      2|    }                                                                                                                      \
conf_mod.c:sk_CONF_MODULE_free:
  114|      3|    {                                                                                                                      \
  115|      3|        OPENSSL_sk_free((OPENSSL_STACK *)sk);                                                                              \
  116|      3|    }                                                                                                                      \
conf_mod.c:sk_CONF_MODULE_pop_free:
  147|      1|    {                                                                                                                      \
  148|      1|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|      1|                                                                                                                           \
  150|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|      1|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|      1|                                                                                                                           \
  153|      1|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|      1|    }                                                                                                                      \
conf_mod.c:sk_CONF_IMODULE_num:
   82|      1|    {                                                                                                                      \
   83|      1|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|      1|    }                                                                                                                      \
ct_log.c:ossl_check_CTLOG_sk_type:
   55|  2.56k|    {                                                                                                           \
   56|  2.56k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  2.56k|    }                                                                                                           \
ct_log.c:ossl_check_CTLOG_freefunc_type:
   67|  2.56k|    {                                                                                                           \
   68|  2.56k|        return (OPENSSL_sk_freefunc)fr;                                                                         \
   69|  2.56k|    }
ct_sct.c:ossl_check_SCT_sk_type:
   55|  1.77k|    {                                                                                                           \
   56|  1.77k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  1.77k|    }                                                                                                           \
ct_sct.c:ossl_check_SCT_freefunc_type:
   67|  1.77k|    {                                                                                                           \
   68|  1.77k|        return (OPENSSL_sk_freefunc)fr;                                                                         \
   69|  1.77k|    }
dso_lib.c:ossl_check_void_sk_type:
   55|    952|    {                                                                                                           \
   56|    952|        return (OPENSSL_STACK *)sk;                                                                             \
   57|    952|    }                                                                                                           \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_new_null:
   98|      2|    {                                                                                                                      \
   99|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null();                                                                      \
  100|      2|    }                                                                                                                      \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_push:
  131|     11|    {                                                                                                                      \
  132|     11|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  133|     11|    }                                                                                                                      \
decoder_lib.c:sk_OSSL_DECODER_new_null:
   98|      2|    {                                                                                                                      \
   99|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null();                                                                      \
  100|      2|    }                                                                                                                      \
decoder_lib.c:sk_OSSL_DECODER_push:
  131|    152|    {                                                                                                                      \
  132|    152|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  133|    152|    }                                                                                                                      \
decoder_lib.c:sk_OSSL_DECODER_num:
   82|      2|    {                                                                                                                      \
   83|      2|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|      2|    }                                                                                                                      \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_num:
   82|   824k|    {                                                                                                                      \
   83|   824k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|   824k|    }                                                                                                                      \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_set_cmp_func:
  196|      4|    {                                                                                                                      \
  197|      4|        return (sk_##t1##_compfunc)OPENSSL_sk_set_cmp_func((OPENSSL_STACK *)sk, (OPENSSL_sk_compfunc)compare);             \
  198|      4|    }
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_value:
   86|  3.18M|    {                                                                                                                      \
   87|  3.18M|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);                                                     \
   88|  3.18M|    }                                                                                                                      \
decoder_lib.c:sk_OSSL_DECODER_INSTANCE_sort:
  176|      2|    {                                                                                                                      \
  177|      2|        OPENSSL_sk_sort((OPENSSL_STACK *)sk);                                                                              \
  178|      2|    }                                                                                                                      \
decoder_lib.c:sk_OSSL_DECODER_value:
   86|  1.67k|    {                                                                                                                      \
   87|  1.67k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);                                                     \
   88|  1.67k|    }                                                                                                                      \
decoder_lib.c:sk_OSSL_DECODER_pop_free:
  147|      2|    {                                                                                                                      \
  148|      2|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|      2|                                                                                                                           \
  150|      2|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|      2|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|      2|                                                                                                                           \
  153|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|      2|    }                                                                                                                      \
decoder_lib.c:sk_OSSL_DECODER_freefunc_thunk:
   77|    152|    {                                                                                                                      \
   78|    152|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc)freefunc_arg;                                                    \
   79|    152|        freefunc((t3 *)ptr);                                                                                               \
   80|    152|    }                                                                                                                      \
decoder_meth.c:sk_OSSL_DECODER_INSTANCE_pop_free:
  147|   412k|    {                                                                                                                      \
  148|   412k|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|   412k|                                                                                                                           \
  150|   412k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|   412k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|   412k|                                                                                                                           \
  153|   412k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|   412k|    }                                                                                                                      \
decoder_meth.c:sk_OSSL_DECODER_INSTANCE_freefunc_thunk:
   77|  2.36M|    {                                                                                                                      \
   78|  2.36M|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc)freefunc_arg;                                                    \
   79|  2.36M|        freefunc((t3 *)ptr);                                                                                               \
   80|  2.36M|    }                                                                                                                      \
decoder_pkey.c:sk_EVP_KEYMGMT_new_null:
   98|      2|    {                                                                                                                      \
   99|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null();                                                                      \
  100|      2|    }                                                                                                                      \
decoder_pkey.c:sk_EVP_KEYMGMT_push:
  131|      3|    {                                                                                                                      \
  132|      3|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  133|      3|    }                                                                                                                      \
decoder_pkey.c:sk_EVP_KEYMGMT_num:
   82|   412k|    {                                                                                                                      \
   83|   412k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|   412k|    }                                                                                                                      \
decoder_pkey.c:sk_EVP_KEYMGMT_value:
   86|   412k|    {                                                                                                                      \
   87|   412k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);                                                     \
   88|   412k|    }                                                                                                                      \
decoder_pkey.c:sk_EVP_KEYMGMT_pop_free:
  147|   412k|    {                                                                                                                      \
  148|   412k|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|   412k|                                                                                                                           \
  150|   412k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|   412k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|   412k|                                                                                                                           \
  153|   412k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|   412k|    }                                                                                                                      \
decoder_pkey.c:sk_EVP_KEYMGMT_freefunc_thunk:
   77|   525k|    {                                                                                                                      \
   78|   525k|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc)freefunc_arg;                                                    \
   79|   525k|        freefunc((t3 *)ptr);                                                                                               \
   80|   525k|    }                                                                                                                      \
decoder_pkey.c:sk_OSSL_DECODER_INSTANCE_deep_copy:
  190|   412k|    {                                                                                                                      \
  191|   412k|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk,                                             \
  192|   412k|            (OPENSSL_sk_copyfunc)copyfunc,                                                                                 \
  193|   412k|            (OPENSSL_sk_freefunc)freefunc);                                                                                \
  194|   412k|    }                                                                                                                      \
decoder_pkey.c:sk_EVP_KEYMGMT_deep_copy:
  190|   412k|    {                                                                                                                      \
  191|   412k|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk,                                             \
  192|   412k|            (OPENSSL_sk_copyfunc)copyfunc,                                                                                 \
  193|   412k|            (OPENSSL_sk_freefunc)freefunc);                                                                                \
  194|   412k|    }                                                                                                                      \
eng_lib.c:sk_ENGINE_CLEANUP_ITEM_new_null:
   98|      1|    {                                                                                                                      \
   99|      1|        return (STACK_OF(t1) *)OPENSSL_sk_new_null();                                                                      \
  100|      1|    }                                                                                                                      \
eng_lib.c:sk_ENGINE_CLEANUP_ITEM_insert:
  156|      1|    {                                                                                                                      \
  157|      1|        return OPENSSL_sk_insert((OPENSSL_STACK *)sk, (const void *)ptr, idx);                                             \
  158|      1|    }                                                                                                                      \
eng_lib.c:sk_ENGINE_CLEANUP_ITEM_push:
  131|      1|    {                                                                                                                      \
  132|      1|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  133|      1|    }                                                                                                                      \
eng_lib.c:sk_ENGINE_CLEANUP_ITEM_pop_free:
  147|      1|    {                                                                                                                      \
  148|      1|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|      1|                                                                                                                           \
  150|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|      1|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|      1|                                                                                                                           \
  153|      1|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|      1|    }                                                                                                                      \
eng_lib.c:sk_ENGINE_CLEANUP_ITEM_freefunc_thunk:
   77|      2|    {                                                                                                                      \
   78|      2|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc)freefunc_arg;                                                    \
   79|      2|        freefunc((t3 *)ptr);                                                                                               \
   80|      2|    }                                                                                                                      \
keymgmt_lib.c:sk_OP_CACHE_ELEM_pop_free:
  147|   832k|    {                                                                                                                      \
  148|   832k|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|   832k|                                                                                                                           \
  150|   832k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|   832k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|   832k|                                                                                                                           \
  153|   832k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|   832k|    }                                                                                                                      \
p_lib.c:ossl_check_X509_ATTRIBUTE_sk_type:
   55|   832k|    {                                                                                                           \
   56|   832k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|   832k|    }                                                                                                           \
p_lib.c:ossl_check_X509_ATTRIBUTE_freefunc_type:
   67|   832k|    {                                                                                                           \
   68|   832k|        return (OPENSSL_sk_freefunc)fr;                                                                         \
   69|   832k|    }
core_namemap.c:sk_NAMES_value:
   86|   754k|    {                                                                                                                      \
   87|   754k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);                                                     \
   88|   754k|    }                                                                                                                      \
core_namemap.c:ossl_check_const_OPENSSL_STRING_sk_type:
   51|  4.71M|    {                                                                                                           \
   52|  4.71M|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|  4.71M|    }                                                                                                           \
core_namemap.c:ossl_check_OPENSSL_STRING_sk_type:
   55|  1.07M|    {                                                                                                           \
   56|  1.07M|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  1.07M|    }                                                                                                           \
core_namemap.c:ossl_check_OPENSSL_STRING_type:
   47|   371k|    {                                                                                                           \
   48|   371k|        return ptr;                                                                                             \
   49|   371k|    }                                                                                                           \
core_namemap.c:sk_NAMES_push:
  131|   160k|    {                                                                                                                      \
  132|   160k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  133|   160k|    }                                                                                                                      \
core_namemap.c:sk_NAMES_num:
   82|   160k|    {                                                                                                                      \
   83|   160k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|   160k|    }                                                                                                                      \
core_namemap.c:ossl_check_OPENSSL_STRING_freefunc_type:
   67|   160k|    {                                                                                                           \
   68|   160k|        return (OPENSSL_sk_freefunc)fr;                                                                         \
   69|   160k|    }
core_namemap.c:sk_NAMES_new_null:
   98|    787|    {                                                                                                                      \
   99|    787|        return (STACK_OF(t1) *)OPENSSL_sk_new_null();                                                                      \
  100|    787|    }                                                                                                                      \
core_namemap.c:sk_NAMES_pop_free:
  147|    787|    {                                                                                                                      \
  148|    787|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|    787|                                                                                                                           \
  150|    787|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|    787|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|    787|                                                                                                                           \
  153|    787|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|    787|    }                                                                                                                      \
core_namemap.c:sk_NAMES_freefunc_thunk:
   77|   160k|    {                                                                                                                      \
   78|   160k|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc)freefunc_arg;                                                    \
   79|   160k|        freefunc((t3 *)ptr);                                                                                               \
   80|   160k|    }                                                                                                                      \
ex_data.c:sk_EX_CALLBACK_pop_free:
  147|  14.1k|    {                                                                                                                      \
  148|  14.1k|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|  14.1k|                                                                                                                           \
  150|  14.1k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|  14.1k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|  14.1k|                                                                                                                           \
  153|  14.1k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|  14.1k|    }                                                                                                                      \
ex_data.c:sk_EX_CALLBACK_freefunc_thunk:
   77|      2|    {                                                                                                                      \
   78|      2|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc)freefunc_arg;                                                    \
   79|      2|        freefunc((t3 *)ptr);                                                                                               \
   80|      2|    }                                                                                                                      \
ex_data.c:sk_EX_CALLBACK_num:
   82|  9.15M|    {                                                                                                                      \
   83|  9.15M|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|  9.15M|    }                                                                                                                      \
ex_data.c:sk_EX_CALLBACK_value:
   86|  3.28k|    {                                                                                                                      \
   87|  3.28k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);                                                     \
   88|  3.28k|    }                                                                                                                      \
ex_data.c:sk_EX_CALLBACK_new_null:
   98|      2|    {                                                                                                                      \
   99|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null();                                                                      \
  100|      2|    }                                                                                                                      \
ex_data.c:sk_EX_CALLBACK_push:
  131|      4|    {                                                                                                                      \
  132|      4|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  133|      4|    }                                                                                                                      \
ex_data.c:sk_EX_CALLBACK_set:
  160|      2|    {                                                                                                                      \
  161|      2|        return (t2 *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr);                                          \
  162|      2|    }                                                                                                                      \
ex_data.c:ossl_check_const_void_sk_type:
   51|  10.7k|    {                                                                                                           \
   52|  10.7k|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|  10.7k|    }                                                                                                           \
ex_data.c:ossl_check_void_sk_type:
   55|  4.58M|    {                                                                                                           \
   56|  4.58M|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  4.58M|    }                                                                                                           \
ex_data.c:ossl_check_void_type:
   47|  5.99k|    {                                                                                                           \
   48|  5.99k|        return ptr;                                                                                             \
   49|  5.99k|    }                                                                                                           \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_new_null:
   98|      1|    {                                                                                                                      \
   99|      1|        return (STACK_OF(t1) *)OPENSSL_sk_new_null();                                                                      \
  100|      1|    }                                                                                                                      \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_free:
  114|      1|    {                                                                                                                      \
  115|      1|        OPENSSL_sk_free((OPENSSL_STACK *)sk);                                                                              \
  116|      1|    }                                                                                                                      \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_push:
  131|      1|    {                                                                                                                      \
  132|      1|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  133|      1|    }                                                                                                                      \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_num:
   82|  3.14k|    {                                                                                                                      \
   83|  3.14k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|  3.14k|    }                                                                                                                      \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_value:
   86|  1.57k|    {                                                                                                                      \
   87|  1.57k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);                                                     \
   88|  1.57k|    }                                                                                                                      \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_delete:
  122|      1|    {                                                                                                                      \
  123|      1|        return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i);                                                            \
  124|      1|    }                                                                                                                      \
param_build.c:sk_OSSL_PARAM_BLD_DEF_new_null:
   98|  2.88k|    {                                                                                                                      \
   99|  2.88k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null();                                                                      \
  100|  2.88k|    }                                                                                                                      \
param_build.c:sk_OSSL_PARAM_BLD_DEF_pop:
  139|  2.88k|    {                                                                                                                      \
  140|  2.88k|        return (t2 *)OPENSSL_sk_pop((OPENSSL_STACK *)sk);                                                                  \
  141|  2.88k|    }                                                                                                                      \
param_build.c:sk_OSSL_PARAM_BLD_DEF_free:
  114|  2.88k|    {                                                                                                                      \
  115|  2.88k|        OPENSSL_sk_free((OPENSSL_STACK *)sk);                                                                              \
  116|  2.88k|    }                                                                                                                      \
param_build.c:sk_OSSL_PARAM_BLD_DEF_push:
  131|  2.88k|    {                                                                                                                      \
  132|  2.88k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  133|  2.88k|    }                                                                                                                      \
param_build.c:sk_OSSL_PARAM_BLD_DEF_num:
   82|  11.5k|    {                                                                                                                      \
   83|  11.5k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|  11.5k|    }                                                                                                                      \
param_build.c:sk_OSSL_PARAM_BLD_DEF_value:
   86|  2.88k|    {                                                                                                                      \
   87|  2.88k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);                                                     \
   88|  2.88k|    }                                                                                                                      \
provider_conf.c:sk_OSSL_PROVIDER_pop_free:
  147|    787|    {                                                                                                                      \
  148|    787|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|    787|                                                                                                                           \
  150|    787|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|    787|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|    787|                                                                                                                           \
  153|    787|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|    787|    }                                                                                                                      \
provider_core.c:sk_INFOPAIR_pop_free:
  147|  1.57k|    {                                                                                                                      \
  148|  1.57k|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|  1.57k|                                                                                                                           \
  150|  1.57k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|  1.57k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|  1.57k|                                                                                                                           \
  153|  1.57k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|  1.57k|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_pop_free:
  147|    787|    {                                                                                                                      \
  148|    787|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|    787|                                                                                                                           \
  150|    787|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|    787|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|    787|                                                                                                                           \
  153|    787|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|    787|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_freefunc_thunk:
   77|  1.43k|    {                                                                                                                      \
   78|  1.43k|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc)freefunc_arg;                                                    \
   79|  1.43k|        freefunc((t3 *)ptr);                                                                                               \
   80|  1.43k|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_pop_free:
  147|    787|    {                                                                                                                      \
  148|    787|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|    787|                                                                                                                           \
  150|    787|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|    787|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|    787|                                                                                                                           \
  153|    787|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|    787|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_new:
   90|    787|    {                                                                                                                      \
   91|    787|        OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare);                                                 \
   92|    787|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
   93|    787|                                                                                                                           \
   94|    787|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
   95|    787|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk);                                                        \
   96|    787|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_new_null:
   98|    787|    {                                                                                                                      \
   99|    787|        return (STACK_OF(t1) *)OPENSSL_sk_new_null();                                                                      \
  100|    787|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_sort:
  176|  3.82k|    {                                                                                                                      \
  177|  3.82k|        OPENSSL_sk_sort((OPENSSL_STACK *)sk);                                                                              \
  178|  3.82k|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_find:
  164|  4.47k|    {                                                                                                                      \
  165|  4.47k|        return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  166|  4.47k|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_value:
   86|   376k|    {                                                                                                                      \
   87|   376k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);                                                     \
   88|   376k|    }                                                                                                                      \
provider_core.c:sk_INFOPAIR_deep_copy:
  190|  1.57k|    {                                                                                                                      \
  191|  1.57k|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk,                                             \
  192|  1.57k|            (OPENSSL_sk_copyfunc)copyfunc,                                                                                 \
  193|  1.57k|            (OPENSSL_sk_freefunc)freefunc);                                                                                \
  194|  1.57k|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_push:
  131|  1.43k|    {                                                                                                                      \
  132|  1.43k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  133|  1.43k|    }                                                                                                                      \
provider_core.c:sk_INFOPAIR_num:
   82|  3.98k|    {                                                                                                                      \
   83|  3.98k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|  3.98k|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_dup:
  184|  79.9k|    {                                                                                                                      \
  185|  79.9k|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk);                                                  \
  186|  79.9k|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_num:
   82|  79.9k|    {                                                                                                                      \
   83|  79.9k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|  79.9k|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_free:
  114|  79.9k|    {                                                                                                                      \
  115|  79.9k|        OPENSSL_sk_free((OPENSSL_STACK *)sk);                                                                              \
  116|  79.9k|    }                                                                                                                      \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_num:
   82|  2.08k|    {                                                                                                                      \
   83|  2.08k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|  2.08k|    }                                                                                                                      \
o_names.c:sk_NAME_FUNCS_pop_free:
  147|      1|    {                                                                                                                      \
  148|      1|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|      1|                                                                                                                           \
  150|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|      1|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|      1|                                                                                                                           \
  153|      1|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|      1|    }                                                                                                                      \
obj_xref.c:sk_nid_triple_pop_free:
  147|      1|    {                                                                                                                      \
  148|      1|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|      1|                                                                                                                           \
  150|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|      1|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|      1|                                                                                                                           \
  153|      1|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|      1|    }                                                                                                                      \
obj_xref.c:sk_nid_triple_free:
  114|      1|    {                                                                                                                      \
  115|      1|        OPENSSL_sk_free((OPENSSL_STACK *)sk);                                                                              \
  116|      1|    }                                                                                                                      \
pem_info.c:ossl_check_X509_INFO_sk_type:
   55|   412k|    {                                                                                                           \
   56|   412k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|   412k|    }                                                                                                           \
pem_info.c:ossl_check_X509_INFO_type:
   47|   412k|    {                                                                                                           \
   48|   412k|        return ptr;                                                                                             \
   49|   412k|    }                                                                                                           \
property.c:sk_IMPLEMENTATION_pop_free:
  147|   168k|    {                                                                                                                      \
  148|   168k|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|   168k|                                                                                                                           \
  150|   168k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|   168k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|   168k|                                                                                                                           \
  153|   168k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|   168k|    }                                                                                                                      \
property.c:sk_IMPLEMENTATION_freefunc_thunk:
   77|   169k|    {                                                                                                                      \
   78|   169k|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc)freefunc_arg;                                                    \
   79|   169k|        freefunc((t3 *)ptr);                                                                                               \
   80|   169k|    }                                                                                                                      \
property.c:sk_IMPLEMENTATION_new_null:
   98|   168k|    {                                                                                                                      \
   99|   168k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null();                                                                      \
  100|   168k|    }                                                                                                                      \
property.c:sk_IMPLEMENTATION_num:
   82|   550k|    {                                                                                                                      \
   83|   550k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|   550k|    }                                                                                                                      \
property.c:sk_IMPLEMENTATION_value:
   86|   204k|    {                                                                                                                      \
   87|   204k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);                                                     \
   88|   204k|    }                                                                                                                      \
property.c:sk_IMPLEMENTATION_push:
  131|   169k|    {                                                                                                                      \
  132|   169k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  133|   169k|    }                                                                                                                      \
property.c:sk_IMPLEMENTATION_delete:
  122|    530|    {                                                                                                                      \
  123|    530|        return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i);                                                            \
  124|    530|    }                                                                                                                      \
property.c:sk_ALGORITHM_new_reserve:
  102|      6|    {                                                                                                                      \
  103|      6|        OPENSSL_STACK *ret = OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n);                                      \
  104|      6|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  105|      6|                                                                                                                           \
  106|      6|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  107|      6|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk);                                                        \
  108|      6|    }                                                                                                                      \
property.c:sk_ALGORITHM_freefunc_thunk:
   77|    656|    {                                                                                                                      \
   78|    656|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc)freefunc_arg;                                                    \
   79|    656|        freefunc((t3 *)ptr);                                                                                               \
   80|    656|    }                                                                                                                      \
property.c:sk_IMPLEMENTATION_dup:
  184|    656|    {                                                                                                                      \
  185|    656|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk);                                                  \
  186|    656|    }                                                                                                                      \
property.c:sk_ALGORITHM_push:
  131|    656|    {                                                                                                                      \
  132|    656|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  133|    656|    }                                                                                                                      \
property.c:sk_ALGORITHM_num:
   82|      6|    {                                                                                                                      \
   83|      6|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|      6|    }                                                                                                                      \
property.c:sk_ALGORITHM_value:
   86|    656|    {                                                                                                                      \
   87|    656|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);                                                     \
   88|    656|    }                                                                                                                      \
property.c:sk_ALGORITHM_pop_free:
  147|      6|    {                                                                                                                      \
  148|      6|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|      6|                                                                                                                           \
  150|      6|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|      6|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|      6|                                                                                                                           \
  153|      6|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|      6|    }                                                                                                                      \
property.c:sk_IMPLEMENTATION_free:
  114|    656|    {                                                                                                                      \
  115|    656|        OPENSSL_sk_free((OPENSSL_STACK *)sk);                                                                              \
  116|    656|    }                                                                                                                      \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_new:
   90|  36.1k|    {                                                                                                                      \
   91|  36.1k|        OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare);                                                 \
   92|  36.1k|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
   93|  36.1k|                                                                                                                           \
   94|  36.1k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
   95|  36.1k|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk);                                                        \
   96|  36.1k|    }                                                                                                                      \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_freefunc_thunk:
   77|   241k|    {                                                                                                                      \
   78|   241k|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc)freefunc_arg;                                                    \
   79|   241k|        freefunc((t3 *)ptr);                                                                                               \
   80|   241k|    }                                                                                                                      \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_push:
  131|   241k|    {                                                                                                                      \
  132|   241k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  133|   241k|    }                                                                                                                      \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_num:
   82|  17.7k|    {                                                                                                                      \
   83|  17.7k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|  17.7k|    }                                                                                                                      \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_sort:
  176|  17.7k|    {                                                                                                                      \
  177|  17.7k|        OPENSSL_sk_sort((OPENSSL_STACK *)sk);                                                                              \
  178|  17.7k|    }                                                                                                                      \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_value:
   86|  23.6k|    {                                                                                                                      \
   87|  23.6k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);                                                     \
   88|  23.6k|    }                                                                                                                      \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_pop_free:
  147|  36.1k|    {                                                                                                                      \
  148|  36.1k|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|  36.1k|                                                                                                                           \
  150|  36.1k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|  36.1k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|  36.1k|                                                                                                                           \
  153|  36.1k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|  36.1k|    }                                                                                                                      \
property_string.c:ossl_check_OPENSSL_CSTRING_sk_type:
   55|  10.4k|    {                                                                                                           \
   56|  10.4k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  10.4k|    }                                                                                                           \
property_string.c:ossl_check_OPENSSL_CSTRING_type:
   47|  8.87k|    {                                                                                                           \
   48|  8.87k|        return ptr;                                                                                             \
   49|  8.87k|    }                                                                                                           \
property_string.c:ossl_check_const_OPENSSL_CSTRING_sk_type:
   51|  2.28k|    {                                                                                                           \
   52|  2.28k|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|  2.28k|    }                                                                                                           \
rsa_backend.c:sk_BIGNUM_const_new_null:
   98|   898k|    {                                                                                                                      \
   99|   898k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null();                                                                      \
  100|   898k|    }                                                                                                                      \
rsa_backend.c:sk_BIGNUM_const_free:
  114|   898k|    {                                                                                                                      \
  115|   898k|        OPENSSL_sk_free((OPENSSL_STACK *)sk);                                                                              \
  116|   898k|    }                                                                                                                      \
rsa_lib.c:sk_RSA_PRIME_INFO_pop_free:
  147|   299k|    {                                                                                                                      \
  148|   299k|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|   299k|                                                                                                                           \
  150|   299k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|   299k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|   299k|                                                                                                                           \
  153|   299k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|   299k|    }                                                                                                                      \
rsa_lib.c:sk_BIGNUM_const_new_null:
   98|   898k|    {                                                                                                                      \
   99|   898k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null();                                                                      \
  100|   898k|    }                                                                                                                      \
rsa_lib.c:sk_BIGNUM_const_num:
   82|   898k|    {                                                                                                                      \
   83|   898k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|   898k|    }                                                                                                                      \
rsa_lib.c:sk_BIGNUM_const_free:
  114|   898k|    {                                                                                                                      \
  115|   898k|        OPENSSL_sk_free((OPENSSL_STACK *)sk);                                                                              \
  116|   898k|    }                                                                                                                      \
rsa_ossl.c:sk_RSA_PRIME_INFO_num:
   82|   299k|    {                                                                                                                      \
   83|   299k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|   299k|    }                                                                                                                      \
by_dir.c:sk_BY_DIR_ENTRY_pop_free:
  147|  1.66k|    {                                                                                                                      \
  148|  1.66k|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|  1.66k|                                                                                                                           \
  150|  1.66k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|  1.66k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|  1.66k|                                                                                                                           \
  153|  1.66k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|  1.66k|    }                                                                                                                      \
by_dir.c:sk_BY_DIR_ENTRY_freefunc_thunk:
   77|  3.16k|    {                                                                                                                      \
   78|  3.16k|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc)freefunc_arg;                                                    \
   79|  3.16k|        freefunc((t3 *)ptr);                                                                                               \
   80|  3.16k|    }                                                                                                                      \
by_dir.c:sk_BY_DIR_HASH_pop_free:
  147|  3.16k|    {                                                                                                                      \
  148|  3.16k|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|  3.16k|                                                                                                                           \
  150|  3.16k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|  3.16k|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|  3.16k|                                                                                                                           \
  153|  3.16k|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|  3.16k|    }                                                                                                                      \
by_dir.c:sk_BY_DIR_ENTRY_num:
   82|   369k|    {                                                                                                                      \
   83|   369k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|   369k|    }                                                                                                                      \
by_dir.c:sk_BY_DIR_ENTRY_value:
   86|   357k|    {                                                                                                                      \
   87|   357k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);                                                     \
   88|   357k|    }                                                                                                                      \
by_dir.c:sk_BY_DIR_ENTRY_new_null:
   98|  1.66k|    {                                                                                                                      \
   99|  1.66k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null();                                                                      \
  100|  1.66k|    }                                                                                                                      \
by_dir.c:sk_BY_DIR_HASH_new:
   90|  3.16k|    {                                                                                                                      \
   91|  3.16k|        OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare);                                                 \
   92|  3.16k|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
   93|  3.16k|                                                                                                                           \
   94|  3.16k|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
   95|  3.16k|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk);                                                        \
   96|  3.16k|    }                                                                                                                      \
by_dir.c:sk_BY_DIR_ENTRY_push:
  131|  3.16k|    {                                                                                                                      \
  132|  3.16k|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  133|  3.16k|    }                                                                                                                      \
by_file.c:ossl_check_const_X509_INFO_sk_type:
   51|   827k|    {                                                                                                           \
   52|   827k|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|   827k|    }                                                                                                           \
by_file.c:ossl_check_X509_INFO_sk_type:
   55|  2.83k|    {                                                                                                           \
   56|  2.83k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  2.83k|    }                                                                                                           \
by_file.c:ossl_check_X509_INFO_freefunc_type:
   67|  2.83k|    {                                                                                                           \
   68|  2.83k|        return (OPENSSL_sk_freefunc)fr;                                                                         \
   69|  2.83k|    }
t_x509.c:ossl_check_X509_sk_type:
   55|  59.6k|    {                                                                                                           \
   56|  59.6k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  59.6k|    }                                                                                                           \
t_x509.c:ossl_check_X509_freefunc_type:
   67|  59.6k|    {                                                                                                           \
   68|  59.6k|        return (OPENSSL_sk_freefunc)fr;                                                                         \
   69|  59.6k|    }
v3_lib.c:ossl_check_const_X509_EXTENSION_sk_type:
   51|  32.0M|    {                                                                                                           \
   52|  32.0M|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|  32.0M|    }                                                                                                           \
v3_purp.c:ossl_check_const_DIST_POINT_sk_type:
   51|   417k|    {                                                                                                           \
   52|   417k|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|   417k|    }                                                                                                           \
v3_purp.c:ossl_check_const_GENERAL_NAME_sk_type:
   51|  23.1k|    {                                                                                                           \
   52|  23.1k|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|  23.1k|    }                                                                                                           \
x509_lu.c:ossl_check_X509_OBJECT_compfunc_type:
   59|  2.56k|    {                                                                                                           \
   60|  2.56k|        return (OPENSSL_sk_compfunc)cmp;                                                                        \
   61|  2.56k|    }                                                                                                           \
x509_lu.c:ossl_check_X509_OBJECT_sk_type:
   55|   657k|    {                                                                                                           \
   56|   657k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|   657k|    }                                                                                                           \
x509_lu.c:ossl_check_X509_LOOKUP_sk_type:
   55|  5.97k|    {                                                                                                           \
   56|  5.97k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  5.97k|    }                                                                                                           \
x509_lu.c:ossl_check_const_X509_LOOKUP_sk_type:
   51|  28.0k|    {                                                                                                           \
   52|  28.0k|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|  28.0k|    }                                                                                                           \
x509_lu.c:ossl_check_X509_OBJECT_freefunc_type:
   67|  2.56k|    {                                                                                                           \
   68|  2.56k|        return (OPENSSL_sk_freefunc)fr;                                                                         \
   69|  2.56k|    }
x509_lu.c:ossl_check_X509_LOOKUP_type:
   47|  3.41k|    {                                                                                                           \
   48|  3.41k|        return ptr;                                                                                             \
   49|  3.41k|    }                                                                                                           \
x509_lu.c:ossl_check_const_X509_OBJECT_sk_type:
   51|   338k|    {                                                                                                           \
   52|   338k|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|   338k|    }                                                                                                           \
x509_lu.c:ossl_check_X509_OBJECT_type:
   47|   655k|    {                                                                                                           \
   48|   655k|        return ptr;                                                                                             \
   49|   655k|    }                                                                                                           \
x509_v3.c:ossl_check_const_X509_EXTENSION_sk_type:
   51|  3.83M|    {                                                                                                           \
   52|  3.83M|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|  3.83M|    }                                                                                                           \
x509_vpm.c:ossl_check_ASN1_OBJECT_sk_type:
   55|  6.81k|    {                                                                                                           \
   56|  6.81k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  6.81k|    }                                                                                                           \
x509_vpm.c:ossl_check_ASN1_OBJECT_freefunc_type:
   67|  6.81k|    {                                                                                                           \
   68|  6.81k|        return (OPENSSL_sk_freefunc)fr;                                                                         \
   69|  6.81k|    }
x509_vpm.c:ossl_check_OPENSSL_STRING_sk_type:
   55|  6.81k|    {                                                                                                           \
   56|  6.81k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  6.81k|    }                                                                                                           \
x509_vpm.c:ossl_check_OPENSSL_STRING_freefunc_type:
   67|  6.81k|    {                                                                                                           \
   68|  6.81k|        return (OPENSSL_sk_freefunc)fr;                                                                         \
   69|  6.81k|    }
x_name.c:ossl_check_X509_NAME_ENTRY_sk_type:
   55|  16.6M|    {                                                                                                           \
   56|  16.6M|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  16.6M|    }                                                                                                           \
x_name.c:ossl_check_X509_NAME_ENTRY_freefunc_type:
   67|  4.65M|    {                                                                                                           \
   68|  4.65M|        return (OPENSSL_sk_freefunc)fr;                                                                         \
   69|  4.65M|    }
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_num:
   82|  3.82M|    {                                                                                                                      \
   83|  3.82M|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk);                                                                  \
   84|  3.82M|    }                                                                                                                      \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_value:
   86|  2.98M|    {                                                                                                                      \
   87|  2.98M|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);                                                     \
   88|  2.98M|    }                                                                                                                      \
x_name.c:ossl_check_const_X509_NAME_ENTRY_sk_type:
   51|  16.6M|    {                                                                                                           \
   52|  16.6M|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|  16.6M|    }                                                                                                           \
x_name.c:ossl_check_X509_NAME_ENTRY_type:
   47|  8.96M|    {                                                                                                           \
   48|  8.96M|        return ptr;                                                                                             \
   49|  8.96M|    }                                                                                                           \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_new_null:
   98|   838k|    {                                                                                                                      \
   99|   838k|        return (STACK_OF(t1) *)OPENSSL_sk_new_null();                                                                      \
  100|   838k|    }                                                                                                                      \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_push:
  131|  2.98M|    {                                                                                                                      \
  132|  2.98M|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  133|  2.98M|    }                                                                                                                      \
x_name.c:ossl_check_const_ASN1_VALUE_sk_type:
   51|  13.6M|    {                                                                                                           \
   52|  13.6M|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|  13.6M|    }                                                                                                           \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_pop_free:
  147|  1.67M|    {                                                                                                                      \
  148|  1.67M|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|  1.67M|                                                                                                                           \
  150|  1.67M|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|  1.67M|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|  1.67M|                                                                                                                           \
  153|  1.67M|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|  1.67M|    }                                                                                                                      \
x_name.c:sk_STACK_OF_X509_NAME_ENTRY_freefunc_thunk:
   77|  5.97M|    {                                                                                                                      \
   78|  5.97M|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc)freefunc_arg;                                                    \
   79|  5.97M|        freefunc((t3 *)ptr);                                                                                               \
   80|  5.97M|    }                                                                                                                      \
x_x509.c:ossl_check_IPAddressFamily_sk_type:
   55|   824k|    {                                                                                                           \
   56|   824k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|   824k|    }                                                                                                           \
x_x509.c:ossl_check_IPAddressFamily_freefunc_type:
   67|   824k|    {                                                                                                           \
   68|   824k|        return (OPENSSL_sk_freefunc)fr;                                                                         \
   69|   824k|    }
dso_dlfcn.c:ossl_check_const_void_sk_type:
   51|    952|    {                                                                                                           \
   52|    952|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|    952|    }                                                                                                           \
eng_dyn.c:ossl_check_OPENSSL_STRING_freefunc_type:
   67|    817|    {                                                                                                           \
   68|    817|        return (OPENSSL_sk_freefunc)fr;                                                                         \
   69|    817|    }
eng_dyn.c:ossl_check_const_OPENSSL_STRING_sk_type:
   51|  1.63k|    {                                                                                                           \
   52|  1.63k|        return (const OPENSSL_STACK *)sk;                                                                       \
   53|  1.63k|    }                                                                                                           \
eng_dyn.c:ossl_check_OPENSSL_STRING_sk_type:
   55|  1.63k|    {                                                                                                           \
   56|  1.63k|        return (OPENSSL_STACK *)sk;                                                                             \
   57|  1.63k|    }                                                                                                           \
eng_dyn.c:ossl_check_OPENSSL_STRING_type:
   47|    817|    {                                                                                                           \
   48|    817|        return ptr;                                                                                             \
   49|    817|    }                                                                                                           \
eng_table.c:sk_ENGINE_new_null:
   98|      1|    {                                                                                                                      \
   99|      1|        return (STACK_OF(t1) *)OPENSSL_sk_new_null();                                                                      \
  100|      1|    }                                                                                                                      \
eng_table.c:sk_ENGINE_free:
  114|      1|    {                                                                                                                      \
  115|      1|        OPENSSL_sk_free((OPENSSL_STACK *)sk);                                                                              \
  116|      1|    }                                                                                                                      \
eng_table.c:sk_ENGINE_delete_ptr:
  126|      2|    {                                                                                                                      \
  127|      2|        return (t2 *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk,                                                            \
  128|      2|            (const void *)ptr);                                                                                            \
  129|      2|    }                                                                                                                      \
eng_table.c:sk_ENGINE_push:
  131|      2|    {                                                                                                                      \
  132|      2|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);                                                    \
  133|      2|    }                                                                                                                      \
evp_pbe.c:sk_EVP_PBE_CTL_pop_free:
  147|      1|    {                                                                                                                      \
  148|      1|        OPENSSL_sk_freefunc_thunk f_thunk;                                                                                 \
  149|      1|                                                                                                                           \
  150|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk;                                                     \
  151|      1|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk);                                          \
  152|      1|                                                                                                                           \
  153|      1|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc);                                           \
  154|      1|    }                                                                                                                      \
comp_methods.c:ossl_check_SSL_COMP_compfunc_type:
   59|    787|    {                                                                                                           \
   60|    787|        return (OPENSSL_sk_compfunc)cmp;                                                                        \
   61|    787|    }                                                                                                           \
comp_methods.c:ossl_check_SSL_COMP_sk_type:
   55|    787|    {                                                                                                           \
   56|    787|        return (OPENSSL_STACK *)sk;                                                                             \
   57|    787|    }                                                                                                           \
comp_methods.c:ossl_check_SSL_COMP_freefunc_type:
   67|    787|    {                                                                                                           \
   68|    787|        return (OPENSSL_sk_freefunc)fr;                                                                         \
   69|    787|    }

ossl_base_provider_init:
  140|    627|{
  141|    627|    OSSL_FUNC_core_get_libctx_fn *c_get_libctx = NULL;
  142|    627|    BIO_METHOD *corebiometh;
  143|       |
  144|    627|    if (!ossl_prov_bio_from_dispatch(in))
  ------------------
  |  Branch (144:9): [True: 0, False: 627]
  ------------------
  145|      0|        return 0;
  146|  33.8k|    for (; in->function_id != 0; in++) {
  ------------------
  |  Branch (146:12): [True: 33.2k, False: 627]
  ------------------
  147|  33.2k|        switch (in->function_id) {
  148|    627|        case OSSL_FUNC_CORE_GETTABLE_PARAMS:
  ------------------
  |  |   72|    627|#define OSSL_FUNC_CORE_GETTABLE_PARAMS 1
  ------------------
  |  Branch (148:9): [True: 627, False: 32.6k]
  ------------------
  149|    627|            c_gettable_params = OSSL_FUNC_core_gettable_params(in);
  150|    627|            break;
  151|    627|        case OSSL_FUNC_CORE_GET_PARAMS:
  ------------------
  |  |   75|    627|#define OSSL_FUNC_CORE_GET_PARAMS 2
  ------------------
  |  Branch (151:9): [True: 627, False: 32.6k]
  ------------------
  152|    627|            c_get_params = OSSL_FUNC_core_get_params(in);
  153|    627|            break;
  154|    627|        case OSSL_FUNC_CORE_GET_LIBCTX:
  ------------------
  |  |   79|    627|#define OSSL_FUNC_CORE_GET_LIBCTX 4
  ------------------
  |  Branch (154:9): [True: 627, False: 32.6k]
  ------------------
  155|    627|            c_get_libctx = OSSL_FUNC_core_get_libctx(in);
  156|    627|            break;
  157|  31.3k|        default:
  ------------------
  |  Branch (157:9): [True: 31.3k, False: 1.88k]
  ------------------
  158|       |            /* Just ignore anything we don't understand */
  159|  31.3k|            break;
  160|  33.2k|        }
  161|  33.2k|    }
  162|       |
  163|    627|    if (c_get_libctx == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 627]
  ------------------
  164|      0|        return 0;
  165|       |
  166|       |    /*
  167|       |     * We want to make sure that all calls from this provider that requires
  168|       |     * a library context use the same context as the one used to call our
  169|       |     * functions.  We do that by passing it along in the provider context.
  170|       |     *
  171|       |     * This only works for built-in providers.  Most providers should
  172|       |     * create their own library context.
  173|       |     */
  174|    627|    if ((*provctx = ossl_prov_ctx_new()) == NULL
  ------------------
  |  Branch (174:9): [True: 0, False: 627]
  ------------------
  175|    627|        || (corebiometh = ossl_bio_prov_init_bio_method()) == NULL) {
  ------------------
  |  Branch (175:12): [True: 0, False: 627]
  ------------------
  176|      0|        ossl_prov_ctx_free(*provctx);
  177|      0|        *provctx = NULL;
  178|      0|        return 0;
  179|      0|    }
  180|    627|    ossl_prov_ctx_set0_libctx(*provctx,
  181|    627|        (OSSL_LIB_CTX *)c_get_libctx(handle));
  182|    627|    ossl_prov_ctx_set0_handle(*provctx, handle);
  183|    627|    ossl_prov_ctx_set0_core_bio_method(*provctx, corebiometh);
  184|    627|    ossl_prov_ctx_set0_core_get_params(*provctx, c_get_params);
  185|       |
  186|    627|    *out = base_dispatch_table;
  187|       |
  188|    627|    return 1;
  189|    627|}
baseprov.c:base_teardown:
  120|    627|{
  121|    627|    BIO_meth_free(ossl_prov_ctx_get0_core_bio_method(provctx));
  122|    627|    ossl_prov_ctx_free(provctx);
  123|    627|}
baseprov.c:base_query:
  104|  42.4k|{
  105|  42.4k|    *no_cache = 0;
  106|  42.4k|    switch (operation_id) {
  ------------------
  |  Branch (106:13): [True: 1.06k, False: 41.4k]
  ------------------
  107|      0|    case OSSL_OP_ENCODER:
  ------------------
  |  |  295|      0|#define OSSL_OP_ENCODER 20
  ------------------
  |  Branch (107:5): [True: 0, False: 42.4k]
  ------------------
  108|      0|        return base_encoder;
  109|      0|    case OSSL_OP_DECODER:
  ------------------
  |  |  296|      0|#define OSSL_OP_DECODER 21
  ------------------
  |  Branch (109:5): [True: 0, False: 42.4k]
  ------------------
  110|      0|        return base_decoder;
  111|      0|    case OSSL_OP_STORE:
  ------------------
  |  |  297|      0|#define OSSL_OP_STORE 22
  ------------------
  |  Branch (111:5): [True: 0, False: 42.4k]
  ------------------
  112|      0|        return base_store;
  113|  1.06k|    case OSSL_OP_RAND:
  ------------------
  |  |  287|  1.06k|#define OSSL_OP_RAND 5
  ------------------
  |  Branch (113:5): [True: 1.06k, False: 41.4k]
  ------------------
  114|  1.06k|        return base_rands;
  115|  42.4k|    }
  116|  41.4k|    return NULL;
  117|  42.4k|}

ossl_prov_bio_from_dispatch:
   27|  1.41k|{
   28|  76.3k|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (28:12): [True: 74.9k, False: 1.41k]
  ------------------
   29|  74.9k|        switch (fns->function_id) {
  ------------------
  |  Branch (29:17): [True: 14.1k, False: 60.8k]
  ------------------
   30|  1.41k|        case OSSL_FUNC_BIO_NEW_FILE:
  ------------------
  |  |  151|  1.41k|#define OSSL_FUNC_BIO_NEW_FILE 40
  ------------------
  |  Branch (30:9): [True: 1.41k, False: 73.5k]
  ------------------
   31|  1.41k|            if (c_bio_new_file == NULL)
  ------------------
  |  Branch (31:17): [True: 1, False: 1.41k]
  ------------------
   32|      1|                c_bio_new_file = OSSL_FUNC_BIO_new_file(fns);
   33|  1.41k|            break;
   34|  1.41k|        case OSSL_FUNC_BIO_NEW_MEMBUF:
  ------------------
  |  |  152|  1.41k|#define OSSL_FUNC_BIO_NEW_MEMBUF 41
  ------------------
  |  Branch (34:9): [True: 1.41k, False: 73.5k]
  ------------------
   35|  1.41k|            if (c_bio_new_membuf == NULL)
  ------------------
  |  Branch (35:17): [True: 1, False: 1.41k]
  ------------------
   36|      1|                c_bio_new_membuf = OSSL_FUNC_BIO_new_membuf(fns);
   37|  1.41k|            break;
   38|  1.41k|        case OSSL_FUNC_BIO_READ_EX:
  ------------------
  |  |  153|  1.41k|#define OSSL_FUNC_BIO_READ_EX 42
  ------------------
  |  Branch (38:9): [True: 1.41k, False: 73.5k]
  ------------------
   39|  1.41k|            if (c_bio_read_ex == NULL)
  ------------------
  |  Branch (39:17): [True: 1, False: 1.41k]
  ------------------
   40|      1|                c_bio_read_ex = OSSL_FUNC_BIO_read_ex(fns);
   41|  1.41k|            break;
   42|  1.41k|        case OSSL_FUNC_BIO_WRITE_EX:
  ------------------
  |  |  154|  1.41k|#define OSSL_FUNC_BIO_WRITE_EX 43
  ------------------
  |  Branch (42:9): [True: 1.41k, False: 73.5k]
  ------------------
   43|  1.41k|            if (c_bio_write_ex == NULL)
  ------------------
  |  Branch (43:17): [True: 1, False: 1.41k]
  ------------------
   44|      1|                c_bio_write_ex = OSSL_FUNC_BIO_write_ex(fns);
   45|  1.41k|            break;
   46|  1.41k|        case OSSL_FUNC_BIO_GETS:
  ------------------
  |  |  160|  1.41k|#define OSSL_FUNC_BIO_GETS 49
  ------------------
  |  Branch (46:9): [True: 1.41k, False: 73.5k]
  ------------------
   47|  1.41k|            if (c_bio_gets == NULL)
  ------------------
  |  Branch (47:17): [True: 1, False: 1.41k]
  ------------------
   48|      1|                c_bio_gets = OSSL_FUNC_BIO_gets(fns);
   49|  1.41k|            break;
   50|  1.41k|        case OSSL_FUNC_BIO_PUTS:
  ------------------
  |  |  159|  1.41k|#define OSSL_FUNC_BIO_PUTS 48
  ------------------
  |  Branch (50:9): [True: 1.41k, False: 73.5k]
  ------------------
   51|  1.41k|            if (c_bio_puts == NULL)
  ------------------
  |  Branch (51:17): [True: 1, False: 1.41k]
  ------------------
   52|      1|                c_bio_puts = OSSL_FUNC_BIO_puts(fns);
   53|  1.41k|            break;
   54|  1.41k|        case OSSL_FUNC_BIO_CTRL:
  ------------------
  |  |  161|  1.41k|#define OSSL_FUNC_BIO_CTRL 50
  ------------------
  |  Branch (54:9): [True: 1.41k, False: 73.5k]
  ------------------
   55|  1.41k|            if (c_bio_ctrl == NULL)
  ------------------
  |  Branch (55:17): [True: 1, False: 1.41k]
  ------------------
   56|      1|                c_bio_ctrl = OSSL_FUNC_BIO_ctrl(fns);
   57|  1.41k|            break;
   58|  1.41k|        case OSSL_FUNC_BIO_UP_REF:
  ------------------
  |  |  155|  1.41k|#define OSSL_FUNC_BIO_UP_REF 44
  ------------------
  |  Branch (58:9): [True: 1.41k, False: 73.5k]
  ------------------
   59|  1.41k|            if (c_bio_up_ref == NULL)
  ------------------
  |  Branch (59:17): [True: 1, False: 1.41k]
  ------------------
   60|      1|                c_bio_up_ref = OSSL_FUNC_BIO_up_ref(fns);
   61|  1.41k|            break;
   62|  1.41k|        case OSSL_FUNC_BIO_FREE:
  ------------------
  |  |  156|  1.41k|#define OSSL_FUNC_BIO_FREE 45
  ------------------
  |  Branch (62:9): [True: 1.41k, False: 73.5k]
  ------------------
   63|  1.41k|            if (c_bio_free == NULL)
  ------------------
  |  Branch (63:17): [True: 1, False: 1.41k]
  ------------------
   64|      1|                c_bio_free = OSSL_FUNC_BIO_free(fns);
   65|  1.41k|            break;
   66|  1.41k|        case OSSL_FUNC_BIO_VPRINTF:
  ------------------
  |  |  157|  1.41k|#define OSSL_FUNC_BIO_VPRINTF 46
  ------------------
  |  Branch (66:9): [True: 1.41k, False: 73.5k]
  ------------------
   67|  1.41k|            if (c_bio_vprintf == NULL)
  ------------------
  |  Branch (67:17): [True: 1, False: 1.41k]
  ------------------
   68|      1|                c_bio_vprintf = OSSL_FUNC_BIO_vprintf(fns);
   69|  1.41k|            break;
   70|  74.9k|        }
   71|  74.9k|    }
   72|       |
   73|  1.41k|    return 1;
   74|  1.41k|}
ossl_prov_bio_read_ex:
   92|  1.64M|{
   93|  1.64M|    if (c_bio_read_ex == NULL)
  ------------------
  |  Branch (93:9): [True: 0, False: 1.64M]
  ------------------
   94|      0|        return 0;
   95|  1.64M|    return c_bio_read_ex(bio, data, data_len, bytes_read);
   96|  1.64M|}
ossl_prov_bio_up_ref:
  128|   824k|{
  129|   824k|    if (c_bio_up_ref == NULL)
  ------------------
  |  Branch (129:9): [True: 0, False: 824k]
  ------------------
  130|      0|        return 0;
  131|   824k|    return c_bio_up_ref(bio);
  132|   824k|}
ossl_prov_bio_free:
  135|   824k|{
  136|   824k|    if (c_bio_free == NULL)
  ------------------
  |  Branch (136:9): [True: 0, False: 824k]
  ------------------
  137|      0|        return 0;
  138|   824k|    return c_bio_free(bio);
  139|   824k|}
ossl_bio_prov_init_bio_method:
  207|  1.41k|{
  208|  1.41k|    BIO_METHOD *corebiometh = NULL;
  209|       |
  210|  1.41k|    corebiometh = BIO_meth_new(BIO_TYPE_CORE_TO_PROV, "BIO to Core filter");
  ------------------
  |  |   71|  1.41k|#define BIO_TYPE_CORE_TO_PROV (25 | BIO_TYPE_SOURCE_SINK)
  |  |  ------------------
  |  |  |  |   43|  1.41k|#define BIO_TYPE_SOURCE_SINK 0x0400
  |  |  ------------------
  ------------------
  211|  1.41k|    if (corebiometh == NULL
  ------------------
  |  Branch (211:9): [True: 0, False: 1.41k]
  ------------------
  212|  1.41k|        || !BIO_meth_set_write_ex(corebiometh, bio_core_write_ex)
  ------------------
  |  Branch (212:12): [True: 0, False: 1.41k]
  ------------------
  213|  1.41k|        || !BIO_meth_set_read_ex(corebiometh, bio_core_read_ex)
  ------------------
  |  Branch (213:12): [True: 0, False: 1.41k]
  ------------------
  214|  1.41k|        || !BIO_meth_set_puts(corebiometh, bio_core_puts)
  ------------------
  |  Branch (214:12): [True: 0, False: 1.41k]
  ------------------
  215|  1.41k|        || !BIO_meth_set_gets(corebiometh, bio_core_gets)
  ------------------
  |  Branch (215:12): [True: 0, False: 1.41k]
  ------------------
  216|  1.41k|        || !BIO_meth_set_ctrl(corebiometh, bio_core_ctrl)
  ------------------
  |  Branch (216:12): [True: 0, False: 1.41k]
  ------------------
  217|  1.41k|        || !BIO_meth_set_create(corebiometh, bio_core_new)
  ------------------
  |  Branch (217:12): [True: 0, False: 1.41k]
  ------------------
  218|  1.41k|        || !BIO_meth_set_destroy(corebiometh, bio_core_free)) {
  ------------------
  |  Branch (218:12): [True: 0, False: 1.41k]
  ------------------
  219|      0|        BIO_meth_free(corebiometh);
  220|      0|        return NULL;
  221|      0|    }
  222|       |
  223|  1.41k|    return corebiometh;
  224|  1.41k|}
ossl_bio_new_from_core_bio:
  227|   824k|{
  228|   824k|    BIO *outbio;
  229|   824k|    BIO_METHOD *corebiometh = ossl_prov_ctx_get0_core_bio_method(provctx);
  230|       |
  231|   824k|    if (corebiometh == NULL)
  ------------------
  |  Branch (231:9): [True: 0, False: 824k]
  ------------------
  232|      0|        return NULL;
  233|       |
  234|   824k|    if ((outbio = BIO_new(corebiometh)) == NULL)
  ------------------
  |  Branch (234:9): [True: 0, False: 824k]
  ------------------
  235|      0|        return NULL;
  236|   824k|    if (!ossl_prov_bio_up_ref(corebio)) {
  ------------------
  |  Branch (236:9): [True: 0, False: 824k]
  ------------------
  237|      0|        BIO_free(outbio);
  238|      0|        return NULL;
  239|      0|    }
  240|   824k|    BIO_set_data(outbio, corebio);
  241|   824k|    return outbio;
  242|   824k|}
bio_prov.c:bio_core_read_ex:
  166|  1.64M|{
  167|  1.64M|    return ossl_prov_bio_read_ex(BIO_get_data(bio), data, data_len, bytes_read);
  168|  1.64M|}
bio_prov.c:bio_core_new:
  192|   824k|{
  193|   824k|    BIO_set_init(bio, 1);
  194|       |
  195|   824k|    return 1;
  196|   824k|}
bio_prov.c:bio_core_free:
  199|   824k|{
  200|   824k|    BIO_set_init(bio, 0);
  201|   824k|    ossl_prov_bio_free(BIO_get_data(bio));
  202|       |
  203|   824k|    return 1;
  204|   824k|}

ossl_prov_get_capabilities:
  336|  5.12k|{
  337|  5.12k|    if (OPENSSL_strcasecmp(capability, "TLS-GROUP") == 0)
  ------------------
  |  Branch (337:9): [True: 2.56k, False: 2.56k]
  ------------------
  338|  2.56k|        return tls_group_capability(cb, arg);
  339|  2.56k|    if (OPENSSL_strcasecmp(capability, "TLS-SIGALG") == 0)
  ------------------
  |  Branch (339:9): [True: 2.56k, False: 0]
  ------------------
  340|  2.56k|        return tls_sigalg_capability(cb, arg);
  341|       |
  342|       |    /* We don't support this capability */
  343|      0|    return 0;
  344|  2.56k|}
capabilities.c:tls_group_capability:
  261|  2.56k|{
  262|  2.56k|#if !defined(OPENSSL_NO_EC) || !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_ML_KEM)
  263|  2.56k|    size_t i;
  264|       |
  265|   153k|    for (i = 0; i < OSSL_NELEM(param_group_list); i++)
  ------------------
  |  |   14|   153k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (265:17): [True: 151k, False: 2.56k]
  ------------------
  266|   151k|        if (!cb(param_group_list[i], arg))
  ------------------
  |  Branch (266:13): [True: 0, False: 151k]
  ------------------
  267|      0|            return 0;
  268|  2.56k|#endif
  269|       |
  270|  2.56k|    return 1;
  271|  2.56k|}
capabilities.c:tls_sigalg_capability:
  323|  2.56k|{
  324|  2.56k|#if !defined(OPENSSL_NO_ML_DSA)
  325|  2.56k|    size_t i;
  326|       |
  327|  10.2k|    for (i = 0; i < OSSL_NELEM(param_sigalg_list); i++)
  ------------------
  |  |   14|  10.2k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (327:17): [True: 7.68k, False: 2.56k]
  ------------------
  328|  7.68k|        if (!cb(param_sigalg_list[i], arg))
  ------------------
  |  Branch (328:13): [True: 0, False: 7.68k]
  ------------------
  329|      0|            return 0;
  330|  2.56k|#endif
  331|  2.56k|    return 1;
  332|  2.56k|}

sha2_prov.c:ossl_param_is_empty:
   30|   338k|{
   31|   338k|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 338k, False: 0]
  |  Branch (31:30): [True: 0, False: 0]
  ------------------
   32|   338k|}
dh_kmgmt.c:ossl_param_is_empty:
   30|    152|{
   31|    152|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 76, False: 76]
  |  Branch (31:30): [True: 0, False: 76]
  ------------------
   32|    152|}
ciphercommon.c:ossl_param_is_empty:
   30|   125k|{
   31|   125k|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 125k, False: 0]
  |  Branch (31:30): [True: 0, False: 0]
  ------------------
   32|   125k|}

ossl_prov_ctx_new:
   16|  1.41k|{
   17|  1.41k|    return OPENSSL_zalloc(sizeof(PROV_CTX));
  ------------------
  |  |  108|  1.41k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   18|  1.41k|}
ossl_prov_ctx_free:
   21|  1.41k|{
   22|  1.41k|    OPENSSL_free(ctx);
  ------------------
  |  |  131|  1.41k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   23|  1.41k|}
ossl_prov_ctx_set0_libctx:
   26|  1.41k|{
   27|  1.41k|    if (ctx != NULL)
  ------------------
  |  Branch (27:9): [True: 1.41k, False: 0]
  ------------------
   28|  1.41k|        ctx->libctx = libctx;
   29|  1.41k|}
ossl_prov_ctx_set0_handle:
   32|  1.41k|{
   33|  1.41k|    if (ctx != NULL)
  ------------------
  |  Branch (33:9): [True: 1.41k, False: 0]
  ------------------
   34|  1.41k|        ctx->handle = handle;
   35|  1.41k|}
ossl_prov_ctx_set0_core_bio_method:
   38|  1.41k|{
   39|  1.41k|    if (ctx != NULL)
  ------------------
  |  Branch (39:9): [True: 1.41k, False: 0]
  ------------------
   40|  1.41k|        ctx->corebiometh = corebiometh;
   41|  1.41k|}
ossl_prov_ctx_set0_core_get_params:
   45|  1.41k|{
   46|  1.41k|    if (ctx != NULL)
  ------------------
  |  Branch (46:9): [True: 1.41k, False: 0]
  ------------------
   47|  1.41k|        ctx->core_get_params = c_get_params;
   48|  1.41k|}
ossl_prov_ctx_get0_libctx:
   51|   836k|{
   52|   836k|    if (ctx == NULL)
  ------------------
  |  Branch (52:9): [True: 0, False: 836k]
  ------------------
   53|      0|        return NULL;
   54|   836k|    return ctx->libctx;
   55|   836k|}
ossl_prov_ctx_get0_core_bio_method:
   65|   826k|{
   66|   826k|    if (ctx == NULL)
  ------------------
  |  Branch (66:9): [True: 0, False: 826k]
  ------------------
   67|      0|        return NULL;
   68|   826k|    return ctx->corebiometh;
   69|   826k|}
ossl_prov_ctx_get_param:
   80|  3.98k|{
   81|  3.98k|    char *val = NULL;
   82|  3.98k|    OSSL_PARAM param[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  3.98k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM param[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  3.98k|    { NULL, 0, NULL, 0, 0 }
  ------------------
   83|       |
   84|  3.98k|    if (ctx == NULL
  ------------------
  |  Branch (84:9): [True: 0, False: 3.98k]
  ------------------
   85|  3.98k|        || ctx->handle == NULL
  ------------------
  |  Branch (85:12): [True: 0, False: 3.98k]
  ------------------
   86|  3.98k|        || ctx->core_get_params == NULL)
  ------------------
  |  Branch (86:12): [True: 0, False: 3.98k]
  ------------------
   87|      0|        return defval;
   88|       |
   89|  3.98k|    param[0].key = (char *)name;
   90|  3.98k|    param[0].data_type = OSSL_PARAM_UTF8_PTR;
  ------------------
  |  |  141|  3.98k|#define OSSL_PARAM_UTF8_PTR 6
  ------------------
   91|  3.98k|    param[0].data = (void *)&val;
   92|  3.98k|    param[0].data_size = sizeof(val);
   93|  3.98k|    param[0].return_size = OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|  3.98k|#define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
   94|       |
   95|       |    /* Errors are ignored, returning the default value */
   96|  3.98k|    if (ctx->core_get_params(ctx->handle, param)
  ------------------
  |  Branch (96:9): [True: 3.98k, False: 0]
  ------------------
   97|  3.98k|        && OSSL_PARAM_modified(param)
  ------------------
  |  Branch (97:12): [True: 0, False: 3.98k]
  ------------------
   98|      0|        && val != NULL)
  ------------------
  |  Branch (98:12): [True: 0, False: 0]
  ------------------
   99|      0|        return val;
  100|  3.98k|    return defval;
  101|  3.98k|}
ossl_prov_ctx_get_bool_param:
  104|  2.65k|{
  105|  2.65k|    const char *val = ossl_prov_ctx_get_param(ctx, name, NULL);
  106|       |
  107|  2.65k|    if (val != NULL) {
  ------------------
  |  Branch (107:9): [True: 0, False: 2.65k]
  ------------------
  108|      0|        if ((strcmp(val, "1") == 0)
  ------------------
  |  Branch (108:13): [True: 0, False: 0]
  ------------------
  109|      0|            || (OPENSSL_strcasecmp(val, "yes") == 0)
  ------------------
  |  Branch (109:16): [True: 0, False: 0]
  ------------------
  110|      0|            || (OPENSSL_strcasecmp(val, "true") == 0)
  ------------------
  |  Branch (110:16): [True: 0, False: 0]
  ------------------
  111|      0|            || (OPENSSL_strcasecmp(val, "on") == 0))
  ------------------
  |  Branch (111:16): [True: 0, False: 0]
  ------------------
  112|      0|            return 1;
  113|      0|        else if ((strcmp(val, "0") == 0)
  ------------------
  |  Branch (113:18): [True: 0, False: 0]
  ------------------
  114|      0|            || (OPENSSL_strcasecmp(val, "no") == 0)
  ------------------
  |  Branch (114:16): [True: 0, False: 0]
  ------------------
  115|      0|            || (OPENSSL_strcasecmp(val, "false") == 0)
  ------------------
  |  Branch (115:16): [True: 0, False: 0]
  ------------------
  116|      0|            || (OPENSSL_strcasecmp(val, "off") == 0))
  ------------------
  |  Branch (116:16): [True: 0, False: 0]
  ------------------
  117|      0|            return 0;
  118|      0|    }
  119|  2.65k|    return defval;
  120|  2.65k|}

ossl_err_load_PROV_strings:
  263|      1|{
  264|      1|#ifndef OPENSSL_NO_ERR
  265|      1|    if (ERR_reason_error_string(PROV_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (265:9): [True: 1, False: 0]
  ------------------
  266|      1|        ERR_load_strings_const(PROV_str_reasons);
  267|      1|#endif
  268|      1|    return 1;
  269|      1|}

ossl_prov_seeding_from_dispatch:
   42|    787|{
   43|  42.4k|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (43:12): [True: 41.7k, False: 787]
  ------------------
   44|       |        /*
   45|       |         * We do not support the scenario of an application linked against
   46|       |         * multiple versions of libcrypto (e.g. one static and one dynamic), but
   47|       |         * sharing a single fips.so. We do a simple sanity check here.
   48|       |         */
   49|  41.7k|#define set_func(c, f)   \
   50|  41.7k|    do {                 \
   51|  41.7k|        if (c == NULL)   \
   52|  41.7k|            c = f;       \
   53|  41.7k|        else if (c != f) \
   54|  41.7k|            return 0;    \
   55|  41.7k|    } while (0)
   56|  41.7k|        switch (fns->function_id) {
  ------------------
  |  Branch (56:17): [True: 6.29k, False: 35.4k]
  ------------------
   57|    787|        case OSSL_FUNC_GET_ENTROPY:
  ------------------
  |  |  188|    787|#define OSSL_FUNC_GET_ENTROPY 101
  ------------------
  |  Branch (57:9): [True: 787, False: 40.9k]
  ------------------
   58|    787|            set_func(c_get_entropy, OSSL_FUNC_get_entropy(fns));
  ------------------
  |  |   50|    787|    do {                 \
  |  |   51|    787|        if (c == NULL)   \
  |  |  ------------------
  |  |  |  Branch (51:13): [True: 1, False: 786]
  |  |  ------------------
  |  |   52|    787|            c = f;       \
  |  |   53|    787|        else if (c != f) \
  |  |  ------------------
  |  |  |  Branch (53:18): [True: 0, False: 786]
  |  |  ------------------
  |  |   54|    786|            return 0;    \
  |  |   55|    787|    } while (0)
  |  |  ------------------
  |  |  |  Branch (55:14): [Folded, False: 787]
  |  |  ------------------
  ------------------
   59|    787|            break;
   60|    787|        case OSSL_FUNC_GET_USER_ENTROPY:
  ------------------
  |  |  179|    787|#define OSSL_FUNC_GET_USER_ENTROPY 98
  ------------------
  |  Branch (60:9): [True: 787, False: 40.9k]
  ------------------
   61|    787|            set_func(c_get_user_entropy, OSSL_FUNC_get_user_entropy(fns));
  ------------------
  |  |   50|    787|    do {                 \
  |  |   51|    787|        if (c == NULL)   \
  |  |  ------------------
  |  |  |  Branch (51:13): [True: 1, False: 786]
  |  |  ------------------
  |  |   52|    787|            c = f;       \
  |  |   53|    787|        else if (c != f) \
  |  |  ------------------
  |  |  |  Branch (53:18): [True: 0, False: 786]
  |  |  ------------------
  |  |   54|    786|            return 0;    \
  |  |   55|    787|    } while (0)
  |  |  ------------------
  |  |  |  Branch (55:14): [Folded, False: 787]
  |  |  ------------------
  ------------------
   62|    787|            break;
   63|    787|        case OSSL_FUNC_CLEANUP_ENTROPY:
  ------------------
  |  |  189|    787|#define OSSL_FUNC_CLEANUP_ENTROPY 102
  ------------------
  |  Branch (63:9): [True: 787, False: 40.9k]
  ------------------
   64|    787|            set_func(c_cleanup_entropy, OSSL_FUNC_cleanup_entropy(fns));
  ------------------
  |  |   50|    787|    do {                 \
  |  |   51|    787|        if (c == NULL)   \
  |  |  ------------------
  |  |  |  Branch (51:13): [True: 1, False: 786]
  |  |  ------------------
  |  |   52|    787|            c = f;       \
  |  |   53|    787|        else if (c != f) \
  |  |  ------------------
  |  |  |  Branch (53:18): [True: 0, False: 786]
  |  |  ------------------
  |  |   54|    786|            return 0;    \
  |  |   55|    787|    } while (0)
  |  |  ------------------
  |  |  |  Branch (55:14): [Folded, False: 787]
  |  |  ------------------
  ------------------
   65|    787|            break;
   66|    787|        case OSSL_FUNC_CLEANUP_USER_ENTROPY:
  ------------------
  |  |  177|    787|#define OSSL_FUNC_CLEANUP_USER_ENTROPY 96
  ------------------
  |  Branch (66:9): [True: 787, False: 40.9k]
  ------------------
   67|    787|            set_func(c_cleanup_user_entropy, OSSL_FUNC_cleanup_user_entropy(fns));
  ------------------
  |  |   50|    787|    do {                 \
  |  |   51|    787|        if (c == NULL)   \
  |  |  ------------------
  |  |  |  Branch (51:13): [True: 1, False: 786]
  |  |  ------------------
  |  |   52|    787|            c = f;       \
  |  |   53|    787|        else if (c != f) \
  |  |  ------------------
  |  |  |  Branch (53:18): [True: 0, False: 786]
  |  |  ------------------
  |  |   54|    786|            return 0;    \
  |  |   55|    787|    } while (0)
  |  |  ------------------
  |  |  |  Branch (55:14): [Folded, False: 787]
  |  |  ------------------
  ------------------
   68|    787|            break;
   69|    787|        case OSSL_FUNC_GET_NONCE:
  ------------------
  |  |  190|    787|#define OSSL_FUNC_GET_NONCE 103
  ------------------
  |  Branch (69:9): [True: 787, False: 40.9k]
  ------------------
   70|    787|            set_func(c_get_nonce, OSSL_FUNC_get_nonce(fns));
  ------------------
  |  |   50|    787|    do {                 \
  |  |   51|    787|        if (c == NULL)   \
  |  |  ------------------
  |  |  |  Branch (51:13): [True: 1, False: 786]
  |  |  ------------------
  |  |   52|    787|            c = f;       \
  |  |   53|    787|        else if (c != f) \
  |  |  ------------------
  |  |  |  Branch (53:18): [True: 0, False: 786]
  |  |  ------------------
  |  |   54|    786|            return 0;    \
  |  |   55|    787|    } while (0)
  |  |  ------------------
  |  |  |  Branch (55:14): [Folded, False: 787]
  |  |  ------------------
  ------------------
   71|    787|            break;
   72|    787|        case OSSL_FUNC_GET_USER_NONCE:
  ------------------
  |  |  180|    787|#define OSSL_FUNC_GET_USER_NONCE 99
  ------------------
  |  Branch (72:9): [True: 787, False: 40.9k]
  ------------------
   73|    787|            set_func(c_get_user_nonce, OSSL_FUNC_get_user_nonce(fns));
  ------------------
  |  |   50|    787|    do {                 \
  |  |   51|    787|        if (c == NULL)   \
  |  |  ------------------
  |  |  |  Branch (51:13): [True: 1, False: 786]
  |  |  ------------------
  |  |   52|    787|            c = f;       \
  |  |   53|    787|        else if (c != f) \
  |  |  ------------------
  |  |  |  Branch (53:18): [True: 0, False: 786]
  |  |  ------------------
  |  |   54|    786|            return 0;    \
  |  |   55|    787|    } while (0)
  |  |  ------------------
  |  |  |  Branch (55:14): [Folded, False: 787]
  |  |  ------------------
  ------------------
   74|    787|            break;
   75|    787|        case OSSL_FUNC_CLEANUP_NONCE:
  ------------------
  |  |  191|    787|#define OSSL_FUNC_CLEANUP_NONCE 104
  ------------------
  |  Branch (75:9): [True: 787, False: 40.9k]
  ------------------
   76|    787|            set_func(c_cleanup_nonce, OSSL_FUNC_cleanup_nonce(fns));
  ------------------
  |  |   50|    787|    do {                 \
  |  |   51|    787|        if (c == NULL)   \
  |  |  ------------------
  |  |  |  Branch (51:13): [True: 1, False: 786]
  |  |  ------------------
  |  |   52|    787|            c = f;       \
  |  |   53|    787|        else if (c != f) \
  |  |  ------------------
  |  |  |  Branch (53:18): [True: 0, False: 786]
  |  |  ------------------
  |  |   54|    786|            return 0;    \
  |  |   55|    787|    } while (0)
  |  |  ------------------
  |  |  |  Branch (55:14): [Folded, False: 787]
  |  |  ------------------
  ------------------
   77|    787|            break;
   78|    787|        case OSSL_FUNC_CLEANUP_USER_NONCE:
  ------------------
  |  |  178|    787|#define OSSL_FUNC_CLEANUP_USER_NONCE 97
  ------------------
  |  Branch (78:9): [True: 787, False: 40.9k]
  ------------------
   79|    787|            set_func(c_cleanup_user_nonce, OSSL_FUNC_cleanup_user_nonce(fns));
  ------------------
  |  |   50|    787|    do {                 \
  |  |   51|    787|        if (c == NULL)   \
  |  |  ------------------
  |  |  |  Branch (51:13): [True: 1, False: 786]
  |  |  ------------------
  |  |   52|    787|            c = f;       \
  |  |   53|    787|        else if (c != f) \
  |  |  ------------------
  |  |  |  Branch (53:18): [True: 0, False: 786]
  |  |  ------------------
  |  |   54|    786|            return 0;    \
  |  |   55|    787|    } while (0)
  |  |  ------------------
  |  |  |  Branch (55:14): [Folded, False: 787]
  |  |  ------------------
  ------------------
   80|    787|            break;
   81|  41.7k|        }
   82|  41.7k|#undef set_func
   83|  41.7k|    }
   84|    787|    return 1;
   85|    787|}

ossl_prov_cache_exported_algorithms:
  340|    787|{
  341|    787|    int i, j;
  342|       |
  343|    787|    if (out[0].algorithm_names == NULL) {
  ------------------
  |  Branch (343:9): [True: 1, False: 786]
  ------------------
  344|    140|        for (i = j = 0; in[i].alg.algorithm_names != NULL; ++i) {
  ------------------
  |  Branch (344:25): [True: 139, False: 1]
  ------------------
  345|    139|            if (in[i].capable == NULL || in[i].capable())
  ------------------
  |  Branch (345:17): [True: 126, False: 13]
  |  Branch (345:42): [True: 4, False: 9]
  ------------------
  346|    130|                out[j++] = in[i].alg;
  347|    139|        }
  348|      1|        out[j++] = in[i].alg;
  349|      1|    }
  350|    787|}

ossl_default_provider_init:
  754|    787|{
  755|    787|    OSSL_FUNC_core_get_libctx_fn *c_get_libctx = NULL;
  756|    787|    BIO_METHOD *corebiometh;
  757|       |
  758|    787|    if (!ossl_prov_bio_from_dispatch(in)
  ------------------
  |  Branch (758:9): [True: 0, False: 787]
  ------------------
  759|    787|        || !ossl_prov_seeding_from_dispatch(in))
  ------------------
  |  Branch (759:12): [True: 0, False: 787]
  ------------------
  760|      0|        return 0;
  761|  42.4k|    for (; in->function_id != 0; in++) {
  ------------------
  |  Branch (761:12): [True: 41.7k, False: 787]
  ------------------
  762|  41.7k|        switch (in->function_id) {
  763|    787|        case OSSL_FUNC_CORE_GETTABLE_PARAMS:
  ------------------
  |  |   72|    787|#define OSSL_FUNC_CORE_GETTABLE_PARAMS 1
  ------------------
  |  Branch (763:9): [True: 787, False: 40.9k]
  ------------------
  764|    787|            c_gettable_params = OSSL_FUNC_core_gettable_params(in);
  765|    787|            break;
  766|    787|        case OSSL_FUNC_CORE_GET_PARAMS:
  ------------------
  |  |   75|    787|#define OSSL_FUNC_CORE_GET_PARAMS 2
  ------------------
  |  Branch (766:9): [True: 787, False: 40.9k]
  ------------------
  767|    787|            c_get_params = OSSL_FUNC_core_get_params(in);
  768|    787|            break;
  769|    787|        case OSSL_FUNC_CORE_GET_LIBCTX:
  ------------------
  |  |   79|    787|#define OSSL_FUNC_CORE_GET_LIBCTX 4
  ------------------
  |  Branch (769:9): [True: 787, False: 40.9k]
  ------------------
  770|    787|            c_get_libctx = OSSL_FUNC_core_get_libctx(in);
  771|    787|            break;
  772|  39.3k|        default:
  ------------------
  |  Branch (772:9): [True: 39.3k, False: 2.36k]
  ------------------
  773|       |            /* Just ignore anything we don't understand */
  774|  39.3k|            break;
  775|  41.7k|        }
  776|  41.7k|    }
  777|       |
  778|    787|    if (c_get_libctx == NULL)
  ------------------
  |  Branch (778:9): [True: 0, False: 787]
  ------------------
  779|      0|        return 0;
  780|       |
  781|       |    /*
  782|       |     * We want to make sure that all calls from this provider that requires
  783|       |     * a library context use the same context as the one used to call our
  784|       |     * functions.  We do that by passing it along in the provider context.
  785|       |     *
  786|       |     * This only works for built-in providers.  Most providers should
  787|       |     * create their own library context.
  788|       |     */
  789|    787|    if ((*provctx = ossl_prov_ctx_new()) == NULL
  ------------------
  |  Branch (789:9): [True: 0, False: 787]
  ------------------
  790|    787|        || (corebiometh = ossl_bio_prov_init_bio_method()) == NULL) {
  ------------------
  |  Branch (790:12): [True: 0, False: 787]
  ------------------
  791|      0|        ossl_prov_ctx_free(*provctx);
  792|      0|        *provctx = NULL;
  793|      0|        return 0;
  794|      0|    }
  795|    787|    ossl_prov_ctx_set0_libctx(*provctx,
  796|    787|        (OSSL_LIB_CTX *)c_get_libctx(handle));
  797|    787|    ossl_prov_ctx_set0_handle(*provctx, handle);
  798|    787|    ossl_prov_ctx_set0_core_bio_method(*provctx, corebiometh);
  799|    787|    ossl_prov_ctx_set0_core_get_params(*provctx, c_get_params);
  800|       |
  801|    787|    *out = deflt_dispatch_table;
  802|    787|    ossl_prov_cache_exported_algorithms(deflt_ciphers, exported_ciphers);
  803|       |
  804|    787|    return 1;
  805|    787|}
defltprov.c:deflt_teardown:
  732|    787|{
  733|    787|    BIO_meth_free(ossl_prov_ctx_get0_core_bio_method(provctx));
  734|    787|    ossl_prov_ctx_free(provctx);
  735|    787|}
defltprov.c:deflt_query:
  696|  75.9k|{
  697|  75.9k|    *no_cache = 0;
  698|  75.9k|    switch (operation_id) {
  ------------------
  |  Branch (698:13): [True: 75.9k, False: 0]
  ------------------
  699|  24.2k|    case OSSL_OP_DIGEST:
  ------------------
  |  |  283|  24.2k|#define OSSL_OP_DIGEST 1
  ------------------
  |  Branch (699:5): [True: 24.2k, False: 51.6k]
  ------------------
  700|  24.2k|        return deflt_digests;
  701|  31.9k|    case OSSL_OP_CIPHER:
  ------------------
  |  |  284|  31.9k|#define OSSL_OP_CIPHER 2 /* Symmetric Ciphers */
  ------------------
  |  Branch (701:5): [True: 31.9k, False: 43.9k]
  ------------------
  702|  31.9k|        return exported_ciphers;
  703|      0|    case OSSL_OP_MAC:
  ------------------
  |  |  285|      0|#define OSSL_OP_MAC 3
  ------------------
  |  Branch (703:5): [True: 0, False: 75.9k]
  ------------------
  704|      0|        return deflt_macs;
  705|      0|    case OSSL_OP_KDF:
  ------------------
  |  |  286|      0|#define OSSL_OP_KDF 4
  ------------------
  |  Branch (705:5): [True: 0, False: 75.9k]
  ------------------
  706|      0|        return deflt_kdfs;
  707|  1.09k|    case OSSL_OP_RAND:
  ------------------
  |  |  287|  1.09k|#define OSSL_OP_RAND 5
  ------------------
  |  Branch (707:5): [True: 1.09k, False: 74.8k]
  ------------------
  708|  1.09k|        return deflt_rands;
  709|  16.1k|    case OSSL_OP_KEYMGMT:
  ------------------
  |  |  288|  16.1k|#define OSSL_OP_KEYMGMT 10
  ------------------
  |  Branch (709:5): [True: 16.1k, False: 59.7k]
  ------------------
  710|  16.1k|        return deflt_keymgmt;
  711|  1.26k|    case OSSL_OP_KEYEXCH:
  ------------------
  |  |  289|  1.26k|#define OSSL_OP_KEYEXCH 11
  ------------------
  |  Branch (711:5): [True: 1.26k, False: 74.6k]
  ------------------
  712|  1.26k|        return deflt_keyexch;
  713|  1.26k|    case OSSL_OP_SIGNATURE:
  ------------------
  |  |  290|  1.26k|#define OSSL_OP_SIGNATURE 12
  ------------------
  |  Branch (713:5): [True: 1.26k, False: 74.6k]
  ------------------
  714|  1.26k|        return deflt_signature;
  715|      0|    case OSSL_OP_ASYM_CIPHER:
  ------------------
  |  |  291|      0|#define OSSL_OP_ASYM_CIPHER 13
  ------------------
  |  Branch (715:5): [True: 0, False: 75.9k]
  ------------------
  716|      0|        return deflt_asym_cipher;
  717|      0|    case OSSL_OP_KEM:
  ------------------
  |  |  292|      0|#define OSSL_OP_KEM 14
  ------------------
  |  Branch (717:5): [True: 0, False: 75.9k]
  ------------------
  718|      0|        return deflt_asym_kem;
  719|      0|    case OSSL_OP_ENCODER:
  ------------------
  |  |  295|      0|#define OSSL_OP_ENCODER 20
  ------------------
  |  Branch (719:5): [True: 0, False: 75.9k]
  ------------------
  720|      0|        return deflt_encoder;
  721|      4|    case OSSL_OP_DECODER:
  ------------------
  |  |  296|      4|#define OSSL_OP_DECODER 21
  ------------------
  |  Branch (721:5): [True: 4, False: 75.8k]
  ------------------
  722|      4|        return deflt_decoder;
  723|      0|    case OSSL_OP_STORE:
  ------------------
  |  |  297|      0|#define OSSL_OP_STORE 22
  ------------------
  |  Branch (723:5): [True: 0, False: 75.9k]
  ------------------
  724|      0|        return deflt_store;
  725|      0|    case OSSL_OP_SKEYMGMT:
  ------------------
  |  |  293|      0|#define OSSL_OP_SKEYMGMT 15
  ------------------
  |  Branch (725:5): [True: 0, False: 75.9k]
  ------------------
  726|      0|        return deflt_skeymgmt;
  727|  75.9k|    }
  728|      0|    return NULL;
  729|  75.9k|}

cipher_aes.c:aes_freectx:
   28|  4.94k|{
   29|  4.94k|    PROV_AES_CTX *ctx = (PROV_AES_CTX *)vctx;
   30|       |
   31|  4.94k|    ossl_cipher_generic_reset_ctx((PROV_CIPHER_CTX *)vctx);
   32|  4.94k|    OPENSSL_clear_free(ctx, sizeof(*ctx));
  ------------------
  |  |  129|  4.94k|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|  4.94k|}

cipher_aes_cbc_hmac_sha.c:aes_128_cbc_hmac_sha1_get_params:
  401|    632|    {                                                                               \
  402|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,            \
  ------------------
  |  |  312|    632|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  403|    632|            flags, kbits, blkbits, ivbits);                                         \
  404|    632|    }                                                                               \
cipher_aes_cbc_hmac_sha.c:aes_gettable_ctx_params:
  301|  2.52k|{
  302|  2.52k|    return cipher_aes_known_gettable_ctx_params;
  303|  2.52k|}
cipher_aes_cbc_hmac_sha.c:aes_256_cbc_hmac_sha1_get_params:
  401|    632|    {                                                                               \
  402|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,            \
  ------------------
  |  |  312|    632|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  403|    632|            flags, kbits, blkbits, ivbits);                                         \
  404|    632|    }                                                                               \
cipher_aes_cbc_hmac_sha.c:aes_128_cbc_hmac_sha256_get_params:
  401|    632|    {                                                                               \
  402|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,            \
  ------------------
  |  |  312|    632|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  403|    632|            flags, kbits, blkbits, ivbits);                                         \
  404|    632|    }                                                                               \
cipher_aes_cbc_hmac_sha.c:aes_256_cbc_hmac_sha256_get_params:
  401|    632|    {                                                                               \
  402|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_CBC_MODE,            \
  ------------------
  |  |  312|    632|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  403|    632|            flags, kbits, blkbits, ivbits);                                         \
  404|    632|    }                                                                               \

ossl_cipher_capable_aes_cbc_hmac_sha1_etm:
   14|      3|{
   15|      3|    return 0;
   16|      3|}

ossl_cipher_capable_aes_cbc_hmac_sha1:
   41|      2|{
   42|      2|    return AESNI_CBC_HMAC_SHA_CAPABLE;
  ------------------
  |  |  171|      2|#define AESNI_CBC_HMAC_SHA_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  ------------------
   43|      2|}

ossl_cipher_capable_aes_cbc_hmac_sha256_etm:
   14|      3|{
   15|      3|    return 0;
   16|      3|}

ossl_cipher_capable_aes_cbc_hmac_sha256:
   41|      2|{
   42|      2|    return AESNI_CBC_HMAC_SHA_CAPABLE
  ------------------
  |  |  171|      4|#define AESNI_CBC_HMAC_SHA_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  ------------------
  |  |  |  Branch (171:36): [True: 2, False: 0]
  |  |  ------------------
  ------------------
   43|      2|        && aesni_cbc_sha256_enc(NULL, NULL, 0, NULL, NULL, NULL, NULL);
  ------------------
  |  Branch (43:12): [True: 2, False: 0]
  ------------------
   44|      2|}

ossl_cipher_capable_aes_cbc_hmac_sha512_etm:
   20|      3|{
   21|      3|    return 0;
   22|      3|}

cipher_aes_gcm_siv.c:ossl_aes_128_gcm_siv_get_params:
  288|    632|    {                                                                                                      \
  289|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,                            \
  ------------------
  |  |  322|    632|#define EVP_CIPH_GCM_SIV_MODE 0x10005
  ------------------
  290|    632|            flags, kbits, blkbits, ivbits);                                                                \
  291|    632|    }                                                                                                      \
cipher_aes_gcm_siv.c:ossl_aes_gcm_siv_gettable_ctx_params:
  211|  1.89k|{
  212|  1.89k|    return aes_gcm_siv_known_gettable_ctx_params;
  213|  1.89k|}
cipher_aes_gcm_siv.c:ossl_aes_192_gcm_siv_get_params:
  288|    632|    {                                                                                                      \
  289|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,                            \
  ------------------
  |  |  322|    632|#define EVP_CIPH_GCM_SIV_MODE 0x10005
  ------------------
  290|    632|            flags, kbits, blkbits, ivbits);                                                                \
  291|    632|    }                                                                                                      \
cipher_aes_gcm_siv.c:ossl_aes_256_gcm_siv_get_params:
  288|    632|    {                                                                                                      \
  289|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,                            \
  ------------------
  |  |  322|    632|#define EVP_CIPH_GCM_SIV_MODE 0x10005
  ------------------
  290|    632|            flags, kbits, blkbits, ivbits);                                                                \
  291|    632|    }                                                                                                      \

ossl_prov_cipher_hw_aes_ecb:
  139|  3.29k|    {                                                   \
  140|  3.29k|        PROV_CIPHER_HW_select(mode) return &aes_##mode; \
  ------------------
  |  |   79|  3.29k|#define PROV_CIPHER_HW_select(mode)                                            \
  |  |   80|  3.29k|if (AESNI_CAPABLE)                                                             \
  |  |  ------------------
  |  |  |  |  185|  3.29k|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (185:23): [True: 3.29k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|  3.29k|    return &aesni_##mode;
  ------------------
  141|  3.29k|    }
ossl_prov_cipher_hw_aes_ctr:
  139|  1.64k|    {                                                   \
  140|  1.64k|        PROV_CIPHER_HW_select(mode) return &aes_##mode; \
  ------------------
  |  |   79|  1.64k|#define PROV_CIPHER_HW_select(mode)                                            \
  |  |   80|  1.64k|if (AESNI_CAPABLE)                                                             \
  |  |  ------------------
  |  |  |  |  185|  1.64k|#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1] & (1 << (57 - 32)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (185:23): [True: 1.64k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|  1.64k|    return &aesni_##mode;
  ------------------
  141|  1.64k|    }

cipher_aes_hw.c:cipher_hw_aesni_initkey:
   20|  87.2k|{
   21|  87.2k|    int ret;
   22|  87.2k|    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
   23|  87.2k|    AES_KEY *ks = &adat->ks.ks;
   24|       |
   25|  87.2k|    dat->ks = ks;
   26|       |
   27|  87.2k|    if ((dat->mode == EVP_CIPH_ECB_MODE || dat->mode == EVP_CIPH_CBC_MODE)
  ------------------
  |  |  311|   174k|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
                  if ((dat->mode == EVP_CIPH_ECB_MODE || dat->mode == EVP_CIPH_CBC_MODE)
  ------------------
  |  |  312|  39.5k|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  |  Branch (27:10): [True: 47.7k, False: 39.5k]
  |  Branch (27:44): [True: 0, False: 39.5k]
  ------------------
   28|  47.7k|        && !dat->enc) {
  ------------------
  |  Branch (28:12): [True: 0, False: 47.7k]
  ------------------
   29|      0|        ret = aesni_set_decrypt_key(key, (int)(keylen * 8), ks);
   30|      0|        dat->block = (block128_f) aesni_decrypt;
   31|      0|        dat->stream.cbc = dat->mode == EVP_CIPH_CBC_MODE ?
  ------------------
  |  |  312|      0|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  |  Branch (31:27): [True: 0, False: 0]
  ------------------
   32|      0|            (cbc128_f) aesni_cbc_encrypt : NULL;
   33|  87.2k|    } else {
   34|  87.2k|        ret = aesni_set_encrypt_key(key, (int)(keylen * 8), ks);
   35|  87.2k|        dat->block = (block128_f) aesni_encrypt;
   36|  87.2k|        if (dat->mode == EVP_CIPH_CBC_MODE)
  ------------------
  |  |  312|  87.2k|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  |  Branch (36:13): [True: 0, False: 87.2k]
  ------------------
   37|      0|            dat->stream.cbc = (cbc128_f) aesni_cbc_encrypt;
   38|  87.2k|        else if (dat->mode == EVP_CIPH_CTR_MODE)
  ------------------
  |  |  315|  87.2k|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  |  Branch (38:18): [True: 39.5k, False: 47.7k]
  ------------------
   39|  39.5k|            dat->stream.ctr = (ctr128_f) aesni_ctr32_encrypt_blocks;
   40|  47.7k|        else
   41|  47.7k|            dat->stream.cbc = NULL;
   42|  87.2k|    }
   43|       |
   44|  87.2k|    if (ret < 0) {
  ------------------
  |  Branch (44:9): [True: 0, False: 87.2k]
  ------------------
   45|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   46|      0|        return 0;
   47|      0|    }
   48|       |
   49|  87.2k|    return 1;
   50|  87.2k|}
cipher_aes_hw.c:cipher_hw_aesni_ecb:
   64|  76.8k|{
   65|  76.8k|    if (len < ctx->blocksize)
  ------------------
  |  Branch (65:9): [True: 0, False: 76.8k]
  ------------------
   66|      0|        return 1;
   67|       |
   68|  76.8k|    aesni_ecb_encrypt(in, out, len, ctx->ks, ctx->enc);
   69|       |
   70|  76.8k|    return 1;
   71|  76.8k|}

cipher_aes_ocb.c:aes_256_ocb_get_params:
  527|    632|    {                                                                           \
  528|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  320|    632|#define EVP_CIPH_OCB_MODE 0x10003
  ------------------
  529|    632|            flags, kbits, blkbits, ivbits);                                     \
  530|    632|    }                                                                           \
cipher_aes_ocb.c:cipher_ocb_gettable_ctx_params:
  486|  1.89k|{
  487|  1.89k|    return cipher_ocb_known_gettable_ctx_params;
  488|  1.89k|}
cipher_aes_ocb.c:aes_192_ocb_get_params:
  527|    632|    {                                                                           \
  528|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  320|    632|#define EVP_CIPH_OCB_MODE 0x10003
  ------------------
  529|    632|            flags, kbits, blkbits, ivbits);                                     \
  530|    632|    }                                                                           \
cipher_aes_ocb.c:aes_128_ocb_get_params:
  527|    632|    {                                                                           \
  528|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  320|    632|#define EVP_CIPH_OCB_MODE 0x10003
  ------------------
  529|    632|            flags, kbits, blkbits, ivbits);                                     \
  530|    632|    }                                                                           \

cipher_aes_siv.c:aes_128_siv_get_params:
  261|    632|    {                                                                            \
  262|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  321|    632|#define EVP_CIPH_SIV_MODE 0x10004
  ------------------
  263|    632|            flags, 2 * kbits, blkbits, ivbits);                                  \
  264|    632|    }                                                                            \
cipher_aes_siv.c:aes_siv_gettable_ctx_params:
  186|  1.89k|{
  187|  1.89k|    return aes_siv_known_gettable_ctx_params;
  188|  1.89k|}
cipher_aes_siv.c:aes_192_siv_get_params:
  261|    632|    {                                                                            \
  262|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  321|    632|#define EVP_CIPH_SIV_MODE 0x10004
  ------------------
  263|    632|            flags, 2 * kbits, blkbits, ivbits);                                  \
  264|    632|    }                                                                            \
cipher_aes_siv.c:aes_256_siv_get_params:
  261|    632|    {                                                                            \
  262|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  321|    632|#define EVP_CIPH_SIV_MODE 0x10004
  ------------------
  263|    632|            flags, 2 * kbits, blkbits, ivbits);                                  \
  264|    632|    }                                                                            \

cipher_aes_wrp.c:aes_256_wrap_get_params:
  288|    632|    {                                                                           \
  289|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  319|    632|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  290|    632|            flags, kbits, blkbits, ivbits);                                     \
  291|    632|    }                                                                           \
cipher_aes_wrp.c:aes_192_wrap_get_params:
  288|    632|    {                                                                           \
  289|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  319|    632|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  290|    632|            flags, kbits, blkbits, ivbits);                                     \
  291|    632|    }                                                                           \
cipher_aes_wrp.c:aes_128_wrap_get_params:
  288|    632|    {                                                                           \
  289|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  319|    632|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  290|    632|            flags, kbits, blkbits, ivbits);                                     \
  291|    632|    }                                                                           \
cipher_aes_wrp.c:aes_256_wrappad_get_params:
  288|    632|    {                                                                           \
  289|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  319|    632|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  290|    632|            flags, kbits, blkbits, ivbits);                                     \
  291|    632|    }                                                                           \
cipher_aes_wrp.c:aes_192_wrappad_get_params:
  288|    632|    {                                                                           \
  289|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  319|    632|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  290|    632|            flags, kbits, blkbits, ivbits);                                     \
  291|    632|    }                                                                           \
cipher_aes_wrp.c:aes_128_wrappad_get_params:
  288|    632|    {                                                                           \
  289|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  319|    632|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  290|    632|            flags, kbits, blkbits, ivbits);                                     \
  291|    632|    }                                                                           \
cipher_aes_wrp.c:aes_256_wrapinv_get_params:
  288|    632|    {                                                                           \
  289|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  319|    632|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  290|    632|            flags, kbits, blkbits, ivbits);                                     \
  291|    632|    }                                                                           \
cipher_aes_wrp.c:aes_192_wrapinv_get_params:
  288|    632|    {                                                                           \
  289|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  319|    632|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  290|    632|            flags, kbits, blkbits, ivbits);                                     \
  291|    632|    }                                                                           \
cipher_aes_wrp.c:aes_128_wrapinv_get_params:
  288|    632|    {                                                                           \
  289|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  319|    632|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  290|    632|            flags, kbits, blkbits, ivbits);                                     \
  291|    632|    }                                                                           \
cipher_aes_wrp.c:aes_256_wrappadinv_get_params:
  288|    632|    {                                                                           \
  289|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  319|    632|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  290|    632|            flags, kbits, blkbits, ivbits);                                     \
  291|    632|    }                                                                           \
cipher_aes_wrp.c:aes_192_wrappadinv_get_params:
  288|    632|    {                                                                           \
  289|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  319|    632|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  290|    632|            flags, kbits, blkbits, ivbits);                                     \
  291|    632|    }                                                                           \
cipher_aes_wrp.c:aes_128_wrappadinv_get_params:
  288|    632|    {                                                                           \
  289|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  319|    632|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  290|    632|            flags, kbits, blkbits, ivbits);                                     \
  291|    632|    }                                                                           \

cipher_aes_xts.c:aes_256_xts_get_params:
  282|    632|    {                                                                              \
  283|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  ------------------
  |  |  318|    632|#define EVP_CIPH_XTS_MODE 0x10001
  ------------------
  284|    632|            flags, 2 * kbits, AES_XTS_BLOCK_BITS,                                  \
  ------------------
  |  |   25|    632|#define AES_XTS_BLOCK_BITS 8
  ------------------
  285|    632|            AES_XTS_IV_BITS);                                                      \
  ------------------
  |  |   24|    632|#define AES_XTS_IV_BITS 128
  ------------------
  286|    632|    }                                                                              \
cipher_aes_xts.c:aes_128_xts_get_params:
  282|    632|    {                                                                              \
  283|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  ------------------
  |  |  318|    632|#define EVP_CIPH_XTS_MODE 0x10001
  ------------------
  284|    632|            flags, 2 * kbits, AES_XTS_BLOCK_BITS,                                  \
  ------------------
  |  |   25|    632|#define AES_XTS_BLOCK_BITS 8
  ------------------
  285|    632|            AES_XTS_IV_BITS);                                                      \
  ------------------
  |  |   24|    632|#define AES_XTS_IV_BITS 128
  ------------------
  286|    632|    }                                                                              \

cipher_chacha20.c:chacha20_get_params:
   96|    632|{
   97|    632|    return ossl_cipher_generic_get_params(params, 0, CHACHA20_FLAGS,
  ------------------
  |  |   21|    632|#define CHACHA20_FLAGS (PROV_CIPHER_FLAG_CUSTOM_IV)
  |  |  ------------------
  |  |  |  |   40|    632|#define PROV_CIPHER_FLAG_CUSTOM_IV 0x0002
  |  |  ------------------
  ------------------
   98|    632|        CHACHA20_KEYLEN * 8,
  ------------------
  |  |   18|    632|#define CHACHA20_KEYLEN (CHACHA_KEY_SIZE)
  |  |  ------------------
  |  |  |  |   44|    632|#define CHACHA_KEY_SIZE 32
  |  |  ------------------
  ------------------
   99|    632|        CHACHA20_BLKLEN * 8,
  ------------------
  |  |   19|    632|#define CHACHA20_BLKLEN (1)
  ------------------
  100|    632|        CHACHA20_IVLEN * 8);
  ------------------
  |  |   20|    632|#define CHACHA20_IVLEN (CHACHA_CTR_SIZE)
  |  |  ------------------
  |  |  |  |   45|    632|#define CHACHA_CTR_SIZE 16
  |  |  ------------------
  ------------------
  101|    632|}
cipher_chacha20.c:chacha20_gettable_ctx_params:
  141|    632|{
  142|    632|    return chacha20_known_gettable_ctx_params;
  143|    632|}

cipher_chacha20_poly1305.c:chacha20_poly1305_get_params:
   96|  3.11k|{
   97|  3.11k|    return ossl_cipher_generic_get_params(params, 0, CHACHA20_POLY1305_FLAGS,
  ------------------
  |  |   25|  3.11k|#define CHACHA20_POLY1305_FLAGS (PROV_CIPHER_FLAG_AEAD \
  |  |  ------------------
  |  |  |  |   39|  3.11k|#define PROV_CIPHER_FLAG_AEAD 0x0001
  |  |  ------------------
  |  |   26|  3.11k|    | PROV_CIPHER_FLAG_CUSTOM_IV)
  |  |  ------------------
  |  |  |  |   40|  3.11k|#define PROV_CIPHER_FLAG_CUSTOM_IV 0x0002
  |  |  ------------------
  ------------------
   98|  3.11k|        CHACHA20_POLY1305_KEYLEN * 8,
  ------------------
  |  |   21|  3.11k|#define CHACHA20_POLY1305_KEYLEN CHACHA_KEY_SIZE
  |  |  ------------------
  |  |  |  |   44|  3.11k|#define CHACHA_KEY_SIZE 32
  |  |  ------------------
  ------------------
   99|  3.11k|        CHACHA20_POLY1305_BLKLEN * 8,
  ------------------
  |  |   22|  3.11k|#define CHACHA20_POLY1305_BLKLEN 1
  ------------------
  100|  3.11k|        CHACHA20_POLY1305_IVLEN * 8);
  ------------------
  |  |   16|  3.11k|#define CHACHA20_POLY1305_IVLEN 12
  ------------------
  101|  3.11k|}
cipher_chacha20_poly1305.c:chacha20_poly1305_gettable_ctx_params:
  262|    632|{
  263|    632|    return chacha20_poly1305_get_ctx_params_list;
  264|    632|}

cipher_aes.c:aes_cts_256_cbc_get_params:
   17|    632|    {                                                                            \
   18|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  312|    632|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
   19|    632|            flags, kbits, blkbits, ivbits);                                      \
   20|    632|    }                                                                            \
cipher_aes.c:aes_cts_192_cbc_get_params:
   17|    632|    {                                                                            \
   18|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  312|    632|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
   19|    632|            flags, kbits, blkbits, ivbits);                                      \
   20|    632|    }                                                                            \
cipher_aes.c:aes_cts_128_cbc_get_params:
   17|    632|    {                                                                            \
   18|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  312|    632|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
   19|    632|            flags, kbits, blkbits, ivbits);                                      \
   20|    632|    }                                                                            \
cipher_camellia.c:camellia_cts_256_cbc_get_params:
   17|    632|    {                                                                            \
   18|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  312|    632|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
   19|    632|            flags, kbits, blkbits, ivbits);                                      \
   20|    632|    }                                                                            \
cipher_camellia.c:camellia_cts_192_cbc_get_params:
   17|    632|    {                                                                            \
   18|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  312|    632|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
   19|    632|            flags, kbits, blkbits, ivbits);                                      \
   20|    632|    }                                                                            \
cipher_camellia.c:camellia_cts_128_cbc_get_params:
   17|    632|    {                                                                            \
   18|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,  \
  ------------------
  |  |  312|    632|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
   19|    632|            flags, kbits, blkbits, ivbits);                                      \
   20|    632|    }                                                                            \

cipher_null.c:null_get_params:
  104|    632|{
  105|    632|    return ossl_cipher_generic_get_params(params, 0, 0, 0, 8, 0);
  106|    632|}
cipher_null.c:null_gettable_ctx_params:
  118|    632|{
  119|    632|    return null_known_gettable_ctx_params;
  120|    632|}

cipher_sm4_xts.c:sm4_128_xts_get_params:
  246|    632|    {                                                                              \
  247|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,    \
  ------------------
  |  |  318|    632|#define EVP_CIPH_XTS_MODE 0x10001
  ------------------
  248|    632|            flags, 2 * kbits, SM4_XTS_BLOCK_BITS,                                  \
  ------------------
  |  |   20|    632|#define SM4_XTS_BLOCK_BITS 8
  ------------------
  249|    632|            SM4_XTS_IV_BITS);                                                      \
  ------------------
  |  |   19|    632|#define SM4_XTS_IV_BITS 128
  ------------------
  250|    632|    }                                                                              \

cipher_tdes.c:tdes_ede3_ecb_get_params:
   44|    632|    {                                                                              \
   45|    632|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  311|    632|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
   46|    632|            flags, kbits, blkbits, ivbits);                                        \
   47|    632|    }                                                                              \
cipher_tdes.c:tdes_ede3_cbc_get_params:
   44|  3.11k|    {                                                                              \
   45|  3.11k|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  312|  3.11k|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
   46|  3.11k|            flags, kbits, blkbits, ivbits);                                        \
   47|  3.11k|    }                                                                              \
cipher_tdes_default.c:tdes_ede3_ofb_get_params:
   44|    632|    {                                                                              \
   45|    632|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  314|    632|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
   46|    632|            flags, kbits, blkbits, ivbits);                                        \
   47|    632|    }                                                                              \
cipher_tdes_default.c:tdes_ede3_cfb_get_params:
   44|    632|    {                                                                              \
   45|    632|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
   46|    632|            flags, kbits, blkbits, ivbits);                                        \
   47|    632|    }                                                                              \
cipher_tdes_default.c:tdes_ede3_cfb1_get_params:
   44|    632|    {                                                                              \
   45|    632|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
   46|    632|            flags, kbits, blkbits, ivbits);                                        \
   47|    632|    }                                                                              \
cipher_tdes_default.c:tdes_ede3_cfb8_get_params:
   44|    632|    {                                                                              \
   45|    632|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
   46|    632|            flags, kbits, blkbits, ivbits);                                        \
   47|    632|    }                                                                              \
cipher_tdes_default.c:tdes_ede2_ecb_get_params:
   44|    632|    {                                                                              \
   45|    632|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  311|    632|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
   46|    632|            flags, kbits, blkbits, ivbits);                                        \
   47|    632|    }                                                                              \
cipher_tdes_default.c:tdes_ede2_cbc_get_params:
   44|    632|    {                                                                              \
   45|    632|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  312|    632|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
   46|    632|            flags, kbits, blkbits, ivbits);                                        \
   47|    632|    }                                                                              \
cipher_tdes_default.c:tdes_ede2_ofb_get_params:
   44|    632|    {                                                                              \
   45|    632|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  314|    632|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
   46|    632|            flags, kbits, blkbits, ivbits);                                        \
   47|    632|    }                                                                              \
cipher_tdes_default.c:tdes_ede2_cfb_get_params:
   44|    632|    {                                                                              \
   45|    632|        return ossl_tdes_get_params(params, EVP_CIPH_##UCMODE##_MODE,              \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
   46|    632|            flags, kbits, blkbits, ivbits);                                        \
   47|    632|    }                                                                              \

ossl_tdes_get_params:
  185|  8.79k|{
  186|       |#ifdef FIPS_MODULE
  187|       |    const int decrypt_only = 1;
  188|       |#else
  189|  8.79k|    const int decrypt_only = 0;
  190|  8.79k|#endif
  191|  8.79k|    OSSL_PARAM *p;
  192|       |
  193|  8.79k|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_DECRYPT_ONLY);
  ------------------
  |  |  193|  8.79k|# define OSSL_CIPHER_PARAM_DECRYPT_ONLY "decrypt-only"
  ------------------
  194|  8.79k|    if (p != NULL && !OSSL_PARAM_set_int(p, decrypt_only)) {
  ------------------
  |  Branch (194:9): [True: 2.47k, False: 6.32k]
  |  Branch (194:22): [True: 0, False: 2.47k]
  ------------------
  195|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  196|      0|        return 0;
  197|      0|    }
  198|       |
  199|  8.79k|    return ossl_cipher_generic_get_params(params, md, flags,
  200|  8.79k|        kbits, blkbits, ivbits);
  201|  8.79k|}

cipher_tdes_wrap.c:tdes_wrap_get_params:
  181|    632|    {                                                                            \
  182|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_WRAP_MODE, flags, \
  ------------------
  |  |  319|    632|#define EVP_CIPH_WRAP_MODE 0x10002
  ------------------
  183|    632|            kbits, blkbits, ivbits);                                             \
  184|    632|    }                                                                            \

ossl_cipher_generic_get_params:
  205|   116k|{
  206|   116k|    struct ossl_cipher_generic_get_params_st p;
  207|       |
  208|   116k|    if (!ossl_cipher_generic_get_params_decoder(params, &p))
  ------------------
  |  Branch (208:9): [True: 0, False: 116k]
  ------------------
  209|      0|        return 0;
  210|       |
  211|   116k|    if (p.mode != NULL && !OSSL_PARAM_set_uint(p.mode, md)) {
  ------------------
  |  Branch (211:9): [True: 82.1k, False: 34.7k]
  |  Branch (211:27): [True: 0, False: 82.1k]
  ------------------
  212|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  213|      0|        return 0;
  214|      0|    }
  215|   116k|    if (p.aead != NULL
  ------------------
  |  Branch (215:9): [True: 82.1k, False: 34.7k]
  ------------------
  216|  82.1k|        && !OSSL_PARAM_set_int(p.aead, (flags & PROV_CIPHER_FLAG_AEAD) != 0)) {
  ------------------
  |  |   39|  82.1k|#define PROV_CIPHER_FLAG_AEAD 0x0001
  ------------------
  |  Branch (216:12): [True: 0, False: 82.1k]
  ------------------
  217|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  218|      0|        return 0;
  219|      0|    }
  220|   116k|    if (p.custiv != NULL
  ------------------
  |  Branch (220:9): [True: 82.1k, False: 34.7k]
  ------------------
  221|  82.1k|        && !OSSL_PARAM_set_int(p.custiv, (flags & PROV_CIPHER_FLAG_CUSTOM_IV) != 0)) {
  ------------------
  |  |   40|  82.1k|#define PROV_CIPHER_FLAG_CUSTOM_IV 0x0002
  ------------------
  |  Branch (221:12): [True: 0, False: 82.1k]
  ------------------
  222|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  223|      0|        return 0;
  224|      0|    }
  225|   116k|    if (p.cts != NULL
  ------------------
  |  Branch (225:9): [True: 82.1k, False: 34.7k]
  ------------------
  226|  82.1k|        && !OSSL_PARAM_set_int(p.cts, (flags & PROV_CIPHER_FLAG_CTS) != 0)) {
  ------------------
  |  |   41|  82.1k|#define PROV_CIPHER_FLAG_CTS 0x0004
  ------------------
  |  Branch (226:12): [True: 0, False: 82.1k]
  ------------------
  227|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  228|      0|        return 0;
  229|      0|    }
  230|   116k|    if (p.mb != NULL
  ------------------
  |  Branch (230:9): [True: 82.1k, False: 34.7k]
  ------------------
  231|  82.1k|        && !OSSL_PARAM_set_int(p.mb, (flags & PROV_CIPHER_FLAG_TLS1_MULTIBLOCK) != 0)) {
  ------------------
  |  |   42|  82.1k|#define PROV_CIPHER_FLAG_TLS1_MULTIBLOCK 0x0008
  ------------------
  |  Branch (231:12): [True: 0, False: 82.1k]
  ------------------
  232|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  233|      0|        return 0;
  234|      0|    }
  235|   116k|    if (p.rand != NULL
  ------------------
  |  Branch (235:9): [True: 82.1k, False: 34.7k]
  ------------------
  236|  82.1k|        && !OSSL_PARAM_set_int(p.rand, (flags & PROV_CIPHER_FLAG_RAND_KEY) != 0)) {
  ------------------
  |  |   43|  82.1k|#define PROV_CIPHER_FLAG_RAND_KEY 0x0010
  ------------------
  |  Branch (236:12): [True: 0, False: 82.1k]
  ------------------
  237|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  238|      0|        return 0;
  239|      0|    }
  240|   116k|    if (p.etm != NULL
  ------------------
  |  Branch (240:9): [True: 82.1k, False: 34.7k]
  ------------------
  241|  82.1k|        && !OSSL_PARAM_set_int(p.etm, (flags & EVP_CIPH_FLAG_ENC_THEN_MAC) != 0)) {
  ------------------
  |  |  368|  82.1k|#define EVP_CIPH_FLAG_ENC_THEN_MAC 0x10000000
  ------------------
  |  Branch (241:12): [True: 0, False: 82.1k]
  ------------------
  242|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  243|      0|        return 0;
  244|      0|    }
  245|   116k|    if (p.keylen != NULL && !OSSL_PARAM_set_size_t(p.keylen, kbits / 8)) {
  ------------------
  |  Branch (245:9): [True: 82.1k, False: 34.7k]
  |  Branch (245:29): [True: 0, False: 82.1k]
  ------------------
  246|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  247|      0|        return 0;
  248|      0|    }
  249|   116k|    if (p.bsize != NULL && !OSSL_PARAM_set_size_t(p.bsize, blkbits / 8)) {
  ------------------
  |  Branch (249:9): [True: 82.1k, False: 34.7k]
  |  Branch (249:28): [True: 0, False: 82.1k]
  ------------------
  250|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  251|      0|        return 0;
  252|      0|    }
  253|   116k|    if (p.ivlen != NULL && !OSSL_PARAM_set_size_t(p.ivlen, ivbits / 8)) {
  ------------------
  |  Branch (253:9): [True: 82.1k, False: 34.7k]
  |  Branch (253:28): [True: 0, False: 82.1k]
  ------------------
  254|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  255|      0|        return 0;
  256|      0|    }
  257|   116k|    return 1;
  258|   116k|}
ossl_cipher_generic_gettable_ctx_params:
  392|  52.4k|{
  393|  52.4k|    return cipher_generic_get_ctx_params_list;
  394|  52.4k|}
ossl_cipher_generic_reset_ctx:
  684|  4.94k|{
  685|  4.94k|    if (ctx != NULL && ctx->alloced) {
  ------------------
  |  Branch (685:9): [True: 4.94k, False: 0]
  |  Branch (685:24): [True: 0, False: 4.94k]
  ------------------
  686|      0|        OPENSSL_free(ctx->tlsmac);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  687|      0|        ctx->alloced = 0;
  688|       |        ctx->tlsmac = NULL;
  689|      0|    }
  690|  4.94k|}
ossl_cipher_generic_einit:
  735|   125k|{
  736|   125k|    return cipher_generic_init_internal((PROV_CIPHER_CTX *)vctx, key, keylen,
  737|   125k|        iv, ivlen, params, 1);
  738|   125k|}
ossl_cipher_generic_block_update:
  776|  76.8k|{
  777|  76.8k|    size_t outlint = 0;
  778|  76.8k|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  779|  76.8k|    size_t blksz = ctx->blocksize;
  780|  76.8k|    size_t nextblocks;
  781|       |
  782|  76.8k|    if (!ctx->key_set) {
  ------------------
  |  Branch (782:9): [True: 0, False: 76.8k]
  ------------------
  783|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_NO_KEY_SET);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  784|      0|        return 0;
  785|      0|    }
  786|       |
  787|  76.8k|    if (ctx->tlsversion > 0) {
  ------------------
  |  Branch (787:9): [True: 0, False: 76.8k]
  ------------------
  788|       |        /*
  789|       |         * Each update call corresponds to a TLS record and is individually
  790|       |         * padded
  791|       |         */
  792|       |
  793|       |        /* Sanity check inputs */
  794|      0|        if (in == NULL
  ------------------
  |  Branch (794:13): [True: 0, False: 0]
  ------------------
  795|      0|            || in != out
  ------------------
  |  Branch (795:16): [True: 0, False: 0]
  ------------------
  796|      0|            || outsize < inl
  ------------------
  |  Branch (796:16): [True: 0, False: 0]
  ------------------
  797|      0|            || !ctx->pad) {
  ------------------
  |  Branch (797:16): [True: 0, False: 0]
  ------------------
  798|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  799|      0|            return 0;
  800|      0|        }
  801|       |
  802|      0|        if (ctx->enc) {
  ------------------
  |  Branch (802:13): [True: 0, False: 0]
  ------------------
  803|      0|            unsigned char padval;
  804|      0|            size_t padnum, loop;
  805|       |
  806|       |            /* Add padding */
  807|       |
  808|      0|            padnum = blksz - (inl % blksz);
  809|       |
  810|      0|            if (outsize < inl + padnum) {
  ------------------
  |  Branch (810:17): [True: 0, False: 0]
  ------------------
  811|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  812|      0|                return 0;
  813|      0|            }
  814|       |
  815|      0|            if (padnum > MAX_PADDING) {
  ------------------
  |  |  771|      0|#define MAX_PADDING 256
  ------------------
  |  Branch (815:17): [True: 0, False: 0]
  ------------------
  816|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  817|      0|                return 0;
  818|      0|            }
  819|      0|            padval = (unsigned char)(padnum - 1);
  820|      0|            if (ctx->tlsversion == SSL3_VERSION) {
  ------------------
  |  |   23|      0|#define SSL3_VERSION 0x0300
  ------------------
  |  Branch (820:17): [True: 0, False: 0]
  ------------------
  821|      0|                if (padnum > 1)
  ------------------
  |  Branch (821:21): [True: 0, False: 0]
  ------------------
  822|      0|                    memset(out + inl, 0, padnum - 1);
  823|      0|                *(out + inl + padnum - 1) = padval;
  824|      0|            } else {
  825|       |                /* we need to add 'padnum' padding bytes of value padval */
  826|      0|                for (loop = inl; loop < inl + padnum; loop++)
  ------------------
  |  Branch (826:34): [True: 0, False: 0]
  ------------------
  827|      0|                    out[loop] = padval;
  828|      0|            }
  829|      0|            inl += padnum;
  830|      0|        }
  831|       |
  832|      0|        if ((inl % blksz) != 0) {
  ------------------
  |  Branch (832:13): [True: 0, False: 0]
  ------------------
  833|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  834|      0|            return 0;
  835|      0|        }
  836|       |
  837|       |        /* Shouldn't normally fail */
  838|      0|        if (!ctx->hw->cipher(ctx, out, in, inl)) {
  ------------------
  |  Branch (838:13): [True: 0, False: 0]
  ------------------
  839|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  840|      0|            return 0;
  841|      0|        }
  842|       |
  843|      0|        if (ctx->alloced) {
  ------------------
  |  Branch (843:13): [True: 0, False: 0]
  ------------------
  844|      0|            OPENSSL_free(ctx->tlsmac);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  845|      0|            ctx->alloced = 0;
  846|      0|            ctx->tlsmac = NULL;
  847|      0|        }
  848|       |
  849|       |        /* This only fails if padding is publicly invalid */
  850|      0|        *outl = inl;
  851|      0|        if (!ctx->enc
  ------------------
  |  Branch (851:13): [True: 0, False: 0]
  ------------------
  852|      0|            && !ossl_cipher_tlsunpadblock(ctx->libctx, ctx->tlsversion,
  ------------------
  |  Branch (852:16): [True: 0, False: 0]
  ------------------
  853|      0|                out, outl,
  854|      0|                blksz, &ctx->tlsmac, &ctx->alloced,
  855|      0|                ctx->tlsmacsize, 0)) {
  856|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  857|      0|            return 0;
  858|      0|        }
  859|      0|        return 1;
  860|      0|    }
  861|       |
  862|  76.8k|    if (ctx->bufsz != 0)
  ------------------
  |  Branch (862:9): [True: 0, False: 76.8k]
  ------------------
  863|      0|        nextblocks = ossl_cipher_fillblock(ctx->buf, &ctx->bufsz, blksz,
  864|      0|            &in, &inl);
  865|  76.8k|    else
  866|  76.8k|        nextblocks = inl & ~(blksz - 1);
  867|       |
  868|       |    /*
  869|       |     * If we're decrypting and we end an update on a block boundary we hold
  870|       |     * the last block back in case this is the last update call and the last
  871|       |     * block is padded.
  872|       |     */
  873|  76.8k|    if (ctx->bufsz == blksz && (ctx->enc || inl > 0 || !ctx->pad)) {
  ------------------
  |  Branch (873:9): [True: 0, False: 76.8k]
  |  Branch (873:33): [True: 0, False: 0]
  |  Branch (873:45): [True: 0, False: 0]
  |  Branch (873:56): [True: 0, False: 0]
  ------------------
  874|      0|        if (outsize < blksz) {
  ------------------
  |  Branch (874:13): [True: 0, False: 0]
  ------------------
  875|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  876|      0|            return 0;
  877|      0|        }
  878|      0|        if (!ctx->hw->cipher(ctx, out, ctx->buf, blksz)) {
  ------------------
  |  Branch (878:13): [True: 0, False: 0]
  ------------------
  879|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  880|      0|            return 0;
  881|      0|        }
  882|      0|        ctx->bufsz = 0;
  883|      0|        outlint = blksz;
  884|      0|        out += blksz;
  885|      0|    }
  886|  76.8k|    if (nextblocks > 0) {
  ------------------
  |  Branch (886:9): [True: 76.8k, False: 0]
  ------------------
  887|  76.8k|        if (!ctx->enc && ctx->pad && nextblocks == inl) {
  ------------------
  |  Branch (887:13): [True: 0, False: 76.8k]
  |  Branch (887:26): [True: 0, False: 0]
  |  Branch (887:38): [True: 0, False: 0]
  ------------------
  888|      0|            if (!ossl_assert(inl >= blksz)) {
  ------------------
  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|      0|    __FILE__, __LINE__)
  ------------------
  |  Branch (888:17): [True: 0, False: 0]
  ------------------
  889|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  890|      0|                return 0;
  891|      0|            }
  892|      0|            nextblocks -= blksz;
  893|      0|        }
  894|  76.8k|        outlint += nextblocks;
  895|  76.8k|        if (outsize < outlint) {
  ------------------
  |  Branch (895:13): [True: 0, False: 76.8k]
  ------------------
  896|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  897|      0|            return 0;
  898|      0|        }
  899|  76.8k|    }
  900|  76.8k|    if (nextblocks > 0) {
  ------------------
  |  Branch (900:9): [True: 76.8k, False: 0]
  ------------------
  901|  76.8k|        if (!ctx->hw->cipher(ctx, out, in, nextblocks)) {
  ------------------
  |  Branch (901:13): [True: 0, False: 76.8k]
  ------------------
  902|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  903|      0|            return 0;
  904|      0|        }
  905|  76.8k|        in += nextblocks;
  906|  76.8k|        inl -= nextblocks;
  907|  76.8k|    }
  908|  76.8k|    if (inl != 0
  ------------------
  |  Branch (908:9): [True: 0, False: 76.8k]
  ------------------
  909|      0|        && !ossl_cipher_trailingdata(ctx->buf, &ctx->bufsz, blksz, &in, &inl)) {
  ------------------
  |  Branch (909:12): [True: 0, False: 0]
  ------------------
  910|       |        /* ERR_raise already called */
  911|      0|        return 0;
  912|      0|    }
  913|       |
  914|  76.8k|    *outl = outlint;
  915|  76.8k|    return inl == 0;
  916|  76.8k|}
ossl_cipher_generic_stream_update:
  995|  34.5k|{
  996|  34.5k|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  997|       |
  998|  34.5k|    if (!ctx->key_set) {
  ------------------
  |  Branch (998:9): [True: 0, False: 34.5k]
  ------------------
  999|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_NO_KEY_SET);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1000|      0|        return 0;
 1001|      0|    }
 1002|       |
 1003|  34.5k|    if (inl == 0) {
  ------------------
  |  Branch (1003:9): [True: 0, False: 34.5k]
  ------------------
 1004|      0|        *outl = 0;
 1005|      0|        return 1;
 1006|      0|    }
 1007|       |
 1008|  34.5k|    if (outsize < inl) {
  ------------------
  |  Branch (1008:9): [True: 0, False: 34.5k]
  ------------------
 1009|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1010|      0|        return 0;
 1011|      0|    }
 1012|       |
 1013|  34.5k|    if (!ctx->hw->cipher(ctx, out, in, inl)) {
  ------------------
  |  Branch (1013:9): [True: 0, False: 34.5k]
  ------------------
 1014|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1015|      0|        return 0;
 1016|      0|    }
 1017|       |
 1018|  34.5k|    *outl = inl;
 1019|  34.5k|    if (!ctx->enc && ctx->tlsversion > 0) {
  ------------------
  |  Branch (1019:9): [True: 0, False: 34.5k]
  |  Branch (1019:22): [True: 0, False: 0]
  ------------------
 1020|       |        /*
 1021|       |         * Remove any TLS padding. Only used by cipher_aes_cbc_hmac_sha1_hw.c and
 1022|       |         * cipher_aes_cbc_hmac_sha256_hw.c
 1023|       |         */
 1024|      0|        if (ctx->removetlspad) {
  ------------------
  |  Branch (1024:13): [True: 0, False: 0]
  ------------------
 1025|       |            /*
 1026|       |             * We should have already failed in the cipher() call above if this
 1027|       |             * isn't true.
 1028|       |             */
 1029|      0|            if (!ossl_assert(*outl >= (size_t)(out[inl - 1] + 1)))
  ------------------
  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|      0|    __FILE__, __LINE__)
  ------------------
  |  Branch (1029:17): [True: 0, False: 0]
  ------------------
 1030|      0|                return 0;
 1031|       |            /* The actual padding length */
 1032|      0|            *outl -= out[inl - 1] + 1;
 1033|      0|        }
 1034|       |
 1035|       |        /* TLS MAC and explicit IV if relevant. We should have already failed
 1036|       |         * in the cipher() call above if *outl is too short.
 1037|       |         */
 1038|      0|        if (!ossl_assert(*outl >= ctx->removetlsfixed))
  ------------------
  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|      0|    __FILE__, __LINE__)
  ------------------
  |  Branch (1038:13): [True: 0, False: 0]
  ------------------
 1039|      0|            return 0;
 1040|      0|        *outl -= ctx->removetlsfixed;
 1041|       |
 1042|       |        /* Extract the MAC if there is one */
 1043|      0|        if (ctx->tlsmacsize > 0) {
  ------------------
  |  Branch (1043:13): [True: 0, False: 0]
  ------------------
 1044|      0|            if (*outl < ctx->tlsmacsize)
  ------------------
  |  Branch (1044:17): [True: 0, False: 0]
  ------------------
 1045|      0|                return 0;
 1046|       |
 1047|      0|            ctx->tlsmac = out + *outl - ctx->tlsmacsize;
 1048|      0|            *outl -= ctx->tlsmacsize;
 1049|      0|        }
 1050|      0|    }
 1051|       |
 1052|  34.5k|    return 1;
 1053|  34.5k|}
ossl_cipher_common_get_ctx_params:
 1100|  6.58k|{
 1101|  6.58k|    if (p->ivlen != NULL && !OSSL_PARAM_set_size_t(p->ivlen, ctx->ivlen)) {
  ------------------
  |  Branch (1101:9): [True: 1.64k, False: 4.94k]
  |  Branch (1101:29): [True: 0, False: 1.64k]
  ------------------
 1102|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1103|      0|        return 0;
 1104|      0|    }
 1105|       |
 1106|  6.58k|    if (p->pad != NULL && !OSSL_PARAM_set_uint(p->pad, ctx->pad)) {
  ------------------
  |  Branch (1106:9): [True: 0, False: 6.58k]
  |  Branch (1106:27): [True: 0, False: 0]
  ------------------
 1107|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1108|      0|        return 0;
 1109|      0|    }
 1110|       |
 1111|  6.58k|    if (p->iv != NULL
  ------------------
  |  Branch (1111:9): [True: 0, False: 6.58k]
  ------------------
 1112|      0|        && !OSSL_PARAM_set_octet_string_or_ptr(p->iv, ctx->oiv, ctx->ivlen)) {
  ------------------
  |  Branch (1112:12): [True: 0, False: 0]
  ------------------
 1113|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1114|      0|        return 0;
 1115|      0|    }
 1116|       |
 1117|  6.58k|    if (p->updiv != NULL
  ------------------
  |  Branch (1117:9): [True: 0, False: 6.58k]
  ------------------
 1118|      0|        && !OSSL_PARAM_set_octet_string_or_ptr(p->updiv, ctx->iv, ctx->ivlen)) {
  ------------------
  |  Branch (1118:12): [True: 0, False: 0]
  ------------------
 1119|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1120|      0|        return 0;
 1121|      0|    }
 1122|       |
 1123|  6.58k|    if (p->num != NULL && !OSSL_PARAM_set_uint(p->num, ctx->num)) {
  ------------------
  |  Branch (1123:9): [True: 0, False: 6.58k]
  |  Branch (1123:27): [True: 0, False: 0]
  ------------------
 1124|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1125|      0|        return 0;
 1126|      0|    }
 1127|       |
 1128|  6.58k|    if (p->keylen != NULL && !OSSL_PARAM_set_size_t(p->keylen, ctx->keylen)) {
  ------------------
  |  Branch (1128:9): [True: 4.94k, False: 1.64k]
  |  Branch (1128:30): [True: 0, False: 4.94k]
  ------------------
 1129|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1130|      0|        return 0;
 1131|      0|    }
 1132|       |
 1133|  6.58k|    if (p->tlsmac != NULL
  ------------------
  |  Branch (1133:9): [True: 0, False: 6.58k]
  ------------------
 1134|      0|        && !OSSL_PARAM_set_octet_ptr(p->tlsmac, ctx->tlsmac, ctx->tlsmacsize)) {
  ------------------
  |  Branch (1134:12): [True: 0, False: 0]
  ------------------
 1135|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1136|      0|        return 0;
 1137|      0|    }
 1138|  6.58k|    return 1;
 1139|  6.58k|}
ossl_cipher_generic_get_ctx_params:
 1142|  6.58k|{
 1143|  6.58k|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
 1144|  6.58k|    struct ossl_cipher_get_ctx_param_list_st p;
 1145|       |
 1146|  6.58k|    if (ctx == NULL || !cipher_generic_get_ctx_params_decoder(params, &p))
  ------------------
  |  Branch (1146:9): [True: 0, False: 6.58k]
  |  Branch (1146:24): [True: 0, False: 6.58k]
  ------------------
 1147|      0|        return 0;
 1148|  6.58k|    return ossl_cipher_common_get_ctx_params(ctx, &p);
 1149|  6.58k|}
ossl_cipher_generic_set_ctx_params:
 1204|   125k|{
 1205|   125k|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
 1206|   125k|    struct ossl_cipher_set_ctx_param_list_st p;
 1207|       |
 1208|   125k|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (1208:9): [True: 125k, False: 0]
  ------------------
 1209|   125k|        return 1;
 1210|       |
 1211|      0|    if (ctx == NULL || !cipher_generic_set_ctx_params_decoder(params, &p))
  ------------------
  |  Branch (1211:9): [True: 0, False: 0]
  |  Branch (1211:24): [True: 0, False: 0]
  ------------------
 1212|      0|        return 0;
 1213|      0|    return ossl_cipher_common_set_ctx_params(ctx, &p);
 1214|      0|}
ossl_cipher_generic_initiv:
 1218|  34.5k|{
 1219|  34.5k|    if (ivlen != ctx->ivlen
  ------------------
  |  Branch (1219:9): [True: 0, False: 34.5k]
  ------------------
 1220|  34.5k|        || ivlen > sizeof(ctx->iv)) {
  ------------------
  |  Branch (1220:12): [True: 0, False: 34.5k]
  ------------------
 1221|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1222|      0|        return 0;
 1223|      0|    }
 1224|  34.5k|    ctx->iv_set = 1;
 1225|  34.5k|    memcpy(ctx->iv, iv, ivlen);
 1226|  34.5k|    memcpy(ctx->oiv, iv, ivlen);
 1227|  34.5k|    return 1;
 1228|  34.5k|}
ossl_cipher_generic_initkey:
 1234|  4.94k|{
 1235|  4.94k|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
 1236|       |
 1237|  4.94k|    if ((flags & PROV_CIPHER_FLAG_INVERSE_CIPHER) != 0)
  ------------------
  |  |   46|  4.94k|#define PROV_CIPHER_FLAG_INVERSE_CIPHER 0x0200
  ------------------
  |  Branch (1237:9): [True: 0, False: 4.94k]
  ------------------
 1238|      0|        ctx->inverse_cipher = 1;
 1239|  4.94k|    if ((flags & PROV_CIPHER_FLAG_VARIABLE_LENGTH) != 0)
  ------------------
  |  |   45|  4.94k|#define PROV_CIPHER_FLAG_VARIABLE_LENGTH 0x0100
  ------------------
  |  Branch (1239:9): [True: 0, False: 4.94k]
  ------------------
 1240|      0|        ctx->variable_keylength = 1;
 1241|       |
 1242|  4.94k|    ctx->pad = 1;
 1243|  4.94k|    ctx->keylen = ((kbits) / 8);
 1244|  4.94k|    ctx->ivlen = ((ivbits) / 8);
 1245|  4.94k|    ctx->hw = hw;
 1246|  4.94k|    ctx->mode = mode;
 1247|  4.94k|    ctx->blocksize = blkbits / 8;
 1248|  4.94k|    if (provctx != NULL)
  ------------------
  |  Branch (1248:9): [True: 4.94k, False: 0]
  ------------------
 1249|  4.94k|        ctx->libctx = PROV_LIBCTX_OF(provctx); /* used for rand */
  ------------------
  |  |   31|  4.94k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
 1250|  4.94k|}
ciphercommon.c:ossl_cipher_generic_get_params_decoder:
   67|   116k|{
   68|   116k|    const char *s;
   69|       |
   70|   116k|    memset(r, 0, sizeof(*r));
   71|   116k|    if (p != NULL)
  ------------------
  |  Branch (71:9): [True: 116k, False: 0]
  ------------------
   72|   973k|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (72:16): [True: 856k, False: 116k]
  ------------------
   73|   856k|            switch(s[0]) {
   74|  34.7k|            default:
  ------------------
  |  Branch (74:13): [True: 34.7k, False: 821k]
  ------------------
   75|  34.7k|                break;
   76|  82.1k|            case 'a':
  ------------------
  |  Branch (76:13): [True: 82.1k, False: 774k]
  ------------------
   77|  82.1k|                if (ossl_likely(strcmp("ead", s + 1) == 0)) {
  ------------------
  |  |   22|  82.1k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 82.1k, False: 0]
  |  |  ------------------
  ------------------
   78|       |                    /* OSSL_CIPHER_PARAM_AEAD */
   79|  82.1k|                    if (ossl_unlikely(r->aead != NULL)) {
  ------------------
  |  |   23|  82.1k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 82.1k]
  |  |  ------------------
  ------------------
   80|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   81|      0|                                       "param %s is repeated", s);
   82|      0|                        return 0;
   83|      0|                    }
   84|  82.1k|                    r->aead = (OSSL_PARAM *)p;
   85|  82.1k|                }
   86|  82.1k|                break;
   87|  82.1k|            case 'b':
  ------------------
  |  Branch (87:13): [True: 82.1k, False: 774k]
  ------------------
   88|  82.1k|                if (ossl_likely(strcmp("locksize", s + 1) == 0)) {
  ------------------
  |  |   22|  82.1k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 82.1k, False: 0]
  |  |  ------------------
  ------------------
   89|       |                    /* OSSL_CIPHER_PARAM_BLOCK_SIZE */
   90|  82.1k|                    if (ossl_unlikely(r->bsize != NULL)) {
  ------------------
  |  |   23|  82.1k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 82.1k]
  |  |  ------------------
  ------------------
   91|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   92|      0|                                       "param %s is repeated", s);
   93|      0|                        return 0;
   94|      0|                    }
   95|  82.1k|                    r->bsize = (OSSL_PARAM *)p;
   96|  82.1k|                }
   97|  82.1k|                break;
   98|   164k|            case 'c':
  ------------------
  |  Branch (98:13): [True: 164k, False: 691k]
  ------------------
   99|   164k|                switch(s[1]) {
  100|      0|                default:
  ------------------
  |  Branch (100:17): [True: 0, False: 164k]
  ------------------
  101|      0|                    break;
  102|  82.1k|                case 't':
  ------------------
  |  Branch (102:17): [True: 82.1k, False: 82.1k]
  ------------------
  103|  82.1k|                    if (ossl_likely(strcmp("s", s + 2) == 0)) {
  ------------------
  |  |   22|  82.1k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 82.1k, False: 0]
  |  |  ------------------
  ------------------
  104|       |                        /* OSSL_CIPHER_PARAM_CTS */
  105|  82.1k|                        if (ossl_unlikely(r->cts != NULL)) {
  ------------------
  |  |   23|  82.1k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 82.1k]
  |  |  ------------------
  ------------------
  106|      0|                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  107|      0|                                           "param %s is repeated", s);
  108|      0|                            return 0;
  109|      0|                        }
  110|  82.1k|                        r->cts = (OSSL_PARAM *)p;
  111|  82.1k|                    }
  112|  82.1k|                    break;
  113|  82.1k|                case 'u':
  ------------------
  |  Branch (113:17): [True: 82.1k, False: 82.1k]
  ------------------
  114|  82.1k|                    if (ossl_likely(strcmp("stom-iv", s + 2) == 0)) {
  ------------------
  |  |   22|  82.1k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 82.1k, False: 0]
  |  |  ------------------
  ------------------
  115|       |                        /* OSSL_CIPHER_PARAM_CUSTOM_IV */
  116|  82.1k|                        if (ossl_unlikely(r->custiv != NULL)) {
  ------------------
  |  |   23|  82.1k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 82.1k]
  |  |  ------------------
  ------------------
  117|      0|                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  118|      0|                                           "param %s is repeated", s);
  119|      0|                            return 0;
  120|      0|                        }
  121|  82.1k|                        r->custiv = (OSSL_PARAM *)p;
  122|  82.1k|                    }
  123|   164k|                }
  124|   164k|                break;
  125|   164k|            case 'e':
  ------------------
  |  Branch (125:13): [True: 82.1k, False: 774k]
  ------------------
  126|  82.1k|                if (ossl_likely(strcmp("ncrypt-then-mac", s + 1) == 0)) {
  ------------------
  |  |   22|  82.1k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 82.1k, False: 0]
  |  |  ------------------
  ------------------
  127|       |                    /* OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC */
  128|  82.1k|                    if (ossl_unlikely(r->etm != NULL)) {
  ------------------
  |  |   23|  82.1k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 82.1k]
  |  |  ------------------
  ------------------
  129|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  130|      0|                                       "param %s is repeated", s);
  131|      0|                        return 0;
  132|      0|                    }
  133|  82.1k|                    r->etm = (OSSL_PARAM *)p;
  134|  82.1k|                }
  135|  82.1k|                break;
  136|  82.1k|            case 'h':
  ------------------
  |  Branch (136:13): [True: 82.1k, False: 774k]
  ------------------
  137|  82.1k|                if (ossl_likely(strcmp("as-randkey", s + 1) == 0)) {
  ------------------
  |  |   22|  82.1k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 82.1k, False: 0]
  |  |  ------------------
  ------------------
  138|       |                    /* OSSL_CIPHER_PARAM_HAS_RAND_KEY */
  139|  82.1k|                    if (ossl_unlikely(r->rand != NULL)) {
  ------------------
  |  |   23|  82.1k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 82.1k]
  |  |  ------------------
  ------------------
  140|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  141|      0|                                       "param %s is repeated", s);
  142|      0|                        return 0;
  143|      0|                    }
  144|  82.1k|                    r->rand = (OSSL_PARAM *)p;
  145|  82.1k|                }
  146|  82.1k|                break;
  147|  82.1k|            case 'i':
  ------------------
  |  Branch (147:13): [True: 82.1k, False: 774k]
  ------------------
  148|  82.1k|                if (ossl_likely(strcmp("vlen", s + 1) == 0)) {
  ------------------
  |  |   22|  82.1k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 82.1k, False: 0]
  |  |  ------------------
  ------------------
  149|       |                    /* OSSL_CIPHER_PARAM_IVLEN */
  150|  82.1k|                    if (ossl_unlikely(r->ivlen != NULL)) {
  ------------------
  |  |   23|  82.1k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 82.1k]
  |  |  ------------------
  ------------------
  151|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  152|      0|                                       "param %s is repeated", s);
  153|      0|                        return 0;
  154|      0|                    }
  155|  82.1k|                    r->ivlen = (OSSL_PARAM *)p;
  156|  82.1k|                }
  157|  82.1k|                break;
  158|  82.1k|            case 'k':
  ------------------
  |  Branch (158:13): [True: 82.1k, False: 774k]
  ------------------
  159|  82.1k|                if (ossl_likely(strcmp("eylen", s + 1) == 0)) {
  ------------------
  |  |   22|  82.1k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 82.1k, False: 0]
  |  |  ------------------
  ------------------
  160|       |                    /* OSSL_CIPHER_PARAM_KEYLEN */
  161|  82.1k|                    if (ossl_unlikely(r->keylen != NULL)) {
  ------------------
  |  |   23|  82.1k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 82.1k]
  |  |  ------------------
  ------------------
  162|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  163|      0|                                       "param %s is repeated", s);
  164|      0|                        return 0;
  165|      0|                    }
  166|  82.1k|                    r->keylen = (OSSL_PARAM *)p;
  167|  82.1k|                }
  168|  82.1k|                break;
  169|  82.1k|            case 'm':
  ------------------
  |  Branch (169:13): [True: 82.1k, False: 774k]
  ------------------
  170|  82.1k|                if (ossl_likely(strcmp("ode", s + 1) == 0)) {
  ------------------
  |  |   22|  82.1k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 82.1k, False: 0]
  |  |  ------------------
  ------------------
  171|       |                    /* OSSL_CIPHER_PARAM_MODE */
  172|  82.1k|                    if (ossl_unlikely(r->mode != NULL)) {
  ------------------
  |  |   23|  82.1k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 82.1k]
  |  |  ------------------
  ------------------
  173|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  174|      0|                                       "param %s is repeated", s);
  175|      0|                        return 0;
  176|      0|                    }
  177|  82.1k|                    r->mode = (OSSL_PARAM *)p;
  178|  82.1k|                }
  179|  82.1k|                break;
  180|  82.1k|            case 't':
  ------------------
  |  Branch (180:13): [True: 82.1k, False: 774k]
  ------------------
  181|  82.1k|                if (ossl_likely(strcmp("ls-multi", s + 1) == 0)) {
  ------------------
  |  |   22|  82.1k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 82.1k, False: 0]
  |  |  ------------------
  ------------------
  182|       |                    /* OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK */
  183|  82.1k|                    if (ossl_unlikely(r->mb != NULL)) {
  ------------------
  |  |   23|  82.1k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 82.1k]
  |  |  ------------------
  ------------------
  184|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  185|      0|                                       "param %s is repeated", s);
  186|      0|                        return 0;
  187|      0|                    }
  188|  82.1k|                    r->mb = (OSSL_PARAM *)p;
  189|  82.1k|                }
  190|   856k|            }
  191|   116k|    return 1;
  192|   116k|}
ciphercommon.c:cipher_generic_init_internal:
  696|   125k|{
  697|   125k|    ctx->num = 0;
  698|   125k|    ctx->bufsz = 0;
  699|   125k|    ctx->updated = 0;
  700|   125k|    ctx->enc = enc ? 1 : 0;
  ------------------
  |  Branch (700:16): [True: 125k, False: 0]
  ------------------
  701|       |
  702|   125k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (702:9): [True: 0, False: 125k]
  ------------------
  703|      0|        return 0;
  704|       |
  705|   125k|    if (iv != NULL && ctx->mode != EVP_CIPH_ECB_MODE) {
  ------------------
  |  |  311|  34.5k|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  |  Branch (705:9): [True: 34.5k, False: 90.5k]
  |  Branch (705:23): [True: 34.5k, False: 0]
  ------------------
  706|  34.5k|        if (!ossl_cipher_generic_initiv(ctx, iv, ivlen))
  ------------------
  |  Branch (706:13): [True: 0, False: 34.5k]
  ------------------
  707|      0|            return 0;
  708|  34.5k|    }
  709|   125k|    if (iv == NULL && ctx->iv_set
  ------------------
  |  Branch (709:9): [True: 90.5k, False: 34.5k]
  |  Branch (709:23): [True: 36.2k, False: 54.3k]
  ------------------
  710|  36.2k|        && (ctx->mode == EVP_CIPH_CBC_MODE
  ------------------
  |  |  312|  72.4k|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  |  Branch (710:13): [True: 0, False: 36.2k]
  ------------------
  711|  36.2k|            || ctx->mode == EVP_CIPH_CFB_MODE
  ------------------
  |  |  313|  72.4k|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  |  Branch (711:16): [True: 0, False: 36.2k]
  ------------------
  712|  36.2k|            || ctx->mode == EVP_CIPH_OFB_MODE))
  ------------------
  |  |  314|  36.2k|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  |  Branch (712:16): [True: 0, False: 36.2k]
  ------------------
  713|       |        /* reset IV for these modes to keep compatibility with 1.1.1 */
  714|      0|        memcpy(ctx->iv, ctx->oiv, ctx->ivlen);
  715|       |
  716|   125k|    if (key != NULL) {
  ------------------
  |  Branch (716:9): [True: 87.2k, False: 37.8k]
  ------------------
  717|  87.2k|        if (ctx->variable_keylength == 0) {
  ------------------
  |  Branch (717:13): [True: 87.2k, False: 0]
  ------------------
  718|  87.2k|            if (keylen != ctx->keylen) {
  ------------------
  |  Branch (718:17): [True: 0, False: 87.2k]
  ------------------
  719|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  720|      0|                return 0;
  721|      0|            }
  722|  87.2k|        } else {
  723|      0|            ctx->keylen = keylen;
  724|      0|        }
  725|  87.2k|        if (!ctx->hw->init(ctx, key, ctx->keylen))
  ------------------
  |  Branch (725:13): [True: 0, False: 87.2k]
  ------------------
  726|      0|            return 0;
  727|  87.2k|        ctx->key_set = 1;
  728|  87.2k|    }
  729|   125k|    return ossl_cipher_generic_set_ctx_params(ctx, params);
  730|   125k|}
ciphercommon.c:cipher_generic_get_ctx_params_decoder:
  292|  6.58k|{
  293|  6.58k|    const char *s;
  294|       |
  295|  6.58k|    memset(r, 0, sizeof(*r));
  296|  6.58k|    if (p != NULL)
  ------------------
  |  Branch (296:9): [True: 6.58k, False: 0]
  ------------------
  297|  13.1k|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (297:16): [True: 6.58k, False: 6.58k]
  ------------------
  298|  6.58k|            switch(s[0]) {
  299|      0|            default:
  ------------------
  |  Branch (299:13): [True: 0, False: 6.58k]
  ------------------
  300|      0|                break;
  301|  1.64k|            case 'i':
  ------------------
  |  Branch (301:13): [True: 1.64k, False: 4.94k]
  ------------------
  302|  1.64k|                switch(s[1]) {
  303|      0|                default:
  ------------------
  |  Branch (303:17): [True: 0, False: 1.64k]
  ------------------
  304|      0|                    break;
  305|  1.64k|                case 'v':
  ------------------
  |  Branch (305:17): [True: 1.64k, False: 0]
  ------------------
  306|  1.64k|                    switch(s[2]) {
  307|      0|                    default:
  ------------------
  |  Branch (307:21): [True: 0, False: 1.64k]
  ------------------
  308|      0|                        break;
  309|  1.64k|                    case 'l':
  ------------------
  |  Branch (309:21): [True: 1.64k, False: 0]
  ------------------
  310|  1.64k|                        if (ossl_likely(strcmp("en", s + 3) == 0)) {
  ------------------
  |  |   22|  1.64k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 1.64k, False: 0]
  |  |  ------------------
  ------------------
  311|       |                            /* OSSL_CIPHER_PARAM_IVLEN */
  312|  1.64k|                            if (ossl_unlikely(r->ivlen != NULL)) {
  ------------------
  |  |   23|  1.64k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.64k]
  |  |  ------------------
  ------------------
  313|      0|                                ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  314|      0|                                               "param %s is repeated", s);
  315|      0|                                return 0;
  316|      0|                            }
  317|  1.64k|                            r->ivlen = (OSSL_PARAM *)p;
  318|  1.64k|                        }
  319|  1.64k|                        break;
  320|  1.64k|                    case '\0':
  ------------------
  |  Branch (320:21): [True: 0, False: 1.64k]
  ------------------
  321|      0|                        if (ossl_unlikely(r->iv != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  322|      0|                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  323|      0|                                           "param %s is repeated", s);
  324|      0|                            return 0;
  325|      0|                        }
  326|      0|                        r->iv = (OSSL_PARAM *)p;
  327|  1.64k|                    }
  328|  1.64k|                }
  329|  1.64k|                break;
  330|  4.94k|            case 'k':
  ------------------
  |  Branch (330:13): [True: 4.94k, False: 1.64k]
  ------------------
  331|  4.94k|                if (ossl_likely(strcmp("eylen", s + 1) == 0)) {
  ------------------
  |  |   22|  4.94k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 4.94k, False: 0]
  |  |  ------------------
  ------------------
  332|       |                    /* OSSL_CIPHER_PARAM_KEYLEN */
  333|  4.94k|                    if (ossl_unlikely(r->keylen != NULL)) {
  ------------------
  |  |   23|  4.94k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 4.94k]
  |  |  ------------------
  ------------------
  334|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  335|      0|                                       "param %s is repeated", s);
  336|      0|                        return 0;
  337|      0|                    }
  338|  4.94k|                    r->keylen = (OSSL_PARAM *)p;
  339|  4.94k|                }
  340|  4.94k|                break;
  341|  4.94k|            case 'n':
  ------------------
  |  Branch (341:13): [True: 0, False: 6.58k]
  ------------------
  342|      0|                if (ossl_likely(strcmp("um", s + 1) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  343|       |                    /* OSSL_CIPHER_PARAM_NUM */
  344|      0|                    if (ossl_unlikely(r->num != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  345|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  346|      0|                                       "param %s is repeated", s);
  347|      0|                        return 0;
  348|      0|                    }
  349|      0|                    r->num = (OSSL_PARAM *)p;
  350|      0|                }
  351|      0|                break;
  352|      0|            case 'p':
  ------------------
  |  Branch (352:13): [True: 0, False: 6.58k]
  ------------------
  353|      0|                if (ossl_likely(strcmp("adding", s + 1) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  354|       |                    /* OSSL_CIPHER_PARAM_PADDING */
  355|      0|                    if (ossl_unlikely(r->pad != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  356|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  357|      0|                                       "param %s is repeated", s);
  358|      0|                        return 0;
  359|      0|                    }
  360|      0|                    r->pad = (OSSL_PARAM *)p;
  361|      0|                }
  362|      0|                break;
  363|      0|            case 't':
  ------------------
  |  Branch (363:13): [True: 0, False: 6.58k]
  ------------------
  364|      0|                if (ossl_likely(strcmp("ls-mac", s + 1) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  365|       |                    /* OSSL_CIPHER_PARAM_TLS_MAC */
  366|      0|                    if (ossl_unlikely(r->tlsmac != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  367|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  368|      0|                                       "param %s is repeated", s);
  369|      0|                        return 0;
  370|      0|                    }
  371|      0|                    r->tlsmac = (OSSL_PARAM *)p;
  372|      0|                }
  373|      0|                break;
  374|      0|            case 'u':
  ------------------
  |  Branch (374:13): [True: 0, False: 6.58k]
  ------------------
  375|      0|                if (ossl_likely(strcmp("pdated-iv", s + 1) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  376|       |                    /* OSSL_CIPHER_PARAM_UPDATED_IV */
  377|      0|                    if (ossl_unlikely(r->updiv != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  378|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  379|      0|                                       "param %s is repeated", s);
  380|      0|                        return 0;
  381|      0|                    }
  382|      0|                    r->updiv = (OSSL_PARAM *)p;
  383|      0|                }
  384|  6.58k|            }
  385|  6.58k|    return 1;
  386|  6.58k|}

ossl_ccm_gettable_ctx_params:
  390|  4.42k|{
  391|  4.42k|    return ossl_cipher_ccm_get_ctx_params_list;
  392|  4.42k|}

ossl_gcm_gettable_ctx_params:
  325|  4.42k|{
  326|  4.42k|    return ossl_cipher_gcm_get_ctx_params_list;
  327|  4.42k|}

ossl_cipher_hw_generic_ctr:
  112|  34.5k|{
  113|  34.5k|    unsigned int num = dat->num;
  114|       |
  115|  34.5k|    if (dat->stream.ctr)
  ------------------
  |  Branch (115:9): [True: 34.5k, False: 0]
  ------------------
  116|  34.5k|        CRYPTO_ctr128_encrypt_ctr32(in, out, len, dat->ks, dat->iv, dat->buf,
  117|  34.5k|            &num, dat->stream.ctr);
  118|      0|    else
  119|      0|        CRYPTO_ctr128_encrypt(in, out, len, dat->ks, dat->iv, dat->buf,
  120|      0|            &num, dat->block);
  121|  34.5k|    dat->num = num;
  122|       |
  123|  34.5k|    return 1;
  124|  34.5k|}

blake2_prov.c:blake2s256_get_params:
  246|    632|    {                                                                                                             \
  247|    632|        return ossl_digest_default_get_params(params, BLAKE##VARIANT##_BLOCKBYTES, BLAKE##VARIANT##_OUTBYTES, 0); \
  ------------------
  |  |   19|    632|#define BLAKE2S_BLOCKBYTES 64
  ------------------
                      return ossl_digest_default_get_params(params, BLAKE##VARIANT##_BLOCKBYTES, BLAKE##VARIANT##_OUTBYTES, 0); \
  ------------------
  |  |   20|    632|#define BLAKE2S_OUTBYTES 32
  ------------------
  248|    632|    }                                                                                                             \
blake2_prov.c:blake2b512_get_params:
  246|    632|    {                                                                                                             \
  247|    632|        return ossl_digest_default_get_params(params, BLAKE##VARIANT##_BLOCKBYTES, BLAKE##VARIANT##_OUTBYTES, 0); \
  ------------------
  |  |   25|    632|#define BLAKE2B_BLOCKBYTES 128
  ------------------
                      return ossl_digest_default_get_params(params, BLAKE##VARIANT##_BLOCKBYTES, BLAKE##VARIANT##_OUTBYTES, 0); \
  ------------------
  |  |   26|    632|#define BLAKE2B_OUTBYTES 64
  ------------------
  248|    632|    }                                                                                                             \

ossl_digest_default_get_params:
  104|  17.0k|{
  105|  17.0k|    struct digest_default_get_params_st p;
  106|       |
  107|  17.0k|    if (!digest_default_get_params_decoder(params, &p))
  ------------------
  |  Branch (107:9): [True: 0, False: 17.0k]
  ------------------
  108|      0|        return 0;
  109|       |
  110|  17.0k|    if (p.bsize != NULL && !OSSL_PARAM_set_size_t(p.bsize, blksz)) {
  ------------------
  |  Branch (110:9): [True: 17.0k, False: 0]
  |  Branch (110:28): [True: 0, False: 17.0k]
  ------------------
  111|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  112|      0|        return 0;
  113|      0|    }
  114|  17.0k|    if (p.size != NULL && !OSSL_PARAM_set_size_t(p.size, paramsz)) {
  ------------------
  |  Branch (114:9): [True: 17.0k, False: 0]
  |  Branch (114:27): [True: 0, False: 17.0k]
  ------------------
  115|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  116|      0|        return 0;
  117|      0|    }
  118|  17.0k|    if (p.xof != NULL
  ------------------
  |  Branch (118:9): [True: 17.0k, False: 0]
  ------------------
  119|  17.0k|        && !OSSL_PARAM_set_int(p.xof, (flags & PROV_DIGEST_FLAG_XOF) != 0)) {
  ------------------
  |  |   19|  17.0k|#define PROV_DIGEST_FLAG_XOF 0x0001
  ------------------
  |  Branch (119:12): [True: 0, False: 17.0k]
  ------------------
  120|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  121|      0|        return 0;
  122|      0|    }
  123|  17.0k|    if (p.aldid != NULL
  ------------------
  |  Branch (123:9): [True: 17.0k, False: 0]
  ------------------
  124|  17.0k|        && !OSSL_PARAM_set_int(p.aldid, (flags & PROV_DIGEST_FLAG_ALGID_ABSENT) != 0)) {
  ------------------
  |  |   20|  17.0k|#define PROV_DIGEST_FLAG_ALGID_ABSENT 0x0002
  ------------------
  |  Branch (124:12): [True: 0, False: 17.0k]
  ------------------
  125|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  126|      0|        return 0;
  127|      0|    }
  128|  17.0k|    return 1;
  129|  17.0k|}
digestcommon.c:digest_default_get_params_decoder:
   43|  17.0k|{
   44|  17.0k|    const char *s;
   45|       |
   46|  17.0k|    memset(r, 0, sizeof(*r));
   47|  17.0k|    if (p != NULL)
  ------------------
  |  Branch (47:9): [True: 17.0k, False: 0]
  ------------------
   48|  85.3k|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (48:16): [True: 68.2k, False: 17.0k]
  ------------------
   49|  68.2k|            switch(s[0]) {
   50|      0|            default:
  ------------------
  |  Branch (50:13): [True: 0, False: 68.2k]
  ------------------
   51|      0|                break;
   52|  17.0k|            case 'a':
  ------------------
  |  Branch (52:13): [True: 17.0k, False: 51.1k]
  ------------------
   53|  17.0k|                if (ossl_likely(strcmp("lgid-absent", s + 1) == 0)) {
  ------------------
  |  |   22|  17.0k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 17.0k, False: 0]
  |  |  ------------------
  ------------------
   54|       |                    /* OSSL_DIGEST_PARAM_ALGID_ABSENT */
   55|  17.0k|                    if (ossl_unlikely(r->aldid != NULL)) {
  ------------------
  |  |   23|  17.0k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 17.0k]
  |  |  ------------------
  ------------------
   56|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   57|      0|                                       "param %s is repeated", s);
   58|      0|                        return 0;
   59|      0|                    }
   60|  17.0k|                    r->aldid = (OSSL_PARAM *)p;
   61|  17.0k|                }
   62|  17.0k|                break;
   63|  17.0k|            case 'b':
  ------------------
  |  Branch (63:13): [True: 17.0k, False: 51.1k]
  ------------------
   64|  17.0k|                if (ossl_likely(strcmp("locksize", s + 1) == 0)) {
  ------------------
  |  |   22|  17.0k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 17.0k, False: 0]
  |  |  ------------------
  ------------------
   65|       |                    /* OSSL_DIGEST_PARAM_BLOCK_SIZE */
   66|  17.0k|                    if (ossl_unlikely(r->bsize != NULL)) {
  ------------------
  |  |   23|  17.0k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 17.0k]
  |  |  ------------------
  ------------------
   67|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   68|      0|                                       "param %s is repeated", s);
   69|      0|                        return 0;
   70|      0|                    }
   71|  17.0k|                    r->bsize = (OSSL_PARAM *)p;
   72|  17.0k|                }
   73|  17.0k|                break;
   74|  17.0k|            case 's':
  ------------------
  |  Branch (74:13): [True: 17.0k, False: 51.1k]
  ------------------
   75|  17.0k|                if (ossl_likely(strcmp("ize", s + 1) == 0)) {
  ------------------
  |  |   22|  17.0k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 17.0k, False: 0]
  |  |  ------------------
  ------------------
   76|       |                    /* OSSL_DIGEST_PARAM_SIZE */
   77|  17.0k|                    if (ossl_unlikely(r->size != NULL)) {
  ------------------
  |  |   23|  17.0k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 17.0k]
  |  |  ------------------
  ------------------
   78|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   79|      0|                                       "param %s is repeated", s);
   80|      0|                        return 0;
   81|      0|                    }
   82|  17.0k|                    r->size = (OSSL_PARAM *)p;
   83|  17.0k|                }
   84|  17.0k|                break;
   85|  17.0k|            case 'x':
  ------------------
  |  Branch (85:13): [True: 17.0k, False: 51.1k]
  ------------------
   86|  17.0k|                if (ossl_likely(strcmp("of", s + 1) == 0)) {
  ------------------
  |  |   22|  17.0k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 17.0k, False: 0]
  |  |  ------------------
  ------------------
   87|       |                    /* OSSL_DIGEST_PARAM_XOF */
   88|  17.0k|                    if (ossl_unlikely(r->xof != NULL)) {
  ------------------
  |  |   23|  17.0k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 17.0k]
  |  |  ------------------
  ------------------
   89|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   90|      0|                                       "param %s is repeated", s);
   91|      0|                        return 0;
   92|      0|                    }
   93|  17.0k|                    r->xof = (OSSL_PARAM *)p;
   94|  17.0k|                }
   95|  68.2k|            }
   96|  17.0k|    return 1;
   97|  17.0k|}

sha2_prov.c:sha1_set_ctx_params:
   43|   338k|{
   44|   338k|    const OSSL_PARAM *p;
   45|   338k|    SHA_CTX *ctx = (SHA_CTX *)vctx;
   46|       |
   47|   338k|    if (ctx == NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 338k]
  ------------------
   48|      0|        return 0;
   49|   338k|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (49:9): [True: 338k, False: 0]
  ------------------
   50|   338k|        return 1;
   51|       |
   52|      0|    p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_SSL3_MS);
  ------------------
  |  |  230|      0|# define OSSL_DIGEST_PARAM_SSL3_MS "ssl3-ms"
  ------------------
   53|      0|    if (p != NULL && p->data_type == OSSL_PARAM_OCTET_STRING)
  ------------------
  |  |  123|      0|#define OSSL_PARAM_OCTET_STRING 5
  ------------------
  |  Branch (53:9): [True: 0, False: 0]
  |  Branch (53:22): [True: 0, False: 0]
  ------------------
   54|      0|        return ossl_sha1_ctrl(ctx, EVP_CTRL_SSL3_MASTER_SECRET,
  ------------------
  |  |  419|      0|#define EVP_CTRL_SSL3_MASTER_SECRET 0x1d
  ------------------
   55|      0|            (int)p->data_size, p->data);
   56|      0|    return 1;
   57|      0|}

sha3_prov.c:generic_sha3_absorb:
  155|  27.8k|{
  156|  27.8k|    KECCAK1600_CTX *ctx = vctx;
  157|       |
  158|  27.8k|    if (!(ctx->xof_state == XOF_STATE_INIT || ctx->xof_state == XOF_STATE_ABSORB))
  ------------------
  |  |   35|  55.7k|#define XOF_STATE_INIT 0
  ------------------
                  if (!(ctx->xof_state == XOF_STATE_INIT || ctx->xof_state == XOF_STATE_ABSORB))
  ------------------
  |  |   36|  5.30k|#define XOF_STATE_ABSORB 1
  ------------------
  |  Branch (158:11): [True: 22.5k, False: 5.30k]
  |  Branch (158:47): [True: 5.30k, False: 0]
  ------------------
  159|      0|        return 0;
  160|  27.8k|    ctx->xof_state = XOF_STATE_ABSORB;
  ------------------
  |  |   36|  27.8k|#define XOF_STATE_ABSORB 1
  ------------------
  161|  27.8k|    return SHA3_absorb(ctx->A, inp, len, ctx->block_size);
  162|  27.8k|}
sha3_prov.c:generic_sha3_final:
  165|  10.6k|{
  166|  10.6k|    return ossl_sha3_final((KECCAK1600_CTX *)vctx, out, outlen);
  167|  10.6k|}
sha3_prov.c:keccak_update:
   79|  26.5k|{
   80|  26.5k|    KECCAK1600_CTX *ctx = vctx;
   81|  26.5k|    const size_t bsz = ctx->block_size;
   82|  26.5k|    size_t num, rem;
   83|       |
   84|  26.5k|    if (ossl_unlikely(len == 0))
  ------------------
  |  |   23|  26.5k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 26.5k]
  |  |  ------------------
  ------------------
   85|      0|        return 1;
   86|       |
   87|       |    /* Is there anything in the buffer already ? */
   88|  26.5k|    if (ossl_likely((num = ctx->bufsz) != 0)) {
  ------------------
  |  |   22|  26.5k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 3.98k, False: 22.5k]
  |  |  ------------------
  ------------------
   89|       |        /* Calculate how much space is left in the buffer */
   90|  3.98k|        rem = bsz - num;
   91|       |        /* If the new input does not fill the buffer then just add it */
   92|  3.98k|        if (len < rem) {
  ------------------
  |  Branch (92:13): [True: 1.32k, False: 2.65k]
  ------------------
   93|  1.32k|            memcpy(ctx->buf + num, inp, len);
   94|  1.32k|            ctx->bufsz += len;
   95|  1.32k|            return 1;
   96|  1.32k|        }
   97|       |        /* otherwise fill up the buffer and absorb the buffer */
   98|  2.65k|        memcpy(ctx->buf + num, inp, rem);
   99|       |        /* Update the input pointer */
  100|  2.65k|        inp += rem;
  101|  2.65k|        len -= rem;
  102|  2.65k|        ctx->meth.absorb(ctx, ctx->buf, bsz);
  103|  2.65k|        ctx->bufsz = 0;
  104|  2.65k|    }
  105|       |    /* Absorb the input - rem = leftover part of the input < blocksize) */
  106|  25.2k|    rem = ctx->meth.absorb(ctx, inp, len);
  107|       |    /* Copy the leftover bit of the input into the buffer */
  108|  25.2k|    if (ossl_likely(rem)) {
  ------------------
  |  |   22|  25.2k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 25.2k, False: 0]
  |  |  ------------------
  ------------------
  109|  25.2k|        memcpy(ctx->buf, inp + len - rem, rem);
  110|  25.2k|        ctx->bufsz = rem;
  111|  25.2k|    }
  112|  25.2k|    return 1;
  113|  26.5k|}
sha3_prov.c:keccak_final:
  117|  10.6k|{
  118|  10.6k|    int ret = 1;
  119|  10.6k|    KECCAK1600_CTX *ctx = vctx;
  120|       |
  121|  10.6k|    if (ossl_unlikely(!ossl_prov_is_running()))
  ------------------
  |  |   23|  10.6k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
  122|      0|        return 0;
  123|  10.6k|    if (ossl_unlikely(ctx->md_size == SIZE_MAX)) {
  ------------------
  |  |   23|  10.6k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
  124|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_DIGEST_LENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  125|      0|        return 0;
  126|      0|    }
  127|  10.6k|    if (ossl_likely(outlen > 0))
  ------------------
  |  |   22|  10.6k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 10.6k, False: 0]
  |  |  ------------------
  ------------------
  128|  10.6k|        ret = ctx->meth.final(ctx, out, ctx->md_size);
  129|       |
  130|  10.6k|    *outl = ctx->md_size;
  131|  10.6k|    return ret;
  132|  10.6k|}
sha3_prov.c:keccak_freectx:
  556|  5.30k|{
  557|  5.30k|    KECCAK1600_CTX *ctx = (KECCAK1600_CTX *)vctx;
  558|       |
  559|  5.30k|    OPENSSL_clear_free(ctx, sizeof(*ctx));
  ------------------
  |  |  129|  5.30k|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  560|  5.30k|}
sha3_prov.c:keccak_init:
   64|  22.5k|{
   65|  22.5k|    if (ossl_unlikely(!ossl_prov_is_running()))
  ------------------
  |  |   23|  22.5k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 22.5k]
  |  |  ------------------
  ------------------
   66|      0|        return 0;
   67|       |    /* The newctx() handles most of the ctx fixed setup. */
   68|  22.5k|    ossl_sha3_reset((KECCAK1600_CTX *)vctx);
   69|  22.5k|    return 1;
   70|  22.5k|}
sha3_prov.c:generic_sha3_squeeze:
  170|  35.9k|{
  171|  35.9k|    return ossl_sha3_squeeze((KECCAK1600_CTX *)vctx, out, outlen);
  172|  35.9k|}
sha3_prov.c:shake_squeeze:
  136|  35.9k|{
  137|  35.9k|    int ret = 1;
  138|  35.9k|    KECCAK1600_CTX *ctx = vctx;
  139|       |
  140|  35.9k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (140:9): [True: 0, False: 35.9k]
  ------------------
  141|      0|        return 0;
  142|  35.9k|    if (ctx->meth.squeeze == NULL)
  ------------------
  |  Branch (142:9): [True: 0, False: 35.9k]
  ------------------
  143|      0|        return 0;
  144|  35.9k|    if (outlen > 0)
  ------------------
  |  Branch (144:9): [True: 35.9k, False: 0]
  ------------------
  145|  35.9k|        ret = ctx->meth.squeeze(ctx, out, outlen);
  146|       |
  147|  35.9k|    *outl = outlen;
  148|  35.9k|    return ret;
  149|  35.9k|}
sha3_prov.c:keccak_init_params:
   73|  19.9k|{
   74|  19.9k|    return keccak_init(vctx, NULL)
  ------------------
  |  Branch (74:12): [True: 19.9k, False: 0]
  ------------------
   75|  19.9k|        && shake_set_ctx_params(vctx, params);
  ------------------
  |  Branch (75:12): [True: 19.9k, False: 0]
  ------------------
   76|  19.9k|}
sha3_prov.c:shake_set_ctx_params:
  727|  27.8k|{
  728|  27.8k|    struct shake_set_ctx_params_st p;
  729|  27.8k|    KECCAK1600_CTX *ctx = (KECCAK1600_CTX *)vctx;
  730|       |
  731|  27.8k|    if (ossl_unlikely(ctx == NULL || !shake_set_ctx_params_decoder(params, &p)))
  ------------------
  |  |   23|  55.7k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 27.8k]
  |  |  |  Branch (23:46): [True: 0, False: 27.8k]
  |  |  |  Branch (23:46): [True: 0, False: 27.8k]
  |  |  ------------------
  ------------------
  732|      0|        return 0;
  733|       |
  734|  27.8k|    if (ossl_unlikely(p.xoflen != NULL
  ------------------
  |  |   23|  35.8k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 27.8k]
  |  |  |  Branch (23:46): [True: 7.96k, False: 19.9k]
  |  |  |  Branch (23:46): [True: 0, False: 7.96k]
  |  |  ------------------
  ------------------
  735|  27.8k|            && !OSSL_PARAM_get_size_t(p.xoflen, &ctx->md_size))) {
  736|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  737|      0|        return 0;
  738|      0|    }
  739|  27.8k|    return 1;
  740|  27.8k|}
sha3_prov.c:shake_set_ctx_params_decoder:
  683|  27.8k|{
  684|  27.8k|    const char *s;
  685|       |
  686|  27.8k|    memset(r, 0, sizeof(*r));
  687|  27.8k|    if (p != NULL)
  ------------------
  |  Branch (687:9): [True: 7.96k, False: 19.9k]
  ------------------
  688|  15.9k|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (688:16): [True: 7.96k, False: 7.96k]
  ------------------
  689|  7.96k|            switch(s[0]) {
  690|      0|            default:
  ------------------
  |  Branch (690:13): [True: 0, False: 7.96k]
  ------------------
  691|      0|                break;
  692|      0|            case 's':
  ------------------
  |  Branch (692:13): [True: 0, False: 7.96k]
  ------------------
  693|      0|                if (ossl_likely(strcmp("ize", s + 1) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  694|       |                    /* OSSL_DIGEST_PARAM_SIZE */
  695|      0|                    if (ossl_unlikely(r->xoflen != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  696|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  697|      0|                                       "param %s is repeated", s);
  698|      0|                        return 0;
  699|      0|                    }
  700|      0|                    r->xoflen = (OSSL_PARAM *)p;
  701|      0|                }
  702|      0|                break;
  703|  7.96k|            case 'x':
  ------------------
  |  Branch (703:13): [True: 7.96k, False: 0]
  ------------------
  704|  7.96k|                if (ossl_likely(strcmp("oflen", s + 1) == 0)) {
  ------------------
  |  |   22|  7.96k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 7.96k, False: 0]
  |  |  ------------------
  ------------------
  705|       |                    /* OSSL_DIGEST_PARAM_XOFLEN */
  706|  7.96k|                    if (ossl_unlikely(r->xoflen != NULL)) {
  ------------------
  |  |   23|  7.96k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 7.96k]
  |  |  ------------------
  ------------------
  707|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  708|      0|                                       "param %s is repeated", s);
  709|      0|                        return 0;
  710|      0|                    }
  711|  7.96k|                    r->xoflen = (OSSL_PARAM *)p;
  712|  7.96k|                }
  713|  7.96k|            }
  714|  27.8k|    return 1;
  715|  27.8k|}

decode_der2key.c:der2key_newctx:
  165|  1.12M|{
  166|  1.12M|    struct der2key_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  108|  1.12M|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  167|       |
  168|  1.12M|    if (ctx != NULL) {
  ------------------
  |  Branch (168:9): [True: 1.12M, False: 0]
  ------------------
  169|  1.12M|        ctx->provctx = provctx;
  170|  1.12M|        ctx->desc = desc;
  171|  1.12M|    }
  172|  1.12M|    return ctx;
  173|  1.12M|}
decode_der2key.c:der2key_freectx:
  237|  1.12M|{
  238|  1.12M|    struct der2key_ctx_st *ctx = vctx;
  239|       |
  240|  1.12M|    OPENSSL_free(ctx);
  ------------------
  |  |  131|  1.12M|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  241|  1.12M|}
decode_der2key.c:PrivateKeyInfo_der2dh_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:der2key_check_selection:
  245|    138|{
  246|       |    /*
  247|       |     * The selections are kinda sorta "levels", i.e. each selection given
  248|       |     * here is assumed to include those following.
  249|       |     */
  250|    138|    int checks[] = {
  251|    138|        OSSL_KEYMGMT_SELECT_PRIVATE_KEY,
  ------------------
  |  |  640|    138|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  ------------------
  252|    138|        OSSL_KEYMGMT_SELECT_PUBLIC_KEY,
  ------------------
  |  |  641|    138|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  ------------------
  253|    138|        OSSL_KEYMGMT_SELECT_ALL_PARAMETERS
  ------------------
  |  |  647|    138|    (OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS \
  |  |  ------------------
  |  |  |  |  642|    138|#define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS 0x04
  |  |  ------------------
  |  |  648|    138|        | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  643|    138|#define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS 0x80
  |  |  ------------------
  ------------------
  254|    138|    };
  255|    138|    size_t i;
  256|       |
  257|       |    /* The decoder implementations made here support guessing */
  258|    138|    if (selection == 0)
  ------------------
  |  Branch (258:9): [True: 0, False: 138]
  ------------------
  259|      0|        return 1;
  260|       |
  261|    276|    for (i = 0; i < OSSL_NELEM(checks); i++) {
  ------------------
  |  |   14|    276|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (261:17): [True: 276, False: 0]
  ------------------
  262|    276|        int check1 = (selection & checks[i]) != 0;
  263|    276|        int check2 = (desc->selection_mask & checks[i]) != 0;
  264|       |
  265|       |        /*
  266|       |         * If the caller asked for the currently checked bit(s), return
  267|       |         * whether the decoder description says it's supported.
  268|       |         */
  269|    276|        if (check1)
  ------------------
  |  Branch (269:13): [True: 138, False: 138]
  ------------------
  270|    138|            return check2;
  271|    276|    }
  272|       |
  273|       |    /* This should be dead code, but just to be safe... */
  274|      0|    return 0;
  275|    138|}
decode_der2key.c:der2key_decode:
  280|   412k|{
  281|   412k|    struct der2key_ctx_st *ctx = vctx;
  282|   412k|    unsigned char *der = NULL;
  283|   412k|    const unsigned char *derp;
  284|   412k|    long der_len = 0;
  285|   412k|    void *key = NULL;
  286|   412k|    int ok = 0;
  287|       |
  288|   412k|    ctx->selection = selection;
  289|       |    /*
  290|       |     * The caller is allowed to specify 0 as a selection mask, to have the
  291|       |     * structure and key type guessed.  For type-specific structures, this
  292|       |     * is not recommended, as some structures are very similar.
  293|       |     * Note that 0 isn't the same as OSSL_KEYMGMT_SELECT_ALL, as the latter
  294|       |     * signifies a private key structure, where everything else is assumed
  295|       |     * to be present as well.
  296|       |     */
  297|   412k|    if (selection == 0)
  ------------------
  |  Branch (297:9): [True: 0, False: 412k]
  ------------------
  298|      0|        selection = ctx->desc->selection_mask;
  299|   412k|    if ((selection & ctx->desc->selection_mask) == 0) {
  ------------------
  |  Branch (299:9): [True: 0, False: 412k]
  ------------------
  300|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  301|      0|        return 0;
  302|      0|    }
  303|       |
  304|   412k|    ok = ossl_read_der(ctx->provctx, cin, &der, &der_len);
  305|   412k|    if (!ok)
  ------------------
  |  Branch (305:9): [True: 0, False: 412k]
  ------------------
  306|      0|        goto next;
  307|       |
  308|   412k|    ok = 0; /* Assume that we fail */
  309|       |
  310|   412k|    ERR_set_mark();
  311|   412k|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  640|   412k|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  ------------------
  |  Branch (311:9): [True: 0, False: 412k]
  ------------------
  312|      0|        derp = der;
  313|      0|        if (ctx->desc->d2i_PKCS8 != NULL) {
  ------------------
  |  Branch (313:13): [True: 0, False: 0]
  ------------------
  314|      0|            key = ctx->desc->d2i_PKCS8(&derp, der_len, ctx);
  315|      0|            if (ctx->flag_fatal) {
  ------------------
  |  Branch (315:17): [True: 0, False: 0]
  ------------------
  316|      0|                ERR_clear_last_mark();
  317|      0|                goto end;
  318|      0|            }
  319|      0|        } else if (ctx->desc->d2i_private_key != NULL) {
  ------------------
  |  Branch (319:20): [True: 0, False: 0]
  ------------------
  320|      0|            key = ctx->desc->d2i_private_key(NULL, &derp, der_len);
  321|      0|        }
  322|      0|        if (key == NULL && ctx->selection != 0) {
  ------------------
  |  Branch (322:13): [True: 0, False: 0]
  |  Branch (322:28): [True: 0, False: 0]
  ------------------
  323|      0|            ERR_clear_last_mark();
  324|      0|            goto next;
  325|      0|        }
  326|      0|    }
  327|   412k|    if (key == NULL && (selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
  ------------------
  |  |  641|   412k|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  ------------------
  |  Branch (327:9): [True: 412k, False: 0]
  |  Branch (327:24): [True: 412k, False: 0]
  ------------------
  328|   412k|        derp = der;
  329|   412k|        if (ctx->desc->d2i_PUBKEY != NULL)
  ------------------
  |  Branch (329:13): [True: 412k, False: 0]
  ------------------
  330|   412k|            key = ctx->desc->d2i_PUBKEY(&derp, der_len, ctx);
  331|      0|        else if (ctx->desc->d2i_public_key != NULL)
  ------------------
  |  Branch (331:18): [True: 0, False: 0]
  ------------------
  332|      0|            key = ctx->desc->d2i_public_key(NULL, &derp, der_len);
  333|   412k|        if (key == NULL && ctx->selection != 0) {
  ------------------
  |  Branch (333:13): [True: 0, False: 412k]
  |  Branch (333:28): [True: 0, False: 0]
  ------------------
  334|      0|            ERR_clear_last_mark();
  335|      0|            goto next;
  336|      0|        }
  337|   412k|    }
  338|   412k|    if (key == NULL && (selection & OSSL_KEYMGMT_SELECT_ALL_PARAMETERS) != 0) {
  ------------------
  |  |  647|      0|    (OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS \
  |  |  ------------------
  |  |  |  |  642|      0|#define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS 0x04
  |  |  ------------------
  |  |  648|      0|        | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  643|      0|#define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS 0x80
  |  |  ------------------
  ------------------
  |  Branch (338:9): [True: 0, False: 412k]
  |  Branch (338:24): [True: 0, False: 0]
  ------------------
  339|      0|        derp = der;
  340|      0|        if (ctx->desc->d2i_key_params != NULL)
  ------------------
  |  Branch (340:13): [True: 0, False: 0]
  ------------------
  341|      0|            key = ctx->desc->d2i_key_params(NULL, &derp, der_len);
  342|      0|        if (key == NULL && ctx->selection != 0) {
  ------------------
  |  Branch (342:13): [True: 0, False: 0]
  |  Branch (342:28): [True: 0, False: 0]
  ------------------
  343|      0|            ERR_clear_last_mark();
  344|      0|            goto next;
  345|      0|        }
  346|      0|    }
  347|   412k|    if (key == NULL)
  ------------------
  |  Branch (347:9): [True: 0, False: 412k]
  ------------------
  348|      0|        ERR_clear_last_mark();
  349|   412k|    else
  350|   412k|        ERR_pop_to_mark();
  351|       |
  352|       |    /*
  353|       |     * Last minute check to see if this was the correct type of key.  This
  354|       |     * should never lead to a fatal error, i.e. the decoding itself was
  355|       |     * correct, it was just an unexpected key type.  This is generally for
  356|       |     * classes of key types that have subtle variants, like RSA-PSS keys as
  357|       |     * opposed to plain RSA keys.
  358|       |     */
  359|   412k|    if (key != NULL
  ------------------
  |  Branch (359:9): [True: 412k, False: 0]
  ------------------
  360|   412k|        && ctx->desc->check_key != NULL
  ------------------
  |  Branch (360:12): [True: 412k, False: 0]
  ------------------
  361|   412k|        && !ctx->desc->check_key(key, ctx)) {
  ------------------
  |  Branch (361:12): [True: 0, False: 412k]
  ------------------
  362|      0|        ctx->desc->free_key(key);
  363|      0|        key = NULL;
  364|      0|    }
  365|       |
  366|   412k|    if (key != NULL && ctx->desc->adjust_key != NULL)
  ------------------
  |  Branch (366:9): [True: 412k, False: 0]
  |  Branch (366:24): [True: 412k, False: 0]
  ------------------
  367|   412k|        ctx->desc->adjust_key(key, ctx);
  368|       |
  369|   412k|next:
  370|       |    /*
  371|       |     * Indicated that we successfully decoded something, or not at all.
  372|       |     * Ending up "empty handed" is not an error.
  373|       |     */
  374|   412k|    ok = 1;
  375|       |
  376|       |    /*
  377|       |     * We free memory here so it's not held up during the callback, because
  378|       |     * we know the process is recursive and the allocated chunks of memory
  379|       |     * add up.
  380|       |     */
  381|   412k|    OPENSSL_free(der);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  382|   412k|    der = NULL;
  383|       |
  384|   412k|    if (key != NULL) {
  ------------------
  |  Branch (384:9): [True: 412k, False: 0]
  ------------------
  385|   412k|        OSSL_PARAM params[4];
  386|   412k|        int object_type = OSSL_OBJECT_PKEY;
  ------------------
  |  |   29|   412k|#define OSSL_OBJECT_PKEY 2 /* EVP_PKEY * */
  ------------------
  387|       |
  388|   412k|        params[0] = OSSL_PARAM_construct_int(OSSL_OBJECT_PARAM_TYPE, &object_type);
  ------------------
  |  |  362|   412k|# define OSSL_OBJECT_PARAM_TYPE "type"
  ------------------
  389|       |
  390|   412k|#ifndef OPENSSL_NO_SM2
  391|   412k|        if (strcmp(ctx->desc->keytype_name, "EC") == 0
  ------------------
  |  Branch (391:13): [True: 112k, False: 299k]
  ------------------
  392|   112k|            && (EC_KEY_get_flags(key) & EC_FLAG_SM2_RANGE) != 0)
  ------------------
  |  |  954|   112k|#define EC_FLAG_SM2_RANGE 0x0004
  ------------------
  |  Branch (392:16): [True: 0, False: 112k]
  ------------------
  393|      0|            params[1] = OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_TYPE,
  ------------------
  |  |  358|      0|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
  394|      0|                "SM2", 0);
  395|   412k|        else
  396|   412k|#endif
  397|   412k|            params[1] = OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_TYPE,
  ------------------
  |  |  358|   412k|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
  398|   412k|                (char *)ctx->desc->keytype_name,
  399|   412k|                0);
  400|       |        /* The address of the key becomes the octet string */
  401|   412k|        params[2] = OSSL_PARAM_construct_octet_string(OSSL_OBJECT_PARAM_REFERENCE,
  ------------------
  |  |  361|   412k|# define OSSL_OBJECT_PARAM_REFERENCE "reference"
  ------------------
  402|   412k|            &key, sizeof(key));
  403|   412k|        params[3] = OSSL_PARAM_construct_end();
  404|       |
  405|   412k|        ok = data_cb(params, data_cbarg);
  406|   412k|    }
  407|       |
  408|   412k|end:
  409|   412k|    ctx->desc->free_key(key);
  410|   412k|    OPENSSL_free(der);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  411|       |
  412|   412k|    return ok;
  413|   412k|}
decode_der2key.c:SubjectPublicKeyInfo_der2dh_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:type_specific_params_der2dh_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:DH_der2dh_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2dhx_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2dhx_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:type_specific_params_der2dhx_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:DHX_der2dhx_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2dsa_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2dsa_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:type_specific_der2dsa_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:DSA_der2dsa_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:ec_check:
  523|   112k|{
  524|       |    /* We're trying to be clever by comparing two truths */
  525|   112k|    int ret = 0;
  526|   112k|    int sm2 = (EC_KEY_get_flags(key) & EC_FLAG_SM2_RANGE) != 0;
  ------------------
  |  |  954|   112k|#define EC_FLAG_SM2_RANGE 0x0004
  ------------------
  527|       |
  528|   112k|    if (sm2)
  ------------------
  |  Branch (528:9): [True: 0, False: 112k]
  ------------------
  529|      0|        ret = ctx->desc->evp_type == EVP_PKEY_SM2
  ------------------
  |  |   74|      0|#define EVP_PKEY_SM2 NID_sm2
  |  |  ------------------
  |  |  |  | 1255|      0|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  |  Branch (529:15): [True: 0, False: 0]
  ------------------
  530|      0|            || ctx->desc->evp_type == NID_X9_62_id_ecPublicKey;
  ------------------
  |  |  178|      0|#define NID_X9_62_id_ecPublicKey                408
  ------------------
  |  Branch (530:16): [True: 0, False: 0]
  ------------------
  531|   112k|    else
  532|   112k|        ret = ctx->desc->evp_type != EVP_PKEY_SM2;
  ------------------
  |  |   74|   112k|#define EVP_PKEY_SM2 NID_sm2
  |  |  ------------------
  |  |  |  | 1255|   112k|#define NID_sm2         1172
  |  |  ------------------
  ------------------
  533|       |
  534|   112k|    return ret;
  535|   112k|}
decode_der2key.c:ec_adjust:
  538|   112k|{
  539|   112k|    ossl_ec_key_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   31|   112k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  540|   112k|}
decode_der2key.c:PrivateKeyInfo_der2ec_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2ec_newctx:
 1231|   112k|    {                                                                                                                 \
 1232|   112k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);                                                     \
 1233|   112k|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2ec_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:type_specific_no_pub_der2ec_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:EC_der2ec_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2x25519_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2x25519_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2x448_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2x448_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2ed25519_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2ed25519_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2ed448_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2ed448_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2sm2_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2sm2_newctx:
 1231|   112k|    {                                                                                                                 \
 1232|   112k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);                                                     \
 1233|   112k|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2sm2_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:type_specific_no_pub_der2sm2_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2ml_kem_512_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_kem_512_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2ml_kem_768_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_kem_768_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2ml_kem_1024_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_kem_1024_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_128s_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_128f_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_192s_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_192f_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_256s_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_sha2_256f_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_128s_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_128f_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_192s_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_192f_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_256s_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2slh_dsa_shake_256f_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_128s_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_128f_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_192s_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_192f_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_256s_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_sha2_256f_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_128s_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_128f_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_192s_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_192f_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_256s_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2slh_dsa_shake_256f_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:rsa_check:
  949|   299k|{
  950|   299k|    int valid;
  951|       |
  952|   299k|    switch (RSA_test_flags(key, RSA_FLAG_TYPE_MASK)) {
  ------------------
  |  |  117|   299k|#define RSA_FLAG_TYPE_MASK 0xF000
  ------------------
  953|   299k|    case RSA_FLAG_TYPE_RSA:
  ------------------
  |  |  118|   299k|#define RSA_FLAG_TYPE_RSA 0x0000
  ------------------
  |  Branch (953:5): [True: 299k, False: 0]
  ------------------
  954|   299k|        valid = (ctx->desc->evp_type == EVP_PKEY_RSA);
  ------------------
  |  |   63|   299k|#define EVP_PKEY_RSA NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|   299k|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
  955|   299k|        break;
  956|      0|    case RSA_FLAG_TYPE_RSASSAPSS:
  ------------------
  |  |  119|      0|#define RSA_FLAG_TYPE_RSASSAPSS 0x1000
  ------------------
  |  Branch (956:5): [True: 0, False: 299k]
  ------------------
  957|      0|        valid = (ctx->desc->evp_type == EVP_PKEY_RSA_PSS);
  ------------------
  |  |   65|      0|#define EVP_PKEY_RSA_PSS NID_rsassaPss
  |  |  ------------------
  |  |  |  |  583|      0|#define NID_rsassaPss           912
  |  |  ------------------
  ------------------
  958|      0|        break;
  959|      0|    default:
  ------------------
  |  Branch (959:5): [True: 0, False: 299k]
  ------------------
  960|       |        /* Currently unsupported RSA key type */
  961|      0|        valid = 0;
  962|   299k|    }
  963|       |
  964|   299k|    valid = (valid && ossl_rsa_check_factors(key));
  ------------------
  |  Branch (964:14): [True: 299k, False: 0]
  |  Branch (964:23): [True: 299k, False: 0]
  ------------------
  965|       |
  966|   299k|    return valid;
  967|   299k|}
decode_der2key.c:rsa_adjust:
  970|   299k|{
  971|   299k|    ossl_rsa_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
  ------------------
  |  |   31|   299k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  972|   299k|}
decode_der2key.c:PrivateKeyInfo_der2rsa_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2rsa_newctx:
 1231|   299k|    {                                                                                                                 \
 1232|   299k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);                                                     \
 1233|   299k|    }                                                                                                                 \
decode_der2key.c:rsa_d2i_PUBKEY:
  944|   299k|{
  945|       |    return d2i_RSA_PUBKEY(NULL, der, der_len);
  946|   299k|}
decode_der2key.c:SubjectPublicKeyInfo_der2rsa_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:type_specific_keypair_der2rsa_newctx:
 1231|   299k|    {                                                                                                                 \
 1232|   299k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);                                                     \
 1233|   299k|    }                                                                                                                 \
decode_der2key.c:type_specific_keypair_der2rsa_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:RSA_der2rsa_newctx:
 1231|   299k|    {                                                                                                                 \
 1232|   299k|        return der2key_newctx(provctx, &kind##_##keytype##_desc);                                                     \
 1233|   299k|    }                                                                                                                 \
decode_der2key.c:RSA_der2rsa_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2rsapss_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2rsapss_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2ml_dsa_44_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_dsa_44_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2ml_dsa_65_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_dsa_65_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:PrivateKeyInfo_der2ml_dsa_87_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \
decode_der2key.c:SubjectPublicKeyInfo_der2ml_dsa_87_does_selection:
 1236|      2|    {                                                                                                                 \
 1237|      2|        return der2key_check_selection(selection,                                                                     \
 1238|      2|            &kind##_##keytype##_desc);                                                                                \
 1239|      2|    }                                                                                                                 \

decode_epki2pki.c:epki2pki_newctx:
   46|   412k|{
   47|   412k|    struct epki2pki_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  108|   412k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|       |
   49|   412k|    if (ctx != NULL)
  ------------------
  |  Branch (49:9): [True: 412k, False: 0]
  ------------------
   50|   412k|        ctx->provctx = provctx;
   51|   412k|    return ctx;
   52|   412k|}
decode_epki2pki.c:epki2pki_freectx:
   55|   412k|{
   56|   412k|    struct epki2pki_ctx_st *ctx = vctx;
   57|       |
   58|   412k|    OPENSSL_free(ctx);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   59|   412k|}
decode_epki2pki.c:epki2pki_set_ctx_params:
  106|      2|{
  107|      2|    struct epki2pki_ctx_st *ctx = vctx;
  108|      2|    struct epki2pki_set_ctx_params_st p;
  109|      2|    char *str;
  110|       |
  111|      2|    if (ctx == NULL || !epki2pki_set_ctx_params_decoder(params, &p))
  ------------------
  |  Branch (111:9): [True: 0, False: 2]
  |  Branch (111:24): [True: 0, False: 2]
  ------------------
  112|      0|        return 0;
  113|       |
  114|      2|    str = ctx->propq;
  115|      2|    if (p.propq != NULL
  ------------------
  |  Branch (115:9): [True: 0, False: 2]
  ------------------
  116|      0|        && !OSSL_PARAM_get_utf8_string(p.propq, &str, sizeof(ctx->propq)))
  ------------------
  |  Branch (116:12): [True: 0, False: 0]
  ------------------
  117|      0|        return 0;
  118|       |
  119|      2|    return 1;
  120|      2|}
decode_epki2pki.c:epki2pki_set_ctx_params_decoder:
   79|      2|{
   80|      2|    const char *s;
   81|       |
   82|      2|    memset(r, 0, sizeof(*r));
   83|      2|    if (p != NULL)
  ------------------
  |  Branch (83:9): [True: 2, False: 0]
  ------------------
   84|      4|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (84:16): [True: 2, False: 2]
  ------------------
   85|      2|            if (ossl_likely(strcmp("properties", s + 0) == 0)) {
  ------------------
  |  |   22|      2|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 2]
  |  |  ------------------
  ------------------
   86|       |                /* OSSL_DECODER_PARAM_PROPERTIES */
   87|      0|                if (ossl_unlikely(r->propq != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   88|      0|                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   89|      0|                                   "param %s is repeated", s);
   90|      0|                    return 0;
   91|      0|                }
   92|      0|                r->propq = (OSSL_PARAM *)p;
   93|      0|            }
   94|      2|    return 1;
   95|      2|}

decode_msblob2key.c:msblob2key_newctx:
   65|      1|{
   66|      1|    struct msblob2key_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  108|      1|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   67|       |
   68|      1|    if (ctx != NULL) {
  ------------------
  |  Branch (68:9): [True: 1, False: 0]
  ------------------
   69|      1|        ctx->provctx = provctx;
   70|      1|        ctx->desc = desc;
   71|      1|    }
   72|      1|    return ctx;
   73|      1|}
decode_msblob2key.c:msblob2key_freectx:
   76|      1|{
   77|      1|    struct msblob2key_ctx_st *ctx = vctx;
   78|       |
   79|      1|    OPENSSL_free(ctx);
  ------------------
  |  |  131|      1|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   80|      1|}
decode_msblob2key.c:msblob2key_does_selection:
   83|      4|{
   84|      4|    if (selection == 0)
  ------------------
  |  Branch (84:9): [True: 0, False: 4]
  ------------------
   85|      0|        return 1;
   86|       |
   87|      4|    if ((selection & (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)) != 0)
  ------------------
  |  |  640|      4|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  ------------------
                  if ((selection & (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)) != 0)
  ------------------
  |  |  641|      4|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  ------------------
  |  Branch (87:9): [True: 4, False: 0]
  ------------------
   88|      4|        return 1;
   89|       |
   90|      0|    return 0;
   91|      4|}
decode_msblob2key.c:msblob2rsa_newctx:
  262|      1|    {                                                                  \
  263|      1|        return msblob2key_newctx(provctx, &mstype##2##keytype##_desc); \
  264|      1|    }                                                                  \

decode_pem2der.c:pem2der_newctx:
   66|   412k|{
   67|   412k|    struct pem2der_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  108|   412k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   68|       |
   69|   412k|    if (ctx != NULL)
  ------------------
  |  Branch (69:9): [True: 412k, False: 0]
  ------------------
   70|   412k|        ctx->provctx = provctx;
   71|   412k|    return ctx;
   72|   412k|}
decode_pem2der.c:pem2der_freectx:
   75|   412k|{
   76|   412k|    struct pem2der_ctx_st *ctx = vctx;
   77|       |
   78|   412k|    OPENSSL_free(ctx);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|   412k|}
decode_pem2der.c:pem2der_set_ctx_params:
  144|      7|{
  145|      7|    struct pem2der_ctx_st *ctx = vctx;
  146|      7|    struct pem2der_set_ctx_params_st p;
  147|      7|    char *str;
  148|       |
  149|      7|    if (ctx == NULL || !pem2der_set_ctx_params_decoder(params, &p))
  ------------------
  |  Branch (149:9): [True: 0, False: 7]
  |  Branch (149:24): [True: 0, False: 7]
  ------------------
  150|      0|        return 0;
  151|       |
  152|      7|    str = ctx->propq;
  153|      7|    if (p.propq != NULL
  ------------------
  |  Branch (153:9): [True: 0, False: 7]
  ------------------
  154|      0|        && !OSSL_PARAM_get_utf8_string(p.propq, &str, sizeof(ctx->propq)))
  ------------------
  |  Branch (154:12): [True: 0, False: 0]
  ------------------
  155|      0|        return 0;
  156|       |
  157|      7|    str = ctx->data_structure;
  158|      7|    if (p.ds != NULL
  ------------------
  |  Branch (158:9): [True: 7, False: 0]
  ------------------
  159|      7|        && !OSSL_PARAM_get_utf8_string(p.ds, &str, sizeof(ctx->data_structure)))
  ------------------
  |  Branch (159:12): [True: 0, False: 7]
  ------------------
  160|      0|        return 0;
  161|       |
  162|      7|    return 1;
  163|      7|}
decode_pem2der.c:pem2der_set_ctx_params_decoder:
  101|      7|{
  102|      7|    const char *s;
  103|       |
  104|      7|    memset(r, 0, sizeof(*r));
  105|      7|    if (p != NULL)
  ------------------
  |  Branch (105:9): [True: 7, False: 0]
  ------------------
  106|     14|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (106:16): [True: 7, False: 7]
  ------------------
  107|      7|            switch(s[0]) {
  108|      0|            default:
  ------------------
  |  Branch (108:13): [True: 0, False: 7]
  ------------------
  109|      0|                break;
  110|      7|            case 'd':
  ------------------
  |  Branch (110:13): [True: 7, False: 0]
  ------------------
  111|      7|                if (ossl_likely(strcmp("ata-structure", s + 1) == 0)) {
  ------------------
  |  |   22|      7|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 7, False: 0]
  |  |  ------------------
  ------------------
  112|       |                    /* OSSL_OBJECT_PARAM_DATA_STRUCTURE */
  113|      7|                    if (ossl_unlikely(r->ds != NULL)) {
  ------------------
  |  |   23|      7|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 7]
  |  |  ------------------
  ------------------
  114|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  115|      0|                                       "param %s is repeated", s);
  116|      0|                        return 0;
  117|      0|                    }
  118|      7|                    r->ds = (OSSL_PARAM *)p;
  119|      7|                }
  120|      7|                break;
  121|      7|            case 'p':
  ------------------
  |  Branch (121:13): [True: 0, False: 7]
  ------------------
  122|      0|                if (ossl_likely(strcmp("roperties", s + 1) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  123|       |                    /* OSSL_DECODER_PARAM_PROPERTIES */
  124|      0|                    if (ossl_unlikely(r->propq != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  125|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  126|      0|                                       "param %s is repeated", s);
  127|      0|                        return 0;
  128|      0|                    }
  129|      0|                    r->propq = (OSSL_PARAM *)p;
  130|      0|                }
  131|      7|            }
  132|      7|    return 1;
  133|      7|}

decode_pvk2key.c:pvk2key_does_selection:
  153|      4|{
  154|      4|    if (selection == 0)
  ------------------
  |  Branch (154:9): [True: 0, False: 4]
  ------------------
  155|      0|        return 1;
  156|       |
  157|      4|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
  ------------------
  |  |  640|      4|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  ------------------
  |  Branch (157:9): [True: 0, False: 4]
  ------------------
  158|      0|        return 1;
  159|       |
  160|      4|    return 0;
  161|      4|}

ossl_spki2typespki_der_decode:
  144|   412k|{
  145|   412k|    const unsigned char *derp = der;
  146|   412k|    X509_PUBKEY *xpub = NULL;
  147|   412k|    X509_ALGOR *algor = NULL;
  148|   412k|    const ASN1_OBJECT *oid = NULL;
  149|   412k|    char dataname[OSSL_MAX_NAME_SIZE];
  150|   412k|    OSSL_PARAM params[6], *p = params;
  151|   412k|    int objtype = OSSL_OBJECT_PKEY;
  ------------------
  |  |   29|   412k|#define OSSL_OBJECT_PKEY 2 /* EVP_PKEY * */
  ------------------
  152|   412k|    int ok = 0;
  153|       |
  154|   412k|    xpub = ossl_d2i_X509_PUBKEY_INTERNAL(&derp, len, libctx, propq);
  155|       |
  156|   412k|    if (xpub == NULL) {
  ------------------
  |  Branch (156:9): [True: 0, False: 412k]
  ------------------
  157|       |        /* We return "empty handed".  This is not an error. */
  158|      0|        ok = 1;
  159|      0|        goto end;
  160|      0|    }
  161|       |
  162|   412k|    if (!X509_PUBKEY_get0_param(NULL, NULL, NULL, &algor, xpub))
  ------------------
  |  Branch (162:9): [True: 0, False: 412k]
  ------------------
  163|      0|        goto end;
  164|   412k|    X509_ALGOR_get0(&oid, NULL, NULL, algor);
  165|       |
  166|   412k|#ifndef OPENSSL_NO_EC
  167|       |    /* SM2 abuses the EC oid, so this could actually be SM2 */
  168|   412k|    if (OBJ_obj2nid(oid) == NID_X9_62_id_ecPublicKey
  ------------------
  |  |  178|   824k|#define NID_X9_62_id_ecPublicKey                408
  ------------------
  |  Branch (168:9): [True: 112k, False: 299k]
  ------------------
  169|   112k|        && ossl_x509_algor_is_sm2(algor))
  ------------------
  |  Branch (169:12): [True: 0, False: 112k]
  ------------------
  170|      0|        strcpy(dataname, "SM2");
  171|   412k|    else
  172|   412k|#endif
  173|   412k|        if (OBJ_obj2txt(dataname, sizeof(dataname), oid, 0) <= 0)
  ------------------
  |  Branch (173:13): [True: 0, False: 412k]
  ------------------
  174|      0|        goto end;
  175|       |
  176|   412k|    ossl_X509_PUBKEY_INTERNAL_free(xpub);
  177|   412k|    xpub = NULL;
  178|       |
  179|   412k|    *p++ = OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_TYPE,
  ------------------
  |  |  358|   412k|# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
  ------------------
  180|   412k|        dataname, 0);
  181|       |
  182|   412k|    *p++ = OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_INPUT_TYPE,
  ------------------
  |  |  360|   412k|# define OSSL_OBJECT_PARAM_INPUT_TYPE "input-type"
  ------------------
  183|   412k|        "DER", 0);
  184|       |
  185|   412k|    *p++ = OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_STRUCTURE,
  ------------------
  |  |  357|   412k|# define OSSL_OBJECT_PARAM_DATA_STRUCTURE "data-structure"
  ------------------
  186|   412k|        "SubjectPublicKeyInfo",
  187|   412k|        0);
  188|   412k|    *p++ = OSSL_PARAM_construct_octet_string(OSSL_OBJECT_PARAM_DATA, der, len);
  ------------------
  |  |  356|   412k|# define OSSL_OBJECT_PARAM_DATA "data"
  ------------------
  189|   412k|    *p++ = OSSL_PARAM_construct_int(OSSL_OBJECT_PARAM_TYPE, &objtype);
  ------------------
  |  |  362|   412k|# define OSSL_OBJECT_PARAM_TYPE "type"
  ------------------
  190|       |
  191|   412k|    *p = OSSL_PARAM_construct_end();
  192|       |
  193|   412k|    ok = data_cb(params, data_cbarg);
  194|       |
  195|   412k|end:
  196|   412k|    ossl_X509_PUBKEY_INTERNAL_free(xpub);
  197|   412k|    return ok;
  198|   412k|}
decode_spki2typespki.c:spki2typespki_newctx:
   45|   412k|{
   46|   412k|    struct spki2typespki_ctx_st *ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  108|   412k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   47|       |
   48|   412k|    if (ctx != NULL)
  ------------------
  |  Branch (48:9): [True: 412k, False: 0]
  ------------------
   49|   412k|        ctx->provctx = provctx;
   50|   412k|    return ctx;
   51|   412k|}
decode_spki2typespki.c:spki2typespki_freectx:
   54|   412k|{
   55|   412k|    struct spki2typespki_ctx_st *ctx = vctx;
   56|       |
   57|   412k|    OPENSSL_free(ctx);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   58|   412k|}
decode_spki2typespki.c:spki2typespki_decode:
  124|   412k|{
  125|   412k|    struct spki2typespki_ctx_st *ctx = vctx;
  126|   412k|    unsigned char *der;
  127|   412k|    long len;
  128|   412k|    int ok = 0;
  129|       |
  130|   412k|    if (!ossl_read_der(ctx->provctx, cin, &der, &len))
  ------------------
  |  Branch (130:9): [True: 0, False: 412k]
  ------------------
  131|      0|        return 1;
  132|       |
  133|   412k|    ok = ossl_spki2typespki_der_decode(der, len, selection, data_cb, data_cbarg,
  134|   412k|        pw_cb, pw_cbarg,
  135|   412k|        PROV_LIBCTX_OF(ctx->provctx), ctx->propq);
  ------------------
  |  |   31|   412k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  136|   412k|    OPENSSL_free(der);
  ------------------
  |  |  131|   412k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|   412k|    return ok;
  138|   412k|}
decode_spki2typespki.c:spki2typespki_set_ctx_params:
  105|      2|{
  106|      2|    struct spki2typespki_ctx_st *ctx = vctx;
  107|      2|    struct spki2typespki_set_ctx_params_st p;
  108|      2|    char *str;
  109|       |
  110|      2|    if (ctx == NULL || !spki2typespki_set_ctx_params_decoder(params, &p))
  ------------------
  |  Branch (110:9): [True: 0, False: 2]
  |  Branch (110:24): [True: 0, False: 2]
  ------------------
  111|      0|        return 0;
  112|       |
  113|      2|    str = ctx->propq;
  114|      2|    if (p.propq != NULL
  ------------------
  |  Branch (114:9): [True: 0, False: 2]
  ------------------
  115|      0|        && !OSSL_PARAM_get_utf8_string(p.propq, &str, sizeof(ctx->propq)))
  ------------------
  |  Branch (115:12): [True: 0, False: 0]
  ------------------
  116|      0|        return 0;
  117|       |
  118|      2|    return 1;
  119|      2|}
decode_spki2typespki.c:spki2typespki_set_ctx_params_decoder:
   78|      2|{
   79|      2|    const char *s;
   80|       |
   81|      2|    memset(r, 0, sizeof(*r));
   82|      2|    if (p != NULL)
  ------------------
  |  Branch (82:9): [True: 2, False: 0]
  ------------------
   83|      4|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (83:16): [True: 2, False: 2]
  ------------------
   84|      2|            if (ossl_likely(strcmp("properties", s + 0) == 0)) {
  ------------------
  |  |   22|      2|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 2]
  |  |  ------------------
  ------------------
   85|       |                /* OSSL_DECODER_PARAM_PROPERTIES */
   86|      0|                if (ossl_unlikely(r->propq != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   87|      0|                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
   88|      0|                                   "param %s is repeated", s);
   89|      0|                    return 0;
   90|      0|                }
   91|      0|                r->propq = (OSSL_PARAM *)p;
   92|      0|            }
   93|      2|    return 1;
   94|      2|}

ossl_read_der:
   88|   824k|{
   89|   824k|    BUF_MEM *mem = NULL;
   90|   824k|    BIO *in = ossl_bio_new_from_core_bio(provctx, cin);
   91|   824k|    int ok;
   92|       |
   93|   824k|    if (in == NULL)
  ------------------
  |  Branch (93:9): [True: 0, False: 824k]
  ------------------
   94|      0|        return 0;
   95|   824k|    ok = (asn1_d2i_read_bio(in, &mem) >= 0);
   96|   824k|    if (ok) {
  ------------------
  |  Branch (96:9): [True: 824k, False: 0]
  ------------------
   97|   824k|        *data = (unsigned char *)mem->data;
   98|   824k|        *len = (long)mem->length;
   99|   824k|        OPENSSL_free(mem);
  ------------------
  |  |  131|   824k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  100|   824k|    }
  101|   824k|    BIO_free(in);
  102|   824k|    return ok;
  103|   824k|}

cipher_aes.c:aes_256_ecb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  311|    632|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aes.c:aes_192_ecb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  311|    632|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aes.c:aes_128_ecb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  311|    632|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aes.c:aes_256_cbc_get_params:
  198|  3.11k|    {                                                                                   \
  199|  3.11k|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  312|  3.11k|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  200|  3.11k|            flags, kbits, blkbits, ivbits);                                             \
  201|  3.11k|    }                                                                                   \
cipher_aes.c:aes_192_cbc_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  312|    632|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aes.c:aes_128_cbc_get_params:
  198|  3.11k|    {                                                                                   \
  199|  3.11k|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  312|  3.11k|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  200|  3.11k|            flags, kbits, blkbits, ivbits);                                             \
  201|  3.11k|    }                                                                                   \
cipher_aes.c:aes_256_ofb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  314|    632|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aes.c:aes_192_ofb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  314|    632|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aes.c:aes_128_ofb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  314|    632|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aes.c:aes_256_cfb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aes.c:aes_192_cfb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aes.c:aes_128_cfb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aes.c:aes_256_cfb1_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aes.c:aes_192_cfb1_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aes.c:aes_128_cfb1_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aes.c:aes_256_cfb8_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aes.c:aes_192_cfb8_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aes.c:aes_128_cfb8_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aes.c:aes_256_ctr_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  315|    632|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aes.c:aes_192_ctr_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  315|    632|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aes.c:aes_128_ctr_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  315|    632|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aes.c:aes_cbc_cts_gettable_ctx_params:
  348|  1.89k|    {                                                                    \
  349|  1.89k|        return name##_known_gettable_ctx_params;                         \
  350|  1.89k|    }
cipher_aria.c:aria_256_ecb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  311|    632|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_192_ecb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  311|    632|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_128_ecb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  311|    632|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_256_cbc_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  312|    632|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_192_cbc_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  312|    632|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_128_cbc_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  312|    632|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_256_ofb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  314|    632|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_192_ofb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  314|    632|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_128_ofb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  314|    632|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_256_cfb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_192_cfb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_128_cfb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_256_cfb1_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_192_cfb1_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_128_cfb1_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_256_cfb8_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_192_cfb8_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_128_cfb8_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_256_ctr_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  315|    632|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_192_ctr_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  315|    632|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_aria.c:aria_128_ctr_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  315|    632|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_256_ecb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  311|    632|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_192_ecb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  311|    632|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_128_ecb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  311|    632|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_256_cbc_get_params:
  198|  3.11k|    {                                                                                   \
  199|  3.11k|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  312|  3.11k|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  200|  3.11k|            flags, kbits, blkbits, ivbits);                                             \
  201|  3.11k|    }                                                                                   \
cipher_camellia.c:camellia_192_cbc_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  312|    632|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_128_cbc_get_params:
  198|  3.11k|    {                                                                                   \
  199|  3.11k|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  312|  3.11k|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  200|  3.11k|            flags, kbits, blkbits, ivbits);                                             \
  201|  3.11k|    }                                                                                   \
cipher_camellia.c:camellia_256_ofb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  314|    632|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_192_ofb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  314|    632|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_128_ofb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  314|    632|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_256_cfb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_192_cfb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_128_cfb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_256_cfb1_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_192_cfb1_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_128_cfb1_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_256_cfb8_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_192_cfb8_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_128_cfb8_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_256_ctr_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  315|    632|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_192_ctr_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  315|    632|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_128_ctr_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  315|    632|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_camellia.c:camellia_cbc_cts_gettable_ctx_params:
  348|  1.89k|    {                                                                    \
  349|  1.89k|        return name##_known_gettable_ctx_params;                         \
  350|  1.89k|    }
cipher_sm4.c:sm4_128_ecb_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  311|    632|#define EVP_CIPH_ECB_MODE 0x1
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_sm4.c:sm4_128_cbc_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  312|    632|#define EVP_CIPH_CBC_MODE 0x2
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_sm4.c:sm4_128_ctr_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  315|    632|#define EVP_CIPH_CTR_MODE 0x5
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_sm4.c:sm4_128_ofb128_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  314|    632|#define EVP_CIPH_OFB_MODE 0x4
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
cipher_sm4.c:sm4_128_cfb128_get_params:
  198|    632|    {                                                                                   \
  199|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE,         \
  ------------------
  |  |  313|    632|#define EVP_CIPH_CFB_MODE 0x3
  ------------------
  200|    632|            flags, kbits, blkbits, ivbits);                                             \
  201|    632|    }                                                                                   \
ossl_tdes_gettable_ctx_params:
  348|  6.95k|    {                                                                    \
  349|  6.95k|        return name##_known_gettable_ctx_params;                         \
  350|  6.95k|    }

cipher_aes_ccm.c:aes_128_ccm_get_params:
   21|  5.59k|    {                                                                           \
   22|  5.59k|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  317|  5.59k|#define EVP_CIPH_CCM_MODE 0x7
  ------------------
   23|  5.59k|            flags, kbits, blkbits, ivbits);                                     \
   24|  5.59k|    }                                                                           \
cipher_aes_ccm.c:aes_192_ccm_get_params:
   21|    632|    {                                                                           \
   22|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  317|    632|#define EVP_CIPH_CCM_MODE 0x7
  ------------------
   23|    632|            flags, kbits, blkbits, ivbits);                                     \
   24|    632|    }                                                                           \
cipher_aes_ccm.c:aes_256_ccm_get_params:
   21|  5.59k|    {                                                                           \
   22|  5.59k|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  317|  5.59k|#define EVP_CIPH_CCM_MODE 0x7
  ------------------
   23|  5.59k|            flags, kbits, blkbits, ivbits);                                     \
   24|  5.59k|    }                                                                           \
cipher_aes_gcm.c:aes_128_gcm_get_params:
   21|  3.11k|    {                                                                           \
   22|  3.11k|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  316|  3.11k|#define EVP_CIPH_GCM_MODE 0x6
  ------------------
   23|  3.11k|            flags, kbits, blkbits, ivbits);                                     \
   24|  3.11k|    }                                                                           \
cipher_aes_gcm.c:aes_192_gcm_get_params:
   21|    632|    {                                                                           \
   22|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  316|    632|#define EVP_CIPH_GCM_MODE 0x6
  ------------------
   23|    632|            flags, kbits, blkbits, ivbits);                                     \
   24|    632|    }                                                                           \
cipher_aes_gcm.c:aes_256_gcm_get_params:
   21|  3.11k|    {                                                                           \
   22|  3.11k|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  316|  3.11k|#define EVP_CIPH_GCM_MODE 0x6
  ------------------
   23|  3.11k|            flags, kbits, blkbits, ivbits);                                     \
   24|  3.11k|    }                                                                           \
cipher_aria_ccm.c:aria_128_ccm_get_params:
   21|    632|    {                                                                           \
   22|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  317|    632|#define EVP_CIPH_CCM_MODE 0x7
  ------------------
   23|    632|            flags, kbits, blkbits, ivbits);                                     \
   24|    632|    }                                                                           \
cipher_aria_ccm.c:aria_192_ccm_get_params:
   21|    632|    {                                                                           \
   22|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  317|    632|#define EVP_CIPH_CCM_MODE 0x7
  ------------------
   23|    632|            flags, kbits, blkbits, ivbits);                                     \
   24|    632|    }                                                                           \
cipher_aria_ccm.c:aria_256_ccm_get_params:
   21|    632|    {                                                                           \
   22|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  317|    632|#define EVP_CIPH_CCM_MODE 0x7
  ------------------
   23|    632|            flags, kbits, blkbits, ivbits);                                     \
   24|    632|    }                                                                           \
cipher_aria_gcm.c:aria_128_gcm_get_params:
   21|  3.11k|    {                                                                           \
   22|  3.11k|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  316|  3.11k|#define EVP_CIPH_GCM_MODE 0x6
  ------------------
   23|  3.11k|            flags, kbits, blkbits, ivbits);                                     \
   24|  3.11k|    }                                                                           \
cipher_aria_gcm.c:aria_192_gcm_get_params:
   21|    632|    {                                                                           \
   22|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  316|    632|#define EVP_CIPH_GCM_MODE 0x6
  ------------------
   23|    632|            flags, kbits, blkbits, ivbits);                                     \
   24|    632|    }                                                                           \
cipher_aria_gcm.c:aria_256_gcm_get_params:
   21|  3.11k|    {                                                                           \
   22|  3.11k|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  316|  3.11k|#define EVP_CIPH_GCM_MODE 0x6
  ------------------
   23|  3.11k|            flags, kbits, blkbits, ivbits);                                     \
   24|  3.11k|    }                                                                           \
cipher_sm4_ccm.c:sm4_128_ccm_get_params:
   21|    632|    {                                                                           \
   22|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  317|    632|#define EVP_CIPH_CCM_MODE 0x7
  ------------------
   23|    632|            flags, kbits, blkbits, ivbits);                                     \
   24|    632|    }                                                                           \
cipher_sm4_gcm.c:sm4_128_gcm_get_params:
   21|    632|    {                                                                           \
   22|    632|        return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
  ------------------
  |  |  316|    632|#define EVP_CIPH_GCM_MODE 0x6
  ------------------
   23|    632|            flags, kbits, blkbits, ivbits);                                     \
   24|    632|    }                                                                           \

md5_prov.c:md5_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
md5_sha1_prov.c:md5_sha1_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
null_prov.c:nullmd_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
ripemd_prov.c:ripemd160_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha2_prov.c:sha1_internal_final:
   44|   338k|    {                                                                             \
   45|   338k|        if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {       \
  ------------------
  |  Branch (45:13): [True: 338k, False: 0]
  |  Branch (45:39): [True: 338k, False: 0]
  |  Branch (45:60): [True: 338k, False: 0]
  ------------------
   46|   338k|            *outl = dgstsize;                                                     \
   47|   338k|            return 1;                                                             \
   48|   338k|        }                                                                         \
   49|   338k|        return 0;                                                                 \
   50|   338k|    }
sha2_prov.c:sha1_freectx:
   63|   338k|    {                                                                            \
   64|   338k|        CTX *ctx = (CTX *)vctx;                                                  \
   65|   338k|        OPENSSL_clear_free(ctx, sizeof(*ctx));                                   \
  ------------------
  |  |  129|   338k|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   66|   338k|    }                                                                            \
sha2_prov.c:sha1_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha2_prov.c:sha1_internal_init:
  117|   338k|    {                                                                                  \
  118|   338k|        return ossl_prov_is_running()                                                  \
  ------------------
  |  Branch (118:16): [True: 338k, False: 0]
  ------------------
  119|   338k|            && init(ctx)                                                               \
  ------------------
  |  Branch (119:16): [True: 338k, False: 0]
  ------------------
  120|   338k|            && set_ctx_params(ctx, params);                                            \
  ------------------
  |  Branch (120:16): [True: 338k, False: 0]
  ------------------
  121|   338k|    }                                                                                  \
sha2_prov.c:sha224_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha2_prov.c:sha256_internal_final:
   44|  24.2k|    {                                                                             \
   45|  24.2k|        if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {       \
  ------------------
  |  Branch (45:13): [True: 24.2k, False: 0]
  |  Branch (45:39): [True: 24.2k, False: 0]
  |  Branch (45:60): [True: 24.2k, False: 0]
  ------------------
   46|  24.2k|            *outl = dgstsize;                                                     \
   47|  24.2k|            return 1;                                                             \
   48|  24.2k|        }                                                                         \
   49|  24.2k|        return 0;                                                                 \
   50|  24.2k|    }
sha2_prov.c:sha256_freectx:
   63|  24.2k|    {                                                                            \
   64|  24.2k|        CTX *ctx = (CTX *)vctx;                                                  \
   65|  24.2k|        OPENSSL_clear_free(ctx, sizeof(*ctx));                                   \
  ------------------
  |  |  129|  24.2k|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   66|  24.2k|    }                                                                            \
sha2_prov.c:sha256_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha2_prov.c:sha256_internal_init:
  104|  24.2k|    {                                                                              \
  105|  24.2k|        return ossl_prov_is_running() && init(ctx);                                \
  ------------------
  |  Branch (105:16): [True: 24.2k, False: 0]
  |  Branch (105:42): [True: 24.2k, False: 0]
  ------------------
  106|  24.2k|    }                                                                              \
sha2_prov.c:sha256_192_internal_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha2_prov.c:sha384_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha2_prov.c:sha512_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha2_prov.c:sha512_224_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha2_prov.c:sha512_256_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha3_prov.c:sha3_224_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha3_prov.c:sha3_256_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha3_prov.c:sha3_384_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha3_prov.c:sha3_512_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha3_prov.c:keccak_224_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha3_prov.c:keccak_256_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha3_prov.c:keccak_384_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha3_prov.c:keccak_512_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha3_prov.c:shake_128_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha3_prov.c:shake_256_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha3_prov.c:keccak_kmac_128_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sha3_prov.c:keccak_kmac_256_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }
sm3_prov.c:sm3_get_params:
   29|    632|    {                                                                            \
   30|    632|        return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \
   31|    632|    }

dh_kmgmt.c:dh_gen_init:
  493|     76|{
  494|     76|    return dh_gen_init_base(provctx, selection, params, DH_FLAG_TYPE_DH);
  ------------------
  |  |  111|     76|#define DH_FLAG_TYPE_DH 0x0000
  ------------------
  495|     76|}
dh_kmgmt.c:dh_gen_init_base:
  453|     76|{
  454|     76|    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(provctx);
  ------------------
  |  |   31|     76|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  455|     76|    struct dh_gen_ctx *gctx = NULL;
  456|       |
  457|     76|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (457:9): [True: 0, False: 76]
  ------------------
  458|      0|        return NULL;
  459|       |
  460|     76|    if ((selection & (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS)) == 0)
  ------------------
  |  |  650|     76|    (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  640|     76|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  641|     76|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  |  |  ------------------
  ------------------
                  if ((selection & (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS)) == 0)
  ------------------
  |  |  642|     76|#define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS 0x04
  ------------------
  |  Branch (460:9): [True: 0, False: 76]
  ------------------
  461|      0|        return NULL;
  462|       |
  463|     76|    if ((gctx = OPENSSL_zalloc(sizeof(*gctx))) != NULL) {
  ------------------
  |  |  108|     76|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (463:9): [True: 76, False: 0]
  ------------------
  464|     76|        gctx->selection = selection;
  465|     76|        gctx->libctx = libctx;
  466|     76|        gctx->pbits = 2048;
  467|     76|        gctx->qbits = 224;
  468|     76|        gctx->mdname = NULL;
  469|       |#ifdef FIPS_MODULE
  470|       |        gctx->gen_type = (type == DH_FLAG_TYPE_DHX)
  471|       |            ? DH_PARAMGEN_TYPE_FIPS_186_4
  472|       |            : DH_PARAMGEN_TYPE_GROUP;
  473|       |#else
  474|     76|        gctx->gen_type = (type == DH_FLAG_TYPE_DHX)
  ------------------
  |  |  112|     76|#define DH_FLAG_TYPE_DHX 0x1000
  ------------------
  |  Branch (474:26): [True: 0, False: 76]
  ------------------
  475|     76|            ? DH_PARAMGEN_TYPE_FIPS_186_2
  ------------------
  |  |   34|      0|#define DH_PARAMGEN_TYPE_FIPS_186_2 1 /* Use FIPS186-2 standard */
  ------------------
  476|     76|            : DH_PARAMGEN_TYPE_GENERATOR;
  ------------------
  |  |   33|    152|#define DH_PARAMGEN_TYPE_GENERATOR 0 /* Use a safe prime generator */
  ------------------
  477|     76|#endif
  478|     76|        gctx->gindex = -1;
  479|     76|        gctx->hindex = 0;
  480|     76|        gctx->pcounter = -1;
  481|     76|        gctx->generator = DH_GENERATOR_2;
  ------------------
  |  |  147|     76|#define DH_GENERATOR_2 2
  ------------------
  482|     76|        gctx->dh_type = type;
  483|     76|    }
  484|     76|    if (!dh_gen_set_params(gctx, params)) {
  ------------------
  |  Branch (484:9): [True: 0, False: 76]
  ------------------
  485|      0|        OPENSSL_free(gctx);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  486|       |        gctx = NULL;
  487|      0|    }
  488|     76|    return gctx;
  489|     76|}
dh_kmgmt.c:dh_gen_set_params:
  660|    152|{
  661|    152|    struct dh_gen_ctx *gctx = genctx;
  662|    152|    const OSSL_PARAM *p;
  663|       |
  664|    152|    if (!dh_gen_common_set_params(genctx, params))
  ------------------
  |  Branch (664:9): [True: 0, False: 152]
  ------------------
  665|      0|        return 0;
  666|       |
  667|    152|    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_DH_GENERATOR);
  ------------------
  |  |  372|    152|# define OSSL_PKEY_PARAM_DH_GENERATOR "safeprime-generator"
  ------------------
  668|    152|    if (p != NULL && !OSSL_PARAM_get_int(p, &gctx->generator))
  ------------------
  |  Branch (668:9): [True: 0, False: 152]
  |  Branch (668:22): [True: 0, False: 0]
  ------------------
  669|      0|        return 0;
  670|       |
  671|       |    /* Parameters that are not allowed for DH */
  672|    152|    if (OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_GINDEX) != NULL
  ------------------
  |  |  404|    152|# define OSSL_PKEY_PARAM_FFC_GINDEX "gindex"
  ------------------
  |  Branch (672:9): [True: 0, False: 152]
  ------------------
  673|    152|        || OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_PCOUNTER) != NULL
  ------------------
  |  |  408|    152|# define OSSL_PKEY_PARAM_FFC_PCOUNTER "pcounter"
  ------------------
  |  Branch (673:12): [True: 0, False: 152]
  ------------------
  674|    152|        || OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_H) != NULL
  ------------------
  |  |  405|    152|# define OSSL_PKEY_PARAM_FFC_H "hindex"
  ------------------
  |  Branch (674:12): [True: 0, False: 152]
  ------------------
  675|    152|        || OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_SEED) != NULL
  ------------------
  |  |  411|    152|# define OSSL_PKEY_PARAM_FFC_SEED "seed"
  ------------------
  |  Branch (675:12): [True: 0, False: 152]
  ------------------
  676|    152|        || OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_QBITS) != NULL
  ------------------
  |  |  410|    152|# define OSSL_PKEY_PARAM_FFC_QBITS "qbits"
  ------------------
  |  Branch (676:12): [True: 0, False: 152]
  ------------------
  677|    152|        || OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_DIGEST) != NULL
  ------------------
  |  |  401|    152|# define OSSL_PKEY_PARAM_FFC_DIGEST OSSL_PKEY_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  374|    152|# define OSSL_PKEY_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  |  |  ------------------
  |  |  |  |  |  |  128|    152|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (677:12): [True: 0, False: 152]
  ------------------
  678|    152|        || OSSL_PARAM_locate_const(params,
  ------------------
  |  Branch (678:12): [True: 0, False: 152]
  ------------------
  679|    152|               OSSL_PKEY_PARAM_FFC_DIGEST_PROPS)
  ------------------
  |  |  402|    152|# define OSSL_PKEY_PARAM_FFC_DIGEST_PROPS OSSL_PKEY_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  440|    152|# define OSSL_PKEY_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  |  |  ------------------
  |  |  |  |  |  |  132|    152|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  680|    152|            != NULL) {
  681|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  682|      0|        return 0;
  683|      0|    }
  684|    152|    return 1;
  685|    152|}
dh_kmgmt.c:dh_gen_common_set_params:
  530|    152|{
  531|    152|    struct dh_gen_ctx *gctx = genctx;
  532|    152|    const OSSL_PARAM *p;
  533|    152|    int gen_type = -1;
  534|       |
  535|    152|    if (gctx == NULL)
  ------------------
  |  Branch (535:9): [True: 0, False: 152]
  ------------------
  536|      0|        return 0;
  537|    152|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (537:9): [True: 76, False: 76]
  ------------------
  538|     76|        return 1;
  539|       |
  540|     76|    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_TYPE);
  ------------------
  |  |  412|     76|# define OSSL_PKEY_PARAM_FFC_TYPE "type"
  ------------------
  541|     76|    if (p != NULL) {
  ------------------
  |  Branch (541:9): [True: 0, False: 76]
  ------------------
  542|      0|        if (p->data_type != OSSL_PARAM_UTF8_STRING
  ------------------
  |  |  117|      0|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (542:13): [True: 0, False: 0]
  ------------------
  543|      0|            || ((gen_type = dh_gen_type_name2id_w_default(p->data, gctx->dh_type)) == -1)) {
  ------------------
  |  Branch (543:16): [True: 0, False: 0]
  ------------------
  544|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  545|      0|            return 0;
  546|      0|        }
  547|      0|        if (gen_type != -1)
  ------------------
  |  Branch (547:13): [True: 0, False: 0]
  ------------------
  548|      0|            gctx->gen_type = gen_type;
  549|      0|    }
  550|     76|    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_GROUP_NAME);
  ------------------
  |  |  420|     76|# define OSSL_PKEY_PARAM_GROUP_NAME "group"
  ------------------
  551|     76|    if (p != NULL) {
  ------------------
  |  Branch (551:9): [True: 76, False: 0]
  ------------------
  552|     76|        const DH_NAMED_GROUP *group = NULL;
  553|       |
  554|     76|        if (p->data_type != OSSL_PARAM_UTF8_STRING
  ------------------
  |  |  117|    152|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (554:13): [True: 0, False: 76]
  ------------------
  555|     76|            || p->data == NULL
  ------------------
  |  Branch (555:16): [True: 0, False: 76]
  ------------------
  556|     76|            || (group = ossl_ffc_name_to_dh_named_group(p->data)) == NULL
  ------------------
  |  Branch (556:16): [True: 0, False: 76]
  ------------------
  557|     76|            || ((gctx->group_nid = ossl_ffc_named_group_get_uid(group)) == NID_undef)) {
  ------------------
  |  |   18|     76|#define NID_undef                       0
  ------------------
  |  Branch (557:16): [True: 0, False: 76]
  ------------------
  558|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  559|      0|            return 0;
  560|      0|        }
  561|     76|    }
  562|     76|    if ((p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_FFC_PBITS)) != NULL
  ------------------
  |  |  407|     76|# define OSSL_PKEY_PARAM_FFC_PBITS "pbits"
  ------------------
  |  Branch (562:9): [True: 0, False: 76]
  ------------------
  563|      0|        && !OSSL_PARAM_get_size_t(p, &gctx->pbits))
  ------------------
  |  Branch (563:12): [True: 0, False: 0]
  ------------------
  564|      0|        return 0;
  565|     76|    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_DH_PRIV_LEN);
  ------------------
  |  |  373|     76|# define OSSL_PKEY_PARAM_DH_PRIV_LEN "priv_len"
  ------------------
  566|     76|    if (p != NULL && !OSSL_PARAM_get_int(p, &gctx->priv_len))
  ------------------
  |  Branch (566:9): [True: 0, False: 76]
  |  Branch (566:22): [True: 0, False: 0]
  ------------------
  567|      0|        return 0;
  568|     76|    return 1;
  569|     76|}
dh_kmgmt.c:dh_gen:
  699|     76|{
  700|     76|    int ret = 0;
  701|     76|    struct dh_gen_ctx *gctx = genctx;
  702|     76|    DH *dh = NULL;
  703|     76|    BN_GENCB *gencb = NULL;
  704|     76|    FFC_PARAMS *ffc;
  705|       |
  706|     76|    if (!ossl_prov_is_running() || gctx == NULL)
  ------------------
  |  Branch (706:9): [True: 0, False: 76]
  |  Branch (706:36): [True: 0, False: 76]
  ------------------
  707|      0|        return NULL;
  708|       |
  709|       |    /*
  710|       |     * If a group name is selected then the type is group regardless of what
  711|       |     * the user selected. This overrides rather than errors for backwards
  712|       |     * compatibility.
  713|       |     */
  714|     76|    if (gctx->group_nid != NID_undef)
  ------------------
  |  |   18|     76|#define NID_undef                       0
  ------------------
  |  Branch (714:9): [True: 76, False: 0]
  ------------------
  715|     76|        gctx->gen_type = DH_PARAMGEN_TYPE_GROUP;
  ------------------
  |  |   36|     76|#define DH_PARAMGEN_TYPE_GROUP 3 /* Use a named safe prime group */
  ------------------
  716|       |
  717|       |    /*
  718|       |     * Do a bounds check on context gen_type. Must be in range:
  719|       |     * DH_PARAMGEN_TYPE_GENERATOR <= gen_type <= DH_PARAMGEN_TYPE_GROUP
  720|       |     * Noted here as this needs to be adjusted if a new group type is
  721|       |     * added.
  722|       |     */
  723|     76|    if (!ossl_assert((gctx->gen_type >= DH_PARAMGEN_TYPE_GENERATOR)
  ------------------
  |  |   52|    152|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  ------------------
  |  |  |  Branch (52:41): [True: 76, False: 0]
  |  |  |  Branch (52:41): [True: 76, False: 0]
  |  |  ------------------
  |  |   53|     76|    __FILE__, __LINE__)
  ------------------
  |  Branch (723:9): [True: 0, False: 76]
  ------------------
  724|     76|            && (gctx->gen_type <= DH_PARAMGEN_TYPE_GROUP))) {
  725|      0|        ERR_raise_data(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  355|      0|#define ERR_R_INTERNAL_ERROR (259 | ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  351|      0|#define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  238|      0|#define ERR_RFLAG_FATAL (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  726|      0|            "gen_type set to unsupported value %d", gctx->gen_type);
  727|      0|        return NULL;
  728|      0|    }
  729|       |
  730|       |    /* For parameter generation - If there is a group name just create it */
  731|     76|    if (gctx->gen_type == DH_PARAMGEN_TYPE_GROUP
  ------------------
  |  |   36|    152|#define DH_PARAMGEN_TYPE_GROUP 3 /* Use a named safe prime group */
  ------------------
  |  Branch (731:9): [True: 76, False: 0]
  ------------------
  732|     76|        && gctx->ffc_params == NULL) {
  ------------------
  |  Branch (732:12): [True: 76, False: 0]
  ------------------
  733|       |        /* Select a named group if there is not one already */
  734|     76|        if (gctx->group_nid == NID_undef)
  ------------------
  |  |   18|     76|#define NID_undef                       0
  ------------------
  |  Branch (734:13): [True: 0, False: 76]
  ------------------
  735|      0|            gctx->group_nid = ossl_dh_get_named_group_uid_from_size((int)gctx->pbits);
  736|     76|        if (gctx->group_nid == NID_undef)
  ------------------
  |  |   18|     76|#define NID_undef                       0
  ------------------
  |  Branch (736:13): [True: 0, False: 76]
  ------------------
  737|      0|            return NULL;
  738|     76|        dh = ossl_dh_new_by_nid_ex(gctx->libctx, gctx->group_nid);
  739|     76|        if (dh == NULL)
  ------------------
  |  Branch (739:13): [True: 0, False: 76]
  ------------------
  740|      0|            return NULL;
  741|     76|        ffc = ossl_dh_get0_params(dh);
  742|     76|    } else {
  743|      0|        dh = ossl_dh_new_ex(gctx->libctx);
  744|      0|        if (dh == NULL)
  ------------------
  |  Branch (744:13): [True: 0, False: 0]
  ------------------
  745|      0|            return NULL;
  746|      0|        ffc = ossl_dh_get0_params(dh);
  747|       |
  748|       |        /* Copy the template value if one was passed */
  749|      0|        if (gctx->ffc_params != NULL
  ------------------
  |  Branch (749:13): [True: 0, False: 0]
  ------------------
  750|      0|            && !ossl_ffc_params_copy(ffc, gctx->ffc_params))
  ------------------
  |  Branch (750:16): [True: 0, False: 0]
  ------------------
  751|      0|            goto end;
  752|       |
  753|      0|        if (!ossl_ffc_params_set_seed(ffc, gctx->seed, gctx->seedlen))
  ------------------
  |  Branch (753:13): [True: 0, False: 0]
  ------------------
  754|      0|            goto end;
  755|      0|        if (gctx->gindex != -1) {
  ------------------
  |  Branch (755:13): [True: 0, False: 0]
  ------------------
  756|      0|            ossl_ffc_params_set_gindex(ffc, gctx->gindex);
  757|      0|            if (gctx->pcounter != -1)
  ------------------
  |  Branch (757:17): [True: 0, False: 0]
  ------------------
  758|      0|                ossl_ffc_params_set_pcounter(ffc, gctx->pcounter);
  759|      0|        } else if (gctx->hindex != 0) {
  ------------------
  |  Branch (759:20): [True: 0, False: 0]
  ------------------
  760|      0|            ossl_ffc_params_set_h(ffc, gctx->hindex);
  761|      0|        }
  762|      0|        if (gctx->mdname != NULL)
  ------------------
  |  Branch (762:13): [True: 0, False: 0]
  ------------------
  763|      0|            ossl_ffc_set_digest(ffc, gctx->mdname, gctx->mdprops);
  764|      0|        gctx->cb = osslcb;
  765|      0|        gctx->cbarg = cbarg;
  766|      0|        gencb = BN_GENCB_new();
  767|      0|        if (gencb != NULL)
  ------------------
  |  Branch (767:13): [True: 0, False: 0]
  ------------------
  768|      0|            BN_GENCB_set(gencb, dh_gencb, genctx);
  769|       |
  770|      0|        if ((gctx->selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0) {
  ------------------
  |  |  642|      0|#define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS 0x04
  ------------------
  |  Branch (770:13): [True: 0, False: 0]
  ------------------
  771|       |            /*
  772|       |             * NOTE: The old safe prime generator code is not used in fips mode,
  773|       |             * (i.e internally it ignores the generator and chooses a named
  774|       |             * group based on pbits.
  775|       |             */
  776|      0|            if (gctx->gen_type == DH_PARAMGEN_TYPE_GENERATOR)
  ------------------
  |  |   33|      0|#define DH_PARAMGEN_TYPE_GENERATOR 0 /* Use a safe prime generator */
  ------------------
  |  Branch (776:17): [True: 0, False: 0]
  ------------------
  777|      0|                ret = DH_generate_parameters_ex(dh, (int)gctx->pbits,
  778|      0|                    gctx->generator, gencb);
  779|      0|            else
  780|      0|                ret = ossl_dh_generate_ffc_parameters(dh, gctx->gen_type,
  781|      0|                    (int)gctx->pbits,
  782|      0|                    (int)gctx->qbits, gencb);
  783|      0|            if (ret <= 0)
  ------------------
  |  Branch (783:17): [True: 0, False: 0]
  ------------------
  784|      0|                goto end;
  785|      0|        }
  786|      0|    }
  787|       |
  788|     76|    if ((gctx->selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
  ------------------
  |  |  650|     76|    (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  640|     76|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  641|     76|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  |  |  ------------------
  ------------------
  |  Branch (788:9): [True: 76, False: 0]
  ------------------
  789|     76|        if (ffc->p == NULL || ffc->g == NULL)
  ------------------
  |  Branch (789:13): [True: 0, False: 76]
  |  Branch (789:31): [True: 0, False: 76]
  ------------------
  790|      0|            goto end;
  791|     76|        if (gctx->priv_len > 0)
  ------------------
  |  Branch (791:13): [True: 0, False: 76]
  ------------------
  792|      0|            DH_set_length(dh, (long)gctx->priv_len);
  793|     76|        ossl_ffc_params_enable_flags(ffc, FFC_PARAM_FLAG_VALIDATE_LEGACY,
  ------------------
  |  |   47|     76|#define FFC_PARAM_FLAG_VALIDATE_LEGACY 0x04
  ------------------
  794|     76|            gctx->gen_type == DH_PARAMGEN_TYPE_FIPS_186_2);
  ------------------
  |  |   34|     76|#define DH_PARAMGEN_TYPE_FIPS_186_2 1 /* Use FIPS186-2 standard */
  ------------------
  795|     76|        if (DH_generate_key(dh) <= 0)
  ------------------
  |  Branch (795:13): [True: 0, False: 76]
  ------------------
  796|      0|            goto end;
  797|       |#ifdef FIPS_MODULE
  798|       |        if (!ossl_fips_self_testing()) {
  799|       |            ret = ossl_dh_check_pairwise(dh, 0);
  800|       |            if (ret <= 0) {
  801|       |                ossl_set_error_state(OSSL_SELF_TEST_TYPE_PCT);
  802|       |                goto end;
  803|       |            }
  804|       |        }
  805|       |#endif /* FIPS_MODULE */
  806|     76|    }
  807|     76|    DH_clear_flags(dh, DH_FLAG_TYPE_MASK);
  ------------------
  |  |  110|     76|#define DH_FLAG_TYPE_MASK 0xF000
  ------------------
  808|     76|    DH_set_flags(dh, gctx->dh_type);
  809|       |
  810|     76|    ret = 1;
  811|     76|end:
  812|     76|    if (ret <= 0) {
  ------------------
  |  Branch (812:9): [True: 0, False: 76]
  ------------------
  813|      0|        DH_free(dh);
  814|       |        dh = NULL;
  815|      0|    }
  816|     76|    BN_GENCB_free(gencb);
  817|     76|    return dh;
  818|     76|}
dh_kmgmt.c:dh_gen_cleanup:
  821|     76|{
  822|     76|    struct dh_gen_ctx *gctx = genctx;
  823|       |
  824|     76|    if (gctx == NULL)
  ------------------
  |  Branch (824:9): [True: 0, False: 76]
  ------------------
  825|      0|        return;
  826|       |
  827|     76|    OPENSSL_free(gctx->mdname);
  ------------------
  |  |  131|     76|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  828|     76|    OPENSSL_free(gctx->mdprops);
  ------------------
  |  |  131|     76|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  829|     76|    OPENSSL_clear_free(gctx->seed, gctx->seedlen);
  ------------------
  |  |  129|     76|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  830|     76|    OPENSSL_free(gctx);
  ------------------
  |  |  131|     76|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  831|     76|}
dh_kmgmt.c:dh_freedata:
  128|     76|{
  129|     76|    DH_free(keydata);
  130|     76|}
dh_kmgmt.c:dh_get_params:
  316|    228|{
  317|    228|    DH *dh = key;
  318|    228|    OSSL_PARAM *p;
  319|       |
  320|    228|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  366|    228|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (320:9): [True: 76, False: 152]
  ------------------
  321|     76|        && !OSSL_PARAM_set_int(p, DH_bits(dh)))
  ------------------
  |  Branch (321:12): [True: 0, False: 76]
  ------------------
  322|      0|        return 0;
  323|    228|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  495|    228|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (323:9): [True: 76, False: 152]
  ------------------
  324|     76|        && !OSSL_PARAM_set_int(p, DH_security_bits(dh)))
  ------------------
  |  Branch (324:12): [True: 0, False: 76]
  ------------------
  325|      0|        return 0;
  326|    228|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  424|    228|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (326:9): [True: 76, False: 152]
  ------------------
  327|     76|        && !OSSL_PARAM_set_int(p, DH_size(dh)))
  ------------------
  |  Branch (327:12): [True: 0, False: 76]
  ------------------
  328|      0|        return 0;
  329|    228|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY)) != NULL) {
  ------------------
  |  |  398|    228|# define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY "encoded-pub-key"
  ------------------
  |  Branch (329:9): [True: 152, False: 76]
  ------------------
  330|    152|        if (p->data_type != OSSL_PARAM_OCTET_STRING)
  ------------------
  |  |  123|    152|#define OSSL_PARAM_OCTET_STRING 5
  ------------------
  |  Branch (330:13): [True: 0, False: 152]
  ------------------
  331|      0|            return 0;
  332|    152|        p->return_size = ossl_dh_key2buf(dh, (unsigned char **)&p->data,
  333|    152|            p->data_size, 0);
  334|    152|        if (p->return_size == 0)
  ------------------
  |  Branch (334:13): [True: 0, False: 152]
  ------------------
  335|      0|            return 0;
  336|    152|    }
  337|    228|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_CATEGORY)) != NULL)
  ------------------
  |  |  496|    228|# define OSSL_PKEY_PARAM_SECURITY_CATEGORY OSSL_ALG_PARAM_SECURITY_CATEGORY
  |  |  ------------------
  |  |  |  |  133|    228|# define OSSL_ALG_PARAM_SECURITY_CATEGORY "security-category"
  |  |  ------------------
  ------------------
  |  Branch (337:9): [True: 76, False: 152]
  ------------------
  338|     76|        if (!OSSL_PARAM_set_int(p, 0))
  ------------------
  |  Branch (338:13): [True: 0, False: 76]
  ------------------
  339|      0|            return 0;
  340|       |
  341|    228|    return ossl_dh_params_todata(dh, NULL, params)
  ------------------
  |  Branch (341:12): [True: 228, False: 0]
  ------------------
  342|    228|        && ossl_dh_key_todata(dh, NULL, params, 1);
  ------------------
  |  Branch (342:12): [True: 228, False: 0]
  ------------------
  343|    228|}

ec_kmgmt.c:ec_gen_init:
  975|    226|{
  976|    226|    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(provctx);
  ------------------
  |  |   31|    226|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  977|    226|    struct ec_gen_ctx *gctx = NULL;
  978|       |
  979|    226|    if (!ossl_prov_is_running() || (selection & (EC_POSSIBLE_SELECTIONS)) == 0)
  ------------------
  |  |   79|    226|    (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS)
  |  |  ------------------
  |  |  |  |  650|    226|    (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  |  |  ------------------
  |  |  |  |  |  |  640|    226|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  |  |  |  |  ------------------
  |  |  |  |                   (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  |  |  ------------------
  |  |  |  |  |  |  641|    226|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS)
  |  |  ------------------
  |  |  |  |  647|    226|    (OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS \
  |  |  |  |  ------------------
  |  |  |  |  |  |  642|    226|#define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS 0x04
  |  |  |  |  ------------------
  |  |  |  |  648|    226|        | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  643|    226|#define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS 0x80
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (979:9): [True: 0, False: 226]
  |  Branch (979:36): [True: 0, False: 226]
  ------------------
  980|      0|        return NULL;
  981|       |
  982|    226|    if ((gctx = OPENSSL_zalloc(sizeof(*gctx))) != NULL) {
  ------------------
  |  |  108|    226|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (982:9): [True: 226, False: 0]
  ------------------
  983|    226|        gctx->libctx = libctx;
  984|    226|        gctx->selection = selection;
  985|    226|        gctx->ecdh_mode = 0;
  986|    226|        OSSL_FIPS_IND_INIT(gctx)
  987|    226|        if (!ec_gen_set_params(gctx, params)) {
  ------------------
  |  Branch (987:13): [True: 0, False: 226]
  ------------------
  988|      0|            ec_gen_cleanup(gctx);
  989|       |            gctx = NULL;
  990|      0|        }
  991|    226|    }
  992|    226|    return gctx;
  993|    226|}
ec_kmgmt.c:ec_gen_set_params:
 1080|    452|{
 1081|    452|    int ret = 0;
 1082|    452|    struct ec_gen_ctx *gctx = genctx;
 1083|    452|    const OSSL_PARAM *p;
 1084|       |
 1085|    452|    if (!OSSL_FIPS_IND_SET_CTX_PARAM(gctx, OSSL_FIPS_IND_SETTABLE0, params,
  ------------------
  |  |  157|    452|#define OSSL_FIPS_IND_SET_CTX_PARAM(ctx, id, params, name) 1
  ------------------
  |  Branch (1085:9): [Folded, False: 452]
  ------------------
 1086|    452|            OSSL_PKEY_PARAM_FIPS_KEY_CHECK))
 1087|      0|        goto err;
 1088|       |
 1089|    452|    COPY_INT_PARAM(params, OSSL_PKEY_PARAM_USE_COFACTOR_ECDH, gctx->ecdh_mode);
  ------------------
  |  | 1043|    452|    p = OSSL_PARAM_locate_const(params, key);      \
  |  | 1044|    452|    if (p != NULL && !OSSL_PARAM_get_int(p, &val)) \
  |  |  ------------------
  |  |  |  Branch (1044:9): [True: 0, False: 452]
  |  |  |  Branch (1044:22): [True: 0, False: 0]
  |  |  ------------------
  |  | 1045|    452|        goto err;
  ------------------
 1090|       |
 1091|    452|    COPY_UTF8_PARAM(params, OSSL_PKEY_PARAM_GROUP_NAME, gctx->group_name);
  ------------------
  |  | 1048|    452|    p = OSSL_PARAM_locate_const(params, key);       \
  |  | 1049|    452|    if (p != NULL) {                                \
  |  |  ------------------
  |  |  |  Branch (1049:9): [True: 226, False: 226]
  |  |  ------------------
  |  | 1050|    226|        if (p->data_type != OSSL_PARAM_UTF8_STRING) \
  |  |  ------------------
  |  |  |  |  117|    226|#define OSSL_PARAM_UTF8_STRING 4
  |  |  ------------------
  |  |  |  Branch (1050:13): [True: 0, False: 226]
  |  |  ------------------
  |  | 1051|    226|            goto err;                               \
  |  | 1052|    226|        OPENSSL_free(val);                          \
  |  |  ------------------
  |  |  |  |  131|    226|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1053|    226|        val = OPENSSL_strdup(p->data);              \
  |  |  ------------------
  |  |  |  |  135|    226|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1054|    226|        if (val == NULL)                            \
  |  |  ------------------
  |  |  |  Branch (1054:13): [True: 0, False: 226]
  |  |  ------------------
  |  | 1055|    226|            goto err;                               \
  |  | 1056|    226|    }
  ------------------
 1092|    452|    COPY_UTF8_PARAM(params, OSSL_PKEY_PARAM_EC_FIELD_TYPE, gctx->field_type);
  ------------------
  |  | 1048|    452|    p = OSSL_PARAM_locate_const(params, key);       \
  |  | 1049|    452|    if (p != NULL) {                                \
  |  |  ------------------
  |  |  |  Branch (1049:9): [True: 0, False: 452]
  |  |  ------------------
  |  | 1050|      0|        if (p->data_type != OSSL_PARAM_UTF8_STRING) \
  |  |  ------------------
  |  |  |  |  117|      0|#define OSSL_PARAM_UTF8_STRING 4
  |  |  ------------------
  |  |  |  Branch (1050:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1051|      0|            goto err;                               \
  |  | 1052|      0|        OPENSSL_free(val);                          \
  |  |  ------------------
  |  |  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1053|      0|        val = OPENSSL_strdup(p->data);              \
  |  |  ------------------
  |  |  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1054|      0|        if (val == NULL)                            \
  |  |  ------------------
  |  |  |  Branch (1054:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1055|      0|            goto err;                               \
  |  | 1056|      0|    }
  ------------------
 1093|    452|    COPY_UTF8_PARAM(params, OSSL_PKEY_PARAM_EC_ENCODING, gctx->encoding);
  ------------------
  |  | 1048|    452|    p = OSSL_PARAM_locate_const(params, key);       \
  |  | 1049|    452|    if (p != NULL) {                                \
  |  |  ------------------
  |  |  |  Branch (1049:9): [True: 0, False: 452]
  |  |  ------------------
  |  | 1050|      0|        if (p->data_type != OSSL_PARAM_UTF8_STRING) \
  |  |  ------------------
  |  |  |  |  117|      0|#define OSSL_PARAM_UTF8_STRING 4
  |  |  ------------------
  |  |  |  Branch (1050:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1051|      0|            goto err;                               \
  |  | 1052|      0|        OPENSSL_free(val);                          \
  |  |  ------------------
  |  |  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1053|      0|        val = OPENSSL_strdup(p->data);              \
  |  |  ------------------
  |  |  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1054|      0|        if (val == NULL)                            \
  |  |  ------------------
  |  |  |  Branch (1054:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1055|      0|            goto err;                               \
  |  | 1056|      0|    }
  ------------------
 1094|    452|    COPY_UTF8_PARAM(params, OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT, gctx->pt_format);
  ------------------
  |  | 1048|    452|    p = OSSL_PARAM_locate_const(params, key);       \
  |  | 1049|    452|    if (p != NULL) {                                \
  |  |  ------------------
  |  |  |  Branch (1049:9): [True: 0, False: 452]
  |  |  ------------------
  |  | 1050|      0|        if (p->data_type != OSSL_PARAM_UTF8_STRING) \
  |  |  ------------------
  |  |  |  |  117|      0|#define OSSL_PARAM_UTF8_STRING 4
  |  |  ------------------
  |  |  |  Branch (1050:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1051|      0|            goto err;                               \
  |  | 1052|      0|        OPENSSL_free(val);                          \
  |  |  ------------------
  |  |  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1053|      0|        val = OPENSSL_strdup(p->data);              \
  |  |  ------------------
  |  |  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1054|      0|        if (val == NULL)                            \
  |  |  ------------------
  |  |  |  Branch (1054:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1055|      0|            goto err;                               \
  |  | 1056|      0|    }
  ------------------
 1095|    452|    COPY_UTF8_PARAM(params, OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE, gctx->group_check);
  ------------------
  |  | 1048|    452|    p = OSSL_PARAM_locate_const(params, key);       \
  |  | 1049|    452|    if (p != NULL) {                                \
  |  |  ------------------
  |  |  |  Branch (1049:9): [True: 0, False: 452]
  |  |  ------------------
  |  | 1050|      0|        if (p->data_type != OSSL_PARAM_UTF8_STRING) \
  |  |  ------------------
  |  |  |  |  117|      0|#define OSSL_PARAM_UTF8_STRING 4
  |  |  ------------------
  |  |  |  Branch (1050:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1051|      0|            goto err;                               \
  |  | 1052|      0|        OPENSSL_free(val);                          \
  |  |  ------------------
  |  |  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1053|      0|        val = OPENSSL_strdup(p->data);              \
  |  |  ------------------
  |  |  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1054|      0|        if (val == NULL)                            \
  |  |  ------------------
  |  |  |  Branch (1054:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1055|      0|            goto err;                               \
  |  | 1056|      0|    }
  ------------------
 1096|       |
 1097|    452|    COPY_BN_PARAM(params, OSSL_PKEY_PARAM_EC_P, gctx->p);
  ------------------
  |  | 1071|    452|    p = OSSL_PARAM_locate_const(params, key);         \
  |  | 1072|    452|    if (p != NULL) {                                  \
  |  |  ------------------
  |  |  |  Branch (1072:9): [True: 0, False: 452]
  |  |  ------------------
  |  | 1073|      0|        if (bn == NULL)                               \
  |  |  ------------------
  |  |  |  Branch (1073:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1074|      0|            bn = BN_new();                            \
  |  | 1075|      0|        if (bn == NULL || !OSSL_PARAM_get_BN(p, &bn)) \
  |  |  ------------------
  |  |  |  Branch (1075:13): [True: 0, False: 0]
  |  |  |  Branch (1075:27): [True: 0, False: 0]
  |  |  ------------------
  |  | 1076|      0|            goto err;                                 \
  |  | 1077|      0|    }
  ------------------
 1098|    452|    COPY_BN_PARAM(params, OSSL_PKEY_PARAM_EC_A, gctx->a);
  ------------------
  |  | 1071|    452|    p = OSSL_PARAM_locate_const(params, key);         \
  |  | 1072|    452|    if (p != NULL) {                                  \
  |  |  ------------------
  |  |  |  Branch (1072:9): [True: 0, False: 452]
  |  |  ------------------
  |  | 1073|      0|        if (bn == NULL)                               \
  |  |  ------------------
  |  |  |  Branch (1073:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1074|      0|            bn = BN_new();                            \
  |  | 1075|      0|        if (bn == NULL || !OSSL_PARAM_get_BN(p, &bn)) \
  |  |  ------------------
  |  |  |  Branch (1075:13): [True: 0, False: 0]
  |  |  |  Branch (1075:27): [True: 0, False: 0]
  |  |  ------------------
  |  | 1076|      0|            goto err;                                 \
  |  | 1077|      0|    }
  ------------------
 1099|    452|    COPY_BN_PARAM(params, OSSL_PKEY_PARAM_EC_B, gctx->b);
  ------------------
  |  | 1071|    452|    p = OSSL_PARAM_locate_const(params, key);         \
  |  | 1072|    452|    if (p != NULL) {                                  \
  |  |  ------------------
  |  |  |  Branch (1072:9): [True: 0, False: 452]
  |  |  ------------------
  |  | 1073|      0|        if (bn == NULL)                               \
  |  |  ------------------
  |  |  |  Branch (1073:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1074|      0|            bn = BN_new();                            \
  |  | 1075|      0|        if (bn == NULL || !OSSL_PARAM_get_BN(p, &bn)) \
  |  |  ------------------
  |  |  |  Branch (1075:13): [True: 0, False: 0]
  |  |  |  Branch (1075:27): [True: 0, False: 0]
  |  |  ------------------
  |  | 1076|      0|            goto err;                                 \
  |  | 1077|      0|    }
  ------------------
 1100|    452|    COPY_BN_PARAM(params, OSSL_PKEY_PARAM_EC_ORDER, gctx->order);
  ------------------
  |  | 1071|    452|    p = OSSL_PARAM_locate_const(params, key);         \
  |  | 1072|    452|    if (p != NULL) {                                  \
  |  |  ------------------
  |  |  |  Branch (1072:9): [True: 0, False: 452]
  |  |  ------------------
  |  | 1073|      0|        if (bn == NULL)                               \
  |  |  ------------------
  |  |  |  Branch (1073:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1074|      0|            bn = BN_new();                            \
  |  | 1075|      0|        if (bn == NULL || !OSSL_PARAM_get_BN(p, &bn)) \
  |  |  ------------------
  |  |  |  Branch (1075:13): [True: 0, False: 0]
  |  |  |  Branch (1075:27): [True: 0, False: 0]
  |  |  ------------------
  |  | 1076|      0|            goto err;                                 \
  |  | 1077|      0|    }
  ------------------
 1101|    452|    COPY_BN_PARAM(params, OSSL_PKEY_PARAM_EC_COFACTOR, gctx->cofactor);
  ------------------
  |  | 1071|    452|    p = OSSL_PARAM_locate_const(params, key);         \
  |  | 1072|    452|    if (p != NULL) {                                  \
  |  |  ------------------
  |  |  |  Branch (1072:9): [True: 0, False: 452]
  |  |  ------------------
  |  | 1073|      0|        if (bn == NULL)                               \
  |  |  ------------------
  |  |  |  Branch (1073:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1074|      0|            bn = BN_new();                            \
  |  | 1075|      0|        if (bn == NULL || !OSSL_PARAM_get_BN(p, &bn)) \
  |  |  ------------------
  |  |  |  Branch (1075:13): [True: 0, False: 0]
  |  |  |  Branch (1075:27): [True: 0, False: 0]
  |  |  ------------------
  |  | 1076|      0|            goto err;                                 \
  |  | 1077|      0|    }
  ------------------
 1102|       |
 1103|    452|    COPY_OCTET_PARAM(params, OSSL_PKEY_PARAM_EC_SEED, gctx->seed, gctx->seed_len);
  ------------------
  |  | 1059|    452|    p = OSSL_PARAM_locate_const(params, key);        \
  |  | 1060|    452|    if (p != NULL) {                                 \
  |  |  ------------------
  |  |  |  Branch (1060:9): [True: 0, False: 452]
  |  |  ------------------
  |  | 1061|      0|        if (p->data_type != OSSL_PARAM_OCTET_STRING) \
  |  |  ------------------
  |  |  |  |  123|      0|#define OSSL_PARAM_OCTET_STRING 5
  |  |  ------------------
  |  |  |  Branch (1061:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1062|      0|            goto err;                                \
  |  | 1063|      0|        OPENSSL_free(val);                           \
  |  |  ------------------
  |  |  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1064|      0|        len = p->data_size;                          \
  |  | 1065|      0|        val = OPENSSL_memdup(p->data, p->data_size); \
  |  |  ------------------
  |  |  |  |  133|      0|    CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                   CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1066|      0|        if (val == NULL)                             \
  |  |  ------------------
  |  |  |  Branch (1066:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1067|      0|            goto err;                                \
  |  | 1068|      0|    }
  ------------------
 1104|    452|    COPY_OCTET_PARAM(params, OSSL_PKEY_PARAM_EC_GENERATOR, gctx->gen,
  ------------------
  |  | 1059|    452|    p = OSSL_PARAM_locate_const(params, key);        \
  |  | 1060|    452|    if (p != NULL) {                                 \
  |  |  ------------------
  |  |  |  Branch (1060:9): [True: 0, False: 452]
  |  |  ------------------
  |  | 1061|      0|        if (p->data_type != OSSL_PARAM_OCTET_STRING) \
  |  |  ------------------
  |  |  |  |  123|      0|#define OSSL_PARAM_OCTET_STRING 5
  |  |  ------------------
  |  |  |  Branch (1061:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1062|      0|            goto err;                                \
  |  | 1063|      0|        OPENSSL_free(val);                           \
  |  |  ------------------
  |  |  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1064|      0|        len = p->data_size;                          \
  |  | 1065|      0|        val = OPENSSL_memdup(p->data, p->data_size); \
  |  |  ------------------
  |  |  |  |  133|      0|    CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                   CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1066|      0|        if (val == NULL)                             \
  |  |  ------------------
  |  |  |  Branch (1066:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1067|      0|            goto err;                                \
  |  | 1068|      0|    }
  ------------------
 1105|    452|        gctx->gen_len);
 1106|       |
 1107|    452|    COPY_OCTET_PARAM(params, OSSL_PKEY_PARAM_DHKEM_IKM, gctx->dhkem_ikm,
  ------------------
  |  | 1059|    452|    p = OSSL_PARAM_locate_const(params, key);        \
  |  | 1060|    452|    if (p != NULL) {                                 \
  |  |  ------------------
  |  |  |  Branch (1060:9): [True: 0, False: 452]
  |  |  ------------------
  |  | 1061|      0|        if (p->data_type != OSSL_PARAM_OCTET_STRING) \
  |  |  ------------------
  |  |  |  |  123|      0|#define OSSL_PARAM_OCTET_STRING 5
  |  |  ------------------
  |  |  |  Branch (1061:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1062|      0|            goto err;                                \
  |  | 1063|      0|        OPENSSL_free(val);                           \
  |  |  ------------------
  |  |  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1064|      0|        len = p->data_size;                          \
  |  | 1065|      0|        val = OPENSSL_memdup(p->data, p->data_size); \
  |  |  ------------------
  |  |  |  |  133|      0|    CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                   CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1066|      0|        if (val == NULL)                             \
  |  |  ------------------
  |  |  |  Branch (1066:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1067|      0|            goto err;                                \
  |  | 1068|      0|    }
  ------------------
 1108|    452|        gctx->dhkem_ikmlen);
 1109|       |
 1110|    452|    ret = 1;
 1111|    452|err:
 1112|    452|    return ret;
 1113|    452|}
ec_kmgmt.c:ec_gen:
 1251|    226|{
 1252|    226|    struct ec_gen_ctx *gctx = genctx;
 1253|    226|    EC_KEY *ec = NULL;
 1254|    226|    int ret = 0;
 1255|       |
 1256|    226|    if (!ossl_prov_is_running()
  ------------------
  |  Branch (1256:9): [True: 0, False: 226]
  ------------------
 1257|    226|        || gctx == NULL
  ------------------
  |  Branch (1257:12): [True: 0, False: 226]
  ------------------
 1258|    226|        || (ec = EC_KEY_new_ex(gctx->libctx, NULL)) == NULL)
  ------------------
  |  Branch (1258:12): [True: 0, False: 226]
  ------------------
 1259|      0|        return NULL;
 1260|       |
 1261|    226|    if (gctx->gen_group == NULL) {
  ------------------
  |  Branch (1261:9): [True: 226, False: 0]
  ------------------
 1262|    226|        if (!ec_gen_set_group_from_params(gctx))
  ------------------
  |  Branch (1262:13): [True: 0, False: 226]
  ------------------
 1263|      0|            goto err;
 1264|    226|    } else {
 1265|      0|        if (gctx->encoding != NULL) {
  ------------------
  |  Branch (1265:13): [True: 0, False: 0]
  ------------------
 1266|      0|            int flags = ossl_ec_encoding_name2id(gctx->encoding);
 1267|       |
 1268|      0|            if (flags < 0)
  ------------------
  |  Branch (1268:17): [True: 0, False: 0]
  ------------------
 1269|      0|                goto err;
 1270|      0|            EC_GROUP_set_asn1_flag(gctx->gen_group, flags);
 1271|      0|        }
 1272|      0|        if (gctx->pt_format != NULL) {
  ------------------
  |  Branch (1272:13): [True: 0, False: 0]
  ------------------
 1273|      0|            int format = ossl_ec_pt_format_name2id(gctx->pt_format);
 1274|       |
 1275|      0|            if (format < 0)
  ------------------
  |  Branch (1275:17): [True: 0, False: 0]
  ------------------
 1276|      0|                goto err;
 1277|      0|            EC_GROUP_set_point_conversion_form(gctx->gen_group, format);
 1278|      0|        }
 1279|      0|    }
 1280|       |#ifdef FIPS_MODULE
 1281|       |    if (!ossl_fips_ind_ec_key_check(OSSL_FIPS_IND_GET(gctx),
 1282|       |            OSSL_FIPS_IND_SETTABLE0, gctx->libctx,
 1283|       |            gctx->gen_group, "EC KeyGen", 1))
 1284|       |        goto err;
 1285|       |#endif
 1286|       |
 1287|       |    /* We must always assign a group, no matter what */
 1288|    226|    ret = ec_gen_assign_group(ec, gctx->gen_group);
 1289|       |
 1290|       |    /* Whether you want it or not, you get a keypair, not just one half */
 1291|    226|    if ((gctx->selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
  ------------------
  |  |  650|    226|    (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  640|    226|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  641|    226|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  |  |  ------------------
  ------------------
  |  Branch (1291:9): [True: 226, False: 0]
  ------------------
 1292|    226|#ifndef FIPS_MODULE
 1293|    226|        if (gctx->dhkem_ikm != NULL && gctx->dhkem_ikmlen != 0)
  ------------------
  |  Branch (1293:13): [True: 0, False: 226]
  |  Branch (1293:40): [True: 0, False: 0]
  ------------------
 1294|      0|            ret = ret && ossl_ec_generate_key_dhkem(ec, gctx->dhkem_ikm, gctx->dhkem_ikmlen);
  ------------------
  |  Branch (1294:19): [True: 0, False: 0]
  |  Branch (1294:26): [True: 0, False: 0]
  ------------------
 1295|    226|        else
 1296|    226|#endif
 1297|    226|            ret = ret && EC_KEY_generate_key(ec);
  ------------------
  |  Branch (1297:19): [True: 226, False: 0]
  |  Branch (1297:26): [True: 226, False: 0]
  ------------------
 1298|    226|    }
 1299|       |
 1300|    226|    if (gctx->ecdh_mode != -1)
  ------------------
  |  Branch (1300:9): [True: 226, False: 0]
  ------------------
 1301|    226|        ret = ret && ossl_ec_set_ecdh_cofactor_mode(ec, gctx->ecdh_mode);
  ------------------
  |  Branch (1301:15): [True: 226, False: 0]
  |  Branch (1301:22): [True: 226, False: 0]
  ------------------
 1302|       |
 1303|    226|    if (gctx->group_check != NULL)
  ------------------
  |  Branch (1303:9): [True: 0, False: 226]
  ------------------
 1304|      0|        ret = ret && ossl_ec_set_check_group_type_from_name(ec, gctx->group_check);
  ------------------
  |  Branch (1304:15): [True: 0, False: 0]
  |  Branch (1304:22): [True: 0, False: 0]
  ------------------
 1305|       |#ifdef FIPS_MODULE
 1306|       |    if (ret > 0
 1307|       |        && !ossl_fips_self_testing()
 1308|       |        && EC_KEY_get0_public_key(ec) != NULL
 1309|       |        && EC_KEY_get0_private_key(ec) != NULL
 1310|       |        && EC_KEY_get0_group(ec) != NULL) {
 1311|       |        BN_CTX *bnctx = BN_CTX_new_ex(ossl_ec_key_get_libctx(ec));
 1312|       |
 1313|       |        ret = bnctx != NULL && ossl_ec_key_pairwise_check(ec, bnctx);
 1314|       |        BN_CTX_free(bnctx);
 1315|       |        if (ret <= 0)
 1316|       |            ossl_set_error_state(OSSL_SELF_TEST_TYPE_PCT);
 1317|       |    }
 1318|       |#endif /* FIPS_MODULE */
 1319|       |
 1320|    226|    if (ret)
  ------------------
  |  Branch (1320:9): [True: 226, False: 0]
  ------------------
 1321|    226|        return ec;
 1322|      0|err:
 1323|       |    /* Something went wrong, throw the key away */
 1324|      0|    EC_KEY_free(ec);
 1325|       |    return NULL;
 1326|    226|}
ec_kmgmt.c:ec_gen_set_group_from_params:
 1116|    226|{
 1117|    226|    int ret = 0;
 1118|    226|    OSSL_PARAM_BLD *bld;
 1119|    226|    OSSL_PARAM *params = NULL;
 1120|    226|    EC_GROUP *group = NULL;
 1121|       |
 1122|    226|    bld = OSSL_PARAM_BLD_new();
 1123|    226|    if (bld == NULL)
  ------------------
  |  Branch (1123:9): [True: 0, False: 226]
  ------------------
 1124|      0|        return 0;
 1125|       |
 1126|    226|    if (gctx->encoding != NULL
  ------------------
  |  Branch (1126:9): [True: 0, False: 226]
  ------------------
 1127|      0|        && !OSSL_PARAM_BLD_push_utf8_string(bld, OSSL_PKEY_PARAM_EC_ENCODING,
  ------------------
  |  |  387|      0|# define OSSL_PKEY_PARAM_EC_ENCODING "encoding"
  ------------------
  |  Branch (1127:12): [True: 0, False: 0]
  ------------------
 1128|      0|            gctx->encoding, 0))
 1129|      0|        goto err;
 1130|       |
 1131|    226|    if (gctx->pt_format != NULL
  ------------------
  |  Branch (1131:9): [True: 0, False: 226]
  ------------------
 1132|      0|        && !OSSL_PARAM_BLD_push_utf8_string(bld,
  ------------------
  |  Branch (1132:12): [True: 0, False: 0]
  ------------------
 1133|      0|            OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT,
  ------------------
  |  |  394|      0|# define OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT "point-format"
  ------------------
 1134|      0|            gctx->pt_format, 0))
 1135|      0|        goto err;
 1136|       |
 1137|    226|    if (gctx->group_name != NULL) {
  ------------------
  |  Branch (1137:9): [True: 226, False: 0]
  ------------------
 1138|    226|        if (!OSSL_PARAM_BLD_push_utf8_string(bld, OSSL_PKEY_PARAM_GROUP_NAME,
  ------------------
  |  |  420|    226|# define OSSL_PKEY_PARAM_GROUP_NAME "group"
  ------------------
  |  Branch (1138:13): [True: 0, False: 226]
  ------------------
 1139|    226|                gctx->group_name, 0))
 1140|      0|            goto err;
 1141|       |        /* Ignore any other parameters if there is a group name */
 1142|    226|        goto build;
 1143|    226|    } else if (gctx->field_type != NULL) {
  ------------------
  |  Branch (1143:16): [True: 0, False: 0]
  ------------------
 1144|      0|        if (!OSSL_PARAM_BLD_push_utf8_string(bld, OSSL_PKEY_PARAM_EC_FIELD_TYPE,
  ------------------
  |  |  388|      0|# define OSSL_PKEY_PARAM_EC_FIELD_TYPE "field-type"
  ------------------
  |  Branch (1144:13): [True: 0, False: 0]
  ------------------
 1145|      0|                gctx->field_type, 0))
 1146|      0|            goto err;
 1147|      0|    } else {
 1148|      0|        goto err;
 1149|      0|    }
 1150|      0|    if (gctx->p == NULL
  ------------------
  |  Branch (1150:9): [True: 0, False: 0]
  ------------------
 1151|      0|        || gctx->a == NULL
  ------------------
  |  Branch (1151:12): [True: 0, False: 0]
  ------------------
 1152|      0|        || gctx->b == NULL
  ------------------
  |  Branch (1152:12): [True: 0, False: 0]
  ------------------
 1153|      0|        || gctx->order == NULL
  ------------------
  |  Branch (1153:12): [True: 0, False: 0]
  ------------------
 1154|      0|        || !OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_EC_P, gctx->p)
  ------------------
  |  |  393|      0|# define OSSL_PKEY_PARAM_EC_P "p"
  ------------------
  |  Branch (1154:12): [True: 0, False: 0]
  ------------------
 1155|      0|        || !OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_EC_A, gctx->a)
  ------------------
  |  |  377|      0|# define OSSL_PKEY_PARAM_EC_A "a"
  ------------------
  |  Branch (1155:12): [True: 0, False: 0]
  ------------------
 1156|      0|        || !OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_EC_B, gctx->b)
  ------------------
  |  |  378|      0|# define OSSL_PKEY_PARAM_EC_B "b"
  ------------------
  |  Branch (1156:12): [True: 0, False: 0]
  ------------------
 1157|      0|        || !OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_EC_ORDER, gctx->order))
  ------------------
  |  |  392|      0|# define OSSL_PKEY_PARAM_EC_ORDER "order"
  ------------------
  |  Branch (1157:12): [True: 0, False: 0]
  ------------------
 1158|      0|        goto err;
 1159|       |
 1160|      0|    if (gctx->cofactor != NULL
  ------------------
  |  Branch (1160:9): [True: 0, False: 0]
  ------------------
 1161|      0|        && !OSSL_PARAM_BLD_push_BN(bld, OSSL_PKEY_PARAM_EC_COFACTOR,
  ------------------
  |  |  385|      0|# define OSSL_PKEY_PARAM_EC_COFACTOR "cofactor"
  ------------------
  |  Branch (1161:12): [True: 0, False: 0]
  ------------------
 1162|      0|            gctx->cofactor))
 1163|      0|        goto err;
 1164|       |
 1165|      0|    if (gctx->seed != NULL
  ------------------
  |  Branch (1165:9): [True: 0, False: 0]
  ------------------
 1166|      0|        && !OSSL_PARAM_BLD_push_octet_string(bld, OSSL_PKEY_PARAM_EC_SEED,
  ------------------
  |  |  397|      0|# define OSSL_PKEY_PARAM_EC_SEED "seed"
  ------------------
  |  Branch (1166:12): [True: 0, False: 0]
  ------------------
 1167|      0|            gctx->seed, gctx->seed_len))
 1168|      0|        goto err;
 1169|       |
 1170|      0|    if (gctx->gen == NULL
  ------------------
  |  Branch (1170:9): [True: 0, False: 0]
  ------------------
 1171|      0|        || !OSSL_PARAM_BLD_push_octet_string(bld, OSSL_PKEY_PARAM_EC_GENERATOR,
  ------------------
  |  |  389|      0|# define OSSL_PKEY_PARAM_EC_GENERATOR "generator"
  ------------------
  |  Branch (1171:12): [True: 0, False: 0]
  ------------------
 1172|      0|            gctx->gen, gctx->gen_len))
 1173|      0|        goto err;
 1174|    226|build:
 1175|    226|    params = OSSL_PARAM_BLD_to_param(bld);
 1176|    226|    if (params == NULL)
  ------------------
  |  Branch (1176:9): [True: 0, False: 226]
  ------------------
 1177|      0|        goto err;
 1178|    226|    group = EC_GROUP_new_from_params(params, gctx->libctx, NULL);
 1179|    226|    if (group == NULL)
  ------------------
  |  Branch (1179:9): [True: 0, False: 226]
  ------------------
 1180|      0|        goto err;
 1181|       |
 1182|    226|    EC_GROUP_free(gctx->gen_group);
 1183|    226|    gctx->gen_group = group;
 1184|       |
 1185|    226|    ret = 1;
 1186|    226|err:
 1187|    226|    OSSL_PARAM_free(params);
 1188|    226|    OSSL_PARAM_BLD_free(bld);
 1189|    226|    return ret;
 1190|    226|}
ec_kmgmt.c:ec_gen_assign_group:
 1239|    226|{
 1240|    226|    if (group == NULL) {
  ------------------
  |  Branch (1240:9): [True: 0, False: 226]
  ------------------
 1241|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_NO_PARAMETERS_SET);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1242|      0|        return 0;
 1243|      0|    }
 1244|    226|    return EC_KEY_set_group(ec, group) > 0;
 1245|    226|}
ec_kmgmt.c:ec_gen_cleanup:
 1381|    226|{
 1382|    226|    struct ec_gen_ctx *gctx = genctx;
 1383|       |
 1384|    226|    if (gctx == NULL)
  ------------------
  |  Branch (1384:9): [True: 0, False: 226]
  ------------------
 1385|      0|        return;
 1386|       |
 1387|    226|    OPENSSL_clear_free(gctx->dhkem_ikm, gctx->dhkem_ikmlen);
  ------------------
  |  |  129|    226|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1388|    226|    EC_GROUP_free(gctx->gen_group);
 1389|    226|    BN_free(gctx->p);
 1390|    226|    BN_free(gctx->a);
 1391|    226|    BN_free(gctx->b);
 1392|    226|    BN_free(gctx->order);
 1393|    226|    BN_free(gctx->cofactor);
 1394|    226|    OPENSSL_free(gctx->group_name);
  ------------------
  |  |  131|    226|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1395|    226|    OPENSSL_free(gctx->field_type);
  ------------------
  |  |  131|    226|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1396|    226|    OPENSSL_free(gctx->pt_format);
  ------------------
  |  |  131|    226|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1397|    226|    OPENSSL_free(gctx->encoding);
  ------------------
  |  |  131|    226|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1398|    226|    OPENSSL_free(gctx->seed);
  ------------------
  |  |  131|    226|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1399|    226|    OPENSSL_free(gctx->gen);
  ------------------
  |  |  131|    226|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1400|    226|    OPENSSL_free(gctx);
  ------------------
  |  |  131|    226|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1401|    226|}
ec_kmgmt.c:ec_load:
 1423|   112k|{
 1424|   112k|    return common_load(reference, reference_sz, 0);
 1425|   112k|}
ec_kmgmt.c:common_load:
 1405|   112k|{
 1406|   112k|    EC_KEY *ec = NULL;
 1407|       |
 1408|   112k|    if (ossl_prov_is_running() && reference_sz == sizeof(ec)) {
  ------------------
  |  Branch (1408:9): [True: 112k, False: 0]
  |  Branch (1408:35): [True: 112k, False: 0]
  ------------------
 1409|       |        /* The contents of the reference is the address to our object */
 1410|   112k|        ec = *(EC_KEY **)reference;
 1411|       |
 1412|   112k|        if (!common_check_sm2(ec, sm2_wanted))
  ------------------
  |  Branch (1412:13): [True: 0, False: 112k]
  ------------------
 1413|      0|            return NULL;
 1414|       |
 1415|       |        /* We grabbed, so we detach it */
 1416|   112k|        *(EC_KEY **)reference = NULL;
 1417|   112k|        return ec;
 1418|   112k|    }
 1419|      0|    return NULL;
 1420|   112k|}
ec_kmgmt.c:common_check_sm2:
  372|   112k|{
  373|   112k|    const EC_GROUP *ecg = NULL;
  374|       |
  375|       |    /*
  376|       |     * sm2_wanted: import the keys or domparams only on SM2 Curve
  377|       |     * !sm2_wanted: import the keys or domparams only not on SM2 Curve
  378|       |     */
  379|   112k|    if ((ecg = EC_KEY_get0_group(ec)) == NULL
  ------------------
  |  Branch (379:9): [True: 0, False: 112k]
  ------------------
  380|   112k|        || (sm2_wanted ^ (EC_GROUP_get_curve_name(ecg) == NID_sm2)))
  ------------------
  |  | 1255|   112k|#define NID_sm2         1172
  ------------------
  |  Branch (380:12): [True: 0, False: 112k]
  ------------------
  381|      0|        return 0;
  382|   112k|    return 1;
  383|   112k|}
ec_kmgmt.c:ec_freedata:
  296|   113k|{
  297|   113k|    EC_KEY_free(keydata);
  298|   113k|}
ec_kmgmt.c:ec_get_params:
  753|   113k|{
  754|   113k|    return common_get_params(key, params, 0);
  755|   113k|}
ec_kmgmt.c:common_get_params:
  620|   113k|{
  621|   113k|    int ret = 0;
  622|   113k|    EC_KEY *eck = key;
  623|   113k|    const EC_GROUP *ecg = NULL;
  624|   113k|    OSSL_PARAM *p;
  625|   113k|    unsigned char *pub_key = NULL, *genbuf = NULL;
  626|   113k|    OSSL_LIB_CTX *libctx;
  627|   113k|    const char *propq;
  628|   113k|    BN_CTX *bnctx = NULL;
  629|       |
  630|   113k|    ecg = EC_KEY_get0_group(eck);
  631|   113k|    if (ecg == NULL) {
  ------------------
  |  Branch (631:9): [True: 0, False: 113k]
  ------------------
  632|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_NO_PARAMETERS_SET);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  633|      0|        return 0;
  634|      0|    }
  635|       |
  636|   113k|    libctx = ossl_ec_key_get_libctx(eck);
  637|   113k|    propq = ossl_ec_key_get0_propq(eck);
  638|       |
  639|   113k|    bnctx = BN_CTX_new_ex(libctx);
  640|   113k|    if (bnctx == NULL)
  ------------------
  |  Branch (640:9): [True: 0, False: 113k]
  ------------------
  641|      0|        return 0;
  642|   113k|    BN_CTX_start(bnctx);
  643|       |
  644|   113k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  424|   113k|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (644:9): [True: 113k, False: 452]
  ------------------
  645|   113k|        && !OSSL_PARAM_set_int(p, ECDSA_size(eck)))
  ------------------
  |  Branch (645:12): [True: 0, False: 113k]
  ------------------
  646|      0|        goto err;
  647|   113k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  366|   113k|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (647:9): [True: 113k, False: 452]
  ------------------
  648|   113k|        && !OSSL_PARAM_set_int(p, EC_GROUP_order_bits(ecg)))
  ------------------
  |  Branch (648:12): [True: 0, False: 113k]
  ------------------
  649|      0|        goto err;
  650|   113k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL) {
  ------------------
  |  |  495|   113k|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (650:9): [True: 113k, False: 452]
  ------------------
  651|   113k|        int ecbits, sec_bits;
  652|       |
  653|   113k|        ecbits = EC_GROUP_order_bits(ecg);
  654|       |
  655|       |        /*
  656|       |         * The following estimates are based on the values published
  657|       |         * in Table 2 of "NIST Special Publication 800-57 Part 1 Revision 4"
  658|       |         * at http://dx.doi.org/10.6028/NIST.SP.800-57pt1r4 .
  659|       |         *
  660|       |         * Note that the above reference explicitly categorizes algorithms in a
  661|       |         * discrete set of values {80, 112, 128, 192, 256}, and that it is
  662|       |         * relevant only for NIST approved Elliptic Curves, while OpenSSL
  663|       |         * applies the same logic also to other curves.
  664|       |         *
  665|       |         * Classifications produced by other standardazing bodies might differ,
  666|       |         * so the results provided for "bits of security" by this provider are
  667|       |         * to be considered merely indicative, and it is the users'
  668|       |         * responsibility to compare these values against the normative
  669|       |         * references that may be relevant for their intent and purposes.
  670|       |         */
  671|   113k|        if (ecbits >= 512)
  ------------------
  |  Branch (671:13): [True: 116, False: 113k]
  ------------------
  672|    116|            sec_bits = 256;
  673|   113k|        else if (ecbits >= 384)
  ------------------
  |  Branch (673:18): [True: 101k, False: 11.3k]
  ------------------
  674|   101k|            sec_bits = 192;
  675|  11.3k|        else if (ecbits >= 256)
  ------------------
  |  Branch (675:18): [True: 11.3k, False: 0]
  ------------------
  676|  11.3k|            sec_bits = 128;
  677|      0|        else if (ecbits >= 224)
  ------------------
  |  Branch (677:18): [True: 0, False: 0]
  ------------------
  678|      0|            sec_bits = 112;
  679|      0|        else if (ecbits >= 160)
  ------------------
  |  Branch (679:18): [True: 0, False: 0]
  ------------------
  680|      0|            sec_bits = 80;
  681|      0|        else
  682|      0|            sec_bits = ecbits / 2;
  683|       |
  684|   113k|        if (!OSSL_PARAM_set_int(p, sec_bits))
  ------------------
  |  Branch (684:13): [True: 0, False: 113k]
  ------------------
  685|      0|            goto err;
  686|   113k|    }
  687|   113k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_CATEGORY)) != NULL)
  ------------------
  |  |  496|   113k|# define OSSL_PKEY_PARAM_SECURITY_CATEGORY OSSL_ALG_PARAM_SECURITY_CATEGORY
  |  |  ------------------
  |  |  |  |  133|   113k|# define OSSL_ALG_PARAM_SECURITY_CATEGORY "security-category"
  |  |  ------------------
  ------------------
  |  Branch (687:9): [True: 113k, False: 452]
  ------------------
  688|   113k|        if (!OSSL_PARAM_set_int(p, 0))
  ------------------
  |  Branch (688:13): [True: 0, False: 113k]
  ------------------
  689|      0|            goto err;
  690|       |
  691|   113k|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (691:9): [True: 0, False: 113k]
  ------------------
  692|   113k|             OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS))
  ------------------
  |  |  386|   113k|# define OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS "decoded-from-explicit"
  ------------------
  693|   113k|        != NULL) {
  694|      0|        int explicitparams = EC_KEY_decoded_from_explicit_params(eck);
  695|       |
  696|      0|        if (explicitparams < 0
  ------------------
  |  Branch (696:13): [True: 0, False: 0]
  ------------------
  697|      0|            || !OSSL_PARAM_set_int(p, explicitparams))
  ------------------
  |  Branch (697:16): [True: 0, False: 0]
  ------------------
  698|      0|            goto err;
  699|      0|    }
  700|       |
  701|   113k|    if (!sm2) {
  ------------------
  |  Branch (701:9): [True: 113k, False: 0]
  ------------------
  702|   113k|        if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
  ------------------
  |  |  370|   113k|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  |  Branch (702:13): [True: 0, False: 113k]
  ------------------
  703|      0|            && !OSSL_PARAM_set_utf8_string(p, EC_DEFAULT_MD))
  ------------------
  |  |   77|      0|#define EC_DEFAULT_MD "SHA256"
  ------------------
  |  Branch (703:16): [True: 0, False: 0]
  ------------------
  704|      0|            goto err;
  705|   113k|    } else {
  706|      0|        if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
  ------------------
  |  |  370|      0|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  |  Branch (706:13): [True: 0, False: 0]
  ------------------
  707|      0|            && !OSSL_PARAM_set_utf8_string(p, SM2_DEFAULT_MD))
  ------------------
  |  |   80|      0|#define SM2_DEFAULT_MD "SM3"
  ------------------
  |  Branch (707:16): [True: 0, False: 0]
  ------------------
  708|      0|            goto err;
  709|      0|    }
  710|       |
  711|       |    /* SM2 doesn't support this PARAM */
  712|   113k|    if (!sm2) {
  ------------------
  |  Branch (712:9): [True: 113k, False: 0]
  ------------------
  713|   113k|        p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_USE_COFACTOR_ECDH);
  ------------------
  |  |  498|   113k|# define OSSL_PKEY_PARAM_USE_COFACTOR_ECDH OSSL_PKEY_PARAM_USE_COFACTOR_FLAG
  |  |  ------------------
  |  |  |  |  499|   113k|# define OSSL_PKEY_PARAM_USE_COFACTOR_FLAG "use-cofactor-flag"
  |  |  ------------------
  ------------------
  714|   113k|        if (p != NULL) {
  ------------------
  |  Branch (714:13): [True: 0, False: 113k]
  ------------------
  715|      0|            int ecdh_cofactor_mode = 0;
  716|       |
  717|      0|            ecdh_cofactor_mode = (EC_KEY_get_flags(eck) & EC_FLAG_COFACTOR_ECDH) ? 1 : 0;
  ------------------
  |  |  955|      0|#define EC_FLAG_COFACTOR_ECDH 0x1000
  ------------------
  |  Branch (717:34): [True: 0, False: 0]
  ------------------
  718|       |
  719|      0|            if (!OSSL_PARAM_set_int(p, ecdh_cofactor_mode))
  ------------------
  |  Branch (719:17): [True: 0, False: 0]
  ------------------
  720|      0|                goto err;
  721|      0|        }
  722|   113k|    }
  723|   113k|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (723:9): [True: 452, False: 113k]
  ------------------
  724|   113k|             OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY))
  ------------------
  |  |  398|   113k|# define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY "encoded-pub-key"
  ------------------
  725|   113k|        != NULL) {
  726|    452|        const EC_POINT *ecp = EC_KEY_get0_public_key(key);
  727|       |
  728|    452|        if (ecp == NULL) {
  ------------------
  |  Branch (728:13): [True: 0, False: 452]
  ------------------
  729|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_A_PUBLIC_KEY);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  730|      0|            goto err;
  731|      0|        }
  732|    452|        p->return_size = EC_POINT_point2oct(ecg, ecp,
  733|    452|            POINT_CONVERSION_UNCOMPRESSED,
  734|    452|            p->data, p->data_size, bnctx);
  735|    452|        if (p->return_size == 0)
  ------------------
  |  Branch (735:13): [True: 0, False: 452]
  ------------------
  736|      0|            goto err;
  737|    452|    }
  738|       |
  739|   113k|    ret = ec_get_ecm_params(ecg, params)
  ------------------
  |  Branch (739:11): [True: 113k, False: 0]
  ------------------
  740|   113k|        && ossl_ec_group_todata(ecg, NULL, params, libctx, propq, bnctx,
  ------------------
  |  Branch (740:12): [True: 113k, False: 0]
  ------------------
  741|   113k|            &genbuf)
  742|   113k|        && key_to_params(eck, NULL, params, 1, &pub_key)
  ------------------
  |  Branch (742:12): [True: 113k, False: 0]
  ------------------
  743|   113k|        && otherparams_to_params(eck, NULL, params);
  ------------------
  |  Branch (743:12): [True: 113k, False: 0]
  ------------------
  744|   113k|err:
  745|   113k|    OPENSSL_free(genbuf);
  ------------------
  |  |  131|   113k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  746|   113k|    OPENSSL_free(pub_key);
  ------------------
  |  |  131|   113k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  747|   113k|    BN_CTX_end(bnctx);
  748|   113k|    BN_CTX_free(bnctx);
  749|   113k|    return ret;
  750|   113k|}
ec_kmgmt.c:ec_get_ecm_params:
  569|   113k|{
  570|       |#ifdef OPENSSL_NO_EC2M
  571|       |    return 1;
  572|       |#else
  573|   113k|    int ret = 0, m;
  574|   113k|    unsigned int k1 = 0, k2 = 0, k3 = 0;
  575|   113k|    int basis_nid;
  576|   113k|    const char *basis_name = NULL;
  577|   113k|    int fid = EC_GROUP_get_field_type(group);
  578|       |
  579|   113k|    if (fid != NID_X9_62_characteristic_two_field)
  ------------------
  |  |  156|   113k|#define NID_X9_62_characteristic_two_field              407
  ------------------
  |  Branch (579:9): [True: 113k, False: 0]
  ------------------
  580|   113k|        return 1;
  581|       |
  582|      0|    basis_nid = EC_GROUP_get_basis_type(group);
  583|      0|    if (basis_nid == NID_X9_62_tpBasis)
  ------------------
  |  |  168|      0|#define NID_X9_62_tpBasis               682
  ------------------
  |  Branch (583:9): [True: 0, False: 0]
  ------------------
  584|      0|        basis_name = SN_X9_62_tpBasis;
  ------------------
  |  |  167|      0|#define SN_X9_62_tpBasis                "tpBasis"
  ------------------
  585|      0|    else if (basis_nid == NID_X9_62_ppBasis)
  ------------------
  |  |  172|      0|#define NID_X9_62_ppBasis               683
  ------------------
  |  Branch (585:14): [True: 0, False: 0]
  ------------------
  586|      0|        basis_name = SN_X9_62_ppBasis;
  ------------------
  |  |  171|      0|#define SN_X9_62_ppBasis                "ppBasis"
  ------------------
  587|      0|    else
  588|      0|        goto err;
  589|       |
  590|      0|    m = EC_GROUP_get_degree(group);
  591|      0|    if (!ossl_param_build_set_int(NULL, params, OSSL_PKEY_PARAM_EC_CHAR2_M, m)
  ------------------
  |  |  379|      0|# define OSSL_PKEY_PARAM_EC_CHAR2_M "m"
  ------------------
  |  Branch (591:9): [True: 0, False: 0]
  ------------------
  592|      0|        || !ossl_param_build_set_utf8_string(NULL, params,
  ------------------
  |  Branch (592:12): [True: 0, False: 0]
  ------------------
  593|      0|            OSSL_PKEY_PARAM_EC_CHAR2_TYPE,
  ------------------
  |  |  384|      0|# define OSSL_PKEY_PARAM_EC_CHAR2_TYPE "basis-type"
  ------------------
  594|      0|            basis_name))
  595|      0|        goto err;
  596|       |
  597|      0|    if (basis_nid == NID_X9_62_tpBasis) {
  ------------------
  |  |  168|      0|#define NID_X9_62_tpBasis               682
  ------------------
  |  Branch (597:9): [True: 0, False: 0]
  ------------------
  598|      0|        if (!EC_GROUP_get_trinomial_basis(group, &k1)
  ------------------
  |  Branch (598:13): [True: 0, False: 0]
  ------------------
  599|      0|            || !ossl_param_build_set_int(NULL, params,
  ------------------
  |  Branch (599:16): [True: 0, False: 0]
  ------------------
  600|      0|                OSSL_PKEY_PARAM_EC_CHAR2_TP_BASIS,
  ------------------
  |  |  383|      0|# define OSSL_PKEY_PARAM_EC_CHAR2_TP_BASIS "tp"
  ------------------
  601|      0|                (int)k1))
  602|      0|            goto err;
  603|      0|    } else {
  604|      0|        if (!EC_GROUP_get_pentanomial_basis(group, &k1, &k2, &k3)
  ------------------
  |  Branch (604:13): [True: 0, False: 0]
  ------------------
  605|      0|            || !ossl_param_build_set_int(NULL, params,
  ------------------
  |  Branch (605:16): [True: 0, False: 0]
  ------------------
  606|      0|                OSSL_PKEY_PARAM_EC_CHAR2_PP_K1, (int)k1)
  ------------------
  |  |  380|      0|# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K1 "k1"
  ------------------
  607|      0|            || !ossl_param_build_set_int(NULL, params,
  ------------------
  |  Branch (607:16): [True: 0, False: 0]
  ------------------
  608|      0|                OSSL_PKEY_PARAM_EC_CHAR2_PP_K2, (int)k2)
  ------------------
  |  |  381|      0|# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K2 "k2"
  ------------------
  609|      0|            || !ossl_param_build_set_int(NULL, params,
  ------------------
  |  Branch (609:16): [True: 0, False: 0]
  ------------------
  610|      0|                OSSL_PKEY_PARAM_EC_CHAR2_PP_K3, (int)k3))
  ------------------
  |  |  382|      0|# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K3 "k3"
  ------------------
  611|      0|            goto err;
  612|      0|    }
  613|      0|    ret = 1;
  614|      0|err:
  615|      0|    return ret;
  616|      0|#endif /* OPENSSL_NO_EC2M */
  617|      0|}
ec_kmgmt.c:key_to_params:
  116|   113k|{
  117|   113k|    BIGNUM *x = NULL, *y = NULL;
  118|   113k|    const BIGNUM *priv_key = NULL;
  119|   113k|    const EC_POINT *pub_point = NULL;
  120|   113k|    const EC_GROUP *ecg = NULL;
  121|   113k|    size_t pub_key_len = 0;
  122|   113k|    int ret = 0;
  123|   113k|    BN_CTX *bnctx = NULL;
  124|       |
  125|   113k|    if (eckey == NULL
  ------------------
  |  Branch (125:9): [True: 0, False: 113k]
  ------------------
  126|   113k|        || (ecg = EC_KEY_get0_group(eckey)) == NULL)
  ------------------
  |  Branch (126:12): [True: 0, False: 113k]
  ------------------
  127|      0|        return 0;
  128|       |
  129|   113k|    priv_key = EC_KEY_get0_private_key(eckey);
  130|   113k|    pub_point = EC_KEY_get0_public_key(eckey);
  131|       |
  132|   113k|    if (pub_point != NULL) {
  ------------------
  |  Branch (132:9): [True: 113k, False: 0]
  ------------------
  133|   113k|        OSSL_PARAM *p = NULL, *px = NULL, *py = NULL;
  134|       |        /*
  135|       |         * EC_POINT_point2buf() can generate random numbers in some
  136|       |         * implementations so we need to ensure we use the correct libctx.
  137|       |         */
  138|   113k|        bnctx = BN_CTX_new_ex(ossl_ec_key_get_libctx(eckey));
  139|   113k|        if (bnctx == NULL)
  ------------------
  |  Branch (139:13): [True: 0, False: 113k]
  ------------------
  140|      0|            goto err;
  141|       |
  142|       |        /* If we are doing a get then check first before decoding the point */
  143|   113k|        if (tmpl == NULL) {
  ------------------
  |  Branch (143:13): [True: 113k, False: 0]
  ------------------
  144|   113k|            p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_PUB_KEY);
  ------------------
  |  |  441|   113k|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  145|   113k|            px = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_EC_PUB_X);
  ------------------
  |  |  395|   113k|# define OSSL_PKEY_PARAM_EC_PUB_X "qx"
  ------------------
  146|   113k|            py = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_EC_PUB_Y);
  ------------------
  |  |  396|   113k|# define OSSL_PKEY_PARAM_EC_PUB_Y "qy"
  ------------------
  147|   113k|        }
  148|       |
  149|   113k|        if (p != NULL || tmpl != NULL) {
  ------------------
  |  Branch (149:13): [True: 0, False: 113k]
  |  Branch (149:26): [True: 0, False: 113k]
  ------------------
  150|       |            /* convert pub_point to a octet string according to the SECG standard */
  151|      0|            point_conversion_form_t format = EC_KEY_get_conv_form(eckey);
  152|       |
  153|      0|            if ((pub_key_len = EC_POINT_point2buf(ecg, pub_point,
  ------------------
  |  Branch (153:17): [True: 0, False: 0]
  ------------------
  154|      0|                     format,
  155|      0|                     pub_key, bnctx))
  156|      0|                    == 0
  157|      0|                || !ossl_param_build_set_octet_string(tmpl, p,
  ------------------
  |  Branch (157:20): [True: 0, False: 0]
  ------------------
  158|      0|                    OSSL_PKEY_PARAM_PUB_KEY,
  ------------------
  |  |  441|      0|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  159|      0|                    *pub_key, pub_key_len))
  160|      0|                goto err;
  161|      0|        }
  162|   113k|        if (px != NULL || py != NULL) {
  ------------------
  |  Branch (162:13): [True: 0, False: 113k]
  |  Branch (162:27): [True: 0, False: 113k]
  ------------------
  163|      0|            if (px != NULL) {
  ------------------
  |  Branch (163:17): [True: 0, False: 0]
  ------------------
  164|      0|                x = BN_CTX_get(bnctx);
  165|      0|                if (x == NULL)
  ------------------
  |  Branch (165:21): [True: 0, False: 0]
  ------------------
  166|      0|                    goto err;
  167|      0|            }
  168|      0|            if (py != NULL) {
  ------------------
  |  Branch (168:17): [True: 0, False: 0]
  ------------------
  169|      0|                y = BN_CTX_get(bnctx);
  170|      0|                if (y == NULL)
  ------------------
  |  Branch (170:21): [True: 0, False: 0]
  ------------------
  171|      0|                    goto err;
  172|      0|            }
  173|       |
  174|      0|            if (!EC_POINT_get_affine_coordinates(ecg, pub_point, x, y, bnctx))
  ------------------
  |  Branch (174:17): [True: 0, False: 0]
  ------------------
  175|      0|                goto err;
  176|      0|            if (px != NULL
  ------------------
  |  Branch (176:17): [True: 0, False: 0]
  ------------------
  177|      0|                && !ossl_param_build_set_bn(tmpl, px,
  ------------------
  |  Branch (177:20): [True: 0, False: 0]
  ------------------
  178|      0|                    OSSL_PKEY_PARAM_EC_PUB_X, x))
  ------------------
  |  |  395|      0|# define OSSL_PKEY_PARAM_EC_PUB_X "qx"
  ------------------
  179|      0|                goto err;
  180|      0|            if (py != NULL
  ------------------
  |  Branch (180:17): [True: 0, False: 0]
  ------------------
  181|      0|                && !ossl_param_build_set_bn(tmpl, py,
  ------------------
  |  Branch (181:20): [True: 0, False: 0]
  ------------------
  182|      0|                    OSSL_PKEY_PARAM_EC_PUB_Y, y))
  ------------------
  |  |  396|      0|# define OSSL_PKEY_PARAM_EC_PUB_Y "qy"
  ------------------
  183|      0|                goto err;
  184|      0|        }
  185|   113k|    }
  186|       |
  187|   113k|    if (priv_key != NULL && include_private) {
  ------------------
  |  Branch (187:9): [True: 678, False: 112k]
  |  Branch (187:29): [True: 678, False: 0]
  ------------------
  188|    678|        size_t sz;
  189|    678|        int ecbits;
  190|       |
  191|       |        /*
  192|       |         * Key import/export should never leak the bit length of the secret
  193|       |         * scalar in the key.
  194|       |         *
  195|       |         * For this reason, on export we use padded BIGNUMs with fixed length.
  196|       |         *
  197|       |         * When importing we also should make sure that, even if short lived,
  198|       |         * the newly created BIGNUM is marked with the BN_FLG_CONSTTIME flag as
  199|       |         * soon as possible, so that any processing of this BIGNUM might opt for
  200|       |         * constant time implementations in the backend.
  201|       |         *
  202|       |         * Setting the BN_FLG_CONSTTIME flag alone is never enough, we also have
  203|       |         * to preallocate the BIGNUM internal buffer to a fixed public size big
  204|       |         * enough that operations performed during the processing never trigger
  205|       |         * a realloc which would leak the size of the scalar through memory
  206|       |         * accesses.
  207|       |         *
  208|       |         * Fixed Length
  209|       |         * ------------
  210|       |         *
  211|       |         * The order of the large prime subgroup of the curve is our choice for
  212|       |         * a fixed public size, as that is generally the upper bound for
  213|       |         * generating a private key in EC cryptosystems and should fit all valid
  214|       |         * secret scalars.
  215|       |         *
  216|       |         * For padding on export we just use the bit length of the order
  217|       |         * converted to bytes (rounding up).
  218|       |         *
  219|       |         * For preallocating the BIGNUM storage we look at the number of "words"
  220|       |         * required for the internal representation of the order, and we
  221|       |         * preallocate 2 extra "words" in case any of the subsequent processing
  222|       |         * might temporarily overflow the order length.
  223|       |         */
  224|    678|        ecbits = EC_GROUP_order_bits(ecg);
  225|    678|        if (ecbits <= 0)
  ------------------
  |  Branch (225:13): [True: 0, False: 678]
  ------------------
  226|      0|            goto err;
  227|    678|        sz = (ecbits + 7) / 8;
  228|       |
  229|    678|        if (!ossl_param_build_set_bn_pad(tmpl, params,
  ------------------
  |  Branch (229:13): [True: 0, False: 678]
  ------------------
  230|    678|                OSSL_PKEY_PARAM_PRIV_KEY,
  ------------------
  |  |  439|    678|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  231|    678|                priv_key, sz))
  232|      0|            goto err;
  233|    678|    }
  234|   113k|    ret = 1;
  235|   113k|err:
  236|   113k|    BN_CTX_free(bnctx);
  237|   113k|    return ret;
  238|   113k|}
ec_kmgmt.c:otherparams_to_params:
  242|   113k|{
  243|   113k|    int ecdh_cofactor_mode = 0, group_check = 0;
  244|   113k|    const char *name = NULL;
  245|   113k|    point_conversion_form_t format;
  246|       |
  247|   113k|    if (ec == NULL)
  ------------------
  |  Branch (247:9): [True: 0, False: 113k]
  ------------------
  248|      0|        return 0;
  249|       |
  250|   113k|    format = EC_KEY_get_conv_form(ec);
  251|   113k|    name = ossl_ec_pt_format_id2name((int)format);
  252|   113k|    if (name != NULL
  ------------------
  |  Branch (252:9): [True: 113k, False: 0]
  ------------------
  253|   113k|        && !ossl_param_build_set_utf8_string(tmpl, params,
  ------------------
  |  Branch (253:12): [True: 0, False: 113k]
  ------------------
  254|   113k|            OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT,
  ------------------
  |  |  394|   113k|# define OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT "point-format"
  ------------------
  255|   113k|            name))
  256|      0|        return 0;
  257|       |
  258|   113k|    group_check = EC_KEY_get_flags(ec) & EC_FLAG_CHECK_NAMED_GROUP_MASK;
  ------------------
  |  |  959|   113k|    (EC_FLAG_CHECK_NAMED_GROUP | EC_FLAG_CHECK_NAMED_GROUP_NIST)
  |  |  ------------------
  |  |  |  |  956|   113k|#define EC_FLAG_CHECK_NAMED_GROUP 0x2000
  |  |  ------------------
  |  |                   (EC_FLAG_CHECK_NAMED_GROUP | EC_FLAG_CHECK_NAMED_GROUP_NIST)
  |  |  ------------------
  |  |  |  |  957|   113k|#define EC_FLAG_CHECK_NAMED_GROUP_NIST 0x4000
  |  |  ------------------
  ------------------
  259|   113k|    name = ossl_ec_check_group_type_id2name(group_check);
  260|   113k|    if (name != NULL
  ------------------
  |  Branch (260:9): [True: 113k, False: 0]
  ------------------
  261|   113k|        && !ossl_param_build_set_utf8_string(tmpl, params,
  ------------------
  |  Branch (261:12): [True: 0, False: 113k]
  ------------------
  262|   113k|            OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE,
  ------------------
  |  |  390|   113k|# define OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE "group-check"
  ------------------
  263|   113k|            name))
  264|      0|        return 0;
  265|       |
  266|   113k|    if ((EC_KEY_get_enc_flags(ec) & EC_PKEY_NO_PUBKEY) != 0
  ------------------
  |  |  951|   113k|#define EC_PKEY_NO_PUBKEY 0x002
  ------------------
  |  Branch (266:9): [True: 0, False: 113k]
  ------------------
  267|      0|        && !ossl_param_build_set_int(tmpl, params,
  ------------------
  |  Branch (267:12): [True: 0, False: 0]
  ------------------
  268|      0|            OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC, 0))
  ------------------
  |  |  391|      0|# define OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC "include-public"
  ------------------
  269|      0|        return 0;
  270|       |
  271|   113k|    ecdh_cofactor_mode = (EC_KEY_get_flags(ec) & EC_FLAG_COFACTOR_ECDH) ? 1 : 0;
  ------------------
  |  |  955|   113k|#define EC_FLAG_COFACTOR_ECDH 0x1000
  ------------------
  |  Branch (271:26): [True: 0, False: 113k]
  ------------------
  272|   113k|    return ossl_param_build_set_int(tmpl, params,
  273|   113k|        OSSL_PKEY_PARAM_USE_COFACTOR_ECDH,
  ------------------
  |  |  498|   113k|# define OSSL_PKEY_PARAM_USE_COFACTOR_ECDH OSSL_PKEY_PARAM_USE_COFACTOR_FLAG
  |  |  ------------------
  |  |  |  |  499|   113k|# define OSSL_PKEY_PARAM_USE_COFACTOR_FLAG "use-cofactor-flag"
  |  |  ------------------
  ------------------
  274|   113k|        ecdh_cofactor_mode);
  275|   113k|}

ecx_kmgmt.c:x25519_get_params:
  803|  5.28k|{
  804|  5.28k|    return ecx_get_params(key, params, X25519_BITS, X25519_SECURITY_BITS,
  ------------------
  |  |   33|  5.28k|#define X25519_BITS 253
  ------------------
                  return ecx_get_params(key, params, X25519_BITS, X25519_SECURITY_BITS,
  ------------------
  |  |   34|  5.28k|#define X25519_SECURITY_BITS 128
  ------------------
  805|  5.28k|        X25519_KEYLEN);
  ------------------
  |  |   26|  5.28k|#define X25519_KEYLEN 32
  ------------------
  806|  5.28k|}
ecx_kmgmt.c:ecx_get_params:
  766|  5.29k|{
  767|  5.29k|    ECX_KEY *ecx = key;
  768|  5.29k|    struct ecx_ed_common_get_params_st p;
  769|       |
  770|  5.29k|    if (key == NULL || !ecx_get_params_decoder(params, &p))
  ------------------
  |  Branch (770:9): [True: 0, False: 5.29k]
  |  Branch (770:24): [True: 0, False: 5.29k]
  ------------------
  771|      0|        return 0;
  772|       |
  773|  5.29k|    if (p.encpub != NULL
  ------------------
  |  Branch (773:9): [True: 2.64k, False: 2.64k]
  ------------------
  774|  2.64k|        && !OSSL_PARAM_set_octet_string(p.encpub, ecx->pubkey, ecx->keylen))
  ------------------
  |  Branch (774:12): [True: 0, False: 2.64k]
  ------------------
  775|      0|        return 0;
  776|       |#ifdef FIPS_MODULE
  777|       |    {
  778|       |        /* Currently X25519 and X448 are not approved */
  779|       |        int approved = 0;
  780|       |
  781|       |        if (p.ind != NULL && !OSSL_PARAM_set_int(p.ind, approved))
  782|       |            return 0;
  783|       |    }
  784|       |#endif
  785|       |
  786|  5.29k|    return ecx_ed_common_get_params(key, &p, bits, secbits, size);
  787|  5.29k|}
ecx_kmgmt.c:ecx_get_params_decoder:
  406|  5.29k|{
  407|  5.29k|    const char *s;
  408|       |
  409|  5.29k|    memset(r, 0, sizeof(*r));
  410|  5.29k|    if (p != NULL)
  ------------------
  |  Branch (410:9): [True: 5.29k, False: 0]
  ------------------
  411|  18.5k|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (411:16): [True: 13.2k, False: 5.29k]
  ------------------
  412|  13.2k|            switch(s[0]) {
  413|      0|            default:
  ------------------
  |  Branch (413:13): [True: 0, False: 13.2k]
  ------------------
  414|      0|                break;
  415|  2.64k|            case 'b':
  ------------------
  |  Branch (415:13): [True: 2.64k, False: 10.5k]
  ------------------
  416|  2.64k|                if (ossl_likely(strcmp("its", s + 1) == 0)) {
  ------------------
  |  |   22|  2.64k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 2.64k, False: 0]
  |  |  ------------------
  ------------------
  417|       |                    /* OSSL_PKEY_PARAM_BITS */
  418|  2.64k|                    if (ossl_unlikely(r->bits != NULL)) {
  ------------------
  |  |   23|  2.64k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 2.64k]
  |  |  ------------------
  ------------------
  419|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  420|      0|                                       "param %s is repeated", s);
  421|      0|                        return 0;
  422|      0|                    }
  423|  2.64k|                    r->bits = (OSSL_PARAM *)p;
  424|  2.64k|                }
  425|  2.64k|                break;
  426|  2.64k|            case 'e':
  ------------------
  |  Branch (426:13): [True: 2.64k, False: 10.5k]
  ------------------
  427|  2.64k|                if (ossl_likely(strcmp("ncoded-pub-key", s + 1) == 0)) {
  ------------------
  |  |   22|  2.64k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 2.64k, False: 0]
  |  |  ------------------
  ------------------
  428|       |                    /* OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY */
  429|  2.64k|                    if (ossl_unlikely(r->encpub != NULL)) {
  ------------------
  |  |   23|  2.64k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 2.64k]
  |  |  ------------------
  ------------------
  430|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  431|      0|                                       "param %s is repeated", s);
  432|      0|                        return 0;
  433|      0|                    }
  434|  2.64k|                    r->encpub = (OSSL_PARAM *)p;
  435|  2.64k|                }
  436|  2.64k|                break;
  437|  2.64k|            case 'f':
  ------------------
  |  Branch (437:13): [True: 0, False: 13.2k]
  ------------------
  438|       |# if defined(FIPS_MODULE)
  439|       |                if (ossl_likely(strcmp("ips-indicator", s + 1) == 0)) {
  440|       |                    /* OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR */
  441|       |                    if (ossl_unlikely(r->ind != NULL)) {
  442|       |                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  443|       |                                       "param %s is repeated", s);
  444|       |                        return 0;
  445|       |                    }
  446|       |                    r->ind = (OSSL_PARAM *)p;
  447|       |                }
  448|       |# endif
  449|      0|                break;
  450|  2.64k|            case 'm':
  ------------------
  |  Branch (450:13): [True: 2.64k, False: 10.5k]
  ------------------
  451|  2.64k|                if (ossl_likely(strcmp("ax-size", s + 1) == 0)) {
  ------------------
  |  |   22|  2.64k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 2.64k, False: 0]
  |  |  ------------------
  ------------------
  452|       |                    /* OSSL_PKEY_PARAM_MAX_SIZE */
  453|  2.64k|                    if (ossl_unlikely(r->size != NULL)) {
  ------------------
  |  |   23|  2.64k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 2.64k]
  |  |  ------------------
  ------------------
  454|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  455|      0|                                       "param %s is repeated", s);
  456|      0|                        return 0;
  457|      0|                    }
  458|  2.64k|                    r->size = (OSSL_PARAM *)p;
  459|  2.64k|                }
  460|  2.64k|                break;
  461|  2.64k|            case 'p':
  ------------------
  |  Branch (461:13): [True: 0, False: 13.2k]
  ------------------
  462|      0|                switch(s[1]) {
  463|      0|                default:
  ------------------
  |  Branch (463:17): [True: 0, False: 0]
  ------------------
  464|      0|                    break;
  465|      0|                case 'r':
  ------------------
  |  Branch (465:17): [True: 0, False: 0]
  ------------------
  466|      0|                    if (ossl_likely(strcmp("iv", s + 2) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  467|       |                        /* OSSL_PKEY_PARAM_PRIV_KEY */
  468|      0|                        if (ossl_unlikely(r->priv != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  469|      0|                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  470|      0|                                           "param %s is repeated", s);
  471|      0|                            return 0;
  472|      0|                        }
  473|      0|                        r->priv = (OSSL_PARAM *)p;
  474|      0|                    }
  475|      0|                    break;
  476|      0|                case 'u':
  ------------------
  |  Branch (476:17): [True: 0, False: 0]
  ------------------
  477|      0|                    if (ossl_likely(strcmp("b", s + 2) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  478|       |                        /* OSSL_PKEY_PARAM_PUB_KEY */
  479|      0|                        if (ossl_unlikely(r->pub != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  480|      0|                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  481|      0|                                           "param %s is repeated", s);
  482|      0|                            return 0;
  483|      0|                        }
  484|      0|                        r->pub = (OSSL_PARAM *)p;
  485|      0|                    }
  486|      0|                }
  487|      0|                break;
  488|  5.29k|            case 's':
  ------------------
  |  Branch (488:13): [True: 5.29k, False: 7.94k]
  ------------------
  489|  5.29k|                switch(s[1]) {
  490|      0|                default:
  ------------------
  |  Branch (490:17): [True: 0, False: 5.29k]
  ------------------
  491|      0|                    break;
  492|  5.29k|                case 'e':
  ------------------
  |  Branch (492:17): [True: 5.29k, False: 0]
  ------------------
  493|  5.29k|                    switch(s[2]) {
  494|      0|                    default:
  ------------------
  |  Branch (494:21): [True: 0, False: 5.29k]
  ------------------
  495|      0|                        break;
  496|  5.29k|                    case 'c':
  ------------------
  |  Branch (496:21): [True: 5.29k, False: 0]
  ------------------
  497|  5.29k|                        switch(s[3]) {
  498|      0|                        default:
  ------------------
  |  Branch (498:25): [True: 0, False: 5.29k]
  ------------------
  499|      0|                            break;
  500|  5.29k|                        case 'u':
  ------------------
  |  Branch (500:25): [True: 5.29k, False: 0]
  ------------------
  501|  5.29k|                            switch(s[4]) {
  502|      0|                            default:
  ------------------
  |  Branch (502:29): [True: 0, False: 5.29k]
  ------------------
  503|      0|                                break;
  504|  5.29k|                            case 'r':
  ------------------
  |  Branch (504:29): [True: 5.29k, False: 0]
  ------------------
  505|  5.29k|                                switch(s[5]) {
  506|      0|                                default:
  ------------------
  |  Branch (506:33): [True: 0, False: 5.29k]
  ------------------
  507|      0|                                    break;
  508|  5.29k|                                case 'i':
  ------------------
  |  Branch (508:33): [True: 5.29k, False: 0]
  ------------------
  509|  5.29k|                                    switch(s[6]) {
  510|      0|                                    default:
  ------------------
  |  Branch (510:37): [True: 0, False: 5.29k]
  ------------------
  511|      0|                                        break;
  512|  5.29k|                                    case 't':
  ------------------
  |  Branch (512:37): [True: 5.29k, False: 0]
  ------------------
  513|  5.29k|                                        switch(s[7]) {
  514|      0|                                        default:
  ------------------
  |  Branch (514:41): [True: 0, False: 5.29k]
  ------------------
  515|      0|                                            break;
  516|  5.29k|                                        case 'y':
  ------------------
  |  Branch (516:41): [True: 5.29k, False: 0]
  ------------------
  517|  5.29k|                                            switch(s[8]) {
  518|      0|                                            default:
  ------------------
  |  Branch (518:45): [True: 0, False: 5.29k]
  ------------------
  519|      0|                                                break;
  520|  5.29k|                                            case '-':
  ------------------
  |  Branch (520:45): [True: 5.29k, False: 0]
  ------------------
  521|  5.29k|                                                switch(s[9]) {
  522|      0|                                                default:
  ------------------
  |  Branch (522:49): [True: 0, False: 5.29k]
  ------------------
  523|      0|                                                    break;
  524|  2.64k|                                                case 'b':
  ------------------
  |  Branch (524:49): [True: 2.64k, False: 2.64k]
  ------------------
  525|  2.64k|                                                    if (ossl_likely(strcmp("its", s + 10) == 0)) {
  ------------------
  |  |   22|  2.64k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 2.64k, False: 0]
  |  |  ------------------
  ------------------
  526|       |                                                        /* OSSL_PKEY_PARAM_SECURITY_BITS */
  527|  2.64k|                                                        if (ossl_unlikely(r->secbits != NULL)) {
  ------------------
  |  |   23|  2.64k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 2.64k]
  |  |  ------------------
  ------------------
  528|      0|                                                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  529|      0|                                                                           "param %s is repeated", s);
  530|      0|                                                            return 0;
  531|      0|                                                        }
  532|  2.64k|                                                        r->secbits = (OSSL_PARAM *)p;
  533|  2.64k|                                                    }
  534|  2.64k|                                                    break;
  535|  2.64k|                                                case 'c':
  ------------------
  |  Branch (535:49): [True: 2.64k, False: 2.64k]
  ------------------
  536|  2.64k|                                                    if (ossl_likely(strcmp("ategory", s + 10) == 0)) {
  ------------------
  |  |   22|  2.64k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 2.64k, False: 0]
  |  |  ------------------
  ------------------
  537|       |                                                        /* OSSL_PKEY_PARAM_SECURITY_CATEGORY */
  538|  2.64k|                                                        if (ossl_unlikely(r->seccat != NULL)) {
  ------------------
  |  |   23|  2.64k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 2.64k]
  |  |  ------------------
  ------------------
  539|      0|                                                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  540|      0|                                                                           "param %s is repeated", s);
  541|      0|                                                            return 0;
  542|      0|                                                        }
  543|  2.64k|                                                        r->seccat = (OSSL_PARAM *)p;
  544|  2.64k|                                                    }
  545|  5.29k|                                                }
  546|  5.29k|                                            }
  547|  5.29k|                                        }
  548|  5.29k|                                    }
  549|  5.29k|                                }
  550|  5.29k|                            }
  551|  5.29k|                        }
  552|  5.29k|                    }
  553|  5.29k|                }
  554|  13.2k|            }
  555|  5.29k|    return 1;
  556|  5.29k|}
ecx_kmgmt.c:ecx_ed_common_get_params:
  749|  5.29k|{
  750|  5.29k|    ECX_KEY *ecx = key;
  751|       |
  752|  5.29k|    if (p->bits != NULL && !OSSL_PARAM_set_int(p->bits, bits))
  ------------------
  |  Branch (752:9): [True: 2.64k, False: 2.64k]
  |  Branch (752:28): [True: 0, False: 2.64k]
  ------------------
  753|      0|        return 0;
  754|  5.29k|    if (p->secbits != NULL && !OSSL_PARAM_set_int(p->secbits, secbits))
  ------------------
  |  Branch (754:9): [True: 2.64k, False: 2.64k]
  |  Branch (754:31): [True: 0, False: 2.64k]
  ------------------
  755|      0|        return 0;
  756|  5.29k|    if (p->size != NULL && !OSSL_PARAM_set_int(p->size, size))
  ------------------
  |  Branch (756:9): [True: 2.64k, False: 2.64k]
  |  Branch (756:28): [True: 0, False: 2.64k]
  ------------------
  757|      0|        return 0;
  758|  5.29k|    if (p->seccat != NULL && !OSSL_PARAM_set_int(p->seccat, 0))
  ------------------
  |  Branch (758:9): [True: 2.64k, False: 2.64k]
  |  Branch (758:30): [True: 0, False: 2.64k]
  ------------------
  759|      0|        return 0;
  760|  5.29k|    return key_to_params(ecx, NULL, p->pub, p->priv, 1);
  761|  5.29k|}
ecx_kmgmt.c:key_to_params:
  294|  6.62k|{
  295|  6.62k|    if (key == NULL)
  ------------------
  |  Branch (295:9): [True: 0, False: 6.62k]
  ------------------
  296|      0|        return 0;
  297|       |
  298|  6.62k|    if (!ossl_param_build_set_octet_string(tmpl, pub,
  ------------------
  |  Branch (298:9): [True: 0, False: 6.62k]
  ------------------
  299|  6.62k|            OSSL_PKEY_PARAM_PUB_KEY,
  ------------------
  |  |  441|  6.62k|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  300|  6.62k|            key->pubkey, key->keylen))
  301|      0|        return 0;
  302|       |
  303|  6.62k|    if (include_private
  ------------------
  |  Branch (303:9): [True: 5.29k, False: 1.32k]
  ------------------
  304|  5.29k|        && key->privkey != NULL
  ------------------
  |  Branch (304:12): [True: 5.29k, False: 0]
  ------------------
  305|  5.29k|        && !ossl_param_build_set_octet_string(tmpl, priv,
  ------------------
  |  Branch (305:12): [True: 0, False: 5.29k]
  ------------------
  306|  5.29k|            OSSL_PKEY_PARAM_PRIV_KEY,
  ------------------
  |  |  439|  5.29k|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  307|  5.29k|            key->privkey, key->keylen))
  308|      0|        return 0;
  309|       |
  310|  6.62k|    return 1;
  311|  6.62k|}
ecx_kmgmt.c:ecx_export:
  315|  1.32k|{
  316|  1.32k|    ECX_KEY *key = keydata;
  317|  1.32k|    OSSL_PARAM_BLD *tmpl;
  318|  1.32k|    OSSL_PARAM *params = NULL;
  319|  1.32k|    int ret = 0;
  320|       |
  321|  1.32k|    if (!ossl_prov_is_running() || key == NULL)
  ------------------
  |  Branch (321:9): [True: 0, False: 1.32k]
  |  Branch (321:36): [True: 0, False: 1.32k]
  ------------------
  322|      0|        return 0;
  323|       |
  324|  1.32k|    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0)
  ------------------
  |  |  650|  1.32k|    (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  640|  1.32k|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  641|  1.32k|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  |  |  ------------------
  ------------------
  |  Branch (324:9): [True: 0, False: 1.32k]
  ------------------
  325|      0|        return 0;
  326|       |
  327|  1.32k|    tmpl = OSSL_PARAM_BLD_new();
  328|  1.32k|    if (tmpl == NULL)
  ------------------
  |  Branch (328:9): [True: 0, False: 1.32k]
  ------------------
  329|      0|        return 0;
  330|       |
  331|  1.32k|    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
  ------------------
  |  |  650|  1.32k|    (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  640|  1.32k|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  641|  1.32k|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  |  |  ------------------
  ------------------
  |  Branch (331:9): [True: 1.32k, False: 0]
  ------------------
  332|  1.32k|        int include_private = ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0);
  ------------------
  |  |  640|  1.32k|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  ------------------
  333|       |
  334|  1.32k|        if (!key_to_params(key, tmpl, NULL, NULL, include_private))
  ------------------
  |  Branch (334:13): [True: 0, False: 1.32k]
  ------------------
  335|      0|            goto err;
  336|  1.32k|    }
  337|       |
  338|  1.32k|    params = OSSL_PARAM_BLD_to_param(tmpl);
  339|  1.32k|    if (params == NULL)
  ------------------
  |  Branch (339:9): [True: 0, False: 1.32k]
  ------------------
  340|      0|        goto err;
  341|       |
  342|  1.32k|    ret = param_cb(params, cbarg);
  343|  1.32k|    OSSL_PARAM_free(params);
  344|  1.32k|err:
  345|  1.32k|    OSSL_PARAM_BLD_free(tmpl);
  346|  1.32k|    return ret;
  347|  1.32k|}
ecx_kmgmt.c:x25519_gen_init:
 1021|  2.64k|{
 1022|  2.64k|    return ecx_gen_init(provctx, selection, params, ECX_KEY_TYPE_X25519, "X25519");
 1023|  2.64k|}
ecx_kmgmt.c:ecx_gen_init:
  990|  2.64k|{
  991|  2.64k|    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(provctx);
  ------------------
  |  |   31|  2.64k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  992|  2.64k|    struct ecx_gen_ctx *gctx = NULL;
  993|       |
  994|  2.64k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (994:9): [True: 0, False: 2.64k]
  ------------------
  995|      0|        return NULL;
  996|       |
  997|  2.64k|    if ((gctx = OPENSSL_zalloc(sizeof(*gctx))) != NULL) {
  ------------------
  |  |  108|  2.64k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (997:9): [True: 2.64k, False: 0]
  ------------------
  998|  2.64k|        gctx->libctx = libctx;
  999|  2.64k|        gctx->type = type;
 1000|  2.64k|        gctx->selection = selection;
 1001|       |#ifdef FIPS_MODULE
 1002|       |        /* X25519/X448 are not FIPS approved, (ED25519/ED448 are approved) */
 1003|       |        if (algdesc != NULL
 1004|       |            && !ossl_FIPS_IND_callback(libctx, algdesc, "KeyGen Init")) {
 1005|       |            OPENSSL_free(gctx);
 1006|       |            return NULL;
 1007|       |        }
 1008|       |#endif
 1009|  2.64k|    } else {
 1010|      0|        return NULL;
 1011|      0|    }
 1012|  2.64k|    if (!ecx_gen_set_params(gctx, params)) {
  ------------------
  |  Branch (1012:9): [True: 0, False: 2.64k]
  ------------------
 1013|      0|        ecx_gen_cleanup(gctx);
 1014|       |        gctx = NULL;
 1015|      0|    }
 1016|  2.64k|    return gctx;
 1017|  2.64k|}
ecx_kmgmt.c:ecx_gen_set_params:
 1114|  5.29k|{
 1115|  5.29k|    struct ecx_gen_ctx *gctx = genctx;
 1116|  5.29k|    struct ecx_gen_set_params_st p;
 1117|       |
 1118|  5.29k|    if (gctx == NULL || !ecx_gen_set_params_decoder(params, &p))
  ------------------
  |  Branch (1118:9): [True: 0, False: 5.29k]
  |  Branch (1118:25): [True: 0, False: 5.29k]
  ------------------
 1119|      0|        return 0;
 1120|       |
 1121|  5.29k|    if (p.group != NULL) {
  ------------------
  |  Branch (1121:9): [True: 1.32k, False: 3.97k]
  ------------------
 1122|  1.32k|        const char *groupname = NULL;
 1123|       |
 1124|       |        /*
 1125|       |         * We optionally allow setting a group name - but each algorithm only
 1126|       |         * support one such name, so all we do is verify that it is the one we
 1127|       |         * expected.
 1128|       |         */
 1129|  1.32k|        switch (gctx->type) {
 1130|  1.31k|        case ECX_KEY_TYPE_X25519:
  ------------------
  |  Branch (1130:9): [True: 1.31k, False: 3]
  ------------------
 1131|  1.31k|            groupname = "x25519";
 1132|  1.31k|            break;
 1133|      3|        case ECX_KEY_TYPE_X448:
  ------------------
  |  Branch (1133:9): [True: 3, False: 1.31k]
  ------------------
 1134|      3|            groupname = "x448";
 1135|      3|            break;
 1136|      0|        default:
  ------------------
  |  Branch (1136:9): [True: 0, False: 1.32k]
  ------------------
 1137|       |            /* We only support this for key exchange at the moment */
 1138|      0|            break;
 1139|  1.32k|        }
 1140|  1.32k|        if (p.group->data_type != OSSL_PARAM_UTF8_STRING
  ------------------
  |  |  117|  2.64k|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (1140:13): [True: 0, False: 1.32k]
  ------------------
 1141|  1.32k|            || groupname == NULL
  ------------------
  |  Branch (1141:16): [True: 0, False: 1.32k]
  ------------------
 1142|  1.32k|            || OPENSSL_strcasecmp(p.group->data, groupname) != 0) {
  ------------------
  |  Branch (1142:16): [True: 0, False: 1.32k]
  ------------------
 1143|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1144|      0|            return 0;
 1145|      0|        }
 1146|  1.32k|    }
 1147|       |
 1148|  5.29k|    if (p.kdfpropq != NULL) {
  ------------------
  |  Branch (1148:9): [True: 0, False: 5.29k]
  ------------------
 1149|      0|        if (p.kdfpropq->data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      0|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (1149:13): [True: 0, False: 0]
  ------------------
 1150|      0|            return 0;
 1151|      0|        OPENSSL_free(gctx->propq);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1152|      0|        gctx->propq = OPENSSL_strdup(p.kdfpropq->data);
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1153|      0|        if (gctx->propq == NULL)
  ------------------
  |  Branch (1153:13): [True: 0, False: 0]
  ------------------
 1154|      0|            return 0;
 1155|      0|    }
 1156|       |
 1157|  5.29k|    if (p.ikm != NULL) {
  ------------------
  |  Branch (1157:9): [True: 0, False: 5.29k]
  ------------------
 1158|      0|        if (p.ikm->data_size != 0 && p.ikm->data != NULL) {
  ------------------
  |  Branch (1158:13): [True: 0, False: 0]
  |  Branch (1158:38): [True: 0, False: 0]
  ------------------
 1159|      0|            OPENSSL_free(gctx->dhkem_ikm);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1160|      0|            gctx->dhkem_ikm = NULL;
 1161|      0|            if (!OSSL_PARAM_get_octet_string(p.ikm, (void **)&gctx->dhkem_ikm, 0,
  ------------------
  |  Branch (1161:17): [True: 0, False: 0]
  ------------------
 1162|      0|                    &gctx->dhkem_ikmlen))
 1163|      0|                return 0;
 1164|      0|        }
 1165|      0|    }
 1166|       |
 1167|  5.29k|    return 1;
 1168|  5.29k|}
ecx_kmgmt.c:ecx_gen_set_params_decoder:
 1065|  5.29k|{
 1066|  5.29k|    const char *s;
 1067|       |
 1068|  5.29k|    memset(r, 0, sizeof(*r));
 1069|  5.29k|    if (p != NULL)
  ------------------
  |  Branch (1069:9): [True: 2.64k, False: 2.64k]
  ------------------
 1070|  3.97k|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (1070:16): [True: 1.32k, False: 2.64k]
  ------------------
 1071|  1.32k|            switch(s[0]) {
 1072|      0|            default:
  ------------------
  |  Branch (1072:13): [True: 0, False: 1.32k]
  ------------------
 1073|      0|                break;
 1074|      0|            case 'd':
  ------------------
  |  Branch (1074:13): [True: 0, False: 1.32k]
  ------------------
 1075|      0|                if (ossl_likely(strcmp("hkem-ikm", s + 1) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1076|       |                    /* OSSL_PKEY_PARAM_DHKEM_IKM */
 1077|      0|                    if (ossl_unlikely(r->ikm != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1078|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
 1079|      0|                                       "param %s is repeated", s);
 1080|      0|                        return 0;
 1081|      0|                    }
 1082|      0|                    r->ikm = (OSSL_PARAM *)p;
 1083|      0|                }
 1084|      0|                break;
 1085|  1.32k|            case 'g':
  ------------------
  |  Branch (1085:13): [True: 1.32k, False: 0]
  ------------------
 1086|  1.32k|                if (ossl_likely(strcmp("roup", s + 1) == 0)) {
  ------------------
  |  |   22|  1.32k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 1.32k, False: 0]
  |  |  ------------------
  ------------------
 1087|       |                    /* OSSL_PKEY_PARAM_GROUP_NAME */
 1088|  1.32k|                    if (ossl_unlikely(r->group != NULL)) {
  ------------------
  |  |   23|  1.32k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.32k]
  |  |  ------------------
  ------------------
 1089|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
 1090|      0|                                       "param %s is repeated", s);
 1091|      0|                        return 0;
 1092|      0|                    }
 1093|  1.32k|                    r->group = (OSSL_PARAM *)p;
 1094|  1.32k|                }
 1095|  1.32k|                break;
 1096|  1.32k|            case 'p':
  ------------------
  |  Branch (1096:13): [True: 0, False: 1.32k]
  ------------------
 1097|      0|                if (ossl_likely(strcmp("roperties", s + 1) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1098|       |                    /* OSSL_KDF_PARAM_PROPERTIES */
 1099|      0|                    if (ossl_unlikely(r->kdfpropq != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1100|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
 1101|      0|                                       "param %s is repeated", s);
 1102|      0|                        return 0;
 1103|      0|                    }
 1104|      0|                    r->kdfpropq = (OSSL_PARAM *)p;
 1105|      0|                }
 1106|  1.32k|            }
 1107|  5.29k|    return 1;
 1108|  5.29k|}
ecx_kmgmt.c:x25519_gen:
 1311|  2.64k|{
 1312|  2.64k|    struct ecx_gen_ctx *gctx = genctx;
 1313|       |
 1314|  2.64k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (1314:9): [True: 0, False: 2.64k]
  ------------------
 1315|      0|        return 0;
 1316|       |
 1317|       |#ifdef S390X_EC_ASM
 1318|       |    if (OPENSSL_s390xcap_P.pcc[1] & S390X_CAPBIT(S390X_SCALAR_MULTIPLY_X25519))
 1319|       |        return s390x_ecx_keygen25519(gctx);
 1320|       |#endif
 1321|  2.64k|    return ecx_gen(gctx);
 1322|  2.64k|}
ecx_kmgmt.c:ecx_gen:
 1245|  2.64k|{
 1246|  2.64k|    ECX_KEY *key;
 1247|  2.64k|    unsigned char *privkey;
 1248|       |
 1249|  2.64k|    if (gctx == NULL)
  ------------------
  |  Branch (1249:9): [True: 0, False: 2.64k]
  ------------------
 1250|      0|        return NULL;
 1251|  2.64k|    if ((key = ossl_ecx_key_new(gctx->libctx, gctx->type, 0,
  ------------------
  |  Branch (1251:9): [True: 0, False: 2.64k]
  ------------------
 1252|  2.64k|             gctx->propq))
 1253|  2.64k|        == NULL) {
 1254|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1255|      0|        return NULL;
 1256|      0|    }
 1257|       |
 1258|       |    /* If we're doing parameter generation then we just return a blank key */
 1259|  2.64k|    if ((gctx->selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0)
  ------------------
  |  |  650|  2.64k|    (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  640|  2.64k|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  641|  2.64k|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  |  |  ------------------
  ------------------
  |  Branch (1259:9): [True: 0, False: 2.64k]
  ------------------
 1260|      0|        return key;
 1261|       |
 1262|  2.64k|    if ((privkey = ossl_ecx_key_allocate_privkey(key)) == NULL) {
  ------------------
  |  Branch (1262:9): [True: 0, False: 2.64k]
  ------------------
 1263|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_EC_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1264|      0|        goto err;
 1265|      0|    }
 1266|  2.64k|#ifndef FIPS_MODULE
 1267|  2.64k|    if (gctx->dhkem_ikm != NULL && gctx->dhkem_ikmlen != 0) {
  ------------------
  |  Branch (1267:9): [True: 0, False: 2.64k]
  |  Branch (1267:36): [True: 0, False: 0]
  ------------------
 1268|      0|        if (ecx_key_type_is_ed(gctx->type))
  ------------------
  |  Branch (1268:13): [True: 0, False: 0]
  ------------------
 1269|      0|            goto err;
 1270|      0|        if (!ossl_ecx_dhkem_derive_private(key, privkey,
  ------------------
  |  Branch (1270:13): [True: 0, False: 0]
  ------------------
 1271|      0|                gctx->dhkem_ikm, gctx->dhkem_ikmlen))
 1272|      0|            goto err;
 1273|      0|    } else
 1274|  2.64k|#endif
 1275|  2.64k|    {
 1276|  2.64k|        if (RAND_priv_bytes_ex(gctx->libctx, privkey, key->keylen, 0) <= 0)
  ------------------
  |  Branch (1276:13): [True: 0, False: 2.64k]
  ------------------
 1277|      0|            goto err;
 1278|  2.64k|    }
 1279|       |
 1280|  2.64k|    switch (gctx->type) {
  ------------------
  |  Branch (1280:13): [True: 2.64k, False: 0]
  ------------------
 1281|  2.64k|    case ECX_KEY_TYPE_X25519:
  ------------------
  |  Branch (1281:5): [True: 2.64k, False: 3]
  ------------------
 1282|  2.64k|        privkey[0] &= 248;
 1283|  2.64k|        privkey[X25519_KEYLEN - 1] &= 127;
  ------------------
  |  |   26|  2.64k|#define X25519_KEYLEN 32
  ------------------
 1284|  2.64k|        privkey[X25519_KEYLEN - 1] |= 64;
  ------------------
  |  |   26|  2.64k|#define X25519_KEYLEN 32
  ------------------
 1285|  2.64k|        ossl_x25519_public_from_private(key->pubkey, privkey);
 1286|  2.64k|        break;
 1287|      3|    case ECX_KEY_TYPE_X448:
  ------------------
  |  Branch (1287:5): [True: 3, False: 2.64k]
  ------------------
 1288|      3|        privkey[0] &= 252;
 1289|      3|        privkey[X448_KEYLEN - 1] |= 128;
  ------------------
  |  |   27|      3|#define X448_KEYLEN 56
  ------------------
 1290|      3|        ossl_x448_public_from_private(key->pubkey, privkey);
 1291|      3|        break;
 1292|      0|    case ECX_KEY_TYPE_ED25519:
  ------------------
  |  Branch (1292:5): [True: 0, False: 2.64k]
  ------------------
 1293|      0|        if (!ossl_ed25519_public_from_private(gctx->libctx, key->pubkey, privkey,
  ------------------
  |  Branch (1293:13): [True: 0, False: 0]
  ------------------
 1294|      0|                gctx->propq))
 1295|      0|            goto err;
 1296|      0|        break;
 1297|      0|    case ECX_KEY_TYPE_ED448:
  ------------------
  |  Branch (1297:5): [True: 0, False: 2.64k]
  ------------------
 1298|      0|        if (!ossl_ed448_public_from_private(gctx->libctx, key->pubkey, privkey,
  ------------------
  |  Branch (1298:13): [True: 0, False: 0]
  ------------------
 1299|      0|                gctx->propq))
 1300|      0|            goto err;
 1301|      0|        break;
 1302|  2.64k|    }
 1303|  2.64k|    key->haspubkey = 1;
 1304|  2.64k|    return key;
 1305|      0|err:
 1306|      0|    ossl_ecx_key_free(key);
 1307|       |    return NULL;
 1308|  2.64k|}
ecx_kmgmt.c:ecx_gen_cleanup:
 1406|  2.64k|{
 1407|  2.64k|    struct ecx_gen_ctx *gctx = genctx;
 1408|       |
 1409|  2.64k|    if (gctx == NULL)
  ------------------
  |  Branch (1409:9): [True: 0, False: 2.64k]
  ------------------
 1410|      0|        return;
 1411|       |
 1412|  2.64k|    OPENSSL_clear_free(gctx->dhkem_ikm, gctx->dhkem_ikmlen);
  ------------------
  |  |  129|  2.64k|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1413|  2.64k|    OPENSSL_free(gctx->propq);
  ------------------
  |  |  131|  2.64k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1414|  2.64k|    OPENSSL_free(gctx);
  ------------------
  |  |  131|  2.64k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1415|  2.64k|}
ecx_kmgmt.c:x448_get_params:
  809|      9|{
  810|      9|    return ecx_get_params(key, params, X448_BITS, X448_SECURITY_BITS,
  ------------------
  |  |   36|      9|#define X448_BITS 448
  ------------------
                  return ecx_get_params(key, params, X448_BITS, X448_SECURITY_BITS,
  ------------------
  |  |   37|      9|#define X448_SECURITY_BITS 224
  ------------------
  811|      9|        X448_KEYLEN);
  ------------------
  |  |   27|      9|#define X448_KEYLEN 56
  ------------------
  812|      9|}
ecx_kmgmt.c:x448_gen_init:
 1027|      3|{
 1028|      3|    return ecx_gen_init(provctx, selection, params, ECX_KEY_TYPE_X448, "X448");
 1029|      3|}
ecx_kmgmt.c:x448_gen:
 1325|      3|{
 1326|      3|    struct ecx_gen_ctx *gctx = genctx;
 1327|       |
 1328|      3|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (1328:9): [True: 0, False: 3]
  ------------------
 1329|      0|        return 0;
 1330|       |
 1331|       |#ifdef S390X_EC_ASM
 1332|       |    if (OPENSSL_s390xcap_P.pcc[1] & S390X_CAPBIT(S390X_SCALAR_MULTIPLY_X448))
 1333|       |        return s390x_ecx_keygen448(gctx);
 1334|       |#endif
 1335|      3|    return ecx_gen(gctx);
 1336|      3|}

ossl_prov_ml_kem_new:
  161|  1.32k|{
  162|  1.32k|    ML_KEM_KEY *key;
  163|       |
  164|  1.32k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (164:9): [True: 0, False: 1.32k]
  ------------------
  165|      0|        return NULL;
  166|       |    /*
  167|       |     * When decoding, if the key ends up "loaded" into the same provider, these
  168|       |     * are the correct config settings, otherwise, new values will be assigned
  169|       |     * on import into a different provider.  The "load" API does not pass along
  170|       |     * the provider context.
  171|       |     */
  172|  1.32k|    if ((key = ossl_ml_kem_key_new(PROV_LIBCTX_OF(ctx), propq, evp_type)) != NULL) {
  ------------------
  |  |   31|  1.32k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  |  Branch (172:9): [True: 1.32k, False: 0]
  ------------------
  173|  1.32k|        const char *pct_type = ossl_prov_ctx_get_param(
  174|  1.32k|            ctx, OSSL_PKEY_PARAM_ML_KEM_IMPORT_PCT_TYPE, "random");
  ------------------
  |  |  432|  1.32k|# define OSSL_PKEY_PARAM_ML_KEM_IMPORT_PCT_TYPE "ml-kem.import_pct_type"
  ------------------
  175|       |
  176|  1.32k|        if (ossl_prov_ctx_get_bool_param(
  ------------------
  |  Branch (176:13): [True: 1.32k, False: 0]
  ------------------
  177|  1.32k|                ctx, OSSL_PKEY_PARAM_ML_KEM_RETAIN_SEED, 1))
  ------------------
  |  |  436|  1.32k|# define OSSL_PKEY_PARAM_ML_KEM_RETAIN_SEED "ml-kem.retain_seed"
  ------------------
  178|  1.32k|            key->prov_flags |= ML_KEM_KEY_RETAIN_SEED;
  ------------------
  |  |  126|  1.32k|#define ML_KEM_KEY_RETAIN_SEED (1 << 3)
  ------------------
  179|      0|        else
  180|      0|            key->prov_flags &= ~ML_KEM_KEY_RETAIN_SEED;
  ------------------
  |  |  126|      0|#define ML_KEM_KEY_RETAIN_SEED (1 << 3)
  ------------------
  181|  1.32k|        if (ossl_prov_ctx_get_bool_param(
  ------------------
  |  Branch (181:13): [True: 1.32k, False: 0]
  ------------------
  182|  1.32k|                ctx, OSSL_PKEY_PARAM_ML_KEM_PREFER_SEED, 1))
  ------------------
  |  |  435|  1.32k|# define OSSL_PKEY_PARAM_ML_KEM_PREFER_SEED "ml-kem.prefer_seed"
  ------------------
  183|  1.32k|            key->prov_flags |= ML_KEM_KEY_PREFER_SEED;
  ------------------
  |  |  125|  1.32k|#define ML_KEM_KEY_PREFER_SEED (1 << 2)
  ------------------
  184|      0|        else
  185|      0|            key->prov_flags &= ~ML_KEM_KEY_PREFER_SEED;
  ------------------
  |  |  125|      0|#define ML_KEM_KEY_PREFER_SEED (1 << 2)
  ------------------
  186|  1.32k|        if (OPENSSL_strcasecmp(pct_type, "random") == 0)
  ------------------
  |  Branch (186:13): [True: 1.32k, False: 0]
  ------------------
  187|  1.32k|            key->prov_flags |= ML_KEM_KEY_RANDOM_PCT;
  ------------------
  |  |  123|  1.32k|#define ML_KEM_KEY_RANDOM_PCT (1 << 0)
  ------------------
  188|      0|        else if (OPENSSL_strcasecmp(pct_type, "fixed") == 0)
  ------------------
  |  Branch (188:18): [True: 0, False: 0]
  ------------------
  189|      0|            key->prov_flags |= ML_KEM_KEY_FIXED_PCT;
  ------------------
  |  |  124|      0|#define ML_KEM_KEY_FIXED_PCT (1 << 1)
  ------------------
  190|      0|        else
  191|      0|            key->prov_flags &= ~ML_KEM_KEY_PCT_TYPE;
  ------------------
  |  |  129|      0|    (ML_KEM_KEY_RANDOM_PCT | ML_KEM_KEY_FIXED_PCT)
  |  |  ------------------
  |  |  |  |  123|      0|#define ML_KEM_KEY_RANDOM_PCT (1 << 0)
  |  |  ------------------
  |  |                   (ML_KEM_KEY_RANDOM_PCT | ML_KEM_KEY_FIXED_PCT)
  |  |  ------------------
  |  |  |  |  124|      0|#define ML_KEM_KEY_FIXED_PCT (1 << 1)
  |  |  ------------------
  ------------------
  192|  1.32k|    }
  193|  1.32k|    return key;
  194|  1.32k|}
ml_kem_kmgmt.c:ml_kem_get_params:
  847|  1.32k|{
  848|  1.32k|    ML_KEM_KEY *key = vkey;
  849|  1.32k|    const ML_KEM_VINFO *v;
  850|  1.32k|    struct ml_kem_get_params_st p;
  851|       |
  852|  1.32k|    if (key == NULL || !ml_kem_get_params_decoder(params, &p))
  ------------------
  |  Branch (852:9): [True: 0, False: 1.32k]
  |  Branch (852:24): [True: 0, False: 1.32k]
  ------------------
  853|      0|        return 0;
  854|       |
  855|  1.32k|    v = ossl_ml_kem_key_vinfo(key);
  ------------------
  |  |  206|  1.32k|#define ossl_ml_kem_key_vinfo(key) ((key)->vinfo)
  ------------------
  856|       |
  857|  1.32k|    if (p.bits != NULL && !OSSL_PARAM_set_size_t(p.bits, v->bits))
  ------------------
  |  Branch (857:9): [True: 1.32k, False: 0]
  |  Branch (857:27): [True: 0, False: 1.32k]
  ------------------
  858|      0|        return 0;
  859|       |
  860|  1.32k|    if (p.secbits != NULL && !OSSL_PARAM_set_size_t(p.secbits, v->secbits))
  ------------------
  |  Branch (860:9): [True: 1.32k, False: 0]
  |  Branch (860:30): [True: 0, False: 1.32k]
  ------------------
  861|      0|        return 0;
  862|       |
  863|  1.32k|    if (p.maxsize != NULL && !OSSL_PARAM_set_size_t(p.maxsize, v->ctext_bytes))
  ------------------
  |  Branch (863:9): [True: 1.32k, False: 0]
  |  Branch (863:30): [True: 0, False: 1.32k]
  ------------------
  864|      0|        return 0;
  865|       |
  866|  1.32k|    if (p.seccat != NULL && !OSSL_PARAM_set_int(p.seccat, v->security_category))
  ------------------
  |  Branch (866:9): [True: 1.32k, False: 0]
  |  Branch (866:29): [True: 0, False: 1.32k]
  ------------------
  867|      0|        return 0;
  868|       |
  869|  1.32k|    if (p.pubkey != NULL && ossl_ml_kem_have_pubkey(key)) {
  ------------------
  |  |  207|      0|#define ossl_ml_kem_have_pubkey(key) ((key)->t != NULL)
  |  |  ------------------
  |  |  |  Branch (207:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (869:9): [True: 0, False: 1.32k]
  ------------------
  870|       |        /* Exported to EVP_PKEY_get_raw_public_key() */
  871|      0|        if (!ml_kem_get_key_param(key, p.pubkey, v->pubkey_bytes,
  ------------------
  |  Branch (871:13): [True: 0, False: 0]
  ------------------
  872|      0|                &ossl_ml_kem_encode_public_key))
  873|      0|            return 0;
  874|      0|    }
  875|       |
  876|  1.32k|    if (p.encpubkey != NULL && ossl_ml_kem_have_pubkey(key)) {
  ------------------
  |  |  207|      0|#define ossl_ml_kem_have_pubkey(key) ((key)->t != NULL)
  |  |  ------------------
  |  |  |  Branch (207:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (876:9): [True: 0, False: 1.32k]
  ------------------
  877|       |        /* Needed by EVP_PKEY_get1_encoded_public_key() */
  878|      0|        if (!ml_kem_get_key_param(key, p.encpubkey, v->pubkey_bytes,
  ------------------
  |  Branch (878:13): [True: 0, False: 0]
  ------------------
  879|      0|                &ossl_ml_kem_encode_public_key))
  880|      0|            return 0;
  881|      0|    }
  882|       |
  883|  1.32k|    if (p.privkey != NULL && ossl_ml_kem_have_prvkey(key)) {
  ------------------
  |  |  208|      0|#define ossl_ml_kem_have_prvkey(key) ((key)->s != NULL)
  |  |  ------------------
  |  |  |  Branch (208:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (883:9): [True: 0, False: 1.32k]
  ------------------
  884|       |        /* Exported to EVP_PKEY_get_raw_private_key() */
  885|      0|        if (!ml_kem_get_key_param(key, p.privkey, v->prvkey_bytes,
  ------------------
  |  Branch (885:13): [True: 0, False: 0]
  ------------------
  886|      0|                &ossl_ml_kem_encode_private_key))
  887|      0|            return 0;
  888|      0|    }
  889|       |
  890|  1.32k|    if (p.seed != NULL && ossl_ml_kem_have_seed(key)) {
  ------------------
  |  |  209|      0|#define ossl_ml_kem_have_seed(key) ((key)->d != NULL)
  |  |  ------------------
  |  |  |  Branch (209:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (890:9): [True: 0, False: 1.32k]
  ------------------
  891|       |        /* Exported for import */
  892|      0|        if (!ml_kem_get_key_param(key, p.seed, ML_KEM_SEED_BYTES,
  ------------------
  |  |   48|      0|#define ML_KEM_SEED_BYTES (ML_KEM_RANDOM_BYTES * 2) /* Keygen (d, z) */
  |  |  ------------------
  |  |  |  |   47|      0|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  |  |  ------------------
  ------------------
  |  Branch (892:13): [True: 0, False: 0]
  ------------------
  893|      0|                &ossl_ml_kem_encode_seed))
  894|      0|            return 0;
  895|      0|    }
  896|       |
  897|  1.32k|#ifndef OPENSSL_NO_CMS
  898|  1.32k|    if (p.ri_type != NULL && !OSSL_PARAM_set_int(p.ri_type, CMS_RECIPINFO_KEM))
  ------------------
  |  |  175|      0|#define CMS_RECIPINFO_KEM 5
  ------------------
  |  Branch (898:9): [True: 0, False: 1.32k]
  |  Branch (898:30): [True: 0, False: 0]
  ------------------
  899|      0|        return 0;
  900|       |
  901|  1.32k|    if (p.kemri_kdf_alg != NULL) {
  ------------------
  |  Branch (901:9): [True: 0, False: 1.32k]
  ------------------
  902|      0|        uint8_t aid_buf[OSSL_MAX_ALGORITHM_ID_SIZE];
  903|      0|        int ret;
  904|      0|        size_t aid_len = 0;
  905|      0|        WPACKET pkt;
  906|      0|        uint8_t *aid = NULL;
  907|       |
  908|      0|        ret = WPACKET_init_der(&pkt, aid_buf, sizeof(aid_buf));
  909|      0|        ret &= ossl_DER_w_begin_sequence(&pkt, -1)
  ------------------
  |  Branch (909:16): [True: 0, False: 0]
  ------------------
  910|      0|            && ossl_DER_w_precompiled(&pkt, -1, ossl_der_oid_id_alg_hkdf_with_sha256,
  ------------------
  |  Branch (910:16): [True: 0, False: 0]
  ------------------
  911|      0|                sizeof(ossl_der_oid_id_alg_hkdf_with_sha256))
  912|      0|            && ossl_DER_w_end_sequence(&pkt, -1);
  ------------------
  |  Branch (912:16): [True: 0, False: 0]
  ------------------
  913|      0|        if (ret && WPACKET_finish(&pkt)) {
  ------------------
  |  Branch (913:13): [True: 0, False: 0]
  |  Branch (913:20): [True: 0, False: 0]
  ------------------
  914|      0|            WPACKET_get_total_written(&pkt, &aid_len);
  915|      0|            aid = WPACKET_get_curr(&pkt);
  916|      0|        }
  917|      0|        WPACKET_cleanup(&pkt);
  918|      0|        if (!ret)
  ------------------
  |  Branch (918:13): [True: 0, False: 0]
  ------------------
  919|      0|            return 0;
  920|      0|        if (aid != NULL && aid_len != 0 && !OSSL_PARAM_set_octet_string(p.kemri_kdf_alg, aid, aid_len))
  ------------------
  |  Branch (920:13): [True: 0, False: 0]
  |  Branch (920:28): [True: 0, False: 0]
  |  Branch (920:44): [True: 0, False: 0]
  ------------------
  921|      0|            return 0;
  922|      0|    }
  923|  1.32k|#endif
  924|       |
  925|  1.32k|    return 1;
  926|  1.32k|}
ml_kem_kmgmt.c:ml_kem_get_params_decoder:
  600|  1.32k|{
  601|  1.32k|    const char *s;
  602|       |
  603|  1.32k|    memset(r, 0, sizeof(*r));
  604|  1.32k|    if (p != NULL)
  ------------------
  |  Branch (604:9): [True: 1.32k, False: 0]
  ------------------
  605|  6.63k|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (605:16): [True: 5.30k, False: 1.32k]
  ------------------
  606|  5.30k|            switch(s[0]) {
  607|      0|            default:
  ------------------
  |  Branch (607:13): [True: 0, False: 5.30k]
  ------------------
  608|      0|                break;
  609|  1.32k|            case 'b':
  ------------------
  |  Branch (609:13): [True: 1.32k, False: 3.98k]
  ------------------
  610|  1.32k|                if (ossl_likely(strcmp("its", s + 1) == 0)) {
  ------------------
  |  |   22|  1.32k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 1.32k, False: 0]
  |  |  ------------------
  ------------------
  611|       |                    /* OSSL_PKEY_PARAM_BITS */
  612|  1.32k|                    if (ossl_unlikely(r->bits != NULL)) {
  ------------------
  |  |   23|  1.32k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.32k]
  |  |  ------------------
  ------------------
  613|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  614|      0|                                       "param %s is repeated", s);
  615|      0|                        return 0;
  616|      0|                    }
  617|  1.32k|                    r->bits = (OSSL_PARAM *)p;
  618|  1.32k|                }
  619|  1.32k|                break;
  620|  1.32k|            case 'e':
  ------------------
  |  Branch (620:13): [True: 0, False: 5.30k]
  ------------------
  621|      0|                if (ossl_likely(strcmp("ncoded-pub-key", s + 1) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  622|       |                    /* OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY */
  623|      0|                    if (ossl_unlikely(r->encpubkey != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  624|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  625|      0|                                       "param %s is repeated", s);
  626|      0|                        return 0;
  627|      0|                    }
  628|      0|                    r->encpubkey = (OSSL_PARAM *)p;
  629|      0|                }
  630|      0|                break;
  631|      0|            case 'k':
  ------------------
  |  Branch (631:13): [True: 0, False: 5.30k]
  ------------------
  632|      0|                if (ossl_likely(strcmp("emri-kdf-alg", s + 1) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  633|       |                    /* OSSL_PKEY_PARAM_CMS_KEMRI_KDF_ALGORITHM */
  634|      0|                    if (ossl_unlikely(r->kemri_kdf_alg != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  635|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  636|      0|                                       "param %s is repeated", s);
  637|      0|                        return 0;
  638|      0|                    }
  639|      0|                    r->kemri_kdf_alg = (OSSL_PARAM *)p;
  640|      0|                }
  641|      0|                break;
  642|  1.32k|            case 'm':
  ------------------
  |  Branch (642:13): [True: 1.32k, False: 3.98k]
  ------------------
  643|  1.32k|                if (ossl_likely(strcmp("ax-size", s + 1) == 0)) {
  ------------------
  |  |   22|  1.32k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 1.32k, False: 0]
  |  |  ------------------
  ------------------
  644|       |                    /* OSSL_PKEY_PARAM_MAX_SIZE */
  645|  1.32k|                    if (ossl_unlikely(r->maxsize != NULL)) {
  ------------------
  |  |   23|  1.32k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.32k]
  |  |  ------------------
  ------------------
  646|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  647|      0|                                       "param %s is repeated", s);
  648|      0|                        return 0;
  649|      0|                    }
  650|  1.32k|                    r->maxsize = (OSSL_PARAM *)p;
  651|  1.32k|                }
  652|  1.32k|                break;
  653|  1.32k|            case 'p':
  ------------------
  |  Branch (653:13): [True: 0, False: 5.30k]
  ------------------
  654|      0|                switch(s[1]) {
  655|      0|                default:
  ------------------
  |  Branch (655:17): [True: 0, False: 0]
  ------------------
  656|      0|                    break;
  657|      0|                case 'r':
  ------------------
  |  Branch (657:17): [True: 0, False: 0]
  ------------------
  658|      0|                    if (ossl_likely(strcmp("iv", s + 2) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  659|       |                        /* OSSL_PKEY_PARAM_PRIV_KEY */
  660|      0|                        if (ossl_unlikely(r->privkey != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  661|      0|                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  662|      0|                                           "param %s is repeated", s);
  663|      0|                            return 0;
  664|      0|                        }
  665|      0|                        r->privkey = (OSSL_PARAM *)p;
  666|      0|                    }
  667|      0|                    break;
  668|      0|                case 'u':
  ------------------
  |  Branch (668:17): [True: 0, False: 0]
  ------------------
  669|      0|                    if (ossl_likely(strcmp("b", s + 2) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  670|       |                        /* OSSL_PKEY_PARAM_PUB_KEY */
  671|      0|                        if (ossl_unlikely(r->pubkey != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  672|      0|                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  673|      0|                                           "param %s is repeated", s);
  674|      0|                            return 0;
  675|      0|                        }
  676|      0|                        r->pubkey = (OSSL_PARAM *)p;
  677|      0|                    }
  678|      0|                }
  679|      0|                break;
  680|      0|            case 'r':
  ------------------
  |  Branch (680:13): [True: 0, False: 5.30k]
  ------------------
  681|      0|                if (ossl_likely(strcmp("i-type", s + 1) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  682|       |                    /* OSSL_PKEY_PARAM_CMS_RI_TYPE */
  683|      0|                    if (ossl_unlikely(r->ri_type != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  684|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  685|      0|                                       "param %s is repeated", s);
  686|      0|                        return 0;
  687|      0|                    }
  688|      0|                    r->ri_type = (OSSL_PARAM *)p;
  689|      0|                }
  690|      0|                break;
  691|  2.65k|            case 's':
  ------------------
  |  Branch (691:13): [True: 2.65k, False: 2.65k]
  ------------------
  692|  2.65k|                switch(s[1]) {
  693|      0|                default:
  ------------------
  |  Branch (693:17): [True: 0, False: 2.65k]
  ------------------
  694|      0|                    break;
  695|  2.65k|                case 'e':
  ------------------
  |  Branch (695:17): [True: 2.65k, False: 0]
  ------------------
  696|  2.65k|                    switch(s[2]) {
  697|      0|                    default:
  ------------------
  |  Branch (697:21): [True: 0, False: 2.65k]
  ------------------
  698|      0|                        break;
  699|  2.65k|                    case 'c':
  ------------------
  |  Branch (699:21): [True: 2.65k, False: 0]
  ------------------
  700|  2.65k|                        switch(s[3]) {
  701|      0|                        default:
  ------------------
  |  Branch (701:25): [True: 0, False: 2.65k]
  ------------------
  702|      0|                            break;
  703|  2.65k|                        case 'u':
  ------------------
  |  Branch (703:25): [True: 2.65k, False: 0]
  ------------------
  704|  2.65k|                            switch(s[4]) {
  705|      0|                            default:
  ------------------
  |  Branch (705:29): [True: 0, False: 2.65k]
  ------------------
  706|      0|                                break;
  707|  2.65k|                            case 'r':
  ------------------
  |  Branch (707:29): [True: 2.65k, False: 0]
  ------------------
  708|  2.65k|                                switch(s[5]) {
  709|      0|                                default:
  ------------------
  |  Branch (709:33): [True: 0, False: 2.65k]
  ------------------
  710|      0|                                    break;
  711|  2.65k|                                case 'i':
  ------------------
  |  Branch (711:33): [True: 2.65k, False: 0]
  ------------------
  712|  2.65k|                                    switch(s[6]) {
  713|      0|                                    default:
  ------------------
  |  Branch (713:37): [True: 0, False: 2.65k]
  ------------------
  714|      0|                                        break;
  715|  2.65k|                                    case 't':
  ------------------
  |  Branch (715:37): [True: 2.65k, False: 0]
  ------------------
  716|  2.65k|                                        switch(s[7]) {
  717|      0|                                        default:
  ------------------
  |  Branch (717:41): [True: 0, False: 2.65k]
  ------------------
  718|      0|                                            break;
  719|  2.65k|                                        case 'y':
  ------------------
  |  Branch (719:41): [True: 2.65k, False: 0]
  ------------------
  720|  2.65k|                                            switch(s[8]) {
  721|      0|                                            default:
  ------------------
  |  Branch (721:45): [True: 0, False: 2.65k]
  ------------------
  722|      0|                                                break;
  723|  2.65k|                                            case '-':
  ------------------
  |  Branch (723:45): [True: 2.65k, False: 0]
  ------------------
  724|  2.65k|                                                switch(s[9]) {
  725|      0|                                                default:
  ------------------
  |  Branch (725:49): [True: 0, False: 2.65k]
  ------------------
  726|      0|                                                    break;
  727|  1.32k|                                                case 'b':
  ------------------
  |  Branch (727:49): [True: 1.32k, False: 1.32k]
  ------------------
  728|  1.32k|                                                    if (ossl_likely(strcmp("its", s + 10) == 0)) {
  ------------------
  |  |   22|  1.32k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 1.32k, False: 0]
  |  |  ------------------
  ------------------
  729|       |                                                        /* OSSL_PKEY_PARAM_SECURITY_BITS */
  730|  1.32k|                                                        if (ossl_unlikely(r->secbits != NULL)) {
  ------------------
  |  |   23|  1.32k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.32k]
  |  |  ------------------
  ------------------
  731|      0|                                                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  732|      0|                                                                           "param %s is repeated", s);
  733|      0|                                                            return 0;
  734|      0|                                                        }
  735|  1.32k|                                                        r->secbits = (OSSL_PARAM *)p;
  736|  1.32k|                                                    }
  737|  1.32k|                                                    break;
  738|  1.32k|                                                case 'c':
  ------------------
  |  Branch (738:49): [True: 1.32k, False: 1.32k]
  ------------------
  739|  1.32k|                                                    if (ossl_likely(strcmp("ategory", s + 10) == 0)) {
  ------------------
  |  |   22|  1.32k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 1.32k, False: 0]
  |  |  ------------------
  ------------------
  740|       |                                                        /* OSSL_PKEY_PARAM_SECURITY_CATEGORY */
  741|  1.32k|                                                        if (ossl_unlikely(r->seccat != NULL)) {
  ------------------
  |  |   23|  1.32k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.32k]
  |  |  ------------------
  ------------------
  742|      0|                                                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  743|      0|                                                                           "param %s is repeated", s);
  744|      0|                                                            return 0;
  745|      0|                                                        }
  746|  1.32k|                                                        r->seccat = (OSSL_PARAM *)p;
  747|  1.32k|                                                    }
  748|  2.65k|                                                }
  749|  2.65k|                                            }
  750|  2.65k|                                        }
  751|  2.65k|                                    }
  752|  2.65k|                                }
  753|  2.65k|                            }
  754|  2.65k|                        }
  755|  2.65k|                        break;
  756|  2.65k|                    case 'e':
  ------------------
  |  Branch (756:21): [True: 0, False: 2.65k]
  ------------------
  757|      0|                        if (ossl_likely(strcmp("d", s + 3) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  758|       |                            /* OSSL_PKEY_PARAM_ML_KEM_SEED */
  759|      0|                            if (ossl_unlikely(r->seed != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  760|      0|                                ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  761|      0|                                               "param %s is repeated", s);
  762|      0|                                return 0;
  763|      0|                            }
  764|      0|                            r->seed = (OSSL_PARAM *)p;
  765|      0|                        }
  766|  2.65k|                    }
  767|  2.65k|                }
  768|  5.30k|            }
  769|  1.32k|    return 1;
  770|  1.32k|}
ml_kem_kmgmt.c:ml_kem_gen_init:
 1096|  1.32k|{
 1097|  1.32k|    PROV_ML_KEM_GEN_CTX *gctx = NULL;
 1098|       |
 1099|       |    /*
 1100|       |     * We can only generate private keys, check that the selection is
 1101|       |     * appropriate.
 1102|       |     */
 1103|  1.32k|    if (!ossl_prov_is_running()
  ------------------
  |  Branch (1103:9): [True: 0, False: 1.32k]
  ------------------
 1104|  1.32k|        || (selection & minimal_selection) == 0
  ------------------
  |  Branch (1104:12): [True: 0, False: 1.32k]
  ------------------
 1105|  1.32k|        || (gctx = OPENSSL_zalloc(sizeof(*gctx))) == NULL)
  ------------------
  |  |  108|  1.32k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (1105:12): [True: 0, False: 1.32k]
  ------------------
 1106|      0|        return NULL;
 1107|       |
 1108|  1.32k|    gctx->selection = selection;
 1109|  1.32k|    gctx->evp_type = evp_type;
 1110|  1.32k|    gctx->provctx = provctx;
 1111|  1.32k|    if (ml_kem_gen_set_params(gctx, params))
  ------------------
  |  Branch (1111:9): [True: 1.32k, False: 0]
  ------------------
 1112|  1.32k|        return gctx;
 1113|       |
 1114|      0|    ml_kem_gen_cleanup(gctx);
 1115|       |    return NULL;
 1116|  1.32k|}
ml_kem_kmgmt.c:ml_kem_gen_set_params:
 1062|  2.65k|{
 1063|  2.65k|    PROV_ML_KEM_GEN_CTX *gctx = vgctx;
 1064|  2.65k|    struct ml_kem_gen_set_params_st p;
 1065|       |
 1066|  2.65k|    if (gctx == NULL || !ml_kem_gen_set_params_decoder(params, &p))
  ------------------
  |  Branch (1066:9): [True: 0, False: 2.65k]
  |  Branch (1066:25): [True: 0, False: 2.65k]
  ------------------
 1067|      0|        return 0;
 1068|       |
 1069|  2.65k|    if (p.propq != NULL) {
  ------------------
  |  Branch (1069:9): [True: 0, False: 2.65k]
  ------------------
 1070|      0|        if (p.propq->data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      0|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (1070:13): [True: 0, False: 0]
  ------------------
 1071|      0|            return 0;
 1072|      0|        OPENSSL_free(gctx->propq);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1073|      0|        if ((gctx->propq = OPENSSL_strdup(p.propq->data)) == NULL)
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (1073:13): [True: 0, False: 0]
  ------------------
 1074|      0|            return 0;
 1075|      0|    }
 1076|       |
 1077|  2.65k|    if (p.seed != NULL) {
  ------------------
  |  Branch (1077:9): [True: 0, False: 2.65k]
  ------------------
 1078|      0|        size_t len = ML_KEM_SEED_BYTES;
  ------------------
  |  |   48|      0|#define ML_KEM_SEED_BYTES (ML_KEM_RANDOM_BYTES * 2) /* Keygen (d, z) */
  |  |  ------------------
  |  |  |  |   47|      0|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  |  |  ------------------
  ------------------
 1079|       |
 1080|      0|        gctx->seed = gctx->seedbuf;
 1081|      0|        if (OSSL_PARAM_get_octet_string(p.seed, (void **)&gctx->seed, len, &len)
  ------------------
  |  Branch (1081:13): [True: 0, False: 0]
  ------------------
 1082|      0|            && len == ML_KEM_SEED_BYTES)
  ------------------
  |  |   48|      0|#define ML_KEM_SEED_BYTES (ML_KEM_RANDOM_BYTES * 2) /* Keygen (d, z) */
  |  |  ------------------
  |  |  |  |   47|      0|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  |  |  ------------------
  ------------------
  |  Branch (1082:16): [True: 0, False: 0]
  ------------------
 1083|      0|            return 1;
 1084|       |
 1085|       |        /* Possibly, but less likely wrong data type */
 1086|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_SEED_LENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1087|      0|        gctx->seed = NULL;
 1088|      0|        return 0;
 1089|      0|    }
 1090|       |
 1091|  2.65k|    return 1;
 1092|  2.65k|}
ml_kem_kmgmt.c:ml_kem_gen_set_params_decoder:
 1024|  2.65k|{
 1025|  2.65k|    const char *s;
 1026|       |
 1027|  2.65k|    memset(r, 0, sizeof(*r));
 1028|  2.65k|    if (p != NULL)
  ------------------
  |  Branch (1028:9): [True: 1.32k, False: 1.32k]
  ------------------
 1029|  1.32k|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (1029:16): [True: 0, False: 1.32k]
  ------------------
 1030|      0|            switch(s[0]) {
 1031|      0|            default:
  ------------------
  |  Branch (1031:13): [True: 0, False: 0]
  ------------------
 1032|      0|                break;
 1033|      0|            case 'p':
  ------------------
  |  Branch (1033:13): [True: 0, False: 0]
  ------------------
 1034|      0|                if (ossl_likely(strcmp("roperties", s + 1) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1035|       |                    /* OSSL_PKEY_PARAM_PROPERTIES */
 1036|      0|                    if (ossl_unlikely(r->propq != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1037|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
 1038|      0|                                       "param %s is repeated", s);
 1039|      0|                        return 0;
 1040|      0|                    }
 1041|      0|                    r->propq = (OSSL_PARAM *)p;
 1042|      0|                }
 1043|      0|                break;
 1044|      0|            case 's':
  ------------------
  |  Branch (1044:13): [True: 0, False: 0]
  ------------------
 1045|      0|                if (ossl_likely(strcmp("eed", s + 1) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1046|       |                    /* OSSL_PKEY_PARAM_ML_DSA_SEED */
 1047|      0|                    if (ossl_unlikely(r->seed != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1048|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
 1049|      0|                                       "param %s is repeated", s);
 1050|      0|                        return 0;
 1051|      0|                    }
 1052|      0|                    r->seed = (OSSL_PARAM *)p;
 1053|      0|                }
 1054|      0|            }
 1055|  2.65k|    return 1;
 1056|  2.65k|}
ml_kem_kmgmt.c:ml_kem_gen:
 1125|  1.32k|{
 1126|  1.32k|    PROV_ML_KEM_GEN_CTX *gctx = vgctx;
 1127|  1.32k|    ML_KEM_KEY *key;
 1128|  1.32k|    uint8_t *nopub = NULL;
 1129|  1.32k|    uint8_t *seed;
 1130|  1.32k|    int genok = 0;
 1131|       |
 1132|  1.32k|    if (gctx == NULL
  ------------------
  |  Branch (1132:9): [True: 0, False: 1.32k]
  ------------------
 1133|  1.32k|        || (gctx->selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  ------------------
  |  |  650|  1.32k|    (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  640|  1.32k|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  641|  1.32k|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  |  |  ------------------
  ------------------
                      || (gctx->selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  ------------------
  |  |  641|  1.32k|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  ------------------
  |  Branch (1133:12): [True: 0, False: 1.32k]
  ------------------
 1134|      0|        return NULL;
 1135|  1.32k|    seed = gctx->seed;
 1136|  1.32k|    key = ossl_prov_ml_kem_new(gctx->provctx, gctx->propq, gctx->evp_type);
 1137|  1.32k|    if (key == NULL)
  ------------------
  |  Branch (1137:9): [True: 0, False: 1.32k]
  ------------------
 1138|      0|        return NULL;
 1139|       |
 1140|  1.32k|    if ((gctx->selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0)
  ------------------
  |  |  650|  1.32k|    (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  640|  1.32k|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  641|  1.32k|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  |  |  ------------------
  ------------------
  |  Branch (1140:9): [True: 0, False: 1.32k]
  ------------------
 1141|      0|        return key;
 1142|       |
 1143|  1.32k|    if (seed != NULL && !ossl_ml_kem_set_seed(seed, ML_KEM_SEED_BYTES, key))
  ------------------
  |  |   48|      0|#define ML_KEM_SEED_BYTES (ML_KEM_RANDOM_BYTES * 2) /* Keygen (d, z) */
  |  |  ------------------
  |  |  |  |   47|      0|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  |  |  ------------------
  ------------------
  |  Branch (1143:9): [True: 0, False: 1.32k]
  |  Branch (1143:25): [True: 0, False: 0]
  ------------------
 1144|      0|        return NULL;
 1145|  1.32k|    genok = ossl_ml_kem_genkey(nopub, 0, key);
 1146|       |
 1147|       |    /* Erase the single-use seed */
 1148|  1.32k|    if (seed != NULL)
  ------------------
  |  Branch (1148:9): [True: 0, False: 1.32k]
  ------------------
 1149|      0|        OPENSSL_cleanse(seed, ML_KEM_SEED_BYTES);
  ------------------
  |  |   48|      0|#define ML_KEM_SEED_BYTES (ML_KEM_RANDOM_BYTES * 2) /* Keygen (d, z) */
  |  |  ------------------
  |  |  |  |   47|      0|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  |  |  ------------------
  ------------------
 1150|  1.32k|    gctx->seed = NULL;
 1151|       |
 1152|  1.32k|    if (genok) {
  ------------------
  |  Branch (1152:9): [True: 1.32k, False: 0]
  ------------------
 1153|       |#ifdef FIPS_MODULE
 1154|       |        if (!ml_kem_pairwise_test(key, ML_KEM_KEY_FIXED_PCT)) {
 1155|       |            ossl_set_error_state(OSSL_SELF_TEST_TYPE_PCT);
 1156|       |            ossl_ml_kem_key_free(key);
 1157|       |            return NULL;
 1158|       |        }
 1159|       |#endif /* FIPS_MODULE */
 1160|  1.32k|        return key;
 1161|  1.32k|    }
 1162|       |
 1163|      0|    ossl_ml_kem_key_free(key);
 1164|       |    return NULL;
 1165|  1.32k|}
ml_kem_kmgmt.c:ml_kem_gen_cleanup:
 1168|  1.32k|{
 1169|  1.32k|    PROV_ML_KEM_GEN_CTX *gctx = vgctx;
 1170|       |
 1171|  1.32k|    if (gctx == NULL)
  ------------------
  |  Branch (1171:9): [True: 0, False: 1.32k]
  ------------------
 1172|      0|        return;
 1173|       |
 1174|  1.32k|    if (gctx->seed != NULL)
  ------------------
  |  Branch (1174:9): [True: 0, False: 1.32k]
  ------------------
 1175|      0|        OPENSSL_cleanse(gctx->seed, ML_KEM_SEED_BYTES);
  ------------------
  |  |   48|      0|#define ML_KEM_SEED_BYTES (ML_KEM_RANDOM_BYTES * 2) /* Keygen (d, z) */
  |  |  ------------------
  |  |  |  |   47|      0|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  |  |  ------------------
  ------------------
 1176|  1.32k|    OPENSSL_free(gctx->propq);
  ------------------
  |  |  131|  1.32k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1177|  1.32k|    OPENSSL_free(gctx);
  ------------------
  |  |  131|  1.32k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1178|  1.32k|}
ml_kem_kmgmt.c:ml_kem_export:
  243|  1.32k|{
  244|  1.32k|    ML_KEM_KEY *key = vkey;
  245|  1.32k|    OSSL_PARAM_BLD *tmpl = NULL;
  246|  1.32k|    OSSL_PARAM *params = NULL;
  247|  1.32k|    const ML_KEM_VINFO *v;
  248|  1.32k|    uint8_t *pubenc = NULL, *prvenc = NULL, *seedenc = NULL;
  249|  1.32k|    size_t prvlen = 0, seedlen = 0;
  250|  1.32k|    int ret = 0;
  251|       |
  252|  1.32k|    if (!ossl_prov_is_running() || key == NULL)
  ------------------
  |  Branch (252:9): [True: 0, False: 1.32k]
  |  Branch (252:36): [True: 0, False: 1.32k]
  ------------------
  253|      0|        return 0;
  254|       |
  255|  1.32k|    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0)
  ------------------
  |  |  650|  1.32k|    (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  640|  1.32k|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  641|  1.32k|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  |  |  ------------------
  ------------------
  |  Branch (255:9): [True: 0, False: 1.32k]
  ------------------
  256|      0|        return 0;
  257|       |
  258|  1.32k|    v = ossl_ml_kem_key_vinfo(key);
  ------------------
  |  |  206|  1.32k|#define ossl_ml_kem_key_vinfo(key) ((key)->vinfo)
  ------------------
  259|  1.32k|    if (!ossl_ml_kem_have_pubkey(key)) {
  ------------------
  |  |  207|  1.32k|#define ossl_ml_kem_have_pubkey(key) ((key)->t != NULL)
  ------------------
  |  Branch (259:9): [True: 0, False: 1.32k]
  ------------------
  260|       |        /* Fail when no key material can be returned */
  261|      0|        if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) == 0
  ------------------
  |  |  640|      0|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  ------------------
  |  Branch (261:13): [True: 0, False: 0]
  ------------------
  262|      0|            || !ossl_ml_kem_decoded_key(key)) {
  ------------------
  |  |  211|      0|#define ossl_ml_kem_decoded_key(key) ((key)->encoded_dk != NULL \
  |  |  ------------------
  |  |  |  Branch (211:39): [True: 0, False: 0]
  |  |  ------------------
  |  |  212|      0|    || ((key)->s == NULL && (key)->d != NULL))
  |  |  ------------------
  |  |  |  Branch (212:9): [True: 0, False: 0]
  |  |  |  Branch (212:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  263|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_KEY);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  264|      0|            return 0;
  265|      0|        }
  266|  1.32k|    } else if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
  ------------------
  |  |  641|  1.32k|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  ------------------
  |  Branch (266:16): [True: 1.32k, False: 0]
  ------------------
  267|  1.32k|        pubenc = OPENSSL_malloc(v->pubkey_bytes);
  ------------------
  |  |  106|  1.32k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  268|  1.32k|        if (pubenc == NULL
  ------------------
  |  Branch (268:13): [True: 0, False: 1.32k]
  ------------------
  269|  1.32k|            || !ossl_ml_kem_encode_public_key(pubenc, v->pubkey_bytes, key))
  ------------------
  |  Branch (269:16): [True: 0, False: 1.32k]
  ------------------
  270|      0|            goto err;
  271|  1.32k|    }
  272|       |
  273|  1.32k|    if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  640|  1.32k|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  ------------------
  |  Branch (273:9): [True: 0, False: 1.32k]
  ------------------
  274|       |        /*
  275|       |         * The seed and/or private key material are allocated on the secure
  276|       |         * heap if configured, ossl_param_build_set_octet_string(), will then
  277|       |         * also use the secure heap.
  278|       |         */
  279|      0|        if (ossl_ml_kem_have_seed(key)) {
  ------------------
  |  |  209|      0|#define ossl_ml_kem_have_seed(key) ((key)->d != NULL)
  |  |  ------------------
  |  |  |  Branch (209:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  280|      0|            seedlen = ML_KEM_SEED_BYTES;
  ------------------
  |  |   48|      0|#define ML_KEM_SEED_BYTES (ML_KEM_RANDOM_BYTES * 2) /* Keygen (d, z) */
  |  |  ------------------
  |  |  |  |   47|      0|#define ML_KEM_RANDOM_BYTES 32 /* rho, sigma, ... */
  |  |  ------------------
  ------------------
  281|      0|            if ((seedenc = OPENSSL_secure_zalloc(seedlen)) == NULL
  ------------------
  |  |  141|      0|    CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (281:17): [True: 0, False: 0]
  ------------------
  282|      0|                || !ossl_ml_kem_encode_seed(seedenc, seedlen, key))
  ------------------
  |  Branch (282:20): [True: 0, False: 0]
  ------------------
  283|      0|                goto err;
  284|      0|        }
  285|      0|        if (ossl_ml_kem_have_prvkey(key)) {
  ------------------
  |  |  208|      0|#define ossl_ml_kem_have_prvkey(key) ((key)->s != NULL)
  |  |  ------------------
  |  |  |  Branch (208:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  286|      0|            prvlen = v->prvkey_bytes;
  287|      0|            if ((prvenc = OPENSSL_secure_zalloc(prvlen)) == NULL
  ------------------
  |  |  141|      0|    CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (287:17): [True: 0, False: 0]
  ------------------
  288|      0|                || !ossl_ml_kem_encode_private_key(prvenc, prvlen, key))
  ------------------
  |  Branch (288:20): [True: 0, False: 0]
  ------------------
  289|      0|                goto err;
  290|      0|        } else if (ossl_ml_kem_have_dkenc(key)) {
  ------------------
  |  |  210|      0|#define ossl_ml_kem_have_dkenc(key) ((key)->encoded_dk != NULL)
  |  |  ------------------
  |  |  |  Branch (210:37): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  291|      0|            prvlen = v->prvkey_bytes;
  292|      0|            if ((prvenc = OPENSSL_secure_zalloc(prvlen)) == NULL)
  ------------------
  |  |  141|      0|    CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (292:17): [True: 0, False: 0]
  ------------------
  293|      0|                goto err;
  294|      0|            memcpy(prvenc, key->encoded_dk, prvlen);
  295|      0|        }
  296|      0|    }
  297|       |
  298|  1.32k|    tmpl = OSSL_PARAM_BLD_new();
  299|  1.32k|    if (tmpl == NULL)
  ------------------
  |  Branch (299:9): [True: 0, False: 1.32k]
  ------------------
  300|      0|        goto err;
  301|       |
  302|       |    /* The (d, z) seed, when available and private keys are requested. */
  303|  1.32k|    if (seedenc != NULL
  ------------------
  |  Branch (303:9): [True: 0, False: 1.32k]
  ------------------
  304|      0|        && !ossl_param_build_set_octet_string(
  ------------------
  |  Branch (304:12): [True: 0, False: 0]
  ------------------
  305|      0|            tmpl, params, OSSL_PKEY_PARAM_ML_KEM_SEED, seedenc, seedlen))
  ------------------
  |  |  437|      0|# define OSSL_PKEY_PARAM_ML_KEM_SEED "seed"
  ------------------
  306|      0|        goto err;
  307|       |
  308|       |    /* The private key in the FIPS 203 |dk| format, when requested. */
  309|  1.32k|    if (prvenc != NULL
  ------------------
  |  Branch (309:9): [True: 0, False: 1.32k]
  ------------------
  310|      0|        && !ossl_param_build_set_octet_string(
  ------------------
  |  Branch (310:12): [True: 0, False: 0]
  ------------------
  311|      0|            tmpl, params, OSSL_PKEY_PARAM_PRIV_KEY, prvenc, prvlen))
  ------------------
  |  |  439|      0|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  312|      0|        goto err;
  313|       |
  314|       |    /* The public key on request; it is always available when either is */
  315|  1.32k|    if (pubenc != NULL
  ------------------
  |  Branch (315:9): [True: 1.32k, False: 0]
  ------------------
  316|  1.32k|        && !ossl_param_build_set_octet_string(
  ------------------
  |  Branch (316:12): [True: 0, False: 1.32k]
  ------------------
  317|  1.32k|            tmpl, params, OSSL_PKEY_PARAM_PUB_KEY, pubenc, v->pubkey_bytes))
  ------------------
  |  |  441|  1.32k|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  318|      0|        goto err;
  319|       |
  320|  1.32k|    params = OSSL_PARAM_BLD_to_param(tmpl);
  321|  1.32k|    if (params == NULL)
  ------------------
  |  Branch (321:9): [True: 0, False: 1.32k]
  ------------------
  322|      0|        goto err;
  323|       |
  324|  1.32k|    ret = param_cb(params, cbarg);
  325|  1.32k|    OSSL_PARAM_free(params);
  326|       |
  327|  1.32k|err:
  328|  1.32k|    OSSL_PARAM_BLD_free(tmpl);
  329|  1.32k|    OPENSSL_secure_clear_free(seedenc, seedlen);
  ------------------
  |  |  149|  1.32k|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  330|  1.32k|    OPENSSL_secure_clear_free(prvenc, prvlen);
  ------------------
  |  |  149|  1.32k|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  331|  1.32k|    OPENSSL_free(pubenc);
  ------------------
  |  |  131|  1.32k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  332|  1.32k|    return ret;
  333|  1.32k|}
ml_kem_kmgmt.c:ml_kem_768_gen_init:
 1206|  1.32k|    {                                                                                     \
 1207|  1.32k|        return ml_kem_gen_init(provctx, selection, params,                                \
 1208|  1.32k|            EVP_PKEY_ML_KEM_##bits);                                                      \
  ------------------
  |  |  103|  1.32k|#define EVP_PKEY_ML_KEM_768 NID_ML_KEM_768
  |  |  ------------------
  |  |  |  | 6641|  1.32k|#define NID_ML_KEM_768          1455
  |  |  ------------------
  ------------------
 1209|  1.32k|    }                                                                                     \

mlx_kmgmt.c:mlx_kem_key_new:
   80|  1.32k|{
   81|  1.32k|    MLX_KEY *key = NULL;
   82|  1.32k|    unsigned int ml_kem_variant;
   83|       |
   84|  1.32k|    if (!ossl_prov_is_running()
  ------------------
  |  Branch (84:9): [True: 0, False: 1.32k]
  ------------------
   85|  1.32k|        || v >= OSSL_NELEM(hybrid_vtable)
  ------------------
  |  |   14|  2.65k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (85:12): [True: 0, False: 1.32k]
  ------------------
   86|  1.32k|        || (key = OPENSSL_malloc(sizeof(*key))) == NULL)
  ------------------
  |  |  106|  1.32k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (86:12): [True: 0, False: 1.32k]
  ------------------
   87|      0|        goto err;
   88|       |
   89|  1.32k|    ml_kem_variant = hybrid_vtable[v].ml_kem_variant;
   90|  1.32k|    key->libctx = libctx;
   91|  1.32k|    key->minfo = ossl_ml_kem_get_vinfo(ml_kem_variant);
   92|  1.32k|    key->xinfo = &hybrid_vtable[v];
   93|  1.32k|    key->xkey = key->mkey = NULL;
   94|  1.32k|    key->state = MLX_HAVE_NOKEYS;
  ------------------
  |  |   39|  1.32k|#define MLX_HAVE_NOKEYS 0
  ------------------
   95|  1.32k|    key->propq = propq;
   96|  1.32k|    return key;
   97|       |
   98|      0|err:
   99|      0|    OPENSSL_free(propq);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  100|       |    return NULL;
  101|  1.32k|}
mlx_kmgmt.c:mlx_kem_key_free:
   66|  1.32k|{
   67|  1.32k|    MLX_KEY *key = vkey;
   68|       |
   69|  1.32k|    if (key == NULL)
  ------------------
  |  Branch (69:9): [True: 0, False: 1.32k]
  ------------------
   70|      0|        return;
   71|  1.32k|    OPENSSL_free(key->propq);
  ------------------
  |  |  131|  1.32k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   72|  1.32k|    EVP_PKEY_free(key->mkey);
   73|  1.32k|    EVP_PKEY_free(key->xkey);
   74|  1.32k|    OPENSSL_free(key);
  ------------------
  |  |  131|  1.32k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   75|  1.32k|}
mlx_kmgmt.c:mlx_kem_get_params:
  696|  3.98k|{
  697|  3.98k|    MLX_KEY *key = vkey;
  698|  3.98k|    OSSL_PARAM *pub, *prv = NULL;
  699|  3.98k|    EXPORT_CB_ARG sub_arg;
  700|  3.98k|    int selection;
  701|  3.98k|    struct mlx_get_params_st p;
  702|       |
  703|  3.98k|    if (key == NULL || !mlx_get_params_decoder(params, &p))
  ------------------
  |  Branch (703:9): [True: 0, False: 3.98k]
  |  Branch (703:24): [True: 0, False: 3.98k]
  ------------------
  704|      0|        return 0;
  705|       |
  706|       |    /* The reported "bit" count is those of the ML-KEM key */
  707|  3.98k|    if (p.bits != NULL)
  ------------------
  |  Branch (707:9): [True: 1.32k, False: 2.65k]
  ------------------
  708|  1.32k|        if (!OSSL_PARAM_set_int(p.bits, key->minfo->bits))
  ------------------
  |  Branch (708:13): [True: 0, False: 1.32k]
  ------------------
  709|      0|            return 0;
  710|       |
  711|       |    /* The reported security bits are those of the ML-KEM key */
  712|  3.98k|    if (p.secbits != NULL)
  ------------------
  |  Branch (712:9): [True: 1.32k, False: 2.65k]
  ------------------
  713|  1.32k|        if (!OSSL_PARAM_set_int(p.secbits, key->minfo->secbits))
  ------------------
  |  Branch (713:13): [True: 0, False: 1.32k]
  ------------------
  714|      0|            return 0;
  715|       |
  716|       |    /* The reported security category are those of the ML-KEM key */
  717|  3.98k|    if (p.seccat != NULL)
  ------------------
  |  Branch (717:9): [True: 1.32k, False: 2.65k]
  ------------------
  718|  1.32k|        if (!OSSL_PARAM_set_int(p.seccat, key->minfo->security_category))
  ------------------
  |  Branch (718:13): [True: 0, False: 1.32k]
  ------------------
  719|      0|            return 0;
  720|       |
  721|       |    /* The ciphertext sizes are additive */
  722|  3.98k|    if (p.maxsize != NULL)
  ------------------
  |  Branch (722:9): [True: 1.32k, False: 2.65k]
  ------------------
  723|  1.32k|        if (!OSSL_PARAM_set_size_t(p.maxsize, key->minfo->ctext_bytes + key->xinfo->pubkey_bytes))
  ------------------
  |  Branch (723:13): [True: 0, False: 1.32k]
  ------------------
  724|      0|            return 0;
  725|       |
  726|  3.98k|    if (!mlx_kem_have_pubkey(key))
  ------------------
  |  |   44|  3.98k|#define mlx_kem_have_pubkey(key) ((key)->state > 0)
  ------------------
  |  Branch (726:9): [True: 0, False: 3.98k]
  ------------------
  727|      0|        return 1;
  728|       |
  729|  3.98k|    memset(&sub_arg, 0, sizeof(sub_arg));
  730|  3.98k|    if ((pub = p.pub) != NULL) {
  ------------------
  |  Branch (730:9): [True: 2.65k, False: 1.32k]
  ------------------
  731|  2.65k|        size_t publen = key->minfo->pubkey_bytes + key->xinfo->pubkey_bytes;
  732|       |
  733|  2.65k|        if (pub->data_type != OSSL_PARAM_OCTET_STRING)
  ------------------
  |  |  123|  2.65k|#define OSSL_PARAM_OCTET_STRING 5
  ------------------
  |  Branch (733:13): [True: 0, False: 2.65k]
  ------------------
  734|      0|            return 0;
  735|  2.65k|        pub->return_size = publen;
  736|  2.65k|        if (pub->data == NULL) {
  ------------------
  |  Branch (736:13): [True: 1.32k, False: 1.32k]
  ------------------
  737|  1.32k|            pub = NULL;
  738|  1.32k|        } else if (pub->data_size < publen) {
  ------------------
  |  Branch (738:20): [True: 0, False: 1.32k]
  ------------------
  739|      0|            ERR_raise_data(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL,
  ------------------
  |  |  127|      0|#define PROV_R_OUTPUT_BUFFER_TOO_SMALL 106
  ------------------
  740|      0|                "public key output buffer too short: %lu < %lu",
  741|      0|                (unsigned long)pub->data_size,
  742|      0|                (unsigned long)publen);
  743|      0|            return 0;
  744|  1.32k|        } else {
  745|  1.32k|            sub_arg.pubenc = pub->data;
  746|  1.32k|        }
  747|  2.65k|    }
  748|  3.98k|    if (mlx_kem_have_prvkey(key)) {
  ------------------
  |  |   45|  3.98k|#define mlx_kem_have_prvkey(key) ((key)->state > 1)
  |  |  ------------------
  |  |  |  Branch (45:34): [True: 3.98k, False: 0]
  |  |  ------------------
  ------------------
  749|  3.98k|        if ((prv = p.priv) != NULL) {
  ------------------
  |  Branch (749:13): [True: 0, False: 3.98k]
  ------------------
  750|      0|            size_t prvlen = key->minfo->prvkey_bytes + key->xinfo->prvkey_bytes;
  751|       |
  752|      0|            if (prv->data_type != OSSL_PARAM_OCTET_STRING)
  ------------------
  |  |  123|      0|#define OSSL_PARAM_OCTET_STRING 5
  ------------------
  |  Branch (752:17): [True: 0, False: 0]
  ------------------
  753|      0|                return 0;
  754|      0|            prv->return_size = prvlen;
  755|      0|            if (prv->data == NULL) {
  ------------------
  |  Branch (755:17): [True: 0, False: 0]
  ------------------
  756|      0|                prv = NULL;
  757|      0|            } else if (prv->data_size < prvlen) {
  ------------------
  |  Branch (757:24): [True: 0, False: 0]
  ------------------
  758|      0|                ERR_raise_data(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                              ERR_raise_data(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                              ERR_raise_data(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL,
  ------------------
  |  |  127|      0|#define PROV_R_OUTPUT_BUFFER_TOO_SMALL 106
  ------------------
  759|      0|                    "private key output buffer too short: %lu < %lu",
  760|      0|                    (unsigned long)prv->data_size,
  761|      0|                    (unsigned long)prvlen);
  762|      0|                return 0;
  763|      0|            } else {
  764|      0|                sub_arg.prvenc = prv->data;
  765|      0|            }
  766|      0|        }
  767|  3.98k|    }
  768|  3.98k|    if (pub == NULL && prv == NULL)
  ------------------
  |  Branch (768:9): [True: 2.65k, False: 1.32k]
  |  Branch (768:24): [True: 2.65k, False: 0]
  ------------------
  769|  2.65k|        return 1;
  770|       |
  771|  1.32k|    selection = prv == NULL ? 0 : OSSL_KEYMGMT_SELECT_PRIVATE_KEY;
  ------------------
  |  |  640|  1.32k|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  ------------------
  |  Branch (771:17): [True: 1.32k, False: 0]
  ------------------
  772|  1.32k|    selection |= pub == NULL ? 0 : OSSL_KEYMGMT_SELECT_PUBLIC_KEY;
  ------------------
  |  |  641|  2.65k|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  ------------------
  |  Branch (772:18): [True: 0, False: 1.32k]
  ------------------
  773|  1.32k|    if (key->xinfo->group_name != NULL)
  ------------------
  |  Branch (773:9): [True: 0, False: 1.32k]
  ------------------
  774|      0|        selection |= OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS;
  ------------------
  |  |  642|      0|#define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS 0x04
  ------------------
  775|       |
  776|       |    /* Extract sub-component key material */
  777|  1.32k|    if (!export_sub(&sub_arg, selection, key))
  ------------------
  |  Branch (777:9): [True: 0, False: 1.32k]
  ------------------
  778|      0|        return 0;
  779|       |
  780|  1.32k|    if ((pub != NULL && sub_arg.pubcount != 2)
  ------------------
  |  Branch (780:10): [True: 1.32k, False: 0]
  |  Branch (780:25): [True: 0, False: 1.32k]
  ------------------
  781|  1.32k|        || (prv != NULL && sub_arg.prvcount != 2))
  ------------------
  |  Branch (781:13): [True: 0, False: 1.32k]
  |  Branch (781:28): [True: 0, False: 0]
  ------------------
  782|      0|        return 0;
  783|       |
  784|  1.32k|    return 1;
  785|  1.32k|}
mlx_kmgmt.c:mlx_get_params_decoder:
  561|  3.98k|{
  562|  3.98k|    const char *s;
  563|       |
  564|  3.98k|    memset(r, 0, sizeof(*r));
  565|  3.98k|    if (p != NULL)
  ------------------
  |  Branch (565:9): [True: 3.98k, False: 0]
  ------------------
  566|  11.9k|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (566:16): [True: 7.96k, False: 3.98k]
  ------------------
  567|  7.96k|            switch(s[0]) {
  568|      0|            default:
  ------------------
  |  Branch (568:13): [True: 0, False: 7.96k]
  ------------------
  569|      0|                break;
  570|  1.32k|            case 'b':
  ------------------
  |  Branch (570:13): [True: 1.32k, False: 6.63k]
  ------------------
  571|  1.32k|                if (ossl_likely(strcmp("its", s + 1) == 0)) {
  ------------------
  |  |   22|  1.32k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 1.32k, False: 0]
  |  |  ------------------
  ------------------
  572|       |                    /* OSSL_PKEY_PARAM_BITS */
  573|  1.32k|                    if (ossl_unlikely(r->bits != NULL)) {
  ------------------
  |  |   23|  1.32k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.32k]
  |  |  ------------------
  ------------------
  574|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  575|      0|                                       "param %s is repeated", s);
  576|      0|                        return 0;
  577|      0|                    }
  578|  1.32k|                    r->bits = (OSSL_PARAM *)p;
  579|  1.32k|                }
  580|  1.32k|                break;
  581|  2.65k|            case 'e':
  ------------------
  |  Branch (581:13): [True: 2.65k, False: 5.30k]
  ------------------
  582|  2.65k|                if (ossl_likely(strcmp("ncoded-pub-key", s + 1) == 0)) {
  ------------------
  |  |   22|  2.65k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 2.65k, False: 0]
  |  |  ------------------
  ------------------
  583|       |                    /* OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY */
  584|  2.65k|                    if (ossl_unlikely(r->pub != NULL)) {
  ------------------
  |  |   23|  2.65k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 2.65k]
  |  |  ------------------
  ------------------
  585|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  586|      0|                                       "param %s is repeated", s);
  587|      0|                        return 0;
  588|      0|                    }
  589|  2.65k|                    r->pub = (OSSL_PARAM *)p;
  590|  2.65k|                }
  591|  2.65k|                break;
  592|  2.65k|            case 'm':
  ------------------
  |  Branch (592:13): [True: 1.32k, False: 6.63k]
  ------------------
  593|  1.32k|                if (ossl_likely(strcmp("ax-size", s + 1) == 0)) {
  ------------------
  |  |   22|  1.32k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 1.32k, False: 0]
  |  |  ------------------
  ------------------
  594|       |                    /* OSSL_PKEY_PARAM_MAX_SIZE */
  595|  1.32k|                    if (ossl_unlikely(r->maxsize != NULL)) {
  ------------------
  |  |   23|  1.32k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.32k]
  |  |  ------------------
  ------------------
  596|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  597|      0|                                       "param %s is repeated", s);
  598|      0|                        return 0;
  599|      0|                    }
  600|  1.32k|                    r->maxsize = (OSSL_PARAM *)p;
  601|  1.32k|                }
  602|  1.32k|                break;
  603|  1.32k|            case 'p':
  ------------------
  |  Branch (603:13): [True: 0, False: 7.96k]
  ------------------
  604|      0|                if (ossl_likely(strcmp("riv", s + 1) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  605|       |                    /* OSSL_PKEY_PARAM_PRIV_KEY */
  606|      0|                    if (ossl_unlikely(r->priv != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  607|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  608|      0|                                       "param %s is repeated", s);
  609|      0|                        return 0;
  610|      0|                    }
  611|      0|                    r->priv = (OSSL_PARAM *)p;
  612|      0|                }
  613|      0|                break;
  614|  2.65k|            case 's':
  ------------------
  |  Branch (614:13): [True: 2.65k, False: 5.30k]
  ------------------
  615|  2.65k|                switch(s[1]) {
  616|      0|                default:
  ------------------
  |  Branch (616:17): [True: 0, False: 2.65k]
  ------------------
  617|      0|                    break;
  618|  2.65k|                case 'e':
  ------------------
  |  Branch (618:17): [True: 2.65k, False: 0]
  ------------------
  619|  2.65k|                    switch(s[2]) {
  620|      0|                    default:
  ------------------
  |  Branch (620:21): [True: 0, False: 2.65k]
  ------------------
  621|      0|                        break;
  622|  2.65k|                    case 'c':
  ------------------
  |  Branch (622:21): [True: 2.65k, False: 0]
  ------------------
  623|  2.65k|                        switch(s[3]) {
  624|      0|                        default:
  ------------------
  |  Branch (624:25): [True: 0, False: 2.65k]
  ------------------
  625|      0|                            break;
  626|  2.65k|                        case 'u':
  ------------------
  |  Branch (626:25): [True: 2.65k, False: 0]
  ------------------
  627|  2.65k|                            switch(s[4]) {
  628|      0|                            default:
  ------------------
  |  Branch (628:29): [True: 0, False: 2.65k]
  ------------------
  629|      0|                                break;
  630|  2.65k|                            case 'r':
  ------------------
  |  Branch (630:29): [True: 2.65k, False: 0]
  ------------------
  631|  2.65k|                                switch(s[5]) {
  632|      0|                                default:
  ------------------
  |  Branch (632:33): [True: 0, False: 2.65k]
  ------------------
  633|      0|                                    break;
  634|  2.65k|                                case 'i':
  ------------------
  |  Branch (634:33): [True: 2.65k, False: 0]
  ------------------
  635|  2.65k|                                    switch(s[6]) {
  636|      0|                                    default:
  ------------------
  |  Branch (636:37): [True: 0, False: 2.65k]
  ------------------
  637|      0|                                        break;
  638|  2.65k|                                    case 't':
  ------------------
  |  Branch (638:37): [True: 2.65k, False: 0]
  ------------------
  639|  2.65k|                                        switch(s[7]) {
  640|      0|                                        default:
  ------------------
  |  Branch (640:41): [True: 0, False: 2.65k]
  ------------------
  641|      0|                                            break;
  642|  2.65k|                                        case 'y':
  ------------------
  |  Branch (642:41): [True: 2.65k, False: 0]
  ------------------
  643|  2.65k|                                            switch(s[8]) {
  644|      0|                                            default:
  ------------------
  |  Branch (644:45): [True: 0, False: 2.65k]
  ------------------
  645|      0|                                                break;
  646|  2.65k|                                            case '-':
  ------------------
  |  Branch (646:45): [True: 2.65k, False: 0]
  ------------------
  647|  2.65k|                                                switch(s[9]) {
  648|      0|                                                default:
  ------------------
  |  Branch (648:49): [True: 0, False: 2.65k]
  ------------------
  649|      0|                                                    break;
  650|  1.32k|                                                case 'b':
  ------------------
  |  Branch (650:49): [True: 1.32k, False: 1.32k]
  ------------------
  651|  1.32k|                                                    if (ossl_likely(strcmp("its", s + 10) == 0)) {
  ------------------
  |  |   22|  1.32k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 1.32k, False: 0]
  |  |  ------------------
  ------------------
  652|       |                                                        /* OSSL_PKEY_PARAM_SECURITY_BITS */
  653|  1.32k|                                                        if (ossl_unlikely(r->secbits != NULL)) {
  ------------------
  |  |   23|  1.32k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.32k]
  |  |  ------------------
  ------------------
  654|      0|                                                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  655|      0|                                                                           "param %s is repeated", s);
  656|      0|                                                            return 0;
  657|      0|                                                        }
  658|  1.32k|                                                        r->secbits = (OSSL_PARAM *)p;
  659|  1.32k|                                                    }
  660|  1.32k|                                                    break;
  661|  1.32k|                                                case 'c':
  ------------------
  |  Branch (661:49): [True: 1.32k, False: 1.32k]
  ------------------
  662|  1.32k|                                                    if (ossl_likely(strcmp("ategory", s + 10) == 0)) {
  ------------------
  |  |   22|  1.32k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 1.32k, False: 0]
  |  |  ------------------
  ------------------
  663|       |                                                        /* OSSL_PKEY_PARAM_SECURITY_CATEGORY */
  664|  1.32k|                                                        if (ossl_unlikely(r->seccat != NULL)) {
  ------------------
  |  |   23|  1.32k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.32k]
  |  |  ------------------
  ------------------
  665|      0|                                                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  666|      0|                                                                           "param %s is repeated", s);
  667|      0|                                                            return 0;
  668|      0|                                                        }
  669|  1.32k|                                                        r->seccat = (OSSL_PARAM *)p;
  670|  1.32k|                                                    }
  671|  2.65k|                                                }
  672|  2.65k|                                            }
  673|  2.65k|                                        }
  674|  2.65k|                                    }
  675|  2.65k|                                }
  676|  2.65k|                            }
  677|  2.65k|                        }
  678|  2.65k|                    }
  679|  2.65k|                }
  680|  7.96k|            }
  681|  3.98k|    return 1;
  682|  3.98k|}
mlx_kmgmt.c:export_sub:
  271|  1.32k|{
  272|  1.32k|    int slot;
  273|       |
  274|       |    /*
  275|       |     * The caller is responsible for initialising only the pubenc and prvenc
  276|       |     * pointer fields, the rest are set here or in the callback.
  277|       |     */
  278|  1.32k|    sub_arg->pubcount = 0;
  279|  1.32k|    sub_arg->prvcount = 0;
  280|       |
  281|  3.98k|    for (slot = 0; slot < 2; ++slot) {
  ------------------
  |  Branch (281:20): [True: 2.65k, False: 1.32k]
  ------------------
  282|  2.65k|        int ml_kem_slot = key->xinfo->ml_kem_slot;
  283|  2.65k|        EVP_PKEY *pkey;
  284|       |
  285|       |        /* Export the parts of each component into its storage slot */
  286|  2.65k|        if (slot == ml_kem_slot) {
  ------------------
  |  Branch (286:13): [True: 1.32k, False: 1.32k]
  ------------------
  287|  1.32k|            pkey = key->mkey;
  288|  1.32k|            sub_arg->algorithm_name = key->minfo->algorithm_name;
  289|  1.32k|            sub_arg->puboff = slot * key->xinfo->pubkey_bytes;
  290|  1.32k|            sub_arg->prvoff = slot * key->xinfo->prvkey_bytes;
  291|  1.32k|            sub_arg->publen = key->minfo->pubkey_bytes;
  292|  1.32k|            sub_arg->prvlen = key->minfo->prvkey_bytes;
  293|  1.32k|        } else {
  294|  1.32k|            pkey = key->xkey;
  295|  1.32k|            sub_arg->algorithm_name = key->xinfo->algorithm_name;
  296|  1.32k|            sub_arg->puboff = (1 - ml_kem_slot) * key->minfo->pubkey_bytes;
  297|  1.32k|            sub_arg->prvoff = (1 - ml_kem_slot) * key->minfo->prvkey_bytes;
  298|  1.32k|            sub_arg->publen = key->xinfo->pubkey_bytes;
  299|  1.32k|            sub_arg->prvlen = key->xinfo->prvkey_bytes;
  300|  1.32k|        }
  301|  2.65k|        if (!EVP_PKEY_export(pkey, selection, export_sub_cb, (void *)sub_arg))
  ------------------
  |  Branch (301:13): [True: 0, False: 2.65k]
  ------------------
  302|      0|            return 0;
  303|  2.65k|    }
  304|  1.32k|    return 1;
  305|  1.32k|}
mlx_kmgmt.c:export_sub_cb:
  225|  2.65k|{
  226|  2.65k|    EXPORT_CB_ARG *sub_arg = varg;
  227|  2.65k|    struct ml_kem_import_export_st p;
  228|  2.65k|    size_t len;
  229|       |
  230|  2.65k|    if (!ml_kem_import_export_decoder(params, &p))
  ------------------
  |  Branch (230:9): [True: 0, False: 2.65k]
  ------------------
  231|      0|        return 0;
  232|       |
  233|       |    /*
  234|       |     * The caller will decide whether anything essential is missing, but, if
  235|       |     * some key material was returned, it should have the right (parameter)
  236|       |     * data type and length.
  237|       |     */
  238|  2.65k|    if (sub_arg->pubenc != NULL && p.pubkey != NULL) {
  ------------------
  |  Branch (238:9): [True: 2.65k, False: 0]
  |  Branch (238:36): [True: 2.65k, False: 0]
  ------------------
  239|  2.65k|        void *pub = sub_arg->pubenc + sub_arg->puboff;
  240|       |
  241|  2.65k|        if (OSSL_PARAM_get_octet_string(p.pubkey, &pub, sub_arg->publen, &len) != 1)
  ------------------
  |  Branch (241:13): [True: 0, False: 2.65k]
  ------------------
  242|      0|            return 0;
  243|  2.65k|        if (len != sub_arg->publen) {
  ------------------
  |  Branch (243:13): [True: 0, False: 2.65k]
  ------------------
  244|      0|            ERR_raise_data(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  355|      0|#define ERR_R_INTERNAL_ERROR (259 | ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  351|      0|#define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  238|      0|#define ERR_RFLAG_FATAL (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  245|      0|                "Unexpected %s public key length %lu != %lu",
  246|      0|                sub_arg->algorithm_name, (unsigned long)len,
  247|      0|                sub_arg->publen);
  248|      0|            return 0;
  249|      0|        }
  250|  2.65k|        ++sub_arg->pubcount;
  251|  2.65k|    }
  252|  2.65k|    if (sub_arg->prvenc != NULL && p.privkey != NULL) {
  ------------------
  |  Branch (252:9): [True: 0, False: 2.65k]
  |  Branch (252:36): [True: 0, False: 0]
  ------------------
  253|      0|        void *prv = sub_arg->prvenc + sub_arg->prvoff;
  254|       |
  255|      0|        if (OSSL_PARAM_get_octet_string(p.privkey, &prv, sub_arg->prvlen, &len) != 1)
  ------------------
  |  Branch (255:13): [True: 0, False: 0]
  ------------------
  256|      0|            return 0;
  257|      0|        if (len != sub_arg->prvlen) {
  ------------------
  |  Branch (257:13): [True: 0, False: 0]
  ------------------
  258|      0|            ERR_raise_data(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                          ERR_raise_data(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR,
  ------------------
  |  |  355|      0|#define ERR_R_INTERNAL_ERROR (259 | ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  351|      0|#define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  238|      0|#define ERR_RFLAG_FATAL (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  259|      0|                "Unexpected %s private key length %lu != %lu",
  260|      0|                sub_arg->algorithm_name, (unsigned long)len,
  261|      0|                (unsigned long)sub_arg->publen);
  262|      0|            return 0;
  263|      0|        }
  264|      0|        ++sub_arg->prvcount;
  265|      0|    }
  266|  2.65k|    return 1;
  267|  2.65k|}
mlx_kmgmt.c:ml_kem_import_export_decoder:
  169|  2.65k|{
  170|  2.65k|    const char *s;
  171|       |
  172|  2.65k|    memset(r, 0, sizeof(*r));
  173|  2.65k|    if (p != NULL)
  ------------------
  |  Branch (173:9): [True: 2.65k, False: 0]
  ------------------
  174|  5.30k|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (174:16): [True: 2.65k, False: 2.65k]
  ------------------
  175|  2.65k|            switch(s[0]) {
  176|      0|            default:
  ------------------
  |  Branch (176:13): [True: 0, False: 2.65k]
  ------------------
  177|      0|                break;
  178|  2.65k|            case 'p':
  ------------------
  |  Branch (178:13): [True: 2.65k, False: 0]
  ------------------
  179|  2.65k|                switch(s[1]) {
  180|      0|                default:
  ------------------
  |  Branch (180:17): [True: 0, False: 2.65k]
  ------------------
  181|      0|                    break;
  182|      0|                case 'r':
  ------------------
  |  Branch (182:17): [True: 0, False: 2.65k]
  ------------------
  183|      0|                    if (ossl_likely(strcmp("iv", s + 2) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  184|       |                        /* OSSL_PKEY_PARAM_PRIV_KEY */
  185|      0|                        if (ossl_unlikely(r->privkey != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  186|      0|                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  187|      0|                                           "param %s is repeated", s);
  188|      0|                            return 0;
  189|      0|                        }
  190|      0|                        r->privkey = (OSSL_PARAM *)p;
  191|      0|                    }
  192|      0|                    break;
  193|  2.65k|                case 'u':
  ------------------
  |  Branch (193:17): [True: 2.65k, False: 0]
  ------------------
  194|  2.65k|                    if (ossl_likely(strcmp("b", s + 2) == 0)) {
  ------------------
  |  |   22|  2.65k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 2.65k, False: 0]
  |  |  ------------------
  ------------------
  195|       |                        /* OSSL_PKEY_PARAM_PUB_KEY */
  196|  2.65k|                        if (ossl_unlikely(r->pubkey != NULL)) {
  ------------------
  |  |   23|  2.65k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 2.65k]
  |  |  ------------------
  ------------------
  197|      0|                            ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                          ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  198|      0|                                           "param %s is repeated", s);
  199|      0|                            return 0;
  200|      0|                        }
  201|  2.65k|                        r->pubkey = (OSSL_PARAM *)p;
  202|  2.65k|                    }
  203|  2.65k|                }
  204|  2.65k|            }
  205|  2.65k|    return 1;
  206|  2.65k|}
mlx_kmgmt.c:mlx_kem_gen_init:
  947|  1.32k|{
  948|  1.32k|    PROV_ML_KEM_GEN_CTX *gctx = NULL;
  949|       |
  950|       |    /*
  951|       |     * We can only generate private keys, check that the selection is
  952|       |     * appropriate.
  953|       |     */
  954|  1.32k|    if (!ossl_prov_is_running()
  ------------------
  |  Branch (954:9): [True: 0, False: 1.32k]
  ------------------
  955|  1.32k|        || (selection & minimal_selection) == 0
  ------------------
  |  Branch (955:12): [True: 0, False: 1.32k]
  ------------------
  956|  1.32k|        || (gctx = OPENSSL_zalloc(sizeof(*gctx))) == NULL)
  ------------------
  |  |  108|  1.32k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (956:12): [True: 0, False: 1.32k]
  ------------------
  957|      0|        return NULL;
  958|       |
  959|  1.32k|    gctx->evp_type = evp_type;
  960|  1.32k|    gctx->libctx = libctx;
  961|  1.32k|    gctx->selection = selection;
  962|  1.32k|    if (mlx_kem_gen_set_params(gctx, params))
  ------------------
  |  Branch (962:9): [True: 1.32k, False: 0]
  ------------------
  963|  1.32k|        return gctx;
  964|       |
  965|      0|    mlx_kem_gen_cleanup(gctx);
  966|       |    return NULL;
  967|  1.32k|}
mlx_kmgmt.c:mlx_kem_gen_set_params:
  928|  2.65k|{
  929|  2.65k|    PROV_ML_KEM_GEN_CTX *gctx = vgctx;
  930|  2.65k|    struct mlx_gen_set_params_st p;
  931|       |
  932|  2.65k|    if (gctx == NULL || !mlx_gen_set_params_decoder(params, &p))
  ------------------
  |  Branch (932:9): [True: 0, False: 2.65k]
  |  Branch (932:25): [True: 0, False: 2.65k]
  ------------------
  933|      0|        return 0;
  934|       |
  935|  2.65k|    if (p.propq != NULL) {
  ------------------
  |  Branch (935:9): [True: 0, False: 2.65k]
  ------------------
  936|      0|        if (p.propq->data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      0|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (936:13): [True: 0, False: 0]
  ------------------
  937|      0|            return 0;
  938|      0|        OPENSSL_free(gctx->propq);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  939|      0|        if ((gctx->propq = OPENSSL_strdup(p.propq->data)) == NULL)
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (939:13): [True: 0, False: 0]
  ------------------
  940|      0|            return 0;
  941|      0|    }
  942|  2.65k|    return 1;
  943|  2.65k|}
mlx_kmgmt.c:mlx_gen_set_params_decoder:
  906|  2.65k|{
  907|  2.65k|    const char *s;
  908|       |
  909|  2.65k|    memset(r, 0, sizeof(*r));
  910|  2.65k|    if (p != NULL)
  ------------------
  |  Branch (910:9): [True: 1.32k, False: 1.32k]
  ------------------
  911|  2.65k|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (911:16): [True: 1.32k, False: 1.32k]
  ------------------
  912|  1.32k|            if (ossl_likely(strcmp("properties", s + 0) == 0)) {
  ------------------
  |  |   22|  1.32k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 1.32k]
  |  |  ------------------
  ------------------
  913|       |                /* OSSL_PKEY_PARAM_PROPERTIES */
  914|      0|                if (ossl_unlikely(r->propq != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  915|      0|                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  916|      0|                                   "param %s is repeated", s);
  917|      0|                    return 0;
  918|      0|                }
  919|      0|                r->propq = (OSSL_PARAM *)p;
  920|      0|            }
  921|  2.65k|    return 1;
  922|  2.65k|}
mlx_kmgmt.c:mlx_kem_gen:
  976|  1.32k|{
  977|  1.32k|    PROV_ML_KEM_GEN_CTX *gctx = vgctx;
  978|  1.32k|    MLX_KEY *key;
  979|  1.32k|    char *propq;
  980|       |
  981|  1.32k|    if (gctx == NULL
  ------------------
  |  Branch (981:9): [True: 0, False: 1.32k]
  ------------------
  982|  1.32k|        || (gctx->selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  ------------------
  |  |  650|  1.32k|    (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  640|  1.32k|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  641|  1.32k|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  |  |  ------------------
  ------------------
                      || (gctx->selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  ------------------
  |  |  641|  1.32k|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  ------------------
  |  Branch (982:12): [True: 0, False: 1.32k]
  ------------------
  983|      0|        return NULL;
  984|       |
  985|       |    /* Lose ownership of propq */
  986|  1.32k|    propq = gctx->propq;
  987|  1.32k|    gctx->propq = NULL;
  988|  1.32k|    if ((key = mlx_kem_key_new(gctx->evp_type, gctx->libctx, propq)) == NULL)
  ------------------
  |  Branch (988:9): [True: 0, False: 1.32k]
  ------------------
  989|      0|        return NULL;
  990|       |
  991|  1.32k|    if ((gctx->selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0)
  ------------------
  |  |  650|  1.32k|    (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  640|  1.32k|#define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
  |  |  ------------------
  |  |                   (OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  |  |  ------------------
  |  |  |  |  641|  1.32k|#define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
  |  |  ------------------
  ------------------
  |  Branch (991:9): [True: 0, False: 1.32k]
  ------------------
  992|      0|        return key;
  993|       |
  994|       |    /* For now, using the same "propq" for all components */
  995|  1.32k|    key->mkey = EVP_PKEY_Q_keygen(key->libctx, key->propq,
  996|  1.32k|        key->minfo->algorithm_name);
  997|  1.32k|    key->xkey = EVP_PKEY_Q_keygen(key->libctx, key->propq,
  998|  1.32k|        key->xinfo->algorithm_name,
  999|  1.32k|        key->xinfo->group_name);
 1000|  1.32k|    if (key->mkey != NULL && key->xkey != NULL) {
  ------------------
  |  Branch (1000:9): [True: 1.32k, False: 0]
  |  Branch (1000:30): [True: 1.32k, False: 0]
  ------------------
 1001|  1.32k|        key->state = MLX_HAVE_PRVKEY;
  ------------------
  |  |   41|  1.32k|#define MLX_HAVE_PRVKEY 2
  ------------------
 1002|  1.32k|        return key;
 1003|  1.32k|    }
 1004|       |
 1005|      0|    mlx_kem_key_free(key);
 1006|       |    return NULL;
 1007|  1.32k|}
mlx_kmgmt.c:mlx_kem_gen_cleanup:
 1010|  1.32k|{
 1011|  1.32k|    PROV_ML_KEM_GEN_CTX *gctx = vgctx;
 1012|       |
 1013|  1.32k|    if (gctx == NULL)
  ------------------
  |  Branch (1013:9): [True: 0, False: 1.32k]
  ------------------
 1014|      0|        return;
 1015|  1.32k|    OPENSSL_free(gctx->propq);
  ------------------
  |  |  131|  1.32k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1016|  1.32k|    OPENSSL_free(gctx);
  ------------------
  |  |  131|  1.32k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1017|  1.32k|}

rsa_kmgmt.c:rsa_load:
  671|   299k|{
  672|   299k|    return common_load(reference, reference_sz, RSA_FLAG_TYPE_RSA);
  ------------------
  |  |  118|   299k|#define RSA_FLAG_TYPE_RSA 0x0000
  ------------------
  673|   299k|}
rsa_kmgmt.c:common_load:
  653|   299k|{
  654|   299k|    RSA *rsa = NULL;
  655|       |
  656|   299k|    if (ossl_prov_is_running() && reference_sz == sizeof(rsa)) {
  ------------------
  |  Branch (656:9): [True: 299k, False: 0]
  |  Branch (656:35): [True: 299k, False: 0]
  ------------------
  657|       |        /* The contents of the reference is the address to our object */
  658|   299k|        rsa = *(RSA **)reference;
  659|       |
  660|   299k|        if (RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK) != expected_rsa_type)
  ------------------
  |  |  117|   299k|#define RSA_FLAG_TYPE_MASK 0xF000
  ------------------
  |  Branch (660:13): [True: 0, False: 299k]
  ------------------
  661|      0|            return NULL;
  662|       |
  663|       |        /* We grabbed, so we detach it */
  664|   299k|        *(RSA **)reference = NULL;
  665|   299k|        return rsa;
  666|   299k|    }
  667|      0|    return NULL;
  668|   299k|}
rsa_kmgmt.c:rsa_freedata:
  111|   299k|{
  112|   299k|    RSA_free(keydata);
  113|   299k|}
rsa_kmgmt.c:rsa_get_params:
  325|   299k|{
  326|   299k|    RSA *rsa = key;
  327|   299k|    const RSA_PSS_PARAMS_30 *pss_params = ossl_rsa_get0_pss_params_30(rsa);
  328|   299k|    int rsa_type = RSA_test_flags(rsa, RSA_FLAG_TYPE_MASK);
  ------------------
  |  |  117|   299k|#define RSA_FLAG_TYPE_MASK 0xF000
  ------------------
  329|   299k|    OSSL_PARAM *p;
  330|   299k|    int empty = RSA_get0_n(rsa) == NULL;
  331|       |
  332|   299k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  366|   299k|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (332:9): [True: 299k, False: 0]
  ------------------
  333|   299k|        && (empty || !OSSL_PARAM_set_int(p, RSA_bits(rsa))))
  ------------------
  |  Branch (333:13): [True: 0, False: 299k]
  |  Branch (333:22): [True: 0, False: 299k]
  ------------------
  334|      0|        return 0;
  335|   299k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  495|   299k|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (335:9): [True: 299k, False: 0]
  ------------------
  336|   299k|        && (empty || !OSSL_PARAM_set_int(p, RSA_security_bits(rsa))))
  ------------------
  |  Branch (336:13): [True: 0, False: 299k]
  |  Branch (336:22): [True: 0, False: 299k]
  ------------------
  337|      0|        return 0;
  338|   299k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  424|   299k|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (338:9): [True: 299k, False: 0]
  ------------------
  339|   299k|        && (empty || !OSSL_PARAM_set_int(p, RSA_size(rsa))))
  ------------------
  |  Branch (339:13): [True: 0, False: 299k]
  |  Branch (339:22): [True: 0, False: 299k]
  ------------------
  340|      0|        return 0;
  341|   299k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_CATEGORY)) != NULL)
  ------------------
  |  |  496|   299k|# define OSSL_PKEY_PARAM_SECURITY_CATEGORY OSSL_ALG_PARAM_SECURITY_CATEGORY
  |  |  ------------------
  |  |  |  |  133|   299k|# define OSSL_ALG_PARAM_SECURITY_CATEGORY "security-category"
  |  |  ------------------
  ------------------
  |  Branch (341:9): [True: 299k, False: 0]
  ------------------
  342|   299k|        if (!OSSL_PARAM_set_int(p, 0))
  ------------------
  |  Branch (342:13): [True: 0, False: 299k]
  ------------------
  343|      0|            return 0;
  344|       |
  345|       |    /*
  346|       |     * For restricted RSA-PSS keys, we ignore the default digest request.
  347|       |     * With RSA-OAEP keys, this may need to be amended.
  348|       |     */
  349|   299k|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_DEFAULT_DIGEST)) != NULL
  ------------------
  |  |  370|   299k|# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
  ------------------
  |  Branch (349:9): [True: 0, False: 299k]
  ------------------
  350|      0|        && (rsa_type != RSA_FLAG_TYPE_RSASSAPSS
  ------------------
  |  |  119|      0|#define RSA_FLAG_TYPE_RSASSAPSS 0x1000
  ------------------
  |  Branch (350:13): [True: 0, False: 0]
  ------------------
  351|      0|            || ossl_rsa_pss_params_30_is_unrestricted(pss_params))) {
  ------------------
  |  Branch (351:16): [True: 0, False: 0]
  ------------------
  352|      0|        if (!OSSL_PARAM_set_utf8_string(p, RSA_DEFAULT_MD))
  ------------------
  |  |   55|      0|#define RSA_DEFAULT_MD "SHA256"
  ------------------
  |  Branch (352:13): [True: 0, False: 0]
  ------------------
  353|      0|            return 0;
  354|      0|    }
  355|       |
  356|       |    /*
  357|       |     * For non-RSA-PSS keys, we ignore the mandatory digest request.
  358|       |     * With RSA-OAEP keys, this may need to be amended.
  359|       |     */
  360|   299k|    if ((p = OSSL_PARAM_locate(params,
  ------------------
  |  Branch (360:9): [True: 0, False: 299k]
  ------------------
  361|   299k|             OSSL_PKEY_PARAM_MANDATORY_DIGEST))
  ------------------
  |  |  422|   299k|# define OSSL_PKEY_PARAM_MANDATORY_DIGEST "mandatory-digest"
  ------------------
  362|   299k|            != NULL
  363|      0|        && rsa_type == RSA_FLAG_TYPE_RSASSAPSS
  ------------------
  |  |  119|   299k|#define RSA_FLAG_TYPE_RSASSAPSS 0x1000
  ------------------
  |  Branch (363:12): [True: 0, False: 0]
  ------------------
  364|      0|        && !ossl_rsa_pss_params_30_is_unrestricted(pss_params)) {
  ------------------
  |  Branch (364:12): [True: 0, False: 0]
  ------------------
  365|      0|        const char *mdname = ossl_rsa_oaeppss_nid2name(ossl_rsa_pss_params_30_hashalg(pss_params));
  366|       |
  367|      0|        if (mdname == NULL || !OSSL_PARAM_set_utf8_string(p, mdname))
  ------------------
  |  Branch (367:13): [True: 0, False: 0]
  |  Branch (367:31): [True: 0, False: 0]
  ------------------
  368|      0|            return 0;
  369|      0|    }
  370|   299k|    return (rsa_type != RSA_FLAG_TYPE_RSASSAPSS
  ------------------
  |  |  119|   598k|#define RSA_FLAG_TYPE_RSASSAPSS 0x1000
  ------------------
  |  Branch (370:13): [True: 299k, False: 0]
  ------------------
  371|      0|               || ossl_rsa_pss_params_30_todata(pss_params, NULL, params))
  ------------------
  |  Branch (371:19): [True: 0, False: 0]
  ------------------
  372|   299k|        && ossl_rsa_todata(rsa, NULL, params, 1);
  ------------------
  |  Branch (372:12): [True: 299k, False: 0]
  ------------------
  373|   299k|}

ossl_drbg_lock:
   54|  89.6k|{
   55|  89.6k|    return 1;
   56|  89.6k|}
ossl_drbg_unlock:
   60|  89.6k|{
   61|  89.6k|}
ossl_drbg_get_seed:
  148|  2.19k|{
  149|  2.19k|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  150|  2.19k|    size_t bytes_needed;
  151|  2.19k|    unsigned char *buffer;
  152|       |
  153|       |    /* Figure out how many bytes we need */
  154|  2.19k|    bytes_needed = entropy >= 0 ? (entropy + 7) / 8 : 0;
  ------------------
  |  Branch (154:20): [True: 2.19k, False: 0]
  ------------------
  155|  2.19k|    if (bytes_needed < min_len)
  ------------------
  |  Branch (155:9): [True: 0, False: 2.19k]
  ------------------
  156|      0|        bytes_needed = min_len;
  157|  2.19k|    if (bytes_needed > max_len)
  ------------------
  |  Branch (157:9): [True: 0, False: 2.19k]
  ------------------
  158|      0|        bytes_needed = max_len;
  159|       |
  160|       |    /* Allocate storage */
  161|  2.19k|    buffer = OPENSSL_secure_malloc(bytes_needed);
  ------------------
  |  |  139|  2.19k|    CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  162|  2.19k|    if (buffer == NULL)
  ------------------
  |  Branch (162:9): [True: 0, False: 2.19k]
  ------------------
  163|      0|        return 0;
  164|       |
  165|       |    /*
  166|       |     * Get random data.  Include our DRBG address as
  167|       |     * additional input, in order to provide a distinction between
  168|       |     * different DRBG child instances.
  169|       |     *
  170|       |     * Note: using the sizeof() operator on a pointer triggers
  171|       |     *       a warning in some static code analyzers, but it's
  172|       |     *       intentional and correct here.
  173|       |     */
  174|  2.19k|    if (!ossl_prov_drbg_generate(drbg, buffer, bytes_needed,
  ------------------
  |  Branch (174:9): [True: 0, False: 2.19k]
  ------------------
  175|  2.19k|            drbg->strength, prediction_resistance,
  176|  2.19k|            (unsigned char *)&drbg, sizeof(drbg))) {
  177|      0|        OPENSSL_secure_clear_free(buffer, bytes_needed);
  ------------------
  |  |  149|      0|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  178|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_GENERATE_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  179|      0|        return 0;
  180|      0|    }
  181|  2.19k|    *pout = buffer;
  182|  2.19k|    return bytes_needed;
  183|  2.19k|}
ossl_drbg_clear_seed:
  188|  2.19k|{
  189|  2.19k|    OPENSSL_secure_clear_free(out, outlen);
  ------------------
  |  |  149|  2.19k|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  190|  2.19k|}
ossl_prov_drbg_nonce_ctx_new:
  272|    787|{
  273|    787|    PROV_DRBG_NONCE_GLOBAL *dngbl = OPENSSL_zalloc(sizeof(*dngbl));
  ------------------
  |  |  108|    787|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  274|       |
  275|    787|    if (dngbl == NULL)
  ------------------
  |  Branch (275:9): [True: 0, False: 787]
  ------------------
  276|      0|        return NULL;
  277|       |
  278|    787|    dngbl->rand_nonce_lock = CRYPTO_THREAD_lock_new();
  279|    787|    if (dngbl->rand_nonce_lock == NULL) {
  ------------------
  |  Branch (279:9): [True: 0, False: 787]
  ------------------
  280|      0|        OPENSSL_free(dngbl);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  281|      0|        return NULL;
  282|      0|    }
  283|       |
  284|    787|    return dngbl;
  285|    787|}
ossl_prov_drbg_nonce_ctx_free:
  288|    787|{
  289|    787|    PROV_DRBG_NONCE_GLOBAL *dngbl = vdngbl;
  290|       |
  291|    787|    if (dngbl == NULL)
  ------------------
  |  Branch (291:9): [True: 0, False: 787]
  ------------------
  292|      0|        return;
  293|       |
  294|    787|    CRYPTO_THREAD_lock_free(dngbl->rand_nonce_lock);
  295|       |
  296|    787|    OPENSSL_free(dngbl);
  ------------------
  |  |  131|    787|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  297|    787|}
ossl_prov_drbg_instantiate:
  352|  1.64k|{
  353|  1.64k|    unsigned char *nonce = NULL, *entropy = NULL;
  354|  1.64k|    size_t noncelen = 0, entropylen = 0;
  355|  1.64k|    unsigned int min_entropy;
  356|  1.64k|    size_t min_entropylen, max_entropylen;
  357|       |
  358|  1.64k|    if (strength > drbg->strength) {
  ------------------
  |  Branch (358:9): [True: 0, False: 1.64k]
  ------------------
  359|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INSUFFICIENT_DRBG_STRENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  360|      0|        goto end;
  361|      0|    }
  362|  1.64k|    min_entropy = drbg->strength;
  363|  1.64k|    min_entropylen = drbg->min_entropylen;
  364|  1.64k|    max_entropylen = drbg->max_entropylen;
  365|       |
  366|  1.64k|    if (pers == NULL) {
  ------------------
  |  Branch (366:9): [True: 1.64k, False: 0]
  ------------------
  367|  1.64k|        pers = (const unsigned char *)ossl_pers_string;
  368|  1.64k|        perslen = sizeof(ossl_pers_string);
  369|  1.64k|    }
  370|  1.64k|    if (perslen > drbg->max_perslen) {
  ------------------
  |  Branch (370:9): [True: 0, False: 1.64k]
  ------------------
  371|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_PERSONALISATION_STRING_TOO_LONG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  372|      0|        goto end;
  373|      0|    }
  374|       |
  375|  1.64k|    if (drbg->state != EVP_RAND_STATE_UNINITIALISED) {
  ------------------
  |  | 1345|  1.64k|#define EVP_RAND_STATE_UNINITIALISED 0
  ------------------
  |  Branch (375:9): [True: 0, False: 1.64k]
  ------------------
  376|      0|        if (drbg->state == EVP_RAND_STATE_ERROR)
  ------------------
  |  | 1347|      0|#define EVP_RAND_STATE_ERROR 2
  ------------------
  |  Branch (376:13): [True: 0, False: 0]
  ------------------
  377|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_IN_ERROR_STATE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  378|      0|        else
  379|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_ALREADY_INSTANTIATED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  380|      0|        goto end;
  381|      0|    }
  382|       |
  383|  1.64k|    drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1347|  1.64k|#define EVP_RAND_STATE_ERROR 2
  ------------------
  384|       |
  385|  1.64k|    if (drbg->min_noncelen > 0) {
  ------------------
  |  Branch (385:9): [True: 1.64k, False: 0]
  ------------------
  386|  1.64k|        if (drbg->parent_nonce != NULL) {
  ------------------
  |  Branch (386:13): [True: 0, False: 1.64k]
  ------------------
  387|      0|            noncelen = drbg->parent_nonce(drbg->parent, NULL, drbg->strength,
  388|      0|                drbg->min_noncelen,
  389|      0|                drbg->max_noncelen);
  390|      0|            if (noncelen == 0) {
  ------------------
  |  Branch (390:17): [True: 0, False: 0]
  ------------------
  391|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_NONCE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  392|      0|                goto end;
  393|      0|            }
  394|      0|            nonce = OPENSSL_malloc(noncelen);
  ------------------
  |  |  106|      0|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  395|      0|            if (nonce == NULL) {
  ------------------
  |  Branch (395:17): [True: 0, False: 0]
  ------------------
  396|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_NONCE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  397|      0|                goto end;
  398|      0|            }
  399|      0|            if (noncelen != drbg->parent_nonce(drbg->parent, nonce, drbg->strength, drbg->min_noncelen, drbg->max_noncelen)) {
  ------------------
  |  Branch (399:17): [True: 0, False: 0]
  ------------------
  400|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_NONCE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  401|      0|                goto end;
  402|      0|            }
  403|      0|#ifndef PROV_RAND_GET_RANDOM_NONCE
  404|  1.64k|        } else if (drbg->parent != NULL) {
  ------------------
  |  Branch (404:20): [True: 1.64k, False: 0]
  ------------------
  405|  1.64k|#endif
  406|       |            /*
  407|       |             * NIST SP800-90Ar1 section 9.1 says you can combine getting
  408|       |             * the entropy and nonce in 1 call by increasing the entropy
  409|       |             * with 50% and increasing the minimum length to accommodate
  410|       |             * the length of the nonce. We do this in case a nonce is
  411|       |             * required and there is no parental nonce capability.
  412|       |             */
  413|  1.64k|            min_entropy += drbg->strength / 2;
  414|  1.64k|            min_entropylen += drbg->min_noncelen;
  415|  1.64k|            max_entropylen += drbg->max_noncelen;
  416|  1.64k|        }
  417|      0|#ifndef PROV_RAND_GET_RANDOM_NONCE
  418|      0|        else { /* parent == NULL */
  419|      0|            noncelen = prov_drbg_get_nonce(drbg, &nonce, drbg->min_noncelen,
  420|      0|                drbg->max_noncelen);
  421|      0|            if (noncelen < drbg->min_noncelen
  ------------------
  |  Branch (421:17): [True: 0, False: 0]
  ------------------
  422|      0|                || noncelen > drbg->max_noncelen) {
  ------------------
  |  Branch (422:20): [True: 0, False: 0]
  ------------------
  423|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_NONCE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  424|      0|                goto end;
  425|      0|            }
  426|      0|        }
  427|  1.64k|#endif
  428|  1.64k|    }
  429|       |
  430|  1.64k|    drbg->reseed_next_counter = tsan_load(&drbg->reseed_counter);
  ------------------
  |  |   61|  1.64k|#define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  431|  1.64k|    if (drbg->reseed_next_counter) {
  ------------------
  |  Branch (431:9): [True: 1.64k, False: 0]
  ------------------
  432|  1.64k|        drbg->reseed_next_counter++;
  433|  1.64k|        if (!drbg->reseed_next_counter)
  ------------------
  |  Branch (433:13): [True: 0, False: 1.64k]
  ------------------
  434|      0|            drbg->reseed_next_counter = 1;
  435|  1.64k|    }
  436|       |
  437|  1.64k|    entropylen = get_entropy(drbg, &entropy, min_entropy,
  438|  1.64k|        min_entropylen, max_entropylen,
  439|  1.64k|        prediction_resistance);
  440|  1.64k|    if (entropylen < min_entropylen
  ------------------
  |  Branch (440:9): [True: 0, False: 1.64k]
  ------------------
  441|  1.64k|        || entropylen > max_entropylen) {
  ------------------
  |  Branch (441:12): [True: 0, False: 1.64k]
  ------------------
  442|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_ENTROPY);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  443|      0|        goto end;
  444|      0|    }
  445|       |
  446|  1.64k|    if (!drbg->instantiate(drbg, entropy, entropylen, nonce, noncelen,
  ------------------
  |  Branch (446:9): [True: 0, False: 1.64k]
  ------------------
  447|  1.64k|            pers, perslen)) {
  448|      0|        cleanup_entropy(drbg, entropy, entropylen);
  449|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_INSTANTIATING_DRBG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  450|      0|        goto end;
  451|      0|    }
  452|  1.64k|    cleanup_entropy(drbg, entropy, entropylen);
  453|       |
  454|  1.64k|    drbg->state = EVP_RAND_STATE_READY;
  ------------------
  |  | 1346|  1.64k|#define EVP_RAND_STATE_READY 1
  ------------------
  455|  1.64k|    drbg->generate_counter = 1;
  456|  1.64k|    drbg->reseed_time = time(NULL);
  457|  1.64k|    tsan_store(&drbg->reseed_counter, drbg->reseed_next_counter);
  ------------------
  |  |   62|  1.64k|#define tsan_store(ptr, val) atomic_store_explicit((ptr), (val), memory_order_relaxed)
  ------------------
  458|       |
  459|  1.64k|end:
  460|  1.64k|    if (nonce != NULL)
  ------------------
  |  Branch (460:9): [True: 0, False: 1.64k]
  ------------------
  461|      0|        ossl_prov_cleanup_nonce(drbg->provctx, nonce, noncelen);
  462|  1.64k|    if (drbg->state == EVP_RAND_STATE_READY)
  ------------------
  |  | 1346|  1.64k|#define EVP_RAND_STATE_READY 1
  ------------------
  |  Branch (462:9): [True: 1.64k, False: 0]
  ------------------
  463|  1.64k|        return 1;
  464|      0|    return 0;
  465|  1.64k|}
ossl_prov_drbg_generate:
  625|  34.5k|{
  626|  34.5k|    int fork_id;
  627|  34.5k|    int reseed_required = 0;
  628|  34.5k|    int ret = 0;
  629|  34.5k|    time_t reseed_time_interval = drbg->reseed_time_interval;
  630|  34.5k|    time_t now = 0;
  631|       |
  632|  34.5k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (632:9): [True: 0, False: 34.5k]
  ------------------
  633|      0|        return 0;
  634|       |
  635|  34.5k|    fork_id = openssl_get_fork_id();
  636|       |
  637|  34.5k|    if (reseed_time_interval > 0)
  ------------------
  |  Branch (637:9): [True: 34.5k, False: 0]
  ------------------
  638|  34.5k|        now = time(NULL);
  639|       |
  640|  34.5k|    if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
  ------------------
  |  Branch (640:9): [True: 2.19k, False: 32.3k]
  |  Branch (640:31): [True: 0, False: 2.19k]
  ------------------
  641|      0|        return 0;
  642|       |
  643|  34.5k|    if (drbg->state != EVP_RAND_STATE_READY) {
  ------------------
  |  | 1346|  34.5k|#define EVP_RAND_STATE_READY 1
  ------------------
  |  Branch (643:9): [True: 0, False: 34.5k]
  ------------------
  644|       |        /* try to recover from previous errors */
  645|      0|        rand_drbg_restart(drbg);
  646|       |
  647|      0|        if (drbg->state == EVP_RAND_STATE_ERROR) {
  ------------------
  |  | 1347|      0|#define EVP_RAND_STATE_ERROR 2
  ------------------
  |  Branch (647:13): [True: 0, False: 0]
  ------------------
  648|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_IN_ERROR_STATE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  649|      0|            goto err;
  650|      0|        }
  651|      0|        if (drbg->state == EVP_RAND_STATE_UNINITIALISED) {
  ------------------
  |  | 1345|      0|#define EVP_RAND_STATE_UNINITIALISED 0
  ------------------
  |  Branch (651:13): [True: 0, False: 0]
  ------------------
  652|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_INSTANTIATED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  653|      0|            goto err;
  654|      0|        }
  655|      0|    }
  656|  34.5k|    if (strength > drbg->strength) {
  ------------------
  |  Branch (656:9): [True: 0, False: 34.5k]
  ------------------
  657|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INSUFFICIENT_DRBG_STRENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  658|      0|        goto err;
  659|      0|    }
  660|       |
  661|  34.5k|    if (outlen > drbg->max_request) {
  ------------------
  |  Branch (661:9): [True: 0, False: 34.5k]
  ------------------
  662|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_REQUEST_TOO_LARGE_FOR_DRBG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  663|      0|        goto err;
  664|      0|    }
  665|  34.5k|    if (adinlen > drbg->max_adinlen) {
  ------------------
  |  Branch (665:9): [True: 0, False: 34.5k]
  ------------------
  666|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ADDITIONAL_INPUT_TOO_LONG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  667|      0|        goto err;
  668|      0|    }
  669|       |
  670|  34.5k|    if (drbg->fork_id != fork_id) {
  ------------------
  |  Branch (670:9): [True: 0, False: 34.5k]
  ------------------
  671|      0|        drbg->fork_id = fork_id;
  672|      0|        reseed_required = 1;
  673|      0|    }
  674|       |
  675|  34.5k|    if (drbg->reseed_interval > 0) {
  ------------------
  |  Branch (675:9): [True: 34.5k, False: 0]
  ------------------
  676|  34.5k|        if (drbg->generate_counter >= drbg->reseed_interval)
  ------------------
  |  Branch (676:13): [True: 0, False: 34.5k]
  ------------------
  677|      0|            reseed_required = 1;
  678|  34.5k|    }
  679|  34.5k|    if (reseed_time_interval > 0) {
  ------------------
  |  Branch (679:9): [True: 34.5k, False: 0]
  ------------------
  680|  34.5k|        if (now < drbg->reseed_time
  ------------------
  |  Branch (680:13): [True: 0, False: 34.5k]
  ------------------
  681|  34.5k|            || now - drbg->reseed_time >= reseed_time_interval)
  ------------------
  |  Branch (681:16): [True: 0, False: 34.5k]
  ------------------
  682|      0|            reseed_required = 1;
  683|  34.5k|    }
  684|  34.5k|    if (drbg->parent != NULL
  ------------------
  |  Branch (684:9): [True: 34.5k, False: 0]
  ------------------
  685|  34.5k|        && get_parent_reseed_count(drbg) != drbg->parent_reseed_counter)
  ------------------
  |  Branch (685:12): [True: 1.09k, False: 33.4k]
  ------------------
  686|  1.09k|        reseed_required = 1;
  687|       |
  688|  34.5k|    if (reseed_required || prediction_resistance) {
  ------------------
  |  Branch (688:9): [True: 1.09k, False: 33.4k]
  |  Branch (688:28): [True: 0, False: 33.4k]
  ------------------
  689|  1.09k|        if (!ossl_prov_drbg_reseed_unlocked(drbg, prediction_resistance, NULL,
  ------------------
  |  Branch (689:13): [True: 0, False: 1.09k]
  ------------------
  690|  1.09k|                0, adin, adinlen)) {
  691|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_RESEED_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  692|      0|            goto err;
  693|      0|        }
  694|  1.09k|        adin = NULL;
  695|  1.09k|        adinlen = 0;
  696|  1.09k|    }
  697|       |
  698|  34.5k|    if (!drbg->generate(drbg, out, outlen, adin, adinlen)) {
  ------------------
  |  Branch (698:9): [True: 0, False: 34.5k]
  ------------------
  699|      0|        drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1347|      0|#define EVP_RAND_STATE_ERROR 2
  ------------------
  700|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_GENERATE_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  701|      0|        goto err;
  702|      0|    }
  703|       |
  704|  34.5k|    drbg->generate_counter++;
  705|       |
  706|  34.5k|    ret = 1;
  707|  34.5k|err:
  708|  34.5k|    if (drbg->lock != NULL)
  ------------------
  |  Branch (708:9): [True: 2.19k, False: 32.3k]
  ------------------
  709|  2.19k|        CRYPTO_THREAD_unlock(drbg->lock);
  710|       |
  711|  34.5k|    return ret;
  712|  34.5k|}
ossl_drbg_enable_locking:
  759|    549|{
  760|    549|    PROV_DRBG *drbg = vctx;
  761|       |
  762|    549|    if (drbg != NULL && drbg->lock == NULL) {
  ------------------
  |  Branch (762:9): [True: 549, False: 0]
  |  Branch (762:25): [True: 549, False: 0]
  ------------------
  763|    549|        if (drbg->parent_enable_locking != NULL)
  ------------------
  |  Branch (763:13): [True: 549, False: 0]
  ------------------
  764|    549|            if (!drbg->parent_enable_locking(drbg->parent)) {
  ------------------
  |  Branch (764:17): [True: 0, False: 549]
  ------------------
  765|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_LOCKING_NOT_ENABLED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  766|      0|                return 0;
  767|      0|            }
  768|    549|        drbg->lock = CRYPTO_THREAD_lock_new();
  769|    549|        if (drbg->lock == NULL) {
  ------------------
  |  Branch (769:13): [True: 0, False: 549]
  ------------------
  770|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_CREATE_LOCK);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  771|      0|            return 0;
  772|      0|        }
  773|    549|    }
  774|    549|    return 1;
  775|    549|}
ossl_rand_drbg_new:
  797|  1.64k|{
  798|  1.64k|    PROV_DRBG *drbg;
  799|  1.64k|    unsigned int p_str;
  800|  1.64k|    const OSSL_DISPATCH *pfunc;
  801|       |
  802|  1.64k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (802:9): [True: 0, False: 1.64k]
  ------------------
  803|      0|        return NULL;
  804|       |
  805|  1.64k|    drbg = OPENSSL_zalloc(sizeof(*drbg));
  ------------------
  |  |  108|  1.64k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  806|  1.64k|    if (drbg == NULL)
  ------------------
  |  Branch (806:9): [True: 0, False: 1.64k]
  ------------------
  807|      0|        return NULL;
  808|       |
  809|  1.64k|    drbg->provctx = provctx;
  810|  1.64k|    drbg->instantiate = instantiate;
  811|  1.64k|    drbg->uninstantiate = uninstantiate;
  812|  1.64k|    drbg->reseed = reseed;
  813|  1.64k|    drbg->generate = generate;
  814|  1.64k|    drbg->fork_id = openssl_get_fork_id();
  815|       |
  816|       |    /* Extract parent's functions */
  817|  1.64k|    drbg->parent = parent;
  818|  1.64k|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_ENABLE_LOCKING)) != NULL)
  ------------------
  |  |  542|  1.64k|#define OSSL_FUNC_RAND_ENABLE_LOCKING 8
  ------------------
  |  Branch (818:9): [True: 1.64k, False: 0]
  ------------------
  819|  1.64k|        drbg->parent_enable_locking = OSSL_FUNC_rand_enable_locking(pfunc);
  820|  1.64k|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_LOCK)) != NULL)
  ------------------
  |  |  543|  1.64k|#define OSSL_FUNC_RAND_LOCK 9
  ------------------
  |  Branch (820:9): [True: 1.64k, False: 0]
  ------------------
  821|  1.64k|        drbg->parent_lock = OSSL_FUNC_rand_lock(pfunc);
  822|  1.64k|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_UNLOCK)) != NULL)
  ------------------
  |  |  544|  1.64k|#define OSSL_FUNC_RAND_UNLOCK 10
  ------------------
  |  Branch (822:9): [True: 1.64k, False: 0]
  ------------------
  823|  1.64k|        drbg->parent_unlock = OSSL_FUNC_rand_unlock(pfunc);
  824|  1.64k|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_GET_CTX_PARAMS)) != NULL)
  ------------------
  |  |  549|  1.64k|#define OSSL_FUNC_RAND_GET_CTX_PARAMS 15
  ------------------
  |  Branch (824:9): [True: 1.64k, False: 0]
  ------------------
  825|  1.64k|        drbg->parent_get_ctx_params = OSSL_FUNC_rand_get_ctx_params(pfunc);
  826|  1.64k|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_NONCE)) != NULL)
  ------------------
  |  |  541|  1.64k|#define OSSL_FUNC_RAND_NONCE 7
  ------------------
  |  Branch (826:9): [True: 0, False: 1.64k]
  ------------------
  827|      0|        drbg->parent_nonce = OSSL_FUNC_rand_nonce(pfunc);
  828|  1.64k|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_GET_SEED)) != NULL)
  ------------------
  |  |  552|  1.64k|#define OSSL_FUNC_RAND_GET_SEED 18
  ------------------
  |  Branch (828:9): [True: 1.64k, False: 0]
  ------------------
  829|  1.64k|        drbg->parent_get_seed = OSSL_FUNC_rand_get_seed(pfunc);
  830|  1.64k|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_CLEAR_SEED)) != NULL)
  ------------------
  |  |  553|  1.64k|#define OSSL_FUNC_RAND_CLEAR_SEED 19
  ------------------
  |  Branch (830:9): [True: 1.64k, False: 0]
  ------------------
  831|  1.64k|        drbg->parent_clear_seed = OSSL_FUNC_rand_clear_seed(pfunc);
  832|       |
  833|       |    /* Set some default maximums up */
  834|  1.64k|    drbg->max_entropylen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|  1.64k|#define DRBG_MAX_LENGTH INT32_MAX
  ------------------
  835|  1.64k|    drbg->max_noncelen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|  1.64k|#define DRBG_MAX_LENGTH INT32_MAX
  ------------------
  836|  1.64k|    drbg->max_perslen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|  1.64k|#define DRBG_MAX_LENGTH INT32_MAX
  ------------------
  837|  1.64k|    drbg->max_adinlen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|  1.64k|#define DRBG_MAX_LENGTH INT32_MAX
  ------------------
  838|  1.64k|    drbg->generate_counter = 1;
  839|  1.64k|    drbg->reseed_counter = 1;
  840|  1.64k|    drbg->reseed_interval = RESEED_INTERVAL;
  ------------------
  |  |   31|  1.64k|#define RESEED_INTERVAL (1 << 8)
  ------------------
  841|  1.64k|    drbg->reseed_time_interval = TIME_INTERVAL;
  ------------------
  |  |   32|  1.64k|#define TIME_INTERVAL (60 * 60) /* 1 hour */
  ------------------
  842|       |
  843|  1.64k|    if (!dnew(drbg))
  ------------------
  |  Branch (843:9): [True: 0, False: 1.64k]
  ------------------
  844|      0|        goto err;
  845|       |
  846|  1.64k|    if (parent != NULL) {
  ------------------
  |  Branch (846:9): [True: 1.64k, False: 0]
  ------------------
  847|  1.64k|        if (!get_parent_strength(drbg, &p_str))
  ------------------
  |  Branch (847:13): [True: 0, False: 1.64k]
  ------------------
  848|      0|            goto err;
  849|  1.64k|        if (drbg->strength > p_str) {
  ------------------
  |  Branch (849:13): [True: 0, False: 1.64k]
  ------------------
  850|       |            /*
  851|       |             * We currently don't support the algorithm from NIST SP 800-90C
  852|       |             * 10.1.2 to use a weaker DRBG as source
  853|       |             */
  854|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_STRENGTH_TOO_WEAK);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  855|      0|            goto err;
  856|      0|        }
  857|  1.64k|    }
  858|       |#ifdef TSAN_REQUIRES_LOCKING
  859|       |    if (!ossl_drbg_enable_locking(drbg))
  860|       |        goto err;
  861|       |#endif
  862|  1.64k|    return drbg;
  863|       |
  864|      0|err:
  865|      0|    dfree(drbg);
  866|       |    return NULL;
  867|  1.64k|}
ossl_rand_drbg_free:
  870|  1.64k|{
  871|  1.64k|    if (drbg == NULL)
  ------------------
  |  Branch (871:9): [True: 0, False: 1.64k]
  ------------------
  872|      0|        return;
  873|       |
  874|  1.64k|    CRYPTO_THREAD_lock_free(drbg->lock);
  875|  1.64k|    OPENSSL_free(drbg);
  ------------------
  |  |  131|  1.64k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  876|  1.64k|}
ossl_drbg_get_ctx_params:
  884|  17.7k|{
  885|  17.7k|    if (p->state != NULL && !OSSL_PARAM_set_int(p->state, drbg->state))
  ------------------
  |  Branch (885:9): [True: 14.4k, False: 3.29k]
  |  Branch (885:29): [True: 0, False: 14.4k]
  ------------------
  886|      0|        return 0;
  887|       |
  888|  17.7k|    if (p->str != NULL && !OSSL_PARAM_set_int(p->str, drbg->strength))
  ------------------
  |  Branch (888:9): [True: 3.29k, False: 14.4k]
  |  Branch (888:27): [True: 0, False: 3.29k]
  ------------------
  889|      0|        return 0;
  890|       |
  891|  17.7k|    if (p->minentlen != NULL
  ------------------
  |  Branch (891:9): [True: 0, False: 17.7k]
  ------------------
  892|      0|        && !OSSL_PARAM_set_size_t(p->minentlen, drbg->min_entropylen))
  ------------------
  |  Branch (892:12): [True: 0, False: 0]
  ------------------
  893|      0|        return 0;
  894|       |
  895|  17.7k|    if (p->maxentlen != NULL
  ------------------
  |  Branch (895:9): [True: 0, False: 17.7k]
  ------------------
  896|      0|        && !OSSL_PARAM_set_size_t(p->maxentlen, drbg->max_entropylen))
  ------------------
  |  Branch (896:12): [True: 0, False: 0]
  ------------------
  897|      0|        return 0;
  898|       |
  899|  17.7k|    if (p->minnonlen != NULL
  ------------------
  |  Branch (899:9): [True: 0, False: 17.7k]
  ------------------
  900|      0|        && !OSSL_PARAM_set_size_t(p->minnonlen, drbg->min_noncelen))
  ------------------
  |  Branch (900:12): [True: 0, False: 0]
  ------------------
  901|      0|        return 0;
  902|       |
  903|  17.7k|    if (p->maxnonlen != NULL
  ------------------
  |  Branch (903:9): [True: 0, False: 17.7k]
  ------------------
  904|      0|        && !OSSL_PARAM_set_size_t(p->maxnonlen, drbg->max_noncelen))
  ------------------
  |  Branch (904:12): [True: 0, False: 0]
  ------------------
  905|      0|        return 0;
  906|       |
  907|  17.7k|    if (p->maxperlen != NULL
  ------------------
  |  Branch (907:9): [True: 0, False: 17.7k]
  ------------------
  908|      0|        && !OSSL_PARAM_set_size_t(p->maxperlen, drbg->max_perslen))
  ------------------
  |  Branch (908:12): [True: 0, False: 0]
  ------------------
  909|      0|        return 0;
  910|       |
  911|  17.7k|    if (p->maxadlen != NULL
  ------------------
  |  Branch (911:9): [True: 0, False: 17.7k]
  ------------------
  912|      0|        && !OSSL_PARAM_set_size_t(p->maxadlen, drbg->max_adinlen))
  ------------------
  |  Branch (912:12): [True: 0, False: 0]
  ------------------
  913|      0|        return 0;
  914|       |
  915|  17.7k|    if (p->reseed_req != NULL
  ------------------
  |  Branch (915:9): [True: 0, False: 17.7k]
  ------------------
  916|      0|        && !OSSL_PARAM_set_uint(p->reseed_req, drbg->reseed_interval))
  ------------------
  |  Branch (916:12): [True: 0, False: 0]
  ------------------
  917|      0|        return 0;
  918|       |
  919|  17.7k|    if (p->reseed_time != NULL
  ------------------
  |  Branch (919:9): [True: 0, False: 17.7k]
  ------------------
  920|      0|        && !OSSL_PARAM_set_time_t(p->reseed_time, drbg->reseed_time))
  ------------------
  |  Branch (920:12): [True: 0, False: 0]
  ------------------
  921|      0|        return 0;
  922|       |
  923|  17.7k|    if (p->reseed_int != NULL
  ------------------
  |  Branch (923:9): [True: 0, False: 17.7k]
  ------------------
  924|      0|        && !OSSL_PARAM_set_time_t(p->reseed_int, drbg->reseed_time_interval))
  ------------------
  |  Branch (924:12): [True: 0, False: 0]
  ------------------
  925|      0|        return 0;
  926|       |
  927|  17.7k|    if (!OSSL_FIPS_IND_GET_CTX_FROM_PARAM(drbg, p->ind))
  ------------------
  |  |  161|  17.7k|#define OSSL_FIPS_IND_GET_CTX_FROM_PARAM(ctx, params) 1
  ------------------
  |  Branch (927:9): [Folded, False: 17.7k]
  ------------------
  928|      0|        return 0;
  929|       |
  930|  17.7k|    return 1;
  931|  17.7k|}
ossl_drbg_get_ctx_params_no_lock:
  940|  83.6k|{
  941|  83.6k|    size_t cnt = 0;
  942|       |
  943|       |    /* This value never changes once set */
  944|  83.6k|    if (p->maxreq != NULL) {
  ------------------
  |  Branch (944:9): [True: 32.3k, False: 51.2k]
  ------------------
  945|  32.3k|        if (!OSSL_PARAM_set_size_t(p->maxreq, drbg->max_request))
  ------------------
  |  Branch (945:13): [True: 0, False: 32.3k]
  ------------------
  946|      0|            return 0;
  947|  32.3k|        cnt++;
  948|  32.3k|    }
  949|       |
  950|       |    /*
  951|       |     * Can be changed by multiple threads, but we tolerate inaccuracies in this
  952|       |     * value.
  953|       |     */
  954|  83.6k|    if (p->reseed_cnt != NULL) {
  ------------------
  |  Branch (954:9): [True: 33.4k, False: 50.1k]
  ------------------
  955|  33.4k|        if (!OSSL_PARAM_set_uint(p->reseed_cnt, tsan_load(&drbg->reseed_counter)))
  ------------------
  |  |   61|  33.4k|#define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  |  Branch (955:13): [True: 0, False: 33.4k]
  ------------------
  956|      0|            return 0;
  957|  33.4k|        cnt++;
  958|  33.4k|    }
  959|       |
  960|  83.6k|    if (params[cnt].key == NULL)
  ------------------
  |  Branch (960:9): [True: 65.8k, False: 17.7k]
  ------------------
  961|  65.8k|        *complete = 1;
  962|  17.7k|    else
  963|  17.7k|        *complete = 0;
  964|       |
  965|  83.6k|    return 1;
  966|  83.6k|}
ossl_drbg_set_ctx_params:
  970|  1.64k|{
  971|  1.64k|    if (p->reseed_req != NULL
  ------------------
  |  Branch (971:9): [True: 1.64k, False: 0]
  ------------------
  972|  1.64k|        && !OSSL_PARAM_get_uint(p->reseed_req, &drbg->reseed_interval))
  ------------------
  |  Branch (972:12): [True: 0, False: 1.64k]
  ------------------
  973|      0|        return 0;
  974|       |
  975|  1.64k|    if (p->reseed_time != NULL
  ------------------
  |  Branch (975:9): [True: 1.64k, False: 0]
  ------------------
  976|  1.64k|        && !OSSL_PARAM_get_time_t(p->reseed_time, &drbg->reseed_time_interval))
  ------------------
  |  Branch (976:12): [True: 0, False: 1.64k]
  ------------------
  977|      0|        return 0;
  978|       |
  979|  1.64k|    return 1;
  980|  1.64k|}
drbg.c:get_entropy:
  195|  2.74k|{
  196|  2.74k|    size_t bytes;
  197|  2.74k|    unsigned int p_str;
  198|       |
  199|  2.74k|    if (drbg->parent == NULL)
  ------------------
  |  Branch (199:9): [True: 0, False: 2.74k]
  ------------------
  200|       |        /*
  201|       |         * In normal use (i.e. OpenSSL's own uses), this is never called.
  202|       |         * This remains purely for legacy reasons.
  203|       |         */
  204|      0|        return ossl_prov_get_entropy(drbg->provctx, pout, entropy, min_len,
  205|      0|            max_len);
  206|       |
  207|  2.74k|    if (drbg->parent_get_seed == NULL) {
  ------------------
  |  Branch (207:9): [True: 0, False: 2.74k]
  ------------------
  208|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_CANNOT_SUPPLY_ENTROPY_SEED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  209|      0|        return 0;
  210|      0|    }
  211|  2.74k|    if (!get_parent_strength(drbg, &p_str))
  ------------------
  |  Branch (211:9): [True: 0, False: 2.74k]
  ------------------
  212|      0|        return 0;
  213|  2.74k|    if (drbg->strength > p_str) {
  ------------------
  |  Branch (213:9): [True: 0, False: 2.74k]
  ------------------
  214|       |        /*
  215|       |         * We currently don't support the algorithm from NIST SP 800-90C
  216|       |         * 10.1.2 to use a weaker DRBG as source
  217|       |         */
  218|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_STRENGTH_TOO_WEAK);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  219|      0|        return 0;
  220|      0|    }
  221|       |
  222|       |    /*
  223|       |     * Our lock is already held, but we need to lock our parent before
  224|       |     * generating bits from it.  Note: taking the lock will be a no-op
  225|       |     * if locking is not required (while drbg->parent->lock == NULL).
  226|       |     */
  227|  2.74k|    if (!ossl_drbg_lock_parent(drbg))
  ------------------
  |  Branch (227:9): [True: 0, False: 2.74k]
  ------------------
  228|      0|        return 0;
  229|       |    /*
  230|       |     * Get random data from parent.  Include our DRBG address as
  231|       |     * additional input, in order to provide a distinction between
  232|       |     * different DRBG child instances.
  233|       |     *
  234|       |     * Note: using the sizeof() operator on a pointer triggers
  235|       |     *       a warning in some static code analyzers, but it's
  236|       |     *       intentional and correct here.
  237|       |     */
  238|  2.74k|    bytes = drbg->parent_get_seed(drbg->parent, pout,
  239|  2.74k|        entropy > 0 ? entropy : (int)drbg->strength,
  ------------------
  |  Branch (239:9): [True: 2.74k, False: 0]
  ------------------
  240|  2.74k|        min_len, max_len, prediction_resistance,
  241|  2.74k|        (unsigned char *)&drbg, sizeof(drbg));
  242|  2.74k|    ossl_drbg_unlock_parent(drbg);
  243|  2.74k|    return bytes;
  244|  2.74k|}
drbg.c:ossl_drbg_lock_parent:
   64|  45.5k|{
   65|  45.5k|    void *parent = drbg->parent;
   66|       |
   67|  45.5k|    if (parent != NULL
  ------------------
  |  Branch (67:9): [True: 45.5k, False: 0]
  ------------------
   68|  45.5k|        && drbg->parent_lock != NULL
  ------------------
  |  Branch (68:12): [True: 45.5k, False: 0]
  ------------------
   69|  45.5k|        && !drbg->parent_lock(parent)) {
  ------------------
  |  Branch (69:12): [True: 0, False: 45.5k]
  ------------------
   70|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_LOCKING_NOT_ENABLED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   71|      0|        return 0;
   72|      0|    }
   73|  45.5k|    return 1;
   74|  45.5k|}
drbg.c:ossl_drbg_unlock_parent:
   77|  45.5k|{
   78|  45.5k|    void *parent = drbg->parent;
   79|       |
   80|  45.5k|    if (parent != NULL && drbg->parent_unlock != NULL)
  ------------------
  |  Branch (80:9): [True: 45.5k, False: 0]
  |  Branch (80:27): [True: 45.5k, False: 0]
  ------------------
   81|  45.5k|        drbg->parent_unlock(parent);
   82|  45.5k|}
drbg.c:cleanup_entropy:
  247|  2.74k|{
  248|  2.74k|    if (drbg->parent == NULL) {
  ------------------
  |  Branch (248:9): [True: 0, False: 2.74k]
  ------------------
  249|      0|        ossl_prov_cleanup_entropy(drbg->provctx, out, outlen);
  250|  2.74k|    } else if (drbg->parent_clear_seed != NULL) {
  ------------------
  |  Branch (250:16): [True: 2.74k, False: 0]
  ------------------
  251|  2.74k|        if (!ossl_drbg_lock_parent(drbg))
  ------------------
  |  Branch (251:13): [True: 0, False: 2.74k]
  ------------------
  252|      0|            return;
  253|  2.74k|        drbg->parent_clear_seed(drbg->parent, out, outlen);
  254|  2.74k|        ossl_drbg_unlock_parent(drbg);
  255|  2.74k|    }
  256|  2.74k|}
drbg.c:ossl_prov_drbg_reseed_unlocked:
  486|  1.09k|{
  487|  1.09k|    unsigned char *entropy = NULL;
  488|  1.09k|    size_t entropylen = 0;
  489|       |
  490|  1.09k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (490:9): [True: 0, False: 1.09k]
  ------------------
  491|      0|        return 0;
  492|       |
  493|  1.09k|    if (drbg->state != EVP_RAND_STATE_READY) {
  ------------------
  |  | 1346|  1.09k|#define EVP_RAND_STATE_READY 1
  ------------------
  |  Branch (493:9): [True: 0, False: 1.09k]
  ------------------
  494|       |        /* try to recover from previous errors */
  495|      0|        rand_drbg_restart(drbg);
  496|       |
  497|      0|        if (drbg->state == EVP_RAND_STATE_ERROR) {
  ------------------
  |  | 1347|      0|#define EVP_RAND_STATE_ERROR 2
  ------------------
  |  Branch (497:13): [True: 0, False: 0]
  ------------------
  498|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_IN_ERROR_STATE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  499|      0|            return 0;
  500|      0|        }
  501|      0|        if (drbg->state == EVP_RAND_STATE_UNINITIALISED) {
  ------------------
  |  | 1345|      0|#define EVP_RAND_STATE_UNINITIALISED 0
  ------------------
  |  Branch (501:13): [True: 0, False: 0]
  ------------------
  502|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_INSTANTIATED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  503|      0|            return 0;
  504|      0|        }
  505|      0|    }
  506|       |
  507|  1.09k|    if (ent != NULL) {
  ------------------
  |  Branch (507:9): [True: 0, False: 1.09k]
  ------------------
  508|      0|        if (ent_len < drbg->min_entropylen) {
  ------------------
  |  Branch (508:13): [True: 0, False: 0]
  ------------------
  509|      0|            ERR_raise(ERR_LIB_RAND, RAND_R_ENTROPY_OUT_OF_RANGE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  510|      0|            drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1347|      0|#define EVP_RAND_STATE_ERROR 2
  ------------------
  511|      0|            return 0;
  512|      0|        }
  513|      0|        if (ent_len > drbg->max_entropylen) {
  ------------------
  |  Branch (513:13): [True: 0, False: 0]
  ------------------
  514|      0|            ERR_raise(ERR_LIB_RAND, RAND_R_ENTROPY_INPUT_TOO_LONG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  515|      0|            drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1347|      0|#define EVP_RAND_STATE_ERROR 2
  ------------------
  516|      0|            return 0;
  517|      0|        }
  518|      0|    }
  519|       |
  520|  1.09k|    if (adin == NULL) {
  ------------------
  |  Branch (520:9): [True: 1.09k, False: 0]
  ------------------
  521|  1.09k|        adinlen = 0;
  522|  1.09k|    } else if (adinlen > drbg->max_adinlen) {
  ------------------
  |  Branch (522:16): [True: 0, False: 0]
  ------------------
  523|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ADDITIONAL_INPUT_TOO_LONG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  524|      0|        return 0;
  525|      0|    }
  526|       |
  527|  1.09k|    drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1347|  1.09k|#define EVP_RAND_STATE_ERROR 2
  ------------------
  528|       |
  529|  1.09k|    drbg->reseed_next_counter = tsan_load(&drbg->reseed_counter);
  ------------------
  |  |   61|  1.09k|#define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  530|  1.09k|    if (drbg->reseed_next_counter) {
  ------------------
  |  Branch (530:9): [True: 1.09k, False: 0]
  ------------------
  531|  1.09k|        drbg->reseed_next_counter++;
  532|  1.09k|        if (!drbg->reseed_next_counter)
  ------------------
  |  Branch (532:13): [True: 0, False: 1.09k]
  ------------------
  533|      0|            drbg->reseed_next_counter = 1;
  534|  1.09k|    }
  535|       |
  536|  1.09k|    if (ent != NULL) {
  ------------------
  |  Branch (536:9): [True: 0, False: 1.09k]
  ------------------
  537|       |#ifdef FIPS_MODULE
  538|       |        /*
  539|       |         * NIST SP-800-90A mandates that entropy *shall not* be provided
  540|       |         * by the consuming application. Instead the data is added as additional
  541|       |         * input.
  542|       |         *
  543|       |         * (NIST SP-800-90Ar1, Sections 9.1 and 9.2)
  544|       |         */
  545|       |        if (!drbg->reseed(drbg, NULL, 0, ent, ent_len)) {
  546|       |            ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_RESEED);
  547|       |            return 0;
  548|       |        }
  549|       |#else
  550|      0|        if (!drbg->reseed(drbg, ent, ent_len, adin, adinlen)) {
  ------------------
  |  Branch (550:13): [True: 0, False: 0]
  ------------------
  551|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_RESEED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  552|      0|            return 0;
  553|      0|        }
  554|       |        /* There isn't much point adding the same additional input twice */
  555|      0|        adin = NULL;
  556|      0|        adinlen = 0;
  557|      0|#endif
  558|      0|    }
  559|       |
  560|       |    /* Reseed using our sources in addition */
  561|  1.09k|    entropylen = get_entropy(drbg, &entropy, drbg->strength,
  562|  1.09k|        drbg->min_entropylen, drbg->max_entropylen,
  563|  1.09k|        prediction_resistance);
  564|  1.09k|    if (entropylen < drbg->min_entropylen
  ------------------
  |  Branch (564:9): [True: 0, False: 1.09k]
  ------------------
  565|  1.09k|        || entropylen > drbg->max_entropylen) {
  ------------------
  |  Branch (565:12): [True: 0, False: 1.09k]
  ------------------
  566|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_ENTROPY);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  567|      0|        goto end;
  568|      0|    }
  569|       |
  570|  1.09k|    if (!drbg->reseed(drbg, entropy, entropylen, adin, adinlen))
  ------------------
  |  Branch (570:9): [True: 0, False: 1.09k]
  ------------------
  571|      0|        goto end;
  572|       |
  573|  1.09k|    drbg->state = EVP_RAND_STATE_READY;
  ------------------
  |  | 1346|  1.09k|#define EVP_RAND_STATE_READY 1
  ------------------
  574|  1.09k|    drbg->generate_counter = 1;
  575|  1.09k|    drbg->reseed_time = time(NULL);
  576|  1.09k|    tsan_store(&drbg->reseed_counter, drbg->reseed_next_counter);
  ------------------
  |  |   62|  1.09k|#define tsan_store(ptr, val) atomic_store_explicit((ptr), (val), memory_order_relaxed)
  ------------------
  577|  1.09k|    if (drbg->parent != NULL)
  ------------------
  |  Branch (577:9): [True: 1.09k, False: 0]
  ------------------
  578|  1.09k|        drbg->parent_reseed_counter = get_parent_reseed_count(drbg);
  579|       |
  580|  1.09k|end:
  581|  1.09k|    cleanup_entropy(drbg, entropy, entropylen);
  582|  1.09k|    if (drbg->state == EVP_RAND_STATE_READY)
  ------------------
  |  | 1346|  1.09k|#define EVP_RAND_STATE_READY 1
  ------------------
  |  Branch (582:9): [True: 1.09k, False: 0]
  ------------------
  583|  1.09k|        return 1;
  584|      0|    return 0;
  585|  1.09k|}
drbg.c:get_parent_reseed_count:
  110|  35.6k|{
  111|  35.6k|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  35.6k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  35.6k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  112|  35.6k|    void *parent = drbg->parent;
  113|  35.6k|    unsigned int r = 0;
  114|       |
  115|  35.6k|    *params = OSSL_PARAM_construct_uint(OSSL_DRBG_PARAM_RESEED_COUNTER, &r);
  ------------------
  |  |  250|  35.6k|# define OSSL_DRBG_PARAM_RESEED_COUNTER "reseed_counter"
  ------------------
  116|  35.6k|    if (!ossl_drbg_lock_parent(drbg)) {
  ------------------
  |  Branch (116:9): [True: 0, False: 35.6k]
  ------------------
  117|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_LOCK_PARENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  118|      0|        goto err;
  119|      0|    }
  120|  35.6k|    if (!drbg->parent_get_ctx_params(parent, params))
  ------------------
  |  Branch (120:9): [True: 0, False: 35.6k]
  ------------------
  121|      0|        r = 0;
  122|  35.6k|    ossl_drbg_unlock_parent(drbg);
  123|  35.6k|    return r;
  124|       |
  125|      0|err:
  126|      0|    r = tsan_load(&drbg->reseed_counter) - 2;
  ------------------
  |  |   61|      0|#define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  127|      0|    if (r == 0)
  ------------------
  |  Branch (127:9): [True: 0, False: 0]
  ------------------
  128|      0|        r = UINT_MAX;
  129|      0|    return r;
  130|  35.6k|}
drbg.c:find_call:
  748|  11.5k|{
  749|  11.5k|    if (dispatch != NULL)
  ------------------
  |  Branch (749:9): [True: 11.5k, False: 0]
  ------------------
  750|   135k|        while (dispatch->function_id != 0) {
  ------------------
  |  Branch (750:16): [True: 133k, False: 1.64k]
  ------------------
  751|   133k|            if (dispatch->function_id == function)
  ------------------
  |  Branch (751:17): [True: 9.88k, False: 124k]
  ------------------
  752|  9.88k|                return dispatch;
  753|   124k|            dispatch++;
  754|   124k|        }
  755|  1.64k|    return NULL;
  756|  11.5k|}
drbg.c:get_parent_strength:
   85|  4.39k|{
   86|  4.39k|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  4.39k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  4.39k|    { NULL, 0, NULL, 0, 0 }
  ------------------
   87|  4.39k|    void *parent = drbg->parent;
   88|  4.39k|    int res;
   89|       |
   90|  4.39k|    if (drbg->parent_get_ctx_params == NULL) {
  ------------------
  |  Branch (90:9): [True: 0, False: 4.39k]
  ------------------
   91|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_GET_PARENT_STRENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   92|      0|        return 0;
   93|      0|    }
   94|       |
   95|  4.39k|    *params = OSSL_PARAM_construct_uint(OSSL_RAND_PARAM_STRENGTH, str);
  ------------------
  |  |  542|  4.39k|# define OSSL_RAND_PARAM_STRENGTH "strength"
  ------------------
   96|  4.39k|    if (!ossl_drbg_lock_parent(drbg)) {
  ------------------
  |  Branch (96:9): [True: 0, False: 4.39k]
  ------------------
   97|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_LOCK_PARENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   98|      0|        return 0;
   99|      0|    }
  100|  4.39k|    res = drbg->parent_get_ctx_params(parent, params);
  101|  4.39k|    ossl_drbg_unlock_parent(drbg);
  102|  4.39k|    if (!res) {
  ------------------
  |  Branch (102:9): [True: 0, False: 4.39k]
  ------------------
  103|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_GET_PARENT_STRENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  104|      0|        return 0;
  105|      0|    }
  106|  4.39k|    return 1;
  107|  4.39k|}

drbg_ctr.c:drbg_ctr_new_wrapper:
  648|  1.64k|{
  649|  1.64k|    return ossl_rand_drbg_new(provctx, parent, parent_dispatch,
  650|  1.64k|        &drbg_ctr_new, &drbg_ctr_free,
  651|  1.64k|        &drbg_ctr_instantiate, &drbg_ctr_uninstantiate,
  652|  1.64k|        &drbg_ctr_reseed, &drbg_ctr_generate);
  653|  1.64k|}
drbg_ctr.c:drbg_ctr_new:
  633|  1.64k|{
  634|  1.64k|    PROV_DRBG_CTR *ctr;
  635|       |
  636|  1.64k|    ctr = OPENSSL_secure_zalloc(sizeof(*ctr));
  ------------------
  |  |  141|  1.64k|    CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  637|  1.64k|    if (ctr == NULL)
  ------------------
  |  Branch (637:9): [True: 0, False: 1.64k]
  ------------------
  638|      0|        return 0;
  639|       |
  640|  1.64k|    ctr->use_df = 1;
  641|  1.64k|    drbg->data = ctr;
  642|  1.64k|    OSSL_FIPS_IND_INIT(drbg)
  643|  1.64k|    return drbg_ctr_init_lengths(drbg);
  644|  1.64k|}
drbg_ctr.c:drbg_ctr_init_lengths:
  539|  3.29k|{
  540|  3.29k|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  541|  3.29k|    int res = 1;
  542|       |
  543|       |    /* Maximum number of bits per request = 2^19  = 2^16 bytes */
  544|  3.29k|    drbg->max_request = 1 << 16;
  545|  3.29k|    if (ctr->use_df) {
  ------------------
  |  Branch (545:9): [True: 3.29k, False: 0]
  ------------------
  546|  3.29k|        drbg->min_entropylen = 0;
  547|  3.29k|        drbg->max_entropylen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|  3.29k|#define DRBG_MAX_LENGTH INT32_MAX
  ------------------
  548|  3.29k|        drbg->min_noncelen = 0;
  549|  3.29k|        drbg->max_noncelen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|  3.29k|#define DRBG_MAX_LENGTH INT32_MAX
  ------------------
  550|  3.29k|        drbg->max_perslen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|  3.29k|#define DRBG_MAX_LENGTH INT32_MAX
  ------------------
  551|  3.29k|        drbg->max_adinlen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|  3.29k|#define DRBG_MAX_LENGTH INT32_MAX
  ------------------
  552|       |
  553|  3.29k|        if (ctr->keylen > 0) {
  ------------------
  |  Branch (553:13): [True: 1.64k, False: 1.64k]
  ------------------
  554|  1.64k|            drbg->min_entropylen = ctr->keylen;
  555|  1.64k|            drbg->min_noncelen = drbg->min_entropylen / 2;
  556|  1.64k|        }
  557|  3.29k|    } else {
  558|      0|        const size_t len = ctr->keylen > 0 ? drbg->seedlen : DRBG_MAX_LENGTH;
  ------------------
  |  |   41|      0|#define DRBG_MAX_LENGTH INT32_MAX
  ------------------
  |  Branch (558:28): [True: 0, False: 0]
  ------------------
  559|       |
  560|      0|        drbg->min_entropylen = len;
  561|      0|        drbg->max_entropylen = len;
  562|       |        /* Nonce not used */
  563|      0|        drbg->min_noncelen = 0;
  564|      0|        drbg->max_noncelen = 0;
  565|      0|        drbg->max_perslen = len;
  566|      0|        drbg->max_adinlen = len;
  567|      0|    }
  568|  3.29k|    return res;
  569|  3.29k|}
drbg_ctr.c:drbg_ctr_instantiate:
  322|  1.64k|{
  323|  1.64k|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  324|       |
  325|  1.64k|    if (entropy == NULL)
  ------------------
  |  Branch (325:9): [True: 0, False: 1.64k]
  ------------------
  326|      0|        return 0;
  327|       |
  328|  1.64k|    memset(ctr->K, 0, sizeof(ctr->K));
  329|  1.64k|    memset(ctr->V, 0, sizeof(ctr->V));
  330|  1.64k|    if (!EVP_CipherInit_ex(ctr->ctx_ecb, NULL, NULL, ctr->K, NULL, -1))
  ------------------
  |  Branch (330:9): [True: 0, False: 1.64k]
  ------------------
  331|      0|        return 0;
  332|       |
  333|  1.64k|    inc_128(ctr);
  334|  1.64k|    if (!ctr_update(drbg, entropy, entropylen, pers, perslen, nonce, noncelen))
  ------------------
  |  Branch (334:9): [True: 0, False: 1.64k]
  ------------------
  335|      0|        return 0;
  336|  1.64k|    return 1;
  337|  1.64k|}
drbg_ctr.c:inc_128:
   71|   118k|{
   72|   118k|    unsigned char *p = &ctr->V[0];
   73|   118k|    u32 n = 16, c = 1;
   74|       |
   75|  1.89M|    do {
   76|  1.89M|        --n;
   77|  1.89M|        c += p[n];
   78|  1.89M|        p[n] = (u8)c;
   79|  1.89M|        c >>= 8;
   80|  1.89M|    } while (n);
  ------------------
  |  Branch (80:14): [True: 1.77M, False: 118k]
  ------------------
   81|   118k|}
drbg_ctr.c:ctr_update:
  276|  39.5k|{
  277|  39.5k|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  278|  39.5k|    int outlen = AES_BLOCK_SIZE;
  ------------------
  |  |   26|  39.5k|#define AES_BLOCK_SIZE 16
  ------------------
  279|  39.5k|    unsigned char V_tmp[48], out[48];
  280|  39.5k|    unsigned char len;
  281|       |
  282|       |    /* correct key is already set up. */
  283|  39.5k|    memcpy(V_tmp, ctr->V, 16);
  284|  39.5k|    inc_128(ctr);
  285|  39.5k|    memcpy(V_tmp + 16, ctr->V, 16);
  286|  39.5k|    if (ctr->keylen == 16) {
  ------------------
  |  Branch (286:9): [True: 0, False: 39.5k]
  ------------------
  287|      0|        len = 32;
  288|  39.5k|    } else {
  289|  39.5k|        inc_128(ctr);
  290|  39.5k|        memcpy(V_tmp + 32, ctr->V, 16);
  291|  39.5k|        len = 48;
  292|  39.5k|    }
  293|  39.5k|    if (!EVP_CipherUpdate(ctr->ctx_ecb, out, &outlen, V_tmp, len)
  ------------------
  |  Branch (293:9): [True: 0, False: 39.5k]
  ------------------
  294|  39.5k|        || outlen != len)
  ------------------
  |  Branch (294:12): [True: 0, False: 39.5k]
  ------------------
  295|      0|        return 0;
  296|  39.5k|    memcpy(ctr->K, out, ctr->keylen);
  297|  39.5k|    memcpy(ctr->V, out + ctr->keylen, 16);
  298|       |
  299|  39.5k|    if (ctr->use_df) {
  ------------------
  |  Branch (299:9): [True: 39.5k, False: 0]
  ------------------
  300|       |        /* If no input reuse existing derived value */
  301|  39.5k|        if (in1 != NULL || nonce != NULL || in2 != NULL)
  ------------------
  |  Branch (301:13): [True: 4.94k, False: 34.5k]
  |  Branch (301:28): [True: 0, False: 34.5k]
  |  Branch (301:45): [True: 0, False: 34.5k]
  ------------------
  302|  4.94k|            if (!ctr_df(ctr, in1, in1len, nonce, noncelen, in2, in2len))
  ------------------
  |  Branch (302:17): [True: 0, False: 4.94k]
  ------------------
  303|      0|                return 0;
  304|       |        /* If this a reuse input in1len != 0 */
  305|  39.5k|        if (in1len)
  ------------------
  |  Branch (305:13): [True: 7.13k, False: 32.3k]
  ------------------
  306|  7.13k|            ctr_XOR(ctr, ctr->KX, drbg->seedlen);
  307|  39.5k|    } else {
  308|      0|        ctr_XOR(ctr, in1, in1len);
  309|      0|        ctr_XOR(ctr, in2, in2len);
  310|      0|    }
  311|       |
  312|  39.5k|    if (!EVP_CipherInit_ex(ctr->ctx_ecb, NULL, NULL, ctr->K, NULL, -1)
  ------------------
  |  Branch (312:9): [True: 0, False: 39.5k]
  ------------------
  313|  39.5k|        || !EVP_CipherInit_ex(ctr->ctx_ctr, NULL, NULL, ctr->K, NULL, -1))
  ------------------
  |  Branch (313:12): [True: 0, False: 39.5k]
  ------------------
  314|      0|        return 0;
  315|  39.5k|    return 1;
  316|  39.5k|}
drbg_ctr.c:ctr_df:
  213|  4.94k|{
  214|  4.94k|    static unsigned char c80 = 0x80;
  215|  4.94k|    size_t inlen;
  216|  4.94k|    unsigned char *p = ctr->bltmp;
  217|  4.94k|    int outlen = AES_BLOCK_SIZE;
  ------------------
  |  |   26|  4.94k|#define AES_BLOCK_SIZE 16
  ------------------
  218|       |
  219|  4.94k|    if (!ctr_BCC_init(ctr))
  ------------------
  |  Branch (219:9): [True: 0, False: 4.94k]
  ------------------
  220|      0|        return 0;
  221|  4.94k|    if (in1 == NULL)
  ------------------
  |  Branch (221:9): [True: 0, False: 4.94k]
  ------------------
  222|      0|        in1len = 0;
  223|  4.94k|    if (in2 == NULL)
  ------------------
  |  Branch (223:9): [True: 4.94k, False: 0]
  ------------------
  224|  4.94k|        in2len = 0;
  225|  4.94k|    if (in3 == NULL)
  ------------------
  |  Branch (225:9): [True: 3.29k, False: 1.64k]
  ------------------
  226|  3.29k|        in3len = 0;
  227|  4.94k|    inlen = in1len + in2len + in3len;
  228|       |    /* Initialise L||N in temporary block */
  229|  4.94k|    *p++ = (inlen >> 24) & 0xff;
  230|  4.94k|    *p++ = (inlen >> 16) & 0xff;
  231|  4.94k|    *p++ = (inlen >> 8) & 0xff;
  232|  4.94k|    *p++ = inlen & 0xff;
  233|       |
  234|       |    /* NB keylen is at most 32 bytes */
  235|  4.94k|    *p++ = 0;
  236|  4.94k|    *p++ = 0;
  237|  4.94k|    *p++ = 0;
  238|  4.94k|    *p = (unsigned char)((ctr->keylen + 16) & 0xff);
  239|  4.94k|    ctr->bltmp_pos = 8;
  240|  4.94k|    if (!ctr_BCC_update(ctr, in1, in1len)
  ------------------
  |  Branch (240:9): [True: 0, False: 4.94k]
  ------------------
  241|  4.94k|        || !ctr_BCC_update(ctr, in2, in2len)
  ------------------
  |  Branch (241:12): [True: 0, False: 4.94k]
  ------------------
  242|  4.94k|        || !ctr_BCC_update(ctr, in3, in3len)
  ------------------
  |  Branch (242:12): [True: 0, False: 4.94k]
  ------------------
  243|  4.94k|        || !ctr_BCC_update(ctr, &c80, 1)
  ------------------
  |  Branch (243:12): [True: 0, False: 4.94k]
  ------------------
  244|  4.94k|        || !ctr_BCC_final(ctr))
  ------------------
  |  Branch (244:12): [True: 0, False: 4.94k]
  ------------------
  245|      0|        return 0;
  246|       |    /* Set up key K */
  247|  4.94k|    if (!EVP_CipherInit_ex(ctr->ctx_ecb, NULL, NULL, ctr->KX, NULL, -1))
  ------------------
  |  Branch (247:9): [True: 0, False: 4.94k]
  ------------------
  248|      0|        return 0;
  249|       |    /* X follows key K */
  250|  4.94k|    if (!EVP_CipherUpdate(ctr->ctx_ecb, ctr->KX, &outlen, ctr->KX + ctr->keylen,
  ------------------
  |  Branch (250:9): [True: 0, False: 4.94k]
  ------------------
  251|  4.94k|            AES_BLOCK_SIZE)
  ------------------
  |  |   26|  4.94k|#define AES_BLOCK_SIZE 16
  ------------------
  252|  4.94k|        || outlen != AES_BLOCK_SIZE)
  ------------------
  |  |   26|  4.94k|#define AES_BLOCK_SIZE 16
  ------------------
  |  Branch (252:12): [True: 0, False: 4.94k]
  ------------------
  253|      0|        return 0;
  254|  4.94k|    if (!EVP_CipherUpdate(ctr->ctx_ecb, ctr->KX + 16, &outlen, ctr->KX,
  ------------------
  |  Branch (254:9): [True: 0, False: 4.94k]
  ------------------
  255|  4.94k|            AES_BLOCK_SIZE)
  ------------------
  |  |   26|  4.94k|#define AES_BLOCK_SIZE 16
  ------------------
  256|  4.94k|        || outlen != AES_BLOCK_SIZE)
  ------------------
  |  |   26|  4.94k|#define AES_BLOCK_SIZE 16
  ------------------
  |  Branch (256:12): [True: 0, False: 4.94k]
  ------------------
  257|      0|        return 0;
  258|  4.94k|    if (ctr->keylen != 16)
  ------------------
  |  Branch (258:9): [True: 4.94k, False: 0]
  ------------------
  259|  4.94k|        if (!EVP_CipherUpdate(ctr->ctx_ecb, ctr->KX + 32, &outlen,
  ------------------
  |  Branch (259:13): [True: 0, False: 4.94k]
  ------------------
  260|  4.94k|                ctr->KX + 16, AES_BLOCK_SIZE)
  ------------------
  |  |   26|  4.94k|#define AES_BLOCK_SIZE 16
  ------------------
  261|  4.94k|            || outlen != AES_BLOCK_SIZE)
  ------------------
  |  |   26|  4.94k|#define AES_BLOCK_SIZE 16
  ------------------
  |  Branch (261:16): [True: 0, False: 4.94k]
  ------------------
  262|      0|            return 0;
  263|  4.94k|    return 1;
  264|  4.94k|}
drbg_ctr.c:ctr_BCC_init:
  150|  4.94k|{
  151|  4.94k|    unsigned char bltmp[48] = { 0 };
  152|  4.94k|    unsigned char num_of_blk;
  153|       |
  154|  4.94k|    memset(ctr->KX, 0, 48);
  155|  4.94k|    num_of_blk = ctr->keylen == 16 ? 2 : 3;
  ------------------
  |  Branch (155:18): [True: 0, False: 4.94k]
  ------------------
  156|  4.94k|    bltmp[(AES_BLOCK_SIZE * 1) + 3] = 1;
  ------------------
  |  |   26|  4.94k|#define AES_BLOCK_SIZE 16
  ------------------
  157|  4.94k|    bltmp[(AES_BLOCK_SIZE * 2) + 3] = 2;
  ------------------
  |  |   26|  4.94k|#define AES_BLOCK_SIZE 16
  ------------------
  158|  4.94k|    return ctr_BCC_block(ctr, ctr->KX, bltmp, num_of_blk * AES_BLOCK_SIZE);
  ------------------
  |  |   26|  4.94k|#define AES_BLOCK_SIZE 16
  ------------------
  159|  4.94k|}
drbg_ctr.c:ctr_BCC_block:
  116|  22.5k|{
  117|  22.5k|    int i, outlen = AES_BLOCK_SIZE;
  ------------------
  |  |   26|  22.5k|#define AES_BLOCK_SIZE 16
  ------------------
  118|       |
  119|  1.10M|    for (i = 0; i < len; i++)
  ------------------
  |  Branch (119:17): [True: 1.08M, False: 22.5k]
  ------------------
  120|  1.08M|        out[i] ^= in[i];
  121|       |
  122|  22.5k|    if (!EVP_CipherUpdate(ctr->ctx_df, out, &outlen, out, len)
  ------------------
  |  Branch (122:9): [True: 0, False: 22.5k]
  ------------------
  123|  22.5k|        || outlen != len)
  ------------------
  |  Branch (123:12): [True: 0, False: 22.5k]
  ------------------
  124|      0|        return 0;
  125|  22.5k|    return 1;
  126|  22.5k|}
drbg_ctr.c:ctr_BCC_update:
  166|  19.7k|{
  167|  19.7k|    if (in == NULL || inlen == 0)
  ------------------
  |  Branch (167:9): [True: 8.23k, False: 11.5k]
  |  Branch (167:23): [True: 0, False: 11.5k]
  ------------------
  168|  8.23k|        return 1;
  169|       |
  170|       |    /* If we have partial block handle it first */
  171|  11.5k|    if (ctr->bltmp_pos) {
  ------------------
  |  Branch (171:9): [True: 9.33k, False: 2.19k]
  ------------------
  172|  9.33k|        size_t left = 16 - ctr->bltmp_pos;
  173|       |
  174|       |        /* If we now have a complete block process it */
  175|  9.33k|        if (inlen >= left) {
  ------------------
  |  Branch (175:13): [True: 6.58k, False: 2.74k]
  ------------------
  176|  6.58k|            memcpy(ctr->bltmp + ctr->bltmp_pos, in, left);
  177|  6.58k|            if (!ctr_BCC_blocks(ctr, ctr->bltmp))
  ------------------
  |  Branch (177:17): [True: 0, False: 6.58k]
  ------------------
  178|      0|                return 0;
  179|  6.58k|            ctr->bltmp_pos = 0;
  180|  6.58k|            inlen -= left;
  181|  6.58k|            in += left;
  182|  6.58k|        }
  183|  9.33k|    }
  184|       |
  185|       |    /* Process zero or more complete blocks */
  186|  17.5k|    for (; inlen >= 16; in += 16, inlen -= 16) {
  ------------------
  |  Branch (186:12): [True: 6.03k, False: 11.5k]
  ------------------
  187|  6.03k|        if (!ctr_BCC_blocks(ctr, in))
  ------------------
  |  Branch (187:13): [True: 0, False: 6.03k]
  ------------------
  188|      0|            return 0;
  189|  6.03k|    }
  190|       |
  191|       |    /* Copy any remaining partial block to the temporary buffer */
  192|  11.5k|    if (inlen > 0) {
  ------------------
  |  Branch (192:9): [True: 9.33k, False: 2.19k]
  ------------------
  193|  9.33k|        memcpy(ctr->bltmp + ctr->bltmp_pos, in, inlen);
  194|  9.33k|        ctr->bltmp_pos += inlen;
  195|  9.33k|    }
  196|  11.5k|    return 1;
  197|  11.5k|}
drbg_ctr.c:ctr_BCC_blocks:
  132|  17.5k|{
  133|  17.5k|    unsigned char in_tmp[48];
  134|  17.5k|    unsigned char num_of_blk = 2;
  135|       |
  136|  17.5k|    memcpy(in_tmp, in, 16);
  137|  17.5k|    memcpy(in_tmp + 16, in, 16);
  138|  17.5k|    if (ctr->keylen != 16) {
  ------------------
  |  Branch (138:9): [True: 17.5k, False: 0]
  ------------------
  139|  17.5k|        memcpy(in_tmp + 32, in, 16);
  140|  17.5k|        num_of_blk = 3;
  141|  17.5k|    }
  142|  17.5k|    return ctr_BCC_block(ctr, ctr->KX, in_tmp, AES_BLOCK_SIZE * num_of_blk);
  ------------------
  |  |   26|  17.5k|#define AES_BLOCK_SIZE 16
  ------------------
  143|  17.5k|}
drbg_ctr.c:ctr_BCC_final:
  200|  4.94k|{
  201|  4.94k|    if (ctr->bltmp_pos) {
  ------------------
  |  Branch (201:9): [True: 4.94k, False: 0]
  ------------------
  202|  4.94k|        memset(ctr->bltmp + ctr->bltmp_pos, 0, 16 - ctr->bltmp_pos);
  203|  4.94k|        if (!ctr_BCC_blocks(ctr, ctr->bltmp))
  ------------------
  |  Branch (203:13): [True: 0, False: 4.94k]
  ------------------
  204|      0|            return 0;
  205|  4.94k|    }
  206|  4.94k|    return 1;
  207|  4.94k|}
drbg_ctr.c:ctr_XOR:
   84|  7.13k|{
   85|  7.13k|    size_t i, n;
   86|       |
   87|  7.13k|    if (in == NULL || inlen == 0)
  ------------------
  |  Branch (87:9): [True: 0, False: 7.13k]
  |  Branch (87:23): [True: 0, False: 7.13k]
  ------------------
   88|      0|        return;
   89|       |
   90|       |    /*
   91|       |     * Any zero padding will have no effect on the result as we
   92|       |     * are XORing. So just process however much input we have.
   93|       |     */
   94|  7.13k|    n = inlen < ctr->keylen ? inlen : ctr->keylen;
  ------------------
  |  Branch (94:9): [True: 0, False: 7.13k]
  ------------------
   95|  7.13k|    if (!ossl_assert(n <= sizeof(ctr->K)))
  ------------------
  |  |   52|  7.13k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  7.13k|    __FILE__, __LINE__)
  ------------------
  |  Branch (95:9): [True: 0, False: 7.13k]
  ------------------
   96|      0|        return;
   97|   235k|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (97:17): [True: 228k, False: 7.13k]
  ------------------
   98|   228k|        ctr->K[i] ^= in[i];
   99|  7.13k|    if (inlen <= ctr->keylen)
  ------------------
  |  Branch (99:9): [True: 0, False: 7.13k]
  ------------------
  100|      0|        return;
  101|       |
  102|  7.13k|    n = inlen - ctr->keylen;
  103|  7.13k|    if (n > 16) {
  ------------------
  |  Branch (103:9): [True: 0, False: 7.13k]
  ------------------
  104|       |        /* Should never happen */
  105|      0|        n = 16;
  106|      0|    }
  107|   121k|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (107:17): [True: 114k, False: 7.13k]
  ------------------
  108|   114k|        ctr->V[i] ^= in[i + ctr->keylen];
  109|  7.13k|}
drbg_ctr.c:drbg_ctr_reseed:
  369|  1.09k|{
  370|  1.09k|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  371|       |
  372|  1.09k|    if (entropy == NULL)
  ------------------
  |  Branch (372:9): [True: 0, False: 1.09k]
  ------------------
  373|      0|        return 0;
  374|       |
  375|  1.09k|    inc_128(ctr);
  376|  1.09k|    if (!ctr_update(drbg, entropy, entropylen, adin, adinlen, NULL, 0))
  ------------------
  |  Branch (376:9): [True: 0, False: 1.09k]
  ------------------
  377|      0|        return 0;
  378|  1.09k|    return 1;
  379|  1.09k|}
drbg_ctr.c:drbg_ctr_generate:
  406|  34.5k|{
  407|  34.5k|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  408|  34.5k|    unsigned int ctr32, blocks;
  409|  34.5k|    int outl, buflen;
  410|       |
  411|  34.5k|    if (adin != NULL && adinlen != 0) {
  ------------------
  |  Branch (411:9): [True: 2.19k, False: 32.3k]
  |  Branch (411:25): [True: 2.19k, False: 0]
  ------------------
  412|  2.19k|        inc_128(ctr);
  413|       |
  414|  2.19k|        if (!ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0))
  ------------------
  |  Branch (414:13): [True: 0, False: 2.19k]
  ------------------
  415|      0|            return 0;
  416|       |        /* This means we reuse derived value */
  417|  2.19k|        if (ctr->use_df) {
  ------------------
  |  Branch (417:13): [True: 2.19k, False: 0]
  ------------------
  418|  2.19k|            adin = NULL;
  419|  2.19k|            adinlen = 1;
  420|  2.19k|        }
  421|  32.3k|    } else {
  422|  32.3k|        adinlen = 0;
  423|  32.3k|    }
  424|       |
  425|  34.5k|    inc_128(ctr);
  426|       |
  427|  34.5k|    if (outlen == 0) {
  ------------------
  |  Branch (427:9): [True: 0, False: 34.5k]
  ------------------
  428|      0|        inc_128(ctr);
  429|       |
  430|      0|        if (!ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0))
  ------------------
  |  Branch (430:13): [True: 0, False: 0]
  ------------------
  431|      0|            return 0;
  432|      0|        return 1;
  433|      0|    }
  434|       |
  435|  34.5k|    memset(out, 0, outlen);
  436|       |
  437|  34.5k|    do {
  438|  34.5k|        if (!EVP_CipherInit_ex(ctr->ctx_ctr,
  ------------------
  |  Branch (438:13): [True: 0, False: 34.5k]
  ------------------
  439|  34.5k|                NULL, NULL, NULL, ctr->V, -1))
  440|      0|            return 0;
  441|       |
  442|       |        /*-
  443|       |         * outlen has type size_t while EVP_CipherUpdate takes an
  444|       |         * int argument and thus cannot be guaranteed to process more
  445|       |         * than 2^31-1 bytes at a time. We process such huge generate
  446|       |         * requests in 2^30 byte chunks, which is the greatest multiple
  447|       |         * of AES block size lower than or equal to 2^31-1.
  448|       |         */
  449|  34.5k|        buflen = outlen > (1U << 30) ? (1 << 30) : (int)outlen;
  ------------------
  |  Branch (449:18): [True: 0, False: 34.5k]
  ------------------
  450|  34.5k|        blocks = (buflen + 15) / 16;
  451|       |
  452|  34.5k|        ctr32 = GETU32(ctr->V + 12) + blocks;
  ------------------
  |  |   98|  34.5k|#define GETU32(p) ((u32)(p)[0] << 24 | (u32)(p)[1] << 16 | (u32)(p)[2] << 8 | (u32)(p)[3])
  ------------------
  453|  34.5k|        if (ctr32 < blocks) {
  ------------------
  |  Branch (453:13): [True: 0, False: 34.5k]
  ------------------
  454|       |            /* 32-bit counter overflow into V. */
  455|      0|            if (ctr32 != 0) {
  ------------------
  |  Branch (455:17): [True: 0, False: 0]
  ------------------
  456|      0|                blocks -= ctr32;
  457|      0|                buflen = blocks * 16;
  458|      0|                ctr32 = 0;
  459|      0|            }
  460|      0|            ctr96_inc(ctr->V);
  461|      0|        }
  462|  34.5k|        PUTU32(ctr->V + 12, ctr32);
  ------------------
  |  |   99|  34.5k|#define PUTU32(p, v) ((p)[0] = (u8)((v) >> 24), (p)[1] = (u8)((v) >> 16), (p)[2] = (u8)((v) >> 8), (p)[3] = (u8)(v))
  ------------------
  463|       |
  464|  34.5k|        if (!EVP_CipherUpdate(ctr->ctx_ctr, out, &outl, out, buflen)
  ------------------
  |  Branch (464:13): [True: 0, False: 34.5k]
  ------------------
  465|  34.5k|            || outl != buflen)
  ------------------
  |  Branch (465:16): [True: 0, False: 34.5k]
  ------------------
  466|      0|            return 0;
  467|       |
  468|  34.5k|        out += buflen;
  469|  34.5k|        outlen -= buflen;
  470|  34.5k|    } while (outlen);
  ------------------
  |  Branch (470:14): [True: 0, False: 34.5k]
  ------------------
  471|       |
  472|  34.5k|    if (!ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0))
  ------------------
  |  Branch (472:9): [True: 0, False: 34.5k]
  ------------------
  473|      0|        return 0;
  474|  34.5k|    return 1;
  475|  34.5k|}
drbg_ctr.c:drbg_ctr_free:
  656|  1.64k|{
  657|  1.64k|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  658|  1.64k|    PROV_DRBG_CTR *ctr;
  659|       |
  660|  1.64k|    if (drbg != NULL && (ctr = (PROV_DRBG_CTR *)drbg->data) != NULL) {
  ------------------
  |  Branch (660:9): [True: 1.64k, False: 0]
  |  Branch (660:25): [True: 1.64k, False: 0]
  ------------------
  661|  1.64k|        EVP_CIPHER_CTX_free(ctr->ctx_ecb);
  662|  1.64k|        EVP_CIPHER_CTX_free(ctr->ctx_ctr);
  663|  1.64k|        EVP_CIPHER_CTX_free(ctr->ctx_df);
  664|  1.64k|        EVP_CIPHER_free(ctr->cipher_ecb);
  665|  1.64k|        EVP_CIPHER_free(ctr->cipher_ctr);
  666|       |
  667|  1.64k|        OPENSSL_secure_clear_free(ctr, sizeof(*ctr));
  ------------------
  |  |  149|  1.64k|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  668|  1.64k|    }
  669|  1.64k|    ossl_rand_drbg_free(drbg);
  670|  1.64k|}
drbg_ctr.c:drbg_ctr_instantiate_wrapper:
  344|  1.64k|{
  345|  1.64k|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  346|  1.64k|    struct drbg_set_ctx_params_st p;
  347|  1.64k|    int ret = 0;
  348|       |
  349|  1.64k|    if (drbg == NULL || !drbg_ctr_set_ctx_params_decoder(params, &p))
  ------------------
  |  Branch (349:9): [True: 0, False: 1.64k]
  |  Branch (349:25): [True: 0, False: 1.64k]
  ------------------
  350|      0|        return 0;
  351|       |
  352|  1.64k|    if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
  ------------------
  |  Branch (352:9): [True: 0, False: 1.64k]
  |  Branch (352:31): [True: 0, False: 0]
  ------------------
  353|      0|        return 0;
  354|       |
  355|  1.64k|    if (!ossl_prov_is_running()
  ------------------
  |  Branch (355:9): [True: 0, False: 1.64k]
  ------------------
  356|  1.64k|        || !drbg_ctr_set_ctx_params_locked(drbg, &p))
  ------------------
  |  Branch (356:12): [True: 0, False: 1.64k]
  ------------------
  357|      0|        goto err;
  358|  1.64k|    ret = ossl_prov_drbg_instantiate(drbg, strength, prediction_resistance,
  359|  1.64k|        pstr, pstr_len);
  360|  1.64k|err:
  361|  1.64k|    if (drbg->lock != NULL)
  ------------------
  |  Branch (361:9): [True: 0, False: 1.64k]
  ------------------
  362|      0|        CRYPTO_THREAD_unlock(drbg->lock);
  363|  1.64k|    return ret;
  364|  1.64k|}
drbg_ctr.c:drbg_ctr_set_ctx_params_decoder:
 1180|  1.64k|{
 1181|  1.64k|    const char *s;
 1182|       |
 1183|  1.64k|    memset(r, 0, sizeof(*r));
 1184|  1.64k|    if (p != NULL)
  ------------------
  |  Branch (1184:9): [True: 1.64k, False: 0]
  ------------------
 1185|  9.88k|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (1185:16): [True: 8.23k, False: 1.64k]
  ------------------
 1186|  8.23k|            switch(s[0]) {
 1187|      0|            default:
  ------------------
  |  Branch (1187:13): [True: 0, False: 8.23k]
  ------------------
 1188|      0|                break;
 1189|  1.64k|            case 'c':
  ------------------
  |  Branch (1189:13): [True: 1.64k, False: 6.58k]
  ------------------
 1190|  1.64k|                if (ossl_likely(strcmp("ipher", s + 1) == 0)) {
  ------------------
  |  |   22|  1.64k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 1.64k, False: 0]
  |  |  ------------------
  ------------------
 1191|       |                    /* OSSL_DRBG_PARAM_CIPHER */
 1192|  1.64k|                    if (ossl_unlikely(r->cipher != NULL)) {
  ------------------
  |  |   23|  1.64k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.64k]
  |  |  ------------------
  ------------------
 1193|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
 1194|      0|                                       "param %s is repeated", s);
 1195|      0|                        return 0;
 1196|      0|                    }
 1197|  1.64k|                    r->cipher = (OSSL_PARAM *)p;
 1198|  1.64k|                }
 1199|  1.64k|                break;
 1200|  1.64k|            case 'p':
  ------------------
  |  Branch (1200:13): [True: 1.64k, False: 6.58k]
  ------------------
 1201|  1.64k|                switch(s[1]) {
 1202|      0|                default:
  ------------------
  |  Branch (1202:17): [True: 0, False: 1.64k]
  ------------------
 1203|      0|                    break;
 1204|  1.64k|                case 'r':
  ------------------
  |  Branch (1204:17): [True: 1.64k, False: 0]
  ------------------
 1205|  1.64k|                    switch(s[2]) {
 1206|      0|                    default:
  ------------------
  |  Branch (1206:21): [True: 0, False: 1.64k]
  ------------------
 1207|      0|                        break;
 1208|  1.64k|                    case 'o':
  ------------------
  |  Branch (1208:21): [True: 1.64k, False: 0]
  ------------------
 1209|  1.64k|                        switch(s[3]) {
 1210|      0|                        default:
  ------------------
  |  Branch (1210:25): [True: 0, False: 1.64k]
  ------------------
 1211|      0|                            break;
 1212|      0|                        case 'p':
  ------------------
  |  Branch (1212:25): [True: 0, False: 1.64k]
  ------------------
 1213|      0|                            if (ossl_likely(strcmp("erties", s + 4) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1214|       |                                /* OSSL_DRBG_PARAM_PROPERTIES */
 1215|      0|                                if (ossl_unlikely(r->propq != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1216|      0|                                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
 1217|      0|                                                   "param %s is repeated", s);
 1218|      0|                                    return 0;
 1219|      0|                                }
 1220|      0|                                r->propq = (OSSL_PARAM *)p;
 1221|      0|                            }
 1222|      0|                            break;
 1223|  1.64k|                        case 'v':
  ------------------
  |  Branch (1223:25): [True: 1.64k, False: 0]
  ------------------
 1224|  1.64k|                            if (ossl_likely(strcmp("ider-name", s + 4) == 0)) {
  ------------------
  |  |   22|  1.64k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 1.64k, False: 0]
  |  |  ------------------
  ------------------
 1225|       |                                /* OSSL_PROV_PARAM_CORE_PROV_NAME */
 1226|  1.64k|                                if (ossl_unlikely(r->prov != NULL)) {
  ------------------
  |  |   23|  1.64k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.64k]
  |  |  ------------------
  ------------------
 1227|      0|                                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
 1228|      0|                                                   "param %s is repeated", s);
 1229|      0|                                    return 0;
 1230|      0|                                }
 1231|  1.64k|                                r->prov = (OSSL_PARAM *)p;
 1232|  1.64k|                            }
 1233|  1.64k|                        }
 1234|  1.64k|                    }
 1235|  1.64k|                }
 1236|  1.64k|                break;
 1237|  3.29k|            case 'r':
  ------------------
  |  Branch (1237:13): [True: 3.29k, False: 4.94k]
  ------------------
 1238|  3.29k|                switch(s[1]) {
 1239|      0|                default:
  ------------------
  |  Branch (1239:17): [True: 0, False: 3.29k]
  ------------------
 1240|      0|                    break;
 1241|  3.29k|                case 'e':
  ------------------
  |  Branch (1241:17): [True: 3.29k, False: 0]
  ------------------
 1242|  3.29k|                    switch(s[2]) {
 1243|      0|                    default:
  ------------------
  |  Branch (1243:21): [True: 0, False: 3.29k]
  ------------------
 1244|      0|                        break;
 1245|  3.29k|                    case 's':
  ------------------
  |  Branch (1245:21): [True: 3.29k, False: 0]
  ------------------
 1246|  3.29k|                        switch(s[3]) {
 1247|      0|                        default:
  ------------------
  |  Branch (1247:25): [True: 0, False: 3.29k]
  ------------------
 1248|      0|                            break;
 1249|  3.29k|                        case 'e':
  ------------------
  |  Branch (1249:25): [True: 3.29k, False: 0]
  ------------------
 1250|  3.29k|                            switch(s[4]) {
 1251|      0|                            default:
  ------------------
  |  Branch (1251:29): [True: 0, False: 3.29k]
  ------------------
 1252|      0|                                break;
 1253|  3.29k|                            case 'e':
  ------------------
  |  Branch (1253:29): [True: 3.29k, False: 0]
  ------------------
 1254|  3.29k|                                switch(s[5]) {
 1255|      0|                                default:
  ------------------
  |  Branch (1255:33): [True: 0, False: 3.29k]
  ------------------
 1256|      0|                                    break;
 1257|  3.29k|                                case 'd':
  ------------------
  |  Branch (1257:33): [True: 3.29k, False: 0]
  ------------------
 1258|  3.29k|                                    switch(s[6]) {
 1259|      0|                                    default:
  ------------------
  |  Branch (1259:37): [True: 0, False: 3.29k]
  ------------------
 1260|      0|                                        break;
 1261|  3.29k|                                    case '_':
  ------------------
  |  Branch (1261:37): [True: 3.29k, False: 0]
  ------------------
 1262|  3.29k|                                        switch(s[7]) {
 1263|      0|                                        default:
  ------------------
  |  Branch (1263:41): [True: 0, False: 3.29k]
  ------------------
 1264|      0|                                            break;
 1265|  1.64k|                                        case 'r':
  ------------------
  |  Branch (1265:41): [True: 1.64k, False: 1.64k]
  ------------------
 1266|  1.64k|                                            if (ossl_likely(strcmp("equests", s + 8) == 0)) {
  ------------------
  |  |   22|  1.64k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 1.64k, False: 0]
  |  |  ------------------
  ------------------
 1267|       |                                                /* OSSL_DRBG_PARAM_RESEED_REQUESTS */
 1268|  1.64k|                                                if (ossl_unlikely(r->reseed_req != NULL)) {
  ------------------
  |  |   23|  1.64k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.64k]
  |  |  ------------------
  ------------------
 1269|      0|                                                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
 1270|      0|                                                                   "param %s is repeated", s);
 1271|      0|                                                    return 0;
 1272|      0|                                                }
 1273|  1.64k|                                                r->reseed_req = (OSSL_PARAM *)p;
 1274|  1.64k|                                            }
 1275|  1.64k|                                            break;
 1276|  1.64k|                                        case 't':
  ------------------
  |  Branch (1276:41): [True: 1.64k, False: 1.64k]
  ------------------
 1277|  1.64k|                                            if (ossl_likely(strcmp("ime_interval", s + 8) == 0)) {
  ------------------
  |  |   22|  1.64k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 1.64k, False: 0]
  |  |  ------------------
  ------------------
 1278|       |                                                /* OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL */
 1279|  1.64k|                                                if (ossl_unlikely(r->reseed_time != NULL)) {
  ------------------
  |  |   23|  1.64k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.64k]
  |  |  ------------------
  ------------------
 1280|      0|                                                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
 1281|      0|                                                                   "param %s is repeated", s);
 1282|      0|                                                    return 0;
 1283|      0|                                                }
 1284|  1.64k|                                                r->reseed_time = (OSSL_PARAM *)p;
 1285|  1.64k|                                            }
 1286|  3.29k|                                        }
 1287|  3.29k|                                    }
 1288|  3.29k|                                }
 1289|  3.29k|                            }
 1290|  3.29k|                        }
 1291|  3.29k|                    }
 1292|  3.29k|                }
 1293|  3.29k|                break;
 1294|  3.29k|            case 'u':
  ------------------
  |  Branch (1294:13): [True: 1.64k, False: 6.58k]
  ------------------
 1295|  1.64k|                if (ossl_likely(strcmp("se_derivation_function", s + 1) == 0)) {
  ------------------
  |  |   22|  1.64k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 1.64k, False: 0]
  |  |  ------------------
  ------------------
 1296|       |                    /* OSSL_DRBG_PARAM_USE_DF */
 1297|  1.64k|                    if (ossl_unlikely(r->df != NULL)) {
  ------------------
  |  |   23|  1.64k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.64k]
  |  |  ------------------
  ------------------
 1298|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
 1299|      0|                                       "param %s is repeated", s);
 1300|      0|                        return 0;
 1301|      0|                    }
 1302|  1.64k|                    r->df = (OSSL_PARAM *)p;
 1303|  1.64k|                }
 1304|  8.23k|            }
 1305|  1.64k|    return 1;
 1306|  1.64k|}
drbg_ctr.c:drbg_ctr_set_ctx_params_locked:
 1063|  1.64k|{
 1064|  1.64k|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)ctx->data;
 1065|  1.64k|    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
  ------------------
  |  |   31|  1.64k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
 1066|  1.64k|    OSSL_PROVIDER *prov = NULL;
 1067|  1.64k|    char *ecb;
 1068|  1.64k|    const char *propquery = NULL;
 1069|  1.64k|    int i, cipher_init = 0;
 1070|       |
 1071|  1.64k|    if (p->df != NULL && OSSL_PARAM_get_int(p->df, &i)) {
  ------------------
  |  Branch (1071:9): [True: 1.64k, False: 0]
  |  Branch (1071:26): [True: 1.64k, False: 0]
  ------------------
 1072|       |        /* FIPS errors out in the drbg_ctr_init() call later */
 1073|  1.64k|        ctr->use_df = i != 0;
 1074|  1.64k|        cipher_init = 1;
 1075|  1.64k|    }
 1076|       |
 1077|  1.64k|    if (p->propq != NULL) {
  ------------------
  |  Branch (1077:9): [True: 0, False: 1.64k]
  ------------------
 1078|      0|        if (p->propq->data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      0|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (1078:13): [True: 0, False: 0]
  ------------------
 1079|      0|            return 0;
 1080|      0|        propquery = (const char *)p->propq->data;
 1081|      0|    }
 1082|       |
 1083|  1.64k|    if (p->prov != NULL) {
  ------------------
  |  Branch (1083:9): [True: 1.64k, False: 0]
  ------------------
 1084|  1.64k|        if (p->prov->data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|  1.64k|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (1084:13): [True: 0, False: 1.64k]
  ------------------
 1085|      0|            return 0;
 1086|  1.64k|        if ((prov = ossl_provider_find(libctx,
  ------------------
  |  Branch (1086:13): [True: 0, False: 1.64k]
  ------------------
 1087|  1.64k|                 (const char *)p->prov->data, 1))
 1088|  1.64k|            == NULL)
 1089|      0|            return 0;
 1090|  1.64k|    }
 1091|       |
 1092|  1.64k|    if (p->cipher != NULL) {
  ------------------
  |  Branch (1092:9): [True: 1.64k, False: 0]
  ------------------
 1093|  1.64k|        const char *base = (const char *)p->cipher->data;
 1094|  1.64k|        size_t ctr_str_len = sizeof("CTR") - 1;
 1095|  1.64k|        size_t ecb_str_len = sizeof("ECB") - 1;
 1096|       |
 1097|  1.64k|        if (p->cipher->data_type != OSSL_PARAM_UTF8_STRING
  ------------------
  |  |  117|  3.29k|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (1097:13): [True: 0, False: 1.64k]
  ------------------
 1098|  1.64k|            || p->cipher->data_size < ctr_str_len) {
  ------------------
  |  Branch (1098:16): [True: 0, False: 1.64k]
  ------------------
 1099|      0|            ossl_provider_free(prov);
 1100|      0|            return 0;
 1101|      0|        }
 1102|  1.64k|        if (OPENSSL_strcasecmp("CTR", base + p->cipher->data_size - ctr_str_len) != 0) {
  ------------------
  |  Branch (1102:13): [True: 0, False: 1.64k]
  ------------------
 1103|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_REQUIRE_CTR_MODE_CIPHER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1104|      0|            ossl_provider_free(prov);
 1105|      0|            return 0;
 1106|      0|        }
 1107|  1.64k|        if ((ecb = OPENSSL_strndup(base, p->cipher->data_size)) == NULL) {
  ------------------
  |  |  137|  1.64k|    CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (1107:13): [True: 0, False: 1.64k]
  ------------------
 1108|      0|            ossl_provider_free(prov);
 1109|      0|            return 0;
 1110|      0|        }
 1111|  1.64k|        strcpy(ecb + p->cipher->data_size - ecb_str_len, "ECB");
 1112|  1.64k|        EVP_CIPHER_free(ctr->cipher_ecb);
 1113|  1.64k|        EVP_CIPHER_free(ctr->cipher_ctr);
 1114|       |        /*
 1115|       |         * Try to fetch algorithms from our own provider code, fallback
 1116|       |         * to generic fetch only if that fails
 1117|       |         */
 1118|  1.64k|        (void)ERR_set_mark();
 1119|  1.64k|        ctr->cipher_ctr = evp_cipher_fetch_from_prov(prov, base, NULL);
 1120|  1.64k|        if (ctr->cipher_ctr == NULL) {
  ------------------
  |  Branch (1120:13): [True: 0, False: 1.64k]
  ------------------
 1121|      0|            (void)ERR_pop_to_mark();
 1122|      0|            ctr->cipher_ctr = EVP_CIPHER_fetch(libctx, base, propquery);
 1123|  1.64k|        } else {
 1124|  1.64k|            (void)ERR_clear_last_mark();
 1125|  1.64k|        }
 1126|  1.64k|        (void)ERR_set_mark();
 1127|  1.64k|        ctr->cipher_ecb = evp_cipher_fetch_from_prov(prov, ecb, NULL);
 1128|  1.64k|        if (ctr->cipher_ecb == NULL) {
  ------------------
  |  Branch (1128:13): [True: 0, False: 1.64k]
  ------------------
 1129|      0|            (void)ERR_pop_to_mark();
 1130|      0|            ctr->cipher_ecb = EVP_CIPHER_fetch(libctx, ecb, propquery);
 1131|  1.64k|        } else {
 1132|  1.64k|            (void)ERR_clear_last_mark();
 1133|  1.64k|        }
 1134|  1.64k|        OPENSSL_free(ecb);
  ------------------
  |  |  131|  1.64k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1135|  1.64k|        if (ctr->cipher_ctr == NULL || ctr->cipher_ecb == NULL) {
  ------------------
  |  Branch (1135:13): [True: 0, False: 1.64k]
  |  Branch (1135:40): [True: 0, False: 1.64k]
  ------------------
 1136|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_FIND_CIPHERS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1137|      0|            ossl_provider_free(prov);
 1138|      0|            return 0;
 1139|      0|        }
 1140|  1.64k|        cipher_init = 1;
 1141|  1.64k|    }
 1142|  1.64k|    ossl_provider_free(prov);
 1143|       |
 1144|  1.64k|    if (cipher_init && !drbg_ctr_init(ctx))
  ------------------
  |  Branch (1144:9): [True: 1.64k, False: 0]
  |  Branch (1144:24): [True: 0, False: 1.64k]
  ------------------
 1145|      0|        return 0;
 1146|       |
 1147|  1.64k|    return ossl_drbg_set_ctx_params(ctx, p);
 1148|  1.64k|}
drbg_ctr.c:drbg_ctr_init:
  572|  1.64k|{
  573|  1.64k|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  574|  1.64k|    size_t keylen;
  575|       |
  576|  1.64k|    if (ctr->cipher_ctr == NULL) {
  ------------------
  |  Branch (576:9): [True: 0, False: 1.64k]
  ------------------
  577|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_CIPHER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  578|      0|        return 0;
  579|      0|    }
  580|  1.64k|    ctr->keylen = keylen = EVP_CIPHER_get_key_length(ctr->cipher_ctr);
  581|  1.64k|    if (ctr->ctx_ecb == NULL)
  ------------------
  |  Branch (581:9): [True: 1.64k, False: 0]
  ------------------
  582|  1.64k|        ctr->ctx_ecb = EVP_CIPHER_CTX_new();
  583|  1.64k|    if (ctr->ctx_ctr == NULL)
  ------------------
  |  Branch (583:9): [True: 1.64k, False: 0]
  ------------------
  584|  1.64k|        ctr->ctx_ctr = EVP_CIPHER_CTX_new();
  585|  1.64k|    if (ctr->ctx_ecb == NULL || ctr->ctx_ctr == NULL) {
  ------------------
  |  Branch (585:9): [True: 0, False: 1.64k]
  |  Branch (585:33): [True: 0, False: 1.64k]
  ------------------
  586|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_EVP_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  587|      0|        goto err;
  588|      0|    }
  589|       |
  590|  1.64k|    if (!EVP_CipherInit_ex(ctr->ctx_ecb,
  ------------------
  |  Branch (590:9): [True: 0, False: 1.64k]
  ------------------
  591|  1.64k|            ctr->cipher_ecb, NULL, NULL, NULL, 1)
  592|  1.64k|        || !EVP_CipherInit_ex(ctr->ctx_ctr,
  ------------------
  |  Branch (592:12): [True: 0, False: 1.64k]
  ------------------
  593|  1.64k|            ctr->cipher_ctr, NULL, NULL, NULL, 1)) {
  594|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_INITIALISE_CIPHERS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  595|      0|        goto err;
  596|      0|    }
  597|       |
  598|  1.64k|    drbg->strength = (unsigned int)(keylen * 8);
  599|  1.64k|    drbg->seedlen = keylen + 16;
  600|       |
  601|  1.64k|    if (ctr->use_df) {
  ------------------
  |  Branch (601:9): [True: 1.64k, False: 0]
  ------------------
  602|       |        /* df initialisation */
  603|  1.64k|        static const unsigned char df_key[32] = {
  604|  1.64k|            0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
  605|  1.64k|            0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
  606|  1.64k|            0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
  607|  1.64k|            0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f
  608|  1.64k|        };
  609|       |
  610|  1.64k|        if (ctr->ctx_df == NULL)
  ------------------
  |  Branch (610:13): [True: 1.64k, False: 0]
  ------------------
  611|  1.64k|            ctr->ctx_df = EVP_CIPHER_CTX_new();
  612|  1.64k|        if (ctr->ctx_df == NULL) {
  ------------------
  |  Branch (612:13): [True: 0, False: 1.64k]
  ------------------
  613|      0|            ERR_raise(ERR_LIB_PROV, ERR_R_EVP_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  614|      0|            goto err;
  615|      0|        }
  616|       |        /* Set key schedule for df_key */
  617|  1.64k|        if (!EVP_CipherInit_ex(ctr->ctx_df,
  ------------------
  |  Branch (617:13): [True: 0, False: 1.64k]
  ------------------
  618|  1.64k|                ctr->cipher_ecb, NULL, df_key, NULL, 1)) {
  619|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_DERIVATION_FUNCTION_INIT_FAILED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  620|      0|            goto err;
  621|      0|        }
  622|  1.64k|    }
  623|  1.64k|    return drbg_ctr_init_lengths(drbg);
  624|       |
  625|      0|err:
  626|      0|    EVP_CIPHER_CTX_free(ctr->ctx_ecb);
  627|      0|    EVP_CIPHER_CTX_free(ctr->ctx_ctr);
  628|       |    ctr->ctx_ecb = ctr->ctx_ctr = NULL;
  629|      0|    return 0;
  630|  1.64k|}
drbg_ctr.c:drbg_ctr_generate_wrapper:
  480|  32.3k|{
  481|  32.3k|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  482|       |
  483|  32.3k|    return ossl_prov_drbg_generate(drbg, out, outlen, strength,
  484|  32.3k|        prediction_resistance, adin, adin_len);
  485|  32.3k|}
drbg_ctr.c:drbg_ctr_settable_ctx_params:
 1333|  1.64k|{
 1334|  1.64k|    return drbg_ctr_set_ctx_params_list;
 1335|  1.64k|}
drbg_ctr.c:drbg_ctr_get_ctx_params:
 1017|  83.6k|{
 1018|  83.6k|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
 1019|  83.6k|    PROV_DRBG_CTR *ctr;
 1020|  83.6k|    struct drbg_ctr_get_ctx_params_st p;
 1021|  83.6k|    int ret = 0, complete = 0;
 1022|       |
 1023|  83.6k|    if (drbg == NULL || !drbg_ctr_get_ctx_params_decoder(params, &p))
  ------------------
  |  Branch (1023:9): [True: 0, False: 83.6k]
  |  Branch (1023:25): [True: 0, False: 83.6k]
  ------------------
 1024|      0|        return 0;
 1025|       |
 1026|  83.6k|    if (!ossl_drbg_get_ctx_params_no_lock(drbg, &p, params, &complete))
  ------------------
  |  Branch (1026:9): [True: 0, False: 83.6k]
  ------------------
 1027|      0|        return 0;
 1028|       |
 1029|  83.6k|    if (complete)
  ------------------
  |  Branch (1029:9): [True: 65.8k, False: 17.7k]
  ------------------
 1030|  65.8k|        return 1;
 1031|       |
 1032|  17.7k|    ctr = (PROV_DRBG_CTR *)drbg->data;
 1033|       |
 1034|  17.7k|    if (drbg->lock != NULL && !CRYPTO_THREAD_read_lock(drbg->lock))
  ------------------
  |  Branch (1034:9): [True: 17.7k, False: 0]
  |  Branch (1034:31): [True: 0, False: 17.7k]
  ------------------
 1035|      0|        return 0;
 1036|       |
 1037|  17.7k|    if (p.df != NULL && !OSSL_PARAM_set_int(p.df, ctr->use_df))
  ------------------
  |  Branch (1037:9): [True: 0, False: 17.7k]
  |  Branch (1037:25): [True: 0, False: 0]
  ------------------
 1038|      0|        goto err;
 1039|       |
 1040|  17.7k|    if (p.cipher != NULL) {
  ------------------
  |  Branch (1040:9): [True: 0, False: 17.7k]
  ------------------
 1041|      0|        if (ctr->cipher_ctr == NULL
  ------------------
  |  Branch (1041:13): [True: 0, False: 0]
  ------------------
 1042|      0|            || !OSSL_PARAM_set_utf8_string(p.cipher,
  ------------------
  |  Branch (1042:16): [True: 0, False: 0]
  ------------------
 1043|      0|                EVP_CIPHER_get0_name(ctr->cipher_ctr)))
 1044|      0|            goto err;
 1045|      0|    }
 1046|       |
 1047|  17.7k|    ret = ossl_drbg_get_ctx_params(drbg, &p);
 1048|  17.7k|err:
 1049|  17.7k|    if (drbg->lock != NULL)
  ------------------
  |  Branch (1049:9): [True: 17.7k, False: 0]
  ------------------
 1050|  17.7k|        CRYPTO_THREAD_unlock(drbg->lock);
 1051|       |
 1052|  17.7k|    return ret;
 1053|  17.7k|}
drbg_ctr.c:drbg_ctr_get_ctx_params_decoder:
  726|  83.6k|{
  727|  83.6k|    const char *s;
  728|       |
  729|  83.6k|    memset(r, 0, sizeof(*r));
  730|  83.6k|    if (p != NULL)
  ------------------
  |  Branch (730:9): [True: 83.6k, False: 0]
  ------------------
  731|   167k|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (731:16): [True: 83.6k, False: 83.6k]
  ------------------
  732|  83.6k|            switch(s[0]) {
  733|      0|            default:
  ------------------
  |  Branch (733:13): [True: 0, False: 83.6k]
  ------------------
  734|      0|                break;
  735|      0|            case 'c':
  ------------------
  |  Branch (735:13): [True: 0, False: 83.6k]
  ------------------
  736|      0|                if (ossl_likely(strcmp("ipher", s + 1) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  737|       |                    /* OSSL_DRBG_PARAM_CIPHER */
  738|      0|                    if (ossl_unlikely(r->cipher != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  739|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  740|      0|                                       "param %s is repeated", s);
  741|      0|                        return 0;
  742|      0|                    }
  743|      0|                    r->cipher = (OSSL_PARAM *)p;
  744|      0|                }
  745|      0|                break;
  746|      0|            case 'f':
  ------------------
  |  Branch (746:13): [True: 0, False: 83.6k]
  ------------------
  747|       |# if defined(FIPS_MODULE)
  748|       |                if (ossl_likely(strcmp("ips-indicator", s + 1) == 0)) {
  749|       |                    /* OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR */
  750|       |                    if (ossl_unlikely(r->ind != NULL)) {
  751|       |                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  752|       |                                       "param %s is repeated", s);
  753|       |                        return 0;
  754|       |                    }
  755|       |                    r->ind = (OSSL_PARAM *)p;
  756|       |                }
  757|       |# endif
  758|      0|                break;
  759|  32.3k|            case 'm':
  ------------------
  |  Branch (759:13): [True: 32.3k, False: 51.2k]
  ------------------
  760|  32.3k|                switch(s[1]) {
  761|      0|                default:
  ------------------
  |  Branch (761:17): [True: 0, False: 32.3k]
  ------------------
  762|      0|                    break;
  763|  32.3k|                case 'a':
  ------------------
  |  Branch (763:17): [True: 32.3k, False: 0]
  ------------------
  764|  32.3k|                    switch(s[2]) {
  765|      0|                    default:
  ------------------
  |  Branch (765:21): [True: 0, False: 32.3k]
  ------------------
  766|      0|                        break;
  767|  32.3k|                    case 'x':
  ------------------
  |  Branch (767:21): [True: 32.3k, False: 0]
  ------------------
  768|  32.3k|                        switch(s[3]) {
  769|      0|                        default:
  ------------------
  |  Branch (769:25): [True: 0, False: 32.3k]
  ------------------
  770|      0|                            break;
  771|  32.3k|                        case '_':
  ------------------
  |  Branch (771:25): [True: 32.3k, False: 0]
  ------------------
  772|  32.3k|                            switch(s[4]) {
  773|      0|                            default:
  ------------------
  |  Branch (773:29): [True: 0, False: 32.3k]
  ------------------
  774|      0|                                break;
  775|      0|                            case 'a':
  ------------------
  |  Branch (775:29): [True: 0, False: 32.3k]
  ------------------
  776|      0|                                if (ossl_likely(strcmp("dinlen", s + 5) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  777|       |                                    /* OSSL_DRBG_PARAM_MAX_ADINLEN */
  778|      0|                                    if (ossl_unlikely(r->maxadlen != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  779|      0|                                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  780|      0|                                                       "param %s is repeated", s);
  781|      0|                                        return 0;
  782|      0|                                    }
  783|      0|                                    r->maxadlen = (OSSL_PARAM *)p;
  784|      0|                                }
  785|      0|                                break;
  786|      0|                            case 'e':
  ------------------
  |  Branch (786:29): [True: 0, False: 32.3k]
  ------------------
  787|      0|                                if (ossl_likely(strcmp("ntropylen", s + 5) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  788|       |                                    /* OSSL_DRBG_PARAM_MAX_ENTROPYLEN */
  789|      0|                                    if (ossl_unlikely(r->maxentlen != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  790|      0|                                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  791|      0|                                                       "param %s is repeated", s);
  792|      0|                                        return 0;
  793|      0|                                    }
  794|      0|                                    r->maxentlen = (OSSL_PARAM *)p;
  795|      0|                                }
  796|      0|                                break;
  797|      0|                            case 'n':
  ------------------
  |  Branch (797:29): [True: 0, False: 32.3k]
  ------------------
  798|      0|                                if (ossl_likely(strcmp("oncelen", s + 5) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  799|       |                                    /* OSSL_DRBG_PARAM_MAX_NONCELEN */
  800|      0|                                    if (ossl_unlikely(r->maxnonlen != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  801|      0|                                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  802|      0|                                                       "param %s is repeated", s);
  803|      0|                                        return 0;
  804|      0|                                    }
  805|      0|                                    r->maxnonlen = (OSSL_PARAM *)p;
  806|      0|                                }
  807|      0|                                break;
  808|      0|                            case 'p':
  ------------------
  |  Branch (808:29): [True: 0, False: 32.3k]
  ------------------
  809|      0|                                if (ossl_likely(strcmp("erslen", s + 5) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  810|       |                                    /* OSSL_DRBG_PARAM_MAX_PERSLEN */
  811|      0|                                    if (ossl_unlikely(r->maxperlen != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  812|      0|                                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  813|      0|                                                       "param %s is repeated", s);
  814|      0|                                        return 0;
  815|      0|                                    }
  816|      0|                                    r->maxperlen = (OSSL_PARAM *)p;
  817|      0|                                }
  818|      0|                                break;
  819|  32.3k|                            case 'r':
  ------------------
  |  Branch (819:29): [True: 32.3k, False: 0]
  ------------------
  820|  32.3k|                                if (ossl_likely(strcmp("equest", s + 5) == 0)) {
  ------------------
  |  |   22|  32.3k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 32.3k, False: 0]
  |  |  ------------------
  ------------------
  821|       |                                    /* OSSL_RAND_PARAM_MAX_REQUEST */
  822|  32.3k|                                    if (ossl_unlikely(r->maxreq != NULL)) {
  ------------------
  |  |   23|  32.3k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 32.3k]
  |  |  ------------------
  ------------------
  823|      0|                                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  824|      0|                                                       "param %s is repeated", s);
  825|      0|                                        return 0;
  826|      0|                                    }
  827|  32.3k|                                    r->maxreq = (OSSL_PARAM *)p;
  828|  32.3k|                                }
  829|  32.3k|                            }
  830|  32.3k|                        }
  831|  32.3k|                    }
  832|  32.3k|                    break;
  833|  32.3k|                case 'i':
  ------------------
  |  Branch (833:17): [True: 0, False: 32.3k]
  ------------------
  834|      0|                    switch(s[2]) {
  835|      0|                    default:
  ------------------
  |  Branch (835:21): [True: 0, False: 0]
  ------------------
  836|      0|                        break;
  837|      0|                    case 'n':
  ------------------
  |  Branch (837:21): [True: 0, False: 0]
  ------------------
  838|      0|                        switch(s[3]) {
  839|      0|                        default:
  ------------------
  |  Branch (839:25): [True: 0, False: 0]
  ------------------
  840|      0|                            break;
  841|      0|                        case '_':
  ------------------
  |  Branch (841:25): [True: 0, False: 0]
  ------------------
  842|      0|                            switch(s[4]) {
  843|      0|                            default:
  ------------------
  |  Branch (843:29): [True: 0, False: 0]
  ------------------
  844|      0|                                break;
  845|      0|                            case 'e':
  ------------------
  |  Branch (845:29): [True: 0, False: 0]
  ------------------
  846|      0|                                if (ossl_likely(strcmp("ntropylen", s + 5) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  847|       |                                    /* OSSL_DRBG_PARAM_MIN_ENTROPYLEN */
  848|      0|                                    if (ossl_unlikely(r->minentlen != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  849|      0|                                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  850|      0|                                                       "param %s is repeated", s);
  851|      0|                                        return 0;
  852|      0|                                    }
  853|      0|                                    r->minentlen = (OSSL_PARAM *)p;
  854|      0|                                }
  855|      0|                                break;
  856|      0|                            case 'n':
  ------------------
  |  Branch (856:29): [True: 0, False: 0]
  ------------------
  857|      0|                                if (ossl_likely(strcmp("oncelen", s + 5) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  858|       |                                    /* OSSL_DRBG_PARAM_MIN_NONCELEN */
  859|      0|                                    if (ossl_unlikely(r->minnonlen != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  860|      0|                                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  861|      0|                                                       "param %s is repeated", s);
  862|      0|                                        return 0;
  863|      0|                                    }
  864|      0|                                    r->minnonlen = (OSSL_PARAM *)p;
  865|      0|                                }
  866|      0|                            }
  867|      0|                        }
  868|      0|                    }
  869|  32.3k|                }
  870|  32.3k|                break;
  871|  33.4k|            case 'r':
  ------------------
  |  Branch (871:13): [True: 33.4k, False: 50.1k]
  ------------------
  872|  33.4k|                switch(s[1]) {
  873|      0|                default:
  ------------------
  |  Branch (873:17): [True: 0, False: 33.4k]
  ------------------
  874|      0|                    break;
  875|  33.4k|                case 'e':
  ------------------
  |  Branch (875:17): [True: 33.4k, False: 0]
  ------------------
  876|  33.4k|                    switch(s[2]) {
  877|      0|                    default:
  ------------------
  |  Branch (877:21): [True: 0, False: 33.4k]
  ------------------
  878|      0|                        break;
  879|  33.4k|                    case 's':
  ------------------
  |  Branch (879:21): [True: 33.4k, False: 0]
  ------------------
  880|  33.4k|                        switch(s[3]) {
  881|      0|                        default:
  ------------------
  |  Branch (881:25): [True: 0, False: 33.4k]
  ------------------
  882|      0|                            break;
  883|  33.4k|                        case 'e':
  ------------------
  |  Branch (883:25): [True: 33.4k, False: 0]
  ------------------
  884|  33.4k|                            switch(s[4]) {
  885|      0|                            default:
  ------------------
  |  Branch (885:29): [True: 0, False: 33.4k]
  ------------------
  886|      0|                                break;
  887|  33.4k|                            case 'e':
  ------------------
  |  Branch (887:29): [True: 33.4k, False: 0]
  ------------------
  888|  33.4k|                                switch(s[5]) {
  889|      0|                                default:
  ------------------
  |  Branch (889:33): [True: 0, False: 33.4k]
  ------------------
  890|      0|                                    break;
  891|  33.4k|                                case 'd':
  ------------------
  |  Branch (891:33): [True: 33.4k, False: 0]
  ------------------
  892|  33.4k|                                    switch(s[6]) {
  893|      0|                                    default:
  ------------------
  |  Branch (893:37): [True: 0, False: 33.4k]
  ------------------
  894|      0|                                        break;
  895|  33.4k|                                    case '_':
  ------------------
  |  Branch (895:37): [True: 33.4k, False: 0]
  ------------------
  896|  33.4k|                                        switch(s[7]) {
  897|      0|                                        default:
  ------------------
  |  Branch (897:41): [True: 0, False: 33.4k]
  ------------------
  898|      0|                                            break;
  899|  33.4k|                                        case 'c':
  ------------------
  |  Branch (899:41): [True: 33.4k, False: 0]
  ------------------
  900|  33.4k|                                            if (ossl_likely(strcmp("ounter", s + 8) == 0)) {
  ------------------
  |  |   22|  33.4k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 33.4k, False: 0]
  |  |  ------------------
  ------------------
  901|       |                                                /* OSSL_DRBG_PARAM_RESEED_COUNTER */
  902|  33.4k|                                                if (ossl_unlikely(r->reseed_cnt != NULL)) {
  ------------------
  |  |   23|  33.4k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 33.4k]
  |  |  ------------------
  ------------------
  903|      0|                                                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  904|      0|                                                                   "param %s is repeated", s);
  905|      0|                                                    return 0;
  906|      0|                                                }
  907|  33.4k|                                                r->reseed_cnt = (OSSL_PARAM *)p;
  908|  33.4k|                                            }
  909|  33.4k|                                            break;
  910|  33.4k|                                        case 'r':
  ------------------
  |  Branch (910:41): [True: 0, False: 33.4k]
  ------------------
  911|      0|                                            if (ossl_likely(strcmp("equests", s + 8) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  912|       |                                                /* OSSL_DRBG_PARAM_RESEED_REQUESTS */
  913|      0|                                                if (ossl_unlikely(r->reseed_req != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  914|      0|                                                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  915|      0|                                                                   "param %s is repeated", s);
  916|      0|                                                    return 0;
  917|      0|                                                }
  918|      0|                                                r->reseed_req = (OSSL_PARAM *)p;
  919|      0|                                            }
  920|      0|                                            break;
  921|      0|                                        case 't':
  ------------------
  |  Branch (921:41): [True: 0, False: 33.4k]
  ------------------
  922|      0|                                            switch(s[8]) {
  923|      0|                                            default:
  ------------------
  |  Branch (923:45): [True: 0, False: 0]
  ------------------
  924|      0|                                                break;
  925|      0|                                            case 'i':
  ------------------
  |  Branch (925:45): [True: 0, False: 0]
  ------------------
  926|      0|                                                switch(s[9]) {
  927|      0|                                                default:
  ------------------
  |  Branch (927:49): [True: 0, False: 0]
  ------------------
  928|      0|                                                    break;
  929|      0|                                                case 'm':
  ------------------
  |  Branch (929:49): [True: 0, False: 0]
  ------------------
  930|      0|                                                    switch(s[10]) {
  931|      0|                                                    default:
  ------------------
  |  Branch (931:53): [True: 0, False: 0]
  ------------------
  932|      0|                                                        break;
  933|      0|                                                    case 'e':
  ------------------
  |  Branch (933:53): [True: 0, False: 0]
  ------------------
  934|      0|                                                        switch(s[11]) {
  935|      0|                                                        default:
  ------------------
  |  Branch (935:57): [True: 0, False: 0]
  ------------------
  936|      0|                                                            break;
  937|      0|                                                        case '_':
  ------------------
  |  Branch (937:57): [True: 0, False: 0]
  ------------------
  938|      0|                                                            if (ossl_likely(strcmp("interval", s + 12) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  939|       |                                                                /* OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL */
  940|      0|                                                                if (ossl_unlikely(r->reseed_int != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  941|      0|                                                                    ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                                                  ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  942|      0|                                                                                   "param %s is repeated", s);
  943|      0|                                                                    return 0;
  944|      0|                                                                }
  945|      0|                                                                r->reseed_int = (OSSL_PARAM *)p;
  946|      0|                                                            }
  947|      0|                                                            break;
  948|      0|                                                        case '\0':
  ------------------
  |  Branch (948:57): [True: 0, False: 0]
  ------------------
  949|      0|                                                            if (ossl_unlikely(r->reseed_time != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  950|      0|                                                                ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  951|      0|                                                                               "param %s is repeated", s);
  952|      0|                                                                return 0;
  953|      0|                                                            }
  954|      0|                                                            r->reseed_time = (OSSL_PARAM *)p;
  955|      0|                                                        }
  956|      0|                                                    }
  957|      0|                                                }
  958|      0|                                            }
  959|  33.4k|                                        }
  960|  33.4k|                                    }
  961|  33.4k|                                }
  962|  33.4k|                            }
  963|  33.4k|                        }
  964|  33.4k|                    }
  965|  33.4k|                }
  966|  33.4k|                break;
  967|  33.4k|            case 's':
  ------------------
  |  Branch (967:13): [True: 17.7k, False: 65.8k]
  ------------------
  968|  17.7k|                switch(s[1]) {
  969|      0|                default:
  ------------------
  |  Branch (969:17): [True: 0, False: 17.7k]
  ------------------
  970|      0|                    break;
  971|  17.7k|                case 't':
  ------------------
  |  Branch (971:17): [True: 17.7k, False: 0]
  ------------------
  972|  17.7k|                    switch(s[2]) {
  973|      0|                    default:
  ------------------
  |  Branch (973:21): [True: 0, False: 17.7k]
  ------------------
  974|      0|                        break;
  975|  14.4k|                    case 'a':
  ------------------
  |  Branch (975:21): [True: 14.4k, False: 3.29k]
  ------------------
  976|  14.4k|                        if (ossl_likely(strcmp("te", s + 3) == 0)) {
  ------------------
  |  |   22|  14.4k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 14.4k, False: 0]
  |  |  ------------------
  ------------------
  977|       |                            /* OSSL_RAND_PARAM_STATE */
  978|  14.4k|                            if (ossl_unlikely(r->state != NULL)) {
  ------------------
  |  |   23|  14.4k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 14.4k]
  |  |  ------------------
  ------------------
  979|      0|                                ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  980|      0|                                               "param %s is repeated", s);
  981|      0|                                return 0;
  982|      0|                            }
  983|  14.4k|                            r->state = (OSSL_PARAM *)p;
  984|  14.4k|                        }
  985|  14.4k|                        break;
  986|  14.4k|                    case 'r':
  ------------------
  |  Branch (986:21): [True: 3.29k, False: 14.4k]
  ------------------
  987|  3.29k|                        if (ossl_likely(strcmp("ength", s + 3) == 0)) {
  ------------------
  |  |   22|  3.29k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 3.29k, False: 0]
  |  |  ------------------
  ------------------
  988|       |                            /* OSSL_RAND_PARAM_STRENGTH */
  989|  3.29k|                            if (ossl_unlikely(r->str != NULL)) {
  ------------------
  |  |   23|  3.29k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 3.29k]
  |  |  ------------------
  ------------------
  990|      0|                                ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  991|      0|                                               "param %s is repeated", s);
  992|      0|                                return 0;
  993|      0|                            }
  994|  3.29k|                            r->str = (OSSL_PARAM *)p;
  995|  3.29k|                        }
  996|  17.7k|                    }
  997|  17.7k|                }
  998|  17.7k|                break;
  999|  17.7k|            case 'u':
  ------------------
  |  Branch (999:13): [True: 0, False: 83.6k]
  ------------------
 1000|      0|                if (ossl_likely(strcmp("se_derivation_function", s + 1) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1001|       |                    /* OSSL_DRBG_PARAM_USE_DF */
 1002|      0|                    if (ossl_unlikely(r->df != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1003|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
 1004|      0|                                       "param %s is repeated", s);
 1005|      0|                        return 0;
 1006|      0|                    }
 1007|      0|                    r->df = (OSSL_PARAM *)p;
 1008|      0|                }
 1009|  83.6k|            }
 1010|  83.6k|    return 1;
 1011|  83.6k|}

seed_src.c:seed_src_new:
   51|    549|{
   52|    549|    PROV_SEED_SRC *s;
   53|       |
   54|    549|    if (parent != NULL) {
  ------------------
  |  Branch (54:9): [True: 0, False: 549]
  ------------------
   55|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_SEED_SOURCES_MUST_NOT_HAVE_A_PARENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   56|      0|        return NULL;
   57|      0|    }
   58|       |
   59|    549|    s = OPENSSL_zalloc(sizeof(*s));
  ------------------
  |  |  108|    549|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   60|    549|    if (s == NULL)
  ------------------
  |  Branch (60:9): [True: 0, False: 549]
  ------------------
   61|      0|        return NULL;
   62|       |
   63|    549|    s->provctx = provctx;
   64|    549|    s->state = EVP_RAND_STATE_UNINITIALISED;
  ------------------
  |  | 1345|    549|#define EVP_RAND_STATE_UNINITIALISED 0
  ------------------
   65|    549|    return s;
   66|    549|}
seed_src.c:seed_src_free:
   69|    549|{
   70|    549|    OPENSSL_free(vseed);
  ------------------
  |  |  131|    549|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   71|    549|}
seed_src.c:seed_src_instantiate:
   77|    549|{
   78|    549|    PROV_SEED_SRC *s = (PROV_SEED_SRC *)vseed;
   79|       |
   80|    549|    s->state = EVP_RAND_STATE_READY;
  ------------------
  |  | 1346|    549|#define EVP_RAND_STATE_READY 1
  ------------------
   81|    549|    return 1;
   82|    549|}
seed_src.c:seed_src_enable_locking:
  294|    549|{
  295|    549|    return 1;
  296|    549|}
seed_src.c:seed_src_lock:
  299|  4.94k|{
  300|  4.94k|    return 1;
  301|  4.94k|}
seed_src.c:seed_src_unlock:
  304|  4.94k|{
  305|  4.94k|}
seed_src.c:seed_src_get_ctx_params:
  229|  3.29k|{
  230|  3.29k|    PROV_SEED_SRC *s = (PROV_SEED_SRC *)vseed;
  231|  3.29k|    struct seed_src_get_ctx_params_st p;
  232|       |
  233|  3.29k|    if (s == NULL || !seed_src_get_ctx_params_decoder(params, &p))
  ------------------
  |  Branch (233:9): [True: 0, False: 3.29k]
  |  Branch (233:22): [True: 0, False: 3.29k]
  ------------------
  234|      0|        return 0;
  235|       |
  236|  3.29k|    if (p.state != NULL && !OSSL_PARAM_set_int(p.state, s->state))
  ------------------
  |  Branch (236:9): [True: 0, False: 3.29k]
  |  Branch (236:28): [True: 0, False: 0]
  ------------------
  237|      0|        return 0;
  238|       |
  239|  3.29k|    if (p.str != NULL && !OSSL_PARAM_set_uint(p.str, 1024))
  ------------------
  |  Branch (239:9): [True: 1.09k, False: 2.19k]
  |  Branch (239:26): [True: 0, False: 1.09k]
  ------------------
  240|      0|        return 0;
  241|       |
  242|  3.29k|    if (p.maxreq != NULL && !OSSL_PARAM_set_size_t(p.maxreq, 128))
  ------------------
  |  Branch (242:9): [True: 0, False: 3.29k]
  |  Branch (242:29): [True: 0, False: 0]
  ------------------
  243|      0|        return 0;
  244|  3.29k|    return 1;
  245|  3.29k|}
seed_src.c:seed_src_get_ctx_params_decoder:
  170|  3.29k|{
  171|  3.29k|    const char *s;
  172|       |
  173|  3.29k|    memset(r, 0, sizeof(*r));
  174|  3.29k|    if (p != NULL)
  ------------------
  |  Branch (174:9): [True: 3.29k, False: 0]
  ------------------
  175|  6.58k|        for (; (s = p->key) != NULL; p++)
  ------------------
  |  Branch (175:16): [True: 3.29k, False: 3.29k]
  ------------------
  176|  3.29k|            switch(s[0]) {
  177|  2.19k|            default:
  ------------------
  |  Branch (177:13): [True: 2.19k, False: 1.09k]
  ------------------
  178|  2.19k|                break;
  179|  2.19k|            case 'm':
  ------------------
  |  Branch (179:13): [True: 0, False: 3.29k]
  ------------------
  180|      0|                if (ossl_likely(strcmp("ax_request", s + 1) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  181|       |                    /* OSSL_RAND_PARAM_MAX_REQUEST */
  182|      0|                    if (ossl_unlikely(r->maxreq != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  183|      0|                        ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                      ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  184|      0|                                       "param %s is repeated", s);
  185|      0|                        return 0;
  186|      0|                    }
  187|      0|                    r->maxreq = (OSSL_PARAM *)p;
  188|      0|                }
  189|      0|                break;
  190|  1.09k|            case 's':
  ------------------
  |  Branch (190:13): [True: 1.09k, False: 2.19k]
  ------------------
  191|  1.09k|                switch(s[1]) {
  192|      0|                default:
  ------------------
  |  Branch (192:17): [True: 0, False: 1.09k]
  ------------------
  193|      0|                    break;
  194|  1.09k|                case 't':
  ------------------
  |  Branch (194:17): [True: 1.09k, False: 0]
  ------------------
  195|  1.09k|                    switch(s[2]) {
  196|      0|                    default:
  ------------------
  |  Branch (196:21): [True: 0, False: 1.09k]
  ------------------
  197|      0|                        break;
  198|      0|                    case 'a':
  ------------------
  |  Branch (198:21): [True: 0, False: 1.09k]
  ------------------
  199|      0|                        if (ossl_likely(strcmp("te", s + 3) == 0)) {
  ------------------
  |  |   22|      0|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  200|       |                            /* OSSL_RAND_PARAM_STATE */
  201|      0|                            if (ossl_unlikely(r->state != NULL)) {
  ------------------
  |  |   23|      0|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  202|      0|                                ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  203|      0|                                               "param %s is repeated", s);
  204|      0|                                return 0;
  205|      0|                            }
  206|      0|                            r->state = (OSSL_PARAM *)p;
  207|      0|                        }
  208|      0|                        break;
  209|  1.09k|                    case 'r':
  ------------------
  |  Branch (209:21): [True: 1.09k, False: 0]
  ------------------
  210|  1.09k|                        if (ossl_likely(strcmp("ength", s + 3) == 0)) {
  ------------------
  |  |   22|  1.09k|#define ossl_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:24): [True: 1.09k, False: 0]
  |  |  ------------------
  ------------------
  211|       |                            /* OSSL_RAND_PARAM_STRENGTH */
  212|  1.09k|                            if (ossl_unlikely(r->str != NULL)) {
  ------------------
  |  |   23|  1.09k|#define ossl_unlikely(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:26): [True: 0, False: 1.09k]
  |  |  ------------------
  ------------------
  213|      0|                                ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  120|      0|#define ERR_LIB_PROV 57
  ------------------
                                              ERR_raise_data(ERR_LIB_PROV, PROV_R_REPEATED_PARAMETER,
  ------------------
  |  |  135|      0|#define PROV_R_REPEATED_PARAMETER 252
  ------------------
  214|      0|                                               "param %s is repeated", s);
  215|      0|                                return 0;
  216|      0|                            }
  217|  1.09k|                            r->str = (OSSL_PARAM *)p;
  218|  1.09k|                        }
  219|  1.09k|                    }
  220|  1.09k|                }
  221|  3.29k|            }
  222|  3.29k|    return 1;
  223|  3.29k|}
seed_src.c:seed_get_seed:
  262|    549|{
  263|    549|    size_t ret = 0;
  264|    549|    size_t entropy_available = 0;
  265|    549|    RAND_POOL *pool;
  266|       |
  267|    549|    pool = ossl_rand_pool_new(entropy, 1, min_len, max_len);
  268|    549|    if (pool == NULL) {
  ------------------
  |  Branch (268:9): [True: 0, False: 549]
  ------------------
  269|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_RAND_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  270|      0|        return 0;
  271|      0|    }
  272|       |
  273|       |    /* Get entropy by polling system entropy sources. */
  274|    549|    entropy_available = ossl_pool_acquire_entropy(pool);
  275|       |
  276|    549|    if (entropy_available > 0
  ------------------
  |  Branch (276:9): [True: 549, False: 0]
  ------------------
  277|    549|        && ossl_rand_pool_adin_mix_in(pool, adin, adin_len)) {
  ------------------
  |  Branch (277:12): [True: 549, False: 0]
  ------------------
  278|    549|        ret = ossl_rand_pool_length(pool);
  279|    549|        *pout = ossl_rand_pool_detach(pool);
  280|    549|    } else {
  281|       |        ERR_raise(ERR_LIB_PROV, PROV_R_ENTROPY_SOURCE_STRENGTH_TOO_WEAK);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  282|      0|    }
  283|    549|    ossl_rand_pool_free(pool);
  284|    549|    return ret;
  285|    549|}
seed_src.c:seed_clear_seed:
  289|    549|{
  290|    549|    OPENSSL_secure_clear_free(out, outlen);
  ------------------
  |  |  149|    549|    CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  291|    549|}

ossl_rand_pool_init:
  571|      1|{
  572|      1|    size_t i;
  573|       |
  574|      5|    for (i = 0; i < OSSL_NELEM(random_devices); i++)
  ------------------
  |  |   14|      5|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (574:17): [True: 4, False: 1]
  ------------------
  575|      4|        random_devices[i].fd = -1;
  576|       |
  577|      1|    return 1;
  578|      1|}
ossl_rand_pool_cleanup:
  581|      1|{
  582|      1|    size_t i;
  583|       |
  584|      5|    for (i = 0; i < OSSL_NELEM(random_devices); i++)
  ------------------
  |  |   14|      5|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (584:17): [True: 4, False: 1]
  ------------------
  585|      4|        close_random_device(i);
  586|      1|}
ossl_pool_acquire_entropy:
  631|    549|{
  632|       |#if defined(OPENSSL_RAND_SEED_NONE)
  633|       |    return ossl_rand_pool_entropy_available(pool);
  634|       |#else
  635|    549|    size_t entropy_available = 0;
  636|       |
  637|    549|    (void)entropy_available; /* avoid compiler warning */
  638|       |
  639|    549|#if defined(OPENSSL_RAND_SEED_GETRANDOM)
  640|    549|    {
  641|    549|        size_t bytes_needed;
  642|    549|        unsigned char *buffer;
  643|    549|        ssize_t bytes;
  644|       |        /* Maximum allowed number of consecutive unsuccessful attempts */
  645|    549|        int attempts = 3;
  646|       |
  647|    549|        bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
  648|  1.09k|        while (bytes_needed != 0 && attempts-- > 0) {
  ------------------
  |  Branch (648:16): [True: 549, False: 549]
  |  Branch (648:37): [True: 549, False: 0]
  ------------------
  649|    549|            buffer = ossl_rand_pool_add_begin(pool, bytes_needed);
  650|    549|            bytes = syscall_random(buffer, bytes_needed);
  651|    549|            if (bytes > 0) {
  ------------------
  |  Branch (651:17): [True: 549, False: 0]
  ------------------
  652|    549|                ossl_rand_pool_add_end(pool, bytes, 8 * bytes);
  653|    549|                bytes_needed -= bytes;
  654|    549|                attempts = 3; /* reset counter after successful attempt */
  655|    549|            } else if (bytes < 0 && errno != EINTR) {
  ------------------
  |  Branch (655:24): [True: 0, False: 0]
  |  Branch (655:37): [True: 0, False: 0]
  ------------------
  656|      0|                break;
  657|      0|            }
  658|    549|        }
  659|    549|    }
  660|    549|    entropy_available = ossl_rand_pool_entropy_available(pool);
  661|    549|    if (entropy_available > 0)
  ------------------
  |  Branch (661:9): [True: 549, False: 0]
  ------------------
  662|    549|        return entropy_available;
  663|      0|#endif
  664|       |
  665|      0|#if defined(OPENSSL_RAND_SEED_DEVRANDOM)
  666|      0|    if (wait_random_seeded()) {
  ------------------
  |  Branch (666:9): [True: 0, False: 0]
  ------------------
  667|      0|        size_t bytes_needed;
  668|      0|        unsigned char *buffer;
  669|      0|        size_t i;
  670|       |
  671|      0|        bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
  672|      0|        for (i = 0; bytes_needed > 0 && i < OSSL_NELEM(random_device_paths);
  ------------------
  |  |   14|      0|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (672:21): [True: 0, False: 0]
  |  Branch (672:41): [True: 0, False: 0]
  ------------------
  673|      0|            i++) {
  674|      0|            ssize_t bytes = 0;
  675|       |            /* Maximum number of consecutive unsuccessful attempts */
  676|      0|            int attempts = 3;
  677|      0|            const int fd = get_random_device(i);
  678|       |
  679|      0|            if (fd == -1)
  ------------------
  |  Branch (679:17): [True: 0, False: 0]
  ------------------
  680|      0|                continue;
  681|       |
  682|      0|            while (bytes_needed != 0 && attempts-- > 0) {
  ------------------
  |  Branch (682:20): [True: 0, False: 0]
  |  Branch (682:41): [True: 0, False: 0]
  ------------------
  683|      0|                buffer = ossl_rand_pool_add_begin(pool, bytes_needed);
  684|      0|                bytes = read(fd, buffer, bytes_needed);
  685|       |
  686|      0|                if (bytes > 0) {
  ------------------
  |  Branch (686:21): [True: 0, False: 0]
  ------------------
  687|      0|                    ossl_rand_pool_add_end(pool, bytes, 8 * bytes);
  688|      0|                    bytes_needed -= bytes;
  689|      0|                    attempts = 3; /* reset counter on successful attempt */
  690|      0|                } else if (bytes < 0 && errno != EINTR) {
  ------------------
  |  Branch (690:28): [True: 0, False: 0]
  |  Branch (690:41): [True: 0, False: 0]
  ------------------
  691|      0|                    break;
  692|      0|                }
  693|      0|            }
  694|      0|            if (bytes < 0 || !keep_random_devices_open)
  ------------------
  |  Branch (694:17): [True: 0, False: 0]
  |  Branch (694:30): [True: 0, False: 0]
  ------------------
  695|      0|                close_random_device(i);
  696|       |
  697|      0|            bytes_needed = ossl_rand_pool_bytes_needed(pool, 1);
  698|      0|        }
  699|      0|        entropy_available = ossl_rand_pool_entropy_available(pool);
  700|      0|        if (entropy_available > 0)
  ------------------
  |  Branch (700:13): [True: 0, False: 0]
  ------------------
  701|      0|            return entropy_available;
  702|      0|    }
  703|      0|#endif
  704|       |
  705|       |#if defined(OPENSSL_RAND_SEED_RDTSC)
  706|       |    entropy_available = ossl_prov_acquire_entropy_from_tsc(pool);
  707|       |    if (entropy_available > 0)
  708|       |        return entropy_available;
  709|       |#endif
  710|       |
  711|       |#if defined(OPENSSL_RAND_SEED_RDCPU)
  712|       |    entropy_available = ossl_prov_acquire_entropy_from_cpu(pool);
  713|       |    if (entropy_available > 0)
  714|       |        return entropy_available;
  715|       |#endif
  716|       |
  717|       |#if defined(OPENSSL_RAND_SEED_EGD)
  718|       |    {
  719|       |        static const char *paths[] = { DEVRANDOM_EGD, NULL };
  720|       |        size_t bytes_needed;
  721|       |        unsigned char *buffer;
  722|       |        int i;
  723|       |
  724|       |        bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
  725|       |        for (i = 0; bytes_needed > 0 && paths[i] != NULL; i++) {
  726|       |            size_t bytes = 0;
  727|       |            int num;
  728|       |
  729|       |            buffer = ossl_rand_pool_add_begin(pool, bytes_needed);
  730|       |            num = RAND_query_egd_bytes(paths[i],
  731|       |                buffer, (int)bytes_needed);
  732|       |            if (num == (int)bytes_needed)
  733|       |                bytes = bytes_needed;
  734|       |
  735|       |            ossl_rand_pool_add_end(pool, bytes, 8 * bytes);
  736|       |            bytes_needed = ossl_rand_pool_bytes_needed(pool, 1);
  737|       |        }
  738|       |        entropy_available = ossl_rand_pool_entropy_available(pool);
  739|       |        if (entropy_available > 0)
  740|       |            return entropy_available;
  741|       |    }
  742|       |#endif
  743|       |
  744|      0|    return ossl_rand_pool_entropy_available(pool);
  745|      0|#endif
  746|      0|}
rand_unix.c:close_random_device:
  562|      4|{
  563|      4|    struct random_device *rd = &random_devices[n];
  564|       |
  565|      4|    if (check_random_device(rd))
  ------------------
  |  Branch (565:9): [True: 0, False: 4]
  ------------------
  566|      0|        close(rd->fd);
  567|      4|    rd->fd = -1;
  568|      4|}
rand_unix.c:check_random_device:
  517|      4|{
  518|      4|    struct stat st;
  519|       |
  520|      4|    return rd->fd != -1
  ------------------
  |  Branch (520:12): [True: 0, False: 4]
  ------------------
  521|      0|        && fstat(rd->fd, &st) != -1
  ------------------
  |  Branch (521:12): [True: 0, False: 0]
  ------------------
  522|      0|        && rd->dev == st.st_dev
  ------------------
  |  Branch (522:12): [True: 0, False: 0]
  ------------------
  523|      0|        && rd->ino == st.st_ino
  ------------------
  |  Branch (523:12): [True: 0, False: 0]
  ------------------
  524|      0|        && ((rd->mode ^ st.st_mode) & ~(S_IRWXU | S_IRWXG | S_IRWXO)) == 0
  ------------------
  |  Branch (524:12): [True: 0, False: 0]
  ------------------
  525|      0|        && rd->rdev == st.st_rdev;
  ------------------
  |  Branch (525:12): [True: 0, False: 0]
  ------------------
  526|      4|}
rand_unix.c:syscall_random:
  333|    549|{
  334|       |    /*
  335|       |     * Note: 'buflen' equals the size of the buffer which is used by the
  336|       |     * get_entropy() callback of the RAND_DRBG. It is roughly bounded by
  337|       |     *
  338|       |     *   2 * RAND_POOL_FACTOR * (RAND_DRBG_STRENGTH / 8) = 2^14
  339|       |     *
  340|       |     * which is way below the OSSL_SSIZE_MAX limit. Therefore sign conversion
  341|       |     * between size_t and ssize_t is safe even without a range check.
  342|       |     */
  343|       |
  344|       |    /*
  345|       |     * Do runtime detection to find getentropy().
  346|       |     *
  347|       |     * Known OSs that should support this:
  348|       |     * - Darwin since 16 (OSX 10.12, IOS 10.0).
  349|       |     * - Solaris since 11.3
  350|       |     * - OpenBSD since 5.6
  351|       |     * - Linux since 3.17 with glibc 2.25
  352|       |     *
  353|       |     * Note: Sometimes getentropy() can be provided but not implemented
  354|       |     * internally. So we need to check errno for ENOSYS
  355|       |     */
  356|    549|#if !defined(__DragonFly__) && !defined(__NetBSD__) && !defined(__FreeBSD__)
  357|    549|#if defined(__GNUC__) && __GNUC__ >= 2 && defined(__ELF__) && !defined(__hpux)
  358|    549|    extern int getentropy(void *buffer, size_t length) __attribute__((weak));
  359|       |
  360|    549|    if (getentropy != NULL) {
  ------------------
  |  Branch (360:9): [True: 549, False: 0]
  ------------------
  361|    549|        if (getentropy(buf, buflen) == 0)
  ------------------
  |  Branch (361:13): [True: 549, False: 0]
  ------------------
  362|    549|            return (ssize_t)buflen;
  363|      0|        if (errno != ENOSYS)
  ------------------
  |  Branch (363:13): [True: 0, False: 0]
  ------------------
  364|      0|            return -1;
  365|      0|    }
  366|       |#elif defined(OPENSSL_APPLE_CRYPTO_RANDOM)
  367|       |
  368|       |    if (CCRandomGenerateBytes(buf, buflen) == kCCSuccess)
  369|       |        return (ssize_t)buflen;
  370|       |
  371|       |    return -1;
  372|       |#else
  373|       |    union {
  374|       |        void *p;
  375|       |        int (*f)(void *buffer, size_t length);
  376|       |    } p_getentropy;
  377|       |
  378|       |    /*
  379|       |     * We could cache the result of the lookup, but we normally don't
  380|       |     * call this function often.
  381|       |     */
  382|       |    ERR_set_mark();
  383|       |    p_getentropy.p = DSO_global_lookup("getentropy");
  384|       |    ERR_pop_to_mark();
  385|       |    if (p_getentropy.p != NULL)
  386|       |        return p_getentropy.f(buf, buflen) == 0 ? (ssize_t)buflen : -1;
  387|       |#endif
  388|      0|#endif /* !__DragonFly__ && !__NetBSD__ && !__FreeBSD__ */
  389|       |
  390|       |    /* Linux supports this since version 3.17 */
  391|      0|#if defined(__linux) && defined(__NR_getrandom)
  392|      0|    return syscall(__NR_getrandom, buf, buflen, 0);
  393|       |#elif (defined(__DragonFly__) && __DragonFly_version >= 500700) \
  394|       |    || (defined(__NetBSD__) && __NetBSD_Version >= 1000000000)  \
  395|       |    || (defined(__FreeBSD__) && __FreeBSD_version >= 1200061)
  396|       |    return getrandom(buf, buflen, 0);
  397|       |#elif (defined(__FreeBSD__) || defined(__NetBSD__)) && defined(KERN_ARND)
  398|       |    return sysctl_random(buf, buflen);
  399|       |#elif defined(__wasi__)
  400|       |    if (getentropy(buf, buflen) == 0)
  401|       |        return (ssize_t)buflen;
  402|       |    return -1;
  403|       |#else
  404|       |    errno = ENOSYS;
  405|       |    return -1;
  406|       |#endif
  407|    549|}

ossl_null_provider_init:
   74|     22|{
   75|     22|    *out = null_dispatch_table;
   76|       |
   77|       |    /* Could be anything - we don't use it */
   78|     22|    *provctx = (void *)handle;
   79|     22|    return 1;
   80|     22|}
nullprov.c:null_query:
   57|  1.10k|{
   58|  1.10k|    *no_cache = 0;
   59|       |    return NULL;
   60|  1.10k|}

ossl_prov_is_running:
   20|  1.75M|{
   21|  1.75M|    return 1;
   22|  1.75M|}

SSL_get_srtp_profiles:
  162|  1.64k|{
  163|  1.64k|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s);
  ------------------
  |  |   23|  1.64k|    SSL_CONNECTION_FROM_SSL_ONLY_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   17|  1.64k|    ((ssl) == NULL ? NULL                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (17:6): [True: 0, False: 1.64k]
  |  |  |  |  ------------------
  |  |  |  |   18|  1.64k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  1.64k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:23): [True: 1.64k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   19|  1.64k|                             ? (c SSL_CONNECTION *)(ssl)     \
  |  |  |  |   20|  1.64k|                             : NULL))
  |  |  ------------------
  ------------------
  164|       |
  165|  1.64k|    if (sc != NULL) {
  ------------------
  |  Branch (165:9): [True: 1.64k, False: 0]
  ------------------
  166|  1.64k|        if (sc->srtp_profiles != NULL) {
  ------------------
  |  Branch (166:13): [True: 0, False: 1.64k]
  ------------------
  167|      0|            return sc->srtp_profiles;
  168|  1.64k|        } else if ((s->ctx != NULL) && (s->ctx->srtp_profiles != NULL)) {
  ------------------
  |  Branch (168:20): [True: 1.64k, False: 0]
  |  Branch (168:40): [True: 0, False: 1.64k]
  ------------------
  169|      0|            return s->ctx->srtp_profiles;
  170|      0|        }
  171|  1.64k|    }
  172|       |
  173|  1.64k|    return NULL;
  174|  1.64k|}

ossl_quic_free_token_store:
 4842|  2.56k|{
 4843|  2.56k|    int refs;
 4844|       |
 4845|  2.56k|    if (hdl == NULL)
  ------------------
  |  Branch (4845:9): [True: 2.56k, False: 0]
  ------------------
 4846|  2.56k|        return;
 4847|       |
 4848|      0|    if (!CRYPTO_DOWN_REF(&hdl->references, &refs))
  ------------------
  |  Branch (4848:9): [True: 0, False: 0]
  ------------------
 4849|      0|        return;
 4850|       |
 4851|      0|    if (refs > 0)
  ------------------
  |  Branch (4851:9): [True: 0, False: 0]
  ------------------
 4852|      0|        return;
 4853|       |
 4854|       |    /* last reference, we can clean up */
 4855|      0|    ossl_crypto_mutex_free(&hdl->mutex);
 4856|      0|    lh_QUIC_TOKEN_doall(hdl->cache, free_this_token);
 4857|      0|    lh_QUIC_TOKEN_free(hdl->cache);
 4858|      0|    CRYPTO_FREE_REF(&hdl->references);
 4859|      0|    OPENSSL_free(hdl);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4860|      0|    return;
 4861|      0|}

ossl_quic_tls_free:
  658|  1.77k|{
  659|  1.77k|    if (qtls == NULL)
  ------------------
  |  Branch (659:9): [True: 1.77k, False: 0]
  ------------------
  660|  1.77k|        return;
  661|      0|    OSSL_ERR_STATE_free(qtls->error_state);
  662|      0|    OPENSSL_free(qtls);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  663|      0|}
ossl_quic_tls_clear:
  864|  3.54k|{
  865|  3.54k|    if (qtls == NULL)
  ------------------
  |  Branch (865:9): [True: 3.54k, False: 0]
  ------------------
  866|  3.54k|        return;
  867|      0|    qtls->local_transport_params_consumed = 0;
  868|      0|}

ossl_tls_buffer_release:
   27|  10.6k|{
   28|  10.6k|    OPENSSL_free(b->buf);
  ------------------
  |  |  131|  10.6k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   29|       |    b->buf = NULL;
   30|  10.6k|}
ossl_rlayer_fatal:
   50|    157|{
   51|    157|    va_list args;
   52|       |
   53|    157|    va_start(args, fmt);
   54|    157|    ERR_vset_error(ERR_LIB_SSL, reason, fmt, args);
  ------------------
  |  |   89|    157|#define ERR_LIB_SSL 20
  ------------------
   55|    157|    va_end(args);
   56|       |
   57|    157|    rl->alert = al;
   58|    157|}
tls_setup_write_buffer:
  144|  3.25k|{
  145|  3.25k|    unsigned char *p;
  146|  3.25k|    size_t maxalign = 0, headerlen;
  147|  3.25k|    TLS_BUFFER *wb;
  148|  3.25k|    size_t currpipe;
  149|  3.25k|    size_t defltlen = 0;
  150|  3.25k|    size_t contenttypelen = 0;
  151|       |
  152|  3.25k|    if (firstlen == 0 || (numwpipes > 1 && nextlen == 0)) {
  ------------------
  |  Branch (152:9): [True: 3.25k, False: 0]
  |  Branch (152:27): [True: 0, False: 0]
  |  Branch (152:44): [True: 0, False: 0]
  ------------------
  153|  3.25k|        if (rl->isdtls)
  ------------------
  |  Branch (153:13): [True: 0, False: 3.25k]
  ------------------
  154|      0|            headerlen = DTLS1_RT_HEADER_LENGTH + 1;
  ------------------
  |  |   41|      0|#define DTLS1_RT_HEADER_LENGTH 13
  ------------------
  155|  3.25k|        else
  156|  3.25k|            headerlen = SSL3_RT_HEADER_LENGTH;
  ------------------
  |  |  139|  3.25k|#define SSL3_RT_HEADER_LENGTH 5
  ------------------
  157|       |
  158|       |        /* TLSv1.3 adds an extra content type byte after payload data */
  159|  3.25k|        if (rl->version == TLS1_3_VERSION)
  ------------------
  |  |   27|  3.25k|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (159:13): [True: 8, False: 3.24k]
  ------------------
  160|      8|            contenttypelen = 1;
  161|       |
  162|  3.25k|#if defined(SSL3_ALIGN_PAYLOAD) && SSL3_ALIGN_PAYLOAD != 0
  163|  3.25k|        maxalign = SSL3_ALIGN_PAYLOAD - 1;
  ------------------
  |  |  152|  3.25k|#define SSL3_ALIGN_PAYLOAD 8
  ------------------
  164|  3.25k|#endif
  165|       |
  166|  3.25k|        defltlen = maxalign + headerlen + rl->eivlen + rl->max_frag_len
  167|  3.25k|            + contenttypelen + SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD;
  ------------------
  |  |  195|  3.25k|    (SSL_RT_MAX_CIPHER_BLOCK_SIZE + SSL3_RT_MAX_MD_SIZE)
  |  |  ------------------
  |  |  |  |  172|  3.25k|#define SSL_RT_MAX_CIPHER_BLOCK_SIZE 16
  |  |  ------------------
  |  |                   (SSL_RT_MAX_CIPHER_BLOCK_SIZE + SSL3_RT_MAX_MD_SIZE)
  |  |  ------------------
  |  |  |  |  166|  3.25k|#define SSL3_RT_MAX_MD_SIZE 64
  |  |  ------------------
  ------------------
  168|  3.25k|#ifndef OPENSSL_NO_COMP
  169|  3.25k|        if (tls_allow_compression(rl))
  ------------------
  |  Branch (169:13): [True: 0, False: 3.25k]
  ------------------
  170|      0|            defltlen += SSL3_RT_MAX_COMPRESSED_OVERHEAD;
  ------------------
  |  |  179|      0|#define SSL3_RT_MAX_COMPRESSED_OVERHEAD 1024
  ------------------
  171|  3.25k|#endif
  172|       |        /*
  173|       |         * We don't need to add eivlen here since empty fragments only occur
  174|       |         * when we don't have an explicit IV. The contenttype byte will also
  175|       |         * always be 0 in these protocol versions
  176|       |         */
  177|  3.25k|        if ((rl->options & SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS) == 0)
  ------------------
  |  |  377|  3.25k|#define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS SSL_OP_BIT(11)
  |  |  ------------------
  |  |  |  |  350|  3.25k|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (177:13): [True: 3.25k, False: 5]
  ------------------
  178|  3.25k|            defltlen += headerlen + maxalign + SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD;
  ------------------
  |  |  195|  3.25k|    (SSL_RT_MAX_CIPHER_BLOCK_SIZE + SSL3_RT_MAX_MD_SIZE)
  |  |  ------------------
  |  |  |  |  172|  3.25k|#define SSL_RT_MAX_CIPHER_BLOCK_SIZE 16
  |  |  ------------------
  |  |                   (SSL_RT_MAX_CIPHER_BLOCK_SIZE + SSL3_RT_MAX_MD_SIZE)
  |  |  ------------------
  |  |  |  |  166|  3.25k|#define SSL3_RT_MAX_MD_SIZE 64
  |  |  ------------------
  ------------------
  179|  3.25k|    }
  180|       |
  181|  3.25k|    wb = rl->wbuf;
  182|  6.51k|    for (currpipe = 0; currpipe < numwpipes; currpipe++) {
  ------------------
  |  Branch (182:24): [True: 3.25k, False: 3.25k]
  ------------------
  183|  3.25k|        TLS_BUFFER *thiswb = &wb[currpipe];
  184|  3.25k|        size_t len = (currpipe == 0) ? firstlen : nextlen;
  ------------------
  |  Branch (184:22): [True: 3.25k, False: 0]
  ------------------
  185|       |
  186|  3.25k|        if (len == 0)
  ------------------
  |  Branch (186:13): [True: 3.25k, False: 0]
  ------------------
  187|  3.25k|            len = defltlen;
  188|       |
  189|  3.25k|        if (thiswb->len != len) {
  ------------------
  |  Branch (189:13): [True: 1.77k, False: 1.47k]
  ------------------
  190|  1.77k|            OPENSSL_free(thiswb->buf);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  191|  1.77k|            thiswb->buf = NULL; /* force reallocation */
  192|  1.77k|        }
  193|       |
  194|  3.25k|        p = thiswb->buf;
  195|  3.25k|        if (p == NULL) {
  ------------------
  |  Branch (195:13): [True: 1.77k, False: 1.47k]
  ------------------
  196|  1.77k|            p = OPENSSL_malloc(len);
  ------------------
  |  |  106|  1.77k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  197|  1.77k|            if (p == NULL) {
  ------------------
  |  Branch (197:17): [True: 0, False: 1.77k]
  ------------------
  198|      0|                if (rl->numwpipes < currpipe)
  ------------------
  |  Branch (198:21): [True: 0, False: 0]
  ------------------
  199|      0|                    rl->numwpipes = currpipe;
  200|       |                /*
  201|       |                 * We've got a malloc failure, and we're still initialising
  202|       |                 * buffers. We assume we're so doomed that we won't even be able
  203|       |                 * to send an alert.
  204|       |                 */
  205|      0|                RLAYERfatal(rl, SSL_AD_NO_ALERT, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  206|      0|                return 0;
  207|      0|            }
  208|  1.77k|        }
  209|  3.25k|        memset(thiswb, 0, sizeof(TLS_BUFFER));
  210|  3.25k|        thiswb->buf = p;
  211|  3.25k|        thiswb->len = len;
  212|  3.25k|    }
  213|       |
  214|       |    /* Free any previously allocated buffers that we are no longer using */
  215|  3.25k|    tls_release_write_buffer_int(rl, currpipe);
  216|       |
  217|  3.25k|    rl->numwpipes = numwpipes;
  218|       |
  219|  3.25k|    return 1;
  220|  3.25k|}
tls_setup_read_buffer:
  230|  1.64k|{
  231|  1.64k|    unsigned char *p;
  232|  1.64k|    size_t len, maxalign = 0, headerlen;
  233|  1.64k|    TLS_BUFFER *b;
  234|       |
  235|  1.64k|    b = &rl->rbuf;
  236|       |
  237|  1.64k|    if (rl->isdtls)
  ------------------
  |  Branch (237:9): [True: 0, False: 1.64k]
  ------------------
  238|      0|        headerlen = DTLS1_RT_HEADER_LENGTH;
  ------------------
  |  |   41|      0|#define DTLS1_RT_HEADER_LENGTH 13
  ------------------
  239|  1.64k|    else
  240|  1.64k|        headerlen = SSL3_RT_HEADER_LENGTH;
  ------------------
  |  |  139|  1.64k|#define SSL3_RT_HEADER_LENGTH 5
  ------------------
  241|       |
  242|  1.64k|#if defined(SSL3_ALIGN_PAYLOAD) && SSL3_ALIGN_PAYLOAD != 0
  243|  1.64k|    maxalign = SSL3_ALIGN_PAYLOAD - 1;
  ------------------
  |  |  152|  1.64k|#define SSL3_ALIGN_PAYLOAD 8
  ------------------
  244|  1.64k|#endif
  245|       |
  246|  1.64k|    if (b->buf == NULL) {
  ------------------
  |  Branch (246:9): [True: 1.64k, False: 0]
  ------------------
  247|  1.64k|        len = rl->max_frag_len
  248|  1.64k|            + SSL3_RT_MAX_ENCRYPTED_OVERHEAD + headerlen + maxalign;
  ------------------
  |  |  186|  1.64k|#define SSL3_RT_MAX_ENCRYPTED_OVERHEAD (256 + SSL3_RT_MAX_MD_SIZE)
  |  |  ------------------
  |  |  |  |  166|  1.64k|#define SSL3_RT_MAX_MD_SIZE 64
  |  |  ------------------
  ------------------
  249|  1.64k|#ifndef OPENSSL_NO_COMP
  250|  1.64k|        if (tls_allow_compression(rl))
  ------------------
  |  Branch (250:13): [True: 0, False: 1.64k]
  ------------------
  251|      0|            len += SSL3_RT_MAX_COMPRESSED_OVERHEAD;
  ------------------
  |  |  179|      0|#define SSL3_RT_MAX_COMPRESSED_OVERHEAD 1024
  ------------------
  252|  1.64k|#endif
  253|       |
  254|       |        /* Ensure our buffer is large enough to support all our pipelines */
  255|  1.64k|        if (rl->max_pipelines > 1)
  ------------------
  |  Branch (255:13): [True: 0, False: 1.64k]
  ------------------
  256|      0|            len *= rl->max_pipelines;
  257|       |
  258|  1.64k|        if (b->default_len > len)
  ------------------
  |  Branch (258:13): [True: 1.64k, False: 0]
  ------------------
  259|  1.64k|            len = b->default_len;
  260|       |
  261|  1.64k|        if ((p = OPENSSL_malloc(len)) == NULL) {
  ------------------
  |  |  106|  1.64k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (261:13): [True: 0, False: 1.64k]
  ------------------
  262|       |            /*
  263|       |             * We've got a malloc failure, and we're still initialising buffers.
  264|       |             * We assume we're so doomed that we won't even be able to send an
  265|       |             * alert.
  266|       |             */
  267|      0|            RLAYERfatal(rl, SSL_AD_NO_ALERT, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  268|      0|            return 0;
  269|      0|        }
  270|  1.64k|        b->buf = p;
  271|  1.64k|        b->len = len;
  272|  1.64k|    }
  273|       |
  274|  1.64k|    return 1;
  275|  1.64k|}
tls_default_read_n:
  296|  2.35k|{
  297|       |    /*
  298|       |     * If extend == 0, obtain new n-byte packet; if extend == 1, increase
  299|       |     * packet by another n bytes. The packet will be in the sub-array of
  300|       |     * rl->rbuf.buf specified by rl->packet and rl->packet_length. (If
  301|       |     * rl->read_ahead is set, 'max' bytes may be stored in rbuf [plus
  302|       |     * rl->packet_length bytes if extend == 1].) if clearold == 1, move the
  303|       |     * packet to the start of the buffer; if clearold == 0 then leave any old
  304|       |     * packets where they were
  305|       |     */
  306|  2.35k|    size_t len, left, align = 0;
  307|  2.35k|    unsigned char *pkt;
  308|  2.35k|    TLS_BUFFER *rb;
  309|       |
  310|  2.35k|    if (n == 0)
  ------------------
  |  Branch (310:9): [True: 0, False: 2.35k]
  ------------------
  311|      0|        return OSSL_RECORD_RETURN_NON_FATAL_ERR;
  ------------------
  |  |   47|      0|#define OSSL_RECORD_RETURN_NON_FATAL_ERR -1
  ------------------
  312|       |
  313|  2.35k|    rb = &rl->rbuf;
  314|  2.35k|    left = rb->left;
  315|  2.35k|#if defined(SSL3_ALIGN_PAYLOAD) && SSL3_ALIGN_PAYLOAD != 0
  316|  2.35k|    align = (size_t)rb->buf + SSL3_RT_HEADER_LENGTH;
  ------------------
  |  |  139|  2.35k|#define SSL3_RT_HEADER_LENGTH 5
  ------------------
  317|  2.35k|    align = SSL3_ALIGN_PAYLOAD - 1 - ((align - 1) % SSL3_ALIGN_PAYLOAD);
  ------------------
  |  |  152|  2.35k|#define SSL3_ALIGN_PAYLOAD 8
  ------------------
                  align = SSL3_ALIGN_PAYLOAD - 1 - ((align - 1) % SSL3_ALIGN_PAYLOAD);
  ------------------
  |  |  152|  2.35k|#define SSL3_ALIGN_PAYLOAD 8
  ------------------
  318|  2.35k|#endif
  319|       |
  320|  2.35k|    if (!extend) {
  ------------------
  |  Branch (320:9): [True: 1.86k, False: 492]
  ------------------
  321|       |        /* start with empty packet ... */
  322|  1.86k|        if (left == 0)
  ------------------
  |  Branch (322:13): [True: 1.85k, False: 11]
  ------------------
  323|  1.85k|            rb->offset = align;
  324|       |
  325|  1.86k|        rl->packet = rb->buf + rb->offset;
  326|  1.86k|        rl->packet_length = 0;
  327|       |        /* ... now we can act as if 'extend' was set */
  328|  1.86k|    }
  329|       |
  330|  2.35k|    if (!ossl_assert(rl->packet != NULL)) {
  ------------------
  |  |   52|  2.35k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  2.35k|    __FILE__, __LINE__)
  ------------------
  |  Branch (330:9): [True: 0, False: 2.35k]
  ------------------
  331|       |        /* does not happen */
  332|      0|        RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  333|      0|        return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  334|      0|    }
  335|       |
  336|  2.35k|    len = rl->packet_length;
  337|  2.35k|    pkt = rb->buf + align;
  338|       |    /*
  339|       |     * Move any available bytes to front of buffer: 'len' bytes already
  340|       |     * pointed to by 'packet', 'left' extra ones at the end
  341|       |     */
  342|  2.35k|    if (rl->packet != pkt && clearold == 1) {
  ------------------
  |  Branch (342:9): [True: 0, False: 2.35k]
  |  Branch (342:30): [True: 0, False: 0]
  ------------------
  343|      0|        memmove(pkt, rl->packet, len + left);
  344|      0|        rl->packet = pkt;
  345|      0|        rb->offset = len + align;
  346|      0|    }
  347|       |
  348|       |    /*
  349|       |     * For DTLS/UDP reads should not span multiple packets because the read
  350|       |     * operation returns the whole packet at once (as long as it fits into
  351|       |     * the buffer).
  352|       |     */
  353|  2.35k|    if (rl->isdtls) {
  ------------------
  |  Branch (353:9): [True: 0, False: 2.35k]
  ------------------
  354|      0|        if (left == 0 && extend) {
  ------------------
  |  Branch (354:13): [True: 0, False: 0]
  |  Branch (354:26): [True: 0, False: 0]
  ------------------
  355|       |            /*
  356|       |             * We received a record with a header but no body data. This will
  357|       |             * get dumped.
  358|       |             */
  359|      0|            return OSSL_RECORD_RETURN_NON_FATAL_ERR;
  ------------------
  |  |   47|      0|#define OSSL_RECORD_RETURN_NON_FATAL_ERR -1
  ------------------
  360|      0|        }
  361|      0|        if (left > 0 && n > left)
  ------------------
  |  Branch (361:13): [True: 0, False: 0]
  |  Branch (361:25): [True: 0, False: 0]
  ------------------
  362|      0|            n = left;
  363|      0|    }
  364|       |
  365|       |    /* if there is enough in the buffer from a previous read, take some */
  366|  2.35k|    if (left >= n) {
  ------------------
  |  Branch (366:9): [True: 0, False: 2.35k]
  ------------------
  367|      0|        rl->packet_length += n;
  368|      0|        rb->left = left - n;
  369|      0|        rb->offset += n;
  370|      0|        *readbytes = n;
  371|      0|        return OSSL_RECORD_RETURN_SUCCESS;
  ------------------
  |  |   45|      0|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
  372|      0|    }
  373|       |
  374|       |    /* else we need to read more data */
  375|       |
  376|  2.35k|    if (n > rb->len - rb->offset) {
  ------------------
  |  Branch (376:9): [True: 0, False: 2.35k]
  ------------------
  377|       |        /* does not happen */
  378|      0|        RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  379|      0|        return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  380|      0|    }
  381|       |
  382|       |    /* We always act like read_ahead is set for DTLS */
  383|  2.35k|    if (!rl->read_ahead && !rl->isdtls) {
  ------------------
  |  Branch (383:9): [True: 2.35k, False: 0]
  |  Branch (383:28): [True: 2.35k, False: 0]
  ------------------
  384|       |        /* ignore max parameter */
  385|  2.35k|        max = n;
  386|  2.35k|    } else {
  387|      0|        if (max < n)
  ------------------
  |  Branch (387:13): [True: 0, False: 0]
  ------------------
  388|      0|            max = n;
  389|      0|        if (max > rb->len - rb->offset)
  ------------------
  |  Branch (389:13): [True: 0, False: 0]
  ------------------
  390|      0|            max = rb->len - rb->offset;
  391|      0|    }
  392|       |
  393|  3.15k|    while (left < n) {
  ------------------
  |  Branch (393:12): [True: 2.38k, False: 770]
  ------------------
  394|  2.38k|        size_t bioread = 0;
  395|  2.38k|        int ret;
  396|  2.38k|        BIO *bio = rl->prev != NULL ? rl->prev : rl->bio;
  ------------------
  |  Branch (396:20): [True: 0, False: 2.38k]
  ------------------
  397|       |
  398|       |        /*
  399|       |         * Now we have len+left bytes at the front of rl->rbuf.buf and
  400|       |         * need to read in more until we have len + n (up to len + max if
  401|       |         * possible)
  402|       |         */
  403|       |
  404|  2.38k|        clear_sys_error();
  ------------------
  |  |   31|  2.38k|#define clear_sys_error() errno = 0
  ------------------
  405|  2.38k|        if (bio != NULL) {
  ------------------
  |  Branch (405:13): [True: 2.38k, False: 0]
  ------------------
  406|  2.38k|            ret = BIO_read(bio, pkt + len + left, (int)(max - left));
  407|  2.38k|            if (ret > 0) {
  ------------------
  |  Branch (407:17): [True: 803, False: 1.58k]
  ------------------
  408|    803|                bioread = ret;
  409|    803|                ret = OSSL_RECORD_RETURN_SUCCESS;
  ------------------
  |  |   45|    803|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
  410|  1.58k|            } else if (BIO_should_retry(bio)) {
  ------------------
  |  |  272|  1.58k|#define BIO_should_retry(a) BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY)
  |  |  ------------------
  |  |  |  |  226|  1.58k|#define BIO_FLAGS_SHOULD_RETRY 0x08
  |  |  ------------------
  |  |  |  Branch (272:29): [True: 310, False: 1.27k]
  |  |  ------------------
  ------------------
  411|    310|                if (rl->prev != NULL) {
  ------------------
  |  Branch (411:21): [True: 0, False: 310]
  ------------------
  412|       |                    /*
  413|       |                     * We were reading from the previous epoch. Now there is no
  414|       |                     * more data, so swap to the actual transport BIO
  415|       |                     */
  416|      0|                    BIO_free(rl->prev);
  417|      0|                    rl->prev = NULL;
  418|      0|                    continue;
  419|      0|                }
  420|    310|                ret = OSSL_RECORD_RETURN_RETRY;
  ------------------
  |  |   46|    310|#define OSSL_RECORD_RETURN_RETRY 0
  ------------------
  421|  1.27k|            } else if (BIO_eof(bio)) {
  ------------------
  |  |  633|  1.27k|#define BIO_eof(b) (int)BIO_ctrl(b, BIO_CTRL_EOF, 0, NULL)
  |  |  ------------------
  |  |  |  |   91|  1.27k|#define BIO_CTRL_EOF 2 /* opt - are we at the eof */
  |  |  ------------------
  |  |  |  Branch (633:20): [True: 1.26k, False: 11]
  |  |  ------------------
  ------------------
  422|  1.26k|                ret = OSSL_RECORD_RETURN_EOF;
  ------------------
  |  |   49|  1.26k|#define OSSL_RECORD_RETURN_EOF -3
  ------------------
  423|  1.26k|            } else {
  424|     11|                ret = OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|     11|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  425|     11|            }
  426|  2.38k|        } else {
  427|      0|            RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, SSL_R_READ_BIO_NOT_SET);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  428|      0|            ret = OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  429|      0|        }
  430|       |
  431|  2.38k|        if (ret <= OSSL_RECORD_RETURN_RETRY) {
  ------------------
  |  |   46|  2.38k|#define OSSL_RECORD_RETURN_RETRY 0
  ------------------
  |  Branch (431:13): [True: 1.58k, False: 803]
  ------------------
  432|  1.58k|            rb->left = left;
  433|  1.58k|            if ((rl->mode & SSL_MODE_RELEASE_BUFFERS) != 0 && !rl->isdtls)
  ------------------
  |  |  515|  1.58k|#define SSL_MODE_RELEASE_BUFFERS 0x00000010U
  ------------------
  |  Branch (433:17): [True: 0, False: 1.58k]
  |  Branch (433:63): [True: 0, False: 0]
  ------------------
  434|      0|                if (len + left == 0)
  ------------------
  |  Branch (434:21): [True: 0, False: 0]
  ------------------
  435|      0|                    tls_release_read_buffer(rl);
  436|  1.58k|            return ret;
  437|  1.58k|        }
  438|    803|        left += bioread;
  439|       |        /*
  440|       |         * reads should *never* span multiple packets for DTLS because the
  441|       |         * underlying transport protocol is message oriented as opposed to
  442|       |         * byte oriented as in the TLS case.
  443|       |         */
  444|    803|        if (rl->isdtls) {
  ------------------
  |  Branch (444:13): [True: 0, False: 803]
  ------------------
  445|      0|            if (n > left)
  ------------------
  |  Branch (445:17): [True: 0, False: 0]
  ------------------
  446|      0|                n = left; /* makes the while condition false */
  447|      0|        }
  448|    803|    }
  449|       |
  450|       |    /* done reading, now the book-keeping */
  451|    770|    rb->offset += n;
  452|    770|    rb->left = left - n;
  453|    770|    rl->packet_length += n;
  454|    770|    *readbytes = n;
  455|    770|    return OSSL_RECORD_RETURN_SUCCESS;
  ------------------
  |  |   45|    770|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
  456|  2.35k|}
tls_get_more_records:
  544|  2.04k|{
  545|  2.04k|    int enc_err, rret;
  546|  2.04k|    int i;
  547|  2.04k|    size_t more, n;
  548|  2.04k|    TLS_RL_RECORD *rr, *thisrr;
  549|  2.04k|    TLS_BUFFER *rbuf;
  550|  2.04k|    unsigned char *p;
  551|  2.04k|    unsigned char md[EVP_MAX_MD_SIZE];
  552|  2.04k|    unsigned int version;
  553|  2.04k|    size_t mac_size = 0;
  554|  2.04k|    int imac_size;
  555|  2.04k|    size_t num_recs = 0, max_recs, j;
  556|  2.04k|    PACKET pkt, sslv2pkt;
  557|  2.04k|    SSL_MAC_BUF *macbufs = NULL;
  558|  2.04k|    int ret = OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|  2.04k|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  559|       |
  560|  2.04k|    rr = rl->rrec;
  561|  2.04k|    rbuf = &rl->rbuf;
  562|  2.04k|    if (rbuf->buf == NULL) {
  ------------------
  |  Branch (562:9): [True: 1.64k, False: 403]
  ------------------
  563|  1.64k|        if (!tls_setup_read_buffer(rl)) {
  ------------------
  |  Branch (563:13): [True: 0, False: 1.64k]
  ------------------
  564|       |            /* RLAYERfatal() already called */
  565|      0|            return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  566|      0|        }
  567|  1.64k|    }
  568|       |
  569|  2.04k|    max_recs = rl->max_pipelines;
  570|       |
  571|  2.04k|    if (max_recs == 0)
  ------------------
  |  Branch (571:9): [True: 2.04k, False: 0]
  ------------------
  572|  2.04k|        max_recs = 1;
  573|       |
  574|  2.04k|    do {
  575|  2.04k|        thisrr = &rr[num_recs];
  576|       |
  577|       |        /* check if we have the header */
  578|  2.04k|        if ((rl->rstate != SSL_ST_READ_BODY) || (rl->packet_length < SSL3_RT_HEADER_LENGTH)) {
  ------------------
  |  | 1161|  2.04k|#define SSL_ST_READ_BODY 0xF1
  ------------------
                      if ((rl->rstate != SSL_ST_READ_BODY) || (rl->packet_length < SSL3_RT_HEADER_LENGTH)) {
  ------------------
  |  |  139|    183|#define SSL3_RT_HEADER_LENGTH 5
  ------------------
  |  Branch (578:13): [True: 1.86k, False: 183]
  |  Branch (578:49): [True: 0, False: 183]
  ------------------
  579|  1.86k|            size_t sslv2len;
  580|  1.86k|            unsigned int type;
  581|       |
  582|  1.86k|            rret = rl->funcs->read_n(rl, SSL3_RT_HEADER_LENGTH,
  ------------------
  |  |  139|  1.86k|#define SSL3_RT_HEADER_LENGTH 5
  ------------------
  583|  1.86k|                TLS_BUFFER_get_len(rbuf), 0,
  ------------------
  |  |  527|  1.86k|#define TLS_BUFFER_get_len(b) ((b)->len)
  ------------------
  584|  1.86k|                num_recs == 0 ? 1 : 0, &n);
  ------------------
  |  Branch (584:17): [True: 1.86k, False: 0]
  ------------------
  585|       |
  586|  1.86k|            if (rret < OSSL_RECORD_RETURN_SUCCESS)
  ------------------
  |  |   45|  1.86k|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
  |  Branch (586:17): [True: 1.38k, False: 478]
  ------------------
  587|  1.38k|                return rret; /* error or non-blocking */
  588|       |
  589|    478|            rl->rstate = SSL_ST_READ_BODY;
  ------------------
  |  | 1161|    478|#define SSL_ST_READ_BODY 0xF1
  ------------------
  590|       |
  591|    478|            p = rl->packet;
  592|    478|            if (!PACKET_buf_init(&pkt, p, rl->packet_length)) {
  ------------------
  |  Branch (592:17): [True: 0, False: 478]
  ------------------
  593|      0|                RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  594|      0|                return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  595|      0|            }
  596|    478|            sslv2pkt = pkt;
  597|    478|            if (!PACKET_get_net_2_len(&sslv2pkt, &sslv2len)
  ------------------
  |  Branch (597:17): [True: 0, False: 478]
  ------------------
  598|    478|                || !PACKET_get_1(&sslv2pkt, &type)) {
  ------------------
  |  Branch (598:20): [True: 0, False: 478]
  ------------------
  599|      0|                RLAYERfatal(rl, SSL_AD_DECODE_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  600|      0|                return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  601|      0|            }
  602|       |            /*
  603|       |             * The first record received by the server may be a V2ClientHello.
  604|       |             */
  605|    478|            if (rl->role == OSSL_RECORD_ROLE_SERVER
  ------------------
  |  |   40|    956|#define OSSL_RECORD_ROLE_SERVER 1
  ------------------
  |  Branch (605:17): [True: 0, False: 478]
  ------------------
  606|      0|                && rl->is_first_record
  ------------------
  |  Branch (606:20): [True: 0, False: 0]
  ------------------
  607|      0|                && (sslv2len & 0x8000) != 0
  ------------------
  |  Branch (607:20): [True: 0, False: 0]
  ------------------
  608|      0|                && (type == SSL2_MT_CLIENT_HELLO)) {
  ------------------
  |  |   25|      0|#define SSL2_MT_CLIENT_HELLO 1
  ------------------
  |  Branch (608:20): [True: 0, False: 0]
  ------------------
  609|       |                /*
  610|       |                 *  SSLv2 style record
  611|       |                 *
  612|       |                 * |num_recs| here will actually always be 0 because
  613|       |                 * |num_recs > 0| only ever occurs when we are processing
  614|       |                 * multiple app data records - which we know isn't the case here
  615|       |                 * because it is an SSLv2ClientHello. We keep it using
  616|       |                 * |num_recs| for the sake of consistency
  617|       |                 */
  618|      0|                thisrr->type = SSL3_RT_HANDSHAKE;
  ------------------
  |  |  221|      0|#define SSL3_RT_HANDSHAKE 22
  ------------------
  619|      0|                thisrr->rec_version = SSL2_VERSION;
  ------------------
  |  |   23|      0|#define SSL2_VERSION 0x0002
  ------------------
  620|       |
  621|      0|                thisrr->length = sslv2len & 0x7fff;
  622|       |
  623|      0|                if (!rl->funcs->validate_record_header(rl, thisrr)) {
  ------------------
  |  Branch (623:21): [True: 0, False: 0]
  ------------------
  624|       |                    /* RLAYERfatal already called */
  625|      0|                    return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  626|      0|                }
  627|       |
  628|      0|                if (thisrr->length > TLS_BUFFER_get_len(rbuf)
  ------------------
  |  |  527|      0|#define TLS_BUFFER_get_len(b) ((b)->len)
  ------------------
  |  Branch (628:21): [True: 0, False: 0]
  ------------------
  629|      0|                        - SSL2_RT_HEADER_LENGTH) {
  ------------------
  |  |  529|      0|#define SSL2_RT_HEADER_LENGTH 2
  ------------------
  630|      0|                    RLAYERfatal(rl, SSL_AD_RECORD_OVERFLOW,
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  631|      0|                        SSL_R_PACKET_LENGTH_TOO_LONG);
  632|      0|                    return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  633|      0|                }
  634|    478|            } else {
  635|       |                /* SSLv3+ style record */
  636|       |
  637|       |                /* Pull apart the header into the TLS_RL_RECORD */
  638|    478|                if (!PACKET_get_1(&pkt, &type)
  ------------------
  |  Branch (638:21): [True: 0, False: 478]
  ------------------
  639|    478|                    || !PACKET_get_net_2(&pkt, &version)
  ------------------
  |  Branch (639:24): [True: 0, False: 478]
  ------------------
  640|    478|                    || !PACKET_get_net_2_len(&pkt, &thisrr->length)) {
  ------------------
  |  Branch (640:24): [True: 0, False: 478]
  ------------------
  641|      0|                    if (rl->msg_callback != NULL)
  ------------------
  |  Branch (641:25): [True: 0, False: 0]
  ------------------
  642|      0|                        rl->msg_callback(0, 0, SSL3_RT_HEADER, p, 5, rl->cbarg);
  ------------------
  |  |  239|      0|#define SSL3_RT_HEADER 0x100
  ------------------
  643|      0|                    RLAYERfatal(rl, SSL_AD_DECODE_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  644|      0|                    return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  645|      0|                }
  646|    478|                thisrr->type = type;
  647|    478|                thisrr->rec_version = version;
  648|       |
  649|       |                /*
  650|       |                 * When we call validate_record_header() only records actually
  651|       |                 * received in SSLv2 format should have the record version set
  652|       |                 * to SSL2_VERSION. This way validate_record_header() can know
  653|       |                 * what format the record was in based on the version.
  654|       |                 */
  655|    478|                if (thisrr->rec_version == SSL2_VERSION) {
  ------------------
  |  |   23|    478|#define SSL2_VERSION 0x0002
  ------------------
  |  Branch (655:21): [True: 2, False: 476]
  ------------------
  656|      2|                    RLAYERfatal(rl, SSL_AD_PROTOCOL_VERSION,
  ------------------
  |  |  391|      2|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      2|    (ERR_new(),                                                  \
  |  |  |  |  394|      2|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      2|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      2|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  657|      2|                        SSL_R_WRONG_VERSION_NUMBER);
  658|      2|                    return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      2|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  659|      2|                }
  660|       |
  661|    476|                if (rl->msg_callback != NULL)
  ------------------
  |  Branch (661:21): [True: 0, False: 476]
  ------------------
  662|      0|                    rl->msg_callback(0, version, SSL3_RT_HEADER, p, 5, rl->cbarg);
  ------------------
  |  |  239|      0|#define SSL3_RT_HEADER 0x100
  ------------------
  663|       |
  664|    476|                if (!rl->funcs->validate_record_header(rl, thisrr)) {
  ------------------
  |  Branch (664:21): [True: 155, False: 321]
  ------------------
  665|       |                    /* RLAYERfatal already called */
  666|    155|                    return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|    155|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  667|    155|                }
  668|       |
  669|    321|                if (thisrr->length > TLS_BUFFER_get_len(rbuf) - SSL3_RT_HEADER_LENGTH) {
  ------------------
  |  |  527|    321|#define TLS_BUFFER_get_len(b) ((b)->len)
  ------------------
                              if (thisrr->length > TLS_BUFFER_get_len(rbuf) - SSL3_RT_HEADER_LENGTH) {
  ------------------
  |  |  139|    321|#define SSL3_RT_HEADER_LENGTH 5
  ------------------
  |  Branch (669:21): [True: 0, False: 321]
  ------------------
  670|      0|                    RLAYERfatal(rl, SSL_AD_RECORD_OVERFLOW,
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  671|      0|                        SSL_R_PACKET_LENGTH_TOO_LONG);
  672|      0|                    return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  673|      0|                }
  674|    321|            }
  675|       |
  676|       |            /* now rl->rstate == SSL_ST_READ_BODY */
  677|    478|        }
  678|       |
  679|       |        /*
  680|       |         * rl->rstate == SSL_ST_READ_BODY, get and decode the data. Calculate
  681|       |         * how much more data we need to read for the rest of the record
  682|       |         */
  683|    504|        if (thisrr->rec_version == SSL2_VERSION) {
  ------------------
  |  |   23|    504|#define SSL2_VERSION 0x0002
  ------------------
  |  Branch (683:13): [True: 0, False: 504]
  ------------------
  684|      0|            more = thisrr->length + SSL2_RT_HEADER_LENGTH
  ------------------
  |  |  529|      0|#define SSL2_RT_HEADER_LENGTH 2
  ------------------
  685|      0|                - SSL3_RT_HEADER_LENGTH;
  ------------------
  |  |  139|      0|#define SSL3_RT_HEADER_LENGTH 5
  ------------------
  686|    504|        } else {
  687|    504|            more = thisrr->length;
  688|    504|        }
  689|       |
  690|    504|        if (more > 0) {
  ------------------
  |  Branch (690:13): [True: 492, False: 12]
  ------------------
  691|       |            /* now rl->packet_length == SSL3_RT_HEADER_LENGTH */
  692|       |
  693|    492|            rret = rl->funcs->read_n(rl, more, more, 1, 0, &n);
  694|    492|            if (rret < OSSL_RECORD_RETURN_SUCCESS)
  ------------------
  |  |   45|    492|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
  |  Branch (694:17): [True: 200, False: 292]
  ------------------
  695|    200|                return rret; /* error or non-blocking io */
  696|    492|        }
  697|       |
  698|       |        /* set state for later operations */
  699|    304|        rl->rstate = SSL_ST_READ_HEADER;
  ------------------
  |  | 1160|    304|#define SSL_ST_READ_HEADER 0xF0
  ------------------
  700|       |
  701|       |        /*
  702|       |         * At this point, rl->packet_length == SSL3_RT_HEADER_LENGTH
  703|       |         * + thisrr->length, or rl->packet_length == SSL2_RT_HEADER_LENGTH
  704|       |         * + thisrr->length and we have that many bytes in rl->packet
  705|       |         */
  706|    304|        if (thisrr->rec_version == SSL2_VERSION)
  ------------------
  |  |   23|    304|#define SSL2_VERSION 0x0002
  ------------------
  |  Branch (706:13): [True: 0, False: 304]
  ------------------
  707|      0|            thisrr->input = &(rl->packet[SSL2_RT_HEADER_LENGTH]);
  ------------------
  |  |  529|      0|#define SSL2_RT_HEADER_LENGTH 2
  ------------------
  708|    304|        else
  709|    304|            thisrr->input = &(rl->packet[SSL3_RT_HEADER_LENGTH]);
  ------------------
  |  |  139|    304|#define SSL3_RT_HEADER_LENGTH 5
  ------------------
  710|       |
  711|       |        /*
  712|       |         * ok, we can now read from 'rl->packet' data into 'thisrr'.
  713|       |         * thisrr->input points at thisrr->length bytes, which need to be copied
  714|       |         * into thisrr->data by either the decryption or by the decompression.
  715|       |         * When the data is 'copied' into the thisrr->data buffer,
  716|       |         * thisrr->input will be updated to point at the new buffer
  717|       |         */
  718|       |
  719|       |        /*
  720|       |         * We now have - encrypted [ MAC [ compressed [ plain ] ] ]
  721|       |         * thisrr->length bytes of encrypted compressed stuff.
  722|       |         */
  723|       |
  724|       |        /* decrypt in place in 'thisrr->input' */
  725|    304|        thisrr->data = thisrr->input;
  726|    304|        thisrr->orig_len = thisrr->length;
  727|       |
  728|    304|        num_recs++;
  729|       |
  730|       |        /* we have pulled in a full packet so zero things */
  731|    304|        rl->packet_length = 0;
  732|    304|        rl->is_first_record = 0;
  733|    304|    } while (num_recs < max_recs
  ------------------
  |  Branch (733:14): [True: 0, False: 304]
  ------------------
  734|      0|        && thisrr->type == SSL3_RT_APPLICATION_DATA
  ------------------
  |  |  222|    304|#define SSL3_RT_APPLICATION_DATA 23
  ------------------
  |  Branch (734:12): [True: 0, False: 0]
  ------------------
  735|      0|        && RLAYER_USE_EXPLICIT_IV(rl)
  ------------------
  |  |  397|    304|#define RLAYER_USE_EXPLICIT_IV(rl) ((rl)->version == TLS1_1_VERSION \
  |  |  ------------------
  |  |  |  |   25|      0|#define TLS1_1_VERSION 0x0302
  |  |  ------------------
  |  |  |  Branch (397:37): [True: 0, False: 0]
  |  |  ------------------
  |  |  398|      0|    || (rl)->version == TLS1_2_VERSION                              \
  |  |  ------------------
  |  |  |  |   26|      0|#define TLS1_2_VERSION 0x0303
  |  |  ------------------
  |  |  |  Branch (398:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  399|      0|    || (rl)->version == DTLS1_BAD_VER                               \
  |  |  ------------------
  |  |  |  |   30|      0|#define DTLS1_BAD_VER 0x0100
  |  |  ------------------
  |  |  |  Branch (399:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  400|      0|    || (rl)->version == DTLS1_VERSION                               \
  |  |  ------------------
  |  |  |  |   28|      0|#define DTLS1_VERSION 0xFEFF
  |  |  ------------------
  |  |  |  Branch (400:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  401|    304|    || (rl)->version == DTLS1_2_VERSION)
  |  |  ------------------
  |  |  |  |   29|      0|#define DTLS1_2_VERSION 0xFEFD
  |  |  ------------------
  |  |  |  Branch (401:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  736|      0|        && rl->enc_ctx != NULL
  ------------------
  |  Branch (736:12): [True: 0, False: 0]
  ------------------
  737|      0|        && (EVP_CIPHER_get_flags(EVP_CIPHER_CTX_get0_cipher(rl->enc_ctx))
  ------------------
  |  Branch (737:12): [True: 0, False: 0]
  ------------------
  738|      0|               & EVP_CIPH_FLAG_PIPELINE)
  ------------------
  |  |  360|      0|#define EVP_CIPH_FLAG_PIPELINE 0X800000
  ------------------
  739|      0|            != 0
  740|      0|        && tls_record_app_data_waiting(rl));
  ------------------
  |  Branch (740:12): [True: 0, False: 0]
  ------------------
  741|       |
  742|    304|    if (num_recs == 1
  ------------------
  |  Branch (742:9): [True: 304, False: 0]
  ------------------
  743|    304|        && thisrr->type == SSL3_RT_CHANGE_CIPHER_SPEC
  ------------------
  |  |  219|    608|#define SSL3_RT_CHANGE_CIPHER_SPEC 20
  ------------------
  |  Branch (743:12): [True: 7, False: 297]
  ------------------
  744|       |        /* The following can happen in tlsany_meth after HRR */
  745|      7|        && rl->version == TLS1_3_VERSION
  ------------------
  |  |   27|    311|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (745:12): [True: 0, False: 7]
  ------------------
  746|      0|        && rl->is_first_handshake) {
  ------------------
  |  Branch (746:12): [True: 0, False: 0]
  ------------------
  747|       |        /*
  748|       |         * CCS messages must be exactly 1 byte long, containing the value 0x01
  749|       |         */
  750|      0|        if (thisrr->length != 1 || thisrr->data[0] != 0x01) {
  ------------------
  |  Branch (750:13): [True: 0, False: 0]
  |  Branch (750:36): [True: 0, False: 0]
  ------------------
  751|      0|            RLAYERfatal(rl, SSL_AD_UNEXPECTED_MESSAGE,
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  752|      0|                SSL_R_INVALID_CCS_MESSAGE);
  753|      0|            return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  754|      0|        }
  755|       |        /*
  756|       |         * CCS messages are ignored in TLSv1.3. We treat it like an empty
  757|       |         * handshake record - but we still call the msg_callback
  758|       |         */
  759|      0|        if (rl->msg_callback != NULL)
  ------------------
  |  Branch (759:13): [True: 0, False: 0]
  ------------------
  760|      0|            rl->msg_callback(0, TLS1_3_VERSION, SSL3_RT_CHANGE_CIPHER_SPEC,
  ------------------
  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  ------------------
                          rl->msg_callback(0, TLS1_3_VERSION, SSL3_RT_CHANGE_CIPHER_SPEC,
  ------------------
  |  |  219|      0|#define SSL3_RT_CHANGE_CIPHER_SPEC 20
  ------------------
  761|      0|                thisrr->data, 1, rl->cbarg);
  762|      0|        thisrr->type = SSL3_RT_HANDSHAKE;
  ------------------
  |  |  221|      0|#define SSL3_RT_HANDSHAKE 22
  ------------------
  763|      0|        if (++(rl->empty_record_count) > MAX_EMPTY_RECORDS) {
  ------------------
  |  |  527|      0|#define MAX_EMPTY_RECORDS 32
  ------------------
  |  Branch (763:13): [True: 0, False: 0]
  ------------------
  764|      0|            RLAYERfatal(rl, SSL_AD_UNEXPECTED_MESSAGE,
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  765|      0|                SSL_R_UNEXPECTED_CCS_MESSAGE);
  766|      0|            return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  767|      0|        }
  768|      0|        rl->num_recs = 0;
  769|      0|        rl->curr_rec = 0;
  770|      0|        rl->num_released = 0;
  771|       |
  772|      0|        return OSSL_RECORD_RETURN_SUCCESS;
  ------------------
  |  |   45|      0|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
  773|      0|    }
  774|       |
  775|    304|    if (rl->md_ctx != NULL) {
  ------------------
  |  Branch (775:9): [True: 0, False: 304]
  ------------------
  776|      0|        const EVP_MD *tmpmd = EVP_MD_CTX_get0_md(rl->md_ctx);
  777|       |
  778|      0|        if (tmpmd != NULL) {
  ------------------
  |  Branch (778:13): [True: 0, False: 0]
  ------------------
  779|      0|            imac_size = EVP_MD_get_size(tmpmd);
  780|      0|            if (!ossl_assert(imac_size > 0 && imac_size <= EVP_MAX_MD_SIZE)) {
  ------------------
  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  ------------------
  |  |  |  Branch (52:41): [True: 0, False: 0]
  |  |  |  Branch (52:41): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|      0|    __FILE__, __LINE__)
  ------------------
  |  Branch (780:17): [True: 0, False: 0]
  ------------------
  781|      0|                RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  782|      0|                return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  783|      0|            }
  784|      0|            mac_size = (size_t)imac_size;
  785|      0|        }
  786|      0|    }
  787|       |
  788|       |    /*
  789|       |     * If in encrypt-then-mac mode calculate mac from encrypted record. All
  790|       |     * the details below are public so no timing details can leak.
  791|       |     */
  792|    304|    if (rl->use_etm && rl->md_ctx != NULL) {
  ------------------
  |  Branch (792:9): [True: 0, False: 304]
  |  Branch (792:24): [True: 0, False: 0]
  ------------------
  793|      0|        unsigned char *mac;
  794|       |
  795|      0|        for (j = 0; j < num_recs; j++) {
  ------------------
  |  Branch (795:21): [True: 0, False: 0]
  ------------------
  796|      0|            thisrr = &rr[j];
  797|       |
  798|      0|            if (thisrr->length < mac_size) {
  ------------------
  |  Branch (798:17): [True: 0, False: 0]
  ------------------
  799|      0|                RLAYERfatal(rl, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_TOO_SHORT);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  800|      0|                return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  801|      0|            }
  802|      0|            thisrr->length -= mac_size;
  803|      0|            mac = thisrr->data + thisrr->length;
  804|      0|            i = rl->funcs->mac(rl, thisrr, md, 0 /* not send */);
  805|      0|            if (i == 0 || CRYPTO_memcmp(md, mac, mac_size) != 0) {
  ------------------
  |  |  319|      0|#define CRYPTO_memcmp memcmp
  ------------------
  |  Branch (805:17): [True: 0, False: 0]
  |  Branch (805:27): [True: 0, False: 0]
  ------------------
  806|      0|                RLAYERfatal(rl, SSL_AD_BAD_RECORD_MAC,
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  807|      0|                    SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC);
  808|      0|                return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  809|      0|            }
  810|      0|        }
  811|       |        /*
  812|       |         * We've handled the mac now - there is no MAC inside the encrypted
  813|       |         * record
  814|       |         */
  815|      0|        mac_size = 0;
  816|      0|    }
  817|       |
  818|    304|    if (mac_size > 0) {
  ------------------
  |  Branch (818:9): [True: 0, False: 304]
  ------------------
  819|      0|        macbufs = OPENSSL_calloc(num_recs, sizeof(*macbufs));
  ------------------
  |  |  112|      0|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  820|      0|        if (macbufs == NULL) {
  ------------------
  |  Branch (820:13): [True: 0, False: 0]
  ------------------
  821|      0|            RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  822|      0|            return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  823|      0|        }
  824|      0|    }
  825|       |
  826|    304|    ERR_set_mark();
  827|    304|    enc_err = rl->funcs->cipher(rl, rr, num_recs, 0, macbufs, mac_size);
  828|       |
  829|       |    /*-
  830|       |     * enc_err is:
  831|       |     *    0: if the record is publicly invalid, or an internal error, or AEAD
  832|       |     *       decryption failed, or ETM decryption failed.
  833|       |     *    1: Success or MTE decryption failed (MAC will be randomised)
  834|       |     */
  835|    304|    if (enc_err == 0) {
  ------------------
  |  Branch (835:9): [True: 0, False: 304]
  ------------------
  836|      0|        if (rl->alert != SSL_AD_NO_ALERT) {
  ------------------
  |  |   63|      0|#define SSL_AD_NO_ALERT -1
  ------------------
  |  Branch (836:13): [True: 0, False: 0]
  ------------------
  837|       |            /* RLAYERfatal() already got called */
  838|      0|            ERR_clear_last_mark();
  839|      0|            goto end;
  840|      0|        }
  841|      0|        if (num_recs == 1
  ------------------
  |  Branch (841:13): [True: 0, False: 0]
  ------------------
  842|      0|            && rl->skip_early_data != NULL
  ------------------
  |  Branch (842:16): [True: 0, False: 0]
  ------------------
  843|      0|            && rl->skip_early_data(rl->cbarg)) {
  ------------------
  |  Branch (843:16): [True: 0, False: 0]
  ------------------
  844|       |            /*
  845|       |             * Valid early_data that we cannot decrypt will fail here. We treat
  846|       |             * it like an empty record.
  847|       |             */
  848|       |
  849|       |            /*
  850|       |             * Remove any errors from the stack. Decryption failures are normal
  851|       |             * behaviour.
  852|       |             */
  853|      0|            ERR_pop_to_mark();
  854|       |
  855|      0|            thisrr = &rr[0];
  856|       |
  857|      0|            if (!rlayer_early_data_count_ok(rl, thisrr->length,
  ------------------
  |  Branch (857:17): [True: 0, False: 0]
  ------------------
  858|      0|                    EARLY_DATA_CIPHERTEXT_OVERHEAD, 0)) {
  ------------------
  |  |  616|      0|#define EARLY_DATA_CIPHERTEXT_OVERHEAD ((6 * (EVP_GCM_TLS_TAG_LEN + 1)) + 2)
  |  |  ------------------
  |  |  |  |  476|      0|#define EVP_GCM_TLS_TAG_LEN 16
  |  |  ------------------
  ------------------
  859|       |                /* RLAYERfatal() already called */
  860|      0|                goto end;
  861|      0|            }
  862|       |
  863|      0|            thisrr->length = 0;
  864|      0|            rl->num_recs = 0;
  865|      0|            rl->curr_rec = 0;
  866|      0|            rl->num_released = 0;
  867|       |            /* Reset the read sequence */
  868|      0|            memset(rl->sequence, 0, sizeof(rl->sequence));
  869|      0|            ret = 1;
  870|      0|            goto end;
  871|      0|        }
  872|      0|        ERR_clear_last_mark();
  873|      0|        RLAYERfatal(rl, SSL_AD_BAD_RECORD_MAC,
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  874|      0|            SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC);
  875|      0|        goto end;
  876|    304|    } else {
  877|    304|        ERR_clear_last_mark();
  878|    304|    }
  879|    304|    OSSL_TRACE_BEGIN(TLS)
  ------------------
  |  |  221|    304|    do {                           \
  |  |  222|    304|        BIO *trc_out = NULL;       \
  |  |  223|    304|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 304]
  |  |  ------------------
  ------------------
  880|      0|    {
  881|      0|        BIO_printf(trc_out, "dec %lu\n", (unsigned long)rr[0].length);
  882|      0|        BIO_dump_indent(trc_out, rr[0].data, (int)rr[0].length, 4);
  883|      0|    }
  884|    304|    OSSL_TRACE_END(TLS);
  ------------------
  |  |  226|    304|    }                            \
  |  |  227|    304|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 304]
  |  |  ------------------
  ------------------
  885|       |
  886|       |    /* r->length is now the compressed data plus mac */
  887|    304|    if (rl->enc_ctx != NULL
  ------------------
  |  Branch (887:9): [True: 0, False: 304]
  ------------------
  888|      0|        && !rl->use_etm
  ------------------
  |  Branch (888:12): [True: 0, False: 0]
  ------------------
  889|      0|        && EVP_MD_CTX_get0_md(rl->md_ctx) != NULL) {
  ------------------
  |  Branch (889:12): [True: 0, False: 0]
  ------------------
  890|      0|        for (j = 0; j < num_recs; j++) {
  ------------------
  |  Branch (890:21): [True: 0, False: 0]
  ------------------
  891|      0|            SSL_MAC_BUF *thismb = &macbufs[j];
  892|       |
  893|      0|            thisrr = &rr[j];
  894|       |
  895|      0|            i = rl->funcs->mac(rl, thisrr, md, 0 /* not send */);
  896|      0|            if (i == 0 || thismb == NULL || thismb->mac == NULL
  ------------------
  |  Branch (896:17): [True: 0, False: 0]
  |  Branch (896:27): [True: 0, False: 0]
  |  Branch (896:45): [True: 0, False: 0]
  ------------------
  897|      0|                || CRYPTO_memcmp(md, thismb->mac, (size_t)mac_size) != 0)
  ------------------
  |  |  319|      0|#define CRYPTO_memcmp memcmp
  ------------------
  |  Branch (897:20): [True: 0, False: 0]
  ------------------
  898|      0|                enc_err = 0;
  899|      0|            if (thisrr->length > SSL3_RT_MAX_COMPRESSED_LENGTH + mac_size)
  ------------------
  |  |  203|      0|    (SSL3_RT_MAX_PLAIN_LENGTH + SSL3_RT_MAX_COMPRESSED_OVERHEAD)
  |  |  ------------------
  |  |  |  |  177|      0|#define SSL3_RT_MAX_PLAIN_LENGTH 16384
  |  |  ------------------
  |  |                   (SSL3_RT_MAX_PLAIN_LENGTH + SSL3_RT_MAX_COMPRESSED_OVERHEAD)
  |  |  ------------------
  |  |  |  |  179|      0|#define SSL3_RT_MAX_COMPRESSED_OVERHEAD 1024
  |  |  ------------------
  ------------------
  |  Branch (899:17): [True: 0, False: 0]
  ------------------
  900|      0|                enc_err = 0;
  901|      0|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  902|      0|            if (enc_err == 0 && mac_size > 0 && thismb != NULL && thismb->mac != NULL && (md[0] ^ thismb->mac[0]) != 0xFF) {
  ------------------
  |  Branch (902:17): [True: 0, False: 0]
  |  Branch (902:33): [True: 0, False: 0]
  |  Branch (902:49): [True: 0, False: 0]
  |  Branch (902:67): [True: 0, False: 0]
  |  Branch (902:90): [True: 0, False: 0]
  ------------------
  903|      0|                enc_err = 1;
  904|      0|            }
  905|      0|#endif
  906|      0|        }
  907|      0|    }
  908|       |
  909|    304|    if (enc_err == 0) {
  ------------------
  |  Branch (909:9): [True: 0, False: 304]
  ------------------
  910|      0|        if (rl->alert != SSL_AD_NO_ALERT) {
  ------------------
  |  |   63|      0|#define SSL_AD_NO_ALERT -1
  ------------------
  |  Branch (910:13): [True: 0, False: 0]
  ------------------
  911|       |            /* We already called RLAYERfatal() */
  912|      0|            goto end;
  913|      0|        }
  914|       |        /*
  915|       |         * A separate 'decryption_failed' alert was introduced with TLS 1.0,
  916|       |         * SSL 3.0 only has 'bad_record_mac'.  But unless a decryption
  917|       |         * failure is directly visible from the ciphertext anyway, we should
  918|       |         * not reveal which kind of error occurred -- this might become
  919|       |         * visible to an attacker (e.g. via a logfile)
  920|       |         */
  921|      0|        RLAYERfatal(rl, SSL_AD_BAD_RECORD_MAC,
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  922|      0|            SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC);
  923|      0|        goto end;
  924|      0|    }
  925|       |
  926|    608|    for (j = 0; j < num_recs; j++) {
  ------------------
  |  Branch (926:17): [True: 304, False: 304]
  ------------------
  927|    304|        thisrr = &rr[j];
  928|       |
  929|    304|        if (!rl->funcs->post_process_record(rl, thisrr)) {
  ------------------
  |  Branch (929:13): [True: 0, False: 304]
  ------------------
  930|       |            /* RLAYERfatal already called */
  931|      0|            goto end;
  932|      0|        }
  933|       |
  934|       |        /*
  935|       |         * Record overflow checking (e.g. checking if
  936|       |         * thisrr->length > SSL3_RT_MAX_PLAIN_LENGTH) is the responsibility of
  937|       |         * the post_process_record() function above. However we check here if
  938|       |         * the received packet overflows the current Max Fragment Length setting
  939|       |         * if there is one.
  940|       |         * Note: rl->max_frag_len != SSL3_RT_MAX_PLAIN_LENGTH and KTLS are
  941|       |         * mutually exclusive. Also note that with KTLS thisrr->length can
  942|       |         * be > SSL3_RT_MAX_PLAIN_LENGTH (and rl->max_frag_len must be ignored)
  943|       |         */
  944|    304|        if (rl->max_frag_len != SSL3_RT_MAX_PLAIN_LENGTH
  ------------------
  |  |  177|    608|#define SSL3_RT_MAX_PLAIN_LENGTH 16384
  ------------------
  |  Branch (944:13): [True: 0, False: 304]
  ------------------
  945|      0|            && thisrr->length > rl->max_frag_len) {
  ------------------
  |  Branch (945:16): [True: 0, False: 0]
  ------------------
  946|      0|            RLAYERfatal(rl, SSL_AD_RECORD_OVERFLOW, SSL_R_DATA_LENGTH_TOO_LONG);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  947|      0|            goto end;
  948|      0|        }
  949|       |
  950|    304|        thisrr->off = 0;
  951|       |        /*-
  952|       |         * So at this point the following is true
  953|       |         * thisrr->type   is the type of record
  954|       |         * thisrr->length == number of bytes in record
  955|       |         * thisrr->off    == offset to first valid byte
  956|       |         * thisrr->data   == where to take bytes from, increment after use :-).
  957|       |         */
  958|       |
  959|       |        /* just read a 0 length packet */
  960|    304|        if (thisrr->length == 0) {
  ------------------
  |  Branch (960:13): [True: 12, False: 292]
  ------------------
  961|     12|            if (++(rl->empty_record_count) > MAX_EMPTY_RECORDS) {
  ------------------
  |  |  527|     12|#define MAX_EMPTY_RECORDS 32
  ------------------
  |  Branch (961:17): [True: 0, False: 12]
  ------------------
  962|      0|                RLAYERfatal(rl, SSL_AD_UNEXPECTED_MESSAGE,
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  963|      0|                    SSL_R_RECORD_TOO_SMALL);
  964|      0|                goto end;
  965|      0|            }
  966|    292|        } else {
  967|    292|            rl->empty_record_count = 0;
  968|    292|        }
  969|    304|    }
  970|       |
  971|    304|    if (rl->level == OSSL_RECORD_PROTECTION_LEVEL_EARLY) {
  ------------------
  |  | 2933|    304|#define OSSL_RECORD_PROTECTION_LEVEL_EARLY 1
  ------------------
  |  Branch (971:9): [True: 0, False: 304]
  ------------------
  972|      0|        thisrr = &rr[0];
  973|      0|        if (thisrr->type == SSL3_RT_APPLICATION_DATA
  ------------------
  |  |  222|      0|#define SSL3_RT_APPLICATION_DATA 23
  ------------------
  |  Branch (973:13): [True: 0, False: 0]
  ------------------
  974|      0|            && !rlayer_early_data_count_ok(rl, thisrr->length, 0, 0)) {
  ------------------
  |  Branch (974:16): [True: 0, False: 0]
  ------------------
  975|       |            /* RLAYERfatal already called */
  976|      0|            goto end;
  977|      0|        }
  978|      0|    }
  979|       |
  980|    304|    rl->num_recs = num_recs;
  981|    304|    rl->curr_rec = 0;
  982|    304|    rl->num_released = 0;
  983|    304|    ret = OSSL_RECORD_RETURN_SUCCESS;
  ------------------
  |  |   45|    304|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
  984|    304|end:
  985|    304|    if (macbufs != NULL) {
  ------------------
  |  Branch (985:9): [True: 0, False: 304]
  ------------------
  986|      0|        for (j = 0; j < num_recs; j++) {
  ------------------
  |  Branch (986:21): [True: 0, False: 0]
  ------------------
  987|      0|            if (macbufs[j].alloced)
  ------------------
  |  Branch (987:17): [True: 0, False: 0]
  ------------------
  988|      0|                OPENSSL_free(macbufs[j].mac);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  989|      0|        }
  990|      0|        OPENSSL_free(macbufs);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  991|      0|    }
  992|    304|    return ret;
  993|    304|}
tls_default_post_process_record:
 1069|    304|{
 1070|    304|    if (rl->compctx != NULL) {
  ------------------
  |  Branch (1070:9): [True: 0, False: 304]
  ------------------
 1071|      0|        if (rec->length > SSL3_RT_MAX_COMPRESSED_LENGTH) {
  ------------------
  |  |  203|      0|    (SSL3_RT_MAX_PLAIN_LENGTH + SSL3_RT_MAX_COMPRESSED_OVERHEAD)
  |  |  ------------------
  |  |  |  |  177|      0|#define SSL3_RT_MAX_PLAIN_LENGTH 16384
  |  |  ------------------
  |  |                   (SSL3_RT_MAX_PLAIN_LENGTH + SSL3_RT_MAX_COMPRESSED_OVERHEAD)
  |  |  ------------------
  |  |  |  |  179|      0|#define SSL3_RT_MAX_COMPRESSED_OVERHEAD 1024
  |  |  ------------------
  ------------------
  |  Branch (1071:13): [True: 0, False: 0]
  ------------------
 1072|      0|            RLAYERfatal(rl, SSL_AD_RECORD_OVERFLOW,
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1073|      0|                SSL_R_COMPRESSED_LENGTH_TOO_LONG);
 1074|      0|            return 0;
 1075|      0|        }
 1076|      0|        if (!tls_do_uncompress(rl, rec)) {
  ------------------
  |  Branch (1076:13): [True: 0, False: 0]
  ------------------
 1077|      0|            RLAYERfatal(rl, SSL_AD_DECOMPRESSION_FAILURE,
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1078|      0|                SSL_R_BAD_DECOMPRESSION);
 1079|      0|            return 0;
 1080|      0|        }
 1081|      0|    }
 1082|       |
 1083|    304|    if (rec->length > SSL3_RT_MAX_PLAIN_LENGTH) {
  ------------------
  |  |  177|    304|#define SSL3_RT_MAX_PLAIN_LENGTH 16384
  ------------------
  |  Branch (1083:9): [True: 0, False: 304]
  ------------------
 1084|      0|        RLAYERfatal(rl, SSL_AD_RECORD_OVERFLOW, SSL_R_DATA_LENGTH_TOO_LONG);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1085|      0|        return 0;
 1086|      0|    }
 1087|       |
 1088|    304|    return 1;
 1089|    304|}
tls_read_record:
 1124|  2.04k|{
 1125|  2.04k|    TLS_RL_RECORD *rec;
 1126|       |
 1127|       |    /*
 1128|       |     * tls_get_more_records() can return success without actually reading
 1129|       |     * anything useful (i.e. if empty records are read). We loop here until
 1130|       |     * we have something useful. tls_get_more_records() will eventually fail if
 1131|       |     * too many sequential empty records are read.
 1132|       |     */
 1133|  2.35k|    while (rl->curr_rec >= rl->num_recs) {
  ------------------
  |  Branch (1133:12): [True: 2.04k, False: 304]
  ------------------
 1134|  2.04k|        int ret;
 1135|       |
 1136|  2.04k|        if (rl->num_released != rl->num_recs) {
  ------------------
  |  Branch (1136:13): [True: 0, False: 2.04k]
  ------------------
 1137|      0|            RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, SSL_R_RECORDS_NOT_RELEASED);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1138|      0|            return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
 1139|      0|        }
 1140|       |
 1141|  2.04k|        ret = rl->funcs->get_more_records(rl);
 1142|       |
 1143|  2.04k|        if (ret != OSSL_RECORD_RETURN_SUCCESS)
  ------------------
  |  |   45|  2.04k|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
  |  Branch (1143:13): [True: 1.74k, False: 304]
  ------------------
 1144|  1.74k|            return ret;
 1145|  2.04k|    }
 1146|       |
 1147|       |    /*
 1148|       |     * We have now got rl->num_recs records buffered in rl->rrec. rl->curr_rec
 1149|       |     * points to the next one to read.
 1150|       |     */
 1151|    304|    rec = &rl->rrec[rl->curr_rec++];
 1152|       |
 1153|    304|    *rechandle = rec;
 1154|    304|    *rversion = rec->rec_version;
 1155|    304|    *type = rec->type;
 1156|    304|    *data = rec->data + rec->off;
 1157|    304|    *datalen = rec->length;
 1158|    304|    if (rl->isdtls) {
  ------------------
  |  Branch (1158:9): [True: 0, False: 304]
  ------------------
 1159|      0|        *epoch = rec->epoch;
 1160|      0|        memcpy(seq_num, rec->seq_num, sizeof(rec->seq_num));
 1161|      0|    }
 1162|       |
 1163|    304|    return OSSL_RECORD_RETURN_SUCCESS;
  ------------------
  |  |   45|    304|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
 1164|  2.04k|}
tls_release_record:
 1167|    725|{
 1168|    725|    TLS_RL_RECORD *rec = &rl->rrec[rl->num_released];
 1169|       |
 1170|    725|    if (!ossl_assert(rl->num_released < rl->curr_rec)
  ------------------
  |  |   52|  1.45k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  1.45k|    __FILE__, __LINE__)
  ------------------
  |  Branch (1170:9): [True: 0, False: 725]
  ------------------
 1171|    725|        || !ossl_assert(rechandle == rec)) {
  ------------------
  |  |   52|    725|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|    725|    __FILE__, __LINE__)
  ------------------
  |  Branch (1171:12): [True: 0, False: 725]
  ------------------
 1172|       |        /* Should not happen */
 1173|      0|        RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, SSL_R_INVALID_RECORD);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1174|      0|        return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
 1175|      0|    }
 1176|       |
 1177|    725|    if (rec->length < length) {
  ------------------
  |  Branch (1177:9): [True: 0, False: 725]
  ------------------
 1178|       |        /* Should not happen */
 1179|      0|        RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1180|      0|        return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
 1181|      0|    }
 1182|       |
 1183|    725|    if ((rl->options & SSL_OP_CLEANSE_PLAINTEXT) != 0)
  ------------------
  |  |  358|    725|#define SSL_OP_CLEANSE_PLAINTEXT SSL_OP_BIT(1)
  |  |  ------------------
  |  |  |  |  350|    725|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (1183:9): [True: 0, False: 725]
  ------------------
 1184|      0|        OPENSSL_cleanse(rec->data + rec->off, length);
 1185|       |
 1186|    725|    rec->off += length;
 1187|    725|    rec->length -= length;
 1188|       |
 1189|    725|    if (rec->length > 0)
  ------------------
  |  Branch (1189:9): [True: 421, False: 304]
  ------------------
 1190|    421|        return OSSL_RECORD_RETURN_SUCCESS;
  ------------------
  |  |   45|    421|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
 1191|       |
 1192|    304|    rl->num_released++;
 1193|       |
 1194|    304|    if (rl->curr_rec == rl->num_released
  ------------------
  |  Branch (1194:9): [True: 304, False: 0]
  ------------------
 1195|    304|        && (rl->mode & SSL_MODE_RELEASE_BUFFERS) != 0
  ------------------
  |  |  515|    304|#define SSL_MODE_RELEASE_BUFFERS 0x00000010U
  ------------------
  |  Branch (1195:12): [True: 0, False: 304]
  ------------------
 1196|      0|        && TLS_BUFFER_get_left(&rl->rbuf) == 0)
  ------------------
  |  |  528|      0|#define TLS_BUFFER_get_left(b) ((b)->left)
  ------------------
  |  Branch (1196:12): [True: 0, False: 0]
  ------------------
 1197|      0|        tls_release_read_buffer(rl);
 1198|       |
 1199|    304|    return OSSL_RECORD_RETURN_SUCCESS;
  ------------------
  |  |   45|    304|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
 1200|    725|}
tls_set_options:
 1203|  10.6k|{
 1204|  10.6k|    const OSSL_PARAM *p;
 1205|       |
 1206|  10.6k|    p = OSSL_PARAM_locate_const(options, OSSL_LIBSSL_RECORD_LAYER_PARAM_OPTIONS);
  ------------------
  |  |  332|  10.6k|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_OPTIONS "options"
  ------------------
 1207|  10.6k|    if (p != NULL && !OSSL_PARAM_get_uint64(p, &rl->options)) {
  ------------------
  |  Branch (1207:9): [True: 10.6k, False: 0]
  |  Branch (1207:22): [True: 0, False: 10.6k]
  ------------------
 1208|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1209|      0|        return 0;
 1210|      0|    }
 1211|       |
 1212|  10.6k|    p = OSSL_PARAM_locate_const(options, OSSL_LIBSSL_RECORD_LAYER_PARAM_MODE);
  ------------------
  |  |  331|  10.6k|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_MODE "mode"
  ------------------
 1213|  10.6k|    if (p != NULL && !OSSL_PARAM_get_uint32(p, &rl->mode)) {
  ------------------
  |  Branch (1213:9): [True: 10.6k, False: 0]
  |  Branch (1213:22): [True: 0, False: 10.6k]
  ------------------
 1214|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1215|      0|        return 0;
 1216|      0|    }
 1217|       |
 1218|  10.6k|    if (rl->direction == OSSL_RECORD_DIRECTION_READ) {
  ------------------
  |  |   42|  10.6k|#define OSSL_RECORD_DIRECTION_READ 0
  ------------------
  |  Branch (1218:9): [True: 5.31k, False: 5.31k]
  ------------------
 1219|  5.31k|        p = OSSL_PARAM_locate_const(options,
 1220|  5.31k|            OSSL_LIBSSL_RECORD_LAYER_READ_BUFFER_LEN);
  ------------------
  |  |  337|  5.31k|# define OSSL_LIBSSL_RECORD_LAYER_READ_BUFFER_LEN "read_buffer_len"
  ------------------
 1221|  5.31k|        if (p != NULL && !OSSL_PARAM_get_size_t(p, &rl->rbuf.default_len)) {
  ------------------
  |  Branch (1221:13): [True: 5.31k, False: 0]
  |  Branch (1221:26): [True: 0, False: 5.31k]
  ------------------
 1222|      0|            ERR_raise(ERR_LIB_SSL, SSL_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1223|      0|            return 0;
 1224|      0|        }
 1225|  5.31k|    } else {
 1226|  5.31k|        p = OSSL_PARAM_locate_const(options,
 1227|  5.31k|            OSSL_LIBSSL_RECORD_LAYER_PARAM_BLOCK_PADDING);
  ------------------
  |  |  327|  5.31k|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_BLOCK_PADDING "block_padding"
  ------------------
 1228|  5.31k|        if (p != NULL && !OSSL_PARAM_get_size_t(p, &rl->block_padding)) {
  ------------------
  |  Branch (1228:13): [True: 5.31k, False: 0]
  |  Branch (1228:26): [True: 0, False: 5.31k]
  ------------------
 1229|      0|            ERR_raise(ERR_LIB_SSL, SSL_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1230|      0|            return 0;
 1231|      0|        }
 1232|  5.31k|        p = OSSL_PARAM_locate_const(options,
 1233|  5.31k|            OSSL_LIBSSL_RECORD_LAYER_PARAM_HS_PADDING);
  ------------------
  |  |  328|  5.31k|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_HS_PADDING "hs_padding"
  ------------------
 1234|  5.31k|        if (p != NULL && !OSSL_PARAM_get_size_t(p, &rl->hs_padding)) {
  ------------------
  |  Branch (1234:13): [True: 5.31k, False: 0]
  |  Branch (1234:26): [True: 0, False: 5.31k]
  ------------------
 1235|      0|            ERR_raise(ERR_LIB_SSL, SSL_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1236|      0|            return 0;
 1237|      0|        }
 1238|  5.31k|    }
 1239|       |
 1240|  10.6k|    if (rl->level == OSSL_RECORD_PROTECTION_LEVEL_APPLICATION) {
  ------------------
  |  | 2935|  10.6k|#define OSSL_RECORD_PROTECTION_LEVEL_APPLICATION 3
  ------------------
  |  Branch (1240:9): [True: 0, False: 10.6k]
  ------------------
 1241|       |        /*
 1242|       |         * We ignore any read_ahead setting prior to the application protection
 1243|       |         * level. Otherwise we may read ahead data in a lower protection level
 1244|       |         * that is destined for a higher protection level. To simplify the logic
 1245|       |         * we don't support that at this stage.
 1246|       |         */
 1247|      0|        p = OSSL_PARAM_locate_const(options,
 1248|      0|            OSSL_LIBSSL_RECORD_LAYER_PARAM_READ_AHEAD);
  ------------------
  |  |  333|      0|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_READ_AHEAD "read_ahead"
  ------------------
 1249|      0|        if (p != NULL && !OSSL_PARAM_get_int(p, &rl->read_ahead)) {
  ------------------
  |  Branch (1249:13): [True: 0, False: 0]
  |  Branch (1249:26): [True: 0, False: 0]
  ------------------
 1250|      0|            ERR_raise(ERR_LIB_SSL, SSL_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1251|      0|            return 0;
 1252|      0|        }
 1253|      0|    }
 1254|       |
 1255|  10.6k|    return 1;
 1256|  10.6k|}
tls_int_new_record_layer:
 1266|  10.6k|{
 1267|  10.6k|    OSSL_RECORD_LAYER *rl = OPENSSL_zalloc(sizeof(*rl));
  ------------------
  |  |  108|  10.6k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1268|  10.6k|    const OSSL_PARAM *p;
 1269|       |
 1270|  10.6k|    *retrl = NULL;
 1271|       |
 1272|  10.6k|    if (rl == NULL)
  ------------------
  |  Branch (1272:9): [True: 0, False: 10.6k]
  ------------------
 1273|      0|        return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
 1274|       |
 1275|       |    /*
 1276|       |     * Default the value for max_frag_len. This may be overridden by the
 1277|       |     * settings
 1278|       |     */
 1279|  10.6k|    rl->max_frag_len = SSL3_RT_MAX_PLAIN_LENGTH;
  ------------------
  |  |  177|  10.6k|#define SSL3_RT_MAX_PLAIN_LENGTH 16384
  ------------------
 1280|       |
 1281|       |    /* Loop through all the settings since they must all be understood */
 1282|  10.6k|    if (settings != NULL) {
  ------------------
  |  Branch (1282:9): [True: 10.6k, False: 0]
  ------------------
 1283|  10.6k|        for (p = settings; p->key != NULL; p++) {
  ------------------
  |  Branch (1283:28): [True: 0, False: 10.6k]
  ------------------
 1284|      0|            if (strcmp(p->key, OSSL_LIBSSL_RECORD_LAYER_PARAM_USE_ETM) == 0) {
  ------------------
  |  |  336|      0|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_USE_ETM "use_etm"
  ------------------
  |  Branch (1284:17): [True: 0, False: 0]
  ------------------
 1285|      0|                if (!OSSL_PARAM_get_int(p, &rl->use_etm)) {
  ------------------
  |  Branch (1285:21): [True: 0, False: 0]
  ------------------
 1286|      0|                    ERR_raise(ERR_LIB_SSL, SSL_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1287|      0|                    goto err;
 1288|      0|                }
 1289|      0|            } else if (strcmp(p->key,
  ------------------
  |  Branch (1289:24): [True: 0, False: 0]
  ------------------
 1290|      0|                           OSSL_LIBSSL_RECORD_LAYER_PARAM_MAX_FRAG_LEN)
  ------------------
  |  |  330|      0|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_MAX_FRAG_LEN "max_frag_len"
  ------------------
 1291|      0|                == 0) {
 1292|      0|                if (!OSSL_PARAM_get_uint(p, &rl->max_frag_len)) {
  ------------------
  |  Branch (1292:21): [True: 0, False: 0]
  ------------------
 1293|      0|                    ERR_raise(ERR_LIB_SSL, SSL_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1294|      0|                    goto err;
 1295|      0|                }
 1296|      0|            } else if (strcmp(p->key,
  ------------------
  |  Branch (1296:24): [True: 0, False: 0]
  ------------------
 1297|      0|                           OSSL_LIBSSL_RECORD_LAYER_PARAM_MAX_EARLY_DATA)
  ------------------
  |  |  329|      0|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_MAX_EARLY_DATA "max_early_data"
  ------------------
 1298|      0|                == 0) {
 1299|      0|                if (!OSSL_PARAM_get_uint32(p, &rl->max_early_data)) {
  ------------------
  |  Branch (1299:21): [True: 0, False: 0]
  ------------------
 1300|      0|                    ERR_raise(ERR_LIB_SSL, SSL_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1301|      0|                    goto err;
 1302|      0|                }
 1303|      0|            } else if (strcmp(p->key,
  ------------------
  |  Branch (1303:24): [True: 0, False: 0]
  ------------------
 1304|      0|                           OSSL_LIBSSL_RECORD_LAYER_PARAM_STREAM_MAC)
  ------------------
  |  |  334|      0|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_STREAM_MAC "stream_mac"
  ------------------
 1305|      0|                == 0) {
 1306|      0|                if (!OSSL_PARAM_get_int(p, &rl->stream_mac)) {
  ------------------
  |  Branch (1306:21): [True: 0, False: 0]
  ------------------
 1307|      0|                    ERR_raise(ERR_LIB_SSL, SSL_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1308|      0|                    goto err;
 1309|      0|                }
 1310|      0|            } else if (strcmp(p->key,
  ------------------
  |  Branch (1310:24): [True: 0, False: 0]
  ------------------
 1311|      0|                           OSSL_LIBSSL_RECORD_LAYER_PARAM_TLSTREE)
  ------------------
  |  |  335|      0|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_TLSTREE "tlstree"
  ------------------
 1312|      0|                == 0) {
 1313|      0|                if (!OSSL_PARAM_get_int(p, &rl->tlstree)) {
  ------------------
  |  Branch (1313:21): [True: 0, False: 0]
  ------------------
 1314|      0|                    ERR_raise(ERR_LIB_SSL, SSL_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1315|      0|                    goto err;
 1316|      0|                }
 1317|      0|            } else {
 1318|      0|                ERR_raise(ERR_LIB_SSL, SSL_R_UNKNOWN_MANDATORY_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1319|      0|                goto err;
 1320|      0|            }
 1321|      0|        }
 1322|  10.6k|    }
 1323|       |
 1324|  10.6k|    rl->libctx = libctx;
 1325|  10.6k|    rl->propq = propq;
 1326|       |
 1327|  10.6k|    rl->version = vers;
 1328|  10.6k|    rl->role = role;
 1329|  10.6k|    rl->direction = direction;
 1330|  10.6k|    rl->level = level;
 1331|  10.6k|    rl->taglen = taglen;
 1332|  10.6k|    rl->md = md;
 1333|       |
 1334|  10.6k|    rl->alert = SSL_AD_NO_ALERT;
  ------------------
  |  |   63|  10.6k|#define SSL_AD_NO_ALERT -1
  ------------------
 1335|  10.6k|    rl->rstate = SSL_ST_READ_HEADER;
  ------------------
  |  | 1160|  10.6k|#define SSL_ST_READ_HEADER 0xF0
  ------------------
 1336|       |
 1337|  10.6k|    if (level == OSSL_RECORD_PROTECTION_LEVEL_NONE)
  ------------------
  |  | 2932|  10.6k|#define OSSL_RECORD_PROTECTION_LEVEL_NONE 0
  ------------------
  |  Branch (1337:9): [True: 10.6k, False: 0]
  ------------------
 1338|  10.6k|        rl->is_first_record = 1;
 1339|       |
 1340|  10.6k|    if (!tls_set1_bio(rl, transport))
  ------------------
  |  Branch (1340:9): [True: 0, False: 10.6k]
  ------------------
 1341|      0|        goto err;
 1342|       |
 1343|  10.6k|    if (prev != NULL && !BIO_up_ref(prev))
  ------------------
  |  Branch (1343:9): [True: 0, False: 10.6k]
  |  Branch (1343:25): [True: 0, False: 0]
  ------------------
 1344|      0|        goto err;
 1345|  10.6k|    rl->prev = prev;
 1346|       |
 1347|  10.6k|    if (next != NULL && !BIO_up_ref(next))
  ------------------
  |  Branch (1347:9): [True: 5.31k, False: 5.31k]
  |  Branch (1347:25): [True: 0, False: 5.31k]
  ------------------
 1348|      0|        goto err;
 1349|  10.6k|    rl->next = next;
 1350|       |
 1351|  10.6k|    rl->cbarg = cbarg;
 1352|  10.6k|    if (fns != NULL) {
  ------------------
  |  Branch (1352:9): [True: 10.6k, False: 0]
  ------------------
 1353|  31.8k|        for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (1353:16): [True: 21.2k, False: 10.6k]
  ------------------
 1354|  21.2k|            switch (fns->function_id) {
 1355|  10.6k|            case OSSL_FUNC_RLAYER_SKIP_EARLY_DATA:
  ------------------
  |  |  185|  10.6k|#define OSSL_FUNC_RLAYER_SKIP_EARLY_DATA 1
  ------------------
  |  Branch (1355:13): [True: 10.6k, False: 10.6k]
  ------------------
 1356|  10.6k|                rl->skip_early_data = OSSL_FUNC_rlayer_skip_early_data(fns);
 1357|  10.6k|                break;
 1358|      0|            case OSSL_FUNC_RLAYER_MSG_CALLBACK:
  ------------------
  |  |  187|      0|#define OSSL_FUNC_RLAYER_MSG_CALLBACK 2
  ------------------
  |  Branch (1358:13): [True: 0, False: 21.2k]
  ------------------
 1359|      0|                rl->msg_callback = OSSL_FUNC_rlayer_msg_callback(fns);
 1360|      0|                break;
 1361|  10.6k|            case OSSL_FUNC_RLAYER_SECURITY:
  ------------------
  |  |  189|  10.6k|#define OSSL_FUNC_RLAYER_SECURITY 3
  ------------------
  |  Branch (1361:13): [True: 10.6k, False: 10.6k]
  ------------------
 1362|  10.6k|                rl->security = OSSL_FUNC_rlayer_security(fns);
 1363|  10.6k|                break;
 1364|      0|            case OSSL_FUNC_RLAYER_PADDING:
  ------------------
  |  |  191|      0|#define OSSL_FUNC_RLAYER_PADDING 4
  ------------------
  |  Branch (1364:13): [True: 0, False: 21.2k]
  ------------------
 1365|      0|                rl->padding = OSSL_FUNC_rlayer_padding(fns);
 1366|      0|            default:
  ------------------
  |  Branch (1366:13): [True: 0, False: 21.2k]
  ------------------
 1367|       |                /* Just ignore anything we don't understand */
 1368|      0|                break;
 1369|  21.2k|            }
 1370|  21.2k|        }
 1371|  10.6k|    }
 1372|       |
 1373|  10.6k|    if (!tls_set_options(rl, options)) {
  ------------------
  |  Branch (1373:9): [True: 0, False: 10.6k]
  ------------------
 1374|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_FAILED_TO_GET_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1375|      0|        goto err;
 1376|      0|    }
 1377|       |
 1378|  10.6k|    if ((rl->options & SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS) == 0
  ------------------
  |  |  377|  10.6k|#define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS SSL_OP_BIT(11)
  |  |  ------------------
  |  |  |  |  350|  10.6k|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (1378:9): [True: 10.6k, False: 18]
  ------------------
 1379|  10.6k|        && rl->version <= TLS1_VERSION
  ------------------
  |  |   24|  21.2k|#define TLS1_VERSION 0x0301
  ------------------
  |  Branch (1379:12): [True: 0, False: 10.6k]
  ------------------
 1380|      0|        && !EVP_CIPHER_is_a(ciph, "NULL")
  ------------------
  |  Branch (1380:12): [True: 0, False: 0]
  ------------------
 1381|      0|        && !EVP_CIPHER_is_a(ciph, "RC4")) {
  ------------------
  |  Branch (1381:12): [True: 0, False: 0]
  ------------------
 1382|       |        /*
 1383|       |         * Enable vulnerability countermeasure for CBC ciphers with known-IV
 1384|       |         * problem (http://www.openssl.org/~bodo/tls-cbc.txt)
 1385|       |         */
 1386|      0|        rl->need_empty_fragments = 1;
 1387|      0|    }
 1388|       |
 1389|  10.6k|    *retrl = rl;
 1390|  10.6k|    return OSSL_RECORD_RETURN_SUCCESS;
  ------------------
  |  |   45|  10.6k|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
 1391|      0|err:
 1392|      0|    tls_int_free(rl);
 1393|      0|    return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
 1394|  10.6k|}
tls_free:
 1481|  10.6k|{
 1482|  10.6k|    TLS_BUFFER *rbuf;
 1483|  10.6k|    size_t left, written;
 1484|  10.6k|    int ret = 1;
 1485|       |
 1486|  10.6k|    if (rl == NULL)
  ------------------
  |  Branch (1486:9): [True: 0, False: 10.6k]
  ------------------
 1487|      0|        return 1;
 1488|       |
 1489|  10.6k|    rbuf = &rl->rbuf;
 1490|       |
 1491|  10.6k|    left = TLS_BUFFER_get_left(rbuf);
  ------------------
  |  |  528|  10.6k|#define TLS_BUFFER_get_left(b) ((b)->left)
  ------------------
 1492|  10.6k|    if (left > 0) {
  ------------------
  |  Branch (1492:9): [True: 25, False: 10.5k]
  ------------------
 1493|       |        /*
 1494|       |         * This record layer is closing but we still have data left in our
 1495|       |         * buffer. It must be destined for the next epoch - so push it there.
 1496|       |         */
 1497|     25|        ret = BIO_write_ex(rl->next, rbuf->buf + rbuf->offset, left, &written);
 1498|     25|    }
 1499|  10.6k|    tls_int_free(rl);
 1500|       |
 1501|  10.6k|    return ret;
 1502|  10.6k|}
tls_processed_read_pending:
 1510|    304|{
 1511|    304|    return rl->curr_rec < rl->num_recs;
 1512|    304|}
tls_get_max_records_default:
 1530|  1.64k|{
 1531|       |    /*
 1532|       |     * If we have a pipeline capable cipher, and we have been configured to use
 1533|       |     * it, then return the preferred number of pipelines.
 1534|       |     */
 1535|  1.64k|    if (rl->max_pipelines > 0
  ------------------
  |  Branch (1535:9): [True: 0, False: 1.64k]
  ------------------
 1536|      0|        && rl->enc_ctx != NULL
  ------------------
  |  Branch (1536:12): [True: 0, False: 0]
  ------------------
 1537|      0|        && (EVP_CIPHER_get_flags(EVP_CIPHER_CTX_get0_cipher(rl->enc_ctx))
  ------------------
  |  Branch (1537:12): [True: 0, False: 0]
  ------------------
 1538|      0|               & EVP_CIPH_FLAG_PIPELINE)
  ------------------
  |  |  360|      0|#define EVP_CIPH_FLAG_PIPELINE 0X800000
  ------------------
 1539|      0|            != 0
 1540|      0|        && RLAYER_USE_EXPLICIT_IV(rl)) {
  ------------------
  |  |  397|      0|#define RLAYER_USE_EXPLICIT_IV(rl) ((rl)->version == TLS1_1_VERSION \
  |  |  ------------------
  |  |  |  |   25|      0|#define TLS1_1_VERSION 0x0302
  |  |  ------------------
  |  |  |  Branch (397:37): [True: 0, False: 0]
  |  |  ------------------
  |  |  398|      0|    || (rl)->version == TLS1_2_VERSION                              \
  |  |  ------------------
  |  |  |  |   26|      0|#define TLS1_2_VERSION 0x0303
  |  |  ------------------
  |  |  |  Branch (398:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  399|      0|    || (rl)->version == DTLS1_BAD_VER                               \
  |  |  ------------------
  |  |  |  |   30|      0|#define DTLS1_BAD_VER 0x0100
  |  |  ------------------
  |  |  |  Branch (399:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  400|      0|    || (rl)->version == DTLS1_VERSION                               \
  |  |  ------------------
  |  |  |  |   28|      0|#define DTLS1_VERSION 0xFEFF
  |  |  ------------------
  |  |  |  Branch (400:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  401|      0|    || (rl)->version == DTLS1_2_VERSION)
  |  |  ------------------
  |  |  |  |   29|      0|#define DTLS1_2_VERSION 0xFEFD
  |  |  ------------------
  |  |  |  Branch (401:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1541|      0|        size_t pipes;
 1542|       |
 1543|      0|        if (len == 0)
  ------------------
  |  Branch (1543:13): [True: 0, False: 0]
  ------------------
 1544|      0|            return 1;
 1545|      0|        pipes = ((len - 1) / *preffrag) + 1;
 1546|       |
 1547|      0|        return (pipes < rl->max_pipelines) ? pipes : rl->max_pipelines;
  ------------------
  |  Branch (1547:16): [True: 0, False: 0]
  ------------------
 1548|      0|    }
 1549|       |
 1550|  1.64k|    return 1;
 1551|  1.64k|}
tls_get_max_records:
 1555|  1.64k|{
 1556|  1.64k|    return rl->funcs->get_max_records(rl, type, len, maxfrag, preffrag);
 1557|  1.64k|}
tls_allocate_write_buffers_default:
 1563|  3.25k|{
 1564|  3.25k|    if (!tls_setup_write_buffer(rl, numtempl, 0, 0)) {
  ------------------
  |  Branch (1564:9): [True: 0, False: 3.25k]
  ------------------
 1565|       |        /* RLAYERfatal() already called */
 1566|      0|        return 0;
 1567|      0|    }
 1568|       |
 1569|  3.25k|    return 1;
 1570|  3.25k|}
tls_initialise_write_packets_default:
 1579|  3.25k|{
 1580|  3.25k|    WPACKET *thispkt;
 1581|  3.25k|    size_t j, align;
 1582|  3.25k|    TLS_BUFFER *wb;
 1583|       |
 1584|  6.51k|    for (j = 0; j < numtempl; j++) {
  ------------------
  |  Branch (1584:17): [True: 3.25k, False: 3.25k]
  ------------------
 1585|  3.25k|        thispkt = &pkt[j];
 1586|  3.25k|        wb = &bufs[j];
 1587|       |
 1588|  3.25k|        wb->type = templates[j].type;
 1589|       |
 1590|  3.25k|#if defined(SSL3_ALIGN_PAYLOAD) && SSL3_ALIGN_PAYLOAD != 0
 1591|  3.25k|        align = (size_t)TLS_BUFFER_get_buf(wb);
  ------------------
  |  |  525|  3.25k|#define TLS_BUFFER_get_buf(b) ((b)->buf)
  ------------------
 1592|  3.25k|        align += rl->isdtls ? DTLS1_RT_HEADER_LENGTH : SSL3_RT_HEADER_LENGTH;
  ------------------
  |  |   41|      0|#define DTLS1_RT_HEADER_LENGTH 13
  ------------------
                      align += rl->isdtls ? DTLS1_RT_HEADER_LENGTH : SSL3_RT_HEADER_LENGTH;
  ------------------
  |  |  139|  6.51k|#define SSL3_RT_HEADER_LENGTH 5
  ------------------
  |  Branch (1592:18): [True: 0, False: 3.25k]
  ------------------
 1593|  3.25k|        align = SSL3_ALIGN_PAYLOAD - 1
  ------------------
  |  |  152|  3.25k|#define SSL3_ALIGN_PAYLOAD 8
  ------------------
 1594|  3.25k|            - ((align - 1) % SSL3_ALIGN_PAYLOAD);
  ------------------
  |  |  152|  3.25k|#define SSL3_ALIGN_PAYLOAD 8
  ------------------
 1595|  3.25k|#endif
 1596|  3.25k|        TLS_BUFFER_set_offset(wb, align);
  ------------------
  |  |  532|  3.25k|#define TLS_BUFFER_set_offset(b, o) ((b)->offset = (o))
  ------------------
 1597|       |
 1598|  3.25k|        if (!WPACKET_init_static_len(thispkt, TLS_BUFFER_get_buf(wb),
  ------------------
  |  |  525|  3.25k|#define TLS_BUFFER_get_buf(b) ((b)->buf)
  ------------------
  |  Branch (1598:13): [True: 0, False: 3.25k]
  ------------------
 1599|  3.25k|                TLS_BUFFER_get_len(wb), 0)) {
  ------------------
  |  |  527|  3.25k|#define TLS_BUFFER_get_len(b) ((b)->len)
  ------------------
 1600|      0|            RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1601|      0|            return 0;
 1602|      0|        }
 1603|  3.25k|        (*wpinited)++;
 1604|  3.25k|        if (!WPACKET_allocate_bytes(thispkt, align, NULL)) {
  ------------------
  |  Branch (1604:13): [True: 0, False: 3.25k]
  ------------------
 1605|      0|            RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1606|      0|            return 0;
 1607|      0|        }
 1608|  3.25k|    }
 1609|       |
 1610|  3.25k|    return 1;
 1611|  3.25k|}
tls_prepare_record_header_default:
 1618|  3.25k|{
 1619|  3.25k|    size_t maxcomplen;
 1620|       |
 1621|  3.25k|    *recdata = NULL;
 1622|       |
 1623|  3.25k|    maxcomplen = templ->buflen;
 1624|  3.25k|    if (rl->compctx != NULL)
  ------------------
  |  Branch (1624:9): [True: 0, False: 3.25k]
  ------------------
 1625|      0|        maxcomplen += SSL3_RT_MAX_COMPRESSED_OVERHEAD;
  ------------------
  |  |  179|      0|#define SSL3_RT_MAX_COMPRESSED_OVERHEAD 1024
  ------------------
 1626|       |
 1627|  3.25k|    if (!WPACKET_put_bytes_u8(thispkt, rectype)
  ------------------
  |  |  889|  6.51k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (1627:9): [True: 0, False: 3.25k]
  ------------------
 1628|  3.25k|        || !WPACKET_put_bytes_u16(thispkt, templ->version)
  ------------------
  |  |  891|  6.51k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (1628:12): [True: 0, False: 3.25k]
  ------------------
 1629|  3.25k|        || !WPACKET_start_sub_packet_u16(thispkt)
  ------------------
  |  |  792|  6.51k|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (1629:12): [True: 0, False: 3.25k]
  ------------------
 1630|  3.25k|        || (rl->eivlen > 0
  ------------------
  |  Branch (1630:13): [True: 0, False: 3.25k]
  ------------------
 1631|      0|            && !WPACKET_allocate_bytes(thispkt, rl->eivlen, NULL))
  ------------------
  |  Branch (1631:16): [True: 0, False: 0]
  ------------------
 1632|  3.25k|        || (maxcomplen > 0
  ------------------
  |  Branch (1632:13): [True: 3.25k, False: 0]
  ------------------
 1633|  3.25k|            && !WPACKET_reserve_bytes(thispkt, maxcomplen,
  ------------------
  |  Branch (1633:16): [True: 0, False: 3.25k]
  ------------------
 1634|  3.25k|                recdata))) {
 1635|      0|        RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1636|      0|        return 0;
 1637|      0|    }
 1638|       |
 1639|  3.25k|    return 1;
 1640|  3.25k|}
tls_post_encryption_processing_default:
 1696|  3.25k|{
 1697|  3.25k|    size_t origlen, len;
 1698|  3.25k|    size_t headerlen = rl->isdtls ? DTLS1_RT_HEADER_LENGTH
  ------------------
  |  |   41|      0|#define DTLS1_RT_HEADER_LENGTH 13
  ------------------
  |  Branch (1698:24): [True: 0, False: 3.25k]
  ------------------
 1699|  3.25k|                                  : SSL3_RT_HEADER_LENGTH;
  ------------------
  |  |  139|  6.51k|#define SSL3_RT_HEADER_LENGTH 5
  ------------------
 1700|       |
 1701|       |    /* Allocate bytes for the encryption overhead */
 1702|  3.25k|    if (!WPACKET_get_length(thispkt, &origlen)
  ------------------
  |  Branch (1702:9): [True: 0, False: 3.25k]
  ------------------
 1703|       |        /* Check we allowed enough room for the encryption growth */
 1704|  3.25k|        || !ossl_assert(origlen + SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD
  ------------------
  |  |   52|  6.51k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  6.51k|    __FILE__, __LINE__)
  ------------------
  |  Branch (1704:12): [True: 0, False: 3.25k]
  ------------------
 1705|  3.25k|                - mac_size
 1706|  3.25k|            >= thiswr->length)
 1707|       |        /* Encryption should never shrink the data! */
 1708|  3.25k|        || origlen > thiswr->length
  ------------------
  |  Branch (1708:12): [True: 0, False: 3.25k]
  ------------------
 1709|  3.25k|        || (thiswr->length > origlen
  ------------------
  |  Branch (1709:13): [True: 0, False: 3.25k]
  ------------------
 1710|      0|            && !WPACKET_allocate_bytes(thispkt,
  ------------------
  |  Branch (1710:16): [True: 0, False: 0]
  ------------------
 1711|      0|                thiswr->length - origlen,
 1712|      0|                NULL))) {
 1713|      0|        RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1714|      0|        return 0;
 1715|      0|    }
 1716|  3.25k|    if (rl->use_etm && mac_size != 0) {
  ------------------
  |  Branch (1716:9): [True: 0, False: 3.25k]
  |  Branch (1716:24): [True: 0, False: 0]
  ------------------
 1717|      0|        unsigned char *mac;
 1718|       |
 1719|      0|        if (!WPACKET_allocate_bytes(thispkt, mac_size, &mac)
  ------------------
  |  Branch (1719:13): [True: 0, False: 0]
  ------------------
 1720|      0|            || !rl->funcs->mac(rl, thiswr, mac, 1)) {
  ------------------
  |  Branch (1720:16): [True: 0, False: 0]
  ------------------
 1721|      0|            RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1722|      0|            return 0;
 1723|      0|        }
 1724|       |
 1725|      0|        TLS_RL_RECORD_add_length(thiswr, mac_size);
  ------------------
  |  |   87|      0|#define TLS_RL_RECORD_add_length(r, l) ((r)->length += (l))
  ------------------
 1726|      0|    }
 1727|       |
 1728|  3.25k|    if (!WPACKET_get_length(thispkt, &len)
  ------------------
  |  Branch (1728:9): [True: 0, False: 3.25k]
  ------------------
 1729|  3.25k|        || !WPACKET_close(thispkt)) {
  ------------------
  |  Branch (1729:12): [True: 0, False: 3.25k]
  ------------------
 1730|      0|        RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1731|      0|        return 0;
 1732|      0|    }
 1733|       |
 1734|  3.25k|    if (rl->msg_callback != NULL) {
  ------------------
  |  Branch (1734:9): [True: 0, False: 3.25k]
  ------------------
 1735|      0|        unsigned char *recordstart;
 1736|       |
 1737|      0|        recordstart = WPACKET_get_curr(thispkt) - len - headerlen;
 1738|      0|        rl->msg_callback(1, thiswr->rec_version, SSL3_RT_HEADER, recordstart,
  ------------------
  |  |  239|      0|#define SSL3_RT_HEADER 0x100
  ------------------
 1739|      0|            headerlen, rl->cbarg);
 1740|       |
 1741|      0|        if (rl->version == TLS1_3_VERSION && rl->enc_ctx != NULL) {
  ------------------
  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (1741:13): [True: 0, False: 0]
  |  Branch (1741:46): [True: 0, False: 0]
  ------------------
 1742|      0|            unsigned char ctype = thistempl->type;
 1743|       |
 1744|      0|            rl->msg_callback(1, thiswr->rec_version, SSL3_RT_INNER_CONTENT_TYPE,
  ------------------
  |  |  240|      0|#define SSL3_RT_INNER_CONTENT_TYPE 0x101
  ------------------
 1745|      0|                &ctype, 1, rl->cbarg);
 1746|      0|        }
 1747|      0|    }
 1748|       |
 1749|  3.25k|    if (!WPACKET_finish(thispkt)) {
  ------------------
  |  Branch (1749:9): [True: 0, False: 3.25k]
  ------------------
 1750|      0|        RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1751|      0|        return 0;
 1752|      0|    }
 1753|       |
 1754|  3.25k|    TLS_RL_RECORD_add_length(thiswr, headerlen);
  ------------------
  |  |   87|  3.25k|#define TLS_RL_RECORD_add_length(r, l) ((r)->length += (l))
  ------------------
 1755|       |
 1756|  3.25k|    return 1;
 1757|  3.25k|}
tls_write_records_default:
 1762|  3.25k|{
 1763|  3.25k|    WPACKET pkt[SSL_MAX_PIPELINES + 1];
 1764|  3.25k|    TLS_RL_RECORD wr[SSL_MAX_PIPELINES + 1];
 1765|  3.25k|    WPACKET *thispkt;
 1766|  3.25k|    TLS_RL_RECORD *thiswr;
 1767|  3.25k|    int mac_size = 0, ret = 0;
 1768|  3.25k|    size_t wpinited = 0;
 1769|  3.25k|    size_t j, prefix = 0;
 1770|  3.25k|    OSSL_RECORD_TEMPLATE prefixtempl;
 1771|  3.25k|    OSSL_RECORD_TEMPLATE *thistempl;
 1772|       |
 1773|  3.25k|    if (rl->md_ctx != NULL && EVP_MD_CTX_get0_md(rl->md_ctx) != NULL) {
  ------------------
  |  Branch (1773:9): [True: 0, False: 3.25k]
  |  Branch (1773:31): [True: 0, False: 0]
  ------------------
 1774|      0|        mac_size = EVP_MD_CTX_get_size(rl->md_ctx);
  ------------------
  |  |  589|      0|#define EVP_MD_CTX_get_size(e) EVP_MD_CTX_get_size_ex(e)
  ------------------
 1775|      0|        if (mac_size < 0) {
  ------------------
  |  Branch (1775:13): [True: 0, False: 0]
  ------------------
 1776|      0|            RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1777|      0|            goto err;
 1778|      0|        }
 1779|      0|    }
 1780|       |
 1781|  3.25k|    if (!rl->funcs->allocate_write_buffers(rl, templates, numtempl, &prefix)) {
  ------------------
  |  Branch (1781:9): [True: 0, False: 3.25k]
  ------------------
 1782|       |        /* RLAYERfatal() already called */
 1783|      0|        goto err;
 1784|      0|    }
 1785|       |
 1786|  3.25k|    if (!rl->funcs->initialise_write_packets(rl, templates, numtempl,
  ------------------
  |  Branch (1786:9): [True: 0, False: 3.25k]
  ------------------
 1787|  3.25k|            &prefixtempl, pkt, rl->wbuf,
 1788|  3.25k|            &wpinited)) {
 1789|       |        /* RLAYERfatal() already called */
 1790|      0|        goto err;
 1791|      0|    }
 1792|       |
 1793|       |    /* Clear our TLS_RL_RECORD structures */
 1794|  3.25k|    memset(wr, 0, sizeof(wr));
 1795|  6.51k|    for (j = 0; j < numtempl + prefix; j++) {
  ------------------
  |  Branch (1795:17): [True: 3.25k, False: 3.25k]
  ------------------
 1796|  3.25k|        unsigned char *compressdata = NULL;
 1797|  3.25k|        uint8_t rectype;
 1798|       |
 1799|  3.25k|        thispkt = &pkt[j];
 1800|  3.25k|        thiswr = &wr[j];
 1801|  3.25k|        thistempl = (j < prefix) ? &prefixtempl : &templates[j - prefix];
  ------------------
  |  Branch (1801:21): [True: 0, False: 3.25k]
  ------------------
 1802|       |
 1803|       |        /*
 1804|       |         * Default to the record type as specified in the template unless the
 1805|       |         * protocol implementation says differently.
 1806|       |         */
 1807|  3.25k|        if (rl->funcs->get_record_type != NULL)
  ------------------
  |  Branch (1807:13): [True: 0, False: 3.25k]
  ------------------
 1808|      0|            rectype = rl->funcs->get_record_type(rl, thistempl);
 1809|  3.25k|        else
 1810|  3.25k|            rectype = thistempl->type;
 1811|       |
 1812|  3.25k|        TLS_RL_RECORD_set_type(thiswr, rectype);
  ------------------
  |  |   83|  3.25k|#define TLS_RL_RECORD_set_type(r, t) ((r)->type = (t))
  ------------------
 1813|  3.25k|        TLS_RL_RECORD_set_rec_version(thiswr, thistempl->version);
  ------------------
  |  |   84|  3.25k|#define TLS_RL_RECORD_set_rec_version(r, v) ((r)->rec_version = (v))
  ------------------
 1814|       |
 1815|  3.25k|        if (!rl->funcs->prepare_record_header(rl, thispkt, thistempl, rectype,
  ------------------
  |  Branch (1815:13): [True: 0, False: 3.25k]
  ------------------
 1816|  3.25k|                &compressdata)) {
 1817|       |            /* RLAYERfatal() already called */
 1818|      0|            goto err;
 1819|      0|        }
 1820|       |
 1821|       |        /* lets setup the record stuff. */
 1822|  3.25k|        TLS_RL_RECORD_set_data(thiswr, compressdata);
  ------------------
  |  |   88|  3.25k|#define TLS_RL_RECORD_set_data(r, d) ((r)->data = (d))
  ------------------
 1823|  3.25k|        TLS_RL_RECORD_set_length(thiswr, thistempl->buflen);
  ------------------
  |  |   86|  3.25k|#define TLS_RL_RECORD_set_length(r, l) ((r)->length = (l))
  ------------------
 1824|       |
 1825|  3.25k|        TLS_RL_RECORD_set_input(thiswr, (unsigned char *)thistempl->buf);
  ------------------
  |  |   89|  3.25k|#define TLS_RL_RECORD_set_input(r, i) ((r)->input = (i))
  ------------------
 1826|       |
 1827|       |        /*
 1828|       |         * we now 'read' from thiswr->input, thiswr->length bytes into
 1829|       |         * thiswr->data
 1830|       |         */
 1831|       |
 1832|       |        /* first we compress */
 1833|  3.25k|        if (rl->compctx != NULL) {
  ------------------
  |  Branch (1833:13): [True: 0, False: 3.25k]
  ------------------
 1834|      0|            if (!tls_do_compress(rl, thiswr)
  ------------------
  |  Branch (1834:17): [True: 0, False: 0]
  ------------------
 1835|      0|                || !WPACKET_allocate_bytes(thispkt, thiswr->length, NULL)) {
  ------------------
  |  Branch (1835:20): [True: 0, False: 0]
  ------------------
 1836|      0|                RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, SSL_R_COMPRESSION_FAILURE);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1837|      0|                goto err;
 1838|      0|            }
 1839|  3.25k|        } else if (compressdata != NULL) {
  ------------------
  |  Branch (1839:20): [True: 3.25k, False: 0]
  ------------------
 1840|  3.25k|            if (!WPACKET_memcpy(thispkt, thiswr->input, thiswr->length)) {
  ------------------
  |  Branch (1840:17): [True: 0, False: 3.25k]
  ------------------
 1841|      0|                RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1842|      0|                goto err;
 1843|      0|            }
 1844|  3.25k|            TLS_RL_RECORD_reset_input(&wr[j]);
  ------------------
  |  |   90|  3.25k|#define TLS_RL_RECORD_reset_input(r) ((r)->input = (r)->data)
  ------------------
 1845|  3.25k|        }
 1846|       |
 1847|  3.25k|        if (rl->funcs->add_record_padding != NULL
  ------------------
  |  Branch (1847:13): [True: 0, False: 3.25k]
  ------------------
 1848|      0|            && !rl->funcs->add_record_padding(rl, thistempl, thispkt,
  ------------------
  |  Branch (1848:16): [True: 0, False: 0]
  ------------------
 1849|      0|                thiswr)) {
 1850|       |            /* RLAYERfatal() already called */
 1851|      0|            goto err;
 1852|      0|        }
 1853|       |
 1854|  3.25k|        if (!rl->funcs->prepare_for_encryption(rl, mac_size, thispkt, thiswr)) {
  ------------------
  |  Branch (1854:13): [True: 0, False: 3.25k]
  ------------------
 1855|       |            /* RLAYERfatal() already called */
 1856|      0|            goto err;
 1857|      0|        }
 1858|  3.25k|    }
 1859|       |
 1860|  3.25k|    if (prefix) {
  ------------------
  |  Branch (1860:9): [True: 0, False: 3.25k]
  ------------------
 1861|      0|        if (rl->funcs->cipher(rl, wr, 1, 1, NULL, mac_size) < 1) {
  ------------------
  |  Branch (1861:13): [True: 0, False: 0]
  ------------------
 1862|      0|            if (rl->alert == SSL_AD_NO_ALERT) {
  ------------------
  |  |   63|      0|#define SSL_AD_NO_ALERT -1
  ------------------
  |  Branch (1862:17): [True: 0, False: 0]
  ------------------
 1863|      0|                RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1864|      0|            }
 1865|      0|            goto err;
 1866|      0|        }
 1867|      0|    }
 1868|       |
 1869|  3.25k|    if (rl->funcs->cipher(rl, wr + prefix, numtempl, 1, NULL, mac_size) < 1) {
  ------------------
  |  Branch (1869:9): [True: 0, False: 3.25k]
  ------------------
 1870|      0|        if (rl->alert == SSL_AD_NO_ALERT) {
  ------------------
  |  |   63|      0|#define SSL_AD_NO_ALERT -1
  ------------------
  |  Branch (1870:13): [True: 0, False: 0]
  ------------------
 1871|      0|            RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1872|      0|        }
 1873|      0|        goto err;
 1874|      0|    }
 1875|       |
 1876|  6.51k|    for (j = 0; j < numtempl + prefix; j++) {
  ------------------
  |  Branch (1876:17): [True: 3.25k, False: 3.25k]
  ------------------
 1877|  3.25k|        thispkt = &pkt[j];
 1878|  3.25k|        thiswr = &wr[j];
 1879|  3.25k|        thistempl = (j < prefix) ? &prefixtempl : &templates[j - prefix];
  ------------------
  |  Branch (1879:21): [True: 0, False: 3.25k]
  ------------------
 1880|       |
 1881|  3.25k|        if (!rl->funcs->post_encryption_processing(rl, mac_size, thistempl,
  ------------------
  |  Branch (1881:13): [True: 0, False: 3.25k]
  ------------------
 1882|  3.25k|                thispkt, thiswr)) {
 1883|       |            /* RLAYERfatal() already called */
 1884|      0|            goto err;
 1885|      0|        }
 1886|       |
 1887|       |        /* now let's set up wb */
 1888|  3.25k|        TLS_BUFFER_set_left(&rl->wbuf[j], TLS_RL_RECORD_get_length(thiswr));
  ------------------
  |  |  529|  3.25k|#define TLS_BUFFER_set_left(b, l) ((b)->left = (l))
  ------------------
 1889|  3.25k|    }
 1890|       |
 1891|  3.25k|    ret = 1;
 1892|  3.25k|err:
 1893|  6.51k|    for (j = 0; j < wpinited; j++)
  ------------------
  |  Branch (1893:17): [True: 3.25k, False: 3.25k]
  ------------------
 1894|  3.25k|        WPACKET_cleanup(&pkt[j]);
 1895|  3.25k|    return ret;
 1896|  3.25k|}
tls_write_records:
 1900|  3.25k|{
 1901|       |    /* Check we don't have pending data waiting to write */
 1902|  3.25k|    if (!ossl_assert(rl->nextwbuf >= rl->numwpipes
  ------------------
  |  |   52|  3.25k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  ------------------
  |  |  |  Branch (52:41): [True: 3.25k, False: 0]
  |  |  |  Branch (52:41): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|  3.25k|    __FILE__, __LINE__)
  ------------------
  |  Branch (1902:9): [True: 0, False: 3.25k]
  ------------------
 1903|  3.25k|            || TLS_BUFFER_get_left(&rl->wbuf[rl->nextwbuf]) == 0)) {
 1904|      0|        RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1905|      0|        return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
 1906|      0|    }
 1907|       |
 1908|  3.25k|    if (!rl->funcs->write_records(rl, templates, numtempl)) {
  ------------------
  |  Branch (1908:9): [True: 0, False: 3.25k]
  ------------------
 1909|       |        /* RLAYERfatal already called */
 1910|      0|        return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
 1911|      0|    }
 1912|       |
 1913|  3.25k|    rl->nextwbuf = 0;
 1914|       |    /* we now just need to write the buffers */
 1915|  3.25k|    return tls_retry_write_records(rl);
 1916|  3.25k|}
tls_retry_write_records:
 1919|  3.25k|{
 1920|  3.25k|    int i, ret;
 1921|  3.25k|    TLS_BUFFER *thiswb;
 1922|  3.25k|    size_t tmpwrit = 0;
 1923|       |
 1924|  3.25k|    if (rl->nextwbuf >= rl->numwpipes)
  ------------------
  |  Branch (1924:9): [True: 0, False: 3.25k]
  ------------------
 1925|      0|        return OSSL_RECORD_RETURN_SUCCESS;
  ------------------
  |  |   45|      0|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
 1926|       |
 1927|  3.25k|    for (;;) {
 1928|  3.25k|        thiswb = &rl->wbuf[rl->nextwbuf];
 1929|       |
 1930|  3.25k|        clear_sys_error();
  ------------------
  |  |   31|  3.25k|#define clear_sys_error() errno = 0
  ------------------
 1931|  3.25k|        if (rl->bio != NULL) {
  ------------------
  |  Branch (1931:13): [True: 3.25k, False: 0]
  ------------------
 1932|  3.25k|            if (rl->funcs->prepare_write_bio != NULL) {
  ------------------
  |  Branch (1932:17): [True: 0, False: 3.25k]
  ------------------
 1933|      0|                ret = rl->funcs->prepare_write_bio(rl, thiswb->type);
 1934|      0|                if (ret != OSSL_RECORD_RETURN_SUCCESS)
  ------------------
  |  |   45|      0|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
  |  Branch (1934:21): [True: 0, False: 0]
  ------------------
 1935|      0|                    return ret;
 1936|      0|            }
 1937|  3.25k|            i = BIO_write(rl->bio, (char *)&(TLS_BUFFER_get_buf(thiswb)[TLS_BUFFER_get_offset(thiswb)]),
  ------------------
  |  |  525|  3.25k|#define TLS_BUFFER_get_buf(b) ((b)->buf)
  ------------------
                          i = BIO_write(rl->bio, (char *)&(TLS_BUFFER_get_buf(thiswb)[TLS_BUFFER_get_offset(thiswb)]),
  ------------------
  |  |  531|  3.25k|#define TLS_BUFFER_get_offset(b) ((b)->offset)
  ------------------
 1938|  3.25k|                (unsigned int)TLS_BUFFER_get_left(thiswb));
  ------------------
  |  |  528|  3.25k|#define TLS_BUFFER_get_left(b) ((b)->left)
  ------------------
 1939|  3.25k|            if (i >= 0) {
  ------------------
  |  Branch (1939:17): [True: 3.25k, False: 0]
  ------------------
 1940|  3.25k|                tmpwrit = i;
 1941|  3.25k|                if (i == 0 && BIO_should_retry(rl->bio))
  ------------------
  |  |  272|      0|#define BIO_should_retry(a) BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY)
  |  |  ------------------
  |  |  |  |  226|      0|#define BIO_FLAGS_SHOULD_RETRY 0x08
  |  |  ------------------
  |  |  |  Branch (272:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1941:21): [True: 0, False: 3.25k]
  ------------------
 1942|      0|                    ret = OSSL_RECORD_RETURN_RETRY;
  ------------------
  |  |   46|      0|#define OSSL_RECORD_RETURN_RETRY 0
  ------------------
 1943|  3.25k|                else
 1944|  3.25k|                    ret = OSSL_RECORD_RETURN_SUCCESS;
  ------------------
  |  |   45|  3.25k|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
 1945|  3.25k|            } else {
 1946|      0|                if (BIO_should_retry(rl->bio)) {
  ------------------
  |  |  272|      0|#define BIO_should_retry(a) BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY)
  |  |  ------------------
  |  |  |  |  226|      0|#define BIO_FLAGS_SHOULD_RETRY 0x08
  |  |  ------------------
  |  |  |  Branch (272:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1947|      0|                    ret = OSSL_RECORD_RETURN_RETRY;
  ------------------
  |  |   46|      0|#define OSSL_RECORD_RETURN_RETRY 0
  ------------------
 1948|      0|                } else {
 1949|      0|                    ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                                  ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   74|      0|#define ERR_LIB_SYS 2
  ------------------
                                  ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   30|      0|#define get_last_sys_error() errno
  ------------------
 1950|      0|                        "tls_retry_write_records failure");
 1951|      0|                    ret = OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
 1952|      0|                }
 1953|      0|            }
 1954|  3.25k|        } else {
 1955|      0|            RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, SSL_R_BIO_NOT_SET);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
 1956|      0|            ret = OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
 1957|      0|            i = -1;
 1958|      0|        }
 1959|       |
 1960|       |        /*
 1961|       |         * When an empty fragment is sent on a connection using KTLS,
 1962|       |         * it is sent as a write of zero bytes.  If this zero byte
 1963|       |         * write succeeds, i will be 0 rather than a non-zero value.
 1964|       |         * Treat i == 0 as success rather than an error for zero byte
 1965|       |         * writes to permit this case.
 1966|       |         */
 1967|  3.25k|        if (i >= 0 && tmpwrit == TLS_BUFFER_get_left(thiswb)) {
  ------------------
  |  |  528|  3.25k|#define TLS_BUFFER_get_left(b) ((b)->left)
  ------------------
  |  Branch (1967:13): [True: 3.25k, False: 0]
  |  Branch (1967:23): [True: 3.25k, False: 0]
  ------------------
 1968|  3.25k|            TLS_BUFFER_set_left(thiswb, 0);
  ------------------
  |  |  529|  3.25k|#define TLS_BUFFER_set_left(b, l) ((b)->left = (l))
  ------------------
 1969|  3.25k|            TLS_BUFFER_add_offset(thiswb, tmpwrit);
  ------------------
  |  |  533|  3.25k|#define TLS_BUFFER_add_offset(b, o) ((b)->offset += (o))
  ------------------
 1970|  3.25k|            if (++(rl->nextwbuf) < rl->numwpipes)
  ------------------
  |  Branch (1970:17): [True: 0, False: 3.25k]
  ------------------
 1971|      0|                continue;
 1972|       |
 1973|  3.25k|            if (rl->nextwbuf == rl->numwpipes
  ------------------
  |  Branch (1973:17): [True: 3.25k, False: 0]
  ------------------
 1974|  3.25k|                && (rl->mode & SSL_MODE_RELEASE_BUFFERS) != 0)
  ------------------
  |  |  515|  3.25k|#define SSL_MODE_RELEASE_BUFFERS 0x00000010U
  ------------------
  |  Branch (1974:20): [True: 0, False: 3.25k]
  ------------------
 1975|      0|                tls_release_write_buffer(rl);
 1976|  3.25k|            return OSSL_RECORD_RETURN_SUCCESS;
  ------------------
  |  |   45|  3.25k|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
 1977|  3.25k|        } else if (i <= 0) {
  ------------------
  |  Branch (1977:20): [True: 0, False: 0]
  ------------------
 1978|      0|            if (rl->isdtls) {
  ------------------
  |  Branch (1978:17): [True: 0, False: 0]
  ------------------
 1979|       |                /*
 1980|       |                 * For DTLS, just drop it. That's kind of the whole point in
 1981|       |                 * using a datagram service
 1982|       |                 */
 1983|      0|                TLS_BUFFER_set_left(thiswb, 0);
  ------------------
  |  |  529|      0|#define TLS_BUFFER_set_left(b, l) ((b)->left = (l))
  ------------------
 1984|      0|                if (++(rl->nextwbuf) == rl->numwpipes
  ------------------
  |  Branch (1984:21): [True: 0, False: 0]
  ------------------
 1985|      0|                    && (rl->mode & SSL_MODE_RELEASE_BUFFERS) != 0)
  ------------------
  |  |  515|      0|#define SSL_MODE_RELEASE_BUFFERS 0x00000010U
  ------------------
  |  Branch (1985:24): [True: 0, False: 0]
  ------------------
 1986|      0|                    tls_release_write_buffer(rl);
 1987|      0|            }
 1988|      0|            return ret;
 1989|      0|        }
 1990|      0|        TLS_BUFFER_add_offset(thiswb, tmpwrit);
  ------------------
  |  |  533|      0|#define TLS_BUFFER_add_offset(b, o) ((b)->offset += (o))
  ------------------
 1991|      0|        TLS_BUFFER_sub_left(thiswb, tmpwrit);
  ------------------
  |  |  530|      0|#define TLS_BUFFER_sub_left(b, l) ((b)->left -= (l))
  ------------------
 1992|      0|    }
 1993|  3.25k|}
tls_get_alert_code:
 1996|    168|{
 1997|    168|    return rl->alert;
 1998|    168|}
tls_set1_bio:
 2001|  17.7k|{
 2002|  17.7k|    if (bio != NULL && !BIO_up_ref(bio))
  ------------------
  |  Branch (2002:9): [True: 10.6k, False: 7.08k]
  |  Branch (2002:24): [True: 0, False: 10.6k]
  ------------------
 2003|      0|        return 0;
 2004|  17.7k|    BIO_free(rl->bio);
 2005|  17.7k|    rl->bio = bio;
 2006|       |
 2007|  17.7k|    return 1;
 2008|  17.7k|}
tls_set_protocol_version:
 2020|     98|{
 2021|     98|    return rl->funcs->set_protocol_version(rl, version);
 2022|     98|}
tls_set_first_handshake:
 2030|  10.6k|{
 2031|  10.6k|    rl->is_first_handshake = first;
 2032|  10.6k|}
tls_common.c:tls_allow_compression:
  114|  4.90k|{
  115|  4.90k|    if (rl->options & SSL_OP_NO_COMPRESSION)
  ------------------
  |  |  394|  4.90k|#define SSL_OP_NO_COMPRESSION SSL_OP_BIT(17)
  |  |  ------------------
  |  |  |  |  350|  4.90k|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (115:9): [True: 4.90k, False: 0]
  ------------------
  116|  4.90k|        return 0;
  117|       |
  118|      0|    return rl->security == NULL
  ------------------
  |  Branch (118:12): [True: 0, False: 0]
  ------------------
  119|      0|        || rl->security(rl->cbarg, SSL_SECOP_COMPRESSION, 0, 0, NULL);
  ------------------
  |  | 2778|      0|#define SSL_SECOP_COMPRESSION (15 | SSL_SECOP_OTHER_NONE)
  |  |  ------------------
  |  |  |  | 2737|      0|#define SSL_SECOP_OTHER_NONE 0
  |  |  ------------------
  ------------------
  |  Branch (119:12): [True: 0, False: 0]
  ------------------
  120|  4.90k|}
tls_common.c:tls_release_write_buffer_int:
  124|  13.8k|{
  125|  13.8k|    TLS_BUFFER *wb;
  126|  13.8k|    size_t pipes;
  127|       |
  128|  13.8k|    pipes = rl->numwpipes;
  129|       |
  130|  15.6k|    while (pipes > start) {
  ------------------
  |  Branch (130:12): [True: 1.77k, False: 13.8k]
  ------------------
  131|  1.77k|        wb = &rl->wbuf[pipes - 1];
  132|       |
  133|  1.77k|        if (TLS_BUFFER_is_app_buffer(wb))
  ------------------
  |  |  535|  1.77k|#define TLS_BUFFER_is_app_buffer(b) ((b)->app_buffer)
  |  |  ------------------
  |  |  |  Branch (535:37): [True: 0, False: 1.77k]
  |  |  ------------------
  ------------------
  134|      0|            TLS_BUFFER_set_app_buffer(wb, 0);
  ------------------
  |  |  534|      0|#define TLS_BUFFER_set_app_buffer(b, l) ((b)->app_buffer = (l))
  ------------------
  135|  1.77k|        else
  136|  1.77k|            OPENSSL_free(wb->buf);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  137|       |        wb->buf = NULL;
  138|  1.77k|        pipes--;
  139|  1.77k|    }
  140|  13.8k|}
tls_common.c:tls_int_free:
 1456|  10.6k|{
 1457|  10.6k|    BIO_free(rl->prev);
 1458|  10.6k|    BIO_free(rl->bio);
 1459|  10.6k|    BIO_free(rl->next);
 1460|  10.6k|    ossl_tls_buffer_release(&rl->rbuf);
 1461|       |
 1462|  10.6k|    tls_release_write_buffer(rl);
 1463|       |
 1464|  10.6k|    EVP_CIPHER_CTX_free(rl->enc_ctx);
 1465|  10.6k|    EVP_MAC_CTX_free(rl->mac_ctx);
 1466|  10.6k|    EVP_MD_CTX_free(rl->md_ctx);
 1467|  10.6k|#ifndef OPENSSL_NO_COMP
 1468|  10.6k|    COMP_CTX_free(rl->compctx);
 1469|  10.6k|#endif
 1470|  10.6k|    OPENSSL_free(rl->iv);
  ------------------
  |  |  131|  10.6k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1471|  10.6k|    OPENSSL_free(rl->nonce);
  ------------------
  |  |  131|  10.6k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1472|  10.6k|    if (rl->version == SSL3_VERSION)
  ------------------
  |  |   23|  10.6k|#define SSL3_VERSION 0x0300
  ------------------
  |  Branch (1472:9): [True: 0, False: 10.6k]
  ------------------
 1473|      0|        OPENSSL_cleanse(rl->mac_secret, sizeof(rl->mac_secret));
 1474|       |
 1475|  10.6k|    TLS_RL_RECORD_release(rl->rrec, SSL_MAX_PIPELINES);
  ------------------
  |  |   71|  10.6k|#define SSL_MAX_PIPELINES 32
  ------------------
 1476|       |
 1477|  10.6k|    OPENSSL_free(rl);
  ------------------
  |  |  131|  10.6k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1478|  10.6k|}
tls_common.c:TLS_RL_RECORD_release:
   33|  10.6k|{
   34|  10.6k|    size_t i;
   35|       |
   36|   350k|    for (i = 0; i < num_recs; i++) {
  ------------------
  |  Branch (36:17): [True: 339k, False: 10.6k]
  ------------------
   37|   339k|        OPENSSL_free(r[i].comp);
  ------------------
  |  |  131|   339k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   38|       |        r[i].comp = NULL;
   39|   339k|    }
   40|  10.6k|}
tls_common.c:tls_release_write_buffer:
  223|  10.6k|{
  224|  10.6k|    tls_release_write_buffer_int(rl, 0);
  225|       |
  226|  10.6k|    rl->numwpipes = 0;
  227|  10.6k|}
tls_common.c:tls_new_record_layer:
 1410|  10.6k|{
 1411|  10.6k|    int ret;
 1412|       |
 1413|  10.6k|    ret = tls_int_new_record_layer(libctx, propq, vers, role, direction, level,
 1414|  10.6k|        ciph, taglen, md, comp, prev,
 1415|  10.6k|        transport, next, settings,
 1416|  10.6k|        options, fns, cbarg, retrl);
 1417|       |
 1418|  10.6k|    if (ret != OSSL_RECORD_RETURN_SUCCESS)
  ------------------
  |  |   45|  10.6k|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
  |  Branch (1418:9): [True: 0, False: 10.6k]
  ------------------
 1419|      0|        return ret;
 1420|       |
 1421|  10.6k|    switch (vers) {
 1422|  10.6k|    case TLS_ANY_VERSION:
  ------------------
  |  |   40|  10.6k|#define TLS_ANY_VERSION 0x10000
  ------------------
  |  Branch (1422:5): [True: 10.6k, False: 0]
  ------------------
 1423|  10.6k|        (*retrl)->funcs = &tls_any_funcs;
 1424|  10.6k|        break;
 1425|      0|    case TLS1_3_VERSION:
  ------------------
  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (1425:5): [True: 0, False: 10.6k]
  ------------------
 1426|      0|        (*retrl)->funcs = &tls_1_3_funcs;
 1427|      0|        break;
 1428|      0|    case TLS1_2_VERSION:
  ------------------
  |  |   26|      0|#define TLS1_2_VERSION 0x0303
  ------------------
  |  Branch (1428:5): [True: 0, False: 10.6k]
  ------------------
 1429|      0|    case TLS1_1_VERSION:
  ------------------
  |  |   25|      0|#define TLS1_1_VERSION 0x0302
  ------------------
  |  Branch (1429:5): [True: 0, False: 10.6k]
  ------------------
 1430|      0|    case TLS1_VERSION:
  ------------------
  |  |   24|      0|#define TLS1_VERSION 0x0301
  ------------------
  |  Branch (1430:5): [True: 0, False: 10.6k]
  ------------------
 1431|      0|        (*retrl)->funcs = &tls_1_funcs;
 1432|      0|        break;
 1433|      0|    case SSL3_VERSION:
  ------------------
  |  |   23|      0|#define SSL3_VERSION 0x0300
  ------------------
  |  Branch (1433:5): [True: 0, False: 10.6k]
  ------------------
 1434|      0|        (*retrl)->funcs = &ssl_3_0_funcs;
 1435|      0|        break;
 1436|      0|    default:
  ------------------
  |  Branch (1436:5): [True: 0, False: 10.6k]
  ------------------
 1437|       |        /* Should not happen */
 1438|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1439|      0|        ret = OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
 1440|      0|        goto err;
 1441|  10.6k|    }
 1442|       |
 1443|  10.6k|    ret = (*retrl)->funcs->set_crypto_state(*retrl, level, key, keylen, iv,
 1444|  10.6k|        ivlen, mackey, mackeylen, ciph,
 1445|  10.6k|        taglen, mactype, md, comp);
 1446|       |
 1447|  10.6k|err:
 1448|  10.6k|    if (ret != OSSL_RECORD_RETURN_SUCCESS) {
  ------------------
  |  |   45|  10.6k|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
  |  Branch (1448:9): [True: 0, False: 10.6k]
  ------------------
 1449|      0|        tls_int_free(*retrl);
 1450|       |        *retrl = NULL;
 1451|      0|    }
 1452|  10.6k|    return ret;
 1453|  10.6k|}

tlsany_meth.c:tls_any_set_crypto_state:
   26|  10.6k|{
   27|  10.6k|    if (level != OSSL_RECORD_PROTECTION_LEVEL_NONE) {
  ------------------
  |  | 2932|  10.6k|#define OSSL_RECORD_PROTECTION_LEVEL_NONE 0
  ------------------
  |  Branch (27:9): [True: 0, False: 10.6k]
  ------------------
   28|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   29|      0|        return OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
   30|      0|    }
   31|       |
   32|       |    /* No crypto protection at the "NONE" level so nothing to be done */
   33|       |
   34|  10.6k|    return OSSL_RECORD_RETURN_SUCCESS;
  ------------------
  |  |   45|  10.6k|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
   35|  10.6k|}
tlsany_meth.c:tls_any_cipher:
   40|  3.56k|{
   41|  3.56k|    return 1;
   42|  3.56k|}
tlsany_meth.c:tls_any_set_protocol_version:
  128|     98|{
  129|     98|    if (rl->version != TLS_ANY_VERSION && rl->version != vers)
  ------------------
  |  |   40|    196|#define TLS_ANY_VERSION 0x10000
  ------------------
  |  Branch (129:9): [True: 0, False: 98]
  |  Branch (129:43): [True: 0, False: 0]
  ------------------
  130|      0|        return 0;
  131|     98|    rl->version = vers;
  132|       |
  133|     98|    return 1;
  134|     98|}
tlsany_meth.c:tls_validate_record_header:
   45|    476|{
   46|    476|    if (rec->rec_version == SSL2_VERSION) {
  ------------------
  |  |   23|    476|#define SSL2_VERSION 0x0002
  ------------------
  |  Branch (46:9): [True: 0, False: 476]
  ------------------
   47|       |        /* SSLv2 format ClientHello */
   48|      0|        if (!ossl_assert(rl->version == TLS_ANY_VERSION)) {
  ------------------
  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|      0|    __FILE__, __LINE__)
  ------------------
  |  Branch (48:13): [True: 0, False: 0]
  ------------------
   49|      0|            RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
   50|      0|            return 0;
   51|      0|        }
   52|      0|        if (rec->length < MIN_SSL2_RECORD_LEN) {
  ------------------
  |  |   15|      0|#define MIN_SSL2_RECORD_LEN 9
  ------------------
  |  Branch (52:13): [True: 0, False: 0]
  ------------------
   53|      0|            RLAYERfatal(rl, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_TOO_SHORT);
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
   54|      0|            return 0;
   55|      0|        }
   56|    476|    } else {
   57|    476|        if (rl->version == TLS_ANY_VERSION) {
  ------------------
  |  |   40|    476|#define TLS_ANY_VERSION 0x10000
  ------------------
  |  Branch (57:13): [True: 476, False: 0]
  ------------------
   58|    476|            if ((rec->rec_version >> 8) != SSL3_VERSION_MAJOR) {
  ------------------
  |  |  216|    476|#define SSL3_VERSION_MAJOR 0x03
  ------------------
  |  Branch (58:17): [True: 152, False: 324]
  ------------------
   59|    152|                if (rl->is_first_record) {
  ------------------
  |  Branch (59:21): [True: 131, False: 21]
  ------------------
   60|    131|                    unsigned char *p;
   61|       |
   62|       |                    /*
   63|       |                     * Go back to start of packet, look at the five bytes that
   64|       |                     * we have.
   65|       |                     */
   66|    131|                    p = rl->packet;
   67|    131|                    if (HAS_PREFIX((char *)p, "GET ") || HAS_PREFIX((char *)p, "POST ") || HAS_PREFIX((char *)p, "HEAD ") || HAS_PREFIX((char *)p, "PATCH") || HAS_PREFIX((char *)p, "OPTIO") || HAS_PREFIX((char *)p, "DELET") || HAS_PREFIX((char *)p, "TRACE") || HAS_PREFIX((char *)p, "PUT ")) {
  ------------------
  |  |   58|    262|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 1, False: 130]
  |  |  ------------------
  ------------------
                                  if (HAS_PREFIX((char *)p, "GET ") || HAS_PREFIX((char *)p, "POST ") || HAS_PREFIX((char *)p, "HEAD ") || HAS_PREFIX((char *)p, "PATCH") || HAS_PREFIX((char *)p, "OPTIO") || HAS_PREFIX((char *)p, "DELET") || HAS_PREFIX((char *)p, "TRACE") || HAS_PREFIX((char *)p, "PUT ")) {
  ------------------
  |  |   58|    261|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 0, False: 130]
  |  |  ------------------
  ------------------
                                  if (HAS_PREFIX((char *)p, "GET ") || HAS_PREFIX((char *)p, "POST ") || HAS_PREFIX((char *)p, "HEAD ") || HAS_PREFIX((char *)p, "PATCH") || HAS_PREFIX((char *)p, "OPTIO") || HAS_PREFIX((char *)p, "DELET") || HAS_PREFIX((char *)p, "TRACE") || HAS_PREFIX((char *)p, "PUT ")) {
  ------------------
  |  |   58|    261|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 1, False: 129]
  |  |  ------------------
  ------------------
                                  if (HAS_PREFIX((char *)p, "GET ") || HAS_PREFIX((char *)p, "POST ") || HAS_PREFIX((char *)p, "HEAD ") || HAS_PREFIX((char *)p, "PATCH") || HAS_PREFIX((char *)p, "OPTIO") || HAS_PREFIX((char *)p, "DELET") || HAS_PREFIX((char *)p, "TRACE") || HAS_PREFIX((char *)p, "PUT ")) {
  ------------------
  |  |   58|    260|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 1, False: 128]
  |  |  ------------------
  ------------------
                                  if (HAS_PREFIX((char *)p, "GET ") || HAS_PREFIX((char *)p, "POST ") || HAS_PREFIX((char *)p, "HEAD ") || HAS_PREFIX((char *)p, "PATCH") || HAS_PREFIX((char *)p, "OPTIO") || HAS_PREFIX((char *)p, "DELET") || HAS_PREFIX((char *)p, "TRACE") || HAS_PREFIX((char *)p, "PUT ")) {
  ------------------
  |  |   58|    259|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 1, False: 127]
  |  |  ------------------
  ------------------
                                  if (HAS_PREFIX((char *)p, "GET ") || HAS_PREFIX((char *)p, "POST ") || HAS_PREFIX((char *)p, "HEAD ") || HAS_PREFIX((char *)p, "PATCH") || HAS_PREFIX((char *)p, "OPTIO") || HAS_PREFIX((char *)p, "DELET") || HAS_PREFIX((char *)p, "TRACE") || HAS_PREFIX((char *)p, "PUT ")) {
  ------------------
  |  |   58|    258|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 1, False: 126]
  |  |  ------------------
  ------------------
                                  if (HAS_PREFIX((char *)p, "GET ") || HAS_PREFIX((char *)p, "POST ") || HAS_PREFIX((char *)p, "HEAD ") || HAS_PREFIX((char *)p, "PATCH") || HAS_PREFIX((char *)p, "OPTIO") || HAS_PREFIX((char *)p, "DELET") || HAS_PREFIX((char *)p, "TRACE") || HAS_PREFIX((char *)p, "PUT ")) {
  ------------------
  |  |   58|    257|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 1, False: 125]
  |  |  ------------------
  ------------------
                                  if (HAS_PREFIX((char *)p, "GET ") || HAS_PREFIX((char *)p, "POST ") || HAS_PREFIX((char *)p, "HEAD ") || HAS_PREFIX((char *)p, "PATCH") || HAS_PREFIX((char *)p, "OPTIO") || HAS_PREFIX((char *)p, "DELET") || HAS_PREFIX((char *)p, "TRACE") || HAS_PREFIX((char *)p, "PUT ")) {
  ------------------
  |  |   58|    125|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 1, False: 124]
  |  |  ------------------
  ------------------
   68|      7|                        RLAYERfatal(rl, SSL_AD_NO_ALERT, SSL_R_HTTP_REQUEST);
  ------------------
  |  |  391|      7|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      7|    (ERR_new(),                                                  \
  |  |  |  |  394|      7|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      7|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      7|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
   69|      7|                        return 0;
   70|    124|                    } else if (HAS_PREFIX((char *)p, "CONNE")) {
  ------------------
  |  |   58|    124|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 1, False: 123]
  |  |  ------------------
  ------------------
   71|      1|                        RLAYERfatal(rl, SSL_AD_NO_ALERT,
  ------------------
  |  |  391|      1|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      1|    (ERR_new(),                                                  \
  |  |  |  |  394|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      1|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
   72|      1|                            SSL_R_HTTPS_PROXY_REQUEST);
   73|      1|                        return 0;
   74|      1|                    }
   75|       |
   76|       |                    /* Doesn't look like TLS - don't send an alert */
   77|    131|                    RLAYERfatal(rl, SSL_AD_NO_ALERT,
  ------------------
  |  |  391|    123|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|    123|    (ERR_new(),                                                  \
  |  |  |  |  394|    123|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|    123|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|    123|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
   78|    123|                        SSL_R_WRONG_VERSION_NUMBER);
   79|    123|                    return 0;
   80|    131|                } else {
   81|     21|                    RLAYERfatal(rl, SSL_AD_PROTOCOL_VERSION,
  ------------------
  |  |  391|     21|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|     21|    (ERR_new(),                                                  \
  |  |  |  |  394|     21|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|     21|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|     21|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
   82|     21|                        SSL_R_WRONG_VERSION_NUMBER);
   83|     21|                    return 0;
   84|     21|                }
   85|    152|            }
   86|    476|        } else if (rl->version == TLS1_3_VERSION) {
  ------------------
  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (86:20): [True: 0, False: 0]
  ------------------
   87|       |            /*
   88|       |             * In this case we know we are going to negotiate TLSv1.3, but we've
   89|       |             * had an HRR, so we haven't actually done so yet. In TLSv1.3 we
   90|       |             * must ignore the legacy record version in plaintext records.
   91|       |             */
   92|      0|        } else if (rec->rec_version != rl->version) {
  ------------------
  |  Branch (92:20): [True: 0, False: 0]
  ------------------
   93|      0|            if ((rl->version & 0xFF00) == (rec->rec_version & 0xFF00)) {
  ------------------
  |  Branch (93:17): [True: 0, False: 0]
  ------------------
   94|      0|                if (rec->type == SSL3_RT_ALERT) {
  ------------------
  |  |  220|      0|#define SSL3_RT_ALERT 21
  ------------------
  |  Branch (94:21): [True: 0, False: 0]
  ------------------
   95|       |                    /*
   96|       |                     * The record is using an incorrect version number,
   97|       |                     * but what we've got appears to be an alert. We
   98|       |                     * haven't read the body yet to check whether its a
   99|       |                     * fatal or not - but chances are it is. We probably
  100|       |                     * shouldn't send a fatal alert back. We'll just
  101|       |                     * end.
  102|       |                     */
  103|      0|                    RLAYERfatal(rl, SSL_AD_NO_ALERT,
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  104|      0|                        SSL_R_WRONG_VERSION_NUMBER);
  105|      0|                    return 0;
  106|      0|                }
  107|       |                /* Send back error using their minor version number */
  108|      0|                rl->version = (unsigned short)rec->rec_version;
  109|      0|            }
  110|      0|            RLAYERfatal(rl, SSL_AD_PROTOCOL_VERSION,
  ------------------
  |  |  391|      0|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      0|    (ERR_new(),                                                  \
  |  |  |  |  394|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      0|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  111|      0|                SSL_R_WRONG_VERSION_NUMBER);
  112|      0|            return 0;
  113|      0|        }
  114|    476|    }
  115|    324|    if (rec->length > SSL3_RT_MAX_PLAIN_LENGTH) {
  ------------------
  |  |  177|    324|#define SSL3_RT_MAX_PLAIN_LENGTH 16384
  ------------------
  |  Branch (115:9): [True: 3, False: 321]
  ------------------
  116|       |        /*
  117|       |         * We use SSL_R_DATA_LENGTH_TOO_LONG instead of
  118|       |         * SSL_R_ENCRYPTED_LENGTH_TOO_LONG here because we are the "any" method
  119|       |         * and we know that we are dealing with plaintext data
  120|       |         */
  121|      3|        RLAYERfatal(rl, SSL_AD_RECORD_OVERFLOW, SSL_R_DATA_LENGTH_TOO_LONG);
  ------------------
  |  |  391|      3|#define RLAYERfatal(rl, al, r) RLAYERfatal_data((rl), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  393|      3|    (ERR_new(),                                                  \
  |  |  |  |  394|      3|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      3|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  395|      3|        ossl_rlayer_fatal)
  |  |  ------------------
  ------------------
  122|      3|        return 0;
  123|      3|    }
  124|    321|    return 1;
  125|    324|}
tlsany_meth.c:tls_any_prepare_for_encryption:
  140|  3.25k|{
  141|       |    /* No encryption, so nothing to do */
  142|  3.25k|    return 1;
  143|  3.25k|}

RECORD_LAYER_init:
   28|  1.77k|{
   29|  1.77k|    rl->s = s;
   30|  1.77k|}
RECORD_LAYER_clear:
   33|  7.08k|{
   34|  7.08k|    int ret = 1;
   35|       |
   36|       |    /* Clear any buffered records we no longer need */
   37|  7.27k|    while (rl->curr_rec < rl->num_recs)
  ------------------
  |  Branch (37:12): [True: 190, False: 7.08k]
  ------------------
   38|    190|        ret &= ssl_release_record(rl->s,
   39|    190|            &(rl->tlsrecs[rl->curr_rec++]),
   40|    190|            0);
   41|       |
   42|  7.08k|    rl->wnum = 0;
   43|  7.08k|    memset(rl->handshake_fragment, 0, sizeof(rl->handshake_fragment));
   44|  7.08k|    rl->handshake_fragment_len = 0;
   45|  7.08k|    rl->wpend_tot = 0;
   46|  7.08k|    rl->wpend_type = 0;
   47|  7.08k|    rl->wpend_buf = NULL;
   48|  7.08k|    rl->alert_count = 0;
   49|  7.08k|    rl->num_recs = 0;
   50|  7.08k|    rl->curr_rec = 0;
   51|       |
   52|  7.08k|    BIO_free(rl->rrlnext);
   53|  7.08k|    rl->rrlnext = NULL;
   54|       |
   55|  7.08k|    if (rl->rrlmethod != NULL)
  ------------------
  |  Branch (55:9): [True: 5.31k, False: 1.77k]
  ------------------
   56|  5.31k|        rl->rrlmethod->free(rl->rrl); /* Ignore return value */
   57|  7.08k|    if (rl->wrlmethod != NULL)
  ------------------
  |  Branch (57:9): [True: 5.31k, False: 1.77k]
  ------------------
   58|  5.31k|        rl->wrlmethod->free(rl->wrl); /* Ignore return value */
   59|  7.08k|    BIO_free(rl->rrlnext);
   60|  7.08k|    rl->rrlmethod = NULL;
   61|  7.08k|    rl->wrlmethod = NULL;
   62|  7.08k|    rl->rrlnext = NULL;
   63|  7.08k|    rl->rrl = NULL;
   64|  7.08k|    rl->wrl = NULL;
   65|       |
   66|  7.08k|    if (rl->d)
  ------------------
  |  Branch (66:9): [True: 0, False: 7.08k]
  ------------------
   67|      0|        DTLS_RECORD_LAYER_clear(rl);
   68|       |
   69|  7.08k|    return ret;
   70|  7.08k|}
RECORD_LAYER_reset:
   73|  5.31k|{
   74|  5.31k|    int ret;
   75|       |
   76|  5.31k|    ret = RECORD_LAYER_clear(rl);
   77|       |
   78|       |    /* We try and reset both record layers even if one fails */
   79|  5.31k|    ret &= ssl_set_new_record_layer(rl->s,
   80|  5.31k|        SSL_CONNECTION_IS_DTLS(rl->s)
  ------------------
  |  |  258|  5.31k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  5.31k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  5.31k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 5.31k]
  |  |  ------------------
  ------------------
   81|  5.31k|            ? DTLS_ANY_VERSION
  ------------------
  |  |   35|      0|#define DTLS_ANY_VERSION 0x1FFFF
  ------------------
   82|  5.31k|            : TLS_ANY_VERSION,
  ------------------
  |  |   40|  5.31k|#define TLS_ANY_VERSION 0x10000
  ------------------
   83|  5.31k|        OSSL_RECORD_DIRECTION_READ,
  ------------------
  |  |   42|  5.31k|#define OSSL_RECORD_DIRECTION_READ 0
  ------------------
   84|  5.31k|        OSSL_RECORD_PROTECTION_LEVEL_NONE, NULL, 0,
  ------------------
  |  | 2932|  5.31k|#define OSSL_RECORD_PROTECTION_LEVEL_NONE 0
  ------------------
   85|  5.31k|        NULL, 0, NULL, 0, NULL, 0, NULL, 0,
   86|  5.31k|        NID_undef, NULL, NULL, NULL);
  ------------------
  |  |   18|  5.31k|#define NID_undef                       0
  ------------------
   87|       |
   88|  5.31k|    ret &= ssl_set_new_record_layer(rl->s,
   89|  5.31k|        SSL_CONNECTION_IS_DTLS(rl->s)
  ------------------
  |  |  258|  5.31k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  5.31k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  5.31k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 5.31k]
  |  |  ------------------
  ------------------
   90|  5.31k|            ? DTLS_ANY_VERSION
  ------------------
  |  |   35|      0|#define DTLS_ANY_VERSION 0x1FFFF
  ------------------
   91|  5.31k|            : TLS_ANY_VERSION,
  ------------------
  |  |   40|  5.31k|#define TLS_ANY_VERSION 0x10000
  ------------------
   92|  5.31k|        OSSL_RECORD_DIRECTION_WRITE,
  ------------------
  |  |   43|  5.31k|#define OSSL_RECORD_DIRECTION_WRITE 1
  ------------------
   93|  5.31k|        OSSL_RECORD_PROTECTION_LEVEL_NONE, NULL, 0,
  ------------------
  |  | 2932|  5.31k|#define OSSL_RECORD_PROTECTION_LEVEL_NONE 0
  ------------------
   94|  5.31k|        NULL, 0, NULL, 0, NULL, 0, NULL, 0,
   95|  5.31k|        NID_undef, NULL, NULL, NULL);
  ------------------
  |  |   18|  5.31k|#define NID_undef                       0
  ------------------
   96|       |
   97|       |    /* SSLfatal already called in the event of failure */
   98|  5.31k|    return ret;
   99|  5.31k|}
RECORD_LAYER_write_pending:
  115|  3.22k|{
  116|  3.22k|    return rl->wpend_tot > 0;
  117|  3.22k|}
SSL_CTX_set_default_read_buffer_len:
  207|  2.47k|{
  208|  2.47k|    ctx->default_read_buf_len = len;
  209|  2.47k|}
ssl3_write_bytes:
  275|  1.64k|{
  276|  1.64k|    const unsigned char *buf = buf_;
  277|  1.64k|    size_t tot;
  278|  1.64k|    size_t n, max_send_fragment, split_send_fragment, maxpipes;
  279|  1.64k|    int i;
  280|  1.64k|    SSL_CONNECTION *s = SSL_CONNECTION_FROM_SSL_ONLY(ssl);
  ------------------
  |  |   23|  1.64k|    SSL_CONNECTION_FROM_SSL_ONLY_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   17|  1.64k|    ((ssl) == NULL ? NULL                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (17:6): [True: 0, False: 1.64k]
  |  |  |  |  ------------------
  |  |  |  |   18|  1.64k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  1.64k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:23): [True: 1.64k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   19|  1.64k|                             ? (c SSL_CONNECTION *)(ssl)     \
  |  |  |  |   20|  1.64k|                             : NULL))
  |  |  ------------------
  ------------------
  281|  1.64k|    OSSL_RECORD_TEMPLATE tmpls[SSL_MAX_PIPELINES];
  282|  1.64k|    unsigned int recversion;
  283|       |
  284|  1.64k|    if (s == NULL)
  ------------------
  |  Branch (284:9): [True: 0, False: 1.64k]
  ------------------
  285|      0|        return -1;
  286|       |
  287|  1.64k|    s->rwstate = SSL_NOTHING;
  ------------------
  |  |  932|  1.64k|#define SSL_NOTHING 1
  ------------------
  288|  1.64k|    tot = s->rlayer.wnum;
  289|       |    /*
  290|       |     * ensure that if we end up with a smaller value of data to write out
  291|       |     * than the original len from a write which didn't complete for
  292|       |     * non-blocking I/O and also somehow ended up avoiding the check for
  293|       |     * this in tls_write_check_pending/SSL_R_BAD_WRITE_RETRY as it must never be
  294|       |     * possible to end up with (len-tot) as a large number that will then
  295|       |     * promptly send beyond the end of the users buffer ... so we trap and
  296|       |     * report the error in a way the user will notice
  297|       |     */
  298|  1.64k|    if ((len < s->rlayer.wnum)
  ------------------
  |  Branch (298:9): [True: 0, False: 1.64k]
  ------------------
  299|  1.64k|        || ((s->rlayer.wpend_tot != 0)
  ------------------
  |  Branch (299:13): [True: 0, False: 1.64k]
  ------------------
  300|      0|            && (len < (s->rlayer.wnum + s->rlayer.wpend_tot)))) {
  ------------------
  |  Branch (300:16): [True: 0, False: 0]
  ------------------
  301|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_LENGTH);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  302|      0|        return -1;
  303|      0|    }
  304|       |
  305|  1.64k|    if (s->early_data_state == SSL_EARLY_DATA_WRITING
  ------------------
  |  Branch (305:9): [True: 0, False: 1.64k]
  ------------------
  306|      0|        && !ossl_early_data_count_ok(s, len, 0, 1)) {
  ------------------
  |  Branch (306:12): [True: 0, False: 0]
  ------------------
  307|       |        /* SSLfatal() already called */
  308|      0|        return -1;
  309|      0|    }
  310|       |
  311|  1.64k|    s->rlayer.wnum = 0;
  312|       |
  313|       |    /*
  314|       |     * If we are supposed to be sending a KeyUpdate or NewSessionTicket then go
  315|       |     * into init unless we have writes pending - in which case we should finish
  316|       |     * doing that first.
  317|       |     */
  318|  1.64k|    if (s->rlayer.wpend_tot == 0 && (s->key_update != SSL_KEY_UPDATE_NONE || s->ext.extra_tickets_expected > 0))
  ------------------
  |  | 1048|  3.28k|#define SSL_KEY_UPDATE_NONE -1
  ------------------
  |  Branch (318:9): [True: 1.64k, False: 0]
  |  Branch (318:38): [True: 0, False: 1.64k]
  |  Branch (318:78): [True: 0, False: 1.64k]
  ------------------
  319|      0|        ossl_statem_set_in_init(s, 1);
  320|       |
  321|       |    /*
  322|       |     * When writing early data on the server side we could be "in_init" in
  323|       |     * between receiving the EoED and the CF - but we don't want to handle those
  324|       |     * messages yet.
  325|       |     */
  326|  1.64k|    if (SSL_in_init(ssl) && !ossl_statem_get_in_handshake(s)
  ------------------
  |  Branch (326:9): [True: 1.64k, False: 0]
  |  Branch (326:29): [True: 0, False: 1.64k]
  ------------------
  327|      0|        && s->early_data_state != SSL_EARLY_DATA_UNAUTH_WRITING) {
  ------------------
  |  Branch (327:12): [True: 0, False: 0]
  ------------------
  328|      0|        i = s->handshake_func(ssl);
  329|       |        /* SSLfatal() already called */
  330|      0|        if (i < 0)
  ------------------
  |  Branch (330:13): [True: 0, False: 0]
  ------------------
  331|      0|            return i;
  332|      0|        if (i == 0) {
  ------------------
  |  Branch (332:13): [True: 0, False: 0]
  ------------------
  333|      0|            return -1;
  334|      0|        }
  335|      0|    }
  336|       |
  337|  1.64k|    i = tls_write_check_pending(s, type, buf, len);
  338|  1.64k|    if (i < 0) {
  ------------------
  |  Branch (338:9): [True: 0, False: 1.64k]
  ------------------
  339|       |        /* SSLfatal() already called */
  340|      0|        return i;
  341|  1.64k|    } else if (i > 0) {
  ------------------
  |  Branch (341:16): [True: 0, False: 1.64k]
  ------------------
  342|       |        /* Retry needed */
  343|      0|        i = HANDLE_RLAYER_WRITE_RETURN(s,
  ------------------
  |  |  169|      0|    ossl_tls_handle_rlayer_return(s, 1, ret, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   ossl_tls_handle_rlayer_return(s, 1, ret, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  344|      0|            s->rlayer.wrlmethod->retry_write_records(s->rlayer.wrl));
  345|      0|        if (i <= 0) {
  ------------------
  |  Branch (345:13): [True: 0, False: 0]
  ------------------
  346|      0|            s->rlayer.wnum = tot;
  347|      0|            return i;
  348|      0|        }
  349|      0|        tot += s->rlayer.wpend_tot;
  350|      0|        s->rlayer.wpend_tot = 0;
  351|      0|    } /* else no retry required */
  352|       |
  353|  1.64k|    if (tot == 0) {
  ------------------
  |  Branch (353:9): [True: 1.64k, False: 0]
  ------------------
  354|       |        /*
  355|       |         * We've not previously sent any data for this write so memorize
  356|       |         * arguments so that we can detect bad write retries later
  357|       |         */
  358|  1.64k|        s->rlayer.wpend_tot = 0;
  359|  1.64k|        s->rlayer.wpend_type = type;
  360|  1.64k|        s->rlayer.wpend_buf = buf;
  361|  1.64k|    }
  362|       |
  363|  1.64k|    if (tot == len) { /* done? */
  ------------------
  |  Branch (363:9): [True: 0, False: 1.64k]
  ------------------
  364|      0|        *written = tot;
  365|      0|        return 1;
  366|      0|    }
  367|       |
  368|       |    /* If we have an alert to send, lets send it */
  369|  1.64k|    if (s->s3.alert_dispatch > 0) {
  ------------------
  |  Branch (369:9): [True: 0, False: 1.64k]
  ------------------
  370|      0|        i = ssl->method->ssl_dispatch_alert(ssl);
  371|      0|        if (i <= 0) {
  ------------------
  |  Branch (371:13): [True: 0, False: 0]
  ------------------
  372|       |            /* SSLfatal() already called if appropriate */
  373|      0|            s->rlayer.wnum = tot;
  374|      0|            return i;
  375|      0|        }
  376|       |        /* if it went, fall through and send more stuff */
  377|      0|    }
  378|       |
  379|  1.64k|    n = (len - tot);
  380|       |
  381|  1.64k|    max_send_fragment = ssl_get_max_send_fragment(s);
  382|  1.64k|    split_send_fragment = ssl_get_split_send_fragment(s);
  383|       |
  384|  1.64k|    if (max_send_fragment == 0
  ------------------
  |  Branch (384:9): [True: 0, False: 1.64k]
  ------------------
  385|  1.64k|        || split_send_fragment == 0
  ------------------
  |  Branch (385:12): [True: 0, False: 1.64k]
  ------------------
  386|  1.64k|        || split_send_fragment > max_send_fragment) {
  ------------------
  |  Branch (386:12): [True: 0, False: 1.64k]
  ------------------
  387|       |        /*
  388|       |         * We should have prevented this when we set/get the split and max send
  389|       |         * fragments so we shouldn't get here
  390|       |         */
  391|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  392|      0|        return -1;
  393|      0|    }
  394|       |
  395|       |    /*
  396|       |     * Some servers hang if initial client hello is larger than 256 bytes
  397|       |     * and record version number > TLS 1.0
  398|       |     */
  399|  1.64k|    recversion = (s->version == TLS1_3_VERSION) ? TLS1_2_VERSION : s->version;
  ------------------
  |  |   27|  1.64k|#define TLS1_3_VERSION 0x0304
  ------------------
                  recversion = (s->version == TLS1_3_VERSION) ? TLS1_2_VERSION : s->version;
  ------------------
  |  |   26|  1.63k|#define TLS1_2_VERSION 0x0303
  ------------------
  |  Branch (399:18): [True: 1.63k, False: 11]
  ------------------
  400|  1.64k|    if (SSL_get_state(ssl) == TLS_ST_CW_CLNT_HELLO
  ------------------
  |  Branch (400:9): [True: 1.64k, False: 0]
  ------------------
  401|  1.64k|        && !s->renegotiate
  ------------------
  |  Branch (401:12): [True: 1.64k, False: 0]
  ------------------
  402|  1.64k|        && TLS1_get_version(ssl) > TLS1_VERSION
  ------------------
  |  |   52|  1.64k|    ((SSL_version(s) >> 8) == TLS1_VERSION_MAJOR ? SSL_version(s) : 0)
  |  |  ------------------
  |  |  |  |   42|  1.64k|#define TLS1_VERSION_MAJOR 0x03
  |  |  ------------------
  |  |  |  Branch (52:6): [True: 1.64k, False: 0]
  |  |  ------------------
  ------------------
                      && TLS1_get_version(ssl) > TLS1_VERSION
  ------------------
  |  |   24|  3.28k|#define TLS1_VERSION 0x0301
  ------------------
  |  Branch (402:12): [True: 1.64k, False: 1]
  ------------------
  403|  1.64k|        && s->hello_retry_request == SSL_HRR_NONE)
  ------------------
  |  Branch (403:12): [True: 1.64k, False: 0]
  ------------------
  404|  1.64k|        recversion = TLS1_VERSION;
  ------------------
  |  |   24|  1.64k|#define TLS1_VERSION 0x0301
  ------------------
  405|       |
  406|  1.64k|    for (;;) {
  407|  1.64k|        size_t tmppipelen, remain;
  408|  1.64k|        size_t j, lensofar = 0;
  409|       |
  410|       |        /*
  411|       |         * Ask the record layer how it would like to split the amount of data
  412|       |         * that we have, and how many of those records it would like in one go.
  413|       |         */
  414|  1.64k|        maxpipes = s->rlayer.wrlmethod->get_max_records(s->rlayer.wrl, type, n,
  415|  1.64k|            max_send_fragment,
  416|  1.64k|            &split_send_fragment);
  417|       |        /*
  418|       |         * If max_pipelines is 0 then this means "undefined" and we default to
  419|       |         * whatever the record layer wants to do. Otherwise we use the smallest
  420|       |         * value from the number requested by the record layer, and max number
  421|       |         * configured by the user.
  422|       |         */
  423|  1.64k|        if (s->max_pipelines > 0 && maxpipes > s->max_pipelines)
  ------------------
  |  Branch (423:13): [True: 0, False: 1.64k]
  |  Branch (423:37): [True: 0, False: 0]
  ------------------
  424|      0|            maxpipes = s->max_pipelines;
  425|       |
  426|  1.64k|        if (maxpipes > SSL_MAX_PIPELINES)
  ------------------
  |  |   71|  1.64k|#define SSL_MAX_PIPELINES 32
  ------------------
  |  Branch (426:13): [True: 0, False: 1.64k]
  ------------------
  427|      0|            maxpipes = SSL_MAX_PIPELINES;
  ------------------
  |  |   71|      0|#define SSL_MAX_PIPELINES 32
  ------------------
  428|       |
  429|  1.64k|        if (split_send_fragment > max_send_fragment) {
  ------------------
  |  Branch (429:13): [True: 0, False: 1.64k]
  ------------------
  430|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  431|      0|            return -1;
  432|      0|        }
  433|       |
  434|  1.64k|        if (n / maxpipes >= split_send_fragment) {
  ------------------
  |  Branch (434:13): [True: 0, False: 1.64k]
  ------------------
  435|       |            /*
  436|       |             * We have enough data to completely fill all available
  437|       |             * pipelines
  438|       |             */
  439|      0|            for (j = 0; j < maxpipes; j++) {
  ------------------
  |  Branch (439:25): [True: 0, False: 0]
  ------------------
  440|      0|                tmpls[j].type = type;
  441|      0|                tmpls[j].version = recversion;
  442|      0|                tmpls[j].buf = &(buf[tot]) + (j * split_send_fragment);
  443|      0|                tmpls[j].buflen = split_send_fragment;
  444|      0|            }
  445|       |            /* Remember how much data we are going to be sending */
  446|      0|            s->rlayer.wpend_tot = maxpipes * split_send_fragment;
  447|  1.64k|        } else {
  448|       |            /* We can partially fill all available pipelines */
  449|  1.64k|            tmppipelen = n / maxpipes;
  450|  1.64k|            remain = n % maxpipes;
  451|       |            /*
  452|       |             * If there is a remainder we add an extra byte to the first few
  453|       |             * pipelines
  454|       |             */
  455|  1.64k|            if (remain > 0)
  ------------------
  |  Branch (455:17): [True: 0, False: 1.64k]
  ------------------
  456|      0|                tmppipelen++;
  457|  3.28k|            for (j = 0; j < maxpipes; j++) {
  ------------------
  |  Branch (457:25): [True: 1.64k, False: 1.64k]
  ------------------
  458|  1.64k|                tmpls[j].type = type;
  459|  1.64k|                tmpls[j].version = recversion;
  460|  1.64k|                tmpls[j].buf = &(buf[tot]) + lensofar;
  461|  1.64k|                tmpls[j].buflen = tmppipelen;
  462|  1.64k|                lensofar += tmppipelen;
  463|  1.64k|                if (j + 1 == remain)
  ------------------
  |  Branch (463:21): [True: 0, False: 1.64k]
  ------------------
  464|      0|                    tmppipelen--;
  465|  1.64k|            }
  466|       |            /* Remember how much data we are going to be sending */
  467|  1.64k|            s->rlayer.wpend_tot = n;
  468|  1.64k|        }
  469|       |
  470|  1.64k|        i = HANDLE_RLAYER_WRITE_RETURN(s,
  ------------------
  |  |  169|  1.64k|    ossl_tls_handle_rlayer_return(s, 1, ret, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   ossl_tls_handle_rlayer_return(s, 1, ret, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  471|  1.64k|            s->rlayer.wrlmethod->write_records(s->rlayer.wrl, tmpls, maxpipes));
  472|  1.64k|        if (i <= 0) {
  ------------------
  |  Branch (472:13): [True: 0, False: 1.64k]
  ------------------
  473|       |            /* SSLfatal() already called if appropriate */
  474|      0|            s->rlayer.wnum = tot;
  475|      0|            return i;
  476|      0|        }
  477|       |
  478|  1.64k|        if (s->rlayer.wpend_tot == n
  ------------------
  |  Branch (478:13): [True: 1.64k, False: 0]
  ------------------
  479|      0|            || (type == SSL3_RT_APPLICATION_DATA
  ------------------
  |  |  222|      0|#define SSL3_RT_APPLICATION_DATA 23
  ------------------
  |  Branch (479:17): [True: 0, False: 0]
  ------------------
  480|  1.64k|                && (s->mode & SSL_MODE_ENABLE_PARTIAL_WRITE) != 0)) {
  ------------------
  |  |  497|      0|#define SSL_MODE_ENABLE_PARTIAL_WRITE 0x00000001U
  ------------------
  |  Branch (480:20): [True: 0, False: 0]
  ------------------
  481|  1.64k|            *written = tot + s->rlayer.wpend_tot;
  482|  1.64k|            s->rlayer.wpend_tot = 0;
  483|  1.64k|            return 1;
  484|  1.64k|        }
  485|       |
  486|      0|        n -= s->rlayer.wpend_tot;
  487|      0|        tot += s->rlayer.wpend_tot;
  488|      0|    }
  489|  1.64k|}
ossl_tls_handle_rlayer_return:
  493|  6.02k|{
  494|  6.02k|    SSL *ssl = SSL_CONNECTION_GET_SSL(s);
  ------------------
  |  |   27|  6.02k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
  495|       |
  496|  6.02k|    if (ret == OSSL_RECORD_RETURN_RETRY) {
  ------------------
  |  |   46|  6.02k|#define OSSL_RECORD_RETURN_RETRY 0
  ------------------
  |  Branch (496:9): [True: 310, False: 5.71k]
  ------------------
  497|    310|        s->rwstate = writing ? SSL_WRITING : SSL_READING;
  ------------------
  |  |  933|      0|#define SSL_WRITING 2
  ------------------
                      s->rwstate = writing ? SSL_WRITING : SSL_READING;
  ------------------
  |  |  934|    620|#define SSL_READING 3
  ------------------
  |  Branch (497:22): [True: 0, False: 310]
  ------------------
  498|    310|        ret = -1;
  499|  5.71k|    } else {
  500|  5.71k|        s->rwstate = SSL_NOTHING;
  ------------------
  |  |  932|  5.71k|#define SSL_NOTHING 1
  ------------------
  501|  5.71k|        if (ret == OSSL_RECORD_RETURN_EOF) {
  ------------------
  |  |   49|  5.71k|#define OSSL_RECORD_RETURN_EOF -3
  ------------------
  |  Branch (501:13): [True: 1.26k, False: 4.45k]
  ------------------
  502|  1.26k|            if (writing) {
  ------------------
  |  Branch (502:17): [True: 0, False: 1.26k]
  ------------------
  503|       |                /*
  504|       |                 * This shouldn't happen with a writing operation. We treat it
  505|       |                 * as fatal.
  506|       |                 */
  507|      0|                ERR_new();
  508|      0|                ERR_set_debug(file, line, 0);
  509|      0|                ossl_statem_fatal(s, SSL_AD_INTERNAL_ERROR,
  ------------------
  |  | 1243|      0|#define SSL_AD_INTERNAL_ERROR TLS1_AD_INTERNAL_ERROR
  |  |  ------------------
  |  |  |  |   66|      0|#define TLS1_AD_INTERNAL_ERROR 80 /* fatal */
  |  |  ------------------
  ------------------
  510|      0|                    ERR_R_INTERNAL_ERROR, NULL);
  ------------------
  |  |  355|      0|#define ERR_R_INTERNAL_ERROR (259 | ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  351|      0|#define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  238|      0|#define ERR_RFLAG_FATAL (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  511|      0|                ret = OSSL_RECORD_RETURN_FATAL;
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  512|  1.26k|            } else if ((s->options & SSL_OP_IGNORE_UNEXPECTED_EOF) != 0) {
  ------------------
  |  |  365|  1.26k|#define SSL_OP_IGNORE_UNEXPECTED_EOF SSL_OP_BIT(7)
  |  |  ------------------
  |  |  |  |  350|  1.26k|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (512:24): [True: 0, False: 1.26k]
  ------------------
  513|      0|                SSL_set_shutdown(ssl, SSL_RECEIVED_SHUTDOWN);
  ------------------
  |  |  216|      0|#define SSL_RECEIVED_SHUTDOWN 2
  ------------------
  514|      0|                s->s3.warn_alert = SSL_AD_CLOSE_NOTIFY;
  ------------------
  |  | 1209|      0|#define SSL_AD_CLOSE_NOTIFY SSL3_AD_CLOSE_NOTIFY
  |  |  ------------------
  |  |  |  |  252|      0|#define SSL3_AD_CLOSE_NOTIFY 0
  |  |  ------------------
  ------------------
  515|  1.26k|            } else {
  516|  1.26k|                ERR_new();
  517|  1.26k|                ERR_set_debug(file, line, 0);
  518|       |                /*
  519|       |                 * This reason code is part of the API and may be used by
  520|       |                 * applications for control flow decisions.
  521|       |                 */
  522|  1.26k|                ossl_statem_fatal(s, SSL_AD_DECODE_ERROR,
  ------------------
  |  | 1234|  1.26k|#define SSL_AD_DECODE_ERROR TLS1_AD_DECODE_ERROR
  |  |  ------------------
  |  |  |  |   61|  1.26k|#define TLS1_AD_DECODE_ERROR 50 /* fatal */
  |  |  ------------------
  ------------------
  523|  1.26k|                    SSL_R_UNEXPECTED_EOF_WHILE_READING, NULL);
  ------------------
  |  |  337|  1.26k|#define SSL_R_UNEXPECTED_EOF_WHILE_READING 294
  ------------------
  524|  1.26k|            }
  525|  4.45k|        } else if (ret == OSSL_RECORD_RETURN_FATAL) {
  ------------------
  |  |   48|  4.45k|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  |  Branch (525:20): [True: 168, False: 4.28k]
  ------------------
  526|    168|            int al = s->rlayer.rrlmethod->get_alert_code(s->rlayer.rrl);
  527|       |
  528|    168|            if (al != SSL_AD_NO_ALERT) {
  ------------------
  |  |   63|    168|#define SSL_AD_NO_ALERT -1
  ------------------
  |  Branch (528:17): [True: 26, False: 142]
  ------------------
  529|     26|                ERR_new();
  530|     26|                ERR_set_debug(file, line, 0);
  531|     26|                ossl_statem_fatal(s, al, SSL_R_RECORD_LAYER_FAILURE, NULL);
  ------------------
  |  |  246|     26|#define SSL_R_RECORD_LAYER_FAILURE 313
  ------------------
  532|     26|            }
  533|       |            /*
  534|       |             * else some failure but there is no alert code. We don't log an
  535|       |             * error for this. The record layer should have logged an error
  536|       |             * already or, if not, its due to some sys call error which will be
  537|       |             * reported via SSL_ERROR_SYSCALL and errno.
  538|       |             */
  539|    168|        }
  540|       |        /*
  541|       |         * The record layer distinguishes the cases of EOF, non-fatal
  542|       |         * err and retry. Upper layers do not.
  543|       |         * If we got a retry or success then *ret is already correct,
  544|       |         * otherwise we need to convert the return value.
  545|       |         */
  546|  5.71k|        if (ret == OSSL_RECORD_RETURN_NON_FATAL_ERR || ret == OSSL_RECORD_RETURN_EOF)
  ------------------
  |  |   47|  11.4k|#define OSSL_RECORD_RETURN_NON_FATAL_ERR -1
  ------------------
                      if (ret == OSSL_RECORD_RETURN_NON_FATAL_ERR || ret == OSSL_RECORD_RETURN_EOF)
  ------------------
  |  |   49|  5.71k|#define OSSL_RECORD_RETURN_EOF -3
  ------------------
  |  Branch (546:13): [True: 0, False: 5.71k]
  |  Branch (546:56): [True: 1.26k, False: 4.45k]
  ------------------
  547|  1.26k|            ret = 0;
  548|  4.45k|        else if (ret < OSSL_RECORD_RETURN_NON_FATAL_ERR)
  ------------------
  |  |   47|  4.45k|#define OSSL_RECORD_RETURN_NON_FATAL_ERR -1
  ------------------
  |  Branch (548:18): [True: 168, False: 4.28k]
  ------------------
  549|    168|            ret = -1;
  550|  5.71k|    }
  551|       |
  552|  6.02k|    return ret;
  553|  6.02k|}
ssl_release_record:
  560|    725|{
  561|    725|    assert(rr->length >= length);
  ------------------
  |  Branch (561:5): [True: 0, False: 725]
  |  Branch (561:5): [True: 725, False: 0]
  ------------------
  562|    725|    if (rr->rechandle != NULL) {
  ------------------
  |  Branch (562:9): [True: 725, False: 0]
  ------------------
  563|    725|        if (length == 0)
  ------------------
  |  Branch (563:13): [True: 250, False: 475]
  ------------------
  564|    250|            length = rr->length;
  565|       |        /* The record layer allocated the buffers for this record */
  566|    725|        if (HANDLE_RLAYER_READ_RETURN(s,
  ------------------
  |  |  166|    725|    ossl_tls_handle_rlayer_return(s, 0, ret, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   ossl_tls_handle_rlayer_return(s, 0, ret, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (566:13): [True: 0, False: 725]
  ------------------
  567|    725|                s->rlayer.rrlmethod->release_record(s->rlayer.rrl,
  568|    725|                    rr->rechandle,
  569|    725|                    length))
  570|    725|            <= 0) {
  571|       |            /* RLAYER_fatal already called */
  572|      0|            return 0;
  573|      0|        }
  574|       |
  575|    725|        if (length == rr->length)
  ------------------
  |  Branch (575:13): [True: 304, False: 421]
  ------------------
  576|    304|            s->rlayer.curr_rec++;
  577|    725|    } else if (length == 0 || length == rr->length) {
  ------------------
  |  Branch (577:16): [True: 0, False: 0]
  |  Branch (577:31): [True: 0, False: 0]
  ------------------
  578|       |        /* We allocated the buffers for this record (only happens with DTLS) */
  579|      0|        OPENSSL_free(rr->allocdata);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  580|      0|        rr->allocdata = NULL;
  581|      0|        s->rlayer.curr_rec++;
  582|      0|    }
  583|    725|    rr->length -= length;
  584|    725|    if (rr->length > 0)
  ------------------
  |  Branch (584:9): [True: 421, False: 304]
  ------------------
  585|    421|        rr->off += length;
  586|    304|    else
  587|    304|        rr->off = 0;
  588|       |
  589|    725|    return 1;
  590|    725|}
ssl3_read_bytes:
  625|  2.24k|{
  626|  2.24k|    int i, j, ret;
  627|  2.24k|    size_t n, curr_rec, totalbytes;
  628|  2.24k|    TLS_RECORD *rr;
  629|  2.24k|    void (*cb)(const SSL *ssl, int type2, int val) = NULL;
  630|  2.24k|    int is_tls13;
  631|  2.24k|    SSL_CONNECTION *s = SSL_CONNECTION_FROM_SSL_ONLY(ssl);
  ------------------
  |  |   23|  2.24k|    SSL_CONNECTION_FROM_SSL_ONLY_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   17|  2.24k|    ((ssl) == NULL ? NULL                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (17:6): [True: 0, False: 2.24k]
  |  |  |  |  ------------------
  |  |  |  |   18|  2.24k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  2.24k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:23): [True: 2.24k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   19|  2.24k|                             ? (c SSL_CONNECTION *)(ssl)     \
  |  |  |  |   20|  2.24k|                             : NULL))
  |  |  ------------------
  ------------------
  632|       |
  633|  2.24k|    is_tls13 = SSL_CONNECTION_IS_TLS13(s);
  ------------------
  |  |  265|  2.24k|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|  4.48k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  2.24k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|  2.24k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 2.24k, False: 0]
  |  |  ------------------
  |  |  266|  2.24k|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|  2.24k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|  4.48k|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 2.24k, False: 0]
  |  |  ------------------
  |  |  267|  2.24k|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|  2.24k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|  2.24k|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 2.24k]
  |  |  ------------------
  ------------------
  634|       |
  635|  2.24k|    if ((type != 0
  ------------------
  |  Branch (635:10): [True: 2.24k, False: 0]
  ------------------
  636|  2.24k|            && (type != SSL3_RT_APPLICATION_DATA)
  ------------------
  |  |  222|  2.24k|#define SSL3_RT_APPLICATION_DATA 23
  ------------------
  |  Branch (636:16): [True: 2.24k, False: 0]
  ------------------
  637|  2.24k|            && (type != SSL3_RT_HANDSHAKE))
  ------------------
  |  |  221|  2.24k|#define SSL3_RT_HANDSHAKE 22
  ------------------
  |  Branch (637:16): [True: 0, False: 2.24k]
  ------------------
  638|  2.24k|        || (peek && (type != SSL3_RT_APPLICATION_DATA))) {
  ------------------
  |  |  222|      0|#define SSL3_RT_APPLICATION_DATA 23
  ------------------
  |  Branch (638:13): [True: 0, False: 2.24k]
  |  Branch (638:21): [True: 0, False: 0]
  ------------------
  639|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  640|      0|        return -1;
  641|      0|    }
  642|       |
  643|  2.24k|    if ((type == SSL3_RT_HANDSHAKE) && (s->rlayer.handshake_fragment_len > 0))
  ------------------
  |  |  221|  2.24k|#define SSL3_RT_HANDSHAKE 22
  ------------------
  |  Branch (643:9): [True: 2.24k, False: 0]
  |  Branch (643:40): [True: 0, False: 2.24k]
  ------------------
  644|       |    /* (partially) satisfy request from storage */
  645|      0|    {
  646|      0|        unsigned char *src = s->rlayer.handshake_fragment;
  647|      0|        unsigned char *dst = buf;
  648|      0|        unsigned int k;
  649|       |
  650|       |        /* peek == 0 */
  651|      0|        n = 0;
  652|      0|        while ((len > 0) && (s->rlayer.handshake_fragment_len > 0)) {
  ------------------
  |  Branch (652:16): [True: 0, False: 0]
  |  Branch (652:29): [True: 0, False: 0]
  ------------------
  653|      0|            *dst++ = *src++;
  654|      0|            len--;
  655|      0|            s->rlayer.handshake_fragment_len--;
  656|      0|            n++;
  657|      0|        }
  658|       |        /* move any remaining fragment bytes: */
  659|      0|        for (k = 0; k < s->rlayer.handshake_fragment_len; k++)
  ------------------
  |  Branch (659:21): [True: 0, False: 0]
  ------------------
  660|      0|            s->rlayer.handshake_fragment[k] = *src++;
  661|       |
  662|      0|        if (recvd_type != NULL)
  ------------------
  |  Branch (662:13): [True: 0, False: 0]
  ------------------
  663|      0|            *recvd_type = SSL3_RT_HANDSHAKE;
  ------------------
  |  |  221|      0|#define SSL3_RT_HANDSHAKE 22
  ------------------
  664|       |
  665|      0|        *readbytes = n;
  666|      0|        return 1;
  667|      0|    }
  668|       |
  669|       |    /*
  670|       |     * Now s->rlayer.handshake_fragment_len == 0 if type == SSL3_RT_HANDSHAKE.
  671|       |     */
  672|       |
  673|  2.24k|    if (!ossl_statem_get_in_handshake(s) && SSL_in_init(ssl)) {
  ------------------
  |  Branch (673:9): [True: 0, False: 2.24k]
  |  Branch (673:45): [True: 0, False: 0]
  ------------------
  674|       |        /* type == SSL3_RT_APPLICATION_DATA */
  675|      0|        i = s->handshake_func(ssl);
  676|       |        /* SSLfatal() already called */
  677|      0|        if (i < 0)
  ------------------
  |  Branch (677:13): [True: 0, False: 0]
  ------------------
  678|      0|            return i;
  679|      0|        if (i == 0)
  ------------------
  |  Branch (679:13): [True: 0, False: 0]
  ------------------
  680|      0|            return -1;
  681|      0|    }
  682|  2.29k|start:
  683|  2.29k|    s->rwstate = SSL_NOTHING;
  ------------------
  |  |  932|  2.29k|#define SSL_NOTHING 1
  ------------------
  684|       |
  685|       |    /*-
  686|       |     * For each record 'i' up to |num_recs]
  687|       |     * rr[i].type     - is the type of record
  688|       |     * rr[i].data,    - data
  689|       |     * rr[i].off,     - offset into 'data' for next read
  690|       |     * rr[i].length,  - number of bytes.
  691|       |     */
  692|       |    /* get new records if necessary */
  693|  2.29k|    if (s->rlayer.curr_rec >= s->rlayer.num_recs) {
  ------------------
  |  Branch (693:9): [True: 2.04k, False: 246]
  ------------------
  694|  2.04k|        s->rlayer.curr_rec = s->rlayer.num_recs = 0;
  695|  2.04k|        do {
  696|  2.04k|            rr = &s->rlayer.tlsrecs[s->rlayer.num_recs];
  697|       |
  698|  2.04k|            ret = HANDLE_RLAYER_READ_RETURN(s,
  ------------------
  |  |  166|  2.04k|    ossl_tls_handle_rlayer_return(s, 0, ret, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   ossl_tls_handle_rlayer_return(s, 0, ret, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  699|  2.04k|                s->rlayer.rrlmethod->read_record(s->rlayer.rrl,
  700|  2.04k|                    &rr->rechandle,
  701|  2.04k|                    &rr->version, &rr->type,
  702|  2.04k|                    &rr->data, &rr->length,
  703|  2.04k|                    NULL, NULL));
  704|  2.04k|            if (ret <= 0) {
  ------------------
  |  Branch (704:17): [True: 1.74k, False: 304]
  ------------------
  705|       |                /* SSLfatal() already called if appropriate */
  706|  1.74k|                return ret;
  707|  1.74k|            }
  708|    304|            rr->off = 0;
  709|    304|            s->rlayer.num_recs++;
  710|    304|        } while (s->rlayer.rrlmethod->processed_read_pending(s->rlayer.rrl)
  ------------------
  |  Branch (710:18): [True: 0, False: 304]
  ------------------
  711|      0|            && s->rlayer.num_recs < SSL_MAX_PIPELINES);
  ------------------
  |  |   71|      0|#define SSL_MAX_PIPELINES 32
  ------------------
  |  Branch (711:16): [True: 0, False: 0]
  ------------------
  712|  2.04k|    }
  713|    550|    rr = &s->rlayer.tlsrecs[s->rlayer.curr_rec];
  714|       |
  715|    550|    if (s->rlayer.handshake_fragment_len > 0
  ------------------
  |  Branch (715:9): [True: 0, False: 550]
  ------------------
  716|      0|        && rr->type != SSL3_RT_HANDSHAKE
  ------------------
  |  |  221|    550|#define SSL3_RT_HANDSHAKE 22
  ------------------
  |  Branch (716:12): [True: 0, False: 0]
  ------------------
  717|      0|        && SSL_CONNECTION_IS_TLS13(s)) {
  ------------------
  |  |  265|      0|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 0, False: 0]
  |  |  ------------------
  |  |  266|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  267|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|      0|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  718|      0|        SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE,
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  719|      0|            SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA);
  720|      0|        return -1;
  721|      0|    }
  722|       |
  723|       |    /*
  724|       |     * Reset the count of consecutive warning alerts if we've got a non-empty
  725|       |     * record that isn't an alert.
  726|       |     */
  727|    550|    if (rr->type != SSL3_RT_ALERT && rr->length != 0)
  ------------------
  |  |  220|  1.10k|#define SSL3_RT_ALERT 21
  ------------------
  |  Branch (727:9): [True: 491, False: 59]
  |  Branch (727:38): [True: 480, False: 11]
  ------------------
  728|    480|        s->rlayer.alert_count = 0;
  729|       |
  730|       |    /* we now have a packet which can be read and processed */
  731|       |
  732|    550|    if (s->s3.change_cipher_spec /* set when we receive ChangeCipherSpec,
  ------------------
  |  Branch (732:9): [True: 0, False: 550]
  ------------------
  733|       |                                  * reset by ssl3_get_finished */
  734|      0|        && (rr->type != SSL3_RT_HANDSHAKE)) {
  ------------------
  |  |  221|      0|#define SSL3_RT_HANDSHAKE 22
  ------------------
  |  Branch (734:12): [True: 0, False: 0]
  ------------------
  735|      0|        SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE,
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  736|      0|            SSL_R_DATA_BETWEEN_CCS_AND_FINISHED);
  737|      0|        return -1;
  738|      0|    }
  739|       |
  740|       |    /*
  741|       |     * If the other end has shut down, throw anything we read away (even in
  742|       |     * 'peek' mode)
  743|       |     */
  744|    550|    if (s->shutdown & SSL_RECEIVED_SHUTDOWN) {
  ------------------
  |  |  216|    550|#define SSL_RECEIVED_SHUTDOWN 2
  ------------------
  |  Branch (744:9): [True: 0, False: 550]
  ------------------
  745|      0|        s->rlayer.curr_rec++;
  746|      0|        s->rwstate = SSL_NOTHING;
  ------------------
  |  |  932|      0|#define SSL_NOTHING 1
  ------------------
  747|      0|        return 0;
  748|      0|    }
  749|       |
  750|    550|    if (type == rr->type
  ------------------
  |  Branch (750:9): [True: 474, False: 76]
  ------------------
  751|     76|        || (rr->type == SSL3_RT_CHANGE_CIPHER_SPEC
  ------------------
  |  |  219|    152|#define SSL3_RT_CHANGE_CIPHER_SPEC 20
  ------------------
  |  Branch (751:13): [True: 7, False: 69]
  ------------------
  752|      7|            && type == SSL3_RT_HANDSHAKE && recvd_type != NULL
  ------------------
  |  |  221|     83|#define SSL3_RT_HANDSHAKE 22
  ------------------
  |  Branch (752:16): [True: 7, False: 0]
  |  Branch (752:45): [True: 7, False: 0]
  ------------------
  753|    481|            && !is_tls13)) {
  ------------------
  |  Branch (753:16): [True: 7, False: 0]
  ------------------
  754|       |        /*
  755|       |         * SSL3_RT_APPLICATION_DATA or
  756|       |         * SSL3_RT_HANDSHAKE or
  757|       |         * SSL3_RT_CHANGE_CIPHER_SPEC
  758|       |         */
  759|       |        /*
  760|       |         * make sure that we are not getting application data when we are
  761|       |         * doing a handshake for the first time
  762|       |         */
  763|    481|        if (SSL_in_init(ssl) && type == SSL3_RT_APPLICATION_DATA
  ------------------
  |  |  222|    962|#define SSL3_RT_APPLICATION_DATA 23
  ------------------
  |  Branch (763:13): [True: 481, False: 0]
  |  Branch (763:33): [True: 0, False: 481]
  ------------------
  764|      0|            && SSL_IS_FIRST_HANDSHAKE(s)) {
  ------------------
  |  |  277|      0|#define SSL_IS_FIRST_HANDSHAKE(s) ((s)->s3.tmp.finish_md_len == 0 \
  |  |  ------------------
  |  |  |  Branch (277:36): [True: 0, False: 0]
  |  |  ------------------
  |  |  278|      0|    || (s)->s3.tmp.peer_finish_md_len == 0)
  |  |  ------------------
  |  |  |  Branch (278:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  765|      0|            SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_APP_DATA_IN_HANDSHAKE);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  766|      0|            return -1;
  767|      0|        }
  768|       |
  769|    481|        if (type == SSL3_RT_HANDSHAKE
  ------------------
  |  |  221|    962|#define SSL3_RT_HANDSHAKE 22
  ------------------
  |  Branch (769:13): [True: 481, False: 0]
  ------------------
  770|    481|            && rr->type == SSL3_RT_CHANGE_CIPHER_SPEC
  ------------------
  |  |  219|    962|#define SSL3_RT_CHANGE_CIPHER_SPEC 20
  ------------------
  |  Branch (770:16): [True: 7, False: 474]
  ------------------
  771|      7|            && s->rlayer.handshake_fragment_len > 0) {
  ------------------
  |  Branch (771:16): [True: 0, False: 7]
  ------------------
  772|      0|            SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_CCS_RECEIVED_EARLY);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  773|      0|            return -1;
  774|      0|        }
  775|       |
  776|    481|        if (recvd_type != NULL)
  ------------------
  |  Branch (776:13): [True: 297, False: 184]
  ------------------
  777|    297|            *recvd_type = rr->type;
  778|       |
  779|    481|        if (len == 0) {
  ------------------
  |  Branch (779:13): [True: 0, False: 481]
  ------------------
  780|       |            /*
  781|       |             * Skip a zero length record. This ensures multiple calls to
  782|       |             * SSL_read() with a zero length buffer will eventually cause
  783|       |             * SSL_pending() to report data as being available.
  784|       |             */
  785|      0|            if (rr->length == 0 && !ssl_release_record(s, rr, 0))
  ------------------
  |  Branch (785:17): [True: 0, False: 0]
  |  Branch (785:36): [True: 0, False: 0]
  ------------------
  786|      0|                return -1;
  787|       |
  788|      0|            return 0;
  789|      0|        }
  790|       |
  791|    481|        totalbytes = 0;
  792|    481|        curr_rec = s->rlayer.curr_rec;
  793|    481|        do {
  794|    481|            if (len - totalbytes > rr->length)
  ------------------
  |  Branch (794:17): [True: 59, False: 422]
  ------------------
  795|     59|                n = rr->length;
  796|    422|            else
  797|    422|                n = len - totalbytes;
  798|       |
  799|    481|            memcpy(buf, &(rr->data[rr->off]), n);
  800|    481|            buf += n;
  801|    481|            if (peek) {
  ------------------
  |  Branch (801:17): [True: 0, False: 481]
  ------------------
  802|       |                /* Mark any zero length record as consumed CVE-2016-6305 */
  803|      0|                if (rr->length == 0 && !ssl_release_record(s, rr, 0))
  ------------------
  |  Branch (803:21): [True: 0, False: 0]
  |  Branch (803:40): [True: 0, False: 0]
  ------------------
  804|      0|                    return -1;
  805|    481|            } else {
  806|    481|                if (!ssl_release_record(s, rr, n))
  ------------------
  |  Branch (806:21): [True: 0, False: 481]
  ------------------
  807|      0|                    return -1;
  808|    481|            }
  809|    481|            if (rr->length == 0
  ------------------
  |  Branch (809:17): [True: 60, False: 421]
  ------------------
  810|    421|                || (peek && n == rr->length)) {
  ------------------
  |  Branch (810:21): [True: 0, False: 421]
  |  Branch (810:29): [True: 0, False: 0]
  ------------------
  811|     60|                rr++;
  812|     60|                curr_rec++;
  813|     60|            }
  814|    481|            totalbytes += n;
  815|    481|        } while (type == SSL3_RT_APPLICATION_DATA
  ------------------
  |  |  222|    962|#define SSL3_RT_APPLICATION_DATA 23
  ------------------
  |  Branch (815:18): [True: 0, False: 481]
  ------------------
  816|      0|            && curr_rec < s->rlayer.num_recs
  ------------------
  |  Branch (816:16): [True: 0, False: 0]
  ------------------
  817|      0|            && totalbytes < len);
  ------------------
  |  Branch (817:16): [True: 0, False: 0]
  ------------------
  818|    481|        if (totalbytes == 0) {
  ------------------
  |  Branch (818:13): [True: 6, False: 475]
  ------------------
  819|       |            /* We must have read empty records. Get more data */
  820|      6|            goto start;
  821|      6|        }
  822|    475|        *readbytes = totalbytes;
  823|    475|        return 1;
  824|    481|    }
  825|       |
  826|       |    /*
  827|       |     * If we get here, then type != rr->type; if we have a handshake message,
  828|       |     * then it was unexpected (Hello Request or Client Hello) or invalid (we
  829|       |     * were actually expecting a CCS).
  830|       |     */
  831|       |
  832|       |    /*
  833|       |     * Lets just double check that we've not got an SSLv2 record
  834|       |     */
  835|     69|    if (rr->version == SSL2_VERSION) {
  ------------------
  |  |   23|     69|#define SSL2_VERSION 0x0002
  ------------------
  |  Branch (835:9): [True: 0, False: 69]
  ------------------
  836|       |        /*
  837|       |         * Should never happen. ssl3_get_record() should only give us an SSLv2
  838|       |         * record back if this is the first packet and we are looking for an
  839|       |         * initial ClientHello. Therefore |type| should always be equal to
  840|       |         * |rr->type|. If not then something has gone horribly wrong
  841|       |         */
  842|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  843|      0|        return -1;
  844|      0|    }
  845|       |
  846|     69|    if (ssl->method->version == TLS_ANY_VERSION
  ------------------
  |  |   40|    138|#define TLS_ANY_VERSION 0x10000
  ------------------
  |  Branch (846:9): [True: 69, False: 0]
  ------------------
  847|     69|        && (s->server || rr->type != SSL3_RT_ALERT)) {
  ------------------
  |  |  220|     69|#define SSL3_RT_ALERT 21
  ------------------
  |  Branch (847:13): [True: 0, False: 69]
  |  Branch (847:26): [True: 10, False: 59]
  ------------------
  848|       |        /*
  849|       |         * If we've got this far and still haven't decided on what version
  850|       |         * we're using then this must be a client side alert we're dealing
  851|       |         * with. We shouldn't be receiving anything other than a ClientHello
  852|       |         * if we are a server.
  853|       |         */
  854|     10|        s->version = rr->version;
  855|     10|        SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_UNEXPECTED_MESSAGE);
  ------------------
  |  |  148|     10|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|     10|    (ERR_new(),                                                  \
  |  |  |  |  151|     10|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|     10|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|     10|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  856|     10|        return -1;
  857|     10|    }
  858|       |
  859|       |    /*-
  860|       |     * s->rlayer.handshake_fragment_len == 4  iff  rr->type == SSL3_RT_HANDSHAKE;
  861|       |     * (Possibly rr is 'empty' now, i.e. rr->length may be 0.)
  862|       |     */
  863|       |
  864|     59|    if (rr->type == SSL3_RT_ALERT) {
  ------------------
  |  |  220|     59|#define SSL3_RT_ALERT 21
  ------------------
  |  Branch (864:9): [True: 59, False: 0]
  ------------------
  865|     59|        unsigned int alert_level, alert_descr;
  866|     59|        const unsigned char *alert_bytes = rr->data + rr->off;
  867|     59|        PACKET alert;
  868|       |
  869|     59|        if (!PACKET_buf_init(&alert, alert_bytes, rr->length)
  ------------------
  |  Branch (869:13): [True: 0, False: 59]
  ------------------
  870|     59|            || !PACKET_get_1(&alert, &alert_level)
  ------------------
  |  Branch (870:16): [True: 1, False: 58]
  ------------------
  871|     58|            || !PACKET_get_1(&alert, &alert_descr)
  ------------------
  |  Branch (871:16): [True: 2, False: 56]
  ------------------
  872|     56|            || PACKET_remaining(&alert) != 0) {
  ------------------
  |  Branch (872:16): [True: 1, False: 55]
  ------------------
  873|      4|            SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_INVALID_ALERT);
  ------------------
  |  |  148|      4|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      4|    (ERR_new(),                                                  \
  |  |  |  |  151|      4|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      4|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      4|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  874|      4|            return -1;
  875|      4|        }
  876|       |
  877|     55|        if (s->msg_callback)
  ------------------
  |  Branch (877:13): [True: 0, False: 55]
  ------------------
  878|      0|            s->msg_callback(0, s->version, SSL3_RT_ALERT, alert_bytes, 2, ssl,
  ------------------
  |  |  220|      0|#define SSL3_RT_ALERT 21
  ------------------
  879|      0|                s->msg_callback_arg);
  880|       |
  881|     55|        if (s->info_callback != NULL)
  ------------------
  |  Branch (881:13): [True: 0, False: 55]
  ------------------
  882|      0|            cb = s->info_callback;
  883|     55|        else if (ssl->ctx->info_callback != NULL)
  ------------------
  |  Branch (883:18): [True: 0, False: 55]
  ------------------
  884|      0|            cb = ssl->ctx->info_callback;
  885|       |
  886|     55|        if (cb != NULL) {
  ------------------
  |  Branch (886:13): [True: 0, False: 55]
  ------------------
  887|      0|            j = (alert_level << 8) | alert_descr;
  888|      0|            cb(ssl, SSL_CB_READ_ALERT, j);
  ------------------
  |  | 1140|      0|#define SSL_CB_READ_ALERT (SSL_CB_ALERT | SSL_CB_READ)
  |  |  ------------------
  |  |  |  | 1139|      0|#define SSL_CB_ALERT 0x4000 /* used in callback */
  |  |  ------------------
  |  |               #define SSL_CB_READ_ALERT (SSL_CB_ALERT | SSL_CB_READ)
  |  |  ------------------
  |  |  |  | 1137|      0|#define SSL_CB_READ 0x04
  |  |  ------------------
  ------------------
  889|      0|        }
  890|       |
  891|     55|        if ((!is_tls13 && alert_level == SSL3_AL_WARNING)
  ------------------
  |  |  249|     55|#define SSL3_AL_WARNING 1
  ------------------
  |  Branch (891:14): [True: 55, False: 0]
  |  Branch (891:27): [True: 48, False: 7]
  ------------------
  892|     48|            || (is_tls13 && alert_descr == SSL_AD_USER_CANCELLED)) {
  ------------------
  |  | 1244|      0|#define SSL_AD_USER_CANCELLED TLS1_AD_USER_CANCELLED
  |  |  ------------------
  |  |  |  |   68|      0|#define TLS1_AD_USER_CANCELLED 90
  |  |  ------------------
  ------------------
  |  Branch (892:17): [True: 0, False: 7]
  |  Branch (892:29): [True: 0, False: 0]
  ------------------
  893|     48|            s->s3.warn_alert = alert_descr;
  894|     48|            if (!ssl_release_record(s, rr, 0))
  ------------------
  |  Branch (894:17): [True: 0, False: 48]
  ------------------
  895|      0|                return -1;
  896|       |
  897|     48|            s->rlayer.alert_count++;
  898|     48|            if (s->rlayer.alert_count == MAX_WARN_ALERT_COUNT) {
  ------------------
  |  |   17|     48|#define MAX_WARN_ALERT_COUNT 5
  ------------------
  |  Branch (898:17): [True: 1, False: 47]
  ------------------
  899|      1|                SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE,
  ------------------
  |  |  148|      1|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      1|    (ERR_new(),                                                  \
  |  |  |  |  151|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      1|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  900|      1|                    SSL_R_TOO_MANY_WARN_ALERTS);
  901|      1|                return -1;
  902|      1|            }
  903|     48|        }
  904|       |
  905|       |        /*
  906|       |         * Apart from close_notify the only other warning alert in TLSv1.3
  907|       |         * is user_cancelled - which we just ignore.
  908|       |         */
  909|     54|        if (is_tls13 && alert_descr == SSL_AD_USER_CANCELLED) {
  ------------------
  |  | 1244|      0|#define SSL_AD_USER_CANCELLED TLS1_AD_USER_CANCELLED
  |  |  ------------------
  |  |  |  |   68|      0|#define TLS1_AD_USER_CANCELLED 90
  |  |  ------------------
  ------------------
  |  Branch (909:13): [True: 0, False: 54]
  |  Branch (909:25): [True: 0, False: 0]
  ------------------
  910|      0|            goto start;
  911|     54|        } else if (alert_descr == SSL_AD_CLOSE_NOTIFY
  ------------------
  |  | 1209|     54|#define SSL_AD_CLOSE_NOTIFY SSL3_AD_CLOSE_NOTIFY
  |  |  ------------------
  |  |  |  |  252|    108|#define SSL3_AD_CLOSE_NOTIFY 0
  |  |  ------------------
  ------------------
  |  Branch (911:20): [True: 4, False: 50]
  ------------------
  912|      4|            && (is_tls13 || alert_level == SSL3_AL_WARNING)) {
  ------------------
  |  |  249|      4|#define SSL3_AL_WARNING 1
  ------------------
  |  Branch (912:17): [True: 0, False: 4]
  |  Branch (912:29): [True: 3, False: 1]
  ------------------
  913|      3|            s->shutdown |= SSL_RECEIVED_SHUTDOWN;
  ------------------
  |  |  216|      3|#define SSL_RECEIVED_SHUTDOWN 2
  ------------------
  914|      3|            return 0;
  915|     51|        } else if (alert_level == SSL3_AL_FATAL || is_tls13) {
  ------------------
  |  |  250|    102|#define SSL3_AL_FATAL 2
  ------------------
  |  Branch (915:20): [True: 6, False: 45]
  |  Branch (915:52): [True: 0, False: 45]
  ------------------
  916|      6|            s->rwstate = SSL_NOTHING;
  ------------------
  |  |  932|      6|#define SSL_NOTHING 1
  ------------------
  917|      6|            s->s3.fatal_alert = alert_descr;
  918|      6|            SSLfatal_data(s, SSL_AD_NO_ALERT,
  ------------------
  |  |  150|      6|    (ERR_new(),                                                  \
  |  |  151|      6|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      6|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  152|      6|        ossl_statem_fatal)
  ------------------
                          SSLfatal_data(s, SSL_AD_NO_ALERT,
  ------------------
  |  |   63|      6|#define SSL_AD_NO_ALERT -1
  ------------------
  919|      6|                SSL_AD_REASON_OFFSET + alert_descr,
  ------------------
  |  | 1206|      6|#define SSL_AD_REASON_OFFSET 1000 /* offset to get SSL_R_... value \
  ------------------
  920|      6|                "SSL alert number %d", alert_descr);
  921|      6|            s->shutdown |= SSL_RECEIVED_SHUTDOWN;
  ------------------
  |  |  216|      6|#define SSL_RECEIVED_SHUTDOWN 2
  ------------------
  922|      6|            if (!ssl_release_record(s, rr, 0))
  ------------------
  |  Branch (922:17): [True: 0, False: 6]
  ------------------
  923|      0|                return -1;
  924|      6|            SSL_CTX_remove_session(s->session_ctx, s->session);
  925|      6|            return 0;
  926|     45|        } else if (alert_descr == SSL_AD_NO_RENEGOTIATION) {
  ------------------
  |  | 1245|     45|#define SSL_AD_NO_RENEGOTIATION TLS1_AD_NO_RENEGOTIATION
  |  |  ------------------
  |  |  |  |   69|     45|#define TLS1_AD_NO_RENEGOTIATION 100
  |  |  ------------------
  ------------------
  |  Branch (926:20): [True: 1, False: 44]
  ------------------
  927|       |            /*
  928|       |             * This is a warning but we receive it if we requested
  929|       |             * renegotiation and the peer denied it. Terminate with a fatal
  930|       |             * alert because if the application tried to renegotiate it
  931|       |             * presumably had a good reason and expects it to succeed. In
  932|       |             * the future we might have a renegotiation where we don't care
  933|       |             * if the peer refused it where we carry on.
  934|       |             */
  935|      1|            SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE, SSL_R_NO_RENEGOTIATION);
  ------------------
  |  |  148|      1|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      1|    (ERR_new(),                                                  \
  |  |  |  |  151|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      1|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  936|      1|            return -1;
  937|     44|        } else if (alert_level == SSL3_AL_WARNING) {
  ------------------
  |  |  249|     44|#define SSL3_AL_WARNING 1
  ------------------
  |  Branch (937:20): [True: 43, False: 1]
  ------------------
  938|       |            /* We ignore any other warning alert in TLSv1.2 and below */
  939|     43|            goto start;
  940|     43|        }
  941|       |
  942|     54|        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_UNKNOWN_ALERT_TYPE);
  ------------------
  |  |  148|      1|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      1|    (ERR_new(),                                                  \
  |  |  |  |  151|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      1|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  943|      1|        return -1;
  944|     54|    }
  945|       |
  946|      0|    if ((s->shutdown & SSL_SENT_SHUTDOWN) != 0) {
  ------------------
  |  |  215|      0|#define SSL_SENT_SHUTDOWN 1
  ------------------
  |  Branch (946:9): [True: 0, False: 0]
  ------------------
  947|      0|        if (rr->type == SSL3_RT_HANDSHAKE) {
  ------------------
  |  |  221|      0|#define SSL3_RT_HANDSHAKE 22
  ------------------
  |  Branch (947:13): [True: 0, False: 0]
  ------------------
  948|      0|            BIO *rbio;
  949|       |
  950|       |            /*
  951|       |             * We ignore any handshake messages sent to us unless they are
  952|       |             * TLSv1.3 in which case we want to process them. For all other
  953|       |             * handshake messages we can't do anything reasonable with them
  954|       |             * because we are unable to write any response due to having already
  955|       |             * sent close_notify.
  956|       |             */
  957|      0|            if (!SSL_CONNECTION_IS_TLS13(s)) {
  ------------------
  |  |  265|      0|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 0, False: 0]
  |  |  ------------------
  |  |  266|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  267|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|      0|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  958|      0|                if (!ssl_release_record(s, rr, 0))
  ------------------
  |  Branch (958:21): [True: 0, False: 0]
  ------------------
  959|      0|                    return -1;
  960|       |
  961|      0|                if ((s->mode & SSL_MODE_AUTO_RETRY) != 0)
  ------------------
  |  |  508|      0|#define SSL_MODE_AUTO_RETRY 0x00000004U
  ------------------
  |  Branch (961:21): [True: 0, False: 0]
  ------------------
  962|      0|                    goto start;
  963|       |
  964|      0|                s->rwstate = SSL_READING;
  ------------------
  |  |  934|      0|#define SSL_READING 3
  ------------------
  965|      0|                rbio = SSL_get_rbio(ssl);
  966|      0|                BIO_clear_retry_flags(rbio);
  ------------------
  |  |  263|      0|    BIO_clear_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  225|      0|#define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|      0|#define BIO_FLAGS_READ 0x01
  |  |  |  |  ------------------
  |  |  |  |               #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  223|      0|#define BIO_FLAGS_WRITE 0x02
  |  |  |  |  ------------------
  |  |  |  |               #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  224|      0|#define BIO_FLAGS_IO_SPECIAL 0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   BIO_clear_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  226|      0|#define BIO_FLAGS_SHOULD_RETRY 0x08
  |  |  ------------------
  ------------------
  967|      0|                BIO_set_retry_read(rbio);
  ------------------
  |  |  257|      0|    BIO_set_flags(b, (BIO_FLAGS_READ | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  222|      0|#define BIO_FLAGS_READ 0x01
  |  |  ------------------
  |  |                   BIO_set_flags(b, (BIO_FLAGS_READ | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  226|      0|#define BIO_FLAGS_SHOULD_RETRY 0x08
  |  |  ------------------
  ------------------
  968|      0|                return -1;
  969|      0|            }
  970|      0|        } else {
  971|       |            /*
  972|       |             * The peer is continuing to send application data, but we have
  973|       |             * already sent close_notify. If this was expected we should have
  974|       |             * been called via SSL_read() and this would have been handled
  975|       |             * above.
  976|       |             * No alert sent because we already sent close_notify
  977|       |             */
  978|      0|            if (!ssl_release_record(s, rr, 0))
  ------------------
  |  Branch (978:17): [True: 0, False: 0]
  ------------------
  979|      0|                return -1;
  980|      0|            SSLfatal(s, SSL_AD_NO_ALERT,
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  981|      0|                SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY);
  982|      0|            return -1;
  983|      0|        }
  984|      0|    }
  985|       |
  986|       |    /*
  987|       |     * For handshake data we have 'fragment' storage, so fill that so that we
  988|       |     * can process the header at a fixed place. This is done after the
  989|       |     * "SHUTDOWN" code above to avoid filling the fragment storage with data
  990|       |     * that we're just going to discard.
  991|       |     */
  992|      0|    if (rr->type == SSL3_RT_HANDSHAKE) {
  ------------------
  |  |  221|      0|#define SSL3_RT_HANDSHAKE 22
  ------------------
  |  Branch (992:9): [True: 0, False: 0]
  ------------------
  993|      0|        size_t dest_maxlen = sizeof(s->rlayer.handshake_fragment);
  994|      0|        unsigned char *dest = s->rlayer.handshake_fragment;
  995|      0|        size_t *dest_len = &s->rlayer.handshake_fragment_len;
  996|       |
  997|      0|        n = dest_maxlen - *dest_len; /* available space in 'dest' */
  998|      0|        if (rr->length < n)
  ------------------
  |  Branch (998:13): [True: 0, False: 0]
  ------------------
  999|      0|            n = rr->length; /* available bytes */
 1000|       |
 1001|       |        /* now move 'n' bytes: */
 1002|      0|        if (n > 0) {
  ------------------
  |  Branch (1002:13): [True: 0, False: 0]
  ------------------
 1003|      0|            memcpy(dest + *dest_len, rr->data + rr->off, n);
 1004|      0|            *dest_len += n;
 1005|      0|        }
 1006|       |        /*
 1007|       |         * We release the number of bytes consumed, or the whole record if it
 1008|       |         * is zero length
 1009|       |         */
 1010|      0|        if ((n > 0 || rr->length == 0) && !ssl_release_record(s, rr, n))
  ------------------
  |  Branch (1010:14): [True: 0, False: 0]
  |  Branch (1010:23): [True: 0, False: 0]
  |  Branch (1010:43): [True: 0, False: 0]
  ------------------
 1011|      0|            return -1;
 1012|       |
 1013|      0|        if (*dest_len < dest_maxlen)
  ------------------
  |  Branch (1013:13): [True: 0, False: 0]
  ------------------
 1014|      0|            goto start; /* fragment was too small */
 1015|      0|    }
 1016|       |
 1017|      0|    if (rr->type == SSL3_RT_CHANGE_CIPHER_SPEC) {
  ------------------
  |  |  219|      0|#define SSL3_RT_CHANGE_CIPHER_SPEC 20
  ------------------
  |  Branch (1017:9): [True: 0, False: 0]
  ------------------
 1018|      0|        SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_CCS_RECEIVED_EARLY);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1019|      0|        return -1;
 1020|      0|    }
 1021|       |
 1022|       |    /*
 1023|       |     * Unexpected handshake message (ClientHello, NewSessionTicket (TLS1.3) or
 1024|       |     * protocol violation)
 1025|       |     */
 1026|      0|    if ((s->rlayer.handshake_fragment_len >= 4)
  ------------------
  |  Branch (1026:9): [True: 0, False: 0]
  ------------------
 1027|      0|        && !ossl_statem_get_in_handshake(s)) {
  ------------------
  |  Branch (1027:12): [True: 0, False: 0]
  ------------------
 1028|      0|        int ined = (s->early_data_state == SSL_EARLY_DATA_READING);
 1029|       |
 1030|       |        /* We found handshake data, so we're going back into init */
 1031|      0|        ossl_statem_set_in_init(s, 1);
 1032|       |
 1033|      0|        i = s->handshake_func(ssl);
 1034|       |        /* SSLfatal() already called if appropriate */
 1035|      0|        if (i < 0)
  ------------------
  |  Branch (1035:13): [True: 0, False: 0]
  ------------------
 1036|      0|            return i;
 1037|      0|        if (i == 0) {
  ------------------
  |  Branch (1037:13): [True: 0, False: 0]
  ------------------
 1038|      0|            return -1;
 1039|      0|        }
 1040|       |
 1041|       |        /*
 1042|       |         * If we were actually trying to read early data and we found a
 1043|       |         * handshake message, then we don't want to continue to try and read
 1044|       |         * the application data any more. It won't be "early" now.
 1045|       |         */
 1046|      0|        if (ined)
  ------------------
  |  Branch (1046:13): [True: 0, False: 0]
  ------------------
 1047|      0|            return -1;
 1048|       |
 1049|      0|        if (!(s->mode & SSL_MODE_AUTO_RETRY)) {
  ------------------
  |  |  508|      0|#define SSL_MODE_AUTO_RETRY 0x00000004U
  ------------------
  |  Branch (1049:13): [True: 0, False: 0]
  ------------------
 1050|      0|            if (!RECORD_LAYER_read_pending(&s->rlayer)) {
  ------------------
  |  Branch (1050:17): [True: 0, False: 0]
  ------------------
 1051|      0|                BIO *bio;
 1052|       |                /*
 1053|       |                 * In the case where we try to read application data, but we
 1054|       |                 * trigger an SSL handshake, we return -1 with the retry
 1055|       |                 * option set.  Otherwise renegotiation may cause nasty
 1056|       |                 * problems in the blocking world
 1057|       |                 */
 1058|      0|                s->rwstate = SSL_READING;
  ------------------
  |  |  934|      0|#define SSL_READING 3
  ------------------
 1059|      0|                bio = SSL_get_rbio(ssl);
 1060|      0|                BIO_clear_retry_flags(bio);
  ------------------
  |  |  263|      0|    BIO_clear_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  225|      0|#define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|      0|#define BIO_FLAGS_READ 0x01
  |  |  |  |  ------------------
  |  |  |  |               #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  223|      0|#define BIO_FLAGS_WRITE 0x02
  |  |  |  |  ------------------
  |  |  |  |               #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  224|      0|#define BIO_FLAGS_IO_SPECIAL 0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   BIO_clear_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  226|      0|#define BIO_FLAGS_SHOULD_RETRY 0x08
  |  |  ------------------
  ------------------
 1061|      0|                BIO_set_retry_read(bio);
  ------------------
  |  |  257|      0|    BIO_set_flags(b, (BIO_FLAGS_READ | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  222|      0|#define BIO_FLAGS_READ 0x01
  |  |  ------------------
  |  |                   BIO_set_flags(b, (BIO_FLAGS_READ | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  226|      0|#define BIO_FLAGS_SHOULD_RETRY 0x08
  |  |  ------------------
  ------------------
 1062|      0|                return -1;
 1063|      0|            }
 1064|      0|        }
 1065|      0|        goto start;
 1066|      0|    }
 1067|       |
 1068|      0|    switch (rr->type) {
 1069|      0|    default:
  ------------------
  |  Branch (1069:5): [True: 0, False: 0]
  ------------------
 1070|       |        /*
 1071|       |         * TLS 1.0 and 1.1 say you SHOULD ignore unrecognised record types, but
 1072|       |         * TLS 1.2 says you MUST send an unexpected message alert. We use the
 1073|       |         * TLS 1.2 behaviour for all protocol versions to prevent issues where
 1074|       |         * no progress is being made and the peer continually sends unrecognised
 1075|       |         * record types, using up resources processing them.
 1076|       |         */
 1077|      0|        SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_UNEXPECTED_RECORD);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1078|      0|        return -1;
 1079|      0|    case SSL3_RT_CHANGE_CIPHER_SPEC:
  ------------------
  |  |  219|      0|#define SSL3_RT_CHANGE_CIPHER_SPEC 20
  ------------------
  |  Branch (1079:5): [True: 0, False: 0]
  ------------------
 1080|      0|    case SSL3_RT_ALERT:
  ------------------
  |  |  220|      0|#define SSL3_RT_ALERT 21
  ------------------
  |  Branch (1080:5): [True: 0, False: 0]
  ------------------
 1081|      0|    case SSL3_RT_HANDSHAKE:
  ------------------
  |  |  221|      0|#define SSL3_RT_HANDSHAKE 22
  ------------------
  |  Branch (1081:5): [True: 0, False: 0]
  ------------------
 1082|       |        /*
 1083|       |         * we already handled all of these, with the possible exception of
 1084|       |         * SSL3_RT_HANDSHAKE when ossl_statem_get_in_handshake(s) is true, but
 1085|       |         * that should not happen when type != rr->type
 1086|       |         */
 1087|      0|        SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1088|      0|        return -1;
 1089|      0|    case SSL3_RT_APPLICATION_DATA:
  ------------------
  |  |  222|      0|#define SSL3_RT_APPLICATION_DATA 23
  ------------------
  |  Branch (1089:5): [True: 0, False: 0]
  ------------------
 1090|       |        /*
 1091|       |         * At this point, we were expecting handshake data, but have
 1092|       |         * application data.  If the library was running inside ssl3_read()
 1093|       |         * (i.e. in_read_app_data is set) and it makes sense to read
 1094|       |         * application data at this point (session renegotiation not yet
 1095|       |         * started), we will indulge it.
 1096|       |         */
 1097|      0|        if (ossl_statem_app_data_allowed(s)) {
  ------------------
  |  Branch (1097:13): [True: 0, False: 0]
  ------------------
 1098|      0|            s->s3.in_read_app_data = 2;
 1099|      0|            return -1;
 1100|      0|        } else if (ossl_statem_skip_early_data(s)) {
  ------------------
  |  Branch (1100:20): [True: 0, False: 0]
  ------------------
 1101|       |            /*
 1102|       |             * This can happen after a client sends a CH followed by early_data,
 1103|       |             * but the server responds with a HelloRetryRequest. The server
 1104|       |             * reads the next record from the client expecting to find a
 1105|       |             * plaintext ClientHello but gets a record which appears to be
 1106|       |             * application data. The trial decrypt "works" because null
 1107|       |             * decryption was applied. We just skip it and move on to the next
 1108|       |             * record.
 1109|       |             */
 1110|      0|            if (!ossl_early_data_count_ok(s, rr->length,
  ------------------
  |  Branch (1110:17): [True: 0, False: 0]
  ------------------
 1111|      0|                    EARLY_DATA_CIPHERTEXT_OVERHEAD, 0)) {
  ------------------
  |  |  616|      0|#define EARLY_DATA_CIPHERTEXT_OVERHEAD ((6 * (EVP_GCM_TLS_TAG_LEN + 1)) + 2)
  |  |  ------------------
  |  |  |  |  476|      0|#define EVP_GCM_TLS_TAG_LEN 16
  |  |  ------------------
  ------------------
 1112|       |                /* SSLfatal() already called */
 1113|      0|                return -1;
 1114|      0|            }
 1115|      0|            if (!ssl_release_record(s, rr, 0))
  ------------------
  |  Branch (1115:17): [True: 0, False: 0]
  ------------------
 1116|      0|                return -1;
 1117|      0|            goto start;
 1118|      0|        } else {
 1119|       |            SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_UNEXPECTED_RECORD);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1120|      0|            return -1;
 1121|      0|        }
 1122|      0|    }
 1123|      0|}
RECORD_LAYER_is_sslv2_record:
 1130|    359|{
 1131|    359|    if (SSL_CONNECTION_IS_DTLS(rl->s))
  ------------------
  |  |  258|    359|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|    359|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|    359|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 359]
  |  |  ------------------
  ------------------
 1132|      0|        return 0;
 1133|    359|    return rl->tlsrecs[0].version == SSL2_VERSION;
  ------------------
  |  |   23|    359|#define SSL2_VERSION 0x0002
  ------------------
 1134|    359|}
ssl_set_new_record_layer:
 1252|  10.6k|{
 1253|  10.6k|    OSSL_PARAM options[5], *opts = options;
 1254|  10.6k|    OSSL_PARAM settings[6], *set = settings;
 1255|  10.6k|    const OSSL_RECORD_METHOD **thismethod;
 1256|  10.6k|    OSSL_RECORD_LAYER **thisrl, *newrl = NULL;
 1257|  10.6k|    BIO *thisbio;
 1258|  10.6k|    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
  ------------------
  |  |   26|  10.6k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
 1259|  10.6k|    const OSSL_RECORD_METHOD *meth;
 1260|  10.6k|    int use_etm, stream_mac = 0, tlstree = 0;
 1261|  10.6k|    unsigned int maxfrag = (direction == OSSL_RECORD_DIRECTION_WRITE)
  ------------------
  |  |   43|  10.6k|#define OSSL_RECORD_DIRECTION_WRITE 1
  ------------------
  |  Branch (1261:28): [True: 5.31k, False: 5.31k]
  ------------------
 1262|  10.6k|        ? ssl_get_max_send_fragment(s)
 1263|  10.6k|        : SSL3_RT_MAX_PLAIN_LENGTH;
  ------------------
  |  |  177|  5.31k|#define SSL3_RT_MAX_PLAIN_LENGTH 16384
  ------------------
 1264|  10.6k|    int use_early_data = 0;
 1265|  10.6k|    uint32_t max_early_data;
 1266|  10.6k|    COMP_METHOD *compm = (comp == NULL) ? NULL : comp->method;
  ------------------
  |  Branch (1266:26): [True: 10.6k, False: 0]
  ------------------
 1267|       |
 1268|  10.6k|    meth = ssl_select_next_record_layer(s, direction, level);
 1269|       |
 1270|  10.6k|    if (direction == OSSL_RECORD_DIRECTION_READ) {
  ------------------
  |  |   42|  10.6k|#define OSSL_RECORD_DIRECTION_READ 0
  ------------------
  |  Branch (1270:9): [True: 5.31k, False: 5.31k]
  ------------------
 1271|  5.31k|        thismethod = &s->rlayer.rrlmethod;
 1272|  5.31k|        thisrl = &s->rlayer.rrl;
 1273|  5.31k|        thisbio = s->rbio;
 1274|  5.31k|    } else {
 1275|  5.31k|        thismethod = &s->rlayer.wrlmethod;
 1276|  5.31k|        thisrl = &s->rlayer.wrl;
 1277|  5.31k|        thisbio = s->wbio;
 1278|  5.31k|    }
 1279|       |
 1280|  10.6k|    if (meth == NULL)
  ------------------
  |  Branch (1280:9): [True: 0, False: 10.6k]
  ------------------
 1281|      0|        meth = *thismethod;
 1282|       |
 1283|  10.6k|    if (!ossl_assert(meth != NULL)) {
  ------------------
  |  |   52|  10.6k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  10.6k|    __FILE__, __LINE__)
  ------------------
  |  Branch (1283:9): [True: 0, False: 10.6k]
  ------------------
 1284|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1285|      0|        return 0;
 1286|      0|    }
 1287|       |
 1288|       |    /* Parameters that *may* be supported by a record layer if passed */
 1289|  10.6k|    *opts++ = OSSL_PARAM_construct_uint64(OSSL_LIBSSL_RECORD_LAYER_PARAM_OPTIONS,
  ------------------
  |  |  332|  10.6k|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_OPTIONS "options"
  ------------------
 1290|  10.6k|        &s->options);
 1291|  10.6k|    *opts++ = OSSL_PARAM_construct_uint32(OSSL_LIBSSL_RECORD_LAYER_PARAM_MODE,
  ------------------
  |  |  331|  10.6k|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_MODE "mode"
  ------------------
 1292|  10.6k|        &s->mode);
 1293|  10.6k|    if (direction == OSSL_RECORD_DIRECTION_READ) {
  ------------------
  |  |   42|  10.6k|#define OSSL_RECORD_DIRECTION_READ 0
  ------------------
  |  Branch (1293:9): [True: 5.31k, False: 5.31k]
  ------------------
 1294|  5.31k|        *opts++ = OSSL_PARAM_construct_size_t(OSSL_LIBSSL_RECORD_LAYER_READ_BUFFER_LEN,
  ------------------
  |  |  337|  5.31k|# define OSSL_LIBSSL_RECORD_LAYER_READ_BUFFER_LEN "read_buffer_len"
  ------------------
 1295|  5.31k|            &s->rlayer.default_read_buf_len);
 1296|  5.31k|        *opts++ = OSSL_PARAM_construct_int(OSSL_LIBSSL_RECORD_LAYER_PARAM_READ_AHEAD,
  ------------------
  |  |  333|  5.31k|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_READ_AHEAD "read_ahead"
  ------------------
 1297|  5.31k|            &s->rlayer.read_ahead);
 1298|  5.31k|    } else {
 1299|  5.31k|        *opts++ = OSSL_PARAM_construct_size_t(OSSL_LIBSSL_RECORD_LAYER_PARAM_BLOCK_PADDING,
  ------------------
  |  |  327|  5.31k|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_BLOCK_PADDING "block_padding"
  ------------------
 1300|  5.31k|            &s->rlayer.block_padding);
 1301|  5.31k|        *opts++ = OSSL_PARAM_construct_size_t(OSSL_LIBSSL_RECORD_LAYER_PARAM_HS_PADDING,
  ------------------
  |  |  328|  5.31k|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_HS_PADDING "hs_padding"
  ------------------
 1302|  5.31k|            &s->rlayer.hs_padding);
 1303|  5.31k|    }
 1304|  10.6k|    *opts = OSSL_PARAM_construct_end();
 1305|       |
 1306|       |    /* Parameters that *must* be supported by a record layer if passed */
 1307|  10.6k|    if (direction == OSSL_RECORD_DIRECTION_READ) {
  ------------------
  |  |   42|  10.6k|#define OSSL_RECORD_DIRECTION_READ 0
  ------------------
  |  Branch (1307:9): [True: 5.31k, False: 5.31k]
  ------------------
 1308|  5.31k|        use_etm = SSL_READ_ETM(s) ? 1 : 0;
  ------------------
  |  |  300|  5.31k|#define SSL_READ_ETM(s) (s->s3.flags & TLS1_FLAGS_ENCRYPT_THEN_MAC_READ)
  |  |  ------------------
  |  |  |  |  296|  5.31k|#define TLS1_FLAGS_ENCRYPT_THEN_MAC_READ 0x0100
  |  |  ------------------
  |  |  |  Branch (300:25): [True: 0, False: 5.31k]
  |  |  ------------------
  ------------------
 1309|  5.31k|        if ((s->mac_flags & SSL_MAC_FLAG_READ_MAC_STREAM) != 0)
  ------------------
  |  |  951|  5.31k|#define SSL_MAC_FLAG_READ_MAC_STREAM 1
  ------------------
  |  Branch (1309:13): [True: 0, False: 5.31k]
  ------------------
 1310|      0|            stream_mac = 1;
 1311|       |
 1312|  5.31k|        if ((s->mac_flags & SSL_MAC_FLAG_READ_MAC_TLSTREE) != 0)
  ------------------
  |  |  953|  5.31k|#define SSL_MAC_FLAG_READ_MAC_TLSTREE 4
  ------------------
  |  Branch (1312:13): [True: 0, False: 5.31k]
  ------------------
 1313|      0|            tlstree = 1;
 1314|  5.31k|    } else {
 1315|  5.31k|        use_etm = SSL_WRITE_ETM(s) ? 1 : 0;
  ------------------
  |  |  301|  5.31k|#define SSL_WRITE_ETM(s) (s->s3.flags & TLS1_FLAGS_ENCRYPT_THEN_MAC_WRITE)
  |  |  ------------------
  |  |  |  |  302|  5.31k|#define TLS1_FLAGS_ENCRYPT_THEN_MAC_WRITE 0x0400
  |  |  ------------------
  |  |  |  Branch (301:26): [True: 0, False: 5.31k]
  |  |  ------------------
  ------------------
 1316|  5.31k|        if ((s->mac_flags & SSL_MAC_FLAG_WRITE_MAC_STREAM) != 0)
  ------------------
  |  |  952|  5.31k|#define SSL_MAC_FLAG_WRITE_MAC_STREAM 2
  ------------------
  |  Branch (1316:13): [True: 0, False: 5.31k]
  ------------------
 1317|      0|            stream_mac = 1;
 1318|       |
 1319|  5.31k|        if ((s->mac_flags & SSL_MAC_FLAG_WRITE_MAC_TLSTREE) != 0)
  ------------------
  |  |  954|  5.31k|#define SSL_MAC_FLAG_WRITE_MAC_TLSTREE 8
  ------------------
  |  Branch (1319:13): [True: 0, False: 5.31k]
  ------------------
 1320|      0|            tlstree = 1;
 1321|  5.31k|    }
 1322|       |
 1323|  10.6k|    if (use_etm)
  ------------------
  |  Branch (1323:9): [True: 0, False: 10.6k]
  ------------------
 1324|      0|        *set++ = OSSL_PARAM_construct_int(OSSL_LIBSSL_RECORD_LAYER_PARAM_USE_ETM,
  ------------------
  |  |  336|      0|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_USE_ETM "use_etm"
  ------------------
 1325|      0|            &use_etm);
 1326|       |
 1327|  10.6k|    if (stream_mac)
  ------------------
  |  Branch (1327:9): [True: 0, False: 10.6k]
  ------------------
 1328|      0|        *set++ = OSSL_PARAM_construct_int(OSSL_LIBSSL_RECORD_LAYER_PARAM_STREAM_MAC,
  ------------------
  |  |  334|      0|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_STREAM_MAC "stream_mac"
  ------------------
 1329|      0|            &stream_mac);
 1330|       |
 1331|  10.6k|    if (tlstree)
  ------------------
  |  Branch (1331:9): [True: 0, False: 10.6k]
  ------------------
 1332|      0|        *set++ = OSSL_PARAM_construct_int(OSSL_LIBSSL_RECORD_LAYER_PARAM_TLSTREE,
  ------------------
  |  |  335|      0|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_TLSTREE "tlstree"
  ------------------
 1333|      0|            &tlstree);
 1334|       |
 1335|       |    /*
 1336|       |     * We only need to do this for the read side. The write side should already
 1337|       |     * have the correct value due to the ssl_get_max_send_fragment() call above
 1338|       |     */
 1339|  10.6k|    if (direction == OSSL_RECORD_DIRECTION_READ
  ------------------
  |  |   42|  21.2k|#define OSSL_RECORD_DIRECTION_READ 0
  ------------------
  |  Branch (1339:9): [True: 5.31k, False: 5.31k]
  ------------------
 1340|  5.31k|        && s->session != NULL
  ------------------
  |  Branch (1340:12): [True: 0, False: 5.31k]
  ------------------
 1341|      0|        && USE_MAX_FRAGMENT_LENGTH_EXT(s->session))
  ------------------
  |  |  296|      0|    IS_MAX_FRAGMENT_LENGTH_EXT_VALID(session->ext.max_fragment_len_mode)
  |  |  ------------------
  |  |  |  |  294|      0|    (((value) >= TLSEXT_max_fragment_length_512) && ((value) <= TLSEXT_max_fragment_length_4096))
  |  |  |  |  ------------------
  |  |  |  |  |  |  229|      0|#define TLSEXT_max_fragment_length_512 1
  |  |  |  |  ------------------
  |  |  |  |                   (((value) >= TLSEXT_max_fragment_length_512) && ((value) <= TLSEXT_max_fragment_length_4096))
  |  |  |  |  ------------------
  |  |  |  |  |  |  232|      0|#define TLSEXT_max_fragment_length_4096 4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:6): [True: 0, False: 0]
  |  |  |  |  |  Branch (294:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1342|      0|        maxfrag = GET_MAX_FRAGMENT_LENGTH(s->session);
  ------------------
  |  |  298|      0|    (512U << (session->ext.max_fragment_len_mode - 1))
  ------------------
 1343|       |
 1344|  10.6k|    if (maxfrag != SSL3_RT_MAX_PLAIN_LENGTH)
  ------------------
  |  |  177|  10.6k|#define SSL3_RT_MAX_PLAIN_LENGTH 16384
  ------------------
  |  Branch (1344:9): [True: 0, False: 10.6k]
  ------------------
 1345|      0|        *set++ = OSSL_PARAM_construct_uint(OSSL_LIBSSL_RECORD_LAYER_PARAM_MAX_FRAG_LEN,
  ------------------
  |  |  330|      0|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_MAX_FRAG_LEN "max_frag_len"
  ------------------
 1346|      0|            &maxfrag);
 1347|       |
 1348|       |    /*
 1349|       |     * The record layer must check the amount of early data sent or received
 1350|       |     * using the early keys. A server also needs to worry about rejected early
 1351|       |     * data that might arrive when the handshake keys are in force.
 1352|       |     */
 1353|  10.6k|    if (s->server && direction == OSSL_RECORD_DIRECTION_READ) {
  ------------------
  |  |   42|      0|#define OSSL_RECORD_DIRECTION_READ 0
  ------------------
  |  Branch (1353:9): [True: 0, False: 10.6k]
  |  Branch (1353:22): [True: 0, False: 0]
  ------------------
 1354|      0|        use_early_data = (level == OSSL_RECORD_PROTECTION_LEVEL_EARLY
  ------------------
  |  | 2933|      0|#define OSSL_RECORD_PROTECTION_LEVEL_EARLY 1
  ------------------
  |  Branch (1354:27): [True: 0, False: 0]
  ------------------
 1355|      0|            || level == OSSL_RECORD_PROTECTION_LEVEL_HANDSHAKE);
  ------------------
  |  | 2934|      0|#define OSSL_RECORD_PROTECTION_LEVEL_HANDSHAKE 2
  ------------------
  |  Branch (1355:16): [True: 0, False: 0]
  ------------------
 1356|  10.6k|    } else if (!s->server && direction == OSSL_RECORD_DIRECTION_WRITE) {
  ------------------
  |  |   43|  10.6k|#define OSSL_RECORD_DIRECTION_WRITE 1
  ------------------
  |  Branch (1356:16): [True: 10.6k, False: 0]
  |  Branch (1356:30): [True: 5.31k, False: 5.31k]
  ------------------
 1357|  5.31k|        use_early_data = (level == OSSL_RECORD_PROTECTION_LEVEL_EARLY);
  ------------------
  |  | 2933|  5.31k|#define OSSL_RECORD_PROTECTION_LEVEL_EARLY 1
  ------------------
 1358|  5.31k|    }
 1359|  10.6k|    if (use_early_data) {
  ------------------
  |  Branch (1359:9): [True: 0, False: 10.6k]
  ------------------
 1360|      0|        max_early_data = ossl_get_max_early_data(s);
 1361|       |
 1362|      0|        if (max_early_data != 0)
  ------------------
  |  Branch (1362:13): [True: 0, False: 0]
  ------------------
 1363|      0|            *set++ = OSSL_PARAM_construct_uint32(OSSL_LIBSSL_RECORD_LAYER_PARAM_MAX_EARLY_DATA,
  ------------------
  |  |  329|      0|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_MAX_EARLY_DATA "max_early_data"
  ------------------
 1364|      0|                &max_early_data);
 1365|      0|    }
 1366|       |
 1367|  10.6k|    *set = OSSL_PARAM_construct_end();
 1368|       |
 1369|  10.6k|    for (;;) {
 1370|  10.6k|        int rlret;
 1371|  10.6k|        BIO *prev = NULL;
 1372|  10.6k|        BIO *next = NULL;
 1373|  10.6k|        unsigned int epoch = 0;
 1374|  10.6k|        OSSL_DISPATCH rlayer_dispatch_tmp[OSSL_NELEM(rlayer_dispatch)];
 1375|  10.6k|        size_t i, j;
 1376|       |
 1377|  10.6k|        if (direction == OSSL_RECORD_DIRECTION_READ) {
  ------------------
  |  |   42|  10.6k|#define OSSL_RECORD_DIRECTION_READ 0
  ------------------
  |  Branch (1377:13): [True: 5.31k, False: 5.31k]
  ------------------
 1378|  5.31k|            prev = s->rlayer.rrlnext;
 1379|  5.31k|            if (SSL_CONNECTION_IS_DTLS(s)
  ------------------
  |  |  258|  10.6k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  5.31k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  5.31k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 5.31k]
  |  |  ------------------
  ------------------
 1380|      0|                && level != OSSL_RECORD_PROTECTION_LEVEL_NONE)
  ------------------
  |  | 2932|      0|#define OSSL_RECORD_PROTECTION_LEVEL_NONE 0
  ------------------
  |  Branch (1380:20): [True: 0, False: 0]
  ------------------
 1381|      0|                epoch = dtls1_get_epoch(s, SSL3_CC_READ); /* new epoch */
  ------------------
  |  |  342|      0|#define SSL3_CC_READ 0x001
  ------------------
 1382|       |
 1383|  5.31k|#ifndef OPENSSL_NO_DGRAM
 1384|  5.31k|            if (SSL_CONNECTION_IS_DTLS(s))
  ------------------
  |  |  258|  5.31k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  5.31k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  5.31k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 5.31k]
  |  |  ------------------
  ------------------
 1385|      0|                next = BIO_new(BIO_s_dgram_mem());
 1386|  5.31k|            else
 1387|  5.31k|#endif
 1388|  5.31k|                next = BIO_new(BIO_s_mem());
 1389|       |
 1390|  5.31k|            if (next == NULL) {
  ------------------
  |  Branch (1390:17): [True: 0, False: 5.31k]
  ------------------
 1391|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1392|      0|                return 0;
 1393|      0|            }
 1394|  5.31k|            s->rlayer.rrlnext = next;
 1395|  5.31k|        } else {
 1396|  5.31k|            if (SSL_CONNECTION_IS_DTLS(s)
  ------------------
  |  |  258|  10.6k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  5.31k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  5.31k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 5.31k]
  |  |  ------------------
  ------------------
 1397|      0|                && level != OSSL_RECORD_PROTECTION_LEVEL_NONE)
  ------------------
  |  | 2932|      0|#define OSSL_RECORD_PROTECTION_LEVEL_NONE 0
  ------------------
  |  Branch (1397:20): [True: 0, False: 0]
  ------------------
 1398|      0|                epoch = dtls1_get_epoch(s, SSL3_CC_WRITE); /* new epoch */
  ------------------
  |  |  343|      0|#define SSL3_CC_WRITE 0x002
  ------------------
 1399|  5.31k|        }
 1400|       |
 1401|       |        /*
 1402|       |         * Create a copy of the dispatch array, missing out wrappers for
 1403|       |         * callbacks that we don't need.
 1404|       |         */
 1405|  63.7k|        for (i = 0, j = 0; i < OSSL_NELEM(rlayer_dispatch); i++) {
  ------------------
  |  |   14|  63.7k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (1405:28): [True: 53.1k, False: 10.6k]
  ------------------
 1406|  53.1k|            switch (rlayer_dispatch[i].function_id) {
 1407|  10.6k|            case OSSL_FUNC_RLAYER_MSG_CALLBACK:
  ------------------
  |  |  187|  10.6k|#define OSSL_FUNC_RLAYER_MSG_CALLBACK 2
  ------------------
  |  Branch (1407:13): [True: 10.6k, False: 42.4k]
  ------------------
 1408|  10.6k|                if (s->msg_callback == NULL)
  ------------------
  |  Branch (1408:21): [True: 10.6k, False: 0]
  ------------------
 1409|  10.6k|                    continue;
 1410|      0|                break;
 1411|  10.6k|            case OSSL_FUNC_RLAYER_PADDING:
  ------------------
  |  |  191|  10.6k|#define OSSL_FUNC_RLAYER_PADDING 4
  ------------------
  |  Branch (1411:13): [True: 10.6k, False: 42.4k]
  ------------------
 1412|  10.6k|                if (s->rlayer.record_padding_cb == NULL)
  ------------------
  |  Branch (1412:21): [True: 10.6k, False: 0]
  ------------------
 1413|  10.6k|                    continue;
 1414|      0|                break;
 1415|  31.8k|            default:
  ------------------
  |  Branch (1415:13): [True: 31.8k, False: 21.2k]
  ------------------
 1416|  31.8k|                break;
 1417|  53.1k|            }
 1418|  31.8k|            rlayer_dispatch_tmp[j++] = rlayer_dispatch[i];
 1419|  31.8k|        }
 1420|       |
 1421|  10.6k|        rlret = meth->new_record_layer(sctx->libctx, sctx->propq, version,
 1422|  10.6k|            s->server, direction, level, epoch,
 1423|  10.6k|            secret, secretlen, key, keylen, iv,
 1424|  10.6k|            ivlen, mackey, mackeylen, ciph, taglen,
 1425|  10.6k|            mactype, md, compm, kdfdigest, prev,
 1426|  10.6k|            thisbio, next, NULL, NULL, settings,
 1427|  10.6k|            options, rlayer_dispatch_tmp, s,
 1428|  10.6k|            s->rlayer.rlarg, &newrl);
 1429|  10.6k|        BIO_free(prev);
 1430|  10.6k|        switch (rlret) {
 1431|      0|        case OSSL_RECORD_RETURN_FATAL:
  ------------------
  |  |   48|      0|#define OSSL_RECORD_RETURN_FATAL -2
  ------------------
  |  Branch (1431:9): [True: 0, False: 10.6k]
  ------------------
 1432|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_RECORD_LAYER_FAILURE);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1433|      0|            return 0;
 1434|       |
 1435|      0|        case OSSL_RECORD_RETURN_NON_FATAL_ERR:
  ------------------
  |  |   47|      0|#define OSSL_RECORD_RETURN_NON_FATAL_ERR -1
  ------------------
  |  Branch (1435:9): [True: 0, False: 10.6k]
  ------------------
 1436|      0|            if (*thismethod != meth && *thismethod != NULL) {
  ------------------
  |  Branch (1436:17): [True: 0, False: 0]
  |  Branch (1436:40): [True: 0, False: 0]
  ------------------
 1437|       |                /*
 1438|       |                 * We tried a new record layer method, but it didn't work out,
 1439|       |                 * so we fallback to the original method and try again
 1440|       |                 */
 1441|      0|                meth = *thismethod;
 1442|      0|                continue;
 1443|      0|            }
 1444|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_SUITABLE_RECORD_LAYER);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1445|      0|            return 0;
 1446|       |
 1447|  10.6k|        case OSSL_RECORD_RETURN_SUCCESS:
  ------------------
  |  |   45|  10.6k|#define OSSL_RECORD_RETURN_SUCCESS 1
  ------------------
  |  Branch (1447:9): [True: 10.6k, False: 0]
  ------------------
 1448|  10.6k|            break;
 1449|       |
 1450|      0|        default:
  ------------------
  |  Branch (1450:9): [True: 0, False: 10.6k]
  ------------------
 1451|       |            /* Should not happen */
 1452|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1453|      0|            return 0;
 1454|  10.6k|        }
 1455|  10.6k|        break;
 1456|  10.6k|    }
 1457|       |
 1458|       |    /*
 1459|       |     * Free the old record layer if we have one except in the case of DTLS when
 1460|       |     * writing and there are still buffered sent messages in our queue. In that
 1461|       |     * case the record layer is still referenced by those buffered messages for
 1462|       |     * potential retransmit. Only when those buffered messages get freed do we
 1463|       |     * free the record layer object (see dtls1_hm_fragment_free)
 1464|       |     */
 1465|  10.6k|    if (!SSL_CONNECTION_IS_DTLS(s)
  ------------------
  |  |  258|  21.2k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  10.6k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  10.6k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  ------------------
  |  Branch (1465:9): [True: 10.6k, False: 0]
  ------------------
 1466|      0|        || direction == OSSL_RECORD_DIRECTION_READ
  ------------------
  |  |   42|  10.6k|#define OSSL_RECORD_DIRECTION_READ 0
  ------------------
  |  Branch (1466:12): [True: 0, False: 0]
  ------------------
 1467|  10.6k|        || pqueue_peek(s->d1->sent_messages) == NULL) {
  ------------------
  |  Branch (1467:12): [True: 0, False: 0]
  ------------------
 1468|  10.6k|        if (*thismethod != NULL && !(*thismethod)->free(*thisrl)) {
  ------------------
  |  Branch (1468:13): [True: 0, False: 10.6k]
  |  Branch (1468:36): [True: 0, False: 0]
  ------------------
 1469|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1470|      0|            return 0;
 1471|      0|        }
 1472|  10.6k|    }
 1473|       |
 1474|  10.6k|    *thisrl = newrl;
 1475|  10.6k|    *thismethod = meth;
 1476|       |
 1477|  10.6k|    return ssl_post_record_layer_select(s, direction);
 1478|  10.6k|}
ssl_set_record_protocol_version:
 1481|     49|{
 1482|     49|    if (!ossl_assert(s->rlayer.rrlmethod != NULL)
  ------------------
  |  |   52|     98|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|     98|    __FILE__, __LINE__)
  ------------------
  |  Branch (1482:9): [True: 0, False: 49]
  ------------------
 1483|     49|        || !ossl_assert(s->rlayer.wrlmethod != NULL))
  ------------------
  |  |   52|     49|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|     49|    __FILE__, __LINE__)
  ------------------
  |  Branch (1483:12): [True: 0, False: 49]
  ------------------
 1484|      0|        return 0;
 1485|     49|    s->rlayer.rrlmethod->set_protocol_version(s->rlayer.rrl, s->version);
 1486|     49|    s->rlayer.wrlmethod->set_protocol_version(s->rlayer.wrl, s->version);
 1487|       |
 1488|     49|    return 1;
 1489|     49|}
rec_layer_s3.c:tls_write_check_pending:
  254|  1.64k|{
  255|  1.64k|    if (s->rlayer.wpend_tot == 0)
  ------------------
  |  Branch (255:9): [True: 1.64k, False: 0]
  ------------------
  256|  1.64k|        return 0;
  257|       |
  258|       |    /* We have pending data, so do some sanity checks */
  259|      0|    if ((s->rlayer.wpend_tot > len)
  ------------------
  |  Branch (259:9): [True: 0, False: 0]
  ------------------
  260|      0|        || (!(s->mode & SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER)
  ------------------
  |  |  504|      0|#define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 0x00000002U
  ------------------
  |  Branch (260:13): [True: 0, False: 0]
  ------------------
  261|      0|            && (s->rlayer.wpend_buf != buf))
  ------------------
  |  Branch (261:16): [True: 0, False: 0]
  ------------------
  262|      0|        || (s->rlayer.wpend_type != type)) {
  ------------------
  |  Branch (262:12): [True: 0, False: 0]
  ------------------
  263|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_WRITE_RETRY);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  264|      0|        return -1;
  265|      0|    }
  266|      0|    return 1;
  267|      0|}
rec_layer_s3.c:ssl_select_next_record_layer:
 1187|  10.6k|{
 1188|  10.6k|    if (s->rlayer.custom_rlmethod != NULL)
  ------------------
  |  Branch (1188:9): [True: 0, False: 10.6k]
  ------------------
 1189|      0|        return s->rlayer.custom_rlmethod;
 1190|       |
 1191|  10.6k|    if (level == OSSL_RECORD_PROTECTION_LEVEL_NONE) {
  ------------------
  |  | 2932|  10.6k|#define OSSL_RECORD_PROTECTION_LEVEL_NONE 0
  ------------------
  |  Branch (1191:9): [True: 10.6k, False: 0]
  ------------------
 1192|  10.6k|        if (SSL_CONNECTION_IS_DTLS(s))
  ------------------
  |  |  258|  10.6k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  10.6k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  10.6k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 10.6k]
  |  |  ------------------
  ------------------
 1193|      0|            return &ossl_dtls_record_method;
 1194|       |
 1195|  10.6k|        return &ossl_tls_record_method;
 1196|  10.6k|    }
 1197|       |
 1198|       |#ifndef OPENSSL_NO_KTLS
 1199|       |    /* KTLS does not support renegotiation */
 1200|       |    if (level == OSSL_RECORD_PROTECTION_LEVEL_APPLICATION
 1201|       |        && (s->options & SSL_OP_ENABLE_KTLS) != 0
 1202|       |        && (SSL_CONNECTION_IS_TLS13(s) || SSL_IS_FIRST_HANDSHAKE(s)))
 1203|       |        return &ossl_ktls_record_method;
 1204|       |#endif
 1205|       |
 1206|       |    /* Default to the current OSSL_RECORD_METHOD */
 1207|      0|    return direction == OSSL_RECORD_DIRECTION_READ ? s->rlayer.rrlmethod
  ------------------
  |  |   42|      0|#define OSSL_RECORD_DIRECTION_READ 0
  ------------------
  |  Branch (1207:12): [True: 0, False: 0]
  ------------------
 1208|      0|                                                   : s->rlayer.wrlmethod;
 1209|  10.6k|}
rec_layer_s3.c:ssl_post_record_layer_select:
 1212|  10.6k|{
 1213|  10.6k|    const OSSL_RECORD_METHOD *thismethod;
 1214|  10.6k|    OSSL_RECORD_LAYER *thisrl;
 1215|       |
 1216|  10.6k|    if (direction == OSSL_RECORD_DIRECTION_READ) {
  ------------------
  |  |   42|  10.6k|#define OSSL_RECORD_DIRECTION_READ 0
  ------------------
  |  Branch (1216:9): [True: 5.31k, False: 5.31k]
  ------------------
 1217|  5.31k|        thismethod = s->rlayer.rrlmethod;
 1218|  5.31k|        thisrl = s->rlayer.rrl;
 1219|  5.31k|    } else {
 1220|  5.31k|        thismethod = s->rlayer.wrlmethod;
 1221|  5.31k|        thisrl = s->rlayer.wrl;
 1222|  5.31k|    }
 1223|       |
 1224|       |#ifndef OPENSSL_NO_KTLS
 1225|       |    {
 1226|       |        SSL *ssl = SSL_CONNECTION_GET_SSL(s);
 1227|       |
 1228|       |        if (s->rlayer.rrlmethod == &ossl_ktls_record_method) {
 1229|       |            /* KTLS does not support renegotiation so disallow it */
 1230|       |            SSL_set_options(ssl, SSL_OP_NO_RENEGOTIATION);
 1231|       |        }
 1232|       |    }
 1233|       |#endif
 1234|  10.6k|    if (SSL_IS_FIRST_HANDSHAKE(s) && thismethod->set_first_handshake != NULL)
  ------------------
  |  |  277|  21.2k|#define SSL_IS_FIRST_HANDSHAKE(s) ((s)->s3.tmp.finish_md_len == 0 \
  |  |  ------------------
  |  |  |  Branch (277:36): [True: 10.6k, False: 0]
  |  |  ------------------
  |  |  278|  21.2k|    || (s)->s3.tmp.peer_finish_md_len == 0)
  |  |  ------------------
  |  |  |  Branch (278:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1234:38): [True: 10.6k, False: 0]
  ------------------
 1235|  10.6k|        thismethod->set_first_handshake(thisrl, 1);
 1236|       |
 1237|  10.6k|    if (s->max_pipelines != 0 && thismethod->set_max_pipelines != NULL)
  ------------------
  |  Branch (1237:9): [True: 0, False: 10.6k]
  |  Branch (1237:34): [True: 0, False: 0]
  ------------------
 1238|      0|        thismethod->set_max_pipelines(thisrl, s->max_pipelines);
 1239|       |
 1240|  10.6k|    return 1;
 1241|  10.6k|}

ssl3_cleanup_key_block:
  214|  8.85k|{
  215|  8.85k|    OPENSSL_clear_free(s->s3.tmp.key_block, s->s3.tmp.key_block_length);
  ------------------
  |  |  129|  8.85k|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  216|       |    s->s3.tmp.key_block = NULL;
  217|  8.85k|    s->s3.tmp.key_block_length = 0;
  218|  8.85k|}
ssl3_init_finished_mac:
  221|  1.77k|{
  222|  1.77k|    BIO *buf = BIO_new(BIO_s_mem());
  223|       |
  224|  1.77k|    if (buf == NULL) {
  ------------------
  |  Branch (224:9): [True: 0, False: 1.77k]
  ------------------
  225|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_BIO_LIB);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  226|      0|        return 0;
  227|      0|    }
  228|  1.77k|    ssl3_free_digest_list(s);
  229|  1.77k|    s->s3.handshake_buffer = buf;
  230|       |    (void)BIO_set_close(s->s3.handshake_buffer, BIO_CLOSE);
  ------------------
  |  |  634|  1.77k|#define BIO_set_close(b, c) (int)BIO_ctrl(b, BIO_CTRL_SET_CLOSE, (c), NULL)
  |  |  ------------------
  |  |  |  |   98|  1.77k|#define BIO_CTRL_SET_CLOSE 9 /* man - set the 'close' on free */
  |  |  ------------------
  ------------------
  231|  1.77k|    return 1;
  232|  1.77k|}
ssl3_free_digest_list:
  240|  10.6k|{
  241|  10.6k|    BIO_free(s->s3.handshake_buffer);
  242|  10.6k|    s->s3.handshake_buffer = NULL;
  243|  10.6k|    EVP_MD_CTX_free(s->s3.handshake_dgst);
  244|       |    s->s3.handshake_dgst = NULL;
  245|  10.6k|}
ssl3_finish_mac:
  248|  1.78k|{
  249|  1.78k|    int ret;
  250|       |
  251|  1.78k|    if (s->s3.handshake_dgst == NULL) {
  ------------------
  |  Branch (251:9): [True: 1.78k, False: 0]
  ------------------
  252|       |        /* Note: this writes to a memory BIO so a failure is a fatal error */
  253|  1.78k|        if (len > INT_MAX) {
  ------------------
  |  Branch (253:13): [True: 0, False: 1.78k]
  ------------------
  254|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_OVERFLOW_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  255|      0|            return 0;
  256|      0|        }
  257|  1.78k|        ret = BIO_write(s->s3.handshake_buffer, (void *)buf, (int)len);
  258|  1.78k|        if (ret <= 0 || ret != (int)len) {
  ------------------
  |  Branch (258:13): [True: 0, False: 1.78k]
  |  Branch (258:25): [True: 0, False: 1.78k]
  ------------------
  259|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  260|      0|            return 0;
  261|      0|        }
  262|  1.78k|    } else {
  263|      0|        ret = EVP_DigestUpdate(s->s3.handshake_dgst, buf, len);
  264|      0|        if (!ret) {
  ------------------
  |  Branch (264:13): [True: 0, False: 0]
  ------------------
  265|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  266|      0|            return 0;
  267|      0|        }
  268|      0|    }
  269|  1.78k|    return 1;
  270|  1.78k|}

ssl_sort_cipher_list:
 3730|      1|{
 3731|      1|    qsort(tls13_ciphers, TLS13_NUM_CIPHERS, sizeof(tls13_ciphers[0]),
  ------------------
  |  |   27|      1|#define TLS13_NUM_CIPHERS OSSL_NELEM(tls13_ciphers)
  |  |  ------------------
  |  |  |  |   14|      1|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  |  |  ------------------
  ------------------
 3732|      1|        cipher_compare);
 3733|      1|    qsort(ssl3_ciphers, SSL3_NUM_CIPHERS, sizeof(ssl3_ciphers[0]),
  ------------------
  |  |   28|      1|#define SSL3_NUM_CIPHERS OSSL_NELEM(ssl3_ciphers)
  |  |  ------------------
  |  |  |  |   14|      1|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  |  |  ------------------
  ------------------
 3734|      1|        cipher_compare);
 3735|      1|    qsort(ssl3_scsvs, SSL3_NUM_SCSVS, sizeof(ssl3_scsvs[0]), cipher_compare);
  ------------------
  |  |   29|      1|#define SSL3_NUM_SCSVS OSSL_NELEM(ssl3_scsvs)
  |  |  ------------------
  |  |  |  |   14|      1|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  |  |  ------------------
  ------------------
 3736|      1|}
ssl3_num_ciphers:
 3777|  3.87k|{
 3778|  3.87k|    return SSL3_NUM_CIPHERS;
  ------------------
  |  |   28|  3.87k|#define SSL3_NUM_CIPHERS OSSL_NELEM(ssl3_ciphers)
  |  |  ------------------
  |  |  |  |   14|  3.87k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  |  |  ------------------
  ------------------
 3779|  3.87k|}
ssl3_get_cipher:
 3782|   639k|{
 3783|   639k|    if (u < SSL3_NUM_CIPHERS)
  ------------------
  |  |   28|   639k|#define SSL3_NUM_CIPHERS OSSL_NELEM(ssl3_ciphers)
  |  |  ------------------
  |  |  |  |   14|   639k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  |  |  ------------------
  ------------------
  |  Branch (3783:9): [True: 639k, False: 0]
  ------------------
 3784|   639k|        return &(ssl3_ciphers[SSL3_NUM_CIPHERS - 1 - u]);
  ------------------
  |  |   28|   639k|#define SSL3_NUM_CIPHERS OSSL_NELEM(ssl3_ciphers)
  |  |  ------------------
  |  |  |  |   14|   639k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  |  |  ------------------
  ------------------
 3785|      0|    else
 3786|      0|        return NULL;
 3787|   639k|}
ssl3_set_handshake_header:
 3790|  1.76k|{
 3791|       |    /* No header in the event of a CCS */
 3792|  1.76k|    if (htype == SSL3_MT_CHANGE_CIPHER_SPEC)
  ------------------
  |  |  337|  1.76k|#define SSL3_MT_CHANGE_CIPHER_SPEC 0x0101
  ------------------
  |  Branch (3792:9): [True: 0, False: 1.76k]
  ------------------
 3793|      0|        return 1;
 3794|       |
 3795|       |    /* Set the content type and 3 bytes for the message len */
 3796|  1.76k|    if (!WPACKET_put_bytes_u8(pkt, htype)
  ------------------
  |  |  889|  3.53k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (3796:9): [True: 0, False: 1.76k]
  ------------------
 3797|  1.76k|        || !WPACKET_start_sub_packet_u24(pkt))
  ------------------
  |  |  794|  1.76k|    WPACKET_start_sub_packet_len__((pkt), 3)
  ------------------
  |  Branch (3797:12): [True: 0, False: 1.76k]
  ------------------
 3798|      0|        return 0;
 3799|       |
 3800|  1.76k|    return 1;
 3801|  1.76k|}
ssl3_handshake_write:
 3804|  1.64k|{
 3805|  1.64k|    return ssl3_do_write(s, SSL3_RT_HANDSHAKE);
  ------------------
  |  |  221|  1.64k|#define SSL3_RT_HANDSHAKE 22
  ------------------
 3806|  1.64k|}
ssl3_new:
 3809|  1.77k|{
 3810|  1.77k|#ifndef OPENSSL_NO_SRP
 3811|  1.77k|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  ------------------
  |  |   39|  1.77k|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|  1.77k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 1.77k]
  |  |  |  |  ------------------
  |  |  |  |   33|  1.77k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  1.77k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 1.77k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  1.77k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  1.77k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
 3812|       |
 3813|  1.77k|    if (sc == NULL)
  ------------------
  |  Branch (3813:9): [True: 0, False: 1.77k]
  ------------------
 3814|      0|        return 0;
 3815|       |
 3816|  1.77k|    if (!ssl_srp_ctx_init_intern(sc))
  ------------------
  |  Branch (3816:9): [True: 0, False: 1.77k]
  ------------------
 3817|      0|        return 0;
 3818|  1.77k|#endif
 3819|       |
 3820|  1.77k|    if (!s->method->ssl_clear(s))
  ------------------
  |  Branch (3820:9): [True: 0, False: 1.77k]
  ------------------
 3821|      0|        return 0;
 3822|       |
 3823|  1.77k|    return 1;
 3824|  1.77k|}
ssl3_free:
 3827|  1.77k|{
 3828|  1.77k|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  ------------------
  |  |   39|  1.77k|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|  1.77k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 1.77k]
  |  |  |  |  ------------------
  |  |  |  |   33|  1.77k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  1.77k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 1.77k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  1.77k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  1.77k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
 3829|  1.77k|    size_t i;
 3830|       |
 3831|  1.77k|    if (sc == NULL)
  ------------------
  |  Branch (3831:9): [True: 0, False: 1.77k]
  ------------------
 3832|      0|        return;
 3833|       |
 3834|  1.77k|    ssl3_cleanup_key_block(sc);
 3835|       |
 3836|  1.77k|    EVP_PKEY_free(sc->s3.peer_tmp);
 3837|  1.77k|    sc->s3.peer_tmp = NULL;
 3838|       |
 3839|  4.72k|    for (i = 0; i < sc->s3.tmp.num_ks_pkey; i++)
  ------------------
  |  Branch (3839:17): [True: 2.95k, False: 1.77k]
  ------------------
 3840|  2.95k|        if (sc->s3.tmp.ks_pkey[i] != NULL) {
  ------------------
  |  Branch (3840:13): [True: 2.95k, False: 0]
  ------------------
 3841|  2.95k|            if (sc->s3.tmp.pkey == sc->s3.tmp.ks_pkey[i])
  ------------------
  |  Branch (3841:17): [True: 1.63k, False: 1.31k]
  ------------------
 3842|  1.63k|                sc->s3.tmp.pkey = NULL;
 3843|       |
 3844|  2.95k|            EVP_PKEY_free(sc->s3.tmp.ks_pkey[i]);
 3845|  2.95k|            sc->s3.tmp.ks_pkey[i] = NULL;
 3846|  2.95k|        }
 3847|  1.77k|    sc->s3.tmp.num_ks_pkey = 0;
 3848|       |
 3849|  1.77k|    if (sc->s3.tmp.pkey != NULL) {
  ------------------
  |  Branch (3849:9): [True: 0, False: 1.77k]
  ------------------
 3850|      0|        EVP_PKEY_free(sc->s3.tmp.pkey);
 3851|      0|        sc->s3.tmp.pkey = NULL;
 3852|      0|    }
 3853|       |
 3854|  1.77k|    ssl_evp_cipher_free(sc->s3.tmp.new_sym_enc);
 3855|  1.77k|    ssl_evp_md_free(sc->s3.tmp.new_hash);
 3856|       |
 3857|  1.77k|    OPENSSL_free(sc->s3.tmp.ctype);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3858|  1.77k|    sk_X509_NAME_pop_free(sc->s3.tmp.peer_ca_names, X509_NAME_free);
  ------------------
  |  |   70|  1.77k|#define sk_X509_NAME_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_freefunc_type(freefunc))
  ------------------
 3859|  1.77k|    OPENSSL_free(sc->s3.tmp.ciphers_raw);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3860|  1.77k|    OPENSSL_clear_free(sc->s3.tmp.pms, sc->s3.tmp.pmslen);
  ------------------
  |  |  129|  1.77k|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3861|  1.77k|    OPENSSL_free(sc->s3.tmp.peer_sigalgs);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3862|  1.77k|    OPENSSL_free(sc->s3.tmp.peer_cert_sigalgs);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3863|  1.77k|    OPENSSL_free(sc->s3.tmp.valid_flags);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3864|  1.77k|    ssl3_free_digest_list(sc);
 3865|  1.77k|    OPENSSL_free(sc->s3.alpn_selected);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3866|  1.77k|    OPENSSL_free(sc->s3.alpn_proposed);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3867|  1.77k|    ossl_quic_tls_free(sc->qtls);
 3868|       |
 3869|  1.77k|#ifndef OPENSSL_NO_PSK
 3870|  1.77k|    OPENSSL_free(sc->s3.tmp.psk);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3871|  1.77k|#endif
 3872|       |
 3873|  1.77k|#ifndef OPENSSL_NO_SRP
 3874|  1.77k|    ssl_srp_ctx_free_intern(sc);
 3875|  1.77k|#endif
 3876|  1.77k|    memset(&sc->s3, 0, sizeof(sc->s3));
 3877|  1.77k|}
ssl3_clear:
 3880|  7.08k|{
 3881|  7.08k|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  ------------------
  |  |   39|  7.08k|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|  7.08k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 7.08k]
  |  |  |  |  ------------------
  |  |  |  |   33|  7.08k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  7.08k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 7.08k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  7.08k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  7.08k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
 3882|  7.08k|    int flags;
 3883|  7.08k|    size_t i;
 3884|       |
 3885|  7.08k|    if (sc == NULL)
  ------------------
  |  Branch (3885:9): [True: 0, False: 7.08k]
  ------------------
 3886|      0|        return 0;
 3887|       |
 3888|  7.08k|    ssl3_cleanup_key_block(sc);
 3889|  7.08k|    OPENSSL_free(sc->s3.tmp.ctype);
  ------------------
  |  |  131|  7.08k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3890|  7.08k|    sk_X509_NAME_pop_free(sc->s3.tmp.peer_ca_names, X509_NAME_free);
  ------------------
  |  |   70|  7.08k|#define sk_X509_NAME_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_freefunc_type(freefunc))
  ------------------
 3891|  7.08k|    OPENSSL_free(sc->s3.tmp.ciphers_raw);
  ------------------
  |  |  131|  7.08k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3892|  7.08k|    OPENSSL_clear_free(sc->s3.tmp.pms, sc->s3.tmp.pmslen);
  ------------------
  |  |  129|  7.08k|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3893|  7.08k|    OPENSSL_free(sc->s3.tmp.peer_sigalgs);
  ------------------
  |  |  131|  7.08k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3894|  7.08k|    OPENSSL_free(sc->s3.tmp.peer_cert_sigalgs);
  ------------------
  |  |  131|  7.08k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3895|  7.08k|    OPENSSL_free(sc->s3.tmp.valid_flags);
  ------------------
  |  |  131|  7.08k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3896|       |
 3897|  7.08k|    EVP_PKEY_free(sc->s3.peer_tmp);
 3898|       |
 3899|  7.08k|    for (i = 0; i < sc->s3.tmp.num_ks_pkey; i++)
  ------------------
  |  Branch (3899:17): [True: 0, False: 7.08k]
  ------------------
 3900|      0|        if (sc->s3.tmp.ks_pkey[i] != NULL) {
  ------------------
  |  Branch (3900:13): [True: 0, False: 0]
  ------------------
 3901|      0|            if (sc->s3.tmp.pkey == sc->s3.tmp.ks_pkey[i])
  ------------------
  |  Branch (3901:17): [True: 0, False: 0]
  ------------------
 3902|      0|                sc->s3.tmp.pkey = NULL;
 3903|       |
 3904|      0|            EVP_PKEY_free(sc->s3.tmp.ks_pkey[i]);
 3905|      0|            sc->s3.tmp.ks_pkey[i] = NULL;
 3906|      0|        }
 3907|  7.08k|    sc->s3.tmp.num_ks_pkey = 0;
 3908|       |
 3909|  7.08k|    if (sc->s3.tmp.pkey != NULL) {
  ------------------
  |  Branch (3909:9): [True: 0, False: 7.08k]
  ------------------
 3910|      0|        EVP_PKEY_free(sc->s3.tmp.pkey);
 3911|      0|        sc->s3.tmp.pkey = NULL;
 3912|      0|    }
 3913|       |
 3914|  7.08k|    ssl3_free_digest_list(sc);
 3915|       |
 3916|  7.08k|    OPENSSL_free(sc->s3.alpn_selected);
  ------------------
  |  |  131|  7.08k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3917|  7.08k|    OPENSSL_free(sc->s3.alpn_proposed);
  ------------------
  |  |  131|  7.08k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3918|       |
 3919|       |    /*
 3920|       |     * NULL/zero-out everything in the s3 struct, but remember if we are doing
 3921|       |     * QUIC.
 3922|       |     */
 3923|  7.08k|    flags = sc->s3.flags & (TLS1_FLAGS_QUIC | TLS1_FLAGS_QUIC_INTERNAL);
  ------------------
  |  |   29|  7.08k|#define TLS1_FLAGS_QUIC 0x2000
  ------------------
                  flags = sc->s3.flags & (TLS1_FLAGS_QUIC | TLS1_FLAGS_QUIC_INTERNAL);
  ------------------
  |  |   31|  7.08k|#define TLS1_FLAGS_QUIC_INTERNAL 0x4000
  ------------------
 3924|  7.08k|    memset(&sc->s3, 0, sizeof(sc->s3));
 3925|  7.08k|    sc->s3.flags |= flags;
 3926|       |
 3927|  7.08k|    if (!ssl_free_wbio_buffer(sc))
  ------------------
  |  Branch (3927:9): [True: 0, False: 7.08k]
  ------------------
 3928|      0|        return 0;
 3929|       |
 3930|  7.08k|    sc->version = SSL3_VERSION;
  ------------------
  |  |   23|  7.08k|#define SSL3_VERSION 0x0300
  ------------------
 3931|       |
 3932|  7.08k|#if !defined(OPENSSL_NO_NEXTPROTONEG)
 3933|  7.08k|    OPENSSL_free(sc->ext.npn);
  ------------------
  |  |  131|  7.08k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3934|  7.08k|    sc->ext.npn = NULL;
 3935|  7.08k|    sc->ext.npn_len = 0;
 3936|  7.08k|#endif
 3937|       |
 3938|  7.08k|    return 1;
 3939|  7.08k|}
ssl3_ctrl:
 3956|    578|{
 3957|    578|    int ret = 0;
 3958|    578|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  ------------------
  |  |   39|    578|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|    578|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 578]
  |  |  |  |  ------------------
  |  |  |  |   33|    578|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|    578|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 578, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|    578|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|    578|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
 3959|    578|#ifndef OPENSSL_NO_OCSP
 3960|    578|    unsigned char *p = NULL;
 3961|    578|    OCSP_RESPONSE *resp = NULL;
 3962|    578|#endif
 3963|       |
 3964|    578|    if (sc == NULL)
  ------------------
  |  Branch (3964:9): [True: 0, False: 578]
  ------------------
 3965|      0|        return ret;
 3966|       |
 3967|    578|    switch (cmd) {
 3968|      0|    case SSL_CTRL_GET_CLIENT_CERT_REQUEST:
  ------------------
  |  | 1279|      0|#define SSL_CTRL_GET_CLIENT_CERT_REQUEST 9
  ------------------
  |  Branch (3968:5): [True: 0, False: 578]
  ------------------
 3969|      0|        break;
 3970|      0|    case SSL_CTRL_GET_NUM_RENEGOTIATIONS:
  ------------------
  |  | 1280|      0|#define SSL_CTRL_GET_NUM_RENEGOTIATIONS 10
  ------------------
  |  Branch (3970:5): [True: 0, False: 578]
  ------------------
 3971|      0|        ret = sc->s3.num_renegotiations;
 3972|      0|        break;
 3973|      0|    case SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS:
  ------------------
  |  | 1281|      0|#define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 11
  ------------------
  |  Branch (3973:5): [True: 0, False: 578]
  ------------------
 3974|      0|        ret = sc->s3.num_renegotiations;
 3975|      0|        sc->s3.num_renegotiations = 0;
 3976|      0|        break;
 3977|      0|    case SSL_CTRL_GET_TOTAL_RENEGOTIATIONS:
  ------------------
  |  | 1282|      0|#define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 12
  ------------------
  |  Branch (3977:5): [True: 0, False: 578]
  ------------------
 3978|      0|        ret = sc->s3.total_renegotiations;
 3979|      0|        break;
 3980|      0|    case SSL_CTRL_GET_FLAGS:
  ------------------
  |  | 1283|      0|#define SSL_CTRL_GET_FLAGS 13
  ------------------
  |  Branch (3980:5): [True: 0, False: 578]
  ------------------
 3981|      0|        ret = (int)(sc->s3.flags);
 3982|      0|        break;
 3983|      0|#if !defined(OPENSSL_NO_DEPRECATED_3_0)
 3984|      0|    case SSL_CTRL_SET_TMP_DH: {
  ------------------
  |  | 1274|      0|#define SSL_CTRL_SET_TMP_DH 3
  ------------------
  |  Branch (3984:5): [True: 0, False: 578]
  ------------------
 3985|      0|        EVP_PKEY *pkdh = NULL;
 3986|      0|        if (parg == NULL) {
  ------------------
  |  Branch (3986:13): [True: 0, False: 0]
  ------------------
 3987|      0|            ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 3988|      0|            return 0;
 3989|      0|        }
 3990|      0|        pkdh = ssl_dh_to_pkey(parg);
 3991|      0|        if (pkdh == NULL) {
  ------------------
  |  Branch (3991:13): [True: 0, False: 0]
  ------------------
 3992|      0|            ERR_raise(ERR_LIB_SSL, ERR_R_DH_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 3993|      0|            return 0;
 3994|      0|        }
 3995|      0|        if (!SSL_set0_tmp_dh_pkey(s, pkdh)) {
  ------------------
  |  Branch (3995:13): [True: 0, False: 0]
  ------------------
 3996|      0|            EVP_PKEY_free(pkdh);
 3997|      0|            return 0;
 3998|      0|        }
 3999|      0|        return 1;
 4000|      0|    } break;
 4001|      0|    case SSL_CTRL_SET_TMP_DH_CB: {
  ------------------
  |  | 1276|      0|#define SSL_CTRL_SET_TMP_DH_CB 6
  ------------------
  |  Branch (4001:5): [True: 0, False: 578]
  ------------------
 4002|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4003|      0|        return ret;
 4004|      0|    }
 4005|      0|#endif
 4006|      0|    case SSL_CTRL_SET_DH_AUTO:
  ------------------
  |  | 1373|      0|#define SSL_CTRL_SET_DH_AUTO 118
  ------------------
  |  Branch (4006:5): [True: 0, False: 578]
  ------------------
 4007|      0|        sc->cert->dh_tmp_auto = larg;
 4008|      0|        return 1;
 4009|      0|#if !defined(OPENSSL_NO_DEPRECATED_3_0)
 4010|      0|    case SSL_CTRL_SET_TMP_ECDH: {
  ------------------
  |  | 1275|      0|#define SSL_CTRL_SET_TMP_ECDH 4
  ------------------
  |  Branch (4010:5): [True: 0, False: 578]
  ------------------
 4011|      0|        if (parg == NULL) {
  ------------------
  |  Branch (4011:13): [True: 0, False: 0]
  ------------------
 4012|      0|            ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4013|      0|            return 0;
 4014|      0|        }
 4015|      0|        return ssl_set_tmp_ecdh_groups(&sc->ext.supportedgroups,
 4016|      0|            &sc->ext.supportedgroups_len,
 4017|      0|            &sc->ext.keyshares,
 4018|      0|            &sc->ext.keyshares_len,
 4019|      0|            &sc->ext.tuples,
 4020|      0|            &sc->ext.tuples_len,
 4021|      0|            parg);
 4022|      0|    }
 4023|      0|#endif /* !OPENSSL_NO_DEPRECATED_3_0 */
 4024|    576|    case SSL_CTRL_SET_TLSEXT_HOSTNAME:
  ------------------
  |  | 1315|    576|#define SSL_CTRL_SET_TLSEXT_HOSTNAME 55
  ------------------
  |  Branch (4024:5): [True: 576, False: 2]
  ------------------
 4025|       |        /*
 4026|       |         * This API is only used for a client to set what SNI it will request
 4027|       |         * from the server, but we currently allow it to be used on servers
 4028|       |         * as well, which is a programming error.  Currently we just clear
 4029|       |         * the field in SSL_do_handshake() for server SSLs, but when we can
 4030|       |         * make ABI-breaking changes, we may want to make use of this API
 4031|       |         * an error on server SSLs.
 4032|       |         */
 4033|    576|        if (larg == TLSEXT_NAMETYPE_host_name) {
  ------------------
  |  |  171|    576|#define TLSEXT_NAMETYPE_host_name 0
  ------------------
  |  Branch (4033:13): [True: 576, False: 0]
  ------------------
 4034|    576|            size_t len;
 4035|       |
 4036|    576|            OPENSSL_free(sc->ext.hostname);
  ------------------
  |  |  131|    576|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4037|    576|            sc->ext.hostname = NULL;
 4038|       |
 4039|    576|            ret = 1;
 4040|    576|            if (parg == NULL)
  ------------------
  |  Branch (4040:17): [True: 0, False: 576]
  ------------------
 4041|      0|                break;
 4042|    576|            len = strlen((char *)parg);
 4043|    576|            if (len == 0 || len > TLSEXT_MAXLEN_host_name) {
  ------------------
  |  |  248|    576|#define TLSEXT_MAXLEN_host_name 255
  ------------------
  |  Branch (4043:17): [True: 0, False: 576]
  |  Branch (4043:29): [True: 0, False: 576]
  ------------------
 4044|      0|                ERR_raise(ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4045|      0|                return 0;
 4046|      0|            }
 4047|    576|            if ((sc->ext.hostname = OPENSSL_strdup((char *)parg)) == NULL) {
  ------------------
  |  |  135|    576|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (4047:17): [True: 0, False: 576]
  ------------------
 4048|      0|                ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4049|      0|                return 0;
 4050|      0|            }
 4051|    576|        } else {
 4052|      0|            ERR_raise(ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4053|      0|            return 0;
 4054|      0|        }
 4055|    576|        break;
 4056|    576|    case SSL_CTRL_SET_TLSEXT_DEBUG_ARG:
  ------------------
  |  | 1317|      0|#define SSL_CTRL_SET_TLSEXT_DEBUG_ARG 57
  ------------------
  |  Branch (4056:5): [True: 0, False: 578]
  ------------------
 4057|      0|        sc->ext.debug_arg = parg;
 4058|      0|        ret = 1;
 4059|      0|        break;
 4060|       |
 4061|      0|    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE:
  ------------------
  |  | 1381|      0|#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE 127
  ------------------
  |  Branch (4061:5): [True: 0, False: 578]
  ------------------
 4062|      0|        ret = sc->ext.status_type;
 4063|      0|        break;
 4064|       |
 4065|      2|    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE:
  ------------------
  |  | 1325|      2|#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE 65
  ------------------
  |  Branch (4065:5): [True: 2, False: 576]
  ------------------
 4066|      2|        sc->ext.status_type = larg;
 4067|      2|        ret = 1;
 4068|      2|        break;
 4069|       |
 4070|      0|    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS:
  ------------------
  |  | 1326|      0|#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS 66
  ------------------
  |  Branch (4070:5): [True: 0, False: 578]
  ------------------
 4071|      0|        *(STACK_OF(X509_EXTENSION) **)parg = sc->ext.ocsp.exts;
 4072|      0|        ret = 1;
 4073|      0|        break;
 4074|       |
 4075|      0|    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS:
  ------------------
  |  | 1327|      0|#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS 67
  ------------------
  |  Branch (4075:5): [True: 0, False: 578]
  ------------------
 4076|      0|        sc->ext.ocsp.exts = parg;
 4077|      0|        ret = 1;
 4078|      0|        break;
 4079|       |
 4080|      0|    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS:
  ------------------
  |  | 1328|      0|#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS 68
  ------------------
  |  Branch (4080:5): [True: 0, False: 578]
  ------------------
 4081|      0|        *(STACK_OF(OCSP_RESPID) **)parg = sc->ext.ocsp.ids;
 4082|      0|        ret = 1;
 4083|      0|        break;
 4084|       |
 4085|      0|    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS:
  ------------------
  |  | 1329|      0|#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS 69
  ------------------
  |  Branch (4085:5): [True: 0, False: 578]
  ------------------
 4086|      0|        sc->ext.ocsp.ids = parg;
 4087|      0|        ret = 1;
 4088|      0|        break;
 4089|       |
 4090|      0|    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP:
  ------------------
  |  | 1330|      0|#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP 70
  ------------------
  |  Branch (4090:5): [True: 0, False: 578]
  ------------------
 4091|      0|        *(unsigned char **)parg = NULL;
 4092|      0|        ret = -1;
 4093|       |
 4094|      0|#ifndef OPENSSL_NO_OCSP
 4095|      0|        resp = sk_OCSP_RESPONSE_value(sc->ext.ocsp.resp_ex, 0);
 4096|       |
 4097|      0|        if (resp != NULL) {
  ------------------
  |  Branch (4097:13): [True: 0, False: 0]
  ------------------
 4098|      0|            int resp_len = i2d_OCSP_RESPONSE(resp, &p);
 4099|       |
 4100|      0|            if (resp_len > 0) {
  ------------------
  |  Branch (4100:17): [True: 0, False: 0]
  ------------------
 4101|      0|                OPENSSL_free(sc->ext.ocsp.resp);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4102|      0|                *(unsigned char **)parg = sc->ext.ocsp.resp = p;
 4103|      0|                sc->ext.ocsp.resp_len = (size_t)resp_len;
 4104|      0|                ret = resp_len;
 4105|      0|            }
 4106|      0|        }
 4107|      0|#endif
 4108|      0|        break;
 4109|       |
 4110|      0|    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP:
  ------------------
  |  | 1331|      0|#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP 71
  ------------------
  |  Branch (4110:5): [True: 0, False: 578]
  ------------------
 4111|      0|        ret = 1;
 4112|      0|#ifndef OPENSSL_NO_OCSP
 4113|       |        /*
 4114|       |         * In case of success keep the single value so we do not need to
 4115|       |         * free it immediately.
 4116|       |         * However in the handshake code we only use the extended values.
 4117|       |         */
 4118|      0|        OPENSSL_free(sc->ext.ocsp.resp);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4119|      0|        sc->ext.ocsp.resp = NULL;
 4120|      0|        sc->ext.ocsp.resp_len = 0;
 4121|       |
 4122|      0|        sk_OCSP_RESPONSE_pop_free(sc->ext.ocsp.resp_ex, OCSP_RESPONSE_free);
 4123|      0|        sc->ext.ocsp.resp_ex = NULL;
 4124|       |
 4125|      0|        if (parg != NULL) {
  ------------------
  |  Branch (4125:13): [True: 0, False: 0]
  ------------------
 4126|      0|            sc->ext.ocsp.resp_ex = sk_OCSP_RESPONSE_new_reserve(NULL, 1);
 4127|      0|            if (sc->ext.ocsp.resp_ex == NULL)
  ------------------
  |  Branch (4127:17): [True: 0, False: 0]
  ------------------
 4128|      0|                return 0;
 4129|       |
 4130|      0|            p = parg;
 4131|      0|            resp = d2i_OCSP_RESPONSE(NULL, (const unsigned char **)&p, larg);
 4132|      0|            if (resp != NULL)
  ------------------
  |  Branch (4132:17): [True: 0, False: 0]
  ------------------
 4133|      0|                sk_OCSP_RESPONSE_push(sc->ext.ocsp.resp_ex, resp);
 4134|       |
 4135|      0|            sc->ext.ocsp.resp = parg;
 4136|      0|            sc->ext.ocsp.resp_len = larg;
 4137|      0|        }
 4138|      0|#endif
 4139|      0|        break;
 4140|       |
 4141|      0|    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP_EX:
  ------------------
  |  | 1396|      0|#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP_EX 142
  ------------------
  |  Branch (4141:5): [True: 0, False: 578]
  ------------------
 4142|      0|#ifndef OPENSSL_NO_OCSP
 4143|      0|        *(STACK_OF(OCSP_RESPONSE) **)parg = sc->ext.ocsp.resp_ex;
 4144|      0|        ret = sk_OCSP_RESPONSE_num(sc->ext.ocsp.resp_ex);
 4145|       |#else
 4146|       |        *(unsigned char **)parg = NULL;
 4147|       |        ret = -1;
 4148|       |#endif
 4149|      0|        break;
 4150|       |
 4151|      0|    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP_EX:
  ------------------
  |  | 1397|      0|#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP_EX 143
  ------------------
  |  Branch (4151:5): [True: 0, False: 578]
  ------------------
 4152|      0|#ifndef OPENSSL_NO_OCSP
 4153|       |        /*
 4154|       |         * cleanup single values, which might be set somewhere else
 4155|       |         * we only use the extended values
 4156|       |         */
 4157|      0|        if (sc->ext.ocsp.resp != NULL) {
  ------------------
  |  Branch (4157:13): [True: 0, False: 0]
  ------------------
 4158|      0|            OPENSSL_free(sc->ext.ocsp.resp);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4159|      0|            sc->ext.ocsp.resp = NULL;
 4160|      0|            sc->ext.ocsp.resp_len = 0;
 4161|      0|        }
 4162|       |
 4163|      0|        sk_OCSP_RESPONSE_pop_free(sc->ext.ocsp.resp_ex, OCSP_RESPONSE_free);
 4164|      0|        sc->ext.ocsp.resp_ex = (STACK_OF(OCSP_RESPONSE) *)parg;
 4165|      0|#endif
 4166|      0|        ret = 1;
 4167|      0|        break;
 4168|       |
 4169|      0|    case SSL_CTRL_CHAIN:
  ------------------
  |  | 1349|      0|#define SSL_CTRL_CHAIN 88
  ------------------
  |  Branch (4169:5): [True: 0, False: 578]
  ------------------
 4170|      0|        if (larg)
  ------------------
  |  Branch (4170:13): [True: 0, False: 0]
  ------------------
 4171|      0|            return ssl_cert_set1_chain(sc, NULL, (STACK_OF(X509) *)parg);
 4172|      0|        else
 4173|      0|            return ssl_cert_set0_chain(sc, NULL, (STACK_OF(X509) *)parg);
 4174|       |
 4175|      0|    case SSL_CTRL_CHAIN_CERT:
  ------------------
  |  | 1350|      0|#define SSL_CTRL_CHAIN_CERT 89
  ------------------
  |  Branch (4175:5): [True: 0, False: 578]
  ------------------
 4176|      0|        if (larg)
  ------------------
  |  Branch (4176:13): [True: 0, False: 0]
  ------------------
 4177|      0|            return ssl_cert_add1_chain_cert(sc, NULL, (X509 *)parg);
 4178|      0|        else
 4179|      0|            return ssl_cert_add0_chain_cert(sc, NULL, (X509 *)parg);
 4180|       |
 4181|      0|    case SSL_CTRL_GET_CHAIN_CERTS:
  ------------------
  |  | 1370|      0|#define SSL_CTRL_GET_CHAIN_CERTS 115
  ------------------
  |  Branch (4181:5): [True: 0, False: 578]
  ------------------
 4182|      0|        *(STACK_OF(X509) **)parg = sc->cert->key->chain;
 4183|      0|        ret = 1;
 4184|      0|        break;
 4185|       |
 4186|      0|    case SSL_CTRL_SELECT_CURRENT_CERT:
  ------------------
  |  | 1371|      0|#define SSL_CTRL_SELECT_CURRENT_CERT 116
  ------------------
  |  Branch (4186:5): [True: 0, False: 578]
  ------------------
 4187|      0|        return ssl_cert_select_current(sc->cert, (X509 *)parg);
 4188|       |
 4189|      0|    case SSL_CTRL_SET_CURRENT_CERT:
  ------------------
  |  | 1372|      0|#define SSL_CTRL_SET_CURRENT_CERT 117
  ------------------
  |  Branch (4189:5): [True: 0, False: 578]
  ------------------
 4190|      0|        if (larg == SSL_CERT_SET_SERVER) {
  ------------------
  |  | 1400|      0|#define SSL_CERT_SET_SERVER 3
  ------------------
  |  Branch (4190:13): [True: 0, False: 0]
  ------------------
 4191|      0|            const SSL_CIPHER *cipher;
 4192|      0|            if (!sc->server)
  ------------------
  |  Branch (4192:17): [True: 0, False: 0]
  ------------------
 4193|      0|                return 0;
 4194|      0|            cipher = sc->s3.tmp.new_cipher;
 4195|      0|            if (cipher == NULL)
  ------------------
  |  Branch (4195:17): [True: 0, False: 0]
  ------------------
 4196|      0|                return 0;
 4197|       |            /*
 4198|       |             * No certificate for unauthenticated ciphersuites or using SRP
 4199|       |             * authentication
 4200|       |             */
 4201|      0|            if (cipher->algorithm_auth & (SSL_aNULL | SSL_aSRP))
  ------------------
  |  |  112|      0|#define SSL_aNULL 0x00000004U
  ------------------
                          if (cipher->algorithm_auth & (SSL_aNULL | SSL_aSRP))
  ------------------
  |  |  120|      0|#define SSL_aSRP 0x00000040U
  ------------------
  |  Branch (4201:17): [True: 0, False: 0]
  ------------------
 4202|      0|                return 2;
 4203|      0|            if (sc->s3.tmp.cert == NULL)
  ------------------
  |  Branch (4203:17): [True: 0, False: 0]
  ------------------
 4204|      0|                return 0;
 4205|      0|            sc->cert->key = sc->s3.tmp.cert;
 4206|      0|            return 1;
 4207|      0|        }
 4208|      0|        return ssl_cert_set_current(sc->cert, larg);
 4209|       |
 4210|      0|    case SSL_CTRL_GET_GROUPS: {
  ------------------
  |  | 1351|      0|#define SSL_CTRL_GET_GROUPS 90
  ------------------
  |  Branch (4210:5): [True: 0, False: 578]
  ------------------
 4211|      0|        uint16_t *clist;
 4212|      0|        size_t clistlen;
 4213|       |
 4214|      0|        if (!sc->session)
  ------------------
  |  Branch (4214:13): [True: 0, False: 0]
  ------------------
 4215|      0|            return 0;
 4216|      0|        clist = sc->ext.peer_supportedgroups;
 4217|      0|        clistlen = sc->ext.peer_supportedgroups_len;
 4218|      0|        if (parg) {
  ------------------
  |  Branch (4218:13): [True: 0, False: 0]
  ------------------
 4219|      0|            size_t i;
 4220|      0|            int *cptr = parg;
 4221|       |
 4222|      0|            for (i = 0; i < clistlen; i++) {
  ------------------
  |  Branch (4222:25): [True: 0, False: 0]
  ------------------
 4223|      0|                const TLS_GROUP_INFO *cinf
 4224|      0|                    = tls1_group_id_lookup(s->ctx, clist[i]);
 4225|       |
 4226|      0|                if (cinf != NULL)
  ------------------
  |  Branch (4226:21): [True: 0, False: 0]
  ------------------
 4227|      0|                    cptr[i] = tls1_group_id2nid(cinf->group_id, 1);
 4228|      0|                else
 4229|      0|                    cptr[i] = TLSEXT_nid_unknown | clist[i];
  ------------------
  |  |  219|      0|#define TLSEXT_nid_unknown 0x1000000
  ------------------
 4230|      0|            }
 4231|      0|        }
 4232|      0|        return (int)clistlen;
 4233|      0|    }
 4234|       |
 4235|      0|    case SSL_CTRL_SET_GROUPS:
  ------------------
  |  | 1352|      0|#define SSL_CTRL_SET_GROUPS 91
  ------------------
  |  Branch (4235:5): [True: 0, False: 578]
  ------------------
 4236|      0|        return tls1_set_groups(&sc->ext.supportedgroups,
 4237|      0|            &sc->ext.supportedgroups_len,
 4238|      0|            &sc->ext.keyshares,
 4239|      0|            &sc->ext.keyshares_len,
 4240|      0|            &sc->ext.tuples,
 4241|      0|            &sc->ext.tuples_len,
 4242|      0|            parg, larg);
 4243|       |
 4244|      0|    case SSL_CTRL_SET_GROUPS_LIST:
  ------------------
  |  | 1353|      0|#define SSL_CTRL_SET_GROUPS_LIST 92
  ------------------
  |  Branch (4244:5): [True: 0, False: 578]
  ------------------
 4245|      0|        return tls1_set_groups_list(s->ctx,
 4246|      0|            &sc->ext.supportedgroups,
 4247|      0|            &sc->ext.supportedgroups_len,
 4248|      0|            &sc->ext.keyshares,
 4249|      0|            &sc->ext.keyshares_len,
 4250|      0|            &sc->ext.tuples,
 4251|      0|            &sc->ext.tuples_len,
 4252|      0|            parg);
 4253|       |
 4254|      0|    case SSL_CTRL_GET_SHARED_GROUP: {
  ------------------
  |  | 1354|      0|#define SSL_CTRL_GET_SHARED_GROUP 93
  ------------------
  |  Branch (4254:5): [True: 0, False: 578]
  ------------------
 4255|      0|        uint16_t id = tls1_shared_group(sc, larg);
 4256|       |
 4257|      0|        if (larg != -1)
  ------------------
  |  Branch (4257:13): [True: 0, False: 0]
  ------------------
 4258|      0|            return tls1_group_id2nid(id, 1);
 4259|      0|        return id;
 4260|      0|    }
 4261|      0|    case SSL_CTRL_GET_NEGOTIATED_GROUP: {
  ------------------
  |  | 1388|      0|#define SSL_CTRL_GET_NEGOTIATED_GROUP 134
  ------------------
  |  Branch (4261:5): [True: 0, False: 578]
  ------------------
 4262|      0|        unsigned int id;
 4263|       |
 4264|      0|        if (SSL_CONNECTION_IS_TLS13(sc) && sc->s3.did_kex)
  ------------------
  |  |  265|      0|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 0, False: 0]
  |  |  ------------------
  |  |  266|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  267|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|      0|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (4264:44): [True: 0, False: 0]
  ------------------
 4265|      0|            id = sc->s3.group_id;
 4266|      0|        else
 4267|      0|            id = (sc->session != NULL) ? sc->session->kex_group : NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (4267:18): [True: 0, False: 0]
  ------------------
 4268|      0|        ret = tls1_group_id2nid(id, 1);
 4269|      0|        break;
 4270|      0|    }
 4271|      0|    case SSL_CTRL_SET_SIGALGS:
  ------------------
  |  | 1355|      0|#define SSL_CTRL_SET_SIGALGS 97
  ------------------
  |  Branch (4271:5): [True: 0, False: 578]
  ------------------
 4272|      0|        return tls1_set_sigalgs(sc->cert, parg, larg, 0);
 4273|       |
 4274|      0|    case SSL_CTRL_SET_SIGALGS_LIST:
  ------------------
  |  | 1356|      0|#define SSL_CTRL_SET_SIGALGS_LIST 98
  ------------------
  |  Branch (4274:5): [True: 0, False: 578]
  ------------------
 4275|      0|        return tls1_set_sigalgs_list(s->ctx, sc->cert, parg, 0);
 4276|       |
 4277|      0|    case SSL_CTRL_SET_CLIENT_SIGALGS:
  ------------------
  |  | 1359|      0|#define SSL_CTRL_SET_CLIENT_SIGALGS 101
  ------------------
  |  Branch (4277:5): [True: 0, False: 578]
  ------------------
 4278|      0|        return tls1_set_sigalgs(sc->cert, parg, larg, 1);
 4279|       |
 4280|      0|    case SSL_CTRL_SET_CLIENT_SIGALGS_LIST:
  ------------------
  |  | 1360|      0|#define SSL_CTRL_SET_CLIENT_SIGALGS_LIST 102
  ------------------
  |  Branch (4280:5): [True: 0, False: 578]
  ------------------
 4281|      0|        return tls1_set_sigalgs_list(s->ctx, sc->cert, parg, 1);
 4282|       |
 4283|      0|    case SSL_CTRL_GET_CLIENT_CERT_TYPES: {
  ------------------
  |  | 1361|      0|#define SSL_CTRL_GET_CLIENT_CERT_TYPES 103
  ------------------
  |  Branch (4283:5): [True: 0, False: 578]
  ------------------
 4284|      0|        const unsigned char **pctype = parg;
 4285|      0|        if (sc->server || !sc->s3.tmp.cert_req)
  ------------------
  |  Branch (4285:13): [True: 0, False: 0]
  |  Branch (4285:27): [True: 0, False: 0]
  ------------------
 4286|      0|            return 0;
 4287|      0|        if (pctype)
  ------------------
  |  Branch (4287:13): [True: 0, False: 0]
  ------------------
 4288|      0|            *pctype = sc->s3.tmp.ctype;
 4289|      0|        return (long)sc->s3.tmp.ctype_len;
 4290|      0|    }
 4291|       |
 4292|      0|    case SSL_CTRL_SET_CLIENT_CERT_TYPES:
  ------------------
  |  | 1362|      0|#define SSL_CTRL_SET_CLIENT_CERT_TYPES 104
  ------------------
  |  Branch (4292:5): [True: 0, False: 578]
  ------------------
 4293|      0|        if (!sc->server)
  ------------------
  |  Branch (4293:13): [True: 0, False: 0]
  ------------------
 4294|      0|            return 0;
 4295|      0|        return ssl3_set_req_cert_type(sc->cert, parg, larg);
 4296|       |
 4297|      0|    case SSL_CTRL_BUILD_CERT_CHAIN:
  ------------------
  |  | 1363|      0|#define SSL_CTRL_BUILD_CERT_CHAIN 105
  ------------------
  |  Branch (4297:5): [True: 0, False: 578]
  ------------------
 4298|      0|        return ssl_build_cert_chain(sc, NULL, larg);
 4299|       |
 4300|      0|    case SSL_CTRL_SET_VERIFY_CERT_STORE:
  ------------------
  |  | 1364|      0|#define SSL_CTRL_SET_VERIFY_CERT_STORE 106
  ------------------
  |  Branch (4300:5): [True: 0, False: 578]
  ------------------
 4301|      0|        return ssl_cert_set_cert_store(sc->cert, parg, 0, larg);
 4302|       |
 4303|      0|    case SSL_CTRL_SET_CHAIN_CERT_STORE:
  ------------------
  |  | 1365|      0|#define SSL_CTRL_SET_CHAIN_CERT_STORE 107
  ------------------
  |  Branch (4303:5): [True: 0, False: 578]
  ------------------
 4304|      0|        return ssl_cert_set_cert_store(sc->cert, parg, 1, larg);
 4305|       |
 4306|      0|    case SSL_CTRL_GET_VERIFY_CERT_STORE:
  ------------------
  |  | 1391|      0|#define SSL_CTRL_GET_VERIFY_CERT_STORE 137
  ------------------
  |  Branch (4306:5): [True: 0, False: 578]
  ------------------
 4307|      0|        return ssl_cert_get_cert_store(sc->cert, parg, 0);
 4308|       |
 4309|      0|    case SSL_CTRL_GET_CHAIN_CERT_STORE:
  ------------------
  |  | 1392|      0|#define SSL_CTRL_GET_CHAIN_CERT_STORE 138
  ------------------
  |  Branch (4309:5): [True: 0, False: 578]
  ------------------
 4310|      0|        return ssl_cert_get_cert_store(sc->cert, parg, 1);
 4311|       |
 4312|      0|    case SSL_CTRL_GET_PEER_SIGNATURE_NAME:
  ------------------
  |  | 1395|      0|#define SSL_CTRL_GET_PEER_SIGNATURE_NAME 141
  ------------------
  |  Branch (4312:5): [True: 0, False: 578]
  ------------------
 4313|      0|        if (parg == NULL || sc->s3.tmp.peer_sigalg == NULL)
  ------------------
  |  Branch (4313:13): [True: 0, False: 0]
  |  Branch (4313:29): [True: 0, False: 0]
  ------------------
 4314|      0|            return 0;
 4315|      0|        *(const char **)parg = sc->s3.tmp.peer_sigalg->name;
 4316|      0|        return 1;
 4317|       |
 4318|      0|    case SSL_CTRL_GET_PEER_SIGNATURE_NID:
  ------------------
  |  | 1366|      0|#define SSL_CTRL_GET_PEER_SIGNATURE_NID 108
  ------------------
  |  Branch (4318:5): [True: 0, False: 578]
  ------------------
 4319|      0|        if (sc->s3.tmp.peer_sigalg == NULL)
  ------------------
  |  Branch (4319:13): [True: 0, False: 0]
  ------------------
 4320|      0|            return 0;
 4321|      0|        *(int *)parg = sc->s3.tmp.peer_sigalg->hash;
 4322|      0|        return 1;
 4323|       |
 4324|      0|    case SSL_CTRL_GET_SIGNATURE_NAME:
  ------------------
  |  | 1394|      0|#define SSL_CTRL_GET_SIGNATURE_NAME 140
  ------------------
  |  Branch (4324:5): [True: 0, False: 578]
  ------------------
 4325|      0|        if (parg == NULL || sc->s3.tmp.sigalg == NULL)
  ------------------
  |  Branch (4325:13): [True: 0, False: 0]
  |  Branch (4325:29): [True: 0, False: 0]
  ------------------
 4326|      0|            return 0;
 4327|      0|        *(const char **)parg = sc->s3.tmp.sigalg->name;
 4328|      0|        return 1;
 4329|       |
 4330|      0|    case SSL_CTRL_GET_SIGNATURE_NID:
  ------------------
  |  | 1386|      0|#define SSL_CTRL_GET_SIGNATURE_NID 132
  ------------------
  |  Branch (4330:5): [True: 0, False: 578]
  ------------------
 4331|      0|        if (sc->s3.tmp.sigalg == NULL)
  ------------------
  |  Branch (4331:13): [True: 0, False: 0]
  ------------------
 4332|      0|            return 0;
 4333|      0|        *(int *)parg = sc->s3.tmp.sigalg->hash;
 4334|      0|        return 1;
 4335|       |
 4336|      0|    case SSL_CTRL_GET_PEER_TMP_KEY:
  ------------------
  |  | 1367|      0|#define SSL_CTRL_GET_PEER_TMP_KEY 109
  ------------------
  |  Branch (4336:5): [True: 0, False: 578]
  ------------------
 4337|      0|        if (sc->session == NULL || sc->s3.peer_tmp == NULL) {
  ------------------
  |  Branch (4337:13): [True: 0, False: 0]
  |  Branch (4337:36): [True: 0, False: 0]
  ------------------
 4338|      0|            return 0;
 4339|      0|        } else {
 4340|      0|            if (!EVP_PKEY_up_ref(sc->s3.peer_tmp))
  ------------------
  |  Branch (4340:17): [True: 0, False: 0]
  ------------------
 4341|      0|                return 0;
 4342|       |
 4343|      0|            *(EVP_PKEY **)parg = sc->s3.peer_tmp;
 4344|      0|            return 1;
 4345|      0|        }
 4346|       |
 4347|      0|    case SSL_CTRL_GET_TMP_KEY:
  ------------------
  |  | 1387|      0|#define SSL_CTRL_GET_TMP_KEY 133
  ------------------
  |  Branch (4347:5): [True: 0, False: 578]
  ------------------
 4348|      0|        if (sc->session == NULL || sc->s3.tmp.pkey == NULL) {
  ------------------
  |  Branch (4348:13): [True: 0, False: 0]
  |  Branch (4348:36): [True: 0, False: 0]
  ------------------
 4349|      0|            return 0;
 4350|      0|        } else {
 4351|      0|            if (!EVP_PKEY_up_ref(sc->s3.tmp.pkey))
  ------------------
  |  Branch (4351:17): [True: 0, False: 0]
  ------------------
 4352|      0|                return 0;
 4353|       |
 4354|      0|            *(EVP_PKEY **)parg = sc->s3.tmp.pkey;
 4355|      0|            return 1;
 4356|      0|        }
 4357|       |
 4358|      0|    case SSL_CTRL_GET_EC_POINT_FORMATS: {
  ------------------
  |  | 1369|      0|#define SSL_CTRL_GET_EC_POINT_FORMATS 111
  ------------------
  |  Branch (4358:5): [True: 0, False: 578]
  ------------------
 4359|      0|        const unsigned char **pformat = parg;
 4360|       |
 4361|      0|        if (sc->ext.peer_ecpointformats == NULL)
  ------------------
  |  Branch (4361:13): [True: 0, False: 0]
  ------------------
 4362|      0|            return 0;
 4363|      0|        *pformat = sc->ext.peer_ecpointformats;
 4364|      0|        return (int)sc->ext.peer_ecpointformats_len;
 4365|      0|    }
 4366|       |
 4367|      0|    case SSL_CTRL_GET_IANA_GROUPS: {
  ------------------
  |  | 1389|      0|#define SSL_CTRL_GET_IANA_GROUPS 135
  ------------------
  |  Branch (4367:5): [True: 0, False: 578]
  ------------------
 4368|      0|        if (parg != NULL) {
  ------------------
  |  Branch (4368:13): [True: 0, False: 0]
  ------------------
 4369|      0|            *(uint16_t **)parg = (uint16_t *)sc->ext.peer_supportedgroups;
 4370|      0|        }
 4371|      0|        return (int)sc->ext.peer_supportedgroups_len;
 4372|      0|    }
 4373|       |
 4374|      0|    case SSL_CTRL_SET_MSG_CALLBACK_ARG:
  ------------------
  |  | 1286|      0|#define SSL_CTRL_SET_MSG_CALLBACK_ARG 16
  ------------------
  |  Branch (4374:5): [True: 0, False: 578]
  ------------------
 4375|      0|        sc->msg_callback_arg = parg;
 4376|      0|        return 1;
 4377|       |
 4378|      0|    default:
  ------------------
  |  Branch (4378:5): [True: 0, False: 578]
  ------------------
 4379|      0|        break;
 4380|    578|    }
 4381|    578|    return ret;
 4382|    578|}
ssl3_ctx_ctrl:
 4420|  2.99k|{
 4421|  2.99k|    switch (cmd) {
 4422|      0|#if !defined(OPENSSL_NO_DEPRECATED_3_0)
 4423|      0|    case SSL_CTRL_SET_TMP_DH: {
  ------------------
  |  | 1274|      0|#define SSL_CTRL_SET_TMP_DH 3
  ------------------
  |  Branch (4423:5): [True: 0, False: 2.99k]
  ------------------
 4424|      0|        EVP_PKEY *pkdh = NULL;
 4425|      0|        if (parg == NULL) {
  ------------------
  |  Branch (4425:13): [True: 0, False: 0]
  ------------------
 4426|      0|            ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4427|      0|            return 0;
 4428|      0|        }
 4429|      0|        pkdh = ssl_dh_to_pkey(parg);
 4430|      0|        if (pkdh == NULL) {
  ------------------
  |  Branch (4430:13): [True: 0, False: 0]
  ------------------
 4431|      0|            ERR_raise(ERR_LIB_SSL, ERR_R_DH_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4432|      0|            return 0;
 4433|      0|        }
 4434|      0|        if (!SSL_CTX_set0_tmp_dh_pkey(ctx, pkdh)) {
  ------------------
  |  Branch (4434:13): [True: 0, False: 0]
  ------------------
 4435|      0|            EVP_PKEY_free(pkdh);
 4436|      0|            return 0;
 4437|      0|        }
 4438|      0|        return 1;
 4439|      0|    }
 4440|      0|    case SSL_CTRL_SET_TMP_DH_CB: {
  ------------------
  |  | 1276|      0|#define SSL_CTRL_SET_TMP_DH_CB 6
  ------------------
  |  Branch (4440:5): [True: 0, False: 2.99k]
  ------------------
 4441|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4442|      0|        return 0;
 4443|      0|    }
 4444|      0|#endif
 4445|      0|    case SSL_CTRL_SET_DH_AUTO:
  ------------------
  |  | 1373|      0|#define SSL_CTRL_SET_DH_AUTO 118
  ------------------
  |  Branch (4445:5): [True: 0, False: 2.99k]
  ------------------
 4446|      0|        ctx->cert->dh_tmp_auto = larg;
 4447|      0|        return 1;
 4448|      0|#if !defined(OPENSSL_NO_DEPRECATED_3_0)
 4449|      0|    case SSL_CTRL_SET_TMP_ECDH: {
  ------------------
  |  | 1275|      0|#define SSL_CTRL_SET_TMP_ECDH 4
  ------------------
  |  Branch (4449:5): [True: 0, False: 2.99k]
  ------------------
 4450|      0|        if (parg == NULL) {
  ------------------
  |  Branch (4450:13): [True: 0, False: 0]
  ------------------
 4451|      0|            ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4452|      0|            return 0;
 4453|      0|        }
 4454|      0|        return ssl_set_tmp_ecdh_groups(&ctx->ext.supportedgroups,
 4455|      0|            &ctx->ext.supportedgroups_len,
 4456|      0|            &ctx->ext.keyshares,
 4457|      0|            &ctx->ext.keyshares_len,
 4458|      0|            &ctx->ext.tuples,
 4459|      0|            &ctx->ext.tuples_len,
 4460|      0|            parg);
 4461|      0|    }
 4462|      0|#endif /* !OPENSSL_NO_DEPRECATED_3_0 */
 4463|      0|    case SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG:
  ------------------
  |  | 1314|      0|#define SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG 54
  ------------------
  |  Branch (4463:5): [True: 0, False: 2.99k]
  ------------------
 4464|      0|        ctx->ext.servername_arg = parg;
 4465|      0|        break;
 4466|      0|    case SSL_CTRL_SET_TLSEXT_TICKET_KEYS:
  ------------------
  |  | 1319|      0|#define SSL_CTRL_SET_TLSEXT_TICKET_KEYS 59
  ------------------
  |  Branch (4466:5): [True: 0, False: 2.99k]
  ------------------
 4467|      0|    case SSL_CTRL_GET_TLSEXT_TICKET_KEYS: {
  ------------------
  |  | 1318|      0|#define SSL_CTRL_GET_TLSEXT_TICKET_KEYS 58
  ------------------
  |  Branch (4467:5): [True: 0, False: 2.99k]
  ------------------
 4468|      0|        unsigned char *keys = parg;
 4469|      0|        long tick_keylen = (sizeof(ctx->ext.tick_key_name) + sizeof(ctx->ext.secure->tick_hmac_key) + sizeof(ctx->ext.secure->tick_aes_key));
 4470|      0|        if (keys == NULL)
  ------------------
  |  Branch (4470:13): [True: 0, False: 0]
  ------------------
 4471|      0|            return tick_keylen;
 4472|      0|        if (larg != tick_keylen) {
  ------------------
  |  Branch (4472:13): [True: 0, False: 0]
  ------------------
 4473|      0|            ERR_raise(ERR_LIB_SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4474|      0|            return 0;
 4475|      0|        }
 4476|      0|        if (cmd == SSL_CTRL_SET_TLSEXT_TICKET_KEYS) {
  ------------------
  |  | 1319|      0|#define SSL_CTRL_SET_TLSEXT_TICKET_KEYS 59
  ------------------
  |  Branch (4476:13): [True: 0, False: 0]
  ------------------
 4477|      0|            memcpy(ctx->ext.tick_key_name, keys,
 4478|      0|                sizeof(ctx->ext.tick_key_name));
 4479|      0|            memcpy(ctx->ext.secure->tick_hmac_key,
 4480|      0|                keys + sizeof(ctx->ext.tick_key_name),
 4481|      0|                sizeof(ctx->ext.secure->tick_hmac_key));
 4482|      0|            memcpy(ctx->ext.secure->tick_aes_key,
 4483|      0|                keys + sizeof(ctx->ext.tick_key_name) + sizeof(ctx->ext.secure->tick_hmac_key),
 4484|      0|                sizeof(ctx->ext.secure->tick_aes_key));
 4485|      0|        } else {
 4486|      0|            memcpy(keys, ctx->ext.tick_key_name,
 4487|      0|                sizeof(ctx->ext.tick_key_name));
 4488|      0|            memcpy(keys + sizeof(ctx->ext.tick_key_name),
 4489|      0|                ctx->ext.secure->tick_hmac_key,
 4490|      0|                sizeof(ctx->ext.secure->tick_hmac_key));
 4491|      0|            memcpy(keys + sizeof(ctx->ext.tick_key_name) + sizeof(ctx->ext.secure->tick_hmac_key),
 4492|      0|                ctx->ext.secure->tick_aes_key,
 4493|      0|                sizeof(ctx->ext.secure->tick_aes_key));
 4494|      0|        }
 4495|      0|        return 1;
 4496|      0|    }
 4497|       |
 4498|      0|    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE:
  ------------------
  |  | 1381|      0|#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE 127
  ------------------
  |  Branch (4498:5): [True: 0, False: 2.99k]
  ------------------
 4499|      0|        return ctx->ext.status_type;
 4500|       |
 4501|      0|    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE:
  ------------------
  |  | 1325|      0|#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE 65
  ------------------
  |  Branch (4501:5): [True: 0, False: 2.99k]
  ------------------
 4502|      0|        ctx->ext.status_type = larg;
 4503|      0|        break;
 4504|       |
 4505|      0|    case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG:
  ------------------
  |  | 1324|      0|#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG 64
  ------------------
  |  Branch (4505:5): [True: 0, False: 2.99k]
  ------------------
 4506|      0|        ctx->ext.status_arg = parg;
 4507|      0|        return 1;
 4508|       |
 4509|      0|    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG:
  ------------------
  |  | 1383|      0|#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG 129
  ------------------
  |  Branch (4509:5): [True: 0, False: 2.99k]
  ------------------
 4510|      0|        *(void **)parg = ctx->ext.status_arg;
 4511|      0|        break;
 4512|       |
 4513|      0|    case SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB:
  ------------------
  |  | 1382|      0|#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB 128
  ------------------
  |  Branch (4513:5): [True: 0, False: 2.99k]
  ------------------
 4514|      0|        *(int (**)(SSL *, void *))parg = ctx->ext.status_cb;
 4515|      0|        break;
 4516|       |
 4517|      0|#ifndef OPENSSL_NO_SRP
 4518|      5|    case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME:
  ------------------
  |  | 1339|      5|#define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME 79
  ------------------
  |  Branch (4518:5): [True: 5, False: 2.99k]
  ------------------
 4519|      5|        ctx->srp_ctx.srp_Mask |= SSL_kSRP;
  ------------------
  |  |   91|      5|#define SSL_kSRP 0x00000020U
  ------------------
 4520|      5|        OPENSSL_free(ctx->srp_ctx.login);
  ------------------
  |  |  131|      5|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4521|      5|        ctx->srp_ctx.login = NULL;
 4522|      5|        if (parg == NULL)
  ------------------
  |  Branch (4522:13): [True: 0, False: 5]
  ------------------
 4523|      0|            break;
 4524|      5|        if (strlen((const char *)parg) > 255 || strlen((const char *)parg) < 1) {
  ------------------
  |  Branch (4524:13): [True: 0, False: 5]
  |  Branch (4524:49): [True: 1, False: 4]
  ------------------
 4525|      1|            ERR_raise(ERR_LIB_SSL, SSL_R_INVALID_SRP_USERNAME);
  ------------------
  |  |  404|      1|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      1|    (ERR_new(),                                                  \
  |  |  |  |  407|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      1|        ERR_set_error)
  |  |  ------------------
  ------------------
 4526|      1|            return 0;
 4527|      1|        }
 4528|      4|        if ((ctx->srp_ctx.login = OPENSSL_strdup((char *)parg)) == NULL) {
  ------------------
  |  |  135|      4|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (4528:13): [True: 0, False: 4]
  ------------------
 4529|      0|            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4530|      0|            return 0;
 4531|      0|        }
 4532|      4|        break;
 4533|      4|    case SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD:
  ------------------
  |  | 1341|      4|#define SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD 81
  ------------------
  |  Branch (4533:5): [True: 4, False: 2.99k]
  ------------------
 4534|      4|        ctx->srp_ctx.SRP_give_srp_client_pwd_callback = srp_password_from_info_cb;
 4535|      4|        if (ctx->srp_ctx.info != NULL)
  ------------------
  |  Branch (4535:13): [True: 0, False: 4]
  ------------------
 4536|      0|            OPENSSL_free(ctx->srp_ctx.info);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4537|      4|        if ((ctx->srp_ctx.info = OPENSSL_strdup((char *)parg)) == NULL) {
  ------------------
  |  |  135|      4|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (4537:13): [True: 2, False: 2]
  ------------------
 4538|      2|            ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      2|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      2|    (ERR_new(),                                                  \
  |  |  |  |  407|      2|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      2|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      2|        ERR_set_error)
  |  |  ------------------
  ------------------
 4539|      2|            return 0;
 4540|      2|        }
 4541|      2|        break;
 4542|      2|    case SSL_CTRL_SET_SRP_ARG:
  ------------------
  |  | 1338|      0|#define SSL_CTRL_SET_SRP_ARG 78
  ------------------
  |  Branch (4542:5): [True: 0, False: 2.99k]
  ------------------
 4543|      0|        ctx->srp_ctx.srp_Mask |= SSL_kSRP;
  ------------------
  |  |   91|      0|#define SSL_kSRP 0x00000020U
  ------------------
 4544|      0|        ctx->srp_ctx.SRP_cb_arg = parg;
 4545|      0|        break;
 4546|       |
 4547|      0|    case SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH:
  ------------------
  |  | 1340|      0|#define SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH 80
  ------------------
  |  Branch (4547:5): [True: 0, False: 2.99k]
  ------------------
 4548|      0|        ctx->srp_ctx.strength = larg;
 4549|      0|        break;
 4550|      0|#endif
 4551|       |
 4552|      0|    case SSL_CTRL_SET_GROUPS:
  ------------------
  |  | 1352|      0|#define SSL_CTRL_SET_GROUPS 91
  ------------------
  |  Branch (4552:5): [True: 0, False: 2.99k]
  ------------------
 4553|      0|        return tls1_set_groups(&ctx->ext.supportedgroups,
 4554|      0|            &ctx->ext.supportedgroups_len,
 4555|      0|            &ctx->ext.keyshares,
 4556|      0|            &ctx->ext.keyshares_len,
 4557|      0|            &ctx->ext.tuples,
 4558|      0|            &ctx->ext.tuples_len,
 4559|      0|            parg, larg);
 4560|       |
 4561|  2.98k|    case SSL_CTRL_SET_GROUPS_LIST:
  ------------------
  |  | 1353|  2.98k|#define SSL_CTRL_SET_GROUPS_LIST 92
  ------------------
  |  Branch (4561:5): [True: 2.98k, False: 9]
  ------------------
 4562|  2.98k|        return tls1_set_groups_list(ctx,
 4563|  2.98k|            &ctx->ext.supportedgroups,
 4564|  2.98k|            &ctx->ext.supportedgroups_len,
 4565|  2.98k|            &ctx->ext.keyshares,
 4566|  2.98k|            &ctx->ext.keyshares_len,
 4567|  2.98k|            &ctx->ext.tuples,
 4568|  2.98k|            &ctx->ext.tuples_len,
 4569|  2.98k|            parg);
 4570|       |
 4571|      0|    case SSL_CTRL_GET0_IMPLEMENTED_GROUPS:
  ------------------
  |  | 1393|      0|#define SSL_CTRL_GET0_IMPLEMENTED_GROUPS 139
  ------------------
  |  Branch (4571:5): [True: 0, False: 2.99k]
  ------------------
 4572|      0|        return tls1_get0_implemented_groups(ctx->min_proto_version,
 4573|      0|            ctx->max_proto_version,
 4574|      0|            ctx->group_list,
 4575|      0|            ctx->group_list_len, larg, parg);
 4576|       |
 4577|      0|    case SSL_CTRL_SET_SIGALGS:
  ------------------
  |  | 1355|      0|#define SSL_CTRL_SET_SIGALGS 97
  ------------------
  |  Branch (4577:5): [True: 0, False: 2.99k]
  ------------------
 4578|      0|        return tls1_set_sigalgs(ctx->cert, parg, larg, 0);
 4579|       |
 4580|      0|    case SSL_CTRL_SET_SIGALGS_LIST:
  ------------------
  |  | 1356|      0|#define SSL_CTRL_SET_SIGALGS_LIST 98
  ------------------
  |  Branch (4580:5): [True: 0, False: 2.99k]
  ------------------
 4581|      0|        return tls1_set_sigalgs_list(ctx, ctx->cert, parg, 0);
 4582|       |
 4583|      0|    case SSL_CTRL_SET_CLIENT_SIGALGS:
  ------------------
  |  | 1359|      0|#define SSL_CTRL_SET_CLIENT_SIGALGS 101
  ------------------
  |  Branch (4583:5): [True: 0, False: 2.99k]
  ------------------
 4584|      0|        return tls1_set_sigalgs(ctx->cert, parg, larg, 1);
 4585|       |
 4586|      0|    case SSL_CTRL_SET_CLIENT_SIGALGS_LIST:
  ------------------
  |  | 1360|      0|#define SSL_CTRL_SET_CLIENT_SIGALGS_LIST 102
  ------------------
  |  Branch (4586:5): [True: 0, False: 2.99k]
  ------------------
 4587|      0|        return tls1_set_sigalgs_list(ctx, ctx->cert, parg, 1);
 4588|       |
 4589|      0|    case SSL_CTRL_SET_CLIENT_CERT_TYPES:
  ------------------
  |  | 1362|      0|#define SSL_CTRL_SET_CLIENT_CERT_TYPES 104
  ------------------
  |  Branch (4589:5): [True: 0, False: 2.99k]
  ------------------
 4590|      0|        return ssl3_set_req_cert_type(ctx->cert, parg, larg);
 4591|       |
 4592|      0|    case SSL_CTRL_BUILD_CERT_CHAIN:
  ------------------
  |  | 1363|      0|#define SSL_CTRL_BUILD_CERT_CHAIN 105
  ------------------
  |  Branch (4592:5): [True: 0, False: 2.99k]
  ------------------
 4593|      0|        return ssl_build_cert_chain(NULL, ctx, larg);
 4594|       |
 4595|      0|    case SSL_CTRL_SET_VERIFY_CERT_STORE:
  ------------------
  |  | 1364|      0|#define SSL_CTRL_SET_VERIFY_CERT_STORE 106
  ------------------
  |  Branch (4595:5): [True: 0, False: 2.99k]
  ------------------
 4596|      0|        return ssl_cert_set_cert_store(ctx->cert, parg, 0, larg);
 4597|       |
 4598|      0|    case SSL_CTRL_SET_CHAIN_CERT_STORE:
  ------------------
  |  | 1365|      0|#define SSL_CTRL_SET_CHAIN_CERT_STORE 107
  ------------------
  |  Branch (4598:5): [True: 0, False: 2.99k]
  ------------------
 4599|      0|        return ssl_cert_set_cert_store(ctx->cert, parg, 1, larg);
 4600|       |
 4601|      0|    case SSL_CTRL_GET_VERIFY_CERT_STORE:
  ------------------
  |  | 1391|      0|#define SSL_CTRL_GET_VERIFY_CERT_STORE 137
  ------------------
  |  Branch (4601:5): [True: 0, False: 2.99k]
  ------------------
 4602|      0|        return ssl_cert_get_cert_store(ctx->cert, parg, 0);
 4603|       |
 4604|      0|    case SSL_CTRL_GET_CHAIN_CERT_STORE:
  ------------------
  |  | 1392|      0|#define SSL_CTRL_GET_CHAIN_CERT_STORE 138
  ------------------
  |  Branch (4604:5): [True: 0, False: 2.99k]
  ------------------
 4605|      0|        return ssl_cert_get_cert_store(ctx->cert, parg, 1);
 4606|       |
 4607|       |        /* A Thawte special :-) */
 4608|      0|    case SSL_CTRL_EXTRA_CHAIN_CERT:
  ------------------
  |  | 1284|      0|#define SSL_CTRL_EXTRA_CHAIN_CERT 14
  ------------------
  |  Branch (4608:5): [True: 0, False: 2.99k]
  ------------------
 4609|      0|        if (ctx->extra_certs == NULL) {
  ------------------
  |  Branch (4609:13): [True: 0, False: 0]
  ------------------
 4610|      0|            if ((ctx->extra_certs = sk_X509_new_null()) == NULL) {
  ------------------
  |  |   85|      0|#define sk_X509_new_null() ((STACK_OF(X509) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (4610:17): [True: 0, False: 0]
  ------------------
 4611|      0|                ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4612|      0|                return 0;
 4613|      0|            }
 4614|      0|        }
 4615|      0|        if (!sk_X509_push(ctx->extra_certs, (X509 *)parg)) {
  ------------------
  |  |   92|      0|#define sk_X509_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr))
  ------------------
  |  Branch (4615:13): [True: 0, False: 0]
  ------------------
 4616|      0|            ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4617|      0|            return 0;
 4618|      0|        }
 4619|      0|        break;
 4620|       |
 4621|      0|    case SSL_CTRL_GET_EXTRA_CHAIN_CERTS:
  ------------------
  |  | 1347|      0|#define SSL_CTRL_GET_EXTRA_CHAIN_CERTS 82
  ------------------
  |  Branch (4621:5): [True: 0, False: 2.99k]
  ------------------
 4622|      0|        if (ctx->extra_certs == NULL && larg == 0)
  ------------------
  |  Branch (4622:13): [True: 0, False: 0]
  |  Branch (4622:41): [True: 0, False: 0]
  ------------------
 4623|      0|            *(STACK_OF(X509) **)parg = ctx->cert->key->chain;
 4624|      0|        else
 4625|      0|            *(STACK_OF(X509) **)parg = ctx->extra_certs;
 4626|      0|        break;
 4627|       |
 4628|      0|    case SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS:
  ------------------
  |  | 1348|      0|#define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS 83
  ------------------
  |  Branch (4628:5): [True: 0, False: 2.99k]
  ------------------
 4629|      0|        OSSL_STACK_OF_X509_free(ctx->extra_certs);
 4630|      0|        ctx->extra_certs = NULL;
 4631|      0|        break;
 4632|       |
 4633|      0|    case SSL_CTRL_CHAIN:
  ------------------
  |  | 1349|      0|#define SSL_CTRL_CHAIN 88
  ------------------
  |  Branch (4633:5): [True: 0, False: 2.99k]
  ------------------
 4634|      0|        if (larg)
  ------------------
  |  Branch (4634:13): [True: 0, False: 0]
  ------------------
 4635|      0|            return ssl_cert_set1_chain(NULL, ctx, (STACK_OF(X509) *)parg);
 4636|      0|        else
 4637|      0|            return ssl_cert_set0_chain(NULL, ctx, (STACK_OF(X509) *)parg);
 4638|       |
 4639|      0|    case SSL_CTRL_CHAIN_CERT:
  ------------------
  |  | 1350|      0|#define SSL_CTRL_CHAIN_CERT 89
  ------------------
  |  Branch (4639:5): [True: 0, False: 2.99k]
  ------------------
 4640|      0|        if (larg)
  ------------------
  |  Branch (4640:13): [True: 0, False: 0]
  ------------------
 4641|      0|            return ssl_cert_add1_chain_cert(NULL, ctx, (X509 *)parg);
 4642|      0|        else
 4643|      0|            return ssl_cert_add0_chain_cert(NULL, ctx, (X509 *)parg);
 4644|       |
 4645|      0|    case SSL_CTRL_GET_CHAIN_CERTS:
  ------------------
  |  | 1370|      0|#define SSL_CTRL_GET_CHAIN_CERTS 115
  ------------------
  |  Branch (4645:5): [True: 0, False: 2.99k]
  ------------------
 4646|      0|        *(STACK_OF(X509) **)parg = ctx->cert->key->chain;
 4647|      0|        break;
 4648|       |
 4649|      0|    case SSL_CTRL_SELECT_CURRENT_CERT:
  ------------------
  |  | 1371|      0|#define SSL_CTRL_SELECT_CURRENT_CERT 116
  ------------------
  |  Branch (4649:5): [True: 0, False: 2.99k]
  ------------------
 4650|      0|        return ssl_cert_select_current(ctx->cert, (X509 *)parg);
 4651|       |
 4652|      0|    case SSL_CTRL_SET_CURRENT_CERT:
  ------------------
  |  | 1372|      0|#define SSL_CTRL_SET_CURRENT_CERT 117
  ------------------
  |  Branch (4652:5): [True: 0, False: 2.99k]
  ------------------
 4653|      0|        return ssl_cert_set_current(ctx->cert, larg);
 4654|       |
 4655|      0|    default:
  ------------------
  |  Branch (4655:5): [True: 0, False: 2.99k]
  ------------------
 4656|      0|        return 0;
 4657|  2.99k|    }
 4658|      6|    return 1;
 4659|  2.99k|}
ssl3_get_cipher_by_id:
 4716|     40|{
 4717|     40|    SSL_CIPHER c;
 4718|     40|    const SSL_CIPHER *cp;
 4719|       |
 4720|     40|    c.id = id;
 4721|     40|    cp = OBJ_bsearch_ssl_cipher_id(&c, tls13_ciphers, TLS13_NUM_CIPHERS);
  ------------------
  |  |   27|     40|#define TLS13_NUM_CIPHERS OSSL_NELEM(tls13_ciphers)
  |  |  ------------------
  |  |  |  |   14|     40|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  |  |  ------------------
  ------------------
 4722|     40|    if (cp != NULL)
  ------------------
  |  Branch (4722:9): [True: 3, False: 37]
  ------------------
 4723|      3|        return cp;
 4724|     37|    cp = OBJ_bsearch_ssl_cipher_id(&c, ssl3_ciphers, SSL3_NUM_CIPHERS);
  ------------------
  |  |   28|     37|#define SSL3_NUM_CIPHERS OSSL_NELEM(ssl3_ciphers)
  |  |  ------------------
  |  |  |  |   14|     37|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  |  |  ------------------
  ------------------
 4725|     37|    if (cp != NULL)
  ------------------
  |  Branch (4725:9): [True: 23, False: 14]
  ------------------
 4726|     23|        return cp;
 4727|     14|    return OBJ_bsearch_ssl_cipher_id(&c, ssl3_scsvs, SSL3_NUM_SCSVS);
  ------------------
  |  |   29|     14|#define SSL3_NUM_SCSVS OSSL_NELEM(ssl3_scsvs)
  |  |  ------------------
  |  |  |  |   14|     14|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  |  |  ------------------
  ------------------
 4728|     37|}
ssl3_get_cipher_by_std_name:
 4731|  12.0k|{
 4732|  12.0k|    SSL_CIPHER *tbl;
 4733|  12.0k|    SSL_CIPHER *alltabs[] = { tls13_ciphers, ssl3_ciphers, ssl3_scsvs };
 4734|  12.0k|    size_t i, j, tblsize[] = { TLS13_NUM_CIPHERS, SSL3_NUM_CIPHERS, SSL3_NUM_SCSVS };
  ------------------
  |  |   27|  12.0k|#define TLS13_NUM_CIPHERS OSSL_NELEM(tls13_ciphers)
  |  |  ------------------
  |  |  |  |   14|  12.0k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  |  |  ------------------
  ------------------
                  size_t i, j, tblsize[] = { TLS13_NUM_CIPHERS, SSL3_NUM_CIPHERS, SSL3_NUM_SCSVS };
  ------------------
  |  |   28|  12.0k|#define SSL3_NUM_CIPHERS OSSL_NELEM(ssl3_ciphers)
  |  |  ------------------
  |  |  |  |   14|  12.0k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  |  |  ------------------
  ------------------
                  size_t i, j, tblsize[] = { TLS13_NUM_CIPHERS, SSL3_NUM_CIPHERS, SSL3_NUM_SCSVS };
  ------------------
  |  |   29|  12.0k|#define SSL3_NUM_SCSVS OSSL_NELEM(ssl3_scsvs)
  |  |  ------------------
  |  |  |  |   14|  12.0k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  |  |  ------------------
  ------------------
 4735|       |
 4736|       |    /* this is not efficient, necessary to optimize this? */
 4737|  24.8k|    for (j = 0; j < OSSL_NELEM(alltabs); j++) {
  ------------------
  |  |   14|  24.8k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (4737:17): [True: 20.6k, False: 4.21k]
  ------------------
 4738|   882k|        for (i = 0, tbl = alltabs[j]; i < tblsize[j]; i++, tbl++) {
  ------------------
  |  Branch (4738:39): [True: 869k, False: 12.7k]
  ------------------
 4739|   869k|            if (tbl->stdname == NULL)
  ------------------
  |  Branch (4739:17): [True: 21.2k, False: 848k]
  ------------------
 4740|  21.2k|                continue;
 4741|   848k|            if (strcmp(stdname, tbl->stdname) == 0) {
  ------------------
  |  Branch (4741:17): [True: 7.84k, False: 840k]
  ------------------
 4742|  7.84k|                return tbl;
 4743|  7.84k|            }
 4744|   848k|        }
 4745|  20.6k|    }
 4746|  4.21k|    return NULL;
 4747|  12.0k|}
ssl3_get_cipher_by_char:
 4754|     40|{
 4755|     40|    return ssl3_get_cipher_by_id(SSL3_CK_CIPHERSUITE_FLAG
  ------------------
  |  |  254|     40|#define SSL3_CK_CIPHERSUITE_FLAG 0x03000000
  ------------------
 4756|     40|        | ((uint32_t)p[0] << 8L)
 4757|     40|        | (uint32_t)p[1]);
 4758|     40|}
ssl3_put_cipher_by_char:
 4761|  52.0k|{
 4762|  52.0k|    if ((c->id & 0xff000000) != SSL3_CK_CIPHERSUITE_FLAG) {
  ------------------
  |  |  254|  52.0k|#define SSL3_CK_CIPHERSUITE_FLAG 0x03000000
  ------------------
  |  Branch (4762:9): [True: 0, False: 52.0k]
  ------------------
 4763|      0|        *len = 0;
 4764|      0|        return 1;
 4765|      0|    }
 4766|       |
 4767|  52.0k|    if (!WPACKET_put_bytes_u16(pkt, c->id & 0xffff))
  ------------------
  |  |  891|  52.0k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (4767:9): [True: 0, False: 52.0k]
  ------------------
 4768|      0|        return 0;
 4769|       |
 4770|  52.0k|    *len = 2;
 4771|  52.0k|    return 1;
 4772|  52.0k|}
ssl3_renegotiate_check:
 5184|  2.07k|{
 5185|  2.07k|    int ret = 0;
 5186|  2.07k|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s);
  ------------------
  |  |   23|  2.07k|    SSL_CONNECTION_FROM_SSL_ONLY_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   17|  2.07k|    ((ssl) == NULL ? NULL                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (17:6): [True: 0, False: 2.07k]
  |  |  |  |  ------------------
  |  |  |  |   18|  2.07k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  2.07k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:23): [True: 2.07k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   19|  2.07k|                             ? (c SSL_CONNECTION *)(ssl)     \
  |  |  |  |   20|  2.07k|                             : NULL))
  |  |  ------------------
  ------------------
 5187|       |
 5188|  2.07k|    if (sc == NULL)
  ------------------
  |  Branch (5188:9): [True: 0, False: 2.07k]
  ------------------
 5189|      0|        return 0;
 5190|       |
 5191|  2.07k|    if (sc->s3.renegotiate) {
  ------------------
  |  Branch (5191:9): [True: 0, False: 2.07k]
  ------------------
 5192|      0|        if (!RECORD_LAYER_read_pending(&sc->rlayer)
  ------------------
  |  Branch (5192:13): [True: 0, False: 0]
  ------------------
 5193|      0|            && !RECORD_LAYER_write_pending(&sc->rlayer)
  ------------------
  |  Branch (5193:16): [True: 0, False: 0]
  ------------------
 5194|      0|            && (initok || !SSL_in_init(s))) {
  ------------------
  |  Branch (5194:17): [True: 0, False: 0]
  |  Branch (5194:27): [True: 0, False: 0]
  ------------------
 5195|       |            /*
 5196|       |             * if we are the server, and we have sent a 'RENEGOTIATE'
 5197|       |             * message, we need to set the state machine into the renegotiate
 5198|       |             * state.
 5199|       |             */
 5200|      0|            ossl_statem_set_renegotiate(sc);
 5201|      0|            sc->s3.renegotiate = 0;
 5202|      0|            sc->s3.num_renegotiations++;
 5203|      0|            sc->s3.total_renegotiations++;
 5204|      0|            ret = 1;
 5205|      0|        }
 5206|      0|    }
 5207|  2.07k|    return ret;
 5208|  2.07k|}
ssl_fill_hello_random:
 5241|  1.76k|{
 5242|  1.76k|    int send_time = 0, ret;
 5243|       |
 5244|  1.76k|    if (len < 4)
  ------------------
  |  Branch (5244:9): [True: 0, False: 1.76k]
  ------------------
 5245|      0|        return 0;
 5246|  1.76k|    if (server)
  ------------------
  |  Branch (5246:9): [True: 0, False: 1.76k]
  ------------------
 5247|      0|        send_time = (s->mode & SSL_MODE_SEND_SERVERHELLO_TIME) != 0;
  ------------------
  |  |  522|      0|#define SSL_MODE_SEND_SERVERHELLO_TIME 0x00000040U
  ------------------
 5248|  1.76k|    else
 5249|  1.76k|        send_time = (s->mode & SSL_MODE_SEND_CLIENTHELLO_TIME) != 0;
  ------------------
  |  |  521|  1.76k|#define SSL_MODE_SEND_CLIENTHELLO_TIME 0x00000020U
  ------------------
 5250|  1.76k|    if (send_time) {
  ------------------
  |  Branch (5250:9): [True: 0, False: 1.76k]
  ------------------
 5251|      0|        unsigned long Time = (unsigned long)time(NULL);
 5252|      0|        unsigned char *p = result;
 5253|       |
 5254|      0|        l2n(Time, p);
  ------------------
  |  |  153|      0|#define l2n(l, c) (*((c)++) = (unsigned char)(((l) >> 24) & 0xff), \
  |  |  154|      0|    *((c)++) = (unsigned char)(((l) >> 16) & 0xff),                \
  |  |  155|      0|    *((c)++) = (unsigned char)(((l) >> 8) & 0xff),                 \
  |  |  156|      0|    *((c)++) = (unsigned char)(((l)) & 0xff))
  ------------------
 5255|      0|        ret = RAND_bytes_ex(SSL_CONNECTION_GET_CTX(s)->libctx, p, len - 4, 0);
  ------------------
  |  |   26|      0|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
 5256|  1.76k|    } else {
 5257|  1.76k|        ret = RAND_bytes_ex(SSL_CONNECTION_GET_CTX(s)->libctx, result, len, 0);
  ------------------
  |  |   26|  1.76k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
 5258|  1.76k|    }
 5259|       |
 5260|  1.76k|    if (ret > 0) {
  ------------------
  |  Branch (5260:9): [True: 1.76k, False: 0]
  ------------------
 5261|  1.76k|        if (!ossl_assert(sizeof(tls11downgrade) < len)
  ------------------
  |  |   52|  3.53k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  3.53k|    __FILE__, __LINE__)
  ------------------
  |  Branch (5261:13): [True: 0, False: 1.76k]
  ------------------
 5262|  1.76k|            || !ossl_assert(sizeof(tls12downgrade) < len))
  ------------------
  |  |   52|  1.76k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  1.76k|    __FILE__, __LINE__)
  ------------------
  |  Branch (5262:16): [True: 0, False: 1.76k]
  ------------------
 5263|      0|            return 0;
 5264|  1.76k|        if (dgrd == DOWNGRADE_TO_1_2)
  ------------------
  |  Branch (5264:13): [True: 0, False: 1.76k]
  ------------------
 5265|      0|            memcpy(result + len - sizeof(tls12downgrade), tls12downgrade,
 5266|      0|                sizeof(tls12downgrade));
 5267|  1.76k|        else if (dgrd == DOWNGRADE_TO_1_1)
  ------------------
  |  Branch (5267:18): [True: 0, False: 1.76k]
  ------------------
 5268|      0|            memcpy(result + len - sizeof(tls11downgrade), tls11downgrade,
 5269|      0|                sizeof(tls11downgrade));
 5270|  1.76k|    }
 5271|       |
 5272|  1.76k|    return ret;
 5273|  1.76k|}
ssl_generate_pkey_group:
 5373|  2.95k|{
 5374|  2.95k|    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
  ------------------
  |  |   26|  2.95k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
 5375|  2.95k|    const TLS_GROUP_INFO *ginf = tls1_group_id_lookup(sctx, id);
 5376|  2.95k|    EVP_PKEY_CTX *pctx = NULL;
 5377|  2.95k|    EVP_PKEY *pkey = NULL;
 5378|       |
 5379|  2.95k|    if (ginf == NULL) {
  ------------------
  |  Branch (5379:9): [True: 0, False: 2.95k]
  ------------------
 5380|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 5381|      0|        goto err;
 5382|      0|    }
 5383|       |
 5384|  2.95k|    pctx = EVP_PKEY_CTX_new_from_name(sctx->libctx, ginf->algorithm,
 5385|  2.95k|        sctx->propq);
 5386|       |
 5387|  2.95k|    if (pctx == NULL) {
  ------------------
  |  Branch (5387:9): [True: 0, False: 2.95k]
  ------------------
 5388|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 5389|      0|        goto err;
 5390|      0|    }
 5391|  2.95k|    if (EVP_PKEY_keygen_init(pctx) <= 0) {
  ------------------
  |  Branch (5391:9): [True: 0, False: 2.95k]
  ------------------
 5392|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 5393|      0|        goto err;
 5394|      0|    }
 5395|  2.95k|    if (EVP_PKEY_CTX_set_group_name(pctx, ginf->realname) <= 0) {
  ------------------
  |  Branch (5395:9): [True: 0, False: 2.95k]
  ------------------
 5396|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 5397|      0|        goto err;
 5398|      0|    }
 5399|  2.95k|    if (EVP_PKEY_keygen(pctx, &pkey) <= 0) {
  ------------------
  |  Branch (5399:9): [True: 0, False: 2.95k]
  ------------------
 5400|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 5401|      0|        EVP_PKEY_free(pkey);
 5402|      0|        pkey = NULL;
 5403|      0|    }
 5404|       |
 5405|  2.95k|err:
 5406|  2.95k|    EVP_PKEY_CTX_free(pctx);
 5407|  2.95k|    return pkey;
 5408|  2.95k|}
s3_lib.c:cipher_compare:
 3720|    973|{
 3721|    973|    const SSL_CIPHER *ap = (const SSL_CIPHER *)a;
 3722|    973|    const SSL_CIPHER *bp = (const SSL_CIPHER *)b;
 3723|       |
 3724|    973|    if (ap->id == bp->id)
  ------------------
  |  Branch (3724:9): [True: 0, False: 973]
  ------------------
 3725|      0|        return 0;
 3726|    973|    return ap->id < bp->id ? -1 : 1;
  ------------------
  |  Branch (3726:12): [True: 626, False: 347]
  ------------------
 3727|    973|}

ssl3_send_alert:
   46|  1.61k|{
   47|  1.61k|    SSL *ssl = SSL_CONNECTION_GET_SSL(s);
  ------------------
  |  |   27|  1.61k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
   48|       |
   49|       |    /* Map tls/ssl alert value to correct one */
   50|  1.61k|    if (SSL_CONNECTION_TREAT_AS_TLS13(s))
  ------------------
  |  |  270|  1.61k|    (SSL_CONNECTION_IS_TLS13(s)                                  \
  |  |  ------------------
  |  |  |  |  265|  3.22k|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  |  |  ------------------
  |  |  |  |  |  |  258|  3.22k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   27|  1.61k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2190|  1.61k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (265:37): [True: 1.61k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  266|  1.61k|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  1.61k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  3.22k|#define TLS1_3_VERSION 0x0304
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (266:8): [True: 1.57k, False: 41]
  |  |  |  |  ------------------
  |  |  |  |  267|  3.22k|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  1.57k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  1.57k|#define TLS_ANY_VERSION 0x10000
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (267:8): [True: 5, False: 1.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  271|  1.61k|        || (s)->early_data_state == SSL_EARLY_DATA_CONNECTING    \
  |  |  ------------------
  |  |  |  Branch (271:12): [True: 0, False: 1.60k]
  |  |  ------------------
  |  |  272|  1.61k|        || (s)->early_data_state == SSL_EARLY_DATA_CONNECT_RETRY \
  |  |  ------------------
  |  |  |  Branch (272:12): [True: 0, False: 1.60k]
  |  |  ------------------
  |  |  273|  1.61k|        || (s)->early_data_state == SSL_EARLY_DATA_WRITING       \
  |  |  ------------------
  |  |  |  Branch (273:12): [True: 0, False: 1.60k]
  |  |  ------------------
  |  |  274|  1.61k|        || (s)->early_data_state == SSL_EARLY_DATA_WRITE_RETRY   \
  |  |  ------------------
  |  |  |  Branch (274:12): [True: 0, False: 1.60k]
  |  |  ------------------
  |  |  275|  1.61k|        || (s)->hello_retry_request == SSL_HRR_PENDING)
  |  |  ------------------
  |  |  |  Branch (275:12): [True: 3, False: 1.60k]
  |  |  ------------------
  ------------------
   51|      8|        desc = tls13_alert_code(desc);
   52|  1.60k|    else
   53|  1.60k|        desc = ssl->method->ssl3_enc->alert_value(desc);
   54|  1.61k|    if (s->version == SSL3_VERSION && desc == SSL_AD_PROTOCOL_VERSION)
  ------------------
  |  |   23|  3.22k|#define SSL3_VERSION 0x0300
  ------------------
                  if (s->version == SSL3_VERSION && desc == SSL_AD_PROTOCOL_VERSION)
  ------------------
  |  | 1239|      7|#define SSL_AD_PROTOCOL_VERSION TLS1_AD_PROTOCOL_VERSION
  |  |  ------------------
  |  |  |  |   64|      7|#define TLS1_AD_PROTOCOL_VERSION 70 /* fatal */
  |  |  ------------------
  ------------------
  |  Branch (54:9): [True: 7, False: 1.60k]
  |  Branch (54:39): [True: 0, False: 7]
  ------------------
   55|      0|        desc = SSL_AD_HANDSHAKE_FAILURE; /* SSL 3.0 does not have
  ------------------
  |  | 1219|      0|#define SSL_AD_HANDSHAKE_FAILURE SSL3_AD_HANDSHAKE_FAILURE
  |  |  ------------------
  |  |  |  |  256|      0|#define SSL3_AD_HANDSHAKE_FAILURE 40 /* fatal */
  |  |  ------------------
  ------------------
   56|       |                                          * protocol_version alerts */
   57|  1.61k|    if (desc < 0)
  ------------------
  |  Branch (57:9): [True: 0, False: 1.61k]
  ------------------
   58|      0|        return -1;
   59|  1.61k|    if (s->shutdown & SSL_SENT_SHUTDOWN && desc != SSL_AD_CLOSE_NOTIFY)
  ------------------
  |  |  215|  3.22k|#define SSL_SENT_SHUTDOWN 1
  ------------------
                  if (s->shutdown & SSL_SENT_SHUTDOWN && desc != SSL_AD_CLOSE_NOTIFY)
  ------------------
  |  | 1209|      0|#define SSL_AD_CLOSE_NOTIFY SSL3_AD_CLOSE_NOTIFY
  |  |  ------------------
  |  |  |  |  252|      0|#define SSL3_AD_CLOSE_NOTIFY 0
  |  |  ------------------
  ------------------
  |  Branch (59:9): [True: 0, False: 1.61k]
  |  Branch (59:44): [True: 0, False: 0]
  ------------------
   60|      0|        return -1;
   61|       |    /* If a fatal one, remove from cache */
   62|  1.61k|    if ((level == SSL3_AL_FATAL) && (s->session != NULL))
  ------------------
  |  |  250|  1.61k|#define SSL3_AL_FATAL 2
  ------------------
  |  Branch (62:9): [True: 1.61k, False: 0]
  |  Branch (62:37): [True: 1.61k, False: 4]
  ------------------
   63|  1.61k|        SSL_CTX_remove_session(s->session_ctx, s->session);
   64|       |
   65|  1.61k|    s->s3.alert_dispatch = SSL_ALERT_DISPATCH_PENDING;
  ------------------
  |  |  314|  1.61k|#define SSL_ALERT_DISPATCH_PENDING 1
  ------------------
   66|  1.61k|    s->s3.send_alert[0] = level;
   67|  1.61k|    s->s3.send_alert[1] = desc;
   68|  1.61k|    if (!RECORD_LAYER_write_pending(&s->rlayer)) {
  ------------------
  |  Branch (68:9): [True: 1.61k, False: 0]
  ------------------
   69|       |        /* data still being written out? */
   70|  1.61k|        return ssl->method->ssl_dispatch_alert(ssl);
   71|  1.61k|    }
   72|       |    /*
   73|       |     * else data is still being written out, we will get written some time in
   74|       |     * the future
   75|       |     */
   76|      0|    return -1;
   77|  1.61k|}
ssl3_dispatch_alert:
   80|  1.61k|{
   81|  1.61k|    int i, j;
   82|  1.61k|    void (*cb)(const SSL *ssl, int type, int val) = NULL;
   83|  1.61k|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  ------------------
  |  |   39|  1.61k|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|  1.61k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 1.61k]
  |  |  |  |  ------------------
  |  |  |  |   33|  1.61k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  1.61k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 1.61k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  1.61k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  1.61k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
   84|  1.61k|    OSSL_RECORD_TEMPLATE templ;
   85|       |
   86|  1.61k|    if (sc == NULL)
  ------------------
  |  Branch (86:9): [True: 0, False: 1.61k]
  ------------------
   87|      0|        return -1;
   88|       |
   89|  1.61k|    if (sc->rlayer.wrlmethod == NULL) {
  ------------------
  |  Branch (89:9): [True: 0, False: 1.61k]
  ------------------
   90|       |        /* No write record layer so we can't sent and alert. We just ignore it */
   91|      0|        sc->s3.alert_dispatch = SSL_ALERT_DISPATCH_NONE;
  ------------------
  |  |  312|      0|#define SSL_ALERT_DISPATCH_NONE 0
  ------------------
   92|      0|        return 1;
   93|      0|    }
   94|       |
   95|  1.61k|    templ.type = SSL3_RT_ALERT;
  ------------------
  |  |  220|  1.61k|#define SSL3_RT_ALERT 21
  ------------------
   96|  1.61k|    templ.version = (sc->version == TLS1_3_VERSION) ? TLS1_2_VERSION
  ------------------
  |  |   27|  1.61k|#define TLS1_3_VERSION 0x0304
  ------------------
                  templ.version = (sc->version == TLS1_3_VERSION) ? TLS1_2_VERSION
  ------------------
  |  |   26|  1.54k|#define TLS1_2_VERSION 0x0303
  ------------------
  |  Branch (96:21): [True: 1.54k, False: 69]
  ------------------
   97|  1.61k|                                                    : sc->version;
   98|  1.61k|    if (SSL_get_state(s) == TLS_ST_CW_CLNT_HELLO
  ------------------
  |  Branch (98:9): [True: 1.40k, False: 206]
  ------------------
   99|  1.40k|        && !sc->renegotiate
  ------------------
  |  Branch (99:12): [True: 1.40k, False: 0]
  ------------------
  100|  1.40k|        && TLS1_get_version(s) > TLS1_VERSION
  ------------------
  |  |   52|  1.40k|    ((SSL_version(s) >> 8) == TLS1_VERSION_MAJOR ? SSL_version(s) : 0)
  |  |  ------------------
  |  |  |  |   42|  1.40k|#define TLS1_VERSION_MAJOR 0x03
  |  |  ------------------
  |  |  |  Branch (52:6): [True: 1.40k, False: 0]
  |  |  ------------------
  ------------------
                      && TLS1_get_version(s) > TLS1_VERSION
  ------------------
  |  |   24|  3.02k|#define TLS1_VERSION 0x0301
  ------------------
  |  Branch (100:12): [True: 1.40k, False: 7]
  ------------------
  101|  1.40k|        && sc->hello_retry_request == SSL_HRR_NONE) {
  ------------------
  |  Branch (101:12): [True: 1.40k, False: 0]
  ------------------
  102|  1.40k|        templ.version = TLS1_VERSION;
  ------------------
  |  |   24|  1.40k|#define TLS1_VERSION 0x0301
  ------------------
  103|  1.40k|    }
  104|  1.61k|    templ.buf = &sc->s3.send_alert[0];
  105|  1.61k|    templ.buflen = 2;
  106|       |
  107|  1.61k|    if (RECORD_LAYER_write_pending(&sc->rlayer)) {
  ------------------
  |  Branch (107:9): [True: 0, False: 1.61k]
  ------------------
  108|      0|        if (sc->s3.alert_dispatch != SSL_ALERT_DISPATCH_RETRY) {
  ------------------
  |  |  316|      0|#define SSL_ALERT_DISPATCH_RETRY 2
  ------------------
  |  Branch (108:13): [True: 0, False: 0]
  ------------------
  109|       |            /*
  110|       |             * We have a write pending but it wasn't from a previous call to
  111|       |             * this function! Can we ever get here? Maybe via API misuse??
  112|       |             * Give up.
  113|       |             */
  114|      0|            sc->s3.alert_dispatch = SSL_ALERT_DISPATCH_NONE;
  ------------------
  |  |  312|      0|#define SSL_ALERT_DISPATCH_NONE 0
  ------------------
  115|      0|            return -1;
  116|      0|        }
  117|       |        /* Retry what we've already got pending */
  118|      0|        i = HANDLE_RLAYER_WRITE_RETURN(sc,
  ------------------
  |  |  169|      0|    ossl_tls_handle_rlayer_return(s, 1, ret, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   ossl_tls_handle_rlayer_return(s, 1, ret, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  119|      0|            sc->rlayer.wrlmethod->retry_write_records(sc->rlayer.wrl));
  120|      0|        if (i <= 0) {
  ------------------
  |  Branch (120:13): [True: 0, False: 0]
  ------------------
  121|       |            /* Could be NBIO. Keep alert_dispatch as SSL_ALERT_DISPATCH_RETRY */
  122|      0|            return -1;
  123|      0|        }
  124|      0|        sc->rlayer.wpend_tot = 0;
  125|      0|        sc->s3.alert_dispatch = SSL_ALERT_DISPATCH_NONE;
  ------------------
  |  |  312|      0|#define SSL_ALERT_DISPATCH_NONE 0
  ------------------
  126|      0|        return 1;
  127|      0|    }
  128|       |
  129|  1.61k|    i = HANDLE_RLAYER_WRITE_RETURN(sc,
  ------------------
  |  |  169|  1.61k|    ossl_tls_handle_rlayer_return(s, 1, ret, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   ossl_tls_handle_rlayer_return(s, 1, ret, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  130|  1.61k|        sc->rlayer.wrlmethod->write_records(sc->rlayer.wrl, &templ, 1));
  131|       |
  132|  1.61k|    if (i <= 0) {
  ------------------
  |  Branch (132:9): [True: 0, False: 1.61k]
  ------------------
  133|      0|        sc->s3.alert_dispatch = SSL_ALERT_DISPATCH_RETRY;
  ------------------
  |  |  316|      0|#define SSL_ALERT_DISPATCH_RETRY 2
  ------------------
  134|      0|        sc->rlayer.wpend_tot = templ.buflen;
  135|      0|        sc->rlayer.wpend_type = templ.type;
  136|      0|        sc->rlayer.wpend_buf = templ.buf;
  137|  1.61k|    } else {
  138|       |        /*
  139|       |         * Alert sent to BIO - now flush. If the message does not get sent due
  140|       |         * to non-blocking IO, we will not worry too much.
  141|       |         */
  142|  1.61k|        (void)BIO_flush(sc->wbio);
  ------------------
  |  |  641|  1.61k|#define BIO_flush(b) (int)BIO_ctrl(b, BIO_CTRL_FLUSH, 0, NULL)
  |  |  ------------------
  |  |  |  |  100|  1.61k|#define BIO_CTRL_FLUSH 11 /* opt - 'flush' buffered output */
  |  |  ------------------
  ------------------
  143|  1.61k|        sc->s3.alert_dispatch = SSL_ALERT_DISPATCH_NONE;
  ------------------
  |  |  312|  1.61k|#define SSL_ALERT_DISPATCH_NONE 0
  ------------------
  144|       |
  145|  1.61k|        if (sc->msg_callback)
  ------------------
  |  Branch (145:13): [True: 0, False: 1.61k]
  ------------------
  146|      0|            sc->msg_callback(1, sc->version, SSL3_RT_ALERT, sc->s3.send_alert,
  ------------------
  |  |  220|      0|#define SSL3_RT_ALERT 21
  ------------------
  147|      0|                2, s, sc->msg_callback_arg);
  148|       |
  149|  1.61k|        if (sc->info_callback != NULL)
  ------------------
  |  Branch (149:13): [True: 0, False: 1.61k]
  ------------------
  150|      0|            cb = sc->info_callback;
  151|  1.61k|        else if (s->ctx->info_callback != NULL)
  ------------------
  |  Branch (151:18): [True: 0, False: 1.61k]
  ------------------
  152|      0|            cb = s->ctx->info_callback;
  153|       |
  154|  1.61k|        if (cb != NULL) {
  ------------------
  |  Branch (154:13): [True: 0, False: 1.61k]
  ------------------
  155|      0|            j = (sc->s3.send_alert[0] << 8) | sc->s3.send_alert[1];
  156|      0|            cb(s, SSL_CB_WRITE_ALERT, j);
  ------------------
  |  | 1141|      0|#define SSL_CB_WRITE_ALERT (SSL_CB_ALERT | SSL_CB_WRITE)
  |  |  ------------------
  |  |  |  | 1139|      0|#define SSL_CB_ALERT 0x4000 /* used in callback */
  |  |  ------------------
  |  |               #define SSL_CB_WRITE_ALERT (SSL_CB_ALERT | SSL_CB_WRITE)
  |  |  ------------------
  |  |  |  | 1138|      0|#define SSL_CB_WRITE 0x08
  |  |  ------------------
  ------------------
  157|      0|        }
  158|  1.61k|    }
  159|  1.61k|    return i;
  160|  1.61k|}

SSL_get_ex_data_X509_STORE_CTX_idx:
   56|  2.56k|{
   57|       |
   58|  2.56k|    if (!RUN_ONCE(&ssl_x509_store_ctx_once, ssl_x509_store_ctx_init))
  ------------------
  |  |  130|  2.56k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2.56k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (58:9): [True: 0, False: 2.56k]
  ------------------
   59|      0|        return -1;
   60|  2.56k|    return ssl_x509_store_ctx_idx;
   61|  2.56k|}
ssl_cert_new:
   64|  2.56k|{
   65|  2.56k|    CERT *ret = NULL;
   66|       |
   67|       |    /* Should never happen */
   68|  2.56k|    if (!ossl_assert(ssl_pkey_num >= SSL_PKEY_NUM))
  ------------------
  |  |   52|  2.56k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  2.56k|    __FILE__, __LINE__)
  ------------------
  |  Branch (68:9): [True: 0, False: 2.56k]
  ------------------
   69|      0|        return NULL;
   70|       |
   71|  2.56k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|  2.56k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   72|  2.56k|    if (ret == NULL)
  ------------------
  |  Branch (72:9): [True: 0, False: 2.56k]
  ------------------
   73|      0|        return NULL;
   74|       |
   75|  2.56k|    ret->ssl_pkey_num = ssl_pkey_num;
   76|  2.56k|    ret->pkeys = OPENSSL_calloc(ret->ssl_pkey_num, sizeof(CERT_PKEY));
  ------------------
  |  |  112|  2.56k|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|  2.56k|    if (ret->pkeys == NULL) {
  ------------------
  |  Branch (77:9): [True: 0, False: 2.56k]
  ------------------
   78|      0|        OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   79|      0|        return NULL;
   80|      0|    }
   81|       |
   82|  2.56k|    ret->key = &(ret->pkeys[SSL_PKEY_RSA]);
  ------------------
  |  |  319|  2.56k|#define SSL_PKEY_RSA 0
  ------------------
   83|  2.56k|    ret->sec_cb = ssl_security_default_callback;
   84|  2.56k|    ret->sec_level = OPENSSL_TLS_SECURITY_LEVEL;
  ------------------
  |  |   31|  2.56k|#define OPENSSL_TLS_SECURITY_LEVEL 2
  ------------------
   85|  2.56k|    ret->sec_ex = NULL;
   86|  2.56k|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (86:9): [True: 0, False: 2.56k]
  ------------------
   87|      0|        OPENSSL_free(ret->pkeys);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   88|      0|        OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   89|      0|        return NULL;
   90|      0|    }
   91|       |
   92|  2.56k|    return ret;
   93|  2.56k|}
ssl_cert_dup:
   96|  1.77k|{
   97|  1.77k|    CERT *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|  1.77k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   98|  1.77k|    size_t i;
   99|       |#ifndef OPENSSL_NO_COMP_ALG
  100|       |    int j;
  101|       |#endif
  102|       |
  103|  1.77k|    if (ret == NULL)
  ------------------
  |  Branch (103:9): [True: 0, False: 1.77k]
  ------------------
  104|      0|        return NULL;
  105|       |
  106|  1.77k|    ret->ssl_pkey_num = cert->ssl_pkey_num;
  107|  1.77k|    ret->pkeys = OPENSSL_calloc(ret->ssl_pkey_num, sizeof(CERT_PKEY));
  ------------------
  |  |  112|  1.77k|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  108|  1.77k|    if (ret->pkeys == NULL) {
  ------------------
  |  Branch (108:9): [True: 0, False: 1.77k]
  ------------------
  109|      0|        OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  110|      0|        return NULL;
  111|      0|    }
  112|       |
  113|  1.77k|    ret->key = &ret->pkeys[cert->key - cert->pkeys];
  114|  1.77k|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (114:9): [True: 0, False: 1.77k]
  ------------------
  115|      0|        OPENSSL_free(ret->pkeys);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  116|      0|        OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  117|      0|        return NULL;
  118|      0|    }
  119|       |
  120|  1.77k|    if (cert->dh_tmp != NULL) {
  ------------------
  |  Branch (120:9): [True: 0, False: 1.77k]
  ------------------
  121|      0|        if (!EVP_PKEY_up_ref(cert->dh_tmp))
  ------------------
  |  Branch (121:13): [True: 0, False: 0]
  ------------------
  122|      0|            goto err;
  123|      0|        ret->dh_tmp = cert->dh_tmp;
  124|      0|    }
  125|       |
  126|  1.77k|    ret->dh_tmp_cb = cert->dh_tmp_cb;
  127|  1.77k|    ret->dh_tmp_auto = cert->dh_tmp_auto;
  128|       |
  129|  23.0k|    for (i = 0; i < ret->ssl_pkey_num; i++) {
  ------------------
  |  Branch (129:17): [True: 21.2k, False: 1.77k]
  ------------------
  130|  21.2k|        CERT_PKEY *cpk = cert->pkeys + i;
  131|  21.2k|        CERT_PKEY *rpk = ret->pkeys + i;
  132|       |
  133|  21.2k|        if (cpk->x509 != NULL) {
  ------------------
  |  Branch (133:13): [True: 0, False: 21.2k]
  ------------------
  134|      0|            if (!X509_up_ref(cpk->x509))
  ------------------
  |  Branch (134:17): [True: 0, False: 0]
  ------------------
  135|      0|                goto err;
  136|      0|            rpk->x509 = cpk->x509;
  137|      0|        }
  138|       |
  139|  21.2k|        if (cpk->privatekey != NULL) {
  ------------------
  |  Branch (139:13): [True: 0, False: 21.2k]
  ------------------
  140|      0|            if (!EVP_PKEY_up_ref(cpk->privatekey))
  ------------------
  |  Branch (140:17): [True: 0, False: 0]
  ------------------
  141|      0|                goto err;
  142|      0|            rpk->privatekey = cpk->privatekey;
  143|      0|        }
  144|       |
  145|  21.2k|        if (cpk->chain) {
  ------------------
  |  Branch (145:13): [True: 0, False: 21.2k]
  ------------------
  146|      0|            rpk->chain = X509_chain_up_ref(cpk->chain);
  147|      0|            if (!rpk->chain) {
  ------------------
  |  Branch (147:17): [True: 0, False: 0]
  ------------------
  148|      0|                ERR_raise(ERR_LIB_SSL, ERR_R_X509_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  149|      0|                goto err;
  150|      0|            }
  151|      0|        }
  152|  21.2k|        if (cpk->serverinfo != NULL) {
  ------------------
  |  Branch (152:13): [True: 0, False: 21.2k]
  ------------------
  153|       |            /* Just copy everything. */
  154|      0|            rpk->serverinfo = OPENSSL_memdup(cpk->serverinfo, cpk->serverinfo_length);
  ------------------
  |  |  133|      0|    CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  155|      0|            if (rpk->serverinfo == NULL)
  ------------------
  |  Branch (155:17): [True: 0, False: 0]
  ------------------
  156|      0|                goto err;
  157|      0|            rpk->serverinfo_length = cpk->serverinfo_length;
  158|      0|        }
  159|       |#ifndef OPENSSL_NO_COMP_ALG
  160|       |        for (j = TLSEXT_comp_cert_none; j < TLSEXT_comp_cert_limit; j++) {
  161|       |            if (cpk->comp_cert[j] != NULL) {
  162|       |                if (!OSSL_COMP_CERT_up_ref(cpk->comp_cert[j]))
  163|       |                    goto err;
  164|       |                rpk->comp_cert[j] = cpk->comp_cert[j];
  165|       |            }
  166|       |        }
  167|       |#endif
  168|  21.2k|    }
  169|       |
  170|       |    /* Configured sigalgs copied across */
  171|  1.77k|    if (cert->conf_sigalgs) {
  ------------------
  |  Branch (171:9): [True: 0, False: 1.77k]
  ------------------
  172|      0|        ret->conf_sigalgs = OPENSSL_malloc_array(cert->conf_sigalgslen,
  ------------------
  |  |  110|      0|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  173|      0|            sizeof(*cert->conf_sigalgs));
  174|      0|        if (ret->conf_sigalgs == NULL)
  ------------------
  |  Branch (174:13): [True: 0, False: 0]
  ------------------
  175|      0|            goto err;
  176|      0|        memcpy(ret->conf_sigalgs, cert->conf_sigalgs,
  177|      0|            cert->conf_sigalgslen * sizeof(*cert->conf_sigalgs));
  178|      0|        ret->conf_sigalgslen = cert->conf_sigalgslen;
  179|      0|    } else
  180|  1.77k|        ret->conf_sigalgs = NULL;
  181|       |
  182|  1.77k|    if (cert->client_sigalgs) {
  ------------------
  |  Branch (182:9): [True: 0, False: 1.77k]
  ------------------
  183|      0|        ret->client_sigalgs = OPENSSL_malloc_array(cert->client_sigalgslen,
  ------------------
  |  |  110|      0|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  184|      0|            sizeof(*cert->client_sigalgs));
  185|      0|        if (ret->client_sigalgs == NULL)
  ------------------
  |  Branch (185:13): [True: 0, False: 0]
  ------------------
  186|      0|            goto err;
  187|      0|        memcpy(ret->client_sigalgs, cert->client_sigalgs,
  188|      0|            cert->client_sigalgslen * sizeof(*cert->client_sigalgs));
  189|      0|        ret->client_sigalgslen = cert->client_sigalgslen;
  190|      0|    } else
  191|  1.77k|        ret->client_sigalgs = NULL;
  192|       |    /* Copy any custom client certificate types */
  193|  1.77k|    if (cert->ctype) {
  ------------------
  |  Branch (193:9): [True: 0, False: 1.77k]
  ------------------
  194|      0|        ret->ctype = OPENSSL_memdup(cert->ctype, cert->ctype_len);
  ------------------
  |  |  133|      0|    CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  195|      0|        if (ret->ctype == NULL)
  ------------------
  |  Branch (195:13): [True: 0, False: 0]
  ------------------
  196|      0|            goto err;
  197|      0|        ret->ctype_len = cert->ctype_len;
  198|      0|    }
  199|       |
  200|  1.77k|    ret->cert_flags = cert->cert_flags;
  201|       |
  202|  1.77k|    ret->cert_cb = cert->cert_cb;
  203|  1.77k|    ret->cert_cb_arg = cert->cert_cb_arg;
  204|       |
  205|  1.77k|    if (cert->verify_store) {
  ------------------
  |  Branch (205:9): [True: 0, False: 1.77k]
  ------------------
  206|      0|        if (!X509_STORE_up_ref(cert->verify_store))
  ------------------
  |  Branch (206:13): [True: 0, False: 0]
  ------------------
  207|      0|            goto err;
  208|      0|        ret->verify_store = cert->verify_store;
  209|      0|    }
  210|       |
  211|  1.77k|    if (cert->chain_store) {
  ------------------
  |  Branch (211:9): [True: 0, False: 1.77k]
  ------------------
  212|      0|        if (!X509_STORE_up_ref(cert->chain_store))
  ------------------
  |  Branch (212:13): [True: 0, False: 0]
  ------------------
  213|      0|            goto err;
  214|      0|        ret->chain_store = cert->chain_store;
  215|      0|    }
  216|       |
  217|  1.77k|    ret->sec_cb = cert->sec_cb;
  218|  1.77k|    ret->sec_level = cert->sec_level;
  219|  1.77k|    ret->sec_ex = cert->sec_ex;
  220|       |
  221|  1.77k|    if (!custom_exts_copy(&ret->custext, &cert->custext))
  ------------------
  |  Branch (221:9): [True: 0, False: 1.77k]
  ------------------
  222|      0|        goto err;
  223|  1.77k|#ifndef OPENSSL_NO_PSK
  224|  1.77k|    if (cert->psk_identity_hint) {
  ------------------
  |  Branch (224:9): [True: 0, False: 1.77k]
  ------------------
  225|      0|        ret->psk_identity_hint = OPENSSL_strdup(cert->psk_identity_hint);
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  226|      0|        if (ret->psk_identity_hint == NULL)
  ------------------
  |  Branch (226:13): [True: 0, False: 0]
  ------------------
  227|      0|            goto err;
  228|      0|    }
  229|  1.77k|#endif
  230|  1.77k|    return ret;
  231|       |
  232|      0|err:
  233|      0|    ssl_cert_free(ret);
  234|       |
  235|       |    return NULL;
  236|  1.77k|}
ssl_cert_clear_certs:
  241|  4.33k|{
  242|  4.33k|    size_t i;
  243|       |#ifndef OPENSSL_NO_COMP_ALG
  244|       |    int j;
  245|       |#endif
  246|       |
  247|  4.33k|    if (c == NULL)
  ------------------
  |  Branch (247:9): [True: 0, False: 4.33k]
  ------------------
  248|      0|        return;
  249|  56.0k|    for (i = 0; i < c->ssl_pkey_num; i++) {
  ------------------
  |  Branch (249:17): [True: 51.7k, False: 4.33k]
  ------------------
  250|  51.7k|        CERT_PKEY *cpk = c->pkeys + i;
  251|  51.7k|        X509_free(cpk->x509);
  252|  51.7k|        cpk->x509 = NULL;
  253|  51.7k|        EVP_PKEY_free(cpk->privatekey);
  254|  51.7k|        cpk->privatekey = NULL;
  255|  51.7k|        OSSL_STACK_OF_X509_free(cpk->chain);
  256|  51.7k|        cpk->chain = NULL;
  257|  51.7k|        OPENSSL_free(cpk->serverinfo);
  ------------------
  |  |  131|  51.7k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  258|  51.7k|        cpk->serverinfo = NULL;
  259|  51.7k|        cpk->serverinfo_length = 0;
  260|       |#ifndef OPENSSL_NO_COMP_ALG
  261|       |        for (j = 0; j < TLSEXT_comp_cert_limit; j++) {
  262|       |            OSSL_COMP_CERT_free(cpk->comp_cert[j]);
  263|       |            cpk->comp_cert[j] = NULL;
  264|       |            cpk->cert_comp_used = 0;
  265|       |        }
  266|       |#endif
  267|  51.7k|    }
  268|  4.33k|}
ssl_cert_free:
  271|  4.33k|{
  272|  4.33k|    int i;
  273|       |
  274|  4.33k|    if (c == NULL)
  ------------------
  |  Branch (274:9): [True: 0, False: 4.33k]
  ------------------
  275|      0|        return;
  276|  4.33k|    CRYPTO_DOWN_REF(&c->references, &i);
  277|  4.33k|    REF_PRINT_COUNT("CERT", i, c);
  ------------------
  |  |  301|  4.33k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  4.33k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  297|  4.33k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  285|  4.33k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  278|  4.33k|    if (i > 0)
  ------------------
  |  Branch (278:9): [True: 0, False: 4.33k]
  ------------------
  279|      0|        return;
  280|  4.33k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|  4.33k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 4.33k]
  |  |  ------------------
  ------------------
  281|       |
  282|  4.33k|    EVP_PKEY_free(c->dh_tmp);
  283|       |
  284|  4.33k|    ssl_cert_clear_certs(c);
  285|  4.33k|    OPENSSL_free(c->conf_sigalgs);
  ------------------
  |  |  131|  4.33k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  286|  4.33k|    OPENSSL_free(c->client_sigalgs);
  ------------------
  |  |  131|  4.33k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  287|  4.33k|    OPENSSL_free(c->ctype);
  ------------------
  |  |  131|  4.33k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  288|  4.33k|    X509_STORE_free(c->verify_store);
  289|  4.33k|    X509_STORE_free(c->chain_store);
  290|  4.33k|    custom_exts_free(&c->custext);
  291|  4.33k|#ifndef OPENSSL_NO_PSK
  292|  4.33k|    OPENSSL_free(c->psk_identity_hint);
  ------------------
  |  |  131|  4.33k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  293|  4.33k|#endif
  294|  4.33k|    OPENSSL_free(c->pkeys);
  ------------------
  |  |  131|  4.33k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  295|  4.33k|    CRYPTO_FREE_REF(&c->references);
  296|  4.33k|    OPENSSL_free(c);
  ------------------
  |  |  131|  4.33k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  297|  4.33k|}
SSL_get0_CA_list:
  631|  1.63k|{
  632|  1.63k|    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s);
  ------------------
  |  |   41|  1.63k|    SSL_CONNECTION_FROM_SSL_int(ssl, const)
  |  |  ------------------
  |  |  |  |   32|  1.63k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 1.63k]
  |  |  |  |  ------------------
  |  |  |  |   33|  1.63k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  1.63k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 1.63k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  1.63k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  1.63k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
  633|       |
  634|  1.63k|    if (sc == NULL)
  ------------------
  |  Branch (634:9): [True: 0, False: 1.63k]
  ------------------
  635|      0|        return NULL;
  636|       |
  637|  1.63k|    return sc->ca_names != NULL ? sc->ca_names : s->ctx->ca_names;
  ------------------
  |  Branch (637:12): [True: 0, False: 1.63k]
  ------------------
  638|  1.63k|}
ssl_get_security_level_bits:
 1219|   275k|{
 1220|   275k|    int level;
 1221|       |    /*
 1222|       |     * note that there's a corresponding minbits_table
 1223|       |     * in crypto/x509/x509_vfy.c that's used for checking the security level
 1224|       |     * of RSA and DSA keys
 1225|       |     */
 1226|   275k|    static const int minbits_table[5 + 1] = { 0, 80, 112, 128, 192, 256 };
 1227|       |
 1228|   275k|    if (ctx != NULL)
  ------------------
  |  Branch (1228:9): [True: 0, False: 275k]
  ------------------
 1229|      0|        level = SSL_CTX_get_security_level(ctx);
 1230|   275k|    else
 1231|   275k|        level = SSL_get_security_level(s);
 1232|       |
 1233|   275k|    if (level > 5)
  ------------------
  |  Branch (1233:9): [True: 0, False: 275k]
  ------------------
 1234|      0|        level = 5;
 1235|   275k|    else if (level < 0)
  ------------------
  |  Branch (1235:14): [True: 0, False: 275k]
  ------------------
 1236|      0|        level = 0;
 1237|       |
 1238|   275k|    if (levelp != NULL)
  ------------------
  |  Branch (1238:9): [True: 275k, False: 0]
  ------------------
 1239|   275k|        *levelp = level;
 1240|       |
 1241|   275k|    return minbits_table[level];
 1242|   275k|}
ssl_security:
 1315|   275k|{
 1316|   275k|    return s->cert->sec_cb(SSL_CONNECTION_GET_USER_SSL(s), NULL, op, bits, nid,
  ------------------
  |  |   28|   275k|#define SSL_CONNECTION_GET_USER_SSL(sc) ((sc)->user_ssl)
  ------------------
 1317|   275k|        other, s->cert->sec_ex);
 1318|   275k|}
ssl_cert_lookup_by_idx:
 1376|   203k|{
 1377|   203k|    if (idx >= (OSSL_NELEM(ssl_cert_info) + ctx->sigalg_list_len))
  ------------------
  |  |   14|   203k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (1377:9): [True: 0, False: 203k]
  ------------------
 1378|      0|        return NULL;
 1379|   203k|    else if (idx >= (OSSL_NELEM(ssl_cert_info)))
  ------------------
  |  |   14|   203k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (1379:14): [True: 15.1k, False: 188k]
  ------------------
 1380|  15.1k|        return &(ctx->ssl_cert_info[idx - SSL_PKEY_NUM]);
  ------------------
  |  |  328|  15.1k|#define SSL_PKEY_NUM 9
  ------------------
 1381|   188k|    return &ssl_cert_info[idx];
 1382|   203k|}
ssl_cert.c:ssl_x509_store_ctx_init:
   48|      1|{
   49|      1|    ssl_x509_store_ctx_idx = X509_STORE_CTX_get_ex_new_index(0,
  ------------------
  |  |  774|      1|    CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE_CTX, l, p, newf, dupf, freef)
  |  |  ------------------
  |  |  |  |  255|      1|#define CRYPTO_EX_INDEX_X509_STORE_CTX 5
  |  |  ------------------
  ------------------
   50|      1|        "SSL for verify callback",
   51|      1|        NULL, NULL, NULL);
   52|      1|    return ssl_x509_store_ctx_idx >= 0;
   53|      1|}
ssl_cert.c:ssl_security_default_callback:
 1247|   275k|{
 1248|   275k|    int level, minbits, pfs_mask;
 1249|   275k|    const SSL_CONNECTION *sc;
 1250|       |
 1251|   275k|    minbits = ssl_get_security_level_bits(s, ctx, &level);
 1252|       |
 1253|   275k|    if (level == 0) {
  ------------------
  |  Branch (1253:9): [True: 1.81k, False: 273k]
  ------------------
 1254|       |        /*
 1255|       |         * No EDH keys weaker than 1024-bits even at level 0, otherwise,
 1256|       |         * anything goes.
 1257|       |         */
 1258|  1.81k|        if (op == SSL_SECOP_TMP_DH && bits < 80)
  ------------------
  |  | 2764|  3.63k|#define SSL_SECOP_TMP_DH (7 | SSL_SECOP_OTHER_PKEY)
  |  |  ------------------
  |  |  |  | 2741|  1.81k|#define SSL_SECOP_OTHER_PKEY (4 << 16)
  |  |  ------------------
  ------------------
  |  Branch (1258:13): [True: 0, False: 1.81k]
  |  Branch (1258:39): [True: 0, False: 0]
  ------------------
 1259|      0|            return 0;
 1260|  1.81k|        return 1;
 1261|  1.81k|    }
 1262|   273k|    switch (op) {
 1263|   158k|    case SSL_SECOP_CIPHER_SUPPORTED:
  ------------------
  |  | 2752|   158k|#define SSL_SECOP_CIPHER_SUPPORTED (1 | SSL_SECOP_OTHER_CIPHER)
  |  |  ------------------
  |  |  |  | 2738|   158k|#define SSL_SECOP_OTHER_CIPHER (1 << 16)
  |  |  ------------------
  ------------------
  |  Branch (1263:5): [True: 158k, False: 114k]
  ------------------
 1264|   158k|    case SSL_SECOP_CIPHER_SHARED:
  ------------------
  |  | 2754|   158k|#define SSL_SECOP_CIPHER_SHARED (2 | SSL_SECOP_OTHER_CIPHER)
  |  |  ------------------
  |  |  |  | 2738|   158k|#define SSL_SECOP_OTHER_CIPHER (1 << 16)
  |  |  ------------------
  ------------------
  |  Branch (1264:5): [True: 0, False: 273k]
  ------------------
 1265|   158k|    case SSL_SECOP_CIPHER_CHECK: {
  ------------------
  |  | 2756|   158k|#define SSL_SECOP_CIPHER_CHECK (3 | SSL_SECOP_OTHER_CIPHER)
  |  |  ------------------
  |  |  |  | 2738|   158k|#define SSL_SECOP_OTHER_CIPHER (1 << 16)
  |  |  ------------------
  ------------------
  |  Branch (1265:5): [True: 22, False: 273k]
  ------------------
 1266|   158k|        const SSL_CIPHER *c = other;
 1267|       |        /* No ciphers below security level */
 1268|   158k|        if (bits < minbits)
  ------------------
  |  Branch (1268:13): [True: 2.45k, False: 156k]
  ------------------
 1269|  2.45k|            return 0;
 1270|       |        /* No unauthenticated ciphersuites */
 1271|   156k|        if (c->algorithm_auth & SSL_aNULL)
  ------------------
  |  |  112|   156k|#define SSL_aNULL 0x00000004U
  ------------------
  |  Branch (1271:13): [True: 3.43k, False: 152k]
  ------------------
 1272|  3.43k|            return 0;
 1273|       |        /* No MD5 mac ciphersuites */
 1274|   152k|        if (c->algorithm_mac & SSL_MD5)
  ------------------
  |  |  168|   152k|#define SSL_MD5 0x00000001U
  ------------------
  |  Branch (1274:13): [True: 0, False: 152k]
  ------------------
 1275|      0|            return 0;
 1276|       |        /* SHA1 HMAC is 160 bits of security */
 1277|   152k|        if (minbits > 160 && c->algorithm_mac & SSL_SHA1)
  ------------------
  |  |  169|    738|#define SSL_SHA1 0x00000002U
  ------------------
  |  Branch (1277:13): [True: 738, False: 151k]
  |  Branch (1277:30): [True: 163, False: 575]
  ------------------
 1278|    163|            return 0;
 1279|       |        /* Level 3: forward secure ciphersuites only */
 1280|   152k|        pfs_mask = SSL_kDHE | SSL_kECDHE | SSL_kDHEPSK | SSL_kECDHEPSK;
  ------------------
  |  |   83|   152k|#define SSL_kDHE 0x00000002U
  ------------------
                      pfs_mask = SSL_kDHE | SSL_kECDHE | SSL_kDHEPSK | SSL_kECDHEPSK;
  ------------------
  |  |   85|   152k|#define SSL_kECDHE 0x00000004U
  ------------------
                      pfs_mask = SSL_kDHE | SSL_kECDHE | SSL_kDHEPSK | SSL_kECDHEPSK;
  ------------------
  |  |   95|   152k|#define SSL_kDHEPSK 0x00000100U
  ------------------
                      pfs_mask = SSL_kDHE | SSL_kECDHE | SSL_kDHEPSK | SSL_kECDHEPSK;
  ------------------
  |  |   94|   152k|#define SSL_kECDHEPSK 0x00000080U
  ------------------
 1281|   152k|        if (level >= 3 && c->min_tls != TLS1_3_VERSION && !(c->algorithm_mkey & pfs_mask))
  ------------------
  |  |   27|   153k|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (1281:13): [True: 1.17k, False: 151k]
  |  Branch (1281:27): [True: 1.08k, False: 93]
  |  Branch (1281:59): [True: 241, False: 841]
  ------------------
 1282|    241|            return 0;
 1283|   152k|        break;
 1284|   152k|    }
 1285|   152k|    case SSL_SECOP_VERSION:
  ------------------
  |  | 2766|  36.1k|#define SSL_SECOP_VERSION (9 | SSL_SECOP_OTHER_NONE)
  |  |  ------------------
  |  |  |  | 2737|  36.1k|#define SSL_SECOP_OTHER_NONE 0
  |  |  ------------------
  ------------------
  |  Branch (1285:5): [True: 36.1k, False: 237k]
  ------------------
 1286|  36.1k|        if ((sc = SSL_CONNECTION_FROM_CONST_SSL(s)) == NULL)
  ------------------
  |  |   41|  36.1k|    SSL_CONNECTION_FROM_SSL_int(ssl, const)
  |  |  ------------------
  |  |  |  |   32|  36.1k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 36.1k]
  |  |  |  |  ------------------
  |  |  |  |   33|  36.1k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  36.1k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 36.1k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  36.1k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  36.1k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
  |  Branch (1286:13): [True: 0, False: 36.1k]
  ------------------
 1287|      0|            return 0;
 1288|  36.1k|        if (!SSL_CONNECTION_IS_DTLS(sc)) {
  ------------------
  |  |  258|  36.1k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  36.1k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  36.1k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  ------------------
  |  Branch (1288:13): [True: 36.1k, False: 0]
  ------------------
 1289|       |            /* SSLv3, TLS v1.0 and TLS v1.1 only allowed at level 0 */
 1290|  36.1k|            if (nid <= TLS1_1_VERSION && level > 0)
  ------------------
  |  |   25|  72.2k|#define TLS1_1_VERSION 0x0302
  ------------------
  |  Branch (1290:17): [True: 3.58k, False: 32.5k]
  |  Branch (1290:42): [True: 3.58k, False: 0]
  ------------------
 1291|  3.58k|                return 0;
 1292|  36.1k|        } else {
 1293|       |            /* DTLS v1.0 only allowed at level 0 */
 1294|      0|            if (DTLS_VERSION_LT(nid, DTLS1_2_VERSION) && level > 0)
  ------------------
  |  |   60|      0|#define DTLS_VERSION_LT(v1, v2) (dtls_ver_ordinal(v1) > dtls_ver_ordinal(v2))
  |  |  ------------------
  |  |  |  |   57|      0|#define dtls_ver_ordinal(v1) (((v1) == DTLS1_BAD_VER) ? 0xff00 : (v1))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|      0|#define DTLS1_BAD_VER 0x0100
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:31): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DTLS_VERSION_LT(v1, v2) (dtls_ver_ordinal(v1) > dtls_ver_ordinal(v2))
  |  |  ------------------
  |  |  |  |   57|      0|#define dtls_ver_ordinal(v1) (((v1) == DTLS1_BAD_VER) ? 0xff00 : (v1))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|      0|#define DTLS1_BAD_VER 0x0100
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:31): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (60:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1294:58): [True: 0, False: 0]
  ------------------
 1295|      0|                return 0;
 1296|      0|        }
 1297|  32.5k|        break;
 1298|       |
 1299|  32.5k|    case SSL_SECOP_COMPRESSION:
  ------------------
  |  | 2778|      0|#define SSL_SECOP_COMPRESSION (15 | SSL_SECOP_OTHER_NONE)
  |  |  ------------------
  |  |  |  | 2737|      0|#define SSL_SECOP_OTHER_NONE 0
  |  |  ------------------
  ------------------
  |  Branch (1299:5): [True: 0, False: 273k]
  ------------------
 1300|      0|        if (level >= 2)
  ------------------
  |  Branch (1300:13): [True: 0, False: 0]
  ------------------
 1301|      0|            return 0;
 1302|      0|        break;
 1303|      0|    case SSL_SECOP_TICKET:
  ------------------
  |  | 2768|      0|#define SSL_SECOP_TICKET (10 | SSL_SECOP_OTHER_NONE)
  |  |  ------------------
  |  |  |  | 2737|      0|#define SSL_SECOP_OTHER_NONE 0
  |  |  ------------------
  ------------------
  |  Branch (1303:5): [True: 0, False: 273k]
  ------------------
 1304|      0|        if (level >= 3)
  ------------------
  |  Branch (1304:13): [True: 0, False: 0]
  ------------------
 1305|      0|            return 0;
 1306|      0|        break;
 1307|  78.7k|    default:
  ------------------
  |  Branch (1307:5): [True: 78.7k, False: 194k]
  ------------------
 1308|  78.7k|        if (bits < minbits)
  ------------------
  |  Branch (1308:13): [True: 5.27k, False: 73.4k]
  ------------------
 1309|  5.27k|            return 0;
 1310|   273k|    }
 1311|   258k|    return 1;
 1312|   273k|}

ssl_load_ciphers:
  327|  2.56k|{
  328|  2.56k|    size_t i;
  329|  2.56k|    const ssl_cipher_table *t;
  330|  2.56k|    EVP_KEYEXCH *kex = NULL;
  331|  2.56k|    EVP_SIGNATURE *sig = NULL;
  332|       |
  333|  2.56k|    ctx->disabled_enc_mask = 0;
  334|  64.0k|    for (i = 0, t = ssl_cipher_table_cipher; i < SSL_ENC_NUM_IDX; i++, t++) {
  ------------------
  |  |  354|  64.0k|#define SSL_ENC_NUM_IDX 24
  ------------------
  |  Branch (334:46): [True: 61.4k, False: 2.56k]
  ------------------
  335|  61.4k|        if (t->nid != NID_undef) {
  ------------------
  |  |   18|  61.4k|#define NID_undef                       0
  ------------------
  |  Branch (335:13): [True: 58.9k, False: 2.56k]
  ------------------
  336|  58.9k|            const EVP_CIPHER *cipher
  337|  58.9k|                = ssl_evp_cipher_fetch(ctx->libctx, t->nid, ctx->propq);
  338|       |
  339|  58.9k|            ctx->ssl_cipher_methods[i] = cipher;
  340|  58.9k|            if (cipher == NULL)
  ------------------
  |  Branch (340:17): [True: 24.2k, False: 34.7k]
  ------------------
  341|  24.2k|                ctx->disabled_enc_mask |= t->mask;
  342|  58.9k|        }
  343|  61.4k|    }
  344|  2.56k|    ctx->disabled_mac_mask = 0;
  345|  38.4k|    for (i = 0, t = ssl_cipher_table_mac; i < SSL_MD_NUM_IDX; i++, t++) {
  ------------------
  |  |  203|  38.4k|#define SSL_MD_NUM_IDX SSL_MAX_DIGEST
  |  |  ------------------
  |  |  |  |  201|  38.4k|#define SSL_MAX_DIGEST 14
  |  |  ------------------
  ------------------
  |  Branch (345:43): [True: 35.8k, False: 2.56k]
  ------------------
  346|  35.8k|        const EVP_MD *md
  347|  35.8k|            = ssl_evp_md_fetch(ctx->libctx, t->nid, ctx->propq);
  348|       |
  349|  35.8k|        ctx->ssl_digest_methods[i] = md;
  350|  35.8k|        if (md == NULL) {
  ------------------
  |  Branch (350:13): [True: 18.5k, False: 17.3k]
  ------------------
  351|  18.5k|            ctx->disabled_mac_mask |= t->mask;
  352|  18.5k|        } else {
  353|  17.3k|            int tmpsize = EVP_MD_get_size(md);
  354|       |
  355|  17.3k|            if (!ossl_assert(tmpsize > 0))
  ------------------
  |  |   52|  17.3k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  17.3k|    __FILE__, __LINE__)
  ------------------
  |  Branch (355:17): [True: 0, False: 17.3k]
  ------------------
  356|      0|                return 0;
  357|  17.3k|            ctx->ssl_mac_secret_size[i] = tmpsize;
  358|  17.3k|        }
  359|  35.8k|    }
  360|       |
  361|  2.56k|    ctx->disabled_mkey_mask = 0;
  362|  2.56k|    ctx->disabled_auth_mask = 0;
  363|       |
  364|       |    /*
  365|       |     * We ignore any errors from the fetches below. They are expected to fail
  366|       |     * if these algorithms are not available.
  367|       |     */
  368|  2.56k|    ERR_set_mark();
  369|  2.56k|    sig = EVP_SIGNATURE_fetch(ctx->libctx, "DSA", ctx->propq);
  370|  2.56k|    if (sig == NULL)
  ------------------
  |  Branch (370:9): [True: 83, False: 2.47k]
  ------------------
  371|     83|        ctx->disabled_auth_mask |= SSL_aDSS;
  ------------------
  |  |  110|     83|#define SSL_aDSS 0x00000002U
  ------------------
  372|  2.47k|    else
  373|  2.47k|        EVP_SIGNATURE_free(sig);
  374|  2.56k|    kex = EVP_KEYEXCH_fetch(ctx->libctx, "DH", ctx->propq);
  375|  2.56k|    if (kex == NULL)
  ------------------
  |  Branch (375:9): [True: 83, False: 2.47k]
  ------------------
  376|     83|        ctx->disabled_mkey_mask |= SSL_kDHE | SSL_kDHEPSK;
  ------------------
  |  |   83|     83|#define SSL_kDHE 0x00000002U
  ------------------
                      ctx->disabled_mkey_mask |= SSL_kDHE | SSL_kDHEPSK;
  ------------------
  |  |   95|     83|#define SSL_kDHEPSK 0x00000100U
  ------------------
  377|  2.47k|    else
  378|  2.47k|        EVP_KEYEXCH_free(kex);
  379|  2.56k|    kex = EVP_KEYEXCH_fetch(ctx->libctx, "ECDH", ctx->propq);
  380|  2.56k|    if (kex == NULL)
  ------------------
  |  Branch (380:9): [True: 83, False: 2.47k]
  ------------------
  381|     83|        ctx->disabled_mkey_mask |= SSL_kECDHE | SSL_kECDHEPSK;
  ------------------
  |  |   85|     83|#define SSL_kECDHE 0x00000004U
  ------------------
                      ctx->disabled_mkey_mask |= SSL_kECDHE | SSL_kECDHEPSK;
  ------------------
  |  |   94|     83|#define SSL_kECDHEPSK 0x00000080U
  ------------------
  382|  2.47k|    else
  383|  2.47k|        EVP_KEYEXCH_free(kex);
  384|  2.56k|    sig = EVP_SIGNATURE_fetch(ctx->libctx, "ECDSA", ctx->propq);
  385|  2.56k|    if (sig == NULL)
  ------------------
  |  Branch (385:9): [True: 83, False: 2.47k]
  ------------------
  386|     83|        ctx->disabled_auth_mask |= SSL_aECDSA;
  ------------------
  |  |  114|     83|#define SSL_aECDSA 0x00000008U
  ------------------
  387|  2.47k|    else
  388|  2.47k|        EVP_SIGNATURE_free(sig);
  389|  2.56k|    ERR_pop_to_mark();
  390|       |
  391|       |#ifdef OPENSSL_NO_PSK
  392|       |    ctx->disabled_mkey_mask |= SSL_PSK;
  393|       |    ctx->disabled_auth_mask |= SSL_aPSK;
  394|       |#endif
  395|       |#ifdef OPENSSL_NO_SRP
  396|       |    ctx->disabled_mkey_mask |= SSL_kSRP;
  397|       |#endif
  398|       |
  399|       |    /*
  400|       |     * Check for presence of GOST 34.10 algorithms, and if they are not
  401|       |     * present, disable appropriate auth and key exchange
  402|       |     */
  403|  2.56k|    memcpy(ctx->ssl_mac_pkey_id, default_mac_pkey_id,
  404|  2.56k|        sizeof(ctx->ssl_mac_pkey_id));
  405|       |
  406|  2.56k|    ctx->ssl_mac_pkey_id[SSL_MD_GOST89MAC_IDX] = get_optional_pkey_id(SN_id_Gost28147_89_MAC);
  ------------------
  |  |  190|  2.56k|#define SSL_MD_GOST89MAC_IDX 3
  ------------------
                  ctx->ssl_mac_pkey_id[SSL_MD_GOST89MAC_IDX] = get_optional_pkey_id(SN_id_Gost28147_89_MAC);
  ------------------
  |  | 4607|  2.56k|#define SN_id_Gost28147_89_MAC          "gost-mac"
  ------------------
  407|  2.56k|    if (ctx->ssl_mac_pkey_id[SSL_MD_GOST89MAC_IDX])
  ------------------
  |  |  190|  2.56k|#define SSL_MD_GOST89MAC_IDX 3
  ------------------
  |  Branch (407:9): [True: 0, False: 2.56k]
  ------------------
  408|      0|        ctx->ssl_mac_secret_size[SSL_MD_GOST89MAC_IDX] = 32;
  ------------------
  |  |  190|      0|#define SSL_MD_GOST89MAC_IDX 3
  ------------------
  409|  2.56k|    else
  410|  2.56k|        ctx->disabled_mac_mask |= SSL_GOST89MAC;
  ------------------
  |  |  171|  2.56k|#define SSL_GOST89MAC 0x00000008U
  ------------------
  411|       |
  412|  2.56k|    ctx->ssl_mac_pkey_id[SSL_MD_GOST89MAC12_IDX] = get_optional_pkey_id(SN_gost_mac_12);
  ------------------
  |  |  194|  2.56k|#define SSL_MD_GOST89MAC12_IDX 7
  ------------------
                  ctx->ssl_mac_pkey_id[SSL_MD_GOST89MAC12_IDX] = get_optional_pkey_id(SN_gost_mac_12);
  ------------------
  |  | 4612|  2.56k|#define SN_gost_mac_12          "gost-mac-12"
  ------------------
  413|  2.56k|    if (ctx->ssl_mac_pkey_id[SSL_MD_GOST89MAC12_IDX])
  ------------------
  |  |  194|  2.56k|#define SSL_MD_GOST89MAC12_IDX 7
  ------------------
  |  Branch (413:9): [True: 0, False: 2.56k]
  ------------------
  414|      0|        ctx->ssl_mac_secret_size[SSL_MD_GOST89MAC12_IDX] = 32;
  ------------------
  |  |  194|      0|#define SSL_MD_GOST89MAC12_IDX 7
  ------------------
  415|  2.56k|    else
  416|  2.56k|        ctx->disabled_mac_mask |= SSL_GOST89MAC12;
  ------------------
  |  |  177|  2.56k|#define SSL_GOST89MAC12 0x00000100U
  ------------------
  417|       |
  418|  2.56k|    ctx->ssl_mac_pkey_id[SSL_MD_MAGMAOMAC_IDX] = get_optional_pkey_id(SN_magma_mac);
  ------------------
  |  |  199|  2.56k|#define SSL_MD_MAGMAOMAC_IDX 12
  ------------------
                  ctx->ssl_mac_pkey_id[SSL_MD_MAGMAOMAC_IDX] = get_optional_pkey_id(SN_magma_mac);
  ------------------
  |  | 5071|  2.56k|#define SN_magma_mac            "magma-mac"
  ------------------
  419|  2.56k|    if (ctx->ssl_mac_pkey_id[SSL_MD_MAGMAOMAC_IDX])
  ------------------
  |  |  199|  2.56k|#define SSL_MD_MAGMAOMAC_IDX 12
  ------------------
  |  Branch (419:9): [True: 0, False: 2.56k]
  ------------------
  420|      0|        ctx->ssl_mac_secret_size[SSL_MD_MAGMAOMAC_IDX] = 32;
  ------------------
  |  |  199|      0|#define SSL_MD_MAGMAOMAC_IDX 12
  ------------------
  421|  2.56k|    else
  422|  2.56k|        ctx->disabled_mac_mask |= SSL_MAGMAOMAC;
  ------------------
  |  |  179|  2.56k|#define SSL_MAGMAOMAC 0x00000400U
  ------------------
  423|       |
  424|  2.56k|    ctx->ssl_mac_pkey_id[SSL_MD_KUZNYECHIKOMAC_IDX] = get_optional_pkey_id(SN_kuznyechik_mac);
  ------------------
  |  |  200|  2.56k|#define SSL_MD_KUZNYECHIKOMAC_IDX 13
  ------------------
                  ctx->ssl_mac_pkey_id[SSL_MD_KUZNYECHIKOMAC_IDX] = get_optional_pkey_id(SN_kuznyechik_mac);
  ------------------
  |  | 5053|  2.56k|#define SN_kuznyechik_mac               "kuznyechik-mac"
  ------------------
  425|  2.56k|    if (ctx->ssl_mac_pkey_id[SSL_MD_KUZNYECHIKOMAC_IDX])
  ------------------
  |  |  200|  2.56k|#define SSL_MD_KUZNYECHIKOMAC_IDX 13
  ------------------
  |  Branch (425:9): [True: 0, False: 2.56k]
  ------------------
  426|      0|        ctx->ssl_mac_secret_size[SSL_MD_KUZNYECHIKOMAC_IDX] = 32;
  ------------------
  |  |  200|      0|#define SSL_MD_KUZNYECHIKOMAC_IDX 13
  ------------------
  427|  2.56k|    else
  428|  2.56k|        ctx->disabled_mac_mask |= SSL_KUZNYECHIKOMAC;
  ------------------
  |  |  180|  2.56k|#define SSL_KUZNYECHIKOMAC 0x00000800U
  ------------------
  429|       |
  430|  2.56k|    if (!get_optional_pkey_id(SN_id_GostR3410_2001))
  ------------------
  |  | 4577|  2.56k|#define SN_id_GostR3410_2001            "gost2001"
  ------------------
  |  Branch (430:9): [True: 2.56k, False: 0]
  ------------------
  431|  2.56k|        ctx->disabled_auth_mask |= SSL_aGOST01 | SSL_aGOST12;
  ------------------
  |  |  118|  2.56k|#define SSL_aGOST01 0x00000020U
  ------------------
                      ctx->disabled_auth_mask |= SSL_aGOST01 | SSL_aGOST12;
  ------------------
  |  |  122|  2.56k|#define SSL_aGOST12 0x00000080U
  ------------------
  432|  2.56k|    if (!get_optional_pkey_id(SN_id_GostR3410_2012_256))
  ------------------
  |  | 4788|  2.56k|#define SN_id_GostR3410_2012_256                "gost2012_256"
  ------------------
  |  Branch (432:9): [True: 2.56k, False: 0]
  ------------------
  433|  2.56k|        ctx->disabled_auth_mask |= SSL_aGOST12;
  ------------------
  |  |  122|  2.56k|#define SSL_aGOST12 0x00000080U
  ------------------
  434|  2.56k|    if (!get_optional_pkey_id(SN_id_GostR3410_2012_512))
  ------------------
  |  | 4793|  2.56k|#define SN_id_GostR3410_2012_512                "gost2012_512"
  ------------------
  |  Branch (434:9): [True: 2.56k, False: 0]
  ------------------
  435|  2.56k|        ctx->disabled_auth_mask |= SSL_aGOST12;
  ------------------
  |  |  122|  2.56k|#define SSL_aGOST12 0x00000080U
  ------------------
  436|       |    /*
  437|       |     * Disable GOST key exchange if no GOST signature algs are available *
  438|       |     */
  439|  2.56k|    if ((ctx->disabled_auth_mask & (SSL_aGOST01 | SSL_aGOST12)) == (SSL_aGOST01 | SSL_aGOST12))
  ------------------
  |  |  118|  2.56k|#define SSL_aGOST01 0x00000020U
  ------------------
                  if ((ctx->disabled_auth_mask & (SSL_aGOST01 | SSL_aGOST12)) == (SSL_aGOST01 | SSL_aGOST12))
  ------------------
  |  |  122|  2.56k|#define SSL_aGOST12 0x00000080U
  ------------------
                  if ((ctx->disabled_auth_mask & (SSL_aGOST01 | SSL_aGOST12)) == (SSL_aGOST01 | SSL_aGOST12))
  ------------------
  |  |  118|  2.56k|#define SSL_aGOST01 0x00000020U
  ------------------
                  if ((ctx->disabled_auth_mask & (SSL_aGOST01 | SSL_aGOST12)) == (SSL_aGOST01 | SSL_aGOST12))
  ------------------
  |  |  122|  2.56k|#define SSL_aGOST12 0x00000080U
  ------------------
  |  Branch (439:9): [True: 2.56k, False: 0]
  ------------------
  440|  2.56k|        ctx->disabled_mkey_mask |= SSL_kGOST;
  ------------------
  |  |   89|  2.56k|#define SSL_kGOST 0x00000010U
  ------------------
  441|       |
  442|  2.56k|    if ((ctx->disabled_auth_mask & SSL_aGOST12) == SSL_aGOST12)
  ------------------
  |  |  122|  2.56k|#define SSL_aGOST12 0x00000080U
  ------------------
                  if ((ctx->disabled_auth_mask & SSL_aGOST12) == SSL_aGOST12)
  ------------------
  |  |  122|  2.56k|#define SSL_aGOST12 0x00000080U
  ------------------
  |  Branch (442:9): [True: 2.56k, False: 0]
  ------------------
  443|  2.56k|        ctx->disabled_mkey_mask |= SSL_kGOST18;
  ------------------
  |  |   97|  2.56k|#define SSL_kGOST18 0x00000200U
  ------------------
  444|       |
  445|  2.56k|    return 1;
  446|  2.56k|}
ssl_md:
  595|  54.0k|{
  596|  54.0k|    idx &= SSL_HANDSHAKE_MAC_MASK;
  ------------------
  |  |  208|  54.0k|#define SSL_HANDSHAKE_MAC_MASK 0xFF
  ------------------
  597|  54.0k|    if (idx < 0 || idx >= SSL_MD_NUM_IDX)
  ------------------
  |  |  203|  54.0k|#define SSL_MD_NUM_IDX SSL_MAX_DIGEST
  |  |  ------------------
  |  |  |  |  201|  54.0k|#define SSL_MAX_DIGEST 14
  |  |  ------------------
  ------------------
  |  Branch (597:9): [True: 0, False: 54.0k]
  |  Branch (597:20): [True: 0, False: 54.0k]
  ------------------
  598|      0|        return NULL;
  599|  54.0k|    return ctx->ssl_digest_methods[idx];
  600|  54.0k|}
SSL_CTX_set_ciphersuites:
 1386|  2.70k|{
 1387|  2.70k|    int ret = set_ciphersuites(&(ctx->tls13_ciphersuites), str);
 1388|       |
 1389|  2.70k|    if (ret && ctx->cipher_list != NULL)
  ------------------
  |  Branch (1389:9): [True: 2.62k, False: 82]
  |  Branch (1389:16): [True: 65, False: 2.56k]
  ------------------
 1390|     65|        return update_cipher_list(ctx, &ctx->cipher_list, &ctx->cipher_list_by_id,
 1391|     65|            ctx->tls13_ciphersuites);
 1392|       |
 1393|  2.64k|    return ret;
 1394|  2.70k|}
ssl_create_cipher_list:
 1425|  3.34k|{
 1426|  3.34k|    int ok, num_of_ciphers, num_of_alias_max, num_of_group_aliases, i;
 1427|  3.34k|    uint32_t disabled_mkey, disabled_auth, disabled_enc, disabled_mac;
 1428|  3.34k|    STACK_OF(SSL_CIPHER) *cipherstack;
  ------------------
  |  |   33|  3.34k|#define STACK_OF(type) struct stack_st_##type
  ------------------
 1429|  3.34k|    const char *rule_p;
 1430|  3.34k|    CIPHER_ORDER *co_list = NULL, *head = NULL, *tail = NULL, *curr;
 1431|  3.34k|    const SSL_CIPHER **ca_list = NULL;
 1432|  3.34k|    const SSL_METHOD *ssl_method = ctx->method;
 1433|       |
 1434|       |    /*
 1435|       |     * Return with error if nothing to do.
 1436|       |     */
 1437|  3.34k|    if (rule_str == NULL || cipher_list == NULL || cipher_list_by_id == NULL)
  ------------------
  |  Branch (1437:9): [True: 0, False: 3.34k]
  |  Branch (1437:29): [True: 0, False: 3.34k]
  |  Branch (1437:52): [True: 0, False: 3.34k]
  ------------------
 1438|      0|        return NULL;
 1439|       |
 1440|  3.34k|    if (!check_suiteb_cipher_list(ssl_method, c, &rule_str))
  ------------------
  |  Branch (1440:9): [True: 0, False: 3.34k]
  ------------------
 1441|      0|        return NULL;
 1442|       |
 1443|       |    /*
 1444|       |     * To reduce the work to do we only want to process the compiled
 1445|       |     * in algorithms, so we first get the mask of disabled ciphers.
 1446|       |     */
 1447|       |
 1448|  3.34k|    disabled_mkey = ctx->disabled_mkey_mask;
 1449|  3.34k|    disabled_auth = ctx->disabled_auth_mask;
 1450|  3.34k|    disabled_enc = ctx->disabled_enc_mask;
 1451|  3.34k|    disabled_mac = ctx->disabled_mac_mask;
 1452|       |
 1453|       |    /*
 1454|       |     * Now we have to collect the available ciphers from the compiled
 1455|       |     * in ciphers. We cannot get more than the number compiled in, so
 1456|       |     * it is used for allocation.
 1457|       |     */
 1458|  3.34k|    num_of_ciphers = ssl_method->num_ciphers();
 1459|       |
 1460|  3.34k|    if (num_of_ciphers > 0) {
  ------------------
  |  Branch (1460:9): [True: 3.34k, False: 0]
  ------------------
 1461|  3.34k|        co_list = OPENSSL_malloc_array(num_of_ciphers, sizeof(*co_list));
  ------------------
  |  |  110|  3.34k|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1462|  3.34k|        if (co_list == NULL)
  ------------------
  |  Branch (1462:13): [True: 0, False: 3.34k]
  ------------------
 1463|      0|            return NULL; /* Failure */
 1464|  3.34k|    }
 1465|       |
 1466|  3.34k|    ssl_cipher_collect_ciphers(ssl_method, num_of_ciphers,
 1467|  3.34k|        disabled_mkey, disabled_auth, disabled_enc,
 1468|  3.34k|        disabled_mac, co_list, &head, &tail);
 1469|       |
 1470|       |    /* Now arrange all ciphers by preference. */
 1471|       |
 1472|       |    /*
 1473|       |     * Everything else being equal, prefer ephemeral ECDH over other key
 1474|       |     * exchange mechanisms.
 1475|       |     * For consistency, prefer ECDSA over RSA (though this only matters if the
 1476|       |     * server has both certificates, and is using the DEFAULT, or a client
 1477|       |     * preference).
 1478|       |     */
 1479|  3.34k|    ssl_cipher_apply_rule(0, SSL_kECDHE, SSL_aECDSA, 0, 0, 0, 0, CIPHER_ADD,
  ------------------
  |  |   85|  3.34k|#define SSL_kECDHE 0x00000004U
  ------------------
                  ssl_cipher_apply_rule(0, SSL_kECDHE, SSL_aECDSA, 0, 0, 0, 0, CIPHER_ADD,
  ------------------
  |  |  114|  3.34k|#define SSL_aECDSA 0x00000008U
  ------------------
                  ssl_cipher_apply_rule(0, SSL_kECDHE, SSL_aECDSA, 0, 0, 0, 0, CIPHER_ADD,
  ------------------
  |  |  144|  3.34k|#define CIPHER_ADD 1
  ------------------
 1480|  3.34k|        -1, &head, &tail);
 1481|  3.34k|    ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_ADD, -1, &head,
  ------------------
  |  |   85|  3.34k|#define SSL_kECDHE 0x00000004U
  ------------------
                  ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_ADD, -1, &head,
  ------------------
  |  |  144|  3.34k|#define CIPHER_ADD 1
  ------------------
 1482|  3.34k|        &tail);
 1483|  3.34k|    ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head,
  ------------------
  |  |   85|  3.34k|#define SSL_kECDHE 0x00000004U
  ------------------
                  ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head,
  ------------------
  |  |  146|  3.34k|#define CIPHER_DEL 3
  ------------------
 1484|  3.34k|        &tail);
 1485|       |
 1486|       |    /* Within each strength group, we prefer GCM over CHACHA... */
 1487|  3.34k|    ssl_cipher_apply_rule(0, 0, 0, SSL_AESGCM, 0, 0, 0, CIPHER_ADD, -1,
  ------------------
  |  |  155|  3.34k|#define SSL_AESGCM (SSL_AES128GCM | SSL_AES256GCM)
  |  |  ------------------
  |  |  |  |  142|  3.34k|#define SSL_AES128GCM 0x00001000U
  |  |  ------------------
  |  |               #define SSL_AESGCM (SSL_AES128GCM | SSL_AES256GCM)
  |  |  ------------------
  |  |  |  |  143|  3.34k|#define SSL_AES256GCM 0x00002000U
  |  |  ------------------
  ------------------
                  ssl_cipher_apply_rule(0, 0, 0, SSL_AESGCM, 0, 0, 0, CIPHER_ADD, -1,
  ------------------
  |  |  144|  3.34k|#define CIPHER_ADD 1
  ------------------
 1488|  3.34k|        &head, &tail);
 1489|  3.34k|    ssl_cipher_apply_rule(0, 0, 0, SSL_CHACHA20, 0, 0, 0, CIPHER_ADD, -1,
  ------------------
  |  |  159|  3.34k|#define SSL_CHACHA20 (SSL_CHACHA20POLY1305)
  |  |  ------------------
  |  |  |  |  149|  3.34k|#define SSL_CHACHA20POLY1305 0x00080000U
  |  |  ------------------
  ------------------
                  ssl_cipher_apply_rule(0, 0, 0, SSL_CHACHA20, 0, 0, 0, CIPHER_ADD, -1,
  ------------------
  |  |  144|  3.34k|#define CIPHER_ADD 1
  ------------------
 1490|  3.34k|        &head, &tail);
 1491|       |
 1492|       |    /*
 1493|       |     * ...and generally, our preferred cipher is AES.
 1494|       |     * Note that AEADs will be bumped to take preference after sorting by
 1495|       |     * strength.
 1496|       |     */
 1497|  3.34k|    ssl_cipher_apply_rule(0, 0, 0, SSL_AES ^ SSL_AESGCM, 0, 0, 0, CIPHER_ADD,
  ------------------
  |  |  157|  3.34k|#define SSL_AES (SSL_AES128 | SSL_AES256 | SSL_AESGCM | SSL_AESCCM)
  |  |  ------------------
  |  |  |  |  136|  3.34k|#define SSL_AES128 0x00000040U
  |  |  ------------------
  |  |               #define SSL_AES (SSL_AES128 | SSL_AES256 | SSL_AESGCM | SSL_AESCCM)
  |  |  ------------------
  |  |  |  |  137|  3.34k|#define SSL_AES256 0x00000080U
  |  |  ------------------
  |  |               #define SSL_AES (SSL_AES128 | SSL_AES256 | SSL_AESGCM | SSL_AESCCM)
  |  |  ------------------
  |  |  |  |  155|  3.34k|#define SSL_AESGCM (SSL_AES128GCM | SSL_AES256GCM)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|  3.34k|#define SSL_AES128GCM 0x00001000U
  |  |  |  |  ------------------
  |  |  |  |               #define SSL_AESGCM (SSL_AES128GCM | SSL_AES256GCM)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|  3.34k|#define SSL_AES256GCM 0x00002000U
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SSL_AES (SSL_AES128 | SSL_AES256 | SSL_AESGCM | SSL_AESCCM)
  |  |  ------------------
  |  |  |  |  156|  3.34k|#define SSL_AESCCM (SSL_AES128CCM | SSL_AES256CCM | SSL_AES128CCM8 | SSL_AES256CCM8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  3.34k|#define SSL_AES128CCM 0x00004000U
  |  |  |  |  ------------------
  |  |  |  |               #define SSL_AESCCM (SSL_AES128CCM | SSL_AES256CCM | SSL_AES128CCM8 | SSL_AES256CCM8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  3.34k|#define SSL_AES256CCM 0x00008000U
  |  |  |  |  ------------------
  |  |  |  |               #define SSL_AESCCM (SSL_AES128CCM | SSL_AES256CCM | SSL_AES128CCM8 | SSL_AES256CCM8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  3.34k|#define SSL_AES128CCM8 0x00010000U
  |  |  |  |  ------------------
  |  |  |  |               #define SSL_AESCCM (SSL_AES128CCM | SSL_AES256CCM | SSL_AES128CCM8 | SSL_AES256CCM8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  3.34k|#define SSL_AES256CCM8 0x00020000U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  ssl_cipher_apply_rule(0, 0, 0, SSL_AES ^ SSL_AESGCM, 0, 0, 0, CIPHER_ADD,
  ------------------
  |  |  155|  3.34k|#define SSL_AESGCM (SSL_AES128GCM | SSL_AES256GCM)
  |  |  ------------------
  |  |  |  |  142|  3.34k|#define SSL_AES128GCM 0x00001000U
  |  |  ------------------
  |  |               #define SSL_AESGCM (SSL_AES128GCM | SSL_AES256GCM)
  |  |  ------------------
  |  |  |  |  143|  3.34k|#define SSL_AES256GCM 0x00002000U
  |  |  ------------------
  ------------------
                  ssl_cipher_apply_rule(0, 0, 0, SSL_AES ^ SSL_AESGCM, 0, 0, 0, CIPHER_ADD,
  ------------------
  |  |  144|  3.34k|#define CIPHER_ADD 1
  ------------------
 1498|  3.34k|        -1, &head, &tail);
 1499|       |
 1500|       |    /* Temporarily enable everything else for sorting */
 1501|  3.34k|    ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, 0, CIPHER_ADD, -1, &head, &tail);
  ------------------
  |  |  144|  3.34k|#define CIPHER_ADD 1
  ------------------
 1502|       |
 1503|       |    /* Low priority for MD5 */
 1504|  3.34k|    ssl_cipher_apply_rule(0, 0, 0, 0, SSL_MD5, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |  168|  3.34k|#define SSL_MD5 0x00000001U
  ------------------
                  ssl_cipher_apply_rule(0, 0, 0, 0, SSL_MD5, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |  147|  3.34k|#define CIPHER_ORD 4
  ------------------
 1505|  3.34k|        &tail);
 1506|       |
 1507|       |    /*
 1508|       |     * Move anonymous ciphers to the end.  Usually, these will remain
 1509|       |     * disabled. (For applications that allow them, they aren't too bad, but
 1510|       |     * we prefer authenticated ciphers.)
 1511|       |     */
 1512|  3.34k|    ssl_cipher_apply_rule(0, 0, SSL_aNULL, 0, 0, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |  112|  3.34k|#define SSL_aNULL 0x00000004U
  ------------------
                  ssl_cipher_apply_rule(0, 0, SSL_aNULL, 0, 0, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |  147|  3.34k|#define CIPHER_ORD 4
  ------------------
 1513|  3.34k|        &tail);
 1514|       |
 1515|  3.34k|    ssl_cipher_apply_rule(0, SSL_kRSA, 0, 0, 0, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |   81|  3.34k|#define SSL_kRSA 0x00000001U
  ------------------
                  ssl_cipher_apply_rule(0, SSL_kRSA, 0, 0, 0, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |  147|  3.34k|#define CIPHER_ORD 4
  ------------------
 1516|  3.34k|        &tail);
 1517|  3.34k|    ssl_cipher_apply_rule(0, SSL_kPSK, 0, 0, 0, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |   87|  3.34k|#define SSL_kPSK 0x00000008U
  ------------------
                  ssl_cipher_apply_rule(0, SSL_kPSK, 0, 0, 0, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |  147|  3.34k|#define CIPHER_ORD 4
  ------------------
 1518|  3.34k|        &tail);
 1519|       |
 1520|       |    /* RC4 is sort-of broken -- move to the end */
 1521|  3.34k|    ssl_cipher_apply_rule(0, 0, 0, SSL_RC4, 0, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |  132|  3.34k|#define SSL_RC4 0x00000004U
  ------------------
                  ssl_cipher_apply_rule(0, 0, 0, SSL_RC4, 0, 0, 0, CIPHER_ORD, -1, &head,
  ------------------
  |  |  147|  3.34k|#define CIPHER_ORD 4
  ------------------
 1522|  3.34k|        &tail);
 1523|       |
 1524|       |    /*
 1525|       |     * Now sort by symmetric encryption strength.  The above ordering remains
 1526|       |     * in force within each class
 1527|       |     */
 1528|  3.34k|    if (!ssl_cipher_strength_sort(&head, &tail)) {
  ------------------
  |  Branch (1528:9): [True: 0, False: 3.34k]
  ------------------
 1529|      0|        OPENSSL_free(co_list);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1530|      0|        return NULL;
 1531|      0|    }
 1532|       |
 1533|       |    /*
 1534|       |     * Partially overrule strength sort to prefer TLS 1.2 ciphers/PRFs.
 1535|       |     */
 1536|  3.34k|    ssl_cipher_apply_rule(0, 0, 0, 0, 0, TLS1_2_VERSION, 0, CIPHER_BUMP, -1,
  ------------------
  |  |   26|  3.34k|#define TLS1_2_VERSION 0x0303
  ------------------
                  ssl_cipher_apply_rule(0, 0, 0, 0, 0, TLS1_2_VERSION, 0, CIPHER_BUMP, -1,
  ------------------
  |  |  153|  3.34k|#define CIPHER_BUMP 6
  ------------------
 1537|  3.34k|        &head, &tail);
 1538|       |
 1539|       |    /*
 1540|       |     * Irrespective of strength, enforce the following order:
 1541|       |     * (EC)DHE + AEAD > (EC)DHE > rest of AEAD > rest.
 1542|       |     * Within each group, ciphers remain sorted by strength and previous
 1543|       |     * preference, i.e.,
 1544|       |     * 1) ECDHE > DHE
 1545|       |     * 2) GCM > CHACHA
 1546|       |     * 3) AES > rest
 1547|       |     * 4) TLS 1.2 > legacy
 1548|       |     *
 1549|       |     * Because we now bump ciphers to the top of the list, we proceed in
 1550|       |     * reverse order of preference.
 1551|       |     */
 1552|  3.34k|    ssl_cipher_apply_rule(0, 0, 0, 0, SSL_AEAD, 0, 0, CIPHER_BUMP, -1,
  ------------------
  |  |  175|  3.34k|#define SSL_AEAD 0x00000040U
  ------------------
                  ssl_cipher_apply_rule(0, 0, 0, 0, SSL_AEAD, 0, 0, CIPHER_BUMP, -1,
  ------------------
  |  |  153|  3.34k|#define CIPHER_BUMP 6
  ------------------
 1553|  3.34k|        &head, &tail);
 1554|  3.34k|    ssl_cipher_apply_rule(0, SSL_kDHE | SSL_kECDHE, 0, 0, 0, 0, 0,
  ------------------
  |  |   83|  3.34k|#define SSL_kDHE 0x00000002U
  ------------------
                  ssl_cipher_apply_rule(0, SSL_kDHE | SSL_kECDHE, 0, 0, 0, 0, 0,
  ------------------
  |  |   85|  3.34k|#define SSL_kECDHE 0x00000004U
  ------------------
 1555|  3.34k|        CIPHER_BUMP, -1, &head, &tail);
  ------------------
  |  |  153|  3.34k|#define CIPHER_BUMP 6
  ------------------
 1556|  3.34k|    ssl_cipher_apply_rule(0, SSL_kDHE | SSL_kECDHE, 0, 0, SSL_AEAD, 0, 0,
  ------------------
  |  |   83|  3.34k|#define SSL_kDHE 0x00000002U
  ------------------
                  ssl_cipher_apply_rule(0, SSL_kDHE | SSL_kECDHE, 0, 0, SSL_AEAD, 0, 0,
  ------------------
  |  |   85|  3.34k|#define SSL_kECDHE 0x00000004U
  ------------------
                  ssl_cipher_apply_rule(0, SSL_kDHE | SSL_kECDHE, 0, 0, SSL_AEAD, 0, 0,
  ------------------
  |  |  175|  3.34k|#define SSL_AEAD 0x00000040U
  ------------------
 1557|  3.34k|        CIPHER_BUMP, -1, &head, &tail);
  ------------------
  |  |  153|  3.34k|#define CIPHER_BUMP 6
  ------------------
 1558|       |
 1559|       |    /* Now disable everything (maintaining the ordering!) */
 1560|  3.34k|    ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head, &tail);
  ------------------
  |  |  146|  3.34k|#define CIPHER_DEL 3
  ------------------
 1561|       |
 1562|       |    /*
 1563|       |     * We also need cipher aliases for selecting based on the rule_str.
 1564|       |     * There might be two types of entries in the rule_str: 1) names
 1565|       |     * of ciphers themselves 2) aliases for groups of ciphers.
 1566|       |     * For 1) we need the available ciphers and for 2) the cipher
 1567|       |     * groups of cipher_aliases added together in one list (otherwise
 1568|       |     * we would be happy with just the cipher_aliases table).
 1569|       |     */
 1570|  3.34k|    num_of_group_aliases = OSSL_NELEM(cipher_aliases);
  ------------------
  |  |   14|  3.34k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 1571|  3.34k|    num_of_alias_max = num_of_ciphers + num_of_group_aliases + 1;
 1572|  3.34k|    ca_list = OPENSSL_malloc_array(num_of_alias_max, sizeof(*ca_list));
  ------------------
  |  |  110|  3.34k|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1573|  3.34k|    if (ca_list == NULL) {
  ------------------
  |  Branch (1573:9): [True: 0, False: 3.34k]
  ------------------
 1574|      0|        OPENSSL_free(co_list);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1575|      0|        return NULL; /* Failure */
 1576|      0|    }
 1577|  3.34k|    ssl_cipher_collect_aliases(ca_list, num_of_group_aliases,
 1578|  3.34k|        disabled_mkey, disabled_auth, disabled_enc,
 1579|  3.34k|        disabled_mac, head);
 1580|       |
 1581|       |    /*
 1582|       |     * If the rule_string begins with DEFAULT, apply the default rule
 1583|       |     * before using the (possibly available) additional rules.
 1584|       |     */
 1585|  3.34k|    ok = 1;
 1586|  3.34k|    rule_p = rule_str;
 1587|  3.34k|    if (HAS_PREFIX(rule_str, "DEFAULT")) {
  ------------------
  |  |   58|  3.34k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 12, False: 3.33k]
  |  |  ------------------
  ------------------
 1588|     12|        ok = ssl_cipher_process_rulestr(OSSL_default_cipher_list(),
 1589|     12|            &head, &tail, ca_list, c);
 1590|     12|        rule_p += 7;
 1591|     12|        if (*rule_p == ':')
  ------------------
  |  Branch (1591:13): [True: 2, False: 10]
  ------------------
 1592|      2|            rule_p++;
 1593|     12|    }
 1594|       |
 1595|  3.34k|    if (ok && (rule_p[0] != '\0'))
  ------------------
  |  Branch (1595:9): [True: 3.34k, False: 0]
  |  Branch (1595:15): [True: 3.34k, False: 3]
  ------------------
 1596|  3.34k|        ok = ssl_cipher_process_rulestr(rule_p, &head, &tail, ca_list, c);
 1597|       |
 1598|  3.34k|    OPENSSL_free(ca_list); /* Not needed anymore */
  ------------------
  |  |  131|  3.34k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1599|       |
 1600|  3.34k|    if (!ok) { /* Rule processing failure */
  ------------------
  |  Branch (1600:9): [True: 255, False: 3.09k]
  ------------------
 1601|    255|        OPENSSL_free(co_list);
  ------------------
  |  |  131|    255|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1602|    255|        return NULL;
 1603|    255|    }
 1604|       |
 1605|       |    /*
 1606|       |     * Allocate new "cipherstack" for the result, return with error
 1607|       |     * if we cannot get one.
 1608|       |     */
 1609|  3.09k|    if ((cipherstack = sk_SSL_CIPHER_new_null()) == NULL) {
  ------------------
  |  | 1008|  3.09k|#define sk_SSL_CIPHER_new_null() ((STACK_OF(SSL_CIPHER) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (1609:9): [True: 0, False: 3.09k]
  ------------------
 1610|      0|        OPENSSL_free(co_list);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1611|      0|        return NULL;
 1612|      0|    }
 1613|       |
 1614|       |    /* Add TLSv1.3 ciphers first - we always prefer those if possible */
 1615|  12.3k|    for (i = 0; i < sk_SSL_CIPHER_num(tls13_ciphersuites); i++) {
  ------------------
  |  | 1005|  12.3k|#define sk_SSL_CIPHER_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_CIPHER_sk_type(sk))
  ------------------
  |  Branch (1615:17): [True: 9.27k, False: 3.09k]
  ------------------
 1616|  9.27k|        const SSL_CIPHER *sslc = sk_SSL_CIPHER_value(tls13_ciphersuites, i);
  ------------------
  |  | 1006|  9.27k|#define sk_SSL_CIPHER_value(sk, idx) ((const SSL_CIPHER *)OPENSSL_sk_value(ossl_check_const_SSL_CIPHER_sk_type(sk), (idx)))
  ------------------
 1617|       |
 1618|       |        /* Don't include any TLSv1.3 ciphers that are disabled */
 1619|  9.27k|        if ((sslc->algorithm_enc & disabled_enc) != 0
  ------------------
  |  Branch (1619:13): [True: 249, False: 9.02k]
  ------------------
 1620|  9.02k|            || (ssl_cipher_table_mac[sslc->algorithm2
  ------------------
  |  Branch (1620:16): [True: 0, False: 9.02k]
  ------------------
 1621|  9.02k|                    & SSL_HANDSHAKE_MAC_MASK]
  ------------------
  |  |  208|  9.02k|#define SSL_HANDSHAKE_MAC_MASK 0xFF
  ------------------
 1622|  9.02k|                       .mask
 1623|  9.02k|                   & ctx->disabled_mac_mask)
 1624|  9.02k|                != 0) {
 1625|    249|            sk_SSL_CIPHER_delete(tls13_ciphersuites, i);
  ------------------
  |  | 1013|    249|#define sk_SSL_CIPHER_delete(sk, i) ((const SSL_CIPHER *)OPENSSL_sk_delete(ossl_check_SSL_CIPHER_sk_type(sk), (i)))
  ------------------
 1626|    249|            i--;
 1627|    249|            continue;
 1628|    249|        }
 1629|       |
 1630|  9.02k|        if (!sk_SSL_CIPHER_push(cipherstack, sslc)) {
  ------------------
  |  | 1015|  9.02k|#define sk_SSL_CIPHER_push(sk, ptr) OPENSSL_sk_push(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr))
  ------------------
  |  Branch (1630:13): [True: 0, False: 9.02k]
  ------------------
 1631|      0|            OPENSSL_free(co_list);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1632|      0|            sk_SSL_CIPHER_free(cipherstack);
  ------------------
  |  | 1011|      0|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1633|      0|            return NULL;
 1634|      0|        }
 1635|  9.02k|    }
 1636|       |
 1637|  3.09k|    OSSL_TRACE_BEGIN(TLS_CIPHER)
  ------------------
  |  |  221|  3.09k|    do {                           \
  |  |  222|  3.09k|        BIO *trc_out = NULL;       \
  |  |  223|  3.09k|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 3.09k]
  |  |  ------------------
  ------------------
 1638|      0|    {
 1639|      0|        BIO_printf(trc_out, "cipher selection:\n");
 1640|      0|    }
 1641|       |    /*
 1642|       |     * The cipher selection for the list is done. The ciphers are added
 1643|       |     * to the resulting precedence to the STACK_OF(SSL_CIPHER).
 1644|       |     */
 1645|   230k|    for (curr = head; curr != NULL; curr = curr->next) {
  ------------------
  |  Branch (1645:23): [True: 227k, False: 3.09k]
  ------------------
 1646|   227k|        if (curr->active) {
  ------------------
  |  Branch (1646:13): [True: 154k, False: 73.5k]
  ------------------
 1647|   154k|            if (!sk_SSL_CIPHER_push(cipherstack, curr->cipher)) {
  ------------------
  |  | 1015|   154k|#define sk_SSL_CIPHER_push(sk, ptr) OPENSSL_sk_push(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr))
  ------------------
  |  Branch (1647:17): [True: 0, False: 154k]
  ------------------
 1648|      0|                OPENSSL_free(co_list);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1649|      0|                sk_SSL_CIPHER_free(cipherstack);
  ------------------
  |  | 1011|      0|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1650|      0|                OSSL_TRACE_CANCEL(TLS_CIPHER);
  ------------------
  |  |  230|      0|    ((void)0)
  ------------------
 1651|      0|                return NULL;
 1652|      0|            }
 1653|   154k|            if (trc_out != NULL)
  ------------------
  |  Branch (1653:17): [True: 0, False: 154k]
  ------------------
 1654|      0|                BIO_printf(trc_out, "<%s>\n", curr->cipher->name);
 1655|   154k|        }
 1656|   227k|    }
 1657|  3.09k|    OPENSSL_free(co_list); /* Not needed any longer */
  ------------------
  |  |  131|  3.09k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1658|  3.09k|    OSSL_TRACE_END(TLS_CIPHER);
  ------------------
  |  |  226|  3.09k|    }                            \
  |  |  227|  3.09k|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 3.09k]
  |  |  ------------------
  ------------------
 1659|       |
 1660|  3.09k|    if (!update_cipher_list_by_id(cipher_list_by_id, cipherstack)) {
  ------------------
  |  Branch (1660:9): [True: 0, False: 3.09k]
  ------------------
 1661|      0|        sk_SSL_CIPHER_free(cipherstack);
  ------------------
  |  | 1011|      0|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1662|      0|        return NULL;
 1663|      0|    }
 1664|  3.09k|    sk_SSL_CIPHER_free(*cipher_list);
  ------------------
  |  | 1011|  3.09k|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1665|  3.09k|    *cipher_list = cipherstack;
 1666|       |
 1667|  3.09k|    return cipherstack;
 1668|  3.09k|}
SSL_COMP_get_compression_methods:
 1978|  2.48k|{
 1979|  2.48k|    STACK_OF(SSL_COMP) **rv;
  ------------------
  |  |   33|  2.48k|#define STACK_OF(type) struct stack_st_##type
  ------------------
 1980|       |
 1981|  2.48k|    rv = (STACK_OF(SSL_COMP) **)OSSL_LIB_CTX_get_data(NULL,
 1982|  2.48k|        OSSL_LIB_CTX_COMP_METHODS);
  ------------------
  |  |  119|  2.48k|#define OSSL_LIB_CTX_COMP_METHODS 21
  ------------------
 1983|  2.48k|    if (rv != NULL)
  ------------------
  |  Branch (1983:9): [True: 2.48k, False: 0]
  ------------------
 1984|  2.48k|        return *rv;
 1985|      0|    else
 1986|      0|        return NULL;
 1987|  2.48k|}
ssl_get_cipher_by_char:
 2083|     40|{
 2084|     40|    const SSL_CIPHER *c = SSL_CONNECTION_GET_SSL(s)->method->get_cipher_by_char(ptr);
  ------------------
  |  |   27|     40|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
 2085|       |
 2086|     40|    if (c == NULL || (!all && c->valid == 0))
  ------------------
  |  Branch (2086:9): [True: 13, False: 27]
  |  Branch (2086:23): [True: 27, False: 0]
  |  Branch (2086:31): [True: 1, False: 26]
  ------------------
 2087|     14|        return NULL;
 2088|     26|    return c;
 2089|     40|}
ssl_get_md_idx:
 2135|  7.43k|{
 2136|  7.43k|    int i;
 2137|       |
 2138|   111k|    for (i = 0; i < SSL_MD_NUM_IDX; i++) {
  ------------------
  |  |  203|   111k|#define SSL_MD_NUM_IDX SSL_MAX_DIGEST
  |  |  ------------------
  |  |  |  |  201|   111k|#define SSL_MAX_DIGEST 14
  |  |  ------------------
  ------------------
  |  Branch (2138:17): [True: 104k, False: 7.43k]
  ------------------
 2139|   104k|        if (md_nid == ssl_cipher_table_mac[i].nid)
  ------------------
  |  Branch (2139:13): [True: 0, False: 104k]
  ------------------
 2140|      0|            return i;
 2141|   104k|    }
 2142|  7.43k|    return -1;
 2143|  7.43k|}
ssl_cert_is_disabled:
 2217|  62.0k|{
 2218|  62.0k|    const SSL_CERT_LOOKUP *cl;
 2219|       |
 2220|       |    /* A provider-loaded key type is always enabled */
 2221|  62.0k|    if (idx >= SSL_PKEY_NUM)
  ------------------
  |  |  328|  62.0k|#define SSL_PKEY_NUM 9
  ------------------
  |  Branch (2221:9): [True: 4.80k, False: 57.2k]
  ------------------
 2222|  4.80k|        return 0;
 2223|       |
 2224|  57.2k|    cl = ssl_cert_lookup_by_idx(idx, ctx);
 2225|  57.2k|    if (cl == NULL || (cl->amask & ctx->disabled_auth_mask) != 0)
  ------------------
  |  Branch (2225:9): [True: 0, False: 57.2k]
  |  Branch (2225:23): [True: 0, False: 57.2k]
  ------------------
 2226|      0|        return 1;
 2227|  57.2k|    return 0;
 2228|  57.2k|}
OSSL_default_cipher_list:
 2236|  2.57k|{
 2237|  2.57k|    return "ALL:!COMPLEMENTOFDEFAULT:!eNULL";
 2238|  2.57k|}
OSSL_default_ciphersuites:
 2246|  2.56k|{
 2247|  2.56k|    return "TLS_AES_256_GCM_SHA384:"
 2248|  2.56k|           "TLS_CHACHA20_POLY1305_SHA256:"
 2249|  2.56k|           "TLS_AES_128_GCM_SHA256";
 2250|  2.56k|}
ssl_ciph.c:get_optional_pkey_id:
  303|  17.9k|{
  304|  17.9k|    const EVP_PKEY_ASN1_METHOD *ameth;
  305|  17.9k|    ENGINE *tmpeng = NULL;
  306|  17.9k|    int pkey_id = 0;
  307|  17.9k|    ameth = EVP_PKEY_asn1_find_str(&tmpeng, pkey_name, -1);
  308|  17.9k|    if (ameth) {
  ------------------
  |  Branch (308:9): [True: 0, False: 17.9k]
  ------------------
  309|      0|        if (EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL,
  ------------------
  |  Branch (309:13): [True: 0, False: 0]
  ------------------
  310|      0|                ameth)
  311|      0|            <= 0)
  312|      0|            pkey_id = 0;
  313|      0|    }
  314|  17.9k|    tls_engine_finish(tmpeng);
  315|  17.9k|    return pkey_id;
  316|  17.9k|}
ssl_ciph.c:set_ciphersuites:
 1301|  2.70k|{
 1302|  2.70k|    STACK_OF(SSL_CIPHER) *newciphers = sk_SSL_CIPHER_new_null();
  ------------------
  |  |   33|  2.70k|#define STACK_OF(type) struct stack_st_##type
  ------------------
                  STACK_OF(SSL_CIPHER) *newciphers = sk_SSL_CIPHER_new_null();
  ------------------
  |  | 1008|  2.70k|#define sk_SSL_CIPHER_new_null() ((STACK_OF(SSL_CIPHER) *)OPENSSL_sk_new_null())
  ------------------
 1303|       |
 1304|  2.70k|    if (newciphers == NULL)
  ------------------
  |  Branch (1304:9): [True: 0, False: 2.70k]
  ------------------
 1305|      0|        return 0;
 1306|       |
 1307|       |    /* Parse the list. We explicitly allow an empty list */
 1308|  2.70k|    if (*str != '\0'
  ------------------
  |  Branch (1308:9): [True: 2.66k, False: 44]
  ------------------
 1309|  2.66k|        && (CONF_parse_list(str, ':', 1, ciphersuite_cb, newciphers) <= 0
  ------------------
  |  Branch (1309:13): [True: 0, False: 2.66k]
  ------------------
 1310|  2.66k|            || sk_SSL_CIPHER_num(newciphers) == 0)) {
  ------------------
  |  | 1005|  2.66k|#define sk_SSL_CIPHER_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_CIPHER_sk_type(sk))
  ------------------
  |  Branch (1310:16): [True: 82, False: 2.58k]
  ------------------
 1311|     82|        ERR_raise(ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH);
  ------------------
  |  |  404|     82|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|     82|    (ERR_new(),                                                  \
  |  |  |  |  407|     82|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|     82|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|     82|        ERR_set_error)
  |  |  ------------------
  ------------------
 1312|     82|        sk_SSL_CIPHER_free(newciphers);
  ------------------
  |  | 1011|     82|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1313|     82|        return 0;
 1314|     82|    }
 1315|  2.62k|    sk_SSL_CIPHER_free(*currciphers);
  ------------------
  |  | 1011|  2.62k|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1316|  2.62k|    *currciphers = newciphers;
 1317|       |
 1318|  2.62k|    return 1;
 1319|  2.70k|}
ssl_ciph.c:ciphersuite_cb:
 1274|  12.0k|{
 1275|  12.0k|    STACK_OF(SSL_CIPHER) *ciphersuites = (STACK_OF(SSL_CIPHER) *)arg;
  ------------------
  |  |   33|  12.0k|#define STACK_OF(type) struct stack_st_##type
  ------------------
 1276|  12.0k|    const SSL_CIPHER *cipher;
 1277|       |    /* Arbitrary sized temp buffer for the cipher name. Should be big enough */
 1278|  12.0k|    char name[80];
 1279|       |
 1280|  12.0k|    if (len > (int)(sizeof(name) - 1))
  ------------------
  |  Branch (1280:9): [True: 38, False: 12.0k]
  ------------------
 1281|       |        /* Anyway return 1 so we can parse rest of the list */
 1282|     38|        return 1;
 1283|       |
 1284|  12.0k|    memcpy(name, elem, len);
 1285|  12.0k|    name[len] = '\0';
 1286|       |
 1287|  12.0k|    cipher = ssl3_get_cipher_by_std_name(name);
 1288|  12.0k|    if (cipher == NULL)
  ------------------
  |  Branch (1288:9): [True: 4.21k, False: 7.84k]
  ------------------
 1289|       |        /* Ciphersuite not found but return 1 to parse rest of the list */
 1290|  4.21k|        return 1;
 1291|       |
 1292|  7.84k|    if (!sk_SSL_CIPHER_push(ciphersuites, cipher)) {
  ------------------
  |  | 1015|  7.84k|#define sk_SSL_CIPHER_push(sk, ptr) OPENSSL_sk_push(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr))
  ------------------
  |  Branch (1292:9): [True: 0, False: 7.84k]
  ------------------
 1293|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1294|      0|        return 0;
 1295|      0|    }
 1296|       |
 1297|  7.84k|    return 1;
 1298|  7.84k|}
ssl_ciph.c:update_cipher_list:
 1343|     65|{
 1344|     65|    int i;
 1345|     65|    STACK_OF(SSL_CIPHER) *tmp_cipher_list = sk_SSL_CIPHER_dup(*cipher_list);
  ------------------
  |  |   33|     65|#define STACK_OF(type) struct stack_st_##type
  ------------------
                  STACK_OF(SSL_CIPHER) *tmp_cipher_list = sk_SSL_CIPHER_dup(*cipher_list);
  ------------------
  |  | 1027|     65|#define sk_SSL_CIPHER_dup(sk) ((STACK_OF(SSL_CIPHER) *)OPENSSL_sk_dup(ossl_check_const_SSL_CIPHER_sk_type(sk)))
  ------------------
 1346|       |
 1347|     65|    if (tmp_cipher_list == NULL)
  ------------------
  |  Branch (1347:9): [True: 0, False: 65]
  ------------------
 1348|      0|        return 0;
 1349|       |
 1350|       |    /*
 1351|       |     * Delete any existing TLSv1.3 ciphersuites. These are always first in the
 1352|       |     * list.
 1353|       |     */
 1354|    260|    while (sk_SSL_CIPHER_num(tmp_cipher_list) > 0
  ------------------
  |  | 1005|    260|#define sk_SSL_CIPHER_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_CIPHER_sk_type(sk))
  ------------------
  |  Branch (1354:12): [True: 260, False: 0]
  ------------------
 1355|    260|        && sk_SSL_CIPHER_value(tmp_cipher_list, 0)->min_tls
  ------------------
  |  | 1006|    260|#define sk_SSL_CIPHER_value(sk, idx) ((const SSL_CIPHER *)OPENSSL_sk_value(ossl_check_const_SSL_CIPHER_sk_type(sk), (idx)))
  ------------------
  |  Branch (1355:12): [True: 195, False: 65]
  ------------------
 1356|    260|            == TLS1_3_VERSION)
  ------------------
  |  |   27|    260|#define TLS1_3_VERSION 0x0304
  ------------------
 1357|    195|        (void)sk_SSL_CIPHER_delete(tmp_cipher_list, 0);
  ------------------
  |  | 1013|    260|#define sk_SSL_CIPHER_delete(sk, i) ((const SSL_CIPHER *)OPENSSL_sk_delete(ossl_check_SSL_CIPHER_sk_type(sk), (i)))
  ------------------
 1358|       |
 1359|       |    /* Insert the new TLSv1.3 ciphersuites */
 1360|    222|    for (i = sk_SSL_CIPHER_num(tls13_ciphersuites) - 1; i >= 0; i--) {
  ------------------
  |  | 1005|     65|#define sk_SSL_CIPHER_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_CIPHER_sk_type(sk))
  ------------------
  |  Branch (1360:57): [True: 157, False: 65]
  ------------------
 1361|    157|        const SSL_CIPHER *sslc = sk_SSL_CIPHER_value(tls13_ciphersuites, i);
  ------------------
  |  | 1006|    157|#define sk_SSL_CIPHER_value(sk, idx) ((const SSL_CIPHER *)OPENSSL_sk_value(ossl_check_const_SSL_CIPHER_sk_type(sk), (idx)))
  ------------------
 1362|       |
 1363|       |        /* Don't include any TLSv1.3 ciphersuites that are disabled */
 1364|    157|        if ((sslc->algorithm_enc & ctx->disabled_enc_mask) == 0
  ------------------
  |  Branch (1364:13): [True: 73, False: 84]
  ------------------
 1365|     73|            && (ssl_cipher_table_mac[sslc->algorithm2
  ------------------
  |  Branch (1365:16): [True: 73, False: 0]
  ------------------
 1366|     73|                    & SSL_HANDSHAKE_MAC_MASK]
  ------------------
  |  |  208|     73|#define SSL_HANDSHAKE_MAC_MASK 0xFF
  ------------------
 1367|     73|                       .mask
 1368|     73|                   & ctx->disabled_mac_mask)
 1369|     73|                == 0) {
 1370|     73|            sk_SSL_CIPHER_unshift(tmp_cipher_list, sslc);
  ------------------
  |  | 1016|     73|#define sk_SSL_CIPHER_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr))
  ------------------
 1371|     73|        }
 1372|    157|    }
 1373|       |
 1374|     65|    if (!update_cipher_list_by_id(cipher_list_by_id, tmp_cipher_list)) {
  ------------------
  |  Branch (1374:9): [True: 0, False: 65]
  ------------------
 1375|      0|        sk_SSL_CIPHER_free(tmp_cipher_list);
  ------------------
  |  | 1011|      0|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1376|      0|        return 0;
 1377|      0|    }
 1378|       |
 1379|     65|    sk_SSL_CIPHER_free(*cipher_list);
  ------------------
  |  | 1011|     65|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1380|     65|    *cipher_list = tmp_cipher_list;
 1381|       |
 1382|     65|    return 1;
 1383|     65|}
ssl_ciph.c:check_suiteb_cipher_list:
 1227|  3.34k|{
 1228|  3.34k|    unsigned int suiteb_flags = 0, suiteb_comb2 = 0;
 1229|  3.34k|    if (HAS_PREFIX(*prule_str, "SUITEB128ONLY")) {
  ------------------
  |  |   58|  3.34k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 6, False: 3.34k]
  |  |  ------------------
  ------------------
 1230|      6|        suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS_ONLY;
  ------------------
  |  |  558|      6|#define SSL_CERT_FLAG_SUITEB_128_LOS_ONLY 0x10000
  ------------------
 1231|  3.34k|    } else if (HAS_PREFIX(*prule_str, "SUITEB128C2")) {
  ------------------
  |  |   58|  3.34k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 1, False: 3.33k]
  |  |  ------------------
  ------------------
 1232|      1|        suiteb_comb2 = 1;
 1233|      1|        suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS;
  ------------------
  |  |  562|      1|#define SSL_CERT_FLAG_SUITEB_128_LOS 0x30000
  ------------------
 1234|  3.33k|    } else if (HAS_PREFIX(*prule_str, "SUITEB128")) {
  ------------------
  |  |   58|  3.33k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 34, False: 3.30k]
  |  |  ------------------
  ------------------
 1235|     34|        suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS;
  ------------------
  |  |  562|     34|#define SSL_CERT_FLAG_SUITEB_128_LOS 0x30000
  ------------------
 1236|  3.30k|    } else if (HAS_PREFIX(*prule_str, "SUITEB192")) {
  ------------------
  |  |   58|  3.30k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 6, False: 3.29k]
  |  |  ------------------
  ------------------
 1237|      6|        suiteb_flags = SSL_CERT_FLAG_SUITEB_192_LOS;
  ------------------
  |  |  560|      6|#define SSL_CERT_FLAG_SUITEB_192_LOS 0x20000
  ------------------
 1238|      6|    }
 1239|       |
 1240|  3.34k|    if (suiteb_flags) {
  ------------------
  |  Branch (1240:9): [True: 47, False: 3.29k]
  ------------------
 1241|     47|        c->cert_flags &= ~SSL_CERT_FLAG_SUITEB_128_LOS;
  ------------------
  |  |  562|     47|#define SSL_CERT_FLAG_SUITEB_128_LOS 0x30000
  ------------------
 1242|     47|        c->cert_flags |= suiteb_flags;
 1243|  3.29k|    } else {
 1244|  3.29k|        suiteb_flags = c->cert_flags & SSL_CERT_FLAG_SUITEB_128_LOS;
  ------------------
  |  |  562|  3.29k|#define SSL_CERT_FLAG_SUITEB_128_LOS 0x30000
  ------------------
 1245|  3.29k|    }
 1246|       |
 1247|  3.34k|    if (!suiteb_flags)
  ------------------
  |  Branch (1247:9): [True: 3.29k, False: 47]
  ------------------
 1248|  3.29k|        return 1;
 1249|       |    /* Check version: if TLS 1.2 ciphers allowed we can use Suite B */
 1250|       |
 1251|     47|    if (!(meth->ssl3_enc->enc_flags & SSL_ENC_FLAG_TLS1_2_CIPHERS)) {
  ------------------
  |  | 2195|     47|#define SSL_ENC_FLAG_TLS1_2_CIPHERS 0x10
  ------------------
  |  Branch (1251:9): [True: 0, False: 47]
  ------------------
 1252|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1253|      0|        return 0;
 1254|      0|    }
 1255|       |
 1256|     47|    switch (suiteb_flags) {
  ------------------
  |  Branch (1256:13): [True: 47, False: 0]
  ------------------
 1257|     35|    case SSL_CERT_FLAG_SUITEB_128_LOS:
  ------------------
  |  |  562|     35|#define SSL_CERT_FLAG_SUITEB_128_LOS 0x30000
  ------------------
  |  Branch (1257:5): [True: 35, False: 12]
  ------------------
 1258|     35|        if (suiteb_comb2)
  ------------------
  |  Branch (1258:13): [True: 1, False: 34]
  ------------------
 1259|      1|            *prule_str = "ECDHE-ECDSA-AES256-GCM-SHA384";
 1260|     34|        else
 1261|     34|            *prule_str = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384";
 1262|     35|        break;
 1263|      6|    case SSL_CERT_FLAG_SUITEB_128_LOS_ONLY:
  ------------------
  |  |  558|      6|#define SSL_CERT_FLAG_SUITEB_128_LOS_ONLY 0x10000
  ------------------
  |  Branch (1263:5): [True: 6, False: 41]
  ------------------
 1264|      6|        *prule_str = "ECDHE-ECDSA-AES128-GCM-SHA256";
 1265|      6|        break;
 1266|      6|    case SSL_CERT_FLAG_SUITEB_192_LOS:
  ------------------
  |  |  560|      6|#define SSL_CERT_FLAG_SUITEB_192_LOS 0x20000
  ------------------
  |  Branch (1266:5): [True: 6, False: 41]
  ------------------
 1267|      6|        *prule_str = "ECDHE-ECDSA-AES256-GCM-SHA384";
 1268|      6|        break;
 1269|     47|    }
 1270|     47|    return 1;
 1271|     47|}
ssl_ciph.c:ssl_cipher_collect_ciphers:
  659|  3.34k|{
  660|  3.34k|    int i, co_list_num;
  661|  3.34k|    const SSL_CIPHER *c;
  662|       |
  663|       |    /*
  664|       |     * We have num_of_ciphers descriptions compiled in, depending on the
  665|       |     * method selected (SSLv3, TLSv1 etc).
  666|       |     * These will later be sorted in a linked list with at most num
  667|       |     * entries.
  668|       |     */
  669|       |
  670|       |    /* Get the initial list of ciphers */
  671|  3.34k|    co_list_num = 0; /* actual count of ciphers */
  672|   642k|    for (i = 0; i < num_of_ciphers; i++) {
  ------------------
  |  Branch (672:17): [True: 639k, False: 3.34k]
  ------------------
  673|   639k|        c = ssl_method->get_cipher(i);
  674|       |        /* drop those that use any of that is not available */
  675|   639k|        if (c == NULL || !c->valid)
  ------------------
  |  Branch (675:13): [True: 0, False: 639k]
  |  Branch (675:26): [True: 0, False: 639k]
  ------------------
  676|      0|            continue;
  677|   639k|        if ((c->algorithm_mkey & disabled_mkey) || (c->algorithm_auth & disabled_auth) || (c->algorithm_enc & disabled_enc) || (c->algorithm_mac & disabled_mac))
  ------------------
  |  Branch (677:13): [True: 32.9k, False: 606k]
  |  Branch (677:52): [True: 249, False: 605k]
  |  Branch (677:91): [True: 53.6k, False: 552k]
  |  Branch (677:128): [True: 747, False: 551k]
  ------------------
  678|  87.6k|            continue;
  679|   551k|        if (((ssl_method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS) == 0) && c->min_tls == 0)
  ------------------
  |  | 2190|   551k|#define SSL_ENC_FLAG_DTLS 0x8
  ------------------
  |  Branch (679:13): [True: 551k, False: 0]
  |  Branch (679:77): [True: 0, False: 551k]
  ------------------
  680|      0|            continue;
  681|   551k|        if (((ssl_method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS) != 0) && c->min_dtls == 0)
  ------------------
  |  | 2190|   551k|#define SSL_ENC_FLAG_DTLS 0x8
  ------------------
  |  Branch (681:13): [True: 0, False: 551k]
  |  Branch (681:77): [True: 0, False: 0]
  ------------------
  682|      0|            continue;
  683|       |
  684|   551k|        co_list[co_list_num].cipher = c;
  685|   551k|        co_list[co_list_num].next = NULL;
  686|   551k|        co_list[co_list_num].prev = NULL;
  687|   551k|        co_list[co_list_num].active = 0;
  688|   551k|        co_list_num++;
  689|   551k|    }
  690|       |
  691|       |    /*
  692|       |     * Prepare linked list from list entries
  693|       |     */
  694|  3.34k|    if (co_list_num > 0) {
  ------------------
  |  Branch (694:9): [True: 3.26k, False: 83]
  ------------------
  695|  3.26k|        co_list[0].prev = NULL;
  696|       |
  697|  3.26k|        if (co_list_num > 1) {
  ------------------
  |  Branch (697:13): [True: 3.26k, False: 0]
  ------------------
  698|  3.26k|            co_list[0].next = &co_list[1];
  699|       |
  700|   548k|            for (i = 1; i < co_list_num - 1; i++) {
  ------------------
  |  Branch (700:25): [True: 544k, False: 3.26k]
  ------------------
  701|   544k|                co_list[i].prev = &co_list[i - 1];
  702|   544k|                co_list[i].next = &co_list[i + 1];
  703|   544k|            }
  704|       |
  705|  3.26k|            co_list[co_list_num - 1].prev = &co_list[co_list_num - 2];
  706|  3.26k|        }
  707|       |
  708|  3.26k|        co_list[co_list_num - 1].next = NULL;
  709|       |
  710|  3.26k|        *head_p = &co_list[0];
  711|  3.26k|        *tail_p = &co_list[co_list_num - 1];
  712|  3.26k|    }
  713|  3.34k|}
ssl_ciph.c:ssl_cipher_apply_rule:
  783|  82.3k|{
  784|  82.3k|    CIPHER_ORDER *head, *tail, *curr, *next, *last;
  785|  82.3k|    const SSL_CIPHER *cp;
  786|  82.3k|    int reverse = 0;
  787|       |
  788|  82.3k|    OSSL_TRACE_BEGIN(TLS_CIPHER)
  ------------------
  |  |  221|  82.3k|    do {                           \
  |  |  222|  82.3k|        BIO *trc_out = NULL;       \
  |  |  223|  82.3k|        if (0)
  |  |  ------------------
  |  |  |  Branch (223:13): [Folded, False: 82.3k]
  |  |  ------------------
  ------------------
  789|      0|    {
  790|      0|        BIO_printf(trc_out,
  791|      0|            "Applying rule %d with %08x/%08x/%08x/%08x/%08x %08x (%d)\n",
  792|      0|            rule, (unsigned int)alg_mkey, (unsigned int)alg_auth,
  793|      0|            (unsigned int)alg_enc, (unsigned int)alg_mac, min_tls,
  794|      0|            (unsigned int)algo_strength, (int)strength_bits);
  795|      0|    }
  796|       |
  797|  82.3k|    if (rule == CIPHER_DEL || rule == CIPHER_BUMP)
  ------------------
  |  |  146|   164k|#define CIPHER_DEL 3
  ------------------
                  if (rule == CIPHER_DEL || rule == CIPHER_BUMP)
  ------------------
  |  |  153|  75.5k|#define CIPHER_BUMP 6
  ------------------
  |  Branch (797:9): [True: 6.78k, False: 75.5k]
  |  Branch (797:31): [True: 13.3k, False: 62.1k]
  ------------------
  798|  20.1k|        reverse = 1; /* needed to maintain sorting between currently
  799|       |                      * deleted ciphers */
  800|       |
  801|  82.3k|    head = *head_p;
  802|  82.3k|    tail = *tail_p;
  803|       |
  804|  82.3k|    if (reverse) {
  ------------------
  |  Branch (804:9): [True: 20.1k, False: 62.1k]
  ------------------
  805|  20.1k|        next = tail;
  806|  20.1k|        last = head;
  807|  62.1k|    } else {
  808|  62.1k|        next = head;
  809|  62.1k|        last = tail;
  810|  62.1k|    }
  811|       |
  812|  82.3k|    curr = NULL;
  813|  13.4M|    for (;;) {
  814|  13.4M|        if (curr == last)
  ------------------
  |  Branch (814:13): [True: 82.3k, False: 13.3M]
  ------------------
  815|  82.3k|            break;
  816|       |
  817|  13.3M|        curr = next;
  818|       |
  819|  13.3M|        if (curr == NULL)
  ------------------
  |  Branch (819:13): [True: 0, False: 13.3M]
  ------------------
  820|      0|            break;
  821|       |
  822|  13.3M|        next = reverse ? curr->prev : curr->next;
  ------------------
  |  Branch (822:16): [True: 3.32M, False: 10.0M]
  ------------------
  823|       |
  824|  13.3M|        cp = curr->cipher;
  825|       |
  826|       |        /*
  827|       |         * Selection criteria is either the value of strength_bits
  828|       |         * or the algorithms used.
  829|       |         */
  830|  13.3M|        if (strength_bits >= 0) {
  ------------------
  |  Branch (830:13): [True: 2.80M, False: 10.5M]
  ------------------
  831|  2.80M|            if (strength_bits != cp->strength_bits)
  ------------------
  |  Branch (831:17): [True: 2.24M, False: 562k]
  ------------------
  832|  2.24M|                continue;
  833|  10.5M|        } else {
  834|  10.5M|            if (trc_out != NULL) {
  ------------------
  |  Branch (834:17): [True: 0, False: 10.5M]
  ------------------
  835|      0|                BIO_printf(trc_out,
  836|      0|                    "\nName: %s:"
  837|      0|                    "\nAlgo = %08x/%08x/%08x/%08x/%08x Algo_strength = %08x\n",
  838|      0|                    cp->name,
  839|      0|                    (unsigned int)cp->algorithm_mkey,
  840|      0|                    (unsigned int)cp->algorithm_auth,
  841|      0|                    (unsigned int)cp->algorithm_enc,
  842|      0|                    (unsigned int)cp->algorithm_mac,
  843|      0|                    cp->min_tls,
  844|      0|                    (unsigned int)cp->algo_strength);
  845|      0|            }
  846|  10.5M|            if (cipher_id != 0 && (cipher_id != cp->id))
  ------------------
  |  Branch (846:17): [True: 19.5k, False: 10.5M]
  |  Branch (846:35): [True: 19.4k, False: 115]
  ------------------
  847|  19.4k|                continue;
  848|  10.5M|            if (alg_mkey && !(alg_mkey & cp->algorithm_mkey))
  ------------------
  |  Branch (848:17): [True: 3.91M, False: 6.64M]
  |  Branch (848:29): [True: 2.94M, False: 968k]
  ------------------
  849|  2.94M|                continue;
  850|  7.60M|            if (alg_auth && !(alg_auth & cp->algorithm_auth))
  ------------------
  |  Branch (850:17): [True: 679k, False: 6.92M]
  |  Branch (850:29): [True: 568k, False: 111k]
  ------------------
  851|   568k|                continue;
  852|  7.04M|            if (alg_enc && !(alg_enc & cp->algorithm_enc))
  ------------------
  |  Branch (852:17): [True: 2.85M, False: 4.18M]
  |  Branch (852:28): [True: 2.10M, False: 751k]
  ------------------
  853|  2.10M|                continue;
  854|  4.93M|            if (alg_mac && !(alg_mac & cp->algorithm_mac))
  ------------------
  |  Branch (854:17): [True: 1.36M, False: 3.56M]
  |  Branch (854:28): [True: 1.06M, False: 299k]
  ------------------
  855|  1.06M|                continue;
  856|  3.86M|            if (min_tls && (min_tls != cp->min_tls))
  ------------------
  |  Branch (856:17): [True: 556k, False: 3.31M]
  |  Branch (856:28): [True: 273k, False: 282k]
  ------------------
  857|   273k|                continue;
  858|  3.59M|            if ((algo_strength & SSL_STRONG_MASK)
  ------------------
  |  |  241|  3.59M|#define SSL_STRONG_MASK 0x0000001FU
  ------------------
  |  Branch (858:17): [True: 28.5k, False: 3.56M]
  ------------------
  859|  28.5k|                && !(algo_strength & SSL_STRONG_MASK & cp->algo_strength))
  ------------------
  |  |  241|  28.5k|#define SSL_STRONG_MASK 0x0000001FU
  ------------------
  |  Branch (859:20): [True: 10.5k, False: 18.0k]
  ------------------
  860|  10.5k|                continue;
  861|  3.58M|            if ((algo_strength & SSL_DEFAULT_MASK)
  ------------------
  |  |  242|  3.58M|#define SSL_DEFAULT_MASK 0X00000020U
  ------------------
  |  Branch (861:17): [True: 423k, False: 3.16M]
  ------------------
  862|   423k|                && !(algo_strength & SSL_DEFAULT_MASK & cp->algo_strength))
  ------------------
  |  |  242|   423k|#define SSL_DEFAULT_MASK 0X00000020U
  ------------------
  |  Branch (862:20): [True: 187k, False: 235k]
  ------------------
  863|   187k|                continue;
  864|  3.58M|        }
  865|       |
  866|  3.95M|        if (trc_out != NULL)
  ------------------
  |  Branch (866:13): [True: 0, False: 3.95M]
  ------------------
  867|      0|            BIO_printf(trc_out, "Action = %d\n", rule);
  868|       |
  869|       |        /* add the cipher if it has not been added yet. */
  870|  3.95M|        if (rule == CIPHER_ADD) {
  ------------------
  |  |  144|  3.95M|#define CIPHER_ADD 1
  ------------------
  |  Branch (870:13): [True: 1.44M, False: 2.51M]
  ------------------
  871|       |            /* reverse == 0 */
  872|  1.44M|            if (!curr->active) {
  ------------------
  |  Branch (872:17): [True: 1.06M, False: 374k]
  ------------------
  873|  1.06M|                ll_append_tail(&head, curr, &tail);
  874|  1.06M|                curr->active = 1;
  875|  1.06M|            }
  876|  1.44M|        }
  877|       |        /* Move the added cipher to this location */
  878|  2.51M|        else if (rule == CIPHER_ORD) {
  ------------------
  |  |  147|  2.51M|#define CIPHER_ORD 4
  ------------------
  |  Branch (878:18): [True: 744k, False: 1.77M]
  ------------------
  879|       |            /* reverse == 0 */
  880|   744k|            if (curr->active) {
  ------------------
  |  Branch (880:17): [True: 738k, False: 5.92k]
  ------------------
  881|   738k|                ll_append_tail(&head, curr, &tail);
  882|   738k|            }
  883|  1.77M|        } else if (rule == CIPHER_DEL) {
  ------------------
  |  |  146|  1.77M|#define CIPHER_DEL 3
  ------------------
  |  Branch (883:20): [True: 666k, False: 1.10M]
  ------------------
  884|       |            /* reverse == 1 */
  885|   666k|            if (curr->active) {
  ------------------
  |  Branch (885:17): [True: 664k, False: 1.87k]
  ------------------
  886|       |                /*
  887|       |                 * most recently deleted ciphersuites get best positions for
  888|       |                 * any future CIPHER_ADD (note that the CIPHER_DEL loop works
  889|       |                 * in reverse to maintain the order)
  890|       |                 */
  891|   664k|                ll_append_head(&head, curr, &tail);
  892|   664k|                curr->active = 0;
  893|   664k|            }
  894|  1.10M|        } else if (rule == CIPHER_BUMP) {
  ------------------
  |  |  153|  1.10M|#define CIPHER_BUMP 6
  ------------------
  |  Branch (894:20): [True: 822k, False: 285k]
  ------------------
  895|   822k|            if (curr->active)
  ------------------
  |  Branch (895:17): [True: 822k, False: 0]
  ------------------
  896|   822k|                ll_append_head(&head, curr, &tail);
  897|   822k|        } else if (rule == CIPHER_KILL) {
  ------------------
  |  |  145|   285k|#define CIPHER_KILL 2
  ------------------
  |  Branch (897:20): [True: 285k, False: 0]
  ------------------
  898|       |            /* reverse == 0 */
  899|   285k|            if (head == curr)
  ------------------
  |  Branch (899:17): [True: 45.9k, False: 239k]
  ------------------
  900|  45.9k|                head = curr->next;
  901|   239k|            else
  902|   239k|                curr->prev->next = curr->next;
  903|   285k|            if (tail == curr)
  ------------------
  |  Branch (903:17): [True: 2.54k, False: 283k]
  ------------------
  904|  2.54k|                tail = curr->prev;
  905|   285k|            curr->active = 0;
  906|   285k|            if (curr->next != NULL)
  ------------------
  |  Branch (906:17): [True: 283k, False: 2.54k]
  ------------------
  907|   283k|                curr->next->prev = curr->prev;
  908|   285k|            if (curr->prev != NULL)
  ------------------
  |  Branch (908:17): [True: 239k, False: 45.9k]
  ------------------
  909|   239k|                curr->prev->next = curr->next;
  910|   285k|            curr->next = NULL;
  911|   285k|            curr->prev = NULL;
  912|   285k|        }
  913|  3.95M|    }
  914|       |
  915|  82.3k|    *head_p = head;
  916|  82.3k|    *tail_p = tail;
  917|       |
  918|  82.3k|    OSSL_TRACE_END(TLS_CIPHER);
  ------------------
  |  |  226|  82.3k|    }                            \
  |  |  227|  82.3k|    while (0)
  |  |  ------------------
  |  |  |  Branch (227:12): [Folded, False: 82.3k]
  |  |  ------------------
  ------------------
  919|  82.3k|}
ssl_ciph.c:ll_append_tail:
  618|  1.80M|{
  619|  1.80M|    if (curr == *tail)
  ------------------
  |  Branch (619:9): [True: 3.28k, False: 1.80M]
  ------------------
  620|  3.28k|        return;
  621|  1.80M|    if (curr == *head)
  ------------------
  |  Branch (621:9): [True: 555k, False: 1.24M]
  ------------------
  622|   555k|        *head = curr->next;
  623|  1.80M|    if (curr->prev != NULL)
  ------------------
  |  Branch (623:9): [True: 1.24M, False: 555k]
  ------------------
  624|  1.24M|        curr->prev->next = curr->next;
  625|  1.80M|    if (curr->next != NULL)
  ------------------
  |  Branch (625:9): [True: 1.80M, False: 0]
  ------------------
  626|  1.80M|        curr->next->prev = curr->prev;
  627|  1.80M|    (*tail)->next = curr;
  628|  1.80M|    curr->prev = *tail;
  629|       |    curr->next = NULL;
  630|  1.80M|    *tail = curr;
  631|  1.80M|}
ssl_ciph.c:ll_append_head:
  635|  1.48M|{
  636|  1.48M|    if (curr == *head)
  ------------------
  |  Branch (636:9): [True: 0, False: 1.48M]
  ------------------
  637|      0|        return;
  638|  1.48M|    if (curr == *tail)
  ------------------
  |  Branch (638:9): [True: 663k, False: 823k]
  ------------------
  639|   663k|        *tail = curr->prev;
  640|  1.48M|    if (curr->next != NULL)
  ------------------
  |  Branch (640:9): [True: 823k, False: 663k]
  ------------------
  641|   823k|        curr->next->prev = curr->prev;
  642|  1.48M|    if (curr->prev != NULL)
  ------------------
  |  Branch (642:9): [True: 1.48M, False: 0]
  ------------------
  643|  1.48M|        curr->prev->next = curr->next;
  644|  1.48M|    (*head)->prev = curr;
  645|  1.48M|    curr->next = *head;
  646|       |    curr->prev = NULL;
  647|  1.48M|    *head = curr;
  648|  1.48M|}
ssl_ciph.c:ssl_cipher_strength_sort:
  923|  3.48k|{
  924|  3.48k|    int32_t max_strength_bits;
  925|  3.48k|    int i, *number_uses;
  926|  3.48k|    CIPHER_ORDER *curr;
  927|       |
  928|       |    /*
  929|       |     * This routine sorts the ciphers with descending strength. The sorting
  930|       |     * must keep the pre-sorted sequence, so we apply the normal sorting
  931|       |     * routine as '+' movement to the end of the list.
  932|       |     */
  933|  3.48k|    max_strength_bits = 0;
  934|  3.48k|    curr = *head_p;
  935|   576k|    while (curr != NULL) {
  ------------------
  |  Branch (935:12): [True: 573k, False: 3.48k]
  ------------------
  936|   573k|        if (curr->active && (curr->cipher->strength_bits > max_strength_bits))
  ------------------
  |  Branch (936:13): [True: 558k, False: 14.4k]
  |  Branch (936:29): [True: 3.35k, False: 555k]
  ------------------
  937|  3.35k|            max_strength_bits = curr->cipher->strength_bits;
  938|   573k|        curr = curr->next;
  939|   573k|    }
  940|       |
  941|  3.48k|    number_uses = OPENSSL_calloc(max_strength_bits + 1, sizeof(int));
  ------------------
  |  |  112|  3.48k|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  942|  3.48k|    if (number_uses == NULL)
  ------------------
  |  Branch (942:9): [True: 0, False: 3.48k]
  ------------------
  943|      0|        return 0;
  944|       |
  945|       |    /*
  946|       |     * Now find the strength_bits values actually used
  947|       |     */
  948|  3.48k|    curr = *head_p;
  949|   576k|    while (curr != NULL) {
  ------------------
  |  Branch (949:12): [True: 573k, False: 3.48k]
  ------------------
  950|   573k|        if (curr->active)
  ------------------
  |  Branch (950:13): [True: 558k, False: 14.4k]
  ------------------
  951|   558k|            number_uses[curr->cipher->strength_bits]++;
  952|   573k|        curr = curr->next;
  953|   573k|    }
  954|       |    /*
  955|       |     * Go through the list of used strength_bits values in descending
  956|       |     * order.
  957|       |     */
  958|   863k|    for (i = max_strength_bits; i >= 0; i--)
  ------------------
  |  Branch (958:33): [True: 859k, False: 3.48k]
  ------------------
  959|   859k|        if (number_uses[i] > 0)
  ------------------
  |  Branch (959:13): [True: 16.6k, False: 843k]
  ------------------
  960|  16.6k|            ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, 0, CIPHER_ORD, i, head_p,
  ------------------
  |  |  147|  16.6k|#define CIPHER_ORD 4
  ------------------
  961|  16.6k|                tail_p);
  962|       |
  963|  3.48k|    OPENSSL_free(number_uses);
  ------------------
  |  |  131|  3.48k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  964|  3.48k|    return 1;
  965|  3.48k|}
ssl_ciph.c:ssl_cipher_collect_aliases:
  722|  3.34k|{
  723|  3.34k|    CIPHER_ORDER *ciph_curr;
  724|  3.34k|    const SSL_CIPHER **ca_curr;
  725|  3.34k|    int i;
  726|  3.34k|    uint32_t mask_mkey = ~disabled_mkey;
  727|  3.34k|    uint32_t mask_auth = ~disabled_auth;
  728|  3.34k|    uint32_t mask_enc = ~disabled_enc;
  729|  3.34k|    uint32_t mask_mac = ~disabled_mac;
  730|       |
  731|       |    /*
  732|       |     * First, add the real ciphers as already collected
  733|       |     */
  734|  3.34k|    ciph_curr = head;
  735|  3.34k|    ca_curr = ca_list;
  736|   554k|    while (ciph_curr != NULL) {
  ------------------
  |  Branch (736:12): [True: 551k, False: 3.34k]
  ------------------
  737|   551k|        *ca_curr = ciph_curr->cipher;
  738|   551k|        ca_curr++;
  739|   551k|        ciph_curr = ciph_curr->next;
  740|   551k|    }
  741|       |
  742|       |    /*
  743|       |     * Now we add the available ones from the cipher_aliases[] table.
  744|       |     * They represent either one or more algorithms, some of which
  745|       |     * in any affected category must be supported (set in enabled_mask),
  746|       |     * or represent a cipher strength value (will be added in any case because algorithms=0).
  747|       |     */
  748|   267k|    for (i = 0; i < num_of_group_aliases; i++) {
  ------------------
  |  Branch (748:17): [True: 264k, False: 3.34k]
  ------------------
  749|   264k|        uint32_t algorithm_mkey = cipher_aliases[i].algorithm_mkey;
  750|   264k|        uint32_t algorithm_auth = cipher_aliases[i].algorithm_auth;
  751|   264k|        uint32_t algorithm_enc = cipher_aliases[i].algorithm_enc;
  752|   264k|        uint32_t algorithm_mac = cipher_aliases[i].algorithm_mac;
  753|       |
  754|   264k|        if (algorithm_mkey)
  ------------------
  |  Branch (754:13): [True: 83.6k, False: 180k]
  ------------------
  755|  83.6k|            if ((algorithm_mkey & mask_mkey) == 0)
  ------------------
  |  Branch (755:17): [True: 8.02k, False: 75.6k]
  ------------------
  756|  8.02k|                continue;
  757|       |
  758|   256k|        if (algorithm_auth)
  ------------------
  |  Branch (758:13): [True: 66.2k, False: 190k]
  ------------------
  759|  66.2k|            if ((algorithm_auth & mask_auth) == 0)
  ------------------
  |  Branch (759:17): [True: 10.3k, False: 55.8k]
  ------------------
  760|  10.3k|                continue;
  761|       |
  762|   245k|        if (algorithm_enc)
  ------------------
  |  Branch (762:13): [True: 96.8k, False: 149k]
  ------------------
  763|  96.8k|            if ((algorithm_enc & mask_enc) == 0)
  ------------------
  |  Branch (763:17): [True: 21.4k, False: 75.4k]
  ------------------
  764|  21.4k|                continue;
  765|       |
  766|   224k|        if (algorithm_mac)
  ------------------
  |  Branch (766:13): [True: 33.2k, False: 191k]
  ------------------
  767|  33.2k|            if ((algorithm_mac & mask_mac) == 0)
  ------------------
  |  Branch (767:17): [True: 10.4k, False: 22.8k]
  ------------------
  768|  10.4k|                continue;
  769|       |
  770|   214k|        *ca_curr = (SSL_CIPHER *)(cipher_aliases + i);
  771|   214k|        ca_curr++;
  772|   214k|    }
  773|       |
  774|       |    *ca_curr = NULL; /* end of list */
  775|  3.34k|}
ssl_ciph.c:ssl_cipher_process_rulestr:
  971|  3.35k|{
  972|  3.35k|    uint32_t alg_mkey, alg_auth, alg_enc, alg_mac, algo_strength;
  973|  3.35k|    int min_tls;
  974|  3.35k|    const char *l, *buf;
  975|  3.35k|    int j, multi, found, rule, retval, ok, buflen;
  976|  3.35k|    uint32_t cipher_id = 0;
  977|  3.35k|    char ch;
  978|       |
  979|  3.35k|    retval = 1;
  980|  3.35k|    l = rule_str;
  981|  21.6k|    for (;;) {
  982|  21.6k|        ch = *l;
  983|       |
  984|  21.6k|        if (ch == '\0')
  ------------------
  |  Branch (984:13): [True: 80, False: 21.5k]
  ------------------
  985|     80|            break; /* done */
  986|  21.5k|        if (ch == '-') {
  ------------------
  |  Branch (986:13): [True: 219, False: 21.3k]
  ------------------
  987|    219|            rule = CIPHER_DEL;
  ------------------
  |  |  146|    219|#define CIPHER_DEL 3
  ------------------
  988|    219|            l++;
  989|  21.3k|        } else if (ch == '+') {
  ------------------
  |  Branch (989:20): [True: 143, False: 21.1k]
  ------------------
  990|    143|            rule = CIPHER_ORD;
  ------------------
  |  |  147|    143|#define CIPHER_ORD 4
  ------------------
  991|    143|            l++;
  992|  21.1k|        } else if (ch == '!') {
  ------------------
  |  Branch (992:20): [True: 5.41k, False: 15.7k]
  ------------------
  993|  5.41k|            rule = CIPHER_KILL;
  ------------------
  |  |  145|  5.41k|#define CIPHER_KILL 2
  ------------------
  994|  5.41k|            l++;
  995|  15.7k|        } else if (ch == '@') {
  ------------------
  |  Branch (995:20): [True: 606, False: 15.1k]
  ------------------
  996|    606|            rule = CIPHER_SPECIAL;
  ------------------
  |  |  148|    606|#define CIPHER_SPECIAL 5
  ------------------
  997|    606|            l++;
  998|  15.1k|        } else {
  999|  15.1k|            rule = CIPHER_ADD;
  ------------------
  |  |  144|  15.1k|#define CIPHER_ADD 1
  ------------------
 1000|  15.1k|        }
 1001|       |
 1002|  21.5k|        if (ITEM_SEP(ch)) {
  ------------------
  |  |  614|  21.5k|    (((a) == ':') || ((a) == ' ') || ((a) == ';') || ((a) == ','))
  |  |  ------------------
  |  |  |  Branch (614:6): [True: 7.24k, False: 14.2k]
  |  |  |  Branch (614:22): [True: 734, False: 13.5k]
  |  |  |  Branch (614:38): [True: 953, False: 12.5k]
  |  |  |  Branch (614:54): [True: 815, False: 11.7k]
  |  |  ------------------
  ------------------
 1003|  9.75k|            l++;
 1004|  9.75k|            continue;
 1005|  9.75k|        }
 1006|       |
 1007|  11.7k|        alg_mkey = 0;
 1008|  11.7k|        alg_auth = 0;
 1009|  11.7k|        alg_enc = 0;
 1010|  11.7k|        alg_mac = 0;
 1011|  11.7k|        min_tls = 0;
 1012|  11.7k|        algo_strength = 0;
 1013|       |
 1014|  11.9k|        for (;;) {
 1015|  11.9k|            ch = *l;
 1016|  11.9k|            buf = l;
 1017|  11.9k|            buflen = 0;
 1018|  11.9k|#ifndef CHARSET_EBCDIC
 1019|   102k|            while (((ch >= 'A') && (ch <= 'Z')) || ((ch >= '0') && (ch <= '9')) || ((ch >= 'a') && (ch <= 'z')) || (ch == '-') || (ch == '_') || (ch == '.') || (ch == '='))
  ------------------
  |  Branch (1019:21): [True: 87.6k, False: 15.1k]
  |  Branch (1019:36): [True: 82.1k, False: 5.54k]
  |  Branch (1019:53): [True: 14.7k, False: 6.00k]
  |  Branch (1019:68): [True: 2.04k, False: 12.6k]
  |  Branch (1019:85): [True: 4.46k, False: 14.2k]
  |  Branch (1019:100): [True: 4.40k, False: 61]
  |  Branch (1019:116): [True: 685, False: 13.5k]
  |  Branch (1019:131): [True: 1.01k, False: 12.5k]
  |  Branch (1019:146): [True: 329, False: 12.2k]
  |  Branch (1019:161): [True: 268, False: 11.9k]
  ------------------
 1020|       |#else
 1021|       |            while (isalnum((unsigned char)ch) || (ch == '-') || (ch == '_') || (ch == '.')
 1022|       |                || (ch == '='))
 1023|       |#endif
 1024|  90.8k|            {
 1025|  90.8k|                ch = *(++l);
 1026|  90.8k|                buflen++;
 1027|  90.8k|            }
 1028|       |
 1029|  11.9k|            if (buflen == 0) {
  ------------------
  |  Branch (1029:17): [True: 130, False: 11.8k]
  ------------------
 1030|       |                /*
 1031|       |                 * We hit something we cannot deal with,
 1032|       |                 * it is no command or separator nor
 1033|       |                 * alphanumeric, so we call this an error.
 1034|       |                 */
 1035|    130|                ERR_raise(ERR_LIB_SSL, SSL_R_INVALID_COMMAND);
  ------------------
  |  |  404|    130|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|    130|    (ERR_new(),                                                  \
  |  |  |  |  407|    130|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|    130|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|    130|        ERR_set_error)
  |  |  ------------------
  ------------------
 1036|    130|                return 0;
 1037|    130|            }
 1038|       |
 1039|  11.8k|            if (rule == CIPHER_SPECIAL) {
  ------------------
  |  |  148|  11.8k|#define CIPHER_SPECIAL 5
  ------------------
  |  Branch (1039:17): [True: 601, False: 11.2k]
  ------------------
 1040|    601|                found = 0; /* unused -- avoid compiler warning */
 1041|    601|                break; /* special treatment */
 1042|    601|            }
 1043|       |
 1044|       |            /* check for multi-part specification */
 1045|  11.2k|            if (ch == '+') {
  ------------------
  |  Branch (1045:17): [True: 259, False: 10.9k]
  ------------------
 1046|    259|                multi = 1;
 1047|    259|                l++;
 1048|  10.9k|            } else {
 1049|  10.9k|                multi = 0;
 1050|  10.9k|            }
 1051|       |
 1052|       |            /*
 1053|       |             * Now search for the cipher alias in the ca_list. Be careful
 1054|       |             * with the strncmp, because the "buflen" limitation
 1055|       |             * will make the rule "ADH:SOME" and the cipher
 1056|       |             * "ADH-MY-CIPHER" look like a match for buflen=3.
 1057|       |             * So additionally check whether the cipher name found
 1058|       |             * has the correct length. We can save a strlen() call:
 1059|       |             * just checking for the '\0' at the right place is
 1060|       |             * sufficient, we have to strncmp() anyway. (We cannot
 1061|       |             * use strcmp(), because buf is not '\0' terminated.)
 1062|       |             */
 1063|  11.2k|            j = found = 0;
 1064|  11.2k|            cipher_id = 0;
 1065|  2.12M|            while (ca_list[j]) {
  ------------------
  |  Branch (1065:20): [True: 2.12M, False: 2.15k]
  ------------------
 1066|  2.12M|                if (strncmp(buf, ca_list[j]->name, buflen) == 0
  ------------------
  |  Branch (1066:21): [True: 30.2k, False: 2.09M]
  ------------------
 1067|  30.2k|                    && (ca_list[j]->name[buflen] == '\0')) {
  ------------------
  |  Branch (1067:24): [True: 9.08k, False: 21.1k]
  ------------------
 1068|  9.08k|                    found = 1;
 1069|  9.08k|                    break;
 1070|  2.11M|                } else if (ca_list[j]->stdname != NULL
  ------------------
  |  Branch (1070:28): [True: 1.84M, False: 270k]
  ------------------
 1071|  1.84M|                    && strncmp(buf, ca_list[j]->stdname, buflen) == 0
  ------------------
  |  Branch (1071:24): [True: 6.79k, False: 1.83M]
  ------------------
 1072|  6.79k|                    && ca_list[j]->stdname[buflen] == '\0') {
  ------------------
  |  Branch (1072:24): [True: 5, False: 6.79k]
  ------------------
 1073|      5|                    found = 1;
 1074|      5|                    break;
 1075|      5|                } else
 1076|  2.11M|                    j++;
 1077|  2.12M|            }
 1078|       |
 1079|  11.2k|            if (!found)
  ------------------
  |  Branch (1079:17): [True: 2.15k, False: 9.08k]
  ------------------
 1080|  2.15k|                break; /* ignore this entry */
 1081|       |
 1082|  9.08k|            if (ca_list[j]->algorithm_mkey) {
  ------------------
  |  Branch (1082:17): [True: 585, False: 8.50k]
  ------------------
 1083|    585|                if (alg_mkey) {
  ------------------
  |  Branch (1083:21): [True: 68, False: 517]
  ------------------
 1084|     68|                    alg_mkey &= ca_list[j]->algorithm_mkey;
 1085|     68|                    if (!alg_mkey) {
  ------------------
  |  Branch (1085:25): [True: 1, False: 67]
  ------------------
 1086|      1|                        found = 0;
 1087|      1|                        break;
 1088|      1|                    }
 1089|    517|                } else {
 1090|    517|                    alg_mkey = ca_list[j]->algorithm_mkey;
 1091|    517|                }
 1092|    585|            }
 1093|       |
 1094|  9.08k|            if (ca_list[j]->algorithm_auth) {
  ------------------
  |  Branch (1094:17): [True: 450, False: 8.63k]
  ------------------
 1095|    450|                if (alg_auth) {
  ------------------
  |  Branch (1095:21): [True: 41, False: 409]
  ------------------
 1096|     41|                    alg_auth &= ca_list[j]->algorithm_auth;
 1097|     41|                    if (!alg_auth) {
  ------------------
  |  Branch (1097:25): [True: 26, False: 15]
  ------------------
 1098|     26|                        found = 0;
 1099|     26|                        break;
 1100|     26|                    }
 1101|    409|                } else {
 1102|    409|                    alg_auth = ca_list[j]->algorithm_auth;
 1103|    409|                }
 1104|    450|            }
 1105|       |
 1106|  9.06k|            if (ca_list[j]->algorithm_enc) {
  ------------------
  |  Branch (1106:17): [True: 5.61k, False: 3.44k]
  ------------------
 1107|  5.61k|                if (alg_enc) {
  ------------------
  |  Branch (1107:21): [True: 35, False: 5.58k]
  ------------------
 1108|     35|                    alg_enc &= ca_list[j]->algorithm_enc;
 1109|     35|                    if (!alg_enc) {
  ------------------
  |  Branch (1109:25): [True: 19, False: 16]
  ------------------
 1110|     19|                        found = 0;
 1111|     19|                        break;
 1112|     19|                    }
 1113|  5.58k|                } else {
 1114|  5.58k|                    alg_enc = ca_list[j]->algorithm_enc;
 1115|  5.58k|                }
 1116|  5.61k|            }
 1117|       |
 1118|  9.04k|            if (ca_list[j]->algorithm_mac) {
  ------------------
  |  Branch (1118:17): [True: 248, False: 8.79k]
  ------------------
 1119|    248|                if (alg_mac) {
  ------------------
  |  Branch (1119:21): [True: 23, False: 225]
  ------------------
 1120|     23|                    alg_mac &= ca_list[j]->algorithm_mac;
 1121|     23|                    if (!alg_mac) {
  ------------------
  |  Branch (1121:25): [True: 10, False: 13]
  ------------------
 1122|     10|                        found = 0;
 1123|     10|                        break;
 1124|     10|                    }
 1125|    225|                } else {
 1126|    225|                    alg_mac = ca_list[j]->algorithm_mac;
 1127|    225|                }
 1128|    248|            }
 1129|       |
 1130|  9.03k|            if (ca_list[j]->algo_strength & SSL_STRONG_MASK) {
  ------------------
  |  |  241|  9.03k|#define SSL_STRONG_MASK 0x0000001FU
  ------------------
  |  Branch (1130:17): [True: 337, False: 8.69k]
  ------------------
 1131|    337|                if (algo_strength & SSL_STRONG_MASK) {
  ------------------
  |  |  241|    337|#define SSL_STRONG_MASK 0x0000001FU
  ------------------
  |  Branch (1131:21): [True: 21, False: 316]
  ------------------
 1132|     21|                    algo_strength &= (ca_list[j]->algo_strength & SSL_STRONG_MASK) | ~SSL_STRONG_MASK;
  ------------------
  |  |  241|     21|#define SSL_STRONG_MASK 0x0000001FU
  ------------------
                                  algo_strength &= (ca_list[j]->algo_strength & SSL_STRONG_MASK) | ~SSL_STRONG_MASK;
  ------------------
  |  |  241|     21|#define SSL_STRONG_MASK 0x0000001FU
  ------------------
 1133|     21|                    if (!(algo_strength & SSL_STRONG_MASK)) {
  ------------------
  |  |  241|     21|#define SSL_STRONG_MASK 0x0000001FU
  ------------------
  |  Branch (1133:25): [True: 9, False: 12]
  ------------------
 1134|      9|                        found = 0;
 1135|      9|                        break;
 1136|      9|                    }
 1137|    316|                } else {
 1138|    316|                    algo_strength = ca_list[j]->algo_strength & SSL_STRONG_MASK;
  ------------------
  |  |  241|    316|#define SSL_STRONG_MASK 0x0000001FU
  ------------------
 1139|    316|                }
 1140|    337|            }
 1141|       |
 1142|  9.02k|            if (ca_list[j]->algo_strength & SSL_DEFAULT_MASK) {
  ------------------
  |  |  242|  9.02k|#define SSL_DEFAULT_MASK 0X00000020U
  ------------------
  |  Branch (1142:17): [True: 2.60k, False: 6.41k]
  ------------------
 1143|  2.60k|                if (algo_strength & SSL_DEFAULT_MASK) {
  ------------------
  |  |  242|  2.60k|#define SSL_DEFAULT_MASK 0X00000020U
  ------------------
  |  Branch (1143:21): [True: 4, False: 2.60k]
  ------------------
 1144|      4|                    algo_strength &= (ca_list[j]->algo_strength & SSL_DEFAULT_MASK) | ~SSL_DEFAULT_MASK;
  ------------------
  |  |  242|      4|#define SSL_DEFAULT_MASK 0X00000020U
  ------------------
                                  algo_strength &= (ca_list[j]->algo_strength & SSL_DEFAULT_MASK) | ~SSL_DEFAULT_MASK;
  ------------------
  |  |  242|      4|#define SSL_DEFAULT_MASK 0X00000020U
  ------------------
 1145|      4|                    if (!(algo_strength & SSL_DEFAULT_MASK)) {
  ------------------
  |  |  242|      4|#define SSL_DEFAULT_MASK 0X00000020U
  ------------------
  |  Branch (1145:25): [True: 0, False: 4]
  ------------------
 1146|      0|                        found = 0;
 1147|      0|                        break;
 1148|      0|                    }
 1149|  2.60k|                } else {
 1150|  2.60k|                    algo_strength |= ca_list[j]->algo_strength & SSL_DEFAULT_MASK;
  ------------------
  |  |  242|  2.60k|#define SSL_DEFAULT_MASK 0X00000020U
  ------------------
 1151|  2.60k|                }
 1152|  2.60k|            }
 1153|       |
 1154|  9.02k|            if (ca_list[j]->valid) {
  ------------------
  |  Branch (1154:17): [True: 123, False: 8.89k]
  ------------------
 1155|       |                /*
 1156|       |                 * explicit ciphersuite found; its protocol version does not
 1157|       |                 * become part of the search pattern!
 1158|       |                 */
 1159|       |
 1160|    123|                cipher_id = ca_list[j]->id;
 1161|  8.89k|            } else {
 1162|       |                /*
 1163|       |                 * not an explicit ciphersuite; only in this case, the
 1164|       |                 * protocol version is considered part of the search pattern
 1165|       |                 */
 1166|       |
 1167|  8.89k|                if (ca_list[j]->min_tls) {
  ------------------
  |  Branch (1167:21): [True: 72, False: 8.82k]
  ------------------
 1168|     72|                    if (min_tls != 0 && min_tls != ca_list[j]->min_tls) {
  ------------------
  |  Branch (1168:25): [True: 24, False: 48]
  |  Branch (1168:41): [True: 6, False: 18]
  ------------------
 1169|      6|                        found = 0;
 1170|      6|                        break;
 1171|     66|                    } else {
 1172|     66|                        min_tls = ca_list[j]->min_tls;
 1173|     66|                    }
 1174|     72|                }
 1175|  8.89k|            }
 1176|       |
 1177|  9.01k|            if (!multi)
  ------------------
  |  Branch (1177:17): [True: 8.81k, False: 198]
  ------------------
 1178|  8.81k|                break;
 1179|  9.01k|        }
 1180|       |
 1181|       |        /*
 1182|       |         * Ok, we have the rule, now apply it
 1183|       |         */
 1184|  11.6k|        if (rule == CIPHER_SPECIAL) { /* special command */
  ------------------
  |  |  148|  11.6k|#define CIPHER_SPECIAL 5
  ------------------
  |  Branch (1184:13): [True: 601, False: 11.0k]
  ------------------
 1185|    601|            ok = 0;
 1186|    601|            if ((buflen == 8) && HAS_PREFIX(buf, "STRENGTH")) {
  ------------------
  |  |   58|    213|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 140, False: 73]
  |  |  ------------------
  ------------------
  |  Branch (1186:17): [True: 213, False: 388]
  ------------------
 1187|    140|                ok = ssl_cipher_strength_sort(head_p, tail_p);
 1188|    461|            } else if (buflen == 10 && CHECK_AND_SKIP_PREFIX(buf, "SECLEVEL=")) {
  ------------------
  |  |   61|    131|    (HAS_PREFIX(str, pre) ? ((str) += sizeof(pre) - 1, 1) : 0)
  |  |  ------------------
  |  |  |  |   58|    131|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (58:30): [True: 75, False: 56]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:5): [True: 75, False: 56]
  |  |  ------------------
  ------------------
  |  Branch (1188:24): [True: 131, False: 330]
  ------------------
 1189|     75|                int level = *buf - '0';
 1190|     75|                if (level < 0 || level > 5) {
  ------------------
  |  Branch (1190:21): [True: 21, False: 54]
  |  Branch (1190:34): [True: 10, False: 44]
  ------------------
 1191|     31|                    ERR_raise(ERR_LIB_SSL, SSL_R_INVALID_COMMAND);
  ------------------
  |  |  404|     31|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|     31|    (ERR_new(),                                                  \
  |  |  |  |  407|     31|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|     31|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|     31|        ERR_set_error)
  |  |  ------------------
  ------------------
 1192|     44|                } else {
 1193|     44|                    c->sec_level = level;
 1194|     44|                    ok = 1;
 1195|     44|                }
 1196|    386|            } else {
 1197|    386|                ERR_raise(ERR_LIB_SSL, SSL_R_INVALID_COMMAND);
  ------------------
  |  |  404|    386|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|    386|    (ERR_new(),                                                  \
  |  |  |  |  407|    386|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|    386|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|    386|        ERR_set_error)
  |  |  ------------------
  ------------------
 1198|    386|            }
 1199|    601|            if (ok == 0)
  ------------------
  |  Branch (1199:17): [True: 417, False: 184]
  ------------------
 1200|    417|                retval = 0;
 1201|       |            /*
 1202|       |             * We do not support any "multi" options
 1203|       |             * together with "@", so throw away the
 1204|       |             * rest of the command, if any left, until
 1205|       |             * end or ':' is found.
 1206|       |             */
 1207|  2.98k|            while ((*l != '\0') && !ITEM_SEP(*l))
  ------------------
  |  |  614|  2.86k|    (((a) == ':') || ((a) == ' ') || ((a) == ';') || ((a) == ','))
  |  |  ------------------
  |  |  |  Branch (614:6): [True: 130, False: 2.73k]
  |  |  |  Branch (614:22): [True: 211, False: 2.52k]
  |  |  |  Branch (614:38): [True: 124, False: 2.39k]
  |  |  |  Branch (614:54): [True: 14, False: 2.38k]
  |  |  ------------------
  ------------------
  |  Branch (1207:20): [True: 2.86k, False: 122]
  ------------------
 1208|  2.38k|                l++;
 1209|  11.0k|        } else if (found) {
  ------------------
  |  Branch (1209:20): [True: 8.81k, False: 2.22k]
  ------------------
 1210|  8.81k|            ssl_cipher_apply_rule(cipher_id,
 1211|  8.81k|                alg_mkey, alg_auth, alg_enc, alg_mac,
 1212|  8.81k|                min_tls, algo_strength, rule, -1, head_p,
 1213|  8.81k|                tail_p);
 1214|  8.81k|        } else {
 1215|  8.46k|            while ((*l != '\0') && !ITEM_SEP(*l))
  ------------------
  |  |  614|  8.12k|    (((a) == ':') || ((a) == ' ') || ((a) == ';') || ((a) == ','))
  |  |  ------------------
  |  |  |  Branch (614:6): [True: 858, False: 7.26k]
  |  |  |  Branch (614:22): [True: 322, False: 6.94k]
  |  |  |  Branch (614:38): [True: 429, False: 6.51k]
  |  |  |  Branch (614:54): [True: 272, False: 6.24k]
  |  |  ------------------
  ------------------
  |  Branch (1215:20): [True: 8.12k, False: 344]
  ------------------
 1216|  6.24k|                l++;
 1217|  2.22k|        }
 1218|  11.6k|        if (*l == '\0')
  ------------------
  |  Branch (1218:13): [True: 3.14k, False: 8.49k]
  ------------------
 1219|  3.14k|            break; /* done */
 1220|  11.6k|    }
 1221|       |
 1222|  3.22k|    return retval;
 1223|  3.35k|}
ssl_ciph.c:update_cipher_list_by_id:
 1323|  3.15k|{
 1324|  3.15k|    STACK_OF(SSL_CIPHER) *tmp_cipher_list = sk_SSL_CIPHER_dup(cipherstack);
  ------------------
  |  |   33|  3.15k|#define STACK_OF(type) struct stack_st_##type
  ------------------
                  STACK_OF(SSL_CIPHER) *tmp_cipher_list = sk_SSL_CIPHER_dup(cipherstack);
  ------------------
  |  | 1027|  3.15k|#define sk_SSL_CIPHER_dup(sk) ((STACK_OF(SSL_CIPHER) *)OPENSSL_sk_dup(ossl_check_const_SSL_CIPHER_sk_type(sk)))
  ------------------
 1325|       |
 1326|  3.15k|    if (tmp_cipher_list == NULL) {
  ------------------
  |  Branch (1326:9): [True: 0, False: 3.15k]
  ------------------
 1327|      0|        return 0;
 1328|      0|    }
 1329|       |
 1330|  3.15k|    sk_SSL_CIPHER_free(*cipher_list_by_id);
  ------------------
  |  | 1011|  3.15k|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1331|  3.15k|    *cipher_list_by_id = tmp_cipher_list;
 1332|       |
 1333|  3.15k|    (void)sk_SSL_CIPHER_set_cmp_func(*cipher_list_by_id, ssl_cipher_ptr_id_cmp);
  ------------------
  |  | 1029|  3.15k|#define sk_SSL_CIPHER_set_cmp_func(sk, cmp) ((sk_SSL_CIPHER_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_compfunc_type(cmp)))
  ------------------
 1334|  3.15k|    sk_SSL_CIPHER_sort(*cipher_list_by_id);
  ------------------
  |  | 1025|  3.15k|#define sk_SSL_CIPHER_sort(sk) OPENSSL_sk_sort(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1335|       |
 1336|  3.15k|    return 1;
 1337|  3.15k|}

SSL_CONF_CTX_free:
 1115|  2.47k|{
 1116|  2.47k|    if (cctx) {
  ------------------
  |  Branch (1116:9): [True: 0, False: 2.47k]
  ------------------
 1117|      0|        free_cert_filename(cctx);
 1118|      0|        OPENSSL_free(cctx->prefix);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1119|      0|        sk_X509_NAME_pop_free(cctx->canames, X509_NAME_free);
  ------------------
  |  |   70|      0|#define sk_X509_NAME_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_freefunc_type(freefunc))
  ------------------
 1120|      0|        OPENSSL_free(cctx);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1121|      0|    }
 1122|  2.47k|}

OPENSSL_init_ssl:
   47|  4.32k|{
   48|  4.32k|    static int stoperrset = 0;
   49|       |
   50|  4.32k|    if (stopped) {
  ------------------
  |  Branch (50:9): [True: 0, False: 4.32k]
  ------------------
   51|      0|        if (!stoperrset) {
  ------------------
  |  Branch (51:13): [True: 0, False: 0]
  ------------------
   52|       |            /*
   53|       |             * We only ever set this once to avoid getting into an infinite
   54|       |             * loop where the error system keeps trying to init and fails so
   55|       |             * sets an error etc
   56|       |             */
   57|      0|            stoperrset = 1;
   58|      0|            ERR_raise(ERR_LIB_SSL, ERR_R_INIT_FAIL);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   59|      0|        }
   60|      0|        return 0;
   61|      0|    }
   62|       |
   63|  4.32k|    opts |= OPENSSL_INIT_ADD_ALL_CIPHERS
  ------------------
  |  |  506|  4.32k|#define OPENSSL_INIT_ADD_ALL_CIPHERS 0x00000004L
  ------------------
   64|  4.32k|        | OPENSSL_INIT_ADD_ALL_DIGESTS;
  ------------------
  |  |  507|  4.32k|#define OPENSSL_INIT_ADD_ALL_DIGESTS 0x00000008L
  ------------------
   65|  4.32k|#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
   66|  4.32k|    if ((opts & OPENSSL_INIT_NO_LOAD_CONFIG) == 0)
  ------------------
  |  |  511|  4.32k|#define OPENSSL_INIT_NO_LOAD_CONFIG 0x00000080L
  ------------------
  |  Branch (66:9): [True: 4.32k, False: 0]
  ------------------
   67|  4.32k|        opts |= OPENSSL_INIT_LOAD_CONFIG;
  ------------------
  |  |  510|  4.32k|#define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
  ------------------
   68|  4.32k|#endif
   69|       |
   70|  4.32k|    if (!OPENSSL_init_crypto(opts, settings))
  ------------------
  |  Branch (70:9): [True: 0, False: 4.32k]
  ------------------
   71|      0|        return 0;
   72|       |
   73|  4.32k|    if (!RUN_ONCE(&ssl_base, ossl_init_ssl_base))
  ------------------
  |  |  130|  4.32k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 4.32k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (73:9): [True: 0, False: 4.32k]
  ------------------
   74|      0|        return 0;
   75|       |
   76|  4.32k|    return 1;
   77|  4.32k|}
ssl_init.c:ossl_init_ssl_base:
   25|      1|{
   26|      1|#ifndef OPENSSL_NO_COMP
   27|      1|    OSSL_TRACE(INIT, "ossl_init_ssl_base: "
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   28|      1|                     "SSL_COMP_get_compression_methods()\n");
   29|       |    /*
   30|       |     * This will initialise the built-in compression algorithms. The value
   31|       |     * returned is a STACK_OF(SSL_COMP), but that can be discarded safely
   32|       |     */
   33|      1|    SSL_COMP_get_compression_methods();
   34|      1|#endif
   35|      1|    ssl_sort_cipher_list();
   36|      1|    OSSL_TRACE(INIT, "ossl_init_ssl_base: SSL_add_ssl_module()\n");
  ------------------
  |  |  290|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  285|      1|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   37|      1|    ssl_base_inited = 1;
   38|      1|    return 1;
   39|      1|}

SSL_clear:
  568|  1.77k|{
  569|  1.77k|    if (s->method == NULL) {
  ------------------
  |  Branch (569:9): [True: 0, False: 1.77k]
  ------------------
  570|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_NO_METHOD_SPECIFIED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  571|      0|        return 0;
  572|      0|    }
  573|       |
  574|  1.77k|    return s->method->ssl_reset(s);
  575|  1.77k|}
ossl_ssl_connection_reset:
  578|  3.54k|{
  579|  3.54k|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  ------------------
  |  |   39|  3.54k|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|  3.54k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 3.54k]
  |  |  |  |  ------------------
  |  |  |  |   33|  3.54k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  3.54k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 3.54k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  3.54k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  3.54k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
  580|       |
  581|  3.54k|    if (sc == NULL)
  ------------------
  |  Branch (581:9): [True: 0, False: 3.54k]
  ------------------
  582|      0|        return 0;
  583|       |
  584|  3.54k|    if (ssl_clear_bad_session(sc)) {
  ------------------
  |  Branch (584:9): [True: 0, False: 3.54k]
  ------------------
  585|      0|        SSL_SESSION_free(sc->session);
  586|      0|        sc->session = NULL;
  587|      0|    }
  588|  3.54k|    SSL_SESSION_free(sc->psksession);
  589|  3.54k|    sc->psksession = NULL;
  590|  3.54k|    OPENSSL_free(sc->psksession_id);
  ------------------
  |  |  131|  3.54k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  591|  3.54k|    sc->psksession_id = NULL;
  592|  3.54k|    sc->psksession_id_len = 0;
  593|  3.54k|    sc->hello_retry_request = SSL_HRR_NONE;
  594|  3.54k|    sc->sent_tickets = 0;
  595|       |
  596|  3.54k|    sc->error = 0;
  597|  3.54k|    sc->hit = 0;
  598|  3.54k|    sc->shutdown = 0;
  599|       |
  600|  3.54k|    if (sc->renegotiate) {
  ------------------
  |  Branch (600:9): [True: 0, False: 3.54k]
  ------------------
  601|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  602|      0|        return 0;
  603|      0|    }
  604|       |
  605|  3.54k|    ossl_statem_clear(sc);
  606|       |
  607|  3.54k|    sc->version = s->method->version;
  608|  3.54k|    sc->client_version = sc->version;
  609|  3.54k|    sc->rwstate = SSL_NOTHING;
  ------------------
  |  |  932|  3.54k|#define SSL_NOTHING 1
  ------------------
  610|       |
  611|  3.54k|    BUF_MEM_free(sc->init_buf);
  612|  3.54k|    sc->init_buf = NULL;
  613|  3.54k|    sc->first_packet = 0;
  614|       |
  615|  3.54k|    sc->key_update = SSL_KEY_UPDATE_NONE;
  ------------------
  |  | 1048|  3.54k|#define SSL_KEY_UPDATE_NONE -1
  ------------------
  616|  3.54k|    memset(sc->ext.compress_certificate_from_peer, 0,
  617|  3.54k|        sizeof(sc->ext.compress_certificate_from_peer));
  618|  3.54k|    sc->ext.compress_certificate_sent = 0;
  619|       |
  620|  3.54k|    EVP_MD_CTX_free(sc->pha_dgst);
  621|  3.54k|    sc->pha_dgst = NULL;
  622|       |
  623|       |    /* Reset DANE verification result state */
  624|  3.54k|    sc->dane.mdpth = -1;
  625|  3.54k|    sc->dane.pdpth = -1;
  626|  3.54k|    X509_free(sc->dane.mcert);
  627|  3.54k|    sc->dane.mcert = NULL;
  628|  3.54k|    sc->dane.mtlsa = NULL;
  629|       |
  630|       |    /* Clear the verification result peername */
  631|  3.54k|    X509_VERIFY_PARAM_move_peername(sc->param, NULL);
  632|       |
  633|       |    /* Clear any shared connection state */
  634|  3.54k|    OPENSSL_free(sc->shared_sigalgs);
  ------------------
  |  |  131|  3.54k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  635|  3.54k|    sc->shared_sigalgs = NULL;
  636|  3.54k|    sc->shared_sigalgslen = 0;
  637|       |
  638|       |    /*
  639|       |     * Check to see if we were changed into a different method, if so, revert
  640|       |     * back.
  641|       |     */
  642|  3.54k|    if (s->method != s->defltmeth) {
  ------------------
  |  Branch (642:9): [True: 0, False: 3.54k]
  ------------------
  643|      0|        s->method->ssl_deinit(s);
  644|      0|        s->method = s->defltmeth;
  645|      0|        if (!s->method->ssl_init(s))
  ------------------
  |  Branch (645:13): [True: 0, False: 0]
  ------------------
  646|      0|            return 0;
  647|  3.54k|    } else {
  648|  3.54k|        if (!s->method->ssl_clear(s))
  ------------------
  |  Branch (648:13): [True: 0, False: 3.54k]
  ------------------
  649|      0|            return 0;
  650|  3.54k|    }
  651|       |
  652|  3.54k|    ossl_quic_tls_clear(sc->qtls);
  653|       |
  654|  3.54k|    if (!RECORD_LAYER_reset(&sc->rlayer))
  ------------------
  |  Branch (654:9): [True: 0, False: 3.54k]
  ------------------
  655|      0|        return 0;
  656|       |
  657|  3.54k|    return 1;
  658|  3.54k|}
SSL_new:
  691|  1.77k|{
  692|  1.77k|    if (ctx == NULL) {
  ------------------
  |  Branch (692:9): [True: 0, False: 1.77k]
  ------------------
  693|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_NULL_SSL_CTX);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  694|      0|        return NULL;
  695|      0|    }
  696|  1.77k|    if (ctx->method == NULL) {
  ------------------
  |  Branch (696:9): [True: 0, False: 1.77k]
  ------------------
  697|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  698|      0|        return NULL;
  699|      0|    }
  700|  1.77k|    return ctx->method->ssl_new(ctx);
  701|  1.77k|}
ossl_ssl_init:
  704|  1.77k|{
  705|  1.77k|    if (!SSL_CTX_up_ref(ctx))
  ------------------
  |  Branch (705:9): [True: 0, False: 1.77k]
  ------------------
  706|      0|        return 0;
  707|       |
  708|  1.77k|    ssl->lock = CRYPTO_THREAD_lock_new();
  709|       |
  710|  1.77k|    if (ssl->lock == NULL || !CRYPTO_NEW_REF(&ssl->references, 1))
  ------------------
  |  Branch (710:9): [True: 0, False: 1.77k]
  |  Branch (710:30): [True: 0, False: 1.77k]
  ------------------
  711|      0|        goto err;
  712|       |
  713|  1.77k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_SSL, ssl, &ssl->ex_data)) {
  ------------------
  |  |  250|  1.77k|#define CRYPTO_EX_INDEX_SSL 0
  ------------------
  |  Branch (713:9): [True: 0, False: 1.77k]
  ------------------
  714|      0|        CRYPTO_FREE_REF(&ssl->references);
  715|      0|        goto err;
  716|      0|    }
  717|       |
  718|  1.77k|    ssl->ctx = ctx;
  719|  1.77k|    ssl->type = type;
  720|  1.77k|    ssl->defltmeth = ssl->method = method;
  721|       |
  722|  1.77k|    return 1;
  723|       |
  724|      0|err:
  725|      0|    CRYPTO_THREAD_lock_free(ssl->lock);
  726|       |    ssl->lock = NULL;
  727|      0|    SSL_CTX_free(ctx);
  728|      0|    return 0;
  729|  1.77k|}
ossl_ssl_connection_new_int:
  733|  1.77k|{
  734|  1.77k|    SSL_CONNECTION *s;
  735|  1.77k|    SSL *ssl;
  736|       |
  737|  1.77k|    s = OPENSSL_zalloc(sizeof(*s));
  ------------------
  |  |  108|  1.77k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  738|  1.77k|    if (s == NULL)
  ------------------
  |  Branch (738:9): [True: 0, False: 1.77k]
  ------------------
  739|      0|        return NULL;
  740|       |
  741|  1.77k|    ssl = &s->ssl;
  742|  1.77k|    s->user_ssl = (user_ssl == NULL) ? ssl : user_ssl;
  ------------------
  |  Branch (742:19): [True: 1.77k, False: 0]
  ------------------
  743|       |
  744|  1.77k|    if (!ossl_ssl_init(ssl, ctx, method, SSL_TYPE_SSL_CONNECTION)) {
  ------------------
  |  | 1223|  1.77k|#define SSL_TYPE_SSL_CONNECTION 0
  ------------------
  |  Branch (744:9): [True: 0, False: 1.77k]
  ------------------
  745|      0|        OPENSSL_free(s);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  746|      0|        s = NULL;
  747|      0|        ssl = NULL;
  748|      0|        goto sslerr;
  749|      0|    }
  750|       |
  751|  1.77k|    RECORD_LAYER_init(&s->rlayer, s);
  752|       |
  753|  1.77k|    s->options = ctx->options;
  754|       |
  755|  1.77k|    s->dane.flags = ctx->dane.flags;
  756|  1.77k|    if (method->version == ctx->method->version) {
  ------------------
  |  Branch (756:9): [True: 1.77k, False: 0]
  ------------------
  757|  1.77k|        s->min_proto_version = ctx->min_proto_version;
  758|  1.77k|        s->max_proto_version = ctx->max_proto_version;
  759|  1.77k|    }
  760|       |
  761|  1.77k|    s->mode = ctx->mode;
  762|  1.77k|    s->max_cert_list = ctx->max_cert_list;
  763|  1.77k|    s->max_early_data = ctx->max_early_data;
  764|  1.77k|    s->recv_max_early_data = ctx->recv_max_early_data;
  765|       |
  766|  1.77k|    s->num_tickets = ctx->num_tickets;
  767|  1.77k|    s->pha_enabled = ctx->pha_enabled;
  768|       |
  769|       |    /* Shallow copy of the ciphersuites stack */
  770|  1.77k|    s->tls13_ciphersuites = sk_SSL_CIPHER_dup(ctx->tls13_ciphersuites);
  ------------------
  |  | 1027|  1.77k|#define sk_SSL_CIPHER_dup(sk) ((STACK_OF(SSL_CIPHER) *)OPENSSL_sk_dup(ossl_check_const_SSL_CIPHER_sk_type(sk)))
  ------------------
  771|  1.77k|    if (s->tls13_ciphersuites == NULL)
  ------------------
  |  Branch (771:9): [True: 0, False: 1.77k]
  ------------------
  772|      0|        goto cerr;
  773|       |
  774|       |    /*
  775|       |     * Earlier library versions used to copy the pointer to the CERT, not
  776|       |     * its contents; only when setting new parameters for the per-SSL
  777|       |     * copy, ssl_cert_new would be called (and the direct reference to
  778|       |     * the per-SSL_CTX settings would be lost, but those still were
  779|       |     * indirectly accessed for various purposes, and for that reason they
  780|       |     * used to be known as s->ctx->default_cert). Now we don't look at the
  781|       |     * SSL_CTX's CERT after having duplicated it once.
  782|       |     */
  783|  1.77k|    s->cert = ssl_cert_dup(ctx->cert);
  784|  1.77k|    if (s->cert == NULL)
  ------------------
  |  Branch (784:9): [True: 0, False: 1.77k]
  ------------------
  785|      0|        goto sslerr;
  786|       |
  787|  1.77k|    RECORD_LAYER_set_read_ahead(&s->rlayer, ctx->read_ahead);
  ------------------
  |  |  134|  1.77k|#define RECORD_LAYER_set_read_ahead(rl, ra) ((rl)->read_ahead = (ra))
  ------------------
  788|  1.77k|    s->msg_callback = ctx->msg_callback;
  789|  1.77k|    s->msg_callback_arg = ctx->msg_callback_arg;
  790|  1.77k|    s->verify_mode = ctx->verify_mode;
  791|  1.77k|    s->not_resumable_session_cb = ctx->not_resumable_session_cb;
  792|  1.77k|    s->rlayer.record_padding_cb = ctx->record_padding_cb;
  793|  1.77k|    s->rlayer.record_padding_arg = ctx->record_padding_arg;
  794|  1.77k|    s->rlayer.block_padding = ctx->block_padding;
  795|  1.77k|    s->rlayer.hs_padding = ctx->hs_padding;
  796|  1.77k|    s->sid_ctx_length = ctx->sid_ctx_length;
  797|  1.77k|    if (!ossl_assert(s->sid_ctx_length <= sizeof(s->sid_ctx)))
  ------------------
  |  |   52|  1.77k|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|  1.77k|    __FILE__, __LINE__)
  ------------------
  |  Branch (797:9): [True: 0, False: 1.77k]
  ------------------
  798|      0|        goto err;
  799|  1.77k|    memcpy(&s->sid_ctx, &ctx->sid_ctx, sizeof(s->sid_ctx));
  800|  1.77k|    s->verify_callback = ctx->default_verify_callback;
  801|  1.77k|    s->generate_session_id = ctx->generate_session_id;
  802|       |
  803|  1.77k|    s->param = X509_VERIFY_PARAM_new();
  804|  1.77k|    if (s->param == NULL)
  ------------------
  |  Branch (804:9): [True: 0, False: 1.77k]
  ------------------
  805|      0|        goto asn1err;
  806|  1.77k|    X509_VERIFY_PARAM_inherit(s->param, ctx->param);
  807|  1.77k|    s->quiet_shutdown = IS_QUIC_CTX(ctx) ? 0 : ctx->quiet_shutdown;
  ------------------
  |  |   54|  1.77k|#define IS_QUIC_CTX(ctx) IS_QUIC_METHOD((ctx)->method)
  |  |  ------------------
  |  |  |  |   52|  1.77k|    ((m) == OSSL_QUIC_client_method() || (m) == OSSL_QUIC_client_thread_method() || (m) == OSSL_QUIC_server_method())
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:6): [True: 0, False: 1.77k]
  |  |  |  |  |  Branch (52:42): [True: 0, False: 1.77k]
  |  |  |  |  |  Branch (52:85): [True: 0, False: 1.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  808|       |
  809|  1.77k|    if (!IS_QUIC_CTX(ctx))
  ------------------
  |  |   54|  1.77k|#define IS_QUIC_CTX(ctx) IS_QUIC_METHOD((ctx)->method)
  |  |  ------------------
  |  |  |  |   52|  1.77k|    ((m) == OSSL_QUIC_client_method() || (m) == OSSL_QUIC_client_thread_method() || (m) == OSSL_QUIC_server_method())
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:6): [True: 0, False: 1.77k]
  |  |  |  |  |  Branch (52:42): [True: 0, False: 1.77k]
  |  |  |  |  |  Branch (52:85): [True: 0, False: 1.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  810|  1.77k|        s->ext.max_fragment_len_mode = ctx->ext.max_fragment_len_mode;
  811|       |
  812|  1.77k|    s->max_send_fragment = ctx->max_send_fragment;
  813|  1.77k|    s->split_send_fragment = ctx->split_send_fragment;
  814|  1.77k|    s->max_pipelines = ctx->max_pipelines;
  815|  1.77k|    s->rlayer.default_read_buf_len = ctx->default_read_buf_len;
  816|       |
  817|  1.77k|    s->ext.debug_cb = 0;
  818|  1.77k|    s->ext.debug_arg = NULL;
  819|  1.77k|    s->ext.ticket_expected = 0;
  820|  1.77k|    s->ext.status_type = ctx->ext.status_type;
  821|  1.77k|    s->ext.status_expected = 0;
  822|  1.77k|    s->ext.ocsp.ids = NULL;
  823|  1.77k|    s->ext.ocsp.exts = NULL;
  824|  1.77k|    s->ext.ocsp.resp = NULL;
  825|  1.77k|    s->ext.ocsp.resp_len = 0;
  826|  1.77k|    s->ext.ocsp.resp_ex = NULL;
  827|       |
  828|  1.77k|    if (!SSL_CTX_up_ref(ctx))
  ------------------
  |  Branch (828:9): [True: 0, False: 1.77k]
  ------------------
  829|      0|        goto err;
  830|       |
  831|  1.77k|    s->session_ctx = ctx;
  832|  1.77k|    if (ctx->ext.ecpointformats != NULL) {
  ------------------
  |  Branch (832:9): [True: 0, False: 1.77k]
  ------------------
  833|      0|        s->ext.ecpointformats = OPENSSL_memdup(ctx->ext.ecpointformats,
  ------------------
  |  |  133|      0|    CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  834|      0|            ctx->ext.ecpointformats_len);
  835|      0|        if (s->ext.ecpointformats == NULL) {
  ------------------
  |  Branch (835:13): [True: 0, False: 0]
  ------------------
  836|      0|            s->ext.ecpointformats_len = 0;
  837|      0|            goto err;
  838|      0|        }
  839|      0|        s->ext.ecpointformats_len = ctx->ext.ecpointformats_len;
  840|      0|    }
  841|  1.77k|    if (ctx->ext.supportedgroups != NULL) {
  ------------------
  |  Branch (841:9): [True: 1.77k, False: 0]
  ------------------
  842|  1.77k|        size_t add = 0;
  843|       |
  844|  1.77k|        if (ctx->ext.supportedgroups_len == 0)
  ------------------
  |  Branch (844:13): [True: 39, False: 1.73k]
  ------------------
  845|       |            /* Add 1 so allocation won't fail */
  846|     39|            add = 1;
  847|  1.77k|        s->ext.supportedgroups = OPENSSL_memdup(ctx->ext.supportedgroups,
  ------------------
  |  |  133|  1.77k|    CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  848|  1.77k|            (ctx->ext.supportedgroups_len + add)
  849|  1.77k|                * sizeof(*ctx->ext.supportedgroups));
  850|  1.77k|        if (s->ext.supportedgroups == NULL) {
  ------------------
  |  Branch (850:13): [True: 0, False: 1.77k]
  ------------------
  851|      0|            s->ext.supportedgroups_len = 0;
  852|      0|            goto err;
  853|      0|        }
  854|  1.77k|        s->ext.supportedgroups_len = ctx->ext.supportedgroups_len;
  855|  1.77k|    }
  856|  1.77k|    if (ctx->ext.keyshares != NULL) {
  ------------------
  |  Branch (856:9): [True: 1.77k, False: 0]
  ------------------
  857|  1.77k|        size_t add = 0;
  858|       |
  859|  1.77k|        if (ctx->ext.keyshares_len == 0)
  ------------------
  |  Branch (859:13): [True: 39, False: 1.73k]
  ------------------
  860|       |            /* Add 1 so allocation won't fail */
  861|     39|            add = 1;
  862|  1.77k|        s->ext.keyshares = OPENSSL_memdup(ctx->ext.keyshares,
  ------------------
  |  |  133|  1.77k|    CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  863|  1.77k|            (ctx->ext.keyshares_len + add)
  864|  1.77k|                * sizeof(*ctx->ext.keyshares));
  865|  1.77k|        if (s->ext.keyshares == NULL) {
  ------------------
  |  Branch (865:13): [True: 0, False: 1.77k]
  ------------------
  866|      0|            s->ext.keyshares_len = 0;
  867|      0|            goto err;
  868|      0|        }
  869|  1.77k|        s->ext.keyshares_len = ctx->ext.keyshares_len;
  870|  1.77k|    }
  871|  1.77k|    if (ctx->ext.tuples != NULL) {
  ------------------
  |  Branch (871:9): [True: 1.77k, False: 0]
  ------------------
  872|  1.77k|        size_t add = 0;
  873|       |
  874|  1.77k|        if (ctx->ext.tuples_len == 0)
  ------------------
  |  Branch (874:13): [True: 39, False: 1.73k]
  ------------------
  875|       |            /* Add 1 so allocation won't fail */
  876|     39|            add = 1;
  877|  1.77k|        s->ext.tuples = OPENSSL_memdup(ctx->ext.tuples,
  ------------------
  |  |  133|  1.77k|    CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  878|  1.77k|            (ctx->ext.tuples_len + add)
  879|  1.77k|                * sizeof(*ctx->ext.tuples));
  880|  1.77k|        if (s->ext.tuples == NULL) {
  ------------------
  |  Branch (880:13): [True: 0, False: 1.77k]
  ------------------
  881|      0|            s->ext.tuples_len = 0;
  882|      0|            goto err;
  883|      0|        }
  884|  1.77k|        s->ext.tuples_len = ctx->ext.tuples_len;
  885|  1.77k|    }
  886|       |
  887|  1.77k|#ifndef OPENSSL_NO_NEXTPROTONEG
  888|  1.77k|    s->ext.npn = NULL;
  889|  1.77k|#endif
  890|       |
  891|  1.77k|    if (ctx->ext.alpn != NULL) {
  ------------------
  |  Branch (891:9): [True: 0, False: 1.77k]
  ------------------
  892|      0|        s->ext.alpn = OPENSSL_malloc(ctx->ext.alpn_len);
  ------------------
  |  |  106|      0|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  893|      0|        if (s->ext.alpn == NULL) {
  ------------------
  |  Branch (893:13): [True: 0, False: 0]
  ------------------
  894|      0|            s->ext.alpn_len = 0;
  895|      0|            goto err;
  896|      0|        }
  897|      0|        memcpy(s->ext.alpn, ctx->ext.alpn, ctx->ext.alpn_len);
  898|      0|        s->ext.alpn_len = ctx->ext.alpn_len;
  899|      0|    }
  900|       |
  901|  1.77k|    s->verified_chain = NULL;
  902|  1.77k|    s->verify_result = X509_V_OK;
  ------------------
  |  |  312|  1.77k|#define X509_V_OK 0
  ------------------
  903|       |
  904|  1.77k|    s->default_passwd_callback = ctx->default_passwd_callback;
  905|  1.77k|    s->default_passwd_callback_userdata = ctx->default_passwd_callback_userdata;
  906|       |
  907|  1.77k|    s->key_update = SSL_KEY_UPDATE_NONE;
  ------------------
  |  | 1048|  1.77k|#define SSL_KEY_UPDATE_NONE -1
  ------------------
  908|       |
  909|  1.77k|    if (!IS_QUIC_CTX(ctx)) {
  ------------------
  |  |   54|  1.77k|#define IS_QUIC_CTX(ctx) IS_QUIC_METHOD((ctx)->method)
  |  |  ------------------
  |  |  |  |   52|  1.77k|    ((m) == OSSL_QUIC_client_method() || (m) == OSSL_QUIC_client_thread_method() || (m) == OSSL_QUIC_server_method())
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:6): [True: 0, False: 1.77k]
  |  |  |  |  |  Branch (52:42): [True: 0, False: 1.77k]
  |  |  |  |  |  Branch (52:85): [True: 0, False: 1.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  910|  1.77k|        s->allow_early_data_cb = ctx->allow_early_data_cb;
  911|  1.77k|        s->allow_early_data_cb_data = ctx->allow_early_data_cb_data;
  912|  1.77k|    }
  913|       |
  914|  1.77k|    if (!method->ssl_init(ssl))
  ------------------
  |  Branch (914:9): [True: 0, False: 1.77k]
  ------------------
  915|      0|        goto sslerr;
  916|       |
  917|  1.77k|    s->server = (method->ssl_accept == ssl_undefined_function) ? 0 : 1;
  ------------------
  |  Branch (917:17): [True: 1.77k, False: 0]
  ------------------
  918|       |
  919|  1.77k|    if (!method->ssl_reset(ssl))
  ------------------
  |  Branch (919:9): [True: 0, False: 1.77k]
  ------------------
  920|      0|        goto sslerr;
  921|       |
  922|  1.77k|#ifndef OPENSSL_NO_PSK
  923|  1.77k|    s->psk_client_callback = ctx->psk_client_callback;
  924|  1.77k|    s->psk_server_callback = ctx->psk_server_callback;
  925|  1.77k|#endif
  926|  1.77k|    s->psk_find_session_cb = ctx->psk_find_session_cb;
  927|  1.77k|    s->psk_use_session_cb = ctx->psk_use_session_cb;
  928|       |
  929|  1.77k|    s->async_cb = ctx->async_cb;
  930|  1.77k|    s->async_cb_arg = ctx->async_cb_arg;
  931|       |
  932|  1.77k|    s->job = NULL;
  933|       |
  934|       |#ifndef OPENSSL_NO_COMP_ALG
  935|       |    memcpy(s->cert_comp_prefs, ctx->cert_comp_prefs, sizeof(s->cert_comp_prefs));
  936|       |#endif
  937|  1.77k|    if (ctx->client_cert_type != NULL) {
  ------------------
  |  Branch (937:9): [True: 0, False: 1.77k]
  ------------------
  938|      0|        s->client_cert_type = OPENSSL_memdup(ctx->client_cert_type,
  ------------------
  |  |  133|      0|    CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  939|      0|            ctx->client_cert_type_len);
  940|      0|        if (s->client_cert_type == NULL)
  ------------------
  |  Branch (940:13): [True: 0, False: 0]
  ------------------
  941|      0|            goto sslerr;
  942|      0|        s->client_cert_type_len = ctx->client_cert_type_len;
  943|      0|    }
  944|  1.77k|    if (ctx->server_cert_type != NULL) {
  ------------------
  |  Branch (944:9): [True: 0, False: 1.77k]
  ------------------
  945|      0|        s->server_cert_type = OPENSSL_memdup(ctx->server_cert_type,
  ------------------
  |  |  133|      0|    CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  946|      0|            ctx->server_cert_type_len);
  947|      0|        if (s->server_cert_type == NULL)
  ------------------
  |  Branch (947:13): [True: 0, False: 0]
  ------------------
  948|      0|            goto sslerr;
  949|      0|        s->server_cert_type_len = ctx->server_cert_type_len;
  950|      0|    }
  951|       |
  952|  1.77k|#ifndef OPENSSL_NO_CT
  953|  1.77k|    if (!SSL_set_ct_validation_callback(ssl, ctx->ct_validation_callback,
  ------------------
  |  Branch (953:9): [True: 0, False: 1.77k]
  ------------------
  954|  1.77k|            ctx->ct_validation_callback_arg))
  955|      0|        goto sslerr;
  956|  1.77k|#endif
  957|       |
  958|  1.77k|    s->ssl_pkey_num = SSL_PKEY_NUM + ctx->sigalg_list_len;
  ------------------
  |  |  328|  1.77k|#define SSL_PKEY_NUM 9
  ------------------
  959|  1.77k|    return ssl;
  960|      0|cerr:
  961|      0|    ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  962|      0|    goto err;
  963|      0|asn1err:
  964|      0|    ERR_raise(ERR_LIB_SSL, ERR_R_ASN1_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  965|      0|    goto err;
  966|      0|sslerr:
  967|      0|    ERR_raise(ERR_LIB_SSL, ERR_R_SSL_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  968|      0|err:
  969|      0|    SSL_free(ssl);
  970|       |    return NULL;
  971|      0|}
ossl_ssl_connection_new:
  974|  1.77k|{
  975|       |    return ossl_ssl_connection_new_int(ctx, NULL, ctx->method);
  976|  1.77k|}
SSL_free:
 1423|  1.77k|{
 1424|  1.77k|    int i;
 1425|       |
 1426|  1.77k|    if (s == NULL)
  ------------------
  |  Branch (1426:9): [True: 0, False: 1.77k]
  ------------------
 1427|      0|        return;
 1428|  1.77k|    CRYPTO_DOWN_REF(&s->references, &i);
 1429|  1.77k|    REF_PRINT_COUNT("SSL", i, s);
  ------------------
  |  |  301|  1.77k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  1.77k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  297|  1.77k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  285|  1.77k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1430|  1.77k|    if (i > 0)
  ------------------
  |  Branch (1430:9): [True: 0, False: 1.77k]
  ------------------
 1431|      0|        return;
 1432|  1.77k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|  1.77k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 1.77k]
  |  |  ------------------
  ------------------
 1433|       |
 1434|  1.77k|    if (s->method != NULL)
  ------------------
  |  Branch (1434:9): [True: 1.77k, False: 0]
  ------------------
 1435|  1.77k|        s->method->ssl_free(s);
 1436|       |
 1437|  1.77k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL, s, &s->ex_data);
  ------------------
  |  |  250|  1.77k|#define CRYPTO_EX_INDEX_SSL 0
  ------------------
 1438|  1.77k|    SSL_CTX_free(s->ctx);
 1439|  1.77k|    CRYPTO_THREAD_lock_free(s->lock);
 1440|  1.77k|    CRYPTO_FREE_REF(&s->references);
 1441|       |
 1442|  1.77k|    OPENSSL_free(s);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1443|  1.77k|}
ossl_ssl_connection_free:
 1446|  1.77k|{
 1447|  1.77k|    SSL_CONNECTION *s;
 1448|       |
 1449|  1.77k|    s = SSL_CONNECTION_FROM_SSL_ONLY(ssl);
  ------------------
  |  |   23|  1.77k|    SSL_CONNECTION_FROM_SSL_ONLY_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   17|  1.77k|    ((ssl) == NULL ? NULL                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (17:6): [True: 0, False: 1.77k]
  |  |  |  |  ------------------
  |  |  |  |   18|  1.77k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  1.77k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:23): [True: 1.77k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   19|  1.77k|                             ? (c SSL_CONNECTION *)(ssl)     \
  |  |  |  |   20|  1.77k|                             : NULL))
  |  |  ------------------
  ------------------
 1450|  1.77k|    if (s == NULL)
  ------------------
  |  Branch (1450:9): [True: 0, False: 1.77k]
  ------------------
 1451|      0|        return;
 1452|       |
 1453|       |    /*
 1454|       |     * Ignore return values. This could result in user callbacks being called
 1455|       |     * e.g. for the QUIC TLS record layer. So we do this early before we have
 1456|       |     * freed other things.
 1457|       |     */
 1458|  1.77k|    ssl_free_wbio_buffer(s);
 1459|  1.77k|    RECORD_LAYER_clear(&s->rlayer);
 1460|       |
 1461|  1.77k|    X509_VERIFY_PARAM_free(s->param);
 1462|  1.77k|    dane_final(&s->dane);
 1463|       |
 1464|  1.77k|    BUF_MEM_free(s->init_buf);
 1465|       |
 1466|       |    /* add extra stuff */
 1467|  1.77k|    sk_SSL_CIPHER_free(s->cipher_list);
  ------------------
  |  | 1011|  1.77k|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1468|  1.77k|    sk_SSL_CIPHER_free(s->cipher_list_by_id);
  ------------------
  |  | 1011|  1.77k|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1469|  1.77k|    sk_SSL_CIPHER_free(s->tls13_ciphersuites);
  ------------------
  |  | 1011|  1.77k|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1470|  1.77k|    sk_SSL_CIPHER_free(s->peer_ciphers);
  ------------------
  |  | 1011|  1.77k|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 1471|       |
 1472|       |    /* Make the next call work :-) */
 1473|  1.77k|    if (s->session != NULL) {
  ------------------
  |  Branch (1473:9): [True: 1.76k, False: 4]
  ------------------
 1474|  1.76k|        ssl_clear_bad_session(s);
 1475|  1.76k|        SSL_SESSION_free(s->session);
 1476|  1.76k|    }
 1477|  1.77k|    SSL_SESSION_free(s->psksession);
 1478|  1.77k|    OPENSSL_free(s->psksession_id);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1479|       |
 1480|  1.77k|    ssl_cert_free(s->cert);
 1481|  1.77k|    OPENSSL_free(s->shared_sigalgs);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1482|       |    /* Free up if allocated */
 1483|       |
 1484|  1.77k|    OPENSSL_free(s->ext.hostname);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1485|  1.77k|    SSL_CTX_free(s->session_ctx);
 1486|  1.77k|    OPENSSL_free(s->ext.ecpointformats);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1487|  1.77k|    OPENSSL_free(s->ext.peer_ecpointformats);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1488|  1.77k|    OPENSSL_free(s->ext.supportedgroups);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1489|  1.77k|    OPENSSL_free(s->ext.keyshares);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1490|  1.77k|    OPENSSL_free(s->ext.tuples);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1491|  1.77k|    OPENSSL_free(s->ext.peer_supportedgroups);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1492|  1.77k|    sk_X509_EXTENSION_pop_free(s->ext.ocsp.exts, X509_EXTENSION_free);
  ------------------
  |  |  256|  1.77k|#define sk_X509_EXTENSION_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_freefunc_type(freefunc))
  ------------------
 1493|       |
 1494|  1.77k|#ifndef OPENSSL_NO_OCSP
 1495|  1.77k|    OPENSSL_free(s->ext.ocsp.resp);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1496|  1.77k|    s->ext.ocsp.resp = NULL;
 1497|  1.77k|    s->ext.ocsp.resp_len = 0;
 1498|       |
 1499|  1.77k|    sk_OCSP_RESPID_pop_free(s->ext.ocsp.ids, OCSP_RESPID_free);
  ------------------
  |  |  180|  1.77k|#define sk_OCSP_RESPID_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OCSP_RESPID_sk_type(sk), ossl_check_OCSP_RESPID_freefunc_type(freefunc))
  ------------------
 1500|  1.77k|    sk_OCSP_RESPONSE_pop_free(s->ext.ocsp.resp_ex, OCSP_RESPONSE_free);
 1501|  1.77k|    s->ext.ocsp.resp_ex = NULL;
 1502|  1.77k|#endif
 1503|  1.77k|#ifndef OPENSSL_NO_CT
 1504|  1.77k|    SCT_LIST_free(s->scts);
 1505|  1.77k|    OPENSSL_free(s->ext.scts);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1506|  1.77k|#endif
 1507|  1.77k|    OPENSSL_free(s->ext.alpn);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1508|  1.77k|    OPENSSL_free(s->ext.tls13_cookie);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1509|  1.77k|    if (s->clienthello != NULL)
  ------------------
  |  Branch (1509:9): [True: 0, False: 1.77k]
  ------------------
 1510|      0|        OPENSSL_free(s->clienthello->pre_proc_exts);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1511|  1.77k|    OPENSSL_free(s->clienthello);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1512|  1.77k|    OPENSSL_free(s->pha_context);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1513|  1.77k|    EVP_MD_CTX_free(s->pha_dgst);
 1514|       |
 1515|  1.77k|    sk_X509_NAME_pop_free(s->ca_names, X509_NAME_free);
  ------------------
  |  |   70|  1.77k|#define sk_X509_NAME_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_freefunc_type(freefunc))
  ------------------
 1516|  1.77k|    sk_X509_NAME_pop_free(s->client_ca_names, X509_NAME_free);
  ------------------
  |  |   70|  1.77k|#define sk_X509_NAME_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_freefunc_type(freefunc))
  ------------------
 1517|       |
 1518|  1.77k|    OPENSSL_free(s->client_cert_type);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1519|  1.77k|    OPENSSL_free(s->server_cert_type);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1520|       |
 1521|  1.77k|    OSSL_STACK_OF_X509_free(s->verified_chain);
 1522|       |
 1523|  1.77k|    if (ssl->method != NULL)
  ------------------
  |  Branch (1523:9): [True: 1.77k, False: 0]
  ------------------
 1524|  1.77k|        ssl->method->ssl_deinit(ssl);
 1525|       |
 1526|  1.77k|    ASYNC_WAIT_CTX_free(s->waitctx);
 1527|       |
 1528|  1.77k|#if !defined(OPENSSL_NO_NEXTPROTONEG)
 1529|  1.77k|    OPENSSL_free(s->ext.npn);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1530|  1.77k|#endif
 1531|       |
 1532|  1.77k|#ifndef OPENSSL_NO_SRTP
 1533|  1.77k|    sk_SRTP_PROTECTION_PROFILE_free(s->srtp_profiles);
  ------------------
  |  |  256|  1.77k|#define sk_SRTP_PROTECTION_PROFILE_free(sk) OPENSSL_sk_free(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk))
  ------------------
 1534|  1.77k|#endif
 1535|       |
 1536|       |    /*
 1537|       |     * We do this late. We want to ensure that any other references we held to
 1538|       |     * these BIOs are freed first *before* we call BIO_free_all(), because
 1539|       |     * BIO_free_all() will only free each BIO in the chain if the number of
 1540|       |     * references to the first BIO have dropped to 0
 1541|       |     */
 1542|  1.77k|    BIO_free_all(s->wbio);
 1543|  1.77k|    s->wbio = NULL;
 1544|  1.77k|    BIO_free_all(s->rbio);
 1545|  1.77k|    s->rbio = NULL;
 1546|  1.77k|    OPENSSL_free(s->s3.tmp.valid_flags);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1547|  1.77k|}
SSL_set0_rbio:
 1550|  1.77k|{
 1551|  1.77k|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  ------------------
  |  |   39|  1.77k|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|  1.77k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 1.77k]
  |  |  |  |  ------------------
  |  |  |  |   33|  1.77k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  1.77k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 1.77k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  1.77k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  1.77k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
 1552|       |
 1553|  1.77k|#ifndef OPENSSL_NO_QUIC
 1554|  1.77k|    if (IS_QUIC(s)) {
  ------------------
  |  |   96|  1.77k|    ((ssl) != NULL && SSL_TYPE_IS_QUIC((ssl)->type))
  |  |  ------------------
  |  |  |  | 1229|  1.77k|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1229:29): [True: 0, False: 1.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (96:6): [True: 1.77k, False: 0]
  |  |  ------------------
  ------------------
 1555|      0|        ossl_quic_conn_set0_net_rbio(s, rbio);
 1556|      0|        return;
 1557|      0|    }
 1558|  1.77k|#endif
 1559|       |
 1560|  1.77k|    if (sc == NULL)
  ------------------
  |  Branch (1560:9): [True: 0, False: 1.77k]
  ------------------
 1561|      0|        return;
 1562|       |
 1563|  1.77k|    BIO_free_all(sc->rbio);
 1564|  1.77k|    sc->rbio = rbio;
 1565|  1.77k|    sc->rlayer.rrlmethod->set1_bio(sc->rlayer.rrl, sc->rbio);
 1566|  1.77k|}
SSL_set0_wbio:
 1569|  1.77k|{
 1570|  1.77k|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  ------------------
  |  |   39|  1.77k|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|  1.77k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 1.77k]
  |  |  |  |  ------------------
  |  |  |  |   33|  1.77k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  1.77k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 1.77k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  1.77k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  1.77k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
 1571|       |
 1572|  1.77k|#ifndef OPENSSL_NO_QUIC
 1573|  1.77k|    if (IS_QUIC(s)) {
  ------------------
  |  |   96|  1.77k|    ((ssl) != NULL && SSL_TYPE_IS_QUIC((ssl)->type))
  |  |  ------------------
  |  |  |  | 1229|  1.77k|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1229:29): [True: 0, False: 1.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (96:6): [True: 1.77k, False: 0]
  |  |  ------------------
  ------------------
 1574|      0|        ossl_quic_conn_set0_net_wbio(s, wbio);
 1575|      0|        return;
 1576|      0|    }
 1577|  1.77k|#endif
 1578|       |
 1579|  1.77k|    if (sc == NULL)
  ------------------
  |  Branch (1579:9): [True: 0, False: 1.77k]
  ------------------
 1580|      0|        return;
 1581|       |
 1582|       |    /*
 1583|       |     * If the output buffering BIO is still in place, remove it
 1584|       |     */
 1585|  1.77k|    if (sc->bbio != NULL)
  ------------------
  |  Branch (1585:9): [True: 0, False: 1.77k]
  ------------------
 1586|      0|        sc->wbio = BIO_pop(sc->wbio);
 1587|       |
 1588|  1.77k|    BIO_free_all(sc->wbio);
 1589|  1.77k|    sc->wbio = wbio;
 1590|       |
 1591|       |    /* Re-attach |bbio| to the new |wbio|. */
 1592|  1.77k|    if (sc->bbio != NULL)
  ------------------
  |  Branch (1592:9): [True: 0, False: 1.77k]
  ------------------
 1593|      0|        sc->wbio = BIO_push(sc->bbio, sc->wbio);
 1594|       |
 1595|  1.77k|    sc->rlayer.wrlmethod->set1_bio(sc->rlayer.wrl, sc->wbio);
 1596|  1.77k|}
SSL_get_rbio:
 1641|    313|{
 1642|    313|    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s);
  ------------------
  |  |   41|    313|    SSL_CONNECTION_FROM_SSL_int(ssl, const)
  |  |  ------------------
  |  |  |  |   32|    313|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 313]
  |  |  |  |  ------------------
  |  |  |  |   33|    313|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|    313|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 313, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|    313|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|    313|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
 1643|       |
 1644|    313|#ifndef OPENSSL_NO_QUIC
 1645|    313|    if (IS_QUIC(s))
  ------------------
  |  |   96|    313|    ((ssl) != NULL && SSL_TYPE_IS_QUIC((ssl)->type))
  |  |  ------------------
  |  |  |  | 1229|    313|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1229:29): [True: 0, False: 313]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (96:6): [True: 313, False: 0]
  |  |  ------------------
  ------------------
 1646|      0|        return ossl_quic_conn_get_net_rbio(s);
 1647|    313|#endif
 1648|       |
 1649|    313|    if (sc == NULL)
  ------------------
  |  Branch (1649:9): [True: 0, False: 313]
  ------------------
 1650|      0|        return NULL;
 1651|       |
 1652|    313|    return sc->rbio;
 1653|    313|}
SSL_connect:
 2209|  2.07k|{
 2210|  2.07k|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  ------------------
  |  |   39|  2.07k|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|  2.07k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 2.07k]
  |  |  |  |  ------------------
  |  |  |  |   33|  2.07k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  2.07k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 2.07k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  2.07k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  2.07k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
 2211|       |
 2212|  2.07k|#ifndef OPENSSL_NO_QUIC
 2213|  2.07k|    if (IS_QUIC(s))
  ------------------
  |  |   96|  2.07k|    ((ssl) != NULL && SSL_TYPE_IS_QUIC((ssl)->type))
  |  |  ------------------
  |  |  |  | 1229|  2.07k|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1229:29): [True: 0, False: 2.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (96:6): [True: 2.07k, False: 0]
  |  |  ------------------
  ------------------
 2214|      0|        return s->method->ssl_connect(s);
 2215|  2.07k|#endif
 2216|       |
 2217|  2.07k|    if (sc == NULL)
  ------------------
  |  Branch (2217:9): [True: 0, False: 2.07k]
  ------------------
 2218|      0|        return 0;
 2219|       |
 2220|  2.07k|    if (sc->handshake_func == NULL) {
  ------------------
  |  Branch (2220:9): [True: 0, False: 2.07k]
  ------------------
 2221|       |        /* Not properly initialized yet */
 2222|      0|        SSL_set_connect_state(s);
 2223|      0|    }
 2224|       |
 2225|  2.07k|    return SSL_do_handshake(s);
 2226|  2.07k|}
SSL_ctrl:
 2944|    578|{
 2945|    578|    return ossl_ctrl_internal(s, cmd, larg, parg, /*no_quic=*/0);
 2946|    578|}
ossl_ctrl_internal:
 2949|    578|{
 2950|    578|    long l;
 2951|    578|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  ------------------
  |  |   39|    578|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|    578|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 578]
  |  |  |  |  ------------------
  |  |  |  |   33|    578|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|    578|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 578, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|    578|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|    578|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
 2952|       |
 2953|       |    /*
 2954|       |     * Routing of ctrl calls for QUIC is a little counterintuitive:
 2955|       |     *
 2956|       |     *   - Firstly (no_quic=0), we pass the ctrl directly to our QUIC
 2957|       |     *     implementation in case it wants to handle the ctrl specially.
 2958|       |     *
 2959|       |     *   - If our QUIC implementation does not care about the ctrl, it
 2960|       |     *     will reenter this function with no_quic=1 and we will try to handle
 2961|       |     *     it directly using the QCSO SSL object stub (not the handshake layer
 2962|       |     *     SSL object). This is important for e.g. the version configuration
 2963|       |     *     ctrls below, which must use s->defltmeth (and not sc->defltmeth).
 2964|       |     *
 2965|       |     *   - If we don't handle a ctrl here specially, then processing is
 2966|       |     *     redirected to the handshake layer SSL object.
 2967|       |     */
 2968|    578|    if (!no_quic && IS_QUIC(s))
  ------------------
  |  |   96|    578|    ((ssl) != NULL && SSL_TYPE_IS_QUIC((ssl)->type))
  |  |  ------------------
  |  |  |  | 1229|    578|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1229:29): [True: 0, False: 578]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (96:6): [True: 578, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2968:9): [True: 578, False: 0]
  ------------------
 2969|      0|        return s->method->ssl_ctrl(s, cmd, larg, parg);
 2970|       |
 2971|    578|    if (sc == NULL)
  ------------------
  |  Branch (2971:9): [True: 0, False: 578]
  ------------------
 2972|      0|        return 0;
 2973|       |
 2974|    578|    switch (cmd) {
 2975|      0|    case SSL_CTRL_GET_READ_AHEAD:
  ------------------
  |  | 1303|      0|#define SSL_CTRL_GET_READ_AHEAD 40
  ------------------
  |  Branch (2975:5): [True: 0, False: 578]
  ------------------
 2976|      0|        return RECORD_LAYER_get_read_ahead(&sc->rlayer);
  ------------------
  |  |  135|      0|#define RECORD_LAYER_get_read_ahead(rl) ((rl)->read_ahead)
  ------------------
 2977|      0|    case SSL_CTRL_SET_READ_AHEAD:
  ------------------
  |  | 1304|      0|#define SSL_CTRL_SET_READ_AHEAD 41
  ------------------
  |  Branch (2977:5): [True: 0, False: 578]
  ------------------
 2978|      0|        l = RECORD_LAYER_get_read_ahead(&sc->rlayer);
  ------------------
  |  |  135|      0|#define RECORD_LAYER_get_read_ahead(rl) ((rl)->read_ahead)
  ------------------
 2979|      0|        RECORD_LAYER_set_read_ahead(&sc->rlayer, larg);
  ------------------
  |  |  134|      0|#define RECORD_LAYER_set_read_ahead(rl, ra) ((rl)->read_ahead = (ra))
  ------------------
 2980|      0|        return l;
 2981|       |
 2982|      0|    case SSL_CTRL_MODE: {
  ------------------
  |  | 1302|      0|#define SSL_CTRL_MODE 33
  ------------------
  |  Branch (2982:5): [True: 0, False: 578]
  ------------------
 2983|      0|        OSSL_PARAM options[2], *opts = options;
 2984|       |
 2985|      0|        sc->mode |= larg;
 2986|       |
 2987|      0|        *opts++ = OSSL_PARAM_construct_uint32(OSSL_LIBSSL_RECORD_LAYER_PARAM_MODE,
  ------------------
  |  |  331|      0|# define OSSL_LIBSSL_RECORD_LAYER_PARAM_MODE "mode"
  ------------------
 2988|      0|            &sc->mode);
 2989|      0|        *opts = OSSL_PARAM_construct_end();
 2990|       |
 2991|       |        /* Ignore return value */
 2992|      0|        sc->rlayer.rrlmethod->set_options(sc->rlayer.rrl, options);
 2993|       |
 2994|      0|        return sc->mode;
 2995|      0|    }
 2996|      0|    case SSL_CTRL_CLEAR_MODE:
  ------------------
  |  | 1345|      0|#define SSL_CTRL_CLEAR_MODE 78
  ------------------
  |  Branch (2996:5): [True: 0, False: 578]
  ------------------
 2997|      0|        return (sc->mode &= ~larg);
 2998|      0|    case SSL_CTRL_GET_MAX_CERT_LIST:
  ------------------
  |  | 1309|      0|#define SSL_CTRL_GET_MAX_CERT_LIST 50
  ------------------
  |  Branch (2998:5): [True: 0, False: 578]
  ------------------
 2999|      0|        return (long)sc->max_cert_list;
 3000|      0|    case SSL_CTRL_SET_MAX_CERT_LIST:
  ------------------
  |  | 1310|      0|#define SSL_CTRL_SET_MAX_CERT_LIST 51
  ------------------
  |  Branch (3000:5): [True: 0, False: 578]
  ------------------
 3001|      0|        if (larg < 0)
  ------------------
  |  Branch (3001:13): [True: 0, False: 0]
  ------------------
 3002|      0|            return 0;
 3003|      0|        l = (long)sc->max_cert_list;
 3004|      0|        sc->max_cert_list = (size_t)larg;
 3005|      0|        return l;
 3006|      0|    case SSL_CTRL_SET_MAX_SEND_FRAGMENT:
  ------------------
  |  | 1311|      0|#define SSL_CTRL_SET_MAX_SEND_FRAGMENT 52
  ------------------
  |  Branch (3006:5): [True: 0, False: 578]
  ------------------
 3007|      0|        if (larg < 512 || larg > SSL3_RT_MAX_PLAIN_LENGTH)
  ------------------
  |  |  177|      0|#define SSL3_RT_MAX_PLAIN_LENGTH 16384
  ------------------
  |  Branch (3007:13): [True: 0, False: 0]
  |  Branch (3007:27): [True: 0, False: 0]
  ------------------
 3008|      0|            return 0;
 3009|       |#ifndef OPENSSL_NO_KTLS
 3010|       |        if (sc->wbio != NULL && BIO_get_ktls_send(sc->wbio))
 3011|       |            return 0;
 3012|       |#endif /* OPENSSL_NO_KTLS */
 3013|      0|        sc->max_send_fragment = larg;
 3014|      0|        if (sc->max_send_fragment < sc->split_send_fragment)
  ------------------
  |  Branch (3014:13): [True: 0, False: 0]
  ------------------
 3015|      0|            sc->split_send_fragment = sc->max_send_fragment;
 3016|      0|        sc->rlayer.wrlmethod->set_max_frag_len(sc->rlayer.wrl, larg);
 3017|      0|        return 1;
 3018|      0|    case SSL_CTRL_SET_SPLIT_SEND_FRAGMENT:
  ------------------
  |  | 1379|      0|#define SSL_CTRL_SET_SPLIT_SEND_FRAGMENT 125
  ------------------
  |  Branch (3018:5): [True: 0, False: 578]
  ------------------
 3019|      0|        if ((size_t)larg > sc->max_send_fragment || larg == 0)
  ------------------
  |  Branch (3019:13): [True: 0, False: 0]
  |  Branch (3019:53): [True: 0, False: 0]
  ------------------
 3020|      0|            return 0;
 3021|      0|        sc->split_send_fragment = larg;
 3022|      0|        return 1;
 3023|      0|    case SSL_CTRL_SET_MAX_PIPELINES:
  ------------------
  |  | 1380|      0|#define SSL_CTRL_SET_MAX_PIPELINES 126
  ------------------
  |  Branch (3023:5): [True: 0, False: 578]
  ------------------
 3024|      0|        if (larg < 1 || larg > SSL_MAX_PIPELINES)
  ------------------
  |  |   71|      0|#define SSL_MAX_PIPELINES 32
  ------------------
  |  Branch (3024:13): [True: 0, False: 0]
  |  Branch (3024:25): [True: 0, False: 0]
  ------------------
 3025|      0|            return 0;
 3026|      0|        sc->max_pipelines = larg;
 3027|      0|        if (sc->rlayer.rrlmethod->set_max_pipelines != NULL)
  ------------------
  |  Branch (3027:13): [True: 0, False: 0]
  ------------------
 3028|      0|            sc->rlayer.rrlmethod->set_max_pipelines(sc->rlayer.rrl, (size_t)larg);
 3029|      0|        return 1;
 3030|      0|    case SSL_CTRL_GET_RI_SUPPORT:
  ------------------
  |  | 1344|      0|#define SSL_CTRL_GET_RI_SUPPORT 76
  ------------------
  |  Branch (3030:5): [True: 0, False: 578]
  ------------------
 3031|      0|        return sc->s3.send_connection_binding;
 3032|      0|    case SSL_CTRL_SET_RETRY_VERIFY:
  ------------------
  |  | 1390|      0|#define SSL_CTRL_SET_RETRY_VERIFY 136
  ------------------
  |  Branch (3032:5): [True: 0, False: 578]
  ------------------
 3033|      0|        sc->rwstate = SSL_RETRY_VERIFY;
  ------------------
  |  |  939|      0|#define SSL_RETRY_VERIFY 8
  ------------------
 3034|      0|        return 1;
 3035|      0|    case SSL_CTRL_CERT_FLAGS:
  ------------------
  |  | 1357|      0|#define SSL_CTRL_CERT_FLAGS 99
  ------------------
  |  Branch (3035:5): [True: 0, False: 578]
  ------------------
 3036|      0|        return (sc->cert->cert_flags |= larg);
 3037|      0|    case SSL_CTRL_CLEAR_CERT_FLAGS:
  ------------------
  |  | 1358|      0|#define SSL_CTRL_CLEAR_CERT_FLAGS 100
  ------------------
  |  Branch (3037:5): [True: 0, False: 578]
  ------------------
 3038|      0|        return (sc->cert->cert_flags &= ~larg);
 3039|       |
 3040|      0|    case SSL_CTRL_GET_RAW_CIPHERLIST:
  ------------------
  |  | 1368|      0|#define SSL_CTRL_GET_RAW_CIPHERLIST 110
  ------------------
  |  Branch (3040:5): [True: 0, False: 578]
  ------------------
 3041|      0|        if (parg) {
  ------------------
  |  Branch (3041:13): [True: 0, False: 0]
  ------------------
 3042|      0|            if (sc->s3.tmp.ciphers_raw == NULL)
  ------------------
  |  Branch (3042:17): [True: 0, False: 0]
  ------------------
 3043|      0|                return 0;
 3044|      0|            *(unsigned char **)parg = sc->s3.tmp.ciphers_raw;
 3045|      0|            return (int)sc->s3.tmp.ciphers_rawlen;
 3046|      0|        } else {
 3047|      0|            return TLS_CIPHER_LEN;
  ------------------
  |  |  379|      0|#define TLS_CIPHER_LEN 2
  ------------------
 3048|      0|        }
 3049|      0|    case SSL_CTRL_GET_EXTMS_SUPPORT:
  ------------------
  |  | 1376|      0|#define SSL_CTRL_GET_EXTMS_SUPPORT 122
  ------------------
  |  Branch (3049:5): [True: 0, False: 578]
  ------------------
 3050|      0|        if (!sc->session || SSL_in_init(s) || ossl_statem_get_in_handshake(sc))
  ------------------
  |  Branch (3050:13): [True: 0, False: 0]
  |  Branch (3050:29): [True: 0, False: 0]
  |  Branch (3050:47): [True: 0, False: 0]
  ------------------
 3051|      0|            return -1;
 3052|      0|        if (sc->session->flags & SSL_SESS_FLAG_EXTMS)
  ------------------
  |  |  567|      0|#define SSL_SESS_FLAG_EXTMS 0x1
  ------------------
  |  Branch (3052:13): [True: 0, False: 0]
  ------------------
 3053|      0|            return 1;
 3054|      0|        else
 3055|      0|            return 0;
 3056|      0|    case SSL_CTRL_SET_MIN_PROTO_VERSION:
  ------------------
  |  | 1377|      0|#define SSL_CTRL_SET_MIN_PROTO_VERSION 123
  ------------------
  |  Branch (3056:5): [True: 0, False: 578]
  ------------------
 3057|      0|        return ssl_check_allowed_versions(larg, sc->max_proto_version)
  ------------------
  |  Branch (3057:16): [True: 0, False: 0]
  ------------------
 3058|      0|            && ssl_set_version_bound(s->defltmeth->version, (int)larg,
  ------------------
  |  Branch (3058:16): [True: 0, False: 0]
  ------------------
 3059|      0|                &sc->min_proto_version);
 3060|      0|    case SSL_CTRL_GET_MIN_PROTO_VERSION:
  ------------------
  |  | 1384|      0|#define SSL_CTRL_GET_MIN_PROTO_VERSION 130
  ------------------
  |  Branch (3060:5): [True: 0, False: 578]
  ------------------
 3061|      0|        return sc->min_proto_version;
 3062|      0|    case SSL_CTRL_SET_MAX_PROTO_VERSION:
  ------------------
  |  | 1378|      0|#define SSL_CTRL_SET_MAX_PROTO_VERSION 124
  ------------------
  |  Branch (3062:5): [True: 0, False: 578]
  ------------------
 3063|      0|        return ssl_check_allowed_versions(sc->min_proto_version, larg)
  ------------------
  |  Branch (3063:16): [True: 0, False: 0]
  ------------------
 3064|      0|            && ssl_set_version_bound(s->defltmeth->version, (int)larg,
  ------------------
  |  Branch (3064:16): [True: 0, False: 0]
  ------------------
 3065|      0|                &sc->max_proto_version);
 3066|      0|    case SSL_CTRL_GET_MAX_PROTO_VERSION:
  ------------------
  |  | 1385|      0|#define SSL_CTRL_GET_MAX_PROTO_VERSION 131
  ------------------
  |  Branch (3066:5): [True: 0, False: 578]
  ------------------
 3067|      0|        return sc->max_proto_version;
 3068|    578|    default:
  ------------------
  |  Branch (3068:5): [True: 578, False: 0]
  ------------------
 3069|    578|        if (IS_QUIC(s))
  ------------------
  |  |   96|    578|    ((ssl) != NULL && SSL_TYPE_IS_QUIC((ssl)->type))
  |  |  ------------------
  |  |  |  | 1229|    578|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1229:29): [True: 0, False: 578]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (96:6): [True: 578, False: 0]
  |  |  ------------------
  ------------------
 3070|      0|            return SSL_ctrl((SSL *)sc, cmd, larg, parg);
 3071|    578|        else
 3072|    578|            return s->method->ssl_ctrl(s, cmd, larg, parg);
 3073|    578|    }
 3074|    578|}
SSL_CTX_ctrl:
 3098|  14.6k|{
 3099|  14.6k|    long l;
 3100|       |
 3101|       |    /* For some cases with ctx == NULL or larg == 1 perform syntax checks */
 3102|  14.6k|    if (cmd == SSL_CTRL_SET_GROUPS_LIST && larg == 1)
  ------------------
  |  | 1353|  29.3k|#define SSL_CTRL_SET_GROUPS_LIST 92
  ------------------
  |  Branch (3102:9): [True: 2.98k, False: 11.6k]
  |  Branch (3102:44): [True: 0, False: 2.98k]
  ------------------
 3103|      0|        return tls1_set_groups_list(ctx, NULL, NULL, NULL, NULL, NULL, NULL, parg);
 3104|  14.6k|    if (ctx == NULL) {
  ------------------
  |  Branch (3104:9): [True: 0, False: 14.6k]
  ------------------
 3105|      0|        switch (cmd) {
 3106|      0|        case SSL_CTRL_SET_SIGALGS_LIST:
  ------------------
  |  | 1356|      0|#define SSL_CTRL_SET_SIGALGS_LIST 98
  ------------------
  |  Branch (3106:9): [True: 0, False: 0]
  ------------------
 3107|      0|        case SSL_CTRL_SET_CLIENT_SIGALGS_LIST:
  ------------------
  |  | 1360|      0|#define SSL_CTRL_SET_CLIENT_SIGALGS_LIST 102
  ------------------
  |  Branch (3107:9): [True: 0, False: 0]
  ------------------
 3108|      0|            return tls1_set_sigalgs_list(ctx, NULL, parg, 0);
 3109|      0|        default:
  ------------------
  |  Branch (3109:9): [True: 0, False: 0]
  ------------------
 3110|      0|            return 0;
 3111|      0|        }
 3112|      0|    }
 3113|       |
 3114|  14.6k|    switch (cmd) {
 3115|      0|    case SSL_CTRL_GET_READ_AHEAD:
  ------------------
  |  | 1303|      0|#define SSL_CTRL_GET_READ_AHEAD 40
  ------------------
  |  Branch (3115:5): [True: 0, False: 14.6k]
  ------------------
 3116|      0|        return ctx->read_ahead;
 3117|  2.47k|    case SSL_CTRL_SET_READ_AHEAD:
  ------------------
  |  | 1304|  2.47k|#define SSL_CTRL_SET_READ_AHEAD 41
  ------------------
  |  Branch (3117:5): [True: 2.47k, False: 12.1k]
  ------------------
 3118|  2.47k|        l = ctx->read_ahead;
 3119|  2.47k|        ctx->read_ahead = larg;
 3120|  2.47k|        return l;
 3121|       |
 3122|      0|    case SSL_CTRL_SET_MSG_CALLBACK_ARG:
  ------------------
  |  | 1286|      0|#define SSL_CTRL_SET_MSG_CALLBACK_ARG 16
  ------------------
  |  Branch (3122:5): [True: 0, False: 14.6k]
  ------------------
 3123|      0|        ctx->msg_callback_arg = parg;
 3124|      0|        return 1;
 3125|       |
 3126|      0|    case SSL_CTRL_GET_MAX_CERT_LIST:
  ------------------
  |  | 1309|      0|#define SSL_CTRL_GET_MAX_CERT_LIST 50
  ------------------
  |  Branch (3126:5): [True: 0, False: 14.6k]
  ------------------
 3127|      0|        return (long)ctx->max_cert_list;
 3128|      0|    case SSL_CTRL_SET_MAX_CERT_LIST:
  ------------------
  |  | 1310|      0|#define SSL_CTRL_SET_MAX_CERT_LIST 51
  ------------------
  |  Branch (3128:5): [True: 0, False: 14.6k]
  ------------------
 3129|      0|        if (larg < 0)
  ------------------
  |  Branch (3129:13): [True: 0, False: 0]
  ------------------
 3130|      0|            return 0;
 3131|      0|        l = (long)ctx->max_cert_list;
 3132|      0|        ctx->max_cert_list = (size_t)larg;
 3133|      0|        return l;
 3134|       |
 3135|      0|    case SSL_CTRL_SET_SESS_CACHE_SIZE:
  ------------------
  |  | 1305|      0|#define SSL_CTRL_SET_SESS_CACHE_SIZE 42
  ------------------
  |  Branch (3135:5): [True: 0, False: 14.6k]
  ------------------
 3136|      0|        if (larg < 0)
  ------------------
  |  Branch (3136:13): [True: 0, False: 0]
  ------------------
 3137|      0|            return 0;
 3138|      0|        l = (long)ctx->session_cache_size;
 3139|      0|        ctx->session_cache_size = (size_t)larg;
 3140|      0|        return l;
 3141|      0|    case SSL_CTRL_GET_SESS_CACHE_SIZE:
  ------------------
  |  | 1306|      0|#define SSL_CTRL_GET_SESS_CACHE_SIZE 43
  ------------------
  |  Branch (3141:5): [True: 0, False: 14.6k]
  ------------------
 3142|      0|        return (long)ctx->session_cache_size;
 3143|  1.77k|    case SSL_CTRL_SET_SESS_CACHE_MODE:
  ------------------
  |  | 1307|  1.77k|#define SSL_CTRL_SET_SESS_CACHE_MODE 44
  ------------------
  |  Branch (3143:5): [True: 1.77k, False: 12.9k]
  ------------------
 3144|  1.77k|        l = ctx->session_cache_mode;
 3145|  1.77k|        ctx->session_cache_mode = larg;
 3146|  1.77k|        return l;
 3147|      0|    case SSL_CTRL_GET_SESS_CACHE_MODE:
  ------------------
  |  | 1308|      0|#define SSL_CTRL_GET_SESS_CACHE_MODE 45
  ------------------
  |  Branch (3147:5): [True: 0, False: 14.6k]
  ------------------
 3148|      0|        return ctx->session_cache_mode;
 3149|       |
 3150|      0|    case SSL_CTRL_SESS_NUMBER:
  ------------------
  |  | 1290|      0|#define SSL_CTRL_SESS_NUMBER 20
  ------------------
  |  Branch (3150:5): [True: 0, False: 14.6k]
  ------------------
 3151|      0|        return lh_SSL_SESSION_num_items(ctx->sessions);
 3152|      0|    case SSL_CTRL_SESS_CONNECT:
  ------------------
  |  | 1291|      0|#define SSL_CTRL_SESS_CONNECT 21
  ------------------
  |  Branch (3152:5): [True: 0, False: 14.6k]
  ------------------
 3153|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_connect);
 3154|      0|    case SSL_CTRL_SESS_CONNECT_GOOD:
  ------------------
  |  | 1292|      0|#define SSL_CTRL_SESS_CONNECT_GOOD 22
  ------------------
  |  Branch (3154:5): [True: 0, False: 14.6k]
  ------------------
 3155|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_connect_good);
 3156|      0|    case SSL_CTRL_SESS_CONNECT_RENEGOTIATE:
  ------------------
  |  | 1293|      0|#define SSL_CTRL_SESS_CONNECT_RENEGOTIATE 23
  ------------------
  |  Branch (3156:5): [True: 0, False: 14.6k]
  ------------------
 3157|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_connect_renegotiate);
 3158|      0|    case SSL_CTRL_SESS_ACCEPT:
  ------------------
  |  | 1294|      0|#define SSL_CTRL_SESS_ACCEPT 24
  ------------------
  |  Branch (3158:5): [True: 0, False: 14.6k]
  ------------------
 3159|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_accept);
 3160|      0|    case SSL_CTRL_SESS_ACCEPT_GOOD:
  ------------------
  |  | 1295|      0|#define SSL_CTRL_SESS_ACCEPT_GOOD 25
  ------------------
  |  Branch (3160:5): [True: 0, False: 14.6k]
  ------------------
 3161|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_accept_good);
 3162|      0|    case SSL_CTRL_SESS_ACCEPT_RENEGOTIATE:
  ------------------
  |  | 1296|      0|#define SSL_CTRL_SESS_ACCEPT_RENEGOTIATE 26
  ------------------
  |  Branch (3162:5): [True: 0, False: 14.6k]
  ------------------
 3163|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_accept_renegotiate);
 3164|      0|    case SSL_CTRL_SESS_HIT:
  ------------------
  |  | 1297|      0|#define SSL_CTRL_SESS_HIT 27
  ------------------
  |  Branch (3164:5): [True: 0, False: 14.6k]
  ------------------
 3165|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_hit);
 3166|      0|    case SSL_CTRL_SESS_CB_HIT:
  ------------------
  |  | 1298|      0|#define SSL_CTRL_SESS_CB_HIT 28
  ------------------
  |  Branch (3166:5): [True: 0, False: 14.6k]
  ------------------
 3167|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_cb_hit);
 3168|      0|    case SSL_CTRL_SESS_MISSES:
  ------------------
  |  | 1299|      0|#define SSL_CTRL_SESS_MISSES 29
  ------------------
  |  Branch (3168:5): [True: 0, False: 14.6k]
  ------------------
 3169|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_miss);
 3170|      0|    case SSL_CTRL_SESS_TIMEOUTS:
  ------------------
  |  | 1300|      0|#define SSL_CTRL_SESS_TIMEOUTS 30
  ------------------
  |  Branch (3170:5): [True: 0, False: 14.6k]
  ------------------
 3171|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_timeout);
 3172|      0|    case SSL_CTRL_SESS_CACHE_FULL:
  ------------------
  |  | 1301|      0|#define SSL_CTRL_SESS_CACHE_FULL 31
  ------------------
  |  Branch (3172:5): [True: 0, False: 14.6k]
  ------------------
 3173|      0|        return ssl_tsan_load(ctx, &ctx->stats.sess_cache_full);
 3174|  2.47k|    case SSL_CTRL_MODE:
  ------------------
  |  | 1302|  2.47k|#define SSL_CTRL_MODE 33
  ------------------
  |  Branch (3174:5): [True: 2.47k, False: 12.1k]
  ------------------
 3175|  2.47k|        return (ctx->mode |= larg);
 3176|      0|    case SSL_CTRL_CLEAR_MODE:
  ------------------
  |  | 1345|      0|#define SSL_CTRL_CLEAR_MODE 78
  ------------------
  |  Branch (3176:5): [True: 0, False: 14.6k]
  ------------------
 3177|      0|        return (ctx->mode &= ~larg);
 3178|      0|    case SSL_CTRL_SET_MAX_SEND_FRAGMENT:
  ------------------
  |  | 1311|      0|#define SSL_CTRL_SET_MAX_SEND_FRAGMENT 52
  ------------------
  |  Branch (3178:5): [True: 0, False: 14.6k]
  ------------------
 3179|      0|        if (larg < 512 || larg > SSL3_RT_MAX_PLAIN_LENGTH)
  ------------------
  |  |  177|      0|#define SSL3_RT_MAX_PLAIN_LENGTH 16384
  ------------------
  |  Branch (3179:13): [True: 0, False: 0]
  |  Branch (3179:27): [True: 0, False: 0]
  ------------------
 3180|      0|            return 0;
 3181|      0|        ctx->max_send_fragment = larg;
 3182|      0|        if (ctx->max_send_fragment < ctx->split_send_fragment)
  ------------------
  |  Branch (3182:13): [True: 0, False: 0]
  ------------------
 3183|      0|            ctx->split_send_fragment = ctx->max_send_fragment;
 3184|      0|        return 1;
 3185|      0|    case SSL_CTRL_SET_SPLIT_SEND_FRAGMENT:
  ------------------
  |  | 1379|      0|#define SSL_CTRL_SET_SPLIT_SEND_FRAGMENT 125
  ------------------
  |  Branch (3185:5): [True: 0, False: 14.6k]
  ------------------
 3186|      0|        if ((size_t)larg > ctx->max_send_fragment || larg == 0)
  ------------------
  |  Branch (3186:13): [True: 0, False: 0]
  |  Branch (3186:54): [True: 0, False: 0]
  ------------------
 3187|      0|            return 0;
 3188|      0|        ctx->split_send_fragment = larg;
 3189|      0|        return 1;
 3190|      0|    case SSL_CTRL_SET_MAX_PIPELINES:
  ------------------
  |  | 1380|      0|#define SSL_CTRL_SET_MAX_PIPELINES 126
  ------------------
  |  Branch (3190:5): [True: 0, False: 14.6k]
  ------------------
 3191|      0|        if (larg < 1 || larg > SSL_MAX_PIPELINES)
  ------------------
  |  |   71|      0|#define SSL_MAX_PIPELINES 32
  ------------------
  |  Branch (3191:13): [True: 0, False: 0]
  |  Branch (3191:25): [True: 0, False: 0]
  ------------------
 3192|      0|            return 0;
 3193|      0|        ctx->max_pipelines = larg;
 3194|      0|        return 1;
 3195|      0|    case SSL_CTRL_CERT_FLAGS:
  ------------------
  |  | 1357|      0|#define SSL_CTRL_CERT_FLAGS 99
  ------------------
  |  Branch (3195:5): [True: 0, False: 14.6k]
  ------------------
 3196|      0|        return (ctx->cert->cert_flags |= larg);
 3197|      0|    case SSL_CTRL_CLEAR_CERT_FLAGS:
  ------------------
  |  | 1358|      0|#define SSL_CTRL_CLEAR_CERT_FLAGS 100
  ------------------
  |  Branch (3197:5): [True: 0, False: 14.6k]
  ------------------
 3198|      0|        return (ctx->cert->cert_flags &= ~larg);
 3199|  2.47k|    case SSL_CTRL_SET_MIN_PROTO_VERSION:
  ------------------
  |  | 1377|  2.47k|#define SSL_CTRL_SET_MIN_PROTO_VERSION 123
  ------------------
  |  Branch (3199:5): [True: 2.47k, False: 12.1k]
  ------------------
 3200|  2.47k|        return ssl_check_allowed_versions(larg, ctx->max_proto_version)
  ------------------
  |  Branch (3200:16): [True: 2.47k, False: 0]
  ------------------
 3201|  2.47k|            && ssl_set_version_bound(ctx->method->version, (int)larg,
  ------------------
  |  Branch (3201:16): [True: 2.47k, False: 0]
  ------------------
 3202|  2.47k|                &ctx->min_proto_version);
 3203|      0|    case SSL_CTRL_GET_MIN_PROTO_VERSION:
  ------------------
  |  | 1384|      0|#define SSL_CTRL_GET_MIN_PROTO_VERSION 130
  ------------------
  |  Branch (3203:5): [True: 0, False: 14.6k]
  ------------------
 3204|      0|        return ctx->min_proto_version;
 3205|  2.47k|    case SSL_CTRL_SET_MAX_PROTO_VERSION:
  ------------------
  |  | 1378|  2.47k|#define SSL_CTRL_SET_MAX_PROTO_VERSION 124
  ------------------
  |  Branch (3205:5): [True: 2.47k, False: 12.1k]
  ------------------
 3206|  2.47k|        return ssl_check_allowed_versions(ctx->min_proto_version, larg)
  ------------------
  |  Branch (3206:16): [True: 2.47k, False: 0]
  ------------------
 3207|  2.47k|            && ssl_set_version_bound(ctx->method->version, (int)larg,
  ------------------
  |  Branch (3207:16): [True: 2.47k, False: 0]
  ------------------
 3208|  2.47k|                &ctx->max_proto_version);
 3209|      0|    case SSL_CTRL_GET_MAX_PROTO_VERSION:
  ------------------
  |  | 1385|      0|#define SSL_CTRL_GET_MAX_PROTO_VERSION 131
  ------------------
  |  Branch (3209:5): [True: 0, False: 14.6k]
  ------------------
 3210|      0|        return ctx->max_proto_version;
 3211|  2.98k|    default:
  ------------------
  |  Branch (3211:5): [True: 2.98k, False: 11.6k]
  ------------------
 3212|  2.98k|        return ctx->method->ssl_ctx_ctrl(ctx, cmd, larg, parg);
 3213|  14.6k|    }
 3214|  14.6k|}
ssl_cipher_id_cmp:
 3231|    411|{
 3232|    411|    if (a->id > b->id)
  ------------------
  |  Branch (3232:9): [True: 152, False: 259]
  ------------------
 3233|    152|        return 1;
 3234|    259|    if (a->id < b->id)
  ------------------
  |  Branch (3234:9): [True: 232, False: 27]
  ------------------
 3235|    232|        return -1;
 3236|     27|    return 0;
 3237|    259|}
ssl_cipher_ptr_id_cmp:
 3241|   744k|{
 3242|   744k|    if ((*ap)->id > (*bp)->id)
  ------------------
  |  Branch (3242:9): [True: 417k, False: 326k]
  ------------------
 3243|   417k|        return 1;
 3244|   326k|    if ((*ap)->id < (*bp)->id)
  ------------------
  |  Branch (3244:9): [True: 326k, False: 129]
  ------------------
 3245|   326k|        return -1;
 3246|    129|    return 0;
 3247|   326k|}
SSL_get_ciphers:
 3254|  5.16k|{
 3255|  5.16k|    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s);
  ------------------
  |  |   41|  5.16k|    SSL_CONNECTION_FROM_SSL_int(ssl, const)
  |  |  ------------------
  |  |  |  |   32|  5.16k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 5.16k]
  |  |  |  |  ------------------
  |  |  |  |   33|  5.16k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  5.16k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 5.16k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  5.16k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  5.16k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
 3256|       |
 3257|  5.16k|    if (sc != NULL) {
  ------------------
  |  Branch (3257:9): [True: 5.16k, False: 0]
  ------------------
 3258|  5.16k|        if (sc->cipher_list != NULL) {
  ------------------
  |  Branch (3258:13): [True: 0, False: 5.16k]
  ------------------
 3259|      0|            return sc->cipher_list;
 3260|  5.16k|        } else if ((s->ctx != NULL) && (s->ctx->cipher_list != NULL)) {
  ------------------
  |  Branch (3260:20): [True: 5.16k, False: 0]
  |  Branch (3260:40): [True: 5.16k, False: 0]
  ------------------
 3261|  5.16k|            return s->ctx->cipher_list;
 3262|  5.16k|        }
 3263|  5.16k|    }
 3264|      0|    return NULL;
 3265|  5.16k|}
SSL_get1_supported_ciphers:
 3277|  3.39k|{
 3278|  3.39k|    STACK_OF(SSL_CIPHER) *sk = NULL, *ciphers;
  ------------------
  |  |   33|  3.39k|#define STACK_OF(type) struct stack_st_##type
  ------------------
 3279|  3.39k|    int i;
 3280|  3.39k|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  ------------------
  |  |   39|  3.39k|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|  3.39k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 3.39k]
  |  |  |  |  ------------------
  |  |  |  |   33|  3.39k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  3.39k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 3.39k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  3.39k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  3.39k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
 3281|       |
 3282|  3.39k|    if (sc == NULL)
  ------------------
  |  Branch (3282:9): [True: 0, False: 3.39k]
  ------------------
 3283|      0|        return NULL;
 3284|       |
 3285|  3.39k|    ciphers = SSL_get_ciphers(s);
 3286|  3.39k|    if (!ciphers)
  ------------------
  |  Branch (3286:9): [True: 0, False: 3.39k]
  ------------------
 3287|      0|        return NULL;
 3288|  3.39k|    if (!ssl_set_client_disabled(sc))
  ------------------
  |  Branch (3288:9): [True: 0, False: 3.39k]
  ------------------
 3289|      0|        return NULL;
 3290|   208k|    for (i = 0; i < sk_SSL_CIPHER_num(ciphers); i++) {
  ------------------
  |  | 1005|   208k|#define sk_SSL_CIPHER_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_CIPHER_sk_type(sk))
  ------------------
  |  Branch (3290:17): [True: 204k, False: 3.39k]
  ------------------
 3291|   204k|        const SSL_CIPHER *c = sk_SSL_CIPHER_value(ciphers, i);
  ------------------
  |  | 1006|   204k|#define sk_SSL_CIPHER_value(sk, idx) ((const SSL_CIPHER *)OPENSSL_sk_value(ossl_check_const_SSL_CIPHER_sk_type(sk), (idx)))
  ------------------
 3292|   204k|        if (!ssl_cipher_disabled(sc, c, SSL_SECOP_CIPHER_SUPPORTED, 0)) {
  ------------------
  |  | 2752|   204k|#define SSL_SECOP_CIPHER_SUPPORTED (1 | SSL_SECOP_OTHER_CIPHER)
  |  |  ------------------
  |  |  |  | 2738|   204k|#define SSL_SECOP_OTHER_CIPHER (1 << 16)
  |  |  ------------------
  ------------------
  |  Branch (3292:13): [True: 101k, False: 103k]
  ------------------
 3293|   101k|            if (!sk)
  ------------------
  |  Branch (3293:17): [True: 3.39k, False: 98.0k]
  ------------------
 3294|  3.39k|                sk = sk_SSL_CIPHER_new_null();
  ------------------
  |  | 1008|  3.39k|#define sk_SSL_CIPHER_new_null() ((STACK_OF(SSL_CIPHER) *)OPENSSL_sk_new_null())
  ------------------
 3295|   101k|            if (!sk)
  ------------------
  |  Branch (3295:17): [True: 0, False: 101k]
  ------------------
 3296|      0|                return NULL;
 3297|   101k|            if (!sk_SSL_CIPHER_push(sk, c)) {
  ------------------
  |  | 1015|   101k|#define sk_SSL_CIPHER_push(sk, ptr) OPENSSL_sk_push(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr))
  ------------------
  |  Branch (3297:17): [True: 0, False: 101k]
  ------------------
 3298|      0|                sk_SSL_CIPHER_free(sk);
  ------------------
  |  | 1011|      0|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 3299|      0|                return NULL;
 3300|      0|            }
 3301|   101k|        }
 3302|   204k|    }
 3303|  3.39k|    return sk;
 3304|  3.39k|}
ssl_get_ciphers_by_id:
 3309|     20|{
 3310|     20|    if (s != NULL) {
  ------------------
  |  Branch (3310:9): [True: 20, False: 0]
  ------------------
 3311|     20|        if (s->cipher_list_by_id != NULL)
  ------------------
  |  Branch (3311:13): [True: 0, False: 20]
  ------------------
 3312|      0|            return s->cipher_list_by_id;
 3313|     20|        else if (s->ssl.ctx != NULL
  ------------------
  |  Branch (3313:18): [True: 20, False: 0]
  ------------------
 3314|     20|            && s->ssl.ctx->cipher_list_by_id != NULL)
  ------------------
  |  Branch (3314:16): [True: 20, False: 0]
  ------------------
 3315|     20|            return s->ssl.ctx->cipher_list_by_id;
 3316|     20|    }
 3317|      0|    return NULL;
 3318|     20|}
SSL_CTX_set_cipher_list:
 3368|    784|{
 3369|    784|    STACK_OF(SSL_CIPHER) *sk;
  ------------------
  |  |   33|    784|#define STACK_OF(type) struct stack_st_##type
  ------------------
 3370|       |
 3371|    784|    sk = ssl_create_cipher_list(ctx, ctx->tls13_ciphersuites,
 3372|    784|        &ctx->cipher_list, &ctx->cipher_list_by_id, str,
 3373|    784|        ctx->cert);
 3374|       |    /*
 3375|       |     * ssl_create_cipher_list may return an empty stack if it was unable to
 3376|       |     * find a cipher matching the given rule string (for example if the rule
 3377|       |     * string specifies a cipher which has been disabled). This is not an
 3378|       |     * error as far as ssl_create_cipher_list is concerned, and hence
 3379|       |     * ctx->cipher_list and ctx->cipher_list_by_id has been updated.
 3380|       |     */
 3381|    784|    if (sk == NULL)
  ------------------
  |  Branch (3381:9): [True: 255, False: 529]
  ------------------
 3382|    255|        return 0;
 3383|    529|    if (ctx->method->num_ciphers() > 0 && cipher_list_tls12_num(sk) == 0) {
  ------------------
  |  Branch (3383:9): [True: 529, False: 0]
  |  Branch (3383:43): [True: 295, False: 234]
  ------------------
 3384|    295|        ERR_raise(ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH);
  ------------------
  |  |  404|    295|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|    295|    (ERR_new(),                                                  \
  |  |  |  |  407|    295|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|    295|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|    295|        ERR_set_error)
  |  |  ------------------
  ------------------
 3385|    295|        return 0;
 3386|    295|    }
 3387|    234|    return 1;
 3388|    529|}
SSL_set_alpn_protos:
 3752|    415|{
 3753|    415|    unsigned char *alpn;
 3754|    415|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl);
  ------------------
  |  |   39|    415|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|    415|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 415]
  |  |  |  |  ------------------
  |  |  |  |   33|    415|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|    415|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 415, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|    415|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|    415|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
 3755|       |
 3756|    415|    if (sc == NULL)
  ------------------
  |  Branch (3756:9): [True: 0, False: 415]
  ------------------
 3757|      0|        return 1;
 3758|       |
 3759|    415|    if (protos_len == 0 || protos == NULL) {
  ------------------
  |  Branch (3759:9): [True: 0, False: 415]
  |  Branch (3759:28): [True: 0, False: 415]
  ------------------
 3760|      0|        OPENSSL_free(sc->ext.alpn);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3761|      0|        sc->ext.alpn = NULL;
 3762|      0|        sc->ext.alpn_len = 0;
 3763|      0|        return 0;
 3764|      0|    }
 3765|       |    /* Not valid per RFC */
 3766|    415|    if (!alpn_value_ok(protos, protos_len))
  ------------------
  |  Branch (3766:9): [True: 0, False: 415]
  ------------------
 3767|      0|        return 1;
 3768|       |
 3769|    415|    alpn = OPENSSL_memdup(protos, protos_len);
  ------------------
  |  |  133|    415|    CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3770|    415|    if (alpn == NULL)
  ------------------
  |  Branch (3770:9): [True: 0, False: 415]
  ------------------
 3771|      0|        return 1;
 3772|    415|    OPENSSL_free(sc->ext.alpn);
  ------------------
  |  |  131|    415|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 3773|    415|    sc->ext.alpn = alpn;
 3774|    415|    sc->ext.alpn_len = protos_len;
 3775|       |
 3776|    415|    return 0;
 3777|    415|}
SSL_CTX_new_ex:
 3991|  2.56k|{
 3992|  2.56k|    SSL_CTX *ret = NULL;
 3993|       |#ifndef OPENSSL_NO_SSLKEYLOG
 3994|       |    const char *keylogfile = ossl_safe_getenv("SSLKEYLOGFILE");
 3995|       |#endif
 3996|       |#ifndef OPENSSL_NO_COMP_ALG
 3997|       |    int i;
 3998|       |#endif
 3999|       |
 4000|  2.56k|    if (meth == NULL) {
  ------------------
  |  Branch (4000:9): [True: 0, False: 2.56k]
  ------------------
 4001|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_NULL_SSL_METHOD_PASSED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4002|      0|        return NULL;
 4003|      0|    }
 4004|       |
 4005|  2.56k|    if (!OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL))
  ------------------
  |  | 2822|  2.56k|#define OPENSSL_INIT_LOAD_SSL_STRINGS 0x00200000L
  ------------------
  |  Branch (4005:9): [True: 0, False: 2.56k]
  ------------------
 4006|      0|        return NULL;
 4007|       |
 4008|       |    /* Doing this for the run once effect */
 4009|  2.56k|    if (SSL_get_ex_data_X509_STORE_CTX_idx() < 0) {
  ------------------
  |  Branch (4009:9): [True: 0, False: 2.56k]
  ------------------
 4010|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4011|      0|        goto err;
 4012|      0|    }
 4013|       |
 4014|  2.56k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  108|  2.56k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4015|  2.56k|    if (ret == NULL)
  ------------------
  |  Branch (4015:9): [True: 0, False: 2.56k]
  ------------------
 4016|      0|        return NULL;
 4017|       |
 4018|       |    /* Init the reference counting before any call to SSL_CTX_free */
 4019|  2.56k|    if (!CRYPTO_NEW_REF(&ret->references, 1)) {
  ------------------
  |  Branch (4019:9): [True: 0, False: 2.56k]
  ------------------
 4020|      0|        OPENSSL_free(ret);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4021|      0|        return NULL;
 4022|      0|    }
 4023|       |
 4024|  2.56k|    ret->lock = CRYPTO_THREAD_lock_new();
 4025|  2.56k|    if (ret->lock == NULL) {
  ------------------
  |  Branch (4025:9): [True: 0, False: 2.56k]
  ------------------
 4026|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4027|      0|        goto err;
 4028|      0|    }
 4029|       |
 4030|       |#ifdef TSAN_REQUIRES_LOCKING
 4031|       |    ret->tsan_lock = CRYPTO_THREAD_lock_new();
 4032|       |    if (ret->tsan_lock == NULL) {
 4033|       |        ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
 4034|       |        goto err;
 4035|       |    }
 4036|       |#endif
 4037|       |
 4038|  2.56k|    ret->libctx = libctx;
 4039|  2.56k|    if (propq != NULL) {
  ------------------
  |  Branch (4039:9): [True: 604, False: 1.95k]
  ------------------
 4040|    604|        ret->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  135|    604|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4041|    604|        if (ret->propq == NULL)
  ------------------
  |  Branch (4041:13): [True: 0, False: 604]
  ------------------
 4042|      0|            goto err;
 4043|    604|    }
 4044|       |
 4045|  2.56k|    ret->method = meth;
 4046|  2.56k|    ret->min_proto_version = 0;
 4047|  2.56k|    ret->max_proto_version = 0;
 4048|  2.56k|    ret->mode = SSL_MODE_AUTO_RETRY;
  ------------------
  |  |  508|  2.56k|#define SSL_MODE_AUTO_RETRY 0x00000004U
  ------------------
 4049|  2.56k|    ret->session_cache_mode = SSL_SESS_CACHE_SERVER;
  ------------------
  |  |  713|  2.56k|#define SSL_SESS_CACHE_SERVER 0x0002
  ------------------
 4050|  2.56k|    ret->session_cache_size = SSL_SESSION_CACHE_MAX_SIZE_DEFAULT;
  ------------------
  |  |  694|  2.56k|#define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024 * 20)
  ------------------
 4051|       |    /* We take the system default. */
 4052|  2.56k|    ret->session_timeout = meth->get_timeout();
 4053|  2.56k|    ret->max_cert_list = SSL_MAX_CERT_LIST_DEFAULT;
  ------------------
  |  |  692|  2.56k|#define SSL_MAX_CERT_LIST_DEFAULT (1024 * 100)
  ------------------
 4054|  2.56k|    ret->verify_mode = SSL_VERIFY_NONE;
  ------------------
  |  | 1177|  2.56k|#define SSL_VERIFY_NONE 0x00
  ------------------
 4055|       |
 4056|  2.56k|    ret->sessions = lh_SSL_SESSION_new(ssl_session_hash, ssl_session_cmp);
 4057|  2.56k|    if (ret->sessions == NULL) {
  ------------------
  |  Branch (4057:9): [True: 0, False: 2.56k]
  ------------------
 4058|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4059|      0|        goto err;
 4060|      0|    }
 4061|  2.56k|    ret->cert_store = X509_STORE_new();
 4062|  2.56k|    if (ret->cert_store == NULL) {
  ------------------
  |  Branch (4062:9): [True: 0, False: 2.56k]
  ------------------
 4063|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_X509_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4064|      0|        goto err;
 4065|      0|    }
 4066|  2.56k|#ifndef OPENSSL_NO_CT
 4067|  2.56k|    ret->ctlog_store = CTLOG_STORE_new_ex(libctx, propq);
 4068|  2.56k|    if (ret->ctlog_store == NULL) {
  ------------------
  |  Branch (4068:9): [True: 0, False: 2.56k]
  ------------------
 4069|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_CT_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4070|      0|        goto err;
 4071|      0|    }
 4072|  2.56k|#endif
 4073|       |
 4074|       |    /* initialize cipher/digest methods table */
 4075|  2.56k|    if (!ssl_load_ciphers(ret)) {
  ------------------
  |  Branch (4075:9): [True: 0, False: 2.56k]
  ------------------
 4076|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_SSL_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4077|      0|        goto err;
 4078|      0|    }
 4079|       |
 4080|  2.56k|    if (!ssl_load_groups(ret)) {
  ------------------
  |  Branch (4080:9): [True: 0, False: 2.56k]
  ------------------
 4081|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_SSL_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4082|      0|        goto err;
 4083|      0|    }
 4084|       |
 4085|       |    /* load provider sigalgs */
 4086|  2.56k|    if (!ssl_load_sigalgs(ret)) {
  ------------------
  |  Branch (4086:9): [True: 0, False: 2.56k]
  ------------------
 4087|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_SSL_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4088|      0|        goto err;
 4089|      0|    }
 4090|       |
 4091|       |    /* initialise sig algs */
 4092|  2.56k|    if (!ssl_setup_sigalgs(ret)) {
  ------------------
  |  Branch (4092:9): [True: 0, False: 2.56k]
  ------------------
 4093|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_SSL_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4094|      0|        goto err;
 4095|      0|    }
 4096|       |
 4097|  2.56k|    if (!SSL_CTX_set_ciphersuites(ret, OSSL_default_ciphersuites())) {
  ------------------
  |  Branch (4097:9): [True: 0, False: 2.56k]
  ------------------
 4098|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_SSL_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4099|      0|        goto err;
 4100|      0|    }
 4101|       |
 4102|  2.56k|    if ((ret->cert = ssl_cert_new(SSL_PKEY_NUM + ret->sigalg_list_len)) == NULL) {
  ------------------
  |  |  328|  2.56k|#define SSL_PKEY_NUM 9
  ------------------
  |  Branch (4102:9): [True: 0, False: 2.56k]
  ------------------
 4103|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_SSL_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4104|      0|        goto err;
 4105|      0|    }
 4106|       |
 4107|  2.56k|    if (!ssl_create_cipher_list(ret,
  ------------------
  |  Branch (4107:9): [True: 0, False: 2.56k]
  ------------------
 4108|  2.56k|            ret->tls13_ciphersuites,
 4109|  2.56k|            &ret->cipher_list, &ret->cipher_list_by_id,
 4110|  2.56k|            OSSL_default_cipher_list(), ret->cert)
 4111|  2.56k|        || sk_SSL_CIPHER_num(ret->cipher_list) <= 0) {
  ------------------
  |  | 1005|  2.56k|#define sk_SSL_CIPHER_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_CIPHER_sk_type(sk))
  ------------------
  |  Branch (4111:12): [True: 83, False: 2.47k]
  ------------------
 4112|     83|        ERR_raise(ERR_LIB_SSL, SSL_R_LIBRARY_HAS_NO_CIPHERS);
  ------------------
  |  |  404|     83|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|     83|    (ERR_new(),                                                  \
  |  |  |  |  407|     83|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|     83|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|     83|        ERR_set_error)
  |  |  ------------------
  ------------------
 4113|     83|        goto err;
 4114|     83|    }
 4115|       |
 4116|  2.47k|    ret->param = X509_VERIFY_PARAM_new();
 4117|  2.47k|    if (ret->param == NULL) {
  ------------------
  |  Branch (4117:9): [True: 0, False: 2.47k]
  ------------------
 4118|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_X509_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4119|      0|        goto err;
 4120|      0|    }
 4121|       |
 4122|       |    /*
 4123|       |     * If these aren't available from the provider we'll get NULL returns.
 4124|       |     * That's fine but will cause errors later if SSLv3 is negotiated
 4125|       |     */
 4126|  2.47k|    ret->md5 = ssl_evp_md_fetch(libctx, NID_md5, propq);
  ------------------
  |  | 1238|  2.47k|#define NID_md5         4
  ------------------
 4127|  2.47k|    ret->sha1 = ssl_evp_md_fetch(libctx, NID_sha1, propq);
  ------------------
  |  | 2344|  2.47k|#define NID_sha1                64
  ------------------
 4128|       |
 4129|  2.47k|    if ((ret->ca_names = sk_X509_NAME_new_null()) == NULL) {
  ------------------
  |  |   59|  2.47k|#define sk_X509_NAME_new_null() ((STACK_OF(X509_NAME) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (4129:9): [True: 0, False: 2.47k]
  ------------------
 4130|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4131|      0|        goto err;
 4132|      0|    }
 4133|       |
 4134|  2.47k|    if ((ret->client_ca_names = sk_X509_NAME_new_null()) == NULL) {
  ------------------
  |  |   59|  2.47k|#define sk_X509_NAME_new_null() ((STACK_OF(X509_NAME) *)OPENSSL_sk_new_null())
  ------------------
  |  Branch (4134:9): [True: 0, False: 2.47k]
  ------------------
 4135|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4136|      0|        goto err;
 4137|      0|    }
 4138|       |
 4139|  2.47k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_SSL_CTX, ret, &ret->ex_data)) {
  ------------------
  |  |  251|  2.47k|#define CRYPTO_EX_INDEX_SSL_CTX 1
  ------------------
  |  Branch (4139:9): [True: 0, False: 2.47k]
  ------------------
 4140|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4141|      0|        goto err;
 4142|      0|    }
 4143|       |
 4144|  2.47k|    if ((ret->ext.secure = OPENSSL_secure_zalloc(sizeof(*ret->ext.secure))) == NULL)
  ------------------
  |  |  141|  2.47k|    CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (4144:9): [True: 0, False: 2.47k]
  ------------------
 4145|      0|        goto err;
 4146|       |
 4147|       |    /* No compression for DTLS */
 4148|  2.47k|    if (!(meth->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS))
  ------------------
  |  | 2190|  2.47k|#define SSL_ENC_FLAG_DTLS 0x8
  ------------------
  |  Branch (4148:9): [True: 2.47k, False: 0]
  ------------------
 4149|  2.47k|        ret->comp_methods = SSL_COMP_get_compression_methods();
 4150|       |
 4151|  2.47k|    ret->max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH;
  ------------------
  |  |  177|  2.47k|#define SSL3_RT_MAX_PLAIN_LENGTH 16384
  ------------------
 4152|  2.47k|    ret->split_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH;
  ------------------
  |  |  177|  2.47k|#define SSL3_RT_MAX_PLAIN_LENGTH 16384
  ------------------
 4153|       |
 4154|       |    /* Setup RFC5077 ticket keys */
 4155|  2.47k|    if ((RAND_bytes_ex(libctx, ret->ext.tick_key_name,
  ------------------
  |  Branch (4155:9): [True: 0, False: 2.47k]
  ------------------
 4156|  2.47k|             sizeof(ret->ext.tick_key_name), 0)
 4157|  2.47k|            <= 0)
 4158|  2.47k|        || (RAND_priv_bytes_ex(libctx, ret->ext.secure->tick_hmac_key,
  ------------------
  |  Branch (4158:12): [True: 0, False: 2.47k]
  ------------------
 4159|  2.47k|                sizeof(ret->ext.secure->tick_hmac_key), 0)
 4160|  2.47k|            <= 0)
 4161|  2.47k|        || (RAND_priv_bytes_ex(libctx, ret->ext.secure->tick_aes_key,
  ------------------
  |  Branch (4161:12): [True: 0, False: 2.47k]
  ------------------
 4162|  2.47k|                sizeof(ret->ext.secure->tick_aes_key), 0)
 4163|  2.47k|            <= 0))
 4164|      0|        ret->options |= SSL_OP_NO_TICKET;
  ------------------
  |  |  383|      0|#define SSL_OP_NO_TICKET SSL_OP_BIT(14)
  |  |  ------------------
  |  |  |  |  350|      0|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
 4165|       |
 4166|  2.47k|    if (RAND_priv_bytes_ex(libctx, ret->ext.cookie_hmac_key,
  ------------------
  |  Branch (4166:9): [True: 0, False: 2.47k]
  ------------------
 4167|  2.47k|            sizeof(ret->ext.cookie_hmac_key), 0)
 4168|  2.47k|        <= 0) {
 4169|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_RAND_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4170|      0|        goto err;
 4171|      0|    }
 4172|       |
 4173|  2.47k|#ifndef OPENSSL_NO_SRP
 4174|  2.47k|    if (!ssl_ctx_srp_ctx_init_intern(ret)) {
  ------------------
  |  Branch (4174:9): [True: 0, False: 2.47k]
  ------------------
 4175|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_SSL_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4176|      0|        goto err;
 4177|      0|    }
 4178|  2.47k|#endif
 4179|  2.47k|#ifndef OPENSSL_NO_ENGINE
 4180|       |#ifdef OPENSSL_SSL_CLIENT_ENGINE_AUTO
 4181|       |#define eng_strx(x) #x
 4182|       |#define eng_str(x) eng_strx(x)
 4183|       |    /* Use specific client engine automatically... ignore errors */
 4184|       |    {
 4185|       |        ENGINE *eng;
 4186|       |        eng = ENGINE_by_id(eng_str(OPENSSL_SSL_CLIENT_ENGINE_AUTO));
 4187|       |        if (!eng) {
 4188|       |            ERR_clear_error();
 4189|       |            ENGINE_load_builtin_engines();
 4190|       |            eng = ENGINE_by_id(eng_str(OPENSSL_SSL_CLIENT_ENGINE_AUTO));
 4191|       |        }
 4192|       |        if (!eng || !SSL_CTX_set_client_cert_engine(ret, eng))
 4193|       |            ERR_clear_error();
 4194|       |    }
 4195|       |#endif
 4196|  2.47k|#endif
 4197|       |
 4198|       |#ifndef OPENSSL_NO_COMP_ALG
 4199|       |    /*
 4200|       |     * Set the default order: brotli, zlib, zstd
 4201|       |     * Including only those enabled algorithms
 4202|       |     */
 4203|       |    memset(ret->cert_comp_prefs, 0, sizeof(ret->cert_comp_prefs));
 4204|       |    i = 0;
 4205|       |    if (ossl_comp_has_alg(TLSEXT_comp_cert_brotli))
 4206|       |        ret->cert_comp_prefs[i++] = TLSEXT_comp_cert_brotli;
 4207|       |    if (ossl_comp_has_alg(TLSEXT_comp_cert_zlib))
 4208|       |        ret->cert_comp_prefs[i++] = TLSEXT_comp_cert_zlib;
 4209|       |    if (ossl_comp_has_alg(TLSEXT_comp_cert_zstd))
 4210|       |        ret->cert_comp_prefs[i++] = TLSEXT_comp_cert_zstd;
 4211|       |#endif
 4212|       |    /*
 4213|       |     * Disable compression by default to prevent CRIME. Applications can
 4214|       |     * re-enable compression by configuring
 4215|       |     * SSL_CTX_clear_options(ctx, SSL_OP_NO_COMPRESSION);
 4216|       |     * or by using the SSL_CONF library. Similarly we also enable TLSv1.3
 4217|       |     * middlebox compatibility by default. This may be disabled by default in
 4218|       |     * a later OpenSSL version.
 4219|       |     */
 4220|  2.47k|    ret->options |= SSL_OP_NO_COMPRESSION | SSL_OP_ENABLE_MIDDLEBOX_COMPAT;
  ------------------
  |  |  394|  2.47k|#define SSL_OP_NO_COMPRESSION SSL_OP_BIT(17)
  |  |  ------------------
  |  |  |  |  350|  2.47k|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
                  ret->options |= SSL_OP_NO_COMPRESSION | SSL_OP_ENABLE_MIDDLEBOX_COMPAT;
  ------------------
  |  |  403|  2.47k|#define SSL_OP_ENABLE_MIDDLEBOX_COMPAT SSL_OP_BIT(20)
  |  |  ------------------
  |  |  |  |  350|  2.47k|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
 4221|       |
 4222|  2.47k|    ret->ext.status_type = TLSEXT_STATUSTYPE_nothing;
  ------------------
  |  | 2207|  2.47k|#define TLSEXT_STATUSTYPE_nothing -1
  ------------------
 4223|       |
 4224|       |    /*
 4225|       |     * We cannot usefully set a default max_early_data here (which gets
 4226|       |     * propagated in SSL_new(), for the following reason: setting the
 4227|       |     * SSL field causes tls_construct_stoc_early_data() to tell the
 4228|       |     * client that early data will be accepted when constructing a TLS 1.3
 4229|       |     * session ticket, and the client will accordingly send us early data
 4230|       |     * when using that ticket (if the client has early data to send).
 4231|       |     * However, in order for the early data to actually be consumed by
 4232|       |     * the application, the application must also have calls to
 4233|       |     * SSL_read_early_data(); otherwise we'll just skip past the early data
 4234|       |     * and ignore it.  So, since the application must add calls to
 4235|       |     * SSL_read_early_data(), we also require them to add
 4236|       |     * calls to SSL_CTX_set_max_early_data() in order to use early data,
 4237|       |     * eliminating the bandwidth-wasting early data in the case described
 4238|       |     * above.
 4239|       |     */
 4240|  2.47k|    ret->max_early_data = 0;
 4241|       |
 4242|       |    /*
 4243|       |     * Default recv_max_early_data is a fully loaded single record. Could be
 4244|       |     * split across multiple records in practice. We set this differently to
 4245|       |     * max_early_data so that, in the default case, we do not advertise any
 4246|       |     * support for early_data, but if a client were to send us some (e.g.
 4247|       |     * because of an old, stale ticket) then we will tolerate it and skip over
 4248|       |     * it.
 4249|       |     */
 4250|  2.47k|    ret->recv_max_early_data = SSL3_RT_MAX_PLAIN_LENGTH;
  ------------------
  |  |  177|  2.47k|#define SSL3_RT_MAX_PLAIN_LENGTH 16384
  ------------------
 4251|       |
 4252|       |    /* By default we send two session tickets automatically in TLSv1.3 */
 4253|  2.47k|    ret->num_tickets = 2;
 4254|       |
 4255|  2.47k|#ifndef OPENSSL_NO_QUIC
 4256|       |    /* only create a cache for client CTX-es */
 4257|  2.47k|    if (meth == OSSL_QUIC_client_method())
  ------------------
  |  Branch (4257:9): [True: 0, False: 2.47k]
  ------------------
 4258|      0|        if ((ret->tokencache = ossl_quic_new_token_store()) == NULL)
  ------------------
  |  Branch (4258:13): [True: 0, False: 0]
  ------------------
 4259|      0|            goto err;
 4260|  2.47k|    ret->domain_flags = 0;
 4261|  2.47k|    if (IS_QUIC_METHOD(meth)) {
  ------------------
  |  |   52|  2.47k|    ((m) == OSSL_QUIC_client_method() || (m) == OSSL_QUIC_client_thread_method() || (m) == OSSL_QUIC_server_method())
  |  |  ------------------
  |  |  |  Branch (52:6): [True: 0, False: 2.47k]
  |  |  |  Branch (52:42): [True: 0, False: 2.47k]
  |  |  |  Branch (52:85): [True: 0, False: 2.47k]
  |  |  ------------------
  ------------------
 4262|      0|#if defined(OPENSSL_THREADS)
 4263|      0|        if (meth == OSSL_QUIC_client_thread_method())
  ------------------
  |  Branch (4263:13): [True: 0, False: 0]
  ------------------
 4264|      0|            ret->domain_flags
 4265|      0|                = SSL_DOMAIN_FLAG_MULTI_THREAD
  ------------------
  |  | 2386|      0|#define SSL_DOMAIN_FLAG_MULTI_THREAD (1U << 1)
  ------------------
 4266|      0|                | SSL_DOMAIN_FLAG_THREAD_ASSISTED
  ------------------
  |  | 2387|      0|#define SSL_DOMAIN_FLAG_THREAD_ASSISTED (1U << 2)
  ------------------
 4267|      0|                | SSL_DOMAIN_FLAG_BLOCKING;
  ------------------
  |  | 2388|      0|#define SSL_DOMAIN_FLAG_BLOCKING (1U << 3)
  ------------------
 4268|      0|        else
 4269|      0|            ret->domain_flags
 4270|      0|                = SSL_DOMAIN_FLAG_MULTI_THREAD
  ------------------
  |  | 2386|      0|#define SSL_DOMAIN_FLAG_MULTI_THREAD (1U << 1)
  ------------------
 4271|      0|                | SSL_DOMAIN_FLAG_LEGACY_BLOCKING;
  ------------------
  |  | 2389|      0|#define SSL_DOMAIN_FLAG_LEGACY_BLOCKING (1U << 4)
  ------------------
 4272|       |#else
 4273|       |        ret->domain_flags
 4274|       |            = SSL_DOMAIN_FLAG_SINGLE_THREAD
 4275|       |            | SSL_DOMAIN_FLAG_LEGACY_BLOCKING;
 4276|       |#endif
 4277|      0|    }
 4278|  2.47k|#endif
 4279|       |
 4280|  2.47k|    if (!ssl_ctx_system_config(ret)) {
  ------------------
  |  Branch (4280:9): [True: 0, False: 2.47k]
  ------------------
 4281|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_ERROR_IN_SYSTEM_DEFAULT_CONFIG);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4282|      0|        goto err;
 4283|      0|    }
 4284|       |
 4285|       |#ifndef OPENSSL_NO_SSLKEYLOG
 4286|       |    if (keylogfile != NULL && strlen(keylogfile) != 0) {
 4287|       |        /* Make sure we have a global lock allocated */
 4288|       |        if (!RUN_ONCE(&ssl_keylog_once, ssl_keylog_init)) {
 4289|       |            /* use a trace message as a warning */
 4290|       |            OSSL_TRACE(TLS, "Unable to initialize keylog data\n");
 4291|       |            goto out;
 4292|       |        }
 4293|       |
 4294|       |        /* Grab our global lock */
 4295|       |        if (!CRYPTO_THREAD_write_lock(keylog_lock)) {
 4296|       |            OSSL_TRACE(TLS, "Unable to acquire keylog write lock\n");
 4297|       |            goto out;
 4298|       |        } else {
 4299|       |            /*
 4300|       |             * If the bio for the requested keylog file hasn't been
 4301|       |             * created yet, go ahead and create it, and set it to append
 4302|       |             * if its already there.
 4303|       |             */
 4304|       |            if (keylog_bio == NULL) {
 4305|       |                keylog_bio = get_sslkeylog_bio(keylogfile);
 4306|       |                if (keylog_bio == NULL) {
 4307|       |                    OSSL_TRACE(TLS, "Unable to create keylog bio\n");
 4308|       |                    goto out;
 4309|       |                }
 4310|       |                BIO_set_callback_ex(keylog_bio, check_keylog_bio_free);
 4311|       |            } else {
 4312|       |                /* up our refcount for the already-created case */
 4313|       |                BIO_up_ref(keylog_bio);
 4314|       |            }
 4315|       |            /* If we have a bio now, assign the callback handler */
 4316|       |            if (keylog_bio != NULL)
 4317|       |                ret->do_sslkeylog = 1;
 4318|       |            /* unlock, and we're done */
 4319|       |            CRYPTO_THREAD_unlock(keylog_lock);
 4320|       |        }
 4321|       |    }
 4322|       |out:
 4323|       |#endif
 4324|  2.47k|    return ret;
 4325|     83|err:
 4326|     83|    SSL_CTX_free(ret);
 4327|       |#ifndef OPENSSL_NO_SSLKEYLOG
 4328|       |    BIO_free(keylog_bio);
 4329|       |#endif
 4330|       |    return NULL;
 4331|  2.47k|}
SSL_CTX_new:
 4334|  1.93k|{
 4335|  1.93k|    return SSL_CTX_new_ex(NULL, NULL, meth);
 4336|  1.93k|}
SSL_CTX_up_ref:
 4339|  3.54k|{
 4340|  3.54k|    int i;
 4341|       |
 4342|  3.54k|    if (CRYPTO_UP_REF(&ctx->references, &i) <= 0)
  ------------------
  |  Branch (4342:9): [True: 0, False: 3.54k]
  ------------------
 4343|      0|        return 0;
 4344|       |
 4345|  3.54k|    REF_PRINT_COUNT("SSL_CTX", i, ctx);
  ------------------
  |  |  301|  3.54k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  3.54k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  297|  3.54k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  285|  3.54k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4346|  3.54k|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|  3.54k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 3.54k]
  |  |  ------------------
  ------------------
 4347|  3.54k|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (4347:13): [True: 3.54k, False: 0]
  ------------------
 4348|  3.54k|}
SSL_CTX_free:
 4351|  6.10k|{
 4352|  6.10k|    int i;
 4353|  6.10k|    size_t j;
 4354|       |
 4355|  6.10k|    if (a == NULL)
  ------------------
  |  Branch (4355:9): [True: 0, False: 6.10k]
  ------------------
 4356|      0|        return;
 4357|       |
 4358|  6.10k|    CRYPTO_DOWN_REF(&a->references, &i);
 4359|  6.10k|    REF_PRINT_COUNT("SSL_CTX", i, a);
  ------------------
  |  |  301|  6.10k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  6.10k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  297|  6.10k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  285|  6.10k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4360|  6.10k|    if (i > 0)
  ------------------
  |  Branch (4360:9): [True: 3.54k, False: 2.56k]
  ------------------
 4361|  3.54k|        return;
 4362|  2.56k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|  2.56k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 2.56k]
  |  |  ------------------
  ------------------
 4363|       |
 4364|       |#ifndef OPENSSL_NO_SSLKEYLOG
 4365|       |    if (keylog_lock != NULL && CRYPTO_THREAD_write_lock(keylog_lock)) {
 4366|       |        if (a->do_sslkeylog == 1)
 4367|       |            BIO_free(keylog_bio);
 4368|       |        a->do_sslkeylog = 0;
 4369|       |        CRYPTO_THREAD_unlock(keylog_lock);
 4370|       |    }
 4371|       |#endif
 4372|       |
 4373|  2.56k|    X509_VERIFY_PARAM_free(a->param);
 4374|  2.56k|    dane_ctx_final(&a->dane);
 4375|       |
 4376|       |    /*
 4377|       |     * Free internal session cache. However: the remove_cb() may reference
 4378|       |     * the ex_data of SSL_CTX, thus the ex_data store can only be removed
 4379|       |     * after the sessions were flushed.
 4380|       |     * As the ex_data handling routines might also touch the session cache,
 4381|       |     * the most secure solution seems to be: empty (flush) the cache, then
 4382|       |     * free ex_data, then finally free the cache.
 4383|       |     * (See ticket [openssl.org #212].)
 4384|       |     */
 4385|  2.56k|    if (a->sessions != NULL)
  ------------------
  |  Branch (4385:9): [True: 2.56k, False: 0]
  ------------------
 4386|  2.56k|        SSL_CTX_flush_sessions_ex(a, 0);
 4387|       |
 4388|  2.56k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_CTX, a, &a->ex_data);
  ------------------
  |  |  251|  2.56k|#define CRYPTO_EX_INDEX_SSL_CTX 1
  ------------------
 4389|  2.56k|    lh_SSL_SESSION_free(a->sessions);
 4390|  2.56k|    X509_STORE_free(a->cert_store);
 4391|  2.56k|#ifndef OPENSSL_NO_CT
 4392|  2.56k|    CTLOG_STORE_free(a->ctlog_store);
 4393|  2.56k|#endif
 4394|  2.56k|    sk_SSL_CIPHER_free(a->cipher_list);
  ------------------
  |  | 1011|  2.56k|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 4395|  2.56k|    sk_SSL_CIPHER_free(a->cipher_list_by_id);
  ------------------
  |  | 1011|  2.56k|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 4396|  2.56k|    sk_SSL_CIPHER_free(a->tls13_ciphersuites);
  ------------------
  |  | 1011|  2.56k|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
 4397|  2.56k|    ssl_cert_free(a->cert);
 4398|  2.56k|    sk_X509_NAME_pop_free(a->ca_names, X509_NAME_free);
  ------------------
  |  |   70|  2.56k|#define sk_X509_NAME_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_freefunc_type(freefunc))
  ------------------
 4399|  2.56k|    sk_X509_NAME_pop_free(a->client_ca_names, X509_NAME_free);
  ------------------
  |  |   70|  2.56k|#define sk_X509_NAME_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_freefunc_type(freefunc))
  ------------------
 4400|  2.56k|    OSSL_STACK_OF_X509_free(a->extra_certs);
 4401|  2.56k|    a->comp_methods = NULL;
 4402|  2.56k|#ifndef OPENSSL_NO_SRTP
 4403|  2.56k|    sk_SRTP_PROTECTION_PROFILE_free(a->srtp_profiles);
  ------------------
  |  |  256|  2.56k|#define sk_SRTP_PROTECTION_PROFILE_free(sk) OPENSSL_sk_free(ossl_check_SRTP_PROTECTION_PROFILE_sk_type(sk))
  ------------------
 4404|  2.56k|#endif
 4405|  2.56k|#ifndef OPENSSL_NO_SRP
 4406|  2.56k|    ssl_ctx_srp_ctx_free_intern(a);
 4407|  2.56k|#endif
 4408|  2.56k|#ifndef OPENSSL_NO_ENGINE
 4409|  2.56k|    tls_engine_finish(a->client_cert_engine);
 4410|  2.56k|#endif
 4411|       |
 4412|  2.56k|    OPENSSL_free(a->ext.ecpointformats);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4413|  2.56k|    OPENSSL_free(a->ext.supportedgroups);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4414|  2.56k|    OPENSSL_free(a->ext.keyshares);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4415|  2.56k|    OPENSSL_free(a->ext.tuples);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4416|  2.56k|    OPENSSL_free(a->ext.alpn);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4417|  2.56k|    OPENSSL_secure_free(a->ext.secure);
  ------------------
  |  |  147|  2.56k|    CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4418|       |
 4419|  2.56k|    ssl_evp_md_free(a->md5);
 4420|  2.56k|    ssl_evp_md_free(a->sha1);
 4421|       |
 4422|  64.0k|    for (j = 0; j < SSL_ENC_NUM_IDX; j++)
  ------------------
  |  |  354|  64.0k|#define SSL_ENC_NUM_IDX 24
  ------------------
  |  Branch (4422:17): [True: 61.4k, False: 2.56k]
  ------------------
 4423|  61.4k|        ssl_evp_cipher_free(a->ssl_cipher_methods[j]);
 4424|  38.4k|    for (j = 0; j < SSL_MD_NUM_IDX; j++)
  ------------------
  |  |  203|  38.4k|#define SSL_MD_NUM_IDX SSL_MAX_DIGEST
  |  |  ------------------
  |  |  |  |  201|  38.4k|#define SSL_MAX_DIGEST 14
  |  |  ------------------
  ------------------
  |  Branch (4424:17): [True: 35.8k, False: 2.56k]
  ------------------
 4425|  35.8k|        ssl_evp_md_free(a->ssl_digest_methods[j]);
 4426|   148k|    for (j = 0; j < a->group_list_len; j++) {
  ------------------
  |  Branch (4426:17): [True: 146k, False: 2.56k]
  ------------------
 4427|   146k|        OPENSSL_free(a->group_list[j].tlsname);
  ------------------
  |  |  131|   146k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4428|   146k|        OPENSSL_free(a->group_list[j].realname);
  ------------------
  |  |  131|   146k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4429|   146k|        OPENSSL_free(a->group_list[j].algorithm);
  ------------------
  |  |  131|   146k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4430|   146k|    }
 4431|  2.56k|    OPENSSL_free(a->group_list);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4432|  9.99k|    for (j = 0; j < a->sigalg_list_len; j++) {
  ------------------
  |  Branch (4432:17): [True: 7.43k, False: 2.56k]
  ------------------
 4433|  7.43k|        OPENSSL_free(a->sigalg_list[j].name);
  ------------------
  |  |  131|  7.43k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4434|  7.43k|        OPENSSL_free(a->sigalg_list[j].sigalg_name);
  ------------------
  |  |  131|  7.43k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4435|  7.43k|        OPENSSL_free(a->sigalg_list[j].sigalg_oid);
  ------------------
  |  |  131|  7.43k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4436|  7.43k|        OPENSSL_free(a->sigalg_list[j].sig_name);
  ------------------
  |  |  131|  7.43k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4437|  7.43k|        OPENSSL_free(a->sigalg_list[j].sig_oid);
  ------------------
  |  |  131|  7.43k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4438|  7.43k|        OPENSSL_free(a->sigalg_list[j].hash_name);
  ------------------
  |  |  131|  7.43k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4439|  7.43k|        OPENSSL_free(a->sigalg_list[j].hash_oid);
  ------------------
  |  |  131|  7.43k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4440|  7.43k|        OPENSSL_free(a->sigalg_list[j].keytype);
  ------------------
  |  |  131|  7.43k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4441|  7.43k|        OPENSSL_free(a->sigalg_list[j].keytype_oid);
  ------------------
  |  |  131|  7.43k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4442|  7.43k|    }
 4443|  2.56k|    OPENSSL_free(a->sigalg_list);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4444|  2.56k|    OPENSSL_free(a->ssl_cert_info);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4445|       |
 4446|  2.56k|    OPENSSL_free(a->sigalg_lookup_cache);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4447|  2.56k|    OPENSSL_free(a->tls12_sigalgs);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4448|       |
 4449|  2.56k|    OPENSSL_free(a->client_cert_type);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4450|  2.56k|    OPENSSL_free(a->server_cert_type);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4451|       |
 4452|  2.56k|    CRYPTO_THREAD_lock_free(a->lock);
 4453|  2.56k|    CRYPTO_FREE_REF(&a->references);
 4454|       |#ifdef TSAN_REQUIRES_LOCKING
 4455|       |    CRYPTO_THREAD_lock_free(a->tsan_lock);
 4456|       |#endif
 4457|       |
 4458|  2.56k|    OPENSSL_free(a->propq);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4459|  2.56k|#ifndef OPENSSL_NO_QLOG
 4460|  2.56k|    OPENSSL_free(a->qlog_title);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4461|  2.56k|#endif
 4462|       |
 4463|  2.56k|#ifndef OPENSSL_NO_QUIC
 4464|  2.56k|    ossl_quic_free_token_store(a->tokencache);
 4465|  2.56k|#endif
 4466|       |
 4467|  2.56k|    OPENSSL_free(a);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 4468|  2.56k|}
SSL_CTX_set_default_passwd_cb:
 4471|      1|{
 4472|      1|    ctx->default_passwd_callback = cb;
 4473|      1|}
SSL_CTX_set_default_passwd_cb_userdata:
 4476|      1|{
 4477|      1|    ctx->default_passwd_callback_userdata = u;
 4478|      1|}
SSL_CTX_set_verify:
 4540|  1.77k|{
 4541|  1.77k|    ctx->verify_mode = mode;
 4542|  1.77k|    ctx->default_verify_callback = cb;
 4543|  1.77k|}
SSL_get_error:
 4827|    722|{
 4828|    722|    return ossl_ssl_get_error(s, i, /*check_err=*/1);
 4829|    722|}
ossl_ssl_get_error:
 4832|    722|{
 4833|    722|    int reason;
 4834|    722|    unsigned long l;
 4835|    722|    BIO *bio;
 4836|    722|    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s);
  ------------------
  |  |   41|    722|    SSL_CONNECTION_FROM_SSL_int(ssl, const)
  |  |  ------------------
  |  |  |  |   32|    722|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 722]
  |  |  |  |  ------------------
  |  |  |  |   33|    722|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|    722|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 722, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|    722|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|    722|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
 4837|       |
 4838|    722|    if (i > 0)
  ------------------
  |  Branch (4838:9): [True: 0, False: 722]
  ------------------
 4839|      0|        return SSL_ERROR_NONE;
  ------------------
  |  | 1258|      0|#define SSL_ERROR_NONE 0
  ------------------
 4840|       |
 4841|    722|#ifndef OPENSSL_NO_QUIC
 4842|    722|    if (IS_QUIC(s)) {
  ------------------
  |  |   96|    722|    ((ssl) != NULL && SSL_TYPE_IS_QUIC((ssl)->type))
  |  |  ------------------
  |  |  |  | 1229|    722|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1229:29): [True: 0, False: 722]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (96:6): [True: 722, False: 0]
  |  |  ------------------
  ------------------
 4843|      0|        reason = ossl_quic_get_error(s, i);
 4844|      0|        if (reason != SSL_ERROR_NONE)
  ------------------
  |  | 1258|      0|#define SSL_ERROR_NONE 0
  ------------------
  |  Branch (4844:13): [True: 0, False: 0]
  ------------------
 4845|      0|            return reason;
 4846|      0|    }
 4847|    722|#endif
 4848|       |
 4849|    722|    if (sc == NULL)
  ------------------
  |  Branch (4849:9): [True: 0, False: 722]
  ------------------
 4850|      0|        return SSL_ERROR_SSL;
  ------------------
  |  | 1259|      0|#define SSL_ERROR_SSL 1
  ------------------
 4851|       |
 4852|       |    /*
 4853|       |     * Make things return SSL_ERROR_SYSCALL when doing SSL_do_handshake etc,
 4854|       |     * where we do encode the error
 4855|       |     */
 4856|    722|    if (check_err && (l = ERR_peek_error()) != 0) {
  ------------------
  |  Branch (4856:9): [True: 722, False: 0]
  |  Branch (4856:22): [True: 409, False: 313]
  ------------------
 4857|    409|        if (ERR_GET_LIB(l) == ERR_LIB_SYS)
  ------------------
  |  |   74|    409|#define ERR_LIB_SYS 2
  ------------------
  |  Branch (4857:13): [True: 0, False: 409]
  ------------------
 4858|      0|            return SSL_ERROR_SYSCALL;
  ------------------
  |  | 1263|      0|#define SSL_ERROR_SYSCALL 5 /* look at error stack/return \
  ------------------
 4859|    409|        else
 4860|    409|            return SSL_ERROR_SSL;
  ------------------
  |  | 1259|    409|#define SSL_ERROR_SSL 1
  ------------------
 4861|    409|    }
 4862|       |
 4863|    313|#ifndef OPENSSL_NO_QUIC
 4864|    313|    if (!IS_QUIC(s))
  ------------------
  |  |   96|    313|    ((ssl) != NULL && SSL_TYPE_IS_QUIC((ssl)->type))
  |  |  ------------------
  |  |  |  | 1229|    313|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1229:29): [True: 0, False: 313]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (96:6): [True: 313, False: 0]
  |  |  ------------------
  ------------------
 4865|    313|#endif
 4866|    313|    {
 4867|    313|        if (SSL_want_read(s)) {
  ------------------
  |  |  943|    313|#define SSL_want_read(s) (SSL_want(s) == SSL_READING)
  |  |  ------------------
  |  |  |  |  934|    313|#define SSL_READING 3
  |  |  ------------------
  |  |  |  Branch (943:26): [True: 313, False: 0]
  |  |  ------------------
  ------------------
 4868|    313|            bio = SSL_get_rbio(s);
 4869|    313|            if (BIO_should_read(bio))
  ------------------
  |  |  268|    313|#define BIO_should_read(a) BIO_test_flags(a, BIO_FLAGS_READ)
  |  |  ------------------
  |  |  |  |  222|    313|#define BIO_FLAGS_READ 0x01
  |  |  ------------------
  |  |  |  Branch (268:28): [True: 310, False: 3]
  |  |  ------------------
  ------------------
 4870|    310|                return SSL_ERROR_WANT_READ;
  ------------------
  |  | 1260|    310|#define SSL_ERROR_WANT_READ 2
  ------------------
 4871|      3|            else if (BIO_should_write(bio))
  ------------------
  |  |  269|      3|#define BIO_should_write(a) BIO_test_flags(a, BIO_FLAGS_WRITE)
  |  |  ------------------
  |  |  |  |  223|      3|#define BIO_FLAGS_WRITE 0x02
  |  |  ------------------
  |  |  |  Branch (269:29): [True: 0, False: 3]
  |  |  ------------------
  ------------------
 4872|       |                /*
 4873|       |                 * This one doesn't make too much sense ... We never try to
 4874|       |                 * write to the rbio, and an application program where rbio and
 4875|       |                 * wbio are separate couldn't even know what it should wait for.
 4876|       |                 * However if we ever set s->rwstate incorrectly (so that we
 4877|       |                 * have SSL_want_read(s) instead of SSL_want_write(s)) and rbio
 4878|       |                 * and wbio *are* the same, this test works around that bug; so
 4879|       |                 * it might be safer to keep it.
 4880|       |                 */
 4881|      0|                return SSL_ERROR_WANT_WRITE;
  ------------------
  |  | 1261|      0|#define SSL_ERROR_WANT_WRITE 3
  ------------------
 4882|      3|            else if (BIO_should_io_special(bio)) {
  ------------------
  |  |  270|      3|#define BIO_should_io_special(a) BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL)
  |  |  ------------------
  |  |  |  |  224|      3|#define BIO_FLAGS_IO_SPECIAL 0x04
  |  |  ------------------
  |  |  |  Branch (270:34): [True: 0, False: 3]
  |  |  ------------------
  ------------------
 4883|      0|                reason = BIO_get_retry_reason(bio);
 4884|      0|                if (reason == BIO_RR_CONNECT)
  ------------------
  |  |  286|      0|#define BIO_RR_CONNECT 0x02
  ------------------
  |  Branch (4884:21): [True: 0, False: 0]
  ------------------
 4885|      0|                    return SSL_ERROR_WANT_CONNECT;
  ------------------
  |  | 1266|      0|#define SSL_ERROR_WANT_CONNECT 7
  ------------------
 4886|      0|                else if (reason == BIO_RR_ACCEPT)
  ------------------
  |  |  288|      0|#define BIO_RR_ACCEPT 0x03
  ------------------
  |  Branch (4886:26): [True: 0, False: 0]
  ------------------
 4887|      0|                    return SSL_ERROR_WANT_ACCEPT;
  ------------------
  |  | 1267|      0|#define SSL_ERROR_WANT_ACCEPT 8
  ------------------
 4888|      0|                else
 4889|      0|                    return SSL_ERROR_SYSCALL; /* unknown */
  ------------------
  |  | 1263|      0|#define SSL_ERROR_SYSCALL 5 /* look at error stack/return \
  ------------------
 4890|      0|            }
 4891|    313|        }
 4892|       |
 4893|      3|        if (SSL_want_write(s)) {
  ------------------
  |  |  944|      3|#define SSL_want_write(s) (SSL_want(s) == SSL_WRITING)
  |  |  ------------------
  |  |  |  |  933|      3|#define SSL_WRITING 2
  |  |  ------------------
  |  |  |  Branch (944:27): [True: 0, False: 3]
  |  |  ------------------
  ------------------
 4894|       |            /*
 4895|       |             * Access wbio directly - in order to use the buffered bio if
 4896|       |             * present
 4897|       |             */
 4898|      0|            bio = sc->wbio;
 4899|      0|            if (BIO_should_write(bio))
  ------------------
  |  |  269|      0|#define BIO_should_write(a) BIO_test_flags(a, BIO_FLAGS_WRITE)
  |  |  ------------------
  |  |  |  |  223|      0|#define BIO_FLAGS_WRITE 0x02
  |  |  ------------------
  |  |  |  Branch (269:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4900|      0|                return SSL_ERROR_WANT_WRITE;
  ------------------
  |  | 1261|      0|#define SSL_ERROR_WANT_WRITE 3
  ------------------
 4901|      0|            else if (BIO_should_read(bio))
  ------------------
  |  |  268|      0|#define BIO_should_read(a) BIO_test_flags(a, BIO_FLAGS_READ)
  |  |  ------------------
  |  |  |  |  222|      0|#define BIO_FLAGS_READ 0x01
  |  |  ------------------
  |  |  |  Branch (268:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4902|       |                /*
 4903|       |                 * See above (SSL_want_read(s) with BIO_should_write(bio))
 4904|       |                 */
 4905|      0|                return SSL_ERROR_WANT_READ;
  ------------------
  |  | 1260|      0|#define SSL_ERROR_WANT_READ 2
  ------------------
 4906|      0|            else if (BIO_should_io_special(bio)) {
  ------------------
  |  |  270|      0|#define BIO_should_io_special(a) BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL)
  |  |  ------------------
  |  |  |  |  224|      0|#define BIO_FLAGS_IO_SPECIAL 0x04
  |  |  ------------------
  |  |  |  Branch (270:34): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4907|      0|                reason = BIO_get_retry_reason(bio);
 4908|      0|                if (reason == BIO_RR_CONNECT)
  ------------------
  |  |  286|      0|#define BIO_RR_CONNECT 0x02
  ------------------
  |  Branch (4908:21): [True: 0, False: 0]
  ------------------
 4909|      0|                    return SSL_ERROR_WANT_CONNECT;
  ------------------
  |  | 1266|      0|#define SSL_ERROR_WANT_CONNECT 7
  ------------------
 4910|      0|                else if (reason == BIO_RR_ACCEPT)
  ------------------
  |  |  288|      0|#define BIO_RR_ACCEPT 0x03
  ------------------
  |  Branch (4910:26): [True: 0, False: 0]
  ------------------
 4911|      0|                    return SSL_ERROR_WANT_ACCEPT;
  ------------------
  |  | 1267|      0|#define SSL_ERROR_WANT_ACCEPT 8
  ------------------
 4912|      0|                else
 4913|      0|                    return SSL_ERROR_SYSCALL;
  ------------------
  |  | 1263|      0|#define SSL_ERROR_SYSCALL 5 /* look at error stack/return \
  ------------------
 4914|      0|            }
 4915|      0|        }
 4916|      3|    }
 4917|       |
 4918|      3|    if (SSL_want_x509_lookup(s))
  ------------------
  |  |  945|      3|#define SSL_want_x509_lookup(s) (SSL_want(s) == SSL_X509_LOOKUP)
  |  |  ------------------
  |  |  |  |  935|      3|#define SSL_X509_LOOKUP 4
  |  |  ------------------
  |  |  |  Branch (945:33): [True: 0, False: 3]
  |  |  ------------------
  ------------------
 4919|      0|        return SSL_ERROR_WANT_X509_LOOKUP;
  ------------------
  |  | 1262|      0|#define SSL_ERROR_WANT_X509_LOOKUP 4
  ------------------
 4920|      3|    if (SSL_want_retry_verify(s))
  ------------------
  |  |  946|      3|#define SSL_want_retry_verify(s) (SSL_want(s) == SSL_RETRY_VERIFY)
  |  |  ------------------
  |  |  |  |  939|      3|#define SSL_RETRY_VERIFY 8
  |  |  ------------------
  |  |  |  Branch (946:34): [True: 0, False: 3]
  |  |  ------------------
  ------------------
 4921|      0|        return SSL_ERROR_WANT_RETRY_VERIFY;
  ------------------
  |  | 1271|      0|#define SSL_ERROR_WANT_RETRY_VERIFY 12
  ------------------
 4922|      3|    if (SSL_want_async(s))
  ------------------
  |  |  947|      3|#define SSL_want_async(s) (SSL_want(s) == SSL_ASYNC_PAUSED)
  |  |  ------------------
  |  |  |  |  936|      3|#define SSL_ASYNC_PAUSED 5
  |  |  ------------------
  |  |  |  Branch (947:27): [True: 0, False: 3]
  |  |  ------------------
  ------------------
 4923|      0|        return SSL_ERROR_WANT_ASYNC;
  ------------------
  |  | 1268|      0|#define SSL_ERROR_WANT_ASYNC 9
  ------------------
 4924|      3|    if (SSL_want_async_job(s))
  ------------------
  |  |  948|      3|#define SSL_want_async_job(s) (SSL_want(s) == SSL_ASYNC_NO_JOBS)
  |  |  ------------------
  |  |  |  |  937|      3|#define SSL_ASYNC_NO_JOBS 6
  |  |  ------------------
  |  |  |  Branch (948:31): [True: 0, False: 3]
  |  |  ------------------
  ------------------
 4925|      0|        return SSL_ERROR_WANT_ASYNC_JOB;
  ------------------
  |  | 1269|      0|#define SSL_ERROR_WANT_ASYNC_JOB 10
  ------------------
 4926|      3|    if (SSL_want_client_hello_cb(s))
  ------------------
  |  |  949|      3|#define SSL_want_client_hello_cb(s) (SSL_want(s) == SSL_CLIENT_HELLO_CB)
  |  |  ------------------
  |  |  |  |  938|      3|#define SSL_CLIENT_HELLO_CB 7
  |  |  ------------------
  |  |  |  Branch (949:37): [True: 0, False: 3]
  |  |  ------------------
  ------------------
 4927|      0|        return SSL_ERROR_WANT_CLIENT_HELLO_CB;
  ------------------
  |  | 1270|      0|#define SSL_ERROR_WANT_CLIENT_HELLO_CB 11
  ------------------
 4928|       |
 4929|      3|    if ((sc->shutdown & SSL_RECEIVED_SHUTDOWN) && (sc->s3.warn_alert == SSL_AD_CLOSE_NOTIFY))
  ------------------
  |  |  216|      3|#define SSL_RECEIVED_SHUTDOWN 2
  ------------------
                  if ((sc->shutdown & SSL_RECEIVED_SHUTDOWN) && (sc->s3.warn_alert == SSL_AD_CLOSE_NOTIFY))
  ------------------
  |  | 1209|      3|#define SSL_AD_CLOSE_NOTIFY SSL3_AD_CLOSE_NOTIFY
  |  |  ------------------
  |  |  |  |  252|      3|#define SSL3_AD_CLOSE_NOTIFY 0
  |  |  ------------------
  ------------------
  |  Branch (4929:9): [True: 3, False: 0]
  |  Branch (4929:51): [True: 3, False: 0]
  ------------------
 4930|      3|        return SSL_ERROR_ZERO_RETURN;
  ------------------
  |  | 1265|      3|#define SSL_ERROR_ZERO_RETURN 6
  ------------------
 4931|       |
 4932|      0|    return SSL_ERROR_SYSCALL;
  ------------------
  |  | 1263|      0|#define SSL_ERROR_SYSCALL 5 /* look at error stack/return \
  ------------------
 4933|      3|}
SSL_do_handshake:
 4948|  2.07k|{
 4949|  2.07k|    int ret = 1;
 4950|  2.07k|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  ------------------
  |  |   39|  2.07k|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|  2.07k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 2.07k]
  |  |  |  |  ------------------
  |  |  |  |   33|  2.07k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  2.07k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 2.07k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  2.07k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  2.07k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
 4951|       |
 4952|  2.07k|#ifndef OPENSSL_NO_QUIC
 4953|  2.07k|    if (IS_QUIC(s))
  ------------------
  |  |   96|  2.07k|    ((ssl) != NULL && SSL_TYPE_IS_QUIC((ssl)->type))
  |  |  ------------------
  |  |  |  | 1229|  2.07k|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1229:29): [True: 0, False: 2.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (96:6): [True: 2.07k, False: 0]
  |  |  ------------------
  ------------------
 4954|      0|        return ossl_quic_do_handshake(s);
 4955|  2.07k|#endif
 4956|       |
 4957|  2.07k|    if (sc == NULL)
  ------------------
  |  Branch (4957:9): [True: 0, False: 2.07k]
  ------------------
 4958|      0|        return -1;
 4959|       |
 4960|  2.07k|    if (sc->handshake_func == NULL) {
  ------------------
  |  Branch (4960:9): [True: 0, False: 2.07k]
  ------------------
 4961|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_CONNECTION_TYPE_NOT_SET);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 4962|      0|        return -1;
 4963|      0|    }
 4964|       |
 4965|  2.07k|    if (!ossl_statem_check_finish_init(sc, -1))
  ------------------
  |  Branch (4965:9): [True: 0, False: 2.07k]
  ------------------
 4966|      0|        return -1;
 4967|       |
 4968|  2.07k|    s->method->ssl_renegotiate_check(s, 0);
 4969|       |
 4970|  2.07k|    if (SSL_in_init(s) || SSL_in_before(s)) {
  ------------------
  |  Branch (4970:9): [True: 2.07k, False: 0]
  |  Branch (4970:27): [True: 0, False: 0]
  ------------------
 4971|  2.07k|        if ((sc->mode & SSL_MODE_ASYNC) && ASYNC_get_current_job() == NULL) {
  ------------------
  |  |  535|  2.07k|#define SSL_MODE_ASYNC 0x00000100U
  ------------------
  |  Branch (4971:13): [True: 0, False: 2.07k]
  |  Branch (4971:44): [True: 0, False: 0]
  ------------------
 4972|      0|            struct ssl_async_args args;
 4973|       |
 4974|      0|            memset(&args, 0, sizeof(args));
 4975|      0|            args.s = s;
 4976|       |
 4977|      0|            ret = ssl_start_async_job(s, &args, ssl_do_handshake_intern);
 4978|  2.07k|        } else {
 4979|  2.07k|            ret = sc->handshake_func(s);
 4980|  2.07k|        }
 4981|  2.07k|    }
 4982|       |
 4983|  2.07k|    return ret;
 4984|  2.07k|}
SSL_set_connect_state:
 5007|  1.77k|{
 5008|  1.77k|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s);
  ------------------
  |  |   23|  1.77k|    SSL_CONNECTION_FROM_SSL_ONLY_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   17|  1.77k|    ((ssl) == NULL ? NULL                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (17:6): [True: 0, False: 1.77k]
  |  |  |  |  ------------------
  |  |  |  |   18|  1.77k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  1.77k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:23): [True: 1.77k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   19|  1.77k|                             ? (c SSL_CONNECTION *)(ssl)     \
  |  |  |  |   20|  1.77k|                             : NULL))
  |  |  ------------------
  ------------------
 5009|       |
 5010|  1.77k|#ifndef OPENSSL_NO_QUIC
 5011|  1.77k|    if (IS_QUIC(s)) {
  ------------------
  |  |   96|  1.77k|    ((ssl) != NULL && SSL_TYPE_IS_QUIC((ssl)->type))
  |  |  ------------------
  |  |  |  | 1229|  1.77k|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1229:29): [True: 0, False: 1.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (96:6): [True: 1.77k, False: 0]
  |  |  ------------------
  ------------------
 5012|       |        /* We suppress errors because this is a void function */
 5013|      0|        (void)ossl_quic_set_connect_state(s, 0 /* suppress errors */);
 5014|      0|        return;
 5015|      0|    }
 5016|  1.77k|#endif
 5017|       |
 5018|  1.77k|    sc->server = 0;
 5019|  1.77k|    sc->shutdown = 0;
 5020|  1.77k|    ossl_statem_clear(sc);
 5021|  1.77k|    sc->handshake_func = s->method->ssl_connect;
 5022|       |    /* Ignore return value. Its a void public API function */
 5023|  1.77k|    RECORD_LAYER_reset(&sc->rlayer);
 5024|  1.77k|}
ssl_init_wbio_buffer:
 5336|  1.77k|{
 5337|  1.77k|    BIO *bbio;
 5338|       |
 5339|  1.77k|    if (s->bbio != NULL) {
  ------------------
  |  Branch (5339:9): [True: 0, False: 1.77k]
  ------------------
 5340|       |        /* Already buffered. */
 5341|      0|        return 1;
 5342|      0|    }
 5343|       |
 5344|  1.77k|    bbio = BIO_new(BIO_f_buffer());
 5345|  1.77k|    if (bbio == NULL || BIO_set_read_buffer_size(bbio, 1) <= 0) {
  ------------------
  |  |  625|  1.77k|#define BIO_set_read_buffer_size(b, size) BIO_int_ctrl(b, BIO_C_SET_BUFF_SIZE, size, 0)
  |  |  ------------------
  |  |  |  |  451|  1.77k|#define BIO_C_SET_BUFF_SIZE 117
  |  |  ------------------
  ------------------
  |  Branch (5345:9): [True: 0, False: 1.77k]
  |  Branch (5345:25): [True: 0, False: 1.77k]
  ------------------
 5346|      0|        BIO_free(bbio);
 5347|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_BUF_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 5348|      0|        return 0;
 5349|      0|    }
 5350|  1.77k|    s->bbio = bbio;
 5351|  1.77k|    s->wbio = BIO_push(bbio, s->wbio);
 5352|       |
 5353|  1.77k|    s->rlayer.wrlmethod->set1_bio(s->rlayer.wrl, s->wbio);
 5354|       |
 5355|  1.77k|    return 1;
 5356|  1.77k|}
ssl_free_wbio_buffer:
 5359|  8.85k|{
 5360|       |    /* callers ensure s is never null */
 5361|  8.85k|    if (s->bbio == NULL)
  ------------------
  |  Branch (5361:9): [True: 7.08k, False: 1.77k]
  ------------------
 5362|  7.08k|        return 1;
 5363|       |
 5364|  1.77k|    s->wbio = BIO_pop(s->wbio);
 5365|  1.77k|    s->rlayer.wrlmethod->set1_bio(s->rlayer.wrl, s->wbio);
 5366|       |
 5367|  1.77k|    BIO_free(s->bbio);
 5368|  1.77k|    s->bbio = NULL;
 5369|       |
 5370|  1.77k|    return 1;
 5371|  8.85k|}
SSL_version:
 5433|  6.10k|{
 5434|  6.10k|    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s);
  ------------------
  |  |   41|  6.10k|    SSL_CONNECTION_FROM_SSL_int(ssl, const)
  |  |  ------------------
  |  |  |  |   32|  6.10k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 6.10k]
  |  |  |  |  ------------------
  |  |  |  |   33|  6.10k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  6.10k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 6.10k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  6.10k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  6.10k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
 5435|       |
 5436|  6.10k|#ifndef OPENSSL_NO_QUIC
 5437|       |    /* We only support QUICv1 - so if its QUIC its QUICv1 */
 5438|  6.10k|    if (s->type == SSL_TYPE_QUIC_CONNECTION || s->type == SSL_TYPE_QUIC_XSO)
  ------------------
  |  | 1224|  12.2k|#define SSL_TYPE_QUIC_CONNECTION 0x80
  ------------------
                  if (s->type == SSL_TYPE_QUIC_CONNECTION || s->type == SSL_TYPE_QUIC_XSO)
  ------------------
  |  | 1225|  6.10k|#define SSL_TYPE_QUIC_XSO 0x81
  ------------------
  |  Branch (5438:9): [True: 0, False: 6.10k]
  |  Branch (5438:48): [True: 0, False: 6.10k]
  ------------------
 5439|      0|        return OSSL_QUIC1_VERSION;
  ------------------
  |  |   33|      0|#define OSSL_QUIC1_VERSION 0x0000001
  ------------------
 5440|  6.10k|#endif
 5441|  6.10k|    if (sc == NULL)
  ------------------
  |  Branch (5441:9): [True: 0, False: 6.10k]
  ------------------
 5442|      0|        return 0;
 5443|       |
 5444|  6.10k|    return sc->version;
 5445|  6.10k|}
SSL_get_verify_result:
 5648|      1|{
 5649|      1|    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(ssl);
  ------------------
  |  |   41|      1|    SSL_CONNECTION_FROM_SSL_int(ssl, const)
  |  |  ------------------
  |  |  |  |   32|      1|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |   33|      1|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|      1|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|      1|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|      1|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
 5650|       |
 5651|      1|    if (sc == NULL)
  ------------------
  |  Branch (5651:9): [True: 0, False: 1]
  ------------------
 5652|      0|        return 0;
 5653|       |
 5654|      1|    return sc->verify_result;
 5655|      1|}
SSL_set_ex_data:
 5710|  1.77k|{
 5711|  1.77k|    return CRYPTO_set_ex_data(&s->ex_data, idx, arg);
 5712|  1.77k|}
SSL_CTX_get_cert_store:
 5730|  2.99k|{
 5731|  2.99k|    return ctx->cert_store;
 5732|  2.99k|}
SSL_want:
 5749|    331|{
 5750|    331|    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s);
  ------------------
  |  |   41|    331|    SSL_CONNECTION_FROM_SSL_int(ssl, const)
  |  |  ------------------
  |  |  |  |   32|    331|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 331]
  |  |  |  |  ------------------
  |  |  |  |   33|    331|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|    331|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 331, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|    331|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|    331|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
 5751|       |
 5752|    331|#ifndef OPENSSL_NO_QUIC
 5753|    331|    if (IS_QUIC(s))
  ------------------
  |  |   96|    331|    ((ssl) != NULL && SSL_TYPE_IS_QUIC((ssl)->type))
  |  |  ------------------
  |  |  |  | 1229|    331|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1229:29): [True: 0, False: 331]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (96:6): [True: 331, False: 0]
  |  |  ------------------
  ------------------
 5754|      0|        return ossl_quic_want(s);
 5755|    331|#endif
 5756|       |
 5757|    331|    if (sc == NULL)
  ------------------
  |  Branch (5757:9): [True: 0, False: 331]
  ------------------
 5758|      0|        return SSL_NOTHING;
  ------------------
  |  |  932|      0|#define SSL_NOTHING 1
  ------------------
 5759|       |
 5760|    331|    return sc->rwstate;
 5761|    331|}
SSL_get_security_level:
 6143|   275k|{
 6144|   275k|    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s);
  ------------------
  |  |   41|   275k|    SSL_CONNECTION_FROM_SSL_int(ssl, const)
  |  |  ------------------
  |  |  |  |   32|   275k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 275k]
  |  |  |  |  ------------------
  |  |  |  |   33|   275k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|   275k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 275k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|   275k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|   275k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
 6145|       |
 6146|   275k|    if (sc == NULL)
  ------------------
  |  Branch (6146:9): [True: 0, False: 275k]
  ------------------
 6147|      0|        return 0;
 6148|       |
 6149|   275k|    return sc->cert->sec_level;
 6150|   275k|}
SSL_CTX_set_options:
 6257|  2.47k|{
 6258|  2.47k|    return ctx->options |= op;
 6259|  2.47k|}
SSL_set_ct_validation_callback:
 6529|  1.77k|{
 6530|  1.77k|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  ------------------
  |  |   39|  1.77k|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|  1.77k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 1.77k]
  |  |  |  |  ------------------
  |  |  |  |   33|  1.77k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  1.77k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 1.77k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  1.77k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  1.77k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
 6531|       |
 6532|  1.77k|    if (sc == NULL)
  ------------------
  |  Branch (6532:9): [True: 0, False: 1.77k]
  ------------------
 6533|      0|        return 0;
 6534|       |
 6535|       |    /*
 6536|       |     * Since code exists that uses the custom extension handler for CT, look
 6537|       |     * for this and throw an error if they have already registered to use CT.
 6538|       |     */
 6539|  1.77k|    if (callback != NULL && SSL_CTX_has_client_custom_ext(s->ctx, TLSEXT_TYPE_signed_certificate_timestamp)) {
  ------------------
  |  |  122|      0|#define TLSEXT_TYPE_signed_certificate_timestamp 18
  ------------------
  |  Branch (6539:9): [True: 0, False: 1.77k]
  |  Branch (6539:29): [True: 0, False: 0]
  ------------------
 6540|      0|        ERR_raise(ERR_LIB_SSL, SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 6541|      0|        return 0;
 6542|      0|    }
 6543|       |
 6544|  1.77k|    if (callback != NULL) {
  ------------------
  |  Branch (6544:9): [True: 0, False: 1.77k]
  ------------------
 6545|       |        /*
 6546|       |         * If we are validating CT, then we MUST accept SCTs served via OCSP
 6547|       |         */
 6548|      0|        if (!SSL_set_tlsext_status_type(s, TLSEXT_STATUSTYPE_ocsp))
  ------------------
  |  |  307|      0|    SSL_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE, type, NULL)
  |  |  ------------------
  |  |  |  | 1325|      0|#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE 65
  |  |  ------------------
  ------------------
  |  Branch (6548:13): [True: 0, False: 0]
  ------------------
 6549|      0|            return 0;
 6550|      0|    }
 6551|       |
 6552|  1.77k|    sc->ct_validation_callback = callback;
 6553|  1.77k|    sc->ct_validation_callback_arg = arg;
 6554|       |
 6555|  1.77k|    return 1;
 6556|  1.77k|}
ssl_get_max_send_fragment:
 7301|  6.95k|{
 7302|       |    /* Return any active Max Fragment Len extension */
 7303|  6.95k|    if (sc->session != NULL && USE_MAX_FRAGMENT_LENGTH_EXT(sc->session))
  ------------------
  |  |  296|  1.64k|    IS_MAX_FRAGMENT_LENGTH_EXT_VALID(session->ext.max_fragment_len_mode)
  |  |  ------------------
  |  |  |  |  294|  1.64k|    (((value) >= TLSEXT_max_fragment_length_512) && ((value) <= TLSEXT_max_fragment_length_4096))
  |  |  |  |  ------------------
  |  |  |  |  |  |  229|  1.64k|#define TLSEXT_max_fragment_length_512 1
  |  |  |  |  ------------------
  |  |  |  |                   (((value) >= TLSEXT_max_fragment_length_512) && ((value) <= TLSEXT_max_fragment_length_4096))
  |  |  |  |  ------------------
  |  |  |  |  |  |  232|  1.64k|#define TLSEXT_max_fragment_length_4096 4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:6): [True: 1.64k, False: 0]
  |  |  |  |  |  Branch (294:53): [True: 0, False: 1.64k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7303:9): [True: 1.64k, False: 5.31k]
  ------------------
 7304|      0|        return GET_MAX_FRAGMENT_LENGTH(sc->session);
  ------------------
  |  |  298|      0|    (512U << (session->ext.max_fragment_len_mode - 1))
  ------------------
 7305|       |
 7306|       |    /* return current SSL connection setting */
 7307|  6.95k|    return (unsigned int)sc->max_send_fragment;
 7308|  6.95k|}
ssl_get_split_send_fragment:
 7311|  1.64k|{
 7312|       |    /* Return a value regarding an active Max Fragment Len extension */
 7313|  1.64k|    if (sc->session != NULL && USE_MAX_FRAGMENT_LENGTH_EXT(sc->session)
  ------------------
  |  |  296|  1.64k|    IS_MAX_FRAGMENT_LENGTH_EXT_VALID(session->ext.max_fragment_len_mode)
  |  |  ------------------
  |  |  |  |  294|  3.28k|    (((value) >= TLSEXT_max_fragment_length_512) && ((value) <= TLSEXT_max_fragment_length_4096))
  |  |  |  |  ------------------
  |  |  |  |  |  |  229|  1.64k|#define TLSEXT_max_fragment_length_512 1
  |  |  |  |  ------------------
  |  |  |  |                   (((value) >= TLSEXT_max_fragment_length_512) && ((value) <= TLSEXT_max_fragment_length_4096))
  |  |  |  |  ------------------
  |  |  |  |  |  |  232|  1.64k|#define TLSEXT_max_fragment_length_4096 4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (294:6): [True: 1.64k, False: 0]
  |  |  |  |  |  Branch (294:53): [True: 0, False: 1.64k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7313:9): [True: 1.64k, False: 0]
  ------------------
 7314|      0|        && sc->split_send_fragment > GET_MAX_FRAGMENT_LENGTH(sc->session))
  ------------------
  |  |  298|      0|    (512U << (session->ext.max_fragment_len_mode - 1))
  ------------------
  |  Branch (7314:12): [True: 0, False: 0]
  ------------------
 7315|      0|        return GET_MAX_FRAGMENT_LENGTH(sc->session);
  ------------------
  |  |  298|      0|    (512U << (session->ext.max_fragment_len_mode - 1))
  ------------------
 7316|       |
 7317|       |    /* else limit |split_send_fragment| to current |max_send_fragment| */
 7318|  1.64k|    if (sc->split_send_fragment > sc->max_send_fragment)
  ------------------
  |  Branch (7318:9): [True: 0, False: 1.64k]
  ------------------
 7319|      0|        return (unsigned int)sc->max_send_fragment;
 7320|       |
 7321|       |    /* return current SSL connection setting */
 7322|  1.64k|    return (unsigned int)sc->split_send_fragment;
 7323|  1.64k|}
SSL_CTX_set_post_handshake_auth:
 7353|  1.83k|{
 7354|  1.83k|    ctx->pha_enabled = val;
 7355|  1.83k|}
ssl_evp_cipher_fetch:
 7461|  58.9k|{
 7462|  58.9k|    const EVP_CIPHER *ciph;
 7463|       |
 7464|  58.9k|    ciph = tls_get_cipher_from_engine(nid);
 7465|  58.9k|    if (ciph != NULL)
  ------------------
  |  Branch (7465:9): [True: 0, False: 58.9k]
  ------------------
 7466|      0|        return ciph;
 7467|       |
 7468|       |    /*
 7469|       |     * If there is no engine cipher then we do an explicit fetch. This may fail
 7470|       |     * and that could be ok
 7471|       |     */
 7472|  58.9k|    ERR_set_mark();
 7473|  58.9k|    ciph = EVP_CIPHER_fetch(libctx, OBJ_nid2sn(nid), properties);
 7474|  58.9k|    if (ciph != NULL) {
  ------------------
  |  Branch (7474:9): [True: 34.7k, False: 24.2k]
  ------------------
 7475|  34.7k|        OSSL_PARAM params[2];
 7476|  34.7k|        int decrypt_only = 0;
 7477|       |
 7478|  34.7k|        params[0] = OSSL_PARAM_construct_int(OSSL_CIPHER_PARAM_DECRYPT_ONLY,
  ------------------
  |  |  193|  34.7k|# define OSSL_CIPHER_PARAM_DECRYPT_ONLY "decrypt-only"
  ------------------
 7479|  34.7k|            &decrypt_only);
 7480|  34.7k|        params[1] = OSSL_PARAM_construct_end();
 7481|  34.7k|        if (EVP_CIPHER_get_params((EVP_CIPHER *)ciph, params)
  ------------------
  |  Branch (7481:13): [True: 34.7k, False: 0]
  ------------------
 7482|  34.7k|            && decrypt_only) {
  ------------------
  |  Branch (7482:16): [True: 0, False: 34.7k]
  ------------------
 7483|       |            /* If a cipher is decrypt-only, it is unusable */
 7484|      0|            EVP_CIPHER_free((EVP_CIPHER *)ciph);
 7485|       |            ciph = NULL;
 7486|      0|        }
 7487|  34.7k|    }
 7488|  58.9k|    ERR_pop_to_mark();
 7489|  58.9k|    return ciph;
 7490|  58.9k|}
ssl_evp_cipher_free:
 7506|  63.2k|{
 7507|  63.2k|    if (cipher == NULL)
  ------------------
  |  Branch (7507:9): [True: 28.5k, False: 34.7k]
  ------------------
 7508|  28.5k|        return;
 7509|       |
 7510|  34.7k|    if (EVP_CIPHER_get0_provider(cipher) != NULL) {
  ------------------
  |  Branch (7510:9): [True: 34.7k, False: 0]
  ------------------
 7511|       |        /*
 7512|       |         * The cipher was explicitly fetched and therefore it is safe to cast
 7513|       |         * away the const
 7514|       |         */
 7515|  34.7k|        EVP_CIPHER_free((EVP_CIPHER *)cipher);
 7516|  34.7k|    }
 7517|  34.7k|}
ssl_evp_md_fetch:
 7522|  40.8k|{
 7523|  40.8k|    const EVP_MD *md;
 7524|       |
 7525|  40.8k|    md = tls_get_digest_from_engine(nid);
 7526|  40.8k|    if (md != NULL)
  ------------------
  |  Branch (7526:9): [True: 0, False: 40.8k]
  ------------------
 7527|      0|        return md;
 7528|       |
 7529|       |    /* Otherwise we do an explicit fetch */
 7530|  40.8k|    ERR_set_mark();
 7531|  40.8k|    md = EVP_MD_fetch(libctx, OBJ_nid2sn(nid), properties);
 7532|  40.8k|    ERR_pop_to_mark();
 7533|  40.8k|    return md;
 7534|  40.8k|}
ssl_evp_md_free:
 7550|  42.7k|{
 7551|  42.7k|    if (md == NULL)
  ------------------
  |  Branch (7551:9): [True: 20.4k, False: 22.3k]
  ------------------
 7552|  20.4k|        return;
 7553|       |
 7554|  22.3k|    if (EVP_MD_get0_provider(md) != NULL) {
  ------------------
  |  Branch (7554:9): [True: 22.3k, False: 0]
  ------------------
 7555|       |        /*
 7556|       |         * The digest was explicitly fetched and therefore it is safe to cast
 7557|       |         * away the const
 7558|       |         */
 7559|  22.3k|        EVP_MD_free((EVP_MD *)md);
 7560|  22.3k|    }
 7561|  22.3k|}
ssl_lib.c:dane_final:
  169|  1.77k|{
  170|  1.77k|    sk_danetls_record_pop_free(dane->trecs, tlsa_free);
  171|  1.77k|    dane->trecs = NULL;
  172|       |
  173|  1.77k|    OSSL_STACK_OF_X509_free(dane->certs);
  174|  1.77k|    dane->certs = NULL;
  175|       |
  176|  1.77k|    X509_free(dane->mcert);
  177|  1.77k|    dane->mcert = NULL;
  178|       |    dane->mtlsa = NULL;
  179|  1.77k|    dane->mdpth = -1;
  180|  1.77k|    dane->pdpth = -1;
  181|  1.77k|}
ssl_lib.c:ssl_check_allowed_versions:
  450|  4.95k|{
  451|  4.95k|    int minisdtls = 0, maxisdtls = 0;
  452|       |
  453|       |    /* Figure out if we're doing DTLS versions or TLS versions */
  454|  4.95k|    if (min_version == DTLS1_BAD_VER
  ------------------
  |  |   30|  9.91k|#define DTLS1_BAD_VER 0x0100
  ------------------
  |  Branch (454:9): [True: 0, False: 4.95k]
  ------------------
  455|  4.95k|        || min_version >> 8 == DTLS1_VERSION_MAJOR)
  ------------------
  |  |   32|  4.95k|#define DTLS1_VERSION_MAJOR 0xFE
  ------------------
  |  Branch (455:12): [True: 0, False: 4.95k]
  ------------------
  456|      0|        minisdtls = 1;
  457|  4.95k|    if (max_version == DTLS1_BAD_VER
  ------------------
  |  |   30|  9.91k|#define DTLS1_BAD_VER 0x0100
  ------------------
  |  Branch (457:9): [True: 0, False: 4.95k]
  ------------------
  458|  4.95k|        || max_version >> 8 == DTLS1_VERSION_MAJOR)
  ------------------
  |  |   32|  4.95k|#define DTLS1_VERSION_MAJOR 0xFE
  ------------------
  |  Branch (458:12): [True: 0, False: 4.95k]
  ------------------
  459|      0|        maxisdtls = 1;
  460|       |    /* A wildcard version of 0 could be DTLS or TLS. */
  461|  4.95k|    if ((minisdtls && !maxisdtls && max_version != 0)
  ------------------
  |  Branch (461:10): [True: 0, False: 4.95k]
  |  Branch (461:23): [True: 0, False: 0]
  |  Branch (461:37): [True: 0, False: 0]
  ------------------
  462|  4.95k|        || (maxisdtls && !minisdtls && min_version != 0)) {
  ------------------
  |  Branch (462:13): [True: 0, False: 4.95k]
  |  Branch (462:26): [True: 0, False: 0]
  |  Branch (462:40): [True: 0, False: 0]
  ------------------
  463|       |        /* Mixing DTLS and TLS versions will lead to sadness; deny it. */
  464|      0|        return 0;
  465|      0|    }
  466|       |
  467|  4.95k|    if (minisdtls || maxisdtls) {
  ------------------
  |  Branch (467:9): [True: 0, False: 4.95k]
  |  Branch (467:22): [True: 0, False: 4.95k]
  ------------------
  468|       |        /* Do DTLS version checks. */
  469|      0|        if (min_version == 0)
  ------------------
  |  Branch (469:13): [True: 0, False: 0]
  ------------------
  470|       |            /* Ignore DTLS1_BAD_VER */
  471|      0|            min_version = DTLS1_VERSION;
  ------------------
  |  |   28|      0|#define DTLS1_VERSION 0xFEFF
  ------------------
  472|      0|        if (max_version == 0)
  ------------------
  |  Branch (472:13): [True: 0, False: 0]
  ------------------
  473|      0|            max_version = DTLS1_2_VERSION;
  ------------------
  |  |   29|      0|#define DTLS1_2_VERSION 0xFEFD
  ------------------
  474|       |#ifdef OPENSSL_NO_DTLS1_2
  475|       |        if (max_version == DTLS1_2_VERSION)
  476|       |            max_version = DTLS1_VERSION;
  477|       |#endif
  478|       |#ifdef OPENSSL_NO_DTLS1
  479|       |        if (min_version == DTLS1_VERSION)
  480|       |            min_version = DTLS1_2_VERSION;
  481|       |#endif
  482|       |        /* Done massaging versions; do the check. */
  483|      0|        if (0
  ------------------
  |  Branch (483:13): [Folded, False: 0]
  ------------------
  484|       |#ifdef OPENSSL_NO_DTLS1
  485|       |            || (DTLS_VERSION_GE(min_version, DTLS1_VERSION)
  486|       |                && DTLS_VERSION_GE(DTLS1_VERSION, max_version))
  487|       |#endif
  488|       |#ifdef OPENSSL_NO_DTLS1_2
  489|       |            || (DTLS_VERSION_GE(min_version, DTLS1_2_VERSION)
  490|       |                && DTLS_VERSION_GE(DTLS1_2_VERSION, max_version))
  491|       |#endif
  492|      0|        )
  493|      0|            return 0;
  494|  4.95k|    } else {
  495|       |        /* Regular TLS version checks. */
  496|  4.95k|        if (min_version == 0)
  ------------------
  |  Branch (496:13): [True: 0, False: 4.95k]
  ------------------
  497|      0|            min_version = SSL3_VERSION;
  ------------------
  |  |   23|      0|#define SSL3_VERSION 0x0300
  ------------------
  498|  4.95k|        if (max_version == 0)
  ------------------
  |  Branch (498:13): [True: 4.93k, False: 23]
  ------------------
  499|  4.93k|            max_version = TLS1_3_VERSION;
  ------------------
  |  |   27|  4.93k|#define TLS1_3_VERSION 0x0304
  ------------------
  500|       |#ifdef OPENSSL_NO_TLS1_3
  501|       |        if (max_version == TLS1_3_VERSION)
  502|       |            max_version = TLS1_2_VERSION;
  503|       |#endif
  504|       |#ifdef OPENSSL_NO_TLS1_2
  505|       |        if (max_version == TLS1_2_VERSION)
  506|       |            max_version = TLS1_1_VERSION;
  507|       |#endif
  508|       |#ifdef OPENSSL_NO_TLS1_1
  509|       |        if (max_version == TLS1_1_VERSION)
  510|       |            max_version = TLS1_VERSION;
  511|       |#endif
  512|       |#ifdef OPENSSL_NO_TLS1
  513|       |        if (max_version == TLS1_VERSION)
  514|       |            max_version = SSL3_VERSION;
  515|       |#endif
  516|       |#ifdef OPENSSL_NO_SSL3
  517|       |        if (min_version == SSL3_VERSION)
  518|       |            min_version = TLS1_VERSION;
  519|       |#endif
  520|       |#ifdef OPENSSL_NO_TLS1
  521|       |        if (min_version == TLS1_VERSION)
  522|       |            min_version = TLS1_1_VERSION;
  523|       |#endif
  524|       |#ifdef OPENSSL_NO_TLS1_1
  525|       |        if (min_version == TLS1_1_VERSION)
  526|       |            min_version = TLS1_2_VERSION;
  527|       |#endif
  528|       |#ifdef OPENSSL_NO_TLS1_2
  529|       |        if (min_version == TLS1_2_VERSION)
  530|       |            min_version = TLS1_3_VERSION;
  531|       |#endif
  532|       |        /* Done massaging versions; do the check. */
  533|  4.95k|        if (0
  ------------------
  |  Branch (533:13): [Folded, False: 4.95k]
  ------------------
  534|       |#ifdef OPENSSL_NO_SSL3
  535|       |            || (min_version <= SSL3_VERSION && SSL3_VERSION <= max_version)
  536|       |#endif
  537|       |#ifdef OPENSSL_NO_TLS1
  538|       |            || (min_version <= TLS1_VERSION && TLS1_VERSION <= max_version)
  539|       |#endif
  540|       |#ifdef OPENSSL_NO_TLS1_1
  541|       |            || (min_version <= TLS1_1_VERSION && TLS1_1_VERSION <= max_version)
  542|       |#endif
  543|       |#ifdef OPENSSL_NO_TLS1_2
  544|       |            || (min_version <= TLS1_2_VERSION && TLS1_2_VERSION <= max_version)
  545|       |#endif
  546|       |#ifdef OPENSSL_NO_TLS1_3
  547|       |            || (min_version <= TLS1_3_VERSION && TLS1_3_VERSION <= max_version)
  548|       |#endif
  549|  4.95k|        )
  550|      0|            return 0;
  551|  4.95k|    }
  552|  4.95k|    return 1;
  553|  4.95k|}
ssl_lib.c:cipher_list_tls12_num:
 3351|    529|{
 3352|    529|    int i, num = 0;
 3353|    529|    const SSL_CIPHER *c;
 3354|       |
 3355|    529|    if (sk == NULL)
  ------------------
  |  Branch (3355:9): [True: 0, False: 529]
  ------------------
 3356|      0|        return 0;
 3357|  14.9k|    for (i = 0; i < sk_SSL_CIPHER_num(sk); ++i) {
  ------------------
  |  | 1005|  14.9k|#define sk_SSL_CIPHER_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_CIPHER_sk_type(sk))
  ------------------
  |  Branch (3357:17): [True: 14.4k, False: 529]
  ------------------
 3358|  14.4k|        c = sk_SSL_CIPHER_value(sk, i);
  ------------------
  |  | 1006|  14.4k|#define sk_SSL_CIPHER_value(sk, idx) ((const SSL_CIPHER *)OPENSSL_sk_value(ossl_check_const_SSL_CIPHER_sk_type(sk), (idx)))
  ------------------
 3359|  14.4k|        if (c->min_tls >= TLS1_3_VERSION)
  ------------------
  |  |   27|  14.4k|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (3359:13): [True: 1.58k, False: 12.8k]
  ------------------
 3360|  1.58k|            continue;
 3361|  12.8k|        num++;
 3362|  12.8k|    }
 3363|    529|    return num;
 3364|    529|}
ssl_lib.c:alpn_value_ok:
 3703|    415|{
 3704|    415|    unsigned int idx;
 3705|       |
 3706|    415|    if (protos_len < 2 || protos == NULL)
  ------------------
  |  Branch (3706:9): [True: 0, False: 415]
  |  Branch (3706:27): [True: 0, False: 415]
  ------------------
 3707|      0|        return 0;
 3708|       |
 3709|  1.21k|    for (idx = 0; idx < protos_len; idx += protos[idx] + 1) {
  ------------------
  |  Branch (3709:19): [True: 796, False: 415]
  ------------------
 3710|    796|        if (protos[idx] == 0)
  ------------------
  |  Branch (3710:13): [True: 0, False: 796]
  ------------------
 3711|      0|            return 0;
 3712|    796|    }
 3713|    415|    return idx == protos_len;
 3714|    415|}
ssl_lib.c:ssl_session_hash:
 3855|     38|{
 3856|     38|    const unsigned char *session_id = a->session_id;
 3857|     38|    unsigned long l;
 3858|     38|    unsigned char tmp_storage[4];
 3859|       |
 3860|     38|    if (a->session_id_length < sizeof(tmp_storage)) {
  ------------------
  |  Branch (3860:9): [True: 4, False: 34]
  ------------------
 3861|      4|        memset(tmp_storage, 0, sizeof(tmp_storage));
 3862|      4|        memcpy(tmp_storage, a->session_id, a->session_id_length);
 3863|      4|        session_id = tmp_storage;
 3864|      4|    }
 3865|       |
 3866|     38|    l = (unsigned long)((unsigned long)session_id[0]) | ((unsigned long)session_id[1] << 8L) | ((unsigned long)session_id[2] << 16L) | ((unsigned long)session_id[3] << 24L);
 3867|     38|    return l;
 3868|     38|}
ssl_lib.c:dane_ctx_final:
  150|  2.56k|{
  151|  2.56k|    OPENSSL_free(dctx->mdevp);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  152|  2.56k|    dctx->mdevp = NULL;
  153|       |
  154|  2.56k|    OPENSSL_free(dctx->mdord);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  155|       |    dctx->mdord = NULL;
  156|  2.56k|    dctx->mdmax = 0;
  157|  2.56k|}

TLS_client_method:
 2347|  2.56k|    {                                                                      \
 2348|  2.56k|        static const SSL_METHOD func_name##_data = {                       \
 2349|  2.56k|            version,                                                       \
 2350|  2.56k|            flags,                                                         \
 2351|  2.56k|            mask,                                                          \
 2352|  2.56k|            ossl_ssl_connection_new,                                       \
 2353|  2.56k|            ossl_ssl_connection_free,                                      \
 2354|  2.56k|            ossl_ssl_connection_reset,                                     \
 2355|  2.56k|            tls1_new,                                                      \
 2356|  2.56k|            tls1_clear,                                                    \
 2357|  2.56k|            tls1_free,                                                     \
 2358|  2.56k|            s_accept,                                                      \
 2359|  2.56k|            s_connect,                                                     \
 2360|  2.56k|            ssl3_read,                                                     \
 2361|  2.56k|            ssl3_peek,                                                     \
 2362|  2.56k|            ssl3_write,                                                    \
 2363|  2.56k|            ssl3_shutdown,                                                 \
 2364|  2.56k|            ssl3_renegotiate,                                              \
 2365|  2.56k|            ssl3_renegotiate_check,                                        \
 2366|  2.56k|            ssl3_read_bytes,                                               \
 2367|  2.56k|            ssl3_write_bytes,                                              \
 2368|  2.56k|            ssl3_dispatch_alert,                                           \
 2369|  2.56k|            ssl3_ctrl,                                                     \
 2370|  2.56k|            ssl3_ctx_ctrl,                                                 \
 2371|  2.56k|            ssl3_get_cipher_by_char,                                       \
 2372|  2.56k|            ssl3_put_cipher_by_char,                                       \
 2373|  2.56k|            ssl3_pending,                                                  \
 2374|  2.56k|            ssl3_num_ciphers,                                              \
 2375|  2.56k|            ssl3_get_cipher,                                               \
 2376|  2.56k|            tls1_default_timeout,                                          \
 2377|  2.56k|            &enc_data,                                                     \
 2378|  2.56k|            ssl_undefined_void_function,                                   \
 2379|  2.56k|            ssl3_callback_ctrl,                                            \
 2380|  2.56k|            ssl3_ctx_callback_ctrl,                                        \
 2381|  2.56k|        };                                                                 \
 2382|  2.56k|        return &func_name##_data;                                          \
 2383|  2.56k|    }
tlsv1_3_client_method:
 2347|  15.5k|    {                                                                      \
 2348|  15.5k|        static const SSL_METHOD func_name##_data = {                       \
 2349|  15.5k|            version,                                                       \
 2350|  15.5k|            flags,                                                         \
 2351|  15.5k|            mask,                                                          \
 2352|  15.5k|            ossl_ssl_connection_new,                                       \
 2353|  15.5k|            ossl_ssl_connection_free,                                      \
 2354|  15.5k|            ossl_ssl_connection_reset,                                     \
 2355|  15.5k|            tls1_new,                                                      \
 2356|  15.5k|            tls1_clear,                                                    \
 2357|  15.5k|            tls1_free,                                                     \
 2358|  15.5k|            s_accept,                                                      \
 2359|  15.5k|            s_connect,                                                     \
 2360|  15.5k|            ssl3_read,                                                     \
 2361|  15.5k|            ssl3_peek,                                                     \
 2362|  15.5k|            ssl3_write,                                                    \
 2363|  15.5k|            ssl3_shutdown,                                                 \
 2364|  15.5k|            ssl3_renegotiate,                                              \
 2365|  15.5k|            ssl3_renegotiate_check,                                        \
 2366|  15.5k|            ssl3_read_bytes,                                               \
 2367|  15.5k|            ssl3_write_bytes,                                              \
 2368|  15.5k|            ssl3_dispatch_alert,                                           \
 2369|  15.5k|            ssl3_ctrl,                                                     \
 2370|  15.5k|            ssl3_ctx_ctrl,                                                 \
 2371|  15.5k|            ssl3_get_cipher_by_char,                                       \
 2372|  15.5k|            ssl3_put_cipher_by_char,                                       \
 2373|  15.5k|            ssl3_pending,                                                  \
 2374|  15.5k|            ssl3_num_ciphers,                                              \
 2375|  15.5k|            ssl3_get_cipher,                                               \
 2376|  15.5k|            tls1_default_timeout,                                          \
 2377|  15.5k|            &enc_data,                                                     \
 2378|  15.5k|            ssl_undefined_void_function,                                   \
 2379|  15.5k|            ssl3_callback_ctrl,                                            \
 2380|  15.5k|            ssl3_ctx_callback_ctrl,                                        \
 2381|  15.5k|        };                                                                 \
 2382|  15.5k|        return &func_name##_data;                                          \
 2383|  15.5k|    }
tlsv1_2_client_method:
 2347|  15.5k|    {                                                                      \
 2348|  15.5k|        static const SSL_METHOD func_name##_data = {                       \
 2349|  15.5k|            version,                                                       \
 2350|  15.5k|            flags,                                                         \
 2351|  15.5k|            mask,                                                          \
 2352|  15.5k|            ossl_ssl_connection_new,                                       \
 2353|  15.5k|            ossl_ssl_connection_free,                                      \
 2354|  15.5k|            ossl_ssl_connection_reset,                                     \
 2355|  15.5k|            tls1_new,                                                      \
 2356|  15.5k|            tls1_clear,                                                    \
 2357|  15.5k|            tls1_free,                                                     \
 2358|  15.5k|            s_accept,                                                      \
 2359|  15.5k|            s_connect,                                                     \
 2360|  15.5k|            ssl3_read,                                                     \
 2361|  15.5k|            ssl3_peek,                                                     \
 2362|  15.5k|            ssl3_write,                                                    \
 2363|  15.5k|            ssl3_shutdown,                                                 \
 2364|  15.5k|            ssl3_renegotiate,                                              \
 2365|  15.5k|            ssl3_renegotiate_check,                                        \
 2366|  15.5k|            ssl3_read_bytes,                                               \
 2367|  15.5k|            ssl3_write_bytes,                                              \
 2368|  15.5k|            ssl3_dispatch_alert,                                           \
 2369|  15.5k|            ssl3_ctrl,                                                     \
 2370|  15.5k|            ssl3_ctx_ctrl,                                                 \
 2371|  15.5k|            ssl3_get_cipher_by_char,                                       \
 2372|  15.5k|            ssl3_put_cipher_by_char,                                       \
 2373|  15.5k|            ssl3_pending,                                                  \
 2374|  15.5k|            ssl3_num_ciphers,                                              \
 2375|  15.5k|            ssl3_get_cipher,                                               \
 2376|  15.5k|            tls1_default_timeout,                                          \
 2377|  15.5k|            &enc_data,                                                     \
 2378|  15.5k|            ssl_undefined_void_function,                                   \
 2379|  15.5k|            ssl3_callback_ctrl,                                            \
 2380|  15.5k|            ssl3_ctx_callback_ctrl,                                        \
 2381|  15.5k|        };                                                                 \
 2382|  15.5k|        return &func_name##_data;                                          \
 2383|  15.5k|    }
tlsv1_1_client_method:
 2347|  15.5k|    {                                                                      \
 2348|  15.5k|        static const SSL_METHOD func_name##_data = {                       \
 2349|  15.5k|            version,                                                       \
 2350|  15.5k|            flags,                                                         \
 2351|  15.5k|            mask,                                                          \
 2352|  15.5k|            ossl_ssl_connection_new,                                       \
 2353|  15.5k|            ossl_ssl_connection_free,                                      \
 2354|  15.5k|            ossl_ssl_connection_reset,                                     \
 2355|  15.5k|            tls1_new,                                                      \
 2356|  15.5k|            tls1_clear,                                                    \
 2357|  15.5k|            tls1_free,                                                     \
 2358|  15.5k|            s_accept,                                                      \
 2359|  15.5k|            s_connect,                                                     \
 2360|  15.5k|            ssl3_read,                                                     \
 2361|  15.5k|            ssl3_peek,                                                     \
 2362|  15.5k|            ssl3_write,                                                    \
 2363|  15.5k|            ssl3_shutdown,                                                 \
 2364|  15.5k|            ssl3_renegotiate,                                              \
 2365|  15.5k|            ssl3_renegotiate_check,                                        \
 2366|  15.5k|            ssl3_read_bytes,                                               \
 2367|  15.5k|            ssl3_write_bytes,                                              \
 2368|  15.5k|            ssl3_dispatch_alert,                                           \
 2369|  15.5k|            ssl3_ctrl,                                                     \
 2370|  15.5k|            ssl3_ctx_ctrl,                                                 \
 2371|  15.5k|            ssl3_get_cipher_by_char,                                       \
 2372|  15.5k|            ssl3_put_cipher_by_char,                                       \
 2373|  15.5k|            ssl3_pending,                                                  \
 2374|  15.5k|            ssl3_num_ciphers,                                              \
 2375|  15.5k|            ssl3_get_cipher,                                               \
 2376|  15.5k|            tls1_default_timeout,                                          \
 2377|  15.5k|            &enc_data,                                                     \
 2378|  15.5k|            ssl_undefined_void_function,                                   \
 2379|  15.5k|            ssl3_callback_ctrl,                                            \
 2380|  15.5k|            ssl3_ctx_callback_ctrl,                                        \
 2381|  15.5k|        };                                                                 \
 2382|  15.5k|        return &func_name##_data;                                          \
 2383|  15.5k|    }
tlsv1_client_method:
 2347|  15.5k|    {                                                                      \
 2348|  15.5k|        static const SSL_METHOD func_name##_data = {                       \
 2349|  15.5k|            version,                                                       \
 2350|  15.5k|            flags,                                                         \
 2351|  15.5k|            mask,                                                          \
 2352|  15.5k|            ossl_ssl_connection_new,                                       \
 2353|  15.5k|            ossl_ssl_connection_free,                                      \
 2354|  15.5k|            ossl_ssl_connection_reset,                                     \
 2355|  15.5k|            tls1_new,                                                      \
 2356|  15.5k|            tls1_clear,                                                    \
 2357|  15.5k|            tls1_free,                                                     \
 2358|  15.5k|            s_accept,                                                      \
 2359|  15.5k|            s_connect,                                                     \
 2360|  15.5k|            ssl3_read,                                                     \
 2361|  15.5k|            ssl3_peek,                                                     \
 2362|  15.5k|            ssl3_write,                                                    \
 2363|  15.5k|            ssl3_shutdown,                                                 \
 2364|  15.5k|            ssl3_renegotiate,                                              \
 2365|  15.5k|            ssl3_renegotiate_check,                                        \
 2366|  15.5k|            ssl3_read_bytes,                                               \
 2367|  15.5k|            ssl3_write_bytes,                                              \
 2368|  15.5k|            ssl3_dispatch_alert,                                           \
 2369|  15.5k|            ssl3_ctrl,                                                     \
 2370|  15.5k|            ssl3_ctx_ctrl,                                                 \
 2371|  15.5k|            ssl3_get_cipher_by_char,                                       \
 2372|  15.5k|            ssl3_put_cipher_by_char,                                       \
 2373|  15.5k|            ssl3_pending,                                                  \
 2374|  15.5k|            ssl3_num_ciphers,                                              \
 2375|  15.5k|            ssl3_get_cipher,                                               \
 2376|  15.5k|            tls1_default_timeout,                                          \
 2377|  15.5k|            &enc_data,                                                     \
 2378|  15.5k|            ssl_undefined_void_function,                                   \
 2379|  15.5k|            ssl3_callback_ctrl,                                            \
 2380|  15.5k|            ssl3_ctx_callback_ctrl,                                        \
 2381|  15.5k|        };                                                                 \
 2382|  15.5k|        return &func_name##_data;                                          \
 2383|  15.5k|    }
sslv3_client_method:
 2387|  15.5k|    {                                                            \
 2388|  15.5k|        static const SSL_METHOD func_name##_data = {             \
 2389|  15.5k|            SSL3_VERSION,                                        \
  ------------------
  |  |   23|  15.5k|#define SSL3_VERSION 0x0300
  ------------------
 2390|  15.5k|            SSL_METHOD_NO_FIPS | SSL_METHOD_NO_SUITEB,           \
  ------------------
  |  | 2341|  15.5k|#define SSL_METHOD_NO_FIPS (1U << 0)
  ------------------
                          SSL_METHOD_NO_FIPS | SSL_METHOD_NO_SUITEB,           \
  ------------------
  |  | 2342|  15.5k|#define SSL_METHOD_NO_SUITEB (1U << 1)
  ------------------
 2391|  15.5k|            SSL_OP_NO_SSLv3,                                     \
  ------------------
  |  |  428|  15.5k|#define SSL_OP_NO_SSLv3 SSL_OP_BIT(25)
  |  |  ------------------
  |  |  |  |  350|  15.5k|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
 2392|  15.5k|            ossl_ssl_connection_new,                             \
 2393|  15.5k|            ossl_ssl_connection_free,                            \
 2394|  15.5k|            ossl_ssl_connection_reset,                           \
 2395|  15.5k|            ssl3_new,                                            \
 2396|  15.5k|            ssl3_clear,                                          \
 2397|  15.5k|            ssl3_free,                                           \
 2398|  15.5k|            s_accept,                                            \
 2399|  15.5k|            s_connect,                                           \
 2400|  15.5k|            ssl3_read,                                           \
 2401|  15.5k|            ssl3_peek,                                           \
 2402|  15.5k|            ssl3_write,                                          \
 2403|  15.5k|            ssl3_shutdown,                                       \
 2404|  15.5k|            ssl3_renegotiate,                                    \
 2405|  15.5k|            ssl3_renegotiate_check,                              \
 2406|  15.5k|            ssl3_read_bytes,                                     \
 2407|  15.5k|            ssl3_write_bytes,                                    \
 2408|  15.5k|            ssl3_dispatch_alert,                                 \
 2409|  15.5k|            ssl3_ctrl,                                           \
 2410|  15.5k|            ssl3_ctx_ctrl,                                       \
 2411|  15.5k|            ssl3_get_cipher_by_char,                             \
 2412|  15.5k|            ssl3_put_cipher_by_char,                             \
 2413|  15.5k|            ssl3_pending,                                        \
 2414|  15.5k|            ssl3_num_ciphers,                                    \
 2415|  15.5k|            ssl3_get_cipher,                                     \
 2416|  15.5k|            ssl3_default_timeout,                                \
 2417|  15.5k|            &SSLv3_enc_data,                                     \
 2418|  15.5k|            ssl_undefined_void_function,                         \
 2419|  15.5k|            ssl3_callback_ctrl,                                  \
 2420|  15.5k|            ssl3_ctx_callback_ctrl,                              \
 2421|  15.5k|        };                                                       \
 2422|  15.5k|        return &func_name##_data;                                \
 2423|  15.5k|    }
statem_lib.c:ssl_tsan_counter:
 3074|  1.76k|{
 3075|  1.76k|    if (ssl_tsan_lock(ctx)) {
  ------------------
  |  Branch (3075:9): [True: 1.76k, False: 0]
  ------------------
 3076|       |        tsan_counter(stat);
  ------------------
  |  |  149|  1.76k|#define tsan_counter(ptr) tsan_add((ptr), 1)
  |  |  ------------------
  |  |  |  |   63|  1.76k|#define tsan_add(ptr, n) atomic_fetch_add_explicit((ptr), (n), memory_order_relaxed)
  |  |  ------------------
  ------------------
 3077|  1.76k|        ssl_tsan_unlock(ctx);
 3078|  1.76k|    }
 3079|  1.76k|}
statem_lib.c:ssl_tsan_lock:
 3057|  1.76k|{
 3058|       |#ifdef TSAN_REQUIRES_LOCKING
 3059|       |    if (!CRYPTO_THREAD_write_lock(ctx->tsan_lock))
 3060|       |        return 0;
 3061|       |#endif
 3062|  1.76k|    return 1;
 3063|  1.76k|}
statem_lib.c:ssl_tsan_unlock:
 3066|  1.76k|{
 3067|       |#ifdef TSAN_REQUIRES_LOCKING
 3068|       |    CRYPTO_THREAD_unlock(ctx->tsan_lock);
 3069|       |#endif
 3070|  1.76k|}

ssl_ctx_system_config:
  105|  2.47k|{
  106|  2.47k|    return ssl_do_config(NULL, ctx, NULL, 1);
  107|  2.47k|}
ssl_mcnf.c:ssl_do_config:
   24|  2.47k|{
   25|  2.47k|    SSL_CONF_CTX *cctx = NULL;
   26|  2.47k|    size_t i, idx, cmd_count;
   27|  2.47k|    int err = 1;
   28|  2.47k|    unsigned int flags;
   29|  2.47k|    unsigned int conf_diagnostics = 0;
   30|  2.47k|    const SSL_METHOD *meth;
   31|  2.47k|    const SSL_CONF_CMD *cmds;
   32|  2.47k|    OSSL_LIB_CTX *prev_libctx = NULL;
   33|  2.47k|    OSSL_LIB_CTX *libctx = NULL;
   34|       |
   35|  2.47k|    if (s == NULL && ctx == NULL) {
  ------------------
  |  Branch (35:9): [True: 2.47k, False: 0]
  |  Branch (35:22): [True: 0, False: 2.47k]
  ------------------
   36|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
   37|      0|        goto err;
   38|      0|    }
   39|       |
   40|  2.47k|    if (name == NULL && system)
  ------------------
  |  Branch (40:9): [True: 2.47k, False: 0]
  |  Branch (40:25): [True: 2.47k, False: 0]
  ------------------
   41|  2.47k|        name = "system_default";
   42|  2.47k|    if (!conf_ssl_name_find(name, &idx)) {
  ------------------
  |  Branch (42:9): [True: 2.47k, False: 0]
  ------------------
   43|  2.47k|        if (!system)
  ------------------
  |  Branch (43:13): [True: 0, False: 2.47k]
  ------------------
   44|      0|            ERR_raise_data(ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME,
  ------------------
  |  |   89|      0|#define ERR_LIB_SSL 20
  ------------------
                          ERR_raise_data(ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME,
  ------------------
  |  |  148|      0|#define SSL_R_INVALID_CONFIGURATION_NAME 113
  ------------------
   45|      0|                "name=%s", name);
   46|  2.47k|        goto err;
   47|  2.47k|    }
   48|      0|    cmds = conf_ssl_get(idx, &name, &cmd_count);
   49|      0|    cctx = SSL_CONF_CTX_new();
   50|      0|    if (cctx == NULL) {
  ------------------
  |  Branch (50:9): [True: 0, False: 0]
  ------------------
   51|       |        /* this is a fatal error, always report */
   52|      0|        system = 0;
   53|      0|        goto err;
   54|      0|    }
   55|      0|    flags = SSL_CONF_FLAG_FILE;
  ------------------
  |  |  604|      0|#define SSL_CONF_FLAG_FILE 0x2
  ------------------
   56|      0|    if (!system)
  ------------------
  |  Branch (56:9): [True: 0, False: 0]
  ------------------
   57|      0|        flags |= SSL_CONF_FLAG_CERTIFICATE | SSL_CONF_FLAG_REQUIRE_PRIVATE;
  ------------------
  |  |  608|      0|#define SSL_CONF_FLAG_CERTIFICATE 0x20
  ------------------
                      flags |= SSL_CONF_FLAG_CERTIFICATE | SSL_CONF_FLAG_REQUIRE_PRIVATE;
  ------------------
  |  |  609|      0|#define SSL_CONF_FLAG_REQUIRE_PRIVATE 0x40
  ------------------
   58|      0|    if (s != NULL) {
  ------------------
  |  Branch (58:9): [True: 0, False: 0]
  ------------------
   59|      0|        meth = s->method;
   60|      0|        SSL_CONF_CTX_set_ssl(cctx, s);
   61|      0|        libctx = s->ctx->libctx;
   62|      0|    } else {
   63|      0|        meth = ctx->method;
   64|      0|        SSL_CONF_CTX_set_ssl_ctx(cctx, ctx);
   65|      0|        libctx = ctx->libctx;
   66|      0|    }
   67|      0|    conf_diagnostics = OSSL_LIB_CTX_get_conf_diagnostics(libctx);
   68|      0|    if (conf_diagnostics)
  ------------------
  |  Branch (68:9): [True: 0, False: 0]
  ------------------
   69|      0|        flags |= SSL_CONF_FLAG_SHOW_ERRORS;
  ------------------
  |  |  607|      0|#define SSL_CONF_FLAG_SHOW_ERRORS 0x10
  ------------------
   70|      0|    if (meth->ssl_accept != ssl_undefined_function)
  ------------------
  |  Branch (70:9): [True: 0, False: 0]
  ------------------
   71|      0|        flags |= SSL_CONF_FLAG_SERVER;
  ------------------
  |  |  606|      0|#define SSL_CONF_FLAG_SERVER 0x8
  ------------------
   72|      0|    if (meth->ssl_connect != ssl_undefined_function)
  ------------------
  |  Branch (72:9): [True: 0, False: 0]
  ------------------
   73|      0|        flags |= SSL_CONF_FLAG_CLIENT;
  ------------------
  |  |  605|      0|#define SSL_CONF_FLAG_CLIENT 0x4
  ------------------
   74|      0|    SSL_CONF_CTX_set_flags(cctx, flags);
   75|      0|    prev_libctx = OSSL_LIB_CTX_set0_default(libctx);
   76|      0|    err = 0;
   77|      0|    for (i = 0; i < cmd_count; i++) {
  ------------------
  |  Branch (77:17): [True: 0, False: 0]
  ------------------
   78|      0|        char *cmdstr, *arg;
   79|      0|        int rv;
   80|       |
   81|      0|        conf_ssl_get_cmd(cmds, i, &cmdstr, &arg);
   82|      0|        rv = SSL_CONF_cmd(cctx, cmdstr, arg);
   83|      0|        if (rv <= 0)
  ------------------
  |  Branch (83:13): [True: 0, False: 0]
  ------------------
   84|      0|            ++err;
   85|      0|    }
   86|      0|    if (!SSL_CONF_CTX_finish(cctx))
  ------------------
  |  Branch (86:9): [True: 0, False: 0]
  ------------------
   87|      0|        ++err;
   88|  2.47k|err:
   89|  2.47k|    OSSL_LIB_CTX_set0_default(prev_libctx);
   90|  2.47k|    SSL_CONF_CTX_free(cctx);
   91|  2.47k|    return err == 0 || (system && !conf_diagnostics);
  ------------------
  |  Branch (91:12): [True: 0, False: 2.47k]
  |  Branch (91:25): [True: 2.47k, False: 0]
  |  Branch (91:35): [True: 2.47k, False: 0]
  ------------------
   92|      0|}

SSL_CTX_use_certificate_chain_file:
  590|     10|{
  591|       |    return use_certificate_chain_file(ctx, NULL, file);
  592|     10|}
ssl_rsa.c:use_certificate_chain_file:
  464|     10|{
  465|     10|    BIO *in = NULL;
  466|     10|    int ret = 0;
  467|     10|    X509 *x = NULL;
  468|     10|    pem_password_cb *passwd_callback;
  469|     10|    void *passwd_callback_userdata;
  470|     10|    SSL_CTX *real_ctx = (ssl == NULL) ? ctx : ssl->ctx;
  ------------------
  |  Branch (470:25): [True: 10, False: 0]
  ------------------
  471|       |
  472|     10|    if (ctx == NULL && ssl == NULL)
  ------------------
  |  Branch (472:9): [True: 0, False: 10]
  |  Branch (472:24): [True: 0, False: 0]
  ------------------
  473|      0|        return 0;
  474|       |
  475|     10|    ERR_clear_error(); /* clear error stack for
  476|       |                        * SSL_CTX_use_certificate() */
  477|       |
  478|     10|    if (ctx != NULL) {
  ------------------
  |  Branch (478:9): [True: 10, False: 0]
  ------------------
  479|     10|        passwd_callback = ctx->default_passwd_callback;
  480|     10|        passwd_callback_userdata = ctx->default_passwd_callback_userdata;
  481|     10|    } else {
  482|      0|        SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl);
  ------------------
  |  |   39|      0|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|      0|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   33|      0|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|      0|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|      0|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|      0|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
  483|       |
  484|      0|        if (sc == NULL)
  ------------------
  |  Branch (484:13): [True: 0, False: 0]
  ------------------
  485|      0|            return 0;
  486|       |
  487|      0|        passwd_callback = sc->default_passwd_callback;
  488|      0|        passwd_callback_userdata = sc->default_passwd_callback_userdata;
  489|      0|    }
  490|       |
  491|     10|    if (file == NULL) {
  ------------------
  |  Branch (491:9): [True: 0, False: 10]
  ------------------
  492|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  493|      0|        goto end;
  494|      0|    }
  495|       |
  496|     10|    in = BIO_new(BIO_s_file());
  497|     10|    if (in == NULL) {
  ------------------
  |  Branch (497:9): [True: 0, False: 10]
  ------------------
  498|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_BUF_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  499|      0|        goto end;
  500|      0|    }
  501|       |
  502|     10|    if (BIO_read_filename(in, file) <= 0) {
  ------------------
  |  |  586|     10|#define BIO_read_filename(b, name) (int)BIO_ctrl(b, BIO_C_SET_FILENAME, \
  |  |  ------------------
  |  |  |  |  442|     10|#define BIO_C_SET_FILENAME 108
  |  |  ------------------
  |  |  587|     10|    BIO_CLOSE | BIO_FP_READ, (char *)(name))
  |  |  ------------------
  |  |  |  |   85|     10|#define BIO_CLOSE 0x01
  |  |  ------------------
  |  |                   BIO_CLOSE | BIO_FP_READ, (char *)(name))
  |  |  ------------------
  |  |  |  |  217|     10|#define BIO_FP_READ 0x02
  |  |  ------------------
  ------------------
  |  Branch (502:9): [True: 7, False: 3]
  ------------------
  503|      7|        ERR_raise(ERR_LIB_SSL, ERR_R_SYS_LIB);
  ------------------
  |  |  404|      7|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      7|    (ERR_new(),                                                  \
  |  |  |  |  407|      7|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      7|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      7|        ERR_set_error)
  |  |  ------------------
  ------------------
  504|      7|        goto end;
  505|      7|    }
  506|       |
  507|      3|    x = X509_new_ex(real_ctx->libctx, real_ctx->propq);
  508|      3|    if (x == NULL) {
  ------------------
  |  Branch (508:9): [True: 0, False: 3]
  ------------------
  509|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_ASN1_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  510|      0|        goto end;
  511|      0|    }
  512|      3|    if (PEM_read_bio_X509_AUX(in, &x, passwd_callback,
  ------------------
  |  Branch (512:9): [True: 3, False: 0]
  ------------------
  513|      3|            passwd_callback_userdata)
  514|      3|        == NULL) {
  515|      3|        ERR_raise(ERR_LIB_SSL, ERR_R_PEM_LIB);
  ------------------
  |  |  404|      3|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      3|    (ERR_new(),                                                  \
  |  |  |  |  407|      3|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      3|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      3|        ERR_set_error)
  |  |  ------------------
  ------------------
  516|      3|        goto end;
  517|      3|    }
  518|       |
  519|      0|    if (ctx)
  ------------------
  |  Branch (519:9): [True: 0, False: 0]
  ------------------
  520|      0|        ret = SSL_CTX_use_certificate(ctx, x);
  521|      0|    else
  522|      0|        ret = SSL_use_certificate(ssl, x);
  523|       |
  524|      0|    if (ERR_peek_error() != 0)
  ------------------
  |  Branch (524:9): [True: 0, False: 0]
  ------------------
  525|      0|        ret = 0; /* Key/certificate mismatch doesn't imply
  526|       |                  * ret==0 ... */
  527|      0|    if (ret) {
  ------------------
  |  Branch (527:9): [True: 0, False: 0]
  ------------------
  528|       |        /*
  529|       |         * If we could set up our certificate, now proceed to the CA
  530|       |         * certificates.
  531|       |         */
  532|      0|        X509 *ca;
  533|      0|        int r;
  534|      0|        unsigned long err;
  535|       |
  536|      0|        if (ctx)
  ------------------
  |  Branch (536:13): [True: 0, False: 0]
  ------------------
  537|      0|            r = SSL_CTX_clear_chain_certs(ctx);
  ------------------
  |  | 1448|      0|    SSL_CTX_set0_chain(ctx, NULL)
  |  |  ------------------
  |  |  |  | 1438|      0|    SSL_CTX_ctrl(ctx, SSL_CTRL_CHAIN, 0, (char *)(sk))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1349|      0|#define SSL_CTRL_CHAIN 88
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  538|      0|        else
  539|      0|            r = SSL_clear_chain_certs(ssl);
  ------------------
  |  | 1478|      0|    SSL_set0_chain(s, NULL)
  |  |  ------------------
  |  |  |  | 1468|      0|    SSL_ctrl(s, SSL_CTRL_CHAIN, 0, (char *)(sk))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1349|      0|#define SSL_CTRL_CHAIN 88
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  540|       |
  541|      0|        if (r == 0) {
  ------------------
  |  Branch (541:13): [True: 0, False: 0]
  ------------------
  542|      0|            ret = 0;
  543|      0|            goto end;
  544|      0|        }
  545|       |
  546|      0|        while (1) {
  ------------------
  |  Branch (546:16): [True: 0, Folded]
  ------------------
  547|      0|            ca = X509_new_ex(real_ctx->libctx, real_ctx->propq);
  548|      0|            if (ca == NULL) {
  ------------------
  |  Branch (548:17): [True: 0, False: 0]
  ------------------
  549|      0|                ERR_raise(ERR_LIB_SSL, ERR_R_ASN1_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  550|      0|                goto end;
  551|      0|            }
  552|      0|            if (PEM_read_bio_X509(in, &ca, passwd_callback,
  ------------------
  |  Branch (552:17): [True: 0, False: 0]
  ------------------
  553|      0|                    passwd_callback_userdata)
  554|      0|                != NULL) {
  555|      0|                if (ctx)
  ------------------
  |  Branch (555:21): [True: 0, False: 0]
  ------------------
  556|      0|                    r = SSL_CTX_add0_chain_cert(ctx, ca);
  ------------------
  |  | 1442|      0|    SSL_CTX_ctrl(ctx, SSL_CTRL_CHAIN_CERT, 0, (char *)(x509))
  |  |  ------------------
  |  |  |  | 1350|      0|#define SSL_CTRL_CHAIN_CERT 89
  |  |  ------------------
  ------------------
  557|      0|                else
  558|      0|                    r = SSL_add0_chain_cert(ssl, ca);
  ------------------
  |  | 1472|      0|    SSL_ctrl(s, SSL_CTRL_CHAIN_CERT, 0, (char *)(x509))
  |  |  ------------------
  |  |  |  | 1350|      0|#define SSL_CTRL_CHAIN_CERT 89
  |  |  ------------------
  ------------------
  559|       |                /*
  560|       |                 * Note that we must not free ca if it was successfully added to
  561|       |                 * the chain (while we must free the main certificate, since its
  562|       |                 * reference count is increased by SSL_CTX_use_certificate).
  563|       |                 */
  564|      0|                if (!r) {
  ------------------
  |  Branch (564:21): [True: 0, False: 0]
  ------------------
  565|      0|                    X509_free(ca);
  566|      0|                    ret = 0;
  567|      0|                    goto end;
  568|      0|                }
  569|      0|            } else {
  570|      0|                X509_free(ca);
  571|      0|                break;
  572|      0|            }
  573|      0|        }
  574|       |        /* When the while loop ends, it's usually just EOF. */
  575|      0|        err = ERR_peek_last_error();
  576|      0|        if (ERR_GET_LIB(err) == ERR_LIB_PEM
  ------------------
  |  |   81|      0|#define ERR_LIB_PEM 9
  ------------------
  |  Branch (576:13): [True: 0, False: 0]
  ------------------
  577|      0|            && ERR_GET_REASON(err) == PEM_R_NO_START_LINE)
  ------------------
  |  |   44|      0|#define PEM_R_NO_START_LINE 108
  ------------------
  |  Branch (577:16): [True: 0, False: 0]
  ------------------
  578|      0|            ERR_clear_error();
  579|      0|        else
  580|      0|            ret = 0; /* some real error */
  581|      0|    }
  582|       |
  583|     10|end:
  584|     10|    X509_free(x);
  585|     10|    BIO_free(in);
  586|     10|    return ret;
  587|      0|}

ssl_session_calculate_timeout:
   49|  3.53k|{
   50|  3.53k|    ss->calc_timeout = ossl_time_add(ss->time, ss->timeout);
   51|  3.53k|}
SSL_SESSION_new:
  103|  1.76k|{
  104|  1.76k|    SSL_SESSION *ss;
  105|       |
  106|  1.76k|    if (!OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL))
  ------------------
  |  | 2822|  1.76k|#define OPENSSL_INIT_LOAD_SSL_STRINGS 0x00200000L
  ------------------
  |  Branch (106:9): [True: 0, False: 1.76k]
  ------------------
  107|      0|        return NULL;
  108|       |
  109|  1.76k|    ss = OPENSSL_zalloc(sizeof(*ss));
  ------------------
  |  |  108|  1.76k|    CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  110|  1.76k|    if (ss == NULL)
  ------------------
  |  Branch (110:9): [True: 0, False: 1.76k]
  ------------------
  111|      0|        return NULL;
  112|       |
  113|  1.76k|    ss->ext.max_fragment_len_mode = TLSEXT_max_fragment_length_UNSPECIFIED;
  ------------------
  |  |  234|  1.76k|#define TLSEXT_max_fragment_length_UNSPECIFIED 255
  ------------------
  114|  1.76k|    ss->verify_result = 1; /* avoid 0 (= X509_V_OK) just in case */
  115|       |    /* 5 minute timeout by default */
  116|  1.76k|    ss->timeout = ossl_seconds2time(60 * 5 + 4);
  ------------------
  |  |   42|  1.76k|#define ossl_seconds2time(s) ossl_ticks2time((s) * OSSL_TIME_SECOND)
  |  |  ------------------
  |  |  |  |   31|  1.76k|#define OSSL_TIME_SECOND ((uint64_t)1000000000)
  |  |  ------------------
  ------------------
  117|  1.76k|    ss->time = ossl_time_now();
  118|  1.76k|    ssl_session_calculate_timeout(ss);
  119|  1.76k|    if (!CRYPTO_NEW_REF(&ss->references, 1)) {
  ------------------
  |  Branch (119:9): [True: 0, False: 1.76k]
  ------------------
  120|      0|        OPENSSL_free(ss);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  121|      0|        return NULL;
  122|      0|    }
  123|       |
  124|  1.76k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_SSL_SESSION, ss, &ss->ex_data)) {
  ------------------
  |  |  252|  1.76k|#define CRYPTO_EX_INDEX_SSL_SESSION 2
  ------------------
  |  Branch (124:9): [True: 0, False: 1.76k]
  ------------------
  125|      0|        CRYPTO_FREE_REF(&ss->references);
  126|      0|        OPENSSL_free(ss);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  127|      0|        return NULL;
  128|      0|    }
  129|  1.76k|    return ss;
  130|  1.76k|}
ssl_get_new_session:
  436|  1.76k|{
  437|       |    /* This gets used by clients and servers. */
  438|       |
  439|  1.76k|    SSL_SESSION *ss = NULL;
  440|       |
  441|  1.76k|    if ((ss = SSL_SESSION_new()) == NULL) {
  ------------------
  |  Branch (441:9): [True: 0, False: 1.76k]
  ------------------
  442|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_SSL_LIB);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  443|      0|        return 0;
  444|      0|    }
  445|       |
  446|       |    /* If the context has a default timeout, use it */
  447|  1.76k|    if (ossl_time_is_zero(s->session_ctx->session_timeout))
  ------------------
  |  Branch (447:9): [True: 0, False: 1.76k]
  ------------------
  448|      0|        ss->timeout = SSL_CONNECTION_GET_SSL(s)->method->get_timeout();
  ------------------
  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
  449|  1.76k|    else
  450|  1.76k|        ss->timeout = s->session_ctx->session_timeout;
  451|  1.76k|    ssl_session_calculate_timeout(ss);
  452|       |
  453|  1.76k|    SSL_SESSION_free(s->session);
  454|  1.76k|    s->session = NULL;
  455|       |
  456|  1.76k|    if (session) {
  ------------------
  |  Branch (456:9): [True: 0, False: 1.76k]
  ------------------
  457|      0|        if (SSL_CONNECTION_IS_TLS13(s)) {
  ------------------
  |  |  265|      0|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 0, False: 0]
  |  |  ------------------
  |  |  266|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  267|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|      0|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  458|       |            /*
  459|       |             * We generate the session id while constructing the
  460|       |             * NewSessionTicket in TLSv1.3.
  461|       |             */
  462|      0|            ss->session_id_length = 0;
  463|      0|        } else if (!ssl_generate_session_id(s, ss)) {
  ------------------
  |  Branch (463:20): [True: 0, False: 0]
  ------------------
  464|       |            /* SSLfatal() already called */
  465|      0|            SSL_SESSION_free(ss);
  466|      0|            return 0;
  467|      0|        }
  468|       |
  469|  1.76k|    } else {
  470|  1.76k|        ss->session_id_length = 0;
  471|  1.76k|    }
  472|       |
  473|  1.76k|    if (s->sid_ctx_length > sizeof(ss->sid_ctx)) {
  ------------------
  |  Branch (473:9): [True: 0, False: 1.76k]
  ------------------
  474|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  475|      0|        SSL_SESSION_free(ss);
  476|      0|        return 0;
  477|      0|    }
  478|  1.76k|    memcpy(ss->sid_ctx, s->sid_ctx, s->sid_ctx_length);
  479|  1.76k|    ss->sid_ctx_length = s->sid_ctx_length;
  480|  1.76k|    s->session = ss;
  481|  1.76k|    ss->ssl_version = s->version;
  482|  1.76k|    ss->verify_result = X509_V_OK;
  ------------------
  |  |  312|  1.76k|#define X509_V_OK 0
  ------------------
  483|       |
  484|       |    /* If client supports extended master secret set it in session */
  485|  1.76k|    if (s->s3.flags & TLS1_FLAGS_RECEIVED_EXTMS)
  ------------------
  |  |  300|  1.76k|#define TLS1_FLAGS_RECEIVED_EXTMS 0x0200
  ------------------
  |  Branch (485:9): [True: 0, False: 1.76k]
  ------------------
  486|      0|        ss->flags |= SSL_SESS_FLAG_EXTMS;
  ------------------
  |  |  567|      0|#define SSL_SESS_FLAG_EXTMS 0x1
  ------------------
  487|       |
  488|  1.76k|    return 1;
  489|  1.76k|}
SSL_CTX_remove_session:
  811|  1.61k|{
  812|  1.61k|    return remove_session_lock(ctx, c, 1);
  813|  1.61k|}
SSL_SESSION_free:
  845|  10.4k|{
  846|  10.4k|    int i;
  847|       |
  848|  10.4k|    if (ss == NULL)
  ------------------
  |  Branch (848:9): [True: 8.70k, False: 1.76k]
  ------------------
  849|  8.70k|        return;
  850|  1.76k|    CRYPTO_DOWN_REF(&ss->references, &i);
  851|  1.76k|    REF_PRINT_COUNT("SSL_SESSION", i, ss);
  ------------------
  |  |  301|  1.76k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  1.76k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  297|  1.76k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  285|  1.76k|#define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  852|  1.76k|    if (i > 0)
  ------------------
  |  Branch (852:9): [True: 0, False: 1.76k]
  ------------------
  853|      0|        return;
  854|  1.76k|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|  1.76k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 1.76k]
  |  |  ------------------
  ------------------
  855|       |
  856|  1.76k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_SESSION, ss, &ss->ex_data);
  ------------------
  |  |  252|  1.76k|#define CRYPTO_EX_INDEX_SSL_SESSION 2
  ------------------
  857|       |
  858|  1.76k|    OPENSSL_cleanse(ss->master_key, sizeof(ss->master_key));
  859|  1.76k|    OPENSSL_cleanse(ss->session_id, sizeof(ss->session_id));
  860|  1.76k|    X509_free(ss->peer);
  861|  1.76k|    EVP_PKEY_free(ss->peer_rpk);
  862|  1.76k|    OSSL_STACK_OF_X509_free(ss->peer_chain);
  863|  1.76k|    OPENSSL_free(ss->ext.hostname);
  ------------------
  |  |  131|  1.76k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  864|  1.76k|    OPENSSL_free(ss->ext.tick);
  ------------------
  |  |  131|  1.76k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  865|  1.76k|#ifndef OPENSSL_NO_PSK
  866|  1.76k|    OPENSSL_free(ss->psk_identity_hint);
  ------------------
  |  |  131|  1.76k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  867|  1.76k|    OPENSSL_free(ss->psk_identity);
  ------------------
  |  |  131|  1.76k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  868|  1.76k|#endif
  869|  1.76k|#ifndef OPENSSL_NO_SRP
  870|  1.76k|    OPENSSL_free(ss->srp_username);
  ------------------
  |  |  131|  1.76k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  871|  1.76k|#endif
  872|  1.76k|    OPENSSL_free(ss->ext.alpn_selected);
  ------------------
  |  |  131|  1.76k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  873|  1.76k|    OPENSSL_free(ss->ticket_appdata);
  ------------------
  |  |  131|  1.76k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  874|  1.76k|    CRYPTO_FREE_REF(&ss->references);
  875|  1.76k|    OPENSSL_clear_free(ss, sizeof(*ss));
  ------------------
  |  |  129|  1.76k|    CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  876|  1.76k|}
SSL_CTX_flush_sessions_ex:
 1211|  2.56k|{
 1212|  2.56k|    STACK_OF(SSL_SESSION) *sk;
  ------------------
  |  |   33|  2.56k|#define STACK_OF(type) struct stack_st_##type
  ------------------
 1213|  2.56k|    SSL_SESSION *current;
 1214|  2.56k|    unsigned long i;
 1215|  2.56k|    const OSSL_TIME timeout = ossl_time_from_time_t(t);
 1216|       |
 1217|  2.56k|    if (!CRYPTO_THREAD_write_lock(s->lock))
  ------------------
  |  Branch (1217:9): [True: 0, False: 2.56k]
  ------------------
 1218|      0|        return;
 1219|       |
 1220|  2.56k|    sk = sk_SSL_SESSION_new_null();
 1221|  2.56k|    i = lh_SSL_SESSION_get_down_load(s->sessions);
 1222|  2.56k|    lh_SSL_SESSION_set_down_load(s->sessions, 0);
 1223|       |
 1224|       |    /*
 1225|       |     * Iterate over the list from the back (oldest), and stop
 1226|       |     * when a session can no longer be removed.
 1227|       |     * Add the session to a temporary list to be freed outside
 1228|       |     * the SSL_CTX lock.
 1229|       |     * But still do the remove_session_cb() within the lock.
 1230|       |     */
 1231|  2.56k|    while (s->session_cache_tail != NULL) {
  ------------------
  |  Branch (1231:12): [True: 0, False: 2.56k]
  ------------------
 1232|      0|        current = s->session_cache_tail;
 1233|      0|        if (t == 0 || sess_timedout(timeout, current)) {
  ------------------
  |  Branch (1233:13): [True: 0, False: 0]
  |  Branch (1233:23): [True: 0, False: 0]
  ------------------
 1234|      0|            lh_SSL_SESSION_delete(s->sessions, current);
 1235|      0|            SSL_SESSION_list_remove(s, current);
 1236|      0|            current->not_resumable = 1;
 1237|      0|            if (s->remove_session_cb != NULL)
  ------------------
  |  Branch (1237:17): [True: 0, False: 0]
  ------------------
 1238|      0|                s->remove_session_cb(s, current);
 1239|       |            /*
 1240|       |             * Throw the session on a stack, it's entirely plausible
 1241|       |             * that while freeing outside the critical section, the
 1242|       |             * session could be re-added, so avoid using the next/prev
 1243|       |             * pointers. If the stack failed to create, or the session
 1244|       |             * couldn't be put on the stack, just free it here
 1245|       |             */
 1246|      0|            if (sk == NULL || !sk_SSL_SESSION_push(sk, current))
  ------------------
  |  Branch (1246:17): [True: 0, False: 0]
  |  Branch (1246:31): [True: 0, False: 0]
  ------------------
 1247|      0|                SSL_SESSION_free(current);
 1248|      0|        } else {
 1249|      0|            break;
 1250|      0|        }
 1251|      0|    }
 1252|       |
 1253|  2.56k|    lh_SSL_SESSION_set_down_load(s->sessions, i);
 1254|  2.56k|    CRYPTO_THREAD_unlock(s->lock);
 1255|       |
 1256|  2.56k|    sk_SSL_SESSION_pop_free(sk, SSL_SESSION_free);
 1257|  2.56k|}
ssl_clear_bad_session:
 1260|  5.30k|{
 1261|  5.30k|    if ((s->session != NULL) && !(s->shutdown & SSL_SENT_SHUTDOWN) && !(SSL_in_init(SSL_CONNECTION_GET_SSL(s)) || SSL_in_before(SSL_CONNECTION_GET_SSL(s)))) {
  ------------------
  |  |  215|  1.76k|#define SSL_SENT_SHUTDOWN 1
  ------------------
                  if ((s->session != NULL) && !(s->shutdown & SSL_SENT_SHUTDOWN) && !(SSL_in_init(SSL_CONNECTION_GET_SSL(s)) || SSL_in_before(SSL_CONNECTION_GET_SSL(s)))) {
  ------------------
  |  |   27|  1.76k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
                  if ((s->session != NULL) && !(s->shutdown & SSL_SENT_SHUTDOWN) && !(SSL_in_init(SSL_CONNECTION_GET_SSL(s)) || SSL_in_before(SSL_CONNECTION_GET_SSL(s)))) {
  ------------------
  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
  |  Branch (1261:9): [True: 1.76k, False: 3.54k]
  |  Branch (1261:33): [True: 1.76k, False: 0]
  |  Branch (1261:73): [True: 1.76k, False: 0]
  |  Branch (1261:115): [True: 0, False: 0]
  ------------------
 1262|      0|        SSL_CTX_remove_session(s->session_ctx, s->session);
 1263|      0|        return 1;
 1264|      0|    } else
 1265|  5.30k|        return 0;
 1266|  5.30k|}
SSL_CTX_sess_set_new_cb:
 1350|  1.77k|{
 1351|  1.77k|    ctx->new_session_cb = cb;
 1352|  1.77k|}
ssl_sess.c:remove_session_lock:
  816|  1.61k|{
  817|  1.61k|    SSL_SESSION *r;
  818|  1.61k|    int ret = 0;
  819|       |
  820|  1.61k|    if ((c != NULL) && (c->session_id_length != 0)) {
  ------------------
  |  Branch (820:9): [True: 1.61k, False: 0]
  |  Branch (820:24): [True: 38, False: 1.57k]
  ------------------
  821|     38|        if (lck) {
  ------------------
  |  Branch (821:13): [True: 38, False: 0]
  ------------------
  822|     38|            if (!CRYPTO_THREAD_write_lock(ctx->lock))
  ------------------
  |  Branch (822:17): [True: 0, False: 38]
  ------------------
  823|      0|                return 0;
  824|     38|        }
  825|     38|        if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) != NULL) {
  ------------------
  |  Branch (825:13): [True: 0, False: 38]
  ------------------
  826|      0|            ret = 1;
  827|      0|            r = lh_SSL_SESSION_delete(ctx->sessions, r);
  828|      0|            SSL_SESSION_list_remove(ctx, r);
  829|      0|        }
  830|     38|        c->not_resumable = 1;
  831|       |
  832|     38|        if (lck)
  ------------------
  |  Branch (832:13): [True: 38, False: 0]
  ------------------
  833|     38|            CRYPTO_THREAD_unlock(ctx->lock);
  834|       |
  835|     38|        if (ctx->remove_session_cb != NULL)
  ------------------
  |  Branch (835:13): [True: 0, False: 38]
  ------------------
  836|      0|            ctx->remove_session_cb(ctx, c);
  837|       |
  838|     38|        if (ret)
  ------------------
  |  Branch (838:13): [True: 0, False: 38]
  ------------------
  839|      0|            SSL_SESSION_free(r);
  840|     38|    }
  841|  1.61k|    return ret;
  842|  1.61k|}

tls_validate_all_contexts:
  417|     41|{
  418|     41|    size_t i, num_exts, builtin_num = OSSL_NELEM(ext_defs), offset;
  ------------------
  |  |   14|     41|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  419|     41|    RAW_EXTENSION *thisext;
  420|     41|    unsigned int context;
  421|     41|    ENDPOINT role = ENDPOINT_BOTH;
  422|       |
  423|     41|    if ((thisctx & SSL_EXT_CLIENT_HELLO) != 0)
  ------------------
  |  |  299|     41|#define SSL_EXT_CLIENT_HELLO 0x00080
  ------------------
  |  Branch (423:9): [True: 0, False: 41]
  ------------------
  424|      0|        role = ENDPOINT_SERVER;
  425|     41|    else if ((thisctx & SSL_EXT_TLS1_2_SERVER_HELLO) != 0)
  ------------------
  |  |  301|     41|#define SSL_EXT_TLS1_2_SERVER_HELLO 0x00100
  ------------------
  |  Branch (425:14): [True: 41, False: 0]
  ------------------
  426|     41|        role = ENDPOINT_CLIENT;
  427|       |
  428|       |    /* Calculate the number of extensions in the extensions list */
  429|     41|    num_exts = builtin_num + s->cert->custext.meths_count;
  430|       |
  431|  1.22k|    for (thisext = exts, i = 0; i < num_exts; i++, thisext++) {
  ------------------
  |  Branch (431:33): [True: 1.18k, False: 40]
  ------------------
  432|  1.18k|        if (!thisext->present)
  ------------------
  |  Branch (432:13): [True: 1.12k, False: 55]
  ------------------
  433|  1.12k|            continue;
  434|       |
  435|     55|        if (i < builtin_num) {
  ------------------
  |  Branch (435:13): [True: 55, False: 0]
  ------------------
  436|     55|            context = ext_defs[i].context;
  437|     55|        } else {
  438|      0|            custom_ext_method *meth = NULL;
  439|       |
  440|      0|            meth = custom_ext_find(&s->cert->custext, role, thisext->type,
  441|      0|                &offset);
  442|      0|            if (!ossl_assert(meth != NULL))
  ------------------
  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|      0|    __FILE__, __LINE__)
  ------------------
  |  Branch (442:17): [True: 0, False: 0]
  ------------------
  443|      0|                return 0;
  444|      0|            context = meth->context;
  445|      0|        }
  446|       |
  447|     55|        if (!validate_context(s, context, thisctx))
  ------------------
  |  Branch (447:13): [True: 1, False: 54]
  ------------------
  448|      1|            return 0;
  449|     55|    }
  450|       |
  451|     40|    return 1;
  452|     41|}
extension_is_relevant:
  510|  48.8k|{
  511|  48.8k|    int is_tls13;
  512|       |
  513|       |    /*
  514|       |     * For HRR we haven't selected the version yet but we know it will be
  515|       |     * TLSv1.3
  516|       |     */
  517|  48.8k|    if ((thisctx & SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST) != 0)
  ------------------
  |  |  304|  48.8k|#define SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST 0x00800
  ------------------
  |  Branch (517:9): [True: 0, False: 48.8k]
  ------------------
  518|      0|        is_tls13 = 1;
  519|  48.8k|    else
  520|  48.8k|        is_tls13 = SSL_CONNECTION_IS_TLS13(s);
  ------------------
  |  |  265|  48.8k|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|  97.7k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  48.8k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|  48.8k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 48.8k, False: 0]
  |  |  ------------------
  |  |  266|  48.8k|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|  48.8k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|  97.7k|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 48.8k, False: 25]
  |  |  ------------------
  |  |  267|  48.8k|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|  48.8k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|  48.8k|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 48.8k]
  |  |  ------------------
  ------------------
  521|       |
  522|  48.8k|    if ((SSL_CONNECTION_IS_DTLS(s)
  ------------------
  |  |  258|  97.7k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  48.8k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  48.8k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 48.8k]
  |  |  ------------------
  ------------------
  523|      0|            && (extctx & SSL_EXT_TLS_IMPLEMENTATION_ONLY) != 0)
  ------------------
  |  |  290|      0|#define SSL_EXT_TLS_IMPLEMENTATION_ONLY 0x00004
  ------------------
  |  Branch (523:16): [True: 0, False: 0]
  ------------------
  524|  48.8k|        || (s->version == SSL3_VERSION
  ------------------
  |  |   23|  97.7k|#define SSL3_VERSION 0x0300
  ------------------
  |  Branch (524:13): [True: 1, False: 48.8k]
  ------------------
  525|      1|            && (extctx & SSL_EXT_SSL3_ALLOWED) == 0)
  ------------------
  |  |  292|      1|#define SSL_EXT_SSL3_ALLOWED 0x00008
  ------------------
  |  Branch (525:16): [True: 1, False: 0]
  ------------------
  526|       |        /*
  527|       |         * Note that SSL_IS_TLS13() means "TLS 1.3 has been negotiated",
  528|       |         * which is never true when generating the ClientHello.
  529|       |         * However, version negotiation *has* occurred by the time the
  530|       |         * ClientHello extensions are being parsed.
  531|       |         * Be careful to allow TLS 1.3-only extensions when generating
  532|       |         * the ClientHello.
  533|       |         */
  534|  48.8k|        || (is_tls13 && (extctx & SSL_EXT_TLS1_2_AND_BELOW_ONLY) != 0)
  ------------------
  |  |  294|      0|#define SSL_EXT_TLS1_2_AND_BELOW_ONLY 0x00010
  ------------------
  |  Branch (534:13): [True: 0, False: 48.8k]
  |  Branch (534:25): [True: 0, False: 0]
  ------------------
  535|  48.8k|        || (!is_tls13 && (extctx & SSL_EXT_TLS1_3_ONLY) != 0
  ------------------
  |  |  296|  48.8k|#define SSL_EXT_TLS1_3_ONLY 0x00020
  ------------------
  |  Branch (535:13): [True: 48.8k, False: 0]
  |  Branch (535:26): [True: 13.1k, False: 35.7k]
  ------------------
  536|  13.1k|            && (thisctx & SSL_EXT_CLIENT_HELLO) == 0)
  ------------------
  |  |  299|  13.1k|#define SSL_EXT_CLIENT_HELLO 0x00080
  ------------------
  |  Branch (536:16): [True: 0, False: 13.1k]
  ------------------
  537|  48.8k|        || (s->server && !is_tls13 && (extctx & SSL_EXT_TLS1_3_ONLY) != 0)
  ------------------
  |  |  296|      0|#define SSL_EXT_TLS1_3_ONLY 0x00020
  ------------------
  |  Branch (537:13): [True: 0, False: 48.8k]
  |  Branch (537:26): [True: 0, False: 0]
  |  Branch (537:39): [True: 0, False: 0]
  ------------------
  538|  48.8k|        || (s->hit && (extctx & SSL_EXT_IGNORE_ON_RESUMPTION) != 0))
  ------------------
  |  |  298|      0|#define SSL_EXT_IGNORE_ON_RESUMPTION 0x00040
  ------------------
  |  Branch (538:13): [True: 0, False: 48.8k]
  |  Branch (538:23): [True: 0, False: 0]
  ------------------
  539|      1|        return 0;
  540|  48.8k|    return 1;
  541|  48.8k|}
tls_collect_extensions:
  562|    115|{
  563|    115|    PACKET extensions = *packet;
  564|    115|    size_t i = 0;
  565|    115|    size_t num_exts;
  566|    115|    custom_ext_methods *exts = &s->cert->custext;
  567|    115|    RAW_EXTENSION *raw_extensions = NULL;
  568|    115|    const EXTENSION_DEFINITION *thisexd;
  569|       |
  570|    115|    *res = NULL;
  571|       |
  572|       |    /*
  573|       |     * Initialise server side custom extensions. Client side is done during
  574|       |     * construction of extensions for the ClientHello.
  575|       |     */
  576|    115|    if ((context & SSL_EXT_CLIENT_HELLO) != 0)
  ------------------
  |  |  299|    115|#define SSL_EXT_CLIENT_HELLO 0x00080
  ------------------
  |  Branch (576:9): [True: 0, False: 115]
  ------------------
  577|      0|        custom_ext_init(&s->cert->custext);
  578|       |
  579|    115|    num_exts = OSSL_NELEM(ext_defs) + (exts != NULL ? exts->meths_count : 0);
  ------------------
  |  |   14|    115|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (579:40): [True: 115, False: 0]
  ------------------
  580|    115|    raw_extensions = OPENSSL_calloc(num_exts, sizeof(*raw_extensions));
  ------------------
  |  |  112|    115|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  581|    115|    if (raw_extensions == NULL) {
  ------------------
  |  Branch (581:9): [True: 0, False: 115]
  ------------------
  582|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  583|      0|        return 0;
  584|      0|    }
  585|       |
  586|    115|    i = 0;
  587|    445|    while (PACKET_remaining(&extensions) > 0) {
  ------------------
  |  Branch (587:12): [True: 371, False: 74]
  ------------------
  588|    371|        unsigned int type, idx;
  589|    371|        PACKET extension;
  590|    371|        RAW_EXTENSION *thisex;
  591|       |
  592|    371|        if (!PACKET_get_net_2(&extensions, &type) || !PACKET_get_length_prefixed_2(&extensions, &extension)) {
  ------------------
  |  Branch (592:13): [True: 1, False: 370]
  |  Branch (592:54): [True: 17, False: 353]
  ------------------
  593|     18|            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
  ------------------
  |  |  148|     18|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|     18|    (ERR_new(),                                                  \
  |  |  |  |  151|     18|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|     18|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|     18|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  594|     18|            goto err;
  595|     18|        }
  596|       |        /*
  597|       |         * Verify this extension is allowed. We only check duplicates for
  598|       |         * extensions that we recognise. We also have a special case for the
  599|       |         * PSK extension, which must be the last one in the ClientHello.
  600|       |         */
  601|    353|        if (!verify_extension(s, context, type, exts, raw_extensions, &thisex)
  ------------------
  |  Branch (601:13): [True: 9, False: 344]
  ------------------
  602|    344|            || (thisex != NULL && thisex->present == 1)
  ------------------
  |  Branch (602:17): [True: 132, False: 212]
  |  Branch (602:35): [True: 6, False: 126]
  ------------------
  603|    338|            || (type == TLSEXT_TYPE_psk
  ------------------
  |  |  151|    676|#define TLSEXT_TYPE_psk 41
  ------------------
  |  Branch (603:17): [True: 1, False: 337]
  ------------------
  604|      1|                && (context & SSL_EXT_CLIENT_HELLO) != 0
  ------------------
  |  |  299|      1|#define SSL_EXT_CLIENT_HELLO 0x00080
  ------------------
  |  Branch (604:20): [True: 0, False: 1]
  ------------------
  605|     15|                && PACKET_remaining(&extensions) != 0)) {
  ------------------
  |  Branch (605:20): [True: 0, False: 0]
  ------------------
  606|     15|            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
  ------------------
  |  |  148|     15|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|     15|    (ERR_new(),                                                  \
  |  |  |  |  151|     15|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|     15|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|     15|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  607|     15|            goto err;
  608|     15|        }
  609|    338|        idx = (unsigned int)(thisex - raw_extensions);
  610|       |        /*-
  611|       |         * Check that we requested this extension (if appropriate). Requests can
  612|       |         * be sent in the ClientHello and CertificateRequest. Unsolicited
  613|       |         * extensions can be sent in the NewSessionTicket. We only do this for
  614|       |         * the built-in extensions. Custom extensions have a different but
  615|       |         * similar check elsewhere.
  616|       |         * Special cases:
  617|       |         * - The HRR cookie extension is unsolicited
  618|       |         * - The renegotiate extension is unsolicited (the client signals
  619|       |         *   support via an SCSV)
  620|       |         * - The signed_certificate_timestamp extension can be provided by a
  621|       |         * custom extension or by the built-in version. We let the extension
  622|       |         * itself handle unsolicited response checks.
  623|       |         */
  624|    338|        if (idx < OSSL_NELEM(ext_defs)
  ------------------
  |  |   14|    676|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (624:13): [True: 126, False: 212]
  ------------------
  625|    126|            && (context & (SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_CERTIFICATE_REQUEST | SSL_EXT_TLS1_3_NEW_SESSION_TICKET)) == 0
  ------------------
  |  |  299|    126|#define SSL_EXT_CLIENT_HELLO 0x00080
  ------------------
                          && (context & (SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_CERTIFICATE_REQUEST | SSL_EXT_TLS1_3_NEW_SESSION_TICKET)) == 0
  ------------------
  |  |  307|    126|#define SSL_EXT_TLS1_3_CERTIFICATE_REQUEST 0x04000
  ------------------
                          && (context & (SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_CERTIFICATE_REQUEST | SSL_EXT_TLS1_3_NEW_SESSION_TICKET)) == 0
  ------------------
  |  |  306|    126|#define SSL_EXT_TLS1_3_NEW_SESSION_TICKET 0x02000
  ------------------
  |  Branch (625:16): [True: 126, False: 0]
  ------------------
  626|    126|            && type != TLSEXT_TYPE_cookie
  ------------------
  |  |  154|    464|#define TLSEXT_TYPE_cookie 44
  ------------------
  |  Branch (626:16): [True: 126, False: 0]
  ------------------
  627|    126|            && type != TLSEXT_TYPE_renegotiate
  ------------------
  |  |  163|    464|#define TLSEXT_TYPE_renegotiate 0xff01
  ------------------
  |  Branch (627:16): [True: 109, False: 17]
  ------------------
  628|    109|            && type != TLSEXT_TYPE_signed_certificate_timestamp
  ------------------
  |  |  122|    447|#define TLSEXT_TYPE_signed_certificate_timestamp 18
  ------------------
  |  Branch (628:16): [True: 105, False: 4]
  ------------------
  629|    105|            && (s->ext.extflags[idx] & SSL_EXT_FLAG_SENT) == 0
  ------------------
  |  | 2068|    105|#define SSL_EXT_FLAG_SENT 0x2
  ------------------
  |  Branch (629:16): [True: 16, False: 89]
  ------------------
  630|     16|#ifndef OPENSSL_NO_GOST
  631|     16|            && !((context & SSL_EXT_TLS1_2_SERVER_HELLO) != 0
  ------------------
  |  |  301|     16|#define SSL_EXT_TLS1_2_SERVER_HELLO 0x00100
  ------------------
  |  Branch (631:18): [True: 16, False: 0]
  ------------------
  632|     16|                && type == TLSEXT_TYPE_cryptopro_bug)
  ------------------
  |  |  401|     16|#define TLSEXT_TYPE_cryptopro_bug 0xfde8
  ------------------
  |  Branch (632:20): [True: 8, False: 8]
  ------------------
  633|    338|#endif
  634|    338|        ) {
  635|      8|            SSLfatal(s, SSL_AD_UNSUPPORTED_EXTENSION,
  ------------------
  |  |  148|      8|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      8|    (ERR_new(),                                                  \
  |  |  |  |  151|      8|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      8|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      8|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  636|      8|                SSL_R_UNSOLICITED_EXTENSION);
  637|      8|            goto err;
  638|      8|        }
  639|    330|        if (thisex != NULL) {
  ------------------
  |  Branch (639:13): [True: 118, False: 212]
  ------------------
  640|    118|            thisex->data = extension;
  641|    118|            thisex->present = 1;
  642|    118|            thisex->type = type;
  643|    118|            thisex->received_order = i++;
  644|    118|            if (s->ext.debug_cb)
  ------------------
  |  Branch (644:17): [True: 0, False: 118]
  ------------------
  645|      0|                s->ext.debug_cb(SSL_CONNECTION_GET_USER_SSL(s), !s->server,
  ------------------
  |  |   28|      0|#define SSL_CONNECTION_GET_USER_SSL(sc) ((sc)->user_ssl)
  ------------------
  646|      0|                    thisex->type, PACKET_data(&thisex->data),
  647|      0|                    (int)PACKET_remaining(&thisex->data),
  648|      0|                    s->ext.debug_arg);
  649|    118|        }
  650|    330|    }
  651|       |
  652|     74|    if (init) {
  ------------------
  |  Branch (652:9): [True: 74, False: 0]
  ------------------
  653|       |        /*
  654|       |         * Initialise all known extensions relevant to this context,
  655|       |         * whether we have found them or not
  656|       |         */
  657|  2.22k|        for (thisexd = ext_defs, i = 0; i < OSSL_NELEM(ext_defs);
  ------------------
  |  |   14|  2.22k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (657:41): [True: 2.14k, False: 74]
  ------------------
  658|  2.14k|            i++, thisexd++) {
  659|  2.14k|            if (thisexd->init != NULL && (thisexd->context & context) != 0
  ------------------
  |  Branch (659:17): [True: 1.33k, False: 814]
  |  Branch (659:42): [True: 814, False: 518]
  ------------------
  660|    814|                && extension_is_relevant(s, thisexd->context, context)
  ------------------
  |  Branch (660:20): [True: 814, False: 0]
  ------------------
  661|    814|                && !thisexd->init(s, context)) {
  ------------------
  |  Branch (661:20): [True: 0, False: 814]
  ------------------
  662|       |                /* SSLfatal() already called */
  663|      0|                goto err;
  664|      0|            }
  665|  2.14k|        }
  666|     74|    }
  667|       |
  668|     74|    *res = raw_extensions;
  669|     74|    if (len != NULL)
  ------------------
  |  Branch (669:9): [True: 0, False: 74]
  ------------------
  670|      0|        *len = num_exts;
  671|     74|    return 1;
  672|       |
  673|     41|err:
  674|     41|    OPENSSL_free(raw_extensions);
  ------------------
  |  |  131|     41|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  675|     41|    return 0;
  676|     74|}
tls_parse_extension:
  690|    299|{
  691|    299|    RAW_EXTENSION *currext = &exts[idx];
  692|    299|    int (*parser)(SSL_CONNECTION *s, PACKET *pkt, unsigned int context, X509 *x,
  693|    299|        size_t chainidx)
  694|    299|        = NULL;
  695|       |
  696|       |    /* Skip if the extension is not present */
  697|    299|    if (!currext->present)
  ------------------
  |  Branch (697:9): [True: 269, False: 30]
  ------------------
  698|    269|        return 1;
  699|       |
  700|       |    /* Skip if we've already parsed this extension */
  701|     30|    if (currext->parsed)
  ------------------
  |  Branch (701:9): [True: 0, False: 30]
  ------------------
  702|      0|        return 1;
  703|       |
  704|     30|    currext->parsed = 1;
  705|       |
  706|     30|    if (idx < OSSL_NELEM(ext_defs)) {
  ------------------
  |  |   14|     30|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (706:9): [True: 30, False: 0]
  ------------------
  707|       |        /* We are handling a built-in extension */
  708|     30|        const EXTENSION_DEFINITION *extdef = &ext_defs[idx];
  709|       |
  710|       |        /* Check if extension is defined for our protocol. If not, skip */
  711|     30|        if (!extension_is_relevant(s, extdef->context, context))
  ------------------
  |  Branch (711:13): [True: 1, False: 29]
  ------------------
  712|      1|            return 1;
  713|       |
  714|     29|        parser = s->server ? extdef->parse_ctos : extdef->parse_stoc;
  ------------------
  |  Branch (714:18): [True: 0, False: 29]
  ------------------
  715|       |
  716|     29|        if (parser != NULL)
  ------------------
  |  Branch (716:13): [True: 24, False: 5]
  ------------------
  717|     24|            return parser(s, &currext->data, context, x, chainidx);
  718|       |
  719|       |        /*
  720|       |         * If the parser is NULL we fall through to the custom extension
  721|       |         * processing
  722|       |         */
  723|     29|    }
  724|       |
  725|       |    /* Parse custom extensions */
  726|      5|    return custom_ext_parse(s, context, currext->type,
  727|      5|        PACKET_data(&currext->data),
  728|      5|        PACKET_remaining(&currext->data),
  729|      5|        x, chainidx);
  730|     30|}
tls_parse_all_extensions:
  742|     16|{
  743|     16|    size_t i, numexts = OSSL_NELEM(ext_defs);
  ------------------
  |  |   14|     16|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  744|     16|    const EXTENSION_DEFINITION *thisexd;
  745|       |
  746|       |    /* Calculate the number of extensions in the extensions list */
  747|     16|    numexts += s->cert->custext.meths_count;
  748|       |
  749|       |    /* Parse each extension in turn */
  750|    230|    for (i = 0; i < numexts; i++) {
  ------------------
  |  Branch (750:17): [True: 225, False: 5]
  ------------------
  751|    225|        if (!tls_parse_extension(s, i, context, exts, x, chainidx)) {
  ------------------
  |  Branch (751:13): [True: 11, False: 214]
  ------------------
  752|       |            /* SSLfatal() already called */
  753|     11|            return 0;
  754|     11|        }
  755|    225|    }
  756|       |
  757|      5|    if (fin) {
  ------------------
  |  Branch (757:9): [True: 5, False: 0]
  ------------------
  758|       |        /*
  759|       |         * Finalise all known extensions relevant to this context,
  760|       |         * whether we have found them or not
  761|       |         */
  762|      5|        for (i = 0, thisexd = ext_defs; i < OSSL_NELEM(ext_defs);
  ------------------
  |  |   14|      5|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (762:41): [True: 5, False: 0]
  ------------------
  763|      5|            i++, thisexd++) {
  764|      5|            if (thisexd->final != NULL && (thisexd->context & context) != 0
  ------------------
  |  Branch (764:17): [True: 5, False: 0]
  |  Branch (764:43): [True: 5, False: 0]
  ------------------
  765|      5|                && !thisexd->final(s, context, exts[i].present)) {
  ------------------
  |  Branch (765:20): [True: 5, False: 0]
  ------------------
  766|       |                /* SSLfatal() already called */
  767|      5|                return 0;
  768|      5|            }
  769|      5|        }
  770|      5|    }
  771|       |
  772|      0|    return 1;
  773|      5|}
should_add_extension:
  777|  48.0k|{
  778|       |    /* Skip if not relevant for our context */
  779|  48.0k|    if ((extctx & thisctx) == 0)
  ------------------
  |  Branch (779:9): [True: 0, False: 48.0k]
  ------------------
  780|      0|        return 0;
  781|       |
  782|       |    /* Check if this extension is defined for our protocol. If not, skip */
  783|  48.0k|    if (!extension_is_relevant(s, extctx, thisctx)
  ------------------
  |  Branch (783:9): [True: 0, False: 48.0k]
  ------------------
  784|  48.0k|        || ((extctx & SSL_EXT_TLS1_3_ONLY) != 0
  ------------------
  |  |  296|  48.0k|#define SSL_EXT_TLS1_3_ONLY 0x00020
  ------------------
  |  Branch (784:13): [True: 13.1k, False: 34.8k]
  ------------------
  785|  13.1k|            && (thisctx & SSL_EXT_CLIENT_HELLO) != 0
  ------------------
  |  |  299|  13.1k|#define SSL_EXT_CLIENT_HELLO 0x00080
  ------------------
  |  Branch (785:16): [True: 13.1k, False: 0]
  ------------------
  786|  13.1k|            && (SSL_CONNECTION_IS_DTLS(s) || max_version < TLS1_3_VERSION)))
  ------------------
  |  |  258|  26.3k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  13.1k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  13.1k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 13.1k]
  |  |  ------------------
  ------------------
                          && (SSL_CONNECTION_IS_DTLS(s) || max_version < TLS1_3_VERSION)))
  ------------------
  |  |   27|  13.1k|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (786:46): [True: 88, False: 13.0k]
  ------------------
  787|     88|        return 0;
  788|       |
  789|  47.9k|    return 1;
  790|  48.0k|}
tls_construct_extensions:
  803|  1.69k|{
  804|  1.69k|    size_t i;
  805|  1.69k|    int min_version, max_version = 0, reason;
  806|  1.69k|    const EXTENSION_DEFINITION *thisexd;
  807|  1.69k|    int for_comp = (context & SSL_EXT_TLS1_3_CERTIFICATE_COMPRESSION) != 0;
  ------------------
  |  |  308|  1.69k|#define SSL_EXT_TLS1_3_CERTIFICATE_COMPRESSION 0x08000
  ------------------
  808|       |
  809|  1.69k|    if (!WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|  3.39k|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (809:9): [True: 0, False: 1.69k]
  ------------------
  810|       |        /*
  811|       |         * If extensions are of zero length then we don't even add the
  812|       |         * extensions length bytes to a ClientHello/ServerHello
  813|       |         * (for non-TLSv1.3).
  814|       |         */
  815|  1.69k|        || ((context & (SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_SERVER_HELLO)) != 0
  ------------------
  |  |  299|  1.69k|#define SSL_EXT_CLIENT_HELLO 0x00080
  ------------------
                      || ((context & (SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_SERVER_HELLO)) != 0
  ------------------
  |  |  301|  1.69k|#define SSL_EXT_TLS1_2_SERVER_HELLO 0x00100
  ------------------
  |  Branch (815:13): [True: 1.69k, False: 0]
  ------------------
  816|  1.69k|            && !WPACKET_set_flags(pkt,
  ------------------
  |  Branch (816:16): [True: 0, False: 1.69k]
  ------------------
  817|  1.69k|                WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH))) {
  ------------------
  |  |  703|  1.69k|#define WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH 2
  ------------------
  818|      0|        if (!for_comp)
  ------------------
  |  Branch (818:13): [True: 0, False: 0]
  ------------------
  819|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  820|      0|        return 0;
  821|      0|    }
  822|       |
  823|  1.69k|    if ((context & SSL_EXT_CLIENT_HELLO) != 0) {
  ------------------
  |  |  299|  1.69k|#define SSL_EXT_CLIENT_HELLO 0x00080
  ------------------
  |  Branch (823:9): [True: 1.69k, False: 0]
  ------------------
  824|  1.69k|        reason = ssl_get_min_max_version(s, &min_version, &max_version, NULL);
  825|  1.69k|        if (reason != 0) {
  ------------------
  |  Branch (825:13): [True: 0, False: 1.69k]
  ------------------
  826|      0|            if (!for_comp)
  ------------------
  |  Branch (826:17): [True: 0, False: 0]
  ------------------
  827|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, reason);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  828|      0|            return 0;
  829|      0|        }
  830|  1.69k|    }
  831|       |
  832|       |    /* Add custom extensions first */
  833|  1.69k|    if ((context & SSL_EXT_CLIENT_HELLO) != 0) {
  ------------------
  |  |  299|  1.69k|#define SSL_EXT_CLIENT_HELLO 0x00080
  ------------------
  |  Branch (833:9): [True: 1.69k, False: 0]
  ------------------
  834|       |        /* On the server side with initialise during ClientHello parsing */
  835|  1.69k|        custom_ext_init(&s->cert->custext);
  836|  1.69k|    }
  837|  1.69k|    if (!custom_ext_add(s, context, pkt, x, chainidx, max_version)) {
  ------------------
  |  Branch (837:9): [True: 0, False: 1.69k]
  ------------------
  838|       |        /* SSLfatal() already called */
  839|      0|        return 0;
  840|      0|    }
  841|       |
  842|  49.6k|    for (i = 0, thisexd = ext_defs; i < OSSL_NELEM(ext_defs); i++, thisexd++) {
  ------------------
  |  |   14|  49.6k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (842:37): [True: 48.0k, False: 1.64k]
  ------------------
  843|  48.0k|        EXT_RETURN (*construct)(SSL_CONNECTION *s, WPACKET *pkt,
  844|  48.0k|            unsigned int context,
  845|  48.0k|            X509 *x, size_t chainidx);
  846|  48.0k|        EXT_RETURN ret;
  847|       |
  848|       |        /* Skip if not relevant for our context */
  849|  48.0k|        if (!should_add_extension(s, thisexd->context, context, max_version))
  ------------------
  |  Branch (849:13): [True: 88, False: 47.9k]
  ------------------
  850|     88|            continue;
  851|       |
  852|  47.9k|        construct = s->server ? thisexd->construct_stoc
  ------------------
  |  Branch (852:21): [True: 0, False: 47.9k]
  ------------------
  853|  47.9k|                              : thisexd->construct_ctos;
  854|       |
  855|  47.9k|        if (construct == NULL)
  ------------------
  |  Branch (855:13): [True: 3.29k, False: 44.6k]
  ------------------
  856|  3.29k|            continue;
  857|       |
  858|  44.6k|        ret = construct(s, pkt, context, x, chainidx);
  859|  44.6k|        if (ret == EXT_RETURN_FAIL) {
  ------------------
  |  Branch (859:13): [True: 55, False: 44.6k]
  ------------------
  860|       |            /* SSLfatal() already called */
  861|     55|            return 0;
  862|     55|        }
  863|  44.6k|        if (ret == EXT_RETURN_SENT
  ------------------
  |  Branch (863:13): [True: 18.9k, False: 25.6k]
  ------------------
  864|  18.9k|            && (context & (SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_CERTIFICATE_REQUEST | SSL_EXT_TLS1_3_NEW_SESSION_TICKET)) != 0)
  ------------------
  |  |  299|  18.9k|#define SSL_EXT_CLIENT_HELLO 0x00080
  ------------------
                          && (context & (SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_CERTIFICATE_REQUEST | SSL_EXT_TLS1_3_NEW_SESSION_TICKET)) != 0)
  ------------------
  |  |  307|  18.9k|#define SSL_EXT_TLS1_3_CERTIFICATE_REQUEST 0x04000
  ------------------
                          && (context & (SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_CERTIFICATE_REQUEST | SSL_EXT_TLS1_3_NEW_SESSION_TICKET)) != 0)
  ------------------
  |  |  306|  18.9k|#define SSL_EXT_TLS1_3_NEW_SESSION_TICKET 0x02000
  ------------------
  |  Branch (864:16): [True: 18.9k, False: 0]
  ------------------
  865|  18.9k|            s->ext.extflags[i] |= SSL_EXT_FLAG_SENT;
  ------------------
  |  | 2068|  18.9k|#define SSL_EXT_FLAG_SENT 0x2
  ------------------
  866|  44.6k|    }
  867|       |
  868|  1.64k|    if (!WPACKET_close(pkt)) {
  ------------------
  |  Branch (868:9): [True: 0, False: 1.64k]
  ------------------
  869|      0|        if (!for_comp)
  ------------------
  |  Branch (869:13): [True: 0, False: 0]
  ------------------
  870|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  871|      0|        return 0;
  872|      0|    }
  873|       |
  874|  1.64k|    return 1;
  875|  1.64k|}
extensions.c:final_renegotiate:
  885|      5|{
  886|      5|    if (!s->server) {
  ------------------
  |  Branch (886:9): [True: 5, False: 0]
  ------------------
  887|       |        /*
  888|       |         * Check if we can connect to a server that doesn't support safe
  889|       |         * renegotiation
  890|       |         */
  891|      5|        if (!(s->options & SSL_OP_LEGACY_SERVER_CONNECT)
  ------------------
  |  |  360|      5|#define SSL_OP_LEGACY_SERVER_CONNECT SSL_OP_BIT(2)
  |  |  ------------------
  |  |  |  |  350|      5|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (891:13): [True: 5, False: 0]
  ------------------
  892|      5|            && !(s->options & SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)
  ------------------
  |  |  396|      5|#define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION SSL_OP_BIT(18)
  |  |  ------------------
  |  |  |  |  350|      5|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (892:16): [True: 5, False: 0]
  ------------------
  893|      5|            && !sent) {
  ------------------
  |  Branch (893:16): [True: 5, False: 0]
  ------------------
  894|      5|            SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE,
  ------------------
  |  |  148|      5|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      5|    (ERR_new(),                                                  \
  |  |  |  |  151|      5|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      5|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      5|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  895|      5|                SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED);
  896|      5|            return 0;
  897|      5|        }
  898|       |
  899|      0|        return 1;
  900|      5|    }
  901|       |
  902|       |    /* Need RI if renegotiating */
  903|      0|    if (s->renegotiate
  ------------------
  |  Branch (903:9): [True: 0, False: 0]
  ------------------
  904|      0|        && !(s->options & SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)
  ------------------
  |  |  396|      0|#define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION SSL_OP_BIT(18)
  |  |  ------------------
  |  |  |  |  350|      0|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (904:12): [True: 0, False: 0]
  ------------------
  905|      0|        && !sent) {
  ------------------
  |  Branch (905:12): [True: 0, False: 0]
  ------------------
  906|      0|        SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE,
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  907|      0|            SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED);
  908|      0|        return 0;
  909|      0|    }
  910|       |
  911|      0|    return 1;
  912|      0|}
extensions.c:init_server_name:
  924|     74|{
  925|     74|    if (s->server) {
  ------------------
  |  Branch (925:9): [True: 0, False: 74]
  ------------------
  926|      0|        s->servername_done = 0;
  927|       |
  928|      0|        OPENSSL_free(s->ext.hostname);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  929|      0|        s->ext.hostname = NULL;
  930|      0|    }
  931|       |
  932|     74|    return 1;
  933|     74|}
extensions.c:init_ec_point_formats:
 1179|     74|{
 1180|     74|    OPENSSL_free(s->ext.peer_ecpointformats);
  ------------------
  |  |  131|     74|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1181|     74|    s->ext.peer_ecpointformats = NULL;
 1182|     74|    s->ext.peer_ecpointformats_len = 0;
 1183|       |
 1184|     74|    return 1;
 1185|     74|}
extensions.c:init_session_ticket:
 1076|     74|{
 1077|     74|    if (!s->server)
  ------------------
  |  Branch (1077:9): [True: 74, False: 0]
  ------------------
 1078|     74|        s->ext.ticket_expected = 0;
 1079|       |
 1080|     74|    return 1;
 1081|     74|}
extensions.c:init_status_request:
 1085|     74|{
 1086|     74|    if (s->server) {
  ------------------
  |  Branch (1086:9): [True: 0, False: 74]
  ------------------
 1087|      0|        s->ext.status_type = TLSEXT_STATUSTYPE_nothing;
  ------------------
  |  | 2207|      0|#define TLSEXT_STATUSTYPE_nothing -1
  ------------------
 1088|     74|    } else {
 1089|       |        /*
 1090|       |         * Ensure we get sensible values passed to tlsext_status_cb in the event
 1091|       |         * that we don't receive a status message
 1092|       |         */
 1093|     74|        OPENSSL_free(s->ext.ocsp.resp);
  ------------------
  |  |  131|     74|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1094|     74|        s->ext.ocsp.resp = NULL;
 1095|     74|        s->ext.ocsp.resp_len = 0;
 1096|       |
 1097|     74|        sk_OCSP_RESPONSE_pop_free(s->ext.ocsp.resp_ex, OCSP_RESPONSE_free);
 1098|     74|        s->ext.ocsp.resp_ex = NULL;
 1099|     74|    }
 1100|       |
 1101|     74|    return 1;
 1102|     74|}
extensions.c:init_npn:
 1107|     74|{
 1108|     74|    s->s3.npn_seen = 0;
 1109|       |
 1110|     74|    return 1;
 1111|     74|}
extensions.c:init_alpn:
 1115|     74|{
 1116|     74|    OPENSSL_free(s->s3.alpn_selected);
  ------------------
  |  |  131|     74|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1117|     74|    s->s3.alpn_selected = NULL;
 1118|     74|    s->s3.alpn_selected_len = 0;
 1119|     74|    if (s->server) {
  ------------------
  |  Branch (1119:9): [True: 0, False: 74]
  ------------------
 1120|      0|        OPENSSL_free(s->s3.alpn_proposed);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1121|       |        s->s3.alpn_proposed = NULL;
 1122|      0|        s->s3.alpn_proposed_len = 0;
 1123|      0|    }
 1124|     74|    return 1;
 1125|     74|}
extensions.c:init_srtp:
 1281|     74|{
 1282|     74|    if (s->server)
  ------------------
  |  Branch (1282:9): [True: 0, False: 74]
  ------------------
 1283|      0|        s->srtp_profile = NULL;
 1284|       |
 1285|     74|    return 1;
 1286|     74|}
extensions.c:init_etm:
 1188|     74|{
 1189|     74|    s->ext.use_etm = 0;
 1190|       |
 1191|     74|    return 1;
 1192|     74|}
extensions.c:init_ems:
 1195|     74|{
 1196|     74|    if (s->s3.flags & TLS1_FLAGS_RECEIVED_EXTMS) {
  ------------------
  |  |  300|     74|#define TLS1_FLAGS_RECEIVED_EXTMS 0x0200
  ------------------
  |  Branch (1196:9): [True: 0, False: 74]
  ------------------
 1197|      0|        s->s3.flags &= ~TLS1_FLAGS_RECEIVED_EXTMS;
  ------------------
  |  |  300|      0|#define TLS1_FLAGS_RECEIVED_EXTMS 0x0200
  ------------------
 1198|      0|        s->s3.flags |= TLS1_FLAGS_REQUIRED_EXTMS;
  ------------------
  |  |  307|      0|#define TLS1_FLAGS_REQUIRED_EXTMS 0x1000
  ------------------
 1199|      0|    }
 1200|       |
 1201|     74|    return 1;
 1202|     74|}
extensions.c:init_client_cert_type:
 1868|     74|{
 1869|       |    /* Only reset when parsing client hello */
 1870|     74|    if (sc->server) {
  ------------------
  |  Branch (1870:9): [True: 0, False: 74]
  ------------------
 1871|      0|        sc->ext.client_cert_type_ctos = OSSL_CERT_TYPE_CTOS_NONE;
  ------------------
  |  |  365|      0|#define OSSL_CERT_TYPE_CTOS_NONE 0
  ------------------
 1872|      0|        sc->ext.client_cert_type = TLSEXT_cert_type_x509;
  ------------------
  |  |  240|      0|#define TLSEXT_cert_type_x509 0
  ------------------
 1873|      0|    }
 1874|     74|    return 1;
 1875|     74|}
extensions.c:init_server_cert_type:
 1858|     74|{
 1859|       |    /* Only reset when parsing client hello */
 1860|     74|    if (sc->server) {
  ------------------
  |  Branch (1860:9): [True: 0, False: 74]
  ------------------
 1861|      0|        sc->ext.server_cert_type_ctos = OSSL_CERT_TYPE_CTOS_NONE;
  ------------------
  |  |  365|      0|#define OSSL_CERT_TYPE_CTOS_NONE 0
  ------------------
 1862|      0|        sc->ext.server_cert_type = TLSEXT_cert_type_x509;
  ------------------
  |  |  240|      0|#define TLSEXT_cert_type_x509 0
  ------------------
 1863|      0|    }
 1864|     74|    return 1;
 1865|     74|}
extensions.c:tls_construct_compress_certificate:
 1737|  1.63k|{
 1738|       |#ifndef OPENSSL_NO_COMP_ALG
 1739|       |    int i;
 1740|       |
 1741|       |    if (!ossl_comp_has_alg(0))
 1742|       |        return EXT_RETURN_NOT_SENT;
 1743|       |
 1744|       |    /* Server: Don't attempt to compress a non-X509 (i.e. an RPK) */
 1745|       |    if (sc->server && sc->ext.server_cert_type != TLSEXT_cert_type_x509) {
 1746|       |        sc->cert_comp_prefs[0] = TLSEXT_comp_cert_none;
 1747|       |        return EXT_RETURN_NOT_SENT;
 1748|       |    }
 1749|       |
 1750|       |    /* Client: If we sent a client cert-type extension, don't indicate compression */
 1751|       |    if (!sc->server && sc->ext.client_cert_type_ctos) {
 1752|       |        sc->cert_comp_prefs[0] = TLSEXT_comp_cert_none;
 1753|       |        return EXT_RETURN_NOT_SENT;
 1754|       |    }
 1755|       |
 1756|       |    /* Do not indicate we support receiving compressed certificates */
 1757|       |    if ((sc->options & SSL_OP_NO_RX_CERTIFICATE_COMPRESSION) != 0)
 1758|       |        return EXT_RETURN_NOT_SENT;
 1759|       |
 1760|       |    if (sc->cert_comp_prefs[0] == TLSEXT_comp_cert_none)
 1761|       |        return EXT_RETURN_NOT_SENT;
 1762|       |
 1763|       |    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_compress_certificate)
 1764|       |        || !WPACKET_start_sub_packet_u16(pkt)
 1765|       |        || !WPACKET_start_sub_packet_u8(pkt))
 1766|       |        goto err;
 1767|       |
 1768|       |    for (i = 0; sc->cert_comp_prefs[i] != TLSEXT_comp_cert_none; i++) {
 1769|       |        if (!WPACKET_put_bytes_u16(pkt, sc->cert_comp_prefs[i]))
 1770|       |            goto err;
 1771|       |    }
 1772|       |    if (!WPACKET_close(pkt) || !WPACKET_close(pkt))
 1773|       |        goto err;
 1774|       |
 1775|       |    sc->ext.compress_certificate_sent = 1;
 1776|       |    return EXT_RETURN_SENT;
 1777|       |err:
 1778|       |    SSLfatal(sc, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
 1779|       |    return EXT_RETURN_FAIL;
 1780|       |#else
 1781|  1.63k|    return EXT_RETURN_NOT_SENT;
 1782|  1.63k|#endif
 1783|  1.63k|}
extensions.c:tls_construct_certificate_authorities:
 1241|  1.63k|{
 1242|  1.63k|    const STACK_OF(X509_NAME) *ca_sk = get_ca_names(s);
 1243|       |
 1244|  1.63k|    if (ca_sk == NULL || sk_X509_NAME_num(ca_sk) == 0)
  ------------------
  |  |   56|  1.63k|#define sk_X509_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_sk_type(sk))
  ------------------
  |  Branch (1244:9): [True: 0, False: 1.63k]
  |  Branch (1244:26): [True: 1.63k, False: 0]
  ------------------
 1245|  1.63k|        return EXT_RETURN_NOT_SENT;
 1246|       |
 1247|      0|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_certificate_authorities)
  ------------------
  |  |  891|      0|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (1247:9): [True: 0, False: 0]
  ------------------
 1248|      0|        || !WPACKET_start_sub_packet_u16(pkt)) {
  ------------------
  |  |  792|      0|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (1248:12): [True: 0, False: 0]
  ------------------
 1249|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1250|      0|        return EXT_RETURN_FAIL;
 1251|      0|    }
 1252|       |
 1253|      0|    if (!construct_ca_names(s, ca_sk, pkt)) {
  ------------------
  |  Branch (1253:9): [True: 0, False: 0]
  ------------------
 1254|       |        /* SSLfatal() already called */
 1255|      0|        return EXT_RETURN_FAIL;
 1256|      0|    }
 1257|       |
 1258|      0|    if (!WPACKET_close(pkt)) {
  ------------------
  |  Branch (1258:9): [True: 0, False: 0]
  ------------------
 1259|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1260|      0|        return EXT_RETURN_FAIL;
 1261|      0|    }
 1262|       |
 1263|      0|    return EXT_RETURN_SENT;
 1264|      0|}
extensions.c:validate_context:
  400|    196|{
  401|       |    /* Check we're allowed to use this extension in this context */
  402|    196|    if ((thisctx & extctx) == 0)
  ------------------
  |  Branch (402:9): [True: 9, False: 187]
  ------------------
  403|      9|        return 0;
  404|       |
  405|    187|    if (SSL_CONNECTION_IS_DTLS(s)) {
  ------------------
  |  |  258|    187|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|    187|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|    187|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 187]
  |  |  ------------------
  ------------------
  406|      0|        if ((extctx & SSL_EXT_TLS_ONLY) != 0)
  ------------------
  |  |  286|      0|#define SSL_EXT_TLS_ONLY 0x00001
  ------------------
  |  Branch (406:13): [True: 0, False: 0]
  ------------------
  407|      0|            return 0;
  408|    187|    } else if ((extctx & SSL_EXT_DTLS_ONLY) != 0) {
  ------------------
  |  |  288|    187|#define SSL_EXT_DTLS_ONLY 0x00002
  ------------------
  |  Branch (408:16): [True: 1, False: 186]
  ------------------
  409|      1|        return 0;
  410|      1|    }
  411|       |
  412|    186|    return 1;
  413|    187|}
extensions.c:verify_extension:
  463|    353|{
  464|    353|    size_t i;
  465|    353|    size_t builtin_num = OSSL_NELEM(ext_defs);
  ------------------
  |  |   14|    353|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  466|    353|    const EXTENSION_DEFINITION *thisext;
  467|       |
  468|  7.92k|    for (i = 0, thisext = ext_defs; i < builtin_num; i++, thisext++) {
  ------------------
  |  Branch (468:37): [True: 7.71k, False: 212]
  ------------------
  469|  7.71k|        if (type == thisext->type) {
  ------------------
  |  Branch (469:13): [True: 141, False: 7.57k]
  ------------------
  470|    141|            if (!validate_context(s, thisext->context, context))
  ------------------
  |  Branch (470:17): [True: 9, False: 132]
  ------------------
  471|      9|                return 0;
  472|       |
  473|    132|            *found = &rawexlist[i];
  474|    132|            return 1;
  475|    141|        }
  476|  7.71k|    }
  477|       |
  478|       |    /* Check the custom extensions */
  479|    212|    if (meths != NULL) {
  ------------------
  |  Branch (479:9): [True: 212, False: 0]
  ------------------
  480|    212|        size_t offset = 0;
  481|    212|        ENDPOINT role = ENDPOINT_BOTH;
  482|    212|        custom_ext_method *meth = NULL;
  483|       |
  484|    212|        if ((context & SSL_EXT_CLIENT_HELLO) != 0)
  ------------------
  |  |  299|    212|#define SSL_EXT_CLIENT_HELLO 0x00080
  ------------------
  |  Branch (484:13): [True: 0, False: 212]
  ------------------
  485|      0|            role = ENDPOINT_SERVER;
  486|    212|        else if ((context & SSL_EXT_TLS1_2_SERVER_HELLO) != 0)
  ------------------
  |  |  301|    212|#define SSL_EXT_TLS1_2_SERVER_HELLO 0x00100
  ------------------
  |  Branch (486:18): [True: 212, False: 0]
  ------------------
  487|    212|            role = ENDPOINT_CLIENT;
  488|       |
  489|    212|        meth = custom_ext_find(meths, role, type, &offset);
  490|    212|        if (meth != NULL) {
  ------------------
  |  Branch (490:13): [True: 0, False: 212]
  ------------------
  491|      0|            if (!validate_context(s, meth->context, context))
  ------------------
  |  Branch (491:17): [True: 0, False: 0]
  ------------------
  492|      0|                return 0;
  493|      0|            *found = &rawexlist[offset + builtin_num];
  494|      0|            return 1;
  495|      0|        }
  496|    212|    }
  497|       |
  498|       |    /* Unknown extension. We allow it */
  499|    212|    *found = NULL;
  500|    212|    return 1;
  501|    212|}

tls_construct_ctos_renegotiate:
   19|  1.69k|{
   20|  1.69k|    if (!s->renegotiate) {
  ------------------
  |  Branch (20:9): [True: 1.69k, False: 0]
  ------------------
   21|       |        /* If not renegotiating, send an empty RI extension to indicate support */
   22|       |
   23|       |#if DTLS_MAX_VERSION_INTERNAL != DTLS1_2_VERSION
   24|       |#error Internal DTLS version error
   25|       |#endif
   26|       |
   27|  1.69k|        if (!SSL_CONNECTION_IS_DTLS(s)
  ------------------
  |  |  258|  3.39k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  1.69k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  1.69k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  ------------------
  |  Branch (27:13): [True: 1.69k, False: 0]
  ------------------
   28|  1.69k|            && (s->min_proto_version >= TLS1_3_VERSION
  ------------------
  |  |   27|  3.39k|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (28:17): [True: 3, False: 1.69k]
  ------------------
   29|  1.69k|                || (ssl_security(s, SSL_SECOP_VERSION, 0, TLS1_VERSION, NULL)
  ------------------
  |  | 2766|  1.69k|#define SSL_SECOP_VERSION (9 | SSL_SECOP_OTHER_NONE)
  |  |  ------------------
  |  |  |  | 2737|  1.69k|#define SSL_SECOP_OTHER_NONE 0
  |  |  ------------------
  ------------------
                              || (ssl_security(s, SSL_SECOP_VERSION, 0, TLS1_VERSION, NULL)
  ------------------
  |  |   24|  1.69k|#define TLS1_VERSION 0x0301
  ------------------
  |  Branch (29:21): [True: 9, False: 1.68k]
  ------------------
   30|      9|                    && s->min_proto_version <= TLS1_VERSION))) {
  ------------------
  |  |   24|      9|#define TLS1_VERSION 0x0301
  ------------------
  |  Branch (30:24): [True: 5, False: 4]
  ------------------
   31|       |            /*
   32|       |             * For TLS <= 1.0 SCSV is used instead, and for TLS 1.3 this
   33|       |             * extension isn't used at all.
   34|       |             */
   35|      8|            return EXT_RETURN_NOT_SENT;
   36|      8|        }
   37|       |
   38|  1.69k|        if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_renegotiate)
  ------------------
  |  |  891|  3.38k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (38:13): [True: 0, False: 1.69k]
  ------------------
   39|  1.69k|            || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|  3.38k|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (39:16): [True: 0, False: 1.69k]
  ------------------
   40|  1.69k|            || !WPACKET_put_bytes_u8(pkt, 0)
  ------------------
  |  |  889|  3.38k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (40:16): [True: 0, False: 1.69k]
  ------------------
   41|  1.69k|            || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (41:16): [True: 0, False: 1.69k]
  ------------------
   42|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
   43|      0|            return EXT_RETURN_FAIL;
   44|      0|        }
   45|       |
   46|  1.69k|        return EXT_RETURN_SENT;
   47|  1.69k|    }
   48|       |
   49|       |    /* Add a complete RI extension if renegotiating */
   50|      0|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_renegotiate)
  ------------------
  |  |  891|      0|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (50:9): [True: 0, False: 0]
  ------------------
   51|      0|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|      0|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (51:12): [True: 0, False: 0]
  ------------------
   52|      0|        || !WPACKET_sub_memcpy_u8(pkt, s->s3.previous_client_finished,
  ------------------
  |  |  918|      0|    WPACKET_sub_memcpy__((pkt), (src), (len), 1)
  ------------------
  |  Branch (52:12): [True: 0, False: 0]
  ------------------
   53|      0|            s->s3.previous_client_finished_len)
   54|      0|        || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (54:12): [True: 0, False: 0]
  ------------------
   55|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
   56|      0|        return EXT_RETURN_FAIL;
   57|      0|    }
   58|       |
   59|      0|    return EXT_RETURN_SENT;
   60|      0|}
tls_construct_ctos_server_name:
   65|  1.69k|{
   66|  1.69k|    if (s->ext.hostname == NULL)
  ------------------
  |  Branch (66:9): [True: 1.17k, False: 525]
  ------------------
   67|  1.17k|        return EXT_RETURN_NOT_SENT;
   68|       |
   69|       |    /* Add TLS extension servername to the Client Hello message */
   70|    525|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_server_name)
  ------------------
  |  |  891|  1.05k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (70:9): [True: 0, False: 525]
  ------------------
   71|       |        /* Sub-packet for server_name extension */
   72|    525|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|  1.05k|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (72:12): [True: 0, False: 525]
  ------------------
   73|       |        /* Sub-packet for servername list (always 1 hostname)*/
   74|    525|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|  1.05k|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (74:12): [True: 0, False: 525]
  ------------------
   75|    525|        || !WPACKET_put_bytes_u8(pkt, TLSEXT_NAMETYPE_host_name)
  ------------------
  |  |  889|  1.05k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (75:12): [True: 0, False: 525]
  ------------------
   76|    525|        || !WPACKET_sub_memcpy_u16(pkt, s->ext.hostname,
  ------------------
  |  |  920|  1.05k|    WPACKET_sub_memcpy__((pkt), (src), (len), 2)
  ------------------
  |  Branch (76:12): [True: 0, False: 525]
  ------------------
   77|    525|            strlen(s->ext.hostname))
   78|    525|        || !WPACKET_close(pkt)
  ------------------
  |  Branch (78:12): [True: 0, False: 525]
  ------------------
   79|    525|        || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (79:12): [True: 0, False: 525]
  ------------------
   80|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
   81|      0|        return EXT_RETURN_FAIL;
   82|      0|    }
   83|       |
   84|    525|    return EXT_RETURN_SENT;
   85|    525|}
tls_construct_ctos_maxfragmentlen:
   91|  1.69k|{
   92|  1.69k|    if (s->ext.max_fragment_len_mode == TLSEXT_max_fragment_length_DISABLED)
  ------------------
  |  |  227|  1.69k|#define TLSEXT_max_fragment_length_DISABLED 0
  ------------------
  |  Branch (92:9): [True: 1.69k, False: 0]
  ------------------
   93|  1.69k|        return EXT_RETURN_NOT_SENT;
   94|       |
   95|       |    /* Add Max Fragment Length extension if client enabled it. */
   96|       |    /*-
   97|       |     * 4 bytes for this extension type and extension length
   98|       |     * 1 byte for the Max Fragment Length code value.
   99|       |     */
  100|      0|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_max_fragment_length)
  ------------------
  |  |  891|      0|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (100:9): [True: 0, False: 0]
  ------------------
  101|       |        /* Sub-packet for Max Fragment Length extension (1 byte) */
  102|      0|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|      0|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (102:12): [True: 0, False: 0]
  ------------------
  103|      0|        || !WPACKET_put_bytes_u8(pkt, s->ext.max_fragment_len_mode)
  ------------------
  |  |  889|      0|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (103:12): [True: 0, False: 0]
  ------------------
  104|      0|        || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (104:12): [True: 0, False: 0]
  ------------------
  105|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  106|      0|        return EXT_RETURN_FAIL;
  107|      0|    }
  108|       |
  109|      0|    return EXT_RETURN_SENT;
  110|      0|}
tls_construct_ctos_srp:
  116|  1.69k|{
  117|       |    /* Add SRP username if there is one */
  118|  1.69k|    if (s->srp_ctx.login == NULL)
  ------------------
  |  Branch (118:9): [True: 1.69k, False: 1]
  ------------------
  119|  1.69k|        return EXT_RETURN_NOT_SENT;
  120|       |
  121|      1|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_srp)
  ------------------
  |  |  891|      2|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (121:9): [True: 0, False: 1]
  ------------------
  122|       |        /* Sub-packet for SRP extension */
  123|      1|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|      2|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (123:12): [True: 0, False: 1]
  ------------------
  124|      1|        || !WPACKET_start_sub_packet_u8(pkt)
  ------------------
  |  |  790|      2|    WPACKET_start_sub_packet_len__((pkt), 1)
  ------------------
  |  Branch (124:12): [True: 0, False: 1]
  ------------------
  125|       |        /* login must not be zero...internal error if so */
  126|      1|        || !WPACKET_set_flags(pkt, WPACKET_FLAGS_NON_ZERO_LENGTH)
  ------------------
  |  |  697|      1|#define WPACKET_FLAGS_NON_ZERO_LENGTH 1
  ------------------
  |  Branch (126:12): [True: 0, False: 1]
  ------------------
  127|      1|        || !WPACKET_memcpy(pkt, s->srp_ctx.login,
  ------------------
  |  Branch (127:12): [True: 0, False: 1]
  ------------------
  128|      1|            strlen(s->srp_ctx.login))
  129|      1|        || !WPACKET_close(pkt)
  ------------------
  |  Branch (129:12): [True: 0, False: 1]
  ------------------
  130|      1|        || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (130:12): [True: 0, False: 1]
  ------------------
  131|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  132|      0|        return EXT_RETURN_FAIL;
  133|      0|    }
  134|       |
  135|      1|    return EXT_RETURN_SENT;
  136|      1|}
tls_construct_ctos_ec_pt_formats:
  186|  1.69k|{
  187|  1.69k|    const unsigned char *pformats;
  188|  1.69k|    size_t num_formats;
  189|  1.69k|    int reason, min_version, max_version;
  190|       |
  191|  1.69k|    reason = ssl_get_min_max_version(s, &min_version, &max_version, NULL);
  192|  1.69k|    if (reason != 0) {
  ------------------
  |  Branch (192:9): [True: 0, False: 1.69k]
  ------------------
  193|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, reason);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  194|      0|        return EXT_RETURN_FAIL;
  195|      0|    }
  196|  1.69k|    if (!use_ecc(s, min_version, max_version))
  ------------------
  |  Branch (196:9): [True: 129, False: 1.56k]
  ------------------
  197|    129|        return EXT_RETURN_NOT_SENT;
  198|       |
  199|       |    /* Add TLS extension ECPointFormats to the ClientHello message */
  200|  1.56k|    tls1_get_formatlist(s, &pformats, &num_formats);
  201|       |
  202|  1.56k|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_ec_point_formats)
  ------------------
  |  |  891|  3.13k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (202:9): [True: 0, False: 1.56k]
  ------------------
  203|       |        /* Sub-packet for formats extension */
  204|  1.56k|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|  3.13k|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (204:12): [True: 0, False: 1.56k]
  ------------------
  205|  1.56k|        || !WPACKET_sub_memcpy_u8(pkt, pformats, num_formats)
  ------------------
  |  |  918|  3.13k|    WPACKET_sub_memcpy__((pkt), (src), (len), 1)
  ------------------
  |  Branch (205:12): [True: 0, False: 1.56k]
  ------------------
  206|  1.56k|        || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (206:12): [True: 0, False: 1.56k]
  ------------------
  207|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  208|      0|        return EXT_RETURN_FAIL;
  209|      0|    }
  210|       |
  211|  1.56k|    return EXT_RETURN_SENT;
  212|  1.56k|}
tls_construct_ctos_supported_groups:
  217|  1.69k|{
  218|  1.69k|    const uint16_t *pgroups = NULL;
  219|  1.69k|    size_t num_groups = 0, i, tls13added = 0, added = 0;
  220|  1.69k|    int min_version, max_version, reason;
  221|       |
  222|  1.69k|    reason = ssl_get_min_max_version(s, &min_version, &max_version, NULL);
  223|  1.69k|    if (reason != 0) {
  ------------------
  |  Branch (223:9): [True: 0, False: 1.69k]
  ------------------
  224|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, reason);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  225|      0|        return EXT_RETURN_FAIL;
  226|      0|    }
  227|       |
  228|       |    /*
  229|       |     * We only support EC groups in TLSv1.2 or below, and in DTLS. Therefore
  230|       |     * if we don't have EC support then we don't send this extension.
  231|       |     */
  232|  1.69k|    if (!use_ecc(s, min_version, max_version)
  ------------------
  |  Branch (232:9): [True: 129, False: 1.56k]
  ------------------
  233|    129|        && (SSL_CONNECTION_IS_DTLS(s) || max_version < TLS1_3_VERSION))
  ------------------
  |  |  258|    258|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|    129|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|    129|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 129]
  |  |  ------------------
  ------------------
                      && (SSL_CONNECTION_IS_DTLS(s) || max_version < TLS1_3_VERSION))
  ------------------
  |  |   27|    129|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (233:42): [True: 4, False: 125]
  ------------------
  234|      4|        return EXT_RETURN_NOT_SENT;
  235|       |
  236|       |    /*
  237|       |     * Add TLS extension supported_groups to the ClientHello message
  238|       |     */
  239|  1.69k|    tls1_get_supported_groups(s, &pgroups, &num_groups);
  240|       |
  241|  1.69k|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_supported_groups)
  ------------------
  |  |  891|  3.38k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (241:9): [True: 0, False: 1.69k]
  ------------------
  242|       |        /* Sub-packet for supported_groups extension */
  243|  1.69k|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|  3.38k|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (243:12): [True: 0, False: 1.69k]
  ------------------
  244|  1.69k|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|  3.38k|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (244:12): [True: 0, False: 1.69k]
  ------------------
  245|  1.69k|        || !WPACKET_set_flags(pkt, WPACKET_FLAGS_NON_ZERO_LENGTH)) {
  ------------------
  |  |  697|  1.69k|#define WPACKET_FLAGS_NON_ZERO_LENGTH 1
  ------------------
  |  Branch (245:12): [True: 0, False: 1.69k]
  ------------------
  246|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  247|      0|        return EXT_RETURN_FAIL;
  248|      0|    }
  249|       |    /* Copy group ID if supported */
  250|  12.5k|    for (i = 0; i < num_groups; i++) {
  ------------------
  |  Branch (250:17): [True: 10.8k, False: 1.69k]
  ------------------
  251|  10.8k|        uint16_t ctmp = pgroups[i];
  252|  10.8k|        int okfortls13;
  253|       |
  254|  10.8k|        if (tls_valid_group(s, ctmp, min_version, max_version, 0, &okfortls13)
  ------------------
  |  Branch (254:13): [True: 10.8k, False: 15]
  ------------------
  255|  10.8k|            && tls_group_allowed(s, ctmp, SSL_SECOP_CURVE_SUPPORTED)) {
  ------------------
  |  | 2758|  10.8k|#define SSL_SECOP_CURVE_SUPPORTED (4 | SSL_SECOP_OTHER_CURVE)
  |  |  ------------------
  |  |  |  | 2739|  10.8k|#define SSL_SECOP_OTHER_CURVE (2 << 16)
  |  |  ------------------
  ------------------
  |  Branch (255:16): [True: 10.7k, False: 62]
  ------------------
  256|  10.7k|            if (!WPACKET_put_bytes_u16(pkt, ctmp)) {
  ------------------
  |  |  891|  10.7k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (256:17): [True: 0, False: 10.7k]
  ------------------
  257|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  258|      0|                return EXT_RETURN_FAIL;
  259|      0|            }
  260|  10.7k|            if (okfortls13 && max_version == TLS1_3_VERSION)
  ------------------
  |  |   27|  10.7k|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (260:17): [True: 10.7k, False: 31]
  |  Branch (260:31): [True: 10.7k, False: 0]
  ------------------
  261|  10.7k|                tls13added++;
  262|  10.7k|            added++;
  263|  10.7k|        }
  264|  10.8k|    }
  265|  1.69k|    if (!WPACKET_close(pkt) || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (265:9): [True: 49, False: 1.64k]
  |  Branch (265:32): [True: 0, False: 1.64k]
  ------------------
  266|     49|        if (added == 0)
  ------------------
  |  Branch (266:13): [True: 49, False: 0]
  ------------------
  267|     49|            SSLfatal_data(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_SUITABLE_GROUPS,
  ------------------
  |  |  150|     49|    (ERR_new(),                                                  \
  |  |  151|     49|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|     49|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  152|     49|        ossl_statem_fatal)
  ------------------
                          SSLfatal_data(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_SUITABLE_GROUPS,
  ------------------
  |  | 1243|     49|#define SSL_AD_INTERNAL_ERROR TLS1_AD_INTERNAL_ERROR
  |  |  ------------------
  |  |  |  |   66|     49|#define TLS1_AD_INTERNAL_ERROR 80 /* fatal */
  |  |  ------------------
  ------------------
                          SSLfatal_data(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_SUITABLE_GROUPS,
  ------------------
  |  |  214|     49|#define SSL_R_NO_SUITABLE_GROUPS 295
  ------------------
  268|     49|                "No groups enabled for max supported SSL/TLS version");
  269|      0|        else
  270|     49|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  271|     49|        return EXT_RETURN_FAIL;
  272|     49|    }
  273|       |
  274|  1.64k|    if (tls13added == 0 && max_version == TLS1_3_VERSION) {
  ------------------
  |  |   27|      9|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (274:9): [True: 9, False: 1.63k]
  |  Branch (274:28): [True: 2, False: 7]
  ------------------
  275|      2|        SSLfatal_data(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_SUITABLE_GROUPS,
  ------------------
  |  |  150|      2|    (ERR_new(),                                                  \
  |  |  151|      2|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      2|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  152|      2|        ossl_statem_fatal)
  ------------------
                      SSLfatal_data(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_SUITABLE_GROUPS,
  ------------------
  |  | 1243|      2|#define SSL_AD_INTERNAL_ERROR TLS1_AD_INTERNAL_ERROR
  |  |  ------------------
  |  |  |  |   66|      2|#define TLS1_AD_INTERNAL_ERROR 80 /* fatal */
  |  |  ------------------
  ------------------
                      SSLfatal_data(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_SUITABLE_GROUPS,
  ------------------
  |  |  214|      2|#define SSL_R_NO_SUITABLE_GROUPS 295
  ------------------
  276|      2|            "No groups enabled for max supported SSL/TLS version");
  277|      2|        return EXT_RETURN_FAIL;
  278|      2|    }
  279|       |
  280|  1.64k|    return EXT_RETURN_SENT;
  281|  1.64k|}
tls_construct_ctos_session_ticket:
  286|  1.64k|{
  287|  1.64k|    size_t ticklen;
  288|       |
  289|  1.64k|    if (!tls_use_ticket(s))
  ------------------
  |  Branch (289:9): [True: 1.64k, False: 0]
  ------------------
  290|  1.64k|        return EXT_RETURN_NOT_SENT;
  291|       |
  292|      0|    if (!s->new_session && s->session != NULL
  ------------------
  |  Branch (292:9): [True: 0, False: 0]
  |  Branch (292:28): [True: 0, False: 0]
  ------------------
  293|      0|        && s->session->ext.tick != NULL
  ------------------
  |  Branch (293:12): [True: 0, False: 0]
  ------------------
  294|      0|        && s->session->ssl_version != TLS1_3_VERSION) {
  ------------------
  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (294:12): [True: 0, False: 0]
  ------------------
  295|      0|        ticklen = s->session->ext.ticklen;
  296|      0|    } else if (s->session && s->ext.session_ticket != NULL
  ------------------
  |  Branch (296:16): [True: 0, False: 0]
  |  Branch (296:30): [True: 0, False: 0]
  ------------------
  297|      0|        && s->ext.session_ticket->data != NULL) {
  ------------------
  |  Branch (297:12): [True: 0, False: 0]
  ------------------
  298|      0|        ticklen = s->ext.session_ticket->length;
  299|      0|        s->session->ext.tick = OPENSSL_malloc(ticklen);
  ------------------
  |  |  106|      0|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  300|      0|        if (s->session->ext.tick == NULL) {
  ------------------
  |  Branch (300:13): [True: 0, False: 0]
  ------------------
  301|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  302|      0|            return EXT_RETURN_FAIL;
  303|      0|        }
  304|      0|        memcpy(s->session->ext.tick,
  305|      0|            s->ext.session_ticket->data, ticklen);
  306|      0|        s->session->ext.ticklen = ticklen;
  307|      0|    } else {
  308|      0|        ticklen = 0;
  309|      0|    }
  310|       |
  311|      0|    if (ticklen == 0 && s->ext.session_ticket != NULL && s->ext.session_ticket->data == NULL)
  ------------------
  |  Branch (311:9): [True: 0, False: 0]
  |  Branch (311:25): [True: 0, False: 0]
  |  Branch (311:58): [True: 0, False: 0]
  ------------------
  312|      0|        return EXT_RETURN_NOT_SENT;
  313|       |
  314|      0|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_session_ticket)
  ------------------
  |  |  891|      0|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (314:9): [True: 0, False: 0]
  ------------------
  315|      0|        || !WPACKET_sub_memcpy_u16(pkt, s->session->ext.tick, ticklen)) {
  ------------------
  |  |  920|      0|    WPACKET_sub_memcpy__((pkt), (src), (len), 2)
  ------------------
  |  Branch (315:12): [True: 0, False: 0]
  ------------------
  316|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  317|      0|        return EXT_RETURN_FAIL;
  318|      0|    }
  319|       |
  320|      0|    return EXT_RETURN_SENT;
  321|      0|}
tls_construct_ctos_sig_algs:
  326|  1.64k|{
  327|  1.64k|    size_t salglen;
  328|  1.64k|    const uint16_t *salg;
  329|       |
  330|       |    /*
  331|       |     * This used both in the initial hello and as part of renegotiation,
  332|       |     * in the latter case, the client version may be already set and may
  333|       |     * be lower than that initially offered in `client_version`.
  334|       |     */
  335|  1.64k|    if (!SSL_CONNECTION_IS_DTLS(s)) {
  ------------------
  |  |  258|  1.64k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  1.64k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  1.64k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  ------------------
  |  Branch (335:9): [True: 1.64k, False: 0]
  ------------------
  336|  1.64k|        if (s->client_version < TLS1_2_VERSION
  ------------------
  |  |   26|  3.29k|#define TLS1_2_VERSION 0x0303
  ------------------
  |  Branch (336:13): [True: 3, False: 1.64k]
  ------------------
  337|  1.64k|            || (s->ssl.method->version != TLS_ANY_VERSION
  ------------------
  |  |   40|  3.28k|#define TLS_ANY_VERSION 0x10000
  ------------------
  |  Branch (337:17): [True: 0, False: 1.64k]
  ------------------
  338|      0|                && s->version < TLS1_2_VERSION))
  ------------------
  |  |   26|      0|#define TLS1_2_VERSION 0x0303
  ------------------
  |  Branch (338:20): [True: 0, False: 0]
  ------------------
  339|      3|            return EXT_RETURN_NOT_SENT;
  340|  1.64k|    } else {
  341|      0|        if (DTLS_VERSION_LT(s->client_version, DTLS1_2_VERSION)
  ------------------
  |  |   60|      0|#define DTLS_VERSION_LT(v1, v2) (dtls_ver_ordinal(v1) > dtls_ver_ordinal(v2))
  |  |  ------------------
  |  |  |  |   57|      0|#define dtls_ver_ordinal(v1) (((v1) == DTLS1_BAD_VER) ? 0xff00 : (v1))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|      0|#define DTLS1_BAD_VER 0x0100
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:31): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DTLS_VERSION_LT(v1, v2) (dtls_ver_ordinal(v1) > dtls_ver_ordinal(v2))
  |  |  ------------------
  |  |  |  |   57|      0|#define dtls_ver_ordinal(v1) (((v1) == DTLS1_BAD_VER) ? 0xff00 : (v1))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|      0|#define DTLS1_BAD_VER 0x0100
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:31): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (60:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  342|      0|            || (s->ssl.method->version != DTLS_ANY_VERSION
  ------------------
  |  |   35|      0|#define DTLS_ANY_VERSION 0x1FFFF
  ------------------
  |  Branch (342:17): [True: 0, False: 0]
  ------------------
  343|      0|                && DTLS_VERSION_LT(s->version, DTLS1_2_VERSION)))
  ------------------
  |  |   60|      0|#define DTLS_VERSION_LT(v1, v2) (dtls_ver_ordinal(v1) > dtls_ver_ordinal(v2))
  |  |  ------------------
  |  |  |  |   57|      0|#define dtls_ver_ordinal(v1) (((v1) == DTLS1_BAD_VER) ? 0xff00 : (v1))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|      0|#define DTLS1_BAD_VER 0x0100
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:31): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DTLS_VERSION_LT(v1, v2) (dtls_ver_ordinal(v1) > dtls_ver_ordinal(v2))
  |  |  ------------------
  |  |  |  |   57|      0|#define dtls_ver_ordinal(v1) (((v1) == DTLS1_BAD_VER) ? 0xff00 : (v1))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|      0|#define DTLS1_BAD_VER 0x0100
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:31): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (60:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  344|      0|            return EXT_RETURN_NOT_SENT;
  345|      0|    }
  346|       |
  347|  1.64k|    salglen = tls12_get_psigalgs(s, 1, &salg);
  348|  1.64k|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_signature_algorithms)
  ------------------
  |  |  891|  3.28k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (348:9): [True: 0, False: 1.64k]
  ------------------
  349|       |        /* Sub-packet for sig-algs extension */
  350|  1.64k|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|  3.28k|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (350:12): [True: 0, False: 1.64k]
  ------------------
  351|       |        /* Sub-packet for the actual list */
  352|  1.64k|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|  3.28k|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (352:12): [True: 0, False: 1.64k]
  ------------------
  353|  1.64k|        || !tls12_copy_sigalgs(s, pkt, salg, salglen)
  ------------------
  |  Branch (353:12): [True: 0, False: 1.64k]
  ------------------
  354|  1.64k|        || !WPACKET_close(pkt)
  ------------------
  |  Branch (354:12): [True: 0, False: 1.64k]
  ------------------
  355|  1.64k|        || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (355:12): [True: 0, False: 1.64k]
  ------------------
  356|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  357|      0|        return EXT_RETURN_FAIL;
  358|      0|    }
  359|       |
  360|  1.64k|    return EXT_RETURN_SENT;
  361|  1.64k|}
tls_construct_ctos_status_request:
  367|  1.64k|{
  368|  1.64k|    int i;
  369|       |
  370|       |    /* This extension isn't defined for client Certificates */
  371|  1.64k|    if (x != NULL)
  ------------------
  |  Branch (371:9): [True: 0, False: 1.64k]
  ------------------
  372|      0|        return EXT_RETURN_NOT_SENT;
  373|       |
  374|  1.64k|    if (s->ext.status_type != TLSEXT_STATUSTYPE_ocsp)
  ------------------
  |  |  173|  1.64k|#define TLSEXT_STATUSTYPE_ocsp 1
  ------------------
  |  Branch (374:9): [True: 1.64k, False: 2]
  ------------------
  375|  1.64k|        return EXT_RETURN_NOT_SENT;
  376|       |
  377|      2|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_status_request)
  ------------------
  |  |  891|      4|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (377:9): [True: 0, False: 2]
  ------------------
  378|       |        /* Sub-packet for status request extension */
  379|      2|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|      4|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (379:12): [True: 0, False: 2]
  ------------------
  380|      2|        || !WPACKET_put_bytes_u8(pkt, TLSEXT_STATUSTYPE_ocsp)
  ------------------
  |  |  889|      4|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (380:12): [True: 0, False: 2]
  ------------------
  381|       |        /* Sub-packet for the ids */
  382|      2|        || !WPACKET_start_sub_packet_u16(pkt)) {
  ------------------
  |  |  792|      2|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (382:12): [True: 0, False: 2]
  ------------------
  383|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  384|      0|        return EXT_RETURN_FAIL;
  385|      0|    }
  386|      2|    for (i = 0; i < sk_OCSP_RESPID_num(s->ext.ocsp.ids); i++) {
  ------------------
  |  |  166|      2|#define sk_OCSP_RESPID_num(sk) OPENSSL_sk_num(ossl_check_const_OCSP_RESPID_sk_type(sk))
  ------------------
  |  Branch (386:17): [True: 0, False: 2]
  ------------------
  387|      0|        unsigned char *idbytes;
  388|      0|        OCSP_RESPID *id = sk_OCSP_RESPID_value(s->ext.ocsp.ids, i);
  ------------------
  |  |  167|      0|#define sk_OCSP_RESPID_value(sk, idx) ((OCSP_RESPID *)OPENSSL_sk_value(ossl_check_const_OCSP_RESPID_sk_type(sk), (idx)))
  ------------------
  389|      0|        int idlen = i2d_OCSP_RESPID(id, NULL);
  390|       |
  391|      0|        if (idlen <= 0
  ------------------
  |  Branch (391:13): [True: 0, False: 0]
  ------------------
  392|       |            /* Sub-packet for an individual id */
  393|      0|            || !WPACKET_sub_allocate_bytes_u16(pkt, idlen, &idbytes)
  ------------------
  |  |  831|      0|    WPACKET_sub_allocate_bytes__((pkt), (len), (bytes), 2)
  ------------------
  |  Branch (393:16): [True: 0, False: 0]
  ------------------
  394|      0|            || i2d_OCSP_RESPID(id, &idbytes) != idlen) {
  ------------------
  |  Branch (394:16): [True: 0, False: 0]
  ------------------
  395|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  396|      0|            return EXT_RETURN_FAIL;
  397|      0|        }
  398|      0|    }
  399|      2|    if (!WPACKET_close(pkt)
  ------------------
  |  Branch (399:9): [True: 0, False: 2]
  ------------------
  400|      2|        || !WPACKET_start_sub_packet_u16(pkt)) {
  ------------------
  |  |  792|      2|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (400:12): [True: 0, False: 2]
  ------------------
  401|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  402|      0|        return EXT_RETURN_FAIL;
  403|      0|    }
  404|      2|    if (s->ext.ocsp.exts) {
  ------------------
  |  Branch (404:9): [True: 0, False: 2]
  ------------------
  405|      0|        unsigned char *extbytes;
  406|      0|        int extlen = i2d_X509_EXTENSIONS(s->ext.ocsp.exts, NULL);
  407|       |
  408|      0|        if (extlen < 0) {
  ------------------
  |  Branch (408:13): [True: 0, False: 0]
  ------------------
  409|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  410|      0|            return EXT_RETURN_FAIL;
  411|      0|        }
  412|      0|        if (!WPACKET_allocate_bytes(pkt, extlen, &extbytes)
  ------------------
  |  Branch (412:13): [True: 0, False: 0]
  ------------------
  413|      0|            || i2d_X509_EXTENSIONS(s->ext.ocsp.exts, &extbytes)
  ------------------
  |  Branch (413:16): [True: 0, False: 0]
  ------------------
  414|      0|                != extlen) {
  415|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  416|      0|            return EXT_RETURN_FAIL;
  417|      0|        }
  418|      0|    }
  419|      2|    if (!WPACKET_close(pkt) || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (419:9): [True: 0, False: 2]
  |  Branch (419:32): [True: 0, False: 2]
  ------------------
  420|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  421|      0|        return EXT_RETURN_FAIL;
  422|      0|    }
  423|       |
  424|      2|    return EXT_RETURN_SENT;
  425|      2|}
tls_construct_ctos_npn:
  432|  1.64k|{
  433|  1.64k|    if (SSL_CONNECTION_GET_CTX(s)->ext.npn_select_cb == NULL
  ------------------
  |  |   26|  1.64k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
  |  Branch (433:9): [True: 1.64k, False: 0]
  ------------------
  434|      0|        || !SSL_IS_FIRST_HANDSHAKE(s))
  ------------------
  |  |  277|      0|#define SSL_IS_FIRST_HANDSHAKE(s) ((s)->s3.tmp.finish_md_len == 0 \
  |  |  ------------------
  |  |  |  Branch (277:36): [True: 0, False: 0]
  |  |  ------------------
  |  |  278|      0|    || (s)->s3.tmp.peer_finish_md_len == 0)
  |  |  ------------------
  |  |  |  Branch (278:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  435|  1.64k|        return EXT_RETURN_NOT_SENT;
  436|       |
  437|       |    /*
  438|       |     * The client advertises an empty extension to indicate its support
  439|       |     * for Next Protocol Negotiation
  440|       |     */
  441|      0|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_next_proto_neg)
  ------------------
  |  |  891|      0|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (441:9): [True: 0, False: 0]
  ------------------
  442|      0|        || !WPACKET_put_bytes_u16(pkt, 0)) {
  ------------------
  |  |  891|      0|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (442:12): [True: 0, False: 0]
  ------------------
  443|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  444|      0|        return EXT_RETURN_FAIL;
  445|      0|    }
  446|       |
  447|      0|    return EXT_RETURN_SENT;
  448|      0|}
tls_construct_ctos_alpn:
  454|  1.64k|{
  455|  1.64k|    s->s3.alpn_sent = 0;
  456|       |
  457|  1.64k|    if (s->ext.alpn == NULL || !SSL_IS_FIRST_HANDSHAKE(s))
  ------------------
  |  |  277|    413|#define SSL_IS_FIRST_HANDSHAKE(s) ((s)->s3.tmp.finish_md_len == 0 \
  |  |  ------------------
  |  |  |  Branch (277:36): [True: 413, False: 0]
  |  |  ------------------
  |  |  278|    413|    || (s)->s3.tmp.peer_finish_md_len == 0)
  |  |  ------------------
  |  |  |  Branch (278:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (457:9): [True: 1.23k, False: 413]
  ------------------
  458|  1.23k|        return EXT_RETURN_NOT_SENT;
  459|       |
  460|    413|    if (!WPACKET_put_bytes_u16(pkt,
  ------------------
  |  |  891|    826|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (460:9): [True: 0, False: 413]
  ------------------
  461|    413|            TLSEXT_TYPE_application_layer_protocol_negotiation)
  462|       |        /* Sub-packet ALPN extension */
  463|    413|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|    826|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (463:12): [True: 0, False: 413]
  ------------------
  464|    413|        || !WPACKET_sub_memcpy_u16(pkt, s->ext.alpn, s->ext.alpn_len)
  ------------------
  |  |  920|    826|    WPACKET_sub_memcpy__((pkt), (src), (len), 2)
  ------------------
  |  Branch (464:12): [True: 0, False: 413]
  ------------------
  465|    413|        || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (465:12): [True: 0, False: 413]
  ------------------
  466|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  467|      0|        return EXT_RETURN_FAIL;
  468|      0|    }
  469|    413|    s->s3.alpn_sent = 1;
  470|       |
  471|    413|    return EXT_RETURN_SENT;
  472|    413|}
tls_construct_ctos_use_srtp:
  478|  1.64k|{
  479|  1.64k|    SSL *ssl = SSL_CONNECTION_GET_SSL(s);
  ------------------
  |  |   27|  1.64k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
  480|  1.64k|    STACK_OF(SRTP_PROTECTION_PROFILE) *clnt = SSL_get_srtp_profiles(ssl);
  ------------------
  |  |   33|  1.64k|#define STACK_OF(type) struct stack_st_##type
  ------------------
  481|  1.64k|    int i, end;
  482|       |
  483|  1.64k|    if (clnt == NULL)
  ------------------
  |  Branch (483:9): [True: 1.64k, False: 0]
  ------------------
  484|  1.64k|        return EXT_RETURN_NOT_SENT;
  485|       |
  486|      0|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_use_srtp)
  ------------------
  |  |  891|      0|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (486:9): [True: 0, False: 0]
  ------------------
  487|       |        /* Sub-packet for SRTP extension */
  488|      0|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|      0|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (488:12): [True: 0, False: 0]
  ------------------
  489|       |        /* Sub-packet for the protection profile list */
  490|      0|        || !WPACKET_start_sub_packet_u16(pkt)) {
  ------------------
  |  |  792|      0|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (490:12): [True: 0, False: 0]
  ------------------
  491|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  492|      0|        return EXT_RETURN_FAIL;
  493|      0|    }
  494|       |
  495|      0|    end = sk_SRTP_PROTECTION_PROFILE_num(clnt);
  ------------------
  |  |  250|      0|#define sk_SRTP_PROTECTION_PROFILE_num(sk) OPENSSL_sk_num(ossl_check_const_SRTP_PROTECTION_PROFILE_sk_type(sk))
  ------------------
  496|      0|    for (i = 0; i < end; i++) {
  ------------------
  |  Branch (496:17): [True: 0, False: 0]
  ------------------
  497|      0|        const SRTP_PROTECTION_PROFILE *prof = sk_SRTP_PROTECTION_PROFILE_value(clnt, i);
  ------------------
  |  |  251|      0|#define sk_SRTP_PROTECTION_PROFILE_value(sk, idx) ((SRTP_PROTECTION_PROFILE *)OPENSSL_sk_value(ossl_check_const_SRTP_PROTECTION_PROFILE_sk_type(sk), (idx)))
  ------------------
  498|       |
  499|      0|        if (prof == NULL || !WPACKET_put_bytes_u16(pkt, prof->id)) {
  ------------------
  |  |  891|      0|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (499:13): [True: 0, False: 0]
  |  Branch (499:29): [True: 0, False: 0]
  ------------------
  500|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  501|      0|            return EXT_RETURN_FAIL;
  502|      0|        }
  503|      0|    }
  504|      0|    if (!WPACKET_close(pkt)
  ------------------
  |  Branch (504:9): [True: 0, False: 0]
  ------------------
  505|       |        /* Add an empty use_mki value */
  506|      0|        || !WPACKET_put_bytes_u8(pkt, 0)
  ------------------
  |  |  889|      0|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (506:12): [True: 0, False: 0]
  ------------------
  507|      0|        || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (507:12): [True: 0, False: 0]
  ------------------
  508|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  509|      0|        return EXT_RETURN_FAIL;
  510|      0|    }
  511|       |
  512|      0|    return EXT_RETURN_SENT;
  513|      0|}
tls_construct_ctos_etm:
  519|  1.64k|{
  520|  1.64k|    if (s->options & SSL_OP_NO_ENCRYPT_THEN_MAC)
  ------------------
  |  |  398|  1.64k|#define SSL_OP_NO_ENCRYPT_THEN_MAC SSL_OP_BIT(19)
  |  |  ------------------
  |  |  |  |  350|  1.64k|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (520:9): [True: 0, False: 1.64k]
  ------------------
  521|      0|        return EXT_RETURN_NOT_SENT;
  522|       |
  523|  1.64k|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_encrypt_then_mac)
  ------------------
  |  |  891|  3.29k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (523:9): [True: 0, False: 1.64k]
  ------------------
  524|  1.64k|        || !WPACKET_put_bytes_u16(pkt, 0)) {
  ------------------
  |  |  891|  1.64k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (524:12): [True: 0, False: 1.64k]
  ------------------
  525|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  526|      0|        return EXT_RETURN_FAIL;
  527|      0|    }
  528|       |
  529|  1.64k|    return EXT_RETURN_SENT;
  530|  1.64k|}
tls_construct_ctos_sct:
  536|  1.64k|{
  537|  1.64k|    if (s->ct_validation_callback == NULL)
  ------------------
  |  Branch (537:9): [True: 1.64k, False: 0]
  ------------------
  538|  1.64k|        return EXT_RETURN_NOT_SENT;
  539|       |
  540|       |    /* Not defined for client Certificates */
  541|      0|    if (x != NULL)
  ------------------
  |  Branch (541:9): [True: 0, False: 0]
  ------------------
  542|      0|        return EXT_RETURN_NOT_SENT;
  543|       |
  544|      0|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_signed_certificate_timestamp)
  ------------------
  |  |  891|      0|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (544:9): [True: 0, False: 0]
  ------------------
  545|      0|        || !WPACKET_put_bytes_u16(pkt, 0)) {
  ------------------
  |  |  891|      0|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (545:12): [True: 0, False: 0]
  ------------------
  546|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  547|      0|        return EXT_RETURN_FAIL;
  548|      0|    }
  549|       |
  550|      0|    return EXT_RETURN_SENT;
  551|      0|}
tls_construct_ctos_ems:
  557|  1.64k|{
  558|  1.64k|    if (s->options & SSL_OP_NO_EXTENDED_MASTER_SECRET)
  ------------------
  |  |  356|  1.64k|#define SSL_OP_NO_EXTENDED_MASTER_SECRET SSL_OP_BIT(0)
  |  |  ------------------
  |  |  |  |  350|  1.64k|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (558:9): [True: 0, False: 1.64k]
  ------------------
  559|      0|        return EXT_RETURN_NOT_SENT;
  560|       |
  561|  1.64k|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_extended_master_secret)
  ------------------
  |  |  891|  3.29k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (561:9): [True: 0, False: 1.64k]
  ------------------
  562|  1.64k|        || !WPACKET_put_bytes_u16(pkt, 0)) {
  ------------------
  |  |  891|  1.64k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (562:12): [True: 0, False: 1.64k]
  ------------------
  563|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  564|      0|        return EXT_RETURN_FAIL;
  565|      0|    }
  566|       |
  567|  1.64k|    return EXT_RETURN_SENT;
  568|  1.64k|}
tls_construct_ctos_supported_versions:
  573|  1.64k|{
  574|  1.64k|    int currv, min_version, max_version, reason;
  575|       |
  576|  1.64k|    reason = ssl_get_min_max_version(s, &min_version, &max_version, NULL);
  577|  1.64k|    if (reason != 0) {
  ------------------
  |  Branch (577:9): [True: 0, False: 1.64k]
  ------------------
  578|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, reason);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  579|      0|        return EXT_RETURN_FAIL;
  580|      0|    }
  581|       |
  582|       |    /*
  583|       |     * Don't include this if we can't negotiate TLSv1.3. We can do a straight
  584|       |     * comparison here because we will never be called in DTLS.
  585|       |     */
  586|  1.64k|    if (max_version < TLS1_3_VERSION)
  ------------------
  |  |   27|  1.64k|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (586:9): [True: 11, False: 1.63k]
  ------------------
  587|     11|        return EXT_RETURN_NOT_SENT;
  588|       |
  589|  1.63k|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_supported_versions)
  ------------------
  |  |  891|  3.27k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (589:9): [True: 0, False: 1.63k]
  ------------------
  590|  1.63k|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|  3.27k|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (590:12): [True: 0, False: 1.63k]
  ------------------
  591|  1.63k|        || !WPACKET_start_sub_packet_u8(pkt)) {
  ------------------
  |  |  790|  1.63k|    WPACKET_start_sub_packet_len__((pkt), 1)
  ------------------
  |  Branch (591:12): [True: 0, False: 1.63k]
  ------------------
  592|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  593|      0|        return EXT_RETURN_FAIL;
  594|      0|    }
  595|       |
  596|  4.91k|    for (currv = max_version; currv >= min_version; currv--) {
  ------------------
  |  Branch (596:31): [True: 3.27k, False: 1.63k]
  ------------------
  597|  3.27k|        if (!WPACKET_put_bytes_u16(pkt, currv)) {
  ------------------
  |  |  891|  3.27k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (597:13): [True: 0, False: 3.27k]
  ------------------
  598|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  599|      0|            return EXT_RETURN_FAIL;
  600|      0|        }
  601|  3.27k|    }
  602|  1.63k|    if (!WPACKET_close(pkt) || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (602:9): [True: 0, False: 1.63k]
  |  Branch (602:32): [True: 0, False: 1.63k]
  ------------------
  603|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  604|      0|        return EXT_RETURN_FAIL;
  605|      0|    }
  606|       |
  607|  1.63k|    return EXT_RETURN_SENT;
  608|  1.63k|}
tls_construct_ctos_psk_kex_modes:
  616|  1.63k|{
  617|  1.63k|#ifndef OPENSSL_NO_TLS1_3
  618|  1.63k|    int nodhe = s->options & SSL_OP_ALLOW_NO_DHE_KEX;
  ------------------
  |  |  369|  1.63k|#define SSL_OP_ALLOW_NO_DHE_KEX SSL_OP_BIT(10)
  |  |  ------------------
  |  |  |  |  350|  1.63k|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  619|       |
  620|  1.63k|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_psk_kex_modes)
  ------------------
  |  |  891|  3.27k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (620:9): [True: 0, False: 1.63k]
  ------------------
  621|  1.63k|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|  3.27k|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (621:12): [True: 0, False: 1.63k]
  ------------------
  622|  1.63k|        || !WPACKET_start_sub_packet_u8(pkt)
  ------------------
  |  |  790|  3.27k|    WPACKET_start_sub_packet_len__((pkt), 1)
  ------------------
  |  Branch (622:12): [True: 0, False: 1.63k]
  ------------------
  623|  1.63k|        || !WPACKET_put_bytes_u8(pkt, TLSEXT_KEX_MODE_KE_DHE)
  ------------------
  |  |  889|  3.27k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (623:12): [True: 0, False: 1.63k]
  ------------------
  624|  1.63k|        || (nodhe && !WPACKET_put_bytes_u8(pkt, TLSEXT_KEX_MODE_KE))
  ------------------
  |  |  889|      0|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (624:13): [True: 0, False: 1.63k]
  |  Branch (624:22): [True: 0, False: 0]
  ------------------
  625|  1.63k|        || !WPACKET_close(pkt)
  ------------------
  |  Branch (625:12): [True: 0, False: 1.63k]
  ------------------
  626|  1.63k|        || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (626:12): [True: 0, False: 1.63k]
  ------------------
  627|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  628|      0|        return EXT_RETURN_FAIL;
  629|      0|    }
  630|       |
  631|  1.63k|    s->ext.psk_kex_mode = TLSEXT_KEX_MODE_FLAG_KE_DHE;
  ------------------
  |  | 2297|  1.63k|#define TLSEXT_KEX_MODE_FLAG_KE_DHE 2
  ------------------
  632|  1.63k|    if (nodhe)
  ------------------
  |  Branch (632:9): [True: 0, False: 1.63k]
  ------------------
  633|      0|        s->ext.psk_kex_mode |= TLSEXT_KEX_MODE_FLAG_KE;
  ------------------
  |  | 2296|      0|#define TLSEXT_KEX_MODE_FLAG_KE 1
  ------------------
  634|  1.63k|#endif
  635|       |
  636|  1.63k|    return EXT_RETURN_SENT;
  637|  1.63k|}
tls_construct_ctos_key_share:
  704|  1.63k|{
  705|  1.63k|#ifndef OPENSSL_NO_TLS1_3
  706|  1.63k|    size_t i, num_groups = 0;
  707|  1.63k|    const uint16_t *pgroups = NULL;
  708|  1.63k|    uint16_t group_id = 0;
  709|  1.63k|    int add_only_one = 0;
  710|  1.63k|    size_t valid_keyshare = 0;
  711|       |
  712|       |    /* key_share extension */
  713|  1.63k|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_key_share)
  ------------------
  |  |  891|  3.27k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (713:9): [True: 0, False: 1.63k]
  ------------------
  714|       |        /* Extension data sub-packet */
  715|  1.63k|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|  3.27k|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (715:12): [True: 0, False: 1.63k]
  ------------------
  716|       |        /* KeyShare list sub-packet */
  717|  1.63k|        || !WPACKET_start_sub_packet_u16(pkt)) {
  ------------------
  |  |  792|  1.63k|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (717:12): [True: 0, False: 1.63k]
  ------------------
  718|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  719|      0|        return EXT_RETURN_FAIL;
  720|      0|    }
  721|       |
  722|  1.63k|    tls1_get_requested_keyshare_groups(s, &pgroups, &num_groups);
  723|  1.63k|    if (num_groups == 1 && pgroups[0] == 0) { /* Indication that no * prefix was used */
  ------------------
  |  Branch (723:9): [True: 305, False: 1.33k]
  |  Branch (723:28): [True: 304, False: 1]
  ------------------
  724|    304|        tls1_get_supported_groups(s, &pgroups, &num_groups);
  725|    304|        add_only_one = 1;
  726|    304|    }
  727|       |
  728|       |    /* If neither the default nor the keyshares have any entry --> fatal */
  729|  1.63k|    if (num_groups == 0) {
  ------------------
  |  Branch (729:9): [True: 3, False: 1.63k]
  ------------------
  730|      3|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_SUITABLE_KEY_SHARE);
  ------------------
  |  |  148|      3|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      3|    (ERR_new(),                                                  \
  |  |  |  |  151|      3|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      3|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      3|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  731|      3|        return EXT_RETURN_FAIL;
  732|      3|    }
  733|       |
  734|       |    /* Add key shares */
  735|       |
  736|  1.63k|    if (s->s3.group_id != 0 && s->s3.tmp.pkey == NULL) {
  ------------------
  |  Branch (736:9): [True: 0, False: 1.63k]
  |  Branch (736:32): [True: 0, False: 0]
  ------------------
  737|       |        /* new, single key share */
  738|      0|        group_id = s->s3.group_id;
  739|      0|        s->s3.tmp.num_ks_pkey = 0;
  740|      0|        if (!add_key_share(s, pkt, group_id, 0)) {
  ------------------
  |  Branch (740:13): [True: 0, False: 0]
  ------------------
  741|       |            /* SSLfatal() already called */
  742|      0|            return EXT_RETURN_FAIL;
  743|      0|        }
  744|      0|        valid_keyshare++;
  745|  1.63k|    } else {
  746|  1.63k|        if (s->ext.supportedgroups == NULL) /* use default */
  ------------------
  |  Branch (746:13): [True: 0, False: 1.63k]
  ------------------
  747|      0|            add_only_one = 1;
  748|       |
  749|  4.29k|        for (i = 0; i < num_groups; i++) {
  ------------------
  |  Branch (749:21): [True: 2.96k, False: 1.32k]
  ------------------
  750|  2.96k|            if (!tls_group_allowed(s, pgroups[i], SSL_SECOP_CURVE_SUPPORTED))
  ------------------
  |  | 2758|  2.96k|#define SSL_SECOP_CURVE_SUPPORTED (4 | SSL_SECOP_OTHER_CURVE)
  |  |  ------------------
  |  |  |  | 2739|  2.96k|#define SSL_SECOP_OTHER_CURVE (2 << 16)
  |  |  ------------------
  ------------------
  |  Branch (750:17): [True: 10, False: 2.95k]
  ------------------
  751|     10|                continue;
  752|  2.95k|            if (!tls_valid_group(s, pgroups[i], TLS1_3_VERSION, TLS1_3_VERSION,
  ------------------
  |  |   27|  2.95k|#define TLS1_3_VERSION 0x0304
  ------------------
                          if (!tls_valid_group(s, pgroups[i], TLS1_3_VERSION, TLS1_3_VERSION,
  ------------------
  |  |   27|  2.95k|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (752:17): [True: 1, False: 2.95k]
  ------------------
  753|  2.95k|                    0, NULL))
  754|      1|                continue;
  755|       |
  756|  2.95k|            group_id = pgroups[i];
  757|       |
  758|  2.95k|            if (group_id == 0) {
  ------------------
  |  Branch (758:17): [True: 0, False: 2.95k]
  ------------------
  759|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_SUITABLE_KEY_SHARE);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  760|      0|                return EXT_RETURN_FAIL;
  761|      0|            }
  762|  2.95k|            if (!add_key_share(s, pkt, group_id, valid_keyshare)) {
  ------------------
  |  Branch (762:17): [True: 0, False: 2.95k]
  ------------------
  763|       |                /* SSLfatal() already called */
  764|      0|                return EXT_RETURN_FAIL;
  765|      0|            }
  766|  2.95k|            valid_keyshare++;
  767|  2.95k|            if (add_only_one)
  ------------------
  |  Branch (767:17): [True: 304, False: 2.64k]
  ------------------
  768|    304|                break;
  769|  2.95k|        }
  770|  1.63k|    }
  771|       |
  772|  1.63k|    if (valid_keyshare == 0) {
  ------------------
  |  Branch (772:9): [True: 1, False: 1.63k]
  ------------------
  773|       |        /* No key shares were allowed */
  774|      1|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_SUITABLE_KEY_SHARE);
  ------------------
  |  |  148|      1|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      1|    (ERR_new(),                                                  \
  |  |  |  |  151|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      1|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  775|      1|        return EXT_RETURN_FAIL;
  776|      1|    }
  777|       |
  778|  1.63k|    if (!WPACKET_close(pkt) || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (778:9): [True: 0, False: 1.63k]
  |  Branch (778:32): [True: 0, False: 1.63k]
  ------------------
  779|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  780|      0|        return EXT_RETURN_FAIL;
  781|      0|    }
  782|  1.63k|    return EXT_RETURN_SENT;
  783|       |#else
  784|       |    return EXT_RETURN_NOT_SENT;
  785|       |#endif
  786|  1.63k|}
tls_construct_ctos_cookie:
  791|  1.63k|{
  792|  1.63k|    EXT_RETURN ret = EXT_RETURN_FAIL;
  793|       |
  794|       |    /* Should only be set if we've had an HRR */
  795|  1.63k|    if (s->ext.tls13_cookie_len == 0)
  ------------------
  |  Branch (795:9): [True: 1.63k, False: 0]
  ------------------
  796|  1.63k|        return EXT_RETURN_NOT_SENT;
  797|       |
  798|      0|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_cookie)
  ------------------
  |  |  891|      0|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (798:9): [True: 0, False: 0]
  ------------------
  799|       |        /* Extension data sub-packet */
  800|      0|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|      0|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (800:12): [True: 0, False: 0]
  ------------------
  801|      0|        || !WPACKET_sub_memcpy_u16(pkt, s->ext.tls13_cookie,
  ------------------
  |  |  920|      0|    WPACKET_sub_memcpy__((pkt), (src), (len), 2)
  ------------------
  |  Branch (801:12): [True: 0, False: 0]
  ------------------
  802|      0|            s->ext.tls13_cookie_len)
  803|      0|        || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (803:12): [True: 0, False: 0]
  ------------------
  804|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  805|      0|        goto end;
  806|      0|    }
  807|       |
  808|      0|    ret = EXT_RETURN_SENT;
  809|      0|end:
  810|      0|    OPENSSL_free(s->ext.tls13_cookie);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  811|      0|    s->ext.tls13_cookie = NULL;
  812|      0|    s->ext.tls13_cookie_len = 0;
  813|       |
  814|      0|    return ret;
  815|      0|}
tls_construct_ctos_early_data:
  820|  1.63k|{
  821|  1.63k|#ifndef OPENSSL_NO_PSK
  822|  1.63k|    char identity[PSK_MAX_IDENTITY_LEN + 1];
  823|  1.63k|#endif /* OPENSSL_NO_PSK */
  824|  1.63k|    const unsigned char *id = NULL;
  825|  1.63k|    size_t idlen = 0;
  826|  1.63k|    SSL_SESSION *psksess = NULL;
  827|  1.63k|    SSL_SESSION *edsess = NULL;
  828|  1.63k|    const EVP_MD *handmd = NULL;
  829|  1.63k|    SSL *ussl = SSL_CONNECTION_GET_USER_SSL(s);
  ------------------
  |  |   28|  1.63k|#define SSL_CONNECTION_GET_USER_SSL(sc) ((sc)->user_ssl)
  ------------------
  830|       |
  831|  1.63k|    if (s->hello_retry_request == SSL_HRR_PENDING)
  ------------------
  |  Branch (831:9): [True: 0, False: 1.63k]
  ------------------
  832|      0|        handmd = ssl_handshake_md(s);
  833|       |
  834|  1.63k|    if (s->psk_use_session_cb != NULL
  ------------------
  |  Branch (834:9): [True: 0, False: 1.63k]
  ------------------
  835|      0|        && (!s->psk_use_session_cb(ussl, handmd, &id, &idlen, &psksess)
  ------------------
  |  Branch (835:13): [True: 0, False: 0]
  ------------------
  836|      0|            || (psksess != NULL
  ------------------
  |  Branch (836:17): [True: 0, False: 0]
  ------------------
  837|      0|                && psksess->ssl_version != TLS1_3_VERSION))) {
  ------------------
  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (837:20): [True: 0, False: 0]
  ------------------
  838|      0|        SSL_SESSION_free(psksess);
  839|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_PSK);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  840|      0|        return EXT_RETURN_FAIL;
  841|      0|    }
  842|       |
  843|  1.63k|#ifndef OPENSSL_NO_PSK
  844|  1.63k|    if (psksess == NULL && s->psk_client_callback != NULL) {
  ------------------
  |  Branch (844:9): [True: 1.63k, False: 0]
  |  Branch (844:28): [True: 0, False: 1.63k]
  ------------------
  845|      0|        unsigned char psk[PSK_MAX_PSK_LEN];
  846|      0|        size_t psklen = 0;
  847|       |
  848|      0|        memset(identity, 0, sizeof(identity));
  849|      0|        psklen = s->psk_client_callback(ussl, NULL,
  850|      0|            identity, sizeof(identity) - 1,
  851|      0|            psk, sizeof(psk));
  852|       |
  853|      0|        if (psklen > PSK_MAX_PSK_LEN) {
  ------------------
  |  |  862|      0|#define PSK_MAX_PSK_LEN 512
  ------------------
  |  Branch (853:13): [True: 0, False: 0]
  ------------------
  854|      0|            SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  855|      0|            return EXT_RETURN_FAIL;
  856|      0|        } else if (psklen > 0) {
  ------------------
  |  Branch (856:20): [True: 0, False: 0]
  ------------------
  857|      0|            const unsigned char tls13_aes128gcmsha256_id[] = { 0x13, 0x01 };
  858|      0|            const SSL_CIPHER *cipher;
  859|       |
  860|      0|            idlen = strlen(identity);
  861|      0|            if (idlen > PSK_MAX_IDENTITY_LEN) {
  ------------------
  |  |  861|      0|#define PSK_MAX_IDENTITY_LEN 256
  ------------------
  |  Branch (861:17): [True: 0, False: 0]
  ------------------
  862|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  863|      0|                return EXT_RETURN_FAIL;
  864|      0|            }
  865|      0|            id = (unsigned char *)identity;
  866|       |
  867|       |            /*
  868|       |             * We found a PSK using an old style callback. We don't know
  869|       |             * the digest so we default to SHA256 as per the TLSv1.3 spec
  870|       |             */
  871|      0|            cipher = SSL_CIPHER_find(SSL_CONNECTION_GET_SSL(s),
  ------------------
  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
  872|      0|                tls13_aes128gcmsha256_id);
  873|      0|            if (cipher == NULL) {
  ------------------
  |  Branch (873:17): [True: 0, False: 0]
  ------------------
  874|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  875|      0|                return EXT_RETURN_FAIL;
  876|      0|            }
  877|       |
  878|      0|            psksess = SSL_SESSION_new();
  879|      0|            if (psksess == NULL
  ------------------
  |  Branch (879:17): [True: 0, False: 0]
  ------------------
  880|      0|                || !SSL_SESSION_set1_master_key(psksess, psk, psklen)
  ------------------
  |  Branch (880:20): [True: 0, False: 0]
  ------------------
  881|      0|                || !SSL_SESSION_set_cipher(psksess, cipher)
  ------------------
  |  Branch (881:20): [True: 0, False: 0]
  ------------------
  882|      0|                || !SSL_SESSION_set_protocol_version(psksess, TLS1_3_VERSION)) {
  ------------------
  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (882:20): [True: 0, False: 0]
  ------------------
  883|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  884|      0|                OPENSSL_cleanse(psk, psklen);
  885|      0|                return EXT_RETURN_FAIL;
  886|      0|            }
  887|      0|            OPENSSL_cleanse(psk, psklen);
  888|      0|        }
  889|      0|    }
  890|  1.63k|#endif /* OPENSSL_NO_PSK */
  891|       |
  892|  1.63k|    SSL_SESSION_free(s->psksession);
  893|  1.63k|    s->psksession = psksess;
  894|  1.63k|    if (psksess != NULL) {
  ------------------
  |  Branch (894:9): [True: 0, False: 1.63k]
  ------------------
  895|      0|        OPENSSL_free(s->psksession_id);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  896|      0|        s->psksession_id = OPENSSL_memdup(id, idlen);
  ------------------
  |  |  133|      0|    CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  897|      0|        if (s->psksession_id == NULL) {
  ------------------
  |  Branch (897:13): [True: 0, False: 0]
  ------------------
  898|      0|            s->psksession_id_len = 0;
  899|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  900|      0|            return EXT_RETURN_FAIL;
  901|      0|        }
  902|      0|        s->psksession_id_len = idlen;
  903|      0|    }
  904|       |
  905|  1.63k|    if (s->early_data_state != SSL_EARLY_DATA_CONNECTING
  ------------------
  |  Branch (905:9): [True: 1.63k, False: 0]
  ------------------
  906|      0|        || (s->session->ext.max_early_data == 0
  ------------------
  |  Branch (906:13): [True: 0, False: 0]
  ------------------
  907|  1.63k|            && (psksess == NULL || psksess->ext.max_early_data == 0))) {
  ------------------
  |  Branch (907:17): [True: 0, False: 0]
  |  Branch (907:36): [True: 0, False: 0]
  ------------------
  908|  1.63k|        s->max_early_data = 0;
  909|  1.63k|        return EXT_RETURN_NOT_SENT;
  910|  1.63k|    }
  911|      0|    edsess = s->session->ext.max_early_data != 0 ? s->session : psksess;
  ------------------
  |  Branch (911:14): [True: 0, False: 0]
  ------------------
  912|      0|    s->max_early_data = edsess->ext.max_early_data;
  913|       |
  914|      0|    if (edsess->ext.hostname != NULL) {
  ------------------
  |  Branch (914:9): [True: 0, False: 0]
  ------------------
  915|      0|        if (s->ext.hostname == NULL
  ------------------
  |  Branch (915:13): [True: 0, False: 0]
  ------------------
  916|      0|            || (s->ext.hostname != NULL
  ------------------
  |  Branch (916:17): [True: 0, False: 0]
  ------------------
  917|      0|                && strcmp(s->ext.hostname, edsess->ext.hostname) != 0)) {
  ------------------
  |  Branch (917:20): [True: 0, False: 0]
  ------------------
  918|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR,
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  919|      0|                SSL_R_INCONSISTENT_EARLY_DATA_SNI);
  920|      0|            return EXT_RETURN_FAIL;
  921|      0|        }
  922|      0|    }
  923|       |
  924|      0|    if ((s->ext.alpn == NULL && edsess->ext.alpn_selected != NULL)) {
  ------------------
  |  Branch (924:10): [True: 0, False: 0]
  |  Branch (924:33): [True: 0, False: 0]
  ------------------
  925|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_INCONSISTENT_EARLY_DATA_ALPN);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  926|      0|        return EXT_RETURN_FAIL;
  927|      0|    }
  928|       |
  929|       |    /*
  930|       |     * Verify that we are offering an ALPN protocol consistent with the early
  931|       |     * data.
  932|       |     */
  933|      0|    if (edsess->ext.alpn_selected != NULL) {
  ------------------
  |  Branch (933:9): [True: 0, False: 0]
  ------------------
  934|      0|        PACKET prots, alpnpkt;
  935|      0|        int found = 0;
  936|       |
  937|      0|        if (!PACKET_buf_init(&prots, s->ext.alpn, s->ext.alpn_len)) {
  ------------------
  |  Branch (937:13): [True: 0, False: 0]
  ------------------
  938|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  939|      0|            return EXT_RETURN_FAIL;
  940|      0|        }
  941|      0|        while (PACKET_get_length_prefixed_1(&prots, &alpnpkt)) {
  ------------------
  |  Branch (941:16): [True: 0, False: 0]
  ------------------
  942|      0|            if (PACKET_equal(&alpnpkt, edsess->ext.alpn_selected,
  ------------------
  |  Branch (942:17): [True: 0, False: 0]
  ------------------
  943|      0|                    edsess->ext.alpn_selected_len)) {
  944|      0|                found = 1;
  945|      0|                break;
  946|      0|            }
  947|      0|        }
  948|      0|        if (!found) {
  ------------------
  |  Branch (948:13): [True: 0, False: 0]
  ------------------
  949|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR,
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  950|      0|                SSL_R_INCONSISTENT_EARLY_DATA_ALPN);
  951|      0|            return EXT_RETURN_FAIL;
  952|      0|        }
  953|      0|    }
  954|       |
  955|      0|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_early_data)
  ------------------
  |  |  891|      0|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (955:9): [True: 0, False: 0]
  ------------------
  956|      0|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|      0|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (956:12): [True: 0, False: 0]
  ------------------
  957|      0|        || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (957:12): [True: 0, False: 0]
  ------------------
  958|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  959|      0|        return EXT_RETURN_FAIL;
  960|      0|    }
  961|       |
  962|       |    /*
  963|       |     * We set this to rejected here. Later, if the server acknowledges the
  964|       |     * extension, we set it to accepted.
  965|       |     */
  966|      0|    s->ext.early_data = SSL_EARLY_DATA_REJECTED;
  ------------------
  |  | 2036|      0|#define SSL_EARLY_DATA_REJECTED 1
  ------------------
  967|      0|    s->ext.early_data_ok = 1;
  968|       |
  969|      0|    return EXT_RETURN_SENT;
  970|      0|}
tls_construct_ctos_padding:
  992|  1.64k|{
  993|  1.64k|    unsigned char *padbytes;
  994|  1.64k|    size_t hlen;
  995|       |
  996|  1.64k|    if ((s->options & SSL_OP_TLSEXT_PADDING) == 0)
  ------------------
  |  |  363|  1.64k|#define SSL_OP_TLSEXT_PADDING SSL_OP_BIT(4)
  |  |  ------------------
  |  |  |  |  350|  1.64k|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (996:9): [True: 0, False: 1.64k]
  ------------------
  997|      0|        return EXT_RETURN_NOT_SENT;
  998|       |
  999|       |    /*
 1000|       |     * Add padding to workaround bugs in F5 terminators. See RFC7685.
 1001|       |     * This code calculates the length of all extensions added so far but
 1002|       |     * excludes the PSK extension (because that MUST be written last). Therefore
 1003|       |     * this extension MUST always appear second to last.
 1004|       |     */
 1005|  1.64k|    if (!WPACKET_get_total_written(pkt, &hlen)) {
  ------------------
  |  Branch (1005:9): [True: 0, False: 1.64k]
  ------------------
 1006|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1007|      0|        return EXT_RETURN_FAIL;
 1008|      0|    }
 1009|       |
 1010|       |    /*
 1011|       |     * If we're going to send a PSK then that will be written out after this
 1012|       |     * extension, so we need to calculate how long it is going to be.
 1013|       |     */
 1014|  1.64k|    if (s->session->ssl_version == TLS1_3_VERSION
  ------------------
  |  |   27|  3.28k|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (1014:9): [True: 1.63k, False: 11]
  ------------------
 1015|  1.63k|        && s->session->ext.ticklen != 0
  ------------------
  |  Branch (1015:12): [True: 0, False: 1.63k]
  ------------------
 1016|      0|        && s->session->cipher != NULL) {
  ------------------
  |  Branch (1016:12): [True: 0, False: 0]
  ------------------
 1017|      0|        const EVP_MD *md = ssl_md(SSL_CONNECTION_GET_CTX(s),
  ------------------
  |  |   26|      0|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
 1018|      0|            s->session->cipher->algorithm2);
 1019|       |
 1020|      0|        if (md != NULL) {
  ------------------
  |  Branch (1020:13): [True: 0, False: 0]
  ------------------
 1021|       |            /*
 1022|       |             * Add the fixed PSK overhead, the identity length and the binder
 1023|       |             * length.
 1024|       |             */
 1025|      0|            int md_size = EVP_MD_get_size(md);
 1026|       |
 1027|      0|            if (md_size <= 0)
  ------------------
  |  Branch (1027:17): [True: 0, False: 0]
  ------------------
 1028|      0|                return EXT_RETURN_FAIL;
 1029|      0|            hlen += PSK_PRE_BINDER_OVERHEAD + s->session->ext.ticklen
  ------------------
  |  |  987|      0|#define PSK_PRE_BINDER_OVERHEAD (2 + 2 + 2 + 2 + 4 + 2 + 1)
  ------------------
 1030|      0|                + md_size;
 1031|      0|        }
 1032|      0|    }
 1033|       |
 1034|  1.64k|    if (hlen > F5_WORKAROUND_MIN_MSG_LEN && hlen < F5_WORKAROUND_MAX_MSG_LEN) {
  ------------------
  |  |  972|  3.28k|#define F5_WORKAROUND_MIN_MSG_LEN 0xff
  ------------------
                  if (hlen > F5_WORKAROUND_MIN_MSG_LEN && hlen < F5_WORKAROUND_MAX_MSG_LEN) {
  ------------------
  |  |  973|  1.62k|#define F5_WORKAROUND_MAX_MSG_LEN 0x200
  ------------------
  |  Branch (1034:9): [True: 1.62k, False: 20]
  |  Branch (1034:45): [True: 235, False: 1.38k]
  ------------------
 1035|       |        /* Calculate the amount of padding we need to add */
 1036|    235|        hlen = F5_WORKAROUND_MAX_MSG_LEN - hlen;
  ------------------
  |  |  973|    235|#define F5_WORKAROUND_MAX_MSG_LEN 0x200
  ------------------
 1037|       |
 1038|       |        /*
 1039|       |         * Take off the size of extension header itself (2 bytes for type and
 1040|       |         * 2 bytes for length bytes), but ensure that the extension is at least
 1041|       |         * 1 byte long so as not to have an empty extension last (WebSphere 7.x,
 1042|       |         * 8.x are intolerant of that condition)
 1043|       |         */
 1044|    235|        if (hlen > 4)
  ------------------
  |  Branch (1044:13): [True: 229, False: 6]
  ------------------
 1045|    229|            hlen -= 4;
 1046|      6|        else
 1047|      6|            hlen = 1;
 1048|       |
 1049|    235|        if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_padding)
  ------------------
  |  |  891|    470|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (1049:13): [True: 0, False: 235]
  ------------------
 1050|    235|            || !WPACKET_sub_allocate_bytes_u16(pkt, hlen, &padbytes)) {
  ------------------
  |  |  831|    235|    WPACKET_sub_allocate_bytes__((pkt), (len), (bytes), 2)
  ------------------
  |  Branch (1050:16): [True: 0, False: 235]
  ------------------
 1051|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1052|      0|            return EXT_RETURN_FAIL;
 1053|      0|        }
 1054|    235|        memset(padbytes, 0, hlen);
 1055|    235|    }
 1056|       |
 1057|  1.64k|    return EXT_RETURN_SENT;
 1058|  1.64k|}
tls_construct_ctos_psk:
 1066|  1.63k|{
 1067|  1.63k|#ifndef OPENSSL_NO_TLS1_3
 1068|  1.63k|    uint32_t agesec, agems = 0;
 1069|  1.63k|    size_t binderoffset, msglen;
 1070|  1.63k|    int reshashsize = 0, pskhashsize = 0;
 1071|  1.63k|    unsigned char *resbinder = NULL, *pskbinder = NULL, *msgstart = NULL;
 1072|  1.63k|    const EVP_MD *handmd = NULL, *mdres = NULL, *mdpsk = NULL;
 1073|  1.63k|    int dores = 0;
 1074|  1.63k|    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
  ------------------
  |  |   26|  1.63k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
 1075|  1.63k|    OSSL_TIME t;
 1076|       |
 1077|  1.63k|    s->ext.tick_identity = 0;
 1078|       |
 1079|       |    /*
 1080|       |     * Note: At this stage of the code we only support adding a single
 1081|       |     * resumption PSK. If we add support for multiple PSKs then the length
 1082|       |     * calculations in the padding extension will need to be adjusted.
 1083|       |     */
 1084|       |
 1085|       |    /*
 1086|       |     * If this is an incompatible or new session then we have nothing to resume
 1087|       |     * so don't add this extension.
 1088|       |     */
 1089|  1.63k|    if (s->session->ssl_version != TLS1_3_VERSION
  ------------------
  |  |   27|  3.26k|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (1089:9): [True: 0, False: 1.63k]
  ------------------
 1090|  1.63k|        || (s->session->ext.ticklen == 0 && s->psksession == NULL))
  ------------------
  |  Branch (1090:13): [True: 1.63k, False: 0]
  |  Branch (1090:45): [True: 1.63k, False: 0]
  ------------------
 1091|  1.63k|        return EXT_RETURN_NOT_SENT;
 1092|       |
 1093|      0|    if (s->hello_retry_request == SSL_HRR_PENDING)
  ------------------
  |  Branch (1093:9): [True: 0, False: 0]
  ------------------
 1094|      0|        handmd = ssl_handshake_md(s);
 1095|       |
 1096|      0|    if (s->session->ext.ticklen != 0) {
  ------------------
  |  Branch (1096:9): [True: 0, False: 0]
  ------------------
 1097|       |        /* Get the digest associated with the ciphersuite in the session */
 1098|      0|        if (s->session->cipher == NULL) {
  ------------------
  |  Branch (1098:13): [True: 0, False: 0]
  ------------------
 1099|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1100|      0|            return EXT_RETURN_FAIL;
 1101|      0|        }
 1102|      0|        mdres = ssl_md(sctx, s->session->cipher->algorithm2);
 1103|      0|        if (mdres == NULL) {
  ------------------
  |  Branch (1103:13): [True: 0, False: 0]
  ------------------
 1104|       |            /*
 1105|       |             * Don't recognize this cipher so we can't use the session.
 1106|       |             * Ignore it
 1107|       |             */
 1108|      0|            goto dopsksess;
 1109|      0|        }
 1110|       |
 1111|      0|        if (s->hello_retry_request == SSL_HRR_PENDING && mdres != handmd) {
  ------------------
  |  Branch (1111:13): [True: 0, False: 0]
  |  Branch (1111:58): [True: 0, False: 0]
  ------------------
 1112|       |            /*
 1113|       |             * Selected ciphersuite hash does not match the hash for the session
 1114|       |             * so we can't use it.
 1115|       |             */
 1116|      0|            goto dopsksess;
 1117|      0|        }
 1118|       |
 1119|       |        /*
 1120|       |         * Technically the C standard just says time() returns a time_t and says
 1121|       |         * nothing about the encoding of that type. In practice most
 1122|       |         * implementations follow POSIX which holds it as an integral type in
 1123|       |         * seconds since epoch. We've already made the assumption that we can do
 1124|       |         * this in multiple places in the code, so portability shouldn't be an
 1125|       |         * issue.
 1126|       |         */
 1127|      0|        t = ossl_time_subtract(ossl_time_now(), s->session->time);
 1128|      0|        agesec = (uint32_t)ossl_time2seconds(t);
  ------------------
  |  |   43|      0|#define ossl_time2seconds(t) (ossl_time2ticks(t) / OSSL_TIME_SECOND)
  |  |  ------------------
  |  |  |  |   31|      0|#define OSSL_TIME_SECOND ((uint64_t)1000000000)
  |  |  ------------------
  ------------------
 1129|       |        /*
 1130|       |         * We calculate the age in seconds but the server may work in ms. Due to
 1131|       |         * rounding errors we could overestimate the age by up to 1s. It is
 1132|       |         * better to underestimate it. Otherwise, if the RTT is very short, when
 1133|       |         * the server calculates the age reported by the client it could be
 1134|       |         * bigger than the age calculated on the server - which should never
 1135|       |         * happen.
 1136|       |         */
 1137|      0|        if (agesec > 0)
  ------------------
  |  Branch (1137:13): [True: 0, False: 0]
  ------------------
 1138|      0|            agesec--;
 1139|       |
 1140|      0|        if (s->session->ext.tick_lifetime_hint < agesec) {
  ------------------
  |  Branch (1140:13): [True: 0, False: 0]
  ------------------
 1141|       |            /* Ticket is too old. Ignore it. */
 1142|      0|            goto dopsksess;
 1143|      0|        }
 1144|       |
 1145|       |        /*
 1146|       |         * Calculate age in ms. We're just doing it to nearest second. Should be
 1147|       |         * good enough.
 1148|       |         */
 1149|      0|        agems = agesec * (uint32_t)1000;
 1150|       |
 1151|      0|        if (agesec != 0 && agems / (uint32_t)1000 != agesec) {
  ------------------
  |  Branch (1151:13): [True: 0, False: 0]
  |  Branch (1151:28): [True: 0, False: 0]
  ------------------
 1152|       |            /*
 1153|       |             * Overflow. Shouldn't happen unless this is a *really* old session.
 1154|       |             * If so we just ignore it.
 1155|       |             */
 1156|      0|            goto dopsksess;
 1157|      0|        }
 1158|       |
 1159|       |        /*
 1160|       |         * Obfuscate the age. Overflow here is fine, this addition is supposed
 1161|       |         * to be mod 2^32.
 1162|       |         */
 1163|      0|        agems += s->session->ext.tick_age_add;
 1164|       |
 1165|      0|        reshashsize = EVP_MD_get_size(mdres);
 1166|      0|        if (reshashsize <= 0)
  ------------------
  |  Branch (1166:13): [True: 0, False: 0]
  ------------------
 1167|      0|            goto dopsksess;
 1168|      0|        s->ext.tick_identity++;
 1169|      0|        dores = 1;
 1170|      0|    }
 1171|       |
 1172|      0|dopsksess:
 1173|      0|    if (!dores && s->psksession == NULL)
  ------------------
  |  Branch (1173:9): [True: 0, False: 0]
  |  Branch (1173:19): [True: 0, False: 0]
  ------------------
 1174|      0|        return EXT_RETURN_NOT_SENT;
 1175|       |
 1176|      0|    if (s->psksession != NULL) {
  ------------------
  |  Branch (1176:9): [True: 0, False: 0]
  ------------------
 1177|      0|        mdpsk = ssl_md(sctx, s->psksession->cipher->algorithm2);
 1178|      0|        if (mdpsk == NULL) {
  ------------------
  |  Branch (1178:13): [True: 0, False: 0]
  ------------------
 1179|       |            /*
 1180|       |             * Don't recognize this cipher so we can't use the session.
 1181|       |             * If this happens it's an application bug.
 1182|       |             */
 1183|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_PSK);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1184|      0|            return EXT_RETURN_FAIL;
 1185|      0|        }
 1186|       |
 1187|      0|        if (s->hello_retry_request == SSL_HRR_PENDING && mdpsk != handmd) {
  ------------------
  |  Branch (1187:13): [True: 0, False: 0]
  |  Branch (1187:58): [True: 0, False: 0]
  ------------------
 1188|       |            /*
 1189|       |             * Selected ciphersuite hash does not match the hash for the PSK
 1190|       |             * session. This is an application bug.
 1191|       |             */
 1192|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_PSK);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1193|      0|            return EXT_RETURN_FAIL;
 1194|      0|        }
 1195|       |
 1196|      0|        pskhashsize = EVP_MD_get_size(mdpsk);
 1197|      0|        if (pskhashsize <= 0) {
  ------------------
  |  Branch (1197:13): [True: 0, False: 0]
  ------------------
 1198|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_PSK);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1199|      0|            return EXT_RETURN_FAIL;
 1200|      0|        }
 1201|      0|    }
 1202|       |
 1203|       |    /* Create the extension, but skip over the binder for now */
 1204|      0|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_psk)
  ------------------
  |  |  891|      0|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (1204:9): [True: 0, False: 0]
  ------------------
 1205|      0|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|      0|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (1205:12): [True: 0, False: 0]
  ------------------
 1206|      0|        || !WPACKET_start_sub_packet_u16(pkt)) {
  ------------------
  |  |  792|      0|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (1206:12): [True: 0, False: 0]
  ------------------
 1207|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1208|      0|        return EXT_RETURN_FAIL;
 1209|      0|    }
 1210|       |
 1211|      0|    if (dores) {
  ------------------
  |  Branch (1211:9): [True: 0, False: 0]
  ------------------
 1212|      0|        if (!WPACKET_sub_memcpy_u16(pkt, s->session->ext.tick,
  ------------------
  |  |  920|      0|    WPACKET_sub_memcpy__((pkt), (src), (len), 2)
  ------------------
  |  Branch (1212:13): [True: 0, False: 0]
  ------------------
 1213|      0|                s->session->ext.ticklen)
 1214|      0|            || !WPACKET_put_bytes_u32(pkt, agems)) {
  ------------------
  |  |  895|      0|    WPACKET_put_bytes__((pkt), (val), 4)
  ------------------
  |  Branch (1214:16): [True: 0, False: 0]
  ------------------
 1215|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1216|      0|            return EXT_RETURN_FAIL;
 1217|      0|        }
 1218|      0|    }
 1219|       |
 1220|      0|    if (s->psksession != NULL) {
  ------------------
  |  Branch (1220:9): [True: 0, False: 0]
  ------------------
 1221|      0|        if (!WPACKET_sub_memcpy_u16(pkt, s->psksession_id,
  ------------------
  |  |  920|      0|    WPACKET_sub_memcpy__((pkt), (src), (len), 2)
  ------------------
  |  Branch (1221:13): [True: 0, False: 0]
  ------------------
 1222|      0|                s->psksession_id_len)
 1223|      0|            || !WPACKET_put_bytes_u32(pkt, 0)) {
  ------------------
  |  |  895|      0|    WPACKET_put_bytes__((pkt), (val), 4)
  ------------------
  |  Branch (1223:16): [True: 0, False: 0]
  ------------------
 1224|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1225|      0|            return EXT_RETURN_FAIL;
 1226|      0|        }
 1227|      0|        s->ext.tick_identity++;
 1228|      0|    }
 1229|       |
 1230|      0|    if (!WPACKET_close(pkt)
  ------------------
  |  Branch (1230:9): [True: 0, False: 0]
  ------------------
 1231|      0|        || !WPACKET_get_total_written(pkt, &binderoffset)
  ------------------
  |  Branch (1231:12): [True: 0, False: 0]
  ------------------
 1232|      0|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|      0|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (1232:12): [True: 0, False: 0]
  ------------------
 1233|      0|        || (dores
  ------------------
  |  Branch (1233:13): [True: 0, False: 0]
  ------------------
 1234|      0|            && !WPACKET_sub_allocate_bytes_u8(pkt, reshashsize, &resbinder))
  ------------------
  |  |  829|      0|    WPACKET_sub_allocate_bytes__((pkt), (len), (bytes), 1)
  ------------------
  |  Branch (1234:16): [True: 0, False: 0]
  ------------------
 1235|      0|        || (s->psksession != NULL
  ------------------
  |  Branch (1235:13): [True: 0, False: 0]
  ------------------
 1236|      0|            && !WPACKET_sub_allocate_bytes_u8(pkt, pskhashsize, &pskbinder))
  ------------------
  |  |  829|      0|    WPACKET_sub_allocate_bytes__((pkt), (len), (bytes), 1)
  ------------------
  |  Branch (1236:16): [True: 0, False: 0]
  ------------------
 1237|      0|        || !WPACKET_close(pkt)
  ------------------
  |  Branch (1237:12): [True: 0, False: 0]
  ------------------
 1238|      0|        || !WPACKET_close(pkt)
  ------------------
  |  Branch (1238:12): [True: 0, False: 0]
  ------------------
 1239|      0|        || !WPACKET_get_total_written(pkt, &msglen)
  ------------------
  |  Branch (1239:12): [True: 0, False: 0]
  ------------------
 1240|       |        /*
 1241|       |         * We need to fill in all the sub-packet lengths now so we can
 1242|       |         * calculate the HMAC of the message up to the binders
 1243|       |         */
 1244|      0|        || !WPACKET_fill_lengths(pkt)) {
  ------------------
  |  Branch (1244:12): [True: 0, False: 0]
  ------------------
 1245|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1246|      0|        return EXT_RETURN_FAIL;
 1247|      0|    }
 1248|       |
 1249|      0|    msgstart = WPACKET_get_curr(pkt) - msglen;
 1250|       |
 1251|      0|    if (dores
  ------------------
  |  Branch (1251:9): [True: 0, False: 0]
  ------------------
 1252|      0|        && tls_psk_do_binder(s, mdres, msgstart, binderoffset, NULL,
  ------------------
  |  Branch (1252:12): [True: 0, False: 0]
  ------------------
 1253|      0|               resbinder, s->session, 1, 0)
 1254|      0|            != 1) {
 1255|       |        /* SSLfatal() already called */
 1256|      0|        return EXT_RETURN_FAIL;
 1257|      0|    }
 1258|       |
 1259|      0|    if (s->psksession != NULL
  ------------------
  |  Branch (1259:9): [True: 0, False: 0]
  ------------------
 1260|      0|        && tls_psk_do_binder(s, mdpsk, msgstart, binderoffset, NULL,
  ------------------
  |  Branch (1260:12): [True: 0, False: 0]
  ------------------
 1261|      0|               pskbinder, s->psksession, 1, 1)
 1262|      0|            != 1) {
 1263|       |        /* SSLfatal() already called */
 1264|      0|        return EXT_RETURN_FAIL;
 1265|      0|    }
 1266|       |
 1267|      0|    return EXT_RETURN_SENT;
 1268|       |#else
 1269|       |    return EXT_RETURN_NOT_SENT;
 1270|       |#endif
 1271|      0|}
tls_construct_ctos_post_handshake_auth:
 1277|  1.63k|{
 1278|  1.63k|#ifndef OPENSSL_NO_TLS1_3
 1279|  1.63k|    if (!s->pha_enabled)
  ------------------
  |  Branch (1279:9): [True: 0, False: 1.63k]
  ------------------
 1280|      0|        return EXT_RETURN_NOT_SENT;
 1281|       |
 1282|       |    /* construct extension - 0 length, no contents */
 1283|  1.63k|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_post_handshake_auth)
  ------------------
  |  |  891|  3.27k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (1283:9): [True: 0, False: 1.63k]
  ------------------
 1284|  1.63k|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|  3.27k|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (1284:12): [True: 0, False: 1.63k]
  ------------------
 1285|  1.63k|        || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (1285:12): [True: 0, False: 1.63k]
  ------------------
 1286|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1287|      0|        return EXT_RETURN_FAIL;
 1288|      0|    }
 1289|       |
 1290|  1.63k|    s->post_handshake_auth = SSL_PHA_EXT_SENT;
 1291|       |
 1292|  1.63k|    return EXT_RETURN_SENT;
 1293|       |#else
 1294|       |    return EXT_RETURN_NOT_SENT;
 1295|       |#endif
 1296|  1.63k|}
tls_parse_stoc_renegotiate:
 1304|      2|{
 1305|      2|    size_t expected_len = s->s3.previous_client_finished_len
 1306|      2|        + s->s3.previous_server_finished_len;
 1307|      2|    size_t ilen;
 1308|      2|    const unsigned char *data;
 1309|       |
 1310|       |    /* Check for logic errors */
 1311|      2|    if (!ossl_assert(expected_len == 0
  ------------------
  |  |   52|      4|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  ------------------
  |  |  |  Branch (52:41): [True: 2, False: 0]
  |  |  |  Branch (52:41): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|      4|    __FILE__, __LINE__)
  ------------------
  |  Branch (1311:9): [True: 0, False: 2]
  ------------------
 1312|      2|            || s->s3.previous_client_finished_len != 0)
 1313|      2|        || !ossl_assert(expected_len == 0
  ------------------
  |  |   52|      2|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  ------------------
  |  |  |  Branch (52:41): [True: 2, False: 0]
  |  |  |  Branch (52:41): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|      2|    __FILE__, __LINE__)
  ------------------
  |  Branch (1313:12): [True: 0, False: 2]
  ------------------
 1314|      2|            || s->s3.previous_server_finished_len != 0)) {
 1315|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1316|      0|        return 0;
 1317|      0|    }
 1318|       |
 1319|       |    /* Parse the length byte */
 1320|      2|    if (!PACKET_get_1_len(pkt, &ilen)) {
  ------------------
  |  Branch (1320:9): [True: 1, False: 1]
  ------------------
 1321|      1|        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_RENEGOTIATION_ENCODING_ERR);
  ------------------
  |  |  148|      1|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      1|    (ERR_new(),                                                  \
  |  |  |  |  151|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      1|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1322|      1|        return 0;
 1323|      1|    }
 1324|       |
 1325|       |    /* Consistency check */
 1326|      1|    if (PACKET_remaining(pkt) != ilen) {
  ------------------
  |  Branch (1326:9): [True: 1, False: 0]
  ------------------
 1327|      1|        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_RENEGOTIATION_ENCODING_ERR);
  ------------------
  |  |  148|      1|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      1|    (ERR_new(),                                                  \
  |  |  |  |  151|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      1|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1328|      1|        return 0;
 1329|      1|    }
 1330|       |
 1331|       |    /* Check that the extension matches */
 1332|      0|    if (ilen != expected_len) {
  ------------------
  |  Branch (1332:9): [True: 0, False: 0]
  ------------------
 1333|      0|        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_RENEGOTIATION_MISMATCH);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1334|      0|        return 0;
 1335|      0|    }
 1336|       |
 1337|      0|    if (!PACKET_get_bytes(pkt, &data, s->s3.previous_client_finished_len)
  ------------------
  |  Branch (1337:9): [True: 0, False: 0]
  ------------------
 1338|      0|        || memcmp(data, s->s3.previous_client_finished,
  ------------------
  |  Branch (1338:12): [True: 0, False: 0]
  ------------------
 1339|      0|               s->s3.previous_client_finished_len)
 1340|      0|            != 0) {
 1341|      0|        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_RENEGOTIATION_MISMATCH);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1342|      0|        return 0;
 1343|      0|    }
 1344|       |
 1345|      0|    if (!PACKET_get_bytes(pkt, &data, s->s3.previous_server_finished_len)
  ------------------
  |  Branch (1345:9): [True: 0, False: 0]
  ------------------
 1346|      0|        || memcmp(data, s->s3.previous_server_finished,
  ------------------
  |  Branch (1346:12): [True: 0, False: 0]
  ------------------
 1347|      0|               s->s3.previous_server_finished_len)
 1348|      0|            != 0) {
 1349|      0|        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_RENEGOTIATION_MISMATCH);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1350|      0|        return 0;
 1351|      0|    }
 1352|      0|    s->s3.send_connection_binding = 1;
 1353|       |
 1354|      0|    return 1;
 1355|      0|}
tls_parse_stoc_ec_pt_formats:
 1429|      4|{
 1430|      4|    size_t ecpointformats_len;
 1431|      4|    PACKET ecptformatlist;
 1432|       |
 1433|      4|    if (!PACKET_as_length_prefixed_1(pkt, &ecptformatlist)) {
  ------------------
  |  Branch (1433:9): [True: 3, False: 1]
  ------------------
 1434|      3|        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
  ------------------
  |  |  148|      3|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      3|    (ERR_new(),                                                  \
  |  |  |  |  151|      3|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      3|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      3|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1435|      3|        return 0;
 1436|      3|    }
 1437|      1|    if (!s->hit) {
  ------------------
  |  Branch (1437:9): [True: 1, False: 0]
  ------------------
 1438|      1|        ecpointformats_len = PACKET_remaining(&ecptformatlist);
 1439|      1|        if (ecpointformats_len == 0) {
  ------------------
  |  Branch (1439:13): [True: 0, False: 1]
  ------------------
 1440|      0|            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_LENGTH);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1441|      0|            return 0;
 1442|      0|        }
 1443|       |
 1444|      1|        s->ext.peer_ecpointformats_len = 0;
 1445|      1|        OPENSSL_free(s->ext.peer_ecpointformats);
  ------------------
  |  |  131|      1|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1446|      1|        s->ext.peer_ecpointformats = OPENSSL_malloc(ecpointformats_len);
  ------------------
  |  |  106|      1|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1447|      1|        if (s->ext.peer_ecpointformats == NULL) {
  ------------------
  |  Branch (1447:13): [True: 0, False: 1]
  ------------------
 1448|      0|            s->ext.peer_ecpointformats_len = 0;
 1449|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1450|      0|            return 0;
 1451|      0|        }
 1452|       |
 1453|      1|        s->ext.peer_ecpointformats_len = ecpointformats_len;
 1454|       |
 1455|      1|        if (!PACKET_copy_bytes(&ecptformatlist,
  ------------------
  |  Branch (1455:13): [True: 0, False: 1]
  ------------------
 1456|      1|                s->ext.peer_ecpointformats,
 1457|      1|                ecpointformats_len)) {
 1458|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1459|      0|            return 0;
 1460|      0|        }
 1461|      1|    }
 1462|       |
 1463|      1|    return 1;
 1464|      1|}
tls_parse_stoc_sct:
 1529|      1|{
 1530|      1|    if (context == SSL_EXT_TLS1_3_CERTIFICATE_REQUEST) {
  ------------------
  |  |  307|      1|#define SSL_EXT_TLS1_3_CERTIFICATE_REQUEST 0x04000
  ------------------
  |  Branch (1530:9): [True: 0, False: 1]
  ------------------
 1531|       |        /* We ignore this if the server sends it in a CertificateRequest */
 1532|      0|        return 1;
 1533|      0|    }
 1534|       |
 1535|       |    /*
 1536|       |     * Only take it if we asked for it - i.e if there is no CT validation
 1537|       |     * callback set, then a custom extension MAY be processing it, so we
 1538|       |     * need to let control continue to flow to that.
 1539|       |     */
 1540|      1|    if (s->ct_validation_callback != NULL) {
  ------------------
  |  Branch (1540:9): [True: 0, False: 1]
  ------------------
 1541|      0|        size_t size = PACKET_remaining(pkt);
 1542|       |
 1543|       |        /* Simply copy it off for later processing */
 1544|      0|        OPENSSL_free(s->ext.scts);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1545|      0|        s->ext.scts = NULL;
 1546|       |
 1547|      0|        s->ext.scts_len = (uint16_t)size;
 1548|      0|        if (size > 0) {
  ------------------
  |  Branch (1548:13): [True: 0, False: 0]
  ------------------
 1549|      0|            s->ext.scts = OPENSSL_malloc(size);
  ------------------
  |  |  106|      0|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1550|      0|            if (s->ext.scts == NULL) {
  ------------------
  |  Branch (1550:17): [True: 0, False: 0]
  ------------------
 1551|      0|                s->ext.scts_len = 0;
 1552|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1553|      0|                return 0;
 1554|      0|            }
 1555|      0|            if (!PACKET_copy_bytes(pkt, s->ext.scts, size)) {
  ------------------
  |  Branch (1555:17): [True: 0, False: 0]
  ------------------
 1556|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1557|      0|                return 0;
 1558|      0|            }
 1559|      0|        }
 1560|      1|    } else {
 1561|      1|        ENDPOINT role = (context & SSL_EXT_TLS1_2_SERVER_HELLO) != 0
  ------------------
  |  |  301|      1|#define SSL_EXT_TLS1_2_SERVER_HELLO 0x00100
  ------------------
  |  Branch (1561:25): [True: 1, False: 0]
  ------------------
 1562|      1|            ? ENDPOINT_CLIENT
 1563|      1|            : ENDPOINT_BOTH;
 1564|       |
 1565|       |        /*
 1566|       |         * If we didn't ask for it then there must be a custom extension,
 1567|       |         * otherwise this is unsolicited.
 1568|       |         */
 1569|      1|        if (custom_ext_find(&s->cert->custext, role,
  ------------------
  |  Branch (1569:13): [True: 1, False: 0]
  ------------------
 1570|      1|                TLSEXT_TYPE_signed_certificate_timestamp,
  ------------------
  |  |  122|      1|#define TLSEXT_TYPE_signed_certificate_timestamp 18
  ------------------
 1571|      1|                NULL)
 1572|      1|            == NULL) {
 1573|      1|            SSLfatal(s, TLS1_AD_UNSUPPORTED_EXTENSION, SSL_R_BAD_EXTENSION);
  ------------------
  |  |  148|      1|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      1|    (ERR_new(),                                                  \
  |  |  |  |  151|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      1|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1574|      1|            return 0;
 1575|      1|        }
 1576|       |
 1577|      0|        if (!custom_ext_parse(s, context,
  ------------------
  |  Branch (1577:13): [True: 0, False: 0]
  ------------------
 1578|      0|                TLSEXT_TYPE_signed_certificate_timestamp,
  ------------------
  |  |  122|      0|#define TLSEXT_TYPE_signed_certificate_timestamp 18
  ------------------
 1579|      0|                PACKET_data(pkt), PACKET_remaining(pkt),
 1580|      0|                x, chainidx)) {
 1581|       |            /* SSLfatal already called */
 1582|      0|            return 0;
 1583|      0|        }
 1584|      0|    }
 1585|       |
 1586|      0|    return 1;
 1587|      1|}
tls_parse_stoc_alpn:
 1667|      5|{
 1668|      5|    size_t len;
 1669|      5|    PACKET confpkt, protpkt;
 1670|      5|    int valid = 0;
 1671|       |
 1672|       |    /* We must have requested it. */
 1673|      5|    if (!s->s3.alpn_sent) {
  ------------------
  |  Branch (1673:9): [True: 0, False: 5]
  ------------------
 1674|      0|        SSLfatal(s, SSL_AD_UNSUPPORTED_EXTENSION, SSL_R_BAD_EXTENSION);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1675|      0|        return 0;
 1676|      0|    }
 1677|       |    /*-
 1678|       |     * The extension data consists of:
 1679|       |     *   uint16 list_length
 1680|       |     *   uint8 proto_length;
 1681|       |     *   uint8 proto[proto_length];
 1682|       |     */
 1683|      5|    if (!PACKET_get_net_2_len(pkt, &len)
  ------------------
  |  Branch (1683:9): [True: 1, False: 4]
  ------------------
 1684|      4|        || PACKET_remaining(pkt) != len || !PACKET_get_1_len(pkt, &len)
  ------------------
  |  Branch (1684:12): [True: 1, False: 3]
  |  Branch (1684:44): [True: 0, False: 3]
  ------------------
 1685|      3|        || PACKET_remaining(pkt) != len) {
  ------------------
  |  Branch (1685:12): [True: 1, False: 2]
  ------------------
 1686|      3|        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
  ------------------
  |  |  148|      3|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      3|    (ERR_new(),                                                  \
  |  |  |  |  151|      3|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      3|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      3|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1687|      3|        return 0;
 1688|      3|    }
 1689|       |
 1690|       |    /* It must be a protocol that we sent */
 1691|      2|    if (!PACKET_buf_init(&confpkt, s->ext.alpn, s->ext.alpn_len)) {
  ------------------
  |  Branch (1691:9): [True: 0, False: 2]
  ------------------
 1692|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1693|      0|        return 0;
 1694|      0|    }
 1695|      5|    while (PACKET_get_length_prefixed_1(&confpkt, &protpkt)) {
  ------------------
  |  Branch (1695:12): [True: 3, False: 2]
  ------------------
 1696|      3|        if (PACKET_remaining(&protpkt) != len)
  ------------------
  |  Branch (1696:13): [True: 3, False: 0]
  ------------------
 1697|      3|            continue;
 1698|      0|        if (memcmp(PACKET_data(pkt), PACKET_data(&protpkt), len) == 0) {
  ------------------
  |  Branch (1698:13): [True: 0, False: 0]
  ------------------
 1699|       |            /* Valid protocol found */
 1700|      0|            valid = 1;
 1701|      0|            break;
 1702|      0|        }
 1703|      0|    }
 1704|       |
 1705|      2|    if (!valid) {
  ------------------
  |  Branch (1705:9): [True: 2, False: 0]
  ------------------
 1706|       |        /* The protocol sent from the server does not match one we advertised */
 1707|      2|        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
  ------------------
  |  |  148|      2|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      2|    (ERR_new(),                                                  \
  |  |  |  |  151|      2|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      2|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      2|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1708|      2|        return 0;
 1709|      2|    }
 1710|       |
 1711|      0|    OPENSSL_free(s->s3.alpn_selected);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1712|      0|    s->s3.alpn_selected = OPENSSL_malloc(len);
  ------------------
  |  |  106|      0|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1713|      0|    if (s->s3.alpn_selected == NULL) {
  ------------------
  |  Branch (1713:9): [True: 0, False: 0]
  ------------------
 1714|      0|        s->s3.alpn_selected_len = 0;
 1715|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1716|      0|        return 0;
 1717|      0|    }
 1718|      0|    if (!PACKET_copy_bytes(pkt, s->s3.alpn_selected, len)) {
  ------------------
  |  Branch (1718:9): [True: 0, False: 0]
  ------------------
 1719|      0|        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_EXTENSION);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1720|      0|        return 0;
 1721|      0|    }
 1722|      0|    s->s3.alpn_selected_len = len;
 1723|       |
 1724|      0|    if (s->session->ext.alpn_selected == NULL
  ------------------
  |  Branch (1724:9): [True: 0, False: 0]
  ------------------
 1725|      0|        || s->session->ext.alpn_selected_len != len
  ------------------
  |  Branch (1725:12): [True: 0, False: 0]
  ------------------
 1726|      0|        || memcmp(s->session->ext.alpn_selected, s->s3.alpn_selected, len)
  ------------------
  |  Branch (1726:12): [True: 0, False: 0]
  ------------------
 1727|      0|            != 0) {
 1728|       |        /* ALPN not consistent with the old session so cannot use early_data */
 1729|      0|        s->ext.early_data_ok = 0;
 1730|      0|    }
 1731|      0|    if (!s->hit) {
  ------------------
  |  Branch (1731:9): [True: 0, False: 0]
  ------------------
 1732|       |        /*
 1733|       |         * This is a new session and so alpn_selected should have been
 1734|       |         * initialised to NULL. We should update it with the selected ALPN.
 1735|       |         */
 1736|      0|        if (!ossl_assert(s->session->ext.alpn_selected == NULL)) {
  ------------------
  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|      0|    __FILE__, __LINE__)
  ------------------
  |  Branch (1736:13): [True: 0, False: 0]
  ------------------
 1737|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1738|      0|            return 0;
 1739|      0|        }
 1740|      0|        s->session->ext.alpn_selected = OPENSSL_memdup(s->s3.alpn_selected, s->s3.alpn_selected_len);
  ------------------
  |  |  133|      0|    CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1741|      0|        if (s->session->ext.alpn_selected == NULL) {
  ------------------
  |  Branch (1741:13): [True: 0, False: 0]
  ------------------
 1742|      0|            s->session->ext.alpn_selected_len = 0;
 1743|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1744|      0|            return 0;
 1745|      0|        }
 1746|      0|        s->session->ext.alpn_selected_len = s->s3.alpn_selected_len;
 1747|      0|    }
 1748|       |
 1749|      0|    return 1;
 1750|      0|}
tls_parse_stoc_etm:
 1804|      4|{
 1805|       |    /* Ignore if inappropriate ciphersuite */
 1806|      4|    if (!(s->options & SSL_OP_NO_ENCRYPT_THEN_MAC)
  ------------------
  |  |  398|      4|#define SSL_OP_NO_ENCRYPT_THEN_MAC SSL_OP_BIT(19)
  |  |  ------------------
  |  |  |  |  350|      4|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (1806:9): [True: 4, False: 0]
  ------------------
 1807|      4|        && s->s3.tmp.new_cipher->algorithm_mac != SSL_AEAD
  ------------------
  |  |  175|      8|#define SSL_AEAD 0x00000040U
  ------------------
  |  Branch (1807:12): [True: 2, False: 2]
  ------------------
 1808|      2|        && s->s3.tmp.new_cipher->algorithm_enc != SSL_RC4
  ------------------
  |  |  132|      6|#define SSL_RC4 0x00000004U
  ------------------
  |  Branch (1808:12): [True: 2, False: 0]
  ------------------
 1809|      2|        && s->s3.tmp.new_cipher->algorithm_enc != SSL_eGOST2814789CNT
  ------------------
  |  |  140|      6|#define SSL_eGOST2814789CNT 0x00000400U
  ------------------
  |  Branch (1809:12): [True: 2, False: 0]
  ------------------
 1810|      2|        && s->s3.tmp.new_cipher->algorithm_enc != SSL_eGOST2814789CNT12
  ------------------
  |  |  148|      6|#define SSL_eGOST2814789CNT12 0x00040000U
  ------------------
  |  Branch (1810:12): [True: 2, False: 0]
  ------------------
 1811|      2|        && s->s3.tmp.new_cipher->algorithm_enc != SSL_MAGMA
  ------------------
  |  |  152|      6|#define SSL_MAGMA 0x00400000U
  ------------------
  |  Branch (1811:12): [True: 2, False: 0]
  ------------------
 1812|      2|        && s->s3.tmp.new_cipher->algorithm_enc != SSL_KUZNYECHIK)
  ------------------
  |  |  153|      2|#define SSL_KUZNYECHIK 0x00800000U
  ------------------
  |  Branch (1812:12): [True: 2, False: 0]
  ------------------
 1813|      2|        s->ext.use_etm = 1;
 1814|       |
 1815|      4|    return 1;
 1816|      4|}
tls_parse_stoc_ems:
 1820|      4|{
 1821|      4|    if (s->options & SSL_OP_NO_EXTENDED_MASTER_SECRET)
  ------------------
  |  |  356|      4|#define SSL_OP_NO_EXTENDED_MASTER_SECRET SSL_OP_BIT(0)
  |  |  ------------------
  |  |  |  |  350|      4|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (1821:9): [True: 0, False: 4]
  ------------------
 1822|      0|        return 1;
 1823|      4|    s->s3.flags |= TLS1_FLAGS_RECEIVED_EXTMS;
  ------------------
  |  |  300|      4|#define TLS1_FLAGS_RECEIVED_EXTMS 0x0200
  ------------------
 1824|      4|    if (!s->hit)
  ------------------
  |  Branch (1824:9): [True: 4, False: 0]
  ------------------
 1825|      4|        s->session->flags |= SSL_SESS_FLAG_EXTMS;
  ------------------
  |  |  567|      4|#define SSL_SESS_FLAG_EXTMS 0x1
  ------------------
 1826|       |
 1827|      4|    return 1;
 1828|      4|}
tls_parse_stoc_supported_versions:
 1833|      4|{
 1834|      4|    unsigned int version;
 1835|       |
 1836|      4|    if (!PACKET_get_net_2(pkt, &version)
  ------------------
  |  Branch (1836:9): [True: 1, False: 3]
  ------------------
 1837|      3|        || PACKET_remaining(pkt) != 0) {
  ------------------
  |  Branch (1837:12): [True: 1, False: 2]
  ------------------
 1838|      2|        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
  ------------------
  |  |  148|      2|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      2|    (ERR_new(),                                                  \
  |  |  |  |  151|      2|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      2|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      2|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1839|      2|        return 0;
 1840|      2|    }
 1841|       |
 1842|       |    /*
 1843|       |     * The only protocol version we support which is valid in this extension in
 1844|       |     * a ServerHello is TLSv1.3 therefore we shouldn't be getting anything else.
 1845|       |     */
 1846|      2|    if (version != TLS1_3_VERSION) {
  ------------------
  |  |   27|      2|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (1846:9): [True: 2, False: 0]
  ------------------
 1847|      2|        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
  ------------------
  |  |  148|      2|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      2|    (ERR_new(),                                                  \
  |  |  |  |  151|      2|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      2|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      2|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1848|      2|            SSL_R_BAD_PROTOCOL_VERSION_NUMBER);
 1849|      2|        return 0;
 1850|      2|    }
 1851|       |
 1852|       |    /* We ignore this extension for HRRs except to sanity check it */
 1853|      0|    if (context == SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST)
  ------------------
  |  |  304|      0|#define SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST 0x00800
  ------------------
  |  Branch (1853:9): [True: 0, False: 0]
  ------------------
 1854|      0|        return 1;
 1855|       |
 1856|       |    /* We just set it here. We validate it in ssl_choose_client_version */
 1857|      0|    s->version = version;
 1858|      0|    if (!ssl_set_record_protocol_version(s, version)) {
  ------------------
  |  Branch (1858:9): [True: 0, False: 0]
  ------------------
 1859|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1860|      0|        return 0;
 1861|      0|    }
 1862|       |
 1863|      0|    return 1;
 1864|      0|}
tls_construct_ctos_client_cert_type:
 2167|  1.64k|{
 2168|  1.64k|    sc->ext.client_cert_type_ctos = OSSL_CERT_TYPE_CTOS_NONE;
  ------------------
  |  |  365|  1.64k|#define OSSL_CERT_TYPE_CTOS_NONE 0
  ------------------
 2169|  1.64k|    if (sc->client_cert_type == NULL)
  ------------------
  |  Branch (2169:9): [True: 1.64k, False: 0]
  ------------------
 2170|  1.64k|        return EXT_RETURN_NOT_SENT;
 2171|       |
 2172|      0|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_client_cert_type)
  ------------------
  |  |  891|      0|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (2172:9): [True: 0, False: 0]
  ------------------
 2173|      0|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|      0|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (2173:12): [True: 0, False: 0]
  ------------------
 2174|      0|        || !WPACKET_sub_memcpy_u8(pkt, sc->client_cert_type, sc->client_cert_type_len)
  ------------------
  |  |  918|      0|    WPACKET_sub_memcpy__((pkt), (src), (len), 1)
  ------------------
  |  Branch (2174:12): [True: 0, False: 0]
  ------------------
 2175|      0|        || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (2175:12): [True: 0, False: 0]
  ------------------
 2176|      0|        SSLfatal(sc, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 2177|      0|        return EXT_RETURN_FAIL;
 2178|      0|    }
 2179|      0|    sc->ext.client_cert_type_ctos = OSSL_CERT_TYPE_CTOS_GOOD;
  ------------------
  |  |  366|      0|#define OSSL_CERT_TYPE_CTOS_GOOD 1
  ------------------
 2180|      0|    return EXT_RETURN_SENT;
 2181|      0|}
tls_construct_ctos_server_cert_type:
 2219|  1.64k|{
 2220|  1.64k|    sc->ext.server_cert_type_ctos = OSSL_CERT_TYPE_CTOS_NONE;
  ------------------
  |  |  365|  1.64k|#define OSSL_CERT_TYPE_CTOS_NONE 0
  ------------------
 2221|  1.64k|    if (sc->server_cert_type == NULL)
  ------------------
  |  Branch (2221:9): [True: 1.64k, False: 0]
  ------------------
 2222|  1.64k|        return EXT_RETURN_NOT_SENT;
 2223|       |
 2224|      0|    if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_server_cert_type)
  ------------------
  |  |  891|      0|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (2224:9): [True: 0, False: 0]
  ------------------
 2225|      0|        || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|      0|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (2225:12): [True: 0, False: 0]
  ------------------
 2226|      0|        || !WPACKET_sub_memcpy_u8(pkt, sc->server_cert_type, sc->server_cert_type_len)
  ------------------
  |  |  918|      0|    WPACKET_sub_memcpy__((pkt), (src), (len), 1)
  ------------------
  |  Branch (2226:12): [True: 0, False: 0]
  ------------------
 2227|      0|        || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (2227:12): [True: 0, False: 0]
  ------------------
 2228|      0|        SSLfatal(sc, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 2229|      0|        return EXT_RETURN_FAIL;
 2230|      0|    }
 2231|      0|    sc->ext.server_cert_type_ctos = OSSL_CERT_TYPE_CTOS_GOOD;
  ------------------
  |  |  366|      0|#define OSSL_CERT_TYPE_CTOS_GOOD 1
  ------------------
 2232|      0|    return EXT_RETURN_SENT;
 2233|      0|}
extensions_clnt.c:use_ecc:
  140|  3.39k|{
  141|  3.39k|    int i, end, ret = 0;
  142|  3.39k|    unsigned long alg_k, alg_a;
  143|  3.39k|    STACK_OF(SSL_CIPHER) *cipher_stack = NULL;
  ------------------
  |  |   33|  3.39k|#define STACK_OF(type) struct stack_st_##type
  ------------------
  144|  3.39k|    const uint16_t *pgroups = NULL;
  145|  3.39k|    size_t num_groups, j;
  146|  3.39k|    SSL *ssl = SSL_CONNECTION_GET_SSL(s);
  ------------------
  |  |   27|  3.39k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
  147|       |
  148|       |    /* See if we support any ECC ciphersuites */
  149|  3.39k|    if (s->version == SSL3_VERSION)
  ------------------
  |  |   23|  3.39k|#define SSL3_VERSION 0x0300
  ------------------
  |  Branch (149:9): [True: 0, False: 3.39k]
  ------------------
  150|      0|        return 0;
  151|       |
  152|  3.39k|    cipher_stack = SSL_get1_supported_ciphers(ssl);
  153|  3.39k|    end = sk_SSL_CIPHER_num(cipher_stack);
  ------------------
  |  | 1005|  3.39k|#define sk_SSL_CIPHER_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_CIPHER_sk_type(sk))
  ------------------
  154|  3.48k|    for (i = 0; i < end; i++) {
  ------------------
  |  Branch (154:17): [True: 3.47k, False: 6]
  ------------------
  155|  3.47k|        const SSL_CIPHER *c = sk_SSL_CIPHER_value(cipher_stack, i);
  ------------------
  |  | 1006|  3.47k|#define sk_SSL_CIPHER_value(sk, idx) ((const SSL_CIPHER *)OPENSSL_sk_value(ossl_check_const_SSL_CIPHER_sk_type(sk), (idx)))
  ------------------
  156|       |
  157|  3.47k|        alg_k = c->algorithm_mkey;
  158|  3.47k|        alg_a = c->algorithm_auth;
  159|  3.47k|        if ((alg_k & (SSL_kECDHE | SSL_kECDHEPSK))
  ------------------
  |  |   85|  3.47k|#define SSL_kECDHE 0x00000004U
  ------------------
                      if ((alg_k & (SSL_kECDHE | SSL_kECDHEPSK))
  ------------------
  |  |   94|  3.47k|#define SSL_kECDHEPSK 0x00000080U
  ------------------
  |  Branch (159:13): [True: 16, False: 3.46k]
  ------------------
  160|  3.46k|            || (alg_a & SSL_aECDSA)
  ------------------
  |  |  114|  3.46k|#define SSL_aECDSA 0x00000008U
  ------------------
  |  Branch (160:16): [True: 0, False: 3.46k]
  ------------------
  161|  3.46k|            || c->min_tls >= TLS1_3_VERSION) {
  ------------------
  |  |   27|  3.46k|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (161:16): [True: 3.37k, False: 88]
  ------------------
  162|  3.39k|            ret = 1;
  163|  3.39k|            break;
  164|  3.39k|        }
  165|  3.47k|    }
  166|  3.39k|    sk_SSL_CIPHER_free(cipher_stack);
  ------------------
  |  | 1011|  3.39k|#define sk_SSL_CIPHER_free(sk) OPENSSL_sk_free(ossl_check_SSL_CIPHER_sk_type(sk))
  ------------------
  167|  3.39k|    if (!ret)
  ------------------
  |  Branch (167:9): [True: 6, False: 3.39k]
  ------------------
  168|      6|        return 0;
  169|       |
  170|       |    /* Check we have at least one EC supported group */
  171|  3.39k|    tls1_get_supported_groups(s, &pgroups, &num_groups);
  172|  6.24k|    for (j = 0; j < num_groups; j++) {
  ------------------
  |  Branch (172:17): [True: 5.98k, False: 252]
  ------------------
  173|  5.98k|        uint16_t ctmp = pgroups[j];
  174|       |
  175|  5.98k|        if (tls_valid_group(s, ctmp, min_version, max_version, 1, NULL)
  ------------------
  |  Branch (175:13): [True: 3.21k, False: 2.77k]
  ------------------
  176|  3.21k|            && tls_group_allowed(s, ctmp, SSL_SECOP_CURVE_SUPPORTED))
  ------------------
  |  | 2758|  3.21k|#define SSL_SECOP_CURVE_SUPPORTED (4 | SSL_SECOP_OTHER_CURVE)
  |  |  ------------------
  |  |  |  | 2739|  3.21k|#define SSL_SECOP_OTHER_CURVE (2 << 16)
  |  |  ------------------
  ------------------
  |  Branch (176:16): [True: 3.13k, False: 74]
  ------------------
  177|  3.13k|            return 1;
  178|  5.98k|    }
  179|       |
  180|    252|    return 0;
  181|  3.39k|}
extensions_clnt.c:add_key_share:
  641|  2.95k|{
  642|  2.95k|    unsigned char *encoded_pubkey = NULL;
  643|  2.95k|    EVP_PKEY *key_share_key = NULL;
  644|  2.95k|    size_t encodedlen;
  645|       |
  646|  2.95k|    if (loop_num < s->s3.tmp.num_ks_pkey) {
  ------------------
  |  Branch (646:9): [True: 0, False: 2.95k]
  ------------------
  647|      0|        if (!ossl_assert(s->hello_retry_request == SSL_HRR_PENDING)
  ------------------
  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|      0|    __FILE__, __LINE__)
  ------------------
  |  Branch (647:13): [True: 0, False: 0]
  ------------------
  648|      0|            || !ossl_assert(s->s3.tmp.ks_pkey[loop_num] != NULL)) {
  ------------------
  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|      0|    __FILE__, __LINE__)
  ------------------
  |  Branch (648:16): [True: 0, False: 0]
  ------------------
  649|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  650|      0|            return 0;
  651|      0|        }
  652|       |        /*
  653|       |         * Could happen if we got an HRR that wasn't requesting a new key_share
  654|       |         */
  655|      0|        key_share_key = s->s3.tmp.ks_pkey[loop_num];
  656|  2.95k|    } else {
  657|  2.95k|        key_share_key = ssl_generate_pkey_group(s, group_id);
  658|  2.95k|        if (key_share_key == NULL) {
  ------------------
  |  Branch (658:13): [True: 0, False: 2.95k]
  ------------------
  659|       |            /* SSLfatal() already called */
  660|      0|            return 0;
  661|      0|        }
  662|  2.95k|    }
  663|       |
  664|       |    /* Encode the public key. */
  665|  2.95k|    encodedlen = EVP_PKEY_get1_encoded_public_key(key_share_key,
  666|  2.95k|        &encoded_pubkey);
  667|  2.95k|    if (encodedlen == 0) {
  ------------------
  |  Branch (667:9): [True: 0, False: 2.95k]
  ------------------
  668|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EC_LIB);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  669|      0|        goto err;
  670|      0|    }
  671|       |
  672|       |    /* Create KeyShareEntry */
  673|  2.95k|    if (!WPACKET_put_bytes_u16(pkt, group_id)
  ------------------
  |  |  891|  5.90k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (673:9): [True: 0, False: 2.95k]
  ------------------
  674|  2.95k|        || !WPACKET_sub_memcpy_u16(pkt, encoded_pubkey, encodedlen)) {
  ------------------
  |  |  920|  2.95k|    WPACKET_sub_memcpy__((pkt), (src), (len), 2)
  ------------------
  |  Branch (674:12): [True: 0, False: 2.95k]
  ------------------
  675|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  676|      0|        goto err;
  677|      0|    }
  678|       |
  679|       |    /* For backward compatibility, we use the first valid group to add a key share */
  680|  2.95k|    if (loop_num == 0) {
  ------------------
  |  Branch (680:9): [True: 1.63k, False: 1.31k]
  ------------------
  681|  1.63k|        s->s3.tmp.pkey = key_share_key;
  682|  1.63k|        s->s3.group_id = group_id;
  683|  1.63k|    }
  684|       |    /* We ensure in t1_lib.c that the loop number does not exceed OPENSSL_CLIENT_MAX_KEY_SHARES */
  685|  2.95k|    s->s3.tmp.ks_pkey[loop_num] = key_share_key;
  686|  2.95k|    s->s3.tmp.ks_group_id[loop_num] = group_id;
  687|  2.95k|    if (loop_num >= s->s3.tmp.num_ks_pkey)
  ------------------
  |  Branch (687:9): [True: 2.95k, False: 0]
  ------------------
  688|  2.95k|        s->s3.tmp.num_ks_pkey++;
  689|       |
  690|  2.95k|    OPENSSL_free(encoded_pubkey);
  ------------------
  |  |  131|  2.95k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  691|       |
  692|  2.95k|    return 1;
  693|      0|err:
  694|      0|    if (key_share_key != s->s3.tmp.ks_pkey[loop_num])
  ------------------
  |  Branch (694:9): [True: 0, False: 0]
  ------------------
  695|      0|        EVP_PKEY_free(key_share_key);
  696|      0|    OPENSSL_free(encoded_pubkey);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  697|      0|    return 0;
  698|  2.95k|}

custom_ext_find:
   84|    218|{
   85|    218|    size_t i;
   86|    218|    custom_ext_method *meth = exts->meths;
   87|       |
   88|    218|    for (i = 0; i < exts->meths_count; i++, meth++) {
  ------------------
  |  Branch (88:17): [True: 0, False: 218]
  ------------------
   89|      0|        if (ext_type == meth->ext_type
  ------------------
  |  Branch (89:13): [True: 0, False: 0]
  ------------------
   90|      0|            && (role == ENDPOINT_BOTH || role == meth->role
  ------------------
  |  Branch (90:17): [True: 0, False: 0]
  |  Branch (90:42): [True: 0, False: 0]
  ------------------
   91|      0|                || meth->role == ENDPOINT_BOTH)) {
  ------------------
  |  Branch (91:20): [True: 0, False: 0]
  ------------------
   92|      0|            if (idx != NULL)
  ------------------
  |  Branch (92:17): [True: 0, False: 0]
  ------------------
   93|      0|                *idx = i;
   94|      0|            return meth;
   95|      0|        }
   96|      0|    }
   97|    218|    return NULL;
   98|    218|}
custom_ext_init:
  104|  1.69k|{
  105|  1.69k|    size_t i;
  106|  1.69k|    custom_ext_method *meth = exts->meths;
  107|       |
  108|  1.69k|    for (i = 0; i < exts->meths_count; i++, meth++)
  ------------------
  |  Branch (108:17): [True: 0, False: 1.69k]
  ------------------
  109|      0|        meth->ext_flags &= ~(SSL_EXT_FLAG_SENT | SSL_EXT_FLAG_RECEIVED);
  ------------------
  |  | 2068|      0|#define SSL_EXT_FLAG_SENT 0x2
  ------------------
                      meth->ext_flags &= ~(SSL_EXT_FLAG_SENT | SSL_EXT_FLAG_RECEIVED);
  ------------------
  |  | 2063|      0|#define SSL_EXT_FLAG_RECEIVED 0x1
  ------------------
  110|  1.69k|}
custom_ext_parse:
  117|      5|{
  118|      5|    int al = 0;
  119|      5|    custom_ext_methods *exts = &s->cert->custext;
  120|      5|    custom_ext_method *meth;
  121|      5|    ENDPOINT role = ENDPOINT_BOTH;
  122|       |
  123|      5|    if ((context & (SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_SERVER_HELLO)) != 0)
  ------------------
  |  |  299|      5|#define SSL_EXT_CLIENT_HELLO 0x00080
  ------------------
                  if ((context & (SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_2_SERVER_HELLO)) != 0)
  ------------------
  |  |  301|      5|#define SSL_EXT_TLS1_2_SERVER_HELLO 0x00100
  ------------------
  |  Branch (123:9): [True: 5, False: 0]
  ------------------
  124|      5|        role = s->server ? ENDPOINT_SERVER : ENDPOINT_CLIENT;
  ------------------
  |  Branch (124:16): [True: 0, False: 5]
  ------------------
  125|       |
  126|      5|    meth = custom_ext_find(exts, role, ext_type, NULL);
  127|       |    /* If not found return success */
  128|      5|    if (!meth)
  ------------------
  |  Branch (128:9): [True: 5, False: 0]
  ------------------
  129|      5|        return 1;
  130|       |
  131|       |    /* Check if extension is defined for our protocol. If not, skip */
  132|      0|    if (!extension_is_relevant(s, meth->context, context))
  ------------------
  |  Branch (132:9): [True: 0, False: 0]
  ------------------
  133|      0|        return 1;
  134|       |
  135|      0|    if ((context & (SSL_EXT_TLS1_2_SERVER_HELLO | SSL_EXT_TLS1_3_SERVER_HELLO | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS)) != 0) {
  ------------------
  |  |  301|      0|#define SSL_EXT_TLS1_2_SERVER_HELLO 0x00100
  ------------------
                  if ((context & (SSL_EXT_TLS1_2_SERVER_HELLO | SSL_EXT_TLS1_3_SERVER_HELLO | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS)) != 0) {
  ------------------
  |  |  302|      0|#define SSL_EXT_TLS1_3_SERVER_HELLO 0x00200
  ------------------
                  if ((context & (SSL_EXT_TLS1_2_SERVER_HELLO | SSL_EXT_TLS1_3_SERVER_HELLO | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS)) != 0) {
  ------------------
  |  |  303|      0|#define SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS 0x00400
  ------------------
  |  Branch (135:9): [True: 0, False: 0]
  ------------------
  136|       |        /*
  137|       |         * If it's ServerHello or EncryptedExtensions we can't have any
  138|       |         * extensions not sent in ClientHello.
  139|       |         */
  140|      0|        if ((meth->ext_flags & SSL_EXT_FLAG_SENT) == 0) {
  ------------------
  |  | 2068|      0|#define SSL_EXT_FLAG_SENT 0x2
  ------------------
  |  Branch (140:13): [True: 0, False: 0]
  ------------------
  141|      0|            SSLfatal(s, TLS1_AD_UNSUPPORTED_EXTENSION, SSL_R_BAD_EXTENSION);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  142|      0|            return 0;
  143|      0|        }
  144|      0|    }
  145|       |
  146|       |    /*
  147|       |     * Extensions received in the ClientHello or CertificateRequest are marked
  148|       |     * with the SSL_EXT_FLAG_RECEIVED. This is so we know to add the equivalent
  149|       |     * extensions in the response messages
  150|       |     */
  151|      0|    if ((context & (SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_CERTIFICATE_REQUEST))
  ------------------
  |  |  299|      0|#define SSL_EXT_CLIENT_HELLO 0x00080
  ------------------
                  if ((context & (SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_CERTIFICATE_REQUEST))
  ------------------
  |  |  307|      0|#define SSL_EXT_TLS1_3_CERTIFICATE_REQUEST 0x04000
  ------------------
  |  Branch (151:9): [True: 0, False: 0]
  ------------------
  152|      0|        != 0)
  153|      0|        meth->ext_flags |= SSL_EXT_FLAG_RECEIVED;
  ------------------
  |  | 2063|      0|#define SSL_EXT_FLAG_RECEIVED 0x1
  ------------------
  154|       |
  155|       |    /* If no parse function set return success */
  156|      0|    if (meth->parse_cb == NULL)
  ------------------
  |  Branch (156:9): [True: 0, False: 0]
  ------------------
  157|      0|        return 1;
  158|       |
  159|      0|    if (meth->parse_cb(SSL_CONNECTION_GET_USER_SSL(s), ext_type, context, ext_data,
  ------------------
  |  |   28|      0|#define SSL_CONNECTION_GET_USER_SSL(sc) ((sc)->user_ssl)
  ------------------
  |  Branch (159:9): [True: 0, False: 0]
  ------------------
  160|      0|            ext_size, x, chainidx, &al, meth->parse_arg)
  161|      0|        <= 0) {
  162|      0|        SSLfatal(s, al, SSL_R_BAD_EXTENSION);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  163|      0|        return 0;
  164|      0|    }
  165|       |
  166|      0|    return 1;
  167|      0|}
custom_ext_add:
  175|  1.69k|{
  176|  1.69k|    custom_ext_methods *exts = &s->cert->custext;
  177|  1.69k|    custom_ext_method *meth;
  178|  1.69k|    size_t i;
  179|  1.69k|    int al;
  180|  1.69k|    int for_comp = (context & SSL_EXT_TLS1_3_CERTIFICATE_COMPRESSION) != 0;
  ------------------
  |  |  308|  1.69k|#define SSL_EXT_TLS1_3_CERTIFICATE_COMPRESSION 0x08000
  ------------------
  181|       |
  182|  1.69k|    for (i = 0; i < exts->meths_count; i++) {
  ------------------
  |  Branch (182:17): [True: 0, False: 1.69k]
  ------------------
  183|      0|        const unsigned char *out = NULL;
  184|      0|        size_t outlen = 0;
  185|       |
  186|      0|        meth = exts->meths + i;
  187|       |
  188|      0|        if (!should_add_extension(s, meth->context, context, maxversion))
  ------------------
  |  Branch (188:13): [True: 0, False: 0]
  ------------------
  189|      0|            continue;
  190|       |
  191|      0|        if ((context & (SSL_EXT_TLS1_2_SERVER_HELLO | SSL_EXT_TLS1_3_SERVER_HELLO | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS | SSL_EXT_TLS1_3_CERTIFICATE | SSL_EXT_TLS1_3_RAW_PUBLIC_KEY | SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST)) != 0) {
  ------------------
  |  |  301|      0|#define SSL_EXT_TLS1_2_SERVER_HELLO 0x00100
  ------------------
                      if ((context & (SSL_EXT_TLS1_2_SERVER_HELLO | SSL_EXT_TLS1_3_SERVER_HELLO | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS | SSL_EXT_TLS1_3_CERTIFICATE | SSL_EXT_TLS1_3_RAW_PUBLIC_KEY | SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST)) != 0) {
  ------------------
  |  |  302|      0|#define SSL_EXT_TLS1_3_SERVER_HELLO 0x00200
  ------------------
                      if ((context & (SSL_EXT_TLS1_2_SERVER_HELLO | SSL_EXT_TLS1_3_SERVER_HELLO | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS | SSL_EXT_TLS1_3_CERTIFICATE | SSL_EXT_TLS1_3_RAW_PUBLIC_KEY | SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST)) != 0) {
  ------------------
  |  |  303|      0|#define SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS 0x00400
  ------------------
                      if ((context & (SSL_EXT_TLS1_2_SERVER_HELLO | SSL_EXT_TLS1_3_SERVER_HELLO | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS | SSL_EXT_TLS1_3_CERTIFICATE | SSL_EXT_TLS1_3_RAW_PUBLIC_KEY | SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST)) != 0) {
  ------------------
  |  |  305|      0|#define SSL_EXT_TLS1_3_CERTIFICATE 0x01000
  ------------------
                      if ((context & (SSL_EXT_TLS1_2_SERVER_HELLO | SSL_EXT_TLS1_3_SERVER_HELLO | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS | SSL_EXT_TLS1_3_CERTIFICATE | SSL_EXT_TLS1_3_RAW_PUBLIC_KEY | SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST)) != 0) {
  ------------------
  |  |  310|      0|#define SSL_EXT_TLS1_3_RAW_PUBLIC_KEY 0x10000
  ------------------
                      if ((context & (SSL_EXT_TLS1_2_SERVER_HELLO | SSL_EXT_TLS1_3_SERVER_HELLO | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS | SSL_EXT_TLS1_3_CERTIFICATE | SSL_EXT_TLS1_3_RAW_PUBLIC_KEY | SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST)) != 0) {
  ------------------
  |  |  304|      0|#define SSL_EXT_TLS1_3_HELLO_RETRY_REQUEST 0x00800
  ------------------
  |  Branch (191:13): [True: 0, False: 0]
  ------------------
  192|       |            /* Only send extensions present in ClientHello/CertificateRequest */
  193|      0|            if (!(meth->ext_flags & SSL_EXT_FLAG_RECEIVED))
  ------------------
  |  | 2063|      0|#define SSL_EXT_FLAG_RECEIVED 0x1
  ------------------
  |  Branch (193:17): [True: 0, False: 0]
  ------------------
  194|      0|                continue;
  195|      0|        }
  196|       |        /*
  197|       |         * We skip it if the callback is absent - except for a ClientHello where
  198|       |         * we add an empty extension.
  199|       |         */
  200|      0|        if ((context & SSL_EXT_CLIENT_HELLO) == 0 && meth->add_cb == NULL)
  ------------------
  |  |  299|      0|#define SSL_EXT_CLIENT_HELLO 0x00080
  ------------------
  |  Branch (200:13): [True: 0, False: 0]
  |  Branch (200:54): [True: 0, False: 0]
  ------------------
  201|      0|            continue;
  202|       |
  203|      0|        if (meth->add_cb != NULL) {
  ------------------
  |  Branch (203:13): [True: 0, False: 0]
  ------------------
  204|      0|            int cb_retval = meth->add_cb(SSL_CONNECTION_GET_USER_SSL(s),
  ------------------
  |  |   28|      0|#define SSL_CONNECTION_GET_USER_SSL(sc) ((sc)->user_ssl)
  ------------------
  205|      0|                meth->ext_type, context, &out,
  206|      0|                &outlen, x, chainidx, &al,
  207|      0|                meth->add_arg);
  208|       |
  209|      0|            if (cb_retval < 0) {
  ------------------
  |  Branch (209:17): [True: 0, False: 0]
  ------------------
  210|      0|                if (!for_comp)
  ------------------
  |  Branch (210:21): [True: 0, False: 0]
  ------------------
  211|      0|                    SSLfatal(s, al, SSL_R_CALLBACK_FAILED);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  212|      0|                return 0; /* error */
  213|      0|            }
  214|      0|            if (cb_retval == 0)
  ------------------
  |  Branch (214:17): [True: 0, False: 0]
  ------------------
  215|      0|                continue; /* skip this extension */
  216|      0|        }
  217|       |
  218|      0|        if (!WPACKET_put_bytes_u16(pkt, meth->ext_type)
  ------------------
  |  |  891|      0|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (218:13): [True: 0, False: 0]
  ------------------
  219|      0|            || !WPACKET_start_sub_packet_u16(pkt)
  ------------------
  |  |  792|      0|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (219:16): [True: 0, False: 0]
  ------------------
  220|      0|            || (outlen > 0 && !WPACKET_memcpy(pkt, out, outlen))
  ------------------
  |  Branch (220:17): [True: 0, False: 0]
  |  Branch (220:31): [True: 0, False: 0]
  ------------------
  221|      0|            || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (221:16): [True: 0, False: 0]
  ------------------
  222|      0|            if (meth->free_cb != NULL)
  ------------------
  |  Branch (222:17): [True: 0, False: 0]
  ------------------
  223|      0|                meth->free_cb(SSL_CONNECTION_GET_USER_SSL(s), meth->ext_type,
  ------------------
  |  |   28|      0|#define SSL_CONNECTION_GET_USER_SSL(sc) ((sc)->user_ssl)
  ------------------
  224|      0|                    context, out, meth->add_arg);
  225|      0|            if (!for_comp)
  ------------------
  |  Branch (225:17): [True: 0, False: 0]
  ------------------
  226|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  227|      0|            return 0;
  228|      0|        }
  229|      0|        if ((context & SSL_EXT_CLIENT_HELLO) != 0) {
  ------------------
  |  |  299|      0|#define SSL_EXT_CLIENT_HELLO 0x00080
  ------------------
  |  Branch (229:13): [True: 0, False: 0]
  ------------------
  230|       |            /*
  231|       |             * We can't send duplicates: code logic should prevent this.
  232|       |             */
  233|      0|            if (!ossl_assert((meth->ext_flags & SSL_EXT_FLAG_SENT) == 0)) {
  ------------------
  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|      0|    __FILE__, __LINE__)
  ------------------
  |  Branch (233:17): [True: 0, False: 0]
  ------------------
  234|      0|                if (meth->free_cb != NULL)
  ------------------
  |  Branch (234:21): [True: 0, False: 0]
  ------------------
  235|      0|                    meth->free_cb(SSL_CONNECTION_GET_USER_SSL(s), meth->ext_type,
  ------------------
  |  |   28|      0|#define SSL_CONNECTION_GET_USER_SSL(sc) ((sc)->user_ssl)
  ------------------
  236|      0|                        context, out, meth->add_arg);
  237|      0|                if (!for_comp)
  ------------------
  |  Branch (237:21): [True: 0, False: 0]
  ------------------
  238|      0|                    SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  239|      0|                return 0;
  240|      0|            }
  241|       |            /*
  242|       |             * Indicate extension has been sent: this is both a sanity check to
  243|       |             * ensure we don't send duplicate extensions and indicates that it
  244|       |             * is not an error if the extension is present in ServerHello.
  245|       |             */
  246|      0|            meth->ext_flags |= SSL_EXT_FLAG_SENT;
  ------------------
  |  | 2068|      0|#define SSL_EXT_FLAG_SENT 0x2
  ------------------
  247|      0|        }
  248|      0|        if (meth->free_cb != NULL)
  ------------------
  |  Branch (248:13): [True: 0, False: 0]
  ------------------
  249|      0|            meth->free_cb(SSL_CONNECTION_GET_USER_SSL(s), meth->ext_type,
  ------------------
  |  |   28|      0|#define SSL_CONNECTION_GET_USER_SSL(sc) ((sc)->user_ssl)
  ------------------
  250|      0|                context, out, meth->add_arg);
  251|      0|    }
  252|  1.69k|    return 1;
  253|  1.69k|}
custom_exts_copy:
  302|  1.77k|{
  303|  1.77k|    size_t i;
  304|  1.77k|    int err = 0;
  305|       |
  306|  1.77k|    if (src->meths_count > 0) {
  ------------------
  |  Branch (306:9): [True: 0, False: 1.77k]
  ------------------
  307|      0|        dst->meths = OPENSSL_memdup(src->meths,
  ------------------
  |  |  133|      0|    CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  308|      0|            sizeof(*src->meths) * src->meths_count);
  309|      0|        if (dst->meths == NULL)
  ------------------
  |  Branch (309:13): [True: 0, False: 0]
  ------------------
  310|      0|            return 0;
  311|      0|        dst->meths_count = src->meths_count;
  312|       |
  313|      0|        for (i = 0; i < src->meths_count; i++)
  ------------------
  |  Branch (313:21): [True: 0, False: 0]
  ------------------
  314|      0|            custom_ext_copy_old_cb(&dst->meths[i], &src->meths[i], &err);
  315|      0|    }
  316|       |
  317|  1.77k|    if (err) {
  ------------------
  |  Branch (317:9): [True: 0, False: 1.77k]
  ------------------
  318|      0|        custom_exts_free(dst);
  319|      0|        return 0;
  320|      0|    }
  321|       |
  322|  1.77k|    return 1;
  323|  1.77k|}
custom_exts_free:
  376|  4.33k|{
  377|  4.33k|    size_t i;
  378|  4.33k|    custom_ext_method *meth;
  379|       |
  380|  4.33k|    for (i = 0, meth = exts->meths; i < exts->meths_count; i++, meth++) {
  ------------------
  |  Branch (380:37): [True: 0, False: 4.33k]
  ------------------
  381|      0|        if (meth->add_cb != custom_ext_add_old_cb_wrap)
  ------------------
  |  Branch (381:13): [True: 0, False: 0]
  ------------------
  382|      0|            continue;
  383|       |
  384|       |        /* Old style API wrapper. Need to free the arguments too */
  385|      0|        OPENSSL_free(meth->add_arg);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  386|      0|        OPENSSL_free(meth->parse_arg);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  387|      0|    }
  388|  4.33k|    OPENSSL_free(exts->meths);
  ------------------
  |  |  131|  4.33k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  389|       |    exts->meths = NULL;
  390|  4.33k|    exts->meths_count = 0;
  391|  4.33k|}

SSL_get_state:
   75|  3.25k|{
   76|  3.25k|    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(ssl);
  ------------------
  |  |   41|  3.25k|    SSL_CONNECTION_FROM_SSL_int(ssl, const)
  |  |  ------------------
  |  |  |  |   32|  3.25k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 3.25k]
  |  |  |  |  ------------------
  |  |  |  |   33|  3.25k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  3.25k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 3.25k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  3.25k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  3.25k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
   77|       |
   78|  3.25k|    if (sc == NULL)
  ------------------
  |  Branch (78:9): [True: 0, False: 3.25k]
  ------------------
   79|      0|        return TLS_ST_BEFORE;
   80|       |
   81|  3.25k|    return sc->statem.hand_state;
   82|  3.25k|}
SSL_in_init:
   85|  8.04k|{
   86|  8.04k|    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s);
  ------------------
  |  |   41|  8.04k|    SSL_CONNECTION_FROM_SSL_int(ssl, const)
  |  |  ------------------
  |  |  |  |   32|  8.04k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 8.04k]
  |  |  |  |  ------------------
  |  |  |  |   33|  8.04k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  8.04k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 8.04k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  8.04k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  8.04k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
   87|       |
   88|  8.04k|    if (sc == NULL)
  ------------------
  |  Branch (88:9): [True: 0, False: 8.04k]
  ------------------
   89|      0|        return 0;
   90|       |
   91|  8.04k|    return sc->statem.in_init;
   92|  8.04k|}
SSL_in_before:
  105|  3.84k|{
  106|  3.84k|    const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s);
  ------------------
  |  |   41|  3.84k|    SSL_CONNECTION_FROM_SSL_int(ssl, const)
  |  |  ------------------
  |  |  |  |   32|  3.84k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 3.84k]
  |  |  |  |  ------------------
  |  |  |  |   33|  3.84k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  3.84k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 3.84k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  3.84k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  3.84k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
  107|       |
  108|  3.84k|    if (sc == NULL)
  ------------------
  |  Branch (108:9): [True: 0, False: 3.84k]
  ------------------
  109|      0|        return 0;
  110|       |
  111|       |    /*
  112|       |     * Historically being "in before" meant before anything had happened. In the
  113|       |     * current code though we remain in the "before" state for a while after we
  114|       |     * have started the handshake process (e.g. as a server waiting for the
  115|       |     * first message to arrive). There "in before" is taken to mean "in before"
  116|       |     * and not started any handshake process yet.
  117|       |     */
  118|  3.84k|    return (sc->statem.hand_state == TLS_ST_BEFORE)
  ------------------
  |  Branch (118:12): [True: 3.54k, False: 305]
  ------------------
  119|  3.54k|        && (sc->statem.state == MSG_FLOW_UNINITED);
  ------------------
  |  Branch (119:12): [True: 3.54k, False: 0]
  ------------------
  120|  3.84k|}
ossl_statem_clear:
  131|  5.31k|{
  132|  5.31k|    s->statem.state = MSG_FLOW_UNINITED;
  133|  5.31k|    s->statem.hand_state = TLS_ST_BEFORE;
  134|  5.31k|    ossl_statem_set_in_init(s, 1);
  135|  5.31k|    s->statem.no_cert_verify = 0;
  136|  5.31k|}
ossl_statem_send_fatal:
  148|  1.62k|{
  149|       |    /* We shouldn't call SSLfatal() twice. Once is enough */
  150|  1.62k|    if (s->statem.in_init && s->statem.state == MSG_FLOW_ERROR)
  ------------------
  |  Branch (150:9): [True: 1.62k, False: 0]
  |  Branch (150:30): [True: 0, False: 1.62k]
  ------------------
  151|      0|        return;
  152|  1.62k|    ossl_statem_set_in_init(s, 1);
  153|  1.62k|    s->statem.state = MSG_FLOW_ERROR;
  154|  1.62k|    if (al != SSL_AD_NO_ALERT)
  ------------------
  |  |   63|  1.62k|#define SSL_AD_NO_ALERT -1
  ------------------
  |  Branch (154:9): [True: 1.61k, False: 6]
  ------------------
  155|  1.61k|        ssl3_send_alert(s, SSL3_AL_FATAL, al);
  ------------------
  |  |  250|  1.61k|#define SSL3_AL_FATAL 2
  ------------------
  156|  1.62k|}
ossl_statem_fatal:
  166|  1.62k|{
  167|  1.62k|    va_list args;
  168|       |
  169|  1.62k|    va_start(args, fmt);
  170|  1.62k|    ERR_vset_error(ERR_LIB_SSL, reason, fmt, args);
  ------------------
  |  |   89|  1.62k|#define ERR_LIB_SSL 20
  ------------------
  171|  1.62k|    va_end(args);
  172|       |
  173|  1.62k|    ossl_statem_send_fatal(s, al);
  174|  1.62k|}
ossl_statem_set_in_init:
  204|  6.93k|{
  205|  6.93k|    s->statem.in_init = init;
  206|  6.93k|    if (s->rlayer.rrlmethod != NULL && s->rlayer.rrlmethod->set_in_init != NULL)
  ------------------
  |  Branch (206:9): [True: 5.16k, False: 1.77k]
  |  Branch (206:40): [True: 0, False: 5.16k]
  ------------------
  207|      0|        s->rlayer.rrlmethod->set_in_init(s->rlayer.rrl, init);
  208|  6.93k|}
ossl_statem_get_in_handshake:
  211|  3.88k|{
  212|  3.88k|    return s->statem.in_handshake;
  213|  3.88k|}
ossl_statem_check_finish_init:
  246|  2.07k|{
  247|  2.07k|    if (sending == -1) {
  ------------------
  |  Branch (247:9): [True: 2.07k, False: 0]
  ------------------
  248|  2.07k|        if (s->statem.hand_state == TLS_ST_PENDING_EARLY_DATA_END
  ------------------
  |  Branch (248:13): [True: 0, False: 2.07k]
  ------------------
  249|  2.07k|            || s->statem.hand_state == TLS_ST_EARLY_DATA) {
  ------------------
  |  Branch (249:16): [True: 0, False: 2.07k]
  ------------------
  250|      0|            ossl_statem_set_in_init(s, 1);
  251|      0|            if (s->early_data_state == SSL_EARLY_DATA_WRITE_RETRY) {
  ------------------
  |  Branch (251:17): [True: 0, False: 0]
  ------------------
  252|       |                /*
  253|       |                 * SSL_connect() or SSL_do_handshake() has been called directly.
  254|       |                 * We don't allow any more writing of early data.
  255|       |                 */
  256|      0|                s->early_data_state = SSL_EARLY_DATA_FINISHED_WRITING;
  257|      0|            }
  258|      0|        }
  259|  2.07k|    } else if (!s->server) {
  ------------------
  |  Branch (259:16): [True: 0, False: 0]
  ------------------
  260|      0|        if ((sending && (s->statem.hand_state == TLS_ST_PENDING_EARLY_DATA_END || s->statem.hand_state == TLS_ST_EARLY_DATA)
  ------------------
  |  Branch (260:14): [True: 0, False: 0]
  |  Branch (260:26): [True: 0, False: 0]
  |  Branch (260:83): [True: 0, False: 0]
  ------------------
  261|      0|                && s->early_data_state != SSL_EARLY_DATA_WRITING)
  ------------------
  |  Branch (261:20): [True: 0, False: 0]
  ------------------
  262|      0|            || (!sending && s->statem.hand_state == TLS_ST_EARLY_DATA)) {
  ------------------
  |  Branch (262:17): [True: 0, False: 0]
  |  Branch (262:29): [True: 0, False: 0]
  ------------------
  263|      0|            ossl_statem_set_in_init(s, 1);
  264|       |            /*
  265|       |             * SSL_write() has been called directly. We don't allow any more
  266|       |             * writing of early data.
  267|       |             */
  268|      0|            if (sending && s->early_data_state == SSL_EARLY_DATA_WRITE_RETRY)
  ------------------
  |  Branch (268:17): [True: 0, False: 0]
  |  Branch (268:28): [True: 0, False: 0]
  ------------------
  269|      0|                s->early_data_state = SSL_EARLY_DATA_FINISHED_WRITING;
  270|      0|        }
  271|      0|    } else {
  272|      0|        if (s->early_data_state == SSL_EARLY_DATA_FINISHED_READING
  ------------------
  |  Branch (272:13): [True: 0, False: 0]
  ------------------
  273|      0|            && s->statem.hand_state == TLS_ST_EARLY_DATA)
  ------------------
  |  Branch (273:16): [True: 0, False: 0]
  ------------------
  274|      0|            ossl_statem_set_in_init(s, 1);
  275|      0|    }
  276|  2.07k|    return 1;
  277|  2.07k|}
ossl_statem_connect:
  294|  2.07k|{
  295|  2.07k|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  ------------------
  |  |   39|  2.07k|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|  2.07k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 2.07k]
  |  |  |  |  ------------------
  |  |  |  |   33|  2.07k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  2.07k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 2.07k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  2.07k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  2.07k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
  296|       |
  297|  2.07k|    if (sc == NULL)
  ------------------
  |  Branch (297:9): [True: 0, False: 2.07k]
  ------------------
  298|      0|        return -1;
  299|       |
  300|  2.07k|    return state_machine(sc, 0);
  301|  2.07k|}
statem_flush:
  970|  1.64k|{
  971|  1.64k|    s->rwstate = SSL_WRITING;
  ------------------
  |  |  933|  1.64k|#define SSL_WRITING 2
  ------------------
  972|  1.64k|    if (BIO_flush(s->wbio) <= 0) {
  ------------------
  |  |  641|  1.64k|#define BIO_flush(b) (int)BIO_ctrl(b, BIO_CTRL_FLUSH, 0, NULL)
  |  |  ------------------
  |  |  |  |  100|  1.64k|#define BIO_CTRL_FLUSH 11 /* opt - 'flush' buffered output */
  |  |  ------------------
  ------------------
  |  Branch (972:9): [True: 0, False: 1.64k]
  ------------------
  973|      0|        return 0;
  974|      0|    }
  975|  1.64k|    s->rwstate = SSL_NOTHING;
  ------------------
  |  |  932|  1.64k|#define SSL_NOTHING 1
  ------------------
  976|       |
  977|  1.64k|    return 1;
  978|  1.64k|}
statem.c:state_machine:
  356|  2.07k|{
  357|  2.07k|    BUF_MEM *buf = NULL;
  358|  2.07k|    void (*cb)(const SSL *ssl, int type, int val) = NULL;
  359|  2.07k|    OSSL_STATEM *st = &s->statem;
  360|  2.07k|    int ret = -1;
  361|  2.07k|    int ssret;
  362|  2.07k|    SSL *ssl = SSL_CONNECTION_GET_SSL(s);
  ------------------
  |  |   27|  2.07k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
  363|  2.07k|    SSL *ussl = SSL_CONNECTION_GET_USER_SSL(s);
  ------------------
  |  |   28|  2.07k|#define SSL_CONNECTION_GET_USER_SSL(sc) ((sc)->user_ssl)
  ------------------
  364|       |
  365|  2.07k|    if (st->state == MSG_FLOW_ERROR) {
  ------------------
  |  Branch (365:9): [True: 0, False: 2.07k]
  ------------------
  366|       |        /* Shouldn't have been called if we're already in the error state */
  367|      0|        return -1;
  368|      0|    }
  369|       |
  370|  2.07k|    ERR_clear_error();
  371|  2.07k|    clear_sys_error();
  ------------------
  |  |   31|  2.07k|#define clear_sys_error() errno = 0
  ------------------
  372|       |
  373|  2.07k|    cb = get_callback(s);
  374|       |
  375|  2.07k|    st->in_handshake++;
  376|  2.07k|    if (!SSL_in_init(ssl) || SSL_in_before(ssl)) {
  ------------------
  |  Branch (376:9): [True: 0, False: 2.07k]
  |  Branch (376:30): [True: 1.77k, False: 305]
  ------------------
  377|       |        /*
  378|       |         * If we are stateless then we already called SSL_clear() - don't do
  379|       |         * it again and clear the STATELESS flag itself.
  380|       |         */
  381|  1.77k|        if ((s->s3.flags & TLS1_FLAGS_STATELESS) == 0 && !SSL_clear(ssl))
  ------------------
  |  |  304|  1.77k|#define TLS1_FLAGS_STATELESS 0x0800
  ------------------
  |  Branch (381:13): [True: 1.77k, False: 0]
  |  Branch (381:58): [True: 0, False: 1.77k]
  ------------------
  382|      0|            return -1;
  383|  1.77k|    }
  384|       |#ifndef OPENSSL_NO_SCTP
  385|       |    if (SSL_CONNECTION_IS_DTLS(s) && BIO_dgram_is_sctp(SSL_get_wbio(ssl))) {
  386|       |        /*
  387|       |         * Notify SCTP BIO socket to enter handshake mode and prevent stream
  388|       |         * identifier other than 0.
  389|       |         */
  390|       |        BIO_ctrl(SSL_get_wbio(ssl), BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE,
  391|       |            st->in_handshake, NULL);
  392|       |    }
  393|       |#endif
  394|       |
  395|       |    /* Initialise state machine */
  396|  2.07k|    if (st->state == MSG_FLOW_UNINITED
  ------------------
  |  Branch (396:9): [True: 1.77k, False: 305]
  ------------------
  397|  1.77k|        || st->state == MSG_FLOW_FINISHED) {
  ------------------
  |  Branch (397:12): [True: 0, False: 305]
  ------------------
  398|  1.77k|        if (st->state == MSG_FLOW_UNINITED) {
  ------------------
  |  Branch (398:13): [True: 1.77k, False: 0]
  ------------------
  399|  1.77k|            st->hand_state = TLS_ST_BEFORE;
  400|  1.77k|            st->request_state = TLS_ST_BEFORE;
  401|  1.77k|        }
  402|       |
  403|  1.77k|        s->server = server;
  404|  1.77k|        if (cb != NULL) {
  ------------------
  |  Branch (404:13): [True: 0, False: 1.77k]
  ------------------
  405|      0|            if (SSL_IS_FIRST_HANDSHAKE(s) || !SSL_CONNECTION_IS_TLS13(s))
  ------------------
  |  |  277|      0|#define SSL_IS_FIRST_HANDSHAKE(s) ((s)->s3.tmp.finish_md_len == 0 \
  |  |  ------------------
  |  |  |  Branch (277:36): [True: 0, False: 0]
  |  |  ------------------
  |  |  278|      0|    || (s)->s3.tmp.peer_finish_md_len == 0)
  |  |  ------------------
  |  |  |  Branch (278:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                          if (SSL_IS_FIRST_HANDSHAKE(s) || !SSL_CONNECTION_IS_TLS13(s))
  ------------------
  |  |  265|      0|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 0, False: 0]
  |  |  ------------------
  |  |  266|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  267|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|      0|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  406|      0|                cb(ussl, SSL_CB_HANDSHAKE_START, 1);
  ------------------
  |  | 1146|      0|#define SSL_CB_HANDSHAKE_START 0x10
  ------------------
  407|      0|        }
  408|       |
  409|       |        /*
  410|       |         * Fatal errors in this block don't send an alert because we have
  411|       |         * failed to even initialise properly. Sending an alert is probably
  412|       |         * doomed to failure.
  413|       |         */
  414|       |
  415|  1.77k|        if (SSL_CONNECTION_IS_DTLS(s)) {
  ------------------
  |  |  258|  1.77k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  1.77k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  1.77k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 1.77k]
  |  |  ------------------
  ------------------
  416|      0|            if ((s->version & 0xff00) != (DTLS1_VERSION & 0xff00) && (server || (s->version & 0xff00) != (DTLS1_BAD_VER & 0xff00))) {
  ------------------
  |  |   28|      0|#define DTLS1_VERSION 0xFEFF
  ------------------
                          if ((s->version & 0xff00) != (DTLS1_VERSION & 0xff00) && (server || (s->version & 0xff00) != (DTLS1_BAD_VER & 0xff00))) {
  ------------------
  |  |   30|      0|#define DTLS1_BAD_VER 0x0100
  ------------------
  |  Branch (416:17): [True: 0, False: 0]
  |  Branch (416:71): [True: 0, False: 0]
  |  Branch (416:81): [True: 0, False: 0]
  ------------------
  417|      0|                SSLfatal(s, SSL_AD_NO_ALERT, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  418|      0|                goto end;
  419|      0|            }
  420|  1.77k|        } else {
  421|  1.77k|            if ((s->version >> 8) != SSL3_VERSION_MAJOR) {
  ------------------
  |  |  216|  1.77k|#define SSL3_VERSION_MAJOR 0x03
  ------------------
  |  Branch (421:17): [True: 0, False: 1.77k]
  ------------------
  422|      0|                SSLfatal(s, SSL_AD_NO_ALERT, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  423|      0|                goto end;
  424|      0|            }
  425|  1.77k|        }
  426|       |
  427|  1.77k|        if (!ssl_security(s, SSL_SECOP_VERSION, 0, s->version, NULL)) {
  ------------------
  |  | 2766|  1.77k|#define SSL_SECOP_VERSION (9 | SSL_SECOP_OTHER_NONE)
  |  |  ------------------
  |  |  |  | 2737|  1.77k|#define SSL_SECOP_OTHER_NONE 0
  |  |  ------------------
  ------------------
  |  Branch (427:13): [True: 0, False: 1.77k]
  ------------------
  428|      0|            SSLfatal(s, SSL_AD_NO_ALERT, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  429|      0|            goto end;
  430|      0|        }
  431|       |
  432|  1.77k|        if (s->init_buf == NULL) {
  ------------------
  |  Branch (432:13): [True: 1.77k, False: 0]
  ------------------
  433|  1.77k|            if ((buf = BUF_MEM_new()) == NULL) {
  ------------------
  |  Branch (433:17): [True: 0, False: 1.77k]
  ------------------
  434|      0|                SSLfatal(s, SSL_AD_NO_ALERT, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  435|      0|                goto end;
  436|      0|            }
  437|  1.77k|            if (!BUF_MEM_grow(buf, SSL3_RT_MAX_PLAIN_LENGTH)) {
  ------------------
  |  |  177|  1.77k|#define SSL3_RT_MAX_PLAIN_LENGTH 16384
  ------------------
  |  Branch (437:17): [True: 0, False: 1.77k]
  ------------------
  438|      0|                SSLfatal(s, SSL_AD_NO_ALERT, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  439|      0|                goto end;
  440|      0|            }
  441|  1.77k|            s->init_buf = buf;
  442|  1.77k|            buf = NULL;
  443|  1.77k|        }
  444|       |
  445|  1.77k|        s->init_num = 0;
  446|       |
  447|       |        /*
  448|       |         * Should have been reset by tls_process_finished, too.
  449|       |         */
  450|  1.77k|        s->s3.change_cipher_spec = 0;
  451|       |
  452|       |        /*
  453|       |         * Ok, we now need to push on a buffering BIO ...but not with
  454|       |         * SCTP
  455|       |         */
  456|       |#ifndef OPENSSL_NO_SCTP
  457|       |        if (!SSL_CONNECTION_IS_DTLS(s) || !BIO_dgram_is_sctp(SSL_get_wbio(ssl)))
  458|       |#endif
  459|  1.77k|            if (!ssl_init_wbio_buffer(s)) {
  ------------------
  |  Branch (459:17): [True: 0, False: 1.77k]
  ------------------
  460|      0|                SSLfatal(s, SSL_AD_NO_ALERT, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  461|      0|                goto end;
  462|      0|            }
  463|       |
  464|  1.77k|        if ((SSL_in_before(ssl))
  ------------------
  |  Branch (464:13): [True: 1.77k, False: 0]
  ------------------
  465|  1.77k|            || s->renegotiate) {
  ------------------
  |  Branch (465:16): [True: 0, False: 0]
  ------------------
  466|  1.77k|            if (!tls_setup_handshake(s)) {
  ------------------
  |  Branch (466:17): [True: 4, False: 1.76k]
  ------------------
  467|       |                /* SSLfatal() already called */
  468|      4|                goto end;
  469|      4|            }
  470|       |
  471|  1.76k|            if (SSL_IS_FIRST_HANDSHAKE(s))
  ------------------
  |  |  277|  1.76k|#define SSL_IS_FIRST_HANDSHAKE(s) ((s)->s3.tmp.finish_md_len == 0 \
  |  |  ------------------
  |  |  |  Branch (277:36): [True: 1.76k, False: 0]
  |  |  ------------------
  |  |  278|  1.76k|    || (s)->s3.tmp.peer_finish_md_len == 0)
  |  |  ------------------
  |  |  |  Branch (278:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  472|  1.76k|                st->read_state_first_init = 1;
  473|  1.76k|        }
  474|       |
  475|  1.76k|        st->state = MSG_FLOW_WRITING;
  476|  1.76k|        init_write_state_machine(s);
  477|  1.76k|    }
  478|       |
  479|  3.71k|    while (st->state != MSG_FLOW_FINISHED) {
  ------------------
  |  Branch (479:12): [True: 3.71k, False: 0]
  ------------------
  480|  3.71k|        if (st->state == MSG_FLOW_READING) {
  ------------------
  |  Branch (480:13): [True: 1.94k, False: 1.76k]
  ------------------
  481|  1.94k|            ssret = read_state_machine(s);
  482|  1.94k|            if (ssret == SUB_STATE_FINISHED) {
  ------------------
  |  Branch (482:17): [True: 0, False: 1.94k]
  ------------------
  483|      0|                st->state = MSG_FLOW_WRITING;
  484|      0|                init_write_state_machine(s);
  485|  1.94k|            } else {
  486|       |                /* NBIO or error */
  487|  1.94k|                goto end;
  488|  1.94k|            }
  489|  1.94k|        } else if (st->state == MSG_FLOW_WRITING) {
  ------------------
  |  Branch (489:20): [True: 1.76k, False: 0]
  ------------------
  490|  1.76k|            ssret = write_state_machine(s);
  491|  1.76k|            if (ssret == SUB_STATE_FINISHED) {
  ------------------
  |  Branch (491:17): [True: 1.64k, False: 123]
  ------------------
  492|  1.64k|                st->state = MSG_FLOW_READING;
  493|  1.64k|                init_read_state_machine(s);
  494|  1.64k|            } else if (ssret == SUB_STATE_END_HANDSHAKE) {
  ------------------
  |  Branch (494:24): [True: 0, False: 123]
  ------------------
  495|      0|                st->state = MSG_FLOW_FINISHED;
  496|    123|            } else {
  497|       |                /* NBIO or error */
  498|    123|                goto end;
  499|    123|            }
  500|  1.76k|        } else {
  501|       |            /* Error */
  502|      0|            check_fatal(s);
  ------------------
  |  |  182|      0|    do {                                                             \
  |  |  183|      0|        if (!ossl_assert((s)->statem.in_init                         \
  |  |  ------------------
  |  |  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:41): [True: 0, False: 0]
  |  |  |  |  |  Branch (52:41): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   53|      0|    __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (183:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  184|      0|                && (s)->statem.state == MSG_FLOW_ERROR))             \
  |  |  185|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_MISSING_FATAL); \
  |  |  ------------------
  |  |  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  186|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (186:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  503|      0|            ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  504|      0|            goto end;
  505|      0|        }
  506|  3.71k|    }
  507|       |
  508|      0|    ret = 1;
  509|       |
  510|  2.07k|end:
  511|  2.07k|    st->in_handshake--;
  512|       |
  513|       |#ifndef OPENSSL_NO_SCTP
  514|       |    if (SSL_CONNECTION_IS_DTLS(s) && BIO_dgram_is_sctp(SSL_get_wbio(ssl))) {
  515|       |        /*
  516|       |         * Notify SCTP BIO socket to leave handshake mode and allow stream
  517|       |         * identifier other than 0.
  518|       |         */
  519|       |        BIO_ctrl(SSL_get_wbio(ssl), BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE,
  520|       |            st->in_handshake, NULL);
  521|       |    }
  522|       |#endif
  523|       |
  524|  2.07k|    BUF_MEM_free(buf);
  525|  2.07k|    if (cb != NULL) {
  ------------------
  |  Branch (525:9): [True: 0, False: 2.07k]
  ------------------
  526|      0|        if (server)
  ------------------
  |  Branch (526:13): [True: 0, False: 0]
  ------------------
  527|      0|            cb(ussl, SSL_CB_ACCEPT_EXIT, ret);
  ------------------
  |  | 1143|      0|#define SSL_CB_ACCEPT_EXIT (SSL_ST_ACCEPT | SSL_CB_EXIT)
  |  |  ------------------
  |  |  |  | 1131|      0|#define SSL_ST_ACCEPT 0x2000
  |  |  ------------------
  |  |               #define SSL_CB_ACCEPT_EXIT (SSL_ST_ACCEPT | SSL_CB_EXIT)
  |  |  ------------------
  |  |  |  | 1136|      0|#define SSL_CB_EXIT 0x02
  |  |  ------------------
  ------------------
  528|      0|        else
  529|      0|            cb(ussl, SSL_CB_CONNECT_EXIT, ret);
  ------------------
  |  | 1145|      0|#define SSL_CB_CONNECT_EXIT (SSL_ST_CONNECT | SSL_CB_EXIT)
  |  |  ------------------
  |  |  |  | 1130|      0|#define SSL_ST_CONNECT 0x1000
  |  |  ------------------
  |  |               #define SSL_CB_CONNECT_EXIT (SSL_ST_CONNECT | SSL_CB_EXIT)
  |  |  ------------------
  |  |  |  | 1136|      0|#define SSL_CB_EXIT 0x02
  |  |  ------------------
  ------------------
  530|      0|    }
  531|  2.07k|    return ret;
  532|      0|}
statem.c:get_callback:
  316|  5.78k|{
  317|  5.78k|    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
  ------------------
  |  |   26|  5.78k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
  318|       |
  319|  5.78k|    if (s->info_callback != NULL)
  ------------------
  |  Branch (319:9): [True: 0, False: 5.78k]
  ------------------
  320|      0|        return s->info_callback;
  321|  5.78k|    else if (sctx->info_callback != NULL)
  ------------------
  |  Branch (321:14): [True: 0, False: 5.78k]
  ------------------
  322|      0|        return sctx->info_callback;
  323|       |
  324|  5.78k|    return NULL;
  325|  5.78k|}
statem.c:init_write_state_machine:
  768|  1.76k|{
  769|  1.76k|    OSSL_STATEM *st = &s->statem;
  770|       |
  771|  1.76k|    st->write_state = WRITE_STATE_TRANSITION;
  772|  1.76k|}
statem.c:read_state_machine:
  587|  1.94k|{
  588|  1.94k|    OSSL_STATEM *st = &s->statem;
  589|  1.94k|    int ret, mt;
  590|  1.94k|    size_t len = 0;
  591|  1.94k|    int (*transition)(SSL_CONNECTION *s, int mt);
  592|  1.94k|    PACKET pkt;
  593|  1.94k|    MSG_PROCESS_RETURN (*process_message)(SSL_CONNECTION *s, PACKET *pkt);
  594|  1.94k|    WORK_STATE (*post_process_message)(SSL_CONNECTION *s, WORK_STATE wst);
  595|  1.94k|    size_t (*max_message_size)(SSL_CONNECTION *s);
  596|  1.94k|    void (*cb)(const SSL *ssl, int type, int val) = NULL;
  597|  1.94k|    SSL *ssl = SSL_CONNECTION_GET_USER_SSL(s);
  ------------------
  |  |   28|  1.94k|#define SSL_CONNECTION_GET_USER_SSL(sc) ((sc)->user_ssl)
  ------------------
  598|       |
  599|  1.94k|    cb = get_callback(s);
  600|       |
  601|  1.94k|    if (s->server) {
  ------------------
  |  Branch (601:9): [True: 0, False: 1.94k]
  ------------------
  602|      0|        transition = ossl_statem_server_read_transition;
  603|      0|        process_message = ossl_statem_server_process_message;
  604|      0|        max_message_size = ossl_statem_server_max_message_size;
  605|      0|        post_process_message = ossl_statem_server_post_process_message;
  606|  1.94k|    } else {
  607|  1.94k|        transition = ossl_statem_client_read_transition;
  608|  1.94k|        process_message = ossl_statem_client_process_message;
  609|  1.94k|        max_message_size = ossl_statem_client_max_message_size;
  610|  1.94k|        post_process_message = ossl_statem_client_post_process_message;
  611|  1.94k|    }
  612|       |
  613|  1.94k|    if (st->read_state_first_init) {
  ------------------
  |  Branch (613:9): [True: 1.64k, False: 305]
  ------------------
  614|  1.64k|        s->first_packet = 1;
  615|  1.64k|        st->read_state_first_init = 0;
  616|  1.64k|    }
  617|       |
  618|  1.94k|    while (1) {
  ------------------
  |  Branch (618:12): [True: 1.94k, Folded]
  ------------------
  619|  1.94k|        switch (st->read_state) {
  620|  1.94k|        case READ_STATE_HEADER:
  ------------------
  |  Branch (620:9): [True: 1.94k, False: 0]
  ------------------
  621|       |            /* Get the state the peer wants to move to */
  622|  1.94k|            if (SSL_CONNECTION_IS_DTLS(s)) {
  ------------------
  |  |  258|  1.94k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  1.94k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  1.94k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 1.94k]
  |  |  ------------------
  ------------------
  623|       |                /*
  624|       |                 * In DTLS we get the whole message in one go - header and body
  625|       |                 */
  626|      0|                ret = dtls_get_message(s, &mt);
  627|  1.94k|            } else {
  628|  1.94k|                ret = tls_get_message_header(s, &mt);
  629|  1.94k|            }
  630|       |
  631|  1.94k|            if (ret == 0) {
  ------------------
  |  Branch (631:17): [True: 1.73k, False: 210]
  ------------------
  632|       |                /* Could be non-blocking IO */
  633|  1.73k|                return SUB_STATE_ERROR;
  634|  1.73k|            }
  635|       |
  636|    210|            if (cb != NULL) {
  ------------------
  |  Branch (636:17): [True: 0, False: 210]
  ------------------
  637|       |                /* Notify callback of an impending state change */
  638|      0|                if (s->server)
  ------------------
  |  Branch (638:21): [True: 0, False: 0]
  ------------------
  639|      0|                    cb(ssl, SSL_CB_ACCEPT_LOOP, 1);
  ------------------
  |  | 1142|      0|#define SSL_CB_ACCEPT_LOOP (SSL_ST_ACCEPT | SSL_CB_LOOP)
  |  |  ------------------
  |  |  |  | 1131|      0|#define SSL_ST_ACCEPT 0x2000
  |  |  ------------------
  |  |               #define SSL_CB_ACCEPT_LOOP (SSL_ST_ACCEPT | SSL_CB_LOOP)
  |  |  ------------------
  |  |  |  | 1135|      0|#define SSL_CB_LOOP 0x01
  |  |  ------------------
  ------------------
  640|      0|                else
  641|      0|                    cb(ssl, SSL_CB_CONNECT_LOOP, 1);
  ------------------
  |  | 1144|      0|#define SSL_CB_CONNECT_LOOP (SSL_ST_CONNECT | SSL_CB_LOOP)
  |  |  ------------------
  |  |  |  | 1130|      0|#define SSL_ST_CONNECT 0x1000
  |  |  ------------------
  |  |               #define SSL_CB_CONNECT_LOOP (SSL_ST_CONNECT | SSL_CB_LOOP)
  |  |  ------------------
  |  |  |  | 1135|      0|#define SSL_CB_LOOP 0x01
  |  |  ------------------
  ------------------
  642|      0|            }
  643|       |            /*
  644|       |             * Validate that we are allowed to move to the new state and move
  645|       |             * to that state if so
  646|       |             */
  647|    210|            if (!transition(s, mt))
  ------------------
  |  Branch (647:17): [True: 8, False: 202]
  ------------------
  648|      8|                return SUB_STATE_ERROR;
  649|       |
  650|    202|            if (s->s3.tmp.message_size > max_message_size(s)) {
  ------------------
  |  Branch (650:17): [True: 18, False: 184]
  ------------------
  651|     18|                SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
  ------------------
  |  |  148|     18|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|     18|    (ERR_new(),                                                  \
  |  |  |  |  151|     18|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|     18|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|     18|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  652|     18|                    SSL_R_EXCESSIVE_MESSAGE_SIZE);
  653|     18|                return SUB_STATE_ERROR;
  654|     18|            }
  655|       |
  656|       |            /* dtls_get_message already did this */
  657|    184|            if (!SSL_CONNECTION_IS_DTLS(s)
  ------------------
  |  |  258|    368|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|    184|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|    184|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  ------------------
  |  Branch (657:17): [True: 184, False: 0]
  ------------------
  658|    184|                && s->s3.tmp.message_size > 0
  ------------------
  |  Branch (658:20): [True: 183, False: 1]
  ------------------
  659|    183|                && !grow_init_buf(s, s->s3.tmp.message_size + SSL3_HM_HEADER_LENGTH)) {
  ------------------
  |  |  141|    183|#define SSL3_HM_HEADER_LENGTH 4
  ------------------
  |  Branch (659:20): [True: 0, False: 183]
  ------------------
  660|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_BUF_LIB);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  661|      0|                return SUB_STATE_ERROR;
  662|      0|            }
  663|       |
  664|    184|            st->read_state = READ_STATE_BODY;
  665|       |            /* Fall through */
  666|       |
  667|    184|        case READ_STATE_BODY:
  ------------------
  |  Branch (667:9): [True: 0, False: 1.94k]
  ------------------
  668|    184|            if (SSL_CONNECTION_IS_DTLS(s)) {
  ------------------
  |  |  258|    184|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|    184|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|    184|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 184]
  |  |  ------------------
  ------------------
  669|       |                /*
  670|       |                 * Actually we already have the body, but we give DTLS the
  671|       |                 * opportunity to do any further processing.
  672|       |                 */
  673|      0|                ret = dtls_get_message_body(s, &len);
  674|    184|            } else {
  675|    184|                ret = tls_get_message_body(s, &len);
  676|    184|            }
  677|    184|            if (ret == 0) {
  ------------------
  |  Branch (677:17): [True: 34, False: 150]
  ------------------
  678|       |                /* Could be non-blocking IO */
  679|     34|                return SUB_STATE_ERROR;
  680|     34|            }
  681|       |
  682|    150|            s->first_packet = 0;
  683|    150|            if (!PACKET_buf_init(&pkt, s->init_msg, len)) {
  ------------------
  |  Branch (683:17): [True: 0, False: 150]
  ------------------
  684|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  685|      0|                return SUB_STATE_ERROR;
  686|      0|            }
  687|    150|            ret = process_message(s, &pkt);
  688|       |
  689|       |            /* Discard the packet data */
  690|    150|            s->init_num = 0;
  691|       |
  692|    150|            switch (ret) {
  693|    150|            case MSG_PROCESS_ERROR:
  ------------------
  |  Branch (693:13): [True: 150, False: 0]
  ------------------
  694|    150|                check_fatal(s);
  ------------------
  |  |  182|    150|    do {                                                             \
  |  |  183|    150|        if (!ossl_assert((s)->statem.in_init                         \
  |  |  ------------------
  |  |  |  |   52|    300|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:41): [True: 150, False: 0]
  |  |  |  |  |  Branch (52:41): [True: 150, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   53|    150|    __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (183:13): [True: 0, False: 150]
  |  |  ------------------
  |  |  184|    150|                && (s)->statem.state == MSG_FLOW_ERROR))             \
  |  |  185|    150|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_MISSING_FATAL); \
  |  |  ------------------
  |  |  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  186|    150|    } while (0)
  |  |  ------------------
  |  |  |  Branch (186:14): [Folded, False: 150]
  |  |  ------------------
  ------------------
  695|    150|                return SUB_STATE_ERROR;
  696|       |
  697|      0|            case MSG_PROCESS_FINISHED_READING:
  ------------------
  |  Branch (697:13): [True: 0, False: 150]
  ------------------
  698|      0|                if (SSL_CONNECTION_IS_DTLS(s)) {
  ------------------
  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  699|      0|                    dtls1_stop_timer(s);
  700|      0|                }
  701|      0|                return SUB_STATE_FINISHED;
  702|       |
  703|      0|            case MSG_PROCESS_CONTINUE_PROCESSING:
  ------------------
  |  Branch (703:13): [True: 0, False: 150]
  ------------------
  704|      0|                st->read_state = READ_STATE_POST_PROCESS;
  705|      0|                st->read_state_work = WORK_MORE_A;
  706|      0|                break;
  707|       |
  708|      0|            default:
  ------------------
  |  Branch (708:13): [True: 0, False: 150]
  ------------------
  709|      0|                st->read_state = READ_STATE_HEADER;
  710|      0|                break;
  711|    150|            }
  712|      0|            break;
  713|       |
  714|      0|        case READ_STATE_POST_PROCESS:
  ------------------
  |  Branch (714:9): [True: 0, False: 1.94k]
  ------------------
  715|      0|            st->read_state_work = post_process_message(s, st->read_state_work);
  716|      0|            switch (st->read_state_work) {
  ------------------
  |  Branch (716:21): [True: 0, False: 0]
  ------------------
  717|      0|            case WORK_ERROR:
  ------------------
  |  Branch (717:13): [True: 0, False: 0]
  ------------------
  718|      0|                check_fatal(s);
  ------------------
  |  |  182|      0|    do {                                                             \
  |  |  183|      0|        if (!ossl_assert((s)->statem.in_init                         \
  |  |  ------------------
  |  |  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:41): [True: 0, False: 0]
  |  |  |  |  |  Branch (52:41): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   53|      0|    __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (183:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  184|      0|                && (s)->statem.state == MSG_FLOW_ERROR))             \
  |  |  185|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_MISSING_FATAL); \
  |  |  ------------------
  |  |  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  186|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (186:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  719|       |                /* Fall through */
  720|      0|            case WORK_MORE_A:
  ------------------
  |  Branch (720:13): [True: 0, False: 0]
  ------------------
  721|      0|            case WORK_MORE_B:
  ------------------
  |  Branch (721:13): [True: 0, False: 0]
  ------------------
  722|      0|            case WORK_MORE_C:
  ------------------
  |  Branch (722:13): [True: 0, False: 0]
  ------------------
  723|      0|                return SUB_STATE_ERROR;
  724|       |
  725|      0|            case WORK_FINISHED_CONTINUE:
  ------------------
  |  Branch (725:13): [True: 0, False: 0]
  ------------------
  726|      0|                st->read_state = READ_STATE_HEADER;
  727|      0|                break;
  728|       |
  729|      0|            case WORK_FINISHED_SWAP:
  ------------------
  |  Branch (729:13): [True: 0, False: 0]
  ------------------
  730|      0|            case WORK_FINISHED_STOP:
  ------------------
  |  Branch (730:13): [True: 0, False: 0]
  ------------------
  731|      0|                if (SSL_CONNECTION_IS_DTLS(s)) {
  ------------------
  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  732|      0|                    dtls1_stop_timer(s);
  733|      0|                }
  734|      0|                return SUB_STATE_FINISHED;
  735|      0|            }
  736|      0|            break;
  737|       |
  738|      0|        default:
  ------------------
  |  Branch (738:9): [True: 0, False: 1.94k]
  ------------------
  739|       |            /* Shouldn't happen */
  740|       |            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  741|      0|            return SUB_STATE_ERROR;
  742|  1.94k|        }
  743|  1.94k|    }
  744|  1.94k|}
statem.c:grow_init_buf:
  545|    183|{
  546|       |
  547|    183|    size_t msg_offset = (char *)s->init_msg - s->init_buf->data;
  548|       |
  549|    183|    if (!BUF_MEM_grow_clean(s->init_buf, (int)size))
  ------------------
  |  Branch (549:9): [True: 0, False: 183]
  ------------------
  550|      0|        return 0;
  551|       |
  552|    183|    if (size < msg_offset)
  ------------------
  |  Branch (552:9): [True: 0, False: 183]
  ------------------
  553|      0|        return 0;
  554|       |
  555|    183|    s->init_msg = s->init_buf->data + msg_offset;
  556|       |
  557|    183|    return 1;
  558|    183|}
statem.c:write_state_machine:
  806|  1.76k|{
  807|  1.76k|    OSSL_STATEM *st = &s->statem;
  808|  1.76k|    int ret;
  809|  1.76k|    WRITE_TRAN (*transition)(SSL_CONNECTION *s);
  810|  1.76k|    WORK_STATE (*pre_work)(SSL_CONNECTION *s, WORK_STATE wst);
  811|  1.76k|    WORK_STATE (*post_work)(SSL_CONNECTION *s, WORK_STATE wst);
  812|  1.76k|    int (*get_construct_message_f)(SSL_CONNECTION *s,
  813|  1.76k|        CON_FUNC_RETURN (**confunc)(SSL_CONNECTION *s,
  814|  1.76k|            WPACKET *pkt),
  815|  1.76k|        int *mt);
  816|  1.76k|    void (*cb)(const SSL *ssl, int type, int val) = NULL;
  817|  1.76k|    CON_FUNC_RETURN (*confunc)(SSL_CONNECTION *s, WPACKET *pkt);
  818|  1.76k|    int mt;
  819|  1.76k|    WPACKET pkt;
  820|  1.76k|    SSL *ssl = SSL_CONNECTION_GET_USER_SSL(s);
  ------------------
  |  |   28|  1.76k|#define SSL_CONNECTION_GET_USER_SSL(sc) ((sc)->user_ssl)
  ------------------
  821|       |
  822|  1.76k|    cb = get_callback(s);
  823|       |
  824|  1.76k|    if (s->server) {
  ------------------
  |  Branch (824:9): [True: 0, False: 1.76k]
  ------------------
  825|      0|        transition = ossl_statem_server_write_transition;
  826|      0|        pre_work = ossl_statem_server_pre_work;
  827|      0|        post_work = ossl_statem_server_post_work;
  828|      0|        get_construct_message_f = ossl_statem_server_construct_message;
  829|  1.76k|    } else {
  830|  1.76k|        transition = ossl_statem_client_write_transition;
  831|  1.76k|        pre_work = ossl_statem_client_pre_work;
  832|  1.76k|        post_work = ossl_statem_client_post_work;
  833|  1.76k|        get_construct_message_f = ossl_statem_client_construct_message;
  834|  1.76k|    }
  835|       |
  836|  5.17k|    while (1) {
  ------------------
  |  Branch (836:12): [True: 5.17k, Folded]
  ------------------
  837|  5.17k|        switch (st->write_state) {
  838|  3.40k|        case WRITE_STATE_TRANSITION:
  ------------------
  |  Branch (838:9): [True: 3.40k, False: 1.76k]
  ------------------
  839|  3.40k|            if (cb != NULL) {
  ------------------
  |  Branch (839:17): [True: 0, False: 3.40k]
  ------------------
  840|       |                /* Notify callback of an impending state change */
  841|      0|                if (s->server)
  ------------------
  |  Branch (841:21): [True: 0, False: 0]
  ------------------
  842|      0|                    cb(ssl, SSL_CB_ACCEPT_LOOP, 1);
  ------------------
  |  | 1142|      0|#define SSL_CB_ACCEPT_LOOP (SSL_ST_ACCEPT | SSL_CB_LOOP)
  |  |  ------------------
  |  |  |  | 1131|      0|#define SSL_ST_ACCEPT 0x2000
  |  |  ------------------
  |  |               #define SSL_CB_ACCEPT_LOOP (SSL_ST_ACCEPT | SSL_CB_LOOP)
  |  |  ------------------
  |  |  |  | 1135|      0|#define SSL_CB_LOOP 0x01
  |  |  ------------------
  ------------------
  843|      0|                else
  844|      0|                    cb(ssl, SSL_CB_CONNECT_LOOP, 1);
  ------------------
  |  | 1144|      0|#define SSL_CB_CONNECT_LOOP (SSL_ST_CONNECT | SSL_CB_LOOP)
  |  |  ------------------
  |  |  |  | 1130|      0|#define SSL_ST_CONNECT 0x1000
  |  |  ------------------
  |  |               #define SSL_CB_CONNECT_LOOP (SSL_ST_CONNECT | SSL_CB_LOOP)
  |  |  ------------------
  |  |  |  | 1135|      0|#define SSL_CB_LOOP 0x01
  |  |  ------------------
  ------------------
  845|      0|            }
  846|  3.40k|            switch (transition(s)) {
  ------------------
  |  Branch (846:21): [True: 3.40k, False: 0]
  ------------------
  847|  1.76k|            case WRITE_TRAN_CONTINUE:
  ------------------
  |  Branch (847:13): [True: 1.76k, False: 1.64k]
  ------------------
  848|  1.76k|                st->write_state = WRITE_STATE_PRE_WORK;
  849|  1.76k|                st->write_state_work = WORK_MORE_A;
  850|  1.76k|                break;
  851|       |
  852|  1.64k|            case WRITE_TRAN_FINISHED:
  ------------------
  |  Branch (852:13): [True: 1.64k, False: 1.76k]
  ------------------
  853|  1.64k|                return SUB_STATE_FINISHED;
  854|       |
  855|      0|            case WRITE_TRAN_ERROR:
  ------------------
  |  Branch (855:13): [True: 0, False: 3.40k]
  ------------------
  856|      0|                check_fatal(s);
  ------------------
  |  |  182|      0|    do {                                                             \
  |  |  183|      0|        if (!ossl_assert((s)->statem.in_init                         \
  |  |  ------------------
  |  |  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:41): [True: 0, False: 0]
  |  |  |  |  |  Branch (52:41): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   53|      0|    __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (183:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  184|      0|                && (s)->statem.state == MSG_FLOW_ERROR))             \
  |  |  185|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_MISSING_FATAL); \
  |  |  ------------------
  |  |  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  186|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (186:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  857|      0|                return SUB_STATE_ERROR;
  858|  3.40k|            }
  859|  1.76k|            break;
  860|       |
  861|  1.76k|        case WRITE_STATE_PRE_WORK:
  ------------------
  |  Branch (861:9): [True: 1.76k, False: 3.40k]
  ------------------
  862|  1.76k|            switch (st->write_state_work = pre_work(s, st->write_state_work)) {
  ------------------
  |  Branch (862:21): [True: 1.76k, False: 0]
  ------------------
  863|      0|            case WORK_ERROR:
  ------------------
  |  Branch (863:13): [True: 0, False: 1.76k]
  ------------------
  864|      0|                check_fatal(s);
  ------------------
  |  |  182|      0|    do {                                                             \
  |  |  183|      0|        if (!ossl_assert((s)->statem.in_init                         \
  |  |  ------------------
  |  |  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:41): [True: 0, False: 0]
  |  |  |  |  |  Branch (52:41): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   53|      0|    __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (183:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  184|      0|                && (s)->statem.state == MSG_FLOW_ERROR))             \
  |  |  185|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_MISSING_FATAL); \
  |  |  ------------------
  |  |  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  186|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (186:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  865|       |                /* Fall through */
  866|      0|            case WORK_MORE_A:
  ------------------
  |  Branch (866:13): [True: 0, False: 1.76k]
  ------------------
  867|      0|            case WORK_MORE_B:
  ------------------
  |  Branch (867:13): [True: 0, False: 1.76k]
  ------------------
  868|      0|            case WORK_MORE_C:
  ------------------
  |  Branch (868:13): [True: 0, False: 1.76k]
  ------------------
  869|      0|                return SUB_STATE_ERROR;
  870|       |
  871|  1.76k|            case WORK_FINISHED_CONTINUE:
  ------------------
  |  Branch (871:13): [True: 1.76k, False: 0]
  ------------------
  872|  1.76k|                st->write_state = WRITE_STATE_SEND;
  873|  1.76k|                break;
  874|       |
  875|      0|            case WORK_FINISHED_SWAP:
  ------------------
  |  Branch (875:13): [True: 0, False: 1.76k]
  ------------------
  876|      0|                return SUB_STATE_FINISHED;
  877|       |
  878|      0|            case WORK_FINISHED_STOP:
  ------------------
  |  Branch (878:13): [True: 0, False: 1.76k]
  ------------------
  879|      0|                return SUB_STATE_END_HANDSHAKE;
  880|  1.76k|            }
  881|  1.76k|            if (!get_construct_message_f(s, &confunc, &mt)) {
  ------------------
  |  Branch (881:17): [True: 0, False: 1.76k]
  ------------------
  882|       |                /* SSLfatal() already called */
  883|      0|                return SUB_STATE_ERROR;
  884|      0|            }
  885|  1.76k|            if (mt == SSL3_MT_DUMMY) {
  ------------------
  |  |   41|  1.76k|#define SSL3_MT_DUMMY -1
  ------------------
  |  Branch (885:17): [True: 0, False: 1.76k]
  ------------------
  886|       |                /* Skip construction and sending. This isn't a "real" state */
  887|      0|                st->write_state = WRITE_STATE_POST_WORK;
  888|      0|                st->write_state_work = WORK_MORE_A;
  889|      0|                break;
  890|      0|            }
  891|  1.76k|            if (!WPACKET_init(&pkt, s->init_buf)
  ------------------
  |  Branch (891:17): [True: 0, False: 1.76k]
  ------------------
  892|  1.76k|                || !ssl_set_handshake_header(s, &pkt, mt)) {
  ------------------
  |  | 2178|  1.76k|    SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->set_handshake_header((s), (pkt), (htype))
  |  |  ------------------
  |  |  |  |   27|  1.76k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  ------------------
  |  Branch (892:20): [True: 0, False: 1.76k]
  ------------------
  893|      0|                WPACKET_cleanup(&pkt);
  894|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  895|      0|                return SUB_STATE_ERROR;
  896|      0|            }
  897|  1.76k|            if (confunc != NULL) {
  ------------------
  |  Branch (897:17): [True: 1.76k, False: 0]
  ------------------
  898|  1.76k|                CON_FUNC_RETURN tmpret;
  899|       |
  900|  1.76k|                tmpret = confunc(s, &pkt);
  901|  1.76k|                if (tmpret == CON_FUNC_ERROR) {
  ------------------
  |  Branch (901:21): [True: 123, False: 1.64k]
  ------------------
  902|    123|                    WPACKET_cleanup(&pkt);
  903|    123|                    check_fatal(s);
  ------------------
  |  |  182|    123|    do {                                                             \
  |  |  183|    123|        if (!ossl_assert((s)->statem.in_init                         \
  |  |  ------------------
  |  |  |  |   52|    246|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:41): [True: 123, False: 0]
  |  |  |  |  |  Branch (52:41): [True: 123, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   53|    123|    __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (183:13): [True: 0, False: 123]
  |  |  ------------------
  |  |  184|    123|                && (s)->statem.state == MSG_FLOW_ERROR))             \
  |  |  185|    123|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_MISSING_FATAL); \
  |  |  ------------------
  |  |  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  186|    123|    } while (0)
  |  |  ------------------
  |  |  |  Branch (186:14): [Folded, False: 123]
  |  |  ------------------
  ------------------
  904|    123|                    return SUB_STATE_ERROR;
  905|  1.64k|                } else if (tmpret == CON_FUNC_DONT_SEND) {
  ------------------
  |  Branch (905:28): [True: 0, False: 1.64k]
  ------------------
  906|       |                    /*
  907|       |                     * The construction function decided not to construct the
  908|       |                     * message after all and continue. Skip sending.
  909|       |                     */
  910|      0|                    WPACKET_cleanup(&pkt);
  911|      0|                    st->write_state = WRITE_STATE_POST_WORK;
  912|      0|                    st->write_state_work = WORK_MORE_A;
  913|      0|                    break;
  914|      0|                } /* else success */
  915|  1.76k|            }
  916|  1.64k|            if (!ssl_close_construct_packet(s, &pkt, mt)
  ------------------
  |  | 2180|  1.64k|    SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->close_construct_packet((s), (pkt), (htype))
  |  |  ------------------
  |  |  |  |   27|  1.64k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  ------------------
  |  Branch (916:17): [True: 0, False: 1.64k]
  ------------------
  917|  1.64k|                || !WPACKET_finish(&pkt)) {
  ------------------
  |  Branch (917:20): [True: 0, False: 1.64k]
  ------------------
  918|      0|                WPACKET_cleanup(&pkt);
  919|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  920|      0|                return SUB_STATE_ERROR;
  921|      0|            }
  922|       |
  923|       |            /* Fall through */
  924|       |
  925|  1.64k|        case WRITE_STATE_SEND:
  ------------------
  |  Branch (925:9): [True: 0, False: 5.17k]
  ------------------
  926|  1.64k|            if (SSL_CONNECTION_IS_DTLS(s) && st->use_timer) {
  ------------------
  |  |  258|  3.28k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  1.64k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  1.64k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 1.64k]
  |  |  ------------------
  ------------------
  |  Branch (926:46): [True: 0, False: 0]
  ------------------
  927|      0|                dtls1_start_timer(s);
  928|      0|            }
  929|  1.64k|            ret = statem_do_write(s);
  930|  1.64k|            if (ret <= 0) {
  ------------------
  |  Branch (930:17): [True: 0, False: 1.64k]
  ------------------
  931|      0|                return SUB_STATE_ERROR;
  932|      0|            }
  933|  1.64k|            st->write_state = WRITE_STATE_POST_WORK;
  934|  1.64k|            st->write_state_work = WORK_MORE_A;
  935|       |            /* Fall through */
  936|       |
  937|  1.64k|        case WRITE_STATE_POST_WORK:
  ------------------
  |  Branch (937:9): [True: 0, False: 5.17k]
  ------------------
  938|  1.64k|            switch (st->write_state_work = post_work(s, st->write_state_work)) {
  ------------------
  |  Branch (938:21): [True: 1.64k, False: 0]
  ------------------
  939|      0|            case WORK_ERROR:
  ------------------
  |  Branch (939:13): [True: 0, False: 1.64k]
  ------------------
  940|      0|                check_fatal(s);
  ------------------
  |  |  182|      0|    do {                                                             \
  |  |  183|      0|        if (!ossl_assert((s)->statem.in_init                         \
  |  |  ------------------
  |  |  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:41): [True: 0, False: 0]
  |  |  |  |  |  Branch (52:41): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   53|      0|    __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (183:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  184|      0|                && (s)->statem.state == MSG_FLOW_ERROR))             \
  |  |  185|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_MISSING_FATAL); \
  |  |  ------------------
  |  |  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  186|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (186:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  941|       |                /* Fall through */
  942|      0|            case WORK_MORE_A:
  ------------------
  |  Branch (942:13): [True: 0, False: 1.64k]
  ------------------
  943|      0|            case WORK_MORE_B:
  ------------------
  |  Branch (943:13): [True: 0, False: 1.64k]
  ------------------
  944|      0|            case WORK_MORE_C:
  ------------------
  |  Branch (944:13): [True: 0, False: 1.64k]
  ------------------
  945|      0|                return SUB_STATE_ERROR;
  946|       |
  947|  1.64k|            case WORK_FINISHED_CONTINUE:
  ------------------
  |  Branch (947:13): [True: 1.64k, False: 0]
  ------------------
  948|  1.64k|                st->write_state = WRITE_STATE_TRANSITION;
  949|  1.64k|                break;
  950|       |
  951|      0|            case WORK_FINISHED_SWAP:
  ------------------
  |  Branch (951:13): [True: 0, False: 1.64k]
  ------------------
  952|      0|                return SUB_STATE_FINISHED;
  953|       |
  954|      0|            case WORK_FINISHED_STOP:
  ------------------
  |  Branch (954:13): [True: 0, False: 1.64k]
  ------------------
  955|      0|                return SUB_STATE_END_HANDSHAKE;
  956|  1.64k|            }
  957|  1.64k|            break;
  958|       |
  959|  1.64k|        default:
  ------------------
  |  Branch (959:9): [True: 0, False: 5.17k]
  ------------------
  960|       |            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  961|      0|            return SUB_STATE_ERROR;
  962|  5.17k|        }
  963|  5.17k|    }
  964|  1.76k|}
statem.c:statem_do_write:
  750|  1.64k|{
  751|  1.64k|    OSSL_STATEM *st = &s->statem;
  752|       |
  753|  1.64k|    if (st->hand_state == TLS_ST_CW_CHANGE
  ------------------
  |  Branch (753:9): [True: 0, False: 1.64k]
  ------------------
  754|  1.64k|        || st->hand_state == TLS_ST_SW_CHANGE) {
  ------------------
  |  Branch (754:12): [True: 0, False: 1.64k]
  ------------------
  755|      0|        if (SSL_CONNECTION_IS_DTLS(s))
  ------------------
  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  756|      0|            return dtls1_do_write(s, SSL3_RT_CHANGE_CIPHER_SPEC);
  ------------------
  |  |  219|      0|#define SSL3_RT_CHANGE_CIPHER_SPEC 20
  ------------------
  757|      0|        else
  758|      0|            return ssl3_do_write(s, SSL3_RT_CHANGE_CIPHER_SPEC);
  ------------------
  |  |  219|      0|#define SSL3_RT_CHANGE_CIPHER_SPEC 20
  ------------------
  759|  1.64k|    } else {
  760|  1.64k|        return ssl_do_write(s);
  ------------------
  |  | 2181|  1.64k|#define ssl_do_write(s) SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->do_write(s)
  |  |  ------------------
  |  |  |  |   27|  1.64k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  ------------------
  761|  1.64k|    }
  762|  1.64k|}
statem.c:init_read_state_machine:
  538|  1.64k|{
  539|  1.64k|    OSSL_STATEM *st = &s->statem;
  540|       |
  541|  1.64k|    st->read_state = READ_STATE_HEADER;
  542|  1.64k|}

ossl_statem_client_read_transition:
  232|    210|{
  233|    210|    OSSL_STATEM *st = &s->statem;
  234|    210|    int ske_expected;
  235|       |
  236|       |    /*
  237|       |     * Note that after writing the first ClientHello we don't know what version
  238|       |     * we are going to negotiate yet, so we don't take this branch until later.
  239|       |     */
  240|    210|    if (SSL_CONNECTION_IS_TLS13(s)) {
  ------------------
  |  |  265|    210|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|    420|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|    210|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|    210|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 210, False: 0]
  |  |  ------------------
  |  |  266|    210|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|    210|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|    420|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 210, False: 0]
  |  |  ------------------
  |  |  267|    210|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|    210|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|    210|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 210]
  |  |  ------------------
  ------------------
  241|      0|        if (!ossl_statem_client13_read_transition(s, mt))
  ------------------
  |  Branch (241:13): [True: 0, False: 0]
  ------------------
  242|      0|            goto err;
  243|      0|        return 1;
  244|      0|    }
  245|       |
  246|    210|    switch (st->hand_state) {
  247|      0|    default:
  ------------------
  |  Branch (247:5): [True: 0, False: 210]
  ------------------
  248|      0|        break;
  249|       |
  250|    210|    case TLS_ST_CW_CLNT_HELLO:
  ------------------
  |  Branch (250:5): [True: 210, False: 0]
  ------------------
  251|    210|        if (mt == SSL3_MT_SERVER_HELLO) {
  ------------------
  |  |  314|    210|#define SSL3_MT_SERVER_HELLO 2
  ------------------
  |  Branch (251:13): [True: 202, False: 8]
  ------------------
  252|    202|            st->hand_state = TLS_ST_CR_SRVR_HELLO;
  253|    202|            return 1;
  254|    202|        }
  255|       |
  256|      8|        if (SSL_CONNECTION_IS_DTLS(s)) {
  ------------------
  |  |  258|      8|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|      8|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|      8|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 8]
  |  |  ------------------
  ------------------
  257|      0|            if (mt == DTLS1_MT_HELLO_VERIFY_REQUEST) {
  ------------------
  |  |  334|      0|#define DTLS1_MT_HELLO_VERIFY_REQUEST 3
  ------------------
  |  Branch (257:17): [True: 0, False: 0]
  ------------------
  258|      0|                st->hand_state = DTLS_ST_CR_HELLO_VERIFY_REQUEST;
  259|      0|                return 1;
  260|      0|            }
  261|      0|        }
  262|      8|        break;
  263|       |
  264|      8|    case TLS_ST_EARLY_DATA:
  ------------------
  |  Branch (264:5): [True: 0, False: 210]
  ------------------
  265|       |        /*
  266|       |         * We've not actually selected TLSv1.3 yet, but we have sent early
  267|       |         * data. The only thing allowed now is a ServerHello or a
  268|       |         * HelloRetryRequest.
  269|       |         */
  270|      0|        if (mt == SSL3_MT_SERVER_HELLO) {
  ------------------
  |  |  314|      0|#define SSL3_MT_SERVER_HELLO 2
  ------------------
  |  Branch (270:13): [True: 0, False: 0]
  ------------------
  271|      0|            st->hand_state = TLS_ST_CR_SRVR_HELLO;
  272|      0|            return 1;
  273|      0|        }
  274|      0|        break;
  275|       |
  276|      0|    case TLS_ST_CR_SRVR_HELLO:
  ------------------
  |  Branch (276:5): [True: 0, False: 210]
  ------------------
  277|      0|        if (s->hit) {
  ------------------
  |  Branch (277:13): [True: 0, False: 0]
  ------------------
  278|      0|            if (s->ext.ticket_expected) {
  ------------------
  |  Branch (278:17): [True: 0, False: 0]
  ------------------
  279|      0|                if (mt == SSL3_MT_NEWSESSION_TICKET) {
  ------------------
  |  |  315|      0|#define SSL3_MT_NEWSESSION_TICKET 4
  ------------------
  |  Branch (279:21): [True: 0, False: 0]
  ------------------
  280|      0|                    st->hand_state = TLS_ST_CR_SESSION_TICKET;
  281|      0|                    return 1;
  282|      0|                }
  283|      0|            } else if (mt == SSL3_MT_CHANGE_CIPHER_SPEC) {
  ------------------
  |  |  337|      0|#define SSL3_MT_CHANGE_CIPHER_SPEC 0x0101
  ------------------
  |  Branch (283:24): [True: 0, False: 0]
  ------------------
  284|      0|                st->hand_state = TLS_ST_CR_CHANGE;
  285|      0|                return 1;
  286|      0|            }
  287|      0|        } else {
  288|      0|            if (SSL_CONNECTION_IS_DTLS(s)
  ------------------
  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  289|      0|                && mt == DTLS1_MT_HELLO_VERIFY_REQUEST) {
  ------------------
  |  |  334|      0|#define DTLS1_MT_HELLO_VERIFY_REQUEST 3
  ------------------
  |  Branch (289:20): [True: 0, False: 0]
  ------------------
  290|      0|                st->hand_state = DTLS_ST_CR_HELLO_VERIFY_REQUEST;
  291|      0|                return 1;
  292|      0|            } else if (s->version >= TLS1_VERSION
  ------------------
  |  |   24|      0|#define TLS1_VERSION 0x0301
  ------------------
  |  Branch (292:24): [True: 0, False: 0]
  ------------------
  293|      0|                && s->ext.session_secret_cb != NULL
  ------------------
  |  Branch (293:20): [True: 0, False: 0]
  ------------------
  294|      0|                && s->session->ext.tick != NULL
  ------------------
  |  Branch (294:20): [True: 0, False: 0]
  ------------------
  295|      0|                && mt == SSL3_MT_CHANGE_CIPHER_SPEC) {
  ------------------
  |  |  337|      0|#define SSL3_MT_CHANGE_CIPHER_SPEC 0x0101
  ------------------
  |  Branch (295:20): [True: 0, False: 0]
  ------------------
  296|       |                /*
  297|       |                 * Normally, we can tell if the server is resuming the session
  298|       |                 * from the session ID. EAP-FAST (RFC 4851), however, relies on
  299|       |                 * the next server message after the ServerHello to determine if
  300|       |                 * the server is resuming.
  301|       |                 */
  302|      0|                s->hit = 1;
  303|      0|                st->hand_state = TLS_ST_CR_CHANGE;
  304|      0|                return 1;
  305|      0|            } else if (!(s->s3.tmp.new_cipher->algorithm_auth
  ------------------
  |  Branch (305:24): [True: 0, False: 0]
  ------------------
  306|      0|                           & (SSL_aNULL | SSL_aSRP | SSL_aPSK))) {
  ------------------
  |  |  112|      0|#define SSL_aNULL 0x00000004U
  ------------------
                                         & (SSL_aNULL | SSL_aSRP | SSL_aPSK))) {
  ------------------
  |  |  120|      0|#define SSL_aSRP 0x00000040U
  ------------------
                                         & (SSL_aNULL | SSL_aSRP | SSL_aPSK))) {
  ------------------
  |  |  116|      0|#define SSL_aPSK 0x00000010U
  ------------------
  307|      0|                if (mt == SSL3_MT_CERTIFICATE) {
  ------------------
  |  |  318|      0|#define SSL3_MT_CERTIFICATE 11
  ------------------
  |  Branch (307:21): [True: 0, False: 0]
  ------------------
  308|      0|                    st->hand_state = TLS_ST_CR_CERT;
  309|      0|                    return 1;
  310|      0|                }
  311|      0|            } else {
  312|      0|                ske_expected = key_exchange_expected(s);
  313|       |                /* SKE is optional for some PSK ciphersuites */
  314|      0|                if (ske_expected
  ------------------
  |  Branch (314:21): [True: 0, False: 0]
  ------------------
  315|      0|                    || ((s->s3.tmp.new_cipher->algorithm_mkey & SSL_PSK)
  ------------------
  |  |  101|      0|#define SSL_PSK (SSL_kPSK | SSL_kRSAPSK | SSL_kECDHEPSK | SSL_kDHEPSK)
  |  |  ------------------
  |  |  |  |   87|      0|#define SSL_kPSK 0x00000008U
  |  |  ------------------
  |  |               #define SSL_PSK (SSL_kPSK | SSL_kRSAPSK | SSL_kECDHEPSK | SSL_kDHEPSK)
  |  |  ------------------
  |  |  |  |   93|      0|#define SSL_kRSAPSK 0x00000040U
  |  |  ------------------
  |  |               #define SSL_PSK (SSL_kPSK | SSL_kRSAPSK | SSL_kECDHEPSK | SSL_kDHEPSK)
  |  |  ------------------
  |  |  |  |   94|      0|#define SSL_kECDHEPSK 0x00000080U
  |  |  ------------------
  |  |               #define SSL_PSK (SSL_kPSK | SSL_kRSAPSK | SSL_kECDHEPSK | SSL_kDHEPSK)
  |  |  ------------------
  |  |  |  |   95|      0|#define SSL_kDHEPSK 0x00000100U
  |  |  ------------------
  ------------------
  |  Branch (315:25): [True: 0, False: 0]
  ------------------
  316|      0|                        && mt == SSL3_MT_SERVER_KEY_EXCHANGE)) {
  ------------------
  |  |  319|      0|#define SSL3_MT_SERVER_KEY_EXCHANGE 12
  ------------------
  |  Branch (316:28): [True: 0, False: 0]
  ------------------
  317|      0|                    if (mt == SSL3_MT_SERVER_KEY_EXCHANGE) {
  ------------------
  |  |  319|      0|#define SSL3_MT_SERVER_KEY_EXCHANGE 12
  ------------------
  |  Branch (317:25): [True: 0, False: 0]
  ------------------
  318|      0|                        st->hand_state = TLS_ST_CR_KEY_EXCH;
  319|      0|                        return 1;
  320|      0|                    }
  321|      0|                } else if (mt == SSL3_MT_CERTIFICATE_REQUEST
  ------------------
  |  |  320|      0|#define SSL3_MT_CERTIFICATE_REQUEST 13
  ------------------
  |  Branch (321:28): [True: 0, False: 0]
  ------------------
  322|      0|                    && cert_req_allowed(s)) {
  ------------------
  |  Branch (322:24): [True: 0, False: 0]
  ------------------
  323|      0|                    st->hand_state = TLS_ST_CR_CERT_REQ;
  324|      0|                    return 1;
  325|      0|                } else if (mt == SSL3_MT_SERVER_DONE) {
  ------------------
  |  |  321|      0|#define SSL3_MT_SERVER_DONE 14
  ------------------
  |  Branch (325:28): [True: 0, False: 0]
  ------------------
  326|      0|                    st->hand_state = TLS_ST_CR_SRVR_DONE;
  327|      0|                    return 1;
  328|      0|                }
  329|      0|            }
  330|      0|        }
  331|      0|        break;
  332|       |
  333|      0|    case TLS_ST_CR_CERT:
  ------------------
  |  Branch (333:5): [True: 0, False: 210]
  ------------------
  334|      0|    case TLS_ST_CR_COMP_CERT:
  ------------------
  |  Branch (334:5): [True: 0, False: 210]
  ------------------
  335|       |        /*
  336|       |         * The CertificateStatus message is optional even if
  337|       |         * |ext.status_expected| is set
  338|       |         */
  339|      0|        if (s->ext.status_expected && mt == SSL3_MT_CERTIFICATE_STATUS) {
  ------------------
  |  |  326|      0|#define SSL3_MT_CERTIFICATE_STATUS 22
  ------------------
  |  Branch (339:13): [True: 0, False: 0]
  |  Branch (339:39): [True: 0, False: 0]
  ------------------
  340|      0|            st->hand_state = TLS_ST_CR_CERT_STATUS;
  341|      0|            return 1;
  342|      0|        }
  343|       |        /* Fall through */
  344|       |
  345|      0|    case TLS_ST_CR_CERT_STATUS:
  ------------------
  |  Branch (345:5): [True: 0, False: 210]
  ------------------
  346|      0|        ske_expected = key_exchange_expected(s);
  347|       |        /* SKE is optional for some PSK ciphersuites */
  348|      0|        if (ske_expected || ((s->s3.tmp.new_cipher->algorithm_mkey & SSL_PSK) && mt == SSL3_MT_SERVER_KEY_EXCHANGE)) {
  ------------------
  |  |  101|      0|#define SSL_PSK (SSL_kPSK | SSL_kRSAPSK | SSL_kECDHEPSK | SSL_kDHEPSK)
  |  |  ------------------
  |  |  |  |   87|      0|#define SSL_kPSK 0x00000008U
  |  |  ------------------
  |  |               #define SSL_PSK (SSL_kPSK | SSL_kRSAPSK | SSL_kECDHEPSK | SSL_kDHEPSK)
  |  |  ------------------
  |  |  |  |   93|      0|#define SSL_kRSAPSK 0x00000040U
  |  |  ------------------
  |  |               #define SSL_PSK (SSL_kPSK | SSL_kRSAPSK | SSL_kECDHEPSK | SSL_kDHEPSK)
  |  |  ------------------
  |  |  |  |   94|      0|#define SSL_kECDHEPSK 0x00000080U
  |  |  ------------------
  |  |               #define SSL_PSK (SSL_kPSK | SSL_kRSAPSK | SSL_kECDHEPSK | SSL_kDHEPSK)
  |  |  ------------------
  |  |  |  |   95|      0|#define SSL_kDHEPSK 0x00000100U
  |  |  ------------------
  ------------------
                      if (ske_expected || ((s->s3.tmp.new_cipher->algorithm_mkey & SSL_PSK) && mt == SSL3_MT_SERVER_KEY_EXCHANGE)) {
  ------------------
  |  |  319|      0|#define SSL3_MT_SERVER_KEY_EXCHANGE 12
  ------------------
  |  Branch (348:13): [True: 0, False: 0]
  |  Branch (348:30): [True: 0, False: 0]
  |  Branch (348:82): [True: 0, False: 0]
  ------------------
  349|      0|            if (mt == SSL3_MT_SERVER_KEY_EXCHANGE) {
  ------------------
  |  |  319|      0|#define SSL3_MT_SERVER_KEY_EXCHANGE 12
  ------------------
  |  Branch (349:17): [True: 0, False: 0]
  ------------------
  350|      0|                st->hand_state = TLS_ST_CR_KEY_EXCH;
  351|      0|                return 1;
  352|      0|            }
  353|      0|            goto err;
  354|      0|        }
  355|       |        /* Fall through */
  356|       |
  357|      0|    case TLS_ST_CR_KEY_EXCH:
  ------------------
  |  Branch (357:5): [True: 0, False: 210]
  ------------------
  358|      0|        if (mt == SSL3_MT_CERTIFICATE_REQUEST) {
  ------------------
  |  |  320|      0|#define SSL3_MT_CERTIFICATE_REQUEST 13
  ------------------
  |  Branch (358:13): [True: 0, False: 0]
  ------------------
  359|      0|            if (cert_req_allowed(s)) {
  ------------------
  |  Branch (359:17): [True: 0, False: 0]
  ------------------
  360|      0|                st->hand_state = TLS_ST_CR_CERT_REQ;
  361|      0|                return 1;
  362|      0|            }
  363|      0|            goto err;
  364|      0|        }
  365|       |        /* Fall through */
  366|       |
  367|      0|    case TLS_ST_CR_CERT_REQ:
  ------------------
  |  Branch (367:5): [True: 0, False: 210]
  ------------------
  368|      0|        if (mt == SSL3_MT_SERVER_DONE) {
  ------------------
  |  |  321|      0|#define SSL3_MT_SERVER_DONE 14
  ------------------
  |  Branch (368:13): [True: 0, False: 0]
  ------------------
  369|      0|            st->hand_state = TLS_ST_CR_SRVR_DONE;
  370|      0|            return 1;
  371|      0|        }
  372|      0|        break;
  373|       |
  374|      0|    case TLS_ST_CW_FINISHED:
  ------------------
  |  Branch (374:5): [True: 0, False: 210]
  ------------------
  375|      0|        if (s->ext.ticket_expected) {
  ------------------
  |  Branch (375:13): [True: 0, False: 0]
  ------------------
  376|      0|            if (mt == SSL3_MT_NEWSESSION_TICKET) {
  ------------------
  |  |  315|      0|#define SSL3_MT_NEWSESSION_TICKET 4
  ------------------
  |  Branch (376:17): [True: 0, False: 0]
  ------------------
  377|      0|                st->hand_state = TLS_ST_CR_SESSION_TICKET;
  378|      0|                return 1;
  379|      0|            }
  380|      0|        } else if (mt == SSL3_MT_CHANGE_CIPHER_SPEC) {
  ------------------
  |  |  337|      0|#define SSL3_MT_CHANGE_CIPHER_SPEC 0x0101
  ------------------
  |  Branch (380:20): [True: 0, False: 0]
  ------------------
  381|      0|            st->hand_state = TLS_ST_CR_CHANGE;
  382|      0|            return 1;
  383|      0|        }
  384|      0|        break;
  385|       |
  386|      0|    case TLS_ST_CR_SESSION_TICKET:
  ------------------
  |  Branch (386:5): [True: 0, False: 210]
  ------------------
  387|      0|        if (mt == SSL3_MT_CHANGE_CIPHER_SPEC) {
  ------------------
  |  |  337|      0|#define SSL3_MT_CHANGE_CIPHER_SPEC 0x0101
  ------------------
  |  Branch (387:13): [True: 0, False: 0]
  ------------------
  388|      0|            st->hand_state = TLS_ST_CR_CHANGE;
  389|      0|            return 1;
  390|      0|        }
  391|      0|        break;
  392|       |
  393|      0|    case TLS_ST_CR_CHANGE:
  ------------------
  |  Branch (393:5): [True: 0, False: 210]
  ------------------
  394|      0|        if (mt == SSL3_MT_FINISHED) {
  ------------------
  |  |  324|      0|#define SSL3_MT_FINISHED 20
  ------------------
  |  Branch (394:13): [True: 0, False: 0]
  ------------------
  395|      0|            st->hand_state = TLS_ST_CR_FINISHED;
  396|      0|            return 1;
  397|      0|        }
  398|      0|        break;
  399|       |
  400|      0|    case TLS_ST_OK:
  ------------------
  |  Branch (400:5): [True: 0, False: 210]
  ------------------
  401|      0|        if (mt == SSL3_MT_HELLO_REQUEST) {
  ------------------
  |  |  312|      0|#define SSL3_MT_HELLO_REQUEST 0
  ------------------
  |  Branch (401:13): [True: 0, False: 0]
  ------------------
  402|      0|            st->hand_state = TLS_ST_CR_HELLO_REQ;
  403|      0|            return 1;
  404|      0|        }
  405|      0|        break;
  406|    210|    }
  407|       |
  408|      8|err:
  409|       |    /* No valid transition found */
  410|      8|    if (SSL_CONNECTION_IS_DTLS(s) && mt == SSL3_MT_CHANGE_CIPHER_SPEC) {
  ------------------
  |  |  258|     16|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|      8|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|      8|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 8]
  |  |  ------------------
  ------------------
                  if (SSL_CONNECTION_IS_DTLS(s) && mt == SSL3_MT_CHANGE_CIPHER_SPEC) {
  ------------------
  |  |  337|      0|#define SSL3_MT_CHANGE_CIPHER_SPEC 0x0101
  ------------------
  |  Branch (410:38): [True: 0, False: 0]
  ------------------
  411|      0|        BIO *rbio;
  412|       |
  413|       |        /*
  414|       |         * CCS messages don't have a message sequence number so this is probably
  415|       |         * because of an out-of-order CCS. We'll just drop it.
  416|       |         */
  417|      0|        s->init_num = 0;
  418|      0|        s->rwstate = SSL_READING;
  ------------------
  |  |  934|      0|#define SSL_READING 3
  ------------------
  419|      0|        rbio = SSL_get_rbio(SSL_CONNECTION_GET_SSL(s));
  ------------------
  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
  420|      0|        BIO_clear_retry_flags(rbio);
  ------------------
  |  |  263|      0|    BIO_clear_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  225|      0|#define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|      0|#define BIO_FLAGS_READ 0x01
  |  |  |  |  ------------------
  |  |  |  |               #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  223|      0|#define BIO_FLAGS_WRITE 0x02
  |  |  |  |  ------------------
  |  |  |  |               #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  224|      0|#define BIO_FLAGS_IO_SPECIAL 0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   BIO_clear_flags(b, (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  226|      0|#define BIO_FLAGS_SHOULD_RETRY 0x08
  |  |  ------------------
  ------------------
  421|      0|        BIO_set_retry_read(rbio);
  ------------------
  |  |  257|      0|    BIO_set_flags(b, (BIO_FLAGS_READ | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  222|      0|#define BIO_FLAGS_READ 0x01
  |  |  ------------------
  |  |                   BIO_set_flags(b, (BIO_FLAGS_READ | BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  226|      0|#define BIO_FLAGS_SHOULD_RETRY 0x08
  |  |  ------------------
  ------------------
  422|      0|        return 0;
  423|      0|    }
  424|      8|    SSLfatal(s, SSL3_AD_UNEXPECTED_MESSAGE, SSL_R_UNEXPECTED_MESSAGE);
  ------------------
  |  |  148|      8|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      8|    (ERR_new(),                                                  \
  |  |  |  |  151|      8|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      8|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      8|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  425|      8|    return 0;
  426|      8|}
ossl_statem_client_write_transition:
  543|  3.40k|{
  544|  3.40k|    OSSL_STATEM *st = &s->statem;
  545|       |
  546|       |    /*
  547|       |     * Note that immediately before/after a ClientHello we don't know what
  548|       |     * version we are going to negotiate yet, so we don't take this branch until
  549|       |     * later
  550|       |     */
  551|  3.40k|    if (SSL_CONNECTION_IS_TLS13(s))
  ------------------
  |  |  265|  3.40k|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|  6.81k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  3.40k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|  3.40k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 3.40k, False: 0]
  |  |  ------------------
  |  |  266|  3.40k|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|  3.40k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|  6.81k|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 3.40k, False: 0]
  |  |  ------------------
  |  |  267|  3.40k|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|  3.40k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|  3.40k|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 3.40k]
  |  |  ------------------
  ------------------
  552|      0|        return ossl_statem_client13_write_transition(s);
  553|       |
  554|  3.40k|    switch (st->hand_state) {
  555|      0|    default:
  ------------------
  |  Branch (555:5): [True: 0, False: 3.40k]
  ------------------
  556|       |        /* Shouldn't happen */
  557|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  558|      0|        return WRITE_TRAN_ERROR;
  559|       |
  560|      0|    case TLS_ST_OK:
  ------------------
  |  Branch (560:5): [True: 0, False: 3.40k]
  ------------------
  561|      0|        if (!s->renegotiate) {
  ------------------
  |  Branch (561:13): [True: 0, False: 0]
  ------------------
  562|       |            /*
  563|       |             * We haven't requested a renegotiation ourselves so we must have
  564|       |             * received a message from the server. Better read it.
  565|       |             */
  566|      0|            return WRITE_TRAN_FINISHED;
  567|      0|        }
  568|       |        /* Renegotiation */
  569|       |        /* fall thru */
  570|  1.76k|    case TLS_ST_BEFORE:
  ------------------
  |  Branch (570:5): [True: 1.76k, False: 1.64k]
  ------------------
  571|  1.76k|        st->hand_state = TLS_ST_CW_CLNT_HELLO;
  572|  1.76k|        return WRITE_TRAN_CONTINUE;
  573|       |
  574|  1.64k|    case TLS_ST_CW_CLNT_HELLO:
  ------------------
  |  Branch (574:5): [True: 1.64k, False: 1.76k]
  ------------------
  575|  1.64k|        if (s->early_data_state == SSL_EARLY_DATA_CONNECTING
  ------------------
  |  Branch (575:13): [True: 0, False: 1.64k]
  ------------------
  576|      0|            && !SSL_IS_QUIC_HANDSHAKE(s)) {
  ------------------
  |  |  303|      0|#define SSL_IS_QUIC_HANDSHAKE(s) (((s)->s3.flags & TLS1_FLAGS_QUIC) != 0)
  |  |  ------------------
  |  |  |  |   29|      0|#define TLS1_FLAGS_QUIC 0x2000
  |  |  ------------------
  ------------------
  |  Branch (576:16): [True: 0, False: 0]
  ------------------
  577|       |            /*
  578|       |             * We are assuming this is a TLSv1.3 connection, although we haven't
  579|       |             * actually selected a version yet.
  580|       |             */
  581|      0|            if ((s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) != 0)
  ------------------
  |  |  403|      0|#define SSL_OP_ENABLE_MIDDLEBOX_COMPAT SSL_OP_BIT(20)
  |  |  ------------------
  |  |  |  |  350|      0|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (581:17): [True: 0, False: 0]
  ------------------
  582|      0|                st->hand_state = TLS_ST_CW_CHANGE;
  583|      0|            else
  584|      0|                st->hand_state = TLS_ST_EARLY_DATA;
  585|      0|            return WRITE_TRAN_CONTINUE;
  586|      0|        }
  587|       |        /*
  588|       |         * No transition at the end of writing because we don't know what
  589|       |         * we will be sent
  590|       |         */
  591|  1.64k|        s->ts_msg_write = ossl_time_now();
  592|  1.64k|        return WRITE_TRAN_FINISHED;
  593|       |
  594|      0|    case TLS_ST_CR_SRVR_HELLO:
  ------------------
  |  Branch (594:5): [True: 0, False: 3.40k]
  ------------------
  595|       |        /*
  596|       |         * We only get here in TLSv1.3. We just received an HRR, so issue a
  597|       |         * CCS unless middlebox compat mode is off, or we already issued one
  598|       |         * because we did early data.
  599|       |         */
  600|      0|        if ((s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) != 0
  ------------------
  |  |  403|      0|#define SSL_OP_ENABLE_MIDDLEBOX_COMPAT SSL_OP_BIT(20)
  |  |  ------------------
  |  |  |  |  350|      0|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (600:13): [True: 0, False: 0]
  ------------------
  601|      0|            && s->early_data_state != SSL_EARLY_DATA_FINISHED_WRITING)
  ------------------
  |  Branch (601:16): [True: 0, False: 0]
  ------------------
  602|      0|            st->hand_state = TLS_ST_CW_CHANGE;
  603|      0|        else
  604|      0|            st->hand_state = TLS_ST_CW_CLNT_HELLO;
  605|      0|        return WRITE_TRAN_CONTINUE;
  606|       |
  607|      0|    case TLS_ST_EARLY_DATA:
  ------------------
  |  Branch (607:5): [True: 0, False: 3.40k]
  ------------------
  608|      0|        s->ts_msg_write = ossl_time_now();
  609|      0|        return WRITE_TRAN_FINISHED;
  610|       |
  611|      0|    case DTLS_ST_CR_HELLO_VERIFY_REQUEST:
  ------------------
  |  Branch (611:5): [True: 0, False: 3.40k]
  ------------------
  612|      0|        st->hand_state = TLS_ST_CW_CLNT_HELLO;
  613|      0|        return WRITE_TRAN_CONTINUE;
  614|       |
  615|      0|    case TLS_ST_CR_SRVR_DONE:
  ------------------
  |  Branch (615:5): [True: 0, False: 3.40k]
  ------------------
  616|      0|        s->ts_msg_read = ossl_time_now();
  617|      0|        if (s->s3.tmp.cert_req)
  ------------------
  |  Branch (617:13): [True: 0, False: 0]
  ------------------
  618|      0|            st->hand_state = TLS_ST_CW_CERT;
  619|      0|        else
  620|      0|            st->hand_state = TLS_ST_CW_KEY_EXCH;
  621|      0|        return WRITE_TRAN_CONTINUE;
  622|       |
  623|      0|    case TLS_ST_CW_CERT:
  ------------------
  |  Branch (623:5): [True: 0, False: 3.40k]
  ------------------
  624|      0|        st->hand_state = TLS_ST_CW_KEY_EXCH;
  625|      0|        return WRITE_TRAN_CONTINUE;
  626|       |
  627|      0|    case TLS_ST_CW_KEY_EXCH:
  ------------------
  |  Branch (627:5): [True: 0, False: 3.40k]
  ------------------
  628|       |        /*
  629|       |         * For TLS, cert_req is set to 2, so a cert chain of nothing is
  630|       |         * sent, but no verify packet is sent
  631|       |         */
  632|       |        /*
  633|       |         * XXX: For now, we do not support client authentication in ECDH
  634|       |         * cipher suites with ECDH (rather than ECDSA) certificates. We
  635|       |         * need to skip the certificate verify message when client's
  636|       |         * ECDH public key is sent inside the client certificate.
  637|       |         */
  638|      0|        if (s->s3.tmp.cert_req == 1) {
  ------------------
  |  Branch (638:13): [True: 0, False: 0]
  ------------------
  639|      0|            st->hand_state = TLS_ST_CW_CERT_VRFY;
  640|      0|        } else {
  641|      0|            st->hand_state = TLS_ST_CW_CHANGE;
  642|      0|        }
  643|      0|        if (s->s3.flags & TLS1_FLAGS_SKIP_CERT_VERIFY) {
  ------------------
  |  |  293|      0|#define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010
  ------------------
  |  Branch (643:13): [True: 0, False: 0]
  ------------------
  644|      0|            st->hand_state = TLS_ST_CW_CHANGE;
  645|      0|        }
  646|      0|        return WRITE_TRAN_CONTINUE;
  647|       |
  648|      0|    case TLS_ST_CW_CERT_VRFY:
  ------------------
  |  Branch (648:5): [True: 0, False: 3.40k]
  ------------------
  649|      0|        st->hand_state = TLS_ST_CW_CHANGE;
  650|      0|        return WRITE_TRAN_CONTINUE;
  651|       |
  652|      0|    case TLS_ST_CW_CHANGE:
  ------------------
  |  Branch (652:5): [True: 0, False: 3.40k]
  ------------------
  653|      0|        if (s->hello_retry_request == SSL_HRR_PENDING) {
  ------------------
  |  Branch (653:13): [True: 0, False: 0]
  ------------------
  654|      0|            st->hand_state = TLS_ST_CW_CLNT_HELLO;
  655|      0|        } else if (s->early_data_state == SSL_EARLY_DATA_CONNECTING) {
  ------------------
  |  Branch (655:20): [True: 0, False: 0]
  ------------------
  656|      0|            st->hand_state = TLS_ST_EARLY_DATA;
  657|      0|        } else {
  658|       |#if defined(OPENSSL_NO_NEXTPROTONEG)
  659|       |            st->hand_state = TLS_ST_CW_FINISHED;
  660|       |#else
  661|      0|            if (!SSL_CONNECTION_IS_DTLS(s) && s->s3.npn_seen)
  ------------------
  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  ------------------
  |  Branch (661:17): [True: 0, False: 0]
  |  Branch (661:47): [True: 0, False: 0]
  ------------------
  662|      0|                st->hand_state = TLS_ST_CW_NEXT_PROTO;
  663|      0|            else
  664|      0|                st->hand_state = TLS_ST_CW_FINISHED;
  665|      0|#endif
  666|      0|        }
  667|      0|        return WRITE_TRAN_CONTINUE;
  668|       |
  669|      0|#if !defined(OPENSSL_NO_NEXTPROTONEG)
  670|      0|    case TLS_ST_CW_NEXT_PROTO:
  ------------------
  |  Branch (670:5): [True: 0, False: 3.40k]
  ------------------
  671|      0|        st->hand_state = TLS_ST_CW_FINISHED;
  672|      0|        return WRITE_TRAN_CONTINUE;
  673|      0|#endif
  674|       |
  675|      0|    case TLS_ST_CW_FINISHED:
  ------------------
  |  Branch (675:5): [True: 0, False: 3.40k]
  ------------------
  676|      0|        if (s->hit) {
  ------------------
  |  Branch (676:13): [True: 0, False: 0]
  ------------------
  677|      0|            st->hand_state = TLS_ST_OK;
  678|      0|            return WRITE_TRAN_CONTINUE;
  679|      0|        } else {
  680|      0|            return WRITE_TRAN_FINISHED;
  681|      0|        }
  682|       |
  683|      0|    case TLS_ST_CR_FINISHED:
  ------------------
  |  Branch (683:5): [True: 0, False: 3.40k]
  ------------------
  684|      0|        if (s->hit) {
  ------------------
  |  Branch (684:13): [True: 0, False: 0]
  ------------------
  685|      0|            st->hand_state = TLS_ST_CW_CHANGE;
  686|      0|            return WRITE_TRAN_CONTINUE;
  687|      0|        } else {
  688|      0|            st->hand_state = TLS_ST_OK;
  689|      0|            return WRITE_TRAN_CONTINUE;
  690|      0|        }
  691|       |
  692|      0|    case TLS_ST_CR_HELLO_REQ:
  ------------------
  |  Branch (692:5): [True: 0, False: 3.40k]
  ------------------
  693|       |        /*
  694|       |         * If we can renegotiate now then do so, otherwise wait for a more
  695|       |         * convenient time.
  696|       |         */
  697|      0|        if (ssl3_renegotiate_check(SSL_CONNECTION_GET_SSL(s), 1)) {
  ------------------
  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
  |  Branch (697:13): [True: 0, False: 0]
  ------------------
  698|      0|            if (!tls_setup_handshake(s)) {
  ------------------
  |  Branch (698:17): [True: 0, False: 0]
  ------------------
  699|       |                /* SSLfatal() already called */
  700|      0|                return WRITE_TRAN_ERROR;
  701|      0|            }
  702|      0|            st->hand_state = TLS_ST_CW_CLNT_HELLO;
  703|      0|            return WRITE_TRAN_CONTINUE;
  704|      0|        }
  705|      0|        st->hand_state = TLS_ST_OK;
  706|      0|        return WRITE_TRAN_CONTINUE;
  707|  3.40k|    }
  708|  3.40k|}
ossl_statem_client_pre_work:
  715|  1.76k|{
  716|  1.76k|    OSSL_STATEM *st = &s->statem;
  717|       |
  718|  1.76k|    switch (st->hand_state) {
  719|      0|    default:
  ------------------
  |  Branch (719:5): [True: 0, False: 1.76k]
  ------------------
  720|       |        /* No pre work to be done */
  721|      0|        break;
  722|       |
  723|  1.76k|    case TLS_ST_CW_CLNT_HELLO:
  ------------------
  |  Branch (723:5): [True: 1.76k, False: 0]
  ------------------
  724|  1.76k|        s->shutdown = 0;
  725|  1.76k|        if (SSL_CONNECTION_IS_DTLS(s)) {
  ------------------
  |  |  258|  1.76k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  1.76k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  1.76k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 1.76k]
  |  |  ------------------
  ------------------
  726|       |            /* every DTLS ClientHello resets Finished MAC */
  727|      0|            if (!ssl3_init_finished_mac(s)) {
  ------------------
  |  Branch (727:17): [True: 0, False: 0]
  ------------------
  728|       |                /* SSLfatal() already called */
  729|      0|                return WORK_ERROR;
  730|      0|            }
  731|  1.76k|        } else if (s->ext.early_data == SSL_EARLY_DATA_REJECTED) {
  ------------------
  |  | 2036|  1.76k|#define SSL_EARLY_DATA_REJECTED 1
  ------------------
  |  Branch (731:20): [True: 0, False: 1.76k]
  ------------------
  732|       |            /*
  733|       |             * This must be a second ClientHello after an HRR following an
  734|       |             * earlier rejected attempt to send early data. Since we were
  735|       |             * previously encrypting the early data we now need to reset the
  736|       |             * write record layer in order to write in plaintext again.
  737|       |             */
  738|      0|            if (!ssl_set_new_record_layer(s,
  ------------------
  |  Branch (738:17): [True: 0, False: 0]
  ------------------
  739|      0|                    TLS_ANY_VERSION,
  ------------------
  |  |   40|      0|#define TLS_ANY_VERSION 0x10000
  ------------------
  740|      0|                    OSSL_RECORD_DIRECTION_WRITE,
  ------------------
  |  |   43|      0|#define OSSL_RECORD_DIRECTION_WRITE 1
  ------------------
  741|      0|                    OSSL_RECORD_PROTECTION_LEVEL_NONE,
  ------------------
  |  | 2932|      0|#define OSSL_RECORD_PROTECTION_LEVEL_NONE 0
  ------------------
  742|      0|                    NULL, 0, NULL, 0, NULL, 0, NULL, 0,
  743|      0|                    NULL, 0, NID_undef, NULL, NULL,
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  744|      0|                    NULL)) {
  745|       |                /* SSLfatal already called */
  746|      0|                return WORK_ERROR;
  747|      0|            }
  748|      0|        }
  749|  1.76k|        break;
  750|       |
  751|  1.76k|    case TLS_ST_CW_CHANGE:
  ------------------
  |  Branch (751:5): [True: 0, False: 1.76k]
  ------------------
  752|      0|        if (SSL_CONNECTION_IS_DTLS(s)) {
  ------------------
  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  753|      0|            if (s->hit) {
  ------------------
  |  Branch (753:17): [True: 0, False: 0]
  ------------------
  754|       |                /*
  755|       |                 * We're into the last flight so we don't retransmit these
  756|       |                 * messages unless we need to.
  757|       |                 */
  758|      0|                st->use_timer = 0;
  759|      0|            }
  760|       |#ifndef OPENSSL_NO_SCTP
  761|       |            if (BIO_dgram_is_sctp(SSL_get_wbio(SSL_CONNECTION_GET_SSL(s)))) {
  762|       |                /* Calls SSLfatal() as required */
  763|       |                return dtls_wait_for_dry(s);
  764|       |            }
  765|       |#endif
  766|      0|        }
  767|      0|        break;
  768|       |
  769|      0|    case TLS_ST_PENDING_EARLY_DATA_END:
  ------------------
  |  Branch (769:5): [True: 0, False: 1.76k]
  ------------------
  770|       |        /*
  771|       |         * If we've been called by SSL_do_handshake()/SSL_write(), or we did not
  772|       |         * attempt to write early data before calling SSL_read() then we press
  773|       |         * on with the handshake. Otherwise we pause here.
  774|       |         */
  775|      0|        if (s->early_data_state == SSL_EARLY_DATA_FINISHED_WRITING
  ------------------
  |  Branch (775:13): [True: 0, False: 0]
  ------------------
  776|      0|            || s->early_data_state == SSL_EARLY_DATA_NONE)
  ------------------
  |  Branch (776:16): [True: 0, False: 0]
  ------------------
  777|      0|            return WORK_FINISHED_CONTINUE;
  778|       |        /* Fall through */
  779|       |
  780|      0|    case TLS_ST_EARLY_DATA:
  ------------------
  |  Branch (780:5): [True: 0, False: 1.76k]
  ------------------
  781|      0|        return tls_finish_handshake(s, wst, 0, 1);
  782|       |
  783|      0|    case TLS_ST_OK:
  ------------------
  |  Branch (783:5): [True: 0, False: 1.76k]
  ------------------
  784|       |        /* Calls SSLfatal() as required */
  785|      0|        return tls_finish_handshake(s, wst, 1, 1);
  786|  1.76k|    }
  787|       |
  788|  1.76k|    return WORK_FINISHED_CONTINUE;
  789|  1.76k|}
ossl_statem_client_post_work:
  796|  1.64k|{
  797|  1.64k|    OSSL_STATEM *st = &s->statem;
  798|  1.64k|    SSL *ssl = SSL_CONNECTION_GET_SSL(s);
  ------------------
  |  |   27|  1.64k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
  799|       |
  800|  1.64k|    s->init_num = 0;
  801|       |
  802|  1.64k|    switch (st->hand_state) {
  803|      0|    default:
  ------------------
  |  Branch (803:5): [True: 0, False: 1.64k]
  ------------------
  804|       |        /* No post work to be done */
  805|      0|        break;
  806|       |
  807|  1.64k|    case TLS_ST_CW_CLNT_HELLO:
  ------------------
  |  Branch (807:5): [True: 1.64k, False: 0]
  ------------------
  808|  1.64k|        if (s->early_data_state == SSL_EARLY_DATA_CONNECTING
  ------------------
  |  Branch (808:13): [True: 0, False: 1.64k]
  ------------------
  809|      0|            && s->max_early_data > 0) {
  ------------------
  |  Branch (809:16): [True: 0, False: 0]
  ------------------
  810|       |            /*
  811|       |             * We haven't selected TLSv1.3 yet so we don't call the change
  812|       |             * cipher state function associated with the SSL_METHOD. Instead
  813|       |             * we call tls13_change_cipher_state() directly.
  814|       |             */
  815|      0|            if ((s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) == 0) {
  ------------------
  |  |  403|      0|#define SSL_OP_ENABLE_MIDDLEBOX_COMPAT SSL_OP_BIT(20)
  |  |  ------------------
  |  |  |  |  350|      0|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (815:17): [True: 0, False: 0]
  ------------------
  816|      0|                if (!tls13_change_cipher_state(s,
  ------------------
  |  Branch (816:21): [True: 0, False: 0]
  ------------------
  817|      0|                        SSL3_CC_EARLY | SSL3_CHANGE_CIPHER_CLIENT_WRITE)) {
  ------------------
  |  |  346|      0|#define SSL3_CC_EARLY 0x040
  ------------------
                                      SSL3_CC_EARLY | SSL3_CHANGE_CIPHER_CLIENT_WRITE)) {
  ------------------
  |  |  349|      0|#define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT | SSL3_CC_WRITE)
  |  |  ------------------
  |  |  |  |  344|      0|#define SSL3_CC_CLIENT 0x010
  |  |  ------------------
  |  |               #define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT | SSL3_CC_WRITE)
  |  |  ------------------
  |  |  |  |  343|      0|#define SSL3_CC_WRITE 0x002
  |  |  ------------------
  ------------------
  818|       |                    /* SSLfatal() already called */
  819|      0|                    return WORK_ERROR;
  820|      0|                }
  821|      0|            }
  822|       |            /* else we're in compat mode so we delay flushing until after CCS */
  823|  1.64k|        } else if (!statem_flush(s)) {
  ------------------
  |  Branch (823:20): [True: 0, False: 1.64k]
  ------------------
  824|      0|            return WORK_MORE_A;
  825|      0|        }
  826|       |
  827|  1.64k|        if (SSL_CONNECTION_IS_DTLS(s)) {
  ------------------
  |  |  258|  1.64k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  1.64k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  1.64k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 1.64k]
  |  |  ------------------
  ------------------
  828|       |            /* Treat the next message as the first packet */
  829|      0|            s->first_packet = 1;
  830|      0|        }
  831|  1.64k|        break;
  832|       |
  833|      0|    case TLS_ST_CW_KEY_EXCH:
  ------------------
  |  Branch (833:5): [True: 0, False: 1.64k]
  ------------------
  834|      0|        if (tls_client_key_exchange_post_work(s) == 0) {
  ------------------
  |  Branch (834:13): [True: 0, False: 0]
  ------------------
  835|       |            /* SSLfatal() already called */
  836|      0|            return WORK_ERROR;
  837|      0|        }
  838|      0|        break;
  839|       |
  840|      0|    case TLS_ST_CW_CHANGE:
  ------------------
  |  Branch (840:5): [True: 0, False: 1.64k]
  ------------------
  841|      0|        if (SSL_CONNECTION_IS_TLS13(s)
  ------------------
  |  |  265|      0|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 0, False: 0]
  |  |  ------------------
  |  |  266|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  267|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|      0|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  842|      0|            || s->hello_retry_request == SSL_HRR_PENDING)
  ------------------
  |  Branch (842:16): [True: 0, False: 0]
  ------------------
  843|      0|            break;
  844|      0|        if (s->early_data_state == SSL_EARLY_DATA_CONNECTING
  ------------------
  |  Branch (844:13): [True: 0, False: 0]
  ------------------
  845|      0|            && s->max_early_data > 0) {
  ------------------
  |  Branch (845:16): [True: 0, False: 0]
  ------------------
  846|       |            /*
  847|       |             * We haven't selected TLSv1.3 yet so we don't call the change
  848|       |             * cipher state function associated with the SSL_METHOD. Instead
  849|       |             * we call tls13_change_cipher_state() directly.
  850|       |             */
  851|      0|            if (!tls13_change_cipher_state(s,
  ------------------
  |  Branch (851:17): [True: 0, False: 0]
  ------------------
  852|      0|                    SSL3_CC_EARLY | SSL3_CHANGE_CIPHER_CLIENT_WRITE))
  ------------------
  |  |  346|      0|#define SSL3_CC_EARLY 0x040
  ------------------
                                  SSL3_CC_EARLY | SSL3_CHANGE_CIPHER_CLIENT_WRITE))
  ------------------
  |  |  349|      0|#define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT | SSL3_CC_WRITE)
  |  |  ------------------
  |  |  |  |  344|      0|#define SSL3_CC_CLIENT 0x010
  |  |  ------------------
  |  |               #define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT | SSL3_CC_WRITE)
  |  |  ------------------
  |  |  |  |  343|      0|#define SSL3_CC_WRITE 0x002
  |  |  ------------------
  ------------------
  853|      0|                return WORK_ERROR;
  854|      0|            break;
  855|      0|        }
  856|      0|        s->session->cipher = s->s3.tmp.new_cipher;
  857|       |#ifdef OPENSSL_NO_COMP
  858|       |        s->session->compress_meth = 0;
  859|       |#else
  860|      0|        if (s->s3.tmp.new_compression == NULL)
  ------------------
  |  Branch (860:13): [True: 0, False: 0]
  ------------------
  861|      0|            s->session->compress_meth = 0;
  862|      0|        else
  863|      0|            s->session->compress_meth = s->s3.tmp.new_compression->id;
  864|      0|#endif
  865|      0|        if (!ssl->method->ssl3_enc->setup_key_block(s)) {
  ------------------
  |  Branch (865:13): [True: 0, False: 0]
  ------------------
  866|       |            /* SSLfatal() already called */
  867|      0|            return WORK_ERROR;
  868|      0|        }
  869|       |
  870|      0|        if (!ssl->method->ssl3_enc->change_cipher_state(s,
  ------------------
  |  Branch (870:13): [True: 0, False: 0]
  ------------------
  871|      0|                SSL3_CHANGE_CIPHER_CLIENT_WRITE)) {
  ------------------
  |  |  349|      0|#define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT | SSL3_CC_WRITE)
  |  |  ------------------
  |  |  |  |  344|      0|#define SSL3_CC_CLIENT 0x010
  |  |  ------------------
  |  |               #define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT | SSL3_CC_WRITE)
  |  |  ------------------
  |  |  |  |  343|      0|#define SSL3_CC_WRITE 0x002
  |  |  ------------------
  ------------------
  872|       |            /* SSLfatal() already called */
  873|      0|            return WORK_ERROR;
  874|      0|        }
  875|       |
  876|       |#ifndef OPENSSL_NO_SCTP
  877|       |        if (SSL_CONNECTION_IS_DTLS(s) && s->hit) {
  878|       |            /*
  879|       |             * Change to new shared key of SCTP-Auth, will be ignored if
  880|       |             * no SCTP used.
  881|       |             */
  882|       |            BIO_ctrl(SSL_get_wbio(ssl), BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY,
  883|       |                0, NULL);
  884|       |        }
  885|       |#endif
  886|      0|        break;
  887|       |
  888|      0|    case TLS_ST_CW_FINISHED:
  ------------------
  |  Branch (888:5): [True: 0, False: 1.64k]
  ------------------
  889|       |#ifndef OPENSSL_NO_SCTP
  890|       |        if (wst == WORK_MORE_A && SSL_CONNECTION_IS_DTLS(s) && s->hit == 0) {
  891|       |            /*
  892|       |             * Change to new shared key of SCTP-Auth, will be ignored if
  893|       |             * no SCTP used.
  894|       |             */
  895|       |            BIO_ctrl(SSL_get_wbio(ssl), BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY,
  896|       |                0, NULL);
  897|       |        }
  898|       |#endif
  899|      0|        if (statem_flush(s) != 1)
  ------------------
  |  Branch (899:13): [True: 0, False: 0]
  ------------------
  900|      0|            return WORK_MORE_B;
  901|       |
  902|      0|        if (SSL_CONNECTION_IS_TLS13(s)) {
  ------------------
  |  |  265|      0|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 0, False: 0]
  |  |  ------------------
  |  |  266|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  267|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|      0|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  903|      0|            if (!tls13_save_handshake_digest_for_pha(s)) {
  ------------------
  |  Branch (903:17): [True: 0, False: 0]
  ------------------
  904|       |                /* SSLfatal() already called */
  905|      0|                return WORK_ERROR;
  906|      0|            }
  907|      0|            if (s->post_handshake_auth != SSL_PHA_REQUESTED) {
  ------------------
  |  Branch (907:17): [True: 0, False: 0]
  ------------------
  908|      0|                if (!ssl->method->ssl3_enc->change_cipher_state(s,
  ------------------
  |  Branch (908:21): [True: 0, False: 0]
  ------------------
  909|      0|                        SSL3_CC_APPLICATION | SSL3_CHANGE_CIPHER_CLIENT_WRITE)) {
  ------------------
  |  |  348|      0|#define SSL3_CC_APPLICATION 0x100
  ------------------
                                      SSL3_CC_APPLICATION | SSL3_CHANGE_CIPHER_CLIENT_WRITE)) {
  ------------------
  |  |  349|      0|#define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT | SSL3_CC_WRITE)
  |  |  ------------------
  |  |  |  |  344|      0|#define SSL3_CC_CLIENT 0x010
  |  |  ------------------
  |  |               #define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT | SSL3_CC_WRITE)
  |  |  ------------------
  |  |  |  |  343|      0|#define SSL3_CC_WRITE 0x002
  |  |  ------------------
  ------------------
  910|       |                    /* SSLfatal() already called */
  911|      0|                    return WORK_ERROR;
  912|      0|                }
  913|       |                /*
  914|       |                 * For QUIC we deferred setting up these keys until now so
  915|       |                 * that we can ensure write keys are always set up before read
  916|       |                 * keys.
  917|       |                 */
  918|      0|                if (SSL_IS_QUIC_HANDSHAKE(s)
  ------------------
  |  |  303|      0|#define SSL_IS_QUIC_HANDSHAKE(s) (((s)->s3.flags & TLS1_FLAGS_QUIC) != 0)
  |  |  ------------------
  |  |  |  |   29|      0|#define TLS1_FLAGS_QUIC 0x2000
  |  |  ------------------
  |  |  |  Branch (303:34): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  919|      0|                    && !ssl->method->ssl3_enc->change_cipher_state(s,
  ------------------
  |  Branch (919:24): [True: 0, False: 0]
  ------------------
  920|      0|                        SSL3_CC_APPLICATION | SSL3_CHANGE_CIPHER_CLIENT_READ)) {
  ------------------
  |  |  348|      0|#define SSL3_CC_APPLICATION 0x100
  ------------------
                                      SSL3_CC_APPLICATION | SSL3_CHANGE_CIPHER_CLIENT_READ)) {
  ------------------
  |  |  351|      0|#define SSL3_CHANGE_CIPHER_CLIENT_READ (SSL3_CC_CLIENT | SSL3_CC_READ)
  |  |  ------------------
  |  |  |  |  344|      0|#define SSL3_CC_CLIENT 0x010
  |  |  ------------------
  |  |               #define SSL3_CHANGE_CIPHER_CLIENT_READ (SSL3_CC_CLIENT | SSL3_CC_READ)
  |  |  ------------------
  |  |  |  |  342|      0|#define SSL3_CC_READ 0x001
  |  |  ------------------
  ------------------
  921|       |                    /* SSLfatal() already called */
  922|      0|                    return WORK_ERROR;
  923|      0|                }
  924|      0|            }
  925|      0|        }
  926|      0|        break;
  927|       |
  928|      0|    case TLS_ST_CW_KEY_UPDATE:
  ------------------
  |  Branch (928:5): [True: 0, False: 1.64k]
  ------------------
  929|      0|        if (statem_flush(s) != 1)
  ------------------
  |  Branch (929:13): [True: 0, False: 0]
  ------------------
  930|      0|            return WORK_MORE_A;
  931|      0|        if (!tls13_update_key(s, 1)) {
  ------------------
  |  Branch (931:13): [True: 0, False: 0]
  ------------------
  932|       |            /* SSLfatal() already called */
  933|      0|            return WORK_ERROR;
  934|      0|        }
  935|      0|        break;
  936|  1.64k|    }
  937|       |
  938|  1.64k|    return WORK_FINISHED_CONTINUE;
  939|  1.64k|}
ossl_statem_client_construct_message:
  951|  1.76k|{
  952|  1.76k|    OSSL_STATEM *st = &s->statem;
  953|       |
  954|  1.76k|    switch (st->hand_state) {
  955|      0|    default:
  ------------------
  |  Branch (955:5): [True: 0, False: 1.76k]
  ------------------
  956|       |        /* Shouldn't happen */
  957|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_BAD_HANDSHAKE_STATE);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  958|      0|        return 0;
  959|       |
  960|      0|    case TLS_ST_CW_CHANGE:
  ------------------
  |  Branch (960:5): [True: 0, False: 1.76k]
  ------------------
  961|      0|        if (SSL_CONNECTION_IS_DTLS(s))
  ------------------
  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  962|      0|            *confunc = dtls_construct_change_cipher_spec;
  963|      0|        else
  964|      0|            *confunc = tls_construct_change_cipher_spec;
  965|      0|        *mt = SSL3_MT_CHANGE_CIPHER_SPEC;
  ------------------
  |  |  337|      0|#define SSL3_MT_CHANGE_CIPHER_SPEC 0x0101
  ------------------
  966|      0|        break;
  967|       |
  968|  1.76k|    case TLS_ST_CW_CLNT_HELLO:
  ------------------
  |  Branch (968:5): [True: 1.76k, False: 0]
  ------------------
  969|  1.76k|        *confunc = tls_construct_client_hello;
  970|  1.76k|        *mt = SSL3_MT_CLIENT_HELLO;
  ------------------
  |  |  313|  1.76k|#define SSL3_MT_CLIENT_HELLO 1
  ------------------
  971|  1.76k|        break;
  972|       |
  973|      0|    case TLS_ST_CW_END_OF_EARLY_DATA:
  ------------------
  |  Branch (973:5): [True: 0, False: 1.76k]
  ------------------
  974|      0|        *confunc = tls_construct_end_of_early_data;
  975|      0|        *mt = SSL3_MT_END_OF_EARLY_DATA;
  ------------------
  |  |  316|      0|#define SSL3_MT_END_OF_EARLY_DATA 5
  ------------------
  976|      0|        break;
  977|       |
  978|      0|    case TLS_ST_PENDING_EARLY_DATA_END:
  ------------------
  |  Branch (978:5): [True: 0, False: 1.76k]
  ------------------
  979|      0|        *confunc = NULL;
  980|      0|        *mt = SSL3_MT_DUMMY;
  ------------------
  |  |   41|      0|#define SSL3_MT_DUMMY -1
  ------------------
  981|      0|        break;
  982|       |
  983|      0|    case TLS_ST_CW_CERT:
  ------------------
  |  Branch (983:5): [True: 0, False: 1.76k]
  ------------------
  984|      0|        *confunc = tls_construct_client_certificate;
  985|      0|        *mt = SSL3_MT_CERTIFICATE;
  ------------------
  |  |  318|      0|#define SSL3_MT_CERTIFICATE 11
  ------------------
  986|      0|        break;
  987|       |
  988|       |#ifndef OPENSSL_NO_COMP_ALG
  989|       |    case TLS_ST_CW_COMP_CERT:
  990|       |        *confunc = tls_construct_client_compressed_certificate;
  991|       |        *mt = SSL3_MT_COMPRESSED_CERTIFICATE;
  992|       |        break;
  993|       |#endif
  994|       |
  995|      0|    case TLS_ST_CW_KEY_EXCH:
  ------------------
  |  Branch (995:5): [True: 0, False: 1.76k]
  ------------------
  996|      0|        *confunc = tls_construct_client_key_exchange;
  997|      0|        *mt = SSL3_MT_CLIENT_KEY_EXCHANGE;
  ------------------
  |  |  323|      0|#define SSL3_MT_CLIENT_KEY_EXCHANGE 16
  ------------------
  998|      0|        break;
  999|       |
 1000|      0|    case TLS_ST_CW_CERT_VRFY:
  ------------------
  |  Branch (1000:5): [True: 0, False: 1.76k]
  ------------------
 1001|      0|        *confunc = tls_construct_cert_verify;
 1002|      0|        *mt = SSL3_MT_CERTIFICATE_VERIFY;
  ------------------
  |  |  322|      0|#define SSL3_MT_CERTIFICATE_VERIFY 15
  ------------------
 1003|      0|        break;
 1004|       |
 1005|      0|#if !defined(OPENSSL_NO_NEXTPROTONEG)
 1006|      0|    case TLS_ST_CW_NEXT_PROTO:
  ------------------
  |  Branch (1006:5): [True: 0, False: 1.76k]
  ------------------
 1007|      0|        *confunc = tls_construct_next_proto;
 1008|      0|        *mt = SSL3_MT_NEXT_PROTO;
  ------------------
  |  |  331|      0|#define SSL3_MT_NEXT_PROTO 67
  ------------------
 1009|      0|        break;
 1010|      0|#endif
 1011|      0|    case TLS_ST_CW_FINISHED:
  ------------------
  |  Branch (1011:5): [True: 0, False: 1.76k]
  ------------------
 1012|      0|        *confunc = tls_construct_finished;
 1013|      0|        *mt = SSL3_MT_FINISHED;
  ------------------
  |  |  324|      0|#define SSL3_MT_FINISHED 20
  ------------------
 1014|      0|        break;
 1015|       |
 1016|      0|    case TLS_ST_CW_KEY_UPDATE:
  ------------------
  |  Branch (1016:5): [True: 0, False: 1.76k]
  ------------------
 1017|      0|        *confunc = tls_construct_key_update;
 1018|      0|        *mt = SSL3_MT_KEY_UPDATE;
  ------------------
  |  |  328|      0|#define SSL3_MT_KEY_UPDATE 24
  ------------------
 1019|      0|        break;
 1020|  1.76k|    }
 1021|       |
 1022|  1.76k|    return 1;
 1023|  1.76k|}
ossl_statem_client_max_message_size:
 1030|    202|{
 1031|    202|    OSSL_STATEM *st = &s->statem;
 1032|       |
 1033|    202|    switch (st->hand_state) {
 1034|      0|    default:
  ------------------
  |  Branch (1034:5): [True: 0, False: 202]
  ------------------
 1035|       |        /* Shouldn't happen */
 1036|      0|        return 0;
 1037|       |
 1038|    202|    case TLS_ST_CR_SRVR_HELLO:
  ------------------
  |  Branch (1038:5): [True: 202, False: 0]
  ------------------
 1039|    202|        return SERVER_HELLO_MAX_LENGTH;
  ------------------
  |  |   32|    202|#define SERVER_HELLO_MAX_LENGTH 65607
  ------------------
 1040|       |
 1041|      0|    case DTLS_ST_CR_HELLO_VERIFY_REQUEST:
  ------------------
  |  Branch (1041:5): [True: 0, False: 202]
  ------------------
 1042|      0|        return HELLO_VERIFY_REQUEST_MAX_LENGTH;
  ------------------
  |  |   20|      0|#define HELLO_VERIFY_REQUEST_MAX_LENGTH 258
  ------------------
 1043|       |
 1044|      0|    case TLS_ST_CR_COMP_CERT:
  ------------------
  |  Branch (1044:5): [True: 0, False: 202]
  ------------------
 1045|      0|    case TLS_ST_CR_CERT:
  ------------------
  |  Branch (1045:5): [True: 0, False: 202]
  ------------------
 1046|      0|        return s->max_cert_list;
 1047|       |
 1048|      0|    case TLS_ST_CR_CERT_VRFY:
  ------------------
  |  Branch (1048:5): [True: 0, False: 202]
  ------------------
 1049|      0|        return CERTIFICATE_VERIFY_MAX_LENGTH;
  ------------------
  |  |   35|      0|#define CERTIFICATE_VERIFY_MAX_LENGTH 65539
  ------------------
 1050|       |
 1051|      0|    case TLS_ST_CR_CERT_STATUS:
  ------------------
  |  Branch (1051:5): [True: 0, False: 202]
  ------------------
 1052|      0|        return SSL3_RT_MAX_PLAIN_LENGTH;
  ------------------
  |  |  177|      0|#define SSL3_RT_MAX_PLAIN_LENGTH 16384
  ------------------
 1053|       |
 1054|      0|    case TLS_ST_CR_KEY_EXCH:
  ------------------
  |  Branch (1054:5): [True: 0, False: 202]
  ------------------
 1055|      0|        return SERVER_KEY_EXCH_MAX_LENGTH;
  ------------------
  |  |   26|      0|#define SERVER_KEY_EXCH_MAX_LENGTH 102400
  ------------------
 1056|       |
 1057|      0|    case TLS_ST_CR_CERT_REQ:
  ------------------
  |  Branch (1057:5): [True: 0, False: 202]
  ------------------
 1058|       |        /*
 1059|       |         * Set to s->max_cert_list for compatibility with previous releases. In
 1060|       |         * practice these messages can get quite long if servers are configured
 1061|       |         * to provide a long list of acceptable CAs
 1062|       |         */
 1063|      0|        return s->max_cert_list;
 1064|       |
 1065|      0|    case TLS_ST_CR_SRVR_DONE:
  ------------------
  |  Branch (1065:5): [True: 0, False: 202]
  ------------------
 1066|      0|        return SERVER_HELLO_DONE_MAX_LENGTH;
  ------------------
  |  |   27|      0|#define SERVER_HELLO_DONE_MAX_LENGTH 0
  ------------------
 1067|       |
 1068|      0|    case TLS_ST_CR_CHANGE:
  ------------------
  |  Branch (1068:5): [True: 0, False: 202]
  ------------------
 1069|      0|        if (s->version == DTLS1_BAD_VER)
  ------------------
  |  |   30|      0|#define DTLS1_BAD_VER 0x0100
  ------------------
  |  Branch (1069:13): [True: 0, False: 0]
  ------------------
 1070|      0|            return 3;
 1071|      0|        return CCS_MAX_LENGTH;
  ------------------
  |  |   29|      0|#define CCS_MAX_LENGTH 1
  ------------------
 1072|       |
 1073|      0|    case TLS_ST_CR_SESSION_TICKET:
  ------------------
  |  Branch (1073:5): [True: 0, False: 202]
  ------------------
 1074|      0|        return (SSL_CONNECTION_IS_TLS13(s)) ? SESSION_TICKET_MAX_LENGTH_TLS13
  ------------------
  |  |  265|      0|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 0, False: 0]
  |  |  ------------------
  |  |  266|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  267|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|      0|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                      return (SSL_CONNECTION_IS_TLS13(s)) ? SESSION_TICKET_MAX_LENGTH_TLS13
  ------------------
  |  |   24|      0|#define SESSION_TICKET_MAX_LENGTH_TLS13 131338
  ------------------
 1075|      0|                                            : SESSION_TICKET_MAX_LENGTH_TLS12;
  ------------------
  |  |   25|      0|#define SESSION_TICKET_MAX_LENGTH_TLS12 65541
  ------------------
 1076|       |
 1077|      0|    case TLS_ST_CR_FINISHED:
  ------------------
  |  Branch (1077:5): [True: 0, False: 202]
  ------------------
 1078|      0|        return FINISHED_MAX_LENGTH;
  ------------------
  |  |   38|      0|#define FINISHED_MAX_LENGTH 64
  ------------------
 1079|       |
 1080|      0|    case TLS_ST_CR_ENCRYPTED_EXTENSIONS:
  ------------------
  |  Branch (1080:5): [True: 0, False: 202]
  ------------------
 1081|      0|        return ENCRYPTED_EXTENSIONS_MAX_LENGTH;
  ------------------
  |  |   23|      0|#define ENCRYPTED_EXTENSIONS_MAX_LENGTH 20000
  ------------------
 1082|       |
 1083|      0|    case TLS_ST_CR_KEY_UPDATE:
  ------------------
  |  Branch (1083:5): [True: 0, False: 202]
  ------------------
 1084|      0|        return KEY_UPDATE_MAX_LENGTH;
  ------------------
  |  |   28|      0|#define KEY_UPDATE_MAX_LENGTH 1
  ------------------
 1085|    202|    }
 1086|    202|}
ossl_statem_client_process_message:
 1093|    150|{
 1094|    150|    OSSL_STATEM *st = &s->statem;
 1095|       |
 1096|    150|    switch (st->hand_state) {
 1097|      0|    default:
  ------------------
  |  Branch (1097:5): [True: 0, False: 150]
  ------------------
 1098|       |        /* Shouldn't happen */
 1099|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1100|      0|        return MSG_PROCESS_ERROR;
 1101|       |
 1102|    150|    case TLS_ST_CR_SRVR_HELLO:
  ------------------
  |  Branch (1102:5): [True: 150, False: 0]
  ------------------
 1103|    150|        return tls_process_server_hello(s, pkt);
 1104|       |
 1105|      0|    case DTLS_ST_CR_HELLO_VERIFY_REQUEST:
  ------------------
  |  Branch (1105:5): [True: 0, False: 150]
  ------------------
 1106|      0|        return dtls_process_hello_verify(s, pkt);
 1107|       |
 1108|      0|    case TLS_ST_CR_CERT:
  ------------------
  |  Branch (1108:5): [True: 0, False: 150]
  ------------------
 1109|      0|        return tls_process_server_certificate(s, pkt);
 1110|       |
 1111|       |#ifndef OPENSSL_NO_COMP_ALG
 1112|       |    case TLS_ST_CR_COMP_CERT:
 1113|       |        return tls_process_server_compressed_certificate(s, pkt);
 1114|       |#endif
 1115|       |
 1116|      0|    case TLS_ST_CR_CERT_VRFY:
  ------------------
  |  Branch (1116:5): [True: 0, False: 150]
  ------------------
 1117|      0|        return tls_process_cert_verify(s, pkt);
 1118|       |
 1119|      0|    case TLS_ST_CR_CERT_STATUS:
  ------------------
  |  Branch (1119:5): [True: 0, False: 150]
  ------------------
 1120|      0|        return tls_process_cert_status(s, pkt);
 1121|       |
 1122|      0|    case TLS_ST_CR_KEY_EXCH:
  ------------------
  |  Branch (1122:5): [True: 0, False: 150]
  ------------------
 1123|      0|        return tls_process_key_exchange(s, pkt);
 1124|       |
 1125|      0|    case TLS_ST_CR_CERT_REQ:
  ------------------
  |  Branch (1125:5): [True: 0, False: 150]
  ------------------
 1126|      0|        return tls_process_certificate_request(s, pkt);
 1127|       |
 1128|      0|    case TLS_ST_CR_SRVR_DONE:
  ------------------
  |  Branch (1128:5): [True: 0, False: 150]
  ------------------
 1129|      0|        return tls_process_server_done(s, pkt);
 1130|       |
 1131|      0|    case TLS_ST_CR_CHANGE:
  ------------------
  |  Branch (1131:5): [True: 0, False: 150]
  ------------------
 1132|      0|        return tls_process_change_cipher_spec(s, pkt);
 1133|       |
 1134|      0|    case TLS_ST_CR_SESSION_TICKET:
  ------------------
  |  Branch (1134:5): [True: 0, False: 150]
  ------------------
 1135|      0|        return tls_process_new_session_ticket(s, pkt);
 1136|       |
 1137|      0|    case TLS_ST_CR_FINISHED:
  ------------------
  |  Branch (1137:5): [True: 0, False: 150]
  ------------------
 1138|      0|        return tls_process_finished(s, pkt);
 1139|       |
 1140|      0|    case TLS_ST_CR_HELLO_REQ:
  ------------------
  |  Branch (1140:5): [True: 0, False: 150]
  ------------------
 1141|      0|        return tls_process_hello_req(s, pkt);
 1142|       |
 1143|      0|    case TLS_ST_CR_ENCRYPTED_EXTENSIONS:
  ------------------
  |  Branch (1143:5): [True: 0, False: 150]
  ------------------
 1144|      0|        return tls_process_encrypted_extensions(s, pkt);
 1145|       |
 1146|      0|    case TLS_ST_CR_KEY_UPDATE:
  ------------------
  |  Branch (1146:5): [True: 0, False: 150]
  ------------------
 1147|      0|        return tls_process_key_update(s, pkt);
 1148|    150|    }
 1149|    150|}
tls_construct_client_hello:
 1177|  1.76k|{
 1178|  1.76k|    unsigned char *p;
 1179|  1.76k|    size_t sess_id_len;
 1180|  1.76k|    int i, protverr;
 1181|  1.76k|#ifndef OPENSSL_NO_COMP
 1182|  1.76k|    SSL_COMP *comp;
 1183|  1.76k|#endif
 1184|  1.76k|    SSL_SESSION *sess = s->session;
 1185|  1.76k|    unsigned char *session_id;
 1186|  1.76k|    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
  ------------------
  |  |   26|  1.76k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
 1187|       |
 1188|       |    /* Work out what SSL/TLS/DTLS version to use */
 1189|  1.76k|    protverr = ssl_set_client_hello_version(s);
 1190|  1.76k|    if (protverr != 0) {
  ------------------
  |  Branch (1190:9): [True: 0, False: 1.76k]
  ------------------
 1191|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, protverr);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1192|      0|        return CON_FUNC_ERROR;
 1193|      0|    }
 1194|       |
 1195|  1.76k|    if (sess == NULL
  ------------------
  |  Branch (1195:9): [True: 1.76k, False: 0]
  ------------------
 1196|      0|        || !ssl_version_supported(s, sess->ssl_version, NULL)
  ------------------
  |  Branch (1196:12): [True: 0, False: 0]
  ------------------
 1197|  1.76k|        || !SSL_SESSION_is_resumable(sess)) {
  ------------------
  |  Branch (1197:12): [True: 0, False: 0]
  ------------------
 1198|  1.76k|        if (s->hello_retry_request == SSL_HRR_NONE
  ------------------
  |  Branch (1198:13): [True: 1.76k, False: 0]
  ------------------
 1199|  1.76k|            && !ssl_get_new_session(s, 0)) {
  ------------------
  |  Branch (1199:16): [True: 0, False: 1.76k]
  ------------------
 1200|       |            /* SSLfatal() already called */
 1201|      0|            return CON_FUNC_ERROR;
 1202|      0|        }
 1203|  1.76k|    }
 1204|       |    /* else use the pre-loaded session */
 1205|       |
 1206|  1.76k|    p = s->s3.client_random;
 1207|       |
 1208|       |    /*
 1209|       |     * for DTLS if client_random is initialized, reuse it, we are
 1210|       |     * required to use same upon reply to HelloVerify
 1211|       |     */
 1212|  1.76k|    if (SSL_CONNECTION_IS_DTLS(s)) {
  ------------------
  |  |  258|  1.76k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  1.76k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  1.76k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 1.76k]
  |  |  ------------------
  ------------------
 1213|      0|        size_t idx;
 1214|      0|        i = 1;
 1215|      0|        for (idx = 0; idx < sizeof(s->s3.client_random); idx++) {
  ------------------
  |  Branch (1215:23): [True: 0, False: 0]
  ------------------
 1216|      0|            if (p[idx]) {
  ------------------
  |  Branch (1216:17): [True: 0, False: 0]
  ------------------
 1217|      0|                i = 0;
 1218|      0|                break;
 1219|      0|            }
 1220|      0|        }
 1221|  1.76k|    } else {
 1222|  1.76k|        i = (s->hello_retry_request == SSL_HRR_NONE);
 1223|  1.76k|    }
 1224|       |
 1225|  1.76k|    if (i && ssl_fill_hello_random(s, 0, p, sizeof(s->s3.client_random), DOWNGRADE_NONE) <= 0) {
  ------------------
  |  Branch (1225:9): [True: 1.76k, False: 0]
  |  Branch (1225:14): [True: 0, False: 1.76k]
  ------------------
 1226|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1227|      0|        return CON_FUNC_ERROR;
 1228|      0|    }
 1229|       |
 1230|       |    /*-
 1231|       |     * version indicates the negotiated version: for example from
 1232|       |     * an SSLv2/v3 compatible client hello). The client_version
 1233|       |     * field is the maximum version we permit and it is also
 1234|       |     * used in RSA encrypted premaster secrets. Some servers can
 1235|       |     * choke if we initially report a higher version then
 1236|       |     * renegotiate to a lower one in the premaster secret. This
 1237|       |     * didn't happen with TLS 1.0 as most servers supported it
 1238|       |     * but it can with TLS 1.1 or later if the server only supports
 1239|       |     * 1.0.
 1240|       |     *
 1241|       |     * Possible scenario with previous logic:
 1242|       |     *      1. Client hello indicates TLS 1.2
 1243|       |     *      2. Server hello says TLS 1.0
 1244|       |     *      3. RSA encrypted premaster secret uses 1.2.
 1245|       |     *      4. Handshake proceeds using TLS 1.0.
 1246|       |     *      5. Server sends hello request to renegotiate.
 1247|       |     *      6. Client hello indicates TLS v1.0 as we now
 1248|       |     *         know that is maximum server supports.
 1249|       |     *      7. Server chokes on RSA encrypted premaster secret
 1250|       |     *         containing version 1.0.
 1251|       |     *
 1252|       |     * For interoperability it should be OK to always use the
 1253|       |     * maximum version we support in client hello and then rely
 1254|       |     * on the checking of version to ensure the servers isn't
 1255|       |     * being inconsistent: for example initially negotiating with
 1256|       |     * TLS 1.0 and renegotiating with TLS 1.2. We do this by using
 1257|       |     * client_version in client hello and not resetting it to
 1258|       |     * the negotiated version.
 1259|       |     *
 1260|       |     * For TLS 1.3 we always set the ClientHello version to 1.2 and rely on the
 1261|       |     * supported_versions extension for the real supported versions.
 1262|       |     */
 1263|  1.76k|    if (!WPACKET_put_bytes_u16(pkt, s->client_version)
  ------------------
  |  |  891|  3.53k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (1263:9): [True: 0, False: 1.76k]
  ------------------
 1264|  1.76k|        || !WPACKET_memcpy(pkt, s->s3.client_random, SSL3_RANDOM_SIZE)) {
  ------------------
  |  |  137|  1.76k|#define SSL3_RANDOM_SIZE 32
  ------------------
  |  Branch (1264:12): [True: 0, False: 1.76k]
  ------------------
 1265|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1266|      0|        return CON_FUNC_ERROR;
 1267|      0|    }
 1268|       |
 1269|       |    /* Session ID */
 1270|  1.76k|    session_id = s->session->session_id;
 1271|  1.76k|    if (s->new_session || s->session->ssl_version == TLS1_3_VERSION) {
  ------------------
  |  |   27|  1.76k|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (1271:9): [True: 0, False: 1.76k]
  |  Branch (1271:27): [True: 1.75k, False: 14]
  ------------------
 1272|  1.75k|        if (s->version == TLS1_3_VERSION
  ------------------
  |  |   27|  3.50k|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (1272:13): [True: 1.75k, False: 0]
  ------------------
 1273|  1.75k|            && (s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) != 0) {
  ------------------
  |  |  403|  1.75k|#define SSL_OP_ENABLE_MIDDLEBOX_COMPAT SSL_OP_BIT(20)
  |  |  ------------------
  |  |  |  |  350|  1.75k|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (1273:16): [True: 1.75k, False: 0]
  ------------------
 1274|  1.75k|            sess_id_len = sizeof(s->tmp_session_id);
 1275|  1.75k|            s->tmp_session_id_len = sess_id_len;
 1276|  1.75k|            session_id = s->tmp_session_id;
 1277|  1.75k|            if (s->hello_retry_request == SSL_HRR_NONE
  ------------------
  |  Branch (1277:17): [True: 1.75k, False: 0]
  ------------------
 1278|  1.75k|                && RAND_bytes_ex(sctx->libctx, s->tmp_session_id,
  ------------------
  |  Branch (1278:20): [True: 0, False: 1.75k]
  ------------------
 1279|  1.75k|                       sess_id_len, 0)
 1280|  1.75k|                    <= 0) {
 1281|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1282|      0|                return CON_FUNC_ERROR;
 1283|      0|            }
 1284|  1.75k|        } else {
 1285|      0|            sess_id_len = 0;
 1286|      0|        }
 1287|  1.75k|    } else {
 1288|     14|        assert(s->session->session_id_length <= sizeof(s->session->session_id));
  ------------------
  |  Branch (1288:9): [True: 0, False: 14]
  |  Branch (1288:9): [True: 14, False: 0]
  ------------------
 1289|     14|        sess_id_len = s->session->session_id_length;
 1290|     14|        if (s->version == TLS1_3_VERSION) {
  ------------------
  |  |   27|     14|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (1290:13): [True: 0, False: 14]
  ------------------
 1291|      0|            s->tmp_session_id_len = sess_id_len;
 1292|      0|            memcpy(s->tmp_session_id, s->session->session_id, sess_id_len);
 1293|      0|        }
 1294|     14|    }
 1295|  1.76k|    if (!WPACKET_start_sub_packet_u8(pkt)
  ------------------
  |  |  790|  3.53k|    WPACKET_start_sub_packet_len__((pkt), 1)
  ------------------
  |  Branch (1295:9): [True: 0, False: 1.76k]
  ------------------
 1296|  1.76k|        || (sess_id_len != 0 && !WPACKET_memcpy(pkt, session_id, sess_id_len))
  ------------------
  |  Branch (1296:13): [True: 1.75k, False: 14]
  |  Branch (1296:33): [True: 0, False: 1.75k]
  ------------------
 1297|  1.76k|        || !WPACKET_close(pkt)) {
  ------------------
  |  Branch (1297:12): [True: 0, False: 1.76k]
  ------------------
 1298|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1299|      0|        return CON_FUNC_ERROR;
 1300|      0|    }
 1301|       |
 1302|       |    /* cookie stuff for DTLS */
 1303|  1.76k|    if (SSL_CONNECTION_IS_DTLS(s)) {
  ------------------
  |  |  258|  1.76k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  1.76k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  1.76k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 1.76k]
  |  |  ------------------
  ------------------
 1304|      0|        if (s->d1->cookie_len > sizeof(s->d1->cookie)
  ------------------
  |  Branch (1304:13): [True: 0, False: 0]
  ------------------
 1305|      0|            || !WPACKET_sub_memcpy_u8(pkt, s->d1->cookie,
  ------------------
  |  |  918|      0|    WPACKET_sub_memcpy__((pkt), (src), (len), 1)
  ------------------
  |  Branch (1305:16): [True: 0, False: 0]
  ------------------
 1306|      0|                s->d1->cookie_len)) {
 1307|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1308|      0|            return CON_FUNC_ERROR;
 1309|      0|        }
 1310|      0|    }
 1311|       |
 1312|       |    /* Ciphers supported */
 1313|  1.76k|    if (!WPACKET_start_sub_packet_u16(pkt)) {
  ------------------
  |  |  792|  1.76k|    WPACKET_start_sub_packet_len__((pkt), 2)
  ------------------
  |  Branch (1313:9): [True: 0, False: 1.76k]
  ------------------
 1314|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1315|      0|        return CON_FUNC_ERROR;
 1316|      0|    }
 1317|       |
 1318|  1.76k|    if (!ssl_cipher_list_to_bytes(s, SSL_get_ciphers(SSL_CONNECTION_GET_SSL(s)),
  ------------------
  |  |   27|  1.76k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
  |  Branch (1318:9): [True: 68, False: 1.69k]
  ------------------
 1319|  1.76k|            pkt)) {
 1320|       |        /* SSLfatal() already called */
 1321|     68|        return CON_FUNC_ERROR;
 1322|     68|    }
 1323|  1.69k|    if (!WPACKET_close(pkt)) {
  ------------------
  |  Branch (1323:9): [True: 0, False: 1.69k]
  ------------------
 1324|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1325|      0|        return CON_FUNC_ERROR;
 1326|      0|    }
 1327|       |
 1328|       |    /* COMPRESSION */
 1329|  1.69k|    if (!WPACKET_start_sub_packet_u8(pkt)) {
  ------------------
  |  |  790|  1.69k|    WPACKET_start_sub_packet_len__((pkt), 1)
  ------------------
  |  Branch (1329:9): [True: 0, False: 1.69k]
  ------------------
 1330|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1331|      0|        return CON_FUNC_ERROR;
 1332|      0|    }
 1333|  1.69k|#ifndef OPENSSL_NO_COMP
 1334|  1.69k|    if (ssl_allow_compression(s)
  ------------------
  |  Branch (1334:9): [True: 0, False: 1.69k]
  ------------------
 1335|      0|        && sctx->comp_methods
  ------------------
  |  Branch (1335:12): [True: 0, False: 0]
  ------------------
 1336|      0|        && (SSL_CONNECTION_IS_DTLS(s)
  ------------------
  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1337|      0|            || s->s3.tmp.max_ver < TLS1_3_VERSION)) {
  ------------------
  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (1337:16): [True: 0, False: 0]
  ------------------
 1338|      0|        int compnum = sk_SSL_COMP_num(sctx->comp_methods);
  ------------------
  |  |   70|      0|#define sk_SSL_COMP_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_COMP_sk_type(sk))
  ------------------
 1339|      0|        for (i = 0; i < compnum; i++) {
  ------------------
  |  Branch (1339:21): [True: 0, False: 0]
  ------------------
 1340|      0|            comp = sk_SSL_COMP_value(sctx->comp_methods, i);
  ------------------
  |  |   71|      0|#define sk_SSL_COMP_value(sk, idx) ((SSL_COMP *)OPENSSL_sk_value(ossl_check_const_SSL_COMP_sk_type(sk), (idx)))
  ------------------
 1341|      0|            if (!WPACKET_put_bytes_u8(pkt, comp->id)) {
  ------------------
  |  |  889|      0|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (1341:17): [True: 0, False: 0]
  ------------------
 1342|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1343|      0|                return CON_FUNC_ERROR;
 1344|      0|            }
 1345|      0|        }
 1346|      0|    }
 1347|  1.69k|#endif
 1348|       |    /* Add the NULL method */
 1349|  1.69k|    if (!WPACKET_put_bytes_u8(pkt, 0) || !WPACKET_close(pkt)) {
  ------------------
  |  |  889|  3.39k|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (1349:9): [True: 0, False: 1.69k]
  |  Branch (1349:42): [True: 0, False: 1.69k]
  ------------------
 1350|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1351|      0|        return CON_FUNC_ERROR;
 1352|      0|    }
 1353|       |
 1354|       |    /* TLS extensions */
 1355|  1.69k|    if (!tls_construct_extensions(s, pkt, SSL_EXT_CLIENT_HELLO, NULL, 0)) {
  ------------------
  |  |  299|  1.69k|#define SSL_EXT_CLIENT_HELLO 0x00080
  ------------------
  |  Branch (1355:9): [True: 55, False: 1.64k]
  ------------------
 1356|       |        /* SSLfatal() already called */
 1357|     55|        return CON_FUNC_ERROR;
 1358|     55|    }
 1359|       |
 1360|  1.64k|    return CON_FUNC_SUCCESS;
 1361|  1.69k|}
tls_process_server_hello:
 1468|    150|{
 1469|    150|    PACKET session_id, extpkt;
 1470|    150|    size_t session_id_len;
 1471|    150|    const unsigned char *cipherchars;
 1472|    150|    int hrr = 0;
 1473|    150|    unsigned int compression;
 1474|    150|    unsigned int sversion;
 1475|    150|    unsigned int context;
 1476|    150|    RAW_EXTENSION *extensions = NULL;
 1477|    150|    SSL *ssl = SSL_CONNECTION_GET_SSL(s);
  ------------------
  |  |   27|    150|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
 1478|    150|    SSL *ussl = SSL_CONNECTION_GET_USER_SSL(s);
  ------------------
  |  |   28|    150|#define SSL_CONNECTION_GET_USER_SSL(sc) ((sc)->user_ssl)
  ------------------
 1479|    150|#ifndef OPENSSL_NO_COMP
 1480|    150|    SSL_COMP *comp;
 1481|    150|#endif
 1482|       |
 1483|    150|    if (!PACKET_get_net_2(pkt, &sversion)) {
  ------------------
  |  Branch (1483:9): [True: 1, False: 149]
  ------------------
 1484|      1|        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
  ------------------
  |  |  148|      1|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      1|    (ERR_new(),                                                  \
  |  |  |  |  151|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      1|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1485|      1|        goto err;
 1486|      1|    }
 1487|       |
 1488|       |    /* load the server random */
 1489|    149|    if (s->version == TLS1_3_VERSION
  ------------------
  |  |   27|    298|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (1489:9): [True: 149, False: 0]
  ------------------
 1490|    149|        && sversion == TLS1_2_VERSION
  ------------------
  |  |   26|    298|#define TLS1_2_VERSION 0x0303
  ------------------
  |  Branch (1490:12): [True: 83, False: 66]
  ------------------
 1491|     83|        && PACKET_remaining(pkt) >= SSL3_RANDOM_SIZE
  ------------------
  |  |  137|    232|#define SSL3_RANDOM_SIZE 32
  ------------------
  |  Branch (1491:12): [True: 82, False: 1]
  ------------------
 1492|     82|        && memcmp(hrrrandom, PACKET_data(pkt), SSL3_RANDOM_SIZE) == 0) {
  ------------------
  |  |  137|     82|#define SSL3_RANDOM_SIZE 32
  ------------------
  |  Branch (1492:12): [True: 3, False: 79]
  ------------------
 1493|      3|        if (s->hello_retry_request != SSL_HRR_NONE) {
  ------------------
  |  Branch (1493:13): [True: 0, False: 3]
  ------------------
 1494|      0|            SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_R_UNEXPECTED_MESSAGE);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1495|      0|            goto err;
 1496|      0|        }
 1497|      3|        s->hello_retry_request = SSL_HRR_PENDING;
 1498|       |        /* Tell the record layer that we know we're going to get TLSv1.3 */
 1499|      3|        if (!ssl_set_record_protocol_version(s, s->version)) {
  ------------------
  |  Branch (1499:13): [True: 0, False: 3]
  ------------------
 1500|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1501|      0|            goto err;
 1502|      0|        }
 1503|      3|        hrr = 1;
 1504|      3|        if (!PACKET_forward(pkt, SSL3_RANDOM_SIZE)) {
  ------------------
  |  |  137|      3|#define SSL3_RANDOM_SIZE 32
  ------------------
  |  Branch (1504:13): [True: 0, False: 3]
  ------------------
 1505|      0|            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1506|      0|            goto err;
 1507|      0|        }
 1508|    146|    } else {
 1509|    146|        if (!PACKET_copy_bytes(pkt, s->s3.server_random, SSL3_RANDOM_SIZE)) {
  ------------------
  |  |  137|    146|#define SSL3_RANDOM_SIZE 32
  ------------------
  |  Branch (1509:13): [True: 2, False: 144]
  ------------------
 1510|      2|            SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
  ------------------
  |  |  148|      2|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      2|    (ERR_new(),                                                  \
  |  |  |  |  151|      2|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      2|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      2|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1511|      2|            goto err;
 1512|      2|        }
 1513|    146|    }
 1514|       |
 1515|       |    /* Get the session-id. */
 1516|    147|    if (!PACKET_get_length_prefixed_1(pkt, &session_id)) {
  ------------------
  |  Branch (1516:9): [True: 9, False: 138]
  ------------------
 1517|      9|        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
  ------------------
  |  |  148|      9|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      9|    (ERR_new(),                                                  \
  |  |  |  |  151|      9|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      9|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      9|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1518|      9|        goto err;
 1519|      9|    }
 1520|    138|    session_id_len = PACKET_remaining(&session_id);
 1521|    138|    if (session_id_len > sizeof(s->session->session_id)
  ------------------
  |  Branch (1521:9): [True: 2, False: 136]
  ------------------
 1522|    136|        || session_id_len > SSL3_SESSION_ID_SIZE) {
  ------------------
  |  |  138|    136|#define SSL3_SESSION_ID_SIZE 32
  ------------------
  |  Branch (1522:12): [True: 0, False: 136]
  ------------------
 1523|      2|        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_SSL3_SESSION_ID_TOO_LONG);
  ------------------
  |  |  148|      2|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      2|    (ERR_new(),                                                  \
  |  |  |  |  151|      2|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      2|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      2|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1524|      2|        goto err;
 1525|      2|    }
 1526|       |
 1527|    136|    if (!PACKET_get_bytes(pkt, &cipherchars, TLS_CIPHER_LEN)) {
  ------------------
  |  |  379|    136|#define TLS_CIPHER_LEN 2
  ------------------
  |  Branch (1527:9): [True: 1, False: 135]
  ------------------
 1528|      1|        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
  ------------------
  |  |  148|      1|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      1|    (ERR_new(),                                                  \
  |  |  |  |  151|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      1|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1529|      1|        goto err;
 1530|      1|    }
 1531|       |
 1532|    135|    if (!PACKET_get_1(pkt, &compression)) {
  ------------------
  |  Branch (1532:9): [True: 1, False: 134]
  ------------------
 1533|      1|        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_LENGTH_MISMATCH);
  ------------------
  |  |  148|      1|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      1|    (ERR_new(),                                                  \
  |  |  |  |  151|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      1|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1534|      1|        goto err;
 1535|      1|    }
 1536|       |
 1537|       |    /* TLS extensions */
 1538|    134|    if (PACKET_remaining(pkt) == 0 && !hrr) {
  ------------------
  |  Branch (1538:9): [True: 28, False: 106]
  |  Branch (1538:39): [True: 27, False: 1]
  ------------------
 1539|     27|        PACKET_null_init(&extpkt);
 1540|    107|    } else if (!PACKET_as_length_prefixed_2(pkt, &extpkt)
  ------------------
  |  Branch (1540:16): [True: 17, False: 90]
  ------------------
 1541|     90|        || PACKET_remaining(pkt) != 0) {
  ------------------
  |  Branch (1541:12): [True: 0, False: 90]
  ------------------
 1542|     17|        SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_R_BAD_LENGTH);
  ------------------
  |  |  148|     17|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|     17|    (ERR_new(),                                                  \
  |  |  |  |  151|     17|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|     17|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|     17|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1543|     17|        goto err;
 1544|     17|    }
 1545|       |
 1546|    117|    if (!hrr) {
  ------------------
  |  Branch (1546:9): [True: 115, False: 2]
  ------------------
 1547|    115|        if (!tls_collect_extensions(s, &extpkt,
  ------------------
  |  Branch (1547:13): [True: 41, False: 74]
  ------------------
 1548|    115|                SSL_EXT_TLS1_2_SERVER_HELLO
  ------------------
  |  |  301|    115|#define SSL_EXT_TLS1_2_SERVER_HELLO 0x00100
  ------------------
 1549|    115|                    | SSL_EXT_TLS1_3_SERVER_HELLO,
  ------------------
  |  |  302|    115|#define SSL_EXT_TLS1_3_SERVER_HELLO 0x00200
  ------------------
 1550|    115|                &extensions, NULL, 1)) {
 1551|       |            /* SSLfatal() already called */
 1552|     41|            goto err;
 1553|     41|        }
 1554|       |
 1555|     74|        if (!ssl_choose_client_version(s, sversion, extensions)) {
  ------------------
  |  Branch (1555:13): [True: 28, False: 46]
  ------------------
 1556|       |            /* SSLfatal() already called */
 1557|     28|            goto err;
 1558|     28|        }
 1559|     74|    }
 1560|       |
 1561|     48|    if (SSL_CONNECTION_IS_TLS13(s) || hrr) {
  ------------------
  |  |  265|     96|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|     96|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|     48|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|     48|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 48, False: 0]
  |  |  ------------------
  |  |  266|     48|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|     48|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|     96|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 7, False: 41]
  |  |  ------------------
  |  |  267|     96|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|      7|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|      7|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 5, False: 2]
  |  |  ------------------
  ------------------
  |  Branch (1561:39): [True: 2, False: 41]
  ------------------
 1562|      7|        if (compression != 0) {
  ------------------
  |  Branch (1562:13): [True: 1, False: 6]
  ------------------
 1563|      1|            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
  ------------------
  |  |  148|      1|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      1|    (ERR_new(),                                                  \
  |  |  |  |  151|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      1|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1564|      1|                SSL_R_INVALID_COMPRESSION_ALGORITHM);
 1565|      1|            goto err;
 1566|      1|        }
 1567|       |
 1568|      6|        if (session_id_len != s->tmp_session_id_len
  ------------------
  |  Branch (1568:13): [True: 1, False: 5]
  ------------------
 1569|      5|            || memcmp(PACKET_data(&session_id), s->tmp_session_id,
  ------------------
  |  Branch (1569:16): [True: 5, False: 0]
  ------------------
 1570|      5|                   session_id_len)
 1571|      6|                != 0) {
 1572|      6|            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_INVALID_SESSION_ID);
  ------------------
  |  |  148|      6|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      6|    (ERR_new(),                                                  \
  |  |  |  |  151|      6|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      6|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      6|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1573|      6|            goto err;
 1574|      6|        }
 1575|      6|    }
 1576|       |
 1577|     41|    if (hrr) {
  ------------------
  |  Branch (1577:9): [True: 0, False: 41]
  ------------------
 1578|      0|        if (!set_client_ciphersuite(s, cipherchars)) {
  ------------------
  |  Branch (1578:13): [True: 0, False: 0]
  ------------------
 1579|       |            /* SSLfatal() already called */
 1580|      0|            goto err;
 1581|      0|        }
 1582|       |
 1583|      0|        return tls_process_as_hello_retry_request(s, &extpkt);
 1584|      0|    }
 1585|       |
 1586|       |    /*
 1587|       |     * Now we have chosen the version we need to check again that the extensions
 1588|       |     * are appropriate for this version.
 1589|       |     */
 1590|     41|    context = SSL_CONNECTION_IS_TLS13(s) ? SSL_EXT_TLS1_3_SERVER_HELLO
  ------------------
  |  |  265|     41|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|     82|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|     41|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|     41|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 41, False: 0]
  |  |  ------------------
  |  |  266|     41|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|     41|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|     82|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 0, False: 41]
  |  |  ------------------
  |  |  267|     41|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|      0|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                  context = SSL_CONNECTION_IS_TLS13(s) ? SSL_EXT_TLS1_3_SERVER_HELLO
  ------------------
  |  |  302|      0|#define SSL_EXT_TLS1_3_SERVER_HELLO 0x00200
  ------------------
 1591|     41|                                         : SSL_EXT_TLS1_2_SERVER_HELLO;
  ------------------
  |  |  301|     82|#define SSL_EXT_TLS1_2_SERVER_HELLO 0x00100
  ------------------
 1592|     41|    if (!tls_validate_all_contexts(s, context, extensions)) {
  ------------------
  |  Branch (1592:9): [True: 1, False: 40]
  ------------------
 1593|      1|        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_EXTENSION);
  ------------------
  |  |  148|      1|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      1|    (ERR_new(),                                                  \
  |  |  |  |  151|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      1|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1594|      1|        goto err;
 1595|      1|    }
 1596|       |
 1597|     40|    s->hit = 0;
 1598|       |
 1599|     40|    if (SSL_CONNECTION_IS_TLS13(s)) {
  ------------------
  |  |  265|     40|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|     80|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|     40|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|     40|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 40, False: 0]
  |  |  ------------------
  |  |  266|     40|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|     40|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|     80|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 0, False: 40]
  |  |  ------------------
  |  |  267|     40|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|      0|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1600|       |        /*
 1601|       |         * In TLSv1.3 a ServerHello message signals a key change so the end of
 1602|       |         * the message must be on a record boundary.
 1603|       |         */
 1604|      0|        if (RECORD_LAYER_processed_read_pending(&s->rlayer)) {
  ------------------
  |  Branch (1604:13): [True: 0, False: 0]
  ------------------
 1605|      0|            SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE,
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1606|      0|                SSL_R_NOT_ON_RECORD_BOUNDARY);
 1607|      0|            goto err;
 1608|      0|        }
 1609|       |
 1610|       |        /* This will set s->hit if we are resuming */
 1611|      0|        if (!tls_parse_extension(s, TLSEXT_IDX_psk,
  ------------------
  |  Branch (1611:13): [True: 0, False: 0]
  ------------------
 1612|      0|                SSL_EXT_TLS1_3_SERVER_HELLO,
  ------------------
  |  |  302|      0|#define SSL_EXT_TLS1_3_SERVER_HELLO 0x00200
  ------------------
 1613|      0|                extensions, NULL, 0)) {
 1614|       |            /* SSLfatal() already called */
 1615|      0|            goto err;
 1616|      0|        }
 1617|     40|    } else {
 1618|       |        /*
 1619|       |         * Check if we can resume the session based on external pre-shared
 1620|       |         * secret. EAP-FAST (RFC 4851) supports two types of session resumption.
 1621|       |         * Resumption based on server-side state works with session IDs.
 1622|       |         * Resumption based on pre-shared Protected Access Credentials (PACs)
 1623|       |         * works by overriding the SessionTicket extension at the application
 1624|       |         * layer, and does not send a session ID. (We do not know whether
 1625|       |         * EAP-FAST servers would honour the session ID.) Therefore, the session
 1626|       |         * ID alone is not a reliable indicator of session resumption, so we
 1627|       |         * first check if we can resume, and later peek at the next handshake
 1628|       |         * message to see if the server wants to resume.
 1629|       |         */
 1630|     40|        if (s->version >= TLS1_VERSION
  ------------------
  |  |   24|     80|#define TLS1_VERSION 0x0301
  ------------------
  |  Branch (1630:13): [True: 40, False: 0]
  ------------------
 1631|     40|            && s->ext.session_secret_cb != NULL && s->session->ext.tick) {
  ------------------
  |  Branch (1631:16): [True: 0, False: 40]
  |  Branch (1631:52): [True: 0, False: 0]
  ------------------
 1632|      0|            const SSL_CIPHER *pref_cipher = NULL;
 1633|       |            /*
 1634|       |             * s->session->master_key_length is a size_t, but this is an int for
 1635|       |             * backwards compat reasons
 1636|       |             */
 1637|      0|            int master_key_length;
 1638|       |
 1639|      0|            master_key_length = sizeof(s->session->master_key);
 1640|      0|            if (s->ext.session_secret_cb(ussl, s->session->master_key,
  ------------------
  |  Branch (1640:17): [True: 0, False: 0]
  ------------------
 1641|      0|                    &master_key_length,
 1642|      0|                    NULL, &pref_cipher,
 1643|      0|                    s->ext.session_secret_cb_arg)
 1644|      0|                && master_key_length > 0) {
  ------------------
  |  Branch (1644:20): [True: 0, False: 0]
  ------------------
 1645|      0|                s->session->master_key_length = master_key_length;
 1646|      0|                s->session->cipher = pref_cipher ? pref_cipher : ssl_get_cipher_by_char(s, cipherchars, 0);
  ------------------
  |  Branch (1646:38): [True: 0, False: 0]
  ------------------
 1647|      0|            } else {
 1648|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1649|      0|                goto err;
 1650|      0|            }
 1651|      0|        }
 1652|       |
 1653|     40|        if (session_id_len != 0
  ------------------
  |  Branch (1653:13): [True: 38, False: 2]
  ------------------
 1654|     38|            && session_id_len == s->session->session_id_length
  ------------------
  |  Branch (1654:16): [True: 0, False: 38]
  ------------------
 1655|      0|            && memcmp(PACKET_data(&session_id), s->session->session_id,
  ------------------
  |  Branch (1655:16): [True: 0, False: 0]
  ------------------
 1656|      0|                   session_id_len)
 1657|      0|                == 0)
 1658|      0|            s->hit = 1;
 1659|     40|    }
 1660|       |
 1661|     40|    if (s->hit) {
  ------------------
  |  Branch (1661:9): [True: 0, False: 40]
  ------------------
 1662|      0|        if (s->sid_ctx_length != s->session->sid_ctx_length
  ------------------
  |  Branch (1662:13): [True: 0, False: 0]
  ------------------
 1663|      0|            || memcmp(s->session->sid_ctx, s->sid_ctx, s->sid_ctx_length)) {
  ------------------
  |  Branch (1663:16): [True: 0, False: 0]
  ------------------
 1664|       |            /* actually a client application bug */
 1665|      0|            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1666|      0|                SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT);
 1667|      0|            goto err;
 1668|      0|        }
 1669|     40|    } else {
 1670|       |        /*
 1671|       |         * If we were trying for session-id reuse but the server
 1672|       |         * didn't resume, make a new SSL_SESSION.
 1673|       |         * In the case of EAP-FAST and PAC, we do not send a session ID,
 1674|       |         * so the PAC-based session secret is always preserved. It'll be
 1675|       |         * overwritten if the server refuses resumption.
 1676|       |         */
 1677|     40|        if (s->session->session_id_length > 0) {
  ------------------
  |  Branch (1677:13): [True: 0, False: 40]
  ------------------
 1678|      0|            ssl_tsan_counter(s->session_ctx, &s->session_ctx->stats.sess_miss);
 1679|      0|            if (!ssl_get_new_session(s, 0)) {
  ------------------
  |  Branch (1679:17): [True: 0, False: 0]
  ------------------
 1680|       |                /* SSLfatal() already called */
 1681|      0|                goto err;
 1682|      0|            }
 1683|      0|        }
 1684|       |
 1685|     40|        s->session->ssl_version = s->version;
 1686|       |        /*
 1687|       |         * In TLSv1.2 and below we save the session id we were sent so we can
 1688|       |         * resume it later. In TLSv1.3 the session id we were sent is just an
 1689|       |         * echo of what we originally sent in the ClientHello and should not be
 1690|       |         * used for resumption.
 1691|       |         */
 1692|     40|        if (!SSL_CONNECTION_IS_TLS13(s)) {
  ------------------
  |  |  265|     40|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|     80|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|     40|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|     40|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 40, False: 0]
  |  |  ------------------
  |  |  266|     40|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|     40|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|     80|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 0, False: 40]
  |  |  ------------------
  |  |  267|     40|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|      0|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1693|     40|            s->session->session_id_length = session_id_len;
 1694|       |            /* session_id_len could be 0 */
 1695|     40|            if (session_id_len > 0)
  ------------------
  |  Branch (1695:17): [True: 38, False: 2]
  ------------------
 1696|     38|                memcpy(s->session->session_id, PACKET_data(&session_id),
 1697|     38|                    session_id_len);
 1698|     40|        }
 1699|     40|    }
 1700|       |
 1701|       |    /* Session version and negotiated protocol version should match */
 1702|     40|    if (s->version != s->session->ssl_version) {
  ------------------
  |  Branch (1702:9): [True: 0, False: 40]
  ------------------
 1703|      0|        SSLfatal(s, SSL_AD_PROTOCOL_VERSION,
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1704|      0|            SSL_R_SSL_SESSION_VERSION_MISMATCH);
 1705|      0|        goto err;
 1706|      0|    }
 1707|       |    /*
 1708|       |     * Now that we know the version, update the check to see if it's an allowed
 1709|       |     * version.
 1710|       |     */
 1711|     40|    s->s3.tmp.min_ver = s->version;
 1712|     40|    s->s3.tmp.max_ver = s->version;
 1713|       |
 1714|     40|    if (!set_client_ciphersuite(s, cipherchars)) {
  ------------------
  |  Branch (1714:9): [True: 23, False: 17]
  ------------------
 1715|       |        /* SSLfatal() already called */
 1716|     23|        goto err;
 1717|     23|    }
 1718|       |
 1719|       |#ifdef OPENSSL_NO_COMP
 1720|       |    if (compression != 0) {
 1721|       |        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
 1722|       |            SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM);
 1723|       |        goto err;
 1724|       |    }
 1725|       |    /*
 1726|       |     * If compression is disabled we'd better not try to resume a session
 1727|       |     * using compression.
 1728|       |     */
 1729|       |    if (s->session->compress_meth != 0) {
 1730|       |        SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE, SSL_R_INCONSISTENT_COMPRESSION);
 1731|       |        goto err;
 1732|       |    }
 1733|       |#else
 1734|     17|    if (s->hit && compression != s->session->compress_meth) {
  ------------------
  |  Branch (1734:9): [True: 0, False: 17]
  |  Branch (1734:19): [True: 0, False: 0]
  ------------------
 1735|      0|        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1736|      0|            SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED);
 1737|      0|        goto err;
 1738|      0|    }
 1739|     17|    if (compression == 0)
  ------------------
  |  Branch (1739:9): [True: 16, False: 1]
  ------------------
 1740|     16|        comp = NULL;
 1741|      1|    else if (!ssl_allow_compression(s)) {
  ------------------
  |  Branch (1741:14): [True: 1, False: 0]
  ------------------
 1742|      1|        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_COMPRESSION_DISABLED);
  ------------------
  |  |  148|      1|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      1|    (ERR_new(),                                                  \
  |  |  |  |  151|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      1|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1743|      1|        goto err;
 1744|      1|    } else {
 1745|      0|        comp = ssl3_comp_find(SSL_CONNECTION_GET_CTX(s)->comp_methods,
  ------------------
  |  |   26|      0|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
 1746|      0|            compression);
 1747|      0|    }
 1748|       |
 1749|     16|    if (compression != 0 && comp == NULL) {
  ------------------
  |  Branch (1749:9): [True: 0, False: 16]
  |  Branch (1749:29): [True: 0, False: 0]
  ------------------
 1750|      0|        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1751|      0|            SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM);
 1752|      0|        goto err;
 1753|     16|    } else {
 1754|     16|        s->s3.tmp.new_compression = comp;
 1755|     16|    }
 1756|     16|#endif
 1757|       |
 1758|     16|    if (!tls_parse_all_extensions(s, context, extensions, NULL, 0, 1)) {
  ------------------
  |  Branch (1758:9): [True: 16, False: 0]
  ------------------
 1759|       |        /* SSLfatal() already called */
 1760|     16|        goto err;
 1761|     16|    }
 1762|       |
 1763|       |#ifndef OPENSSL_NO_SCTP
 1764|       |    if (SSL_CONNECTION_IS_DTLS(s) && s->hit) {
 1765|       |        unsigned char sctpauthkey[64];
 1766|       |        char labelbuffer[sizeof(DTLS1_SCTP_AUTH_LABEL)];
 1767|       |        size_t labellen;
 1768|       |
 1769|       |        /*
 1770|       |         * Add new shared key for SCTP-Auth, will be ignored if
 1771|       |         * no SCTP used.
 1772|       |         */
 1773|       |        memcpy(labelbuffer, DTLS1_SCTP_AUTH_LABEL,
 1774|       |            sizeof(DTLS1_SCTP_AUTH_LABEL));
 1775|       |
 1776|       |        /* Don't include the terminating zero. */
 1777|       |        labellen = sizeof(labelbuffer) - 1;
 1778|       |        if (s->mode & SSL_MODE_DTLS_SCTP_LABEL_LENGTH_BUG)
 1779|       |            labellen += 1;
 1780|       |
 1781|       |        if (SSL_export_keying_material(ssl, sctpauthkey,
 1782|       |                sizeof(sctpauthkey),
 1783|       |                labelbuffer,
 1784|       |                labellen, NULL, 0, 0)
 1785|       |            <= 0) {
 1786|       |            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
 1787|       |            goto err;
 1788|       |        }
 1789|       |
 1790|       |        BIO_ctrl(SSL_get_wbio(ssl),
 1791|       |            BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY,
 1792|       |            sizeof(sctpauthkey), sctpauthkey);
 1793|       |    }
 1794|       |#endif
 1795|       |
 1796|       |    /*
 1797|       |     * In TLSv1.3 we have some post-processing to change cipher state, otherwise
 1798|       |     * we're done with this message
 1799|       |     */
 1800|      0|    if (SSL_CONNECTION_IS_TLS13(s)) {
  ------------------
  |  |  265|      0|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 0, False: 0]
  |  |  ------------------
  |  |  266|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  267|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|      0|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1801|      0|        if (!ssl->method->ssl3_enc->setup_key_block(s)
  ------------------
  |  Branch (1801:13): [True: 0, False: 0]
  ------------------
 1802|      0|            || !tls13_store_handshake_traffic_hash(s)) {
  ------------------
  |  Branch (1802:16): [True: 0, False: 0]
  ------------------
 1803|       |            /* SSLfatal() already called */
 1804|      0|            goto err;
 1805|      0|        }
 1806|       |        /*
 1807|       |         * If we're not doing early-data and we're not going to send a dummy CCS
 1808|       |         * (i.e. no middlebox compat mode) then we can change the write keys
 1809|       |         * immediately. Otherwise we have to defer this until after all possible
 1810|       |         * early data is written. We could just always defer until the last
 1811|       |         * moment except QUIC needs it done at the same time as the read keys
 1812|       |         * are changed. Since QUIC doesn't do TLS early data or need middlebox
 1813|       |         * compat this doesn't cause a problem.
 1814|       |         */
 1815|      0|        if (SSL_IS_QUIC_HANDSHAKE(s)
  ------------------
  |  |  303|      0|#define SSL_IS_QUIC_HANDSHAKE(s) (((s)->s3.flags & TLS1_FLAGS_QUIC) != 0)
  |  |  ------------------
  |  |  |  |   29|      0|#define TLS1_FLAGS_QUIC 0x2000
  |  |  ------------------
  |  |  |  Branch (303:34): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1816|      0|            || (s->early_data_state == SSL_EARLY_DATA_NONE
  ------------------
  |  Branch (1816:17): [True: 0, False: 0]
  ------------------
 1817|      0|                && (s->options & SSL_OP_ENABLE_MIDDLEBOX_COMPAT) == 0)) {
  ------------------
  |  |  403|      0|#define SSL_OP_ENABLE_MIDDLEBOX_COMPAT SSL_OP_BIT(20)
  |  |  ------------------
  |  |  |  |  350|      0|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (1817:20): [True: 0, False: 0]
  ------------------
 1818|      0|            if (!ssl->method->ssl3_enc->change_cipher_state(s,
  ------------------
  |  Branch (1818:17): [True: 0, False: 0]
  ------------------
 1819|      0|                    SSL3_CC_HANDSHAKE | SSL3_CHANGE_CIPHER_CLIENT_WRITE)) {
  ------------------
  |  |  347|      0|#define SSL3_CC_HANDSHAKE 0x080
  ------------------
                                  SSL3_CC_HANDSHAKE | SSL3_CHANGE_CIPHER_CLIENT_WRITE)) {
  ------------------
  |  |  349|      0|#define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT | SSL3_CC_WRITE)
  |  |  ------------------
  |  |  |  |  344|      0|#define SSL3_CC_CLIENT 0x010
  |  |  ------------------
  |  |               #define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT | SSL3_CC_WRITE)
  |  |  ------------------
  |  |  |  |  343|      0|#define SSL3_CC_WRITE 0x002
  |  |  ------------------
  ------------------
 1820|       |                /* SSLfatal() already called */
 1821|      0|                goto err;
 1822|      0|            }
 1823|      0|        }
 1824|      0|        if (!ssl->method->ssl3_enc->change_cipher_state(s,
  ------------------
  |  Branch (1824:13): [True: 0, False: 0]
  ------------------
 1825|      0|                SSL3_CC_HANDSHAKE | SSL3_CHANGE_CIPHER_CLIENT_READ)) {
  ------------------
  |  |  347|      0|#define SSL3_CC_HANDSHAKE 0x080
  ------------------
                              SSL3_CC_HANDSHAKE | SSL3_CHANGE_CIPHER_CLIENT_READ)) {
  ------------------
  |  |  351|      0|#define SSL3_CHANGE_CIPHER_CLIENT_READ (SSL3_CC_CLIENT | SSL3_CC_READ)
  |  |  ------------------
  |  |  |  |  344|      0|#define SSL3_CC_CLIENT 0x010
  |  |  ------------------
  |  |               #define SSL3_CHANGE_CIPHER_CLIENT_READ (SSL3_CC_CLIENT | SSL3_CC_READ)
  |  |  ------------------
  |  |  |  |  342|      0|#define SSL3_CC_READ 0x001
  |  |  ------------------
  ------------------
 1826|       |            /* SSLfatal() already called */
 1827|      0|            goto err;
 1828|      0|        }
 1829|      0|    }
 1830|       |
 1831|      0|    OPENSSL_free(extensions);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1832|      0|    return MSG_PROCESS_CONTINUE_READING;
 1833|    150|err:
 1834|    150|    OPENSSL_free(extensions);
  ------------------
  |  |  131|    150|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1835|    150|    return MSG_PROCESS_ERROR;
 1836|      0|}
statem_clnt.c:set_client_ciphersuite:
 1391|     40|{
 1392|     40|    STACK_OF(SSL_CIPHER) *sk;
  ------------------
  |  |   33|     40|#define STACK_OF(type) struct stack_st_##type
  ------------------
 1393|     40|    const SSL_CIPHER *c;
 1394|     40|    int i;
 1395|     40|    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
  ------------------
  |  |   26|     40|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
 1396|       |
 1397|     40|    c = ssl_get_cipher_by_char(s, cipherchars, 0);
 1398|     40|    if (c == NULL) {
  ------------------
  |  Branch (1398:9): [True: 14, False: 26]
  ------------------
 1399|       |        /* unknown cipher */
 1400|     14|        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_UNKNOWN_CIPHER_RETURNED);
  ------------------
  |  |  148|     14|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|     14|    (ERR_new(),                                                  \
  |  |  |  |  151|     14|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|     14|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|     14|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1401|     14|        return 0;
 1402|     14|    }
 1403|       |    /*
 1404|       |     * If it is a disabled cipher we either didn't send it in client hello,
 1405|       |     * or it's not allowed for the selected protocol. So we return an error.
 1406|       |     */
 1407|     26|    if (ssl_cipher_disabled(s, c, SSL_SECOP_CIPHER_CHECK, 1)) {
  ------------------
  |  | 2756|     26|#define SSL_SECOP_CIPHER_CHECK (3 | SSL_SECOP_OTHER_CIPHER)
  |  |  ------------------
  |  |  |  | 2738|     26|#define SSL_SECOP_OTHER_CIPHER (1 << 16)
  |  |  ------------------
  ------------------
  |  Branch (1407:9): [True: 6, False: 20]
  ------------------
 1408|      6|        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_WRONG_CIPHER_RETURNED);
  ------------------
  |  |  148|      6|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      6|    (ERR_new(),                                                  \
  |  |  |  |  151|      6|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      6|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      6|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1409|      6|        return 0;
 1410|      6|    }
 1411|       |
 1412|     20|    sk = ssl_get_ciphers_by_id(s);
 1413|     20|    i = sk_SSL_CIPHER_find(sk, c);
  ------------------
  |  | 1022|     20|#define sk_SSL_CIPHER_find(sk, ptr) OPENSSL_sk_find(ossl_check_SSL_CIPHER_sk_type(sk), ossl_check_SSL_CIPHER_type(ptr))
  ------------------
 1414|     20|    if (i < 0) {
  ------------------
  |  Branch (1414:9): [True: 3, False: 17]
  ------------------
 1415|       |        /* we did not say we would use this cipher */
 1416|      3|        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_WRONG_CIPHER_RETURNED);
  ------------------
  |  |  148|      3|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      3|    (ERR_new(),                                                  \
  |  |  |  |  151|      3|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      3|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      3|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1417|      3|        return 0;
 1418|      3|    }
 1419|       |
 1420|     17|    if (SSL_CONNECTION_IS_TLS13(s) && s->s3.tmp.new_cipher != NULL
  ------------------
  |  |  265|     34|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|     34|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|     17|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|     17|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 17, False: 0]
  |  |  ------------------
  |  |  266|     17|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|     17|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|     34|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 0, False: 17]
  |  |  ------------------
  |  |  267|     34|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|      0|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1420:39): [True: 0, False: 0]
  ------------------
 1421|      0|        && s->s3.tmp.new_cipher->id != c->id) {
  ------------------
  |  Branch (1421:12): [True: 0, False: 0]
  ------------------
 1422|       |        /* ServerHello selected a different ciphersuite to that in the HRR */
 1423|      0|        SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_WRONG_CIPHER_RETURNED);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1424|      0|        return 0;
 1425|      0|    }
 1426|       |
 1427|       |    /*
 1428|       |     * Depending on the session caching (internal/external), the cipher
 1429|       |     * and/or cipher_id values may not be set. Make sure that cipher_id is
 1430|       |     * set and use it for comparison.
 1431|       |     */
 1432|     17|    if (s->session->cipher != NULL)
  ------------------
  |  Branch (1432:9): [True: 0, False: 17]
  ------------------
 1433|      0|        s->session->cipher_id = s->session->cipher->id;
 1434|     17|    if (s->hit && (s->session->cipher_id != c->id)) {
  ------------------
  |  Branch (1434:9): [True: 0, False: 17]
  |  Branch (1434:19): [True: 0, False: 0]
  ------------------
 1435|      0|        if (SSL_CONNECTION_IS_TLS13(s)) {
  ------------------
  |  |  265|      0|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 0, False: 0]
  |  |  ------------------
  |  |  266|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  267|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|      0|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1436|      0|            const EVP_MD *md = ssl_md(sctx, c->algorithm2);
 1437|       |
 1438|      0|            if (!ossl_assert(s->session->cipher != NULL)) {
  ------------------
  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|      0|    __FILE__, __LINE__)
  ------------------
  |  Branch (1438:17): [True: 0, False: 0]
  ------------------
 1439|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1440|      0|                return 0;
 1441|      0|            }
 1442|       |            /*
 1443|       |             * In TLSv1.3 it is valid for the server to select a different
 1444|       |             * ciphersuite as long as the hash is the same.
 1445|       |             */
 1446|      0|            if (md == NULL
  ------------------
  |  Branch (1446:17): [True: 0, False: 0]
  ------------------
 1447|      0|                || md != ssl_md(sctx, s->session->cipher->algorithm2)) {
  ------------------
  |  Branch (1447:20): [True: 0, False: 0]
  ------------------
 1448|      0|                SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1449|      0|                    SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED);
 1450|      0|                return 0;
 1451|      0|            }
 1452|      0|        } else {
 1453|       |            /*
 1454|       |             * Prior to TLSv1.3 resuming a session always meant using the same
 1455|       |             * ciphersuite.
 1456|       |             */
 1457|      0|            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1458|      0|                SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED);
 1459|      0|            return 0;
 1460|      0|        }
 1461|      0|    }
 1462|     17|    s->s3.tmp.new_cipher = c;
 1463|       |
 1464|     17|    return 1;
 1465|     17|}
statem_clnt.c:ssl_cipher_list_to_bytes:
 4152|  1.76k|{
 4153|  1.76k|    int i;
 4154|  1.76k|    size_t totlen = 0, len, maxlen, maxverok = 0;
 4155|  1.76k|    int empty_reneg_info_scsv = !s->renegotiate
  ------------------
  |  Branch (4155:33): [True: 1.76k, False: 0]
  ------------------
 4156|  1.76k|        && !SSL_CONNECTION_IS_DTLS(s)
  ------------------
  |  |  258|  3.53k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  1.76k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  1.76k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  ------------------
  |  Branch (4156:12): [True: 1.76k, False: 0]
  ------------------
 4157|  1.76k|        && ssl_security(s, SSL_SECOP_VERSION, 0, TLS1_VERSION, NULL)
  ------------------
  |  | 2766|  1.76k|#define SSL_SECOP_VERSION (9 | SSL_SECOP_OTHER_NONE)
  |  |  ------------------
  |  |  |  | 2737|  1.76k|#define SSL_SECOP_OTHER_NONE 0
  |  |  ------------------
  ------------------
                      && ssl_security(s, SSL_SECOP_VERSION, 0, TLS1_VERSION, NULL)
  ------------------
  |  |   24|  1.76k|#define TLS1_VERSION 0x0301
  ------------------
  |  Branch (4157:12): [True: 13, False: 1.75k]
  ------------------
 4158|     13|        && s->min_proto_version <= TLS1_VERSION;
  ------------------
  |  |   24|     13|#define TLS1_VERSION 0x0301
  ------------------
  |  Branch (4158:12): [True: 6, False: 7]
  ------------------
 4159|  1.76k|    SSL *ssl = SSL_CONNECTION_GET_SSL(s);
  ------------------
  |  |   27|  1.76k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
 4160|       |
 4161|       |    /* Set disabled masks for this session */
 4162|  1.76k|    if (!ssl_set_client_disabled(s)) {
  ------------------
  |  Branch (4162:9): [True: 0, False: 1.76k]
  ------------------
 4163|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_PROTOCOLS_AVAILABLE);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 4164|      0|        return 0;
 4165|      0|    }
 4166|       |
 4167|  1.76k|    if (sk == NULL) {
  ------------------
  |  Branch (4167:9): [True: 0, False: 1.76k]
  ------------------
 4168|      0|        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 4169|      0|        return 0;
 4170|      0|    }
 4171|       |
 4172|       |#ifdef OPENSSL_MAX_TLS1_2_CIPHER_LENGTH
 4173|       |#if OPENSSL_MAX_TLS1_2_CIPHER_LENGTH < 6
 4174|       |#error Max cipher length too short
 4175|       |#endif
 4176|       |    /*
 4177|       |     * Some servers hang if client hello > 256 bytes as hack workaround
 4178|       |     * chop number of supported ciphers to keep it well below this if we
 4179|       |     * use TLS v1.2
 4180|       |     */
 4181|       |    if (TLS1_get_version(ssl) >= TLS1_2_VERSION)
 4182|       |        maxlen = OPENSSL_MAX_TLS1_2_CIPHER_LENGTH & ~1;
 4183|       |    else
 4184|       |#endif
 4185|       |        /* Maximum length that can be stored in 2 bytes. Length must be even */
 4186|  1.76k|        maxlen = 0xfffe;
 4187|       |
 4188|  1.76k|    if (empty_reneg_info_scsv)
  ------------------
  |  Branch (4188:9): [True: 6, False: 1.76k]
  ------------------
 4189|      6|        maxlen -= 2;
 4190|  1.76k|    if (s->mode & SSL_MODE_SEND_FALLBACK_SCSV)
  ------------------
  |  |  531|  1.76k|#define SSL_MODE_SEND_FALLBACK_SCSV 0x00000080U
  ------------------
  |  Branch (4190:9): [True: 0, False: 1.76k]
  ------------------
 4191|      0|        maxlen -= 2;
 4192|       |
 4193|   107k|    for (i = 0; i < sk_SSL_CIPHER_num(sk) && totlen < maxlen; i++) {
  ------------------
  |  | 1005|   214k|#define sk_SSL_CIPHER_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_CIPHER_sk_type(sk))
  ------------------
  |  Branch (4193:17): [True: 105k, False: 1.76k]
  |  Branch (4193:46): [True: 105k, False: 0]
  ------------------
 4194|   105k|        const SSL_CIPHER *c;
 4195|       |
 4196|   105k|        c = sk_SSL_CIPHER_value(sk, i);
  ------------------
  |  | 1006|   105k|#define sk_SSL_CIPHER_value(sk, idx) ((const SSL_CIPHER *)OPENSSL_sk_value(ossl_check_const_SSL_CIPHER_sk_type(sk), (idx)))
  ------------------
 4197|       |        /* Skip disabled ciphers */
 4198|   105k|        if (ssl_cipher_disabled(s, c, SSL_SECOP_CIPHER_SUPPORTED, 0))
  ------------------
  |  | 2752|   105k|#define SSL_SECOP_CIPHER_SUPPORTED (1 | SSL_SECOP_OTHER_CIPHER)
  |  |  ------------------
  |  |  |  | 2738|   105k|#define SSL_SECOP_OTHER_CIPHER (1 << 16)
  |  |  ------------------
  ------------------
  |  Branch (4198:13): [True: 53.3k, False: 51.9k]
  ------------------
 4199|  53.3k|            continue;
 4200|       |
 4201|  51.9k|        if (!ssl->method->put_cipher_by_char(c, pkt, &len)) {
  ------------------
  |  Branch (4201:13): [True: 0, False: 51.9k]
  ------------------
 4202|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 4203|      0|            return 0;
 4204|      0|        }
 4205|       |
 4206|       |        /* Sanity check that the maximum version we offer has ciphers enabled */
 4207|  51.9k|        if (!maxverok) {
  ------------------
  |  Branch (4207:13): [True: 2.99k, False: 49.0k]
  ------------------
 4208|  2.99k|            int minproto = SSL_CONNECTION_IS_DTLS(s) ? c->min_dtls : c->min_tls;
  ------------------
  |  |  258|  2.99k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  2.99k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  2.99k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 2.99k]
  |  |  ------------------
  ------------------
 4209|  2.99k|            int maxproto = SSL_CONNECTION_IS_DTLS(s) ? c->max_dtls : c->max_tls;
  ------------------
  |  |  258|  2.99k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  2.99k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  2.99k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 2.99k]
  |  |  ------------------
  ------------------
 4210|       |
 4211|  2.99k|            if (ssl_version_cmp(s, maxproto, s->s3.tmp.max_ver) >= 0
  ------------------
  |  Branch (4211:17): [True: 1.69k, False: 1.29k]
  ------------------
 4212|  1.69k|                && ssl_version_cmp(s, minproto, s->s3.tmp.max_ver) <= 0)
  ------------------
  |  Branch (4212:20): [True: 1.69k, False: 0]
  ------------------
 4213|  1.69k|                maxverok = 1;
 4214|  2.99k|        }
 4215|       |
 4216|  51.9k|        totlen += len;
 4217|  51.9k|    }
 4218|       |
 4219|  1.76k|    if (totlen == 0 || !maxverok) {
  ------------------
  |  Branch (4219:9): [True: 6, False: 1.76k]
  |  Branch (4219:24): [True: 62, False: 1.69k]
  ------------------
 4220|     68|        const char *maxvertext = !maxverok
  ------------------
  |  Branch (4220:34): [True: 68, False: 0]
  ------------------
 4221|     68|            ? "No ciphers enabled for max supported SSL/TLS version"
 4222|     68|            : NULL;
 4223|       |
 4224|     68|        SSLfatal_data(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_CIPHERS_AVAILABLE,
  ------------------
  |  |  150|     68|    (ERR_new(),                                                  \
  |  |  151|     68|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|     68|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  152|     68|        ossl_statem_fatal)
  ------------------
                      SSLfatal_data(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_CIPHERS_AVAILABLE,
  ------------------
  |  | 1243|     68|#define SSL_AD_INTERNAL_ERROR TLS1_AD_INTERNAL_ERROR
  |  |  ------------------
  |  |  |  |   66|     68|#define TLS1_AD_INTERNAL_ERROR 80 /* fatal */
  |  |  ------------------
  ------------------
                      SSLfatal_data(s, SSL_AD_INTERNAL_ERROR, SSL_R_NO_CIPHERS_AVAILABLE,
  ------------------
  |  |  195|     68|#define SSL_R_NO_CIPHERS_AVAILABLE 181
  ------------------
 4225|     68|            maxvertext);
 4226|     68|        return 0;
 4227|     68|    }
 4228|       |
 4229|  1.69k|    if (totlen != 0) {
  ------------------
  |  Branch (4229:9): [True: 1.69k, False: 0]
  ------------------
 4230|  1.69k|        if (empty_reneg_info_scsv) {
  ------------------
  |  Branch (4230:13): [True: 5, False: 1.69k]
  ------------------
 4231|      5|            static const SSL_CIPHER scsv = {
 4232|      5|                0, NULL, NULL, SSL3_CK_SCSV, 0, 0, 0, 0, 0, 0, 0, 0, 0
  ------------------
  |  |   33|      5|#define SSL3_CK_SCSV 0x030000FF
  ------------------
 4233|      5|            };
 4234|      5|            if (!ssl->method->put_cipher_by_char(&scsv, pkt, &len)) {
  ------------------
  |  Branch (4234:17): [True: 0, False: 5]
  ------------------
 4235|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 4236|      0|                return 0;
 4237|      0|            }
 4238|      5|        }
 4239|  1.69k|        if (s->mode & SSL_MODE_SEND_FALLBACK_SCSV) {
  ------------------
  |  |  531|  1.69k|#define SSL_MODE_SEND_FALLBACK_SCSV 0x00000080U
  ------------------
  |  Branch (4239:13): [True: 0, False: 1.69k]
  ------------------
 4240|      0|            static const SSL_CIPHER scsv = {
 4241|      0|                0, NULL, NULL, SSL3_CK_FALLBACK_SCSV, 0, 0, 0, 0, 0, 0, 0, 0, 0
  ------------------
  |  |   39|      0|#define SSL3_CK_FALLBACK_SCSV 0x03005600
  ------------------
 4242|      0|            };
 4243|      0|            if (!ssl->method->put_cipher_by_char(&scsv, pkt, &len)) {
  ------------------
  |  Branch (4243:17): [True: 0, False: 0]
  ------------------
 4244|      0|                SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 4245|      0|                return 0;
 4246|      0|            }
 4247|      0|        }
 4248|  1.69k|    }
 4249|       |
 4250|  1.69k|    return 1;
 4251|  1.69k|}

ssl3_do_write:
   63|  1.64k|{
   64|  1.64k|    int ret;
   65|  1.64k|    size_t written = 0;
   66|  1.64k|    SSL *ssl = SSL_CONNECTION_GET_SSL(s);
  ------------------
  |  |   27|  1.64k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
   67|  1.64k|    SSL *ussl = SSL_CONNECTION_GET_USER_SSL(s);
  ------------------
  |  |   28|  1.64k|#define SSL_CONNECTION_GET_USER_SSL(sc) ((sc)->user_ssl)
  ------------------
   68|       |
   69|       |    /*
   70|       |     * If we're running the test suite then we may need to mutate the message
   71|       |     * we've been asked to write. Does not happen in normal operation.
   72|       |     */
   73|  1.64k|    if (s->statem.mutate_handshake_cb != NULL
  ------------------
  |  Branch (73:9): [True: 0, False: 1.64k]
  ------------------
   74|      0|        && !s->statem.write_in_progress
  ------------------
  |  Branch (74:12): [True: 0, False: 0]
  ------------------
   75|      0|        && type == SSL3_RT_HANDSHAKE
  ------------------
  |  |  221|  1.64k|#define SSL3_RT_HANDSHAKE 22
  ------------------
  |  Branch (75:12): [True: 0, False: 0]
  ------------------
   76|      0|        && s->init_num >= SSL3_HM_HEADER_LENGTH) {
  ------------------
  |  |  141|      0|#define SSL3_HM_HEADER_LENGTH 4
  ------------------
  |  Branch (76:12): [True: 0, False: 0]
  ------------------
   77|      0|        unsigned char *msg;
   78|      0|        size_t msglen;
   79|       |
   80|      0|        if (!s->statem.mutate_handshake_cb((unsigned char *)s->init_buf->data,
  ------------------
  |  Branch (80:13): [True: 0, False: 0]
  ------------------
   81|      0|                s->init_num,
   82|      0|                &msg, &msglen,
   83|      0|                s->statem.mutatearg))
   84|      0|            return -1;
   85|      0|        if (msglen < SSL3_HM_HEADER_LENGTH
  ------------------
  |  |  141|      0|#define SSL3_HM_HEADER_LENGTH 4
  ------------------
  |  Branch (85:13): [True: 0, False: 0]
  ------------------
   86|      0|            || !BUF_MEM_grow(s->init_buf, msglen))
  ------------------
  |  Branch (86:16): [True: 0, False: 0]
  ------------------
   87|      0|            return -1;
   88|      0|        memcpy(s->init_buf->data, msg, msglen);
   89|      0|        s->init_num = msglen;
   90|      0|        s->init_msg = s->init_buf->data + SSL3_HM_HEADER_LENGTH;
  ------------------
  |  |  141|      0|#define SSL3_HM_HEADER_LENGTH 4
  ------------------
   91|      0|        s->statem.finish_mutate_handshake_cb(s->statem.mutatearg);
   92|      0|        s->statem.write_in_progress = 1;
   93|      0|    }
   94|       |
   95|  1.64k|    ret = ssl3_write_bytes(ssl, type, &s->init_buf->data[s->init_off],
   96|  1.64k|        s->init_num, &written);
   97|  1.64k|    if (ret <= 0)
  ------------------
  |  Branch (97:9): [True: 0, False: 1.64k]
  ------------------
   98|      0|        return -1;
   99|  1.64k|    if (type == SSL3_RT_HANDSHAKE)
  ------------------
  |  |  221|  1.64k|#define SSL3_RT_HANDSHAKE 22
  ------------------
  |  Branch (99:9): [True: 1.64k, False: 0]
  ------------------
  100|       |        /*
  101|       |         * should not be done for 'Hello Request's, but in that case we'll
  102|       |         * ignore the result anyway
  103|       |         * TLS1.3 KeyUpdate and NewSessionTicket do not need to be added
  104|       |         */
  105|  1.64k|        if (!SSL_CONNECTION_IS_TLS13(s)
  ------------------
  |  |  265|  3.28k|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|  3.28k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  1.64k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|  1.64k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 1.64k, False: 0]
  |  |  ------------------
  |  |  266|  1.64k|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|  1.64k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|  3.28k|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 1.64k, False: 0]
  |  |  ------------------
  |  |  267|  3.28k|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|  1.64k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|  1.64k|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 1.64k]
  |  |  ------------------
  ------------------
  106|      0|            || (s->statem.hand_state != TLS_ST_SW_SESSION_TICKET
  ------------------
  |  Branch (106:17): [True: 0, False: 0]
  ------------------
  107|      0|                && s->statem.hand_state != TLS_ST_CW_KEY_UPDATE
  ------------------
  |  Branch (107:20): [True: 0, False: 0]
  ------------------
  108|      0|                && s->statem.hand_state != TLS_ST_SW_KEY_UPDATE))
  ------------------
  |  Branch (108:20): [True: 0, False: 0]
  ------------------
  109|  1.64k|            if (!ssl3_finish_mac(s,
  ------------------
  |  Branch (109:17): [True: 0, False: 1.64k]
  ------------------
  110|  1.64k|                    (unsigned char *)&s->init_buf->data[s->init_off],
  111|  1.64k|                    written))
  112|      0|                return -1;
  113|  1.64k|    if (written == s->init_num) {
  ------------------
  |  Branch (113:9): [True: 1.64k, False: 0]
  ------------------
  114|  1.64k|        s->statem.write_in_progress = 0;
  115|  1.64k|        if (s->msg_callback)
  ------------------
  |  Branch (115:13): [True: 0, False: 1.64k]
  ------------------
  116|      0|            s->msg_callback(1, s->version, type, s->init_buf->data,
  117|      0|                (size_t)(s->init_off + s->init_num), ussl,
  118|      0|                s->msg_callback_arg);
  119|  1.64k|        return 1;
  120|  1.64k|    }
  121|      0|    s->init_off += written;
  122|      0|    s->init_num -= written;
  123|      0|    return 0;
  124|  1.64k|}
tls_close_construct_packet:
  127|  1.64k|{
  128|  1.64k|    size_t msglen;
  129|       |
  130|  1.64k|    if ((htype != SSL3_MT_CHANGE_CIPHER_SPEC && !WPACKET_close(pkt))
  ------------------
  |  |  337|  3.28k|#define SSL3_MT_CHANGE_CIPHER_SPEC 0x0101
  ------------------
  |  Branch (130:10): [True: 1.64k, False: 0]
  |  Branch (130:49): [True: 0, False: 1.64k]
  ------------------
  131|  1.64k|        || !WPACKET_get_length(pkt, &msglen)
  ------------------
  |  Branch (131:12): [True: 0, False: 1.64k]
  ------------------
  132|  1.64k|        || msglen > INT_MAX)
  ------------------
  |  Branch (132:12): [True: 0, False: 1.64k]
  ------------------
  133|      0|        return 0;
  134|  1.64k|    s->init_num = (int)msglen;
  135|  1.64k|    s->init_off = 0;
  136|       |
  137|  1.64k|    return 1;
  138|  1.64k|}
tls_setup_handshake:
  141|  1.77k|{
  142|  1.77k|    int ver_min, ver_max, ok;
  143|  1.77k|    SSL *ssl = SSL_CONNECTION_GET_SSL(s);
  ------------------
  |  |   27|  1.77k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
  144|  1.77k|    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
  ------------------
  |  |   26|  1.77k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
  145|       |
  146|  1.77k|    if (!ssl3_init_finished_mac(s)) {
  ------------------
  |  Branch (146:9): [True: 0, False: 1.77k]
  ------------------
  147|       |        /* SSLfatal() already called */
  148|      0|        return 0;
  149|      0|    }
  150|       |
  151|       |    /* Reset any extension flags */
  152|  1.77k|    memset(s->ext.extflags, 0, sizeof(s->ext.extflags));
  153|       |
  154|  1.77k|    if (ssl_get_min_max_version(s, &ver_min, &ver_max, NULL) != 0) {
  ------------------
  |  Branch (154:9): [True: 4, False: 1.76k]
  ------------------
  155|      4|        SSLfatal(s, SSL_AD_PROTOCOL_VERSION, SSL_R_NO_PROTOCOLS_AVAILABLE);
  ------------------
  |  |  148|      4|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      4|    (ERR_new(),                                                  \
  |  |  |  |  151|      4|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      4|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      4|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  156|      4|        return 0;
  157|      4|    }
  158|       |
  159|       |    /* Sanity check that we have MD5-SHA1 if we need it */
  160|  1.76k|    if (sctx->ssl_digest_methods[SSL_MD_MD5_SHA1_IDX] == NULL) {
  ------------------
  |  |  196|  1.76k|#define SSL_MD_MD5_SHA1_IDX 9
  ------------------
  |  Branch (160:9): [True: 0, False: 1.76k]
  ------------------
  161|      0|        int negotiated_minversion;
  162|      0|        int md5sha1_needed_maxversion = SSL_CONNECTION_IS_DTLS(s)
  ------------------
  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  163|      0|            ? DTLS1_VERSION
  ------------------
  |  |   28|      0|#define DTLS1_VERSION 0xFEFF
  ------------------
  164|      0|            : TLS1_1_VERSION;
  ------------------
  |  |   25|      0|#define TLS1_1_VERSION 0x0302
  ------------------
  165|       |
  166|       |        /* We don't have MD5-SHA1 - do we need it? */
  167|      0|        if (ssl_version_cmp(s, ver_max, md5sha1_needed_maxversion) <= 0) {
  ------------------
  |  Branch (167:13): [True: 0, False: 0]
  ------------------
  168|      0|            SSLfatal_data(s, SSL_AD_HANDSHAKE_FAILURE,
  ------------------
  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  152|      0|        ossl_statem_fatal)
  ------------------
                          SSLfatal_data(s, SSL_AD_HANDSHAKE_FAILURE,
  ------------------
  |  | 1219|      0|#define SSL_AD_HANDSHAKE_FAILURE SSL3_AD_HANDSHAKE_FAILURE
  |  |  ------------------
  |  |  |  |  256|      0|#define SSL3_AD_HANDSHAKE_FAILURE 40 /* fatal */
  |  |  ------------------
  ------------------
  169|      0|                SSL_R_NO_SUITABLE_DIGEST_ALGORITHM,
  ------------------
  |  |  213|      0|#define SSL_R_NO_SUITABLE_DIGEST_ALGORITHM 297
  ------------------
  170|      0|                "The max supported SSL/TLS version needs the"
  171|      0|                " MD5-SHA1 digest but it is not available"
  172|      0|                " in the loaded providers. Use (D)TLSv1.2 or"
  173|      0|                " above, or load different providers");
  174|      0|            return 0;
  175|      0|        }
  176|       |
  177|      0|        ok = 1;
  178|       |
  179|       |        /* Don't allow TLSv1.1 or below to be negotiated */
  180|      0|        negotiated_minversion = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_2_VERSION : TLS1_2_VERSION;
  ------------------
  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                      negotiated_minversion = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_2_VERSION : TLS1_2_VERSION;
  ------------------
  |  |   29|      0|#define DTLS1_2_VERSION 0xFEFD
  ------------------
                      negotiated_minversion = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_2_VERSION : TLS1_2_VERSION;
  ------------------
  |  |   26|      0|#define TLS1_2_VERSION 0x0303
  ------------------
  181|      0|        if (ssl_version_cmp(s, ver_min, negotiated_minversion) < 0)
  ------------------
  |  Branch (181:13): [True: 0, False: 0]
  ------------------
  182|      0|            ok = SSL_set_min_proto_version(ssl, negotiated_minversion);
  ------------------
  |  | 1565|      0|    SSL_ctrl(s, SSL_CTRL_SET_MIN_PROTO_VERSION, version, NULL)
  |  |  ------------------
  |  |  |  | 1377|      0|#define SSL_CTRL_SET_MIN_PROTO_VERSION 123
  |  |  ------------------
  ------------------
  183|      0|        if (!ok) {
  ------------------
  |  Branch (183:13): [True: 0, False: 0]
  ------------------
  184|       |            /* Shouldn't happen */
  185|      0|            SSLfatal(s, SSL_AD_HANDSHAKE_FAILURE, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
  186|      0|            return 0;
  187|      0|        }
  188|      0|    }
  189|       |
  190|  1.76k|    ok = 0;
  191|  1.76k|    if (s->server) {
  ------------------
  |  Branch (191:9): [True: 0, False: 1.76k]
  ------------------
  192|      0|        STACK_OF(SSL_CIPHER) *ciphers = SSL_get_ciphers(ssl);
  ------------------
  |  |   33|      0|#define STACK_OF(type) struct stack_st_##type
  ------------------
  193|      0|        int i;
  194|       |
  195|       |        /*
  196|       |         * Sanity check that the maximum version we accept has ciphers
  197|       |         * enabled. For clients we do this check during construction of the
  198|       |         * ClientHello.
  199|       |         */
  200|      0|        for (i = 0; i < sk_SSL_CIPHER_num(ciphers); i++) {
  ------------------
  |  | 1005|      0|#define sk_SSL_CIPHER_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_CIPHER_sk_type(sk))
  ------------------
  |  Branch (200:21): [True: 0, False: 0]
  ------------------
  201|      0|            const SSL_CIPHER *c = sk_SSL_CIPHER_value(ciphers, i);
  ------------------
  |  | 1006|      0|#define sk_SSL_CIPHER_value(sk, idx) ((const SSL_CIPHER *)OPENSSL_sk_value(ossl_check_const_SSL_CIPHER_sk_type(sk), (idx)))
  ------------------
  202|      0|            int cipher_minprotover = SSL_CONNECTION_IS_DTLS(s)
  ------------------
  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  203|      0|                ? c->min_dtls
  204|      0|                : c->min_tls;
  205|      0|            int cipher_maxprotover = SSL_CONNECTION_IS_DTLS(s)
  ------------------
  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  206|      0|                ? c->max_dtls
  207|      0|                : c->max_tls;
  208|       |
  209|      0|            if (ssl_version_cmp(s, ver_max, cipher_minprotover) >= 0
  ------------------
  |  Branch (209:17): [True: 0, False: 0]
  ------------------
  210|      0|                && ssl_version_cmp(s, ver_max, cipher_maxprotover) <= 0) {
  ------------------
  |  Branch (210:20): [True: 0, False: 0]
  ------------------
  211|      0|                ok = 1;
  212|      0|                break;
  213|      0|            }
  214|      0|        }
  215|      0|        if (!ok) {
  ------------------
  |  Branch (215:13): [True: 0, False: 0]
  ------------------
  216|      0|            SSLfatal_data(s, SSL_AD_HANDSHAKE_FAILURE,
  ------------------
  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  152|      0|        ossl_statem_fatal)
  ------------------
                          SSLfatal_data(s, SSL_AD_HANDSHAKE_FAILURE,
  ------------------
  |  | 1219|      0|#define SSL_AD_HANDSHAKE_FAILURE SSL3_AD_HANDSHAKE_FAILURE
  |  |  ------------------
  |  |  |  |  256|      0|#define SSL3_AD_HANDSHAKE_FAILURE 40 /* fatal */
  |  |  ------------------
  ------------------
  217|      0|                SSL_R_NO_CIPHERS_AVAILABLE,
  ------------------
  |  |  195|      0|#define SSL_R_NO_CIPHERS_AVAILABLE 181
  ------------------
  218|      0|                "No ciphers enabled for max supported "
  219|      0|                "SSL/TLS version");
  220|      0|            return 0;
  221|      0|        }
  222|      0|        if (SSL_IS_FIRST_HANDSHAKE(s)) {
  ------------------
  |  |  277|      0|#define SSL_IS_FIRST_HANDSHAKE(s) ((s)->s3.tmp.finish_md_len == 0 \
  |  |  ------------------
  |  |  |  Branch (277:36): [True: 0, False: 0]
  |  |  ------------------
  |  |  278|      0|    || (s)->s3.tmp.peer_finish_md_len == 0)
  |  |  ------------------
  |  |  |  Branch (278:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  223|       |            /* N.B. s->session_ctx == s->ctx here */
  224|      0|            ssl_tsan_counter(s->session_ctx, &s->session_ctx->stats.sess_accept);
  225|      0|        } else {
  226|       |            /* N.B. s->ctx may not equal s->session_ctx */
  227|      0|            ssl_tsan_counter(sctx, &sctx->stats.sess_accept_renegotiate);
  228|       |
  229|      0|            s->s3.tmp.cert_request = 0;
  230|      0|        }
  231|  1.76k|    } else {
  232|  1.76k|        if (SSL_IS_FIRST_HANDSHAKE(s))
  ------------------
  |  |  277|  1.76k|#define SSL_IS_FIRST_HANDSHAKE(s) ((s)->s3.tmp.finish_md_len == 0 \
  |  |  ------------------
  |  |  |  Branch (277:36): [True: 1.76k, False: 0]
  |  |  ------------------
  |  |  278|  1.76k|    || (s)->s3.tmp.peer_finish_md_len == 0)
  |  |  ------------------
  |  |  |  Branch (278:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  233|  1.76k|            ssl_tsan_counter(s->session_ctx, &s->session_ctx->stats.sess_connect);
  234|      0|        else
  235|      0|            ssl_tsan_counter(s->session_ctx,
  236|      0|                &s->session_ctx->stats.sess_connect_renegotiate);
  237|       |
  238|       |        /* mark client_random uninitialized */
  239|  1.76k|        memset(s->s3.client_random, 0, sizeof(s->s3.client_random));
  240|  1.76k|        s->hit = 0;
  241|       |
  242|  1.76k|        s->s3.tmp.cert_req = 0;
  243|       |
  244|  1.76k|        if (SSL_CONNECTION_IS_DTLS(s))
  ------------------
  |  |  258|  1.76k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  1.76k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  1.76k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 1.76k]
  |  |  ------------------
  ------------------
  245|      0|            s->statem.use_timer = 1;
  246|  1.76k|    }
  247|       |
  248|  1.76k|    return 1;
  249|  1.76k|}
tls_get_message_header:
 1554|  1.94k|{
 1555|       |    /* s->init_num < SSL3_HM_HEADER_LENGTH */
 1556|  1.94k|    int skip_message, i;
 1557|  1.94k|    uint8_t recvd_type;
 1558|  1.94k|    unsigned char *p;
 1559|  1.94k|    size_t l, readbytes;
 1560|  1.94k|    SSL *ssl = SSL_CONNECTION_GET_SSL(s);
  ------------------
  |  |   27|  1.94k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
 1561|  1.94k|    SSL *ussl = SSL_CONNECTION_GET_USER_SSL(s);
  ------------------
  |  |   28|  1.94k|#define SSL_CONNECTION_GET_USER_SSL(sc) ((sc)->user_ssl)
  ------------------
 1562|       |
 1563|  1.94k|    p = (unsigned char *)s->init_buf->data;
 1564|       |
 1565|  2.01k|    do {
 1566|  2.29k|        while (s->init_num < SSL3_HM_HEADER_LENGTH) {
  ------------------
  |  |  141|  2.29k|#define SSL3_HM_HEADER_LENGTH 4
  ------------------
  |  Branch (1566:16): [True: 2.02k, False: 272]
  ------------------
 1567|  2.02k|            i = ssl->method->ssl_read_bytes(ssl, SSL3_RT_HANDSHAKE, &recvd_type,
  ------------------
  |  |  221|  2.02k|#define SSL3_RT_HANDSHAKE 22
  ------------------
 1568|  2.02k|                &p[s->init_num],
 1569|  2.02k|                SSL3_HM_HEADER_LENGTH - s->init_num,
  ------------------
  |  |  141|  2.02k|#define SSL3_HM_HEADER_LENGTH 4
  ------------------
 1570|  2.02k|                0, &readbytes);
 1571|  2.02k|            if (i <= 0) {
  ------------------
  |  Branch (1571:17): [True: 1.73k, False: 291]
  ------------------
 1572|  1.73k|                s->rwstate = SSL_READING;
  ------------------
  |  |  934|  1.73k|#define SSL_READING 3
  ------------------
 1573|  1.73k|                return 0;
 1574|  1.73k|            }
 1575|    291|            if (recvd_type == SSL3_RT_CHANGE_CIPHER_SPEC) {
  ------------------
  |  |  219|    291|#define SSL3_RT_CHANGE_CIPHER_SPEC 20
  ------------------
  |  Branch (1575:17): [True: 5, False: 286]
  ------------------
 1576|       |                /*
 1577|       |                 * A ChangeCipherSpec must be a single byte and may not occur
 1578|       |                 * in the middle of a handshake message.
 1579|       |                 */
 1580|      5|                if (s->init_num != 0 || readbytes != 1 || p[0] != SSL3_MT_CCS) {
  ------------------
  |  |  339|      2|#define SSL3_MT_CCS 1
  ------------------
  |  Branch (1580:21): [True: 1, False: 4]
  |  Branch (1580:41): [True: 2, False: 2]
  |  Branch (1580:59): [True: 1, False: 1]
  ------------------
 1581|      4|                    SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE,
  ------------------
  |  |  148|      4|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      4|    (ERR_new(),                                                  \
  |  |  |  |  151|      4|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      4|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      4|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1582|      4|                        SSL_R_BAD_CHANGE_CIPHER_SPEC);
 1583|      4|                    return 0;
 1584|      4|                }
 1585|      1|                if (s->statem.hand_state == TLS_ST_BEFORE
  ------------------
  |  Branch (1585:21): [True: 0, False: 1]
  ------------------
 1586|      0|                    && (s->s3.flags & TLS1_FLAGS_STATELESS) != 0) {
  ------------------
  |  |  304|      0|#define TLS1_FLAGS_STATELESS 0x0800
  ------------------
  |  Branch (1586:24): [True: 0, False: 0]
  ------------------
 1587|       |                    /*
 1588|       |                     * We are stateless and we received a CCS. Probably this is
 1589|       |                     * from a client between the first and second ClientHellos.
 1590|       |                     * We should ignore this, but return an error because we do
 1591|       |                     * not return success until we see the second ClientHello
 1592|       |                     * with a valid cookie.
 1593|       |                     */
 1594|      0|                    return 0;
 1595|      0|                }
 1596|      1|                s->s3.tmp.message_type = *mt = SSL3_MT_CHANGE_CIPHER_SPEC;
  ------------------
  |  |  337|      1|#define SSL3_MT_CHANGE_CIPHER_SPEC 0x0101
  ------------------
 1597|      1|                s->init_num = readbytes - 1;
 1598|      1|                s->init_msg = s->init_buf->data;
 1599|      1|                s->s3.tmp.message_size = readbytes;
 1600|      1|                return 1;
 1601|    286|            } else if (recvd_type != SSL3_RT_HANDSHAKE) {
  ------------------
  |  |  221|    286|#define SSL3_RT_HANDSHAKE 22
  ------------------
  |  Branch (1601:24): [True: 0, False: 286]
  ------------------
 1602|      0|                SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE,
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1603|      0|                    SSL_R_CCS_RECEIVED_EARLY);
 1604|      0|                return 0;
 1605|      0|            }
 1606|    286|            s->init_num += readbytes;
 1607|    286|        }
 1608|       |
 1609|    272|        skip_message = 0;
 1610|    272|        if (!s->server)
  ------------------
  |  Branch (1610:13): [True: 272, False: 0]
  ------------------
 1611|    272|            if (s->statem.hand_state != TLS_ST_OK
  ------------------
  |  Branch (1611:17): [True: 272, False: 0]
  ------------------
 1612|    272|                && p[0] == SSL3_MT_HELLO_REQUEST)
  ------------------
  |  |  312|    272|#define SSL3_MT_HELLO_REQUEST 0
  ------------------
  |  Branch (1612:20): [True: 69, False: 203]
  ------------------
 1613|       |                /*
 1614|       |                 * The server may always send 'Hello Request' messages --
 1615|       |                 * we are doing a handshake anyway now, so ignore them if
 1616|       |                 * their format is correct. Does not count for 'Finished'
 1617|       |                 * MAC.
 1618|       |                 */
 1619|     69|                if (p[1] == 0 && p[2] == 0 && p[3] == 0) {
  ------------------
  |  Branch (1619:21): [True: 68, False: 1]
  |  Branch (1619:34): [True: 66, False: 2]
  |  Branch (1619:47): [True: 63, False: 3]
  ------------------
 1620|     63|                    s->init_num = 0;
 1621|     63|                    skip_message = 1;
 1622|       |
 1623|     63|                    if (s->msg_callback)
  ------------------
  |  Branch (1623:25): [True: 0, False: 63]
  ------------------
 1624|      0|                        s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE,
  ------------------
  |  |  221|      0|#define SSL3_RT_HANDSHAKE 22
  ------------------
 1625|      0|                            p, SSL3_HM_HEADER_LENGTH, ussl,
  ------------------
  |  |  141|      0|#define SSL3_HM_HEADER_LENGTH 4
  ------------------
 1626|      0|                            s->msg_callback_arg);
 1627|     63|                }
 1628|    272|    } while (skip_message);
  ------------------
  |  Branch (1628:14): [True: 63, False: 209]
  ------------------
 1629|       |    /* s->init_num == SSL3_HM_HEADER_LENGTH */
 1630|       |
 1631|    209|    *mt = *p;
 1632|    209|    s->s3.tmp.message_type = *(p++);
 1633|       |
 1634|    209|    if (RECORD_LAYER_is_sslv2_record(&s->rlayer)) {
  ------------------
  |  Branch (1634:9): [True: 0, False: 209]
  ------------------
 1635|       |        /*
 1636|       |         * Only happens with SSLv3+ in an SSLv2 backward compatible
 1637|       |         * ClientHello
 1638|       |         *
 1639|       |         * Total message size is the remaining record bytes to read
 1640|       |         * plus the SSL3_HM_HEADER_LENGTH bytes that we already read
 1641|       |         */
 1642|      0|        l = s->rlayer.tlsrecs[0].length + SSL3_HM_HEADER_LENGTH;
  ------------------
  |  |  141|      0|#define SSL3_HM_HEADER_LENGTH 4
  ------------------
 1643|      0|        s->s3.tmp.message_size = l;
 1644|       |
 1645|      0|        s->init_msg = s->init_buf->data;
 1646|      0|        s->init_num = SSL3_HM_HEADER_LENGTH;
  ------------------
  |  |  141|      0|#define SSL3_HM_HEADER_LENGTH 4
  ------------------
 1647|    209|    } else {
 1648|    209|        n2l3(p, l);
  ------------------
  |  |  196|    209|#define n2l3(c, l) ((l = (((unsigned long)((c)[0])) << 16) | (((unsigned long)((c)[1])) << 8) | (((unsigned long)((c)[2])))), (c) += 3)
  ------------------
 1649|       |        /* BUF_MEM_grow takes an 'int' parameter */
 1650|    209|        if (l > (INT_MAX - SSL3_HM_HEADER_LENGTH)) {
  ------------------
  |  |  141|    209|#define SSL3_HM_HEADER_LENGTH 4
  ------------------
  |  Branch (1650:13): [True: 0, False: 209]
  ------------------
 1651|      0|            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 1652|      0|                SSL_R_EXCESSIVE_MESSAGE_SIZE);
 1653|      0|            return 0;
 1654|      0|        }
 1655|    209|        s->s3.tmp.message_size = l;
 1656|       |
 1657|    209|        s->init_msg = s->init_buf->data + SSL3_HM_HEADER_LENGTH;
  ------------------
  |  |  141|    209|#define SSL3_HM_HEADER_LENGTH 4
  ------------------
 1658|    209|        s->init_num = 0;
 1659|    209|    }
 1660|       |
 1661|    209|    return 1;
 1662|    209|}
tls_get_message_body:
 1665|    184|{
 1666|    184|    size_t n, readbytes;
 1667|    184|    unsigned char *p;
 1668|    184|    int i;
 1669|    184|    SSL *ssl = SSL_CONNECTION_GET_SSL(s);
  ------------------
  |  |   27|    184|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
 1670|    184|    SSL *ussl = SSL_CONNECTION_GET_USER_SSL(s);
  ------------------
  |  |   28|    184|#define SSL_CONNECTION_GET_USER_SSL(sc) ((sc)->user_ssl)
  ------------------
 1671|       |
 1672|    184|    if (s->s3.tmp.message_type == SSL3_MT_CHANGE_CIPHER_SPEC) {
  ------------------
  |  |  337|    184|#define SSL3_MT_CHANGE_CIPHER_SPEC 0x0101
  ------------------
  |  Branch (1672:9): [True: 0, False: 184]
  ------------------
 1673|       |        /* We've already read everything in */
 1674|      0|        *len = (unsigned long)s->init_num;
 1675|      0|        return 1;
 1676|      0|    }
 1677|       |
 1678|    184|    p = s->init_msg;
 1679|    184|    n = s->s3.tmp.message_size - s->init_num;
 1680|    368|    while (n > 0) {
  ------------------
  |  Branch (1680:12): [True: 218, False: 150]
  ------------------
 1681|    218|        i = ssl->method->ssl_read_bytes(ssl, SSL3_RT_HANDSHAKE, NULL,
  ------------------
  |  |  221|    218|#define SSL3_RT_HANDSHAKE 22
  ------------------
 1682|    218|            &p[s->init_num], n, 0, &readbytes);
 1683|    218|        if (i <= 0) {
  ------------------
  |  Branch (1683:13): [True: 34, False: 184]
  ------------------
 1684|     34|            s->rwstate = SSL_READING;
  ------------------
  |  |  934|     34|#define SSL_READING 3
  ------------------
 1685|     34|            *len = 0;
 1686|     34|            return 0;
 1687|     34|        }
 1688|    184|        s->init_num += readbytes;
 1689|    184|        n -= readbytes;
 1690|    184|    }
 1691|       |
 1692|       |    /*
 1693|       |     * If receiving Finished, record MAC of prior handshake messages for
 1694|       |     * Finished verification.
 1695|       |     */
 1696|    150|    if (*(s->init_buf->data) == SSL3_MT_FINISHED && !ssl3_take_mac(s)) {
  ------------------
  |  |  324|    300|#define SSL3_MT_FINISHED 20
  ------------------
  |  Branch (1696:9): [True: 0, False: 150]
  |  Branch (1696:53): [True: 0, False: 0]
  ------------------
 1697|       |        /* SSLfatal() already called */
 1698|      0|        *len = 0;
 1699|      0|        return 0;
 1700|      0|    }
 1701|       |
 1702|       |    /* Feed this message into MAC computation. */
 1703|    150|    if (RECORD_LAYER_is_sslv2_record(&s->rlayer)) {
  ------------------
  |  Branch (1703:9): [True: 0, False: 150]
  ------------------
 1704|      0|        if (!ssl3_finish_mac(s, (unsigned char *)s->init_buf->data,
  ------------------
  |  Branch (1704:13): [True: 0, False: 0]
  ------------------
 1705|      0|                s->init_num)) {
 1706|       |            /* SSLfatal() already called */
 1707|      0|            *len = 0;
 1708|      0|            return 0;
 1709|      0|        }
 1710|      0|        if (s->msg_callback)
  ------------------
  |  Branch (1710:13): [True: 0, False: 0]
  ------------------
 1711|      0|            s->msg_callback(0, SSL2_VERSION, 0, s->init_buf->data,
  ------------------
  |  |   23|      0|#define SSL2_VERSION 0x0002
  ------------------
 1712|      0|                (size_t)s->init_num, ussl, s->msg_callback_arg);
 1713|    150|    } else {
 1714|       |        /*
 1715|       |         * We defer feeding in the HRR until later. We'll do it as part of
 1716|       |         * processing the message
 1717|       |         * The TLsv1.3 handshake transcript stops at the ClientFinished
 1718|       |         * message.
 1719|       |         */
 1720|    150|#define SERVER_HELLO_RANDOM_OFFSET (SSL3_HM_HEADER_LENGTH + 2)
 1721|       |        /* KeyUpdate and NewSessionTicket do not need to be added */
 1722|    150|        if (!SSL_CONNECTION_IS_TLS13(s)
  ------------------
  |  |  265|    300|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|    300|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|    150|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|    150|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 150, False: 0]
  |  |  ------------------
  |  |  266|    150|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|    150|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|    300|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 150, False: 0]
  |  |  ------------------
  |  |  267|    300|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|    150|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|    150|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 150]
  |  |  ------------------
  ------------------
 1723|      0|            || (s->s3.tmp.message_type != SSL3_MT_NEWSESSION_TICKET
  ------------------
  |  |  315|      0|#define SSL3_MT_NEWSESSION_TICKET 4
  ------------------
  |  Branch (1723:17): [True: 0, False: 0]
  ------------------
 1724|    150|                && s->s3.tmp.message_type != SSL3_MT_KEY_UPDATE)) {
  ------------------
  |  |  328|      0|#define SSL3_MT_KEY_UPDATE 24
  ------------------
  |  Branch (1724:20): [True: 0, False: 0]
  ------------------
 1725|    150|            if (s->s3.tmp.message_type != SSL3_MT_SERVER_HELLO
  ------------------
  |  |  314|    300|#define SSL3_MT_SERVER_HELLO 2
  ------------------
  |  Branch (1725:17): [True: 0, False: 150]
  ------------------
 1726|    150|                || s->init_num < SERVER_HELLO_RANDOM_OFFSET + SSL3_RANDOM_SIZE
  ------------------
  |  | 1720|    150|#define SERVER_HELLO_RANDOM_OFFSET (SSL3_HM_HEADER_LENGTH + 2)
  |  |  ------------------
  |  |  |  |  141|    150|#define SSL3_HM_HEADER_LENGTH 4
  |  |  ------------------
  ------------------
                              || s->init_num < SERVER_HELLO_RANDOM_OFFSET + SSL3_RANDOM_SIZE
  ------------------
  |  |  137|    300|#define SSL3_RANDOM_SIZE 32
  ------------------
  |  Branch (1726:20): [True: 4, False: 146]
  ------------------
 1727|    146|                || memcmp(hrrrandom,
  ------------------
  |  Branch (1727:20): [True: 142, False: 4]
  ------------------
 1728|    146|                       s->init_buf->data + SERVER_HELLO_RANDOM_OFFSET,
  ------------------
  |  | 1720|    146|#define SERVER_HELLO_RANDOM_OFFSET (SSL3_HM_HEADER_LENGTH + 2)
  |  |  ------------------
  |  |  |  |  141|    146|#define SSL3_HM_HEADER_LENGTH 4
  |  |  ------------------
  ------------------
 1729|    146|                       SSL3_RANDOM_SIZE)
  ------------------
  |  |  137|    146|#define SSL3_RANDOM_SIZE 32
  ------------------
 1730|    146|                    != 0) {
 1731|    146|                if (!ssl3_finish_mac(s, (unsigned char *)s->init_buf->data,
  ------------------
  |  Branch (1731:21): [True: 0, False: 146]
  ------------------
 1732|    146|                        s->init_num + SSL3_HM_HEADER_LENGTH)) {
  ------------------
  |  |  141|    146|#define SSL3_HM_HEADER_LENGTH 4
  ------------------
 1733|       |                    /* SSLfatal() already called */
 1734|      0|                    *len = 0;
 1735|      0|                    return 0;
 1736|      0|                }
 1737|    146|            }
 1738|    150|        }
 1739|    150|        if (s->msg_callback)
  ------------------
  |  Branch (1739:13): [True: 0, False: 150]
  ------------------
 1740|      0|            s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, s->init_buf->data,
  ------------------
  |  |  221|      0|#define SSL3_RT_HANDSHAKE 22
  ------------------
 1741|      0|                (size_t)s->init_num + SSL3_HM_HEADER_LENGTH, ussl,
  ------------------
  |  |  141|      0|#define SSL3_HM_HEADER_LENGTH 4
  ------------------
 1742|      0|                s->msg_callback_arg);
 1743|    150|    }
 1744|       |
 1745|    150|    *len = s->init_num;
 1746|    150|    return 1;
 1747|    150|}
ssl_allow_compression:
 1806|  1.69k|{
 1807|  1.69k|    if (s->options & SSL_OP_NO_COMPRESSION)
  ------------------
  |  |  394|  1.69k|#define SSL_OP_NO_COMPRESSION SSL_OP_BIT(17)
  |  |  ------------------
  |  |  |  |  350|  1.69k|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (1807:9): [True: 1.69k, False: 0]
  ------------------
 1808|  1.69k|        return 0;
 1809|      0|    return ssl_security(s, SSL_SECOP_COMPRESSION, 0, 0, NULL);
  ------------------
  |  | 2778|      0|#define SSL_SECOP_COMPRESSION (15 | SSL_SECOP_OTHER_NONE)
  |  |  ------------------
  |  |  |  | 2737|      0|#define SSL_SECOP_OTHER_NONE 0
  |  |  ------------------
  ------------------
 1810|  1.69k|}
ssl_version_cmp:
 1821|   442k|{
 1822|   442k|    int dtls = SSL_CONNECTION_IS_DTLS(s);
  ------------------
  |  |  258|   442k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|   442k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|   442k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  ------------------
 1823|       |
 1824|   442k|    if (versiona == versionb)
  ------------------
  |  Branch (1824:9): [True: 202k, False: 240k]
  ------------------
 1825|   202k|        return 0;
 1826|   240k|    if (!dtls)
  ------------------
  |  Branch (1826:9): [True: 240k, False: 0]
  ------------------
 1827|   240k|        return versiona < versionb ? -1 : 1;
  ------------------
  |  Branch (1827:16): [True: 192k, False: 47.7k]
  ------------------
 1828|      0|    return DTLS_VERSION_LT(versiona, versionb) ? -1 : 1;
  ------------------
  |  |   60|      0|#define DTLS_VERSION_LT(v1, v2) (dtls_ver_ordinal(v1) > dtls_ver_ordinal(v2))
  |  |  ------------------
  |  |  |  |   57|      0|#define dtls_ver_ordinal(v1) (((v1) == DTLS1_BAD_VER) ? 0xff00 : (v1))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|      0|#define DTLS1_BAD_VER 0x0100
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:31): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DTLS_VERSION_LT(v1, v2) (dtls_ver_ordinal(v1) > dtls_ver_ordinal(v2))
  |  |  ------------------
  |  |  |  |   57|      0|#define dtls_ver_ordinal(v1) (((v1) == DTLS1_BAD_VER) ? 0xff00 : (v1))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|      0|#define DTLS1_BAD_VER 0x0100
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:31): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (60:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1829|   240k|}
ssl_set_version_bound:
 2080|  4.95k|{
 2081|  4.95k|    int valid_tls;
 2082|  4.95k|    int valid_dtls;
 2083|       |
 2084|  4.95k|    if (version == 0) {
  ------------------
  |  Branch (2084:9): [True: 2.45k, False: 2.50k]
  ------------------
 2085|  2.45k|        *bound = version;
 2086|  2.45k|        return 1;
 2087|  2.45k|    }
 2088|       |
 2089|  2.50k|    valid_tls = version >= SSL3_VERSION && version <= TLS_MAX_VERSION_INTERNAL;
  ------------------
  |  |   23|  5.00k|#define SSL3_VERSION 0x0300
  ------------------
                  valid_tls = version >= SSL3_VERSION && version <= TLS_MAX_VERSION_INTERNAL;
  ------------------
  |  |   50|  2.50k|#define TLS_MAX_VERSION_INTERNAL TLS1_3_VERSION
  |  |  ------------------
  |  |  |  |   27|  5.00k|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  ------------------
  |  Branch (2089:17): [True: 2.50k, False: 0]
  |  Branch (2089:44): [True: 2.50k, False: 0]
  ------------------
 2090|  2.50k|    valid_dtls =
 2091|       |        /* We support client side pre-standardisation version of DTLS */
 2092|  2.50k|        (version == DTLS1_BAD_VER)
  ------------------
  |  |   30|  2.50k|#define DTLS1_BAD_VER 0x0100
  ------------------
  |  Branch (2092:9): [True: 0, False: 2.50k]
  ------------------
 2093|  2.50k|        || (DTLS_VERSION_LE(version, DTLS_MAX_VERSION_INTERNAL)
  ------------------
  |  |   61|  5.00k|#define DTLS_VERSION_LE(v1, v2) (dtls_ver_ordinal(v1) >= dtls_ver_ordinal(v2))
  |  |  ------------------
  |  |  |  |   57|  2.50k|#define dtls_ver_ordinal(v1) (((v1) == DTLS1_BAD_VER) ? 0xff00 : (v1))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  2.50k|#define DTLS1_BAD_VER 0x0100
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:31): [True: 0, False: 2.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DTLS_VERSION_LE(v1, v2) (dtls_ver_ordinal(v1) >= dtls_ver_ordinal(v2))
  |  |  ------------------
  |  |  |  |   57|  2.50k|#define dtls_ver_ordinal(v1) (((v1) == DTLS1_BAD_VER) ? 0xff00 : (v1))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  2.50k|#define DTLS1_BAD_VER 0x0100
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:31): [Folded, False: 2.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:33): [True: 0, False: 2.50k]
  |  |  ------------------
  ------------------
 2094|      0|            && DTLS_VERSION_GE(version, DTLS1_VERSION));
  ------------------
  |  |   59|      0|#define DTLS_VERSION_GE(v1, v2) (dtls_ver_ordinal(v1) <= dtls_ver_ordinal(v2))
  |  |  ------------------
  |  |  |  |   57|      0|#define dtls_ver_ordinal(v1) (((v1) == DTLS1_BAD_VER) ? 0xff00 : (v1))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|      0|#define DTLS1_BAD_VER 0x0100
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:31): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DTLS_VERSION_GE(v1, v2) (dtls_ver_ordinal(v1) <= dtls_ver_ordinal(v2))
  |  |  ------------------
  |  |  |  |   57|      0|#define dtls_ver_ordinal(v1) (((v1) == DTLS1_BAD_VER) ? 0xff00 : (v1))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|      0|#define DTLS1_BAD_VER 0x0100
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:31): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (59:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2095|       |
 2096|  2.50k|    if (!valid_tls && !valid_dtls)
  ------------------
  |  Branch (2096:9): [True: 0, False: 2.50k]
  |  Branch (2096:23): [True: 0, False: 0]
  ------------------
 2097|      0|        return 0;
 2098|       |
 2099|       |    /*-
 2100|       |     * Restrict TLS methods to TLS protocol versions.
 2101|       |     * Restrict DTLS methods to DTLS protocol versions.
 2102|       |     * Note, DTLS version numbers are decreasing, use comparison macros.
 2103|       |     *
 2104|       |     * Note that for both lower-bounds we use explicit versions, not
 2105|       |     * (D)TLS_MIN_VERSION.  This is because we don't want to break user
 2106|       |     * configurations.  If the MIN (supported) version ever rises, the user's
 2107|       |     * "floor" remains valid even if no longer available.  We don't expect the
 2108|       |     * MAX ceiling to ever get lower, so making that variable makes sense.
 2109|       |     *
 2110|       |     * We ignore attempts to set bounds on version-inflexible methods,
 2111|       |     * returning success.
 2112|       |     */
 2113|  2.50k|    switch (method_version) {
 2114|      0|    default:
  ------------------
  |  Branch (2114:5): [True: 0, False: 2.50k]
  ------------------
 2115|      0|        break;
 2116|       |
 2117|  2.50k|    case TLS_ANY_VERSION:
  ------------------
  |  |   40|  2.50k|#define TLS_ANY_VERSION 0x10000
  ------------------
  |  Branch (2117:5): [True: 2.50k, False: 0]
  ------------------
 2118|  2.50k|        if (valid_tls)
  ------------------
  |  Branch (2118:13): [True: 2.50k, False: 0]
  ------------------
 2119|  2.50k|            *bound = version;
 2120|  2.50k|        break;
 2121|       |
 2122|      0|    case DTLS_ANY_VERSION:
  ------------------
  |  |   35|      0|#define DTLS_ANY_VERSION 0x1FFFF
  ------------------
  |  Branch (2122:5): [True: 0, False: 2.50k]
  ------------------
 2123|      0|        if (valid_dtls)
  ------------------
  |  Branch (2123:13): [True: 0, False: 0]
  ------------------
 2124|      0|            *bound = version;
 2125|      0|        break;
 2126|  2.50k|    }
 2127|  2.50k|    return 1;
 2128|  2.50k|}
ssl_choose_client_version:
 2317|     74|{
 2318|     74|    const version_info *vent;
 2319|     74|    const version_info *table;
 2320|     74|    int ret, ver_min, ver_max, real_max, origv;
 2321|     74|    SSL *ssl = SSL_CONNECTION_GET_SSL(s);
  ------------------
  |  |   27|     74|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
 2322|       |
 2323|     74|    origv = s->version;
 2324|     74|    s->version = version;
 2325|       |
 2326|       |    /* This will overwrite s->version if the extension is present */
 2327|     74|    if (!tls_parse_extension(s, TLSEXT_IDX_supported_versions,
  ------------------
  |  Branch (2327:9): [True: 4, False: 70]
  ------------------
 2328|     74|            SSL_EXT_TLS1_2_SERVER_HELLO
  ------------------
  |  |  301|     74|#define SSL_EXT_TLS1_2_SERVER_HELLO 0x00100
  ------------------
 2329|     74|                | SSL_EXT_TLS1_3_SERVER_HELLO,
  ------------------
  |  |  302|     74|#define SSL_EXT_TLS1_3_SERVER_HELLO 0x00200
  ------------------
 2330|     74|            extensions,
 2331|     74|            NULL, 0)) {
 2332|      4|        s->version = origv;
 2333|      4|        return 0;
 2334|      4|    }
 2335|       |
 2336|     70|    if (s->hello_retry_request != SSL_HRR_NONE
  ------------------
  |  Branch (2336:9): [True: 0, False: 70]
  ------------------
 2337|      0|        && s->version != TLS1_3_VERSION) {
  ------------------
  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (2337:12): [True: 0, False: 0]
  ------------------
 2338|      0|        s->version = origv;
 2339|      0|        SSLfatal(s, SSL_AD_PROTOCOL_VERSION, SSL_R_WRONG_SSL_VERSION);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 2340|      0|        return 0;
 2341|      0|    }
 2342|       |
 2343|     70|    switch (ssl->method->version) {
 2344|      0|    default:
  ------------------
  |  Branch (2344:5): [True: 0, False: 70]
  ------------------
 2345|      0|        if (s->version != ssl->method->version) {
  ------------------
  |  Branch (2345:13): [True: 0, False: 0]
  ------------------
 2346|      0|            s->version = origv;
 2347|      0|            SSLfatal(s, SSL_AD_PROTOCOL_VERSION, SSL_R_WRONG_SSL_VERSION);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 2348|      0|            return 0;
 2349|      0|        }
 2350|       |        /*
 2351|       |         * If this SSL handle is not from a version flexible method we don't
 2352|       |         * (and never did) check min/max, FIPS or Suite B constraints.  Hope
 2353|       |         * that's OK.  It is up to the caller to not choose fixed protocol
 2354|       |         * versions they don't want.  If not, then easy to fix, just return
 2355|       |         * ssl_method_error(s, s->method)
 2356|       |         */
 2357|      0|        if (!ssl_set_record_protocol_version(s, s->version)) {
  ------------------
  |  Branch (2357:13): [True: 0, False: 0]
  ------------------
 2358|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 2359|      0|            return 0;
 2360|      0|        }
 2361|      0|        return 1;
 2362|     70|    case TLS_ANY_VERSION:
  ------------------
  |  |   40|     70|#define TLS_ANY_VERSION 0x10000
  ------------------
  |  Branch (2362:5): [True: 70, False: 0]
  ------------------
 2363|     70|        table = tls_version_table;
 2364|     70|        break;
 2365|      0|    case DTLS_ANY_VERSION:
  ------------------
  |  |   35|      0|#define DTLS_ANY_VERSION 0x1FFFF
  ------------------
  |  Branch (2365:5): [True: 0, False: 70]
  ------------------
 2366|      0|        table = dtls_version_table;
 2367|      0|        break;
 2368|     70|    }
 2369|       |
 2370|     70|    ret = ssl_get_min_max_version(s, &ver_min, &ver_max, &real_max);
 2371|     70|    if (ret != 0) {
  ------------------
  |  Branch (2371:9): [True: 0, False: 70]
  ------------------
 2372|      0|        s->version = origv;
 2373|      0|        SSLfatal(s, SSL_AD_PROTOCOL_VERSION, ret);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 2374|      0|        return 0;
 2375|      0|    }
 2376|     70|    if (ssl_version_cmp(s, s->version, ver_min) < 0
  ------------------
  |  Branch (2376:9): [True: 1, False: 69]
  ------------------
 2377|     69|        || ssl_version_cmp(s, s->version, ver_max) > 0) {
  ------------------
  |  Branch (2377:12): [True: 21, False: 48]
  ------------------
 2378|     22|        s->version = origv;
 2379|     22|        SSLfatal(s, SSL_AD_PROTOCOL_VERSION, SSL_R_UNSUPPORTED_PROTOCOL);
  ------------------
  |  |  148|     22|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|     22|    (ERR_new(),                                                  \
  |  |  |  |  151|     22|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|     22|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|     22|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 2380|     22|        return 0;
 2381|     22|    }
 2382|       |
 2383|     48|    if ((s->mode & SSL_MODE_SEND_FALLBACK_SCSV) == 0)
  ------------------
  |  |  531|     48|#define SSL_MODE_SEND_FALLBACK_SCSV 0x00000080U
  ------------------
  |  Branch (2383:9): [True: 48, False: 0]
  ------------------
 2384|     48|        real_max = ver_max;
 2385|       |
 2386|       |    /* Check for downgrades */
 2387|       |    /* TODO(DTLSv1.3): Update this code for DTLSv1.3 */
 2388|     48|    if (!SSL_CONNECTION_IS_DTLS(s) && real_max > s->version) {
  ------------------
  |  |  258|     96|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|     48|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|     48|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  ------------------
  |  Branch (2388:9): [True: 48, False: 0]
  |  Branch (2388:39): [True: 43, False: 5]
  ------------------
 2389|       |        /* Signal applies to all versions */
 2390|     43|        if (memcmp(tls11downgrade,
  ------------------
  |  Branch (2390:13): [True: 1, False: 42]
  ------------------
 2391|     43|                s->s3.server_random + SSL3_RANDOM_SIZE
  ------------------
  |  |  137|     43|#define SSL3_RANDOM_SIZE 32
  ------------------
 2392|     43|                    - sizeof(tls11downgrade),
 2393|     43|                sizeof(tls11downgrade))
 2394|     43|            == 0) {
 2395|      1|            s->version = origv;
 2396|      1|            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
  ------------------
  |  |  148|      1|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      1|    (ERR_new(),                                                  \
  |  |  |  |  151|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      1|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 2397|      1|                SSL_R_INAPPROPRIATE_FALLBACK);
 2398|      1|            return 0;
 2399|      1|        }
 2400|       |        /* Only when accepting TLS1.3 */
 2401|     42|        if (real_max == TLS1_3_VERSION
  ------------------
  |  |   27|     84|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (2401:13): [True: 42, False: 0]
  ------------------
 2402|     42|            && memcmp(tls12downgrade,
  ------------------
  |  Branch (2402:16): [True: 1, False: 41]
  ------------------
 2403|     42|                   s->s3.server_random + SSL3_RANDOM_SIZE
  ------------------
  |  |  137|     42|#define SSL3_RANDOM_SIZE 32
  ------------------
 2404|     42|                       - sizeof(tls12downgrade),
 2405|     42|                   sizeof(tls12downgrade))
 2406|     42|                == 0) {
 2407|      1|            s->version = origv;
 2408|      1|            SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER,
  ------------------
  |  |  148|      1|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      1|    (ERR_new(),                                                  \
  |  |  |  |  151|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      1|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 2409|      1|                SSL_R_INAPPROPRIATE_FALLBACK);
 2410|      1|            return 0;
 2411|      1|        }
 2412|     42|    }
 2413|       |
 2414|     87|    for (vent = table; vent->version != 0; ++vent) {
  ------------------
  |  Branch (2414:24): [True: 87, False: 0]
  ------------------
 2415|     87|        if (vent->cmeth == NULL || s->version != vent->version)
  ------------------
  |  Branch (2415:13): [True: 0, False: 87]
  |  Branch (2415:36): [True: 41, False: 46]
  ------------------
 2416|     41|            continue;
 2417|       |
 2418|     46|        ssl->method = vent->cmeth();
 2419|     46|        if (!ssl_set_record_protocol_version(s, s->version)) {
  ------------------
  |  Branch (2419:13): [True: 0, False: 46]
  ------------------
 2420|      0|            SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 2421|      0|            return 0;
 2422|      0|        }
 2423|     46|        return 1;
 2424|     46|    }
 2425|       |
 2426|      0|    s->version = origv;
 2427|       |    SSLfatal(s, SSL_AD_PROTOCOL_VERSION, SSL_R_UNSUPPORTED_PROTOCOL);
  ------------------
  |  |  148|      0|#define SSLfatal(s, al, r) SSLfatal_data((s), (al), (r), NULL)
  |  |  ------------------
  |  |  |  |  150|      0|    (ERR_new(),                                                  \
  |  |  |  |  151|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  152|      0|        ossl_statem_fatal)
  |  |  ------------------
  ------------------
 2428|      0|    return 0;
 2429|     46|}
ssl_get_min_max_version:
 2455|  15.5k|{
 2456|  15.5k|    int version, tmp_real_max;
 2457|  15.5k|    int hole;
 2458|  15.5k|    const SSL_METHOD *method;
 2459|  15.5k|    const version_info *table;
 2460|  15.5k|    const version_info *vent;
 2461|  15.5k|    const SSL *ssl = SSL_CONNECTION_GET_SSL(s);
  ------------------
  |  |   27|  15.5k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
 2462|       |
 2463|  15.5k|    switch (ssl->method->version) {
 2464|      0|    default:
  ------------------
  |  Branch (2464:5): [True: 0, False: 15.5k]
  ------------------
 2465|       |        /*
 2466|       |         * If this SSL handle is not from a version flexible method we don't
 2467|       |         * (and never did) check min/max FIPS or Suite B constraints.  Hope
 2468|       |         * that's OK.  It is up to the caller to not choose fixed protocol
 2469|       |         * versions they don't want.  If not, then easy to fix, just return
 2470|       |         * ssl_method_error(s, s->method)
 2471|       |         */
 2472|      0|        *min_version = *max_version = s->version;
 2473|       |        /*
 2474|       |         * Providing a real_max only makes sense where we're using a version
 2475|       |         * flexible method.
 2476|       |         */
 2477|      0|        if (!ossl_assert(real_max == NULL))
  ------------------
  |  |   52|      0|#define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: " #x, \
  |  |   53|      0|    __FILE__, __LINE__)
  ------------------
  |  Branch (2477:13): [True: 0, False: 0]
  ------------------
 2478|      0|            return ERR_R_INTERNAL_ERROR;
  ------------------
  |  |  355|      0|#define ERR_R_INTERNAL_ERROR (259 | ERR_R_FATAL)
  |  |  ------------------
  |  |  |  |  351|      0|#define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  238|      0|#define ERR_RFLAG_FATAL (0x1 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ERR_R_FATAL (ERR_RFLAG_FATAL | ERR_RFLAG_COMMON)
  |  |  |  |  ------------------
  |  |  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2479|      0|        return 0;
 2480|  15.5k|    case TLS_ANY_VERSION:
  ------------------
  |  |   40|  15.5k|#define TLS_ANY_VERSION 0x10000
  ------------------
  |  Branch (2480:5): [True: 15.5k, False: 0]
  ------------------
 2481|  15.5k|        table = tls_version_table;
 2482|  15.5k|        break;
 2483|      0|    case DTLS_ANY_VERSION:
  ------------------
  |  |   35|      0|#define DTLS_ANY_VERSION 0x1FFFF
  ------------------
  |  Branch (2483:5): [True: 0, False: 15.5k]
  ------------------
 2484|      0|        table = dtls_version_table;
 2485|      0|        break;
 2486|  15.5k|    }
 2487|       |
 2488|       |    /*
 2489|       |     * SSL_OP_NO_X disables all protocols above X *if* there are some protocols
 2490|       |     * below X enabled. This is required in order to maintain the "version
 2491|       |     * capability" vector contiguous. Any versions with a NULL client method
 2492|       |     * (protocol version client is disabled at compile-time) is also a "hole".
 2493|       |     *
 2494|       |     * Our initial state is hole == 1, version == 0.  That is, versions above
 2495|       |     * the first version in the method table are disabled (a "hole" above
 2496|       |     * the valid protocol entries) and we don't have a selected version yet.
 2497|       |     *
 2498|       |     * Whenever "hole == 1", and we hit an enabled method, its version becomes
 2499|       |     * the selected version.  We're no longer in a hole, so "hole" becomes 0.
 2500|       |     *
 2501|       |     * If "hole == 0" and we hit an enabled method, we support a contiguous
 2502|       |     * range of at least two methods.  If we hit a disabled method,
 2503|       |     * then hole becomes true again, but nothing else changes yet,
 2504|       |     * because all the remaining methods may be disabled too.
 2505|       |     * If we again hit an enabled method after the new hole, it becomes
 2506|       |     * selected, as we start from scratch.
 2507|       |     */
 2508|  15.5k|    *min_version = version = 0;
 2509|  15.5k|    hole = 1;
 2510|  15.5k|    if (real_max != NULL)
  ------------------
  |  Branch (2510:9): [True: 70, False: 15.4k]
  ------------------
 2511|     70|        *real_max = 0;
 2512|  15.5k|    tmp_real_max = 0;
 2513|  93.0k|    for (vent = table; vent->version != 0; ++vent) {
  ------------------
  |  Branch (2513:24): [True: 77.5k, False: 15.5k]
  ------------------
 2514|       |        /*
 2515|       |         * A table entry with a NULL client method is still a hole in the
 2516|       |         * "version capability" vector.
 2517|       |         */
 2518|  77.5k|        if (vent->cmeth == NULL) {
  ------------------
  |  Branch (2518:13): [True: 0, False: 77.5k]
  ------------------
 2519|      0|            hole = 1;
 2520|      0|            tmp_real_max = 0;
 2521|      0|            continue;
 2522|      0|        }
 2523|  77.5k|        method = vent->cmeth();
 2524|       |
 2525|  77.5k|        if (hole == 1 && tmp_real_max == 0)
  ------------------
  |  Branch (2525:13): [True: 46.6k, False: 30.9k]
  |  Branch (2525:26): [True: 15.5k, False: 31.0k]
  ------------------
 2526|  15.5k|            tmp_real_max = vent->version;
 2527|       |
 2528|  77.5k|        if (ssl_method_error(s, method) != 0) {
  ------------------
  |  Branch (2528:13): [True: 46.6k, False: 30.9k]
  ------------------
 2529|  46.6k|            hole = 1;
 2530|  46.6k|        } else if (!hole) {
  ------------------
  |  Branch (2530:20): [True: 15.4k, False: 15.5k]
  ------------------
 2531|  15.4k|            *min_version = method->version;
 2532|  15.5k|        } else {
 2533|  15.5k|            if (real_max != NULL && tmp_real_max != 0)
  ------------------
  |  Branch (2533:17): [True: 70, False: 15.4k]
  |  Branch (2533:37): [True: 70, False: 0]
  ------------------
 2534|     70|                *real_max = tmp_real_max;
 2535|  15.5k|            version = method->version;
 2536|  15.5k|            *min_version = version;
 2537|  15.5k|            hole = 0;
 2538|  15.5k|        }
 2539|  77.5k|    }
 2540|       |
 2541|  15.5k|    *max_version = version;
 2542|       |
 2543|       |    /* Fail if everything is disabled */
 2544|  15.5k|    if (version == 0)
  ------------------
  |  Branch (2544:9): [True: 4, False: 15.5k]
  ------------------
 2545|      4|        return SSL_R_NO_PROTOCOLS_AVAILABLE;
  ------------------
  |  |  205|      4|#define SSL_R_NO_PROTOCOLS_AVAILABLE 191
  ------------------
 2546|       |
 2547|  15.5k|    return 0;
 2548|  15.5k|}
ssl_set_client_hello_version:
 2559|  1.76k|{
 2560|  1.76k|    int ver_min, ver_max, ret;
 2561|       |
 2562|       |    /*
 2563|       |     * In a renegotiation we always send the same client_version that we sent
 2564|       |     * last time, regardless of which version we eventually negotiated.
 2565|       |     */
 2566|  1.76k|    if (!SSL_IS_FIRST_HANDSHAKE(s))
  ------------------
  |  |  277|  1.76k|#define SSL_IS_FIRST_HANDSHAKE(s) ((s)->s3.tmp.finish_md_len == 0 \
  |  |  ------------------
  |  |  |  Branch (277:36): [True: 1.76k, False: 0]
  |  |  ------------------
  |  |  278|  1.76k|    || (s)->s3.tmp.peer_finish_md_len == 0)
  |  |  ------------------
  |  |  |  Branch (278:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2567|      0|        return 0;
 2568|       |
 2569|  1.76k|    ret = ssl_get_min_max_version(s, &ver_min, &ver_max, NULL);
 2570|       |
 2571|  1.76k|    if (ret != 0)
  ------------------
  |  Branch (2571:9): [True: 0, False: 1.76k]
  ------------------
 2572|      0|        return ret;
 2573|       |
 2574|  1.76k|    s->version = ver_max;
 2575|       |
 2576|  1.76k|    if (SSL_CONNECTION_IS_DTLS(s)) {
  ------------------
  |  |  258|  1.76k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  1.76k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  1.76k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 1.76k]
  |  |  ------------------
  ------------------
 2577|      0|        if (ver_max == DTLS1_BAD_VER) {
  ------------------
  |  |   30|      0|#define DTLS1_BAD_VER 0x0100
  ------------------
  |  Branch (2577:13): [True: 0, False: 0]
  ------------------
 2578|       |            /*
 2579|       |             * Even though this is technically before version negotiation,
 2580|       |             * because we have asked for DTLS1_BAD_VER we will never negotiate
 2581|       |             * anything else, and this has impacts on the record layer for when
 2582|       |             * we read the ServerHello. So we need to tell the record layer
 2583|       |             * about this immediately.
 2584|       |             */
 2585|      0|            if (!ssl_set_record_protocol_version(s, ver_max))
  ------------------
  |  Branch (2585:17): [True: 0, False: 0]
  ------------------
 2586|      0|                return 0;
 2587|      0|        }
 2588|  1.76k|    } else if (ver_max > TLS1_2_VERSION) {
  ------------------
  |  |   26|  1.76k|#define TLS1_2_VERSION 0x0303
  ------------------
  |  Branch (2588:16): [True: 1.75k, False: 14]
  ------------------
 2589|       |        /* TLS1.3 always uses TLS1.2 in the legacy_version field */
 2590|  1.75k|        ver_max = TLS1_2_VERSION;
  ------------------
  |  |   26|  1.75k|#define TLS1_2_VERSION 0x0303
  ------------------
 2591|  1.75k|    }
 2592|       |
 2593|  1.76k|    s->client_version = ver_max;
 2594|  1.76k|    return 0;
 2595|  1.76k|}
get_ca_names:
 2742|  1.63k|{
 2743|  1.63k|    const STACK_OF(X509_NAME) *ca_sk = NULL;
 2744|  1.63k|    SSL *ssl = SSL_CONNECTION_GET_SSL(s);
  ------------------
  |  |   27|  1.63k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
 2745|       |
 2746|  1.63k|    if (s->server) {
  ------------------
  |  Branch (2746:9): [True: 0, False: 1.63k]
  ------------------
 2747|      0|        ca_sk = SSL_get_client_CA_list(ssl);
 2748|      0|        if (ca_sk != NULL && sk_X509_NAME_num(ca_sk) == 0)
  ------------------
  |  |   56|      0|#define sk_X509_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_sk_type(sk))
  ------------------
  |  Branch (2748:13): [True: 0, False: 0]
  |  Branch (2748:30): [True: 0, False: 0]
  ------------------
 2749|      0|            ca_sk = NULL;
 2750|      0|    }
 2751|       |
 2752|  1.63k|    if (ca_sk == NULL)
  ------------------
  |  Branch (2752:9): [True: 1.63k, False: 0]
  ------------------
 2753|  1.63k|        ca_sk = SSL_get0_CA_list(ssl);
 2754|       |
 2755|  1.63k|    return ca_sk;
 2756|  1.63k|}
statem_lib.c:ssl_method_error:
 1901|  77.5k|{
 1902|  77.5k|    int version = method->version;
 1903|       |
 1904|  77.5k|    if ((s->min_proto_version != 0 && ssl_version_cmp(s, version, s->min_proto_version) < 0) || ssl_security(s, SSL_SECOP_VERSION, 0, version, NULL) == 0)
  ------------------
  |  | 2766|  31.2k|#define SSL_SECOP_VERSION (9 | SSL_SECOP_OTHER_NONE)
  |  |  ------------------
  |  |  |  | 2737|  31.2k|#define SSL_SECOP_OTHER_NONE 0
  |  |  ------------------
  ------------------
  |  Branch (1904:10): [True: 77.5k, False: 0]
  |  Branch (1904:39): [True: 46.3k, False: 31.2k]
  |  Branch (1904:97): [True: 147, False: 31.0k]
  ------------------
 1905|  46.4k|        return SSL_R_VERSION_TOO_LOW;
  ------------------
  |  |  367|  46.4k|#define SSL_R_VERSION_TOO_LOW 396
  ------------------
 1906|       |
 1907|  31.0k|    if (s->max_proto_version != 0 && ssl_version_cmp(s, version, s->max_proto_version) > 0)
  ------------------
  |  Branch (1907:9): [True: 358, False: 30.7k]
  |  Branch (1907:38): [True: 154, False: 204]
  ------------------
 1908|    154|        return SSL_R_VERSION_TOO_HIGH;
  ------------------
  |  |  366|    154|#define SSL_R_VERSION_TOO_HIGH 166
  ------------------
 1909|       |
 1910|  30.9k|    if ((s->options & method->mask) != 0)
  ------------------
  |  Branch (1910:9): [True: 0, False: 30.9k]
  ------------------
 1911|      0|        return SSL_R_UNSUPPORTED_PROTOCOL;
  ------------------
  |  |  361|      0|#define SSL_R_UNSUPPORTED_PROTOCOL 258
  ------------------
 1912|  30.9k|    if ((method->flags & SSL_METHOD_NO_SUITEB) != 0 && tls1_suiteb(s))
  ------------------
  |  | 2342|  30.9k|#define SSL_METHOD_NO_SUITEB (1U << 1)
  ------------------
                  if ((method->flags & SSL_METHOD_NO_SUITEB) != 0 && tls1_suiteb(s))
  ------------------
  |  | 2029|    102|#define tls1_suiteb(s) (s->cert->cert_flags & SSL_CERT_FLAG_SUITEB_128_LOS)
  |  |  ------------------
  |  |  |  |  562|    102|#define SSL_CERT_FLAG_SUITEB_128_LOS 0x30000
  |  |  ------------------
  |  |  |  Branch (2029:24): [True: 0, False: 102]
  |  |  ------------------
  ------------------
  |  Branch (1912:9): [True: 102, False: 30.8k]
  ------------------
 1913|      0|        return SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE;
  ------------------
  |  |   25|      0|#define SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE 158
  ------------------
 1914|       |
 1915|  30.9k|    return 0;
 1916|  30.9k|}

tls1_alert_code:
  526|  1.61k|{
  527|  1.61k|    switch (code) {
  528|      0|    case SSL_AD_CLOSE_NOTIFY:
  ------------------
  |  | 1209|      0|#define SSL_AD_CLOSE_NOTIFY SSL3_AD_CLOSE_NOTIFY
  |  |  ------------------
  |  |  |  |  252|      0|#define SSL3_AD_CLOSE_NOTIFY 0
  |  |  ------------------
  ------------------
  |  Branch (528:5): [True: 0, False: 1.61k]
  ------------------
  529|      0|        return SSL3_AD_CLOSE_NOTIFY;
  ------------------
  |  |  252|      0|#define SSL3_AD_CLOSE_NOTIFY 0
  ------------------
  530|     27|    case SSL_AD_UNEXPECTED_MESSAGE:
  ------------------
  |  | 1211|     27|#define SSL_AD_UNEXPECTED_MESSAGE SSL3_AD_UNEXPECTED_MESSAGE
  |  |  ------------------
  |  |  |  |  253|     27|#define SSL3_AD_UNEXPECTED_MESSAGE 10 /* fatal */
  |  |  ------------------
  ------------------
  |  Branch (530:5): [True: 27, False: 1.58k]
  ------------------
  531|     27|        return SSL3_AD_UNEXPECTED_MESSAGE;
  ------------------
  |  |  253|     27|#define SSL3_AD_UNEXPECTED_MESSAGE 10 /* fatal */
  ------------------
  532|      0|    case SSL_AD_BAD_RECORD_MAC:
  ------------------
  |  | 1213|      0|#define SSL_AD_BAD_RECORD_MAC SSL3_AD_BAD_RECORD_MAC
  |  |  ------------------
  |  |  |  |  254|      0|#define SSL3_AD_BAD_RECORD_MAC 20 /* fatal */
  |  |  ------------------
  ------------------
  |  Branch (532:5): [True: 0, False: 1.61k]
  ------------------
  533|      0|        return SSL3_AD_BAD_RECORD_MAC;
  ------------------
  |  |  254|      0|#define SSL3_AD_BAD_RECORD_MAC 20 /* fatal */
  ------------------
  534|      0|    case SSL_AD_DECRYPTION_FAILED:
  ------------------
  |  | 1214|      0|#define SSL_AD_DECRYPTION_FAILED TLS1_AD_DECRYPTION_FAILED
  |  |  ------------------
  |  |  |  |   57|      0|#define TLS1_AD_DECRYPTION_FAILED 21
  |  |  ------------------
  ------------------
  |  Branch (534:5): [True: 0, False: 1.61k]
  ------------------
  535|      0|        return TLS1_AD_DECRYPTION_FAILED;
  ------------------
  |  |   57|      0|#define TLS1_AD_DECRYPTION_FAILED 21
  ------------------
  536|      3|    case SSL_AD_RECORD_OVERFLOW:
  ------------------
  |  | 1215|      3|#define SSL_AD_RECORD_OVERFLOW TLS1_AD_RECORD_OVERFLOW
  |  |  ------------------
  |  |  |  |   58|      3|#define TLS1_AD_RECORD_OVERFLOW 22
  |  |  ------------------
  ------------------
  |  Branch (536:5): [True: 3, False: 1.61k]
  ------------------
  537|      3|        return TLS1_AD_RECORD_OVERFLOW;
  ------------------
  |  |   58|      3|#define TLS1_AD_RECORD_OVERFLOW 22
  ------------------
  538|      0|    case SSL_AD_DECOMPRESSION_FAILURE:
  ------------------
  |  | 1217|      0|#define SSL_AD_DECOMPRESSION_FAILURE SSL3_AD_DECOMPRESSION_FAILURE
  |  |  ------------------
  |  |  |  |  255|      0|#define SSL3_AD_DECOMPRESSION_FAILURE 30 /* fatal */
  |  |  ------------------
  ------------------
  |  Branch (538:5): [True: 0, False: 1.61k]
  ------------------
  539|      0|        return SSL3_AD_DECOMPRESSION_FAILURE;
  ------------------
  |  |  255|      0|#define SSL3_AD_DECOMPRESSION_FAILURE 30 /* fatal */
  ------------------
  540|      6|    case SSL_AD_HANDSHAKE_FAILURE:
  ------------------
  |  | 1219|      6|#define SSL_AD_HANDSHAKE_FAILURE SSL3_AD_HANDSHAKE_FAILURE
  |  |  ------------------
  |  |  |  |  256|      6|#define SSL3_AD_HANDSHAKE_FAILURE 40 /* fatal */
  |  |  ------------------
  ------------------
  |  Branch (540:5): [True: 6, False: 1.60k]
  ------------------
  541|      6|        return SSL3_AD_HANDSHAKE_FAILURE;
  ------------------
  |  |  256|      6|#define SSL3_AD_HANDSHAKE_FAILURE 40 /* fatal */
  ------------------
  542|      0|    case SSL_AD_NO_CERTIFICATE:
  ------------------
  |  | 1221|      0|#define SSL_AD_NO_CERTIFICATE SSL3_AD_NO_CERTIFICATE
  |  |  ------------------
  |  |  |  |  257|      0|#define SSL3_AD_NO_CERTIFICATE 41
  |  |  ------------------
  ------------------
  |  Branch (542:5): [True: 0, False: 1.61k]
  ------------------
  543|      0|        return -1;
  544|      0|    case SSL_AD_BAD_CERTIFICATE:
  ------------------
  |  | 1222|      0|#define SSL_AD_BAD_CERTIFICATE SSL3_AD_BAD_CERTIFICATE
  |  |  ------------------
  |  |  |  |  258|      0|#define SSL3_AD_BAD_CERTIFICATE 42
  |  |  ------------------
  ------------------
  |  Branch (544:5): [True: 0, False: 1.61k]
  ------------------
  545|      0|        return SSL3_AD_BAD_CERTIFICATE;
  ------------------
  |  |  258|      0|#define SSL3_AD_BAD_CERTIFICATE 42
  ------------------
  546|      0|    case SSL_AD_UNSUPPORTED_CERTIFICATE:
  ------------------
  |  | 1223|      0|#define SSL_AD_UNSUPPORTED_CERTIFICATE SSL3_AD_UNSUPPORTED_CERTIFICATE
  |  |  ------------------
  |  |  |  |  259|      0|#define SSL3_AD_UNSUPPORTED_CERTIFICATE 43
  |  |  ------------------
  ------------------
  |  Branch (546:5): [True: 0, False: 1.61k]
  ------------------
  547|      0|        return SSL3_AD_UNSUPPORTED_CERTIFICATE;
  ------------------
  |  |  259|      0|#define SSL3_AD_UNSUPPORTED_CERTIFICATE 43
  ------------------
  548|      0|    case SSL_AD_CERTIFICATE_REVOKED:
  ------------------
  |  | 1224|      0|#define SSL_AD_CERTIFICATE_REVOKED SSL3_AD_CERTIFICATE_REVOKED
  |  |  ------------------
  |  |  |  |  260|      0|#define SSL3_AD_CERTIFICATE_REVOKED 44
  |  |  ------------------
  ------------------
  |  Branch (548:5): [True: 0, False: 1.61k]
  ------------------
  549|      0|        return SSL3_AD_CERTIFICATE_REVOKED;
  ------------------
  |  |  260|      0|#define SSL3_AD_CERTIFICATE_REVOKED 44
  ------------------
  550|      0|    case SSL_AD_CERTIFICATE_EXPIRED:
  ------------------
  |  | 1225|      0|#define SSL_AD_CERTIFICATE_EXPIRED SSL3_AD_CERTIFICATE_EXPIRED
  |  |  ------------------
  |  |  |  |  261|      0|#define SSL3_AD_CERTIFICATE_EXPIRED 45
  |  |  ------------------
  ------------------
  |  Branch (550:5): [True: 0, False: 1.61k]
  ------------------
  551|      0|        return SSL3_AD_CERTIFICATE_EXPIRED;
  ------------------
  |  |  261|      0|#define SSL3_AD_CERTIFICATE_EXPIRED 45
  ------------------
  552|      0|    case SSL_AD_CERTIFICATE_UNKNOWN:
  ------------------
  |  | 1226|      0|#define SSL_AD_CERTIFICATE_UNKNOWN SSL3_AD_CERTIFICATE_UNKNOWN
  |  |  ------------------
  |  |  |  |  262|      0|#define SSL3_AD_CERTIFICATE_UNKNOWN 46
  |  |  ------------------
  ------------------
  |  Branch (552:5): [True: 0, False: 1.61k]
  ------------------
  553|      0|        return SSL3_AD_CERTIFICATE_UNKNOWN;
  ------------------
  |  |  262|      0|#define SSL3_AD_CERTIFICATE_UNKNOWN 46
  ------------------
  554|     72|    case SSL_AD_ILLEGAL_PARAMETER:
  ------------------
  |  | 1228|     72|#define SSL_AD_ILLEGAL_PARAMETER SSL3_AD_ILLEGAL_PARAMETER
  |  |  ------------------
  |  |  |  |  263|     72|#define SSL3_AD_ILLEGAL_PARAMETER 47 /* fatal */
  |  |  ------------------
  ------------------
  |  Branch (554:5): [True: 72, False: 1.54k]
  ------------------
  555|     72|        return SSL3_AD_ILLEGAL_PARAMETER;
  ------------------
  |  |  263|     72|#define SSL3_AD_ILLEGAL_PARAMETER 47 /* fatal */
  ------------------
  556|      0|    case SSL_AD_UNKNOWN_CA:
  ------------------
  |  | 1230|      0|#define SSL_AD_UNKNOWN_CA TLS1_AD_UNKNOWN_CA
  |  |  ------------------
  |  |  |  |   59|      0|#define TLS1_AD_UNKNOWN_CA 48 /* fatal */
  |  |  ------------------
  ------------------
  |  Branch (556:5): [True: 0, False: 1.61k]
  ------------------
  557|      0|        return TLS1_AD_UNKNOWN_CA;
  ------------------
  |  |   59|      0|#define TLS1_AD_UNKNOWN_CA 48 /* fatal */
  ------------------
  558|      0|    case SSL_AD_ACCESS_DENIED:
  ------------------
  |  | 1232|      0|#define SSL_AD_ACCESS_DENIED TLS1_AD_ACCESS_DENIED
  |  |  ------------------
  |  |  |  |   60|      0|#define TLS1_AD_ACCESS_DENIED 49 /* fatal */
  |  |  ------------------
  ------------------
  |  Branch (558:5): [True: 0, False: 1.61k]
  ------------------
  559|      0|        return TLS1_AD_ACCESS_DENIED;
  ------------------
  |  |   60|      0|#define TLS1_AD_ACCESS_DENIED 49 /* fatal */
  ------------------
  560|  1.32k|    case SSL_AD_DECODE_ERROR:
  ------------------
  |  | 1234|  1.32k|#define SSL_AD_DECODE_ERROR TLS1_AD_DECODE_ERROR
  |  |  ------------------
  |  |  |  |   61|  1.32k|#define TLS1_AD_DECODE_ERROR 50 /* fatal */
  |  |  ------------------
  ------------------
  |  Branch (560:5): [True: 1.32k, False: 289]
  ------------------
  561|  1.32k|        return TLS1_AD_DECODE_ERROR;
  ------------------
  |  |   61|  1.32k|#define TLS1_AD_DECODE_ERROR 50 /* fatal */
  ------------------
  562|      0|    case SSL_AD_DECRYPT_ERROR:
  ------------------
  |  | 1235|      0|#define SSL_AD_DECRYPT_ERROR TLS1_AD_DECRYPT_ERROR
  |  |  ------------------
  |  |  |  |   62|      0|#define TLS1_AD_DECRYPT_ERROR 51
  |  |  ------------------
  ------------------
  |  Branch (562:5): [True: 0, False: 1.61k]
  ------------------
  563|      0|        return TLS1_AD_DECRYPT_ERROR;
  ------------------
  |  |   62|      0|#define TLS1_AD_DECRYPT_ERROR 51
  ------------------
  564|      0|    case SSL_AD_EXPORT_RESTRICTION:
  ------------------
  |  | 1237|      0|#define SSL_AD_EXPORT_RESTRICTION TLS1_AD_EXPORT_RESTRICTION
  |  |  ------------------
  |  |  |  |   63|      0|#define TLS1_AD_EXPORT_RESTRICTION 60 /* fatal */
  |  |  ------------------
  ------------------
  |  Branch (564:5): [True: 0, False: 1.61k]
  ------------------
  565|      0|        return TLS1_AD_EXPORT_RESTRICTION;
  ------------------
  |  |   63|      0|#define TLS1_AD_EXPORT_RESTRICTION 60 /* fatal */
  ------------------
  566|     49|    case SSL_AD_PROTOCOL_VERSION:
  ------------------
  |  | 1239|     49|#define SSL_AD_PROTOCOL_VERSION TLS1_AD_PROTOCOL_VERSION
  |  |  ------------------
  |  |  |  |   64|     49|#define TLS1_AD_PROTOCOL_VERSION 70 /* fatal */
  |  |  ------------------
  ------------------
  |  Branch (566:5): [True: 49, False: 1.56k]
  ------------------
  567|     49|        return TLS1_AD_PROTOCOL_VERSION;
  ------------------
  |  |   64|     49|#define TLS1_AD_PROTOCOL_VERSION 70 /* fatal */
  ------------------
  568|      0|    case SSL_AD_INSUFFICIENT_SECURITY:
  ------------------
  |  | 1241|      0|#define SSL_AD_INSUFFICIENT_SECURITY TLS1_AD_INSUFFICIENT_SECURITY
  |  |  ------------------
  |  |  |  |   65|      0|#define TLS1_AD_INSUFFICIENT_SECURITY 71 /* fatal */
  |  |  ------------------
  ------------------
  |  Branch (568:5): [True: 0, False: 1.61k]
  ------------------
  569|      0|        return TLS1_AD_INSUFFICIENT_SECURITY;
  ------------------
  |  |   65|      0|#define TLS1_AD_INSUFFICIENT_SECURITY 71 /* fatal */
  ------------------
  570|    123|    case SSL_AD_INTERNAL_ERROR:
  ------------------
  |  | 1243|    123|#define SSL_AD_INTERNAL_ERROR TLS1_AD_INTERNAL_ERROR
  |  |  ------------------
  |  |  |  |   66|    123|#define TLS1_AD_INTERNAL_ERROR 80 /* fatal */
  |  |  ------------------
  ------------------
  |  Branch (570:5): [True: 123, False: 1.49k]
  ------------------
  571|    123|        return TLS1_AD_INTERNAL_ERROR;
  ------------------
  |  |   66|    123|#define TLS1_AD_INTERNAL_ERROR 80 /* fatal */
  ------------------
  572|      0|    case SSL_AD_USER_CANCELLED:
  ------------------
  |  | 1244|      0|#define SSL_AD_USER_CANCELLED TLS1_AD_USER_CANCELLED
  |  |  ------------------
  |  |  |  |   68|      0|#define TLS1_AD_USER_CANCELLED 90
  |  |  ------------------
  ------------------
  |  Branch (572:5): [True: 0, False: 1.61k]
  ------------------
  573|      0|        return TLS1_AD_USER_CANCELLED;
  ------------------
  |  |   68|      0|#define TLS1_AD_USER_CANCELLED 90
  ------------------
  574|      0|    case SSL_AD_NO_RENEGOTIATION:
  ------------------
  |  | 1245|      0|#define SSL_AD_NO_RENEGOTIATION TLS1_AD_NO_RENEGOTIATION
  |  |  ------------------
  |  |  |  |   69|      0|#define TLS1_AD_NO_RENEGOTIATION 100
  |  |  ------------------
  ------------------
  |  Branch (574:5): [True: 0, False: 1.61k]
  ------------------
  575|      0|        return TLS1_AD_NO_RENEGOTIATION;
  ------------------
  |  |   69|      0|#define TLS1_AD_NO_RENEGOTIATION 100
  ------------------
  576|      9|    case SSL_AD_UNSUPPORTED_EXTENSION:
  ------------------
  |  | 1248|      9|#define SSL_AD_UNSUPPORTED_EXTENSION TLS1_AD_UNSUPPORTED_EXTENSION
  |  |  ------------------
  |  |  |  |   74|      9|#define TLS1_AD_UNSUPPORTED_EXTENSION 110
  |  |  ------------------
  ------------------
  |  Branch (576:5): [True: 9, False: 1.60k]
  ------------------
  577|      9|        return TLS1_AD_UNSUPPORTED_EXTENSION;
  ------------------
  |  |   74|      9|#define TLS1_AD_UNSUPPORTED_EXTENSION 110
  ------------------
  578|      0|    case SSL_AD_CERTIFICATE_UNOBTAINABLE:
  ------------------
  |  | 1249|      0|#define SSL_AD_CERTIFICATE_UNOBTAINABLE TLS1_AD_CERTIFICATE_UNOBTAINABLE
  |  |  ------------------
  |  |  |  |   75|      0|#define TLS1_AD_CERTIFICATE_UNOBTAINABLE 111
  |  |  ------------------
  ------------------
  |  Branch (578:5): [True: 0, False: 1.61k]
  ------------------
  579|      0|        return TLS1_AD_CERTIFICATE_UNOBTAINABLE;
  ------------------
  |  |   75|      0|#define TLS1_AD_CERTIFICATE_UNOBTAINABLE 111
  ------------------
  580|      0|    case SSL_AD_UNRECOGNIZED_NAME:
  ------------------
  |  | 1250|      0|#define SSL_AD_UNRECOGNIZED_NAME TLS1_AD_UNRECOGNIZED_NAME
  |  |  ------------------
  |  |  |  |   76|      0|#define TLS1_AD_UNRECOGNIZED_NAME 112
  |  |  ------------------
  ------------------
  |  Branch (580:5): [True: 0, False: 1.61k]
  ------------------
  581|      0|        return TLS1_AD_UNRECOGNIZED_NAME;
  ------------------
  |  |   76|      0|#define TLS1_AD_UNRECOGNIZED_NAME 112
  ------------------
  582|      0|    case SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE:
  ------------------
  |  | 1251|      0|#define SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE
  |  |  ------------------
  |  |  |  |   77|      0|#define TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE 113
  |  |  ------------------
  ------------------
  |  Branch (582:5): [True: 0, False: 1.61k]
  ------------------
  583|      0|        return TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE;
  ------------------
  |  |   77|      0|#define TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE 113
  ------------------
  584|      0|    case SSL_AD_BAD_CERTIFICATE_HASH_VALUE:
  ------------------
  |  | 1252|      0|#define SSL_AD_BAD_CERTIFICATE_HASH_VALUE TLS1_AD_BAD_CERTIFICATE_HASH_VALUE
  |  |  ------------------
  |  |  |  |   78|      0|#define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114
  |  |  ------------------
  ------------------
  |  Branch (584:5): [True: 0, False: 1.61k]
  ------------------
  585|      0|        return TLS1_AD_BAD_CERTIFICATE_HASH_VALUE;
  ------------------
  |  |   78|      0|#define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114
  ------------------
  586|      0|    case SSL_AD_UNKNOWN_PSK_IDENTITY:
  ------------------
  |  | 1254|      0|#define SSL_AD_UNKNOWN_PSK_IDENTITY TLS1_AD_UNKNOWN_PSK_IDENTITY
  |  |  ------------------
  |  |  |  |   79|      0|#define TLS1_AD_UNKNOWN_PSK_IDENTITY 115 /* fatal */
  |  |  ------------------
  ------------------
  |  Branch (586:5): [True: 0, False: 1.61k]
  ------------------
  587|      0|        return TLS1_AD_UNKNOWN_PSK_IDENTITY;
  ------------------
  |  |   79|      0|#define TLS1_AD_UNKNOWN_PSK_IDENTITY 115 /* fatal */
  ------------------
  588|      0|    case SSL_AD_INAPPROPRIATE_FALLBACK:
  ------------------
  |  | 1256|      0|#define SSL_AD_INAPPROPRIATE_FALLBACK TLS1_AD_INAPPROPRIATE_FALLBACK
  |  |  ------------------
  |  |  |  |   67|      0|#define TLS1_AD_INAPPROPRIATE_FALLBACK 86 /* fatal */
  |  |  ------------------
  ------------------
  |  Branch (588:5): [True: 0, False: 1.61k]
  ------------------
  589|      0|        return TLS1_AD_INAPPROPRIATE_FALLBACK;
  ------------------
  |  |   67|      0|#define TLS1_AD_INAPPROPRIATE_FALLBACK 86 /* fatal */
  ------------------
  590|      0|    case SSL_AD_NO_APPLICATION_PROTOCOL:
  ------------------
  |  | 1257|      0|#define SSL_AD_NO_APPLICATION_PROTOCOL TLS1_AD_NO_APPLICATION_PROTOCOL
  |  |  ------------------
  |  |  |  |   80|      0|#define TLS1_AD_NO_APPLICATION_PROTOCOL 120 /* fatal */
  |  |  ------------------
  ------------------
  |  Branch (590:5): [True: 0, False: 1.61k]
  ------------------
  591|      0|        return TLS1_AD_NO_APPLICATION_PROTOCOL;
  ------------------
  |  |   80|      0|#define TLS1_AD_NO_APPLICATION_PROTOCOL 120 /* fatal */
  ------------------
  592|      0|    case SSL_AD_CERTIFICATE_REQUIRED:
  ------------------
  |  | 1247|      0|#define SSL_AD_CERTIFICATE_REQUIRED TLS13_AD_CERTIFICATE_REQUIRED
  |  |  ------------------
  |  |  |  |   72|      0|#define TLS13_AD_CERTIFICATE_REQUIRED 116 /* fatal */
  |  |  ------------------
  ------------------
  |  Branch (592:5): [True: 0, False: 1.61k]
  ------------------
  593|      0|        return SSL_AD_HANDSHAKE_FAILURE;
  ------------------
  |  | 1219|      0|#define SSL_AD_HANDSHAKE_FAILURE SSL3_AD_HANDSHAKE_FAILURE
  |  |  ------------------
  |  |  |  |  256|      0|#define SSL3_AD_HANDSHAKE_FAILURE 40 /* fatal */
  |  |  ------------------
  ------------------
  594|      0|    case TLS13_AD_MISSING_EXTENSION:
  ------------------
  |  |   71|      0|#define TLS13_AD_MISSING_EXTENSION 109 /* fatal */
  ------------------
  |  Branch (594:5): [True: 0, False: 1.61k]
  ------------------
  595|      0|        return SSL_AD_HANDSHAKE_FAILURE;
  ------------------
  |  | 1219|      0|#define SSL_AD_HANDSHAKE_FAILURE SSL3_AD_HANDSHAKE_FAILURE
  |  |  ------------------
  |  |  |  |  256|      0|#define SSL3_AD_HANDSHAKE_FAILURE 40 /* fatal */
  |  |  ------------------
  ------------------
  596|      0|    default:
  ------------------
  |  Branch (596:5): [True: 0, False: 1.61k]
  ------------------
  597|      0|        return -1;
  598|  1.61k|    }
  599|  1.61k|}

tls1_default_timeout:
   97|  2.56k|{
   98|       |    /*
   99|       |     * 2 hours, the 24 hours mentioned in the TLSv1 spec is way too long for
  100|       |     * http, the cache would over fill
  101|       |     */
  102|  2.56k|    return ossl_seconds2time(60 * 60 * 2);
  ------------------
  |  |   42|  2.56k|#define ossl_seconds2time(s) ossl_ticks2time((s) * OSSL_TIME_SECOND)
  |  |  ------------------
  |  |  |  |   31|  2.56k|#define OSSL_TIME_SECOND ((uint64_t)1000000000)
  |  |  ------------------
  ------------------
  103|  2.56k|}
tls1_new:
  106|  1.77k|{
  107|  1.77k|    if (!ssl3_new(s))
  ------------------
  |  Branch (107:9): [True: 0, False: 1.77k]
  ------------------
  108|      0|        return 0;
  109|  1.77k|    if (!s->method->ssl_clear(s))
  ------------------
  |  Branch (109:9): [True: 0, False: 1.77k]
  ------------------
  110|      0|        return 0;
  111|       |
  112|  1.77k|    return 1;
  113|  1.77k|}
tls1_free:
  116|  1.77k|{
  117|  1.77k|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  ------------------
  |  |   39|  1.77k|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|  1.77k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 1.77k]
  |  |  |  |  ------------------
  |  |  |  |   33|  1.77k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  1.77k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 1.77k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  1.77k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  1.77k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
  118|       |
  119|  1.77k|    if (sc == NULL)
  ------------------
  |  Branch (119:9): [True: 0, False: 1.77k]
  ------------------
  120|      0|        return;
  121|       |
  122|  1.77k|    OPENSSL_free(sc->ext.session_ticket);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  123|  1.77k|    ssl3_free(s);
  124|  1.77k|}
tls1_clear:
  127|  7.08k|{
  128|  7.08k|    SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  ------------------
  |  |   39|  7.08k|    SSL_CONNECTION_FROM_SSL_int(ssl, SSL_CONNECTION_NO_CONST)
  |  |  ------------------
  |  |  |  |   32|  7.08k|    ((ssl) == NULL ? NULL                                                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (32:6): [True: 0, False: 7.08k]
  |  |  |  |  ------------------
  |  |  |  |   33|  7.08k|                   : ((ssl)->type == SSL_TYPE_SSL_CONNECTION                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1223|  7.08k|#define SSL_TYPE_SSL_CONNECTION 0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (33:23): [True: 7.08k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   34|  7.08k|                             ? (c SSL_CONNECTION *)(ssl)                                                           \
  |  |  |  |   35|  7.08k|                             : (SSL_TYPE_IS_QUIC((ssl)->type)                                                      \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1229|      0|#define SSL_TYPE_IS_QUIC(x) (((x) & 0x80) != 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1229:29): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   36|      0|                                       ? (c SSL_CONNECTION *)ossl_quic_obj_get0_handshake_layer((QUIC_OBJ *)(ssl)) \
  |  |  |  |   37|      0|                                       : NULL)))
  |  |  ------------------
  ------------------
  129|       |
  130|  7.08k|    if (sc == NULL)
  ------------------
  |  Branch (130:9): [True: 0, False: 7.08k]
  ------------------
  131|      0|        return 0;
  132|       |
  133|  7.08k|    if (!ssl3_clear(s))
  ------------------
  |  Branch (133:9): [True: 0, False: 7.08k]
  ------------------
  134|      0|        return 0;
  135|       |
  136|  7.08k|    if (s->method->version == TLS_ANY_VERSION)
  ------------------
  |  |   40|  7.08k|#define TLS_ANY_VERSION 0x10000
  ------------------
  |  Branch (136:9): [True: 7.08k, False: 0]
  ------------------
  137|  7.08k|        sc->version = TLS_MAX_VERSION_INTERNAL;
  ------------------
  |  |   50|  7.08k|#define TLS_MAX_VERSION_INTERNAL TLS1_3_VERSION
  |  |  ------------------
  |  |  |  |   27|  7.08k|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  ------------------
  138|      0|    else
  139|      0|        sc->version = s->method->version;
  140|       |
  141|  7.08k|    return 1;
  142|  7.08k|}
ssl_load_groups:
  367|  2.56k|{
  368|  2.56k|    if (!OSSL_PROVIDER_do_all(ctx->libctx, discover_provider_groups, ctx))
  ------------------
  |  Branch (368:9): [True: 0, False: 2.56k]
  ------------------
  369|      0|        return 0;
  370|       |
  371|  2.56k|    return SSL_CTX_set1_groups_list(ctx, TLS_DEFAULT_GROUP_LIST);
  ------------------
  |  | 1505|  2.56k|    SSL_CTX_ctrl(ctx, SSL_CTRL_SET_GROUPS_LIST, 0, (char *)(s))
  |  |  ------------------
  |  |  |  | 1353|  2.56k|#define SSL_CTRL_SET_GROUPS_LIST 92
  |  |  ------------------
  ------------------
  372|  2.56k|}
ssl_load_sigalgs:
  681|  2.56k|{
  682|  2.56k|    size_t i;
  683|  2.56k|    SSL_CERT_LOOKUP lu;
  684|       |
  685|  2.56k|    if (!OSSL_PROVIDER_do_all(ctx->libctx, discover_provider_sigalgs, ctx))
  ------------------
  |  Branch (685:9): [True: 0, False: 2.56k]
  ------------------
  686|      0|        return 0;
  687|       |
  688|       |    /* now populate ctx->ssl_cert_info */
  689|  2.56k|    if (ctx->sigalg_list_len > 0) {
  ------------------
  |  Branch (689:9): [True: 2.47k, False: 83]
  ------------------
  690|  2.47k|        OPENSSL_free(ctx->ssl_cert_info);
  ------------------
  |  |  131|  2.47k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  691|  2.47k|        ctx->ssl_cert_info = OPENSSL_calloc(ctx->sigalg_list_len, sizeof(lu));
  ------------------
  |  |  112|  2.47k|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  692|  2.47k|        if (ctx->ssl_cert_info == NULL)
  ------------------
  |  Branch (692:13): [True: 0, False: 2.47k]
  ------------------
  693|      0|            return 0;
  694|  9.91k|        for (i = 0; i < ctx->sigalg_list_len; i++) {
  ------------------
  |  Branch (694:21): [True: 7.43k, False: 2.47k]
  ------------------
  695|  7.43k|            const char *keytype = inferred_keytype(&ctx->sigalg_list[i]);
  696|  7.43k|            ctx->ssl_cert_info[i].pkey_nid = OBJ_txt2nid(keytype);
  697|  7.43k|            ctx->ssl_cert_info[i].amask = SSL_aANY;
  ------------------
  |  |  124|  7.43k|#define SSL_aANY 0x00000000U
  ------------------
  698|  7.43k|        }
  699|  2.47k|    }
  700|       |
  701|       |    /*
  702|       |     * For now, leave it at this: legacy sigalgs stay in their own
  703|       |     * data structures until "legacy cleanup" occurs.
  704|       |     */
  705|       |
  706|  2.56k|    return 1;
  707|  2.56k|}
tls1_group_id_lookup:
  723|  39.7k|{
  724|  39.7k|    size_t i;
  725|       |
  726|   190k|    for (i = 0; i < ctx->group_list_len; i++) {
  ------------------
  |  Branch (726:17): [True: 190k, False: 0]
  ------------------
  727|   190k|        if (ctx->group_list[i].group_id == group_id)
  ------------------
  |  Branch (727:13): [True: 39.7k, False: 150k]
  ------------------
  728|  39.7k|            return &ctx->group_list[i];
  729|   190k|    }
  730|       |
  731|      0|    return NULL;
  732|  39.7k|}
tls1_group_id2nid:
  745|  17.0k|{
  746|  17.0k|    size_t i;
  747|       |
  748|  17.0k|    if (group_id == 0)
  ------------------
  |  Branch (748:9): [True: 0, False: 17.0k]
  ------------------
  749|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  750|       |
  751|       |    /*
  752|       |     * Return well known Group NIDs - for backwards compatibility. This won't
  753|       |     * work for groups we don't know about.
  754|       |     */
  755|   553k|    for (i = 0; i < OSSL_NELEM(nid_to_group); i++) {
  ------------------
  |  |   14|   553k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (755:17): [True: 551k, False: 2.63k]
  ------------------
  756|   551k|        if (nid_to_group[i].group_id == group_id)
  ------------------
  |  Branch (756:13): [True: 14.3k, False: 536k]
  ------------------
  757|  14.3k|            return nid_to_group[i].nid;
  758|   551k|    }
  759|  2.63k|    if (!include_unknown)
  ------------------
  |  Branch (759:9): [True: 2.63k, False: 0]
  ------------------
  760|  2.63k|        return NID_undef;
  ------------------
  |  |   18|  2.63k|#define NID_undef                       0
  ------------------
  761|      0|    return TLSEXT_nid_unknown | (int)group_id;
  ------------------
  |  |  219|      0|#define TLSEXT_nid_unknown 0x1000000
  ------------------
  762|  2.63k|}
tls1_get_supported_groups:
  786|  5.38k|{
  787|  5.38k|    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
  ------------------
  |  |   26|  5.38k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
  788|       |
  789|       |    /* For Suite B mode only include P-256, P-384 */
  790|  5.38k|    switch (tls1_suiteb(s)) {
  ------------------
  |  | 2029|  5.38k|#define tls1_suiteb(s) (s->cert->cert_flags & SSL_CERT_FLAG_SUITEB_128_LOS)
  |  |  ------------------
  |  |  |  |  562|  5.38k|#define SSL_CERT_FLAG_SUITEB_128_LOS 0x30000
  |  |  ------------------
  ------------------
  791|     89|    case SSL_CERT_FLAG_SUITEB_128_LOS:
  ------------------
  |  |  562|     89|#define SSL_CERT_FLAG_SUITEB_128_LOS 0x30000
  ------------------
  |  Branch (791:5): [True: 89, False: 5.29k]
  ------------------
  792|     89|        *pgroups = suiteb_curves;
  793|     89|        *pgroupslen = OSSL_NELEM(suiteb_curves);
  ------------------
  |  |   14|     89|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  794|     89|        break;
  795|       |
  796|     19|    case SSL_CERT_FLAG_SUITEB_128_LOS_ONLY:
  ------------------
  |  |  558|     19|#define SSL_CERT_FLAG_SUITEB_128_LOS_ONLY 0x10000
  ------------------
  |  Branch (796:5): [True: 19, False: 5.36k]
  ------------------
  797|     19|        *pgroups = suiteb_curves;
  798|     19|        *pgroupslen = 1;
  799|     19|        break;
  800|       |
  801|     16|    case SSL_CERT_FLAG_SUITEB_192_LOS:
  ------------------
  |  |  560|     16|#define SSL_CERT_FLAG_SUITEB_192_LOS 0x20000
  ------------------
  |  Branch (801:5): [True: 16, False: 5.37k]
  ------------------
  802|     16|        *pgroups = suiteb_curves + 1;
  803|     16|        *pgroupslen = 1;
  804|     16|        break;
  805|       |
  806|  5.26k|    default:
  ------------------
  |  Branch (806:5): [True: 5.26k, False: 124]
  ------------------
  807|  5.26k|        if (s->ext.supportedgroups == NULL) {
  ------------------
  |  Branch (807:13): [True: 0, False: 5.26k]
  ------------------
  808|      0|            *pgroups = sctx->ext.supportedgroups;
  809|      0|            *pgroupslen = sctx->ext.supportedgroups_len;
  810|  5.26k|        } else {
  811|  5.26k|            *pgroups = s->ext.supportedgroups;
  812|  5.26k|            *pgroupslen = s->ext.supportedgroups_len;
  813|  5.26k|        }
  814|  5.26k|        break;
  815|  5.38k|    }
  816|  5.38k|}
tls1_get_requested_keyshare_groups:
  833|  1.63k|{
  834|  1.63k|    SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
  ------------------
  |  |   26|  1.63k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
  835|       |
  836|  1.63k|    if (s->ext.supportedgroups == NULL) {
  ------------------
  |  Branch (836:9): [True: 0, False: 1.63k]
  ------------------
  837|      0|        *pgroups = sctx->ext.supportedgroups;
  838|      0|        *pgroupslen = sctx->ext.supportedgroups_len;
  839|  1.63k|    } else {
  840|  1.63k|        *pgroups = s->ext.keyshares;
  841|  1.63k|        *pgroupslen = s->ext.keyshares_len;
  842|  1.63k|    }
  843|  1.63k|}
tls_valid_group:
  862|  19.8k|{
  863|  19.8k|    const TLS_GROUP_INFO *ginfo = tls1_group_id_lookup(SSL_CONNECTION_GET_CTX(s),
  ------------------
  |  |   26|  19.8k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
  864|  19.8k|        group_id);
  865|  19.8k|    int ret;
  866|  19.8k|    int group_minversion, group_maxversion;
  867|       |
  868|  19.8k|    if (okfortls13 != NULL)
  ------------------
  |  Branch (868:9): [True: 10.8k, False: 8.94k]
  ------------------
  869|  10.8k|        *okfortls13 = 0;
  870|       |
  871|  19.8k|    if (ginfo == NULL)
  ------------------
  |  Branch (871:9): [True: 0, False: 19.8k]
  ------------------
  872|      0|        return 0;
  873|       |
  874|  19.8k|    group_minversion = SSL_CONNECTION_IS_DTLS(s) ? ginfo->mindtls : ginfo->mintls;
  ------------------
  |  |  258|  19.8k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  19.8k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  19.8k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 19.8k]
  |  |  ------------------
  ------------------
  875|  19.8k|    group_maxversion = SSL_CONNECTION_IS_DTLS(s) ? ginfo->maxdtls : ginfo->maxtls;
  ------------------
  |  |  258|  19.8k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  19.8k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  19.8k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 19.8k]
  |  |  ------------------
  ------------------
  876|       |
  877|  19.8k|    if (group_minversion < 0 || group_maxversion < 0)
  ------------------
  |  Branch (877:9): [True: 0, False: 19.8k]
  |  Branch (877:33): [True: 0, False: 19.8k]
  ------------------
  878|      0|        return 0;
  879|  19.8k|    if (group_maxversion == 0)
  ------------------
  |  Branch (879:9): [True: 19.7k, False: 65]
  ------------------
  880|  19.7k|        ret = 1;
  881|     65|    else
  882|     65|        ret = (ssl_version_cmp(s, minversion, group_maxversion) <= 0);
  883|  19.8k|    if (group_minversion > 0)
  ------------------
  |  Branch (883:9): [True: 19.8k, False: 0]
  ------------------
  884|  19.8k|        ret &= (ssl_version_cmp(s, maxversion, group_minversion) >= 0);
  885|       |
  886|  19.8k|    if (!SSL_CONNECTION_IS_DTLS(s)) {
  ------------------
  |  |  258|  19.8k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  19.8k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  19.8k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  ------------------
  |  Branch (886:9): [True: 19.8k, False: 0]
  ------------------
  887|  19.8k|        if (ret && okfortls13 != NULL && maxversion == TLS1_3_VERSION)
  ------------------
  |  |   27|  10.8k|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (887:13): [True: 19.7k, False: 26]
  |  Branch (887:20): [True: 10.8k, False: 8.92k]
  |  Branch (887:42): [True: 10.8k, False: 28]
  ------------------
  888|  10.8k|            *okfortls13 = (group_maxversion == 0)
  ------------------
  |  Branch (888:27): [True: 10.8k, False: 24]
  ------------------
  889|     24|                || (group_maxversion >= TLS1_3_VERSION);
  ------------------
  |  |   27|     24|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (889:20): [True: 0, False: 24]
  ------------------
  890|  19.8k|    }
  891|  19.8k|    ret &= !isec
  ------------------
  |  Branch (891:12): [True: 13.8k, False: 5.98k]
  ------------------
  892|  5.98k|        || strcmp(ginfo->algorithm, "EC") == 0
  ------------------
  |  Branch (892:12): [True: 568, False: 5.42k]
  ------------------
  893|  5.42k|        || strcmp(ginfo->algorithm, "X25519") == 0
  ------------------
  |  Branch (893:12): [True: 2.62k, False: 2.80k]
  ------------------
  894|  2.80k|        || strcmp(ginfo->algorithm, "X448") == 0;
  ------------------
  |  Branch (894:12): [True: 24, False: 2.77k]
  ------------------
  895|       |
  896|  19.8k|    return ret;
  897|  19.8k|}
tls_group_allowed:
  901|  17.0k|{
  902|  17.0k|    const TLS_GROUP_INFO *ginfo = tls1_group_id_lookup(SSL_CONNECTION_GET_CTX(s),
  ------------------
  |  |   26|  17.0k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
  903|  17.0k|        group);
  904|  17.0k|    unsigned char gtmp[2];
  905|       |
  906|  17.0k|    if (ginfo == NULL)
  ------------------
  |  Branch (906:9): [True: 0, False: 17.0k]
  ------------------
  907|      0|        return 0;
  908|       |
  909|  17.0k|    gtmp[0] = group >> 8;
  910|  17.0k|    gtmp[1] = group & 0xff;
  911|  17.0k|    return ssl_security(s, op, ginfo->secbits,
  912|  17.0k|        tls1_group_id2nid(ginfo->group_id, 0), (void *)gtmp);
  913|  17.0k|}
tls1_set_groups_list:
 1610|  2.98k|{
 1611|  2.98k|    size_t i = 0, j;
 1612|  2.98k|    int ret = 0, parse_ret = 0;
 1613|  2.98k|    gid_cb_st gcb;
 1614|       |
 1615|       |    /* Sanity check */
 1616|  2.98k|    if (ctx == NULL) {
  ------------------
  |  Branch (1616:9): [True: 0, False: 2.98k]
  ------------------
 1617|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 1618|      0|        return 0;
 1619|      0|    }
 1620|       |
 1621|  2.98k|    memset(&gcb, 0, sizeof(gcb));
 1622|  2.98k|    gcb.gidmax = GROUPLIST_INCREMENT;
  ------------------
  |  | 1193|  2.98k|#define GROUPLIST_INCREMENT 32 /* Memory allocation chunk size (64 Bytes chunks ~= cache line) */
  ------------------
 1623|  2.98k|    gcb.tplmax = GROUPLIST_INCREMENT;
  ------------------
  |  | 1193|  2.98k|#define GROUPLIST_INCREMENT 32 /* Memory allocation chunk size (64 Bytes chunks ~= cache line) */
  ------------------
 1624|  2.98k|    gcb.ksidmax = GROUPLIST_INCREMENT;
  ------------------
  |  | 1193|  2.98k|#define GROUPLIST_INCREMENT 32 /* Memory allocation chunk size (64 Bytes chunks ~= cache line) */
  ------------------
 1625|  2.98k|    gcb.ctx = ctx;
 1626|       |
 1627|       |    /* Prepare initial chunks of memory for groups, tuples and keyshares groupIDs */
 1628|  2.98k|    gcb.gid_arr = OPENSSL_malloc_array(gcb.gidmax, sizeof(*gcb.gid_arr));
  ------------------
  |  |  110|  2.98k|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1629|  2.98k|    if (gcb.gid_arr == NULL)
  ------------------
  |  Branch (1629:9): [True: 0, False: 2.98k]
  ------------------
 1630|      0|        goto end;
 1631|  2.98k|    gcb.tuplcnt_arr = OPENSSL_malloc_array(gcb.tplmax, sizeof(*gcb.tuplcnt_arr));
  ------------------
  |  |  110|  2.98k|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1632|  2.98k|    if (gcb.tuplcnt_arr == NULL)
  ------------------
  |  Branch (1632:9): [True: 0, False: 2.98k]
  ------------------
 1633|      0|        goto end;
 1634|  2.98k|    gcb.tuplcnt_arr[0] = 0;
 1635|  2.98k|    gcb.ksid_arr = OPENSSL_malloc_array(gcb.ksidmax, sizeof(*gcb.ksid_arr));
  ------------------
  |  |  110|  2.98k|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1636|  2.98k|    if (gcb.ksid_arr == NULL)
  ------------------
  |  Branch (1636:9): [True: 0, False: 2.98k]
  ------------------
 1637|      0|        goto end;
 1638|       |
 1639|  3.04k|    while (str[0] != '\0' && isspace((unsigned char)*str))
  ------------------
  |  Branch (1639:12): [True: 3.01k, False: 31]
  |  Branch (1639:30): [True: 56, False: 2.95k]
  ------------------
 1640|     56|        str++;
 1641|  2.98k|    if (str[0] == '\0')
  ------------------
  |  Branch (1641:9): [True: 31, False: 2.95k]
  ------------------
 1642|     31|        goto empty_list;
 1643|       |
 1644|       |    /*
 1645|       |     * Start the (potentially recursive) tuple processing by calling CONF_parse_list
 1646|       |     * with the TUPLE_DELIMITER_CHARACTER (which will call tuple_cb after cleaning spaces)
 1647|       |     */
 1648|  2.95k|    parse_ret = CONF_parse_list(str, TUPLE_DELIMITER_CHARACTER, 1, tuple_cb, &gcb);
  ------------------
  |  | 1204|  2.95k|#define TUPLE_DELIMITER_CHARACTER '/'
  ------------------
 1649|       |
 1650|  2.95k|    if (parse_ret == 0)
  ------------------
  |  Branch (1650:9): [True: 54, False: 2.90k]
  ------------------
 1651|     54|        goto end;
 1652|  2.90k|    if (parse_ret == -1) {
  ------------------
  |  Branch (1652:9): [True: 9, False: 2.89k]
  ------------------
 1653|      9|        ERR_raise_data(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  406|      9|    (ERR_new(),                                                  \
  |  |  407|      9|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      9|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      9|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |   89|      9|#define ERR_LIB_SSL 20
  ------------------
                      ERR_raise_data(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  358|      9|#define ERR_R_PASSED_INVALID_ARGUMENT (262 | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  239|      9|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  230|      9|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1654|      9|            "Syntax error in '%s'", str);
 1655|      9|        goto end;
 1656|      9|    }
 1657|       |
 1658|       |    /*
 1659|       |     * We check whether a tuple was completely emptied by using "-" prefix
 1660|       |     * excessively, in which case we remove the tuple
 1661|       |     */
 1662|  13.1k|    for (i = j = 0; j < gcb.tplcnt; j++) {
  ------------------
  |  Branch (1662:21): [True: 10.2k, False: 2.89k]
  ------------------
 1663|  10.2k|        if (gcb.tuplcnt_arr[j] == 0)
  ------------------
  |  Branch (1663:13): [True: 3, False: 10.2k]
  ------------------
 1664|      3|            continue;
 1665|       |        /* If there's a gap, move to first unfilled slot */
 1666|  10.2k|        if (j == i)
  ------------------
  |  Branch (1666:13): [True: 10.2k, False: 1]
  ------------------
 1667|  10.2k|            ++i;
 1668|      1|        else
 1669|      1|            gcb.tuplcnt_arr[i++] = gcb.tuplcnt_arr[j];
 1670|  10.2k|    }
 1671|  2.89k|    gcb.tplcnt = i;
 1672|       |
 1673|  2.89k|    if (gcb.ksidcnt > OPENSSL_CLIENT_MAX_KEY_SHARES) {
  ------------------
  |  |  790|  2.89k|#define OPENSSL_CLIENT_MAX_KEY_SHARES 4
  ------------------
  |  Branch (1673:9): [True: 0, False: 2.89k]
  ------------------
 1674|      0|        ERR_raise_data(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  ------------------
  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  408|      0|        ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |   89|      0|#define ERR_LIB_SSL 20
  ------------------
                      ERR_raise_data(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT,
  ------------------
  |  |  358|      0|#define ERR_R_PASSED_INVALID_ARGUMENT (262 | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  239|      0|#define ERR_RFLAG_COMMON (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  230|      0|#define ERR_RFLAGS_OFFSET 18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1675|      0|            "To many keyshares requested in '%s' (max = %d)",
 1676|      0|            str, OPENSSL_CLIENT_MAX_KEY_SHARES);
  ------------------
  |  |  790|      0|#define OPENSSL_CLIENT_MAX_KEY_SHARES 4
  ------------------
 1677|      0|        goto end;
 1678|      0|    }
 1679|       |
 1680|       |    /*
 1681|       |     * For backward compatibility we let the rest of the code know that a key share
 1682|       |     * for the first valid group should be added if no "*" prefix was used anywhere
 1683|       |     */
 1684|  2.89k|    if (gcb.gidcnt > 0 && gcb.ksidcnt == 0) {
  ------------------
  |  Branch (1684:9): [True: 2.80k, False: 92]
  |  Branch (1684:27): [True: 319, False: 2.48k]
  ------------------
 1685|       |        /*
 1686|       |         * No key share group prefix character was used, hence we indicate that a single
 1687|       |         * key share should be sent and flag that it should come from the supported_groups list
 1688|       |         */
 1689|    319|        gcb.ksidcnt = 1;
 1690|    319|        gcb.ksid_arr[0] = 0;
 1691|    319|    }
 1692|       |
 1693|  2.92k|empty_list:
 1694|       |    /*
 1695|       |     * A call to tls1_set_groups_list with any of the args (other than ctx) set
 1696|       |     * to NULL only does a syntax check, hence we're done here and report success
 1697|       |     */
 1698|  2.92k|    if (grpext == NULL || ksext == NULL || tplext == NULL || grpextlen == NULL || ksextlen == NULL || tplextlen == NULL) {
  ------------------
  |  Branch (1698:9): [True: 0, False: 2.92k]
  |  Branch (1698:27): [True: 0, False: 2.92k]
  |  Branch (1698:44): [True: 0, False: 2.92k]
  |  Branch (1698:62): [True: 0, False: 2.92k]
  |  Branch (1698:83): [True: 0, False: 2.92k]
  |  Branch (1698:103): [True: 0, False: 2.92k]
  ------------------
 1699|      0|        ret = 1;
 1700|      0|        goto end;
 1701|      0|    }
 1702|       |
 1703|       |    /*
 1704|       |     * tuple_cb and gid_cb combo ensures there are no duplicates or unknown groups so we
 1705|       |     * can just go ahead and set the results (after disposing the existing)
 1706|       |     */
 1707|  2.92k|    OPENSSL_free(*grpext);
  ------------------
  |  |  131|  2.92k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1708|  2.92k|    *grpext = gcb.gid_arr;
 1709|  2.92k|    *grpextlen = gcb.gidcnt;
 1710|  2.92k|    OPENSSL_free(*ksext);
  ------------------
  |  |  131|  2.92k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1711|  2.92k|    *ksext = gcb.ksid_arr;
 1712|  2.92k|    *ksextlen = gcb.ksidcnt;
 1713|  2.92k|    OPENSSL_free(*tplext);
  ------------------
  |  |  131|  2.92k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1714|  2.92k|    *tplext = gcb.tuplcnt_arr;
 1715|  2.92k|    *tplextlen = gcb.tplcnt;
 1716|       |
 1717|  2.92k|    return 1;
 1718|       |
 1719|     63|end:
 1720|     63|    OPENSSL_free(gcb.gid_arr);
  ------------------
  |  |  131|     63|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1721|     63|    OPENSSL_free(gcb.tuplcnt_arr);
  ------------------
  |  |  131|     63|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1722|     63|    OPENSSL_free(gcb.ksid_arr);
  ------------------
  |  |  131|     63|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1723|     63|    return ret;
 1724|  2.92k|}
tls1_get_formatlist:
 1782|  1.56k|{
 1783|       |    /*
 1784|       |     * If we have a custom point format list use it otherwise use default
 1785|       |     */
 1786|  1.56k|    if (s->ext.ecpointformats) {
  ------------------
  |  Branch (1786:9): [True: 0, False: 1.56k]
  ------------------
 1787|      0|        *pformats = s->ext.ecpointformats;
 1788|      0|        *num_formats = s->ext.ecpointformats_len;
 1789|  1.56k|    } else if ((s->options & SSL_OP_LEGACY_EC_POINT_FORMATS) != 0) {
  ------------------
  |  |  455|  1.56k|#define SSL_OP_LEGACY_EC_POINT_FORMATS SSL_OP_BIT(36)
  |  |  ------------------
  |  |  |  |  350|  1.56k|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (1789:16): [True: 0, False: 1.56k]
  ------------------
 1790|      0|        *pformats = ecformats_all;
 1791|       |        /* For Suite B we don't support char2 fields */
 1792|      0|        if (tls1_suiteb(s))
  ------------------
  |  | 2029|      0|#define tls1_suiteb(s) (s->cert->cert_flags & SSL_CERT_FLAG_SUITEB_128_LOS)
  |  |  ------------------
  |  |  |  |  562|      0|#define SSL_CERT_FLAG_SUITEB_128_LOS 0x30000
  |  |  ------------------
  |  |  |  Branch (2029:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1793|      0|            *num_formats = sizeof(ecformats_all) - 1;
 1794|      0|        else
 1795|      0|            *num_formats = sizeof(ecformats_all);
 1796|  1.56k|    } else {
 1797|  1.56k|        *pformats = ecformats_default;
 1798|  1.56k|        *num_formats = sizeof(ecformats_default);
 1799|  1.56k|    }
 1800|  1.56k|}
ssl_setup_sigalgs:
 2191|  2.56k|{
 2192|  2.56k|    size_t i, cache_idx, sigalgs_len, enabled;
 2193|  2.56k|    const SIGALG_LOOKUP *lu;
 2194|  2.56k|    SIGALG_LOOKUP *cache = NULL;
 2195|  2.56k|    uint16_t *tls12_sigalgs_list = NULL;
 2196|  2.56k|    EVP_PKEY *tmpkey = EVP_PKEY_new();
 2197|  2.56k|    int istls;
 2198|  2.56k|    int ret = 0;
 2199|       |
 2200|  2.56k|    if (ctx == NULL)
  ------------------
  |  Branch (2200:9): [True: 0, False: 2.56k]
  ------------------
 2201|      0|        goto err;
 2202|       |
 2203|  2.56k|    istls = !SSL_CTX_IS_DTLS(ctx);
  ------------------
  |  |  262|  2.56k|    (ctx->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  2.56k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  ------------------
 2204|       |
 2205|  2.56k|    sigalgs_len = OSSL_NELEM(sigalg_lookup_tbl) + ctx->sigalg_list_len;
  ------------------
  |  |   14|  2.56k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 2206|       |
 2207|  2.56k|    cache = OPENSSL_calloc(sigalgs_len, sizeof(const SIGALG_LOOKUP));
  ------------------
  |  |  112|  2.56k|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2208|  2.56k|    if (cache == NULL || tmpkey == NULL)
  ------------------
  |  Branch (2208:9): [True: 0, False: 2.56k]
  |  Branch (2208:26): [True: 0, False: 2.56k]
  ------------------
 2209|      0|        goto err;
 2210|       |
 2211|  2.56k|    tls12_sigalgs_list = OPENSSL_calloc(sigalgs_len, sizeof(uint16_t));
  ------------------
  |  |  112|  2.56k|    CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2212|  2.56k|    if (tls12_sigalgs_list == NULL)
  ------------------
  |  Branch (2212:9): [True: 0, False: 2.56k]
  ------------------
 2213|      0|        goto err;
 2214|       |
 2215|  2.56k|    ERR_set_mark();
 2216|       |    /* First fill cache and tls12_sigalgs list from legacy algorithm list */
 2217|  2.56k|    for (i = 0, lu = sigalg_lookup_tbl;
 2218|  81.9k|        i < OSSL_NELEM(sigalg_lookup_tbl); lu++, i++) {
  ------------------
  |  |   14|  81.9k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (2218:9): [True: 79.4k, False: 2.56k]
  ------------------
 2219|  79.4k|        EVP_PKEY_CTX *pctx;
 2220|       |
 2221|  79.4k|        cache[i] = *lu;
 2222|       |
 2223|       |        /*
 2224|       |         * Check hash is available.
 2225|       |         * This test is not perfect. A provider could have support
 2226|       |         * for a signature scheme, but not a particular hash. However the hash
 2227|       |         * could be available from some other loaded provider. In that case it
 2228|       |         * could be that the signature is available, and the hash is available
 2229|       |         * independently - but not as a combination. We ignore this for now.
 2230|       |         */
 2231|  79.4k|        if (lu->hash != NID_undef
  ------------------
  |  |   18|   158k|#define NID_undef                       0
  ------------------
  |  Branch (2231:13): [True: 74.2k, False: 5.12k]
  ------------------
 2232|  74.2k|            && ctx->ssl_digest_methods[lu->hash_idx] == NULL) {
  ------------------
  |  Branch (2232:16): [True: 14.8k, False: 59.4k]
  ------------------
 2233|  14.8k|            cache[i].available = 0;
 2234|  14.8k|            continue;
 2235|  14.8k|        }
 2236|       |
 2237|  64.6k|        if (!EVP_PKEY_set_type(tmpkey, lu->sig)) {
  ------------------
  |  Branch (2237:13): [True: 0, False: 64.6k]
  ------------------
 2238|      0|            cache[i].available = 0;
 2239|      0|            continue;
 2240|      0|        }
 2241|  64.6k|        pctx = EVP_PKEY_CTX_new_from_pkey(ctx->libctx, tmpkey, ctx->propq);
 2242|       |        /* If unable to create pctx we assume the sig algorithm is unavailable */
 2243|  64.6k|        if (pctx == NULL)
  ------------------
  |  Branch (2243:13): [True: 166, False: 64.4k]
  ------------------
 2244|    166|            cache[i].available = 0;
 2245|  64.6k|        EVP_PKEY_CTX_free(pctx);
 2246|  64.6k|    }
 2247|       |
 2248|       |    /* Now complete cache and tls12_sigalgs list with provider sig information */
 2249|  2.56k|    cache_idx = OSSL_NELEM(sigalg_lookup_tbl);
  ------------------
  |  |   14|  2.56k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 2250|  9.99k|    for (i = 0; i < ctx->sigalg_list_len; i++) {
  ------------------
  |  Branch (2250:17): [True: 7.43k, False: 2.56k]
  ------------------
 2251|  7.43k|        TLS_SIGALG_INFO si = ctx->sigalg_list[i];
 2252|  7.43k|        cache[cache_idx].name = si.name;
 2253|  7.43k|        cache[cache_idx].name12 = si.sigalg_name;
 2254|  7.43k|        cache[cache_idx].sigalg = si.code_point;
 2255|  7.43k|        tls12_sigalgs_list[cache_idx] = si.code_point;
 2256|  7.43k|        cache[cache_idx].hash = si.hash_name ? OBJ_txt2nid(si.hash_name) : NID_undef;
  ------------------
  |  |   18|  14.8k|#define NID_undef                       0
  ------------------
  |  Branch (2256:33): [True: 0, False: 7.43k]
  ------------------
 2257|  7.43k|        cache[cache_idx].hash_idx = ssl_get_md_idx(cache[cache_idx].hash);
 2258|  7.43k|        cache[cache_idx].sig = OBJ_txt2nid(si.sigalg_name);
 2259|  7.43k|        cache[cache_idx].sig_idx = (int)(i + SSL_PKEY_NUM);
  ------------------
  |  |  328|  7.43k|#define SSL_PKEY_NUM 9
  ------------------
 2260|  7.43k|        cache[cache_idx].sigandhash = OBJ_txt2nid(si.sigalg_name);
 2261|  7.43k|        cache[cache_idx].curve = NID_undef;
  ------------------
  |  |   18|  7.43k|#define NID_undef                       0
  ------------------
 2262|  7.43k|        cache[cache_idx].mintls = TLS1_3_VERSION;
  ------------------
  |  |   27|  7.43k|#define TLS1_3_VERSION 0x0304
  ------------------
 2263|  7.43k|        cache[cache_idx].maxtls = TLS1_3_VERSION;
  ------------------
  |  |   27|  7.43k|#define TLS1_3_VERSION 0x0304
  ------------------
 2264|  7.43k|        cache[cache_idx].mindtls = -1;
 2265|  7.43k|        cache[cache_idx].maxdtls = -1;
 2266|       |        /* Compatibility with TLS 1.3 is checked on load */
 2267|  7.43k|        cache[cache_idx].available = istls;
 2268|  7.43k|        cache[cache_idx].advertise = 0;
 2269|  7.43k|        cache_idx++;
 2270|  7.43k|    }
 2271|  2.56k|    ERR_pop_to_mark();
 2272|       |
 2273|  2.56k|    enabled = 0;
 2274|  89.6k|    for (i = 0; i < OSSL_NELEM(tls12_sigalgs); ++i) {
  ------------------
  |  |   14|  89.6k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (2274:17): [True: 87.1k, False: 2.56k]
  ------------------
 2275|  87.1k|        SIGALG_LOOKUP *ent = cache;
 2276|  87.1k|        size_t j;
 2277|       |
 2278|  1.52M|        for (j = 0; j < sigalgs_len; ent++, j++) {
  ------------------
  |  Branch (2278:21): [True: 1.52M, False: 249]
  ------------------
 2279|  1.52M|            if (ent->sigalg != tls12_sigalgs[i])
  ------------------
  |  Branch (2279:17): [True: 1.43M, False: 86.8k]
  ------------------
 2280|  1.43M|                continue;
 2281|       |            /* Dedup by marking cache entry as default enabled. */
 2282|  86.8k|            if (ent->available && !ent->advertise) {
  ------------------
  |  Branch (2282:17): [True: 71.8k, False: 14.9k]
  |  Branch (2282:35): [True: 71.8k, False: 0]
  ------------------
 2283|  71.8k|                ent->advertise = 1;
 2284|  71.8k|                tls12_sigalgs_list[enabled++] = tls12_sigalgs[i];
 2285|  71.8k|            }
 2286|  86.8k|            break;
 2287|  1.52M|        }
 2288|  87.1k|    }
 2289|       |
 2290|       |    /* Append any provider sigalgs not yet handled */
 2291|  9.99k|    for (i = OSSL_NELEM(sigalg_lookup_tbl); i < sigalgs_len; ++i) {
  ------------------
  |  |   14|  2.56k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (2291:45): [True: 7.43k, False: 2.56k]
  ------------------
 2292|  7.43k|        SIGALG_LOOKUP *ent = &cache[i];
 2293|       |
 2294|  7.43k|        if (ent->available && !ent->advertise)
  ------------------
  |  Branch (2294:13): [True: 7.43k, False: 0]
  |  Branch (2294:31): [True: 0, False: 7.43k]
  ------------------
 2295|      0|            tls12_sigalgs_list[enabled++] = ent->sigalg;
 2296|  7.43k|    }
 2297|       |
 2298|  2.56k|    ctx->sigalg_lookup_cache = cache;
 2299|  2.56k|    ctx->sigalg_lookup_cache_len = sigalgs_len;
 2300|  2.56k|    ctx->tls12_sigalgs = tls12_sigalgs_list;
 2301|  2.56k|    ctx->tls12_sigalgs_len = enabled;
 2302|  2.56k|    cache = NULL;
 2303|  2.56k|    tls12_sigalgs_list = NULL;
 2304|       |
 2305|  2.56k|    ret = 1;
 2306|  2.56k|err:
 2307|  2.56k|    OPENSSL_free(cache);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2308|  2.56k|    OPENSSL_free(tls12_sigalgs_list);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2309|  2.56k|    EVP_PKEY_free(tmpkey);
 2310|  2.56k|    return ret;
 2311|  2.56k|}
tls1_lookup_md:
 2407|  62.0k|{
 2408|  62.0k|    const EVP_MD *md;
 2409|       |
 2410|  62.0k|    if (lu == NULL)
  ------------------
  |  Branch (2410:9): [True: 0, False: 62.0k]
  ------------------
 2411|      0|        return 0;
 2412|       |    /* lu->hash == NID_undef means no associated digest */
 2413|  62.0k|    if (lu->hash == NID_undef) {
  ------------------
  |  |   18|  62.0k|#define NID_undef                       0
  ------------------
  |  Branch (2413:9): [True: 8.01k, False: 54.0k]
  ------------------
 2414|  8.01k|        md = NULL;
 2415|  54.0k|    } else {
 2416|  54.0k|        md = ssl_md(ctx, lu->hash_idx);
 2417|  54.0k|        if (md == NULL)
  ------------------
  |  Branch (2417:13): [True: 0, False: 54.0k]
  ------------------
 2418|      0|            return 0;
 2419|  54.0k|    }
 2420|  62.0k|    if (pmd)
  ------------------
  |  Branch (2420:9): [True: 62.0k, False: 0]
  ------------------
 2421|  62.0k|        *pmd = md;
 2422|  62.0k|    return 1;
 2423|  62.0k|}
tls12_get_psigalgs:
 2544|  6.80k|{
 2545|       |    /*
 2546|       |     * If Suite B mode use Suite B sigalgs only, ignore any other
 2547|       |     * preferences.
 2548|       |     */
 2549|  6.80k|    switch (tls1_suiteb(s)) {
  ------------------
  |  | 2029|  6.80k|#define tls1_suiteb(s) (s->cert->cert_flags & SSL_CERT_FLAG_SUITEB_128_LOS)
  |  |  ------------------
  |  |  |  |  562|  6.80k|#define SSL_CERT_FLAG_SUITEB_128_LOS 0x30000
  |  |  ------------------
  |  |  |  Branch (2029:24): [True: 161, False: 6.64k]
  |  |  ------------------
  ------------------
 2550|    119|    case SSL_CERT_FLAG_SUITEB_128_LOS:
  ------------------
  |  |  562|    119|#define SSL_CERT_FLAG_SUITEB_128_LOS 0x30000
  ------------------
  |  Branch (2550:5): [True: 119, False: 6.68k]
  ------------------
 2551|    119|        *psigs = suiteb_sigalgs;
 2552|    119|        return OSSL_NELEM(suiteb_sigalgs);
  ------------------
  |  |   14|    119|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
 2553|       |
 2554|     21|    case SSL_CERT_FLAG_SUITEB_128_LOS_ONLY:
  ------------------
  |  |  558|     21|#define SSL_CERT_FLAG_SUITEB_128_LOS_ONLY 0x10000
  ------------------
  |  Branch (2554:5): [True: 21, False: 6.78k]
  ------------------
 2555|     21|        *psigs = suiteb_sigalgs;
 2556|     21|        return 1;
 2557|       |
 2558|     21|    case SSL_CERT_FLAG_SUITEB_192_LOS:
  ------------------
  |  |  560|     21|#define SSL_CERT_FLAG_SUITEB_192_LOS 0x20000
  ------------------
  |  Branch (2558:5): [True: 21, False: 6.78k]
  ------------------
 2559|     21|        *psigs = suiteb_sigalgs + 1;
 2560|     21|        return 1;
 2561|  6.80k|    }
 2562|       |    /*
 2563|       |     *  We use client_sigalgs (if not NULL) if we're a server
 2564|       |     *  and sending a certificate request or if we're a client and
 2565|       |     *  determining which shared algorithm to use.
 2566|       |     */
 2567|  6.64k|    if ((s->server == sent) && s->cert->client_sigalgs != NULL) {
  ------------------
  |  Branch (2567:9): [True: 0, False: 6.64k]
  |  Branch (2567:32): [True: 0, False: 0]
  ------------------
 2568|      0|        *psigs = s->cert->client_sigalgs;
 2569|      0|        return s->cert->client_sigalgslen;
 2570|  6.64k|    } else if (s->cert->conf_sigalgs) {
  ------------------
  |  Branch (2570:16): [True: 0, False: 6.64k]
  ------------------
 2571|      0|        *psigs = s->cert->conf_sigalgs;
 2572|      0|        return s->cert->conf_sigalgslen;
 2573|  6.64k|    } else {
 2574|  6.64k|        *psigs = SSL_CONNECTION_GET_CTX(s)->tls12_sigalgs;
  ------------------
  |  |   26|  6.64k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
 2575|  6.64k|        return SSL_CONNECTION_GET_CTX(s)->tls12_sigalgs_len;
  ------------------
  |  |   26|  6.64k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
 2576|  6.64k|    }
 2577|  6.64k|}
ssl_set_client_disabled:
 2878|  5.16k|{
 2879|  5.16k|    s->s3.tmp.mask_a = 0;
 2880|  5.16k|    s->s3.tmp.mask_k = 0;
 2881|  5.16k|    ssl_set_sig_mask(&s->s3.tmp.mask_a, s, SSL_SECOP_SIGALG_MASK);
  ------------------
  |  | 2776|  5.16k|#define SSL_SECOP_SIGALG_MASK (14 | SSL_SECOP_OTHER_SIGALG)
  |  |  ------------------
  |  |  |  | 2742|  5.16k|#define SSL_SECOP_OTHER_SIGALG (5 << 16)
  |  |  ------------------
  ------------------
 2882|  5.16k|    if (ssl_get_min_max_version(s, &s->s3.tmp.min_ver,
  ------------------
  |  Branch (2882:9): [True: 0, False: 5.16k]
  ------------------
 2883|  5.16k|            &s->s3.tmp.max_ver, NULL)
 2884|  5.16k|        != 0)
 2885|      0|        return 0;
 2886|  5.16k|#ifndef OPENSSL_NO_PSK
 2887|       |    /* with PSK there must be client callback set */
 2888|  5.16k|    if (!s->psk_client_callback) {
  ------------------
  |  Branch (2888:9): [True: 5.16k, False: 0]
  ------------------
 2889|  5.16k|        s->s3.tmp.mask_a |= SSL_aPSK;
  ------------------
  |  |  116|  5.16k|#define SSL_aPSK 0x00000010U
  ------------------
 2890|  5.16k|        s->s3.tmp.mask_k |= SSL_PSK;
  ------------------
  |  |  101|  5.16k|#define SSL_PSK (SSL_kPSK | SSL_kRSAPSK | SSL_kECDHEPSK | SSL_kDHEPSK)
  |  |  ------------------
  |  |  |  |   87|  5.16k|#define SSL_kPSK 0x00000008U
  |  |  ------------------
  |  |               #define SSL_PSK (SSL_kPSK | SSL_kRSAPSK | SSL_kECDHEPSK | SSL_kDHEPSK)
  |  |  ------------------
  |  |  |  |   93|  5.16k|#define SSL_kRSAPSK 0x00000040U
  |  |  ------------------
  |  |               #define SSL_PSK (SSL_kPSK | SSL_kRSAPSK | SSL_kECDHEPSK | SSL_kDHEPSK)
  |  |  ------------------
  |  |  |  |   94|  5.16k|#define SSL_kECDHEPSK 0x00000080U
  |  |  ------------------
  |  |               #define SSL_PSK (SSL_kPSK | SSL_kRSAPSK | SSL_kECDHEPSK | SSL_kDHEPSK)
  |  |  ------------------
  |  |  |  |   95|  5.16k|#define SSL_kDHEPSK 0x00000100U
  |  |  ------------------
  ------------------
 2891|  5.16k|    }
 2892|  5.16k|#endif /* OPENSSL_NO_PSK */
 2893|  5.16k|#ifndef OPENSSL_NO_SRP
 2894|  5.16k|    if (!(s->srp_ctx.srp_Mask & SSL_kSRP)) {
  ------------------
  |  |   91|  5.16k|#define SSL_kSRP 0x00000020U
  ------------------
  |  Branch (2894:9): [True: 5.15k, False: 4]
  ------------------
 2895|  5.15k|        s->s3.tmp.mask_a |= SSL_aSRP;
  ------------------
  |  |  120|  5.15k|#define SSL_aSRP 0x00000040U
  ------------------
 2896|  5.15k|        s->s3.tmp.mask_k |= SSL_kSRP;
  ------------------
  |  |   91|  5.15k|#define SSL_kSRP 0x00000020U
  ------------------
 2897|  5.15k|    }
 2898|  5.16k|#endif
 2899|  5.16k|    return 1;
 2900|  5.16k|}
ssl_cipher_disabled:
 2913|   310k|{
 2914|   310k|    int minversion = SSL_CONNECTION_IS_DTLS(s) ? c->min_dtls : c->min_tls;
  ------------------
  |  |  258|   310k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|   310k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|   310k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 310k]
  |  |  ------------------
  ------------------
 2915|   310k|    int maxversion = SSL_CONNECTION_IS_DTLS(s) ? c->max_dtls : c->max_tls;
  ------------------
  |  |  258|   310k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|   310k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|   310k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 310k]
  |  |  ------------------
  ------------------
 2916|       |
 2917|   310k|    if (c->algorithm_mkey & s->s3.tmp.mask_k
  ------------------
  |  Branch (2917:9): [True: 149k, False: 160k]
  ------------------
 2918|   160k|        || c->algorithm_auth & s->s3.tmp.mask_a)
  ------------------
  |  Branch (2918:12): [True: 0, False: 160k]
  ------------------
 2919|   149k|        return 1;
 2920|   160k|    if (s->s3.tmp.max_ver == 0)
  ------------------
  |  Branch (2920:9): [True: 0, False: 160k]
  ------------------
 2921|      0|        return 1;
 2922|       |
 2923|   160k|    if (SSL_IS_QUIC_INT_HANDSHAKE(s))
  ------------------
  |  |  304|   160k|#define SSL_IS_QUIC_INT_HANDSHAKE(s) (((s)->s3.flags & TLS1_FLAGS_QUIC_INTERNAL) != 0)
  |  |  ------------------
  |  |  |  |   31|   160k|#define TLS1_FLAGS_QUIC_INTERNAL 0x4000
  |  |  ------------------
  |  |  |  Branch (304:38): [True: 0, False: 160k]
  |  |  ------------------
  ------------------
 2924|       |        /* For QUIC, only allow these ciphersuites. */
 2925|      0|        switch (SSL_CIPHER_get_id(c)) {
 2926|      0|        case TLS1_3_CK_AES_128_GCM_SHA256:
  ------------------
  |  |  626|      0|#define TLS1_3_CK_AES_128_GCM_SHA256 0x03001301
  ------------------
  |  Branch (2926:9): [True: 0, False: 0]
  ------------------
 2927|      0|        case TLS1_3_CK_AES_256_GCM_SHA384:
  ------------------
  |  |  627|      0|#define TLS1_3_CK_AES_256_GCM_SHA384 0x03001302
  ------------------
  |  Branch (2927:9): [True: 0, False: 0]
  ------------------
 2928|      0|        case TLS1_3_CK_CHACHA20_POLY1305_SHA256:
  ------------------
  |  |  628|      0|#define TLS1_3_CK_CHACHA20_POLY1305_SHA256 0x03001303
  ------------------
  |  Branch (2928:9): [True: 0, False: 0]
  ------------------
 2929|      0|            break;
 2930|      0|        default:
  ------------------
  |  Branch (2930:9): [True: 0, False: 0]
  ------------------
 2931|      0|            return 1;
 2932|      0|        }
 2933|       |
 2934|       |    /*
 2935|       |     * For historical reasons we will allow ECHDE to be selected by a server
 2936|       |     * in SSLv3 if we are a client
 2937|       |     */
 2938|   160k|    if (minversion == TLS1_VERSION
  ------------------
  |  |   24|   320k|#define TLS1_VERSION 0x0301
  ------------------
  |  Branch (2938:9): [True: 20.3k, False: 139k]
  ------------------
 2939|  20.3k|        && ecdhe
  ------------------
  |  Branch (2939:12): [True: 2, False: 20.3k]
  ------------------
 2940|      2|        && (c->algorithm_mkey & (SSL_kECDHE | SSL_kECDHEPSK)) != 0)
  ------------------
  |  |   85|      2|#define SSL_kECDHE 0x00000004U
  ------------------
                      && (c->algorithm_mkey & (SSL_kECDHE | SSL_kECDHEPSK)) != 0)
  ------------------
  |  |   94|      2|#define SSL_kECDHEPSK 0x00000080U
  ------------------
  |  Branch (2940:12): [True: 1, False: 1]
  ------------------
 2941|      1|        minversion = SSL3_VERSION;
  ------------------
  |  |   23|      1|#define SSL3_VERSION 0x0300
  ------------------
 2942|       |
 2943|   160k|    if (ssl_version_cmp(s, minversion, s->s3.tmp.max_ver) > 0
  ------------------
  |  Branch (2943:9): [True: 268, False: 160k]
  ------------------
 2944|   160k|        || ssl_version_cmp(s, maxversion, s->s3.tmp.min_ver) < 0)
  ------------------
  |  Branch (2944:12): [True: 324, False: 159k]
  ------------------
 2945|    592|        return 1;
 2946|       |
 2947|   159k|    return !ssl_security(s, op, c->strength_bits, 0, (void *)c);
 2948|   160k|}
tls_use_ticket:
 2951|  1.64k|{
 2952|  1.64k|    if ((s->options & SSL_OP_NO_TICKET))
  ------------------
  |  |  383|  1.64k|#define SSL_OP_NO_TICKET SSL_OP_BIT(14)
  |  |  ------------------
  |  |  |  |  350|  1.64k|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  |  Branch (2952:9): [True: 1.64k, False: 0]
  ------------------
 2953|  1.64k|        return 0;
 2954|      0|    return ssl_security(s, SSL_SECOP_TICKET, 0, 0, NULL);
  ------------------
  |  | 2768|      0|#define SSL_SECOP_TICKET (10 | SSL_SECOP_OTHER_NONE)
  |  |  ------------------
  |  |  |  | 2737|      0|#define SSL_SECOP_OTHER_NONE 0
  |  |  ------------------
  ------------------
 2955|  1.64k|}
ssl_set_sig_mask:
 3425|  5.16k|{
 3426|  5.16k|    const uint16_t *sigalgs;
 3427|  5.16k|    size_t i, sigalgslen;
 3428|  5.16k|    uint32_t disabled_mask = SSL_aRSA | SSL_aDSS | SSL_aECDSA;
  ------------------
  |  |  108|  5.16k|#define SSL_aRSA 0x00000001U
  ------------------
                  uint32_t disabled_mask = SSL_aRSA | SSL_aDSS | SSL_aECDSA;
  ------------------
  |  |  110|  5.16k|#define SSL_aDSS 0x00000002U
  ------------------
                  uint32_t disabled_mask = SSL_aRSA | SSL_aDSS | SSL_aECDSA;
  ------------------
  |  |  114|  5.16k|#define SSL_aECDSA 0x00000008U
  ------------------
 3429|       |    /*
 3430|       |     * Go through all signature algorithms seeing if we support any
 3431|       |     * in disabled_mask.
 3432|       |     */
 3433|  5.16k|    sigalgslen = tls12_get_psigalgs(s, 1, &sigalgs);
 3434|   151k|    for (i = 0; i < sigalgslen; i++, sigalgs++) {
  ------------------
  |  Branch (3434:17): [True: 146k, False: 5.16k]
  ------------------
 3435|   146k|        const SIGALG_LOOKUP *lu = tls1_lookup_sigalg(SSL_CONNECTION_GET_CTX(s), *sigalgs);
  ------------------
  |  |   26|   146k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
 3436|   146k|        const SSL_CERT_LOOKUP *clu;
 3437|       |
 3438|   146k|        if (lu == NULL)
  ------------------
  |  Branch (3438:13): [True: 0, False: 146k]
  ------------------
 3439|      0|            continue;
 3440|       |
 3441|   146k|        clu = ssl_cert_lookup_by_idx(lu->sig_idx,
 3442|   146k|            SSL_CONNECTION_GET_CTX(s));
  ------------------
  |  |   26|   146k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
 3443|   146k|        if (clu == NULL)
  ------------------
  |  Branch (3443:13): [True: 0, False: 146k]
  ------------------
 3444|      0|            continue;
 3445|       |
 3446|       |        /* If algorithm is disabled see if we can enable it */
 3447|   146k|        if ((clu->amask & disabled_mask) != 0
  ------------------
  |  Branch (3447:13): [True: 15.4k, False: 130k]
  ------------------
 3448|  15.4k|            && tls12_sigalg_allowed(s, op, lu))
  ------------------
  |  Branch (3448:16): [True: 15.2k, False: 253]
  ------------------
 3449|  15.2k|            disabled_mask &= ~clu->amask;
 3450|   146k|    }
 3451|  5.16k|    *pmask_a |= disabled_mask;
 3452|  5.16k|}
tls12_copy_sigalgs:
 3456|  1.64k|{
 3457|  1.64k|    size_t i;
 3458|  1.64k|    int rv = 0;
 3459|       |
 3460|  48.2k|    for (i = 0; i < psiglen; i++, psig++) {
  ------------------
  |  Branch (3460:17): [True: 46.6k, False: 1.64k]
  ------------------
 3461|  46.6k|        const SIGALG_LOOKUP *lu = tls1_lookup_sigalg(SSL_CONNECTION_GET_CTX(s), *psig);
  ------------------
  |  |   26|  46.6k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
 3462|       |
 3463|  46.6k|        if (lu == NULL || !tls_sigalg_compat(s, lu))
  ------------------
  |  Branch (3463:13): [True: 0, False: 46.6k]
  |  Branch (3463:27): [True: 4.96k, False: 41.6k]
  ------------------
 3464|  4.96k|            continue;
 3465|  41.6k|        if (!WPACKET_put_bytes_u16(pkt, *psig))
  ------------------
  |  |  891|  41.6k|    WPACKET_put_bytes__((pkt), (val), 2)
  ------------------
  |  Branch (3465:13): [True: 0, False: 41.6k]
  ------------------
 3466|      0|            return 0;
 3467|       |        /*
 3468|       |         * If TLS 1.3 must have at least one valid TLS 1.3 message
 3469|       |         * signing algorithm: i.e. neither RSA nor SHA1/SHA224
 3470|       |         */
 3471|  41.6k|        if (rv == 0 && (!SSL_CONNECTION_IS_TLS13(s) || (lu->sig != EVP_PKEY_RSA && lu->hash != NID_sha1 && lu->hash != NID_sha224)))
  ------------------
  |  |  265|  3.28k|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|  3.28k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  1.64k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|  1.64k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 1.64k, False: 0]
  |  |  ------------------
  |  |  266|  1.64k|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|  1.64k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|  3.28k|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 1.64k, False: 0]
  |  |  ------------------
  |  |  267|  3.28k|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|  1.64k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|  1.64k|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 1.64k]
  |  |  ------------------
  ------------------
                      if (rv == 0 && (!SSL_CONNECTION_IS_TLS13(s) || (lu->sig != EVP_PKEY_RSA && lu->hash != NID_sha1 && lu->hash != NID_sha224)))
  ------------------
  |  |   63|      0|#define EVP_PKEY_RSA NID_rsaEncryption
  |  |  ------------------
  |  |  |  |  543|      0|#define NID_rsaEncryption               6
  |  |  ------------------
  ------------------
                      if (rv == 0 && (!SSL_CONNECTION_IS_TLS13(s) || (lu->sig != EVP_PKEY_RSA && lu->hash != NID_sha1 && lu->hash != NID_sha224)))
  ------------------
  |  | 2344|      0|#define NID_sha1                64
  ------------------
                      if (rv == 0 && (!SSL_CONNECTION_IS_TLS13(s) || (lu->sig != EVP_PKEY_RSA && lu->hash != NID_sha1 && lu->hash != NID_sha224)))
  ------------------
  |  | 3302|      0|#define NID_sha224              675
  ------------------
  |  Branch (3471:13): [True: 1.64k, False: 40.0k]
  |  Branch (3471:57): [True: 0, False: 0]
  |  Branch (3471:84): [True: 0, False: 0]
  |  Branch (3471:108): [True: 0, False: 0]
  ------------------
 3472|  1.64k|            rv = 1;
 3473|  41.6k|    }
 3474|  1.64k|    if (rv == 0)
  ------------------
  |  Branch (3474:9): [True: 0, False: 1.64k]
  ------------------
 3475|       |        ERR_raise(ERR_LIB_SSL, SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
 3476|  1.64k|    return rv;
 3477|  1.64k|}
t1_lib.c:discover_provider_groups:
  357|  3.18k|{
  358|  3.18k|    struct provider_ctx_data_st pgd;
  359|       |
  360|  3.18k|    pgd.ctx = vctx;
  361|  3.18k|    pgd.provider = provider;
  362|  3.18k|    return OSSL_PROVIDER_get_capabilities(provider, "TLS-GROUP",
  363|  3.18k|        add_provider_groups, &pgd);
  364|  3.18k|}
t1_lib.c:add_provider_groups:
  228|   151k|{
  229|   151k|    struct provider_ctx_data_st *pgd = data;
  230|   151k|    SSL_CTX *ctx = pgd->ctx;
  231|   151k|    const OSSL_PARAM *p;
  232|   151k|    TLS_GROUP_INFO *ginf = NULL;
  233|   151k|    EVP_KEYMGMT *keymgmt;
  234|   151k|    unsigned int gid;
  235|   151k|    unsigned int is_kem = 0;
  236|   151k|    int ret = 0;
  237|       |
  238|   151k|    if (ctx->group_list_max_len == ctx->group_list_len) {
  ------------------
  |  Branch (238:9): [True: 14.9k, False: 136k]
  ------------------
  239|  14.9k|        TLS_GROUP_INFO *tmp = NULL;
  240|       |
  241|  14.9k|        if (ctx->group_list_max_len == 0)
  ------------------
  |  Branch (241:13): [True: 2.56k, False: 12.3k]
  ------------------
  242|  2.56k|            tmp = OPENSSL_malloc_array(TLS_GROUP_LIST_MALLOC_BLOCK_SIZE,
  ------------------
  |  |  110|  2.56k|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  243|  14.9k|                sizeof(TLS_GROUP_INFO));
  244|  12.3k|        else
  245|  12.3k|            tmp = OPENSSL_realloc_array(ctx->group_list,
  ------------------
  |  |  124|  12.3k|    CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  246|  14.9k|                ctx->group_list_max_len
  247|  14.9k|                    + TLS_GROUP_LIST_MALLOC_BLOCK_SIZE,
  248|  14.9k|                sizeof(TLS_GROUP_INFO));
  249|  14.9k|        if (tmp == NULL)
  ------------------
  |  Branch (249:13): [True: 0, False: 14.9k]
  ------------------
  250|      0|            return 0;
  251|  14.9k|        ctx->group_list = tmp;
  252|  14.9k|        memset(tmp + ctx->group_list_max_len,
  253|  14.9k|            0,
  254|  14.9k|            sizeof(TLS_GROUP_INFO) * TLS_GROUP_LIST_MALLOC_BLOCK_SIZE);
  ------------------
  |  |  225|  14.9k|#define TLS_GROUP_LIST_MALLOC_BLOCK_SIZE 10
  ------------------
  255|  14.9k|        ctx->group_list_max_len += TLS_GROUP_LIST_MALLOC_BLOCK_SIZE;
  ------------------
  |  |  225|  14.9k|#define TLS_GROUP_LIST_MALLOC_BLOCK_SIZE 10
  ------------------
  256|  14.9k|    }
  257|       |
  258|   151k|    ginf = &ctx->group_list[ctx->group_list_len];
  259|       |
  260|   151k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_NAME);
  ------------------
  |  |  156|   151k|# define OSSL_CAPABILITY_TLS_GROUP_NAME "tls-group-name"
  ------------------
  261|   151k|    if (p == NULL || p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|   151k|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (261:9): [True: 0, False: 151k]
  |  Branch (261:22): [True: 0, False: 151k]
  ------------------
  262|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  263|      0|        goto err;
  264|      0|    }
  265|   151k|    ginf->tlsname = OPENSSL_strdup(p->data);
  ------------------
  |  |  135|   151k|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  266|   151k|    if (ginf->tlsname == NULL)
  ------------------
  |  Branch (266:9): [True: 0, False: 151k]
  ------------------
  267|      0|        goto err;
  268|       |
  269|   151k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_NAME_INTERNAL);
  ------------------
  |  |  157|   151k|# define OSSL_CAPABILITY_TLS_GROUP_NAME_INTERNAL "tls-group-name-internal"
  ------------------
  270|   151k|    if (p == NULL || p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|   151k|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (270:9): [True: 0, False: 151k]
  |  Branch (270:22): [True: 0, False: 151k]
  ------------------
  271|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|        goto err;
  273|      0|    }
  274|   151k|    ginf->realname = OPENSSL_strdup(p->data);
  ------------------
  |  |  135|   151k|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  275|   151k|    if (ginf->realname == NULL)
  ------------------
  |  Branch (275:9): [True: 0, False: 151k]
  ------------------
  276|      0|        goto err;
  277|       |
  278|   151k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_ID);
  ------------------
  |  |  150|   151k|# define OSSL_CAPABILITY_TLS_GROUP_ID "tls-group-id"
  ------------------
  279|   151k|    if (p == NULL || !OSSL_PARAM_get_uint(p, &gid) || gid > UINT16_MAX) {
  ------------------
  |  Branch (279:9): [True: 0, False: 151k]
  |  Branch (279:22): [True: 0, False: 151k]
  |  Branch (279:55): [True: 0, False: 151k]
  ------------------
  280|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  281|      0|        goto err;
  282|      0|    }
  283|   151k|    ginf->group_id = (uint16_t)gid;
  284|       |
  285|   151k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_ALG);
  ------------------
  |  |  149|   151k|# define OSSL_CAPABILITY_TLS_GROUP_ALG "tls-group-alg"
  ------------------
  286|   151k|    if (p == NULL || p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|   151k|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (286:9): [True: 0, False: 151k]
  |  Branch (286:22): [True: 0, False: 151k]
  ------------------
  287|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  288|      0|        goto err;
  289|      0|    }
  290|   151k|    ginf->algorithm = OPENSSL_strdup(p->data);
  ------------------
  |  |  135|   151k|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  291|   151k|    if (ginf->algorithm == NULL)
  ------------------
  |  Branch (291:9): [True: 0, False: 151k]
  ------------------
  292|      0|        goto err;
  293|       |
  294|   151k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_SECURITY_BITS);
  ------------------
  |  |  158|   151k|# define OSSL_CAPABILITY_TLS_GROUP_SECURITY_BITS "tls-group-sec-bits"
  ------------------
  295|   151k|    if (p == NULL || !OSSL_PARAM_get_uint(p, &ginf->secbits)) {
  ------------------
  |  Branch (295:9): [True: 0, False: 151k]
  |  Branch (295:22): [True: 0, False: 151k]
  ------------------
  296|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  297|      0|        goto err;
  298|      0|    }
  299|       |
  300|   151k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_IS_KEM);
  ------------------
  |  |  151|   151k|# define OSSL_CAPABILITY_TLS_GROUP_IS_KEM "tls-group-is-kem"
  ------------------
  301|   151k|    if (p != NULL && (!OSSL_PARAM_get_uint(p, &is_kem) || is_kem > 1)) {
  ------------------
  |  Branch (301:9): [True: 151k, False: 0]
  |  Branch (301:23): [True: 0, False: 151k]
  |  Branch (301:59): [True: 0, False: 151k]
  ------------------
  302|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  303|      0|        goto err;
  304|      0|    }
  305|   151k|    ginf->is_kem = 1 & is_kem;
  306|       |
  307|   151k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_MIN_TLS);
  ------------------
  |  |  155|   151k|# define OSSL_CAPABILITY_TLS_GROUP_MIN_TLS "tls-min-tls"
  ------------------
  308|   151k|    if (p == NULL || !OSSL_PARAM_get_int(p, &ginf->mintls)) {
  ------------------
  |  Branch (308:9): [True: 0, False: 151k]
  |  Branch (308:22): [True: 0, False: 151k]
  ------------------
  309|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  310|      0|        goto err;
  311|      0|    }
  312|       |
  313|   151k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_MAX_TLS);
  ------------------
  |  |  153|   151k|# define OSSL_CAPABILITY_TLS_GROUP_MAX_TLS "tls-max-tls"
  ------------------
  314|   151k|    if (p == NULL || !OSSL_PARAM_get_int(p, &ginf->maxtls)) {
  ------------------
  |  Branch (314:9): [True: 0, False: 151k]
  |  Branch (314:22): [True: 0, False: 151k]
  ------------------
  315|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  316|      0|        goto err;
  317|      0|    }
  318|       |
  319|   151k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_MIN_DTLS);
  ------------------
  |  |  154|   151k|# define OSSL_CAPABILITY_TLS_GROUP_MIN_DTLS "tls-min-dtls"
  ------------------
  320|   151k|    if (p == NULL || !OSSL_PARAM_get_int(p, &ginf->mindtls)) {
  ------------------
  |  Branch (320:9): [True: 0, False: 151k]
  |  Branch (320:22): [True: 0, False: 151k]
  ------------------
  321|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  322|      0|        goto err;
  323|      0|    }
  324|       |
  325|   151k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_GROUP_MAX_DTLS);
  ------------------
  |  |  152|   151k|# define OSSL_CAPABILITY_TLS_GROUP_MAX_DTLS "tls-max-dtls"
  ------------------
  326|   151k|    if (p == NULL || !OSSL_PARAM_get_int(p, &ginf->maxdtls)) {
  ------------------
  |  Branch (326:9): [True: 0, False: 151k]
  |  Branch (326:22): [True: 0, False: 151k]
  ------------------
  327|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  328|      0|        goto err;
  329|      0|    }
  330|       |    /*
  331|       |     * Now check that the algorithm is actually usable for our property query
  332|       |     * string. Regardless of the result we still return success because we have
  333|       |     * successfully processed this group, even though we may decide not to use
  334|       |     * it.
  335|       |     */
  336|   151k|    ret = 1;
  337|   151k|    ERR_set_mark();
  338|   151k|    keymgmt = EVP_KEYMGMT_fetch(ctx->libctx, ginf->algorithm, ctx->propq);
  339|   151k|    if (keymgmt != NULL) {
  ------------------
  |  Branch (339:9): [True: 146k, False: 4.89k]
  ------------------
  340|       |        /* We have successfully fetched the algorithm, we can use the group. */
  341|   146k|        ctx->group_list_len++;
  342|   146k|        ginf = NULL;
  343|   146k|        EVP_KEYMGMT_free(keymgmt);
  344|   146k|    }
  345|   151k|    ERR_pop_to_mark();
  346|   151k|err:
  347|   151k|    if (ginf != NULL) {
  ------------------
  |  Branch (347:9): [True: 4.89k, False: 146k]
  ------------------
  348|  4.89k|        OPENSSL_free(ginf->tlsname);
  ------------------
  |  |  131|  4.89k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  349|  4.89k|        OPENSSL_free(ginf->realname);
  ------------------
  |  |  131|  4.89k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  350|  4.89k|        OPENSSL_free(ginf->algorithm);
  ------------------
  |  |  131|  4.89k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  351|       |        ginf->algorithm = ginf->tlsname = ginf->realname = NULL;
  352|  4.89k|    }
  353|   151k|    return ret;
  354|   151k|}
t1_lib.c:discover_provider_sigalgs:
  666|  3.18k|{
  667|  3.18k|    struct provider_ctx_data_st pgd;
  668|       |
  669|  3.18k|    pgd.ctx = vctx;
  670|  3.18k|    pgd.provider = provider;
  671|  3.18k|    OSSL_PROVIDER_get_capabilities(provider, "TLS-SIGALG",
  672|  3.18k|        add_provider_sigalgs, &pgd);
  673|       |    /*
  674|       |     * Always OK, even if provider doesn't support the capability:
  675|       |     * Reconsider testing retval when legacy sigalgs are also loaded this way.
  676|       |     */
  677|  3.18k|    return 1;
  678|  3.18k|}
t1_lib.c:add_provider_sigalgs:
  386|  7.68k|{
  387|  7.68k|    struct provider_ctx_data_st *pgd = data;
  388|  7.68k|    SSL_CTX *ctx = pgd->ctx;
  389|  7.68k|    OSSL_PROVIDER *provider = pgd->provider;
  390|  7.68k|    const OSSL_PARAM *p;
  391|  7.68k|    TLS_SIGALG_INFO *sinf = NULL;
  392|  7.68k|    EVP_KEYMGMT *keymgmt;
  393|  7.68k|    const char *keytype;
  394|  7.68k|    unsigned int code_point = 0;
  395|  7.68k|    int ret = 0;
  396|       |
  397|  7.68k|    if (ctx->sigalg_list_max_len == ctx->sigalg_list_len) {
  ------------------
  |  Branch (397:9): [True: 2.56k, False: 5.12k]
  ------------------
  398|  2.56k|        TLS_SIGALG_INFO *tmp = NULL;
  399|       |
  400|  2.56k|        if (ctx->sigalg_list_max_len == 0)
  ------------------
  |  Branch (400:13): [True: 2.56k, False: 0]
  ------------------
  401|  2.56k|            tmp = OPENSSL_malloc_array(TLS_SIGALG_LIST_MALLOC_BLOCK_SIZE,
  ------------------
  |  |  110|  2.56k|    CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  402|  2.56k|                sizeof(TLS_SIGALG_INFO));
  403|      0|        else
  404|      0|            tmp = OPENSSL_realloc_array(ctx->sigalg_list,
  ------------------
  |  |  124|      0|    CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  405|  2.56k|                ctx->sigalg_list_max_len
  406|  2.56k|                    + TLS_SIGALG_LIST_MALLOC_BLOCK_SIZE,
  407|  2.56k|                sizeof(TLS_SIGALG_INFO));
  408|  2.56k|        if (tmp == NULL)
  ------------------
  |  Branch (408:13): [True: 0, False: 2.56k]
  ------------------
  409|      0|            return 0;
  410|  2.56k|        ctx->sigalg_list = tmp;
  411|  2.56k|        memset(tmp + ctx->sigalg_list_max_len, 0,
  412|  2.56k|            sizeof(TLS_SIGALG_INFO) * TLS_SIGALG_LIST_MALLOC_BLOCK_SIZE);
  ------------------
  |  |  383|  2.56k|#define TLS_SIGALG_LIST_MALLOC_BLOCK_SIZE 10
  ------------------
  413|  2.56k|        ctx->sigalg_list_max_len += TLS_SIGALG_LIST_MALLOC_BLOCK_SIZE;
  ------------------
  |  |  383|  2.56k|#define TLS_SIGALG_LIST_MALLOC_BLOCK_SIZE 10
  ------------------
  414|  2.56k|    }
  415|       |
  416|  7.68k|    sinf = &ctx->sigalg_list[ctx->sigalg_list_len];
  417|       |
  418|       |    /* First, mandatory parameters */
  419|  7.68k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_NAME);
  ------------------
  |  |  169|  7.68k|# define OSSL_CAPABILITY_TLS_SIGALG_NAME "tls-sigalg-name"
  ------------------
  420|  7.68k|    if (p == NULL || p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|  7.68k|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (420:9): [True: 0, False: 7.68k]
  |  Branch (420:22): [True: 0, False: 7.68k]
  ------------------
  421|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  422|      0|        goto err;
  423|      0|    }
  424|  7.68k|    OPENSSL_free(sinf->sigalg_name);
  ------------------
  |  |  131|  7.68k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  425|  7.68k|    sinf->sigalg_name = OPENSSL_strdup(p->data);
  ------------------
  |  |  135|  7.68k|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  426|  7.68k|    if (sinf->sigalg_name == NULL)
  ------------------
  |  Branch (426:9): [True: 0, False: 7.68k]
  ------------------
  427|      0|        goto err;
  428|       |
  429|  7.68k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_IANA_NAME);
  ------------------
  |  |  162|  7.68k|# define OSSL_CAPABILITY_TLS_SIGALG_IANA_NAME "tls-sigalg-iana-name"
  ------------------
  430|  7.68k|    if (p == NULL || p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|  7.68k|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (430:9): [True: 0, False: 7.68k]
  |  Branch (430:22): [True: 0, False: 7.68k]
  ------------------
  431|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  432|      0|        goto err;
  433|      0|    }
  434|  7.68k|    OPENSSL_free(sinf->name);
  ------------------
  |  |  131|  7.68k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  435|  7.68k|    sinf->name = OPENSSL_strdup(p->data);
  ------------------
  |  |  135|  7.68k|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  436|  7.68k|    if (sinf->name == NULL)
  ------------------
  |  Branch (436:9): [True: 0, False: 7.68k]
  ------------------
  437|      0|        goto err;
  438|       |
  439|  7.68k|    p = OSSL_PARAM_locate_const(params,
  440|  7.68k|        OSSL_CAPABILITY_TLS_SIGALG_CODE_POINT);
  ------------------
  |  |  159|  7.68k|# define OSSL_CAPABILITY_TLS_SIGALG_CODE_POINT "tls-sigalg-code-point"
  ------------------
  441|  7.68k|    if (p == NULL
  ------------------
  |  Branch (441:9): [True: 0, False: 7.68k]
  ------------------
  442|  7.68k|        || !OSSL_PARAM_get_uint(p, &code_point)
  ------------------
  |  Branch (442:12): [True: 0, False: 7.68k]
  ------------------
  443|  7.68k|        || code_point > UINT16_MAX) {
  ------------------
  |  Branch (443:12): [True: 0, False: 7.68k]
  ------------------
  444|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  445|      0|        goto err;
  446|      0|    }
  447|  7.68k|    sinf->code_point = (uint16_t)code_point;
  448|       |
  449|  7.68k|    p = OSSL_PARAM_locate_const(params,
  450|  7.68k|        OSSL_CAPABILITY_TLS_SIGALG_SECURITY_BITS);
  ------------------
  |  |  171|  7.68k|# define OSSL_CAPABILITY_TLS_SIGALG_SECURITY_BITS "tls-sigalg-sec-bits"
  ------------------
  451|  7.68k|    if (p == NULL || !OSSL_PARAM_get_uint(p, &sinf->secbits)) {
  ------------------
  |  Branch (451:9): [True: 0, False: 7.68k]
  |  Branch (451:22): [True: 0, False: 7.68k]
  ------------------
  452|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  453|      0|        goto err;
  454|      0|    }
  455|       |
  456|       |    /* Now, optional parameters */
  457|  7.68k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_OID);
  ------------------
  |  |  170|  7.68k|# define OSSL_CAPABILITY_TLS_SIGALG_OID "tls-sigalg-oid"
  ------------------
  458|  7.68k|    if (p == NULL) {
  ------------------
  |  Branch (458:9): [True: 0, False: 7.68k]
  ------------------
  459|      0|        sinf->sigalg_oid = NULL;
  460|  7.68k|    } else if (p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|  7.68k|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (460:16): [True: 0, False: 7.68k]
  ------------------
  461|      0|        goto err;
  462|  7.68k|    } else {
  463|  7.68k|        OPENSSL_free(sinf->sigalg_oid);
  ------------------
  |  |  131|  7.68k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  464|  7.68k|        sinf->sigalg_oid = OPENSSL_strdup(p->data);
  ------------------
  |  |  135|  7.68k|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  465|  7.68k|        if (sinf->sigalg_oid == NULL)
  ------------------
  |  Branch (465:13): [True: 0, False: 7.68k]
  ------------------
  466|      0|            goto err;
  467|  7.68k|    }
  468|       |
  469|  7.68k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_SIG_NAME);
  ------------------
  |  |  172|  7.68k|# define OSSL_CAPABILITY_TLS_SIGALG_SIG_NAME "tls-sigalg-sig-name"
  ------------------
  470|  7.68k|    if (p == NULL) {
  ------------------
  |  Branch (470:9): [True: 7.68k, False: 0]
  ------------------
  471|  7.68k|        sinf->sig_name = NULL;
  472|  7.68k|    } else if (p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|      0|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (472:16): [True: 0, False: 0]
  ------------------
  473|      0|        goto err;
  474|      0|    } else {
  475|      0|        OPENSSL_free(sinf->sig_name);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  476|      0|        sinf->sig_name = OPENSSL_strdup(p->data);
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  477|      0|        if (sinf->sig_name == NULL)
  ------------------
  |  Branch (477:13): [True: 0, False: 0]
  ------------------
  478|      0|            goto err;
  479|      0|    }
  480|       |
  481|  7.68k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_SIG_OID);
  ------------------
  |  |  173|  7.68k|# define OSSL_CAPABILITY_TLS_SIGALG_SIG_OID "tls-sigalg-sig-oid"
  ------------------
  482|  7.68k|    if (p == NULL) {
  ------------------
  |  Branch (482:9): [True: 7.68k, False: 0]
  ------------------
  483|  7.68k|        sinf->sig_oid = NULL;
  484|  7.68k|    } else if (p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|      0|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (484:16): [True: 0, False: 0]
  ------------------
  485|      0|        goto err;
  486|      0|    } else {
  487|      0|        OPENSSL_free(sinf->sig_oid);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  488|      0|        sinf->sig_oid = OPENSSL_strdup(p->data);
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  489|      0|        if (sinf->sig_oid == NULL)
  ------------------
  |  Branch (489:13): [True: 0, False: 0]
  ------------------
  490|      0|            goto err;
  491|      0|    }
  492|       |
  493|  7.68k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_HASH_NAME);
  ------------------
  |  |  160|  7.68k|# define OSSL_CAPABILITY_TLS_SIGALG_HASH_NAME "tls-sigalg-hash-name"
  ------------------
  494|  7.68k|    if (p == NULL) {
  ------------------
  |  Branch (494:9): [True: 7.68k, False: 0]
  ------------------
  495|  7.68k|        sinf->hash_name = NULL;
  496|  7.68k|    } else if (p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|      0|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (496:16): [True: 0, False: 0]
  ------------------
  497|      0|        goto err;
  498|      0|    } else {
  499|      0|        OPENSSL_free(sinf->hash_name);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  500|      0|        sinf->hash_name = OPENSSL_strdup(p->data);
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  501|      0|        if (sinf->hash_name == NULL)
  ------------------
  |  Branch (501:13): [True: 0, False: 0]
  ------------------
  502|      0|            goto err;
  503|      0|    }
  504|       |
  505|  7.68k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_HASH_OID);
  ------------------
  |  |  161|  7.68k|# define OSSL_CAPABILITY_TLS_SIGALG_HASH_OID "tls-sigalg-hash-oid"
  ------------------
  506|  7.68k|    if (p == NULL) {
  ------------------
  |  Branch (506:9): [True: 7.68k, False: 0]
  ------------------
  507|  7.68k|        sinf->hash_oid = NULL;
  508|  7.68k|    } else if (p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|      0|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (508:16): [True: 0, False: 0]
  ------------------
  509|      0|        goto err;
  510|      0|    } else {
  511|      0|        OPENSSL_free(sinf->hash_oid);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  512|      0|        sinf->hash_oid = OPENSSL_strdup(p->data);
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  513|      0|        if (sinf->hash_oid == NULL)
  ------------------
  |  Branch (513:13): [True: 0, False: 0]
  ------------------
  514|      0|            goto err;
  515|      0|    }
  516|       |
  517|  7.68k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_KEYTYPE);
  ------------------
  |  |  163|  7.68k|# define OSSL_CAPABILITY_TLS_SIGALG_KEYTYPE "tls-sigalg-keytype"
  ------------------
  518|  7.68k|    if (p == NULL) {
  ------------------
  |  Branch (518:9): [True: 7.68k, False: 0]
  ------------------
  519|  7.68k|        sinf->keytype = NULL;
  520|  7.68k|    } else if (p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|      0|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (520:16): [True: 0, False: 0]
  ------------------
  521|      0|        goto err;
  522|      0|    } else {
  523|      0|        OPENSSL_free(sinf->keytype);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  524|      0|        sinf->keytype = OPENSSL_strdup(p->data);
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  525|      0|        if (sinf->keytype == NULL)
  ------------------
  |  Branch (525:13): [True: 0, False: 0]
  ------------------
  526|      0|            goto err;
  527|      0|    }
  528|       |
  529|  7.68k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_KEYTYPE_OID);
  ------------------
  |  |  164|  7.68k|# define OSSL_CAPABILITY_TLS_SIGALG_KEYTYPE_OID "tls-sigalg-keytype-oid"
  ------------------
  530|  7.68k|    if (p == NULL) {
  ------------------
  |  Branch (530:9): [True: 7.68k, False: 0]
  ------------------
  531|  7.68k|        sinf->keytype_oid = NULL;
  532|  7.68k|    } else if (p->data_type != OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|      0|#define OSSL_PARAM_UTF8_STRING 4
  ------------------
  |  Branch (532:16): [True: 0, False: 0]
  ------------------
  533|      0|        goto err;
  534|      0|    } else {
  535|      0|        OPENSSL_free(sinf->keytype_oid);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  536|      0|        sinf->keytype_oid = OPENSSL_strdup(p->data);
  ------------------
  |  |  135|      0|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  537|      0|        if (sinf->keytype_oid == NULL)
  ------------------
  |  Branch (537:13): [True: 0, False: 0]
  ------------------
  538|      0|            goto err;
  539|      0|    }
  540|       |
  541|       |    /* Optional, not documented prior to 3.5 */
  542|  7.68k|    sinf->mindtls = sinf->maxdtls = -1;
  543|  7.68k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_MIN_DTLS);
  ------------------
  |  |  167|  7.68k|# define OSSL_CAPABILITY_TLS_SIGALG_MIN_DTLS "tls-min-dtls"
  ------------------
  544|  7.68k|    if (p != NULL && !OSSL_PARAM_get_int(p, &sinf->mindtls)) {
  ------------------
  |  Branch (544:9): [True: 7.68k, False: 0]
  |  Branch (544:22): [True: 0, False: 7.68k]
  ------------------
  545|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  546|      0|        goto err;
  547|      0|    }
  548|  7.68k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_MAX_DTLS);
  ------------------
  |  |  165|  7.68k|# define OSSL_CAPABILITY_TLS_SIGALG_MAX_DTLS "tls-max-dtls"
  ------------------
  549|  7.68k|    if (p != NULL && !OSSL_PARAM_get_int(p, &sinf->maxdtls)) {
  ------------------
  |  Branch (549:9): [True: 7.68k, False: 0]
  |  Branch (549:22): [True: 0, False: 7.68k]
  ------------------
  550|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  551|      0|        goto err;
  552|      0|    }
  553|       |    /* DTLS version numbers grow downward */
  554|  7.68k|    if ((sinf->maxdtls != 0) && (sinf->maxdtls != -1) && ((sinf->maxdtls > sinf->mindtls))) {
  ------------------
  |  Branch (554:9): [True: 7.68k, False: 0]
  |  Branch (554:33): [True: 0, False: 7.68k]
  |  Branch (554:58): [True: 0, False: 0]
  ------------------
  555|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  556|      0|        goto err;
  557|      0|    }
  558|       |    /* No provider sigalgs are supported in DTLS, reset after checking. */
  559|  7.68k|    sinf->mindtls = sinf->maxdtls = -1;
  560|       |
  561|       |    /* The remaining parameters below are mandatory again */
  562|  7.68k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_MIN_TLS);
  ------------------
  |  |  168|  7.68k|# define OSSL_CAPABILITY_TLS_SIGALG_MIN_TLS "tls-min-tls"
  ------------------
  563|  7.68k|    if (p == NULL || !OSSL_PARAM_get_int(p, &sinf->mintls)) {
  ------------------
  |  Branch (563:9): [True: 0, False: 7.68k]
  |  Branch (563:22): [True: 0, False: 7.68k]
  ------------------
  564|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  565|      0|        goto err;
  566|      0|    }
  567|  7.68k|    p = OSSL_PARAM_locate_const(params, OSSL_CAPABILITY_TLS_SIGALG_MAX_TLS);
  ------------------
  |  |  166|  7.68k|# define OSSL_CAPABILITY_TLS_SIGALG_MAX_TLS "tls-max-tls"
  ------------------
  568|  7.68k|    if (p == NULL || !OSSL_PARAM_get_int(p, &sinf->maxtls)) {
  ------------------
  |  Branch (568:9): [True: 0, False: 7.68k]
  |  Branch (568:22): [True: 0, False: 7.68k]
  ------------------
  569|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  570|      0|        goto err;
  571|      0|    }
  572|  7.68k|    if ((sinf->maxtls != 0) && (sinf->maxtls != -1) && ((sinf->maxtls < sinf->mintls))) {
  ------------------
  |  Branch (572:9): [True: 0, False: 7.68k]
  |  Branch (572:32): [True: 0, False: 0]
  |  Branch (572:56): [True: 0, False: 0]
  ------------------
  573|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  574|      0|        goto err;
  575|      0|    }
  576|  7.68k|    if ((sinf->mintls != 0) && (sinf->mintls != -1) && ((sinf->mintls > TLS1_3_VERSION)))
  ------------------
  |  |   27|  7.68k|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (576:9): [True: 7.68k, False: 0]
  |  Branch (576:32): [True: 7.68k, False: 0]
  |  Branch (576:56): [True: 0, False: 7.68k]
  ------------------
  577|      0|        sinf->mintls = sinf->maxtls = -1;
  578|  7.68k|    if ((sinf->maxtls != 0) && (sinf->maxtls != -1) && ((sinf->maxtls < TLS1_3_VERSION)))
  ------------------
  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (578:9): [True: 0, False: 7.68k]
  |  Branch (578:32): [True: 0, False: 0]
  |  Branch (578:56): [True: 0, False: 0]
  ------------------
  579|      0|        sinf->mintls = sinf->maxtls = -1;
  580|       |
  581|       |    /* Ignore unusable sigalgs */
  582|  7.68k|    if (sinf->mintls == -1 && sinf->mindtls == -1) {
  ------------------
  |  Branch (582:9): [True: 0, False: 7.68k]
  |  Branch (582:31): [True: 0, False: 0]
  ------------------
  583|      0|        ret = 1;
  584|      0|        goto err;
  585|      0|    }
  586|       |
  587|       |    /*
  588|       |     * Now check that the algorithm is actually usable for our property query
  589|       |     * string. Regardless of the result we still return success because we have
  590|       |     * successfully processed this signature, even though we may decide not to
  591|       |     * use it.
  592|       |     */
  593|  7.68k|    ret = 1;
  594|  7.68k|    ERR_set_mark();
  595|  7.68k|    keytype = inferred_keytype(sinf);
  596|  7.68k|    keymgmt = EVP_KEYMGMT_fetch(ctx->libctx, keytype, ctx->propq);
  597|  7.68k|    if (keymgmt != NULL) {
  ------------------
  |  Branch (597:9): [True: 7.43k, False: 249]
  ------------------
  598|       |        /*
  599|       |         * We have successfully fetched the algorithm - however if the provider
  600|       |         * doesn't match this one then we ignore it.
  601|       |         *
  602|       |         * Note: We're cheating a little here. Technically if the same algorithm
  603|       |         * is available from more than one provider then it is undefined which
  604|       |         * implementation you will get back. Theoretically this could be
  605|       |         * different every time...we assume here that you'll always get the
  606|       |         * same one back if you repeat the exact same fetch. Is this a reasonable
  607|       |         * assumption to make (in which case perhaps we should document this
  608|       |         * behaviour)?
  609|       |         */
  610|  7.43k|        if (EVP_KEYMGMT_get0_provider(keymgmt) == provider) {
  ------------------
  |  Branch (610:13): [True: 7.43k, False: 0]
  ------------------
  611|       |            /*
  612|       |             * We have a match - so we could use this signature;
  613|       |             * Check proper object registration first, though.
  614|       |             * Don't care about return value as this may have been
  615|       |             * done within providers or previous calls to
  616|       |             * add_provider_sigalgs.
  617|       |             */
  618|  7.43k|            OBJ_create(sinf->sigalg_oid, sinf->sigalg_name, NULL);
  619|       |            /* sanity check: Without successful registration don't use alg */
  620|  7.43k|            if ((OBJ_txt2nid(sinf->sigalg_name) == NID_undef) || (OBJ_nid2obj(OBJ_txt2nid(sinf->sigalg_name)) == NULL)) {
  ------------------
  |  |   18|  7.43k|#define NID_undef                       0
  ------------------
  |  Branch (620:17): [True: 0, False: 7.43k]
  |  Branch (620:66): [True: 0, False: 7.43k]
  ------------------
  621|      0|                ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  622|      0|                goto err;
  623|      0|            }
  624|  7.43k|            if (sinf->sig_name != NULL)
  ------------------
  |  Branch (624:17): [True: 0, False: 7.43k]
  ------------------
  625|      0|                OBJ_create(sinf->sig_oid, sinf->sig_name, NULL);
  626|  7.43k|            if (sinf->keytype != NULL)
  ------------------
  |  Branch (626:17): [True: 0, False: 7.43k]
  ------------------
  627|      0|                OBJ_create(sinf->keytype_oid, sinf->keytype, NULL);
  628|  7.43k|            if (sinf->hash_name != NULL)
  ------------------
  |  Branch (628:17): [True: 0, False: 7.43k]
  ------------------
  629|      0|                OBJ_create(sinf->hash_oid, sinf->hash_name, NULL);
  630|  7.43k|            OBJ_add_sigid(OBJ_txt2nid(sinf->sigalg_name),
  631|  7.43k|                (sinf->hash_name != NULL
  ------------------
  |  Branch (631:18): [True: 0, False: 7.43k]
  ------------------
  632|  7.43k|                        ? OBJ_txt2nid(sinf->hash_name)
  633|  7.43k|                        : NID_undef),
  ------------------
  |  |   18|  7.43k|#define NID_undef                       0
  ------------------
  634|  7.43k|                OBJ_txt2nid(keytype));
  635|  7.43k|            ctx->sigalg_list_len++;
  636|  7.43k|            sinf = NULL;
  637|  7.43k|        }
  638|  7.43k|        EVP_KEYMGMT_free(keymgmt);
  639|  7.43k|    }
  640|  7.68k|    ERR_pop_to_mark();
  641|  7.68k|err:
  642|  7.68k|    if (sinf != NULL) {
  ------------------
  |  Branch (642:9): [True: 249, False: 7.43k]
  ------------------
  643|    249|        OPENSSL_free(sinf->name);
  ------------------
  |  |  131|    249|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  644|    249|        sinf->name = NULL;
  645|    249|        OPENSSL_free(sinf->sigalg_name);
  ------------------
  |  |  131|    249|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  646|    249|        sinf->sigalg_name = NULL;
  647|    249|        OPENSSL_free(sinf->sigalg_oid);
  ------------------
  |  |  131|    249|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  648|    249|        sinf->sigalg_oid = NULL;
  649|    249|        OPENSSL_free(sinf->sig_name);
  ------------------
  |  |  131|    249|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  650|    249|        sinf->sig_name = NULL;
  651|    249|        OPENSSL_free(sinf->sig_oid);
  ------------------
  |  |  131|    249|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  652|    249|        sinf->sig_oid = NULL;
  653|    249|        OPENSSL_free(sinf->hash_name);
  ------------------
  |  |  131|    249|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  654|    249|        sinf->hash_name = NULL;
  655|    249|        OPENSSL_free(sinf->hash_oid);
  ------------------
  |  |  131|    249|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  656|    249|        sinf->hash_oid = NULL;
  657|    249|        OPENSSL_free(sinf->keytype);
  ------------------
  |  |  131|    249|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  658|    249|        sinf->keytype = NULL;
  659|    249|        OPENSSL_free(sinf->keytype_oid);
  ------------------
  |  |  131|    249|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  660|       |        sinf->keytype_oid = NULL;
  661|    249|    }
  662|  7.68k|    return ret;
  663|  7.68k|}
t1_lib.c:inferred_keytype:
  375|  15.1k|{
  376|  15.1k|    return (sinf->keytype != NULL
  ------------------
  |  Branch (376:13): [True: 0, False: 15.1k]
  ------------------
  377|  15.1k|            ? sinf->keytype
  378|  15.1k|            : (sinf->sig_name != NULL
  ------------------
  |  Branch (378:16): [True: 0, False: 15.1k]
  ------------------
  379|  15.1k|                      ? sinf->sig_name
  380|  15.1k|                      : sinf->sigalg_name));
  381|  15.1k|}
t1_lib.c:tuple_cb:
 1562|  10.6k|{
 1563|  10.6k|    gid_cb_st *garg = arg;
 1564|  10.6k|    int retval = 1; /* We assume success */
 1565|  10.6k|    char *restored_tuple_string;
 1566|       |
 1567|       |    /* Sanity checks */
 1568|  10.6k|    if (garg == NULL || tuple == NULL || len <= 0) {
  ------------------
  |  Branch (1568:9): [True: 0, False: 10.6k]
  |  Branch (1568:25): [True: 3, False: 10.6k]
  |  Branch (1568:42): [True: 0, False: 10.6k]
  ------------------
 1569|      3|        ERR_raise(ERR_LIB_SSL, SSL_R_UNSUPPORTED_CONFIG_VALUE);
  ------------------
  |  |  404|      3|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      3|    (ERR_new(),                                                  \
  |  |  |  |  407|      3|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      3|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      3|        ERR_set_error)
  |  |  ------------------
  ------------------
 1570|      3|        return 0;
 1571|      3|    }
 1572|       |
 1573|  10.6k|    if (garg->inner && !garg->first && !close_tuple(garg))
  ------------------
  |  Branch (1573:9): [True: 13, False: 10.6k]
  |  Branch (1573:24): [True: 9, False: 4]
  |  Branch (1573:40): [True: 0, False: 9]
  ------------------
 1574|      0|        return 0;
 1575|  10.6k|    garg->first = 0;
 1576|       |
 1577|       |    /* Convert to \0-terminated string */
 1578|  10.6k|    restored_tuple_string = OPENSSL_malloc(len + 1 /* \0 */);
  ------------------
  |  |  106|  10.6k|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1579|  10.6k|    if (restored_tuple_string == NULL)
  ------------------
  |  Branch (1579:9): [True: 0, False: 10.6k]
  ------------------
 1580|      0|        return 0;
 1581|  10.6k|    memcpy(restored_tuple_string, tuple, len);
 1582|  10.6k|    restored_tuple_string[len] = '\0';
 1583|       |
 1584|       |    /* Analyze group list of this tuple */
 1585|  10.6k|    retval = CONF_parse_list(restored_tuple_string, GROUP_DELIMITER_CHARACTER, 1, gid_cb, arg);
  ------------------
  |  | 1208|  10.6k|#define GROUP_DELIMITER_CHARACTER ':'
  ------------------
 1586|       |
 1587|       |    /* We don't need the \o-terminated string anymore */
 1588|  10.6k|    OPENSSL_free(restored_tuple_string);
  ------------------
  |  |  131|  10.6k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1589|       |
 1590|  10.6k|    if (!garg->inner && !close_tuple(garg))
  ------------------
  |  Branch (1590:9): [True: 10.6k, False: 13]
  |  Branch (1590:25): [True: 0, False: 10.6k]
  ------------------
 1591|      0|        return 0;
 1592|  10.6k|    return retval;
 1593|  10.6k|}
t1_lib.c:close_tuple:
 1548|  10.6k|{
 1549|  10.6k|    size_t gidcnt = garg->tuplcnt_arr[garg->tplcnt];
 1550|       |
 1551|  10.6k|    if (gidcnt == 0)
  ------------------
  |  Branch (1551:9): [True: 412, False: 10.2k]
  ------------------
 1552|    412|        return 1;
 1553|  10.2k|    if (!grow_tuples(garg))
  ------------------
  |  Branch (1553:9): [True: 0, False: 10.2k]
  ------------------
 1554|      0|        return 0;
 1555|       |
 1556|  10.2k|    garg->tuplcnt_arr[++garg->tplcnt] = 0;
 1557|  10.2k|    return 1;
 1558|  10.2k|}
t1_lib.c:grow_tuples:
 1532|  10.2k|{
 1533|  10.2k|    if (garg->tplcnt == garg->tplmax) {
  ------------------
  |  Branch (1533:9): [True: 0, False: 10.2k]
  ------------------
 1534|      0|        size_t newcnt = garg->tplmax + GROUPLIST_INCREMENT;
  ------------------
  |  | 1193|      0|#define GROUPLIST_INCREMENT 32 /* Memory allocation chunk size (64 Bytes chunks ~= cache line) */
  ------------------
 1535|      0|        size_t *tmp = OPENSSL_realloc_array(garg->tuplcnt_arr,
  ------------------
  |  |  124|      0|    CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1536|      0|            newcnt, sizeof(*garg->tuplcnt_arr));
 1537|       |
 1538|      0|        if (tmp == NULL)
  ------------------
  |  Branch (1538:13): [True: 0, False: 0]
  ------------------
 1539|      0|            return 0;
 1540|       |
 1541|      0|        garg->tplmax = newcnt;
 1542|      0|        garg->tuplcnt_arr = tmp;
 1543|      0|    }
 1544|  10.2k|    return 1;
 1545|  10.2k|}
t1_lib.c:gid_cb:
 1264|  20.9k|{
 1265|  20.9k|    gid_cb_st *garg = arg;
 1266|  20.9k|    size_t i, j, k;
 1267|  20.9k|    uint16_t gid = 0;
 1268|  20.9k|    int found_group = 0;
 1269|  20.9k|    char etmp[GROUP_NAME_BUFFER_LENGTH];
 1270|  20.9k|    int retval = 1; /* We assume success */
 1271|  20.9k|    const char *current_prefix;
 1272|  20.9k|    int ignore_unknown = 0;
 1273|  20.9k|    int add_keyshare = 0;
 1274|  20.9k|    int remove_group = 0;
 1275|  20.9k|    size_t restored_prefix_index = 0;
 1276|  20.9k|    char *restored_default_group_string;
 1277|  20.9k|    int continue_while_loop = 1;
 1278|       |
 1279|       |    /* Sanity checks */
 1280|  20.9k|    if (garg == NULL || elem == NULL || len <= 0) {
  ------------------
  |  Branch (1280:9): [True: 0, False: 20.9k]
  |  Branch (1280:25): [True: 1, False: 20.9k]
  |  Branch (1280:41): [True: 0, False: 20.9k]
  ------------------
 1281|      1|        ERR_raise(ERR_LIB_SSL, SSL_R_UNSUPPORTED_CONFIG_VALUE);
  ------------------
  |  |  404|      1|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      1|    (ERR_new(),                                                  \
  |  |  |  |  407|      1|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      1|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      1|        ERR_set_error)
  |  |  ------------------
  ------------------
 1282|      1|        return 0;
 1283|      1|    }
 1284|       |
 1285|       |    /* Check the possible prefixes (remark: Leading and trailing spaces already cleared) */
 1286|  46.7k|    while (continue_while_loop && len > 0
  ------------------
  |  Branch (1286:12): [True: 46.6k, False: 18]
  |  Branch (1286:35): [True: 46.6k, False: 2]
  ------------------
 1287|  46.6k|        && ((current_prefix = strchr(prefixes, elem[0])) != NULL
  ------------------
  |  Branch (1287:13): [True: 25.7k, False: 20.9k]
  ------------------
 1288|  25.7k|            || OPENSSL_strncasecmp(current_prefix = (char *)DEFAULT_GROUPNAME_FIRST_CHARACTER, elem, 1) == 0)) {
  ------------------
  |  Branch (1288:16): [True: 24, False: 20.9k]
  ------------------
 1289|       |
 1290|  25.7k|        switch (*current_prefix) {
 1291|      0|        case TUPLE_DELIMITER_CHARACTER:
  ------------------
  |  | 1204|      0|#define TUPLE_DELIMITER_CHARACTER '/'
  ------------------
  |  Branch (1291:9): [True: 0, False: 25.7k]
  ------------------
 1292|       |            /* tuple delimiter not allowed here -> syntax error */
 1293|      0|            return -1;
 1294|      0|            break;
 1295|      0|        case GROUP_DELIMITER_CHARACTER:
  ------------------
  |  | 1208|      0|#define GROUP_DELIMITER_CHARACTER ':'
  ------------------
  |  Branch (1295:9): [True: 0, False: 25.7k]
  ------------------
 1296|      0|            return -1; /* Not a valid prefix for a single group name-> syntax error */
 1297|      0|            break;
 1298|  5.14k|        case KEY_SHARE_INDICATOR_CHARACTER:
  ------------------
  |  | 1216|  5.14k|#define KEY_SHARE_INDICATOR_CHARACTER '*'
  ------------------
  |  Branch (1298:9): [True: 5.14k, False: 20.6k]
  ------------------
 1299|  5.14k|            if (add_keyshare)
  ------------------
  |  Branch (1299:17): [True: 1, False: 5.14k]
  ------------------
 1300|      1|                return -1; /* Only single key share prefix allowed -> syntax error */
 1301|  5.14k|            add_keyshare = 1;
 1302|  5.14k|            ++elem;
 1303|  5.14k|            --len;
 1304|  5.14k|            break;
 1305|     20|        case REMOVE_GROUP_INDICATOR_CHARACTER:
  ------------------
  |  | 1220|     20|#define REMOVE_GROUP_INDICATOR_CHARACTER '-'
  ------------------
  |  Branch (1305:9): [True: 20, False: 25.7k]
  ------------------
 1306|     20|            if (remove_group)
  ------------------
  |  Branch (1306:17): [True: 1, False: 19]
  ------------------
 1307|      1|                return -1; /* Only single remove group prefix allowed -> syntax error */
 1308|     19|            remove_group = 1;
 1309|     19|            ++elem;
 1310|     19|            --len;
 1311|     19|            break;
 1312|  20.5k|        case IGNORE_UNKNOWN_GROUP_CHARACTER:
  ------------------
  |  | 1212|  20.5k|#define IGNORE_UNKNOWN_GROUP_CHARACTER '?'
  ------------------
  |  Branch (1312:9): [True: 20.5k, False: 5.18k]
  ------------------
 1313|  20.5k|            if (ignore_unknown)
  ------------------
  |  Branch (1313:17): [True: 1, False: 20.5k]
  ------------------
 1314|      1|                return -1; /* Only single ? allowed -> syntax error */
 1315|  20.5k|            ignore_unknown = 1;
 1316|  20.5k|            ++elem;
 1317|  20.5k|            --len;
 1318|  20.5k|            break;
 1319|     24|        default:
  ------------------
  |  Branch (1319:9): [True: 24, False: 25.7k]
  ------------------
 1320|       |            /*
 1321|       |             * Check whether a DEFAULT[_XYZ] 'pseudo group' (= a built-in
 1322|       |             * list of groups) should be added
 1323|       |             */
 1324|     60|            for (i = 0; i < OSSL_NELEM(default_group_strings); i++) {
  ------------------
  |  |   14|     60|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (1324:25): [True: 42, False: 18]
  ------------------
 1325|     42|                if ((size_t)len == (strlen(default_group_strings[i].list_name))
  ------------------
  |  Branch (1325:21): [True: 14, False: 28]
  ------------------
 1326|     14|                    && OPENSSL_strncasecmp(default_group_strings[i].list_name, elem, len) == 0) {
  ------------------
  |  Branch (1326:24): [True: 6, False: 8]
  ------------------
 1327|      6|                    int saved_first;
 1328|       |
 1329|       |                    /*
 1330|       |                     * We're asked to insert an entire list of groups from a
 1331|       |                     * DEFAULT[_XYZ] 'pseudo group' which we do by
 1332|       |                     * recursively calling this function (indirectly via
 1333|       |                     * CONF_parse_list and tuple_cb); essentially, we treat a DEFAULT
 1334|       |                     * group string like a tuple which is appended to the current tuple
 1335|       |                     * rather then starting a new tuple.
 1336|       |                     */
 1337|      6|                    if (ignore_unknown || remove_group)
  ------------------
  |  Branch (1337:25): [True: 1, False: 5]
  |  Branch (1337:43): [True: 1, False: 4]
  ------------------
 1338|      2|                        return -1; /* removal or ignore not allowed here -> syntax error */
 1339|       |
 1340|       |                    /*
 1341|       |                     * First, we restore any keyshare prefix in a new zero-terminated string
 1342|       |                     * (if not already present)
 1343|       |                     */
 1344|      4|                    restored_default_group_string = OPENSSL_malloc(1 /* max prefix length */ + strlen(default_group_strings[i].group_string) + 1 /* \0 */);
  ------------------
  |  |  106|      4|    CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1345|      4|                    if (restored_default_group_string == NULL)
  ------------------
  |  Branch (1345:25): [True: 0, False: 4]
  ------------------
 1346|      0|                        return 0;
 1347|      4|                    if (add_keyshare
  ------------------
  |  Branch (1347:25): [True: 1, False: 3]
  ------------------
 1348|       |                        /* Remark: we tolerate a duplicated keyshare indicator here */
 1349|      1|                        && default_group_strings[i].group_string[0]
  ------------------
  |  Branch (1349:28): [True: 1, False: 0]
  ------------------
 1350|      1|                            != KEY_SHARE_INDICATOR_CHARACTER)
  ------------------
  |  | 1216|      1|#define KEY_SHARE_INDICATOR_CHARACTER '*'
  ------------------
 1351|      1|                        restored_default_group_string[restored_prefix_index++] = KEY_SHARE_INDICATOR_CHARACTER;
  ------------------
  |  | 1216|      1|#define KEY_SHARE_INDICATOR_CHARACTER '*'
  ------------------
 1352|       |
 1353|      4|                    memcpy(restored_default_group_string + restored_prefix_index,
 1354|      4|                        default_group_strings[i].group_string,
 1355|      4|                        strlen(default_group_strings[i].group_string));
 1356|      4|                    restored_default_group_string[strlen(default_group_strings[i].group_string) + restored_prefix_index] = '\0';
 1357|       |                    /*
 1358|       |                     * Append first tuple of result to current tuple, and don't
 1359|       |                     * terminate the last tuple until we return to a top-level
 1360|       |                     * tuple_cb.
 1361|       |                     */
 1362|      4|                    saved_first = garg->first;
 1363|      4|                    garg->inner = garg->first = 1;
 1364|      4|                    retval = CONF_parse_list(restored_default_group_string,
 1365|      4|                        TUPLE_DELIMITER_CHARACTER, 1, tuple_cb, garg);
  ------------------
  |  | 1204|      4|#define TUPLE_DELIMITER_CHARACTER '/'
  ------------------
 1366|      4|                    garg->inner = 0;
 1367|      4|                    garg->first = saved_first;
 1368|       |                    /* We don't need the \0-terminated string anymore */
 1369|      4|                    OPENSSL_free(restored_default_group_string);
  ------------------
  |  |  131|      4|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1370|       |
 1371|      4|                    return retval;
 1372|      4|                }
 1373|     42|            }
 1374|       |            /*
 1375|       |             * If we reached this point, a group name started with a 'd' or 'D', but no request
 1376|       |             * for a DEFAULT[_XYZ] 'pseudo group' was detected, hence processing of the group
 1377|       |             * name can continue as usual (= the while loop checking prefixes can end)
 1378|       |             */
 1379|     18|            continue_while_loop = 0;
 1380|     18|            break;
 1381|  25.7k|        }
 1382|  25.7k|    }
 1383|       |
 1384|  20.9k|    if (len == 0)
  ------------------
  |  Branch (1384:9): [True: 2, False: 20.9k]
  ------------------
 1385|      2|        return -1; /* Seems we have prefxes without a group name -> syntax error */
 1386|       |
 1387|       |    /* Memory management in case more groups are present compared to initial allocation */
 1388|  20.9k|    if (garg->gidcnt == garg->gidmax) {
  ------------------
  |  Branch (1388:9): [True: 0, False: 20.9k]
  ------------------
 1389|      0|        uint16_t *tmp = OPENSSL_realloc_array(garg->gid_arr,
  ------------------
  |  |  124|      0|    CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1390|      0|            garg->gidmax + GROUPLIST_INCREMENT,
 1391|      0|            sizeof(*garg->gid_arr));
 1392|       |
 1393|      0|        if (tmp == NULL)
  ------------------
  |  Branch (1393:13): [True: 0, False: 0]
  ------------------
 1394|      0|            return 0;
 1395|       |
 1396|      0|        garg->gidmax += GROUPLIST_INCREMENT;
  ------------------
  |  | 1193|      0|#define GROUPLIST_INCREMENT 32 /* Memory allocation chunk size (64 Bytes chunks ~= cache line) */
  ------------------
 1397|      0|        garg->gid_arr = tmp;
 1398|      0|    }
 1399|       |    /* Memory management for key share groups */
 1400|  20.9k|    if (garg->ksidcnt == garg->ksidmax) {
  ------------------
  |  Branch (1400:9): [True: 0, False: 20.9k]
  ------------------
 1401|      0|        uint16_t *tmp = OPENSSL_realloc_array(garg->ksid_arr,
  ------------------
  |  |  124|      0|    CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1402|      0|            garg->ksidmax + GROUPLIST_INCREMENT,
 1403|      0|            sizeof(*garg->ksid_arr));
 1404|       |
 1405|      0|        if (tmp == NULL)
  ------------------
  |  Branch (1405:13): [True: 0, False: 0]
  ------------------
 1406|      0|            return 0;
 1407|      0|        garg->ksidmax += GROUPLIST_INCREMENT;
  ------------------
  |  | 1193|      0|#define GROUPLIST_INCREMENT 32 /* Memory allocation chunk size (64 Bytes chunks ~= cache line) */
  ------------------
 1408|      0|        garg->ksid_arr = tmp;
 1409|      0|    }
 1410|       |
 1411|  20.9k|    if (len > (int)(sizeof(etmp) - 1))
  ------------------
  |  Branch (1411:9): [True: 2, False: 20.9k]
  ------------------
 1412|      2|        return -1; /* group name to long  -> syntax error */
 1413|       |
 1414|       |    /*
 1415|       |     * Prepare addition or removal of a single group by converting
 1416|       |     * a group name into its groupID equivalent
 1417|       |     */
 1418|       |
 1419|       |    /* Create a \0-terminated string and get the gid for this group if possible */
 1420|  20.9k|    memcpy(etmp, elem, len);
 1421|  20.9k|    etmp[len] = 0;
 1422|       |
 1423|       |    /* Get the groupID */
 1424|  20.9k|    gid = tls1_group_name2id(garg->ctx, etmp);
 1425|       |    /*
 1426|       |     * Handle the case where no valid groupID was returned
 1427|       |     * e.g. for an unknown group, which we'd ignore (only) if relevant prefix was set
 1428|       |     */
 1429|  20.9k|    if (gid == 0) {
  ------------------
  |  Branch (1429:9): [True: 744, False: 20.2k]
  ------------------
 1430|       |        /* Is it one of the GOST groups ? */
 1431|  5.95k|        for (i = 0; i < OSSL_NELEM(name2id_arr); i++) {
  ------------------
  |  |   14|  5.95k|#define OSSL_NELEM(x) (sizeof(x) / sizeof((x)[0]))
  ------------------
  |  Branch (1431:21): [True: 5.20k, False: 744]
  ------------------
 1432|  5.20k|            if (OPENSSL_strcasecmp(etmp, name2id_arr[i].group_name) == 0) {
  ------------------
  |  Branch (1432:17): [True: 0, False: 5.20k]
  ------------------
 1433|      0|                gid = name2id_arr[i].groupID;
 1434|      0|                break;
 1435|      0|            }
 1436|  5.20k|        }
 1437|    744|        if (gid == 0) { /* still not found */
  ------------------
  |  Branch (1437:13): [True: 744, False: 0]
  ------------------
 1438|       |            /* Unknown group - ignore if ignore_unknown; trigger error otherwise */
 1439|    744|            retval = ignore_unknown;
 1440|    744|            goto done;
 1441|    744|        }
 1442|    744|    }
 1443|       |
 1444|       |    /* Make sure that at least one provider is supporting this groupID */
 1445|  20.2k|    found_group = 0;
 1446|   119k|    for (j = 0; j < garg->ctx->group_list_len; j++)
  ------------------
  |  Branch (1446:17): [True: 119k, False: 0]
  ------------------
 1447|   119k|        if (garg->ctx->group_list[j].group_id == gid) {
  ------------------
  |  Branch (1447:13): [True: 20.2k, False: 98.9k]
  ------------------
 1448|  20.2k|            found_group = 1;
 1449|  20.2k|            break;
 1450|  20.2k|        }
 1451|       |
 1452|       |    /*
 1453|       |     * No provider supports this group - ignore if
 1454|       |     * ignore_unknown; trigger error otherwise
 1455|       |     */
 1456|  20.2k|    if (found_group == 0) {
  ------------------
  |  Branch (1456:9): [True: 0, False: 20.2k]
  ------------------
 1457|      0|        retval = ignore_unknown;
 1458|      0|        goto done;
 1459|      0|    }
 1460|       |    /* Remove group (and keyshare) from anywhere in the list if present, ignore if not present */
 1461|  20.2k|    if (remove_group) {
  ------------------
  |  Branch (1461:9): [True: 13, False: 20.2k]
  ------------------
 1462|       |        /* Is the current group specified anywhere in the entire list so far? */
 1463|     13|        found_group = 0;
 1464|     21|        for (i = 0; i < garg->gidcnt; i++)
  ------------------
  |  Branch (1464:21): [True: 13, False: 8]
  ------------------
 1465|     13|            if (garg->gid_arr[i] == gid) {
  ------------------
  |  Branch (1465:17): [True: 5, False: 8]
  ------------------
 1466|      5|                found_group = 1;
 1467|      5|                break;
 1468|      5|            }
 1469|       |        /* The group to remove is at position i in the list of (zero indexed) groups */
 1470|     13|        if (found_group) {
  ------------------
  |  Branch (1470:13): [True: 5, False: 8]
  ------------------
 1471|       |            /* We remove that group from its position (which is at i)... */
 1472|      7|            for (j = i; j < (garg->gidcnt - 1); j++)
  ------------------
  |  Branch (1472:25): [True: 2, False: 5]
  ------------------
 1473|      2|                garg->gid_arr[j] = garg->gid_arr[j + 1]; /* ...shift remaining groups left ... */
 1474|      5|            garg->gidcnt--; /* ..and update the book keeping for the number of groups */
 1475|       |
 1476|       |            /*
 1477|       |             * We also must update the number of groups either in a previous tuple (which we
 1478|       |             * must identify and check whether it becomes empty due to the deletion) or in
 1479|       |             * the current tuple, pending where the deleted group resides
 1480|       |             */
 1481|      5|            k = 0;
 1482|      7|            for (j = 0; j < garg->tplcnt; j++) {
  ------------------
  |  Branch (1482:25): [True: 5, False: 2]
  ------------------
 1483|      5|                k += garg->tuplcnt_arr[j];
 1484|       |                /* Remark: i is zero-indexed, k is one-indexed */
 1485|      5|                if (k > i) { /* remove from one of the previous tuples */
  ------------------
  |  Branch (1485:21): [True: 3, False: 2]
  ------------------
 1486|      3|                    garg->tuplcnt_arr[j]--;
 1487|      3|                    break; /* We took care not to have group duplicates, hence we can stop here */
 1488|      3|                }
 1489|      5|            }
 1490|      5|            if (k <= i) /* remove from current tuple */
  ------------------
  |  Branch (1490:17): [True: 2, False: 3]
  ------------------
 1491|      2|                garg->tuplcnt_arr[j]--;
 1492|       |
 1493|       |            /* We also remove the group from the list of keyshares (if present) */
 1494|      5|            found_group = 0;
 1495|      7|            for (i = 0; i < garg->ksidcnt; i++)
  ------------------
  |  Branch (1495:25): [True: 4, False: 3]
  ------------------
 1496|      4|                if (garg->ksid_arr[i] == gid) {
  ------------------
  |  Branch (1496:21): [True: 2, False: 2]
  ------------------
 1497|      2|                    found_group = 1;
 1498|      2|                    break;
 1499|      2|                }
 1500|      5|            if (found_group) {
  ------------------
  |  Branch (1500:17): [True: 2, False: 3]
  ------------------
 1501|       |                /* Found, hence we remove that keyshare from its position (which is at i)... */
 1502|      2|                for (j = i; j < (garg->ksidcnt - 1); j++)
  ------------------
  |  Branch (1502:29): [True: 0, False: 2]
  ------------------
 1503|      0|                    garg->ksid_arr[j] = garg->ksid_arr[j + 1]; /* shift remaining key shares */
 1504|       |                /* ... and update the book keeping */
 1505|      2|                garg->ksidcnt--;
 1506|      2|            }
 1507|      5|        }
 1508|  20.2k|    } else { /* Processing addition of a single new group */
 1509|       |
 1510|       |        /* Check for duplicates */
 1511|  89.7k|        for (i = 0; i < garg->gidcnt; i++)
  ------------------
  |  Branch (1511:21): [True: 69.5k, False: 20.2k]
  ------------------
 1512|  69.5k|            if (garg->gid_arr[i] == gid) {
  ------------------
  |  Branch (1512:17): [True: 4, False: 69.5k]
  ------------------
 1513|       |                /* Duplicate group anywhere in the list of groups - ignore */
 1514|      4|                goto done;
 1515|      4|            }
 1516|       |
 1517|       |        /* Add the current group to the 'flat' list of groups */
 1518|  20.2k|        garg->gid_arr[garg->gidcnt++] = gid;
 1519|       |        /* and update the book keeping for the number of groups in current tuple */
 1520|  20.2k|        garg->tuplcnt_arr[garg->tplcnt]++;
 1521|       |
 1522|       |        /* We want to add a key share for the current group */
 1523|  20.2k|        if (add_keyshare)
  ------------------
  |  Branch (1523:13): [True: 4.97k, False: 15.2k]
  ------------------
 1524|  4.97k|            garg->ksid_arr[garg->ksidcnt++] = gid;
 1525|  20.2k|    }
 1526|       |
 1527|  20.9k|done:
 1528|  20.9k|    return retval;
 1529|  20.2k|}
t1_lib.c:tls1_group_name2id:
  710|  20.9k|{
  711|  20.9k|    size_t i;
  712|       |
  713|   124k|    for (i = 0; i < ctx->group_list_len; i++) {
  ------------------
  |  Branch (713:17): [True: 123k, False: 744]
  ------------------
  714|   123k|        if (OPENSSL_strcasecmp(ctx->group_list[i].tlsname, name) == 0
  ------------------
  |  Branch (714:13): [True: 20.2k, False: 103k]
  ------------------
  715|   103k|            || OPENSSL_strcasecmp(ctx->group_list[i].realname, name) == 0)
  ------------------
  |  Branch (715:16): [True: 0, False: 103k]
  ------------------
  716|  20.2k|            return ctx->group_list[i].group_id;
  717|   123k|    }
  718|       |
  719|    744|    return 0;
  720|  20.9k|}
t1_lib.c:tls1_lookup_sigalg:
 2391|   192k|{
 2392|   192k|    size_t i;
 2393|   192k|    const SIGALG_LOOKUP *lu = ctx->sigalg_lookup_cache;
 2394|       |
 2395|  2.99M|    for (i = 0; i < ctx->sigalg_lookup_cache_len; lu++, i++) {
  ------------------
  |  Branch (2395:17): [True: 2.99M, False: 0]
  ------------------
 2396|  2.99M|        if (lu->sigalg == sigalg) {
  ------------------
  |  Branch (2396:13): [True: 192k, False: 2.79M]
  ------------------
 2397|   192k|            if (!lu->available)
  ------------------
  |  Branch (2397:17): [True: 0, False: 192k]
  ------------------
 2398|      0|                return NULL;
 2399|   192k|            return lu;
 2400|   192k|        }
 2401|  2.99M|    }
 2402|      0|    return NULL;
 2403|   192k|}
t1_lib.c:tls_sigalg_compat:
 2663|  46.6k|{
 2664|  46.6k|    int minversion, maxversion;
 2665|  46.6k|    int minproto, maxproto;
 2666|       |
 2667|  46.6k|    if (!lu->available)
  ------------------
  |  Branch (2667:9): [True: 0, False: 46.6k]
  ------------------
 2668|      0|        return 0;
 2669|       |
 2670|  46.6k|    if (SSL_CONNECTION_IS_DTLS(sc)) {
  ------------------
  |  |  258|  46.6k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  46.6k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  46.6k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  |  |  |  Branch (258:5): [True: 0, False: 46.6k]
  |  |  ------------------
  ------------------
 2671|      0|        if (sc->ssl.method->version == DTLS_ANY_VERSION) {
  ------------------
  |  |   35|      0|#define DTLS_ANY_VERSION 0x1FFFF
  ------------------
  |  Branch (2671:13): [True: 0, False: 0]
  ------------------
 2672|      0|            minproto = sc->min_proto_version;
 2673|      0|            maxproto = sc->max_proto_version;
 2674|      0|        } else {
 2675|      0|            maxproto = minproto = sc->version;
 2676|      0|        }
 2677|      0|        minversion = lu->mindtls;
 2678|      0|        maxversion = lu->maxdtls;
 2679|  46.6k|    } else {
 2680|  46.6k|        if (sc->ssl.method->version == TLS_ANY_VERSION) {
  ------------------
  |  |   40|  46.6k|#define TLS_ANY_VERSION 0x10000
  ------------------
  |  Branch (2680:13): [True: 46.6k, False: 0]
  ------------------
 2681|  46.6k|            minproto = sc->min_proto_version;
 2682|  46.6k|            maxproto = sc->max_proto_version;
 2683|  46.6k|        } else {
 2684|      0|            maxproto = minproto = sc->version;
 2685|      0|        }
 2686|  46.6k|        minversion = lu->mintls;
 2687|  46.6k|        maxversion = lu->maxtls;
 2688|  46.6k|    }
 2689|  46.6k|    if (minversion == -1 || maxversion == -1
  ------------------
  |  Branch (2689:9): [True: 0, False: 46.6k]
  |  Branch (2689:29): [True: 0, False: 46.6k]
  ------------------
 2690|  46.6k|        || (minversion != 0 && maxproto != 0
  ------------------
  |  Branch (2690:13): [True: 46.6k, False: 0]
  |  Branch (2690:32): [True: 235, False: 46.4k]
  ------------------
 2691|    235|            && ssl_version_cmp(sc, minversion, maxproto) > 0)
  ------------------
  |  Branch (2691:16): [True: 36, False: 199]
  ------------------
 2692|  46.6k|        || (maxversion != 0 && minproto != 0
  ------------------
  |  Branch (2692:13): [True: 19.2k, False: 27.3k]
  |  Branch (2692:32): [True: 19.2k, False: 0]
  ------------------
 2693|  19.2k|            && ssl_version_cmp(sc, maxversion, minproto) < 0)
  ------------------
  |  Branch (2693:16): [True: 18, False: 19.2k]
  ------------------
 2694|  46.5k|        || !tls12_sigalg_allowed(sc, SSL_SECOP_SIGALG_SUPPORTED, lu))
  ------------------
  |  | 2770|  46.5k|#define SSL_SECOP_SIGALG_SUPPORTED (11 | SSL_SECOP_OTHER_SIGALG)
  |  |  ------------------
  |  |  |  | 2742|  46.5k|#define SSL_SECOP_OTHER_SIGALG (5 << 16)
  |  |  ------------------
  ------------------
  |  Branch (2694:12): [True: 4.91k, False: 41.6k]
  ------------------
 2695|  4.96k|        return 0;
 2696|  41.6k|    return 1;
 2697|  46.6k|}
t1_lib.c:sigalg_security_bits:
 2615|  62.0k|{
 2616|  62.0k|    const EVP_MD *md = NULL;
 2617|  62.0k|    int secbits = 0;
 2618|       |
 2619|  62.0k|    if (!tls1_lookup_md(ctx, lu, &md))
  ------------------
  |  Branch (2619:9): [True: 0, False: 62.0k]
  ------------------
 2620|      0|        return 0;
 2621|  62.0k|    if (md != NULL) {
  ------------------
  |  Branch (2621:9): [True: 54.0k, False: 8.01k]
  ------------------
 2622|  54.0k|        int md_type = EVP_MD_get_type(md);
 2623|       |
 2624|       |        /* Security bits: half digest bits */
 2625|  54.0k|        secbits = EVP_MD_get_size(md) * 4;
 2626|  54.0k|        if (secbits <= 0)
  ------------------
  |  Branch (2626:13): [True: 0, False: 54.0k]
  ------------------
 2627|      0|            return 0;
 2628|       |        /*
 2629|       |         * SHA1 and MD5 are known to be broken. Reduce security bits so that
 2630|       |         * they're no longer accepted at security level 1. The real values don't
 2631|       |         * really matter as long as they're lower than 80, which is our
 2632|       |         * security level 1.
 2633|       |         * https://eprint.iacr.org/2020/014 puts a chosen-prefix attack for
 2634|       |         * SHA1 at 2^63.4 and MD5+SHA1 at 2^67.2
 2635|       |         * https://documents.epfl.ch/users/l/le/lenstra/public/papers/lat.pdf
 2636|       |         * puts a chosen-prefix attack for MD5 at 2^39.
 2637|       |         */
 2638|  54.0k|        if (md_type == NID_sha1)
  ------------------
  |  | 2344|  54.0k|#define NID_sha1                64
  ------------------
  |  Branch (2638:13): [True: 4.85k, False: 49.1k]
  ------------------
 2639|  4.85k|            secbits = 64;
 2640|  49.1k|        else if (md_type == NID_md5_sha1)
  ------------------
  |  | 1243|  49.1k|#define NID_md5_sha1            114
  ------------------
  |  Branch (2640:18): [True: 0, False: 49.1k]
  ------------------
 2641|      0|            secbits = 67;
 2642|  49.1k|        else if (md_type == NID_md5)
  ------------------
  |  | 1238|  49.1k|#define NID_md5         4
  ------------------
  |  Branch (2642:18): [True: 0, False: 49.1k]
  ------------------
 2643|      0|            secbits = 39;
 2644|  54.0k|    } else {
 2645|       |        /* Values from https://tools.ietf.org/html/rfc8032#section-8.5 */
 2646|  8.01k|        if (lu->sigalg == TLSEXT_SIGALG_ed25519)
  ------------------
  |  | 2237|  8.01k|#define TLSEXT_SIGALG_ed25519 0x0807
  ------------------
  |  Branch (2646:13): [True: 1.60k, False: 6.40k]
  ------------------
 2647|  1.60k|            secbits = 128;
 2648|  6.40k|        else if (lu->sigalg == TLSEXT_SIGALG_ed448)
  ------------------
  |  | 2238|  6.40k|#define TLSEXT_SIGALG_ed448 0x0808
  ------------------
  |  Branch (2648:18): [True: 1.60k, False: 4.80k]
  ------------------
 2649|  1.60k|            secbits = 224;
 2650|  8.01k|    }
 2651|       |    /*
 2652|       |     * For provider-based sigalgs we have secbits information available
 2653|       |     * in the (provider-loaded) sigalg_list structure
 2654|       |     */
 2655|  62.0k|    if ((secbits == 0) && (lu->sig_idx >= SSL_PKEY_NUM)
  ------------------
  |  |  328|  4.80k|#define SSL_PKEY_NUM 9
  ------------------
  |  Branch (2655:9): [True: 4.80k, False: 57.2k]
  |  Branch (2655:27): [True: 4.80k, False: 0]
  ------------------
 2656|  4.80k|        && ((lu->sig_idx - SSL_PKEY_NUM) < (int)ctx->sigalg_list_len)) {
  ------------------
  |  |  328|  4.80k|#define SSL_PKEY_NUM 9
  ------------------
  |  Branch (2656:12): [True: 4.80k, False: 0]
  ------------------
 2657|  4.80k|        secbits = ctx->sigalg_list[lu->sig_idx - SSL_PKEY_NUM].secbits;
  ------------------
  |  |  328|  4.80k|#define SSL_PKEY_NUM 9
  ------------------
 2658|  4.80k|    }
 2659|  62.0k|    return secbits;
 2660|  62.0k|}
t1_lib.c:tls12_sigalg_allowed:
 3348|  62.0k|{
 3349|  62.0k|    unsigned char sigalgstr[2];
 3350|  62.0k|    int secbits;
 3351|       |
 3352|  62.0k|    if (lu == NULL || !lu->available)
  ------------------
  |  Branch (3352:9): [True: 0, False: 62.0k]
  |  Branch (3352:23): [True: 0, False: 62.0k]
  ------------------
 3353|      0|        return 0;
 3354|       |    /* DSA is not allowed in TLS 1.3 */
 3355|  62.0k|    if (SSL_CONNECTION_IS_TLS13(s) && lu->sig == EVP_PKEY_DSA)
  ------------------
  |  |  265|   124k|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|   124k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  62.0k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|  62.0k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 62.0k, False: 0]
  |  |  ------------------
  |  |  266|  62.0k|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|  62.0k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|   124k|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 62.0k, False: 0]
  |  |  ------------------
  |  |  267|   124k|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|  62.0k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|  62.0k|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 62.0k]
  |  |  ------------------
  ------------------
                  if (SSL_CONNECTION_IS_TLS13(s) && lu->sig == EVP_PKEY_DSA)
  ------------------
  |  |   66|      0|#define EVP_PKEY_DSA NID_dsa
  |  |  ------------------
  |  |  |  |  136|      0|#define NID_dsa         116
  |  |  ------------------
  ------------------
  |  Branch (3355:39): [True: 0, False: 0]
  ------------------
 3356|      0|        return 0;
 3357|       |    /*
 3358|       |     * At some point we should fully axe DSA/etc. in ClientHello as per TLS 1.3
 3359|       |     * spec
 3360|       |     */
 3361|  62.0k|    if (!s->server && !SSL_CONNECTION_IS_DTLS(s)
  ------------------
  |  |  258|   124k|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  |   27|  62.0k|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  ------------------
  |  |  |  | 2190|  62.0k|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  ------------------
  ------------------
  |  Branch (3361:9): [True: 62.0k, False: 0]
  |  Branch (3361:23): [True: 62.0k, False: 0]
  ------------------
 3362|  62.0k|        && s->s3.tmp.min_ver >= TLS1_3_VERSION
  ------------------
  |  |   27|   124k|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (3362:12): [True: 82, False: 61.9k]
  ------------------
 3363|     82|        && (lu->sig == EVP_PKEY_DSA || lu->hash_idx == SSL_MD_SHA1_IDX
  ------------------
  |  |   66|     82|#define EVP_PKEY_DSA NID_dsa
  |  |  ------------------
  |  |  |  |  136|    164|#define NID_dsa         116
  |  |  ------------------
  ------------------
                      && (lu->sig == EVP_PKEY_DSA || lu->hash_idx == SSL_MD_SHA1_IDX
  ------------------
  |  |  188|    134|#define SSL_MD_SHA1_IDX 1
  ------------------
  |  Branch (3363:13): [True: 30, False: 52]
  |  Branch (3363:40): [True: 0, False: 52]
  ------------------
 3364|     52|            || lu->hash_idx == SSL_MD_MD5_IDX
  ------------------
  |  |  187|    134|#define SSL_MD_MD5_IDX 0
  ------------------
  |  Branch (3364:16): [True: 0, False: 52]
  ------------------
 3365|     52|            || lu->hash_idx == SSL_MD_SHA224_IDX))
  ------------------
  |  |  197|     52|#define SSL_MD_SHA224_IDX 10
  ------------------
  |  Branch (3365:16): [True: 0, False: 52]
  ------------------
 3366|     30|        return 0;
 3367|       |
 3368|       |    /* See if public key algorithm allowed */
 3369|  62.0k|    if (ssl_cert_is_disabled(SSL_CONNECTION_GET_CTX(s), lu->sig_idx))
  ------------------
  |  |   26|  62.0k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
  |  Branch (3369:9): [True: 0, False: 62.0k]
  ------------------
 3370|      0|        return 0;
 3371|       |
 3372|  62.0k|    if (lu->sig == NID_id_GostR3410_2012_256
  ------------------
  |  | 4790|   124k|#define NID_id_GostR3410_2012_256               979
  ------------------
  |  Branch (3372:9): [True: 0, False: 62.0k]
  ------------------
 3373|  62.0k|        || lu->sig == NID_id_GostR3410_2012_512
  ------------------
  |  | 4795|   124k|#define NID_id_GostR3410_2012_512               980
  ------------------
  |  Branch (3373:12): [True: 0, False: 62.0k]
  ------------------
 3374|  62.0k|        || lu->sig == NID_id_GostR3410_2001) {
  ------------------
  |  | 4579|  62.0k|#define NID_id_GostR3410_2001           811
  ------------------
  |  Branch (3374:12): [True: 0, False: 62.0k]
  ------------------
 3375|       |        /* We never allow GOST sig algs on the server with TLSv1.3 */
 3376|      0|        if (s->server && SSL_CONNECTION_IS_TLS13(s))
  ------------------
  |  |  265|      0|#define SSL_CONNECTION_IS_TLS13(s) (!SSL_CONNECTION_IS_DTLS(s)      \
  |  |  ------------------
  |  |  |  |  258|      0|    (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  |  |  ------------------
  |  |  |  |                   (SSL_CONNECTION_GET_SSL(s)->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2190|      0|#define SSL_ENC_FLAG_DTLS 0x8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (265:37): [True: 0, False: 0]
  |  |  ------------------
  |  |  266|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version >= TLS1_3_VERSION \
  |  |  ------------------
  |  |  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  |  |  ------------------
  |  |  |  Branch (266:8): [True: 0, False: 0]
  |  |  ------------------
  |  |  267|      0|    && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  |  |  ------------------
  |  |                   && SSL_CONNECTION_GET_SSL(s)->method->version != TLS_ANY_VERSION)
  |  |  ------------------
  |  |  |  |   40|      0|#define TLS_ANY_VERSION 0x10000
  |  |  ------------------
  |  |  |  Branch (267:8): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (3376:13): [True: 0, False: 0]
  ------------------
 3377|      0|            return 0;
 3378|      0|        if (!s->server
  ------------------
  |  Branch (3378:13): [True: 0, False: 0]
  ------------------
 3379|      0|            && SSL_CONNECTION_GET_SSL(s)->method->version == TLS_ANY_VERSION
  ------------------
  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
                          && SSL_CONNECTION_GET_SSL(s)->method->version == TLS_ANY_VERSION
  ------------------
  |  |   40|      0|#define TLS_ANY_VERSION 0x10000
  ------------------
  |  Branch (3379:16): [True: 0, False: 0]
  ------------------
 3380|      0|            && s->s3.tmp.max_ver >= TLS1_3_VERSION) {
  ------------------
  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (3380:16): [True: 0, False: 0]
  ------------------
 3381|      0|            int i, num;
 3382|      0|            STACK_OF(SSL_CIPHER) *sk;
  ------------------
  |  |   33|      0|#define STACK_OF(type) struct stack_st_##type
  ------------------
 3383|       |
 3384|       |            /*
 3385|       |             * We're a client that could negotiate TLSv1.3. We only allow GOST
 3386|       |             * sig algs if we could negotiate TLSv1.2 or below and we have GOST
 3387|       |             * ciphersuites enabled.
 3388|       |             */
 3389|       |
 3390|      0|            if (s->s3.tmp.min_ver >= TLS1_3_VERSION)
  ------------------
  |  |   27|      0|#define TLS1_3_VERSION 0x0304
  ------------------
  |  Branch (3390:17): [True: 0, False: 0]
  ------------------
 3391|      0|                return 0;
 3392|       |
 3393|      0|            sk = SSL_get_ciphers(SSL_CONNECTION_GET_SSL(s));
  ------------------
  |  |   27|      0|#define SSL_CONNECTION_GET_SSL(sc) (&(sc)->ssl)
  ------------------
 3394|      0|            num = sk != NULL ? sk_SSL_CIPHER_num(sk) : 0;
  ------------------
  |  | 1005|      0|#define sk_SSL_CIPHER_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_CIPHER_sk_type(sk))
  ------------------
  |  Branch (3394:19): [True: 0, False: 0]
  ------------------
 3395|      0|            for (i = 0; i < num; i++) {
  ------------------
  |  Branch (3395:25): [True: 0, False: 0]
  ------------------
 3396|      0|                const SSL_CIPHER *c;
 3397|       |
 3398|      0|                c = sk_SSL_CIPHER_value(sk, i);
  ------------------
  |  | 1006|      0|#define sk_SSL_CIPHER_value(sk, idx) ((const SSL_CIPHER *)OPENSSL_sk_value(ossl_check_const_SSL_CIPHER_sk_type(sk), (idx)))
  ------------------
 3399|       |                /* Skip disabled ciphers */
 3400|      0|                if (ssl_cipher_disabled(s, c, SSL_SECOP_CIPHER_SUPPORTED, 0))
  ------------------
  |  | 2752|      0|#define SSL_SECOP_CIPHER_SUPPORTED (1 | SSL_SECOP_OTHER_CIPHER)
  |  |  ------------------
  |  |  |  | 2738|      0|#define SSL_SECOP_OTHER_CIPHER (1 << 16)
  |  |  ------------------
  ------------------
  |  Branch (3400:21): [True: 0, False: 0]
  ------------------
 3401|      0|                    continue;
 3402|       |
 3403|      0|                if ((c->algorithm_mkey & (SSL_kGOST | SSL_kGOST18)) != 0)
  ------------------
  |  |   89|      0|#define SSL_kGOST 0x00000010U
  ------------------
                              if ((c->algorithm_mkey & (SSL_kGOST | SSL_kGOST18)) != 0)
  ------------------
  |  |   97|      0|#define SSL_kGOST18 0x00000200U
  ------------------
  |  Branch (3403:21): [True: 0, False: 0]
  ------------------
 3404|      0|                    break;
 3405|      0|            }
 3406|      0|            if (i == num)
  ------------------
  |  Branch (3406:17): [True: 0, False: 0]
  ------------------
 3407|      0|                return 0;
 3408|      0|        }
 3409|      0|    }
 3410|       |
 3411|       |    /* Finally see if security callback allows it */
 3412|  62.0k|    secbits = sigalg_security_bits(SSL_CONNECTION_GET_CTX(s), lu);
  ------------------
  |  |   26|  62.0k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
 3413|  62.0k|    sigalgstr[0] = (lu->sigalg >> 8) & 0xff;
 3414|  62.0k|    sigalgstr[1] = lu->sigalg & 0xff;
 3415|  62.0k|    return ssl_security(s, op, secbits, lu->hash, (void *)sigalgstr);
 3416|  62.0k|}

tls13_alert_code:
  838|      8|{
  839|       |    /* There are 2 additional alerts in TLSv1.3 compared to TLSv1.2 */
  840|      8|    if (code == SSL_AD_MISSING_EXTENSION || code == SSL_AD_CERTIFICATE_REQUIRED)
  ------------------
  |  | 1246|      8|#define SSL_AD_MISSING_EXTENSION TLS13_AD_MISSING_EXTENSION
  |  |  ------------------
  |  |  |  |   71|     16|#define TLS13_AD_MISSING_EXTENSION 109 /* fatal */
  |  |  ------------------
  ------------------
                  if (code == SSL_AD_MISSING_EXTENSION || code == SSL_AD_CERTIFICATE_REQUIRED)
  ------------------
  |  | 1247|      8|#define SSL_AD_CERTIFICATE_REQUIRED TLS13_AD_CERTIFICATE_REQUIRED
  |  |  ------------------
  |  |  |  |   72|      8|#define TLS13_AD_CERTIFICATE_REQUIRED 116 /* fatal */
  |  |  ------------------
  ------------------
  |  Branch (840:9): [True: 0, False: 8]
  |  Branch (840:45): [True: 0, False: 8]
  ------------------
  841|      0|        return code;
  842|       |
  843|      8|    return tls1_alert_code(code);
  844|      8|}

tls_engine_finish:
   24|  20.4k|{
   25|  20.4k|    ENGINE_finish(e);
   26|  20.4k|}
tls_get_cipher_from_engine:
   30|  58.9k|{
   31|  58.9k|    const EVP_CIPHER *ret = NULL;
   32|  58.9k|#ifndef OPENSSL_NO_ENGINE
   33|  58.9k|    ENGINE *eng;
   34|       |
   35|       |    /*
   36|       |     * If there is an Engine available for this cipher we use the "implicit"
   37|       |     * form to ensure we use that engine later.
   38|       |     */
   39|  58.9k|    eng = ENGINE_get_cipher_engine(nid);
   40|  58.9k|    if (eng != NULL) {
  ------------------
  |  Branch (40:9): [True: 0, False: 58.9k]
  ------------------
   41|      0|        ret = ENGINE_get_cipher(eng, nid);
   42|      0|        ENGINE_finish(eng);
   43|      0|    }
   44|  58.9k|#endif
   45|  58.9k|    return ret;
   46|  58.9k|}
tls_get_digest_from_engine:
   49|  40.8k|{
   50|  40.8k|    const EVP_MD *ret = NULL;
   51|  40.8k|#ifndef OPENSSL_NO_ENGINE
   52|  40.8k|    ENGINE *eng;
   53|       |
   54|       |    /*
   55|       |     * If there is an Engine available for this digest we use the "implicit"
   56|       |     * form to ensure we use that engine later.
   57|       |     */
   58|  40.8k|    eng = ENGINE_get_digest_engine(nid);
   59|  40.8k|    if (eng != NULL) {
  ------------------
  |  Branch (59:9): [True: 0, False: 40.8k]
  ------------------
   60|      0|        ret = ENGINE_get_digest(eng, nid);
   61|      0|        ENGINE_finish(eng);
   62|      0|    }
   63|  40.8k|#endif
   64|  40.8k|    return ret;
   65|  40.8k|}

ssl_ctx_srp_ctx_free_intern:
   34|  2.56k|{
   35|  2.56k|    if (ctx == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 2.56k]
  ------------------
   36|      0|        return 0;
   37|  2.56k|    OPENSSL_free(ctx->srp_ctx.login);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   38|  2.56k|    OPENSSL_free(ctx->srp_ctx.info);
  ------------------
  |  |  131|  2.56k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   39|  2.56k|    BN_free(ctx->srp_ctx.N);
   40|  2.56k|    BN_free(ctx->srp_ctx.g);
   41|  2.56k|    BN_free(ctx->srp_ctx.s);
   42|  2.56k|    BN_free(ctx->srp_ctx.B);
   43|  2.56k|    BN_free(ctx->srp_ctx.A);
   44|  2.56k|    BN_free(ctx->srp_ctx.a);
   45|  2.56k|    BN_free(ctx->srp_ctx.b);
   46|  2.56k|    BN_free(ctx->srp_ctx.v);
   47|  2.56k|    memset(&ctx->srp_ctx, 0, sizeof(ctx->srp_ctx));
   48|  2.56k|    ctx->srp_ctx.strength = SRP_MINIMAL_N;
  ------------------
  |  |  276|  2.56k|#define SRP_MINIMAL_N 1024
  ------------------
   49|  2.56k|    return 1;
   50|  2.56k|}
ssl_srp_ctx_free_intern:
   62|  1.77k|{
   63|  1.77k|    if (s == NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 1.77k]
  ------------------
   64|      0|        return 0;
   65|  1.77k|    OPENSSL_free(s->srp_ctx.login);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   66|  1.77k|    OPENSSL_free(s->srp_ctx.info);
  ------------------
  |  |  131|  1.77k|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   67|  1.77k|    BN_free(s->srp_ctx.N);
   68|  1.77k|    BN_free(s->srp_ctx.g);
   69|  1.77k|    BN_free(s->srp_ctx.s);
   70|  1.77k|    BN_free(s->srp_ctx.B);
   71|  1.77k|    BN_free(s->srp_ctx.A);
   72|  1.77k|    BN_free(s->srp_ctx.a);
   73|  1.77k|    BN_free(s->srp_ctx.b);
   74|  1.77k|    BN_free(s->srp_ctx.v);
   75|  1.77k|    memset(&s->srp_ctx, 0, sizeof(s->srp_ctx));
   76|  1.77k|    s->srp_ctx.strength = SRP_MINIMAL_N;
  ------------------
  |  |  276|  1.77k|#define SRP_MINIMAL_N 1024
  ------------------
   77|  1.77k|    return 1;
   78|  1.77k|}
ssl_srp_ctx_init_intern:
   93|  1.77k|{
   94|  1.77k|    SSL_CTX *ctx;
   95|       |
   96|  1.77k|    if (s == NULL || (ctx = SSL_CONNECTION_GET_CTX(s)) == NULL)
  ------------------
  |  |   26|  1.77k|#define SSL_CONNECTION_GET_CTX(sc) ((sc)->ssl.ctx)
  ------------------
  |  Branch (96:9): [True: 0, False: 1.77k]
  |  Branch (96:22): [True: 0, False: 1.77k]
  ------------------
   97|      0|        return 0;
   98|       |
   99|  1.77k|    memset(&s->srp_ctx, 0, sizeof(s->srp_ctx));
  100|       |
  101|  1.77k|    s->srp_ctx.SRP_cb_arg = ctx->srp_ctx.SRP_cb_arg;
  102|       |    /* set client Hello login callback */
  103|  1.77k|    s->srp_ctx.TLS_ext_srp_username_callback = ctx->srp_ctx.TLS_ext_srp_username_callback;
  104|       |    /* set SRP N/g param callback for verification */
  105|  1.77k|    s->srp_ctx.SRP_verify_param_callback = ctx->srp_ctx.SRP_verify_param_callback;
  106|       |    /* set SRP client passwd callback */
  107|  1.77k|    s->srp_ctx.SRP_give_srp_client_pwd_callback = ctx->srp_ctx.SRP_give_srp_client_pwd_callback;
  108|       |
  109|  1.77k|    s->srp_ctx.strength = ctx->srp_ctx.strength;
  110|       |
  111|  1.77k|    if (((ctx->srp_ctx.N != NULL) && ((s->srp_ctx.N = BN_dup(ctx->srp_ctx.N)) == NULL)) || ((ctx->srp_ctx.g != NULL) && ((s->srp_ctx.g = BN_dup(ctx->srp_ctx.g)) == NULL)) || ((ctx->srp_ctx.s != NULL) && ((s->srp_ctx.s = BN_dup(ctx->srp_ctx.s)) == NULL)) || ((ctx->srp_ctx.B != NULL) && ((s->srp_ctx.B = BN_dup(ctx->srp_ctx.B)) == NULL)) || ((ctx->srp_ctx.A != NULL) && ((s->srp_ctx.A = BN_dup(ctx->srp_ctx.A)) == NULL)) || ((ctx->srp_ctx.a != NULL) && ((s->srp_ctx.a = BN_dup(ctx->srp_ctx.a)) == NULL)) || ((ctx->srp_ctx.v != NULL) && ((s->srp_ctx.v = BN_dup(ctx->srp_ctx.v)) == NULL)) || ((ctx->srp_ctx.b != NULL) && ((s->srp_ctx.b = BN_dup(ctx->srp_ctx.b)) == NULL))) {
  ------------------
  |  Branch (111:10): [True: 0, False: 1.77k]
  |  Branch (111:38): [True: 0, False: 0]
  |  Branch (111:93): [True: 0, False: 1.77k]
  |  Branch (111:121): [True: 0, False: 0]
  |  Branch (111:176): [True: 0, False: 1.77k]
  |  Branch (111:204): [True: 0, False: 0]
  |  Branch (111:259): [True: 0, False: 1.77k]
  |  Branch (111:287): [True: 0, False: 0]
  |  Branch (111:342): [True: 0, False: 1.77k]
  |  Branch (111:370): [True: 0, False: 0]
  |  Branch (111:425): [True: 0, False: 1.77k]
  |  Branch (111:453): [True: 0, False: 0]
  |  Branch (111:508): [True: 0, False: 1.77k]
  |  Branch (111:536): [True: 0, False: 0]
  |  Branch (111:591): [True: 0, False: 1.77k]
  |  Branch (111:619): [True: 0, False: 0]
  ------------------
  112|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_BN_LIB);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  113|      0|        goto err;
  114|      0|    }
  115|  1.77k|    if ((ctx->srp_ctx.login != NULL) && ((s->srp_ctx.login = OPENSSL_strdup(ctx->srp_ctx.login)) == NULL)) {
  ------------------
  |  |  135|      2|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (115:9): [True: 2, False: 1.76k]
  |  Branch (115:41): [True: 0, False: 2]
  ------------------
  116|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  117|      0|        goto err;
  118|      0|    }
  119|  1.77k|    if ((ctx->srp_ctx.info != NULL) && ((s->srp_ctx.info = OPENSSL_strdup(ctx->srp_ctx.info)) == NULL)) {
  ------------------
  |  |  135|      2|    CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (119:9): [True: 2, False: 1.76k]
  |  Branch (119:40): [True: 0, False: 2]
  ------------------
  120|      0|        ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  404|      0|#define ERR_raise(lib, reason) ERR_raise_data((lib), (reason), NULL)
  |  |  ------------------
  |  |  |  |  406|      0|    (ERR_new(),                                                  \
  |  |  |  |  407|      0|        ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                       ERR_set_debug(OPENSSL_FILE, OPENSSL_LINE, OPENSSL_FUNC), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  408|      0|        ERR_set_error)
  |  |  ------------------
  ------------------
  121|      0|        goto err;
  122|      0|    }
  123|  1.77k|    s->srp_ctx.srp_Mask = ctx->srp_ctx.srp_Mask;
  124|       |
  125|  1.77k|    return 1;
  126|      0|err:
  127|      0|    OPENSSL_free(s->srp_ctx.login);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  128|      0|    OPENSSL_free(s->srp_ctx.info);
  ------------------
  |  |  131|      0|    CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  314|       |#define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  315|       |#define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  129|      0|    BN_free(s->srp_ctx.N);
  130|      0|    BN_free(s->srp_ctx.g);
  131|      0|    BN_free(s->srp_ctx.s);
  132|      0|    BN_free(s->srp_ctx.B);
  133|      0|    BN_free(s->srp_ctx.A);
  134|      0|    BN_free(s->srp_ctx.a);
  135|      0|    BN_free(s->srp_ctx.b);
  136|      0|    BN_free(s->srp_ctx.v);
  137|      0|    memset(&s->srp_ctx, 0, sizeof(s->srp_ctx));
  138|      0|    return 0;
  139|  1.77k|}
ssl_ctx_srp_ctx_init_intern:
  154|  2.47k|{
  155|  2.47k|    if (ctx == NULL)
  ------------------
  |  Branch (155:9): [True: 0, False: 2.47k]
  ------------------
  156|      0|        return 0;
  157|       |
  158|  2.47k|    memset(&ctx->srp_ctx, 0, sizeof(ctx->srp_ctx));
  159|  2.47k|    ctx->srp_ctx.strength = SRP_MINIMAL_N;
  ------------------
  |  |  276|  2.47k|#define SRP_MINIMAL_N 1024
  ------------------
  160|       |
  161|  2.47k|    return 1;
  162|  2.47k|}
SSL_CTX_set_srp_username:
  506|      5|{
  507|      5|    return tls1_ctx_ctrl(ctx, SSL_CTRL_SET_TLS_EXT_SRP_USERNAME, 0, name);
  ------------------
  |  |  502|      5|#define tls1_ctx_ctrl ssl3_ctx_ctrl
  ------------------
                  return tls1_ctx_ctrl(ctx, SSL_CTRL_SET_TLS_EXT_SRP_USERNAME, 0, name);
  ------------------
  |  | 1339|      5|#define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME 79
  ------------------
  508|      5|}
SSL_CTX_set_srp_password:
  511|      4|{
  512|      4|    return tls1_ctx_ctrl(ctx, SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD, 0, password);
  ------------------
  |  |  502|      4|#define tls1_ctx_ctrl ssl3_ctx_ctrl
  ------------------
                  return tls1_ctx_ctrl(ctx, SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD, 0, password);
  ------------------
  |  | 1341|      4|#define SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD 81
  ------------------
  513|      4|}

adler32_z:
   61|    370|uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) {
   62|    370|    unsigned long sum2;
   63|    370|    unsigned n;
   64|       |
   65|       |    /* split Adler-32 into component sums */
   66|    370|    sum2 = (adler >> 16) & 0xffff;
   67|    370|    adler &= 0xffff;
   68|       |
   69|       |    /* in case user likes doing a byte at a time, keep it fast */
   70|    370|    if (len == 1) {
  ------------------
  |  Branch (70:9): [True: 34, False: 336]
  ------------------
   71|     34|        adler += buf[0];
   72|     34|        if (adler >= BASE)
  ------------------
  |  |   10|     34|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
  |  Branch (72:13): [True: 3, False: 31]
  ------------------
   73|      3|            adler -= BASE;
  ------------------
  |  |   10|      3|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   74|     34|        sum2 += adler;
   75|     34|        if (sum2 >= BASE)
  ------------------
  |  |   10|     34|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
  |  Branch (75:13): [True: 11, False: 23]
  ------------------
   76|     11|            sum2 -= BASE;
  ------------------
  |  |   10|     11|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   77|     34|        return adler | (sum2 << 16);
   78|     34|    }
   79|       |
   80|       |    /* initial Adler-32 value (deferred check for len == 1 speed) */
   81|    336|    if (buf == Z_NULL)
  ------------------
  |  |  212|    336|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (81:9): [True: 99, False: 237]
  ------------------
   82|     99|        return 1L;
   83|       |
   84|       |    /* in case short lengths are provided, keep it somewhat fast */
   85|    237|    if (len < 16) {
  ------------------
  |  Branch (85:9): [True: 34, False: 203]
  ------------------
   86|    322|        while (len--) {
  ------------------
  |  Branch (86:16): [True: 288, False: 34]
  ------------------
   87|    288|            adler += *buf++;
   88|    288|            sum2 += adler;
   89|    288|        }
   90|     34|        if (adler >= BASE)
  ------------------
  |  |   10|     34|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
  |  Branch (90:13): [True: 5, False: 29]
  ------------------
   91|      5|            adler -= BASE;
  ------------------
  |  |   10|      5|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   92|     34|        MOD28(sum2);            /* only added so many BASE's */
  ------------------
  |  |   56|     34|#  define MOD28(a) a %= BASE
  |  |  ------------------
  |  |  |  |   10|     34|#define BASE 65521U     /* largest prime smaller than 65536 */
  |  |  ------------------
  ------------------
   93|     34|        return adler | (sum2 << 16);
   94|     34|    }
   95|       |
   96|       |    /* do length NMAX blocks -- requires just one modulo operation */
   97|    278|    while (len >= NMAX) {
  ------------------
  |  |   11|    278|#define NMAX 5552
  ------------------
  |  Branch (97:12): [True: 75, False: 203]
  ------------------
   98|     75|        len -= NMAX;
  ------------------
  |  |   11|     75|#define NMAX 5552
  ------------------
   99|     75|        n = NMAX / 16;          /* NMAX is divisible by 16 */
  ------------------
  |  |   11|     75|#define NMAX 5552
  ------------------
  100|  26.0k|        do {
  101|  26.0k|            DO16(buf);          /* 16 sums unrolled */
  ------------------
  |  |   18|  26.0k|#define DO16(buf)   DO8(buf,0); DO8(buf,8);
  |  |  ------------------
  |  |  |  |   17|  26.0k|#define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  26.0k|#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  26.0k|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  26.0k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  26.0k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  26.0k|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  26.0k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  26.0k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  26.0k|#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  26.0k|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  26.0k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  26.0k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  26.0k|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  26.0k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  26.0k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DO16(buf)   DO8(buf,0); DO8(buf,8);
  |  |  ------------------
  |  |  |  |   17|  26.0k|#define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  26.0k|#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  26.0k|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  26.0k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  26.0k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  26.0k|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  26.0k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  26.0k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  26.0k|#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  26.0k|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  26.0k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  26.0k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  26.0k|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  26.0k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  26.0k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  102|  26.0k|            buf += 16;
  103|  26.0k|        } while (--n);
  ------------------
  |  Branch (103:18): [True: 25.9k, False: 75]
  ------------------
  104|     75|        MOD(adler);
  ------------------
  |  |   55|     75|#  define MOD(a) a %= BASE
  |  |  ------------------
  |  |  |  |   10|     75|#define BASE 65521U     /* largest prime smaller than 65536 */
  |  |  ------------------
  ------------------
  105|     75|        MOD(sum2);
  ------------------
  |  |   55|     75|#  define MOD(a) a %= BASE
  |  |  ------------------
  |  |  |  |   10|     75|#define BASE 65521U     /* largest prime smaller than 65536 */
  |  |  ------------------
  ------------------
  106|     75|    }
  107|       |
  108|       |    /* do remaining bytes (less than NMAX, still just one modulo) */
  109|    203|    if (len) {                  /* avoid modulos if none remaining */
  ------------------
  |  Branch (109:9): [True: 202, False: 1]
  ------------------
  110|  23.4k|        while (len >= 16) {
  ------------------
  |  Branch (110:16): [True: 23.2k, False: 202]
  ------------------
  111|  23.2k|            len -= 16;
  112|  23.2k|            DO16(buf);
  ------------------
  |  |   18|  23.2k|#define DO16(buf)   DO8(buf,0); DO8(buf,8);
  |  |  ------------------
  |  |  |  |   17|  23.2k|#define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  23.2k|#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  23.2k|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  23.2k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  23.2k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  23.2k|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  23.2k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  23.2k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  23.2k|#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  23.2k|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  23.2k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  23.2k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  23.2k|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  23.2k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  23.2k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DO16(buf)   DO8(buf,0); DO8(buf,8);
  |  |  ------------------
  |  |  |  |   17|  23.2k|#define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  23.2k|#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  23.2k|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  23.2k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  23.2k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  23.2k|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  23.2k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  23.2k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  23.2k|#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  23.2k|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  23.2k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  23.2k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  23.2k|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  23.2k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  23.2k|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  113|  23.2k|            buf += 16;
  114|  23.2k|        }
  115|  1.65k|        while (len--) {
  ------------------
  |  Branch (115:16): [True: 1.45k, False: 202]
  ------------------
  116|  1.45k|            adler += *buf++;
  117|  1.45k|            sum2 += adler;
  118|  1.45k|        }
  119|    202|        MOD(adler);
  ------------------
  |  |   55|    202|#  define MOD(a) a %= BASE
  |  |  ------------------
  |  |  |  |   10|    202|#define BASE 65521U     /* largest prime smaller than 65536 */
  |  |  ------------------
  ------------------
  120|    202|        MOD(sum2);
  ------------------
  |  |   55|    202|#  define MOD(a) a %= BASE
  |  |  ------------------
  |  |  |  |   10|    202|#define BASE 65521U     /* largest prime smaller than 65536 */
  |  |  ------------------
  ------------------
  121|    202|    }
  122|       |
  123|       |    /* return recombined sums */
  124|    203|    return adler | (sum2 << 16);
  125|    237|}
adler32:
  128|    370|uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) {
  129|    370|    return adler32_z(adler, buf, len);
  130|    370|}

inflate_fast:
   50|  6.70k|void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) {
   51|  6.70k|    struct inflate_state FAR *state;
   52|  6.70k|    z_const unsigned char FAR *in;      /* local strm->next_in */
   53|  6.70k|    z_const unsigned char FAR *last;    /* have enough input while in < last */
   54|  6.70k|    unsigned char FAR *out;     /* local strm->next_out */
   55|  6.70k|    unsigned char FAR *beg;     /* inflate()'s initial strm->next_out */
   56|  6.70k|    unsigned char FAR *end;     /* while out < end, enough space available */
   57|       |#ifdef INFLATE_STRICT
   58|       |    unsigned dmax;              /* maximum distance from zlib header */
   59|       |#endif
   60|  6.70k|    unsigned wsize;             /* window size or zero if not using window */
   61|  6.70k|    unsigned whave;             /* valid bytes in the window */
   62|  6.70k|    unsigned wnext;             /* window write index */
   63|  6.70k|    unsigned char FAR *window;  /* allocated sliding window, if wsize != 0 */
   64|  6.70k|    unsigned long hold;         /* local strm->hold */
   65|  6.70k|    unsigned bits;              /* local strm->bits */
   66|  6.70k|    code const FAR *lcode;      /* local strm->lencode */
   67|  6.70k|    code const FAR *dcode;      /* local strm->distcode */
   68|  6.70k|    unsigned lmask;             /* mask for first level of length codes */
   69|  6.70k|    unsigned dmask;             /* mask for first level of distance codes */
   70|  6.70k|    code const *here;           /* retrieved table entry */
   71|  6.70k|    unsigned op;                /* code bits, operation, extra bits, or */
   72|       |                                /*  window position, window bytes to copy */
   73|  6.70k|    unsigned len;               /* match length, unused bytes */
   74|  6.70k|    unsigned dist;              /* match distance */
   75|  6.70k|    unsigned char FAR *from;    /* where to copy match from */
   76|       |
   77|       |    /* copy state to local variables */
   78|  6.70k|    state = (struct inflate_state FAR *)strm->state;
   79|  6.70k|    in = strm->next_in;
   80|  6.70k|    last = in + (strm->avail_in - 5);
   81|  6.70k|    out = strm->next_out;
   82|  6.70k|    beg = out - (start - strm->avail_out);
   83|  6.70k|    end = out + (strm->avail_out - 257);
   84|       |#ifdef INFLATE_STRICT
   85|       |    dmax = state->dmax;
   86|       |#endif
   87|  6.70k|    wsize = state->wsize;
   88|  6.70k|    whave = state->whave;
   89|  6.70k|    wnext = state->wnext;
   90|  6.70k|    window = state->window;
   91|  6.70k|    hold = state->hold;
   92|  6.70k|    bits = state->bits;
   93|  6.70k|    lcode = state->lencode;
   94|  6.70k|    dcode = state->distcode;
   95|  6.70k|    lmask = (1U << state->lenbits) - 1;
   96|  6.70k|    dmask = (1U << state->distbits) - 1;
   97|       |
   98|       |    /* decode literals and length/distances until end-of-block or not enough
   99|       |       input data or output space */
  100|  2.58M|    do {
  101|  2.58M|        if (bits < 15) {
  ------------------
  |  Branch (101:13): [True: 1.34M, False: 1.24M]
  ------------------
  102|  1.34M|            hold += (unsigned long)(*in++) << bits;
  103|  1.34M|            bits += 8;
  104|  1.34M|            hold += (unsigned long)(*in++) << bits;
  105|  1.34M|            bits += 8;
  106|  1.34M|        }
  107|  2.58M|        here = lcode + (hold & lmask);
  108|  2.58M|      dolen:
  109|  2.58M|        op = (unsigned)(here->bits);
  110|  2.58M|        hold >>= op;
  111|  2.58M|        bits -= op;
  112|  2.58M|        op = (unsigned)(here->op);
  113|  2.58M|        if (op == 0) {                          /* literal */
  ------------------
  |  Branch (113:13): [True: 2.09M, False: 494k]
  ------------------
  114|  2.09M|            Tracevv((stderr, here->val >= 0x20 && here->val < 0x7f ?
  115|  2.09M|                    "inflate:         literal '%c'\n" :
  116|  2.09M|                    "inflate:         literal 0x%02x\n", here->val));
  117|  2.09M|            *out++ = (unsigned char)(here->val);
  118|  2.09M|        }
  119|   494k|        else if (op & 16) {                     /* length base */
  ------------------
  |  Branch (119:18): [True: 490k, False: 3.80k]
  ------------------
  120|   490k|            len = (unsigned)(here->val);
  121|   490k|            op &= 15;                           /* number of extra bits */
  122|   490k|            if (op) {
  ------------------
  |  Branch (122:17): [True: 339k, False: 150k]
  ------------------
  123|   339k|                if (bits < op) {
  ------------------
  |  Branch (123:21): [True: 0, False: 339k]
  ------------------
  124|      0|                    hold += (unsigned long)(*in++) << bits;
  125|      0|                    bits += 8;
  126|      0|                }
  127|   339k|                len += (unsigned)hold & ((1U << op) - 1);
  128|   339k|                hold >>= op;
  129|   339k|                bits -= op;
  130|   339k|            }
  131|   490k|            Tracevv((stderr, "inflate:         length %u\n", len));
  132|   490k|            if (bits < 15) {
  ------------------
  |  Branch (132:17): [True: 335k, False: 155k]
  ------------------
  133|   335k|                hold += (unsigned long)(*in++) << bits;
  134|   335k|                bits += 8;
  135|   335k|                hold += (unsigned long)(*in++) << bits;
  136|   335k|                bits += 8;
  137|   335k|            }
  138|   490k|            here = dcode + (hold & dmask);
  139|   490k|          dodist:
  140|   490k|            op = (unsigned)(here->bits);
  141|   490k|            hold >>= op;
  142|   490k|            bits -= op;
  143|   490k|            op = (unsigned)(here->op);
  144|   490k|            if (op & 16) {                      /* distance base */
  ------------------
  |  Branch (144:17): [True: 490k, False: 24]
  ------------------
  145|   490k|                dist = (unsigned)(here->val);
  146|   490k|                op &= 15;                       /* number of extra bits */
  147|   490k|                if (bits < op) {
  ------------------
  |  Branch (147:21): [True: 1.41k, False: 488k]
  ------------------
  148|  1.41k|                    hold += (unsigned long)(*in++) << bits;
  149|  1.41k|                    bits += 8;
  150|  1.41k|                    if (bits < op) {
  ------------------
  |  Branch (150:25): [True: 0, False: 1.41k]
  ------------------
  151|      0|                        hold += (unsigned long)(*in++) << bits;
  152|      0|                        bits += 8;
  153|      0|                    }
  154|  1.41k|                }
  155|   490k|                dist += (unsigned)hold & ((1U << op) - 1);
  156|       |#ifdef INFLATE_STRICT
  157|       |                if (dist > dmax) {
  158|       |                    strm->msg = (char *)"invalid distance too far back";
  159|       |                    state->mode = BAD;
  160|       |                    break;
  161|       |                }
  162|       |#endif
  163|   490k|                hold >>= op;
  164|   490k|                bits -= op;
  165|   490k|                Tracevv((stderr, "inflate:         distance %u\n", dist));
  166|   490k|                op = (unsigned)(out - beg);     /* max distance in output */
  167|   490k|                if (dist > op) {                /* see if copy from window */
  ------------------
  |  Branch (167:21): [True: 22.0k, False: 468k]
  ------------------
  168|  22.0k|                    op = dist - op;             /* distance back in window */
  169|  22.0k|                    if (op > whave) {
  ------------------
  |  Branch (169:25): [True: 33, False: 22.0k]
  ------------------
  170|     33|                        if (state->sane) {
  ------------------
  |  Branch (170:29): [True: 33, False: 0]
  ------------------
  171|     33|                            strm->msg =
  172|     33|                                (char *)"invalid distance too far back";
  173|     33|                            state->mode = BAD;
  174|     33|                            break;
  175|     33|                        }
  176|       |#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
  177|       |                        if (len <= op - whave) {
  178|       |                            do {
  179|       |                                *out++ = 0;
  180|       |                            } while (--len);
  181|       |                            continue;
  182|       |                        }
  183|       |                        len -= op - whave;
  184|       |                        do {
  185|       |                            *out++ = 0;
  186|       |                        } while (--op > whave);
  187|       |                        if (op == 0) {
  188|       |                            from = out - dist;
  189|       |                            do {
  190|       |                                *out++ = *from++;
  191|       |                            } while (--len);
  192|       |                            continue;
  193|       |                        }
  194|       |#endif
  195|     33|                    }
  196|  22.0k|                    from = window;
  197|  22.0k|                    if (wnext == 0) {           /* very common case */
  ------------------
  |  Branch (197:25): [True: 4.99k, False: 17.0k]
  ------------------
  198|  4.99k|                        from += wsize - op;
  199|  4.99k|                        if (op < len) {         /* some from window */
  ------------------
  |  Branch (199:29): [True: 415, False: 4.57k]
  ------------------
  200|    415|                            len -= op;
  201|  34.4k|                            do {
  202|  34.4k|                                *out++ = *from++;
  203|  34.4k|                            } while (--op);
  ------------------
  |  Branch (203:38): [True: 34.0k, False: 415]
  ------------------
  204|    415|                            from = out - dist;  /* rest from output */
  205|    415|                        }
  206|  4.99k|                    }
  207|  17.0k|                    else if (wnext < op) {      /* wrap around window */
  ------------------
  |  Branch (207:30): [True: 2.26k, False: 14.7k]
  ------------------
  208|  2.26k|                        from += wsize + wnext - op;
  209|  2.26k|                        op -= wnext;
  210|  2.26k|                        if (op < len) {         /* some from end of window */
  ------------------
  |  Branch (210:29): [True: 129, False: 2.13k]
  ------------------
  211|    129|                            len -= op;
  212|  9.52k|                            do {
  213|  9.52k|                                *out++ = *from++;
  214|  9.52k|                            } while (--op);
  ------------------
  |  Branch (214:38): [True: 9.39k, False: 129]
  ------------------
  215|    129|                            from = window;
  216|    129|                            if (wnext < len) {  /* some from start of window */
  ------------------
  |  Branch (216:33): [True: 86, False: 43]
  ------------------
  217|     86|                                op = wnext;
  218|     86|                                len -= op;
  219|  2.69k|                                do {
  220|  2.69k|                                    *out++ = *from++;
  221|  2.69k|                                } while (--op);
  ------------------
  |  Branch (221:42): [True: 2.60k, False: 86]
  ------------------
  222|     86|                                from = out - dist;      /* rest from output */
  223|     86|                            }
  224|    129|                        }
  225|  2.26k|                    }
  226|  14.7k|                    else {                      /* contiguous in window */
  227|  14.7k|                        from += wnext - op;
  228|  14.7k|                        if (op < len) {         /* some from window */
  ------------------
  |  Branch (228:29): [True: 3.26k, False: 11.5k]
  ------------------
  229|  3.26k|                            len -= op;
  230|   127k|                            do {
  231|   127k|                                *out++ = *from++;
  232|   127k|                            } while (--op);
  ------------------
  |  Branch (232:38): [True: 123k, False: 3.26k]
  ------------------
  233|  3.26k|                            from = out - dist;  /* rest from output */
  234|  3.26k|                        }
  235|  14.7k|                    }
  236|   396k|                    while (len > 2) {
  ------------------
  |  Branch (236:28): [True: 374k, False: 22.0k]
  ------------------
  237|   374k|                        *out++ = *from++;
  238|   374k|                        *out++ = *from++;
  239|   374k|                        *out++ = *from++;
  240|   374k|                        len -= 3;
  241|   374k|                    }
  242|  22.0k|                    if (len) {
  ------------------
  |  Branch (242:25): [True: 12.3k, False: 9.65k]
  ------------------
  243|  12.3k|                        *out++ = *from++;
  244|  12.3k|                        if (len > 1)
  ------------------
  |  Branch (244:29): [True: 7.06k, False: 5.30k]
  ------------------
  245|  7.06k|                            *out++ = *from++;
  246|  12.3k|                    }
  247|  22.0k|                }
  248|   468k|                else {
  249|   468k|                    from = out - dist;          /* copy direct from output */
  250|  11.0M|                    do {                        /* minimum length is three */
  251|  11.0M|                        *out++ = *from++;
  252|  11.0M|                        *out++ = *from++;
  253|  11.0M|                        *out++ = *from++;
  254|  11.0M|                        len -= 3;
  255|  11.0M|                    } while (len > 2);
  ------------------
  |  Branch (255:30): [True: 10.6M, False: 468k]
  ------------------
  256|   468k|                    if (len) {
  ------------------
  |  Branch (256:25): [True: 269k, False: 199k]
  ------------------
  257|   269k|                        *out++ = *from++;
  258|   269k|                        if (len > 1)
  ------------------
  |  Branch (258:29): [True: 119k, False: 149k]
  ------------------
  259|   119k|                            *out++ = *from++;
  260|   269k|                    }
  261|   468k|                }
  262|   490k|            }
  263|     24|            else if ((op & 64) == 0) {          /* 2nd level distance code */
  ------------------
  |  Branch (263:22): [True: 0, False: 24]
  ------------------
  264|      0|                here = dcode + here->val + (hold & ((1U << op) - 1));
  265|      0|                goto dodist;
  266|      0|            }
  267|     24|            else {
  268|     24|                strm->msg = (char *)"invalid distance code";
  269|     24|                state->mode = BAD;
  270|     24|                break;
  271|     24|            }
  272|   490k|        }
  273|  3.80k|        else if ((op & 64) == 0) {              /* 2nd level length code */
  ------------------
  |  Branch (273:18): [True: 1, False: 3.80k]
  ------------------
  274|      1|            here = lcode + here->val + (hold & ((1U << op) - 1));
  275|      1|            goto dolen;
  276|      1|        }
  277|  3.80k|        else if (op & 32) {                     /* end-of-block */
  ------------------
  |  Branch (277:18): [True: 3.78k, False: 17]
  ------------------
  278|  3.78k|            Tracevv((stderr, "inflate:         end of block\n"));
  279|  3.78k|            state->mode = TYPE;
  280|  3.78k|            break;
  281|  3.78k|        }
  282|     17|        else {
  283|     17|            strm->msg = (char *)"invalid literal/length code";
  284|     17|            state->mode = BAD;
  285|     17|            break;
  286|     17|        }
  287|  2.58M|    } while (in < last && out < end);
  ------------------
  |  Branch (287:14): [True: 2.58M, False: 896]
  |  Branch (287:27): [True: 2.58M, False: 1.95k]
  ------------------
  288|       |
  289|       |    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
  290|  6.70k|    len = bits >> 3;
  291|  6.70k|    in -= len;
  292|  6.70k|    bits -= len << 3;
  293|  6.70k|    hold &= (1U << bits) - 1;
  294|       |
  295|       |    /* update state and return */
  296|  6.70k|    strm->next_in = in;
  297|  6.70k|    strm->next_out = out;
  298|  6.70k|    strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
  ------------------
  |  Branch (298:33): [True: 6.28k, False: 427]
  ------------------
  299|  6.70k|    strm->avail_out = (unsigned)(out < end ?
  ------------------
  |  Branch (299:34): [True: 4.74k, False: 1.96k]
  ------------------
  300|  4.74k|                                 257 + (end - out) : 257 - (out - end));
  301|  6.70k|    state->hold = hold;
  302|  6.70k|    state->bits = bits;
  303|  6.70k|    return;
  304|  6.70k|}

inflateResetKeep:
  106|  1.27k|int ZEXPORT inflateResetKeep(z_streamp strm) {
  107|  1.27k|    struct inflate_state FAR *state;
  108|       |
  109|  1.27k|    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
  ------------------
  |  |  181|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (109:9): [True: 0, False: 1.27k]
  ------------------
  110|  1.27k|    state = (struct inflate_state FAR *)strm->state;
  111|  1.27k|    strm->total_in = strm->total_out = state->total = 0;
  112|  1.27k|    strm->msg = Z_NULL;
  ------------------
  |  |  212|  1.27k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  113|  1.27k|    if (state->wrap)        /* to support ill-conceived Java test suite */
  ------------------
  |  Branch (113:9): [True: 715, False: 563]
  ------------------
  114|    715|        strm->adler = state->wrap & 1;
  115|  1.27k|    state->mode = HEAD;
  116|  1.27k|    state->last = 0;
  117|  1.27k|    state->havedict = 0;
  118|  1.27k|    state->flags = -1;
  119|  1.27k|    state->dmax = 32768U;
  120|  1.27k|    state->head = Z_NULL;
  ------------------
  |  |  212|  1.27k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  121|  1.27k|    state->hold = 0;
  122|  1.27k|    state->bits = 0;
  123|  1.27k|    state->lencode = state->distcode = state->next = state->codes;
  124|  1.27k|    state->sane = 1;
  125|  1.27k|    state->back = -1;
  126|  1.27k|    Tracev((stderr, "inflate: reset\n"));
  127|  1.27k|    return Z_OK;
  ------------------
  |  |  177|  1.27k|#define Z_OK            0
  ------------------
  128|  1.27k|}
inflateReset:
  130|  1.27k|int ZEXPORT inflateReset(z_streamp strm) {
  131|  1.27k|    struct inflate_state FAR *state;
  132|       |
  133|  1.27k|    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
  ------------------
  |  |  181|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (133:9): [True: 0, False: 1.27k]
  ------------------
  134|  1.27k|    state = (struct inflate_state FAR *)strm->state;
  135|  1.27k|    state->wsize = 0;
  136|  1.27k|    state->whave = 0;
  137|  1.27k|    state->wnext = 0;
  138|  1.27k|    return inflateResetKeep(strm);
  139|  1.27k|}
inflateReset2:
  141|  1.27k|int ZEXPORT inflateReset2(z_streamp strm, int windowBits) {
  142|  1.27k|    int wrap;
  143|  1.27k|    struct inflate_state FAR *state;
  144|       |
  145|       |    /* get the state */
  146|  1.27k|    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
  ------------------
  |  |  181|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (146:9): [True: 0, False: 1.27k]
  ------------------
  147|  1.27k|    state = (struct inflate_state FAR *)strm->state;
  148|       |
  149|       |    /* extract wrap request from windowBits parameter */
  150|  1.27k|    if (windowBits < 0) {
  ------------------
  |  Branch (150:9): [True: 563, False: 715]
  ------------------
  151|    563|        if (windowBits < -15)
  ------------------
  |  Branch (151:13): [True: 0, False: 563]
  ------------------
  152|      0|            return Z_STREAM_ERROR;
  ------------------
  |  |  181|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  153|    563|        wrap = 0;
  154|    563|        windowBits = -windowBits;
  155|    563|    }
  156|    715|    else {
  157|    715|        wrap = (windowBits >> 4) + 5;
  158|    715|#ifdef GUNZIP
  159|    715|        if (windowBits < 48)
  ------------------
  |  Branch (159:13): [True: 715, False: 0]
  ------------------
  160|    715|            windowBits &= 15;
  161|    715|#endif
  162|    715|    }
  163|       |
  164|       |    /* set number of window bits, free window if different */
  165|  1.27k|    if (windowBits && (windowBits < 8 || windowBits > 15))
  ------------------
  |  Branch (165:9): [True: 1.27k, False: 0]
  |  Branch (165:24): [True: 0, False: 1.27k]
  |  Branch (165:42): [True: 0, False: 1.27k]
  ------------------
  166|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  181|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  167|  1.27k|    if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {
  ------------------
  |  |  212|  2.55k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (167:9): [True: 0, False: 1.27k]
  |  Branch (167:36): [True: 0, False: 0]
  ------------------
  168|      0|        ZFREE(strm, state->window);
  ------------------
  |  |  247|      0|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
  169|      0|        state->window = Z_NULL;
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  170|      0|    }
  171|       |
  172|       |    /* update state and reset the rest of it */
  173|  1.27k|    state->wrap = wrap;
  174|  1.27k|    state->wbits = (unsigned)windowBits;
  175|  1.27k|    return inflateReset(strm);
  176|  1.27k|}
inflateInit2_:
  179|    715|                          const char *version, int stream_size) {
  180|    715|    int ret;
  181|    715|    struct inflate_state FAR *state;
  182|       |
  183|    715|    if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
  ------------------
  |  |  212|  1.43k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
  ------------------
  |  |   40|    715|#define ZLIB_VERSION "1.3.1"
  ------------------
  |  Branch (183:9): [True: 0, False: 715]
  |  Branch (183:30): [True: 0, False: 715]
  ------------------
  184|    715|        stream_size != (int)(sizeof(z_stream)))
  ------------------
  |  Branch (184:9): [True: 0, False: 715]
  ------------------
  185|      0|        return Z_VERSION_ERROR;
  ------------------
  |  |  185|      0|#define Z_VERSION_ERROR (-6)
  ------------------
  186|    715|    if (strm == Z_NULL) return Z_STREAM_ERROR;
  ------------------
  |  |  212|    715|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (strm == Z_NULL) return Z_STREAM_ERROR;
  ------------------
  |  |  181|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (186:9): [True: 0, False: 715]
  ------------------
  187|    715|    strm->msg = Z_NULL;                 /* in case we return an error */
  ------------------
  |  |  212|    715|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  188|    715|    if (strm->zalloc == (alloc_func)0) {
  ------------------
  |  Branch (188:9): [True: 0, False: 715]
  ------------------
  189|       |#ifdef Z_SOLO
  190|       |        return Z_STREAM_ERROR;
  191|       |#else
  192|      0|        strm->zalloc = zcalloc;
  193|      0|        strm->opaque = (voidpf)0;
  194|      0|#endif
  195|      0|    }
  196|    715|    if (strm->zfree == (free_func)0)
  ------------------
  |  Branch (196:9): [True: 0, False: 715]
  ------------------
  197|       |#ifdef Z_SOLO
  198|       |        return Z_STREAM_ERROR;
  199|       |#else
  200|      0|        strm->zfree = zcfree;
  201|    715|#endif
  202|    715|    state = (struct inflate_state FAR *)
  203|    715|            ZALLOC(strm, 1, sizeof(struct inflate_state));
  ------------------
  |  |  246|    715|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  204|    715|    if (state == Z_NULL) return Z_MEM_ERROR;
  ------------------
  |  |  212|    715|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (state == Z_NULL) return Z_MEM_ERROR;
  ------------------
  |  |  183|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  |  Branch (204:9): [True: 0, False: 715]
  ------------------
  205|    715|    Tracev((stderr, "inflate: allocated\n"));
  206|    715|    strm->state = (struct internal_state FAR *)state;
  207|    715|    state->strm = strm;
  208|    715|    state->window = Z_NULL;
  ------------------
  |  |  212|    715|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  209|    715|    state->mode = HEAD;     /* to pass state test in inflateReset2() */
  210|    715|    ret = inflateReset2(strm, windowBits);
  211|    715|    if (ret != Z_OK) {
  ------------------
  |  |  177|    715|#define Z_OK            0
  ------------------
  |  Branch (211:9): [True: 0, False: 715]
  ------------------
  212|      0|        ZFREE(strm, state);
  ------------------
  |  |  247|      0|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
  213|      0|        strm->state = Z_NULL;
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  214|      0|    }
  215|    715|    return ret;
  216|    715|}
inflateInit_:
  219|    715|                         int stream_size) {
  220|    715|    return inflateInit2_(strm, DEF_WBITS, version, stream_size);
  ------------------
  |  |   68|    715|#  define DEF_WBITS MAX_WBITS
  |  |  ------------------
  |  |  |  |  277|    715|#  define MAX_WBITS   15 /* 32K LZ77 window */
  |  |  ------------------
  ------------------
  221|    715|}
inflate:
  590|  8.54k|int ZEXPORT inflate(z_streamp strm, int flush) {
  591|  8.54k|    struct inflate_state FAR *state;
  592|  8.54k|    z_const unsigned char FAR *next;    /* next input */
  593|  8.54k|    unsigned char FAR *put;     /* next output */
  594|  8.54k|    unsigned have, left;        /* available input and output */
  595|  8.54k|    unsigned long hold;         /* bit buffer */
  596|  8.54k|    unsigned bits;              /* bits in bit buffer */
  597|  8.54k|    unsigned in, out;           /* save starting available input and output */
  598|  8.54k|    unsigned copy;              /* number of stored or match bytes to copy */
  599|  8.54k|    unsigned char FAR *from;    /* where to copy match bytes from */
  600|  8.54k|    code here;                  /* current decoding table entry */
  601|  8.54k|    code last;                  /* parent table entry */
  602|  8.54k|    unsigned len;               /* length to copy for repeats, bits to drop */
  603|  8.54k|    int ret;                    /* return code */
  604|  8.54k|#ifdef GUNZIP
  605|  8.54k|    unsigned char hbuf[4];      /* buffer for gzip header crc calculation */
  606|  8.54k|#endif
  607|  8.54k|    static const unsigned short order[19] = /* permutation of code lengths */
  608|  8.54k|        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
  609|       |
  610|  8.54k|    if (inflateStateCheck(strm) || strm->next_out == Z_NULL ||
  ------------------
  |  |  212|  17.0k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (610:9): [True: 0, False: 8.54k]
  |  Branch (610:36): [True: 0, False: 8.54k]
  ------------------
  611|  8.54k|        (strm->next_in == Z_NULL && strm->avail_in != 0))
  ------------------
  |  |  212|  17.0k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (611:10): [True: 0, False: 8.54k]
  |  Branch (611:37): [True: 0, False: 0]
  ------------------
  612|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  181|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  613|       |
  614|  8.54k|    state = (struct inflate_state FAR *)strm->state;
  615|  8.54k|    if (state->mode == TYPE) state->mode = TYPEDO;      /* skip check */
  ------------------
  |  Branch (615:9): [True: 3.95k, False: 4.59k]
  ------------------
  616|  8.54k|    LOAD();
  ------------------
  |  |  445|  8.54k|    do { \
  |  |  446|  8.54k|        put = strm->next_out; \
  |  |  447|  8.54k|        left = strm->avail_out; \
  |  |  448|  8.54k|        next = strm->next_in; \
  |  |  449|  8.54k|        have = strm->avail_in; \
  |  |  450|  8.54k|        hold = state->hold; \
  |  |  451|  8.54k|        bits = state->bits; \
  |  |  452|  8.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (452:14): [Folded, False: 8.54k]
  |  |  ------------------
  ------------------
  617|  8.54k|    in = have;
  618|  8.54k|    out = left;
  619|  8.54k|    ret = Z_OK;
  ------------------
  |  |  177|  8.54k|#define Z_OK            0
  ------------------
  620|  8.54k|    for (;;)
  621|  79.1k|        switch (state->mode) {
  622|  1.25k|        case HEAD:
  ------------------
  |  Branch (622:9): [True: 1.25k, False: 77.8k]
  ------------------
  623|  1.25k|            if (state->wrap == 0) {
  ------------------
  |  Branch (623:17): [True: 563, False: 693]
  ------------------
  624|    563|                state->mode = TYPEDO;
  625|    563|                break;
  626|    563|            }
  627|    693|            NEEDBITS(16);
  ------------------
  |  |  485|    693|    do { \
  |  |  486|  1.99k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 1.34k, False: 649]
  |  |  ------------------
  |  |  487|  1.34k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|  1.34k|    do { \
  |  |  |  |  476|  1.34k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 44, False: 1.30k]
  |  |  |  |  ------------------
  |  |  |  |  477|  1.34k|        have--; \
  |  |  |  |  478|  1.30k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|  1.30k|        bits += 8; \
  |  |  |  |  480|  1.30k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded, False: 1.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|    693|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded, False: 649]
  |  |  ------------------
  ------------------
  628|    649|#ifdef GUNZIP
  629|    649|            if ((state->wrap & 2) && hold == 0x8b1f) {  /* gzip header */
  ------------------
  |  Branch (629:17): [True: 0, False: 649]
  |  Branch (629:38): [True: 0, False: 0]
  ------------------
  630|      0|                if (state->wbits == 0)
  ------------------
  |  Branch (630:21): [True: 0, False: 0]
  ------------------
  631|      0|                    state->wbits = 15;
  632|      0|                state->check = crc32(0L, Z_NULL, 0);
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  633|      0|                CRC2(state->check, hold);
  ------------------
  |  |  427|      0|    do { \
  |  |  428|      0|        hbuf[0] = (unsigned char)(word); \
  |  |  429|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  430|      0|        check = crc32(check, hbuf, 2); \
  |  |  431|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (431:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  634|      0|                INITBITS();
  ------------------
  |  |  467|      0|    do { \
  |  |  468|      0|        hold = 0; \
  |  |  469|      0|        bits = 0; \
  |  |  470|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  635|      0|                state->mode = FLAGS;
  636|      0|                break;
  637|      0|            }
  638|    649|            if (state->head != Z_NULL)
  ------------------
  |  |  212|    649|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (638:17): [True: 0, False: 649]
  ------------------
  639|      0|                state->head->done = -1;
  640|    649|            if (!(state->wrap & 1) ||   /* check if zlib header allowed */
  ------------------
  |  Branch (640:17): [True: 0, False: 649]
  ------------------
  641|       |#else
  642|       |            if (
  643|       |#endif
  644|    649|                ((BITS(8) << 8) + (hold >> 8)) % 31) {
  ------------------
  |  |  492|    649|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  |  Branch (644:17): [True: 543, False: 106]
  ------------------
  645|    543|                strm->msg = (char *)"incorrect header check";
  646|    543|                state->mode = BAD;
  647|    543|                break;
  648|    543|            }
  649|    106|            if (BITS(4) != Z_DEFLATED) {
  ------------------
  |  |  492|    106|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
                          if (BITS(4) != Z_DEFLATED) {
  ------------------
  |  |  209|    106|#define Z_DEFLATED   8
  ------------------
  |  Branch (649:17): [True: 6, False: 100]
  ------------------
  650|      6|                strm->msg = (char *)"unknown compression method";
  651|      6|                state->mode = BAD;
  652|      6|                break;
  653|      6|            }
  654|    100|            DROPBITS(4);
  ------------------
  |  |  496|    100|    do { \
  |  |  497|    100|        hold >>= (n); \
  |  |  498|    100|        bits -= (unsigned)(n); \
  |  |  499|    100|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 100]
  |  |  ------------------
  ------------------
  655|    100|            len = BITS(4) + 8;
  ------------------
  |  |  492|    100|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  656|    100|            if (state->wbits == 0)
  ------------------
  |  Branch (656:17): [True: 0, False: 100]
  ------------------
  657|      0|                state->wbits = len;
  658|    100|            if (len > 15 || len > state->wbits) {
  ------------------
  |  Branch (658:17): [True: 1, False: 99]
  |  Branch (658:29): [True: 0, False: 99]
  ------------------
  659|      1|                strm->msg = (char *)"invalid window size";
  660|      1|                state->mode = BAD;
  661|      1|                break;
  662|      1|            }
  663|     99|            state->dmax = 1U << len;
  664|     99|            state->flags = 0;               /* indicate zlib header */
  665|     99|            Tracev((stderr, "inflate:   zlib header ok\n"));
  666|     99|            strm->adler = state->check = adler32(0L, Z_NULL, 0);
  ------------------
  |  |  212|     99|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  667|     99|            state->mode = hold & 0x200 ? DICTID : TYPE;
  ------------------
  |  Branch (667:27): [True: 4, False: 95]
  ------------------
  668|     99|            INITBITS();
  ------------------
  |  |  467|     99|    do { \
  |  |  468|     99|        hold = 0; \
  |  |  469|     99|        bits = 0; \
  |  |  470|     99|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded, False: 99]
  |  |  ------------------
  ------------------
  669|     99|            break;
  670|      0|#ifdef GUNZIP
  671|      0|        case FLAGS:
  ------------------
  |  Branch (671:9): [True: 0, False: 79.1k]
  ------------------
  672|      0|            NEEDBITS(16);
  ------------------
  |  |  485|      0|    do { \
  |  |  486|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  487|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|      0|    do { \
  |  |  |  |  476|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  477|      0|        have--; \
  |  |  |  |  478|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|      0|        bits += 8; \
  |  |  |  |  480|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  673|      0|            state->flags = (int)(hold);
  674|      0|            if ((state->flags & 0xff) != Z_DEFLATED) {
  ------------------
  |  |  209|      0|#define Z_DEFLATED   8
  ------------------
  |  Branch (674:17): [True: 0, False: 0]
  ------------------
  675|      0|                strm->msg = (char *)"unknown compression method";
  676|      0|                state->mode = BAD;
  677|      0|                break;
  678|      0|            }
  679|      0|            if (state->flags & 0xe000) {
  ------------------
  |  Branch (679:17): [True: 0, False: 0]
  ------------------
  680|      0|                strm->msg = (char *)"unknown header flags set";
  681|      0|                state->mode = BAD;
  682|      0|                break;
  683|      0|            }
  684|      0|            if (state->head != Z_NULL)
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (684:17): [True: 0, False: 0]
  ------------------
  685|      0|                state->head->text = (int)((hold >> 8) & 1);
  686|      0|            if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (686:17): [True: 0, False: 0]
  |  Branch (686:44): [True: 0, False: 0]
  ------------------
  687|      0|                CRC2(state->check, hold);
  ------------------
  |  |  427|      0|    do { \
  |  |  428|      0|        hbuf[0] = (unsigned char)(word); \
  |  |  429|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  430|      0|        check = crc32(check, hbuf, 2); \
  |  |  431|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (431:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  688|      0|            INITBITS();
  ------------------
  |  |  467|      0|    do { \
  |  |  468|      0|        hold = 0; \
  |  |  469|      0|        bits = 0; \
  |  |  470|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  689|      0|            state->mode = TIME;
  690|       |                /* fallthrough */
  691|      0|        case TIME:
  ------------------
  |  Branch (691:9): [True: 0, False: 79.1k]
  ------------------
  692|      0|            NEEDBITS(32);
  ------------------
  |  |  485|      0|    do { \
  |  |  486|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  487|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|      0|    do { \
  |  |  |  |  476|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  477|      0|        have--; \
  |  |  |  |  478|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|      0|        bits += 8; \
  |  |  |  |  480|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  693|      0|            if (state->head != Z_NULL)
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (693:17): [True: 0, False: 0]
  ------------------
  694|      0|                state->head->time = hold;
  695|      0|            if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (695:17): [True: 0, False: 0]
  |  Branch (695:44): [True: 0, False: 0]
  ------------------
  696|      0|                CRC4(state->check, hold);
  ------------------
  |  |  434|      0|    do { \
  |  |  435|      0|        hbuf[0] = (unsigned char)(word); \
  |  |  436|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  437|      0|        hbuf[2] = (unsigned char)((word) >> 16); \
  |  |  438|      0|        hbuf[3] = (unsigned char)((word) >> 24); \
  |  |  439|      0|        check = crc32(check, hbuf, 4); \
  |  |  440|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (440:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  697|      0|            INITBITS();
  ------------------
  |  |  467|      0|    do { \
  |  |  468|      0|        hold = 0; \
  |  |  469|      0|        bits = 0; \
  |  |  470|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  698|      0|            state->mode = OS;
  699|       |                /* fallthrough */
  700|      0|        case OS:
  ------------------
  |  Branch (700:9): [True: 0, False: 79.1k]
  ------------------
  701|      0|            NEEDBITS(16);
  ------------------
  |  |  485|      0|    do { \
  |  |  486|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  487|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|      0|    do { \
  |  |  |  |  476|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  477|      0|        have--; \
  |  |  |  |  478|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|      0|        bits += 8; \
  |  |  |  |  480|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  702|      0|            if (state->head != Z_NULL) {
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (702:17): [True: 0, False: 0]
  ------------------
  703|      0|                state->head->xflags = (int)(hold & 0xff);
  704|      0|                state->head->os = (int)(hold >> 8);
  705|      0|            }
  706|      0|            if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (706:17): [True: 0, False: 0]
  |  Branch (706:44): [True: 0, False: 0]
  ------------------
  707|      0|                CRC2(state->check, hold);
  ------------------
  |  |  427|      0|    do { \
  |  |  428|      0|        hbuf[0] = (unsigned char)(word); \
  |  |  429|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  430|      0|        check = crc32(check, hbuf, 2); \
  |  |  431|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (431:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  708|      0|            INITBITS();
  ------------------
  |  |  467|      0|    do { \
  |  |  468|      0|        hold = 0; \
  |  |  469|      0|        bits = 0; \
  |  |  470|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  709|      0|            state->mode = EXLEN;
  710|       |                /* fallthrough */
  711|      0|        case EXLEN:
  ------------------
  |  Branch (711:9): [True: 0, False: 79.1k]
  ------------------
  712|      0|            if (state->flags & 0x0400) {
  ------------------
  |  Branch (712:17): [True: 0, False: 0]
  ------------------
  713|      0|                NEEDBITS(16);
  ------------------
  |  |  485|      0|    do { \
  |  |  486|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  487|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|      0|    do { \
  |  |  |  |  476|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  477|      0|        have--; \
  |  |  |  |  478|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|      0|        bits += 8; \
  |  |  |  |  480|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  714|      0|                state->length = (unsigned)(hold);
  715|      0|                if (state->head != Z_NULL)
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (715:21): [True: 0, False: 0]
  ------------------
  716|      0|                    state->head->extra_len = (unsigned)hold;
  717|      0|                if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (717:21): [True: 0, False: 0]
  |  Branch (717:48): [True: 0, False: 0]
  ------------------
  718|      0|                    CRC2(state->check, hold);
  ------------------
  |  |  427|      0|    do { \
  |  |  428|      0|        hbuf[0] = (unsigned char)(word); \
  |  |  429|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  430|      0|        check = crc32(check, hbuf, 2); \
  |  |  431|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (431:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  719|      0|                INITBITS();
  ------------------
  |  |  467|      0|    do { \
  |  |  468|      0|        hold = 0; \
  |  |  469|      0|        bits = 0; \
  |  |  470|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  720|      0|            }
  721|      0|            else if (state->head != Z_NULL)
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (721:22): [True: 0, False: 0]
  ------------------
  722|      0|                state->head->extra = Z_NULL;
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  723|      0|            state->mode = EXTRA;
  724|       |                /* fallthrough */
  725|      0|        case EXTRA:
  ------------------
  |  Branch (725:9): [True: 0, False: 79.1k]
  ------------------
  726|      0|            if (state->flags & 0x0400) {
  ------------------
  |  Branch (726:17): [True: 0, False: 0]
  ------------------
  727|      0|                copy = state->length;
  728|      0|                if (copy > have) copy = have;
  ------------------
  |  Branch (728:21): [True: 0, False: 0]
  ------------------
  729|      0|                if (copy) {
  ------------------
  |  Branch (729:21): [True: 0, False: 0]
  ------------------
  730|      0|                    if (state->head != Z_NULL &&
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (730:25): [True: 0, False: 0]
  ------------------
  731|      0|                        state->head->extra != Z_NULL &&
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (731:25): [True: 0, False: 0]
  ------------------
  732|      0|                        (len = state->head->extra_len - state->length) <
  ------------------
  |  Branch (732:25): [True: 0, False: 0]
  ------------------
  733|      0|                            state->head->extra_max) {
  734|      0|                        zmemcpy(state->head->extra + len, next,
  ------------------
  |  |  209|      0|#    define zmemcpy memcpy
  ------------------
  735|      0|                                len + copy > state->head->extra_max ?
  ------------------
  |  Branch (735:33): [True: 0, False: 0]
  ------------------
  736|      0|                                state->head->extra_max - len : copy);
  737|      0|                    }
  738|      0|                    if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (738:25): [True: 0, False: 0]
  |  Branch (738:52): [True: 0, False: 0]
  ------------------
  739|      0|                        state->check = crc32(state->check, next, copy);
  740|      0|                    have -= copy;
  741|      0|                    next += copy;
  742|      0|                    state->length -= copy;
  743|      0|                }
  744|      0|                if (state->length) goto inf_leave;
  ------------------
  |  Branch (744:21): [True: 0, False: 0]
  ------------------
  745|      0|            }
  746|      0|            state->length = 0;
  747|      0|            state->mode = NAME;
  748|       |                /* fallthrough */
  749|      0|        case NAME:
  ------------------
  |  Branch (749:9): [True: 0, False: 79.1k]
  ------------------
  750|      0|            if (state->flags & 0x0800) {
  ------------------
  |  Branch (750:17): [True: 0, False: 0]
  ------------------
  751|      0|                if (have == 0) goto inf_leave;
  ------------------
  |  Branch (751:21): [True: 0, False: 0]
  ------------------
  752|      0|                copy = 0;
  753|      0|                do {
  754|      0|                    len = (unsigned)(next[copy++]);
  755|      0|                    if (state->head != Z_NULL &&
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (755:25): [True: 0, False: 0]
  ------------------
  756|      0|                            state->head->name != Z_NULL &&
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (756:29): [True: 0, False: 0]
  ------------------
  757|      0|                            state->length < state->head->name_max)
  ------------------
  |  Branch (757:29): [True: 0, False: 0]
  ------------------
  758|      0|                        state->head->name[state->length++] = (Bytef)len;
  759|      0|                } while (len && copy < have);
  ------------------
  |  Branch (759:26): [True: 0, False: 0]
  |  Branch (759:33): [True: 0, False: 0]
  ------------------
  760|      0|                if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (760:21): [True: 0, False: 0]
  |  Branch (760:48): [True: 0, False: 0]
  ------------------
  761|      0|                    state->check = crc32(state->check, next, copy);
  762|      0|                have -= copy;
  763|      0|                next += copy;
  764|      0|                if (len) goto inf_leave;
  ------------------
  |  Branch (764:21): [True: 0, False: 0]
  ------------------
  765|      0|            }
  766|      0|            else if (state->head != Z_NULL)
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (766:22): [True: 0, False: 0]
  ------------------
  767|      0|                state->head->name = Z_NULL;
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  768|      0|            state->length = 0;
  769|      0|            state->mode = COMMENT;
  770|       |                /* fallthrough */
  771|      0|        case COMMENT:
  ------------------
  |  Branch (771:9): [True: 0, False: 79.1k]
  ------------------
  772|      0|            if (state->flags & 0x1000) {
  ------------------
  |  Branch (772:17): [True: 0, False: 0]
  ------------------
  773|      0|                if (have == 0) goto inf_leave;
  ------------------
  |  Branch (773:21): [True: 0, False: 0]
  ------------------
  774|      0|                copy = 0;
  775|      0|                do {
  776|      0|                    len = (unsigned)(next[copy++]);
  777|      0|                    if (state->head != Z_NULL &&
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (777:25): [True: 0, False: 0]
  ------------------
  778|      0|                            state->head->comment != Z_NULL &&
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (778:29): [True: 0, False: 0]
  ------------------
  779|      0|                            state->length < state->head->comm_max)
  ------------------
  |  Branch (779:29): [True: 0, False: 0]
  ------------------
  780|      0|                        state->head->comment[state->length++] = (Bytef)len;
  781|      0|                } while (len && copy < have);
  ------------------
  |  Branch (781:26): [True: 0, False: 0]
  |  Branch (781:33): [True: 0, False: 0]
  ------------------
  782|      0|                if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (782:21): [True: 0, False: 0]
  |  Branch (782:48): [True: 0, False: 0]
  ------------------
  783|      0|                    state->check = crc32(state->check, next, copy);
  784|      0|                have -= copy;
  785|      0|                next += copy;
  786|      0|                if (len) goto inf_leave;
  ------------------
  |  Branch (786:21): [True: 0, False: 0]
  ------------------
  787|      0|            }
  788|      0|            else if (state->head != Z_NULL)
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (788:22): [True: 0, False: 0]
  ------------------
  789|      0|                state->head->comment = Z_NULL;
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  790|      0|            state->mode = HCRC;
  791|       |                /* fallthrough */
  792|      0|        case HCRC:
  ------------------
  |  Branch (792:9): [True: 0, False: 79.1k]
  ------------------
  793|      0|            if (state->flags & 0x0200) {
  ------------------
  |  Branch (793:17): [True: 0, False: 0]
  ------------------
  794|      0|                NEEDBITS(16);
  ------------------
  |  |  485|      0|    do { \
  |  |  486|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  487|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|      0|    do { \
  |  |  |  |  476|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  477|      0|        have--; \
  |  |  |  |  478|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|      0|        bits += 8; \
  |  |  |  |  480|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  795|      0|                if ((state->wrap & 4) && hold != (state->check & 0xffff)) {
  ------------------
  |  Branch (795:21): [True: 0, False: 0]
  |  Branch (795:42): [True: 0, False: 0]
  ------------------
  796|      0|                    strm->msg = (char *)"header crc mismatch";
  797|      0|                    state->mode = BAD;
  798|      0|                    break;
  799|      0|                }
  800|      0|                INITBITS();
  ------------------
  |  |  467|      0|    do { \
  |  |  468|      0|        hold = 0; \
  |  |  469|      0|        bits = 0; \
  |  |  470|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  801|      0|            }
  802|      0|            if (state->head != Z_NULL) {
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (802:17): [True: 0, False: 0]
  ------------------
  803|      0|                state->head->hcrc = (int)((state->flags >> 9) & 1);
  804|      0|                state->head->done = 1;
  805|      0|            }
  806|      0|            strm->adler = state->check = crc32(0L, Z_NULL, 0);
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  807|      0|            state->mode = TYPE;
  808|      0|            break;
  809|      0|#endif
  810|     18|        case DICTID:
  ------------------
  |  Branch (810:9): [True: 18, False: 79.0k]
  ------------------
  811|     18|            NEEDBITS(32);
  ------------------
  |  |  485|     18|    do { \
  |  |  486|     34|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 30, False: 4]
  |  |  ------------------
  |  |  487|     30|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|     30|    do { \
  |  |  |  |  476|     30|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 14, False: 16]
  |  |  |  |  ------------------
  |  |  |  |  477|     30|        have--; \
  |  |  |  |  478|     16|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|     16|        bits += 8; \
  |  |  |  |  480|     16|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|     18|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded, False: 4]
  |  |  ------------------
  ------------------
  812|      4|            strm->adler = state->check = ZSWAP32(hold);
  ------------------
  |  |  251|      4|#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
  |  |  252|      4|                    (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
  ------------------
  813|      4|            INITBITS();
  ------------------
  |  |  467|      4|    do { \
  |  |  468|      4|        hold = 0; \
  |  |  469|      4|        bits = 0; \
  |  |  470|      4|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded, False: 4]
  |  |  ------------------
  ------------------
  814|      4|            state->mode = DICT;
  815|       |                /* fallthrough */
  816|      4|        case DICT:
  ------------------
  |  Branch (816:9): [True: 0, False: 79.1k]
  ------------------
  817|      4|            if (state->havedict == 0) {
  ------------------
  |  Branch (817:17): [True: 4, False: 0]
  ------------------
  818|      4|                RESTORE();
  ------------------
  |  |  456|      4|    do { \
  |  |  457|      4|        strm->next_out = put; \
  |  |  458|      4|        strm->avail_out = left; \
  |  |  459|      4|        strm->next_in = next; \
  |  |  460|      4|        strm->avail_in = have; \
  |  |  461|      4|        state->hold = hold; \
  |  |  462|      4|        state->bits = bits; \
  |  |  463|      4|    } while (0)
  |  |  ------------------
  |  |  |  Branch (463:14): [Folded, False: 4]
  |  |  ------------------
  ------------------
  819|      4|                return Z_NEED_DICT;
  ------------------
  |  |  179|      4|#define Z_NEED_DICT     2
  ------------------
  820|      4|            }
  821|      0|            strm->adler = state->check = adler32(0L, Z_NULL, 0);
  ------------------
  |  |  212|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  822|      0|            state->mode = TYPE;
  823|       |                /* fallthrough */
  824|  4.00k|        case TYPE:
  ------------------
  |  Branch (824:9): [True: 4.00k, False: 75.1k]
  ------------------
  825|  4.00k|            if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
  ------------------
  |  |  173|  8.01k|#define Z_BLOCK         5
  ------------------
                          if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
  ------------------
  |  |  174|      0|#define Z_TREES         6
  ------------------
  |  Branch (825:17): [True: 4.00k, False: 0]
  |  Branch (825:37): [True: 0, False: 0]
  ------------------
  826|       |                /* fallthrough */
  827|  4.53k|        case TYPEDO:
  ------------------
  |  Branch (827:9): [True: 4.53k, False: 74.5k]
  ------------------
  828|  4.53k|            if (state->last) {
  ------------------
  |  Branch (828:17): [True: 57, False: 4.47k]
  ------------------
  829|     57|                BYTEBITS();
  ------------------
  |  |  503|     57|    do { \
  |  |  504|     57|        hold >>= bits & 7; \
  |  |  505|     57|        bits -= bits & 7; \
  |  |  506|     57|    } while (0)
  |  |  ------------------
  |  |  |  Branch (506:14): [Folded, False: 57]
  |  |  ------------------
  ------------------
  830|     57|                state->mode = CHECK;
  831|     57|                break;
  832|     57|            }
  833|  4.47k|            NEEDBITS(3);
  ------------------
  |  |  485|  4.47k|    do { \
  |  |  486|  6.26k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 1.80k, False: 4.45k]
  |  |  ------------------
  |  |  487|  4.47k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|  1.80k|    do { \
  |  |  |  |  476|  1.80k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 18, False: 1.78k]
  |  |  |  |  ------------------
  |  |  |  |  477|  1.80k|        have--; \
  |  |  |  |  478|  1.78k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|  1.78k|        bits += 8; \
  |  |  |  |  480|  1.78k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded, False: 1.78k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|  4.47k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded, False: 4.45k]
  |  |  ------------------
  ------------------
  834|  4.45k|            state->last = BITS(1);
  ------------------
  |  |  492|  4.45k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  835|  4.45k|            DROPBITS(1);
  ------------------
  |  |  496|  4.45k|    do { \
  |  |  497|  4.45k|        hold >>= (n); \
  |  |  498|  4.45k|        bits -= (unsigned)(n); \
  |  |  499|  4.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 4.45k]
  |  |  ------------------
  ------------------
  836|  4.45k|            switch (BITS(2)) {
  ------------------
  |  |  492|  4.45k|    ((unsigned)hold & ((1U << (n)) - 1))
  |  |  ------------------
  |  |  |  Branch (492:5): [True: 4.45k, False: 0]
  |  |  ------------------
  ------------------
  837|    157|            case 0:                             /* stored block */
  ------------------
  |  Branch (837:13): [True: 157, False: 4.30k]
  ------------------
  838|    157|                Tracev((stderr, "inflate:     stored block%s\n",
  839|    157|                        state->last ? " (last)" : ""));
  840|    157|                state->mode = STORED;
  841|    157|                break;
  842|  4.15k|            case 1:                             /* fixed block */
  ------------------
  |  Branch (842:13): [True: 4.15k, False: 300]
  ------------------
  843|  4.15k|                fixedtables(state);
  844|  4.15k|                Tracev((stderr, "inflate:     fixed codes block%s\n",
  845|  4.15k|                        state->last ? " (last)" : ""));
  846|  4.15k|                state->mode = LEN_;             /* decode codes */
  847|  4.15k|                if (flush == Z_TREES) {
  ------------------
  |  |  174|  4.15k|#define Z_TREES         6
  ------------------
  |  Branch (847:21): [True: 0, False: 4.15k]
  ------------------
  848|      0|                    DROPBITS(2);
  ------------------
  |  |  496|      0|    do { \
  |  |  497|      0|        hold >>= (n); \
  |  |  498|      0|        bits -= (unsigned)(n); \
  |  |  499|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  849|      0|                    goto inf_leave;
  850|      0|                }
  851|  4.15k|                break;
  852|  4.15k|            case 2:                             /* dynamic block */
  ------------------
  |  Branch (852:13): [True: 129, False: 4.32k]
  ------------------
  853|    129|                Tracev((stderr, "inflate:     dynamic codes block%s\n",
  854|    129|                        state->last ? " (last)" : ""));
  855|    129|                state->mode = TABLE;
  856|    129|                break;
  857|     14|            case 3:
  ------------------
  |  Branch (857:13): [True: 14, False: 4.44k]
  ------------------
  858|     14|                strm->msg = (char *)"invalid block type";
  859|     14|                state->mode = BAD;
  860|  4.45k|            }
  861|  4.45k|            DROPBITS(2);
  ------------------
  |  |  496|  4.45k|    do { \
  |  |  497|  4.45k|        hold >>= (n); \
  |  |  498|  4.45k|        bits -= (unsigned)(n); \
  |  |  499|  4.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 4.45k]
  |  |  ------------------
  ------------------
  862|  4.45k|            break;
  863|    197|        case STORED:
  ------------------
  |  Branch (863:9): [True: 197, False: 78.9k]
  ------------------
  864|    197|            BYTEBITS();                         /* go to byte boundary */
  ------------------
  |  |  503|    197|    do { \
  |  |  504|    197|        hold >>= bits & 7; \
  |  |  505|    197|        bits -= bits & 7; \
  |  |  506|    197|    } while (0)
  |  |  ------------------
  |  |  |  Branch (506:14): [Folded, False: 197]
  |  |  ------------------
  ------------------
  865|    197|            NEEDBITS(32);
  ------------------
  |  |  485|    197|    do { \
  |  |  486|    756|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 630, False: 126]
  |  |  ------------------
  |  |  487|    630|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|    630|    do { \
  |  |  |  |  476|    630|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 71, False: 559]
  |  |  |  |  ------------------
  |  |  |  |  477|    630|        have--; \
  |  |  |  |  478|    559|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|    559|        bits += 8; \
  |  |  |  |  480|    559|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded, False: 559]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|    197|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded, False: 126]
  |  |  ------------------
  ------------------
  866|    126|            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
  ------------------
  |  Branch (866:17): [True: 89, False: 37]
  ------------------
  867|     89|                strm->msg = (char *)"invalid stored block lengths";
  868|     89|                state->mode = BAD;
  869|     89|                break;
  870|     89|            }
  871|     37|            state->length = (unsigned)hold & 0xffff;
  872|     37|            Tracev((stderr, "inflate:       stored length %u\n",
  873|     37|                    state->length));
  874|     37|            INITBITS();
  ------------------
  |  |  467|     37|    do { \
  |  |  468|     37|        hold = 0; \
  |  |  469|     37|        bits = 0; \
  |  |  470|     37|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded, False: 37]
  |  |  ------------------
  ------------------
  875|     37|            state->mode = COPY_;
  876|     37|            if (flush == Z_TREES) goto inf_leave;
  ------------------
  |  |  174|     37|#define Z_TREES         6
  ------------------
  |  Branch (876:17): [True: 0, False: 37]
  ------------------
  877|       |                /* fallthrough */
  878|     37|        case COPY_:
  ------------------
  |  Branch (878:9): [True: 0, False: 79.1k]
  ------------------
  879|     37|            state->mode = COPY;
  880|       |                /* fallthrough */
  881|     73|        case COPY:
  ------------------
  |  Branch (881:9): [True: 36, False: 79.0k]
  ------------------
  882|     73|            copy = state->length;
  883|     73|            if (copy) {
  ------------------
  |  Branch (883:17): [True: 48, False: 25]
  ------------------
  884|     48|                if (copy > have) copy = have;
  ------------------
  |  Branch (884:21): [True: 42, False: 6]
  ------------------
  885|     48|                if (copy > left) copy = left;
  ------------------
  |  Branch (885:21): [True: 0, False: 48]
  ------------------
  886|     48|                if (copy == 0) goto inf_leave;
  ------------------
  |  Branch (886:21): [True: 27, False: 21]
  ------------------
  887|     21|                zmemcpy(put, next, copy);
  ------------------
  |  |  209|     21|#    define zmemcpy memcpy
  ------------------
  888|     21|                have -= copy;
  889|     21|                next += copy;
  890|     21|                left -= copy;
  891|     21|                put += copy;
  892|     21|                state->length -= copy;
  893|     21|                break;
  894|     48|            }
  895|     25|            Tracev((stderr, "inflate:       stored end\n"));
  896|     25|            state->mode = TYPE;
  897|     25|            break;
  898|    175|        case TABLE:
  ------------------
  |  Branch (898:9): [True: 175, False: 78.9k]
  ------------------
  899|    175|            NEEDBITS(14);
  ------------------
  |  |  485|    175|    do { \
  |  |  486|    399|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 276, False: 123]
  |  |  ------------------
  |  |  487|    276|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|    276|    do { \
  |  |  |  |  476|    276|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 52, False: 224]
  |  |  |  |  ------------------
  |  |  |  |  477|    276|        have--; \
  |  |  |  |  478|    224|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|    224|        bits += 8; \
  |  |  |  |  480|    224|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded, False: 224]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|    175|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded, False: 123]
  |  |  ------------------
  ------------------
  900|    123|            state->nlen = BITS(5) + 257;
  ------------------
  |  |  492|    123|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  901|    123|            DROPBITS(5);
  ------------------
  |  |  496|    123|    do { \
  |  |  497|    123|        hold >>= (n); \
  |  |  498|    123|        bits -= (unsigned)(n); \
  |  |  499|    123|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 123]
  |  |  ------------------
  ------------------
  902|    123|            state->ndist = BITS(5) + 1;
  ------------------
  |  |  492|    123|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  903|    123|            DROPBITS(5);
  ------------------
  |  |  496|    123|    do { \
  |  |  497|    123|        hold >>= (n); \
  |  |  498|    123|        bits -= (unsigned)(n); \
  |  |  499|    123|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 123]
  |  |  ------------------
  ------------------
  904|    123|            state->ncode = BITS(4) + 4;
  ------------------
  |  |  492|    123|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  905|    123|            DROPBITS(4);
  ------------------
  |  |  496|    123|    do { \
  |  |  497|    123|        hold >>= (n); \
  |  |  498|    123|        bits -= (unsigned)(n); \
  |  |  499|    123|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 123]
  |  |  ------------------
  ------------------
  906|    123|#ifndef PKZIP_BUG_WORKAROUND
  907|    123|            if (state->nlen > 286 || state->ndist > 30) {
  ------------------
  |  Branch (907:17): [True: 2, False: 121]
  |  Branch (907:38): [True: 1, False: 120]
  ------------------
  908|      3|                strm->msg = (char *)"too many length or distance symbols";
  909|      3|                state->mode = BAD;
  910|      3|                break;
  911|      3|            }
  912|    120|#endif
  913|    120|            Tracev((stderr, "inflate:       table sizes ok\n"));
  914|    120|            state->have = 0;
  915|    120|            state->mode = LENLENS;
  916|       |                /* fallthrough */
  917|    171|        case LENLENS:
  ------------------
  |  Branch (917:9): [True: 51, False: 79.0k]
  ------------------
  918|  1.41k|            while (state->have < state->ncode) {
  ------------------
  |  Branch (918:20): [True: 1.29k, False: 115]
  ------------------
  919|  1.29k|                NEEDBITS(3);
  ------------------
  |  |  485|  1.29k|    do { \
  |  |  486|  1.73k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 496, False: 1.23k]
  |  |  ------------------
  |  |  487|  1.29k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|    496|    do { \
  |  |  |  |  476|    496|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 56, False: 440]
  |  |  |  |  ------------------
  |  |  |  |  477|    496|        have--; \
  |  |  |  |  478|    440|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|    440|        bits += 8; \
  |  |  |  |  480|    440|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded, False: 440]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|  1.29k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded, False: 1.23k]
  |  |  ------------------
  ------------------
  920|  1.23k|                state->lens[order[state->have++]] = (unsigned short)BITS(3);
  ------------------
  |  |  492|  1.23k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  921|  1.23k|                DROPBITS(3);
  ------------------
  |  |  496|  1.23k|    do { \
  |  |  497|  1.23k|        hold >>= (n); \
  |  |  498|  1.23k|        bits -= (unsigned)(n); \
  |  |  499|  1.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 1.23k]
  |  |  ------------------
  ------------------
  922|  1.23k|            }
  923|  1.08k|            while (state->have < 19)
  ------------------
  |  Branch (923:20): [True: 970, False: 115]
  ------------------
  924|    970|                state->lens[order[state->have++]] = 0;
  925|    115|            state->next = state->codes;
  926|    115|            state->lencode = (const code FAR *)(state->next);
  927|    115|            state->lenbits = 7;
  928|    115|            ret = inflate_table(CODES, state->lens, 19, &(state->next),
  929|    115|                                &(state->lenbits), state->work);
  930|    115|            if (ret) {
  ------------------
  |  Branch (930:17): [True: 27, False: 88]
  ------------------
  931|     27|                strm->msg = (char *)"invalid code lengths set";
  932|     27|                state->mode = BAD;
  933|     27|                break;
  934|     27|            }
  935|     88|            Tracev((stderr, "inflate:       code lengths ok\n"));
  936|     88|            state->have = 0;
  937|     88|            state->mode = CODELENS;
  938|       |                /* fallthrough */
  939|    776|        case CODELENS:
  ------------------
  |  Branch (939:9): [True: 688, False: 78.4k]
  ------------------
  940|  12.1k|            while (state->have < state->nlen + state->ndist) {
  ------------------
  |  Branch (940:20): [True: 12.0k, False: 43]
  ------------------
  941|  14.3k|                for (;;) {
  942|  14.3k|                    here = state->lencode[BITS(state->lenbits)];
  ------------------
  |  |  492|  14.3k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  943|  14.3k|                    if ((unsigned)(here.bits) <= bits) break;
  ------------------
  |  Branch (943:25): [True: 11.6k, False: 2.75k]
  ------------------
  944|  2.75k|                    PULLBYTE();
  ------------------
  |  |  475|  2.75k|    do { \
  |  |  476|  2.75k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (476:13): [True: 448, False: 2.30k]
  |  |  ------------------
  |  |  477|  2.75k|        have--; \
  |  |  478|  2.30k|        hold += (unsigned long)(*next++) << bits; \
  |  |  479|  2.30k|        bits += 8; \
  |  |  480|  2.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded, False: 2.30k]
  |  |  ------------------
  ------------------
  945|  2.75k|                }
  946|  11.6k|                if (here.val < 16) {
  ------------------
  |  Branch (946:21): [True: 9.55k, False: 2.08k]
  ------------------
  947|  9.55k|                    DROPBITS(here.bits);
  ------------------
  |  |  496|  9.55k|    do { \
  |  |  497|  9.55k|        hold >>= (n); \
  |  |  498|  9.55k|        bits -= (unsigned)(n); \
  |  |  499|  9.55k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 9.55k]
  |  |  ------------------
  ------------------
  948|  9.55k|                    state->lens[state->have++] = here.val;
  949|  9.55k|                }
  950|  2.08k|                else {
  951|  2.08k|                    if (here.val == 16) {
  ------------------
  |  Branch (951:25): [True: 1.30k, False: 782]
  ------------------
  952|  1.30k|                        NEEDBITS(here.bits + 2);
  ------------------
  |  |  485|  1.30k|    do { \
  |  |  486|  2.16k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 948, False: 1.21k]
  |  |  ------------------
  |  |  487|  1.30k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|    948|    do { \
  |  |  |  |  476|    948|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 94, False: 854]
  |  |  |  |  ------------------
  |  |  |  |  477|    948|        have--; \
  |  |  |  |  478|    854|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|    854|        bits += 8; \
  |  |  |  |  480|    854|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded, False: 854]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|  1.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded, False: 1.21k]
  |  |  ------------------
  ------------------
  953|  1.21k|                        DROPBITS(here.bits);
  ------------------
  |  |  496|  1.21k|    do { \
  |  |  497|  1.21k|        hold >>= (n); \
  |  |  498|  1.21k|        bits -= (unsigned)(n); \
  |  |  499|  1.21k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 1.21k]
  |  |  ------------------
  ------------------
  954|  1.21k|                        if (state->have == 0) {
  ------------------
  |  Branch (954:29): [True: 2, False: 1.21k]
  ------------------
  955|      2|                            strm->msg = (char *)"invalid bit length repeat";
  956|      2|                            state->mode = BAD;
  957|      2|                            break;
  958|      2|                        }
  959|  1.21k|                        len = state->lens[state->have - 1];
  960|  1.21k|                        copy = 3 + BITS(2);
  ------------------
  |  |  492|  1.21k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  961|  1.21k|                        DROPBITS(2);
  ------------------
  |  |  496|  1.21k|    do { \
  |  |  497|  1.21k|        hold >>= (n); \
  |  |  498|  1.21k|        bits -= (unsigned)(n); \
  |  |  499|  1.21k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 1.21k]
  |  |  ------------------
  ------------------
  962|  1.21k|                    }
  963|    782|                    else if (here.val == 17) {
  ------------------
  |  Branch (963:30): [True: 581, False: 201]
  ------------------
  964|    581|                        NEEDBITS(here.bits + 3);
  ------------------
  |  |  485|    581|    do { \
  |  |  486|    815|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 354, False: 461]
  |  |  ------------------
  |  |  487|    581|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|    354|    do { \
  |  |  |  |  476|    354|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 120, False: 234]
  |  |  |  |  ------------------
  |  |  |  |  477|    354|        have--; \
  |  |  |  |  478|    234|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|    234|        bits += 8; \
  |  |  |  |  480|    234|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded, False: 234]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|    581|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded, False: 461]
  |  |  ------------------
  ------------------
  965|    461|                        DROPBITS(here.bits);
  ------------------
  |  |  496|    461|    do { \
  |  |  497|    461|        hold >>= (n); \
  |  |  498|    461|        bits -= (unsigned)(n); \
  |  |  499|    461|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 461]
  |  |  ------------------
  ------------------
  966|    461|                        len = 0;
  967|    461|                        copy = 3 + BITS(3);
  ------------------
  |  |  492|    461|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  968|    461|                        DROPBITS(3);
  ------------------
  |  |  496|    461|    do { \
  |  |  497|    461|        hold >>= (n); \
  |  |  498|    461|        bits -= (unsigned)(n); \
  |  |  499|    461|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 461]
  |  |  ------------------
  ------------------
  969|    461|                    }
  970|    201|                    else {
  971|    201|                        NEEDBITS(here.bits + 7);
  ------------------
  |  |  485|    201|    do { \
  |  |  486|    323|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 158, False: 165]
  |  |  ------------------
  |  |  487|    201|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|    158|    do { \
  |  |  |  |  476|    158|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 36, False: 122]
  |  |  |  |  ------------------
  |  |  |  |  477|    158|        have--; \
  |  |  |  |  478|    122|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|    122|        bits += 8; \
  |  |  |  |  480|    122|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded, False: 122]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|    201|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded, False: 165]
  |  |  ------------------
  ------------------
  972|    165|                        DROPBITS(here.bits);
  ------------------
  |  |  496|    165|    do { \
  |  |  497|    165|        hold >>= (n); \
  |  |  498|    165|        bits -= (unsigned)(n); \
  |  |  499|    165|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 165]
  |  |  ------------------
  ------------------
  973|    165|                        len = 0;
  974|    165|                        copy = 11 + BITS(7);
  ------------------
  |  |  492|    165|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  975|    165|                        DROPBITS(7);
  ------------------
  |  |  496|    165|    do { \
  |  |  497|    165|        hold >>= (n); \
  |  |  498|    165|        bits -= (unsigned)(n); \
  |  |  499|    165|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 165]
  |  |  ------------------
  ------------------
  976|    165|                    }
  977|  1.83k|                    if (state->have + copy > state->nlen + state->ndist) {
  ------------------
  |  Branch (977:25): [True: 33, False: 1.80k]
  ------------------
  978|     33|                        strm->msg = (char *)"invalid bit length repeat";
  979|     33|                        state->mode = BAD;
  980|     33|                        break;
  981|     33|                    }
  982|  13.9k|                    while (copy--)
  ------------------
  |  Branch (982:28): [True: 12.1k, False: 1.80k]
  ------------------
  983|  12.1k|                        state->lens[state->have++] = (unsigned short)len;
  984|  1.80k|                }
  985|  11.6k|            }
  986|       |
  987|       |            /* handle error breaks in while */
  988|     78|            if (state->mode == BAD) break;
  ------------------
  |  Branch (988:17): [True: 35, False: 43]
  ------------------
  989|       |
  990|       |            /* check for end-of-block code (better have one) */
  991|     43|            if (state->lens[256] == 0) {
  ------------------
  |  Branch (991:17): [True: 15, False: 28]
  ------------------
  992|     15|                strm->msg = (char *)"invalid code -- missing end-of-block";
  993|     15|                state->mode = BAD;
  994|     15|                break;
  995|     15|            }
  996|       |
  997|       |            /* build code tables -- note: do not change the lenbits or distbits
  998|       |               values here (9 and 6) without reading the comments in inftrees.h
  999|       |               concerning the ENOUGH constants, which depend on those values */
 1000|     28|            state->next = state->codes;
 1001|     28|            state->lencode = (const code FAR *)(state->next);
 1002|     28|            state->lenbits = 9;
 1003|     28|            ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
 1004|     28|                                &(state->lenbits), state->work);
 1005|     28|            if (ret) {
  ------------------
  |  Branch (1005:17): [True: 14, False: 14]
  ------------------
 1006|     14|                strm->msg = (char *)"invalid literal/lengths set";
 1007|     14|                state->mode = BAD;
 1008|     14|                break;
 1009|     14|            }
 1010|     14|            state->distcode = (const code FAR *)(state->next);
 1011|     14|            state->distbits = 6;
 1012|     14|            ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
 1013|     14|                            &(state->next), &(state->distbits), state->work);
 1014|     14|            if (ret) {
  ------------------
  |  Branch (1014:17): [True: 12, False: 2]
  ------------------
 1015|     12|                strm->msg = (char *)"invalid distances set";
 1016|     12|                state->mode = BAD;
 1017|     12|                break;
 1018|     12|            }
 1019|      2|            Tracev((stderr, "inflate:       codes ok\n"));
 1020|      2|            state->mode = LEN_;
 1021|      2|            if (flush == Z_TREES) goto inf_leave;
  ------------------
  |  |  174|      2|#define Z_TREES         6
  ------------------
  |  Branch (1021:17): [True: 0, False: 2]
  ------------------
 1022|       |                /* fallthrough */
 1023|  4.15k|        case LEN_:
  ------------------
  |  Branch (1023:9): [True: 4.15k, False: 74.9k]
  ------------------
 1024|  4.15k|            state->mode = LEN;
 1025|       |                /* fallthrough */
 1026|  38.4k|        case LEN:
  ------------------
  |  Branch (1026:9): [True: 34.3k, False: 44.7k]
  ------------------
 1027|  38.4k|            if (have >= 6 && left >= 258) {
  ------------------
  |  Branch (1027:17): [True: 36.3k, False: 2.15k]
  |  Branch (1027:30): [True: 6.70k, False: 29.6k]
  ------------------
 1028|  6.70k|                RESTORE();
  ------------------
  |  |  456|  6.70k|    do { \
  |  |  457|  6.70k|        strm->next_out = put; \
  |  |  458|  6.70k|        strm->avail_out = left; \
  |  |  459|  6.70k|        strm->next_in = next; \
  |  |  460|  6.70k|        strm->avail_in = have; \
  |  |  461|  6.70k|        state->hold = hold; \
  |  |  462|  6.70k|        state->bits = bits; \
  |  |  463|  6.70k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (463:14): [Folded, False: 6.70k]
  |  |  ------------------
  ------------------
 1029|  6.70k|                inflate_fast(strm, out);
 1030|  6.70k|                LOAD();
  ------------------
  |  |  445|  6.70k|    do { \
  |  |  446|  6.70k|        put = strm->next_out; \
  |  |  447|  6.70k|        left = strm->avail_out; \
  |  |  448|  6.70k|        next = strm->next_in; \
  |  |  449|  6.70k|        have = strm->avail_in; \
  |  |  450|  6.70k|        hold = state->hold; \
  |  |  451|  6.70k|        bits = state->bits; \
  |  |  452|  6.70k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (452:14): [Folded, False: 6.70k]
  |  |  ------------------
  ------------------
 1031|  6.70k|                if (state->mode == TYPE)
  ------------------
  |  Branch (1031:21): [True: 3.78k, False: 2.92k]
  ------------------
 1032|  3.78k|                    state->back = -1;
 1033|  6.70k|                break;
 1034|  6.70k|            }
 1035|  31.7k|            state->back = 0;
 1036|  63.3k|            for (;;) {
 1037|  63.3k|                here = state->lencode[BITS(state->lenbits)];
  ------------------
  |  |  492|  63.3k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
 1038|  63.3k|                if ((unsigned)(here.bits) <= bits) break;
  ------------------
  |  Branch (1038:21): [True: 31.3k, False: 32.0k]
  ------------------
 1039|  32.0k|                PULLBYTE();
  ------------------
  |  |  475|  32.0k|    do { \
  |  |  476|  32.0k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (476:13): [True: 489, False: 31.5k]
  |  |  ------------------
  |  |  477|  32.0k|        have--; \
  |  |  478|  31.5k|        hold += (unsigned long)(*next++) << bits; \
  |  |  479|  31.5k|        bits += 8; \
  |  |  480|  31.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded, False: 31.5k]
  |  |  ------------------
  ------------------
 1040|  32.0k|            }
 1041|  31.3k|            if (here.op && (here.op & 0xf0) == 0) {
  ------------------
  |  Branch (1041:17): [True: 6.73k, False: 24.5k]
  |  Branch (1041:28): [True: 0, False: 6.73k]
  ------------------
 1042|      0|                last = here;
 1043|      0|                for (;;) {
 1044|      0|                    here = state->lencode[last.val +
 1045|      0|                            (BITS(last.bits + last.op) >> last.bits)];
  ------------------
  |  |  492|      0|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
 1046|      0|                    if ((unsigned)(last.bits + here.bits) <= bits) break;
  ------------------
  |  Branch (1046:25): [True: 0, False: 0]
  ------------------
 1047|      0|                    PULLBYTE();
  ------------------
  |  |  475|      0|    do { \
  |  |  476|      0|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (476:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  477|      0|        have--; \
  |  |  478|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  479|      0|        bits += 8; \
  |  |  480|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1048|      0|                }
 1049|      0|                DROPBITS(last.bits);
  ------------------
  |  |  496|      0|    do { \
  |  |  497|      0|        hold >>= (n); \
  |  |  498|      0|        bits -= (unsigned)(n); \
  |  |  499|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1050|      0|                state->back += last.bits;
 1051|      0|            }
 1052|  31.3k|            DROPBITS(here.bits);
  ------------------
  |  |  496|  31.3k|    do { \
  |  |  497|  31.3k|        hold >>= (n); \
  |  |  498|  31.3k|        bits -= (unsigned)(n); \
  |  |  499|  31.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 31.3k]
  |  |  ------------------
  ------------------
 1053|  31.3k|            state->back += here.bits;
 1054|  31.3k|            state->length = (unsigned)here.val;
 1055|  31.3k|            if ((int)(here.op) == 0) {
  ------------------
  |  Branch (1055:17): [True: 24.5k, False: 6.73k]
  ------------------
 1056|  24.5k|                Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
 1057|  24.5k|                        "inflate:         literal '%c'\n" :
 1058|  24.5k|                        "inflate:         literal 0x%02x\n", here.val));
 1059|  24.5k|                state->mode = LIT;
 1060|  24.5k|                break;
 1061|  24.5k|            }
 1062|  6.73k|            if (here.op & 32) {
  ------------------
  |  Branch (1062:17): [True: 100, False: 6.63k]
  ------------------
 1063|    100|                Tracevv((stderr, "inflate:         end of block\n"));
 1064|    100|                state->back = -1;
 1065|    100|                state->mode = TYPE;
 1066|    100|                break;
 1067|    100|            }
 1068|  6.63k|            if (here.op & 64) {
  ------------------
  |  Branch (1068:17): [True: 1, False: 6.63k]
  ------------------
 1069|      1|                strm->msg = (char *)"invalid literal/length code";
 1070|      1|                state->mode = BAD;
 1071|      1|                break;
 1072|      1|            }
 1073|  6.63k|            state->extra = (unsigned)(here.op) & 15;
 1074|  6.63k|            state->mode = LENEXT;
 1075|       |                /* fallthrough */
 1076|  6.68k|        case LENEXT:
  ------------------
  |  Branch (1076:9): [True: 55, False: 79.0k]
  ------------------
 1077|  6.68k|            if (state->extra) {
  ------------------
  |  Branch (1077:17): [True: 4.79k, False: 1.89k]
  ------------------
 1078|  4.79k|                NEEDBITS(state->extra);
  ------------------
  |  |  485|  4.79k|    do { \
  |  |  486|  8.19k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 3.47k, False: 4.72k]
  |  |  ------------------
  |  |  487|  4.79k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|  3.47k|    do { \
  |  |  |  |  476|  3.47k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 66, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  477|  3.47k|        have--; \
  |  |  |  |  478|  3.40k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|  3.40k|        bits += 8; \
  |  |  |  |  480|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|  4.79k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded, False: 4.72k]
  |  |  ------------------
  ------------------
 1079|  4.72k|                state->length += BITS(state->extra);
  ------------------
  |  |  492|  4.72k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
 1080|  4.72k|                DROPBITS(state->extra);
  ------------------
  |  |  496|  4.72k|    do { \
  |  |  497|  4.72k|        hold >>= (n); \
  |  |  498|  4.72k|        bits -= (unsigned)(n); \
  |  |  499|  4.72k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 4.72k]
  |  |  ------------------
  ------------------
 1081|  4.72k|                state->back += state->extra;
 1082|  4.72k|            }
 1083|  6.61k|            Tracevv((stderr, "inflate:         length %u\n", state->length));
 1084|  6.61k|            state->was = state->length;
 1085|  6.61k|            state->mode = DIST;
 1086|       |                /* fallthrough */
 1087|  6.67k|        case DIST:
  ------------------
  |  Branch (1087:9): [True: 58, False: 79.0k]
  ------------------
 1088|  10.1k|            for (;;) {
 1089|  10.1k|                here = state->distcode[BITS(state->distbits)];
  ------------------
  |  |  492|  10.1k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
 1090|  10.1k|                if ((unsigned)(here.bits) <= bits) break;
  ------------------
  |  Branch (1090:21): [True: 6.58k, False: 3.58k]
  ------------------
 1091|  3.58k|                PULLBYTE();
  ------------------
  |  |  475|  3.58k|    do { \
  |  |  476|  3.58k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (476:13): [True: 88, False: 3.50k]
  |  |  ------------------
  |  |  477|  3.58k|        have--; \
  |  |  478|  3.50k|        hold += (unsigned long)(*next++) << bits; \
  |  |  479|  3.50k|        bits += 8; \
  |  |  480|  3.50k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded, False: 3.50k]
  |  |  ------------------
  ------------------
 1092|  3.58k|            }
 1093|  6.58k|            if ((here.op & 0xf0) == 0) {
  ------------------
  |  Branch (1093:17): [True: 0, False: 6.58k]
  ------------------
 1094|      0|                last = here;
 1095|      0|                for (;;) {
 1096|      0|                    here = state->distcode[last.val +
 1097|      0|                            (BITS(last.bits + last.op) >> last.bits)];
  ------------------
  |  |  492|      0|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
 1098|      0|                    if ((unsigned)(last.bits + here.bits) <= bits) break;
  ------------------
  |  Branch (1098:25): [True: 0, False: 0]
  ------------------
 1099|      0|                    PULLBYTE();
  ------------------
  |  |  475|      0|    do { \
  |  |  476|      0|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (476:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  477|      0|        have--; \
  |  |  478|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  479|      0|        bits += 8; \
  |  |  480|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1100|      0|                }
 1101|      0|                DROPBITS(last.bits);
  ------------------
  |  |  496|      0|    do { \
  |  |  497|      0|        hold >>= (n); \
  |  |  498|      0|        bits -= (unsigned)(n); \
  |  |  499|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1102|      0|                state->back += last.bits;
 1103|      0|            }
 1104|  6.58k|            DROPBITS(here.bits);
  ------------------
  |  |  496|  6.58k|    do { \
  |  |  497|  6.58k|        hold >>= (n); \
  |  |  498|  6.58k|        bits -= (unsigned)(n); \
  |  |  499|  6.58k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 6.58k]
  |  |  ------------------
  ------------------
 1105|  6.58k|            state->back += here.bits;
 1106|  6.58k|            if (here.op & 64) {
  ------------------
  |  Branch (1106:17): [True: 2, False: 6.58k]
  ------------------
 1107|      2|                strm->msg = (char *)"invalid distance code";
 1108|      2|                state->mode = BAD;
 1109|      2|                break;
 1110|      2|            }
 1111|  6.58k|            state->offset = (unsigned)here.val;
 1112|  6.58k|            state->extra = (unsigned)(here.op) & 15;
 1113|  6.58k|            state->mode = DISTEXT;
 1114|       |                /* fallthrough */
 1115|  6.64k|        case DISTEXT:
  ------------------
  |  Branch (1115:9): [True: 58, False: 79.0k]
  ------------------
 1116|  6.64k|            if (state->extra) {
  ------------------
  |  Branch (1116:17): [True: 6.26k, False: 385]
  ------------------
 1117|  6.26k|                NEEDBITS(state->extra);
  ------------------
  |  |  485|  6.26k|    do { \
  |  |  486|  9.20k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 3.01k, False: 6.19k]
  |  |  ------------------
  |  |  487|  6.26k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|  3.01k|    do { \
  |  |  |  |  476|  3.01k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 70, False: 2.94k]
  |  |  |  |  ------------------
  |  |  |  |  477|  3.01k|        have--; \
  |  |  |  |  478|  2.94k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|  2.94k|        bits += 8; \
  |  |  |  |  480|  2.94k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|  6.26k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded, False: 6.19k]
  |  |  ------------------
  ------------------
 1118|  6.19k|                state->offset += BITS(state->extra);
  ------------------
  |  |  492|  6.19k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
 1119|  6.19k|                DROPBITS(state->extra);
  ------------------
  |  |  496|  6.19k|    do { \
  |  |  497|  6.19k|        hold >>= (n); \
  |  |  498|  6.19k|        bits -= (unsigned)(n); \
  |  |  499|  6.19k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded, False: 6.19k]
  |  |  ------------------
  ------------------
 1120|  6.19k|                state->back += state->extra;
 1121|  6.19k|            }
 1122|       |#ifdef INFLATE_STRICT
 1123|       |            if (state->offset > state->dmax) {
 1124|       |                strm->msg = (char *)"invalid distance too far back";
 1125|       |                state->mode = BAD;
 1126|       |                break;
 1127|       |            }
 1128|       |#endif
 1129|  6.57k|            Tracevv((stderr, "inflate:         distance %u\n", state->offset));
 1130|  6.57k|            state->mode = MATCH;
 1131|       |                /* fallthrough */
 1132|  10.4k|        case MATCH:
  ------------------
  |  Branch (1132:9): [True: 3.88k, False: 75.2k]
  ------------------
 1133|  10.4k|            if (left == 0) goto inf_leave;
  ------------------
  |  Branch (1133:17): [True: 1.83k, False: 8.61k]
  ------------------
 1134|  8.61k|            copy = out - left;
 1135|  8.61k|            if (state->offset > copy) {         /* copy from window */
  ------------------
  |  Branch (1135:17): [True: 1.98k, False: 6.63k]
  ------------------
 1136|  1.98k|                copy = state->offset - copy;
 1137|  1.98k|                if (copy > state->whave) {
  ------------------
  |  Branch (1137:21): [True: 1, False: 1.98k]
  ------------------
 1138|      1|                    if (state->sane) {
  ------------------
  |  Branch (1138:25): [True: 1, False: 0]
  ------------------
 1139|      1|                        strm->msg = (char *)"invalid distance too far back";
 1140|      1|                        state->mode = BAD;
 1141|      1|                        break;
 1142|      1|                    }
 1143|       |#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
 1144|       |                    Trace((stderr, "inflate.c too far\n"));
 1145|       |                    copy -= state->whave;
 1146|       |                    if (copy > state->length) copy = state->length;
 1147|       |                    if (copy > left) copy = left;
 1148|       |                    left -= copy;
 1149|       |                    state->length -= copy;
 1150|       |                    do {
 1151|       |                        *put++ = 0;
 1152|       |                    } while (--copy);
 1153|       |                    if (state->length == 0) state->mode = LEN;
 1154|       |                    break;
 1155|       |#endif
 1156|      1|                }
 1157|  1.98k|                if (copy > state->wnext) {
  ------------------
  |  Branch (1157:21): [True: 634, False: 1.35k]
  ------------------
 1158|    634|                    copy -= state->wnext;
 1159|    634|                    from = state->window + (state->wsize - copy);
 1160|    634|                }
 1161|  1.35k|                else
 1162|  1.35k|                    from = state->window + (state->wnext - copy);
 1163|  1.98k|                if (copy > state->length) copy = state->length;
  ------------------
  |  Branch (1163:21): [True: 1.69k, False: 287]
  ------------------
 1164|  1.98k|            }
 1165|  6.63k|            else {                              /* copy from output */
 1166|  6.63k|                from = put - state->offset;
 1167|  6.63k|                copy = state->length;
 1168|  6.63k|            }
 1169|  8.61k|            if (copy > left) copy = left;
  ------------------
  |  Branch (1169:17): [True: 1.79k, False: 6.81k]
  ------------------
 1170|  8.61k|            left -= copy;
 1171|  8.61k|            state->length -= copy;
 1172|   489k|            do {
 1173|   489k|                *put++ = *from++;
 1174|   489k|            } while (--copy);
  ------------------
  |  Branch (1174:22): [True: 480k, False: 8.61k]
  ------------------
 1175|  8.61k|            if (state->length == 0) state->mode = LEN;
  ------------------
  |  Branch (1175:17): [True: 6.55k, False: 2.06k]
  ------------------
 1176|  8.61k|            break;
 1177|  24.6k|        case LIT:
  ------------------
  |  Branch (1177:9): [True: 24.6k, False: 54.4k]
  ------------------
 1178|  24.6k|            if (left == 0) goto inf_leave;
  ------------------
  |  Branch (1178:17): [True: 100, False: 24.5k]
  ------------------
 1179|  24.5k|            *put++ = (unsigned char)(state->length);
 1180|  24.5k|            left--;
 1181|  24.5k|            state->mode = LEN;
 1182|  24.5k|            break;
 1183|     67|        case CHECK:
  ------------------
  |  Branch (1183:9): [True: 67, False: 79.0k]
  ------------------
 1184|     67|            if (state->wrap) {
  ------------------
  |  Branch (1184:17): [True: 46, False: 21]
  ------------------
 1185|     46|                NEEDBITS(32);
  ------------------
  |  |  485|     46|    do { \
  |  |  486|    178|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 146, False: 32]
  |  |  ------------------
  |  |  487|    146|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|    146|    do { \
  |  |  |  |  476|    146|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 14, False: 132]
  |  |  |  |  ------------------
  |  |  |  |  477|    146|        have--; \
  |  |  |  |  478|    132|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|    132|        bits += 8; \
  |  |  |  |  480|    132|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded, False: 132]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|     46|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded, False: 32]
  |  |  ------------------
  ------------------
 1186|     32|                out -= left;
 1187|     32|                strm->total_out += out;
 1188|     32|                state->total += out;
 1189|     32|                if ((state->wrap & 4) && out)
  ------------------
  |  Branch (1189:21): [True: 32, False: 0]
  |  Branch (1189:42): [True: 0, False: 32]
  ------------------
 1190|      0|                    strm->adler = state->check =
 1191|      0|                        UPDATE_CHECK(state->check, put - out, out);
  ------------------
  |  |  419|      0|    (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
  |  |  ------------------
  |  |  |  Branch (419:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1192|     32|                out = left;
 1193|     32|                if ((state->wrap & 4) && (
  ------------------
  |  Branch (1193:21): [True: 32, False: 0]
  |  Branch (1193:42): [True: 32, False: 0]
  ------------------
 1194|     32|#ifdef GUNZIP
 1195|     32|                     state->flags ? hold :
  ------------------
  |  Branch (1195:22): [True: 0, False: 32]
  ------------------
 1196|     32|#endif
 1197|     32|                     ZSWAP32(hold)) != state->check) {
  ------------------
  |  |  251|     32|#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
  |  |  252|     32|                    (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
  ------------------
 1198|     32|                    strm->msg = (char *)"incorrect data check";
 1199|     32|                    state->mode = BAD;
 1200|     32|                    break;
 1201|     32|                }
 1202|      0|                INITBITS();
  ------------------
  |  |  467|      0|    do { \
  |  |  468|      0|        hold = 0; \
  |  |  469|      0|        bits = 0; \
  |  |  470|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1203|      0|                Tracev((stderr, "inflate:   check matches trailer\n"));
 1204|      0|            }
 1205|     21|#ifdef GUNZIP
 1206|     21|            state->mode = LENGTH;
 1207|       |                /* fallthrough */
 1208|     21|        case LENGTH:
  ------------------
  |  Branch (1208:9): [True: 0, False: 79.1k]
  ------------------
 1209|     21|            if (state->wrap && state->flags) {
  ------------------
  |  Branch (1209:17): [True: 0, False: 21]
  |  Branch (1209:32): [True: 0, False: 0]
  ------------------
 1210|      0|                NEEDBITS(32);
  ------------------
  |  |  485|      0|    do { \
  |  |  486|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  487|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|      0|    do { \
  |  |  |  |  476|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  477|      0|        have--; \
  |  |  |  |  478|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|      0|        bits += 8; \
  |  |  |  |  480|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1211|      0|                if ((state->wrap & 4) && hold != (state->total & 0xffffffff)) {
  ------------------
  |  Branch (1211:21): [True: 0, False: 0]
  |  Branch (1211:42): [True: 0, False: 0]
  ------------------
 1212|      0|                    strm->msg = (char *)"incorrect length check";
 1213|      0|                    state->mode = BAD;
 1214|      0|                    break;
 1215|      0|                }
 1216|      0|                INITBITS();
  ------------------
  |  |  467|      0|    do { \
  |  |  468|      0|        hold = 0; \
  |  |  469|      0|        bits = 0; \
  |  |  470|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1217|      0|                Tracev((stderr, "inflate:   length matches trailer\n"));
 1218|      0|            }
 1219|     21|#endif
 1220|     21|            state->mode = DONE;
 1221|       |                /* fallthrough */
 1222|     21|        case DONE:
  ------------------
  |  Branch (1222:9): [True: 0, False: 79.1k]
  ------------------
 1223|     21|            ret = Z_STREAM_END;
  ------------------
  |  |  178|     21|#define Z_STREAM_END    1
  ------------------
 1224|     21|            goto inf_leave;
 1225|    869|        case BAD:
  ------------------
  |  Branch (1225:9): [True: 869, False: 78.2k]
  ------------------
 1226|    869|            ret = Z_DATA_ERROR;
  ------------------
  |  |  182|    869|#define Z_DATA_ERROR   (-3)
  ------------------
 1227|    869|            goto inf_leave;
 1228|      0|        case MEM:
  ------------------
  |  Branch (1228:9): [True: 0, False: 79.1k]
  ------------------
 1229|      0|            return Z_MEM_ERROR;
  ------------------
  |  |  183|      0|#define Z_MEM_ERROR    (-4)
  ------------------
 1230|      0|        case SYNC:
  ------------------
  |  Branch (1230:9): [True: 0, False: 79.1k]
  ------------------
 1231|       |                /* fallthrough */
 1232|      0|        default:
  ------------------
  |  Branch (1232:9): [True: 0, False: 79.1k]
  ------------------
 1233|      0|            return Z_STREAM_ERROR;
  ------------------
  |  |  181|      0|#define Z_STREAM_ERROR (-2)
  ------------------
 1234|  79.1k|        }
 1235|       |
 1236|       |    /*
 1237|       |       Return from inflate(), updating the total counts and the check value.
 1238|       |       If there was no progress during the inflate() call, return a buffer
 1239|       |       error.  Call updatewindow() to create and/or update the window state.
 1240|       |       Note: a memory error from inflate() is non-recoverable.
 1241|       |     */
 1242|  8.54k|  inf_leave:
 1243|  8.54k|    RESTORE();
  ------------------
  |  |  456|  8.54k|    do { \
  |  |  457|  8.54k|        strm->next_out = put; \
  |  |  458|  8.54k|        strm->avail_out = left; \
  |  |  459|  8.54k|        strm->next_in = next; \
  |  |  460|  8.54k|        strm->avail_in = have; \
  |  |  461|  8.54k|        state->hold = hold; \
  |  |  462|  8.54k|        state->bits = bits; \
  |  |  463|  8.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (463:14): [Folded, False: 8.54k]
  |  |  ------------------
  ------------------
 1244|  8.54k|    if (state->wsize || (out != strm->avail_out && state->mode < BAD &&
  ------------------
  |  Branch (1244:9): [True: 6.40k, False: 2.14k]
  |  Branch (1244:26): [True: 612, False: 1.53k]
  |  Branch (1244:52): [True: 584, False: 28]
  ------------------
 1245|    584|            (state->mode < CHECK || flush != Z_FINISH)))
  ------------------
  |  |  172|      0|#define Z_FINISH        4
  ------------------
  |  Branch (1245:14): [True: 584, False: 0]
  |  Branch (1245:37): [True: 0, False: 0]
  ------------------
 1246|  6.98k|        if (updatewindow(strm, strm->next_out, out - strm->avail_out)) {
  ------------------
  |  Branch (1246:13): [True: 0, False: 6.98k]
  ------------------
 1247|      0|            state->mode = MEM;
 1248|      0|            return Z_MEM_ERROR;
  ------------------
  |  |  183|      0|#define Z_MEM_ERROR    (-4)
  ------------------
 1249|      0|        }
 1250|  8.54k|    in -= strm->avail_in;
 1251|  8.54k|    out -= strm->avail_out;
 1252|  8.54k|    strm->total_in += in;
 1253|  8.54k|    strm->total_out += out;
 1254|  8.54k|    state->total += out;
 1255|  8.54k|    if ((state->wrap & 4) && out)
  ------------------
  |  Branch (1255:9): [True: 1.83k, False: 6.70k]
  |  Branch (1255:30): [True: 271, False: 1.56k]
  ------------------
 1256|    271|        strm->adler = state->check =
 1257|    271|            UPDATE_CHECK(state->check, strm->next_out - out, out);
  ------------------
  |  |  419|    271|    (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
  |  |  ------------------
  |  |  |  Branch (419:6): [True: 0, False: 271]
  |  |  ------------------
  ------------------
 1258|  8.54k|    strm->data_type = (int)state->bits + (state->last ? 64 : 0) +
  ------------------
  |  Branch (1258:43): [True: 465, False: 8.07k]
  ------------------
 1259|  8.54k|                      (state->mode == TYPE ? 128 : 0) +
  ------------------
  |  Branch (1259:24): [True: 4.00k, False: 4.53k]
  ------------------
 1260|  8.54k|                      (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
  ------------------
  |  Branch (1260:24): [True: 0, False: 8.54k]
  |  Branch (1260:47): [True: 0, False: 8.54k]
  ------------------
 1261|  8.54k|    if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
  ------------------
  |  |  172|  7.66k|#define Z_FINISH        4
  ------------------
                  if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
  ------------------
  |  |  177|    879|#define Z_OK            0
  ------------------
  |  Branch (1261:11): [True: 889, False: 7.65k]
  |  Branch (1261:22): [True: 879, False: 10]
  |  Branch (1261:35): [True: 0, False: 7.66k]
  |  Branch (1261:57): [True: 850, False: 29]
  ------------------
 1262|    850|        ret = Z_BUF_ERROR;
  ------------------
  |  |  184|    850|#define Z_BUF_ERROR    (-5)
  ------------------
 1263|  8.54k|    return ret;
 1264|  8.54k|}
inflateEnd:
 1266|    715|int ZEXPORT inflateEnd(z_streamp strm) {
 1267|    715|    struct inflate_state FAR *state;
 1268|    715|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (1268:9): [True: 0, False: 715]
  ------------------
 1269|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  181|      0|#define Z_STREAM_ERROR (-2)
  ------------------
 1270|    715|    state = (struct inflate_state FAR *)strm->state;
 1271|    715|    if (state->window != Z_NULL) ZFREE(strm, state->window);
  ------------------
  |  |  212|    715|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (state->window != Z_NULL) ZFREE(strm, state->window);
  ------------------
  |  |  247|    584|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
  |  Branch (1271:9): [True: 584, False: 131]
  ------------------
 1272|    715|    ZFREE(strm, strm->state);
  ------------------
  |  |  247|    715|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
 1273|    715|    strm->state = Z_NULL;
  ------------------
  |  |  212|    715|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1274|    715|    Tracev((stderr, "inflate: end\n"));
 1275|    715|    return Z_OK;
  ------------------
  |  |  177|    715|#define Z_OK            0
  ------------------
 1276|    715|}
inflate.c:inflateStateCheck:
   94|  13.0k|local int inflateStateCheck(z_streamp strm) {
   95|  13.0k|    struct inflate_state FAR *state;
   96|  13.0k|    if (strm == Z_NULL ||
  ------------------
  |  |  212|  26.1k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (96:9): [True: 0, False: 13.0k]
  ------------------
   97|  13.0k|        strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
  ------------------
  |  Branch (97:9): [True: 0, False: 13.0k]
  |  Branch (97:42): [True: 0, False: 13.0k]
  ------------------
   98|      0|        return 1;
   99|  13.0k|    state = (struct inflate_state FAR *)strm->state;
  100|  13.0k|    if (state == Z_NULL || state->strm != strm ||
  ------------------
  |  |  212|  26.1k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (100:9): [True: 0, False: 13.0k]
  |  Branch (100:28): [True: 0, False: 13.0k]
  ------------------
  101|  13.0k|        state->mode < HEAD || state->mode > SYNC)
  ------------------
  |  Branch (101:9): [True: 0, False: 13.0k]
  |  Branch (101:31): [True: 0, False: 13.0k]
  ------------------
  102|      0|        return 1;
  103|  13.0k|    return 0;
  104|  13.0k|}
inflate.c:fixedtables:
  252|  4.15k|local void fixedtables(struct inflate_state FAR *state) {
  253|       |#ifdef BUILDFIXED
  254|       |    static int virgin = 1;
  255|       |    static code *lenfix, *distfix;
  256|       |    static code fixed[544];
  257|       |
  258|       |    /* build fixed huffman tables if first call (may not be thread safe) */
  259|       |    if (virgin) {
  260|       |        unsigned sym, bits;
  261|       |        static code *next;
  262|       |
  263|       |        /* literal/length table */
  264|       |        sym = 0;
  265|       |        while (sym < 144) state->lens[sym++] = 8;
  266|       |        while (sym < 256) state->lens[sym++] = 9;
  267|       |        while (sym < 280) state->lens[sym++] = 7;
  268|       |        while (sym < 288) state->lens[sym++] = 8;
  269|       |        next = fixed;
  270|       |        lenfix = next;
  271|       |        bits = 9;
  272|       |        inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
  273|       |
  274|       |        /* distance table */
  275|       |        sym = 0;
  276|       |        while (sym < 32) state->lens[sym++] = 5;
  277|       |        distfix = next;
  278|       |        bits = 5;
  279|       |        inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
  280|       |
  281|       |        /* do this just once */
  282|       |        virgin = 0;
  283|       |    }
  284|       |#else /* !BUILDFIXED */
  285|  4.15k|#   include "inffixed.h"
  ------------------
  |  |    1|       |    /* inffixed.h -- table for decoding fixed codes
  |  |    2|       |     * Generated automatically by makefixed().
  |  |    3|       |     */
  |  |    4|       |
  |  |    5|       |    /* WARNING: this file should *not* be used by applications.
  |  |    6|       |       It is part of the implementation of this library and is
  |  |    7|       |       subject to change. Applications should only use zlib.h.
  |  |    8|       |     */
  |  |    9|       |
  |  |   10|  4.15k|    static const code lenfix[512] = {
  |  |   11|  4.15k|        {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
  |  |   12|  4.15k|        {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
  |  |   13|  4.15k|        {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
  |  |   14|  4.15k|        {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
  |  |   15|  4.15k|        {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
  |  |   16|  4.15k|        {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
  |  |   17|  4.15k|        {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
  |  |   18|  4.15k|        {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
  |  |   19|  4.15k|        {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
  |  |   20|  4.15k|        {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
  |  |   21|  4.15k|        {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
  |  |   22|  4.15k|        {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
  |  |   23|  4.15k|        {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
  |  |   24|  4.15k|        {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
  |  |   25|  4.15k|        {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
  |  |   26|  4.15k|        {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
  |  |   27|  4.15k|        {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
  |  |   28|  4.15k|        {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
  |  |   29|  4.15k|        {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
  |  |   30|  4.15k|        {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
  |  |   31|  4.15k|        {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
  |  |   32|  4.15k|        {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
  |  |   33|  4.15k|        {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
  |  |   34|  4.15k|        {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
  |  |   35|  4.15k|        {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
  |  |   36|  4.15k|        {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
  |  |   37|  4.15k|        {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
  |  |   38|  4.15k|        {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
  |  |   39|  4.15k|        {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
  |  |   40|  4.15k|        {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
  |  |   41|  4.15k|        {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
  |  |   42|  4.15k|        {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
  |  |   43|  4.15k|        {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
  |  |   44|  4.15k|        {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
  |  |   45|  4.15k|        {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
  |  |   46|  4.15k|        {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
  |  |   47|  4.15k|        {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
  |  |   48|  4.15k|        {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
  |  |   49|  4.15k|        {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
  |  |   50|  4.15k|        {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
  |  |   51|  4.15k|        {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
  |  |   52|  4.15k|        {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
  |  |   53|  4.15k|        {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
  |  |   54|  4.15k|        {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
  |  |   55|  4.15k|        {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
  |  |   56|  4.15k|        {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
  |  |   57|  4.15k|        {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
  |  |   58|  4.15k|        {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
  |  |   59|  4.15k|        {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
  |  |   60|  4.15k|        {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
  |  |   61|  4.15k|        {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
  |  |   62|  4.15k|        {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
  |  |   63|  4.15k|        {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
  |  |   64|  4.15k|        {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
  |  |   65|  4.15k|        {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
  |  |   66|  4.15k|        {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
  |  |   67|  4.15k|        {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
  |  |   68|  4.15k|        {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
  |  |   69|  4.15k|        {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
  |  |   70|  4.15k|        {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
  |  |   71|  4.15k|        {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
  |  |   72|  4.15k|        {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
  |  |   73|  4.15k|        {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
  |  |   74|  4.15k|        {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
  |  |   75|  4.15k|        {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
  |  |   76|  4.15k|        {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
  |  |   77|  4.15k|        {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
  |  |   78|  4.15k|        {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
  |  |   79|  4.15k|        {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
  |  |   80|  4.15k|        {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
  |  |   81|  4.15k|        {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
  |  |   82|  4.15k|        {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
  |  |   83|  4.15k|        {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
  |  |   84|  4.15k|        {0,9,255}
  |  |   85|  4.15k|    };
  |  |   86|       |
  |  |   87|  4.15k|    static const code distfix[32] = {
  |  |   88|  4.15k|        {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
  |  |   89|  4.15k|        {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
  |  |   90|  4.15k|        {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
  |  |   91|  4.15k|        {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
  |  |   92|  4.15k|        {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
  |  |   93|  4.15k|        {22,5,193},{64,5,0}
  |  |   94|  4.15k|    };
  ------------------
  286|  4.15k|#endif /* BUILDFIXED */
  287|  4.15k|    state->lencode = lenfix;
  288|  4.15k|    state->lenbits = 9;
  289|  4.15k|    state->distcode = distfix;
  290|  4.15k|    state->distbits = 5;
  291|  4.15k|}
inflate.c:updatewindow:
  368|  6.98k|local int updatewindow(z_streamp strm, const Bytef *end, unsigned copy) {
  369|  6.98k|    struct inflate_state FAR *state;
  370|  6.98k|    unsigned dist;
  371|       |
  372|  6.98k|    state = (struct inflate_state FAR *)strm->state;
  373|       |
  374|       |    /* if it hasn't been done already, allocate space for the window */
  375|  6.98k|    if (state->window == Z_NULL) {
  ------------------
  |  |  212|  6.98k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (375:9): [True: 584, False: 6.40k]
  ------------------
  376|    584|        state->window = (unsigned char FAR *)
  377|    584|                        ZALLOC(strm, 1U << state->wbits,
  ------------------
  |  |  246|    584|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  378|    584|                               sizeof(unsigned char));
  379|    584|        if (state->window == Z_NULL) return 1;
  ------------------
  |  |  212|    584|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (379:13): [True: 0, False: 584]
  ------------------
  380|    584|    }
  381|       |
  382|       |    /* if window not in use yet, initialize */
  383|  6.98k|    if (state->wsize == 0) {
  ------------------
  |  Branch (383:9): [True: 584, False: 6.40k]
  ------------------
  384|    584|        state->wsize = 1U << state->wbits;
  385|    584|        state->wnext = 0;
  386|    584|        state->whave = 0;
  387|    584|    }
  388|       |
  389|       |    /* copy state->wsize or less output bytes into the circular window */
  390|  6.98k|    if (copy >= state->wsize) {
  ------------------
  |  Branch (390:9): [True: 0, False: 6.98k]
  ------------------
  391|      0|        zmemcpy(state->window, end - state->wsize, state->wsize);
  ------------------
  |  |  209|      0|#    define zmemcpy memcpy
  ------------------
  392|      0|        state->wnext = 0;
  393|      0|        state->whave = state->wsize;
  394|      0|    }
  395|  6.98k|    else {
  396|  6.98k|        dist = state->wsize - state->wnext;
  397|  6.98k|        if (dist > copy) dist = copy;
  ------------------
  |  Branch (397:13): [True: 6.08k, False: 903]
  ------------------
  398|  6.98k|        zmemcpy(state->window + state->wnext, end - copy, dist);
  ------------------
  |  |  209|  6.98k|#    define zmemcpy memcpy
  ------------------
  399|  6.98k|        copy -= dist;
  400|  6.98k|        if (copy) {
  ------------------
  |  Branch (400:13): [True: 390, False: 6.59k]
  ------------------
  401|    390|            zmemcpy(state->window, end - copy, copy);
  ------------------
  |  |  209|    390|#    define zmemcpy memcpy
  ------------------
  402|    390|            state->wnext = copy;
  403|    390|            state->whave = state->wsize;
  404|    390|        }
  405|  6.59k|        else {
  406|  6.59k|            state->wnext += dist;
  407|  6.59k|            if (state->wnext == state->wsize) state->wnext = 0;
  ------------------
  |  Branch (407:17): [True: 513, False: 6.08k]
  ------------------
  408|  6.59k|            if (state->whave < state->wsize) state->whave += dist;
  ------------------
  |  Branch (408:17): [True: 2.60k, False: 3.99k]
  ------------------
  409|  6.59k|        }
  410|  6.98k|    }
  411|  6.98k|    return 0;
  412|  6.98k|}

inflate_table:
   34|    157|                                unsigned FAR *bits, unsigned short FAR *work) {
   35|    157|    unsigned len;               /* a code's length in bits */
   36|    157|    unsigned sym;               /* index of code symbols */
   37|    157|    unsigned min, max;          /* minimum and maximum code lengths */
   38|    157|    unsigned root;              /* number of index bits for root table */
   39|    157|    unsigned curr;              /* number of index bits for current table */
   40|    157|    unsigned drop;              /* code bits to drop for sub-table */
   41|    157|    int left;                   /* number of prefix codes available */
   42|    157|    unsigned used;              /* code entries in table used */
   43|    157|    unsigned huff;              /* Huffman code */
   44|    157|    unsigned incr;              /* for incrementing code, index */
   45|    157|    unsigned fill;              /* index for replicating entries */
   46|    157|    unsigned low;               /* low bits for current root entry */
   47|    157|    unsigned mask;              /* mask for low root bits */
   48|    157|    code here;                  /* table entry for duplication */
   49|    157|    code FAR *next;             /* next available space in table */
   50|    157|    const unsigned short FAR *base;     /* base value table to use */
   51|    157|    const unsigned short FAR *extra;    /* extra bits table to use */
   52|    157|    unsigned match;             /* use base and extra for symbol >= match */
   53|    157|    unsigned short count[MAXBITS+1];    /* number of codes of each length */
   54|    157|    unsigned short offs[MAXBITS+1];     /* offsets in table for each length */
   55|    157|    static const unsigned short lbase[31] = { /* Length codes 257..285 base */
   56|    157|        3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
   57|    157|        35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
   58|    157|    static const unsigned short lext[31] = { /* Length codes 257..285 extra */
   59|    157|        16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
   60|    157|        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 203, 77};
   61|    157|    static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
   62|    157|        1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
   63|    157|        257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
   64|    157|        8193, 12289, 16385, 24577, 0, 0};
   65|    157|    static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
   66|    157|        16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
   67|    157|        23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
   68|    157|        28, 28, 29, 29, 64, 64};
   69|       |
   70|       |    /*
   71|       |       Process a set of code lengths to create a canonical Huffman code.  The
   72|       |       code lengths are lens[0..codes-1].  Each length corresponds to the
   73|       |       symbols 0..codes-1.  The Huffman code is generated by first sorting the
   74|       |       symbols by length from short to long, and retaining the symbol order
   75|       |       for codes with equal lengths.  Then the code starts with all zero bits
   76|       |       for the first code of the shortest length, and the codes are integer
   77|       |       increments for the same length, and zeros are appended as the length
   78|       |       increases.  For the deflate format, these bits are stored backwards
   79|       |       from their more natural integer increment ordering, and so when the
   80|       |       decoding tables are built in the large loop below, the integer codes
   81|       |       are incremented backwards.
   82|       |
   83|       |       This routine assumes, but does not check, that all of the entries in
   84|       |       lens[] are in the range 0..MAXBITS.  The caller must assure this.
   85|       |       1..MAXBITS is interpreted as that code length.  zero means that that
   86|       |       symbol does not occur in this code.
   87|       |
   88|       |       The codes are sorted by computing a count of codes for each length,
   89|       |       creating from that a table of starting indices for each length in the
   90|       |       sorted table, and then entering the symbols in order in the sorted
   91|       |       table.  The sorted table is work[], with that space being provided by
   92|       |       the caller.
   93|       |
   94|       |       The length counts are used for other purposes as well, i.e. finding
   95|       |       the minimum and maximum length codes, determining if there are any
   96|       |       codes at all, checking for a valid set of lengths, and looking ahead
   97|       |       at length counts to determine sub-table sizes when building the
   98|       |       decoding tables.
   99|       |     */
  100|       |
  101|       |    /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
  102|  2.66k|    for (len = 0; len <= MAXBITS; len++)
  ------------------
  |  |    9|  2.66k|#define MAXBITS 15
  ------------------
  |  Branch (102:19): [True: 2.51k, False: 157]
  ------------------
  103|  2.51k|        count[len] = 0;
  104|  10.1k|    for (sym = 0; sym < codes; sym++)
  ------------------
  |  Branch (104:19): [True: 9.97k, False: 157]
  ------------------
  105|  9.97k|        count[lens[sym]]++;
  106|       |
  107|       |    /* bound code lengths, force root to be within code lengths */
  108|    157|    root = *bits;
  109|  1.51k|    for (max = MAXBITS; max >= 1; max--)
  ------------------
  |  |    9|    157|#define MAXBITS 15
  ------------------
  |  Branch (109:25): [True: 1.50k, False: 9]
  ------------------
  110|  1.50k|        if (count[max] != 0) break;
  ------------------
  |  Branch (110:13): [True: 148, False: 1.35k]
  ------------------
  111|    157|    if (root > max) root = max;
  ------------------
  |  Branch (111:9): [True: 65, False: 92]
  ------------------
  112|    157|    if (max == 0) {                     /* no symbols to code at all */
  ------------------
  |  Branch (112:9): [True: 9, False: 148]
  ------------------
  113|      9|        here.op = (unsigned char)64;    /* invalid code marker */
  114|      9|        here.bits = (unsigned char)1;
  115|      9|        here.val = (unsigned short)0;
  116|      9|        *(*table)++ = here;             /* make a table to force an error */
  117|      9|        *(*table)++ = here;
  118|      9|        *bits = 1;
  119|      9|        return 0;     /* no symbols, but wait for decoding to report error */
  120|      9|    }
  121|    344|    for (min = 1; min < max; min++)
  ------------------
  |  Branch (121:19): [True: 322, False: 22]
  ------------------
  122|    322|        if (count[min] != 0) break;
  ------------------
  |  Branch (122:13): [True: 126, False: 196]
  ------------------
  123|    148|    if (root < min) root = min;
  ------------------
  |  Branch (123:9): [True: 7, False: 141]
  ------------------
  124|       |
  125|       |    /* check for an over-subscribed or incomplete set of lengths */
  126|    148|    left = 1;
  127|  1.97k|    for (len = 1; len <= MAXBITS; len++) {
  ------------------
  |  |    9|  1.97k|#define MAXBITS 15
  ------------------
  |  Branch (127:19): [True: 1.86k, False: 116]
  ------------------
  128|  1.86k|        left <<= 1;
  129|  1.86k|        left -= count[len];
  130|  1.86k|        if (left < 0) return -1;        /* over-subscribed */
  ------------------
  |  Branch (130:13): [True: 32, False: 1.82k]
  ------------------
  131|  1.86k|    }
  132|    116|    if (left > 0 && (type == CODES || max != 1))
  ------------------
  |  Branch (132:9): [True: 21, False: 95]
  |  Branch (132:22): [True: 7, False: 14]
  |  Branch (132:39): [True: 14, False: 0]
  ------------------
  133|     21|        return -1;                      /* incomplete set */
  134|       |
  135|       |    /* generate offsets into symbol table for each length for sorting */
  136|     95|    offs[1] = 0;
  137|  1.42k|    for (len = 1; len < MAXBITS; len++)
  ------------------
  |  |    9|  1.42k|#define MAXBITS 15
  ------------------
  |  Branch (137:19): [True: 1.33k, False: 95]
  ------------------
  138|  1.33k|        offs[len + 1] = offs[len] + count[len];
  139|       |
  140|       |    /* sort symbols by length, by symbol order within each length */
  141|  5.37k|    for (sym = 0; sym < codes; sym++)
  ------------------
  |  Branch (141:19): [True: 5.27k, False: 95]
  ------------------
  142|  5.27k|        if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
  ------------------
  |  Branch (142:13): [True: 4.25k, False: 1.02k]
  ------------------
  143|       |
  144|       |    /*
  145|       |       Create and fill in decoding tables.  In this loop, the table being
  146|       |       filled is at next and has curr index bits.  The code being used is huff
  147|       |       with length len.  That code is converted to an index by dropping drop
  148|       |       bits off of the bottom.  For codes where len is less than drop + curr,
  149|       |       those top drop + curr - len bits are incremented through all values to
  150|       |       fill the table with replicated entries.
  151|       |
  152|       |       root is the number of index bits for the root table.  When len exceeds
  153|       |       root, sub-tables are created pointed to by the root entry with an index
  154|       |       of the low root bits of huff.  This is saved in low to check for when a
  155|       |       new sub-table should be started.  drop is zero when the root table is
  156|       |       being filled, and drop is root when sub-tables are being filled.
  157|       |
  158|       |       When a new sub-table is needed, it is necessary to look ahead in the
  159|       |       code lengths to determine what size sub-table is needed.  The length
  160|       |       counts are used for this, and so count[] is decremented as codes are
  161|       |       entered in the tables.
  162|       |
  163|       |       used keeps track of how many table entries have been allocated from the
  164|       |       provided *table space.  It is checked for LENS and DIST tables against
  165|       |       the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
  166|       |       the initial root table size constants.  See the comments in inftrees.h
  167|       |       for more information.
  168|       |
  169|       |       sym increments through all symbols, and the loop terminates when
  170|       |       all codes of length max, i.e. all codes, have been processed.  This
  171|       |       routine permits incomplete codes, so another loop after this one fills
  172|       |       in the rest of the decoding tables with invalid code markers.
  173|       |     */
  174|       |
  175|       |    /* set up for code type */
  176|     95|    switch (type) {
  177|     81|    case CODES:
  ------------------
  |  Branch (177:5): [True: 81, False: 14]
  ------------------
  178|     81|        base = extra = work;    /* dummy value--not used */
  179|     81|        match = 20;
  180|     81|        break;
  181|     14|    case LENS:
  ------------------
  |  Branch (181:5): [True: 14, False: 81]
  ------------------
  182|     14|        base = lbase;
  183|     14|        extra = lext;
  184|     14|        match = 257;
  185|     14|        break;
  186|      0|    default:    /* DISTS */
  ------------------
  |  Branch (186:5): [True: 0, False: 95]
  ------------------
  187|      0|        base = dbase;
  188|      0|        extra = dext;
  189|      0|        match = 0;
  190|     95|    }
  191|       |
  192|       |    /* initialize state for loop */
  193|     95|    huff = 0;                   /* starting code */
  194|     95|    sym = 0;                    /* starting code symbol */
  195|     95|    len = min;                  /* starting code length */
  196|     95|    next = *table;              /* current table to fill in */
  197|     95|    curr = root;                /* current table index bits */
  198|     95|    drop = 0;                   /* current bits to drop from code for index */
  199|     95|    low = (unsigned)(-1);       /* trigger new sub-table when len > root */
  200|     95|    used = 1U << root;          /* use root table entries */
  201|     95|    mask = used - 1;            /* mask for comparing low */
  202|       |
  203|       |    /* check available table space */
  204|     95|    if ((type == LENS && used > ENOUGH_LENS) ||
  ------------------
  |  |   49|     14|#define ENOUGH_LENS 852
  ------------------
  |  Branch (204:10): [True: 14, False: 81]
  |  Branch (204:26): [True: 0, False: 14]
  ------------------
  205|     95|        (type == DISTS && used > ENOUGH_DISTS))
  ------------------
  |  |   50|      0|#define ENOUGH_DISTS 592
  ------------------
  |  Branch (205:10): [True: 0, False: 95]
  |  Branch (205:27): [True: 0, False: 0]
  ------------------
  206|      0|        return 1;
  207|       |
  208|       |    /* process all codes and make table entries */
  209|  4.25k|    for (;;) {
  210|       |        /* create table entry */
  211|  4.25k|        here.bits = (unsigned char)(len - drop);
  212|  4.25k|        if (work[sym] + 1U < match) {
  ------------------
  |  Branch (212:13): [True: 4.12k, False: 130]
  ------------------
  213|  4.12k|            here.op = (unsigned char)0;
  214|  4.12k|            here.val = work[sym];
  215|  4.12k|        }
  216|    130|        else if (work[sym] >= match) {
  ------------------
  |  Branch (216:18): [True: 116, False: 14]
  ------------------
  217|    116|            here.op = (unsigned char)(extra[work[sym] - match]);
  218|    116|            here.val = base[work[sym] - match];
  219|    116|        }
  220|     14|        else {
  221|     14|            here.op = (unsigned char)(32 + 64);         /* end of block */
  222|     14|            here.val = 0;
  223|     14|        }
  224|       |
  225|       |        /* replicate for those indices with low len bits equal to huff */
  226|  4.25k|        incr = 1U << (len - drop);
  227|  4.25k|        fill = 1U << curr;
  228|  4.25k|        min = fill;                 /* save offset to next table */
  229|  13.2k|        do {
  230|  13.2k|            fill -= incr;
  231|  13.2k|            next[(huff >> drop) + fill] = here;
  232|  13.2k|        } while (fill != 0);
  ------------------
  |  Branch (232:18): [True: 9.03k, False: 4.25k]
  ------------------
  233|       |
  234|       |        /* backwards increment the len-bit code huff */
  235|  4.25k|        incr = 1U << (len - 1);
  236|  8.40k|        while (huff & incr)
  ------------------
  |  Branch (236:16): [True: 4.15k, False: 4.25k]
  ------------------
  237|  4.15k|            incr >>= 1;
  238|  4.25k|        if (incr != 0) {
  ------------------
  |  Branch (238:13): [True: 4.15k, False: 95]
  ------------------
  239|  4.15k|            huff &= incr - 1;
  240|  4.15k|            huff += incr;
  241|  4.15k|        }
  242|     95|        else
  243|     95|            huff = 0;
  244|       |
  245|       |        /* go to next symbol, update count, len */
  246|  4.25k|        sym++;
  247|  4.25k|        if (--(count[len]) == 0) {
  ------------------
  |  Branch (247:13): [True: 403, False: 3.84k]
  ------------------
  248|    403|            if (len == max) break;
  ------------------
  |  Branch (248:17): [True: 95, False: 308]
  ------------------
  249|    308|            len = lens[work[sym]];
  250|    308|        }
  251|       |
  252|       |        /* create new sub-table if needed */
  253|  4.15k|        if (len > root && (huff & mask) != low) {
  ------------------
  |  Branch (253:13): [True: 1.11k, False: 3.04k]
  |  Branch (253:27): [True: 80, False: 1.03k]
  ------------------
  254|       |            /* if first time, transition to sub-tables */
  255|     80|            if (drop == 0)
  ------------------
  |  Branch (255:17): [True: 9, False: 71]
  ------------------
  256|      9|                drop = root;
  257|       |
  258|       |            /* increment past last table */
  259|     80|            next += min;            /* here min is 1 << curr */
  260|       |
  261|       |            /* determine length of next table */
  262|     80|            curr = len - drop;
  263|     80|            left = (int)(1 << curr);
  264|     96|            while (curr + drop < max) {
  ------------------
  |  Branch (264:20): [True: 86, False: 10]
  ------------------
  265|     86|                left -= count[curr + drop];
  266|     86|                if (left <= 0) break;
  ------------------
  |  Branch (266:21): [True: 70, False: 16]
  ------------------
  267|     16|                curr++;
  268|     16|                left <<= 1;
  269|     16|            }
  270|       |
  271|       |            /* check for enough space */
  272|     80|            used += 1U << curr;
  273|     80|            if ((type == LENS && used > ENOUGH_LENS) ||
  ------------------
  |  |   49|     80|#define ENOUGH_LENS 852
  ------------------
  |  Branch (273:18): [True: 80, False: 0]
  |  Branch (273:34): [True: 0, False: 80]
  ------------------
  274|     80|                (type == DISTS && used > ENOUGH_DISTS))
  ------------------
  |  |   50|      0|#define ENOUGH_DISTS 592
  ------------------
  |  Branch (274:18): [True: 0, False: 80]
  |  Branch (274:35): [True: 0, False: 0]
  ------------------
  275|      0|                return 1;
  276|       |
  277|       |            /* point entry in root table to sub-table */
  278|     80|            low = huff & mask;
  279|     80|            (*table)[low].op = (unsigned char)curr;
  280|     80|            (*table)[low].bits = (unsigned char)root;
  281|     80|            (*table)[low].val = (unsigned short)(next - *table);
  282|     80|        }
  283|  4.15k|    }
  284|       |
  285|       |    /* fill in remaining table entry if code is incomplete (guaranteed to have
  286|       |       at most one remaining entry, since if the code is incomplete, the
  287|       |       maximum code length that was allowed to get this far is one bit) */
  288|     95|    if (huff != 0) {
  ------------------
  |  Branch (288:9): [True: 0, False: 95]
  ------------------
  289|      0|        here.op = (unsigned char)64;            /* invalid code marker */
  290|      0|        here.bits = (unsigned char)(len - drop);
  291|      0|        here.val = (unsigned short)0;
  292|      0|        next[huff] = here;
  293|      0|    }
  294|       |
  295|       |    /* set return parameters */
  296|     95|    *table += used;
  297|     95|    *bits = root;
  298|     95|    return 0;
  299|     95|}

LLVMFuzzerTestOneInput:
   35|  18.7k|{
   36|  18.7k|  int rc = 0;
   37|  18.7k|  int tlv_rc;
   38|  18.7k|  FUZZ_DATA fuzz;
   39|  18.7k|  TLV tlv;
   40|       |
   41|       |  /* Ignore SIGPIPE errors. We'll handle the errors ourselves. */
   42|  18.7k|  signal(SIGPIPE, SIG_IGN);
   43|       |
   44|       |  /* Have to set all fields to zero before getting to the terminate function */
   45|  18.7k|  memset(&fuzz, 0, sizeof(FUZZ_DATA));
   46|       |
   47|  18.7k|  if(size < sizeof(TLV_RAW)) {
  ------------------
  |  Branch (47:6): [True: 4, False: 18.7k]
  ------------------
   48|       |    /* Not enough data for a single TLV - don't continue */
   49|      4|    goto EXIT_LABEL;
   50|      4|  }
   51|       |
   52|       |  /* Try to initialize the fuzz data */
   53|  18.7k|  FTRY(fuzz_initialize_fuzz_data(&fuzz, data, size));
  ------------------
  |  |  480|  18.7k|        {                                                                     \
  |  |  481|  18.7k|          int _func_rc = (FUNC);                                              \
  |  |  482|  18.7k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |  483|  18.7k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  18.7k|        }
  ------------------
   54|       |
   55|  18.7k|  for(tlv_rc = fuzz_get_first_tlv(&fuzz, &tlv);
   56|   222k|      tlv_rc == 0;
  ------------------
  |  Branch (56:7): [True: 204k, False: 17.3k]
  ------------------
   57|   204k|      tlv_rc = fuzz_get_next_tlv(&fuzz, &tlv)) {
   58|       |
   59|       |    /* Have the TLV in hand. Parse the TLV. */
   60|   204k|    rc = fuzz_parse_tlv(&fuzz, &tlv);
   61|       |
   62|   204k|    if(rc != 0) {
  ------------------
  |  Branch (62:8): [True: 1.46k, False: 203k]
  ------------------
   63|       |      /* Failed to parse the TLV. Can't continue. */
   64|  1.46k|      goto EXIT_LABEL;
   65|  1.46k|    }
   66|   204k|  }
   67|       |
   68|  17.3k|  if(tlv_rc != TLV_RC_NO_MORE_TLVS) {
  ------------------
  |  |  267|  17.3k|#define TLV_RC_NO_MORE_TLVS             1
  ------------------
  |  Branch (68:6): [True: 121, False: 17.2k]
  ------------------
   69|       |    /* A TLV call failed. Can't continue. */
   70|    121|    goto EXIT_LABEL;
   71|    121|  }
   72|       |
   73|       |  /* Set up the standard easy options. */
   74|  17.2k|  FTRY(fuzz_set_easy_options(&fuzz));
  ------------------
  |  |  480|  17.2k|        {                                                                     \
  |  |  481|  17.2k|          int _func_rc = (FUNC);                                              \
  |  |  482|  17.2k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  483|  17.2k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  17.2k|        }
  ------------------
   75|       |
   76|       |  /**
   77|       |   * Add in more curl options that have been accumulated over possibly
   78|       |   * multiple TLVs.
   79|       |   */
   80|  17.2k|  if(fuzz.header_list != NULL) {
  ------------------
  |  Branch (80:6): [True: 876, False: 16.3k]
  ------------------
   81|    876|    curl_easy_setopt(fuzz.easy, CURLOPT_HTTPHEADER, fuzz.header_list);
  ------------------
  |  | 3337|    876|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3335|    876|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
   82|    876|  }
   83|       |
   84|  17.2k|  if(fuzz.mail_recipients_list != NULL) {
  ------------------
  |  Branch (84:6): [True: 27, False: 17.1k]
  ------------------
   85|     27|    curl_easy_setopt(fuzz.easy, CURLOPT_MAIL_RCPT, fuzz.mail_recipients_list);
  ------------------
  |  | 3337|     27|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3335|     27|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
   86|     27|  }
   87|       |
   88|  17.2k|  if(fuzz.mime != NULL) {
  ------------------
  |  Branch (88:6): [True: 527, False: 16.6k]
  ------------------
   89|    527|    curl_easy_setopt(fuzz.easy, CURLOPT_MIMEPOST, fuzz.mime);
  ------------------
  |  | 3337|    527|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3335|    527|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
   90|    527|  }
   91|       |
   92|  17.2k|  if (fuzz.httppost != NULL) {
  ------------------
  |  Branch (92:7): [True: 156, False: 17.0k]
  ------------------
   93|    156|    curl_easy_setopt(fuzz.easy, CURLOPT_HTTPPOST, fuzz.httppost);
  ------------------
  |  | 3337|    156|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3335|    156|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
   94|    156|  }
   95|       |
   96|       |  /* Run the transfer. */
   97|  17.2k|  fuzz_handle_transfer(&fuzz);
   98|       |
   99|  18.7k|EXIT_LABEL:
  100|       |
  101|  18.7k|  fuzz_terminate_fuzz_data(&fuzz);
  102|       |
  103|       |  /* This function must always return 0. Non-zero codes are reserved. */
  104|  18.7k|  return 0;
  105|  17.2k|}
_Z6to_u32PKh:
  111|   222k|{
  112|   222k|  uint32_t u;
  113|   222k|  u = (b[0] << 24) + (b[1] << 16) + (b[2] << 8) + b[3];
  114|   222k|  return u;
  115|   222k|}
_Z6to_u16PKh:
  121|   208k|{
  122|   208k|  uint16_t u;
  123|   208k|  u = (b[0] << 8) + b[1];
  124|   208k|  return u;
  125|   208k|}
_Z25fuzz_initialize_fuzz_dataP9fuzz_dataPKhm:
  133|  18.7k|{
  134|  18.7k|  int rc = 0;
  135|  18.7k|  int ii;
  136|       |
  137|       |  /* Initialize the fuzz data. */
  138|  18.7k|  memset(fuzz, 0, sizeof(FUZZ_DATA));
  139|       |
  140|       |  /* Create an easy handle. This will have all of the settings configured on
  141|       |     it. */
  142|  18.7k|  fuzz->easy = curl_easy_init();
  143|  18.7k|  FCHECK(fuzz->easy != NULL);
  ------------------
  |  |  490|  18.7k|        {                                                                     \
  |  |  491|  18.7k|          if (!(COND))                                                        \
  |  |  ------------------
  |  |  |  Branch (491:15): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |  492|  18.7k|          {                                                                   \
  |  |  493|      0|            rc = 255;                                                         \
  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  495|      0|          }                                                                   \
  |  |  496|  18.7k|        }
  ------------------
  144|       |
  145|       |  /* Set up the state parser */
  146|  18.7k|  fuzz->state.data = data;
  147|  18.7k|  fuzz->state.data_len = data_len;
  148|       |
  149|       |  /* Set up the state of the server sockets. */
  150|  56.3k|  for(ii = 0; ii < FUZZ_NUM_CONNECTIONS; ii++) {
  ------------------
  |  |  307|  56.3k|#define FUZZ_NUM_CONNECTIONS            2
  ------------------
  |  Branch (150:15): [True: 37.5k, False: 18.7k]
  ------------------
  151|  37.5k|    fuzz->sockman[ii].index = ii;
  152|  37.5k|    fuzz->sockman[ii].fd_state = FUZZ_SOCK_CLOSED;
  153|  37.5k|  }
  154|       |
  155|       |  /* Check for verbose mode. */
  156|  18.7k|  fuzz->verbose = (getenv("FUZZ_VERBOSE") != NULL);
  157|       |
  158|  18.7k|  FCHECK(setenv("CURL_HSTS_HTTP", "1", 0) == 0);
  ------------------
  |  |  490|  18.7k|        {                                                                     \
  |  |  491|  18.7k|          if (!(COND))                                                        \
  |  |  ------------------
  |  |  |  Branch (491:15): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |  492|  18.7k|          {                                                                   \
  |  |  493|      0|            rc = 255;                                                         \
  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  495|      0|          }                                                                   \
  |  |  496|  18.7k|        }
  ------------------
  159|  18.7k|  FCHECK(setenv("CURL_ALTSVC_HTTP", "1", 0) == 0);
  ------------------
  |  |  490|  18.7k|        {                                                                     \
  |  |  491|  18.7k|          if (!(COND))                                                        \
  |  |  ------------------
  |  |  |  Branch (491:15): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |  492|  18.7k|          {                                                                   \
  |  |  493|      0|            rc = 255;                                                         \
  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  495|      0|          }                                                                   \
  |  |  496|  18.7k|        }
  ------------------
  160|       |
  161|  18.7k|EXIT_LABEL:
  162|       |
  163|  18.7k|  return rc;
  164|  18.7k|}
_Z21fuzz_set_easy_optionsP9fuzz_data:
  170|  17.2k|{
  171|  17.2k|  int rc = 0;
  172|  17.2k|  unsigned long allowed_protocols;
  173|       |
  174|       |  /* Set some standard options on the CURL easy handle. We need to override the
  175|       |     socket function so that we create our own sockets to present to CURL. */
  176|  17.2k|  FTRY(curl_easy_setopt(fuzz->easy,
  ------------------
  |  |  480|  17.2k|        {                                                                     \
  |  |  481|  17.2k|          int _func_rc = (FUNC);                                              \
  |  |  482|  17.2k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  483|  17.2k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  17.2k|        }
  ------------------
  177|  17.2k|                        CURLOPT_OPENSOCKETFUNCTION,
  178|  17.2k|                        fuzz_open_socket));
  179|  17.2k|  FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_OPENSOCKETDATA, fuzz));
  ------------------
  |  |  480|  17.2k|        {                                                                     \
  |  |  481|  17.2k|          int _func_rc = (FUNC);                                              \
  |  |  482|  17.2k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  483|  17.2k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  17.2k|        }
  ------------------
  180|       |
  181|       |  /* In case something tries to set a socket option, intercept this. */
  182|  17.2k|  FTRY(curl_easy_setopt(fuzz->easy,
  ------------------
  |  |  480|  17.2k|        {                                                                     \
  |  |  481|  17.2k|          int _func_rc = (FUNC);                                              \
  |  |  482|  17.2k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  483|  17.2k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  17.2k|        }
  ------------------
  183|  17.2k|                        CURLOPT_SOCKOPTFUNCTION,
  184|  17.2k|                        fuzz_sockopt_callback));
  185|       |
  186|       |  /* Set the standard read function callback. */
  187|  17.2k|  FTRY(curl_easy_setopt(fuzz->easy,
  ------------------
  |  |  480|  17.2k|        {                                                                     \
  |  |  481|  17.2k|          int _func_rc = (FUNC);                                              \
  |  |  482|  17.2k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  483|  17.2k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  17.2k|        }
  ------------------
  188|  17.2k|                        CURLOPT_READFUNCTION,
  189|  17.2k|                        fuzz_read_callback));
  190|  17.2k|  FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_READDATA, fuzz));
  ------------------
  |  |  480|  17.2k|        {                                                                     \
  |  |  481|  17.2k|          int _func_rc = (FUNC);                                              \
  |  |  482|  17.2k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  483|  17.2k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  17.2k|        }
  ------------------
  191|       |
  192|       |  /* Set the standard write function callback. */
  193|  17.2k|  FTRY(curl_easy_setopt(fuzz->easy,
  ------------------
  |  |  480|  17.2k|        {                                                                     \
  |  |  481|  17.2k|          int _func_rc = (FUNC);                                              \
  |  |  482|  17.2k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  483|  17.2k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  17.2k|        }
  ------------------
  194|  17.2k|                        CURLOPT_WRITEFUNCTION,
  195|  17.2k|                        fuzz_write_callback));
  196|  17.2k|  FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_WRITEDATA, fuzz));
  ------------------
  |  |  480|  17.2k|        {                                                                     \
  |  |  481|  17.2k|          int _func_rc = (FUNC);                                              \
  |  |  482|  17.2k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  483|  17.2k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  17.2k|        }
  ------------------
  197|       |
  198|       |  /* Set the writable cookie jar path so cookies are tested. */
  199|  17.2k|  FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_COOKIEJAR, FUZZ_COOKIE_JAR_PATH));
  ------------------
  |  |  480|  17.2k|        {                                                                     \
  |  |  481|  17.2k|          int _func_rc = (FUNC);                                              \
  |  |  482|  17.2k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  483|  17.2k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  17.2k|        }
  ------------------
  200|       |
  201|       |  /* Set the RO cookie file path so cookies are tested. */
  202|  17.2k|  FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_COOKIEFILE, FUZZ_RO_COOKIE_FILE_PATH));
  ------------------
  |  |  480|  17.2k|        {                                                                     \
  |  |  481|  17.2k|          int _func_rc = (FUNC);                                              \
  |  |  482|  17.2k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  483|  17.2k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  17.2k|        }
  ------------------
  203|       |
  204|       |  /* Set altsvc header cache filepath so that it can be fuzzed. */
  205|  17.2k|  FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_ALTSVC, FUZZ_ALT_SVC_HEADER_CACHE_PATH));
  ------------------
  |  |  480|  17.2k|        {                                                                     \
  |  |  481|  17.2k|          int _func_rc = (FUNC);                                              \
  |  |  482|  17.2k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  483|  17.2k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  17.2k|        }
  ------------------
  206|       |
  207|       |  /* Set the hsts header cache filepath so that it can be fuzzed. */
  208|  17.2k|  FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_HSTS, FUZZ_HSTS_HEADER_CACHE_PATH));
  ------------------
  |  |  480|  17.2k|        {                                                                     \
  |  |  481|  17.2k|          int _func_rc = (FUNC);                                              \
  |  |  482|  17.2k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  483|  17.2k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  17.2k|        }
  ------------------
  209|       |
  210|       |  /* Set the Certificate Revocation List file path so it can be fuzzed */
  211|  17.2k|  FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_CRLFILE, FUZZ_CRL_FILE_PATH));
  ------------------
  |  |  480|  17.2k|        {                                                                     \
  |  |  481|  17.2k|          int _func_rc = (FUNC);                                              \
  |  |  482|  17.2k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  483|  17.2k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  17.2k|        }
  ------------------
  212|       |
  213|       |  /* Set the .netrc file path so it can be fuzzed */
  214|  17.2k|  FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_NETRC_FILE, FUZZ_NETRC_FILE_PATH));
  ------------------
  |  |  480|  17.2k|        {                                                                     \
  |  |  481|  17.2k|          int _func_rc = (FUNC);                                              \
  |  |  482|  17.2k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  483|  17.2k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  17.2k|        }
  ------------------
  215|       |
  216|       |  /* Time out requests quickly. */
  217|  17.2k|  FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_TIMEOUT_MS, 200L));
  ------------------
  |  |  480|  17.2k|        {                                                                     \
  |  |  481|  17.2k|          int _func_rc = (FUNC);                                              \
  |  |  482|  17.2k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  483|  17.2k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  17.2k|        }
  ------------------
  218|  17.2k|  FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_SERVER_RESPONSE_TIMEOUT, 1L));
  ------------------
  |  |  480|  17.2k|        {                                                                     \
  |  |  481|  17.2k|          int _func_rc = (FUNC);                                              \
  |  |  482|  17.2k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  483|  17.2k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  17.2k|        }
  ------------------
  219|       |
  220|       |  /* Can enable verbose mode by having the environment variable FUZZ_VERBOSE. */
  221|  17.2k|  if(fuzz->verbose) {
  ------------------
  |  Branch (221:6): [True: 0, False: 17.2k]
  ------------------
  222|      0|    FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_VERBOSE, 1L));
  ------------------
  |  |  480|      0|        {                                                                     \
  |  |  481|      0|          int _func_rc = (FUNC);                                              \
  |  |  482|      0|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 0]
  |  |  ------------------
  |  |  483|      0|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|      0|        }
  ------------------
  223|      0|  }
  224|       |
  225|       |  /* Force resolution of all addresses to a specific IP address. */
  226|  17.2k|  fuzz->connect_to_list = curl_slist_append(NULL, "::127.0.1.127:");
  227|  17.2k|  FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_CONNECT_TO, fuzz->connect_to_list));
  ------------------
  |  |  480|  17.2k|        {                                                                     \
  |  |  481|  17.2k|          int _func_rc = (FUNC);                                              \
  |  |  482|  17.2k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  483|  17.2k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  17.2k|        }
  ------------------
  228|       |
  229|       |  /* Limit the protocols in use by this fuzzer. */
  230|  17.2k|  FTRY(fuzz_set_allowed_protocols(fuzz));
  ------------------
  |  |  480|  17.2k|        {                                                                     \
  |  |  481|  17.2k|          int _func_rc = (FUNC);                                              \
  |  |  482|  17.2k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  483|  17.2k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  17.2k|        }
  ------------------
  231|       |
  232|  17.2k|EXIT_LABEL:
  233|       |
  234|  17.2k|  return rc;
  235|  17.2k|}
_Z24fuzz_terminate_fuzz_dataP9fuzz_data:
  241|  18.7k|{
  242|  18.7k|  int ii;
  243|       |
  244|  18.7k|  fuzz_free((void **)&fuzz->postfields);
  245|       |
  246|  56.3k|  for(ii = 0; ii < FUZZ_NUM_CONNECTIONS; ii++) {
  ------------------
  |  |  307|  56.3k|#define FUZZ_NUM_CONNECTIONS            2
  ------------------
  |  Branch (246:15): [True: 37.5k, False: 18.7k]
  ------------------
  247|  37.5k|    if(fuzz->sockman[ii].fd_state != FUZZ_SOCK_CLOSED) {
  ------------------
  |  Branch (247:8): [True: 13.9k, False: 23.6k]
  ------------------
  248|  13.9k|      close(fuzz->sockman[ii].fd);
  249|  13.9k|      fuzz->sockman[ii].fd_state = FUZZ_SOCK_CLOSED;
  250|  13.9k|    }
  251|  37.5k|  }
  252|       |
  253|  18.7k|  if(fuzz->connect_to_list != NULL) {
  ------------------
  |  Branch (253:6): [True: 17.2k, False: 1.59k]
  ------------------
  254|  17.2k|    curl_slist_free_all(fuzz->connect_to_list);
  255|  17.2k|    fuzz->connect_to_list = NULL;
  256|  17.2k|  }
  257|       |
  258|  18.7k|  if(fuzz->header_list != NULL) {
  ------------------
  |  Branch (258:6): [True: 881, False: 17.9k]
  ------------------
  259|    881|    curl_slist_free_all(fuzz->header_list);
  260|    881|    fuzz->header_list = NULL;
  261|    881|  }
  262|       |
  263|  18.7k|  if(fuzz->mail_recipients_list != NULL) {
  ------------------
  |  Branch (263:6): [True: 32, False: 18.7k]
  ------------------
  264|     32|    curl_slist_free_all(fuzz->mail_recipients_list);
  265|     32|    fuzz->mail_recipients_list = NULL;
  266|     32|  }
  267|       |
  268|  18.7k|  if(fuzz->mime != NULL) {
  ------------------
  |  Branch (268:6): [True: 537, False: 18.2k]
  ------------------
  269|    537|    curl_mime_free(fuzz->mime);
  270|    537|    fuzz->mime = NULL;
  271|    537|  }
  272|       |
  273|  18.7k|  if(fuzz->easy != NULL) {
  ------------------
  |  Branch (273:6): [True: 18.7k, False: 4]
  ------------------
  274|  18.7k|    curl_easy_cleanup(fuzz->easy);
  275|  18.7k|    fuzz->easy = NULL;
  276|  18.7k|  }
  277|       |
  278|       |  /* When you have passed the struct curl_httppost pointer to curl_easy_setopt
  279|       |   * (using the CURLOPT_HTTPPOST option), you must not free the list until after
  280|       |   *  you have called curl_easy_cleanup for the curl handle.
  281|       |   *  https://curl.se/libcurl/c/curl_formadd.html */
  282|  18.7k|  if (fuzz->httppost != NULL) {
  ------------------
  |  Branch (282:7): [True: 158, False: 18.6k]
  ------------------
  283|    158|    curl_formfree(fuzz->httppost);
  284|    158|    fuzz->httppost = NULL;
  285|    158|  }
  286|       |
  287|       |  // free after httppost and last_post_part.
  288|  18.7k|  if (fuzz->post_body != NULL) {
  ------------------
  |  Branch (288:7): [True: 158, False: 18.6k]
  ------------------
  289|    158|    fuzz_free((void **)&fuzz->post_body);
  290|    158|  }
  291|  18.7k|}
_Z9fuzz_freePPv:
  297|   224k|{
  298|   224k|  if(*ptr != NULL) {
  ------------------
  |  Branch (298:6): [True: 49.3k, False: 174k]
  ------------------
  299|  49.3k|    free(*ptr);
  300|       |    *ptr = NULL;
  301|  49.3k|  }
  302|   224k|}
_Z20fuzz_handle_transferP9fuzz_data:
  309|  17.2k|{
  310|  17.2k|  int rc = 0;
  311|  17.2k|  CURLM *multi_handle;
  312|  17.2k|  int still_running; /* keep number of running handles */
  313|  17.2k|  CURLMsg *msg; /* for picking up messages with the transfer status */
  314|  17.2k|  int msgs_left; /* how many messages are left */
  315|  17.2k|  int double_timeout = 0;
  316|  17.2k|  fd_set fdread;
  317|  17.2k|  fd_set fdwrite;
  318|  17.2k|  fd_set fdexcep;
  319|  17.2k|  struct timeval timeout;
  320|  17.2k|  int select_rc;
  321|  17.2k|  CURLMcode mc;
  322|  17.2k|  int maxfd = -1;
  323|  17.2k|  long curl_timeo = -1;
  324|  17.2k|  int ii;
  325|  17.2k|  FUZZ_SOCKET_MANAGER *sman[FUZZ_NUM_CONNECTIONS];
  326|       |
  327|  51.6k|  for(ii = 0; ii < FUZZ_NUM_CONNECTIONS; ii++) {
  ------------------
  |  |  307|  51.6k|#define FUZZ_NUM_CONNECTIONS            2
  ------------------
  |  Branch (327:15): [True: 34.4k, False: 17.2k]
  ------------------
  328|  34.4k|    sman[ii] = &fuzz->sockman[ii];
  329|       |
  330|       |    /* Set up the starting index for responses. */
  331|  34.4k|    sman[ii]->response_index = 1;
  332|  34.4k|  }
  333|       |
  334|       |  /* init a multi stack */
  335|  17.2k|  multi_handle = curl_multi_init();
  336|       |
  337|       |  /* add the individual transfers */
  338|  17.2k|  curl_multi_add_handle(multi_handle, fuzz->easy);
  339|       |
  340|       |  /* Do an initial process. This might end the transfer immediately. */
  341|  17.2k|  curl_multi_perform(multi_handle, &still_running);
  342|  17.2k|  FV_PRINTF(fuzz,
  ------------------
  |  |  530|  17.2k|        if((FUZZP)->verbose) {                                                \
  |  |  ------------------
  |  |  |  Branch (530:12): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  531|      0|          printf(__VA_ARGS__);                                                \
  |  |  532|      0|        }
  ------------------
  343|  17.2k|            "FUZZ: Initial perform; still running? %d \n",
  344|  17.2k|            still_running);
  345|       |
  346|  3.51M|  while(still_running) {
  ------------------
  |  Branch (346:9): [True: 3.50M, False: 16.8k]
  ------------------
  347|       |    /* Reset the sets of file descriptors. */
  348|  3.50M|    FD_ZERO(&fdread);
  ------------------
  |  Branch (348:5): [True: 56.0M, False: 3.50M]
  |  Branch (348:5): [Folded, False: 3.50M]
  ------------------
  349|  3.50M|    FD_ZERO(&fdwrite);
  ------------------
  |  Branch (349:5): [True: 56.0M, False: 3.50M]
  |  Branch (349:5): [Folded, False: 3.50M]
  ------------------
  350|  3.50M|    FD_ZERO(&fdexcep);
  ------------------
  |  Branch (350:5): [True: 56.0M, False: 3.50M]
  |  Branch (350:5): [Folded, False: 3.50M]
  ------------------
  351|       |
  352|       |    /* Set a timeout of 10ms. This is lower than recommended by the multi guide
  353|       |       but we're not going to any remote servers, so everything should complete
  354|       |       very quickly. */
  355|  3.50M|    timeout.tv_sec = 0;
  356|  3.50M|    timeout.tv_usec = 10000;
  357|       |
  358|       |    /* get file descriptors from the transfers */
  359|  3.50M|    mc = curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
  360|  3.50M|    if(mc != CURLM_OK) {
  ------------------
  |  Branch (360:8): [True: 0, False: 3.50M]
  ------------------
  361|      0|      fprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc);
  362|      0|      rc = -1;
  363|      0|      break;
  364|      0|    }
  365|       |
  366|  10.5M|    for(ii = 0; ii < FUZZ_NUM_CONNECTIONS; ii++) {
  ------------------
  |  |  307|  10.5M|#define FUZZ_NUM_CONNECTIONS            2
  ------------------
  |  Branch (366:17): [True: 7.00M, False: 3.50M]
  ------------------
  367|       |      /* Add the socket FD into the readable set if connected. */
  368|  7.00M|      if(sman[ii]->fd_state == FUZZ_SOCK_OPEN) {
  ------------------
  |  Branch (368:10): [True: 3.28M, False: 3.72M]
  ------------------
  369|  3.28M|        FD_SET(sman[ii]->fd, &fdread);
  370|       |
  371|       |        /* Work out the maximum FD between the cURL file descriptors and the
  372|       |           server FD. */
  373|  3.28M|        maxfd = FUZZ_MAX(sman[ii]->fd, maxfd);
  ------------------
  |  |  534|  3.28M|#define FUZZ_MAX(A, B) ((A) > (B) ? (A) : (B))
  |  |  ------------------
  |  |  |  Branch (534:25): [True: 32, False: 3.28M]
  |  |  ------------------
  ------------------
  374|  3.28M|      }
  375|  7.00M|    }
  376|       |
  377|       |    /* Work out what file descriptors need work. */
  378|  3.50M|    rc = fuzz_select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
  379|       |
  380|  3.50M|    if(rc == -1) {
  ------------------
  |  Branch (380:8): [True: 0, False: 3.50M]
  ------------------
  381|       |      /* Had an issue while selecting a file descriptor. Let's just exit. */
  382|      0|      FV_PRINTF(fuzz, "FUZZ: select failed, exiting \n");
  ------------------
  |  |  530|      0|        if((FUZZP)->verbose) {                                                \
  |  |  ------------------
  |  |  |  Branch (530:12): [True: 0, False: 0]
  |  |  ------------------
  |  |  531|      0|          printf(__VA_ARGS__);                                                \
  |  |  532|      0|        }
  ------------------
  383|      0|      break;
  384|      0|    }
  385|  3.50M|    else if(rc == 0) {
  ------------------
  |  Branch (385:13): [True: 904, False: 3.50M]
  ------------------
  386|    904|      FV_PRINTF(fuzz,
  ------------------
  |  |  530|    904|        if((FUZZP)->verbose) {                                                \
  |  |  ------------------
  |  |  |  Branch (530:12): [True: 0, False: 904]
  |  |  ------------------
  |  |  531|      0|          printf(__VA_ARGS__);                                                \
  |  |  532|      0|        }
  ------------------
  387|    904|                "FUZZ: Timed out; double timeout? %d \n",
  388|    904|                double_timeout);
  389|       |
  390|       |      /* Timed out. */
  391|    904|      if(double_timeout == 1) {
  ------------------
  |  Branch (391:10): [True: 338, False: 566]
  ------------------
  392|       |        /* We don't expect multiple timeouts in a row. If there are double
  393|       |           timeouts then exit. */
  394|    338|        break;
  395|    338|      }
  396|    566|      else {
  397|       |        /* Set the timeout flag for the next time we select(). */
  398|    566|        double_timeout = 1;
  399|    566|      }
  400|    904|    }
  401|  3.50M|    else {
  402|       |      /* There's an active file descriptor. Reset the timeout flag. */
  403|  3.50M|      double_timeout = 0;
  404|  3.50M|    }
  405|       |
  406|       |    /* Check to see if a server file descriptor is readable. If it is,
  407|       |       then send the next response from the fuzzing data. */
  408|  10.5M|    for(ii = 0; ii < FUZZ_NUM_CONNECTIONS; ii++) {
  ------------------
  |  |  307|  10.5M|#define FUZZ_NUM_CONNECTIONS            2
  ------------------
  |  Branch (408:17): [True: 7.00M, False: 3.50M]
  ------------------
  409|  7.00M|      if(sman[ii]->fd_state == FUZZ_SOCK_OPEN &&
  ------------------
  |  Branch (409:10): [True: 3.28M, False: 3.72M]
  ------------------
  410|  7.00M|         FD_ISSET(sman[ii]->fd, &fdread)) {
  ------------------
  |  Branch (410:10): [True: 2.50k, False: 3.27M]
  ------------------
  411|  2.50k|        rc = fuzz_send_next_response(fuzz, sman[ii]);
  412|  2.50k|        if(rc != 0) {
  ------------------
  |  Branch (412:12): [True: 12, False: 2.49k]
  ------------------
  413|       |          /* Failed to send a response. Break out here. */
  414|     12|          break;
  415|     12|        }
  416|  2.50k|      }
  417|  7.00M|    }
  418|       |
  419|  3.50M|    curl_multi_perform(multi_handle, &still_running);
  420|  3.50M|  }
  421|       |
  422|       |  /* Remove the easy handle from the multi stack. */
  423|  17.2k|  curl_multi_remove_handle(multi_handle, fuzz->easy);
  424|       |
  425|       |  /* Clean up the multi handle - the top level function will handle the easy
  426|       |     handle. */
  427|  17.2k|  curl_multi_cleanup(multi_handle);
  428|       |
  429|  17.2k|  return(rc);
  430|  17.2k|}
_Z23fuzz_send_next_responseP9fuzz_dataP19fuzz_socket_manager:
  436|  2.50k|{
  437|  2.50k|  int rc = 0;
  438|  2.50k|  ssize_t ret_in;
  439|  2.50k|  ssize_t ret_out;
  440|  2.50k|  char buffer[8192];
  441|  2.50k|  const uint8_t *data;
  442|  2.50k|  size_t data_len;
  443|       |
  444|       |  /* Need to read all data sent by the client so the file descriptor becomes
  445|       |     unreadable. Because the file descriptor is non-blocking we won't just
  446|       |     hang here. */
  447|  5.79k|  do {
  448|  5.79k|    ret_in = read(sman->fd, buffer, sizeof(buffer));
  449|  5.79k|    if(fuzz->verbose && ret_in > 0) {
  ------------------
  |  Branch (449:8): [True: 0, False: 5.79k]
  |  Branch (449:25): [True: 0, False: 0]
  ------------------
  450|      0|      printf("FUZZ[%d]: Received %zu bytes \n==>\n", sman->index, ret_in);
  451|      0|      fwrite(buffer, ret_in, 1, stdout);
  452|      0|      printf("\n<==\n");
  453|      0|    }
  454|  5.79k|  } while (ret_in > 0);
  ------------------
  |  Branch (454:12): [True: 3.28k, False: 2.50k]
  ------------------
  455|       |
  456|       |  /* Now send a response to the request that the client just made. */
  457|  2.50k|  FV_PRINTF(fuzz,
  ------------------
  |  |  530|  2.50k|        if((FUZZP)->verbose) {                                                \
  |  |  ------------------
  |  |  |  Branch (530:12): [True: 0, False: 2.50k]
  |  |  ------------------
  |  |  531|      0|          printf(__VA_ARGS__);                                                \
  |  |  532|      0|        }
  ------------------
  458|  2.50k|            "FUZZ[%d]: Sending next response: %d \n",
  459|  2.50k|            sman->index,
  460|  2.50k|            sman->response_index);
  461|  2.50k|  data = sman->responses[sman->response_index].data;
  462|  2.50k|  data_len = sman->responses[sman->response_index].data_len;
  463|       |
  464|  2.50k|  if(data != NULL) {
  ------------------
  |  Branch (464:6): [True: 2.50k, False: 0]
  ------------------
  465|  2.50k|    if(write(sman->fd, data, data_len) != (ssize_t)data_len) {
  ------------------
  |  Branch (465:8): [True: 12, False: 2.49k]
  ------------------
  466|       |      /* Failed to write the data back to the client. Prevent any further
  467|       |         testing. */
  468|     12|      rc = -1;
  469|     12|    }
  470|  2.50k|  }
  471|       |
  472|       |  /* Work out if there are any more responses. If not, then shut down the
  473|       |     server. */
  474|  2.50k|  sman->response_index++;
  475|       |
  476|  2.50k|  if(sman->response_index >= TLV_MAX_NUM_RESPONSES ||
  ------------------
  |  |  298|  5.01k|#define TLV_MAX_NUM_RESPONSES           11
  ------------------
  |  Branch (476:6): [True: 0, False: 2.50k]
  ------------------
  477|  2.50k|     sman->responses[sman->response_index].data == NULL) {
  ------------------
  |  Branch (477:6): [True: 1.04k, False: 1.46k]
  ------------------
  478|  1.04k|    FV_PRINTF(fuzz,
  ------------------
  |  |  530|  1.04k|        if((FUZZP)->verbose) {                                                \
  |  |  ------------------
  |  |  |  Branch (530:12): [True: 0, False: 1.04k]
  |  |  ------------------
  |  |  531|      0|          printf(__VA_ARGS__);                                                \
  |  |  532|      0|        }
  ------------------
  479|  1.04k|              "FUZZ[%d]: Shutting down server socket: %d \n",
  480|  1.04k|              sman->index,
  481|  1.04k|              sman->fd);
  482|  1.04k|    shutdown(sman->fd, SHUT_WR);
  483|  1.04k|    sman->fd_state = FUZZ_SOCK_SHUTDOWN;
  484|  1.04k|  }
  485|       |
  486|  2.50k|  return(rc);
  487|  2.50k|}
_Z11fuzz_selectiP6fd_setS0_S0_P7timeval:
  496|  3.50M|                struct timeval *timeout) {
  497|  3.50M|  return select(nfds, readfds, writefds, exceptfds, timeout);
  498|  3.50M|}
_Z26fuzz_set_allowed_protocolsP9fuzz_data:
  506|  17.2k|{
  507|  17.2k|  int rc = 0;
  508|  17.2k|  const char *allowed_protocols = "";
  509|       |
  510|       |#ifdef FUZZ_PROTOCOLS_ALL
  511|       |  /* Do not allow telnet currently as it accepts input from stdin. */
  512|       |  allowed_protocols =
  513|       |    "dict,file,ftp,ftps,gopher,gophers,http,https,imap,imaps,"
  514|       |    "mqtt,pop3,pop3s,"
  515|       |    "ldap,ldaps,"
  516|       |    "rtmp,rtmpe,rtmps,rtmpt,rtmpte,rtmpts,"
  517|       |    "scp,"
  518|       |    "sftp,"
  519|       |    "rtsp,smb,smbs,smtp,smtps,tftp,"
  520|       |    "ws,wss";
  521|       |#endif
  522|       |#ifdef FUZZ_PROTOCOLS_DICT
  523|       |  allowed_protocols = "dict";
  524|       |#endif
  525|       |#ifdef FUZZ_PROTOCOLS_FILE
  526|       |  allowed_protocols = "file";
  527|       |#endif
  528|  17.2k|#ifdef FUZZ_PROTOCOLS_FTP
  529|  17.2k|  allowed_protocols = "ftp,ftps";
  530|  17.2k|#endif
  531|       |#ifdef FUZZ_PROTOCOLS_GOPHER
  532|       |  allowed_protocols = "gopher,gophers";
  533|       |#endif
  534|       |#ifdef FUZZ_PROTOCOLS_HTTP
  535|       |  allowed_protocols = "http";
  536|       |#endif
  537|       |#ifdef FUZZ_PROTOCOLS_HTTPS
  538|       |  allowed_protocols = "https";
  539|       |#endif
  540|       |#ifdef FUZZ_PROTOCOLS_IMAP
  541|       |  allowed_protocols = "imap,imaps";
  542|       |#endif
  543|       |#ifdef FUZZ_PROTOCOLS_LDAP
  544|       |  allowed_protocols = "ldap,ldaps";
  545|       |#endif
  546|       |#ifdef FUZZ_PROTOCOLS_MQTT
  547|       |  allowed_protocols = "mqtt";
  548|       |#endif
  549|       |#ifdef FUZZ_PROTOCOLS_POP3
  550|       |  allowed_protocols = "pop3,pop3s";
  551|       |#endif
  552|       |#ifdef FUZZ_PROTOCOLS_RTMP
  553|       |  allowed_protocols = "rtmp,rtmpe,rtmps,rtmpt,rtmpte,rtmpts";
  554|       |#endif
  555|       |#ifdef FUZZ_PROTOCOLS_RTSP
  556|       |  allowed_protocols = "rtsp";
  557|       |#endif
  558|       |#ifdef FUZZ_PROTOCOLS_SCP
  559|       |  allowed_protocols = "scp";
  560|       |#endif
  561|       |#ifdef FUZZ_PROTOCOLS_SFTP
  562|       |  allowed_protocols = "sftp";
  563|       |#endif
  564|       |#ifdef FUZZ_PROTOCOLS_SMB
  565|       |  allowed_protocols = "smb,smbs";
  566|       |#endif
  567|       |#ifdef FUZZ_PROTOCOLS_SMTP
  568|       |  allowed_protocols = "smtp,smtps";
  569|       |#endif
  570|       |#ifdef FUZZ_PROTOCOLS_TFTP
  571|       |  allowed_protocols = "tftp";
  572|       |#endif
  573|       |#ifdef FUZZ_PROTOCOLS_WS
  574|       |  // http is required by websockets
  575|       |  allowed_protocols = "http,ws,wss";
  576|       |  FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_CONNECT_ONLY, 2L));
  577|       |#endif
  578|       |
  579|  17.2k|  FTRY(curl_easy_setopt(fuzz->easy, CURLOPT_PROTOCOLS_STR, allowed_protocols));
  ------------------
  |  |  480|  17.2k|        {                                                                     \
  |  |  481|  17.2k|          int _func_rc = (FUNC);                                              \
  |  |  482|  17.2k|          if (_func_rc)                                                       \
  |  |  ------------------
  |  |  |  Branch (482:15): [True: 0, False: 17.2k]
  |  |  ------------------
  |  |  483|  17.2k|          {                                                                   \
  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  486|      0|          }                                                                   \
  |  |  487|  17.2k|        }
  ------------------
  580|       |
  581|  17.2k|EXIT_LABEL:
  582|       |
  583|  17.2k|  return rc;
  584|  17.2k|}

_Z16fuzz_open_socketPv12curlsocktypeP13curl_sockaddr:
   42|  14.0k|{
   43|  14.0k|  FUZZ_DATA *fuzz = (FUZZ_DATA *)ptr;
   44|  14.0k|  int fds[2];
   45|  14.0k|  int flags;
   46|  14.0k|  int status;
   47|  14.0k|  const uint8_t *data;
   48|  14.0k|  size_t data_len;
   49|  14.0k|  struct sockaddr_un client_addr;
   50|  14.0k|  FUZZ_SOCKET_MANAGER *sman;
   51|       |
   52|       |  /* Handle unused parameters */
   53|  14.0k|  (void)purpose;
   54|  14.0k|  (void)address;
   55|       |
   56|  14.0k|  if(fuzz->sockman[0].fd_state != FUZZ_SOCK_CLOSED &&
  ------------------
  |  Branch (56:6): [True: 1.78k, False: 12.2k]
  ------------------
   57|  1.78k|     fuzz->sockman[1].fd_state != FUZZ_SOCK_CLOSED) {
  ------------------
  |  Branch (57:6): [True: 75, False: 1.71k]
  ------------------
   58|       |    /* Both sockets have already been opened. */
   59|     75|    return CURL_SOCKET_BAD;
  ------------------
  |  |  145|     75|#define CURL_SOCKET_BAD (-1)
  ------------------
   60|     75|  }
   61|  13.9k|  else if(fuzz->sockman[0].fd_state != FUZZ_SOCK_CLOSED) {
  ------------------
  |  Branch (61:11): [True: 1.71k, False: 12.2k]
  ------------------
   62|  1.71k|    sman = &fuzz->sockman[1];
   63|  1.71k|  }
   64|  12.2k|  else {
   65|  12.2k|    FV_PRINTF(fuzz, "FUZZ: Using socket manager 0 \n");
  ------------------
  |  |  530|  12.2k|        if((FUZZP)->verbose) {                                                \
  |  |  ------------------
  |  |  |  Branch (530:12): [True: 0, False: 12.2k]
  |  |  ------------------
  |  |  531|      0|          printf(__VA_ARGS__);                                                \
  |  |  532|      0|        }
  ------------------
   66|  12.2k|    sman = &fuzz->sockman[0];
   67|  12.2k|  }
   68|  13.9k|  FV_PRINTF(fuzz, "FUZZ[%d]: Using socket manager %d \n",
  ------------------
  |  |  530|  13.9k|        if((FUZZP)->verbose) {                                                \
  |  |  ------------------
  |  |  |  Branch (530:12): [True: 0, False: 13.9k]
  |  |  ------------------
  |  |  531|      0|          printf(__VA_ARGS__);                                                \
  |  |  532|      0|        }
  ------------------
   69|  13.9k|            sman->index,
   70|  13.9k|            sman->index);
   71|       |
   72|  13.9k|  if(socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) {
  ------------------
  |  Branch (72:6): [True: 0, False: 13.9k]
  ------------------
   73|       |    /* Failed to create a pair of sockets. */
   74|      0|    return CURL_SOCKET_BAD;
  ------------------
  |  |  145|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
   75|      0|  }
   76|       |
   77|  13.9k|  if(!FUZZ_VALID_SOCK(fds[0]) || !FUZZ_VALID_SOCK(fds[1])) {
  ------------------
  |  |   34|  27.8k|#define FUZZ_VALID_SOCK(s) (((s) >= 0) && ((s) < FD_SETSIZE))
  |  |  ------------------
  |  |  |  Branch (34:29): [True: 13.9k, False: 0]
  |  |  |  Branch (34:43): [True: 13.9k, False: 0]
  |  |  ------------------
  ------------------
                if(!FUZZ_VALID_SOCK(fds[0]) || !FUZZ_VALID_SOCK(fds[1])) {
  ------------------
  |  |   34|  13.9k|#define FUZZ_VALID_SOCK(s) (((s) >= 0) && ((s) < FD_SETSIZE))
  |  |  ------------------
  |  |  |  Branch (34:29): [True: 13.9k, False: 0]
  |  |  |  Branch (34:43): [True: 13.9k, False: 0]
  |  |  ------------------
  ------------------
   78|       |    /* One or more of the file descriptors is too large to fit in an fd_set,
   79|       |       so reject it here. Print out a message because this ought to be quite
   80|       |       rare. */
   81|      0|    printf("FUZZ[%d]: Not using file descriptors %d,%d as FD_SETSIZE is %d\n",
   82|      0|           sman->index,
   83|      0|           fds[0],
   84|      0|           fds[1],
   85|      0|           FD_SETSIZE);
   86|       |
   87|       |    /* Close the file descriptors so they don't leak. */
   88|      0|    close(fds[0]);
   89|      0|    close(fds[1]);
   90|       |
   91|      0|    return CURL_SOCKET_BAD;
  ------------------
  |  |  145|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
   92|      0|  }
   93|       |
   94|       |  /* Make the server non-blocking. */
   95|  13.9k|  flags = fcntl(fds[0], F_GETFL, 0);
   96|  13.9k|  status = fcntl(fds[0], F_SETFL, flags | O_NONBLOCK);
   97|       |
   98|  13.9k|  if(status == -1) {
  ------------------
  |  Branch (98:6): [True: 0, False: 13.9k]
  ------------------
   99|       |    /* Close the file descriptors so they don't leak. */
  100|      0|    close(fds[0]);
  101|      0|    close(fds[1]);
  102|       |
  103|       |    /* Setting non-blocking failed. Return a negative response code. */
  104|      0|    return CURL_SOCKET_BAD;
  ------------------
  |  |  145|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  105|      0|  }
  106|       |
  107|       |  /* At this point, the file descriptors in hand should be good enough to
  108|       |     work with. */
  109|  13.9k|  sman->fd = fds[0];
  110|  13.9k|  sman->fd_state = FUZZ_SOCK_OPEN;
  111|       |
  112|       |  /* If the server should be sending data immediately, send it here. */
  113|  13.9k|  data = sman->responses[0].data;
  114|  13.9k|  data_len = sman->responses[0].data_len;
  115|       |
  116|  13.9k|  if(data != NULL) {
  ------------------
  |  Branch (116:6): [True: 9.29k, False: 4.62k]
  ------------------
  117|  9.29k|    FV_PRINTF(fuzz, "FUZZ[%d]: Sending initial response \n", sman->index);
  ------------------
  |  |  530|  9.29k|        if((FUZZP)->verbose) {                                                \
  |  |  ------------------
  |  |  |  Branch (530:12): [True: 0, False: 9.29k]
  |  |  ------------------
  |  |  531|      0|          printf(__VA_ARGS__);                                                \
  |  |  532|      0|        }
  ------------------
  118|       |
  119|  9.29k|    if(write(sman->fd, data, data_len) != (ssize_t)data_len) {
  ------------------
  |  Branch (119:8): [True: 0, False: 9.29k]
  ------------------
  120|       |      /* Close the file descriptors so they don't leak. */
  121|      0|      close(sman->fd);
  122|      0|      sman->fd = -1;
  123|       |
  124|      0|      close(fds[1]);
  125|       |
  126|       |      /* Failed to write all of the response data. */
  127|      0|      return CURL_SOCKET_BAD;
  ------------------
  |  |  145|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  128|      0|    }
  129|  9.29k|  }
  130|       |
  131|       |  /* Check to see if the socket should be shut down immediately. */
  132|  13.9k|  if(sman->responses[1].data == NULL) {
  ------------------
  |  Branch (132:6): [True: 12.3k, False: 1.59k]
  ------------------
  133|  12.3k|    FV_PRINTF(fuzz,
  ------------------
  |  |  530|  12.3k|        if((FUZZP)->verbose) {                                                \
  |  |  ------------------
  |  |  |  Branch (530:12): [True: 0, False: 12.3k]
  |  |  ------------------
  |  |  531|      0|          printf(__VA_ARGS__);                                                \
  |  |  532|      0|        }
  ------------------
  134|  12.3k|              "FUZZ[%d]: Shutting down server socket: %d \n",
  135|  12.3k|              sman->index,
  136|  12.3k|              sman->fd);
  137|  12.3k|    shutdown(sman->fd, SHUT_WR);
  138|  12.3k|    sman->fd_state = FUZZ_SOCK_SHUTDOWN;
  139|  12.3k|  }
  140|       |
  141|       |  /* Return the other half of the socket pair. */
  142|  13.9k|  return fds[1];
  143|  13.9k|}
_Z21fuzz_sockopt_callbackPvi12curlsocktype:
  152|  13.9k|{
  153|  13.9k|  (void)ptr;
  154|  13.9k|  (void)curlfd;
  155|  13.9k|  (void)purpose;
  156|       |
  157|  13.9k|  return CURL_SOCKOPT_ALREADY_CONNECTED;
  ------------------
  |  |  421|  13.9k|#define CURL_SOCKOPT_ALREADY_CONNECTED 2
  ------------------
  158|  13.9k|}
_Z18fuzz_read_callbackPcmmPv:
  167|    267|{
  168|    267|  FUZZ_DATA *fuzz = (FUZZ_DATA *)ptr;
  169|    267|  size_t remaining_data;
  170|    267|  size_t buffer_size = size * nitems;
  171|       |
  172|       |  /* If no upload data has been specified, then return an error code. */
  173|    267|  if(fuzz->upload1_data_len == 0) {
  ------------------
  |  Branch (173:6): [True: 15, False: 252]
  ------------------
  174|       |    /* No data to upload */
  175|     15|    return CURL_READFUNC_ABORT;
  ------------------
  |  |  390|     15|#define CURL_READFUNC_ABORT 0x10000000
  ------------------
  176|     15|  }
  177|       |
  178|       |  /* Work out how much data is remaining to upload. */
  179|    252|  remaining_data = fuzz->upload1_data_len - fuzz->upload1_data_written;
  180|       |
  181|       |  /* Respect the buffer size that libcurl is giving us! */
  182|    252|  if(remaining_data > buffer_size) {
  ------------------
  |  Branch (182:6): [True: 37, False: 215]
  ------------------
  183|     37|    remaining_data = buffer_size;
  184|     37|  }
  185|       |
  186|    252|  if(remaining_data > 0) {
  ------------------
  |  Branch (186:6): [True: 220, False: 32]
  ------------------
  187|    220|    FV_PRINTF(fuzz,
  ------------------
  |  |  530|    220|        if((FUZZP)->verbose) {                                                \
  |  |  ------------------
  |  |  |  Branch (530:12): [True: 0, False: 220]
  |  |  ------------------
  |  |  531|      0|          printf(__VA_ARGS__);                                                \
  |  |  532|      0|        }
  ------------------
  188|    220|              "FUZZ: Uploading %zu bytes from position %zu \n",
  189|    220|              remaining_data,
  190|    220|              fuzz->upload1_data_written);
  191|       |
  192|       |    /* Send the upload data. */
  193|    220|    memcpy(buffer,
  194|    220|           &fuzz->upload1_data[fuzz->upload1_data_written],
  195|    220|           remaining_data);
  196|       |
  197|       |    /* Increase the count of written data */
  198|    220|    fuzz->upload1_data_written += remaining_data;
  199|    220|  }
  200|       |
  201|    252|  return(remaining_data);
  202|    267|}
_Z19fuzz_write_callbackPvmmS_:
  211|  8.01k|{
  212|  8.01k|  size_t total = size * nmemb;
  213|  8.01k|  FUZZ_DATA *fuzz = (FUZZ_DATA *)ptr;
  214|  8.01k|  size_t copy_len = total;
  215|       |
  216|       |  /* Restrict copy_len to at most TEMP_WRITE_ARRAY_SIZE. */
  217|  8.01k|  if(copy_len > TEMP_WRITE_ARRAY_SIZE) {
  ------------------
  |  |  271|  8.01k|#define TEMP_WRITE_ARRAY_SIZE           10
  ------------------
  |  Branch (217:6): [True: 5.18k, False: 2.82k]
  ------------------
  218|  5.18k|    copy_len = TEMP_WRITE_ARRAY_SIZE;
  ------------------
  |  |  271|  5.18k|#define TEMP_WRITE_ARRAY_SIZE           10
  ------------------
  219|  5.18k|  }
  220|       |
  221|       |  /* Copy bytes to the temp store just to ensure the parameters are
  222|       |     exercised. */
  223|  8.01k|  memcpy(fuzz->write_array, contents, copy_len);
  224|       |
  225|       |  /* Add on the total to the count. If it exceeds the maximum then return
  226|       |     zero to the caller so that the transfer is terminated early. */
  227|  8.01k|  fuzz->written_data += total;
  228|       |
  229|  8.01k|  if(fuzz->written_data > MAXIMUM_WRITE_LENGTH) {
  ------------------
  |  |  274|  8.01k|#define MAXIMUM_WRITE_LENGTH            52428800
  ------------------
  |  Branch (229:6): [True: 0, False: 8.01k]
  ------------------
  230|      0|    FV_PRINTF(fuzz,
  ------------------
  |  |  530|      0|        if((FUZZP)->verbose) {                                                \
  |  |  ------------------
  |  |  |  Branch (530:12): [True: 0, False: 0]
  |  |  ------------------
  |  |  531|      0|          printf(__VA_ARGS__);                                                \
  |  |  532|      0|        }
  ------------------
  231|      0|              "FUZZ: Exceeded maximum write length (%zu) \n",
  232|      0|              fuzz->written_data);
  233|      0|    total = 0;
  234|      0|  }
  235|       |
  236|  8.01k|  return total;
  237|  8.01k|}

_Z18fuzz_get_first_tlvP9fuzz_dataP3tlv:
   32|  21.2k|{
   33|       |  /* Reset the cursor. */
   34|  21.2k|  fuzz->state.data_pos = 0;
   35|  21.2k|  return fuzz_get_tlv_comn(fuzz, tlv);
   36|  21.2k|}
_Z17fuzz_get_next_tlvP9fuzz_dataP3tlv:
   43|   204k|{
   44|       |  /* Advance the cursor by the full length of the previous TLV. */
   45|   204k|  fuzz->state.data_pos += sizeof(TLV_RAW) + tlv->length;
   46|       |
   47|       |  /* Work out if there's a TLV's worth of data to read */
   48|   204k|  if(fuzz->state.data_pos + sizeof(TLV_RAW) > fuzz->state.data_len) {
  ------------------
  |  Branch (48:6): [True: 17.7k, False: 186k]
  ------------------
   49|       |    /* No more TLVs to parse */
   50|  17.7k|    return TLV_RC_NO_MORE_TLVS;
  ------------------
  |  |  267|  17.7k|#define TLV_RC_NO_MORE_TLVS             1
  ------------------
   51|  17.7k|  }
   52|       |
   53|   186k|  return fuzz_get_tlv_comn(fuzz, tlv);
   54|   204k|}
_Z17fuzz_get_tlv_comnP9fuzz_dataP3tlv:
   61|   208k|{
   62|   208k|  int rc = 0;
   63|   208k|  size_t data_offset;
   64|   208k|  TLV_RAW *raw;
   65|       |
   66|       |  /* Start by casting the data stream to a TLV. */
   67|   208k|  raw = (TLV_RAW *)&fuzz->state.data[fuzz->state.data_pos];
   68|   208k|  data_offset = fuzz->state.data_pos + sizeof(TLV_RAW);
   69|       |
   70|       |  /* Set the TLV values. */
   71|   208k|  tlv->type = to_u16(raw->raw_type);
   72|   208k|  tlv->length = to_u32(raw->raw_length);
   73|   208k|  tlv->value = &fuzz->state.data[data_offset];
   74|       |
   75|   208k|  FV_PRINTF(fuzz, "TLV: type %x length %u\n", tlv->type, tlv->length);
  ------------------
  |  |  530|   208k|        if((FUZZP)->verbose) {                                                \
  |  |  ------------------
  |  |  |  Branch (530:12): [True: 0, False: 208k]
  |  |  ------------------
  |  |  531|      0|          printf(__VA_ARGS__);                                                \
  |  |  532|      0|        }
  ------------------
   76|       |
   77|       |  /* Use uint64s to verify lengths of TLVs so that overflow problems don't
   78|       |     matter. */
   79|   208k|  uint64_t check_length = data_offset;
   80|   208k|  check_length += tlv->length;
   81|       |
   82|   208k|  uint64_t remaining_len = fuzz->state.data_len;
   83|   208k|  FV_PRINTF(fuzz, "Check length of data: %" PRIu64 " \n", check_length);
  ------------------
  |  |  530|   208k|        if((FUZZP)->verbose) {                                                \
  |  |  ------------------
  |  |  |  Branch (530:12): [True: 0, False: 208k]
  |  |  ------------------
  |  |  531|      0|          printf(__VA_ARGS__);                                                \
  |  |  532|      0|        }
  ------------------
   84|   208k|  FV_PRINTF(fuzz, "Remaining length of data: %" PRIu64 " \n", remaining_len);
  ------------------
  |  |  530|   208k|        if((FUZZP)->verbose) {                                                \
  |  |  ------------------
  |  |  |  Branch (530:12): [True: 0, False: 208k]
  |  |  ------------------
  |  |  531|      0|          printf(__VA_ARGS__);                                                \
  |  |  532|      0|        }
  ------------------
   85|       |
   86|       |  /* Sanity check that the TLV length is ok. */
   87|   208k|  if(check_length > remaining_len) {
  ------------------
  |  Branch (87:6): [True: 1.65k, False: 206k]
  ------------------
   88|  1.65k|    FV_PRINTF(fuzz, "Returning TLV_RC_SIZE_ERROR\n");
  ------------------
  |  |  530|  1.65k|        if((FUZZP)->verbose) {                                                \
  |  |  ------------------
  |  |  |  Branch (530:12): [True: 0, False: 1.65k]
  |  |  ------------------
  |  |  531|      0|          printf(__VA_ARGS__);                                                \
  |  |  532|      0|        }
  ------------------
   89|  1.65k|    rc = TLV_RC_SIZE_ERROR;
  ------------------
  |  |  268|  1.65k|#define TLV_RC_SIZE_ERROR               2
  ------------------
   90|  1.65k|  }
   91|       |
   92|   208k|  return rc;
   93|   208k|}
_Z14fuzz_parse_tlvP9fuzz_dataP3tlv:
   99|   204k|{
  100|   204k|  int rc;
  101|   204k|  char *tmp = NULL;
  102|   204k|  uint32_t tmp_u32;
  103|   204k|  curl_slist *new_list;
  104|       |
  105|   204k|  switch(tlv->type) {
  106|       |    /* The pointers in response TLVs will always be valid as long as the fuzz
  107|       |       data is in scope, which is the entirety of this file. */
  108|  9.33k|    FRESPONSETLV(&fuzz->sockman[0], TLV_TYPE_RESPONSE0, 0);
  ------------------
  |  |  513|  9.33k|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (513:9): [True: 9.33k, False: 195k]
  |  |  ------------------
  |  |  514|  9.33k|          (SMAN)->responses[(INDEX)].data = tlv->value;                       \
  |  |  515|  9.33k|          (SMAN)->responses[(INDEX)].data_len = tlv->length;                  \
  |  |  516|  9.33k|          break
  ------------------
  109|  1.70k|    FRESPONSETLV(&fuzz->sockman[0], TLV_TYPE_RESPONSE1, 1);
  ------------------
  |  |  513|  1.70k|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (513:9): [True: 1.70k, False: 202k]
  |  |  ------------------
  |  |  514|  1.70k|          (SMAN)->responses[(INDEX)].data = tlv->value;                       \
  |  |  515|  1.70k|          (SMAN)->responses[(INDEX)].data_len = tlv->length;                  \
  |  |  516|  1.70k|          break
  ------------------
  110|    925|    FRESPONSETLV(&fuzz->sockman[0], TLV_TYPE_RESPONSE2, 2);
  ------------------
  |  |  513|    925|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (513:9): [True: 925, False: 203k]
  |  |  ------------------
  |  |  514|    925|          (SMAN)->responses[(INDEX)].data = tlv->value;                       \
  |  |  515|    925|          (SMAN)->responses[(INDEX)].data_len = tlv->length;                  \
  |  |  516|    925|          break
  ------------------
  111|    507|    FRESPONSETLV(&fuzz->sockman[0], TLV_TYPE_RESPONSE3, 3);
  ------------------
  |  |  513|    507|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (513:9): [True: 507, False: 204k]
  |  |  ------------------
  |  |  514|    507|          (SMAN)->responses[(INDEX)].data = tlv->value;                       \
  |  |  515|    507|          (SMAN)->responses[(INDEX)].data_len = tlv->length;                  \
  |  |  516|    507|          break
  ------------------
  112|    452|    FRESPONSETLV(&fuzz->sockman[0], TLV_TYPE_RESPONSE4, 4);
  ------------------
  |  |  513|    452|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (513:9): [True: 452, False: 204k]
  |  |  ------------------
  |  |  514|    452|          (SMAN)->responses[(INDEX)].data = tlv->value;                       \
  |  |  515|    452|          (SMAN)->responses[(INDEX)].data_len = tlv->length;                  \
  |  |  516|    452|          break
  ------------------
  113|    421|    FRESPONSETLV(&fuzz->sockman[0], TLV_TYPE_RESPONSE5, 5);
  ------------------
  |  |  513|    421|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (513:9): [True: 421, False: 204k]
  |  |  ------------------
  |  |  514|    421|          (SMAN)->responses[(INDEX)].data = tlv->value;                       \
  |  |  515|    421|          (SMAN)->responses[(INDEX)].data_len = tlv->length;                  \
  |  |  516|    421|          break
  ------------------
  114|    393|    FRESPONSETLV(&fuzz->sockman[0], TLV_TYPE_RESPONSE6, 6);
  ------------------
  |  |  513|    393|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (513:9): [True: 393, False: 204k]
  |  |  ------------------
  |  |  514|    393|          (SMAN)->responses[(INDEX)].data = tlv->value;                       \
  |  |  515|    393|          (SMAN)->responses[(INDEX)].data_len = tlv->length;                  \
  |  |  516|    393|          break
  ------------------
  115|    331|    FRESPONSETLV(&fuzz->sockman[0], TLV_TYPE_RESPONSE7, 7);
  ------------------
  |  |  513|    331|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (513:9): [True: 331, False: 204k]
  |  |  ------------------
  |  |  514|    331|          (SMAN)->responses[(INDEX)].data = tlv->value;                       \
  |  |  515|    331|          (SMAN)->responses[(INDEX)].data_len = tlv->length;                  \
  |  |  516|    331|          break
  ------------------
  116|    285|    FRESPONSETLV(&fuzz->sockman[0], TLV_TYPE_RESPONSE8, 8);
  ------------------
  |  |  513|    285|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (513:9): [True: 285, False: 204k]
  |  |  ------------------
  |  |  514|    285|          (SMAN)->responses[(INDEX)].data = tlv->value;                       \
  |  |  515|    285|          (SMAN)->responses[(INDEX)].data_len = tlv->length;                  \
  |  |  516|    285|          break
  ------------------
  117|    196|    FRESPONSETLV(&fuzz->sockman[0], TLV_TYPE_RESPONSE9, 9);
  ------------------
  |  |  513|    196|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (513:9): [True: 196, False: 204k]
  |  |  ------------------
  |  |  514|    196|          (SMAN)->responses[(INDEX)].data = tlv->value;                       \
  |  |  515|    196|          (SMAN)->responses[(INDEX)].data_len = tlv->length;                  \
  |  |  516|    196|          break
  ------------------
  118|    200|    FRESPONSETLV(&fuzz->sockman[0], TLV_TYPE_RESPONSE10, 10);
  ------------------
  |  |  513|    200|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (513:9): [True: 200, False: 204k]
  |  |  ------------------
  |  |  514|    200|          (SMAN)->responses[(INDEX)].data = tlv->value;                       \
  |  |  515|    200|          (SMAN)->responses[(INDEX)].data_len = tlv->length;                  \
  |  |  516|    200|          break
  ------------------
  119|       |
  120|    771|    FRESPONSETLV(&fuzz->sockman[1], TLV_TYPE_SECOND_RESPONSE0, 0);
  ------------------
  |  |  513|    771|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (513:9): [True: 771, False: 203k]
  |  |  ------------------
  |  |  514|    771|          (SMAN)->responses[(INDEX)].data = tlv->value;                       \
  |  |  515|    771|          (SMAN)->responses[(INDEX)].data_len = tlv->length;                  \
  |  |  516|    771|          break
  ------------------
  121|    556|    FRESPONSETLV(&fuzz->sockman[1], TLV_TYPE_SECOND_RESPONSE1, 1);
  ------------------
  |  |  513|    556|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (513:9): [True: 556, False: 204k]
  |  |  ------------------
  |  |  514|    556|          (SMAN)->responses[(INDEX)].data = tlv->value;                       \
  |  |  515|    556|          (SMAN)->responses[(INDEX)].data_len = tlv->length;                  \
  |  |  516|    556|          break
  ------------------
  122|       |
  123|    389|    case TLV_TYPE_UPLOAD1:
  ------------------
  |  |   36|    389|#define TLV_TYPE_UPLOAD1                        8
  ------------------
  |  Branch (123:5): [True: 389, False: 204k]
  ------------------
  124|       |      /* The pointers in the TLV will always be valid as long as the fuzz data
  125|       |         is in scope, which is the entirety of this file. */
  126|       |
  127|    389|      FCHECK_OPTION_UNSET(fuzz, CURLOPT_UPLOAD);
  ------------------
  |  |  503|    389|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  ------------------
  |  |  |  |  490|    389|        {                                                                     \
  |  |  |  |  491|    389|          if (!(COND))                                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (491:15): [True: 1, False: 388]
  |  |  |  |  ------------------
  |  |  |  |  492|    389|          {                                                                   \
  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  496|    389|        }
  |  |  ------------------
  ------------------
  128|       |
  129|    388|      fuzz->upload1_data = tlv->value;
  130|    388|      fuzz->upload1_data_len = tlv->length;
  131|       |
  132|    388|      FSET_OPTION(fuzz, CURLOPT_UPLOAD, 1L);
  ------------------
  |  |  499|    388|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  ------------------
  |  |  |  |  480|    388|        {                                                                     \
  |  |  |  |  481|    388|          int _func_rc = (FUNC);                                              \
  |  |  |  |  482|    388|          if (_func_rc)                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (482:15): [True: 0, False: 388]
  |  |  |  |  ------------------
  |  |  |  |  483|    388|          {                                                                   \
  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  487|    388|        }
  |  |  ------------------
  |  |  500|    388|        (FUZZP)->options[OPTNAME % 1000] = 1
  ------------------
  133|    388|      FSET_OPTION(fuzz,
  ------------------
  |  |  499|    388|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  ------------------
  |  |  |  |  480|    388|        {                                                                     \
  |  |  |  |  481|    388|          int _func_rc = (FUNC);                                              \
  |  |  |  |  482|    388|          if (_func_rc)                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (482:15): [True: 0, False: 388]
  |  |  |  |  ------------------
  |  |  |  |  483|    388|          {                                                                   \
  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  487|    388|        }
  |  |  ------------------
  |  |  500|    388|        (FUZZP)->options[OPTNAME % 1000] = 1
  ------------------
  134|    388|                  CURLOPT_INFILESIZE_LARGE,
  135|    388|                  (curl_off_t)fuzz->upload1_data_len);
  136|    388|      break;
  137|       |
  138|  14.7k|    case TLV_TYPE_HEADER:
  ------------------
  |  |   34|  14.7k|#define TLV_TYPE_HEADER                         6
  ------------------
  |  Branch (138:5): [True: 14.7k, False: 189k]
  ------------------
  139|       |      /* Limit the number of headers that can be added to a message to prevent
  140|       |         timeouts. */
  141|  14.7k|      if(fuzz->header_list_count >= TLV_MAX_NUM_CURLOPT_HEADER) {
  ------------------
  |  |  301|  14.7k|#define TLV_MAX_NUM_CURLOPT_HEADER      2000
  ------------------
  |  Branch (141:10): [True: 1, False: 14.7k]
  ------------------
  142|      1|        rc = 255;
  143|      1|        goto EXIT_LABEL;
  144|      1|      }
  145|       |
  146|  14.7k|      tmp = fuzz_tlv_to_string(tlv);
  147|  14.7k|      if (tmp == NULL) {
  ------------------
  |  Branch (147:11): [True: 0, False: 14.7k]
  ------------------
  148|       |        // keep on despite allocation failure
  149|      0|        break;
  150|      0|      }
  151|  14.7k|      new_list = curl_slist_append(fuzz->header_list, tmp);
  152|  14.7k|      if (new_list == NULL) {
  ------------------
  |  Branch (152:11): [True: 0, False: 14.7k]
  ------------------
  153|      0|        break;
  154|      0|      }
  155|  14.7k|      fuzz->header_list = new_list;
  156|  14.7k|      fuzz->header_list_count++;
  157|  14.7k|      break;
  158|       |
  159|    404|    case TLV_TYPE_MAIL_RECIPIENT:
  ------------------
  |  |   39|    404|#define TLV_TYPE_MAIL_RECIPIENT                 11
  ------------------
  |  Branch (159:5): [True: 404, False: 204k]
  ------------------
  160|       |      /* Limit the number of headers that can be added to a message to prevent
  161|       |         timeouts. */
  162|    404|      if(fuzz->header_list_count >= TLV_MAX_NUM_CURLOPT_HEADER) {
  ------------------
  |  |  301|    404|#define TLV_MAX_NUM_CURLOPT_HEADER      2000
  ------------------
  |  Branch (162:10): [True: 1, False: 403]
  ------------------
  163|      1|        rc = 255;
  164|      1|        goto EXIT_LABEL;
  165|      1|      }
  166|    403|      tmp = fuzz_tlv_to_string(tlv);
  167|    403|      if (tmp == NULL) {
  ------------------
  |  Branch (167:11): [True: 0, False: 403]
  ------------------
  168|       |        // keep on despite allocation failure
  169|      0|        break;
  170|      0|      }
  171|    403|      new_list = curl_slist_append(fuzz->mail_recipients_list, tmp);
  172|    403|      if (new_list != NULL) {
  ------------------
  |  Branch (172:11): [True: 403, False: 0]
  ------------------
  173|    403|        fuzz->mail_recipients_list = new_list;
  174|    403|        fuzz->header_list_count++;
  175|    403|      }
  176|    403|      break;
  177|       |
  178|   124k|    case TLV_TYPE_MIME_PART:
  ------------------
  |  |   41|   124k|#define TLV_TYPE_MIME_PART                      13
  ------------------
  |  Branch (178:5): [True: 124k, False: 79.9k]
  ------------------
  179|   124k|      if(fuzz->mime == NULL) {
  ------------------
  |  Branch (179:10): [True: 537, False: 124k]
  ------------------
  180|    537|        fuzz->mime = curl_mime_init(fuzz->easy);
  181|    537|      }
  182|       |
  183|   124k|      fuzz->part = curl_mime_addpart(fuzz->mime);
  184|       |
  185|       |      /* This TLV may have sub TLVs. */
  186|   124k|      fuzz_add_mime_part(tlv, fuzz->part);
  187|       |
  188|   124k|      break;
  189|       |
  190|    231|    case TLV_TYPE_POSTFIELDS:
  ------------------
  |  |   33|    231|#define TLV_TYPE_POSTFIELDS                     5
  ------------------
  |  Branch (190:5): [True: 231, False: 204k]
  ------------------
  191|    231|      FCHECK_OPTION_UNSET(fuzz, CURLOPT_POSTFIELDS);
  ------------------
  |  |  503|    231|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  ------------------
  |  |  |  |  490|    231|        {                                                                     \
  |  |  |  |  491|    231|          if (!(COND))                                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (491:15): [True: 1, False: 230]
  |  |  |  |  ------------------
  |  |  |  |  492|    231|          {                                                                   \
  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  496|    231|        }
  |  |  ------------------
  ------------------
  192|    230|      fuzz->postfields = fuzz_tlv_to_string(tlv);
  193|    230|      FSET_OPTION(fuzz, CURLOPT_POSTFIELDS, fuzz->postfields);
  ------------------
  |  |  499|    230|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  ------------------
  |  |  |  |  480|    230|        {                                                                     \
  |  |  |  |  481|    230|          int _func_rc = (FUNC);                                              \
  |  |  |  |  482|    230|          if (_func_rc)                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (482:15): [True: 0, False: 230]
  |  |  |  |  ------------------
  |  |  |  |  483|    230|          {                                                                   \
  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  487|    230|        }
  |  |  ------------------
  |  |  500|    230|        (FUZZP)->options[OPTNAME % 1000] = 1
  ------------------
  194|    230|      break;
  195|       |
  196|    159|    case TLV_TYPE_HTTPPOSTBODY:
  ------------------
  |  |   80|    159|#define TLV_TYPE_HTTPPOSTBODY                   52
  ------------------
  |  Branch (196:5): [True: 159, False: 204k]
  ------------------
  197|    159|      FCHECK_OPTION_UNSET(fuzz, CURLOPT_HTTPPOST);
  ------------------
  |  |  503|    159|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  ------------------
  |  |  |  |  490|    159|        {                                                                     \
  |  |  |  |  491|    159|          if (!(COND))                                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (491:15): [True: 1, False: 158]
  |  |  |  |  ------------------
  |  |  |  |  492|    159|          {                                                                   \
  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  496|    159|        }
  |  |  ------------------
  ------------------
  198|    158|      fuzz_setup_http_post(fuzz, tlv);
  199|    158|      FSET_OPTION(fuzz, CURLOPT_HTTPPOST, fuzz->httppost);
  ------------------
  |  |  499|    158|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  ------------------
  |  |  |  |  480|    158|        {                                                                     \
  |  |  |  |  481|    158|          int _func_rc = (FUNC);                                              \
  |  |  |  |  482|    158|          if (_func_rc)                                                       \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (482:15): [True: 0, False: 158]
  |  |  |  |  ------------------
  |  |  |  |  483|    158|          {                                                                   \
  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  487|    158|        }
  |  |  ------------------
  |  |  500|    158|        (FUZZP)->options[OPTNAME % 1000] = 1
  ------------------
  200|    158|      break;
  201|       |
  202|       |    /* Define a set of u32 options. */
  203|  1.38k|    FU32TLV(fuzz, TLV_TYPE_HTTPAUTH, CURLOPT_HTTPAUTH);
  ------------------
  |  |  519|    464|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 464, False: 204k]
  |  |  ------------------
  |  |  520|    464|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 462]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|    464|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    462|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    462|        {                                                                     \
  |  |  |  |  |  |  491|    462|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 461]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    462|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    462|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|    461|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|    461|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|    461|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    461|        {                                                                     \
  |  |  |  |  |  |  481|    461|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    461|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 460]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    461|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|    461|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    460|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    460|          break
  ------------------
  204|     76|    FU32TLV(fuzz, TLV_TYPE_OPTHEADER, CURLOPT_HEADER);
  ------------------
  |  |  519|     27|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 27, False: 204k]
  |  |  ------------------
  |  |  520|     27|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 25]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     27|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     25|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     25|        {                                                                     \
  |  |  |  |  |  |  491|     25|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 24]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     25|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     25|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     24|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     24|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     24|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     24|        {                                                                     \
  |  |  |  |  |  |  481|     24|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     24|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 24]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     24|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     24|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     24|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     24|          break
  ------------------
  205|    558|    FU32TLV(fuzz, TLV_TYPE_NOBODY, CURLOPT_NOBODY);
  ------------------
  |  |  519|    187|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 187, False: 204k]
  |  |  ------------------
  |  |  520|    187|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 1, False: 186]
  |  |  ------------------
  |  |  521|      1|            rc = 255;                                                         \
  |  |  522|      1|            goto EXIT_LABEL;                                                  \
  |  |  523|      1|          }                                                                   \
  |  |  524|    187|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    186|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    186|        {                                                                     \
  |  |  |  |  |  |  491|    186|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 185]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    186|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    186|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|    185|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|    185|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|    185|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    185|        {                                                                     \
  |  |  |  |  |  |  481|    185|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    185|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 185]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    185|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    185|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    185|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    185|          break
  ------------------
  206|  3.04k|    FU32TLV(fuzz, TLV_TYPE_FOLLOWLOCATION, CURLOPT_FOLLOWLOCATION);
  ------------------
  |  |  519|  1.02k|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 1.02k, False: 203k]
  |  |  ------------------
  |  |  520|  1.02k|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 8, False: 1.01k]
  |  |  ------------------
  |  |  521|      8|            rc = 255;                                                         \
  |  |  522|      8|            goto EXIT_LABEL;                                                  \
  |  |  523|      8|          }                                                                   \
  |  |  524|  1.02k|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|  1.01k|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|  1.01k|        {                                                                     \
  |  |  |  |  |  |  491|  1.01k|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 1.01k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|  1.01k|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|  1.01k|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|  1.01k|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|  1.01k|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|  1.01k|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|  1.01k|        {                                                                     \
  |  |  |  |  |  |  481|  1.01k|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|  1.01k|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 14, False: 998]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|  1.01k|          {                                                                   \
  |  |  |  |  |  |  484|     14|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     14|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     14|          }                                                                   \
  |  |  |  |  |  |  487|  1.01k|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    998|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    998|          break
  ------------------
  207|  1.77k|    FU32TLV(fuzz, TLV_TYPE_WILDCARDMATCH, CURLOPT_WILDCARDMATCH);
  ------------------
  |  |  519|    593|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 593, False: 204k]
  |  |  ------------------
  |  |  520|    593|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 4, False: 589]
  |  |  ------------------
  |  |  521|      4|            rc = 255;                                                         \
  |  |  522|      4|            goto EXIT_LABEL;                                                  \
  |  |  523|      4|          }                                                                   \
  |  |  524|    593|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    589|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    589|        {                                                                     \
  |  |  |  |  |  |  491|    589|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 588]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    589|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    589|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|    588|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|    588|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|    588|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    588|        {                                                                     \
  |  |  |  |  |  |  481|    588|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    588|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 588]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    588|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    588|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    588|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    588|          break
  ------------------
  208|    105|    FU32TLV(fuzz, TLV_TYPE_RTSP_REQUEST, CURLOPT_RTSP_REQUEST);
  ------------------
  |  |  519|     40|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 40, False: 204k]
  |  |  ------------------
  |  |  520|     40|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 7, False: 33]
  |  |  ------------------
  |  |  521|      7|            rc = 255;                                                         \
  |  |  522|      7|            goto EXIT_LABEL;                                                  \
  |  |  523|      7|          }                                                                   \
  |  |  524|     40|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     33|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     33|        {                                                                     \
  |  |  |  |  |  |  491|     33|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 32]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     33|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     33|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     32|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     32|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     32|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     32|        {                                                                     \
  |  |  |  |  |  |  481|     32|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     32|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 28, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     32|          {                                                                   \
  |  |  |  |  |  |  484|     28|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     28|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     28|          }                                                                   \
  |  |  |  |  |  |  487|     32|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      4|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      4|          break
  ------------------
  209|    205|    FU32TLV(fuzz, TLV_TYPE_RTSP_CLIENT_CSEQ, CURLOPT_RTSP_CLIENT_CSEQ);
  ------------------
  |  |  519|     74|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 74, False: 204k]
  |  |  ------------------
  |  |  520|     74|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 8, False: 66]
  |  |  ------------------
  |  |  521|      8|            rc = 255;                                                         \
  |  |  522|      8|            goto EXIT_LABEL;                                                  \
  |  |  523|      8|          }                                                                   \
  |  |  524|     74|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     66|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     66|        {                                                                     \
  |  |  |  |  |  |  491|     66|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 65]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     66|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     66|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     65|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     65|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     65|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     65|        {                                                                     \
  |  |  |  |  |  |  481|     65|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     65|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 65]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     65|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     65|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     65|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     65|          break
  ------------------
  210|  13.6k|    FU32TLV(fuzz, TLV_TYPE_HTTP_VERSION, CURLOPT_HTTP_VERSION);
  ------------------
  |  |  519|  4.54k|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 4.54k, False: 200k]
  |  |  ------------------
  |  |  520|  4.54k|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 4.54k]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|  4.54k|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|  4.54k|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|  4.54k|        {                                                                     \
  |  |  |  |  |  |  491|  4.54k|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 4.54k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|  4.54k|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|  4.54k|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|  4.54k|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|  4.54k|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|  4.54k|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|  4.54k|        {                                                                     \
  |  |  |  |  |  |  481|  4.54k|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|  4.54k|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 38, False: 4.50k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|  4.54k|          {                                                                   \
  |  |  |  |  |  |  484|     38|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     38|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     38|          }                                                                   \
  |  |  |  |  |  |  487|  4.54k|        }
  |  |  |  |  ------------------
  |  |  |  |  500|  4.50k|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|  4.50k|          break
  ------------------
  211|    171|    FU32TLV(fuzz, TLV_TYPE_NETRC, CURLOPT_NETRC);
  ------------------
  |  |  519|     58|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 58, False: 204k]
  |  |  ------------------
  |  |  520|     58|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 1, False: 57]
  |  |  ------------------
  |  |  521|      1|            rc = 255;                                                         \
  |  |  522|      1|            goto EXIT_LABEL;                                                  \
  |  |  523|      1|          }                                                                   \
  |  |  524|     58|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     57|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     57|        {                                                                     \
  |  |  |  |  |  |  491|     57|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 56]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     57|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     57|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     56|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     56|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     56|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     56|        {                                                                     \
  |  |  |  |  |  |  481|     56|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     56|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 35, False: 21]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     56|          {                                                                   \
  |  |  |  |  |  |  484|     35|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     35|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     35|          }                                                                   \
  |  |  |  |  |  |  487|     56|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     21|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     21|          break
  ------------------
  212|     26|    FU32TLV(fuzz, TLV_TYPE_WS_OPTIONS, CURLOPT_WS_OPTIONS);
  ------------------
  |  |  519|     11|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 11, False: 204k]
  |  |  ------------------
  |  |  520|     11|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 8]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     11|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      8|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      8|        {                                                                     \
  |  |  |  |  |  |  491|      8|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      8|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      8|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      7|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      7|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      7|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      7|        {                                                                     \
  |  |  |  |  |  |  481|      7|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      7|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      7|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      7|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      7|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      7|          break
  ------------------
  213|    296|    FU32TLV(fuzz, TLV_TYPE_CONNECT_ONLY, CURLOPT_CONNECT_ONLY);
  ------------------
  |  |  519|    101|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 101, False: 204k]
  |  |  ------------------
  |  |  520|    101|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 98]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|    101|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     98|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     98|        {                                                                     \
  |  |  |  |  |  |  491|     98|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 97]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     98|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     98|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     97|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     97|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     97|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     97|        {                                                                     \
  |  |  |  |  |  |  481|     97|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     97|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 27, False: 70]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     97|          {                                                                   \
  |  |  |  |  |  |  484|     27|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     27|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     27|          }                                                                   \
  |  |  |  |  |  |  487|     97|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     70|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     70|          break
  ------------------
  214|    278|    FU32TLV(fuzz, TLV_TYPE_POST, CURLOPT_POST);
  ------------------
  |  |  519|     95|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 95, False: 204k]
  |  |  ------------------
  |  |  520|     95|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 92]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     95|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     92|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     92|        {                                                                     \
  |  |  |  |  |  |  491|     92|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 91]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     92|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     92|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     91|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     91|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     91|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     91|        {                                                                     \
  |  |  |  |  |  |  481|     91|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     91|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 91]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     91|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     91|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     91|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     91|          break
  ------------------
  215|  1.66k|    FU32TLV(fuzz, TLV_TYPE_PROXYTYPE, CURLOPT_PROXYTYPE);
  ------------------
  |  |  519|    557|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 557, False: 204k]
  |  |  ------------------
  |  |  520|    557|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 1, False: 556]
  |  |  ------------------
  |  |  521|      1|            rc = 255;                                                         \
  |  |  522|      1|            goto EXIT_LABEL;                                                  \
  |  |  523|      1|          }                                                                   \
  |  |  524|    557|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    556|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    556|        {                                                                     \
  |  |  |  |  |  |  491|    556|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 555]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    556|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    556|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|    555|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|    555|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|    555|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    555|        {                                                                     \
  |  |  |  |  |  |  481|    555|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    555|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 34, False: 521]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    555|          {                                                                   \
  |  |  |  |  |  |  484|     34|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     34|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     34|          }                                                                   \
  |  |  |  |  |  |  487|    555|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    521|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    521|          break
  ------------------
  216|    209|    FU32TLV(fuzz, TLV_TYPE_PORT, CURLOPT_PORT);
  ------------------
  |  |  519|     72|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 72, False: 204k]
  |  |  ------------------
  |  |  520|     72|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 69]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     72|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     69|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     69|        {                                                                     \
  |  |  |  |  |  |  491|     69|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 68]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     69|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     69|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     68|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     68|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     68|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     68|        {                                                                     \
  |  |  |  |  |  |  481|     68|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     68|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 24, False: 44]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     68|          {                                                                   \
  |  |  |  |  |  |  484|     24|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     24|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     24|          }                                                                   \
  |  |  |  |  |  |  487|     68|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     44|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     44|          break
  ------------------
  217|    379|    FU32TLV(fuzz, TLV_TYPE_LOW_SPEED_LIMIT, CURLOPT_LOW_SPEED_LIMIT);
  ------------------
  |  |  519|    128|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 128, False: 204k]
  |  |  ------------------
  |  |  520|    128|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 126]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|    128|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    126|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    126|        {                                                                     \
  |  |  |  |  |  |  491|    126|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 125]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    126|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    126|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|    125|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|    125|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|    125|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    125|        {                                                                     \
  |  |  |  |  |  |  481|    125|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    125|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 125]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    125|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    125|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    125|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    125|          break
  ------------------
  218|    351|    FU32TLV(fuzz, TLV_TYPE_LOW_SPEED_TIME, CURLOPT_LOW_SPEED_TIME);
  ------------------
  |  |  519|    118|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 118, False: 204k]
  |  |  ------------------
  |  |  520|    118|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 1, False: 117]
  |  |  ------------------
  |  |  521|      1|            rc = 255;                                                         \
  |  |  522|      1|            goto EXIT_LABEL;                                                  \
  |  |  523|      1|          }                                                                   \
  |  |  524|    118|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    117|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    117|        {                                                                     \
  |  |  |  |  |  |  491|    117|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 116]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    117|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    117|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|    116|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|    116|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|    116|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    116|        {                                                                     \
  |  |  |  |  |  |  481|    116|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    116|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 116]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    116|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    116|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    116|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    116|          break
  ------------------
  219|    319|    FU32TLV(fuzz, TLV_TYPE_RESUME_FROM, CURLOPT_RESUME_FROM);
  ------------------
  |  |  519|    108|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 108, False: 204k]
  |  |  ------------------
  |  |  520|    108|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 106]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|    108|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    106|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    106|        {                                                                     \
  |  |  |  |  |  |  491|    106|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 105]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    106|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    106|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|    105|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|    105|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|    105|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    105|        {                                                                     \
  |  |  |  |  |  |  481|    105|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    105|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 105]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    105|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    105|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    105|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    105|          break
  ------------------
  220|     27|    FU32TLV(fuzz, TLV_TYPE_TIMEVALUE, CURLOPT_TIMEVALUE);
  ------------------
  |  |  519|     10|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 10, False: 204k]
  |  |  ------------------
  |  |  520|     10|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 1, False: 9]
  |  |  ------------------
  |  |  521|      1|            rc = 255;                                                         \
  |  |  522|      1|            goto EXIT_LABEL;                                                  \
  |  |  523|      1|          }                                                                   \
  |  |  524|     10|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      9|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      9|        {                                                                     \
  |  |  |  |  |  |  491|      9|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 8]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      9|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      9|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      8|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      8|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      8|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      8|        {                                                                     \
  |  |  |  |  |  |  481|      8|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      8|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 8]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      8|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      8|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      8|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      8|          break
  ------------------
  221|    179|    FU32TLV(fuzz, TLV_TYPE_NOPROGRESS, CURLOPT_NOPROGRESS);
  ------------------
  |  |  519|     62|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 62, False: 204k]
  |  |  ------------------
  |  |  520|     62|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 59]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     62|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     59|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     59|        {                                                                     \
  |  |  |  |  |  |  491|     59|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 58]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     59|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     59|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     58|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     58|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     58|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     58|        {                                                                     \
  |  |  |  |  |  |  481|     58|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     58|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 58]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     58|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     58|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     58|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     58|          break
  ------------------
  222|     58|    FU32TLV(fuzz, TLV_TYPE_FAILONERROR, CURLOPT_FAILONERROR);
  ------------------
  |  |  519|     21|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 21, False: 204k]
  |  |  ------------------
  |  |  520|     21|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 19]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     21|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     19|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     19|        {                                                                     \
  |  |  |  |  |  |  491|     19|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 18]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     19|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     19|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     18|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     18|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     18|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     18|        {                                                                     \
  |  |  |  |  |  |  481|     18|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     18|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 18]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     18|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     18|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     18|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     18|          break
  ------------------
  223|     15|    FU32TLV(fuzz, TLV_TYPE_DIRLISTONLY, CURLOPT_DIRLISTONLY);
  ------------------
  |  |  519|      8|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 8, False: 204k]
  |  |  ------------------
  |  |  520|      8|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 4, False: 4]
  |  |  ------------------
  |  |  521|      4|            rc = 255;                                                         \
  |  |  522|      4|            goto EXIT_LABEL;                                                  \
  |  |  523|      4|          }                                                                   \
  |  |  524|      8|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      4|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      4|        {                                                                     \
  |  |  |  |  |  |  491|      4|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      4|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      4|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      3|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      3|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      3|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      3|        {                                                                     \
  |  |  |  |  |  |  481|      3|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      3|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      3|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      3|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      3|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      3|          break
  ------------------
  224|     22|    FU32TLV(fuzz, TLV_TYPE_APPEND, CURLOPT_APPEND);
  ------------------
  |  |  519|      9|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 9, False: 204k]
  |  |  ------------------
  |  |  520|      9|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 7]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|      9|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      7|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      7|        {                                                                     \
  |  |  |  |  |  |  491|      7|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      7|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      7|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      6|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      6|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      6|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      6|        {                                                                     \
  |  |  |  |  |  |  481|      6|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      6|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      6|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      6|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      6|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      6|          break
  ------------------
  225|    232|    FU32TLV(fuzz, TLV_TYPE_TRANSFERTEXT, CURLOPT_TRANSFERTEXT);
  ------------------
  |  |  519|     79|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 79, False: 204k]
  |  |  ------------------
  |  |  520|     79|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 77]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     79|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     77|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     77|        {                                                                     \
  |  |  |  |  |  |  491|     77|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 76]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     77|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     77|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     76|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     76|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     76|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     76|        {                                                                     \
  |  |  |  |  |  |  481|     76|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     76|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 76]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     76|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     76|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     76|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     76|          break
  ------------------
  226|     80|    FU32TLV(fuzz, TLV_TYPE_AUTOREFERER, CURLOPT_AUTOREFERER);
  ------------------
  |  |  519|     33|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 33, False: 204k]
  |  |  ------------------
  |  |  520|     33|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 9, False: 24]
  |  |  ------------------
  |  |  521|      9|            rc = 255;                                                         \
  |  |  522|      9|            goto EXIT_LABEL;                                                  \
  |  |  523|      9|          }                                                                   \
  |  |  524|     33|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     24|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     24|        {                                                                     \
  |  |  |  |  |  |  491|     24|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 23]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     24|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     24|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     23|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     23|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     23|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     23|        {                                                                     \
  |  |  |  |  |  |  481|     23|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     23|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 23]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     23|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     23|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     23|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     23|          break
  ------------------
  227|    245|    FU32TLV(fuzz, TLV_TYPE_PROXYPORT, CURLOPT_PROXYPORT);
  ------------------
  |  |  519|     88|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 88, False: 204k]
  |  |  ------------------
  |  |  520|     88|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 9, False: 79]
  |  |  ------------------
  |  |  521|      9|            rc = 255;                                                         \
  |  |  522|      9|            goto EXIT_LABEL;                                                  \
  |  |  523|      9|          }                                                                   \
  |  |  524|     88|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     79|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     79|        {                                                                     \
  |  |  |  |  |  |  491|     79|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 78]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     79|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     79|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     78|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     78|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     78|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     78|        {                                                                     \
  |  |  |  |  |  |  481|     78|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     78|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 19, False: 59]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     78|          {                                                                   \
  |  |  |  |  |  |  484|     19|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     19|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     19|          }                                                                   \
  |  |  |  |  |  |  487|     78|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     59|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     59|          break
  ------------------
  228|       |    // too easy for API misuse FU32TLV(fuzz, TLV_TYPE_POSTFIELDSIZE, CURLOPT_POSTFIELDSIZE);
  229|     26|    FU32TLV(fuzz, TLV_TYPE_HTTPPROXYTUNNEL, CURLOPT_HTTPPROXYTUNNEL);
  ------------------
  |  |  519|     11|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 11, False: 204k]
  |  |  ------------------
  |  |  520|     11|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 8]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     11|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      8|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      8|        {                                                                     \
  |  |  |  |  |  |  491|      8|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      8|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      8|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      7|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      7|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      7|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      7|        {                                                                     \
  |  |  |  |  |  |  481|      7|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      7|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      7|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      7|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      7|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      7|          break
  ------------------
  230|     35|    FU32TLV(fuzz, TLV_TYPE_SSL_VERIFYPEER, CURLOPT_SSL_VERIFYPEER);
  ------------------
  |  |  519|     14|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 14, False: 204k]
  |  |  ------------------
  |  |  520|     14|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 11]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     14|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     11|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     11|        {                                                                     \
  |  |  |  |  |  |  491|     11|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 10]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     11|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     11|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     10|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     10|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     10|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     10|        {                                                                     \
  |  |  |  |  |  |  481|     10|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     10|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 10]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     10|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     10|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     10|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     10|          break
  ------------------
  231|    121|    FU32TLV(fuzz, TLV_TYPE_MAXREDIRS, CURLOPT_MAXREDIRS);
  ------------------
  |  |  519|     42|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 42, False: 204k]
  |  |  ------------------
  |  |  520|     42|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 40]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     42|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     40|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     40|        {                                                                     \
  |  |  |  |  |  |  491|     40|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 39]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     40|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     40|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     39|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     39|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     39|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     39|        {                                                                     \
  |  |  |  |  |  |  481|     39|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     39|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 39]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     39|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     39|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     39|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     39|          break
  ------------------
  232|    155|    FU32TLV(fuzz, TLV_TYPE_FILETIME, CURLOPT_FILETIME);
  ------------------
  |  |  519|     56|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 56, False: 204k]
  |  |  ------------------
  |  |  520|     56|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 6, False: 50]
  |  |  ------------------
  |  |  521|      6|            rc = 255;                                                         \
  |  |  522|      6|            goto EXIT_LABEL;                                                  \
  |  |  523|      6|          }                                                                   \
  |  |  524|     56|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     50|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     50|        {                                                                     \
  |  |  |  |  |  |  491|     50|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 49]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     50|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     50|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     49|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     49|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     49|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     49|        {                                                                     \
  |  |  |  |  |  |  481|     49|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     49|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 49]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     49|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     49|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     49|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     49|          break
  ------------------
  233|    167|    FU32TLV(fuzz, TLV_TYPE_MAXCONNECTS, CURLOPT_MAXCONNECTS);
  ------------------
  |  |  519|     58|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 58, False: 204k]
  |  |  ------------------
  |  |  520|     58|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 55]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     58|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     55|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     55|        {                                                                     \
  |  |  |  |  |  |  491|     55|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 54]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     55|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     55|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     54|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     54|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     54|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     54|        {                                                                     \
  |  |  |  |  |  |  481|     54|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     54|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 53]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     54|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|     54|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     53|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     53|          break
  ------------------
  234|    124|    FU32TLV(fuzz, TLV_TYPE_FRESH_CONNECT, CURLOPT_FRESH_CONNECT);
  ------------------
  |  |  519|     43|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 43, False: 204k]
  |  |  ------------------
  |  |  520|     43|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 41]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     43|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     41|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     41|        {                                                                     \
  |  |  |  |  |  |  491|     41|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 40]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     41|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     41|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     40|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     40|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     40|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     40|        {                                                                     \
  |  |  |  |  |  |  481|     40|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     40|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 40]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     40|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     40|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     40|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     40|          break
  ------------------
  235|    173|    FU32TLV(fuzz, TLV_TYPE_FORBID_REUSE, CURLOPT_FORBID_REUSE);
  ------------------
  |  |  519|     60|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 60, False: 204k]
  |  |  ------------------
  |  |  520|     60|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 57]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     60|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     57|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     57|        {                                                                     \
  |  |  |  |  |  |  491|     57|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 56]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     57|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     57|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     56|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     56|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     56|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     56|        {                                                                     \
  |  |  |  |  |  |  481|     56|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     56|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 56]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     56|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     56|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     56|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     56|          break
  ------------------
  236|    585|    FU32TLV(fuzz, TLV_TYPE_CONNECTTIMEOUT, CURLOPT_CONNECTTIMEOUT);
  ------------------
  |  |  519|    204|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 204, False: 204k]
  |  |  ------------------
  |  |  520|    204|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 13, False: 191]
  |  |  ------------------
  |  |  521|     13|            rc = 255;                                                         \
  |  |  522|     13|            goto EXIT_LABEL;                                                  \
  |  |  523|     13|          }                                                                   \
  |  |  524|    204|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    191|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    191|        {                                                                     \
  |  |  |  |  |  |  491|    191|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 190]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    191|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    191|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|    190|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|    190|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|    190|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    190|        {                                                                     \
  |  |  |  |  |  |  481|    190|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    190|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 190]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    190|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    190|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    190|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    190|          break
  ------------------
  237|     16|    FU32TLV(fuzz, TLV_TYPE_HTTPGET, CURLOPT_HTTPGET);
  ------------------
  |  |  519|      9|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 9, False: 204k]
  |  |  ------------------
  |  |  520|      9|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 5, False: 4]
  |  |  ------------------
  |  |  521|      5|            rc = 255;                                                         \
  |  |  522|      5|            goto EXIT_LABEL;                                                  \
  |  |  523|      5|          }                                                                   \
  |  |  524|      9|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      4|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      4|        {                                                                     \
  |  |  |  |  |  |  491|      4|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      4|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      4|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      3|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      3|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      3|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      3|        {                                                                     \
  |  |  |  |  |  |  481|      3|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      3|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      3|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      3|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      3|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      3|          break
  ------------------
  238|     30|    FU32TLV(fuzz, TLV_TYPE_SSL_VERIFYHOST, CURLOPT_SSL_VERIFYHOST);
  ------------------
  |  |  519|     11|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 11, False: 204k]
  |  |  ------------------
  |  |  520|     11|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 1, False: 10]
  |  |  ------------------
  |  |  521|      1|            rc = 255;                                                         \
  |  |  522|      1|            goto EXIT_LABEL;                                                  \
  |  |  523|      1|          }                                                                   \
  |  |  524|     11|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     10|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     10|        {                                                                     \
  |  |  |  |  |  |  491|     10|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     10|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     10|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      9|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      9|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      9|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      9|        {                                                                     \
  |  |  |  |  |  |  481|      9|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      9|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      9|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      9|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      9|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      9|          break
  ------------------
  239|      9|    FU32TLV(fuzz, TLV_TYPE_FTP_USE_EPSV, CURLOPT_FTP_USE_EPSV);
  ------------------
  |  |  519|      4|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 4, False: 204k]
  |  |  ------------------
  |  |  520|      4|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 1, False: 3]
  |  |  ------------------
  |  |  521|      1|            rc = 255;                                                         \
  |  |  522|      1|            goto EXIT_LABEL;                                                  \
  |  |  523|      1|          }                                                                   \
  |  |  524|      4|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      3|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      3|        {                                                                     \
  |  |  |  |  |  |  491|      3|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      3|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      3|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      2|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      2|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      2|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      2|        {                                                                     \
  |  |  |  |  |  |  481|      2|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      2|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      2|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      2|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      2|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      2|          break
  ------------------
  240|     16|    FU32TLV(fuzz, TLV_TYPE_SSLENGINE_DEFAULT, CURLOPT_SSLENGINE_DEFAULT);
  ------------------
  |  |  519|      7|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 7, False: 204k]
  |  |  ------------------
  |  |  520|      7|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 5]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|      7|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      5|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      5|        {                                                                     \
  |  |  |  |  |  |  491|      5|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      5|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      5|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      4|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      4|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      4|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      4|        {                                                                     \
  |  |  |  |  |  |  481|      4|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      4|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      4|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      4|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      4|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      4|          break
  ------------------
  241|    333|    FU32TLV(fuzz, TLV_TYPE_DNS_CACHE_TIMEOUT, CURLOPT_DNS_CACHE_TIMEOUT);
  ------------------
  |  |  519|    114|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 114, False: 204k]
  |  |  ------------------
  |  |  520|    114|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 4, False: 110]
  |  |  ------------------
  |  |  521|      4|            rc = 255;                                                         \
  |  |  522|      4|            goto EXIT_LABEL;                                                  \
  |  |  523|      4|          }                                                                   \
  |  |  524|    114|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    110|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    110|        {                                                                     \
  |  |  |  |  |  |  491|    110|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 109]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    110|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    110|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|    109|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|    109|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|    109|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    109|        {                                                                     \
  |  |  |  |  |  |  481|    109|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    109|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 109]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    109|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    109|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    109|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    109|          break
  ------------------
  242|     16|    FU32TLV(fuzz, TLV_TYPE_COOKIESESSION, CURLOPT_COOKIESESSION);
  ------------------
  |  |  519|     11|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 11, False: 204k]
  |  |  ------------------
  |  |  520|     11|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 8, False: 3]
  |  |  ------------------
  |  |  521|      8|            rc = 255;                                                         \
  |  |  522|      8|            goto EXIT_LABEL;                                                  \
  |  |  523|      8|          }                                                                   \
  |  |  524|     11|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      3|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      3|        {                                                                     \
  |  |  |  |  |  |  491|      3|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      3|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      3|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      2|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      2|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      2|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      2|        {                                                                     \
  |  |  |  |  |  |  481|      2|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      2|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      2|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      2|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      2|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      2|          break
  ------------------
  243|    213|    FU32TLV(fuzz, TLV_TYPE_BUFFERSIZE, CURLOPT_BUFFERSIZE);
  ------------------
  |  |  519|     72|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 72, False: 204k]
  |  |  ------------------
  |  |  520|     72|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 1, False: 71]
  |  |  ------------------
  |  |  521|      1|            rc = 255;                                                         \
  |  |  522|      1|            goto EXIT_LABEL;                                                  \
  |  |  523|      1|          }                                                                   \
  |  |  524|     72|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     71|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     71|        {                                                                     \
  |  |  |  |  |  |  491|     71|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 70]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     71|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     71|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     70|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     70|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     70|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     70|        {                                                                     \
  |  |  |  |  |  |  481|     70|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     70|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 70]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     70|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     70|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     70|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     70|          break
  ------------------
  244|     46|    FU32TLV(fuzz, TLV_TYPE_NOSIGNAL, CURLOPT_NOSIGNAL);
  ------------------
  |  |  519|     17|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 17, False: 204k]
  |  |  ------------------
  |  |  520|     17|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 15]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     17|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     15|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     15|        {                                                                     \
  |  |  |  |  |  |  491|     15|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 14]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     15|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     15|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     14|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     14|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     14|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     14|        {                                                                     \
  |  |  |  |  |  |  481|     14|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     14|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 14]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     14|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     14|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     14|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     14|          break
  ------------------
  245|     46|    FU32TLV(fuzz, TLV_TYPE_UNRESTRICTED_AUTH, CURLOPT_UNRESTRICTED_AUTH);
  ------------------
  |  |  519|     19|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 19, False: 204k]
  |  |  ------------------
  |  |  520|     19|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 5, False: 14]
  |  |  ------------------
  |  |  521|      5|            rc = 255;                                                         \
  |  |  522|      5|            goto EXIT_LABEL;                                                  \
  |  |  523|      5|          }                                                                   \
  |  |  524|     19|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     14|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     14|        {                                                                     \
  |  |  |  |  |  |  491|     14|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 13]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     14|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     14|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     13|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     13|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     13|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     13|        {                                                                     \
  |  |  |  |  |  |  481|     13|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     13|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 13]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     13|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     13|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     13|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     13|          break
  ------------------
  246|     16|    FU32TLV(fuzz, TLV_TYPE_FTP_USE_EPRT, CURLOPT_FTP_USE_EPRT);
  ------------------
  |  |  519|      7|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 7, False: 204k]
  |  |  ------------------
  |  |  520|      7|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 5]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|      7|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      5|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      5|        {                                                                     \
  |  |  |  |  |  |  491|      5|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      5|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      5|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      4|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      4|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      4|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      4|        {                                                                     \
  |  |  |  |  |  |  481|      4|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      4|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      4|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      4|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      4|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      4|          break
  ------------------
  247|    177|    FU32TLV(fuzz, TLV_TYPE_FTP_CREATE_MISSING_DIRS, CURLOPT_FTP_CREATE_MISSING_DIRS);
  ------------------
  |  |  519|     66|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 66, False: 204k]
  |  |  ------------------
  |  |  520|     66|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 10, False: 56]
  |  |  ------------------
  |  |  521|     10|            rc = 255;                                                         \
  |  |  522|     10|            goto EXIT_LABEL;                                                  \
  |  |  523|     10|          }                                                                   \
  |  |  524|     66|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     56|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     56|        {                                                                     \
  |  |  |  |  |  |  491|     56|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 55]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     56|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     56|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     55|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     55|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     55|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     55|        {                                                                     \
  |  |  |  |  |  |  481|     55|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     55|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 35, False: 20]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     55|          {                                                                   \
  |  |  |  |  |  |  484|     35|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     35|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     35|          }                                                                   \
  |  |  |  |  |  |  487|     55|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     20|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     20|          break
  ------------------
  248|    253|    FU32TLV(fuzz, TLV_TYPE_MAXFILESIZE, CURLOPT_MAXFILESIZE);
  ------------------
  |  |  519|     86|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 86, False: 204k]
  |  |  ------------------
  |  |  520|     86|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 84]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     86|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     84|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     84|        {                                                                     \
  |  |  |  |  |  |  491|     84|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 83]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     84|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     84|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     83|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     83|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     83|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     83|        {                                                                     \
  |  |  |  |  |  |  481|     83|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     83|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 83]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     83|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     83|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     83|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     83|          break
  ------------------
  249|     18|    FU32TLV(fuzz, TLV_TYPE_TCP_NODELAY, CURLOPT_TCP_NODELAY);
  ------------------
  |  |  519|      9|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 9, False: 204k]
  |  |  ------------------
  |  |  520|      9|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 4, False: 5]
  |  |  ------------------
  |  |  521|      4|            rc = 255;                                                         \
  |  |  522|      4|            goto EXIT_LABEL;                                                  \
  |  |  523|      4|          }                                                                   \
  |  |  524|      9|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      5|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      5|        {                                                                     \
  |  |  |  |  |  |  491|      5|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      5|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      5|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      4|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      4|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      4|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      4|        {                                                                     \
  |  |  |  |  |  |  481|      4|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      4|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      4|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      4|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      4|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      4|          break
  ------------------
  250|     52|    FU32TLV(fuzz, TLV_TYPE_IGNORE_CONTENT_LENGTH, CURLOPT_IGNORE_CONTENT_LENGTH);
  ------------------
  |  |  519|     21|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 21, False: 204k]
  |  |  ------------------
  |  |  520|     21|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 5, False: 16]
  |  |  ------------------
  |  |  521|      5|            rc = 255;                                                         \
  |  |  522|      5|            goto EXIT_LABEL;                                                  \
  |  |  523|      5|          }                                                                   \
  |  |  524|     21|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     16|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     16|        {                                                                     \
  |  |  |  |  |  |  491|     16|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 15]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     16|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     16|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     15|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     15|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     15|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     15|        {                                                                     \
  |  |  |  |  |  |  481|     15|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     15|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 15]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     15|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     15|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     15|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     15|          break
  ------------------
  251|     15|    FU32TLV(fuzz, TLV_TYPE_FTP_SKIP_PASV_IP, CURLOPT_FTP_SKIP_PASV_IP);
  ------------------
  |  |  519|      6|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 6, False: 204k]
  |  |  ------------------
  |  |  520|      6|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 1, False: 5]
  |  |  ------------------
  |  |  521|      1|            rc = 255;                                                         \
  |  |  522|      1|            goto EXIT_LABEL;                                                  \
  |  |  523|      1|          }                                                                   \
  |  |  524|      6|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      5|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      5|        {                                                                     \
  |  |  |  |  |  |  491|      5|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      5|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      5|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      4|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      4|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      4|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      4|        {                                                                     \
  |  |  |  |  |  |  481|      4|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      4|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      4|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      4|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      4|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      4|          break
  ------------------
  252|    209|    FU32TLV(fuzz, TLV_TYPE_LOCALPORT, CURLOPT_LOCALPORT);
  ------------------
  |  |  519|     72|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 72, False: 204k]
  |  |  ------------------
  |  |  520|     72|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 69]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     72|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     69|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     69|        {                                                                     \
  |  |  |  |  |  |  491|     69|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 68]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     69|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     69|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     68|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     68|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     68|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     68|        {                                                                     \
  |  |  |  |  |  |  481|     68|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     68|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 32, False: 36]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     68|          {                                                                   \
  |  |  |  |  |  |  484|     32|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     32|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     32|          }                                                                   \
  |  |  |  |  |  |  487|     68|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     36|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     36|          break
  ------------------
  253|    185|    FU32TLV(fuzz, TLV_TYPE_LOCALPORTRANGE, CURLOPT_LOCALPORTRANGE);
  ------------------
  |  |  519|     64|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 64, False: 204k]
  |  |  ------------------
  |  |  520|     64|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 61]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     64|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     61|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     61|        {                                                                     \
  |  |  |  |  |  |  491|     61|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 60]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     61|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     61|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     60|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     60|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     60|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     60|        {                                                                     \
  |  |  |  |  |  |  481|     60|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     60|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 28, False: 32]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     60|          {                                                                   \
  |  |  |  |  |  |  484|     28|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     28|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     28|          }                                                                   \
  |  |  |  |  |  |  487|     60|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     32|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     32|          break
  ------------------
  254|     16|    FU32TLV(fuzz, TLV_TYPE_SSL_SESSIONID_CACHE, CURLOPT_SSL_SESSIONID_CACHE);
  ------------------
  |  |  519|      7|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 7, False: 204k]
  |  |  ------------------
  |  |  520|      7|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 5]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|      7|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      5|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      5|        {                                                                     \
  |  |  |  |  |  |  491|      5|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      5|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      5|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      4|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      4|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      4|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      4|        {                                                                     \
  |  |  |  |  |  |  481|      4|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      4|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      4|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      4|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      4|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      4|          break
  ------------------
  255|    119|    FU32TLV(fuzz, TLV_TYPE_FTP_SSL_CCC, CURLOPT_FTP_SSL_CCC);
  ------------------
  |  |  519|     48|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 48, False: 204k]
  |  |  ------------------
  |  |  520|     48|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 12, False: 36]
  |  |  ------------------
  |  |  521|     12|            rc = 255;                                                         \
  |  |  522|     12|            goto EXIT_LABEL;                                                  \
  |  |  523|     12|          }                                                                   \
  |  |  524|     48|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     36|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     36|        {                                                                     \
  |  |  |  |  |  |  491|     36|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 35]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     36|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     36|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     35|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     35|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     35|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     35|        {                                                                     \
  |  |  |  |  |  |  481|     35|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     35|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 33, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     35|          {                                                                   \
  |  |  |  |  |  |  484|     33|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     33|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     33|          }                                                                   \
  |  |  |  |  |  |  487|     35|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      2|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      2|          break
  ------------------
  256|    643|    FU32TLV(fuzz, TLV_TYPE_CONNECTTIMEOUT_MS, CURLOPT_CONNECTTIMEOUT_MS);
  ------------------
  |  |  519|    216|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 216, False: 204k]
  |  |  ------------------
  |  |  520|    216|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 214]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|    216|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    214|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    214|        {                                                                     \
  |  |  |  |  |  |  491|    214|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 213]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    214|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    214|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|    213|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|    213|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|    213|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    213|        {                                                                     \
  |  |  |  |  |  |  481|    213|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    213|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 213]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    213|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    213|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    213|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    213|          break
  ------------------
  257|    173|    FU32TLV(fuzz, TLV_TYPE_HTTP_TRANSFER_DECODING, CURLOPT_HTTP_TRANSFER_DECODING);
  ------------------
  |  |  519|     60|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 60, False: 204k]
  |  |  ------------------
  |  |  520|     60|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 57]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     60|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     57|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     57|        {                                                                     \
  |  |  |  |  |  |  491|     57|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 56]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     57|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     57|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     56|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     56|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     56|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     56|        {                                                                     \
  |  |  |  |  |  |  481|     56|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     56|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 56]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     56|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     56|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     56|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     56|          break
  ------------------
  258|     14|    FU32TLV(fuzz, TLV_TYPE_HTTP_CONTENT_DECODING, CURLOPT_HTTP_CONTENT_DECODING);
  ------------------
  |  |  519|      7|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 7, False: 204k]
  |  |  ------------------
  |  |  520|      7|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 4]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|      7|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      4|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      4|        {                                                                     \
  |  |  |  |  |  |  491|      4|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      4|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      4|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      3|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      3|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      3|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      3|        {                                                                     \
  |  |  |  |  |  |  481|      3|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      3|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      3|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      3|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      3|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      3|          break
  ------------------
  259|    131|    FU32TLV(fuzz, TLV_TYPE_NEW_FILE_PERMS, CURLOPT_NEW_FILE_PERMS);
  ------------------
  |  |  519|     46|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 46, False: 204k]
  |  |  ------------------
  |  |  520|     46|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 43]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     46|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     43|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     43|        {                                                                     \
  |  |  |  |  |  |  491|     43|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 42]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     43|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     43|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     42|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     42|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     42|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     42|        {                                                                     \
  |  |  |  |  |  |  481|     42|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     42|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 32, False: 10]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     42|          {                                                                   \
  |  |  |  |  |  |  484|     32|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     32|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     32|          }                                                                   \
  |  |  |  |  |  |  487|     42|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     10|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     10|          break
  ------------------
  260|      5|    FU32TLV(fuzz, TLV_TYPE_NEW_DIRECTORY_PERMS, CURLOPT_NEW_DIRECTORY_PERMS);
  ------------------
  |  |  519|      3|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 3, False: 204k]
  |  |  ------------------
  |  |  520|      3|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 1]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|      3|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      1|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|        {                                                                     \
  |  |  |  |  |  |  491|      1|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|          {                                                                   \
  |  |  |  |  |  |  493|      0|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      0|          }                                                                   \
  |  |  |  |  |  |  496|      1|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      1|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      1|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      1|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|        {                                                                     \
  |  |  |  |  |  |  481|      1|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      1|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|      1|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      0|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      0|          break
  ------------------
  261|     25|    FU32TLV(fuzz, TLV_TYPE_PROXY_TRANSFER_MODE, CURLOPT_PROXY_TRANSFER_MODE);
  ------------------
  |  |  519|     12|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 12, False: 204k]
  |  |  ------------------
  |  |  520|     12|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 5, False: 7]
  |  |  ------------------
  |  |  521|      5|            rc = 255;                                                         \
  |  |  522|      5|            goto EXIT_LABEL;                                                  \
  |  |  523|      5|          }                                                                   \
  |  |  524|     12|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      7|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      7|        {                                                                     \
  |  |  |  |  |  |  491|      7|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      7|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      7|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      6|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      6|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      6|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      6|        {                                                                     \
  |  |  |  |  |  |  481|      6|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      6|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      6|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      6|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      6|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      6|          break
  ------------------
  262|    920|    FU32TLV(fuzz, TLV_TYPE_ADDRESS_SCOPE, CURLOPT_ADDRESS_SCOPE);
  ------------------
  |  |  519|    309|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 309, False: 204k]
  |  |  ------------------
  |  |  520|    309|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 306]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|    309|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    306|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    306|        {                                                                     \
  |  |  |  |  |  |  491|    306|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 305]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    306|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    306|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|    305|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|    305|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|    305|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    305|        {                                                                     \
  |  |  |  |  |  |  481|    305|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    305|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 305]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    305|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    305|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    305|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    305|          break
  ------------------
  263|     23|    FU32TLV(fuzz, TLV_TYPE_CERTINFO, CURLOPT_CERTINFO);
  ------------------
  |  |  519|     10|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 10, False: 204k]
  |  |  ------------------
  |  |  520|     10|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 7]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     10|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      7|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      7|        {                                                                     \
  |  |  |  |  |  |  491|      7|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      7|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      7|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      6|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      6|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      6|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      6|        {                                                                     \
  |  |  |  |  |  |  481|      6|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      6|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      6|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      6|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      6|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      6|          break
  ------------------
  264|    179|    FU32TLV(fuzz, TLV_TYPE_TFTP_BLKSIZE, CURLOPT_TFTP_BLKSIZE);
  ------------------
  |  |  519|     62|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 62, False: 204k]
  |  |  ------------------
  |  |  520|     62|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 59]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     62|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     59|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     59|        {                                                                     \
  |  |  |  |  |  |  491|     59|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 58]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     59|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     59|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     58|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     58|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     58|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     58|        {                                                                     \
  |  |  |  |  |  |  481|     58|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     58|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 58]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     58|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     58|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     58|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     58|          break
  ------------------
  265|      5|    FU32TLV(fuzz, TLV_TYPE_SOCKS5_GSSAPI_NEC, CURLOPT_SOCKS5_GSSAPI_NEC);
  ------------------
  |  |  519|      3|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 3, False: 204k]
  |  |  ------------------
  |  |  520|      3|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 1]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|      3|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      1|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|        {                                                                     \
  |  |  |  |  |  |  491|      1|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|          {                                                                   \
  |  |  |  |  |  |  493|      0|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      0|          }                                                                   \
  |  |  |  |  |  |  496|      1|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      1|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      1|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      1|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|        {                                                                     \
  |  |  |  |  |  |  481|      1|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      1|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|      1|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      0|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      0|          break
  ------------------
  266|     27|    FU32TLV(fuzz, TLV_TYPE_FTP_USE_PRET, CURLOPT_FTP_USE_PRET);
  ------------------
  |  |  519|     12|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 12, False: 204k]
  |  |  ------------------
  |  |  520|     12|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 4, False: 8]
  |  |  ------------------
  |  |  521|      4|            rc = 255;                                                         \
  |  |  522|      4|            goto EXIT_LABEL;                                                  \
  |  |  523|      4|          }                                                                   \
  |  |  524|     12|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      8|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      8|        {                                                                     \
  |  |  |  |  |  |  491|      8|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      8|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      8|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      7|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      7|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      7|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      7|        {                                                                     \
  |  |  |  |  |  |  481|      7|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      7|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      7|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      7|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      7|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      7|          break
  ------------------
  267|    159|    FU32TLV(fuzz, TLV_TYPE_RTSP_SERVER_CSEQ, CURLOPT_RTSP_SERVER_CSEQ);
  ------------------
  |  |  519|     56|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 56, False: 204k]
  |  |  ------------------
  |  |  520|     56|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 4, False: 52]
  |  |  ------------------
  |  |  521|      4|            rc = 255;                                                         \
  |  |  522|      4|            goto EXIT_LABEL;                                                  \
  |  |  523|      4|          }                                                                   \
  |  |  524|     56|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     52|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     52|        {                                                                     \
  |  |  |  |  |  |  491|     52|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 51]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     52|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     52|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     51|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     51|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     51|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     51|        {                                                                     \
  |  |  |  |  |  |  481|     51|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     51|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 51]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     51|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     51|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     51|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     51|          break
  ------------------
  268|  1.39k|    FU32TLV(fuzz, TLV_TYPE_TRANSFER_ENCODING, CURLOPT_TRANSFER_ENCODING);
  ------------------
  |  |  519|    465|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 465, False: 204k]
  |  |  ------------------
  |  |  520|    465|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 463]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|    465|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    463|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    463|        {                                                                     \
  |  |  |  |  |  |  491|    463|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 462]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    463|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    463|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|    462|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|    462|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|    462|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    462|        {                                                                     \
  |  |  |  |  |  |  481|    462|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    462|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 462]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    462|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    462|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    462|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    462|          break
  ------------------
  269|     65|    FU32TLV(fuzz, TLV_TYPE_ACCEPTTIMEOUT_MS, CURLOPT_ACCEPTTIMEOUT_MS);
  ------------------
  |  |  519|     24|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 24, False: 204k]
  |  |  ------------------
  |  |  520|     24|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 21]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     24|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     21|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     21|        {                                                                     \
  |  |  |  |  |  |  491|     21|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 20]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     21|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     21|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     20|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     20|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     20|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     20|        {                                                                     \
  |  |  |  |  |  |  481|     20|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     20|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 20]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     20|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     20|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     20|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     20|          break
  ------------------
  270|    103|    FU32TLV(fuzz, TLV_TYPE_TCP_KEEPALIVE, CURLOPT_TCP_KEEPALIVE);
  ------------------
  |  |  519|     36|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 36, False: 204k]
  |  |  ------------------
  |  |  520|     36|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 34]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     36|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     34|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     34|        {                                                                     \
  |  |  |  |  |  |  491|     34|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 33]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     34|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     34|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     33|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     33|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     33|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     33|        {                                                                     \
  |  |  |  |  |  |  481|     33|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     33|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 33]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     33|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     33|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     33|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     33|          break
  ------------------
  271|    168|    FU32TLV(fuzz, TLV_TYPE_TCP_KEEPIDLE, CURLOPT_TCP_KEEPIDLE);
  ------------------
  |  |  519|     57|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 57, False: 204k]
  |  |  ------------------
  |  |  520|     57|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 1, False: 56]
  |  |  ------------------
  |  |  521|      1|            rc = 255;                                                         \
  |  |  522|      1|            goto EXIT_LABEL;                                                  \
  |  |  523|      1|          }                                                                   \
  |  |  524|     57|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     56|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     56|        {                                                                     \
  |  |  |  |  |  |  491|     56|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 55]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     56|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     56|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     55|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     55|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     55|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     55|        {                                                                     \
  |  |  |  |  |  |  481|     55|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     55|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 55]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     55|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     55|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     55|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     55|          break
  ------------------
  272|    362|    FU32TLV(fuzz, TLV_TYPE_TCP_KEEPINTVL, CURLOPT_TCP_KEEPINTVL);
  ------------------
  |  |  519|    123|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 123, False: 204k]
  |  |  ------------------
  |  |  520|    123|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 120]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|    123|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    120|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    120|        {                                                                     \
  |  |  |  |  |  |  491|    120|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 119]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    120|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    120|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|    119|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|    119|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|    119|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    119|        {                                                                     \
  |  |  |  |  |  |  481|    119|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    119|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 119]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    119|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    119|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    119|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    119|          break
  ------------------
  273|     24|    FU32TLV(fuzz, TLV_TYPE_SASL_IR, CURLOPT_SASL_IR);
  ------------------
  |  |  519|     17|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 17, False: 204k]
  |  |  ------------------
  |  |  520|     17|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 13, False: 4]
  |  |  ------------------
  |  |  521|     13|            rc = 255;                                                         \
  |  |  522|     13|            goto EXIT_LABEL;                                                  \
  |  |  523|     13|          }                                                                   \
  |  |  524|     17|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      4|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      4|        {                                                                     \
  |  |  |  |  |  |  491|      4|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      4|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      4|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      3|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      3|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      3|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      3|        {                                                                     \
  |  |  |  |  |  |  481|      3|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      3|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      3|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      3|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      3|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      3|          break
  ------------------
  274|     58|    FU32TLV(fuzz, TLV_TYPE_SSL_ENABLE_ALPN, CURLOPT_SSL_ENABLE_ALPN);
  ------------------
  |  |  519|     25|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 25, False: 204k]
  |  |  ------------------
  |  |  520|     25|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 8, False: 17]
  |  |  ------------------
  |  |  521|      8|            rc = 255;                                                         \
  |  |  522|      8|            goto EXIT_LABEL;                                                  \
  |  |  523|      8|          }                                                                   \
  |  |  524|     25|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     17|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     17|        {                                                                     \
  |  |  |  |  |  |  491|     17|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 16]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     17|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     17|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     16|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     16|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     16|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     16|        {                                                                     \
  |  |  |  |  |  |  481|     16|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     16|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 16]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     16|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     16|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     16|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     16|          break
  ------------------
  275|    244|    FU32TLV(fuzz, TLV_TYPE_EXPECT_100_TIMEOUT_MS, CURLOPT_EXPECT_100_TIMEOUT_MS);
  ------------------
  |  |  519|     83|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 83, False: 204k]
  |  |  ------------------
  |  |  520|     83|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 81]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     83|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     81|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     81|        {                                                                     \
  |  |  |  |  |  |  491|     81|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 80]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     81|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     81|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     80|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     80|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     80|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     80|        {                                                                     \
  |  |  |  |  |  |  481|     80|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     80|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 80]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     80|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     80|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     80|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     80|          break
  ------------------
  276|     31|    FU32TLV(fuzz, TLV_TYPE_SSL_VERIFYSTATUS, CURLOPT_SSL_VERIFYSTATUS);
  ------------------
  |  |  519|     12|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 12, False: 204k]
  |  |  ------------------
  |  |  520|     12|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 10]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     12|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     10|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     10|        {                                                                     \
  |  |  |  |  |  |  491|     10|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     10|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     10|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      9|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      9|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      9|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      9|        {                                                                     \
  |  |  |  |  |  |  481|      9|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      9|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      9|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      9|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      9|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      9|          break
  ------------------
  277|      5|    FU32TLV(fuzz, TLV_TYPE_SSL_FALSESTART, CURLOPT_SSL_FALSESTART);
  ------------------
  |  |  519|      3|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 3, False: 204k]
  |  |  ------------------
  |  |  520|      3|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 1]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|      3|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      1|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|        {                                                                     \
  |  |  |  |  |  |  491|      1|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|          {                                                                   \
  |  |  |  |  |  |  493|      0|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      0|          }                                                                   \
  |  |  |  |  |  |  496|      1|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      1|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      1|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      1|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|        {                                                                     \
  |  |  |  |  |  |  481|      1|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      1|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|      1|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      0|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      0|          break
  ------------------
  278|     17|    FU32TLV(fuzz, TLV_TYPE_PATH_AS_IS, CURLOPT_PATH_AS_IS);
  ------------------
  |  |  519|      8|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 8, False: 204k]
  |  |  ------------------
  |  |  520|      8|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 5]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|      8|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      5|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      5|        {                                                                     \
  |  |  |  |  |  |  491|      5|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      5|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      5|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      4|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      4|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      4|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      4|        {                                                                     \
  |  |  |  |  |  |  481|      4|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      4|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      4|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      4|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      4|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      4|          break
  ------------------
  279|     67|    FU32TLV(fuzz, TLV_TYPE_PIPEWAIT, CURLOPT_PIPEWAIT);
  ------------------
  |  |  519|     24|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 24, False: 204k]
  |  |  ------------------
  |  |  520|     24|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 22]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     24|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     22|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     22|        {                                                                     \
  |  |  |  |  |  |  491|     22|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 21]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     22|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     22|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     21|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     21|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     21|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     21|        {                                                                     \
  |  |  |  |  |  |  481|     21|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     21|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 21]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     21|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     21|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     21|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     21|          break
  ------------------
  280|    168|    FU32TLV(fuzz, TLV_TYPE_STREAM_WEIGHT, CURLOPT_STREAM_WEIGHT);
  ------------------
  |  |  519|     57|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 57, False: 204k]
  |  |  ------------------
  |  |  520|     57|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 1, False: 56]
  |  |  ------------------
  |  |  521|      1|            rc = 255;                                                         \
  |  |  522|      1|            goto EXIT_LABEL;                                                  \
  |  |  523|      1|          }                                                                   \
  |  |  524|     57|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     56|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     56|        {                                                                     \
  |  |  |  |  |  |  491|     56|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 55]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     56|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     56|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     55|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     55|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     55|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     55|        {                                                                     \
  |  |  |  |  |  |  481|     55|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     55|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 55]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     55|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     55|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     55|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     55|          break
  ------------------
  281|     26|    FU32TLV(fuzz, TLV_TYPE_TFTP_NO_OPTIONS, CURLOPT_TFTP_NO_OPTIONS);
  ------------------
  |  |  519|     11|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 11, False: 204k]
  |  |  ------------------
  |  |  520|     11|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 8]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     11|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      8|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      8|        {                                                                     \
  |  |  |  |  |  |  491|      8|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      8|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      8|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      7|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      7|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      7|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      7|        {                                                                     \
  |  |  |  |  |  |  481|      7|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      7|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      7|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      7|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      7|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      7|          break
  ------------------
  282|     24|    FU32TLV(fuzz, TLV_TYPE_TCP_FASTOPEN, CURLOPT_TCP_FASTOPEN);
  ------------------
  |  |  519|     15|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 15, False: 204k]
  |  |  ------------------
  |  |  520|     15|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 10, False: 5]
  |  |  ------------------
  |  |  521|     10|            rc = 255;                                                         \
  |  |  522|     10|            goto EXIT_LABEL;                                                  \
  |  |  523|     10|          }                                                                   \
  |  |  524|     15|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      5|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      5|        {                                                                     \
  |  |  |  |  |  |  491|      5|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      5|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      5|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      4|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      4|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      4|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      4|        {                                                                     \
  |  |  |  |  |  |  481|      4|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      4|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      4|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      4|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      4|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      4|          break
  ------------------
  283|      9|    FU32TLV(fuzz, TLV_TYPE_KEEP_SENDING_ON_ERROR, CURLOPT_KEEP_SENDING_ON_ERROR);
  ------------------
  |  |  519|      4|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 4, False: 204k]
  |  |  ------------------
  |  |  520|      4|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 1, False: 3]
  |  |  ------------------
  |  |  521|      1|            rc = 255;                                                         \
  |  |  522|      1|            goto EXIT_LABEL;                                                  \
  |  |  523|      1|          }                                                                   \
  |  |  524|      4|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      3|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      3|        {                                                                     \
  |  |  |  |  |  |  491|      3|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      3|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      3|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      2|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      2|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      2|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      2|        {                                                                     \
  |  |  |  |  |  |  481|      2|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      2|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      2|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      2|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      2|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      2|          break
  ------------------
  284|    117|    FU32TLV(fuzz, TLV_TYPE_PROXY_SSL_VERIFYPEER, CURLOPT_PROXY_SSL_VERIFYPEER);
  ------------------
  |  |  519|     40|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 40, False: 204k]
  |  |  ------------------
  |  |  520|     40|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 1, False: 39]
  |  |  ------------------
  |  |  521|      1|            rc = 255;                                                         \
  |  |  522|      1|            goto EXIT_LABEL;                                                  \
  |  |  523|      1|          }                                                                   \
  |  |  524|     40|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     39|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     39|        {                                                                     \
  |  |  |  |  |  |  491|     39|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 38]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     39|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     39|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     38|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     38|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     38|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     38|        {                                                                     \
  |  |  |  |  |  |  481|     38|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     38|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 38]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     38|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     38|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     38|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     38|          break
  ------------------
  285|     33|    FU32TLV(fuzz, TLV_TYPE_PROXY_SSL_VERIFYHOST, CURLOPT_PROXY_SSL_VERIFYHOST);
  ------------------
  |  |  519|     14|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 14, False: 204k]
  |  |  ------------------
  |  |  520|     14|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 4, False: 10]
  |  |  ------------------
  |  |  521|      4|            rc = 255;                                                         \
  |  |  522|      4|            goto EXIT_LABEL;                                                  \
  |  |  523|      4|          }                                                                   \
  |  |  524|     14|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     10|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     10|        {                                                                     \
  |  |  |  |  |  |  491|     10|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     10|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     10|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      9|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      9|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      9|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      9|        {                                                                     \
  |  |  |  |  |  |  481|      9|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      9|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      9|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      9|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      9|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      9|          break
  ------------------
  286|    151|    FU32TLV(fuzz, TLV_TYPE_PROXY_SSL_OPTIONS, CURLOPT_PROXY_SSL_OPTIONS);
  ------------------
  |  |  519|     52|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 52, False: 204k]
  |  |  ------------------
  |  |  520|     52|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 50]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     52|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     50|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     50|        {                                                                     \
  |  |  |  |  |  |  491|     50|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 49]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     50|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     50|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     49|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     49|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     49|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     49|        {                                                                     \
  |  |  |  |  |  |  481|     49|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     49|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 49]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     49|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     49|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     49|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     49|          break
  ------------------
  287|     55|    FU32TLV(fuzz, TLV_TYPE_SUPPRESS_CONNECT_HEADERS, CURLOPT_SUPPRESS_CONNECT_HEADERS);
  ------------------
  |  |  519|     20|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 20, False: 204k]
  |  |  ------------------
  |  |  520|     20|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 18]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     20|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     18|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     18|        {                                                                     \
  |  |  |  |  |  |  491|     18|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 17]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     18|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     18|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     17|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     17|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     17|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     17|        {                                                                     \
  |  |  |  |  |  |  481|     17|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     17|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 17]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     17|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     17|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     17|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     17|          break
  ------------------
  288|     40|    FU32TLV(fuzz, TLV_TYPE_SOCKS5_AUTH, CURLOPT_SOCKS5_AUTH);
  ------------------
  |  |  519|     15|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 15, False: 204k]
  |  |  ------------------
  |  |  520|     15|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 13]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     15|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     13|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     13|        {                                                                     \
  |  |  |  |  |  |  491|     13|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 12]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     13|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     13|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     12|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     12|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     12|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     12|        {                                                                     \
  |  |  |  |  |  |  481|     12|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     12|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 7, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     12|          {                                                                   \
  |  |  |  |  |  |  484|      7|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      7|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      7|          }                                                                   \
  |  |  |  |  |  |  487|     12|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      5|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      5|          break
  ------------------
  289|     11|    FU32TLV(fuzz, TLV_TYPE_SSH_COMPRESSION, CURLOPT_SSH_COMPRESSION);
  ------------------
  |  |  519|      5|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 5, False: 204k]
  |  |  ------------------
  |  |  520|      5|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 3]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|      5|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      3|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      3|        {                                                                     \
  |  |  |  |  |  |  491|      3|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 0, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      3|          {                                                                   \
  |  |  |  |  |  |  493|      0|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      0|          }                                                                   \
  |  |  |  |  |  |  496|      3|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      3|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      3|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      3|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      3|        {                                                                     \
  |  |  |  |  |  |  481|      3|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      3|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 3, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      3|          {                                                                   \
  |  |  |  |  |  |  484|      3|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      3|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      3|          }                                                                   \
  |  |  |  |  |  |  487|      3|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      0|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      0|          break
  ------------------
  290|     98|    FU32TLV(fuzz, TLV_TYPE_HAPPY_EYEBALLS_TIMEOUT_MS, CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS);
  ------------------
  |  |  519|     35|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 35, False: 204k]
  |  |  ------------------
  |  |  520|     35|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 32]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     35|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     32|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     32|        {                                                                     \
  |  |  |  |  |  |  491|     32|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 31]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     32|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     32|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     31|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     31|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     31|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     31|        {                                                                     \
  |  |  |  |  |  |  481|     31|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     31|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 31]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     31|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     31|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     31|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     31|          break
  ------------------
  291|     60|    FU32TLV(fuzz, TLV_TYPE_HAPROXYPROTOCOL, CURLOPT_HAPROXYPROTOCOL);
  ------------------
  |  |  519|     25|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 25, False: 204k]
  |  |  ------------------
  |  |  520|     25|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 7, False: 18]
  |  |  ------------------
  |  |  521|      7|            rc = 255;                                                         \
  |  |  522|      7|            goto EXIT_LABEL;                                                  \
  |  |  523|      7|          }                                                                   \
  |  |  524|     25|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     18|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     18|        {                                                                     \
  |  |  |  |  |  |  491|     18|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 17]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     18|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     18|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     17|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     17|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     17|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     17|        {                                                                     \
  |  |  |  |  |  |  481|     17|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     17|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 17]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     17|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     17|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     17|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     17|          break
  ------------------
  292|    142|    FU32TLV(fuzz, TLV_TYPE_DNS_SHUFFLE_ADDRESSES, CURLOPT_DNS_SHUFFLE_ADDRESSES);
  ------------------
  |  |  519|     49|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 49, False: 204k]
  |  |  ------------------
  |  |  520|     49|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 47]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     49|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     47|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     47|        {                                                                     \
  |  |  |  |  |  |  491|     47|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 46]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     47|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     47|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     46|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     46|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     46|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     46|        {                                                                     \
  |  |  |  |  |  |  481|     46|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     46|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 46]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     46|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     46|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     46|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     46|          break
  ------------------
  293|     21|    FU32TLV(fuzz, TLV_TYPE_DISALLOW_USERNAME_IN_URL, CURLOPT_DISALLOW_USERNAME_IN_URL);
  ------------------
  |  |  519|     10|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 10, False: 204k]
  |  |  ------------------
  |  |  520|     10|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 4, False: 6]
  |  |  ------------------
  |  |  521|      4|            rc = 255;                                                         \
  |  |  522|      4|            goto EXIT_LABEL;                                                  \
  |  |  523|      4|          }                                                                   \
  |  |  524|     10|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      6|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      6|        {                                                                     \
  |  |  |  |  |  |  491|      6|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      6|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      6|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      5|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      5|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      5|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      5|        {                                                                     \
  |  |  |  |  |  |  481|      5|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      5|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      5|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      5|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      5|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      5|          break
  ------------------
  294|    453|    FU32TLV(fuzz, TLV_TYPE_UPLOAD_BUFFERSIZE, CURLOPT_UPLOAD_BUFFERSIZE);
  ------------------
  |  |  519|    154|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 154, False: 204k]
  |  |  ------------------
  |  |  520|    154|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 4, False: 150]
  |  |  ------------------
  |  |  521|      4|            rc = 255;                                                         \
  |  |  522|      4|            goto EXIT_LABEL;                                                  \
  |  |  523|      4|          }                                                                   \
  |  |  524|    154|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    150|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    150|        {                                                                     \
  |  |  |  |  |  |  491|    150|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 149]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    150|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    150|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|    149|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|    149|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|    149|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    149|        {                                                                     \
  |  |  |  |  |  |  481|    149|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    149|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 149]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    149|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    149|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    149|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    149|          break
  ------------------
  295|     91|    FU32TLV(fuzz, TLV_TYPE_UPKEEP_INTERVAL_MS, CURLOPT_UPKEEP_INTERVAL_MS);
  ------------------
  |  |  519|     32|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 32, False: 204k]
  |  |  ------------------
  |  |  520|     32|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 30]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     32|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     30|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     30|        {                                                                     \
  |  |  |  |  |  |  491|     30|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 29]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     30|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     30|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     29|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     29|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     29|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     29|        {                                                                     \
  |  |  |  |  |  |  481|     29|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     29|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 29]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     29|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     29|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     29|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     29|          break
  ------------------
  296|     25|    FU32TLV(fuzz, TLV_TYPE_HTTP09_ALLOWED, CURLOPT_HTTP09_ALLOWED);
  ------------------
  |  |  519|     10|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 10, False: 204k]
  |  |  ------------------
  |  |  520|     10|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 8]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     10|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      8|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      8|        {                                                                     \
  |  |  |  |  |  |  491|      8|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      8|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      8|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      7|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      7|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      7|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      7|        {                                                                     \
  |  |  |  |  |  |  481|      7|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      7|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      7|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      7|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      7|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      7|          break
  ------------------
  297|    126|    FU32TLV(fuzz, TLV_TYPE_ALTSVC_CTRL, CURLOPT_ALTSVC_CTRL);
  ------------------
  |  |  519|     45|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 45, False: 204k]
  |  |  ------------------
  |  |  520|     45|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 4, False: 41]
  |  |  ------------------
  |  |  521|      4|            rc = 255;                                                         \
  |  |  522|      4|            goto EXIT_LABEL;                                                  \
  |  |  523|      4|          }                                                                   \
  |  |  524|     45|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     41|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     41|        {                                                                     \
  |  |  |  |  |  |  491|     41|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 40]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     41|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     41|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     40|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     40|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     40|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     40|        {                                                                     \
  |  |  |  |  |  |  481|     40|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     40|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 39]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     40|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|     40|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     39|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     39|          break
  ------------------
  298|    175|    FU32TLV(fuzz, TLV_TYPE_MAXAGE_CONN, CURLOPT_MAXAGE_CONN);
  ------------------
  |  |  519|     60|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 60, False: 204k]
  |  |  ------------------
  |  |  520|     60|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 58]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     60|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     58|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     58|        {                                                                     \
  |  |  |  |  |  |  491|     58|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 57]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     58|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     58|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     57|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     57|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     57|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     57|        {                                                                     \
  |  |  |  |  |  |  481|     57|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     57|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 57]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     57|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     57|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     57|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     57|          break
  ------------------
  299|     20|    FU32TLV(fuzz, TLV_TYPE_MAIL_RCPT_ALLOWFAILS, CURLOPT_MAIL_RCPT_ALLOWFAILS);
  ------------------
  |  |  519|      9|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 9, False: 204k]
  |  |  ------------------
  |  |  520|      9|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 6]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|      9|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      6|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      6|        {                                                                     \
  |  |  |  |  |  |  491|      6|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      6|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      6|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      5|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      5|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      5|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      5|        {                                                                     \
  |  |  |  |  |  |  481|      5|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      5|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      5|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      5|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      5|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      5|          break
  ------------------
  300|     21|    FU32TLV(fuzz, TLV_TYPE_HSTS_CTRL, CURLOPT_HSTS_CTRL);
  ------------------
  |  |  519|      8|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 8, False: 204k]
  |  |  ------------------
  |  |  520|      8|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 1, False: 7]
  |  |  ------------------
  |  |  521|      1|            rc = 255;                                                         \
  |  |  522|      1|            goto EXIT_LABEL;                                                  \
  |  |  523|      1|          }                                                                   \
  |  |  524|      8|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      7|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      7|        {                                                                     \
  |  |  |  |  |  |  491|      7|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      7|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      7|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      6|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      6|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      6|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      6|        {                                                                     \
  |  |  |  |  |  |  481|      6|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      6|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      6|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      6|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      6|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      6|          break
  ------------------
  301|     17|    FU32TLV(fuzz, TLV_TYPE_DOH_SSL_VERIFYPEER, CURLOPT_DOH_SSL_VERIFYPEER);
  ------------------
  |  |  519|     10|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 10, False: 204k]
  |  |  ------------------
  |  |  520|     10|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 6, False: 4]
  |  |  ------------------
  |  |  521|      6|            rc = 255;                                                         \
  |  |  522|      6|            goto EXIT_LABEL;                                                  \
  |  |  523|      6|          }                                                                   \
  |  |  524|     10|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      4|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      4|        {                                                                     \
  |  |  |  |  |  |  491|      4|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      4|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      4|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      3|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      3|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      3|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      3|        {                                                                     \
  |  |  |  |  |  |  481|      3|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      3|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      3|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      3|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      3|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      3|          break
  ------------------
  302|     25|    FU32TLV(fuzz, TLV_TYPE_DOH_SSL_VERIFYHOST, CURLOPT_DOH_SSL_VERIFYHOST);
  ------------------
  |  |  519|     14|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 14, False: 204k]
  |  |  ------------------
  |  |  520|     14|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 8, False: 6]
  |  |  ------------------
  |  |  521|      8|            rc = 255;                                                         \
  |  |  522|      8|            goto EXIT_LABEL;                                                  \
  |  |  523|      8|          }                                                                   \
  |  |  524|     14|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      6|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      6|        {                                                                     \
  |  |  |  |  |  |  491|      6|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      6|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      6|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      5|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      5|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      5|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      5|        {                                                                     \
  |  |  |  |  |  |  481|      5|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      5|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      5|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      5|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      5|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      5|          break
  ------------------
  303|     28|    FU32TLV(fuzz, TLV_TYPE_DOH_SSL_VERIFYSTATUS, CURLOPT_DOH_SSL_VERIFYSTATUS);
  ------------------
  |  |  519|     11|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 11, False: 204k]
  |  |  ------------------
  |  |  520|     11|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 9]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     11|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      9|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      9|        {                                                                     \
  |  |  |  |  |  |  491|      9|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 8]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      9|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      9|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      8|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      8|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      8|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      8|        {                                                                     \
  |  |  |  |  |  |  481|      8|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      8|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 8]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      8|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      8|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      8|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      8|          break
  ------------------
  304|    169|    FU32TLV(fuzz, TLV_TYPE_MAXLIFETIME_CONN, CURLOPT_MAXLIFETIME_CONN);
  ------------------
  |  |  519|     64|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 64, False: 204k]
  |  |  ------------------
  |  |  520|     64|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 11, False: 53]
  |  |  ------------------
  |  |  521|     11|            rc = 255;                                                         \
  |  |  522|     11|            goto EXIT_LABEL;                                                  \
  |  |  523|     11|          }                                                                   \
  |  |  524|     64|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     53|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     53|        {                                                                     \
  |  |  |  |  |  |  491|     53|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 52]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     53|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     53|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     52|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     52|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     52|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     52|        {                                                                     \
  |  |  |  |  |  |  481|     52|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     52|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 52]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     52|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     52|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     52|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     52|          break
  ------------------
  305|     37|    FU32TLV(fuzz, TLV_TYPE_MIME_OPTIONS, CURLOPT_MIME_OPTIONS);
  ------------------
  |  |  519|     14|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 14, False: 204k]
  |  |  ------------------
  |  |  520|     14|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 12]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     14|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     12|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     12|        {                                                                     \
  |  |  |  |  |  |  491|     12|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 11]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     12|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     12|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     11|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     11|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     11|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     11|        {                                                                     \
  |  |  |  |  |  |  481|     11|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     11|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 11]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     11|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     11|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     11|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     11|          break
  ------------------
  306|    157|    FU32TLV(fuzz, TLV_TYPE_CA_CACHE_TIMEOUT, CURLOPT_CA_CACHE_TIMEOUT);
  ------------------
  |  |  519|     54|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 54, False: 204k]
  |  |  ------------------
  |  |  520|     54|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 52]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     54|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     52|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     52|        {                                                                     \
  |  |  |  |  |  |  491|     52|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 51]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     52|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     52|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     51|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     51|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     51|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     51|        {                                                                     \
  |  |  |  |  |  |  481|     51|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     51|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 51]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     51|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     51|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     51|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     51|          break
  ------------------
  307|     20|    FU32TLV(fuzz, TLV_TYPE_QUICK_EXIT, CURLOPT_QUICK_EXIT);
  ------------------
  |  |  519|      9|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 9, False: 204k]
  |  |  ------------------
  |  |  520|      9|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 6]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|      9|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      6|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      6|        {                                                                     \
  |  |  |  |  |  |  491|      6|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      6|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      6|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      5|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      5|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      5|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      5|        {                                                                     \
  |  |  |  |  |  |  481|      5|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      5|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      5|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      5|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      5|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      5|          break
  ------------------
  308|    127|    FU32TLV(fuzz, TLV_TYPE_SERVER_RESPONSE_TIMEOUT_MS, CURLOPT_SERVER_RESPONSE_TIMEOUT_MS);
  ------------------
  |  |  519|     44|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 44, False: 204k]
  |  |  ------------------
  |  |  520|     44|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 42]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     44|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     42|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     42|        {                                                                     \
  |  |  |  |  |  |  491|     42|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 41]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     42|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     42|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     41|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     41|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     41|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     41|        {                                                                     \
  |  |  |  |  |  |  481|     41|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     41|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 41]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     41|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     41|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     41|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     41|          break
  ------------------
  309|    155|    FU32TLV(fuzz, TLV_TYPE_TCP_KEEPCNT, CURLOPT_TCP_KEEPCNT);
  ------------------
  |  |  519|     54|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 54, False: 204k]
  |  |  ------------------
  |  |  520|     54|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 51]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     54|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     51|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     51|        {                                                                     \
  |  |  |  |  |  |  491|     51|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 50]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     51|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     51|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     50|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     50|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     50|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     50|        {                                                                     \
  |  |  |  |  |  |  481|     50|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     50|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 50]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     50|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     50|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     50|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     50|          break
  ------------------
  310|    154|    FU32TLV(fuzz, TLV_TYPE_SSLVERSION, CURLOPT_SSLVERSION);
  ------------------
  |  |  519|     53|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 53, False: 204k]
  |  |  ------------------
  |  |  520|     53|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 51]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     53|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     51|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     51|        {                                                                     \
  |  |  |  |  |  |  491|     51|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 50]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     51|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     51|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     50|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     50|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     50|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     50|        {                                                                     \
  |  |  |  |  |  |  481|     50|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     50|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 13, False: 37]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     50|          {                                                                   \
  |  |  |  |  |  |  484|     13|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     13|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     13|          }                                                                   \
  |  |  |  |  |  |  487|     50|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     37|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     37|          break
  ------------------
  311|    434|    FU32TLV(fuzz, TLV_TYPE_TIMECONDITION, CURLOPT_TIMECONDITION);
  ------------------
  |  |  519|    147|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 147, False: 204k]
  |  |  ------------------
  |  |  520|    147|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 144]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|    147|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    144|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    144|        {                                                                     \
  |  |  |  |  |  |  491|    144|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 143]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    144|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    144|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|    143|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|    143|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|    143|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    143|        {                                                                     \
  |  |  |  |  |  |  481|    143|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    143|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 34, False: 109]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    143|          {                                                                   \
  |  |  |  |  |  |  484|     34|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     34|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     34|          }                                                                   \
  |  |  |  |  |  |  487|    143|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    109|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    109|          break
  ------------------
  312|    244|    FU32TLV(fuzz, TLV_TYPE_PROXYAUTH, CURLOPT_PROXYAUTH);
  ------------------
  |  |  519|     83|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 83, False: 204k]
  |  |  ------------------
  |  |  520|     83|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 81]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     83|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     81|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     81|        {                                                                     \
  |  |  |  |  |  |  491|     81|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 80]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     81|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     81|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     80|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     80|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     80|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     80|        {                                                                     \
  |  |  |  |  |  |  481|     80|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     80|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 79]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     80|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|     80|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     79|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     79|          break
  ------------------
  313|    120|    FU32TLV(fuzz, TLV_TYPE_IPRESOLVE, CURLOPT_IPRESOLVE);
  ------------------
  |  |  519|     41|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 41, False: 204k]
  |  |  ------------------
  |  |  520|     41|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 1, False: 40]
  |  |  ------------------
  |  |  521|      1|            rc = 255;                                                         \
  |  |  522|      1|            goto EXIT_LABEL;                                                  \
  |  |  523|      1|          }                                                                   \
  |  |  524|     41|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     40|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     40|        {                                                                     \
  |  |  |  |  |  |  491|     40|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 39]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     40|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     40|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     39|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     39|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     39|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     39|        {                                                                     \
  |  |  |  |  |  |  481|     39|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     39|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 26, False: 13]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     39|          {                                                                   \
  |  |  |  |  |  |  484|     26|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     26|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     26|          }                                                                   \
  |  |  |  |  |  |  487|     39|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     13|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     13|          break
  ------------------
  314|    127|    FU32TLV(fuzz, TLV_TYPE_USE_SSL, CURLOPT_USE_SSL);
  ------------------
  |  |  519|     44|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 44, False: 204k]
  |  |  ------------------
  |  |  520|     44|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 42]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     44|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     42|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     42|        {                                                                     \
  |  |  |  |  |  |  491|     42|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 41]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     42|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     42|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     41|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     41|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     41|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     41|        {                                                                     \
  |  |  |  |  |  |  481|     41|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     41|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 30, False: 11]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     41|          {                                                                   \
  |  |  |  |  |  |  484|     30|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     30|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     30|          }                                                                   \
  |  |  |  |  |  |  487|     41|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     11|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     11|          break
  ------------------
  315|    138|    FU32TLV(fuzz, TLV_TYPE_FTPSSLAUTH, CURLOPT_FTPSSLAUTH);
  ------------------
  |  |  519|     47|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 47, False: 204k]
  |  |  ------------------
  |  |  520|     47|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 1, False: 46]
  |  |  ------------------
  |  |  521|      1|            rc = 255;                                                         \
  |  |  522|      1|            goto EXIT_LABEL;                                                  \
  |  |  523|      1|          }                                                                   \
  |  |  524|     47|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     46|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     46|        {                                                                     \
  |  |  |  |  |  |  491|     46|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 45]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     46|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     46|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     45|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     45|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     45|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     45|        {                                                                     \
  |  |  |  |  |  |  481|     45|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     45|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 36, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     45|          {                                                                   \
  |  |  |  |  |  |  484|     36|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     36|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     36|          }                                                                   \
  |  |  |  |  |  |  487|     45|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      9|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      9|          break
  ------------------
  316|    139|    FU32TLV(fuzz, TLV_TYPE_FTP_FILEMETHOD, CURLOPT_FTP_FILEMETHOD);
  ------------------
  |  |  519|     52|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 52, False: 204k]
  |  |  ------------------
  |  |  520|     52|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 8, False: 44]
  |  |  ------------------
  |  |  521|      8|            rc = 255;                                                         \
  |  |  522|      8|            goto EXIT_LABEL;                                                  \
  |  |  523|      8|          }                                                                   \
  |  |  524|     52|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     44|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     44|        {                                                                     \
  |  |  |  |  |  |  491|     44|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 43]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     44|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     44|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     43|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     43|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     43|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     43|        {                                                                     \
  |  |  |  |  |  |  481|     43|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     43|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 28, False: 15]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     43|          {                                                                   \
  |  |  |  |  |  |  484|     28|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     28|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     28|          }                                                                   \
  |  |  |  |  |  |  487|     43|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     15|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     15|          break
  ------------------
  317|      6|    FU32TLV(fuzz, TLV_TYPE_SSH_AUTH_TYPES, CURLOPT_SSH_AUTH_TYPES);
  ------------------
  |  |  519|      4|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 4, False: 204k]
  |  |  ------------------
  |  |  520|      4|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 1]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|      4|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      1|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|        {                                                                     \
  |  |  |  |  |  |  491|      1|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|          {                                                                   \
  |  |  |  |  |  |  493|      0|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      0|          }                                                                   \
  |  |  |  |  |  |  496|      1|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      1|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      1|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      1|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|        {                                                                     \
  |  |  |  |  |  |  481|      1|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      1|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|      1|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      0|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      0|          break
  ------------------
  318|    112|    FU32TLV(fuzz, TLV_TYPE_POSTREDIR, CURLOPT_POSTREDIR);
  ------------------
  |  |  519|     43|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 43, False: 204k]
  |  |  ------------------
  |  |  520|     43|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 8, False: 35]
  |  |  ------------------
  |  |  521|      8|            rc = 255;                                                         \
  |  |  522|      8|            goto EXIT_LABEL;                                                  \
  |  |  523|      8|          }                                                                   \
  |  |  524|     43|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     35|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     35|        {                                                                     \
  |  |  |  |  |  |  491|     35|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 34]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     35|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     35|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     34|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     34|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     34|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     34|        {                                                                     \
  |  |  |  |  |  |  481|     34|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     34|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 34]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     34|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     34|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     34|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     34|          break
  ------------------
  319|      5|    FU32TLV(fuzz, TLV_TYPE_GSSAPI_DELEGATION, CURLOPT_GSSAPI_DELEGATION);
  ------------------
  |  |  519|      3|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 3, False: 204k]
  |  |  ------------------
  |  |  520|      3|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 1]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|      3|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      1|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|        {                                                                     \
  |  |  |  |  |  |  491|      1|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|          {                                                                   \
  |  |  |  |  |  |  493|      0|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      0|          }                                                                   \
  |  |  |  |  |  |  496|      1|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      1|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      1|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      1|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|        {                                                                     \
  |  |  |  |  |  |  481|      1|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      1|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|      1|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      0|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      0|          break
  ------------------
  320|     31|    FU32TLV(fuzz, TLV_TYPE_SSL_OPTIONS, CURLOPT_SSL_OPTIONS);
  ------------------
  |  |  519|     12|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 12, False: 204k]
  |  |  ------------------
  |  |  520|     12|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 10]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|     12|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     10|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     10|        {                                                                     \
  |  |  |  |  |  |  491|     10|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     10|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     10|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      9|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      9|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      9|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      9|        {                                                                     \
  |  |  |  |  |  |  481|      9|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      9|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      9|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      9|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      9|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      9|          break
  ------------------
  321|  1.05k|    FU32TLV(fuzz, TLV_TYPE_HEADEROPT, CURLOPT_HEADEROPT);
  ------------------
  |  |  519|    352|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 352, False: 204k]
  |  |  ------------------
  |  |  520|    352|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 350]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|    352|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    350|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    350|        {                                                                     \
  |  |  |  |  |  |  491|    350|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 349]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    350|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    350|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|    349|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|    349|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|    349|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    349|        {                                                                     \
  |  |  |  |  |  |  481|    349|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    349|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 349]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    349|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    349|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    349|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    349|          break
  ------------------
  322|     68|    FU32TLV(fuzz, TLV_TYPE_PROXY_SSLVERSION, CURLOPT_PROXY_SSLVERSION);
  ------------------
  |  |  519|     25|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 25, False: 204k]
  |  |  ------------------
  |  |  520|     25|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 22]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     25|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     22|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     22|        {                                                                     \
  |  |  |  |  |  |  491|     22|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 21]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     22|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     22|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     21|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     21|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     21|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     21|        {                                                                     \
  |  |  |  |  |  |  481|     21|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     21|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 15, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     21|          {                                                                   \
  |  |  |  |  |  |  484|     15|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     15|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     15|          }                                                                   \
  |  |  |  |  |  |  487|     21|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      6|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      6|          break
  ------------------
  323|    634|    FU32TLV(fuzz, TLV_TYPE_RESUME_FROM_LARGE, CURLOPT_RESUME_FROM_LARGE);
  ------------------
  |  |  519|    213|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 213, False: 204k]
  |  |  ------------------
  |  |  520|    213|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 2, False: 211]
  |  |  ------------------
  |  |  521|      2|            rc = 255;                                                         \
  |  |  522|      2|            goto EXIT_LABEL;                                                  \
  |  |  523|      2|          }                                                                   \
  |  |  524|    213|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    211|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    211|        {                                                                     \
  |  |  |  |  |  |  491|    211|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 210]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    211|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    211|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|    210|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|    210|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|    210|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    210|        {                                                                     \
  |  |  |  |  |  |  481|    210|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    210|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 210]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    210|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    210|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    210|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    210|          break
  ------------------
  324|    227|    FU32TLV(fuzz, TLV_TYPE_MAXFILESIZE_LARGE, CURLOPT_MAXFILESIZE_LARGE);
  ------------------
  |  |  519|     78|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 78, False: 204k]
  |  |  ------------------
  |  |  520|     78|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 3, False: 75]
  |  |  ------------------
  |  |  521|      3|            rc = 255;                                                         \
  |  |  522|      3|            goto EXIT_LABEL;                                                  \
  |  |  523|      3|          }                                                                   \
  |  |  524|     78|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     75|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     75|        {                                                                     \
  |  |  |  |  |  |  491|     75|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 74]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     75|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     75|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     74|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|     74|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|     74|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     74|        {                                                                     \
  |  |  |  |  |  |  481|     74|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     74|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 74]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     74|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     74|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     74|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|     74|          break
  ------------------
  325|       |    // too easy for API misuse FU32TLV(fuzz, TLV_TYPE_POSTFIELDSIZE_LARGE, CURLOPT_POSTFIELDSIZE_LARGE);
  326|    882|    FU32TLV(fuzz, TLV_TYPE_MAX_SEND_SPEED_LARGE, CURLOPT_MAX_SEND_SPEED_LARGE);
  ------------------
  |  |  519|    295|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 295, False: 204k]
  |  |  ------------------
  |  |  520|    295|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 1, False: 294]
  |  |  ------------------
  |  |  521|      1|            rc = 255;                                                         \
  |  |  522|      1|            goto EXIT_LABEL;                                                  \
  |  |  523|      1|          }                                                                   \
  |  |  524|    295|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    294|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    294|        {                                                                     \
  |  |  |  |  |  |  491|    294|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 293]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    294|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    294|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|    293|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|    293|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|    293|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    293|        {                                                                     \
  |  |  |  |  |  |  481|    293|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    293|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 293]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    293|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    293|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    293|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    293|          break
  ------------------
  327|  2.20k|    FU32TLV(fuzz, TLV_TYPE_MAX_RECV_SPEED_LARGE, CURLOPT_MAX_RECV_SPEED_LARGE);
  ------------------
  |  |  519|    737|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 737, False: 203k]
  |  |  ------------------
  |  |  520|    737|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 4, False: 733]
  |  |  ------------------
  |  |  521|      4|            rc = 255;                                                         \
  |  |  522|      4|            goto EXIT_LABEL;                                                  \
  |  |  523|      4|          }                                                                   \
  |  |  524|    737|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    733|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    733|        {                                                                     \
  |  |  |  |  |  |  491|    733|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 732]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    733|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    733|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|    732|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|    732|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|    732|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    732|        {                                                                     \
  |  |  |  |  |  |  481|    732|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    732|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 732]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    732|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    732|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    732|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|    732|          break
  ------------------
  328|     22|    FU32TLV(fuzz, TLV_TYPE_TIMEVALUE_LARGE, CURLOPT_TIMEVALUE_LARGE);
  ------------------
  |  |  519|     13|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (519:9): [True: 13, False: 204k]
  |  |  ------------------
  |  |  520|     13|          if(tlv->length != 4) {                                              \
  |  |  ------------------
  |  |  |  Branch (520:14): [True: 8, False: 5]
  |  |  ------------------
  |  |  521|      8|            rc = 255;                                                         \
  |  |  522|      8|            goto EXIT_LABEL;                                                  \
  |  |  523|      8|          }                                                                   \
  |  |  524|     13|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      5|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      5|        {                                                                     \
  |  |  |  |  |  |  491|      5|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      5|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      5|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      4|          tmp_u32 = to_u32(tlv->value);                                       \
  |  |  526|      4|          FSET_OPTION(FUZZP, OPTNAME, tmp_u32);                               \
  |  |  ------------------
  |  |  |  |  499|      4|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      4|        {                                                                     \
  |  |  |  |  |  |  481|      4|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      4|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      4|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      4|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      4|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  527|      4|          break
  ------------------
  329|       |
  330|       |    /* Define a set of singleton TLVs - they can only have their value set once
  331|       |       and all follow the same pattern. */
  332|  27.7k|    FSINGLETONTLV(fuzz, TLV_TYPE_URL, CURLOPT_URL);
  ------------------
  |  |  506|  13.8k|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 13.8k, False: 190k]
  |  |  ------------------
  |  |  507|  13.8k|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|  13.8k|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|  13.8k|        {                                                                     \
  |  |  |  |  |  |  491|  13.8k|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 13.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|  13.8k|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|  13.8k|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|  13.8k|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|  13.8k|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|  13.8k|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|  13.8k|        {                                                                     \
  |  |  |  |  |  |  481|  13.8k|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|  13.8k|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 13.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|  13.8k|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|  13.8k|        }
  |  |  |  |  ------------------
  |  |  |  |  500|  13.8k|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|  13.8k|          break
  ------------------
  333|    711|    FSINGLETONTLV(fuzz, TLV_TYPE_DOH_URL, CURLOPT_DOH_URL);
  ------------------
  |  |  506|    356|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 356, False: 204k]
  |  |  ------------------
  |  |  507|    356|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    356|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    356|        {                                                                     \
  |  |  |  |  |  |  491|    356|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 355]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    356|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    356|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    355|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    355|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    355|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    355|        {                                                                     \
  |  |  |  |  |  |  481|    355|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    355|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 355]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    355|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    355|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    355|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    355|          break
  ------------------
  334|     83|    FSINGLETONTLV(fuzz, TLV_TYPE_USERNAME, CURLOPT_USERNAME);
  ------------------
  |  |  506|     42|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 42, False: 204k]
  |  |  ------------------
  |  |  507|     42|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     42|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     42|        {                                                                     \
  |  |  |  |  |  |  491|     42|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 41]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     42|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     42|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     41|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     41|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     41|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     41|        {                                                                     \
  |  |  |  |  |  |  481|     41|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     41|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 41]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     41|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     41|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     41|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     41|          break
  ------------------
  335|    241|    FSINGLETONTLV(fuzz, TLV_TYPE_PASSWORD, CURLOPT_PASSWORD);
  ------------------
  |  |  506|    121|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 121, False: 204k]
  |  |  ------------------
  |  |  507|    121|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    121|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    121|        {                                                                     \
  |  |  |  |  |  |  491|    121|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 120]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    121|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    121|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    120|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    120|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    120|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    120|        {                                                                     \
  |  |  |  |  |  |  481|    120|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    120|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 120]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    120|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    120|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    120|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    120|          break
  ------------------
  336|    359|    FSINGLETONTLV(fuzz, TLV_TYPE_COOKIE, CURLOPT_COOKIE);
  ------------------
  |  |  506|    180|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 180, False: 204k]
  |  |  ------------------
  |  |  507|    180|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    180|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    180|        {                                                                     \
  |  |  |  |  |  |  491|    180|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 179]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    180|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    180|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    179|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    179|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    179|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    179|        {                                                                     \
  |  |  |  |  |  |  481|    179|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    179|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 179]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    179|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    179|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    179|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    179|          break
  ------------------
  337|    711|    FSINGLETONTLV(fuzz, TLV_TYPE_RANGE, CURLOPT_RANGE);
  ------------------
  |  |  506|    356|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 356, False: 204k]
  |  |  ------------------
  |  |  507|    356|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    356|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    356|        {                                                                     \
  |  |  |  |  |  |  491|    356|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 355]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    356|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    356|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    355|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    355|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    355|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    355|        {                                                                     \
  |  |  |  |  |  |  481|    355|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    355|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 355]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    355|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    355|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    355|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    355|          break
  ------------------
  338|    249|    FSINGLETONTLV(fuzz, TLV_TYPE_CUSTOMREQUEST, CURLOPT_CUSTOMREQUEST);
  ------------------
  |  |  506|    125|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 125, False: 204k]
  |  |  ------------------
  |  |  507|    125|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    125|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    125|        {                                                                     \
  |  |  |  |  |  |  491|    125|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 124]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    125|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    125|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    124|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    124|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    124|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    124|        {                                                                     \
  |  |  |  |  |  |  481|    124|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    124|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 124]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    124|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    124|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    124|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    124|          break
  ------------------
  339|    119|    FSINGLETONTLV(fuzz, TLV_TYPE_MAIL_FROM, CURLOPT_MAIL_FROM);
  ------------------
  |  |  506|     60|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 60, False: 204k]
  |  |  ------------------
  |  |  507|     60|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     60|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     60|        {                                                                     \
  |  |  |  |  |  |  491|     60|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 59]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     60|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     60|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     59|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     59|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     59|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     59|        {                                                                     \
  |  |  |  |  |  |  481|     59|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     59|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 59]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     59|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     59|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     59|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     59|          break
  ------------------
  340|    349|    FSINGLETONTLV(fuzz, TLV_TYPE_ACCEPTENCODING, CURLOPT_ACCEPT_ENCODING);
  ------------------
  |  |  506|    175|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 175, False: 204k]
  |  |  ------------------
  |  |  507|    175|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    175|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    175|        {                                                                     \
  |  |  |  |  |  |  491|    175|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 174]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    175|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    175|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    174|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    174|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    174|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    174|        {                                                                     \
  |  |  |  |  |  |  481|    174|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    174|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 174]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    174|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    174|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    174|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    174|          break
  ------------------
  341|     59|    FSINGLETONTLV(fuzz, TLV_TYPE_RTSP_SESSION_ID, CURLOPT_RTSP_SESSION_ID);
  ------------------
  |  |  506|     30|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 30, False: 204k]
  |  |  ------------------
  |  |  507|     30|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     30|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     30|        {                                                                     \
  |  |  |  |  |  |  491|     30|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 29]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     30|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     30|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     29|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     29|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     29|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     29|        {                                                                     \
  |  |  |  |  |  |  481|     29|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     29|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 29]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     29|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     29|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     29|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     29|          break
  ------------------
  342|     31|    FSINGLETONTLV(fuzz, TLV_TYPE_RTSP_STREAM_URI, CURLOPT_RTSP_STREAM_URI);
  ------------------
  |  |  506|     16|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 16, False: 204k]
  |  |  ------------------
  |  |  507|     16|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     16|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     16|        {                                                                     \
  |  |  |  |  |  |  491|     16|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 15]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     16|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     16|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     15|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     15|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     15|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     15|        {                                                                     \
  |  |  |  |  |  |  481|     15|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     15|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 15]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     15|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     15|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     15|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     15|          break
  ------------------
  343|     11|    FSINGLETONTLV(fuzz, TLV_TYPE_RTSP_TRANSPORT, CURLOPT_RTSP_TRANSPORT);
  ------------------
  |  |  506|      6|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 6, False: 204k]
  |  |  ------------------
  |  |  507|      6|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      6|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      6|        {                                                                     \
  |  |  |  |  |  |  491|      6|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      6|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      6|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|      5|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|      5|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|      5|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      5|        {                                                                     \
  |  |  |  |  |  |  481|      5|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      5|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      5|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      5|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      5|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|      5|          break
  ------------------
  344|     43|    FSINGLETONTLV(fuzz, TLV_TYPE_MAIL_AUTH, CURLOPT_MAIL_AUTH);
  ------------------
  |  |  506|     22|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 22, False: 204k]
  |  |  ------------------
  |  |  507|     22|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     22|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     22|        {                                                                     \
  |  |  |  |  |  |  491|     22|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 21]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     22|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     22|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     21|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     21|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     21|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     21|        {                                                                     \
  |  |  |  |  |  |  481|     21|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     21|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 21]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     21|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     21|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     21|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     21|          break
  ------------------
  345|    171|    FSINGLETONTLV(fuzz, TLV_TYPE_LOGIN_OPTIONS, CURLOPT_LOGIN_OPTIONS);
  ------------------
  |  |  506|     86|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 86, False: 204k]
  |  |  ------------------
  |  |  507|     86|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     86|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     86|        {                                                                     \
  |  |  |  |  |  |  491|     86|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 85]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     86|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     86|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     85|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     85|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     85|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     85|        {                                                                     \
  |  |  |  |  |  |  481|     85|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     85|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 85]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     85|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     85|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     85|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     85|          break
  ------------------
  346|    551|    FSINGLETONTLV(fuzz, TLV_TYPE_XOAUTH2_BEARER, CURLOPT_XOAUTH2_BEARER);
  ------------------
  |  |  506|    276|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 276, False: 204k]
  |  |  ------------------
  |  |  507|    276|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    276|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    276|        {                                                                     \
  |  |  |  |  |  |  491|    276|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 275]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    276|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    276|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    275|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    275|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    275|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    275|        {                                                                     \
  |  |  |  |  |  |  481|    275|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    275|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 275]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    275|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    275|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    275|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    275|          break
  ------------------
  347|    235|    FSINGLETONTLV(fuzz, TLV_TYPE_USERPWD, CURLOPT_USERPWD);
  ------------------
  |  |  506|    118|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 118, False: 204k]
  |  |  ------------------
  |  |  507|    118|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    118|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    118|        {                                                                     \
  |  |  |  |  |  |  491|    118|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 117]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    118|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    118|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    117|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    117|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    117|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    117|        {                                                                     \
  |  |  |  |  |  |  481|    117|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    117|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 117]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    117|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    117|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    117|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    117|          break
  ------------------
  348|  1.98k|    FSINGLETONTLV(fuzz, TLV_TYPE_USERAGENT, CURLOPT_USERAGENT);
  ------------------
  |  |  506|    992|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 992, False: 203k]
  |  |  ------------------
  |  |  507|    992|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    992|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    992|        {                                                                     \
  |  |  |  |  |  |  491|    992|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 991]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    992|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    992|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    991|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    991|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    991|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    991|        {                                                                     \
  |  |  |  |  |  |  481|    991|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    991|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 991]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    991|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    991|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    991|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    991|          break
  ------------------
  349|      8|    FSINGLETONTLV(fuzz, TLV_TYPE_SSH_HOST_PUBLIC_KEY_SHA256, CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256);
  ------------------
  |  |  506|      4|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 4, False: 204k]
  |  |  ------------------
  |  |  507|      4|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      4|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      4|        {                                                                     \
  |  |  |  |  |  |  491|      4|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 0, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      4|          {                                                                   \
  |  |  |  |  |  |  493|      0|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      0|          }                                                                   \
  |  |  |  |  |  |  496|      4|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|      4|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|      4|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|      4|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      4|        {                                                                     \
  |  |  |  |  |  |  481|      4|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      4|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 4, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      4|          {                                                                   \
  |  |  |  |  |  |  484|      4|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      4|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      4|          }                                                                   \
  |  |  |  |  |  |  487|      4|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      0|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|      0|          break
  ------------------
  350|  16.2k|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXY, CURLOPT_PROXY);
  ------------------
  |  |  506|  8.11k|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 8.11k, False: 196k]
  |  |  ------------------
  |  |  507|  8.11k|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|  8.11k|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|  8.11k|        {                                                                     \
  |  |  |  |  |  |  491|  8.11k|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 8.11k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|  8.11k|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|  8.11k|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|  8.11k|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|  8.11k|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|  8.11k|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|  8.11k|        {                                                                     \
  |  |  |  |  |  |  481|  8.11k|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|  8.11k|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 8.11k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|  8.11k|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|  8.11k|        }
  |  |  |  |  ------------------
  |  |  |  |  500|  8.11k|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|  8.11k|          break
  ------------------
  351|    805|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXYUSERPWD, CURLOPT_PROXYUSERPWD);
  ------------------
  |  |  506|    403|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 403, False: 204k]
  |  |  ------------------
  |  |  507|    403|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    403|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    403|        {                                                                     \
  |  |  |  |  |  |  491|    403|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 402]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    403|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    403|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    402|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    402|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    402|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    402|        {                                                                     \
  |  |  |  |  |  |  481|    402|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    402|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 2, False: 400]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    402|          {                                                                   \
  |  |  |  |  |  |  484|      2|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      2|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      2|          }                                                                   \
  |  |  |  |  |  |  487|    402|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    400|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    400|          break
  ------------------
  352|    345|    FSINGLETONTLV(fuzz, TLV_TYPE_REFERER, CURLOPT_REFERER);
  ------------------
  |  |  506|    173|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 173, False: 204k]
  |  |  ------------------
  |  |  507|    173|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    173|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    173|        {                                                                     \
  |  |  |  |  |  |  491|    173|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 172]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    173|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    173|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    172|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    172|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    172|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    172|        {                                                                     \
  |  |  |  |  |  |  481|    172|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    172|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 172]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    172|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    172|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    172|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    172|          break
  ------------------
  353|     47|    FSINGLETONTLV(fuzz, TLV_TYPE_FTPPORT, CURLOPT_FTPPORT);
  ------------------
  |  |  506|     24|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 24, False: 204k]
  |  |  ------------------
  |  |  507|     24|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     24|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     24|        {                                                                     \
  |  |  |  |  |  |  491|     24|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 23]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     24|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     24|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     23|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     23|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     23|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     23|        {                                                                     \
  |  |  |  |  |  |  481|     23|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     23|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 23]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     23|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     23|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     23|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     23|          break
  ------------------
  354|     61|    FSINGLETONTLV(fuzz, TLV_TYPE_SSLCERT, CURLOPT_SSLCERT);
  ------------------
  |  |  506|     31|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 31, False: 204k]
  |  |  ------------------
  |  |  507|     31|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     31|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     31|        {                                                                     \
  |  |  |  |  |  |  491|     31|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 30]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     31|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     31|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     30|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     30|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     30|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     30|        {                                                                     \
  |  |  |  |  |  |  481|     30|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     30|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 30]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     30|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     30|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     30|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     30|          break
  ------------------
  355|     13|    FSINGLETONTLV(fuzz, TLV_TYPE_KEYPASSWD, CURLOPT_KEYPASSWD);
  ------------------
  |  |  506|      7|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 7, False: 204k]
  |  |  ------------------
  |  |  507|      7|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      7|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      7|        {                                                                     \
  |  |  |  |  |  |  491|      7|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      7|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      7|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|      6|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|      6|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|      6|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      6|        {                                                                     \
  |  |  |  |  |  |  481|      6|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      6|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      6|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      6|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      6|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|      6|          break
  ------------------
  356|    383|    FSINGLETONTLV(fuzz, TLV_TYPE_INTERFACE, CURLOPT_INTERFACE);
  ------------------
  |  |  506|    192|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 192, False: 204k]
  |  |  ------------------
  |  |  507|    192|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    192|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    192|        {                                                                     \
  |  |  |  |  |  |  491|    192|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 191]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    192|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    192|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    191|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    191|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    191|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    191|        {                                                                     \
  |  |  |  |  |  |  481|    191|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    191|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 7, False: 184]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    191|          {                                                                   \
  |  |  |  |  |  |  484|      7|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      7|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      7|          }                                                                   \
  |  |  |  |  |  |  487|    191|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    184|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    184|          break
  ------------------
  357|      2|    FSINGLETONTLV(fuzz, TLV_TYPE_KRBLEVEL, CURLOPT_KRBLEVEL);
  ------------------
  |  |  506|      1|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 1, False: 204k]
  |  |  ------------------
  |  |  507|      1|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      1|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|        {                                                                     \
  |  |  |  |  |  |  491|      1|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|          {                                                                   \
  |  |  |  |  |  |  493|      0|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      0|          }                                                                   \
  |  |  |  |  |  |  496|      1|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|      1|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|      1|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|      1|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|        {                                                                     \
  |  |  |  |  |  |  481|      1|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      1|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|      1|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      0|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|      0|          break
  ------------------
  358|    309|    FSINGLETONTLV(fuzz, TLV_TYPE_CAINFO, CURLOPT_CAINFO);
  ------------------
  |  |  506|    155|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 155, False: 204k]
  |  |  ------------------
  |  |  507|    155|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    155|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    155|        {                                                                     \
  |  |  |  |  |  |  491|    155|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 154]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    155|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    155|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    154|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    154|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    154|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    154|        {                                                                     \
  |  |  |  |  |  |  481|    154|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    154|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 154]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    154|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    154|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    154|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    154|          break
  ------------------
  359|  1.83k|    FSINGLETONTLV(fuzz, TLV_TYPE_SSL_CIPHER_LIST, CURLOPT_SSL_CIPHER_LIST);
  ------------------
  |  |  506|    916|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 916, False: 203k]
  |  |  ------------------
  |  |  507|    916|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    916|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    916|        {                                                                     \
  |  |  |  |  |  |  491|    916|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 915]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    916|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    916|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    915|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    915|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    915|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    915|        {                                                                     \
  |  |  |  |  |  |  481|    915|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    915|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 915]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    915|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    915|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    915|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    915|          break
  ------------------
  360|     39|    FSINGLETONTLV(fuzz, TLV_TYPE_SSLCERTTYPE, CURLOPT_SSLCERTTYPE);
  ------------------
  |  |  506|     20|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 20, False: 204k]
  |  |  ------------------
  |  |  507|     20|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     20|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     20|        {                                                                     \
  |  |  |  |  |  |  491|     20|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 19]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     20|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     20|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     19|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     19|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     19|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     19|        {                                                                     \
  |  |  |  |  |  |  481|     19|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     19|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 19]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     19|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     19|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     19|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     19|          break
  ------------------
  361|     19|    FSINGLETONTLV(fuzz, TLV_TYPE_SSLKEY, CURLOPT_SSLKEY);
  ------------------
  |  |  506|     10|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 10, False: 204k]
  |  |  ------------------
  |  |  507|     10|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     10|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     10|        {                                                                     \
  |  |  |  |  |  |  491|     10|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     10|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     10|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|      9|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|      9|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|      9|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      9|        {                                                                     \
  |  |  |  |  |  |  481|      9|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      9|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      9|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      9|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      9|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|      9|          break
  ------------------
  362|     99|    FSINGLETONTLV(fuzz, TLV_TYPE_SSLKEYTYPE, CURLOPT_SSLKEYTYPE);
  ------------------
  |  |  506|     50|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 50, False: 204k]
  |  |  ------------------
  |  |  507|     50|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     50|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     50|        {                                                                     \
  |  |  |  |  |  |  491|     50|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 49]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     50|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     50|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     49|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     49|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     49|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     49|        {                                                                     \
  |  |  |  |  |  |  481|     49|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     49|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 49]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     49|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     49|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     49|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     49|          break
  ------------------
  363|  1.65k|    FSINGLETONTLV(fuzz, TLV_TYPE_SSLENGINE, CURLOPT_SSLENGINE);
  ------------------
  |  |  506|    828|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 828, False: 203k]
  |  |  ------------------
  |  |  507|    828|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    828|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    828|        {                                                                     \
  |  |  |  |  |  |  491|    828|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 827]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    828|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    828|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    827|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    827|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    827|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    827|        {                                                                     \
  |  |  |  |  |  |  481|    827|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    827|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 170, False: 657]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    827|          {                                                                   \
  |  |  |  |  |  |  484|    170|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|    170|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|    170|          }                                                                   \
  |  |  |  |  |  |  487|    827|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    657|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    657|          break
  ------------------
  364|    329|    FSINGLETONTLV(fuzz, TLV_TYPE_CAPATH, CURLOPT_CAPATH);
  ------------------
  |  |  506|    165|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 165, False: 204k]
  |  |  ------------------
  |  |  507|    165|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    165|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    165|        {                                                                     \
  |  |  |  |  |  |  491|    165|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 164]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    165|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    165|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    164|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    164|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    164|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    164|        {                                                                     \
  |  |  |  |  |  |  481|    164|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    164|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 164]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    164|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    164|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    164|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    164|          break
  ------------------
  365|    701|    FSINGLETONTLV(fuzz, TLV_TYPE_FTP_ACCOUNT, CURLOPT_FTP_ACCOUNT);
  ------------------
  |  |  506|    351|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 351, False: 204k]
  |  |  ------------------
  |  |  507|    351|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    351|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    351|        {                                                                     \
  |  |  |  |  |  |  491|    351|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 350]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    351|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    351|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    350|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    350|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    350|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    350|        {                                                                     \
  |  |  |  |  |  |  481|    350|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    350|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 350]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    350|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    350|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    350|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    350|          break
  ------------------
  366|  2.98k|    FSINGLETONTLV(fuzz, TLV_TYPE_COOKIELIST, CURLOPT_COOKIELIST);
  ------------------
  |  |  506|  1.49k|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 1.49k, False: 203k]
  |  |  ------------------
  |  |  507|  1.49k|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|  1.49k|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|  1.49k|        {                                                                     \
  |  |  |  |  |  |  491|  1.49k|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 1.49k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|  1.49k|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|  1.49k|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|  1.49k|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|  1.49k|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|  1.49k|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|  1.49k|        {                                                                     \
  |  |  |  |  |  |  481|  1.49k|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|  1.49k|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 1.49k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|  1.49k|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|  1.49k|        }
  |  |  |  |  ------------------
  |  |  |  |  500|  1.49k|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|  1.49k|          break
  ------------------
  367|     23|    FSINGLETONTLV(fuzz, TLV_TYPE_FTP_ALTERNATIVE_TO_USER, CURLOPT_FTP_ALTERNATIVE_TO_USER);
  ------------------
  |  |  506|     12|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 12, False: 204k]
  |  |  ------------------
  |  |  507|     12|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     12|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     12|        {                                                                     \
  |  |  |  |  |  |  491|     12|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 11]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     12|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     12|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     11|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     11|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     11|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     11|        {                                                                     \
  |  |  |  |  |  |  481|     11|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     11|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 11]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     11|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     11|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     11|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     11|          break
  ------------------
  368|      2|    FSINGLETONTLV(fuzz, TLV_TYPE_SSH_PUBLIC_KEYFILE, CURLOPT_SSH_PUBLIC_KEYFILE);
  ------------------
  |  |  506|      1|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 1, False: 204k]
  |  |  ------------------
  |  |  507|      1|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      1|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|        {                                                                     \
  |  |  |  |  |  |  491|      1|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|          {                                                                   \
  |  |  |  |  |  |  493|      0|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      0|          }                                                                   \
  |  |  |  |  |  |  496|      1|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|      1|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|      1|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|      1|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|        {                                                                     \
  |  |  |  |  |  |  481|      1|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      1|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|      1|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      0|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|      0|          break
  ------------------
  369|      2|    FSINGLETONTLV(fuzz, TLV_TYPE_SSH_PRIVATE_KEYFILE, CURLOPT_SSH_PRIVATE_KEYFILE);
  ------------------
  |  |  506|      1|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 1, False: 204k]
  |  |  ------------------
  |  |  507|      1|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      1|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|        {                                                                     \
  |  |  |  |  |  |  491|      1|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|          {                                                                   \
  |  |  |  |  |  |  493|      0|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      0|          }                                                                   \
  |  |  |  |  |  |  496|      1|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|      1|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|      1|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|      1|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|        {                                                                     \
  |  |  |  |  |  |  481|      1|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      1|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|      1|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      0|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|      0|          break
  ------------------
  370|      2|    FSINGLETONTLV(fuzz, TLV_TYPE_SSH_HOST_PUBLIC_KEY_MD5, CURLOPT_SSH_HOST_PUBLIC_KEY_MD5);
  ------------------
  |  |  506|      1|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 1, False: 204k]
  |  |  ------------------
  |  |  507|      1|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      1|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|        {                                                                     \
  |  |  |  |  |  |  491|      1|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|          {                                                                   \
  |  |  |  |  |  |  493|      0|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      0|          }                                                                   \
  |  |  |  |  |  |  496|      1|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|      1|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|      1|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|      1|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|        {                                                                     \
  |  |  |  |  |  |  481|      1|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      1|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|      1|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      0|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|      0|          break
  ------------------
  371|     37|    FSINGLETONTLV(fuzz, TLV_TYPE_ISSUERCERT, CURLOPT_ISSUERCERT);
  ------------------
  |  |  506|     19|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 19, False: 204k]
  |  |  ------------------
  |  |  507|     19|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     19|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     19|        {                                                                     \
  |  |  |  |  |  |  491|     19|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 18]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     19|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     19|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     18|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     18|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     18|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     18|        {                                                                     \
  |  |  |  |  |  |  481|     18|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     18|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 18]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     18|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     18|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     18|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     18|          break
  ------------------
  372|     43|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXYUSERNAME, CURLOPT_PROXYUSERNAME);
  ------------------
  |  |  506|     22|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 22, False: 204k]
  |  |  ------------------
  |  |  507|     22|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     22|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     22|        {                                                                     \
  |  |  |  |  |  |  491|     22|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 21]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     22|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     22|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     21|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     21|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     21|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     21|        {                                                                     \
  |  |  |  |  |  |  481|     21|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     21|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 21]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     21|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     21|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     21|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     21|          break
  ------------------
  373|     57|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXYPASSWORD, CURLOPT_PROXYPASSWORD);
  ------------------
  |  |  506|     29|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 29, False: 204k]
  |  |  ------------------
  |  |  507|     29|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     29|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     29|        {                                                                     \
  |  |  |  |  |  |  491|     29|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 28]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     29|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     29|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     28|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     28|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     28|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     28|        {                                                                     \
  |  |  |  |  |  |  481|     28|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     28|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 28]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     28|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     28|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     28|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     28|          break
  ------------------
  374|    589|    FSINGLETONTLV(fuzz, TLV_TYPE_NOPROXY, CURLOPT_NOPROXY);
  ------------------
  |  |  506|    295|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 295, False: 204k]
  |  |  ------------------
  |  |  507|    295|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    295|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    295|        {                                                                     \
  |  |  |  |  |  |  491|    295|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 294]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    295|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    295|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    294|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    294|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    294|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    294|        {                                                                     \
  |  |  |  |  |  |  481|    294|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    294|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 294]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    294|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    294|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    294|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    294|          break
  ------------------
  375|      2|    FSINGLETONTLV(fuzz, TLV_TYPE_SSH_KNOWNHOSTS, CURLOPT_SSH_KNOWNHOSTS);
  ------------------
  |  |  506|      1|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 1, False: 204k]
  |  |  ------------------
  |  |  507|      1|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      1|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|        {                                                                     \
  |  |  |  |  |  |  491|      1|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|          {                                                                   \
  |  |  |  |  |  |  493|      0|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      0|          }                                                                   \
  |  |  |  |  |  |  496|      1|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|      1|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|      1|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|      1|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|        {                                                                     \
  |  |  |  |  |  |  481|      1|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      1|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|      1|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      0|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|      0|          break
  ------------------
  376|     25|    FSINGLETONTLV(fuzz, TLV_TYPE_TLSAUTH_USERNAME, CURLOPT_TLSAUTH_USERNAME);
  ------------------
  |  |  506|     13|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 13, False: 204k]
  |  |  ------------------
  |  |  507|     13|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     13|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     13|        {                                                                     \
  |  |  |  |  |  |  491|     13|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 12]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     13|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     13|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     12|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     12|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     12|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     12|        {                                                                     \
  |  |  |  |  |  |  481|     12|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     12|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 12]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     12|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     12|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     12|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     12|          break
  ------------------
  377|     21|    FSINGLETONTLV(fuzz, TLV_TYPE_TLSAUTH_PASSWORD, CURLOPT_TLSAUTH_PASSWORD);
  ------------------
  |  |  506|     11|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 11, False: 204k]
  |  |  ------------------
  |  |  507|     11|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     11|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     11|        {                                                                     \
  |  |  |  |  |  |  491|     11|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 10]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     11|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     11|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     10|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     10|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     10|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     10|        {                                                                     \
  |  |  |  |  |  |  481|     10|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     10|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 10]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     10|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     10|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     10|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     10|          break
  ------------------
  378|      9|    FSINGLETONTLV(fuzz, TLV_TYPE_TLSAUTH_TYPE, CURLOPT_TLSAUTH_TYPE);
  ------------------
  |  |  506|      5|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 5, False: 204k]
  |  |  ------------------
  |  |  507|      5|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      5|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      5|        {                                                                     \
  |  |  |  |  |  |  491|      5|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      5|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      5|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|      4|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|      4|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|      4|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      4|        {                                                                     \
  |  |  |  |  |  |  481|      4|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      4|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 2, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      4|          {                                                                   \
  |  |  |  |  |  |  484|      2|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      2|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      2|          }                                                                   \
  |  |  |  |  |  |  487|      4|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      2|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|      2|          break
  ------------------
  379|      2|    FSINGLETONTLV(fuzz, TLV_TYPE_DNS_SERVERS, CURLOPT_DNS_SERVERS);
  ------------------
  |  |  506|      1|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 1, False: 204k]
  |  |  ------------------
  |  |  507|      1|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      1|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|        {                                                                     \
  |  |  |  |  |  |  491|      1|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|          {                                                                   \
  |  |  |  |  |  |  493|      0|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      0|          }                                                                   \
  |  |  |  |  |  |  496|      1|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|      1|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|      1|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|      1|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|        {                                                                     \
  |  |  |  |  |  |  481|      1|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      1|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|      1|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      0|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|      0|          break
  ------------------
  380|      2|    FSINGLETONTLV(fuzz, TLV_TYPE_DNS_INTERFACE, CURLOPT_DNS_INTERFACE);
  ------------------
  |  |  506|      1|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 1, False: 204k]
  |  |  ------------------
  |  |  507|      1|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      1|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|        {                                                                     \
  |  |  |  |  |  |  491|      1|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|          {                                                                   \
  |  |  |  |  |  |  493|      0|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      0|          }                                                                   \
  |  |  |  |  |  |  496|      1|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|      1|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|      1|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|      1|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|        {                                                                     \
  |  |  |  |  |  |  481|      1|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      1|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|      1|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      0|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|      0|          break
  ------------------
  381|      2|    FSINGLETONTLV(fuzz, TLV_TYPE_DNS_LOCAL_IP4, CURLOPT_DNS_LOCAL_IP4);
  ------------------
  |  |  506|      1|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 1, False: 204k]
  |  |  ------------------
  |  |  507|      1|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      1|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|        {                                                                     \
  |  |  |  |  |  |  491|      1|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|          {                                                                   \
  |  |  |  |  |  |  493|      0|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      0|          }                                                                   \
  |  |  |  |  |  |  496|      1|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|      1|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|      1|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|      1|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|        {                                                                     \
  |  |  |  |  |  |  481|      1|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      1|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|      1|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      0|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|      0|          break
  ------------------
  382|      2|    FSINGLETONTLV(fuzz, TLV_TYPE_DNS_LOCAL_IP6, CURLOPT_DNS_LOCAL_IP6);
  ------------------
  |  |  506|      1|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 1, False: 204k]
  |  |  ------------------
  |  |  507|      1|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      1|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|        {                                                                     \
  |  |  |  |  |  |  491|      1|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|          {                                                                   \
  |  |  |  |  |  |  493|      0|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      0|          }                                                                   \
  |  |  |  |  |  |  496|      1|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|      1|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|      1|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|      1|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|        {                                                                     \
  |  |  |  |  |  |  481|      1|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      1|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|      1|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      0|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|      0|          break
  ------------------
  383|    121|    FSINGLETONTLV(fuzz, TLV_TYPE_PINNEDPUBLICKEY, CURLOPT_PINNEDPUBLICKEY);
  ------------------
  |  |  506|     61|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 61, False: 204k]
  |  |  ------------------
  |  |  507|     61|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     61|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     61|        {                                                                     \
  |  |  |  |  |  |  491|     61|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 60]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     61|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     61|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     60|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     60|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     60|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     60|        {                                                                     \
  |  |  |  |  |  |  481|     60|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     60|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 60]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     60|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     60|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     60|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     60|          break
  ------------------
  384|    189|    FSINGLETONTLV(fuzz, TLV_TYPE_UNIX_SOCKET_PATH, CURLOPT_UNIX_SOCKET_PATH);
  ------------------
  |  |  506|     95|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 95, False: 204k]
  |  |  ------------------
  |  |  507|     95|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     95|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     95|        {                                                                     \
  |  |  |  |  |  |  491|     95|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 94]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     95|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     95|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     94|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     94|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     94|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     94|        {                                                                     \
  |  |  |  |  |  |  481|     94|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     94|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 94]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     94|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     94|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     94|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     94|          break
  ------------------
  385|     45|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXY_SERVICE_NAME, CURLOPT_PROXY_SERVICE_NAME);
  ------------------
  |  |  506|     23|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 23, False: 204k]
  |  |  ------------------
  |  |  507|     23|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     23|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     23|        {                                                                     \
  |  |  |  |  |  |  491|     23|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 22]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     23|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     23|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     22|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     22|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     22|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     22|        {                                                                     \
  |  |  |  |  |  |  481|     22|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     22|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 22]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     22|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     22|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     22|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     22|          break
  ------------------
  386|     39|    FSINGLETONTLV(fuzz, TLV_TYPE_SERVICE_NAME, CURLOPT_SERVICE_NAME);
  ------------------
  |  |  506|     20|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 20, False: 204k]
  |  |  ------------------
  |  |  507|     20|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     20|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     20|        {                                                                     \
  |  |  |  |  |  |  491|     20|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 19]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     20|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     20|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     19|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     19|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     19|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     19|        {                                                                     \
  |  |  |  |  |  |  481|     19|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     19|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 19]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     19|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     19|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     19|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     19|          break
  ------------------
  387|    117|    FSINGLETONTLV(fuzz, TLV_TYPE_DEFAULT_PROTOCOL, CURLOPT_DEFAULT_PROTOCOL);
  ------------------
  |  |  506|     59|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 59, False: 204k]
  |  |  ------------------
  |  |  507|     59|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     59|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     59|        {                                                                     \
  |  |  |  |  |  |  491|     59|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 58]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     59|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     59|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     58|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     58|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     58|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     58|        {                                                                     \
  |  |  |  |  |  |  481|     58|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     58|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 58]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     58|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     58|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     58|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     58|          break
  ------------------
  388|     43|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXY_CAINFO, CURLOPT_PROXY_CAINFO);
  ------------------
  |  |  506|     22|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 22, False: 204k]
  |  |  ------------------
  |  |  507|     22|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     22|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     22|        {                                                                     \
  |  |  |  |  |  |  491|     22|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 21]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     22|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     22|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     21|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     21|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     21|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     21|        {                                                                     \
  |  |  |  |  |  |  481|     21|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     21|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 21]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     21|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     21|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     21|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     21|          break
  ------------------
  389|     49|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXY_CAPATH, CURLOPT_PROXY_CAPATH);
  ------------------
  |  |  506|     25|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 25, False: 204k]
  |  |  ------------------
  |  |  507|     25|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     25|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     25|        {                                                                     \
  |  |  |  |  |  |  491|     25|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 24]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     25|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     25|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     24|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     24|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     24|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     24|        {                                                                     \
  |  |  |  |  |  |  481|     24|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     24|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 24]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     24|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     24|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     24|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     24|          break
  ------------------
  390|     39|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXY_TLSAUTH_USERNAME, CURLOPT_PROXY_TLSAUTH_USERNAME);
  ------------------
  |  |  506|     20|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 20, False: 204k]
  |  |  ------------------
  |  |  507|     20|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     20|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     20|        {                                                                     \
  |  |  |  |  |  |  491|     20|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 19]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     20|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     20|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     19|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     19|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     19|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     19|        {                                                                     \
  |  |  |  |  |  |  481|     19|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     19|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 19]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     19|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     19|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     19|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     19|          break
  ------------------
  391|      9|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXY_TLSAUTH_PASSWORD, CURLOPT_PROXY_TLSAUTH_PASSWORD);
  ------------------
  |  |  506|      5|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 5, False: 204k]
  |  |  ------------------
  |  |  507|      5|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      5|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      5|        {                                                                     \
  |  |  |  |  |  |  491|      5|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      5|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      5|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|      4|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|      4|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|      4|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      4|        {                                                                     \
  |  |  |  |  |  |  481|      4|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      4|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      4|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      4|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      4|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|      4|          break
  ------------------
  392|      7|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXY_TLSAUTH_TYPE, CURLOPT_PROXY_TLSAUTH_TYPE);
  ------------------
  |  |  506|      4|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 4, False: 204k]
  |  |  ------------------
  |  |  507|      4|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      4|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      4|        {                                                                     \
  |  |  |  |  |  |  491|      4|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      4|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|      4|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|      3|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|      3|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|      3|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      3|        {                                                                     \
  |  |  |  |  |  |  481|      3|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      3|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      3|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|      3|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      2|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|      2|          break
  ------------------
  393|     43|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXY_SSLCERT, CURLOPT_PROXY_SSLCERT);
  ------------------
  |  |  506|     22|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 22, False: 204k]
  |  |  ------------------
  |  |  507|     22|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     22|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     22|        {                                                                     \
  |  |  |  |  |  |  491|     22|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 21]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     22|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     22|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     21|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     21|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     21|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     21|        {                                                                     \
  |  |  |  |  |  |  481|     21|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     21|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 21]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     21|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     21|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     21|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     21|          break
  ------------------
  394|     25|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXY_SSLCERTTYPE, CURLOPT_PROXY_SSLCERTTYPE);
  ------------------
  |  |  506|     13|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 13, False: 204k]
  |  |  ------------------
  |  |  507|     13|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     13|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     13|        {                                                                     \
  |  |  |  |  |  |  491|     13|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 12]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     13|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     13|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     12|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     12|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     12|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     12|        {                                                                     \
  |  |  |  |  |  |  481|     12|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     12|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 12]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     12|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     12|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     12|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     12|          break
  ------------------
  395|     19|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXY_SSLKEY, CURLOPT_PROXY_SSLKEY);
  ------------------
  |  |  506|     10|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 10, False: 204k]
  |  |  ------------------
  |  |  507|     10|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     10|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     10|        {                                                                     \
  |  |  |  |  |  |  491|     10|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     10|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     10|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|      9|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|      9|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|      9|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      9|        {                                                                     \
  |  |  |  |  |  |  481|      9|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      9|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      9|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|      9|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      9|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|      9|          break
  ------------------
  396|     41|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXY_SSLKEYTYPE, CURLOPT_PROXY_SSLKEYTYPE);
  ------------------
  |  |  506|     21|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 21, False: 204k]
  |  |  ------------------
  |  |  507|     21|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     21|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     21|        {                                                                     \
  |  |  |  |  |  |  491|     21|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 20]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     21|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     21|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     20|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     20|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     20|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     20|        {                                                                     \
  |  |  |  |  |  |  481|     20|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     20|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 20]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     20|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     20|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     20|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     20|          break
  ------------------
  397|     37|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXY_KEYPASSWD, CURLOPT_PROXY_KEYPASSWD);
  ------------------
  |  |  506|     19|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 19, False: 204k]
  |  |  ------------------
  |  |  507|     19|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     19|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     19|        {                                                                     \
  |  |  |  |  |  |  491|     19|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 18]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     19|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     19|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     18|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     18|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     18|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     18|        {                                                                     \
  |  |  |  |  |  |  481|     18|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     18|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 18]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     18|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     18|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     18|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     18|          break
  ------------------
  398|    185|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXY_SSL_CIPHER_LIST, CURLOPT_PROXY_SSL_CIPHER_LIST);
  ------------------
  |  |  506|     93|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 93, False: 204k]
  |  |  ------------------
  |  |  507|     93|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     93|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     93|        {                                                                     \
  |  |  |  |  |  |  491|     93|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 92]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     93|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     93|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     92|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     92|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     92|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     92|        {                                                                     \
  |  |  |  |  |  |  481|     92|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     92|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 92]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     92|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     92|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     92|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     92|          break
  ------------------
  399|     65|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXY_CRLFILE, CURLOPT_PROXY_CRLFILE);
  ------------------
  |  |  506|     33|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 33, False: 204k]
  |  |  ------------------
  |  |  507|     33|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     33|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     33|        {                                                                     \
  |  |  |  |  |  |  491|     33|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 32]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     33|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     33|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     32|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     32|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     32|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     32|        {                                                                     \
  |  |  |  |  |  |  481|     32|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     32|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 32]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     32|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     32|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     32|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     32|          break
  ------------------
  400|    883|    FSINGLETONTLV(fuzz, TLV_TYPE_PRE_PROXY, CURLOPT_PRE_PROXY);
  ------------------
  |  |  506|    442|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 442, False: 204k]
  |  |  ------------------
  |  |  507|    442|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    442|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    442|        {                                                                     \
  |  |  |  |  |  |  491|    442|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 441]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    442|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    442|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    441|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    441|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    441|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    441|        {                                                                     \
  |  |  |  |  |  |  481|    441|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    441|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 441]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    441|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    441|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    441|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    441|          break
  ------------------
  401|     65|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXY_PINNEDPUBLICKEY, CURLOPT_PROXY_PINNEDPUBLICKEY);
  ------------------
  |  |  506|     33|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 33, False: 204k]
  |  |  ------------------
  |  |  507|     33|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     33|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     33|        {                                                                     \
  |  |  |  |  |  |  491|     33|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 32]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     33|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     33|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     32|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     32|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     32|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     32|        {                                                                     \
  |  |  |  |  |  |  481|     32|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     32|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 32]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     32|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     32|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     32|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     32|          break
  ------------------
  402|     27|    FSINGLETONTLV(fuzz, TLV_TYPE_ABSTRACT_UNIX_SOCKET, CURLOPT_ABSTRACT_UNIX_SOCKET);
  ------------------
  |  |  506|     14|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 14, False: 204k]
  |  |  ------------------
  |  |  507|     14|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     14|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     14|        {                                                                     \
  |  |  |  |  |  |  491|     14|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 13]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     14|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     14|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     13|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     13|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     13|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     13|        {                                                                     \
  |  |  |  |  |  |  481|     13|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     13|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 13]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     13|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     13|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     13|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     13|          break
  ------------------
  403|    175|    FSINGLETONTLV(fuzz, TLV_TYPE_REQUEST_TARGET, CURLOPT_REQUEST_TARGET);
  ------------------
  |  |  506|     88|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 88, False: 204k]
  |  |  ------------------
  |  |  507|     88|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     88|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     88|        {                                                                     \
  |  |  |  |  |  |  491|     88|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 87]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     88|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     88|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     87|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     87|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     87|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     87|        {                                                                     \
  |  |  |  |  |  |  481|     87|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     87|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 87]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     87|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     87|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     87|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     87|          break
  ------------------
  404|    407|    FSINGLETONTLV(fuzz, TLV_TYPE_TLS13_CIPHERS, CURLOPT_TLS13_CIPHERS);
  ------------------
  |  |  506|    204|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 204, False: 204k]
  |  |  ------------------
  |  |  507|    204|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    204|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    204|        {                                                                     \
  |  |  |  |  |  |  491|    204|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 203]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    204|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    204|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    203|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    203|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    203|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    203|        {                                                                     \
  |  |  |  |  |  |  481|    203|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    203|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 203]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    203|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    203|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    203|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    203|          break
  ------------------
  405|     41|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXY_TLS13_CIPHERS, CURLOPT_PROXY_TLS13_CIPHERS);
  ------------------
  |  |  506|     21|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 21, False: 204k]
  |  |  ------------------
  |  |  507|     21|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     21|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     21|        {                                                                     \
  |  |  |  |  |  |  491|     21|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 20]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     21|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     21|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     20|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     20|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     20|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     20|        {                                                                     \
  |  |  |  |  |  |  481|     20|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     20|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 20]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     20|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     20|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     20|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     20|          break
  ------------------
  406|    203|    FSINGLETONTLV(fuzz, TLV_TYPE_SASL_AUTHZID, CURLOPT_SASL_AUTHZID);
  ------------------
  |  |  506|    102|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 102, False: 204k]
  |  |  ------------------
  |  |  507|    102|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    102|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    102|        {                                                                     \
  |  |  |  |  |  |  491|    102|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 101]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    102|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    102|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    101|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    101|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    101|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    101|        {                                                                     \
  |  |  |  |  |  |  481|    101|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    101|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 101]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    101|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    101|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    101|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    101|          break
  ------------------
  407|     25|    FSINGLETONTLV(fuzz, TLV_TYPE_PROXY_ISSUERCERT, CURLOPT_PROXY_ISSUERCERT);
  ------------------
  |  |  506|     13|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 13, False: 204k]
  |  |  ------------------
  |  |  507|     13|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     13|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     13|        {                                                                     \
  |  |  |  |  |  |  491|     13|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 12]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     13|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     13|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     12|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     12|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     12|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     12|        {                                                                     \
  |  |  |  |  |  |  481|     12|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     12|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 12]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     12|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     12|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     12|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     12|          break
  ------------------
  408|    921|    FSINGLETONTLV(fuzz, TLV_TYPE_SSL_EC_CURVES, CURLOPT_SSL_EC_CURVES);
  ------------------
  |  |  506|    461|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 461, False: 204k]
  |  |  ------------------
  |  |  507|    461|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|    461|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|    461|        {                                                                     \
  |  |  |  |  |  |  491|    461|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 460]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|    461|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|    461|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|    460|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|    460|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|    460|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|    460|        {                                                                     \
  |  |  |  |  |  |  481|    460|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|    460|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 460]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|    460|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|    460|        }
  |  |  |  |  ------------------
  |  |  |  |  500|    460|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|    460|          break
  ------------------
  409|  2.32k|    FSINGLETONTLV(fuzz, TLV_TYPE_AWS_SIGV4, CURLOPT_AWS_SIGV4);
  ------------------
  |  |  506|  1.16k|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 1.16k, False: 203k]
  |  |  ------------------
  |  |  507|  1.16k|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|  1.16k|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|  1.16k|        {                                                                     \
  |  |  |  |  |  |  491|  1.16k|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 1.16k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|  1.16k|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|  1.16k|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|  1.16k|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|  1.16k|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|  1.16k|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|  1.16k|        {                                                                     \
  |  |  |  |  |  |  481|  1.16k|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|  1.16k|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 1.16k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|  1.16k|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|  1.16k|        }
  |  |  |  |  ------------------
  |  |  |  |  500|  1.16k|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|  1.16k|          break
  ------------------
  410|     75|    FSINGLETONTLV(fuzz, TLV_TYPE_REDIR_PROTOCOLS_STR, CURLOPT_REDIR_PROTOCOLS_STR);
  ------------------
  |  |  506|     38|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 38, False: 204k]
  |  |  ------------------
  |  |  507|     38|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     38|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     38|        {                                                                     \
  |  |  |  |  |  |  491|     38|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 37]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     38|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     38|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     37|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     37|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     37|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     37|        {                                                                     \
  |  |  |  |  |  |  481|     37|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     37|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 29, False: 8]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     37|          {                                                                   \
  |  |  |  |  |  |  484|     29|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|     29|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|     29|          }                                                                   \
  |  |  |  |  |  |  487|     37|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      8|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|      8|          break
  ------------------
  411|    179|    FSINGLETONTLV(fuzz, TLV_TYPE_HAPROXY_CLIENT_IP, CURLOPT_HAPROXY_CLIENT_IP);
  ------------------
  |  |  506|     90|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 90, False: 204k]
  |  |  ------------------
  |  |  507|     90|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|     90|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|     90|        {                                                                     \
  |  |  |  |  |  |  491|     90|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 1, False: 89]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|     90|          {                                                                   \
  |  |  |  |  |  |  493|      1|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      1|          }                                                                   \
  |  |  |  |  |  |  496|     90|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|     89|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|     89|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|     89|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|     89|        {                                                                     \
  |  |  |  |  |  |  481|     89|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|     89|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 0, False: 89]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|     89|          {                                                                   \
  |  |  |  |  |  |  484|      0|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      0|          }                                                                   \
  |  |  |  |  |  |  487|     89|        }
  |  |  |  |  ------------------
  |  |  |  |  500|     89|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|     89|          break
  ------------------
  412|      2|    FSINGLETONTLV(fuzz, TLV_TYPE_ECH, CURLOPT_ECH);
  ------------------
  |  |  506|      1|        case TLVNAME:                                                         \
  |  |  ------------------
  |  |  |  Branch (506:9): [True: 1, False: 204k]
  |  |  ------------------
  |  |  507|      1|          FCHECK_OPTION_UNSET(FUZZP, OPTNAME);                                \
  |  |  ------------------
  |  |  |  |  503|      1|        FCHECK((FUZZP)->options[OPTNAME % 1000] == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |  490|      1|        {                                                                     \
  |  |  |  |  |  |  491|      1|          if (!(COND))                                                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (491:15): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  492|      1|          {                                                                   \
  |  |  |  |  |  |  493|      0|            rc = 255;                                                         \
  |  |  |  |  |  |  494|      0|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  495|      0|          }                                                                   \
  |  |  |  |  |  |  496|      1|        }
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  508|      1|          tmp = fuzz_tlv_to_string(tlv);                                      \
  |  |  509|      1|          FSET_OPTION(FUZZP, OPTNAME, tmp);                                   \
  |  |  ------------------
  |  |  |  |  499|      1|        FTRY(curl_easy_setopt((FUZZP)->easy, OPTNAME, OPTVALUE));             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  480|      1|        {                                                                     \
  |  |  |  |  |  |  481|      1|          int _func_rc = (FUNC);                                              \
  |  |  |  |  |  |  482|      1|          if (_func_rc)                                                       \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (482:15): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  483|      1|          {                                                                   \
  |  |  |  |  |  |  484|      1|            rc = _func_rc;                                                    \
  |  |  |  |  |  |  485|      1|            goto EXIT_LABEL;                                                  \
  |  |  |  |  |  |  486|      1|          }                                                                   \
  |  |  |  |  |  |  487|      1|        }
  |  |  |  |  ------------------
  |  |  |  |  500|      0|        (FUZZP)->options[OPTNAME % 1000] = 1
  |  |  ------------------
  |  |  510|      0|          break
  ------------------
  413|     39|    default:
  ------------------
  |  Branch (413:5): [True: 39, False: 204k]
  ------------------
  414|       |      /* The fuzzer generates lots of unknown TLVs - we don't want these in the
  415|       |         corpus so we reject any unknown TLVs. */
  416|     39|      rc = 127;
  417|     39|      goto EXIT_LABEL;
  418|      0|      break;
  419|   204k|  }
  420|       |
  421|   203k|  rc = 0;
  422|       |
  423|   204k|EXIT_LABEL:
  424|       |
  425|   204k|  fuzz_free((void **)&tmp);
  426|       |
  427|   204k|  return rc;
  428|   203k|}
_Z18fuzz_tlv_to_stringP3tlv:
  434|  49.3k|{
  435|  49.3k|  char *tlvstr;
  436|       |
  437|       |  /* Allocate enough space, plus a null terminator */
  438|  49.3k|  tlvstr = (char *)malloc(tlv->length + 1);
  439|       |
  440|  49.3k|  if(tlvstr != NULL) {
  ------------------
  |  Branch (440:6): [True: 49.3k, False: 0]
  ------------------
  441|  49.3k|    memcpy(tlvstr, tlv->value, tlv->length);
  442|  49.3k|    tlvstr[tlv->length] = 0;
  443|  49.3k|  }
  444|       |
  445|  49.3k|  return tlvstr;
  446|  49.3k|}
_Z20fuzz_setup_http_postP9fuzz_dataP3tlv:
  450|    158|{
  451|    158|  if (fuzz->httppost == NULL) {
  ------------------
  |  Branch (451:7): [True: 158, False: 0]
  ------------------
  452|    158|    struct curl_httppost *post = NULL;
  453|    158|    struct curl_httppost *last = NULL;
  454|       |
  455|    158|    fuzz->post_body = fuzz_tlv_to_string(tlv);
  456|    158|    if (fuzz->post_body == NULL) {
  ------------------
  |  Branch (456:9): [True: 0, False: 158]
  ------------------
  457|      0|      return;
  458|      0|    }
  459|       |
  460|       |    /* This is just one of several possible entrypoints to
  461|       |     * the HTTPPOST API. see https://curl.se/libcurl/c/curl_formadd.html
  462|       |     * for lots of others which could be added here.
  463|       |     */
  464|    158|    curl_formadd(&post, &last,
  465|    158|                 CURLFORM_COPYNAME, FUZZ_HTTPPOST_NAME,
  ------------------
  |  |  277|    158|#define FUZZ_HTTPPOST_NAME              "test"
  ------------------
  466|    158|                 CURLFORM_PTRCONTENTS, fuzz->post_body,
  467|    158|                 CURLFORM_CONTENTLEN, (curl_off_t) strlen(fuzz->post_body),
  468|    158|                 CURLFORM_END);
  469|       |
  470|    158|    fuzz->last_post_part = last;
  471|    158|    fuzz->httppost = post;
  472|    158|  }
  473|       |
  474|    158|  return;
  475|    158|}
_Z18fuzz_add_mime_partP3tlvP13curl_mimepart:
  481|   124k|{
  482|   124k|  FUZZ_DATA part_fuzz;
  483|   124k|  TLV tlv;
  484|   124k|  int rc = 0;
  485|   124k|  int tlv_rc;
  486|       |
  487|   124k|  memset(&part_fuzz, 0, sizeof(FUZZ_DATA));
  488|       |
  489|   124k|  if(src_tlv->length < sizeof(TLV_RAW)) {
  ------------------
  |  Branch (489:6): [True: 122k, False: 2.49k]
  ------------------
  490|       |    /* Not enough data for a single TLV - don't continue */
  491|   122k|    goto EXIT_LABEL;
  492|   122k|  }
  493|       |
  494|       |  /* Set up the state parser */
  495|  2.49k|  part_fuzz.state.data = src_tlv->value;
  496|  2.49k|  part_fuzz.state.data_len = src_tlv->length;
  497|       |
  498|  2.49k|  for(tlv_rc = fuzz_get_first_tlv(&part_fuzz, &tlv);
  499|  3.82k|      tlv_rc == 0;
  ------------------
  |  Branch (499:7): [True: 1.77k, False: 2.05k]
  ------------------
  500|  2.49k|      tlv_rc = fuzz_get_next_tlv(&part_fuzz, &tlv)) {
  501|       |
  502|       |    /* Have the TLV in hand. Parse the TLV. */
  503|  1.77k|    rc = fuzz_parse_mime_tlv(part, &tlv);
  504|       |
  505|  1.77k|    if(rc != 0) {
  ------------------
  |  Branch (505:8): [True: 443, False: 1.33k]
  ------------------
  506|       |      /* Failed to parse the TLV. Can't continue. */
  507|    443|      goto EXIT_LABEL;
  508|    443|    }
  509|  1.77k|  }
  510|       |
  511|  2.05k|  if(tlv_rc != TLV_RC_NO_MORE_TLVS) {
  ------------------
  |  |  267|  2.05k|#define TLV_RC_NO_MORE_TLVS             1
  ------------------
  |  Branch (511:6): [True: 1.53k, False: 520]
  ------------------
  512|       |    /* A TLV call failed. Can't continue. */
  513|  1.53k|    goto EXIT_LABEL;
  514|  1.53k|  }
  515|       |
  516|   124k|EXIT_LABEL:
  517|       |
  518|   124k|  return(rc);
  519|  2.05k|}
_Z19fuzz_parse_mime_tlvP13curl_mimepartP3tlv:
  525|  1.77k|{
  526|  1.77k|  int rc;
  527|  1.77k|  char *tmp;
  528|       |
  529|  1.77k|  switch(tlv->type) {
  530|    468|    case TLV_TYPE_MIME_PART_NAME:
  ------------------
  |  |   42|    468|#define TLV_TYPE_MIME_PART_NAME                 14
  ------------------
  |  Branch (530:5): [True: 468, False: 1.30k]
  ------------------
  531|    468|      tmp = fuzz_tlv_to_string(tlv);
  532|    468|      curl_mime_name(part, tmp);
  533|    468|      fuzz_free((void **)&tmp);
  534|    468|      break;
  535|       |
  536|    866|    case TLV_TYPE_MIME_PART_DATA:
  ------------------
  |  |   43|    866|#define TLV_TYPE_MIME_PART_DATA                 15
  ------------------
  |  Branch (536:5): [True: 866, False: 911]
  ------------------
  537|    866|      curl_mime_data(part, (const char *)tlv->value, tlv->length);
  538|    866|      break;
  539|       |
  540|    443|    default:
  ------------------
  |  Branch (540:5): [True: 443, False: 1.33k]
  ------------------
  541|       |      /* The fuzzer generates lots of unknown TLVs - we don't want these in the
  542|       |         corpus so we reject any unknown TLVs. */
  543|    443|      rc = 255;
  544|    443|      goto EXIT_LABEL;
  545|      0|      break;
  546|  1.77k|  }
  547|       |
  548|  1.33k|  rc = 0;
  549|       |
  550|  1.77k|EXIT_LABEL:
  551|       |
  552|  1.77k|  return rc;
  553|  1.33k|}

